[pyferret] 01/110: Upstream 1.0.2

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jul 28 08:41:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository pyferret.

commit 5fd5d650df36dd4770b02abc3924f11bacef1303
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon Nov 10 15:34:58 2014 +0000

    Upstream 1.0.2
---
 IFDEF_DESCRIPTION                                  |    97 +
 Makefile                                           |   123 +
 README_build_ferret                                |    66 +
 bench/123456789000101_100101_test_numeric.nc       |   Bin 0 -> 972 bytes
 bench/6dfile.nc                                    |   Bin 0 -> 12189532 bytes
 bench/EZ.DAT                                       |     5 +
 bench/NORM_CDF.DAT                                 |   Bin 0 -> 9612 bytes
 bench/README                                       |    76 +
 bench/RUN_TESTS.sh                                 |   193 +
 bench/TAO_SST_clim.cdf                             |   Bin 0 -> 5084 bytes
 bench/TEST_SCRIPTS                                 |   215 +
 bench/TRASH_FILES                                  |   205 +
 bench/a1478.nc                                     |   Bin 0 -> 1048 bytes
 bench/a_cartesian_bug1179.nc                       |   Bin 0 -> 1116 bytes
 bench/adouble.nc                                   |   Bin 0 -> 664 bytes
 bench/adouble_2D.nc                                |   Bin 0 -> 748 bytes
 bench/ansley_official.linux_err                    |  3676 +
 bench/ansley_official.linux_log                    | 80057 ++++++++++++++++++
 bench/ansley_official.rhel6-32_err                 |  3676 +
 bench/ansley_official.rhel6-32_log                 | 78481 ++++++++++++++++++
 bench/ansley_official.rhel6-64_err                 |  3731 +
 bench/ansley_official.rhel6-64_log                 | 80573 +++++++++++++++++++
 bench/ansley_official.x86_64-linux_err             |  3700 +
 bench/ansley_official.x86_64-linux_log             | 80298 ++++++++++++++++++
 bench/append_pack.nc                               |   Bin 0 -> 1672 bytes
 bench/b1478.nc                                     |   Bin 0 -> 1260 bytes
 bench/bad_taxis.nc                                 |   Bin 0 -> 82060 bytes
 bench/badbounds.nc                                 |   Bin 0 -> 1860 bytes
 bench/bench_add_9.jnl                              |    21 +
 bench/bench_add_9_visual.jnl                       |    32 +
 bench/bench_avet.jnl                               |    22 +
 bench/bench_avet_visual.jnl                        |    33 +
 bench/bench_compress.jnl                           |    24 +
 bench/bench_compress_by.jnl                        |     5 +
 bench/bench_environment                            |    13 +
 bench/bench_eof.jnl                                |    49 +
 bench/bench_examples.jnl                           |    19 +
 bench/bench_extrema.jnl                            |    18 +
 bench/bench_fft.jnl                                |    69 +
 bench/bench_fft_visual.jnl                         |    91 +
 bench/bench_gridding.jnl                           |    71 +
 bench/bench_gridding_visual.jnl                    |    66 +
 bench/bench_internal_string_functions.jnl          |    67 +
 bench/bench_pass_thru.jnl                          |    24 +
 bench/bench_pass_thru_visual.jnl                   |    20 +
 bench/bench_samplet_date.jnl                       |    13 +
 bench/bench_samplexy.jnl                           |    12 +
 bench/bench_sort.jnl                               |    22 +
 bench/bench_sorti.jnl                              |    36 +
 bench/bench_sorti_visual.jnl                       |    31 +
 bench/bench_sortj.jnl                              |    37 +
 bench/bench_sortj_visual.jnl                       |    35 +
 bench/bench_sortk.jnl                              |    32 +
 bench/bench_sortk_visual.jnl                       |    30 +
 bench/bench_sortl.jnl                              |    52 +
 bench/bench_sortl_visual.jnl                       |    40 +
 bench/bench_storage.jnl                            |    24 +
 bench/bench_storage_visual.jnl                     |    27 +
 bench/bench_subtract.jnl                           |    42 +
 bench/bench_subtract_visual.jnl                    |    46 +
 bench/bench_v5d.jnl                                |    19 +
 bench/bn301_mem_mgmt.jnl                           |    58 +
 bench/bn491_bug_fixes.jnl                          |    54 +
 bench/bn500_bug_fixes.jnl                          |    44 +
 bench/bn541_bug_fixes.jnl                          |    75 +
 bench/bn542_bug_fixes.jnl                          |    31 +
 bench/bn550_bug_fixes.jnl                          |     9 +
 bench/bn551_bug_fixes.jnl                          |    36 +
 bench/bn552_bug_fixes.jnl                          |    55 +
 bench/bn553_bug_fixes.jnl                          |    18 +
 bench/bn554_bug_fixes.jnl                          |    72 +
 bench/bn570_bug_fixes.jnl                          |    38 +
 bench/bn580_bug_fixes.jnl                          |   112 +
 bench/bn581_bug_fixes.jnl                          |    87 +
 bench/bn600_bug_fixes.jnl                          |    97 +
 bench/bn601_bug_fixes.jnl                          |    98 +
 bench/bn602_bug_fixes.jnl                          |    32 +
 bench/bn603_bug_fixes.jnl                          |    18 +
 bench/bn605_bug_fixes.jnl                          |    11 +
 bench/bn608_bug_fixes.jnl                          |    19 +
 bench/bn611_bug_fixes.jnl                          |    33 +
 bench/bn614_bug_fixes.jnl                          |    60 +
 bench/bn61_bug_fixes.jnl                           |    13 +
 bench/bn62_bug_fixes.jnl                           |     8 +
 bench/bn63_bug_fixes.jnl                           |    49 +
 bench/bn64_bug_fixes.jnl                           |    14 +
 bench/bn65_bug_fixes.jnl                           |    26 +
 bench/bn663_bug_fixes.jnl                          |     9 +
 bench/bn665_bug_fixes.jnl                          |    17 +
 bench/bn66_bug_fixes.jnl                           |     6 +
 bench/bn671_bug_fixes.jnl                          |    18 +
 bench/bn67_bug_fixes.jnl                           |    37 +
 bench/bn682_bug_fixes.jnl                          |     7 +
 bench/bn683_bug_fixes.jnl                          |    27 +
 bench/bn685_bug_fixes.jnl                          |    63 +
 bench/bn686_bug_fixes.jnl                          |    31 +
 bench/bn68_bug_fixes.jnl                           |    35 +
 bench/bn69_bug_fixes.jnl                           |    24 +
 bench/bn_6d_lab_mode.jnl                           |    38 +
 bench/bn_NaN_note.jnl                              |    15 +
 bench/bn_abstract_axis_names.jnl                   |   110 +
 bench/bn_aggregate_e.jnl                           |   152 +
 bench/bn_all.jnl                                   |   911 +
 bench/bn_all_ef.jnl                                |    15 +
 bench/bn_all_leap.jnl                              |    21 +
 bench/bn_appende.jnl                               |    51 +
 bench/bn_attributes.jnl                            |  1014 +
 bench/bn_ax_attrib.jnl                             |    13 +
 bench/bn_axcontrol.jnl                             |    38 +
 bench/bn_axis_cf.jnl                               |    53 +
 bench/bn_axis_dir_symbols.jnl                      |    18 +
 bench/bn_axis_limits.jnl                           |    45 +
 bench/bn_axis_limits.sub1                          |    55 +
 bench/bn_axis_limits.sub2                          |    51 +
 bench/bn_axis_nonmonotonic.jnl                     |    11 +
 bench/bn_axis_outtype.jnl                          |    68 +
 bench/bn_axis_reversed_syms.jnl                    |    49 +
 bench/bn_axis_viewports.jnl                        |   128 +
 bench/bn_bad_axis_bounds.jnl                       |     6 +
 bench/bn_batch_metafile.jnl                        |    83 +
 bench/bn_bounds.jnl                                |   205 +
 bench/bn_bounds_defineax.jnl                       |    68 +
 bench/bn_cache_hits.jnl                            |    47 +
 bench/bn_cache_hits.sub                            |    62 +
 bench/bn_cache_hits_gcfcn.sub                      |    32 +
 bench/bn_calendar.jnl                              |   125 +
 bench/bn_cancel_axes.jnl                           |    48 +
 bench/bn_cancel_axes_1.sub                         |    11 +
 bench/bn_cancel_axes_2.sub                         |     7 +
 bench/bn_cancel_upcase_uservar.jnl                 |    31 +
 bench/bn_cat_string.jnl                            |    25 +
 bench/bn_cdf.jnl                                   |    45 +
 bench/bn_cdf.sub1                                  |    43 +
 bench/bn_cdf.sub2                                  |    98 +
 bench/bn_cdf.sub3                                  |    79 +
 bench/bn_cdf.sub4                                  |    80 +
 bench/bn_cdf_errmsg.jnl                            |    41 +
 bench/bn_cdf_keepax.jnl                            |    41 +
 bench/bn_cdf_keepax.sub1                           |    43 +
 bench/bn_cdf_keepax.sub2                           |    98 +
 bench/bn_cdf_keepax.sub3                           |    79 +
 bench/bn_cdf_keepax.sub4                           |    87 +
 bench/bn_cdf_reversed.sub                          |    14 +
 bench/bn_cdf_reversed_keepax.sub                   |    14 +
 bench/bn_clock_syms.jnl                            |    24 +
 bench/bn_comma_delimited.jnl                       |    83 +
 bench/bn_comma_delimited.sub                       |    37 +
 bench/bn_compress.jnl                              |    23 +
 bench/bn_compress.sub_v                            |    30 +
 bench/bn_convolve.jnl                              |    26 +
 bench/bn_curv.jnl                                  |    88 +
 bench/bn_curv_mod.jnl                              |    17 +
 bench/bn_dash_dot.jnl                              |    19 +
 bench/bn_define_axes.jnl                           |   126 +
 bench/bn_deg_min.jnl                               |    33 +
 bench/bn_delimited_read.jnl                        |   129 +
 bench/bn_delimited_read_1.dat                      |     7 +
 bench/bn_delimited_read_2.dat                      |     3 +
 bench/bn_delimited_read_CO2.dat                    |    20 +
 bench/bn_delimited_read_date_time.dat              |     4 +
 bench/bn_descr_4digit.jnl                          |     7 +
 bench/bn_descriptor_mc.jnl                         |    14 +
 bench/bn_direction_fcns_6d.jnl                     |    56 +
 bench/bn_dods_strides.jnl                          |   239 +
 bench/bn_dollar.jnl                                |   112 +
 bench/bn_dollar.sub                                |    15 +
 bench/bn_dots.jnl                                  |    19 +
 bench/bn_dp_readscale.jnl                          |    39 +
 bench/bn_dsg_e_x.jnl                               |    13 +
 bench/bn_dynamic_grids.jnl                         |   363 +
 bench/bn_ef_bench_extrema.jnl                      |    18 +
 bench/bn_ef_curv_to_rect.jnl                       |    23 +
 bench/bn_ef_err541_date_delim.jnl                  |    39 +
 bench/bn_ef_external_functions.jnl                 |    14 +
 bench/bn_ef_v5d_strings.jnl                        |    35 +
 bench/bn_ef_zaxr_fcns.jnl                          |    33 +
 bench/bn_element_functions.jnl                     |    22 +
 bench/bn_encode_url.jnl                            |    41 +
 bench/bn_enter_exit_GO.jnl                         |    20 +
 bench/bn_eof_4d.jnl                                |   159 +
 bench/bn_eof_simple.jnl                            |   147 +
 bench/bn_eof_simple2.jnl                           |   158 +
 bench/bn_exit_cycle.jnl                            |    21 +
 bench/bn_exit_script.jnl                           |    31 +
 bench/bn_expressions.jnl                           |   141 +
 bench/bn_expressions_6d.jnl                        |   112 +
 bench/bn_external_functions.jnl                    |    15 +
 bench/bn_ez.jnl                                    |    82 +
 bench/bn_ez_order.jnl                              |   197 +
 bench/bn_fcn_calls.jnl                             |     7 +
 bench/bn_fifty_files.jnl                           |    59 +
 bench/bn_fill_irregular.jnl                        |    20 +
 bench/bn_floatstr.jnl                              |    28 +
 bench/bn_flowlines.jnl                             |    43 +
 bench/bn_gc_functions.jnl                          |   136 +
 bench/bn_geometry.jnl                              |    79 +
 bench/bn_geometry.sub                              |    27 +
 bench/bn_gif.jnl                                   |   164 +
 bench/bn_grads_z.jnl                               |    32 +
 bench/bn_graticules.jnl                            |   104 +
 bench/bn_grave.jnl                                 |   142 +
 bench/bn_if.jnl                                    |   166 +
 bench/bn_if.sub                                    |    25 +
 bench/bn_ifv.jnl                                   |    51 +
 bench/bn_illegal_axisname.jnl                      |    17 +
 bench/bn_in_plane.jnl                              |    20 +
 bench/bn_in_plane.sub                              |    27 +
 bench/bn_inf_levels.jnl                            |    75 +
 bench/bn_internal_external_functions.jnl           |    88 +
 bench/bn_interpolate.jnl                           |    20 +
 bench/bn_interpolate.sub                           |    27 +
 bench/bn_interpolate_6d.jnl                        |    21 +
 bench/bn_interpolate_6d.sub                        |    27 +
 bench/bn_isdepth.jnl                               |    21 +
 bench/bn_keep_axisnames.jnl                        |    20 +
 bench/bn_keep_axnames.jnl                          |    20 +
 bench/bn_key_label_minmax.jnl                      |    77 +
 bench/bn_labnum_calendar.jnl                       |    13 +
 bench/bn_labwid.jnl                                |    21 +
 bench/bn_last_error.jnl                            |    45 +
 bench/bn_last_go_file.jnl                          |     5 +
 bench/bn_letd.jnl                                  |   118 +
 bench/bn_lev_symbols.jnl                           |    34 +
 bench/bn_linecolors.jnl                            |    60 +
 bench/bn_logaxes.jnl                               |    41 +
 bench/bn_long_grid_names.jnl                       |   163 +
 bench/bn_long_revision_num.jnl                     |    18 +
 bench/bn_long_symnames.jnl                         |    30 +
 bench/bn_longvarnames.jnl                          |    38 +
 bench/bn_lsl_lowpass.jnl                           |    13 +
 bench/bn_many_polygons.jnl                         |    26 +
 bench/bn_mc.jnl                                    |    47 +
 bench/bn_mc_vary_scale.jnl                         |    33 +
 bench/bn_median.jnl                                |    29 +
 bench/bn_memory_symbol.jnl                         |    18 +
 bench/bn_min_max_smoothers.jnl                     |    27 +
 bench/bn_mn_fcns.jnl                               |    77 +
 bench/bn_mode_logo_lab.jnl                         |    57 +
 bench/bn_mode_nlevels.jnl                          |    23 +
 bench/bn_mode_nodata_lab.jnl                       |    26 +
 bench/bn_modnbd.jnl                                |    18 +
 bench/bn_modstats.jnl                              |    20 +
 bench/bn_modulo_attribute.jnl                      |    11 +
 bench/bn_modulo_strides.jnl                        |    80 +
 bench/bn_movie.jnl                                 |    24 +
 bench/bn_mp_zoo.jnl                                |    80 +
 bench/bn_multi_decade.jnl                          |    60 +
 bench/bn_multi_line_labels.jnl                     |   126 +
 bench/bn_n_open_dsets_sym.jnl                      |    35 +
 bench/bn_nco_append.jnl                            |    18 +
 bench/bn_nco_functions.jnl                         |    43 +
 bench/bn_negative_t.jnl                            |    64 +
 bench/bn_negative_t.sub                            |    15 +
 bench/bn_netcdf4.jnl                               |    82 +
 bench/bn_no_valid_on_plot.jnl                      |    32 +
 bench/bn_nobounds.jnl                              |    31 +
 bench/bn_nocoords.jnl                              |    39 +
 bench/bn_non_COARDS_netCDF.jnl                     |    33 +
 bench/bn_odd_variable_name.jnl                     |    26 +
 bench/bn_output.jnl                                |    44 +
 bench/bn_output.sub                                |    95 +
 bench/bn_outtype.jnl                               |   102 +
 bench/bn_packed_coordinates.jnl                    |    77 +
 bench/bn_pattern.jnl                               |    43 +
 bench/bn_plot.jnl                                  |   174 +
 bench/bn_plot_color_only.jnl                       |    74 +
 bench/bn_plot_nokey.jnl                            |    18 +
 bench/bn_polygon.jnl                               |    21 +
 bench/bn_ppl_errors.jnl                            |    17 +
 bench/bn_proleptic_gregorian_calendar.jnl          |     7 +
 bench/bn_ps.jnl                                    |    82 +
 bench/bn_randu2_randn2.jnl                         |    67 +
 bench/bn_redefine_taxis_mc.jnl                     |    17 +
 bench/bn_regrid.jnl                                |   129 +
 bench/bn_regrid.sub                                |    18 +
 bench/bn_regrid_6d.jnl                             |   123 +
 bench/bn_regrid_to_user.jnl                        |   113 +
 bench/bn_regrid_transforms.jnl                     |   260 +
 bench/bn_regrid_transforms_6d.jnl                  |    99 +
 bench/bn_regulart.jnl                              |    15 +
 bench/bn_repeat_range.jnl                          |   100 +
 bench/bn_repeated_coords.jnl                       |    23 +
 bench/bn_repl_9999999.jnl                          |     9 +
 bench/bn_reset.jnl                                 |    20 +
 bench/bn_reset_attributes.jnl                      |   107 +
 bench/bn_return_xmod_tmod.jnl                      |    32 +
 bench/bn_ribbon_plot.jnl                           |   114 +
 bench/bn_sample.jnl                                |   153 +
 bench/bn_samplexyt.jnl                             |    36 +
 bench/bn_samplexz.jnl                              |    20 +
 bench/bn_sampleyz.jnl                              |    20 +
 bench/bn_scat2grid_bin.jnl                         |    92 +
 bench/bn_scat2grid_gl.jnl                          |    95 +
 bench/bn_scat2grid_nobs.jnl                        |    45 +
 bench/bn_scat2grid_t.jnl                           |    22 +
 bench/bn_scat2grid_test.jnl                        |   111 +
 bench/bn_scat2gridlaplace_tarasoff.jnl             |    33 +
 bench/bn_set_axis_name.jnl                         |    76 +
 bench/bn_set_axis_regular.jnl                      |    53 +
 bench/bn_set_axis_regular.nc                       |   Bin 0 -> 1492 bytes
 bench/bn_set_cancel_redirect.jnl                   |   156 +
 bench/bn_set_strides.jnl                           |   162 +
 bench/bn_set_var_name.jnl                          |    19 +
 bench/bn_set_var_scale_off.jnl                     |    33 +
 bench/bn_shade_keycont.jnl                         |    62 +
 bench/bn_shade_trim.jnl                            |    21 +
 bench/bn_shakey.jnl                                |    70 +
 bench/bn_short.sub                                 |     5 +
 bench/bn_shortgo.jnl                               |     4 +
 bench/bn_shortgo2.jnl                              |     6 +
 bench/bn_show_xml_file.jnl                         |    33 +
 bench/bn_single_colorlev.jnl                       |    16 +
 bench/bn_sort_strings.jnl                          |    62 +
 bench/bn_startupfile.jnl                           |    19 +
 bench/bn_stddev.jnl                                |    12 +
 bench/bn_strdim.jnl                                |    20 +
 bench/bn_stream.jnl                                |    22 +
 bench/bn_strides.cdf                               |   Bin 0 -> 1081312 bytes
 bench/bn_strides.cdl                               | 27114 +++++++
 bench/bn_strides_revs_perms.jnl                    |   272 +
 bench/bn_string_ngd_nbd.jnl                        |    76 +
 bench/bn_strings.jnl                               |   193 +
 bench/bn_subspan_modulo.jnl                        |    98 +
 bench/bn_subspan_modulo.sub1                       |    25 +
 bench/bn_subspan_modulo.sub2                       |   124 +
 bench/bn_symbols.jnl                               |   109 +
 bench/bn_syntax.jnl                                |   254 +
 bench/bn_syntax_6d.jnl                             |    32 +
 bench/bn_tab_comma_multivar.jnl                    |    19 +
 bench/bn_tax_tstep.jnl                             |    32 +
 bench/bn_test_nan.jnl                              |    36 +
 bench/bn_test_opendap.jnl                          |    13 +
 bench/bn_test_stream_big.jnl                       |   152 +
 bench/bn_test_stream_little.jnl                    |   154 +
 bench/bn_transforms.jnl                            |    27 +
 bench/bn_transpose.jnl                             |    30 +
 bench/bn_txtype_dmy.jnl                            |    98 +
 bench/bn_unique_str2int.jnl                        |    33 +
 bench/bn_user.jnl                                  |    13 +
 bench/bn_var_hist_levels.jnl                       |    50 +
 bench/bn_varcontext_attributes.jnl                 |   103 +
 bench/bn_variance.jnl                              |    10 +
 bench/bn_variance_large.jnl                        |    13 +
 bench/bn_vec_curv.jnl                              |    70 +
 bench/bn_vec_mod.jnl                               |    20 +
 bench/bn_vector_symbols.jnl                        |    29 +
 bench/bn_vtree.jnl                                 |   173 +
 bench/bn_vtree.sub                                 |    18 +
 bench/bn_window_title.jnl                          |    30 +
 bench/bn_write_integer_att.jnl                     |    17 +
 bench/bn_xact_regrid.jnl                           |    55 +
 bench/bn_xact_regrid.sub                           |    31 +
 bench/bn_xml_header.jnl                            |    14 +
 bench/bn_xml_output.jnl                            |    78 +
 bench/bn_xml_repl.jnl                              |     9 +
 bench/bn_zaxr_fcns.jnl                             |    31 +
 bench/bounds_noenclose.nc                          |   Bin 0 -> 1012 bytes
 bench/bounds_overlapping.nc                        |   Bin 0 -> 660 bytes
 bench/bug1421_a.nc                                 |   Bin 0 -> 1492 bytes
 bench/bug1421_b.nc                                 |   Bin 0 -> 980 bytes
 bench/bug_save_subset.nc                           |   Bin 0 -> 720 bytes
 bench/byte.dat                                     |   Bin 0 -> 48 bytes
 bench/byteSwapped.dat                              |   Bin 0 -> 48 bytes
 bench/cc_irreg.nc                                  |   Bin 0 -> 2112 bytes
 bench/check_metafiles_rh6                          |    93 +
 bench/clean                                        |    13 +
 bench/clean_draconian                              |    13 +
 bench/clean_ultra                                  |    11 +
 bench/clim_airt_lev.cdf                            |   Bin 0 -> 771820 bytes
 bench/climatological_axes.cdf                      |   Bin 0 -> 1188 bytes
 bench/coads_clim.001                               |   Bin 0 -> 132520 bytes
 bench/coads_clim.002                               |   Bin 0 -> 132520 bytes
 bench/coads_clim.003                               |   Bin 0 -> 132536 bytes
 bench/coads_clim.003b                              |   Bin 0 -> 67712 bytes
 bench/coads_clim.1000                              |   Bin 0 -> 1164 bytes
 bench/coads_clim.1001                              |   Bin 0 -> 1168 bytes
 bench/coads_clim.999                               |   Bin 0 -> 1160 bytes
 bench/coads_clim.des                               |    61 +
 bench/coads_clim_4digit.des                        |    54 +
 bench/coads_clim_bad_delta.des                     |    61 +
 bench/coads_clim_irreg.des                         |    61 +
 bench/coads_clim_missing_step1.des                 |    61 +
 bench/coads_clim_missing_stepN.des                 |    61 +
 bench/coads_clim_step_order.des                    |    61 +
 bench/coads_climatology.cdf                        |   Bin 0 -> 197324 bytes
 bench/coads_uw.nc                                  |   Bin 0 -> 131548 bytes
 bench/coads_vwnd.cdf                               |   Bin 0 -> 15636 bytes
 bench/dates_bug.dat                                |     6 +
 bench/default.ferret                               |     3 +
 bench/degrees.nc                                   |   Bin 0 -> 780 bytes
 bench/delim_prec.dat                               |     4 +
 bench/des.mc                                       |    55 +
 bench/des.my_descriptor                            |    45 +
 bench/dims_not_coord.nc                            |   Bin 0 -> 1212 bytes
 bench/double.dat                                   |   Bin 0 -> 384 bytes
 bench/doubleSwapped.dat                            |   Bin 0 -> 384 bytes
 bench/dsg.nc                                       |   Bin 0 -> 2300 bytes
 bench/dstitle.nc                                   |   Bin 0 -> 1172 bytes
 bench/duplicate.cdf                                |   Bin 0 -> 1300 bytes
 bench/duplicate.des                                |    61 +
 bench/duplicate.nc                                 |   Bin 0 -> 1300 bytes
 bench/ens1.nc                                      |   Bin 0 -> 10048 bytes
 bench/ens2.nc                                      |   Bin 0 -> 5512 bytes
 bench/ens3.nc                                      |   Bin 0 -> 5512 bytes
 bench/ens4.nc                                      |   Bin 0 -> 5512 bytes
 bench/epic_formatted_file.nc                       |   Bin 0 -> 3284 bytes
 bench/err490_cdf_childax.jnl                       |    19 +
 bench/err490_command_parser.jnl                    |    16 +
 bench/err490_fixed_var_size.jnl                    |    45 +
 bench/err490_l_ave.jnl                             |    60 +
 bench/err490_neg_time_show_grid.jnl                |     8 +
 bench/err490_repeat_first_echo.jnl                 |    23 +
 bench/err490_tilde.jnl                             |    15 +
 bench/err491_RESHAPE_ctx.jnl                       |    34 +
 bench/err491_asn.jnl                               |    44 +
 bench/err491_attrib_dp.jnl                         |    17 +
 bench/err491_attval.cdf                            |   Bin 0 -> 12496 bytes
 bench/err491_cdf_childax.jnl                       |    25 +
 bench/err491_days1900.jnl                          |    20 +
 bench/err491_delete_child_var.jnl                  |    23 +
 bench/err491_dp_time_write.jnl                     |    18 +
 bench/err491_explicit_limits.jnl                   |    28 +
 bench/err491_gmax.jnl                              |    12 +
 bench/err491_grid_from_name.jnl                    |    12 +
 bench/err491_gt_syntax.jnl                         |    15 +
 bench/err491_interp.jnl                            |    31 +
 bench/err491_let_d.jnl                             |     7 +
 bench/err491_long_gif_name.jnl                     |    13 +
 bench/err491_mc.jnl                                |     9 +
 bench/err491_reshape_limits.jnl                    |    24 +
 bench/err491_sh_var_templates.jnl                  |     9 +
 bench/err491_shade_lev_roundoff.jnl                |    13 +
 bench/err491_single_char_replace.jnl               |    10 +
 bench/err491_spawn_quotes.jnl                      |     6 +
 bench/err491_time_regridding.jnl                   |    30 +
 bench/err491_unknown_function.jnl                  |    12 +
 bench/err491_zaxreplace.jnl                        |    46 +
 bench/err500_IF_THEN_ELSE_quote.jnl                |     8 +
 bench/err500_logcontour.jnl                        |    26 +
 bench/err540_ax_ave.jnl                            |    11 +
 bench/err540_axis_symbols.jnl                      |    25 +
 bench/err540_axset.jnl                             |    29 +
 bench/err540_cd_use_recdim.jnl                     |    31 +
 bench/err540_data_type.jnl                         |    28 +
 bench/err540_dods_bad_dataset.jnl                  |    13 +
 bench/err540_dods_bad_strides.jnl                  |    30 +
 bench/err540_ill_format.jnl                        |    12 +
 bench/err540_modscat.jnl                           |    18 +
 bench/err540_parse_repeat.jnl                      |    18 +
 bench/err540_poly_overlay.jnl                      |     6 +
 bench/err540_polymissing.jnl                       |    22 +
 bench/err540_samplexy_missing.jnl                  |    11 +
 bench/err540_strides_rev.jnl                       |    50 +
 bench/err540_use.jnl                               |    43 +
 bench/err540_vs_dash.jnl                           |    38 +
 bench/err540_write_order.jnl                       |    41 +
 bench/err541_cancel_axes.jnl                       |    24 +
 bench/err541_date_delim.jnl                        |    39 +
 bench/err541_fill_tics.jnl                         |    12 +
 bench/err541_non_gregorian.jnl                     |    12 +
 bench/err541_string4d.jnl                          |    28 +
 bench/err542_poly_over_calendar.jnl                |     6 +
 bench/err542_poly_over_calendar.nc                 |   Bin 0 -> 1012 bytes
 bench/err550_define_axis_expression.jnl            |    22 +
 bench/err550_dots_thickpens.jnl                    |     5 +
 bench/err550_nc_seconds.jnl                        |    12 +
 bench/err550_redefine_calendar_axis.jnl            |     9 +
 bench/err550_shade_limits.jnl                      |     9 +
 bench/err550_view_axes_fill.jnl                    |    74 +
 bench/err550_view_axes_position.jnl                |    13 +
 bench/err551_2dave.jnl                             |    11 +
 bench/err551_axes_set.jnl                          |    13 +
 bench/err551_colorkey.jnl                          |    17 +
 bench/err551_fft_freqaxis.jnl                      |    14 +
 bench/err551_invalid_calendar.jnl                  |     6 +
 bench/err551_modulo_nc_regrid.jnl                  |    30 +
 bench/err551_no_taxis_errmsg.jnl                   |     9 +
 bench/err551_num_levels.jnl                        |    20 +
 bench/err551_regrid_undef_grid.jnl                 |    57 +
 bench/err551_repeat_sym.jnl                        |     8 +
 bench/err551_return_message.jnl                    |    16 +
 bench/err551_streamread_directory.jnl              |    15 +
 bench/err551_strings.jnl                           |    36 +
 bench/err553_axis_too_long.jnl                     |     9 +
 bench/err553_contour_fine_grid.jnl                 |    30 +
 bench/err553_lev_c.jnl                             |     8 +
 bench/err553_list_string_numeric.jnl               |    17 +
 bench/err553_list_width.jnl                        |    17 +
 bench/err553_lon_ax_0_label.jnl                    |     8 +
 bench/err553_long_string_var_name.jnl              |    15 +
 bench/err553_numeric_filename.jnl                  |    10 +
 bench/err553_regionname_lengths.jnl                |    15 +
 bench/err553_set_axis_depth.jnl                    |    10 +
 bench/err553_shakey_labels.jnl                     |    11 +
 bench/err553_stride_def_grid.jnl                   |   120 +
 bench/err553_stride_modulo.jnl                     |    27 +
 bench/err553_symbol_lev.jnl                        |    36 +
 bench/err553_symsize.jnl                           |     5 +
 bench/err553_timeregion.jnl                        |    13 +
 bench/err553_xaxis_nsmtc.jnl                       |    10 +
 bench/err553_year_yr.jnl                           |    47 +
 bench/err560_century.jnl                           |    17 +
 bench/err560_leap_years.jnl                        |     7 +
 bench/err560_mc_irreg_t.jnl                        |    17 +
 bench/err560_regridding_gaps.jnl                   |    34 +
 bench/err560_shade_levels.jnl                      |     9 +
 bench/err560_shade_noleap.jnl                      |    10 +
 bench/err570_cnnn_multiline.jnl                    |     9 +
 bench/err570_coaching.jnl                          |    38 +
 bench/err570_compressk_by.jnl                      |    52 +
 bench/err570_digit_filename.jnl                    |    18 +
 bench/err570_dods_url_label.jnl                    |    40 +
 bench/err570_dollar_zero.jnl                       |     8 +
 bench/err570_fine_grid_list.jnl                    |    27 +
 bench/err570_hlimit_onepoint.jnl                   |    16 +
 bench/err570_illegal_stride.jnl                    |     8 +
 bench/err570_index111.jnl                          |    24 +
 bench/err570_keylabels.jnl                         |     9 +
 bench/err570_list_tab_coords.jnl                   |    12 +
 bench/err570_long_label.jnl                        |    35 +
 bench/err570_many_variables.jnl                    |   245 +
 bench/err570_null_symbol.jnl                       |    12 +
 bench/err570_parse_labelcommand.jnl                |    22 +
 bench/err570_poly_lonlat_axis.jnl                  |    21 +
 bench/err570_poly_over_julian.jnl                  |    15 +
 bench/err570_ppl_poly.jnl                          |    17 +
 bench/err570_sh_dat_nan.jnl                        |    10 +
 bench/err570_shakeylab.jnl                         |    48 +
 bench/err570_singlecolor.jnl                       |    38 +
 bench/err570_thick_colors.jnl                      |    19 +
 bench/err570_time_range.jnl                        |    16 +
 bench/err580_arg_case.jnl                          |    13 +
 bench/err580_cal360_region.jnl                     |     9 +
 bench/err580_cartesian_depth.jnl                   |     8 +
 bench/err580_cdb.jnl                               |    20 +
 bench/err580_cdc_timeaxis.jnl                      |    37 +
 bench/err580_def_t_norange.jnl                     |     8 +
 bench/err580_def_tax_norange.jnl                   |     7 +
 bench/err580_def_view_axes.jnl                     |    30 +
 bench/err580_irreg_bounds.jnl                      |    21 +
 bench/err580_lev_del.jnl                           |    11 +
 bench/err580_long_dsettitle.jnl                    |    13 +
 bench/err580_long_title.jnl                        |     8 +
 bench/err580_long_veckey.jnl                       |    10 +
 bench/err580_show_axis_t.jnl                       |    12 +
 bench/err580_strfloat_errors.jnl                   |     6 +
 bench/err580_use_des.jnl                           |     5 +
 bench/err581_cal_dates_output.jnl                  |    14 +
 bench/err581_cancel_data.jnl                       |    32 +
 bench/err581_command_cx.jnl                        |    17 +
 bench/err581_contour_zero_lev.jnl                  |     7 +
 bench/err581_define_1pt_bounds.jnl                 |    16 +
 bench/err581_des_scale.jnl                         |    26 +
 bench/err581_exp_spaces.jnl                        |    22 +
 bench/err581_hlim_axislab.jnl                      |    15 +
 bench/err581_if_conditional.jnl                    |    79 +
 bench/err581_illegal_trans.jnl                     |    10 +
 bench/err581_list_stray_chars.jnl                  |    14 +
 bench/err581_missing_scale_off.jnl                 |    12 +
 bench/err581_nlev.jnl                              |     8 +
 bench/err581_noleap_mod.jnl                        |    11 +
 bench/err581_poly_rev.jnl                          |    47 +
 bench/err581_shakey_inf.jnl                        |    13 +
 bench/err581_sho_func_pattern_match.jnl            |    10 +
 bench/err581_since_units.jnl                       |    16 +
 bench/err581_strrindex.jnl                         |     7 +
 bench/err581_subspanx_fill_bug.jnl                 |    15 +
 bench/err581_use_bounds.jnl                        |    10 +
 bench/err581_vs_poly_axis.jnl                      |    18 +
 bench/err600_check_bounds_regular.jnl              |    14 +
 bench/err600_ferret_axis_names.jnl                 |    21 +
 bench/err600_if_comments_tab.jnl                   |    19 +
 bench/err600_let_d.jnl                             |    10 +
 bench/err600_long_bounds_name.jnl                  |    16 +
 bench/err600_long_symbol_string.jnl                |    23 +
 bench/err600_missing_flag.jnl                      |     9 +
 bench/err600_nc_des_order.jnl                      |    22 +
 bench/err600_reset_redefine_axis.jnl               |    43 +
 bench/err600_returnsize.jnl                        |    13 +
 bench/err600_save_two.jnl                          |    11 +
 bench/err600_set_var_title.jnl                     |    17 +
 bench/err600_tab_comma_missingdat.jnl              |    16 +
 bench/err600_upcase.jnl                            |    17 +
 bench/err600_upcase.nc                             |   Bin 0 -> 448 bytes
 bench/err600_var_label.jnl                         |    20 +
 bench/err600_vec_aspect.jnl                        |    16 +
 bench/err601_check_missing_3arg.jnl                |    28 +
 bench/err601_index_111.jnl                         |    10 +
 bench/err601_irregular_axis.jnl                    |     7 +
 bench/err601_missing_string_element.jnl            |     6 +
 bench/err601_sho_ax_xml_calendar.jnl               |    10 +
 bench/err602_curvi_modulo_cut.jnl                  |    16 +
 bench/err602_list_prec.jnl                         |    22 +
 bench/err602_shade_line_lev.jnl                    |    14 +
 bench/err604_irreg_axis.jnl                        |     6 +
 bench/err605_show_func.jnl                         |     7 +
 bench/err607_axis_minmax_syms.jnl                  |    16 +
 bench/err607_lev_errmsg.jnl                        |     8 +
 bench/err607_set_new_history_att.jnl               |    14 +
 bench/err607_show_var_xml.jnl                      |    15 +
 bench/err608_bug1556.jnl                           |    21 +
 bench/err608_bug1556.nc                            |   Bin 0 -> 1640 bytes
 bench/err608_precision_neg_numbers.jnl             |    11 +
 bench/err611_axislab.jnl                           |    10 +
 bench/err611_context_after_error.jnl               |    33 +
 bench/err611_convert_missing_type.jnl              |    18 +
 bench/err611_digit_filename.jnl                    |    10 +
 bench/err611_ef_string_result.jnl                  |    21 +
 bench/err611_exit_if.jnl                           |    15 +
 bench/err611_irregular_axis.jnl                    |    20 +
 bench/err611_isize_gc_fcns.jnl                     |    25 +
 bench/err611_ov_ax.jnl                             |    16 +
 bench/err611_parse_semicolon.jnl                   |    11 +
 bench/err611_polygons.jnl                          |    15 +
 bench/err611_return_precision.jnl                  |    63 +
 bench/err611_save_from_desc.jnl                    |     7 +
 bench/err611_save_irreg.jnl                        |    14 +
 bench/err611_set_uvar_outtyp.jnl                   |    18 +
 bench/err611_set_var_ez.jnl                        |    31 +
 bench/err611_shade_fill_levs.jnl                   |     9 +
 bench/err611_wrong_fineaxis_range.jnl              |    28 +
 bench/err618_julday.jnl                            |    20 +
 bench/err61_360_calendar.jnl                       |    11 +
 bench/err61_context_scalar_strings.jnl             |     8 +
 bench/err61_contour_subspan_reps.jnl               |    33 +
 bench/err61_exit_script.jnl                        |    30 +
 bench/err61_new_attr_on_axis.jnl                   |    22 +
 bench/err61_poly_shade_over_noaxes.jnl             |    49 +
 bench/err61_show_dat_var_xml.jnl                   |    39 +
 bench/err61_write_bounds.jnl                       |    25 +
 bench/err62_append_irreg_to_reg.jnl                |    28 +
 bench/err62_axis_stride_off.jnl                    |    24 +
 bench/err62_compound_string_conditional.jnl        |    13 +
 bench/err62_contourbug.jnl                         |    18 +
 bench/err62_cos_lat_uncentered.jnl                 |    34 +
 bench/err62_if_inside_repeat.jnl                   |   220 +
 bench/err62_levset.jnl                             |     7 +
 bench/err62_one_point_bounds.jnl                   |    15 +
 bench/err62_reset_after_inf.jnl                    |    15 +
 bench/err62_reversed_up.jnl                        |    16 +
 bench/err62_samplexy.jnl                           |    19 +
 bench/err62_save_missingcoordvar.jnl               |    12 +
 bench/err62_string_write.nc                        |   Bin 0 -> 2992 bytes
 bench/err62_string_write_nc.jnl                    |    44 +
 bench/err62_thick_tic_time_axis.jnl                |    45 +
 bench/err62_title_curvi_plot.jnl                   |    25 +
 bench/err63_days1900toydmhms.jnl                   |    11 +
 bench/err63_delim_E.jnl                            |    22 +
 bench/err63_log_vaxis.jnl                          |    14 +
 bench/err64_packed_data.jnl                        |    27 +
 bench/err64_packed_data.nc                         |   Bin 0 -> 30244 bytes
 bench/err64_parse_equals.jnl                       |    11 +
 bench/err64_polymark_over_calendar.jnl             |    13 +
 bench/err64_regrid_noleap.jnl                      |    19 +
 bench/err64_return_precision.jnl                   |    16 +
 bench/err64_shakey_missingdata.jnl                 |    20 +
 bench/err64_small_latlon.nc                        |   Bin 0 -> 65452 bytes
 bench/err64_very_small_latlon.jnl                  |    10 +
 bench/err65_averages.jnl                           |    12 +
 bench/err65_dots_in_dashes.jnl                     |    16 +
 bench/err65_read_epic_cdf.jnl                      |     8 +
 bench/err664_tax_fcns.jnl                          |    23 +
 bench/err664_xml_keep_case.jnl                     |    24 +
 bench/err664_xml_one_point_axis.jnl                |    21 +
 bench/err665_centered_lev.jnl                      |    16 +
 bench/err665_din.jnl                               |    41 +
 bench/err665_hours_since_T.jnl                     |    10 +
 bench/err665_sum_4d_labels.jnl                     |     6 +
 bench/err667_5d_netcdf.jnl                         |    11 +
 bench/err667_att_too_long.jnl                      |     8 +
 bench/err667_dup_axnames.jnl                       |    26 +
 bench/err667_mode_desperate.jnl                    |    22 +
 bench/err667_show_var_twice.jnl                    |    13 +
 bench/err667_string_if.jnl                         |    13 +
 bench/err66_all_missing_lev_v.jnl                  |     7 +
 bench/err672_axis_label_prec.jnl                   |    29 +
 bench/err672_axis_order.jnl                        |    13 +
 bench/err672_dset_cx.jnl                           |    41 +
 bench/err672_long_show_axis.jnl                    |     7 +
 bench/err672_runoff_page.jnl                       |    16 +
 bench/err672_samplexy_modulo.jnl                   |    20 +
 bench/err672_stray_line.jnl                        |    16 +
 bench/err672_subscr_precision.jnl                  |    10 +
 bench/err672_tax_functions_prec.jnl                |    64 +
 bench/err672_varnames.jnl                          |    26 +
 bench/err672_vert_axislabel.jnl                    |    26 +
 bench/err67_axis_order.nc                          |   Bin 0 -> 2044 bytes
 bench/err67_nrst_trans.jnl                         |    10 +
 bench/err67_regridding_dyn.jnl                     |    40 +
 bench/err67_reverse_bounds.jnl                     |     8 +
 bench/err67_save_append_open.jnl                   |    25 +
 bench/err67_tax_modtime.jnl                        |    18 +
 bench/err681_dims_direction.jnl                    |    25 +
 bench/err682_append_packed.jnl                     |    18 +
 bench/err682_axis_no_clue.jnl                      |     8 +
 bench/err682_grid_merge.jnl                        |    12 +
 bench/err682_if_yes_exit.jnl                       |    19 +
 bench/err682_scale_no_offset.jnl                   |    21 +
 bench/err682_scale_no_offset.nc                    |   Bin 0 -> 1436 bytes
 bench/err682_shrink_axlab.jnl                      |    23 +
 bench/err682_use_no_quotes.jnl                     |     9 +
 bench/err682_xact_high_prec.jnl                    |    46 +
 bench/err6842_context_shape.jnl                    |    34 +
 bench/err684_FillValue_xml.jnl                     |    13 +
 bench/err684_axticlab.jnl                          |    15 +
 bench/err684_cancel_att.jnl                        |    10 +
 bench/err684_context_shape.jnl                     |    18 +
 bench/err684_define_grid.jnl                       |    12 +
 bench/err684_degC_axlab.jnl                        |    15 +
 bench/err684_delimited_precision.jnl               |    17 +
 bench/err684_dotstart.jnl                          |    20 +
 bench/err684_evnt_z.jnl                            |    16 +
 bench/err684_label_quotes.jnl                      |    22 +
 bench/err684_line_plot_zero.jnl                    |     7 +
 bench/err684_null_stringwrite.jnl                  |    18 +
 bench/err684_packed_output.jnl                     |    16 +
 bench/err684_packed_output.nc                      |   Bin 0 -> 1428 bytes
 bench/err684_repeated_coordindates.jnl             |     5 +
 bench/err684_save_expression.jnl                   |    44 +
 bench/err684_save_subset.jnl                       |     8 +
 bench/err684_string_dim_name.jnl                   |    10 +
 bench/err684_tax_fcns.jnl                          |    28 +
 bench/err684_vfine_to_coarse.jnl                   |    77 +
 bench/err685_lowercaseAxis.jnl                     |    27 +
 bench/err685_ppl_palette.jnl                       |    29 +
 bench/err685_redefine_uvar_att.jnl                 |     8 +
 bench/err685_ribbon_by_val.jnl                     |    11 +
 bench/err685_samplexy.jnl                          |    10 +
 bench/err685_shade_set.jnl                         |    36 +
 bench/err685_show_grid_e.jnl                       |    12 +
 bench/err685_use_no_extension.jnl                  |    24 +
 bench/err686_cancel_invalid_var.jnl                |    17 +
 bench/err686_dup_axnames.jnl                       |    47 +
 bench/err686_faxis_label.jnl                       |    25 +
 bench/err686_individual_levels.jnl                 |    15 +
 bench/err686_long_list_varnames.jnl                |    70 +
 bench/err686_redef_ascii_att.jnl                   |    22 +
 bench/err686_set_var_name.jnl                      |    34 +
 bench/err686_sho_nonexist_att.jnl                  |    11 +
 bench/err_calendar.nc                              |   Bin 0 -> 804 bytes
 bench/euro_dates_bug.dat                           |     5 +
 bench/exit_script_1.jnl                            |     6 +
 bench/exit_script_if.jnl                           |     9 +
 bench/exit_script_if_loop.jnl                      |     7 +
 bench/exit_script_inloop.jnl                       |     8 +
 bench/exit_script_loop.jnl                         |     7 +
 bench/exit_script_twolev.jnl                       |     6 +
 bench/ferret_startup                               |    18 +
 bench/fill_value_int.nc                            |   Bin 0 -> 612 bytes
 bench/finale.dat                                   |   Bin 0 -> 288 bytes
 bench/fine_x_axis.nc                               |   Bin 0 -> 87476 bytes
 bench/float.dat                                    |   Bin 0 -> 192 bytes
 bench/floatSwapped.dat                             |   Bin 0 -> 192 bytes
 bench/gappy_bounds.nc                              |   Bin 0 -> 1028 bytes
 bench/geo_borders.cdf                              |   Bin 0 -> 967548 bytes
 bench/grads_bug_file.nc                            |   Bin 0 -> 4756 bytes
 bench/gt160w011_nts30.des                          |   169 +
 bench/gt4d011.cdf                                  |   Bin 0 -> 2019040 bytes
 bench/gtbc011.cdf                                  |   Bin 0 -> 511284 bytes
 bench/gtsa056_1.cdf                                |   Bin 0 -> 1104460 bytes
 bench/gtsa056_1_ef.nc                              |   Bin 0 -> 8709124 bytes
 bench/gtsa056_2.cdf                                |   Bin 0 -> 3284540 bytes
 bench/hourst.nc                                    |   Bin 0 -> 796 bytes
 bench/illeg_axname.nc                              |   Bin 0 -> 2696 bytes
 bench/int.dat                                      |   Bin 0 -> 192 bytes
 bench/intSwapped.dat                               |   Bin 0 -> 192 bytes
 bench/latestOb.nc                                  |   Bin 0 -> 3164 bytes
 bench/lev_rev_up.nc                                |   Bin 0 -> 2968 bytes
 bench/levitus_climatology.cdf                      |   Bin 0 -> 60312 bytes
 bench/longtitle1000.nc                             |   Bin 0 -> 2716 bytes
 bench/longvarnames.tsv                             |    11 +
 bench/lowercaseTime.nc                             |   Bin 0 -> 844 bytes
 bench/make_stream_file.F                           |    57 +
 bench/mc_test.des                                  |    53 +
 bench/memleak.jnl                                  |     7 +
 bench/missing_scale_off.nc                         |   Bin 0 -> 860 bytes
 bench/modfalse.nc                                  |   Bin 0 -> 980 bytes
 bench/modulo_lon_time.nc                           |   Bin 0 -> 1636 bytes
 bench/mylon.nc                                     |   Bin 0 -> 13396 bytes
 bench/nan_missing.nc                               |   Bin 0 -> 2008 bytes
 bench/navy_uw.nc                                   |   Bin 0 -> 433896 bytes
 bench/nc5d.nc                                      |   Bin 0 -> 439368 bytes
 bench/noglobalhistory.nc                           |   Bin 0 -> 260 bytes
 bench/non_COARDS.cdf                               |   Bin 0 -> 1196740 bytes
 bench/non_COARDS.cdl                               | 44328 ++++++++++
 bench/non_std_refmap.jnl                           |   216 +
 bench/numstring.nc                                 |   Bin 0 -> 1368 bytes
 bench/objective.jnl                                |    51 +
 bench/ocean_atlas_temp.cdf                         |   Bin 0 -> 523624 bytes
 bench/outside_the_lines.jnl                        |    10 +
 bench/proleptic_gregorian.nc                       |   Bin 0 -> 800 bytes
 bench/repeat_t_coord.nc                            |   Bin 0 -> 1296 bytes
 bench/reverse_axes.cdf                             |   Bin 0 -> 12720 bytes
 bench/reverse_z_bnds.nc                            |   Bin 0 -> 1604 bytes
 bench/run_all                                      |   350 +
 bench/scat2grid.nc                                 |   Bin 0 -> 5228 bytes
 bench/short.dat                                    |   Bin 0 -> 96 bytes
 bench/shortSwapped.dat                             |   Bin 0 -> 96 bytes
 bench/skip.dat                                     |   Bin 0 -> 400 bytes
 bench/ss_small.nc                                  |   Bin 0 -> 12356 bytes
 bench/sstnok_short.nc                              |   Bin 0 -> 1980 bytes
 bench/sstok_short.nc                               |   Bin 0 -> 1980 bytes
 bench/strdimfile.nc                                |   Bin 0 -> 676 bytes
 bench/stream10by5.unf                              |   Bin 0 -> 400 bytes
 bench/stream10by5_aix.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_alp.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_dec.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_i386-apple-darwin.unf            |   Bin 0 -> 400 bytes
 bench/stream10by5_ia64-linux.unf                   |   Bin 0 -> 200 bytes
 bench/stream10by5_ia64-sles9.unf                   |   Bin 0 -> 200 bytes
 bench/stream10by5_linux.unf                        |   Bin 0 -> 400 bytes
 bench/stream10by5_sgi.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_sol.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_sun.unf                          |   Bin 0 -> 200 bytes
 bench/stream10by5_x86_64-linux.unf                 |   Bin 0 -> 400 bytes
 bench/string5d.nc                                  |   Bin 0 -> 968 bytes
 bench/test                                         |    73 +
 bench/test0.nc                                     |   Bin 0 -> 1172 bytes
 bench/test_axes.nc                                 |   Bin 0 -> 888 bytes
 bench/test_nan.nc                                  |   Bin 0 -> 524 bytes
 bench/test_results/axticlabel.pdf                  |   Bin 0 -> 7177 bytes
 bench/test_results/bnplot.pdf                      |   Bin 0 -> 183832 bytes
 bench/test_results/closed_lev.pdf                  |   Bin 0 -> 38462 bytes
 bench/test_results/dashbug.pdf                     |   Bin 0 -> 10413 bytes
 bench/test_results/degC_axlab.pdf                  |   Bin 0 -> 6948 bytes
 bench/test_results/dots.pdf                        |   Bin 0 -> 5193 bytes
 bench/test_results/ferret_run_tests_err            |  3474 +
 bench/test_results/ferret_run_tests_log            | 75717 +++++++++++++++++
 bench/test_results/ferret_run_tests_ncdump         |  2926 +
 bench/test_results/flowlines.pdf                   |   Bin 0 -> 55408 bytes
 bench/test_results/graticules.pdf                  |   Bin 0 -> 24461 bytes
 bench/test_results/linecolors.pdf                  |   Bin 0 -> 16544 bytes
 bench/test_results/multi_line_labels.pdf           |   Bin 0 -> 30878 bytes
 bench/test_results/polygon_plot.pdf                |   Bin 0 -> 16333 bytes
 bench/test_results/pyferret_run_tests_err          |  3546 +
 bench/test_results/pyferret_run_tests_log          | 75902 +++++++++++++++++
 bench/test_results/pyferret_run_tests_ncdump       |  2926 +
 bench/test_results/startup_tests2.pdf              |   Bin 0 -> 11505 bytes
 bench/test_results/timetics.pdf                    |   Bin 0 -> 15654 bytes
 bench/test_results/timetics2.pdf                   |   Bin 0 -> 27328 bytes
 bench/test_results/vec_curv.pdf                    |   Bin 0 -> 14409 bytes
 bench/test_results/vec_curv2.pdf                   |   Bin 0 -> 28782 bytes
 bench/test_results/viewaxes.pdf                    |   Bin 0 -> 8042 bytes
 bench/test_trans.html                              |     7 +
 bench/time_axis_seconds.nc                         |   Bin 0 -> 1084 bytes
 bench/timemissing.nc                               |   Bin 0 -> 388 bytes
 bench/tnok_short.des                               |    38 +
 bench/tok_short.des                                |    38 +
 bench/toolong.nc                                   |   Bin 0 -> 3896 bytes
 bench/trajectory_trajectory_name.nc                |   Bin 0 -> 1808 bytes
 bench/tripolar_subset.nc                           |   Bin 0 -> 154740 bytes
 bench/truemonth.nc                                 |   Bin 0 -> 7220 bytes
 bench/twoType.dat                                  |   Bin 0 -> 216 bytes
 bench/uncentered.nc                                |   Bin 0 -> 12476 bytes
 bench/vary_scale.des                               |    49 +
 bench/varyscale_1.nc                               |   Bin 0 -> 852 bytes
 bench/varyscale_2.nc                               |   Bin 0 -> 852 bytes
 bench/weird_name1.cdf                              |   Bin 0 -> 1412 bytes
 bench/write_int_att.nc                             |   Bin 0 -> 1844 bytes
 bench/xml_header_script.jnl                        |    22 +
 bench/xml_use_coads.jnl                            |     2 +
 bench/xml_use_numstring.jnl                        |     2 +
 bench/xsz.nc                                       |   Bin 0 -> 1544 bytes
 bench/xz_nozattrib.nc                              |   Bin 0 -> 764 bytes
 bench/z_wide_variation.nc                          |   Bin 0 -> 1312 bytes
 bin/Fdata                                          |    25 +
 bin/Fdescr                                         |    25 +
 bin/Fenv                                           |     5 +
 bin/Fgo                                            |    79 +
 bin/Fgrids                                         |    25 +
 bin/Finstall                                       |   535 +
 bin/Fpalette                                       |    79 +
 bin/Fpattern                                       |    79 +
 bin/Fprint_template                                |   297 +
 bin/Fpurge                                         |    15 +
 bin/FshowGO                                        |    19 +
 bin/Fsort                                          |    17 +
 bin/Fsort.nawk                                     |    36 +
 bin/build_fonts/README                             |    27 +
 bin/build_fonts/unix/Makefile                      |    89 +
 bin/build_fonts/unix/binary.F                      |    34 +
 bin/build_fonts/unix/fondat.dat                    |    33 +
 bin/build_fonts/unix/in_fnt01a.chr                 |    66 +
 bin/build_fonts/unix/in_fnt02a.chr                 |   132 +
 bin/build_fonts/unix/in_fnt03a.chr                 |   208 +
 bin/build_fonts/unix/in_fnt04a.chr                 |   120 +
 bin/build_fonts/unix/in_fnt05a.chr                 |   144 +
 bin/build_fonts/unix/in_fnt06a.chr                 |   200 +
 bin/build_fonts/unix/in_fnt07a.chr                 |   232 +
 bin/build_fonts/unix/in_fnt08a.chr                 |   106 +
 bin/build_fonts/unix/in_fnt09a.chr                 |    82 +
 bin/build_fonts/unix/in_fnt10a.chr                 |    90 +
 bin/build_fonts/unix/in_fnt11a.chr                 |    80 +
 bin/build_fonts/unix/in_fnt12a.chr                 |    48 +
 bin/build_fonts/unix/in_fnt13a.chr                 |    84 +
 bin/build_fonts/unix/in_fnt14a.chr                 |    74 +
 bin/build_fonts/unix/in_fnt15a.chr                 |   186 +
 bin/build_fonts/unix/in_fnt16a.chr                 |   138 +
 bin/build_fonts/unix/in_fnt17a.chr                 |   118 +
 bin/build_fonts/unix/in_fnt18a.chr                 |    40 +
 bin/build_fonts/unix/in_fnt19a.chr                 |    22 +
 bin/build_fonts/unix/in_fnt20a.sym                 |    55 +
 bin/build_fonts/unix/in_fnt21a.sym                 |    61 +
 bin/build_fonts/unix/in_fnt22a.sym                 |    23 +
 bin/build_fonts/unix/in_fnt23a.sym                 |    20 +
 bin/build_fonts/unix/in_fnt24a.sym                 |   101 +
 bin/build_fonts/unix/in_fnt25a.sym                 |    42 +
 bin/build_fonts/unix/in_fnt26a.sym                 |    54 +
 bin/build_fonts/unix/in_fnt27a.sym                 |    20 +
 bin/build_fonts/unix/in_fnt28a.sym                 |    22 +
 bin/build_fonts/unix/in_fnt29a.sym                 |    59 +
 bin/build_fonts/unix/in_fnt30a.sym                 |    17 +
 bin/build_fonts/unix/in_fnt31a.chr                 |    78 +
 bin/build_fonts/unix/in_fnt32a.chr                 |   132 +
 bin/build_fonts/unix/in_fnt33a.sym                 |    42 +
 bin/ferret_paths_template.csh                      |    92 +
 bin/ferret_paths_template.sh                       |    94 +
 bin/install_ferret_links                           |    44 +
 bin/make_environment_tar                           |   162 +
 bin/make_executable_tar                            |   182 +
 bin/make_source_tar                                |   104 +
 bin/mtp                                            |     3 +
 bin/my_ferret_paths_template.csh                   |    28 +
 bin/my_ferret_paths_template.sh                    |    28 +
 bin/pyferret_template.csh                          |    55 +
 bin/pyferret_template.sh                           |    56 +
 efmem/Makefile                                     |    44 +
 efmem/copy_ferret_ef_mem_subsc.F                   |   330 +
 external_functions/Makefile                        |    88 +
 external_functions/cat/Makefile                    |    50 +
 external_functions/cat/list_good.F                 |   251 +
 external_functions/cat/tcat.F                      |   231 +
 external_functions/cat/tcat_str.F                  |   229 +
 external_functions/cat/treverse.F                  |   186 +
 external_functions/cat/xcat.F                      |   229 +
 external_functions/cat/xcat_str.F                  |   231 +
 external_functions/cat/xreverse.F                  |   185 +
 external_functions/cat/ycat.F                      |   232 +
 external_functions/cat/ycat_str.F                  |   230 +
 external_functions/cat/yreverse.F                  |   185 +
 external_functions/cat/zcat.F                      |   231 +
 external_functions/cat/zcat_str.F                  |   229 +
 external_functions/cat/zreverse.F                  |   185 +
 .../cflib/curv_to_lonlat_from_weights.c            |   253 +
 external_functions/cflib/curv_to_lonlat_regrid.c   |   270 +
 external_functions/cflib/fcn_curv_to_lonlat.c      |   281 +
 external_functions/closest_in_list/Makefile        |    48 +
 .../closest_in_list/closest_in_zlist.F             |   260 +
 external_functions/cmprsi_by/Makefile              |    53 +
 external_functions/cmprsi_by/cmprsi_by.F           |   239 +
 external_functions/cmprsi_by/expndi_by.F           |   242 +
 external_functions/cmprsi_by/expndi_by_t.F         |   272 +
 external_functions/cmprsi_by/expndi_by_z.F         |   272 +
 external_functions/cmprsi_by/expndi_by_z_counts.F  |   273 +
 .../cmprsi_by/expndi_id_by_z_counts.F              |   246 +
 external_functions/contributed/Makefile            |    56 +
 external_functions/contributed/chdir.F             |   158 +
 external_functions/contributed/chdir_pmel.F        |   148 +
 external_functions/contributed/fill_xy.F           |   251 +
 external_functions/contributed/neutral.F           |   272 +
 external_functions/contributed/pco2.F              |   722 +
 external_functions/contributed/pco2_exampels.jnl   |    16 +
 external_functions/contributed/species.h           |    11 +
 external_functions/convolve/Makefile               |    52 +
 external_functions/convolve/convolvei.F            |   256 +
 external_functions/convolve/convolvej.F            |   255 +
 external_functions/convolve/convolvek.F            |   257 +
 external_functions/convolve/convolvel.F            |   254 +
 external_functions/date_and_time/Makefile          |    61 +
 external_functions/date_and_time/date1900.F        |   211 +
 external_functions/date_and_time/date_decode.c     |   107 +
 .../date_and_time/days1900toymdhms.F               |   241 +
 external_functions/date_and_time/minutes24.F       |   211 +
 external_functions/date_and_time/secs_to_ymdhms.F  |   147 +
 external_functions/date_and_time/time_decode.c     |    83 +
 external_functions/date_and_time/xgodae_obs.cmn    |     6 +
 external_functions/decimate/Makefile               |    41 +
 external_functions/decimate/decimate.jnl           |   137 +
 external_functions/decimate/piecewise.F            |   761 +
 external_functions/decimate/piecewise3.F           |   891 +
 external_functions/decimate/sample.jnl             |   184 +
 external_functions/decimate/sample3.jnl            |    90 +
 external_functions/decimate/sample_fast_i.F        |   167 +
 external_functions/decimate/separate.F             |   254 +
 .../ef_utility/ferret_cmn/EF_Util.cmn              |    80 +
 .../ef_utility/ferret_cmn/EF_Util.parm             |    79 +
 .../ef_utility/ferret_cmn/EF_Util_f90.inc          |    81 +
 .../ef_utility/ferret_cmn/EF_Util_f90.parm         |    44 +
 .../ef_utility/ferret_cmn/EF_mem_subsc.cmn         |   147 +
 .../ef_utility/ferret_cmn/EF_mem_subsc_f90.inc     |   147 +
 .../platform_specific.mk.i386-apple-darwin         |    37 +
 .../ef_utility/platform_specific.mk.i386-linux     |    49 +
 .../ef_utility/platform_specific.mk.i386-linux-gnu |    49 +
 .../ef_utility/platform_specific.mk.intel-mac      |    42 +
 .../ef_utility/platform_specific.mk.x86_64-linux   |    50 +
 .../platform_specific.mk.x86_64-linux-gnu          |    50 +
 external_functions/ef_utility/site_specific.mk     |    38 +
 external_functions/eof/Makefile                    |    61 +
 external_functions/eof/ann_trend.F                 |   198 +
 external_functions/eof/anntrend_subs.F             |   727 +
 external_functions/examples/Makefile               |    56 +
 external_functions/examples/add_9.F                |   357 +
 external_functions/examples/appende.F              |   288 +
 external_functions/examples/avet.F                 |   195 +
 external_functions/examples/check6dlist.csh        |    25 +
 external_functions/examples/custom.F               |   200 +
 external_functions/examples/dates.F                |   293 +
 external_functions/examples/extend.F               |   136 +
 external_functions/examples/factorial.F            |   187 +
 external_functions/examples/pass_thru.F            |   186 +
 external_functions/examples/percent_good_t.F       |   202 +
 external_functions/examples/status.F               |   189 +
 external_functions/examples/storage.F              |   253 +
 external_functions/examples/string_arg.F           |   196 +
 external_functions/examples/strings.F              |   177 +
 external_functions/examples/subtract.F             |   199 +
 external_functions/examples/times_table.F          |   214 +
 external_functions/extrema/Makefile                |    58 +
 external_functions/extrema/findhi.F                |   356 +
 external_functions/extrema/findlo.F                |   359 +
 external_functions/extrema/maxminmax.F             |   199 +
 external_functions/extrema/minmax_label_demo.jnl   |    29 +
 external_functions/extrema/minminmax.F             |   196 +
 external_functions/extrema/testr.jnl               |    36 +
 external_functions/featurecollections/Makefile     |    40 +
 .../featurecollections/expnd_by_len.F              |   231 +
 external_functions/featurecollections/fc_isubset.F |   289 +
 external_functions/fft/Makefile                    |    60 +
 external_functions/fft/del_lopass.jnl              |     8 +
 external_functions/fft/delta_function.jnl          |    16 +
 external_functions/fft/fft_amp.F                   |   452 +
 external_functions/fft/fft_im.F                    |   462 +
 external_functions/fft/fft_inverse.F               |   383 +
 external_functions/fft/fft_phas.F                  |   455 +
 external_functions/fft/fft_re.F                    |   463 +
 external_functions/fft/fft_sunspot.jnl             |    50 +
 external_functions/fft/fft_synthesis_demo.jnl      |    36 +
 external_functions/fft/ffta.F                      |   474 +
 external_functions/fft/ffta_sample.F               |   443 +
 external_functions/fft/fftinv_subs.F               |   523 +
 external_functions/fft/fftp.F                      |   477 +
 external_functions/fft/fftp_sample.F               |   449 +
 external_functions/fft/fftsubs.F                   |   671 +
 external_functions/fft/invert.jnl                  |    70 +
 external_functions/fft/lsl_lowpass.F               |   430 +
 external_functions/fft/sunspot_fft.dat             |   154 +
 external_functions/fft/suntest.jnl                 |    29 +
 external_functions/fft/yearssn.dat                 |   301 +
 external_functions/godae_obs/Makefile              |    57 +
 external_functions/godae_obs/godae_obs.F           |   224 +
 external_functions/godae_obs/ocn_obs.F             |  1153 +
 external_functions/godae_obs/ocn_types.h           |   104 +
 external_functions/godae_obs/xgodae_obs.cmn        |     6 +
 external_functions/gridding/Makefile               |    59 +
 external_functions/gridding/ave_scat2grid_t.F      |   386 +
 .../gridding/fco2_xyt_stats_year.jnl               |    84 +
 external_functions/gridding/index_to_grid.F        |   211 +
 external_functions/gridding/modscatminmax.F        |    76 +
 external_functions/gridding/nobsxytv.F             |    67 +
 .../gridding/scat2grid_mask_bin_xyt.F              |   530 +
 .../gridding/scat2grid_mask_minmax_xyt.F           |   545 +
 .../gridding/scat2grid_mask_nbin_xyt.F             |   486 +
 .../gridding/scat2grid_mask_std_xyt.F              |   615 +
 external_functions/gridding/scat2grid_minmax_xyt.F |   499 +
 external_functions/gridding/scat2grid_nobs_xy.F    |   445 +
 external_functions/gridding/scat2grid_std_xyt.F    |   553 +
 external_functions/gridding/scat2grid_subs.F       |   210 +
 external_functions/gridding/scat2grid_subs_mask.F  |    62 +
 external_functions/gridding/scat2grid_t.F          |   381 +
 external_functions/gridding/socat_decadal.jnl      |    99 +
 .../gridding/socat_monthly_climatology.jnl         |    96 +
 external_functions/gridding/socat_yearly.jnl       |    93 +
 .../gridding/test_tracks2grid_var_xyt.jnl          |    64 +
 .../gridding/tracks2grid_ave_fco2_xyt_stats.jnl    |    57 +
 external_functions/gridding/tracks2grid_ave_xyt.F  |   710 +
 .../gridding/tracks2grid_mask_ave_xyt.F            |   732 +
 external_functions/gridding/tracks2grid_std_xyt.F  |   897 +
 external_functions/gridding/tracks2grid_var_xyt.F  |   942 +
 external_functions/hinterp/Makefile                |    56 +
 external_functions/hinterp/curv_range.F            |   736 +
 external_functions/hinterp/curv_to_rect.F          |   329 +
 external_functions/hinterp/curv_to_rect_fsu.F      |   329 +
 external_functions/hinterp/curv_to_rect_map.F      |  1092 +
 external_functions/hinterp/rect_to_curv.F          |  1029 +
 external_functions/lanczos/Makefile                |    51 +
 external_functions/lanczos/lanczos.F               |   319 +
 external_functions/lanczos/orig_code/lanczos.tar   |   Bin 0 -> 30720 bytes
 external_functions/las/Makefile                    |    56 +
 external_functions/las/list_value_xml.F            |   317 +
 external_functions/las/write_webrow.F              |   271 +
 external_functions/las/write_webrow_gwt.F          |   271 +
 external_functions/matlab/Makefile                 |    65 +
 external_functions/matlab/matlab.F                 |   176 +
 external_functions/matlab/matlab_func.F            |   230 +
 external_functions/matlab/matlab_func_link.c       |   147 +
 external_functions/matlab/matlab_link.c            |    83 +
 external_functions/ncedit/Makefile                 |    55 +
 external_functions/ncedit/nco.F                    |   143 +
 external_functions/ncedit/nco_attr.F               |   336 +
 external_functions/obs_viz/Makefile                |    50 +
 external_functions/obs_viz/flag2ddups.F            |    90 +
 external_functions/obs_viz/scat2ddups.F            |   256 +
 external_functions/pnpoly/Makefile                 |    49 +
 external_functions/pnpoly/pnpoly_subs.F            |   289 +
 external_functions/pnpoly/pt_in_poly.F             |   285 +
 external_functions/pyef/template.py                |    87 +
 external_functions/romea/Makefile                  |    54 +
 external_functions/romea/ffta_2.F                  |   450 +
 external_functions/romea/ffta_3.F                  |   446 +
 external_functions/romea/ffta_sample_rr.F          |   452 +
 external_functions/romea/fftabst.F                 |   379 +
 external_functions/romea/rr_adv_sx.F               |   237 +
 external_functions/romea/rr_adv_sy.F               |   229 +
 external_functions/romea/rr_adv_sz.F               |   232 +
 external_functions/romea/rr_adv_tx.F               |   185 +
 external_functions/romea/rr_adv_ty.F               |   190 +
 external_functions/romea/rr_adv_tz.F               |   121 +
 external_functions/romea/rr_adv_umetric.F          |   181 +
 external_functions/romea/rr_adv_ux.F               |   274 +
 external_functions/romea/rr_adv_uy.F               |   276 +
 external_functions/romea/rr_adv_uz.F               |   287 +
 external_functions/romea/rr_adv_vmetric.F          |   156 +
 external_functions/romea/rr_adv_vx.F               |   286 +
 external_functions/romea/rr_adv_vy.F               |   244 +
 external_functions/romea/rr_adv_vz.F               |   290 +
 external_functions/romea/rr_av.F                   |   288 +
 external_functions/romea/rr_cross_spectrum.F       |  1908 +
 external_functions/romea/rr_cross_spectrum_abs.F   |  1795 +
 external_functions/romea/rr_cross_spectrum_orig.F  |  1796 +
 external_functions/romea/rr_density.F              |    51 +
 external_functions/romea/rr_diff_sx.F              |   233 +
 external_functions/romea/rr_diff_sy.F              |   218 +
 external_functions/romea/rr_diff_sz.F              |   455 +
 external_functions/romea/rr_diff_tx.F              |   204 +
 external_functions/romea/rr_diff_ty.F              |   213 +
 external_functions/romea/rr_diff_tz.F              |   428 +
 external_functions/romea/rr_diff_umetric.F         |   219 +
 external_functions/romea/rr_diff_ux.F              |   236 +
 external_functions/romea/rr_diff_uy.F              |   255 +
 external_functions/romea/rr_diff_uz.F              |   425 +
 external_functions/romea/rr_diff_vmetric.F         |   220 +
 external_functions/romea/rr_diff_vx.F              |   250 +
 external_functions/romea/rr_diff_vy.F              |   255 +
 external_functions/romea/rr_diff_vz.F              |   418 +
 external_functions/romea/rr_dsdt.F                 |   153 +
 external_functions/romea/rr_dtdt.F                 |   152 +
 external_functions/romea/rr_dudt.F                 |   153 +
 external_functions/romea/rr_dvdt.F                 |   167 +
 external_functions/romea/rr_flux_sx.F              |   234 +
 external_functions/romea/rr_flux_sy.F              |   230 +
 external_functions/romea/rr_flux_sz.F              |   273 +
 external_functions/romea/rr_flux_tx.F              |   239 +
 external_functions/romea/rr_flux_ty.F              |   229 +
 external_functions/romea/rr_flux_tz.F              |   119 +
 external_functions/romea/rr_flux_ux.F              |   175 +
 external_functions/romea/rr_flux_uy.F              |   194 +
 external_functions/romea/rr_flux_uz.F              |   216 +
 external_functions/romea/rr_flux_vx.F              |   274 +
 external_functions/romea/rr_flux_vy.F              |   240 +
 external_functions/romea/rr_flux_vz.F              |   285 +
 external_functions/romea/rr_fv.F                   |   112 +
 external_functions/romea/rr_geopotential_height.F  |   247 +
 external_functions/romea/rr_grad_pbc_u.F           |   297 +
 external_functions/romea/rr_grad_pbc_v.F           |   306 +
 external_functions/romea/rr_grad_ps_u.F            |   194 +
 external_functions/romea/rr_grad_ps_v.F            |   185 +
 external_functions/romea/rr_parameters.h           |   123 +
 external_functions/romea/rr_taux.F                 |   368 +
 external_functions/romea/rr_tauy.F                 |   366 +
 external_functions/romea/rr_uux_qiao.F             |   109 +
 external_functions/romea/rr_vuy_qiao.F             |   108 +
 external_functions/romea/rr_w_qiao.F               |   158 +
 external_functions/romea/rr_wuz_qiao.F             |    84 +
 external_functions/sort/Makefile                   |    56 +
 external_functions/sort/bin_index_wt.F             |   206 +
 external_functions/sort/compressi.F                |   231 +
 external_functions/sort/compressi_str.F            |   278 +
 external_functions/sort/compressj.F                |   231 +
 external_functions/sort/compressk.F                |   231 +
 external_functions/sort/compressl.F                |   230 +
 external_functions/sort/element_index.F            |   198 +
 external_functions/sort/element_index_str.F        |   215 +
 external_functions/sort/is_element_of.F            |   244 +
 external_functions/sort/is_element_of_str.F        |   263 +
 external_functions/sort/pickt.F                    |   296 +
 external_functions/sort/pickx.F                    |   297 +
 external_functions/sort/picky.F                    |   296 +
 external_functions/sort/pickz.F                    |   297 +
 external_functions/sort/samplei_multi.F            |   274 +
 external_functions/sort/samplej_multi.F            |   273 +
 external_functions/sort/samplek_multi.F            |   275 +
 external_functions/sort/samplel_multi.F            |   278 +
 external_functions/sort/samplexy_closest.F         |   577 +
 external_functions/sort/samplexy_curv.F            |   472 +
 external_functions/sort/samplexy_curv_avg.F        |   548 +
 external_functions/sort/samplexy_curv_nrst.F       |   537 +
 external_functions/sort/samplexyt.F                |   691 +
 external_functions/sort/samplexyt_nrst.F           |   721 +
 external_functions/sort/samplexz.F                 |   538 +
 external_functions/sort/sampleyz.F                 |   543 +
 external_functions/sort/shellsort.F                |    43 +
 external_functions/sort/sorti_str.F                |   403 +
 external_functions/sort/string_to_id.F             |   188 +
 external_functions/statistics/Makefile             |    55 +
 .../statistics/get_student_t_carson.F              |    73 +
 external_functions/statistics/locij.F              |   199 +
 external_functions/statistics/minmax.F             |   180 +
 external_functions/statistics/student_t.F          |    77 +
 external_functions/statistics/student_t_cutoff.F   |   203 +
 .../statistics/student_t_cutoff_df.F               |   197 +
 external_functions/stringfcns/Makefile             |    57 +
 external_functions/stringfcns/efstrings.F          |   215 +
 external_functions/stringfcns/length_of_strings.F  |   145 +
 external_functions/stringfcns/maxstrlen.F          |   105 +
 external_functions/stringfcns/pass_thru_string.F   |   153 +
 external_functions/stringfcns/pick_a_string.F      |   210 +
 external_functions/stringfcns/str_missing.F        |   206 +
 external_functions/stringfcns/string_cat3.F        |   193 +
 external_functions/stringfcns/string_len_sum.F     |   182 +
 external_functions/stringfcns/strings_as_args.F    |   209 +
 external_functions/stringfcns/stringtests.jnl      |    51 +
 external_functions/tax_times/Makefile              |    51 +
 external_functions/tax_times/tax.h                 |     2 +
 external_functions/tax_times/tax_datestring.F      |   260 +
 external_functions/tax_times/tax_day.F             |   187 +
 external_functions/tax_times/tax_dayfrac.F         |   188 +
 .../tax_times/tax_index_datestring.F               |   309 +
 external_functions/tax_times/tax_jday.F            |   225 +
 external_functions/tax_times/tax_jday1900.F        |   277 +
 external_functions/tax_times/tax_month.F           |   196 +
 external_functions/tax_times/tax_times.F           |   177 +
 external_functions/tax_times/tax_tstep.F           |   646 +
 external_functions/tax_times/tax_units.F           |   226 +
 external_functions/tax_times/tax_year.F            |   185 +
 external_functions/tax_times/tax_yearfrac.F        |   240 +
 external_functions/tax_times/xunits.cmn_text       |    48 +
 external_functions/tax_times/xunits_data.F         |   217 +
 external_functions/transpose/Makefile              |    55 +
 external_functions/transpose/transpose_xt.F        |   222 +
 external_functions/transpose/transpose_xy.F        |   222 +
 external_functions/transpose/transpose_xz.F        |   222 +
 external_functions/transpose/transpose_yt.F        |   222 +
 external_functions/transpose/transpose_yz.F        |   222 +
 external_functions/transpose/transpose_zt.F        |   222 +
 external_functions/v5d/Makefile                    |    58 +
 external_functions/v5d/binio.c                     |   813 +
 external_functions/v5d/binio.h                     |   109 +
 external_functions/v5d/config.h                    |   325 +
 external_functions/v5d/v5d.c                       |  3298 +
 external_functions/v5d/v5d.h                       |   345 +
 .../v5d/v5d_platform_specific_flags.mk.i386-linux  |     8 +
 .../v5d_platform_specific_flags.mk.x86_64-darwin   |     8 +
 .../v5d_platform_specific_flags.mk.x86_64-linux    |     8 +
 external_functions/v5d/v5df_fer.h                  |    40 +
 external_functions/v5d/vis5d.h                     |   112 +
 external_functions/v5d/vis5d_append.jnl            |    35 +
 external_functions/v5d/vis5d_start.jnl             |    17 +
 external_functions/v5d/vis5d_write.jnl             |    34 +
 external_functions/v5d/writev5d.F                  |  1322 +
 external_functions/zaxr/Makefile                   |    54 +
 external_functions/zaxr/zaxreplace_avg.F           |   488 +
 external_functions/zaxr/zaxreplace_avg.jnl         |   153 +
 external_functions/zaxr/zaxreplace_bin.F           |   416 +
 external_functions/zaxr/zaxreplace_lin.F           |   384 +
 external_functions/zaxr/zaxreplace_rev.F           |   486 +
 external_functions/zaxr/zaxreplace_xyt.F           |   384 +
 external_functions/zaxr/zaxreplace_zlev.F          |   471 +
 fer/AIX_MODIFICATIONS.LOG                          |   347 +
 fer/AIX_MODIFICATIONS_SCHMIDT.LOG                  |   330 +
 fer/Makefile                                       |   114 +
 fer/ccr/EF_InternalUtil.c                          |  4161 +
 fer/ccr/LIB_NAME                                   |     1 +
 fer/ccr/Makefile                                   |    36 +
 fer/ccr/SOURCE_FILES                               |    42 +
 fer/ccr/add_c_pointer.c                            |    64 +
 fer/ccr/batch_graphics.c                           |    75 +
 fer/ccr/binaryRead.c                               |   524 +
 fer/ccr/binaryRead.h                               |    70 +
 fer/ccr/c_dncase.c                                 |    75 +
 fer/ccr/c_strcat.c                                 |    92 +
 fer/ccr/c_strcmp.c                                 |    63 +
 fer/ccr/c_strfloat.c                               |    74 +
 fer/ccr/c_strindex.c                               |    66 +
 fer/ccr/c_strlen.c                                 |    56 +
 fer/ccr/c_strrindex.c                              |    73 +
 fer/ccr/c_substr.c                                 |    87 +
 fer/ccr/c_upcase.c                                 |    75 +
 fer/ccr/check_nan_data_sub.c                       |    70 +
 fer/ccr/compare_c_strings.c                        |    62 +
 fer/ccr/copy_c_string.c                            |    64 +
 fer/ccr/ferret_dispatch_c.c                        |   139 +
 fer/ccr/ferret_query.c                             |   155 +
 fer/ccr/free_c_pointer.c                           |    50 +
 fer/ccr/free_c_string_array.c                      |    64 +
 fer/ccr/get_c_string.c                             |    59 +
 fer/ccr/get_c_string_len.c                         |    53 +
 fer/ccr/get_max_c_string_len.c                     |    65 +
 fer/ccr/get_offset_c_string.c                      |    70 +
 fer/ccr/get_offset_c_string_len.c                  |    59 +
 fer/ccr/get_sys_cmnd.c                             |   180 +
 fer/ccr/gui_init.c                                 |    64 +
 fer/ccr/init_c_string_array.c                      |    61 +
 fer/ccr/linux_routines_c.c                         |    50 +
 fer/ccr/list.c                                     |   485 +
 fer/ccr/perl_read.c                                |    23 +
 fer/ccr/replace_bad_data_sub.c                     |    79 +
 fer/ccr/replaceable_bad_flags.c                    |    63 +
 fer/ccr/run_thredds_browser.c                      |   277 +
 fer/ccr/run_thredds_browser.h                      |    21 +
 fer/ccr/save_arg_pointers.c                        |   134 +
 fer/ccr/save_c_string.c                            |    72 +
 fer/ccr/set_nan.c                                  |    77 +
 fer/ccr/set_null_c_string.c                        |    55 +
 fer/ccr/set_null_c_string_array.c                  |    62 +
 fer/ccr/sizeof_pointer.c                           |    45 +
 fer/ccr/write_dods.c                               |   170 +
 fer/ccr/xfer_c_ptrs.c                              |    68 +
 fer/cferbind/Makefile                              |    39 +
 fer/cferbind/cairoCFerBind.h                       |   171 +
 fer/cferbind/cairoCFerBind_beginSegment.c          |    50 +
 fer/cferbind/cairoCFerBind_beginView.c             |    67 +
 fer/cferbind/cairoCFerBind_clearWindow.c           |    76 +
 fer/cferbind/cairoCFerBind_clipView.c              |    71 +
 fer/cferbind/cairoCFerBind_createBrush.c           |    90 +
 fer/cferbind/cairoCFerBind_createColor.c           |    76 +
 fer/cferbind/cairoCFerBind_createFont.c            |    34 +
 fer/cferbind/cairoCFerBind_createPen.c             |   176 +
 fer/cferbind/cairoCFerBind_createSurface.c         |   189 +
 fer/cferbind/cairoCFerBind_createSymbol.c          |    67 +
 fer/cferbind/cairoCFerBind_createWindow.c          |   101 +
 fer/cferbind/cairoCFerBind_deleteBrush.c           |    44 +
 fer/cferbind/cairoCFerBind_deleteColor.c           |    40 +
 fer/cferbind/cairoCFerBind_deleteFont.c            |    32 +
 fer/cferbind/cairoCFerBind_deletePen.c             |    40 +
 fer/cferbind/cairoCFerBind_deleteSegment.c         |    96 +
 fer/cferbind/cairoCFerBind_deleteSymbol.c          |    30 +
 fer/cferbind/cairoCFerBind_deleteWindow.c          |    63 +
 fer/cferbind/cairoCFerBind_drawMultiline.c         |   116 +
 fer/cferbind/cairoCFerBind_drawPoints.c            |   203 +
 fer/cferbind/cairoCFerBind_drawPolygon.c           |   220 +
 fer/cferbind/cairoCFerBind_drawRectangle.c         |   213 +
 fer/cferbind/cairoCFerBind_drawText.c              |    51 +
 fer/cferbind/cairoCFerBind_endSegment.c            |    46 +
 fer/cferbind/cairoCFerBind_endView.c               |   102 +
 fer/cferbind/cairoCFerBind_redrawWindow.c          |    43 +
 fer/cferbind/cairoCFerBind_replaceBrushColor.c     |    45 +
 fer/cferbind/cairoCFerBind_replacePenColor.c       |    45 +
 fer/cferbind/cairoCFerBind_resizeWindow.c          |    79 +
 fer/cferbind/cairoCFerBind_saveWindow.c            |   551 +
 fer/cferbind/cairoCFerBind_scaleWindow.c           |    28 +
 fer/cferbind/cairoCFerBind_setAntialias.c          |    45 +
 fer/cferbind/cairoCFerBind_setImageName.c          |   161 +
 fer/cferbind/cairoCFerBind_setWidthFactor.c        |    37 +
 fer/cferbind/cairoCFerBind_showWindow.c            |    27 +
 fer/cferbind/cairoCFerBind_updateWindow.c          |    26 +
 fer/cferbind/cairoCFerBind_windowScreenInfo.c      |    32 +
 fer/cferbind/cferbind.h                            |   104 +
 fer/cferbind/cferbind_createWindow.c               |    61 +
 fer/cferbind/pyqtcairoCFerBind.h                   |    26 +
 fer/cferbind/pyqtcairoCFerBind_clearWindow.c       |    94 +
 fer/cferbind/pyqtcairoCFerBind_createWindow.c      |   120 +
 fer/cferbind/pyqtcairoCFerBind_deleteWindow.c      |    53 +
 fer/cferbind/pyqtcairoCFerBind_redrawWindow.c      |    75 +
 fer/cferbind/pyqtcairoCFerBind_resizeWindow.c      |    71 +
 fer/cferbind/pyqtcairoCFerBind_saveWindow.c        |    74 +
 fer/cferbind/pyqtcairoCFerBind_scaleWindow.c       |    37 +
 fer/cferbind/pyqtcairoCFerBind_setImageName.c      |    67 +
 fer/cferbind/pyqtcairoCFerBind_showWindow.c        |    37 +
 fer/cferbind/pyqtcairoCFerBind_updateWindow.c      |   174 +
 fer/cferbind/pyqtcairoCFerBind_windowScreenInfo.c  |    41 +
 fer/common/EF_Util.cmn                             |    80 +
 fer/common/EF_Util.h                               |   207 +
 fer/common/EF_Util.parm                            |    79 +
 fer/common/EF_mem_subsc.cmn                        |   146 +
 fer/common/command.parm                            |    71 +
 fer/common/dsimple.h                               |    53 +
 fer/common/errmsg.parm                             |   136 +
 fer/common/ferret.h                                |   120 +
 fer/common/ferret.parm                             |   695 +
 fer/common/ferret_query.parm                       |    17 +
 fer/common/ferret_shared_buffer.h                  |    55 +
 fer/common/fgrdel.cmn                              |   164 +
 fer/common/gfdl.parm                               |    39 +
 fer/common/gfdl_vms.parm                           |     6 +
 fer/common/gfnext.parm                             |     6 +
 fer/common/grid_chg_fcns.parm                      |   101 +
 fer/common/gui.parm                                |    65 +
 fer/common/instance_table.parm                     |   133 +
 fer/common/interp_stack.parm                       |   206 +
 fer/common/list.h                                  |    90 +
 fer/common/movies.parm                             |     5 +
 fer/common/netcdf4_settings.cmn                    |    52 +
 fer/common/plot_setup.parm                         |   155 +
 fer/common/ppl_ax_save.cmn                         |    14 +
 fer/common/ppl_dash_save.cmn                       |    17 +
 fer/common/pyferret.parm                           |    36 +
 fer/common/rpn.parm                                |    45 +
 fer/common/slash.parm                              |   702 +
 fer/common/vax_machine.parm                        |    11 +
 fer/common/xactivity.cmn                           |    26 +
 fer/common/xalgebra.cmn                            |   110 +
 fer/common/xax_speed.cmn                           |     8 +
 fer/common/xbox_bounds.cmn                         |     4 +
 fer/common/xcalc_vars.cmn                          |    85 +
 fer/common/xcommand.cmn                            |   463 +
 fer/common/xcontext.cmn                            |   186 +
 fer/common/xcontext.equiv                          |    69 +
 fer/common/xcontrol.cmn                            |    76 +
 fer/common/xcurvilinear.cmn                        |    65 +
 fer/common/xcvar_calcs.cmn                         |     8 +
 fer/common/xdelta_context.cmn                      |    13 +
 fer/common/xdependency_tree.cmn                    |    54 +
 fer/common/xdset_parms.cmn                         |    55 +
 fer/common/xeddy.cmn                               |     2 +
 fer/common/xerrmsg_text.cmn                        |    24 +
 fer/common/xfr_grid.cmn                            |    31 +
 fer/common/xgfdl_masks.cmn                         |    12 +
 fer/common/xgks_devices.cmn                        |    16 +
 fer/common/xgrid_chg_fcns.cmn                      |    91 +
 fer/common/xgui.cmn                                |    19 +
 fer/common/xinterrupt.cmn                          |     3 +
 fer/common/xlbr_io.cmn                             |     5 +
 fer/common/xmake_date.cmn                          |     5 +
 fer/common/xmem_subsc.cmn                          |    78 +
 fer/common/xonedim.cmn                             |    55 +
 fer/common/xplatform_type.cmn                      |     8 +
 fer/common/xplot_setup.cmn                         |   108 +
 fer/common/xplot_state.cmn                         |   133 +
 fer/common/xpplus.cmn                              |     6 +
 fer/common/xprog_state.cmn                         |   307 +
 fer/common/xpyvar_info.cmn                         |    34 +
 fer/common/xregrid.cmn                             |    14 +
 fer/common/xrevision.cmn                           |     9 +
 fer/common/xrevision_type.cmn                      |     6 +
 fer/common/xrisc.cmn                               |    20 +
 fer/common/xtext_info.cmn                          |    29 +
 fer/common/xtoday.cmn                              |    16 +
 fer/common/xvariables.cmn                          |   442 +
 fer/common/xvideo.cmn                              |     2 +
 fer/common/xwindow_state.cmn                       |    11 +
 fer/common/xwork_space.cmn                         |     7 +
 fer/ctx/LIB_NAME                                   |     1 +
 fer/ctx/Makefile                                   |    37 +
 fer/ctx/SOURCE_FILES                               |    52 +
 fer/ctx/add_rdc_xform.F                            |   150 +
 fer/ctx/addl_cx_doc.F                              |   119 +
 fer/ctx/apply_auto_curv.F                          |   151 +
 fer/ctx/apply_context_mods.F                       |   182 +
 fer/ctx/apply_delta_context.F                      |   116 +
 fer/ctx/aux_axis_from_arg.F                        |    59 +
 fer/ctx/cgrid_axis.F                               |    63 +
 fer/ctx/cgrid_size.F                               |    64 +
 fer/ctx/cgrid_size_max.F                           |    88 +
 fer/ctx/complete_missing_limits.F                  |   180 +
 fer/ctx/confine_context.F                          |    75 +
 fer/ctx/create_new_context.F                       |    66 +
 fer/ctx/cs_set_context.F                           |    91 +
 fer/ctx/cx_dim_len.F                               |    61 +
 fer/ctx/cx_dim_len_zero.F                          |    64 +
 fer/ctx/cx_ww_pos.F                                |    72 +
 fer/ctx/del_cx_dim.F                               |    66 +
 fer/ctx/flesh_out_axis.F                           |   328 +
 fer/ctx/forget_past_context_mods.F                 |    64 +
 fer/ctx/get_auto_aux_vars.F                        |   130 +
 fer/ctx/get_aux_var_context.F                      |   174 +
 fer/ctx/get_context_bad_flag.F                     |    81 +
 fer/ctx/get_context_grid.F                         |   447 +
 fer/ctx/get_cx_dims.F                              |    95 +
 fer/ctx/get_cx_dims_zero.F                         |   111 +
 fer/ctx/get_cx_modulo_axes.F                       |    67 +
 fer/ctx/get_delta_context.F                        |   124 +
 fer/ctx/get_new_cx.F                               |   113 +
 fer/ctx/get_var_context.F                          |   239 +
 fer/ctx/get_var_grid.F                             |   105 +
 fer/ctx/grp_cx_doc.F                               |    80 +
 fer/ctx/inherited_limits.F                         |    81 +
 fer/ctx/init_context_mods.F                        |   104 +
 fer/ctx/init_empty_context.F                       |    95 +
 fer/ctx/known_data_type.F                          |   129 +
 fer/ctx/merge_axis_with_offsets.F                  |   123 +
 fer/ctx/merge_context.F                            |   326 +
 fer/ctx/merge_grid.F                               |   589 +
 fer/ctx/mergify_cx.F                               |    90 +
 fer/ctx/nest_region_class.F                        |   123 +
 fer/ctx/ov_grp_cx_doc.F                            |    77 +
 fer/ctx/ovsiz_cx.F                                 |   119 +
 fer/ctx/parse_nam_dset.F                           |   176 +
 fer/ctx/parse_var_name.F                           |   319 +
 fer/ctx/plotify_grp_cx.F                           |   116 +
 fer/ctx/pseudo_var_context.F                       |   341 +
 fer/ctx/reconcile_com_dst_cx.F                     |    79 +
 fer/ctx/region_class.F                             |    84 +
 fer/ctx/restrict_file_limits.F                     |   114 +
 fer/ctx/set_doc_flag.F                             |    76 +
 fer/ctx/transfer_context.F                         |   103 +
 fer/dat/LIB_NAME                                   |     1 +
 fer/dat/Makefile                                   |    37 +
 fer/dat/SOURCE_FILES                               |    25 +
 fer/dat/netcdf4_settings_data.F                    |    72 +
 fer/dat/xalgebra_data.F                            |   801 +
 fer/dat/xcalc_vars_data.F                          |  2472 +
 fer/dat/xcommand_data.F                            |  1814 +
 fer/dat/xcontext_data.F                            |   210 +
 fer/dat/xcontrol_data.F                            |    56 +
 fer/dat/xdependency_tree_data.F                    |    52 +
 fer/dat/xdset_parms_data.F                         |    77 +
 fer/dat/xfgrdel_data.F                             |   103 +
 fer/dat/xfr_grid_data.F                            |    52 +
 fer/dat/xgfdl_error_text_data.F                    |   309 +
 fer/dat/xgfdl_masks_data.F                         |  1264 +
 fer/dat/xgks_devices_data.F                        |    81 +
 fer/dat/xgrid_chg_fcns_data.F                      |  1224 +
 fer/dat/xgui_data.F                                |    58 +
 fer/dat/xonedim_data.F                             |    53 +
 fer/dat/xplot_setup_data.F                         |    63 +
 fer/dat/xplot_state_data.F                         |   164 +
 fer/dat/xprog_state_data.F                         |   379 +
 fer/dat/xpyvar_info_data.F                         |    63 +
 fer/dat/xrevision_data.F                           |   120 +
 fer/dat/xtext_info_data.F                          |   135 +
 fer/dat/xvariables_data.F                          |   133 +
 fer/dat/xwindow_state_data.F                       |    51 +
 fer/doo/LIB_NAME                                   |     1 +
 fer/doo/Makefile                                   |    37 +
 fer/doo/SOURCE_FILES                               |    96 +
 fer/doo/asn_ptr_regrid_1_axis.F                    |    86 +
 fer/doo/asn_regrid_1_axis.F                        |    86 +
 fer/doo/ave_regrid_1_axis.F                        |   979 +
 fer/doo/binom_wt.F                                 |    75 +
 fer/doo/convolve.F                                 |   384 +
 fer/doo/days_from_day0.F                           |   110 +
 fer/doo/dd1step.F                                  |   265 +
 fer/doo/dd2step.F                                  |   257 +
 fer/doo/diag_op.F                                  |   226 +
 fer/doo/do_4d_ave.F                                |    76 +
 fer/doo/do_4d_int_def.F                            |    76 +
 fer/doo/do_4d_nbd.F                                |    76 +
 fer/doo/do_4d_ngd.F                                |    76 +
 fer/doo/do_4d_string_goodbad.F                     |   224 +
 fer/doo/do_4d_string_trans.F                       |    87 +
 fer/doo/do_4d_sum.F                                |    76 +
 fer/doo/do_4d_trans.F                              |   478 +
 fer/doo/do_4d_var.F                                |    76 +
 fer/doo/do_asn_regrid.F                            |    66 +
 fer/doo/do_aux_var_regrid.F                        |    92 +
 fer/doo/do_aux_var_regrid_1d.F                     |   275 +
 fer/doo/do_aux_var_regrid_line_ave.F               |   178 +
 fer/doo/do_aux_var_regrid_line_lin.F               |   101 +
 fer/doo/do_ave_int.F                               |   348 +
 fer/doo/do_ave_regrid.F                            |    67 +
 fer/doo/do_average.F                               |    79 +
 fer/doo/do_deriv_bkwd.F                            |    83 +
 fer/doo/do_deriv_cntr.F                            |    76 +
 fer/doo/do_deriv_frwd.F                            |    83 +
 fer/doo/do_dist_loc.F                              |   333 +
 fer/doo/do_event.F                                 |   286 +
 fer/doo/do_external_gc_fcn.F                       |   138 +
 fer/doo/do_fill_ave.F                              |   410 +
 fer/doo/do_fill_interp.F                           |   653 +
 fer/doo/do_fill_near.F                             |   525 +
 fer/doo/do_int_indef.F                             |    77 +
 fer/doo/do_int_indef_sub.F                         |   265 +
 fer/doo/do_integ_def.F                             |    80 +
 fer/doo/do_internal_gc_fcn.F                       |  1008 +
 fer/doo/do_interpolate.F                           |   236 +
 fer/doo/do_lin_regrid.F                            |    64 +
 fer/doo/do_locate.F                                |   299 +
 fer/doo/do_max.F                                   |   210 +
 fer/doo/do_min.F                                   |   210 +
 fer/doo/do_nbad.F                                  |    77 +
 fer/doo/do_nearest.F                               |   288 +
 fer/doo/do_nearest_dist_above.F                    |    74 +
 fer/doo/do_nearest_dist_below.F                    |    74 +
 fer/doo/do_nearest_index_above.F                   |    75 +
 fer/doo/do_nearest_index_below.F                   |    75 +
 fer/doo/do_nearest_regrid.F                        |    70 +
 fer/doo/do_ngood.F                                 |    77 +
 fer/doo/do_points.F                                |   222 +
 fer/doo/do_run_sum.F                               |    76 +
 fer/doo/do_run_sum_sub.F                           |   210 +
 fer/doo/do_shift.F                                 |   177 +
 fer/doo/do_smth_binml.F                            |    88 +
 fer/doo/do_smth_box.F                              |    93 +
 fer/doo/do_smth_hanng.F                            |    89 +
 fer/doo/do_smth_max.F                              |    79 +
 fer/doo/do_smth_median.F                           |    86 +
 fer/doo/do_smth_min.F                              |    79 +
 fer/doo/do_smth_parzn.F                            |    88 +
 fer/doo/do_smth_welch.F                            |    88 +
 fer/doo/do_stddev.F                                |    80 +
 fer/doo/do_string_goodbad.F                        |   236 +
 fer/doo/do_string_shift.F                          |   162 +
 fer/doo/do_sum.F                                   |   215 +
 fer/doo/do_var_sub.F                               |   425 +
 fer/doo/do_variance.F                              |    81 +
 fer/doo/do_window_regrid.F                         |    65 +
 fer/doo/do_xact_regrid.F                           |    68 +
 fer/doo/do_xyave_regrid.F                          |    67 +
 fer/doo/do_xylin_regrid.F                          |    70 +
 fer/doo/geog_cos_factor.F                          |    84 +
 fer/doo/get_linear_coef.F                          |   115 +
 fer/doo/hanng_wt.F                                 |    69 +
 fer/doo/lin_regrid_1_axis.F                        |   428 +
 fer/doo/maxsmoother.F                              |   408 +
 fer/doo/median.F                                   |   447 +
 fer/doo/minsmoother.F                              |   406 +
 fer/doo/modulo_regrid.F                            |   786 +
 fer/doo/nearest_ptr_regrid_1_axis.F                |   305 +
 fer/doo/nearest_regrid_1_axis.F                    |   342 +
 fer/doo/normalize.F                                |    67 +
 fer/doo/parzn_wt.F                                 |    66 +
 fer/doo/regrid_comments.F                          |   233 +
 fer/doo/rho_unesco.F                               |   134 +
 fer/doo/theta_foff.F                               |   126 +
 fer/doo/welch_wt.F                                 |    66 +
 fer/doo/window_regrid_1_axis.F                     |   392 +
 fer/doo/xact_ptr_regrid_1_axis.F                   |   270 +
 fer/doo/xact_regrid_1_axis.F                       |   284 +
 fer/doo/xyave_regrid.F                             |   259 +
 fer/doo/xylin_regrid.F                             |   210 +
 fer/ef_utility/Makefile                            |    44 +
 fer/ef_utility/SOURCE_FILES                        |    82 +
 fer/ef_utility/ef_bail_out.F                       |    93 +
 fer/ef_utility/ef_get_arg_info.F                   |    76 +
 fer/ef_utility/ef_get_arg_mem_subscripts.F         |    82 +
 fer/ef_utility/ef_get_arg_mem_subscripts_6d.F      |   170 +
 fer/ef_utility/ef_get_arg_ss_extremes.F            |    84 +
 fer/ef_utility/ef_get_arg_ss_extremes_6d.F         |    78 +
 fer/ef_utility/ef_get_arg_string.F                 |   134 +
 fer/ef_utility/ef_get_arg_subscripts.F             |    91 +
 fer/ef_utility/ef_get_arg_subscripts_6d.F          |   152 +
 fer/ef_utility/ef_get_arg_type.c                   |    24 +
 fer/ef_utility/ef_get_axis_calendar.F              |   105 +
 fer/ef_utility/ef_get_axis_dates.F                 |   184 +
 fer/ef_utility/ef_get_axis_info.F                  |    86 +
 fer/ef_utility/ef_get_axis_info_6d.F               |    93 +
 fer/ef_utility/ef_get_axis_modulo_len.F            |    77 +
 fer/ef_utility/ef_get_bad_flags.c                  |    14 +
 fer/ef_utility/ef_get_box_hi_lim.F                 |    78 +
 fer/ef_utility/ef_get_box_limits.F                 |    85 +
 fer/ef_utility/ef_get_box_lo_lim.F                 |    79 +
 fer/ef_utility/ef_get_box_size.F                   |    75 +
 fer/ef_utility/ef_get_coordinates.F                |    78 +
 fer/ef_utility/ef_get_cx_list.c                    |    13 +
 fer/ef_utility/ef_get_mr_list.c                    |    21 +
 fer/ef_utility/ef_get_mres.c                       |     9 +
 fer/ef_utility/ef_get_one_arg_string.F             |   134 +
 fer/ef_utility/ef_get_one_val.c                    |     9 +
 fer/ef_utility/ef_get_one_val_sub.F                |   114 +
 fer/ef_utility/ef_get_one_val_sub_sub.F            |    59 +
 fer/ef_utility/ef_get_res_mem_subscripts.F         |    73 +
 fer/ef_utility/ef_get_res_mem_subscripts_6d.F      |    63 +
 fer/ef_utility/ef_get_res_subscripts.F             |    89 +
 fer/ef_utility/ef_get_res_subscripts_6d.F          |    82 +
 fer/ef_utility/ef_get_result_type.c                |    16 +
 fer/ef_utility/ef_get_string_arg_elem_len_sub.F    |    64 +
 fer/ef_utility/ef_get_string_arg_element.F         |    84 +
 fer/ef_utility/ef_get_string_arg_element_6d.F      |   123 +
 fer/ef_utility/ef_get_string_arg_element_len.F     |    81 +
 fer/ef_utility/ef_get_string_arg_element_len_6d.F  |   117 +
 fer/ef_utility/ef_get_string_arg_element_sub.F     |    63 +
 fer/ef_utility/ef_get_string_arg_max_len.F         |   122 +
 fer/ef_utility/ef_get_wrk_mem_subscripts.F         |    85 +
 fer/ef_utility/ef_get_wrk_mem_subscripts_6d.F      |   174 +
 fer/ef_utility/ef_put_string.c                     |    26 +
 fer/ef_utility/ef_put_string_ptr.c                 |    22 +
 fer/ef_utility/ef_set_alt_fcn_name.F               |    80 +
 fer/ef_utility/ef_set_alt_fcn_name_sub.c           |    17 +
 fer/ef_utility/ef_set_arg_desc.F                   |    78 +
 fer/ef_utility/ef_set_arg_desc_sub.c               |    17 +
 fer/ef_utility/ef_set_arg_name.F                   |    78 +
 fer/ef_utility/ef_set_arg_name_sub.c               |    17 +
 fer/ef_utility/ef_set_arg_type.c                   |    16 +
 fer/ef_utility/ef_set_arg_unit.F                   |    78 +
 fer/ef_utility/ef_set_arg_unit_sub.c               |    17 +
 fer/ef_utility/ef_set_axis_extend.c                |    17 +
 fer/ef_utility/ef_set_axis_influence.c             |    14 +
 fer/ef_utility/ef_set_axis_influence_6d.c          |    55 +
 fer/ef_utility/ef_set_axis_inheritance.c           |    14 +
 fer/ef_utility/ef_set_axis_inheritance_6d.c        |    55 +
 fer/ef_utility/ef_set_axis_limits.c                |    17 +
 fer/ef_utility/ef_set_axis_reduction.c             |    14 +
 fer/ef_utility/ef_set_axis_reduction_6d.c          |    54 +
 fer/ef_utility/ef_set_custom_axis.F                |    82 +
 fer/ef_utility/ef_set_custom_axis_sub.c            |    23 +
 fer/ef_utility/ef_set_desc.F                       |    78 +
 fer/ef_utility/ef_set_desc_sub.c                   |    17 +
 fer/ef_utility/ef_set_freq_axis.F                  |    82 +
 fer/ef_utility/ef_set_freq_axis_sub.c              |    30 +
 fer/ef_utility/ef_set_has_vari_args.c              |    19 +
 fer/ef_utility/ef_set_num_args.c                   |    29 +
 fer/ef_utility/ef_set_num_work_arrays.c            |    19 +
 fer/ef_utility/ef_set_piecemeal_ok.c               |    14 +
 fer/ef_utility/ef_set_piecemeal_ok_6d.c            |    23 +
 fer/ef_utility/ef_set_real_to_string.F             |    71 +
 fer/ef_utility/ef_set_result_type.c                |    16 +
 fer/ef_utility/ef_set_work_array_dims.c            |    20 +
 fer/ef_utility/ef_set_work_array_dims_6d.c         |    35 +
 fer/ef_utility/ef_set_work_array_lens.c            |    20 +
 fer/ef_utility/ef_set_work_array_lens_6d.c         |    35 +
 fer/ef_utility/ef_version_test.c                   |    34 +
 fer/efi/LIB_NAME                                   |     2 +
 fer/efi/Makefile                                   |    40 +
 fer/efi/SOURCE_FILES                               |   187 +
 fer/efi/ave_scat2grid_t.F                          |   402 +
 fer/efi/bin_index_wt.F                             |   221 +
 fer/efi/compressi.F                                |   293 +
 fer/efi/compressi_by.F                             |   305 +
 fer/efi/compressj.F                                |   292 +
 fer/efi/compressj_by.F                             |   305 +
 fer/efi/compressk.F                                |   291 +
 fer/efi/compressk_by.F                             |   309 +
 fer/efi/compressl.F                                |   290 +
 fer/efi/compressl_by.F                             |   306 +
 fer/efi/compressm.F                                |   291 +
 fer/efi/compressm_by.F                             |   309 +
 fer/efi/compressn.F                                |   290 +
 fer/efi/compressn_by.F                             |   310 +
 fer/efi/convolvei.F                                |   275 +
 fer/efi/convolvej.F                                |   274 +
 fer/efi/convolvek.F                                |   277 +
 fer/efi/convolvel.F                                |   274 +
 fer/efi/convolvem.F                                |   273 +
 fer/efi/convolven.F                                |   274 +
 fer/efi/copyscat.F                                 |    89 +
 fer/efi/curv_range.F                               |   773 +
 fer/efi/curv_to_rect.F                             |   350 +
 fer/efi/curv_to_rect_map.F                         |  1120 +
 fer/efi/date1900.F                                 |   216 +
 fer/efi/date_decode.c                              |   117 +
 fer/efi/day_of_year.F                              |    78 +
 fer/efi/days1900toymdhms.F                         |   253 +
 fer/efi/ecat.F                                     |   270 +
 fer/efi/ecat_str.F                                 |   272 +
 fer/efi/element_index.F                            |   215 +
 fer/efi/element_index_str.F                        |   241 +
 fer/efi/element_index_str_n.F                      |   242 +
 fer/efi/eof_space.F                                |   633 +
 fer/efi/eof_stat.F                                 |   652 +
 fer/efi/eof_tfunc.F                                |   623 +
 fer/efi/eofsubs.F                                  |  1012 +
 fer/efi/eofsvd_space.F                             |   588 +
 fer/efi/eofsvd_stat.F                              |   612 +
 fer/efi/eofsvd_tfunc.F                             |   580 +
 fer/efi/ereverse.F                                 |   206 +
 fer/efi/expnd_by_len.F                             |   249 +
 fer/efi/expnd_by_len_str.F                         |   261 +
 fer/efi/expndi_by.F                                |   278 +
 fer/efi/expndi_by_t.F                              |   306 +
 fer/efi/expndi_by_z.F                              |   306 +
 fer/efi/expndi_by_z_counts.F                       |   272 +
 fer/efi/expndi_id_by_z_counts.F                    |   238 +
 fer/efi/fc_isubset.F                               |   289 +
 fer/efi/fcat.F                                     |   270 +
 fer/efi/fcat_str.F                                 |   273 +
 fer/efi/fft_im.F                                   |   471 +
 fer/efi/fft_inverse.F                              |   418 +
 fer/efi/fft_re.F                                   |   471 +
 fer/efi/ffta.F                                     |   493 +
 fer/efi/fftinv_subs.F                              |   523 +
 fer/efi/fftp.F                                     |   490 +
 fer/efi/fftsubs.F                                  |   671 +
 fer/efi/fill_xy.F                                  |   283 +
 fer/efi/findhi.F                                   |   384 +
 fer/efi/findlo.F                                   |   384 +
 fer/efi/flag2ddups.F                               |    92 +
 fer/efi/floatstr.F                                 |   199 +
 fer/efi/freverse.F                                 |   206 +
 fer/efi/gausswt.F                                  |   139 +
 fer/efi/gausswt_v0.F                               |   132 +
 fer/efi/heap2_str.F                                |    58 +
 fer/efi/is_element_of.F                            |   261 +
 fer/efi/is_element_of_str.F                        |   282 +
 fer/efi/is_element_of_str_n.F                      |   294 +
 fer/efi/labwid.F                                   |   211 +
 fer/efi/lanczos.F                                  |   345 +
 fer/efi/list_value_xml.F                           |   324 +
 fer/efi/lsl_lowpass.F                              |   471 +
 fer/efi/maxminmax.F                                |   199 +
 fer/efi/minmax.F                                   |   192 +
 fer/efi/minminmax.F                                |   196 +
 fer/efi/minutes24.F                                |   216 +
 fer/efi/modscat.F                                  |    85 +
 fer/efi/mrgrnk.F                                   |   251 +
 fer/efi/nco.F                                      |   153 +
 fer/efi/nco_attr.F                                 |   344 +
 fer/efi/nobad.F                                    |    68 +
 fer/efi/pickindex.F                                |    48 +
 fer/efi/pt_in_poly.F                               |   566 +
 fer/efi/rect_to_curv.F                             |  1048 +
 fer/efi/samplei_multi.F                            |   259 +
 fer/efi/sampleij.F                                 |   442 +
 fer/efi/samplej_multi.F                            |   256 +
 fer/efi/samplek_multi.F                            |   258 +
 fer/efi/samplel_multi.F                            |   263 +
 fer/efi/samplet_date.F                             |   569 +
 fer/efi/samplexy.F                                 |   753 +
 fer/efi/samplexy_closest.F                         |   594 +
 fer/efi/samplexy_curv.F                            |   605 +
 fer/efi/samplexy_curv_avg.F                        |   609 +
 fer/efi/samplexy_curv_nrst.F                       |   615 +
 fer/efi/samplexyt.F                                |   755 +
 fer/efi/samplexyt_nrst.F                           |   721 +
 fer/efi/samplexz.F                                 |   587 +
 fer/efi/sampleyz.F                                 |   591 +
 fer/efi/scat2ddups.F                               |   271 +
 fer/efi/scat2grid_bin_xy.F                         |   496 +
 fer/efi/scat2grid_bin_xyt.F                        |   590 +
 fer/efi/scat2grid_nbin_xy.F                        |   461 +
 fer/efi/scat2grid_nbin_xyt.F                       |   546 +
 fer/efi/scat2grid_nobs_xy.F                        |   481 +
 fer/efi/scat2grid_nobs_xyt.F                       |   586 +
 fer/efi/scat2grid_subs.F                           |   210 +
 fer/efi/scat2grid_t.F                              |   345 +
 fer/efi/scat2gridgauss_xt.F                        |   660 +
 fer/efi/scat2gridgauss_xt_v0.F                     |   662 +
 fer/efi/scat2gridgauss_xy.F                        |   679 +
 fer/efi/scat2gridgauss_xy_v0.F                     |   681 +
 fer/efi/scat2gridgauss_xz.F                        |   678 +
 fer/efi/scat2gridgauss_xz_v0.F                     |   680 +
 fer/efi/scat2gridgauss_yt.F                        |   660 +
 fer/efi/scat2gridgauss_yt_v0.F                     |   662 +
 fer/efi/scat2gridgauss_yz.F                        |   677 +
 fer/efi/scat2gridgauss_yz_v0.F                     |   679 +
 fer/efi/scat2gridgauss_zt.F                        |   660 +
 fer/efi/scat2gridgauss_zt_v0.F                     |   662 +
 fer/efi/scat2gridlaplace_xt.F                      |   759 +
 fer/efi/scat2gridlaplace_xy.F                      |   758 +
 fer/efi/scat2gridlaplace_xz.F                      |   759 +
 fer/efi/scat2gridlaplace_yt.F                      |   759 +
 fer/efi/scat2gridlaplace_yz.F                      |   759 +
 fer/efi/scat2gridlaplace_zt.F                      |   759 +
 fer/efi/secs_to_ymdhms.F                           |   154 +
 fer/efi/sorti.F                                    |   352 +
 fer/efi/sorti_str.F                                |   359 +
 fer/efi/sortj.F                                    |   356 +
 fer/efi/sortj_str.F                                |   358 +
 fer/efi/sortk.F                                    |   354 +
 fer/efi/sortk_str.F                                |   359 +
 fer/efi/sortl.F                                    |   353 +
 fer/efi/sortl_str.F                                |   361 +
 fer/efi/sortm.F                                    |   348 +
 fer/efi/sortm_str.F                                |   360 +
 fer/efi/sortn.F                                    |   348 +
 fer/efi/sortn_str.F                                |   360 +
 fer/efi/str_mask.F                                 |   175 +
 fer/efi/svdeof-4.F                                 |   770 +
 fer/efi/tauto_cor.F                                |   398 +
 fer/efi/tax_datestring.F                           |   359 +
 fer/efi/tax_day.F                                  |   287 +
 fer/efi/tax_dayfrac.F                              |   289 +
 fer/efi/tax_jday.F                                 |   291 +
 fer/efi/tax_jday1900.F                             |   287 +
 fer/efi/tax_month.F                                |   302 +
 fer/efi/tax_subs.F                                 |   264 +
 fer/efi/tax_times.F                                |   190 +
 fer/efi/tax_tstep.F                                |   662 +
 fer/efi/tax_units.F                                |   159 +
 fer/efi/tax_year.F                                 |   284 +
 fer/efi/tax_yearfrac.F                             |   292 +
 fer/efi/tcat.F                                     |   275 +
 fer/efi/tcat_str.F                                 |   273 +
 fer/efi/test_opendap.F                             |   264 +
 fer/efi/time_decode.c                              |    81 +
 fer/efi/transpose_xt.F                             |   236 +
 fer/efi/transpose_xy.F                             |   236 +
 fer/efi/transpose_xz.F                             |   236 +
 fer/efi/transpose_yt.F                             |   236 +
 fer/efi/transpose_yz.F                             |   236 +
 fer/efi/transpose_zt.F                             |   236 +
 fer/efi/treverse.F                                 |   206 +
 fer/efi/unique_str2int.F                           |   237 +
 fer/efi/us2i_compare_string_list.c                 |   180 +
 fer/efi/write_webrow.F                             |   310 +
 fer/efi/xauto_cor.F                                |   398 +
 fer/efi/xcat.F                                     |   274 +
 fer/efi/xcat_str.F                                 |   273 +
 fer/efi/xreverse.F                                 |   206 +
 fer/efi/ycat.F                                     |   275 +
 fer/efi/ycat_str.F                                 |   274 +
 fer/efi/yreverse.F                                 |   206 +
 fer/efi/zaxreplace_avg.F                           |   496 +
 fer/efi/zaxreplace_bin.F                           |   377 +
 fer/efi/zaxreplace_rev.F                           |   492 +
 fer/efi/zaxreplace_zlev.F                          |   378 +
 fer/efi/zcat.F                                     |   276 +
 fer/efi/zcat_str.F                                 |   273 +
 fer/efi/zgrid_laplace.F                            |   421 +
 fer/efi/zreverse.F                                 |   206 +
 fer/efn/LIB_NAME                                   |     2 +
 fer/efn/Makefile                                   |    37 +
 fer/efn/SOURCE_FILES                               |     5 +
 fer/efn/efcn_copy_array_dims.F                     |   161 +
 fer/efn/efcn_get_custom_axis.F                     |    56 +
 fer/efn/efcn_get_workspace_addr.F                  |    29 +
 fer/efn/efcn_set_work_array_dims.F                 |   206 +
 fer/fmt/LIB_NAME                                   |     1 +
 fer/fmt/Makefile                                   |    37 +
 fer/fmt/SOURCE_FILES                               |    39 +
 fer/fmt/alg_regrid_trans_titl.F                    |    59 +
 fer/fmt/alg_trans_titl.F                           |    89 +
 fer/fmt/ascii_limits.F                             |   143 +
 fer/fmt/ax_title.F                                 |   102 +
 fer/fmt/clean_coord_string.F                       |    94 +
 fer/fmt/compound_title.F                           |    82 +
 fer/fmt/cx_dim_str.F                               |   134 +
 fer/fmt/cx_size_str.F                              |    73 +
 fer/fmt/date_prec.F                                |    82 +
 fer/fmt/field_width.F                              |   112 +
 fer/fmt/full_uvar_name.F                           |    81 +
 fer/fmt/full_uvar_name_xml.F                       |    77 +
 fer/fmt/full_var_title.F                           |    86 +
 fer/fmt/geog_label.F                               |   119 +
 fer/fmt/get_dset_name.F                            |    88 +
 fer/fmt/get_dset_title.F                           |    68 +
 fer/fmt/get_nc_offset.F                            |    61 +
 fer/fmt/get_nc_scale.F                             |    62 +
 fer/fmt/get_prec_digits.F                          |   102 +
 fer/fmt/get_short_dset_name.F                      |   105 +
 fer/fmt/get_sig_digits.F                           |    67 +
 fer/fmt/get_user_offset.F                          |    60 +
 fer/fmt/get_user_scale.F                           |    61 +
 fer/fmt/lefint.F                                   |    76 +
 fer/fmt/left_just.F                                |    85 +
 fer/fmt/left_real.F                                |    84 +
 fer/fmt/lohi_string.F                              |    87 +
 fer/fmt/lohi_world.F                               |   142 +
 fer/fmt/paren_surround.F                           |    65 +
 fer/fmt/replace_deq.F                              |   146 +
 fer/fmt/row_coord_fmt.F                            |   120 +
 fer/fmt/sanitary_var_code.F                        |    74 +
 fer/fmt/translate_to_world.F                       |   196 +
 fer/fmt/var_data_fmt.F                             |    79 +
 fer/fmt/var_title.F                                |   218 +
 fer/fmt/var_title_mod.F                            |   307 +
 fer/fmt/var_trans.F                                |    81 +
 fer/fmt/var_units.F                                |   134 +
 fer/gnl/LIB_NAME                                   |     1 +
 fer/gnl/Makefile                                   |    37 +
 fer/gnl/SOURCE_FILES                               |   118 +
 fer/gnl/add_attribute.F                            |   187 +
 fer/gnl/alias_command.F                            |   124 +
 fer/gnl/alias_id.F                                 |    80 +
 fer/gnl/all_1_arg.F                                |    81 +
 fer/gnl/arg_string.F                               |    83 +
 fer/gnl/atom_pos.F                                 |    93 +
 fer/gnl/auto_filename.F                            |   169 +
 fer/gnl/cancel_data_set.F                          |   223 +
 fer/gnl/cdf_list.F                                 |  1219 +
 fer/gnl/cdf_list_global_atts.F                     |   103 +
 fer/gnl/check_format.F                             |    94 +
 fer/gnl/check_member_sets.F                        |   158 +
 fer/gnl/check_memory.F                             |   260 +
 fer/gnl/cleanup_last_cmnd.F                        |    81 +
 fer/gnl/coached_str_sub.F                          |   305 +
 fer/gnl/create_agg_axis.F                          |   102 +
 fer/gnl/create_agg_dset.F                          |    92 +
 fer/gnl/cs_command.F                               |   246 +
 fer/gnl/cs_semicolon.F                             |    84 +
 fer/gnl/ctrl_c.F                                   |   144 +
 fer/gnl/define_aggregate_grid.F                    |   169 +
 fer/gnl/define_special_grids.F                     |   255 +
 fer/gnl/delete_one_line.F                          |    92 +
 fer/gnl/do_query.F                                 |   645 +
 fer/gnl/dollar_arg.F                               |   186 +
 fer/gnl/dollar_command.F                           |   267 +
 fer/gnl/edit_attribute.F                           |   560 +
 fer/gnl/equal_format.F                             |   125 +
 fer/gnl/equal_permute.F                            |   154 +
 fer/gnl/equal_str_lc.F                             |    94 +
 fer/gnl/equal_string.F                             |    96 +
 fer/gnl/equal_type.F                               |   137 +
 fer/gnl/equal_val.F                                |    97 +
 fer/gnl/equal_val_int.F                            |    92 +
 fer/gnl/errmsg.F                                   |   307 +
 fer/gnl/escape_for_xml.F                           |   110 +
 fer/gnl/finalize.F                                 |    78 +
 fer/gnl/float2string_for_xml.F                     |    91 +
 fer/gnl/get_context_mods.F                         |  1208 +
 fer/gnl/get_dataset_name.F                         |   107 +
 fer/gnl/get_fer_command.F                          |   324 +
 fer/gnl/get_fvars_list_by_attname_and_val.F        |   105 +
 fer/gnl/get_input_varname.F                        |    77 +
 fer/gnl/get_mode_arg.F                             |   205 +
 fer/gnl/get_ppl_memory_size.F                      |    54 +
 fer/gnl/get_scriptfile_name.F                      |    64 +
 fer/gnl/get_uvars_list_by_attname_and_val.F        |   107 +
 fer/gnl/init_aggregate_dset.F                      |   340 +
 fer/gnl/init_journal.F                             |    90 +
 fer/gnl/init_memory.F                              |   109 +
 fer/gnl/initialize.F                               |   295 +
 fer/gnl/isit_another_dset.F                        |    74 +
 fer/gnl/isit_coord_var.F                           |   155 +
 fer/gnl/line_facts.F                               |   186 +
 fer/gnl/line_facts_xml.F                           |   282 +
 fer/gnl/list_cmnd_data.F                           |   879 +
 fer/gnl/list_cmnd_data_xml.F                       |   888 +
 fer/gnl/list_multi.F                               |    80 +
 fer/gnl/list_multi_sub.F                           |   739 +
 fer/gnl/mouse_command.F                            |   137 +
 fer/gnl/name_equal_string.F                        |   122 +
 fer/gnl/name_equal_string_lc.F                     |   119 +
 fer/gnl/name_equal_string_vatt.F                   |   121 +
 fer/gnl/netcdf4_cancel_settings.F                  |    68 +
 fer/gnl/netcdf4_list_settings.F                    |   289 +
 fer/gnl/netcdf4_set_list_settings.F                |   257 +
 fer/gnl/netcdf4_show_list_settings.F               |   159 +
 fer/gnl/no_journal.F                               |    52 +
 fer/gnl/parse_comma_list.F                         |   217 +
 fer/gnl/parse_command.F                            |   911 +
 fer/gnl/pop_cs.F                                   |   195 +
 fer/gnl/process_if.F                               |   212 +
 fer/gnl/proclaim.F                                 |    97 +
 fer/gnl/proclaim_c.F                               |    74 +
 fer/gnl/redefine_ax_att.F                          |   321 +
 fer/gnl/repl_exprns.F                              |   848 +
 fer/gnl/reset_ax_att.F                             |   288 +
 fer/gnl/reset_axis.F                               |   314 +
 fer/gnl/sample.F                                   |   313 +
 fer/gnl/sample_sub.F                               |   346 +
 fer/gnl/save_ppl_memory_size.F                     |    56 +
 fer/gnl/save_scriptfile_name.F                     |    90 +
 fer/gnl/set_var.F                                  |   703 +
 fer/gnl/show_1_dsvar.F                             |    94 +
 fer/gnl/show_1_function.F                          |   326 +
 fer/gnl/show_1_mr.F                                |   207 +
 fer/gnl/show_1_pyvar.F                             |   145 +
 fer/gnl/show_1_uvar.F                              |   114 +
 fer/gnl/show_1_uvar_xml.F                          |   241 +
 fer/gnl/show_attribute.F                           |   127 +
 fer/gnl/show_data.F                                |   220 +
 fer/gnl/show_data_files.F                          |   140 +
 fer/gnl/show_data_set_attrs.F                      |   264 +
 fer/gnl/show_data_set_params.F                     |   121 +
 fer/gnl/show_data_set_vars.F                       |   487 +
 fer/gnl/show_data_set_vars_xml.F                   |   608 +
 fer/gnl/show_data_set_xml.F                        |   109 +
 fer/gnl/show_diag_vars.F                           |   132 +
 fer/gnl/show_dim_xml.F                             |    89 +
 fer/gnl/show_dyn_grids.F                           |   193 +
 fer/gnl/show_grid.F                                |   127 +
 fer/gnl/show_grid_string_xml.F                     |   131 +
 fer/gnl/show_grid_xml.F                            |   147 +
 fer/gnl/show_line.F                                |   175 +
 fer/gnl/show_line_coords.F                         |   229 +
 fer/gnl/show_line_xml.F                            |   377 +
 fer/gnl/show_mem_vars.F                            |   128 +
 fer/gnl/show_region.F                              |   114 +
 fer/gnl/show_regrid_transforms.F                   |   185 +
 fer/gnl/show_transforms.F                          |   138 +
 fer/gnl/special_symbol.F                           |   310 +
 fer/gnl/symbol_command.F                           |   253 +
 fer/gnl/translate_lat_long.F                       |   110 +
 fer/gnl/translate_limit.F                          |   207 +
 fer/gnl/turnoff_verify.F                           |    57 +
 fer/gnl/var_stat.F                                 |   384 +
 fer/gnl/version_only.F                             |    66 +
 fer/gnl/warn.F                                     |    75 +
 fer/gnl/warn_occasionally.F                        |    96 +
 fer/gnl/write_dods_fmt.F                           |   102 +
 fer/gnl/write_multi.F                              |    95 +
 fer/grdel/Makefile                                 |    41 +
 fer/grdel/brush.c                                  |   300 +
 fer/grdel/color.c                                  |   243 +
 fer/grdel/draw.c                                   |   847 +
 fer/grdel/dup_color_set_opacity.F                  |    75 +
 fer/grdel/dup_std_pen_set_opacity.F                |    96 +
 fer/grdel/fgd_consider_update.F                    |    49 +
 fer/grdel/fgd_create_temp_color.F                  |    42 +
 fer/grdel/fgd_create_temp_pen.F                    |    43 +
 fer/grdel/fgd_engine_match.F                       |    72 +
 fer/grdel/fgd_gacwk.F                              |    28 +
 fer/grdel/fgd_gca.F                                |    31 +
 fer/grdel/fgd_gclks.F                              |    20 +
 fer/grdel/fgd_gclrwk.F                             |    48 +
 fer/grdel/fgd_gclsg.F                              |    34 +
 fer/grdel/fgd_gclwk.F                              |   110 +
 fer/grdel/fgd_gcrsg.F                              |    35 +
 fer/grdel/fgd_gdawk.F                              |    37 +
 fer/grdel/fgd_gdsg.F                               |    36 +
 fer/grdel/fgd_gesspn.F                             |    15 +
 fer/grdel/fgd_get_view_limits.F                    |    87 +
 fer/grdel/fgd_get_window_size.F                    |    28 +
 fer/grdel/fgd_getanimate.F                         |    25 +
 fer/grdel/fgd_gfa.F                                |   117 +
 fer/grdel/fgd_ginch.F                              |    16 +
 fer/grdel/fgd_gopks.F                              |    13 +
 fer/grdel/fgd_gopwk.F                              |   116 +
 fer/grdel/fgd_gpl.F                                |    49 +
 fer/grdel/fgd_gpm.F                                |    64 +
 fer/grdel/fgd_gprec.F                              |    17 +
 fer/grdel/fgd_gqacwk.F                             |    29 +
 fer/grdel/fgd_gqasf.F                              |    21 +
 fer/grdel/fgd_gqchs.F                              |    22 +
 fer/grdel/fgd_gqclip.F                             |    30 +
 fer/grdel/fgd_gqcls.F                              |    22 +
 fer/grdel/fgd_gqcntn.F                             |    17 +
 fer/grdel/fgd_gqcr.F                               |    53 +
 fer/grdel/fgd_gqdsp.F                              |    57 +
 fer/grdel/fgd_gqlwk.F                              |    33 +
 fer/grdel/fgd_gqnt.F                               |    45 +
 fer/grdel/fgd_gqops.F                              |    17 +
 fer/grdel/fgd_gqopwk.F                             |    30 +
 fer/grdel/fgd_gqpcr.F                              |    34 +
 fer/grdel/fgd_gqpxad.F                             |    54 +
 fer/grdel/fgd_gqwkc.F                              |    25 +
 fer/grdel/fgd_grqch.F                              |    16 +
 fer/grdel/fgd_grqlc.F                              |    18 +
 fer/grdel/fgd_gsasf.F                              |    13 +
 fer/grdel/fgd_gsclip.F                             |    42 +
 fer/grdel/fgd_gscr.F                               |   112 +
 fer/grdel/fgd_gsds.F                               |    13 +
 fer/grdel/fgd_gselnt.F                             |    62 +
 fer/grdel/fgd_gsfaci.F                             |    19 +
 fer/grdel/fgd_gsfai.F                              |    30 +
 fer/grdel/fgd_gsfais.F                             |    29 +
 fer/grdel/fgd_gsfar.F                              |   100 +
 fer/grdel/fgd_gsfasi.F                             |    39 +
 fer/grdel/fgd_gslcm.F                              |    14 +
 fer/grdel/fgd_gspli.F                              |    30 +
 fer/grdel/fgd_gsplr.F                              |    93 +
 fer/grdel/fgd_gspmi.F                              |    30 +
 fer/grdel/fgd_gspmr.F                              |   107 +
 fer/grdel/fgd_gsvp.F                               |    65 +
 fer/grdel/fgd_gsvpip.F                             |    14 +
 fer/grdel/fgd_gswkvp.F                             |    59 +
 fer/grdel/fgd_gswkwn.F                             |    44 +
 fer/grdel/fgd_gswn.F                               |    34 +
 fer/grdel/fgd_guwk.F                               |    53 +
 fer/grdel/fgd_redraw_background.F                  |    45 +
 fer/grdel/fgd_save_window.F                        |    76 +
 fer/grdel/fgd_send_image_scale.F                   |    38 +
 fer/grdel/fgd_set_antialias.F                      |    52 +
 fer/grdel/fgd_set_engine.F                         |   117 +
 fer/grdel/fgd_set_thick_factor.F                   |    51 +
 fer/grdel/fgd_set_transparency.F                   |    24 +
 fer/grdel/fgd_set_unmapped_default.F               |    21 +
 fer/grdel/fgd_setimgname.F                         |    53 +
 fer/grdel/font.c                                   |   239 +
 fer/grdel/grdel.h                                  |   271 +
 fer/grdel/pen.c                                    |   319 +
 fer/grdel/symbol.c                                 |   208 +
 fer/grdel/window.c                                 |  1823 +
 fer/ino/LIB_NAME                                   |     1 +
 fer/ino/Makefile                                   |    37 +
 fer/ino/SOURCE_FILES                               |    17 +
 fer/ino/cdf_prep_cache.F                           |   192 +
 fer/ino/dset_type.F                                |    60 +
 fer/ino/equal_delimit.F                            |   143 +
 fer/ino/find_dset_number.F                         |   238 +
 fer/ino/get_dset_parms.F                           |   323 +
 fer/ino/init_ez_dset.F                             |   373 +
 fer/ino/make_cvar_grids.F                          |   116 +
 fer/ino/read_binary.F                              |   291 +
 fer/ino/read_delimited.F                           |   263 +
 fer/ino/read_ez.F                                  |   288 +
 fer/ino/read_perl.F                                |   246 +
 fer/ino/read_remote.F                              |   329 +
 fer/ino/read_tm.F                                  |   275 +
 fer/ino/repl_tm_find_grid_slot.F                   |    88 +
 fer/ino/replace_bad_data.F                         |    68 +
 fer/ino/var_ss_lims.F                              |   113 +
 fer/link.ppc64.sh                                  |    27 +
 fer/mem/LIB_NAME                                   |     1 +
 fer/mem/Makefile                                   |    37 +
 fer/mem/SOURCE_FILES                               |    57 +
 fer/mem/allo_grid_to_cx.F                          |    81 +
 fer/mem/assign_mr_cx.F                             |   111 +
 fer/mem/assign_temp_var.F                          |    77 +
 fer/mem/assign_variable.F                          |    98 +
 fer/mem/cgrid_size_delta.F                         |    74 +
 fer/mem/create_mem_var.F                           |    87 +
 fer/mem/create_permutation.F                       |   174 +
 fer/mem/create_temp_mem_var.F                      |    88 +
 fer/mem/deallo_dyn_grid.F                          |    80 +
 fer/mem/deallo_uvar_grids.F                        |    85 +
 fer/mem/delete_mrs_in_progress.F                   |    70 +
 fer/mem/delete_old_expr.F                          |    83 +
 fer/mem/delete_transformed_vars.F                  |    82 +
 fer/mem/delete_un_cached_mvars.F                   |    85 +
 fer/mem/delete_user_var.F                          |    78 +
 fer/mem/delete_user_var_sub.F                      |   180 +
 fer/mem/delete_variable.F                          |   139 +
 fer/mem/erase_dset.F                               |   109 +
 fer/mem/fill_memory.F                              |    66 +
 fer/mem/find_mem_var.F                             |   360 +
 fer/mem/find_mr_slot.F                             |    88 +
 fer/mem/find_var_name.F                            |   392 +
 fer/mem/free_memory.F                              |   144 +
 fer/mem/fvar_number.F                              |    91 +
 fer/mem/get_memory.F                               |   160 +
 fer/mem/get_work_mr.F                              |   103 +
 fer/mem/get_work_spc.F                             |    77 +
 fer/mem/hash_cx.F                                  |   104 +
 fer/mem/hash_name.F                                |    68 +
 fer/mem/init_grid.F                                |    69 +
 fer/mem/its_un_cached.F                            |    73 +
 fer/mem/mgrid_size.F                               |    66 +
 fer/mem/mgrid_size_delta.F                         |    72 +
 fer/mem/mr_available.F                             |    75 +
 fer/mem/mr_dim_len.F                               |    59 +
 fer/mem/mr_in_use.F                                |    77 +
 fer/mem/mr_not_in_use.F                            |    75 +
 fer/mem/mvar_num_dims.F                            |    66 +
 fer/mem/new_mr_w_edges.F                           |    76 +
 fer/mem/purge_all_memory.F                         |    64 +
 fer/mem/purge_all_pystat_vars.F                    |    56 +
 fer/mem/purge_all_uvars.F                          |    92 +
 fer/mem/purge_aux_var_dependents.F                 |    70 +
 fer/mem/purge_dset.F                               |    66 +
 fer/mem/purge_file_var.F                           |    72 +
 fer/mem/purge_mr_axis.F                            |   130 +
 fer/mem/purge_mr_grid.F                            |   143 +
 fer/mem/purge_pystat_dset_vars.F                   |    59 +
 fer/mem/purge_pystat_var.F                         |    61 +
 fer/mem/purge_user_var.F                           |    75 +
 fer/mem/re_assign_variable.F                       |    85 +
 fer/mem/release_work_spc.F                         |    55 +
 fer/mem/un_cache.F                                 |    75 +
 fer/mem/unprotect_all_mrs.F                        |    64 +
 fer/mem/uvar_number.F                              |    87 +
 fer/mem/var_code.F                                 |   128 +
 fer/ocn/LIB_NAME                                   |     1 +
 fer/ocn/Makefile                                   |    37 +
 fer/ocn/SOURCE_FILES                               |    34 +
 fer/ocn/air_temp.F                                 |   132 +
 fer/ocn/calc_cvar.F                                |   746 +
 fer/ocn/cmesh.F                                    |    60 +
 fer/ocn/conv_adj_mask.F                            |   160 +
 fer/ocn/cvar_context.F                             |   243 +
 fer/ocn/ew_hadvec.F                                |   140 +
 fer/ocn/expl_coriolis.F                            |   163 +
 fer/ocn/fuw.F                                      |   150 +
 fer/ocn/fvn.F                                      |   152 +
 fer/ocn/gfdl_terms.F                               |   233 +
 fer/ocn/grad_p_clinic.F                            |   215 +
 fer/ocn/hflux.F                                    |   176 +
 fer/ocn/hourly_data.F                              |    78 +
 fer/ocn/hradiation.F                               |   162 +
 fer/ocn/knudsen.F                                  |   162 +
 fer/ocn/mesh.F                                     |    64 +
 fer/ocn/prof.F                                     |   175 +
 fer/ocn/sn_hadvec.F                                |   150 +
 fer/ocn/state.F                                    |   238 +
 fer/ocn/u_from_psi.F                               |   133 +
 fer/ocn/vel_adv_ew.F                               |   161 +
 fer/ocn/vel_adv_ns.F                               |   153 +
 fer/ocn/vel_adv_z.F                                |   168 +
 fer/ocn/vel_by_grad_p.F                            |   115 +
 fer/ocn/vel_by_wind.F                              |   140 +
 fer/ocn/vel_dif_xy.F                               |   236 +
 fer/ocn/vel_dif_z.F                                |   186 +
 fer/ocn/w_on_ts.F                                  |   216 +
 fer/ocn/w_on_uv.F                                  |   170 +
 fer/ocn/wind_stress.F                              |   182 +
 fer/ocn/xy_hdiffus.F                               |   145 +
 fer/ocn/z_hadvec.F                                 |   178 +
 fer/ocn/z_hdiffus.F                                |   174 +
 fer/plt/LIB_NAME                                   |     2 +
 fer/plt/Makefile                                   |    37 +
 fer/plt/SOURCE_FILES                               |    83 +
 fer/plt/abs_whoi_date.F                            |    76 +
 fer/plt/assign_modemeta.F                          |    54 +
 fer/plt/ax_on_off.F                                |   118 +
 fer/plt/axis_end_syms.F                            |    67 +
 fer/plt/axis_ends.F                                |   150 +
 fer/plt/axis_format.F                              |   233 +
 fer/plt/box_label.F                                |   227 +
 fer/plt/cancel_window.F                            |   173 +
 fer/plt/check_graphics.F                           |    68 +
 fer/plt/choose_cx_ww.F                             |   138 +
 fer/plt/ck_gks_active.F                            |    79 +
 fer/plt/clear_window.F                             |    79 +
 fer/plt/compound_key.F                             |    75 +
 fer/plt/curv_coord_add_sub.F                       |   346 +
 fer/plt/curv_coord_range_sub.F                     |   166 +
 fer/plt/curv_coord_sub.F                           |   301 +
 fer/plt/disp_data_set_up.F                         |   156 +
 fer/plt/disp_init.F                                |   272 +
 fer/plt/disp_labels.F                              |   226 +
 fer/plt/disp_prep.F                                |   460 +
 fer/plt/disp_reset.F                               |   126 +
 fer/plt/disp_set_up.F                              |   885 +
 fer/plt/echof_off.F                                |    46 +
 fer/plt/equal_color.F                              |   190 +
 fer/plt/equal_range.F                              |   189 +
 fer/plt/equal_range_t.F                            |    97 +
 fer/plt/equal_thick.F                              |   171 +
 fer/plt/flow_set_up.F                              |    88 +
 fer/plt/get_axis_format.F                          |    80 +
 fer/plt/get_frame_size.F                           |    99 +
 fer/plt/get_view_size.F                            |    88 +
 fer/plt/get_window_pixels.F                        |   115 +
 fer/plt/gks_windows.F                              |    63 +
 fer/plt/gks_x_conid.F                              |    78 +
 fer/plt/internal_whoi_date.F                       |   105 +
 fer/plt/its_curv_edges.F                           |    60 +
 fer/plt/its_curvilinear.F                          |    52 +
 fer/plt/itsa_axis_view.F                           |    52 +
 fer/plt/itsa_modulo_curvi_axis.F                   |   155 +
 fer/plt/itsa_modulo_curvi_axis_sub.F               |   161 +
 fer/plt/key_loc.F                                  |   136 +
 fer/plt/key_string.F                               |   148 +
 fer/plt/line_plot_labels.F                         |   341 +
 fer/plt/line_style.F                               |   227 +
 fer/plt/load_curvilinear.F                         |   237 +
 fer/plt/merged_whoi_date.F                         |   102 +
 fer/plt/parse_color_tuple.F                        |   119 +
 fer/plt/plot_set_up.F                              |   942 +
 fer/plt/polygon_set_up.F                           |  1208 +
 fer/plt/pos_lab.F                                  |    94 +
 fer/plt/ppl_axes_off.F                             |    82 +
 fer/plt/ppl_axes_restore.F                         |    80 +
 fer/plt/ppl_bdead.F                                |    47 +
 fer/plt/ppl_dash_restore.F                         |    76 +
 fer/plt/ppl_patset.F                               |    29 +
 fer/plt/ppl_shaset.F                               |    64 +
 fer/plt/ppl_time.F                                 |    90 +
 fer/plt/put_cmnd_key.F                             |    94 +
 fer/plt/put_key.F                                  |   112 +
 fer/plt/put_label.F                                |   242 +
 fer/plt/re_orient.F                                |   197 +
 fer/plt/save_frame.F                               |   160 +
 fer/plt/save_ppl_values.F                          |    90 +
 fer/plt/seg_off.F                                  |    66 +
 fer/plt/seg_on.F                                   |    78 +
 fer/plt/send_pltype.F                              |    77 +
 fer/plt/set_ax_sizes.F                             |    88 +
 fer/plt/set_graticules.F                           |   445 +
 fer/plt/set_plot_size.F                            |    64 +
 fer/plt/set_ppl_values.F                           |   128 +
 fer/plt/set_text_sizes.F                           |    99 +
 fer/plt/set_viewport.F                             |   209 +
 fer/plt/set_vp_symbols.F                           |   110 +
 fer/plt/set_window.F                               |   515 +
 fer/plt/setup_keys.F                               |   165 +
 fer/plt/start_pplus.F                              |   183 +
 fer/plt/taxis_style.F                              |   218 +
 fer/plt/trim_axis_ends.F                           |   118 +
 fer/plt/viewport_number.F                          |    78 +
 fer/plt/vp_axlim2lim.F                             |   173 +
 fer/plt/whoi_date.F                                |   106 +
 fer/plt/window_size_from_opts.F                    |   426 +
 fer/pyf/LIB_NAME                                   |     1 +
 fer/pyf/Makefile                                   |    37 +
 fer/pyf/SOURCE_FILES                               |    16 +
 fer/pyf/add_pystat_var.F                           |   185 +
 fer/pyf/check_line_subset.F                        |   152 +
 fer/pyf/check_time_line_subset.F                   |   185 +
 fer/pyf/clear_fer_last_error_info.F                |    49 +
 fer/pyf/delete_all_pystat_vars.F                   |    57 +
 fer/pyf/delete_pystat_dset_vars.F                  |    62 +
 fer/pyf/delete_pystat_var.F                        |    95 +
 fer/pyf/ef_get_single_axis_info.F                  |    94 +
 fer/pyf/get_axis_num.F                             |   242 +
 fer/pyf/get_data_array_coords.F                    |   133 +
 fer/pyf/get_data_array_params.F                    |   180 +
 fer/pyf/get_data_array_time_coords.F               |   186 +
 fer/pyf/get_fer_last_error_info.F                  |    59 +
 fer/pyf/get_ferret_params.F                        |   216 +
 fer/pyf/get_time_axis_num.F                        |   333 +
 fer/rpn/LIB_NAME                                   |     1 +
 fer/rpn/Makefile                                   |    37 +
 fer/rpn/SOURCE_FILES                               |    18 +
 fer/rpn/alg_break_up.F                             |   322 +
 fer/rpn/alg_class.F                                |   123 +
 fer/rpn/alg_id.F                                   |   369 +
 fer/rpn/alg_trans_code.F                           |    68 +
 fer/rpn/break_up_expr.F                            |   240 +
 fer/rpn/break_varattname.F                         |   350 +
 fer/rpn/break_varname.F                            |   183 +
 fer/rpn/delete_all_uvar_grids.F                    |    75 +
 fer/rpn/dflt_trans_arg.F                           |   121 +
 fer/rpn/expr_name.F                                |    56 +
 fer/rpn/init_counter_var.F                         |   175 +
 fer/rpn/init_uvar.F                                |   345 +
 fer/rpn/init_uvar_sub.F                            |   286 +
 fer/rpn/not_rpn.F                                  |   129 +
 fer/rpn/ok_juxtapo.F                               |   155 +
 fer/rpn/prcd.F                                     |   116 +
 fer/rpn/rpn.F                                      |   355 +
 fer/special/Makefile                               |    32 +
 fer/special/SOURCE_FILES                           |    10 +
 fer/special/aix_routines.F                         |   169 +
 fer/special/fake_ppl.F                             |    44 +
 fer/special/fake_tmio.F                            |    60 +
 fer/special/fakes3.F                               |    41 +
 fer/special/ferret_dispatch.F                      |   361 +
 fer/special/ferret_query_f.F                       |   535 +
 fer/special/gui_fakes.F                            |    69 +
 fer/special/linux_routines.F                       |    98 +
 fer/special/xmake_date_data.template               |    13 +
 fer/special/xplatform_type_data.template           |    14 +
 fer/special/xrevision_type_data.template           |    15 +
 fer/stk/LIB_NAME                                   |     1 +
 fer/stk/Makefile                                   |    37 +
 fer/stk/SOURCE_FILES                               |    81 +
 fer/stk/aux_regrid_lims.F                          |    81 +
 fer/stk/aux_regrid_lims_1d.F                       |   259 +
 fer/stk/bad_edges.F                                |    80 +
 fer/stk/bad_edges_sub.F                            |   200 +
 fer/stk/bad_ptr_edges_sub.F                        |   197 +
 fer/stk/clean_stack.F                              |    59 +
 fer/stk/const_var_context.F                        |    71 +
 fer/stk/constant_context.F                         |    97 +
 fer/stk/crawl_dependencies.F                       |   104 +
 fer/stk/diagnostic_out.F                           |   152 +
 fer/stk/eval_context.F                             |   100 +
 fer/stk/eval_expr.F                                |   128 +
 fer/stk/exit_dependency_mode.F                     |    54 +
 fer/stk/explicit_uvar.F                            |    60 +
 fer/stk/gcf_arg_eval_order.F                       |    74 +
 fer/stk/get_axis_speed.F                           |   101 +
 fer/stk/get_cmnd_data.F                            |    86 +
 fer/stk/get_dependencies.F                         |   109 +
 fer/stk/get_prot_cmnd_data.F                       |   208 +
 fer/stk/get_uvar_grid.F                            |   128 +
 fer/stk/hunt.F                                     |   110 +
 fer/stk/i1mach.F                                   |   526 +
 fer/stk/init_dependencies.F                        |   117 +
 fer/stk/init_ftds_dset.F                           |   149 +
 fer/stk/init_random_seed.F                         |    71 +
 fer/stk/interp_context.F                           |   179 +
 fer/stk/interp_stack.F                             |   683 +
 fer/stk/is_aggregate_gather.F                      |   195 +
 fer/stk/is_aggregate_grid.F                        |   281 +
 fer/stk/is_algebra.F                               |   945 +
 fer/stk/is_attrib_val.F                            |   394 +
 fer/stk/is_auxvar_regrid.F                         |   407 +
 fer/stk/is_calc.F                                  |   191 +
 fer/stk/is_const_var.F                             |    90 +
 fer/stk/is_constant.F                              |    93 +
 fer/stk/is_counter_var.F                           |   115 +
 fer/stk/is_dependencies.F                          |   351 +
 fer/stk/is_do_gc_fcn.F                             |   347 +
 fer/stk/is_do_op.F                                 |   345 +
 fer/stk/is_gather.F                                |   134 +
 fer/stk/is_grid_mode.F                             |   105 +
 fer/stk/is_modulo.F                                |   276 +
 fer/stk/is_pseudo.F                                |    98 +
 fer/stk/is_pystat_var.F                            |   182 +
 fer/stk/is_read.F                                  |   146 +
 fer/stk/is_read_remote.F                           |    86 +
 fer/stk/is_reconcile.F                             |   145 +
 fer/stk/is_regrid.F                                |   396 +
 fer/stk/is_reverse.F                               |   184 +
 fer/stk/is_sample.F                                |   228 +
 fer/stk/is_string.F                                |    76 +
 fer/stk/is_strip.F                                 |   554 +
 fer/stk/is_subspan_fill.F                          |   148 +
 fer/stk/is_trans.F                                 |   402 +
 fer/stk/is_uvar_grid.F                             |   805 +
 fer/stk/its_auto_curvi.F                           |    66 +
 fer/stk/known_grid.F                               |   120 +
 fer/stk/make_pseudo_var.F                          |   104 +
 fer/stk/non_array_subsc.F                          |    67 +
 fer/stk/offset_ss.F                                |   229 +
 fer/stk/operate.F                                  |  1724 +
 fer/stk/pass_ambig_lims.F                          |   249 +
 fer/stk/potent_size.F                              |    80 +
 fer/stk/push_interp_stack.F                        |    82 +
 fer/stk/randn.F                                    |    87 +
 fer/stk/randn2.F                                   |    88 +
 fer/stk/randu.F                                    |   147 +
 fer/stk/rcvd_regrid.F                              |   284 +
 fer/stk/regrid_lims.F                              |   277 +
 fer/stk/rqst_regrid.F                              |   366 +
 fer/stk/setup_sample.F                             |   175 +
 fer/stk/stack_ptr_dn.F                             |    65 +
 fer/stk/stack_ptr_up.F                             |    63 +
 fer/stk/string_concatenate.F                       |   137 +
 fer/stk/string_conditional.F                       |   218 +
 fer/stk/string_context.F                           |    49 +
 fer/stk/string_operate.F                           |   189 +
 fer/stk/svar_context.F                             |    48 +
 fer/stk/transfer_isp.F                             |    65 +
 fer/stk/unprotect_cmnd_data.F                      |    71 +
 fer/stk/xerror.F                                   |    45 +
 fer/utl/LIB_NAME                                   |     1 +
 fer/utl/Makefile                                   |    37 +
 fer/utl/SOURCE_FILES                               |   168 +
 fer/utl/add_2_grids.F                              |    79 +
 fer/utl/add_2_grids_sub.F                          |    88 +
 fer/utl/add_c_2_grid.F                             |    62 +
 fer/utl/adjust_copy_limits.F                       |   101 +
 fer/utl/allo_grid.F                                |    69 +
 fer/utl/allo_managed_axis.F                        |    88 +
 fer/utl/allo_managed_grid.F                        |    89 +
 fer/utl/arg_to_item.F                              |    68 +
 fer/utl/attrib_string.F                            |    94 +
 fer/utl/attrib_vals.F                              |    83 +
 fer/utl/axis_distance.F                            |    73 +
 fer/utl/axis_intervals.F                           |   194 +
 fer/utl/bkwd_axis.F                                |    81 +
 fer/utl/box_bounds.F                               |    87 +
 fer/utl/box_size.F                                 |   155 +
 fer/utl/cal_factr.F                                |    97 +
 fer/utl/calendar_axis.F                            |   108 +
 fer/utl/caxis_len.F                                |    70 +
 fer/utl/caxis_modlen.F                             |    77 +
 fer/utl/check_neg_taxis.F                          |    99 +
 fer/utl/confine_axis.F                             |   273 +
 fer/utl/copy_2d_to_3d.F                            |    72 +
 fer/utl/copy_2d_to_3d_sub.F                        |    88 +
 fer/utl/copy_agg_into.F                            |   131 +
 fer/utl/copy_agg_into_sub.F                        |    86 +
 fer/utl/copy_agg_ptr_into_sub.F                    |    76 +
 fer/utl/copy_grid.F                                |   117 +
 fer/utl/copy_grid_sub.F                            |    93 +
 fer/utl/copy_grid_trans.F                          |    74 +
 fer/utl/copy_grid_trans_sub.F                      |    98 +
 fer/utl/copy_into.F                                |   131 +
 fer/utl/copy_into_mapped.F                         |   105 +
 fer/utl/copy_into_mapped_sub.F                     |   300 +
 fer/utl/copy_into_sub.F                            |    81 +
 fer/utl/copy_ptr_grid_sub.F                        |    76 +
 fer/utl/copy_ptr_into_mapped_sub.F                 |   302 +
 fer/utl/copy_ptr_into_sub.F                        |    75 +
 fer/utl/count_number_list.F                        |   128 +
 fer/utl/create_counter_list.F                      |   107 +
 fer/utl/cstring_insert.F                           |    92 +
 fer/utl/de_escape_string.F                         |    84 +
 fer/utl/deallo_all_axes.F                          |   114 +
 fer/utl/deallo_all_grids.F                         |    92 +
 fer/utl/deallo_grid.F                              |    81 +
 fer/utl/deallo_unformed_grid.F                     |    74 +
 fer/utl/decrement_plot_grid.F                      |    51 +
 fer/utl/dense_contig_region.F                      |    84 +
 fer/utl/depend_stat_var.F                          |    60 +
 fer/utl/depend_stat_var_sub.F                      |    93 +
 fer/utl/display_dependency.F                       |    60 +
 fer/utl/display_dependency_sub.F                   |   342 +
 fer/utl/extract_dp_line.F                          |    78 +
 fer/utl/extract_dp_line2.F                         |    78 +
 fer/utl/extract_line.F                             |    98 +
 fer/utl/extract_line_fast.F                        |    94 +
 fer/utl/extract_line_sub.F                         |    78 +
 fer/utl/extract_z_line.F                           |    97 +
 fer/utl/field_minmax.F                             |    65 +
 fer/utl/field_minmax_sub.F                         |    82 +
 fer/utl/gcf_arg_type.F                             |    33 +
 fer/utl/gcf_child_var_name.F                       |    75 +
 fer/utl/gcf_find_fcn.F                             |   106 +
 fer/utl/gcf_get_arg_lims.F                         |   145 +
 fer/utl/gcf_get_arg_parms.F                        |    99 +
 fer/utl/gcf_get_axis_srcs.F                        |   128 +
 fer/utl/gcf_get_imposed_axes.F                     |   247 +
 fer/utl/gcf_impose_arg_lim_dflts.F                 |   234 +
 fer/utl/gcf_impose_axes.F                          |   148 +
 fer/utl/gcf_impose_result_lims.F                   |   422 +
 fer/utl/gcf_name.F                                 |    91 +
 fer/utl/gcf_num_args.F                             |    67 +
 fer/utl/gcf_parent_char.F                          |    84 +
 fer/utl/gcf_parent_uvar.F                          |    76 +
 fer/utl/gcf_rtn_type.F                             |    99 +
 fer/utl/geog_var.F                                 |    89 +
 fer/utl/get_ave_lims.F                             |   112 +
 fer/utl/get_date_and_time.F                        |    57 +
 fer/utl/get_dependency_status.F                    |    98 +
 fer/utl/get_max_string_len.F                       |    65 +
 fer/utl/get_max_string_len_sub.F                   |    92 +
 fer/utl/get_string_element.F                       |    88 +
 fer/utl/get_unique_dset_name.F                     |    82 +
 fer/utl/get_window_lims.F                          |    92 +
 fer/utl/getunit.F                                  |    73 +
 fer/utl/gname_from_number.F                        |   106 +
 fer/utl/go_file_input.F                            |    60 +
 fer/utl/grid_from_name.F                           |    99 +
 fer/utl/grid_from_name_xml.F                       |   101 +
 fer/utl/grid_subscript_extremes.F                  |    88 +
 fer/utl/grid_subscript_extremes_no_mod.F           |    81 +
 fer/utl/grid_world_extremes.F                      |   103 +
 fer/utl/heap2.F                                    |   111 +
 fer/utl/heap2_v.F                                  |   105 +
 fer/utl/hunt_indices.F                             |   217 +
 fer/utl/hunt_r4.F                                  |   126 +
 fer/utl/igrid.F                                    |   112 +
 fer/utl/inherit_attrs.F                            |   187 +
 fer/utl/invalid_r8_to_i4.F                         |    64 +
 fer/utl/is_template.F                              |    54 +
 fer/utl/isubscr_cx.F                               |   289 +
 fer/utl/isubscript.F                               |   246 +
 fer/utl/itsa_fill_trans.F                          |    56 +
 fer/utl/itsa_gcvar.F                               |    60 +
 fer/utl/itsa_modulo_axis.F                         |    63 +
 fer/utl/itsa_modulo_gcf.F                          |    81 +
 fer/utl/itsa_modulo_regrid.F                       |    61 +
 fer/utl/itsa_pure_sum_var.F                        |   126 +
 fer/utl/legal_chars.F                              |    72 +
 fer/utl/make_axis.F                                |    67 +
 fer/utl/make_step_axis.F                           |    85 +
 fer/utl/match4.F                                   |    85 +
 fer/utl/match_name.F                               |    81 +
 fer/utl/match_quoted_name.F                        |   100 +
 fer/utl/match_template.F                           |   134 +
 fer/utl/minmax.F                                   |    70 +
 fer/utl/modulo_parity.F                            |    62 +
 fer/utl/mult_grid.F                                |    58 +
 fer/utl/ndig_coords.F                              |    98 +
 fer/utl/no_grid_range.F                            |    84 +
 fer/utl/no_line_range.F                            |    77 +
 fer/utl/open_show_file.F                           |   144 +
 fer/utl/pack_line_storage.F                        |   110 +
 fer/utl/parse_nam_dset_grd.F                       |    91 +
 fer/utl/parse_number_list.F                        |   117 +
 fer/utl/parse_string_list.F                        |   165 +
 fer/utl/permute.F                                  |    98 +
 fer/utl/permute_ptr_sub.F                          |    98 +
 fer/utl/permute_sub.F                              |   121 +
 fer/utl/region_number.F                            |    74 +
 fer/utl/regularly_spaced.F                         |    55 +
 fer/utl/report_aux_dependency.F                    |    90 +
 fer/utl/report_dependency.F                        |   173 +
 fer/utl/reset_secs_from_bc.F                       |    83 +
 fer/utl/reverse_grid_axis.F                        |    89 +
 fer/utl/reverse_grid_axis_sub.F                    |   133 +
 fer/utl/secs_from_bc.F                             |    82 +
 fer/utl/secs_to_date.F                             |    72 +
 fer/utl/secs_to_date_c.F                           |    76 +
 fer/utl/secs_to_date_out.F                         |   149 +
 fer/utl/secs_to_tstep.F                            |    89 +
 fer/utl/set_auto_curvi_modes.F                     |    73 +
 fer/utl/shellr.F                                   |    86 +
 fer/utl/short_mod_copy.F                           |   184 +
 fer/utl/sort_list.F                                |    89 +
 fer/utl/split_list.F                               |   122 +
 fer/utl/ss_neighbors.F                             |   269 +
 fer/utl/store_dependency.F                         |   254 +
 fer/utl/store_string.F                             |    82 +
 fer/utl/store_sys_strings.F                        |   112 +
 fer/utl/str_match.F                                |    70 +
 fer/utl/sub_2_grids.F                              |    84 +
 fer/utl/sub_2_grids_sub.F                          |    94 +
 fer/utl/t_deriv.F                                  |   147 +
 fer/utl/tdest_world.F                              |    99 +
 fer/utl/tdest_world_init.F                         |   137 +
 fer/utl/transfer_axis.F                            |    76 +
 fer/utl/transfer_cx_axis_to_uv.F                   |    59 +
 fer/utl/transfer_grid.F                            |    64 +
 fer/utl/transfer_uv_axis_to_uv.F                   |    59 +
 fer/utl/true_or_false.F                            |   104 +
 fer/utl/tstep_to_date.F                            |   138 +
 fer/utl/tstep_to_secs.F                            |   118 +
 fer/utl/tworld.F                                   |    81 +
 fer/utl/unit_chg_ax.F                              |    91 +
 fer/utl/update_attributes.F                        |   130 +
 fer/utl/upper_case.F                               |    84 +
 fer/utl/valid_grid.F                               |    68 +
 fer/utl/which_gcfcn.F                              |    65 +
 fer/xeq/LIB_NAME                                   |     2 +
 fer/xeq/Makefile                                   |    37 +
 fer/xeq/SOURCE_FILES                               |    28 +
 fer/xeq/xeq_cancel.F                               |  1252 +
 fer/xeq/xeq_contour.F                              |   620 +
 fer/xeq/xeq_define.F                               |  2380 +
 fer/xeq/xeq_elif.F                                 |   111 +
 fer/xeq/xeq_else.F                                 |    84 +
 fer/xeq/xeq_endif.F                                |    84 +
 fer/xeq/xeq_exit.F                                 |   183 +
 fer/xeq/xeq_frame.F                                |   218 +
 fer/xeq/xeq_go.F                                   |   202 +
 fer/xeq/xeq_help.F                                 |    84 +
 fer/xeq/xeq_if.F                                   |   232 +
 fer/xeq/xeq_list.F                                 |   734 +
 fer/xeq/xeq_load.F                                 |   139 +
 fer/xeq/xeq_message.F                              |   175 +
 fer/xeq/xeq_plot.F                                 |   752 +
 fer/xeq/xeq_polygon.F                              |   549 +
 fer/xeq/xeq_pplus.F                                |   205 +
 fer/xeq/xeq_query.F                                |   149 +
 fer/xeq/xeq_repeat.F                               |   441 +
 fer/xeq/xeq_set.F                                  |  2098 +
 fer/xeq/xeq_shade.F                                |   491 +
 fer/xeq/xeq_show.F                                 |  2059 +
 fer/xeq/xeq_spawn.F                                |    87 +
 fer/xeq/xeq_stat.F                                 |    88 +
 fer/xeq/xeq_user_command.F                         |   103 +
 fer/xeq/xeq_vector.F                               |   579 +
 fer/xeq/xeq_wire.F                                 |   215 +
 fer/xeq/xeq_write.F                                |    50 +
 ferretmagic.py                                     |   398 +
 fmt/cmn/NCF_Util.h                                 |   159 +
 fmt/cmn/cd_lib.parm                                |    24 +
 fmt/cmn/cdf_tmap.parm                              |    26 +
 fmt/cmn/cpu.parm                                   |    12 +
 fmt/cmn/descript.def                               |    48 +
 fmt/cmn/encode_strings.cmn                         |    13 +
 fmt/cmn/ez_delimited_read.h                        |    82 +
 fmt/cmn/ez_lib.parm                                |    38 +
 fmt/cmn/ferretmacros.h                             |    27 +
 fmt/cmn/gt_lib.parm                                |    98 +
 fmt/cmn/implicit.parm                              |    12 +
 fmt/cmn/netcdf_declareUnderscore.inc               |    35 +
 fmt/cmn/tmap_dims.parm                             |    79 +
 fmt/cmn/tmap_dset.parm                             |   184 +
 fmt/cmn/tmap_dtypes.parm                           |    21 +
 fmt/cmn/tmap_errors.parm                           |   111 +
 fmt/cmn/xalt_messages.cmn                          |     3 +
 fmt/cmn/xalt_messages.cmn_text                     |     9 +
 fmt/cmn/xbuild_grids.cmn                           |    26 +
 fmt/cmn/xcdferror.cmn                              |     3 +
 fmt/cmn/xcdferror.cmn_text                         |     8 +
 fmt/cmn/xdefer_coords.cmn                          |    32 +
 fmt/cmn/xdiag_ctrl.cmn                             |     3 +
 fmt/cmn/xdiag_ctrl.cmn_text                        |     5 +
 fmt/cmn/xdset_info.cd_equiv                        |    28 +
 fmt/cmn/xdset_info.cmn                             |     5 +
 fmt/cmn/xdset_info.cmn_text                        |   131 +
 fmt/cmn/xerror_text.cmn                            |     3 +
 fmt/cmn/xerror_text.cmn_text                       |     4 +
 fmt/cmn/xez_info.cmn                               |     3 +
 fmt/cmn/xez_info.cmn_text                          |     9 +
 fmt/cmn/xez_order.cmn_text                         |     4 +
 fmt/cmn/xio.cmn                                    |     3 +
 fmt/cmn/xio.cmn_text                               |     9 +
 fmt/cmn/xio.parm                                   |     8 +
 fmt/cmn/xmachine_byte.cmn                          |    24 +
 fmt/cmn/xmachine_int1.cmn                          |    24 +
 fmt/cmn/xrisc_buff.cmn                             |    13 +
 fmt/cmn/xstep_files.cmn                            |     5 +
 fmt/cmn/xstep_files.cmn_text                       |    59 +
 fmt/cmn/xsys_names.cmn                             |     3 +
 fmt/cmn/xsys_names.cmn_text                        |     7 +
 fmt/cmn/xtm_grid.cmn                               |     4 +
 fmt/cmn/xtm_grid.cmn_text                          |   103 +
 fmt/cmn/xunits.cmn                                 |     4 +
 fmt/cmn/xunits.cmn_text                            |    48 +
 fmt/src/LIB_NAME                                   |     1 +
 fmt/src/Makefile                                   |    38 +
 fmt/src/NCF_Util.c                                 |  3696 +
 fmt/src/SOURCE_FILES                               |   340 +
 fmt/src/cd_abort_grids.F                           |    67 +
 fmt/src/cd_add_agg_var_info.F                      |    67 +
 fmt/src/cd_add_coord_var.F                         |    91 +
 fmt/src/cd_add_var.F                               |    97 +
 fmt/src/cd_assoc_grids.F                           |   254 +
 fmt/src/cd_axis_name.F                             |   121 +
 fmt/src/cd_axis_outname.F                          |   156 +
 fmt/src/cd_axlen.F                                 |   110 +
 fmt/src/cd_childax_name.F                          |    92 +
 fmt/src/cd_clean_grids.F                           |   276 +
 fmt/src/cd_close_set.F                             |    85 +
 fmt/src/cd_consistent_axis_orient.F                |   358 +
 fmt/src/cd_conventions_out.F                       |    94 +
 fmt/src/cd_defer_coord_write.F                     |    79 +
 fmt/src/cd_delete_attribute.F                      |    71 +
 fmt/src/cd_dods_control.F                          |   163 +
 fmt/src/cd_dset_remoteok.F                         |   126 +
 fmt/src/cd_encode_url.F                            |    83 +
 fmt/src/cd_get_1_axis.F                            |  1347 +
 fmt/src/cd_get_1_dep_var.F                         |   403 +
 fmt/src/cd_get_agg_dset_info.F                     |    52 +
 fmt/src/cd_get_agg_dset_member.F                   |    53 +
 fmt/src/cd_get_agg_var_info.F                      |    66 +
 fmt/src/cd_get_attrib.F                            |   157 +
 fmt/src/cd_get_attval.F                            |   193 +
 fmt/src/cd_get_attval_l.F                          |   162 +
 fmt/src/cd_get_attvalc.F                           |   139 +
 fmt/src/cd_get_bounds.F                            |   219 +
 fmt/src/cd_get_chunk_cache.F                       |    80 +
 fmt/src/cd_get_dim_id.F                            |    75 +
 fmt/src/cd_get_ds_dims.F                           |    72 +
 fmt/src/cd_get_ds_info.F                           |    63 +
 fmt/src/cd_get_generic_bounds.F                    |   235 +
 fmt/src/cd_get_generic_grids.F                     |   363 +
 fmt/src/cd_get_line_direction.F                    |   526 +
 fmt/src/cd_get_missing_flag.F                      |   135 +
 fmt/src/cd_get_parent_grids.F                      |   231 +
 fmt/src/cd_get_time_axis.F                         |   123 +
 fmt/src/cd_get_tmap_parms.F                        |   165 +
 fmt/src/cd_get_var_att_id.F                        |   123 +
 fmt/src/cd_get_var_att_info.F                      |    84 +
 fmt/src/cd_get_var_att_name.F                      |    74 +
 fmt/src/cd_get_var_id.F                            |   145 +
 fmt/src/cd_get_var_info.F                          |   106 +
 fmt/src/cd_get_var_outflag.F                       |    66 +
 fmt/src/cd_get_var_outtype.F                       |    71 +
 fmt/src/cd_init_agg_dset.F                         |    74 +
 fmt/src/cd_init_dset.F                             |   189 +
 fmt/src/cd_isit_another_dset.F                     |    78 +
 fmt/src/cd_isit_epic.F                             |    96 +
 fmt/src/cd_isit_recdim.F                           |   137 +
 fmt/src/cd_load_dset_attrs.F                       |   252 +
 fmt/src/cd_make_var.F                              |   516 +
 fmt/src/cd_ncclose.F                               |    59 +
 fmt/src/cd_ncopen.F                                |    87 +
 fmt/src/cd_nf_get_bad.F                            |    91 +
 fmt/src/cd_nf_get_var_grid.F                       |   120 +
 fmt/src/cd_nf_get_varid.F                          |    89 +
 fmt/src/cd_open_dset.F                             |   302 +
 fmt/src/cd_open_out.F                              |   145 +
 fmt/src/cd_put_agg_memb_grid.F                     |    63 +
 fmt/src/cd_put_new_attr.F                          |   115 +
 fmt/src/cd_put_new_attr_dp.F                       |   115 +
 fmt/src/cd_rd_ep_1.F                               |   142 +
 fmt/src/cd_rd_ep_arr.F                             |    85 +
 fmt/src/cd_rd_r8_1.F                               |    89 +
 fmt/src/cd_rd_r8_arr.F                             |    97 +
 fmt/src/cd_rd_r8_as_r4.c                           |   118 +
 fmt/src/cd_rd_r8_bnds.F                            |   101 +
 fmt/src/cd_rd_ymd_1.F                              |   146 +
 fmt/src/cd_rd_ymd_arr.F                            |    85 +
 fmt/src/cd_read.F                                  |   431 +
 fmt/src/cd_read_remote.F                           |   318 +
 fmt/src/cd_read_scale.c                            |   242 +
 fmt/src/cd_read_sub.c                              |   253 +
 fmt/src/cd_rec_synch.F                             |   350 +
 fmt/src/cd_rename_var.F                            |    81 +
 fmt/src/cd_replace_attr.F                          |   119 +
 fmt/src/cd_replace_attr_dp.F                       |   118 +
 fmt/src/cd_scan_vars.F                             |   489 +
 fmt/src/cd_set_att_axdir.F                         |    62 +
 fmt/src/cd_set_att_flag.F                          |   121 +
 fmt/src/cd_set_chunk_cache.F                       |   136 +
 fmt/src/cd_set_compress.F                          |   140 +
 fmt/src/cd_set_mode.F                              |   111 +
 fmt/src/cd_set_var_type.F                          |    65 +
 fmt/src/cd_stamp_out.F                             |   104 +
 fmt/src/cd_store_dset.F                            |    93 +
 fmt/src/cd_store_dset_attrs.F                      |   112 +
 fmt/src/cd_transfer_attribute.F                    |    62 +
 fmt/src/cd_translate_error.F                       |    87 +
 fmt/src/cd_use_recdim.F                            |   133 +
 fmt/src/cd_write_att_dp_sub.c                      |   110 +
 fmt/src/cd_write_att_sub.c                         |   134 +
 fmt/src/cd_write_attrib.F                          |   216 +
 fmt/src/cd_write_attval.F                          |   169 +
 fmt/src/cd_write_attval_dp.F                       |   167 +
 fmt/src/cd_write_axis.F                            |  1069 +
 fmt/src/cd_write_bndsdim.F                         |   133 +
 fmt/src/cd_write_defer_coord.F                     |   167 +
 fmt/src/cd_write_grid.F                            |   218 +
 fmt/src/cd_write_strdim.F                          |   128 +
 fmt/src/cd_write_var.F                             |   551 +
 fmt/src/cd_write_var_sub.c                         |   225 +
 fmt/src/deleted_list.h                             |    65 +
 fmt/src/deleted_list_clear.c                       |    60 +
 fmt/src/deleted_list_get_del.c                     |    72 +
 fmt/src/deleted_list_get_undel.c                   |    72 +
 fmt/src/deleted_list_init.c                        |    95 +
 fmt/src/deleted_list_modify.c                      |    99 +
 fmt/src/emacs_keymap.h                             |   474 +
 fmt/src/encode_strings_data.F                      |   106 +
 fmt/src/ez_delimited_read.c                        |   786 +
 fmt/src/ez_init_dset.F                             |   498 +
 fmt/src/ez_init_permute.F                          |    85 +
 fmt/src/ez_mod_dset.F                              |   124 +
 fmt/src/ez_mod_vars.F                              |   190 +
 fmt/src/ez_permuted_index.F                        |    90 +
 fmt/src/ez_read.F                                  |   469 +
 fmt/src/ez_update_var.F                            |    87 +
 fmt/src/fbits.h                                    |    26 +
 fmt/src/gt_get_time_axis.F                         |   287 +
 fmt/src/lib_free_lun.F                             |    50 +
 fmt/src/lib_get_lun.F                              |    62 +
 fmt/src/mc_init_dset.F                             |   393 +
 fmt/src/mc_read.F                                  |   427 +
 fmt/src/nc.h                                       |     7 +
 fmt/src/nc_get_attrib.F                            |   202 +
 fmt/src/nc_get_attrib_dp.F                         |   136 +
 fmt/src/nc_get_attrib_float.F                      |   193 +
 fmt/src/nc_get_attrib_string.F                     |   195 +
 fmt/src/ncconfig.h                                 |     6 +
 fmt/src/ncio.h                                     |     7 +
 fmt/src/remote_read.F                              |   255 +
 fmt/src/str_case_blind_compare.F                   |    64 +
 fmt/src/str_case_blind_compare_sub.c               |   113 +
 fmt/src/str_dncase.F                               |    64 +
 fmt/src/str_dncase_sub.c                           |    52 +
 fmt/src/str_same.F                                 |    83 +
 fmt/src/str_upcase.F                               |    71 +
 fmt/src/str_upcase_sub.c                           |    53 +
 fmt/src/string_array.h                             |    64 +
 fmt/src/string_array_clear.c                       |    61 +
 fmt/src/string_array_find.c                        |   119 +
 fmt/src/string_array_find_caseblind.c              |   116 +
 fmt/src/string_array_find_exact.c                  |   116 +
 fmt/src/string_array_find_quoted.c                 |   143 +
 fmt/src/string_array_get_strlen.c                  |    61 +
 fmt/src/string_array_get_strlen1.c                 |    63 +
 fmt/src/string_array_hash.c                        |   170 +
 fmt/src/string_array_init.c                        |    93 +
 fmt/src/string_array_modify.c                      |   100 +
 fmt/src/string_array_modify_upcase.c               |   100 +
 fmt/src/tm_abstract_axis.F                         |    70 +
 fmt/src/tm_add_message.F                           |    57 +
 fmt/src/tm_allo_dyn_grid.F                         |    53 +
 fmt/src/tm_allo_dyn_grid_sub.F                     |   104 +
 fmt/src/tm_allo_dyn_line.F                         |    54 +
 fmt/src/tm_allo_dyn_line_sub.F                     |   112 +
 fmt/src/tm_allo_tmp_grid.F                         |    73 +
 fmt/src/tm_allo_tmp_line.F                         |    76 +
 fmt/src/tm_alternate_note.F                        |    73 +
 fmt/src/tm_axes_reversed.F                         |    80 +
 fmt/src/tm_axis_direction.F                        |   105 +
 fmt/src/tm_axis_order.F                            |   297 +
 fmt/src/tm_axis_recursive.F                        |    55 +
 fmt/src/tm_axis_stride.F                           |    73 +
 fmt/src/tm_blockify_ferret_strings.c               |    77 +
 fmt/src/tm_break_date.F                            |   313 +
 fmt/src/tm_break_fmt_date.F                        |   146 +
 fmt/src/tm_break_fmt_date_c.c                      |   113 +
 fmt/src/tm_break_lines.F                           |   117 +
 fmt/src/tm_break_str.F                             |    82 +
 fmt/src/tm_c_rename.c                              |    70 +
 fmt/src/tm_check_bnds.F                            |   213 +
 fmt/src/tm_check_bnds_attrib.F                     |   128 +
 fmt/src/tm_check_bnds_centered.F                   |   111 +
 fmt/src/tm_check_box_loc.F                         |    75 +
 fmt/src/tm_check_edges_attrib.F                    |   140 +
 fmt/src/tm_check_inf.c                             |    57 +
 fmt/src/tm_check_nan.c                             |    57 +
 fmt/src/tm_choose_read.F                           |   123 +
 fmt/src/tm_clean_filename.F                        |   114 +
 fmt/src/tm_close_set.F                             |   237 +
 fmt/src/tm_close_step.F                            |    79 +
 fmt/src/tm_cmprss.F                                |    86 +
 fmt/src/tm_conv_to_r4.F                            |   121 +
 fmt/src/tm_conv_to_r8.F                            |   144 +
 fmt/src/tm_copy_grid.F                             |    62 +
 fmt/src/tm_copy_grid_w_line_use.F                  |    66 +
 fmt/src/tm_copy_line.F                             |    85 +
 fmt/src/tm_ctof_strng.F                            |    97 +
 fmt/src/tm_date.F                                  |   110 +
 fmt/src/tm_date_ok.F                               |    64 +
 fmt/src/tm_date_reformat.F                         |    85 +
 fmt/src/tm_date_time.F                             |    51 +
 fmt/src/tm_date_to_step.F                          |   116 +
 fmt/src/tm_deallo_dyn_grid.F                       |    80 +
 fmt/src/tm_deallo_dyn_grid_sub.F                   |    99 +
 fmt/src/tm_deallo_dyn_line.F                       |    72 +
 fmt/src/tm_deallo_dyn_line_sub.F                   |   113 +
 fmt/src/tm_dfp_convert.c                           |   209 +
 fmt/src/tm_dfpeq.F                                 |    65 +
 fmt/src/tm_dfpeq_tol.F                             |    63 +
 fmt/src/tm_digit.F                                 |   105 +
 fmt/src/tm_digit_test.F                            |   120 +
 fmt/src/tm_dset_deallo_grids.F                     |    68 +
 fmt/src/tm_dset_number.F                           |    76 +
 fmt/src/tm_dset_use_grids.F                        |    68 +
 fmt/src/tm_ep_time_convrt.c                        |   131 +
 fmt/src/tm_errmsg.F                                |   330 +
 fmt/src/tm_exit.F                                  |    81 +
 fmt/src/tm_exp_code.F                              |   133 +
 fmt/src/tm_f7721bug_inquire.F                      |    71 +
 fmt/src/tm_ferret_vartype.F                        |    75 +
 fmt/src/tm_fill.F                                  |    73 +
 fmt/src/tm_find_like_dyn_grid.F                    |    85 +
 fmt/src/tm_find_like_dyn_line.F                    |    86 +
 fmt/src/tm_find_like_grid.F                        |    77 +
 fmt/src/tm_find_like_line.F                        |    81 +
 fmt/src/tm_find_line_slot.F                        |    83 +
 fmt/src/tm_firm_axis_orient.F                      |    96 +
 fmt/src/tm_fmt.F                                   |   337 +
 fmt/src/tm_fmt_sngl.F                              |   295 +
 fmt/src/tm_fmt_sngl_digits.F                       |   272 +
 fmt/src/tm_fp_convert.F                            |   166 +
 fmt/src/tm_fpeq.F                                  |    77 +
 fmt/src/tm_fpeq_eps.F                              |    69 +
 fmt/src/tm_fpeq_sngl.F                             |    70 +
 fmt/src/tm_friendly_read.F                         |    84 +
 fmt/src/tm_ftoc_readline.c                         |   201 +
 fmt/src/tm_ftoc_strng.F                            |    95 +
 fmt/src/tm_garb_col_grids.F                        |   133 +
 fmt/src/tm_garb_col_lines.F                        |   142 +
 fmt/src/tm_get_205_run_line.F                      |   141 +
 fmt/src/tm_get_205_run_parm.F                      |   119 +
 fmt/src/tm_get_cal.F                               |    57 +
 fmt/src/tm_get_calendar_attributes.F               |   117 +
 fmt/src/tm_get_calendar_id.F                       |    86 +
 fmt/src/tm_get_calendar_name.F                     |    52 +
 fmt/src/tm_get_f_cal.F                             |    57 +
 fmt/src/tm_get_grid_of_line.F                      |    82 +
 fmt/src/tm_get_gridnum.F                           |    84 +
 fmt/src/tm_get_like_dyn_grid.F                     |   106 +
 fmt/src/tm_get_like_dyn_line.F                     |   216 +
 fmt/src/tm_get_like_grid.F                         |    83 +
 fmt/src/tm_get_like_line.F                         |    82 +
 fmt/src/tm_get_linematch.F                         |    92 +
 fmt/src/tm_get_linematch_sub.F                     |    96 +
 fmt/src/tm_get_linenum.F                           |    85 +
 fmt/src/tm_get_strlen.c                            |    52 +
 fmt/src/tm_get_varnum.F                            |    83 +
 fmt/src/tm_grid_match.F                            |    78 +
 fmt/src/tm_has_string.F                            |    77 +
 fmt/src/tm_hash_name.F                             |    66 +
 fmt/src/tm_init_dset.F                             |   573 +
 fmt/src/tm_init_dyn_grids.F                        |   105 +
 fmt/src/tm_inq_path.F                              |   224 +
 fmt/src/tm_int2_swap.F                             |    96 +
 fmt/src/tm_int4_swap.F                             |    97 +
 fmt/src/tm_irregax_mid.F                           |    77 +
 fmt/src/tm_its_cdf.F                               |    89 +
 fmt/src/tm_its_subspan_modulo.F                    |    72 +
 fmt/src/tm_itsa_model_run.F                        |    96 +
 fmt/src/tm_lefint.F                                |    77 +
 fmt/src/tm_legal_name.F                            |   104 +
 fmt/src/tm_legal_name_op.F                         |    73 +
 fmt/src/tm_legal_unix_name.F                       |    83 +
 fmt/src/tm_lenstr.F                                |    57 +
 fmt/src/tm_lenstr1.F                               |    68 +
 fmt/src/tm_line_match.F                            |   134 +
 fmt/src/tm_load_calendar.F                         |   106 +
 fmt/src/tm_loc_string.F                            |    91 +
 fmt/src/tm_lonw2lone.F                             |    54 +
 fmt/src/tm_make_4d_grids.F                         |   245 +
 fmt/src/tm_make_basic_axis.F                       |   103 +
 fmt/src/tm_make_dyn_line.F                         |   190 +
 fmt/src/tm_make_fmt_date.F                         |    83 +
 fmt/src/tm_make_relative_ver.c                     |   117 +
 fmt/src/tm_match_capital_name.c                    |    62 +
 fmt/src/tm_mod.F                                   |    67 +
 fmt/src/tm_modulo_axlen.F                          |    61 +
 fmt/src/tm_modulo_line_dim.F                       |    64 +
 fmt/src/tm_new_grid_name.F                         |    97 +
 fmt/src/tm_new_line_name.F                         |    96 +
 fmt/src/tm_next_dyn_grid.F                         |    55 +
 fmt/src/tm_next_dyn_line.F                         |    55 +
 fmt/src/tm_next_tmp_grid.F                         |    55 +
 fmt/src/tm_next_tmp_line.F                         |    55 +
 fmt/src/tm_next_ver_name.F                         |    86 +
 fmt/src/tm_note.F                                  |    77 +
 fmt/src/tm_number.F                                |    68 +
 fmt/src/tm_number_sub.c                            |    75 +
 fmt/src/tm_only1_step.F                            |    77 +
 fmt/src/tm_pack_string.F                           |    99 +
 fmt/src/tm_park_last_version.F                     |   113 +
 fmt/src/tm_parse_string.F                          |    98 +
 fmt/src/tm_path_list.F                             |   340 +
 fmt/src/tm_purge_tmp_grids.F                       |   101 +
 fmt/src/tm_re_allo_tmp_grid.F                      |    85 +
 fmt/src/tm_re_allo_tmp_line.F                      |    85 +
 fmt/src/tm_read.F                                  |   290 +
 fmt/src/tm_read_gridfile.F                         |   656 +
 fmt/src/tm_rename.F                                |    81 +
 fmt/src/tm_same_grid_def.F                         |    78 +
 fmt/src/tm_same_line_def.F                         |   211 +
 fmt/src/tm_scale.F                                 |    58 +
 fmt/src/tm_scale_all.F                             |    87 +
 fmt/src/tm_scale_nobad.F                           |    60 +
 fmt/src/tm_secs_from_bc.F                          |   222 +
 fmt/src/tm_secs_to_date.F                          |   335 +
 fmt/src/tm_set_current_calendar.F                  |    87 +
 fmt/src/tm_set_free_event.c                        |    66 +
 fmt/src/tm_split_message.F                         |    55 +
 fmt/src/tm_step_to_date.F                          |   130 +
 fmt/src/tm_string.F                                |    66 +
 fmt/src/tm_subsc.F                                 |   218 +
 fmt/src/tm_switch_nan.c                            |    66 +
 fmt/src/tm_translate_axis.F                        |   115 +
 fmt/src/tm_translate_lat_long.F                    |   112 +
 fmt/src/tm_unblockify_ferret_strings.c             |   100 +
 fmt/src/tm_unit_id.F                               |   129 +
 fmt/src/tm_unix_versions.c                         |   186 +
 fmt/src/tm_use_dyn_grid.F                          |    59 +
 fmt/src/tm_use_line.F                              |    64 +
 fmt/src/tm_world.F                                 |    94 +
 fmt/src/tm_world_ax.F                              |   165 +
 fmt/src/tm_world_recur.c                           |   303 +
 fmt/src/tm_ww_ax_1_n.F                             |    66 +
 fmt/src/tm_ww_axlen.F                              |    59 +
 fmt/src/tm_ww_axlims.F                             |    67 +
 fmt/src/tm_ymd_time_convrt.F                       |    83 +
 fmt/src/urlencode.c                                |   109 +
 fmt/src/xalt_messages_data.F                       |    56 +
 fmt/src/xdiag_ctrl_data.F                          |    54 +
 fmt/src/xdset_info_data.F                          |   148 +
 fmt/src/xerror_text_data.F                         |   160 +
 fmt/src/xez_info_data.F                            |    63 +
 fmt/src/xgt_grid_data.F                            |   696 +
 fmt/src/xio_data.F                                 |    56 +
 fmt/src/xmachine_data.F                            |    73 +
 fmt/src/xstep_files_data.F                         |    77 +
 fmt/src/xsys_names_data.F                          |    57 +
 fmt/src/xunits_data.F                              |   217 +
 gcircle.py                                         |   637 +
 jnls/contrib/TS_section.jnl                        |    85 +
 jnls/contrib/TernaryDiagram.jnl                    |    40 +
 jnls/contrib/bering_coast.dat                      | 13467 ++++
 jnls/contrib/bering_coast.jnl                      |    21 +
 jnls/contrib/bering_iso100.dat                     |  4175 +
 jnls/contrib/bering_iso100.jnl                     |    21 +
 jnls/contrib/bering_iso1000.dat                    |  2570 +
 jnls/contrib/bering_iso1000.jnl                    |    21 +
 jnls/contrib/bias_zonalanommap.nc                  |   Bin 0 -> 4096 bytes
 jnls/contrib/color_vector.jnl                      |   301 +
 jnls/contrib/color_vector_demo.jnl                 |   106 +
 jnls/contrib/create_KMZ.jnl                        |   346 +
 jnls/contrib/create_KMZ_groundoverlay_1.jnl        |    83 +
 jnls/contrib/create_KMZ_groundoverlay_2.jnl        |    83 +
 jnls/contrib/create_KMZ_groundoverlay_3.jnl        |    83 +
 jnls/contrib/create_KMZ_groundoverlay_4.jnl        |    83 +
 jnls/contrib/create_KMZ_tour_1.jnl                 |    52 +
 jnls/contrib/create_KMZ_tour_2.jnl                 |    52 +
 jnls/contrib/create_KMZ_tour_3.jnl                 |    52 +
 jnls/contrib/create_KMZ_tour_4.jnl                 |    52 +
 jnls/contrib/def_monthaxis_days.jnl                |   141 +
 jnls/contrib/flip_palette.jnl                      |   175 +
 jnls/contrib/histogram.jnl                         |    51 +
 jnls/contrib/histogram.notes                       |    41 +
 jnls/contrib/histogram.plot                        |    38 +
 jnls/contrib/histogram_spillane                    |    64 +
 jnls/contrib/land_full.jnl                         |   241 +
 jnls/contrib/legend.jnl                            |    47 +
 jnls/contrib/legline.jnl                           |    22 +
 jnls/contrib/legline_nu.jnl                        |    19 +
 jnls/contrib/line_segments.jnl                     |    60 +
 jnls/contrib/mlbase_var.jnl                        |    79 +
 jnls/contrib/mld_dens.jnl                          |    72 +
 jnls/contrib/mld_temp.jnl                          |    71 +
 jnls/contrib/mp_lambert_az.jnl                     |    67 +
 jnls/contrib/mp_lambert_cc.jnl                     |    70 +
 jnls/contrib/multi_view.jnl                        |   251 +
 jnls/contrib/multi_view_demo.jnl                   |   358 +
 jnls/contrib/plot_vectors.jnl                      |   195 +
 jnls/contrib/portraitNxN.jnl                       |    63 +
 jnls/contrib/ratio_set.jnl                         |    61 +
 jnls/contrib/regressxy.jnl                         |    46 +
 jnls/contrib/small_view.jnl                        |   145 +
 jnls/contrib/surface_uv_from_ssh.jnl               |    50 +
 jnls/contrib/taylor_agraticule.jnl                 |    60 +
 jnls/contrib/taylor_example1.jnl                   |    46 +
 jnls/contrib/taylor_example2.jnl                   |    13 +
 jnls/contrib/taylor_example3.jnl                   |    17 +
 jnls/contrib/taylor_frame.jnl                      |   138 +
 jnls/contrib/taylor_frame_accurate.jnl             |    90 +
 jnls/contrib/taylor_label.jnl                      |    43 +
 jnls/contrib/taylor_plot.jnl                       |    43 +
 jnls/contrib/taylor_polymark.jnl                   |    51 +
 jnls/contrib/taylor_rgraticule.jnl                 |    69 +
 jnls/contrib/taylor_rmscircles.jnl                 |    86 +
 jnls/contrib/taylor_wtarea.jnl                     |   124 +
 jnls/contrib/test_legend.jnl                       |    50 +
 jnls/contrib/variance-ellipses-bold.jnl            |   221 +
 jnls/contrib/viewport_defn_tool                    |    43 +
 jnls/contrib/wind_barbs.jnl                        |    76 +
 jnls/examples/argo_zt.jnl                          |    70 +
 jnls/examples/bar_chart_demo.jnl                   |    30 +
 jnls/examples/binary_read_demo.jnl                 |   102 +
 jnls/examples/call_stack.jnl                       |    18 +
 jnls/examples/call_stack_stick.jnl                 |    18 +
 jnls/examples/ccbar_demo.jnl                       |    77 +
 jnls/examples/coads_demo.jnl                       |   146 +
 jnls/examples/compass_rose.jnl                     |    81 +
 jnls/examples/constant_array_demo.jnl              |    62 +
 jnls/examples/custom_contour_demo.jnl              |    72 +
 jnls/examples/depth_to_density_demo.jnl            |    43 +
 jnls/examples/depth_to_density_weq_demo.jnl        |    77 +
 jnls/examples/dods_demo.jnl                        |   160 +
 jnls/examples/draw_it.jnl                          |    15 +
 jnls/examples/edit_data_file_demo.jnl              |    53 +
 jnls/examples/ef_eof_demo.jnl                      |   187 +
 jnls/examples/ef_eofsvd_demo.jnl                   |   177 +
 jnls/examples/ef_fft_demo.jnl                      |   165 +
 jnls/examples/ef_sort_demo.jnl                     |    93 +
 jnls/examples/ef_wv5d_demo.jnl                     |    92 +
 jnls/examples/error_bars_demo.jnl                  |    65 +
 jnls/examples/file_reading_demo.jnl                |    63 +
 jnls/examples/fill_between.jnl                     |    89 +
 jnls/examples/fnoc_demo.jnl                        |   126 +
 jnls/examples/graticules_demo.jnl                  |    97 +
 jnls/examples/image_to_kml.jnl                     |   163 +
 jnls/examples/janfebmar_time_axis.jnl              |    61 +
 jnls/examples/land_detail_demo.jnl                 |    42 +
 jnls/examples/langrangian.sub                      |    16 +
 jnls/examples/langrangian_example.jnl              |    50 +
 jnls/examples/levitus_demo.jnl                     |   152 +
 jnls/examples/log_plot_demo.jnl                    |    32 +
 jnls/examples/mathematics_demo.jnl                 |    62 +
 jnls/examples/mercator_demo.jnl                    |    80 +
 jnls/examples/minmax_label_demo.jnl                |    31 +
 jnls/examples/mp_stereo_demo.jnl                   |    74 +
 jnls/examples/multi_line_labels_demo.jnl           |    78 +
 jnls/examples/multi_variable_demo.jnl              |   106 +
 jnls/examples/objective_analysis_demo.jnl          |   133 +
 jnls/examples/overlay_on_time_axis_demo.jnl        |    43 +
 jnls/examples/palette_demo.jnl                     |   108 +
 jnls/examples/pattern_demo.jnl                     |    37 +
 jnls/examples/plot_swath_demo.jnl                  |    40 +
 jnls/examples/polar_demo.jnl                       |    68 +
 jnls/examples/polar_south_demo.jnl                 |    58 +
 jnls/examples/poly_vec_demo.jnl                    |   241 +
 jnls/examples/poly_vector_demo.jnl                 |   241 +
 jnls/examples/polydata.cdf                         |   Bin 0 -> 1408 bytes
 jnls/examples/polymark_demo.jnl                    |    23 +
 jnls/examples/polytube_bent_demo.jnl               |    27 +
 jnls/examples/polytube_demo.jnl                    |    48 +
 jnls/examples/quantiles.jnl                        |    65 +
 jnls/examples/regridding_demo.jnl                  |   177 +
 jnls/examples/ribbon_plot_demo.jnl                 |   197 +
 jnls/examples/samplexy_demo.jnl                    |    57 +
 jnls/examples/shaded_error_bar_zone.jnl            |    60 +
 jnls/examples/show_all_patterns.jnl                |    79 +
 jnls/examples/show_pattern.jnl                     |    21 +
 jnls/examples/sigma_coordinate_demo.jnl            |   194 +
 jnls/examples/sigma_coordinate_demo_weq.jnl        |   228 +
 jnls/examples/single_color_palettes.jnl            |   120 +
 jnls/examples/snoopy.dat                           |    50 +
 jnls/examples/spirograph_demo.jnl                  |    43 +
 jnls/examples/splash_demo.jnl                      |    50 +
 jnls/examples/statistics_demo.jnl                  |    77 +
 jnls/examples/symbol_demo.jnl                      |    57 +
 jnls/examples/topo_palette_demo.jnl                |    19 +
 jnls/examples/topographic_relief_demo.jnl          |    91 +
 jnls/examples/trackplot_demo.jnl                   |    62 +
 jnls/examples/tutorial.jnl                         |   412 +
 jnls/examples/two_dee_plot_of_1d.jnl               |    31 +
 jnls/examples/vector_demo.jnl                      |   213 +
 jnls/examples/viewports_demo.jnl                   |    54 +
 jnls/examples/wire_frame_demo.jnl                  |    29 +
 jnls/go/bar_chart1.jnl                             |    61 +
 jnls/go/bar_chart2.jnl                             |   111 +
 jnls/go/bar_chart3.jnl                             |    69 +
 jnls/go/basemap.jnl                                |    54 +
 jnls/go/black.jnl                                  |     9 +
 jnls/go/bold.jnl                                   |    30 +
 jnls/go/box.jnl                                    |    40 +
 jnls/go/box_plot.jnl                               |    28 +
 jnls/go/bullseye.jnl                               |    89 +
 jnls/go/bullseye_box.jnl                           |    28 +
 jnls/go/ccbar.jnl                                  |   128 +
 jnls/go/centered_vectors.jnl                       |    77 +
 jnls/go/cleanup_text.jnl                           |    13 +
 jnls/go/climatological_axes.cdf                    |   Bin 0 -> 3232 bytes
 jnls/go/convert_to_fnoc_2d.jnl                     |    49 +
 jnls/go/convert_to_polar_2d.jnl                    |    60 +
 jnls/go/datestring.jnl                             |    71 +
 jnls/go/digitize.jnl                               |   127 +
 jnls/go/dynamic_height.jnl                         |    54 +
 jnls/go/ellipse.jnl                                |    42 +
 jnls/go/error_bars.jnl                             |   103 +
 jnls/go/exact_colors.jnl                           |    85 +
 jnls/go/extremum.jnl                               |    46 +
 jnls/go/fft2drun.jnl                               |    84 +
 jnls/go/find_bullseye.jnl                          |   101 +
 jnls/go/fland.jnl                                  |    65 +
 jnls/go/fnoc_2d.jnl                                |    44 +
 jnls/go/fnoc_map_grid.jnl                          |    19 +
 jnls/go/fnoc_verify.jnl                            |    10 +
 jnls/go/focean.jnl                                 |    54 +
 jnls/go/frequency.awk                              |    40 +
 jnls/go/frequency_histogram.jnl                    |   102 +
 jnls/go/frequency_histogram2.jnl                   |   103 +
 jnls/go/gmt_power.jnl                              |   121 +
 jnls/go/graticule.jnl                              |    14 +
 jnls/go/gratxt.jnl                                 |    23 +
 jnls/go/gratxy.jnl                                 |    26 +
 jnls/go/gratxz.jnl                                 |    23 +
 jnls/go/gratyt.jnl                                 |    23 +
 jnls/go/gratyz.jnl                                 |    23 +
 jnls/go/gratzt.jnl                                 |    25 +
 jnls/go/great_circle.jnl                           |    65 +
 jnls/go/gridlines.jnl                              |    41 +
 jnls/go/gridxt.jnl                                 |    17 +
 jnls/go/gridxy.jnl                                 |    17 +
 jnls/go/gridxz.jnl                                 |    17 +
 jnls/go/gridyt.jnl                                 |    17 +
 jnls/go/gridyz.jnl                                 |    17 +
 jnls/go/gridzt.jnl                                 |    17 +
 jnls/go/histogram_pdf.jnl                          |    78 +
 jnls/go/label_hi_lo.jnl                            |   139 +
 jnls/go/labelvalues.jnl                            |   143 +
 jnls/go/land.jnl                                   |   162 +
 jnls/go/land_detail.jnl                            |   233 +
 jnls/go/landscape.jnl                              |    12 +
 jnls/go/landscape1x2.jnl                           |    16 +
 jnls/go/landscape2x1.jnl                           |    19 +
 jnls/go/landscape2x2.jnl                           |    34 +
 jnls/go/landscape3x2.jnl                           |    38 +
 jnls/go/landt.jnl                                  |    10 +
 jnls/go/landu.jnl                                  |    10 +
 jnls/go/landz.jnl                                  |    87 +
 jnls/go/left_axis_plot.jnl                         |    64 +
 jnls/go/line_samples.jnl                           |    23 +
 jnls/go/line_thickness.jnl                         |    21 +
 jnls/go/magnify.jnl                                |    86 +
 jnls/go/make_monthly_climatology.jnl               |   112 +
 jnls/go/margins.jnl                                |    82 +
 jnls/go/mask_outline.jnl                           |   116 +
 jnls/go/max_area.jnl                               |    14 +
 jnls/go/mp_aspect.jnl                              |    41 +
 jnls/go/mp_bonne.jnl                               |    95 +
 jnls/go/mp_craster_parabolic.jnl                   |    71 +
 jnls/go/mp_demo.jnl                                |   162 +
 jnls/go/mp_eckert_greifendorff.jnl                 |    74 +
 jnls/go/mp_eckert_iii.jnl                          |    71 +
 jnls/go/mp_eckert_v.jnl                            |    71 +
 jnls/go/mp_fland.jnl                               |    71 +
 jnls/go/mp_graticule.jnl                           |   227 +
 jnls/go/mp_graticule_limit.jnl                     |   258 +
 jnls/go/mp_grid.jnl                                |    28 +
 jnls/go/mp_hammer.jnl                              |    74 +
 jnls/go/mp_label.jnl                               |    93 +
 jnls/go/mp_lambert_cyl.jnl                         |    71 +
 jnls/go/mp_land.jnl                                |   244 +
 jnls/go/mp_land_detail.jnl                         |   318 +
 jnls/go/mp_land_stripmap.jnl                       |   152 +
 jnls/go/mp_line.jnl                                |    74 +
 jnls/go/mp_mask_outline.jnl                        |    57 +
 jnls/go/mp_mcbryde_fpp.jnl                         |    72 +
 jnls/go/mp_mercator.jnl                            |    87 +
 jnls/go/mp_ocean_stripmap.jnl                      |    88 +
 jnls/go/mp_orthographic.jnl                        |    65 +
 jnls/go/mp_plate_caree.jnl                         |    71 +
 jnls/go/mp_poly_vectors.jnl                        |   243 +
 jnls/go/mp_polyconic.jnl                           |    99 +
 jnls/go/mp_polymark.jnl                            |   125 +
 jnls/go/mp_polytube.jnl                            |    76 +
 jnls/go/mp_polytube_bent.jnl                       |    76 +
 jnls/go/mp_rotate.jnl                              |    47 +
 jnls/go/mp_sinusoidal.jnl                          |    71 +
 jnls/go/mp_stereographic_eq.jnl                    |    75 +
 jnls/go/mp_stereographic_north.jnl                 |    74 +
 jnls/go/mp_stereographic_south.jnl                 |    74 +
 jnls/go/mp_trackplot.jnl                           |    79 +
 jnls/go/mp_vertical_perspective.jnl                |    68 +
 jnls/go/mp_viewport_aspect.jnl                     |   103 +
 jnls/go/mp_wagner_vii.jnl                          |    75 +
 jnls/go/mp_winkel_i.jnl                            |    72 +
 jnls/go/multi_xaxis_overlay.jnl                    |    71 +
 jnls/go/multi_xaxis_plot1.jnl                      |    78 +
 jnls/go/multi_yaxis_overlay.jnl                    |    76 +
 jnls/go/multi_yaxis_plot1.jnl                      |    80 +
 jnls/go/objective.jnl                              |    63 +
 jnls/go/one_climatology_month.jnl                  |    42 +
 jnls/go/overlay_bars.jnl                           |    36 +
 jnls/go/pdatekey_dms.jnl                           |    21 +
 jnls/go/plot_swath.jnl                             |    88 +
 jnls/go/polar.jnl                                  |     4 +
 jnls/go/polar_2d.jnl                               |    65 +
 jnls/go/polar_fland.jnl                            |    61 +
 jnls/go/polar_grid.jnl                             |    50 +
 jnls/go/polar_grid_fancy.jnl                       |   101 +
 jnls/go/polar_land.jnl                             |    65 +
 jnls/go/polar_map_inv_eqns.jnl                     |    28 +
 jnls/go/polar_vector.jnl                           |    76 +
 jnls/go/polar_vs.jnl                               |    61 +
 jnls/go/poly_arrow_key.jnl                         |    82 +
 jnls/go/poly_vectors.jnl                           |   146 +
 jnls/go/polymark.jnl                               |    77 +
 jnls/go/polymark_annotate_key.jnl                  |    79 +
 jnls/go/polymark_datekey.jnl                       |   210 +
 jnls/go/polyshape.jnl                              |   220 +
 jnls/go/polytube.jnl                               |    93 +
 jnls/go/polytube_bent.jnl                          |   149 +
 jnls/go/portrait.jnl                               |    10 +
 jnls/go/portrait1x2.jnl                            |    26 +
 jnls/go/portrait1x3.jnl                            |    32 +
 jnls/go/portrait1x4.jnl                            |    35 +
 jnls/go/projected_map_grid.jnl                     |    24 +
 jnls/go/ptest.jnl                                  |     5 +
 jnls/go/regresst.jnl                               |    39 +
 jnls/go/regressx.jnl                               |    38 +
 jnls/go/regressy.jnl                               |    38 +
 jnls/go/regressz.jnl                               |    38 +
 jnls/go/reminder.jnl                               |    32 +
 jnls/go/remove_logo.jnl                            |    22 +
 jnls/go/rgb_centered.jnl                           |     6 +
 jnls/go/rgb_fireworks.jnl                          |    34 +
 jnls/go/rgb_grayscale.jnl                          |     7 +
 jnls/go/rgb_greyscale.jnl                          |     8 +
 jnls/go/rgb_rainbow.jnl                            |     8 +
 jnls/go/rgb_try_em.jnl                             |     8 +
 jnls/go/right_axis_plot.jnl                        |    63 +
 jnls/go/scalemark.jnl                              |   101 +
 jnls/go/scattered_vectors.jnl                      |   165 +
 jnls/go/set_aspect.jnl                             |    45 +
 jnls/go/set_pixel_size.jnl                         |    40 +
 jnls/go/setup_text.jnl                             |    36 +
 jnls/go/show_88_syms.jnl                           |   116 +
 jnls/go/show_symbols.jnl                           |    29 +
 jnls/go/split_z.jnl                                |    92 +
 jnls/go/squares.jnl                                |     8 +
 jnls/go/squeeze_colors.jnl                         |    63 +
 jnls/go/stack_line.jnl                             |   122 +
 jnls/go/stack_stick.jnl                            |   143 +
 jnls/go/start_vis5d.jnl                            |    17 +
 jnls/go/stick_vectors.jnl                          |    70 +
 jnls/go/stick_vectors_key.jnl                      |    86 +
 jnls/go/test.jnl                                   |     3 +
 jnls/go/tgridlines.jnl                             |    70 +
 jnls/go/tics.jnl                                   |    11 +
 jnls/go/tlandr.jnl                                 |    19 +
 jnls/go/trackplot.jnl                              |   102 +
 jnls/go/try_centered_palette.jnl                   |    22 +
 jnls/go/try_palette.jnl                            |    28 +
 jnls/go/try_pattern.jnl                            |    33 +
 jnls/go/ts_frequency.jnl                           |    91 +
 jnls/go/unbold.jnl                                 |    23 +
 jnls/go/unf_tlandr.dat_dec                         |   Bin 0 -> 141600 bytes
 jnls/go/unf_tlandr.dat_sun                         |   Bin 0 -> 141600 bytes
 jnls/go/unit_square.jnl                            |     7 +
 jnls/go/unlabel.jnl                                |    18 +
 jnls/go/unmagnify.jnl                              |     9 +
 jnls/go/var_n.jnl                                  |    25 +
 jnls/go/variance.jnl                               |    47 +
 jnls/go/vertical_section.jnl                       |    64 +
 jnls/go/vfland.jnl                                 |    84 +
 jnls/go/vis5d_append.jnl                           |    37 +
 jnls/go/vis5d_start.jnl                            |    20 +
 jnls/go/vis5d_write.jnl                            |    34 +
 jnls/go/vland.jnl                                  |    80 +
 jnls/go/water_vector_stack.jnl                     |    50 +
 jnls/go/white.jnl                                  |     9 +
 jnls/go/wv5d.jnl                                   |    26 +
 jnls/go/wv5d_append.jnl                            |    60 +
 jnls/go/xgridlines.jnl                             |    64 +
 jnls/go/ygridlines.jnl                             |    62 +
 palettes/2patterns.pat                             |     2 +
 palettes/3patterns.pat                             |     3 +
 palettes/4patterns.pat                             |     4 +
 palettes/5patterns.pat                             |     5 +
 palettes/6patterns.pat                             |     6 +
 palettes/7patterns.pat                             |     7 +
 palettes/8patterns.pat                             |     8 +
 palettes/QC_by_level.spk                           |    21 +
 palettes/angled_grid.pat                           |     1 +
 palettes/ball_bearings.pat                         |     1 +
 palettes/black.spk                                 |     2 +
 palettes/blue.spk                                  |     2 +
 palettes/blue_brown.spk                            |    14 +
 palettes/blue_dark.spk                             |     3 +
 palettes/blue_darkorange.spk                       |    21 +
 palettes/blue_darkred.spk                          |    21 +
 palettes/blue_green.spk                            |    17 +
 palettes/blue_green_yellow.spk                     |    12 +
 palettes/blue_light.spk                            |     3 +
 palettes/blue_orange.spk                           |    14 +
 palettes/blue_red_centered.spk                     |    14 +
 palettes/blue_red_gray_centered.spk                |    14 +
 palettes/blue_red_nowhite_centered.spk             |    13 +
 palettes/blues_cmyk.spk                            |     8 +
 palettes/bluescale.spk                             |     2 +
 palettes/brick.pat                                 |     1 +
 palettes/bright_centered.spk                       |     9 +
 palettes/broad.spk                                 |    10 +
 palettes/brown.spk                                 |     2 +
 palettes/brown_blue.spk                            |    14 +
 palettes/brown_dark.spk                            |     2 +
 palettes/brown_green.spk                           |     9 +
 palettes/brown_light.spk                           |     2 +
 palettes/brown_orange_yellow.spk                   |     9 +
 palettes/categorical_12_step.spk                   |    14 +
 palettes/centered.spk                              |     9 +
 palettes/centered_diff.spk                         |     8 +
 palettes/centered_turq_red_purple.spk              |     5 +
 palettes/cyan.spk                                  |     2 +
 palettes/cyan_dark.spk                             |     2 +
 palettes/cyan_light.spk                            |     2 +
 palettes/dark_horizontal.pat                       |     1 +
 palettes/dark_land_sea.spk                         |     8 +
 palettes/dark_terrestrial.spk                      |    14 +
 palettes/dark_up_left_to_right.pat                 |     1 +
 palettes/dark_up_right_to_left.pat                 |     1 +
 palettes/dark_vertical.pat                         |     1 +
 palettes/darkorange_blue.spk                       |    20 +
 palettes/darkred_blue.spk                          |    20 +
 palettes/default.pat                               |     4 +
 palettes/default.spk                               |     6 +
 palettes/double_horizontal.pat                     |     1 +
 palettes/double_vertical.pat                       |     1 +
 palettes/dynamic_cmyk.spk                          |    11 +
 palettes/etop_values.spk                           |    22 +
 palettes/exciting_cmyk.spk                         |    10 +
 palettes/fish_scale.pat                            |     1 +
 palettes/gray.spk                                  |     2 +
 palettes/gray_dark.spk                             |     2 +
 palettes/gray_light.spk                            |     2 +
 palettes/grayscale.spk                             |     2 +
 palettes/green.spk                                 |     2 +
 palettes/green_blue.spk                            |    17 +
 palettes/green_brown.spk                           |     9 +
 palettes/green_dark.spk                            |     2 +
 palettes/green_deep.spk                            |     2 +
 palettes/green_light.spk                           |     2 +
 palettes/green_magenta.spk                         |    18 +
 palettes/greens_cmyk.spk                           |     8 +
 palettes/greenscale.spk                            |     2 +
 palettes/grey.spk                                  |     2 +
 palettes/grey_dark.spk                             |     2 +
 palettes/grey_light.spk                            |     2 +
 palettes/greyscale.spk                             |     2 +
 palettes/horizontal.pat                            |     1 +
 palettes/inverse_bluescale.spk                     |     2 +
 palettes/inverse_dark_rainbow.spk                  |     6 +
 palettes/inverse_grayscale.spk                     |     2 +
 palettes/inverse_greenscale.spk                    |     2 +
 palettes/inverse_greyscale.spk                     |     2 +
 palettes/inverse_redscale.spk                      |     2 +
 palettes/land_sea.spk                              |     8 +
 palettes/land_sea3.spk                             |    23 +
 palettes/land_sea_values.spk                       |    17 +
 palettes/large_grid.pat                            |     1 +
 palettes/light_bottom.spk                          |    16 +
 palettes/light_centered.spk                        |     5 +
 palettes/light_rainbow.spk                         |     8 +
 palettes/lightgray_bottom.spk                      |    15 +
 palettes/lite_horizontal.pat                       |     1 +
 palettes/lite_up_left_to_right.pat                 |     1 +
 palettes/lite_up_right_to_left.pat                 |     1 +
 palettes/lite_vertical.pat                         |     1 +
 palettes/low_blue.spk                              |     5 +
 palettes/low_green.spk                             |     5 +
 palettes/low_red.spk                               |     5 +
 palettes/magenta.spk                               |     2 +
 palettes/magenta_dark.spk                          |     3 +
 palettes/magenta_green.spk                         |    19 +
 palettes/magenta_light.spk                         |     2 +
 palettes/modulo.spk                                |    10 +
 palettes/more_by_levels.spk                        |    18 +
 palettes/narrow_light_centered.spk                 |     6 +
 palettes/navy.spk                                  |     2 +
 palettes/no_blue.spk                               |     5 +
 palettes/no_blue_centered.spk                      |     7 +
 palettes/no_blue_grey_centered.spk                 |    10 +
 palettes/no_blue_yellow_centered.spk               |    10 +
 palettes/no_green.spk                              |     5 +
 palettes/no_green_centered.spk                     |     7 +
 palettes/no_red.spk                                |     5 +
 palettes/no_red_centered.spk                       |     7 +
 palettes/no_white_greenpink_centered.spk           |     9 +
 palettes/no_white_light_centered.spk               |     5 +
 palettes/norm_cent_cmyk.spk                        |    16 +
 palettes/ocean_blue.spk                            |     4 +
 palettes/ocean_temp.spk                            |     9 +
 palettes/ocean_temp_bounds.spk                     |    11 +
 palettes/orange.spk                                |     2 +
 palettes/orange_blue.spk                           |    15 +
 palettes/orange_dark.spk                           |     2 +
 palettes/orange_light.spk                          |     2 +
 palettes/orange_purple.spk                         |     9 +
 palettes/orange_red.spk                            |    10 +
 palettes/osmc_bluescale.spk                        |     3 +
 palettes/osmc_land.spk                             |     4 +
 palettes/osmc_terrestrial.spk                      |    15 +
 palettes/paleo_psdi_value.spk                      |    56 +
 palettes/patterns4.pat                             |     4 +
 palettes/pink.spk                                  |     2 +
 palettes/pink_dark.spk                             |     2 +
 palettes/pink_light.spk                            |     2 +
 palettes/purple.spk                                |     2 +
 palettes/purple_dark.spk                           |     2 +
 palettes/purple_light.spk                          |     2 +
 palettes/purple_orange.spk                         |     8 +
 palettes/purple_red.spk                            |    12 +
 palettes/rain_cmyk.spk                             |    12 +
 palettes/rain_hole_cmyk.spk                        |    16 +
 palettes/rainbow.spk                               |     6 +
 palettes/rainbow2_cmyk.spk                         |    13 +
 palettes/rainbow_by_levels.spk                     |     9 +
 palettes/rainbow_cmyk.spk                          |    13 +
 palettes/rainbow_rgb.spk                           |     9 +
 palettes/red.spk                                   |     2 +
 palettes/red_blue_centered.spk                     |    14 +
 palettes/red_blue_gray_centered.spk                |    14 +
 palettes/red_blue_nowhite_centered.spk             |    14 +
 palettes/red_dark.spk                              |     3 +
 palettes/red_light.spk                             |     2 +
 palettes/red_orange.spk                            |    10 +
 palettes/red_purple.spk                            |    11 +
 palettes/reds_cmyk.spk                             |     8 +
 palettes/redscale.spk                              |     2 +
 palettes/rev_cent_cmyk.spk                         |    16 +
 palettes/rnb.spk                                   |     6 +
 palettes/rnb2.spk                                  |     7 +
 palettes/saz2.spk                                  |     9 +
 palettes/solid.pat                                 |     1 +
 palettes/sunny_cmyk.spk                            |     8 +
 palettes/tan.spk                                   |     2 +
 palettes/tan_dark.spk                              |     2 +
 palettes/tan_light.spk                             |     2 +
 palettes/ten_by_levels.spk                         |    14 +
 palettes/terrestrial.spk                           |    14 +
 palettes/thirty_by_levels.spk                      |    34 +
 palettes/tiny_grid.pat                             |     1 +
 palettes/tiny_open_squares.pat                     |     1 +
 palettes/tiny_squares.pat                          |     1 +
 palettes/tiny_triangles.pat                        |     1 +
 palettes/topo.spk                                  |    24 +
 palettes/topo_blue_brown.spk                       |    21 +
 palettes/topo_light.spk                            |    24 +
 palettes/topo_osmc_blue_brown.spk                  |    17 +
 palettes/vertical.pat                              |     1 +
 palettes/very_dark_terrestrial.spk                 |     6 +
 palettes/violet.spk                                |     2 +
 palettes/violet_dark.spk                           |     2 +
 palettes/violet_light.spk                          |     2 +
 palettes/warm_cmyk.spk                             |     8 +
 palettes/weave.pat                                 |     1 +
 palettes/white.spk                                 |     2 +
 palettes/white_centered.spk                        |     6 +
 palettes/yellow.spk                                |     2 +
 palettes/yellow_dark.spk                           |     2 +
 palettes/yellow_green_blue.spk                     |    11 +
 palettes/yellow_light.spk                          |     3 +
 palettes/yellow_orange_brown.spk                   |     9 +
 platform_specific.mk.i386-apple-darwin             |   171 +
 platform_specific.mk.i386-linux                    |   112 +
 platform_specific.mk.i386-linux-gnu                |   113 +
 platform_specific.mk.intel-mac                     |    95 +
 platform_specific.mk.x86_64-linux                  |   117 +
 platform_specific.mk.x86_64-linux-gnu              |   118 +
 ppl/Makefile                                       |    43 +
 ppl/complot/LIB_NAME                               |     2 +
 ppl/complot/Makefile                               |    49 +
 ppl/complot/SOURCE_FILES                           |    68 +
 ppl/complot/abmv.F                                 |   107 +
 ppl/complot/abmv_makedot.F                         |   111 +
 ppl/complot/abplt.F                                |   295 +
 ppl/complot/abplt_makedot.F                        |   122 +
 ppl/complot/alphas.F                               |   109 +
 ppl/complot/axis.F                                 |   222 +
 ppl/complot/axisl.F                                |   518 +
 ppl/complot/baud.F                                 |    70 +
 ppl/complot/bell.F                                 |    68 +
 ppl/complot/check.F                                |    81 +
 ppl/complot/chin.F                                 |    75 +
 ppl/complot/chout.F                                |   149 +
 ppl/complot/circle.F                               |   121 +
 ppl/complot/clear_vp.F                             |    93 +
 ppl/complot/color.F                                |   210 +
 ppl/complot/dashes.F                               |    71 +
 ppl/complot/dashsz.F                               |    74 +
 ppl/complot/englsh.F                               |    66 +
 ppl/complot/erase.F                                |   314 +
 ppl/complot/gksmv.F                                |   122 +
 ppl/complot/gksmv_makedot.F                        |   107 +
 ppl/complot/grid.F                                 |   266 +
 ppl/complot/hpabmv.F                               |   108 +
 ppl/complot/igrinpt.F                              |   496 +
 ppl/complot/line.F                                 |    79 +
 ppl/complot/line3.F                                |    79 +
 ppl/complot/makedot.F                              |   119 +
 ppl/complot/mark.F                                 |   176 +
 ppl/complot/marker.F                               |    53 +
 ppl/complot/markh.F                                |    66 +
 ppl/complot/metric.F                               |    66 +
 ppl/complot/mirror.F                               |    75 +
 ppl/complot/number.F                               |    94 +
 ppl/complot/obliq3.F                               |    91 +
 ppl/complot/opndev.F                               |   387 +
 ppl/complot/origin.F                               |    73 +
 ppl/complot/page.F                                 |   119 +
 ppl/complot/plot3.F                                |    91 +
 ppl/complot/plotype.F                              |   123 +
 ppl/complot/pltend.F                               |    88 +
 ppl/complot/pltlun.F                               |    59 +
 ppl/complot/pltnme.F                               |    72 +
 ppl/complot/points.F                               |    66 +
 ppl/complot/positon.F                              |   217 +
 ppl/complot/prime.F                                |    51 +
 ppl/complot/putchsun.F                             |    63 +
 ppl/complot/range.F                                |   131 +
 ppl/complot/range_dm.F                             |   123 +
 ppl/complot/rangel.F                               |   100 +
 ppl/complot/rotate.F                               |    88 +
 ppl/complot/scale3.F                               |    77 +
 ppl/complot/symbel.F                               |   602 +
 ppl/complot/symbol.F                               |   351 +
 ppl/complot/tabmv.F                                |   321 +
 ppl/complot/teklun.F                               |    59 +
 ppl/complot/teknme.F                               |    59 +
 ppl/complot/tekpaus.F                              |    83 +
 ppl/complot/tform.F                                |   125 +
 ppl/complot/tformi.F                               |   130 +
 ppl/complot/tktype.F                               |   117 +
 ppl/complot/vectors.F                              |    66 +
 ppl/complot/view3.F                                |   140 +
 ppl/complot/window.F                               |   117 +
 ppl/complot/xyzplt.F                               |   394 +
 ppl/complot/zabmv.F                                |   139 +
 ppl/complot/zbufft.F                               |   109 +
 ppl/complot/zoom.F                                 |   148 +
 ppl/include/ARFILL.INC                             |    26 +
 ppl/include/AXIS.INC                               |    96 +
 ppl/include/AXISL.INC                              |    38 +
 ppl/include/AXISL.INC.pre_4digit                   |    27 +
 ppl/include/AXLWID.INC                             |    22 +
 ppl/include/BIBO.COM                               |    24 +
 ppl/include/BIBO.DAT                               |    16 +
 ppl/include/CDFTN5.INC                             |    19 +
 ppl/include/CEFTN5.INC                             |    24 +
 ppl/include/CMDCOM.INC                             |    44 +
 ppl/include/CMRD.INC                               |    25 +
 ppl/include/CMRDL.INC                              |    30 +
 ppl/include/CMSTRT.INC                             |    20 +
 ppl/include/COMDATF.INC                            |    13 +
 ppl/include/COMEPL.INC                             |    20 +
 ppl/include/COMEPS.INC                             |    43 +
 ppl/include/COMEPV.INC                             |    23 +
 ppl/include/COMTHDR.INC                            |    12 +
 ppl/include/COMVAR.INC                             |    11 +
 ppl/include/CONLAB.INC                             |    21 +
 ppl/include/CONT.INC                               |    71 +
 ppl/include/CORECM.INC                             |    22 +
 ppl/include/CPFTN5.INC                             |    20 +
 ppl/include/DASHZZ.INC                             |    21 +
 ppl/include/DATA.INC                               |    31 +
 ppl/include/DSFCOM.DAT                             |    22 +
 ppl/include/DSFSVE.INC                             |    23 +
 ppl/include/EPICLUN.INC                            |    21 +
 ppl/include/F90_PLTCOM.DAT                         |    41 +
 ppl/include/FILNAM.INC                             |    21 +
 ppl/include/GKSCM1.INC                             |    43 +
 ppl/include/HAB.INC                                |    23 +
 ppl/include/HD.INC                                 |    60 +
 ppl/include/IK.LIS                                 |    62 +
 ppl/include/LABCOM.INC                             |    32 +
 ppl/include/LABELS.INC                             |    33 +
 ppl/include/LINES.INC                              |    47 +
 ppl/include/LUNITS.INC                             |    21 +
 ppl/include/MISS.INC                               |    28 +
 ppl/include/MPLOT.INC                              |    38 +
 ppl/include/MPLOTS.INC                             |    22 +
 ppl/include/MPLOTX.INC                             |    24 +
 ppl/include/PARAMPL5.DAT                           |    32 +
 ppl/include/PEN.INC                                |    29 +
 ppl/include/PLT.INC                                |    24 +
 ppl/include/PLTCOM.DAT                             |    38 +
 ppl/include/PLTDAT_UNIX.DAT                        |    30 +
 ppl/include/PLTDAT_VMS.DAT                         |    30 +
 ppl/include/PLTL.INC                               |    25 +
 ppl/include/PPL.INC                                |   101 +
 ppl/include/PPLDAT.INC                             |    28 +
 ppl/include/PRMCOM.INC                             |    20 +
 ppl/include/QGCOMMON.INC                           |    57 +
 ppl/include/SWITCH.INC                             |    33 +
 ppl/include/SYMKEY.INC                             |    12 +
 ppl/include/SYSTEM.INC                             |    27 +
 ppl/include/TAXIS.INC                              |    44 +
 ppl/include/TBLE.INC                               |    23 +
 ppl/include/TICS.INC                               |    28 +
 ppl/include/TICS2.INC                              |    24 +
 ppl/include/VECTOR.INC                             |    39 +
 ppl/include/VIEW.INC                               |    26 +
 ppl/include/XYLABP.INC                             |    34 +
 ppl/include/ZGRID.INC                              |    27 +
 ppl/include/ZGRIDD.INC                             |    24 +
 ppl/ourlib/LIB_NAME                                |     2 +
 ppl/ourlib/Makefile                                |    49 +
 ppl/ourlib/SOURCE_FILES                            |    21 +
 ppl/ourlib/bibo5.F                                 |   212 +
 ppl/ourlib/datype5.F                               |    75 +
 ppl/ourlib/deflt.F                                 |    57 +
 ppl/ourlib/dirrd.F                                 |   127 +
 ppl/ourlib/dsf.F                                   |   579 +
 ppl/ourlib/dtypi.F                                 |    66 +
 ppl/ourlib/init.F                                  |   175 +
 ppl/ourlib/krnd.F                                  |    50 +
 ppl/ourlib/lnblk.F                                 |    65 +
 ppl/ourlib/loadppl.F                               |   275 +
 ppl/ourlib/logger.F                                |    46 +
 ppl/ourlib/lpplot5.F                               |   163 +
 ppl/ourlib/lstb5.F                                 |   352 +
 ppl/ourlib/mttime.F                                |   135 +
 ppl/ourlib/ndig5.F                                 |    57 +
 ppl/ourlib/npbt5.F                                 |    66 +
 ppl/ourlib/squish.F                                |    92 +
 ppl/ourlib/uninit.F                                |   111 +
 ppl/ourlib/upper.F                                 |    81 +
 ppl/ourlib/wldfle.F                                |   131 +
 ppl/plot/LIB_NAME                                  |     2 +
 ppl/plot/Makefile                                  |    49 +
 ppl/plot/SOURCE_FILES                              |    57 +
 ppl/plot/arrow.F                                   |    84 +
 ppl/plot/box.F                                     |    97 +
 ppl/plot/box_centers.F                             |    80 +
 ppl/plot/check_2d_size.F                           |    84 +
 ppl/plot/clsppl.F                                  |   140 +
 ppl/plot/cross.F                                   |    88 +
 ppl/plot/datlst.F                                  |   115 +
 ppl/plot/daxis.F                                   |   229 +
 ppl/plot/daxis2.F                                  |   224 +
 ppl/plot/dellev.F                                  |    59 +
 ppl/plot/drawvec.F                                 |   142 +
 ppl/plot/dsflab.F                                  |   132 +
 ppl/plot/dsflim.F                                  |   102 +
 ppl/plot/ferret_plot_complete.F                    |    67 +
 ppl/plot/get_curvilinear_limits.F                  |    65 +
 ppl/plot/get_vp_from_ferret.F                      |    91 +
 ppl/plot/interrupt.F                               |    67 +
 ppl/plot/labdrw.F                                  |   236 +
 ppl/plot/lev.F                                     |   265 +
 ppl/plot/level.F                                   |    92 +
 ppl/plot/levprs.F                                  |   109 +
 ppl/plot/levset.F                                  |    88 +
 ppl/plot/levsrt.F                                  |    85 +
 ppl/plot/linear.F                                  |   427 +
 ppl/plot/linfit.F                                  |   323 +
 ppl/plot/mplot.F                                   |   225 +
 ppl/plot/mult.F                                    |   156 +
 ppl/plot/opnppl.F                                  |   351 +
 ppl/plot/plotnm.F                                  |    62 +
 ppl/plot/plotxy.F                                  |   344 +
 ppl/plot/plotxy_ribbon.F                           |   411 +
 ppl/plot/plotz.F                                   |   377 +
 ppl/plot/pltit.F                                   |   508 +
 ppl/plot/pplcmd.F                                  |    66 +
 ppl/plot/pplcmd_f.F                                |  1888 +
 ppl/plot/ppldata.F                                 |   237 +
 ppl/plot/pplldc.F                                  |   221 +
 ppl/plot/pplldx.F                                  |   431 +
 ppl/plot/ppllist.F                                 |   537 +
 ppl/plot/pplus.F                                   |   234 +
 ppl/plot/prmtiv.F                                  |   679 +
 ppl/plot/rdseq.F                                   |   288 +
 ppl/plot/readsq.F                                  |   359 +
 ppl/plot/redsf.F                                   |   357 +
 ppl/plot/rsmnmx.F                                  |   110 +
 ppl/plot/save.F                                    |   316 +
 ppl/plot/savezg.F                                  |    59 +
 ppl/plot/scale2.F                                  |   117 +
 ppl/plot/setax.F                                   |   304 +
 ppl/plot/setlab.F                                  |    98 +
 ppl/plot/size2.F                                   |   381 +
 ppl/plot/spwn.F                                    |    59 +
 ppl/plot/stmnmx.F                                  |   256 +
 ppl/plot/trans.F                                   |    61 +
 ppl/plot/vecfld.F                                  |   487 +
 ppl/plot/view.F                                    |   100 +
 ppl/plotlib/LIB_NAME                               |     2 +
 ppl/plotlib/Makefile                               |    49 +
 ppl/plotlib/SOURCE_FILES                           |    48 +
 ppl/plotlib/arc.F                                  |   147 +
 ppl/plotlib/cmprmt.F                               |    59 +
 ppl/plotlib/cmrdst.F                               |   113 +
 ppl/plotlib/comrd5.F                               |   167 +
 ppl/plotlib/conseg.F                               |   166 +
 ppl/plotlib/conseg_section.F                       |   119 +
 ppl/plotlib/contur.F                               |   908 +
 ppl/plotlib/datpt.F                                |   108 +
 ppl/plotlib/daywk1.F                               |    71 +
 ppl/plotlib/delay.F                                |    80 +
 ppl/plotlib/diff.F                                 |    78 +
 ppl/plotlib/double.F                               |   158 +
 ppl/plotlib/frmt.F                                 |   132 +
 ppl/plotlib/getlev.F                               |    75 +
 ppl/plotlib/habis.F                                |    88 +
 ppl/plotlib/hdcopy.F                               |    76 +
 ppl/plotlib/iday.F                                 |    56 +
 ppl/plotlib/inside.F                               |    87 +
 ppl/plotlib/itdiff.F                               |    57 +
 ppl/plotlib/jday.F                                 |    68 +
 ppl/plotlib/lenc.F                                 |    57 +
 ppl/plotlib/neftn5.F                               |    70 +
 ppl/plotlib/numcde.F                               |   269 +
 ppl/plotlib/numcde_off.F                           |   256 +
 ppl/plotlib/numdm1.F                               |   111 +
 ppl/plotlib/plotny.F                               |   129 +
 ppl/plotlib/plott7.F                               |   149 +
 ppl/plotlib/reset_labsiz.F                         |    91 +
 ppl/plotlib/scinot.F                               |   145 +
 ppl/plotlib/smooth.F                               |    81 +
 ppl/plotlib/smx1.F                                 |    96 +
 ppl/plotlib/smy1.F                                 |    98 +
 ppl/plotlib/surf.F                                 |   704 +
 ppl/plotlib/taxis.F                                |    74 +
 ppl/plotlib/taxis0.F                               |   370 +
 ppl/plotlib/taxis1.F                               |   372 +
 ppl/plotlib/taxis3.F                               |   462 +
 ppl/plotlib/tayis.F                                |    75 +
 ppl/plotlib/tayis0.F                               |   365 +
 ppl/plotlib/tayis1.F                               |   374 +
 ppl/plotlib/tayis3.F                               |   450 +
 ppl/plotlib/time1.F                                |   146 +
 ppl/plotlib/time2.F                                |    81 +
 ppl/plotlib/time3.F                                |    61 +
 ppl/plotlib/xaxis1.F                               |   211 +
 ppl/plotlib/xaxis2.F                               |   261 +
 ppl/plotlib/yaxis1.F                               |   295 +
 ppl/plotlib/yaxis2.F                               |   267 +
 ppl/plotlib/zgrid.F                                |   412 +
 ppl/pplepic/LIB_NAME                               |     2 +
 ppl/pplepic/Makefile                               |    49 +
 ppl/pplepic/SOURCE_FILES                           |    28 +
 ppl/pplepic/efile.F                                |   143 +
 ppl/pplepic/ekeycls.F                              |    53 +
 ppl/pplepic/ekeyopn.F                              |    65 +
 ppl/pplepic/ekeyrd.F                               |    79 +
 ppl/pplepic/epicrd.F                               |   112 +
 ppl/pplepic/epicsq.F                               |    74 +
 ppl/pplepic/epictimc.F                             |    59 +
 ppl/pplepic/epictlab.F                             |   229 +
 ppl/pplepic/epictlim.F                             |    91 +
 ppl/pplepic/epictrd.F                              |   132 +
 ppl/pplepic/epicv.F                                |   123 +
 ppl/pplepic/epicvar.F                              |   133 +
 ppl/pplepic/epicvc.F                               |   116 +
 ppl/pplepic/fixtim.F                               |   119 +
 ppl/pplepic/frsthd.F                               |    83 +
 ppl/pplepic/geo.F                                  |    69 +
 ppl/pplepic/geo1.F                                 |    59 +
 ppl/pplepic/geochar.F                              |    72 +
 ppl/pplepic/hdrt1.F                                |    74 +
 ppl/pplepic/lenstr.F                               |    62 +
 ppl/pplepic/nxthdr.F                               |    74 +
 ppl/pplepic/readhd.F                               |   109 +
 ppl/pplepic/readthd.F                              |   101 +
 ppl/pplepic/stripit.F                              |    76 +
 ppl/pplepic/upcase.F                               |    77 +
 ppl/pplepic/varck.F                                |   122 +
 ppl/pplepic/varkey.F                               |    67 +
 ppl/pplusr/LIB_NAME                                |     2 +
 ppl/pplusr/Makefile                                |    49 +
 ppl/pplusr/SOURCE_FILES                            |     2 +
 ppl/pplusr/pplusr.F                                |    59 +
 ppl/symlib/LIB_NAME                                |     2 +
 ppl/symlib/Makefile                                |    49 +
 ppl/symlib/SOURCE_FILES                            |    25 +
 ppl/symlib/atend.F                                 |   142 +
 ppl/symlib/atflsh.F                                |    73 +
 ppl/symlib/atstrt.F                                |   176 +
 ppl/symlib/charin.F                                |   108 +
 ppl/symlib/cmderr.F                                |   131 +
 ppl/symlib/cmljst.F                                |    76 +
 ppl/symlib/copy.F                                  |   107 +
 ppl/symlib/dbmsubs.F                               |   265 +
 ppl/symlib/delsym.F                                |    85 +
 ppl/symlib/echo.F                                  |   101 +
 ppl/symlib/getcmd.F                                |   352 +
 ppl/symlib/getlin.F                                |   107 +
 ppl/symlib/getsym.F                                |   168 +
 ppl/symlib/gtqual.F                                |   132 +
 ppl/symlib/lstsym.F                                |    91 +
 ppl/symlib/parse.F                                 |   103 +
 ppl/symlib/parsev.F                                |   324 +
 ppl/symlib/parsex.F                                |   195 +
 ppl/symlib/putsym.F                                |    90 +
 ppl/symlib/putval.F                                |    87 +
 ppl/symlib/setsym.F                                |   369 +
 ppl/symlib/stprmp.F                                |    94 +
 ppl/symlib/symcnv.F                                |   132 +
 ppl/symlib/symsub.F                                |   108 +
 ppl/tmap_inc/aline.cmn                             |    10 +
 ppl/tmap_inc/axis_inc.decl                         |    56 +
 ppl/tmap_inc/axisl_inc.decl                        |     4 +
 ppl/tmap_inc/axlwid_inc.decl                       |     6 +
 ppl/tmap_inc/bibo_dat.decl                         |    33 +
 ppl/tmap_inc/calendar.cmn                          |    36 +
 ppl/tmap_inc/calendar.decl                         |    66 +
 ppl/tmap_inc/cdftn5_inc.decl                       |     5 +
 ppl/tmap_inc/ceftn5_inc.decl                       |     4 +
 ppl/tmap_inc/century.cmn                           |    10 +
 ppl/tmap_inc/cmdcom_inc.decl                       |     6 +
 ppl/tmap_inc/cmndlen.inc                           |    13 +
 ppl/tmap_inc/cmrd_inc.decl                         |    10 +
 ppl/tmap_inc/cmrdl_inc.decl                        |     4 +
 ppl/tmap_inc/cmstrt_inc.decl                       |     4 +
 ppl/tmap_inc/comdatf_inc.decl                      |     4 +
 ppl/tmap_inc/comepl_inc.decl                       |     4 +
 ppl/tmap_inc/comeps_inc.decl                       |     4 +
 ppl/tmap_inc/comepv_inc.decl                       |     7 +
 ppl/tmap_inc/comthdr_inc.decl                      |     4 +
 ppl/tmap_inc/comvar_inc.decl                       |     5 +
 ppl/tmap_inc/conlab_inc.decl                       |     4 +
 ppl/tmap_inc/cont_inc.decl                         |    40 +
 ppl/tmap_inc/cpftn5_inc.decl                       |     4 +
 ppl/tmap_inc/dashzz_inc.decl                       |     7 +
 ppl/tmap_inc/data_inc.decl                         |    16 +
 ppl/tmap_inc/dsfcom_dat.decl                       |    16 +
 ppl/tmap_inc/dsfsve_inc.decl                       |     6 +
 ppl/tmap_inc/echo_dat.decl                         |     4 +
 ppl/tmap_inc/epiclun_inc.decl                      |     7 +
 ppl/tmap_inc/filnam_inc.decl                       |     4 +
 ppl/tmap_inc/gkscm1_inc.decl                       |     4 +
 ppl/tmap_inc/gkscm2.cmn                            |    35 +
 ppl/tmap_inc/gkspar.inc                            |   445 +
 ppl/tmap_inc/hab_inc.decl                          |     7 +
 ppl/tmap_inc/hd_inc.decl                           |    21 +
 ppl/tmap_inc/labcom_inc.decl                       |    12 +
 ppl/tmap_inc/labels_inc.decl                       |     4 +
 ppl/tmap_inc/lines_inc.decl                        |    21 +
 ppl/tmap_inc/lunits_inc.decl                       |     8 +
 ppl/tmap_inc/makedot.cmn                           |    11 +
 ppl/tmap_inc/miss_inc.decl                         |    13 +
 ppl/tmap_inc/mplot_inc.decl                        |    18 +
 ppl/tmap_inc/mplots_inc.decl                       |     4 +
 ppl/tmap_inc/mplotx_inc.decl                       |    10 +
 ppl/tmap_inc/parampl5_dat.decl                     |    13 +
 ppl/tmap_inc/pen_inc.decl                          |     9 +
 ppl/tmap_inc/plt_inc.decl                          |    12 +
 ppl/tmap_inc/pltcom_dat.decl                       |    80 +
 ppl/tmap_inc/pltdat_dat.decl                       |     4 +
 ppl/tmap_inc/pltl_inc.decl                         |     4 +
 ppl/tmap_inc/ppl_in_ferret.cmn                     |     5 +
 ppl/tmap_inc/ppl_inc.decl                          |     6 +
 ppl/tmap_inc/pplcmd_strings.cmn                    |    10 +
 ppl/tmap_inc/pplp_ver_date.cmn                     |     8 +
 ppl/tmap_inc/prmcom_inc.decl                       |     4 +
 ppl/tmap_inc/save_colors.cmn                       |    17 +
 ppl/tmap_inc/shade_vars.cmn                        |   138 +
 ppl/tmap_inc/switch_inc.decl                       |     4 +
 ppl/tmap_inc/symbol_dat.decl                       |     4 +
 ppl/tmap_inc/symkey_inc.decl                       |     4 +
 ppl/tmap_inc/system_inc.decl                       |     4 +
 ppl/tmap_inc/taxis_inc.decl                        |    18 +
 ppl/tmap_inc/tble_inc.decl                         |    18 +
 ppl/tmap_inc/tics2_inc.decl                        |     6 +
 ppl/tmap_inc/tics_inc.decl                         |    10 +
 ppl/tmap_inc/vector_inc.decl                       |    29 +
 ppl/tmap_inc/view_inc.decl                         |    11 +
 ppl/tmap_inc/ws_types.cmn                          |    26 +
 ppl/tmap_inc/xgrinpt.cmn                           |     8 +
 ppl/tmap_inc/xinterrupt.cmn                        |     5 +
 ppl/tmap_inc/xylabp_inc.decl                       |    12 +
 ppl/tmap_inc/zgrid_inc.decl                        |     7 +
 ppl/tmap_inc/zgridd_inc.decl                       |     8 +
 ppl/tmapadds/LIB_NAME                              |     1 +
 ppl/tmapadds/Makefile                              |    49 +
 ppl/tmapadds/SOURCE_FILES                          |    92 +
 ppl/tmapadds/aline.F                               |   132 +
 ppl/tmapadds/aline_sub.F                           |   177 +
 ppl/tmapadds/arfill.F                              |   217 +
 ppl/tmapadds/arfill_section.F                      |   200 +
 ppl/tmapadds/bad_xy_coord.F                        |    82 +
 ppl/tmapadds/bc2whoi.F                             |    83 +
 ppl/tmapadds/buffer_fillpoly.F                     |    35 +
 ppl/tmapadds/calendar_blkdat.F                     |   175 +
 ppl/tmapadds/cmdini.F                              |   188 +
 ppl/tmapadds/compute_histo_bins.F                  |    99 +
 ppl/tmapadds/compute_mnstd.F                       |   137 +
 ppl/tmapadds/daxis_box.F                           |   123 +
 ppl/tmapadds/drawpoly.F                            |   211 +
 ppl/tmapadds/fillpol.F                             |   399 +
 ppl/tmapadds/fillpoly.F                            |   389 +
 ppl/tmapadds/flowline.F                            |   118 +
 ppl/tmapadds/flowline_sub.F                        |   867 +
 ppl/tmapadds/flush_buffered_fillpoly.F             |   231 +
 ppl/tmapadds/get_ndx.F                             |   135 +
 ppl/tmapadds/get_pix.F                             |    61 +
 ppl/tmapadds/get_user_coords.F                     |   104 +
 ppl/tmapadds/get_world_coords.F                    |    80 +
 ppl/tmapadds/getlabfonts.F                         |   109 +
 ppl/tmapadds/gxstrm.c                              |   253 +
 ppl/tmapadds/hatch_fill_rep.F                      |    80 +
 ppl/tmapadds/its_gksm.c                            |    48 +
 ppl/tmapadds/key.F                                 |   725 +
 ppl/tmapadds/key_annotate.F                        |   156 +
 ppl/tmapadds/key_hi_inf_horz.F                     |   129 +
 ppl/tmapadds/key_hi_inf_vert.F                     |   125 +
 ppl/tmapadds/key_lo_inf_horz.F                     |   131 +
 ppl/tmapadds/key_lo_inf_vert.F                     |   130 +
 ppl/tmapadds/kurv.F                                |   718 +
 ppl/tmapadds/line_key.F                            |   184 +
 ppl/tmapadds/new_gks_window.F                      |    74 +
 ppl/tmapadds/open_gks_ws.F                         |   182 +
 ppl/tmapadds/open_metafile.F                       |    30 +
 ppl/tmapadds/pattern_set.F                         |   405 +
 ppl/tmapadds/pltdat_block_data.F                   |    34 +
 ppl/tmapadds/point_convert.F                       |    61 +
 ppl/tmapadds/pplcmd_c.c                            |    77 +
 ppl/tmapadds/pplld_pts.F                           |    82 +
 ppl/tmapadds/pplld_pts_envelope.c                  |    82 +
 ppl/tmapadds/pplldc_envelope.c                     |    91 +
 ppl/tmapadds/pplldv_envelope.c                     |    80 +
 ppl/tmapadds/pplldx_envelope.c                     |    91 +
 ppl/tmapadds/ppllocator.F                          |   111 +
 ppl/tmapadds/pplmem.h                              |   101 +
 ppl/tmapadds/pplp_ver_data.F                       |    50 +
 ppl/tmapadds/reallo_envelope.c                     |    77 +
 ppl/tmapadds/reallo_ppl_memory.c                   |    81 +
 ppl/tmapadds/restore_saved_line_colors.F           |    62 +
 ppl/tmapadds/ribbon_missing.F                      |   185 +
 ppl/tmapadds/save_line_color.F                     |    57 +
 ppl/tmapadds/save_rgb_blkdat.F                     |    53 +
 ppl/tmapadds/say_interrupted.F                     |    69 +
 ppl/tmapadds/set_default_colors.F                  |    66 +
 ppl/tmapadds/set_default_nlevels.F                 |    54 +
 ppl/tmapadds/set_fill_area_rep.F                   |    80 +
 ppl/tmapadds/set_fill_ndx.F                        |    81 +
 ppl/tmapadds/set_gks_metafile.F                    |   181 +
 ppl/tmapadds/set_levels_shade_fill.F               |   279 +
 ppl/tmapadds/set_num_linecolors.F                  |    81 +
 ppl/tmapadds/set_one_color.F                       |   123 +
 ppl/tmapadds/set_open_levels.F                     |   452 +
 ppl/tmapadds/set_override_opacity.F                |    50 +
 ppl/tmapadds/set_pat_size.F                        |    66 +
 ppl/tmapadds/set_regular_plot.F                    |    50 +
 ppl/tmapadds/set_window_size.F                     |    70 +
 ppl/tmapadds/setax_syms.F                          |    77 +
 ppl/tmapadds/setfont.F                             |   147 +
 ppl/tmapadds/setlab_syms.F                         |   166 +
 ppl/tmapadds/setup_color_table.F                   |   206 +
 ppl/tmapadds/setup_defaults.F                      |   213 +
 ppl/tmapadds/shade.F                               |   183 +
 ppl/tmapadds/shade_cell.F                          |    57 +
 ppl/tmapadds/shade_fill_it.F                       |   245 +
 ppl/tmapadds/shade_key.F                           |   143 +
 ppl/tmapadds/shade_key_cont.F                      |    62 +
 ppl/tmapadds/shade_set.F                           |   628 +
 ppl/tmapadds/shade_sub.F                           |   479 +
 ppl/tmapadds/strmar.F                              |   125 +
 ppl/tmapadds/upnsquish.F                           |    87 +
 ppl/tmapadds/use_linear_levels.F                   |    69 +
 ppl/tmapadds/vec_arrows.F                          |   127 +
 ppl/tmapadds/whoi2bc.F                             |    82 +
 ppl/tmapadds/ws_fill_rep.F                         |   163 +
 ppl/tmapadds/ws_line_bundles.F                     |   117 +
 ppl/tmapadds/ws_line_spectrum.F                    |   188 +
 ppl/tmapadds/ws_types_init.F                       |   102 +
 ppl/tmapadds/xgrinpt_blkdat.F                      |    54 +
 ppl/tmapadds/yabd.F                                |    56 +
 pviewmod/.project                                  |    17 +
 pviewmod/.pydevproject                             |    11 +
 pviewmod/README.txt                                |     2 +
 pviewmod/__init__.py                               |   244 +
 pviewmod/cmndhelperpq.py                           |   448 +
 pviewmod/pipedimagerpq.py                          |   891 +
 pviewmod/pipedviewerpq.py                          |  1707 +
 pviewmod/pyferretbindings.py                       |   975 +
 pviewmod/scaledialogpq.py                          |   220 +
 pyfermod/__init__.py                               |  1908 +
 pyfermod/copy_pystat_data.c                        |    73 +
 pyfermod/decref_pyobj.c                            |    44 +
 pyfermod/eofanal/.project                          |    17 +
 pyfermod/eofanal/.pydevproject                     |     9 +
 pyfermod/eofanal/__init__.py                       |    10 +
 pyfermod/eofanal/eofanalysis.py                    |   623 +
 pyfermod/eofanal/eofanalysistests.py               |   340 +
 pyfermod/eofanal/eofdatapiece.py                   |   179 +
 pyfermod/eofanal/eofdatasum.py                     |   179 +
 pyfermod/fershp/__init__.py                        |   341 +
 pyfermod/fershp/mapprj.py                          |  2712 +
 pyfermod/fershp/shapefile_readxy.py                |   126 +
 pyfermod/fershp/shapefile_readxyval.py             |   171 +
 pyfermod/fershp/shapefile_readxyz.py               |    87 +
 pyfermod/fershp/shapefile_readxyzval.py            |   129 +
 pyfermod/fershp/shapefile_writeval.py              |   148 +
 pyfermod/fershp/shapefile_writexyval.py            |   327 +
 pyfermod/fershp/shapefile_writexyzval.py           |   364 +
 pyfermod/filenamecompleter.py                      |   195 +
 pyfermod/graphbind/.project                        |    17 +
 pyfermod/graphbind/.pydevproject                   |    10 +
 pyfermod/graphbind/__init__.py                     |   111 +
 pyfermod/graphbind/abstractpyferretbindings.py     |   491 +
 pyfermod/libpyferret.c                             |  1838 +
 pyfermod/pyefcn_compute.c                          |   446 +
 pyfermod/pyefcn_custom_axes.c                      |   200 +
 pyfermod/pyefcn_get_error.c                        |    81 +
 pyfermod/pyefcn_init.c                             |   705 +
 pyfermod/pyefcn_result_limits.c                    |   160 +
 pyfermod/pyferret.h                                |   318 +
 pyfermod/regrid/.project                           |    17 +
 pyfermod/regrid/.pydevproject                      |    10 +
 pyfermod/regrid/README.txt                         |     2 +
 pyfermod/regrid/__init__.py                        |   151 +
 pyfermod/regrid/curv2rect.py                       |   216 +
 pyfermod/regrid/curv3srect.py                      |   246 +
 pyfermod/regrid/esmpcontrol.py                     |   103 +
 pyfermod/regrid/esmpcontroltests.py                |    48 +
 pyfermod/regrid/regrid2d.py                        |   774 +
 pyfermod/regrid/regrid2dexample.py                 |   954 +
 pyfermod/regrid/regrid2dexample2.py                |   308 +
 pyfermod/regrid/regrid2dtests.py                   |   452 +
 pyfermod/regrid/regrid3d.py                        |  1033 +
 pyfermod/regrid/regrid3dexample.py                 |   588 +
 pyfermod/regrid/regrid3dtests.py                   |   594 +
 pyfermod/regrid/regridtests.py                     |   113 +
 pyfermod/set_memory.c                              |    69 +
 pyfermod/stats/__init__.py                         |  1790 +
 pyfermod/stats/create_stats_funcs.sh               |    66 +
 pyfermod/stats/stats_beta_cdf.py                   |    28 +
 pyfermod/stats/stats_beta_isf.py                   |    28 +
 pyfermod/stats/stats_beta_pdf.py                   |    28 +
 pyfermod/stats/stats_beta_ppf.py                   |    28 +
 pyfermod/stats/stats_beta_rvs.py                   |    28 +
 pyfermod/stats/stats_beta_sf.py                    |    28 +
 pyfermod/stats/stats_binom_cdf.py                  |    28 +
 pyfermod/stats/stats_binom_isf.py                  |    28 +
 pyfermod/stats/stats_binom_pmf.py                  |    28 +
 pyfermod/stats/stats_binom_ppf.py                  |    28 +
 pyfermod/stats/stats_binom_rvs.py                  |    28 +
 pyfermod/stats/stats_binom_sf.py                   |    28 +
 pyfermod/stats/stats_cauchy_cdf.py                 |    28 +
 pyfermod/stats/stats_cauchy_isf.py                 |    28 +
 pyfermod/stats/stats_cauchy_pdf.py                 |    28 +
 pyfermod/stats/stats_cauchy_ppf.py                 |    28 +
 pyfermod/stats/stats_cauchy_rvs.py                 |    28 +
 pyfermod/stats/stats_cauchy_sf.py                  |    28 +
 pyfermod/stats/stats_cdf.py                        |    87 +
 pyfermod/stats/stats_chi2_cdf.py                   |    28 +
 pyfermod/stats/stats_chi2_isf.py                   |    28 +
 pyfermod/stats/stats_chi2_pdf.py                   |    28 +
 pyfermod/stats/stats_chi2_ppf.py                   |    28 +
 pyfermod/stats/stats_chi2_rvs.py                   |    28 +
 pyfermod/stats/stats_chi2_sf.py                    |    28 +
 pyfermod/stats/stats_chi_cdf.py                    |    28 +
 pyfermod/stats/stats_chi_isf.py                    |    28 +
 pyfermod/stats/stats_chi_pdf.py                    |    28 +
 pyfermod/stats/stats_chi_ppf.py                    |    28 +
 pyfermod/stats/stats_chi_rvs.py                    |    28 +
 pyfermod/stats/stats_chi_sf.py                     |    28 +
 pyfermod/stats/stats_chisquare.py                  |   154 +
 pyfermod/stats/stats_expon_cdf.py                  |    28 +
 pyfermod/stats/stats_expon_isf.py                  |    28 +
 pyfermod/stats/stats_expon_pdf.py                  |    28 +
 pyfermod/stats/stats_expon_ppf.py                  |    28 +
 pyfermod/stats/stats_expon_rvs.py                  |    28 +
 pyfermod/stats/stats_expon_sf.py                   |    28 +
 pyfermod/stats/stats_exponweib_cdf.py              |    28 +
 pyfermod/stats/stats_exponweib_isf.py              |    28 +
 pyfermod/stats/stats_exponweib_pdf.py              |    28 +
 pyfermod/stats/stats_exponweib_ppf.py              |    28 +
 pyfermod/stats/stats_exponweib_rvs.py              |    28 +
 pyfermod/stats/stats_exponweib_sf.py               |    28 +
 pyfermod/stats/stats_f_cdf.py                      |    28 +
 pyfermod/stats/stats_f_isf.py                      |    28 +
 pyfermod/stats/stats_f_pdf.py                      |    28 +
 pyfermod/stats/stats_f_ppf.py                      |    28 +
 pyfermod/stats/stats_f_rvs.py                      |    28 +
 pyfermod/stats/stats_f_sf.py                       |    28 +
 pyfermod/stats/stats_fit.py                        |   105 +
 pyfermod/stats/stats_gamma_cdf.py                  |    28 +
 pyfermod/stats/stats_gamma_isf.py                  |    28 +
 pyfermod/stats/stats_gamma_pdf.py                  |    28 +
 pyfermod/stats/stats_gamma_ppf.py                  |    28 +
 pyfermod/stats/stats_gamma_rvs.py                  |    28 +
 pyfermod/stats/stats_gamma_sf.py                   |    28 +
 pyfermod/stats/stats_geom_cdf.py                   |    28 +
 pyfermod/stats/stats_geom_isf.py                   |    28 +
 pyfermod/stats/stats_geom_pmf.py                   |    28 +
 pyfermod/stats/stats_geom_ppf.py                   |    28 +
 pyfermod/stats/stats_geom_rvs.py                   |    28 +
 pyfermod/stats/stats_geom_sf.py                    |    28 +
 pyfermod/stats/stats_helper.py                     |   143 +
 pyfermod/stats/stats_histogram.py                  |   115 +
 pyfermod/stats/stats_hypergeom_cdf.py              |    28 +
 pyfermod/stats/stats_hypergeom_isf.py              |    28 +
 pyfermod/stats/stats_hypergeom_pmf.py              |    28 +
 pyfermod/stats/stats_hypergeom_ppf.py              |    28 +
 pyfermod/stats/stats_hypergeom_rvs.py              |    28 +
 pyfermod/stats/stats_hypergeom_sf.py               |    28 +
 pyfermod/stats/stats_invgamma_cdf.py               |    28 +
 pyfermod/stats/stats_invgamma_isf.py               |    28 +
 pyfermod/stats/stats_invgamma_pdf.py               |    28 +
 pyfermod/stats/stats_invgamma_ppf.py               |    28 +
 pyfermod/stats/stats_invgamma_rvs.py               |    28 +
 pyfermod/stats/stats_invgamma_sf.py                |    28 +
 pyfermod/stats/stats_isf.py                        |    86 +
 pyfermod/stats/stats_kstest1.py                    |   135 +
 pyfermod/stats/stats_kstest2.py                    |   125 +
 pyfermod/stats/stats_laplace_cdf.py                |    28 +
 pyfermod/stats/stats_laplace_isf.py                |    28 +
 pyfermod/stats/stats_laplace_pdf.py                |    28 +
 pyfermod/stats/stats_laplace_ppf.py                |    28 +
 pyfermod/stats/stats_laplace_rvs.py                |    28 +
 pyfermod/stats/stats_laplace_sf.py                 |    28 +
 pyfermod/stats/stats_linregress.py                 |   153 +
 pyfermod/stats/stats_lognorm_cdf.py                |    28 +
 pyfermod/stats/stats_lognorm_isf.py                |    28 +
 pyfermod/stats/stats_lognorm_pdf.py                |    28 +
 pyfermod/stats/stats_lognorm_ppf.py                |    28 +
 pyfermod/stats/stats_lognorm_rvs.py                |    28 +
 pyfermod/stats/stats_lognorm_sf.py                 |    28 +
 pyfermod/stats/stats_nbinom_cdf.py                 |    28 +
 pyfermod/stats/stats_nbinom_isf.py                 |    28 +
 pyfermod/stats/stats_nbinom_pmf.py                 |    28 +
 pyfermod/stats/stats_nbinom_ppf.py                 |    28 +
 pyfermod/stats/stats_nbinom_rvs.py                 |    28 +
 pyfermod/stats/stats_nbinom_sf.py                  |    28 +
 pyfermod/stats/stats_norm_cdf.py                   |    28 +
 pyfermod/stats/stats_norm_isf.py                   |    28 +
 pyfermod/stats/stats_norm_pdf.py                   |    79 +
 pyfermod/stats/stats_norm_ppf.py                   |    28 +
 pyfermod/stats/stats_norm_rvs.py                   |    28 +
 pyfermod/stats/stats_norm_sf.py                    |    28 +
 pyfermod/stats/stats_pareto_cdf.py                 |    28 +
 pyfermod/stats/stats_pareto_isf.py                 |    28 +
 pyfermod/stats/stats_pareto_pdf.py                 |    28 +
 pyfermod/stats/stats_pareto_ppf.py                 |    28 +
 pyfermod/stats/stats_pareto_rvs.py                 |    28 +
 pyfermod/stats/stats_pareto_sf.py                  |    28 +
 pyfermod/stats/stats_pdf.py                        |    87 +
 pyfermod/stats/stats_pearsonr.py                   |   145 +
 pyfermod/stats/stats_percentilesofscores.py        |   102 +
 pyfermod/stats/stats_pmf.py                        |    86 +
 pyfermod/stats/stats_poisson_cdf.py                |    28 +
 pyfermod/stats/stats_poisson_isf.py                |    28 +
 pyfermod/stats/stats_poisson_pmf.py                |    28 +
 pyfermod/stats/stats_poisson_ppf.py                |    28 +
 pyfermod/stats/stats_poisson_rvs.py                |    28 +
 pyfermod/stats/stats_poisson_sf.py                 |    28 +
 pyfermod/stats/stats_ppf.py                        |    86 +
 pyfermod/stats/stats_probplotvals.py               |   162 +
 pyfermod/stats/stats_randint_cdf.py                |    28 +
 pyfermod/stats/stats_randint_isf.py                |    28 +
 pyfermod/stats/stats_randint_pmf.py                |    28 +
 pyfermod/stats/stats_randint_ppf.py                |    28 +
 pyfermod/stats/stats_randint_rvs.py                |    28 +
 pyfermod/stats/stats_randint_sf.py                 |    28 +
 pyfermod/stats/stats_rvs.py                        |   100 +
 pyfermod/stats/stats_scoresatpercentiles.py        |   101 +
 pyfermod/stats/stats_sf.py                         |    86 +
 pyfermod/stats/stats_spearmanr.py                  |   143 +
 pyfermod/stats/stats_stats.py                      |   106 +
 pyfermod/stats/stats_t_cdf.py                      |    28 +
 pyfermod/stats/stats_t_isf.py                      |    28 +
 pyfermod/stats/stats_t_pdf.py                      |    28 +
 pyfermod/stats/stats_t_ppf.py                      |    28 +
 pyfermod/stats/stats_t_rvs.py                      |    28 +
 pyfermod/stats/stats_t_sf.py                       |    28 +
 pyfermod/stats/stats_template                      |    28 +
 pyfermod/stats/stats_ttest1.py                     |   140 +
 pyfermod/stats/stats_ttest2ind.py                  |   129 +
 pyfermod/stats/stats_ttest2rel.py                  |   138 +
 pyfermod/stats/stats_uniform_cdf.py                |    28 +
 pyfermod/stats/stats_uniform_isf.py                |    28 +
 pyfermod/stats/stats_uniform_pdf.py                |    28 +
 pyfermod/stats/stats_uniform_ppf.py                |    28 +
 pyfermod/stats/stats_uniform_rvs.py                |    28 +
 pyfermod/stats/stats_uniform_sf.py                 |    28 +
 pyfermod/stats/stats_weibull_cdf.py                |    28 +
 pyfermod/stats/stats_weibull_isf.py                |    28 +
 pyfermod/stats/stats_weibull_pdf.py                |    28 +
 pyfermod/stats/stats_weibull_ppf.py                |    28 +
 pyfermod/stats/stats_weibull_rvs.py                |    28 +
 pyfermod/stats/stats_weibull_sf.py                 |    28 +
 pyfermod/stats/stats_zscore.py                     |    91 +
 setup.py                                           |   184 +
 site_specific.mk                                   |    74 +
 threddsBrowser/.classpath                          |     9 +
 threddsBrowser/.project                            |    17 +
 .../.settings/org.eclipse.jdt.core.prefs           |    12 +
 threddsBrowser/.settings/scoped_pref_store.prefs   |     3 +
 threddsBrowser/Makefile                            |    31 +
 threddsBrowser/README                              |    23 +
 .../ferret/threddsBrowser/BrowserDefaults.java     |   302 +
 .../ferret/threddsBrowser/ExtensionFileFilter.java |    91 +
 .../pmel/ferret/threddsBrowser/HTMLViewer.java     |   116 +
 .../threddsBrowser/LocalDirInvDatasetImpl.java     |    68 +
 .../threddsBrowser/LocalDirTreeScanMonitor.java    |   253 +
 .../ferret/threddsBrowser/LocalDirTreeScanner.java |   294 +
 .../ferret/threddsBrowser/LocationSelector.java    |   184 +
 .../threddsBrowser/LocationSelectorDialog.java     |   404 +
 .../pmel/ferret/threddsBrowser/ThreddsBrowser.java |   606 +
 .../threddsBrowser/ThreddsBrowserListener.java     |   234 +
 threddsBrowser/toolsUI/toolsUI-4.1.jar             |   Bin 0 -> 19687841 bytes
 .../threddsBrowserTests/TestBrowserDefaults.java   |   263 +
 .../TestExtensionFileFilter.java                   |   143 +
 .../TestLocalDirTreeScanMonitor.java               |   197 +
 .../TestLocalDirTreeScanner.java                   |   239 +
 .../threddsBrowserTests/TestThreddsBrowser.java    |    65 +
 4342 files changed, 1150758 insertions(+)

diff --git a/IFDEF_DESCRIPTION b/IFDEF_DESCRIPTION
new file mode 100644
index 0000000..e2d288e
--- /dev/null
+++ b/IFDEF_DESCRIPTION
@@ -0,0 +1,97 @@
+
+IFDEFS found in Fortran code
+----------------------------
+
+aix - specific to aix in pplus routine cmdini.F to not execute a line of
+      code which didn't work on aix systems
+AIX_XLF - things specific to usin AIX XLF fortran compiler
+atc_gks - specific to commercial atc release of the xgks library
+call_handler_each_time - gets defined automatically on solaris and aix 
+		         systems - maybe not needed in this list then?
+core - pplus only - not sure what it's for - doesn't seem to get used
+crptd_cat_argument - sgi only (??) problem w/ appending using "//" in 
+		     symbol_command.F
+debug_dyn_grids - used only for debugging dynamic grid code
+DEC_FORTRAN - items specific to DEC Fortran
+F90_DATE_TIME - use the F90 routine date_and_time rather than the 
+		f77 routine date.  currently only used for linux
+F90_NO_FPUTC - F90 didn't have a "fputc" routine, so had to use a
+	       write statement
+F90_OPEN_FILE_APPEND - For F90, open files w/ POSITION=APPEND rather
+		       than ACCESS=APPEND  
+F90_SYSTEM_ERROR_CALLS - Use F90 specific error calls
+FORTRAN_90 - General F90 switch
+hp - General switch when compiling on HP's
+HP_ADDS - Additional needs for HP compilers
+inquire_not_nfs_compatible - probably obselete option which was needed when
+			     using DEC f772.1 and multinet
+MANDATORY_FORMAT_WIDTHS - AIX only - needs explicit format widths
+NEED_BYTE - for compilers which user BYTE rather than INTEGER*1
+NEED_IAND - for compilers which user intrinsic function IAND 
+	    rather than AND 
+need_underscore - aix specific - intrinsic function SIGNAL_ needed
+		  underscore appended to it. 
+NINT_WRITE_UNMATCH - probably obselete switch which was used to isolate
+		     an older portion of code which was originally written
+		     to fix a VAX bug
+NO_ACCESS_APPEND - For compilers whose OPEN statement doesn't 
+		   allow ACCESS=APPEND
+NO_DOUBLE_ESCAPE_SLASH - for compilers which don't require two
+		         backslashes "\\" when escaping the "!" char
+NO_OPEN_CARRIAGECONTROL - For compilers whose OPEN statement doesn't 
+			  allow CARRIAGECONTROL option
+NO_OPEN_READONLY - For compilers whose OPEN statement doesn't 
+		   allow READONLY option
+NO_OPEN_RECORDTYPE - For compilers whose OPEN statement doesn't 
+		     allow RECORDTYPE option
+NO_OPEN_SHARED - For compilers whose OPEN statement doesn't 
+		 allow SHARED option
+NO_PASSED_CONCAT - used when the compiler has a problem passing 
+		   concatenated strings to subroutines as arguments
+NO_PREPEND_STRING - used for compilers which have a problem prepending
+		    strings used in variable assignments
+NO_SNGL  - necessary for compilers which do not have the intrinsic 
+	   function SNGL
+READONLY_ALLOWED - For compiles which allow READONLY in their OPEN
+		   statement
+reclen_in_bytes - For compilers which use bytes as the default record 
+		  length calculator, especially in open statments
+sgi  - IRIX specific switch
+solaris - Solaris specific switch
+STAR_1_SUPPORTED - USed if Integer*1 is supported - used only in pplus 
+		   code - same idea as NEED_BYTE
+STDERR_UNIT_SEVEN - FOR HP, the stderr unit was 7, instead of 0
+sun - sunOS (solaris 1.x) specific switches
+ultrix - Ultrix (no longer supported) specific switches
+unix - general Unix switch
+xgks - Switch to use Xgks
+X_REFRESH - For systems which do not have backing store, this Should be 
+	    set/used to force screen refreshes of plots
+
+
+IFDEFS found in C code
+-----------------------
+BELL - switch to turn on the bell to notify user when X snapshot is
+       being taken
+CHODEBUG - XGKS debugging switch
+DESIGN_TIME -  GUI specific switch - not needed
+ESCAPEDEBUG - Another XGKS debugging switch
+FULL_GUI_VERSION - Full functionality of GUI - should probably be
+		   on by default
+HP_SIGNALS - HP specific signal handling
+LINK_GUI_AS_MAIN - Link in the gui to Ferret.  W/out this the gui will
+		   will not be a part of ferret
+MIXING_NAG_F90_AND_C - Needed when using NAG F90 to call some fortran
+		       i/o setup routines - necessary w/ c main
+		       program
+NO_ENTRY_NAME_UNDERSCORES - Whether or not to append an underscore "_"
+			    to the name of a subroutine
+PSDEBUG - Switch for debugging postscript output
+QUERY_DEBUG - Another debugging switch, used in the ferret_query.c routine
+SEGMENTDEBUG - Another Xgks debugging switch
+SGI_POPUPS - SGI switch in order for menu's to function correctly in GUI
+XT_CODE - SWitch to have GUI use Xt library - probably should be default
+X_REFRESH - Switch to have set mode refresh on by default - needed on 
+	    systems that don't have backing store (ie, SGI)
+_NO_PROTO - Switch to allow function prototyping
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5ad5886
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,123 @@
+#
+# Makefile for building and installing the pyferret module
+# and the modules and libraries associated with it.
+#
+
+# Site-specific defines
+include site_specific.mk
+
+# Platform-specific defines
+include platform_specific.mk.$(BUILDTYPE)
+
+.PHONY : all
+all : optimized
+
+.PHONY : optimized
+optimized :
+	mkdir -p $(DIR_PREFIX)/lib
+	$(MAKE) -C $(DIR_PREFIX)/fer optimized
+	$(MAKE) -C $(DIR_PREFIX)/threddsBrowser
+	$(MAKE) "CFLAGS = $(CFLAGS) -O" pymod_optimized
+	$(MAKE) "FFLAGS = $(FFLAGS) -O" -C $(DIR_PREFIX)/efmem
+	$(MAKE) "INSTALL_FER_DIR = $(DIR_PREFIX)/pyferret_install" -C $(DIR_PREFIX)/external_functions optimized
+	$(MAKE) -C $(DIR_PREFIX)/bin/build_fonts/unix
+
+.PHONY : debug
+debug :
+	mkdir -p $(DIR_PREFIX)/lib
+	$(MAKE) -C $(DIR_PREFIX)/fer debug
+	$(MAKE) -C $(DIR_PREFIX)/threddsBrowser
+	$(MAKE) "CFLAGS = $(CFLAGS) -O0 -g" pymod_debug
+	$(MAKE) "FFLAGS = $(FFLAGS) -O0 -g" -C $(DIR_PREFIX)/efmem
+	$(MAKE) "INSTALL_FER_DIR = $(DIR_PREFIX)/pyferret_install" -C $(DIR_PREFIX)/external_functions debug
+	$(MAKE) -C $(DIR_PREFIX)/bin/build_fonts/unix
+
+## The following builds libpyferret.so, then installs that shared-object
+## library and all the python scripts into $(DIR_PREFIX)/pyferret_install.
+## This install directory can then be used for the <pyferret_install_dir>
+## argument to make_executables_tar.
+.PHONY : pymod_optimized
+pymod_optimized :
+	rm -fr $(DIR_PREFIX)/build $(DIR_PREFIX)/pyferret_install
+	( cd $(DIR_PREFIX) ; \
+	  export CAIRO_LIBDIR=$(CAIRO_LIBDIR) ; \
+	  export HDF5_LIBDIR=$(HDF5_LIBDIR) ; \
+	  export NETCDF4_LIBDIR=$(NETCDF4_LIBDIR) ; \
+	  export PYFERRET_VERSION=$(PYFERRET_VERSION) ; \
+	  $(PYTHON_EXE) setup.py build )
+	( cd $(DIR_PREFIX) ; \
+	  export CAIRO_LIBDIR=$(CAIRO_LIBDIR) ; \
+	  export HDF5_LIBDIR=$(HDF5_LIBDIR) ; \
+	  export NETCDF4_LIBDIR=$(NETCDF4_LIBDIR) ; \
+	  export PYFERRET_VERSION=$(PYFERRET_VERSION) ; \
+	  $(PYTHON_EXE) setup.py install -O2 --prefix=$(DIR_PREFIX)/pyferret_install )
+
+.PHONY : pymod_debug
+pymod_debug :
+	rm -fr $(DIR_PREFIX)/build $(DIR_PREFIX)/pyferret_install
+	( cd $(DIR_PREFIX) ; \
+	  export CAIRO_LIBDIR=$(CAIRO_LIBDIR) ; \
+	  export HDF5_LIBDIR=$(HDF5_LIBDIR) ; \
+	  export NETCDF4_LIBDIR=$(NETCDF4_LIBDIR) ; \
+	  export PYFERRET_VERSION=$(PYFERRET_VERSION) ; \
+	  $(PYTHON_EXE) setup.py build -g )
+	( cd $(DIR_PREFIX) ; \
+	  export CAIRO_LIBDIR=$(CAIRO_LIBDIR) ; \
+	  export HDF5_LIBDIR=$(HDF5_LIBDIR) ; \
+	  export NETCDF4_LIBDIR=$(NETCDF4_LIBDIR) ; \
+	  export PYFERRET_VERSION=$(PYFERRET_VERSION) ; \
+	  $(PYTHON_EXE) setup.py install -O0 --prefix=$(DIR_PREFIX)/pyferret_install )
+
+## Remove everything that was built
+.PHONY : clean
+clean :
+	$(MAKE) -C $(DIR_PREFIX)/bin/build_fonts/unix clean
+	$(MAKE) -C $(DIR_PREFIX)/external_functions clean
+	$(MAKE) -C $(DIR_PREFIX)/efmem clean
+	rm -fr $(DIR_PREFIX)/pyferret_install $(DIR_PREFIX)/build ferret.jnl*
+	find $(DIR_PREFIX)/pviewmod -name '*.py[co]' -exec rm -f {} ';'
+	find $(DIR_PREFIX)/pyfermod -name '*.py[co]' -exec rm -f {} ';'
+	$(MAKE) -C $(DIR_PREFIX)/threddsBrowser clean
+	$(MAKE) -C $(DIR_PREFIX)/fer clean
+	rm -fr $(DIR_PREFIX)/lib
+
+## Install Ferret binaries, scripts, and other files into $(INSTALL_FER_DIR)
+.PHONY : install
+install : install_env install_exes
+
+## Create the fer_environment.tar.gz files and then extract it into $(INSTALL_FER_DIR)
+.PHONY :  install_env
+install_env :
+	rm -f fer_environment.tar.gz
+	bin/make_environment_tar . . -y
+	mkdir -p $(INSTALL_FER_DIR)
+	mv -f fer_environment.tar.gz $(INSTALL_FER_DIR)
+	( cd $(INSTALL_FER_DIR) ; tar xvzf fer_environment.tar.gz )
+
+## Create the fer_executables.tar.gz files and then extract it into $(INSTALL_FER_DIR)
+.PHONY : install_exes
+install_exes :
+	rm -f fer_executables.tar.gz
+	bin/make_executable_tar . . -y
+	mkdir -p $(INSTALL_FER_DIR)
+	mv -f fer_executables.tar.gz $(INSTALL_FER_DIR)
+	( cd $(INSTALL_FER_DIR) ; tar xvzf fer_executables.tar.gz )
+	cp -f threddsBrowser/toolsUI/toolsUI-4.1.jar $(INSTALL_FER_DIR)/lib/
+
+## The following is for installing the updated threddsBrowser.jar, libpyferret.so,
+## and python scripts into $(INSTALL_FER_DIR)/lib without having to go
+## through the make_executables_tar script.
+.PHONY : update
+update :
+	mkdir -p $(INSTALL_FER_DIR)/lib
+	cp -f $(DIR_PREFIX)/efmem/ferret_ef_mem_subsc.so $(INSTALL_FER_DIR)/lib
+	cp -f $(DIR_PREFIX)/threddsBrowser/threddsBrowser.jar $(INSTALL_FER_DIR)/lib
+	( cd $(DIR_PREFIX) ; \
+	  export CAIRO_LIBDIR=$(CAIRO_LIBDIR) ; \
+	  export HDF5_LIBDIR=$(HDF5_LIBDIR) ; \
+	  export NETCDF4_LIBDIR=$(NETCDF4_LIBDIR) ; \
+	  export PYFERRET_VERSION=$(PYFERRET_VERSION) ; \
+	  $(PYTHON_EXE) setup.py install -O2 --prefix=$(INSTALL_FER_DIR) )
+#	$(MAKE) "FER_LOCAL_EXTFCNS = $(INSTALL_FER_DIR)/ext_func/libs" -C $(DIR_PREFIX)/external_functions install
+
+##
diff --git a/README_build_ferret b/README_build_ferret
new file mode 100644
index 0000000..424643b
--- /dev/null
+++ b/README_build_ferret
@@ -0,0 +1,66 @@
+As of August 2011 we now have a single make procedure for compiling, linking, and 
+installing Ferret. 
+
+
+NetCDF4.1 or higher is required for building Ferret. The library NetCDF4.2 or higher
+is recommended. We recommend building NetCDF and HDF libraries yourself, so that these
+libraries and Ferret are all built with the same compiler. This takes a little time, but
+is not difficult. For building the libraries and Ferret, we have used gfortran. The 
+NetCDF downloads can be found here: http://www.unidata.ucar.edu/software/NetCDF/. Build 
+NetCDF4.+ with the appropriate version of hdf5 given in the NetCDF instructions; and make
+sure to build it with fortran (Starting with NetCDF4.1.3 there is a separate NetCDF fortran
+library). Specify the hdf5 libraries, --enable-NetCDF-4 --enable-dap for NetCDF-4 features 
+and OPeNDAP dataset access.
+
+The current official release of Ferret is linked with NetCDF4.2 and has syntax for 
+writing NetCDF4 datasets (hdf5 chunking and compression.)  See the release notes 
+for Ferret v6.6 at http://porter.pmel.noaa.gov/Ferret/home/documentation/v6-6-release-notes
+
+
+To build Ferret:
+
+  * Under the FERRET directory you will find a file called site_specific.mk. Edit this file
+  and insert the locations of the HDF5, NetCDF, and readline directories, and java. Java is
+  used only for the ThreddsBrowser facility of Ferret and is not required. If you use Java, 
+  you need version 1.6 "version 6".
+
+  * Still in the top-level FERRET directory, run "make". This will compile and link Ferret, 
+  gksm2ps, external functions, and the fonts files. The Ferret executable is the file
+  FERRET/fer/ferret_c
+
+  * The build process creates the fonts files that will be needed for Ferret.
+
+  * In the site_specific.mk file, you will see a section about the variable INSTALL_FER_DIR.
+  It is defined there as INSTALL_FER_DIR = $(FER_DIR). If you leave it set that way, then run 
+  "make install" to install Ferret and the environment under that directory. It will also
+  create the tar files fer_environment.tar.gz and fer_executables.tar.gz in directory $(FER_DIR).
+  
+  Alternatively you may want to set INSTALL_FER_DIR to some local directory. Now run "make 
+  install". This will install Ferret under the directory you defined and also create 
+  fer_environment.tar.gz and fer_executables.tar.gz as if they came from the Ferret 
+  distribution. Now you can get the Datasets tar file from 
+  ftp://ftp.pmel.noaa.gov/ferret/pub/data/fer_dsets.tar.gz 
+  and follow the installation instructions
+  http://ferret.pmel.noaa.gov/static/Downloads/ferret_installation_and_update_guide_v600.html
+
+  * Once you have installed Ferret, you'll want to test it. Running some simple scripts, 
+  such as "yes? go ptest" is a good place to start. If you wish, go into the FERRET/bench 
+  directory to run the suite of benchmark tests. There is a simple README file which will 
+  get you started with running the Ferret benchmark scripts. You will run a shell script 
+  called "run_all" which starts the benchmark job. It tests a wide variety of Ferret's 
+  capabilities and makes a number of plots. If it runs successfully you will see these lines:
+
+about to run test of .ferret script
+Display no longer set, about to run batch gif test
+Display still not set, about to run batch ps test
+Display still not set, about to run batch metafile test
+Ended at Tue Nov 8 13:08:13 PST 2011
+Checking PLT, GIF and PS files.......
+
+  In all likelihood this will be followed by a number of messages starting with "plt files
+  differ". The script checks the size of the image files, and it's to be expected that that
+  will differ a bit from one system to another.
+
+  Running all the way through the benchmark suite is a good test of Ferret and the Ferret
+  installation. If you have questions about the results you are welcome to write us at the 
+  contact-Ferret email address, see http://ferret.pmel.noaa.gov/Ferret/support.
diff --git a/bench/123456789000101_100101_test_numeric.nc b/bench/123456789000101_100101_test_numeric.nc
new file mode 100644
index 0000000..5db733d
Binary files /dev/null and b/bench/123456789000101_100101_test_numeric.nc differ
diff --git a/bench/6dfile.nc b/bench/6dfile.nc
new file mode 100644
index 0000000..dc6e4d5
Binary files /dev/null and b/bench/6dfile.nc differ
diff --git a/bench/EZ.DAT b/bench/EZ.DAT
new file mode 100644
index 0000000..a7cc68c
--- /dev/null
+++ b/bench/EZ.DAT
@@ -0,0 +1,5 @@
+        0.006 0.8865         0.176 0.7597         0.282 0.7151
+        0.355 0.6643         0.379 0.6455         0.393 0.6246
+        0.410 0.6071         0.417 0.5935         0.467 0.5648
+        0.435 0.5535         0.444 0.5458         0.470 0.5326
+        0.478 0.5337         0.515 0.5147         0.469 0.5250
diff --git a/bench/NORM_CDF.DAT b/bench/NORM_CDF.DAT
new file mode 100644
index 0000000..e777f4e
Binary files /dev/null and b/bench/NORM_CDF.DAT differ
diff --git a/bench/README b/bench/README
new file mode 100644
index 0000000..2263150
--- /dev/null
+++ b/bench/README
@@ -0,0 +1,76 @@
+FERRET benchmarks README file
+
+Running the benchmarks and interpreting results.
+
+After building Ferret, make a few simple tests for command-line reading,
+script reading, file reading, for example
+
+   > ferretdods_gui
+   yes? list/L=1:5 L
+   yes? go ptest
+
+   yes? use coads_climatology
+   yes? show data
+
+When Ferret is running, the benchmark tests will verify its performance. To run the benchmarks, 
+in the /bench directory we will run the script run_all. Look at the start of run_all, and if you 
+like, customize the section for machine type. This information is used to make the log file, and
+also to look for a machine-specific stream binary file.
+
+Run run_all and answer the questions. When you first run the shell script run_all, you will be 
+coached to create a stream binary file for the machine by compiling and running the program 
+make_stream_file.F. Do this, and then run run_all again.  The benchmarks may be run with or without 
+the shared-object external functions. 
+If the benchmark scripts run correctly, the benchmark job will finish with 
+Display no longer set, about to run batch gif test
+Display still not set, about to run batch ps test
+Ended at Wed Nov 1 09:35:09 PST 2006
+Checking PLT, GIF and PS files.......
+    PLT files look good.....
+    GIF files look good.....
+    PS files look good......
+
+The output is contained in several files:
+
+  all_01nov06at0959.sol_log
+  all_01nov06at0959.sol_err
+  all_01nov06at0959.sol_plt
+
+where the name contains the date and time of the benchmark run, and the extension refers to the 
+machine type or operating system. In addition a number of plot output files are created and 
+compared to reference output by the benchmark script.
+
+In the benchmark directory are "official" output files from a number of operating systems.  To 
+compare your output logs, choose one to compare with your output. There are lines in the benchmark 
+output which may differ from one run of the benchmarks to another and which do not indicate problems 
+with the benchmark run. We may remove them by running the script "clean_ultra" and piping the output 
+to a new file, for the official benchmark log file and the one just created
+
+    > clean_ultra ansley_official.x86_64-linux_log > cleaned_ansley_official.x86_64-linux_log
+    > clean_ultra all_01nov06at0959.sol_log > cleaned_all_01nov06at0959.sol_log 
+
+    > xdiff cleaned_ansley_official.x86_64-linux_log cleaned_all_01nov06at0959.sol_log 
+
+Some differences will still always exist: 
+
+1) The date of the Ferret run and the operating system are included in various outputs such 
+as the Ferret symbol SESSION_DATE, values of labels which are written to the logs, or file 
+attributes which are listed. These differences may be ignored.
+
+2) Values of PPL$XPIXEL and PPL$YPIXEL will differ; these are computed based on the display of the terminal where the benchmark job is run
+
+3) If you are comparing a log from a different operating system, there may be differences in the 
+values of data in output. This might show up as missing_value=-9.9999998e+33f vs missing_value=-1.e-34f, or 
+listings may differ in the least-significant positions. Most all Ferret results are single-prescision, so 
+diffreences of that size are OK. Try to compare with output from a similar machine (32- or 64-bit for
+instance).
+
+4) At the end of the log files, there is a collection of outputs from "spawn ncdump file.nc" commands. 
+Differences in the form of ncdump output, such as differently-placed commas, may exist especially if you
+are comparing logs from different operating systems.
+
+5) Some benchmark scripts involve the output of a spawn command.  The speed with which this output is
+written to the log file may vary from run to run or system to system.  Occasional garbled output is the 
+result of this effect. 
+
+
diff --git a/bench/RUN_TESTS.sh b/bench/RUN_TESTS.sh
new file mode 100755
index 0000000..699596c
--- /dev/null
+++ b/bench/RUN_TESTS.sh
@@ -0,0 +1,193 @@
+#! /bin/sh -f
+# run individually each of the benchmark tests listed in TEST_SCRIPTS
+
+if [ $# -lt 2 ]; then
+   echo ""
+   echo "Usage:  $0  Ferret  ExtFuncsDir  [ ... ]"
+   echo "where:"
+   echo "       Ferret is the ferret executable or pyferret script to use"
+   echo "       ExtFuncsDir is the external functions directory to use"
+   echo "           (if '.', bn_all_ef.jnl will not be run)"
+   echo "       Any remaining arguments are used as comments in the log files"
+   echo ""
+   exit 1
+fi
+
+fver="$1"
+shift
+efdir="$1"
+shift
+bmarker="$USER"
+bcomment="$*"
+
+# allow tests to be commented out by beginning with the line with a '!'
+# remove bn_all_ef.jnl from the list if $efdir is "."
+if [ "$efdir" = "." ]; then
+   test_scripts=`grep -v '^!' TEST_SCRIPTS | grep -v "bn_all_ef\.jnl"`
+else
+   test_scripts=`grep -v '^!' TEST_SCRIPTS`
+fi
+
+umask 002
+
+# Get the machine type for the stream file testing
+if [ `uname -s` = "Linux" -a `uname -m` = "x86_64" ]; then
+    machine="x86_64-linux"
+elif [ `uname -s` = "Linux" -a `uname -m` = "i686" ]; then
+    machine="linux"
+else
+    echo "Unknown machine type"
+    exit 1
+fi
+
+date_stamp=`date +'%d%h%yAT%H%M'|tr '[A-Z]' '[a-z]'`
+log_file="all_${date_stamp}.${machine}_log"
+err_file="all_${date_stamp}.${machine}_err"
+ncdump_file="all_${date_stamp}.${machine}_ncdump"
+rm -f $log_file $err_file $ncdump_file
+touch $log_file $ncdump_file
+
+# set up the binary unformatted stream test file as a machine-specific link
+machine_stream="stream10by5_${machine}.unf"
+if [ -r  $machine_stream ]; then
+   rm -f stream_data_link.unf
+   ln -s $machine_stream stream_data_link.unf
+else
+   echo "File $machine_stream does not exist." >> $log_file
+   echo "Benchmark bn420_stream will fail." >> $log_file
+   echo "To create $machine_stream compile make_stream_file.F and run the executable" >> $log_file
+   echo "Then rename stream10by5.unf to $machine_stream" >> $log_file
+   echo "File $machine_stream does not exist."
+   echo "Benchmark bn420_stream will fail."
+   echo "To create $machine_stream compile make_stream_file.F and run the executable"
+   echo "Then rename stream10by5.unf to $machine_stream"
+fi
+
+#set up proper stream testing jnl file - depends on endianness
+rm -f bn_test_stream.jnl
+if [ $machine = "linux" -o $machine = "alp" -o \
+     $machine = "x86_64-linux" -o $machine = "ia64-linux" ]; then
+    ln -s bn_test_stream_little.jnl bn_test_stream.jnl
+else
+    ln -s bn_test_stream_big.jnl bn_test_stream.jnl
+fi
+
+echo "Testing log output in $log_file"
+echo "Testing errors in $err_file" 
+echo "Testing ncdump output in $ncdump_file"
+
+echo "Using FERRET $fver" >> $log_file
+ls -l $fver >> $log_file
+echo "Using external functions from $efdir" >> $log_file
+echo "Benchmark run by $bmarker" >> $log_file
+echo "Note: $bcomment" >> $log_file
+echo "Benchmark scripts that will be run:" >> $log_file
+for jnl in $test_scripts; do
+   echo "   $jnl" >> $log_file
+done
+
+#set up external functions search path
+FER_EXTERNAL_FUNCTIONS="$efdir"
+export FER_EXTERNAL_FUNCTIONS
+
+#set up a generic data environment
+echo "****** Restricting Ferret paths to bench directory ******" >> $log_file
+FER_DATA="."
+export FER_DATA
+FER_DESCR="."
+export FER_DESCR
+FER_DSETS="."
+export FER_DSETS
+FER_DAT="."
+export FER_DAT
+FER_GRIDS="."
+export FER_GRIDS
+FER_DIR="."
+export FER_DIR
+Fenv >> $log_file
+
+# Make sure things are clean for this run
+rm -f ferret.jnl* bat.plt* `cat TRASH_FILES`
+rm -fr subdir
+touch F.cdf snoopy.dat
+
+now=`date`
+echo "Beginning at $now" >> $log_file
+cp $log_file $err_file
+echo "Beginning at $now"
+
+# always replace $HOME/.ferret with default.ferret so results are consistent
+rm -f keep.ferret
+if [ -f $HOME/.ferret ]; then 
+   echo "****** Temporarily moving $HOME/.ferret to keep.ferret ******"
+   mv -f $HOME/.ferret keep.ferret
+fi
+cp ./default.ferret $HOME/.ferret
+
+if ! echo "$fver" | grep -q "pyferret"; then
+#  command-line options for ferret
+   feropts="-noverify"
+else
+#  command-line options for pyferret
+   feropts="-quiet -nodisplay -noverify"
+fi
+
+# run each of the scripts in the list
+rm -f all_ncdump.out
+for jnl in $test_scripts; do
+
+   echo "*** Running test: $jnl" >> $log_file
+   echo "*** Running test: $jnl" >> $err_file
+   echo "*** Running test: $jnl" > all_ncdump.out
+   echo "Running test: $jnl"
+
+   if [ $jnl = "bn_startupfile.jnl" ]; then
+#     bn_startupfile.jnl needs ferret_startup as $HOME/.ferret
+      rm -f $HOME/.ferret
+      cp -f ferret_startup $HOME/.ferret
+   fi
+
+   if [ $jnl = "bn_dollar.jnl" ]; then
+      $fver $feropts -script $jnl hello 1>> $log_file 2>> $err_file
+   else
+      $fver $feropts -script $jnl 1>> $log_file 2>> $err_file
+   fi
+   if [ $? -ne 0 ]; then
+      echo "****** FERRET error: $jnl failed ******" >> $log_file
+      echo "****** FERRET error: $jnl failed ******" >> $err_file
+      echo "****** FERRET error: $jnl failed ******" >> all_ncdump.out
+      echo "****** FERRET error: $jnl failed ******"
+   fi
+
+   if [ $jnl = "bn_startupfile.jnl" ]; then
+#     remove the $HOME/.ferret created for bn_startupfile.jnl
+      rm -f $HOME/.ferret
+      cp -f default.ferret $HOME/.ferret
+   fi
+
+#  add the contents of all_ncdump.out to $ncdump_file
+   cat all_ncdump.out >> $ncdump_file
+   rm -f all_ncdump.out
+
+done
+
+# Replace $HOME/.ferret if it was removed
+rm -f $HOME/.ferret
+if [ -f keep.ferret ]; then
+   echo "****** Returning keep.ferret to $HOME/.ferret ******"
+   mv keep.ferret $HOME/.ferret
+fi
+
+# Clean-up
+rm -f ferret.jnl* bat.plt* `cat TRASH_FILES`
+# Remove temporary subdirectory
+rm -fr subdir
+# Remove links made by this script (not in TRASH_FILES)
+rm -f bn_test_stream.jnl
+rm -f stream_data_link.unf
+
+now=`date`
+echo  "Ended at $now" >> $err_file
+echo  "Ended at $now" >> $log_file
+echo  "Ended at $now"
+
diff --git a/bench/TAO_SST_clim.cdf b/bench/TAO_SST_clim.cdf
new file mode 100644
index 0000000..aab750e
Binary files /dev/null and b/bench/TAO_SST_clim.cdf differ
diff --git a/bench/TEST_SCRIPTS b/bench/TEST_SCRIPTS
new file mode 100644
index 0000000..6b072de
--- /dev/null
+++ b/bench/TEST_SCRIPTS
@@ -0,0 +1,215 @@
+bn_syntax.jnl
+bn_dollar.jnl
+bn_grave.jnl
+bn_letd.jnl
+bn_if.jnl
+bn_expressions.jnl
+bn_geometry.jnl
+bn_output.jnl
+bn_in_plane.jnl
+bn_compress.jnl
+bn_interpolate.jnl
+bn_regrid.jnl
+bn_ez.jnl
+bn_plot.jnl
+bn_curv.jnl
+bn_symbols.jnl
+bn_comma_delimited.jnl
+bn_dynamic_grids.jnl
+bn_cdf.jnl
+bn_regrid_transforms.jnl
+bn_axis_limits.jnl
+bn_movie.jnl
+bn_ez_order.jnl
+bn_user.jnl
+bn_stream.jnl
+bn_mc.jnl
+bn_negative_t.jnl
+bn_xact_regrid.jnl
+bn_gc_functions.jnl
+bn491_bug_fixes.jnl
+bn_odd_variable_name.jnl
+bn_test_stream.jnl
+bn_define_axes.jnl
+! bn_pattern.jnl - KMS - patterns not supported in PyFerret
+bn_polygon.jnl
+bn500_bug_fixes.jnl
+bn_sample.jnl
+bn_strides_revs_perms.jnl
+bn_non_COARDS_netCDF.jnl
+bn_cache_hits.jnl
+bn_regrid_to_user.jnl
+bn_calendar.jnl
+bn_dash_dot.jnl
+bn_flowlines.jnl
+bn_logaxes.jnl
+bn_internal_external_functions.jnl
+bn_modulo_strides.jnl
+bn_axis_viewports.jnl
+bn_strings.jnl
+bn_axcontrol.jnl
+bn_vec_curv.jnl
+bn_delimited_read.jnl
+bn541_bug_fixes.jnl
+bn_cancel_axes.jnl
+bn542_bug_fixes.jnl
+bn_subspan_modulo.jnl
+bn_dots.jnl
+bn_lev_symbols.jnl
+bn_mode_logo_lab.jnl
+bn_modulo_attribute.jnl
+bn550_bug_fixes.jnl
+bn551_bug_fixes.jnl
+bn_multi_line_labels.jnl
+bn552_bug_fixes.jnl
+bn_set_var_scale_off.jnl
+bn_longvarnames.jnl
+bn_shakey.jnl
+bn_eof_4d.jnl
+bn_abstract_axis_names.jnl
+bn_many_polygons.jnl
+bn_fill_irregular.jnl
+bn_xml_output.jnl
+bn_test_nan.jnl
+bn553_bug_fixes.jnl
+bn_graticules.jnl
+bn_repeat_range.jnl
+bn554_bug_fixes.jnl
+bn_bounds.jnl
+bn_all_leap.jnl
+bn570_bug_fixes.jnl
+bn_modstats.jnl
+bn_mc_vary_scale.jnl
+bn_plot_nokey.jnl
+bn580_bug_fixes.jnl
+bn_inf_levels.jnl
+bn_regulart.jnl
+bn_labwid.jnl
+bn_redefine_taxis_mc.jnl
+bn_illegal_axisname.jnl
+bn_exit_script.jnl
+bn_exit_cycle.jnl
+bn_curv_mod.jnl
+bn_shade_keycont.jnl
+bn581_bug_fixes.jnl
+bn_tab_comma_multivar.jnl
+bn_element_functions.jnl
+bn_long_revision_num.jnl
+bn_window_title.jnl
+bn_last_error.jnl
+bn_deg_min.jnl
+bn_dp_readscale.jnl
+bn_bounds_defineax.jnl
+bn_attributes.jnl
+bn_transforms.jnl
+bn_variance.jnl
+bn_linecolors.jnl
+bn_cdf_errmsg.jnl
+bn600_bug_fixes.jnl
+bn601_bug_fixes.jnl
+bn_set_strides.jnl
+bn_lsl_lowpass.jnl
+bn_return_xmod_tmod.jnl
+bn602_bug_fixes.jnl
+bn_modnbd.jnl
+bn_fifty_files.jnl
+bn603_bug_fixes.jnl
+bn_set_var_name.jnl
+bn_memory_symbol.jnl
+bn605_bug_fixes.jnl
+bn608_bug_fixes.jnl
+bn_shade_trim.jnl
+bn_mode_nlevels.jnl
+bn61_bug_fixes.jnl
+bn_test_opendap.jnl
+bn611_bug_fixes.jnl
+bn_no_valid_on_plot.jnl
+bn_median.jnl
+bn614_bug_fixes.jnl
+bn_mode_nodata_lab.jnl
+bn_proleptic_gregorian_calendar.jnl
+bn_string_ngd_nbd.jnl
+bn_cat_string.jnl
+bn_sort_strings.jnl
+bn_samplexyt.jnl
+bn_last_go_file.jnl
+bn_cancel_upcase_uservar.jnl
+bn_cdf_keepax.jnl
+bn_keep_axisnames.jnl
+bn_key_label_minmax.jnl
+bn62_bug_fixes.jnl
+bn_convolve.jnl
+bn_tax_tstep.jnl
+bn_grads_z.jnl
+bn_clock_syms.jnl
+bn63_bug_fixes.jnl
+bn_axis_reversed_syms.jnl
+bn_isdepth.jnl
+bn_var_hist_levels.jnl
+bn64_bug_fixes.jnl
+bn_long_grid_names.jnl
+bn_xml_repl.jnl
+bn65_bug_fixes.jnl
+bn_txtype_dmy.jnl
+bn_n_open_dsets_sym.jnl
+bn_multi_decade.jnl
+bn_show_xml_file.jnl
+bn66_bug_fixes.jnl
+bn_netcdf4.jnl
+bn_scat2grid_bin.jnl
+bn_axis_dir_symbols.jnl
+bn663_bug_fixes.jnl
+bn_set_axis_regular.jnl
+bn_set_cancel_redirect.jnl
+bn_min_max_smoothers.jnl
+bn_vector_symbols.jnl
+bn_variance_large.jnl
+bn_labnum_calendar.jnl
+bn665_bug_fixes.jnl
+bn_floatstr.jnl
+bn67_bug_fixes.jnl
+bn_NaN_note.jnl
+bn671_bug_fixes.jnl
+bn68_bug_fixes.jnl
+bn_ifv.jnl
+bn_randu2_randn2.jnl
+bn_axis_cf.jnl
+bn_repeated_coords.jnl
+bn_xml_header.jnl
+bn_eof_simple.jnl
+bn_eof_simple2.jnl
+bn_interpolate_6d.jnl
+bn_regrid_6d.jnl
+bn_syntax_6d.jnl
+bn_expressions_6d.jnl
+bn_direction_fcns_6d.jnl
+bn_regrid_transforms_6d.jnl
+bn_aggregate_e.jnl
+bn_6d_lab_mode.jnl
+bn682_bug_fixes.jnl
+bn683_bug_fixes.jnl
+bn_outtype.jnl
+bn_ribbon_plot.jnl
+bn_descr_4digit.jnl
+bn_axis_outtype.jnl
+bn_axis_nonmonotonic.jnl
+bn_vec_mod.jnl
+bn685_bug_fixes.jnl
+bn_dsg_e_x.jnl
+bn_nco_append.jnl
+bn_nobounds.jnl
+bn_write_integer_att.jnl
+bn_descriptor_mc.jnl
+bn_plot_color_only.jnl
+bn_vtree.jnl
+bn686_bug_fixes.jnl
+bn_long_symnames.jnl
+bn_strdim.jnl
+bn_single_colorlev.jnl
+bn69_bug_fixes.jnl
+bn_bad_axis_bounds.jnl
+bn_enter_exit_GO.jnl
+bn_stddev.jnl
+bn_set_axis_name.jnl
+bn_all_ef.jnl
+bn_startupfile.jnl
diff --git a/bench/TRASH_FILES b/bench/TRASH_FILES
new file mode 100644
index 0000000..d345265
--- /dev/null
+++ b/bench/TRASH_FILES
@@ -0,0 +1,205 @@
+0000_a.nc
+10a.nc
+11a.dat
+1a.dat
+3a.dat
+5a.dat
+7a.dat
+9a.dat
+a1.nc
+a2.nc
+aa.nc
+abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif
+a.jnl
+a.nc
+a1.nc
+a2.nc
+another_file_vars.nc
+anothername.gif
+append_to_this.nc
+asc.nc
+axticlabel.plt
+b1566.jnl
+bat.plt_1
+bat.plt_2
+bat.plt_3
+bat.plt_4
+bat.plt_5
+bat.plt_6
+bat.plt_7
+bat.plt_8
+bat.plt_9
+benchmark_history.log
+b.jnl
+b.nc
+bench.mgm 
+bnplot-1.gif
+bnplot-1.plt
+bnplot-2.gif
+bnplot-2.plt
+bnplot-3.plt
+bnplot-4.plt
+bnplot.gif
+bnplot.plt
+bnplot.ps
+c.nc
+c1.nc
+c1.nc
+c2.nc
+cc.nc
+clim.nc
+closed_lev.plt
+confuse_xz.nc
+confuse_yt.nc
+confuse_yz.nc
+confuse_yzt.nc
+d2.nc
+dashbug.gif
+dashbug.plt
+dashbug.png
+dat.dat
+degC_axlab.plt
+dots.plt
+dsg_nocoord.nc
+dummy1.string_tst
+dummy1.str_test
+dummy2.string_tst
+dummy2.str_test
+dummy3.string_tst
+dummy3.str_test
+dummy4.string_tst
+dummy4.str_test
+dummy5.string_tst
+dummy5.str_test
+dummy6.string_tst
+dummy6.str_test
+dummy7.string_tst
+dummy7.str_test
+dummy8.string_tst
+dummy8.str_test
+dummy9.str_test
+dummy.dat
+eofsp.cdf
+eofst.cdf
+eofti.cdf
+err67_axis_order_copy.nc
+f2.nc
+F.cdf
+ferret.jnl
+ferret.jnl.~1~
+ferret.png
+FI.cdf
+FL.cdf
+flowlines.plt
+f.nc
+foo.bar1
+foo.bar2
+foo.bar3
+foo.cdf
+fort.41
+FTLON.cdf
+gh.nc
+.gif
+gif_dashbug.gif
+g.nc
+graticules.plt
+h.nc
+input.txt
+irrxzt.nc
+junk.dat
+justg.nc
+justh.nc
+linecolors.plt
+list_of_numbers.dat
+longax.dat
+longtitle.nc
+longvname.nc
+lonlat.dat
+lonlat.nc
+multi_line_labels.plt
+my_file_vars.nc
+mypack.nc
+mytype.nc
+names
+nc
+nc4_deflate4bigchunk.nc
+nc4_deflate4_defaultchunk.nc
+nc4_deflate4.nc
+nc4_deflate4_t1.nc
+nc4_deflate4_xyt.nc
+nc4_inttemp_classic.nc
+nc4_inttemp_set_classic.nc
+nc4_inttemp_set_list_deflate_chunk.nc
+nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+nc4_nodeflate3.nc
+newjournal.jnl
+noleap.nc
+other_file_vars.nc
+out.cdf
+out.nc
+pattern_plot1.plt
+pattern_plot2.plt
+permutedBinaryTest.dat
+polygon_plot.plt
+ppllist.out
+redirect_journal.txt
+redirect_stderr.txt
+redirect_stdout.txt
+redirect.txt
+revision.nc
+snoopy.dat
+sst_new.nc
+startup_tests2.plt
+startup_tests.jnl
+startup_tests.plt
+string4d.nc
+t12.nc
+t2.nc
+t3file.nc
+t_bug.nc
+test0a.cdf
+test0b.cdf
+test0c.cdf
+test0d.cdf
+test0e.cdf
+test0f.cdf
+test0g.cdf
+test0h.cdf
+test0i.cdf
+test0j.cdf
+test0k.cdf
+test0l.cdf
+test0m.cdf
+test0n.cdf
+test0o.cdf
+test0p.cdf
+test_100x100.nc
+test2.cdf
+test_abs.cdf
+testbackground.gif
+test.cdf
+test.dat
+test_fil0.cdf
+test_fil.cdf
+test_mod.cdf
+test_modulo.cdf
+test_nomod.cdf
+test_string.cdf
+test_subspan_modulo.nc
+test.txt
+test.unf
+the_xml_file.xml
+timetics2.plt
+timetics.plt
+unf.dat
+v12file.nc
+v1file.nc
+vec_curv2.plt
+vec_curv.plt
+WV.J34K56L7
+xml_out.xml
+xml_out_string.xml
+xyir.nc
+xz.nc
+z1.nc
+z2.nc
diff --git a/bench/a1478.nc b/bench/a1478.nc
new file mode 100644
index 0000000..0caadbc
Binary files /dev/null and b/bench/a1478.nc differ
diff --git a/bench/a_cartesian_bug1179.nc b/bench/a_cartesian_bug1179.nc
new file mode 100644
index 0000000..101a9c6
Binary files /dev/null and b/bench/a_cartesian_bug1179.nc differ
diff --git a/bench/adouble.nc b/bench/adouble.nc
new file mode 100644
index 0000000..c21cc36
Binary files /dev/null and b/bench/adouble.nc differ
diff --git a/bench/adouble_2D.nc b/bench/adouble_2D.nc
new file mode 100644
index 0000000..ff6211f
Binary files /dev/null and b/bench/adouble_2D.nc differ
diff --git a/bench/ansley_official.linux_err b/bench/ansley_official.linux_err
new file mode 100644
index 0000000..8797fa2
--- /dev/null
+++ b/bench/ansley_official.linux_err
@@ -0,0 +1,3676 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/linux/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 52529714 Mar 17 15:44 /home/users/ansley/build/linux/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/linux/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: after Steve's checkin, aux variables
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/linux/FERRET/external_functions/ext_func
+FER_GO=. /home/users/tmap/ferret/linux/go /home/users/tmap/ferret/linux/examples /home/users/tmap/ferret/linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/linux/ppl
+PWD=/home/users/ansley/build/linux/FERRET/bench
+Beginning at Mon Mar 17 15:53:19 PDT 2014
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO bn_dollar hello
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO bn_dollar hello
+say ($10)0
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          Legal range is 1 to 3
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+cont/over/i=1:10/color=noexist i
+ **ERROR: unknown command qualifier: thick=4
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: multiple specifications on X axis
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: multiple specifications on X axis
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+Replacing definition of grid G12
+Replacing definition of grid G24
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TCAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+Replacing definition of axis Y1
+Replacing definition of axis Y2
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+Replacing definition of grid TGRID
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X10
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of grid G1
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis Z1
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport LL6
+Re-defining viewport UL6
+Re-defining viewport LM6
+Re-defining viewport UM6
+Re-defining viewport LR6
+Re-defining viewport UR6
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+Replacing definition of axis TAX2
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+Re-defining viewport MID2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ls: input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis Z1
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=JAN-1990
+          Axis extremes are T=DEC-1997:JAN-1998
+list/t=1-jan-1990 dummy
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=AUG-1980:JAN-1982
+          Axis extremes are T=AUG-1982:JAN-1983
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid TGRID
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: ZORRO
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized for T axis: METERS
+ *** NOTE: They will not be convertible
+ *** NOTE: Units  not recognized for Y axis: SECONDS
+ *** NOTE: They will not be convertible
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis YFINE
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XQ
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TGREG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file revision.nc
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT1).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME4).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ *** NOTE: Changing the value of attribute (PSYT1).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIR
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ LISTing to file a.nc
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME9
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX047)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid GG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis ZAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis TAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of axis Y1
+Replacing definition of grid G1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file list_of_numbers.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dummy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid MYGRID
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+Replacing definition of axis YAX
+ LISTing to file a.nc
+Replacing definition of axis TAXIS
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis TNEW
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAXIS
+Replacing definition of axis TAXIS
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid EVEN
+Replacing definition of grid G1
+Replacing definition of grid G2
+Replacing definition of grid G3
+Replacing definition of grid G4
+Replacing definition of grid G13
+Replacing definition of grid G14
+Replacing definition of grid G23
+Replacing definition of grid G33
+Replacing definition of grid G234
+Replacing definition of grid G134
+Replacing definition of grid G124
+Replacing definition of grid G123
+Replacing definition of grid G1234
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+Replacing definition of grid G48
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid G5DAY
+Replacing definition of axis FAX4DAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ncks: WARNING Overwriting global attribute history
+ncks: WARNING Overwriting global attribute Conventions
+ncks: WARNING Overwriting attribute point_spacing for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute axis for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute standard_name for output variable ZAXIS_ORIG
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file append_to_this.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIRREG
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+ *** NOTE: Not deleted: ENSEMBLE
+ *** NOTE: Axis is in use by grid (G103)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute a.ival
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             nosuchfile.nc
+SET DAT/FORM=CDF nosuchfile.nc
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for nosuchfile(.nc ,.cdf,.des)
+SET DAT/FORM=CDF nosuchfile
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for snoopy(.nc ,.cdf,.des)
+SET DAT/FORM=CDF snoopy
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./snoopy.dat
+SET DAT/FORM=CDF snoopy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis definition error on axis: MONTH_IRREG. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "MONTH_IRREG_bnds" or bounds do not enclose point on axis MONTH_IRREG
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unknown region name: @w
+set region/@w
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+          unknown function "writev5d"
+DEFINE VARIABLE/QUIET vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+ **ERROR: variable unknown or not in data set: VFLAG
+LOAD/TEMPORARY vflag
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ *** NOTE: Cannot create new windows when batch mode set
+Ended at Mon Mar 17 15:55:07 PDT 2014
diff --git a/bench/ansley_official.linux_log b/bench/ansley_official.linux_log
new file mode 100644
index 0000000..811d01b
--- /dev/null
+++ b/bench/ansley_official.linux_log
@@ -0,0 +1,80057 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/linux/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 52529714 Mar 17 15:44 /home/users/ansley/build/linux/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/linux/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: after Steve's checkin, aux variables
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/linux/FERRET/external_functions/ext_func
+FER_GO=. /home/users/tmap/ferret/linux/go /home/users/tmap/ferret/linux/examples /home/users/tmap/ferret/linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/linux/ppl
+PWD=/home/users/ansley/build/linux/FERRET/bench
+Beginning at Mon Mar 17 15:53:19 PDT 2014
+! BN500_ALL.JNL
+! - run all the benchmark tests
+! - ordered (more or less) from least to most complex
+! V2.30: uses BN230_syntax instead of BN200_syntax
+!        added BN230_cdf
+!	 added BN230_regrid_transforms 8/92
+! V3.00: uses BN300_syntax instead of BN230_syntax
+! 	 added bn300_dollar 4/93
+! V3.01: adds bn301_axis_limits and ppl echo ON
+! V3.11: adds bn311_ez_order (/ORDER and /FORMAT=STREAM)
+! V3.12: adds bn312_user (tests SAMPLE and OBJECTIVE)
+! V3.13: for AIX testing: removed mem_mgmt & ignore errors during bn200_output
+! V3.20: to test SAVE/HEADING=enhanced (new BN320_cdf)
+! V4.00: added "*" tests to bnxxx_dollar and added new test bn400_grave
+!    6/95 - added bn401_symbols
+!    7/95 - modified bn*_syntax: bn401_syntax has var1[G=var2[d=dset]]
+!    8/95 - modified bn*_ez: bn401_ez tests FORM=unf
+! V4.20:
+!    9/95 - added test of LET/D and LIST/FORMAT=STREAM
+!	  - slightly modified syntax in bn420_regrid_transforms
+!	  - added bn420_dynamic_grids and bn420_comma_delimited
+!	  - added 2 small additional tests in bn420_grave
+!	  - added a small syntax test in bn420_syntax
+!	  - tested for commas inside args in bn420_dollar
+!	  - tested for enclosing parens in bn420_symbol
+! V4.30:
+!   5/96  - added IF tests
+!   9/96  - added MC data tests *kob*
+! V4.50:
+!   1/97  - eliminated MODE POLISH
+!	    (bn301_expressions.jnl -> bn450_expressions.jnl)
+!   8/97  - bn430_if -> bn450_if: added symbol substitution test
+!10/97*kob*- cancel metafile creation after bn420_syntax and turn it
+!	    on only before bn450_plot (upgraded from bn320_plot)
+!	   - also add test for negative time steps (bn450_negative_t)
+!	   - also add test for cuvilinear stuff
+!          - also added steve's "exact match" regridding
+!11/97 *kob* - added bn450_gc_functions
+! V4.91:
+!    1/98  - corrected bug in this script -- need to cancel viewports after
+!	     bn312_user or the plots which follow come up in a small viewport
+!    2/98 *kob* - moved bn450_curv.jnl up to right after bn450_plot.jnl in
+!		  order to have those metafiles saves as well for checking
+!		  also renamed it to bn491_curv.jnl and added some minor
+!		  cosmetic changes
+!    2/98 *kob* - add in bn491_bug_fixes.jnl
+!    4/98 *sh*  - replaced bn420_dynamic_grids with bn491_... (minor chg)
+! V5.00:
+!   2/99 *sh* -- bn420_regrid_transform ==> bn500_regrid_transform
+!   3/1/99 *kob* - removed bn200_budget from distributable benchmarks
+!   5/99 *kob* - added V50 bench files
+! V5.10:
+!  10/99 *sh* -- added bn_sample.jnl to test SAMPLEI,J,K,L
+!			bn_non_COARDS_netCDF.jnl
+!			bn_cache_hits.jnl, .sub
+!			bn_strides_revs_perms.jnl
+!			bn_regrid_to_user.jnl
+! V5.33:
+! 6/01 *sh* -- added bn_modulo_strides.jnl
+! 6/01 *acm*  -- add	bn_calendar
+!			bn_dash_dot
+!			bn_flowlines
+! 6/08 *kob*  -- add	bn_internal_external_functions
+!
+! V5.40:
+! 9/01 *sh* -- added bn_axis_viewports
+!           -- added bn_strings
+! 10/01 *acm* -- added bn_axcontrol
+!             -- add EOF's and cmprsi_by to bn_internal_external_functions.jnl
+! 11/01 *sh* -- added bn_delimited_read
+!
+! V5.41:
+! 3/02 *acm*-- Add bn540_bug_fixes.jnl
+!
+! V5.50:
+! 11/02 *sh*-- Add bn_subspan_modulo.jnl
+!
+! V5.52
+!  5/03 *acm* add bn_multi_line_labels.jnl, bn552_bug_fixes.jnl,
+!             bn_set_var_scale_off.jnl, bn_longvarnames.jnl, bn_shakey.jnl
+! v5.53
+!  9/03 *kob* added bn_test_nan
+ 
+! v5.81
+!  9/05 *acm* remove bn_curv_shade_mod.jnl which was duplicated by bn_curv_mod.jnl
+ 
+!  V6.00
+!  9/06 *acm* new scripts  bn_tab_comma_multivar.jnl, bn_element_functions.jnl,
+!             bn_long_revision_num.jnl, bn_window_title.jnl, bn_last_error.jnl,
+!             bn_deg_min.jnl, bn_dp_readscale.jnl, bn_bounds_defineax.jnl,
+!              bn_attributes.jnl, n600_bug_fixes.jnl
+!
+! 9/06 *acm* New bn601_bug_fixes for version 6.02
+ 
+! 6/06  *acm* add bn_transforms.jnl -- there was a benchmark testing regridding
+!             transforms but not the others: smoothers, fillers, etc.
+! 1/12  *acm* add bn_variance.jnl -- testing @VAR transform
+ 
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!
+! 11/06 *acm* New bn602_bug_fixes for version 6.02
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V685  *sh* 11/13 - added bn_vtree to test SHOW VAR/TREE
+ 
+! Include this statement to compare the outupt of 6D Ferret with
+! previous 4D benchmark logs.
+! cancel mode 6d_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      metafile.plt
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN ACTIVE
+   1    *
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+cancel mode metafile      !9/97
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dollar hello    ! test command arg
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+ 
+! added in bn400
+GO bn_reset
+cancel mode verify
+GO bn_grave
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  3 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+ 
+! added in bn420
+GO bn_reset
+cancel mode verify
+GO bn_letd
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+ 
+! added in bn430
+GO bn_reset
+cancel mode verify
+GO bn_if
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+ 
+GO bn_reset
+cancel mode verify
+GO bn_geometry
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+set mode ignore		! needed for AIX   11/94
+GO bn_output
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+cancel list/format
+can mode ignore		! needed for AIX
+ 
+GO bn_reset
+cancel mode verify
+GO bn_in_plane
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+ 
+GO bn_reset
+cancel mode verify
+GO bn_compress
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4        6        8     
+              2        3        4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- K:3 Z:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- K:4 Z:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- K:3 Z:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- K:4 Z:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- K:3 Z:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- K:4 Z:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5        7        9     
+              3        4        5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- K:4 Z:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- K:5 Z:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- K:4 Z:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- K:5 Z:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- K:4 Z:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- K:5 Z:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ez		! changed from bn200_ez 8/10/95
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.355000
+ 3   / 3:  0.410000
+ 4   / 4:  0.435000
+ 5   / 5:  0.478000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+               X1      X2
+1   / 1:  0.006000  0.886500
+2   / 2:  0.355000  0.664300
+3   / 3:  0.410000  0.607100
+4   / 4:  0.435000  0.553500
+5   / 5:  0.478000  0.533700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.006000
+ 2    /  2:  0.176000
+ 3    /  3:  0.282000
+ 4    /  4:  0.355000
+ 5    /  5:  0.379000
+ 6    /  6:  0.393000
+ 7    /  7:  0.410000
+ 8    /  8:  0.417000
+ 9    /  9:  0.467000
+ 10   / 10:  0.435000
+ 11   / 11:  0.444000
+ 12   / 12:  0.470000
+ 13   / 13:  0.478000
+ 14   / 14:  0.515000
+ 15   / 15:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.593500
+ 3   / 3:  0.435000
+ 4   / 4:  0.545800
+ 5   / 5:  0.478000
+ 6   / 6:  0.514700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.355000
+ 2   / 2:  0.379000
+ 3   / 3:  0.393000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+              1         2         3      
+               1         2         3
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ 3   / 3:  0.410000  0.417000  0.467000
+ 4   / 4:  0.435000  0.444000  0.470000
+ 5   / 5:  0.478000  0.515000  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+              1         2         3      
+               1         2         3
+ ---- L:1 T:   1
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ ---- L:2 T:   2
+ 1   / 1:  0.410000  0.417000  0.467000
+ 2   / 2:  0.435000  0.444000  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.176000
+ 3   / 3:  0.282000
+ 4   / 4:  0.355000
+ 5   / 5:  0.379000
+ 6   / 6:  0.393000
+ 7   / 7:  0.410000
+ 8   / 8:  0.417000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+! ****
+! remove bn200_budgets for portable benchmarks *kob* 5/99
+! ****
+ 
+! ppl echo on turns on fort.41 to capture ppl commands.
+PPL ECHO ON		! added 10/27/93
+ 
+! 10/97 *kob* now set mode metafile
+set mode metafile bnplot.plt
+GO bn_reset
+cancel mode verify
+GO bn_plot		! upgraded from bn320_plot 10/1/97 *kob*
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+ 
+ 
+!added in bn450 10/97 *kob*
+! moved to right after bn450_plot to capture metafiles *kob* 2/98
+GO bn_reset
+cancel mode verify
+! 2/98 changed bn450_curv to bn491_curv - just some cosmetic changes *kob*
+GO bn_curv
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+ 
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! 8/25/92
+!CANCEL WINDOW/ALL    ! added 7/27/92
+! 10/97 *kob* now cancel mode metafile
+cancel mode metafile
+ 
+GO bn_reset
+cancel mode verify
+GO bn_symbols	! added 6/22/95
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5PAE 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:50:21 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+DELTA_CPU = "4.84426"
+CLOCK_SECS = "7.36"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:53:27"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5PAE 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:50:21 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+DELTA_CPU = "0.001"
+CLOCK_SECS = "7.361"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:53:27"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "4"
+Q23456789012345678901234567890AAAAA = "5"
+Q23456789012345678901234567XXXAAAAA = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LAB1 = "FERRET Ver. 6.861"
+LAB2 = "NOAA/PMEL TMAP"
+LAB3 = "17-MAR-2014 15:53:27"
+LABX = "X"
+LAB4 = "Y : 10"
+LABNUM_Y = "4"
+LAB5 = "Z : 5"
+LABNUM_Z = "5"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "4"
+LABNUM_Z = "5"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "4"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5PAE 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:50:21 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+SESSION_PID = "3592"
+DELTA_CPU = "0.010998"
+CLOCK_SECS = "7.372"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:53:27"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_comma_delimited	! added 10/2/95
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- K:3 Z:   25
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- K:3 Z:   25
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- I:96 X:   134.5W
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+15,27.1246,27.5239
+25,27.011,27.3501
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- J:42 Y:   1.167S
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+15,27.1246,27.5239
+25,27.011,27.3501
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- K:3 Z:   25
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- K:3 Z:   25
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+25,27.2481
+ ---- I:96 X:   134.5W
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+15,27.1246
+25,27.011
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+25,27.2481
+ ---- J:42 Y:   1.167S
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+15,27.1246
+25,27.011
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+ ---- I:96 X:   134.5W
+15,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+ ---- I:96 X:   134.5W
+15,27.1246
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+ ---- J:42 Y:   1.167S
+15,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+ ---- J:42 Y:   1.167S
+15,27.1246
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.167S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.167S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+1.5S,27.335
+1.167S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W   	134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.3346	27.2218
+1.167S	27.2382	27.1246
+ ---- K:3 Z:   25
+1.5S	27.2481	27.1248
+1.167S	27.1293	27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.7751	27.6218
+1.167S	27.678	27.5239
+ ---- K:3 Z:   25
+1.5S	27.6518	27.4892
+1.167S	27.51	27.3501
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,2.E+08,2.E+08
+1.167S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,1.6675084E+08,2.0208841E+08
+1.167S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.000002,0.000002
+1.167S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.00000166750845,0.00000202088412
+1.167S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.833S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.333S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1     ,2     ,3     ,4     ,5     
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dynamic_grids	! added 9/27/95, V420 ->V491 4/98
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.67N / 50:  24.6561  24.4277  24.3118  24.3162  24.5191
+ 1.33N / 49:  24.4396  24.2439  24.1355  24.1369  24.3131
+ 1N    / 48:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.67N / 47:  24.0904  23.9463  23.8383  23.7928  23.8749
+ 0.33N / 46:  23.9899  23.8698  23.7654  23.6951  23.7076
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  24.5431  24.3351  24.2254  24.2312  24.4219
+ 1.17N / 49:  24.3362  24.1527  24.0455  24.0427  24.2042
+ 0.83N / 48:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.5N  / 47:  24.0242  23.8934  23.7879  23.7273  23.7728
+ 0.17N / 46:  23.9556  23.8461  23.7430  23.6629  23.6425
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G003)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+                179.5W    178.5W    177.5W    176.5W    175.5W  
+                 51        52        53        54        55
+ 1.83N / 51: -0.627987 -0.652220 -0.659763 -0.663230 -0.662623
+ 1.5N  / 50: -0.631590 -0.653915 -0.653717 -0.650547 -0.644405
+ 1.17N / 49: -0.635168 -0.655610 -0.647673 -0.637865 -0.626188
+ 0.83N / 48: -0.627037 -0.647150 -0.637065 -0.626707 -0.616078
+ 0.5N  / 47: -0.607180 -0.628495 -0.621847 -0.617047 -0.614073
+ 0.17N / 46: -0.587298 -0.609840 -0.606630 -0.607388 -0.612068
+ 0.17S / 45: -0.567438 -0.591208 -0.591415 -0.597708 -0.610065
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 1.83N / 51:  27.5946  27.5458  27.5038  27.4555  27.3787  27.2791
+ 1.5N  / 50:  27.6353  27.5819  27.5333  27.4787  27.4018  27.3015
+ 1.17N / 49:  27.6807  27.6187  27.5654  27.5064  27.4279  27.3285
+ 0.83N / 48:  27.7285  27.6555  27.5958  27.5327  27.4522  27.3536
+ 0.5N  / 47:  27.7775  27.6952  27.6296  27.5610  27.4762  27.3760
+ 0.17N / 46:  27.8234  27.7366  27.6691  27.5969  27.5077  27.4040
+ 0.17S / 45:  27.8727  27.7878  27.7232  27.6494  27.5563  27.4494
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                  A      A
+130.5E / 1:  130.500  130.500
+131.5E / 2:  131.500  131.500
+132.5E / 3:  132.500  132.500
+133.5E / 4:  133.500  133.500
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX003)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.10000
+ 0.2  /  2:  0.20000
+ 0.3  /  3:  0.30000
+ 0.4  /  4:  0.40000
+ 0.5  /  5:  0.50000
+ 0.6  /  6:  0.60000
+ 0.7  /  7:  0.70000
+ 0.8  /  8:  0.80000
+ 0.9  /  9:  0.90000
+ 1    / 10:  1.00000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.000
+ 132.5E / 2:  132.500
+ 135E   / 3:  135.000
+ 137.5E / 4:  137.500
+ 140E   / 5:  140.000
+ 142.5E / 6:  142.500
+ 145E   / 7:  145.000
+ 147.5E / 8:  147.500
+ 150E   / 9:  150.000
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 101   /  1:  101.100  102.600  104.100  105.600  107.100  108.600  110.100
+ 102   /  2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 103   /  3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 104   /  4:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 105   /  5:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+ 106   /  6:  106.100  107.600  109.100  110.600  112.100  113.600  115.100
+ 107   /  7:  107.100  108.600  110.100  111.600  113.100  114.600  116.100
+ 108   /  8:  108.100  109.600  111.100  112.600  114.100  115.600  117.100
+ 109   /  9:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+ 110   / 10:  110.100  111.600  113.100  114.600  116.100  117.600  119.100
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                 0.1      4.6      9.1   
+                 1        2        3
+ 101   /  1:  101.100  105.600  110.100
+ 102   /  2:  102.100  106.600  111.100
+ 103   /  3:  103.100  107.600  112.100
+ 104   /  4:  104.100  108.600  113.100
+ 105   /  5:  105.100  109.600  114.100
+ 106   /  6:  106.100  110.600  115.100
+ 107   /  7:  107.100  111.600  116.100
+ 108   /  8:  108.100  112.600  117.100
+ 109   /  9:  109.100  113.600  118.100
+ 110   / 10:  110.100  114.600  119.100
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                 0.1      7.6   
+                 1        2
+ 101   /  1:  101.100  108.600
+ 102   /  2:  102.100  109.600
+ 103   /  3:  103.100  110.600
+ 104   /  4:  104.100  111.600
+ 105   /  5:  105.100  112.600
+ 106   /  6:  106.100  113.600
+ 107   /  7:  107.100  114.600
+ 108   /  8:  108.100  115.600
+ 109   /  9:  109.100  116.600
+ 110   / 10:  110.100  117.600
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 102    / 1:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 102.5  / 2:  102.600  104.100  105.600  107.100  108.600  110.100  111.600
+ 103    / 3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 103.5  / 4:  103.600  105.100  106.600  108.100  109.600  111.100  112.600
+ 104    / 5:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 104.5  / 6:  104.600  106.100  107.600  109.100  110.600  112.100  113.600
+ 105    / 7:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+                0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                1        2        3        4        5        6        7
+ 95    / 1:     ....     ....     ....     ....     ....     ....     ....
+ 102   / 2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 109   / 3:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX004)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX003)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX003)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ (AX004)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.00
+ 121    /  2:   220.00
+ 441    /  3:   420.00
+ 961    /  4:   620.00
+ 1681   /  5:   820.00
+ 2601   /  6:  1020.00
+ 3721   /  7:  1220.00
+ 5041   /  8:  1420.00
+ 6561   /  9:  1620.00
+ 8281   / 10:  1720.00
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.500
+ 131.5E /  2:  131.500
+ 132.5E /  3:  132.500
+ 133.5E /  4:  133.500
+ 134.5E /  5:  134.500
+ 135.5E /  6:  135.500
+ 136.5E /  7:  136.500
+ 137.5E /  8:  137.500
+ 138.5E /  9:  138.500
+ 139.5E / 10:  139.500
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX003)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  255.043  255.835  256.725  257.731  258.922
+ 1.17N / 49:  254.836  255.653  256.546  257.543  258.704
+ 0.83N / 48:  254.657  255.499  256.389  257.358  258.477
+ 0.5N  / 47:  254.524  255.393  256.288  257.227  258.273
+ 0.17N / 46:  254.456  255.346  256.243  257.163  258.142
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  125.543  129.422  134.545  137.119  141.562
+ 1.17N / 49:  125.336  129.204  134.163  136.896  141.270
+ 0.83N / 48:  125.157  128.977  133.703  136.690  140.960
+ 0.5N  / 47:  125.024  128.773  133.295  136.512  140.644
+ 0.17N / 46:  124.956  128.642  132.987  136.380  140.376
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  255.043  258.922  264.045  266.619  271.062
+ 1.17N / 49:  254.836  258.704  263.663  266.396  270.770
+ 0.83N / 48:  254.657  258.477  263.203  266.190  270.460
+ 0.5N  / 47:  254.524  258.273  262.795  266.012  270.144
+ 0.17N / 46:  254.456  258.142  262.487  265.880  269.876
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               168.5E   170.5E   172.5E   174.5E   176.5E   178.5E  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  29.2186  29.1820  28.9284  28.6727  28.1158  27.7262
+ 1.17N / 49:  29.2537  29.1794  28.9683  28.7060  28.2175  27.8045
+ 0.83N / 48:  29.2747  29.1817  28.9842  28.7218  28.2984  27.8834
+ 0.5N  / 47:  29.3025  29.1943  28.9819  28.7306  28.3551  27.9545
+ 0.17N / 46:  29.3441  29.2219  28.9889  28.7493  28.3962  28.0105
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               108.5W   106.5W   104.5W   102.5W   100.5W   98.5W   
+                 1        2        3        4        5        6
+ 1.5N  / 50:  25.4248  25.2404  25.0453  25.2349  25.4898  25.8063
+ 1.17N / 49:  25.0178  24.8787  24.7362  24.9070  25.2015  25.5514
+ 0.83N / 48:  24.6455  24.5412  24.4230  24.5627  24.8753  25.2469
+ 0.5N  / 47:  24.2823  24.1999  24.1010  24.2162  24.5241  24.8980
+ 0.17N / 46:  23.9664  23.8958  23.8185  23.9163  24.1945  24.5649
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX004)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.000
+ 170E   / 2:  170.000
+ 150W   / 3:  210.000
+ 110W   / 4:  250.000
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.0000
+ 2S    / 2:  -2.0000
+ 10S   / 1: -10.0000
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 2.8N / 4:  25.8760  25.1016  24.7591  25.3616  25.9523  26.1052
+ 1.8N / 3:  25.1492  24.5204  24.4013  25.0592  25.8372  25.5690
+ 0.8N / 2:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.2S / 1:  24.0844  23.8819  23.6864  23.6291  23.8094  23.6664
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 4N   / 4:  26.3100  25.7627  25.1684  25.4169  26.0928  26.4324
+ 2.5N / 3:  25.6892  24.9014  24.6646  25.3345  25.9631  26.0034
+ 1N   / 2:  24.4816  24.0759  23.9505  24.3911  24.9972  24.6091
+ 0.5S / 1:  24.1489  23.9855  23.7919  23.6520  23.7144  23.6009
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 2.8N / 4:  25.6905  24.7917  25.5507  26.0875
+ 1.8N / 3:  24.9592  24.3997  25.3139  25.6838
+ 0.8N / 2:  24.2617  23.8736  24.4085  24.5531
+ 0.2S / 1:  24.0313  23.7330  23.6749  23.7233
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 4N   / 4:  26.1901  25.2969  25.5832  26.3921
+ 2.5N / 3:  25.4818  24.6784  25.5471  26.0151
+ 1N   / 2:  24.3640  23.9588  24.5740  24.7711
+ 0.5S / 1:  24.1087  23.8399  23.6597  23.6433
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX003)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   138.5W   136.5W   134.5W   132.5W   130.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.9330  24.4927  25.4749  25.9529  25.6235  24.8629
+ 1.17N / 49:  24.8195  24.3658  25.1683  25.8306  25.3698  24.5966
+ 0.83N / 48:  24.6946  24.2521  24.7974  25.6708  25.1391  24.3667
+ 0.5N  / 47:  24.5726  24.1661  24.4685  25.4813  24.9214  24.1928
+ 0.17N / 46:  24.4684  24.1208  24.2760  25.1658  24.7013  24.0902
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W  
+                 1        2        3
+ 1.5N  / 50:  24.9330  25.4749  25.6235
+ 1.17N / 49:  24.8195  25.1683  25.3698
+ 0.83N / 48:  24.6946  24.7974  25.1391
+ 0.5N  / 47:  24.5726  24.4685  24.9214
+ 0.17N / 46:  24.4684  24.2760  24.7013
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W   128.5W  
+                 1        2        3        4
+ 1.5N  / 50:  24.9330  25.4749  25.6235  24.3351
+ 1.17N / 49:  24.8195  25.1683  25.3698  24.1527
+ 0.83N / 48:  24.6946  24.7974  25.1391  23.9991
+ 0.5N  / 47:  24.5726  24.4685  24.9214  23.8934
+ 0.17N / 46:  24.4684  24.2760  24.7013  23.8461
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               134.5W   132.5W   130.5W   128.5W   126.5W   124.5W  
+                 4        5        6        7        8        9
+ 1.5N  / 50:  25.9529  25.6235  24.8629  24.3351  24.2312  24.8158
+ 1.17N / 49:  25.8306  25.3698  24.5966  24.1527  24.0427  24.5341
+ 0.83N / 48:  25.6708  25.1391  24.3667  23.9991  23.8583  24.2480
+ 0.5N  / 47:  25.4813  24.9214  24.1928  23.8934  23.7273  23.9665
+ 0.17N / 46:  25.1658  24.7013  24.0902  23.8461  23.6629  23.7442
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               135W     132W     129W     126W    
+                 1        2        3        4
+ 1.5N  / 50:  25.8334  25.4333  24.4671  24.3773
+ 1.17N / 49:  25.6650  25.1765  24.2637  24.1656
+ 0.83N / 48:  25.4524  24.9460  24.0910  23.9557
+ 0.5N  / 47:  25.2281  24.7393  23.9683  23.7871
+ 0.17N / 46:  24.9433  24.5486  23.9072  23.6832
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     127W     125W     123W     121W    
+                 1        2        3        4        5
+ 1.5N  / 50:  24.5447  24.2283  24.7825  25.1672  25.3824
+ 1.17N / 49:  24.3256  24.0441  24.5077  24.8227  24.9891
+ 0.83N / 48:  24.1323  23.8736  24.2302  24.4567  24.5531
+ 0.5N  / 47:  23.9915  23.7576  23.9781  24.1197  24.1823
+ 0.17N / 46:  23.9163  23.7029  23.7877  23.8557  23.9069
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               138W     133W     128W     123W     118W     113W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....  24.3865  25.1672     ....     ....
+ 1.17N / 49:     ....     ....  24.1849  24.8227     ....     ....
+ 0.83N / 48:     ....     ....  24.0029  24.4567     ....     ....
+ 0.5N  / 47:     ....     ....  23.8746  24.1197     ....     ....
+ 0.17N / 46:     ....     ....  23.8096  23.8557     ....     ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4.8N / 6:  26.3655  26.1878  26.0268  25.9290  25.9885
+ 3.8N / 5:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 5.8N / 4:  26.6294  26.5670  26.5361  26.5638  26.6554
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:  26.4095  26.2510  26.1116  26.0348  26.0997
+ 3N   / 3:  25.5883  25.1978  24.9065  24.8097  24.9649
+ 1N   / 2:  24.2587  24.0860  23.9737  23.9488  24.0835
+ 1S   / 1:     ....     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:     ....     ....     ....     ....     ....
+ 3N   / 3:  25.5396  25.1885  24.9365  24.8326  24.9791
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 1S   / 1:  24.2763  24.2177  24.1436  24.0651  23.9786
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W    63.5W    61.5W  
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966  29.4136  29.5107
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191  29.4462  29.5279
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689  29.4873  29.5544
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330  29.5361  29.5888
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966  29.5858  29.6187
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX002)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W  
+                 1        2        3
+ 1.5N  / 50:     ....     ....  29.5035
+ 1.17N / 49:     ....     ....  29.5373
+ 0.83N / 48:     ....     ....  29.6002
+ 0.5N  / 47:     ....     ....  29.6787
+ 0.17N / 46:     ....     ....  29.7929
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W    63.5W  
+                 1        2        3        4
+ 1.5N  / 50:     ....     ....  29.5035  29.4136
+ 1.17N / 49:     ....     ....  29.5373  29.4462
+ 0.83N / 48:     ....     ....  29.6002  29.4873
+ 0.5N  / 47:     ....     ....  29.6787  29.5361
+ 0.17N / 46:     ....     ....  29.7929  29.5858
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                85W      80W      75W      70W      65W      60W      55W      50W      45W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....     ....     ....  29.4009     ....     ....     ....     ....
+ 1.17N / 49:     ....     ....     ....     ....  29.4259     ....     ....     ....     ....
+ 0.83N / 48:     ....     ....     ....     ....  29.4735     ....     ....     ....     ....
+ 0.5N  / 47:     ....     ....     ....     ....  29.5338     ....     ....     ....     ....
+ 0.17N / 46:     ....     ....     ....     ....  29.5939     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W    
+                 1        2        3
+ 1.5N  / 50:  27.2194  27.9470     ....
+ 1.17N / 49:  27.1122  27.8883     ....
+ 0.83N / 48:  26.9645  27.7639     ....
+ 0.5N  / 47:  26.7776  27.5584     ....
+ 0.17N / 46:  26.5410  27.2770     ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W      66W    
+                 1        2        3        4
+ 1.5N  / 50:  27.2194  27.9470     ....  29.3528
+ 1.17N / 49:  27.1122  27.8883     ....  29.3882
+ 0.83N / 48:  26.9645  27.7639     ....  29.4644
+ 0.5N  / 47:  26.7776  27.5584     ....  29.5482
+ 0.17N / 46:  26.5410  27.2770     ....  29.6283
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                92W      89W      86W      83W      80W      77W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....  27.3039  27.5576  27.8497     ....     ....
+ 1.17N / 49:     ....  27.1874  27.4131  27.7695     ....     ....
+ 0.83N / 48:     ....  27.0366  27.2528  27.6362     ....     ....
+ 0.5N  / 47:     ....  26.8545  27.0851  27.4401     ....     ....
+ 0.17N / 46:     ....  26.6303  26.8980  27.1822     ....     ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               101W      95W      89W      83W      77W      71W      65W      59W      53W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....  27.3039  27.8497     ....     ....  29.3867     ....     ....
+ 1.17N / 49:     ....     ....  27.1874  27.7695     ....     ....  29.4183     ....     ....
+ 0.83N / 48:     ....     ....  27.0366  27.6362     ....     ....  29.4828     ....     ....
+ 0.5N  / 47:     ....     ....  26.8545  27.4401     ....     ....  29.5548     ....     ....
+ 0.17N / 46:     ....     ....  26.6303  27.1822     ....     ....  29.6233     ....     ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+ 15-JAN-1982 00 / 1:  27.7767
+ 21-JAN-1982 00 / 2:  27.7818
+ 27-JAN-1982 00 / 3:  27.6992
+ 02-FEB-1982 00 / 4:  27.8253
+ 08-FEB-1982 00 / 5:  27.7319
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.7767
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX004)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G007_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+         FCN_NOR   FCN_REV
+J /  1:  0.633194 -0.633194
+J /  2:  0.645479 -0.645479
+J /  3:  0.499729 -0.499729
+J /  4:  0.231628 -0.231628
+J /  5: -0.093184  0.093184
+J /  6: -0.395181  0.395181
+J /  7: -0.600424  0.600424
+J /  8: -0.658663  0.658663
+J /  9: -0.555637  0.555637
+J / 10: -0.316573  0.316573
+J / 11:  0.000000  0.000000
+J / 12:  0.316573 -0.316573
+J / 13:  0.555637 -0.555637
+J / 14:  0.658663 -0.658663
+J / 15:  0.600424 -0.600424
+J / 16:  0.395181 -0.395181
+J / 17:  0.093184 -0.093184
+J / 18: -0.231628  0.231628
+J / 19: -0.499729  0.499729
+J / 20: -0.645479  0.645479
+J / 21: -0.633194  0.633194
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+               180E    
+                51
+ 8N   / 19:  0.499729
+ 7N   / 18:  0.231628
+ 6N   / 17: -0.093184
+ 5N   / 16: -0.395181
+ 4N   / 15: -0.600424
+ 3N   / 14: -0.658663
+ 2N   / 13: -0.555637
+ 1N   / 12: -0.316573
+ 0    / 11:  0.000000
+ 1S   / 10:  0.316573
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 57 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=@ave]   ! no target grid specified
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 55 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,g=w]   ! more than 1 target grid
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 45 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 43 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 39 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 36 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 33 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ reading TEMP     M: 22 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 16 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 10 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  7 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M: 27 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M: 27 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 49 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6373  25.0615  25.4410
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8705  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6495
+ 1N    / 48:  24.1494  24.2321  24.4464  24.8164  25.1767  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6691  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 18 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 48 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 40 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:  6 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 37 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 32 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2012  24.2556  24.4066  24.7485  25.2133  25.5037
+ 1N    / 48:  24.0581  24.0827  24.1835  24.4473  24.8567  25.1333
+ 0.67N / 47:  23.9772  23.9643  23.9994  24.1601  24.4838  24.7472
+ 0.33N / 46:  23.9584  23.9040  23.8788  23.9333  24.1419  24.3790
+ 0     / 45:  24.0357  23.9390  23.8536  23.8172  23.9069  24.0855
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9325  23.9890  24.1393  24.4928  25.0067  25.3582
+ 1N    / 48:  23.7314  23.7626  23.8716  24.1488  24.6053  24.9421
+ 0.67N / 47:  23.5951  23.5875  23.6312  23.8060  24.1706  24.4921
+ 0.33N / 46:  23.5385  23.4834  23.4619  23.5233  23.7598  24.0491
+ 0     / 45:  23.6210  23.5135  23.4199  23.3768  23.4767  23.6893
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  1 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2921  24.2593  24.2798  24.4459  24.8288  25.2942
+ 1N    / 48:  24.1296  24.0952  24.0995  24.2165  24.5387  24.9629
+ 0.67N / 47:  24.0124  23.9735  23.9541  24.0061  24.2416  24.6067
+ 0.33N / 46:  23.9590  23.9098  23.8662  23.8516  23.9772  24.2614
+ 0     / 45:  23.9901  23.9230  23.8503  23.7816  23.8003  23.9828
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0517  24.0117  24.0305  24.1957  24.5888  25.1042
+ 1N    / 48:  23.8384  23.7998  23.8085  23.9326  24.2677  24.7399
+ 0.67N / 47:  23.6606  23.6190  23.6065  23.6697  23.9240  24.3347
+ 0.33N / 46:  23.5549  23.5048  23.4677  23.4600  23.6025  23.9282
+ 0     / 45:  23.5662  23.4962  23.4251  23.3553  23.3775  23.5902
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2879  24.3481  24.5174  24.8892  25.3674  25.6544
+ 1N    / 48:  24.1297  24.1691  24.2950  24.5979  25.0350  25.3185
+ 0.67N / 47:  24.0177  24.0235  24.0914  24.3037  24.6703  24.9403
+ 0.33N / 46:  23.9678  23.9342  23.9391  24.0467  24.3128  24.5631
+ 0     / 45:  23.9971  23.9215  23.8662  23.8753  24.0244  24.2322
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0365  24.0951  24.2619  24.6460  25.1734  25.5187
+ 1N    / 48:  23.8319  23.8758  24.0055  24.3208  24.8060  25.1502
+ 0.67N / 47:  23.6632  23.6751  23.7514  23.9774  24.3880  24.7171
+ 0.33N / 46:  23.5668  23.5355  23.5465  23.6647  23.9652  24.2706
+ 0     / 45:  23.5798  23.4985  23.4409  23.4500  23.6182  23.8692
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 52 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 56 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.1864  24.1787  24.2594  24.5105  24.9134  25.2830
+ 1N    / 48:  24.0384  24.0160  24.0566  24.2448  24.5882  24.9167
+ 0.67N / 47:  23.9476  23.9116  23.9036  24.0029  24.2600  24.5428
+ 0.33N / 46:  23.9212  23.8644  23.8142  23.8259  23.9786  24.2058
+ 0     / 45:  23.9919  23.9089  23.8177  23.7561  23.8046  23.9579
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9233  23.9145  23.9973  24.2541  24.6864  25.1105
+ 1N    / 48:  23.7149  23.6938  23.7438  23.9462  24.3212  24.7033
+ 0.67N / 47:  23.5646  23.5317  23.5324  23.6475  23.9375  24.2709
+ 0.33N / 46:  23.4951  23.4409  23.3953  23.4150  23.5931  23.8658
+ 0     / 45:  23.5673  23.4804  23.3851  23.3179  23.3746  23.5590
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2284  24.3311  24.5775  24.9809  25.3585  25.4979
+ 1N    / 48:  24.0704  24.1331  24.3154  24.6520  24.9950  25.1205
+ 0.67N / 47:  23.9708  23.9819  24.0798  24.3220  24.6155  24.7426
+ 0.33N / 46:  23.9312  23.8914  23.9061  24.0376  24.2605  24.3979
+ 0     / 45:  23.9874  23.8963  23.8354  23.8620  23.9962  24.1237
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9608  24.0642  24.3160  24.7497  25.1824  25.3725
+ 1N    / 48:  23.7470  23.8171  24.0102  24.3770  24.7737  24.9496
+ 0.67N / 47:  23.5913  23.6093  23.7186  23.9883  24.3314  24.5067
+ 0.33N / 46:  23.5110  23.4726  23.4926  23.6415  23.9044  24.0873
+ 0     / 45:  23.5673  23.4667  23.3983  23.4267  23.5830  23.7431
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 20 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 44 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 41 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7799  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5330  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2438  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9739  25.1064
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 35 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:  9 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2029  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  5 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 47 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7800  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5331  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2439  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9740  25.1065
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 50 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3316  24.1982  24.1149  24.1101  24.2698  24.6194
+ 1N    / 48:  24.1534  24.0459  23.9640  23.9283  24.0343  24.3289
+ 0.67N / 47:  24.0296  23.9427  23.8693  23.8085  23.8334  24.0392
+ 0.33N / 46:  23.9776  23.9013  23.8273  23.7484  23.7068  23.8063
+ 0     / 45:  24.0264  23.9547  23.8708  23.7728  23.6845  23.6853
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0998  23.9419  23.8502  23.8473  24.0126  24.3725
+ 1N    / 48:  23.8568  23.7289  23.6389  23.6068  23.7315  24.0484
+ 0.67N / 47:  23.6628  23.5633  23.4870  23.4278  23.4670  23.7064
+ 0.33N / 46:  23.5593  23.4735  23.4013  23.3239  23.2836  23.4092
+ 0     / 45:  23.6053  23.5232  23.4384  23.3380  23.2391  23.2432
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 58 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3718  24.2759  24.2381  24.3143  24.5845  24.9998
+ 1N    / 48:  24.1915  24.1099  24.0666  24.1084  24.3268  24.6951
+ 0.67N / 47:  24.0557  23.9849  23.9336  23.9307  24.0730  24.3751
+ 0.33N / 46:  23.9834  23.9165  23.8564  23.8115  23.8637  24.0759
+ 0     / 45:  23.9966  23.9258  23.8496  23.7701  23.7430  23.8530
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1479  24.0348  23.9902  24.0651  24.3406  24.7844
+ 1N    / 48:  23.9151  23.8193  23.7735  23.8199  24.0509  24.4498
+ 0.67N / 47:  23.7150  23.6338  23.5826  23.5862  23.7461  24.0841
+ 0.33N / 46:  23.5857  23.5123  23.4548  23.4139  23.4780  23.7252
+ 0     / 45:  23.5750  23.4974  23.4222  23.3420  23.3139  23.4455
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2986  24.3714  24.5593  24.9405  25.4006  25.6571
+ 1N    / 48:  24.1387  24.1885  24.3309  24.6454  25.0684  25.3212
+ 0.67N / 47:  24.0238  24.0371  24.1191  24.3444  24.7020  24.9439
+ 0.33N / 46:  23.9705  23.9413  23.9571  24.0777  24.3415  24.5694
+ 0     / 45:  23.9960  23.9223  23.8745  23.8951  24.0474  24.2410
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0465  24.1179  24.3048  24.7018  25.2123  25.5259
+ 1N    / 48:  23.8411  23.8950  24.0422  24.3726  24.8452  25.1571
+ 0.67N / 47:  23.6700  23.6890  23.7799  24.0219  24.4252  24.7240
+ 0.33N / 46:  23.5701  23.5428  23.5650  23.6985  23.9987  24.2798
+ 0     / 45:  23.5791  23.4988  23.4489  23.4714  23.6448  23.8804
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2294  24.1666  24.1789  24.3348  24.6565  25.0363
+ 1N    / 48:  24.0720  24.0100  23.9961  24.1004  24.3654  24.6946
+ 0.67N / 47:  23.9687  23.9085  23.8682  23.9032  24.0827  24.3496
+ 0.33N / 46:  23.9312  23.8643  23.7997  23.7720  23.8569  24.0495
+ 0     / 45:  23.9912  23.9110  23.8200  23.7410  23.7390  23.8465
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9767  23.9044  23.9159  24.0764  24.4158  24.8366
+ 1N    / 48:  23.7576  23.6884  23.6775  23.7944  24.0849  24.4571
+ 0.67N / 47:  23.5912  23.5281  23.4913  23.5379  23.7453  24.0569
+ 0.33N / 46:  23.5068  23.4390  23.3774  23.3540  23.4579  23.6911
+ 0     / 45:  23.5656  23.4806  23.3868  23.3018  23.3015  23.4336
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2444  24.3616  24.6223  25.0230  25.3769  25.4884
+ 1N    / 48:  24.0827  24.1577  24.3539  24.6907  25.0127  25.1114
+ 0.67N / 47:  23.9782  23.9985  24.1095  24.3557  24.6332  24.7370
+ 0.33N / 46:  23.9336  23.8998  23.9253  24.0636  24.2777  24.3972
+ 0     / 45:  23.9847  23.8969  23.8444  23.8789  24.0106  24.1269
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9764  24.0949  24.3635  24.7971  25.2062  25.3654
+ 1N    / 48:  23.7597  23.8423  24.0513  24.4207  24.7960  24.9418
+ 0.67N / 47:  23.5993  23.6266  23.7505  24.0264  24.3532  24.5021
+ 0.33N / 46:  23.5136  23.4812  23.5130  23.6709  23.9254  24.0877
+ 0     / 45:  23.5643  23.4665  23.4073  23.4453  23.5998  23.7470
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 62 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 64 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 66 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3636  24.2466  24.2047  24.2944  24.5700  24.9834
+ 1N    / 48:  24.1823  24.0808  24.0293  24.0856  24.3131  24.6721
+ 0.67N / 47:  24.0429  23.9555  23.8925  23.9012  24.0590  24.3508
+ 0.33N / 46:  23.9628  23.8852  23.8134  23.7743  23.8464  24.0554
+ 0     / 45:  23.9650  23.8885  23.8048  23.7281  23.7207  23.8377
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1405  24.0053  23.9571  24.0466  24.3282  24.7726
+ 1N    / 48:  23.9068  23.7900  23.7358  23.7995  24.0412  24.4324
+ 0.67N / 47:  23.7030  23.6045  23.5401  23.5583  23.7383  24.0672
+ 0.33N / 46:  23.5647  23.4813  23.4100  23.3756  23.4665  23.7136
+ 0     / 45:  23.5403  23.4591  23.3754  23.2961  23.2938  23.4386
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8829  23.9742  24.1489  24.3750  24.6256
+ 25-JAN-1982 00 / 3:  23.8850  23.9834  24.1657  24.3983  24.6503
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8838  23.9752  24.1501  24.3761  24.6265
+ 25-JAN-1982 00 / 3:  23.8774  23.9728  24.1535  24.3857  24.6381
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 72 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7485  23.7489  23.8463  24.0075  24.2057
+ 25-JAN-1982 00 / 3:  23.7481  23.7620  23.8678  24.0343  24.2309
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5859  29.5797  29.5756  29.5662  29.5590
+ 25-JAN-1982 00 / 3:  29.5787  29.5737  29.5698  29.5546  29.5421
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 76 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5747  29.5654  29.5513  29.5344  29.5265
+ 25-JAN-1982 00 / 3:  29.5636  29.5536  29.5355  29.5146  29.5054
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7784  23.7190  23.7799  23.9148  24.1031
+ 25-JAN-1982 00 / 3:  23.7745  23.7236  23.7888  23.9212  24.1104
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 80 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 82 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.9612  23.9499  24.0203  24.1507  24.3238
+ 25-JAN-1982 00 / 3:  23.9591  23.9559  24.0305  24.1636  24.3350
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 84 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7527  23.7638  23.8729  24.0446  24.2520
+ 25-JAN-1982 00 / 3:  23.7439  23.7321  23.8164  23.9658  24.1537
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 85 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 86 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 88 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 89 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 91 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 92 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 94 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 95 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 96 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 98 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 97 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 97 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 99 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:101 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:100 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:100 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:102 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:105 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:104 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:106 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:108 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:107 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:107 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:109 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:110 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:111 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:112 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:113 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:114 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:115 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:116 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:118 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:117 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:120 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:121 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:122 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 76   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:125 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:126 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 77   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:130 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:132 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 78   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:135 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:137 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M:138 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 79   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:141 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:142 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 80   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:146 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:148 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 81   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:151 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:153 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M:154 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 82   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:157 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:159 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 83   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:162 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 84   complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:167 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:169 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 85   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:172 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 86   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:177 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:180 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 87   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 88   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:188 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 89   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:191 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:192 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 90   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:194 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:196 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 91   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:197 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:198 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 92   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:201 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:202 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 93   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:204 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:206 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 94   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:207 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:208 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 95   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:211 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 96   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:214 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 97   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:217 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:219 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 98   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:220 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 99   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:223 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 100  complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 101  complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:231 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ reading TEMP     M:233 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ reading TEMP     M:235 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 102  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:238 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:239 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:241 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:242 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 103  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:244 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:247 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 104  complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:248 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:250 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 105  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:253 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:254 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:256 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:257 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 106  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:259 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:262 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 107  complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:263 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:265 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 108  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:268 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:270 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:271 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:273 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 109  complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 110  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:278 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:279 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:281 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:282 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 111  complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:284 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:287 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 112  complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:288 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:290 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 113  complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:293 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:295 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 114  complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  4.50000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at var] ! should be all missing
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ -DELETE X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  5.40000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at var]
+ -DELETE X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:       ....
+ 2.1 / 2:       ....
+ 3.1 / 3:       ....
+ 4.1 / 4:       ....
+ 5.1 / 5:  0.0900000
+ 6.1 / 6:       ....
+ 7.1 / 7:       ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 5.1 / 5:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  0.10000  0.90000     ....     ....
+ 5.1 / 5:     ....     ....     ....  0.90000  8.10000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.1000  11.0000     ....
+ 5.1 / 5:     ....     ....     ....  10.1000  10.2000  11.1000     ....
+ 6.1 / 6:     ....     ....     ....  11.0000  11.1000  12.0000     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....   0.1000   1.0100   0.9900     ....
+ 5.1 / 5:     ....     ....     ....   1.0100  10.2000   9.9900     ....
+ 6.1 / 6:     ....     ....     ....   0.9900   9.9900   9.7200     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1       2.1       3.1       4.1       5.1       6.1       7.1    
+               1         2         3         4         5         6         7
+ 1.1 / 1:      ....      ....      ....      ....      ....      ....      ....
+ 2.1 / 2:      ....      ....      ....      ....      ....      ....      ....
+ 3.1 / 3:      ....      ....      ....      ....      ....      ....      ....
+ 4.1 / 4:      ....      ....      ....      ....      ....      ....      ....
+ 5.1 / 5:      ....      ....      ....      ....  0.000000      ....      ....
+ 6.1 / 6:      ....      ....      ....      ....      ....      ....      ....
+ 7.1 / 7:      ....      ....      ....      ....      ....      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:303 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:301 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:302 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.50000
+ 6.1 / 6:  6.50000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MIN
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @SUM
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:   8.8500
+ 6.1 / 6:  12.2000
+ 7.1 / 7:   1.9500
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ -DELETE X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G008)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.50000
+ 2   / 2:  1.50000
+ 3   / 3:  2.50000
+ 4   / 4:  3.50000
+ 5   / 5:  5.50000
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:299 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:296 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:301 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  2.50000
+ 4   / 4:     ....
+ 5   / 5:     ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    3    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.50000
+list a5[gx=x5 at max,i=4]
+ -DELETE X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    4    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ -DELETE X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:296 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G006)           @MAX
+ eval    ATIME    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ regrid  ATIME    M:299 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset		! reordered reset before next test: 2/94
+cancel mode verify
+GO bn_axis_limits	! added 10/27/93
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! added 2/94
+ 
+!GO bn_reset
+!GO bn301_mem_mgmt
+MESSAGE/CONTINUE  ***** bn301_mem_mgmt has been removed from run_all.
+***** bn301_mem_mgmt has been removed from run_all.
+MESSAGE/CONTINUE  ***** Its too slow!!!
+***** Its too slow
+MESSAGE/CONTINUE  ***** Remember to run it separately
+***** Remember to run it separately
+ 
+GO bn_reset
+cancel mode verify
+GO bn_movie
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+ 
+! added in bn311
+GO bn_reset
+cancel mode verify
+GO bn_ez_order	! was bn311 until 9/95
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+              1        2     
+              1        2
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+ ---- K:2 Z:   2
+ 1   / 1:     ....     ....
+ 2   / 2:     ....     ....
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.20000
+ 2   / 2:  0.30000  0.40000
+ ---- K:2 Z:   2
+ 1   / 1:  0.50000  0.60000
+ 2   / 2:  0.70000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.00000
+ 2   / 2:  1.10000  1.20000
+ ---- K:2 Z:   2
+ 1   / 1:  1.30000  1.40000
+ 2   / 2:  1.50000  1.60000
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.50000
+ 2   / 2:  0.20000  0.60000
+ ---- K:2 Z:   2
+ 1   / 1:  0.30000  0.70000
+ 2   / 2:  0.40000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.30000
+ 2   / 2:  1.00000  1.40000
+ ---- K:2 Z:   2
+ 1   / 1:  1.10000  1.50000
+ 2   / 2:  1.20000  1.60000
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.020000
+ 2   / 2:  0.030000  0.040000
+ ---- K:2 Z:   2
+ 1   / 1:  0.050000  0.060000
+ 2   / 2:  0.070000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.100000
+ 2   / 2:  0.110000  0.120000
+ ---- K:2 Z:   2
+ 1   / 1:  0.130000  0.140000
+ 2   / 2:  0.150000  0.160000
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.050000
+ 2   / 2:  0.020000  0.060000
+ ---- K:2 Z:   2
+ 1   / 1:  0.030000  0.070000
+ 2   / 2:  0.040000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.130000
+ 2   / 2:  0.100000  0.140000
+ ---- K:2 Z:   2
+ 1   / 1:  0.110000  0.150000
+ 2   / 2:  0.120000  0.160000
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  1367.00
+ 2   / 2:  2357.00  2367.00
+ ---- K:2 Z:   2
+ 1   / 1:  1457.00  1467.00
+ 2   / 2:  2457.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  1368.00
+ 2   / 2:  2358.00  2368.00
+ ---- K:2 Z:   2
+ 1   / 1:  1458.00  1468.00
+ 2   / 2:  2458.00  2468.00
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+ 
+! added in bn312  6/3/94
+GO bn_reset
+cancel mode verify
+! cancel mode metafile   ! needed temporarily 6/94: PLOT+/XGKS interaction bug
+GO bn_user
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+set window 1		! clean up
+ 
+! added in bn420  1/96
+GO bn_reset
+cancel mode verify
+GO bn_stream
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:   1.0000   2.0000   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000  17.0000  18.0000  19.0000  20.0000
+ 3   / 3:  21.0000  22.0000  23.0000  24.0000  25.0000  26.0000  27.0000  28.0000  29.0000  30.0000
+ 4   / 4:  31.0000  32.0000  33.0000  34.0000  35.0000  36.0000  37.0000  38.0000  39.0000  40.0000
+ 5   / 5:  41.0000  42.0000  43.0000  44.0000  45.0000  46.0000  47.0000  48.0000  49.0000  50.0000
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+              MYV1    MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.0000  31.0000
+2    /  2:  12.0000  32.0000
+3    /  3:  13.0000  33.0000
+4    /  4:  14.0000  34.0000
+5    /  5:  15.0000  35.0000
+6    /  6:  16.0000  36.0000
+7    /  7:  17.0000  37.0000
+8    /  8:  18.0000  38.0000
+9    /  9:  19.0000  39.0000
+10   / 10:  20.0000  40.0000
+ ---- J:2 Y:   2
+1    /  1:  21.0000  41.0000
+2    /  2:  22.0000  42.0000
+3    /  3:  23.0000  43.0000
+4    /  4:  24.0000  44.0000
+5    /  5:  25.0000  45.0000
+6    /  6:  26.0000  46.0000
+7    /  7:  27.0000  47.0000
+8    /  8:  28.0000  48.0000
+9    /  9:  29.0000  49.0000
+10   / 10:  30.0000  50.0000
+cancel data stream_data_link.unf
+ 
+ 
+!added in bn430 9/96 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_mc
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     T (hour)             6 r   366                  4018.4
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              730.485    731.2425
+       3>  1826.97               730.485    1461.727
+       4>  2557.455              730.485    2192.213
+       5>  3287.94               730.485    2922.698
+       6>  4018.425              730.485    3653.182
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 1827   / 3:  28.2710  28.1010  27.1568  26.6065  26.5793  27.1318  27.1135  27.1007
+ 2557.5 / 4:  28.3570  28.5412  27.6643  27.2819  27.1998  27.4282  27.5459  27.4002
+ 3287.9 / 5:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+ 4018.4 / 6:  28.0824  27.9723  27.7204  26.8768  26.9810  27.7220  28.0643  27.8845
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 1827   / 3:  27.9375  27.9731  27.8331  27.5333  27.0461  27.2091  27.2154  27.0734  26.8618  26.6585
+ 2557.5 / 4:  27.9532  27.8072  27.9180  27.9515  27.7807  27.6695  27.5253  27.3922  27.3396  27.2409
+ 3287.9 / 5:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 4018.4 / 6:  28.1912  28.2880  28.4249  28.1785  27.8359  27.8262  27.5394  27.3811  27.1444  27.0317
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     T (hour)             3 i   366                  3287.9
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              1460.97    731.2425
+       3>  3287.94               2191.455   2192.213
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 3287.9 / 3:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 3287.9 / 3:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-T (hour))
+      ... listing every  14th point
+                21E      49E      77E     105E     133E     161E     171W     143W     115W      87W      59W      31W      3W     
+                 1       15       29       43       57       71       85       99      113      127      141      155      169
+ ---- L:1 T:   366
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75N   / 83:   1.5550     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73N   / 82:   3.7205   0.5871     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.0000
+ 71N   / 81:   5.0934   0.6186     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   4.1287
+ 69N   / 80:   5.4500   0.4500     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.0000   4.8885
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   4.3120   4.5952
+ 65N   / 78:   0.0718     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.8767   5.0952   5.2194
+ 63N   / 77:   0.5111     ....     ....     ....     ....     ....  -0.8467     ....     ....     ....   0.8500   5.9579   6.4264
+ 61N   / 76:   1.2269     ....     ....     ....     ....   0.3500   0.1214   6.0000     ....     ....   0.8000   6.2213   8.1800
+ 59N   / 75:   2.9000     ....     ....     ....     ....   1.1500   1.6321   5.7458     ....     ....   2.7033   7.3962   7.6307
+ 57N   / 74:   3.0388     ....     ....     ....     ....   1.1250   2.8750   5.2914     ....     ....   0.5308   7.5317   6.4543
+ 55N   / 73:   3.2013     ....     ....     ....     ....   0.6459   3.6936   5.2583     ....     ....  -0.4622   7.4551   6.5806
+ 53N   / 72:     ....     ....     ....     ....     ....   1.1996   4.2880   5.7998     ....     ....   1.2333   7.7514   7.1047
+ 51N   / 71:     ....     ....     ....     ....     ....   2.1893   4.2290   6.2278     ....     ....  -0.2905  10.2702   9.3957
+ 49N   / 70:     ....     ....     ....     ....     ....   2.5412   4.6069   6.6250     ....   3.0125   0.6527  11.6186  10.2970
+ 47N   / 69:     ....     ....     ....     ....     ....   2.9602   5.5956   7.6881     ....   3.1794   1.2426  12.6823  11.3385
+ 45N   / 68:     ....   3.3167     ....     ....     ....   4.4480   7.0744   8.9556     ....   3.4525   2.2314  13.7819  12.2254
+ 43N   / 67:     ....   4.7221     ....     ....   2.4068   6.9255   8.9646  10.3486     ....   3.1277   6.3709  14.7211  13.0557
+ 41N   / 66:     ....   4.8365     ....     ....   4.3635   9.6898  10.9751  11.9288     ....     ....  15.5498  15.4318     ....
+ 39N   / 65:  15.4366   8.6262     ....     ....   8.8837  12.8097  12.5484  13.4077     ....     ....  18.6870  16.2119     ....
+ 37N   / 64:  16.0318   8.0667     ....     ....  12.3600  15.0324  13.9800  15.0021     ....     ....  19.2616  17.1874  15.1152
+ 35N   / 63:  16.2507     ....     ....     ....  13.3810  16.7364  15.4538  16.4689     ....     ....  19.5398  18.1828  15.5754
+ 33N   / 62:  16.7783     ....     ....     ....  18.5491  18.0244  16.8419  17.7790     ....     ....  20.1041  19.2886     ....
+ 31N   / 61:  17.9786     ....     ....     ....  19.9407  19.3074  18.5523  19.1648  17.8500  17.4183  20.8400  20.0450     ....
+ 29N   / 60:     ....  18.9119     ....     ....  20.5019  20.6291  20.1257  20.1026  16.8274  20.6176  22.0740  20.6790     ....
+ 27N   / 59:     ....  20.8300     ....     ....  21.3326  22.0026  21.6086  20.9032  17.8323  23.7582  23.1533  21.5070     ....
+ 25N   / 58:     ....     ....     ....     ....  22.3495  23.8248  23.2779  21.5841  18.8269  24.8593  24.0919  22.3336     ....
+ 23N   / 57:     ....     ....     ....     ....  23.6807  25.0783  24.0186  22.3034  20.2700  25.5195  24.7930  22.7905     ....
+ 21N   / 56:     ....     ....     ....     ....  24.7072  25.9688  24.7256  22.9079  22.0270  26.4860  25.3493  22.9386     ....
+ 19N   / 55:     ....     ....     ....  22.6383  25.9015  26.6802  25.6078  23.5313  23.8074  27.0339  25.8612  23.4342     ....
+ 17N   / 54:     ....     ....     ....     ....  26.8579  27.0091  25.9585  24.1694  25.2841  27.0695  26.1928  23.8282     ....
+ 15N   / 53:     ....  25.4074     ....     ....  27.4243  27.0312  26.1212  24.8069  26.3029  26.9280  26.3665  24.2289     ....
+ 13N   / 52:     ....  25.3684     ....     ....  27.7591  27.2962  26.4994  25.1181  26.6522  26.8229  26.6502  24.8118     ....
+ 11N   / 51:     ....  25.8188  27.8253  27.8789  27.8781  27.9126  26.8606  25.7058  27.0455  26.2577  26.8927  25.3867     ....
+ 9N    / 50:     ....  27.2000  27.8411  26.3897  28.1118  28.0045  27.4964  26.6136  26.7775  26.8093  27.0323  25.9038     ....
+ 7N    / 49:     ....  26.1127  27.5677  26.0238  28.0494  28.7383  27.8221  27.0807  26.9304  27.5097  26.8869  26.5924     ....
+ 5N    / 48:     ....  26.1020  27.8127  26.5939  28.3079  28.7465  28.1379  27.1305  27.5967  27.5257     ....  26.9872  27.8152
+ 3N    / 47:     ....  26.2525  27.9241  26.8579  28.5464  28.9967  27.6071  26.2341  25.5129  27.0847     ....  27.0516  28.3003
+ 1N    / 46:     ....  26.4437  28.2462  27.2532  28.7823  28.7893  27.5856  25.9683  24.2075  25.8155     ....  27.0482  27.9197
+ 1S    / 45:     ....  27.0068  28.1397  27.7957  28.9633  29.1200  27.9352  26.0170  24.4768  24.9226     ....  27.0957  27.0229
+ 3S    / 44:     ....  27.6137  28.2304  27.5868  28.9390  29.4694  27.9904  26.2519  24.6900  24.9094     ....  27.1568  26.8912
+ 5S    / 43:     ....  28.2419  28.1710  28.0148  28.8535  29.6225  28.6900  26.6985  24.8254  25.1700     ....  27.1489  26.2070
+ 7S    / 42:     ....  28.7080  28.1502  28.3020  28.9045  29.3650  29.1496  27.0025  25.1069  24.9153     ....  27.3142  25.4034
+ 9S    / 41:     ....  28.4648  28.3721  28.3145  28.9483  29.3450  28.9944  28.0900  25.3219  24.4950     ....  27.2335  24.8536
+ 11S   / 40:     ....  28.0725  28.3709  28.1023  29.6033  29.3462  29.1837  28.2076  25.4194  24.1157     ....  27.2170  24.0960
+ 13S   / 39:     ....  28.1510  28.0187  27.8073  30.0000  29.1755  29.0507  28.1889  25.3569  23.7371     ....  27.3476  23.4967
+ 15S   / 38:     ....  28.0800  27.7714  27.2320     ....  28.6954  28.8358  28.2165  25.5737  22.9877     ....  27.0100  23.0127
+ 17S   / 37:     ....  28.2857  26.9409  26.4882     ....  28.2425  28.1673  27.9296  25.5046  22.3944     ....  26.7405  22.9133
+ 19S   / 36:     ....  27.6122  26.1967  25.0514     ....  27.7552  27.8560  27.5000  25.4854  21.0467     ....  26.6053  22.7264
+ 21S   / 35:     ....  27.5942  25.6929  24.4583     ....  26.3083  26.9939  27.2162  25.5969  21.8550     ....  26.4333  22.5890
+ 23S   / 34:     ....  27.0610  25.3542  23.6893     ....  26.0250  26.0238  26.6869  25.5377  21.5647     ....  26.5500  22.9482
+ 25S   / 33:     ....  26.6974  25.2817  22.6691     ....  25.5528  25.4389  25.4775  25.2041  21.3664     ....  25.4338  23.1510
+ 27S   / 32:     ....  25.8897  24.5000  22.1500     ....  24.8603  24.1297  24.3742  24.8067  21.0300     ....  24.8628  22.9100
+ 29S   / 31:     ....  24.6453  23.8583  21.1592     ....  24.0408  23.2608  23.1950  24.4300  21.1500     ....  23.4096  22.5004
+ 31S   / 30:     ....  23.8611  22.6739  20.5028     ....  23.2794  21.8597  21.8462  22.7130  21.3700     ....  22.5936  22.0041
+ 33S   / 29:     ....  22.1584  21.2131  19.2542  18.8470  22.4742  20.8053  20.6944  22.4667  20.3670     ....  20.5743  20.8167
+ 35S   / 28:  21.0773  20.5794  19.8725  18.4359  18.1523  22.1463  20.1823  19.6000  20.4500  19.2450  21.7333  19.9441  19.5977
+ 37S   / 27:  21.2868  19.1969  17.8018  16.7463  16.9175  20.0833  19.0935  18.1643  18.1575  18.4543     ....  18.6379  17.6856
+ 39S   / 26:  20.7459  17.5123  15.9600  14.8400  16.3010  18.3956  18.3997  16.9135  16.9625  17.0514  18.6879  16.7446  15.4764
+ 41S   / 25:  16.4473  14.4439  14.4573  13.5944  14.4030  17.4141  17.2206  15.2329     ....  15.7317  16.7885  14.7942  12.6567
+ 43S   / 24:  14.3660   8.5494  12.8214  11.9753  13.3524  15.0229  16.4218  13.6950     ....  13.6375  13.9769  12.5075  10.4100
+ 45S   / 23:   8.4925   7.5150  11.1860  10.5093  11.8445  13.9774  14.9780  13.0112     ....  12.0000  12.2990  10.5100   7.9967
+ 47S   / 22:   6.0621   5.7733   7.4400   9.0110  10.8888  13.2065  13.4630  11.6550     ....  10.2400  11.1783   8.6200   6.4500
+ 49S   / 21:   4.4209   4.2067   6.0325   6.1945   9.7129  10.8775  12.9344     ....     ....   9.3675  10.3435   5.2987   4.5450
+ 51S   / 20:   1.8375   3.6387   3.1564   5.7656   8.0480  10.0143  11.0070  10.9750     ....   9.2000   9.8156   3.6350   2.5350
+ 53S   / 19:   1.0891   2.8667   2.1950   4.1600   6.5630   9.4455   9.7660     ....     ....   8.5500   8.5604   2.1900   1.0550
+ 55S   / 18:   0.6469   2.6750   2.3478   4.1000   5.1560   6.5700   8.0000     ....   7.8000   7.8786   6.9458   1.3933   0.5425
+ 57S   / 17:   0.4114   2.0529   1.8425   2.4260   4.2929   4.7383   7.0125   3.9825     ....   6.8667   5.7852   0.7771   0.5529
+ 59S   / 16:   0.6236   1.3700   1.4776   2.0189   3.2000   4.0325   4.4000   1.8360     ....   6.5150   2.7940   0.0694   0.0558
+ 61S   / 15:   0.8438   1.3312   1.2144   1.2400   1.9900   2.2237   3.2143   0.8080   3.6867     ....   1.6781   0.0830   0.6620
+ 63S   / 14:   0.8813   0.7700   1.1575   0.4750   1.2344   1.1619   1.6000   0.5280   2.3275   3.4000   1.1667  -0.3333   0.4050
+ 65S   / 13:   0.3667  -0.0356   0.8123   0.0871   0.1521   0.3286   0.5200   0.4550   0.5067   1.8325  -0.9000  -0.5500   0.2060
+ 67S   / 12:  -0.6667  -0.9250   0.5317     ....     ....  -0.3906  -0.0233  -1.2000  -0.1537   0.8722     ....  -0.2533   0.2300
+ 69S   / 11:   0.0425     ....   1.2033     ....     ....  -0.6200  -0.1364     ....  -0.4150   0.1786     ....   0.5000   0.0700
+ 71S   / 10:     ....     ....     ....     ....     ....     ....  -0.7040   0.0000     ....     ....     ....  -1.0167  -1.0100
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -0.3500     ....     ....     ....     ....  -1.2000     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -1.1750     ....     ....     ....     ....  -0.4233     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6250     ....     ....     ....     ....  -0.8678     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:2 T:   1096.5
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.0000
+ 75N   / 83:   2.5283     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -1.5500
+ 73N   / 82:   4.0984   0.3050     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.1087
+ 71N   / 81:   4.6724   0.1046     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.7960
+ 69N   / 80:   4.1971   0.0000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.8097
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   3.7596   4.3979
+ 65N   / 78:  -0.0625     ....     ....     ....     ....     ....  -0.2000     ....     ....     ....   0.4221   4.4633   4.8655
+ 63N   / 77:   0.0745     ....     ....     ....     ....     ....  -1.7560     ....     ....     ....  -0.2712   5.8617   6.3740
+ 61N   / 76:   0.4814     ....     ....     ....     ....   2.4947  -1.5404   4.7000     ....     ....   2.1750   6.4468   7.9008
+ 59N   / 75:   1.6399     ....     ....     ....     ....   2.0000   0.0008   5.2586     ....     ....   1.3824   7.0788   6.9452
+ 57N   / 74:   2.0350     ....     ....     ....     ....   1.0500   2.0321   4.7989     ....     ....   1.5986   7.2850   5.6111
+ 55N   / 73:   2.0609     ....     ....     ....     ....   0.2492   3.3744   4.9032     ....     ....   1.1250   7.1357   5.8718
+ 53N   / 72:     ....     ....     ....     ....     ....   0.6807   3.7572   5.4648     ....     ....  -2.2000   7.5902   6.5032
+ 51N   / 71:     ....     ....     ....     ....     ....   1.6469   3.7090   5.7799     ....     ....  -1.1807  10.0328   8.4741
+ 49N   / 70:     ....     ....     ....     ....     ....   1.8588   4.3120   6.2452     ....     ....  -0.3648  11.3871   9.5089
+ 47N   / 69:     ....     ....     ....     ....     ....   2.3163   5.1206   7.3744     ....   1.9691  -0.0062  12.2219  10.1338
+ 45N   / 68:     ....   3.6500     ....     ....     ....   3.6392   6.7455   8.6209     ....   2.8224   0.9671  13.4022  11.7268
+ 43N   / 67:     ....   4.6473     ....     ....   1.3648   5.8679   8.5111   9.8453     ....   2.4835   5.0119  14.2248  12.1942
+ 41N   / 66:     ....   4.7861     ....     ....   3.0570   8.4719  10.3051  11.4213     ....     ....  14.7565  15.0002     ....
+ 39N   / 65:  15.0270   8.4385     ....     ....   7.3566  11.4912  12.1752  12.8504     ....     ....  18.0116  15.7098     ....
+ 37N   / 64:  15.3211     ....     ....     ....  10.8839  13.7783  13.3446  14.3616     ....     ....  18.5301  16.5598  14.7798
+ 35N   / 63:  15.5386     ....     ....     ....  11.5113  15.5093  14.6245  15.8741     ....     ....  18.7629  17.4589  15.1510
+ 33N   / 62:  16.0085     ....     ....     ....  18.0727  16.9360  16.0912  17.1296     ....     ....  19.2839  18.5539     ....
+ 31N   / 61:  15.5003     ....     ....     ....  19.3688  18.1290  17.7404  18.4996  16.6805  17.1886  20.0995  19.3186     ....
+ 29N   / 60:     ....  17.9540     ....     ....  19.6179  19.5035  19.2114  19.5065  16.2029  20.0335  21.3973  20.0384     ....
+ 27N   / 59:     ....  19.2895     ....     ....  20.5089  21.1212  20.6266  20.3709  17.2076  23.4895  22.6302  20.8561     ....
+ 25N   / 58:     ....     ....     ....     ....  21.6717  22.9821  22.7977  21.2932  18.4958  24.6577  23.6045  21.6921     ....
+ 23N   / 57:     ....     ....     ....     ....  23.0715  24.4551  23.5951  22.2253  19.8338  25.2474  24.2970  22.1740     ....
+ 21N   / 56:     ....     ....     ....     ....  24.4908  25.3921  24.3804  22.7672  21.2780  25.9320  24.9042  22.6199     ....
+ 19N   / 55:     ....     ....     ....  21.9809  25.6218  26.2087  25.0433  23.4827  23.0766  26.7496  25.4450  22.7637     ....
+ 17N   / 54:     ....     ....     ....     ....  26.5571  26.5915  25.7194  24.1352  24.9649  26.7912  25.7799  22.9853     ....
+ 15N   / 53:     ....  25.4092     ....     ....  27.2200  26.8560  25.9733  24.7324  26.0247  26.0114  26.0969  23.6629     ....
+ 13N   / 52:     ....  25.4771     ....     ....  27.5037  27.5150  26.1672  25.1314  26.5769  26.9127  26.4016  24.1635     ....
+ 11N   / 51:     ....  25.9857  28.0015  26.7764  27.5853  27.5652  26.8019  25.7690  27.0738  26.0525  26.6473  24.7404     ....
+ 9N    / 50:     ....  26.4544  28.2288  26.5501  27.7983  28.1491  27.4758  26.8996  26.9893  26.8687  26.7045  25.5850     ....
+ 7N    / 49:     ....  26.2609  27.8816  26.4870  27.6868  28.5162  27.7850  27.0898  27.0539  28.0777  26.7957  26.6243     ....
+ 5N    / 48:     ....  26.4131  27.9713  26.8734  27.7794  28.6949  27.8279  26.7964  26.6060  28.0647     ....  26.8913  28.0427
+ 3N    / 47:     ....  26.5913  28.1749  26.9865  28.4875  29.1712  27.8616  26.6257  26.2312  27.7434     ....  27.1225  28.5353
+ 1N    / 46:     ....  26.8491  28.6115  27.3775  28.2466  28.9555  27.5331  26.4050  26.4266  26.5208     ....  27.2455  28.5152
+ 1S    / 45:     ....  27.3064  28.4080  27.9040  28.4680  29.2010  27.7261  26.4751  24.6569  26.0235     ....  27.4196  27.9833
+ 3S    / 44:     ....  27.9602  28.2742  28.3296  28.8893  29.5794  28.3834  26.5213  25.4925  26.6125     ....  27.6638  27.3859
+ 5S    / 43:     ....  28.2396  28.0572  28.3176  28.7901  29.3721  28.2957  26.7982  25.7981  26.6252     ....  27.6334  27.2052
+ 7S    / 42:     ....  28.6815  28.2612  28.2786  28.7463  29.4168  28.8967  27.4410  26.1729  26.5534     ....  27.7374  26.6993
+ 9S    / 41:     ....  28.4790  28.3137  28.5841  28.7040  29.4256  29.1270  28.3372  25.9400  25.9795     ....  27.6607  26.1480
+ 11S   / 40:     ....  28.2829  28.6414  28.3339  29.3503  29.1771  29.1492  28.2032  25.9871  25.9624     ....  27.5419  25.5310
+ 13S   / 39:     ....  28.3226  28.3738  28.5679     ....  29.0269  29.1852  28.3130  25.7940  25.0490     ....  27.3347  25.0641
+ 15S   / 38:     ....  27.6600  28.2896  27.7713     ....  28.8387  29.0820  28.4626  25.9384  24.0311     ....  27.4378  24.5993
+ 17S   / 37:     ....  28.0370  27.5108  27.3368     ....  28.5764  28.4527  27.9555  26.0744  23.1143     ....  27.5051  24.0454
+ 19S   / 36:     ....  27.7741  27.0157  26.4074     ....  28.0387  28.2036  28.0002  26.1485  23.5125     ....  27.4665  23.8172
+ 21S   / 35:     ....  27.5781  26.3341  25.2805     ....  26.9356  27.5820  27.6097  26.0473  22.5984     ....  27.0379  23.6919
+ 23S   / 34:     ....  27.4302  26.2267  24.4780     ....  26.2735  26.9770  26.9149  25.9504  22.6780     ....  27.2712  23.6569
+ 25S   / 33:     ....  27.1106  25.3692  23.3572     ....  25.8933  25.9116  26.4028  25.5674  21.8153     ....  26.4321  23.8424
+ 27S   / 32:     ....  26.2136  25.2324  22.5225     ....  25.1302  24.7613  25.0533  25.4781  22.3270     ....  26.0936  23.3768
+ 29S   / 31:     ....  25.1187  23.9464  21.6124     ....  24.6507  24.1035  24.0470  24.7712  21.6070     ....  25.1327  23.1977
+ 31S   / 30:     ....  24.1655  22.8869  20.9082     ....  23.9437  22.8024  22.8395  23.8185  21.6885     ....  23.6302  22.7434
+ 33S   / 29:     ....  23.0193  21.8809  19.7883  19.8276  23.0018  21.7527  21.3169  21.5627  21.0475     ....  22.6172  21.4319
+ 35S   / 28:  20.9734  21.1547  20.7043  18.8851  18.9300  22.5357  20.8505  20.5353  22.0240  20.2323  22.8700  20.8750  20.1989
+ 37S   / 27:  21.7237  19.9086  18.4469  17.2227  17.7141  20.7386  19.8244  18.3687  19.8411  19.7704     ....  19.5269  18.6070
+ 39S   / 26:  22.0397  18.3765  16.5437  15.5140  17.0989  19.0830  18.8514  17.5866     ....  18.7405  19.1255  18.2102  15.7730
+ 41S   / 25:  17.8526  16.3651  15.5023  14.2290  15.4274  17.6752  17.4792  15.9576  18.1650  17.1268  17.4312  16.4894  13.9250
+ 43S   / 24:  13.4949   9.2836  13.3727  12.3420  13.9432  16.1595  17.0221  14.6650  16.3947  14.2424  14.2672  14.1820  10.6937
+ 45S   / 23:   8.3840   7.6307  11.6679  11.2457  12.8452  14.4788  15.0178  13.5082     ....  12.0600  12.7115  10.9652   8.1250
+ 47S   / 22:   6.7167   6.0540   8.2500   9.1190  10.9825  12.8255  13.8707  12.4650     ....  10.8575  11.1699   8.5767   5.5000
+ 49S   / 21:   4.8858   5.4150   5.9088   6.2255  10.1339  11.2443  12.5930  11.4167     ....  10.0842  10.6338   7.4442   4.9572
+ 51S   / 20:   2.3210   3.9822   3.9846   5.7576   7.7675   9.9738  10.8426  10.1840     ....  10.0000  10.2138   5.1999   3.5755
+ 53S   / 19:   1.6715   3.2515   2.9610   4.1500   6.9224   8.5819   9.1357     ....     ....   8.1500   8.4738   3.8071   2.1017
+ 55S   / 18:   1.3318   3.1000   2.6454   3.0000   5.7914   6.1994   7.9489   6.6000     ....   7.7692   7.2001   1.8440   1.0135
+ 57S   / 17:   0.9767   1.9018   1.9953   2.7540   5.2543   4.5237   6.5740   3.7000     ....   7.5635   6.0275   1.7052   1.1491
+ 59S   / 16:   1.1588   2.1100   1.9107   2.7212   3.8002   3.8360   4.9089   1.7892     ....   6.7092   3.6242   1.2592   0.7025
+ 61S   / 15:   0.9937   1.7382   1.5836   2.3000   3.0766   2.3196   3.4012   1.9993     ....   4.4088   2.4941   0.0903   0.4673
+ 63S   / 14:   1.0650   1.2982   1.6343   1.2108   1.5136   1.6090   1.8151   1.2050     ....   3.1150   1.2840   0.3114   0.9075
+ 65S   / 13:   0.6686   0.1303   0.8185   0.2022   0.5104   0.3644   1.0079   0.2598   1.8500   1.8860   0.7000   0.0021   0.9191
+ 67S   / 12:   0.4623  -0.5492   0.0874     ....     ....  -0.0052  -0.2830  -0.0203   1.1982   0.4323  -0.5000   0.2120  -0.0205
+ 69S   / 11:  -0.3438     ....  -0.2335     ....     ....  -1.3365  -0.1277     ....  -0.2716  -0.3135     ....  -0.7000  -0.2723
+ 71S   / 10:     ....     ....     ....     ....     ....  -1.6000  -1.0248     ....  -1.0000     ....     ....  -1.5633  -0.9349
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -1.0216     ....     ....     ....     ....  -1.4771     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -0.6115     ....     ....     ....  -1.6061  -1.2224     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6974     ....     ....     ....     ....  -1.3728     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:3 T:   3287.9
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:   2.5000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.3750
+ 77N   / 84:   3.4400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6250
+ 75N   / 83:   2.6000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.8460
+ 73N   / 82:   4.4409   0.5100     ....     ....     ....     ....     ....     ....     ....     ....  -1.3667     ....  -0.8225
+ 71N   / 81:   5.4388   0.3400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.6240
+ 69N   / 80:   5.9773     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   7.0333   5.7596
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6000   6.2775   5.0971
+ 65N   / 78:   1.4558     ....     ....     ....     ....     ....  -0.2350     ....     ....     ....  -0.0333   5.5736   5.9673
+ 63N   / 77:   3.4200     ....     ....     ....     ....     ....   0.6400     ....     ....     ....  -1.6700   6.6186   7.9123
+ 61N   / 76:   3.4160     ....     ....     ....     ....   2.5655   0.7717   6.6667     ....     ....   1.8667   7.0529   8.8649
+ 59N   / 75:   5.6405     ....     ....     ....     ....   2.0611   0.9867   6.9750     ....     ....   2.0100   7.4621   8.4868
+ 57N   / 74:   5.9800     ....     ....     ....     ....   3.0850   2.7321   6.8916     ....     ....   0.9500   8.2306   8.5784
+ 55N   / 73:   8.0252     ....     ....     ....     ....   2.3115   4.5506   6.4479     ....     ....   3.7000   8.3973   9.5559
+ 53N   / 72:     ....     ....     ....     ....     ....   2.6937   4.8088   6.7680     ....     ....   2.8900   9.2218  10.4003
+ 51N   / 71:     ....     ....     ....     ....     ....   3.2503   4.9117   6.8015     ....     ....   2.5529  11.3034  10.8005
+ 49N   / 70:     ....     ....     ....     ....     ....   3.0545   5.1517   7.2869     ....   2.7152   3.2139  12.3364  11.3225
+ 47N   / 69:     ....   2.7000     ....     ....     ....   3.3659   5.8927   8.3193     ....   2.7223   3.4114  13.6252  13.5042
+ 45N   / 68:     ....  10.0571     ....     ....     ....   4.8410   7.4161   9.4102     ....   3.6258   3.8275  14.6266  14.1615
+ 43N   / 67:     ....  12.7416     ....     ....   6.7189   6.9232   9.1093  10.6638     ....   4.2112   7.7514  15.5934  14.2717
+ 41N   / 66:     ....  12.2736     ....     ....   9.4889  10.0966  11.2221  12.2000     ....   7.4752  17.0025  16.5220     ....
+ 39N   / 65:  18.3061  17.6344     ....     ....  13.1272  13.1707  13.2898  13.6927     ....     ....  20.0227  17.1398     ....
+ 37N   / 64:  18.5141  17.9063     ....     ....  15.3549  15.3983  15.0444  15.3707     ....     ....  20.4579  18.0923  17.5707
+ 35N   / 63:  18.7384     ....     ....     ....  16.8426  17.6000  16.7552  16.7829     ....     ....  20.4300  19.0107  17.7344
+ 33N   / 62:  18.9508     ....     ....     ....  21.5277  18.7307  18.1471  17.9534     ....     ....  21.0125  20.0088     ....
+ 31N   / 61:  18.7025     ....     ....     ....  22.5800  20.5256  20.0583  19.4733  17.4200  24.2768  21.8716  20.6057     ....
+ 29N   / 60:     ....  25.7695     ....     ....  22.5733  22.5723  21.6635  20.2684  16.2180  24.9511  23.1845  21.2752     ....
+ 27N   / 59:     ....  25.4122     ....     ....  23.6602  24.0498  22.5812  21.2723  16.7570  26.3925  24.2020  21.7641     ....
+ 25N   / 58:     ....     ....     ....     ....  25.2143  25.5321  24.3246  21.9995  17.9540  26.9720  24.9484  22.4602     ....
+ 23N   / 57:     ....     ....     ....     ....  26.6917  26.0579  24.8529  22.5776  20.2795  27.1909  25.5700  22.9362     ....
+ 21N   / 56:     ....     ....     ....     ....  27.8576  26.6563  25.3957  23.1102  22.1345  27.7200  26.0730  23.0700     ....
+ 19N   / 55:     ....     ....     ....  26.8300  28.4227  27.1402  25.9305  23.6595  23.7516  28.1905  26.6716  23.3293     ....
+ 17N   / 54:     ....     ....     ....     ....  28.8737  27.3141  26.3835  24.2809  25.2149  28.3251  27.0405  23.5656     ....
+ 15N   / 53:     ....  29.6770     ....     ....  29.0020  27.5648  26.8352  25.0370  26.4873  28.2522  27.1788  24.0619     ....
+ 13N   / 52:     ....  29.7957     ....     ....  29.0452  27.9505  26.9712  25.7979  27.9270  29.0510  27.4940  24.9544     ....
+ 11N   / 51:     ....  29.9600  29.6100  29.9485  29.1975  28.5281  27.2419  26.2275  28.2569  28.6935  27.4943  25.4832     ....
+ 9N    / 50:     ....  29.0000  29.2055  29.9940  29.1339  28.5629  28.0300  26.8865  28.1333  28.7602  27.5655  26.2932     ....
+ 7N    / 49:     ....  28.0975  29.2157  29.8208  29.1260  28.9489  28.3765  27.6896  27.9185  28.6481  27.8075  26.9731     ....
+ 5N    / 48:     ....  28.5837  28.9960  29.6031  29.2848  28.8200  28.2841  28.0367  28.0050  28.1459     ....  27.4683  28.6742
+ 3N    / 47:     ....  28.8228  28.8738  29.6720  29.1708  29.1114  27.9356  27.4223  27.0792  27.4624     ....  27.7005  28.7616
+ 1N    / 46:     ....  28.9241  28.9488  29.6711  29.2204  29.2053  27.9759  26.7708  26.2331  24.6843     ....  27.7243  28.5300
+ 1S    / 45:     ....  28.8412  28.8305  29.7569  29.3532  29.1575  28.6016  27.3479  26.1727  23.7911     ....  27.7941  27.3629
+ 3S    / 44:     ....  28.7131  28.7504  29.7065  28.8744  29.3853  29.0300  27.7041  26.2321  24.2555     ....  27.9582  27.0115
+ 5S    / 43:     ....  28.2603  28.5437  29.3988  28.6953  29.4181  29.4700  28.0004  26.6977  25.2607     ....  28.0911  26.9673
+ 7S    / 42:     ....  28.4590  28.1998  29.0577  28.3900  29.3039  29.4132  28.1829  26.9186  25.5194     ....  28.0741  26.4868
+ 9S    / 41:     ....  27.4126  27.8088  28.6505  28.0595  29.3987  29.4488  28.6235  26.8222  25.9759     ....  27.9426  25.9048
+ 11S   / 40:     ....  27.3103  27.5905  28.4839  28.4948  28.7670  29.4367  28.7400  26.7212  25.1000     ....  27.5707  25.3691
+ 13S   / 39:     ....  27.6357  27.1885  28.1500  29.0750  28.2963  29.0007  28.3957  26.0152  23.9237     ....  27.2888  23.9450
+ 15S   / 38:     ....  27.4167  26.8054  27.3040     ....  27.6349  28.8591  28.2997  25.6416  22.9757     ....  26.8832  23.2593
+ 17S   / 37:     ....  26.5750  26.3315  26.3547     ....  26.9741  27.8112  27.7504  25.2758  22.2731     ....  26.9240  22.9660
+ 19S   / 36:     ....  26.3800  25.6018  25.5118     ....  26.2589  26.8355  27.3067  25.1597  21.8636     ....  26.4242  22.7498
+ 21S   / 35:     ....  26.3962  24.9433  24.4010     ....  25.0882  26.0626  26.7074  25.1090  21.2900     ....  26.0265  22.2924
+ 23S   / 34:     ....  25.5153  23.9938  23.6290     ....  23.7930  24.8873  25.7890  24.6791  21.6500     ....  25.0545  22.3546
+ 25S   / 33:     ....  25.0498  23.4605  22.4263     ....  23.5336  23.1886  24.5767  23.8922  21.0542     ....  24.0368  22.0510
+ 27S   / 32:     ....  24.0579  22.4800  21.3337     ....  22.9638  22.6794  22.9685  23.3845  20.5250     ....  23.4248  21.4712
+ 29S   / 31:     ....  22.2597  20.8924  20.4105     ....  22.1940  21.7986  21.7838  22.1056  20.3556     ....  22.2542  20.3204
+ 31S   / 30:     ....  21.4554  20.1326  19.0221     ....  21.7333  20.2379  20.6162  21.0963  19.7514     ....  21.3928  19.9943
+ 33S   / 29:     ....  20.1174  18.7177  17.8882  17.9775  20.9526  18.9529  18.9267  19.8433  18.7275     ....  19.5163  19.1597
+ 35S   / 28:  17.4848  19.0512  17.2736  16.4823  17.0525  20.2329  17.9626  17.6227  19.3250  17.7730  18.5000  18.2119  17.9181
+ 37S   / 27:  19.0393  18.4096  15.7970  14.9422  15.5643  18.4488  16.9900  16.4614  16.4140  16.1780     ....  17.4080  16.3346
+ 39S   / 26:  19.3745  17.0241  15.1964  13.3975  14.9817  16.2655  15.9971  15.1350  15.1000  15.0855  13.9982  15.9207  14.3391
+ 41S   / 25:  17.5125  14.8843  13.7848  11.6755  13.7962  15.6597  15.2020  13.3413     ....  13.7836  12.0222  14.1123  13.4425
+ 43S   / 24:  14.8667   8.6540  13.1967  10.4214  12.3867  14.4790  14.1935  12.8180     ....  12.5791   9.4489  13.2311  12.1000
+ 45S   / 23:  14.8333     ....  10.7300  10.0000  10.7150  12.2380  12.7589  11.4000     ....  11.8200   8.4016     ....     ....
+ 47S   / 22:     ....     ....   6.0500     ....     ....  11.8750  11.9511  10.9667     ....   9.6250   7.7883   7.6600     ....
+ 49S   / 21:     ....     ....   5.4000     ....     ....  10.7667  11.0757   9.8500     ....   8.9767   7.4821   6.6840     ....
+ 51S   / 20:     ....     ....   2.5333     ....     ....   8.8000     ....   9.2571     ....   7.6900   7.7200   3.7350     ....
+ 53S   / 19:     ....   3.4133     ....     ....     ....   8.4600     ....     ....   5.0000   6.6850   7.1267   1.1217     ....
+ 55S   / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.5000   6.0667   1.4680     ....
+ 57S   / 17:     ....     ....     ....     ....     ....     ....     ....     ....     ....   5.2000   5.2657   1.0000     ....
+ 59S   / 16:     ....     ....  -0.4400     ....     ....     ....     ....     ....     ....     ....   1.5000  -0.8000     ....
+ 61S   / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.4500     ....     ....
+ 63S   / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.0700     ....     ....     ....
+ 65S   / 13:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 67S   / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 69S   / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 71S   / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73S   /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_negative_t
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.66667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.000000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.0000
+ -2   / 5: -12.0000
+ 0    / 6: -12.0000
+ 2    / 7:  -8.0000
+ 4    / 8:   0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -20.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+ -2   / 5: -40.0000
+ 0    / 6: -40.0000
+ 2    / 7: -36.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.0000
+ -8    /  2: -36.0000
+ -6    /  3: -48.0000
+ -4    /  4: -56.0000
+ -2    /  5: -60.0000
+ 0     /  6: -60.0000
+ 2     /  7: -56.0000
+ 4     /  8: -48.0000
+ 6     /  9: -36.0000
+ 8     / 10: -20.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.000000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -6.00000
+ 0    / 6: -6.00000
+ 2    / 7: -4.00000
+ 4    / 8:  0.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+ -2   / 5: -20.0000
+ 0    / 6: -20.0000
+ 2    / 7: -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.0000
+ -8    /  2: -18.0000
+ -6    /  3: -24.0000
+ -4    /  4: -28.0000
+ -2    /  5: -30.0000
+ 0     /  6: -30.0000
+ 2     /  7: -28.0000
+ 4     /  8: -24.0000
+ 6     /  9: -18.0000
+ 8     / 10: -10.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+ 4    / 8:  6.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.0000
+ -8    /  2:  -6.0000
+ -6    /  3:  -4.0000
+ -4    /  4:  -2.0000
+ -2    /  5:   0.0000
+ 0     /  6:   2.0000
+ 2     /  7:   4.0000
+ 4     /  8:   6.0000
+ 6     /  9:   8.0000
+ 8     / 10:  10.0000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.0000
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.00000
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:  1.00000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.20000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.20000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.20000
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+ 4    / 8:      ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:      ....
+ -6   / 3:      ....
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:      ....
+ -8    /  2:      ....
+ -6    /  3:      ....
+ -4    /  4:  0.100000
+ -2    /  5:  0.900000
+ 0     /  6:      ....
+ 2     /  7:      ....
+ 4     /  8:      ....
+ 6     /  9:      ....
+ 8     / 10:      ....
+ 10    / 11:      ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.00000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  8.00000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.20000
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  9.00000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+ 4    / 8: -2.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -7.00000
+ -4    /  4: -6.00000
+ -2    /  5: -5.00000
+ 0     /  6: -4.00000
+ 2     /  7: -3.00000
+ 4     /  8: -2.00000
+ 6     /  9: -1.00000
+ 8     / 10:  0.00000
+ 10    / 11:  1.00000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1:....
+ 692184   /  2:....
+ 692208   /  3:....
+ 692232   /  4:....
+ 692256   /  5:....
+ 692280   /  6:....
+ 692304   /  7:....
+ 692328   /  8:....
+ 692352   /  9:....
+ 692376   / 10:....
+ 692400   / 11:....
+ 692424   / 12:....
+ 692448   / 13:....
+ 692472   / 14:....
+ 692496   / 15:....
+ 692520   / 16:....
+ 692544   / 17:....
+ 692568   / 18:....
+ 692592   / 19:....
+ 692616   / 20:....
+ 692640   / 21:....
+ 692664   / 22:....
+ 692688   / 23:....
+ 692712   / 24:....
+ 692736   / 25:....
+ 692760   / 26:....
+ 692784   / 27:....
+ 692808   / 28:....
+ 692832   / 29:....
+ 692856   / 30:....
+CANCEL MODE ignore_error
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_xact_regrid
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+ 
+!added in bn450 11/97 *kob*
+! replace w/ bn500 *kob* 5/99
+GO bn_reset
+cancel mode verify
+GO bn_gc_functions
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+               1        2        3        4     
+               1        2        3        4
+ 0.1  / 1:  1.10000  2.10000  3.10000  4.10000
+ 0.2  / 2:  1.20000  2.20000  3.20000  4.20000
+ 0.3  / 3:  1.30000  2.30000  3.30000  4.30000
+ 0.4  / 4:  1.40000  2.40000  3.40000  4.40000
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+               1         2         3         4      
+                1         2         3         4
+ 0.1  / 1:  0.891207  0.863209  0.041581 -0.818277
+ 0.2  / 2:  0.932039  0.808496 -0.058374 -0.871576
+ 0.3  / 3:  0.963558  0.745705 -0.157746 -0.916166
+ 0.4  / 4:  0.985450  0.675463 -0.255541 -0.951602
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.10000
+ 2    /  2:  2.10000
+ 3    /  3:  3.10000
+ 4    /  4:  4.10000
+ 5    /  5:  1.20000
+ 6    /  6:  2.20000
+ 7    /  7:  3.20000
+ 8    /  8:  4.20000
+ 9    /  9:  1.30000
+ 10   / 10:  2.30000
+ 11   / 11:  3.30000
+ 12   / 12:  4.30000
+ 13   / 13:  1.40000
+ 14   / 14:  2.40000
+ 15   / 15:  3.40000
+ 16   / 16:  4.40000
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.45
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.10000
+ 4   / 4:  4.10000
+ 5   / 5:  1.20000
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+               2        3     
+               2        3
+ 0.2  / 2:  2.20000  3.20000
+ 0.3  / 3:  2.30000  3.30000
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.20000
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 4   / 4:  3.30000
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+                1        2        3        4     
+                1        2        3        4
+ 0.01  / 1:  2.21000  3.21000  2.31000  3.31000
+ 0.02  / 2:  2.22000  3.22000  2.32000  3.32000
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+               1        2        3     
+               1        2        3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11000  2.11000  3.11000
+ 0.2  / 2:  1.21000  2.21000  3.21000
+ 0.3  / 3:  1.31000  2.31000  3.31000
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12000  2.12000  3.12000
+ 0.2  / 2:  1.22000  2.22000  3.22000
+ 0.3  / 3:  1.32000  2.32000  3.32000
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13000  2.13000  3.13000
+ 0.2  / 2:  1.23000  2.23000  3.23000
+ 0.3  / 3:  1.33000  2.33000  3.33000
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.14000  2.14000  3.14000
+ 0.2  / 2:  1.24000  2.24000  3.24000
+ 0.3  / 3:  1.34000  2.34000  3.34000
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.15000  2.15000  3.15000
+ 0.2  / 2:  1.25000  2.25000  3.25000
+ 0.3  / 3:  1.35000  2.35000  3.35000
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.16000  2.16000  3.16000
+ 0.2  / 2:  1.26000  2.26000  3.26000
+ 0.3  / 3:  1.36000  2.36000  3.36000
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.17000  2.17000  3.17000
+ 0.2  / 2:  1.27000  2.27000  3.27000
+ 0.3  / 3:  1.37000  2.37000  3.37000
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.18000  2.18000  3.18000
+ 0.2  / 2:  1.28000  2.28000  3.28000
+ 0.3  / 3:  1.38000  2.38000  3.38000
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.19000  2.19000  3.19000
+ 0.2  / 2:  1.29000  2.29000  3.29000
+ 0.3  / 3:  1.39000  2.39000  3.39000
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:  220.777  252.000  293.508  315.000  293.508  252.000  220.777
+ 3    / 2:  210.675  240.469  280.078  300.586  280.078  240.469  210.675
+ 5    / 3:  199.382  227.579  265.064  284.473  265.064  227.579  199.382
+ 7    / 4:  186.579  212.965  248.043  266.206  248.043  212.965  186.579
+ 9    / 5:  171.798  196.094  228.394  245.118  228.394  196.094  171.798
+ 11   / 6:  154.317  176.140  205.154  220.176  205.154  176.140  154.317
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:   15.459   13.544   11.629   10.835   11.629   13.544   15.459
+ 3    / 2:   46.534   40.768   35.003   32.614   35.003   40.768   46.534
+ 5    / 3:   77.920   68.266   58.612   54.613   58.612   68.266   77.920
+ 7    / 4:  109.622   96.040   82.458   76.832   82.458   96.040  109.622
+ 9    / 5:  141.642  124.093  106.544   99.274  106.544  124.093  141.642
+ 11   / 6:  173.985  152.428  130.872  121.943  130.872  152.428  173.985
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30      -20      -10       0       10       20       30     
+                 1        2        3        4        5        6        7
+ 0      / 1:     ....     ....     ....     ....     ....     ....     ....
+ 50     / 2:  209.428  236.141  270.541  287.852  270.541  236.141  209.428
+ 100    / 3:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 150    / 4:  167.281  177.850     ....     ....     ....  177.850  167.281
+ 200    / 5:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  219.301  249.266  288.698  308.935  288.698  249.266  219.301
+ 40     /  3:  212.799  240.795  276.900  295.177  276.900  240.795  212.799
+ 60     /  4:  205.830  231.454  264.073  280.044  264.073  231.454  205.830
+ 80     /  5:  198.542  221.405  249.798  263.229  249.798  221.405  198.542
+ 100    /  6:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 120    /  7:  181.788  198.556  215.539  222.313  215.539  198.556  181.788
+ 140    /  8:  172.556  184.892     ....     ....     ....  184.892  172.556
+ 160    /  9:  161.876     ....     ....     ....     ....     ....  161.876
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  1.14612  1.23714  1.35815  1.42080  1.35815  1.23714  1.14612
+ 40     /  3:  1.78974  1.97179  2.21167  2.33573  2.21167  1.97179  1.78974
+ 60     /  4:  2.42905  2.69940  3.05822  3.24246  3.05822  2.69940  2.42905
+ 80     /  5:  3.06561  3.42249  3.89693  4.14116  3.89693  3.42249  3.06561
+ 100    /  6:  3.69649  4.14116  4.72832  5.03201  4.72832  4.14116  3.69649
+ 120    /  7:  4.32411  4.85410  5.55312  5.91430  5.55312  4.85410  4.32411
+ 140    /  8:  4.94871  5.56139     ....     ....     ....  5.56139  4.94871
+ 160    /  9:  5.56760     ....     ....     ....     ....     ....  5.56760
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  5.56760
+ -20   / 2:  5.56139
+ -10   / 3:  5.55312
+ 0     / 4:  5.91430
+ 10    / 5:  5.55312
+ 20    / 6:  5.56139
+ 30    / 7:  5.56760
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  163.058
+ -20   / 2:  186.117
+ -10   / 3:  216.774
+ 0     / 4:  232.647
+ 10    / 5:  216.774
+ 20    / 6:  186.117
+ 30    / 7:  163.058
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   1.1817
+ -20   / 2:   1.2249
+ -10   / 3:   1.2346
+ 0     / 4:  10.3336
+ 10    / 5:   1.2346
+ 20    / 6:   1.2249
+ 30    / 7:   1.1817
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   7.6679
+ -20   / 2:   9.6753
+ -10   / 3:  10.7875
+ 0     / 4:  10.3336
+ 10    / 5:  10.7875
+ 20    / 6:   9.6753
+ 30    / 7:   7.6679
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+ 
+!added in bn491 - originally had this in run_all, but moved it here to
+! properly echo commands  *kob*
+GO bn_reset
+cancel mode verify
+set mode verify  ! somehow this was off
+ 
+GO bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+can viewport
+can win/all
+set window 1
+ 
+!netcdf write error
+GO err490_cdf_childax
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+ 
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+!
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+ 
+ 
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+ 
+message/continue ********File successfully written******
+********File successfully written******
+ 
+ 
+! command parser
+GO bn_reset
+cancel mode verify
+GO err490_command_parser
+! err490_command_parser.jnl 12/1/98 - reported by billy kessler
+ 
+! ERROR Fixed:  command parser fix
+! the following caused an abort of ferret to occur
+!
+! routines modifed:  gnl/parse_command.F
+!	     	     rpn/init_uvar_sub.F
+!                    common/xvariables.cmn
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+label/nou `($ppl$xlen)-.3`  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ !-> PPL %LABEL/nou 8.44  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ 
+! the following also caused an abort of ferret
+let sstb = if ( (i eq 172 and j eq 36) or (i ge 173 and i le 175 and j eq 35) or (i ge 176 and i le 178 and j eq 36) or (i eq 178 and j eq 35) ) then 1.e35 else sst
+message/continue ****Variable defined successfully******
+****Variable defined successfully******
+ 
+ 
+! tilde error
+!GO bn_reset
+!GO err490_tilde
+ 
+ 
+!repeat error
+GO bn_reset
+cancel mode verify
+GO err490_repeat_first_echo
+! err490_repeat_first_echo (created later 23/98)
+ 
+! for the first REPEAT loop on T the formatting of the "verify" output
+! is based on the last previous command given
+ 
+! fixed 1/98 sh&kob
+!  relevant routines (bug not yet fixed)
+!		       gnl/cs_command.F
+!                      xeq/xeq_repeat.F
+!                      ctx/cs_set_context.F
+ 
+set mode calendar
+can mode interp
+ 
+! cause the "last" command to be non-calendar
+stat t[t=15]
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+ 
+! now note the first loop echo
+set mode verify
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.42017
+ 14   / 14:  1.41077
+ 15   / 15:  2.06106
+ 16   / 16:  1.77316
+ 17   / 17:  0.81176
+ 18   / 18:  0.06077
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.693528
+ 12   / 12: -0.372132
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+ 19   / 19:  0.103945
+ 20   / 20:  0.633159
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.99999
+ 12   / 12: -1.53656
+ 13   / 13: -1.11640
+ 14   / 14: -0.12579
+ 15   / 15:  0.52450
+ 16   / 16:  0.23660
+ 17   / 17: -0.72480
+ 18   / 18: -1.47579
+ 19   / 19: -1.32591
+ 20   / 20: -0.41297
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME4     TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.0000
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.51W  135.469W 135.429W 135.389W 135.348W 135.308W 135.267W 135.227W 135.187W 135.146W 135.106W 135.066W 
+                     1        4        7       10       13       16       19       22       25       28       31       34
+ 59.4667N / 127:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4599N / 126:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.453N  / 125:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4462N / 124:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97638     ....
+ 59.4394N / 123:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4325N / 122:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4257N / 121:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4189N / 120:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.412N  / 119:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.4052N / 118:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3983N / 117:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.3915N / 116:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3846N / 115:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97555     ....     ....
+ 59.3778N / 114:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3709N / 113:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3641N / 112:     ....     ....     ....     ....     ....     ....     ....     ....  2.98572     ....     ....     ....
+ 59.3572N / 111:     ....     ....     ....     ....     ....     ....     ....     ....  2.98764     ....     ....     ....
+ 59.3504N / 110:     ....     ....     ....     ....     ....     ....     ....     ....  2.98791     ....     ....     ....
+ 59.3435N / 109:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3366N / 108:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3298N / 107:     ....     ....     ....     ....     ....     ....     ....  2.98599     ....     ....     ....     ....
+ 59.3229N / 106:     ....     ....     ....     ....  2.98956     ....     ....  2.98709     ....     ....     ....     ....
+ 59.3161N / 105:     ....     ....     ....     ....  2.98901     ....     ....  2.98627     ....     ....     ....     ....
+ 59.3092N / 104:     ....     ....     ....     ....  2.98846     ....  2.98379  2.98517     ....     ....     ....     ....
+ 59.3023N / 103:     ....     ....     ....     ....     ....  2.98379  2.98297  2.98407     ....     ....     ....     ....
+ 59.2955N / 102:     ....     ....     ....     ....     ....  2.98297     ....  2.98270     ....     ....     ....     ....
+ 59.2886N / 101:     ....  2.99863     ....     ....     ....  2.98297  2.98077  2.98105     ....     ....     ....     ....
+ 59.2817N / 100:     ....     ....  2.98956     ....     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2748N /  99:     ....     ....  2.99149     ....     ....  2.98462  2.98050     ....     ....     ....     ....     ....
+ 59.268N  /  98:     ....     ....  2.99341     ....     ....  2.98462  2.97967     ....     ....     ....     ....     ....
+ 59.2611N /  97:     ....     ....  2.99561     ....     ....     ....  2.97967     ....     ....     ....     ....     ....
+ 59.2542N /  96:     ....     ....  2.99615  3.00055     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2473N /  95:     ....     ....  2.99643  2.99945     ....  2.98434  2.98709     ....     ....     ....     ....     ....
+ 59.2405N /  94:     ....     ....     ....  2.99753     ....  2.98572  2.99286     ....     ....     ....     ....     ....
+ 59.2336N /  93:     ....     ....     ....  2.99561  2.99588  2.98627  2.99313     ....     ....     ....     ....     ....
+ 59.2267N /  92:     ....     ....     ....  2.99396  2.99451     ....  2.99588  2.99588     ....     ....     ....     ....
+ 59.2198N /  91:     ....     ....     ....  2.99231  2.99341     ....  2.99643  2.99698     ....     ....     ....     ....
+ 59.2129N /  90:     ....     ....     ....  2.99039  2.99176     ....  2.99561  2.99780     ....     ....     ....     ....
+ 59.2061N /  89:     ....     ....     ....  2.98984  2.99231     ....  2.99396  2.99725     ....     ....     ....     ....
+ 59.1992N /  88:     ....     ....     ....  2.98984  2.99176     ....     ....  2.99368     ....     ....     ....     ....
+ 59.1923N /  87:     ....     ....     ....     ....  2.99203     ....     ....  2.99039     ....     ....     ....     ....
+ 59.1854N /  86:     ....     ....     ....     ....  2.99451     ....     ....  2.98956     ....     ....     ....     ....
+ 59.1785N /  85:     ....     ....     ....  2.99313  2.99670  2.99918     ....  2.98956     ....     ....     ....     ....
+ 59.1716N /  84:     ....     ....     ....  2.99423  2.99808     ....     ....  2.99066     ....     ....     ....     ....
+ 59.1647N /  83:     ....     ....     ....  2.99561  2.99780  3.00494     ....  2.99149     ....     ....     ....     ....
+ 59.1578N /  82:     ....     ....     ....  2.99588  2.99835     ....     ....  2.99286     ....     ....     ....     ....
+ 59.1509N /  81:     ....     ....     ....  2.99588  2.99945     ....  2.99506  2.99423     ....     ....     ....     ....
+ 59.144N  /  80:     ....     ....     ....     ....  2.99973     ....  2.99561  2.99396     ....     ....     ....     ....
+ 59.1371N /  79:     ....     ....     ....     ....  2.99973     ....  2.99643  2.99396     ....     ....     ....     ....
+ 59.1302N /  78:     ....     ....     ....     ....  3.00055     ....  2.99808  2.99451     ....     ....     ....     ....
+ 59.1233N /  77:     ....     ....     ....     ....  3.00247     ....  3.00027  2.99561     ....     ....     ....     ....
+ 59.1164N /  76:     ....     ....     ....     ....  3.00385     ....  3.00110  2.99670     ....     ....     ....     ....
+ 59.1095N /  75:     ....     ....     ....     ....     ....  3.00330  3.00275  2.99753     ....     ....     ....     ....
+ 59.1026N /  74:     ....     ....     ....     ....     ....  3.00192     ....  2.99808     ....     ....     ....     ....
+ 59.0957N /  73:     ....     ....     ....     ....  2.99643  3.00027     ....  2.99973     ....     ....     ....     ....
+ 59.0888N /  72:     ....     ....     ....     ....  2.99615  3.00000     ....  3.00082     ....     ....     ....     ....
+ 59.0819N /  71:     ....     ....     ....     ....  2.99670  3.00055  3.00412  3.00110     ....     ....     ....     ....
+ 59.075N  /  70:     ....     ....     ....     ....  2.99780  3.00137  3.00302  3.00137     ....     ....     ....     ....
+ 59.0681N /  69:     ....     ....     ....     ....  2.99890  3.00137  3.00082  3.00055     ....     ....     ....     ....
+ 59.0612N /  68:     ....     ....     ....     ....  2.99863  3.00000     ....  2.99780     ....     ....     ....     ....
+ 59.0542N /  67:     ....     ....     ....     ....  2.99835  2.99780     ....  2.99533     ....     ....     ....     ....
+ 59.0473N /  66:     ....     ....     ....     ....  2.99808  2.99615     ....  2.99341     ....     ....     ....     ....
+ 59.0404N /  65:     ....     ....     ....     ....  2.99780  2.99588  2.99368  2.99094     ....     ....     ....     ....
+ 59.0335N /  64:     ....     ....     ....  2.99835  2.99753  2.99506  2.99286  2.98791     ....     ....     ....     ....
+ 59.0266N /  63:     ....     ....     ....  2.99780     ....  2.99396  2.99039  2.98599     ....     ....     ....     ....
+ 59.0196N /  62:     ....     ....     ....  2.99698     ....  2.99258     ....  2.98324     ....     ....     ....     ....
+ 59.0127N /  61:     ....     ....     ....  2.99561     ....  2.99203  2.98572  2.97995     ....     ....     ....     ....
+ 59.0058N /  60:     ....     ....     ....  2.99423     ....  2.99121  2.98572  2.97748     ....     ....     ....     ....
+ 58.9989N /  59:     ....     ....     ....  2.99506     ....  2.99094  2.98572  2.97748     ....     ....     ....     ....
+ 58.9919N /  58:     ....     ....     ....  2.99808     ....  2.99066  2.98489  2.97748     ....     ....     ....     ....
+ 58.985N  /  57:     ....     ....     ....  3.00027     ....  2.99011  2.98407  2.97720     ....     ....     ....     ....
+ 58.9781N /  56:     ....     ....     ....  3.00055     ....  2.98929  2.98160  2.97720     ....     ....     ....     ....
+ 58.9711N /  55:     ....     ....     ....  3.00000     ....  2.98819  2.97693  2.97638     ....     ....     ....     ....
+ 58.9642N /  54:     ....     ....     ....  2.99863     ....  2.98736  2.97775  2.97198     ....     ....     ....     ....
+ 58.9573N /  53:     ....     ....     ....  2.99670     ....  2.98682  2.97803  2.96512     ....     ....     ....     ....
+ 58.9503N /  52:     ....     ....     ....  2.99588  2.99203  2.98654  2.97830  2.96676     ....     ....     ....     ....
+ 58.9434N /  51:     ....     ....     ....  2.99588  2.99231  2.98654  2.97748  2.96814     ....     ....     ....     ....
+ 58.9365N /  50:     ....     ....     ....  2.99780  2.99258  2.98627  2.97665     ....     ....     ....     ....     ....
+ 58.9295N /  49:     ....     ....     ....     ....  2.99231  2.98572  2.97638     ....     ....     ....     ....     ....
+ 58.9226N /  48:     ....     ....     ....     ....  2.99286  2.98544  2.97610     ....     ....     ....     ....     ....
+ 58.9156N /  47:     ....     ....     ....  2.99478  2.99423  2.98544  2.97528     ....     ....     ....     ....     ....
+ 58.9087N /  46:     ....     ....     ....  2.99533  2.99368  2.98517  2.97500     ....     ....     ....     ....     ....
+ 58.9017N /  45:     ....     ....     ....  2.99506  2.99286  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8948N /  44:     ....     ....     ....  2.99533  2.99231  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8878N /  43:     ....     ....     ....  2.99615  2.99176  2.98462  2.97555     ....     ....     ....     ....     ....
+ 58.8809N /  42:     ....     ....     ....  2.99698  2.99258  2.98489  2.97638     ....     ....     ....     ....     ....
+ 58.8739N /  41:     ....     ....     ....  2.99698  2.99341  2.98544  2.97555     ....     ....     ....     ....     ....
+ 58.867N  /  40:     ....     ....     ....  2.99698  2.99341  2.98544  2.97418     ....     ....     ....     ....     ....
+ 58.86N   /  39:     ....     ....     ....  2.99753  2.99368  2.98544  2.97171     ....     ....     ....     ....     ....
+ 58.8531N /  38:     ....     ....     ....  2.99835  2.99368  2.98572  2.96786     ....     ....     ....     ....     ....
+ 58.8461N /  37:     ....     ....     ....  2.99863  2.99368  2.98572  2.96621     ....     ....     ....     ....     ....
+ 58.8392N /  36:     ....     ....     ....  2.99890  2.99368  2.98517  2.96814     ....     ....     ....     ....     ....
+ 58.8322N /  35:     ....     ....     ....     ....  2.99313  2.98379  2.97061     ....     ....     ....     ....     ....
+ 58.8252N /  34:     ....     ....     ....     ....  2.99258  2.98215  2.96896     ....     ....     ....     ....     ....
+ 58.8183N /  33:     ....     ....     ....     ....  2.99121  2.98160  2.96814     ....     ....     ....     ....     ....
+ 58.8113N /  32:     ....     ....     ....     ....  2.99094  2.98242  2.96869     ....     ....     ....  2.93408  2.92254
+ 58.8043N /  31:     ....     ....     ....     ....  2.99341  2.98297  2.96759     ....     ....     ....  2.93463     ....
+ 58.7974N /  30:     ....     ....     ....  3.00247  2.99286  2.98242  2.96621  2.94754     ....     ....  2.93545     ....
+ 58.7904N /  29:     ....     ....     ....     ....  2.99149  2.98105  2.96567  2.94809     ....     ....     ....     ....
+ 58.7834N /  28:     ....     ....     ....     ....  2.99094  2.97967  2.96512  2.94644     ....     ....  2.96374     ....
+ 58.7765N /  27:     ....     ....     ....     ....  2.98956  2.97748  2.96347  2.94864     ....     ....  2.95880     ....
+ 58.7695N /  26:     ....     ....     ....     ....  2.98874  2.97940  2.96484  2.95440     ....  2.94781  2.95660     ....
+ 58.7625N /  25:     ....     ....     ....     ....  2.98846  2.98187  2.96869  2.95990     ....  2.95166  2.95495     ....
+ 58.7555N /  24:     ....     ....     ....     ....  2.98791  2.98160  2.96896  2.96264     ....  2.95358  2.95303     ....
+ 58.7486N /  23:     ....     ....     ....  2.98682  2.98627  2.97940  2.96841  2.96127     ....  2.95440  2.95056     ....
+ 58.7416N /  22:     ....     ....     ....  2.98544  2.98462  2.97693  2.96731  2.95935     ....  2.95276  2.94616     ....
+ 58.7346N /  21:     ....     ....     ....  2.98352  2.98297  2.97500  2.96484  2.95797  2.95166  2.94919  2.94507     ....
+ 58.7276N /  20:     ....     ....     ....     ....  2.98160  2.97226  2.96292  2.95605  2.95138  2.94644  2.94232     ....
+ 58.7206N /  19:     ....     ....     ....     ....  2.97995  2.96896  2.96209  2.95578  2.95056  2.94452     ....     ....
+ 58.7137N /  18:     ....     ....     ....     ....  2.97858  2.97088  2.96292  2.95440  2.94891  2.94424     ....     ....
+ 58.7067N /  17:     ....     ....     ....     ....  2.97775  2.97391  2.96402  2.95331  2.94699  2.94561     ....     ....
+ 58.6997N /  16:     ....     ....     ....     ....  2.97748  2.97446  2.96457  2.95248  2.94507  2.94616     ....     ....
+ 58.6927N /  15:     ....     ....     ....     ....  2.97803  2.97446  2.96457  2.95056  2.94424  2.94699     ....     ....
+ 58.6857N /  14:     ....     ....     ....     ....  2.97967  2.97446  2.96567  2.94836  2.94397  2.94726     ....     ....
+ 58.6787N /  13:     ....     ....     ....     ....  2.98050  2.97500  2.96924  2.95193  2.94534  2.94864     ....     ....
+ 58.6717N /  12:     ....     ....     ....     ....  2.98215  2.97638  2.96814  2.95550  2.94424  2.95193     ....     ....
+ 58.6647N /  11:     ....     ....     ....     ....  2.98270  2.97830  2.96539  2.94919     ....  2.95248     ....     ....
+ 58.6577N /  10:     ....     ....     ....     ....  2.98215  2.97885  2.96594  2.94534     ....     ....     ....     ....
+ 58.6507N /   9:     ....     ....     ....  2.98160  2.97995  2.97500  2.97088  2.95331     ....     ....     ....     ....
+ 58.6437N /   8:     ....     ....     ....     ....  2.97967  2.97116  2.97198  2.95852     ....     ....     ....     ....
+ 58.6367N /   7:     ....     ....     ....     ....  2.98160  2.97500  2.96841  2.96017     ....     ....     ....     ....
+ 58.6297N /   6:     ....     ....     ....     ....  2.98132  2.97693  2.96896  2.96292  2.94946     ....     ....     ....
+ 58.6227N /   5:     ....     ....     ....     ....  2.98160  2.97665  2.97143  2.96155  2.95221     ....     ....     ....
+ 58.6157N /   4:     ....     ....     ....     ....  2.96951  2.96814  2.96484  2.95660  2.95138     ....     ....     ....
+ 58.6087N /   3:     ....     ....     ....     ....  2.95276  2.95138  2.94397  2.96127  2.94644     ....     ....     ....
+ 58.6017N /   2:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 58.5947N /   1:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 
+ 
+! ******** V500 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_odd_variable_name
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.041581
+ 2    /  2: -0.058374
+ 3    /  3: -0.157746
+ 4    /  4: -0.255541
+ 5    /  5: -0.350783
+ 6    /  6: -0.442520
+ 7    /  7: -0.529836
+ 8    /  8: -0.611858
+ 9    /  9: -0.687766
+ 10   / 10: -0.756802
+ 11   / 11: -0.818277
+ 12   / 12: -0.871576
+ 13   / 13: -0.916166
+ 14   / 14: -0.951602
+ 15   / 15: -0.977530
+ 16   / 16: -0.993691
+ 17   / 17: -0.999923
+ 18   / 18: -0.996165
+ 19   / 19: -0.982453
+ 20   / 20: -0.958924
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.891207
+ 2    /  2:  0.932039
+ 3    /  3:  0.963558
+ 4    /  4:  0.985450
+ 5    /  5:  0.997495
+ 6    /  6:  0.999574
+ 7    /  7:  0.991665
+ 8    /  8:  0.973848
+ 9    /  9:  0.946300
+ 10   / 10:  0.909297
+ 11   / 11:  0.863209
+ 12   / 12:  0.808496
+ 13   / 13:  0.745705
+ 14   / 14:  0.675463
+ 15   / 15:  0.598472
+ 16   / 16:  0.515501
+ 17   / 17:  0.427380
+ 18   / 18:  0.334988
+ 19   / 19:  0.239249
+ 20   / 20:  0.141120
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.863209
+ 2    /  2:  0.808496
+ 3    /  3:  0.745705
+ 4    /  4:  0.675463
+ 5    /  5:  0.598472
+ 6    /  6:  0.515501
+ 7    /  7:  0.427380
+ 8    /  8:  0.334988
+ 9    /  9:  0.239249
+ 10   / 10:  0.141120
+ 11   / 11:  0.041581
+ 12   / 12: -0.058374
+ 13   / 13: -0.157746
+ 14   / 14: -0.255541
+ 15   / 15: -0.350783
+ 16   / 16: -0.442520
+ 17   / 17: -0.529836
+ 18   / 18: -0.611858
+ 19   / 19: -0.687766
+ 20   / 20: -0.756802
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.925815
+ 2    /  2: -0.883455
+ 3    /  3: -0.832267
+ 4    /  4: -0.772764
+ 5    /  5: -0.705540
+ 6    /  6: -0.631267
+ 7    /  7: -0.550686
+ 8    /  8: -0.464602
+ 9    /  9: -0.373877
+ 10   / 10: -0.279415
+ 11   / 11: -0.182163
+ 12   / 12: -0.083090
+ 13   / 13:  0.016814
+ 14   / 14:  0.116549
+ 15   / 15:  0.215120
+ 16   / 16:  0.311541
+ 17   / 17:  0.404850
+ 18   / 18:  0.494114
+ 19   / 19:  0.578440
+ 20   / 20:  0.656987
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.818277
+ 2    /  2: -0.871576
+ 3    /  3: -0.916166
+ 4    /  4: -0.951602
+ 5    /  5: -0.977530
+ 6    /  6: -0.993691
+ 7    /  7: -0.999923
+ 8    /  8: -0.996165
+ 9    /  9: -0.982453
+ 10   / 10: -0.958924
+ 11   / 11: -0.925815
+ 12   / 12: -0.883455
+ 13   / 13: -0.832267
+ 14   / 14: -0.772764
+ 15   / 15: -0.705540
+ 16   / 16: -0.631267
+ 17   / 17: -0.550686
+ 18   / 18: -0.464602
+ 19   / 19: -0.373877
+ 20   / 20: -0.279415
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.84963
+ 2    /  2: -0.99041
+ 3    /  3: -1.12130
+ 4    /  4: -1.24099
+ 5    /  5: -1.34828
+ 6    /  6: -1.44209
+ 7    /  7: -1.52150
+ 8    /  8: -1.58571
+ 9    /  9: -1.63407
+ 10   / 10: -1.66610
+ 11   / 11: -1.68149
+ 12   / 12: -1.68007
+ 13   / 13: -1.66187
+ 14   / 14: -1.62707
+ 15   / 15: -1.57600
+ 16   / 16: -1.50919
+ 17   / 17: -1.42730
+ 18   / 18: -1.33115
+ 19   / 19: -1.22170
+ 20   / 20: -1.10004
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.730346
+ 7    /  7: -0.736317
+ 8    /  8: -0.732716
+ 9    /  9: -0.719579
+ 10   / 10: -0.697038
+ 11   / 11: -0.665317
+ 12   / 12: -0.624734
+ 13   / 13: -0.575694
+ 14   / 14: -0.518687
+ 15   / 15: -0.454283
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.441047
+ 7    /  7: -0.528071
+ 8    /  8: -0.609820
+ 9    /  9: -0.685476
+ 10   / 10: -0.754282
+ 11   / 11: -0.815552
+ 12   / 12: -0.868673
+ 13   / 13: -0.913115
+ 14   / 14: -0.948433
+ 15   / 15: -0.974274
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.996244
+ 7    /  7:  0.988362
+ 8    /  8:  0.970604
+ 9    /  9:  0.943148
+ 10   / 10:  0.906269
+ 11   / 11:  0.860334
+ 12   / 12:  0.805804
+ 13   / 13:  0.743222
+ 14   / 14:  0.673213
+ 15   / 15:  0.596479
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.25425
+ 2    /  2:  0.22114
+ 3    /  3:  0.19991
+ 4    /  4:  0.19245
+ 5    /  5:  0.20137
+ 6    /  6:  0.23088
+ 7    /  7:  0.28859
+ 8    /  8:  0.39076
+ 9    /  9:  0.58026
+ 10   / 10:  1.02106
+ 11   / 11:  3.45512
+ 12   / 12: -2.30685
+ 13   / 13: -0.72568
+ 14   / 14: -0.31668
+ 15   / 15: -0.09228
+ 16   / 16:  0.07275
+ 17   / 17:  0.21342
+ 18   / 18:  0.34296
+ 19   / 19:  0.46716
+ 20   / 20:  0.58869
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.0415808
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.999574
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.0799809
+ 6    /  6: -0.0855462
+ 7    /  7: -0.0902566
+ 8    /  8: -0.0940653
+ 9    /  9: -0.0969341
+ 10   / 10: -0.0988342
+ 11   / 11: -0.0997471
+ 12   / 12: -0.0996632
+ 13   / 13: -0.0985835
+ 14   / 14: -0.0965188
+ 15   / 15: -0.0934896
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_stream
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- L:3 T:   3
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:4 T:   4
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  37.0000
+ 2   / 2:  29.0000  41.0000
+ 3   / 3:  33.0000  45.0000
+ ---- L:2 T:   2
+ 1   / 1:  26.0000  38.0000
+ 2   / 2:  30.0000  42.0000
+ 3   / 3:  34.0000  46.0000
+ ---- L:3 T:   3
+ 1   / 1:  27.0000  39.0000
+ 2   / 2:  31.0000  43.0000
+ 3   / 3:  35.0000  47.0000
+ ---- L:4 T:   4
+ 1   / 1:  28.0000  40.0000
+ 2   / 2:  32.0000  44.0000
+ 3   / 3:  36.0000  48.0000
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- L:2 T:   2
+ 1   / 1:  13.0000  15.0000
+ 2   / 2:  17.0000  19.0000
+ 3   / 3:  21.0000  23.0000
+ ---- L:3 T:   3
+ 1   / 1:  25.0000  27.0000
+ 2   / 2:  29.0000  31.0000
+ 3   / 3:  33.0000  35.0000
+ ---- L:4 T:   4
+ 1   / 1:  37.0000  39.0000
+ 2   / 2:  41.0000  43.0000
+ 3   / 3:  45.0000  47.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+ ---- L:2 T:   2
+ 1   / 1:  14.0000  16.0000
+ 2   / 2:  18.0000  20.0000
+ 3   / 3:  22.0000  24.0000
+ ---- L:3 T:   3
+ 1   / 1:  26.0000  28.0000
+ 2   / 2:  30.0000  32.0000
+ 3   / 3:  34.0000  36.0000
+ ---- L:4 T:   4
+ 1   / 1:  38.0000  40.0000
+ 2   / 2:  42.0000  44.0000
+ 3   / 3:  46.0000  48.0000
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_define_axes
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_external_functions  ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_pattern
+! pattern_bench.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+ 
+set view full
+ 
+use coads_climatology
+set reg/l=3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+ 
+! Note that colors are set in the usual way...
+ 
+set win 1
+ 
+set mode meta pattern_plot1.plt
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns/nolabel sst
+ 
+go land thick
+ 
+! Colors and patterns can be overlaid; patterns are transparent
+ 
+set win 2
+ 
+set data coads_climatology
+set data clim_airt_lev.cdf
+set reg/l=1:3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+set mode meta pattern_plot2.plt
+fill/lev=(0,33,3)/nolabel sst[l=@ave,d=1]
+ 
+fill/lev=(25,27,1)/over/nolab/pal=black/pat=angled_grid/nolabel airt[l=@ave]
+label/user,200,-30,-1,0,.15, at trAIRT gt 25 and lt 27 deg. C
+ 
+go land thick
+ 
+!can data/all
+can win 2
+set win 1
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn_polygon
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn500_bug_fixes
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G012)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Mon Mar 17 15:53:35 PDT 2014
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+ 
+! ******** V510 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sample			! internal (optimized) SAMPLE* functions
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : JAN
+               79E      99E     119E    
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  28.5769  28.5925  28.1495
+ 1S   / 45:  28.3343  28.7146  28.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  29.1373  28.9243  28.3264
+ 1S   / 45:  28.8965  28.8240  28.5357
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : JAN
+                2     
+                2
+ 1N   / 46:  28.1992
+ 1S   / 45:  28.5607
+ -DELETE (C01,V02 M: 34 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 25 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 28 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 31 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 34 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 32 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+cancel memory/all
+ -DELETE A        M: 26 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 26 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE A        M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 32 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=20E:20E(380)@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[X=20E:20E(380)@IIN,D=1]
+ -DELETE          M: 32 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 23 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                 1           2           3       
+                  1           2           3
+ 1N   / 46:  182881720.  245818833.  306844239.
+ 1S   / 45:  183667676.  246892478.  309487473.
+cancel memory/all
+ -DELETE FSST     M: 22 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 25 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 31 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 31 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 33 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G017)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G017)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:  4.00000
+ 3   / 3:  7.00000
+ 4   / 4:     ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.000
+ 2   / 2:  114.000
+ 3   / 3:  117.000
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:     ....
+ 3   / 3:     ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.2222  28.1992     ....  28.4514
+ 1S   / 45:  28.1514  28.5607     ....  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.1992     ....  28.4514  28.2222
+ 1S   / 45:  28.5607     ....  28.8326  28.1514
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:     ....
+ 3   / 3:     ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:     ....
+ 3   / 3:  170.000
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G017)          NORMAL    (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 29 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 20 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 18 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V01 C: 12 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 14 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1978
+            largest free region: 1976
+            number of free regions: 3
+            free memory table slots: 478
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : JAN
+            179E    
+             80
+ 0   / 1:  22.6389
+ 5   / 2:  27.6389
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : JAN
+              1        2        3        4     
+              1        2        3        4
+ 0   / 1:  22.6389  23.5251  26.9131  29.2606
+ 5   / 2:  27.6389  28.5251  31.9131  34.2606
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  22.6389
+ 2   / 2:  29.2606
+ 3   / 3:  27.7269
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  23.5649  22.6150  21.9434  22.5531  22.5856  22.4436  21.9629  22.2754  21.6575
+ 2   / 2:  29.3521  29.1692  29.2257  29.4440  29.0923  29.3430  29.1310  28.6520  28.9082
+ 3   / 3:  27.9696  28.0578  27.8618  27.9059  27.4280  27.4100  27.3646  27.3974  27.1177
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : JAN
+          173.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  178.202
+ 3   / 3:  198.202
+ 4   / 4:  223.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  223.202
+ 3   / 3:  273.202
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  174.169  174.225  173.963  173.313  173.532  172.803  172.991  172.548  171.929
+ 2   / 2:  224.169  224.225  223.963  223.313  223.532  222.803  222.991  222.548  221.929
+ 3   / 3:  274.169  274.225  273.963  273.313  273.532  272.803  272.991  272.548  271.929
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+            179E    
+             80
+ 0   / 1:  28.2022
+ 5   / 2:  33.2022
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+              0        5     
+              1        2
+ 1   / 1:  28.3646  33.3646
+ 2   / 2:  28.3538  33.3538
+ 3   / 3:  28.2022  33.2022
+ 4   / 4:  28.3646  33.3646
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+            179E    
+             80
+ 1   / 1:  28.2022
+ 2   / 2:  28.2022
+ 3   / 3:  28.3646
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 2   / 2:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 3   / 3:  29.0509  29.1878  28.7239  29.5150  28.3287  28.1944  27.4815  27.4749  26.7886
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strides_revs_perms	! netCDF fancy reads
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1124.00  1125.00  1126.00
+ 3   / 3:  1133.00  1134.00  1135.00  1136.00
+ 4   / 4:  1143.00  1144.00  1145.00  1146.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1224.00  1225.00  1226.00
+ 3   / 3:  1233.00  1234.00  1235.00  1236.00
+ 4   / 4:  1243.00  1244.00  1245.00  1246.00
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.00  1142.00  1152.00  1162.00
+ 3   / 3:  1133.00  1143.00  1153.00  1163.00
+ 4   / 4:  1134.00  1144.00  1154.00  1164.00
+ ---- K:2 Z:   2
+ 2   / 2:  1232.00  1242.00  1252.00  1262.00
+ 3   / 3:  1233.00  1243.00  1253.00  1263.00
+ 4   / 4:  1234.00  1244.00  1254.00  1264.00
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1421.00  1521.00  1621.00
+ 3   / 3:  1331.00  1431.00  1531.00  1631.00
+ 4   / 4:  1341.00  1441.00  1541.00  1641.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1332.00  1432.00  1532.00  1632.00
+ 4   / 4:  1342.00  1442.00  1542.00  1642.00
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1412.00  1512.00  1612.00
+ 3   / 3:  1313.00  1413.00  1513.00  1613.00
+ 4   / 4:  1314.00  1414.00  1514.00  1614.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1323.00  1423.00  1523.00  1623.00
+ 4   / 4:  1324.00  1424.00  1524.00  1624.00
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1032.00  1033.00  1034.00
+ 2N   / 2:  1021.00  1022.00  1023.00  1024.00
+ 1N   / 1:  1011.00  1012.00  1013.00  1014.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2032.00  2033.00  2034.00
+ 2N   / 2:  2021.00  2022.00  2023.00  2024.00
+ 1N   / 1:  2011.00  2012.00  2013.00  2014.00
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1021.00  1031.00  1041.00
+ 142   / 2:  1012.00  1022.00  1032.00  1042.00
+ 143   / 3:  1013.00  1023.00  1033.00  1043.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2021.00  2031.00  2041.00
+ 142   / 2:  2012.00  2022.00  2032.00  2042.00
+ 143   / 3:  2013.00  2023.00  2033.00  2043.00
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  2031.00  3031.00  4031.00
+ 2N   / 2:  1021.00  2021.00  3021.00  4021.00
+ 1N   / 1:  1011.00  2011.00  3011.00  4011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  2032.00  3032.00  4032.00
+ 2N   / 2:  1022.00  2022.00  3022.00  4022.00
+ 1N   / 1:  1012.00  2012.00  3012.00  4012.00
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @AVE
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1113.67
+ 2   / 2:  1122.00  1123.67
+ 3   / 3:  1132.00  1133.67
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1213.67
+ 2   / 2:  1222.00  1223.67
+ 3   / 3:  1232.00  1233.67
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 47 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M: 54 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G010)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.3      0.48     0.6    
+             1        2        3        4
+          1111.00  1112.00  1113.00  1114.00
+cancel mem/all
+ -DELETE BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.9      1.87     2.65     3.3    
+             1        2        3        4        5
+          1111.00  1118.00  1115.00  1112.00  1119.00
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6    
+               1        2
+ 0    / 1:  1112.00  1114.00
+ 0.95 / 2:  1132.00  1134.00
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6      0.78   
+               1        2        3
+ 0    / 1:  1112.00  1114.00  1116.00
+ 0.95 / 2:  1132.00  1134.00  1136.00
+ 1.4  / 3:  1152.00  1154.00  1156.00
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1125.00  1127.00  1129.00
+ 3   / 3:  1133.00  1135.00  1137.00  1139.00
+ 4   / 4:  1143.00  1145.00  1147.00  1149.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1225.00  1227.00  1229.00
+ 3   / 3:  1233.00  1235.00  1237.00  1239.00
+ 4   / 4:  1243.00  1245.00  1247.00  1249.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1124.00  1125.00  1126.00
+ 4   / 2:  1143.00  1144.00  1145.00  1146.00
+ 6   / 3:  1163.00  1164.00  1165.00  1166.00
+ ---- K:2 Z:   2
+ 2   / 1:  1223.00  1224.00  1225.00  1226.00
+ 4   / 2:  1243.00  1244.00  1245.00  1246.00
+ 6   / 3:  1263.00  1264.00  1265.00  1266.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1521.00  1721.00  1921.00
+ 3   / 3:  1331.00  1531.00  1731.00  1931.00
+ 4   / 4:  1341.00  1541.00  1741.00  1941.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1332.00  1532.00  1732.00  1932.00
+ 4   / 4:  1342.00  1542.00  1742.00  1942.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1421.00  1521.00  1621.00
+ 4   / 2:  1341.00  1441.00  1541.00  1641.00
+ 6   / 3:  1361.00  1461.00  1561.00  1661.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1342.00  1442.00  1542.00  1642.00
+ 6   / 3:  1362.00  1462.00  1562.00  1662.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1512.00  1712.00  1912.00
+ 3   / 3:  1313.00  1513.00  1713.00  1913.00
+ 4   / 4:  1314.00  1514.00  1714.00  1914.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1323.00  1523.00  1723.00  1923.00
+ 4   / 4:  1324.00  1524.00  1724.00  1924.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1412.00  1512.00  1612.00
+ 4   / 2:  1314.00  1414.00  1514.00  1614.00
+ 6   / 3:  1316.00  1416.00  1516.00  1616.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1324.00  1424.00  1524.00  1624.00
+ 6   / 3:  1326.00  1426.00  1526.00  1626.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1512.00  1712.00  1912.00
+ 4   / 2:  1314.00  1514.00  1714.00  1914.00
+ 6   / 3:  1316.00  1516.00  1716.00  1916.00
+ ---- K:2 Z:   3
+ 2   / 1:  1332.00  1532.00  1732.00  1932.00
+ 4   / 2:  1334.00  1534.00  1734.00  1934.00
+ 6   / 3:  1336.00  1536.00  1736.00  1936.00
+canc data/all
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1033.00  1035.00  1037.00
+ 2N   / 2:  1021.00  1023.00  1025.00  1027.00
+ 1N   / 1:  1011.00  1013.00  1015.00  1017.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2033.00  2035.00  2037.00
+ 2N   / 2:  2021.00  2023.00  2025.00  2027.00
+ 1N   / 1:  2011.00  2013.00  2015.00  2017.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  1061.00  1062.00  1063.00  1064.00
+ 4N   / 2:  1041.00  1042.00  1043.00  1044.00
+ 2N   / 1:  1021.00  1022.00  1023.00  1024.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  2061.00  2062.00  2063.00  2064.00
+ 4N   / 2:  2041.00  2042.00  2043.00  2044.00
+ 2N   / 1:  2021.00  2022.00  2023.00  2024.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1031.00  1051.00  1071.00
+ 142   / 2:  1012.00  1032.00  1052.00  1072.00
+ 143   / 3:  1013.00  1033.00  1053.00  1073.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2031.00  2051.00  2071.00
+ 142   / 2:  2012.00  2032.00  2052.00  2072.00
+ 143   / 3:  2013.00  2033.00  2053.00  2073.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  1012.00  1022.00  1032.00  1042.00
+ 144   / 2:  1014.00  1024.00  1034.00  1044.00
+ 146   / 3:  1016.00  1026.00  1036.00  1046.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  2012.00  2022.00  2032.00  2042.00
+ 144   / 2:  2014.00  2024.00  2034.00  2044.00
+ 146   / 3:  2016.00  2026.00  2036.00  2046.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  3012.00  3032.00  3052.00  3072.00
+ 144   / 2:  3014.00  3034.00  3054.00  3074.00
+ 146   / 3:  3016.00  3036.00  3056.00  3076.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  5012.00  5032.00  5052.00  5072.00
+ 144   / 2:  5014.00  5034.00  5054.00  5074.00
+ 146   / 3:  5016.00  5036.00  5056.00  5076.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  3031.00  5031.00  7031.00
+ 2N   / 2:  1021.00  3021.00  5021.00  7021.00
+ 1N   / 1:  1011.00  3011.00  5011.00  7011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  3032.00  5032.00  7032.00
+ 2N   / 2:  1022.00  3022.00  5022.00  7022.00
+ 1N   / 1:  1012.00  3012.00  5012.00  7012.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.00  2061.00  3061.00  4061.00
+ 4N   / 2:  1041.00  2041.00  3041.00  4041.00
+ 2N   / 1:  1021.00  2021.00  3021.00  4021.00
+ ---- L:2 T:   142
+ 6N   / 3:  1062.00  2062.00  3062.00  4062.00
+ 4N   / 2:  1042.00  2042.00  3042.00  4042.00
+ 2N   / 1:  1022.00  2022.00  3022.00  4022.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.00  3063.00  5063.00  7063.00
+ 4N   / 2:  1043.00  3043.00  5043.00  7043.00
+ 2N   / 1:  1023.00  3023.00  5023.00  7023.00
+ ---- L:2 T:   145
+ 6N   / 3:  1065.00  3065.00  5065.00  7065.00
+ 4N   / 2:  1045.00  3045.00  5045.00  7045.00
+ 2N   / 1:  1025.00  3025.00  5025.00  7025.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- L:2 T:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- L:2 T:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- K:2 Z:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.00  1342.00
+ 5   / 2:  1385.00  1345.00
+ ---- K:2 Z:   5
+ 2   / 1:  1582.00  1542.00
+ 5   / 2:  1585.00  1545.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+GO bn_reset
+cancel mode verify
+GO bn_non_COARDS_netCDF		! non-standard netCDF files
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME4     TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  3.00000
+ 3   / 3:  5.00000
+ 4   / 4:  2.00000
+ 5   / 5:  4.00000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:     ....
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.0000
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.0000
+ 2   / 2:  40.0000
+ 3   / 3:  30.0000
+ 4   / 4:  20.0000
+ 5   / 5:  10.0000
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cache_hits		! cache hits on unspecified (full) regions
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTX     M: 40 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 33 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 86 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 90 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5X    M: 60 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5X    M: 64 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 57 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 59 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 70 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 76 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 85 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTSBX   M:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTSBX   M: 56 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXAVE  M: 14 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXAVE  M: 17 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 28 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 98 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 91 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 96 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XAVE M: 59 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XAVE M: 72 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 14 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 17 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 58 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 60 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 86 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 90 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 93 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 94 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 95 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 89 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C11,V11 M: 94 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 84 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.00000
+ 2   / 2:  5.00000
+ 3   / 3:  3.00000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 82 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 95 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 95 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 78 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.0000
+ 2   / 2:  12.0000
+ 3   / 3:  13.0000
+ 4   / 4:  21.0000
+ 5   / 5:  22.0000
+ 6   / 6:  23.0000
+ 7   / 7:  31.0000
+ 8   / 8:  32.0000
+ 9   / 9:  33.0000
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+ 
+GO bn_reset
+cancel mode verify
+ -DELETE SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  2 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 18 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 20 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 22 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C31,V11 M: 78 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C31,V11 M: 95 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 79 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 90 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 75 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 82 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+GO bn_regrid_to_user		! G=user_var and related
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.0000
+ 23E   / 2:  23.0000
+ 25E   / 3:  25.0000
+ 27E   / 4:  27.0000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G012)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX012)                         use count:   1
+    AXIS (AX020)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 2   / 2:   5.0000   7.0000   9.0000     ....
+ 3   / 3:   6.0000   8.0000  10.0000     ....
+ 4   / 4:   7.0000   9.0000  11.0000     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 3   / 2:   6.0000   8.0000  10.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX005)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G018)
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G011)
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX002)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.00000
+ 9.4S   / 4:  4.00000
+ 9.6S   / 3:  3.00000
+ 9.8S   / 2:  2.00000
+ 10S    / 1:  1.00000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G011)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX020)                         use count:   1
+ 
+ 
+! ******** V53 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_calendar
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.436165
+ 28-FEB-1988 00 / 58:  0.992873
+ 29-FEB-1988 00 / 59:  0.636738
+ 30-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 01-MAR-1988 00 / 60: -0.304811
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.8979
+ 03-DEC-1982 00 / 16:  32.9221
+ 10-DEC-1982 00 / 17:  32.9583
+ 17-DEC-1982 00 / 18:  32.9707
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 28-NOV-1982 00 / 15:  32.9508
+ 05-DEC-1982 00 / 16:  32.9011
+ 12-DEC-1982 00 / 17:  32.8862
+ 19-DEC-1982 00 / 18:  32.9099
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.9099
+ 03-DEC-1982 00 / 16:  32.9287
+ 10-DEC-1982 00 / 17:  32.9658
+ 17-DEC-1982 00 / 18:  32.9710
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT91_100 LONGITUDE          10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+             TIME: AUG-1982 to JAN-1983 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                    132.5W  
+                     98
+ 18-SEP-1982 / 2:  27.2694
+ 18-OCT-1982 / 3:  31.3241
+ 18-NOV-1982 / 4:  32.9011
+ 18-DEC-1982 / 5:  32.9710
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                         132.5W  
+                          98
+ 05-DEC-1982 00 / 108:     ....
+ 06-DEC-1982 00 / 109:  32.9340
+ 07-DEC-1982 00 / 110:  32.9401
+ 08-DEC-1982 00 / 111:  32.9462
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                    179E    
+                     80
+ 16-JAN      / 1:  28.2022
+ 15-FEB      / 2:  28.3646
+ 17-MAR      / 3:  28.3538
+ 16-AUG      / 4:     ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                    JSST    NSST
+01-JAN      / 1:     ....  28.2022
+31-JAN      / 2:  28.2832  28.2022
+01-MAR      / 3:  28.3592  28.3646
+01-APR      / 4:     ....  28.3538
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dash_dot
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ 
+GO bn_reset
+cancel mode verify
+GO bn_flowlines
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+ 
+! ******** V533 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_logaxes
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+ 
+! *kob* same tests for internal external functions but moved out of
+!       the bn_external_function jnl file.
+GO bn_reset
+cancel mode verify
+GO bn_internal_external_functions
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.013664
+ 0.00355 / 31:  0.021183
+ 0.00366 / 32:  0.048189
+ 0.00378 / 33:  0.498982
+ 0.00389 / 34:  0.052353
+ 0.00401 / 35:  0.032474
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.072791
+ 0.00584 / 51:  0.104108
+ 0.00595 / 52:  0.185372
+ 0.00607 / 53:  0.894540
+ 0.00618 / 54:  0.311122
+ 0.0063  / 55:  0.131705
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.057
+ 0       /  2: -176.112
+ 0       /  3: -174.161
+ 0       /  4: -172.203
+ 0       /  5: -170.234
+ 0       /  6: -168.251
+ 0       /  7: -166.250
+ 0       /  8: -164.228
+ 0.00103 /  9: -162.179
+ 0.00114 / 10: -160.100
+ 0.00126 / 11: -157.983
+ 0.00137 / 12: -155.821
+ 0.00149 / 13: -153.606
+ 0.0016  / 14: -151.326
+ 0.00172 / 15: -148.970
+ 0.00183 / 16: -146.520
+ 0.00195 / 17: -143.957
+ 0.00206 / 18: -141.255
+ 0.00217 / 19: -138.381
+ 0.00229 / 20: -135.294
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                  161W    
+                   90
+ 0        /  1:  1.99605
+ 0        /  2:  2.16839
+ 0        /  3:  0.17387
+ 0        /  4:  2.01530
+ 0        /  5:  0.35361
+ 0        /  6:  1.72488
+ 0        /  7:  1.25348
+ 0        /  8:  0.30416
+ 0        /  9:  1.65059
+ 0        / 10:  0.81359
+ 0        / 11:  0.15377
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                 1       
+                  21
+ 4     /  81:  0.249981
+ 4.05  /  82:  0.245294
+ 4.1   /  83:  0.240500
+ 4.15  /  84:  0.235600
+ 4.2   /  85:  0.230597
+ 4.25  /  86:  0.225493
+ 4.3   /  87:  0.220289
+ 4.35  /  88:  0.214988
+ 4.4   /  89:  0.209592
+ 4.45  /  90:  0.204102
+ 4.5   /  91:  0.198521
+ 4.55  /  92:  0.192851
+ 4.6   /  93:  0.187094
+ 4.65  /  94:  0.181253
+ 4.7   /  95:  0.175329
+ 4.75  /  96:  0.169325
+ 4.8   /  97:  0.163243
+ 4.85  /  98:  0.157086
+ 4.9   /  99:  0.150856
+ 4.95  / 100:  0.144555
+ 5     / 101:  0.138186
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.308984  0.361972  0.109085 -0.004967 -0.136744 -0.408450 -0.225496  0.151670  0.225024  0.073150
+ 1.5   /  2:  0.315638  0.371230  0.093750 -0.037386 -0.201756 -0.452435 -0.150009  0.278155  0.330914  0.069854
+ 2     /  3:  0.378812  0.315634  0.037083 -0.088708 -0.253832 -0.492242 -0.073700  0.374786  0.450968  0.081332
+ 2.5   /  4:  0.420045  0.252191 -0.063598 -0.144131 -0.252740 -0.466614  0.019391  0.439631  0.491399  0.089314
+ 3     /  5:  0.406392  0.198397 -0.139974 -0.197140 -0.279040 -0.425529  0.118978  0.432969  0.545303  0.085462
+ 3.5   /  6:  0.351014  0.169762 -0.201579 -0.257493 -0.283843 -0.357982  0.185850  0.585861  0.530755  0.058808
+ 4     /  7:  0.277107  0.096747 -0.246534 -0.289021 -0.258951 -0.329342  0.312474  0.641602  0.518714  0.021205
+ 4.5   /  8:  0.188951  0.044707 -0.312641 -0.319182 -0.213513 -0.222475  0.302121  0.626625  0.412068 -0.008475
+ 5     /  9:  0.139939 -0.037119 -0.323878 -0.333812 -0.199768 -0.134206  0.265570  0.577839  0.312094 -0.056718
+ 5.5   / 10:  0.078577 -0.096394 -0.338922 -0.312885 -0.172743 -0.085023  0.206702  0.482419  0.235803 -0.079778
+ 6     / 11:  0.007372 -0.135345 -0.377702 -0.274110 -0.121663 -0.019270  0.173802  0.354012  0.148779 -0.122582
+ 6.5   / 12: -0.071091 -0.209142 -0.370362 -0.249289 -0.041035  0.069505  0.148512  0.236838  0.045584 -0.173237
+ 7     / 13: -0.137482 -0.254334 -0.378632 -0.228148  0.063018  0.183000  0.135520  0.132174 -0.050976 -0.215292
+ 7.5   / 14: -0.202760 -0.266868 -0.346402 -0.210460  0.168372  0.279647  0.178541  0.064025 -0.115153 -0.228150
+ 8     / 15: -0.275191 -0.259180 -0.300179 -0.155421  0.233304  0.351951  0.219702  0.033928 -0.135697 -0.218938
+ 8.5   / 16: -0.326812 -0.273253 -0.245151 -0.113795  0.264889  0.402452  0.253275  0.029382 -0.138544 -0.200463
+ 9     / 17: -0.351551 -0.266762 -0.164899 -0.032110  0.276385  0.437033  0.281707  0.036426 -0.134209 -0.191118
+ 9.5   / 18: -0.364215 -0.240170 -0.093384  0.038122  0.276072  0.442607  0.294658  0.049712 -0.140883 -0.217410
+ 10    / 19: -0.369196 -0.210353 -0.040323  0.103110  0.280278  0.405237  0.298599  0.066760 -0.138644 -0.252572
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.290994  0.424162  0.097006  0.003143 -0.136744 -0.412297 -0.207808      ....  0.241076      ....
+ 1.5   /  2:  0.314929  0.373640  0.124083 -0.001456 -0.201756 -0.441151 -0.189145  0.331034  0.333491  0.005624
+ 2     /  3:  0.337643  0.312076  0.046130 -0.011788 -0.267158 -0.486359 -0.073700      ....  0.461555      ....
+ 2.5   /  4:  0.359734  0.242399 -0.066085      .... -0.243857 -0.457333 -0.031104  0.417939  0.473995  0.200894
+ 3     /  5:      ....  0.198698 -0.131262 -0.203700 -0.277160 -0.388506  0.065758  0.434211  0.539378      ....
+ 3.5   /  6:  0.310287  0.169976 -0.216298 -0.249436 -0.282498 -0.336468  0.156727  0.537358  0.505391  0.142444
+ 4     /  7:  0.274766  0.091884 -0.274252 -0.239529 -0.262206 -0.333969  0.312474  0.580377  0.520608  0.093618
+ 4.5   /  8:  0.184044  0.041657 -0.304953      .... -0.210582 -0.196012  0.326227  0.576412  0.366262  0.059061
+ 5     /  9:  0.146796 -0.044536 -0.353323 -0.375483 -0.190888 -0.106617  0.284743  0.521940  0.278387 -0.035055
+ 5.5   / 10:  0.041582 -0.109698 -0.335399 -0.325452      .... -0.088590  0.221990  0.438637  0.235803  0.041225
+ 6     / 11: -0.012273 -0.174380 -0.371063 -0.263403      ....      ....  0.172629  0.346297  0.219052      ....
+ 6.5   / 12: -0.064809 -0.127226 -0.366128 -0.245270      ....  0.104409  0.165680  0.242858  0.095140      ....
+ 7     / 13: -0.138619      .... -0.379843 -0.230018      ....  0.181947  0.135892  0.164309 -0.026041 -0.204659
+ 7.5   / 14: -0.203907 -0.289087 -0.346009 -0.209873  0.169451  0.272161  0.184553  0.103343 -0.114248      ....
+ 8     / 15: -0.285911 -0.258721 -0.300520 -0.170515  0.240968  0.352162  0.229361  0.066151 -0.135985      ....
+ 8.5   / 16: -0.329428 -0.279209 -0.236667 -0.125716  0.292407  0.388989  0.256564      .... -0.139683 -0.183944
+ 9     / 17: -0.341597 -0.268585 -0.177502 -0.064298  0.277369  0.431662  0.288204  0.023055 -0.139178 -0.195303
+ 9.5   / 18: -0.343919 -0.225702 -0.093580  0.013191  0.253357  0.442399  0.294693  0.034103 -0.137639 -0.211783
+ 10    / 19:      .... -0.204222 -0.021547      ....      ....  0.421118  0.287954      .... -0.144731 -0.203650
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.274901  0.351990  0.125870  0.000547 -0.130676 -0.409444 -0.196473  0.113026  0.291807  0.128390
+ 1.5   /  2:  0.299222  0.340543  0.124519 -0.061100 -0.263759 -0.435083 -0.176723  0.348424  0.372371  0.128390
+ 2     /  3:  0.281567  0.320514  0.026296 -0.110384 -0.295665 -0.434870 -0.190697  0.460511  0.445156  0.191902
+ 2.5   /  4:  0.290517  0.274621 -0.063970 -0.166628 -0.264776 -0.417589 -0.116164  0.537969  0.442169  0.264943
+ 3     /  5:  0.291464  0.248219 -0.125567 -0.223844 -0.256285 -0.371561  0.247717  0.497526  0.452304  0.276328
+ 3.5   /  6:  0.267037  0.177128 -0.170576 -0.230988 -0.274809 -0.281194  0.254637  0.510104  0.422794  0.248322
+ 4     /  7:  0.225394  0.114379 -0.176660 -0.227903 -0.272403 -0.244676  0.280180  0.544886  0.397193  0.212214
+ 4.5   /  8:  0.189285  0.081180 -0.332907 -0.343445 -0.230804 -0.244260  0.339829  0.530983  0.335082  0.061286
+ 5     /  9:  0.127042  0.039043 -0.356226 -0.369075 -0.177935 -0.153186  0.253590  0.499044  0.303545  0.025609
+ 5.5   / 10:  0.048635 -0.126901 -0.331398 -0.289789 -0.162591 -0.082396  0.192227  0.401098  0.303746  0.055576
+ 6     / 11: -0.037713 -0.136552 -0.336681 -0.268753 -0.197051  0.016254  0.209390  0.295370  0.263940 -0.135684
+ 6.5   / 12: -0.064917 -0.134912 -0.359398 -0.220212 -0.011644  0.110802  0.164667  0.259319  0.078530 -0.137706
+ 7     / 13: -0.103972 -0.140560 -0.362975 -0.166853  0.066535  0.193231  0.149487  0.141794 -0.113016 -0.143405
+ 7.5   / 14: -0.199710 -0.279592 -0.339043 -0.191829  0.185240  0.262158  0.152165  0.039367 -0.115781 -0.151274
+ 8     / 15: -0.235285 -0.278212 -0.283035 -0.157240  0.250258  0.333134  0.204490  0.017943 -0.115931 -0.171603
+ 8.5   / 16: -0.306008 -0.278546 -0.240470 -0.100659  0.251651  0.363846  0.251194  0.080410 -0.130532 -0.187823
+ 9     / 17: -0.335648 -0.266336 -0.213641  0.013456  0.288406  0.405273  0.272644  0.141238 -0.142601 -0.193561
+ 9.5   / 18: -0.349458 -0.212960 -0.108340  0.097657  0.205467  0.422547  0.294706  0.116317 -0.143410 -0.195569
+ 10    / 19: -0.353035 -0.181573 -0.086119  0.078837  0.108731  0.420380  0.321587  0.036216 -0.151253 -0.191472
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.281552  0.312213  0.193558 -0.030592 -0.206961 -0.317374 -0.200235  0.035776  0.251615  0.217897
+ 1.5   /  2:  0.275271  0.296173  0.155526 -0.085149 -0.266966 -0.350539 -0.202341  0.168678  0.341517  0.274690
+ 2     /  3:  0.267170  0.260868  0.085385 -0.139671 -0.296632 -0.356898 -0.159219  0.302176  0.393862  0.319020
+ 2.5   /  4:  0.256878  0.203678  0.000735 -0.176300 -0.300338 -0.332200 -0.037496  0.393557  0.416391  0.336288
+ 3     /  5:  0.242290  0.152878 -0.057424 -0.197874 -0.288975 -0.265744  0.103144  0.430207  0.412825  0.327333
+ 3.5   /  6:  0.222556  0.121831 -0.090666 -0.216330 -0.271362 -0.184480  0.187704  0.436022  0.391648  0.301597
+ 4     /  7:  0.199438  0.094153 -0.126981 -0.240001 -0.252964 -0.137926  0.223192  0.431619  0.360695  0.262091
+ 4.5   /  8:  0.165055  0.052904 -0.183379 -0.267119 -0.231965 -0.117235  0.236822  0.416791  0.325354  0.213933
+ 5     /  9:  0.103166 -0.013463 -0.234016 -0.283000 -0.207964 -0.093414  0.234809  0.379625  0.299928  0.181999
+ 5.5   / 10:  0.019557 -0.082190 -0.253614 -0.280357 -0.179994 -0.046106  0.219394  0.327974  0.276824  0.165491
+ 6     / 11: -0.043123 -0.124439 -0.262702 -0.257404 -0.115678  0.036003  0.200459  0.273757  0.219858  0.088693
+ 6.5   / 12: -0.080238 -0.159570 -0.282392 -0.216326  0.011196  0.126375  0.181603  0.207992  0.109108 -0.036546
+ 7     / 13: -0.125137 -0.215907 -0.293904 -0.180571  0.098961  0.191463  0.171154  0.130122 -0.005575 -0.104958
+ 7.5   / 14: -0.186850 -0.262803 -0.283642 -0.149158  0.150674  0.242358  0.181345  0.073483 -0.066151 -0.129099
+ 8     / 15: -0.238052 -0.273211 -0.262614 -0.116643  0.191858  0.284230  0.210919  0.059208 -0.090155 -0.143986
+ 8.5   / 16: -0.274654 -0.269613 -0.239107 -0.087178  0.223535  0.315867  0.242668  0.071672 -0.107088 -0.159422
+ 9     / 17: -0.300031 -0.259464 -0.211792 -0.059935  0.246533  0.340287  0.266976  0.081553 -0.124034 -0.168991
+ 9.5   / 18: -0.314125 -0.241656 -0.177924 -0.031561  0.260916  0.358325  0.284307  0.073478 -0.135647 -0.172063
+ 10    / 19: -0.318713 -0.220992 -0.146630 -0.009841  0.266488  0.369766  0.296933  0.053734 -0.142473 -0.172360
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G010)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                 50E      52.1E    54.2E    56.3E    58.4E    60.5E    62.6E    64.7E    66.8E    68.9E  
+                  1        3        5        7        9       11       13       15       17       19
+ 20N    / 20:     ....     ....     ....     ....  143.990  241.090     ....     ....     ....     ....
+ 19.47N / 19:     ....     ....     ....     ....  117.831  207.449  172.925     ....     ....     ....
+ 18.95N / 18:     ....     ....     ....  137.758  107.307   98.003     ....     ....     ....     ....
+ 18.42N / 17:     ....     ....     ....  161.079  156.071    7.072   16.239     ....     ....     ....
+ 17.89N / 16:     ....     ....     ....  179.862  189.128   81.665     ....     ....     ....     ....
+ 17.37N / 15:     ....     ....     ....  165.097  200.741  145.418     ....     ....     ....     ....
+ 16.84N / 14:     ....     ....     ....  128.322  183.027  168.029  182.582     ....     ....     ....
+ 16.32N / 13:     ....     ....   76.347   92.413  158.520  190.506  197.367     ....     ....     ....
+ 15.79N / 12:     ....     ....     ....   80.307     ....  189.841  195.829     ....     ....     ....
+ 15.26N / 11:     ....     ....     ....   72.161     ....  187.475  191.467     ....     ....     ....
+ 14.74N / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 14.21N /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.68N /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.16N /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.63N /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.11N /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.58N /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.05N /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10.53N /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10N    /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 28N   / 10:      ....  0.000000 -0.017348 -0.052117 -0.086972 -0.121869 -0.156767 -0.191621 -0.226391 -0.243739      ....
+ 26N   /  9:      ....  0.017348  0.000000 -0.034770 -0.069624 -0.104522 -0.139419 -0.174274 -0.209043 -0.226391      ....
+ 24N   /  8:      ....  0.052117  0.034770  0.000000 -0.034855 -0.069752 -0.104649 -0.139504 -0.174274 -0.191621      ....
+ 22N   /  7:      ....  0.086972  0.069624  0.034855  0.000000 -0.034897 -0.069794 -0.104649 -0.139419 -0.156767      ....
+ 20N   /  6:      ....  0.121869  0.104522  0.069752  0.034897  0.000000 -0.034897 -0.069752 -0.104522 -0.121869      ....
+ 18N   /  5:      ....  0.156767  0.139419  0.104649  0.069794  0.034897  0.000000 -0.034855 -0.069624 -0.086972      ....
+ 16N   /  4:      ....  0.191621  0.174274  0.139504  0.104649  0.069752  0.034855  0.000000 -0.034770 -0.052117      ....
+ 14N   /  3:      ....  0.226391  0.209043  0.174274  0.139419  0.104522  0.069624  0.034770  0.000000 -0.017348      ....
+ 12N   /  2:      ....  0.243739  0.226391  0.191621  0.156767  0.121869  0.086972  0.052117  0.017348  0.000000      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      .... -0.057531 -0.086987 -0.119152 -0.153259 -0.187881 -0.221435 -0.252146 -0.279109      ....
+ 28N   / 10:      ....  0.001469 -0.031719 -0.066314 -0.100631 -0.135459 -0.170322 -0.204898 -0.238648 -0.268796 -0.279109
+ 26N   /  9:      ....  0.030054  0.001289 -0.034598 -0.069227 -0.104122 -0.139020 -0.173835 -0.208160 -0.238648 -0.252146
+ 24N   /  8:      ....  0.062225  0.036296 -0.000330 -0.034822 -0.069721 -0.104621 -0.139444 -0.173835 -0.204898 -0.221435
+ 22N   /  7:      ....  0.096660  0.071306  0.034440  0.000001 -0.034898 -0.069798 -0.104621 -0.139020 -0.170322 -0.187881
+ 20N   /  6:      ....  0.131820  0.106170  0.069324  0.034901  0.000001 -0.034898 -0.069721 -0.104122 -0.135459 -0.153259
+ 18N   /  5:      ....  0.166766  0.141022  0.104198  0.069800  0.034901  0.000001 -0.034822 -0.069227 -0.100631 -0.119152
+ 16N   /  4:      ....  0.200738  0.175293  0.138438  0.104198  0.069324  0.034440 -0.000330 -0.034598 -0.066314 -0.086987
+ 14N   /  3:      ....  0.233148  0.215255  0.175293  0.141022  0.106170  0.071306  0.036296  0.001289 -0.031719 -0.057531
+ 12N   /  2:      ....      ....  0.233148  0.200738  0.166766  0.131820  0.096660  0.062225  0.030054  0.001469      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+           SMXZ_XS   SMXZ_ZS   SMXZ
+1    /  1:  173.000  15.0000  1.51981
+2    /  2:  174.000  15.0000  1.50247
+3    /  3:  175.000  15.0000  1.48510
+4    /  4:  176.000  15.0000  1.46770
+5    /  5:  177.000  15.0000  1.45028
+6    /  6:  178.000  15.0000  1.43284
+7    /  7:  179.000  15.0000  1.41539
+8    /  8:  180.000  15.0000  1.39794
+9    /  9: -179.000  15.0000  1.38049
+10   / 10: -178.000  15.0000  1.36304
+11   / 11: -177.000  15.0000  1.34560
+12   / 12: -176.000  15.0000  1.32818
+13   / 13: -175.000  15.0000  1.31078
+14   / 14: -174.000  15.0000  1.29341
+15   / 15: -173.000  15.0000  1.27607
+16   / 16:  173.000  20.0000  1.59899
+17   / 17:  174.000  20.0000  1.58165
+18   / 18:  175.000  20.0000  1.56428
+19   / 19:  176.000  20.0000  1.54688
+20   / 20:  177.000  20.0000  1.52946
+21   / 21:  178.000  20.0000  1.51202
+22   / 22:  179.000  20.0000  1.49457
+23   / 23:  180.000  20.0000  1.47712
+24   / 24: -179.000  20.0000  1.45967
+25   / 25: -178.000  20.0000  1.44222
+26   / 26: -177.000  20.0000  1.42479
+27   / 27: -176.000  20.0000  1.40736
+28   / 28: -175.000  20.0000  1.38997
+29   / 29: -174.000  20.0000  1.37259
+30   / 30: -173.000  20.0000  1.35525
+31   / 31:  173.000  25.0000  1.66594
+32   / 32:  174.000  25.0000  1.64860
+33   / 33:  175.000  25.0000  1.63122
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+           SMXT_XS   SMXT_TS   SMXT
+1    /  1:  173.000   273.75  2.63208
+2    /  2:  174.000   273.75  2.61474
+3    /  3:  175.000   273.75  2.59737
+4    /  4:  176.000   273.75  2.57997
+5    /  5:  177.000   273.75  2.56255
+6    /  6:  178.000   273.75  2.54511
+7    /  7:  179.000   273.75  2.52766
+8    /  8:  180.000   273.75  2.51021
+9    /  9: -179.000   273.75  2.49276
+10   / 10: -178.000   273.75  2.47531
+11   / 11: -177.000   273.75  2.45787
+12   / 12: -176.000   273.75  2.44045
+13   / 13: -175.000   273.75  2.42305
+14   / 14: -174.000   273.75  2.40568
+15   / 15: -173.000   273.75  2.38834
+16   / 16:  173.000   821.25  3.06201
+17   / 17:  174.000   821.25  3.04467
+18   / 18:  175.000   821.25  3.02730
+19   / 19:  176.000   821.25  3.00990
+20   / 20:  177.000   821.25  2.99248
+21   / 21:  178.000   821.25  2.97504
+22   / 22:  179.000   821.25  2.95760
+23   / 23:  180.000   821.25  2.94014
+24   / 24: -179.000   821.25  2.92269
+25   / 25: -178.000   821.25  2.90524
+26   / 26: -177.000   821.25  2.88781
+27   / 27: -176.000   821.25  2.87039
+28   / 28: -175.000   821.25  2.85299
+29   / 29: -174.000   821.25  2.83561
+30   / 30: -173.000   821.25  2.81827
+31   / 31:  173.000  1368.75  3.27378
+32   / 32:  174.000  1368.75  3.25643
+33   / 33:  175.000  1368.75  3.23906
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+           SMYZ_YS   SMYZ_ZS   SMYZ
+1    /  1:  13.0000  15.0000  1.51981
+2    /  2:  14.0000  15.0000  1.50247
+3    /  3:  15.0000  15.0000  1.48510
+4    /  4:  16.0000  15.0000  1.46770
+5    /  5:  17.0000  15.0000  1.45028
+6    /  6:  18.0000  15.0000  1.43284
+7    /  7:  19.0000  15.0000  1.41539
+8    /  8:  20.0000  15.0000  1.39794
+9    /  9:  21.0000  15.0000  1.38049
+10   / 10:  22.0000  15.0000  1.36304
+11   / 11:  23.0000  15.0000  1.34560
+12   / 12:  24.0000  15.0000  1.32818
+13   / 13:  25.0000  15.0000  1.31078
+14   / 14:  26.0000  15.0000  1.29341
+15   / 15:  27.0000  15.0000  1.27607
+16   / 16:  13.0000  20.0000  1.59899
+17   / 17:  14.0000  20.0000  1.58165
+18   / 18:  15.0000  20.0000  1.56428
+19   / 19:  16.0000  20.0000  1.54688
+20   / 20:  17.0000  20.0000  1.52946
+21   / 21:  18.0000  20.0000  1.51202
+22   / 22:  19.0000  20.0000  1.49457
+23   / 23:  20.0000  20.0000  1.47712
+24   / 24:  21.0000  20.0000  1.45967
+25   / 25:  22.0000  20.0000  1.44222
+26   / 26:  23.0000  20.0000  1.42479
+27   / 27:  24.0000  20.0000  1.40736
+28   / 28:  25.0000  20.0000  1.38997
+29   / 29:  26.0000  20.0000  1.37259
+30   / 30:  27.0000  20.0000  1.35525
+31   / 31:  13.0000  25.0000  1.66594
+32   / 32:  14.0000  25.0000  1.64860
+33   / 33:  15.0000  25.0000  1.63122
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+           SMYT_YS   SMYT_TS   SMYT
+1    /  1:  13.0000   273.75  2.63208
+2    /  2:  14.0000   273.75  2.61474
+3    /  3:  15.0000   273.75  2.59737
+4    /  4:  16.0000   273.75  2.57997
+5    /  5:  17.0000   273.75  2.56255
+6    /  6:  18.0000   273.75  2.54511
+7    /  7:  19.0000   273.75  2.52766
+8    /  8:  20.0000   273.75  2.51021
+9    /  9:  21.0000   273.75  2.49276
+10   / 10:  22.0000   273.75  2.47531
+11   / 11:  23.0000   273.75  2.45787
+12   / 12:  24.0000   273.75  2.44045
+13   / 13:  25.0000   273.75  2.42305
+14   / 14:  26.0000   273.75  2.40568
+15   / 15:  27.0000   273.75  2.38834
+16   / 16:  13.0000   821.25  3.06201
+17   / 17:  14.0000   821.25  3.04467
+18   / 18:  15.0000   821.25  3.02730
+19   / 19:  16.0000   821.25  3.00990
+20   / 20:  17.0000   821.25  2.99248
+21   / 21:  18.0000   821.25  2.97504
+22   / 22:  19.0000   821.25  2.95760
+23   / 23:  20.0000   821.25  2.94014
+24   / 24:  21.0000   821.25  2.92269
+25   / 25:  22.0000   821.25  2.90524
+26   / 26:  23.0000   821.25  2.88781
+27   / 27:  24.0000   821.25  2.87039
+28   / 28:  25.0000   821.25  2.85299
+29   / 29:  26.0000   821.25  2.83561
+30   / 30:  27.0000   821.25  2.81827
+31   / 31:  13.0000  1368.75  3.27378
+32   / 32:  14.0000  1368.75  3.25643
+33   / 33:  15.0000  1368.75  3.23906
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+           SMZT_ZS   SMZT_TS   SMZT
+1    /  1:  15.0000   273.75  3.90815
+2    /  2:  20.0000   273.75  3.98733
+3    /  3:  25.0000   273.75  4.05428
+4    /  4:  30.0000   273.75  4.11227
+5    /  5:  35.0000   273.75  4.16342
+6    /  6:  40.0000   273.75  4.20918
+7    /  7:  45.0000   273.75  4.25057
+8    /  8:  50.0000   273.75  4.28836
+9    /  9:  55.0000   273.75  4.32312
+10   / 10:  60.0000   273.75  4.35531
+11   / 11:  65.0000   273.75  4.38527
+12   / 12:  70.0000   273.75  4.41330
+13   / 13:  75.0000   273.75  4.43963
+14   / 14:  80.0000   273.75  4.46445
+15   / 15:  85.0000   273.75  4.48793
+16   / 16:  15.0000   821.25  4.33808
+17   / 17:  20.0000   821.25  4.41726
+18   / 18:  25.0000   821.25  4.48421
+19   / 19:  30.0000   821.25  4.54220
+20   / 20:  35.0000   821.25  4.59336
+21   / 21:  40.0000   821.25  4.63911
+22   / 22:  45.0000   821.25  4.68051
+23   / 23:  50.0000   821.25  4.71829
+24   / 24:  55.0000   821.25  4.75306
+25   / 25:  60.0000   821.25  4.78524
+26   / 26:  65.0000   821.25  4.81520
+27   / 27:  70.0000   821.25  4.84323
+28   / 28:  75.0000   821.25  4.86956
+29   / 29:  80.0000   821.25  4.89439
+30   / 30:  85.0000   821.25  4.91787
+31   / 31:  15.0000  1368.75  4.54985
+32   / 32:  20.0000  1368.75  4.62903
+33   / 33:  25.0000  1368.75  4.69597
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  3.90815  3.98474  4.11082  4.20825  4.28772  4.35484  4.41294  4.46417  4.48793     ....
+ 15-FEB-1995 /  2:     ....  4.44396  4.52055  4.64663  4.74407  4.82353  4.89065  4.94875  4.99998  5.02375     ....
+ 18-MAR-1995 /  3:     ....  4.69158  4.76817  4.89425  4.99168  5.07115  5.13827  5.19637  5.24760  5.27136     ....
+ 17-APR-1995 /  4:     ....  4.79826  4.87485  5.00093  5.09837  5.17783  5.24495  5.30305  5.35428  5.37805     ....
+ 17-MAY-1995 /  5:     ....  4.91957  4.99616  5.12224  5.21967  5.29914  5.36626  5.42436  5.47559  5.49935     ....
+ 17-JUN-1995 /  6:     ....  5.01664  5.09323  5.21931  5.31675  5.39621  5.46333  5.52143  5.57266  5.59643     ....
+ 17-JUL-1995 /  7:     ....  5.07038  5.14697  5.27305  5.37049  5.44995  5.51707  5.57517  5.62640  5.65017     ....
+ 17-AUG-1995 /  8:     ....  5.13974  5.21633  5.34241  5.43984  5.51931  5.58643  5.64453  5.69576  5.71952     ....
+ 16-SEP-1995 /  9:     ....  5.20046  5.27705  5.40313  5.50056  5.58003  5.64714  5.70525  5.75648  5.78024     ....
+ 16-OCT-1995 / 10:     ....  5.23640  5.31298  5.43907  5.53650  5.61597  5.68308  5.74119  5.79241  5.81618     ....
+ 16-NOV-1995 / 11:     ....  5.28500  5.36159  5.48767  5.58511  5.66457  5.73169  5.78979  5.84102  5.86479     ....
+ 16-DEC-1995 / 12:     ....  5.32921  5.40580  5.53188  5.62931  5.70878  5.77589  5.83400  5.88523  5.90899     ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  4.01260  4.01103  4.18210  4.27779  4.35640  4.42302  4.48082  4.53115  4.59056  4.66549
+ 15-FEB-1995 /  2:     ....  4.33307  4.54051  4.67120  4.76690  4.84550  4.91213  4.96992  5.02025  5.05263  4.98503
+ 18-MAR-1995 /  3:     ....  4.58238  4.74650  4.87751  4.97320  5.05181  5.11843  5.17623  5.22656  5.25909  5.23387
+ 17-APR-1995 /  4:     ....  4.74816  4.87728  5.01937  5.11506  5.19367  5.26030  5.31809  5.36842  5.40831  5.39943
+ 17-MAY-1995 /  5:     ....  4.86788  4.98645  5.12825  5.22394  5.30254  5.36917  5.42697  5.47730  5.51696  5.51891
+ 17-JUN-1995 /  6:     ....  4.95864  5.07392  5.21453  5.31022  5.38882  5.45545  5.51325  5.56358  5.60243  5.60948
+ 17-JUL-1995 /  7:     ....  5.02839  5.14132  5.28493  5.38062  5.45923  5.52585  5.58365  5.63398  5.67485  5.67935
+ 17-AUG-1995 /  8:     ....  5.09002  5.20515  5.34732  5.44301  5.52162  5.58824  5.64604  5.69637  5.73635  5.74158
+ 16-SEP-1995 /  9:     ....  5.14392  5.26070  5.40159  5.49728  5.57588  5.64251  5.70031  5.75064  5.78987  5.79641
+ 16-OCT-1995 / 10:     ....  5.18891  5.30597  5.44856  5.54425  5.62285  5.68948  5.74728  5.79761  5.83810  5.84235
+ 16-NOV-1995 / 11:     ....  5.23042  5.35103  5.49229  5.58798  5.66658  5.73321  5.79101  5.84134  5.88103  5.88458
+ 16-DEC-1995 / 12:     ....  5.26827  5.39059  5.53066  5.62635  5.70495  5.77158  5.82938  5.87971  5.91865  5.92282
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G017)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                 68.25N   68.75N   69.25N   69.75N   70.25N   70.75N   71.25N   71.75N  
+                  43       44       45       46       47       48       49       50
+ 15.5E / -105:     ....     ....     ....     ....     ....     ....     ....     ....
+ 16.5E / -104:     ....     ....     ....     ....     ....     ....     ....     ....
+ 17.5E / -103:     ....     ....     ....     ....     ....     ....     ....     ....
+ 18.5E / -102:     ....     ....     ....  0.45146  0.25859     ....     ....     ....
+ 19.5E / -101:     ....     ....  0.67000  0.52258  0.17310  0.04000     ....     ....
+ 20.5E / -100:     ....     ....     ....  0.45141  0.25856     ....     ....     ....
+ 21.5E /  -99:     ....     ....     ....     ....     ....     ....     ....     ....
+ 22.5E /  -98:     ....     ....     ....     ....     ....     ....     ....     ....
+ 23.5E /  -97:     ....     ....     ....     ....     ....     ....     ....     ....
+ 24.5E /  -96:     ....     ....     ....     ....     ....     ....     ....     ....
+ 25.5E /  -95:     ....     ....     ....     ....     ....     ....     ....     ....
+ 26.5E /  -94:     ....     ....     ....     ....     ....     ....     ....     ....
+ 27.5E /  -93:     ....     ....     ....     ....     ....     ....     ....     ....
+ 28.5E /  -92:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 29.5E /  -91:     ....     ....     ....  1.17000  1.17000  1.17000     ....     ....
+ 30.5E /  -90:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 31.5E /  -89:     ....     ....     ....     ....     ....     ....     ....     ....
+ 32.5E /  -88:     ....     ....     ....     ....     ....     ....     ....     ....
+ 33.5E /  -87:     ....     ....     ....     ....     ....     ....     ....     ....
+ 34.5E /  -86:     ....     ....     ....     ....     ....     ....     ....     ....
+ 35.5E /  -85:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 36.5E /  -84:     ....  1.34000  1.34000  1.34000     ....     ....     ....     ....
+ 37.5E /  -83:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 38.5E /  -82:     ....     ....     ....     ....     ....     ....     ....     ....
+ 39.5E /  -81:     ....     ....     ....     ....     ....     ....     ....     ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+          SMXYT_XS  SMXYT_YS SMXYT_TS   SMXYT
+1    /  1:  173.000  13.0000  273.750  2.75395
+2    /  2:  174.000  13.0000  273.750  2.73661
+3    /  3:  175.000  13.0000  273.750  2.71923
+4    /  4:  176.000  13.0000  273.750  2.70184
+5    /  5:  177.000  13.0000  273.750  2.68442
+6    /  6:  178.000  13.0000  273.750  2.66698
+7    /  7:  179.000  13.0000  273.750  2.64953
+8    /  8:  180.000  13.0000  273.750  2.63208
+9    /  9: -179.000  13.0000  273.750  2.61463
+10   / 10: -178.000  13.0000  273.750  2.59718
+11   / 11: -177.000  13.0000  273.750  2.57974
+12   / 12: -176.000  13.0000  273.750  2.56232
+13   / 13: -175.000  13.0000  273.750  2.54492
+14   / 14: -174.000  13.0000  273.750  2.52755
+15   / 15: -173.000  13.0000  273.750  2.51021
+16   / 16:  173.000  14.0000  273.750  2.73661
+17   / 17:  174.000  14.0000  273.750  2.71927
+18   / 18:  175.000  14.0000  273.750  2.70189
+19   / 19:  176.000  14.0000  273.750  2.68449
+20   / 20:  177.000  14.0000  273.750  2.66707
+21   / 21:  178.000  14.0000  273.750  2.64964
+22   / 22:  179.000  14.0000  273.750  2.63219
+23   / 23:  180.000  14.0000  273.750  2.61474
+24   / 24: -179.000  14.0000  273.750  2.59729
+25   / 25: -178.000  14.0000  273.750  2.57984
+26   / 26: -177.000  14.0000  273.750  2.56240
+27   / 27: -176.000  14.0000  273.750  2.54498
+28   / 28: -175.000  14.0000  273.750  2.52758
+29   / 29: -174.000  14.0000  273.750  2.51021
+30   / 30: -173.000  14.0000  273.750  2.49287
+31   / 31:  173.000  15.0000  273.750  2.71923
+32   / 32:  174.000  15.0000  273.750  2.70189
+33   / 33:  175.000  15.0000  273.750  2.68452
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ ---- L:1 T:   JAN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:2 T:   FEB-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:3 T:   MAR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:4 T:   APR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:5 T:   MAY-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:6 T:   JUN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:7 T:   JUL-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:8 T:   AUG-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:9 T:   SEP-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:10 T:   OCT-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:11 T:   NOV-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:12 T:   DEC-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: JAN-1995 to JAN-1996
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                   LTP50_TAX   LOGTP50
+06-JAN-1995 16 /  1:   136.88  2.27155
+18-JAN-1995 02 /  2:   410.63  2.66335
+29-JAN-1995 12 /  3:   684.38  2.86592
+09-FEB-1995 22 /  4:   958.13  3.00351
+21-FEB-1995 07 /  5:  1231.88  3.10785
+04-MAR-1995 17 /  6:  1505.63  3.19190
+16-MAR-1995 03 /  7:  1779.38  3.26230
+27-MAR-1995 13 /  8:  2053.13  3.32287
+07-APR-1995 22 /  9:  2326.88  3.37601
+19-APR-1995 08 / 10:  2600.63  3.42335
+30-APR-1995 18 / 11:  2874.38  3.46603
+12-MAY-1995 04 / 12:  3148.13  3.50490
+23-MAY-1995 13 / 13:  3421.88  3.54056
+03-JUN-1995 23 / 14:  3695.63  3.57352
+15-JUN-1995 09 / 15:  3969.38  3.60416
+26-JUN-1995 19 / 16:  4243.13  3.63277
+08-JUL-1995 04 / 17:  4516.88  3.65962
+19-JUL-1995 14 / 18:  4790.63  3.68490
+31-JUL-1995 00 / 19:  5064.38  3.70879
+11-AUG-1995 10 / 20:  5338.13  3.73144
+22-AUG-1995 19 / 21:  5611.88  3.75296
+03-SEP-1995 05 / 22:  5885.63  3.77347
+14-SEP-1995 15 / 23:  6159.38  3.79305
+26-SEP-1995 01 / 24:  6433.13  3.81178
+07-OCT-1995 10 / 25:  6706.88  3.82975
+18-OCT-1995 20 / 26:  6980.63  3.84699
+30-OCT-1995 06 / 27:  7254.38  3.86358
+10-NOV-1995 16 / 28:  7528.13  3.87956
+22-NOV-1995 01 / 29:  7801.88  3.89497
+03-DEC-1995 11 / 30:  8075.63  3.90986
+14-DEC-1995 21 / 31:  8349.38  3.92425
+26-DEC-1995 07 / 32:  8623.13  3.93818
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: JAN-1995 to JAN-1996
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                  NEW_TAX    AVE_T    T_CNT
+16-JAN-1995 /  1:   365.00  2.60027  3.00000
+15-FEB-1995 /  2:  1095.00  3.05568  2.00000
+18-MAR-1995 /  3:  1825.00  3.25902  3.00000
+17-APR-1995 /  4:  2555.00  3.42180  3.00000
+17-MAY-1995 /  5:  3285.00  3.52273  2.00000
+17-JUN-1995 /  6:  4015.00  3.60349  3.00000
+17-JUL-1995 /  7:  4745.00  3.68444  3.00000
+17-AUG-1995 /  8:  5475.00  3.74220  2.00000
+16-SEP-1995 /  9:  6205.00  3.79277  3.00000
+16-OCT-1995 / 10:  6935.00  3.84677  3.00000
+16-NOV-1995 / 11:  7665.00  3.88727  2.00000
+16-DEC-1995 / 12:  8395.00  3.92409  3.00000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+              1        2        3        4     
+              1        2        3        4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    5.000   10.000   15.000
+ 2   / 2:    1.000    6.000   11.000   16.000
+ 3   / 3:    2.000    7.000   12.000   17.000
+ 4   / 4:    3.000    8.000   13.000   18.000
+ 5   / 5:    4.000    9.000   14.000   19.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   25.000   30.000   35.000
+ 2   / 2:   21.000   26.000   31.000   36.000
+ 3   / 3:   22.000   27.000   32.000   37.000
+ 4   / 4:   23.000   28.000   33.000   38.000
+ 5   / 5:   24.000   29.000   34.000   39.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   45.000   50.000   55.000
+ 2   / 2:   41.000   46.000   51.000   56.000
+ 3   / 3:   42.000   47.000   52.000   57.000
+ 4   / 4:   43.000   48.000   53.000   58.000
+ 5   / 5:   44.000   49.000   54.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.000   65.000   70.000   75.000
+ 2   / 2:   61.000   66.000   71.000   76.000
+ 3   / 3:   62.000   67.000   72.000   77.000
+ 4   / 4:   63.000   68.000   73.000   78.000
+ 5   / 5:   64.000   69.000   74.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   80.000   85.000   90.000   95.000
+ 2   / 2:   81.000   86.000   91.000   96.000
+ 3   / 3:   82.000   87.000   92.000   97.000
+ 4   / 4:   83.000   88.000   93.000   98.000
+ 5   / 5:   84.000   89.000   94.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:  100.000  105.000  110.000  115.000
+ 2   / 2:  101.000  106.000  111.000  116.000
+ 3   / 3:  102.000  107.000  112.000  117.000
+ 4   / 4:  103.000  108.000  113.000  118.000
+ 5   / 5:  104.000  109.000  114.000  119.000
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.000   20.000   40.000
+ 1   / 2:    5.000   25.000   45.000
+ 2   / 3:   10.000   30.000   50.000
+ 3   / 4:   15.000   35.000   55.000
+ ---- K:2 Z:   2
+ 0   / 1:    1.000   21.000   41.000
+ 1   / 2:    6.000   26.000   46.000
+ 2   / 3:   11.000   31.000   51.000
+ 3   / 4:   16.000   36.000   56.000
+ ---- K:3 Z:   3
+ 0   / 1:    2.000   22.000   42.000
+ 1   / 2:    7.000   27.000   47.000
+ 2   / 3:   12.000   32.000   52.000
+ 3   / 4:   17.000   37.000   57.000
+ ---- K:4 Z:   4
+ 0   / 1:    3.000   23.000   43.000
+ 1   / 2:    8.000   28.000   48.000
+ 2   / 3:   13.000   33.000   53.000
+ 3   / 4:   18.000   38.000   58.000
+ ---- K:5 Z:   5
+ 0   / 1:    4.000   24.000   44.000
+ 1   / 2:    9.000   29.000   49.000
+ 2   / 3:   14.000   34.000   54.000
+ 3   / 4:   19.000   39.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.000   80.000  100.000
+ 1   / 2:   65.000   85.000  105.000
+ 2   / 3:   70.000   90.000  110.000
+ 3   / 4:   75.000   95.000  115.000
+ ---- K:2 Z:   2
+ 0   / 1:   61.000   81.000  101.000
+ 1   / 2:   66.000   86.000  106.000
+ 2   / 3:   71.000   91.000  111.000
+ 3   / 4:   76.000   96.000  116.000
+ ---- K:3 Z:   3
+ 0   / 1:   62.000   82.000  102.000
+ 1   / 2:   67.000   87.000  107.000
+ 2   / 3:   72.000   92.000  112.000
+ 3   / 4:   77.000   97.000  117.000
+ ---- K:4 Z:   4
+ 0   / 1:   63.000   83.000  103.000
+ 1   / 2:   68.000   88.000  108.000
+ 2   / 3:   73.000   93.000  113.000
+ 3   / 4:   78.000   98.000  118.000
+ ---- K:5 Z:   5
+ 0   / 1:   64.000   84.000  104.000
+ 1   / 2:   69.000   89.000  109.000
+ 2   / 3:   74.000   94.000  114.000
+ 3   / 4:   79.000   99.000  119.000
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.000   60.000
+ 1   / 2:    5.000   65.000
+ 2   / 3:   10.000   70.000
+ 3   / 4:   15.000   75.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   80.000
+ 1   / 2:   25.000   85.000
+ 2   / 3:   30.000   90.000
+ 3   / 4:   35.000   95.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000  100.000
+ 1   / 2:   45.000  105.000
+ 2   / 3:   50.000  110.000
+ 3   / 4:   55.000  115.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.000   61.000
+ 1   / 2:    6.000   66.000
+ 2   / 3:   11.000   71.000
+ 3   / 4:   16.000   76.000
+ ---- K:2 Z:   1
+ 0   / 1:   21.000   81.000
+ 1   / 2:   26.000   86.000
+ 2   / 3:   31.000   91.000
+ 3   / 4:   36.000   96.000
+ ---- K:3 Z:   2
+ 0   / 1:   41.000  101.000
+ 1   / 2:   46.000  106.000
+ 2   / 3:   51.000  111.000
+ 3   / 4:   56.000  116.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.000   62.000
+ 1   / 2:    7.000   67.000
+ 2   / 3:   12.000   72.000
+ 3   / 4:   17.000   77.000
+ ---- K:2 Z:   1
+ 0   / 1:   22.000   82.000
+ 1   / 2:   27.000   87.000
+ 2   / 3:   32.000   92.000
+ 3   / 4:   37.000   97.000
+ ---- K:3 Z:   2
+ 0   / 1:   42.000  102.000
+ 1   / 2:   47.000  107.000
+ 2   / 3:   52.000  112.000
+ 3   / 4:   57.000  117.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.000   63.000
+ 1   / 2:    8.000   68.000
+ 2   / 3:   13.000   73.000
+ 3   / 4:   18.000   78.000
+ ---- K:2 Z:   1
+ 0   / 1:   23.000   83.000
+ 1   / 2:   28.000   88.000
+ 2   / 3:   33.000   93.000
+ 3   / 4:   38.000   98.000
+ ---- K:3 Z:   2
+ 0   / 1:   43.000  103.000
+ 1   / 2:   48.000  108.000
+ 2   / 3:   53.000  113.000
+ 3   / 4:   58.000  118.000
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.000   64.000
+ 1   / 2:    9.000   69.000
+ 2   / 3:   14.000   74.000
+ 3   / 4:   19.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   24.000   84.000
+ 1   / 2:   29.000   89.000
+ 2   / 3:   34.000   94.000
+ 3   / 4:   39.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:   44.000  104.000
+ 1   / 2:   49.000  109.000
+ 2   / 3:   54.000  114.000
+ 3   / 4:   59.000  119.000
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   20.000   21.000   22.000   23.000   24.000
+ 3   / 3:   40.000   41.000   42.000   43.000   44.000
+ ---- K:2 Z:   2
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   25.000   26.000   27.000   28.000   29.000
+ 3   / 3:   45.000   46.000   47.000   48.000   49.000
+ ---- K:3 Z:   3
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   30.000   31.000   32.000   33.000   34.000
+ 3   / 3:   50.000   51.000   52.000   53.000   54.000
+ ---- K:4 Z:   4
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   35.000   36.000   37.000   38.000   39.000
+ 3   / 3:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.000   61.000   62.000   63.000   64.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ 3   / 3:  100.000  101.000  102.000  103.000  104.000
+ ---- K:2 Z:   2
+ 1   / 1:   65.000   66.000   67.000   68.000   69.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ 3   / 3:  105.000  106.000  107.000  108.000  109.000
+ ---- K:3 Z:   3
+ 1   / 1:   70.000   71.000   72.000   73.000   74.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ 3   / 3:  110.000  111.000  112.000  113.000  114.000
+ ---- K:4 Z:   4
+ 1   / 1:   75.000   76.000   77.000   78.000   79.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ 3   / 3:  115.000  116.000  117.000  118.000  119.000
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   60.000   61.000   62.000   63.000   64.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   21.000   22.000   23.000   24.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   41.000   42.000   43.000   44.000
+ 2   / 2:  100.000  101.000  102.000  103.000  104.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   65.000   66.000   67.000   68.000   69.000
+ ---- K:2 Z:   1
+ 1   / 1:   25.000   26.000   27.000   28.000   29.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ ---- K:3 Z:   2
+ 1   / 1:   45.000   46.000   47.000   48.000   49.000
+ 2   / 2:  105.000  106.000  107.000  108.000  109.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   70.000   71.000   72.000   73.000   74.000
+ ---- K:2 Z:   1
+ 1   / 1:   30.000   31.000   32.000   33.000   34.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ ---- K:3 Z:   2
+ 1   / 1:   50.000   51.000   52.000   53.000   54.000
+ 2   / 2:  110.000  111.000  112.000  113.000  114.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   35.000   36.000   37.000   38.000   39.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:   55.000   56.000   57.000   58.000   59.000
+ 2   / 2:  115.000  116.000  117.000  118.000  119.000
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   2
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:2 Z:   2
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- K:2 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+              EX#1                      ALIST
+1    /  1:  1.00000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.00000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.00000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.00000 ""                                           
+6    /  6:  5.00000 ""                                           
+7    /  7:  4.00000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.00000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.00000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.00000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.00000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+            EX#1                      BLIST
+1   / 1:  3.00000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.00000 ""                                           
+3   / 3:  6.00000 "Something new has been added"               
+4   / 4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.00000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.00000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+SORTI_STR(DAT)
+    Returns indices of string data, sorted on the I axis in increasing order
+    DAT: String variable to sort in I (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : FEB
+                 39N    
+                 65
+ 141E   / 61:   8.8575
+ 143E   / 62:   8.5178
+ 145E   / 63:   9.2910
+ 147E   / 64:  10.2489
+ 149E   / 65:  10.9823
+ 151E   / 66:  10.8754
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  62.0000   8.5178
+2   / 2:  61.0000   8.8575
+3   / 3:  63.0000   9.2910
+4   / 4:  64.0000  10.2489
+5   / 5:  66.0000  10.8754
+6   / 6:  65.0000  10.9823
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+               1S     
+               45
+ 1    /  1:  23.7595
+ 2    /  2:  23.8632
+ 3    /  3:  23.8882
+ 4    /  4:  23.9519
+ 5    /  5:  23.9616
+ 6    /  6:  24.0241
+ 7    /  7:  24.0481
+ 8    /  8:  24.0854
+ 9    /  9:  24.2126
+ 10   / 10:  24.2807
+ 11   / 11:  24.3114
+ 12   / 12:  24.3562
+ 13   / 13:  24.3861
+ 14   / 14:  24.4567
+ 15   / 15:  24.4717
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : JAN
+          147.000
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : FEB
+               141E    
+                61
+ 49N   / 70:  1.88296
+ 47N   / 69:  2.01405
+ 45N   / 68:  3.44455
+ 43N   / 67:  4.55859
+ 41N   / 66:  6.47285
+ 39N   / 65:  8.85749
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  70.0000  1.88296
+2   / 2:  69.0000  2.01405
+3   / 3:  68.0000  3.44455
+4   / 4:  67.0000  4.55859
+5   / 5:  66.0000  6.47285
+6   / 6:  65.0000  8.85749
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : JAN
+               19E    
+                0
+ 1    /  1: -0.12500
+ 2    /  2:  0.05400
+ 3    /  3:  0.18556
+ 4    /  4:  0.30000
+ 5    /  5:  0.43875
+ 6    /  6:  0.62500
+ 7    /  7:  0.66000
+ 8    /  8:  0.72750
+ 9    /  9:  0.79955
+ 10   / 10:  1.29667
+ 11   / 11:  1.58765
+ 12   / 12:  1.60684
+ 13   / 13:  1.91667
+ 14   / 14:  2.05857
+ 15   / 15:  2.69400
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : JAN
+          32.0000
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.833S
+             TIME     : AUG-1982
+              131.5W  
+               99
+ 1    /  1:  24.6576
+ 2    /  2:  25.2599
+ 3    /  3:  25.7023
+ 4    /  4:  26.0588
+ 5    /  5:  26.1281
+ 6    /  6:  26.1309
+ 7    /  7:  26.1387
+ 8    /  8:  26.1637
+ 9    /  9:  26.2191
+ 10   / 10:  26.3090
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : JAN
+          28.8626
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+          28.8626
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                    141E    
+                     61
+ 16-JAN      / 1:  11.0274
+ 15-FEB      / 2:   8.8575
+ 17-MAR      / 3:   8.3911
+ 16-AUG      / 4:     ....
+ 15-JAN      / 5:  11.0274
+ 14-FEB      / 6:   8.8575
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+            141E    
+             61
+ 1   / 1:  11.0274
+ 2   / 2:   8.3911
+ 3   / 3:  11.0274
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+        TSORTED_  TSORTED_SST
+1   / 1:  3.00000   8.3911
+2   / 2:  2.00000   8.8575
+3   / 3:  1.00000  11.0274
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-JAN-1946 12 /  1:     ....
+ 15-FEB-1946 00 /  2:     ....
+ 16-MAR-1946 12 /  3:     ....
+ 16-APR-1946 00 /  4:     ....
+ 16-MAY-1946 12 /  5:     ....
+ 16-JUN-1946 00 /  6:     ....
+ 16-JUL-1946 12 /  7:     ....
+ 16-AUG-1946 12 /  8:     ....
+ 16-SEP-1946 00 /  9:     ....
+ 16-OCT-1946 12 / 10:     ....
+ 16-NOV-1946 00 / 11:     ....
+ 16-DEC-1946 12 / 12:  12.3500
+ 16-JAN-1947 12 / 13:     ....
+ 15-FEB-1947 00 / 14:     ....
+ 16-MAR-1947 12 / 15:     ....
+ 16-APR-1947 00 / 16:   0.0000
+ 16-MAY-1947 12 / 17:     ....
+ 16-JUN-1947 00 / 18:     ....
+ 16-JUL-1947 12 / 19:     ....
+ 16-AUG-1947 12 / 20:     ....
+ 16-SEP-1947 00 / 21:   6.6000
+ 16-OCT-1947 12 / 22:     ....
+ 16-NOV-1947 00 / 23:     ....
+ 16-DEC-1947 12 / 24:     ....
+ 16-JAN-1948 12 / 25:   4.5000
+ 15-FEB-1948 12 / 26:     ....
+ 16-MAR-1948 12 / 27:     ....
+ 16-APR-1948 00 / 28:     ....
+ 16-MAY-1948 12 / 29:     ....
+ 16-JUN-1948 00 / 30:   4.7000
+ 16-JUL-1948 12 / 31:     ....
+ 16-AUG-1948 12 / 32:     ....
+ 16-SEP-1948 00 / 33:  -5.8000
+ 16-OCT-1948 12 / 34:   0.4500
+ 16-NOV-1948 00 / 35:     ....
+ 16-DEC-1948 12 / 36:     ....
+ 16-JAN-1949 12 / 37:   4.2300
+ 15-FEB-1949 00 / 38:  -1.0800
+ 16-MAR-1949 12 / 39:   2.0700
+ 16-APR-1949 00 / 40:   0.8300
+ 16-MAY-1949 12 / 41:   0.0000
+ 16-JUN-1949 00 / 42:   5.3700
+ 16-JUL-1949 12 / 43:  -1.3000
+ 16-AUG-1949 12 / 44:   1.3800
+ 16-SEP-1949 00 / 45:   5.9200
+ 16-OCT-1949 12 / 46:   0.7100
+ 16-NOV-1949 00 / 47:  -0.9400
+ 16-DEC-1949 12 / 48:  -0.5200
+ 16-JAN-1950 12 / 49:   1.5800
+ 15-FEB-1950 00 / 50:   4.9300
+ 16-MAR-1950 12 / 51:   3.5100
+ 16-APR-1950 00 / 52:   4.5400
+ 16-MAY-1950 12 / 53:   1.6000
+ 16-JUN-1950 00 / 54:   1.3300
+ 16-JUL-1950 12 / 55:   0.9000
+ 16-AUG-1950 12 / 56:  -0.4500
+ 16-SEP-1950 00 / 57:   3.5700
+ 16-OCT-1950 12 / 58:  -8.7500
+ 16-NOV-1950 00 / 59:  -5.2400
+ 16-DEC-1950 12 / 60:  -6.4700
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 61
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+        TSORTED_IN  TSORTED_WND
+1    /  1:  58.0000  -8.7500
+2    /  2:  60.0000  -6.4700
+3    /  3:  33.0000  -5.8000
+4    /  4:  59.0000  -5.2400
+5    /  5:  43.0000  -1.3000
+6    /  6:  38.0000  -1.0800
+7    /  7:  47.0000  -0.9400
+8    /  8:  48.0000  -0.5200
+9    /  9:  56.0000  -0.4500
+10   / 10:  41.0000   0.0000
+11   / 11:  16.0000   0.0000
+12   / 12:  34.0000   0.4500
+13   / 13:  46.0000   0.7100
+14   / 14:  40.0000   0.8300
+15   / 15:  55.0000   0.9000
+16   / 16:  54.0000   1.3300
+17   / 17:  44.0000   1.3800
+18   / 18:  49.0000   1.5800
+19   / 19:  53.0000   1.6000
+20   / 20:  39.0000   2.0700
+21   / 21:  51.0000   3.5100
+22   / 22:  57.0000   3.5700
+23   / 23:  37.0000   4.2300
+24   / 24:  25.0000   4.5000
+25   / 25:  52.0000   4.5400
+26   / 26:  30.0000   4.7000
+27   / 27:  50.0000   4.9300
+28   / 28:  42.0000   5.3700
+29   / 29:  45.0000   5.9200
+30   / 30:  21.0000   6.6000
+31   / 31:  12.0000  12.3500
+32   / 32:     ....     ....
+33   / 33:     ....     ....
+34   / 34:     ....     ....
+35   / 35:     ....     ....
+36   / 36:     ....     ....
+37   / 37:     ....     ....
+38   / 38:     ....     ....
+39   / 39:     ....     ....
+40   / 40:     ....     ....
+41   / 41:     ....     ....
+42   / 42:     ....     ....
+43   / 43:     ....     ....
+44   / 44:     ....     ....
+45   / 45:     ....     ....
+46   / 46:     ....     ....
+47   / 47:     ....     ....
+48   / 48:     ....     ....
+49   / 49:     ....     ....
+50   / 50:     ....     ....
+51   / 51:     ....     ....
+52   / 52:     ....     ....
+53   / 53:     ....     ....
+54   / 54:     ....     ....
+55   / 55:     ....     ....
+56   / 56:     ....     ....
+57   / 57:     ....     ....
+58   / 58:     ....     ....
+59   / 59:     ....     ....
+60   / 60:     ....     ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 61
+          31.0000
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 61
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955  26.7131
+ 15-FEB      / 2:  28.5508  28.2499  26.3700
+ 17-MAR      / 3:  28.8764  28.4775  26.3180
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  28.2696  26.7131
+ 15-FEB      / 2:  28.5508  28.4857  26.3700
+ 17-MAR      / 3:  28.8764  28.6147  26.3180
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.22661
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+            161W    
+             90
+ 1   / 1:  1.60000
+ 2   / 2: -0.40645
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+               27W       25W       23W     
+               157       158       159
+ ---- L:1 T:   1
+ 3N   / 47: -0.175348 -0.178392 -0.309239
+ 1N   / 46: -0.308620 -0.280936 -0.291017
+ 1S   / 45: -0.271470 -0.497559 -0.595639
+ ---- L:2 T:   2
+ 3N   / 47: -0.052492 -0.002775 -0.124133
+ 1N   / 46:  0.064590  0.057180 -0.069549
+ 1S   / 45:  0.121296  0.039745 -0.034207
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:   9.0000   9.0000   9.0000
+ 2   / 2:  95.8009   4.1991   0.0000
+ 3   / 3:   1.0931   0.0479   0.0000
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                      1        2     
+                      1        2
+ 16-JAN      / 1:  1.17837 -0.78194
+ 15-FEB      / 2:  0.08800  1.41147
+ 17-MAR      / 3: -1.26637 -0.62953
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:101 T:   101
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+ ---- L:102 T:   102
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                  1        2        3        4        5     
+                  1        2        3        4        5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : JAN
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : JAN
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : JAN
+                91W    
+               125
+ 55N   / 73:     ....
+ 53N   / 72:     ....
+ 51N   / 71:     ....
+ 49N   / 70:     ....
+ 47N   / 69:   2.6969
+ 45N   / 68:  13.3500
+ 43N   / 67:     ....
+ 41N   / 66:     ....
+ 39N   / 65:     ....
+ 37N   / 64:     ....
+ 35N   / 63:     ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : JAN
+               91W    
+              125
+ 1    /  1:  13.3500
+ 2    /  2:   2.6969
+ 3    /  3:     ....
+ 4    /  4:     ....
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 11   / 11:     ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+               139.5W  
+                91
+ 5     /  1:     ....
+ 15    /  2:     ....
+ 25    /  3:     ....
+ 35    /  4:     ....
+ 45    /  5:     ....
+ 55    /  6:     ....
+ 65    /  7:  26.3984
+ 75    /  8:  26.0190
+ 85    /  9:  25.6663
+ 95    / 10:  25.3181
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+              139.5W  
+               91
+ 1    /  1:  26.3984
+ 2    /  2:  26.0190
+ 3    /  3:  25.6663
+ 4    /  4:  25.3181
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.0000
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.000000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.0000
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.0000
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.785000
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  335.000  359.000  269.000   57.000  195.000   73.000  101.000  209.000   87.000  167.000
+ 2   / 2:  -69.000  -63.000  -25.000  -13.000  -13.000  -11.000  -11.000  -11.000   -9.000   -9.000
+ 3   / 3:    0.340    0.863   23.271   28.382   29.675   28.470   28.341   28.881   28.429   29.847
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  331.000  365.000  147.000   79.000  119.000   65.000   83.000  125.000  157.000  237.000
+ 2   / 2:  -65.000  -61.000  -59.000  -53.000   -9.000   -7.000   -7.000   -7.000   -3.000   -1.000
+ 3   / 3:   -0.766   -0.063    0.400    1.607   28.333   27.646   27.757   28.387   28.721   23.888
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  13.0000
+ 2   / 2:  13.0000
+ 3   / 3:  13.0000
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  113.000
+ 2   / 2:  113.000
+ 3   / 3:  113.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ 1   / 1:     ....  1999.00  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    29.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00     0.00
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+            DDAT_A   DDAT_B   DDAT_C
+345   / 1:     ....     ....     ....
+346   / 2:     ....  1126.00  1126.00
+347   / 3:  1136.00  1136.00  1136.00
+348   / 4:  1141.00  1141.00     ....
+349   / 5:  1146.00  1146.00  1146.00
+350   / 6:  1156.00  1156.00  1156.00
+351   / 7:  1166.00  1166.00  1166.00
+352   / 8:     ....     ....     ....
+353   / 9:     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                  (C001,V001)    EX#2
+10-NOV-1982 16 / 15:  0.666667  16.0000
+16-NOV-1982 18 / 16:  0.750000  18.0000
+22-NOV-1982 20 / 17:  0.833333  20.0000
+28-NOV-1982 22 / 18:  0.916667  22.0000
+05-DEC-1982 00 / 19:  0.000000   0.0000
+11-DEC-1982 02 / 20:  0.083333   2.0000
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  10.0000  314.000
+16-NOV-1982 18 / 16:  16.0000  320.000
+22-NOV-1982 20 / 17:  22.0000  326.000
+28-NOV-1982 22 / 18:  28.0000  332.000
+05-DEC-1982 00 / 19:   5.0000  339.000
+11-DEC-1982 02 / 20:  11.0000  345.000
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  11.0000  0.860274
+16-NOV-1982 18 / 16:  11.0000  0.876712
+22-NOV-1982 20 / 17:  11.0000  0.893151
+28-NOV-1982 22 / 18:  11.0000  0.909589
+05-DEC-1982 00 / 19:  12.0000  0.928767
+11-DEC-1982 02 / 20:  12.0000  0.945205
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.00
+ 16-NOV-1982 18 / 16:  1982.00
+ 22-NOV-1982 20 / 17:  1982.00
+ 28-NOV-1982 22 / 18:  1982.00
+ 05-DEC-1982 00 / 19:  1982.00
+ 11-DEC-1982 02 / 20:  1982.00
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.00
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_strides
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:322 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:322 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:322 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:319 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G023)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:325 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.0000
+ 4    / 2:   4.0000
+ 7    / 3:   7.0000
+ 10   / 4:  10.0000
+ 13   / 5:  13.0000
+ 16   / 6:  16.0000
+ 19   / 7:  19.0000
+ 22   / 8:   2.0000
+ 25   / 9:   5.0000
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:341 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:341 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:341 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:339 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+ 24   / 4:   4.0000
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+ 24   / 3:   4.0000
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+ 25   / 3:   5.0000
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.0000
+ 6    / 2:   6.0000
+ 11   / 3:  11.0000
+ 16   / 4:  16.0000
+ 21   / 5:   1.0000
+ 26   / 6:   6.0000
+ 31   / 7:  11.0000
+ 36   / 8:  16.0000
+ 41   / 9:   1.0000
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.0000
+ 7    / 2:   7.0000
+ 12   / 3:  12.0000
+ 17   / 4:  17.0000
+ 22   / 5:   2.0000
+ 27   / 6:   7.0000
+ 32   / 7:  12.0000
+ 37   / 8:  17.0000
+ 42   / 9:   2.0000
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.0000
+ 8    / 2:   8.0000
+ 13   / 3:  13.0000
+ 18   / 4:  18.0000
+ 23   / 5:   3.0000
+ 28   / 6:   8.0000
+ 33   / 7:  13.0000
+ 38   / 8:  18.0000
+ 43   / 9:   3.0000
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.0000
+ 9    / 2:   9.0000
+ 14   / 3:  14.0000
+ 19   / 4:  19.0000
+ 24   / 5:   4.0000
+ 29   / 6:   9.0000
+ 34   / 7:  14.0000
+ 39   / 8:  19.0000
+ 44   / 9:   4.0000
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.0000
+ 10   / 2:  10.0000
+ 15   / 3:  15.0000
+ 20   / 4:  20.0000
+ 25   / 5:   5.0000
+ 30   / 6:  10.0000
+ 35   / 7:  15.0000
+ 40   / 8:  20.0000
+ 45   / 9:   5.0000
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.0000
+ 11   / 2:  11.0000
+ 16   / 3:  16.0000
+ 21   / 4:   1.0000
+ 26   / 5:   6.0000
+ 31   / 6:  11.0000
+ 36   / 7:  16.0000
+ 41   / 8:   1.0000
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.0000
+ 106   / 2:   6.0000
+ 111   / 3:  11.0000
+ 116   / 4:  16.0000
+ 121   / 5:   1.0000
+ 126   / 6:   6.0000
+ 131   / 7:  11.0000
+ 136   / 8:  16.0000
+ 141   / 9:   1.0000
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.0000
+ 107   / 2:   7.0000
+ 112   / 3:  12.0000
+ 117   / 4:  17.0000
+ 122   / 5:   2.0000
+ 127   / 6:   7.0000
+ 132   / 7:  12.0000
+ 137   / 8:  17.0000
+ 142   / 9:   2.0000
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.0000
+ 108   / 2:   8.0000
+ 113   / 3:  13.0000
+ 118   / 4:  18.0000
+ 123   / 5:   3.0000
+ 128   / 6:   8.0000
+ 133   / 7:  13.0000
+ 138   / 8:  18.0000
+ 143   / 9:   3.0000
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.0000
+ 109   / 2:   9.0000
+ 114   / 3:  14.0000
+ 119   / 4:  19.0000
+ 124   / 5:   4.0000
+ 129   / 6:   9.0000
+ 134   / 7:  14.0000
+ 139   / 8:  19.0000
+ 144   / 9:   4.0000
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.0000
+ 110   / 2:  10.0000
+ 115   / 3:  15.0000
+ 120   / 4:  20.0000
+ 125   / 5:   5.0000
+ 130   / 6:  10.0000
+ 135   / 7:  15.0000
+ 140   / 8:  20.0000
+ 145   / 9:   5.0000
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.0000
+ 111   / 2:  11.0000
+ 116   / 3:  16.0000
+ 121   / 4:   1.0000
+ 126   / 5:   6.0000
+ 131   / 6:  11.0000
+ 136   / 7:  16.0000
+ 141   / 8:   1.0000
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G023)          (AX010)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:335 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G022)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:335 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:335 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:335 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:334 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G023)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:334 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:318 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+ 
+! ******** V54 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_viewports
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/nolab {0,4.737}, {0,4.737}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/line {0,4.737}, {0,4.737}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.60   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.60   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 7.27E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.67E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strings
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string    cnst
+1   / 1: "string"            5.00000
+2   / 2: "s2"                5.00000
+3   / 3: "very long string"  5.00000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1.00000  0.00000  0.00000
+ 2   / 2:  0.00000  1.00000  0.00000
+ 3   / 3:  0.00000  0.00000  1.00000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  0.00000  1.00000  1.00000
+ 2   / 2:  1.00000  0.00000  1.00000
+ 3   / 3:  1.00000  1.00000  0.00000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  1.00000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  0.00000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axcontrol
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_curv
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_delimited_read
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6     V7       V8     V9     V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      .... " "      " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000 "word 1" " "      ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     .... "word 2" " "      ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030 " wd 3 " " "      ....
+5   / 5: " "          " "    " "    " "    " "    " "      .... " "      " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000 "word 4" "aa"  77.0000
+7   / 7: "extra line" " "    " "    " "    " "    " "      .... " "      " "      ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6     A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030
+5   / 5: " "          " "    " "    " "    " "    " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000
+7   / 7: "extra line" " "    " "    " "    " "    " "      ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2    V3       V4       V5     V6     V7       V8     V9     V10
+1   / 1: "one"       ...  1.10000 -24.0000  130.000 " "    10.000 "word 1" " "      ....
+2   / 2: "two"       ...  2.20000  24.0000 -130.000 "2S"     .... "word 2" " "      ....
+3   / 3: "three"     ...  3.30000  24.0000  130.000 "3N"    0.030 " wd 3 " " "      ....
+4   / 4: " "         ...     ....     ....     .... " "      .... " "      " "      ....
+5   / 5: "five"      ...  4.40000 -24.0000 -130.000 "91" -400.000 "word 4" "aa"  77.0000
+6   / 6: "extra line"...     ....     ....     .... " "      .... " "      " "      ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000     ....     ....     ....   10.000......     ....
+2   / 2:......  2.20000     ....     ....     ....     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000     ....    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000 -24.0000     ....     ....   10.000......     ....
+2   / 2:......  2.20000  24.0000     ....  -2.0000     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000   3.0000    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+              V1     V2
+1   / 1:  37965.0  12.5833
+2   / 2:     ....     ....
+3   / 3:  39051.0  13.7514
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5       V6       V7       V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.0  36218.0  12.0000  13.7601
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.0  36219.0   1.0037  14.7601
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.0  36220.0   2.0000  15.7500
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+              V1     V2    V3 V4    V5       V6    V7 V8
+1   / 1:  36493.0  36218.0......  36493.0  36218.0......
+2   / 2:  36494.0  36219.0......  36494.0  36219.0......
+3   / 3:     ....     ..........  36495.0  36220.0......
+4   / 4:  36496.0  36221.0......  36496.0  36221.0......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2    V3       V4    V5 V6    V7       V8
+1   / 1:......  12.0000  13.7601......  12.0000  13.7601
+2   / 2:......   1.0037  14.7601......   1.0037  14.7601
+3   / 3:......     ....     ..........   2.0000  15.7500
+4   / 4:......   3.0000  16.7601......   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+              V1     V2       V3       V4       V5       V6       V7       V8
+1   / 1:  36493.0  36218.0  12.0000  13.7601  36493.0  36218.0  12.0000  13.7601
+2   / 2:  36494.0  36219.0   1.0037  14.7601  36494.0  36219.0   1.0037  14.7601
+3   / 3:     ....     ....     ....     ....  36495.0  36220.0   2.0000  15.7500
+4   / 4:  36496.0  36221.0   3.0000  16.7601  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+              V1     V3       V5       V7
+1   / 1:  36493.0  12.0000  36493.0  12.0000
+2   / 2:  36494.0   1.0037  36494.0   1.0037
+3   / 3:     ....     ....  36495.0   2.0000
+4   / 4:  36496.0   3.0000  36496.0   3.0000
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+              V1     V2                        V3                       V4
+1   / 1:  12.0000  1.00000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.00000
+2   / 2:  12.0000  2.00000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.00000
+3   / 3:  12.0000  3.00000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.00000
+4   / 4:  12.0000  4.00000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.00000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+              V1     V2      V3        V4           V5           V6         V7       V8
+1   / 1:  12.0000  1.00000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6       V7           V8         V9       V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6     V7      V8     V9     V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"   12.0000 "00"   13.0000 "45" 
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"    1.0000 "00"   13.5000 "14" 
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x"   2.0000 "00x"  15.0000 "45x"
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"    3.0000 "00"   16.0000 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1     V2     V3    V4       V5       V6       V7       V8       V9       V10      V11      V12      V13       V14      V15      V16      V17       V18      V19      V20       V21      V22      V23      V24      V25      V26
+1    /  1: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    10.00  21.1028  35.9408  0.00000  36.0000  0.000000  1.00000     9.80  224.641  0.000000   0.1172  0.00000  0.000000  0.00000   1.0156  0.00000  0.11621  0.00000  2.22900
+2    /  2: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    54.00  19.8913  35.9437  0.00000  35.0000  0.000000  1.00000    54.70  233.185  0.000000   0.1465  0.00000  0.000000  0.00000   1.0351  0.00000  0.13769  0.00000  2.43100
+3    /  3: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    79.00  19.0138  35.9186  0.00000  34.0000  0.000000  1.00000    79.50  237.026  0.000000   0.1660  0.00000  0.000000  0.00000   1.0449  0.00000  0.13085  0.00000  2.51600
+4    /  4: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   104.00  18.0026  35.8627  0.00000  33.0000  0.000000  1.00000   104.60  233.766  0.000000   0.1855  0.00000  0.000000  0.00000   1.0645  0.00000  0.16602  0.00000  2.65000
+5    /  5: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   154.00  16.3595  35.7126  0.00000  32.0000  0.000000  1.00000   155.10  230.216  0.000000   0.9083  0.00000  0.146501  0.00000   0.8985  0.00000  0.26566  0.00000  2.84600
+6    /  6: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   204.00  14.8461  35.5541  0.00000  31.0000  0.000000  1.00000   206.00  222.307  0.000000   3.7899  0.00000  0.009768  0.00000   1.4359  0.00000  0.44542  0.00000  2.95400
+7    /  7: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   253.00  13.7175  35.3809  0.00000  29.0000  0.000000  1.00000   255.20  227.612  0.000000   5.5293  0.00000  0.009769  0.00000   1.6315  0.00000  0.55880  0.00000  3.00600
+8    /  8: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   254.00  13.7070  35.3835  0.00000  30.0000  0.000000  1.00000   255.60  227.350  0.000000   5.5098  0.00000  0.009769  0.00000   1.7877  0.00000  0.55489  0.00000  2.99600
+9    /  9: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   305.00  12.6234  35.2123  0.00000  28.0000  0.000000  1.00000   307.20  230.868  0.000000   7.6502  0.00000  0.009770  0.00000   2.1593  0.00000  0.68588  0.00000  3.13400
+10   / 10: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   353.00  12.0102  35.1165  0.00000  27.0000  0.000000  1.00000   355.70  235.378  0.000000   8.7158  0.00000  0.009771  0.00000   2.5209  0.00000  0.75335  0.00000  3.19000
+11   / 11: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   404.00  11.4592     ....  9.00000  26.0000  0.000000  1.00000   406.90     ....  0.000000     ....  9.00000      ....  9.00000     ....  9.00000     ....  9.00000  3.25500
+12   / 12: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   452.00  11.0375  34.9575  0.00000  25.0000  0.000000  1.00000   455.90  239.899  0.000000  10.9546  0.00000  0.000000  0.00000   3.0489  0.00000  0.88438  0.00000  3.24500
+13   / 13: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   502.00  10.5797  34.8825  0.00000  24.0000  0.000000  1.00000   506.00  241.090  0.000000  12.1377  0.00000  0.000000  0.00000   3.4009  0.00000  0.95871  0.00000  3.19500
+14   / 14: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   601.00   9.8037  34.7585  0.00000  23.0000  0.000000  1.00000   605.90  238.538  0.000000  14.4357  0.00000  0.000000  0.00000   4.2711  0.00000  1.11419  0.00000     ....
+15   / 15: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   701.00   9.0245  34.6510  0.00000  22.0000  0.000000  1.00000   706.70  229.219  0.000000  17.5353  0.00000  0.000000  0.00000   6.1774  0.00000  1.31173  0.00000  2.45400
+16   / 16: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   800.00   7.6879  34.5292  0.00000  21.0000  0.000000  1.00000   807.00  206.678  0.000000  22.7373  0.00000  0.000000  0.00000  13.2162  0.00000  1.63345  0.00000  1.32000
+17   / 17: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   899.00   6.2124  34.4434  0.00000  20.0000  0.000000  1.00000   907.30  194.602  0.000000  27.2943  0.00000  0.000000  0.00000  23.8630  0.00000  1.92683  0.00000  0.73200
+18   / 18: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   999.00   4.9587  34.4055  0.00000  19.0000  0.000000  1.00000  1008.40  186.926  0.000000  30.2768  0.00000  0.000000  0.00000  36.3870  0.00000  2.15272  0.00000  0.42900
+19   / 19: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00  1098.00   4.3083  34.4383  0.00000  18.0000  0.000000  1.00000  1109.00  171.821  0.000000  32.2020  0.00000  0.000000  0.00000  50.4537  0.00000  2.29735  0.00000  0.19800
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+               V11     V19      V21      V23      V25
+8    /  8:  0.00000  0.00000  0.00000  0.00000  0.00000
+9    /  9:  0.00000  0.00000  0.00000  0.00000  0.00000
+10   / 10:  0.00000  0.00000  0.00000  0.00000  0.00000
+11   / 11:  9.00000  9.00000  9.00000  9.00000  9.00000
+12   / 12:  0.00000  0.00000  0.00000  0.00000  0.00000
+13   / 13:  0.00000  0.00000  0.00000  0.00000  0.00000
+14   / 14:  0.00000  0.00000  0.00000  0.00000  0.00000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+                V11     V19       V21       V23       V25
+8    /  8:  0.000000  0.000000  0.000000  0.000000  0.000000
+9    /  9:  0.000000  0.000000  0.000000  0.000000  0.000000
+10   / 10:  0.000000  0.000000  0.000000  0.000000  0.000000
+11   / 11:      ....      ....      ....      ....      ....
+12   / 12:  0.000000  0.000000  0.000000  0.000000  0.000000
+13   / 13:  0.000000  0.000000  0.000000  0.000000  0.000000
+14   / 14:  0.000000  0.000000  0.000000  0.000000  0.000000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+ 
+ 
+! ******** V5.41 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn541_bug_fixes
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955     ....
+ 15-FEB      / 2:  28.5508  28.2499     ....
+ 17-MAR      / 3:  28.8764  28.4775     ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045     ....  26.9596
+ 15-FEB      / 2:  28.5508     ....  26.7875
+ 17-MAR      / 3:  28.8764     ....  27.1092
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX010)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 279  complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.00000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_axes
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+ 
+! ******** V5.42 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn542_bug_fixes
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+ 
+! ******** V5.50 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_subspan_modulo
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       43       44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  13.0000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M: 11 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  6 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  5 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M: 17 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.0000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.0000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.0000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.0393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+             ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+             ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+             ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      / 2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      / 3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0002 / 14:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0002 / 15:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+ 15-APR-0002 / 16:  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000
+ 15-MAY-0002 / 17:  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0003 / 20:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0003 / 21:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0002 / 14:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0002 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 / 16:  102.000     ....     ....     ....  106.000     ....  101.000  102.000     ....     ....     ....
+ 15-MAY-0002 / 17:  132.000     ....     ....     ....  136.000     ....  131.000  132.000     ....     ....     ....
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0003 / 20:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0003 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0002 / 14:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0002 / 15:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 15-APR-0002 / 16:  102.000  102.000  104.000  106.000  106.000     ....  101.000  102.000  102.000  104.000  106.000
+ 15-MAY-0002 / 17:  132.000  132.000  134.000  136.000  136.000     ....  131.000  132.000  132.000  134.000  136.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0003 / 20:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0003 / 21:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0002 / 13:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0002 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 / 15:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 15-APR-0002 / 16:   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000     ....
+ 15-MAY-0002 / 17:   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000     ....
+ 15-SEP-0002 / 18:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0003 / 19:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0003 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 / 21:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G008)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G008)          (AX017)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G008)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 16-MAR-0000 / 2:   71.000
+ 15-MAY-0000 / 3:  131.000
+ 15-JAN-0001 / 4:   11.000
+ 16-MAR-0001 / 5:   71.000
+ 15-MAY-0001 / 6:  131.000
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   71.000
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.000
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.000
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.000
+ 16-MAR-0001 / 3:   71.000
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0000 / 2:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0001 / 4:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.00000
+ 15-FEB      / 2:  2.00000
+ 16-MAR      / 3:  3.00000
+ 15-APR      / 4:  4.00000
+ 15-MAY      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.0000
+ 15-FEB      / 2:  10.0000
+ 16-MAR      / 3:  10.0000
+ 15-APR      / 4:  10.0000
+ 15-MAY      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.00000
+ 15-SEP-0166 / 1002:     ....
+ 16-JAN-0167 / 1003:  1.00000
+ 15-FEB-0167 / 1004:  2.00000
+ 17-MAR-0167 / 1005:  3.00000
+ 16-APR-0167 / 1006:  4.00000
+ 16-MAY-0167 / 1007:  5.00000
+ 16-SEP-0167 / 1008:     ....
+ 16-JAN-0168 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       42.1     44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  12.1000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.1000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.1000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.1000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.7393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+             ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+             ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+             ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      / 2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      / 3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      / 4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      / 5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0002 05 / 15:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+ 15-APR-0002 17 / 16:  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0003 11 / 21:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0002 14 / 14:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0002 05 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 17 / 16:  102.249  102.349     ....     ....  106.249     ....  101.249  102.249  102.349     ....     ....
+ 15-MAY-0002 17 / 17:  132.249  132.349     ....     ....  136.249     ....  131.249  132.249  132.349     ....     ....
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0003 20 / 20:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0003 11 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0002 05 / 15:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 15-APR-0002 17 / 16:  102.249  102.349  102.349  106.249  106.249     ....  101.249  102.249  102.349  102.349  106.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  132.349  136.249  136.249     ....  131.249  132.249  132.349  132.349  136.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0003 11 / 21:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 15-JAN-0002 23 / 13:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0002 14 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 05 / 15:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 15-APR-0002 17 / 16:   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000     ....
+ 15-MAY-0002 17 / 17:   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249     ....
+ 15-SEP-0002 05 / 18:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 16-JAN-0003 05 / 19:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0003 20 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 11 / 21:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G018)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G018)          (AX010)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G018)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 15-MAR-0000 / 2:   70.249
+ 15-MAY-0000 / 3:  131.249
+ 15-JAN-0001 / 4:   11.000
+ 15-MAR-0001 / 5:   70.249
+ 15-MAY-0001 / 6:  131.249
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   70.249
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.249
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.249
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.249
+ 15-MAR-0001 / 3:   70.249
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0000 / 2:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0001 / 4:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.00000
+ 15-FEB 02      / 2:  2.00000
+ 15-MAR 17      / 3:  3.00000
+ 15-APR 05      / 4:  4.00000
+ 15-MAY 05      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.0000
+ 15-FEB 02      / 2:  10.0000
+ 15-MAR 17      / 3:  10.0000
+ 15-APR 05      / 4:  10.0000
+ 15-MAY 05      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.00000
+ 15-SEP-0166 23 / 1002:     ....
+ 16-JAN-0167 23 / 1003:  1.00000
+ 15-FEB-0167 14 / 1004:  2.00000
+ 17-MAR-0167 05 / 1005:  3.00000
+ 16-APR-0167 17 / 1006:  4.00000
+ 16-MAY-0167 17 / 1007:  5.00000
+ 16-SEP-0167 05 / 1008:     ....
+ 17-JAN-0168 05 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dots
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lev_symbols
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+ 
+GO bn_reset
+cancel mode verify
+! GO bench_extrema  ! moved to bn_ef_bench_extrema; tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_logo_lab
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL       CANCELLED      ferret.jnl
+      LONG_LABEL       SET              -4
+      LATIT_LABEL      SET              -4
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         months
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      dots.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+plot/vs/over/line/color=white {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_attribute
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_FIELD_J_AXIS Y             2 r   50                   65
+   Axis span (to cell edges) = 30
+ LON_FIELD_I_AXIS X             7 r   160                  208
+   Axis span (to cell edges) = 56
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME      T (HOURS)           20 r   1                    20
+   Axis span (to cell edges) = 20
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ TIME5     TIME                 2mr   16-MAY 23:56         16-JUN 10:25
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn550_bug_fixes
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+ 
+! ******** V5.51 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn551_bug_fixes
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME3
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.00000
+ 10-JUN-1996 04:03:37 / 2:  1.00000
+ 10-JUN-1996 04:03:38 / 3:  2.00000
+ 10-JUN-1996 04:03:39 / 4:  3.00000
+ 10-JUN-1996 04:03:40 / 5:  4.00000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+ 
+! ******** V5.52 Additions below ***********
+ 
+GO bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 7.74
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+ 
+GO bn_reset
+cancel mode verify
+GO bn552_bug_fixes
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : JAN
+                20N    
+                 6
+ 110W   / 1:  24.0382
+ 105W   / 2:  25.4564
+ 100W   / 3:  24.5714
+ 95W    / 4:  23.8243
+ 90W    / 5:  24.9977
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.00000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.00000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.167S
+                     100.5W  
+                     130
+ 16-JUL-1966 /  1: -1.42152
+ 15-AUG-1966 /  2: -2.97198
+ 14-SEP-1966 /  3: -4.50335
+ 15-OCT-1966 /  4: -3.88179
+ 14-NOV-1966 /  5: -2.57982
+ 15-DEC-1966 /  6: -1.07968
+ 14-JAN-1967 /  7:  1.42391
+ 14-FEB-1967 /  8:  2.96231
+ 16-MAR-1967 /  9:  4.50322
+ 15-APR-1967 / 10:  3.83807
+ 16-MAY-1967 / 11:  2.60886
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                          1
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.00
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.00
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.00
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+        A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:  12.0000  14.0000
+2   / 2:  14.0000  20.0000
+3   / 3:  20.0000  28.0000
+4   / 4:  28.0000  22.0000
+5   / 5:  22.0000  10.0000
+6   / 6:  10.0000     ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+              1        2        3     
+              1        2        3
+ 1   / 1:  3.00000  5.00000  7.00000
+ 2   / 2:  4.00000  6.00000  8.00000
+ 3   / 3:  5.00000  7.00000  9.00000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:   5.0000   7.0000   9.0000  11.0000  13.0000
+ 2   / 2:   7.0000  11.0000  15.0000  19.0000  23.0000
+ 3   / 3:   9.0000  15.0000  21.0000  27.0000  33.0000
+ 4   / 4:  11.0000  19.0000  27.0000  35.0000  43.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.94
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.8
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.94,,1.8
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.94    10.23     1.80     7.20
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.94
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 6.405
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.94,,6.405
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.65     9.94     1.00     6.41
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.3
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 6.905
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.305
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,6.905,7.305
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30    10.04     6.91     7.30
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.2
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.94
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.4
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,8.94,1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.20     8.94     1.40     1.49
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.2  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.2  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.7,1.1
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.4
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.20     9.94    -1.40    -1.31
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.25380  2.34749  2.42382  2.47460  2.50064
+ 2.17S / 4:  2.26997  2.36147  2.43073  2.47739  2.50277
+ 2.5S  / 3:  2.26576  2.35100  2.41285  2.45516  2.48145
+ 2.83S / 2:  2.23354  2.30728  2.35946  2.39631  2.42393
+ 3.17S / 1:  2.16829  2.22692  2.26870  2.30046  2.33013
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.28179  2.37704  2.45447  2.50708  2.53486
+ 2.17S / 4:  2.29644  2.38952  2.46056  2.50887  2.53607
+ 2.5S  / 3:  2.29075  2.37736  2.44104  2.48452  2.51240
+ 2.83S / 2:  2.25743  2.33286  2.38636  2.42369  2.45233
+ 3.17S / 1:  2.19089  2.25118  2.29360  2.32531  2.35557
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.72333  1.84007  1.94120  2.00514  2.04715
+ 2.17S / 4:  1.63876  1.74435  1.83141  1.88234  1.91985
+ 2.5S  / 3:  1.51509  1.60488  1.67644  1.71352  1.74562
+ 2.83S / 2:  1.35750  1.42836  1.48145  1.50285  1.52819
+ 3.17S / 1:  1.17476  1.22230  1.25622  1.26294  1.28236
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.21576  1.30112  1.37420  1.42210  1.45249
+ 2.17S / 4:  1.08595  1.16417  1.22895  1.26976  1.29822
+ 2.5S  / 3:  0.93683  1.00553  1.05923  1.09102  1.11580
+ 2.83S / 2:  0.77184  0.82972  0.86888  0.89054  0.91114
+ 3.17S / 1:  0.59936  0.64140  0.66649  0.68065  0.69951
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.81161
+ 23-AUG-1982 14 / 2: -1.75761
+ 29-AUG-1982 16 / 3: -1.67763
+ 04-SEP-1982 18 / 4: -1.57055
+ 10-SEP-1982 20 / 5: -1.42678
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -2.21821
+ 23-AUG-1982 14 / 2: -2.04941
+ 29-AUG-1982 16 / 3: -1.77359
+ 04-SEP-1982 18 / 4: -1.41208
+ 10-SEP-1982 20 / 5: -1.05323
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.77560
+ 23-AUG-1982 14 / 2: -1.45491
+ 29-AUG-1982 16 / 3: -1.24196
+ 04-SEP-1982 18 / 4: -1.05135
+ 10-SEP-1982 20 / 5: -0.84706
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                         1      
+                          1
+ 17-AUG-1982 12 / 1:  0.003693
+ 23-AUG-1982 14 / 2: -0.189178
+ 29-AUG-1982 16 / 3: -0.298222
+ 04-SEP-1982 18 / 4: -0.405668
+ 10-SEP-1982 20 / 5: -0.517797
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.0000
+ 15    /  2:  25.0000
+ 25    /  3:  25.0000
+ 35    /  4:  25.0000
+ 45    /  5:  25.0000
+ 55    /  6:  25.0000
+ 65    /  7:  25.0000
+ 75    /  8:  25.0000
+ 85    /  9:  25.0000
+ 95    / 10:  25.0000
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.2678   0.6794   0.0319   0.0157   0.0031
+ 45    / 2:  98.6525   1.1464   0.1451   0.0296   0.0198
+ 85    / 3:  95.1217   4.5698   0.2195   0.0744   0.0084
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.576
+ 2   / 2:    0.955
+ 3   / 3:    0.045
+ 4   / 4:    0.022
+ 5   / 5:    0.004
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.8576
+ 2   / 2:   0.1262
+ 3   / 3:   0.0160
+ 4   / 4:   0.0033
+ 5   / 5:   0.0022
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.23641
+ 2   / 2:  0.10744
+ 3   / 3:  0.00516
+ 4   / 4:  0.00175
+ 5   / 5:  0.00020
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+GO bn_reset
+cancel mode verify
+GO bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_zaxr_fcns.jnl ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+ 
+! ******** V5.53 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT1
+<axes>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME6
+<axes>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME4">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                     161W    
+                       1
+ 16-JAN      /  1:  3.43667
+ 15-FEB      /  2:  1.92500
+ 17-MAR      /  3:  2.79000
+ 16-APR      /  4:  1.79000
+ 16-MAY      /  5:  0.80000
+ 16-JUN      /  6:  3.80000
+ 16-JUL      /  7: -0.20000
+ 16-AUG      /  8:  0.46500
+ 15-SEP      /  9:  2.57250
+ 16-OCT      / 10: -2.53000
+ 15-NOV      / 11: -3.09000
+ 16-DEC      / 12:  1.78667
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+ 
+ 
+! ******** V5.6Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+SHADE/grat=(color=white) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=whi)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.00000
+!-> REPEAT: S:4
+          4.00000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.0000  6.00000  480.000
+I / *:     80.0000  8.00000  640.000
+I / *:     80.0000  10.0000  800.000
+I / *:     60.0000  6.00000  360.000
+I / *:     60.0000  8.00000  480.000
+I / *:     60.0000  10.0000  600.000
+I / *:     40.0000  6.00000  240.000
+I / *:     40.0000  8.00000  320.000
+I / *:     40.0000  10.0000  400.000
+I / *:     20.0000  6.00000  120.000
+I / *:     20.0000  8.00000  160.000
+I / *:     20.0000  10.0000  200.000
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.000
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.000
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.00
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.00
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.00
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.00
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.00
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.00
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.00000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.00000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.000
+ 177W    / -98: -177.000
+ 175W    / -97: -175.000
+ 173W    / -96: -173.000
+ 171W    / -95: -171.000
+ 169W    / -94: -169.000
+ 167W    / -93: -167.000
+ 165W    / -92: -165.000
+ 163W    / -91: -163.000
+ 161W    / -90: -161.000
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.000
+ 177W    / -98: -354.000
+ 175W    / -97: -350.000
+ 173W    / -96: -346.000
+ 171W    / -95: -342.000
+ 169W    / -94: -338.000
+ 167W    / -93: -334.000
+ 165W    / -92: -330.000
+ 163W    / -91: -326.000
+ 161W    / -90: -322.000
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.000
+ 177W    / -98: -531.000
+ 175W    / -97: -525.000
+ 173W    / -96: -519.000
+ 171W    / -95: -513.000
+ 169W    / -94: -507.000
+ 167W    / -93: -501.000
+ 165W    / -92: -495.000
+ 163W    / -91: -489.000
+ 161W    / -90: -483.000
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.000
+ 177W    / -98: -708.000
+ 175W    / -97: -700.000
+ 173W    / -96: -692.000
+ 171W    / -95: -684.000
+ 169W    / -94: -676.000
+ 167W    / -93: -668.000
+ 165W    / -92: -660.000
+ 163W    / -91: -652.000
+ 161W    / -90: -644.000
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.000
+ 177W    / -98: -885.000
+ 175W    / -97: -875.000
+ 173W    / -96: -865.000
+ 171W    / -95: -855.000
+ 169W    / -94: -845.000
+ 167W    / -93: -835.000
+ 165W    / -92: -825.000
+ 163W    / -91: -815.000
+ 161W    / -90: -805.000
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.00000 "factorial"  1.00000
+I / *:     2.00000 "factorial"  2.00000
+I / *:     3.00000 "factorial"  6.00000
+I / *:     4.00000 "factorial"  24.0000
+I / *:     5.00000 "factorial"  120.000
+I / *:     6.00000 "factorial"  720.000
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 81E    / 2:  28.1147
+ 161E   / 3:  28.7893
+ 119W   / 4:  24.5394
+ 39W    / 5:  27.4849
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 121E   / 2:  28.5914
+ 119W   / 3:  24.5394
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN-0002
+          20.9844
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:148 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:153 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.7890
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:141 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:143 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          21.2500
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:130 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9385
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.00000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : JAN
+          28.2839
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:146 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+can mem/all
+ -DELETE A        M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:146 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:146 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M:146 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G001)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:146 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:146 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G001)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:151 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G001)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.500  212.500
+214   / 2:  214.000  212.500  215.500
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.700  212.300
+213.6 / 2:  213.600  212.300  214.900
+216.2 / 3:  216.200  214.900  217.500
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+               A   B
+1   / 1:  1.00000 "a"
+2   / 2:  2.00000 "b"
+3   / 3:  3.00000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C       V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.00000
+2   / 2: "b" "spat"  1.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.00000
+2   / 2: "b" "that"  1.00000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.00000
+2   / 2: "b" "spat"  2.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.00000
+2   / 2: "b" "that"  2.00000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.00000
+2   / 2: "b" "spat"  3.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.00000
+2   / 2: "b" "that"  3.00000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.00000
+2   / 2: "b" "spat"  4.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.00000
+2   / 2: "b" "that"  4.00000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.00000
+2   / 2: "b" "spat"  5.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.00000
+2   / 2: "b" "that"  5.00000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       DEPTH (m)           26 r-  0                    1000
+   Axis span (to cell edges) = 1040
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.976269
+ 106.8W  /  2:  0.824340
+ 100.2W  /  3:  0.552644
+ 93.5W   /  4:  0.200690
+ 86.8W   /  5: -0.180415
+ 80.2W   /  6: -0.535314
+ 73.5W   /  7: -0.812473
+ 66.8W   /  8: -0.971589
+ 60.2W   /  9: -0.989574
+ 53.5W   / 10: -0.863802
+ 46.8W   / 11: -0.612560
+ 40.2W   / 12: -0.272341
+ 33.5W   / 13:  0.107469
+ 26.8W   / 14:  0.471639
+ 20.2W   / 15:  0.767299
+ 13.5W   / 16:  0.951514
+ 6.8W    / 17:  0.997495
+ 0.2W    / 18:  0.898583
+ 6.5E    / 19:  0.669123
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.976269
+ 96.8W   / 2: -0.383713
+ 80.2W   / 3: -0.535314
+ 63.5W   / 4:  0.998887
+ 46.8W   / 5: -0.612560
+ 30.2W   / 6: -0.294944
+ 13.5W   / 7:  0.951514
+ 3.2E    / 8: -0.798487
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.976269
+ 96.2W   / 2: -0.383713
+ 79.5W   / 3: -0.535314
+ 62.8W   / 4:  0.998887
+ 46.2W   / 5: -0.612560
+ 29.5W   / 6: -0.294944
+ 12.8W   / 7:  0.951514
+ 3.8E    / 8: -0.798487
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.83E(42.83)
+         -0.912341
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.996087
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  45th point
+              1       46       91       136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     238 [...]
+              1       46       91      136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     2386 [...]
+ 1   / 1:  1.84147  1.90179  1.10599  0.20957  0.06355  0.80656  1.73321  1.96379  1.27939  0.32975  0.01642  0.63686  1.60205  1.99568  1.44406  0.47087  0.00001  0.47850  1.45208  1.99647  1.59486  0.62851  0.01484  0.33643  1.28799  1.96614  1.72708  0.79776  0.06044  0.21509  1.11490  1.90563  1.83659  0.97333  0.13539  0.11827  0.93823  1.81683  1.91997  1.14973  0.23734  0.04899  0.76349  1.70252  1.97461  1.32145  0.36312  0.00942  0.59613  1.56626  1.99881  1.48313  0.50879  0.00 [...]
+ 2   / 2:  2.84147  2.90179  2.10599  1.20957  1.06355  1.80656  2.73321  2.96379  2.27939  1.32975  1.01642  1.63686  2.60205  2.99568  2.44406  1.47087  1.00001  1.47850  2.45208  2.99647  2.59486  1.62851  1.01484  1.33643  2.28799  2.96614  2.72708  1.79776  1.06044  1.21509  2.11490  2.90563  2.83659  1.97333  1.13539  1.11827  1.93823  2.81683  2.91997  2.14973  1.23734  1.04899  1.76349  2.70252  2.97461  2.32145  1.36312  1.00942  1.59613  2.56626  2.99881  2.48313  1.50879  1.00 [...]
+ 
+can mode ignore
+ 
+ 
+! ******** V5.7 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                       179W     177W     175W    
+                         1        2        3
+ 16-JAN 12      / 1:  27.9765  28.2538  28.2807
+ 15-FEB 02      / 2:  28.3564  28.4117  27.9982
+ 15-MAR 17      / 3:  27.9418  28.0035  27.7238
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                        1N       3N       5N       7N     
+                         1        2        3        4
+ 16-JAN 12      / 1:  28.4146  28.2538  28.0640  28.1024
+ 15-FEB 02      / 2:  28.4018  28.4117  28.1639  27.7498
+ 15-MAR 17      / 3:  27.5907  28.0035  27.8730  27.8183
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000  28.0000
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1.2 / 1:  1.20000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3.2 / 3:  3.20000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8.4 / 6:  8.40000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME4)
+ Column  3: TBOXLO is TBOXLO (axis TIME4)
+ Column  4: TBOXHI is TBOXHI (axis TIME4)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+                 V      Z     ZBOXLO   ZBOXHI
+0     / 1:    7.000    0.000   0.0000   10.000
+20    / 2:   27.000   20.000  10.0000   30.000
+50    / 3:   57.000   50.000  30.0000   60.000
+75    / 4:   82.000   75.000  60.0000   90.000
+120   / 5:  127.000  120.000  90.0000  150.000
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: JAN-1990 to JAN-1990
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+GO bn_reset
+cancel mode verify
+GO bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_reset_attributes.jnl
+! bn_reset_attributes.jnl
+! acm 6/14/2004
+! tests of SET AXIS/CALENDAR  /T0  /UNITS  also CANCEL AXIS/DEPTH
+! also RETURN=calendar
+ 
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+sh axis `temp,return=taxis`
+ !-> sh axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 11-DEC-1982 02 / 20:  25476.0
+ 17-DEC-1982 04 / 21:  25622.0
+ 23-DEC-1982 06 / 22:  25768.0
+ 29-DEC-1982 08 / 23:  25914.0
+ 04-JAN-1983 10 / 24:  26060.0
+ 10-JAN-1983 12 / 25:  26206.0
+ 
+! New RETURN=calendar
+def sym calname = `temp,return=calendar`
+ !-> def sym calname = GREGORIAN
+ 
+! SET AXIS/CALENDAR=  julian, 360-day, 365_day=julian, 366_day=all_leap, standard=gregorian
+set axis/calendar=julian `temp,return=taxis`
+ !-> set axis/calendar=julian TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE JULIAN
+JULIAN
+ 
+set axis/calendar=360_day `temp,return=taxis`
+ !-> set axis/calendar=360_day TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 26-DEC-1982 02 / 20:  32.6698
+ 02-JAN-1983 04 / 21:  32.7830
+ 08-JAN-1983 06 / 22:  32.7033
+ 14-JAN-1983 08 / 23:  32.4479
+ 20-JAN-1983 10 / 24:  32.2491
+ 26-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE 360_DAY
+360_DAY
+ 
+set axis/calendar=365_day `temp,return=taxis`
+ !-> set axis/calendar=365_day TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=nol `temp,return=taxis`
+ !-> set axis/calendar=nol TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 12-DEC-1982 02 / 20:  32.6698
+ 18-DEC-1982 04 / 21:  32.7830
+ 24-DEC-1982 06 / 22:  32.7033
+ 30-DEC-1982 08 / 23:  32.4479
+ 05-JAN-1983 10 / 24:  32.2491
+ 11-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=366 `temp,return=taxis`
+ !-> set axis/calendar=366 TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+ 
+set axis/calendar=all_leap `temp,return=taxis`
+ !-> set axis/calendar=all_leap TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : ALL_LEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 09-DEC-1982 02 / 20:  32.6698
+ 15-DEC-1982 04 / 21:  32.7830
+ 21-DEC-1982 06 / 22:  32.7033
+ 27-DEC-1982 08 / 23:  32.4479
+ 02-JAN-1983 10 / 24:  32.2491
+ 08-JAN-1983 12 / 25:  32.1819
+ 
+! Now resetting T0
+CAN DATA/ALL
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+set axis/calendar="standard" `temp,return=taxis`
+ !-> set axis/calendar="standard" TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+ 
+! One day earlier
+set axis/t0="13-jan-1980:14:00" `temp,return=taxis`
+ !-> set axis/t0="13-jan-1980:14:00" TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE GREGORIAN
+GREGORIAN
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-DEC-1982 02 / 20:  25476.0
+ 16-DEC-1982 04 / 21:  25622.0
+ 22-DEC-1982 06 / 22:  25768.0
+ 28-DEC-1982 08 / 23:  25914.0
+ 03-JAN-1983 10 / 24:  26060.0
+ 09-JAN-1983 12 / 25:  26206.0
+ 
+ 
+! Now resetting UNITS
+CAN DATA/ALL
+CAN REGION
+use gt4d011.cdf
+ 
+set axis/units=feet `temp,return=zaxis`
+ !-> set axis/units=feet PSZT
+show axis `temp,return=zaxis`
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (FEET)            27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+! unrecognized units
+set axis/units="something" `temp,return=xaxis`
+ !-> set axis/units="something" PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon
+set axis/units=lon `temp,return=xaxis`
+ !-> set axis/units=lon PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=something `temp,return=xaxis`
+ !-> set axis/units=something PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon using word DEG
+set axis/units=deg `temp,return=xaxis`
+ !-> set axis/units=deg PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=zorro  `temp,r=zaxis`
+ !-> set axis/units=zorro  PSZT
+list/x=130w/y=1/k=1/L=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                       130.5W  
+                       100
+ 17-AUG-1982 12 / 1:  25.9777
+ 23-AUG-1982 14 / 2:  26.2025
+ 29-AUG-1982 16 / 3:  26.4463
+ 04-SEP-1982 18 / 4:  26.6606
+ 10-SEP-1982 20 / 5:  26.7818
+ 
+! not a geographic axis
+set axis/units=meters `temp,return=yaxis`
+ !-> set axis/units=meters PSYT
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (Y (METERS))
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ -0.5  / 44:  26.3422
+ -0.17 / 45:  26.2807
+ 0.17  / 46:  26.2649
+ 0.5   / 47:  26.2916
+ 
+set axis/units=deg `temp,return=yaxis`
+ !-> set axis/units=deg PSYT
+show axis `temp,return=yaxis`
+ !-> show axis PSYT
+ name       axis              # pts   start                end
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+   Axis span (to cell edges) = 80.00004
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (LATITUDE)
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ 0.5N  / 47:  26.2916
+ 0.17N / 46:  26.2649
+ 0.17S / 45:  26.2807
+ 0.5S  / 44:  26.3422
+ 
+! inappropriate units for axis direction
+set axis/units=meters `temp,return=taxis`
+ !-> set axis/units=meters TIME11
+list/x=130w/y=1/k=1/l=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (T (METERS))
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                130.5W  
+                100
+ 22702   / 1:  25.9777
+ 22848   / 2:  26.2025
+ 22994   / 3:  26.4463
+ 23140   / 4:  26.6606
+ 23286   / 5:  26.7818
+ 
+set axis/units=seconds  `temp,r=yaxis`
+ !-> set axis/units=seconds  PSYT
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      Y (SECONDS)        100 i   -28.836              48.568
+ PSZT      Z (ZORRO)           27 i-  5                    3824
+ TIME11    T (METERS)          25 r   22702                26206
+ normal    E
+ normal    F
+ 
+! assign time units to an abstract axis
+def axis/t=1:5:1 tax
+ 
+set axis/units=days/t0=1-jan-1990 tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 5 r   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 5
+list t[gt=tax]
+             VARIABLE : T
+                        axis TAX
+             SUBSET   : 5 points (TIME)
+ 02-JAN-1990 00 / 1:  1.00000
+ 03-JAN-1990 00 / 2:  2.00000
+ 04-JAN-1990 00 / 3:  3.00000
+ 05-JAN-1990 00 / 4:  4.00000
+ 06-JAN-1990 00 / 5:  5.00000
+ 
+! assign longitude units to an abstract axis
+! by default this becomes modulo
+def axis/x=0:120:20 xax
+ 
+set axis/units=lon xax
+sh axis xax
+ name       axis              # pts   start                end
+ XAX       LONGITUDE            7mr   0E                   120E
+   Axis span (to cell edges) = 140 (modulo length = 360)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 7 points (LONGITUDE)
+ 0E     / 1:    0.000
+ 20E    / 2:   20.000
+ 40E    / 3:   40.000
+ 60E    / 4:   60.000
+ 80E    / 5:   80.000
+ 100E   / 6:  100.000
+ 120E   / 7:  120.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.00000
+ 114W   / 427:  1.00000
+ 113W   / 428:  1.00000
+ 112W   / 429:  1.00000
+ 111W   / 430:  1.00000
+ 110W   / 431:  1.00000
+ 109W   / 432:  1.00000
+ 108W   / 433:  1.00000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+ 
+! ******** V5.8 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5559
+ 15-FEB      /  2:  29.5316
+ 17-MAR      /  3:  29.6615
+ 16-APR      /  4:  29.8829
+ 16-MAY      /  5:  29.8907
+ 16-JUN      /  6:  29.9644
+ 16-JUL      /  7:  29.6883
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.6661
+ 16-OCT      / 10:  29.7464
+ 15-NOV      / 11:  29.9058
+ 16-DEC      / 12:  29.7728
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                      139.5E   
+                       10
+ 16-JAN      /  1:  0.0020743
+ 15-FEB      /  2:  0.0005012
+ 17-MAR      /  3:  0.0079502
+ 16-APR      /  4:  0.0015034
+ 16-MAY      /  5:  0.0035104
+ 16-JUN      /  6:  0.0096970
+ 16-JUL      /  7:  0.0188794
+ 16-AUG      /  8:       ....
+ 15-SEP      /  9:  0.0055797
+ 16-OCT      / 10:  0.0068064
+ 15-NOV      / 11:  0.0019084
+ 16-DEC      / 12:  0.0048345
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5018
+ 15-FEB      /  2:  29.5157
+ 17-MAR      /  3:  29.5182
+ 16-APR      /  4:  29.7809
+ 16-MAY      /  5:  29.7883
+ 16-JUN      /  6:  29.8047
+ 16-JUL      /  7:  29.5034
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.5334
+ 16-OCT      / 10:  29.6438
+ 15-NOV      / 11:  29.8575
+ 16-DEC      / 12:  29.6620
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.6371
+ 15-FEB      /  2:  29.5474
+ 17-MAR      /  3:  29.8171
+ 16-APR      /  4:  29.9306
+ 16-MAY      /  5:  29.9564
+ 16-JUN      /  6:  30.0834
+ 16-JUL      /  7:  29.8189
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.7498
+ 16-OCT      / 10:  29.9003
+ 15-NOV      / 11:  29.9684
+ 16-DEC      / 12:  29.8558
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  295.559
+ 15-FEB      /  2:   59.063
+ 17-MAR      /  3:  533.908
+ 16-APR      /  4:  597.657
+ 16-MAY      /  5:  597.813
+ 16-JUN      /  6:  359.572
+ 16-JUL      /  7:  207.818
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  237.329
+ 16-OCT      / 10:  297.464
+ 15-NOV      / 11:  299.058
+ 16-DEC      / 12:  297.728
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  10.0000
+ 15-FEB      /  2:   2.0000
+ 17-MAR      /  3:  18.0000
+ 16-APR      /  4:  20.0000
+ 16-MAY      /  5:  20.0000
+ 16-JUN      /  6:  12.0000
+ 16-JUL      /  7:   7.0000
+ 16-AUG      /  8:   0.0000
+ 15-SEP      /  9:   8.0000
+ 16-OCT      / 10:  10.0000
+ 15-NOV      / 11:  10.0000
+ 16-DEC      / 12:  10.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.5000
+ 02-JAN-1990 00 /  2:  -1.5000
+ 03-JAN-1990 00 /  3:  -2.5000
+ 04-JAN-1990 00 /  4:  -3.5000
+ 05-JAN-1990 00 /  5:  -4.5000
+ 06-JAN-1990 00 /  6:  -5.5000
+ 07-JAN-1990 00 /  7:  -6.5000
+ 08-JAN-1990 00 /  8:  -7.5000
+ 09-JAN-1990 00 /  9:  -8.5000
+ 10-JAN-1990 00 / 10:  -9.5000
+ 11-JAN-1990 00 / 11:   1.9800
+ 12-JAN-1990 00 / 12:   3.9800
+ 13-JAN-1990 00 / 13:   5.9800
+ 14-JAN-1990 00 / 14:   7.9800
+ 15-JAN-1990 00 / 15:   9.9800
+ 16-JAN-1990 00 / 16:  11.9800
+ 17-JAN-1990 00 / 17:  13.9800
+ 18-JAN-1990 00 / 18:  15.9800
+ 19-JAN-1990 00 / 19:  17.9800
+ 20-JAN-1990 00 / 20:  19.9800
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.50000
+ 03-JAN-1990 00 / 3: -2.50000
+ 04-JAN-1990 00 / 4: -3.50000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.00000  0.500000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.98000
+ 13-JAN-1990 00 / 13:  5.98000
+ 14-JAN-1990 00 / 14:  7.98000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,6.2,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  3.00000  2.00000  1.00000  1.00000  3.00000
+ 2   / 2:  1.00000  3.00000  2.00000  2.00000  3.00000
+ 3   / 3:  2.00000  3.00000  3.00000  2.00000  3.00000
+ 4   / 4:  3.00000  2.00000  1.00000  1.00000  2.00000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ ---- K:1 Z:   1
+ 1   / 1:  111.000  112.000  113.000  114.000  115.000
+ 2   / 2:  121.000  122.000  123.000  124.000  125.000
+ 3   / 3:  131.000  132.000  133.000  134.000  135.000
+ 4   / 4:  141.000  142.000  143.000  144.000  145.000
+ ---- K:2 Z:   2
+ 1   / 1:  211.000  212.000  213.000  214.000  215.000
+ 2   / 2:  221.000  222.000  223.000  224.000  225.000
+ 3   / 3:  231.000  232.000  233.000  234.000  235.000
+ 4   / 4:  241.000  242.000  243.000  244.000  245.000
+ ---- K:3 Z:   3
+ 1   / 1:  311.000  312.000  313.000  314.000  315.000
+ 2   / 2:  321.000  322.000  323.000  324.000  325.000
+ 3   / 3:  331.000  332.000  333.000  334.000  335.000
+ 4   / 4:  341.000  342.000  343.000  344.000  345.000
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  311.000  212.000  113.000  114.000  315.000
+ 2   / 2:  121.000  322.000  223.000  224.000  325.000
+ 3   / 3:  231.000  332.000  333.000  234.000  335.000
+ 4   / 4:  341.000  242.000  143.000  144.000  245.000
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E     	100E     	100.1E   	100.2E   	100.2E   	100.3E   
+0.11N	1.0011	1.0016	1.0021	1.0026	1.0031	1.0036
+0.128N	1.00128	1.00178	1.00228	1.00278	1.00328	1.00378
+0.146N	1.00146	1.00196	1.00246	1.00296	1.00346	1.00396
+0.164N	1.00164	1.00214	1.00264	1.00314	1.00364	1.00414
+0.182N	1.00182	1.00232	1.00282	1.00332	1.00382	1.00432
+0.2N	1.002	1.0025	1.003	1.0035	1.004	1.0045
+0.218N	1.00218	1.00268	1.00318	1.00368	1.00418	1.00468
+0.236N	1.00236	1.00286	1.00336	1.00386	1.00436	1.00486
+0.254N	1.00254	1.00304	1.00354	1.00404	1.00454	1.00504
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E     ,100E     ,100.1E   ,100.1E   
+0.11N,1.0011,1.00143,1.00176,1.00209
+0.128N,1.00128,1.00161,1.00194,1.00227
+0.146N,1.00146,1.00179,1.00212,1.00245
+0.164N,1.00164,1.00197,1.0023,1.00263
+0.182N,1.00182,1.00215,1.00248,1.00281
+0.2N,1.002,1.00233,1.00266,1.00299
+0.218N,1.00218,1.00251,1.00284,1.00317
+0.236N,1.00236,1.00269,1.00302,1.00335
+0.254N,1.00254,1.00287,1.0032,1.00353
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.000
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.00000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1W   	155.1W   	155.1W   	155.1W   	155.1W   
+19.7N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1W   ,155.1W   ,155.1W   ,155.1W   ,155.1W   
+19.7N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: FEB-1980
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  8.000E+00  7.200E+00 0.060    0  SYSTEM  @ASFERRET Ver. 6.861
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 2  8.000E+00  7.100E+00 0.060    0  SYSTEM  @ASNOAA/PMEL TMAP
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 3  8.000E+00  7.000E+00 0.060    0  SYSTEM  @AS17-MAR-2014 15:54:03
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  8.000E+00  6.540E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 7  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 8  8.000E+00  6.750E+00 0.073    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+ 
+! ******** V5.81 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.5
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.5
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+ 
+GO bn_reset
+cancel mode verify
+GO bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl fill
+ 
+GO bn_reset
+cancel mode verify
+GO bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME7     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME7     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+! can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+ 
+! ******** V6.00 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+ 
+GO bn_reset
+cancel mode verify
+GO bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.861"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET   version6.861:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE/SIGMA
+      /CURVILIN
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE/QUIET
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET/SIGMA/CURVILIN
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO
+ 
+ Use SHOW ALIAS to see alternative command names
+ 
+GO bn_reset
+cancel mode verify
+GO bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "17-Mar-14:15:53"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="17-Mar-14:15:53"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 17-Mar-14
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 15:53
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="17-Mar-14:15:53"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "17-Mar-14:15:53"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT1)
+ Column  2: Z is Z (axis PSZT1)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT1)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+ 
+go bn_reset
+cancel mode verify
+go bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT1)                DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT1)                DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT1)                DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME4"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT1).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME4).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.59N
+             T (day): 1.8
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT1).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT1).units = degrees 
+ (PSXT1).point_spacing = even 
+ (PSXT1).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT1).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT1).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT1).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT1).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT1).units = meters 
+ (PSYT1).point_spacing = uneven 
+ (PSYT1).edges = PSYTedges 
+ (PSYT1).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = hour since 0000-01-01 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME7).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = days since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME7).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME7).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-mar-1955 
+ (TIME7).time_origin = 1-mar-1955 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME7).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME3[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME3).units = hour since 0000-01-01 00:00:00 
+ (TIME3).time_origin = 01-JAN-0000 00:00:00 
+ (TIME3).modulo =   
+ (TIME3).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+ 
+!=======
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!go bn_reset
+!go bn_nco_functions.jnl
+ 
+go bn_reset
+cancel mode verify
+go bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : JAN
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : JAN
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+ 
+go bn_reset
+cancel mode verify
+go bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : JAN to APR (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : JAN
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : JAN
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : AUG-1982
+          11.33
+ 
+go bn_reset
+cancel mode verify
+go bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+ 
+go bn_reset
+cancel mode verify
+go bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test (STRING)
+    VALUES: strings to search for (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME11
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+ 
+! ******** V6.01 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6321)
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME9
+ 
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME9
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT1
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT1
+show att/all ($zax)
+ !-> show att/all PSZT1
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT1_10)             DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        13   T       PSZT1_10_bnds
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ PSZT1_10_bnds         DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT1_10)             DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        13   T       PSZT1_10_bnds
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ PSZT1_10_bnds         DOUBLE
+  
+(TIME12)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! ******** V6.02 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX047)
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:   1
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX042)
+ name       axis              # pts   start                end
+ (AX042)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX049)
+ name       axis              # pts   start                end
+ (AX049)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME10
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX051)
+ name       axis              # pts   start                end
+ (AX051)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX048)
+ name       axis              # pts   start                end
+ (AX048)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: FEB-1982 to MAR-1982
+             LONGITUDE: 179.5E
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME3     TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      T                    5 r   1                    5
+   Axis span (to cell edges) = 5
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX1     X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX1     T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = 360)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+GO bn_reset
+cancel mode verify
+GO bn602_bug_fixes
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME11    TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+ 
+ 
+! ******** V6.03 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: JAN to DEC
+             LONGITUDE: 139.5E
+             LATITUDE: 0.833N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn603_bug_fixes
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+Internal overflow expressing 500000.0 Mwords as words (1783793664) 
+Unable to allocate the requested 500000.0 Mwords of memory.
+Memory remaining at 0.2 Mwords.
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+ 
+! ******** V6.05 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  11.89756
+ 179W   / 81:  12.11905
+ 177W   / 82:  12.07976
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  35.69268
+ 179W   / 81:  36.35714
+ 177W   / 82:  36.23927
+ 
+ 
+GO bn_reset
+cancel mode verify
+! This routine executes a ppl error which exits us from Ferret
+! when run in the benchmark suite. Should test this, but dont do it
+! here, for now.
+!GO bn_ppl_errors.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO bn_memory_symbol
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+ 
+GO bn_reset
+cancel mode verify
+GO bn605_bug_fixes
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: JAN to DEC
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                            T     TBOX
+16-JAN 12      /  1:   15.5000  31.00000
+15-FEB 02      /  2:   45.1213  28.24250
+15-MAR 17      /  3:   74.7425  31.00000
+15-APR 05      /  4:  105.2425  30.00000
+15-MAY 17      /  5:  135.7425  31.00000
+15-JUN 05      /  6:  166.2425  30.00000
+15-JUL 17      /  7:  196.7425  31.00000
+15-AUG 17      /  8:  227.7425  31.00000
+15-SEP 05      /  9:  258.2425  30.00000
+15-OCT 17      / 10:  288.7425  31.00000
+15-NOV 05      / 11:  319.2425  30.00000
+15-DEC 17      / 12:  349.7425  31.00000
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+ADD_9(A,B,C,D,E,F,G,H,I)
+APPENDE(ENS,VAR)
+AVET(A)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+DATES(Offsets)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+FACTORIAL(A)
+FFT_AMP(A)
+FFTA_SAMPLE(A)
+FFT_PHAS(A)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+PASS_THRU(A)
+PERCENT_GOOD_T(A)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SORTI_STR(DAT)
+STORAGE(A)
+STRING_ARG(Flags,NString)
+STUDENT_T_CUTOFF(P,nf)
+SUBTRACT(A,B)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn608_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+<taxis>TIME11</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "7.9999998E-04"
+YAXIS_MAX = "2.0999999E-03"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000001E-07"
+YAXIS_MAX = "2.1000001E-06"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+YAXNAM = "YAX_LEV94"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXL = "4.737"
+XAXNAME = "XIRREG_SUBSPAN"
+XAXIS_MAX = "5.0050505E-06"
+XAXNAM = "(XAX_LEV9421_380)"
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+YAXNAM = "YAX_LEV94"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+ 
+ 
+! ******** V6.1 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_trim
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_nlevels
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn61_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+ 
+ 
+! ******** V6.11 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_test_opendap
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00000
+ 
+ 
+CANCEL MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO bn611_bug_fixes
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+fill/over/i=1:2/j=0:2/patt i+j
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME3"          
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+ 
+! ******** V6.13 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_no_valid_on_plot
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.530E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.780E+00 -7.900E-01 0.119    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.530E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_median
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: NOV-1982 to JAN-1983
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                           VAR     VAR       VAR       VAR
+30-NOV-1982 23 / 106: -10.06812 -10.06812 -10.06812 -11.97891
+04-DEC-1982 00 / 107: -13.41848 -13.41848 -13.41848 -10.06812
+07-DEC-1982 01 / 108: -15.06836 -13.41848 -13.41848 -10.06812
+10-DEC-1982 02 / 109: -11.97891 -11.97891 -11.97891 -10.06812
+13-DEC-1982 03 / 110:  -4.63116  -4.63116  -4.63116  -4.63116
+16-DEC-1982 04 / 111:   0.77075   0.77075   0.77075   0.77075
+19-DEC-1982 05 / 112:   1.06240   1.06240   1.06240   1.06240
+22-DEC-1982 06 / 113:   2.75400   2.75400   2.75400   2.75400
+25-DEC-1982 07 / 114:   9.06758   9.06758   9.06758   4.21162
+28-DEC-1982 08 / 115:  10.80434   9.06758   9.06758   4.21162
+31-DEC-1982 09 / 116:   4.21162  10.80434  10.80434   9.06758
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: FEB-0002
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+                  VAR     VAR       VAR
+79W   / 131:      ....  25.98750  25.92824
+77W   / 132:      ....      ....  25.98750
+75W   / 133:      ....      ....  25.98750
+73W   / 134:      ....      ....      ....
+71W   / 135:      ....      ....      ....
+69W   / 136:      ....      ....      ....
+67W   / 137:      ....      ....      ....
+65W   / 138:      ....      ....      ....
+63W   / 139:      ....      ....  27.80000
+61W   / 140:      ....      ....  27.80000
+59W   / 141:      ....  27.80000  27.64737
+57W   / 142:  27.80000  27.80000  27.70333
+55W   / 143:  27.64737  27.64737  27.64737
+53W   / 144:  27.43500  27.64737  27.64737
+51W   / 145:  27.70333  27.43500  27.64737
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: FEB-0002
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+                 VAR     VAR       VAR
+19S   / 36:  28.32244  28.32244  28.32244
+17S   / 37:  28.56983  28.56983  28.56983
+15S   / 38:  29.05953  29.05953  29.05953
+13S   / 39:  29.43250  29.23719  29.23170
+11S   / 40:  29.23719  29.32561  29.23170
+9S    / 41:  29.32561  29.23719  29.23170
+7S    / 42:  29.23170  29.23170  29.23170
+5S    / 43:  28.96976  28.96976  28.96976
+3S    / 44:  28.39779  28.39779  28.44243
+1S    / 45:  28.36456  28.39779  28.39779
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+                VAR     VAR        VAR
+0     / 1:  1.900075  1.900075  0.3281405
+20    / 2:  1.322209  1.322209  0.3281405
+40    / 3:  0.328140  0.328140  0.2405229
+60    / 4: -0.253715 -0.157475  0.3281405
+80    / 5: -0.157475 -0.253715  0.3281405
+100   / 6: -0.785400 -0.157475  0.3281405
+120   / 7:  0.240523  0.240523  0.3281405
+140   / 8:  0.390383  0.390383  0.3903829
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn614_bug_fixes
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E(179.97)
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME11    TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E(180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E(180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1.011S
+                          141.3W   
+                            1
+ 16-JAN 12      /  1:  0.05848070
+ 15-FEB 00      /  2:  0.05188299
+ 16-MAR 12      /  3:  0.04782573
+ 16-APR 00      /  4:  0.03808421
+ 16-MAY 12      /  5:  0.05937929
+ 16-JUN 00      /  6:  0.06571895
+ 16-JUL 12      /  7:  0.06152720
+ 16-AUG 12      /  8:  0.07460730
+ 16-SEP 00      /  9:  0.05815475
+ 16-OCT 12      / 10:  0.06169292
+ 16-NOV 00      / 11:  0.05654943
+ 16-DEC 12      / 12:  0.05768678
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX3      TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+ 
+! ******** V6.14 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_mode_nodata_lab
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_proleptic_gregorian_calendar
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME               733 r   01-JAN-1988 00:00    01-JAN-1990 00:00
+T0 = 15-JAN-1901
+CALENDAR = ALL_LEAP
+   Axis span (to cell edges) = 733
+ 
+GO bn_reset
+cancel mode verify
+GO bn_string_ngd_nbd
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cat_string
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sort_strings
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+          INDX_AJ                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+          INDX_BJ   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+          INDX_AK                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+          INDX_BK   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+          INDX_AL                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+          INDX_BL   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_samplexyt
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+               YPTS     TPTS   SAMPL_PTS
+1    /  1:  20.53799    20.000      ....
+2    /  2: -29.07481    60.000      ....
+3    /  3:  26.64251   100.000      ....
+4    /  4: -28.97490   140.000      ....
+5    /  5: -17.10210   180.000      ....
+6    /  6:  -8.79040   220.000      ....
+7    /  7: -26.48790   260.000      ....
+8    /  8:  -9.00391   300.000      ....
+9    /  9: -19.19385   340.000      ....
+10   / 10: -19.84003   380.000  360.6600
+11   / 11: -44.10992   420.000  376.3901
+12   / 12:  34.07387   460.000  494.5739
+13   / 13:  34.62830   500.000  535.1283
+14   / 14:  -6.59559   540.000  533.9044
+15   / 15: -39.01164   580.000  541.4884
+16   / 16: -25.63370   620.000  594.8663
+17   / 17: -22.96677   660.000  637.5332
+18   / 18: -30.90969   700.000  669.5903
+19   / 19: -22.52078   740.000      ....
+20   / 20: -20.65415   780.000      ....
+21   / 21: -41.65880   820.000      ....
+22   / 22:  39.13533   860.000      ....
+23   / 23:  22.88071   900.000      ....
+24   / 24: -41.03287   940.000      ....
+25   / 25:  33.34976   980.000      ....
+26   / 26:  22.53505  1020.000      ....
+27   / 27:  13.97536  1060.000      ....
+28   / 28:  21.99063  1100.000      ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G093_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G093_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G104_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+          FCN_NOR    FCN_REV
+J /  1:  0.6331937 -0.6331937
+J /  2:  0.6454794 -0.6454794
+J /  3:  0.4997293 -0.4997293
+J /  4:  0.2316280 -0.2316280
+J /  5: -0.0931839  0.0931839
+J /  6: -0.3951811  0.3951811
+J /  7: -0.6004243  0.6004243
+J /  8: -0.6586626  0.6586626
+J /  9: -0.5556374  0.5556374
+J / 10: -0.3165727  0.3165727
+J / 11:  0.0000000  0.0000000
+J / 12:  0.3165727 -0.3165727
+J / 13:  0.5556374 -0.5556374
+J / 14:  0.6586626 -0.6586626
+J / 15:  0.6004243 -0.6004243
+J / 16:  0.3951811 -0.3951811
+J / 17:  0.0931839 -0.0931839
+J / 18: -0.2316280  0.2316280
+J / 19: -0.4997293  0.4997293
+J / 20: -0.6454794  0.6454794
+J / 21: -0.6331937  0.6331937
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+                180E    
+                51
+ 8N   / 19:  0.4997293
+ 7N   / 18:  0.2316280
+ 6N   / 17: -0.0931839
+ 5N   / 16: -0.3951811
+ 4N   / 15: -0.6004243
+ 3N   / 14: -0.6586626
+ 2N   / 13: -0.5556374
+ 1N   / 12: -0.3165727
+ 0    / 11:  0.0000000
+ 1S   / 10:  0.3165727
+ 
+GO bn_reset
+cancel mode verify
+GO bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+ 
+! ******** V6.2 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0000
+ 31-DEC-1999 12:00 / 792:  365.0000
+ 01-JAN-2000 00:00 / 793:    1.0000
+ 01-JAN-2000 12:00 / 794:    1.0000
+ 02-JAN-2000 00:00 / 795:    2.0000
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A       A        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+                  B       B        EX#3       EX#4
+1    /  1:  0.000000       ....       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000  0.8000000
+3    /  3:  1.000000  0.7500000  0.7500000  0.6000000
+4    /  4:  0.000000  0.5000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000  0.4000000
+6    /  6:  0.000000  0.2500000  0.2500000  0.1000000
+7    /  7:  0.000000  0.0000000  0.0000000       ....
+8    /  8:  0.000000       ....       ....       ....
+9    /  9:      ....       ....       ....       ....
+10   / 10:  0.000000       ....       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000       ....
+12   / 12:  0.000000       ....       ....       ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+                  C       C        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 13
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+                  D       D        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A      A        EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000000      ....      ....
+2    /  2:  2.000000  1.750000  1.750000
+3    /  3:  2.000000  1.750000  1.750000
+4    /  4:  1.000000  1.500000  1.500000
+5    /  5:  2.000000  1.500000  1.500000
+6    /  6:  1.000000  1.250000  1.250000
+7    /  7:  1.000000  1.000000  1.000000
+8    /  8:  1.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  1.000000      ....      ....
+11   / 11:  1.000000  1.000000  1.000000
+12   / 12:  1.000000      ....      ....
+ ---- J:2 Y:   2
+1    /  1:  2.000000      ....      ....
+2    /  2:  3.000000  2.750000  2.750000
+3    /  3:  3.000000  2.750000  2.750000
+4    /  4:  2.000000  2.500000  2.500000
+5    /  5:  3.000000  2.500000  2.500000
+6    /  6:  2.000000  2.250000  2.250000
+7    /  7:  2.000000  2.000000  2.000000
+8    /  8:  2.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  2.000000      ....      ....
+11   / 11:  2.000000  2.000000  2.000000
+12   / 12:  2.000000      ....      ....
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3122928879.
+ 01-JAN-2000 00:14:41 / 441:  3122928881.
+ 01-JAN-2000 00:14:43 / 442:  3122928883.
+ 01-JAN-2000 00:14:45 / 443:  3122928885.
+ 01-JAN-2000 00:14:47 / 444:  3122928887.
+ 01-JAN-2000 00:14:49 / 445:  3122928889.
+ 01-JAN-2000 00:14:51 / 446:  3122928891.
+ 01-JAN-2000 00:14:53 / 447:  3122928893.
+ 01-JAN-2000 00:14:55 / 448:  3122928895.
+ 01-JAN-2000 00:14:57 / 449:  3122928897.
+ 01-JAN-2000 00:14:59 / 450:  3122928899.
+ 01-JAN-2000 00:15:01 / 451:  3122928901.
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_clock_syms
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "39.644"
+CLOCK_SECS = "68.286"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:54:28"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.037994"
+CLOCK_SECS = "68.357"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.297955
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0"
+CLOCK_SECS = "69.07"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "69.07"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.036995
+ !-> DEFINE VARIABLE sumcpu =0.036995
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.032995
+ !-> DEFINE VARIABLE sumcpu =0.06999
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.035994
+ !-> DEFINE VARIABLE sumcpu =0.105984
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.030995
+ !-> DEFINE VARIABLE sumcpu =0.136979
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.032996
+ !-> DEFINE VARIABLE sumcpu =0.169975
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.030995
+ !-> DEFINE VARIABLE sumcpu =0.20097
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.033995
+ !-> DEFINE VARIABLE sumcpu =0.234965
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.26996
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.037993
+ !-> DEFINE VARIABLE sumcpu =0.307953
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.032995
+ !-> DEFINE VARIABLE sumcpu =0.340948
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.340948
+0.340948
+sh sym CLOCK_SECS
+CLOCK_SECS = "70.242"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:53"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:54:30"
+ 
+ 
+! ******** V6.3 Additions below ***********
+! Note that allowing mouse-click operations in the current
+! window, not only in window 1, is implemented in v6.3. Not
+! tested in the benchmarks.
+ 
+GO bn_reset
+cancel mode verify
+GO bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+Set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                     Z    ZBOXLO    ZBOXHI
+-5000   /  1: -5000.000 -5000.000 -4500.000
+-4000   /  2: -4000.000 -4500.000 -3500.000
+-3000   /  3: -3000.000 -3500.000 -2500.000
+-2000   /  4: -2000.000 -2500.000 -1800.000
+-1500   /  5: -1500.000 -1800.000 -1300.000
+-1200   /  6: -1200.000 -1300.000 -1100.000
+-1000   /  7: -1000.000 -1100.000  -900.000
+-800    /  8:  -800.000  -900.000  -700.000
+-600    /  9:  -600.000  -700.000  -500.000
+-400    / 10:  -400.000  -500.000  -350.000
+-300    / 11:  -300.000  -350.000  -250.000
+-200    / 12:  -200.000  -250.000  -180.000
+-150    / 13:  -150.000  -180.000  -120.000
+-100    / 14:  -100.000  -120.000   -90.000
+-75     / 15:   -75.000   -90.000   -60.000
+-50     / 16:   -50.000   -60.000   -32.000
+-30     / 17:   -30.000   -32.000   -24.000
+-20     / 18:   -20.000   -24.000   -12.000
+-10     / 19:   -10.000   -12.000    -5.000
+0       / 20:     0.000    -5.000     0.000
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : JAN
+ 1   / 1:  27.46402
+ 2   / 2:  27.44937
+ 3   / 3:  27.53579
+ 4   / 4:  27.54567
+ 5   / 5:  27.55554
+ 6   / 6:  27.65924
+ 7   / 7:  27.74823
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+              YBOXLO    YBOXHI
+76.5S /  1: -90.00000 -70.81186
+66.4S /  2: -70.81186 -62.73396
+59.4S /  3: -62.73396 -56.44269
+53.7S /  4: -56.44269 -51.05756
+48.6S /  5: -51.05756 -46.23826
+44S   /  6: -46.23826 -41.81031
+39.7S /  7: -41.81031 -37.66989
+35.7S /  8: -37.66989 -33.74899
+31.9S /  9: -33.74899 -30.00000
+28.2S / 10: -30.00000 -26.38780
+24.6S / 11: -26.38780 -22.88538
+21.2S / 12: -22.88538 -19.47122
+17.8S / 13: -19.47122 -16.12762
+14.5S / 14: -16.12762 -12.83959
+11.2S / 15: -12.83959  -9.59407
+8S    / 16:  -9.59407  -6.37937
+4.8S  / 17:  -6.37937  -3.18474
+1.6S  / 18:  -3.18474   0.00000
+1.6N  / 19:   0.00000   3.18474
+4.8N  / 20:   3.18474   6.37937
+8N    / 21:   6.37937   9.59407
+11.2N / 22:   9.59407  12.83959
+14.5N / 23:  12.83959  16.12762
+17.8N / 24:  16.12762  19.47122
+21.2N / 25:  19.47122  22.88538
+24.6N / 26:  22.88538  26.38780
+28.2N / 27:  26.38780  30.00000
+31.9N / 28:  30.00000  33.74899
+35.7N / 29:  33.74899  37.66989
+39.7N / 30:  37.66989  41.81031
+44N   / 31:  41.81031  46.23826
+48.6N / 32:  46.23826  51.05756
+53.7N / 33:  51.05756  56.44269
+59.4N / 34:  56.44269  62.73396
+66.4N / 35:  62.73396  70.81186
+76.5N / 36:  70.81186  90.00000
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+                  EX#1      EX#2
+76.5S /  1:  0.03826170  0.02777778
+66.4S /  2:  0.02750340  0.02777778
+59.4S /  3:  0.02724976  0.02777778
+53.7S /  4:  0.02718343  0.02777778
+48.6S /  5:  0.02715676  0.02777778
+44S   /  6:  0.02714348  0.02777778
+39.7S /  7:  0.02713596  0.02777778
+35.7S /  8:  0.02713132  0.02777778
+31.9S /  9:  0.02712828  0.02777778
+28.2S / 10:  0.02712619  0.02777778
+24.6S / 11:  0.02712471  0.02777778
+21.2S / 12:  0.02712365  0.02777778
+17.8S / 13:  0.02712287  0.02777778
+14.5S / 14:  0.02712229  0.02777778
+11.2S / 15:  0.02712188  0.02777778
+8S    / 16:  0.02712159  0.02777778
+4.8S  / 17:  0.02712141  0.02777778
+1.6S  / 18:  0.02712133  0.02777778
+1.6N  / 19:  0.02712133  0.02777778
+4.8N  / 20:  0.02712141  0.02777778
+8N    / 21:  0.02712159  0.02777778
+11.2N / 22:  0.02712188  0.02777778
+14.5N / 23:  0.02712229  0.02777778
+17.8N / 24:  0.02712287  0.02777778
+21.2N / 25:  0.02712365  0.02777778
+24.6N / 26:  0.02712471  0.02777778
+28.2N / 27:  0.02712619  0.02777778
+31.9N / 28:  0.02712828  0.02777778
+35.7N / 29:  0.02713132  0.02777778
+39.7N / 30:  0.02713596  0.02777778
+44N   / 31:  0.02714348  0.02777778
+48.6N / 32:  0.02715676  0.02777778
+53.7N / 33:  0.02718343  0.02777778
+59.4N / 34:  0.02724976  0.02777778
+66.4N / 35:  0.02750340  0.02777778
+76.5N / 36:  0.03826170  0.02777778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777782
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777779
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777777
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0000
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8458605
+ 16-JAN-1951 /  2: -0.4792148
+ 16-JAN-1952 /  3: -0.0086413
+ 16-JAN-1953 /  4:  0.5029880
+ 16-JAN-1954 /  5: -0.8600939
+ 16-JAN-1955 /  6:  0.9996375
+ 16-JAN-1956 /  7: -0.8863128
+ 16-JAN-1957 /  8:  0.5403982
+ 16-JAN-1958 /  9: -0.0624683
+ 16-JAN-1959 / 10: -0.4312768
+ 16-JAN-1960 / 11:  0.8159143
+ 16-JAN-1961 / 12: -0.9951944
+ 16-JAN-1962 / 13:  0.9169914
+ 16-JAN-1963 / 14: -0.6068212
+ 16-JAN-1964 / 15:  0.1431603
+ 16-JAN-1965 / 16:  0.3660465
+ 16-JAN-1966 / 17: -0.7727474
+ 16-JAN-1967 / 18:  0.9839827
+ 16-JAN-1968 / 19: -0.9463078
+ 16-JAN-1969 / 20:  0.6617913
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX133)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241199
+ DEC-1951 /  2:  0.2968155
+ DEC-1952 /  3:  0.2153545
+ DEC-1953 /  4: -0.6634768
+ DEC-1954 /  5:  0.9437761
+ DEC-1955 /  6: -0.9853337
+ DEC-1956 /  7:  0.7713169
+ DEC-1957 /  8: -0.3639512
+ DEC-1958 /  9: -0.1354919
+ DEC-1959 / 10:  0.6006479
+ DEC-1960 / 11: -0.9178868
+ DEC-1961 / 12:  0.9949715
+ DEC-1962 / 13: -0.8203671
+ DEC-1963 / 14:  0.4382506
+ DEC-1964 / 15:  0.0647143
+ DEC-1965 / 16: -0.5422904
+ DEC-1966 / 17:  0.8826929
+ DEC-1967 / 18: -0.9998160
+ DEC-1968 / 19:  0.8589436
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX139)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_reversed_syms
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_isdepth
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT1
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+ 
+ 
+! ******** V6.4 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn64_bug_fixes
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                  2         3      
+                   2         3
+ 21241   / 1:   2.00000  27.00000
+ 21242   / 2:   2.00000  28.00000
+ 21243   / 3:   2.00000  29.00000
+ 21244   / 4:   3.00000   1.00000
+ 21245   / 5:   3.00000   2.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_grid_names
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+               1          2          3      
+               1          2          3
+ 1   / 1:  0.0060000  0.1760000  0.2820000
+ 2   / 2:  0.3550000  0.3790000  0.3930000
+ 3   / 3:  0.4100000  0.4170000  0.4670000
+ 4   / 4:  0.4350000  0.4440000  0.4700000
+ 5   / 5:  0.4780000  0.5150000  0.4690000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4         6         8      
+               2         3         4
+ ---- L:2 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2222.000  3222.000  4222.000
+ 6   / 3:  2322.000  3322.000  4322.000
+ 8   / 4:  2422.000  3422.000  4422.000
+ ---- K:3 Z:   6
+ 4   / 2:  2232.000  3232.000  4232.000
+ 6   / 3:  2332.000  3332.000  4332.000
+ 8   / 4:  2432.000  3432.000  4432.000
+ ---- K:4 Z:   8
+ 4   / 2:  2242.000  3242.000  4242.000
+ 6   / 3:  2342.000  3342.000  4342.000
+ 8   / 4:  2442.000  3442.000  4442.000
+ ---- L:3 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2223.000  3223.000  4223.000
+ 6   / 3:  2323.000  3323.000  4323.000
+ 8   / 4:  2423.000  3423.000  4423.000
+ ---- K:3 Z:   6
+ 4   / 2:  2233.000  3233.000  4233.000
+ 6   / 3:  2333.000  3333.000  4333.000
+ 8   / 4:  2433.000  3433.000  4433.000
+ ---- K:4 Z:   8
+ 4   / 2:  2243.000  3243.000  4243.000
+ 6   / 3:  2343.000  3343.000  4343.000
+ 8   / 4:  2443.000  3443.000  4443.000
+ ---- L:4 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2224.000  3224.000  4224.000
+ 6   / 3:  2324.000  3324.000  4324.000
+ 8   / 4:  2424.000  3424.000  4424.000
+ ---- K:3 Z:   6
+ 4   / 2:  2234.000  3234.000  4234.000
+ 6   / 3:  2334.000  3334.000  4334.000
+ 8   / 4:  2434.000  3434.000  4434.000
+ ---- K:4 Z:   8
+ 4   / 2:  2244.000  3244.000  4244.000
+ 6   / 3:  2344.000  3344.000  4344.000
+ 8   / 4:  2444.000  3444.000  4444.000
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5         7         9      
+               3         4         5
+ ---- L:3 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2777.500  3777.500  4777.500
+ 7   / 4:  2877.500  3877.500  4877.500
+ 9   / 5:  2977.500  3977.500  4977.500
+ ---- K:4 Z:   7
+ 5   / 3:  2787.500  3787.500  4787.500
+ 7   / 4:  2887.500  3887.500  4887.500
+ 9   / 5:  2987.500  3987.500  4987.500
+ ---- K:5 Z:   9
+ 5   / 3:  2797.500  3797.500  4797.500
+ 7   / 4:  2897.500  3897.500  4897.500
+ 9   / 5:  2997.500  3997.500  4997.500
+ ---- L:4 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2778.500  3778.500  4778.500
+ 7   / 4:  2878.500  3878.500  4878.500
+ 9   / 5:  2978.500  3978.500  4978.500
+ ---- K:4 Z:   7
+ 5   / 3:  2788.500  3788.500  4788.500
+ 7   / 4:  2888.500  3888.500  4888.500
+ 9   / 5:  2988.500  3988.500  4988.500
+ ---- K:5 Z:   9
+ 5   / 3:  2798.500  3798.500  4798.500
+ 7   / 4:  2898.500  3898.500  4898.500
+ 9   / 5:  2998.500  3998.500  4998.500
+ ---- L:5 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2779.500  3779.500  4779.500
+ 7   / 4:  2879.500  3879.500  4879.500
+ 9   / 5:  2979.500  3979.500  4979.500
+ ---- K:4 Z:   7
+ 5   / 3:  2789.500  3789.500  4789.500
+ 7   / 4:  2889.500  3889.500  4889.500
+ 9   / 5:  2989.500  3989.500  4989.500
+ ---- K:5 Z:   9
+ 5   / 3:  2799.500  3799.500  4799.500
+ 7   / 4:  2899.500  3899.500  4899.500
+ 9   / 5:  2999.500  3999.500  4999.500
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88290  23.97420  24.14894  24.37499  24.62556
+ 25-JAN-1982 00 / 3:  23.88501  23.98344  24.16565  24.39832  24.65027
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88380  23.97520  24.15006  24.37614  24.62650
+ 25-JAN-1982 00 / 3:  23.87741  23.97277  24.15346  24.38574  24.63814
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.75267  23.76377  23.87293  24.04456  24.25203
+ 25-JAN-1982 00 / 3:  23.74388  23.73211  23.81637  23.96577  24.15370
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M: 29 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 753  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 27 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 754  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 755  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 756  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 26 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 757  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 758  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 759  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 760  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 761  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ found   TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+setting up plot
+PPL plot 762  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 25 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 763  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 764  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 765  complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+               158.5E    159.5E    160.5E  
+               139       140       141
+ 4.5S / 86:  29.51100  29.44300  29.38000
+ 5.5S / 85:  29.58900  29.52500  29.45700
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00000
+ 23E   / 2:  23.00000
+ 25E   / 3:  25.00000
+ 27E   / 4:  27.00000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   3
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid GG2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G106)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX116)                         use count:   1
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX127)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_repl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+ 
+! ******** V6.5 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn65_bug_fixes
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.0
+ 16-OCT-1149 12 /  2:  419308.5
+ 16-NOV-1149 00 /  3:  419339.0
+ 16-DEC-1149 12 /  4:  419369.5
+ 16-JAN-1150 12 /  5:  419400.5
+ 15-FEB-1150 00 /  6:  419430.0
+ 16-MAR-1150 12 /  7:  419459.5
+ 16-APR-1150 00 /  8:  419490.0
+ 16-MAY-1150 12 /  9:  419520.5
+ 16-JUN-1150 00 / 10:  419551.0
+ 16-JUL-1150 12 / 11:  419581.5
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_txtype_dmy
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn_n_open_dsets_sym
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_multi_decade
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+GO bn_reset
+cancel mode verify
+GO bn_show_xml_file
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+ 
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME3</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME3">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+ 
+ 
+! GO bn_reset
+! GO bn_encode_url
+ 
+! ******** V6.6 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn66_bug_fixes
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: AUG-1982 to JAN-1983 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: AUG-1982 to JAN-1983
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : AUG-1982 to JAN-1983 (XZT ave)
+ 3.5N  / 56:  27.59128
+ 3.17N / 55:  27.76072
+ 2.83N / 54:  27.89503
+ 2.5N  / 53:  28.00175
+ 2.17N / 52:  28.08330
+ 1.83N / 51:  28.13652
+ 1.5N  / 50:  28.15913
+ 1.17N / 49:  28.15796
+ 0.83N / 48:  28.14635
+ 0.5N  / 47:  28.13609
+ 0.17N / 46:  28.13627
+ 0.17S / 45:  28.15042
+ 0.5S  / 44:  28.17639
+ 0.83S / 43:  28.20504
+ 1.17S / 42:  28.22684
+ 1.5S  / 41:  28.23347
+ 1.83S / 40:  28.21657
+ 2.17S / 39:  28.16886
+ 2.5S  / 38:  28.08460
+ 2.83S / 37:  27.96112
+ 3.17S / 36:  27.80014
+ 3.5S  / 35:  27.60770
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: AUG-1982 to JAN-1983 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+ 
+GO bn_reset
+cancel mode verify
+GO bn_netcdf4
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G089)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G103)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+ 
+! *********** v6.62 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_dir_symbols
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+AX_VERT = "Y"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+ 
+! *********** v6.63 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn663_bug_fixes
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_axis_regular
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.2563 to 10.74
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_cancel_redirect
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.861  "                                                         
+ 3    /  3:" ! Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14"                           
+ 4    /  4:" ! 17-Mar-14 15:53     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+ 
+GO bn_reset
+cancel mode verify
+GO bn_min_max_smoothers
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+ 
+auxiliary varible regridding transforms e.g.TEMP[GZ(depth)=zax at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @PLAVE      pc-wise linear ave
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.667S to 3.667N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vector_symbols
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+ 
+GO bn_reset
+cancel mode verify
+GO bn_variance_large
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labnum_calendar
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME12
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+ 
+ 
+! *********** v6.65 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn665_bug_fixes
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME13
+<axes>
+<axis name="TIME13">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME13
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_floatstr
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+ 
+! *********** v6.7 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn67_bug_fixes
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME13)               DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_NaN_note
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+ 
+! *********** v6.71 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn671_bug_fixes
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3663   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+ 
+! *********** v6.8 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn68_bug_fixes
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX128)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX120)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ifv
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_randu2_randn2
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+ 
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+ 
+can mode ver
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.122
+randu2_randn2       0.552
+randu2_randn2       0.336
+randu2_randn2       0.760
+randu2_randn2       0.809
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.671
+randu2_randn2       0.410
+randu2_randn2       0.644
+randu2_randn2       0.858
+randu2_randn2       0.128
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.340
+randu2_randn2       0.473
+randu2_randn2       0.649
+randu2_randn2       0.815
+randu2_randn2       0.391
+randu2_randn2       0.219
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.402
+randu2_randn2       0.871
+randu2_randn2       0.011
+randu2_randn2       0.384
+randu2_randn2       0.489
+randu2_randn2       0.938
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.204
+randu2_randn2      -0.952
+randu2_randn2      -0.076
+randu2_randn2      -0.894
+randu2_randn2      -0.123
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       1.686
+randu2_randn2      -1.735
+randu2_randn2      -0.659
+randu2_randn2      -1.317
+randu2_randn2      -1.823
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.193
+randu2_randn2      -0.565
+randu2_randn2       0.181
+randu2_randn2       0.976
+randu2_randn2       1.204
+randu2_randn2      -0.993
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.764
+randu2_randn2      -0.760
+randu2_randn2      -0.391
+randu2_randn2       0.717
+randu2_randn2       1.299
+randu2_randn2       0.840
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+randu2_randn2       1.791       1.791       0.735
+randu2_randn2       1.343       1.343       0.735
+randu2_randn2       0.735       0.735       0.340
+randu2_randn2       0.019       0.019       0.735
+randu2_randn2      -0.682      -0.459       0.735
+randu2_randn2      -0.459      -0.459       0.735
+randu2_randn2       0.340       0.340       0.735
+randu2_randn2       0.766       0.766       0.766
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_cf
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeated_coords
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_header
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+! Here's one where the dataset has a string variable
+ 
+can dat/all
+ 
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_numstring.jnl"
+use numstring
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out_string.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out_string.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out_string.xml" </data>
+ 
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
+<dimension>STRING1_7</dimension>
+<xaxis>XAX1_10</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+--
+<dimensions>
+<dimension name="STRING1_7">
+<attribute name="length" type="short">
+   <value>7</value>
+</attribute>
+</dimension>
+</dimensions>
+</data>
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1: -0.7071  0.0000
+ 2   / 2:  0.0000 -0.7071
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1: -1.414  0.000
+ 0.25  /   2: -1.402 -0.185
+ 0.5   /   3: -1.366 -0.366
+ 0.75  /   4: -1.307 -0.541
+ 1     /   5: -1.225 -0.707
+ 1.25  /   6: -1.122 -0.861
+ 1.5   /   7: -1.000 -1.000
+ 1.75  /   8: -0.861 -1.122
+ 2     /   9: -0.707 -1.225
+ 2.25  /  10: -0.541 -1.307
+ 2.5   /  11: -0.366 -1.366
+ 2.75  /  12: -0.185 -1.402
+ 3     /  13:  0.000 -1.414
+ 3.25  /  14:  0.185 -1.402
+ 3.5   /  15:  0.366 -1.366
+ 3.75  /  16:  0.541 -1.307
+ 4     /  17:  0.707 -1.225
+ 4.25  /  18:  0.861 -1.122
+ 4.5   /  19:  1.000 -1.000
+ 4.75  /  20:  1.122 -0.861
+ 5     /  21:  1.225 -0.707
+ 5.25  /  22:  1.307 -0.541
+ 5.5   /  23:  1.366 -0.366
+ 5.75  /  24:  1.402 -0.185
+ 6     /  25:  1.414  0.000
+ 6.25  /  26:  1.402  0.185
+ 6.5   /  27:  1.366  0.366
+ 6.75  /  28:  1.307  0.541
+ 7     /  29:  1.225  0.707
+ 7.25  /  30:  1.122  0.861
+ 7.5   /  31:  1.000  1.000
+ 7.75  /  32:  0.861  1.122
+ 8     /  33:  0.707  1.225
+ 8.25  /  34:  0.541  1.307
+ 8.5   /  35:  0.366  1.366
+ 8.75  /  36:  0.185  1.402
+ 9     /  37:  0.000  1.414
+ 9.25  /  38: -0.185  1.402
+ 9.5   /  39: -0.366  1.366
+ 9.75  /  40: -0.541  1.307
+ 10    /  41: -0.707  1.225
+ 10.25 /  42: -0.861  1.122
+ 10.5  /  43: -1.000  1.000
+ 10.75 /  44: -1.122  0.861
+ 11    /  45: -1.225  0.707
+ 11.25 /  46: -1.307  0.541
+ 11.5  /  47: -1.366  0.366
+ 11.75 /  48: -1.402  0.185
+ 12    /  49: -1.414  0.000
+ 12.25 /  50: -1.402 -0.185
+ 12.5  /  51: -1.366 -0.366
+ 12.75 /  52: -1.307 -0.541
+ 13    /  53: -1.225 -0.707
+ 13.25 /  54: -1.122 -0.861
+ 13.5  /  55: -1.000 -1.000
+ 13.75 /  56: -0.861 -1.122
+ 14    /  57: -0.707 -1.225
+ 14.25 /  58: -0.541 -1.307
+ 14.5  /  59: -0.366 -1.366
+ 14.75 /  60: -0.185 -1.402
+ 15    /  61:  0.000 -1.414
+ 15.25 /  62:  0.185 -1.402
+ 15.5  /  63:  0.366 -1.366
+ 15.75 /  64:  0.541 -1.307
+ 16    /  65:  0.707 -1.225
+ 16.25 /  66:  0.861 -1.122
+ 16.5  /  67:  1.000 -1.000
+ 16.75 /  68:  1.122 -0.861
+ 17    /  69:  1.225 -0.707
+ 17.25 /  70:  1.307 -0.541
+ 17.5  /  71:  1.366 -0.366
+ 17.75 /  72:  1.402 -0.185
+ 18    /  73:  1.414  0.000
+ 18.25 /  74:  1.402  0.185
+ 18.5  /  75:  1.366  0.366
+ 18.75 /  76:  1.307  0.541
+ 19    /  77:  1.225  0.707
+ 19.25 /  78:  1.122  0.861
+ 19.5  /  79:  1.000  1.000
+ 19.75 /  80:  0.861  1.122
+ 20    /  81:  0.707  1.225
+ 20.25 /  82:  0.541  1.307
+ 20.5  /  83:  0.366  1.366
+ 20.75 /  84:  0.185  1.402
+ 21    /  85:  0.000  1.414
+ 21.25 /  86: -0.185  1.402
+ 21.5  /  87: -0.366  1.366
+ 21.75 /  88: -0.541  1.307
+ 22    /  89: -0.707  1.225
+ 22.25 /  90: -0.861  1.122
+ 22.5  /  91: -1.000  1.000
+ 22.75 /  92: -1.122  0.861
+ 23    /  93: -1.225  0.707
+ 23.25 /  94: -1.307  0.541
+ 23.5  /  95: -1.366  0.366
+ 23.75 /  96: -1.402  0.185
+ 24    /  97: -1.414  0.000
+ 24.25 /  98: -1.402 -0.185
+ 24.5  /  99: -1.366 -0.366
+ 24.75 / 100: -1.307 -0.541
+ 25    / 101: -1.225 -0.707
+ 25.25 / 102: -1.122 -0.861
+ 25.5  / 103: -1.000 -1.000
+ 25.75 / 104: -0.861 -1.122
+ 26    / 105: -0.707 -1.225
+ 26.25 / 106: -0.541 -1.307
+ 26.5  / 107: -0.366 -1.366
+ 26.75 / 108: -0.185 -1.402
+ 27    / 109:  0.000 -1.414
+ 27.25 / 110:  0.185 -1.402
+ 27.5  / 111:  0.366 -1.366
+ 27.75 / 112:  0.541 -1.307
+ 28    / 113:  0.707 -1.225
+ 28.25 / 114:  0.861 -1.122
+ 28.5  / 115:  1.000 -1.000
+ 28.75 / 116:  1.122 -0.861
+ 29    / 117:  1.225 -0.707
+ 29.25 / 118:  1.307 -0.541
+ 29.5  / 119:  1.366 -0.366
+ 29.75 / 120:  1.402 -0.185
+ 30    / 121:  1.414  0.000
+ 30.25 / 122:  1.402  0.185
+ 30.5  / 123:  1.366  0.366
+ 30.75 / 124:  1.307  0.541
+ 31    / 125:  1.225  0.707
+ 31.25 / 126:  1.122  0.861
+ 31.5  / 127:  1.000  1.000
+ 31.75 / 128:  0.861  1.122
+ 32    / 129:  0.707  1.225
+ 32.25 / 130:  0.541  1.307
+ 32.5  / 131:  0.366  1.366
+ 32.75 / 132:  0.185  1.402
+ 33    / 133:  0.000  1.414
+ 33.25 / 134: -0.185  1.402
+ 33.5  / 135: -0.366  1.366
+ 33.75 / 136: -0.541  1.307
+ 34    / 137: -0.707  1.225
+ 34.25 / 138: -0.861  1.122
+ 34.5  / 139: -1.000  1.000
+ 34.75 / 140: -1.122  0.861
+ 35    / 141: -1.225  0.707
+ 35.25 / 142: -1.307  0.541
+ 35.5  / 143: -1.366  0.366
+ 35.75 / 144: -1.402  0.185
+ 36    / 145: -1.414  0.000
+ 36.25 / 146: -1.402 -0.185
+ 36.5  / 147: -1.366 -0.366
+ 36.75 / 148: -1.307 -0.541
+ 37    / 149: -1.225 -0.707
+ 37.25 / 150: -1.122 -0.861
+ 37.5  / 151: -1.000 -1.000
+ 37.75 / 152: -0.861 -1.122
+ 38    / 153: -0.707 -1.225
+ 38.25 / 154: -0.541 -1.307
+ 38.5  / 155: -0.366 -1.366
+ 38.75 / 156: -0.185 -1.402
+ 39    / 157:  0.000 -1.414
+ 39.25 / 158:  0.185 -1.402
+ 39.5  / 159:  0.366 -1.366
+ 39.75 / 160:  0.541 -1.307
+ 40    / 161:  0.707 -1.225
+ 40.25 / 162:  0.861 -1.122
+ 40.5  / 163:  1.000 -1.000
+ 40.75 / 164:  1.122 -0.861
+ 41    / 165:  1.225 -0.707
+ 41.25 / 166:  1.307 -0.541
+ 41.5  / 167:  1.366 -0.366
+ 41.75 / 168:  1.402 -0.185
+ 42    / 169:  1.414  0.000
+ 42.25 / 170:  1.402  0.185
+ 42.5  / 171:  1.366  0.366
+ 42.75 / 172:  1.307  0.541
+ 43    / 173:  1.225  0.707
+ 43.25 / 174:  1.122  0.861
+ 43.5  / 175:  1.000  1.000
+ 43.75 / 176:  0.861  1.122
+ 44    / 177:  0.707  1.225
+ 44.25 / 178:  0.541  1.307
+ 44.5  / 179:  0.366  1.366
+ 44.75 / 180:  0.185  1.402
+ 45    / 181:  0.000  1.414
+ 45.25 / 182: -0.185  1.402
+ 45.5  / 183: -0.366  1.366
+ 45.75 / 184: -0.541  1.307
+ 46    / 185: -0.707  1.225
+ 46.25 / 186: -0.861  1.122
+ 46.5  / 187: -1.000  1.000
+ 46.75 / 188: -1.122  0.861
+ 47    / 189: -1.225  0.707
+ 47.25 / 190: -1.307  0.541
+ 47.5  / 191: -1.366  0.366
+ 47.75 / 192: -1.402  0.185
+ 48    / 193: -1.414  0.000
+ 48.25 / 194: -1.402 -0.185
+ 48.5  / 195: -1.366 -0.366
+ 48.75 / 196: -1.307 -0.541
+ 49    / 197: -1.225 -0.707
+ 49.25 / 198: -1.122 -0.861
+ 49.5  / 199: -1.000 -1.000
+ 49.75 / 200: -0.861 -1.122
+ 50    / 201: -0.707 -1.225
+ 50.25 / 202: -0.541 -1.307
+ 50.5  / 203: -0.366 -1.366
+ 50.75 / 204: -0.185 -1.402
+ 51    / 205:  0.000 -1.414
+ 51.25 / 206:  0.185 -1.402
+ 51.5  / 207:  0.366 -1.366
+ 51.75 / 208:  0.541 -1.307
+ 52    / 209:  0.707 -1.225
+ 52.25 / 210:  0.861 -1.122
+ 52.5  / 211:  1.000 -1.000
+ 52.75 / 212:  1.122 -0.861
+ 53    / 213:  1.225 -0.707
+ 53.25 / 214:  1.307 -0.541
+ 53.5  / 215:  1.366 -0.366
+ 53.75 / 216:  1.402 -0.185
+ 54    / 217:  1.414  0.000
+ 54.25 / 218:  1.402  0.185
+ 54.5  / 219:  1.366  0.366
+ 54.75 / 220:  1.307  0.541
+ 55    / 221:  1.225  0.707
+ 55.25 / 222:  1.122  0.861
+ 55.5  / 223:  1.000  1.000
+ 55.75 / 224:  0.861  1.122
+ 56    / 225:  0.707  1.225
+ 56.25 / 226:  0.541  1.307
+ 56.5  / 227:  0.366  1.366
+ 56.75 / 228:  0.185  1.402
+ 57    / 229:  0.000  1.414
+ 57.25 / 230: -0.185  1.402
+ 57.5  / 231: -0.366  1.366
+ 57.75 / 232: -0.541  1.307
+ 58    / 233: -0.707  1.225
+ 58.25 / 234: -0.861  1.122
+ 58.5  / 235: -1.000  1.000
+ 58.75 / 236: -1.122  0.861
+ 59    / 237: -1.225  0.707
+ 59.25 / 238: -1.307  0.541
+ 59.5  / 239: -1.366  0.366
+ 59.75 / 240: -1.402  0.185
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1: -0.7071  0.0000    ....
+ 2   / 2:  0.0000 -0.7071    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1: -1.414  0.000   ....
+ 0.25  /   2: -1.402 -0.185   ....
+ 0.5   /   3: -1.366 -0.366   ....
+ 0.75  /   4: -1.307 -0.541   ....
+ 1     /   5: -1.225 -0.707   ....
+ 1.25  /   6: -1.122 -0.861   ....
+ 1.5   /   7: -1.000 -1.000   ....
+ 1.75  /   8: -0.861 -1.122   ....
+ 2     /   9: -0.707 -1.225   ....
+ 2.25  /  10: -0.541 -1.307   ....
+ 2.5   /  11: -0.366 -1.366   ....
+ 2.75  /  12: -0.185 -1.402   ....
+ 3     /  13:  0.000 -1.414   ....
+ 3.25  /  14:  0.185 -1.402   ....
+ 3.5   /  15:  0.366 -1.366   ....
+ 3.75  /  16:  0.541 -1.307   ....
+ 4     /  17:  0.707 -1.225   ....
+ 4.25  /  18:  0.861 -1.122   ....
+ 4.5   /  19:  1.000 -1.000   ....
+ 4.75  /  20:  1.122 -0.861   ....
+ 5     /  21:  1.225 -0.707   ....
+ 5.25  /  22:  1.307 -0.541   ....
+ 5.5   /  23:  1.366 -0.366   ....
+ 5.75  /  24:  1.402 -0.185   ....
+ 6     /  25:  1.414  0.000   ....
+ 6.25  /  26:  1.402  0.185   ....
+ 6.5   /  27:  1.366  0.366   ....
+ 6.75  /  28:  1.307  0.541   ....
+ 7     /  29:  1.225  0.707   ....
+ 7.25  /  30:  1.122  0.861   ....
+ 7.5   /  31:  1.000  1.000   ....
+ 7.75  /  32:  0.861  1.122   ....
+ 8     /  33:  0.707  1.225   ....
+ 8.25  /  34:  0.541  1.307   ....
+ 8.5   /  35:  0.366  1.366   ....
+ 8.75  /  36:  0.185  1.402   ....
+ 9     /  37:  0.000  1.414   ....
+ 9.25  /  38: -0.185  1.402   ....
+ 9.5   /  39: -0.366  1.366   ....
+ 9.75  /  40: -0.541  1.307   ....
+ 10    /  41: -0.707  1.225   ....
+ 10.25 /  42: -0.861  1.122   ....
+ 10.5  /  43: -1.000  1.000   ....
+ 10.75 /  44: -1.122  0.861   ....
+ 11    /  45: -1.225  0.707   ....
+ 11.25 /  46: -1.307  0.541   ....
+ 11.5  /  47: -1.366  0.366   ....
+ 11.75 /  48: -1.402  0.185   ....
+ 12    /  49: -1.414  0.000   ....
+ 12.25 /  50: -1.402 -0.185   ....
+ 12.5  /  51: -1.366 -0.366   ....
+ 12.75 /  52: -1.307 -0.541   ....
+ 13    /  53: -1.225 -0.707   ....
+ 13.25 /  54: -1.122 -0.861   ....
+ 13.5  /  55: -1.000 -1.000   ....
+ 13.75 /  56: -0.861 -1.122   ....
+ 14    /  57: -0.707 -1.225   ....
+ 14.25 /  58: -0.541 -1.307   ....
+ 14.5  /  59: -0.366 -1.366   ....
+ 14.75 /  60: -0.185 -1.402   ....
+ 15    /  61:  0.000 -1.414   ....
+ 15.25 /  62:  0.185 -1.402   ....
+ 15.5  /  63:  0.366 -1.366   ....
+ 15.75 /  64:  0.541 -1.307   ....
+ 16    /  65:  0.707 -1.225   ....
+ 16.25 /  66:  0.861 -1.122   ....
+ 16.5  /  67:  1.000 -1.000   ....
+ 16.75 /  68:  1.122 -0.861   ....
+ 17    /  69:  1.225 -0.707   ....
+ 17.25 /  70:  1.307 -0.541   ....
+ 17.5  /  71:  1.366 -0.366   ....
+ 17.75 /  72:  1.402 -0.185   ....
+ 18    /  73:  1.414  0.000   ....
+ 18.25 /  74:  1.402  0.185   ....
+ 18.5  /  75:  1.366  0.366   ....
+ 18.75 /  76:  1.307  0.541   ....
+ 19    /  77:  1.225  0.707   ....
+ 19.25 /  78:  1.122  0.861   ....
+ 19.5  /  79:  1.000  1.000   ....
+ 19.75 /  80:  0.861  1.122   ....
+ 20    /  81:  0.707  1.225   ....
+ 20.25 /  82:  0.541  1.307   ....
+ 20.5  /  83:  0.366  1.366   ....
+ 20.75 /  84:  0.185  1.402   ....
+ 21    /  85:  0.000  1.414   ....
+ 21.25 /  86: -0.185  1.402   ....
+ 21.5  /  87: -0.366  1.366   ....
+ 21.75 /  88: -0.541  1.307   ....
+ 22    /  89: -0.707  1.225   ....
+ 22.25 /  90: -0.861  1.122   ....
+ 22.5  /  91: -1.000  1.000   ....
+ 22.75 /  92: -1.122  0.861   ....
+ 23    /  93: -1.225  0.707   ....
+ 23.25 /  94: -1.307  0.541   ....
+ 23.5  /  95: -1.366  0.366   ....
+ 23.75 /  96: -1.402  0.185   ....
+ 24    /  97: -1.414  0.000   ....
+ 24.25 /  98: -1.402 -0.185   ....
+ 24.5  /  99: -1.366 -0.366   ....
+ 24.75 / 100: -1.307 -0.541   ....
+ 25    / 101: -1.225 -0.707   ....
+ 25.25 / 102: -1.122 -0.861   ....
+ 25.5  / 103: -1.000 -1.000   ....
+ 25.75 / 104: -0.861 -1.122   ....
+ 26    / 105: -0.707 -1.225   ....
+ 26.25 / 106: -0.541 -1.307   ....
+ 26.5  / 107: -0.366 -1.366   ....
+ 26.75 / 108: -0.185 -1.402   ....
+ 27    / 109:  0.000 -1.414   ....
+ 27.25 / 110:  0.185 -1.402   ....
+ 27.5  / 111:  0.366 -1.366   ....
+ 27.75 / 112:  0.541 -1.307   ....
+ 28    / 113:  0.707 -1.225   ....
+ 28.25 / 114:  0.861 -1.122   ....
+ 28.5  / 115:  1.000 -1.000   ....
+ 28.75 / 116:  1.122 -0.861   ....
+ 29    / 117:  1.225 -0.707   ....
+ 29.25 / 118:  1.307 -0.541   ....
+ 29.5  / 119:  1.366 -0.366   ....
+ 29.75 / 120:  1.402 -0.185   ....
+ 30    / 121:  1.414  0.000   ....
+ 30.25 / 122:  1.402  0.185   ....
+ 30.5  / 123:  1.366  0.366   ....
+ 30.75 / 124:  1.307  0.541   ....
+ 31    / 125:  1.225  0.707   ....
+ 31.25 / 126:  1.122  0.861   ....
+ 31.5  / 127:  1.000  1.000   ....
+ 31.75 / 128:  0.861  1.122   ....
+ 32    / 129:  0.707  1.225   ....
+ 32.25 / 130:  0.541  1.307   ....
+ 32.5  / 131:  0.366  1.366   ....
+ 32.75 / 132:  0.185  1.402   ....
+ 33    / 133:  0.000  1.414   ....
+ 33.25 / 134: -0.185  1.402   ....
+ 33.5  / 135: -0.366  1.366   ....
+ 33.75 / 136: -0.541  1.307   ....
+ 34    / 137: -0.707  1.225   ....
+ 34.25 / 138: -0.861  1.122   ....
+ 34.5  / 139: -1.000  1.000   ....
+ 34.75 / 140: -1.122  0.861   ....
+ 35    / 141: -1.225  0.707   ....
+ 35.25 / 142: -1.307  0.541   ....
+ 35.5  / 143: -1.366  0.366   ....
+ 35.75 / 144: -1.402  0.185   ....
+ 36    / 145: -1.414  0.000   ....
+ 36.25 / 146: -1.402 -0.185   ....
+ 36.5  / 147: -1.366 -0.366   ....
+ 36.75 / 148: -1.307 -0.541   ....
+ 37    / 149: -1.225 -0.707   ....
+ 37.25 / 150: -1.122 -0.861   ....
+ 37.5  / 151: -1.000 -1.000   ....
+ 37.75 / 152: -0.861 -1.122   ....
+ 38    / 153: -0.707 -1.225   ....
+ 38.25 / 154: -0.541 -1.307   ....
+ 38.5  / 155: -0.366 -1.366   ....
+ 38.75 / 156: -0.185 -1.402   ....
+ 39    / 157:  0.000 -1.414   ....
+ 39.25 / 158:  0.185 -1.402   ....
+ 39.5  / 159:  0.366 -1.366   ....
+ 39.75 / 160:  0.541 -1.307   ....
+ 40    / 161:  0.707 -1.225   ....
+ 40.25 / 162:  0.861 -1.122   ....
+ 40.5  / 163:  1.000 -1.000   ....
+ 40.75 / 164:  1.122 -0.861   ....
+ 41    / 165:  1.225 -0.707   ....
+ 41.25 / 166:  1.307 -0.541   ....
+ 41.5  / 167:  1.366 -0.366   ....
+ 41.75 / 168:  1.402 -0.185   ....
+ 42    / 169:  1.414  0.000   ....
+ 42.25 / 170:  1.402  0.185   ....
+ 42.5  / 171:  1.366  0.366   ....
+ 42.75 / 172:  1.307  0.541   ....
+ 43    / 173:  1.225  0.707   ....
+ 43.25 / 174:  1.122  0.861   ....
+ 43.5  / 175:  1.000  1.000   ....
+ 43.75 / 176:  0.861  1.122   ....
+ 44    / 177:  0.707  1.225   ....
+ 44.25 / 178:  0.541  1.307   ....
+ 44.5  / 179:  0.366  1.366   ....
+ 44.75 / 180:  0.185  1.402   ....
+ 45    / 181:  0.000  1.414   ....
+ 45.25 / 182: -0.185  1.402   ....
+ 45.5  / 183: -0.366  1.366   ....
+ 45.75 / 184: -0.541  1.307   ....
+ 46    / 185: -0.707  1.225   ....
+ 46.25 / 186: -0.861  1.122   ....
+ 46.5  / 187: -1.000  1.000   ....
+ 46.75 / 188: -1.122  0.861   ....
+ 47    / 189: -1.225  0.707   ....
+ 47.25 / 190: -1.307  0.541   ....
+ 47.5  / 191: -1.366  0.366   ....
+ 47.75 / 192: -1.402  0.185   ....
+ 48    / 193: -1.414  0.000   ....
+ 48.25 / 194: -1.402 -0.185   ....
+ 48.5  / 195: -1.366 -0.366   ....
+ 48.75 / 196: -1.307 -0.541   ....
+ 49    / 197: -1.225 -0.707   ....
+ 49.25 / 198: -1.122 -0.861   ....
+ 49.5  / 199: -1.000 -1.000   ....
+ 49.75 / 200: -0.861 -1.122   ....
+ 50    / 201: -0.707 -1.225   ....
+ 50.25 / 202: -0.541 -1.307   ....
+ 50.5  / 203: -0.366 -1.366   ....
+ 50.75 / 204: -0.185 -1.402   ....
+ 51    / 205:  0.000 -1.414   ....
+ 51.25 / 206:  0.185 -1.402   ....
+ 51.5  / 207:  0.366 -1.366   ....
+ 51.75 / 208:  0.541 -1.307   ....
+ 52    / 209:  0.707 -1.225   ....
+ 52.25 / 210:  0.861 -1.122   ....
+ 52.5  / 211:  1.000 -1.000   ....
+ 52.75 / 212:  1.122 -0.861   ....
+ 53    / 213:  1.225 -0.707   ....
+ 53.25 / 214:  1.307 -0.541   ....
+ 53.5  / 215:  1.366 -0.366   ....
+ 53.75 / 216:  1.402 -0.185   ....
+ 54    / 217:  1.414  0.000   ....
+ 54.25 / 218:  1.402  0.185   ....
+ 54.5  / 219:  1.366  0.366   ....
+ 54.75 / 220:  1.307  0.541   ....
+ 55    / 221:  1.225  0.707   ....
+ 55.25 / 222:  1.122  0.861   ....
+ 55.5  / 223:  1.000  1.000   ....
+ 55.75 / 224:  0.861  1.122   ....
+ 56    / 225:  0.707  1.225   ....
+ 56.25 / 226:  0.541  1.307   ....
+ 56.5  / 227:  0.366  1.366   ....
+ 56.75 / 228:  0.185  1.402   ....
+ 57    / 229:  0.000  1.414   ....
+ 57.25 / 230: -0.185  1.402   ....
+ 57.5  / 231: -0.366  1.366   ....
+ 57.75 / 232: -0.541  1.307   ....
+ 58    / 233: -0.707  1.225   ....
+ 58.25 / 234: -0.861  1.122   ....
+ 58.5  / 235: -1.000  1.000   ....
+ 58.75 / 236: -1.122  0.861   ....
+ 59    / 237: -1.225  0.707   ....
+ 59.25 / 238: -1.307  0.541   ....
+ 59.5  / 239: -1.366  0.366   ....
+ 59.75 / 240: -1.402  0.185   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple2
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1: -0.3534 -0.0087
+ 2   / 2: -0.0087  0.3534
+ ---- L:2 T:   2
+ 1   / 1:  0.0087 -0.3534
+ 2   / 2: -0.3534 -0.0087
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1: -1.414  0.035
+ 0.1   /   2: -1.410 -0.113
+ 0.2   /   3: -1.390 -0.260
+ 0.3   /   4: -1.355 -0.404
+ 0.4   /   5: -1.306 -0.543
+ 0.5   /   6: -1.242 -0.677
+ 0.6   /   7: -1.164 -0.803
+ 0.7   /   8: -1.074 -0.920
+ 0.8   /   9: -0.972 -1.027
+ 0.9   /  10: -0.859 -1.123
+ 1     /  11: -0.737 -1.207
+ 1.1   /  12: -0.607 -1.277
+ 1.2   /  13: -0.470 -1.334
+ 1.3   /  14: -0.328 -1.376
+ 1.4   /  15: -0.182 -1.402
+ 1.5   /  16: -0.035 -1.414
+ 1.6   /  17:  0.113 -1.410
+ 1.7   /  18:  0.260 -1.390
+ 1.8   /  19:  0.404 -1.355
+ 1.9   /  20:  0.543 -1.306
+ 2     /  21:  0.677 -1.242
+ 2.1   /  22:  0.803 -1.164
+ 2.2   /  23:  0.920 -1.074
+ 2.3   /  24:  1.027 -0.972
+ 2.4   /  25:  1.123 -0.859
+ 2.5   /  26:  1.207 -0.737
+ 2.6   /  27:  1.277 -0.607
+ 2.7   /  28:  1.334 -0.470
+ 2.8   /  29:  1.376 -0.328
+ 2.9   /  30:  1.402 -0.182
+ 3     /  31:  1.414 -0.035
+ 3.1   /  32:  1.410  0.113
+ 3.2   /  33:  1.390  0.260
+ 3.3   /  34:  1.355  0.404
+ 3.4   /  35:  1.306  0.543
+ 3.5   /  36:  1.242  0.677
+ 3.6   /  37:  1.164  0.803
+ 3.7   /  38:  1.074  0.920
+ 3.8   /  39:  0.972  1.027
+ 3.9   /  40:  0.859  1.123
+ 4     /  41:  0.737  1.207
+ 4.1   /  42:  0.607  1.277
+ 4.2   /  43:  0.470  1.334
+ 4.3   /  44:  0.328  1.376
+ 4.4   /  45:  0.182  1.402
+ 4.5   /  46:  0.035  1.414
+ 4.6   /  47: -0.113  1.410
+ 4.7   /  48: -0.260  1.390
+ 4.8   /  49: -0.404  1.355
+ 4.9   /  50: -0.543  1.306
+ 5     /  51: -0.677  1.242
+ 5.1   /  52: -0.803  1.164
+ 5.2   /  53: -0.920  1.074
+ 5.3   /  54: -1.027  0.972
+ 5.4   /  55: -1.123  0.859
+ 5.5   /  56: -1.207  0.737
+ 5.6   /  57: -1.277  0.607
+ 5.7   /  58: -1.334  0.470
+ 5.8   /  59: -1.376  0.328
+ 5.9   /  60: -1.402  0.182
+ 6     /  61: -1.414  0.035
+ 6.1   /  62: -1.410 -0.113
+ 6.2   /  63: -1.390 -0.260
+ 6.3   /  64: -1.355 -0.404
+ 6.4   /  65: -1.306 -0.543
+ 6.5   /  66: -1.242 -0.677
+ 6.6   /  67: -1.164 -0.803
+ 6.7   /  68: -1.074 -0.920
+ 6.8   /  69: -0.972 -1.027
+ 6.9   /  70: -0.859 -1.123
+ 7     /  71: -0.737 -1.207
+ 7.1   /  72: -0.607 -1.277
+ 7.2   /  73: -0.470 -1.334
+ 7.3   /  74: -0.328 -1.376
+ 7.4   /  75: -0.182 -1.402
+ 7.5   /  76: -0.035 -1.414
+ 7.6   /  77:  0.113 -1.410
+ 7.7   /  78:  0.260 -1.390
+ 7.8   /  79:  0.404 -1.355
+ 7.9   /  80:  0.543 -1.306
+ 8     /  81:  0.677 -1.242
+ 8.1   /  82:  0.803 -1.164
+ 8.2   /  83:  0.920 -1.074
+ 8.3   /  84:  1.027 -0.972
+ 8.4   /  85:  1.123 -0.859
+ 8.5   /  86:  1.207 -0.737
+ 8.6   /  87:  1.277 -0.607
+ 8.7   /  88:  1.334 -0.470
+ 8.8   /  89:  1.376 -0.328
+ 8.9   /  90:  1.402 -0.182
+ 9     /  91:  1.414 -0.035
+ 9.1   /  92:  1.410  0.113
+ 9.2   /  93:  1.390  0.260
+ 9.3   /  94:  1.355  0.404
+ 9.4   /  95:  1.306  0.543
+ 9.5   /  96:  1.242  0.677
+ 9.6   /  97:  1.164  0.803
+ 9.7   /  98:  1.074  0.920
+ 9.8   /  99:  0.972  1.027
+ 9.9   / 100:  0.859  1.123
+ 10    / 101:  0.737  1.207
+ 10.1  / 102:  0.607  1.277
+ 10.2  / 103:  0.470  1.334
+ 10.3  / 104:  0.328  1.376
+ 10.4  / 105:  0.182  1.402
+ 10.5  / 106:  0.035  1.414
+ 10.6  / 107: -0.113  1.410
+ 10.7  / 108: -0.260  1.390
+ 10.8  / 109: -0.404  1.355
+ 10.9  / 110: -0.543  1.306
+ 11    / 111: -0.677  1.242
+ 11.1  / 112: -0.803  1.164
+ 11.2  / 113: -0.920  1.074
+ 11.3  / 114: -1.027  0.972
+ 11.4  / 115: -1.123  0.859
+ 11.5  / 116: -1.207  0.737
+ 11.6  / 117: -1.277  0.607
+ 11.7  / 118: -1.334  0.470
+ 11.8  / 119: -1.376  0.328
+ 11.9  / 120: -1.402  0.182
+ 12    / 121: -1.414  0.035
+ 12.1  / 122: -1.410 -0.113
+ 12.2  / 123: -1.390 -0.260
+ 12.3  / 124: -1.355 -0.404
+ 12.4  / 125: -1.306 -0.543
+ 12.5  / 126: -1.242 -0.677
+ 12.6  / 127: -1.164 -0.803
+ 12.7  / 128: -1.074 -0.920
+ 12.8  / 129: -0.972 -1.027
+ 12.9  / 130: -0.859 -1.123
+ 13    / 131: -0.737 -1.207
+ 13.1  / 132: -0.607 -1.277
+ 13.2  / 133: -0.470 -1.334
+ 13.3  / 134: -0.328 -1.376
+ 13.4  / 135: -0.182 -1.402
+ 13.5  / 136: -0.035 -1.414
+ 13.6  / 137:  0.113 -1.410
+ 13.7  / 138:  0.260 -1.390
+ 13.8  / 139:  0.404 -1.355
+ 13.9  / 140:  0.543 -1.306
+ 14    / 141:  0.677 -1.242
+ 14.1  / 142:  0.803 -1.164
+ 14.2  / 143:  0.920 -1.074
+ 14.3  / 144:  1.027 -0.972
+ 14.4  / 145:  1.123 -0.859
+ 14.5  / 146:  1.207 -0.737
+ 14.6  / 147:  1.277 -0.607
+ 14.7  / 148:  1.334 -0.470
+ 14.8  / 149:  1.376 -0.328
+ 14.9  / 150:  1.402 -0.182
+ 15    / 151:  1.414 -0.035
+ 15.1  / 152:  1.410  0.113
+ 15.2  / 153:  1.390  0.260
+ 15.3  / 154:  1.355  0.404
+ 15.4  / 155:  1.306  0.543
+ 15.5  / 156:  1.242  0.677
+ 15.6  / 157:  1.164  0.803
+ 15.7  / 158:  1.074  0.920
+ 15.8  / 159:  0.972  1.027
+ 15.9  / 160:  0.859  1.123
+ 16    / 161:  0.737  1.207
+ 16.1  / 162:  0.607  1.277
+ 16.2  / 163:  0.470  1.334
+ 16.3  / 164:  0.328  1.376
+ 16.4  / 165:  0.182  1.402
+ 16.5  / 166:  0.035  1.414
+ 16.6  / 167: -0.113  1.410
+ 16.7  / 168: -0.260  1.390
+ 16.8  / 169: -0.404  1.355
+ 16.9  / 170: -0.543  1.306
+ 17    / 171: -0.677  1.242
+ 17.1  / 172: -0.803  1.164
+ 17.2  / 173: -0.920  1.074
+ 17.3  / 174: -1.027  0.972
+ 17.4  / 175: -1.123  0.859
+ 17.5  / 176: -1.207  0.737
+ 17.6  / 177: -1.277  0.607
+ 17.7  / 178: -1.334  0.470
+ 17.8  / 179: -1.376  0.328
+ 17.9  / 180: -1.402  0.182
+ 18    / 181: -1.414  0.035
+ 18.1  / 182: -1.410 -0.113
+ 18.2  / 183: -1.390 -0.260
+ 18.3  / 184: -1.355 -0.404
+ 18.4  / 185: -1.306 -0.543
+ 18.5  / 186: -1.242 -0.677
+ 18.6  / 187: -1.164 -0.803
+ 18.7  / 188: -1.074 -0.920
+ 18.8  / 189: -0.972 -1.027
+ 18.9  / 190: -0.859 -1.123
+ 19    / 191: -0.737 -1.207
+ 19.1  / 192: -0.607 -1.277
+ 19.2  / 193: -0.470 -1.334
+ 19.3  / 194: -0.328 -1.376
+ 19.4  / 195: -0.182 -1.402
+ 19.5  / 196: -0.035 -1.414
+ 19.6  / 197:  0.113 -1.410
+ 19.7  / 198:  0.260 -1.390
+ 19.8  / 199:  0.404 -1.355
+ 19.9  / 200:  0.543 -1.306
+ 20    / 201:  0.677 -1.242
+ 20.1  / 202:  0.803 -1.164
+ 20.2  / 203:  0.920 -1.074
+ 20.3  / 204:  1.027 -0.972
+ 20.4  / 205:  1.123 -0.859
+ 20.5  / 206:  1.207 -0.737
+ 20.6  / 207:  1.277 -0.607
+ 20.7  / 208:  1.334 -0.470
+ 20.8  / 209:  1.376 -0.328
+ 20.9  / 210:  1.402 -0.182
+ 21    / 211:  1.414 -0.035
+ 21.1  / 212:  1.410  0.113
+ 21.2  / 213:  1.390  0.260
+ 21.3  / 214:  1.355  0.404
+ 21.4  / 215:  1.306  0.543
+ 21.5  / 216:  1.242  0.677
+ 21.6  / 217:  1.164  0.803
+ 21.7  / 218:  1.074  0.920
+ 21.8  / 219:  0.972  1.027
+ 21.9  / 220:  0.859  1.123
+ 22    / 221:  0.737  1.207
+ 22.1  / 222:  0.607  1.277
+ 22.2  / 223:  0.470  1.334
+ 22.3  / 224:  0.328  1.376
+ 22.4  / 225:  0.182  1.402
+ 22.5  / 226:  0.035  1.414
+ 22.6  / 227: -0.113  1.410
+ 22.7  / 228: -0.260  1.390
+ 22.8  / 229: -0.404  1.355
+ 22.9  / 230: -0.543  1.306
+ 23    / 231: -0.677  1.242
+ 23.1  / 232: -0.803  1.164
+ 23.2  / 233: -0.920  1.074
+ 23.3  / 234: -1.027  0.972
+ 23.4  / 235: -1.123  0.859
+ 23.5  / 236: -1.207  0.737
+ 23.6  / 237: -1.277  0.607
+ 23.7  / 238: -1.334  0.470
+ 23.8  / 239: -1.376  0.328
+ 23.9  / 240: -1.402  0.182
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+ 
+! 6D tests for Ferret v6.8
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate_6d
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_6d
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              4        6        8     
+              2        3        4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- M:3 E:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- M:4 E:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- M:3 E:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- M:4 E:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- M:3 E:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- M:4 E:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              5        7        9     
+              3        4        5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- M:4 E:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- M:5 E:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- M:4 E:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- M:5 E:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- M:4 E:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- M:5 E:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax_6d
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid G48
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.167N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+                6.17N  
+                50
+ 160.5W / 1:  3.70015
+ 159.5W / 2:  3.70015
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.833N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.00000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.00000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions_6d
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.0000
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+           3.0000   6.0000   9.0000  12.0000  15.0000
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          4.00000  5.00000  6.00000  7.00000  8.00000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000  0.00000  1.00000  2.00000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            1.000    8.000   27.000   64.000  125.000
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  0.00000  0.00000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.000000  0.000000  0.000000  0.000000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+             1         2         3         4         5      
+              1         2         3         4         5
+ ---- N:1 F:   1
+ N:1 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:2 F:   2
+ N:2 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:3 F:   3
+ N:3 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:4 F:   4
+ N:4 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:5 F:   5
+ N:5 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+             ....     ....     ....  4.00000  5.00000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  4.00000  5.00000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33300  0.33300  0.33300  4.00000 -9.00000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          3.00000  3.00000  3.00000  4.00000  5.00000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  3.00000  3.00000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          2.00000  1.00000  0.00000  1.00000  2.00000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            2.718    7.389   20.086   54.598  148.413
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.69315  1.09861  1.38629  1.60944
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.301030  0.477121  0.602060  0.698970
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.841471  0.909297  0.141120 -0.756802 -0.958924
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.47493
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.540302 -0.416147 -0.989992 -0.653644  0.283662
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.55741 -2.18504 -0.14255  1.15782 -3.38052
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333 -1.47493
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  0.00000  0.00000  0.00000  0.00000
+ 2   / 2:  1.57080  0.78540  0.46365  0.32175  0.24498
+ 3   / 3:  1.57080  1.10715  0.78540  0.58800  0.46365
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  0.00000  1.00000  2.00000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000     ....  1.00000  2.00000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000 -9.00000  1.00000  2.00000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.337575  0.723822  0.030403  0.849932  0.169352
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -0.26718  0.28276 -0.32292  1.21676 -0.30437
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+          EBOXLO   EBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+          FBOXLO   FBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_direction_fcns_6d
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+               C   M_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1   M_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+               C   N_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1   N_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+          TEMP    EX#2
+M / 1:  30.7500  34.7500
+M / 2:  31.7500  33.7500
+M / 3:  32.7500  32.7500
+M / 4:  33.7500  31.7500
+M / 5:  34.7500  30.7500
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+          TEMP    EX#2
+N / 1:  30.7500  31.3500
+N / 2:  30.9500  31.1500
+N / 3:  31.1500  30.9500
+N / 4:  31.3500  30.7500
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+                 A      A        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+                 B      B        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000  1.00000  0.00000  0.00000     ....     ....
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms_6d
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:120 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:114 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 00:00 (interpolated)
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE EX#1     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.3553  32.3552  32.5032  32.8652  33.3285
+ 1.17N / 45:  32.1766  32.1710  32.2834  32.5970  33.0244
+ 0.83N / 44:  32.0256  32.0016  32.0631  32.3109  32.6873
+ 0.5N  / 43:  31.9306  31.8902  31.8887  32.0374  32.3408
+ 0.17N / 42:  31.8944  31.8343  31.7825  31.8263  32.0336
+ 0.17S / 41:  31.9538  31.8657  31.7716  31.7285  31.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.3553  38.3552  38.5032  38.8652  39.3285
+ 1.17N / 45:  38.1766  38.1710  38.2834  38.5970  39.0244
+ 0.83N / 44:  38.0256  38.0016  38.0631  38.3109  38.6873
+ 0.5N  / 43:  37.9306  37.8902  37.8887  38.0374  38.3408
+ 0.17N / 42:  37.8944  37.8343  37.7825  37.8263  38.0336
+ 0.17S / 41:  37.9538  37.8657  37.7716  37.7285  37.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.7553  37.7552  37.9032  38.2652  38.7285
+ 1.17N / 45:  37.5766  37.5710  37.6834  37.9970  38.4244
+ 0.83N / 44:  37.4256  37.4016  37.4631  37.7109  38.0873
+ 0.5N  / 43:  37.3306  37.2902  37.2887  37.4374  37.7408
+ 0.17N / 42:  37.2944  37.2343  37.1825  37.2263  37.4336
+ 0.17S / 41:  37.3538  37.2657  37.1716  37.1285  37.2282
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.7553  43.7552  43.9032  44.2652  44.7285
+ 1.17N / 45:  43.5766  43.5710  43.6834  43.9970  44.4244
+ 0.83N / 44:  43.4256  43.4016  43.4631  43.7109  44.0873
+ 0.5N  / 43:  43.3306  43.2902  43.2887  43.4374  43.7408
+ 0.17N / 42:  43.2944  43.2343  43.1825  43.2263  43.4336
+ 0.17S / 41:  43.3538  43.2657  43.1716  43.1285  43.2282
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.3553  34.3552  34.5032  34.8652  35.3285
+ 1.17N / 45:  34.1766  34.1710  34.2834  34.5970  35.0244
+ 0.83N / 44:  34.0256  34.0016  34.0631  34.3109  34.6873
+ 0.5N  / 43:  33.9306  33.8902  33.8887  34.0374  34.3408
+ 0.17N / 42:  33.8944  33.8343  33.7825  33.8263  34.0336
+ 0.17S / 41:  33.9538  33.8657  33.7716  33.7285  33.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.3553  40.3552  40.5032  40.8652  41.3285
+ 1.17N / 45:  40.1766  40.1710  40.2834  40.5970  41.0244
+ 0.83N / 44:  40.0256  40.0016  40.0631  40.3109  40.6873
+ 0.5N  / 43:  39.9306  39.8902  39.8887  40.0374  40.3408
+ 0.17N / 42:  39.8944  39.8343  39.7825  39.8263  40.0336
+ 0.17S / 41:  39.9538  39.8657  39.7716  39.7285  39.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.0220  36.0219  36.1698  36.5318  36.9952
+ 1.17N / 45:  35.8433  35.8377  35.9501  36.2637  36.6910
+ 0.83N / 44:  35.6923  35.6682  35.7298  35.9776  36.3539
+ 0.5N  / 43:  35.5973  35.5568  35.5554  35.7040  36.0075
+ 0.17N / 42:  35.5610  35.5010  35.4491  35.4929  35.7003
+ 0.17S / 41:  35.6205  35.5323  35.4383  35.3952  35.4948
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.0220  42.0219  42.1698  42.5318  42.9952
+ 1.17N / 45:  41.8433  41.8377  41.9501  42.2637  42.6910
+ 0.83N / 44:  41.6923  41.6682  41.7298  41.9776  42.3539
+ 0.5N  / 43:  41.5973  41.5568  41.5554  41.7040  42.0075
+ 0.17N / 42:  41.5610  41.5010  41.4491  41.4929  41.7003
+ 0.17S / 41:  41.6205  41.5323  41.4383  41.3952  41.4948
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ reading TEMP     M:104 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 863  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M: 90 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 864  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 88 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 88 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 865  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 94 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 94 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 866  complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 78 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 80 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 867  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:106 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 868  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 869  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 870  complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 66 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  29593.5
+ 23-JAN-1982 00 /  3:     ....  29593.5
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  8878.05
+ 23-JAN-1982 00 /  3:     ....  8878.05
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:    213056.    355093.
+ 23-JAN-1982 00 /  3:  20028585.  33381003.
+ 27-JAN-1982 00 /  4:    213084.    355141.
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                            1.1          2.1     
+                            1            2
+ 15-JAN-1982 00 /  1:         ....         ....
+ 19-JAN-1982 00 /  2:         ....         ....
+ 23-JAN-1982 00 /  3:         ....  5.16988E-27
+ 27-JAN-1982 00 /  4:         ....         ....
+ 31-JAN-1982 00 /  5:         ....         ....
+ 04-FEB-1982 00 /  6:         ....         ....
+ 08-FEB-1982 00 /  7:         ....         ....
+ 12-FEB-1982 00 /  8:         ....         ....
+ 16-FEB-1982 00 /  9:         ....         ....
+ 20-FEB-1982 00 / 10:         ....         ....
+ 24-FEB-1982 00 / 11:         ....         ....
+ 28-FEB-1982 00 / 12:         ....         ....
+ 04-MAR-1982 00 / 13:         ....         ....
+ 08-MAR-1982 00 / 14:         ....         ....
+ 12-MAR-1982 00 / 15:         ....         ....
+ 16-MAR-1982 00 / 16:         ....         ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 64 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G092)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:     ....
+ 2.1 / 2:  2.50000
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G101)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MIN
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.00000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @SUM
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.05000
+ 2.1 / 2:  4.20000
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ -DELETE _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G096)
+    GRID (G096)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G106)           @MAX
+ eval    AFCST    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ regrid  AFCST    M: 46 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_aggregate_e
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M: 64 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M: 62 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M: 56 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M: 54 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   28.513   28.441   27.892   27.457   26.726   25.561     ....     ....     ....
+ 2   / 2:   85.539   85.323   83.676   82.370   80.177   76.683     ....     ....     ....
+ 3   / 3:   57.026   56.882   55.784   54.913   53.452   51.122     ....     ....     ....
+ 4   / 4:  114.051  113.765  111.568  109.826  106.903  102.245     ....     ....     ....
+cancel data fourfiles
+ -DELETE SST      M: 66 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M: 74 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ getgrid AIRT     C:  5 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G109)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M: 74 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:120 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   27.675   27.570   27.061   26.673   25.793   25.207     ....     ....     ....
+ 2   / 2:   86.539   86.323   84.676   83.370   81.177   77.683     ....     ....     ....
+ 3   / 3:   58.026   57.882   56.784   55.913   54.452   52.122     ....     ....     ....
+ 4   / 4:  115.051  114.765  112.568  110.826  107.903  103.245     ....     ....     ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+                 UWND     UWND     UWND      VWND     UWND
+59W    / -30:  2.20244  0.934329  2.20244  0.934329  1.56839
+57W    / -29:  2.26128  0.812758  2.26128  0.812758  1.53702
+55W    / -28:  1.99826  0.681776  1.99826  0.681776  1.34002
+53W    / -27:  1.93361  0.507158  1.93361  0.507158  1.22038
+51W    / -26:  1.64932  0.330430  1.64932  0.330430  0.98987
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+                 UWND     UWND      VWND     UWND     VWND
+59W    / -30:  2.20244  0.934329  0.934329  2.20244  1.56839
+57W    / -29:  2.26128  0.812758  0.812758  2.26128  1.53702
+55W    / -28:  1.99826  0.681776  0.681776  1.99826  1.34002
+53W    / -27:  1.93361  0.507158  0.507158  1.93361  1.22038
+51W    / -26:  1.64932  0.330430  0.330430  1.64932  0.98987
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_6d_lab_mode
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT21         PSXT1     PSYT1     PSZT2     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=28.84S:51.43N at AV4,D=1]
+ reading TAUX     M:106 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.274203
+ 23-AUG-1982 14 / 2: -0.236318
+ 29-AUG-1982 16 / 3: -0.198434
+ 04-SEP-1982 18 / 4: -0.160549
+ 10-SEP-1982 20 / 5: -0.122665
+ 16-SEP-1982 22 / 6: -0.104062
+ 23-SEP-1982 00 / 7: -0.104740
+ 29-SEP-1982 02 / 8: -0.105418
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=28.84S:51.43N at SM4,D=1]
+ reading TAUX     M: 94 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.649
+ 23-AUG-1982 14 / 2:  -89.328
+ 29-AUG-1982 16 / 3:  -75.007
+ 04-SEP-1982 18 / 4:  -60.686
+ 10-SEP-1982 20 / 5:  -46.365
+ 16-SEP-1982 22 / 6:  -39.333
+ 23-SEP-1982 00 / 7:  -39.590
+ 29-SEP-1982 02 / 8:  -39.847
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+ 
+ 
+! *********** v6.82 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn682_bug_fixes
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+! *********** v6.83 Additions ***********
+!  (was released as v6.84)
+ 
+GO bn_reset
+cancel mode verify
+GO bn683_bug_fixes
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.625140
+ 02-NOV-2011 07:55:36 /  2:  0.220931
+ 02-NOV-2011 07:56:36 /  3:  0.607368
+ 02-NOV-2011 07:57:36 /  4:  0.322594
+ 02-NOV-2011 07:58:36 /  5:  0.107545
+ 02-NOV-2011 07:59:36 /  6:  0.225720
+ 02-NOV-2011 08:00:36 /  7:  0.081070
+ 02-NOV-2011 08:01:36 /  8:  0.898013
+ 02-NOV-2011 08:02:36 /  9:  0.716275
+ 02-NOV-2011 08:03:36 / 10:  0.664871
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:      ....
+ 02-NOV-2011 07:54:31 / 114872:      ....
+ 02-NOV-2011 07:54:32 / 114873:      ....
+ 02-NOV-2011 07:54:33 / 114874:      ....
+ 02-NOV-2011 07:54:34 / 114875:      ....
+ 02-NOV-2011 07:54:35 / 114876:      ....
+ 02-NOV-2011 07:54:36 / 114877:  0.625140
+ 02-NOV-2011 07:54:37 / 114878:      ....
+ 02-NOV-2011 07:54:38 / 114879:      ....
+ 02-NOV-2011 07:54:39 / 114880:      ....
+ 02-NOV-2011 07:54:40 / 114881:      ....
+ 02-NOV-2011 07:54:41 / 114882:      ....
+ 02-NOV-2011 07:54:42 / 114883:      ....
+ 02-NOV-2011 07:54:43 / 114884:      ....
+ 02-NOV-2011 07:54:44 / 114885:      ....
+ 02-NOV-2011 07:54:45 / 114886:      ....
+ 02-NOV-2011 07:54:46 / 114887:      ....
+ 02-NOV-2011 07:54:47 / 114888:      ....
+ 02-NOV-2011 07:54:48 / 114889:      ....
+ 02-NOV-2011 07:54:49 / 114890:      ....
+ 02-NOV-2011 07:54:50 / 114891:      ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 179.9E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 179.9E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6966
+ 02-JAN-1994 12 / 2:  28.6361
+ 
+set mode/last upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_outtype
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ribbon_plot
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descr_4digit
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-1900 / 1:  28.36
+ 15-FEB-1900 / 2:  28.38
+ 18-MAR-1900 / 3:  28.00
+ 17-APR-1900 / 4:  27.99
+ 17-MAY-1900 / 5:  28.41
+ 17-JUN-1900 / 6:  28.23
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_outtype
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME13)               FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME13)               FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   17-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_nonmonotonic
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_mod
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+ 
+! *********** v6.85 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn685_bug_fixes
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294629927, -0.0415768591404557, 0.141480238197389 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double E410(TIME) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294629927, -0.0415768591404557, 0.141480238197389 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float E410(TIME) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON1</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dsg_e_x
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nco_append
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+	double DDAT_ORIG(ZAXIS_ORIG) ;
+		DDAT_ORIG:missing_value = -1.e+34 ;
+		DDAT_ORIG:_FillValue = -1.e+34 ;
+		DDAT_ORIG:long_name = "DDAT[GZ=ZAXIS_ORIG at ASN]" ;
+
+// global attributes:
+		:history = "Mon Mar 17 15:54:58 2014: ncks -h -A -h z1.nc append_to_this.nc\n",
+			"FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nobounds
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+		XIRREG:units = "meters" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:units = "meters" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_write_integer_att
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descriptor_mc
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-0000 / 1:  28.36
+ 15-FEB-0000 / 2:  28.38
+ 17-MAR-0000 / 3:  28.00
+ 16-APR-0000 / 4:  27.99
+ 16-MAY-0000 / 5:  28.41
+ 16-JUN-0000 / 6:  28.23
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 60W (interpolated)
+             LATITUDE : 10N (interpolated)
+ 17-MAR-0000 / 1:  26.70
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.39
+ 16-JUN-0000 / 4:  27.65
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_color_only
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vtree
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+ 
+ 
+! *********** v6.86 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn686_bug_fixes
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ribbon_by_val
+! err685_ribbon_by_val.jnl
+! 11/21/2013
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+ 
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ppl_palette
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+ 
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+ 
+pal  bluescale.spk
+use levitus_climatology; shade/k=1 temp
+ 
+pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+ 
+pal   default
+pattern   solid
+ 
+fill sst[l=@ave]
+pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+ 
+! restore defaults
+palette default
+pattern solid
+ 
+GO bn_reset
+cancel mode verify
+GO err685_show_grid_e
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+ 
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+sh grid /e gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       M     E                   EBOX      EBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+      11>  11                    1          10.5
+      12>  12                    1          11.5
+sh grid /f gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       N     F                   FBOX      FBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_lowercaseAxis
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+ 
+use lowercaseTime.nc
+sh dat
+     currently SET data sets:
+    1> ./lowercaseTime.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AA                                        ...       ...       ...       1:15      ...       ...
+ BB                                        ...       ...       ...       1:8       ...       ...
+ 
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+ 
+! All this was correct
+show axis uppercasetime
+ name       axis              # pts   start                end
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 8
+show grid bb
+    GRID GHC2
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+ normal    E
+ normal    F
+ 
+! This variable has axis time, lowercase in the file
+sh grid aa
+    GRID GHC1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME16    T                   15 r   1                    15
+ normal    E
+ normal    F
+set axis/t0=1-jan-2001/units=days time
+ 
+! showed no output
+show axis time
+ name       axis              # pts   start                end
+ TIME      TIME                 3 i   01-JAN-2001 00:00    04-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 4.5
+ 
+! The axis did get changed but is inconsistently listed in the
+! internal arrays that store axis info.
+ 
+list/L=1:5 aa
+             VARIABLE : AA
+             FILENAME : lowercaseTime.nc
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_redefine_uvar_att
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on,
+!   returned a runtime error.
+ 
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
+ 
+GO bn_reset
+cancel mode verify
+GO err685_use_no_extension
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+ 
+! The directory contains files with all three extensions
+sp ls duplicate.*
+duplicate.cdf
+duplicate.des
+duplicate.nc
+ 
+! The one that's used is .nc
+use duplicate
+sh dat
+     currently SET data sets:
+    1> ./duplicate.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:1       1:10      ...       1:3       ...       ...
+ 
+ 
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+ 
+! Specify a nonexistent file, no extension
+use nosuchfile
+ 
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+ 
+use snoopy.dat
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err685_samplexy
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error
+! sending sub-range of variable into samplexy
+ 
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+             VARIABLE : SAMPLEXY(SST[X=290:310,Y=0:20], LON, LAT)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  26.84  26.77  26.66
+ 15-FEB      / 2:  26.60  26.52  26.35
+ 17-MAR      / 3:  26.68  26.61  26.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_shade_set
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+ 
+can dat/all
+ 
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the
+! epression being SHADED, inside a SHADE/SET
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !GAVE A BLANK PLOT
+ 
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+ 
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+ !-> shade/title="DAYS" tseries*z[gz=1:5:1]
+ 
+can var/all; can mem
+can axis timax
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err686_individual_levels
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+ 
+use coads_climatology
+ 
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+ 
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+LEV_TEXT = "(10)(20)(30)(40)"
+LEV_MIN = "10"
+LEV_MAX = "40"
+LEV_NUM = "3"
+LEV_DEL = "10"
+ 
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
+LEV_TEXT = "(10)(15)(20)(25)(30)"
+LEV_MIN = "10"
+LEV_MAX = "30"
+LEV_NUM = "4"
+LEV_DEL = "5"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_symnames
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+ 
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+! SHOW
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+FERRET_TEMPERATURE_EQUILIBRATOR_MAX = "35"
+ 
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+ 
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+can sym *max
+ 
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "0"
+ 
+ 
+! bn_symbols had a line to
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567XXX = "6"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strdim
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+ 
+use strdimfile.nc
+ 
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+ 
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	ENSEMBLE = 3 ;
+	maxStrlen64 = 64 ;
+variables:
+	double ENSEMBLE(ENSEMBLE) ;
+		ENSEMBLE:long_name = "Ensemble of Realizations" ;
+		ENSEMBLE:axis = "E" ;
+		ENSEMBLE:point_spacing = "even" ;
+	char LABELS(ENSEMBLE, maxStrlen64) ;
+		LABELS:long_name = "Realizations" ;
+		LABELS:history = "From http://dunkel.pmel.noaa.gov:8930/thredds/dodsC/data/atmos3.ncml" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+ 
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_5 = 5 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char STRVAR(XAX1_3, STRING1_5) ;
+		STRVAR:long_name = "mystrings" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_single_colorlev
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when
+! single level is specified with a range of values
+ 
+use coads_climatology
+ 
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+ 
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+ 
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+ 
+ 
+ 
+! *********** v6.87 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn687_bug_fixes
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err686_long_list_varnames
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+ 
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+ 
+! The list was cut off after woa_land_marker.
+! Try to load a variable later than that in the list.
+ 
+list etopo2_depth
+             VARIABLE : ETOPO2_DEPTH
+             FILENAME : longvarnames.tsv
+             SUBSET   : 10 points (X)
+ 1    /  1: -97.00
+ 2    /  2: -97.00
+ 3    /  3: -97.00
+ 4    /  4: -97.00
+ 5    /  5: -97.00
+ 6    /  6: -97.00
+ 7    /  7: -97.00
+ 8    /  8: -99.00
+ 9    /  9: -99.00
+ 10   / 10: -99.00
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_faxis_label
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis
+! shouldn't automatically get it.
+ 
+! Define a variable with a Julian calendar axis, and an abstract F axis
+ 
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+ 
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! This label should be just F : 3
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "F : 3"
+ 
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "FORECAST : 03-JAN-2000 00:00:00 JULIAN"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bad_axis_bounds
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+ 
+use badbounds.nc
+show data
+     currently SET data sets:
+    1> ./badbounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MONTH_IRREG_BNDS
+                                           1:2       ...       ...       1:12      ...       ...
+       (invalid axis bounds)
+ TEMP2    TEMP[GT=MONTH_IRREG at ASN]         1:1       1:1       1:1       1:12      ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_enter_exit_GO
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+ 
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+ 
+set redirect/tee/journal
+go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ 
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+ !-> if 1 THEN GO bn_shortgo2
+! Enter_GO bn_shortgo2
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
+! Enter_GO bn_short.sub tvar ave
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+ 
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+ !-> LIST/nohead/norow tvar[t=-5:9 at ave]	! neg/pos t endpoints
+   2.000
+ 
+! Exit_GO
+! Exit_GO
+ 
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+ !-> repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+!-> REPEAT: L=1
+ !-> if 0 then go bn_shortgo
+ !-> def sym ok = 1
+!-> REPEAT: L=2
+ !-> if 1 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 2
+!-> REPEAT: L=3
+ !-> if 2 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 3
+ 
+cancel redirect
+ 
+ 
+!  *********** Always do a bn_reset  ***********
+!  *********** make sure things clean up well **
+GO bn_reset
+cancel mode verify
+ 
+! version 2.3 requires exit/command *sh* 3/92
+exit/command
+yes? ! bn_all_ef_shell.jnl
+yes? ! 5/05 *acm*
+yes? ! run bn_all_ef tests
+yes? 
+yes? GO bn_all_ef
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14
+ 	17-Mar-14 15:55     
+
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+ADD_9(A,B,C,D,E,F,G,H,I)
+    (demonstration function) adds 9 arguments
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+AVET(A)
+    (demonstration function) returns the time average
+    A: data to be averaged over the time axis
+show func pass_thru
+PASS_THRU(A)
+    (demonstration function) sets result equal to input
+    A: this arg is passed through
+show func sto*
+STORAGE(A)
+    sets result equal to input/10
+    A: input
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+list a
+             VARIABLE : ADD_9(A1,A2,A3,A1,A2,A3,A1,A2,A3)
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  263.6
+ 153E   / 67:  264.5
+ 155E   / 68:  264.2
+ 157E   / 69:  261.3
+ 159E   / 70:  260.9
+ 161E   / 71:  262.4
+ 163E   / 72:  264.0
+ 165E   / 73:  261.1
+ 167E   / 74:  260.9
+ 169E   / 75:  261.0
+ 171E   / 76:  259.3
+ 173E   / 77:  257.9
+ 175E   / 78:  257.0
+ 177E   / 79:  259.1
+ 179E   / 80:  254.8
+list  a - 3 * sst[d=1,l=1:3 at sum]
+             VARIABLE : A - 3 * SST[D=coads_climatology,L=1:3 at SUM]
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+set mode/last ignore_errors
+go bench_avet
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a = avet(sst)
+list a
+             VARIABLE : AVET(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+                1S    
+                45
+ 151E   / 66:  29.28
+ 153E   / 67:  29.39
+ 155E   / 68:  29.35
+ 157E   / 69:  29.03
+ 159E   / 70:  28.99
+ 161E   / 71:  29.15
+ 163E   / 72:  29.33
+ 165E   / 73:  29.01
+ 167E   / 74:  28.99
+ 169E   / 75:  29.00
+ 171E   / 76:  28.81
+ 173E   / 77:  28.66
+ 175E   / 78:  28.56
+ 177E   / 79:  28.79
+ 179E   / 80:  28.31
+list a - sst[l=@ave]
+             VARIABLE : A - SST[L=@AVE]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+ 
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+             X: 0.5 to 9.5
+ Column  1: B is X[I=1:9,K=1:5]
+ Column  2: C is AVET(A)
+             B     C
+1   / 1:  1.000   4.00
+2   / 2:  2.000   5.00
+3   / 3:  3.000   6.00
+4   / 4:  4.000   7.00
+5   / 5:  5.000   8.00
+6   / 6:  6.000   9.00
+7   / 7:  7.000  10.00
+8   / 8:  8.000  11.00
+9   / 9:  9.000  12.00
+ 
+set mode/last ignore_errors
+go bench_pass_thru
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+             VARIABLE : PASS_THRU(X)
+             SUBSET   : 20 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 11   / 11:  11.00
+ 12   / 12:  12.00
+ 13   / 13:  13.00
+ 14   / 14:  14.00
+ 15   / 15:  15.00
+ 16   / 16:  16.00
+ 17   / 17:  17.00
+ 18   / 18:  18.00
+ 19   / 19:  19.00
+ 20   / 20:  20.00
+set region/i=1:20
+list sin(a)
+             VARIABLE : SIN(A)
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8415
+ 2    /  2:  0.9093
+ 3    /  3:  0.1411
+ 4    /  4: -0.7568
+ 5    /  5: -0.9589
+ 6    /  6: -0.2794
+ 7    /  7:  0.6570
+ 8    /  8:  0.9894
+ 9    /  9:  0.4121
+ 10   / 10: -0.5440
+ 11   / 11: -1.0000
+ 12   / 12: -0.5366
+ 13   / 13:  0.4202
+ 14   / 14:  0.9906
+ 15   / 15:  0.6503
+ 16   / 16: -0.2879
+ 17   / 17: -0.9614
+ 18   / 18: -0.7510
+ 19   / 19:  0.1499
+ 20   / 20:  0.9129
+can var/all
+can region
+ 
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+             VARIABLE : PASS_THRU(SST[L=@AVE,Y=@SBX:11])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+             VARIABLE : PASS_THRU(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 16-JAN 06:00
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   0.59
+ 71N   / 81:   0.62
+ 69N   / 80:   0.45
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   3.32
+ 43N   / 67:   4.72
+ 41N   / 66:   4.84
+ 39N   / 65:   8.63
+ 37N   / 64:   8.07
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:  18.91
+ 27N   / 59:  20.83
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:  25.41
+ 13N   / 52:  25.37
+ 11N   / 51:  25.82
+ 9N    / 50:  27.20
+ 7N    / 49:  26.11
+ 5N    / 48:  26.10
+ 3N    / 47:  26.25
+ 1N    / 46:  26.44
+ 1S    / 45:  27.01
+ 3S    / 44:  27.61
+ 5S    / 43:  28.24
+ 7S    / 42:  28.71
+ 9S    / 41:  28.46
+ 11S   / 40:  28.07
+ 13S   / 39:  28.15
+ 15S   / 38:  28.08
+ 17S   / 37:  28.29
+ 19S   / 36:  27.61
+ 21S   / 35:  27.59
+ 23S   / 34:  27.06
+ 25S   / 33:  26.70
+ 27S   / 32:  25.89
+ 29S   / 31:  24.65
+ 31S   / 30:  23.86
+ 33S   / 29:  22.16
+ 35S   / 28:  20.58
+ 37S   / 27:  19.20
+ 39S   / 26:  17.51
+ 41S   / 25:  14.44
+ 43S   / 24:   8.55
+ 45S   / 23:   7.51
+ 47S   / 22:   5.77
+ 49S   / 21:   4.21
+ 51S   / 20:   3.64
+ 53S   / 19:   2.87
+ 55S   / 18:   2.67
+ 57S   / 17:   2.05
+ 59S   / 16:   1.37
+ 61S   / 15:   1.33
+ 63S   / 14:   0.77
+ 65S   / 13:  -0.04
+ 67S   / 12:  -0.93
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+list/x=50 a[l=@ave,y=@sbx:11]
+             VARIABLE : PASS_THRU(SST)
+                        box smoothed by 11 pts on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (averaged)
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+ 
+set mode/last ignore_errors
+go bench_storage
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+              130.5E 131.5E 
+                1      2
+ 1.5N  / 50:   ....  2.955
+ 1.17N / 49:   ....  2.962
+ 0.83N / 48:   ....  2.966
+ 0.5N  / 47:   ....  2.973
+ 0.17N / 46:   ....  2.985
+ 0.17S / 45:   ....  2.990
+ 0.5S  / 44:   ....   ....
+ 
+can region
+set region/x=140w/y=10n/k=1
+list a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 140.5W
+             LATITUDE : 9.8N
+             DEPTH (m): 5
+                      140.5W 
+                       90
+ 15-JAN-1982 14 / 1:  2.656
+ 18-JAN-1982 15 / 2:  2.654
+ 21-JAN-1982 16 / 3:  2.652
+ 24-JAN-1982 17 / 4:  2.649
+ 27-JAN-1982 18 / 5:  2.646
+ 
+can region
+ 
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+             VARIABLE : STORAGE(B)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 0.7S to 1.7N (averaged)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+ 140.5E / 11:  2.953
+ 141.5E / 12:  2.956
+ 142.5E / 13:  2.961
+ 143.5E / 14:  2.966
+ 144.5E / 15:  2.968
+ 145.5E / 16:  2.968
+ 146.5E / 17:  2.967
+ 147.5E / 18:  2.970
+ 148.5E / 19:  2.974
+ 149.5E / 20:  2.979
+ 
+set mode/last ignore_errors
+ 
+go bench_subtract
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+ 
+set mode ignore_errors
+ 
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+             VARIABLE : SUBTRACT(OATEMP,SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+             VARIABLE : A - B
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+ 
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             DEPTH (m): 0
+                    179E   
+                     80
+ 16-JAN      / 1:  0.1934
+ 15-FEB      / 2:  0.1304
+ 17-MAR      / 3:    ....
+ 
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+             VARIABLE : SUBTRACT(A,B)
+             SUBSET   : 30 points (X)
+             Y        : 15
+              15    
+              15
+ 1    /  1: -14.00
+ 2    /  2: -13.00
+ 3    /  3: -12.00
+ 4    /  4: -11.00
+ 5    /  5: -10.00
+ 6    /  6:  -9.00
+ 7    /  7:  -8.00
+ 8    /  8:  -7.00
+ 9    /  9:  -6.00
+ 10   / 10:  -5.00
+ 11   / 11:  -4.00
+ 12   / 12:  -3.00
+ 13   / 13:  -2.00
+ 14   / 14:  -1.00
+ 15   / 15:   0.00
+ 16   / 16:   1.00
+ 17   / 17:   2.00
+ 18   / 18:   3.00
+ 19   / 19:   4.00
+ 20   / 20:   5.00
+ 21   / 21:   6.00
+ 22   / 22:   7.00
+ 23   / 23:   8.00
+ 24   / 24:   9.00
+ 25   / 25:  10.00
+ 26   / 26:  11.00
+ 27   / 27:  12.00
+ 28   / 28:  13.00
+ 29   / 29:  14.00
+ 30   / 30:  15.00
+ 
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+list/x=150:160/y=0 subtract(a,26)
+             VARIABLE : SUBTRACT(A,26)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+ 
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                1S    
+                45
+ 151E   / 66:  1.109
+ 153E   / 67:  1.124
+ 155E   / 68:  1.027
+ 157E   / 69:  0.883
+ 159E   / 70:  0.912
+ 
+set mode/last ignore_errors
+ 
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
+ 
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+!
+! 4/2006 all efs distributed with Ferret except writev5d and the
+!        examples tested in bench_examples.jnl are now internally linked.
+ 
+GO bn_reset
+cancel mode verify
+go bench_v5d
+! benchmark for Vis5D external function
+! 5/99 ACM
+ 
+ 
+!  Write data to a Vis5D file.  The first argument to the
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+ 
+can region
+ set mode ignore_error
+ 
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+To view the file with Vis5D say:   GO vis5d_start vis5d_out.v5d
+ 
+set mode/last ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_v5d_strings.jnl
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+ 
+go bn_reset
+cancel mode verify
+go bn_fcn_calls.jnl
+! Simple tests of external functions
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and
+!             fill_xy to bn_internal_external_functions.jnl
+ 
+exit
+ 
+exit/command
+ 
+-----
+Appending ncdump output
+ 
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_17 = 17 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_17) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348803, 27.9324667419544,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIME_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME = UNLIMITED ; // (3 currently)
+	TIMEedges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:edges = "TIMEedges" ;
+	double TIMEedges(TIMEedges) ;
+		TIMEedges:edges = " " ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIMEedges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.861   17-Mar-14" ;
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float SST(TIME, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float SST(TIME, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT100_100 = 1 ;
+	PSYT35_56 = 22 ;
+	PSZT1_1 = 1 ;
+	TIME1 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT100_100(PSXT100_100) ;
+		PSXT100_100:units = "degrees_east" ;
+		PSXT100_100:modulo = 360. ;
+		PSXT100_100:point_spacing = "even" ;
+		PSXT100_100:axis = "X" ;
+		PSXT100_100:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_1(PSZT1_1) ;
+		PSZT1_1:units = "METERS" ;
+		PSZT1_1:positive = "down" ;
+		PSZT1_1:point_spacing = "uneven" ;
+		PSZT1_1:axis = "Z" ;
+		PSZT1_1:standard_name = "depth" ;
+		PSZT1_1:bounds = "PSZT1_1_bnds" ;
+	double PSZT1_1_bnds(PSZT1_1, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:point_spacing = "even" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float TEMP(TIME1, PSZT1_1, PSYT35_56, PSXT100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME1, PSZT1_1, PSYT48_48, PSXT91_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME1, PSZT1_1, PSYT48_48, PSXT91_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "meters" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "meters" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double FAREN(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	int FAREN(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	tday = UNLIMITED ; // (31 currently)
+	lon1_5 = 5 ;
+	lat1_5 = 5 ;
+	bnds = 2 ;
+	zt = 10 ;
+	time1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double tday(tday) ;
+		tday:units = "days since 1998-12-31 00:00:00" ;
+		tday:axis = "T" ;
+		tday:calendar = "GREGORIAN" ;
+		tday:time_origin = "31-DEC-1998" ;
+		tday:standard_name = "time" ;
+	double MyUpperLowerCaseVar(tday, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double lon1_5(lon1_5) ;
+		lon1_5:point_spacing = "even" ;
+		lon1_5:axis = "X" ;
+		lon1_5:standard_name = "longitude" ;
+	double lat1_5(lat1_5) ;
+		lat1_5:point_spacing = "uneven" ;
+		lat1_5:axis = "Y" ;
+		lat1_5:standard_name = "latitude" ;
+		lat1_5:bounds = "lat1_5_bnds" ;
+	double lat1_5_bnds(lat1_5, bnds) ;
+	float zt(zt) ;
+		zt:units = "meters" ;
+		zt:positive = "down" ;
+		zt:point_spacing = "uneven" ;
+		zt:axis = "Z" ;
+		zt:standard_name = "depth" ;
+		zt:bounds = "zt_bnds" ;
+	float zt_bnds(zt, bnds) ;
+	double time1478(time1478) ;
+		time1478:calendar = "NOLEAP" ;
+		time1478:point_spacing = "even" ;
+		time1478:axis = "T" ;
+		time1478:standard_name = "time" ;
+	double newvar(time1478, zt, lat1_5, lon1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:units = "deg" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:units = "degrees" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.861   17-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+-----
+end of ncdump output
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_startupfile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14
+ 	17-Mar-14 15:55     
+
+CAN MODE VERIFY
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "656"
+PPL$YPIXEL = "492"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5PAE 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:50:21 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "17-Mar-14"
+SESSION_TIME = "15:55"
+SESSION_PID = "3996"
+DELTA_CPU = "0.027995"
+CLOCK_SECS = "0.348"
+CURRENT_DATE = "17-Mar-14"
+CURRENT_TIME = "15:55:05"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "startup_tests.plt"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "8.000"
+PPL$YLEN = "6.000"
+PPL$XORG = "1.200"
+PPL$YORG = "1.400"
+PPL$WIDTH = "10.20"
+PPL$HEIGHT = "8.800"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+WIN_TITLE = "17-Mar-14:15:55"
+VP_WIDTH = "10.2"
+VP_HEIGHT = "8.8"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1"
+VP_TOP_MARGIN = "1.4"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+GO_FILE = "./bn_startupfile.jnl"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE         SET         startup_tests.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_gif
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14
+ 	17-Mar-14 15:55     
+
+! bn450_gif.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of gif file in batch mode using
+! frame/file=bnplot.gif....will create three gif files
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= .gif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+frame/file=bnplot.gif
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+frame/file=bnplot.gif
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+frame/file=bnplot.gif
+ 
+! Prior to v5.8 could not get the window size in pixels when in gif mode
+show symbol ppl$xpixel
+PPL$XPIXEL = "1152"
+show symbol ppl$ypixel
+PPL$YPIXEL = "662"
+ 
+! V6.13
+! transparency with FRAME/TRANS
+!!
+! These gif images have the background color white or black
+! replaced by transparent color. This can be tested by putting
+! them into an HTML document with a colored background.
+! e.g. a file called test_transparent.html containing only this line:
+! <html> <body bgcolor="orange"> <img src="testfile.gif"/> </body> </html>
+ 
+can view
+use coads_climatology
+shade/nokey/lev=50 sst[L=1]
+frame/trans/file=testbackground.gif
+ 
+! moved here from bn500_bug_fixes.jnl. The frame/  command it contains
+! has trouble when running the benchmarks from remote desktop
+go bn_reset
+cancel mode verify
+go err491_long_gif_name
+! err491_long_gif_name.jnl
+! *sh* 4/99 - test 175 character gif name
+ 
+! name length extended with changes to save_frame.F and xeq_frame.F
+ 
+set wind/siz=0.03
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+sp rm -f abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+ 
+frame/file="abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif"
+ 
+spawn ls abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif
+ 
+ 
+! The fix for bug 1396
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=gif_dashbug.gif
+ 
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_ps
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14
+ 	17-Mar-14 15:55     
+
+! bn450_ps.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of ps files in batch mode using
+! "-batch bnplot.ps" command line option...will create on final ps file
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.ps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+ 
+set mode ignore
+frame/file=bnplot.ps    ! DELIBERATE ERROR MESSAGE
+can mode ignore
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_batch_metafile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5PAE 32-bit - 03/17/14
+ 	17-Mar-14 15:55     
+
+! bn_batch_metafile.jnl
+! Run at the end of the benchmark scripts, starting ferret with the flags
+!   -batch bat.plt
+! Produces nine metafiles.
+ 
+cancel mode logo
+ 
+! test viewports and set window/clear; cancel viewport
+set view upper
+plot/i=1:150 sin(i/12)
+set view lower
+plot/color=red/i=1:150 cos(i/10)
+ 
+set window/clear
+ 
+set view left
+shade/i=1:15/j=1:15/lev=30 i*j
+set view right
+shade/i=1:15/j=1:15 cos(i)* sin(j)
+ 
+cancel viewports
+ 
+set view ur
+plot/i=1:12 1./i
+set view ll
+shade/i=1:150/j=1:150 cos(i/10) - sin(j/12)
+ 
+! polygon command and palette
+ 
+cancel viewports
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! more viewports, with pplus/reset
+ 
+set view upper; shade/i=1:10/j=1:10 i*j
+cancel viewports
+pplus/reset
+ 
+! cancel viewports when viewport wasnt set
+! and set window/clear after cancel viewports
+ 
+plot/vs/line/i=1:314 i*cos(i/20),i*sin(i/20)
+plot/vs/line/over/i=1:314 i*cos(i/30),i*sin(i/20)
+ 
+cancel viewports
+set window/clear
+ 
+! aspect ratio can be set
+ 
+set window/asp=3
+shade/i=1:15/j=1:15/lev=20 i*j
+ 
+set win/asp=1
+fill/i=1:15/j=1:15/lev=20 i*j
+ 
+pplus/reset
+ 
+ 
+! Bug 1396 fixed
+ 
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+cancel viewports
+ 
+! intentional errors and ignored commands
+! set and cancel mode metafile are ignored
+ 
+set mode metafile new.plt
+ 
+cancel mode metafile
+ 
+plot/i=1:12/title="after cancel mode metafile in batch mode" 1./i
+ 
+! set window commands are ignored, except for set window/aspect
+set window/new
+ 
+set window/location=0.1,0.1/title="another title"
+ 
+set mode/last logo
+exit/command
+Ended at Mon Mar 17 15:55:07 PDT 2014
diff --git a/bench/ansley_official.rhel6-32_err b/bench/ansley_official.rhel6-32_err
new file mode 100644
index 0000000..f0cef0b
--- /dev/null
+++ b/bench/ansley_official.rhel6-32_err
@@ -0,0 +1,3676 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/v685Release/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 42809389 Nov 12 15:10 /home/users/ansley/build/v685Release/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/v685Release/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: v6.85 on flat 32-bit
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func
+FER_FONTS=/home/users/tmap/ferret/rhel6-x86_64-linux/ppl/fonts
+FER_GO=. /home/users/tmap/ferret/rhel6-x86_64-linux/go /home/users/tmap/ferret/rhel6-x86_64-linux/examples /home/users/tmap/ferret/rhel6-x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/rhel6-x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/rhel6-x86_64-linux/ppl
+FER_WEB_BROWSER=firefox
+PWD=/home/users/ansley/build/v685Release/FERRET/bench
+Beginning at Tue Nov 12 15:12:09 PST 2013
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO bn_dollar hello
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO bn_dollar hello
+say ($10)0
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          Legal range is 1 to 3
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+cont/over/i=1:10/color=noexist i
+ **ERROR: unknown command qualifier: thick=4
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: regridding: no target grid specified
+load temp[g=@lin]
+ **ERROR: regridding: no target grid specified
+load temp[gx=@ave]
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+Replacing definition of grid G12
+Replacing definition of grid G24
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TCAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+Replacing definition of axis Y1
+Replacing definition of axis Y2
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+Replacing definition of grid TGRID
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X10
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of grid G1
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis Z1
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport LL6
+Re-defining viewport UL6
+Re-defining viewport LM6
+Re-defining viewport UM6
+Re-defining viewport LR6
+Re-defining viewport UR6
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+Replacing definition of axis TAX2
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+Re-defining viewport MID2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ls: cannot access input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis Z1
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=JAN-1990
+          Axis extremes are T=DEC-1997:JAN-1998
+list/t=1-jan-1990 dummy
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=AUG-1980:JAN-1982
+          Axis extremes are T=AUG-1982:JAN-1983
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid TGRID
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: ZORRO
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized for T axis: METERS
+ *** NOTE: They will not be convertible
+ *** NOTE: Units  not recognized for Y axis: SECONDS
+ *** NOTE: They will not be convertible
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis YFINE
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XQ
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TGREG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file revision.nc
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT1).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME4).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ *** NOTE: Changing the value of attribute (PSYT1).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIR
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ LISTing to file a.nc
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME9
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX047)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+**ERROR in External Function add_9:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/add_9.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function appende:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/appende.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function avet:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/avet.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function dates:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/dates.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function expndi_by_z_counts:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/expndi_by_z_counts.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function expndi_id_by_z_counts:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/expndi_id_by_z_counts.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function factorial:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/factorial.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function fft_amp:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/fft_amp.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function ffta_sample:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/ffta_sample.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function fft_phas:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/fft_phas.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function fill_xy:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/fill_xy.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function minmax:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/minmax.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function pass_thru:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/pass_thru.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function percent_good_t:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/percent_good_t.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function storage:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/storage.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function string_arg:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/string_arg.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function student_t_cutoff:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/student_t_cutoff.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function subtract:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/subtract.so: wrong ELF class: ELFCLASS64".
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid GG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis ZAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis TAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of axis Y1
+Replacing definition of grid G1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file list_of_numbers.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dummy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid MYGRID
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+Replacing definition of axis YAX
+ LISTing to file a.nc
+Replacing definition of axis TAXIS
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis TNEW
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAXIS
+Replacing definition of axis TAXIS
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid EVEN
+Replacing definition of grid G1
+Replacing definition of grid G2
+Replacing definition of grid G3
+Replacing definition of grid G4
+Replacing definition of grid G13
+Replacing definition of grid G14
+Replacing definition of grid G23
+Replacing definition of grid G33
+Replacing definition of grid G234
+Replacing definition of grid G134
+Replacing definition of grid G124
+Replacing definition of grid G123
+Replacing definition of grid G1234
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+Replacing definition of grid G48
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid G5DAY
+Replacing definition of axis FAX4DAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file append_to_this.nc
+ncks: WARNING Overwriting global attribute history
+ncks: WARNING Overwriting global attribute Conventions
+ncks: WARNING Overwriting attribute point_spacing for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute axis for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute standard_name for output variable ZAXIS_ORIG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIRREG
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+**ERROR in External Function add_9:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/add_9.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function avet:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/avet.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function pass_thru:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/pass_thru.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function storage:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/storage.so: wrong ELF class: ELFCLASS64".
+**ERROR in External Function add_9:
+  Dynamic linking call dlopen() returns --
+  "/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func/add_9.so: wrong ELF class: ELFCLASS64".
+**ERROR Ferret crash; signal = 11
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ *** NOTE: Cannot create new windows when batch mode set
+Ended at Tue Nov 12 15:14:02 PST 2013
diff --git a/bench/ansley_official.rhel6-32_log b/bench/ansley_official.rhel6-32_log
new file mode 100644
index 0000000..ea05e35
--- /dev/null
+++ b/bench/ansley_official.rhel6-32_log
@@ -0,0 +1,78481 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/v685Release/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 42809389 Nov 12 15:10 /home/users/ansley/build/v685Release/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/v685Release/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: v6.85 on flat 32-bit
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/v685Release/FERRET/external_functions/ext_func
+FER_FONTS=/home/users/tmap/ferret/rhel6-x86_64-linux/ppl/fonts
+FER_GO=. /home/users/tmap/ferret/rhel6-x86_64-linux/go /home/users/tmap/ferret/rhel6-x86_64-linux/examples /home/users/tmap/ferret/rhel6-x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/rhel6-x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/rhel6-x86_64-linux/ppl
+FER_WEB_BROWSER=firefox
+PWD=/home/users/ansley/build/v685Release/FERRET/bench
+Beginning at Tue Nov 12 15:12:09 PST 2013
+! BN500_ALL.JNL
+! - run all the benchmark tests
+! - ordered (more or less) from least to most complex
+! V2.30: uses BN230_syntax instead of BN200_syntax
+!        added BN230_cdf
+!	 added BN230_regrid_transforms 8/92
+! V3.00: uses BN300_syntax instead of BN230_syntax
+! 	 added bn300_dollar 4/93
+! V3.01: adds bn301_axis_limits and ppl echo ON
+! V3.11: adds bn311_ez_order (/ORDER and /FORMAT=STREAM)
+! V3.12: adds bn312_user (tests SAMPLE and OBJECTIVE)
+! V3.13: for AIX testing: removed mem_mgmt & ignore errors during bn200_output
+! V3.20: to test SAVE/HEADING=enhanced (new BN320_cdf)
+! V4.00: added "*" tests to bnxxx_dollar and added new test bn400_grave
+!    6/95 - added bn401_symbols
+!    7/95 - modified bn*_syntax: bn401_syntax has var1[G=var2[d=dset]]
+!    8/95 - modified bn*_ez: bn401_ez tests FORM=unf
+! V4.20:
+!    9/95 - added test of LET/D and LIST/FORMAT=STREAM
+!	  - slightly modified syntax in bn420_regrid_transforms
+!	  - added bn420_dynamic_grids and bn420_comma_delimited
+!	  - added 2 small additional tests in bn420_grave
+!	  - added a small syntax test in bn420_syntax
+!	  - tested for commas inside args in bn420_dollar
+!	  - tested for enclosing parens in bn420_symbol
+! V4.30:
+!   5/96  - added IF tests
+!   9/96  - added MC data tests *kob*
+! V4.50:
+!   1/97  - eliminated MODE POLISH
+!	    (bn301_expressions.jnl -> bn450_expressions.jnl)
+!   8/97  - bn430_if -> bn450_if: added symbol substitution test
+!10/97*kob*- cancel metafile creation after bn420_syntax and turn it
+!	    on only before bn450_plot (upgraded from bn320_plot)
+!	   - also add test for negative time steps (bn450_negative_t)
+!	   - also add test for cuvilinear stuff
+!          - also added steve's "exact match" regridding
+!11/97 *kob* - added bn450_gc_functions
+! V4.91:
+!    1/98  - corrected bug in this script -- need to cancel viewports after
+!	     bn312_user or the plots which follow come up in a small viewport
+!    2/98 *kob* - moved bn450_curv.jnl up to right after bn450_plot.jnl in
+!		  order to have those metafiles saves as well for checking
+!		  also renamed it to bn491_curv.jnl and added some minor
+!		  cosmetic changes
+!    2/98 *kob* - add in bn491_bug_fixes.jnl
+!    4/98 *sh*  - replaced bn420_dynamic_grids with bn491_... (minor chg)
+! V5.00:
+!   2/99 *sh* -- bn420_regrid_transform ==> bn500_regrid_transform
+!   3/1/99 *kob* - removed bn200_budget from distributable benchmarks
+!   5/99 *kob* - added V50 bench files
+! V5.10:
+!  10/99 *sh* -- added bn_sample.jnl to test SAMPLEI,J,K,L
+!			bn_non_COARDS_netCDF.jnl
+!			bn_cache_hits.jnl, .sub
+!			bn_strides_revs_perms.jnl
+!			bn_regrid_to_user.jnl
+! V5.33:
+! 6/01 *sh* -- added bn_modulo_strides.jnl
+! 6/01 *acm*  -- add	bn_calendar
+!			bn_dash_dot
+!			bn_flowlines
+! 6/08 *kob*  -- add	bn_internal_external_functions
+!
+! V5.40:
+! 9/01 *sh* -- added bn_axis_viewports
+!           -- added bn_strings
+! 10/01 *acm* -- added bn_axcontrol
+!             -- add EOF's and cmprsi_by to bn_internal_external_functions.jnl
+! 11/01 *sh* -- added bn_delimited_read
+!
+! V5.41:
+! 3/02 *acm*-- Add bn540_bug_fixes.jnl
+!
+! V5.50:
+! 11/02 *sh*-- Add bn_subspan_modulo.jnl
+!
+! V5.52
+!  5/03 *acm* add bn_multi_line_labels.jnl, bn552_bug_fixes.jnl,
+!             bn_set_var_scale_off.jnl, bn_longvarnames.jnl, bn_shakey.jnl
+! v5.53
+!  9/03 *kob* added bn_test_nan
+ 
+! v5.81
+!  9/05 *acm* remove bn_curv_shade_mod.jnl which was duplicated by bn_curv_mod.jnl
+ 
+!  V6.00
+!  9/06 *acm* new scripts  bn_tab_comma_multivar.jnl, bn_element_functions.jnl,
+!             bn_long_revision_num.jnl, bn_window_title.jnl, bn_last_error.jnl,
+!             bn_deg_min.jnl, bn_dp_readscale.jnl, bn_bounds_defineax.jnl,
+!              bn_attributes.jnl, n600_bug_fixes.jnl
+!
+! 9/06 *acm* New bn601_bug_fixes for version 6.02
+ 
+! 6/06  *acm* add bn_transforms.jnl -- there was a benchmark testing regridding
+!             transforms but not the others: smoothers, fillers, etc.
+! 1/12  *acm* add bn_variance.jnl -- testing @VAR transform
+ 
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!
+! 11/06 *acm* New bn602_bug_fixes for version 6.02
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V685  *sh* 11/13 - added bn_vtree to test SHOW VAR/TREE
+ 
+! Include this statement to compare the outupt of 6D Ferret with
+! previous 4D benchmark logs.
+! cancel mode 6d_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      shrink_ylab   CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      shrink_ylab   CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      shrink_ylab   CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      metafile.plt
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN ACTIVE
+   1    *
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+cancel mode metafile      !9/97
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dollar hello    ! test command arg
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+ 
+! added in bn400
+GO bn_reset
+cancel mode verify
+GO bn_grave
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  3 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+ 
+! added in bn420
+GO bn_reset
+cancel mode verify
+GO bn_letd
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+ 
+! added in bn430
+GO bn_reset
+cancel mode verify
+GO bn_if
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+ 
+GO bn_reset
+cancel mode verify
+GO bn_geometry
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+set mode ignore		! needed for AIX   11/94
+GO bn_output
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+cancel list/format
+can mode ignore		! needed for AIX
+ 
+GO bn_reset
+cancel mode verify
+GO bn_in_plane
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+ 
+GO bn_reset
+cancel mode verify
+GO bn_compress
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4        6        8     
+              2        3        4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- K:3 Z:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- K:4 Z:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- K:3 Z:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- K:4 Z:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- K:3 Z:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- K:4 Z:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5        7        9     
+              3        4        5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- K:4 Z:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- K:5 Z:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- K:4 Z:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- K:5 Z:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- K:4 Z:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- K:5 Z:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ez		! changed from bn200_ez 8/10/95
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.355000
+ 3   / 3:  0.410000
+ 4   / 4:  0.435000
+ 5   / 5:  0.478000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+               X1      X2
+1   / 1:  0.006000  0.886500
+2   / 2:  0.355000  0.664300
+3   / 3:  0.410000  0.607100
+4   / 4:  0.435000  0.553500
+5   / 5:  0.478000  0.533700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.006000
+ 2    /  2:  0.176000
+ 3    /  3:  0.282000
+ 4    /  4:  0.355000
+ 5    /  5:  0.379000
+ 6    /  6:  0.393000
+ 7    /  7:  0.410000
+ 8    /  8:  0.417000
+ 9    /  9:  0.467000
+ 10   / 10:  0.435000
+ 11   / 11:  0.444000
+ 12   / 12:  0.470000
+ 13   / 13:  0.478000
+ 14   / 14:  0.515000
+ 15   / 15:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.593500
+ 3   / 3:  0.435000
+ 4   / 4:  0.545800
+ 5   / 5:  0.478000
+ 6   / 6:  0.514700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.355000
+ 2   / 2:  0.379000
+ 3   / 3:  0.393000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+              1         2         3      
+               1         2         3
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ 3   / 3:  0.410000  0.417000  0.467000
+ 4   / 4:  0.435000  0.444000  0.470000
+ 5   / 5:  0.478000  0.515000  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+              1         2         3      
+               1         2         3
+ ---- L:1 T:   1
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ ---- L:2 T:   2
+ 1   / 1:  0.410000  0.417000  0.467000
+ 2   / 2:  0.435000  0.444000  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.176000
+ 3   / 3:  0.282000
+ 4   / 4:  0.355000
+ 5   / 5:  0.379000
+ 6   / 6:  0.393000
+ 7   / 7:  0.410000
+ 8   / 8:  0.417000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+! ****
+! remove bn200_budgets for portable benchmarks *kob* 5/99
+! ****
+ 
+! ppl echo on turns on fort.41 to capture ppl commands.
+PPL ECHO ON		! added 10/27/93
+ 
+! 10/97 *kob* now set mode metafile
+set mode metafile bnplot.plt
+GO bn_reset
+cancel mode verify
+GO bn_plot		! upgraded from bn320_plot 10/1/97 *kob*
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+ 
+ 
+!added in bn450 10/97 *kob*
+! moved to right after bn450_plot to capture metafiles *kob* 2/98
+GO bn_reset
+cancel mode verify
+! 2/98 changed bn450_curv to bn491_curv - just some cosmetic changes *kob*
+GO bn_curv
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+ 
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! 8/25/92
+!CANCEL WINDOW/ALL    ! added 7/27/92
+! 10/97 *kob* now cancel mode metafile
+cancel mode metafile
+ 
+GO bn_reset
+cancel mode verify
+GO bn_symbols	! added 6/22/95
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.85"
+FERRET_PLATFORM = "Linux 2.6.32-358.23.2.el6.x86_64 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.0 of May 13 2013 13:48:05 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+DELTA_CPU = "4.84326"
+CLOCK_SECS = "9.779"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:12:19"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.85"
+FERRET_PLATFORM = "Linux 2.6.32-358.23.2.el6.x86_64 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.0 of May 13 2013 13:48:05 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+DELTA_CPU = "0.001"
+CLOCK_SECS = "9.78"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:12:19"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567XXX = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LAB1 = "FERRET Ver. 6.85"
+LAB2 = "NOAA/PMEL TMAP"
+LAB3 = "12-NOV-2013 15:12:19"
+LABX = "X"
+LAB4 = "Y : 10"
+LABNUM_Y = "4"
+LAB5 = "Z : 5"
+LABNUM_Z = "5"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "4"
+LABNUM_Z = "5"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "4"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.85"
+FERRET_PLATFORM = "Linux 2.6.32-358.23.2.el6.x86_64 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.0 of May 13 2013 13:48:05 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+SESSION_PID = "27740"
+DELTA_CPU = "0.008998"
+CLOCK_SECS = "9.788"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:12:19"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_comma_delimited	! added 10/2/95
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- K:3 Z:   25
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- K:3 Z:   25
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- I:96 X:   134.5W
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+15,27.1246,27.5239
+25,27.011,27.3501
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- J:42 Y:   1.167S
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+15,27.1246,27.5239
+25,27.011,27.3501
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- K:3 Z:   25
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- K:3 Z:   25
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+25,27.2481
+ ---- I:96 X:   134.5W
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+15,27.1246
+25,27.011
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+25,27.2481
+ ---- J:42 Y:   1.167S
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+15,27.1246
+25,27.011
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+ ---- I:96 X:   134.5W
+15,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+ ---- I:96 X:   134.5W
+15,27.1246
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+ ---- J:42 Y:   1.167S
+15,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+ ---- J:42 Y:   1.167S
+15,27.1246
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.167S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.167S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+1.5S,27.335
+1.167S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W   	134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.3346	27.2218
+1.167S	27.2382	27.1246
+ ---- K:3 Z:   25
+1.5S	27.2481	27.1248
+1.167S	27.1293	27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.7751	27.6218
+1.167S	27.678	27.5239
+ ---- K:3 Z:   25
+1.5S	27.6518	27.4892
+1.167S	27.51	27.3501
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,2.E+08,2.E+08
+1.167S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,1.6675084E+08,2.0208841E+08
+1.167S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.000002,0.000002
+1.167S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.00000166750845,0.00000202088412
+1.167S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.833S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.333S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1     ,2     ,3     ,4     ,5     
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dynamic_grids	! added 9/27/95, V420 ->V491 4/98
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.67N / 50:  24.6561  24.4277  24.3118  24.3162  24.5191
+ 1.33N / 49:  24.4396  24.2439  24.1355  24.1369  24.3131
+ 1N    / 48:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.67N / 47:  24.0904  23.9463  23.8383  23.7928  23.8749
+ 0.33N / 46:  23.9899  23.8698  23.7654  23.6951  23.7076
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  24.5431  24.3351  24.2254  24.2312  24.4219
+ 1.17N / 49:  24.3362  24.1527  24.0455  24.0427  24.2042
+ 0.83N / 48:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.5N  / 47:  24.0242  23.8934  23.7879  23.7273  23.7728
+ 0.17N / 46:  23.9556  23.8461  23.7430  23.6629  23.6425
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G003)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+                179.5W    178.5W    177.5W    176.5W    175.5W  
+                 51        52        53        54        55
+ 1.83N / 51: -0.627987 -0.652220 -0.659763 -0.663230 -0.662623
+ 1.5N  / 50: -0.631590 -0.653915 -0.653717 -0.650547 -0.644405
+ 1.17N / 49: -0.635168 -0.655610 -0.647673 -0.637865 -0.626188
+ 0.83N / 48: -0.627037 -0.647150 -0.637065 -0.626707 -0.616078
+ 0.5N  / 47: -0.607180 -0.628495 -0.621847 -0.617047 -0.614073
+ 0.17N / 46: -0.587298 -0.609840 -0.606630 -0.607388 -0.612068
+ 0.17S / 45: -0.567438 -0.591208 -0.591415 -0.597708 -0.610065
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 1.83N / 51:  27.5946  27.5458  27.5038  27.4555  27.3787  27.2791
+ 1.5N  / 50:  27.6353  27.5819  27.5333  27.4787  27.4018  27.3015
+ 1.17N / 49:  27.6807  27.6187  27.5654  27.5064  27.4279  27.3285
+ 0.83N / 48:  27.7285  27.6555  27.5958  27.5327  27.4522  27.3536
+ 0.5N  / 47:  27.7775  27.6952  27.6296  27.5610  27.4762  27.3760
+ 0.17N / 46:  27.8234  27.7366  27.6691  27.5969  27.5077  27.4040
+ 0.17S / 45:  27.8727  27.7878  27.7232  27.6494  27.5563  27.4494
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                  A      A
+130.5E / 1:  130.500  130.500
+131.5E / 2:  131.500  131.500
+132.5E / 3:  132.500  132.500
+133.5E / 4:  133.500  133.500
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX003)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.10000
+ 0.2  /  2:  0.20000
+ 0.3  /  3:  0.30000
+ 0.4  /  4:  0.40000
+ 0.5  /  5:  0.50000
+ 0.6  /  6:  0.60000
+ 0.7  /  7:  0.70000
+ 0.8  /  8:  0.80000
+ 0.9  /  9:  0.90000
+ 1    / 10:  1.00000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.000
+ 132.5E / 2:  132.500
+ 135E   / 3:  135.000
+ 137.5E / 4:  137.500
+ 140E   / 5:  140.000
+ 142.5E / 6:  142.500
+ 145E   / 7:  145.000
+ 147.5E / 8:  147.500
+ 150E   / 9:  150.000
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 101   /  1:  101.100  102.600  104.100  105.600  107.100  108.600  110.100
+ 102   /  2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 103   /  3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 104   /  4:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 105   /  5:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+ 106   /  6:  106.100  107.600  109.100  110.600  112.100  113.600  115.100
+ 107   /  7:  107.100  108.600  110.100  111.600  113.100  114.600  116.100
+ 108   /  8:  108.100  109.600  111.100  112.600  114.100  115.600  117.100
+ 109   /  9:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+ 110   / 10:  110.100  111.600  113.100  114.600  116.100  117.600  119.100
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                 0.1      4.6      9.1   
+                 1        2        3
+ 101   /  1:  101.100  105.600  110.100
+ 102   /  2:  102.100  106.600  111.100
+ 103   /  3:  103.100  107.600  112.100
+ 104   /  4:  104.100  108.600  113.100
+ 105   /  5:  105.100  109.600  114.100
+ 106   /  6:  106.100  110.600  115.100
+ 107   /  7:  107.100  111.600  116.100
+ 108   /  8:  108.100  112.600  117.100
+ 109   /  9:  109.100  113.600  118.100
+ 110   / 10:  110.100  114.600  119.100
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                 0.1      7.6   
+                 1        2
+ 101   /  1:  101.100  108.600
+ 102   /  2:  102.100  109.600
+ 103   /  3:  103.100  110.600
+ 104   /  4:  104.100  111.600
+ 105   /  5:  105.100  112.600
+ 106   /  6:  106.100  113.600
+ 107   /  7:  107.100  114.600
+ 108   /  8:  108.100  115.600
+ 109   /  9:  109.100  116.600
+ 110   / 10:  110.100  117.600
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 102    / 1:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 102.5  / 2:  102.600  104.100  105.600  107.100  108.600  110.100  111.600
+ 103    / 3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 103.5  / 4:  103.600  105.100  106.600  108.100  109.600  111.100  112.600
+ 104    / 5:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 104.5  / 6:  104.600  106.100  107.600  109.100  110.600  112.100  113.600
+ 105    / 7:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+                0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                1        2        3        4        5        6        7
+ 95    / 1:     ....     ....     ....     ....     ....     ....     ....
+ 102   / 2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 109   / 3:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX004)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX003)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX003)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ (AX004)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.00
+ 121    /  2:   220.00
+ 441    /  3:   420.00
+ 961    /  4:   620.00
+ 1681   /  5:   820.00
+ 2601   /  6:  1020.00
+ 3721   /  7:  1220.00
+ 5041   /  8:  1420.00
+ 6561   /  9:  1620.00
+ 8281   / 10:  1720.00
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.500
+ 131.5E /  2:  131.500
+ 132.5E /  3:  132.500
+ 133.5E /  4:  133.500
+ 134.5E /  5:  134.500
+ 135.5E /  6:  135.500
+ 136.5E /  7:  136.500
+ 137.5E /  8:  137.500
+ 138.5E /  9:  138.500
+ 139.5E / 10:  139.500
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX003)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  255.043  255.835  256.725  257.731  258.922
+ 1.17N / 49:  254.836  255.653  256.546  257.543  258.704
+ 0.83N / 48:  254.657  255.499  256.389  257.358  258.477
+ 0.5N  / 47:  254.524  255.393  256.288  257.227  258.273
+ 0.17N / 46:  254.456  255.346  256.243  257.163  258.142
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  125.543  129.422  134.545  137.119  141.562
+ 1.17N / 49:  125.336  129.204  134.163  136.896  141.270
+ 0.83N / 48:  125.157  128.977  133.703  136.690  140.960
+ 0.5N  / 47:  125.024  128.773  133.295  136.512  140.644
+ 0.17N / 46:  124.956  128.642  132.987  136.380  140.376
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  255.043  258.922  264.045  266.619  271.062
+ 1.17N / 49:  254.836  258.704  263.663  266.396  270.770
+ 0.83N / 48:  254.657  258.477  263.203  266.190  270.460
+ 0.5N  / 47:  254.524  258.273  262.795  266.012  270.144
+ 0.17N / 46:  254.456  258.142  262.487  265.880  269.876
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               168.5E   170.5E   172.5E   174.5E   176.5E   178.5E  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  29.2186  29.1820  28.9284  28.6727  28.1158  27.7262
+ 1.17N / 49:  29.2537  29.1794  28.9683  28.7060  28.2175  27.8045
+ 0.83N / 48:  29.2747  29.1817  28.9842  28.7218  28.2984  27.8834
+ 0.5N  / 47:  29.3025  29.1943  28.9819  28.7306  28.3551  27.9545
+ 0.17N / 46:  29.3441  29.2219  28.9889  28.7493  28.3962  28.0105
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               108.5W   106.5W   104.5W   102.5W   100.5W   98.5W   
+                 1        2        3        4        5        6
+ 1.5N  / 50:  25.4248  25.2404  25.0453  25.2349  25.4898  25.8063
+ 1.17N / 49:  25.0178  24.8787  24.7362  24.9070  25.2015  25.5514
+ 0.83N / 48:  24.6455  24.5412  24.4230  24.5627  24.8753  25.2469
+ 0.5N  / 47:  24.2823  24.1999  24.1010  24.2162  24.5241  24.8980
+ 0.17N / 46:  23.9664  23.8958  23.8185  23.9163  24.1945  24.5649
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX004)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.000
+ 170E   / 2:  170.000
+ 150W   / 3:  210.000
+ 110W   / 4:  250.000
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.0000
+ 2S    / 2:  -2.0000
+ 10S   / 1: -10.0000
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 2.8N / 4:  25.8760  25.1016  24.7591  25.3616  25.9523  26.1052
+ 1.8N / 3:  25.1492  24.5204  24.4013  25.0592  25.8372  25.5690
+ 0.8N / 2:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.2S / 1:  24.0844  23.8819  23.6864  23.6291  23.8094  23.6664
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 4N   / 4:  26.3100  25.7627  25.1684  25.4169  26.0928  26.4324
+ 2.5N / 3:  25.6892  24.9014  24.6646  25.3345  25.9631  26.0034
+ 1N   / 2:  24.4816  24.0759  23.9505  24.3911  24.9972  24.6091
+ 0.5S / 1:  24.1489  23.9855  23.7919  23.6520  23.7144  23.6009
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 2.8N / 4:  25.6905  24.7917  25.5507  26.0875
+ 1.8N / 3:  24.9592  24.3997  25.3139  25.6838
+ 0.8N / 2:  24.2617  23.8736  24.4085  24.5531
+ 0.2S / 1:  24.0313  23.7330  23.6749  23.7233
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 4N   / 4:  26.1901  25.2969  25.5832  26.3921
+ 2.5N / 3:  25.4818  24.6784  25.5471  26.0151
+ 1N   / 2:  24.3640  23.9588  24.5740  24.7711
+ 0.5S / 1:  24.1087  23.8399  23.6597  23.6433
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX003)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   138.5W   136.5W   134.5W   132.5W   130.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.9330  24.4927  25.4749  25.9529  25.6235  24.8629
+ 1.17N / 49:  24.8195  24.3658  25.1683  25.8306  25.3698  24.5966
+ 0.83N / 48:  24.6946  24.2521  24.7974  25.6708  25.1391  24.3667
+ 0.5N  / 47:  24.5726  24.1661  24.4685  25.4813  24.9214  24.1928
+ 0.17N / 46:  24.4684  24.1208  24.2760  25.1658  24.7013  24.0902
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W  
+                 1        2        3
+ 1.5N  / 50:  24.9330  25.4749  25.6235
+ 1.17N / 49:  24.8195  25.1683  25.3698
+ 0.83N / 48:  24.6946  24.7974  25.1391
+ 0.5N  / 47:  24.5726  24.4685  24.9214
+ 0.17N / 46:  24.4684  24.2760  24.7013
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W   128.5W  
+                 1        2        3        4
+ 1.5N  / 50:  24.9330  25.4749  25.6235  24.3351
+ 1.17N / 49:  24.8195  25.1683  25.3698  24.1527
+ 0.83N / 48:  24.6946  24.7974  25.1391  23.9991
+ 0.5N  / 47:  24.5726  24.4685  24.9214  23.8934
+ 0.17N / 46:  24.4684  24.2760  24.7013  23.8461
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               134.5W   132.5W   130.5W   128.5W   126.5W   124.5W  
+                 4        5        6        7        8        9
+ 1.5N  / 50:  25.9529  25.6235  24.8629  24.3351  24.2312  24.8158
+ 1.17N / 49:  25.8306  25.3698  24.5966  24.1527  24.0427  24.5341
+ 0.83N / 48:  25.6708  25.1391  24.3667  23.9991  23.8583  24.2480
+ 0.5N  / 47:  25.4813  24.9214  24.1928  23.8934  23.7273  23.9665
+ 0.17N / 46:  25.1658  24.7013  24.0902  23.8461  23.6629  23.7442
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               135W     132W     129W     126W    
+                 1        2        3        4
+ 1.5N  / 50:  25.8334  25.4333  24.4671  24.3773
+ 1.17N / 49:  25.6650  25.1765  24.2637  24.1656
+ 0.83N / 48:  25.4524  24.9460  24.0910  23.9557
+ 0.5N  / 47:  25.2281  24.7393  23.9683  23.7871
+ 0.17N / 46:  24.9433  24.5486  23.9072  23.6832
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     127W     125W     123W     121W    
+                 1        2        3        4        5
+ 1.5N  / 50:  24.5447  24.2283  24.7825  25.1672  25.3824
+ 1.17N / 49:  24.3256  24.0441  24.5077  24.8227  24.9891
+ 0.83N / 48:  24.1323  23.8736  24.2302  24.4567  24.5531
+ 0.5N  / 47:  23.9915  23.7576  23.9781  24.1197  24.1823
+ 0.17N / 46:  23.9163  23.7029  23.7877  23.8557  23.9069
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               138W     133W     128W     123W     118W     113W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....  24.3865  25.1672     ....     ....
+ 1.17N / 49:     ....     ....  24.1849  24.8227     ....     ....
+ 0.83N / 48:     ....     ....  24.0029  24.4567     ....     ....
+ 0.5N  / 47:     ....     ....  23.8746  24.1197     ....     ....
+ 0.17N / 46:     ....     ....  23.8096  23.8557     ....     ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4.8N / 6:  26.3655  26.1878  26.0268  25.9290  25.9885
+ 3.8N / 5:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 5.8N / 4:  26.6294  26.5670  26.5361  26.5638  26.6554
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:  26.4095  26.2510  26.1116  26.0348  26.0997
+ 3N   / 3:  25.5883  25.1978  24.9065  24.8097  24.9649
+ 1N   / 2:  24.2587  24.0860  23.9737  23.9488  24.0835
+ 1S   / 1:     ....     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:     ....     ....     ....     ....     ....
+ 3N   / 3:  25.5396  25.1885  24.9365  24.8326  24.9791
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 1S   / 1:  24.2763  24.2177  24.1436  24.0651  23.9786
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W    63.5W    61.5W  
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966  29.4136  29.5107
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191  29.4462  29.5279
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689  29.4873  29.5544
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330  29.5361  29.5888
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966  29.5858  29.6187
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX002)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W  
+                 1        2        3
+ 1.5N  / 50:     ....     ....  29.5035
+ 1.17N / 49:     ....     ....  29.5373
+ 0.83N / 48:     ....     ....  29.6002
+ 0.5N  / 47:     ....     ....  29.6787
+ 0.17N / 46:     ....     ....  29.7929
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W    63.5W  
+                 1        2        3        4
+ 1.5N  / 50:     ....     ....  29.5035  29.4136
+ 1.17N / 49:     ....     ....  29.5373  29.4462
+ 0.83N / 48:     ....     ....  29.6002  29.4873
+ 0.5N  / 47:     ....     ....  29.6787  29.5361
+ 0.17N / 46:     ....     ....  29.7929  29.5858
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                85W      80W      75W      70W      65W      60W      55W      50W      45W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....     ....     ....  29.4009     ....     ....     ....     ....
+ 1.17N / 49:     ....     ....     ....     ....  29.4259     ....     ....     ....     ....
+ 0.83N / 48:     ....     ....     ....     ....  29.4735     ....     ....     ....     ....
+ 0.5N  / 47:     ....     ....     ....     ....  29.5338     ....     ....     ....     ....
+ 0.17N / 46:     ....     ....     ....     ....  29.5939     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W    
+                 1        2        3
+ 1.5N  / 50:  27.2194  27.9470     ....
+ 1.17N / 49:  27.1122  27.8883     ....
+ 0.83N / 48:  26.9645  27.7639     ....
+ 0.5N  / 47:  26.7776  27.5584     ....
+ 0.17N / 46:  26.5410  27.2770     ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W      66W    
+                 1        2        3        4
+ 1.5N  / 50:  27.2194  27.9470     ....  29.3528
+ 1.17N / 49:  27.1122  27.8883     ....  29.3882
+ 0.83N / 48:  26.9645  27.7639     ....  29.4644
+ 0.5N  / 47:  26.7776  27.5584     ....  29.5482
+ 0.17N / 46:  26.5410  27.2770     ....  29.6283
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                92W      89W      86W      83W      80W      77W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....  27.3039  27.5576  27.8497     ....     ....
+ 1.17N / 49:     ....  27.1874  27.4131  27.7695     ....     ....
+ 0.83N / 48:     ....  27.0366  27.2528  27.6362     ....     ....
+ 0.5N  / 47:     ....  26.8545  27.0851  27.4401     ....     ....
+ 0.17N / 46:     ....  26.6303  26.8980  27.1822     ....     ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               101W      95W      89W      83W      77W      71W      65W      59W      53W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....  27.3039  27.8497     ....     ....  29.3867     ....     ....
+ 1.17N / 49:     ....     ....  27.1874  27.7695     ....     ....  29.4183     ....     ....
+ 0.83N / 48:     ....     ....  27.0366  27.6362     ....     ....  29.4828     ....     ....
+ 0.5N  / 47:     ....     ....  26.8545  27.4401     ....     ....  29.5548     ....     ....
+ 0.17N / 46:     ....     ....  26.6303  27.1822     ....     ....  29.6233     ....     ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+ 15-JAN-1982 00 / 1:  27.7767
+ 21-JAN-1982 00 / 2:  27.7818
+ 27-JAN-1982 00 / 3:  27.6992
+ 02-FEB-1982 00 / 4:  27.8253
+ 08-FEB-1982 00 / 5:  27.7319
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.7767
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX004)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G007_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=161W:158W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=161.5W:157.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=161W:158W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=161.5W:157.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+         FCN_NOR   FCN_REV
+J /  1:  0.633194 -0.633194
+J /  2:  0.645479 -0.645479
+J /  3:  0.499729 -0.499729
+J /  4:  0.231628 -0.231628
+J /  5: -0.093184  0.093184
+J /  6: -0.395181  0.395181
+J /  7: -0.600424  0.600424
+J /  8: -0.658663  0.658663
+J /  9: -0.555637  0.555637
+J / 10: -0.316573  0.316573
+J / 11:  0.000000  0.000000
+J / 12:  0.316573 -0.316573
+J / 13:  0.555637 -0.555637
+J / 14:  0.658663 -0.658663
+J / 15:  0.600424 -0.600424
+J / 16:  0.395181 -0.395181
+J / 17:  0.093184 -0.093184
+J / 18: -0.231628  0.231628
+J / 19: -0.499729  0.499729
+J / 20: -0.645479  0.645479
+J / 21: -0.633194  0.633194
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+               180E    
+                51
+ 8N   / 19:  0.499729
+ 7N   / 18:  0.231628
+ 6N   / 17: -0.093184
+ 5N   / 16: -0.395181
+ 4N   / 15: -0.600424
+ 3N   / 14: -0.658663
+ 2N   / 13: -0.555637
+ 1N   / 12: -0.316573
+ 0    / 11:  0.000000
+ 1S   / 10:  0.316573
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[gx=@ave]   ! no target grid specified
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=u,g=w]   ! more than 1 target grid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 57 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 55 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 45 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 43 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 39 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 36 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 33 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 34 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ reading TEMP     M: 28 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M: 22 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 22 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 21 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 16 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M: 12 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 11 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:  7 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 27 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6373  25.0615  25.4410
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8705  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6495
+ 1N    / 48:  24.1494  24.2321  24.4464  24.8164  25.1767  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6691  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 24 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 49 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 49 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 49 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 48 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  6 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 40 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 37 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 32 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 19 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2012  24.2556  24.4066  24.7485  25.2133  25.5037
+ 1N    / 48:  24.0581  24.0827  24.1835  24.4473  24.8567  25.1333
+ 0.67N / 47:  23.9772  23.9643  23.9994  24.1601  24.4838  24.7472
+ 0.33N / 46:  23.9584  23.9040  23.8788  23.9333  24.1419  24.3790
+ 0     / 45:  24.0357  23.9390  23.8536  23.8172  23.9069  24.0855
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9325  23.9890  24.1393  24.4928  25.0067  25.3582
+ 1N    / 48:  23.7314  23.7626  23.8716  24.1488  24.6053  24.9421
+ 0.67N / 47:  23.5951  23.5875  23.6312  23.8060  24.1706  24.4921
+ 0.33N / 46:  23.5385  23.4834  23.4619  23.5233  23.7598  24.0491
+ 0     / 45:  23.6210  23.5135  23.4199  23.3768  23.4767  23.6893
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 13 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2921  24.2593  24.2798  24.4459  24.8288  25.2942
+ 1N    / 48:  24.1296  24.0952  24.0995  24.2165  24.5387  24.9629
+ 0.67N / 47:  24.0124  23.9735  23.9541  24.0061  24.2416  24.6067
+ 0.33N / 46:  23.9590  23.9098  23.8662  23.8516  23.9772  24.2614
+ 0     / 45:  23.9901  23.9230  23.8503  23.7816  23.8003  23.9828
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0517  24.0117  24.0305  24.1957  24.5888  25.1042
+ 1N    / 48:  23.8384  23.7998  23.8085  23.9326  24.2677  24.7399
+ 0.67N / 47:  23.6606  23.6190  23.6065  23.6697  23.9240  24.3347
+ 0.33N / 46:  23.5549  23.5048  23.4677  23.4600  23.6025  23.9282
+ 0     / 45:  23.5662  23.4962  23.4251  23.3553  23.3775  23.5902
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2879  24.3481  24.5174  24.8892  25.3674  25.6544
+ 1N    / 48:  24.1297  24.1691  24.2950  24.5979  25.0350  25.3185
+ 0.67N / 47:  24.0177  24.0235  24.0914  24.3037  24.6703  24.9403
+ 0.33N / 46:  23.9678  23.9342  23.9391  24.0467  24.3128  24.5631
+ 0     / 45:  23.9971  23.9215  23.8662  23.8753  24.0244  24.2322
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0365  24.0951  24.2619  24.6460  25.1734  25.5187
+ 1N    / 48:  23.8319  23.8758  24.0055  24.3208  24.8060  25.1502
+ 0.67N / 47:  23.6632  23.6751  23.7514  23.9774  24.3880  24.7171
+ 0.33N / 46:  23.5668  23.5355  23.5465  23.6647  23.9652  24.2706
+ 0     / 45:  23.5798  23.4985  23.4409  23.4500  23.6182  23.8692
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:  1 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.1864  24.1787  24.2594  24.5105  24.9134  25.2830
+ 1N    / 48:  24.0384  24.0160  24.0566  24.2448  24.5882  24.9167
+ 0.67N / 47:  23.9476  23.9116  23.9036  24.0029  24.2600  24.5428
+ 0.33N / 46:  23.9212  23.8644  23.8142  23.8259  23.9786  24.2058
+ 0     / 45:  23.9919  23.9089  23.8177  23.7561  23.8046  23.9579
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9233  23.9145  23.9973  24.2541  24.6864  25.1105
+ 1N    / 48:  23.7149  23.6938  23.7438  23.9462  24.3212  24.7033
+ 0.67N / 47:  23.5646  23.5317  23.5324  23.6475  23.9375  24.2709
+ 0.33N / 46:  23.4951  23.4409  23.3953  23.4150  23.5931  23.8658
+ 0     / 45:  23.5673  23.4804  23.3851  23.3179  23.3746  23.5590
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2284  24.3311  24.5775  24.9809  25.3585  25.4979
+ 1N    / 48:  24.0704  24.1331  24.3154  24.6520  24.9950  25.1205
+ 0.67N / 47:  23.9708  23.9819  24.0798  24.3220  24.6155  24.7426
+ 0.33N / 46:  23.9312  23.8914  23.9061  24.0376  24.2605  24.3979
+ 0     / 45:  23.9874  23.8963  23.8354  23.8620  23.9962  24.1237
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9608  24.0642  24.3160  24.7497  25.1824  25.3725
+ 1N    / 48:  23.7470  23.8171  24.0102  24.3770  24.7737  24.9496
+ 0.67N / 47:  23.5913  23.6093  23.7186  23.9883  24.3314  24.5067
+ 0.33N / 46:  23.5110  23.4726  23.4926  23.6415  23.9044  24.0873
+ 0     / 45:  23.5673  23.4667  23.3983  23.4267  23.5830  23.7431
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 52 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 20 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 56 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 44 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 41 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7799  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5330  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2438  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9739  25.1064
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 41 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 41 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 35 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 35 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2029  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  9 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  5 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 47 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7800  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5331  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2439  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9740  25.1065
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 50 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 50 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3316  24.1982  24.1149  24.1101  24.2698  24.6194
+ 1N    / 48:  24.1534  24.0459  23.9640  23.9283  24.0343  24.3289
+ 0.67N / 47:  24.0296  23.9427  23.8693  23.8085  23.8334  24.0392
+ 0.33N / 46:  23.9776  23.9013  23.8273  23.7484  23.7068  23.8063
+ 0     / 45:  24.0264  23.9547  23.8708  23.7728  23.6845  23.6853
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0998  23.9419  23.8502  23.8473  24.0126  24.3725
+ 1N    / 48:  23.8568  23.7289  23.6389  23.6068  23.7315  24.0484
+ 0.67N / 47:  23.6628  23.5633  23.4870  23.4278  23.4670  23.7064
+ 0.33N / 46:  23.5593  23.4735  23.4013  23.3239  23.2836  23.4092
+ 0     / 45:  23.6053  23.5232  23.4384  23.3380  23.2391  23.2432
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 50 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 54 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3718  24.2759  24.2381  24.3143  24.5845  24.9998
+ 1N    / 48:  24.1915  24.1099  24.0666  24.1084  24.3268  24.6951
+ 0.67N / 47:  24.0557  23.9849  23.9336  23.9307  24.0730  24.3751
+ 0.33N / 46:  23.9834  23.9165  23.8564  23.8115  23.8637  24.0759
+ 0     / 45:  23.9966  23.9258  23.8496  23.7701  23.7430  23.8530
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1479  24.0348  23.9902  24.0651  24.3406  24.7844
+ 1N    / 48:  23.9151  23.8193  23.7735  23.8199  24.0509  24.4498
+ 0.67N / 47:  23.7150  23.6338  23.5826  23.5862  23.7461  24.0841
+ 0.33N / 46:  23.5857  23.5123  23.4548  23.4139  23.4780  23.7252
+ 0     / 45:  23.5750  23.4974  23.4222  23.3420  23.3139  23.4455
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2986  24.3714  24.5593  24.9405  25.4006  25.6571
+ 1N    / 48:  24.1387  24.1885  24.3309  24.6454  25.0684  25.3212
+ 0.67N / 47:  24.0238  24.0371  24.1191  24.3444  24.7020  24.9439
+ 0.33N / 46:  23.9705  23.9413  23.9571  24.0777  24.3415  24.5694
+ 0     / 45:  23.9960  23.9223  23.8745  23.8951  24.0474  24.2410
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0465  24.1179  24.3048  24.7018  25.2123  25.5259
+ 1N    / 48:  23.8411  23.8950  24.0422  24.3726  24.8452  25.1571
+ 0.67N / 47:  23.6700  23.6890  23.7799  24.0219  24.4252  24.7240
+ 0.33N / 46:  23.5701  23.5428  23.5650  23.6985  23.9987  24.2798
+ 0     / 45:  23.5791  23.4988  23.4489  23.4714  23.6448  23.8804
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 58 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 60 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 59 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 60 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2294  24.1666  24.1789  24.3348  24.6565  25.0363
+ 1N    / 48:  24.0720  24.0100  23.9961  24.1004  24.3654  24.6946
+ 0.67N / 47:  23.9687  23.9085  23.8682  23.9032  24.0827  24.3496
+ 0.33N / 46:  23.9312  23.8643  23.7997  23.7720  23.8569  24.0495
+ 0     / 45:  23.9912  23.9110  23.8200  23.7410  23.7390  23.8465
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9767  23.9044  23.9159  24.0764  24.4158  24.8366
+ 1N    / 48:  23.7576  23.6884  23.6775  23.7944  24.0849  24.4571
+ 0.67N / 47:  23.5912  23.5281  23.4913  23.5379  23.7453  24.0569
+ 0.33N / 46:  23.5068  23.4390  23.3774  23.3540  23.4579  23.6911
+ 0     / 45:  23.5656  23.4806  23.3868  23.3018  23.3015  23.4336
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2444  24.3616  24.6223  25.0230  25.3769  25.4884
+ 1N    / 48:  24.0827  24.1577  24.3539  24.6907  25.0127  25.1114
+ 0.67N / 47:  23.9782  23.9985  24.1095  24.3557  24.6332  24.7370
+ 0.33N / 46:  23.9336  23.8998  23.9253  24.0636  24.2777  24.3972
+ 0     / 45:  23.9847  23.8969  23.8444  23.8789  24.0106  24.1269
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9764  24.0949  24.3635  24.7971  25.2062  25.3654
+ 1N    / 48:  23.7597  23.8423  24.0513  24.4207  24.7960  24.9418
+ 0.67N / 47:  23.5993  23.6266  23.7505  24.0264  24.3532  24.5021
+ 0.33N / 46:  23.5136  23.4812  23.5130  23.6709  23.9254  24.0877
+ 0     / 45:  23.5643  23.4665  23.4073  23.4453  23.5998  23.7470
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 62 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 61 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 64 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3636  24.2466  24.2047  24.2944  24.5700  24.9834
+ 1N    / 48:  24.1823  24.0808  24.0293  24.0856  24.3131  24.6721
+ 0.67N / 47:  24.0429  23.9555  23.8925  23.9012  24.0590  24.3508
+ 0.33N / 46:  23.9628  23.8852  23.8134  23.7743  23.8464  24.0554
+ 0     / 45:  23.9650  23.8885  23.8048  23.7281  23.7207  23.8377
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1405  24.0053  23.9571  24.0466  24.3282  24.7726
+ 1N    / 48:  23.9068  23.7900  23.7358  23.7995  24.0412  24.4324
+ 0.67N / 47:  23.7030  23.6045  23.5401  23.5583  23.7383  24.0672
+ 0.33N / 46:  23.5647  23.4813  23.4100  23.3756  23.4665  23.7136
+ 0     / 45:  23.5403  23.4591  23.3754  23.2961  23.2938  23.4386
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 63 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 66 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 65 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8829  23.9742  24.1489  24.3750  24.6256
+ 25-JAN-1982 00 / 3:  23.8850  23.9834  24.1657  24.3983  24.6503
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 65 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 66 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 66 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8838  23.9752  24.1501  24.3761  24.6265
+ 25-JAN-1982 00 / 3:  23.8774  23.9728  24.1535  24.3857  24.6381
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 66 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 69 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 70 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 72 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7485  23.7489  23.8463  24.0075  24.2057
+ 25-JAN-1982 00 / 3:  23.7481  23.7620  23.8678  24.0343  24.2309
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 73 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5859  29.5797  29.5756  29.5662  29.5590
+ 25-JAN-1982 00 / 3:  29.5787  29.5737  29.5698  29.5546  29.5421
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 74 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 77 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5747  29.5654  29.5513  29.5344  29.5265
+ 25-JAN-1982 00 / 3:  29.5636  29.5536  29.5355  29.5146  29.5054
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 76 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7784  23.7190  23.7799  23.9148  24.1031
+ 25-JAN-1982 00 / 3:  23.7745  23.7236  23.7888  23.9212  24.1104
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 78 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 80 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 81 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.9612  23.9499  24.0203  24.1507  24.3238
+ 25-JAN-1982 00 / 3:  23.9591  23.9559  24.0305  24.1636  24.3350
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 81 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 82 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7527  23.7638  23.8729  24.0446  24.2520
+ 25-JAN-1982 00 / 3:  23.7439  23.7321  23.8164  23.9658  24.1537
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 83 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 84 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 86 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 87 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 89 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 90 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 92 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 93 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 94 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 96 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 95 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 95 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 97 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 99 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 98 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 98 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:100 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:101 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:100 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:100 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:102 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:106 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:105 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:105 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:107 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:108 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:109 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:110 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:111 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:112 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:113 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:114 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:115 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:116 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:115 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:115 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:118 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:120 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 76   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:123 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:124 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 77   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:128 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:129 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:130 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:129 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 78   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:133 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:134 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:135 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:134 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M:136 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:134 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 79   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:139 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:140 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 80   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:144 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:145 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:146 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:145 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 81   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:149 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:150 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:151 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:150 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M:152 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:150 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 82   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:155 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:156 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:157 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:156 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 83   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:160 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:161 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:162 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:161 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:161 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:162 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 84   complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:165 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:166 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:167 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:166 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 85   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:170 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:172 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:171 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:172 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 86   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:175 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:176 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:177 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:176 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:176 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:177 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:178 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:177 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 87   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:181 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:182 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:182 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:182 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:182 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 88   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:186 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 89   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:189 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:190 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 90   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:192 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:193 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:194 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:193 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 91   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:196 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:197 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:196 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:196 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:197 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 92   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:200 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 93   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:202 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:203 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:204 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:203 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 94   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:205 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:206 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:207 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:206 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:206 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:207 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 95   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:209 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:210 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:211 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:210 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 96   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:214 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:214 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 97   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:215 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:216 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:217 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:216 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 98   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:218 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:219 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:220 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:219 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:219 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:220 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 99   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:222 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:223 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:222 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:223 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:223 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 100  complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:225 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:226 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:226 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:226 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:226 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 101  complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:229 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ reading TEMP     M:231 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ reading TEMP     M:233 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 102  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:236 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:237 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:239 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:240 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 103  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:242 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:244 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:245 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:244 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 104  complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:248 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:249 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:248 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:248 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:249 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 105  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:252 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:254 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:255 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 106  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:257 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:259 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:260 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:259 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 107  complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:261 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:263 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:264 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:263 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:263 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:264 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 108  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:266 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:267 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:268 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:267 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:270 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:271 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:270 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 109  complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:272 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:273 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:273 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:273 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:273 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 110  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:276 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:277 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:279 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:280 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 111  complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:282 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:284 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:285 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:284 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 112  complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:288 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:289 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:288 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:288 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:289 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 113  complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:292 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:293 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:292 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 114  complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:294 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:294 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:297 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  4.50000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at var] ! should be all missing
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ -DELETE X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  5.40000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at var]
+ -DELETE X        M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:       ....
+ 2.1 / 2:       ....
+ 3.1 / 3:       ....
+ 4.1 / 4:       ....
+ 5.1 / 5:  0.0900000
+ 6.1 / 6:       ....
+ 7.1 / 7:       ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:294 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:295 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:295 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:295 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 5.1 / 5:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:295 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:296 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:296 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:295 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:295 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:295 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  0.10000  0.90000     ....     ....
+ 5.1 / 5:     ....     ....     ....  0.90000  8.10000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:295 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:295 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:295 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:296 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:296 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:295 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:295 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:295 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.1000  11.0000     ....
+ 5.1 / 5:     ....     ....     ....  10.1000  10.2000  11.1000     ....
+ 6.1 / 6:     ....     ....     ....  11.0000  11.1000  12.0000     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:295 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:295 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:296 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:296 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....   0.1000   1.0100   0.9900     ....
+ 5.1 / 5:     ....     ....     ....   1.0100  10.2000   9.9900     ....
+ 6.1 / 6:     ....     ....     ....   0.9900   9.9900   9.7200     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:295 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:295 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:296 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:296 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:295 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:295 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:295 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1       2.1       3.1       4.1       5.1       6.1       7.1    
+               1         2         3         4         5         6         7
+ 1.1 / 1:      ....      ....      ....      ....      ....      ....      ....
+ 2.1 / 2:      ....      ....      ....      ....      ....      ....      ....
+ 3.1 / 3:      ....      ....      ....      ....      ....      ....      ....
+ 4.1 / 4:      ....      ....      ....      ....      ....      ....      ....
+ 5.1 / 5:      ....      ....      ....      ....  0.000000      ....      ....
+ 6.1 / 6:      ....      ....      ....      ....      ....      ....      ....
+ 7.1 / 7:      ....      ....      ....      ....      ....      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:296 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:298 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:301 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:294 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:299 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:300 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:294 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:300 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:294 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:294 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:294 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.50000
+ 6.1 / 6:  6.50000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:301 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MIN
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:297 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE X        M:298 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:297 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @SUM
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:   8.8500
+ 6.1 / 6:  12.2000
+ 7.1 / 7:   1.9500
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ -DELETE X        M:297 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G008)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:295 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.50000
+ 2   / 2:  1.50000
+ 3   / 3:  2.50000
+ 4   / 4:  3.50000
+ 5   / 5:  5.50000
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:295 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:297 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:296 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:294 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:298 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:301 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:301 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  2.50000
+ 4   / 4:     ....
+ 5   / 5:     ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:299 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:301 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    3    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:298 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.50000
+list a5[gx=x5 at max,i=4]
+ -DELETE X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:298 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    4    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ -DELETE X        M:298 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:294 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:294 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:294 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G006)           @MAX
+ eval    ATIME    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:294 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ regrid  ATIME    M:297 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset		! reordered reset before next test: 2/94
+cancel mode verify
+GO bn_axis_limits	! added 10/27/93
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! added 2/94
+ 
+!GO bn_reset
+!GO bn301_mem_mgmt
+MESSAGE/CONTINUE  ***** bn301_mem_mgmt has been removed from run_all.
+***** bn301_mem_mgmt has been removed from run_all.
+MESSAGE/CONTINUE  ***** Its too slow!!!
+***** Its too slow
+MESSAGE/CONTINUE  ***** Remember to run it separately
+***** Remember to run it separately
+ 
+GO bn_reset
+cancel mode verify
+GO bn_movie
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+ 
+! added in bn311
+GO bn_reset
+cancel mode verify
+GO bn_ez_order	! was bn311 until 9/95
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+              1        2     
+              1        2
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+ ---- K:2 Z:   2
+ 1   / 1:     ....     ....
+ 2   / 2:     ....     ....
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.20000
+ 2   / 2:  0.30000  0.40000
+ ---- K:2 Z:   2
+ 1   / 1:  0.50000  0.60000
+ 2   / 2:  0.70000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.00000
+ 2   / 2:  1.10000  1.20000
+ ---- K:2 Z:   2
+ 1   / 1:  1.30000  1.40000
+ 2   / 2:  1.50000  1.60000
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.50000
+ 2   / 2:  0.20000  0.60000
+ ---- K:2 Z:   2
+ 1   / 1:  0.30000  0.70000
+ 2   / 2:  0.40000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.30000
+ 2   / 2:  1.00000  1.40000
+ ---- K:2 Z:   2
+ 1   / 1:  1.10000  1.50000
+ 2   / 2:  1.20000  1.60000
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.020000
+ 2   / 2:  0.030000  0.040000
+ ---- K:2 Z:   2
+ 1   / 1:  0.050000  0.060000
+ 2   / 2:  0.070000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.100000
+ 2   / 2:  0.110000  0.120000
+ ---- K:2 Z:   2
+ 1   / 1:  0.130000  0.140000
+ 2   / 2:  0.150000  0.160000
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.050000
+ 2   / 2:  0.020000  0.060000
+ ---- K:2 Z:   2
+ 1   / 1:  0.030000  0.070000
+ 2   / 2:  0.040000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.130000
+ 2   / 2:  0.100000  0.140000
+ ---- K:2 Z:   2
+ 1   / 1:  0.110000  0.150000
+ 2   / 2:  0.120000  0.160000
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  1367.00
+ 2   / 2:  2357.00  2367.00
+ ---- K:2 Z:   2
+ 1   / 1:  1457.00  1467.00
+ 2   / 2:  2457.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  1368.00
+ 2   / 2:  2358.00  2368.00
+ ---- K:2 Z:   2
+ 1   / 1:  1458.00  1468.00
+ 2   / 2:  2458.00  2468.00
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+ 
+! added in bn312  6/3/94
+GO bn_reset
+cancel mode verify
+! cancel mode metafile   ! needed temporarily 6/94: PLOT+/XGKS interaction bug
+GO bn_user
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+set window 1		! clean up
+ 
+! added in bn420  1/96
+GO bn_reset
+cancel mode verify
+GO bn_stream
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:   1.0000   2.0000   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000  17.0000  18.0000  19.0000  20.0000
+ 3   / 3:  21.0000  22.0000  23.0000  24.0000  25.0000  26.0000  27.0000  28.0000  29.0000  30.0000
+ 4   / 4:  31.0000  32.0000  33.0000  34.0000  35.0000  36.0000  37.0000  38.0000  39.0000  40.0000
+ 5   / 5:  41.0000  42.0000  43.0000  44.0000  45.0000  46.0000  47.0000  48.0000  49.0000  50.0000
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+              MYV1    MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.0000  31.0000
+2    /  2:  12.0000  32.0000
+3    /  3:  13.0000  33.0000
+4    /  4:  14.0000  34.0000
+5    /  5:  15.0000  35.0000
+6    /  6:  16.0000  36.0000
+7    /  7:  17.0000  37.0000
+8    /  8:  18.0000  38.0000
+9    /  9:  19.0000  39.0000
+10   / 10:  20.0000  40.0000
+ ---- J:2 Y:   2
+1    /  1:  21.0000  41.0000
+2    /  2:  22.0000  42.0000
+3    /  3:  23.0000  43.0000
+4    /  4:  24.0000  44.0000
+5    /  5:  25.0000  45.0000
+6    /  6:  26.0000  46.0000
+7    /  7:  27.0000  47.0000
+8    /  8:  28.0000  48.0000
+9    /  9:  29.0000  49.0000
+10   / 10:  30.0000  50.0000
+cancel data stream_data_link.unf
+ 
+ 
+!added in bn430 9/96 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_mc
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     T (hour)             6 r   366                  4018.4
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              730.485    731.2425
+       3>  1826.97               730.485    1461.727
+       4>  2557.455              730.485    2192.213
+       5>  3287.94               730.485    2922.698
+       6>  4018.425              730.485    3653.182
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 1827   / 3:  28.2710  28.1010  27.1568  26.6065  26.5793  27.1318  27.1135  27.1007
+ 2557.5 / 4:  28.3570  28.5412  27.6643  27.2819  27.1998  27.4282  27.5459  27.4002
+ 3287.9 / 5:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+ 4018.4 / 6:  28.0824  27.9723  27.7204  26.8768  26.9810  27.7220  28.0643  27.8845
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 1827   / 3:  27.9375  27.9731  27.8331  27.5333  27.0461  27.2091  27.2154  27.0734  26.8618  26.6585
+ 2557.5 / 4:  27.9532  27.8072  27.9180  27.9515  27.7807  27.6695  27.5253  27.3922  27.3396  27.2409
+ 3287.9 / 5:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 4018.4 / 6:  28.1912  28.2880  28.4249  28.1785  27.8359  27.8262  27.5394  27.3811  27.1444  27.0317
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     T (hour)             3 i   366                  3287.9
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              1460.97    731.2425
+       3>  3287.94               2191.455   2192.213
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 3287.9 / 3:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 3287.9 / 3:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-T (hour))
+      ... listing every  14th point
+                21E      49E      77E     105E     133E     161E     171W     143W     115W      87W      59W      31W      3W     
+                 1       15       29       43       57       71       85       99      113      127      141      155      169
+ ---- L:1 T:   366
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75N   / 83:   1.5550     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73N   / 82:   3.7205   0.5871     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.0000
+ 71N   / 81:   5.0934   0.6186     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   4.1287
+ 69N   / 80:   5.4500   0.4500     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.0000   4.8885
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   4.3120   4.5952
+ 65N   / 78:   0.0718     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.8767   5.0952   5.2194
+ 63N   / 77:   0.5111     ....     ....     ....     ....     ....  -0.8467     ....     ....     ....   0.8500   5.9579   6.4264
+ 61N   / 76:   1.2269     ....     ....     ....     ....   0.3500   0.1214   6.0000     ....     ....   0.8000   6.2213   8.1800
+ 59N   / 75:   2.9000     ....     ....     ....     ....   1.1500   1.6321   5.7458     ....     ....   2.7033   7.3962   7.6307
+ 57N   / 74:   3.0388     ....     ....     ....     ....   1.1250   2.8750   5.2914     ....     ....   0.5308   7.5317   6.4543
+ 55N   / 73:   3.2013     ....     ....     ....     ....   0.6459   3.6936   5.2583     ....     ....  -0.4622   7.4551   6.5806
+ 53N   / 72:     ....     ....     ....     ....     ....   1.1996   4.2880   5.7998     ....     ....   1.2333   7.7514   7.1047
+ 51N   / 71:     ....     ....     ....     ....     ....   2.1893   4.2290   6.2278     ....     ....  -0.2905  10.2702   9.3957
+ 49N   / 70:     ....     ....     ....     ....     ....   2.5412   4.6069   6.6250     ....   3.0125   0.6527  11.6186  10.2970
+ 47N   / 69:     ....     ....     ....     ....     ....   2.9602   5.5956   7.6881     ....   3.1794   1.2426  12.6823  11.3385
+ 45N   / 68:     ....   3.3167     ....     ....     ....   4.4480   7.0744   8.9556     ....   3.4525   2.2314  13.7819  12.2254
+ 43N   / 67:     ....   4.7221     ....     ....   2.4068   6.9255   8.9646  10.3486     ....   3.1277   6.3709  14.7211  13.0557
+ 41N   / 66:     ....   4.8365     ....     ....   4.3635   9.6898  10.9751  11.9288     ....     ....  15.5498  15.4318     ....
+ 39N   / 65:  15.4366   8.6262     ....     ....   8.8837  12.8097  12.5484  13.4077     ....     ....  18.6870  16.2119     ....
+ 37N   / 64:  16.0318   8.0667     ....     ....  12.3600  15.0324  13.9800  15.0021     ....     ....  19.2616  17.1874  15.1152
+ 35N   / 63:  16.2507     ....     ....     ....  13.3810  16.7364  15.4538  16.4689     ....     ....  19.5398  18.1828  15.5754
+ 33N   / 62:  16.7783     ....     ....     ....  18.5491  18.0244  16.8419  17.7790     ....     ....  20.1041  19.2886     ....
+ 31N   / 61:  17.9786     ....     ....     ....  19.9407  19.3074  18.5523  19.1648  17.8500  17.4183  20.8400  20.0450     ....
+ 29N   / 60:     ....  18.9119     ....     ....  20.5019  20.6291  20.1257  20.1026  16.8274  20.6176  22.0740  20.6790     ....
+ 27N   / 59:     ....  20.8300     ....     ....  21.3326  22.0026  21.6086  20.9032  17.8323  23.7582  23.1533  21.5070     ....
+ 25N   / 58:     ....     ....     ....     ....  22.3495  23.8248  23.2779  21.5841  18.8269  24.8593  24.0919  22.3336     ....
+ 23N   / 57:     ....     ....     ....     ....  23.6807  25.0783  24.0186  22.3034  20.2700  25.5195  24.7930  22.7905     ....
+ 21N   / 56:     ....     ....     ....     ....  24.7072  25.9688  24.7256  22.9079  22.0270  26.4860  25.3493  22.9386     ....
+ 19N   / 55:     ....     ....     ....  22.6383  25.9015  26.6802  25.6078  23.5313  23.8074  27.0339  25.8612  23.4342     ....
+ 17N   / 54:     ....     ....     ....     ....  26.8579  27.0091  25.9585  24.1694  25.2841  27.0695  26.1928  23.8282     ....
+ 15N   / 53:     ....  25.4074     ....     ....  27.4243  27.0312  26.1212  24.8069  26.3029  26.9280  26.3665  24.2289     ....
+ 13N   / 52:     ....  25.3684     ....     ....  27.7591  27.2962  26.4994  25.1181  26.6522  26.8229  26.6502  24.8118     ....
+ 11N   / 51:     ....  25.8188  27.8253  27.8789  27.8781  27.9126  26.8606  25.7058  27.0455  26.2577  26.8927  25.3867     ....
+ 9N    / 50:     ....  27.2000  27.8411  26.3897  28.1118  28.0045  27.4964  26.6136  26.7775  26.8093  27.0323  25.9038     ....
+ 7N    / 49:     ....  26.1127  27.5677  26.0238  28.0494  28.7383  27.8221  27.0807  26.9304  27.5097  26.8869  26.5924     ....
+ 5N    / 48:     ....  26.1020  27.8127  26.5939  28.3079  28.7465  28.1379  27.1305  27.5967  27.5257     ....  26.9872  27.8152
+ 3N    / 47:     ....  26.2525  27.9241  26.8579  28.5464  28.9967  27.6071  26.2341  25.5129  27.0847     ....  27.0516  28.3003
+ 1N    / 46:     ....  26.4437  28.2462  27.2532  28.7823  28.7893  27.5856  25.9683  24.2075  25.8155     ....  27.0482  27.9197
+ 1S    / 45:     ....  27.0068  28.1397  27.7957  28.9633  29.1200  27.9352  26.0170  24.4768  24.9226     ....  27.0957  27.0229
+ 3S    / 44:     ....  27.6137  28.2304  27.5868  28.9390  29.4694  27.9904  26.2519  24.6900  24.9094     ....  27.1568  26.8912
+ 5S    / 43:     ....  28.2419  28.1710  28.0148  28.8535  29.6225  28.6900  26.6985  24.8254  25.1700     ....  27.1489  26.2070
+ 7S    / 42:     ....  28.7080  28.1502  28.3020  28.9045  29.3650  29.1496  27.0025  25.1069  24.9153     ....  27.3142  25.4034
+ 9S    / 41:     ....  28.4648  28.3721  28.3145  28.9483  29.3450  28.9944  28.0900  25.3219  24.4950     ....  27.2335  24.8536
+ 11S   / 40:     ....  28.0725  28.3709  28.1023  29.6033  29.3462  29.1837  28.2076  25.4194  24.1157     ....  27.2170  24.0960
+ 13S   / 39:     ....  28.1510  28.0187  27.8073  30.0000  29.1755  29.0507  28.1889  25.3569  23.7371     ....  27.3476  23.4967
+ 15S   / 38:     ....  28.0800  27.7714  27.2320     ....  28.6954  28.8358  28.2165  25.5737  22.9877     ....  27.0100  23.0127
+ 17S   / 37:     ....  28.2857  26.9409  26.4882     ....  28.2425  28.1673  27.9296  25.5046  22.3944     ....  26.7405  22.9133
+ 19S   / 36:     ....  27.6122  26.1967  25.0514     ....  27.7552  27.8560  27.5000  25.4854  21.0467     ....  26.6053  22.7264
+ 21S   / 35:     ....  27.5942  25.6929  24.4583     ....  26.3083  26.9939  27.2162  25.5969  21.8550     ....  26.4333  22.5890
+ 23S   / 34:     ....  27.0610  25.3542  23.6893     ....  26.0250  26.0238  26.6869  25.5377  21.5647     ....  26.5500  22.9482
+ 25S   / 33:     ....  26.6974  25.2817  22.6691     ....  25.5528  25.4389  25.4775  25.2041  21.3664     ....  25.4338  23.1510
+ 27S   / 32:     ....  25.8897  24.5000  22.1500     ....  24.8603  24.1297  24.3742  24.8067  21.0300     ....  24.8628  22.9100
+ 29S   / 31:     ....  24.6453  23.8583  21.1592     ....  24.0408  23.2608  23.1950  24.4300  21.1500     ....  23.4096  22.5004
+ 31S   / 30:     ....  23.8611  22.6739  20.5028     ....  23.2794  21.8597  21.8462  22.7130  21.3700     ....  22.5936  22.0041
+ 33S   / 29:     ....  22.1584  21.2131  19.2542  18.8470  22.4742  20.8053  20.6944  22.4667  20.3670     ....  20.5743  20.8167
+ 35S   / 28:  21.0773  20.5794  19.8725  18.4359  18.1523  22.1463  20.1823  19.6000  20.4500  19.2450  21.7333  19.9441  19.5977
+ 37S   / 27:  21.2868  19.1969  17.8018  16.7463  16.9175  20.0833  19.0935  18.1643  18.1575  18.4543     ....  18.6379  17.6856
+ 39S   / 26:  20.7459  17.5123  15.9600  14.8400  16.3010  18.3956  18.3997  16.9135  16.9625  17.0514  18.6879  16.7446  15.4764
+ 41S   / 25:  16.4473  14.4439  14.4573  13.5944  14.4030  17.4141  17.2206  15.2329     ....  15.7317  16.7885  14.7942  12.6567
+ 43S   / 24:  14.3660   8.5494  12.8214  11.9753  13.3524  15.0229  16.4218  13.6950     ....  13.6375  13.9769  12.5075  10.4100
+ 45S   / 23:   8.4925   7.5150  11.1860  10.5093  11.8445  13.9774  14.9780  13.0112     ....  12.0000  12.2990  10.5100   7.9967
+ 47S   / 22:   6.0621   5.7733   7.4400   9.0110  10.8888  13.2065  13.4630  11.6550     ....  10.2400  11.1783   8.6200   6.4500
+ 49S   / 21:   4.4209   4.2067   6.0325   6.1945   9.7129  10.8775  12.9344     ....     ....   9.3675  10.3435   5.2987   4.5450
+ 51S   / 20:   1.8375   3.6387   3.1564   5.7656   8.0480  10.0143  11.0070  10.9750     ....   9.2000   9.8156   3.6350   2.5350
+ 53S   / 19:   1.0891   2.8667   2.1950   4.1600   6.5630   9.4455   9.7660     ....     ....   8.5500   8.5604   2.1900   1.0550
+ 55S   / 18:   0.6469   2.6750   2.3478   4.1000   5.1560   6.5700   8.0000     ....   7.8000   7.8786   6.9458   1.3933   0.5425
+ 57S   / 17:   0.4114   2.0529   1.8425   2.4260   4.2929   4.7383   7.0125   3.9825     ....   6.8667   5.7852   0.7771   0.5529
+ 59S   / 16:   0.6236   1.3700   1.4776   2.0189   3.2000   4.0325   4.4000   1.8360     ....   6.5150   2.7940   0.0694   0.0558
+ 61S   / 15:   0.8438   1.3312   1.2144   1.2400   1.9900   2.2237   3.2143   0.8080   3.6867     ....   1.6781   0.0830   0.6620
+ 63S   / 14:   0.8813   0.7700   1.1575   0.4750   1.2344   1.1619   1.6000   0.5280   2.3275   3.4000   1.1667  -0.3333   0.4050
+ 65S   / 13:   0.3667  -0.0356   0.8123   0.0871   0.1521   0.3286   0.5200   0.4550   0.5067   1.8325  -0.9000  -0.5500   0.2060
+ 67S   / 12:  -0.6667  -0.9250   0.5317     ....     ....  -0.3906  -0.0233  -1.2000  -0.1537   0.8722     ....  -0.2533   0.2300
+ 69S   / 11:   0.0425     ....   1.2033     ....     ....  -0.6200  -0.1364     ....  -0.4150   0.1786     ....   0.5000   0.0700
+ 71S   / 10:     ....     ....     ....     ....     ....     ....  -0.7040   0.0000     ....     ....     ....  -1.0167  -1.0100
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -0.3500     ....     ....     ....     ....  -1.2000     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -1.1750     ....     ....     ....     ....  -0.4233     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6250     ....     ....     ....     ....  -0.8678     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:2 T:   1096.5
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.0000
+ 75N   / 83:   2.5283     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -1.5500
+ 73N   / 82:   4.0984   0.3050     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.1087
+ 71N   / 81:   4.6724   0.1046     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.7960
+ 69N   / 80:   4.1971   0.0000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.8097
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   3.7596   4.3979
+ 65N   / 78:  -0.0625     ....     ....     ....     ....     ....  -0.2000     ....     ....     ....   0.4221   4.4633   4.8655
+ 63N   / 77:   0.0745     ....     ....     ....     ....     ....  -1.7560     ....     ....     ....  -0.2712   5.8617   6.3740
+ 61N   / 76:   0.4814     ....     ....     ....     ....   2.4947  -1.5404   4.7000     ....     ....   2.1750   6.4468   7.9008
+ 59N   / 75:   1.6399     ....     ....     ....     ....   2.0000   0.0008   5.2586     ....     ....   1.3824   7.0788   6.9452
+ 57N   / 74:   2.0350     ....     ....     ....     ....   1.0500   2.0321   4.7989     ....     ....   1.5986   7.2850   5.6111
+ 55N   / 73:   2.0609     ....     ....     ....     ....   0.2492   3.3744   4.9032     ....     ....   1.1250   7.1357   5.8718
+ 53N   / 72:     ....     ....     ....     ....     ....   0.6807   3.7572   5.4648     ....     ....  -2.2000   7.5902   6.5032
+ 51N   / 71:     ....     ....     ....     ....     ....   1.6469   3.7090   5.7799     ....     ....  -1.1807  10.0328   8.4741
+ 49N   / 70:     ....     ....     ....     ....     ....   1.8588   4.3120   6.2452     ....     ....  -0.3648  11.3871   9.5089
+ 47N   / 69:     ....     ....     ....     ....     ....   2.3163   5.1206   7.3744     ....   1.9691  -0.0062  12.2219  10.1338
+ 45N   / 68:     ....   3.6500     ....     ....     ....   3.6392   6.7455   8.6209     ....   2.8224   0.9671  13.4022  11.7268
+ 43N   / 67:     ....   4.6473     ....     ....   1.3648   5.8679   8.5111   9.8453     ....   2.4835   5.0119  14.2248  12.1942
+ 41N   / 66:     ....   4.7861     ....     ....   3.0570   8.4719  10.3051  11.4213     ....     ....  14.7565  15.0002     ....
+ 39N   / 65:  15.0270   8.4385     ....     ....   7.3566  11.4912  12.1752  12.8504     ....     ....  18.0116  15.7098     ....
+ 37N   / 64:  15.3211     ....     ....     ....  10.8839  13.7783  13.3446  14.3616     ....     ....  18.5301  16.5598  14.7798
+ 35N   / 63:  15.5386     ....     ....     ....  11.5113  15.5093  14.6245  15.8741     ....     ....  18.7629  17.4589  15.1510
+ 33N   / 62:  16.0085     ....     ....     ....  18.0727  16.9360  16.0912  17.1296     ....     ....  19.2839  18.5539     ....
+ 31N   / 61:  15.5003     ....     ....     ....  19.3688  18.1290  17.7404  18.4996  16.6805  17.1886  20.0995  19.3186     ....
+ 29N   / 60:     ....  17.9540     ....     ....  19.6179  19.5035  19.2114  19.5065  16.2029  20.0335  21.3973  20.0384     ....
+ 27N   / 59:     ....  19.2895     ....     ....  20.5089  21.1212  20.6266  20.3709  17.2076  23.4895  22.6302  20.8561     ....
+ 25N   / 58:     ....     ....     ....     ....  21.6717  22.9821  22.7977  21.2932  18.4958  24.6577  23.6045  21.6921     ....
+ 23N   / 57:     ....     ....     ....     ....  23.0715  24.4551  23.5951  22.2253  19.8338  25.2474  24.2970  22.1740     ....
+ 21N   / 56:     ....     ....     ....     ....  24.4908  25.3921  24.3804  22.7672  21.2780  25.9320  24.9042  22.6199     ....
+ 19N   / 55:     ....     ....     ....  21.9809  25.6218  26.2087  25.0433  23.4827  23.0766  26.7496  25.4450  22.7637     ....
+ 17N   / 54:     ....     ....     ....     ....  26.5571  26.5915  25.7194  24.1352  24.9649  26.7912  25.7799  22.9853     ....
+ 15N   / 53:     ....  25.4092     ....     ....  27.2200  26.8560  25.9733  24.7324  26.0247  26.0114  26.0969  23.6629     ....
+ 13N   / 52:     ....  25.4771     ....     ....  27.5037  27.5150  26.1672  25.1314  26.5769  26.9127  26.4016  24.1635     ....
+ 11N   / 51:     ....  25.9857  28.0015  26.7764  27.5853  27.5652  26.8019  25.7690  27.0738  26.0525  26.6473  24.7404     ....
+ 9N    / 50:     ....  26.4544  28.2288  26.5501  27.7983  28.1491  27.4758  26.8996  26.9893  26.8687  26.7045  25.5850     ....
+ 7N    / 49:     ....  26.2609  27.8816  26.4870  27.6868  28.5162  27.7850  27.0898  27.0539  28.0777  26.7957  26.6243     ....
+ 5N    / 48:     ....  26.4131  27.9713  26.8734  27.7794  28.6949  27.8279  26.7964  26.6060  28.0647     ....  26.8913  28.0427
+ 3N    / 47:     ....  26.5913  28.1749  26.9865  28.4875  29.1712  27.8616  26.6257  26.2312  27.7434     ....  27.1225  28.5353
+ 1N    / 46:     ....  26.8491  28.6115  27.3775  28.2466  28.9555  27.5331  26.4050  26.4266  26.5208     ....  27.2455  28.5152
+ 1S    / 45:     ....  27.3064  28.4080  27.9040  28.4680  29.2010  27.7261  26.4751  24.6569  26.0235     ....  27.4196  27.9833
+ 3S    / 44:     ....  27.9602  28.2742  28.3296  28.8893  29.5794  28.3834  26.5213  25.4925  26.6125     ....  27.6638  27.3859
+ 5S    / 43:     ....  28.2396  28.0572  28.3176  28.7901  29.3721  28.2957  26.7982  25.7981  26.6252     ....  27.6334  27.2052
+ 7S    / 42:     ....  28.6815  28.2612  28.2786  28.7463  29.4168  28.8967  27.4410  26.1729  26.5534     ....  27.7374  26.6993
+ 9S    / 41:     ....  28.4790  28.3137  28.5841  28.7040  29.4256  29.1270  28.3372  25.9400  25.9795     ....  27.6607  26.1480
+ 11S   / 40:     ....  28.2829  28.6414  28.3339  29.3503  29.1771  29.1492  28.2032  25.9871  25.9624     ....  27.5419  25.5310
+ 13S   / 39:     ....  28.3226  28.3738  28.5679     ....  29.0269  29.1852  28.3130  25.7940  25.0490     ....  27.3347  25.0641
+ 15S   / 38:     ....  27.6600  28.2896  27.7713     ....  28.8387  29.0820  28.4626  25.9384  24.0311     ....  27.4378  24.5993
+ 17S   / 37:     ....  28.0370  27.5108  27.3368     ....  28.5764  28.4527  27.9555  26.0744  23.1143     ....  27.5051  24.0454
+ 19S   / 36:     ....  27.7741  27.0157  26.4074     ....  28.0387  28.2036  28.0002  26.1485  23.5125     ....  27.4665  23.8172
+ 21S   / 35:     ....  27.5781  26.3341  25.2805     ....  26.9356  27.5820  27.6097  26.0473  22.5984     ....  27.0379  23.6919
+ 23S   / 34:     ....  27.4302  26.2267  24.4780     ....  26.2735  26.9770  26.9149  25.9504  22.6780     ....  27.2712  23.6569
+ 25S   / 33:     ....  27.1106  25.3692  23.3572     ....  25.8933  25.9116  26.4028  25.5674  21.8153     ....  26.4321  23.8424
+ 27S   / 32:     ....  26.2136  25.2324  22.5225     ....  25.1302  24.7613  25.0533  25.4781  22.3270     ....  26.0936  23.3768
+ 29S   / 31:     ....  25.1187  23.9464  21.6124     ....  24.6507  24.1035  24.0470  24.7712  21.6070     ....  25.1327  23.1977
+ 31S   / 30:     ....  24.1655  22.8869  20.9082     ....  23.9437  22.8024  22.8395  23.8185  21.6885     ....  23.6302  22.7434
+ 33S   / 29:     ....  23.0193  21.8809  19.7883  19.8276  23.0018  21.7527  21.3169  21.5627  21.0475     ....  22.6172  21.4319
+ 35S   / 28:  20.9734  21.1547  20.7043  18.8851  18.9300  22.5357  20.8505  20.5353  22.0240  20.2323  22.8700  20.8750  20.1989
+ 37S   / 27:  21.7237  19.9086  18.4469  17.2227  17.7141  20.7386  19.8244  18.3687  19.8411  19.7704     ....  19.5269  18.6070
+ 39S   / 26:  22.0397  18.3765  16.5437  15.5140  17.0989  19.0830  18.8514  17.5866     ....  18.7405  19.1255  18.2102  15.7730
+ 41S   / 25:  17.8526  16.3651  15.5023  14.2290  15.4274  17.6752  17.4792  15.9576  18.1650  17.1268  17.4312  16.4894  13.9250
+ 43S   / 24:  13.4949   9.2836  13.3727  12.3420  13.9432  16.1595  17.0221  14.6650  16.3947  14.2424  14.2672  14.1820  10.6937
+ 45S   / 23:   8.3840   7.6307  11.6679  11.2457  12.8452  14.4788  15.0178  13.5082     ....  12.0600  12.7115  10.9652   8.1250
+ 47S   / 22:   6.7167   6.0540   8.2500   9.1190  10.9825  12.8255  13.8707  12.4650     ....  10.8575  11.1699   8.5767   5.5000
+ 49S   / 21:   4.8858   5.4150   5.9088   6.2255  10.1339  11.2443  12.5930  11.4167     ....  10.0842  10.6338   7.4442   4.9572
+ 51S   / 20:   2.3210   3.9822   3.9846   5.7576   7.7675   9.9738  10.8426  10.1840     ....  10.0000  10.2138   5.1999   3.5755
+ 53S   / 19:   1.6715   3.2515   2.9610   4.1500   6.9224   8.5819   9.1357     ....     ....   8.1500   8.4738   3.8071   2.1017
+ 55S   / 18:   1.3318   3.1000   2.6454   3.0000   5.7914   6.1994   7.9489   6.6000     ....   7.7692   7.2001   1.8440   1.0135
+ 57S   / 17:   0.9767   1.9018   1.9953   2.7540   5.2543   4.5237   6.5740   3.7000     ....   7.5635   6.0275   1.7052   1.1491
+ 59S   / 16:   1.1588   2.1100   1.9107   2.7212   3.8002   3.8360   4.9089   1.7892     ....   6.7092   3.6242   1.2592   0.7025
+ 61S   / 15:   0.9937   1.7382   1.5836   2.3000   3.0766   2.3196   3.4012   1.9993     ....   4.4088   2.4941   0.0903   0.4673
+ 63S   / 14:   1.0650   1.2982   1.6343   1.2108   1.5136   1.6090   1.8151   1.2050     ....   3.1150   1.2840   0.3114   0.9075
+ 65S   / 13:   0.6686   0.1303   0.8185   0.2022   0.5104   0.3644   1.0079   0.2598   1.8500   1.8860   0.7000   0.0021   0.9191
+ 67S   / 12:   0.4623  -0.5492   0.0874     ....     ....  -0.0052  -0.2830  -0.0203   1.1982   0.4323  -0.5000   0.2120  -0.0205
+ 69S   / 11:  -0.3438     ....  -0.2335     ....     ....  -1.3365  -0.1277     ....  -0.2716  -0.3135     ....  -0.7000  -0.2723
+ 71S   / 10:     ....     ....     ....     ....     ....  -1.6000  -1.0248     ....  -1.0000     ....     ....  -1.5633  -0.9349
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -1.0216     ....     ....     ....     ....  -1.4771     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -0.6115     ....     ....     ....  -1.6061  -1.2224     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6974     ....     ....     ....     ....  -1.3728     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:3 T:   3287.9
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:   2.5000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.3750
+ 77N   / 84:   3.4400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6250
+ 75N   / 83:   2.6000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.8460
+ 73N   / 82:   4.4409   0.5100     ....     ....     ....     ....     ....     ....     ....     ....  -1.3667     ....  -0.8225
+ 71N   / 81:   5.4388   0.3400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.6240
+ 69N   / 80:   5.9773     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   7.0333   5.7596
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6000   6.2775   5.0971
+ 65N   / 78:   1.4558     ....     ....     ....     ....     ....  -0.2350     ....     ....     ....  -0.0333   5.5736   5.9673
+ 63N   / 77:   3.4200     ....     ....     ....     ....     ....   0.6400     ....     ....     ....  -1.6700   6.6186   7.9123
+ 61N   / 76:   3.4160     ....     ....     ....     ....   2.5655   0.7717   6.6667     ....     ....   1.8667   7.0529   8.8649
+ 59N   / 75:   5.6405     ....     ....     ....     ....   2.0611   0.9867   6.9750     ....     ....   2.0100   7.4621   8.4868
+ 57N   / 74:   5.9800     ....     ....     ....     ....   3.0850   2.7321   6.8916     ....     ....   0.9500   8.2306   8.5784
+ 55N   / 73:   8.0252     ....     ....     ....     ....   2.3115   4.5506   6.4479     ....     ....   3.7000   8.3973   9.5559
+ 53N   / 72:     ....     ....     ....     ....     ....   2.6937   4.8088   6.7680     ....     ....   2.8900   9.2218  10.4003
+ 51N   / 71:     ....     ....     ....     ....     ....   3.2503   4.9117   6.8015     ....     ....   2.5529  11.3034  10.8005
+ 49N   / 70:     ....     ....     ....     ....     ....   3.0545   5.1517   7.2869     ....   2.7152   3.2139  12.3364  11.3225
+ 47N   / 69:     ....   2.7000     ....     ....     ....   3.3659   5.8927   8.3193     ....   2.7223   3.4114  13.6252  13.5042
+ 45N   / 68:     ....  10.0571     ....     ....     ....   4.8410   7.4161   9.4102     ....   3.6258   3.8275  14.6266  14.1615
+ 43N   / 67:     ....  12.7416     ....     ....   6.7189   6.9232   9.1093  10.6638     ....   4.2112   7.7514  15.5934  14.2717
+ 41N   / 66:     ....  12.2736     ....     ....   9.4889  10.0966  11.2221  12.2000     ....   7.4752  17.0025  16.5220     ....
+ 39N   / 65:  18.3061  17.6344     ....     ....  13.1272  13.1707  13.2898  13.6927     ....     ....  20.0227  17.1398     ....
+ 37N   / 64:  18.5141  17.9063     ....     ....  15.3549  15.3983  15.0444  15.3707     ....     ....  20.4579  18.0923  17.5707
+ 35N   / 63:  18.7384     ....     ....     ....  16.8426  17.6000  16.7552  16.7829     ....     ....  20.4300  19.0107  17.7344
+ 33N   / 62:  18.9508     ....     ....     ....  21.5277  18.7307  18.1471  17.9534     ....     ....  21.0125  20.0088     ....
+ 31N   / 61:  18.7025     ....     ....     ....  22.5800  20.5256  20.0583  19.4733  17.4200  24.2768  21.8716  20.6057     ....
+ 29N   / 60:     ....  25.7695     ....     ....  22.5733  22.5723  21.6635  20.2684  16.2180  24.9511  23.1845  21.2752     ....
+ 27N   / 59:     ....  25.4122     ....     ....  23.6602  24.0498  22.5812  21.2723  16.7570  26.3925  24.2020  21.7641     ....
+ 25N   / 58:     ....     ....     ....     ....  25.2143  25.5321  24.3246  21.9995  17.9540  26.9720  24.9484  22.4602     ....
+ 23N   / 57:     ....     ....     ....     ....  26.6917  26.0579  24.8529  22.5776  20.2795  27.1909  25.5700  22.9362     ....
+ 21N   / 56:     ....     ....     ....     ....  27.8576  26.6563  25.3957  23.1102  22.1345  27.7200  26.0730  23.0700     ....
+ 19N   / 55:     ....     ....     ....  26.8300  28.4227  27.1402  25.9305  23.6595  23.7516  28.1905  26.6716  23.3293     ....
+ 17N   / 54:     ....     ....     ....     ....  28.8737  27.3141  26.3835  24.2809  25.2149  28.3251  27.0405  23.5656     ....
+ 15N   / 53:     ....  29.6770     ....     ....  29.0020  27.5648  26.8352  25.0370  26.4873  28.2522  27.1788  24.0619     ....
+ 13N   / 52:     ....  29.7957     ....     ....  29.0452  27.9505  26.9712  25.7979  27.9270  29.0510  27.4940  24.9544     ....
+ 11N   / 51:     ....  29.9600  29.6100  29.9485  29.1975  28.5281  27.2419  26.2275  28.2569  28.6935  27.4943  25.4832     ....
+ 9N    / 50:     ....  29.0000  29.2055  29.9940  29.1339  28.5629  28.0300  26.8865  28.1333  28.7602  27.5655  26.2932     ....
+ 7N    / 49:     ....  28.0975  29.2157  29.8208  29.1260  28.9489  28.3765  27.6896  27.9185  28.6481  27.8075  26.9731     ....
+ 5N    / 48:     ....  28.5837  28.9960  29.6031  29.2848  28.8200  28.2841  28.0367  28.0050  28.1459     ....  27.4683  28.6742
+ 3N    / 47:     ....  28.8228  28.8738  29.6720  29.1708  29.1114  27.9356  27.4223  27.0792  27.4624     ....  27.7005  28.7616
+ 1N    / 46:     ....  28.9241  28.9488  29.6711  29.2204  29.2053  27.9759  26.7708  26.2331  24.6843     ....  27.7243  28.5300
+ 1S    / 45:     ....  28.8412  28.8305  29.7569  29.3532  29.1575  28.6016  27.3479  26.1727  23.7911     ....  27.7941  27.3629
+ 3S    / 44:     ....  28.7131  28.7504  29.7065  28.8744  29.3853  29.0300  27.7041  26.2321  24.2555     ....  27.9582  27.0115
+ 5S    / 43:     ....  28.2603  28.5437  29.3988  28.6953  29.4181  29.4700  28.0004  26.6977  25.2607     ....  28.0911  26.9673
+ 7S    / 42:     ....  28.4590  28.1998  29.0577  28.3900  29.3039  29.4132  28.1829  26.9186  25.5194     ....  28.0741  26.4868
+ 9S    / 41:     ....  27.4126  27.8088  28.6505  28.0595  29.3987  29.4488  28.6235  26.8222  25.9759     ....  27.9426  25.9048
+ 11S   / 40:     ....  27.3103  27.5905  28.4839  28.4948  28.7670  29.4367  28.7400  26.7212  25.1000     ....  27.5707  25.3691
+ 13S   / 39:     ....  27.6357  27.1885  28.1500  29.0750  28.2963  29.0007  28.3957  26.0152  23.9237     ....  27.2888  23.9450
+ 15S   / 38:     ....  27.4167  26.8054  27.3040     ....  27.6349  28.8591  28.2997  25.6416  22.9757     ....  26.8832  23.2593
+ 17S   / 37:     ....  26.5750  26.3315  26.3547     ....  26.9741  27.8112  27.7504  25.2758  22.2731     ....  26.9240  22.9660
+ 19S   / 36:     ....  26.3800  25.6018  25.5118     ....  26.2589  26.8355  27.3067  25.1597  21.8636     ....  26.4242  22.7498
+ 21S   / 35:     ....  26.3962  24.9433  24.4010     ....  25.0882  26.0626  26.7074  25.1090  21.2900     ....  26.0265  22.2924
+ 23S   / 34:     ....  25.5153  23.9938  23.6290     ....  23.7930  24.8873  25.7890  24.6791  21.6500     ....  25.0545  22.3546
+ 25S   / 33:     ....  25.0498  23.4605  22.4263     ....  23.5336  23.1886  24.5767  23.8922  21.0542     ....  24.0368  22.0510
+ 27S   / 32:     ....  24.0579  22.4800  21.3337     ....  22.9638  22.6794  22.9685  23.3845  20.5250     ....  23.4248  21.4712
+ 29S   / 31:     ....  22.2597  20.8924  20.4105     ....  22.1940  21.7986  21.7838  22.1056  20.3556     ....  22.2542  20.3204
+ 31S   / 30:     ....  21.4554  20.1326  19.0221     ....  21.7333  20.2379  20.6162  21.0963  19.7514     ....  21.3928  19.9943
+ 33S   / 29:     ....  20.1174  18.7177  17.8882  17.9775  20.9526  18.9529  18.9267  19.8433  18.7275     ....  19.5163  19.1597
+ 35S   / 28:  17.4848  19.0512  17.2736  16.4823  17.0525  20.2329  17.9626  17.6227  19.3250  17.7730  18.5000  18.2119  17.9181
+ 37S   / 27:  19.0393  18.4096  15.7970  14.9422  15.5643  18.4488  16.9900  16.4614  16.4140  16.1780     ....  17.4080  16.3346
+ 39S   / 26:  19.3745  17.0241  15.1964  13.3975  14.9817  16.2655  15.9971  15.1350  15.1000  15.0855  13.9982  15.9207  14.3391
+ 41S   / 25:  17.5125  14.8843  13.7848  11.6755  13.7962  15.6597  15.2020  13.3413     ....  13.7836  12.0222  14.1123  13.4425
+ 43S   / 24:  14.8667   8.6540  13.1967  10.4214  12.3867  14.4790  14.1935  12.8180     ....  12.5791   9.4489  13.2311  12.1000
+ 45S   / 23:  14.8333     ....  10.7300  10.0000  10.7150  12.2380  12.7589  11.4000     ....  11.8200   8.4016     ....     ....
+ 47S   / 22:     ....     ....   6.0500     ....     ....  11.8750  11.9511  10.9667     ....   9.6250   7.7883   7.6600     ....
+ 49S   / 21:     ....     ....   5.4000     ....     ....  10.7667  11.0757   9.8500     ....   8.9767   7.4821   6.6840     ....
+ 51S   / 20:     ....     ....   2.5333     ....     ....   8.8000     ....   9.2571     ....   7.6900   7.7200   3.7350     ....
+ 53S   / 19:     ....   3.4133     ....     ....     ....   8.4600     ....     ....   5.0000   6.6850   7.1267   1.1217     ....
+ 55S   / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.5000   6.0667   1.4680     ....
+ 57S   / 17:     ....     ....     ....     ....     ....     ....     ....     ....     ....   5.2000   5.2657   1.0000     ....
+ 59S   / 16:     ....     ....  -0.4400     ....     ....     ....     ....     ....     ....     ....   1.5000  -0.8000     ....
+ 61S   / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.4500     ....     ....
+ 63S   / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.0700     ....     ....     ....
+ 65S   / 13:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 67S   / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 69S   / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 71S   / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73S   /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_negative_t
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.66667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.000000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.0000
+ -2   / 5: -12.0000
+ 0    / 6: -12.0000
+ 2    / 7:  -8.0000
+ 4    / 8:   0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -20.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+ -2   / 5: -40.0000
+ 0    / 6: -40.0000
+ 2    / 7: -36.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.0000
+ -8    /  2: -36.0000
+ -6    /  3: -48.0000
+ -4    /  4: -56.0000
+ -2    /  5: -60.0000
+ 0     /  6: -60.0000
+ 2     /  7: -56.0000
+ 4     /  8: -48.0000
+ 6     /  9: -36.0000
+ 8     / 10: -20.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.000000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -6.00000
+ 0    / 6: -6.00000
+ 2    / 7: -4.00000
+ 4    / 8:  0.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+ -2   / 5: -20.0000
+ 0    / 6: -20.0000
+ 2    / 7: -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.0000
+ -8    /  2: -18.0000
+ -6    /  3: -24.0000
+ -4    /  4: -28.0000
+ -2    /  5: -30.0000
+ 0     /  6: -30.0000
+ 2     /  7: -28.0000
+ 4     /  8: -24.0000
+ 6     /  9: -18.0000
+ 8     / 10: -10.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+ 4    / 8:  6.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.0000
+ -8    /  2:  -6.0000
+ -6    /  3:  -4.0000
+ -4    /  4:  -2.0000
+ -2    /  5:   0.0000
+ 0     /  6:   2.0000
+ 2     /  7:   4.0000
+ 4     /  8:   6.0000
+ 6     /  9:   8.0000
+ 8     / 10:  10.0000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.0000
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.00000
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:  1.00000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.20000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.20000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.20000
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+ 4    / 8:      ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:      ....
+ -6   / 3:      ....
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:      ....
+ -8    /  2:      ....
+ -6    /  3:      ....
+ -4    /  4:  0.100000
+ -2    /  5:  0.900000
+ 0     /  6:      ....
+ 2     /  7:      ....
+ 4     /  8:      ....
+ 6     /  9:      ....
+ 8     / 10:      ....
+ 10    / 11:      ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.00000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  8.00000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.20000
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  9.00000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+ 4    / 8: -2.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -7.00000
+ -4    /  4: -6.00000
+ -2    /  5: -5.00000
+ 0     /  6: -4.00000
+ 2     /  7: -3.00000
+ 4     /  8: -2.00000
+ 6     /  9: -1.00000
+ 8     / 10:  0.00000
+ 10    / 11:  1.00000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1:....
+ 692184   /  2:....
+ 692208   /  3:....
+ 692232   /  4:....
+ 692256   /  5:....
+ 692280   /  6:....
+ 692304   /  7:....
+ 692328   /  8:....
+ 692352   /  9:....
+ 692376   / 10:....
+ 692400   / 11:....
+ 692424   / 12:....
+ 692448   / 13:....
+ 692472   / 14:....
+ 692496   / 15:....
+ 692520   / 16:....
+ 692544   / 17:....
+ 692568   / 18:....
+ 692592   / 19:....
+ 692616   / 20:....
+ 692640   / 21:....
+ 692664   / 22:....
+ 692688   / 23:....
+ 692712   / 24:....
+ 692736   / 25:....
+ 692760   / 26:....
+ 692784   / 27:....
+ 692808   / 28:....
+ 692832   / 29:....
+ 692856   / 30:....
+CANCEL MODE ignore_error
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_xact_regrid
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+ 
+!added in bn450 11/97 *kob*
+! replace w/ bn500 *kob* 5/99
+GO bn_reset
+cancel mode verify
+GO bn_gc_functions
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+               1        2        3        4     
+               1        2        3        4
+ 0.1  / 1:  1.10000  2.10000  3.10000  4.10000
+ 0.2  / 2:  1.20000  2.20000  3.20000  4.20000
+ 0.3  / 3:  1.30000  2.30000  3.30000  4.30000
+ 0.4  / 4:  1.40000  2.40000  3.40000  4.40000
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+               1         2         3         4      
+                1         2         3         4
+ 0.1  / 1:  0.891207  0.863209  0.041581 -0.818277
+ 0.2  / 2:  0.932039  0.808496 -0.058374 -0.871576
+ 0.3  / 3:  0.963558  0.745705 -0.157746 -0.916166
+ 0.4  / 4:  0.985450  0.675463 -0.255541 -0.951602
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.10000
+ 2    /  2:  2.10000
+ 3    /  3:  3.10000
+ 4    /  4:  4.10000
+ 5    /  5:  1.20000
+ 6    /  6:  2.20000
+ 7    /  7:  3.20000
+ 8    /  8:  4.20000
+ 9    /  9:  1.30000
+ 10   / 10:  2.30000
+ 11   / 11:  3.30000
+ 12   / 12:  4.30000
+ 13   / 13:  1.40000
+ 14   / 14:  2.40000
+ 15   / 15:  3.40000
+ 16   / 16:  4.40000
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.45
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.10000
+ 4   / 4:  4.10000
+ 5   / 5:  1.20000
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+               2        3     
+               2        3
+ 0.2  / 2:  2.20000  3.20000
+ 0.3  / 3:  2.30000  3.30000
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.20000
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 4   / 4:  3.30000
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+                1        2        3        4     
+                1        2        3        4
+ 0.01  / 1:  2.21000  3.21000  2.31000  3.31000
+ 0.02  / 2:  2.22000  3.22000  2.32000  3.32000
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+               1        2        3     
+               1        2        3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11000  2.11000  3.11000
+ 0.2  / 2:  1.21000  2.21000  3.21000
+ 0.3  / 3:  1.31000  2.31000  3.31000
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12000  2.12000  3.12000
+ 0.2  / 2:  1.22000  2.22000  3.22000
+ 0.3  / 3:  1.32000  2.32000  3.32000
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13000  2.13000  3.13000
+ 0.2  / 2:  1.23000  2.23000  3.23000
+ 0.3  / 3:  1.33000  2.33000  3.33000
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.14000  2.14000  3.14000
+ 0.2  / 2:  1.24000  2.24000  3.24000
+ 0.3  / 3:  1.34000  2.34000  3.34000
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.15000  2.15000  3.15000
+ 0.2  / 2:  1.25000  2.25000  3.25000
+ 0.3  / 3:  1.35000  2.35000  3.35000
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.16000  2.16000  3.16000
+ 0.2  / 2:  1.26000  2.26000  3.26000
+ 0.3  / 3:  1.36000  2.36000  3.36000
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.17000  2.17000  3.17000
+ 0.2  / 2:  1.27000  2.27000  3.27000
+ 0.3  / 3:  1.37000  2.37000  3.37000
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.18000  2.18000  3.18000
+ 0.2  / 2:  1.28000  2.28000  3.28000
+ 0.3  / 3:  1.38000  2.38000  3.38000
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.19000  2.19000  3.19000
+ 0.2  / 2:  1.29000  2.29000  3.29000
+ 0.3  / 3:  1.39000  2.39000  3.39000
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:  220.777  252.000  293.508  315.000  293.508  252.000  220.777
+ 3    / 2:  210.675  240.469  280.078  300.586  280.078  240.469  210.675
+ 5    / 3:  199.382  227.579  265.064  284.473  265.064  227.579  199.382
+ 7    / 4:  186.579  212.965  248.043  266.206  248.043  212.965  186.579
+ 9    / 5:  171.798  196.094  228.394  245.118  228.394  196.094  171.798
+ 11   / 6:  154.317  176.140  205.154  220.176  205.154  176.140  154.317
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:   15.459   13.544   11.629   10.835   11.629   13.544   15.459
+ 3    / 2:   46.534   40.768   35.003   32.614   35.003   40.768   46.534
+ 5    / 3:   77.920   68.266   58.612   54.613   58.612   68.266   77.920
+ 7    / 4:  109.622   96.040   82.458   76.832   82.458   96.040  109.622
+ 9    / 5:  141.642  124.093  106.544   99.274  106.544  124.093  141.642
+ 11   / 6:  173.985  152.428  130.872  121.943  130.872  152.428  173.985
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30      -20      -10       0       10       20       30     
+                 1        2        3        4        5        6        7
+ 0      / 1:     ....     ....     ....     ....     ....     ....     ....
+ 50     / 2:  209.428  236.141  270.541  287.852  270.541  236.141  209.428
+ 100    / 3:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 150    / 4:  167.281  177.850     ....     ....     ....  177.850  167.281
+ 200    / 5:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  219.301  249.266  288.698  308.935  288.698  249.266  219.301
+ 40     /  3:  212.799  240.795  276.900  295.177  276.900  240.795  212.799
+ 60     /  4:  205.830  231.454  264.073  280.044  264.073  231.454  205.830
+ 80     /  5:  198.542  221.405  249.798  263.229  249.798  221.405  198.542
+ 100    /  6:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 120    /  7:  181.788  198.556  215.539  222.313  215.539  198.556  181.788
+ 140    /  8:  172.556  184.892     ....     ....     ....  184.892  172.556
+ 160    /  9:  161.876     ....     ....     ....     ....     ....  161.876
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  1.14612  1.23714  1.35815  1.42080  1.35815  1.23714  1.14612
+ 40     /  3:  1.78974  1.97179  2.21167  2.33573  2.21167  1.97179  1.78974
+ 60     /  4:  2.42905  2.69940  3.05822  3.24246  3.05822  2.69940  2.42905
+ 80     /  5:  3.06561  3.42249  3.89693  4.14116  3.89693  3.42249  3.06561
+ 100    /  6:  3.69649  4.14116  4.72832  5.03201  4.72832  4.14116  3.69649
+ 120    /  7:  4.32411  4.85410  5.55312  5.91430  5.55312  4.85410  4.32411
+ 140    /  8:  4.94871  5.56139     ....     ....     ....  5.56139  4.94871
+ 160    /  9:  5.56760     ....     ....     ....     ....     ....  5.56760
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  5.56760
+ -20   / 2:  5.56139
+ -10   / 3:  5.55312
+ 0     / 4:  5.91430
+ 10    / 5:  5.55312
+ 20    / 6:  5.56139
+ 30    / 7:  5.56760
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  163.058
+ -20   / 2:  186.117
+ -10   / 3:  216.774
+ 0     / 4:  232.647
+ 10    / 5:  216.774
+ 20    / 6:  186.117
+ 30    / 7:  163.058
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   1.1817
+ -20   / 2:   1.2249
+ -10   / 3:   1.2346
+ 0     / 4:  10.3336
+ 10    / 5:   1.2346
+ 20    / 6:   1.2249
+ 30    / 7:   1.1817
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   7.6679
+ -20   / 2:   9.6753
+ -10   / 3:  10.7875
+ 0     / 4:  10.3336
+ 10    / 5:  10.7875
+ 20    / 6:   9.6753
+ 30    / 7:   7.6679
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+ 
+!added in bn491 - originally had this in run_all, but moved it here to
+! properly echo commands  *kob*
+GO bn_reset
+cancel mode verify
+set mode verify  ! somehow this was off
+ 
+GO bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+can viewport
+can win/all
+set window 1
+ 
+!netcdf write error
+GO err490_cdf_childax
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+ 
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+!
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+ 
+ 
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+ 
+message/continue ********File successfully written******
+********File successfully written******
+ 
+ 
+! command parser
+GO bn_reset
+cancel mode verify
+GO err490_command_parser
+! err490_command_parser.jnl 12/1/98 - reported by billy kessler
+ 
+! ERROR Fixed:  command parser fix
+! the following caused an abort of ferret to occur
+!
+! routines modifed:  gnl/parse_command.F
+!	     	     rpn/init_uvar_sub.F
+!                    common/xvariables.cmn
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+label/nou `($ppl$xlen)-.3`  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ !-> PPL %LABEL/nou 8.44  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ 
+! the following also caused an abort of ferret
+let sstb = if ( (i eq 172 and j eq 36) or (i ge 173 and i le 175 and j eq 35) or (i ge 176 and i le 178 and j eq 36) or (i eq 178 and j eq 35) ) then 1.e35 else sst
+message/continue ****Variable defined successfully******
+****Variable defined successfully******
+ 
+ 
+! tilde error
+!GO bn_reset
+!GO err490_tilde
+ 
+ 
+!repeat error
+GO bn_reset
+cancel mode verify
+GO err490_repeat_first_echo
+! err490_repeat_first_echo (created later 23/98)
+ 
+! for the first REPEAT loop on T the formatting of the "verify" output
+! is based on the last previous command given
+ 
+! fixed 1/98 sh&kob
+!  relevant routines (bug not yet fixed)
+!		       gnl/cs_command.F
+!                      xeq/xeq_repeat.F
+!                      ctx/cs_set_context.F
+ 
+set mode calendar
+can mode interp
+ 
+! cause the "last" command to be non-calendar
+stat t[t=15]
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+ 
+! now note the first loop echo
+set mode verify
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.42017
+ 14   / 14:  1.41077
+ 15   / 15:  2.06106
+ 16   / 16:  1.77316
+ 17   / 17:  0.81176
+ 18   / 18:  0.06077
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.693528
+ 12   / 12: -0.372132
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+ 19   / 19:  0.103945
+ 20   / 20:  0.633159
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.99999
+ 12   / 12: -1.53656
+ 13   / 13: -1.11640
+ 14   / 14: -0.12579
+ 15   / 15:  0.52450
+ 16   / 16:  0.23660
+ 17   / 17: -0.72480
+ 18   / 18: -1.47579
+ 19   / 19: -1.32591
+ 20   / 20: -0.41297
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME4     TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.0000
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.51W  135.469W 135.429W 135.389W 135.348W 135.308W 135.267W 135.227W 135.187W 135.146W 135.106W 135.066W 
+                     1        4        7       10       13       16       19       22       25       28       31       34
+ 59.4667N / 127:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4599N / 126:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.453N  / 125:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4462N / 124:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97638     ....
+ 59.4394N / 123:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4325N / 122:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4257N / 121:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4189N / 120:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.412N  / 119:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.4052N / 118:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3983N / 117:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.3915N / 116:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3846N / 115:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97555     ....     ....
+ 59.3778N / 114:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3709N / 113:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3641N / 112:     ....     ....     ....     ....     ....     ....     ....     ....  2.98572     ....     ....     ....
+ 59.3572N / 111:     ....     ....     ....     ....     ....     ....     ....     ....  2.98764     ....     ....     ....
+ 59.3504N / 110:     ....     ....     ....     ....     ....     ....     ....     ....  2.98791     ....     ....     ....
+ 59.3435N / 109:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3366N / 108:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3298N / 107:     ....     ....     ....     ....     ....     ....     ....  2.98599     ....     ....     ....     ....
+ 59.3229N / 106:     ....     ....     ....     ....  2.98956     ....     ....  2.98709     ....     ....     ....     ....
+ 59.3161N / 105:     ....     ....     ....     ....  2.98901     ....     ....  2.98627     ....     ....     ....     ....
+ 59.3092N / 104:     ....     ....     ....     ....  2.98846     ....  2.98379  2.98517     ....     ....     ....     ....
+ 59.3023N / 103:     ....     ....     ....     ....     ....  2.98379  2.98297  2.98407     ....     ....     ....     ....
+ 59.2955N / 102:     ....     ....     ....     ....     ....  2.98297     ....  2.98270     ....     ....     ....     ....
+ 59.2886N / 101:     ....  2.99863     ....     ....     ....  2.98297  2.98077  2.98105     ....     ....     ....     ....
+ 59.2817N / 100:     ....     ....  2.98956     ....     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2748N /  99:     ....     ....  2.99149     ....     ....  2.98462  2.98050     ....     ....     ....     ....     ....
+ 59.268N  /  98:     ....     ....  2.99341     ....     ....  2.98462  2.97967     ....     ....     ....     ....     ....
+ 59.2611N /  97:     ....     ....  2.99561     ....     ....     ....  2.97967     ....     ....     ....     ....     ....
+ 59.2542N /  96:     ....     ....  2.99615  3.00055     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2473N /  95:     ....     ....  2.99643  2.99945     ....  2.98434  2.98709     ....     ....     ....     ....     ....
+ 59.2405N /  94:     ....     ....     ....  2.99753     ....  2.98572  2.99286     ....     ....     ....     ....     ....
+ 59.2336N /  93:     ....     ....     ....  2.99561  2.99588  2.98627  2.99313     ....     ....     ....     ....     ....
+ 59.2267N /  92:     ....     ....     ....  2.99396  2.99451     ....  2.99588  2.99588     ....     ....     ....     ....
+ 59.2198N /  91:     ....     ....     ....  2.99231  2.99341     ....  2.99643  2.99698     ....     ....     ....     ....
+ 59.2129N /  90:     ....     ....     ....  2.99039  2.99176     ....  2.99561  2.99780     ....     ....     ....     ....
+ 59.2061N /  89:     ....     ....     ....  2.98984  2.99231     ....  2.99396  2.99725     ....     ....     ....     ....
+ 59.1992N /  88:     ....     ....     ....  2.98984  2.99176     ....     ....  2.99368     ....     ....     ....     ....
+ 59.1923N /  87:     ....     ....     ....     ....  2.99203     ....     ....  2.99039     ....     ....     ....     ....
+ 59.1854N /  86:     ....     ....     ....     ....  2.99451     ....     ....  2.98956     ....     ....     ....     ....
+ 59.1785N /  85:     ....     ....     ....  2.99313  2.99670  2.99918     ....  2.98956     ....     ....     ....     ....
+ 59.1716N /  84:     ....     ....     ....  2.99423  2.99808     ....     ....  2.99066     ....     ....     ....     ....
+ 59.1647N /  83:     ....     ....     ....  2.99561  2.99780  3.00494     ....  2.99149     ....     ....     ....     ....
+ 59.1578N /  82:     ....     ....     ....  2.99588  2.99835     ....     ....  2.99286     ....     ....     ....     ....
+ 59.1509N /  81:     ....     ....     ....  2.99588  2.99945     ....  2.99506  2.99423     ....     ....     ....     ....
+ 59.144N  /  80:     ....     ....     ....     ....  2.99973     ....  2.99561  2.99396     ....     ....     ....     ....
+ 59.1371N /  79:     ....     ....     ....     ....  2.99973     ....  2.99643  2.99396     ....     ....     ....     ....
+ 59.1302N /  78:     ....     ....     ....     ....  3.00055     ....  2.99808  2.99451     ....     ....     ....     ....
+ 59.1233N /  77:     ....     ....     ....     ....  3.00247     ....  3.00027  2.99561     ....     ....     ....     ....
+ 59.1164N /  76:     ....     ....     ....     ....  3.00385     ....  3.00110  2.99670     ....     ....     ....     ....
+ 59.1095N /  75:     ....     ....     ....     ....     ....  3.00330  3.00275  2.99753     ....     ....     ....     ....
+ 59.1026N /  74:     ....     ....     ....     ....     ....  3.00192     ....  2.99808     ....     ....     ....     ....
+ 59.0957N /  73:     ....     ....     ....     ....  2.99643  3.00027     ....  2.99973     ....     ....     ....     ....
+ 59.0888N /  72:     ....     ....     ....     ....  2.99615  3.00000     ....  3.00082     ....     ....     ....     ....
+ 59.0819N /  71:     ....     ....     ....     ....  2.99670  3.00055  3.00412  3.00110     ....     ....     ....     ....
+ 59.075N  /  70:     ....     ....     ....     ....  2.99780  3.00137  3.00302  3.00137     ....     ....     ....     ....
+ 59.0681N /  69:     ....     ....     ....     ....  2.99890  3.00137  3.00082  3.00055     ....     ....     ....     ....
+ 59.0612N /  68:     ....     ....     ....     ....  2.99863  3.00000     ....  2.99780     ....     ....     ....     ....
+ 59.0542N /  67:     ....     ....     ....     ....  2.99835  2.99780     ....  2.99533     ....     ....     ....     ....
+ 59.0473N /  66:     ....     ....     ....     ....  2.99808  2.99615     ....  2.99341     ....     ....     ....     ....
+ 59.0404N /  65:     ....     ....     ....     ....  2.99780  2.99588  2.99368  2.99094     ....     ....     ....     ....
+ 59.0335N /  64:     ....     ....     ....  2.99835  2.99753  2.99506  2.99286  2.98791     ....     ....     ....     ....
+ 59.0266N /  63:     ....     ....     ....  2.99780     ....  2.99396  2.99039  2.98599     ....     ....     ....     ....
+ 59.0196N /  62:     ....     ....     ....  2.99698     ....  2.99258     ....  2.98324     ....     ....     ....     ....
+ 59.0127N /  61:     ....     ....     ....  2.99561     ....  2.99203  2.98572  2.97995     ....     ....     ....     ....
+ 59.0058N /  60:     ....     ....     ....  2.99423     ....  2.99121  2.98572  2.97748     ....     ....     ....     ....
+ 58.9989N /  59:     ....     ....     ....  2.99506     ....  2.99094  2.98572  2.97748     ....     ....     ....     ....
+ 58.9919N /  58:     ....     ....     ....  2.99808     ....  2.99066  2.98489  2.97748     ....     ....     ....     ....
+ 58.985N  /  57:     ....     ....     ....  3.00027     ....  2.99011  2.98407  2.97720     ....     ....     ....     ....
+ 58.9781N /  56:     ....     ....     ....  3.00055     ....  2.98929  2.98160  2.97720     ....     ....     ....     ....
+ 58.9711N /  55:     ....     ....     ....  3.00000     ....  2.98819  2.97693  2.97638     ....     ....     ....     ....
+ 58.9642N /  54:     ....     ....     ....  2.99863     ....  2.98736  2.97775  2.97198     ....     ....     ....     ....
+ 58.9573N /  53:     ....     ....     ....  2.99670     ....  2.98682  2.97803  2.96512     ....     ....     ....     ....
+ 58.9503N /  52:     ....     ....     ....  2.99588  2.99203  2.98654  2.97830  2.96676     ....     ....     ....     ....
+ 58.9434N /  51:     ....     ....     ....  2.99588  2.99231  2.98654  2.97748  2.96814     ....     ....     ....     ....
+ 58.9365N /  50:     ....     ....     ....  2.99780  2.99258  2.98627  2.97665     ....     ....     ....     ....     ....
+ 58.9295N /  49:     ....     ....     ....     ....  2.99231  2.98572  2.97638     ....     ....     ....     ....     ....
+ 58.9226N /  48:     ....     ....     ....     ....  2.99286  2.98544  2.97610     ....     ....     ....     ....     ....
+ 58.9156N /  47:     ....     ....     ....  2.99478  2.99423  2.98544  2.97528     ....     ....     ....     ....     ....
+ 58.9087N /  46:     ....     ....     ....  2.99533  2.99368  2.98517  2.97500     ....     ....     ....     ....     ....
+ 58.9017N /  45:     ....     ....     ....  2.99506  2.99286  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8948N /  44:     ....     ....     ....  2.99533  2.99231  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8878N /  43:     ....     ....     ....  2.99615  2.99176  2.98462  2.97555     ....     ....     ....     ....     ....
+ 58.8809N /  42:     ....     ....     ....  2.99698  2.99258  2.98489  2.97638     ....     ....     ....     ....     ....
+ 58.8739N /  41:     ....     ....     ....  2.99698  2.99341  2.98544  2.97555     ....     ....     ....     ....     ....
+ 58.867N  /  40:     ....     ....     ....  2.99698  2.99341  2.98544  2.97418     ....     ....     ....     ....     ....
+ 58.86N   /  39:     ....     ....     ....  2.99753  2.99368  2.98544  2.97171     ....     ....     ....     ....     ....
+ 58.8531N /  38:     ....     ....     ....  2.99835  2.99368  2.98572  2.96786     ....     ....     ....     ....     ....
+ 58.8461N /  37:     ....     ....     ....  2.99863  2.99368  2.98572  2.96621     ....     ....     ....     ....     ....
+ 58.8392N /  36:     ....     ....     ....  2.99890  2.99368  2.98517  2.96814     ....     ....     ....     ....     ....
+ 58.8322N /  35:     ....     ....     ....     ....  2.99313  2.98379  2.97061     ....     ....     ....     ....     ....
+ 58.8252N /  34:     ....     ....     ....     ....  2.99258  2.98215  2.96896     ....     ....     ....     ....     ....
+ 58.8183N /  33:     ....     ....     ....     ....  2.99121  2.98160  2.96814     ....     ....     ....     ....     ....
+ 58.8113N /  32:     ....     ....     ....     ....  2.99094  2.98242  2.96869     ....     ....     ....  2.93408  2.92254
+ 58.8043N /  31:     ....     ....     ....     ....  2.99341  2.98297  2.96759     ....     ....     ....  2.93463     ....
+ 58.7974N /  30:     ....     ....     ....  3.00247  2.99286  2.98242  2.96621  2.94754     ....     ....  2.93545     ....
+ 58.7904N /  29:     ....     ....     ....     ....  2.99149  2.98105  2.96567  2.94809     ....     ....     ....     ....
+ 58.7834N /  28:     ....     ....     ....     ....  2.99094  2.97967  2.96512  2.94644     ....     ....  2.96374     ....
+ 58.7765N /  27:     ....     ....     ....     ....  2.98956  2.97748  2.96347  2.94864     ....     ....  2.95880     ....
+ 58.7695N /  26:     ....     ....     ....     ....  2.98874  2.97940  2.96484  2.95440     ....  2.94781  2.95660     ....
+ 58.7625N /  25:     ....     ....     ....     ....  2.98846  2.98187  2.96869  2.95990     ....  2.95166  2.95495     ....
+ 58.7555N /  24:     ....     ....     ....     ....  2.98791  2.98160  2.96896  2.96264     ....  2.95358  2.95303     ....
+ 58.7486N /  23:     ....     ....     ....  2.98682  2.98627  2.97940  2.96841  2.96127     ....  2.95440  2.95056     ....
+ 58.7416N /  22:     ....     ....     ....  2.98544  2.98462  2.97693  2.96731  2.95935     ....  2.95276  2.94616     ....
+ 58.7346N /  21:     ....     ....     ....  2.98352  2.98297  2.97500  2.96484  2.95797  2.95166  2.94919  2.94507     ....
+ 58.7276N /  20:     ....     ....     ....     ....  2.98160  2.97226  2.96292  2.95605  2.95138  2.94644  2.94232     ....
+ 58.7206N /  19:     ....     ....     ....     ....  2.97995  2.96896  2.96209  2.95578  2.95056  2.94452     ....     ....
+ 58.7137N /  18:     ....     ....     ....     ....  2.97858  2.97088  2.96292  2.95440  2.94891  2.94424     ....     ....
+ 58.7067N /  17:     ....     ....     ....     ....  2.97775  2.97391  2.96402  2.95331  2.94699  2.94561     ....     ....
+ 58.6997N /  16:     ....     ....     ....     ....  2.97748  2.97446  2.96457  2.95248  2.94507  2.94616     ....     ....
+ 58.6927N /  15:     ....     ....     ....     ....  2.97803  2.97446  2.96457  2.95056  2.94424  2.94699     ....     ....
+ 58.6857N /  14:     ....     ....     ....     ....  2.97967  2.97446  2.96567  2.94836  2.94397  2.94726     ....     ....
+ 58.6787N /  13:     ....     ....     ....     ....  2.98050  2.97500  2.96924  2.95193  2.94534  2.94864     ....     ....
+ 58.6717N /  12:     ....     ....     ....     ....  2.98215  2.97638  2.96814  2.95550  2.94424  2.95193     ....     ....
+ 58.6647N /  11:     ....     ....     ....     ....  2.98270  2.97830  2.96539  2.94919     ....  2.95248     ....     ....
+ 58.6577N /  10:     ....     ....     ....     ....  2.98215  2.97885  2.96594  2.94534     ....     ....     ....     ....
+ 58.6507N /   9:     ....     ....     ....  2.98160  2.97995  2.97500  2.97088  2.95331     ....     ....     ....     ....
+ 58.6437N /   8:     ....     ....     ....     ....  2.97967  2.97116  2.97198  2.95852     ....     ....     ....     ....
+ 58.6367N /   7:     ....     ....     ....     ....  2.98160  2.97500  2.96841  2.96017     ....     ....     ....     ....
+ 58.6297N /   6:     ....     ....     ....     ....  2.98132  2.97693  2.96896  2.96292  2.94946     ....     ....     ....
+ 58.6227N /   5:     ....     ....     ....     ....  2.98160  2.97665  2.97143  2.96155  2.95221     ....     ....     ....
+ 58.6157N /   4:     ....     ....     ....     ....  2.96951  2.96814  2.96484  2.95660  2.95138     ....     ....     ....
+ 58.6087N /   3:     ....     ....     ....     ....  2.95276  2.95138  2.94397  2.96127  2.94644     ....     ....     ....
+ 58.6017N /   2:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 58.5947N /   1:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 
+ 
+! ******** V500 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_odd_variable_name
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.041581
+ 2    /  2: -0.058374
+ 3    /  3: -0.157746
+ 4    /  4: -0.255541
+ 5    /  5: -0.350783
+ 6    /  6: -0.442520
+ 7    /  7: -0.529836
+ 8    /  8: -0.611858
+ 9    /  9: -0.687766
+ 10   / 10: -0.756802
+ 11   / 11: -0.818277
+ 12   / 12: -0.871576
+ 13   / 13: -0.916166
+ 14   / 14: -0.951602
+ 15   / 15: -0.977530
+ 16   / 16: -0.993691
+ 17   / 17: -0.999923
+ 18   / 18: -0.996165
+ 19   / 19: -0.982453
+ 20   / 20: -0.958924
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.891207
+ 2    /  2:  0.932039
+ 3    /  3:  0.963558
+ 4    /  4:  0.985450
+ 5    /  5:  0.997495
+ 6    /  6:  0.999574
+ 7    /  7:  0.991665
+ 8    /  8:  0.973848
+ 9    /  9:  0.946300
+ 10   / 10:  0.909297
+ 11   / 11:  0.863209
+ 12   / 12:  0.808496
+ 13   / 13:  0.745705
+ 14   / 14:  0.675463
+ 15   / 15:  0.598472
+ 16   / 16:  0.515501
+ 17   / 17:  0.427380
+ 18   / 18:  0.334988
+ 19   / 19:  0.239249
+ 20   / 20:  0.141120
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.863209
+ 2    /  2:  0.808496
+ 3    /  3:  0.745705
+ 4    /  4:  0.675463
+ 5    /  5:  0.598472
+ 6    /  6:  0.515501
+ 7    /  7:  0.427380
+ 8    /  8:  0.334988
+ 9    /  9:  0.239249
+ 10   / 10:  0.141120
+ 11   / 11:  0.041581
+ 12   / 12: -0.058374
+ 13   / 13: -0.157746
+ 14   / 14: -0.255541
+ 15   / 15: -0.350783
+ 16   / 16: -0.442520
+ 17   / 17: -0.529836
+ 18   / 18: -0.611858
+ 19   / 19: -0.687766
+ 20   / 20: -0.756802
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.925815
+ 2    /  2: -0.883455
+ 3    /  3: -0.832267
+ 4    /  4: -0.772764
+ 5    /  5: -0.705540
+ 6    /  6: -0.631267
+ 7    /  7: -0.550686
+ 8    /  8: -0.464602
+ 9    /  9: -0.373877
+ 10   / 10: -0.279415
+ 11   / 11: -0.182163
+ 12   / 12: -0.083090
+ 13   / 13:  0.016814
+ 14   / 14:  0.116549
+ 15   / 15:  0.215120
+ 16   / 16:  0.311541
+ 17   / 17:  0.404850
+ 18   / 18:  0.494114
+ 19   / 19:  0.578440
+ 20   / 20:  0.656987
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.818277
+ 2    /  2: -0.871576
+ 3    /  3: -0.916166
+ 4    /  4: -0.951602
+ 5    /  5: -0.977530
+ 6    /  6: -0.993691
+ 7    /  7: -0.999923
+ 8    /  8: -0.996165
+ 9    /  9: -0.982453
+ 10   / 10: -0.958924
+ 11   / 11: -0.925815
+ 12   / 12: -0.883455
+ 13   / 13: -0.832267
+ 14   / 14: -0.772764
+ 15   / 15: -0.705540
+ 16   / 16: -0.631267
+ 17   / 17: -0.550686
+ 18   / 18: -0.464602
+ 19   / 19: -0.373877
+ 20   / 20: -0.279415
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.84963
+ 2    /  2: -0.99041
+ 3    /  3: -1.12130
+ 4    /  4: -1.24099
+ 5    /  5: -1.34828
+ 6    /  6: -1.44209
+ 7    /  7: -1.52150
+ 8    /  8: -1.58571
+ 9    /  9: -1.63407
+ 10   / 10: -1.66610
+ 11   / 11: -1.68149
+ 12   / 12: -1.68007
+ 13   / 13: -1.66187
+ 14   / 14: -1.62707
+ 15   / 15: -1.57600
+ 16   / 16: -1.50919
+ 17   / 17: -1.42730
+ 18   / 18: -1.33115
+ 19   / 19: -1.22170
+ 20   / 20: -1.10004
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.730346
+ 7    /  7: -0.736317
+ 8    /  8: -0.732716
+ 9    /  9: -0.719579
+ 10   / 10: -0.697038
+ 11   / 11: -0.665317
+ 12   / 12: -0.624734
+ 13   / 13: -0.575694
+ 14   / 14: -0.518687
+ 15   / 15: -0.454283
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.441047
+ 7    /  7: -0.528071
+ 8    /  8: -0.609820
+ 9    /  9: -0.685476
+ 10   / 10: -0.754282
+ 11   / 11: -0.815552
+ 12   / 12: -0.868673
+ 13   / 13: -0.913115
+ 14   / 14: -0.948433
+ 15   / 15: -0.974274
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.996244
+ 7    /  7:  0.988362
+ 8    /  8:  0.970604
+ 9    /  9:  0.943148
+ 10   / 10:  0.906269
+ 11   / 11:  0.860334
+ 12   / 12:  0.805804
+ 13   / 13:  0.743222
+ 14   / 14:  0.673213
+ 15   / 15:  0.596479
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.25425
+ 2    /  2:  0.22114
+ 3    /  3:  0.19991
+ 4    /  4:  0.19245
+ 5    /  5:  0.20137
+ 6    /  6:  0.23088
+ 7    /  7:  0.28859
+ 8    /  8:  0.39076
+ 9    /  9:  0.58026
+ 10   / 10:  1.02106
+ 11   / 11:  3.45512
+ 12   / 12: -2.30685
+ 13   / 13: -0.72568
+ 14   / 14: -0.31668
+ 15   / 15: -0.09228
+ 16   / 16:  0.07275
+ 17   / 17:  0.21342
+ 18   / 18:  0.34296
+ 19   / 19:  0.46716
+ 20   / 20:  0.58869
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.0415808
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.999574
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.0799809
+ 6    /  6: -0.0855462
+ 7    /  7: -0.0902566
+ 8    /  8: -0.0940653
+ 9    /  9: -0.0969341
+ 10   / 10: -0.0988342
+ 11   / 11: -0.0997471
+ 12   / 12: -0.0996632
+ 13   / 13: -0.0985835
+ 14   / 14: -0.0965188
+ 15   / 15: -0.0934896
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_stream
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- L:3 T:   3
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:4 T:   4
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  37.0000
+ 2   / 2:  29.0000  41.0000
+ 3   / 3:  33.0000  45.0000
+ ---- L:2 T:   2
+ 1   / 1:  26.0000  38.0000
+ 2   / 2:  30.0000  42.0000
+ 3   / 3:  34.0000  46.0000
+ ---- L:3 T:   3
+ 1   / 1:  27.0000  39.0000
+ 2   / 2:  31.0000  43.0000
+ 3   / 3:  35.0000  47.0000
+ ---- L:4 T:   4
+ 1   / 1:  28.0000  40.0000
+ 2   / 2:  32.0000  44.0000
+ 3   / 3:  36.0000  48.0000
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- L:2 T:   2
+ 1   / 1:  13.0000  15.0000
+ 2   / 2:  17.0000  19.0000
+ 3   / 3:  21.0000  23.0000
+ ---- L:3 T:   3
+ 1   / 1:  25.0000  27.0000
+ 2   / 2:  29.0000  31.0000
+ 3   / 3:  33.0000  35.0000
+ ---- L:4 T:   4
+ 1   / 1:  37.0000  39.0000
+ 2   / 2:  41.0000  43.0000
+ 3   / 3:  45.0000  47.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+ ---- L:2 T:   2
+ 1   / 1:  14.0000  16.0000
+ 2   / 2:  18.0000  20.0000
+ 3   / 3:  22.0000  24.0000
+ ---- L:3 T:   3
+ 1   / 1:  26.0000  28.0000
+ 2   / 2:  30.0000  32.0000
+ 3   / 3:  34.0000  36.0000
+ ---- L:4 T:   4
+ 1   / 1:  38.0000  40.0000
+ 2   / 2:  42.0000  44.0000
+ 3   / 3:  46.0000  48.0000
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_define_axes
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_external_functions  ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_pattern
+! pattern_bench.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+ 
+set view full
+ 
+use coads_climatology
+set reg/l=3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+ 
+! Note that colors are set in the usual way...
+ 
+set win 1
+ 
+set mode meta pattern_plot1.plt
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns/nolabel sst
+ 
+go land thick
+ 
+! Colors and patterns can be overlaid; patterns are transparent
+ 
+set win 2
+ 
+set data coads_climatology
+set data clim_airt_lev.cdf
+set reg/l=1:3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+set mode meta pattern_plot2.plt
+fill/lev=(0,33,3)/nolabel sst[l=@ave,d=1]
+ 
+fill/lev=(25,27,1)/over/nolab/pal=black/pat=angled_grid/nolabel airt[l=@ave]
+label/user,200,-30,-1,0,.15, at trAIRT gt 25 and lt 27 deg. C
+ 
+go land thick
+ 
+!can data/all
+can win 2
+set win 1
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn_polygon
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn500_bug_fixes
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G012)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Tue Nov 12 15:12:30 PST 2013
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+ 
+! ******** V510 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sample			! internal (optimized) SAMPLE* functions
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : JAN
+               79E      99E     119E    
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  28.5769  28.5925  28.1495
+ 1S   / 45:  28.3343  28.7146  28.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  29.1373  28.9243  28.3264
+ 1S   / 45:  28.8965  28.8240  28.5357
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : JAN
+                2     
+                2
+ 1N   / 46:  28.1992
+ 1S   / 45:  28.5607
+ -DELETE (C01,V02 M: 34 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 25 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 28 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 31 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 34 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 32 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+cancel memory/all
+ -DELETE A        M: 26 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 26 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE A        M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 32 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=???@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[I=1:180 at IIN,D=1]
+ -DELETE          M: 32 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 23 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                 1           2           3       
+                  1           2           3
+ 1N   / 46:  182881720.  245818833.  306844239.
+ 1S   / 45:  183667676.  246892478.  309487473.
+cancel memory/all
+ -DELETE FSST     M: 22 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 25 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 31 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 31 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 33 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G017)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G017)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:  4.00000
+ 3   / 3:  7.00000
+ 4   / 4:     ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.000
+ 2   / 2:  114.000
+ 3   / 3:  117.000
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:     ....
+ 3   / 3:     ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.2222  28.1992     ....  28.4514
+ 1S   / 45:  28.1514  28.5607     ....  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.1992     ....  28.4514  28.2222
+ 1S   / 45:  28.5607     ....  28.8326  28.1514
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:     ....
+ 3   / 3:     ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:     ....
+ 3   / 3:  170.000
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G017)          NORMAL    (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 29 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 20 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 18 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V01 C: 12 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 14 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1978
+            largest free region: 1976
+            number of free regions: 3
+            free memory table slots: 478
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : JAN
+            179E    
+             80
+ 0   / 1:  22.6389
+ 5   / 2:  27.6389
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : JAN
+              1        2        3        4     
+              1        2        3        4
+ 0   / 1:  22.6389  23.5251  26.9131  29.2606
+ 5   / 2:  27.6389  28.5251  31.9131  34.2606
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  22.6389
+ 2   / 2:  29.2606
+ 3   / 3:  27.7269
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  23.5649  22.6150  21.9434  22.5531  22.5856  22.4436  21.9629  22.2754  21.6575
+ 2   / 2:  29.3521  29.1692  29.2257  29.4440  29.0923  29.3430  29.1310  28.6520  28.9082
+ 3   / 3:  27.9696  28.0578  27.8618  27.9059  27.4280  27.4100  27.3646  27.3974  27.1177
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : JAN
+          173.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  178.202
+ 3   / 3:  198.202
+ 4   / 4:  223.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  223.202
+ 3   / 3:  273.202
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  174.169  174.225  173.963  173.313  173.532  172.803  172.991  172.548  171.929
+ 2   / 2:  224.169  224.225  223.963  223.313  223.532  222.803  222.991  222.548  221.929
+ 3   / 3:  274.169  274.225  273.963  273.313  273.532  272.803  272.991  272.548  271.929
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+            179E    
+             80
+ 0   / 1:  28.2022
+ 5   / 2:  33.2022
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+              0        5     
+              1        2
+ 1   / 1:  28.3646  33.3646
+ 2   / 2:  28.3538  33.3538
+ 3   / 3:  28.2022  33.2022
+ 4   / 4:  28.3646  33.3646
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+            179E    
+             80
+ 1   / 1:  28.2022
+ 2   / 2:  28.2022
+ 3   / 3:  28.3646
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 2   / 2:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 3   / 3:  29.0509  29.1878  28.7239  29.5150  28.3287  28.1944  27.4815  27.4749  26.7886
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strides_revs_perms	! netCDF fancy reads
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1124.00  1125.00  1126.00
+ 3   / 3:  1133.00  1134.00  1135.00  1136.00
+ 4   / 4:  1143.00  1144.00  1145.00  1146.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1224.00  1225.00  1226.00
+ 3   / 3:  1233.00  1234.00  1235.00  1236.00
+ 4   / 4:  1243.00  1244.00  1245.00  1246.00
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.00  1142.00  1152.00  1162.00
+ 3   / 3:  1133.00  1143.00  1153.00  1163.00
+ 4   / 4:  1134.00  1144.00  1154.00  1164.00
+ ---- K:2 Z:   2
+ 2   / 2:  1232.00  1242.00  1252.00  1262.00
+ 3   / 3:  1233.00  1243.00  1253.00  1263.00
+ 4   / 4:  1234.00  1244.00  1254.00  1264.00
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1421.00  1521.00  1621.00
+ 3   / 3:  1331.00  1431.00  1531.00  1631.00
+ 4   / 4:  1341.00  1441.00  1541.00  1641.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1332.00  1432.00  1532.00  1632.00
+ 4   / 4:  1342.00  1442.00  1542.00  1642.00
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1412.00  1512.00  1612.00
+ 3   / 3:  1313.00  1413.00  1513.00  1613.00
+ 4   / 4:  1314.00  1414.00  1514.00  1614.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1323.00  1423.00  1523.00  1623.00
+ 4   / 4:  1324.00  1424.00  1524.00  1624.00
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1032.00  1033.00  1034.00
+ 2N   / 2:  1021.00  1022.00  1023.00  1024.00
+ 1N   / 1:  1011.00  1012.00  1013.00  1014.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2032.00  2033.00  2034.00
+ 2N   / 2:  2021.00  2022.00  2023.00  2024.00
+ 1N   / 1:  2011.00  2012.00  2013.00  2014.00
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1021.00  1031.00  1041.00
+ 142   / 2:  1012.00  1022.00  1032.00  1042.00
+ 143   / 3:  1013.00  1023.00  1033.00  1043.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2021.00  2031.00  2041.00
+ 142   / 2:  2012.00  2022.00  2032.00  2042.00
+ 143   / 3:  2013.00  2023.00  2033.00  2043.00
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  2031.00  3031.00  4031.00
+ 2N   / 2:  1021.00  2021.00  3021.00  4021.00
+ 1N   / 1:  1011.00  2011.00  3011.00  4011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  2032.00  3032.00  4032.00
+ 2N   / 2:  1022.00  2022.00  3022.00  4022.00
+ 1N   / 1:  1012.00  2012.00  3012.00  4012.00
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @AVE
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1113.67
+ 2   / 2:  1122.00  1123.67
+ 3   / 3:  1132.00  1133.67
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1213.67
+ 2   / 2:  1222.00  1223.67
+ 3   / 3:  1232.00  1233.67
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 47 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M: 54 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G010)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.3      0.48     0.6    
+             1        2        3        4
+          1111.00  1112.00  1113.00  1114.00
+cancel mem/all
+ -DELETE BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.9      1.87     2.65     3.3    
+             1        2        3        4        5
+          1111.00  1118.00  1115.00  1112.00  1119.00
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6    
+               1        2
+ 0    / 1:  1112.00  1114.00
+ 0.95 / 2:  1132.00  1134.00
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6      0.78   
+               1        2        3
+ 0    / 1:  1112.00  1114.00  1116.00
+ 0.95 / 2:  1132.00  1134.00  1136.00
+ 1.4  / 3:  1152.00  1154.00  1156.00
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1125.00  1127.00  1129.00
+ 3   / 3:  1133.00  1135.00  1137.00  1139.00
+ 4   / 4:  1143.00  1145.00  1147.00  1149.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1225.00  1227.00  1229.00
+ 3   / 3:  1233.00  1235.00  1237.00  1239.00
+ 4   / 4:  1243.00  1245.00  1247.00  1249.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1124.00  1125.00  1126.00
+ 4   / 2:  1143.00  1144.00  1145.00  1146.00
+ 6   / 3:  1163.00  1164.00  1165.00  1166.00
+ ---- K:2 Z:   2
+ 2   / 1:  1223.00  1224.00  1225.00  1226.00
+ 4   / 2:  1243.00  1244.00  1245.00  1246.00
+ 6   / 3:  1263.00  1264.00  1265.00  1266.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1521.00  1721.00  1921.00
+ 3   / 3:  1331.00  1531.00  1731.00  1931.00
+ 4   / 4:  1341.00  1541.00  1741.00  1941.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1332.00  1532.00  1732.00  1932.00
+ 4   / 4:  1342.00  1542.00  1742.00  1942.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1421.00  1521.00  1621.00
+ 4   / 2:  1341.00  1441.00  1541.00  1641.00
+ 6   / 3:  1361.00  1461.00  1561.00  1661.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1342.00  1442.00  1542.00  1642.00
+ 6   / 3:  1362.00  1462.00  1562.00  1662.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1512.00  1712.00  1912.00
+ 3   / 3:  1313.00  1513.00  1713.00  1913.00
+ 4   / 4:  1314.00  1514.00  1714.00  1914.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1323.00  1523.00  1723.00  1923.00
+ 4   / 4:  1324.00  1524.00  1724.00  1924.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1412.00  1512.00  1612.00
+ 4   / 2:  1314.00  1414.00  1514.00  1614.00
+ 6   / 3:  1316.00  1416.00  1516.00  1616.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1324.00  1424.00  1524.00  1624.00
+ 6   / 3:  1326.00  1426.00  1526.00  1626.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1512.00  1712.00  1912.00
+ 4   / 2:  1314.00  1514.00  1714.00  1914.00
+ 6   / 3:  1316.00  1516.00  1716.00  1916.00
+ ---- K:2 Z:   3
+ 2   / 1:  1332.00  1532.00  1732.00  1932.00
+ 4   / 2:  1334.00  1534.00  1734.00  1934.00
+ 6   / 3:  1336.00  1536.00  1736.00  1936.00
+canc data/all
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1033.00  1035.00  1037.00
+ 2N   / 2:  1021.00  1023.00  1025.00  1027.00
+ 1N   / 1:  1011.00  1013.00  1015.00  1017.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2033.00  2035.00  2037.00
+ 2N   / 2:  2021.00  2023.00  2025.00  2027.00
+ 1N   / 1:  2011.00  2013.00  2015.00  2017.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  1061.00  1062.00  1063.00  1064.00
+ 4N   / 2:  1041.00  1042.00  1043.00  1044.00
+ 2N   / 1:  1021.00  1022.00  1023.00  1024.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  2061.00  2062.00  2063.00  2064.00
+ 4N   / 2:  2041.00  2042.00  2043.00  2044.00
+ 2N   / 1:  2021.00  2022.00  2023.00  2024.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1031.00  1051.00  1071.00
+ 142   / 2:  1012.00  1032.00  1052.00  1072.00
+ 143   / 3:  1013.00  1033.00  1053.00  1073.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2031.00  2051.00  2071.00
+ 142   / 2:  2012.00  2032.00  2052.00  2072.00
+ 143   / 3:  2013.00  2033.00  2053.00  2073.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  1012.00  1022.00  1032.00  1042.00
+ 144   / 2:  1014.00  1024.00  1034.00  1044.00
+ 146   / 3:  1016.00  1026.00  1036.00  1046.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  2012.00  2022.00  2032.00  2042.00
+ 144   / 2:  2014.00  2024.00  2034.00  2044.00
+ 146   / 3:  2016.00  2026.00  2036.00  2046.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  3012.00  3032.00  3052.00  3072.00
+ 144   / 2:  3014.00  3034.00  3054.00  3074.00
+ 146   / 3:  3016.00  3036.00  3056.00  3076.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  5012.00  5032.00  5052.00  5072.00
+ 144   / 2:  5014.00  5034.00  5054.00  5074.00
+ 146   / 3:  5016.00  5036.00  5056.00  5076.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  3031.00  5031.00  7031.00
+ 2N   / 2:  1021.00  3021.00  5021.00  7021.00
+ 1N   / 1:  1011.00  3011.00  5011.00  7011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  3032.00  5032.00  7032.00
+ 2N   / 2:  1022.00  3022.00  5022.00  7022.00
+ 1N   / 1:  1012.00  3012.00  5012.00  7012.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.00  2061.00  3061.00  4061.00
+ 4N   / 2:  1041.00  2041.00  3041.00  4041.00
+ 2N   / 1:  1021.00  2021.00  3021.00  4021.00
+ ---- L:2 T:   142
+ 6N   / 3:  1062.00  2062.00  3062.00  4062.00
+ 4N   / 2:  1042.00  2042.00  3042.00  4042.00
+ 2N   / 1:  1022.00  2022.00  3022.00  4022.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.00  3063.00  5063.00  7063.00
+ 4N   / 2:  1043.00  3043.00  5043.00  7043.00
+ 2N   / 1:  1023.00  3023.00  5023.00  7023.00
+ ---- L:2 T:   145
+ 6N   / 3:  1065.00  3065.00  5065.00  7065.00
+ 4N   / 2:  1045.00  3045.00  5045.00  7045.00
+ 2N   / 1:  1025.00  3025.00  5025.00  7025.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- L:2 T:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- L:2 T:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- K:2 Z:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.00  1342.00
+ 5   / 2:  1385.00  1345.00
+ ---- K:2 Z:   5
+ 2   / 1:  1582.00  1542.00
+ 5   / 2:  1585.00  1545.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+GO bn_reset
+cancel mode verify
+GO bn_non_COARDS_netCDF		! non-standard netCDF files
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME4     TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  3.00000
+ 3   / 3:  5.00000
+ 4   / 4:  2.00000
+ 5   / 5:  4.00000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:     ....
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.0000
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.0000
+ 2   / 2:  40.0000
+ 3   / 3:  30.0000
+ 4   / 4:  20.0000
+ 5   / 5:  10.0000
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cache_hits		! cache hits on unspecified (full) regions
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTX     M: 40 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 33 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 86 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 90 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5X    M: 60 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5X    M: 64 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 57 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 59 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 70 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 76 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 85 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTSBX   M:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTSBX   M: 56 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXAVE  M: 14 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXAVE  M: 17 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 28 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@SBX:3,D=1]
+ eval    SST5     C:  7 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[I=1:180 at SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7234
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.698 (unweighted average)
+ Standard deviation: 10.097
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 31 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 31 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@SBX:3,D=1]
+ eval    SST5     C:  7 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[I=1:180 at SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7234
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.698 (unweighted average)
+ Standard deviation: 10.097
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@SBX:3,D=1]
+ eval    SST5     C:  9 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 62 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[I=1:180 at SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7234
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.698 (unweighted average)
+ Standard deviation: 10.097
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 90 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 90 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=???@SBX:3,D=1]
+ eval    SST5     C:  9 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 90 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[I=1:180 at SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7234
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.698 (unweighted average)
+ Standard deviation: 10.097
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 93 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 94 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 93 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 60 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XAVE M: 59 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XAVE M: 72 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 14 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 17 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 58 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 86 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 91 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 91 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 91 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 91 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 82 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C11,V11 M: 89 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE J        M: 91 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 79 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 78 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 84 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 79 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 78 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 79 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 82 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 73 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.00000
+ 2   / 2:  5.00000
+ 3   / 3:  3.00000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 75 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 91 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 78 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 82 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 82 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 78 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 78 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 91 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 89 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 73 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 86 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 86 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 73 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 69 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 89 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.0000
+ 2   / 2:  12.0000
+ 3   / 3:  13.0000
+ 4   / 4:  21.0000
+ 5   / 5:  22.0000
+ 6   / 6:  23.0000
+ 7   / 7:  31.0000
+ 8   / 8:  32.0000
+ 9   / 9:  33.0000
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+ 
+GO bn_reset
+cancel mode verify
+ -DELETE SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  2 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 18 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 20 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 22 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 62 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 90 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C31,V11 M: 69 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C31,V11 M: 91 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 73 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 84 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 78 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 67 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 75 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 89 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 82 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+GO bn_regrid_to_user		! G=user_var and related
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.0000
+ 23E   / 2:  23.0000
+ 25E   / 3:  25.0000
+ 27E   / 4:  27.0000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G012)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX012)                         use count:   1
+    AXIS (AX020)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 2   / 2:   5.0000   7.0000   9.0000     ....
+ 3   / 3:   6.0000   8.0000  10.0000     ....
+ 4   / 4:   7.0000   9.0000  11.0000     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 3   / 2:   6.0000   8.0000  10.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX005)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G018)
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G011)
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX002)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.00000
+ 9.4S   / 4:  4.00000
+ 9.6S   / 3:  3.00000
+ 9.8S   / 2:  2.00000
+ 10S    / 1:  1.00000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G011)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX020)                         use count:   1
+ 
+ 
+! ******** V53 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_calendar
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.436165
+ 28-FEB-1988 00 / 58:  0.992873
+ 29-FEB-1988 00 / 59:  0.636738
+ 30-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 01-MAR-1988 00 / 60: -0.304811
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.8979
+ 03-DEC-1982 00 / 16:  32.9221
+ 10-DEC-1982 00 / 17:  32.9583
+ 17-DEC-1982 00 / 18:  32.9707
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 28-NOV-1982 00 / 15:  32.9508
+ 05-DEC-1982 00 / 16:  32.9011
+ 12-DEC-1982 00 / 17:  32.8862
+ 19-DEC-1982 00 / 18:  32.9099
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.9099
+ 03-DEC-1982 00 / 16:  32.9287
+ 10-DEC-1982 00 / 17:  32.9658
+ 17-DEC-1982 00 / 18:  32.9710
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT91_100 LONGITUDE          10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+             TIME: AUG-1982 to JAN-1983 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                    132.5W  
+                     98
+ 18-SEP-1982 / 2:  27.2694
+ 18-OCT-1982 / 3:  31.3241
+ 18-NOV-1982 / 4:  32.9011
+ 18-DEC-1982 / 5:  32.9710
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                         132.5W  
+                          98
+ 05-DEC-1982 00 / 108:     ....
+ 06-DEC-1982 00 / 109:  32.9340
+ 07-DEC-1982 00 / 110:  32.9401
+ 08-DEC-1982 00 / 111:  32.9462
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                    179E    
+                     80
+ 16-JAN      / 1:  28.2022
+ 15-FEB      / 2:  28.3646
+ 17-MAR      / 3:  28.3538
+ 16-AUG      / 4:     ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                    JSST    NSST
+01-JAN      / 1:     ....  28.2022
+31-JAN      / 2:  28.2832  28.2022
+01-MAR      / 3:  28.3592  28.3646
+01-APR      / 4:     ....  28.3538
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dash_dot
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ 
+GO bn_reset
+cancel mode verify
+GO bn_flowlines
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+ 
+! ******** V533 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_logaxes
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+ 
+! *kob* same tests for internal external functions but moved out of
+!       the bn_external_function jnl file.
+GO bn_reset
+cancel mode verify
+GO bn_internal_external_functions
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.013664
+ 0.00355 / 31:  0.021183
+ 0.00366 / 32:  0.048189
+ 0.00378 / 33:  0.498982
+ 0.00389 / 34:  0.052353
+ 0.00401 / 35:  0.032474
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.072791
+ 0.00584 / 51:  0.104108
+ 0.00595 / 52:  0.185372
+ 0.00607 / 53:  0.894540
+ 0.00618 / 54:  0.311122
+ 0.0063  / 55:  0.131705
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.057
+ 0       /  2: -176.112
+ 0       /  3: -174.161
+ 0       /  4: -172.203
+ 0       /  5: -170.234
+ 0       /  6: -168.251
+ 0       /  7: -166.250
+ 0       /  8: -164.228
+ 0.00103 /  9: -162.179
+ 0.00114 / 10: -160.100
+ 0.00126 / 11: -157.983
+ 0.00137 / 12: -155.821
+ 0.00149 / 13: -153.606
+ 0.0016  / 14: -151.326
+ 0.00172 / 15: -148.970
+ 0.00183 / 16: -146.520
+ 0.00195 / 17: -143.957
+ 0.00206 / 18: -141.255
+ 0.00217 / 19: -138.381
+ 0.00229 / 20: -135.294
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                  161W    
+                   90
+ 0        /  1:  1.99605
+ 0        /  2:  2.16839
+ 0        /  3:  0.17387
+ 0        /  4:  2.01530
+ 0        /  5:  0.35361
+ 0        /  6:  1.72488
+ 0        /  7:  1.25348
+ 0        /  8:  0.30416
+ 0        /  9:  1.65059
+ 0        / 10:  0.81359
+ 0        / 11:  0.15377
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                 1       
+                  21
+ 4     /  81:  0.249981
+ 4.05  /  82:  0.245294
+ 4.1   /  83:  0.240500
+ 4.15  /  84:  0.235600
+ 4.2   /  85:  0.230597
+ 4.25  /  86:  0.225493
+ 4.3   /  87:  0.220289
+ 4.35  /  88:  0.214988
+ 4.4   /  89:  0.209592
+ 4.45  /  90:  0.204102
+ 4.5   /  91:  0.198521
+ 4.55  /  92:  0.192851
+ 4.6   /  93:  0.187094
+ 4.65  /  94:  0.181253
+ 4.7   /  95:  0.175329
+ 4.75  /  96:  0.169325
+ 4.8   /  97:  0.163243
+ 4.85  /  98:  0.157086
+ 4.9   /  99:  0.150856
+ 4.95  / 100:  0.144555
+ 5     / 101:  0.138186
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.308984  0.361972  0.109085 -0.004967 -0.136744 -0.408450 -0.225496  0.151670  0.225024  0.073150
+ 1.5   /  2:  0.315638  0.371230  0.093750 -0.037386 -0.201756 -0.452435 -0.150009  0.278155  0.330914  0.069854
+ 2     /  3:  0.378812  0.315634  0.037083 -0.088708 -0.253832 -0.492242 -0.073700  0.374786  0.450968  0.081332
+ 2.5   /  4:  0.420045  0.252191 -0.063598 -0.144131 -0.252740 -0.466614  0.019391  0.439631  0.491399  0.089314
+ 3     /  5:  0.406392  0.198397 -0.139974 -0.197140 -0.279040 -0.425529  0.118978  0.432969  0.545303  0.085462
+ 3.5   /  6:  0.351014  0.169762 -0.201579 -0.257493 -0.283843 -0.357982  0.185850  0.585861  0.530755  0.058808
+ 4     /  7:  0.277107  0.096747 -0.246534 -0.289021 -0.258951 -0.329342  0.312474  0.641602  0.518714  0.021205
+ 4.5   /  8:  0.188951  0.044707 -0.312641 -0.319182 -0.213513 -0.222475  0.302121  0.626625  0.412068 -0.008475
+ 5     /  9:  0.139939 -0.037119 -0.323878 -0.333812 -0.199768 -0.134206  0.265570  0.577839  0.312094 -0.056718
+ 5.5   / 10:  0.078577 -0.096394 -0.338922 -0.312885 -0.172743 -0.085023  0.206702  0.482419  0.235803 -0.079778
+ 6     / 11:  0.007372 -0.135345 -0.377702 -0.274110 -0.121663 -0.019270  0.173802  0.354012  0.148779 -0.122582
+ 6.5   / 12: -0.071091 -0.209142 -0.370362 -0.249289 -0.041035  0.069505  0.148512  0.236838  0.045584 -0.173237
+ 7     / 13: -0.137482 -0.254334 -0.378632 -0.228148  0.063018  0.183000  0.135520  0.132174 -0.050976 -0.215292
+ 7.5   / 14: -0.202760 -0.266868 -0.346402 -0.210460  0.168372  0.279647  0.178541  0.064025 -0.115153 -0.228150
+ 8     / 15: -0.275191 -0.259180 -0.300179 -0.155421  0.233304  0.351951  0.219702  0.033928 -0.135697 -0.218938
+ 8.5   / 16: -0.326812 -0.273253 -0.245151 -0.113795  0.264889  0.402452  0.253275  0.029382 -0.138544 -0.200463
+ 9     / 17: -0.351551 -0.266762 -0.164899 -0.032110  0.276385  0.437033  0.281707  0.036426 -0.134209 -0.191118
+ 9.5   / 18: -0.364215 -0.240170 -0.093384  0.038122  0.276072  0.442607  0.294658  0.049712 -0.140883 -0.217410
+ 10    / 19: -0.369196 -0.210353 -0.040323  0.103110  0.280278  0.405237  0.298599  0.066760 -0.138644 -0.252572
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.290994  0.424162  0.097006  0.003143 -0.136744 -0.412297 -0.207808      ....  0.241076      ....
+ 1.5   /  2:  0.314929  0.373640  0.124083 -0.001456 -0.201756 -0.441151 -0.189145  0.331034  0.333491  0.005624
+ 2     /  3:  0.337643  0.312076  0.046130 -0.011788 -0.267158 -0.486359 -0.073700      ....  0.461555      ....
+ 2.5   /  4:  0.359734  0.242399 -0.066085      .... -0.243857 -0.457333 -0.031104  0.417939  0.473995  0.200894
+ 3     /  5:      ....  0.198698 -0.131262 -0.203700 -0.277160 -0.388506  0.065758  0.434211  0.539378      ....
+ 3.5   /  6:  0.310287  0.169976 -0.216298 -0.249436 -0.282498 -0.336468  0.156727  0.537358  0.505391  0.142444
+ 4     /  7:  0.274766  0.091884 -0.274252 -0.239529 -0.262206 -0.333969  0.312474  0.580377  0.520608  0.093618
+ 4.5   /  8:  0.184044  0.041657 -0.304953      .... -0.210582 -0.196012  0.326227  0.576412  0.366262  0.059061
+ 5     /  9:  0.146796 -0.044536 -0.353323 -0.375483 -0.190888 -0.106617  0.284743  0.521940  0.278387 -0.035055
+ 5.5   / 10:  0.041582 -0.109698 -0.335399 -0.325452      .... -0.088590  0.221990  0.438637  0.235803  0.041225
+ 6     / 11: -0.012273 -0.174380 -0.371063 -0.263403      ....      ....  0.172629  0.346297  0.219052      ....
+ 6.5   / 12: -0.064809 -0.127226 -0.366128 -0.245270      ....  0.104409  0.165680  0.242858  0.095140      ....
+ 7     / 13: -0.138619      .... -0.379843 -0.230018      ....  0.181947  0.135892  0.164309 -0.026041 -0.204659
+ 7.5   / 14: -0.203907 -0.289087 -0.346009 -0.209873  0.169451  0.272161  0.184553  0.103343 -0.114248      ....
+ 8     / 15: -0.285911 -0.258721 -0.300520 -0.170515  0.240968  0.352162  0.229361  0.066151 -0.135985      ....
+ 8.5   / 16: -0.329428 -0.279209 -0.236667 -0.125716  0.292407  0.388989  0.256564      .... -0.139683 -0.183944
+ 9     / 17: -0.341597 -0.268585 -0.177502 -0.064298  0.277369  0.431662  0.288204  0.023055 -0.139178 -0.195303
+ 9.5   / 18: -0.343919 -0.225702 -0.093580  0.013191  0.253357  0.442399  0.294693  0.034103 -0.137639 -0.211783
+ 10    / 19:      .... -0.204222 -0.021547      ....      ....  0.421118  0.287954      .... -0.144731 -0.203650
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.274901  0.351990  0.125870  0.000547 -0.130676 -0.409444 -0.196473  0.113026  0.291807  0.128390
+ 1.5   /  2:  0.299222  0.340543  0.124519 -0.061100 -0.263759 -0.435083 -0.176723  0.348424  0.372371  0.128390
+ 2     /  3:  0.281567  0.320514  0.026296 -0.110384 -0.295665 -0.434870 -0.190697  0.460511  0.445156  0.191902
+ 2.5   /  4:  0.290517  0.274621 -0.063970 -0.166628 -0.264776 -0.417589 -0.116164  0.537969  0.442169  0.264943
+ 3     /  5:  0.291464  0.248219 -0.125567 -0.223844 -0.256285 -0.371561  0.247717  0.497526  0.452304  0.276328
+ 3.5   /  6:  0.267037  0.177128 -0.170576 -0.230988 -0.274809 -0.281194  0.254637  0.510104  0.422794  0.248322
+ 4     /  7:  0.225394  0.114379 -0.176660 -0.227903 -0.272403 -0.244676  0.280180  0.544886  0.397193  0.212214
+ 4.5   /  8:  0.189285  0.081180 -0.332907 -0.343445 -0.230804 -0.244260  0.339829  0.530983  0.335082  0.061286
+ 5     /  9:  0.127042  0.039043 -0.356226 -0.369075 -0.177935 -0.153186  0.253590  0.499044  0.303545  0.025609
+ 5.5   / 10:  0.048635 -0.126901 -0.331398 -0.289789 -0.162591 -0.082396  0.192227  0.401098  0.303746  0.055576
+ 6     / 11: -0.037713 -0.136552 -0.336681 -0.268753 -0.197051  0.016254  0.209390  0.295370  0.263940 -0.135684
+ 6.5   / 12: -0.064917 -0.134912 -0.359398 -0.220212 -0.011644  0.110802  0.164667  0.259319  0.078530 -0.137706
+ 7     / 13: -0.103972 -0.140560 -0.362975 -0.166853  0.066535  0.193231  0.149487  0.141794 -0.113016 -0.143405
+ 7.5   / 14: -0.199710 -0.279592 -0.339043 -0.191829  0.185240  0.262158  0.152165  0.039367 -0.115781 -0.151274
+ 8     / 15: -0.235285 -0.278212 -0.283035 -0.157240  0.250258  0.333134  0.204490  0.017943 -0.115931 -0.171603
+ 8.5   / 16: -0.306008 -0.278546 -0.240470 -0.100659  0.251651  0.363846  0.251194  0.080410 -0.130532 -0.187823
+ 9     / 17: -0.335648 -0.266336 -0.213641  0.013456  0.288406  0.405273  0.272644  0.141238 -0.142601 -0.193561
+ 9.5   / 18: -0.349458 -0.212960 -0.108340  0.097657  0.205467  0.422547  0.294706  0.116317 -0.143410 -0.195569
+ 10    / 19: -0.353035 -0.181573 -0.086119  0.078837  0.108731  0.420380  0.321587  0.036216 -0.151253 -0.191472
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.281552  0.312213  0.193558 -0.030592 -0.206961 -0.317374 -0.200235  0.035776  0.251615  0.217897
+ 1.5   /  2:  0.275271  0.296173  0.155526 -0.085149 -0.266966 -0.350539 -0.202341  0.168678  0.341517  0.274690
+ 2     /  3:  0.267170  0.260868  0.085385 -0.139671 -0.296632 -0.356898 -0.159219  0.302176  0.393862  0.319020
+ 2.5   /  4:  0.256878  0.203678  0.000735 -0.176300 -0.300338 -0.332200 -0.037496  0.393557  0.416391  0.336288
+ 3     /  5:  0.242290  0.152878 -0.057424 -0.197874 -0.288975 -0.265744  0.103144  0.430207  0.412825  0.327333
+ 3.5   /  6:  0.222556  0.121831 -0.090666 -0.216330 -0.271362 -0.184480  0.187704  0.436022  0.391648  0.301597
+ 4     /  7:  0.199438  0.094153 -0.126981 -0.240001 -0.252964 -0.137926  0.223192  0.431619  0.360695  0.262091
+ 4.5   /  8:  0.165055  0.052904 -0.183379 -0.267119 -0.231965 -0.117235  0.236822  0.416791  0.325354  0.213933
+ 5     /  9:  0.103166 -0.013463 -0.234016 -0.283000 -0.207964 -0.093414  0.234809  0.379625  0.299928  0.181999
+ 5.5   / 10:  0.019557 -0.082190 -0.253614 -0.280357 -0.179994 -0.046106  0.219394  0.327974  0.276824  0.165491
+ 6     / 11: -0.043123 -0.124439 -0.262702 -0.257404 -0.115678  0.036003  0.200459  0.273757  0.219858  0.088693
+ 6.5   / 12: -0.080238 -0.159570 -0.282392 -0.216326  0.011196  0.126375  0.181603  0.207992  0.109108 -0.036546
+ 7     / 13: -0.125137 -0.215907 -0.293904 -0.180571  0.098961  0.191463  0.171154  0.130122 -0.005575 -0.104958
+ 7.5   / 14: -0.186850 -0.262803 -0.283642 -0.149158  0.150674  0.242358  0.181345  0.073483 -0.066151 -0.129099
+ 8     / 15: -0.238052 -0.273211 -0.262614 -0.116643  0.191858  0.284230  0.210919  0.059208 -0.090155 -0.143986
+ 8.5   / 16: -0.274654 -0.269613 -0.239107 -0.087178  0.223535  0.315867  0.242668  0.071672 -0.107088 -0.159422
+ 9     / 17: -0.300031 -0.259464 -0.211792 -0.059935  0.246533  0.340287  0.266976  0.081553 -0.124034 -0.168991
+ 9.5   / 18: -0.314125 -0.241656 -0.177924 -0.031561  0.260916  0.358325  0.284307  0.073478 -0.135647 -0.172063
+ 10    / 19: -0.318713 -0.220992 -0.146630 -0.009841  0.266488  0.369766  0.296933  0.053734 -0.142473 -0.172360
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G010)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                 50E      52.1E    54.2E    56.3E    58.4E    60.5E    62.6E    64.7E    66.8E    68.9E  
+                  1        3        5        7        9       11       13       15       17       19
+ 20N    / 20:     ....     ....     ....     ....  143.990  241.090     ....     ....     ....     ....
+ 19.47N / 19:     ....     ....     ....     ....  117.831  207.449  172.925     ....     ....     ....
+ 18.95N / 18:     ....     ....     ....  137.758  107.307   98.003     ....     ....     ....     ....
+ 18.42N / 17:     ....     ....     ....  161.079  156.071    7.072   16.239     ....     ....     ....
+ 17.9N  / 16:     ....     ....     ....  179.862  189.128   81.665     ....     ....     ....     ....
+ 17.37N / 15:     ....     ....     ....  165.097  200.741  145.418     ....     ....     ....     ....
+ 16.84N / 14:     ....     ....     ....  128.322  183.027  168.029  182.582     ....     ....     ....
+ 16.32N / 13:     ....     ....   76.347   92.413  158.520  190.506  197.367     ....     ....     ....
+ 15.79N / 12:     ....     ....     ....   80.307     ....  189.841  195.829     ....     ....     ....
+ 15.26N / 11:     ....     ....     ....   72.161     ....  187.475  191.467     ....     ....     ....
+ 14.74N / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 14.21N /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.68N /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.16N /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.63N /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.11N /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.58N /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.05N /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10.53N /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10N    /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 28N   / 10:      ....  0.000000 -0.017348 -0.052117 -0.086972 -0.121869 -0.156767 -0.191621 -0.226391 -0.243739      ....
+ 26N   /  9:      ....  0.017348  0.000000 -0.034770 -0.069624 -0.104522 -0.139419 -0.174274 -0.209043 -0.226391      ....
+ 24N   /  8:      ....  0.052117  0.034770  0.000000 -0.034855 -0.069752 -0.104649 -0.139504 -0.174274 -0.191621      ....
+ 22N   /  7:      ....  0.086972  0.069624  0.034855  0.000000 -0.034897 -0.069794 -0.104649 -0.139419 -0.156767      ....
+ 20N   /  6:      ....  0.121869  0.104522  0.069752  0.034897  0.000000 -0.034897 -0.069752 -0.104522 -0.121869      ....
+ 18N   /  5:      ....  0.156767  0.139419  0.104649  0.069794  0.034897  0.000000 -0.034855 -0.069624 -0.086972      ....
+ 16N   /  4:      ....  0.191621  0.174274  0.139504  0.104649  0.069752  0.034855  0.000000 -0.034770 -0.052117      ....
+ 14N   /  3:      ....  0.226391  0.209043  0.174274  0.139419  0.104522  0.069624  0.034770  0.000000 -0.017348      ....
+ 12N   /  2:      ....  0.243739  0.226391  0.191621  0.156767  0.121869  0.086972  0.052117  0.017348  0.000000      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      .... -0.057531 -0.086987 -0.119152 -0.153259 -0.187881 -0.221435 -0.252146 -0.279109      ....
+ 28N   / 10:      ....  0.001469 -0.031719 -0.066314 -0.100631 -0.135459 -0.170322 -0.204898 -0.238648 -0.268796 -0.279109
+ 26N   /  9:      ....  0.030054  0.001289 -0.034598 -0.069227 -0.104122 -0.139020 -0.173835 -0.208160 -0.238648 -0.252146
+ 24N   /  8:      ....  0.062225  0.036296 -0.000330 -0.034822 -0.069721 -0.104621 -0.139444 -0.173835 -0.204898 -0.221435
+ 22N   /  7:      ....  0.096660  0.071306  0.034440  0.000001 -0.034898 -0.069798 -0.104621 -0.139020 -0.170322 -0.187881
+ 20N   /  6:      ....  0.131820  0.106170  0.069324  0.034901  0.000001 -0.034898 -0.069721 -0.104122 -0.135459 -0.153259
+ 18N   /  5:      ....  0.166766  0.141022  0.104198  0.069800  0.034901  0.000001 -0.034822 -0.069227 -0.100631 -0.119152
+ 16N   /  4:      ....  0.200738  0.175293  0.138438  0.104198  0.069324  0.034440 -0.000330 -0.034598 -0.066314 -0.086987
+ 14N   /  3:      ....  0.233148  0.215255  0.175293  0.141022  0.106170  0.071306  0.036296  0.001289 -0.031719 -0.057531
+ 12N   /  2:      ....      ....  0.233148  0.200738  0.166766  0.131820  0.096660  0.062225  0.030054  0.001469      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+           SMXZ_XS   SMXZ_ZS   SMXZ
+1    /  1:  173.000  15.0000  1.51981
+2    /  2:  174.000  15.0000  1.50247
+3    /  3:  175.000  15.0000  1.48510
+4    /  4:  176.000  15.0000  1.46770
+5    /  5:  177.000  15.0000  1.45028
+6    /  6:  178.000  15.0000  1.43284
+7    /  7:  179.000  15.0000  1.41539
+8    /  8:  180.000  15.0000  1.39794
+9    /  9: -179.000  15.0000  1.38049
+10   / 10: -178.000  15.0000  1.36304
+11   / 11: -177.000  15.0000  1.34560
+12   / 12: -176.000  15.0000  1.32818
+13   / 13: -175.000  15.0000  1.31078
+14   / 14: -174.000  15.0000  1.29341
+15   / 15: -173.000  15.0000  1.27607
+16   / 16:  173.000  20.0000  1.59899
+17   / 17:  174.000  20.0000  1.58165
+18   / 18:  175.000  20.0000  1.56428
+19   / 19:  176.000  20.0000  1.54688
+20   / 20:  177.000  20.0000  1.52946
+21   / 21:  178.000  20.0000  1.51202
+22   / 22:  179.000  20.0000  1.49457
+23   / 23:  180.000  20.0000  1.47712
+24   / 24: -179.000  20.0000  1.45967
+25   / 25: -178.000  20.0000  1.44222
+26   / 26: -177.000  20.0000  1.42479
+27   / 27: -176.000  20.0000  1.40736
+28   / 28: -175.000  20.0000  1.38997
+29   / 29: -174.000  20.0000  1.37259
+30   / 30: -173.000  20.0000  1.35525
+31   / 31:  173.000  25.0000  1.66594
+32   / 32:  174.000  25.0000  1.64860
+33   / 33:  175.000  25.0000  1.63122
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+           SMXT_XS   SMXT_TS   SMXT
+1    /  1:  173.000   273.75  2.63208
+2    /  2:  174.000   273.75  2.61474
+3    /  3:  175.000   273.75  2.59737
+4    /  4:  176.000   273.75  2.57997
+5    /  5:  177.000   273.75  2.56255
+6    /  6:  178.000   273.75  2.54511
+7    /  7:  179.000   273.75  2.52766
+8    /  8:  180.000   273.75  2.51021
+9    /  9: -179.000   273.75  2.49276
+10   / 10: -178.000   273.75  2.47531
+11   / 11: -177.000   273.75  2.45787
+12   / 12: -176.000   273.75  2.44045
+13   / 13: -175.000   273.75  2.42305
+14   / 14: -174.000   273.75  2.40568
+15   / 15: -173.000   273.75  2.38834
+16   / 16:  173.000   821.25  3.06201
+17   / 17:  174.000   821.25  3.04467
+18   / 18:  175.000   821.25  3.02730
+19   / 19:  176.000   821.25  3.00990
+20   / 20:  177.000   821.25  2.99248
+21   / 21:  178.000   821.25  2.97504
+22   / 22:  179.000   821.25  2.95760
+23   / 23:  180.000   821.25  2.94014
+24   / 24: -179.000   821.25  2.92269
+25   / 25: -178.000   821.25  2.90524
+26   / 26: -177.000   821.25  2.88781
+27   / 27: -176.000   821.25  2.87039
+28   / 28: -175.000   821.25  2.85299
+29   / 29: -174.000   821.25  2.83561
+30   / 30: -173.000   821.25  2.81827
+31   / 31:  173.000  1368.75  3.27378
+32   / 32:  174.000  1368.75  3.25643
+33   / 33:  175.000  1368.75  3.23906
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+           SMYZ_YS   SMYZ_ZS   SMYZ
+1    /  1:  13.0000  15.0000  1.51981
+2    /  2:  14.0000  15.0000  1.50247
+3    /  3:  15.0000  15.0000  1.48510
+4    /  4:  16.0000  15.0000  1.46770
+5    /  5:  17.0000  15.0000  1.45028
+6    /  6:  18.0000  15.0000  1.43284
+7    /  7:  19.0000  15.0000  1.41539
+8    /  8:  20.0000  15.0000  1.39794
+9    /  9:  21.0000  15.0000  1.38049
+10   / 10:  22.0000  15.0000  1.36304
+11   / 11:  23.0000  15.0000  1.34560
+12   / 12:  24.0000  15.0000  1.32818
+13   / 13:  25.0000  15.0000  1.31078
+14   / 14:  26.0000  15.0000  1.29341
+15   / 15:  27.0000  15.0000  1.27607
+16   / 16:  13.0000  20.0000  1.59899
+17   / 17:  14.0000  20.0000  1.58165
+18   / 18:  15.0000  20.0000  1.56428
+19   / 19:  16.0000  20.0000  1.54688
+20   / 20:  17.0000  20.0000  1.52946
+21   / 21:  18.0000  20.0000  1.51202
+22   / 22:  19.0000  20.0000  1.49457
+23   / 23:  20.0000  20.0000  1.47712
+24   / 24:  21.0000  20.0000  1.45967
+25   / 25:  22.0000  20.0000  1.44222
+26   / 26:  23.0000  20.0000  1.42479
+27   / 27:  24.0000  20.0000  1.40736
+28   / 28:  25.0000  20.0000  1.38997
+29   / 29:  26.0000  20.0000  1.37259
+30   / 30:  27.0000  20.0000  1.35525
+31   / 31:  13.0000  25.0000  1.66594
+32   / 32:  14.0000  25.0000  1.64860
+33   / 33:  15.0000  25.0000  1.63122
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+           SMYT_YS   SMYT_TS   SMYT
+1    /  1:  13.0000   273.75  2.63208
+2    /  2:  14.0000   273.75  2.61474
+3    /  3:  15.0000   273.75  2.59737
+4    /  4:  16.0000   273.75  2.57997
+5    /  5:  17.0000   273.75  2.56255
+6    /  6:  18.0000   273.75  2.54511
+7    /  7:  19.0000   273.75  2.52766
+8    /  8:  20.0000   273.75  2.51021
+9    /  9:  21.0000   273.75  2.49276
+10   / 10:  22.0000   273.75  2.47531
+11   / 11:  23.0000   273.75  2.45787
+12   / 12:  24.0000   273.75  2.44045
+13   / 13:  25.0000   273.75  2.42305
+14   / 14:  26.0000   273.75  2.40568
+15   / 15:  27.0000   273.75  2.38834
+16   / 16:  13.0000   821.25  3.06201
+17   / 17:  14.0000   821.25  3.04467
+18   / 18:  15.0000   821.25  3.02730
+19   / 19:  16.0000   821.25  3.00990
+20   / 20:  17.0000   821.25  2.99248
+21   / 21:  18.0000   821.25  2.97504
+22   / 22:  19.0000   821.25  2.95760
+23   / 23:  20.0000   821.25  2.94014
+24   / 24:  21.0000   821.25  2.92269
+25   / 25:  22.0000   821.25  2.90524
+26   / 26:  23.0000   821.25  2.88781
+27   / 27:  24.0000   821.25  2.87039
+28   / 28:  25.0000   821.25  2.85299
+29   / 29:  26.0000   821.25  2.83561
+30   / 30:  27.0000   821.25  2.81827
+31   / 31:  13.0000  1368.75  3.27378
+32   / 32:  14.0000  1368.75  3.25643
+33   / 33:  15.0000  1368.75  3.23906
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+           SMZT_ZS   SMZT_TS   SMZT
+1    /  1:  15.0000   273.75  3.90815
+2    /  2:  20.0000   273.75  3.98733
+3    /  3:  25.0000   273.75  4.05428
+4    /  4:  30.0000   273.75  4.11227
+5    /  5:  35.0000   273.75  4.16342
+6    /  6:  40.0000   273.75  4.20918
+7    /  7:  45.0000   273.75  4.25057
+8    /  8:  50.0000   273.75  4.28836
+9    /  9:  55.0000   273.75  4.32312
+10   / 10:  60.0000   273.75  4.35531
+11   / 11:  65.0000   273.75  4.38527
+12   / 12:  70.0000   273.75  4.41330
+13   / 13:  75.0000   273.75  4.43963
+14   / 14:  80.0000   273.75  4.46445
+15   / 15:  85.0000   273.75  4.48793
+16   / 16:  15.0000   821.25  4.33808
+17   / 17:  20.0000   821.25  4.41726
+18   / 18:  25.0000   821.25  4.48421
+19   / 19:  30.0000   821.25  4.54220
+20   / 20:  35.0000   821.25  4.59336
+21   / 21:  40.0000   821.25  4.63911
+22   / 22:  45.0000   821.25  4.68051
+23   / 23:  50.0000   821.25  4.71829
+24   / 24:  55.0000   821.25  4.75306
+25   / 25:  60.0000   821.25  4.78524
+26   / 26:  65.0000   821.25  4.81520
+27   / 27:  70.0000   821.25  4.84323
+28   / 28:  75.0000   821.25  4.86956
+29   / 29:  80.0000   821.25  4.89439
+30   / 30:  85.0000   821.25  4.91787
+31   / 31:  15.0000  1368.75  4.54985
+32   / 32:  20.0000  1368.75  4.62903
+33   / 33:  25.0000  1368.75  4.69597
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  3.90815  3.98474  4.11082  4.20825  4.28772  4.35484  4.41294  4.46417  4.48793     ....
+ 15-FEB-1995 /  2:     ....  4.44396  4.52055  4.64663  4.74407  4.82353  4.89065  4.94875  4.99998  5.02375     ....
+ 18-MAR-1995 /  3:     ....  4.69158  4.76817  4.89425  4.99168  5.07115  5.13827  5.19637  5.24760  5.27136     ....
+ 17-APR-1995 /  4:     ....  4.79826  4.87485  5.00093  5.09837  5.17783  5.24495  5.30305  5.35428  5.37805     ....
+ 17-MAY-1995 /  5:     ....  4.91957  4.99616  5.12224  5.21967  5.29914  5.36626  5.42436  5.47559  5.49935     ....
+ 17-JUN-1995 /  6:     ....  5.01664  5.09323  5.21931  5.31675  5.39621  5.46333  5.52143  5.57266  5.59643     ....
+ 17-JUL-1995 /  7:     ....  5.07038  5.14697  5.27305  5.37049  5.44995  5.51707  5.57517  5.62640  5.65017     ....
+ 17-AUG-1995 /  8:     ....  5.13974  5.21633  5.34241  5.43984  5.51931  5.58643  5.64453  5.69576  5.71952     ....
+ 16-SEP-1995 /  9:     ....  5.20046  5.27705  5.40313  5.50056  5.58003  5.64714  5.70525  5.75648  5.78024     ....
+ 16-OCT-1995 / 10:     ....  5.23640  5.31298  5.43907  5.53650  5.61597  5.68308  5.74119  5.79241  5.81618     ....
+ 16-NOV-1995 / 11:     ....  5.28500  5.36159  5.48767  5.58511  5.66457  5.73169  5.78979  5.84102  5.86479     ....
+ 16-DEC-1995 / 12:     ....  5.32921  5.40580  5.53188  5.62931  5.70878  5.77589  5.83400  5.88523  5.90899     ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  4.01260  4.01103  4.18210  4.27779  4.35640  4.42302  4.48082  4.53115  4.59056  4.66549
+ 15-FEB-1995 /  2:     ....  4.33307  4.54051  4.67120  4.76690  4.84550  4.91213  4.96992  5.02025  5.05263  4.98503
+ 18-MAR-1995 /  3:     ....  4.58238  4.74650  4.87751  4.97320  5.05181  5.11843  5.17623  5.22656  5.25909  5.23387
+ 17-APR-1995 /  4:     ....  4.74816  4.87728  5.01937  5.11506  5.19367  5.26030  5.31809  5.36842  5.40831  5.39943
+ 17-MAY-1995 /  5:     ....  4.86788  4.98645  5.12825  5.22394  5.30254  5.36917  5.42697  5.47730  5.51696  5.51891
+ 17-JUN-1995 /  6:     ....  4.95864  5.07392  5.21453  5.31022  5.38882  5.45545  5.51325  5.56358  5.60243  5.60948
+ 17-JUL-1995 /  7:     ....  5.02839  5.14132  5.28493  5.38062  5.45923  5.52585  5.58365  5.63398  5.67485  5.67935
+ 17-AUG-1995 /  8:     ....  5.09002  5.20515  5.34732  5.44301  5.52162  5.58824  5.64604  5.69637  5.73635  5.74158
+ 16-SEP-1995 /  9:     ....  5.14392  5.26070  5.40159  5.49728  5.57588  5.64251  5.70031  5.75064  5.78987  5.79641
+ 16-OCT-1995 / 10:     ....  5.18891  5.30597  5.44856  5.54425  5.62285  5.68948  5.74728  5.79761  5.83810  5.84235
+ 16-NOV-1995 / 11:     ....  5.23042  5.35103  5.49229  5.58798  5.66658  5.73321  5.79101  5.84134  5.88103  5.88458
+ 16-DEC-1995 / 12:     ....  5.26827  5.39059  5.53066  5.62635  5.70495  5.77158  5.82938  5.87971  5.91865  5.92282
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G017)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                 68.25N   68.75N   69.25N   69.75N   70.25N   70.75N   71.25N   71.75N  
+                  43       44       45       46       47       48       49       50
+ 15.5E / -105:     ....     ....     ....     ....     ....     ....     ....     ....
+ 16.5E / -104:     ....     ....     ....     ....     ....     ....     ....     ....
+ 17.5E / -103:     ....     ....     ....     ....     ....     ....     ....     ....
+ 18.5E / -102:     ....     ....     ....  0.45146  0.25859     ....     ....     ....
+ 19.5E / -101:     ....     ....  0.67000  0.52258  0.17310  0.04000     ....     ....
+ 20.5E / -100:     ....     ....     ....  0.45141  0.25856     ....     ....     ....
+ 21.5E /  -99:     ....     ....     ....     ....     ....     ....     ....     ....
+ 22.5E /  -98:     ....     ....     ....     ....     ....     ....     ....     ....
+ 23.5E /  -97:     ....     ....     ....     ....     ....     ....     ....     ....
+ 24.5E /  -96:     ....     ....     ....     ....     ....     ....     ....     ....
+ 25.5E /  -95:     ....     ....     ....     ....     ....     ....     ....     ....
+ 26.5E /  -94:     ....     ....     ....     ....     ....     ....     ....     ....
+ 27.5E /  -93:     ....     ....     ....     ....     ....     ....     ....     ....
+ 28.5E /  -92:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 29.5E /  -91:     ....     ....     ....  1.17000  1.17000  1.17000     ....     ....
+ 30.5E /  -90:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 31.5E /  -89:     ....     ....     ....     ....     ....     ....     ....     ....
+ 32.5E /  -88:     ....     ....     ....     ....     ....     ....     ....     ....
+ 33.5E /  -87:     ....     ....     ....     ....     ....     ....     ....     ....
+ 34.5E /  -86:     ....     ....     ....     ....     ....     ....     ....     ....
+ 35.5E /  -85:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 36.5E /  -84:     ....  1.34000  1.34000  1.34000     ....     ....     ....     ....
+ 37.5E /  -83:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 38.5E /  -82:     ....     ....     ....     ....     ....     ....     ....     ....
+ 39.5E /  -81:     ....     ....     ....     ....     ....     ....     ....     ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+          SMXYT_XS  SMXYT_YS SMXYT_TS   SMXYT
+1    /  1:  173.000  13.0000  273.750  2.75395
+2    /  2:  174.000  13.0000  273.750  2.73661
+3    /  3:  175.000  13.0000  273.750  2.71923
+4    /  4:  176.000  13.0000  273.750  2.70184
+5    /  5:  177.000  13.0000  273.750  2.68442
+6    /  6:  178.000  13.0000  273.750  2.66698
+7    /  7:  179.000  13.0000  273.750  2.64953
+8    /  8:  180.000  13.0000  273.750  2.63208
+9    /  9: -179.000  13.0000  273.750  2.61463
+10   / 10: -178.000  13.0000  273.750  2.59718
+11   / 11: -177.000  13.0000  273.750  2.57974
+12   / 12: -176.000  13.0000  273.750  2.56232
+13   / 13: -175.000  13.0000  273.750  2.54492
+14   / 14: -174.000  13.0000  273.750  2.52755
+15   / 15: -173.000  13.0000  273.750  2.51021
+16   / 16:  173.000  14.0000  273.750  2.73661
+17   / 17:  174.000  14.0000  273.750  2.71927
+18   / 18:  175.000  14.0000  273.750  2.70189
+19   / 19:  176.000  14.0000  273.750  2.68449
+20   / 20:  177.000  14.0000  273.750  2.66707
+21   / 21:  178.000  14.0000  273.750  2.64964
+22   / 22:  179.000  14.0000  273.750  2.63219
+23   / 23:  180.000  14.0000  273.750  2.61474
+24   / 24: -179.000  14.0000  273.750  2.59729
+25   / 25: -178.000  14.0000  273.750  2.57984
+26   / 26: -177.000  14.0000  273.750  2.56240
+27   / 27: -176.000  14.0000  273.750  2.54498
+28   / 28: -175.000  14.0000  273.750  2.52758
+29   / 29: -174.000  14.0000  273.750  2.51021
+30   / 30: -173.000  14.0000  273.750  2.49287
+31   / 31:  173.000  15.0000  273.750  2.71923
+32   / 32:  174.000  15.0000  273.750  2.70189
+33   / 33:  175.000  15.0000  273.750  2.68452
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ ---- L:1 T:   JAN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:2 T:   FEB-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:3 T:   MAR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:4 T:   APR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:5 T:   MAY-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:6 T:   JUN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:7 T:   JUL-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:8 T:   AUG-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:9 T:   SEP-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:10 T:   OCT-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:11 T:   NOV-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:12 T:   DEC-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: JAN-1995 to JAN-1996
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                   LTP50_TAX   LOGTP50
+06-JAN-1995 16 /  1:   136.88  2.27155
+18-JAN-1995 02 /  2:   410.63  2.66335
+29-JAN-1995 12 /  3:   684.38  2.86592
+09-FEB-1995 22 /  4:   958.13  3.00351
+21-FEB-1995 07 /  5:  1231.88  3.10785
+04-MAR-1995 17 /  6:  1505.63  3.19190
+16-MAR-1995 03 /  7:  1779.38  3.26230
+27-MAR-1995 13 /  8:  2053.13  3.32287
+07-APR-1995 22 /  9:  2326.88  3.37601
+19-APR-1995 08 / 10:  2600.63  3.42335
+30-APR-1995 18 / 11:  2874.38  3.46603
+12-MAY-1995 04 / 12:  3148.13  3.50490
+23-MAY-1995 13 / 13:  3421.88  3.54056
+03-JUN-1995 23 / 14:  3695.63  3.57352
+15-JUN-1995 09 / 15:  3969.38  3.60416
+26-JUN-1995 19 / 16:  4243.13  3.63277
+08-JUL-1995 04 / 17:  4516.88  3.65962
+19-JUL-1995 14 / 18:  4790.63  3.68490
+31-JUL-1995 00 / 19:  5064.38  3.70879
+11-AUG-1995 10 / 20:  5338.13  3.73144
+22-AUG-1995 19 / 21:  5611.88  3.75296
+03-SEP-1995 05 / 22:  5885.63  3.77347
+14-SEP-1995 15 / 23:  6159.38  3.79305
+26-SEP-1995 01 / 24:  6433.13  3.81178
+07-OCT-1995 10 / 25:  6706.88  3.82975
+18-OCT-1995 20 / 26:  6980.63  3.84699
+30-OCT-1995 06 / 27:  7254.38  3.86358
+10-NOV-1995 16 / 28:  7528.13  3.87956
+22-NOV-1995 01 / 29:  7801.88  3.89497
+03-DEC-1995 11 / 30:  8075.63  3.90986
+14-DEC-1995 21 / 31:  8349.38  3.92425
+26-DEC-1995 07 / 32:  8623.13  3.93818
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: JAN-1995 to JAN-1996
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                  NEW_TAX    AVE_T    T_CNT
+16-JAN-1995 /  1:   365.00  2.60027  3.00000
+15-FEB-1995 /  2:  1095.00  3.05568  2.00000
+18-MAR-1995 /  3:  1825.00  3.25902  3.00000
+17-APR-1995 /  4:  2555.00  3.42180  3.00000
+17-MAY-1995 /  5:  3285.00  3.52273  2.00000
+17-JUN-1995 /  6:  4015.00  3.60349  3.00000
+17-JUL-1995 /  7:  4745.00  3.68444  3.00000
+17-AUG-1995 /  8:  5475.00  3.74220  2.00000
+16-SEP-1995 /  9:  6205.00  3.79277  3.00000
+16-OCT-1995 / 10:  6935.00  3.84677  3.00000
+16-NOV-1995 / 11:  7665.00  3.88727  2.00000
+16-DEC-1995 / 12:  8395.00  3.92409  3.00000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+              1        2        3        4     
+              1        2        3        4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    5.000   10.000   15.000
+ 2   / 2:    1.000    6.000   11.000   16.000
+ 3   / 3:    2.000    7.000   12.000   17.000
+ 4   / 4:    3.000    8.000   13.000   18.000
+ 5   / 5:    4.000    9.000   14.000   19.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   25.000   30.000   35.000
+ 2   / 2:   21.000   26.000   31.000   36.000
+ 3   / 3:   22.000   27.000   32.000   37.000
+ 4   / 4:   23.000   28.000   33.000   38.000
+ 5   / 5:   24.000   29.000   34.000   39.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   45.000   50.000   55.000
+ 2   / 2:   41.000   46.000   51.000   56.000
+ 3   / 3:   42.000   47.000   52.000   57.000
+ 4   / 4:   43.000   48.000   53.000   58.000
+ 5   / 5:   44.000   49.000   54.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.000   65.000   70.000   75.000
+ 2   / 2:   61.000   66.000   71.000   76.000
+ 3   / 3:   62.000   67.000   72.000   77.000
+ 4   / 4:   63.000   68.000   73.000   78.000
+ 5   / 5:   64.000   69.000   74.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   80.000   85.000   90.000   95.000
+ 2   / 2:   81.000   86.000   91.000   96.000
+ 3   / 3:   82.000   87.000   92.000   97.000
+ 4   / 4:   83.000   88.000   93.000   98.000
+ 5   / 5:   84.000   89.000   94.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:  100.000  105.000  110.000  115.000
+ 2   / 2:  101.000  106.000  111.000  116.000
+ 3   / 3:  102.000  107.000  112.000  117.000
+ 4   / 4:  103.000  108.000  113.000  118.000
+ 5   / 5:  104.000  109.000  114.000  119.000
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.000   20.000   40.000
+ 1   / 2:    5.000   25.000   45.000
+ 2   / 3:   10.000   30.000   50.000
+ 3   / 4:   15.000   35.000   55.000
+ ---- K:2 Z:   2
+ 0   / 1:    1.000   21.000   41.000
+ 1   / 2:    6.000   26.000   46.000
+ 2   / 3:   11.000   31.000   51.000
+ 3   / 4:   16.000   36.000   56.000
+ ---- K:3 Z:   3
+ 0   / 1:    2.000   22.000   42.000
+ 1   / 2:    7.000   27.000   47.000
+ 2   / 3:   12.000   32.000   52.000
+ 3   / 4:   17.000   37.000   57.000
+ ---- K:4 Z:   4
+ 0   / 1:    3.000   23.000   43.000
+ 1   / 2:    8.000   28.000   48.000
+ 2   / 3:   13.000   33.000   53.000
+ 3   / 4:   18.000   38.000   58.000
+ ---- K:5 Z:   5
+ 0   / 1:    4.000   24.000   44.000
+ 1   / 2:    9.000   29.000   49.000
+ 2   / 3:   14.000   34.000   54.000
+ 3   / 4:   19.000   39.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.000   80.000  100.000
+ 1   / 2:   65.000   85.000  105.000
+ 2   / 3:   70.000   90.000  110.000
+ 3   / 4:   75.000   95.000  115.000
+ ---- K:2 Z:   2
+ 0   / 1:   61.000   81.000  101.000
+ 1   / 2:   66.000   86.000  106.000
+ 2   / 3:   71.000   91.000  111.000
+ 3   / 4:   76.000   96.000  116.000
+ ---- K:3 Z:   3
+ 0   / 1:   62.000   82.000  102.000
+ 1   / 2:   67.000   87.000  107.000
+ 2   / 3:   72.000   92.000  112.000
+ 3   / 4:   77.000   97.000  117.000
+ ---- K:4 Z:   4
+ 0   / 1:   63.000   83.000  103.000
+ 1   / 2:   68.000   88.000  108.000
+ 2   / 3:   73.000   93.000  113.000
+ 3   / 4:   78.000   98.000  118.000
+ ---- K:5 Z:   5
+ 0   / 1:   64.000   84.000  104.000
+ 1   / 2:   69.000   89.000  109.000
+ 2   / 3:   74.000   94.000  114.000
+ 3   / 4:   79.000   99.000  119.000
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.000   60.000
+ 1   / 2:    5.000   65.000
+ 2   / 3:   10.000   70.000
+ 3   / 4:   15.000   75.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   80.000
+ 1   / 2:   25.000   85.000
+ 2   / 3:   30.000   90.000
+ 3   / 4:   35.000   95.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000  100.000
+ 1   / 2:   45.000  105.000
+ 2   / 3:   50.000  110.000
+ 3   / 4:   55.000  115.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.000   61.000
+ 1   / 2:    6.000   66.000
+ 2   / 3:   11.000   71.000
+ 3   / 4:   16.000   76.000
+ ---- K:2 Z:   1
+ 0   / 1:   21.000   81.000
+ 1   / 2:   26.000   86.000
+ 2   / 3:   31.000   91.000
+ 3   / 4:   36.000   96.000
+ ---- K:3 Z:   2
+ 0   / 1:   41.000  101.000
+ 1   / 2:   46.000  106.000
+ 2   / 3:   51.000  111.000
+ 3   / 4:   56.000  116.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.000   62.000
+ 1   / 2:    7.000   67.000
+ 2   / 3:   12.000   72.000
+ 3   / 4:   17.000   77.000
+ ---- K:2 Z:   1
+ 0   / 1:   22.000   82.000
+ 1   / 2:   27.000   87.000
+ 2   / 3:   32.000   92.000
+ 3   / 4:   37.000   97.000
+ ---- K:3 Z:   2
+ 0   / 1:   42.000  102.000
+ 1   / 2:   47.000  107.000
+ 2   / 3:   52.000  112.000
+ 3   / 4:   57.000  117.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.000   63.000
+ 1   / 2:    8.000   68.000
+ 2   / 3:   13.000   73.000
+ 3   / 4:   18.000   78.000
+ ---- K:2 Z:   1
+ 0   / 1:   23.000   83.000
+ 1   / 2:   28.000   88.000
+ 2   / 3:   33.000   93.000
+ 3   / 4:   38.000   98.000
+ ---- K:3 Z:   2
+ 0   / 1:   43.000  103.000
+ 1   / 2:   48.000  108.000
+ 2   / 3:   53.000  113.000
+ 3   / 4:   58.000  118.000
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.000   64.000
+ 1   / 2:    9.000   69.000
+ 2   / 3:   14.000   74.000
+ 3   / 4:   19.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   24.000   84.000
+ 1   / 2:   29.000   89.000
+ 2   / 3:   34.000   94.000
+ 3   / 4:   39.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:   44.000  104.000
+ 1   / 2:   49.000  109.000
+ 2   / 3:   54.000  114.000
+ 3   / 4:   59.000  119.000
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   20.000   21.000   22.000   23.000   24.000
+ 3   / 3:   40.000   41.000   42.000   43.000   44.000
+ ---- K:2 Z:   2
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   25.000   26.000   27.000   28.000   29.000
+ 3   / 3:   45.000   46.000   47.000   48.000   49.000
+ ---- K:3 Z:   3
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   30.000   31.000   32.000   33.000   34.000
+ 3   / 3:   50.000   51.000   52.000   53.000   54.000
+ ---- K:4 Z:   4
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   35.000   36.000   37.000   38.000   39.000
+ 3   / 3:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.000   61.000   62.000   63.000   64.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ 3   / 3:  100.000  101.000  102.000  103.000  104.000
+ ---- K:2 Z:   2
+ 1   / 1:   65.000   66.000   67.000   68.000   69.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ 3   / 3:  105.000  106.000  107.000  108.000  109.000
+ ---- K:3 Z:   3
+ 1   / 1:   70.000   71.000   72.000   73.000   74.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ 3   / 3:  110.000  111.000  112.000  113.000  114.000
+ ---- K:4 Z:   4
+ 1   / 1:   75.000   76.000   77.000   78.000   79.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ 3   / 3:  115.000  116.000  117.000  118.000  119.000
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   60.000   61.000   62.000   63.000   64.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   21.000   22.000   23.000   24.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   41.000   42.000   43.000   44.000
+ 2   / 2:  100.000  101.000  102.000  103.000  104.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   65.000   66.000   67.000   68.000   69.000
+ ---- K:2 Z:   1
+ 1   / 1:   25.000   26.000   27.000   28.000   29.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ ---- K:3 Z:   2
+ 1   / 1:   45.000   46.000   47.000   48.000   49.000
+ 2   / 2:  105.000  106.000  107.000  108.000  109.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   70.000   71.000   72.000   73.000   74.000
+ ---- K:2 Z:   1
+ 1   / 1:   30.000   31.000   32.000   33.000   34.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ ---- K:3 Z:   2
+ 1   / 1:   50.000   51.000   52.000   53.000   54.000
+ 2   / 2:  110.000  111.000  112.000  113.000  114.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   35.000   36.000   37.000   38.000   39.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:   55.000   56.000   57.000   58.000   59.000
+ 2   / 2:  115.000  116.000  117.000  118.000  119.000
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   2
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:2 Z:   2
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- K:2 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+              EX#1                      ALIST
+1    /  1:  1.00000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.00000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.00000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.00000 ""                                           
+6    /  6:  5.00000 ""                                           
+7    /  7:  4.00000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.00000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.00000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.00000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.00000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+            EX#1                      BLIST
+1   / 1:  3.00000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.00000 ""                                           
+3   / 3:  6.00000 "Something new has been added"               
+4   / 4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.00000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.00000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : FEB
+                 39N    
+                 65
+ 141E   / 61:   8.8575
+ 143E   / 62:   8.5178
+ 145E   / 63:   9.2910
+ 147E   / 64:  10.2489
+ 149E   / 65:  10.9823
+ 151E   / 66:  10.8754
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  62.0000   8.5178
+2   / 2:  61.0000   8.8575
+3   / 3:  63.0000   9.2910
+4   / 4:  64.0000  10.2489
+5   / 5:  66.0000  10.8754
+6   / 6:  65.0000  10.9823
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+               1S     
+               45
+ 1    /  1:  23.7595
+ 2    /  2:  23.8632
+ 3    /  3:  23.8882
+ 4    /  4:  23.9519
+ 5    /  5:  23.9616
+ 6    /  6:  24.0241
+ 7    /  7:  24.0481
+ 8    /  8:  24.0854
+ 9    /  9:  24.2126
+ 10   / 10:  24.2807
+ 11   / 11:  24.3114
+ 12   / 12:  24.3562
+ 13   / 13:  24.3861
+ 14   / 14:  24.4567
+ 15   / 15:  24.4717
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : JAN
+          147.000
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : FEB
+               141E    
+                61
+ 49N   / 70:  1.88296
+ 47N   / 69:  2.01405
+ 45N   / 68:  3.44455
+ 43N   / 67:  4.55859
+ 41N   / 66:  6.47285
+ 39N   / 65:  8.85749
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  70.0000  1.88296
+2   / 2:  69.0000  2.01405
+3   / 3:  68.0000  3.44455
+4   / 4:  67.0000  4.55859
+5   / 5:  66.0000  6.47285
+6   / 6:  65.0000  8.85749
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : JAN
+               19E    
+                0
+ 1    /  1: -0.12500
+ 2    /  2:  0.05400
+ 3    /  3:  0.18556
+ 4    /  4:  0.30000
+ 5    /  5:  0.43875
+ 6    /  6:  0.62500
+ 7    /  7:  0.66000
+ 8    /  8:  0.72750
+ 9    /  9:  0.79955
+ 10   / 10:  1.29667
+ 11   / 11:  1.58765
+ 12   / 12:  1.60684
+ 13   / 13:  1.91667
+ 14   / 14:  2.05857
+ 15   / 15:  2.69400
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : JAN
+          32.0000
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.833S
+             TIME     : AUG-1982
+              131.5W  
+               99
+ 1    /  1:  24.6576
+ 2    /  2:  25.2599
+ 3    /  3:  25.7023
+ 4    /  4:  26.0588
+ 5    /  5:  26.1281
+ 6    /  6:  26.1309
+ 7    /  7:  26.1387
+ 8    /  8:  26.1637
+ 9    /  9:  26.2191
+ 10   / 10:  26.3090
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : JAN
+          28.8626
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+          28.8626
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                    141E    
+                     61
+ 16-JAN      / 1:  11.0274
+ 15-FEB      / 2:   8.8575
+ 17-MAR      / 3:   8.3911
+ 16-AUG      / 4:     ....
+ 15-JAN      / 5:  11.0274
+ 14-FEB      / 6:   8.8575
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+            141E    
+             61
+ 1   / 1:  11.0274
+ 2   / 2:   8.3911
+ 3   / 3:  11.0274
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+        TSORTED_  TSORTED_SST
+1   / 1:  3.00000   8.3911
+2   / 2:  2.00000   8.8575
+3   / 3:  1.00000  11.0274
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-JAN-1946 12 /  1:     ....
+ 15-FEB-1946 00 /  2:     ....
+ 16-MAR-1946 12 /  3:     ....
+ 16-APR-1946 00 /  4:     ....
+ 16-MAY-1946 12 /  5:     ....
+ 16-JUN-1946 00 /  6:     ....
+ 16-JUL-1946 12 /  7:     ....
+ 16-AUG-1946 12 /  8:     ....
+ 16-SEP-1946 00 /  9:     ....
+ 16-OCT-1946 12 / 10:     ....
+ 16-NOV-1946 00 / 11:     ....
+ 16-DEC-1946 12 / 12:  12.3500
+ 16-JAN-1947 12 / 13:     ....
+ 15-FEB-1947 00 / 14:     ....
+ 16-MAR-1947 12 / 15:     ....
+ 16-APR-1947 00 / 16:   0.0000
+ 16-MAY-1947 12 / 17:     ....
+ 16-JUN-1947 00 / 18:     ....
+ 16-JUL-1947 12 / 19:     ....
+ 16-AUG-1947 12 / 20:     ....
+ 16-SEP-1947 00 / 21:   6.6000
+ 16-OCT-1947 12 / 22:     ....
+ 16-NOV-1947 00 / 23:     ....
+ 16-DEC-1947 12 / 24:     ....
+ 16-JAN-1948 12 / 25:   4.5000
+ 15-FEB-1948 12 / 26:     ....
+ 16-MAR-1948 12 / 27:     ....
+ 16-APR-1948 00 / 28:     ....
+ 16-MAY-1948 12 / 29:     ....
+ 16-JUN-1948 00 / 30:   4.7000
+ 16-JUL-1948 12 / 31:     ....
+ 16-AUG-1948 12 / 32:     ....
+ 16-SEP-1948 00 / 33:  -5.8000
+ 16-OCT-1948 12 / 34:   0.4500
+ 16-NOV-1948 00 / 35:     ....
+ 16-DEC-1948 12 / 36:     ....
+ 16-JAN-1949 12 / 37:   4.2300
+ 15-FEB-1949 00 / 38:  -1.0800
+ 16-MAR-1949 12 / 39:   2.0700
+ 16-APR-1949 00 / 40:   0.8300
+ 16-MAY-1949 12 / 41:   0.0000
+ 16-JUN-1949 00 / 42:   5.3700
+ 16-JUL-1949 12 / 43:  -1.3000
+ 16-AUG-1949 12 / 44:   1.3800
+ 16-SEP-1949 00 / 45:   5.9200
+ 16-OCT-1949 12 / 46:   0.7100
+ 16-NOV-1949 00 / 47:  -0.9400
+ 16-DEC-1949 12 / 48:  -0.5200
+ 16-JAN-1950 12 / 49:   1.5800
+ 15-FEB-1950 00 / 50:   4.9300
+ 16-MAR-1950 12 / 51:   3.5100
+ 16-APR-1950 00 / 52:   4.5400
+ 16-MAY-1950 12 / 53:   1.6000
+ 16-JUN-1950 00 / 54:   1.3300
+ 16-JUL-1950 12 / 55:   0.9000
+ 16-AUG-1950 12 / 56:  -0.4500
+ 16-SEP-1950 00 / 57:   3.5700
+ 16-OCT-1950 12 / 58:  -8.7500
+ 16-NOV-1950 00 / 59:  -5.2400
+ 16-DEC-1950 12 / 60:  -6.4700
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 61
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+        TSORTED_IN  TSORTED_WND
+1    /  1:  58.0000  -8.7500
+2    /  2:  60.0000  -6.4700
+3    /  3:  33.0000  -5.8000
+4    /  4:  59.0000  -5.2400
+5    /  5:  43.0000  -1.3000
+6    /  6:  38.0000  -1.0800
+7    /  7:  47.0000  -0.9400
+8    /  8:  48.0000  -0.5200
+9    /  9:  56.0000  -0.4500
+10   / 10:  41.0000   0.0000
+11   / 11:  16.0000   0.0000
+12   / 12:  34.0000   0.4500
+13   / 13:  46.0000   0.7100
+14   / 14:  40.0000   0.8300
+15   / 15:  55.0000   0.9000
+16   / 16:  54.0000   1.3300
+17   / 17:  44.0000   1.3800
+18   / 18:  49.0000   1.5800
+19   / 19:  53.0000   1.6000
+20   / 20:  39.0000   2.0700
+21   / 21:  51.0000   3.5100
+22   / 22:  57.0000   3.5700
+23   / 23:  37.0000   4.2300
+24   / 24:  25.0000   4.5000
+25   / 25:  52.0000   4.5400
+26   / 26:  30.0000   4.7000
+27   / 27:  50.0000   4.9300
+28   / 28:  42.0000   5.3700
+29   / 29:  45.0000   5.9200
+30   / 30:  21.0000   6.6000
+31   / 31:  12.0000  12.3500
+32   / 32:     ....     ....
+33   / 33:     ....     ....
+34   / 34:     ....     ....
+35   / 35:     ....     ....
+36   / 36:     ....     ....
+37   / 37:     ....     ....
+38   / 38:     ....     ....
+39   / 39:     ....     ....
+40   / 40:     ....     ....
+41   / 41:     ....     ....
+42   / 42:     ....     ....
+43   / 43:     ....     ....
+44   / 44:     ....     ....
+45   / 45:     ....     ....
+46   / 46:     ....     ....
+47   / 47:     ....     ....
+48   / 48:     ....     ....
+49   / 49:     ....     ....
+50   / 50:     ....     ....
+51   / 51:     ....     ....
+52   / 52:     ....     ....
+53   / 53:     ....     ....
+54   / 54:     ....     ....
+55   / 55:     ....     ....
+56   / 56:     ....     ....
+57   / 57:     ....     ....
+58   / 58:     ....     ....
+59   / 59:     ....     ....
+60   / 60:     ....     ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 61
+          31.0000
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 61
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955  26.7131
+ 15-FEB      / 2:  28.5508  28.2499  26.3700
+ 17-MAR      / 3:  28.8764  28.4775  26.3180
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  28.2696  26.7131
+ 15-FEB      / 2:  28.5508  28.4857  26.3700
+ 17-MAR      / 3:  28.8764  28.6147  26.3180
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.22661
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+            161W    
+             90
+ 1   / 1:  1.60000
+ 2   / 2: -0.40645
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+               27W       25W       23W     
+               157       158       159
+ ---- L:1 T:   1
+ 3N   / 47: -0.175348 -0.178392 -0.309239
+ 1N   / 46: -0.308620 -0.280936 -0.291017
+ 1S   / 45: -0.271470 -0.497559 -0.595639
+ ---- L:2 T:   2
+ 3N   / 47:  0.052492  0.002775  0.124133
+ 1N   / 46: -0.064590 -0.057180  0.069549
+ 1S   / 45: -0.121296 -0.039745  0.034207
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:   9.0000   9.0000   9.0000
+ 2   / 2:  95.8009   4.1991   0.0000
+ 3   / 3:   1.0931   0.0479   0.0000
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                      1        2     
+                      1        2
+ 16-JAN      / 1:  1.17837  0.78194
+ 15-FEB      / 2:  0.08800 -1.41147
+ 17-MAR      / 3: -1.26637  0.62953
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:101 T:   101
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+ ---- L:102 T:   102
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                  1        2        3        4        5     
+                  1        2        3        4        5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : JAN
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : JAN
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : JAN
+                91W    
+               125
+ 55N   / 73:     ....
+ 53N   / 72:     ....
+ 51N   / 71:     ....
+ 49N   / 70:     ....
+ 47N   / 69:   2.6969
+ 45N   / 68:  13.3500
+ 43N   / 67:     ....
+ 41N   / 66:     ....
+ 39N   / 65:     ....
+ 37N   / 64:     ....
+ 35N   / 63:     ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : JAN
+               91W    
+              125
+ 1    /  1:  13.3500
+ 2    /  2:   2.6969
+ 3    /  3:     ....
+ 4    /  4:     ....
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 11   / 11:     ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+               139.5W  
+                91
+ 5     /  1:     ....
+ 15    /  2:     ....
+ 25    /  3:     ....
+ 35    /  4:     ....
+ 45    /  5:     ....
+ 55    /  6:     ....
+ 65    /  7:  26.3984
+ 75    /  8:  26.0190
+ 85    /  9:  25.6663
+ 95    / 10:  25.3181
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+              139.5W  
+               91
+ 1    /  1:  26.3984
+ 2    /  2:  26.0190
+ 3    /  3:  25.6663
+ 4    /  4:  25.3181
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.0000
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.000000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.0000
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.0000
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.785000
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  335.000  359.000  269.000   57.000  195.000   73.000  101.000  209.000   87.000  167.000
+ 2   / 2:  -69.000  -63.000  -25.000  -13.000  -13.000  -11.000  -11.000  -11.000   -9.000   -9.000
+ 3   / 3:    0.340    0.863   23.271   28.382   29.675   28.470   28.341   28.881   28.429   29.847
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  331.000  365.000  147.000   79.000  119.000   65.000   83.000  125.000  157.000  237.000
+ 2   / 2:  -65.000  -61.000  -59.000  -53.000   -9.000   -7.000   -7.000   -7.000   -3.000   -1.000
+ 3   / 3:   -0.766   -0.063    0.400    1.607   28.333   27.646   27.757   28.387   28.721   23.888
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  13.0000
+ 2   / 2:  13.0000
+ 3   / 3:  13.0000
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  113.000
+ 2   / 2:  113.000
+ 3   / 3:  113.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ 1   / 1:     ....  1999.00  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    29.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00     0.00
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+            DDAT_A   DDAT_B   DDAT_C
+345   / 1:     ....     ....     ....
+346   / 2:     ....  1126.00  1126.00
+347   / 3:  1136.00  1136.00  1136.00
+348   / 4:  1141.00  1141.00     ....
+349   / 5:  1146.00  1146.00  1146.00
+350   / 6:  1156.00  1156.00  1156.00
+351   / 7:  1166.00  1166.00  1166.00
+352   / 8:     ....     ....     ....
+353   / 9:     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                  (C001,V001)    EX#2
+10-NOV-1982 16 / 15:  0.666667  16.0000
+16-NOV-1982 18 / 16:  0.750000  18.0000
+22-NOV-1982 20 / 17:  0.833333  20.0000
+28-NOV-1982 22 / 18:  0.916667  22.0000
+05-DEC-1982 00 / 19:  0.000000   0.0000
+11-DEC-1982 02 / 20:  0.083333   2.0000
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  10.0000  314.000
+16-NOV-1982 18 / 16:  16.0000  320.000
+22-NOV-1982 20 / 17:  22.0000  326.000
+28-NOV-1982 22 / 18:  28.0000  332.000
+05-DEC-1982 00 / 19:   5.0000  339.000
+11-DEC-1982 02 / 20:  11.0000  345.000
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  11.0000  0.860274
+16-NOV-1982 18 / 16:  11.0000  0.876712
+22-NOV-1982 20 / 17:  11.0000  0.893151
+28-NOV-1982 22 / 18:  11.0000  0.909589
+05-DEC-1982 00 / 19:  12.0000  0.928767
+11-DEC-1982 02 / 20:  12.0000  0.945205
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.00
+ 16-NOV-1982 18 / 16:  1982.00
+ 22-NOV-1982 20 / 17:  1982.00
+ 28-NOV-1982 22 / 18:  1982.00
+ 05-DEC-1982 00 / 19:  1982.00
+ 11-DEC-1982 02 / 20:  1982.00
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.00
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_strides
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:322 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:322 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:322 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:319 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G023)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:325 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.0000
+ 4    / 2:   4.0000
+ 7    / 3:   7.0000
+ 10   / 4:  10.0000
+ 13   / 5:  13.0000
+ 16   / 6:  16.0000
+ 19   / 7:  19.0000
+ 22   / 8:   2.0000
+ 25   / 9:   5.0000
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:341 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:341 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:341 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:339 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+ 24   / 4:   4.0000
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+ 24   / 3:   4.0000
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+ 25   / 3:   5.0000
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.0000
+ 6    / 2:   6.0000
+ 11   / 3:  11.0000
+ 16   / 4:  16.0000
+ 21   / 5:   1.0000
+ 26   / 6:   6.0000
+ 31   / 7:  11.0000
+ 36   / 8:  16.0000
+ 41   / 9:   1.0000
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.0000
+ 7    / 2:   7.0000
+ 12   / 3:  12.0000
+ 17   / 4:  17.0000
+ 22   / 5:   2.0000
+ 27   / 6:   7.0000
+ 32   / 7:  12.0000
+ 37   / 8:  17.0000
+ 42   / 9:   2.0000
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.0000
+ 8    / 2:   8.0000
+ 13   / 3:  13.0000
+ 18   / 4:  18.0000
+ 23   / 5:   3.0000
+ 28   / 6:   8.0000
+ 33   / 7:  13.0000
+ 38   / 8:  18.0000
+ 43   / 9:   3.0000
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.0000
+ 9    / 2:   9.0000
+ 14   / 3:  14.0000
+ 19   / 4:  19.0000
+ 24   / 5:   4.0000
+ 29   / 6:   9.0000
+ 34   / 7:  14.0000
+ 39   / 8:  19.0000
+ 44   / 9:   4.0000
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.0000
+ 10   / 2:  10.0000
+ 15   / 3:  15.0000
+ 20   / 4:  20.0000
+ 25   / 5:   5.0000
+ 30   / 6:  10.0000
+ 35   / 7:  15.0000
+ 40   / 8:  20.0000
+ 45   / 9:   5.0000
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.0000
+ 11   / 2:  11.0000
+ 16   / 3:  16.0000
+ 21   / 4:   1.0000
+ 26   / 5:   6.0000
+ 31   / 6:  11.0000
+ 36   / 7:  16.0000
+ 41   / 8:   1.0000
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.0000
+ 106   / 2:   6.0000
+ 111   / 3:  11.0000
+ 116   / 4:  16.0000
+ 121   / 5:   1.0000
+ 126   / 6:   6.0000
+ 131   / 7:  11.0000
+ 136   / 8:  16.0000
+ 141   / 9:   1.0000
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.0000
+ 107   / 2:   7.0000
+ 112   / 3:  12.0000
+ 117   / 4:  17.0000
+ 122   / 5:   2.0000
+ 127   / 6:   7.0000
+ 132   / 7:  12.0000
+ 137   / 8:  17.0000
+ 142   / 9:   2.0000
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.0000
+ 108   / 2:   8.0000
+ 113   / 3:  13.0000
+ 118   / 4:  18.0000
+ 123   / 5:   3.0000
+ 128   / 6:   8.0000
+ 133   / 7:  13.0000
+ 138   / 8:  18.0000
+ 143   / 9:   3.0000
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.0000
+ 109   / 2:   9.0000
+ 114   / 3:  14.0000
+ 119   / 4:  19.0000
+ 124   / 5:   4.0000
+ 129   / 6:   9.0000
+ 134   / 7:  14.0000
+ 139   / 8:  19.0000
+ 144   / 9:   4.0000
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.0000
+ 110   / 2:  10.0000
+ 115   / 3:  15.0000
+ 120   / 4:  20.0000
+ 125   / 5:   5.0000
+ 130   / 6:  10.0000
+ 135   / 7:  15.0000
+ 140   / 8:  20.0000
+ 145   / 9:   5.0000
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.0000
+ 111   / 2:  11.0000
+ 116   / 3:  16.0000
+ 121   / 4:   1.0000
+ 126   / 5:   6.0000
+ 131   / 6:  11.0000
+ 136   / 7:  16.0000
+ 141   / 8:   1.0000
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G023)          (AX010)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:335 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G022)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:335 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:335 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:335 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:334 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G023)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:334 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:318 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+ 
+! ******** V54 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_viewports
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/nolab {0,4.737}, {0,4.737}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/line {0,4.737}, {0,4.737}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.60   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.60   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 7.27E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.67E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strings
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string    cnst
+1   / 1: "string"            5.00000
+2   / 2: "s2"                5.00000
+3   / 3: "very long string"  5.00000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1.00000  0.00000  0.00000
+ 2   / 2:  0.00000  1.00000  0.00000
+ 3   / 3:  0.00000  0.00000  1.00000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  0.00000  1.00000  1.00000
+ 2   / 2:  1.00000  0.00000  1.00000
+ 3   / 3:  1.00000  1.00000  0.00000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  1.00000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  0.00000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axcontrol
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_curv
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_delimited_read
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6     V7       V8     V9     V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      .... " "      " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000 "word 1" " "      ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     .... "word 2" " "      ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030 " wd 3 " " "      ....
+5   / 5: " "          " "    " "    " "    " "    " "      .... " "      " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000 "word 4" "aa"  77.0000
+7   / 7: "extra line" " "    " "    " "    " "    " "      .... " "      " "      ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6     A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030
+5   / 5: " "          " "    " "    " "    " "    " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000
+7   / 7: "extra line" " "    " "    " "    " "    " "      ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2    V3       V4       V5     V6     V7       V8     V9     V10
+1   / 1: "one"       ...  1.10000 -24.0000  130.000 " "    10.000 "word 1" " "      ....
+2   / 2: "two"       ...  2.20000  24.0000 -130.000 "2S"     .... "word 2" " "      ....
+3   / 3: "three"     ...  3.30000  24.0000  130.000 "3N"    0.030 " wd 3 " " "      ....
+4   / 4: " "         ...     ....     ....     .... " "      .... " "      " "      ....
+5   / 5: "five"      ...  4.40000 -24.0000 -130.000 "91" -400.000 "word 4" "aa"  77.0000
+6   / 6: "extra line"...     ....     ....     .... " "      .... " "      " "      ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000     ....     ....     ....   10.000......     ....
+2   / 2:......  2.20000     ....     ....     ....     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000     ....    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000 -24.0000     ....     ....   10.000......     ....
+2   / 2:......  2.20000  24.0000     ....  -2.0000     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000   3.0000    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+              V1     V2
+1   / 1:  37965.0  12.5833
+2   / 2:     ....     ....
+3   / 3:  39051.0  13.7514
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5       V6       V7       V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.0  36218.0  12.0000  13.7601
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.0  36219.0   1.0037  14.7601
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.0  36220.0   2.0000  15.7500
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+              V1     V2    V3 V4    V5       V6    V7 V8
+1   / 1:  36493.0  36218.0......  36493.0  36218.0......
+2   / 2:  36494.0  36219.0......  36494.0  36219.0......
+3   / 3:     ....     ..........  36495.0  36220.0......
+4   / 4:  36496.0  36221.0......  36496.0  36221.0......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2    V3       V4    V5 V6    V7       V8
+1   / 1:......  12.0000  13.7601......  12.0000  13.7601
+2   / 2:......   1.0037  14.7601......   1.0037  14.7601
+3   / 3:......     ....     ..........   2.0000  15.7500
+4   / 4:......   3.0000  16.7601......   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+              V1     V2       V3       V4       V5       V6       V7       V8
+1   / 1:  36493.0  36218.0  12.0000  13.7601  36493.0  36218.0  12.0000  13.7601
+2   / 2:  36494.0  36219.0   1.0037  14.7601  36494.0  36219.0   1.0037  14.7601
+3   / 3:     ....     ....     ....     ....  36495.0  36220.0   2.0000  15.7500
+4   / 4:  36496.0  36221.0   3.0000  16.7601  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+              V1     V3       V5       V7
+1   / 1:  36493.0  12.0000  36493.0  12.0000
+2   / 2:  36494.0   1.0037  36494.0   1.0037
+3   / 3:     ....     ....  36495.0   2.0000
+4   / 4:  36496.0   3.0000  36496.0   3.0000
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+              V1     V2                        V3                       V4
+1   / 1:  12.0000  1.00000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.00000
+2   / 2:  12.0000  2.00000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.00000
+3   / 3:  12.0000  3.00000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.00000
+4   / 4:  12.0000  4.00000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.00000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+              V1     V2      V3        V4           V5           V6         V7       V8
+1   / 1:  12.0000  1.00000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6       V7           V8         V9       V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6     V7      V8     V9     V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"   12.0000 "00"   13.0000 "45" 
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"    1.0000 "00"   13.5000 "14" 
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x"   2.0000 "00x"  15.0000 "45x"
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"    3.0000 "00"   16.0000 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1     V2     V3    V4       V5       V6       V7       V8       V9       V10      V11      V12      V13       V14      V15      V16      V17       V18      V19      V20       V21      V22      V23      V24      V25      V26
+1    /  1: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    10.00  21.1028  35.9408  0.00000  36.0000  0.000000  1.00000     9.80  224.641  0.000000   0.1172  0.00000  0.000000  0.00000   1.0156  0.00000  0.11621  0.00000  2.22900
+2    /  2: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    54.00  19.8913  35.9437  0.00000  35.0000  0.000000  1.00000    54.70  233.185  0.000000   0.1465  0.00000  0.000000  0.00000   1.0351  0.00000  0.13769  0.00000  2.43100
+3    /  3: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    79.00  19.0138  35.9186  0.00000  34.0000  0.000000  1.00000    79.50  237.026  0.000000   0.1660  0.00000  0.000000  0.00000   1.0449  0.00000  0.13085  0.00000  2.51600
+4    /  4: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   104.00  18.0026  35.8627  0.00000  33.0000  0.000000  1.00000   104.60  233.766  0.000000   0.1855  0.00000  0.000000  0.00000   1.0645  0.00000  0.16602  0.00000  2.65000
+5    /  5: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   154.00  16.3595  35.7126  0.00000  32.0000  0.000000  1.00000   155.10  230.216  0.000000   0.9083  0.00000  0.146501  0.00000   0.8985  0.00000  0.26566  0.00000  2.84600
+6    /  6: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   204.00  14.8461  35.5541  0.00000  31.0000  0.000000  1.00000   206.00  222.307  0.000000   3.7899  0.00000  0.009768  0.00000   1.4359  0.00000  0.44542  0.00000  2.95400
+7    /  7: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   253.00  13.7175  35.3809  0.00000  29.0000  0.000000  1.00000   255.20  227.612  0.000000   5.5293  0.00000  0.009769  0.00000   1.6315  0.00000  0.55880  0.00000  3.00600
+8    /  8: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   254.00  13.7070  35.3835  0.00000  30.0000  0.000000  1.00000   255.60  227.350  0.000000   5.5098  0.00000  0.009769  0.00000   1.7877  0.00000  0.55489  0.00000  2.99600
+9    /  9: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   305.00  12.6234  35.2123  0.00000  28.0000  0.000000  1.00000   307.20  230.868  0.000000   7.6502  0.00000  0.009770  0.00000   2.1593  0.00000  0.68588  0.00000  3.13400
+10   / 10: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   353.00  12.0102  35.1165  0.00000  27.0000  0.000000  1.00000   355.70  235.378  0.000000   8.7158  0.00000  0.009771  0.00000   2.5209  0.00000  0.75335  0.00000  3.19000
+11   / 11: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   404.00  11.4592     ....  9.00000  26.0000  0.000000  1.00000   406.90     ....  0.000000     ....  9.00000      ....  9.00000     ....  9.00000     ....  9.00000  3.25500
+12   / 12: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   452.00  11.0375  34.9575  0.00000  25.0000  0.000000  1.00000   455.90  239.899  0.000000  10.9546  0.00000  0.000000  0.00000   3.0489  0.00000  0.88438  0.00000  3.24500
+13   / 13: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   502.00  10.5797  34.8825  0.00000  24.0000  0.000000  1.00000   506.00  241.090  0.000000  12.1377  0.00000  0.000000  0.00000   3.4009  0.00000  0.95871  0.00000  3.19500
+14   / 14: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   601.00   9.8037  34.7585  0.00000  23.0000  0.000000  1.00000   605.90  238.538  0.000000  14.4357  0.00000  0.000000  0.00000   4.2711  0.00000  1.11419  0.00000     ....
+15   / 15: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   701.00   9.0245  34.6510  0.00000  22.0000  0.000000  1.00000   706.70  229.219  0.000000  17.5353  0.00000  0.000000  0.00000   6.1774  0.00000  1.31173  0.00000  2.45400
+16   / 16: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   800.00   7.6879  34.5292  0.00000  21.0000  0.000000  1.00000   807.00  206.678  0.000000  22.7373  0.00000  0.000000  0.00000  13.2162  0.00000  1.63345  0.00000  1.32000
+17   / 17: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   899.00   6.2124  34.4434  0.00000  20.0000  0.000000  1.00000   907.30  194.602  0.000000  27.2943  0.00000  0.000000  0.00000  23.8630  0.00000  1.92683  0.00000  0.73200
+18   / 18: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   999.00   4.9587  34.4055  0.00000  19.0000  0.000000  1.00000  1008.40  186.926  0.000000  30.2768  0.00000  0.000000  0.00000  36.3870  0.00000  2.15272  0.00000  0.42900
+19   / 19: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00  1098.00   4.3083  34.4383  0.00000  18.0000  0.000000  1.00000  1109.00  171.821  0.000000  32.2020  0.00000  0.000000  0.00000  50.4537  0.00000  2.29735  0.00000  0.19800
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+               V11     V19      V21      V23      V25
+8    /  8:  0.00000  0.00000  0.00000  0.00000  0.00000
+9    /  9:  0.00000  0.00000  0.00000  0.00000  0.00000
+10   / 10:  0.00000  0.00000  0.00000  0.00000  0.00000
+11   / 11:  9.00000  9.00000  9.00000  9.00000  9.00000
+12   / 12:  0.00000  0.00000  0.00000  0.00000  0.00000
+13   / 13:  0.00000  0.00000  0.00000  0.00000  0.00000
+14   / 14:  0.00000  0.00000  0.00000  0.00000  0.00000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+                V11     V19       V21       V23       V25
+8    /  8:  0.000000  0.000000  0.000000  0.000000  0.000000
+9    /  9:  0.000000  0.000000  0.000000  0.000000  0.000000
+10   / 10:  0.000000  0.000000  0.000000  0.000000  0.000000
+11   / 11:      ....      ....      ....      ....      ....
+12   / 12:  0.000000  0.000000  0.000000  0.000000  0.000000
+13   / 13:  0.000000  0.000000  0.000000  0.000000  0.000000
+14   / 14:  0.000000  0.000000  0.000000  0.000000  0.000000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+ 
+ 
+! ******** V5.41 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn541_bug_fixes
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955     ....
+ 15-FEB      / 2:  28.5508  28.2499     ....
+ 17-MAR      / 3:  28.8764  28.4775     ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045     ....  26.9596
+ 15-FEB      / 2:  28.5508     ....  26.7875
+ 17-MAR      / 3:  28.8764     ....  27.1092
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX010)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 279  complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.00000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_axes
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+ 
+! ******** V5.42 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn542_bug_fixes
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+ 
+! ******** V5.50 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_subspan_modulo
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       43       44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  13.0000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M: 11 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  6 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  5 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M: 17 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.0000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.0000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.0000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.0393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+             ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+             ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+             ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      / 2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      / 3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0002 / 14:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0002 / 15:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+ 15-APR-0002 / 16:  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000
+ 15-MAY-0002 / 17:  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0003 / 20:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0003 / 21:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0002 / 14:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0002 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 / 16:  102.000     ....     ....     ....  106.000     ....  101.000  102.000     ....     ....     ....
+ 15-MAY-0002 / 17:  132.000     ....     ....     ....  136.000     ....  131.000  132.000     ....     ....     ....
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0003 / 20:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0003 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0002 / 14:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0002 / 15:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 15-APR-0002 / 16:  102.000  102.000  104.000  106.000  106.000     ....  101.000  102.000  102.000  104.000  106.000
+ 15-MAY-0002 / 17:  132.000  132.000  134.000  136.000  136.000     ....  131.000  132.000  132.000  134.000  136.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0003 / 20:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0003 / 21:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0002 / 13:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0002 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 / 15:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 15-APR-0002 / 16:   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000     ....
+ 15-MAY-0002 / 17:   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000     ....
+ 15-SEP-0002 / 18:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0003 / 19:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0003 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 / 21:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G008)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G008)          (AX017)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G008)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 16-MAR-0000 / 2:   71.000
+ 15-MAY-0000 / 3:  131.000
+ 15-JAN-0001 / 4:   11.000
+ 16-MAR-0001 / 5:   71.000
+ 15-MAY-0001 / 6:  131.000
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   71.000
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.000
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.000
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.000
+ 16-MAR-0001 / 3:   71.000
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0000 / 2:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0001 / 4:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.00000
+ 15-FEB      / 2:  2.00000
+ 16-MAR      / 3:  3.00000
+ 15-APR      / 4:  4.00000
+ 15-MAY      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.0000
+ 15-FEB      / 2:  10.0000
+ 16-MAR      / 3:  10.0000
+ 15-APR      / 4:  10.0000
+ 15-MAY      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.00000
+ 15-SEP-0166 / 1002:     ....
+ 16-JAN-0167 / 1003:  1.00000
+ 15-FEB-0167 / 1004:  2.00000
+ 17-MAR-0167 / 1005:  3.00000
+ 16-APR-0167 / 1006:  4.00000
+ 16-MAY-0167 / 1007:  5.00000
+ 16-SEP-0167 / 1008:     ....
+ 16-JAN-0168 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       42.1     44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  12.1000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.1000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.1000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.1000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.7393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+             ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+             ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+             ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      / 2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      / 3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      / 4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      / 5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0002 05 / 15:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+ 15-APR-0002 17 / 16:  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0003 11 / 21:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0002 14 / 14:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0002 05 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 17 / 16:  102.249  102.349     ....     ....  106.249     ....  101.249  102.249  102.349     ....     ....
+ 15-MAY-0002 17 / 17:  132.249  132.349     ....     ....  136.249     ....  131.249  132.249  132.349     ....     ....
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0003 20 / 20:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0003 11 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0002 05 / 15:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 15-APR-0002 17 / 16:  102.249  102.349  102.349  106.249  106.249     ....  101.249  102.249  102.349  102.349  106.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  132.349  136.249  136.249     ....  131.249  132.249  132.349  132.349  136.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0003 11 / 21:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 15-JAN-0002 23 / 13:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0002 14 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 05 / 15:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 15-APR-0002 17 / 16:   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000     ....
+ 15-MAY-0002 17 / 17:   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249     ....
+ 15-SEP-0002 05 / 18:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 16-JAN-0003 05 / 19:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0003 20 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 11 / 21:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G018)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G018)          (AX010)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G018)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 15-MAR-0000 / 2:   70.249
+ 15-MAY-0000 / 3:  131.249
+ 15-JAN-0001 / 4:   11.000
+ 15-MAR-0001 / 5:   70.249
+ 15-MAY-0001 / 6:  131.249
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   70.249
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.249
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.249
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.249
+ 15-MAR-0001 / 3:   70.249
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0000 / 2:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0001 / 4:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.00000
+ 15-FEB 02      / 2:  2.00000
+ 15-MAR 17      / 3:  3.00000
+ 15-APR 05      / 4:  4.00000
+ 15-MAY 05      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.0000
+ 15-FEB 02      / 2:  10.0000
+ 15-MAR 17      / 3:  10.0000
+ 15-APR 05      / 4:  10.0000
+ 15-MAY 05      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.00000
+ 15-SEP-0166 23 / 1002:     ....
+ 16-JAN-0167 23 / 1003:  1.00000
+ 15-FEB-0167 14 / 1004:  2.00000
+ 17-MAR-0167 05 / 1005:  3.00000
+ 16-APR-0167 17 / 1006:  4.00000
+ 16-MAY-0167 17 / 1007:  5.00000
+ 16-SEP-0167 05 / 1008:     ....
+ 17-JAN-0168 05 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dots
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lev_symbols
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+ 
+GO bn_reset
+cancel mode verify
+! GO bench_extrema  ! moved to bn_ef_bench_extrema; tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_logo_lab
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL       CANCELLED      ferret.jnl
+      LONG_LABEL       SET              -4
+      LATIT_LABEL      SET              -4
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         months
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      dots.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      shrink_ylab   CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+plot/vs/over/line/color=white {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_attribute
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_FIELD_J_AXIS Y             2 r   50                   65
+   Axis span (to cell edges) = 30
+ LON_FIELD_I_AXIS X             7 r   160                  208
+   Axis span (to cell edges) = 56
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME      T (HOURS)           20 r   1                    20
+   Axis span (to cell edges) = 20
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ TIME5     TIME                 2mr   16-MAY 23:56         16-JUN 10:25
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn550_bug_fixes
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+ 
+! ******** V5.51 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn551_bug_fixes
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME3
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.00000
+ 10-JUN-1996 04:03:37 / 2:  1.00000
+ 10-JUN-1996 04:03:38 / 3:  2.00000
+ 10-JUN-1996 04:03:39 / 4:  3.00000
+ 10-JUN-1996 04:03:40 / 5:  4.00000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+ 
+! ******** V5.52 Additions below ***********
+ 
+GO bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 7.74
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+ 
+GO bn_reset
+cancel mode verify
+GO bn552_bug_fixes
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : JAN
+                20N    
+                 6
+ 110W   / 1:  24.0382
+ 105W   / 2:  25.4564
+ 100W   / 3:  24.5714
+ 95W    / 4:  23.8243
+ 90W    / 5:  24.9977
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.00000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.00000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.167S
+                     100.5W  
+                     130
+ 16-JUL-1966 /  1: -1.42152
+ 15-AUG-1966 /  2: -2.97198
+ 14-SEP-1966 /  3: -4.50335
+ 15-OCT-1966 /  4: -3.88179
+ 14-NOV-1966 /  5: -2.57982
+ 15-DEC-1966 /  6: -1.07968
+ 14-JAN-1967 /  7:  1.42391
+ 14-FEB-1967 /  8:  2.96231
+ 16-MAR-1967 /  9:  4.50322
+ 15-APR-1967 / 10:  3.83807
+ 16-MAY-1967 / 11:  2.60886
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                          1
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.00
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.00
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.00
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+        A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:  12.0000  14.0000
+2   / 2:  14.0000  20.0000
+3   / 3:  20.0000  28.0000
+4   / 4:  28.0000  22.0000
+5   / 5:  22.0000  10.0000
+6   / 6:  10.0000     ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+              1        2        3     
+              1        2        3
+ 1   / 1:  3.00000  5.00000  7.00000
+ 2   / 2:  4.00000  6.00000  8.00000
+ 3   / 3:  5.00000  7.00000  9.00000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:   5.0000   7.0000   9.0000  11.0000  13.0000
+ 2   / 2:   7.0000  11.0000  15.0000  19.0000  23.0000
+ 3   / 3:   9.0000  15.0000  21.0000  27.0000  33.0000
+ 4   / 4:  11.0000  19.0000  27.0000  35.0000  43.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.94
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.8
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.94,,1.8
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.94    10.23     1.80     7.20
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.94
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 6.405
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.94,,6.405
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.65     9.94     1.00     6.41
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.3
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 6.905
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.305
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,6.905,7.305
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30    10.04     6.91     7.30
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.2
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.94
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.4
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,8.94,1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.20     8.94     1.40     1.77
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.2  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.2  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.7,1.1
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.4
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.20     9.94    -1.40    -1.30
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.25380  2.34749  2.42382  2.47460  2.50064
+ 2.17S / 4:  2.26997  2.36147  2.43073  2.47739  2.50277
+ 2.5S  / 3:  2.26576  2.35100  2.41285  2.45516  2.48145
+ 2.83S / 2:  2.23354  2.30728  2.35946  2.39631  2.42393
+ 3.17S / 1:  2.16829  2.22692  2.26870  2.30046  2.33013
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.28179  2.37704  2.45447  2.50708  2.53486
+ 2.17S / 4:  2.29644  2.38952  2.46056  2.50887  2.53607
+ 2.5S  / 3:  2.29075  2.37736  2.44104  2.48452  2.51240
+ 2.83S / 2:  2.25743  2.33286  2.38636  2.42369  2.45233
+ 3.17S / 1:  2.19089  2.25118  2.29360  2.32531  2.35557
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.72333  1.84007  1.94120  2.00514  2.04715
+ 2.17S / 4:  1.63876  1.74435  1.83141  1.88234  1.91985
+ 2.5S  / 3:  1.51509  1.60488  1.67644  1.71352  1.74562
+ 2.83S / 2:  1.35750  1.42836  1.48145  1.50285  1.52819
+ 3.17S / 1:  1.17476  1.22230  1.25622  1.26294  1.28236
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.21576  1.30112  1.37420  1.42210  1.45249
+ 2.17S / 4:  1.08595  1.16417  1.22895  1.26976  1.29822
+ 2.5S  / 3:  0.93683  1.00553  1.05923  1.09102  1.11580
+ 2.83S / 2:  0.77184  0.82972  0.86888  0.89054  0.91114
+ 3.17S / 1:  0.59936  0.64140  0.66649  0.68065  0.69951
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.81161
+ 23-AUG-1982 14 / 2: -1.75761
+ 29-AUG-1982 16 / 3: -1.67763
+ 04-SEP-1982 18 / 4: -1.57055
+ 10-SEP-1982 20 / 5: -1.42678
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -2.21821
+ 23-AUG-1982 14 / 2: -2.04941
+ 29-AUG-1982 16 / 3: -1.77359
+ 04-SEP-1982 18 / 4: -1.41208
+ 10-SEP-1982 20 / 5: -1.05323
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.77560
+ 23-AUG-1982 14 / 2: -1.45491
+ 29-AUG-1982 16 / 3: -1.24196
+ 04-SEP-1982 18 / 4: -1.05135
+ 10-SEP-1982 20 / 5: -0.84706
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                         1      
+                          1
+ 17-AUG-1982 12 / 1:  0.003693
+ 23-AUG-1982 14 / 2: -0.189178
+ 29-AUG-1982 16 / 3: -0.298222
+ 04-SEP-1982 18 / 4: -0.405668
+ 10-SEP-1982 20 / 5: -0.517797
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.0000
+ 15    /  2:  25.0000
+ 25    /  3:  25.0000
+ 35    /  4:  25.0000
+ 45    /  5:  25.0000
+ 55    /  6:  25.0000
+ 65    /  7:  25.0000
+ 75    /  8:  25.0000
+ 85    /  9:  25.0000
+ 95    / 10:  25.0000
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.2678   0.6794   0.0319   0.0157   0.0031
+ 45    / 2:  98.6525   1.1464   0.1451   0.0296   0.0198
+ 85    / 3:  95.1217   4.5698   0.2195   0.0744   0.0084
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.576
+ 2   / 2:    0.955
+ 3   / 3:    0.045
+ 4   / 4:    0.022
+ 5   / 5:    0.004
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.8576
+ 2   / 2:   0.1262
+ 3   / 3:   0.0160
+ 4   / 4:   0.0033
+ 5   / 5:   0.0022
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.23641
+ 2   / 2:  0.10744
+ 3   / 3:  0.00516
+ 4   / 4:  0.00175
+ 5   / 5:  0.00020
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+GO bn_reset
+cancel mode verify
+GO bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_zaxr_fcns.jnl ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+ 
+! ******** V5.53 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT1
+<axes>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME6
+<axes>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME4">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                     161W    
+                       1
+ 16-JAN      /  1:  3.43667
+ 15-FEB      /  2:  1.92500
+ 17-MAR      /  3:  2.79000
+ 16-APR      /  4:  1.79000
+ 16-MAY      /  5:  0.80000
+ 16-JUN      /  6:  3.80000
+ 16-JUL      /  7: -0.20000
+ 16-AUG      /  8:  0.46500
+ 15-SEP      /  9:  2.57250
+ 16-OCT      / 10: -2.53000
+ 15-NOV      / 11: -3.09000
+ 16-DEC      / 12:  1.78667
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+ 
+ 
+! ******** V5.6Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+SHADE/grat=(color=white) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=whi)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.00000
+!-> REPEAT: S:4
+          4.00000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.0000  6.00000  480.000
+I / *:     80.0000  8.00000  640.000
+I / *:     80.0000  10.0000  800.000
+I / *:     60.0000  6.00000  360.000
+I / *:     60.0000  8.00000  480.000
+I / *:     60.0000  10.0000  600.000
+I / *:     40.0000  6.00000  240.000
+I / *:     40.0000  8.00000  320.000
+I / *:     40.0000  10.0000  400.000
+I / *:     20.0000  6.00000  120.000
+I / *:     20.0000  8.00000  160.000
+I / *:     20.0000  10.0000  200.000
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.000
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.000
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.00
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.00
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.00
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.00
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.00
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.00
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.00000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.00000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.000
+ 177W    / -98: -177.000
+ 175W    / -97: -175.000
+ 173W    / -96: -173.000
+ 171W    / -95: -171.000
+ 169W    / -94: -169.000
+ 167W    / -93: -167.000
+ 165W    / -92: -165.000
+ 163W    / -91: -163.000
+ 161W    / -90: -161.000
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.000
+ 177W    / -98: -354.000
+ 175W    / -97: -350.000
+ 173W    / -96: -346.000
+ 171W    / -95: -342.000
+ 169W    / -94: -338.000
+ 167W    / -93: -334.000
+ 165W    / -92: -330.000
+ 163W    / -91: -326.000
+ 161W    / -90: -322.000
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.000
+ 177W    / -98: -531.000
+ 175W    / -97: -525.000
+ 173W    / -96: -519.000
+ 171W    / -95: -513.000
+ 169W    / -94: -507.000
+ 167W    / -93: -501.000
+ 165W    / -92: -495.000
+ 163W    / -91: -489.000
+ 161W    / -90: -483.000
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.000
+ 177W    / -98: -708.000
+ 175W    / -97: -700.000
+ 173W    / -96: -692.000
+ 171W    / -95: -684.000
+ 169W    / -94: -676.000
+ 167W    / -93: -668.000
+ 165W    / -92: -660.000
+ 163W    / -91: -652.000
+ 161W    / -90: -644.000
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.000
+ 177W    / -98: -885.000
+ 175W    / -97: -875.000
+ 173W    / -96: -865.000
+ 171W    / -95: -855.000
+ 169W    / -94: -845.000
+ 167W    / -93: -835.000
+ 165W    / -92: -825.000
+ 163W    / -91: -815.000
+ 161W    / -90: -805.000
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.00000 "factorial"  1.00000
+I / *:     2.00000 "factorial"  2.00000
+I / *:     3.00000 "factorial"  6.00000
+I / *:     4.00000 "factorial"  24.0000
+I / *:     5.00000 "factorial"  120.000
+I / *:     6.00000 "factorial"  720.000
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 81E    / 2:  28.1147
+ 161E   / 3:  28.7893
+ 119W   / 4:  24.5394
+ 39W    / 5:  27.4849
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 121E   / 2:  28.5914
+ 119W   / 3:  24.5394
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN-0002
+          20.9844
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:148 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:153 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.7890
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:141 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:143 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          21.2500
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:130 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9385
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.00000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : JAN
+          28.2839
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:146 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+can mem/all
+ -DELETE A        M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:146 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:146 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M:146 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G001)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:146 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:146 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G001)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:151 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G001)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.500  212.500
+214   / 2:  214.000  212.500  215.500
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.700  212.300
+213.6 / 2:  213.600  212.300  214.900
+216.2 / 3:  216.200  214.900  217.500
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+               A   B
+1   / 1:  1.00000 "a"
+2   / 2:  2.00000 "b"
+3   / 3:  3.00000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C       V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.00000
+2   / 2: "b" "spat"  1.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.00000
+2   / 2: "b" "that"  1.00000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.00000
+2   / 2: "b" "spat"  2.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.00000
+2   / 2: "b" "that"  2.00000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.00000
+2   / 2: "b" "spat"  3.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.00000
+2   / 2: "b" "that"  3.00000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.00000
+2   / 2: "b" "spat"  4.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.00000
+2   / 2: "b" "that"  4.00000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.00000
+2   / 2: "b" "spat"  5.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.00000
+2   / 2: "b" "that"  5.00000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       DEPTH (m)           26 r-  0                    1000
+   Axis span (to cell edges) = 1040
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.976269
+ 106.8W  /  2:  0.824340
+ 100.2W  /  3:  0.552644
+ 93.5W   /  4:  0.200690
+ 86.8W   /  5: -0.180415
+ 80.2W   /  6: -0.535314
+ 73.5W   /  7: -0.812473
+ 66.8W   /  8: -0.971589
+ 60.2W   /  9: -0.989574
+ 53.5W   / 10: -0.863802
+ 46.8W   / 11: -0.612560
+ 40.2W   / 12: -0.272341
+ 33.5W   / 13:  0.107469
+ 26.8W   / 14:  0.471639
+ 20.2W   / 15:  0.767299
+ 13.5W   / 16:  0.951514
+ 6.8W    / 17:  0.997495
+ 0.2W    / 18:  0.898583
+ 6.5E    / 19:  0.669123
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.976269
+ 96.8W   / 2: -0.383713
+ 80.2W   / 3: -0.535314
+ 63.5W   / 4:  0.998887
+ 46.8W   / 5: -0.612560
+ 30.2W   / 6: -0.294944
+ 13.5W   / 7:  0.951514
+ 3.2E    / 8: -0.798487
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.976269
+ 96.2W   / 2: -0.383713
+ 79.5W   / 3: -0.535314
+ 62.8W   / 4:  0.998887
+ 46.2W   / 5: -0.612560
+ 29.5W   / 6: -0.294944
+ 12.8W   / 7:  0.951514
+ 3.8E    / 8: -0.798487
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.83E(42.83)
+         -0.912341
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.996087
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  45th point
+              1       46       91       136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     238 [...]
+              1       46       91      136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     2386 [...]
+ 1   / 1:  1.84147  1.90179  1.10599  0.20957  0.06355  0.80656  1.73321  1.96379  1.27939  0.32975  0.01642  0.63686  1.60205  1.99568  1.44406  0.47087  0.00001  0.47850  1.45208  1.99647  1.59486  0.62851  0.01484  0.33643  1.28799  1.96614  1.72708  0.79776  0.06044  0.21509  1.11490  1.90563  1.83659  0.97333  0.13539  0.11827  0.93823  1.81683  1.91997  1.14973  0.23734  0.04899  0.76349  1.70252  1.97461  1.32145  0.36312  0.00942  0.59613  1.56626  1.99881  1.48313  0.50879  0.00 [...]
+ 2   / 2:  2.84147  2.90179  2.10599  1.20957  1.06355  1.80656  2.73321  2.96379  2.27939  1.32975  1.01642  1.63686  2.60205  2.99568  2.44406  1.47087  1.00001  1.47850  2.45208  2.99647  2.59486  1.62851  1.01484  1.33643  2.28799  2.96614  2.72708  1.79776  1.06044  1.21509  2.11490  2.90563  2.83659  1.97333  1.13539  1.11827  1.93823  2.81683  2.91997  2.14973  1.23734  1.04899  1.76349  2.70252  2.97461  2.32145  1.36312  1.00942  1.59613  2.56626  2.99881  2.48313  1.50879  1.00 [...]
+ 
+can mode ignore
+ 
+ 
+! ******** V5.7 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                       179W     177W     175W    
+                         1        2        3
+ 16-JAN 12      / 1:  27.9765  28.2538  28.2807
+ 15-FEB 02      / 2:  28.3564  28.4117  27.9982
+ 15-MAR 17      / 3:  27.9418  28.0035  27.7238
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                        1N       3N       5N       7N     
+                         1        2        3        4
+ 16-JAN 12      / 1:  28.4146  28.2538  28.0640  28.1024
+ 15-FEB 02      / 2:  28.4018  28.4117  28.1639  27.7498
+ 15-MAR 17      / 3:  27.5907  28.0035  27.8730  27.8183
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000  28.0000
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1.2 / 1:  1.20000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3.2 / 3:  3.20000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8.4 / 6:  8.40000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME4)
+ Column  3: TBOXLO is TBOXLO (axis TIME4)
+ Column  4: TBOXHI is TBOXHI (axis TIME4)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+                 V      Z     ZBOXLO   ZBOXHI
+0     / 1:    7.000    0.000   0.0000   10.000
+20    / 2:   27.000   20.000  10.0000   30.000
+50    / 3:   57.000   50.000  30.0000   60.000
+75    / 4:   82.000   75.000  60.0000   90.000
+120   / 5:  127.000  120.000  90.0000  150.000
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: JAN-1990 to JAN-1990
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+GO bn_reset
+cancel mode verify
+GO bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_reset_attributes.jnl
+! bn_reset_attributes.jnl
+! acm 6/14/2004
+! tests of SET AXIS/CALENDAR  /T0  /UNITS  also CANCEL AXIS/DEPTH
+! also RETURN=calendar
+ 
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+sh axis `temp,return=taxis`
+ !-> sh axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 11-DEC-1982 02 / 20:  25476.0
+ 17-DEC-1982 04 / 21:  25622.0
+ 23-DEC-1982 06 / 22:  25768.0
+ 29-DEC-1982 08 / 23:  25914.0
+ 04-JAN-1983 10 / 24:  26060.0
+ 10-JAN-1983 12 / 25:  26206.0
+ 
+! New RETURN=calendar
+def sym calname = `temp,return=calendar`
+ !-> def sym calname = GREGORIAN
+ 
+! SET AXIS/CALENDAR=  julian, 360-day, 365_day=julian, 366_day=all_leap, standard=gregorian
+set axis/calendar=julian `temp,return=taxis`
+ !-> set axis/calendar=julian TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE JULIAN
+JULIAN
+ 
+set axis/calendar=360_day `temp,return=taxis`
+ !-> set axis/calendar=360_day TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 26-DEC-1982 02 / 20:  32.6698
+ 02-JAN-1983 04 / 21:  32.7830
+ 08-JAN-1983 06 / 22:  32.7033
+ 14-JAN-1983 08 / 23:  32.4479
+ 20-JAN-1983 10 / 24:  32.2491
+ 26-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE 360_DAY
+360_DAY
+ 
+set axis/calendar=365_day `temp,return=taxis`
+ !-> set axis/calendar=365_day TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=nol `temp,return=taxis`
+ !-> set axis/calendar=nol TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 12-DEC-1982 02 / 20:  32.6698
+ 18-DEC-1982 04 / 21:  32.7830
+ 24-DEC-1982 06 / 22:  32.7033
+ 30-DEC-1982 08 / 23:  32.4479
+ 05-JAN-1983 10 / 24:  32.2491
+ 11-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=366 `temp,return=taxis`
+ !-> set axis/calendar=366 TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+ 
+set axis/calendar=all_leap `temp,return=taxis`
+ !-> set axis/calendar=all_leap TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : ALL_LEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 09-DEC-1982 02 / 20:  32.6698
+ 15-DEC-1982 04 / 21:  32.7830
+ 21-DEC-1982 06 / 22:  32.7033
+ 27-DEC-1982 08 / 23:  32.4479
+ 02-JAN-1983 10 / 24:  32.2491
+ 08-JAN-1983 12 / 25:  32.1819
+ 
+! Now resetting T0
+CAN DATA/ALL
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+set axis/calendar="standard" `temp,return=taxis`
+ !-> set axis/calendar="standard" TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+ 
+! One day earlier
+set axis/t0="13-jan-1980:14:00" `temp,return=taxis`
+ !-> set axis/t0="13-jan-1980:14:00" TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE GREGORIAN
+GREGORIAN
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-DEC-1982 02 / 20:  25476.0
+ 16-DEC-1982 04 / 21:  25622.0
+ 22-DEC-1982 06 / 22:  25768.0
+ 28-DEC-1982 08 / 23:  25914.0
+ 03-JAN-1983 10 / 24:  26060.0
+ 09-JAN-1983 12 / 25:  26206.0
+ 
+ 
+! Now resetting UNITS
+CAN DATA/ALL
+CAN REGION
+use gt4d011.cdf
+ 
+set axis/units=feet `temp,return=zaxis`
+ !-> set axis/units=feet PSZT
+show axis `temp,return=zaxis`
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (FEET)            27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+! unrecognized units
+set axis/units="something" `temp,return=xaxis`
+ !-> set axis/units="something" PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon
+set axis/units=lon `temp,return=xaxis`
+ !-> set axis/units=lon PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=something `temp,return=xaxis`
+ !-> set axis/units=something PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon using word DEG
+set axis/units=deg `temp,return=xaxis`
+ !-> set axis/units=deg PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=zorro  `temp,r=zaxis`
+ !-> set axis/units=zorro  PSZT
+list/x=130w/y=1/k=1/L=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                       130.5W  
+                       100
+ 17-AUG-1982 12 / 1:  25.9777
+ 23-AUG-1982 14 / 2:  26.2025
+ 29-AUG-1982 16 / 3:  26.4463
+ 04-SEP-1982 18 / 4:  26.6606
+ 10-SEP-1982 20 / 5:  26.7818
+ 
+! not a geographic axis
+set axis/units=meters `temp,return=yaxis`
+ !-> set axis/units=meters PSYT
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (Y (METERS))
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ -0.5  / 44:  26.3422
+ -0.17 / 45:  26.2807
+ 0.17  / 46:  26.2649
+ 0.5   / 47:  26.2916
+ 
+set axis/units=deg `temp,return=yaxis`
+ !-> set axis/units=deg PSYT
+show axis `temp,return=yaxis`
+ !-> show axis PSYT
+ name       axis              # pts   start                end
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+   Axis span (to cell edges) = 80.00004
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (LATITUDE)
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ 0.5N  / 47:  26.2916
+ 0.17N / 46:  26.2649
+ 0.17S / 45:  26.2807
+ 0.5S  / 44:  26.3422
+ 
+! inappropriate units for axis direction
+set axis/units=meters `temp,return=taxis`
+ !-> set axis/units=meters TIME11
+list/x=130w/y=1/k=1/l=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (T (METERS))
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                130.5W  
+                100
+ 22702   / 1:  25.9777
+ 22848   / 2:  26.2025
+ 22994   / 3:  26.4463
+ 23140   / 4:  26.6606
+ 23286   / 5:  26.7818
+ 
+set axis/units=seconds  `temp,r=yaxis`
+ !-> set axis/units=seconds  PSYT
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      Y (SECONDS)        100 i   -28.836              48.568
+ PSZT      Z (ZORRO)           27 i-  5                    3824
+ TIME11    T (METERS)          25 r   22702                26206
+ normal    E
+ normal    F
+ 
+! assign time units to an abstract axis
+def axis/t=1:5:1 tax
+ 
+set axis/units=days/t0=1-jan-1990 tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 5 r   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 5
+list t[gt=tax]
+             VARIABLE : T
+                        axis TAX
+             SUBSET   : 5 points (TIME)
+ 02-JAN-1990 00 / 1:  1.00000
+ 03-JAN-1990 00 / 2:  2.00000
+ 04-JAN-1990 00 / 3:  3.00000
+ 05-JAN-1990 00 / 4:  4.00000
+ 06-JAN-1990 00 / 5:  5.00000
+ 
+! assign longitude units to an abstract axis
+! by default this becomes modulo
+def axis/x=0:120:20 xax
+ 
+set axis/units=lon xax
+sh axis xax
+ name       axis              # pts   start                end
+ XAX       LONGITUDE            7mr   0E                   120E
+   Axis span (to cell edges) = 140 (modulo length = 360)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 7 points (LONGITUDE)
+ 0E     / 1:    0.000
+ 20E    / 2:   20.000
+ 40E    / 3:   40.000
+ 60E    / 4:   60.000
+ 80E    / 5:   80.000
+ 100E   / 6:  100.000
+ 120E   / 7:  120.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.00000
+ 114W   / 427:  1.00000
+ 113W   / 428:  1.00000
+ 112W   / 429:  1.00000
+ 111W   / 430:  1.00000
+ 110W   / 431:  1.00000
+ 109W   / 432:  1.00000
+ 108W   / 433:  1.00000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+ 
+! ******** V5.8 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5559
+ 15-FEB      /  2:  29.5316
+ 17-MAR      /  3:  29.6615
+ 16-APR      /  4:  29.8829
+ 16-MAY      /  5:  29.8907
+ 16-JUN      /  6:  29.9644
+ 16-JUL      /  7:  29.6883
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.6661
+ 16-OCT      / 10:  29.7464
+ 15-NOV      / 11:  29.9058
+ 16-DEC      / 12:  29.7728
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                      139.5E   
+                       10
+ 16-JAN      /  1:  0.0020743
+ 15-FEB      /  2:  0.0005012
+ 17-MAR      /  3:  0.0079502
+ 16-APR      /  4:  0.0015034
+ 16-MAY      /  5:  0.0035104
+ 16-JUN      /  6:  0.0096970
+ 16-JUL      /  7:  0.0188794
+ 16-AUG      /  8:       ....
+ 15-SEP      /  9:  0.0055797
+ 16-OCT      / 10:  0.0068064
+ 15-NOV      / 11:  0.0019084
+ 16-DEC      / 12:  0.0048345
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5018
+ 15-FEB      /  2:  29.5157
+ 17-MAR      /  3:  29.5182
+ 16-APR      /  4:  29.7809
+ 16-MAY      /  5:  29.7883
+ 16-JUN      /  6:  29.8047
+ 16-JUL      /  7:  29.5034
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.5334
+ 16-OCT      / 10:  29.6438
+ 15-NOV      / 11:  29.8575
+ 16-DEC      / 12:  29.6620
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.6371
+ 15-FEB      /  2:  29.5474
+ 17-MAR      /  3:  29.8171
+ 16-APR      /  4:  29.9306
+ 16-MAY      /  5:  29.9564
+ 16-JUN      /  6:  30.0834
+ 16-JUL      /  7:  29.8189
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.7498
+ 16-OCT      / 10:  29.9003
+ 15-NOV      / 11:  29.9684
+ 16-DEC      / 12:  29.8558
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  295.559
+ 15-FEB      /  2:   59.063
+ 17-MAR      /  3:  533.908
+ 16-APR      /  4:  597.657
+ 16-MAY      /  5:  597.813
+ 16-JUN      /  6:  359.572
+ 16-JUL      /  7:  207.818
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  237.329
+ 16-OCT      / 10:  297.464
+ 15-NOV      / 11:  299.058
+ 16-DEC      / 12:  297.728
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  10.0000
+ 15-FEB      /  2:   2.0000
+ 17-MAR      /  3:  18.0000
+ 16-APR      /  4:  20.0000
+ 16-MAY      /  5:  20.0000
+ 16-JUN      /  6:  12.0000
+ 16-JUL      /  7:   7.0000
+ 16-AUG      /  8:   0.0000
+ 15-SEP      /  9:   8.0000
+ 16-OCT      / 10:  10.0000
+ 15-NOV      / 11:  10.0000
+ 16-DEC      / 12:  10.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.5000
+ 02-JAN-1990 00 /  2:  -1.5000
+ 03-JAN-1990 00 /  3:  -2.5000
+ 04-JAN-1990 00 /  4:  -3.5000
+ 05-JAN-1990 00 /  5:  -4.5000
+ 06-JAN-1990 00 /  6:  -5.5000
+ 07-JAN-1990 00 /  7:  -6.5000
+ 08-JAN-1990 00 /  8:  -7.5000
+ 09-JAN-1990 00 /  9:  -8.5000
+ 10-JAN-1990 00 / 10:  -9.5000
+ 11-JAN-1990 00 / 11:   1.9800
+ 12-JAN-1990 00 / 12:   3.9800
+ 13-JAN-1990 00 / 13:   5.9800
+ 14-JAN-1990 00 / 14:   7.9800
+ 15-JAN-1990 00 / 15:   9.9800
+ 16-JAN-1990 00 / 16:  11.9800
+ 17-JAN-1990 00 / 17:  13.9800
+ 18-JAN-1990 00 / 18:  15.9800
+ 19-JAN-1990 00 / 19:  17.9800
+ 20-JAN-1990 00 / 20:  19.9800
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.50000
+ 03-JAN-1990 00 / 3: -2.50000
+ 04-JAN-1990 00 / 4: -3.50000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.00000  0.500000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.98000
+ 13-JAN-1990 00 / 13:  5.98000
+ 14-JAN-1990 00 / 14:  7.98000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,6.2,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  3.00000  2.00000  1.00000  1.00000  3.00000
+ 2   / 2:  1.00000  3.00000  2.00000  2.00000  3.00000
+ 3   / 3:  2.00000  3.00000  3.00000  2.00000  3.00000
+ 4   / 4:  3.00000  2.00000  1.00000  1.00000  2.00000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ ---- K:1 Z:   1
+ 1   / 1:  111.000  112.000  113.000  114.000  115.000
+ 2   / 2:  121.000  122.000  123.000  124.000  125.000
+ 3   / 3:  131.000  132.000  133.000  134.000  135.000
+ 4   / 4:  141.000  142.000  143.000  144.000  145.000
+ ---- K:2 Z:   2
+ 1   / 1:  211.000  212.000  213.000  214.000  215.000
+ 2   / 2:  221.000  222.000  223.000  224.000  225.000
+ 3   / 3:  231.000  232.000  233.000  234.000  235.000
+ 4   / 4:  241.000  242.000  243.000  244.000  245.000
+ ---- K:3 Z:   3
+ 1   / 1:  311.000  312.000  313.000  314.000  315.000
+ 2   / 2:  321.000  322.000  323.000  324.000  325.000
+ 3   / 3:  331.000  332.000  333.000  334.000  335.000
+ 4   / 4:  341.000  342.000  343.000  344.000  345.000
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  311.000  212.000  113.000  114.000  315.000
+ 2   / 2:  121.000  322.000  223.000  224.000  325.000
+ 3   / 3:  231.000  332.000  333.000  234.000  335.000
+ 4   / 4:  341.000  242.000  143.000  144.000  245.000
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E     	100.E    	100.1E   	100.2E   	100.2E   	100.3E   
+0.11N	1.0011	1.0016	1.0021	1.0026	1.0031	1.0036
+0.128N	1.00128	1.00178	1.00228	1.00278	1.00328	1.00378
+0.146N	1.00146	1.00196	1.00246	1.00296	1.00346	1.00396
+0.164N	1.00164	1.00214	1.00264	1.00314	1.00364	1.00414
+0.182N	1.00182	1.00232	1.00282	1.00332	1.00382	1.00432
+0.2N	1.002	1.0025	1.003	1.0035	1.004	1.0045
+0.218N	1.00218	1.00268	1.00318	1.00368	1.00418	1.00468
+0.236N	1.00236	1.00286	1.00336	1.00386	1.00436	1.00486
+0.254N	1.00254	1.00304	1.00354	1.00404	1.00454	1.00504
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E     ,100E     ,100.1E   ,100.1E   
+0.11N,1.0011,1.00143,1.00176,1.00209
+0.128N,1.00128,1.00161,1.00194,1.00227
+0.146N,1.00146,1.00179,1.00212,1.00245
+0.164N,1.00164,1.00197,1.0023,1.00263
+0.182N,1.00182,1.00215,1.00248,1.00281
+0.2N,1.002,1.00233,1.00266,1.00299
+0.218N,1.00218,1.00251,1.00284,1.00317
+0.236N,1.00236,1.00269,1.00302,1.00335
+0.254N,1.00254,1.00287,1.0032,1.00353
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.000
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.00000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1W   	155.1W   	155.1W   	155.1W   	155.1W   
+19.7N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1W   ,155.1W   ,155.1W   ,155.1W   ,155.1W   
+19.7N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: FEB-1980
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  8.000E+00  7.200E+00 0.060    0  SYSTEM  @ASFERRET Ver. 6.85
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 2  8.000E+00  7.100E+00 0.060    0  SYSTEM  @ASNOAA/PMEL TMAP
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 3  8.000E+00  7.000E+00 0.060    0  SYSTEM  @AS12-NOV-2013 15:13:02
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  8.000E+00  6.540E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 7  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 8  8.000E+00  6.750E+00 0.073    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+ 
+! ******** V5.81 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.5
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.5
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+ 
+GO bn_reset
+cancel mode verify
+GO bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl fill
+ 
+GO bn_reset
+cancel mode verify
+GO bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME7     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME7     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+! can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+ 
+! ******** V6.00 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+ 
+GO bn_reset
+cancel mode verify
+GO bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.85"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET   version6.85:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO
+ 
+ Use SHOW ALIAS to see alternative command names
+ 
+GO bn_reset
+cancel mode verify
+GO bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "12-Nov-13:15:12"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="12-Nov-13:15:12"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 12-Nov-13
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 15:12
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="12-Nov-13:15:12"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "12-Nov-13:15:12"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT1)
+ Column  2: Z is Z (axis PSZT1)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT1)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+ 
+go bn_reset
+cancel mode verify
+go bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT1)                DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT1)                DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT1)                DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME4"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT1).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME4).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.6N
+             T (day): 1.8
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT1).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT1).units = degrees 
+ (PSXT1).point_spacing = even 
+ (PSXT1).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT1).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT1).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT1).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT1).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT1).units = meters 
+ (PSYT1).point_spacing = uneven 
+ (PSYT1).edges = PSYTedges 
+ (PSYT1).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = hour since 0000-01-01 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME7).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = days since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME7).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME7).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-mar-1955 
+ (TIME7).time_origin = 1-mar-1955 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME7).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME3[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME3).units = hour since 0000-01-01 00:00:00 
+ (TIME3).time_origin = 01-JAN-0000 00:00:00 
+ (TIME3).modulo =   
+ (TIME3).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+ 
+!=======
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!go bn_reset
+!go bn_nco_functions.jnl
+ 
+go bn_reset
+cancel mode verify
+go bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : JAN
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : JAN
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+ 
+go bn_reset
+cancel mode verify
+go bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : JAN to APR (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : JAN
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : JAN
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : AUG-1982
+          11.33
+ 
+go bn_reset
+cancel mode verify
+go bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+ 
+go bn_reset
+cancel mode verify
+go bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME11
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+ 
+! ******** V6.01 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6321)
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME9
+ 
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME9
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT1
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT1
+show att/all ($zax)
+ !-> show att/all PSZT1
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT1_10)             DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        13   T       PSZT1_10_bnds
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ PSZT1_10_bnds         DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT1_10)             DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        13   T       PSZT1_10_bnds
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ PSZT1_10_bnds         DOUBLE
+  
+(TIME12)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! ******** V6.02 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX047)
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:   1
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX042)
+ name       axis              # pts   start                end
+ (AX042)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX049)
+ name       axis              # pts   start                end
+ (AX049)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME10
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX051)
+ name       axis              # pts   start                end
+ (AX051)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX048)
+ name       axis              # pts   start                end
+ (AX048)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: FEB-1982 to MAR-1982
+             LONGITUDE: 179.5E
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME3     TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      T                    5 r   1                    5
+   Axis span (to cell edges) = 5
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX1     X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX1     T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = 360)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+GO bn_reset
+cancel mode verify
+GO bn602_bug_fixes
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME11    TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+ 
+ 
+! ******** V6.03 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: JAN to DEC
+             LONGITUDE: 139.5E
+             LATITUDE: 0.833N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn603_bug_fixes
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+ 
+! ******** V6.05 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+Internal overflow expressing 500000.0 Mwords as words (1783793664) 
+Unable to allocate the requested 500000.0 Mwords of memory.
+Memory remaining at 0.2 Mwords.
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  11.89756
+ 179W   / 81:  12.11905
+ 177W   / 82:  12.07976
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  35.69268
+ 179W   / 81:  36.35714
+ 177W   / 82:  36.23927
+ 
+ 
+GO bn_reset
+cancel mode verify
+! This routine executes a ppl error which exits us from Ferret
+! when run in the benchmark suite. Should test this, but dont do it
+! here, for now.
+!GO bn_ppl_errors.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO bn_memory_symbol
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+ 
+GO bn_reset
+cancel mode verify
+GO bn605_bug_fixes
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: JAN to DEC
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                            T     TBOX
+16-JAN 12      /  1:   15.5000  31.00000
+15-FEB 02      /  2:   45.1213  28.24250
+15-MAR 17      /  3:   74.7425  31.00000
+15-APR 05      /  4:  105.2425  30.00000
+15-MAY 17      /  5:  135.7425  31.00000
+15-JUN 05      /  6:  166.2425  30.00000
+15-JUL 17      /  7:  196.7425  31.00000
+15-AUG 17      /  8:  227.7425  31.00000
+15-SEP 05      /  9:  258.2425  30.00000
+15-OCT 17      / 10:  288.7425  31.00000
+15-NOV 05      / 11:  319.2425  30.00000
+15-DEC 17      / 12:  349.7425  31.00000
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn608_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G103)">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+<taxis>TIME11</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "7.9999998E-04"
+YAXIS_MAX = "2.0999999E-03"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000001E-07"
+YAXIS_MAX = "2.1000001E-06"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+YAXNAM = "YAX_LEV94"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXL = "4.737"
+XAXNAME = "XIRREG_SUBSPAN"
+XAXIS_MAX = "5.0050505E-06"
+XAXNAM = "(XAX_LEV9421_380)"
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+YAXNAM = "YAX_LEV94"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+ 
+ 
+! ******** V6.1 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_trim
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_nlevels
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn61_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+ 
+ 
+! ******** V6.11 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_test_opendap
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00000
+ 
+ 
+CANCEL MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO bn611_bug_fixes
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+fill/over/i=1:2/j=0:2/patt i+j
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME3"          
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G103)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+ 
+! ******** V6.13 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_no_valid_on_plot
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.530E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.780E+00 -7.900E-01 0.119    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.530E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_median
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: NOV-1982 to JAN-1983
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                           VAR     VAR       VAR       VAR
+30-NOV-1982 23 / 106: -10.06812 -10.06812 -10.06812 -11.97891
+04-DEC-1982 00 / 107: -13.41848 -13.41848 -13.41848 -10.06812
+07-DEC-1982 01 / 108: -15.06836 -13.41848 -13.41848 -10.06812
+10-DEC-1982 02 / 109: -11.97891 -11.97891 -11.97891 -10.06812
+13-DEC-1982 03 / 110:  -4.63116  -4.63116  -4.63116  -4.63116
+16-DEC-1982 04 / 111:   0.77075   0.77075   0.77075   0.77075
+19-DEC-1982 05 / 112:   1.06240   1.06240   1.06240   1.06240
+22-DEC-1982 06 / 113:   2.75400   2.75400   2.75400   2.75400
+25-DEC-1982 07 / 114:   9.06758   9.06758   9.06758   4.21162
+28-DEC-1982 08 / 115:  10.80434   9.06758   9.06758   4.21162
+31-DEC-1982 09 / 116:   4.21162  10.80434  10.80434   9.06758
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: FEB-0002
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+                  VAR     VAR       VAR
+79W   / 131:      ....  25.98750  25.92824
+77W   / 132:      ....      ....  25.98750
+75W   / 133:      ....      ....  25.98750
+73W   / 134:      ....      ....      ....
+71W   / 135:      ....      ....      ....
+69W   / 136:      ....      ....      ....
+67W   / 137:      ....      ....      ....
+65W   / 138:      ....      ....      ....
+63W   / 139:      ....      ....  27.80000
+61W   / 140:      ....      ....  27.80000
+59W   / 141:      ....  27.80000  27.64737
+57W   / 142:  27.80000  27.80000  27.70333
+55W   / 143:  27.64737  27.64737  27.64737
+53W   / 144:  27.43500  27.64737  27.64737
+51W   / 145:  27.70333  27.43500  27.64737
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: FEB-0002
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+                 VAR     VAR       VAR
+19S   / 36:  28.32244  28.32244  28.32244
+17S   / 37:  28.56983  28.56983  28.56983
+15S   / 38:  29.05953  29.05953  29.05953
+13S   / 39:  29.43250  29.23719  29.23170
+11S   / 40:  29.23719  29.32561  29.23170
+9S    / 41:  29.32561  29.23719  29.23170
+7S    / 42:  29.23170  29.23170  29.23170
+5S    / 43:  28.96976  28.96976  28.96976
+3S    / 44:  28.39779  28.39779  28.44243
+1S    / 45:  28.36456  28.39779  28.39779
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+                VAR     VAR        VAR
+0     / 1:  1.900075  1.900075  0.3281405
+20    / 2:  1.322209  1.322209  0.3281405
+40    / 3:  0.328140  0.328140  0.2405229
+60    / 4: -0.253715 -0.157475  0.3281405
+80    / 5: -0.157475 -0.253715  0.3281405
+100   / 6: -0.785400 -0.157475  0.3281405
+120   / 7:  0.240523  0.240523  0.3281405
+140   / 8:  0.390383  0.390383  0.3903829
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn614_bug_fixes
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E(179.97)
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME11    TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E(180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E(180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1.011S
+                          141.3W   
+                            1
+ 16-JAN 12      /  1:  0.05848070
+ 15-FEB 00      /  2:  0.05188299
+ 16-MAR 12      /  3:  0.04782573
+ 16-APR 00      /  4:  0.03808421
+ 16-MAY 12      /  5:  0.05937929
+ 16-JUN 00      /  6:  0.06571895
+ 16-JUL 12      /  7:  0.06152720
+ 16-AUG 12      /  8:  0.07460730
+ 16-SEP 00      /  9:  0.05815475
+ 16-OCT 12      / 10:  0.06169292
+ 16-NOV 00      / 11:  0.05654943
+ 16-DEC 12      / 12:  0.05768678
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX3      TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+ 
+! ******** V6.14 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_mode_nodata_lab
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_proleptic_gregorian_calendar
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME               733 r   01-JAN-1988 00:00    01-JAN-1990 00:00
+T0 = 15-JAN-1901
+CALENDAR = ALL_LEAP
+   Axis span (to cell edges) = 733
+ 
+GO bn_reset
+cancel mode verify
+GO bn_string_ngd_nbd
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cat_string
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sort_strings
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+          INDX_AJ                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+          INDX_BJ   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+          INDX_AK                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+          INDX_BK   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+          INDX_AL                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+          INDX_BL   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_samplexyt
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+               YPTS     TPTS   SAMPL_PTS
+1    /  1:  20.53799    20.000      ....
+2    /  2: -29.07481    60.000      ....
+3    /  3:  26.64251   100.000      ....
+4    /  4: -28.97490   140.000      ....
+5    /  5: -17.10210   180.000      ....
+6    /  6:  -8.79040   220.000      ....
+7    /  7: -26.48790   260.000      ....
+8    /  8:  -9.00391   300.000      ....
+9    /  9: -19.19385   340.000      ....
+10   / 10: -19.84003   380.000  360.6600
+11   / 11: -44.10992   420.000  376.3901
+12   / 12:  34.07387   460.000  494.5739
+13   / 13:  34.62830   500.000  535.1283
+14   / 14:  -6.59559   540.000  533.9044
+15   / 15: -39.01164   580.000  541.4884
+16   / 16: -25.63370   620.000  594.8663
+17   / 17: -22.96677   660.000  637.5332
+18   / 18: -30.90969   700.000  669.5903
+19   / 19: -22.52078   740.000      ....
+20   / 20: -20.65415   780.000      ....
+21   / 21: -41.65880   820.000      ....
+22   / 22:  39.13533   860.000      ....
+23   / 23:  22.88071   900.000      ....
+24   / 24: -41.03287   940.000      ....
+25   / 25:  33.34976   980.000      ....
+26   / 26:  22.53505  1020.000      ....
+27   / 27:  13.97536  1060.000      ....
+28   / 28:  21.99063  1100.000      ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G092_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G092_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G103_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+          FCN_NOR    FCN_REV
+J /  1:  0.6331937 -0.6331937
+J /  2:  0.6454794 -0.6454794
+J /  3:  0.4997293 -0.4997293
+J /  4:  0.2316280 -0.2316280
+J /  5: -0.0931839  0.0931839
+J /  6: -0.3951811  0.3951811
+J /  7: -0.6004243  0.6004243
+J /  8: -0.6586626  0.6586626
+J /  9: -0.5556374  0.5556374
+J / 10: -0.3165727  0.3165727
+J / 11:  0.0000000  0.0000000
+J / 12:  0.3165727 -0.3165727
+J / 13:  0.5556374 -0.5556374
+J / 14:  0.6586626 -0.6586626
+J / 15:  0.6004243 -0.6004243
+J / 16:  0.3951811 -0.3951811
+J / 17:  0.0931839 -0.0931839
+J / 18: -0.2316280  0.2316280
+J / 19: -0.4997293  0.4997293
+J / 20: -0.6454794  0.6454794
+J / 21: -0.6331937  0.6331937
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+                180E    
+                51
+ 8N   / 19:  0.4997293
+ 7N   / 18:  0.2316280
+ 6N   / 17: -0.0931839
+ 5N   / 16: -0.3951811
+ 4N   / 15: -0.6004243
+ 3N   / 14: -0.6586626
+ 2N   / 13: -0.5556374
+ 1N   / 12: -0.3165727
+ 0    / 11:  0.0000000
+ 1S   / 10:  0.3165727
+ 
+GO bn_reset
+cancel mode verify
+GO bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+ 
+! ******** V6.2 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0000
+ 31-DEC-1999 12:00 / 792:  365.0000
+ 01-JAN-2000 00:00 / 793:    1.0000
+ 01-JAN-2000 12:00 / 794:    1.0000
+ 02-JAN-2000 00:00 / 795:    2.0000
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A       A        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+                  B       B        EX#3       EX#4
+1    /  1:  0.000000       ....       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000  0.8000000
+3    /  3:  1.000000  0.7500000  0.7500000  0.6000000
+4    /  4:  0.000000  0.5000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000  0.4000000
+6    /  6:  0.000000  0.2500000  0.2500000  0.1000000
+7    /  7:  0.000000  0.0000000  0.0000000       ....
+8    /  8:  0.000000       ....       ....       ....
+9    /  9:      ....       ....       ....       ....
+10   / 10:  0.000000       ....       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000       ....
+12   / 12:  0.000000       ....       ....       ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+                  C       C        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 13
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+                  D       D        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A      A        EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000000      ....      ....
+2    /  2:  2.000000  1.750000  1.750000
+3    /  3:  2.000000  1.750000  1.750000
+4    /  4:  1.000000  1.500000  1.500000
+5    /  5:  2.000000  1.500000  1.500000
+6    /  6:  1.000000  1.250000  1.250000
+7    /  7:  1.000000  1.000000  1.000000
+8    /  8:  1.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  1.000000      ....      ....
+11   / 11:  1.000000  1.000000  1.000000
+12   / 12:  1.000000      ....      ....
+ ---- J:2 Y:   2
+1    /  1:  2.000000      ....      ....
+2    /  2:  3.000000  2.750000  2.750000
+3    /  3:  3.000000  2.750000  2.750000
+4    /  4:  2.000000  2.500000  2.500000
+5    /  5:  3.000000  2.500000  2.500000
+6    /  6:  2.000000  2.250000  2.250000
+7    /  7:  2.000000  2.000000  2.000000
+8    /  8:  2.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  2.000000      ....      ....
+11   / 11:  2.000000  2.000000  2.000000
+12   / 12:  2.000000      ....      ....
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3122928879.
+ 01-JAN-2000 00:14:41 / 441:  3122928881.
+ 01-JAN-2000 00:14:43 / 442:  3122928883.
+ 01-JAN-2000 00:14:45 / 443:  3122928885.
+ 01-JAN-2000 00:14:47 / 444:  3122928887.
+ 01-JAN-2000 00:14:49 / 445:  3122928889.
+ 01-JAN-2000 00:14:51 / 446:  3122928891.
+ 01-JAN-2000 00:14:53 / 447:  3122928893.
+ 01-JAN-2000 00:14:55 / 448:  3122928895.
+ 01-JAN-2000 00:14:57 / 449:  3122928897.
+ 01-JAN-2000 00:14:59 / 450:  3122928899.
+ 01-JAN-2000 00:15:01 / 451:  3122928901.
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_clock_syms
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "37.8522"
+CLOCK_SECS = "78.607"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:13:28"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.033995"
+CLOCK_SECS = "78.676"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.314951
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.001"
+CLOCK_SECS = "79.62"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "79.621"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.033996
+ !-> DEFINE VARIABLE sumcpu =0.033996
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.037994
+ !-> DEFINE VARIABLE sumcpu =0.07199
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.035994
+ !-> DEFINE VARIABLE sumcpu =0.107984
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.033995
+ !-> DEFINE VARIABLE sumcpu =0.141979
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.036994
+ !-> DEFINE VARIABLE sumcpu =0.178973
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.213968
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.248963
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.036995
+ !-> DEFINE VARIABLE sumcpu =0.285958
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.036993
+ !-> DEFINE VARIABLE sumcpu =0.322951
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.034996
+ !-> DEFINE VARIABLE sumcpu =0.357947
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.357947
+0.357947
+sh sym CLOCK_SECS
+CLOCK_SECS = "80.865"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:12"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:13:30"
+ 
+ 
+! ******** V6.3 Additions below ***********
+! Note that allowing mouse-click operations in the current
+! window, not only in window 1, is implemented in v6.3. Not
+! tested in the benchmarks.
+ 
+GO bn_reset
+cancel mode verify
+GO bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+Set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                     Z    ZBOXLO    ZBOXHI
+-5000   /  1: -5000.000 -5000.000 -4500.000
+-4000   /  2: -4000.000 -4500.000 -3500.000
+-3000   /  3: -3000.000 -3500.000 -2500.000
+-2000   /  4: -2000.000 -2500.000 -1800.000
+-1500   /  5: -1500.000 -1800.000 -1300.000
+-1200   /  6: -1200.000 -1300.000 -1100.000
+-1000   /  7: -1000.000 -1100.000  -900.000
+-800    /  8:  -800.000  -900.000  -700.000
+-600    /  9:  -600.000  -700.000  -500.000
+-400    / 10:  -400.000  -500.000  -350.000
+-300    / 11:  -300.000  -350.000  -250.000
+-200    / 12:  -200.000  -250.000  -180.000
+-150    / 13:  -150.000  -180.000  -120.000
+-100    / 14:  -100.000  -120.000   -90.000
+-75     / 15:   -75.000   -90.000   -60.000
+-50     / 16:   -50.000   -60.000   -32.000
+-30     / 17:   -30.000   -32.000   -24.000
+-20     / 18:   -20.000   -24.000   -12.000
+-10     / 19:   -10.000   -12.000    -5.000
+0       / 20:     0.000    -5.000     0.000
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : JAN
+ 1   / 1:  27.46402
+ 2   / 2:  27.44937
+ 3   / 3:  27.53579
+ 4   / 4:  27.54567
+ 5   / 5:  27.55554
+ 6   / 6:  27.65924
+ 7   / 7:  27.74823
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+              YBOXLO    YBOXHI
+76.5S /  1: -90.00000 -70.81186
+66.4S /  2: -70.81186 -62.73396
+59.4S /  3: -62.73396 -56.44269
+53.7S /  4: -56.44269 -51.05756
+48.6S /  5: -51.05756 -46.23826
+44S   /  6: -46.23826 -41.81031
+39.7S /  7: -41.81031 -37.66989
+35.7S /  8: -37.66989 -33.74899
+31.9S /  9: -33.74899 -30.00000
+28.2S / 10: -30.00000 -26.38780
+24.6S / 11: -26.38780 -22.88538
+21.2S / 12: -22.88538 -19.47122
+17.8S / 13: -19.47122 -16.12762
+14.5S / 14: -16.12762 -12.83959
+11.2S / 15: -12.83959  -9.59407
+8S    / 16:  -9.59407  -6.37937
+4.8S  / 17:  -6.37937  -3.18474
+1.6S  / 18:  -3.18474  -0.00000
+1.6N  / 19:  -0.00000   3.18474
+4.8N  / 20:   3.18474   6.37937
+8N    / 21:   6.37937   9.59407
+11.2N / 22:   9.59407  12.83959
+14.5N / 23:  12.83959  16.12762
+17.8N / 24:  16.12762  19.47122
+21.2N / 25:  19.47122  22.88538
+24.6N / 26:  22.88538  26.38780
+28.2N / 27:  26.38780  30.00000
+31.9N / 28:  30.00000  33.74899
+35.7N / 29:  33.74899  37.66989
+39.7N / 30:  37.66989  41.81031
+44N   / 31:  41.81031  46.23826
+48.6N / 32:  46.23826  51.05756
+53.7N / 33:  51.05756  56.44269
+59.4N / 34:  56.44269  62.73396
+66.4N / 35:  62.73396  70.81186
+76.5N / 36:  70.81186  90.00000
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+                  EX#1      EX#2
+76.5S /  1:  0.03826170  0.02777778
+66.4S /  2:  0.02750340  0.02777778
+59.4S /  3:  0.02724976  0.02777778
+53.7S /  4:  0.02718343  0.02777778
+48.6S /  5:  0.02715676  0.02777778
+44S   /  6:  0.02714348  0.02777778
+39.7S /  7:  0.02713596  0.02777778
+35.7S /  8:  0.02713132  0.02777778
+31.9S /  9:  0.02712828  0.02777778
+28.2S / 10:  0.02712619  0.02777778
+24.6S / 11:  0.02712471  0.02777778
+21.2S / 12:  0.02712365  0.02777778
+17.8S / 13:  0.02712287  0.02777778
+14.5S / 14:  0.02712229  0.02777778
+11.2S / 15:  0.02712188  0.02777778
+8S    / 16:  0.02712159  0.02777778
+4.8S  / 17:  0.02712141  0.02777778
+1.6S  / 18:  0.02712133  0.02777778
+1.6N  / 19:  0.02712133  0.02777778
+4.8N  / 20:  0.02712141  0.02777778
+8N    / 21:  0.02712159  0.02777778
+11.2N / 22:  0.02712188  0.02777778
+14.5N / 23:  0.02712229  0.02777778
+17.8N / 24:  0.02712287  0.02777778
+21.2N / 25:  0.02712365  0.02777778
+24.6N / 26:  0.02712471  0.02777778
+28.2N / 27:  0.02712619  0.02777778
+31.9N / 28:  0.02712828  0.02777778
+35.7N / 29:  0.02713132  0.02777778
+39.7N / 30:  0.02713596  0.02777778
+44N   / 31:  0.02714348  0.02777778
+48.6N / 32:  0.02715676  0.02777778
+53.7N / 33:  0.02718343  0.02777778
+59.4N / 34:  0.02724976  0.02777778
+66.4N / 35:  0.02750340  0.02777778
+76.5N / 36:  0.03826170  0.02777778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777782
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777779
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777777
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0000
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8458605
+ 16-JAN-1951 /  2: -0.4792148
+ 16-JAN-1952 /  3: -0.0086413
+ 16-JAN-1953 /  4:  0.5029880
+ 16-JAN-1954 /  5: -0.8600939
+ 16-JAN-1955 /  6:  0.9996375
+ 16-JAN-1956 /  7: -0.8863128
+ 16-JAN-1957 /  8:  0.5403982
+ 16-JAN-1958 /  9: -0.0624683
+ 16-JAN-1959 / 10: -0.4312768
+ 16-JAN-1960 / 11:  0.8159143
+ 16-JAN-1961 / 12: -0.9951944
+ 16-JAN-1962 / 13:  0.9169914
+ 16-JAN-1963 / 14: -0.6068212
+ 16-JAN-1964 / 15:  0.1431603
+ 16-JAN-1965 / 16:  0.3660465
+ 16-JAN-1966 / 17: -0.7727474
+ 16-JAN-1967 / 18:  0.9839827
+ 16-JAN-1968 / 19: -0.9463078
+ 16-JAN-1969 / 20:  0.6617913
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX133)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241199
+ DEC-1951 /  2:  0.2968155
+ DEC-1952 /  3:  0.2153545
+ DEC-1953 /  4: -0.6634768
+ DEC-1954 /  5:  0.9437761
+ DEC-1955 /  6: -0.9853337
+ DEC-1956 /  7:  0.7713169
+ DEC-1957 /  8: -0.3639512
+ DEC-1958 /  9: -0.1354919
+ DEC-1959 / 10:  0.6006479
+ DEC-1960 / 11: -0.9178868
+ DEC-1961 / 12:  0.9949715
+ DEC-1962 / 13: -0.8203671
+ DEC-1963 / 14:  0.4382506
+ DEC-1964 / 15:  0.0647143
+ DEC-1965 / 16: -0.5422904
+ DEC-1966 / 17:  0.8826929
+ DEC-1967 / 18: -0.9998160
+ DEC-1968 / 19:  0.8589436
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX139)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_reversed_syms
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_isdepth
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT1
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+ 
+ 
+! ******** V6.4 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn64_bug_fixes
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                  2         3      
+                   2         3
+ 21241   / 1:   2.00000  27.00000
+ 21242   / 2:   2.00000  28.00000
+ 21243   / 3:   2.00000  29.00000
+ 21244   / 4:   3.00000   1.00000
+ 21245   / 5:   3.00000   2.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_grid_names
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+               1          2          3      
+               1          2          3
+ 1   / 1:  0.0060000  0.1760000  0.2820000
+ 2   / 2:  0.3550000  0.3790000  0.3930000
+ 3   / 3:  0.4100000  0.4170000  0.4670000
+ 4   / 4:  0.4350000  0.4440000  0.4700000
+ 5   / 5:  0.4780000  0.5150000  0.4690000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4         6         8      
+               2         3         4
+ ---- L:2 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2222.000  3222.000  4222.000
+ 6   / 3:  2322.000  3322.000  4322.000
+ 8   / 4:  2422.000  3422.000  4422.000
+ ---- K:3 Z:   6
+ 4   / 2:  2232.000  3232.000  4232.000
+ 6   / 3:  2332.000  3332.000  4332.000
+ 8   / 4:  2432.000  3432.000  4432.000
+ ---- K:4 Z:   8
+ 4   / 2:  2242.000  3242.000  4242.000
+ 6   / 3:  2342.000  3342.000  4342.000
+ 8   / 4:  2442.000  3442.000  4442.000
+ ---- L:3 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2223.000  3223.000  4223.000
+ 6   / 3:  2323.000  3323.000  4323.000
+ 8   / 4:  2423.000  3423.000  4423.000
+ ---- K:3 Z:   6
+ 4   / 2:  2233.000  3233.000  4233.000
+ 6   / 3:  2333.000  3333.000  4333.000
+ 8   / 4:  2433.000  3433.000  4433.000
+ ---- K:4 Z:   8
+ 4   / 2:  2243.000  3243.000  4243.000
+ 6   / 3:  2343.000  3343.000  4343.000
+ 8   / 4:  2443.000  3443.000  4443.000
+ ---- L:4 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2224.000  3224.000  4224.000
+ 6   / 3:  2324.000  3324.000  4324.000
+ 8   / 4:  2424.000  3424.000  4424.000
+ ---- K:3 Z:   6
+ 4   / 2:  2234.000  3234.000  4234.000
+ 6   / 3:  2334.000  3334.000  4334.000
+ 8   / 4:  2434.000  3434.000  4434.000
+ ---- K:4 Z:   8
+ 4   / 2:  2244.000  3244.000  4244.000
+ 6   / 3:  2344.000  3344.000  4344.000
+ 8   / 4:  2444.000  3444.000  4444.000
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5         7         9      
+               3         4         5
+ ---- L:3 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2777.500  3777.500  4777.500
+ 7   / 4:  2877.500  3877.500  4877.500
+ 9   / 5:  2977.500  3977.500  4977.500
+ ---- K:4 Z:   7
+ 5   / 3:  2787.500  3787.500  4787.500
+ 7   / 4:  2887.500  3887.500  4887.500
+ 9   / 5:  2987.500  3987.500  4987.500
+ ---- K:5 Z:   9
+ 5   / 3:  2797.500  3797.500  4797.500
+ 7   / 4:  2897.500  3897.500  4897.500
+ 9   / 5:  2997.500  3997.500  4997.500
+ ---- L:4 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2778.500  3778.500  4778.500
+ 7   / 4:  2878.500  3878.500  4878.500
+ 9   / 5:  2978.500  3978.500  4978.500
+ ---- K:4 Z:   7
+ 5   / 3:  2788.500  3788.500  4788.500
+ 7   / 4:  2888.500  3888.500  4888.500
+ 9   / 5:  2988.500  3988.500  4988.500
+ ---- K:5 Z:   9
+ 5   / 3:  2798.500  3798.500  4798.500
+ 7   / 4:  2898.500  3898.500  4898.500
+ 9   / 5:  2998.500  3998.500  4998.500
+ ---- L:5 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2779.500  3779.500  4779.500
+ 7   / 4:  2879.500  3879.500  4879.500
+ 9   / 5:  2979.500  3979.500  4979.500
+ ---- K:4 Z:   7
+ 5   / 3:  2789.500  3789.500  4789.500
+ 7   / 4:  2889.500  3889.500  4889.500
+ 9   / 5:  2989.500  3989.500  4989.500
+ ---- K:5 Z:   9
+ 5   / 3:  2799.500  3799.500  4799.500
+ 7   / 4:  2899.500  3899.500  4899.500
+ 9   / 5:  2999.500  3999.500  4999.500
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME13    NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88290  23.97420  24.14894  24.37499  24.62556
+ 25-JAN-1982 00 / 3:  23.88501  23.98344  24.16565  24.39832  24.65027
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88380  23.97520  24.15006  24.37614  24.62650
+ 25-JAN-1982 00 / 3:  23.87741  23.97277  24.15346  24.38574  24.63814
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.75267  23.76377  23.87293  24.04456  24.25203
+ 25-JAN-1982 00 / 3:  23.74388  23.73211  23.81637  23.96577  24.15370
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M: 29 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 753  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 27 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 754  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 755  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT1     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 756  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 26 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 757  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 758  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT1     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 759  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 760  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 761  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ found   TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+setting up plot
+PPL plot 762  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT1     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 25 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 763  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT1     TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 764  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 765  complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+               158.5E    159.5E    160.5E  
+               139       140       141
+ 4.5S / 86:  29.51100  29.44300  29.38000
+ 5.5S / 85:  29.58900  29.52500  29.45700
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G105)
+    GRID (G105)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G105)
+    GRID (G105)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G105)
+    GRID (G105)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00000
+ 23E   / 2:  23.00000
+ 25E   / 3:  25.00000
+ 27E   / 4:  27.00000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   3
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid GG2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid (G105)
+    GRID (G105)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX139)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G105)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX139)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX139)                         use count:   1
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX128)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_repl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+ 
+! ******** V6.5 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn65_bug_fixes
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.0
+ 16-OCT-1149 12 /  2:  419308.5
+ 16-NOV-1149 00 /  3:  419339.0
+ 16-DEC-1149 12 /  4:  419369.5
+ 16-JAN-1150 12 /  5:  419400.5
+ 15-FEB-1150 00 /  6:  419430.0
+ 16-MAR-1150 12 /  7:  419459.5
+ 16-APR-1150 00 /  8:  419490.0
+ 16-MAY-1150 12 /  9:  419520.5
+ 16-JUN-1150 00 / 10:  419551.0
+ 16-JUL-1150 12 / 11:  419581.5
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_txtype_dmy
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn_n_open_dsets_sym
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_multi_decade
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+GO bn_reset
+cancel mode verify
+GO bn_show_xml_file
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME3</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME3">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+ 
+ 
+! GO bn_reset
+! GO bn_encode_url
+ 
+! ******** V6.6 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn66_bug_fixes
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: AUG-1982 to JAN-1983 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: AUG-1982 to JAN-1983
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : AUG-1982 to JAN-1983 (XZT ave)
+ 3.5N  / 56:  27.59128
+ 3.17N / 55:  27.76072
+ 2.83N / 54:  27.89503
+ 2.5N  / 53:  28.00175
+ 2.17N / 52:  28.08330
+ 1.83N / 51:  28.13652
+ 1.5N  / 50:  28.15913
+ 1.17N / 49:  28.15796
+ 0.83N / 48:  28.14635
+ 0.5N  / 47:  28.13609
+ 0.17N / 46:  28.13627
+ 0.17S / 45:  28.15042
+ 0.5S  / 44:  28.17639
+ 0.83S / 43:  28.20504
+ 1.17S / 42:  28.22684
+ 1.5S  / 41:  28.23347
+ 1.83S / 40:  28.21657
+ 2.17S / 39:  28.16886
+ 2.5S  / 38:  28.08460
+ 2.83S / 37:  27.96112
+ 3.17S / 36:  27.80014
+ 3.5S  / 35:  27.60770
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: AUG-1982 to JAN-1983 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+ 
+GO bn_reset
+cancel mode verify
+GO bn_netcdf4
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G088)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G095)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+ 
+! *********** v6.62 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_dir_symbols
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+AX_VERT = "Y"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+ 
+! *********** v6.63 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn663_bug_fixes
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_axis_regular
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.2563 to 10.74
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_cancel_redirect
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.85  "                                                          
+ 3    /  3:" ! Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13"                      
+ 4    /  4:" ! 12-Nov-13 15:12     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+ 
+GO bn_reset
+cancel mode verify
+GO bn_min_max_smoothers
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.667S to 3.667N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vector_symbols
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+ 
+GO bn_reset
+cancel mode verify
+GO bn_variance_large
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labnum_calendar
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME12
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+ 
+ 
+! *********** v6.65 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn665_bug_fixes
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME12
+<axes>
+<axis name="TIME12">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME12</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME12</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME12
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_floatstr
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+ 
+! *********** v6.7 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn67_bug_fixes
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME12)               DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_NaN_note
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+ 
+! *********** v6.71 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn671_bug_fixes
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3663   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+ 
+! *********** v6.8 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn68_bug_fixes
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G091)
+ name       axis              # pts   start                end
+ (AX129)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G091)
+ name       axis              # pts   start                end
+ (AX127)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX129
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX129
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX129
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX129
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX129
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ifv
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_randu2_randn2
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+let xbig = x[i=1:20000:1]
+let xx = x[i=1:6:1]
+ 
+! RANDU2 with seed init via system clock. These should be different
+! load the variable to make sure some time has passed on the clock.
+ 
+! ******** This result may differ with each run of the benchmark scripts
+load randu2(xbig,-1)
+list/i=1:5 randu2(xbig,-1)
+             VARIABLE : RANDU2(XBIG,-1)
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.4663
+ 2   / 2:  0.1828
+ 3   / 3:  0.6104
+ 4   / 4:  0.4529
+ 5   / 5:  0.7002
+can mem
+list/i=1:5 randu2(xbig,-1)
+             VARIABLE : RANDU2(XBIG,-1)
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.0709
+ 2   / 2:  0.1771
+ 3   / 3:  0.1118
+ 4   / 4:  0.6788
+ 5   / 5:  0.5445
+ 
+! ******** This result may differ with each run of the benchmark scripts
+! RANDU2 with 0 seed to continue from previous seed. These should be different
+list randu2(xx,0)
+             VARIABLE : RANDU2(XX,0)
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.6885
+ 2   / 2:  0.4732
+ 3   / 3:  0.0327
+ 4   / 4:  0.6587
+ 5   / 5:  0.4896
+ 6   / 6:  0.8972
+can mem
+list randu2(xx,0)
+             VARIABLE : RANDU2(XX,0)
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.0823
+ 2   / 2:  0.7589
+ 3   / 3:  0.4554
+ 4   / 4:  0.3671
+ 5   / 5:  0.8057
+ 6   / 6:  0.8830
+ 
+! ******** This result should be consistent with each run of the benchmark scripts
+! RANDU2 with user-set seed. These should be duplicates
+list randu2(xx,12436)
+             VARIABLE : RANDU2(XX,12436)
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.3018
+ 2   / 2:  0.3804
+ 3   / 3:  0.9263
+ 4   / 4:  0.6721
+ 5   / 5:  0.2378
+ 6   / 6:  0.6382
+can mem
+list randu2(xx,12436)
+             VARIABLE : RANDU2(XX,12436)
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.3018
+ 2   / 2:  0.3804
+ 3   / 3:  0.9263
+ 4   / 4:  0.6721
+ 5   / 5:  0.2378
+ 6   / 6:  0.6382
+ 
+!same tests with RANDN2
+ 
+! ******** This result may differ with each run of the benchmark scripts
+! RANDN2 with clock-set seed. These should be different
+load randn2(xbig,-1)
+list/i=1:5 randn2(xbig,-1)
+             VARIABLE : RANDN2(XBIG,-1)
+             SUBSET   : 5 points (X)
+ 1   / 1: -0.741
+ 2   / 2:  0.428
+ 3   / 3:  1.838
+ 4   / 4:  0.479
+ 5   / 5: -0.373
+can mem
+list/i=1:5 randn2(xbig,-1)
+             VARIABLE : RANDN2(XBIG,-1)
+             SUBSET   : 5 points (X)
+ 1   / 1: -0.943
+ 2   / 2: -0.215
+ 3   / 3: -0.480
+ 4   / 4: -2.073
+ 5   / 5: -0.060
+ 
+! ******** This result may differ with each run of the benchmark scripts
+! RANDN2 with 0 seed to continue from previous seed. These should be different
+list randn2(xx,0)
+             VARIABLE : RANDN2(XX,0)
+             SUBSET   : 6 points (X)
+ 1   / 1: -0.661
+ 2   / 2: -0.984
+ 3   / 3:  0.570
+ 4   / 4: -1.507
+ 5   / 5: -0.067
+ 6   / 6: -0.070
+can mem
+list randn2(xx,0)
+             VARIABLE : RANDN2(XX,0)
+             SUBSET   : 6 points (X)
+ 1   / 1: -0.813
+ 2   / 2: -1.045
+ 3   / 3:  0.416
+ 4   / 4: -0.976
+ 5   / 5:  0.653
+ 6   / 6: -1.640
+ 
+! ******** This result should be consistent with each run of the benchmark scripts
+! RANDN2 with user-set seed. These should be duplicates
+list randn2(xx,12436)
+             VARIABLE : RANDN2(XX,12436)
+             SUBSET   : 6 points (X)
+ 1   / 1: -0.906
+ 2   / 2: -1.503
+ 3   / 3:  0.217
+ 4   / 4:  0.537
+ 5   / 5:  0.674
+ 6   / 6: -1.279
+can mem
+list randn2(xx,12436)
+             VARIABLE : RANDN2(XX,12436)
+             SUBSET   : 6 points (X)
+ 1   / 1: -0.906
+ 2   / 2: -1.503
+ 3   / 3:  0.217
+ 4   / 4:  0.537
+ 5   / 5:  0.674
+ 6   / 6: -1.279
+ 
+! A test from the median-smoothing benchmark
+ 
+! ******** This result may differ with each run of the benchmark scripts
+define axis/z=0:1000:20/depth zax
+let var2 = cos(z[gz=zax]/30) + randu2(1+k[gz=zax],-1)
+plot/trans var2, var2[z=@med:3], var2[z=@med:9]
+list/z=1:140 var2, var2[z=@med:3], var2[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+            VAR2   VAR2    VAR2
+0     / 1:  1.138  1.138  0.4152
+20    / 2:  0.794  0.794  0.4152
+40    / 3:  0.415  0.415  0.2777
+60    / 4:  0.278  0.278  0.2777
+80    / 5: -0.274 -0.135  0.2777
+100   / 6: -0.135 -0.274  0.2777
+120   / 7: -0.517 -0.135  0.2777
+140   / 8:  0.223  0.223  0.2777
+ 
+! ******** This result may differ with each run of the benchmark scripts
+! one for randn2
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN2(ypts,-1)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=v xpts,ypts,sst,star
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_cf
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeated_coords
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_header
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1: -0.0294  0.7065
+ 2   / 2:  0.7065  0.0294
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1: -0.059  1.413
+ 0.25  /   2:  0.126  1.409
+ 0.5   /   3:  0.309  1.380
+ 0.75  /   4:  0.486  1.328
+ 1     /   5:  0.655  1.253
+ 1.25  /   6:  0.813  1.157
+ 1.5   /   7:  0.957  1.041
+ 1.75  /   8:  1.085  0.907
+ 2     /   9:  1.194  0.757
+ 2.25  /  10:  1.283  0.595
+ 2.5   /  11:  1.350  0.423
+ 2.75  /  12:  1.393  0.243
+ 3     /  13:  1.413  0.059
+ 3.25  /  14:  1.409 -0.126
+ 3.5   /  15:  1.380 -0.309
+ 3.75  /  16:  1.328 -0.486
+ 4     /  17:  1.253 -0.655
+ 4.25  /  18:  1.157 -0.813
+ 4.5   /  19:  1.041 -0.957
+ 4.75  /  20:  0.907 -1.085
+ 5     /  21:  0.757 -1.194
+ 5.25  /  22:  0.595 -1.283
+ 5.5   /  23:  0.423 -1.350
+ 5.75  /  24:  0.243 -1.393
+ 6     /  25:  0.059 -1.413
+ 6.25  /  26: -0.126 -1.409
+ 6.5   /  27: -0.309 -1.380
+ 6.75  /  28: -0.486 -1.328
+ 7     /  29: -0.655 -1.253
+ 7.25  /  30: -0.813 -1.157
+ 7.5   /  31: -0.957 -1.041
+ 7.75  /  32: -1.085 -0.907
+ 8     /  33: -1.194 -0.757
+ 8.25  /  34: -1.283 -0.595
+ 8.5   /  35: -1.350 -0.423
+ 8.75  /  36: -1.393 -0.243
+ 9     /  37: -1.413 -0.059
+ 9.25  /  38: -1.409  0.126
+ 9.5   /  39: -1.380  0.309
+ 9.75  /  40: -1.328  0.486
+ 10    /  41: -1.253  0.655
+ 10.25 /  42: -1.157  0.813
+ 10.5  /  43: -1.041  0.957
+ 10.75 /  44: -0.907  1.085
+ 11    /  45: -0.757  1.194
+ 11.25 /  46: -0.595  1.283
+ 11.5  /  47: -0.423  1.350
+ 11.75 /  48: -0.243  1.393
+ 12    /  49: -0.059  1.413
+ 12.25 /  50:  0.126  1.409
+ 12.5  /  51:  0.309  1.380
+ 12.75 /  52:  0.486  1.328
+ 13    /  53:  0.655  1.253
+ 13.25 /  54:  0.813  1.157
+ 13.5  /  55:  0.957  1.041
+ 13.75 /  56:  1.085  0.907
+ 14    /  57:  1.194  0.757
+ 14.25 /  58:  1.283  0.595
+ 14.5  /  59:  1.350  0.423
+ 14.75 /  60:  1.393  0.243
+ 15    /  61:  1.413  0.059
+ 15.25 /  62:  1.409 -0.126
+ 15.5  /  63:  1.380 -0.309
+ 15.75 /  64:  1.328 -0.486
+ 16    /  65:  1.253 -0.655
+ 16.25 /  66:  1.157 -0.813
+ 16.5  /  67:  1.041 -0.957
+ 16.75 /  68:  0.907 -1.085
+ 17    /  69:  0.757 -1.194
+ 17.25 /  70:  0.595 -1.283
+ 17.5  /  71:  0.423 -1.350
+ 17.75 /  72:  0.243 -1.393
+ 18    /  73:  0.059 -1.413
+ 18.25 /  74: -0.126 -1.409
+ 18.5  /  75: -0.309 -1.380
+ 18.75 /  76: -0.486 -1.328
+ 19    /  77: -0.655 -1.253
+ 19.25 /  78: -0.813 -1.157
+ 19.5  /  79: -0.957 -1.041
+ 19.75 /  80: -1.085 -0.907
+ 20    /  81: -1.194 -0.757
+ 20.25 /  82: -1.283 -0.595
+ 20.5  /  83: -1.350 -0.423
+ 20.75 /  84: -1.393 -0.243
+ 21    /  85: -1.413 -0.059
+ 21.25 /  86: -1.409  0.126
+ 21.5  /  87: -1.380  0.309
+ 21.75 /  88: -1.328  0.486
+ 22    /  89: -1.253  0.655
+ 22.25 /  90: -1.157  0.813
+ 22.5  /  91: -1.041  0.957
+ 22.75 /  92: -0.907  1.085
+ 23    /  93: -0.757  1.194
+ 23.25 /  94: -0.595  1.283
+ 23.5  /  95: -0.423  1.350
+ 23.75 /  96: -0.243  1.393
+ 24    /  97: -0.059  1.413
+ 24.25 /  98:  0.126  1.409
+ 24.5  /  99:  0.309  1.380
+ 24.75 / 100:  0.486  1.328
+ 25    / 101:  0.655  1.253
+ 25.25 / 102:  0.813  1.157
+ 25.5  / 103:  0.957  1.041
+ 25.75 / 104:  1.085  0.907
+ 26    / 105:  1.194  0.757
+ 26.25 / 106:  1.283  0.595
+ 26.5  / 107:  1.350  0.423
+ 26.75 / 108:  1.393  0.243
+ 27    / 109:  1.413  0.059
+ 27.25 / 110:  1.409 -0.126
+ 27.5  / 111:  1.380 -0.309
+ 27.75 / 112:  1.328 -0.486
+ 28    / 113:  1.253 -0.655
+ 28.25 / 114:  1.157 -0.813
+ 28.5  / 115:  1.041 -0.957
+ 28.75 / 116:  0.907 -1.085
+ 29    / 117:  0.757 -1.194
+ 29.25 / 118:  0.595 -1.283
+ 29.5  / 119:  0.423 -1.350
+ 29.75 / 120:  0.243 -1.393
+ 30    / 121:  0.059 -1.413
+ 30.25 / 122: -0.126 -1.409
+ 30.5  / 123: -0.309 -1.380
+ 30.75 / 124: -0.486 -1.328
+ 31    / 125: -0.655 -1.253
+ 31.25 / 126: -0.813 -1.157
+ 31.5  / 127: -0.957 -1.041
+ 31.75 / 128: -1.085 -0.907
+ 32    / 129: -1.194 -0.757
+ 32.25 / 130: -1.283 -0.595
+ 32.5  / 131: -1.350 -0.423
+ 32.75 / 132: -1.393 -0.243
+ 33    / 133: -1.413 -0.059
+ 33.25 / 134: -1.409  0.126
+ 33.5  / 135: -1.380  0.309
+ 33.75 / 136: -1.328  0.486
+ 34    / 137: -1.253  0.655
+ 34.25 / 138: -1.157  0.813
+ 34.5  / 139: -1.041  0.957
+ 34.75 / 140: -0.907  1.085
+ 35    / 141: -0.757  1.194
+ 35.25 / 142: -0.595  1.283
+ 35.5  / 143: -0.423  1.350
+ 35.75 / 144: -0.243  1.393
+ 36    / 145: -0.059  1.413
+ 36.25 / 146:  0.126  1.409
+ 36.5  / 147:  0.309  1.380
+ 36.75 / 148:  0.486  1.328
+ 37    / 149:  0.655  1.253
+ 37.25 / 150:  0.813  1.157
+ 37.5  / 151:  0.957  1.041
+ 37.75 / 152:  1.085  0.907
+ 38    / 153:  1.194  0.757
+ 38.25 / 154:  1.283  0.595
+ 38.5  / 155:  1.350  0.423
+ 38.75 / 156:  1.393  0.243
+ 39    / 157:  1.413  0.059
+ 39.25 / 158:  1.409 -0.126
+ 39.5  / 159:  1.380 -0.309
+ 39.75 / 160:  1.328 -0.486
+ 40    / 161:  1.253 -0.655
+ 40.25 / 162:  1.157 -0.813
+ 40.5  / 163:  1.041 -0.957
+ 40.75 / 164:  0.907 -1.085
+ 41    / 165:  0.757 -1.194
+ 41.25 / 166:  0.595 -1.283
+ 41.5  / 167:  0.423 -1.350
+ 41.75 / 168:  0.243 -1.393
+ 42    / 169:  0.059 -1.413
+ 42.25 / 170: -0.126 -1.409
+ 42.5  / 171: -0.309 -1.380
+ 42.75 / 172: -0.486 -1.328
+ 43    / 173: -0.655 -1.253
+ 43.25 / 174: -0.813 -1.157
+ 43.5  / 175: -0.957 -1.041
+ 43.75 / 176: -1.085 -0.907
+ 44    / 177: -1.194 -0.757
+ 44.25 / 178: -1.283 -0.595
+ 44.5  / 179: -1.350 -0.423
+ 44.75 / 180: -1.393 -0.243
+ 45    / 181: -1.413 -0.059
+ 45.25 / 182: -1.409  0.126
+ 45.5  / 183: -1.380  0.309
+ 45.75 / 184: -1.328  0.486
+ 46    / 185: -1.253  0.655
+ 46.25 / 186: -1.157  0.813
+ 46.5  / 187: -1.041  0.957
+ 46.75 / 188: -0.907  1.085
+ 47    / 189: -0.757  1.194
+ 47.25 / 190: -0.595  1.283
+ 47.5  / 191: -0.423  1.350
+ 47.75 / 192: -0.243  1.393
+ 48    / 193: -0.059  1.413
+ 48.25 / 194:  0.126  1.409
+ 48.5  / 195:  0.309  1.380
+ 48.75 / 196:  0.486  1.328
+ 49    / 197:  0.655  1.253
+ 49.25 / 198:  0.813  1.157
+ 49.5  / 199:  0.957  1.041
+ 49.75 / 200:  1.085  0.907
+ 50    / 201:  1.194  0.757
+ 50.25 / 202:  1.283  0.595
+ 50.5  / 203:  1.350  0.423
+ 50.75 / 204:  1.393  0.243
+ 51    / 205:  1.413  0.059
+ 51.25 / 206:  1.409 -0.126
+ 51.5  / 207:  1.380 -0.309
+ 51.75 / 208:  1.328 -0.486
+ 52    / 209:  1.253 -0.655
+ 52.25 / 210:  1.157 -0.813
+ 52.5  / 211:  1.041 -0.957
+ 52.75 / 212:  0.907 -1.085
+ 53    / 213:  0.757 -1.194
+ 53.25 / 214:  0.595 -1.283
+ 53.5  / 215:  0.423 -1.350
+ 53.75 / 216:  0.243 -1.393
+ 54    / 217:  0.059 -1.413
+ 54.25 / 218: -0.126 -1.409
+ 54.5  / 219: -0.309 -1.380
+ 54.75 / 220: -0.486 -1.328
+ 55    / 221: -0.655 -1.253
+ 55.25 / 222: -0.813 -1.157
+ 55.5  / 223: -0.957 -1.041
+ 55.75 / 224: -1.085 -0.907
+ 56    / 225: -1.194 -0.757
+ 56.25 / 226: -1.283 -0.595
+ 56.5  / 227: -1.350 -0.423
+ 56.75 / 228: -1.393 -0.243
+ 57    / 229: -1.413 -0.059
+ 57.25 / 230: -1.409  0.126
+ 57.5  / 231: -1.380  0.309
+ 57.75 / 232: -1.328  0.486
+ 58    / 233: -1.253  0.655
+ 58.25 / 234: -1.157  0.813
+ 58.5  / 235: -1.041  0.957
+ 58.75 / 236: -0.907  1.085
+ 59    / 237: -0.757  1.194
+ 59.25 / 238: -0.595  1.283
+ 59.5  / 239: -0.423  1.350
+ 59.75 / 240: -0.243  1.393
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1: -0.0294  0.7065    ....
+ 2   / 2:  0.7065  0.0294    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1: -0.059  1.413   ....
+ 0.25  /   2:  0.126  1.409   ....
+ 0.5   /   3:  0.309  1.380   ....
+ 0.75  /   4:  0.486  1.328   ....
+ 1     /   5:  0.655  1.253   ....
+ 1.25  /   6:  0.813  1.157   ....
+ 1.5   /   7:  0.957  1.041   ....
+ 1.75  /   8:  1.085  0.907   ....
+ 2     /   9:  1.194  0.757   ....
+ 2.25  /  10:  1.283  0.595   ....
+ 2.5   /  11:  1.350  0.423   ....
+ 2.75  /  12:  1.393  0.243   ....
+ 3     /  13:  1.413  0.059   ....
+ 3.25  /  14:  1.409 -0.126   ....
+ 3.5   /  15:  1.380 -0.309   ....
+ 3.75  /  16:  1.328 -0.486   ....
+ 4     /  17:  1.253 -0.655   ....
+ 4.25  /  18:  1.157 -0.813   ....
+ 4.5   /  19:  1.041 -0.957   ....
+ 4.75  /  20:  0.907 -1.085   ....
+ 5     /  21:  0.757 -1.194   ....
+ 5.25  /  22:  0.595 -1.283   ....
+ 5.5   /  23:  0.423 -1.350   ....
+ 5.75  /  24:  0.243 -1.393   ....
+ 6     /  25:  0.059 -1.413   ....
+ 6.25  /  26: -0.126 -1.409   ....
+ 6.5   /  27: -0.309 -1.380   ....
+ 6.75  /  28: -0.486 -1.328   ....
+ 7     /  29: -0.655 -1.253   ....
+ 7.25  /  30: -0.813 -1.157   ....
+ 7.5   /  31: -0.957 -1.041   ....
+ 7.75  /  32: -1.085 -0.907   ....
+ 8     /  33: -1.194 -0.757   ....
+ 8.25  /  34: -1.283 -0.595   ....
+ 8.5   /  35: -1.350 -0.423   ....
+ 8.75  /  36: -1.393 -0.243   ....
+ 9     /  37: -1.413 -0.059   ....
+ 9.25  /  38: -1.409  0.126   ....
+ 9.5   /  39: -1.380  0.309   ....
+ 9.75  /  40: -1.328  0.486   ....
+ 10    /  41: -1.253  0.655   ....
+ 10.25 /  42: -1.157  0.813   ....
+ 10.5  /  43: -1.041  0.957   ....
+ 10.75 /  44: -0.907  1.085   ....
+ 11    /  45: -0.757  1.194   ....
+ 11.25 /  46: -0.595  1.283   ....
+ 11.5  /  47: -0.423  1.350   ....
+ 11.75 /  48: -0.243  1.393   ....
+ 12    /  49: -0.059  1.413   ....
+ 12.25 /  50:  0.126  1.409   ....
+ 12.5  /  51:  0.309  1.380   ....
+ 12.75 /  52:  0.486  1.328   ....
+ 13    /  53:  0.655  1.253   ....
+ 13.25 /  54:  0.813  1.157   ....
+ 13.5  /  55:  0.957  1.041   ....
+ 13.75 /  56:  1.085  0.907   ....
+ 14    /  57:  1.194  0.757   ....
+ 14.25 /  58:  1.283  0.595   ....
+ 14.5  /  59:  1.350  0.423   ....
+ 14.75 /  60:  1.393  0.243   ....
+ 15    /  61:  1.413  0.059   ....
+ 15.25 /  62:  1.409 -0.126   ....
+ 15.5  /  63:  1.380 -0.309   ....
+ 15.75 /  64:  1.328 -0.486   ....
+ 16    /  65:  1.253 -0.655   ....
+ 16.25 /  66:  1.157 -0.813   ....
+ 16.5  /  67:  1.041 -0.957   ....
+ 16.75 /  68:  0.907 -1.085   ....
+ 17    /  69:  0.757 -1.194   ....
+ 17.25 /  70:  0.595 -1.283   ....
+ 17.5  /  71:  0.423 -1.350   ....
+ 17.75 /  72:  0.243 -1.393   ....
+ 18    /  73:  0.059 -1.413   ....
+ 18.25 /  74: -0.126 -1.409   ....
+ 18.5  /  75: -0.309 -1.380   ....
+ 18.75 /  76: -0.486 -1.328   ....
+ 19    /  77: -0.655 -1.253   ....
+ 19.25 /  78: -0.813 -1.157   ....
+ 19.5  /  79: -0.957 -1.041   ....
+ 19.75 /  80: -1.085 -0.907   ....
+ 20    /  81: -1.194 -0.757   ....
+ 20.25 /  82: -1.283 -0.595   ....
+ 20.5  /  83: -1.350 -0.423   ....
+ 20.75 /  84: -1.393 -0.243   ....
+ 21    /  85: -1.413 -0.059   ....
+ 21.25 /  86: -1.409  0.126   ....
+ 21.5  /  87: -1.380  0.309   ....
+ 21.75 /  88: -1.328  0.486   ....
+ 22    /  89: -1.253  0.655   ....
+ 22.25 /  90: -1.157  0.813   ....
+ 22.5  /  91: -1.041  0.957   ....
+ 22.75 /  92: -0.907  1.085   ....
+ 23    /  93: -0.757  1.194   ....
+ 23.25 /  94: -0.595  1.283   ....
+ 23.5  /  95: -0.423  1.350   ....
+ 23.75 /  96: -0.243  1.393   ....
+ 24    /  97: -0.059  1.413   ....
+ 24.25 /  98:  0.126  1.409   ....
+ 24.5  /  99:  0.309  1.380   ....
+ 24.75 / 100:  0.486  1.328   ....
+ 25    / 101:  0.655  1.253   ....
+ 25.25 / 102:  0.813  1.157   ....
+ 25.5  / 103:  0.957  1.041   ....
+ 25.75 / 104:  1.085  0.907   ....
+ 26    / 105:  1.194  0.757   ....
+ 26.25 / 106:  1.283  0.595   ....
+ 26.5  / 107:  1.350  0.423   ....
+ 26.75 / 108:  1.393  0.243   ....
+ 27    / 109:  1.413  0.059   ....
+ 27.25 / 110:  1.409 -0.126   ....
+ 27.5  / 111:  1.380 -0.309   ....
+ 27.75 / 112:  1.328 -0.486   ....
+ 28    / 113:  1.253 -0.655   ....
+ 28.25 / 114:  1.157 -0.813   ....
+ 28.5  / 115:  1.041 -0.957   ....
+ 28.75 / 116:  0.907 -1.085   ....
+ 29    / 117:  0.757 -1.194   ....
+ 29.25 / 118:  0.595 -1.283   ....
+ 29.5  / 119:  0.423 -1.350   ....
+ 29.75 / 120:  0.243 -1.393   ....
+ 30    / 121:  0.059 -1.413   ....
+ 30.25 / 122: -0.126 -1.409   ....
+ 30.5  / 123: -0.309 -1.380   ....
+ 30.75 / 124: -0.486 -1.328   ....
+ 31    / 125: -0.655 -1.253   ....
+ 31.25 / 126: -0.813 -1.157   ....
+ 31.5  / 127: -0.957 -1.041   ....
+ 31.75 / 128: -1.085 -0.907   ....
+ 32    / 129: -1.194 -0.757   ....
+ 32.25 / 130: -1.283 -0.595   ....
+ 32.5  / 131: -1.350 -0.423   ....
+ 32.75 / 132: -1.393 -0.243   ....
+ 33    / 133: -1.413 -0.059   ....
+ 33.25 / 134: -1.409  0.126   ....
+ 33.5  / 135: -1.380  0.309   ....
+ 33.75 / 136: -1.328  0.486   ....
+ 34    / 137: -1.253  0.655   ....
+ 34.25 / 138: -1.157  0.813   ....
+ 34.5  / 139: -1.041  0.957   ....
+ 34.75 / 140: -0.907  1.085   ....
+ 35    / 141: -0.757  1.194   ....
+ 35.25 / 142: -0.595  1.283   ....
+ 35.5  / 143: -0.423  1.350   ....
+ 35.75 / 144: -0.243  1.393   ....
+ 36    / 145: -0.059  1.413   ....
+ 36.25 / 146:  0.126  1.409   ....
+ 36.5  / 147:  0.309  1.380   ....
+ 36.75 / 148:  0.486  1.328   ....
+ 37    / 149:  0.655  1.253   ....
+ 37.25 / 150:  0.813  1.157   ....
+ 37.5  / 151:  0.957  1.041   ....
+ 37.75 / 152:  1.085  0.907   ....
+ 38    / 153:  1.194  0.757   ....
+ 38.25 / 154:  1.283  0.595   ....
+ 38.5  / 155:  1.350  0.423   ....
+ 38.75 / 156:  1.393  0.243   ....
+ 39    / 157:  1.413  0.059   ....
+ 39.25 / 158:  1.409 -0.126   ....
+ 39.5  / 159:  1.380 -0.309   ....
+ 39.75 / 160:  1.328 -0.486   ....
+ 40    / 161:  1.253 -0.655   ....
+ 40.25 / 162:  1.157 -0.813   ....
+ 40.5  / 163:  1.041 -0.957   ....
+ 40.75 / 164:  0.907 -1.085   ....
+ 41    / 165:  0.757 -1.194   ....
+ 41.25 / 166:  0.595 -1.283   ....
+ 41.5  / 167:  0.423 -1.350   ....
+ 41.75 / 168:  0.243 -1.393   ....
+ 42    / 169:  0.059 -1.413   ....
+ 42.25 / 170: -0.126 -1.409   ....
+ 42.5  / 171: -0.309 -1.380   ....
+ 42.75 / 172: -0.486 -1.328   ....
+ 43    / 173: -0.655 -1.253   ....
+ 43.25 / 174: -0.813 -1.157   ....
+ 43.5  / 175: -0.957 -1.041   ....
+ 43.75 / 176: -1.085 -0.907   ....
+ 44    / 177: -1.194 -0.757   ....
+ 44.25 / 178: -1.283 -0.595   ....
+ 44.5  / 179: -1.350 -0.423   ....
+ 44.75 / 180: -1.393 -0.243   ....
+ 45    / 181: -1.413 -0.059   ....
+ 45.25 / 182: -1.409  0.126   ....
+ 45.5  / 183: -1.380  0.309   ....
+ 45.75 / 184: -1.328  0.486   ....
+ 46    / 185: -1.253  0.655   ....
+ 46.25 / 186: -1.157  0.813   ....
+ 46.5  / 187: -1.041  0.957   ....
+ 46.75 / 188: -0.907  1.085   ....
+ 47    / 189: -0.757  1.194   ....
+ 47.25 / 190: -0.595  1.283   ....
+ 47.5  / 191: -0.423  1.350   ....
+ 47.75 / 192: -0.243  1.393   ....
+ 48    / 193: -0.059  1.413   ....
+ 48.25 / 194:  0.126  1.409   ....
+ 48.5  / 195:  0.309  1.380   ....
+ 48.75 / 196:  0.486  1.328   ....
+ 49    / 197:  0.655  1.253   ....
+ 49.25 / 198:  0.813  1.157   ....
+ 49.5  / 199:  0.957  1.041   ....
+ 49.75 / 200:  1.085  0.907   ....
+ 50    / 201:  1.194  0.757   ....
+ 50.25 / 202:  1.283  0.595   ....
+ 50.5  / 203:  1.350  0.423   ....
+ 50.75 / 204:  1.393  0.243   ....
+ 51    / 205:  1.413  0.059   ....
+ 51.25 / 206:  1.409 -0.126   ....
+ 51.5  / 207:  1.380 -0.309   ....
+ 51.75 / 208:  1.328 -0.486   ....
+ 52    / 209:  1.253 -0.655   ....
+ 52.25 / 210:  1.157 -0.813   ....
+ 52.5  / 211:  1.041 -0.957   ....
+ 52.75 / 212:  0.907 -1.085   ....
+ 53    / 213:  0.757 -1.194   ....
+ 53.25 / 214:  0.595 -1.283   ....
+ 53.5  / 215:  0.423 -1.350   ....
+ 53.75 / 216:  0.243 -1.393   ....
+ 54    / 217:  0.059 -1.413   ....
+ 54.25 / 218: -0.126 -1.409   ....
+ 54.5  / 219: -0.309 -1.380   ....
+ 54.75 / 220: -0.486 -1.328   ....
+ 55    / 221: -0.655 -1.253   ....
+ 55.25 / 222: -0.813 -1.157   ....
+ 55.5  / 223: -0.957 -1.041   ....
+ 55.75 / 224: -1.085 -0.907   ....
+ 56    / 225: -1.194 -0.757   ....
+ 56.25 / 226: -1.283 -0.595   ....
+ 56.5  / 227: -1.350 -0.423   ....
+ 56.75 / 228: -1.393 -0.243   ....
+ 57    / 229: -1.413 -0.059   ....
+ 57.25 / 230: -1.409  0.126   ....
+ 57.5  / 231: -1.380  0.309   ....
+ 57.75 / 232: -1.328  0.486   ....
+ 58    / 233: -1.253  0.655   ....
+ 58.25 / 234: -1.157  0.813   ....
+ 58.5  / 235: -1.041  0.957   ....
+ 58.75 / 236: -0.907  1.085   ....
+ 59    / 237: -0.757  1.194   ....
+ 59.25 / 238: -0.595  1.283   ....
+ 59.5  / 239: -0.423  1.350   ....
+ 59.75 / 240: -0.243  1.393   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple2
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1: -0.3516  0.0367
+ 2   / 2:  0.0367  0.3516
+ ---- L:2 T:   2
+ 1   / 1:  0.0367  0.3516
+ 2   / 2:  0.3516 -0.0367
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1: -1.407  0.147
+ 0.1   /   2: -1.384  0.293
+ 0.2   /   3: -1.345  0.436
+ 0.3   /   4: -1.292  0.574
+ 0.4   /   5: -1.225  0.706
+ 0.5   /   6: -1.145  0.831
+ 0.6   /   7: -1.052  0.946
+ 0.7   /   8: -0.947  1.050
+ 0.8   /   9: -0.832  1.144
+ 0.9   /  10: -0.708  1.224
+ 1     /  11: -0.576  1.292
+ 1.1   /  12: -0.438  1.345
+ 1.2   /  13: -0.295  1.383
+ 1.3   /  14: -0.149  1.406
+ 1.4   /  15: -0.001  1.414
+ 1.5   /  16:  0.147  1.407
+ 1.6   /  17:  0.293  1.384
+ 1.7   /  18:  0.436  1.345
+ 1.8   /  19:  0.574  1.292
+ 1.9   /  20:  0.706  1.225
+ 2     /  21:  0.831  1.145
+ 2.1   /  22:  0.946  1.052
+ 2.2   /  23:  1.050  0.947
+ 2.3   /  24:  1.144  0.832
+ 2.4   /  25:  1.224  0.708
+ 2.5   /  26:  1.292  0.576
+ 2.6   /  27:  1.345  0.438
+ 2.7   /  28:  1.383  0.295
+ 2.8   /  29:  1.406  0.149
+ 2.9   /  30:  1.414  0.001
+ 3     /  31:  1.407 -0.147
+ 3.1   /  32:  1.384 -0.293
+ 3.2   /  33:  1.345 -0.436
+ 3.3   /  34:  1.292 -0.574
+ 3.4   /  35:  1.225 -0.706
+ 3.5   /  36:  1.145 -0.831
+ 3.6   /  37:  1.052 -0.946
+ 3.7   /  38:  0.947 -1.050
+ 3.8   /  39:  0.832 -1.144
+ 3.9   /  40:  0.708 -1.224
+ 4     /  41:  0.576 -1.292
+ 4.1   /  42:  0.438 -1.345
+ 4.2   /  43:  0.295 -1.383
+ 4.3   /  44:  0.149 -1.406
+ 4.4   /  45:  0.001 -1.414
+ 4.5   /  46: -0.147 -1.407
+ 4.6   /  47: -0.293 -1.384
+ 4.7   /  48: -0.436 -1.345
+ 4.8   /  49: -0.574 -1.292
+ 4.9   /  50: -0.706 -1.225
+ 5     /  51: -0.831 -1.145
+ 5.1   /  52: -0.946 -1.052
+ 5.2   /  53: -1.050 -0.947
+ 5.3   /  54: -1.144 -0.832
+ 5.4   /  55: -1.224 -0.708
+ 5.5   /  56: -1.292 -0.576
+ 5.6   /  57: -1.345 -0.438
+ 5.7   /  58: -1.383 -0.295
+ 5.8   /  59: -1.406 -0.149
+ 5.9   /  60: -1.414 -0.001
+ 6     /  61: -1.407  0.147
+ 6.1   /  62: -1.384  0.293
+ 6.2   /  63: -1.345  0.436
+ 6.3   /  64: -1.292  0.574
+ 6.4   /  65: -1.225  0.706
+ 6.5   /  66: -1.145  0.831
+ 6.6   /  67: -1.052  0.946
+ 6.7   /  68: -0.947  1.050
+ 6.8   /  69: -0.832  1.144
+ 6.9   /  70: -0.708  1.224
+ 7     /  71: -0.576  1.292
+ 7.1   /  72: -0.438  1.345
+ 7.2   /  73: -0.295  1.383
+ 7.3   /  74: -0.149  1.406
+ 7.4   /  75: -0.001  1.414
+ 7.5   /  76:  0.147  1.407
+ 7.6   /  77:  0.293  1.384
+ 7.7   /  78:  0.436  1.345
+ 7.8   /  79:  0.574  1.292
+ 7.9   /  80:  0.706  1.225
+ 8     /  81:  0.831  1.145
+ 8.1   /  82:  0.946  1.052
+ 8.2   /  83:  1.050  0.947
+ 8.3   /  84:  1.144  0.832
+ 8.4   /  85:  1.224  0.708
+ 8.5   /  86:  1.292  0.576
+ 8.6   /  87:  1.345  0.438
+ 8.7   /  88:  1.383  0.295
+ 8.8   /  89:  1.406  0.149
+ 8.9   /  90:  1.414  0.001
+ 9     /  91:  1.407 -0.147
+ 9.1   /  92:  1.384 -0.293
+ 9.2   /  93:  1.345 -0.436
+ 9.3   /  94:  1.292 -0.574
+ 9.4   /  95:  1.225 -0.706
+ 9.5   /  96:  1.145 -0.831
+ 9.6   /  97:  1.052 -0.946
+ 9.7   /  98:  0.947 -1.050
+ 9.8   /  99:  0.832 -1.144
+ 9.9   / 100:  0.708 -1.224
+ 10    / 101:  0.576 -1.292
+ 10.1  / 102:  0.438 -1.345
+ 10.2  / 103:  0.295 -1.383
+ 10.3  / 104:  0.149 -1.406
+ 10.4  / 105:  0.001 -1.414
+ 10.5  / 106: -0.147 -1.407
+ 10.6  / 107: -0.293 -1.384
+ 10.7  / 108: -0.436 -1.345
+ 10.8  / 109: -0.574 -1.292
+ 10.9  / 110: -0.706 -1.225
+ 11    / 111: -0.831 -1.145
+ 11.1  / 112: -0.946 -1.052
+ 11.2  / 113: -1.050 -0.947
+ 11.3  / 114: -1.144 -0.832
+ 11.4  / 115: -1.224 -0.708
+ 11.5  / 116: -1.292 -0.576
+ 11.6  / 117: -1.345 -0.438
+ 11.7  / 118: -1.383 -0.295
+ 11.8  / 119: -1.406 -0.149
+ 11.9  / 120: -1.414 -0.001
+ 12    / 121: -1.407  0.147
+ 12.1  / 122: -1.384  0.293
+ 12.2  / 123: -1.345  0.436
+ 12.3  / 124: -1.292  0.574
+ 12.4  / 125: -1.225  0.706
+ 12.5  / 126: -1.145  0.831
+ 12.6  / 127: -1.052  0.946
+ 12.7  / 128: -0.947  1.050
+ 12.8  / 129: -0.832  1.144
+ 12.9  / 130: -0.708  1.224
+ 13    / 131: -0.576  1.292
+ 13.1  / 132: -0.438  1.345
+ 13.2  / 133: -0.295  1.383
+ 13.3  / 134: -0.149  1.406
+ 13.4  / 135: -0.001  1.414
+ 13.5  / 136:  0.147  1.407
+ 13.6  / 137:  0.293  1.384
+ 13.7  / 138:  0.436  1.345
+ 13.8  / 139:  0.574  1.292
+ 13.9  / 140:  0.706  1.225
+ 14    / 141:  0.831  1.145
+ 14.1  / 142:  0.946  1.052
+ 14.2  / 143:  1.050  0.947
+ 14.3  / 144:  1.144  0.832
+ 14.4  / 145:  1.224  0.708
+ 14.5  / 146:  1.292  0.576
+ 14.6  / 147:  1.345  0.438
+ 14.7  / 148:  1.383  0.295
+ 14.8  / 149:  1.406  0.149
+ 14.9  / 150:  1.414  0.001
+ 15    / 151:  1.407 -0.147
+ 15.1  / 152:  1.384 -0.293
+ 15.2  / 153:  1.345 -0.436
+ 15.3  / 154:  1.292 -0.574
+ 15.4  / 155:  1.225 -0.706
+ 15.5  / 156:  1.145 -0.831
+ 15.6  / 157:  1.052 -0.946
+ 15.7  / 158:  0.947 -1.050
+ 15.8  / 159:  0.832 -1.144
+ 15.9  / 160:  0.708 -1.224
+ 16    / 161:  0.576 -1.292
+ 16.1  / 162:  0.438 -1.345
+ 16.2  / 163:  0.295 -1.383
+ 16.3  / 164:  0.149 -1.406
+ 16.4  / 165:  0.001 -1.414
+ 16.5  / 166: -0.147 -1.407
+ 16.6  / 167: -0.293 -1.384
+ 16.7  / 168: -0.436 -1.345
+ 16.8  / 169: -0.574 -1.292
+ 16.9  / 170: -0.706 -1.225
+ 17    / 171: -0.831 -1.145
+ 17.1  / 172: -0.946 -1.052
+ 17.2  / 173: -1.050 -0.947
+ 17.3  / 174: -1.144 -0.832
+ 17.4  / 175: -1.224 -0.708
+ 17.5  / 176: -1.292 -0.576
+ 17.6  / 177: -1.345 -0.438
+ 17.7  / 178: -1.383 -0.295
+ 17.8  / 179: -1.406 -0.149
+ 17.9  / 180: -1.414 -0.001
+ 18    / 181: -1.407  0.147
+ 18.1  / 182: -1.384  0.293
+ 18.2  / 183: -1.345  0.436
+ 18.3  / 184: -1.292  0.574
+ 18.4  / 185: -1.225  0.706
+ 18.5  / 186: -1.145  0.831
+ 18.6  / 187: -1.052  0.946
+ 18.7  / 188: -0.947  1.050
+ 18.8  / 189: -0.832  1.144
+ 18.9  / 190: -0.708  1.224
+ 19    / 191: -0.576  1.292
+ 19.1  / 192: -0.438  1.345
+ 19.2  / 193: -0.295  1.383
+ 19.3  / 194: -0.149  1.406
+ 19.4  / 195: -0.001  1.414
+ 19.5  / 196:  0.147  1.407
+ 19.6  / 197:  0.293  1.384
+ 19.7  / 198:  0.436  1.345
+ 19.8  / 199:  0.574  1.292
+ 19.9  / 200:  0.706  1.225
+ 20    / 201:  0.831  1.145
+ 20.1  / 202:  0.946  1.052
+ 20.2  / 203:  1.050  0.947
+ 20.3  / 204:  1.144  0.832
+ 20.4  / 205:  1.224  0.708
+ 20.5  / 206:  1.292  0.576
+ 20.6  / 207:  1.345  0.438
+ 20.7  / 208:  1.383  0.295
+ 20.8  / 209:  1.406  0.149
+ 20.9  / 210:  1.414  0.001
+ 21    / 211:  1.407 -0.147
+ 21.1  / 212:  1.384 -0.293
+ 21.2  / 213:  1.345 -0.436
+ 21.3  / 214:  1.292 -0.574
+ 21.4  / 215:  1.225 -0.706
+ 21.5  / 216:  1.145 -0.831
+ 21.6  / 217:  1.052 -0.946
+ 21.7  / 218:  0.947 -1.050
+ 21.8  / 219:  0.832 -1.144
+ 21.9  / 220:  0.708 -1.224
+ 22    / 221:  0.576 -1.292
+ 22.1  / 222:  0.438 -1.345
+ 22.2  / 223:  0.295 -1.383
+ 22.3  / 224:  0.149 -1.406
+ 22.4  / 225:  0.001 -1.414
+ 22.5  / 226: -0.147 -1.407
+ 22.6  / 227: -0.293 -1.384
+ 22.7  / 228: -0.436 -1.345
+ 22.8  / 229: -0.574 -1.292
+ 22.9  / 230: -0.706 -1.225
+ 23    / 231: -0.831 -1.145
+ 23.1  / 232: -0.946 -1.052
+ 23.2  / 233: -1.050 -0.947
+ 23.3  / 234: -1.144 -0.832
+ 23.4  / 235: -1.224 -0.708
+ 23.5  / 236: -1.292 -0.576
+ 23.6  / 237: -1.345 -0.438
+ 23.7  / 238: -1.383 -0.295
+ 23.8  / 239: -1.406 -0.149
+ 23.9  / 240: -1.414 -0.001
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+ 
+! 6D tests for Ferret v6.8
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate_6d
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_6d
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              4        6        8     
+              2        3        4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- M:3 E:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- M:4 E:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- M:3 E:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- M:4 E:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- M:3 E:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- M:4 E:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              5        7        9     
+              3        4        5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- M:4 E:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- M:5 E:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- M:4 E:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- M:5 E:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- M:4 E:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- M:5 E:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax_6d
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid G48
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.167N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+                6.17N  
+                50
+ 160.5W / 1:  3.70015
+ 159.5W / 2:  3.70015
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.833N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.00000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.00000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions_6d
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.0000
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+           3.0000   6.0000   9.0000  12.0000  15.0000
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          4.00000  5.00000  6.00000  7.00000  8.00000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000  0.00000  1.00000  2.00000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            1.000    8.000   27.000   64.000  125.000
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  0.00000  0.00000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.000000  0.000000  0.000000  0.000000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+             1         2         3         4         5      
+              1         2         3         4         5
+ ---- N:1 F:   1
+ N:1 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:2 F:   2
+ N:2 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:3 F:   3
+ N:3 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:4 F:   4
+ N:4 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:5 F:   5
+ N:5 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+             ....     ....     ....  4.00000  5.00000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  4.00000  5.00000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33300  0.33300  0.33300  4.00000 -9.00000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          3.00000  3.00000  3.00000  4.00000  5.00000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  3.00000  3.00000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          2.00000  1.00000  0.00000  1.00000  2.00000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            2.718    7.389   20.086   54.598  148.413
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.69315  1.09861  1.38629  1.60944
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.301030  0.477121  0.602060  0.698970
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.841471  0.909297  0.141120 -0.756802 -0.958924
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.47493
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.540302 -0.416147 -0.989992 -0.653644  0.283662
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.55741 -2.18504 -0.14255  1.15782 -3.38052
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333 -1.47493
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  0.00000  0.00000  0.00000  0.00000
+ 2   / 2:  1.57080  0.78540  0.46365  0.32175  0.24498
+ 3   / 3:  1.57080  1.10715  0.78540  0.58800  0.46365
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  0.00000  1.00000  2.00000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000     ....  1.00000  2.00000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000 -9.00000  1.00000  2.00000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.337575  0.723822  0.030403  0.849932  0.169352
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -0.26718  0.28276 -0.32292  1.21676 -0.30437
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+          EBOXLO   EBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+          FBOXLO   FBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_direction_fcns_6d
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+               C   M_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1   M_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+               C   N_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1   N_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+          TEMP    EX#2
+M / 1:  30.7500  34.7500
+M / 2:  31.7500  33.7500
+M / 3:  32.7500  32.7500
+M / 4:  33.7500  31.7500
+M / 5:  34.7500  30.7500
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+          TEMP    EX#2
+N / 1:  30.7500  31.3500
+N / 2:  30.9500  31.1500
+N / 3:  31.1500  30.9500
+N / 4:  31.3500  30.7500
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+                 A      A        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+                 B      B        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000  1.00000  0.00000  0.00000     ....     ....
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms_6d
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:120 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:114 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 00:00 (interpolated)
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE EX#1     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.3553  32.3552  32.5032  32.8652  33.3285
+ 1.17N / 45:  32.1766  32.1710  32.2834  32.5970  33.0244
+ 0.83N / 44:  32.0256  32.0016  32.0631  32.3109  32.6873
+ 0.5N  / 43:  31.9306  31.8902  31.8887  32.0374  32.3408
+ 0.17N / 42:  31.8944  31.8343  31.7825  31.8263  32.0336
+ 0.17S / 41:  31.9538  31.8657  31.7716  31.7285  31.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.3553  38.3552  38.5032  38.8652  39.3285
+ 1.17N / 45:  38.1766  38.1710  38.2834  38.5970  39.0244
+ 0.83N / 44:  38.0256  38.0016  38.0631  38.3109  38.6873
+ 0.5N  / 43:  37.9306  37.8902  37.8887  38.0374  38.3408
+ 0.17N / 42:  37.8944  37.8343  37.7825  37.8263  38.0336
+ 0.17S / 41:  37.9538  37.8657  37.7716  37.7285  37.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.7553  37.7552  37.9032  38.2652  38.7285
+ 1.17N / 45:  37.5766  37.5710  37.6834  37.9970  38.4244
+ 0.83N / 44:  37.4256  37.4016  37.4631  37.7109  38.0873
+ 0.5N  / 43:  37.3306  37.2902  37.2887  37.4374  37.7408
+ 0.17N / 42:  37.2944  37.2343  37.1825  37.2263  37.4336
+ 0.17S / 41:  37.3538  37.2657  37.1716  37.1285  37.2282
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.7553  43.7552  43.9032  44.2652  44.7285
+ 1.17N / 45:  43.5766  43.5710  43.6834  43.9970  44.4244
+ 0.83N / 44:  43.4256  43.4016  43.4631  43.7109  44.0873
+ 0.5N  / 43:  43.3306  43.2902  43.2887  43.4374  43.7408
+ 0.17N / 42:  43.2944  43.2343  43.1825  43.2263  43.4336
+ 0.17S / 41:  43.3538  43.2657  43.1716  43.1285  43.2282
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.3553  34.3552  34.5032  34.8652  35.3285
+ 1.17N / 45:  34.1766  34.1710  34.2834  34.5970  35.0244
+ 0.83N / 44:  34.0256  34.0016  34.0631  34.3109  34.6873
+ 0.5N  / 43:  33.9306  33.8902  33.8887  34.0374  34.3408
+ 0.17N / 42:  33.8944  33.8343  33.7825  33.8263  34.0336
+ 0.17S / 41:  33.9538  33.8657  33.7716  33.7285  33.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.3553  40.3552  40.5032  40.8652  41.3285
+ 1.17N / 45:  40.1766  40.1710  40.2834  40.5970  41.0244
+ 0.83N / 44:  40.0256  40.0016  40.0631  40.3109  40.6873
+ 0.5N  / 43:  39.9306  39.8902  39.8887  40.0374  40.3408
+ 0.17N / 42:  39.8944  39.8343  39.7825  39.8263  40.0336
+ 0.17S / 41:  39.9538  39.8657  39.7716  39.7285  39.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.0220  36.0219  36.1698  36.5318  36.9952
+ 1.17N / 45:  35.8433  35.8377  35.9501  36.2637  36.6910
+ 0.83N / 44:  35.6923  35.6682  35.7298  35.9776  36.3539
+ 0.5N  / 43:  35.5973  35.5568  35.5554  35.7040  36.0075
+ 0.17N / 42:  35.5610  35.5010  35.4491  35.4929  35.7003
+ 0.17S / 41:  35.6205  35.5323  35.4383  35.3952  35.4948
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.0220  42.0219  42.1698  42.5318  42.9952
+ 1.17N / 45:  41.8433  41.8377  41.9501  42.2637  42.6910
+ 0.83N / 44:  41.6923  41.6682  41.7298  41.9776  42.3539
+ 0.5N  / 43:  41.5973  41.5568  41.5554  41.7040  42.0075
+ 0.17N / 42:  41.5610  41.5010  41.4491  41.4929  41.7003
+ 0.17S / 41:  41.6205  41.5323  41.4383  41.3952  41.4948
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M: -999 -999  N:    1    2
+ reading TEMP     M:104 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 865  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M: -999 -999  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M: 90 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 866  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 88 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M: -999 -999  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 88 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 867  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 94 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M: -999 -999  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 94 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 868  complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 78 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 80 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 869  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:106 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 870  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 871  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 872  complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 66 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G098)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  29593.5
+ 23-JAN-1982 00 /  3:     ....  29593.5
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G098)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  8878.05
+ 23-JAN-1982 00 /  3:     ....  8878.05
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G098)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G091)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G091)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:    213056.    355093.
+ 23-JAN-1982 00 /  3:  20028585.  33381003.
+ 27-JAN-1982 00 /  4:    213084.    355141.
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G091)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                            1.1          2.1     
+                            1            2
+ 15-JAN-1982 00 /  1:         ....         ....
+ 19-JAN-1982 00 /  2:         ....         ....
+ 23-JAN-1982 00 /  3:         ....  5.16988E-27
+ 27-JAN-1982 00 /  4:         ....         ....
+ 31-JAN-1982 00 /  5:         ....         ....
+ 04-FEB-1982 00 /  6:         ....         ....
+ 08-FEB-1982 00 /  7:         ....         ....
+ 12-FEB-1982 00 /  8:         ....         ....
+ 16-FEB-1982 00 /  9:         ....         ....
+ 20-FEB-1982 00 / 10:         ....         ....
+ 24-FEB-1982 00 / 11:         ....         ....
+ 28-FEB-1982 00 / 12:         ....         ....
+ 04-MAR-1982 00 / 13:         ....         ....
+ 08-MAR-1982 00 / 14:         ....         ....
+ 12-MAR-1982 00 / 15:         ....         ....
+ 16-MAR-1982 00 / 16:         ....         ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 64 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G098)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G086)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:     ....
+ 2.1 / 2:  2.50000
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G091)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G098)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G101)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G101)           @MIN
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.00000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G101)           @SUM
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G091)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.05000
+ 2.1 / 2:  4.20000
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ -DELETE _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G101)
+    GRID (G101)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G105)           @MAX
+ eval    AFCST    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ regrid  AFCST    M: 46 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G105)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G105)
+    GRID (G105)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_aggregate_e
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M: 64 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M: 62 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M: 56 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M: 54 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   28.513   28.441   27.892   27.457   26.726   25.561     ....     ....     ....
+ 2   / 2:   85.539   85.323   83.676   82.370   80.177   76.683     ....     ....     ....
+ 3   / 3:   57.026   56.882   55.784   54.913   53.452   51.122     ....     ....     ....
+ 4   / 4:  114.051  113.765  111.568  109.826  106.903  102.245     ....     ....     ....
+cancel data fourfiles
+ -DELETE SST      M: 66 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M: 74 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ getgrid AIRT     C:  6 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME12    NORMAL    NORMAL
+ getgrid AIRT     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME12    NORMAL    NORMAL
+ getgrid AIRT     C:  6 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME12    NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ getgrid EX#1     C:  7 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AIRT     C:  9 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ dealloc  dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          COADSX116_COADSY52_6NORMAL    TIME12    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M: 74 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:120 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   27.675   27.570   27.061   26.673   25.793   25.207     ....     ....     ....
+ 2   / 2:   86.539   86.323   84.676   83.370   81.177   77.683     ....     ....     ....
+ 3   / 3:   58.026   57.882   56.784   55.913   54.452   52.122     ....     ....     ....
+ 4   / 4:  115.051  114.765  112.568  110.826  107.903  103.245     ....     ....     ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+                 UWND     UWND     UWND      VWND     UWND
+59W    / -30:  2.20244  0.934329  2.20244  0.934329  1.56839
+57W    / -29:  2.26128  0.812758  2.26128  0.812758  1.53702
+55W    / -28:  1.99826  0.681776  1.99826  0.681776  1.34002
+53W    / -27:  1.93361  0.507158  1.93361  0.507158  1.22038
+51W    / -26:  1.64932  0.330430  1.64932  0.330430  0.98987
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+                 UWND     UWND      VWND     UWND     VWND
+59W    / -30:  2.20244  0.934329  0.934329  2.20244  1.56839
+57W    / -29:  2.26128  0.812758  0.812758  2.26128  1.53702
+55W    / -28:  1.99826  0.681776  0.681776  1.99826  1.34002
+53W    / -27:  1.93361  0.507158  0.507158  1.93361  1.22038
+51W    / -26:  1.64932  0.330430  0.330430  1.64932  0.98987
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_6d_lab_mode
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT1     PSZT1     TIME12    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME12    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+ reading TAUX     M:110 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.274203
+ 23-AUG-1982 14 / 2: -0.236318
+ 29-AUG-1982 16 / 3: -0.198434
+ 04-SEP-1982 18 / 4: -0.160549
+ 10-SEP-1982 20 / 5: -0.122665
+ 16-SEP-1982 22 / 6: -0.104062
+ 23-SEP-1982 00 / 7: -0.104740
+ 29-SEP-1982 02 / 8: -0.105418
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME12
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME12
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+ reading TAUX     M: 96 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.649
+ 23-AUG-1982 14 / 2:  -89.328
+ 29-AUG-1982 16 / 3:  -75.007
+ 04-SEP-1982 18 / 4:  -60.686
+ 10-SEP-1982 20 / 5:  -46.365
+ 16-SEP-1982 22 / 6:  -39.333
+ 23-SEP-1982 00 / 7:  -39.590
+ 29-SEP-1982 02 / 8:  -39.847
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+ 
+ 
+! *********** v6.82 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn682_bug_fixes
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+! *********** v6.83 Additions ***********
+!  (was released as v6.84)
+ 
+GO bn_reset
+cancel mode verify
+GO bn683_bug_fixes
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.625140
+ 02-NOV-2011 07:55:36 /  2:  0.220931
+ 02-NOV-2011 07:56:36 /  3:  0.607368
+ 02-NOV-2011 07:57:36 /  4:  0.322594
+ 02-NOV-2011 07:58:36 /  5:  0.107545
+ 02-NOV-2011 07:59:36 /  6:  0.225720
+ 02-NOV-2011 08:00:36 /  7:  0.081070
+ 02-NOV-2011 08:01:36 /  8:  0.898013
+ 02-NOV-2011 08:02:36 /  9:  0.716275
+ 02-NOV-2011 08:03:36 / 10:  0.664871
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:      ....
+ 02-NOV-2011 07:54:31 / 114872:      ....
+ 02-NOV-2011 07:54:32 / 114873:      ....
+ 02-NOV-2011 07:54:33 / 114874:      ....
+ 02-NOV-2011 07:54:34 / 114875:      ....
+ 02-NOV-2011 07:54:35 / 114876:      ....
+ 02-NOV-2011 07:54:36 / 114877:  0.625140
+ 02-NOV-2011 07:54:37 / 114878:      ....
+ 02-NOV-2011 07:54:38 / 114879:      ....
+ 02-NOV-2011 07:54:39 / 114880:      ....
+ 02-NOV-2011 07:54:40 / 114881:      ....
+ 02-NOV-2011 07:54:41 / 114882:      ....
+ 02-NOV-2011 07:54:42 / 114883:      ....
+ 02-NOV-2011 07:54:43 / 114884:      ....
+ 02-NOV-2011 07:54:44 / 114885:      ....
+ 02-NOV-2011 07:54:45 / 114886:      ....
+ 02-NOV-2011 07:54:46 / 114887:      ....
+ 02-NOV-2011 07:54:47 / 114888:      ....
+ 02-NOV-2011 07:54:48 / 114889:      ....
+ 02-NOV-2011 07:54:49 / 114890:      ....
+ 02-NOV-2011 07:54:50 / 114891:      ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6966
+ 02-JAN-1994 12 / 2:  28.6361
+ 
+set mode/last upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_outtype
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ribbon_plot
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descr_4digit
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-1900 / 1:  28.36
+ 15-FEB-1900 / 2:  28.38
+ 18-MAR-1900 / 3:  28.00
+ 17-APR-1900 / 4:  27.99
+ 17-MAY-1900 / 5:  28.41
+ 17-JUN-1900 / 6:  28.23
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_outtype
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME12)               FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME12)               FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V6.85   12-Nov-13
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_nonmonotonic
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_mod
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+ 
+! *********** v6.85 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn685_bug_fixes
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294620938, -0.0415768591395995, 0.141480238198149 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double E410(TIME) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294620938, -0.0415768591395995, 0.141480238198149 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float E410(TIME) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON1</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dsg_e_x
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nco_append
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+	double DDAT_ORIG(ZAXIS_ORIG) ;
+		DDAT_ORIG:missing_value = -1.e+34 ;
+		DDAT_ORIG:_FillValue = -1.e+34 ;
+		DDAT_ORIG:long_name = "DDAT[GZ=ZAXIS_ORIG at ASN]" ;
+
+// global attributes:
+		:history = "Tue Nov 12 15:13:58 2013: ncks -h -A -h z1.nc append_to_this.nc\n",
+			"FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nobounds
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+		XIRREG:units = "meters" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:units = "meters" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_write_integer_att
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descriptor_mc
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-0000 / 1:  28.36
+ 15-FEB-0000 / 2:  28.38
+ 17-MAR-0000 / 3:  28.00
+ 16-APR-0000 / 4:  27.99
+ 16-MAY-0000 / 5:  28.41
+ 16-JUN-0000 / 6:  28.23
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 60W (interpolated)
+             LATITUDE : 10N (interpolated)
+ 17-MAR-0000 / 1:  26.70
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.39
+ 16-JUN-0000 / 4:  27.65
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_color_only
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vtree
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST   (unknown variable)
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST   (unknown variable)
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST]   (unknown dataset)
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST]   (unknown dataset)
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET]   (unknown dataset)
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET]   (unknown dataset)
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST   (unknown variable)
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST   (unknown variable)
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS]   (unknown variable)
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS]   (unknown variable)
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]   (unknown variable)
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]   (unknown variable)
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1   (unknown variable)
+     P1 = S2 + P2
+       S2   (unknown variable)
+       P2 = S3 + P3
+         S3   (unknown variable)
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3   (unknown variable)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1   (unknown variable)
+     P1 = S2 + P2
+       S2   (unknown variable)
+       P2 = S3 + P3
+         S3   (unknown variable)
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3   (unknown variable)
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1   (unknown variable)
+     P1 = S2 + P2
+       S2   (unknown variable)
+       P2 = S3 + P3
+         S3   (unknown variable)
+         P3 = S1 + S3
+           S1   (unknown variable)
+           S3   (unknown variable)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1   (unknown variable)
+     P1 = S2 + P2
+       S2   (unknown variable)
+       P2 = S3 + P3
+         S3   (unknown variable)
+         P3 = S1 + S3
+           S1   (unknown variable)
+           S3   (unknown variable)
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F   (unknown variable)
+   NOEXIST   (unknown variable)
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F   (unknown variable)
+   NOEXIST   (unknown variable)
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+ 
+ 
+!!!!!!!!!!!!! Note we should include tests for all the scat2grid functions.
+!!!!!!!!! completed and improved the docs for scat2grid_bin and scat2grid_nbin functions
+ 
+! version 2.3 requires exit/command *sh* 3/92
+exit/command
+yes? ! bn_all_ef_shell.jnl
+yes? ! 5/05 *acm*
+yes? ! run bn_all_ef tests
+yes? 
+yes? GO bn_all_ef
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.85  
+ 	Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13
+ 	12-Nov-13 15:13     
+
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+show func pass_thru
+show func sto*
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+-----
+Appending ncdump output
+ 
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_15 = 15 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_15) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348803, 27.9324667419544,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIME_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME = UNLIMITED ; // (3 currently)
+	TIMEedges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:edges = "TIMEedges" ;
+	double TIMEedges(TIMEedges) ;
+		TIMEedges:edges = " " ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIMEedges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.85   12-Nov-13" ;
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float SST(TIME, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float SST(TIME, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT100_100 = 1 ;
+	PSYT35_56 = 22 ;
+	PSZT1_1 = 1 ;
+	TIME1 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT100_100(PSXT100_100) ;
+		PSXT100_100:units = "degrees_east" ;
+		PSXT100_100:modulo = 360. ;
+		PSXT100_100:point_spacing = "even" ;
+		PSXT100_100:axis = "X" ;
+		PSXT100_100:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_1(PSZT1_1) ;
+		PSZT1_1:units = "METERS" ;
+		PSZT1_1:positive = "down" ;
+		PSZT1_1:point_spacing = "uneven" ;
+		PSZT1_1:axis = "Z" ;
+		PSZT1_1:standard_name = "depth" ;
+		PSZT1_1:bounds = "PSZT1_1_bnds" ;
+	double PSZT1_1_bnds(PSZT1_1, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:point_spacing = "even" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float TEMP(TIME1, PSZT1_1, PSYT35_56, PSXT100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME1, PSZT1_1, PSYT48_48, PSXT91_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME1, PSZT1_1, PSYT48_48, PSXT91_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	STRING1_3 = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, STRING1_3) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "meters" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "meters" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	STRING1_3 = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, STRING1_3) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double FAREN(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT1_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees_east" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT1_10(PSZT1_10) ;
+		PSZT1_10:units = "METERS" ;
+		PSZT1_10:positive = "down" ;
+		PSZT1_10:point_spacing = "uneven" ;
+		PSZT1_10:axis = "Z" ;
+		PSZT1_10:standard_name = "depth" ;
+		PSZT1_10:bounds = "PSZT1_10_bnds" ;
+	double PSZT1_10_bnds(PSZT1_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	int FAREN(TIME1, PSZT1_10, PSYT35_56, PSXT91_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = 8765.81982421875 ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	tday = UNLIMITED ; // (31 currently)
+	lon1_5 = 5 ;
+	lat1_5 = 5 ;
+	bnds = 2 ;
+	zt = 10 ;
+	time1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double tday(tday) ;
+		tday:units = "days since 1998-12-31 00:00:00" ;
+		tday:axis = "T" ;
+		tday:calendar = "GREGORIAN" ;
+		tday:time_origin = "31-DEC-1998" ;
+		tday:standard_name = "time" ;
+	double MyUpperLowerCaseVar(tday, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double lon1_5(lon1_5) ;
+		lon1_5:point_spacing = "even" ;
+		lon1_5:axis = "X" ;
+		lon1_5:standard_name = "longitude" ;
+	double lat1_5(lat1_5) ;
+		lat1_5:point_spacing = "uneven" ;
+		lat1_5:axis = "Y" ;
+		lat1_5:standard_name = "latitude" ;
+		lat1_5:bounds = "lat1_5_bnds" ;
+	double lat1_5_bnds(lat1_5, bnds) ;
+	float zt(zt) ;
+		zt:units = "meters" ;
+		zt:positive = "down" ;
+		zt:point_spacing = "uneven" ;
+		zt:axis = "Z" ;
+		zt:standard_name = "depth" ;
+		zt:bounds = "zt_bnds" ;
+	float zt_bnds(zt, bnds) ;
+	double time1478(time1478) ;
+		time1478:calendar = "NOLEAP" ;
+		time1478:point_spacing = "even" ;
+		time1478:axis = "T" ;
+		time1478:standard_name = "time" ;
+	double newvar(time1478, zt, lat1_5, lon1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:units = "deg" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:units = "degrees" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.85   12-Nov-13" ;
+		:Conventions = "CF-1.0" ;
+}
+-----
+end of ncdump output
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_startupfile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.85  
+ 	Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13
+ 	12-Nov-13 15:14     
+
+CAN MODE VERIFY
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "656"
+PPL$YPIXEL = "492"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.85"
+FERRET_PLATFORM = "Linux 2.6.32-358.23.2.el6.x86_64 32-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.0 of May 13 2013 13:48:05 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "12-Nov-13"
+SESSION_TIME = "15:14"
+SESSION_PID = "28140"
+DELTA_CPU = "0.036993"
+CLOCK_SECS = "0.313"
+CURRENT_DATE = "12-Nov-13"
+CURRENT_TIME = "15:14:00"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "startup_tests.plt"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "8.000"
+PPL$YLEN = "6.000"
+PPL$XORG = "1.200"
+PPL$YORG = "1.400"
+PPL$WIDTH = "10.20"
+PPL$HEIGHT = "8.800"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+WIN_TITLE = "12-Nov-13:15:14"
+VP_WIDTH = "10.2"
+VP_HEIGHT = "8.8"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1"
+VP_TOP_MARGIN = "1.4"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+GO_FILE = "./bn_startupfile.jnl"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE         SET         startup_tests.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      shrink_ylab   CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_gif
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.85  
+ 	Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13
+ 	12-Nov-13 15:14     
+
+! bn450_gif.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of gif file in batch mode using
+! frame/file=bnplot.gif....will create three gif files
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= .gif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+frame/file=bnplot.gif
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+frame/file=bnplot.gif
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+frame/file=bnplot.gif
+ 
+! Prior to v5.8 could not get the window size in pixels when in gif mode
+show symbol ppl$xpixel
+PPL$XPIXEL = "1152"
+show symbol ppl$ypixel
+PPL$YPIXEL = "662"
+ 
+! V6.13
+! transparency with FRAME/TRANS
+!!
+! These gif images have the background color white or black
+! replaced by transparent color. This can be tested by putting
+! them into an HTML document with a colored background.
+! e.g. a file called test_transparent.html containing only this line:
+! <html> <body bgcolor="orange"> <img src="testfile.gif"/> </body> </html>
+ 
+can view
+use coads_climatology
+shade/nokey/lev=50 sst[L=1]
+frame/trans/file=testbackground.gif
+ 
+! moved here from bn500_bug_fixes.jnl. The frame/  command it contains
+! has trouble when running the benchmarks from remote desktop
+go bn_reset
+cancel mode verify
+go err491_long_gif_name
+! err491_long_gif_name.jnl
+! *sh* 4/99 - test 175 character gif name
+ 
+! name length extended with changes to save_frame.F and xeq_frame.F
+ 
+set wind/siz=0.03
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+sp rm -f abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+ 
+frame/file="abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif"
+ 
+spawn ls abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif
+ 
+ 
+! The fix for bug 1396
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=gif_dashbug.gif
+ 
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_ps
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.85  
+ 	Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13
+ 	12-Nov-13 15:14     
+
+! bn450_ps.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of ps files in batch mode using
+! "-batch bnplot.ps" command line option...will create on final ps file
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.ps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+ 
+set mode ignore
+frame/file=bnplot.ps    ! DELIBERATE ERROR MESSAGE
+can mode ignore
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_batch_metafile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.85  
+ 	Linux 2.6.32-358.23.2.el6.x86_64 32-bit - 11/12/13
+ 	12-Nov-13 15:14     
+
+! bn_batch_metafile.jnl
+! Run at the end of the benchmark scripts, starting ferret with the flags
+!   -batch bat.plt
+! Produces nine metafiles.
+ 
+cancel mode logo
+ 
+! test viewports and set window/clear; cancel viewport
+set view upper
+plot/i=1:150 sin(i/12)
+set view lower
+plot/color=red/i=1:150 cos(i/10)
+ 
+set window/clear
+ 
+set view left
+shade/i=1:15/j=1:15/lev=30 i*j
+set view right
+shade/i=1:15/j=1:15 cos(i)* sin(j)
+ 
+cancel viewports
+ 
+set view ur
+plot/i=1:12 1./i
+set view ll
+shade/i=1:150/j=1:150 cos(i/10) - sin(j/12)
+ 
+! polygon command and palette
+ 
+cancel viewports
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! more viewports, with pplus/reset
+ 
+set view upper; shade/i=1:10/j=1:10 i*j
+cancel viewports
+pplus/reset
+ 
+! cancel viewports when viewport wasnt set
+! and set window/clear after cancel viewports
+ 
+plot/vs/line/i=1:314 i*cos(i/20),i*sin(i/20)
+plot/vs/line/over/i=1:314 i*cos(i/30),i*sin(i/20)
+ 
+cancel viewports
+set window/clear
+ 
+! aspect ratio can be set
+ 
+set window/asp=3
+shade/i=1:15/j=1:15/lev=20 i*j
+ 
+set win/asp=1
+fill/i=1:15/j=1:15/lev=20 i*j
+ 
+pplus/reset
+ 
+ 
+! Bug 1396 fixed
+ 
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+cancel viewports
+ 
+! intentional errors and ignored commands
+! set and cancel mode metafile are ignored
+ 
+set mode metafile new.plt
+ 
+cancel mode metafile
+ 
+plot/i=1:12/title="after cancel mode metafile in batch mode" 1./i
+ 
+! set window commands are ignored, except for set window/aspect
+set window/new
+ 
+set window/location=0.1,0.1/title="another title"
+ 
+set mode/last logo
+exit/command
+Ended at Tue Nov 12 15:14:02 PST 2013
diff --git a/bench/ansley_official.rhel6-64_err b/bench/ansley_official.rhel6-64_err
new file mode 100644
index 0000000..ee75936
--- /dev/null
+++ b/bench/ansley_official.rhel6-64_err
@@ -0,0 +1,3731 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/flat_64/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 53378727 Mar 28 11:22 /home/users/ansley/build/flat_64/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/flat_64/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: ticket 2160: SET AXIS/NAME=
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/flat_64/FERRET/external_functions/ext_func
+FER_FONTS=/home/users/tmap/ferret/rhel6-x86_64-linux/ppl/fonts
+FER_GO=. /home/users/tmap/ferret/rhel6-x86_64-linux/go /home/users/tmap/ferret/rhel6-x86_64-linux/examples /home/users/tmap/ferret/rhel6-x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/rhel6-x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/rhel6-x86_64-linux/ppl
+FER_WEB_BROWSER=firefox
+PWD=/home/users/ansley/build/flat_64/FERRET/bench
+Beginning at Fri Mar 28 11:40:40 PDT 2014
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO bn_dollar hello
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO bn_dollar hello
+say ($10)0
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          Legal range is 1 to 3
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+cont/over/i=1:10/color=noexist i
+ **ERROR: unknown command qualifier: thick=4
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: multiple specifications on X axis
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: multiple specifications on X axis
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+Replacing definition of grid G12
+Replacing definition of grid G24
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TCAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+Replacing definition of axis Y1
+Replacing definition of axis Y2
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+Replacing definition of grid TGRID
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X10
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of grid G1
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis Z1
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport LL6
+Re-defining viewport UL6
+Re-defining viewport LM6
+Re-defining viewport UM6
+Re-defining viewport LR6
+Re-defining viewport UR6
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+Replacing definition of axis TAX2
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+Re-defining viewport MID2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ls: cannot access input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis Z1
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=JAN-1990
+          Axis extremes are T=DEC-1997:JAN-1998
+list/t=1-jan-1990 dummy
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=AUG-1980:JAN-1982
+          Axis extremes are T=AUG-1982:JAN-1983
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid TGRID
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: ZORRO
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized for T axis: METERS
+ *** NOTE: They will not be convertible
+ *** NOTE: Units  not recognized for Y axis: SECONDS
+ *** NOTE: They will not be convertible
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis YFINE
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XQ
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TGREG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file revision.nc
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT1).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME4).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ *** NOTE: Changing the value of attribute (PSYT1).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIR
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ LISTing to file a.nc
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME9
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX047)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid GG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis ZAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis TAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of axis Y1
+Replacing definition of grid G1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: TIME13: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file list_of_numbers.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dummy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid MYGRID
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+Replacing definition of axis YAX
+ LISTing to file a.nc
+Replacing definition of axis TAXIS
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis TNEW
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAXIS
+Replacing definition of axis TAXIS
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid EVEN
+Replacing definition of grid G1
+Replacing definition of grid G2
+Replacing definition of grid G3
+Replacing definition of grid G4
+Replacing definition of grid G13
+Replacing definition of grid G14
+Replacing definition of grid G23
+Replacing definition of grid G33
+Replacing definition of grid G234
+Replacing definition of grid G134
+Replacing definition of grid G124
+Replacing definition of grid G123
+Replacing definition of grid G1234
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+Replacing definition of grid G48
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid G5DAY
+Replacing definition of axis FAX4DAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file append_to_this.nc
+ncks: WARNING Overwriting global attribute history
+ncks: WARNING Overwriting global attribute Conventions
+ncks: WARNING Overwriting attribute point_spacing for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute axis for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute standard_name for output variable ZAXIS_ORIG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIRREG
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+ *** NOTE: Not deleted: ENSEMBLE
+ *** NOTE: Axis is in use by grid (G103)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute a.ival
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             nosuchfile.nc
+SET DAT/FORM=CDF nosuchfile.nc
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for nosuchfile(.nc ,.cdf,.des)
+SET DAT/FORM=CDF nosuchfile
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for snoopy(.nc ,.cdf,.des)
+SET DAT/FORM=CDF snoopy
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./snoopy.dat
+SET DAT/FORM=CDF snoopy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis XAXIS_TEST
+ LISTing to file b.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file nc
+ **TMAP ERR: error in line definition
+             file coords dont match variable coords on axis XAXIS_TEST
+LIST/FORMAT=CDF/clobber/keep/file=nc b,a[d=1]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: must be a 2D region
+          shade b
+shade b
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute v1.long_name
+ *** NOTE: Changing the value of attribute v1.units
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: attribute undefined or invalid attribute name: temp.noexist[d=levitus_climatology]
+          attribute noexist not found for variable TEMP
+show att temp.noexist[d=levitus_climatology]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: illegal new name.  Variable b already defined
+set var/name=b a
+ **ERROR: invalid command: illegal new name.  Variable temp exists in dataset
+set var/name=temp salt
+ **ERROR: invalid command: illegal new name.  Variable psi exists in dataset
+set var/name=psi myvar
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis definition error on axis: MONTH_IRREG. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "MONTH_IRREG_bnds" or bounds do not enclose point on axis MONTH_IRREG
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file c.nc
+ **ERROR: invalid command: illegal new name. Axis days2000 is already defined
+set axis/name=days2000 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis
+set axis/name x_in_meters
+ **ERROR: invalid command: illegal new name given for axis 45
+set axis/name=45 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis .fr
+set axis/name=.fr x_in_meters
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unknown region name: @w
+set region/@w
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+          unknown function "writev5d"
+DEFINE VARIABLE/QUIET vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+ **ERROR: variable unknown or not in data set: VFLAG
+LOAD/TEMPORARY vflag
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ *** NOTE: Cannot create new windows when batch mode set
+Ended at Fri Mar 28 11:42:11 PDT 2014
diff --git a/bench/ansley_official.rhel6-64_log b/bench/ansley_official.rhel6-64_log
new file mode 100644
index 0000000..b1f2cf4
--- /dev/null
+++ b/bench/ansley_official.rhel6-64_log
@@ -0,0 +1,80573 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/flat_64/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 53378727 Mar 28 11:22 /home/users/ansley/build/flat_64/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/flat_64/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: ticket 2160: SET AXIS/NAME=
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/flat_64/FERRET/external_functions/ext_func
+FER_FONTS=/home/users/tmap/ferret/rhel6-x86_64-linux/ppl/fonts
+FER_GO=. /home/users/tmap/ferret/rhel6-x86_64-linux/go /home/users/tmap/ferret/rhel6-x86_64-linux/examples /home/users/tmap/ferret/rhel6-x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/rhel6-x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/rhel6-x86_64-linux/ppl
+FER_WEB_BROWSER=firefox
+PWD=/home/users/ansley/build/flat_64/FERRET/bench
+Beginning at Fri Mar 28 11:40:40 PDT 2014
+! BN500_ALL.JNL
+! - run all the benchmark tests
+! - ordered (more or less) from least to most complex
+! V2.30: uses BN230_syntax instead of BN200_syntax
+!        added BN230_cdf
+!	 added BN230_regrid_transforms 8/92
+! V3.00: uses BN300_syntax instead of BN230_syntax
+! 	 added bn300_dollar 4/93
+! V3.01: adds bn301_axis_limits and ppl echo ON
+! V3.11: adds bn311_ez_order (/ORDER and /FORMAT=STREAM)
+! V3.12: adds bn312_user (tests SAMPLE and OBJECTIVE)
+! V3.13: for AIX testing: removed mem_mgmt & ignore errors during bn200_output
+! V3.20: to test SAVE/HEADING=enhanced (new BN320_cdf)
+! V4.00: added "*" tests to bnxxx_dollar and added new test bn400_grave
+!    6/95 - added bn401_symbols
+!    7/95 - modified bn*_syntax: bn401_syntax has var1[G=var2[d=dset]]
+!    8/95 - modified bn*_ez: bn401_ez tests FORM=unf
+! V4.20:
+!    9/95 - added test of LET/D and LIST/FORMAT=STREAM
+!	  - slightly modified syntax in bn420_regrid_transforms
+!	  - added bn420_dynamic_grids and bn420_comma_delimited
+!	  - added 2 small additional tests in bn420_grave
+!	  - added a small syntax test in bn420_syntax
+!	  - tested for commas inside args in bn420_dollar
+!	  - tested for enclosing parens in bn420_symbol
+! V4.30:
+!   5/96  - added IF tests
+!   9/96  - added MC data tests *kob*
+! V4.50:
+!   1/97  - eliminated MODE POLISH
+!	    (bn301_expressions.jnl -> bn450_expressions.jnl)
+!   8/97  - bn430_if -> bn450_if: added symbol substitution test
+!10/97*kob*- cancel metafile creation after bn420_syntax and turn it
+!	    on only before bn450_plot (upgraded from bn320_plot)
+!	   - also add test for negative time steps (bn450_negative_t)
+!	   - also add test for cuvilinear stuff
+!          - also added steve's "exact match" regridding
+!11/97 *kob* - added bn450_gc_functions
+! V4.91:
+!    1/98  - corrected bug in this script -- need to cancel viewports after
+!	     bn312_user or the plots which follow come up in a small viewport
+!    2/98 *kob* - moved bn450_curv.jnl up to right after bn450_plot.jnl in
+!		  order to have those metafiles saves as well for checking
+!		  also renamed it to bn491_curv.jnl and added some minor
+!		  cosmetic changes
+!    2/98 *kob* - add in bn491_bug_fixes.jnl
+!    4/98 *sh*  - replaced bn420_dynamic_grids with bn491_... (minor chg)
+! V5.00:
+!   2/99 *sh* -- bn420_regrid_transform ==> bn500_regrid_transform
+!   3/1/99 *kob* - removed bn200_budget from distributable benchmarks
+!   5/99 *kob* - added V50 bench files
+! V5.10:
+!  10/99 *sh* -- added bn_sample.jnl to test SAMPLEI,J,K,L
+!			bn_non_COARDS_netCDF.jnl
+!			bn_cache_hits.jnl, .sub
+!			bn_strides_revs_perms.jnl
+!			bn_regrid_to_user.jnl
+! V5.33:
+! 6/01 *sh* -- added bn_modulo_strides.jnl
+! 6/01 *acm*  -- add	bn_calendar
+!			bn_dash_dot
+!			bn_flowlines
+! 6/08 *kob*  -- add	bn_internal_external_functions
+!
+! V5.40:
+! 9/01 *sh* -- added bn_axis_viewports
+!           -- added bn_strings
+! 10/01 *acm* -- added bn_axcontrol
+!             -- add EOF's and cmprsi_by to bn_internal_external_functions.jnl
+! 11/01 *sh* -- added bn_delimited_read
+!
+! V5.41:
+! 3/02 *acm*-- Add bn540_bug_fixes.jnl
+!
+! V5.50:
+! 11/02 *sh*-- Add bn_subspan_modulo.jnl
+!
+! V5.52
+!  5/03 *acm* add bn_multi_line_labels.jnl, bn552_bug_fixes.jnl,
+!             bn_set_var_scale_off.jnl, bn_longvarnames.jnl, bn_shakey.jnl
+! v5.53
+!  9/03 *kob* added bn_test_nan
+ 
+! v5.81
+!  9/05 *acm* remove bn_curv_shade_mod.jnl which was duplicated by bn_curv_mod.jnl
+ 
+!  V6.00
+!  9/06 *acm* new scripts  bn_tab_comma_multivar.jnl, bn_element_functions.jnl,
+!             bn_long_revision_num.jnl, bn_window_title.jnl, bn_last_error.jnl,
+!             bn_deg_min.jnl, bn_dp_readscale.jnl, bn_bounds_defineax.jnl,
+!              bn_attributes.jnl, n600_bug_fixes.jnl
+!
+! 9/06 *acm* New bn601_bug_fixes for version 6.02
+ 
+! 6/06  *acm* add bn_transforms.jnl -- there was a benchmark testing regridding
+!             transforms but not the others: smoothers, fillers, etc.
+! 1/12  *acm* add bn_variance.jnl -- testing @VAR transform
+ 
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!
+! 11/06 *acm* New bn602_bug_fixes for version 6.02
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V685  *sh* 11/13 - added bn_vtree to test SHOW VAR/TREE
+ 
+! Include this statement to compare the outupt of 6D Ferret with
+! previous 4D benchmark logs.
+! cancel mode 6d_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      metafile.plt
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN ACTIVE
+   1    *
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+cancel mode metafile      !9/97
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dollar hello    ! test command arg
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+ 
+! added in bn400
+GO bn_reset
+cancel mode verify
+GO bn_grave
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  3 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+ 
+! added in bn420
+GO bn_reset
+cancel mode verify
+GO bn_letd
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+ 
+! added in bn430
+GO bn_reset
+cancel mode verify
+GO bn_if
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+ 
+GO bn_reset
+cancel mode verify
+GO bn_geometry
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+set mode ignore		! needed for AIX   11/94
+GO bn_output
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+cancel list/format
+can mode ignore		! needed for AIX
+ 
+GO bn_reset
+cancel mode verify
+GO bn_in_plane
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+ 
+GO bn_reset
+cancel mode verify
+GO bn_compress
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4        6        8     
+              2        3        4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- K:3 Z:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- K:4 Z:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- K:3 Z:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- K:4 Z:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- K:3 Z:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- K:4 Z:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5        7        9     
+              3        4        5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- K:4 Z:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- K:5 Z:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- K:4 Z:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- K:5 Z:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- K:4 Z:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- K:5 Z:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ez		! changed from bn200_ez 8/10/95
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.355000
+ 3   / 3:  0.410000
+ 4   / 4:  0.435000
+ 5   / 5:  0.478000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+               X1      X2
+1   / 1:  0.006000  0.886500
+2   / 2:  0.355000  0.664300
+3   / 3:  0.410000  0.607100
+4   / 4:  0.435000  0.553500
+5   / 5:  0.478000  0.533700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.006000
+ 2    /  2:  0.176000
+ 3    /  3:  0.282000
+ 4    /  4:  0.355000
+ 5    /  5:  0.379000
+ 6    /  6:  0.393000
+ 7    /  7:  0.410000
+ 8    /  8:  0.417000
+ 9    /  9:  0.467000
+ 10   / 10:  0.435000
+ 11   / 11:  0.444000
+ 12   / 12:  0.470000
+ 13   / 13:  0.478000
+ 14   / 14:  0.515000
+ 15   / 15:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.593500
+ 3   / 3:  0.435000
+ 4   / 4:  0.545800
+ 5   / 5:  0.478000
+ 6   / 6:  0.514700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.355000
+ 2   / 2:  0.379000
+ 3   / 3:  0.393000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+              1         2         3      
+               1         2         3
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ 3   / 3:  0.410000  0.417000  0.467000
+ 4   / 4:  0.435000  0.444000  0.470000
+ 5   / 5:  0.478000  0.515000  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+              1         2         3      
+               1         2         3
+ ---- L:1 T:   1
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ ---- L:2 T:   2
+ 1   / 1:  0.410000  0.417000  0.467000
+ 2   / 2:  0.435000  0.444000  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.176000
+ 3   / 3:  0.282000
+ 4   / 4:  0.355000
+ 5   / 5:  0.379000
+ 6   / 6:  0.393000
+ 7   / 7:  0.410000
+ 8   / 8:  0.417000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+! ****
+! remove bn200_budgets for portable benchmarks *kob* 5/99
+! ****
+ 
+! ppl echo on turns on fort.41 to capture ppl commands.
+PPL ECHO ON		! added 10/27/93
+ 
+! 10/97 *kob* now set mode metafile
+set mode metafile bnplot.plt
+GO bn_reset
+cancel mode verify
+GO bn_plot		! upgraded from bn320_plot 10/1/97 *kob*
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+ 
+ 
+!added in bn450 10/97 *kob*
+! moved to right after bn450_plot to capture metafiles *kob* 2/98
+GO bn_reset
+cancel mode verify
+! 2/98 changed bn450_curv to bn491_curv - just some cosmetic changes *kob*
+GO bn_curv
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+ 
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! 8/25/92
+!CANCEL WINDOW/ALL    ! added 7/27/92
+! 10/97 *kob* now cancel mode metafile
+cancel mode metafile
+ 
+GO bn_reset
+cancel mode verify
+GO bn_symbols	! added 6/22/95
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.862"
+FERRET_PLATFORM = "Linux 2.6.32-431.5.1.el6.x86_64 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 10:43:06 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+DELTA_CPU = "4.37933"
+CLOCK_SECS = "6.512"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:40:47"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.862"
+FERRET_PLATFORM = "Linux 2.6.32-431.5.1.el6.x86_64 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 10:43:06 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+DELTA_CPU = "0.001"
+CLOCK_SECS = "6.513"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:40:47"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "4"
+Q23456789012345678901234567890AAAAA = "5"
+Q23456789012345678901234567XXXAAAAA = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LAB1 = "FERRET Ver. 6.862"
+LAB2 = "NOAA/PMEL TMAP"
+LAB3 = "28-MAR-2014 11:40:47"
+LABX = "X"
+LAB4 = "Y : 10"
+LABNUM_Y = "4"
+LAB5 = "Z : 5"
+LABNUM_Z = "5"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "4"
+LABNUM_Z = "5"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "4"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.862"
+FERRET_PLATFORM = "Linux 2.6.32-431.5.1.el6.x86_64 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 10:43:06 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+SESSION_PID = "30596"
+DELTA_CPU = "0.008999"
+CLOCK_SECS = "6.522"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:40:47"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_comma_delimited	! added 10/2/95
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- K:3 Z:   25
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- K:3 Z:   25
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- I:96 X:   134.5W
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+15,27.1246,27.5239
+25,27.011,27.3501
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- J:42 Y:   1.167S
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+15,27.1246,27.5239
+25,27.011,27.3501
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- K:3 Z:   25
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- K:3 Z:   25
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+25,27.2481
+ ---- I:96 X:   134.5W
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+15,27.1246
+25,27.011
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+25,27.2481
+ ---- J:42 Y:   1.167S
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+15,27.1246
+25,27.011
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+ ---- I:96 X:   134.5W
+15,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+ ---- I:96 X:   134.5W
+15,27.1246
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+ ---- J:42 Y:   1.167S
+15,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+ ---- J:42 Y:   1.167S
+15,27.1246
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.167S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.167S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+1.5S,27.335
+1.167S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W   	134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.3346	27.2218
+1.167S	27.2382	27.1246
+ ---- K:3 Z:   25
+1.5S	27.2481	27.1248
+1.167S	27.1293	27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.7751	27.6218
+1.167S	27.678	27.5239
+ ---- K:3 Z:   25
+1.5S	27.6518	27.4892
+1.167S	27.51	27.3501
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,2.E+08,2.E+08
+1.167S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,1.6675084E+08,2.0208841E+08
+1.167S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.000002,0.000002
+1.167S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.00000166750845,0.00000202088412
+1.167S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.833S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.333S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1     ,2     ,3     ,4     ,5     
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dynamic_grids	! added 9/27/95, V420 ->V491 4/98
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.67N / 50:  24.6561  24.4277  24.3118  24.3162  24.5191
+ 1.33N / 49:  24.4396  24.2439  24.1355  24.1369  24.3131
+ 1N    / 48:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.67N / 47:  24.0904  23.9463  23.8383  23.7928  23.8749
+ 0.33N / 46:  23.9899  23.8698  23.7654  23.6951  23.7076
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  24.5431  24.3351  24.2254  24.2312  24.4219
+ 1.17N / 49:  24.3362  24.1527  24.0455  24.0427  24.2042
+ 0.83N / 48:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.5N  / 47:  24.0242  23.8934  23.7879  23.7273  23.7728
+ 0.17N / 46:  23.9556  23.8461  23.7430  23.6629  23.6425
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G003)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+                179.5W    178.5W    177.5W    176.5W    175.5W  
+                 51        52        53        54        55
+ 1.83N / 51: -0.627987 -0.652220 -0.659763 -0.663230 -0.662623
+ 1.5N  / 50: -0.631590 -0.653915 -0.653717 -0.650547 -0.644405
+ 1.17N / 49: -0.635168 -0.655610 -0.647673 -0.637865 -0.626188
+ 0.83N / 48: -0.627037 -0.647150 -0.637065 -0.626707 -0.616078
+ 0.5N  / 47: -0.607180 -0.628495 -0.621847 -0.617047 -0.614073
+ 0.17N / 46: -0.587298 -0.609840 -0.606630 -0.607388 -0.612068
+ 0.17S / 45: -0.567438 -0.591208 -0.591415 -0.597708 -0.610065
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 1.83N / 51:  27.5946  27.5458  27.5038  27.4555  27.3787  27.2791
+ 1.5N  / 50:  27.6353  27.5819  27.5333  27.4787  27.4018  27.3015
+ 1.17N / 49:  27.6807  27.6187  27.5654  27.5064  27.4279  27.3285
+ 0.83N / 48:  27.7285  27.6555  27.5958  27.5327  27.4522  27.3536
+ 0.5N  / 47:  27.7775  27.6952  27.6296  27.5610  27.4762  27.3760
+ 0.17N / 46:  27.8234  27.7366  27.6691  27.5969  27.5077  27.4040
+ 0.17S / 45:  27.8727  27.7878  27.7232  27.6494  27.5563  27.4494
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                  A      A
+130.5E / 1:  130.500  130.500
+131.5E / 2:  131.500  131.500
+132.5E / 3:  132.500  132.500
+133.5E / 4:  133.500  133.500
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX003)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.10000
+ 0.2  /  2:  0.20000
+ 0.3  /  3:  0.30000
+ 0.4  /  4:  0.40000
+ 0.5  /  5:  0.50000
+ 0.6  /  6:  0.60000
+ 0.7  /  7:  0.70000
+ 0.8  /  8:  0.80000
+ 0.9  /  9:  0.90000
+ 1    / 10:  1.00000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.000
+ 132.5E / 2:  132.500
+ 135E   / 3:  135.000
+ 137.5E / 4:  137.500
+ 140E   / 5:  140.000
+ 142.5E / 6:  142.500
+ 145E   / 7:  145.000
+ 147.5E / 8:  147.500
+ 150E   / 9:  150.000
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 101   /  1:  101.100  102.600  104.100  105.600  107.100  108.600  110.100
+ 102   /  2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 103   /  3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 104   /  4:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 105   /  5:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+ 106   /  6:  106.100  107.600  109.100  110.600  112.100  113.600  115.100
+ 107   /  7:  107.100  108.600  110.100  111.600  113.100  114.600  116.100
+ 108   /  8:  108.100  109.600  111.100  112.600  114.100  115.600  117.100
+ 109   /  9:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+ 110   / 10:  110.100  111.600  113.100  114.600  116.100  117.600  119.100
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                 0.1      4.6      9.1   
+                 1        2        3
+ 101   /  1:  101.100  105.600  110.100
+ 102   /  2:  102.100  106.600  111.100
+ 103   /  3:  103.100  107.600  112.100
+ 104   /  4:  104.100  108.600  113.100
+ 105   /  5:  105.100  109.600  114.100
+ 106   /  6:  106.100  110.600  115.100
+ 107   /  7:  107.100  111.600  116.100
+ 108   /  8:  108.100  112.600  117.100
+ 109   /  9:  109.100  113.600  118.100
+ 110   / 10:  110.100  114.600  119.100
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                 0.1      7.6   
+                 1        2
+ 101   /  1:  101.100  108.600
+ 102   /  2:  102.100  109.600
+ 103   /  3:  103.100  110.600
+ 104   /  4:  104.100  111.600
+ 105   /  5:  105.100  112.600
+ 106   /  6:  106.100  113.600
+ 107   /  7:  107.100  114.600
+ 108   /  8:  108.100  115.600
+ 109   /  9:  109.100  116.600
+ 110   / 10:  110.100  117.600
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 102    / 1:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 102.5  / 2:  102.600  104.100  105.600  107.100  108.600  110.100  111.600
+ 103    / 3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 103.5  / 4:  103.600  105.100  106.600  108.100  109.600  111.100  112.600
+ 104    / 5:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 104.5  / 6:  104.600  106.100  107.600  109.100  110.600  112.100  113.600
+ 105    / 7:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+                0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                1        2        3        4        5        6        7
+ 95    / 1:     ....     ....     ....     ....     ....     ....     ....
+ 102   / 2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 109   / 3:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX004)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX003)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX003)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ (AX004)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.00
+ 121    /  2:   220.00
+ 441    /  3:   420.00
+ 961    /  4:   620.00
+ 1681   /  5:   820.00
+ 2601   /  6:  1020.00
+ 3721   /  7:  1220.00
+ 5041   /  8:  1420.00
+ 6561   /  9:  1620.00
+ 8281   / 10:  1720.00
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.500
+ 131.5E /  2:  131.500
+ 132.5E /  3:  132.500
+ 133.5E /  4:  133.500
+ 134.5E /  5:  134.500
+ 135.5E /  6:  135.500
+ 136.5E /  7:  136.500
+ 137.5E /  8:  137.500
+ 138.5E /  9:  138.500
+ 139.5E / 10:  139.500
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX003)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  255.043  255.835  256.725  257.731  258.922
+ 1.17N / 49:  254.836  255.653  256.546  257.543  258.704
+ 0.83N / 48:  254.657  255.499  256.389  257.358  258.477
+ 0.5N  / 47:  254.524  255.393  256.288  257.227  258.273
+ 0.17N / 46:  254.456  255.346  256.243  257.163  258.142
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  125.543  129.422  134.545  137.119  141.562
+ 1.17N / 49:  125.336  129.204  134.163  136.896  141.270
+ 0.83N / 48:  125.157  128.977  133.703  136.690  140.960
+ 0.5N  / 47:  125.024  128.773  133.295  136.512  140.644
+ 0.17N / 46:  124.956  128.642  132.987  136.380  140.376
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  255.043  258.922  264.045  266.619  271.062
+ 1.17N / 49:  254.836  258.704  263.663  266.396  270.770
+ 0.83N / 48:  254.657  258.477  263.203  266.190  270.460
+ 0.5N  / 47:  254.524  258.273  262.795  266.012  270.144
+ 0.17N / 46:  254.456  258.142  262.487  265.880  269.876
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               168.5E   170.5E   172.5E   174.5E   176.5E   178.5E  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  29.2186  29.1820  28.9284  28.6727  28.1158  27.7262
+ 1.17N / 49:  29.2537  29.1794  28.9683  28.7060  28.2175  27.8045
+ 0.83N / 48:  29.2747  29.1817  28.9842  28.7218  28.2984  27.8834
+ 0.5N  / 47:  29.3025  29.1943  28.9819  28.7306  28.3551  27.9545
+ 0.17N / 46:  29.3441  29.2219  28.9889  28.7493  28.3962  28.0105
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               108.5W   106.5W   104.5W   102.5W   100.5W   98.5W   
+                 1        2        3        4        5        6
+ 1.5N  / 50:  25.4248  25.2404  25.0453  25.2349  25.4898  25.8063
+ 1.17N / 49:  25.0178  24.8787  24.7362  24.9070  25.2015  25.5514
+ 0.83N / 48:  24.6455  24.5412  24.4230  24.5627  24.8753  25.2469
+ 0.5N  / 47:  24.2823  24.1999  24.1010  24.2162  24.5241  24.8980
+ 0.17N / 46:  23.9664  23.8958  23.8185  23.9163  24.1945  24.5649
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX004)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.000
+ 170E   / 2:  170.000
+ 150W   / 3:  210.000
+ 110W   / 4:  250.000
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.0000
+ 2S    / 2:  -2.0000
+ 10S   / 1: -10.0000
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 2.8N / 4:  25.8760  25.1016  24.7591  25.3616  25.9523  26.1052
+ 1.8N / 3:  25.1492  24.5204  24.4013  25.0592  25.8372  25.5690
+ 0.8N / 2:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.2S / 1:  24.0844  23.8819  23.6864  23.6291  23.8094  23.6664
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 4N   / 4:  26.3100  25.7627  25.1684  25.4169  26.0928  26.4324
+ 2.5N / 3:  25.6892  24.9014  24.6646  25.3345  25.9631  26.0034
+ 1N   / 2:  24.4816  24.0759  23.9505  24.3911  24.9972  24.6091
+ 0.5S / 1:  24.1489  23.9855  23.7919  23.6520  23.7144  23.6009
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 2.8N / 4:  25.6905  24.7917  25.5507  26.0875
+ 1.8N / 3:  24.9592  24.3997  25.3139  25.6838
+ 0.8N / 2:  24.2617  23.8736  24.4085  24.5531
+ 0.2S / 1:  24.0313  23.7330  23.6749  23.7233
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 4N   / 4:  26.1901  25.2969  25.5832  26.3921
+ 2.5N / 3:  25.4818  24.6784  25.5471  26.0151
+ 1N   / 2:  24.3640  23.9588  24.5740  24.7711
+ 0.5S / 1:  24.1087  23.8399  23.6597  23.6433
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX003)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   138.5W   136.5W   134.5W   132.5W   130.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.9330  24.4927  25.4749  25.9529  25.6235  24.8629
+ 1.17N / 49:  24.8195  24.3658  25.1683  25.8306  25.3698  24.5966
+ 0.83N / 48:  24.6946  24.2521  24.7974  25.6708  25.1391  24.3667
+ 0.5N  / 47:  24.5726  24.1661  24.4685  25.4813  24.9214  24.1928
+ 0.17N / 46:  24.4684  24.1208  24.2760  25.1658  24.7013  24.0902
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W  
+                 1        2        3
+ 1.5N  / 50:  24.9330  25.4749  25.6235
+ 1.17N / 49:  24.8195  25.1683  25.3698
+ 0.83N / 48:  24.6946  24.7974  25.1391
+ 0.5N  / 47:  24.5726  24.4685  24.9214
+ 0.17N / 46:  24.4684  24.2760  24.7013
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W   128.5W  
+                 1        2        3        4
+ 1.5N  / 50:  24.9330  25.4749  25.6235  24.3351
+ 1.17N / 49:  24.8195  25.1683  25.3698  24.1527
+ 0.83N / 48:  24.6946  24.7974  25.1391  23.9991
+ 0.5N  / 47:  24.5726  24.4685  24.9214  23.8934
+ 0.17N / 46:  24.4684  24.2760  24.7013  23.8461
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               134.5W   132.5W   130.5W   128.5W   126.5W   124.5W  
+                 4        5        6        7        8        9
+ 1.5N  / 50:  25.9529  25.6235  24.8629  24.3351  24.2312  24.8158
+ 1.17N / 49:  25.8306  25.3698  24.5966  24.1527  24.0427  24.5341
+ 0.83N / 48:  25.6708  25.1391  24.3667  23.9991  23.8583  24.2480
+ 0.5N  / 47:  25.4813  24.9214  24.1928  23.8934  23.7273  23.9665
+ 0.17N / 46:  25.1658  24.7013  24.0902  23.8461  23.6629  23.7442
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               135W     132W     129W     126W    
+                 1        2        3        4
+ 1.5N  / 50:  25.8334  25.4333  24.4671  24.3773
+ 1.17N / 49:  25.6650  25.1765  24.2637  24.1656
+ 0.83N / 48:  25.4524  24.9460  24.0910  23.9557
+ 0.5N  / 47:  25.2281  24.7393  23.9683  23.7871
+ 0.17N / 46:  24.9433  24.5486  23.9072  23.6832
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     127W     125W     123W     121W    
+                 1        2        3        4        5
+ 1.5N  / 50:  24.5447  24.2283  24.7825  25.1672  25.3824
+ 1.17N / 49:  24.3256  24.0441  24.5077  24.8227  24.9891
+ 0.83N / 48:  24.1323  23.8736  24.2302  24.4567  24.5531
+ 0.5N  / 47:  23.9915  23.7576  23.9781  24.1197  24.1823
+ 0.17N / 46:  23.9163  23.7029  23.7877  23.8557  23.9069
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               138W     133W     128W     123W     118W     113W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....  24.3865  25.1672     ....     ....
+ 1.17N / 49:     ....     ....  24.1849  24.8227     ....     ....
+ 0.83N / 48:     ....     ....  24.0029  24.4567     ....     ....
+ 0.5N  / 47:     ....     ....  23.8746  24.1197     ....     ....
+ 0.17N / 46:     ....     ....  23.8096  23.8557     ....     ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4.8N / 6:  26.3655  26.1878  26.0268  25.9290  25.9885
+ 3.8N / 5:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 5.8N / 4:  26.6294  26.5670  26.5361  26.5638  26.6554
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:  26.4095  26.2510  26.1116  26.0348  26.0997
+ 3N   / 3:  25.5883  25.1978  24.9065  24.8097  24.9649
+ 1N   / 2:  24.2587  24.0860  23.9737  23.9488  24.0835
+ 1S   / 1:     ....     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:     ....     ....     ....     ....     ....
+ 3N   / 3:  25.5396  25.1885  24.9365  24.8326  24.9791
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 1S   / 1:  24.2763  24.2177  24.1436  24.0651  23.9786
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W    63.5W    61.5W  
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966  29.4136  29.5107
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191  29.4462  29.5279
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689  29.4873  29.5544
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330  29.5361  29.5888
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966  29.5858  29.6187
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX002)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W  
+                 1        2        3
+ 1.5N  / 50:     ....     ....  29.5035
+ 1.17N / 49:     ....     ....  29.5373
+ 0.83N / 48:     ....     ....  29.6002
+ 0.5N  / 47:     ....     ....  29.6787
+ 0.17N / 46:     ....     ....  29.7929
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W    63.5W  
+                 1        2        3        4
+ 1.5N  / 50:     ....     ....  29.5035  29.4136
+ 1.17N / 49:     ....     ....  29.5373  29.4462
+ 0.83N / 48:     ....     ....  29.6002  29.4873
+ 0.5N  / 47:     ....     ....  29.6787  29.5361
+ 0.17N / 46:     ....     ....  29.7929  29.5858
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                85W      80W      75W      70W      65W      60W      55W      50W      45W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....     ....     ....  29.4009     ....     ....     ....     ....
+ 1.17N / 49:     ....     ....     ....     ....  29.4259     ....     ....     ....     ....
+ 0.83N / 48:     ....     ....     ....     ....  29.4735     ....     ....     ....     ....
+ 0.5N  / 47:     ....     ....     ....     ....  29.5338     ....     ....     ....     ....
+ 0.17N / 46:     ....     ....     ....     ....  29.5939     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W    
+                 1        2        3
+ 1.5N  / 50:  27.2194  27.9470     ....
+ 1.17N / 49:  27.1122  27.8883     ....
+ 0.83N / 48:  26.9645  27.7639     ....
+ 0.5N  / 47:  26.7776  27.5584     ....
+ 0.17N / 46:  26.5410  27.2770     ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W      66W    
+                 1        2        3        4
+ 1.5N  / 50:  27.2194  27.9470     ....  29.3528
+ 1.17N / 49:  27.1122  27.8883     ....  29.3882
+ 0.83N / 48:  26.9645  27.7639     ....  29.4644
+ 0.5N  / 47:  26.7776  27.5584     ....  29.5482
+ 0.17N / 46:  26.5410  27.2770     ....  29.6283
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                92W      89W      86W      83W      80W      77W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....  27.3039  27.5576  27.8497     ....     ....
+ 1.17N / 49:     ....  27.1874  27.4131  27.7695     ....     ....
+ 0.83N / 48:     ....  27.0366  27.2528  27.6362     ....     ....
+ 0.5N  / 47:     ....  26.8545  27.0851  27.4401     ....     ....
+ 0.17N / 46:     ....  26.6303  26.8980  27.1822     ....     ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               101W      95W      89W      83W      77W      71W      65W      59W      53W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....  27.3039  27.8497     ....     ....  29.3867     ....     ....
+ 1.17N / 49:     ....     ....  27.1874  27.7695     ....     ....  29.4183     ....     ....
+ 0.83N / 48:     ....     ....  27.0366  27.6362     ....     ....  29.4828     ....     ....
+ 0.5N  / 47:     ....     ....  26.8545  27.4401     ....     ....  29.5548     ....     ....
+ 0.17N / 46:     ....     ....  26.6303  27.1822     ....     ....  29.6233     ....     ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+ 15-JAN-1982 00 / 1:  27.7767
+ 21-JAN-1982 00 / 2:  27.7818
+ 27-JAN-1982 00 / 3:  27.6992
+ 02-FEB-1982 00 / 4:  27.8253
+ 08-FEB-1982 00 / 5:  27.7319
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.7767
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX004)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G007_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+         FCN_NOR   FCN_REV
+J /  1:  0.633194 -0.633194
+J /  2:  0.645479 -0.645479
+J /  3:  0.499729 -0.499729
+J /  4:  0.231628 -0.231628
+J /  5: -0.093184  0.093184
+J /  6: -0.395181  0.395181
+J /  7: -0.600424  0.600424
+J /  8: -0.658663  0.658663
+J /  9: -0.555637  0.555637
+J / 10: -0.316573  0.316573
+J / 11:  0.000000  0.000000
+J / 12:  0.316573 -0.316573
+J / 13:  0.555637 -0.555637
+J / 14:  0.658663 -0.658663
+J / 15:  0.600424 -0.600424
+J / 16:  0.395181 -0.395181
+J / 17:  0.093184 -0.093184
+J / 18: -0.231628  0.231628
+J / 19: -0.499729  0.499729
+J / 20: -0.645479  0.645479
+J / 21: -0.633194  0.633194
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+               180E    
+                51
+ 8N   / 19:  0.499729
+ 7N   / 18:  0.231628
+ 6N   / 17: -0.093184
+ 5N   / 16: -0.395181
+ 4N   / 15: -0.600424
+ 3N   / 14: -0.658663
+ 2N   / 13: -0.555637
+ 1N   / 12: -0.316573
+ 0    / 11:  0.000000
+ 1S   / 10:  0.316573
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 57 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=@ave]   ! no target grid specified
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 55 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,g=w]   ! more than 1 target grid
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 45 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 43 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 39 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 36 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 33 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ reading TEMP     M: 22 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 16 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 10 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  7 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M: 27 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M: 27 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 49 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6373  25.0615  25.4410
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8705  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6495
+ 1N    / 48:  24.1494  24.2321  24.4464  24.8164  25.1767  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6691  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 18 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 48 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 40 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:  6 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 37 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 32 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2012  24.2556  24.4066  24.7485  25.2133  25.5037
+ 1N    / 48:  24.0581  24.0827  24.1835  24.4473  24.8567  25.1333
+ 0.67N / 47:  23.9772  23.9643  23.9994  24.1601  24.4838  24.7472
+ 0.33N / 46:  23.9584  23.9040  23.8788  23.9333  24.1419  24.3790
+ 0     / 45:  24.0357  23.9390  23.8536  23.8172  23.9069  24.0855
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9325  23.9890  24.1393  24.4928  25.0067  25.3582
+ 1N    / 48:  23.7314  23.7626  23.8716  24.1488  24.6053  24.9421
+ 0.67N / 47:  23.5951  23.5875  23.6312  23.8060  24.1706  24.4921
+ 0.33N / 46:  23.5385  23.4834  23.4619  23.5233  23.7598  24.0491
+ 0     / 45:  23.6210  23.5135  23.4199  23.3768  23.4767  23.6893
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  1 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2921  24.2593  24.2798  24.4459  24.8288  25.2942
+ 1N    / 48:  24.1296  24.0952  24.0995  24.2165  24.5387  24.9629
+ 0.67N / 47:  24.0124  23.9735  23.9541  24.0061  24.2416  24.6067
+ 0.33N / 46:  23.9590  23.9098  23.8662  23.8516  23.9772  24.2614
+ 0     / 45:  23.9901  23.9230  23.8503  23.7816  23.8003  23.9828
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0517  24.0117  24.0305  24.1957  24.5888  25.1042
+ 1N    / 48:  23.8384  23.7998  23.8085  23.9326  24.2677  24.7399
+ 0.67N / 47:  23.6606  23.6190  23.6065  23.6697  23.9240  24.3347
+ 0.33N / 46:  23.5549  23.5048  23.4677  23.4600  23.6025  23.9282
+ 0     / 45:  23.5662  23.4962  23.4251  23.3553  23.3775  23.5902
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2879  24.3481  24.5174  24.8892  25.3674  25.6544
+ 1N    / 48:  24.1297  24.1691  24.2950  24.5979  25.0350  25.3185
+ 0.67N / 47:  24.0177  24.0235  24.0914  24.3037  24.6703  24.9403
+ 0.33N / 46:  23.9678  23.9342  23.9391  24.0467  24.3128  24.5631
+ 0     / 45:  23.9971  23.9215  23.8662  23.8753  24.0244  24.2322
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0365  24.0951  24.2619  24.6460  25.1734  25.5187
+ 1N    / 48:  23.8319  23.8758  24.0055  24.3208  24.8060  25.1502
+ 0.67N / 47:  23.6632  23.6751  23.7514  23.9774  24.3880  24.7171
+ 0.33N / 46:  23.5668  23.5355  23.5465  23.6647  23.9652  24.2706
+ 0     / 45:  23.5798  23.4985  23.4409  23.4500  23.6182  23.8692
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 52 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 56 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.1864  24.1787  24.2594  24.5105  24.9134  25.2830
+ 1N    / 48:  24.0384  24.0160  24.0566  24.2448  24.5882  24.9167
+ 0.67N / 47:  23.9476  23.9116  23.9036  24.0029  24.2600  24.5428
+ 0.33N / 46:  23.9212  23.8644  23.8142  23.8259  23.9786  24.2058
+ 0     / 45:  23.9919  23.9089  23.8177  23.7561  23.8046  23.9579
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9233  23.9145  23.9973  24.2541  24.6864  25.1105
+ 1N    / 48:  23.7149  23.6938  23.7438  23.9462  24.3212  24.7033
+ 0.67N / 47:  23.5646  23.5317  23.5324  23.6475  23.9375  24.2709
+ 0.33N / 46:  23.4951  23.4409  23.3953  23.4150  23.5931  23.8658
+ 0     / 45:  23.5673  23.4804  23.3851  23.3179  23.3746  23.5590
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2284  24.3311  24.5775  24.9809  25.3585  25.4979
+ 1N    / 48:  24.0704  24.1331  24.3154  24.6520  24.9950  25.1205
+ 0.67N / 47:  23.9708  23.9819  24.0798  24.3220  24.6155  24.7426
+ 0.33N / 46:  23.9312  23.8914  23.9061  24.0376  24.2605  24.3979
+ 0     / 45:  23.9874  23.8963  23.8354  23.8620  23.9962  24.1237
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9608  24.0642  24.3160  24.7497  25.1824  25.3725
+ 1N    / 48:  23.7470  23.8171  24.0102  24.3770  24.7737  24.9496
+ 0.67N / 47:  23.5913  23.6093  23.7186  23.9883  24.3314  24.5067
+ 0.33N / 46:  23.5110  23.4726  23.4926  23.6415  23.9044  24.0873
+ 0     / 45:  23.5673  23.4667  23.3983  23.4267  23.5830  23.7431
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 20 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 44 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 41 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7799  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5330  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2438  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9739  25.1064
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 35 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:  9 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2029  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  5 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 47 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7800  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5331  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2439  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9740  25.1065
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 50 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3316  24.1982  24.1149  24.1101  24.2698  24.6194
+ 1N    / 48:  24.1534  24.0459  23.9640  23.9283  24.0343  24.3289
+ 0.67N / 47:  24.0296  23.9427  23.8693  23.8085  23.8334  24.0392
+ 0.33N / 46:  23.9776  23.9013  23.8273  23.7484  23.7068  23.8063
+ 0     / 45:  24.0264  23.9547  23.8708  23.7728  23.6845  23.6853
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0998  23.9419  23.8502  23.8473  24.0126  24.3725
+ 1N    / 48:  23.8568  23.7289  23.6389  23.6068  23.7315  24.0484
+ 0.67N / 47:  23.6628  23.5633  23.4870  23.4278  23.4670  23.7064
+ 0.33N / 46:  23.5593  23.4735  23.4013  23.3239  23.2836  23.4092
+ 0     / 45:  23.6053  23.5232  23.4384  23.3380  23.2391  23.2432
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 58 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3718  24.2759  24.2381  24.3143  24.5845  24.9998
+ 1N    / 48:  24.1915  24.1099  24.0666  24.1084  24.3268  24.6951
+ 0.67N / 47:  24.0557  23.9849  23.9336  23.9307  24.0730  24.3751
+ 0.33N / 46:  23.9834  23.9165  23.8564  23.8115  23.8637  24.0759
+ 0     / 45:  23.9966  23.9258  23.8496  23.7701  23.7430  23.8530
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1479  24.0348  23.9902  24.0651  24.3406  24.7844
+ 1N    / 48:  23.9151  23.8193  23.7735  23.8199  24.0509  24.4498
+ 0.67N / 47:  23.7150  23.6338  23.5826  23.5862  23.7461  24.0841
+ 0.33N / 46:  23.5857  23.5123  23.4548  23.4139  23.4780  23.7252
+ 0     / 45:  23.5750  23.4974  23.4222  23.3420  23.3139  23.4455
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2986  24.3714  24.5593  24.9405  25.4006  25.6571
+ 1N    / 48:  24.1387  24.1885  24.3309  24.6454  25.0684  25.3212
+ 0.67N / 47:  24.0238  24.0371  24.1191  24.3444  24.7020  24.9439
+ 0.33N / 46:  23.9705  23.9413  23.9571  24.0777  24.3415  24.5694
+ 0     / 45:  23.9960  23.9223  23.8745  23.8951  24.0474  24.2410
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0465  24.1179  24.3048  24.7018  25.2123  25.5259
+ 1N    / 48:  23.8411  23.8950  24.0422  24.3726  24.8452  25.1571
+ 0.67N / 47:  23.6700  23.6890  23.7799  24.0219  24.4252  24.7240
+ 0.33N / 46:  23.5701  23.5428  23.5650  23.6985  23.9987  24.2798
+ 0     / 45:  23.5791  23.4988  23.4489  23.4714  23.6448  23.8804
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2294  24.1666  24.1789  24.3348  24.6565  25.0363
+ 1N    / 48:  24.0720  24.0100  23.9961  24.1004  24.3654  24.6946
+ 0.67N / 47:  23.9687  23.9085  23.8682  23.9032  24.0827  24.3496
+ 0.33N / 46:  23.9312  23.8643  23.7997  23.7720  23.8569  24.0495
+ 0     / 45:  23.9912  23.9110  23.8200  23.7410  23.7390  23.8465
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9767  23.9044  23.9159  24.0764  24.4158  24.8366
+ 1N    / 48:  23.7576  23.6884  23.6775  23.7944  24.0849  24.4571
+ 0.67N / 47:  23.5912  23.5281  23.4913  23.5379  23.7453  24.0569
+ 0.33N / 46:  23.5068  23.4390  23.3774  23.3540  23.4579  23.6911
+ 0     / 45:  23.5656  23.4806  23.3868  23.3018  23.3015  23.4336
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2444  24.3616  24.6223  25.0230  25.3769  25.4884
+ 1N    / 48:  24.0827  24.1577  24.3539  24.6907  25.0127  25.1114
+ 0.67N / 47:  23.9782  23.9985  24.1095  24.3557  24.6332  24.7370
+ 0.33N / 46:  23.9336  23.8998  23.9253  24.0636  24.2777  24.3972
+ 0     / 45:  23.9847  23.8969  23.8444  23.8789  24.0106  24.1269
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9764  24.0949  24.3635  24.7971  25.2062  25.3654
+ 1N    / 48:  23.7597  23.8423  24.0513  24.4207  24.7960  24.9418
+ 0.67N / 47:  23.5993  23.6266  23.7505  24.0264  24.3532  24.5021
+ 0.33N / 46:  23.5136  23.4812  23.5130  23.6709  23.9254  24.0877
+ 0     / 45:  23.5643  23.4665  23.4073  23.4453  23.5998  23.7470
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 62 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 64 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 66 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3636  24.2466  24.2047  24.2944  24.5700  24.9834
+ 1N    / 48:  24.1823  24.0808  24.0293  24.0856  24.3131  24.6721
+ 0.67N / 47:  24.0429  23.9555  23.8925  23.9012  24.0590  24.3508
+ 0.33N / 46:  23.9628  23.8852  23.8134  23.7743  23.8464  24.0554
+ 0     / 45:  23.9650  23.8885  23.8048  23.7281  23.7207  23.8377
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1405  24.0053  23.9571  24.0466  24.3282  24.7726
+ 1N    / 48:  23.9068  23.7900  23.7358  23.7995  24.0412  24.4324
+ 0.67N / 47:  23.7030  23.6045  23.5401  23.5583  23.7383  24.0672
+ 0.33N / 46:  23.5647  23.4813  23.4100  23.3756  23.4665  23.7136
+ 0     / 45:  23.5403  23.4591  23.3754  23.2961  23.2938  23.4386
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8829  23.9742  24.1489  24.3750  24.6256
+ 25-JAN-1982 00 / 3:  23.8850  23.9834  24.1657  24.3983  24.6503
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8838  23.9752  24.1501  24.3761  24.6265
+ 25-JAN-1982 00 / 3:  23.8774  23.9728  24.1535  24.3857  24.6381
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 72 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7485  23.7489  23.8463  24.0075  24.2057
+ 25-JAN-1982 00 / 3:  23.7481  23.7620  23.8678  24.0343  24.2309
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5859  29.5797  29.5756  29.5662  29.5590
+ 25-JAN-1982 00 / 3:  29.5787  29.5737  29.5698  29.5546  29.5421
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 76 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5747  29.5654  29.5513  29.5344  29.5265
+ 25-JAN-1982 00 / 3:  29.5636  29.5536  29.5355  29.5146  29.5054
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7784  23.7190  23.7799  23.9148  24.1031
+ 25-JAN-1982 00 / 3:  23.7745  23.7236  23.7888  23.9212  24.1104
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 80 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 82 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.9612  23.9499  24.0203  24.1507  24.3238
+ 25-JAN-1982 00 / 3:  23.9591  23.9559  24.0305  24.1636  24.3350
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 84 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7527  23.7638  23.8729  24.0446  24.2520
+ 25-JAN-1982 00 / 3:  23.7439  23.7321  23.8164  23.9658  24.1537
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 85 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 86 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 88 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 89 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 91 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 92 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 94 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 95 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 96 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 98 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 97 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 97 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 99 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:101 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:100 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:100 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:102 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:105 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:104 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:106 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:108 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:107 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:107 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:109 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:110 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:111 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:112 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:113 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:114 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:115 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:116 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:118 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:117 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:120 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:121 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:122 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 76   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:125 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:126 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 77   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:130 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:132 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 78   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:135 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:137 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M:138 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 79   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:141 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:142 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 80   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:146 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:148 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 81   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:151 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:153 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M:154 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 82   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:157 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:159 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 83   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:162 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 84   complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:167 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:169 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 85   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:172 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 86   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:177 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:180 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 87   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 88   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:188 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 89   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:191 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:192 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 90   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:194 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:196 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 91   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:197 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:198 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 92   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:201 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:202 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 93   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:204 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:206 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 94   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:207 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:208 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 95   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:211 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 96   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:214 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 97   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:217 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:219 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 98   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:220 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 99   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:223 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 100  complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 101  complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:231 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ reading TEMP     M:233 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ reading TEMP     M:235 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 102  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:238 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:239 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:241 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:242 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 103  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:244 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:247 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 104  complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:248 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:250 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 105  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:253 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:254 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:256 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:257 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 106  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:259 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:262 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 107  complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:263 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:265 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 108  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:268 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:270 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:271 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:273 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 109  complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 110  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:278 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:279 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:281 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:282 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 111  complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:284 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:287 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 112  complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:288 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:290 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 113  complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:293 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:295 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 114  complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  4.50000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at var] ! should be all missing
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ -DELETE X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  5.40000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at var]
+ -DELETE X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:       ....
+ 2.1 / 2:       ....
+ 3.1 / 3:       ....
+ 4.1 / 4:       ....
+ 5.1 / 5:  0.0900000
+ 6.1 / 6:       ....
+ 7.1 / 7:       ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 5.1 / 5:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  0.10000  0.90000     ....     ....
+ 5.1 / 5:     ....     ....     ....  0.90000  8.10000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.1000  11.0000     ....
+ 5.1 / 5:     ....     ....     ....  10.1000  10.2000  11.1000     ....
+ 6.1 / 6:     ....     ....     ....  11.0000  11.1000  12.0000     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....   0.1000   1.0100   0.9900     ....
+ 5.1 / 5:     ....     ....     ....   1.0100  10.2000   9.9900     ....
+ 6.1 / 6:     ....     ....     ....   0.9900   9.9900   9.7200     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1       2.1       3.1       4.1       5.1       6.1       7.1    
+               1         2         3         4         5         6         7
+ 1.1 / 1:      ....      ....      ....      ....      ....      ....      ....
+ 2.1 / 2:      ....      ....      ....      ....      ....      ....      ....
+ 3.1 / 3:      ....      ....      ....      ....      ....      ....      ....
+ 4.1 / 4:      ....      ....      ....      ....      ....      ....      ....
+ 5.1 / 5:      ....      ....      ....      ....  0.000000      ....      ....
+ 6.1 / 6:      ....      ....      ....      ....      ....      ....      ....
+ 7.1 / 7:      ....      ....      ....      ....      ....      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:303 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:301 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:302 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.50000
+ 6.1 / 6:  6.50000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MIN
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @SUM
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:   8.8500
+ 6.1 / 6:  12.2000
+ 7.1 / 7:   1.9500
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ -DELETE X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G008)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.50000
+ 2   / 2:  1.50000
+ 3   / 3:  2.50000
+ 4   / 4:  3.50000
+ 5   / 5:  5.50000
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:299 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:296 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:301 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  2.50000
+ 4   / 4:     ....
+ 5   / 5:     ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    3    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.50000
+list a5[gx=x5 at max,i=4]
+ -DELETE X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    4    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ -DELETE X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:296 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G006)           @MAX
+ eval    ATIME    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ regrid  ATIME    M:299 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset		! reordered reset before next test: 2/94
+cancel mode verify
+GO bn_axis_limits	! added 10/27/93
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! added 2/94
+ 
+!GO bn_reset
+!GO bn301_mem_mgmt
+MESSAGE/CONTINUE  ***** bn301_mem_mgmt has been removed from run_all.
+***** bn301_mem_mgmt has been removed from run_all.
+MESSAGE/CONTINUE  ***** Its too slow!!!
+***** Its too slow
+MESSAGE/CONTINUE  ***** Remember to run it separately
+***** Remember to run it separately
+ 
+GO bn_reset
+cancel mode verify
+GO bn_movie
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+ 
+! added in bn311
+GO bn_reset
+cancel mode verify
+GO bn_ez_order	! was bn311 until 9/95
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+              1        2     
+              1        2
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+ ---- K:2 Z:   2
+ 1   / 1:     ....     ....
+ 2   / 2:     ....     ....
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.20000
+ 2   / 2:  0.30000  0.40000
+ ---- K:2 Z:   2
+ 1   / 1:  0.50000  0.60000
+ 2   / 2:  0.70000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.00000
+ 2   / 2:  1.10000  1.20000
+ ---- K:2 Z:   2
+ 1   / 1:  1.30000  1.40000
+ 2   / 2:  1.50000  1.60000
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.50000
+ 2   / 2:  0.20000  0.60000
+ ---- K:2 Z:   2
+ 1   / 1:  0.30000  0.70000
+ 2   / 2:  0.40000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.30000
+ 2   / 2:  1.00000  1.40000
+ ---- K:2 Z:   2
+ 1   / 1:  1.10000  1.50000
+ 2   / 2:  1.20000  1.60000
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.020000
+ 2   / 2:  0.030000  0.040000
+ ---- K:2 Z:   2
+ 1   / 1:  0.050000  0.060000
+ 2   / 2:  0.070000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.100000
+ 2   / 2:  0.110000  0.120000
+ ---- K:2 Z:   2
+ 1   / 1:  0.130000  0.140000
+ 2   / 2:  0.150000  0.160000
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.050000
+ 2   / 2:  0.020000  0.060000
+ ---- K:2 Z:   2
+ 1   / 1:  0.030000  0.070000
+ 2   / 2:  0.040000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.130000
+ 2   / 2:  0.100000  0.140000
+ ---- K:2 Z:   2
+ 1   / 1:  0.110000  0.150000
+ 2   / 2:  0.120000  0.160000
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  1367.00
+ 2   / 2:  2357.00  2367.00
+ ---- K:2 Z:   2
+ 1   / 1:  1457.00  1467.00
+ 2   / 2:  2457.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  1368.00
+ 2   / 2:  2358.00  2368.00
+ ---- K:2 Z:   2
+ 1   / 1:  1458.00  1468.00
+ 2   / 2:  2458.00  2468.00
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+ 
+! added in bn312  6/3/94
+GO bn_reset
+cancel mode verify
+! cancel mode metafile   ! needed temporarily 6/94: PLOT+/XGKS interaction bug
+GO bn_user
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+set window 1		! clean up
+ 
+! added in bn420  1/96
+GO bn_reset
+cancel mode verify
+GO bn_stream
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:   1.0000   2.0000   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000  17.0000  18.0000  19.0000  20.0000
+ 3   / 3:  21.0000  22.0000  23.0000  24.0000  25.0000  26.0000  27.0000  28.0000  29.0000  30.0000
+ 4   / 4:  31.0000  32.0000  33.0000  34.0000  35.0000  36.0000  37.0000  38.0000  39.0000  40.0000
+ 5   / 5:  41.0000  42.0000  43.0000  44.0000  45.0000  46.0000  47.0000  48.0000  49.0000  50.0000
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+              MYV1    MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.0000  31.0000
+2    /  2:  12.0000  32.0000
+3    /  3:  13.0000  33.0000
+4    /  4:  14.0000  34.0000
+5    /  5:  15.0000  35.0000
+6    /  6:  16.0000  36.0000
+7    /  7:  17.0000  37.0000
+8    /  8:  18.0000  38.0000
+9    /  9:  19.0000  39.0000
+10   / 10:  20.0000  40.0000
+ ---- J:2 Y:   2
+1    /  1:  21.0000  41.0000
+2    /  2:  22.0000  42.0000
+3    /  3:  23.0000  43.0000
+4    /  4:  24.0000  44.0000
+5    /  5:  25.0000  45.0000
+6    /  6:  26.0000  46.0000
+7    /  7:  27.0000  47.0000
+8    /  8:  28.0000  48.0000
+9    /  9:  29.0000  49.0000
+10   / 10:  30.0000  50.0000
+cancel data stream_data_link.unf
+ 
+ 
+!added in bn430 9/96 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_mc
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     T (hour)             6 r   366                  4018.4
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              730.485    731.2425
+       3>  1826.97               730.485    1461.727
+       4>  2557.455              730.485    2192.213
+       5>  3287.94               730.485    2922.698
+       6>  4018.425              730.485    3653.183
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 1827   / 3:  28.2710  28.1010  27.1568  26.6065  26.5793  27.1318  27.1135  27.1007
+ 2557.5 / 4:  28.3570  28.5412  27.6643  27.2819  27.1998  27.4282  27.5459  27.4002
+ 3287.9 / 5:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+ 4018.4 / 6:  28.0824  27.9723  27.7204  26.8768  26.9810  27.7220  28.0643  27.8845
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 1827   / 3:  27.9375  27.9731  27.8331  27.5333  27.0461  27.2091  27.2154  27.0734  26.8618  26.6585
+ 2557.5 / 4:  27.9532  27.8072  27.9180  27.9515  27.7807  27.6695  27.5253  27.3922  27.3396  27.2409
+ 3287.9 / 5:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 4018.4 / 6:  28.1912  28.2880  28.4249  28.1785  27.8359  27.8262  27.5394  27.3811  27.1444  27.0317
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     T (hour)             3 i   366                  3287.9
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              1460.97    731.2425
+       3>  3287.94               2191.455   2192.213
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 3287.9 / 3:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 3287.9 / 3:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-T (hour))
+      ... listing every  14th point
+                21E      49E      77E     105E     133E     161E     171W     143W     115W      87W      59W      31W      3W     
+                 1       15       29       43       57       71       85       99      113      127      141      155      169
+ ---- L:1 T:   366
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75N   / 83:   1.5550     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73N   / 82:   3.7205   0.5871     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.0000
+ 71N   / 81:   5.0934   0.6186     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   4.1287
+ 69N   / 80:   5.4500   0.4500     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.0000   4.8885
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   4.3120   4.5952
+ 65N   / 78:   0.0718     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.8767   5.0952   5.2194
+ 63N   / 77:   0.5111     ....     ....     ....     ....     ....  -0.8467     ....     ....     ....   0.8500   5.9579   6.4264
+ 61N   / 76:   1.2269     ....     ....     ....     ....   0.3500   0.1214   6.0000     ....     ....   0.8000   6.2213   8.1800
+ 59N   / 75:   2.9000     ....     ....     ....     ....   1.1500   1.6321   5.7458     ....     ....   2.7033   7.3962   7.6307
+ 57N   / 74:   3.0388     ....     ....     ....     ....   1.1250   2.8750   5.2914     ....     ....   0.5308   7.5317   6.4543
+ 55N   / 73:   3.2013     ....     ....     ....     ....   0.6459   3.6936   5.2583     ....     ....  -0.4622   7.4551   6.5806
+ 53N   / 72:     ....     ....     ....     ....     ....   1.1996   4.2880   5.7998     ....     ....   1.2333   7.7514   7.1047
+ 51N   / 71:     ....     ....     ....     ....     ....   2.1893   4.2290   6.2278     ....     ....  -0.2905  10.2702   9.3957
+ 49N   / 70:     ....     ....     ....     ....     ....   2.5412   4.6069   6.6250     ....   3.0125   0.6527  11.6186  10.2970
+ 47N   / 69:     ....     ....     ....     ....     ....   2.9602   5.5956   7.6881     ....   3.1794   1.2426  12.6823  11.3385
+ 45N   / 68:     ....   3.3167     ....     ....     ....   4.4480   7.0744   8.9556     ....   3.4525   2.2314  13.7819  12.2254
+ 43N   / 67:     ....   4.7221     ....     ....   2.4068   6.9255   8.9646  10.3486     ....   3.1277   6.3709  14.7211  13.0557
+ 41N   / 66:     ....   4.8365     ....     ....   4.3635   9.6898  10.9751  11.9288     ....     ....  15.5498  15.4318     ....
+ 39N   / 65:  15.4366   8.6262     ....     ....   8.8837  12.8097  12.5484  13.4077     ....     ....  18.6870  16.2119     ....
+ 37N   / 64:  16.0318   8.0667     ....     ....  12.3600  15.0324  13.9800  15.0021     ....     ....  19.2616  17.1874  15.1152
+ 35N   / 63:  16.2507     ....     ....     ....  13.3810  16.7364  15.4538  16.4689     ....     ....  19.5398  18.1828  15.5754
+ 33N   / 62:  16.7783     ....     ....     ....  18.5491  18.0244  16.8419  17.7790     ....     ....  20.1041  19.2886     ....
+ 31N   / 61:  17.9786     ....     ....     ....  19.9407  19.3074  18.5523  19.1648  17.8500  17.4183  20.8400  20.0450     ....
+ 29N   / 60:     ....  18.9119     ....     ....  20.5019  20.6291  20.1257  20.1026  16.8274  20.6176  22.0740  20.6790     ....
+ 27N   / 59:     ....  20.8300     ....     ....  21.3326  22.0026  21.6086  20.9032  17.8323  23.7582  23.1533  21.5070     ....
+ 25N   / 58:     ....     ....     ....     ....  22.3495  23.8248  23.2779  21.5841  18.8269  24.8593  24.0919  22.3336     ....
+ 23N   / 57:     ....     ....     ....     ....  23.6807  25.0783  24.0186  22.3034  20.2700  25.5195  24.7930  22.7905     ....
+ 21N   / 56:     ....     ....     ....     ....  24.7072  25.9688  24.7256  22.9079  22.0270  26.4860  25.3493  22.9386     ....
+ 19N   / 55:     ....     ....     ....  22.6383  25.9015  26.6802  25.6078  23.5313  23.8074  27.0339  25.8612  23.4342     ....
+ 17N   / 54:     ....     ....     ....     ....  26.8579  27.0091  25.9585  24.1694  25.2841  27.0695  26.1928  23.8282     ....
+ 15N   / 53:     ....  25.4074     ....     ....  27.4243  27.0312  26.1212  24.8069  26.3029  26.9280  26.3665  24.2289     ....
+ 13N   / 52:     ....  25.3684     ....     ....  27.7591  27.2962  26.4994  25.1181  26.6522  26.8229  26.6502  24.8118     ....
+ 11N   / 51:     ....  25.8188  27.8253  27.8789  27.8781  27.9126  26.8606  25.7058  27.0455  26.2577  26.8927  25.3867     ....
+ 9N    / 50:     ....  27.2000  27.8411  26.3897  28.1118  28.0045  27.4964  26.6136  26.7775  26.8093  27.0323  25.9038     ....
+ 7N    / 49:     ....  26.1127  27.5677  26.0238  28.0494  28.7383  27.8221  27.0807  26.9304  27.5097  26.8869  26.5924     ....
+ 5N    / 48:     ....  26.1020  27.8127  26.5939  28.3079  28.7465  28.1379  27.1305  27.5967  27.5257     ....  26.9872  27.8152
+ 3N    / 47:     ....  26.2525  27.9241  26.8579  28.5464  28.9967  27.6071  26.2341  25.5129  27.0847     ....  27.0516  28.3003
+ 1N    / 46:     ....  26.4437  28.2462  27.2532  28.7823  28.7893  27.5856  25.9683  24.2075  25.8155     ....  27.0482  27.9197
+ 1S    / 45:     ....  27.0068  28.1397  27.7957  28.9633  29.1200  27.9352  26.0170  24.4768  24.9226     ....  27.0957  27.0229
+ 3S    / 44:     ....  27.6137  28.2304  27.5868  28.9390  29.4694  27.9904  26.2519  24.6900  24.9094     ....  27.1568  26.8912
+ 5S    / 43:     ....  28.2419  28.1710  28.0148  28.8535  29.6225  28.6900  26.6985  24.8254  25.1700     ....  27.1489  26.2070
+ 7S    / 42:     ....  28.7080  28.1502  28.3020  28.9045  29.3650  29.1496  27.0025  25.1069  24.9153     ....  27.3142  25.4034
+ 9S    / 41:     ....  28.4648  28.3721  28.3145  28.9483  29.3450  28.9944  28.0900  25.3219  24.4950     ....  27.2335  24.8536
+ 11S   / 40:     ....  28.0725  28.3709  28.1023  29.6033  29.3462  29.1837  28.2076  25.4194  24.1157     ....  27.2170  24.0960
+ 13S   / 39:     ....  28.1510  28.0187  27.8073  30.0000  29.1755  29.0507  28.1889  25.3569  23.7371     ....  27.3476  23.4967
+ 15S   / 38:     ....  28.0800  27.7714  27.2320     ....  28.6954  28.8358  28.2165  25.5737  22.9877     ....  27.0100  23.0127
+ 17S   / 37:     ....  28.2857  26.9409  26.4882     ....  28.2425  28.1673  27.9296  25.5046  22.3944     ....  26.7405  22.9133
+ 19S   / 36:     ....  27.6122  26.1967  25.0514     ....  27.7552  27.8560  27.5000  25.4854  21.0467     ....  26.6053  22.7264
+ 21S   / 35:     ....  27.5942  25.6929  24.4583     ....  26.3083  26.9939  27.2162  25.5969  21.8550     ....  26.4333  22.5890
+ 23S   / 34:     ....  27.0610  25.3542  23.6893     ....  26.0250  26.0238  26.6869  25.5377  21.5647     ....  26.5500  22.9482
+ 25S   / 33:     ....  26.6974  25.2817  22.6691     ....  25.5528  25.4389  25.4775  25.2041  21.3664     ....  25.4338  23.1510
+ 27S   / 32:     ....  25.8897  24.5000  22.1500     ....  24.8603  24.1297  24.3742  24.8067  21.0300     ....  24.8628  22.9100
+ 29S   / 31:     ....  24.6453  23.8583  21.1592     ....  24.0408  23.2608  23.1950  24.4300  21.1500     ....  23.4096  22.5004
+ 31S   / 30:     ....  23.8611  22.6739  20.5028     ....  23.2794  21.8597  21.8462  22.7130  21.3700     ....  22.5936  22.0041
+ 33S   / 29:     ....  22.1584  21.2131  19.2542  18.8470  22.4742  20.8053  20.6944  22.4667  20.3670     ....  20.5743  20.8167
+ 35S   / 28:  21.0773  20.5794  19.8725  18.4359  18.1523  22.1463  20.1823  19.6000  20.4500  19.2450  21.7333  19.9441  19.5977
+ 37S   / 27:  21.2868  19.1969  17.8018  16.7463  16.9175  20.0833  19.0935  18.1643  18.1575  18.4543     ....  18.6379  17.6856
+ 39S   / 26:  20.7459  17.5123  15.9600  14.8400  16.3010  18.3956  18.3997  16.9135  16.9625  17.0514  18.6879  16.7446  15.4764
+ 41S   / 25:  16.4473  14.4439  14.4573  13.5944  14.4030  17.4141  17.2206  15.2329     ....  15.7317  16.7885  14.7942  12.6567
+ 43S   / 24:  14.3660   8.5494  12.8214  11.9753  13.3524  15.0229  16.4218  13.6950     ....  13.6375  13.9769  12.5075  10.4100
+ 45S   / 23:   8.4925   7.5150  11.1860  10.5093  11.8445  13.9774  14.9780  13.0112     ....  12.0000  12.2990  10.5100   7.9967
+ 47S   / 22:   6.0621   5.7733   7.4400   9.0110  10.8888  13.2065  13.4630  11.6550     ....  10.2400  11.1783   8.6200   6.4500
+ 49S   / 21:   4.4209   4.2067   6.0325   6.1945   9.7129  10.8775  12.9344     ....     ....   9.3675  10.3435   5.2987   4.5450
+ 51S   / 20:   1.8375   3.6387   3.1564   5.7656   8.0480  10.0143  11.0070  10.9750     ....   9.2000   9.8156   3.6350   2.5350
+ 53S   / 19:   1.0891   2.8667   2.1950   4.1600   6.5630   9.4455   9.7660     ....     ....   8.5500   8.5604   2.1900   1.0550
+ 55S   / 18:   0.6469   2.6750   2.3478   4.1000   5.1560   6.5700   8.0000     ....   7.8000   7.8786   6.9458   1.3933   0.5425
+ 57S   / 17:   0.4114   2.0529   1.8425   2.4260   4.2929   4.7383   7.0125   3.9825     ....   6.8667   5.7852   0.7771   0.5529
+ 59S   / 16:   0.6236   1.3700   1.4776   2.0189   3.2000   4.0325   4.4000   1.8360     ....   6.5150   2.7940   0.0694   0.0558
+ 61S   / 15:   0.8438   1.3312   1.2144   1.2400   1.9900   2.2237   3.2143   0.8080   3.6867     ....   1.6781   0.0830   0.6620
+ 63S   / 14:   0.8813   0.7700   1.1575   0.4750   1.2344   1.1619   1.6000   0.5280   2.3275   3.4000   1.1667  -0.3333   0.4050
+ 65S   / 13:   0.3667  -0.0356   0.8123   0.0871   0.1521   0.3286   0.5200   0.4550   0.5067   1.8325  -0.9000  -0.5500   0.2060
+ 67S   / 12:  -0.6667  -0.9250   0.5317     ....     ....  -0.3906  -0.0233  -1.2000  -0.1537   0.8722     ....  -0.2533   0.2300
+ 69S   / 11:   0.0425     ....   1.2033     ....     ....  -0.6200  -0.1364     ....  -0.4150   0.1786     ....   0.5000   0.0700
+ 71S   / 10:     ....     ....     ....     ....     ....     ....  -0.7040   0.0000     ....     ....     ....  -1.0167  -1.0100
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -0.3500     ....     ....     ....     ....  -1.2000     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -1.1750     ....     ....     ....     ....  -0.4233     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6250     ....     ....     ....     ....  -0.8678     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:2 T:   1096.5
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.0000
+ 75N   / 83:   2.5283     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -1.5500
+ 73N   / 82:   4.0984   0.3050     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.1087
+ 71N   / 81:   4.6724   0.1046     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.7960
+ 69N   / 80:   4.1971   0.0000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.8097
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   3.7596   4.3979
+ 65N   / 78:  -0.0625     ....     ....     ....     ....     ....  -0.2000     ....     ....     ....   0.4221   4.4633   4.8655
+ 63N   / 77:   0.0745     ....     ....     ....     ....     ....  -1.7560     ....     ....     ....  -0.2712   5.8617   6.3740
+ 61N   / 76:   0.4814     ....     ....     ....     ....   2.4947  -1.5404   4.7000     ....     ....   2.1750   6.4468   7.9008
+ 59N   / 75:   1.6399     ....     ....     ....     ....   2.0000   0.0008   5.2586     ....     ....   1.3824   7.0788   6.9452
+ 57N   / 74:   2.0350     ....     ....     ....     ....   1.0500   2.0321   4.7989     ....     ....   1.5986   7.2850   5.6111
+ 55N   / 73:   2.0609     ....     ....     ....     ....   0.2492   3.3744   4.9032     ....     ....   1.1250   7.1357   5.8718
+ 53N   / 72:     ....     ....     ....     ....     ....   0.6807   3.7572   5.4648     ....     ....  -2.2000   7.5902   6.5032
+ 51N   / 71:     ....     ....     ....     ....     ....   1.6469   3.7090   5.7799     ....     ....  -1.1807  10.0328   8.4741
+ 49N   / 70:     ....     ....     ....     ....     ....   1.8588   4.3120   6.2452     ....     ....  -0.3648  11.3871   9.5089
+ 47N   / 69:     ....     ....     ....     ....     ....   2.3163   5.1206   7.3744     ....   1.9691  -0.0062  12.2219  10.1338
+ 45N   / 68:     ....   3.6500     ....     ....     ....   3.6392   6.7455   8.6209     ....   2.8224   0.9671  13.4022  11.7268
+ 43N   / 67:     ....   4.6473     ....     ....   1.3648   5.8679   8.5111   9.8453     ....   2.4835   5.0119  14.2248  12.1942
+ 41N   / 66:     ....   4.7861     ....     ....   3.0570   8.4719  10.3051  11.4213     ....     ....  14.7565  15.0002     ....
+ 39N   / 65:  15.0270   8.4385     ....     ....   7.3566  11.4912  12.1752  12.8504     ....     ....  18.0116  15.7098     ....
+ 37N   / 64:  15.3211     ....     ....     ....  10.8839  13.7783  13.3446  14.3616     ....     ....  18.5301  16.5598  14.7798
+ 35N   / 63:  15.5386     ....     ....     ....  11.5113  15.5093  14.6245  15.8741     ....     ....  18.7629  17.4589  15.1510
+ 33N   / 62:  16.0085     ....     ....     ....  18.0727  16.9360  16.0912  17.1296     ....     ....  19.2839  18.5539     ....
+ 31N   / 61:  15.5003     ....     ....     ....  19.3688  18.1290  17.7404  18.4996  16.6805  17.1886  20.0995  19.3186     ....
+ 29N   / 60:     ....  17.9540     ....     ....  19.6179  19.5035  19.2114  19.5065  16.2029  20.0335  21.3973  20.0384     ....
+ 27N   / 59:     ....  19.2895     ....     ....  20.5089  21.1212  20.6266  20.3709  17.2076  23.4895  22.6302  20.8561     ....
+ 25N   / 58:     ....     ....     ....     ....  21.6717  22.9821  22.7977  21.2932  18.4958  24.6577  23.6045  21.6921     ....
+ 23N   / 57:     ....     ....     ....     ....  23.0715  24.4551  23.5951  22.2253  19.8338  25.2474  24.2970  22.1740     ....
+ 21N   / 56:     ....     ....     ....     ....  24.4908  25.3921  24.3804  22.7672  21.2780  25.9320  24.9042  22.6199     ....
+ 19N   / 55:     ....     ....     ....  21.9809  25.6218  26.2087  25.0433  23.4827  23.0766  26.7496  25.4450  22.7637     ....
+ 17N   / 54:     ....     ....     ....     ....  26.5571  26.5915  25.7194  24.1352  24.9649  26.7912  25.7799  22.9853     ....
+ 15N   / 53:     ....  25.4092     ....     ....  27.2200  26.8560  25.9733  24.7324  26.0247  26.0114  26.0969  23.6629     ....
+ 13N   / 52:     ....  25.4771     ....     ....  27.5037  27.5150  26.1672  25.1314  26.5769  26.9127  26.4016  24.1635     ....
+ 11N   / 51:     ....  25.9857  28.0015  26.7764  27.5853  27.5652  26.8019  25.7690  27.0738  26.0525  26.6473  24.7404     ....
+ 9N    / 50:     ....  26.4544  28.2288  26.5501  27.7983  28.1491  27.4758  26.8996  26.9893  26.8687  26.7045  25.5850     ....
+ 7N    / 49:     ....  26.2609  27.8816  26.4870  27.6868  28.5162  27.7850  27.0898  27.0539  28.0777  26.7957  26.6243     ....
+ 5N    / 48:     ....  26.4131  27.9713  26.8734  27.7794  28.6949  27.8279  26.7964  26.6060  28.0647     ....  26.8913  28.0427
+ 3N    / 47:     ....  26.5913  28.1749  26.9865  28.4875  29.1712  27.8616  26.6257  26.2312  27.7434     ....  27.1225  28.5353
+ 1N    / 46:     ....  26.8491  28.6115  27.3775  28.2466  28.9555  27.5331  26.4050  26.4266  26.5208     ....  27.2455  28.5152
+ 1S    / 45:     ....  27.3064  28.4080  27.9040  28.4680  29.2010  27.7261  26.4751  24.6569  26.0235     ....  27.4196  27.9833
+ 3S    / 44:     ....  27.9602  28.2742  28.3296  28.8893  29.5794  28.3834  26.5213  25.4925  26.6125     ....  27.6638  27.3859
+ 5S    / 43:     ....  28.2396  28.0572  28.3176  28.7901  29.3721  28.2957  26.7982  25.7981  26.6252     ....  27.6334  27.2052
+ 7S    / 42:     ....  28.6815  28.2612  28.2786  28.7463  29.4168  28.8967  27.4410  26.1729  26.5534     ....  27.7374  26.6993
+ 9S    / 41:     ....  28.4790  28.3137  28.5841  28.7040  29.4256  29.1270  28.3372  25.9400  25.9795     ....  27.6607  26.1480
+ 11S   / 40:     ....  28.2829  28.6414  28.3339  29.3503  29.1771  29.1492  28.2032  25.9871  25.9624     ....  27.5419  25.5310
+ 13S   / 39:     ....  28.3226  28.3738  28.5679     ....  29.0269  29.1852  28.3130  25.7940  25.0490     ....  27.3347  25.0641
+ 15S   / 38:     ....  27.6600  28.2896  27.7713     ....  28.8387  29.0820  28.4626  25.9384  24.0311     ....  27.4378  24.5993
+ 17S   / 37:     ....  28.0370  27.5108  27.3368     ....  28.5764  28.4527  27.9555  26.0744  23.1143     ....  27.5051  24.0454
+ 19S   / 36:     ....  27.7741  27.0157  26.4074     ....  28.0387  28.2036  28.0002  26.1485  23.5125     ....  27.4665  23.8172
+ 21S   / 35:     ....  27.5781  26.3341  25.2805     ....  26.9356  27.5820  27.6097  26.0473  22.5984     ....  27.0379  23.6919
+ 23S   / 34:     ....  27.4302  26.2267  24.4780     ....  26.2735  26.9770  26.9149  25.9504  22.6780     ....  27.2712  23.6569
+ 25S   / 33:     ....  27.1106  25.3692  23.3572     ....  25.8933  25.9116  26.4028  25.5674  21.8153     ....  26.4321  23.8424
+ 27S   / 32:     ....  26.2136  25.2324  22.5225     ....  25.1302  24.7613  25.0533  25.4781  22.3270     ....  26.0936  23.3768
+ 29S   / 31:     ....  25.1187  23.9464  21.6124     ....  24.6507  24.1035  24.0470  24.7712  21.6070     ....  25.1327  23.1977
+ 31S   / 30:     ....  24.1655  22.8869  20.9082     ....  23.9437  22.8024  22.8395  23.8185  21.6885     ....  23.6302  22.7434
+ 33S   / 29:     ....  23.0193  21.8809  19.7883  19.8276  23.0018  21.7527  21.3169  21.5627  21.0475     ....  22.6172  21.4319
+ 35S   / 28:  20.9734  21.1547  20.7043  18.8851  18.9300  22.5357  20.8505  20.5353  22.0240  20.2323  22.8700  20.8750  20.1989
+ 37S   / 27:  21.7237  19.9086  18.4469  17.2227  17.7141  20.7386  19.8244  18.3687  19.8411  19.7704     ....  19.5269  18.6070
+ 39S   / 26:  22.0397  18.3765  16.5437  15.5140  17.0989  19.0830  18.8514  17.5866     ....  18.7405  19.1255  18.2102  15.7730
+ 41S   / 25:  17.8526  16.3651  15.5023  14.2290  15.4274  17.6752  17.4792  15.9576  18.1650  17.1268  17.4312  16.4894  13.9250
+ 43S   / 24:  13.4949   9.2836  13.3727  12.3420  13.9432  16.1595  17.0221  14.6650  16.3947  14.2424  14.2672  14.1820  10.6937
+ 45S   / 23:   8.3840   7.6307  11.6679  11.2457  12.8452  14.4788  15.0178  13.5082     ....  12.0600  12.7115  10.9652   8.1250
+ 47S   / 22:   6.7167   6.0540   8.2500   9.1190  10.9825  12.8255  13.8707  12.4650     ....  10.8575  11.1699   8.5767   5.5000
+ 49S   / 21:   4.8858   5.4150   5.9088   6.2255  10.1339  11.2443  12.5930  11.4167     ....  10.0842  10.6338   7.4442   4.9572
+ 51S   / 20:   2.3210   3.9822   3.9846   5.7576   7.7675   9.9738  10.8426  10.1840     ....  10.0000  10.2138   5.1999   3.5755
+ 53S   / 19:   1.6715   3.2515   2.9610   4.1500   6.9224   8.5819   9.1357     ....     ....   8.1500   8.4738   3.8071   2.1017
+ 55S   / 18:   1.3318   3.1000   2.6454   3.0000   5.7914   6.1994   7.9489   6.6000     ....   7.7692   7.2001   1.8440   1.0135
+ 57S   / 17:   0.9767   1.9018   1.9953   2.7540   5.2543   4.5237   6.5740   3.7000     ....   7.5635   6.0275   1.7052   1.1491
+ 59S   / 16:   1.1588   2.1100   1.9107   2.7212   3.8002   3.8360   4.9089   1.7892     ....   6.7092   3.6242   1.2592   0.7025
+ 61S   / 15:   0.9937   1.7382   1.5836   2.3000   3.0766   2.3196   3.4012   1.9993     ....   4.4088   2.4941   0.0903   0.4673
+ 63S   / 14:   1.0650   1.2982   1.6343   1.2108   1.5136   1.6090   1.8151   1.2050     ....   3.1150   1.2840   0.3114   0.9075
+ 65S   / 13:   0.6686   0.1303   0.8185   0.2022   0.5104   0.3644   1.0079   0.2598   1.8500   1.8860   0.7000   0.0021   0.9191
+ 67S   / 12:   0.4623  -0.5492   0.0874     ....     ....  -0.0052  -0.2830  -0.0203   1.1982   0.4323  -0.5000   0.2120  -0.0205
+ 69S   / 11:  -0.3438     ....  -0.2335     ....     ....  -1.3365  -0.1277     ....  -0.2716  -0.3135     ....  -0.7000  -0.2723
+ 71S   / 10:     ....     ....     ....     ....     ....  -1.6000  -1.0248     ....  -1.0000     ....     ....  -1.5633  -0.9349
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -1.0216     ....     ....     ....     ....  -1.4771     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -0.6115     ....     ....     ....  -1.6061  -1.2224     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6974     ....     ....     ....     ....  -1.3728     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:3 T:   3287.9
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:   2.5000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.3750
+ 77N   / 84:   3.4400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6250
+ 75N   / 83:   2.6000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.8460
+ 73N   / 82:   4.4409   0.5100     ....     ....     ....     ....     ....     ....     ....     ....  -1.3667     ....  -0.8225
+ 71N   / 81:   5.4388   0.3400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.6240
+ 69N   / 80:   5.9773     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   7.0333   5.7596
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6000   6.2775   5.0971
+ 65N   / 78:   1.4558     ....     ....     ....     ....     ....  -0.2350     ....     ....     ....  -0.0333   5.5736   5.9673
+ 63N   / 77:   3.4200     ....     ....     ....     ....     ....   0.6400     ....     ....     ....  -1.6700   6.6186   7.9123
+ 61N   / 76:   3.4160     ....     ....     ....     ....   2.5655   0.7717   6.6667     ....     ....   1.8667   7.0529   8.8649
+ 59N   / 75:   5.6405     ....     ....     ....     ....   2.0611   0.9867   6.9750     ....     ....   2.0100   7.4621   8.4868
+ 57N   / 74:   5.9800     ....     ....     ....     ....   3.0850   2.7321   6.8916     ....     ....   0.9500   8.2306   8.5784
+ 55N   / 73:   8.0252     ....     ....     ....     ....   2.3115   4.5506   6.4479     ....     ....   3.7000   8.3973   9.5559
+ 53N   / 72:     ....     ....     ....     ....     ....   2.6937   4.8088   6.7680     ....     ....   2.8900   9.2218  10.4003
+ 51N   / 71:     ....     ....     ....     ....     ....   3.2503   4.9117   6.8015     ....     ....   2.5529  11.3034  10.8005
+ 49N   / 70:     ....     ....     ....     ....     ....   3.0545   5.1517   7.2869     ....   2.7152   3.2139  12.3364  11.3225
+ 47N   / 69:     ....   2.7000     ....     ....     ....   3.3659   5.8927   8.3193     ....   2.7223   3.4114  13.6252  13.5042
+ 45N   / 68:     ....  10.0571     ....     ....     ....   4.8410   7.4161   9.4102     ....   3.6258   3.8275  14.6266  14.1615
+ 43N   / 67:     ....  12.7416     ....     ....   6.7189   6.9232   9.1093  10.6638     ....   4.2112   7.7514  15.5934  14.2717
+ 41N   / 66:     ....  12.2736     ....     ....   9.4889  10.0966  11.2221  12.2000     ....   7.4752  17.0025  16.5220     ....
+ 39N   / 65:  18.3061  17.6344     ....     ....  13.1272  13.1707  13.2898  13.6927     ....     ....  20.0227  17.1398     ....
+ 37N   / 64:  18.5141  17.9063     ....     ....  15.3549  15.3983  15.0444  15.3707     ....     ....  20.4579  18.0923  17.5707
+ 35N   / 63:  18.7384     ....     ....     ....  16.8426  17.6000  16.7552  16.7829     ....     ....  20.4300  19.0107  17.7344
+ 33N   / 62:  18.9508     ....     ....     ....  21.5277  18.7307  18.1471  17.9534     ....     ....  21.0125  20.0088     ....
+ 31N   / 61:  18.7025     ....     ....     ....  22.5800  20.5256  20.0583  19.4733  17.4200  24.2768  21.8716  20.6057     ....
+ 29N   / 60:     ....  25.7695     ....     ....  22.5733  22.5723  21.6635  20.2684  16.2180  24.9511  23.1845  21.2752     ....
+ 27N   / 59:     ....  25.4122     ....     ....  23.6602  24.0498  22.5812  21.2723  16.7570  26.3925  24.2020  21.7641     ....
+ 25N   / 58:     ....     ....     ....     ....  25.2143  25.5321  24.3246  21.9995  17.9540  26.9720  24.9484  22.4602     ....
+ 23N   / 57:     ....     ....     ....     ....  26.6917  26.0579  24.8529  22.5776  20.2795  27.1909  25.5700  22.9362     ....
+ 21N   / 56:     ....     ....     ....     ....  27.8576  26.6563  25.3957  23.1102  22.1345  27.7200  26.0730  23.0700     ....
+ 19N   / 55:     ....     ....     ....  26.8300  28.4227  27.1402  25.9305  23.6595  23.7516  28.1905  26.6716  23.3293     ....
+ 17N   / 54:     ....     ....     ....     ....  28.8737  27.3141  26.3835  24.2809  25.2149  28.3251  27.0405  23.5656     ....
+ 15N   / 53:     ....  29.6770     ....     ....  29.0020  27.5648  26.8352  25.0370  26.4873  28.2522  27.1788  24.0619     ....
+ 13N   / 52:     ....  29.7957     ....     ....  29.0452  27.9505  26.9712  25.7979  27.9270  29.0510  27.4940  24.9544     ....
+ 11N   / 51:     ....  29.9600  29.6100  29.9485  29.1975  28.5281  27.2419  26.2275  28.2569  28.6935  27.4943  25.4832     ....
+ 9N    / 50:     ....  29.0000  29.2055  29.9940  29.1339  28.5629  28.0300  26.8865  28.1333  28.7602  27.5655  26.2932     ....
+ 7N    / 49:     ....  28.0975  29.2157  29.8208  29.1260  28.9489  28.3765  27.6896  27.9185  28.6481  27.8075  26.9731     ....
+ 5N    / 48:     ....  28.5837  28.9960  29.6031  29.2848  28.8200  28.2841  28.0367  28.0050  28.1459     ....  27.4683  28.6742
+ 3N    / 47:     ....  28.8228  28.8738  29.6720  29.1708  29.1114  27.9356  27.4223  27.0792  27.4624     ....  27.7005  28.7616
+ 1N    / 46:     ....  28.9241  28.9488  29.6711  29.2204  29.2053  27.9759  26.7708  26.2331  24.6843     ....  27.7243  28.5300
+ 1S    / 45:     ....  28.8412  28.8305  29.7569  29.3532  29.1575  28.6016  27.3479  26.1727  23.7911     ....  27.7941  27.3629
+ 3S    / 44:     ....  28.7131  28.7504  29.7065  28.8744  29.3853  29.0300  27.7041  26.2321  24.2555     ....  27.9582  27.0115
+ 5S    / 43:     ....  28.2603  28.5437  29.3988  28.6953  29.4181  29.4700  28.0004  26.6977  25.2607     ....  28.0911  26.9673
+ 7S    / 42:     ....  28.4590  28.1998  29.0577  28.3900  29.3039  29.4132  28.1829  26.9186  25.5194     ....  28.0741  26.4868
+ 9S    / 41:     ....  27.4126  27.8088  28.6505  28.0595  29.3987  29.4488  28.6235  26.8222  25.9759     ....  27.9426  25.9048
+ 11S   / 40:     ....  27.3103  27.5905  28.4839  28.4948  28.7670  29.4367  28.7400  26.7212  25.1000     ....  27.5707  25.3691
+ 13S   / 39:     ....  27.6357  27.1885  28.1500  29.0750  28.2963  29.0007  28.3957  26.0152  23.9237     ....  27.2888  23.9450
+ 15S   / 38:     ....  27.4167  26.8054  27.3040     ....  27.6349  28.8591  28.2997  25.6416  22.9757     ....  26.8832  23.2593
+ 17S   / 37:     ....  26.5750  26.3315  26.3547     ....  26.9741  27.8112  27.7504  25.2758  22.2731     ....  26.9240  22.9660
+ 19S   / 36:     ....  26.3800  25.6018  25.5118     ....  26.2589  26.8355  27.3067  25.1597  21.8636     ....  26.4242  22.7498
+ 21S   / 35:     ....  26.3962  24.9433  24.4010     ....  25.0882  26.0626  26.7074  25.1090  21.2900     ....  26.0265  22.2924
+ 23S   / 34:     ....  25.5153  23.9938  23.6290     ....  23.7930  24.8873  25.7890  24.6791  21.6500     ....  25.0545  22.3546
+ 25S   / 33:     ....  25.0498  23.4605  22.4263     ....  23.5336  23.1886  24.5767  23.8922  21.0542     ....  24.0368  22.0510
+ 27S   / 32:     ....  24.0579  22.4800  21.3337     ....  22.9638  22.6794  22.9685  23.3845  20.5250     ....  23.4248  21.4712
+ 29S   / 31:     ....  22.2597  20.8924  20.4105     ....  22.1940  21.7986  21.7838  22.1056  20.3556     ....  22.2542  20.3204
+ 31S   / 30:     ....  21.4554  20.1326  19.0221     ....  21.7333  20.2379  20.6162  21.0963  19.7514     ....  21.3928  19.9943
+ 33S   / 29:     ....  20.1174  18.7177  17.8882  17.9775  20.9526  18.9529  18.9267  19.8433  18.7275     ....  19.5163  19.1597
+ 35S   / 28:  17.4848  19.0512  17.2736  16.4823  17.0525  20.2329  17.9626  17.6227  19.3250  17.7730  18.5000  18.2119  17.9181
+ 37S   / 27:  19.0393  18.4096  15.7970  14.9422  15.5643  18.4488  16.9900  16.4614  16.4140  16.1780     ....  17.4080  16.3346
+ 39S   / 26:  19.3745  17.0241  15.1964  13.3975  14.9817  16.2655  15.9971  15.1350  15.1000  15.0855  13.9982  15.9207  14.3391
+ 41S   / 25:  17.5125  14.8843  13.7848  11.6755  13.7962  15.6597  15.2020  13.3413     ....  13.7836  12.0222  14.1123  13.4425
+ 43S   / 24:  14.8667   8.6540  13.1967  10.4214  12.3867  14.4790  14.1935  12.8180     ....  12.5791   9.4489  13.2311  12.1000
+ 45S   / 23:  14.8333     ....  10.7300  10.0000  10.7150  12.2380  12.7589  11.4000     ....  11.8200   8.4016     ....     ....
+ 47S   / 22:     ....     ....   6.0500     ....     ....  11.8750  11.9511  10.9667     ....   9.6250   7.7883   7.6600     ....
+ 49S   / 21:     ....     ....   5.4000     ....     ....  10.7667  11.0757   9.8500     ....   8.9767   7.4821   6.6840     ....
+ 51S   / 20:     ....     ....   2.5333     ....     ....   8.8000     ....   9.2571     ....   7.6900   7.7200   3.7350     ....
+ 53S   / 19:     ....   3.4133     ....     ....     ....   8.4600     ....     ....   5.0000   6.6850   7.1267   1.1217     ....
+ 55S   / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.5000   6.0667   1.4680     ....
+ 57S   / 17:     ....     ....     ....     ....     ....     ....     ....     ....     ....   5.2000   5.2657   1.0000     ....
+ 59S   / 16:     ....     ....  -0.4400     ....     ....     ....     ....     ....     ....     ....   1.5000  -0.8000     ....
+ 61S   / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.4500     ....     ....
+ 63S   / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.0700     ....     ....     ....
+ 65S   / 13:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 67S   / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 69S   / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 71S   / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73S   /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_negative_t
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.66667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.000000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.0000
+ -2   / 5: -12.0000
+ 0    / 6: -12.0000
+ 2    / 7:  -8.0000
+ 4    / 8:   0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -20.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+ -2   / 5: -40.0000
+ 0    / 6: -40.0000
+ 2    / 7: -36.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.0000
+ -8    /  2: -36.0000
+ -6    /  3: -48.0000
+ -4    /  4: -56.0000
+ -2    /  5: -60.0000
+ 0     /  6: -60.0000
+ 2     /  7: -56.0000
+ 4     /  8: -48.0000
+ 6     /  9: -36.0000
+ 8     / 10: -20.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.000000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -6.00000
+ 0    / 6: -6.00000
+ 2    / 7: -4.00000
+ 4    / 8:  0.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+ -2   / 5: -20.0000
+ 0    / 6: -20.0000
+ 2    / 7: -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.0000
+ -8    /  2: -18.0000
+ -6    /  3: -24.0000
+ -4    /  4: -28.0000
+ -2    /  5: -30.0000
+ 0     /  6: -30.0000
+ 2     /  7: -28.0000
+ 4     /  8: -24.0000
+ 6     /  9: -18.0000
+ 8     / 10: -10.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+ 4    / 8:  6.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.0000
+ -8    /  2:  -6.0000
+ -6    /  3:  -4.0000
+ -4    /  4:  -2.0000
+ -2    /  5:   0.0000
+ 0     /  6:   2.0000
+ 2     /  7:   4.0000
+ 4     /  8:   6.0000
+ 6     /  9:   8.0000
+ 8     / 10:  10.0000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.0000
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.00000
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:  1.00000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.20000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.20000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.20000
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+ 4    / 8:      ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:      ....
+ -6   / 3:      ....
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:      ....
+ -8    /  2:      ....
+ -6    /  3:      ....
+ -4    /  4:  0.100000
+ -2    /  5:  0.900000
+ 0     /  6:      ....
+ 2     /  7:      ....
+ 4     /  8:      ....
+ 6     /  9:      ....
+ 8     / 10:      ....
+ 10    / 11:      ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.00000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  8.00000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.20000
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  9.00000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+ 4    / 8: -2.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -7.00000
+ -4    /  4: -6.00000
+ -2    /  5: -5.00000
+ 0     /  6: -4.00000
+ 2     /  7: -3.00000
+ 4     /  8: -2.00000
+ 6     /  9: -1.00000
+ 8     / 10:  0.00000
+ 10    / 11:  1.00000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1:....
+ 692184   /  2:....
+ 692208   /  3:....
+ 692232   /  4:....
+ 692256   /  5:....
+ 692280   /  6:....
+ 692304   /  7:....
+ 692328   /  8:....
+ 692352   /  9:....
+ 692376   / 10:....
+ 692400   / 11:....
+ 692424   / 12:....
+ 692448   / 13:....
+ 692472   / 14:....
+ 692496   / 15:....
+ 692520   / 16:....
+ 692544   / 17:....
+ 692568   / 18:....
+ 692592   / 19:....
+ 692616   / 20:....
+ 692640   / 21:....
+ 692664   / 22:....
+ 692688   / 23:....
+ 692712   / 24:....
+ 692736   / 25:....
+ 692760   / 26:....
+ 692784   / 27:....
+ 692808   / 28:....
+ 692832   / 29:....
+ 692856   / 30:....
+CANCEL MODE ignore_error
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_xact_regrid
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+ 
+!added in bn450 11/97 *kob*
+! replace w/ bn500 *kob* 5/99
+GO bn_reset
+cancel mode verify
+GO bn_gc_functions
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+               1        2        3        4     
+               1        2        3        4
+ 0.1  / 1:  1.10000  2.10000  3.10000  4.10000
+ 0.2  / 2:  1.20000  2.20000  3.20000  4.20000
+ 0.3  / 3:  1.30000  2.30000  3.30000  4.30000
+ 0.4  / 4:  1.40000  2.40000  3.40000  4.40000
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+               1         2         3         4      
+                1         2         3         4
+ 0.1  / 1:  0.891207  0.863209  0.041581 -0.818277
+ 0.2  / 2:  0.932039  0.808496 -0.058374 -0.871576
+ 0.3  / 3:  0.963558  0.745705 -0.157746 -0.916166
+ 0.4  / 4:  0.985450  0.675463 -0.255541 -0.951602
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.10000
+ 2    /  2:  2.10000
+ 3    /  3:  3.10000
+ 4    /  4:  4.10000
+ 5    /  5:  1.20000
+ 6    /  6:  2.20000
+ 7    /  7:  3.20000
+ 8    /  8:  4.20000
+ 9    /  9:  1.30000
+ 10   / 10:  2.30000
+ 11   / 11:  3.30000
+ 12   / 12:  4.30000
+ 13   / 13:  1.40000
+ 14   / 14:  2.40000
+ 15   / 15:  3.40000
+ 16   / 16:  4.40000
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.45
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.10000
+ 4   / 4:  4.10000
+ 5   / 5:  1.20000
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+               2        3     
+               2        3
+ 0.2  / 2:  2.20000  3.20000
+ 0.3  / 3:  2.30000  3.30000
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.20000
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 4   / 4:  3.30000
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+                1        2        3        4     
+                1        2        3        4
+ 0.01  / 1:  2.21000  3.21000  2.31000  3.31000
+ 0.02  / 2:  2.22000  3.22000  2.32000  3.32000
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+               1        2        3     
+               1        2        3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11000  2.11000  3.11000
+ 0.2  / 2:  1.21000  2.21000  3.21000
+ 0.3  / 3:  1.31000  2.31000  3.31000
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12000  2.12000  3.12000
+ 0.2  / 2:  1.22000  2.22000  3.22000
+ 0.3  / 3:  1.32000  2.32000  3.32000
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13000  2.13000  3.13000
+ 0.2  / 2:  1.23000  2.23000  3.23000
+ 0.3  / 3:  1.33000  2.33000  3.33000
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.14000  2.14000  3.14000
+ 0.2  / 2:  1.24000  2.24000  3.24000
+ 0.3  / 3:  1.34000  2.34000  3.34000
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.15000  2.15000  3.15000
+ 0.2  / 2:  1.25000  2.25000  3.25000
+ 0.3  / 3:  1.35000  2.35000  3.35000
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.16000  2.16000  3.16000
+ 0.2  / 2:  1.26000  2.26000  3.26000
+ 0.3  / 3:  1.36000  2.36000  3.36000
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.17000  2.17000  3.17000
+ 0.2  / 2:  1.27000  2.27000  3.27000
+ 0.3  / 3:  1.37000  2.37000  3.37000
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.18000  2.18000  3.18000
+ 0.2  / 2:  1.28000  2.28000  3.28000
+ 0.3  / 3:  1.38000  2.38000  3.38000
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.19000  2.19000  3.19000
+ 0.2  / 2:  1.29000  2.29000  3.29000
+ 0.3  / 3:  1.39000  2.39000  3.39000
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:  220.777  252.000  293.508  315.000  293.508  252.000  220.777
+ 3    / 2:  210.675  240.469  280.078  300.586  280.078  240.469  210.675
+ 5    / 3:  199.382  227.579  265.064  284.473  265.064  227.579  199.382
+ 7    / 4:  186.579  212.965  248.043  266.206  248.043  212.965  186.579
+ 9    / 5:  171.798  196.094  228.394  245.118  228.394  196.094  171.798
+ 11   / 6:  154.317  176.140  205.154  220.176  205.154  176.140  154.317
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:   15.459   13.544   11.629   10.835   11.629   13.544   15.459
+ 3    / 2:   46.534   40.768   35.003   32.614   35.003   40.768   46.534
+ 5    / 3:   77.920   68.266   58.612   54.613   58.612   68.266   77.920
+ 7    / 4:  109.622   96.040   82.458   76.832   82.458   96.040  109.622
+ 9    / 5:  141.642  124.093  106.544   99.274  106.544  124.093  141.642
+ 11   / 6:  173.985  152.428  130.872  121.943  130.872  152.428  173.985
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30      -20      -10       0       10       20       30     
+                 1        2        3        4        5        6        7
+ 0      / 1:     ....     ....     ....     ....     ....     ....     ....
+ 50     / 2:  209.428  236.141  270.541  287.852  270.541  236.141  209.428
+ 100    / 3:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 150    / 4:  167.281  177.850     ....     ....     ....  177.850  167.281
+ 200    / 5:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  219.301  249.266  288.698  308.935  288.698  249.266  219.301
+ 40     /  3:  212.799  240.795  276.900  295.177  276.900  240.795  212.799
+ 60     /  4:  205.830  231.454  264.073  280.044  264.073  231.454  205.830
+ 80     /  5:  198.542  221.405  249.798  263.229  249.798  221.405  198.542
+ 100    /  6:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 120    /  7:  181.788  198.556  215.539  222.313  215.539  198.556  181.788
+ 140    /  8:  172.556  184.892     ....     ....     ....  184.892  172.556
+ 160    /  9:  161.876     ....     ....     ....     ....     ....  161.876
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  1.14612  1.23714  1.35815  1.42080  1.35815  1.23714  1.14612
+ 40     /  3:  1.78974  1.97179  2.21167  2.33573  2.21167  1.97179  1.78974
+ 60     /  4:  2.42905  2.69940  3.05822  3.24246  3.05822  2.69940  2.42905
+ 80     /  5:  3.06561  3.42249  3.89693  4.14116  3.89693  3.42249  3.06561
+ 100    /  6:  3.69649  4.14116  4.72832  5.03201  4.72832  4.14116  3.69649
+ 120    /  7:  4.32411  4.85410  5.55312  5.91430  5.55312  4.85410  4.32411
+ 140    /  8:  4.94871  5.56139     ....     ....     ....  5.56139  4.94871
+ 160    /  9:  5.56760     ....     ....     ....     ....     ....  5.56760
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  5.56760
+ -20   / 2:  5.56139
+ -10   / 3:  5.55312
+ 0     / 4:  5.91430
+ 10    / 5:  5.55312
+ 20    / 6:  5.56139
+ 30    / 7:  5.56760
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  163.058
+ -20   / 2:  186.117
+ -10   / 3:  216.774
+ 0     / 4:  232.647
+ 10    / 5:  216.774
+ 20    / 6:  186.117
+ 30    / 7:  163.058
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   1.1817
+ -20   / 2:   1.2249
+ -10   / 3:   1.2346
+ 0     / 4:  10.3336
+ 10    / 5:   1.2346
+ 20    / 6:   1.2249
+ 30    / 7:   1.1817
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   7.6679
+ -20   / 2:   9.6753
+ -10   / 3:  10.7875
+ 0     / 4:  10.3336
+ 10    / 5:  10.7875
+ 20    / 6:   9.6753
+ 30    / 7:   7.6679
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+ 
+!added in bn491 - originally had this in run_all, but moved it here to
+! properly echo commands  *kob*
+GO bn_reset
+cancel mode verify
+set mode verify  ! somehow this was off
+ 
+GO bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+can viewport
+can win/all
+set window 1
+ 
+!netcdf write error
+GO err490_cdf_childax
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+ 
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+!
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+ 
+ 
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+ 
+message/continue ********File successfully written******
+********File successfully written******
+ 
+ 
+! command parser
+GO bn_reset
+cancel mode verify
+GO err490_command_parser
+! err490_command_parser.jnl 12/1/98 - reported by billy kessler
+ 
+! ERROR Fixed:  command parser fix
+! the following caused an abort of ferret to occur
+!
+! routines modifed:  gnl/parse_command.F
+!	     	     rpn/init_uvar_sub.F
+!                    common/xvariables.cmn
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+label/nou `($ppl$xlen)-.3`  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ !-> PPL %LABEL/nou 8.44  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ 
+! the following also caused an abort of ferret
+let sstb = if ( (i eq 172 and j eq 36) or (i ge 173 and i le 175 and j eq 35) or (i ge 176 and i le 178 and j eq 36) or (i eq 178 and j eq 35) ) then 1.e35 else sst
+message/continue ****Variable defined successfully******
+****Variable defined successfully******
+ 
+ 
+! tilde error
+!GO bn_reset
+!GO err490_tilde
+ 
+ 
+!repeat error
+GO bn_reset
+cancel mode verify
+GO err490_repeat_first_echo
+! err490_repeat_first_echo (created later 23/98)
+ 
+! for the first REPEAT loop on T the formatting of the "verify" output
+! is based on the last previous command given
+ 
+! fixed 1/98 sh&kob
+!  relevant routines (bug not yet fixed)
+!		       gnl/cs_command.F
+!                      xeq/xeq_repeat.F
+!                      ctx/cs_set_context.F
+ 
+set mode calendar
+can mode interp
+ 
+! cause the "last" command to be non-calendar
+stat t[t=15]
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+ 
+! now note the first loop echo
+set mode verify
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.42017
+ 14   / 14:  1.41077
+ 15   / 15:  2.06106
+ 16   / 16:  1.77316
+ 17   / 17:  0.81176
+ 18   / 18:  0.06077
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.693528
+ 12   / 12: -0.372132
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+ 19   / 19:  0.103945
+ 20   / 20:  0.633159
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.99999
+ 12   / 12: -1.53656
+ 13   / 13: -1.11640
+ 14   / 14: -0.12579
+ 15   / 15:  0.52450
+ 16   / 16:  0.23660
+ 17   / 17: -0.72480
+ 18   / 18: -1.47579
+ 19   / 19: -1.32591
+ 20   / 20: -0.41297
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME4     TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.0000
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.51W  135.469W 135.429W 135.389W 135.348W 135.308W 135.267W 135.227W 135.187W 135.146W 135.106W 135.066W 
+                     1        4        7       10       13       16       19       22       25       28       31       34
+ 59.4667N / 127:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4599N / 126:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.453N  / 125:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4462N / 124:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97638     ....
+ 59.4394N / 123:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4325N / 122:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4257N / 121:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4189N / 120:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.412N  / 119:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.4052N / 118:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3983N / 117:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.3915N / 116:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3846N / 115:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97555     ....     ....
+ 59.3778N / 114:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3709N / 113:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3641N / 112:     ....     ....     ....     ....     ....     ....     ....     ....  2.98572     ....     ....     ....
+ 59.3572N / 111:     ....     ....     ....     ....     ....     ....     ....     ....  2.98764     ....     ....     ....
+ 59.3504N / 110:     ....     ....     ....     ....     ....     ....     ....     ....  2.98791     ....     ....     ....
+ 59.3435N / 109:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3366N / 108:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3298N / 107:     ....     ....     ....     ....     ....     ....     ....  2.98599     ....     ....     ....     ....
+ 59.3229N / 106:     ....     ....     ....     ....  2.98956     ....     ....  2.98709     ....     ....     ....     ....
+ 59.3161N / 105:     ....     ....     ....     ....  2.98901     ....     ....  2.98627     ....     ....     ....     ....
+ 59.3092N / 104:     ....     ....     ....     ....  2.98846     ....  2.98379  2.98517     ....     ....     ....     ....
+ 59.3023N / 103:     ....     ....     ....     ....     ....  2.98379  2.98297  2.98407     ....     ....     ....     ....
+ 59.2955N / 102:     ....     ....     ....     ....     ....  2.98297     ....  2.98270     ....     ....     ....     ....
+ 59.2886N / 101:     ....  2.99863     ....     ....     ....  2.98297  2.98077  2.98105     ....     ....     ....     ....
+ 59.2817N / 100:     ....     ....  2.98956     ....     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2748N /  99:     ....     ....  2.99149     ....     ....  2.98462  2.98050     ....     ....     ....     ....     ....
+ 59.268N  /  98:     ....     ....  2.99341     ....     ....  2.98462  2.97967     ....     ....     ....     ....     ....
+ 59.2611N /  97:     ....     ....  2.99561     ....     ....     ....  2.97967     ....     ....     ....     ....     ....
+ 59.2542N /  96:     ....     ....  2.99615  3.00055     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2473N /  95:     ....     ....  2.99643  2.99945     ....  2.98434  2.98709     ....     ....     ....     ....     ....
+ 59.2405N /  94:     ....     ....     ....  2.99753     ....  2.98572  2.99286     ....     ....     ....     ....     ....
+ 59.2336N /  93:     ....     ....     ....  2.99561  2.99588  2.98627  2.99313     ....     ....     ....     ....     ....
+ 59.2267N /  92:     ....     ....     ....  2.99396  2.99451     ....  2.99588  2.99588     ....     ....     ....     ....
+ 59.2198N /  91:     ....     ....     ....  2.99231  2.99341     ....  2.99643  2.99698     ....     ....     ....     ....
+ 59.2129N /  90:     ....     ....     ....  2.99039  2.99176     ....  2.99561  2.99780     ....     ....     ....     ....
+ 59.2061N /  89:     ....     ....     ....  2.98984  2.99231     ....  2.99396  2.99725     ....     ....     ....     ....
+ 59.1992N /  88:     ....     ....     ....  2.98984  2.99176     ....     ....  2.99368     ....     ....     ....     ....
+ 59.1923N /  87:     ....     ....     ....     ....  2.99203     ....     ....  2.99039     ....     ....     ....     ....
+ 59.1854N /  86:     ....     ....     ....     ....  2.99451     ....     ....  2.98956     ....     ....     ....     ....
+ 59.1785N /  85:     ....     ....     ....  2.99313  2.99670  2.99918     ....  2.98956     ....     ....     ....     ....
+ 59.1716N /  84:     ....     ....     ....  2.99423  2.99808     ....     ....  2.99066     ....     ....     ....     ....
+ 59.1647N /  83:     ....     ....     ....  2.99561  2.99780  3.00494     ....  2.99149     ....     ....     ....     ....
+ 59.1578N /  82:     ....     ....     ....  2.99588  2.99835     ....     ....  2.99286     ....     ....     ....     ....
+ 59.1509N /  81:     ....     ....     ....  2.99588  2.99945     ....  2.99506  2.99423     ....     ....     ....     ....
+ 59.144N  /  80:     ....     ....     ....     ....  2.99973     ....  2.99561  2.99396     ....     ....     ....     ....
+ 59.1371N /  79:     ....     ....     ....     ....  2.99973     ....  2.99643  2.99396     ....     ....     ....     ....
+ 59.1302N /  78:     ....     ....     ....     ....  3.00055     ....  2.99808  2.99451     ....     ....     ....     ....
+ 59.1233N /  77:     ....     ....     ....     ....  3.00247     ....  3.00027  2.99561     ....     ....     ....     ....
+ 59.1164N /  76:     ....     ....     ....     ....  3.00385     ....  3.00110  2.99670     ....     ....     ....     ....
+ 59.1095N /  75:     ....     ....     ....     ....     ....  3.00330  3.00275  2.99753     ....     ....     ....     ....
+ 59.1026N /  74:     ....     ....     ....     ....     ....  3.00192     ....  2.99808     ....     ....     ....     ....
+ 59.0957N /  73:     ....     ....     ....     ....  2.99643  3.00027     ....  2.99973     ....     ....     ....     ....
+ 59.0888N /  72:     ....     ....     ....     ....  2.99615  3.00000     ....  3.00082     ....     ....     ....     ....
+ 59.0819N /  71:     ....     ....     ....     ....  2.99670  3.00055  3.00412  3.00110     ....     ....     ....     ....
+ 59.075N  /  70:     ....     ....     ....     ....  2.99780  3.00137  3.00302  3.00137     ....     ....     ....     ....
+ 59.0681N /  69:     ....     ....     ....     ....  2.99890  3.00137  3.00082  3.00055     ....     ....     ....     ....
+ 59.0612N /  68:     ....     ....     ....     ....  2.99863  3.00000     ....  2.99780     ....     ....     ....     ....
+ 59.0542N /  67:     ....     ....     ....     ....  2.99835  2.99780     ....  2.99533     ....     ....     ....     ....
+ 59.0473N /  66:     ....     ....     ....     ....  2.99808  2.99615     ....  2.99341     ....     ....     ....     ....
+ 59.0404N /  65:     ....     ....     ....     ....  2.99780  2.99588  2.99368  2.99094     ....     ....     ....     ....
+ 59.0335N /  64:     ....     ....     ....  2.99835  2.99753  2.99506  2.99286  2.98791     ....     ....     ....     ....
+ 59.0266N /  63:     ....     ....     ....  2.99780     ....  2.99396  2.99039  2.98599     ....     ....     ....     ....
+ 59.0196N /  62:     ....     ....     ....  2.99698     ....  2.99258     ....  2.98324     ....     ....     ....     ....
+ 59.0127N /  61:     ....     ....     ....  2.99561     ....  2.99203  2.98572  2.97995     ....     ....     ....     ....
+ 59.0058N /  60:     ....     ....     ....  2.99423     ....  2.99121  2.98572  2.97748     ....     ....     ....     ....
+ 58.9989N /  59:     ....     ....     ....  2.99506     ....  2.99094  2.98572  2.97748     ....     ....     ....     ....
+ 58.9919N /  58:     ....     ....     ....  2.99808     ....  2.99066  2.98489  2.97748     ....     ....     ....     ....
+ 58.985N  /  57:     ....     ....     ....  3.00027     ....  2.99011  2.98407  2.97720     ....     ....     ....     ....
+ 58.9781N /  56:     ....     ....     ....  3.00055     ....  2.98929  2.98160  2.97720     ....     ....     ....     ....
+ 58.9711N /  55:     ....     ....     ....  3.00000     ....  2.98819  2.97693  2.97638     ....     ....     ....     ....
+ 58.9642N /  54:     ....     ....     ....  2.99863     ....  2.98736  2.97775  2.97198     ....     ....     ....     ....
+ 58.9573N /  53:     ....     ....     ....  2.99670     ....  2.98682  2.97803  2.96512     ....     ....     ....     ....
+ 58.9503N /  52:     ....     ....     ....  2.99588  2.99203  2.98654  2.97830  2.96676     ....     ....     ....     ....
+ 58.9434N /  51:     ....     ....     ....  2.99588  2.99231  2.98654  2.97748  2.96814     ....     ....     ....     ....
+ 58.9365N /  50:     ....     ....     ....  2.99780  2.99258  2.98627  2.97665     ....     ....     ....     ....     ....
+ 58.9295N /  49:     ....     ....     ....     ....  2.99231  2.98572  2.97638     ....     ....     ....     ....     ....
+ 58.9226N /  48:     ....     ....     ....     ....  2.99286  2.98544  2.97610     ....     ....     ....     ....     ....
+ 58.9156N /  47:     ....     ....     ....  2.99478  2.99423  2.98544  2.97528     ....     ....     ....     ....     ....
+ 58.9087N /  46:     ....     ....     ....  2.99533  2.99368  2.98517  2.97500     ....     ....     ....     ....     ....
+ 58.9017N /  45:     ....     ....     ....  2.99506  2.99286  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8948N /  44:     ....     ....     ....  2.99533  2.99231  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8878N /  43:     ....     ....     ....  2.99615  2.99176  2.98462  2.97555     ....     ....     ....     ....     ....
+ 58.8809N /  42:     ....     ....     ....  2.99698  2.99258  2.98489  2.97638     ....     ....     ....     ....     ....
+ 58.8739N /  41:     ....     ....     ....  2.99698  2.99341  2.98544  2.97555     ....     ....     ....     ....     ....
+ 58.867N  /  40:     ....     ....     ....  2.99698  2.99341  2.98544  2.97418     ....     ....     ....     ....     ....
+ 58.86N   /  39:     ....     ....     ....  2.99753  2.99368  2.98544  2.97171     ....     ....     ....     ....     ....
+ 58.8531N /  38:     ....     ....     ....  2.99835  2.99368  2.98572  2.96786     ....     ....     ....     ....     ....
+ 58.8461N /  37:     ....     ....     ....  2.99863  2.99368  2.98572  2.96621     ....     ....     ....     ....     ....
+ 58.8392N /  36:     ....     ....     ....  2.99890  2.99368  2.98517  2.96814     ....     ....     ....     ....     ....
+ 58.8322N /  35:     ....     ....     ....     ....  2.99313  2.98379  2.97061     ....     ....     ....     ....     ....
+ 58.8252N /  34:     ....     ....     ....     ....  2.99258  2.98215  2.96896     ....     ....     ....     ....     ....
+ 58.8183N /  33:     ....     ....     ....     ....  2.99121  2.98160  2.96814     ....     ....     ....     ....     ....
+ 58.8113N /  32:     ....     ....     ....     ....  2.99094  2.98242  2.96869     ....     ....     ....  2.93408  2.92254
+ 58.8043N /  31:     ....     ....     ....     ....  2.99341  2.98297  2.96759     ....     ....     ....  2.93463     ....
+ 58.7974N /  30:     ....     ....     ....  3.00247  2.99286  2.98242  2.96621  2.94754     ....     ....  2.93545     ....
+ 58.7904N /  29:     ....     ....     ....     ....  2.99149  2.98105  2.96567  2.94809     ....     ....     ....     ....
+ 58.7834N /  28:     ....     ....     ....     ....  2.99094  2.97967  2.96512  2.94644     ....     ....  2.96374     ....
+ 58.7765N /  27:     ....     ....     ....     ....  2.98956  2.97748  2.96347  2.94864     ....     ....  2.95880     ....
+ 58.7695N /  26:     ....     ....     ....     ....  2.98874  2.97940  2.96484  2.95440     ....  2.94781  2.95660     ....
+ 58.7625N /  25:     ....     ....     ....     ....  2.98846  2.98187  2.96869  2.95990     ....  2.95166  2.95495     ....
+ 58.7555N /  24:     ....     ....     ....     ....  2.98791  2.98160  2.96896  2.96264     ....  2.95358  2.95303     ....
+ 58.7486N /  23:     ....     ....     ....  2.98682  2.98627  2.97940  2.96841  2.96127     ....  2.95440  2.95056     ....
+ 58.7416N /  22:     ....     ....     ....  2.98544  2.98462  2.97693  2.96731  2.95935     ....  2.95276  2.94616     ....
+ 58.7346N /  21:     ....     ....     ....  2.98352  2.98297  2.97500  2.96484  2.95797  2.95166  2.94919  2.94507     ....
+ 58.7276N /  20:     ....     ....     ....     ....  2.98160  2.97226  2.96292  2.95605  2.95138  2.94644  2.94232     ....
+ 58.7206N /  19:     ....     ....     ....     ....  2.97995  2.96896  2.96209  2.95578  2.95056  2.94452     ....     ....
+ 58.7137N /  18:     ....     ....     ....     ....  2.97858  2.97088  2.96292  2.95440  2.94891  2.94424     ....     ....
+ 58.7067N /  17:     ....     ....     ....     ....  2.97775  2.97391  2.96402  2.95331  2.94699  2.94561     ....     ....
+ 58.6997N /  16:     ....     ....     ....     ....  2.97748  2.97446  2.96457  2.95248  2.94507  2.94616     ....     ....
+ 58.6927N /  15:     ....     ....     ....     ....  2.97803  2.97446  2.96457  2.95056  2.94424  2.94699     ....     ....
+ 58.6857N /  14:     ....     ....     ....     ....  2.97967  2.97446  2.96567  2.94836  2.94397  2.94726     ....     ....
+ 58.6787N /  13:     ....     ....     ....     ....  2.98050  2.97500  2.96924  2.95193  2.94534  2.94864     ....     ....
+ 58.6717N /  12:     ....     ....     ....     ....  2.98215  2.97638  2.96814  2.95550  2.94424  2.95193     ....     ....
+ 58.6647N /  11:     ....     ....     ....     ....  2.98270  2.97830  2.96539  2.94919     ....  2.95248     ....     ....
+ 58.6577N /  10:     ....     ....     ....     ....  2.98215  2.97885  2.96594  2.94534     ....     ....     ....     ....
+ 58.6507N /   9:     ....     ....     ....  2.98160  2.97995  2.97500  2.97088  2.95331     ....     ....     ....     ....
+ 58.6437N /   8:     ....     ....     ....     ....  2.97967  2.97116  2.97198  2.95852     ....     ....     ....     ....
+ 58.6367N /   7:     ....     ....     ....     ....  2.98160  2.97500  2.96841  2.96017     ....     ....     ....     ....
+ 58.6297N /   6:     ....     ....     ....     ....  2.98132  2.97693  2.96896  2.96292  2.94946     ....     ....     ....
+ 58.6227N /   5:     ....     ....     ....     ....  2.98160  2.97665  2.97143  2.96155  2.95221     ....     ....     ....
+ 58.6157N /   4:     ....     ....     ....     ....  2.96951  2.96814  2.96484  2.95660  2.95138     ....     ....     ....
+ 58.6087N /   3:     ....     ....     ....     ....  2.95276  2.95138  2.94397  2.96127  2.94644     ....     ....     ....
+ 58.6017N /   2:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 58.5947N /   1:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 
+ 
+! ******** V500 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_odd_variable_name
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.041581
+ 2    /  2: -0.058374
+ 3    /  3: -0.157746
+ 4    /  4: -0.255541
+ 5    /  5: -0.350783
+ 6    /  6: -0.442520
+ 7    /  7: -0.529836
+ 8    /  8: -0.611858
+ 9    /  9: -0.687766
+ 10   / 10: -0.756802
+ 11   / 11: -0.818277
+ 12   / 12: -0.871576
+ 13   / 13: -0.916166
+ 14   / 14: -0.951602
+ 15   / 15: -0.977530
+ 16   / 16: -0.993691
+ 17   / 17: -0.999923
+ 18   / 18: -0.996165
+ 19   / 19: -0.982453
+ 20   / 20: -0.958924
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.891207
+ 2    /  2:  0.932039
+ 3    /  3:  0.963558
+ 4    /  4:  0.985450
+ 5    /  5:  0.997495
+ 6    /  6:  0.999574
+ 7    /  7:  0.991665
+ 8    /  8:  0.973848
+ 9    /  9:  0.946300
+ 10   / 10:  0.909297
+ 11   / 11:  0.863209
+ 12   / 12:  0.808496
+ 13   / 13:  0.745705
+ 14   / 14:  0.675463
+ 15   / 15:  0.598472
+ 16   / 16:  0.515501
+ 17   / 17:  0.427380
+ 18   / 18:  0.334988
+ 19   / 19:  0.239249
+ 20   / 20:  0.141120
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.863209
+ 2    /  2:  0.808496
+ 3    /  3:  0.745705
+ 4    /  4:  0.675463
+ 5    /  5:  0.598472
+ 6    /  6:  0.515501
+ 7    /  7:  0.427380
+ 8    /  8:  0.334988
+ 9    /  9:  0.239249
+ 10   / 10:  0.141120
+ 11   / 11:  0.041581
+ 12   / 12: -0.058374
+ 13   / 13: -0.157746
+ 14   / 14: -0.255541
+ 15   / 15: -0.350783
+ 16   / 16: -0.442520
+ 17   / 17: -0.529836
+ 18   / 18: -0.611858
+ 19   / 19: -0.687766
+ 20   / 20: -0.756802
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.925815
+ 2    /  2: -0.883455
+ 3    /  3: -0.832267
+ 4    /  4: -0.772764
+ 5    /  5: -0.705540
+ 6    /  6: -0.631267
+ 7    /  7: -0.550686
+ 8    /  8: -0.464602
+ 9    /  9: -0.373877
+ 10   / 10: -0.279415
+ 11   / 11: -0.182163
+ 12   / 12: -0.083090
+ 13   / 13:  0.016814
+ 14   / 14:  0.116549
+ 15   / 15:  0.215120
+ 16   / 16:  0.311541
+ 17   / 17:  0.404850
+ 18   / 18:  0.494114
+ 19   / 19:  0.578440
+ 20   / 20:  0.656987
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.818277
+ 2    /  2: -0.871576
+ 3    /  3: -0.916166
+ 4    /  4: -0.951602
+ 5    /  5: -0.977530
+ 6    /  6: -0.993691
+ 7    /  7: -0.999923
+ 8    /  8: -0.996165
+ 9    /  9: -0.982453
+ 10   / 10: -0.958924
+ 11   / 11: -0.925815
+ 12   / 12: -0.883455
+ 13   / 13: -0.832267
+ 14   / 14: -0.772764
+ 15   / 15: -0.705540
+ 16   / 16: -0.631267
+ 17   / 17: -0.550686
+ 18   / 18: -0.464602
+ 19   / 19: -0.373877
+ 20   / 20: -0.279415
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.84963
+ 2    /  2: -0.99041
+ 3    /  3: -1.12130
+ 4    /  4: -1.24099
+ 5    /  5: -1.34828
+ 6    /  6: -1.44209
+ 7    /  7: -1.52150
+ 8    /  8: -1.58571
+ 9    /  9: -1.63407
+ 10   / 10: -1.66610
+ 11   / 11: -1.68149
+ 12   / 12: -1.68007
+ 13   / 13: -1.66187
+ 14   / 14: -1.62707
+ 15   / 15: -1.57600
+ 16   / 16: -1.50919
+ 17   / 17: -1.42730
+ 18   / 18: -1.33115
+ 19   / 19: -1.22170
+ 20   / 20: -1.10004
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.730346
+ 7    /  7: -0.736317
+ 8    /  8: -0.732716
+ 9    /  9: -0.719579
+ 10   / 10: -0.697038
+ 11   / 11: -0.665317
+ 12   / 12: -0.624734
+ 13   / 13: -0.575694
+ 14   / 14: -0.518687
+ 15   / 15: -0.454283
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.441047
+ 7    /  7: -0.528071
+ 8    /  8: -0.609820
+ 9    /  9: -0.685476
+ 10   / 10: -0.754282
+ 11   / 11: -0.815552
+ 12   / 12: -0.868673
+ 13   / 13: -0.913115
+ 14   / 14: -0.948433
+ 15   / 15: -0.974274
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.996244
+ 7    /  7:  0.988362
+ 8    /  8:  0.970604
+ 9    /  9:  0.943148
+ 10   / 10:  0.906269
+ 11   / 11:  0.860334
+ 12   / 12:  0.805804
+ 13   / 13:  0.743222
+ 14   / 14:  0.673213
+ 15   / 15:  0.596479
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.25425
+ 2    /  2:  0.22114
+ 3    /  3:  0.19991
+ 4    /  4:  0.19245
+ 5    /  5:  0.20137
+ 6    /  6:  0.23088
+ 7    /  7:  0.28859
+ 8    /  8:  0.39076
+ 9    /  9:  0.58026
+ 10   / 10:  1.02106
+ 11   / 11:  3.45512
+ 12   / 12: -2.30685
+ 13   / 13: -0.72568
+ 14   / 14: -0.31668
+ 15   / 15: -0.09228
+ 16   / 16:  0.07275
+ 17   / 17:  0.21342
+ 18   / 18:  0.34296
+ 19   / 19:  0.46716
+ 20   / 20:  0.58869
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.0415808
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.999574
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.0799809
+ 6    /  6: -0.0855462
+ 7    /  7: -0.0902566
+ 8    /  8: -0.0940653
+ 9    /  9: -0.0969341
+ 10   / 10: -0.0988342
+ 11   / 11: -0.0997471
+ 12   / 12: -0.0996632
+ 13   / 13: -0.0985835
+ 14   / 14: -0.0965188
+ 15   / 15: -0.0934896
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_stream
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- L:3 T:   3
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:4 T:   4
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  37.0000
+ 2   / 2:  29.0000  41.0000
+ 3   / 3:  33.0000  45.0000
+ ---- L:2 T:   2
+ 1   / 1:  26.0000  38.0000
+ 2   / 2:  30.0000  42.0000
+ 3   / 3:  34.0000  46.0000
+ ---- L:3 T:   3
+ 1   / 1:  27.0000  39.0000
+ 2   / 2:  31.0000  43.0000
+ 3   / 3:  35.0000  47.0000
+ ---- L:4 T:   4
+ 1   / 1:  28.0000  40.0000
+ 2   / 2:  32.0000  44.0000
+ 3   / 3:  36.0000  48.0000
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- L:2 T:   2
+ 1   / 1:  13.0000  15.0000
+ 2   / 2:  17.0000  19.0000
+ 3   / 3:  21.0000  23.0000
+ ---- L:3 T:   3
+ 1   / 1:  25.0000  27.0000
+ 2   / 2:  29.0000  31.0000
+ 3   / 3:  33.0000  35.0000
+ ---- L:4 T:   4
+ 1   / 1:  37.0000  39.0000
+ 2   / 2:  41.0000  43.0000
+ 3   / 3:  45.0000  47.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+ ---- L:2 T:   2
+ 1   / 1:  14.0000  16.0000
+ 2   / 2:  18.0000  20.0000
+ 3   / 3:  22.0000  24.0000
+ ---- L:3 T:   3
+ 1   / 1:  26.0000  28.0000
+ 2   / 2:  30.0000  32.0000
+ 3   / 3:  34.0000  36.0000
+ ---- L:4 T:   4
+ 1   / 1:  38.0000  40.0000
+ 2   / 2:  42.0000  44.0000
+ 3   / 3:  46.0000  48.0000
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_define_axes
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_external_functions  ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_pattern
+! pattern_bench.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+ 
+set view full
+ 
+use coads_climatology
+set reg/l=3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+ 
+! Note that colors are set in the usual way...
+ 
+set win 1
+ 
+set mode meta pattern_plot1.plt
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns/nolabel sst
+ 
+go land thick
+ 
+! Colors and patterns can be overlaid; patterns are transparent
+ 
+set win 2
+ 
+set data coads_climatology
+set data clim_airt_lev.cdf
+set reg/l=1:3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+set mode meta pattern_plot2.plt
+fill/lev=(0,33,3)/nolabel sst[l=@ave,d=1]
+ 
+fill/lev=(25,27,1)/over/nolab/pal=black/pat=angled_grid/nolabel airt[l=@ave]
+label/user,200,-30,-1,0,.15, at trAIRT gt 25 and lt 27 deg. C
+ 
+go land thick
+ 
+!can data/all
+can win 2
+set win 1
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn_polygon
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn500_bug_fixes
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G012)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Fri Mar 28 11:40:54 PDT 2014
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+ 
+! ******** V510 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sample			! internal (optimized) SAMPLE* functions
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : JAN
+               79E      99E     119E    
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  28.5769  28.5925  28.1495
+ 1S   / 45:  28.3343  28.7146  28.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  29.1373  28.9243  28.3264
+ 1S   / 45:  28.8965  28.8240  28.5357
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : JAN
+                2     
+                2
+ 1N   / 46:  28.1992
+ 1S   / 45:  28.5607
+ -DELETE (C01,V02 M: 34 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 25 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 28 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 31 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 34 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 32 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+cancel memory/all
+ -DELETE A        M: 26 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 26 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE A        M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 32 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=20E:20E(380)@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[X=20E:20E(380)@IIN,D=1]
+ -DELETE          M: 32 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 23 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                 1           2           3       
+                  1           2           3
+ 1N   / 46:  182881720.  245818833.  306844239.
+ 1S   / 45:  183667676.  246892478.  309487473.
+cancel memory/all
+ -DELETE FSST     M: 22 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 25 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 31 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 31 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 33 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G017)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G017)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:  4.00000
+ 3   / 3:  7.00000
+ 4   / 4:     ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.000
+ 2   / 2:  114.000
+ 3   / 3:  117.000
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:     ....
+ 3   / 3:     ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.2222  28.1992     ....  28.4514
+ 1S   / 45:  28.1514  28.5607     ....  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.1992     ....  28.4514  28.2222
+ 1S   / 45:  28.5607     ....  28.8326  28.1514
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:     ....
+ 3   / 3:     ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:     ....
+ 3   / 3:  170.000
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G017)          NORMAL    (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 29 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 20 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 18 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V01 C: 12 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 14 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1978
+            largest free region: 1976
+            number of free regions: 3
+            free memory table slots: 478
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : JAN
+            179E    
+             80
+ 0   / 1:  22.6389
+ 5   / 2:  27.6389
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : JAN
+              1        2        3        4     
+              1        2        3        4
+ 0   / 1:  22.6389  23.5251  26.9131  29.2606
+ 5   / 2:  27.6389  28.5251  31.9131  34.2606
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  22.6389
+ 2   / 2:  29.2606
+ 3   / 3:  27.7269
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  23.5649  22.6150  21.9434  22.5531  22.5856  22.4436  21.9629  22.2754  21.6575
+ 2   / 2:  29.3521  29.1692  29.2257  29.4440  29.0923  29.3430  29.1310  28.6520  28.9082
+ 3   / 3:  27.9696  28.0578  27.8618  27.9059  27.4280  27.4100  27.3646  27.3974  27.1177
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : JAN
+          173.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  178.202
+ 3   / 3:  198.202
+ 4   / 4:  223.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  223.202
+ 3   / 3:  273.202
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  174.169  174.225  173.963  173.313  173.532  172.803  172.991  172.548  171.929
+ 2   / 2:  224.169  224.225  223.963  223.313  223.532  222.803  222.991  222.548  221.929
+ 3   / 3:  274.169  274.225  273.963  273.313  273.532  272.803  272.991  272.548  271.929
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+            179E    
+             80
+ 0   / 1:  28.2022
+ 5   / 2:  33.2022
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+              0        5     
+              1        2
+ 1   / 1:  28.3646  33.3646
+ 2   / 2:  28.3538  33.3538
+ 3   / 3:  28.2022  33.2022
+ 4   / 4:  28.3646  33.3646
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+            179E    
+             80
+ 1   / 1:  28.2022
+ 2   / 2:  28.2022
+ 3   / 3:  28.3646
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 2   / 2:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 3   / 3:  29.0509  29.1878  28.7239  29.5150  28.3287  28.1944  27.4815  27.4749  26.7886
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strides_revs_perms	! netCDF fancy reads
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1124.00  1125.00  1126.00
+ 3   / 3:  1133.00  1134.00  1135.00  1136.00
+ 4   / 4:  1143.00  1144.00  1145.00  1146.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1224.00  1225.00  1226.00
+ 3   / 3:  1233.00  1234.00  1235.00  1236.00
+ 4   / 4:  1243.00  1244.00  1245.00  1246.00
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.00  1142.00  1152.00  1162.00
+ 3   / 3:  1133.00  1143.00  1153.00  1163.00
+ 4   / 4:  1134.00  1144.00  1154.00  1164.00
+ ---- K:2 Z:   2
+ 2   / 2:  1232.00  1242.00  1252.00  1262.00
+ 3   / 3:  1233.00  1243.00  1253.00  1263.00
+ 4   / 4:  1234.00  1244.00  1254.00  1264.00
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1421.00  1521.00  1621.00
+ 3   / 3:  1331.00  1431.00  1531.00  1631.00
+ 4   / 4:  1341.00  1441.00  1541.00  1641.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1332.00  1432.00  1532.00  1632.00
+ 4   / 4:  1342.00  1442.00  1542.00  1642.00
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1412.00  1512.00  1612.00
+ 3   / 3:  1313.00  1413.00  1513.00  1613.00
+ 4   / 4:  1314.00  1414.00  1514.00  1614.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1323.00  1423.00  1523.00  1623.00
+ 4   / 4:  1324.00  1424.00  1524.00  1624.00
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1032.00  1033.00  1034.00
+ 2N   / 2:  1021.00  1022.00  1023.00  1024.00
+ 1N   / 1:  1011.00  1012.00  1013.00  1014.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2032.00  2033.00  2034.00
+ 2N   / 2:  2021.00  2022.00  2023.00  2024.00
+ 1N   / 1:  2011.00  2012.00  2013.00  2014.00
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1021.00  1031.00  1041.00
+ 142   / 2:  1012.00  1022.00  1032.00  1042.00
+ 143   / 3:  1013.00  1023.00  1033.00  1043.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2021.00  2031.00  2041.00
+ 142   / 2:  2012.00  2022.00  2032.00  2042.00
+ 143   / 3:  2013.00  2023.00  2033.00  2043.00
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  2031.00  3031.00  4031.00
+ 2N   / 2:  1021.00  2021.00  3021.00  4021.00
+ 1N   / 1:  1011.00  2011.00  3011.00  4011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  2032.00  3032.00  4032.00
+ 2N   / 2:  1022.00  2022.00  3022.00  4022.00
+ 1N   / 1:  1012.00  2012.00  3012.00  4012.00
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @AVE
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1113.67
+ 2   / 2:  1122.00  1123.67
+ 3   / 3:  1132.00  1133.67
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1213.67
+ 2   / 2:  1222.00  1223.67
+ 3   / 3:  1232.00  1233.67
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 47 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M: 54 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G010)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.3      0.48     0.6    
+             1        2        3        4
+          1111.00  1112.00  1113.00  1114.00
+cancel mem/all
+ -DELETE BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.9      1.87     2.65     3.3    
+             1        2        3        4        5
+          1111.00  1118.00  1115.00  1112.00  1119.00
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6    
+               1        2
+ 0    / 1:  1112.00  1114.00
+ 0.95 / 2:  1132.00  1134.00
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6      0.78   
+               1        2        3
+ 0    / 1:  1112.00  1114.00  1116.00
+ 0.95 / 2:  1132.00  1134.00  1136.00
+ 1.4  / 3:  1152.00  1154.00  1156.00
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1125.00  1127.00  1129.00
+ 3   / 3:  1133.00  1135.00  1137.00  1139.00
+ 4   / 4:  1143.00  1145.00  1147.00  1149.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1225.00  1227.00  1229.00
+ 3   / 3:  1233.00  1235.00  1237.00  1239.00
+ 4   / 4:  1243.00  1245.00  1247.00  1249.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1124.00  1125.00  1126.00
+ 4   / 2:  1143.00  1144.00  1145.00  1146.00
+ 6   / 3:  1163.00  1164.00  1165.00  1166.00
+ ---- K:2 Z:   2
+ 2   / 1:  1223.00  1224.00  1225.00  1226.00
+ 4   / 2:  1243.00  1244.00  1245.00  1246.00
+ 6   / 3:  1263.00  1264.00  1265.00  1266.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1521.00  1721.00  1921.00
+ 3   / 3:  1331.00  1531.00  1731.00  1931.00
+ 4   / 4:  1341.00  1541.00  1741.00  1941.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1332.00  1532.00  1732.00  1932.00
+ 4   / 4:  1342.00  1542.00  1742.00  1942.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1421.00  1521.00  1621.00
+ 4   / 2:  1341.00  1441.00  1541.00  1641.00
+ 6   / 3:  1361.00  1461.00  1561.00  1661.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1342.00  1442.00  1542.00  1642.00
+ 6   / 3:  1362.00  1462.00  1562.00  1662.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1512.00  1712.00  1912.00
+ 3   / 3:  1313.00  1513.00  1713.00  1913.00
+ 4   / 4:  1314.00  1514.00  1714.00  1914.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1323.00  1523.00  1723.00  1923.00
+ 4   / 4:  1324.00  1524.00  1724.00  1924.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1412.00  1512.00  1612.00
+ 4   / 2:  1314.00  1414.00  1514.00  1614.00
+ 6   / 3:  1316.00  1416.00  1516.00  1616.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1324.00  1424.00  1524.00  1624.00
+ 6   / 3:  1326.00  1426.00  1526.00  1626.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1512.00  1712.00  1912.00
+ 4   / 2:  1314.00  1514.00  1714.00  1914.00
+ 6   / 3:  1316.00  1516.00  1716.00  1916.00
+ ---- K:2 Z:   3
+ 2   / 1:  1332.00  1532.00  1732.00  1932.00
+ 4   / 2:  1334.00  1534.00  1734.00  1934.00
+ 6   / 3:  1336.00  1536.00  1736.00  1936.00
+canc data/all
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1033.00  1035.00  1037.00
+ 2N   / 2:  1021.00  1023.00  1025.00  1027.00
+ 1N   / 1:  1011.00  1013.00  1015.00  1017.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2033.00  2035.00  2037.00
+ 2N   / 2:  2021.00  2023.00  2025.00  2027.00
+ 1N   / 1:  2011.00  2013.00  2015.00  2017.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  1061.00  1062.00  1063.00  1064.00
+ 4N   / 2:  1041.00  1042.00  1043.00  1044.00
+ 2N   / 1:  1021.00  1022.00  1023.00  1024.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  2061.00  2062.00  2063.00  2064.00
+ 4N   / 2:  2041.00  2042.00  2043.00  2044.00
+ 2N   / 1:  2021.00  2022.00  2023.00  2024.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1031.00  1051.00  1071.00
+ 142   / 2:  1012.00  1032.00  1052.00  1072.00
+ 143   / 3:  1013.00  1033.00  1053.00  1073.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2031.00  2051.00  2071.00
+ 142   / 2:  2012.00  2032.00  2052.00  2072.00
+ 143   / 3:  2013.00  2033.00  2053.00  2073.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  1012.00  1022.00  1032.00  1042.00
+ 144   / 2:  1014.00  1024.00  1034.00  1044.00
+ 146   / 3:  1016.00  1026.00  1036.00  1046.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  2012.00  2022.00  2032.00  2042.00
+ 144   / 2:  2014.00  2024.00  2034.00  2044.00
+ 146   / 3:  2016.00  2026.00  2036.00  2046.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  3012.00  3032.00  3052.00  3072.00
+ 144   / 2:  3014.00  3034.00  3054.00  3074.00
+ 146   / 3:  3016.00  3036.00  3056.00  3076.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  5012.00  5032.00  5052.00  5072.00
+ 144   / 2:  5014.00  5034.00  5054.00  5074.00
+ 146   / 3:  5016.00  5036.00  5056.00  5076.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  3031.00  5031.00  7031.00
+ 2N   / 2:  1021.00  3021.00  5021.00  7021.00
+ 1N   / 1:  1011.00  3011.00  5011.00  7011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  3032.00  5032.00  7032.00
+ 2N   / 2:  1022.00  3022.00  5022.00  7022.00
+ 1N   / 1:  1012.00  3012.00  5012.00  7012.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.00  2061.00  3061.00  4061.00
+ 4N   / 2:  1041.00  2041.00  3041.00  4041.00
+ 2N   / 1:  1021.00  2021.00  3021.00  4021.00
+ ---- L:2 T:   142
+ 6N   / 3:  1062.00  2062.00  3062.00  4062.00
+ 4N   / 2:  1042.00  2042.00  3042.00  4042.00
+ 2N   / 1:  1022.00  2022.00  3022.00  4022.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.00  3063.00  5063.00  7063.00
+ 4N   / 2:  1043.00  3043.00  5043.00  7043.00
+ 2N   / 1:  1023.00  3023.00  5023.00  7023.00
+ ---- L:2 T:   145
+ 6N   / 3:  1065.00  3065.00  5065.00  7065.00
+ 4N   / 2:  1045.00  3045.00  5045.00  7045.00
+ 2N   / 1:  1025.00  3025.00  5025.00  7025.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- L:2 T:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- L:2 T:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- K:2 Z:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.00  1342.00
+ 5   / 2:  1385.00  1345.00
+ ---- K:2 Z:   5
+ 2   / 1:  1582.00  1542.00
+ 5   / 2:  1585.00  1545.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+GO bn_reset
+cancel mode verify
+GO bn_non_COARDS_netCDF		! non-standard netCDF files
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME4     TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  3.00000
+ 3   / 3:  5.00000
+ 4   / 4:  2.00000
+ 5   / 5:  4.00000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:     ....
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.0000
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.0000
+ 2   / 2:  40.0000
+ 3   / 3:  30.0000
+ 4   / 4:  20.0000
+ 5   / 5:  10.0000
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cache_hits		! cache hits on unspecified (full) regions
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTX     M: 40 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 33 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 86 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 90 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5X    M: 60 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5X    M: 64 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 57 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 59 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 70 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 76 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 85 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTSBX   M:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTSBX   M: 56 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXAVE  M: 14 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXAVE  M: 17 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 28 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 98 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 91 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 96 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XAVE M: 59 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XAVE M: 72 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 14 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 17 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 58 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 60 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 86 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 90 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 93 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 94 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 95 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 89 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C11,V11 M: 94 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 84 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.00000
+ 2   / 2:  5.00000
+ 3   / 3:  3.00000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 82 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 95 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 95 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 78 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.0000
+ 2   / 2:  12.0000
+ 3   / 3:  13.0000
+ 4   / 4:  21.0000
+ 5   / 5:  22.0000
+ 6   / 6:  23.0000
+ 7   / 7:  31.0000
+ 8   / 8:  32.0000
+ 9   / 9:  33.0000
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+ 
+GO bn_reset
+cancel mode verify
+ -DELETE SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  2 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 18 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 20 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 22 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C31,V11 M: 78 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C31,V11 M: 95 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 79 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 90 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 75 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 82 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+GO bn_regrid_to_user		! G=user_var and related
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.0000
+ 23E   / 2:  23.0000
+ 25E   / 3:  25.0000
+ 27E   / 4:  27.0000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G012)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX012)                         use count:   1
+    AXIS (AX020)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 2   / 2:   5.0000   7.0000   9.0000     ....
+ 3   / 3:   6.0000   8.0000  10.0000     ....
+ 4   / 4:   7.0000   9.0000  11.0000     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 3   / 2:   6.0000   8.0000  10.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX005)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G018)
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G011)
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX002)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.00000
+ 9.4S   / 4:  4.00000
+ 9.6S   / 3:  3.00000
+ 9.8S   / 2:  2.00000
+ 10S    / 1:  1.00000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G011)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX020)                         use count:   1
+ 
+ 
+! ******** V53 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_calendar
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.436165
+ 28-FEB-1988 00 / 58:  0.992873
+ 29-FEB-1988 00 / 59:  0.636738
+ 30-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 01-MAR-1988 00 / 60: -0.304811
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.8979
+ 03-DEC-1982 00 / 16:  32.9221
+ 10-DEC-1982 00 / 17:  32.9583
+ 17-DEC-1982 00 / 18:  32.9707
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 28-NOV-1982 00 / 15:  32.9508
+ 05-DEC-1982 00 / 16:  32.9011
+ 12-DEC-1982 00 / 17:  32.8862
+ 19-DEC-1982 00 / 18:  32.9099
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.9099
+ 03-DEC-1982 00 / 16:  32.9287
+ 10-DEC-1982 00 / 17:  32.9658
+ 17-DEC-1982 00 / 18:  32.9710
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT191_100 LONGITUDE         10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+             TIME: AUG-1982 to JAN-1983 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                    132.5W  
+                     98
+ 18-SEP-1982 / 2:  27.2694
+ 18-OCT-1982 / 3:  31.3241
+ 18-NOV-1982 / 4:  32.9011
+ 18-DEC-1982 / 5:  32.9710
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                         132.5W  
+                          98
+ 05-DEC-1982 00 / 108:     ....
+ 06-DEC-1982 00 / 109:  32.9340
+ 07-DEC-1982 00 / 110:  32.9401
+ 08-DEC-1982 00 / 111:  32.9462
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                    179E    
+                     80
+ 16-JAN      / 1:  28.2022
+ 15-FEB      / 2:  28.3646
+ 17-MAR      / 3:  28.3538
+ 16-AUG      / 4:     ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                    JSST    NSST
+01-JAN      / 1:     ....  28.2022
+31-JAN      / 2:  28.2832  28.2022
+01-MAR      / 3:  28.3592  28.3646
+01-APR      / 4:     ....  28.3538
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dash_dot
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ 
+GO bn_reset
+cancel mode verify
+GO bn_flowlines
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+ 
+! ******** V533 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_logaxes
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+ 
+! *kob* same tests for internal external functions but moved out of
+!       the bn_external_function jnl file.
+GO bn_reset
+cancel mode verify
+GO bn_internal_external_functions
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.013664
+ 0.00355 / 31:  0.021183
+ 0.00366 / 32:  0.048189
+ 0.00378 / 33:  0.498982
+ 0.00389 / 34:  0.052353
+ 0.00401 / 35:  0.032474
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.072791
+ 0.00584 / 51:  0.104108
+ 0.00595 / 52:  0.185372
+ 0.00607 / 53:  0.894540
+ 0.00618 / 54:  0.311122
+ 0.0063  / 55:  0.131705
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.057
+ 0       /  2: -176.112
+ 0       /  3: -174.161
+ 0       /  4: -172.203
+ 0       /  5: -170.234
+ 0       /  6: -168.251
+ 0       /  7: -166.250
+ 0       /  8: -164.228
+ 0.00103 /  9: -162.179
+ 0.00114 / 10: -160.100
+ 0.00126 / 11: -157.983
+ 0.00137 / 12: -155.821
+ 0.00149 / 13: -153.606
+ 0.0016  / 14: -151.326
+ 0.00172 / 15: -148.970
+ 0.00183 / 16: -146.520
+ 0.00195 / 17: -143.957
+ 0.00206 / 18: -141.255
+ 0.00217 / 19: -138.381
+ 0.00229 / 20: -135.294
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                  161W    
+                   90
+ 0        /  1:  1.99605
+ 0        /  2:  2.16839
+ 0        /  3:  0.17387
+ 0        /  4:  2.01530
+ 0        /  5:  0.35361
+ 0        /  6:  1.72488
+ 0        /  7:  1.25348
+ 0        /  8:  0.30416
+ 0        /  9:  1.65059
+ 0        / 10:  0.81359
+ 0        / 11:  0.15377
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                 1       
+                  21
+ 4     /  81:  0.249981
+ 4.05  /  82:  0.245294
+ 4.1   /  83:  0.240500
+ 4.15  /  84:  0.235600
+ 4.2   /  85:  0.230597
+ 4.25  /  86:  0.225493
+ 4.3   /  87:  0.220289
+ 4.35  /  88:  0.214988
+ 4.4   /  89:  0.209592
+ 4.45  /  90:  0.204102
+ 4.5   /  91:  0.198521
+ 4.55  /  92:  0.192851
+ 4.6   /  93:  0.187094
+ 4.65  /  94:  0.181253
+ 4.7   /  95:  0.175329
+ 4.75  /  96:  0.169325
+ 4.8   /  97:  0.163243
+ 4.85  /  98:  0.157086
+ 4.9   /  99:  0.150856
+ 4.95  / 100:  0.144555
+ 5     / 101:  0.138186
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.308984  0.361972  0.109085 -0.004967 -0.136744 -0.408450 -0.225496  0.151670  0.225024  0.073150
+ 1.5   /  2:  0.315638  0.371230  0.093750 -0.037386 -0.201756 -0.452435 -0.150009  0.278155  0.330914  0.069854
+ 2     /  3:  0.378812  0.315634  0.037083 -0.088708 -0.253832 -0.492242 -0.073700  0.374786  0.450968  0.081332
+ 2.5   /  4:  0.420045  0.252191 -0.063598 -0.144131 -0.252740 -0.466614  0.019391  0.439631  0.491399  0.089314
+ 3     /  5:  0.406392  0.198397 -0.139974 -0.197140 -0.279040 -0.425529  0.118978  0.432969  0.545303  0.085462
+ 3.5   /  6:  0.351014  0.169762 -0.201579 -0.257493 -0.283843 -0.357982  0.185850  0.585861  0.530755  0.058808
+ 4     /  7:  0.277107  0.096747 -0.246534 -0.289021 -0.258951 -0.329342  0.312474  0.641602  0.518714  0.021205
+ 4.5   /  8:  0.188951  0.044707 -0.312641 -0.319182 -0.213513 -0.222475  0.302121  0.626625  0.412068 -0.008475
+ 5     /  9:  0.139939 -0.037119 -0.323878 -0.333812 -0.199768 -0.134206  0.265570  0.577839  0.312094 -0.056718
+ 5.5   / 10:  0.078577 -0.096394 -0.338922 -0.312885 -0.172743 -0.085023  0.206702  0.482419  0.235803 -0.079778
+ 6     / 11:  0.007372 -0.135345 -0.377702 -0.274110 -0.121663 -0.019270  0.173802  0.354012  0.148779 -0.122582
+ 6.5   / 12: -0.071091 -0.209142 -0.370362 -0.249289 -0.041035  0.069505  0.148512  0.236838  0.045584 -0.173237
+ 7     / 13: -0.137482 -0.254334 -0.378632 -0.228148  0.063018  0.183000  0.135520  0.132174 -0.050976 -0.215292
+ 7.5   / 14: -0.202760 -0.266868 -0.346402 -0.210460  0.168372  0.279647  0.178541  0.064025 -0.115153 -0.228150
+ 8     / 15: -0.275191 -0.259180 -0.300179 -0.155421  0.233304  0.351951  0.219702  0.033928 -0.135697 -0.218938
+ 8.5   / 16: -0.326812 -0.273253 -0.245151 -0.113795  0.264889  0.402452  0.253275  0.029382 -0.138544 -0.200463
+ 9     / 17: -0.351551 -0.266762 -0.164899 -0.032110  0.276385  0.437033  0.281707  0.036426 -0.134209 -0.191118
+ 9.5   / 18: -0.364215 -0.240170 -0.093384  0.038122  0.276072  0.442607  0.294658  0.049712 -0.140883 -0.217410
+ 10    / 19: -0.369196 -0.210353 -0.040323  0.103110  0.280278  0.405237  0.298599  0.066760 -0.138644 -0.252572
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.290994  0.424162  0.097006  0.003143 -0.136744 -0.412297 -0.207808      ....  0.241076      ....
+ 1.5   /  2:  0.314929  0.373640  0.124083 -0.001456 -0.201756 -0.441151 -0.189145  0.331034  0.333491  0.005624
+ 2     /  3:  0.337643  0.312076  0.046130 -0.011788 -0.267158 -0.486359 -0.073700      ....  0.461555      ....
+ 2.5   /  4:  0.359734  0.242399 -0.066085      .... -0.243857 -0.457333 -0.031104  0.417939  0.473995  0.200894
+ 3     /  5:      ....  0.198698 -0.131262 -0.203700 -0.277160 -0.388506  0.065758  0.434211  0.539378      ....
+ 3.5   /  6:  0.310287  0.169976 -0.216298 -0.249436 -0.282498 -0.336468  0.156727  0.537358  0.505391  0.142444
+ 4     /  7:  0.274766  0.091884 -0.274252 -0.239529 -0.262206 -0.333969  0.312474  0.580377  0.520608  0.093618
+ 4.5   /  8:  0.184044  0.041657 -0.304953      .... -0.210582 -0.196012  0.326227  0.576412  0.366262  0.059061
+ 5     /  9:  0.146796 -0.044536 -0.353323 -0.375483 -0.190888 -0.106617  0.284743  0.521940  0.278387 -0.035055
+ 5.5   / 10:  0.041582 -0.109698 -0.335399 -0.325452      .... -0.088590  0.221990  0.438637  0.235803  0.041225
+ 6     / 11: -0.012273 -0.174380 -0.371063 -0.263403      ....      ....  0.172629  0.346297  0.219052      ....
+ 6.5   / 12: -0.064809 -0.127226 -0.366128 -0.245270      ....  0.104409  0.165680  0.242858  0.095140      ....
+ 7     / 13: -0.138619      .... -0.379843 -0.230018      ....  0.181947  0.135892  0.164309 -0.026041 -0.204659
+ 7.5   / 14: -0.203907 -0.289087 -0.346009 -0.209873  0.169451  0.272161  0.184553  0.103343 -0.114248      ....
+ 8     / 15: -0.285911 -0.258721 -0.300520 -0.170515  0.240968  0.352162  0.229361  0.066151 -0.135985      ....
+ 8.5   / 16: -0.329428 -0.279209 -0.236667 -0.125716  0.292407  0.388989  0.256564      .... -0.139683 -0.183944
+ 9     / 17: -0.341597 -0.268585 -0.177502 -0.064298  0.277369  0.431662  0.288204  0.023055 -0.139178 -0.195303
+ 9.5   / 18: -0.343919 -0.225702 -0.093580  0.013191  0.253357  0.442399  0.294693  0.034103 -0.137639 -0.211783
+ 10    / 19:      .... -0.204222 -0.021547      ....      ....  0.421118  0.287954      .... -0.144731 -0.203650
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.274901  0.351990  0.125870  0.000547 -0.130676 -0.409444 -0.196473  0.113026  0.291807  0.128390
+ 1.5   /  2:  0.299222  0.340543  0.124519 -0.061100 -0.263759 -0.435083 -0.176723  0.348424  0.372371  0.128390
+ 2     /  3:  0.281567  0.320514  0.026296 -0.110384 -0.295665 -0.434870 -0.190697  0.460511  0.445156  0.191902
+ 2.5   /  4:  0.290517  0.274621 -0.063970 -0.166628 -0.264776 -0.417589 -0.116164  0.537969  0.442169  0.264943
+ 3     /  5:  0.291464  0.248219 -0.125567 -0.223844 -0.256285 -0.371561  0.247717  0.497526  0.452304  0.276328
+ 3.5   /  6:  0.267037  0.177128 -0.170576 -0.230988 -0.274809 -0.281194  0.254637  0.510104  0.422794  0.248322
+ 4     /  7:  0.225394  0.114379 -0.176660 -0.227903 -0.272403 -0.244676  0.280180  0.544886  0.397193  0.212214
+ 4.5   /  8:  0.189285  0.081180 -0.332907 -0.343445 -0.230804 -0.244260  0.339829  0.530983  0.335082  0.061286
+ 5     /  9:  0.127042  0.039043 -0.356226 -0.369075 -0.177935 -0.153186  0.253590  0.499044  0.303545  0.025609
+ 5.5   / 10:  0.048635 -0.126901 -0.331398 -0.289789 -0.162591 -0.082396  0.192227  0.401098  0.303746  0.055576
+ 6     / 11: -0.037713 -0.136552 -0.336681 -0.268753 -0.197051  0.016254  0.209390  0.295370  0.263940 -0.135684
+ 6.5   / 12: -0.064917 -0.134912 -0.359398 -0.220212 -0.011644  0.110802  0.164667  0.259319  0.078530 -0.137706
+ 7     / 13: -0.103972 -0.140560 -0.362975 -0.166853  0.066535  0.193231  0.149487  0.141794 -0.113016 -0.143405
+ 7.5   / 14: -0.199710 -0.279592 -0.339043 -0.191829  0.185240  0.262158  0.152165  0.039367 -0.115781 -0.151274
+ 8     / 15: -0.235285 -0.278212 -0.283035 -0.157240  0.250258  0.333134  0.204490  0.017943 -0.115931 -0.171603
+ 8.5   / 16: -0.306008 -0.278546 -0.240470 -0.100659  0.251651  0.363846  0.251194  0.080410 -0.130532 -0.187823
+ 9     / 17: -0.335648 -0.266336 -0.213641  0.013456  0.288406  0.405273  0.272644  0.141238 -0.142601 -0.193561
+ 9.5   / 18: -0.349458 -0.212960 -0.108340  0.097657  0.205467  0.422547  0.294706  0.116317 -0.143410 -0.195569
+ 10    / 19: -0.353035 -0.181573 -0.086119  0.078837  0.108731  0.420380  0.321587  0.036216 -0.151253 -0.191472
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.281552  0.312213  0.193558 -0.030592 -0.206961 -0.317374 -0.200235  0.035776  0.251615  0.217897
+ 1.5   /  2:  0.275271  0.296173  0.155526 -0.085149 -0.266966 -0.350539 -0.202341  0.168678  0.341517  0.274690
+ 2     /  3:  0.267170  0.260868  0.085385 -0.139671 -0.296632 -0.356898 -0.159219  0.302176  0.393862  0.319020
+ 2.5   /  4:  0.256878  0.203678  0.000735 -0.176300 -0.300338 -0.332200 -0.037496  0.393557  0.416391  0.336288
+ 3     /  5:  0.242290  0.152878 -0.057424 -0.197874 -0.288975 -0.265744  0.103144  0.430207  0.412825  0.327333
+ 3.5   /  6:  0.222556  0.121831 -0.090666 -0.216330 -0.271362 -0.184480  0.187704  0.436022  0.391648  0.301597
+ 4     /  7:  0.199438  0.094153 -0.126981 -0.240001 -0.252964 -0.137926  0.223192  0.431619  0.360695  0.262091
+ 4.5   /  8:  0.165055  0.052904 -0.183379 -0.267119 -0.231965 -0.117235  0.236822  0.416791  0.325354  0.213933
+ 5     /  9:  0.103166 -0.013463 -0.234016 -0.283000 -0.207964 -0.093414  0.234809  0.379625  0.299928  0.181999
+ 5.5   / 10:  0.019557 -0.082190 -0.253614 -0.280357 -0.179994 -0.046106  0.219394  0.327974  0.276824  0.165491
+ 6     / 11: -0.043123 -0.124439 -0.262702 -0.257404 -0.115678  0.036003  0.200459  0.273757  0.219858  0.088693
+ 6.5   / 12: -0.080238 -0.159570 -0.282392 -0.216326  0.011196  0.126375  0.181603  0.207992  0.109108 -0.036546
+ 7     / 13: -0.125137 -0.215907 -0.293904 -0.180571  0.098961  0.191463  0.171154  0.130122 -0.005575 -0.104958
+ 7.5   / 14: -0.186850 -0.262803 -0.283642 -0.149158  0.150674  0.242358  0.181345  0.073483 -0.066151 -0.129099
+ 8     / 15: -0.238052 -0.273211 -0.262614 -0.116643  0.191858  0.284230  0.210919  0.059208 -0.090155 -0.143986
+ 8.5   / 16: -0.274654 -0.269613 -0.239107 -0.087178  0.223535  0.315867  0.242668  0.071672 -0.107088 -0.159422
+ 9     / 17: -0.300031 -0.259464 -0.211792 -0.059935  0.246533  0.340287  0.266976  0.081553 -0.124034 -0.168991
+ 9.5   / 18: -0.314125 -0.241656 -0.177924 -0.031561  0.260916  0.358325  0.284307  0.073478 -0.135647 -0.172063
+ 10    / 19: -0.318713 -0.220992 -0.146630 -0.009841  0.266488  0.369766  0.296933  0.053734 -0.142473 -0.172360
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G010)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                 50E      52.1E    54.2E    56.3E    58.4E    60.5E    62.6E    64.7E    66.8E    68.9E  
+                  1        3        5        7        9       11       13       15       17       19
+ 20N    / 20:     ....     ....     ....     ....  143.990  241.090     ....     ....     ....     ....
+ 19.47N / 19:     ....     ....     ....     ....  117.831  207.449  172.925     ....     ....     ....
+ 18.95N / 18:     ....     ....     ....  137.758  107.307   98.003     ....     ....     ....     ....
+ 18.42N / 17:     ....     ....     ....  161.079  156.071    7.072   16.239     ....     ....     ....
+ 17.9N  / 16:     ....     ....     ....  179.862  189.128   81.665     ....     ....     ....     ....
+ 17.37N / 15:     ....     ....     ....  165.097  200.741  145.418     ....     ....     ....     ....
+ 16.84N / 14:     ....     ....     ....  128.322  183.027  168.029  182.582     ....     ....     ....
+ 16.32N / 13:     ....     ....   76.347   92.413  158.520  190.506  197.367     ....     ....     ....
+ 15.79N / 12:     ....     ....     ....   80.307     ....  189.841  195.829     ....     ....     ....
+ 15.26N / 11:     ....     ....     ....   72.161     ....  187.475  191.467     ....     ....     ....
+ 14.74N / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 14.21N /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.68N /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.16N /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.63N /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.11N /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.58N /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.05N /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10.53N /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10N    /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 28N   / 10:      ....  0.000000 -0.017348 -0.052117 -0.086972 -0.121869 -0.156767 -0.191621 -0.226391 -0.243739      ....
+ 26N   /  9:      ....  0.017348  0.000000 -0.034770 -0.069624 -0.104522 -0.139419 -0.174274 -0.209043 -0.226391      ....
+ 24N   /  8:      ....  0.052117  0.034770  0.000000 -0.034855 -0.069752 -0.104649 -0.139504 -0.174274 -0.191621      ....
+ 22N   /  7:      ....  0.086972  0.069624  0.034855  0.000000 -0.034897 -0.069794 -0.104649 -0.139419 -0.156767      ....
+ 20N   /  6:      ....  0.121869  0.104522  0.069752  0.034897  0.000000 -0.034897 -0.069752 -0.104522 -0.121869      ....
+ 18N   /  5:      ....  0.156767  0.139419  0.104649  0.069794  0.034897  0.000000 -0.034855 -0.069624 -0.086972      ....
+ 16N   /  4:      ....  0.191621  0.174274  0.139504  0.104649  0.069752  0.034855  0.000000 -0.034770 -0.052117      ....
+ 14N   /  3:      ....  0.226391  0.209043  0.174274  0.139419  0.104522  0.069624  0.034770  0.000000 -0.017348      ....
+ 12N   /  2:      ....  0.243739  0.226391  0.191621  0.156767  0.121869  0.086972  0.052117  0.017348  0.000000      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      .... -0.057531 -0.086987 -0.119152 -0.153259 -0.187881 -0.221435 -0.252146 -0.279109      ....
+ 28N   / 10:      ....  0.001469 -0.031719 -0.066314 -0.100631 -0.135459 -0.170322 -0.204898 -0.238648 -0.268796 -0.279109
+ 26N   /  9:      ....  0.030054  0.001289 -0.034598 -0.069227 -0.104122 -0.139020 -0.173835 -0.208160 -0.238648 -0.252146
+ 24N   /  8:      ....  0.062225  0.036296 -0.000330 -0.034822 -0.069721 -0.104621 -0.139444 -0.173835 -0.204898 -0.221435
+ 22N   /  7:      ....  0.096660  0.071306  0.034440  0.000001 -0.034898 -0.069798 -0.104621 -0.139020 -0.170322 -0.187881
+ 20N   /  6:      ....  0.131820  0.106170  0.069324  0.034901  0.000001 -0.034898 -0.069721 -0.104122 -0.135459 -0.153259
+ 18N   /  5:      ....  0.166766  0.141022  0.104198  0.069800  0.034901  0.000001 -0.034822 -0.069227 -0.100631 -0.119152
+ 16N   /  4:      ....  0.200738  0.175293  0.138438  0.104198  0.069324  0.034440 -0.000330 -0.034598 -0.066314 -0.086987
+ 14N   /  3:      ....  0.233148  0.215255  0.175293  0.141022  0.106170  0.071306  0.036296  0.001289 -0.031719 -0.057531
+ 12N   /  2:      ....      ....  0.233148  0.200738  0.166766  0.131820  0.096660  0.062225  0.030054  0.001469      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+           SMXZ_XS   SMXZ_ZS   SMXZ
+1    /  1:  173.000  15.0000  1.51981
+2    /  2:  174.000  15.0000  1.50247
+3    /  3:  175.000  15.0000  1.48510
+4    /  4:  176.000  15.0000  1.46770
+5    /  5:  177.000  15.0000  1.45028
+6    /  6:  178.000  15.0000  1.43284
+7    /  7:  179.000  15.0000  1.41539
+8    /  8:  180.000  15.0000  1.39794
+9    /  9: -179.000  15.0000  1.38049
+10   / 10: -178.000  15.0000  1.36304
+11   / 11: -177.000  15.0000  1.34560
+12   / 12: -176.000  15.0000  1.32818
+13   / 13: -175.000  15.0000  1.31078
+14   / 14: -174.000  15.0000  1.29341
+15   / 15: -173.000  15.0000  1.27607
+16   / 16:  173.000  20.0000  1.59899
+17   / 17:  174.000  20.0000  1.58165
+18   / 18:  175.000  20.0000  1.56428
+19   / 19:  176.000  20.0000  1.54688
+20   / 20:  177.000  20.0000  1.52946
+21   / 21:  178.000  20.0000  1.51202
+22   / 22:  179.000  20.0000  1.49457
+23   / 23:  180.000  20.0000  1.47712
+24   / 24: -179.000  20.0000  1.45967
+25   / 25: -178.000  20.0000  1.44222
+26   / 26: -177.000  20.0000  1.42479
+27   / 27: -176.000  20.0000  1.40736
+28   / 28: -175.000  20.0000  1.38997
+29   / 29: -174.000  20.0000  1.37259
+30   / 30: -173.000  20.0000  1.35525
+31   / 31:  173.000  25.0000  1.66594
+32   / 32:  174.000  25.0000  1.64860
+33   / 33:  175.000  25.0000  1.63122
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+           SMXT_XS   SMXT_TS   SMXT
+1    /  1:  173.000   273.75  2.63208
+2    /  2:  174.000   273.75  2.61474
+3    /  3:  175.000   273.75  2.59737
+4    /  4:  176.000   273.75  2.57997
+5    /  5:  177.000   273.75  2.56255
+6    /  6:  178.000   273.75  2.54511
+7    /  7:  179.000   273.75  2.52766
+8    /  8:  180.000   273.75  2.51021
+9    /  9: -179.000   273.75  2.49276
+10   / 10: -178.000   273.75  2.47531
+11   / 11: -177.000   273.75  2.45787
+12   / 12: -176.000   273.75  2.44045
+13   / 13: -175.000   273.75  2.42305
+14   / 14: -174.000   273.75  2.40568
+15   / 15: -173.000   273.75  2.38834
+16   / 16:  173.000   821.25  3.06201
+17   / 17:  174.000   821.25  3.04467
+18   / 18:  175.000   821.25  3.02730
+19   / 19:  176.000   821.25  3.00990
+20   / 20:  177.000   821.25  2.99248
+21   / 21:  178.000   821.25  2.97504
+22   / 22:  179.000   821.25  2.95760
+23   / 23:  180.000   821.25  2.94014
+24   / 24: -179.000   821.25  2.92269
+25   / 25: -178.000   821.25  2.90524
+26   / 26: -177.000   821.25  2.88781
+27   / 27: -176.000   821.25  2.87039
+28   / 28: -175.000   821.25  2.85299
+29   / 29: -174.000   821.25  2.83561
+30   / 30: -173.000   821.25  2.81827
+31   / 31:  173.000  1368.75  3.27378
+32   / 32:  174.000  1368.75  3.25643
+33   / 33:  175.000  1368.75  3.23906
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+           SMYZ_YS   SMYZ_ZS   SMYZ
+1    /  1:  13.0000  15.0000  1.51981
+2    /  2:  14.0000  15.0000  1.50247
+3    /  3:  15.0000  15.0000  1.48510
+4    /  4:  16.0000  15.0000  1.46770
+5    /  5:  17.0000  15.0000  1.45028
+6    /  6:  18.0000  15.0000  1.43284
+7    /  7:  19.0000  15.0000  1.41539
+8    /  8:  20.0000  15.0000  1.39794
+9    /  9:  21.0000  15.0000  1.38049
+10   / 10:  22.0000  15.0000  1.36304
+11   / 11:  23.0000  15.0000  1.34560
+12   / 12:  24.0000  15.0000  1.32818
+13   / 13:  25.0000  15.0000  1.31078
+14   / 14:  26.0000  15.0000  1.29341
+15   / 15:  27.0000  15.0000  1.27607
+16   / 16:  13.0000  20.0000  1.59899
+17   / 17:  14.0000  20.0000  1.58165
+18   / 18:  15.0000  20.0000  1.56428
+19   / 19:  16.0000  20.0000  1.54688
+20   / 20:  17.0000  20.0000  1.52946
+21   / 21:  18.0000  20.0000  1.51202
+22   / 22:  19.0000  20.0000  1.49457
+23   / 23:  20.0000  20.0000  1.47712
+24   / 24:  21.0000  20.0000  1.45967
+25   / 25:  22.0000  20.0000  1.44222
+26   / 26:  23.0000  20.0000  1.42479
+27   / 27:  24.0000  20.0000  1.40736
+28   / 28:  25.0000  20.0000  1.38997
+29   / 29:  26.0000  20.0000  1.37259
+30   / 30:  27.0000  20.0000  1.35525
+31   / 31:  13.0000  25.0000  1.66594
+32   / 32:  14.0000  25.0000  1.64860
+33   / 33:  15.0000  25.0000  1.63122
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+           SMYT_YS   SMYT_TS   SMYT
+1    /  1:  13.0000   273.75  2.63208
+2    /  2:  14.0000   273.75  2.61474
+3    /  3:  15.0000   273.75  2.59737
+4    /  4:  16.0000   273.75  2.57997
+5    /  5:  17.0000   273.75  2.56255
+6    /  6:  18.0000   273.75  2.54511
+7    /  7:  19.0000   273.75  2.52766
+8    /  8:  20.0000   273.75  2.51021
+9    /  9:  21.0000   273.75  2.49276
+10   / 10:  22.0000   273.75  2.47531
+11   / 11:  23.0000   273.75  2.45787
+12   / 12:  24.0000   273.75  2.44045
+13   / 13:  25.0000   273.75  2.42305
+14   / 14:  26.0000   273.75  2.40568
+15   / 15:  27.0000   273.75  2.38834
+16   / 16:  13.0000   821.25  3.06201
+17   / 17:  14.0000   821.25  3.04467
+18   / 18:  15.0000   821.25  3.02730
+19   / 19:  16.0000   821.25  3.00990
+20   / 20:  17.0000   821.25  2.99248
+21   / 21:  18.0000   821.25  2.97504
+22   / 22:  19.0000   821.25  2.95760
+23   / 23:  20.0000   821.25  2.94014
+24   / 24:  21.0000   821.25  2.92269
+25   / 25:  22.0000   821.25  2.90524
+26   / 26:  23.0000   821.25  2.88781
+27   / 27:  24.0000   821.25  2.87039
+28   / 28:  25.0000   821.25  2.85299
+29   / 29:  26.0000   821.25  2.83561
+30   / 30:  27.0000   821.25  2.81827
+31   / 31:  13.0000  1368.75  3.27378
+32   / 32:  14.0000  1368.75  3.25643
+33   / 33:  15.0000  1368.75  3.23906
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+           SMZT_ZS   SMZT_TS   SMZT
+1    /  1:  15.0000   273.75  3.90815
+2    /  2:  20.0000   273.75  3.98733
+3    /  3:  25.0000   273.75  4.05428
+4    /  4:  30.0000   273.75  4.11227
+5    /  5:  35.0000   273.75  4.16342
+6    /  6:  40.0000   273.75  4.20918
+7    /  7:  45.0000   273.75  4.25057
+8    /  8:  50.0000   273.75  4.28836
+9    /  9:  55.0000   273.75  4.32312
+10   / 10:  60.0000   273.75  4.35531
+11   / 11:  65.0000   273.75  4.38527
+12   / 12:  70.0000   273.75  4.41330
+13   / 13:  75.0000   273.75  4.43963
+14   / 14:  80.0000   273.75  4.46445
+15   / 15:  85.0000   273.75  4.48793
+16   / 16:  15.0000   821.25  4.33808
+17   / 17:  20.0000   821.25  4.41726
+18   / 18:  25.0000   821.25  4.48421
+19   / 19:  30.0000   821.25  4.54220
+20   / 20:  35.0000   821.25  4.59336
+21   / 21:  40.0000   821.25  4.63911
+22   / 22:  45.0000   821.25  4.68051
+23   / 23:  50.0000   821.25  4.71829
+24   / 24:  55.0000   821.25  4.75306
+25   / 25:  60.0000   821.25  4.78524
+26   / 26:  65.0000   821.25  4.81520
+27   / 27:  70.0000   821.25  4.84323
+28   / 28:  75.0000   821.25  4.86956
+29   / 29:  80.0000   821.25  4.89439
+30   / 30:  85.0000   821.25  4.91787
+31   / 31:  15.0000  1368.75  4.54985
+32   / 32:  20.0000  1368.75  4.62903
+33   / 33:  25.0000  1368.75  4.69597
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  3.90815  3.98474  4.11082  4.20825  4.28772  4.35484  4.41294  4.46417  4.48793     ....
+ 15-FEB-1995 /  2:     ....  4.44396  4.52055  4.64663  4.74407  4.82353  4.89065  4.94875  4.99998  5.02375     ....
+ 18-MAR-1995 /  3:     ....  4.69158  4.76817  4.89425  4.99168  5.07115  5.13827  5.19637  5.24760  5.27136     ....
+ 17-APR-1995 /  4:     ....  4.79826  4.87485  5.00093  5.09837  5.17783  5.24495  5.30305  5.35428  5.37805     ....
+ 17-MAY-1995 /  5:     ....  4.91957  4.99616  5.12224  5.21967  5.29914  5.36626  5.42436  5.47559  5.49935     ....
+ 17-JUN-1995 /  6:     ....  5.01664  5.09323  5.21931  5.31675  5.39621  5.46333  5.52143  5.57266  5.59643     ....
+ 17-JUL-1995 /  7:     ....  5.07038  5.14697  5.27305  5.37049  5.44995  5.51707  5.57517  5.62640  5.65017     ....
+ 17-AUG-1995 /  8:     ....  5.13974  5.21633  5.34241  5.43984  5.51931  5.58643  5.64453  5.69576  5.71952     ....
+ 16-SEP-1995 /  9:     ....  5.20046  5.27705  5.40313  5.50056  5.58003  5.64714  5.70525  5.75648  5.78024     ....
+ 16-OCT-1995 / 10:     ....  5.23640  5.31298  5.43907  5.53650  5.61597  5.68308  5.74119  5.79241  5.81618     ....
+ 16-NOV-1995 / 11:     ....  5.28500  5.36159  5.48767  5.58511  5.66457  5.73169  5.78979  5.84102  5.86479     ....
+ 16-DEC-1995 / 12:     ....  5.32921  5.40580  5.53188  5.62931  5.70878  5.77589  5.83400  5.88523  5.90899     ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  4.01260  4.01103  4.18210  4.27779  4.35640  4.42302  4.48082  4.53115  4.59056  4.66549
+ 15-FEB-1995 /  2:     ....  4.33307  4.54051  4.67120  4.76690  4.84550  4.91213  4.96992  5.02025  5.05263  4.98503
+ 18-MAR-1995 /  3:     ....  4.58238  4.74650  4.87751  4.97320  5.05181  5.11843  5.17623  5.22656  5.25909  5.23387
+ 17-APR-1995 /  4:     ....  4.74816  4.87728  5.01937  5.11506  5.19367  5.26030  5.31809  5.36842  5.40831  5.39943
+ 17-MAY-1995 /  5:     ....  4.86788  4.98645  5.12825  5.22394  5.30254  5.36917  5.42697  5.47730  5.51696  5.51891
+ 17-JUN-1995 /  6:     ....  4.95864  5.07392  5.21453  5.31022  5.38882  5.45545  5.51325  5.56358  5.60243  5.60948
+ 17-JUL-1995 /  7:     ....  5.02839  5.14132  5.28493  5.38062  5.45923  5.52585  5.58365  5.63398  5.67485  5.67935
+ 17-AUG-1995 /  8:     ....  5.09002  5.20515  5.34732  5.44301  5.52162  5.58824  5.64604  5.69637  5.73635  5.74158
+ 16-SEP-1995 /  9:     ....  5.14392  5.26070  5.40159  5.49728  5.57588  5.64251  5.70031  5.75064  5.78987  5.79641
+ 16-OCT-1995 / 10:     ....  5.18891  5.30597  5.44856  5.54425  5.62285  5.68948  5.74728  5.79761  5.83810  5.84235
+ 16-NOV-1995 / 11:     ....  5.23042  5.35103  5.49229  5.58798  5.66658  5.73321  5.79101  5.84134  5.88103  5.88458
+ 16-DEC-1995 / 12:     ....  5.26827  5.39059  5.53066  5.62635  5.70495  5.77158  5.82938  5.87971  5.91865  5.92282
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G017)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                 68.25N   68.75N   69.25N   69.75N   70.25N   70.75N   71.25N   71.75N  
+                  43       44       45       46       47       48       49       50
+ 15.5E / -105:     ....     ....     ....     ....     ....     ....     ....     ....
+ 16.5E / -104:     ....     ....     ....     ....     ....     ....     ....     ....
+ 17.5E / -103:     ....     ....     ....     ....     ....     ....     ....     ....
+ 18.5E / -102:     ....     ....     ....  0.45146  0.25859     ....     ....     ....
+ 19.5E / -101:     ....     ....  0.67000  0.52258  0.17310  0.04000     ....     ....
+ 20.5E / -100:     ....     ....     ....  0.45141  0.25856     ....     ....     ....
+ 21.5E /  -99:     ....     ....     ....     ....     ....     ....     ....     ....
+ 22.5E /  -98:     ....     ....     ....     ....     ....     ....     ....     ....
+ 23.5E /  -97:     ....     ....     ....     ....     ....     ....     ....     ....
+ 24.5E /  -96:     ....     ....     ....     ....     ....     ....     ....     ....
+ 25.5E /  -95:     ....     ....     ....     ....     ....     ....     ....     ....
+ 26.5E /  -94:     ....     ....     ....     ....     ....     ....     ....     ....
+ 27.5E /  -93:     ....     ....     ....     ....     ....     ....     ....     ....
+ 28.5E /  -92:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 29.5E /  -91:     ....     ....     ....  1.17000  1.17000  1.17000     ....     ....
+ 30.5E /  -90:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 31.5E /  -89:     ....     ....     ....     ....     ....     ....     ....     ....
+ 32.5E /  -88:     ....     ....     ....     ....     ....     ....     ....     ....
+ 33.5E /  -87:     ....     ....     ....     ....     ....     ....     ....     ....
+ 34.5E /  -86:     ....     ....     ....     ....     ....     ....     ....     ....
+ 35.5E /  -85:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 36.5E /  -84:     ....  1.34000  1.34000  1.34000     ....     ....     ....     ....
+ 37.5E /  -83:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 38.5E /  -82:     ....     ....     ....     ....     ....     ....     ....     ....
+ 39.5E /  -81:     ....     ....     ....     ....     ....     ....     ....     ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+          SMXYT_XS  SMXYT_YS SMXYT_TS   SMXYT
+1    /  1:  173.000  13.0000  273.750  2.75395
+2    /  2:  174.000  13.0000  273.750  2.73661
+3    /  3:  175.000  13.0000  273.750  2.71923
+4    /  4:  176.000  13.0000  273.750  2.70184
+5    /  5:  177.000  13.0000  273.750  2.68442
+6    /  6:  178.000  13.0000  273.750  2.66698
+7    /  7:  179.000  13.0000  273.750  2.64953
+8    /  8:  180.000  13.0000  273.750  2.63208
+9    /  9: -179.000  13.0000  273.750  2.61463
+10   / 10: -178.000  13.0000  273.750  2.59718
+11   / 11: -177.000  13.0000  273.750  2.57974
+12   / 12: -176.000  13.0000  273.750  2.56232
+13   / 13: -175.000  13.0000  273.750  2.54492
+14   / 14: -174.000  13.0000  273.750  2.52755
+15   / 15: -173.000  13.0000  273.750  2.51021
+16   / 16:  173.000  14.0000  273.750  2.73661
+17   / 17:  174.000  14.0000  273.750  2.71927
+18   / 18:  175.000  14.0000  273.750  2.70189
+19   / 19:  176.000  14.0000  273.750  2.68449
+20   / 20:  177.000  14.0000  273.750  2.66707
+21   / 21:  178.000  14.0000  273.750  2.64964
+22   / 22:  179.000  14.0000  273.750  2.63219
+23   / 23:  180.000  14.0000  273.750  2.61474
+24   / 24: -179.000  14.0000  273.750  2.59729
+25   / 25: -178.000  14.0000  273.750  2.57984
+26   / 26: -177.000  14.0000  273.750  2.56240
+27   / 27: -176.000  14.0000  273.750  2.54498
+28   / 28: -175.000  14.0000  273.750  2.52758
+29   / 29: -174.000  14.0000  273.750  2.51021
+30   / 30: -173.000  14.0000  273.750  2.49287
+31   / 31:  173.000  15.0000  273.750  2.71923
+32   / 32:  174.000  15.0000  273.750  2.70189
+33   / 33:  175.000  15.0000  273.750  2.68452
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ ---- L:1 T:   JAN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:2 T:   FEB-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:3 T:   MAR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:4 T:   APR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:5 T:   MAY-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:6 T:   JUN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:7 T:   JUL-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:8 T:   AUG-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:9 T:   SEP-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:10 T:   OCT-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:11 T:   NOV-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:12 T:   DEC-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: JAN-1995 to JAN-1996
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                   LTP50_TAX   LOGTP50
+06-JAN-1995 16 /  1:   136.88  2.27155
+18-JAN-1995 02 /  2:   410.63  2.66335
+29-JAN-1995 12 /  3:   684.38  2.86592
+09-FEB-1995 22 /  4:   958.13  3.00351
+21-FEB-1995 07 /  5:  1231.88  3.10785
+04-MAR-1995 17 /  6:  1505.63  3.19190
+16-MAR-1995 03 /  7:  1779.38  3.26230
+27-MAR-1995 13 /  8:  2053.13  3.32287
+07-APR-1995 22 /  9:  2326.88  3.37601
+19-APR-1995 08 / 10:  2600.63  3.42335
+30-APR-1995 18 / 11:  2874.38  3.46603
+12-MAY-1995 04 / 12:  3148.13  3.50490
+23-MAY-1995 13 / 13:  3421.88  3.54056
+03-JUN-1995 23 / 14:  3695.63  3.57352
+15-JUN-1995 09 / 15:  3969.38  3.60416
+26-JUN-1995 19 / 16:  4243.13  3.63277
+08-JUL-1995 04 / 17:  4516.88  3.65962
+19-JUL-1995 14 / 18:  4790.63  3.68490
+31-JUL-1995 00 / 19:  5064.38  3.70879
+11-AUG-1995 10 / 20:  5338.13  3.73144
+22-AUG-1995 19 / 21:  5611.88  3.75296
+03-SEP-1995 05 / 22:  5885.63  3.77347
+14-SEP-1995 15 / 23:  6159.38  3.79305
+26-SEP-1995 01 / 24:  6433.13  3.81178
+07-OCT-1995 10 / 25:  6706.88  3.82975
+18-OCT-1995 20 / 26:  6980.63  3.84699
+30-OCT-1995 06 / 27:  7254.38  3.86358
+10-NOV-1995 16 / 28:  7528.13  3.87956
+22-NOV-1995 01 / 29:  7801.88  3.89497
+03-DEC-1995 11 / 30:  8075.63  3.90986
+14-DEC-1995 21 / 31:  8349.38  3.92425
+26-DEC-1995 07 / 32:  8623.13  3.93818
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: JAN-1995 to JAN-1996
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                  NEW_TAX    AVE_T    T_CNT
+16-JAN-1995 /  1:   365.00  2.60027  3.00000
+15-FEB-1995 /  2:  1095.00  3.05568  2.00000
+18-MAR-1995 /  3:  1825.00  3.25902  3.00000
+17-APR-1995 /  4:  2555.00  3.42180  3.00000
+17-MAY-1995 /  5:  3285.00  3.52273  2.00000
+17-JUN-1995 /  6:  4015.00  3.60349  3.00000
+17-JUL-1995 /  7:  4745.00  3.68444  3.00000
+17-AUG-1995 /  8:  5475.00  3.74220  2.00000
+16-SEP-1995 /  9:  6205.00  3.79277  3.00000
+16-OCT-1995 / 10:  6935.00  3.84677  3.00000
+16-NOV-1995 / 11:  7665.00  3.88727  2.00000
+16-DEC-1995 / 12:  8395.00  3.92409  3.00000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+              1        2        3        4     
+              1        2        3        4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    5.000   10.000   15.000
+ 2   / 2:    1.000    6.000   11.000   16.000
+ 3   / 3:    2.000    7.000   12.000   17.000
+ 4   / 4:    3.000    8.000   13.000   18.000
+ 5   / 5:    4.000    9.000   14.000   19.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   25.000   30.000   35.000
+ 2   / 2:   21.000   26.000   31.000   36.000
+ 3   / 3:   22.000   27.000   32.000   37.000
+ 4   / 4:   23.000   28.000   33.000   38.000
+ 5   / 5:   24.000   29.000   34.000   39.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   45.000   50.000   55.000
+ 2   / 2:   41.000   46.000   51.000   56.000
+ 3   / 3:   42.000   47.000   52.000   57.000
+ 4   / 4:   43.000   48.000   53.000   58.000
+ 5   / 5:   44.000   49.000   54.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.000   65.000   70.000   75.000
+ 2   / 2:   61.000   66.000   71.000   76.000
+ 3   / 3:   62.000   67.000   72.000   77.000
+ 4   / 4:   63.000   68.000   73.000   78.000
+ 5   / 5:   64.000   69.000   74.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   80.000   85.000   90.000   95.000
+ 2   / 2:   81.000   86.000   91.000   96.000
+ 3   / 3:   82.000   87.000   92.000   97.000
+ 4   / 4:   83.000   88.000   93.000   98.000
+ 5   / 5:   84.000   89.000   94.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:  100.000  105.000  110.000  115.000
+ 2   / 2:  101.000  106.000  111.000  116.000
+ 3   / 3:  102.000  107.000  112.000  117.000
+ 4   / 4:  103.000  108.000  113.000  118.000
+ 5   / 5:  104.000  109.000  114.000  119.000
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.000   20.000   40.000
+ 1   / 2:    5.000   25.000   45.000
+ 2   / 3:   10.000   30.000   50.000
+ 3   / 4:   15.000   35.000   55.000
+ ---- K:2 Z:   2
+ 0   / 1:    1.000   21.000   41.000
+ 1   / 2:    6.000   26.000   46.000
+ 2   / 3:   11.000   31.000   51.000
+ 3   / 4:   16.000   36.000   56.000
+ ---- K:3 Z:   3
+ 0   / 1:    2.000   22.000   42.000
+ 1   / 2:    7.000   27.000   47.000
+ 2   / 3:   12.000   32.000   52.000
+ 3   / 4:   17.000   37.000   57.000
+ ---- K:4 Z:   4
+ 0   / 1:    3.000   23.000   43.000
+ 1   / 2:    8.000   28.000   48.000
+ 2   / 3:   13.000   33.000   53.000
+ 3   / 4:   18.000   38.000   58.000
+ ---- K:5 Z:   5
+ 0   / 1:    4.000   24.000   44.000
+ 1   / 2:    9.000   29.000   49.000
+ 2   / 3:   14.000   34.000   54.000
+ 3   / 4:   19.000   39.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.000   80.000  100.000
+ 1   / 2:   65.000   85.000  105.000
+ 2   / 3:   70.000   90.000  110.000
+ 3   / 4:   75.000   95.000  115.000
+ ---- K:2 Z:   2
+ 0   / 1:   61.000   81.000  101.000
+ 1   / 2:   66.000   86.000  106.000
+ 2   / 3:   71.000   91.000  111.000
+ 3   / 4:   76.000   96.000  116.000
+ ---- K:3 Z:   3
+ 0   / 1:   62.000   82.000  102.000
+ 1   / 2:   67.000   87.000  107.000
+ 2   / 3:   72.000   92.000  112.000
+ 3   / 4:   77.000   97.000  117.000
+ ---- K:4 Z:   4
+ 0   / 1:   63.000   83.000  103.000
+ 1   / 2:   68.000   88.000  108.000
+ 2   / 3:   73.000   93.000  113.000
+ 3   / 4:   78.000   98.000  118.000
+ ---- K:5 Z:   5
+ 0   / 1:   64.000   84.000  104.000
+ 1   / 2:   69.000   89.000  109.000
+ 2   / 3:   74.000   94.000  114.000
+ 3   / 4:   79.000   99.000  119.000
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.000   60.000
+ 1   / 2:    5.000   65.000
+ 2   / 3:   10.000   70.000
+ 3   / 4:   15.000   75.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   80.000
+ 1   / 2:   25.000   85.000
+ 2   / 3:   30.000   90.000
+ 3   / 4:   35.000   95.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000  100.000
+ 1   / 2:   45.000  105.000
+ 2   / 3:   50.000  110.000
+ 3   / 4:   55.000  115.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.000   61.000
+ 1   / 2:    6.000   66.000
+ 2   / 3:   11.000   71.000
+ 3   / 4:   16.000   76.000
+ ---- K:2 Z:   1
+ 0   / 1:   21.000   81.000
+ 1   / 2:   26.000   86.000
+ 2   / 3:   31.000   91.000
+ 3   / 4:   36.000   96.000
+ ---- K:3 Z:   2
+ 0   / 1:   41.000  101.000
+ 1   / 2:   46.000  106.000
+ 2   / 3:   51.000  111.000
+ 3   / 4:   56.000  116.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.000   62.000
+ 1   / 2:    7.000   67.000
+ 2   / 3:   12.000   72.000
+ 3   / 4:   17.000   77.000
+ ---- K:2 Z:   1
+ 0   / 1:   22.000   82.000
+ 1   / 2:   27.000   87.000
+ 2   / 3:   32.000   92.000
+ 3   / 4:   37.000   97.000
+ ---- K:3 Z:   2
+ 0   / 1:   42.000  102.000
+ 1   / 2:   47.000  107.000
+ 2   / 3:   52.000  112.000
+ 3   / 4:   57.000  117.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.000   63.000
+ 1   / 2:    8.000   68.000
+ 2   / 3:   13.000   73.000
+ 3   / 4:   18.000   78.000
+ ---- K:2 Z:   1
+ 0   / 1:   23.000   83.000
+ 1   / 2:   28.000   88.000
+ 2   / 3:   33.000   93.000
+ 3   / 4:   38.000   98.000
+ ---- K:3 Z:   2
+ 0   / 1:   43.000  103.000
+ 1   / 2:   48.000  108.000
+ 2   / 3:   53.000  113.000
+ 3   / 4:   58.000  118.000
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.000   64.000
+ 1   / 2:    9.000   69.000
+ 2   / 3:   14.000   74.000
+ 3   / 4:   19.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   24.000   84.000
+ 1   / 2:   29.000   89.000
+ 2   / 3:   34.000   94.000
+ 3   / 4:   39.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:   44.000  104.000
+ 1   / 2:   49.000  109.000
+ 2   / 3:   54.000  114.000
+ 3   / 4:   59.000  119.000
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   20.000   21.000   22.000   23.000   24.000
+ 3   / 3:   40.000   41.000   42.000   43.000   44.000
+ ---- K:2 Z:   2
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   25.000   26.000   27.000   28.000   29.000
+ 3   / 3:   45.000   46.000   47.000   48.000   49.000
+ ---- K:3 Z:   3
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   30.000   31.000   32.000   33.000   34.000
+ 3   / 3:   50.000   51.000   52.000   53.000   54.000
+ ---- K:4 Z:   4
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   35.000   36.000   37.000   38.000   39.000
+ 3   / 3:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.000   61.000   62.000   63.000   64.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ 3   / 3:  100.000  101.000  102.000  103.000  104.000
+ ---- K:2 Z:   2
+ 1   / 1:   65.000   66.000   67.000   68.000   69.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ 3   / 3:  105.000  106.000  107.000  108.000  109.000
+ ---- K:3 Z:   3
+ 1   / 1:   70.000   71.000   72.000   73.000   74.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ 3   / 3:  110.000  111.000  112.000  113.000  114.000
+ ---- K:4 Z:   4
+ 1   / 1:   75.000   76.000   77.000   78.000   79.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ 3   / 3:  115.000  116.000  117.000  118.000  119.000
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   60.000   61.000   62.000   63.000   64.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   21.000   22.000   23.000   24.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   41.000   42.000   43.000   44.000
+ 2   / 2:  100.000  101.000  102.000  103.000  104.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   65.000   66.000   67.000   68.000   69.000
+ ---- K:2 Z:   1
+ 1   / 1:   25.000   26.000   27.000   28.000   29.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ ---- K:3 Z:   2
+ 1   / 1:   45.000   46.000   47.000   48.000   49.000
+ 2   / 2:  105.000  106.000  107.000  108.000  109.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   70.000   71.000   72.000   73.000   74.000
+ ---- K:2 Z:   1
+ 1   / 1:   30.000   31.000   32.000   33.000   34.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ ---- K:3 Z:   2
+ 1   / 1:   50.000   51.000   52.000   53.000   54.000
+ 2   / 2:  110.000  111.000  112.000  113.000  114.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   35.000   36.000   37.000   38.000   39.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:   55.000   56.000   57.000   58.000   59.000
+ 2   / 2:  115.000  116.000  117.000  118.000  119.000
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   2
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:2 Z:   2
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- K:2 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+              EX#1                      ALIST
+1    /  1:  1.00000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.00000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.00000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.00000 ""                                           
+6    /  6:  5.00000 ""                                           
+7    /  7:  4.00000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.00000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.00000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.00000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.00000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+            EX#1                      BLIST
+1   / 1:  3.00000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.00000 ""                                           
+3   / 3:  6.00000 "Something new has been added"               
+4   / 4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.00000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.00000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : FEB
+                 39N    
+                 65
+ 141E   / 61:   8.8575
+ 143E   / 62:   8.5178
+ 145E   / 63:   9.2910
+ 147E   / 64:  10.2489
+ 149E   / 65:  10.9823
+ 151E   / 66:  10.8754
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  62.0000   8.5178
+2   / 2:  61.0000   8.8575
+3   / 3:  63.0000   9.2910
+4   / 4:  64.0000  10.2489
+5   / 5:  66.0000  10.8754
+6   / 6:  65.0000  10.9823
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+               1S     
+               45
+ 1    /  1:  23.7595
+ 2    /  2:  23.8632
+ 3    /  3:  23.8882
+ 4    /  4:  23.9519
+ 5    /  5:  23.9616
+ 6    /  6:  24.0241
+ 7    /  7:  24.0481
+ 8    /  8:  24.0854
+ 9    /  9:  24.2126
+ 10   / 10:  24.2807
+ 11   / 11:  24.3114
+ 12   / 12:  24.3562
+ 13   / 13:  24.3861
+ 14   / 14:  24.4567
+ 15   / 15:  24.4717
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : JAN
+          147.000
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : FEB
+               141E    
+                61
+ 49N   / 70:  1.88296
+ 47N   / 69:  2.01405
+ 45N   / 68:  3.44455
+ 43N   / 67:  4.55859
+ 41N   / 66:  6.47285
+ 39N   / 65:  8.85749
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  70.0000  1.88296
+2   / 2:  69.0000  2.01405
+3   / 3:  68.0000  3.44455
+4   / 4:  67.0000  4.55859
+5   / 5:  66.0000  6.47285
+6   / 6:  65.0000  8.85749
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : JAN
+               19E    
+                0
+ 1    /  1: -0.12500
+ 2    /  2:  0.05400
+ 3    /  3:  0.18556
+ 4    /  4:  0.30000
+ 5    /  5:  0.43875
+ 6    /  6:  0.62500
+ 7    /  7:  0.66000
+ 8    /  8:  0.72750
+ 9    /  9:  0.79955
+ 10   / 10:  1.29667
+ 11   / 11:  1.58765
+ 12   / 12:  1.60684
+ 13   / 13:  1.91667
+ 14   / 14:  2.05857
+ 15   / 15:  2.69400
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : JAN
+          32.0000
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.833S
+             TIME     : AUG-1982
+              131.5W  
+               99
+ 1    /  1:  24.6576
+ 2    /  2:  25.2599
+ 3    /  3:  25.7023
+ 4    /  4:  26.0588
+ 5    /  5:  26.1281
+ 6    /  6:  26.1309
+ 7    /  7:  26.1387
+ 8    /  8:  26.1637
+ 9    /  9:  26.2191
+ 10   / 10:  26.3090
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : JAN
+          28.8626
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+          28.8626
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                    141E    
+                     61
+ 16-JAN      / 1:  11.0274
+ 15-FEB      / 2:   8.8575
+ 17-MAR      / 3:   8.3911
+ 16-AUG      / 4:     ....
+ 15-JAN      / 5:  11.0274
+ 14-FEB      / 6:   8.8575
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+            141E    
+             61
+ 1   / 1:  11.0274
+ 2   / 2:   8.3911
+ 3   / 3:  11.0274
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+        TSORTED_  TSORTED_SST
+1   / 1:  3.00000   8.3911
+2   / 2:  2.00000   8.8575
+3   / 3:  1.00000  11.0274
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-JAN-1946 12 /  1:     ....
+ 15-FEB-1946 00 /  2:     ....
+ 16-MAR-1946 12 /  3:     ....
+ 16-APR-1946 00 /  4:     ....
+ 16-MAY-1946 12 /  5:     ....
+ 16-JUN-1946 00 /  6:     ....
+ 16-JUL-1946 12 /  7:     ....
+ 16-AUG-1946 12 /  8:     ....
+ 16-SEP-1946 00 /  9:     ....
+ 16-OCT-1946 12 / 10:     ....
+ 16-NOV-1946 00 / 11:     ....
+ 16-DEC-1946 12 / 12:  12.3500
+ 16-JAN-1947 12 / 13:     ....
+ 15-FEB-1947 00 / 14:     ....
+ 16-MAR-1947 12 / 15:     ....
+ 16-APR-1947 00 / 16:   0.0000
+ 16-MAY-1947 12 / 17:     ....
+ 16-JUN-1947 00 / 18:     ....
+ 16-JUL-1947 12 / 19:     ....
+ 16-AUG-1947 12 / 20:     ....
+ 16-SEP-1947 00 / 21:   6.6000
+ 16-OCT-1947 12 / 22:     ....
+ 16-NOV-1947 00 / 23:     ....
+ 16-DEC-1947 12 / 24:     ....
+ 16-JAN-1948 12 / 25:   4.5000
+ 15-FEB-1948 12 / 26:     ....
+ 16-MAR-1948 12 / 27:     ....
+ 16-APR-1948 00 / 28:     ....
+ 16-MAY-1948 12 / 29:     ....
+ 16-JUN-1948 00 / 30:   4.7000
+ 16-JUL-1948 12 / 31:     ....
+ 16-AUG-1948 12 / 32:     ....
+ 16-SEP-1948 00 / 33:  -5.8000
+ 16-OCT-1948 12 / 34:   0.4500
+ 16-NOV-1948 00 / 35:     ....
+ 16-DEC-1948 12 / 36:     ....
+ 16-JAN-1949 12 / 37:   4.2300
+ 15-FEB-1949 00 / 38:  -1.0800
+ 16-MAR-1949 12 / 39:   2.0700
+ 16-APR-1949 00 / 40:   0.8300
+ 16-MAY-1949 12 / 41:   0.0000
+ 16-JUN-1949 00 / 42:   5.3700
+ 16-JUL-1949 12 / 43:  -1.3000
+ 16-AUG-1949 12 / 44:   1.3800
+ 16-SEP-1949 00 / 45:   5.9200
+ 16-OCT-1949 12 / 46:   0.7100
+ 16-NOV-1949 00 / 47:  -0.9400
+ 16-DEC-1949 12 / 48:  -0.5200
+ 16-JAN-1950 12 / 49:   1.5800
+ 15-FEB-1950 00 / 50:   4.9300
+ 16-MAR-1950 12 / 51:   3.5100
+ 16-APR-1950 00 / 52:   4.5400
+ 16-MAY-1950 12 / 53:   1.6000
+ 16-JUN-1950 00 / 54:   1.3300
+ 16-JUL-1950 12 / 55:   0.9000
+ 16-AUG-1950 12 / 56:  -0.4500
+ 16-SEP-1950 00 / 57:   3.5700
+ 16-OCT-1950 12 / 58:  -8.7500
+ 16-NOV-1950 00 / 59:  -5.2400
+ 16-DEC-1950 12 / 60:  -6.4700
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 61
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+        TSORTED_IN  TSORTED_WND
+1    /  1:  58.0000  -8.7500
+2    /  2:  60.0000  -6.4700
+3    /  3:  33.0000  -5.8000
+4    /  4:  59.0000  -5.2400
+5    /  5:  43.0000  -1.3000
+6    /  6:  38.0000  -1.0800
+7    /  7:  47.0000  -0.9400
+8    /  8:  48.0000  -0.5200
+9    /  9:  56.0000  -0.4500
+10   / 10:  41.0000   0.0000
+11   / 11:  16.0000   0.0000
+12   / 12:  34.0000   0.4500
+13   / 13:  46.0000   0.7100
+14   / 14:  40.0000   0.8300
+15   / 15:  55.0000   0.9000
+16   / 16:  54.0000   1.3300
+17   / 17:  44.0000   1.3800
+18   / 18:  49.0000   1.5800
+19   / 19:  53.0000   1.6000
+20   / 20:  39.0000   2.0700
+21   / 21:  51.0000   3.5100
+22   / 22:  57.0000   3.5700
+23   / 23:  37.0000   4.2300
+24   / 24:  25.0000   4.5000
+25   / 25:  52.0000   4.5400
+26   / 26:  30.0000   4.7000
+27   / 27:  50.0000   4.9300
+28   / 28:  42.0000   5.3700
+29   / 29:  45.0000   5.9200
+30   / 30:  21.0000   6.6000
+31   / 31:  12.0000  12.3500
+32   / 32:     ....     ....
+33   / 33:     ....     ....
+34   / 34:     ....     ....
+35   / 35:     ....     ....
+36   / 36:     ....     ....
+37   / 37:     ....     ....
+38   / 38:     ....     ....
+39   / 39:     ....     ....
+40   / 40:     ....     ....
+41   / 41:     ....     ....
+42   / 42:     ....     ....
+43   / 43:     ....     ....
+44   / 44:     ....     ....
+45   / 45:     ....     ....
+46   / 46:     ....     ....
+47   / 47:     ....     ....
+48   / 48:     ....     ....
+49   / 49:     ....     ....
+50   / 50:     ....     ....
+51   / 51:     ....     ....
+52   / 52:     ....     ....
+53   / 53:     ....     ....
+54   / 54:     ....     ....
+55   / 55:     ....     ....
+56   / 56:     ....     ....
+57   / 57:     ....     ....
+58   / 58:     ....     ....
+59   / 59:     ....     ....
+60   / 60:     ....     ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 61
+          31.0000
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 61
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955  26.7131
+ 15-FEB      / 2:  28.5508  28.2499  26.3700
+ 17-MAR      / 3:  28.8764  28.4775  26.3180
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  28.2696  26.7131
+ 15-FEB      / 2:  28.5508  28.4857  26.3700
+ 17-MAR      / 3:  28.8764  28.6147  26.3180
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.22661
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+            161W    
+             90
+ 1   / 1:  1.60000
+ 2   / 2: -0.40645
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+               27W       25W       23W     
+               157       158       159
+ ---- L:1 T:   1
+ 3N   / 47: -0.175348 -0.178392 -0.309239
+ 1N   / 46: -0.308620 -0.280936 -0.291017
+ 1S   / 45: -0.271470 -0.497559 -0.595639
+ ---- L:2 T:   2
+ 3N   / 47: -0.052492 -0.002775 -0.124133
+ 1N   / 46:  0.064590  0.057180 -0.069549
+ 1S   / 45:  0.121296  0.039745 -0.034207
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:   9.0000   9.0000   9.0000
+ 2   / 2:  95.8009   4.1991   0.0000
+ 3   / 3:   1.0931   0.0479   0.0000
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                      1        2     
+                      1        2
+ 16-JAN      / 1:  1.17837 -0.78194
+ 15-FEB      / 2:  0.08800  1.41147
+ 17-MAR      / 3: -1.26637 -0.62953
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:101 T:   101
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+ ---- L:102 T:   102
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                  1        2        3        4        5     
+                  1        2        3        4        5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : JAN
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : JAN
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : JAN
+                91W    
+               125
+ 55N   / 73:     ....
+ 53N   / 72:     ....
+ 51N   / 71:     ....
+ 49N   / 70:     ....
+ 47N   / 69:   2.6969
+ 45N   / 68:  13.3500
+ 43N   / 67:     ....
+ 41N   / 66:     ....
+ 39N   / 65:     ....
+ 37N   / 64:     ....
+ 35N   / 63:     ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : JAN
+               91W    
+              125
+ 1    /  1:  13.3500
+ 2    /  2:   2.6969
+ 3    /  3:     ....
+ 4    /  4:     ....
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 11   / 11:     ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+               139.5W  
+                91
+ 5     /  1:     ....
+ 15    /  2:     ....
+ 25    /  3:     ....
+ 35    /  4:     ....
+ 45    /  5:     ....
+ 55    /  6:     ....
+ 65    /  7:  26.3984
+ 75    /  8:  26.0190
+ 85    /  9:  25.6663
+ 95    / 10:  25.3181
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+              139.5W  
+               91
+ 1    /  1:  26.3984
+ 2    /  2:  26.0190
+ 3    /  3:  25.6663
+ 4    /  4:  25.3181
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.0000
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.000000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.0000
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.0000
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.785000
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  335.000  359.000  269.000   57.000  195.000   73.000  101.000  209.000   87.000  167.000
+ 2   / 2:  -69.000  -63.000  -25.000  -13.000  -13.000  -11.000  -11.000  -11.000   -9.000   -9.000
+ 3   / 3:    0.340    0.863   23.271   28.382   29.675   28.470   28.341   28.881   28.429   29.847
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  331.000  365.000  147.000   79.000  119.000   65.000   83.000  125.000  157.000  237.000
+ 2   / 2:  -65.000  -61.000  -59.000  -53.000   -9.000   -7.000   -7.000   -7.000   -3.000   -1.000
+ 3   / 3:   -0.766   -0.063    0.400    1.607   28.333   27.646   27.757   28.387   28.721   23.888
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  13.0000
+ 2   / 2:  13.0000
+ 3   / 3:  13.0000
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  113.000
+ 2   / 2:  113.000
+ 3   / 3:  113.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ 1   / 1:     ....  1999.00  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    29.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00     0.00
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+            DDAT_A   DDAT_B   DDAT_C
+345   / 1:     ....     ....     ....
+346   / 2:     ....  1126.00  1126.00
+347   / 3:  1136.00  1136.00  1136.00
+348   / 4:  1141.00  1141.00     ....
+349   / 5:  1146.00  1146.00  1146.00
+350   / 6:  1156.00  1156.00  1156.00
+351   / 7:  1166.00  1166.00  1166.00
+352   / 8:     ....     ....     ....
+353   / 9:     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                  (C001,V001)    EX#2
+10-NOV-1982 16 / 15:  0.666667  16.0000
+16-NOV-1982 18 / 16:  0.750000  18.0000
+22-NOV-1982 20 / 17:  0.833333  20.0000
+28-NOV-1982 22 / 18:  0.916667  22.0000
+05-DEC-1982 00 / 19:  0.000000   0.0000
+11-DEC-1982 02 / 20:  0.083333   2.0000
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  10.0000  314.000
+16-NOV-1982 18 / 16:  16.0000  320.000
+22-NOV-1982 20 / 17:  22.0000  326.000
+28-NOV-1982 22 / 18:  28.0000  332.000
+05-DEC-1982 00 / 19:   5.0000  339.000
+11-DEC-1982 02 / 20:  11.0000  345.000
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  11.0000  0.860274
+16-NOV-1982 18 / 16:  11.0000  0.876712
+22-NOV-1982 20 / 17:  11.0000  0.893151
+28-NOV-1982 22 / 18:  11.0000  0.909589
+05-DEC-1982 00 / 19:  12.0000  0.928767
+11-DEC-1982 02 / 20:  12.0000  0.945205
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.00
+ 16-NOV-1982 18 / 16:  1982.00
+ 22-NOV-1982 20 / 17:  1982.00
+ 28-NOV-1982 22 / 18:  1982.00
+ 05-DEC-1982 00 / 19:  1982.00
+ 11-DEC-1982 02 / 20:  1982.00
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.00
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_strides
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:322 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:322 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:322 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:319 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G023)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:325 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.0000
+ 4    / 2:   4.0000
+ 7    / 3:   7.0000
+ 10   / 4:  10.0000
+ 13   / 5:  13.0000
+ 16   / 6:  16.0000
+ 19   / 7:  19.0000
+ 22   / 8:   2.0000
+ 25   / 9:   5.0000
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:341 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:341 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:341 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:339 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+ 24   / 4:   4.0000
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+ 24   / 3:   4.0000
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+ 25   / 3:   5.0000
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.0000
+ 6    / 2:   6.0000
+ 11   / 3:  11.0000
+ 16   / 4:  16.0000
+ 21   / 5:   1.0000
+ 26   / 6:   6.0000
+ 31   / 7:  11.0000
+ 36   / 8:  16.0000
+ 41   / 9:   1.0000
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.0000
+ 7    / 2:   7.0000
+ 12   / 3:  12.0000
+ 17   / 4:  17.0000
+ 22   / 5:   2.0000
+ 27   / 6:   7.0000
+ 32   / 7:  12.0000
+ 37   / 8:  17.0000
+ 42   / 9:   2.0000
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.0000
+ 8    / 2:   8.0000
+ 13   / 3:  13.0000
+ 18   / 4:  18.0000
+ 23   / 5:   3.0000
+ 28   / 6:   8.0000
+ 33   / 7:  13.0000
+ 38   / 8:  18.0000
+ 43   / 9:   3.0000
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.0000
+ 9    / 2:   9.0000
+ 14   / 3:  14.0000
+ 19   / 4:  19.0000
+ 24   / 5:   4.0000
+ 29   / 6:   9.0000
+ 34   / 7:  14.0000
+ 39   / 8:  19.0000
+ 44   / 9:   4.0000
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.0000
+ 10   / 2:  10.0000
+ 15   / 3:  15.0000
+ 20   / 4:  20.0000
+ 25   / 5:   5.0000
+ 30   / 6:  10.0000
+ 35   / 7:  15.0000
+ 40   / 8:  20.0000
+ 45   / 9:   5.0000
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.0000
+ 11   / 2:  11.0000
+ 16   / 3:  16.0000
+ 21   / 4:   1.0000
+ 26   / 5:   6.0000
+ 31   / 6:  11.0000
+ 36   / 7:  16.0000
+ 41   / 8:   1.0000
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.0000
+ 106   / 2:   6.0000
+ 111   / 3:  11.0000
+ 116   / 4:  16.0000
+ 121   / 5:   1.0000
+ 126   / 6:   6.0000
+ 131   / 7:  11.0000
+ 136   / 8:  16.0000
+ 141   / 9:   1.0000
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.0000
+ 107   / 2:   7.0000
+ 112   / 3:  12.0000
+ 117   / 4:  17.0000
+ 122   / 5:   2.0000
+ 127   / 6:   7.0000
+ 132   / 7:  12.0000
+ 137   / 8:  17.0000
+ 142   / 9:   2.0000
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.0000
+ 108   / 2:   8.0000
+ 113   / 3:  13.0000
+ 118   / 4:  18.0000
+ 123   / 5:   3.0000
+ 128   / 6:   8.0000
+ 133   / 7:  13.0000
+ 138   / 8:  18.0000
+ 143   / 9:   3.0000
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.0000
+ 109   / 2:   9.0000
+ 114   / 3:  14.0000
+ 119   / 4:  19.0000
+ 124   / 5:   4.0000
+ 129   / 6:   9.0000
+ 134   / 7:  14.0000
+ 139   / 8:  19.0000
+ 144   / 9:   4.0000
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.0000
+ 110   / 2:  10.0000
+ 115   / 3:  15.0000
+ 120   / 4:  20.0000
+ 125   / 5:   5.0000
+ 130   / 6:  10.0000
+ 135   / 7:  15.0000
+ 140   / 8:  20.0000
+ 145   / 9:   5.0000
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.0000
+ 111   / 2:  11.0000
+ 116   / 3:  16.0000
+ 121   / 4:   1.0000
+ 126   / 5:   6.0000
+ 131   / 6:  11.0000
+ 136   / 7:  16.0000
+ 141   / 8:   1.0000
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G023)          (AX010)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:335 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G022)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:335 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:335 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:335 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:334 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G023)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:334 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:318 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+ 
+! ******** V54 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_viewports
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/nolab {0,4.737}, {0,4.737}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/line {0,4.737}, {0,4.737}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.60   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.60   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 7.27E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.67E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strings
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string    cnst
+1   / 1: "string"            5.00000
+2   / 2: "s2"                5.00000
+3   / 3: "very long string"  5.00000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1.00000  0.00000  0.00000
+ 2   / 2:  0.00000  1.00000  0.00000
+ 3   / 3:  0.00000  0.00000  1.00000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  0.00000  1.00000  1.00000
+ 2   / 2:  1.00000  0.00000  1.00000
+ 3   / 3:  1.00000  1.00000  0.00000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  1.00000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  0.00000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axcontrol
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_curv
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_delimited_read
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6     V7       V8     V9     V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      .... " "      " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000 "word 1" " "      ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     .... "word 2" " "      ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030 " wd 3 " " "      ....
+5   / 5: " "          " "    " "    " "    " "    " "      .... " "      " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000 "word 4" "aa"  77.0000
+7   / 7: "extra line" " "    " "    " "    " "    " "      .... " "      " "      ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6     A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030
+5   / 5: " "          " "    " "    " "    " "    " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000
+7   / 7: "extra line" " "    " "    " "    " "    " "      ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2    V3       V4       V5     V6     V7       V8     V9     V10
+1   / 1: "one"       ...  1.10000 -24.0000  130.000 " "    10.000 "word 1" " "      ....
+2   / 2: "two"       ...  2.20000  24.0000 -130.000 "2S"     .... "word 2" " "      ....
+3   / 3: "three"     ...  3.30000  24.0000  130.000 "3N"    0.030 " wd 3 " " "      ....
+4   / 4: " "         ...     ....     ....     .... " "      .... " "      " "      ....
+5   / 5: "five"      ...  4.40000 -24.0000 -130.000 "91" -400.000 "word 4" "aa"  77.0000
+6   / 6: "extra line"...     ....     ....     .... " "      .... " "      " "      ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000     ....     ....     ....   10.000......     ....
+2   / 2:......  2.20000     ....     ....     ....     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000     ....    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000 -24.0000     ....     ....   10.000......     ....
+2   / 2:......  2.20000  24.0000     ....  -2.0000     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000   3.0000    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+              V1     V2
+1   / 1:  37965.0  12.5833
+2   / 2:     ....     ....
+3   / 3:  39051.0  13.7514
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5       V6       V7       V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.0  36218.0  12.0000  13.7601
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.0  36219.0   1.0037  14.7601
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.0  36220.0   2.0000  15.7500
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+              V1     V2    V3 V4    V5       V6    V7 V8
+1   / 1:  36493.0  36218.0......  36493.0  36218.0......
+2   / 2:  36494.0  36219.0......  36494.0  36219.0......
+3   / 3:     ....     ..........  36495.0  36220.0......
+4   / 4:  36496.0  36221.0......  36496.0  36221.0......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2    V3       V4    V5 V6    V7       V8
+1   / 1:......  12.0000  13.7601......  12.0000  13.7601
+2   / 2:......   1.0037  14.7601......   1.0037  14.7601
+3   / 3:......     ....     ..........   2.0000  15.7500
+4   / 4:......   3.0000  16.7601......   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+              V1     V2       V3       V4       V5       V6       V7       V8
+1   / 1:  36493.0  36218.0  12.0000  13.7601  36493.0  36218.0  12.0000  13.7601
+2   / 2:  36494.0  36219.0   1.0037  14.7601  36494.0  36219.0   1.0037  14.7601
+3   / 3:     ....     ....     ....     ....  36495.0  36220.0   2.0000  15.7500
+4   / 4:  36496.0  36221.0   3.0000  16.7601  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+              V1     V3       V5       V7
+1   / 1:  36493.0  12.0000  36493.0  12.0000
+2   / 2:  36494.0   1.0037  36494.0   1.0037
+3   / 3:     ....     ....  36495.0   2.0000
+4   / 4:  36496.0   3.0000  36496.0   3.0000
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+              V1     V2                        V3                       V4
+1   / 1:  12.0000  1.00000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.00000
+2   / 2:  12.0000  2.00000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.00000
+3   / 3:  12.0000  3.00000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.00000
+4   / 4:  12.0000  4.00000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.00000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+              V1     V2      V3        V4           V5           V6         V7       V8
+1   / 1:  12.0000  1.00000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6       V7           V8         V9       V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6     V7      V8     V9     V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"   12.0000 "00"   13.0000 "45" 
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"    1.0000 "00"   13.5000 "14" 
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x"   2.0000 "00x"  15.0000 "45x"
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"    3.0000 "00"   16.0000 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1     V2     V3    V4       V5       V6       V7       V8       V9       V10      V11      V12      V13       V14      V15      V16      V17       V18      V19      V20       V21      V22      V23      V24      V25      V26
+1    /  1: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    10.00  21.1028  35.9408  0.00000  36.0000  0.000000  1.00000     9.80  224.641  0.000000   0.1172  0.00000  0.000000  0.00000   1.0156  0.00000  0.11621  0.00000  2.22900
+2    /  2: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    54.00  19.8913  35.9437  0.00000  35.0000  0.000000  1.00000    54.70  233.185  0.000000   0.1465  0.00000  0.000000  0.00000   1.0351  0.00000  0.13769  0.00000  2.43100
+3    /  3: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    79.00  19.0138  35.9186  0.00000  34.0000  0.000000  1.00000    79.50  237.026  0.000000   0.1660  0.00000  0.000000  0.00000   1.0449  0.00000  0.13085  0.00000  2.51600
+4    /  4: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   104.00  18.0026  35.8627  0.00000  33.0000  0.000000  1.00000   104.60  233.766  0.000000   0.1855  0.00000  0.000000  0.00000   1.0645  0.00000  0.16602  0.00000  2.65000
+5    /  5: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   154.00  16.3595  35.7126  0.00000  32.0000  0.000000  1.00000   155.10  230.216  0.000000   0.9083  0.00000  0.146501  0.00000   0.8985  0.00000  0.26566  0.00000  2.84600
+6    /  6: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   204.00  14.8461  35.5541  0.00000  31.0000  0.000000  1.00000   206.00  222.307  0.000000   3.7899  0.00000  0.009768  0.00000   1.4359  0.00000  0.44542  0.00000  2.95400
+7    /  7: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   253.00  13.7175  35.3809  0.00000  29.0000  0.000000  1.00000   255.20  227.612  0.000000   5.5293  0.00000  0.009769  0.00000   1.6315  0.00000  0.55880  0.00000  3.00600
+8    /  8: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   254.00  13.7070  35.3835  0.00000  30.0000  0.000000  1.00000   255.60  227.350  0.000000   5.5098  0.00000  0.009769  0.00000   1.7877  0.00000  0.55489  0.00000  2.99600
+9    /  9: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   305.00  12.6234  35.2123  0.00000  28.0000  0.000000  1.00000   307.20  230.868  0.000000   7.6502  0.00000  0.009770  0.00000   2.1593  0.00000  0.68588  0.00000  3.13400
+10   / 10: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   353.00  12.0102  35.1165  0.00000  27.0000  0.000000  1.00000   355.70  235.378  0.000000   8.7158  0.00000  0.009771  0.00000   2.5209  0.00000  0.75335  0.00000  3.19000
+11   / 11: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   404.00  11.4592     ....  9.00000  26.0000  0.000000  1.00000   406.90     ....  0.000000     ....  9.00000      ....  9.00000     ....  9.00000     ....  9.00000  3.25500
+12   / 12: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   452.00  11.0375  34.9575  0.00000  25.0000  0.000000  1.00000   455.90  239.899  0.000000  10.9546  0.00000  0.000000  0.00000   3.0489  0.00000  0.88438  0.00000  3.24500
+13   / 13: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   502.00  10.5797  34.8825  0.00000  24.0000  0.000000  1.00000   506.00  241.090  0.000000  12.1377  0.00000  0.000000  0.00000   3.4009  0.00000  0.95871  0.00000  3.19500
+14   / 14: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   601.00   9.8037  34.7585  0.00000  23.0000  0.000000  1.00000   605.90  238.538  0.000000  14.4357  0.00000  0.000000  0.00000   4.2711  0.00000  1.11419  0.00000     ....
+15   / 15: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   701.00   9.0245  34.6510  0.00000  22.0000  0.000000  1.00000   706.70  229.219  0.000000  17.5353  0.00000  0.000000  0.00000   6.1774  0.00000  1.31173  0.00000  2.45400
+16   / 16: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   800.00   7.6879  34.5292  0.00000  21.0000  0.000000  1.00000   807.00  206.678  0.000000  22.7373  0.00000  0.000000  0.00000  13.2162  0.00000  1.63345  0.00000  1.32000
+17   / 17: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   899.00   6.2124  34.4434  0.00000  20.0000  0.000000  1.00000   907.30  194.602  0.000000  27.2943  0.00000  0.000000  0.00000  23.8630  0.00000  1.92683  0.00000  0.73200
+18   / 18: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   999.00   4.9587  34.4055  0.00000  19.0000  0.000000  1.00000  1008.40  186.926  0.000000  30.2768  0.00000  0.000000  0.00000  36.3870  0.00000  2.15272  0.00000  0.42900
+19   / 19: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00  1098.00   4.3083  34.4383  0.00000  18.0000  0.000000  1.00000  1109.00  171.821  0.000000  32.2020  0.00000  0.000000  0.00000  50.4537  0.00000  2.29735  0.00000  0.19800
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+               V11     V19      V21      V23      V25
+8    /  8:  0.00000  0.00000  0.00000  0.00000  0.00000
+9    /  9:  0.00000  0.00000  0.00000  0.00000  0.00000
+10   / 10:  0.00000  0.00000  0.00000  0.00000  0.00000
+11   / 11:  9.00000  9.00000  9.00000  9.00000  9.00000
+12   / 12:  0.00000  0.00000  0.00000  0.00000  0.00000
+13   / 13:  0.00000  0.00000  0.00000  0.00000  0.00000
+14   / 14:  0.00000  0.00000  0.00000  0.00000  0.00000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+                V11     V19       V21       V23       V25
+8    /  8:  0.000000  0.000000  0.000000  0.000000  0.000000
+9    /  9:  0.000000  0.000000  0.000000  0.000000  0.000000
+10   / 10:  0.000000  0.000000  0.000000  0.000000  0.000000
+11   / 11:      ....      ....      ....      ....      ....
+12   / 12:  0.000000  0.000000  0.000000  0.000000  0.000000
+13   / 13:  0.000000  0.000000  0.000000  0.000000  0.000000
+14   / 14:  0.000000  0.000000  0.000000  0.000000  0.000000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+ 
+ 
+! ******** V5.41 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn541_bug_fixes
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955     ....
+ 15-FEB      / 2:  28.5508  28.2499     ....
+ 17-MAR      / 3:  28.8764  28.4775     ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045     ....  26.9596
+ 15-FEB      / 2:  28.5508     ....  26.7875
+ 17-MAR      / 3:  28.8764     ....  27.1092
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX010)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 279  complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.00000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_axes
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+ 
+! ******** V5.42 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn542_bug_fixes
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+ 
+! ******** V5.50 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_subspan_modulo
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       43       44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  13.0000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M: 11 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  6 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  5 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M: 17 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.0000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.0000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.0000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.0393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+             ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+             ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+             ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      / 2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      / 3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0002 / 14:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0002 / 15:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+ 15-APR-0002 / 16:  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000
+ 15-MAY-0002 / 17:  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0003 / 20:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0003 / 21:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0002 / 14:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0002 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 / 16:  102.000     ....     ....     ....  106.000     ....  101.000  102.000     ....     ....     ....
+ 15-MAY-0002 / 17:  132.000     ....     ....     ....  136.000     ....  131.000  132.000     ....     ....     ....
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0003 / 20:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0003 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0002 / 14:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0002 / 15:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 15-APR-0002 / 16:  102.000  102.000  104.000  106.000  106.000     ....  101.000  102.000  102.000  104.000  106.000
+ 15-MAY-0002 / 17:  132.000  132.000  134.000  136.000  136.000     ....  131.000  132.000  132.000  134.000  136.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0003 / 20:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0003 / 21:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0002 / 13:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0002 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 / 15:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 15-APR-0002 / 16:   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000     ....
+ 15-MAY-0002 / 17:   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000     ....
+ 15-SEP-0002 / 18:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0003 / 19:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0003 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 / 21:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G008)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G008)          (AX017)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G008)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 16-MAR-0000 / 2:   71.000
+ 15-MAY-0000 / 3:  131.000
+ 15-JAN-0001 / 4:   11.000
+ 16-MAR-0001 / 5:   71.000
+ 15-MAY-0001 / 6:  131.000
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   71.000
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.000
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.000
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.000
+ 16-MAR-0001 / 3:   71.000
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0000 / 2:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0001 / 4:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.00000
+ 15-FEB      / 2:  2.00000
+ 16-MAR      / 3:  3.00000
+ 15-APR      / 4:  4.00000
+ 15-MAY      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.0000
+ 15-FEB      / 2:  10.0000
+ 16-MAR      / 3:  10.0000
+ 15-APR      / 4:  10.0000
+ 15-MAY      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.00000
+ 15-SEP-0166 / 1002:     ....
+ 16-JAN-0167 / 1003:  1.00000
+ 15-FEB-0167 / 1004:  2.00000
+ 17-MAR-0167 / 1005:  3.00000
+ 16-APR-0167 / 1006:  4.00000
+ 16-MAY-0167 / 1007:  5.00000
+ 16-SEP-0167 / 1008:     ....
+ 16-JAN-0168 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       42.1     44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  12.1000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.1000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.1000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.1000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.7393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+             ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+             ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+             ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      / 2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      / 3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      / 4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      / 5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0002 05 / 15:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+ 15-APR-0002 17 / 16:  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0003 11 / 21:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0002 14 / 14:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0002 05 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 17 / 16:  102.249  102.349     ....     ....  106.249     ....  101.249  102.249  102.349     ....     ....
+ 15-MAY-0002 17 / 17:  132.249  132.349     ....     ....  136.249     ....  131.249  132.249  132.349     ....     ....
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0003 20 / 20:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0003 11 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0002 05 / 15:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 15-APR-0002 17 / 16:  102.249  102.349  102.349  106.249  106.249     ....  101.249  102.249  102.349  102.349  106.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  132.349  136.249  136.249     ....  131.249  132.249  132.349  132.349  136.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0003 11 / 21:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 15-JAN-0002 23 / 13:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0002 14 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 05 / 15:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 15-APR-0002 17 / 16:   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000     ....
+ 15-MAY-0002 17 / 17:   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249     ....
+ 15-SEP-0002 05 / 18:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 16-JAN-0003 05 / 19:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0003 20 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 11 / 21:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G018)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G018)          (AX010)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G018)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 15-MAR-0000 / 2:   70.249
+ 15-MAY-0000 / 3:  131.249
+ 15-JAN-0001 / 4:   11.000
+ 15-MAR-0001 / 5:   70.249
+ 15-MAY-0001 / 6:  131.249
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   70.249
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.249
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.249
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.249
+ 15-MAR-0001 / 3:   70.249
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0000 / 2:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0001 / 4:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.00000
+ 15-FEB 02      / 2:  2.00000
+ 15-MAR 17      / 3:  3.00000
+ 15-APR 05      / 4:  4.00000
+ 15-MAY 05      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.0000
+ 15-FEB 02      / 2:  10.0000
+ 15-MAR 17      / 3:  10.0000
+ 15-APR 05      / 4:  10.0000
+ 15-MAY 05      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.00000
+ 15-SEP-0166 23 / 1002:     ....
+ 16-JAN-0167 23 / 1003:  1.00000
+ 15-FEB-0167 14 / 1004:  2.00000
+ 17-MAR-0167 05 / 1005:  3.00000
+ 16-APR-0167 17 / 1006:  4.00000
+ 16-MAY-0167 17 / 1007:  5.00000
+ 16-SEP-0167 05 / 1008:     ....
+ 17-JAN-0168 05 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dots
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lev_symbols
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+ 
+GO bn_reset
+cancel mode verify
+! GO bench_extrema  ! moved to bn_ef_bench_extrema; tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_logo_lab
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL       CANCELLED      ferret.jnl
+      LONG_LABEL       SET              -4
+      LATIT_LABEL      SET              -4
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         months
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      dots.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+plot/vs/over/line/color=white {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_attribute
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_FIELD_J_AXIS Y             2 r   50                   65
+   Axis span (to cell edges) = 30
+ LON_FIELD_I_AXIS X             7 r   160                  208
+   Axis span (to cell edges) = 56
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME      T (HOURS)           20 r   1                    20
+   Axis span (to cell edges) = 20
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ TIME5     TIME                 2mr   16-MAY 23:56         16-JUN 10:25
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn550_bug_fixes
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+ 
+! ******** V5.51 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn551_bug_fixes
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME3
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.00000
+ 10-JUN-1996 04:03:37 / 2:  1.00000
+ 10-JUN-1996 04:03:38 / 3:  2.00000
+ 10-JUN-1996 04:03:39 / 4:  3.00000
+ 10-JUN-1996 04:03:40 / 5:  4.00000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+ 
+! ******** V5.52 Additions below ***********
+ 
+GO bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 7.74
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+ 
+GO bn_reset
+cancel mode verify
+GO bn552_bug_fixes
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : JAN
+                20N    
+                 6
+ 110W   / 1:  24.0382
+ 105W   / 2:  25.4564
+ 100W   / 3:  24.5714
+ 95W    / 4:  23.8243
+ 90W    / 5:  24.9977
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.00000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.00000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.167S
+                     100.5W  
+                     130
+ 16-JUL-1966 /  1: -1.42152
+ 15-AUG-1966 /  2: -2.97198
+ 14-SEP-1966 /  3: -4.50335
+ 15-OCT-1966 /  4: -3.88179
+ 14-NOV-1966 /  5: -2.57982
+ 15-DEC-1966 /  6: -1.07968
+ 14-JAN-1967 /  7:  1.42391
+ 14-FEB-1967 /  8:  2.96231
+ 16-MAR-1967 /  9:  4.50322
+ 15-APR-1967 / 10:  3.83807
+ 16-MAY-1967 / 11:  2.60886
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                          1
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.00
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.00
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.00
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+        A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:  12.0000  14.0000
+2   / 2:  14.0000  20.0000
+3   / 3:  20.0000  28.0000
+4   / 4:  28.0000  22.0000
+5   / 5:  22.0000  10.0000
+6   / 6:  10.0000     ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+              1        2        3     
+              1        2        3
+ 1   / 1:  3.00000  5.00000  7.00000
+ 2   / 2:  4.00000  6.00000  8.00000
+ 3   / 3:  5.00000  7.00000  9.00000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:   5.0000   7.0000   9.0000  11.0000  13.0000
+ 2   / 2:   7.0000  11.0000  15.0000  19.0000  23.0000
+ 3   / 3:   9.0000  15.0000  21.0000  27.0000  33.0000
+ 4   / 4:  11.0000  19.0000  27.0000  35.0000  43.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.94
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.8
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.94,,1.8
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.94    10.23     1.80     7.21
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.94
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 6.405
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.94,,6.405
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.65     9.94     1.00     6.41
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.3
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 6.905
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.305
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,6.905,7.305
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30    10.04     6.91     7.30
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.2
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.94
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.4
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,8.94,1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.20     8.94     1.40     1.49
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.2  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.2  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.7,1.1
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.4
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.20     9.94    -1.40    -1.31
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.25380  2.34749  2.42382  2.47460  2.50064
+ 2.17S / 4:  2.26997  2.36147  2.43073  2.47739  2.50277
+ 2.5S  / 3:  2.26576  2.35100  2.41285  2.45516  2.48145
+ 2.83S / 2:  2.23354  2.30728  2.35946  2.39631  2.42393
+ 3.17S / 1:  2.16829  2.22692  2.26870  2.30046  2.33013
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.28179  2.37704  2.45447  2.50708  2.53486
+ 2.17S / 4:  2.29644  2.38952  2.46056  2.50887  2.53607
+ 2.5S  / 3:  2.29075  2.37736  2.44104  2.48452  2.51240
+ 2.83S / 2:  2.25743  2.33286  2.38636  2.42369  2.45233
+ 3.17S / 1:  2.19089  2.25118  2.29360  2.32531  2.35557
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.72333  1.84007  1.94120  2.00514  2.04715
+ 2.17S / 4:  1.63876  1.74435  1.83141  1.88234  1.91985
+ 2.5S  / 3:  1.51509  1.60488  1.67644  1.71352  1.74562
+ 2.83S / 2:  1.35750  1.42836  1.48145  1.50285  1.52819
+ 3.17S / 1:  1.17476  1.22230  1.25622  1.26294  1.28236
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.21576  1.30112  1.37420  1.42210  1.45249
+ 2.17S / 4:  1.08595  1.16417  1.22895  1.26976  1.29822
+ 2.5S  / 3:  0.93683  1.00553  1.05923  1.09102  1.11580
+ 2.83S / 2:  0.77184  0.82972  0.86888  0.89054  0.91114
+ 3.17S / 1:  0.59936  0.64140  0.66649  0.68065  0.69951
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.81161
+ 23-AUG-1982 14 / 2: -1.75761
+ 29-AUG-1982 16 / 3: -1.67763
+ 04-SEP-1982 18 / 4: -1.57055
+ 10-SEP-1982 20 / 5: -1.42678
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -2.21821
+ 23-AUG-1982 14 / 2: -2.04941
+ 29-AUG-1982 16 / 3: -1.77359
+ 04-SEP-1982 18 / 4: -1.41208
+ 10-SEP-1982 20 / 5: -1.05323
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.77560
+ 23-AUG-1982 14 / 2: -1.45491
+ 29-AUG-1982 16 / 3: -1.24196
+ 04-SEP-1982 18 / 4: -1.05135
+ 10-SEP-1982 20 / 5: -0.84706
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                         1      
+                          1
+ 17-AUG-1982 12 / 1:  0.003693
+ 23-AUG-1982 14 / 2: -0.189178
+ 29-AUG-1982 16 / 3: -0.298222
+ 04-SEP-1982 18 / 4: -0.405668
+ 10-SEP-1982 20 / 5: -0.517797
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.0000
+ 15    /  2:  25.0000
+ 25    /  3:  25.0000
+ 35    /  4:  25.0000
+ 45    /  5:  25.0000
+ 55    /  6:  25.0000
+ 65    /  7:  25.0000
+ 75    /  8:  25.0000
+ 85    /  9:  25.0000
+ 95    / 10:  25.0000
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.2678   0.6794   0.0319   0.0157   0.0031
+ 45    / 2:  98.6525   1.1464   0.1451   0.0296   0.0198
+ 85    / 3:  95.1217   4.5698   0.2195   0.0744   0.0084
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.576
+ 2   / 2:    0.955
+ 3   / 3:    0.045
+ 4   / 4:    0.022
+ 5   / 5:    0.004
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.8576
+ 2   / 2:   0.1262
+ 3   / 3:   0.0160
+ 4   / 4:   0.0033
+ 5   / 5:   0.0022
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.23641
+ 2   / 2:  0.10744
+ 3   / 3:  0.00516
+ 4   / 4:  0.00175
+ 5   / 5:  0.00020
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+GO bn_reset
+cancel mode verify
+GO bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_zaxr_fcns.jnl ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+ 
+! ******** V5.53 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT1
+<axes>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME6
+<axes>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME4">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                     161W    
+                       1
+ 16-JAN      /  1:  3.43667
+ 15-FEB      /  2:  1.92500
+ 17-MAR      /  3:  2.79000
+ 16-APR      /  4:  1.79000
+ 16-MAY      /  5:  0.80000
+ 16-JUN      /  6:  3.80000
+ 16-JUL      /  7: -0.20000
+ 16-AUG      /  8:  0.46500
+ 15-SEP      /  9:  2.57250
+ 16-OCT      / 10: -2.53000
+ 15-NOV      / 11: -3.09000
+ 16-DEC      / 12:  1.78667
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+ 
+ 
+! ******** V5.6Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+SHADE/grat=(color=white) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=whi)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.00000
+!-> REPEAT: S:4
+          4.00000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.0000  6.00000  480.000
+I / *:     80.0000  8.00000  640.000
+I / *:     80.0000  10.0000  800.000
+I / *:     60.0000  6.00000  360.000
+I / *:     60.0000  8.00000  480.000
+I / *:     60.0000  10.0000  600.000
+I / *:     40.0000  6.00000  240.000
+I / *:     40.0000  8.00000  320.000
+I / *:     40.0000  10.0000  400.000
+I / *:     20.0000  6.00000  120.000
+I / *:     20.0000  8.00000  160.000
+I / *:     20.0000  10.0000  200.000
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.000
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.000
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.00
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.00
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.00
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.00
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.00
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.00
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.00000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.00000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.000
+ 177W    / -98: -177.000
+ 175W    / -97: -175.000
+ 173W    / -96: -173.000
+ 171W    / -95: -171.000
+ 169W    / -94: -169.000
+ 167W    / -93: -167.000
+ 165W    / -92: -165.000
+ 163W    / -91: -163.000
+ 161W    / -90: -161.000
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.000
+ 177W    / -98: -354.000
+ 175W    / -97: -350.000
+ 173W    / -96: -346.000
+ 171W    / -95: -342.000
+ 169W    / -94: -338.000
+ 167W    / -93: -334.000
+ 165W    / -92: -330.000
+ 163W    / -91: -326.000
+ 161W    / -90: -322.000
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.000
+ 177W    / -98: -531.000
+ 175W    / -97: -525.000
+ 173W    / -96: -519.000
+ 171W    / -95: -513.000
+ 169W    / -94: -507.000
+ 167W    / -93: -501.000
+ 165W    / -92: -495.000
+ 163W    / -91: -489.000
+ 161W    / -90: -483.000
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.000
+ 177W    / -98: -708.000
+ 175W    / -97: -700.000
+ 173W    / -96: -692.000
+ 171W    / -95: -684.000
+ 169W    / -94: -676.000
+ 167W    / -93: -668.000
+ 165W    / -92: -660.000
+ 163W    / -91: -652.000
+ 161W    / -90: -644.000
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.000
+ 177W    / -98: -885.000
+ 175W    / -97: -875.000
+ 173W    / -96: -865.000
+ 171W    / -95: -855.000
+ 169W    / -94: -845.000
+ 167W    / -93: -835.000
+ 165W    / -92: -825.000
+ 163W    / -91: -815.000
+ 161W    / -90: -805.000
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.00000 "factorial"  1.00000
+I / *:     2.00000 "factorial"  2.00000
+I / *:     3.00000 "factorial"  6.00000
+I / *:     4.00000 "factorial"  24.0000
+I / *:     5.00000 "factorial"  120.000
+I / *:     6.00000 "factorial"  720.000
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 81E    / 2:  28.1147
+ 161E   / 3:  28.7893
+ 119W   / 4:  24.5394
+ 39W    / 5:  27.4849
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 121E   / 2:  28.5914
+ 119W   / 3:  24.5394
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN-0002
+          20.9844
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:148 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:153 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.7890
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:141 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:143 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          21.2500
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:130 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9385
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.00000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : JAN
+          28.2839
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:146 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+can mem/all
+ -DELETE A        M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:146 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:146 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M:146 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G001)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:146 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:146 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G001)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:151 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G001)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.500  212.500
+214   / 2:  214.000  212.500  215.500
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.700  212.300
+213.6 / 2:  213.600  212.300  214.900
+216.2 / 3:  216.200  214.900  217.500
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+               A   B
+1   / 1:  1.00000 "a"
+2   / 2:  2.00000 "b"
+3   / 3:  3.00000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C       V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.00000
+2   / 2: "b" "spat"  1.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.00000
+2   / 2: "b" "that"  1.00000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.00000
+2   / 2: "b" "spat"  2.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.00000
+2   / 2: "b" "that"  2.00000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.00000
+2   / 2: "b" "spat"  3.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.00000
+2   / 2: "b" "that"  3.00000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.00000
+2   / 2: "b" "spat"  4.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.00000
+2   / 2: "b" "that"  4.00000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.00000
+2   / 2: "b" "spat"  5.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.00000
+2   / 2: "b" "that"  5.00000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       DEPTH (m)           26 r-  0                    1000
+   Axis span (to cell edges) = 1040
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.976269
+ 106.8W  /  2:  0.824340
+ 100.2W  /  3:  0.552644
+ 93.5W   /  4:  0.200690
+ 86.8W   /  5: -0.180415
+ 80.2W   /  6: -0.535314
+ 73.5W   /  7: -0.812473
+ 66.8W   /  8: -0.971589
+ 60.2W   /  9: -0.989574
+ 53.5W   / 10: -0.863802
+ 46.8W   / 11: -0.612560
+ 40.2W   / 12: -0.272341
+ 33.5W   / 13:  0.107469
+ 26.8W   / 14:  0.471639
+ 20.2W   / 15:  0.767299
+ 13.5W   / 16:  0.951514
+ 6.8W    / 17:  0.997495
+ 0.2W    / 18:  0.898583
+ 6.5E    / 19:  0.669123
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.976269
+ 96.8W   / 2: -0.383713
+ 80.2W   / 3: -0.535314
+ 63.5W   / 4:  0.998887
+ 46.8W   / 5: -0.612560
+ 30.2W   / 6: -0.294944
+ 13.5W   / 7:  0.951514
+ 3.2E    / 8: -0.798487
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.976269
+ 96.2W   / 2: -0.383713
+ 79.5W   / 3: -0.535314
+ 62.8W   / 4:  0.998887
+ 46.2W   / 5: -0.612560
+ 29.5W   / 6: -0.294944
+ 12.8W   / 7:  0.951514
+ 3.8E    / 8: -0.798487
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.83E(42.83)
+         -0.912341
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.996087
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  45th point
+              1       46       91       136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     238 [...]
+              1       46       91      136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     2386 [...]
+ 1   / 1:  1.84147  1.90179  1.10599  0.20957  0.06355  0.80656  1.73321  1.96379  1.27939  0.32975  0.01642  0.63686  1.60205  1.99568  1.44406  0.47087  0.00001  0.47850  1.45208  1.99647  1.59486  0.62851  0.01484  0.33643  1.28799  1.96614  1.72708  0.79776  0.06044  0.21509  1.11490  1.90563  1.83659  0.97333  0.13539  0.11827  0.93823  1.81683  1.91997  1.14973  0.23734  0.04899  0.76349  1.70252  1.97461  1.32145  0.36312  0.00942  0.59613  1.56626  1.99881  1.48313  0.50879  0.00 [...]
+ 2   / 2:  2.84147  2.90179  2.10599  1.20957  1.06355  1.80656  2.73321  2.96379  2.27939  1.32975  1.01642  1.63686  2.60205  2.99568  2.44406  1.47087  1.00001  1.47850  2.45208  2.99647  2.59486  1.62851  1.01484  1.33643  2.28799  2.96614  2.72708  1.79776  1.06044  1.21509  2.11490  2.90563  2.83659  1.97333  1.13539  1.11827  1.93823  2.81683  2.91997  2.14973  1.23734  1.04899  1.76349  2.70252  2.97461  2.32145  1.36312  1.00942  1.59613  2.56626  2.99881  2.48313  1.50879  1.00 [...]
+ 
+can mode ignore
+ 
+ 
+! ******** V5.7 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                       179W     177W     175W    
+                         1        2        3
+ 16-JAN 12      / 1:  27.9765  28.2538  28.2807
+ 15-FEB 02      / 2:  28.3564  28.4117  27.9982
+ 15-MAR 17      / 3:  27.9418  28.0035  27.7238
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                        1N       3N       5N       7N     
+                         1        2        3        4
+ 16-JAN 12      / 1:  28.4146  28.2538  28.0640  28.1024
+ 15-FEB 02      / 2:  28.4018  28.4117  28.1639  27.7498
+ 15-MAR 17      / 3:  27.5907  28.0035  27.8730  27.8183
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000  28.0000
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1.2 / 1:  1.20000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3.2 / 3:  3.20000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8.4 / 6:  8.40000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME4)
+ Column  3: TBOXLO is TBOXLO (axis TIME4)
+ Column  4: TBOXHI is TBOXHI (axis TIME4)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+                 V      Z     ZBOXLO   ZBOXHI
+0     / 1:    7.000    0.000   0.0000   10.000
+20    / 2:   27.000   20.000  10.0000   30.000
+50    / 3:   57.000   50.000  30.0000   60.000
+75    / 4:   82.000   75.000  60.0000   90.000
+120   / 5:  127.000  120.000  90.0000  150.000
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: JAN-1990 to JAN-1990
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+GO bn_reset
+cancel mode verify
+GO bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_reset_attributes.jnl
+! bn_reset_attributes.jnl
+! acm 6/14/2004
+! tests of SET AXIS/CALENDAR  /T0  /UNITS  also CANCEL AXIS/DEPTH
+! also RETURN=calendar
+ 
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+sh axis `temp,return=taxis`
+ !-> sh axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 11-DEC-1982 02 / 20:  25476.0
+ 17-DEC-1982 04 / 21:  25622.0
+ 23-DEC-1982 06 / 22:  25768.0
+ 29-DEC-1982 08 / 23:  25914.0
+ 04-JAN-1983 10 / 24:  26060.0
+ 10-JAN-1983 12 / 25:  26206.0
+ 
+! New RETURN=calendar
+def sym calname = `temp,return=calendar`
+ !-> def sym calname = GREGORIAN
+ 
+! SET AXIS/CALENDAR=  julian, 360-day, 365_day=julian, 366_day=all_leap, standard=gregorian
+set axis/calendar=julian `temp,return=taxis`
+ !-> set axis/calendar=julian TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE JULIAN
+JULIAN
+ 
+set axis/calendar=360_day `temp,return=taxis`
+ !-> set axis/calendar=360_day TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 26-DEC-1982 02 / 20:  32.6698
+ 02-JAN-1983 04 / 21:  32.7830
+ 08-JAN-1983 06 / 22:  32.7033
+ 14-JAN-1983 08 / 23:  32.4479
+ 20-JAN-1983 10 / 24:  32.2491
+ 26-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE 360_DAY
+360_DAY
+ 
+set axis/calendar=365_day `temp,return=taxis`
+ !-> set axis/calendar=365_day TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=nol `temp,return=taxis`
+ !-> set axis/calendar=nol TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 12-DEC-1982 02 / 20:  32.6698
+ 18-DEC-1982 04 / 21:  32.7830
+ 24-DEC-1982 06 / 22:  32.7033
+ 30-DEC-1982 08 / 23:  32.4479
+ 05-JAN-1983 10 / 24:  32.2491
+ 11-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=366 `temp,return=taxis`
+ !-> set axis/calendar=366 TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+ 
+set axis/calendar=all_leap `temp,return=taxis`
+ !-> set axis/calendar=all_leap TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : ALL_LEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 09-DEC-1982 02 / 20:  32.6698
+ 15-DEC-1982 04 / 21:  32.7830
+ 21-DEC-1982 06 / 22:  32.7033
+ 27-DEC-1982 08 / 23:  32.4479
+ 02-JAN-1983 10 / 24:  32.2491
+ 08-JAN-1983 12 / 25:  32.1819
+ 
+! Now resetting T0
+CAN DATA/ALL
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+set axis/calendar="standard" `temp,return=taxis`
+ !-> set axis/calendar="standard" TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+ 
+! One day earlier
+set axis/t0="13-jan-1980:14:00" `temp,return=taxis`
+ !-> set axis/t0="13-jan-1980:14:00" TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE GREGORIAN
+GREGORIAN
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-DEC-1982 02 / 20:  25476.0
+ 16-DEC-1982 04 / 21:  25622.0
+ 22-DEC-1982 06 / 22:  25768.0
+ 28-DEC-1982 08 / 23:  25914.0
+ 03-JAN-1983 10 / 24:  26060.0
+ 09-JAN-1983 12 / 25:  26206.0
+ 
+ 
+! Now resetting UNITS
+CAN DATA/ALL
+CAN REGION
+use gt4d011.cdf
+ 
+set axis/units=feet `temp,return=zaxis`
+ !-> set axis/units=feet PSZT
+show axis `temp,return=zaxis`
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (FEET)            27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+! unrecognized units
+set axis/units="something" `temp,return=xaxis`
+ !-> set axis/units="something" PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon
+set axis/units=lon `temp,return=xaxis`
+ !-> set axis/units=lon PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=something `temp,return=xaxis`
+ !-> set axis/units=something PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon using word DEG
+set axis/units=deg `temp,return=xaxis`
+ !-> set axis/units=deg PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=zorro  `temp,r=zaxis`
+ !-> set axis/units=zorro  PSZT
+list/x=130w/y=1/k=1/L=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                       130.5W  
+                       100
+ 17-AUG-1982 12 / 1:  25.9777
+ 23-AUG-1982 14 / 2:  26.2025
+ 29-AUG-1982 16 / 3:  26.4463
+ 04-SEP-1982 18 / 4:  26.6606
+ 10-SEP-1982 20 / 5:  26.7818
+ 
+! not a geographic axis
+set axis/units=meters `temp,return=yaxis`
+ !-> set axis/units=meters PSYT
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (Y (METERS))
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ -0.5  / 44:  26.3422
+ -0.17 / 45:  26.2807
+ 0.17  / 46:  26.2649
+ 0.5   / 47:  26.2916
+ 
+set axis/units=deg `temp,return=yaxis`
+ !-> set axis/units=deg PSYT
+show axis `temp,return=yaxis`
+ !-> show axis PSYT
+ name       axis              # pts   start                end
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+   Axis span (to cell edges) = 80.00004
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (LATITUDE)
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ 0.5N  / 47:  26.2916
+ 0.17N / 46:  26.2649
+ 0.17S / 45:  26.2807
+ 0.5S  / 44:  26.3422
+ 
+! inappropriate units for axis direction
+set axis/units=meters `temp,return=taxis`
+ !-> set axis/units=meters TIME11
+list/x=130w/y=1/k=1/l=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (T (METERS))
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                130.5W  
+                100
+ 22702   / 1:  25.9777
+ 22848   / 2:  26.2025
+ 22994   / 3:  26.4463
+ 23140   / 4:  26.6606
+ 23286   / 5:  26.7818
+ 
+set axis/units=seconds  `temp,r=yaxis`
+ !-> set axis/units=seconds  PSYT
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      Y (SECONDS)        100 i   -28.836              48.568
+ PSZT      Z (ZORRO)           27 i-  5                    3824
+ TIME11    T (METERS)          25 r   22702                26206
+ normal    E
+ normal    F
+ 
+! assign time units to an abstract axis
+def axis/t=1:5:1 tax
+ 
+set axis/units=days/t0=1-jan-1990 tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 5 r   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 5
+list t[gt=tax]
+             VARIABLE : T
+                        axis TAX
+             SUBSET   : 5 points (TIME)
+ 02-JAN-1990 00 / 1:  1.00000
+ 03-JAN-1990 00 / 2:  2.00000
+ 04-JAN-1990 00 / 3:  3.00000
+ 05-JAN-1990 00 / 4:  4.00000
+ 06-JAN-1990 00 / 5:  5.00000
+ 
+! assign longitude units to an abstract axis
+! by default this becomes modulo
+def axis/x=0:120:20 xax
+ 
+set axis/units=lon xax
+sh axis xax
+ name       axis              # pts   start                end
+ XAX       LONGITUDE            7mr   0E                   120E
+   Axis span (to cell edges) = 140 (modulo length = 360)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 7 points (LONGITUDE)
+ 0E     / 1:    0.000
+ 20E    / 2:   20.000
+ 40E    / 3:   40.000
+ 60E    / 4:   60.000
+ 80E    / 5:   80.000
+ 100E   / 6:  100.000
+ 120E   / 7:  120.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.00000
+ 114W   / 427:  1.00000
+ 113W   / 428:  1.00000
+ 112W   / 429:  1.00000
+ 111W   / 430:  1.00000
+ 110W   / 431:  1.00000
+ 109W   / 432:  1.00000
+ 108W   / 433:  1.00000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+ 
+! ******** V5.8 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5559
+ 15-FEB      /  2:  29.5316
+ 17-MAR      /  3:  29.6615
+ 16-APR      /  4:  29.8829
+ 16-MAY      /  5:  29.8907
+ 16-JUN      /  6:  29.9644
+ 16-JUL      /  7:  29.6883
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.6661
+ 16-OCT      / 10:  29.7464
+ 15-NOV      / 11:  29.9058
+ 16-DEC      / 12:  29.7728
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                      139.5E   
+                       10
+ 16-JAN      /  1:  0.0020743
+ 15-FEB      /  2:  0.0005012
+ 17-MAR      /  3:  0.0079502
+ 16-APR      /  4:  0.0015034
+ 16-MAY      /  5:  0.0035104
+ 16-JUN      /  6:  0.0096970
+ 16-JUL      /  7:  0.0188794
+ 16-AUG      /  8:       ....
+ 15-SEP      /  9:  0.0055797
+ 16-OCT      / 10:  0.0068064
+ 15-NOV      / 11:  0.0019084
+ 16-DEC      / 12:  0.0048345
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5018
+ 15-FEB      /  2:  29.5157
+ 17-MAR      /  3:  29.5182
+ 16-APR      /  4:  29.7809
+ 16-MAY      /  5:  29.7883
+ 16-JUN      /  6:  29.8047
+ 16-JUL      /  7:  29.5034
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.5334
+ 16-OCT      / 10:  29.6438
+ 15-NOV      / 11:  29.8575
+ 16-DEC      / 12:  29.6620
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.6371
+ 15-FEB      /  2:  29.5474
+ 17-MAR      /  3:  29.8171
+ 16-APR      /  4:  29.9306
+ 16-MAY      /  5:  29.9564
+ 16-JUN      /  6:  30.0834
+ 16-JUL      /  7:  29.8189
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.7498
+ 16-OCT      / 10:  29.9003
+ 15-NOV      / 11:  29.9684
+ 16-DEC      / 12:  29.8558
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  295.559
+ 15-FEB      /  2:   59.063
+ 17-MAR      /  3:  533.908
+ 16-APR      /  4:  597.657
+ 16-MAY      /  5:  597.813
+ 16-JUN      /  6:  359.572
+ 16-JUL      /  7:  207.818
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  237.329
+ 16-OCT      / 10:  297.464
+ 15-NOV      / 11:  299.058
+ 16-DEC      / 12:  297.728
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  10.0000
+ 15-FEB      /  2:   2.0000
+ 17-MAR      /  3:  18.0000
+ 16-APR      /  4:  20.0000
+ 16-MAY      /  5:  20.0000
+ 16-JUN      /  6:  12.0000
+ 16-JUL      /  7:   7.0000
+ 16-AUG      /  8:   0.0000
+ 15-SEP      /  9:   8.0000
+ 16-OCT      / 10:  10.0000
+ 15-NOV      / 11:  10.0000
+ 16-DEC      / 12:  10.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.5000
+ 02-JAN-1990 00 /  2:  -1.5000
+ 03-JAN-1990 00 /  3:  -2.5000
+ 04-JAN-1990 00 /  4:  -3.5000
+ 05-JAN-1990 00 /  5:  -4.5000
+ 06-JAN-1990 00 /  6:  -5.5000
+ 07-JAN-1990 00 /  7:  -6.5000
+ 08-JAN-1990 00 /  8:  -7.5000
+ 09-JAN-1990 00 /  9:  -8.5000
+ 10-JAN-1990 00 / 10:  -9.5000
+ 11-JAN-1990 00 / 11:   1.9800
+ 12-JAN-1990 00 / 12:   3.9800
+ 13-JAN-1990 00 / 13:   5.9800
+ 14-JAN-1990 00 / 14:   7.9800
+ 15-JAN-1990 00 / 15:   9.9800
+ 16-JAN-1990 00 / 16:  11.9800
+ 17-JAN-1990 00 / 17:  13.9800
+ 18-JAN-1990 00 / 18:  15.9800
+ 19-JAN-1990 00 / 19:  17.9800
+ 20-JAN-1990 00 / 20:  19.9800
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.50000
+ 03-JAN-1990 00 / 3: -2.50000
+ 04-JAN-1990 00 / 4: -3.50000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.00000  0.500000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.98000
+ 13-JAN-1990 00 / 13:  5.98000
+ 14-JAN-1990 00 / 14:  7.98000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,6.2,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  3.00000  2.00000  1.00000  1.00000  3.00000
+ 2   / 2:  1.00000  3.00000  2.00000  2.00000  3.00000
+ 3   / 3:  2.00000  3.00000  3.00000  2.00000  3.00000
+ 4   / 4:  3.00000  2.00000  1.00000  1.00000  2.00000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ ---- K:1 Z:   1
+ 1   / 1:  111.000  112.000  113.000  114.000  115.000
+ 2   / 2:  121.000  122.000  123.000  124.000  125.000
+ 3   / 3:  131.000  132.000  133.000  134.000  135.000
+ 4   / 4:  141.000  142.000  143.000  144.000  145.000
+ ---- K:2 Z:   2
+ 1   / 1:  211.000  212.000  213.000  214.000  215.000
+ 2   / 2:  221.000  222.000  223.000  224.000  225.000
+ 3   / 3:  231.000  232.000  233.000  234.000  235.000
+ 4   / 4:  241.000  242.000  243.000  244.000  245.000
+ ---- K:3 Z:   3
+ 1   / 1:  311.000  312.000  313.000  314.000  315.000
+ 2   / 2:  321.000  322.000  323.000  324.000  325.000
+ 3   / 3:  331.000  332.000  333.000  334.000  335.000
+ 4   / 4:  341.000  342.000  343.000  344.000  345.000
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  311.000  212.000  113.000  114.000  315.000
+ 2   / 2:  121.000  322.000  223.000  224.000  325.000
+ 3   / 3:  231.000  332.000  333.000  234.000  335.000
+ 4   / 4:  341.000  242.000  143.000  144.000  245.000
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E     	100.E    	100.1E   	100.2E   	100.2E   	100.3E   
+0.11N	1.0011	1.0016	1.0021	1.0026	1.0031	1.0036
+0.128N	1.00128	1.00178	1.00228	1.00278	1.00328	1.00378
+0.146N	1.00146	1.00196	1.00246	1.00296	1.00346	1.00396
+0.164N	1.00164	1.00214	1.00264	1.00314	1.00364	1.00414
+0.182N	1.00182	1.00232	1.00282	1.00332	1.00382	1.00432
+0.2N	1.002	1.0025	1.003	1.0035	1.004	1.0045
+0.218N	1.00218	1.00268	1.00318	1.00368	1.00418	1.00468
+0.236N	1.00236	1.00286	1.00336	1.00386	1.00436	1.00486
+0.254N	1.00254	1.00304	1.00354	1.00404	1.00454	1.00504
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E     ,100E     ,100.1E   ,100.1E   
+0.11N,1.0011,1.00143,1.00176,1.00209
+0.128N,1.00128,1.00161,1.00194,1.00227
+0.146N,1.00146,1.00179,1.00212,1.00245
+0.164N,1.00164,1.00197,1.0023,1.00263
+0.182N,1.00182,1.00215,1.00248,1.00281
+0.2N,1.002,1.00233,1.00266,1.00299
+0.218N,1.00218,1.00251,1.00284,1.00317
+0.236N,1.00236,1.00269,1.00302,1.00335
+0.254N,1.00254,1.00287,1.0032,1.00353
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.000
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.00000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1W   	155.1W   	155.1W   	155.1W   	155.1W   
+19.7N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1W   ,155.1W   ,155.1W   ,155.1W   ,155.1W   
+19.7N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: FEB-1980
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  8.000E+00  7.200E+00 0.060    0  SYSTEM  @ASFERRET Ver. 6.862
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 2  8.000E+00  7.100E+00 0.060    0  SYSTEM  @ASNOAA/PMEL TMAP
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 3  8.000E+00  7.000E+00 0.060    0  SYSTEM  @AS28-MAR-2014 11:41:22
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  8.000E+00  6.540E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 7  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 8  8.000E+00  6.750E+00 0.073    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+ 
+! ******** V5.81 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.5
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.5
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+ 
+GO bn_reset
+cancel mode verify
+GO bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl fill
+ 
+GO bn_reset
+cancel mode verify
+GO bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME7     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME7     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+! can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+ 
+! ******** V6.00 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+ 
+GO bn_reset
+cancel mode verify
+GO bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.862"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET   version6.862:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE/SIGMA
+      /CURVILIN
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE/NAME
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE/QUIET
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET/SIGMA/CURVILIN
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO
+ 
+ Use SHOW ALIAS to see alternative command names
+ 
+GO bn_reset
+cancel mode verify
+GO bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "28-Mar-14:11:40"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="28-Mar-14:11:40"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 28-Mar-14
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 11:40
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="28-Mar-14:11:40"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "28-Mar-14:11:40"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT1)
+ Column  2: Z is Z (axis PSZT1)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT1)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+ 
+go bn_reset
+cancel mode verify
+go bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT1)                DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT1)                DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT1)                DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME4"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT1).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME4).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.6N
+             T (day): 1.8
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT1).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT1).units = degrees 
+ (PSXT1).point_spacing = even 
+ (PSXT1).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT1).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT1).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT1).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT1).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT1).units = meters 
+ (PSYT1).point_spacing = uneven 
+ (PSYT1).edges = PSYTedges 
+ (PSYT1).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = hour since 0000-01-01 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME7).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = days since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME7).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME7).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-mar-1955 
+ (TIME7).time_origin = 1-mar-1955 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME7).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME3[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME3).units = hour since 0000-01-01 00:00:00 
+ (TIME3).time_origin = 01-JAN-0000 00:00:00 
+ (TIME3).modulo =   
+ (TIME3).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+ 
+!=======
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!go bn_reset
+!go bn_nco_functions.jnl
+ 
+go bn_reset
+cancel mode verify
+go bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : JAN
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : JAN
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+ 
+go bn_reset
+cancel mode verify
+go bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : JAN to APR (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : JAN
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : JAN
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : AUG-1982
+          11.33
+ 
+go bn_reset
+cancel mode verify
+go bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+ 
+go bn_reset
+cancel mode verify
+go bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME11
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+ 
+! ******** V6.01 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6321)
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME9
+ 
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME9
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT1
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT1
+show att/all ($zax)
+ !-> show att/all PSZT1
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT191_108)          DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        11   F       PSXT191_108
+  
+(PSYT135_56)           DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        15   T       PSYT135_56_bnds
+                                 orig_file_axnameCHAR        10   F       PSYT135_56
+  
+ PSYT135_56_bnds       DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT191_108)          DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        11   F       PSXT191_108
+  
+(PSYT135_56)           DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        15   T       PSYT135_56_bnds
+                                 orig_file_axnameCHAR        10   F       PSYT135_56
+  
+ PSYT135_56_bnds       DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME111)              DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! ******** V6.02 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX047)
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:   1
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX042)
+ name       axis              # pts   start                end
+ (AX042)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX049)
+ name       axis              # pts   start                end
+ (AX049)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME10
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX051)
+ name       axis              # pts   start                end
+ (AX051)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX048)
+ name       axis              # pts   start                end
+ (AX048)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: FEB-1982 to MAR-1982
+             LONGITUDE: 179.5E
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME3     TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      T                    5 r   1                    5
+   Axis span (to cell edges) = 5
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX1     X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX1     T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = 360)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+GO bn_reset
+cancel mode verify
+GO bn602_bug_fixes
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME11    TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+ 
+ 
+! ******** V6.03 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: JAN to DEC
+             LONGITUDE: 139.5E
+             LATITUDE: 0.833N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn603_bug_fixes
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+ 
+! ******** V6.05 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+Unable to allocate 500000.0 Mwords of memory.
+Restoring previous memory of 0.2 Mwords.
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  11.89756
+ 179W   / 81:  12.11905
+ 177W   / 82:  12.07976
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  35.69268
+ 179W   / 81:  36.35714
+ 177W   / 82:  36.23927
+ 
+ 
+GO bn_reset
+cancel mode verify
+! This routine executes a ppl error which exits us from Ferret
+! when run in the benchmark suite. Should test this, but dont do it
+! here, for now.
+!GO bn_ppl_errors.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO bn_memory_symbol
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+ 
+GO bn_reset
+cancel mode verify
+GO bn605_bug_fixes
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: JAN to DEC
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                            T     TBOX
+16-JAN 12      /  1:   15.5000  31.00000
+15-FEB 02      /  2:   45.1213  28.24250
+15-MAR 17      /  3:   74.7425  31.00000
+15-APR 05      /  4:  105.2425  30.00000
+15-MAY 17      /  5:  135.7425  31.00000
+15-JUN 05      /  6:  166.2425  30.00000
+15-JUL 17      /  7:  196.7425  31.00000
+15-AUG 17      /  8:  227.7425  31.00000
+15-SEP 05      /  9:  258.2425  30.00000
+15-OCT 17      / 10:  288.7425  31.00000
+15-NOV 05      / 11:  319.2425  30.00000
+15-DEC 17      / 12:  349.7425  31.00000
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+ADD_9(A,B,C,D,E,F,G,H,I)
+APPENDE(ENS,VAR)
+AVET(A)
+DATES(Offsets)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+FACTORIAL(A)
+FFT_AMP(A)
+FFTA_SAMPLE(A)
+FFT_PHAS(A)
+PASS_THRU(A)
+PERCENT_GOOD_T(A)
+STORAGE(A)
+STRING_ARG(Flags,NString)
+STUDENT_T_CUTOFF(P,nf)
+SUBTRACT(A,B)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn608_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+<taxis>TIME11</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "7.9999998E-04"
+YAXIS_MAX = "2.0999999E-03"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000001E-07"
+YAXIS_MAX = "2.1000001E-06"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+YAXNAM = "YAX_LEV94"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXL = "4.737"
+XAXNAME = "XIRREG_SUBSPAN"
+XAXIS_MAX = "5.0050505E-06"
+XAXNAM = "(XAX_LEV9421_380)"
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+YAXNAM = "YAX_LEV94"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+ 
+ 
+! ******** V6.1 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_trim
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_nlevels
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn61_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+ 
+ 
+! ******** V6.11 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_test_opendap
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00000
+ 
+ 
+CANCEL MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO bn611_bug_fixes
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+fill/over/i=1:2/j=0:2/patt i+j
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME3"          
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+ 
+! ******** V6.13 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_no_valid_on_plot
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.530E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.780E+00 -7.900E-01 0.119    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.530E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_median
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: NOV-1982 to JAN-1983
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                           VAR     VAR       VAR       VAR
+30-NOV-1982 23 / 106: -10.06812 -10.06812 -10.06812 -11.97891
+04-DEC-1982 00 / 107: -13.41848 -13.41848 -13.41848 -10.06812
+07-DEC-1982 01 / 108: -15.06836 -13.41848 -13.41848 -10.06812
+10-DEC-1982 02 / 109: -11.97891 -11.97891 -11.97891 -10.06812
+13-DEC-1982 03 / 110:  -4.63116  -4.63116  -4.63116  -4.63116
+16-DEC-1982 04 / 111:   0.77075   0.77075   0.77075   0.77075
+19-DEC-1982 05 / 112:   1.06240   1.06240   1.06240   1.06240
+22-DEC-1982 06 / 113:   2.75400   2.75400   2.75400   2.75400
+25-DEC-1982 07 / 114:   9.06758   9.06758   9.06758   4.21162
+28-DEC-1982 08 / 115:  10.80434   9.06758   9.06758   4.21162
+31-DEC-1982 09 / 116:   4.21162  10.80434  10.80434   9.06758
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: FEB-0002
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+                  VAR     VAR       VAR
+79W   / 131:      ....  25.98750  25.92824
+77W   / 132:      ....      ....  25.98750
+75W   / 133:      ....      ....  25.98750
+73W   / 134:      ....      ....      ....
+71W   / 135:      ....      ....      ....
+69W   / 136:      ....      ....      ....
+67W   / 137:      ....      ....      ....
+65W   / 138:      ....      ....      ....
+63W   / 139:      ....      ....  27.80000
+61W   / 140:      ....      ....  27.80000
+59W   / 141:      ....  27.80000  27.64737
+57W   / 142:  27.80000  27.80000  27.70333
+55W   / 143:  27.64737  27.64737  27.64737
+53W   / 144:  27.43500  27.64737  27.64737
+51W   / 145:  27.70333  27.43500  27.64737
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: FEB-0002
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+                 VAR     VAR       VAR
+19S   / 36:  28.32244  28.32244  28.32244
+17S   / 37:  28.56983  28.56983  28.56983
+15S   / 38:  29.05953  29.05953  29.05953
+13S   / 39:  29.43250  29.23719  29.23170
+11S   / 40:  29.23719  29.32561  29.23170
+9S    / 41:  29.32561  29.23719  29.23170
+7S    / 42:  29.23170  29.23170  29.23170
+5S    / 43:  28.96976  28.96976  28.96976
+3S    / 44:  28.39779  28.39779  28.44243
+1S    / 45:  28.36456  28.39779  28.39779
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+                VAR     VAR        VAR
+0     / 1:  1.900075  1.900075  0.3281405
+20    / 2:  1.322209  1.322209  0.3281405
+40    / 3:  0.328140  0.328140  0.2405229
+60    / 4: -0.253715 -0.157475  0.3281405
+80    / 5: -0.157475 -0.253715  0.3281405
+100   / 6: -0.785400 -0.157475  0.3281405
+120   / 7:  0.240523  0.240523  0.3281405
+140   / 8:  0.390383  0.390383  0.3903829
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn614_bug_fixes
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME11    TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1.011S
+                          141.3W   
+                            1
+ 16-JAN 12      /  1:  0.05848070
+ 15-FEB 00      /  2:  0.05188299
+ 16-MAR 12      /  3:  0.04782573
+ 16-APR 00      /  4:  0.03808421
+ 16-MAY 12      /  5:  0.05937929
+ 16-JUN 00      /  6:  0.06571895
+ 16-JUL 12      /  7:  0.06152720
+ 16-AUG 12      /  8:  0.07460730
+ 16-SEP 00      /  9:  0.05815475
+ 16-OCT 12      / 10:  0.06169292
+ 16-NOV 00      / 11:  0.05654943
+ 16-DEC 12      / 12:  0.05768678
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1.02"
+LEV_NUM = "51"
+LEV_DEL = "0.02"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX3      TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+ 
+! ******** V6.14 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_mode_nodata_lab
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_proleptic_gregorian_calendar
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME               733 r   01-JAN-1988 00:00    01-JAN-1990 00:00
+T0 = 15-JAN-1901
+CALENDAR = ALL_LEAP
+   Axis span (to cell edges) = 733
+ 
+GO bn_reset
+cancel mode verify
+GO bn_string_ngd_nbd
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cat_string
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sort_strings
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+          INDX_AJ                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+          INDX_BJ   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+          INDX_AK                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+          INDX_BK   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+          INDX_AL                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+          INDX_BL   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_samplexyt
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+               YPTS     TPTS   SAMPL_PTS
+1    /  1:  20.53799    20.000      ....
+2    /  2: -29.07481    60.000      ....
+3    /  3:  26.64251   100.000      ....
+4    /  4: -28.97490   140.000      ....
+5    /  5: -17.10210   180.000      ....
+6    /  6:  -8.79040   220.000      ....
+7    /  7: -26.48790   260.000      ....
+8    /  8:  -9.00391   300.000      ....
+9    /  9: -19.19385   340.000      ....
+10   / 10: -19.84003   380.000  360.6600
+11   / 11: -44.10992   420.000  376.3901
+12   / 12:  34.07387   460.000  494.5739
+13   / 13:  34.62830   500.000  535.1283
+14   / 14:  -6.59559   540.000  533.9044
+15   / 15: -39.01164   580.000  541.4884
+16   / 16: -25.63370   620.000  594.8663
+17   / 17: -22.96677   660.000  637.5332
+18   / 18: -30.90969   700.000  669.5903
+19   / 19: -22.52078   740.000      ....
+20   / 20: -20.65415   780.000      ....
+21   / 21: -41.65880   820.000      ....
+22   / 22:  39.13533   860.000      ....
+23   / 23:  22.88071   900.000      ....
+24   / 24: -41.03287   940.000      ....
+25   / 25:  33.34976   980.000      ....
+26   / 26:  22.53505  1020.000      ....
+27   / 27:  13.97536  1060.000      ....
+28   / 28:  21.99063  1100.000      ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G093_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G093_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G104_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+          FCN_NOR    FCN_REV
+J /  1:  0.6331937 -0.6331937
+J /  2:  0.6454794 -0.6454794
+J /  3:  0.4997293 -0.4997293
+J /  4:  0.2316280 -0.2316280
+J /  5: -0.0931839  0.0931839
+J /  6: -0.3951811  0.3951811
+J /  7: -0.6004243  0.6004243
+J /  8: -0.6586626  0.6586626
+J /  9: -0.5556374  0.5556374
+J / 10: -0.3165727  0.3165727
+J / 11:  0.0000000  0.0000000
+J / 12:  0.3165727 -0.3165727
+J / 13:  0.5556374 -0.5556374
+J / 14:  0.6586626 -0.6586626
+J / 15:  0.6004243 -0.6004243
+J / 16:  0.3951811 -0.3951811
+J / 17:  0.0931839 -0.0931839
+J / 18: -0.2316280  0.2316280
+J / 19: -0.4997293  0.4997293
+J / 20: -0.6454794  0.6454794
+J / 21: -0.6331937  0.6331937
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+                180E    
+                51
+ 8N   / 19:  0.4997293
+ 7N   / 18:  0.2316280
+ 6N   / 17: -0.0931839
+ 5N   / 16: -0.3951811
+ 4N   / 15: -0.6004243
+ 3N   / 14: -0.6586626
+ 2N   / 13: -0.5556374
+ 1N   / 12: -0.3165727
+ 0    / 11:  0.0000000
+ 1S   / 10:  0.3165727
+ 
+GO bn_reset
+cancel mode verify
+GO bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+ 
+! ******** V6.2 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0000
+ 31-DEC-1999 12:00 / 792:  365.0000
+ 01-JAN-2000 00:00 / 793:    1.0000
+ 01-JAN-2000 12:00 / 794:    1.0000
+ 02-JAN-2000 00:00 / 795:    2.0000
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A       A        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+                  B       B        EX#3       EX#4
+1    /  1:  0.000000       ....       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000  0.8000000
+3    /  3:  1.000000  0.7500000  0.7500000  0.6000000
+4    /  4:  0.000000  0.5000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000  0.4000000
+6    /  6:  0.000000  0.2500000  0.2500000  0.1000000
+7    /  7:  0.000000  0.0000000  0.0000000       ....
+8    /  8:  0.000000       ....       ....       ....
+9    /  9:      ....       ....       ....       ....
+10   / 10:  0.000000       ....       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000       ....
+12   / 12:  0.000000       ....       ....       ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+                  C       C        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 13
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+                  D       D        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A      A        EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000000      ....      ....
+2    /  2:  2.000000  1.750000  1.750000
+3    /  3:  2.000000  1.750000  1.750000
+4    /  4:  1.000000  1.500000  1.500000
+5    /  5:  2.000000  1.500000  1.500000
+6    /  6:  1.000000  1.250000  1.250000
+7    /  7:  1.000000  1.000000  1.000000
+8    /  8:  1.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  1.000000      ....      ....
+11   / 11:  1.000000  1.000000  1.000000
+12   / 12:  1.000000      ....      ....
+ ---- J:2 Y:   2
+1    /  1:  2.000000      ....      ....
+2    /  2:  3.000000  2.750000  2.750000
+3    /  3:  3.000000  2.750000  2.750000
+4    /  4:  2.000000  2.500000  2.500000
+5    /  5:  3.000000  2.500000  2.500000
+6    /  6:  2.000000  2.250000  2.250000
+7    /  7:  2.000000  2.000000  2.000000
+8    /  8:  2.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  2.000000      ....      ....
+11   / 11:  2.000000  2.000000  2.000000
+12   / 12:  2.000000      ....      ....
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3122928879.
+ 01-JAN-2000 00:14:41 / 441:  3122928881.
+ 01-JAN-2000 00:14:43 / 442:  3122928883.
+ 01-JAN-2000 00:14:45 / 443:  3122928885.
+ 01-JAN-2000 00:14:47 / 444:  3122928887.
+ 01-JAN-2000 00:14:49 / 445:  3122928889.
+ 01-JAN-2000 00:14:51 / 446:  3122928891.
+ 01-JAN-2000 00:14:53 / 447:  3122928893.
+ 01-JAN-2000 00:14:55 / 448:  3122928895.
+ 01-JAN-2000 00:14:57 / 449:  3122928897.
+ 01-JAN-2000 00:14:59 / 450:  3122928899.
+ 01-JAN-2000 00:15:01 / 451:  3122928901.
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_clock_syms
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "35.8975"
+CLOCK_SECS = "62.39"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:41:43"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.033996"
+CLOCK_SECS = "62.45"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.268959
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0"
+CLOCK_SECS = "63.055"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "63.056"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.034994
+ !-> DEFINE VARIABLE sumcpu =0.034994
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.069989
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.029995
+ !-> DEFINE VARIABLE sumcpu =0.099984
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.034994
+ !-> DEFINE VARIABLE sumcpu =0.134978
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.030996
+ !-> DEFINE VARIABLE sumcpu =0.165974
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.033995
+ !-> DEFINE VARIABLE sumcpu =0.199969
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.033994
+ !-> DEFINE VARIABLE sumcpu =0.233963
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.033996
+ !-> DEFINE VARIABLE sumcpu =0.267959
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.031995
+ !-> DEFINE VARIABLE sumcpu =0.299954
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.031995
+ !-> DEFINE VARIABLE sumcpu =0.331949
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.331949
+0.331949
+sh sym CLOCK_SECS
+CLOCK_SECS = "64.012"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:40"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:41:44"
+ 
+ 
+! ******** V6.3 Additions below ***********
+! Note that allowing mouse-click operations in the current
+! window, not only in window 1, is implemented in v6.3. Not
+! tested in the benchmarks.
+ 
+GO bn_reset
+cancel mode verify
+GO bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+Set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                     Z    ZBOXLO    ZBOXHI
+-5000   /  1: -5000.000 -5000.000 -4500.000
+-4000   /  2: -4000.000 -4500.000 -3500.000
+-3000   /  3: -3000.000 -3500.000 -2500.000
+-2000   /  4: -2000.000 -2500.000 -1800.000
+-1500   /  5: -1500.000 -1800.000 -1300.000
+-1200   /  6: -1200.000 -1300.000 -1100.000
+-1000   /  7: -1000.000 -1100.000  -900.000
+-800    /  8:  -800.000  -900.000  -700.000
+-600    /  9:  -600.000  -700.000  -500.000
+-400    / 10:  -400.000  -500.000  -350.000
+-300    / 11:  -300.000  -350.000  -250.000
+-200    / 12:  -200.000  -250.000  -180.000
+-150    / 13:  -150.000  -180.000  -120.000
+-100    / 14:  -100.000  -120.000   -90.000
+-75     / 15:   -75.000   -90.000   -60.000
+-50     / 16:   -50.000   -60.000   -32.000
+-30     / 17:   -30.000   -32.000   -24.000
+-20     / 18:   -20.000   -24.000   -12.000
+-10     / 19:   -10.000   -12.000    -5.000
+0       / 20:     0.000    -5.000     0.000
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : JAN
+ 1   / 1:  27.46402
+ 2   / 2:  27.44937
+ 3   / 3:  27.53579
+ 4   / 4:  27.54567
+ 5   / 5:  27.55554
+ 6   / 6:  27.65924
+ 7   / 7:  27.74823
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+              YBOXLO    YBOXHI
+76.5S /  1: -90.00000 -70.81186
+66.4S /  2: -70.81186 -62.73396
+59.4S /  3: -62.73396 -56.44269
+53.7S /  4: -56.44269 -51.05756
+48.6S /  5: -51.05756 -46.23826
+44S   /  6: -46.23826 -41.81031
+39.7S /  7: -41.81031 -37.66989
+35.7S /  8: -37.66989 -33.74899
+31.9S /  9: -33.74899 -30.00000
+28.2S / 10: -30.00000 -26.38780
+24.6S / 11: -26.38780 -22.88538
+21.2S / 12: -22.88538 -19.47122
+17.8S / 13: -19.47122 -16.12762
+14.5S / 14: -16.12762 -12.83959
+11.2S / 15: -12.83959  -9.59407
+8S    / 16:  -9.59407  -6.37937
+4.8S  / 17:  -6.37937  -3.18474
+1.6S  / 18:  -3.18474  -0.00000
+1.6N  / 19:  -0.00000   3.18474
+4.8N  / 20:   3.18474   6.37937
+8N    / 21:   6.37937   9.59407
+11.2N / 22:   9.59407  12.83959
+14.5N / 23:  12.83959  16.12762
+17.8N / 24:  16.12762  19.47122
+21.2N / 25:  19.47122  22.88538
+24.6N / 26:  22.88538  26.38780
+28.2N / 27:  26.38780  30.00000
+31.9N / 28:  30.00000  33.74899
+35.7N / 29:  33.74899  37.66989
+39.7N / 30:  37.66989  41.81031
+44N   / 31:  41.81031  46.23826
+48.6N / 32:  46.23826  51.05756
+53.7N / 33:  51.05756  56.44269
+59.4N / 34:  56.44269  62.73396
+66.4N / 35:  62.73396  70.81186
+76.5N / 36:  70.81186  90.00000
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+                  EX#1      EX#2
+76.5S /  1:  0.03826170  0.02777778
+66.4S /  2:  0.02750340  0.02777778
+59.4S /  3:  0.02724976  0.02777778
+53.7S /  4:  0.02718343  0.02777778
+48.6S /  5:  0.02715676  0.02777778
+44S   /  6:  0.02714348  0.02777778
+39.7S /  7:  0.02713596  0.02777778
+35.7S /  8:  0.02713132  0.02777778
+31.9S /  9:  0.02712828  0.02777778
+28.2S / 10:  0.02712619  0.02777778
+24.6S / 11:  0.02712471  0.02777778
+21.2S / 12:  0.02712365  0.02777778
+17.8S / 13:  0.02712287  0.02777778
+14.5S / 14:  0.02712229  0.02777778
+11.2S / 15:  0.02712188  0.02777778
+8S    / 16:  0.02712159  0.02777778
+4.8S  / 17:  0.02712141  0.02777778
+1.6S  / 18:  0.02712133  0.02777778
+1.6N  / 19:  0.02712133  0.02777778
+4.8N  / 20:  0.02712141  0.02777778
+8N    / 21:  0.02712159  0.02777778
+11.2N / 22:  0.02712188  0.02777778
+14.5N / 23:  0.02712229  0.02777778
+17.8N / 24:  0.02712287  0.02777778
+21.2N / 25:  0.02712365  0.02777778
+24.6N / 26:  0.02712471  0.02777778
+28.2N / 27:  0.02712619  0.02777778
+31.9N / 28:  0.02712828  0.02777778
+35.7N / 29:  0.02713132  0.02777778
+39.7N / 30:  0.02713596  0.02777778
+44N   / 31:  0.02714348  0.02777778
+48.6N / 32:  0.02715676  0.02777778
+53.7N / 33:  0.02718343  0.02777778
+59.4N / 34:  0.02724976  0.02777778
+66.4N / 35:  0.02750340  0.02777778
+76.5N / 36:  0.03826170  0.02777778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777782
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777779
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777777
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0000
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8458605
+ 16-JAN-1951 /  2: -0.4792148
+ 16-JAN-1952 /  3: -0.0086413
+ 16-JAN-1953 /  4:  0.5029880
+ 16-JAN-1954 /  5: -0.8600939
+ 16-JAN-1955 /  6:  0.9996375
+ 16-JAN-1956 /  7: -0.8863128
+ 16-JAN-1957 /  8:  0.5403982
+ 16-JAN-1958 /  9: -0.0624683
+ 16-JAN-1959 / 10: -0.4312768
+ 16-JAN-1960 / 11:  0.8159143
+ 16-JAN-1961 / 12: -0.9951944
+ 16-JAN-1962 / 13:  0.9169914
+ 16-JAN-1963 / 14: -0.6068212
+ 16-JAN-1964 / 15:  0.1431603
+ 16-JAN-1965 / 16:  0.3660465
+ 16-JAN-1966 / 17: -0.7727474
+ 16-JAN-1967 / 18:  0.9839827
+ 16-JAN-1968 / 19: -0.9463078
+ 16-JAN-1969 / 20:  0.6617913
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX139)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241199
+ DEC-1951 /  2:  0.2968155
+ DEC-1952 /  3:  0.2153545
+ DEC-1953 /  4: -0.6634768
+ DEC-1954 /  5:  0.9437761
+ DEC-1955 /  6: -0.9853337
+ DEC-1956 /  7:  0.7713169
+ DEC-1957 /  8: -0.3639512
+ DEC-1958 /  9: -0.1354919
+ DEC-1959 / 10:  0.6006479
+ DEC-1960 / 11: -0.9178868
+ DEC-1961 / 12:  0.9949715
+ DEC-1962 / 13: -0.8203671
+ DEC-1963 / 14:  0.4382506
+ DEC-1964 / 15:  0.0647143
+ DEC-1965 / 16: -0.5422904
+ DEC-1966 / 17:  0.8826929
+ DEC-1967 / 18: -0.9998160
+ DEC-1968 / 19:  0.8589436
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX130)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_reversed_syms
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_isdepth
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT1
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+ 
+ 
+! ******** V6.4 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn64_bug_fixes
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                  2         3      
+                   2         3
+ 21241   / 1:   2.00000  27.00000
+ 21242   / 2:   2.00000  28.00000
+ 21243   / 3:   2.00000  29.00000
+ 21244   / 4:   3.00000   1.00000
+ 21245   / 5:   3.00000   2.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_grid_names
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+               1          2          3      
+               1          2          3
+ 1   / 1:  0.0060000  0.1760000  0.2820000
+ 2   / 2:  0.3550000  0.3790000  0.3930000
+ 3   / 3:  0.4100000  0.4170000  0.4670000
+ 4   / 4:  0.4350000  0.4440000  0.4700000
+ 5   / 5:  0.4780000  0.5150000  0.4690000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4         6         8      
+               2         3         4
+ ---- L:2 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2222.000  3222.000  4222.000
+ 6   / 3:  2322.000  3322.000  4322.000
+ 8   / 4:  2422.000  3422.000  4422.000
+ ---- K:3 Z:   6
+ 4   / 2:  2232.000  3232.000  4232.000
+ 6   / 3:  2332.000  3332.000  4332.000
+ 8   / 4:  2432.000  3432.000  4432.000
+ ---- K:4 Z:   8
+ 4   / 2:  2242.000  3242.000  4242.000
+ 6   / 3:  2342.000  3342.000  4342.000
+ 8   / 4:  2442.000  3442.000  4442.000
+ ---- L:3 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2223.000  3223.000  4223.000
+ 6   / 3:  2323.000  3323.000  4323.000
+ 8   / 4:  2423.000  3423.000  4423.000
+ ---- K:3 Z:   6
+ 4   / 2:  2233.000  3233.000  4233.000
+ 6   / 3:  2333.000  3333.000  4333.000
+ 8   / 4:  2433.000  3433.000  4433.000
+ ---- K:4 Z:   8
+ 4   / 2:  2243.000  3243.000  4243.000
+ 6   / 3:  2343.000  3343.000  4343.000
+ 8   / 4:  2443.000  3443.000  4443.000
+ ---- L:4 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2224.000  3224.000  4224.000
+ 6   / 3:  2324.000  3324.000  4324.000
+ 8   / 4:  2424.000  3424.000  4424.000
+ ---- K:3 Z:   6
+ 4   / 2:  2234.000  3234.000  4234.000
+ 6   / 3:  2334.000  3334.000  4334.000
+ 8   / 4:  2434.000  3434.000  4434.000
+ ---- K:4 Z:   8
+ 4   / 2:  2244.000  3244.000  4244.000
+ 6   / 3:  2344.000  3344.000  4344.000
+ 8   / 4:  2444.000  3444.000  4444.000
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5         7         9      
+               3         4         5
+ ---- L:3 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2777.500  3777.500  4777.500
+ 7   / 4:  2877.500  3877.500  4877.500
+ 9   / 5:  2977.500  3977.500  4977.500
+ ---- K:4 Z:   7
+ 5   / 3:  2787.500  3787.500  4787.500
+ 7   / 4:  2887.500  3887.500  4887.500
+ 9   / 5:  2987.500  3987.500  4987.500
+ ---- K:5 Z:   9
+ 5   / 3:  2797.500  3797.500  4797.500
+ 7   / 4:  2897.500  3897.500  4897.500
+ 9   / 5:  2997.500  3997.500  4997.500
+ ---- L:4 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2778.500  3778.500  4778.500
+ 7   / 4:  2878.500  3878.500  4878.500
+ 9   / 5:  2978.500  3978.500  4978.500
+ ---- K:4 Z:   7
+ 5   / 3:  2788.500  3788.500  4788.500
+ 7   / 4:  2888.500  3888.500  4888.500
+ 9   / 5:  2988.500  3988.500  4988.500
+ ---- K:5 Z:   9
+ 5   / 3:  2798.500  3798.500  4798.500
+ 7   / 4:  2898.500  3898.500  4898.500
+ 9   / 5:  2998.500  3998.500  4998.500
+ ---- L:5 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2779.500  3779.500  4779.500
+ 7   / 4:  2879.500  3879.500  4879.500
+ 9   / 5:  2979.500  3979.500  4979.500
+ ---- K:4 Z:   7
+ 5   / 3:  2789.500  3789.500  4789.500
+ 7   / 4:  2889.500  3889.500  4889.500
+ 9   / 5:  2989.500  3989.500  4989.500
+ ---- K:5 Z:   9
+ 5   / 3:  2799.500  3799.500  4799.500
+ 7   / 4:  2899.500  3899.500  4899.500
+ 9   / 5:  2999.500  3999.500  4999.500
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88290  23.97420  24.14894  24.37499  24.62556
+ 25-JAN-1982 00 / 3:  23.88501  23.98344  24.16565  24.39832  24.65027
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88380  23.97520  24.15006  24.37614  24.62650
+ 25-JAN-1982 00 / 3:  23.87741  23.97277  24.15346  24.38574  24.63814
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.75267  23.76377  23.87293  24.04456  24.25203
+ 25-JAN-1982 00 / 3:  23.74388  23.73211  23.81637  23.96577  24.15370
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M: 29 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 753  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 27 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 754  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 755  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 756  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 26 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 757  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 758  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 759  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 760  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 761  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ found   TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+setting up plot
+PPL plot 762  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 25 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 763  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 764  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 765  complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+               158.5E    159.5E    160.5E  
+               139       140       141
+ 4.5S / 86:  29.51100  29.44300  29.38000
+ 5.5S / 85:  29.58900  29.52500  29.45700
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00000
+ 23E   / 2:  23.00000
+ 25E   / 3:  25.00000
+ 27E   / 4:  27.00000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   3
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid GG2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G106)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX116)                         use count:   1
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX127)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_repl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+ 
+! ******** V6.5 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn65_bug_fixes
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.0
+ 16-OCT-1149 12 /  2:  419308.5
+ 16-NOV-1149 00 /  3:  419339.0
+ 16-DEC-1149 12 /  4:  419369.5
+ 16-JAN-1150 12 /  5:  419400.5
+ 15-FEB-1150 00 /  6:  419430.0
+ 16-MAR-1150 12 /  7:  419459.5
+ 16-APR-1150 00 /  8:  419490.0
+ 16-MAY-1150 12 /  9:  419520.5
+ 16-JUN-1150 00 / 10:  419551.0
+ 16-JUL-1150 12 / 11:  419581.5
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_txtype_dmy
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn_n_open_dsets_sym
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_multi_decade
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+GO bn_reset
+cancel mode verify
+GO bn_show_xml_file
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+ 
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME3</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME3">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+ 
+ 
+! GO bn_reset
+! GO bn_encode_url
+ 
+! ******** V6.6 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn66_bug_fixes
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: AUG-1982 to JAN-1983 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: AUG-1982 to JAN-1983
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : AUG-1982 to JAN-1983 (XZT ave)
+ 3.5N  / 56:  27.59128
+ 3.17N / 55:  27.76072
+ 2.83N / 54:  27.89503
+ 2.5N  / 53:  28.00175
+ 2.17N / 52:  28.08330
+ 1.83N / 51:  28.13652
+ 1.5N  / 50:  28.15913
+ 1.17N / 49:  28.15796
+ 0.83N / 48:  28.14635
+ 0.5N  / 47:  28.13609
+ 0.17N / 46:  28.13627
+ 0.17S / 45:  28.15042
+ 0.5S  / 44:  28.17639
+ 0.83S / 43:  28.20504
+ 1.17S / 42:  28.22684
+ 1.5S  / 41:  28.23347
+ 1.83S / 40:  28.21657
+ 2.17S / 39:  28.16886
+ 2.5S  / 38:  28.08460
+ 2.83S / 37:  27.96112
+ 3.17S / 36:  27.80014
+ 3.5S  / 35:  27.60770
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: AUG-1982 to JAN-1983 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+ 
+GO bn_reset
+cancel mode verify
+GO bn_netcdf4
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G089)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G103)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+ 
+! *********** v6.62 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_dir_symbols
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+AX_VERT = "Y"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+ 
+! *********** v6.63 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn663_bug_fixes
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_axis_regular
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.2563 to 10.74
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_cancel_redirect
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.862  "                                                         
+ 3    /  3:" ! Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14"                       
+ 4    /  4:" ! 28-Mar-14 11:40     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+ 
+GO bn_reset
+cancel mode verify
+GO bn_min_max_smoothers
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed             @STD        standard deviation
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+ 
+auxiliary varible regridding transforms e.g.TEMP[GZ(depth)=zax at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @PLAVE      pc-wise linear ave
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.667S to 3.667N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vector_symbols
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+ 
+GO bn_reset
+cancel mode verify
+GO bn_variance_large
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labnum_calendar
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME12
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+ 
+ 
+! *********** v6.65 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn665_bug_fixes
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME13
+<axes>
+<axis name="TIME13">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME13
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_floatstr
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+ 
+! *********** v6.7 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn67_bug_fixes
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME13)               DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_NaN_note
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+ 
+! *********** v6.71 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn671_bug_fixes
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3662   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+ 
+! *********** v6.8 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn68_bug_fixes
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX128)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX120)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ifv
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_randu2_randn2
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+ 
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+ 
+can mode ver
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.940
+randu2_randn2       0.286
+randu2_randn2       0.045
+randu2_randn2       0.839
+randu2_randn2       0.445
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.553
+randu2_randn2       0.241
+randu2_randn2       0.063
+randu2_randn2       0.435
+randu2_randn2       0.366
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.354
+randu2_randn2       0.314
+randu2_randn2       0.798
+randu2_randn2       0.528
+randu2_randn2       0.607
+randu2_randn2       0.108
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.215
+randu2_randn2       0.246
+randu2_randn2       0.099
+randu2_randn2       0.204
+randu2_randn2       0.104
+randu2_randn2       0.148
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.302
+randu2_randn2       0.380
+randu2_randn2       0.926
+randu2_randn2       0.672
+randu2_randn2       0.238
+randu2_randn2       0.638
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.302
+randu2_randn2       0.380
+randu2_randn2       0.926
+randu2_randn2       0.672
+randu2_randn2       0.238
+randu2_randn2       0.638
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.345
+randu2_randn2      -1.197
+randu2_randn2      -1.226
+randu2_randn2      -0.532
+randu2_randn2       0.783
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2      -0.339
+randu2_randn2      -0.069
+randu2_randn2       0.345
+randu2_randn2       2.072
+randu2_randn2      -1.610
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.749
+randu2_randn2      -0.602
+randu2_randn2      -0.229
+randu2_randn2       1.741
+randu2_randn2       1.232
+randu2_randn2       0.522
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.061
+randu2_randn2       0.559
+randu2_randn2      -1.751
+randu2_randn2      -2.088
+randu2_randn2       0.150
+randu2_randn2       0.302
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.906
+randu2_randn2      -1.503
+randu2_randn2       0.217
+randu2_randn2       0.537
+randu2_randn2       0.674
+randu2_randn2      -1.279
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.906
+randu2_randn2      -1.503
+randu2_randn2       0.217
+randu2_randn2       0.537
+randu2_randn2       0.674
+randu2_randn2      -1.279
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+randu2_randn2       1.017       1.494       0.754
+randu2_randn2       1.494       1.017       0.754
+randu2_randn2       0.754       0.754       0.257
+randu2_randn2       0.257       0.257       0.393
+randu2_randn2      -0.545      -0.545       0.393
+randu2_randn2      -0.658      -0.545       0.393
+randu2_randn2      -0.379      -0.379       0.393
+randu2_randn2       0.393       0.393       0.393
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_cf
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeated_coords
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_header
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+! Here's one where the dataset has a string variable
+ 
+can dat/all
+ 
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_numstring.jnl"
+use numstring
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out_string.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out_string.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out_string.xml" </data>
+ 
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
+<dimension>STRING1_7</dimension>
+<xaxis>XAX1_10</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+--
+<dimensions>
+<dimension name="STRING1_7">
+<attribute name="length" type="short">
+   <value>7</value>
+</attribute>
+</dimension>
+</dimensions>
+</data>
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1:  0.0000 -0.7071
+ 2   / 2: -0.7071 -0.0000
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1: -0.000 -1.414
+ 0.25  /   2: -0.185 -1.402
+ 0.5   /   3: -0.366 -1.366
+ 0.75  /   4: -0.541 -1.307
+ 1     /   5: -0.707 -1.225
+ 1.25  /   6: -0.861 -1.122
+ 1.5   /   7: -1.000 -1.000
+ 1.75  /   8: -1.122 -0.861
+ 2     /   9: -1.225 -0.707
+ 2.25  /  10: -1.307 -0.541
+ 2.5   /  11: -1.366 -0.366
+ 2.75  /  12: -1.402 -0.185
+ 3     /  13: -1.414 -0.000
+ 3.25  /  14: -1.402  0.185
+ 3.5   /  15: -1.366  0.366
+ 3.75  /  16: -1.307  0.541
+ 4     /  17: -1.225  0.707
+ 4.25  /  18: -1.122  0.861
+ 4.5   /  19: -1.000  1.000
+ 4.75  /  20: -0.861  1.122
+ 5     /  21: -0.707  1.225
+ 5.25  /  22: -0.541  1.307
+ 5.5   /  23: -0.366  1.366
+ 5.75  /  24: -0.185  1.402
+ 6     /  25: -0.000  1.414
+ 6.25  /  26:  0.185  1.402
+ 6.5   /  27:  0.366  1.366
+ 6.75  /  28:  0.541  1.307
+ 7     /  29:  0.707  1.225
+ 7.25  /  30:  0.861  1.122
+ 7.5   /  31:  1.000  1.000
+ 7.75  /  32:  1.122  0.861
+ 8     /  33:  1.225  0.707
+ 8.25  /  34:  1.307  0.541
+ 8.5   /  35:  1.366  0.366
+ 8.75  /  36:  1.402  0.185
+ 9     /  37:  1.414  0.000
+ 9.25  /  38:  1.402 -0.185
+ 9.5   /  39:  1.366 -0.366
+ 9.75  /  40:  1.307 -0.541
+ 10    /  41:  1.225 -0.707
+ 10.25 /  42:  1.122 -0.861
+ 10.5  /  43:  1.000 -1.000
+ 10.75 /  44:  0.861 -1.122
+ 11    /  45:  0.707 -1.225
+ 11.25 /  46:  0.541 -1.307
+ 11.5  /  47:  0.366 -1.366
+ 11.75 /  48:  0.185 -1.402
+ 12    /  49:  0.000 -1.414
+ 12.25 /  50: -0.185 -1.402
+ 12.5  /  51: -0.366 -1.366
+ 12.75 /  52: -0.541 -1.307
+ 13    /  53: -0.707 -1.225
+ 13.25 /  54: -0.861 -1.122
+ 13.5  /  55: -1.000 -1.000
+ 13.75 /  56: -1.122 -0.861
+ 14    /  57: -1.225 -0.707
+ 14.25 /  58: -1.307 -0.541
+ 14.5  /  59: -1.366 -0.366
+ 14.75 /  60: -1.402 -0.185
+ 15    /  61: -1.414 -0.000
+ 15.25 /  62: -1.402  0.185
+ 15.5  /  63: -1.366  0.366
+ 15.75 /  64: -1.307  0.541
+ 16    /  65: -1.225  0.707
+ 16.25 /  66: -1.122  0.861
+ 16.5  /  67: -1.000  1.000
+ 16.75 /  68: -0.861  1.122
+ 17    /  69: -0.707  1.225
+ 17.25 /  70: -0.541  1.307
+ 17.5  /  71: -0.366  1.366
+ 17.75 /  72: -0.185  1.402
+ 18    /  73: -0.000  1.414
+ 18.25 /  74:  0.185  1.402
+ 18.5  /  75:  0.366  1.366
+ 18.75 /  76:  0.541  1.307
+ 19    /  77:  0.707  1.225
+ 19.25 /  78:  0.861  1.122
+ 19.5  /  79:  1.000  1.000
+ 19.75 /  80:  1.122  0.861
+ 20    /  81:  1.225  0.707
+ 20.25 /  82:  1.307  0.541
+ 20.5  /  83:  1.366  0.366
+ 20.75 /  84:  1.402  0.185
+ 21    /  85:  1.414  0.000
+ 21.25 /  86:  1.402 -0.185
+ 21.5  /  87:  1.366 -0.366
+ 21.75 /  88:  1.307 -0.541
+ 22    /  89:  1.225 -0.707
+ 22.25 /  90:  1.122 -0.861
+ 22.5  /  91:  1.000 -1.000
+ 22.75 /  92:  0.861 -1.122
+ 23    /  93:  0.707 -1.225
+ 23.25 /  94:  0.541 -1.307
+ 23.5  /  95:  0.366 -1.366
+ 23.75 /  96:  0.185 -1.402
+ 24    /  97:  0.000 -1.414
+ 24.25 /  98: -0.185 -1.402
+ 24.5  /  99: -0.366 -1.366
+ 24.75 / 100: -0.541 -1.307
+ 25    / 101: -0.707 -1.225
+ 25.25 / 102: -0.861 -1.122
+ 25.5  / 103: -1.000 -1.000
+ 25.75 / 104: -1.122 -0.861
+ 26    / 105: -1.225 -0.707
+ 26.25 / 106: -1.307 -0.541
+ 26.5  / 107: -1.366 -0.366
+ 26.75 / 108: -1.402 -0.185
+ 27    / 109: -1.414 -0.000
+ 27.25 / 110: -1.402  0.185
+ 27.5  / 111: -1.366  0.366
+ 27.75 / 112: -1.307  0.541
+ 28    / 113: -1.225  0.707
+ 28.25 / 114: -1.122  0.861
+ 28.5  / 115: -1.000  1.000
+ 28.75 / 116: -0.861  1.122
+ 29    / 117: -0.707  1.225
+ 29.25 / 118: -0.541  1.307
+ 29.5  / 119: -0.366  1.366
+ 29.75 / 120: -0.185  1.402
+ 30    / 121: -0.000  1.414
+ 30.25 / 122:  0.185  1.402
+ 30.5  / 123:  0.366  1.366
+ 30.75 / 124:  0.541  1.307
+ 31    / 125:  0.707  1.225
+ 31.25 / 126:  0.861  1.122
+ 31.5  / 127:  1.000  1.000
+ 31.75 / 128:  1.122  0.861
+ 32    / 129:  1.225  0.707
+ 32.25 / 130:  1.307  0.541
+ 32.5  / 131:  1.366  0.366
+ 32.75 / 132:  1.402  0.185
+ 33    / 133:  1.414 -0.000
+ 33.25 / 134:  1.402 -0.185
+ 33.5  / 135:  1.366 -0.366
+ 33.75 / 136:  1.307 -0.541
+ 34    / 137:  1.225 -0.707
+ 34.25 / 138:  1.122 -0.861
+ 34.5  / 139:  1.000 -1.000
+ 34.75 / 140:  0.861 -1.122
+ 35    / 141:  0.707 -1.225
+ 35.25 / 142:  0.541 -1.307
+ 35.5  / 143:  0.366 -1.366
+ 35.75 / 144:  0.185 -1.402
+ 36    / 145:  0.000 -1.414
+ 36.25 / 146: -0.185 -1.402
+ 36.5  / 147: -0.366 -1.366
+ 36.75 / 148: -0.541 -1.307
+ 37    / 149: -0.707 -1.225
+ 37.25 / 150: -0.861 -1.122
+ 37.5  / 151: -1.000 -1.000
+ 37.75 / 152: -1.122 -0.861
+ 38    / 153: -1.225 -0.707
+ 38.25 / 154: -1.307 -0.541
+ 38.5  / 155: -1.366 -0.366
+ 38.75 / 156: -1.402 -0.185
+ 39    / 157: -1.414 -0.000
+ 39.25 / 158: -1.402  0.185
+ 39.5  / 159: -1.366  0.366
+ 39.75 / 160: -1.307  0.541
+ 40    / 161: -1.225  0.707
+ 40.25 / 162: -1.122  0.861
+ 40.5  / 163: -1.000  1.000
+ 40.75 / 164: -0.861  1.122
+ 41    / 165: -0.707  1.225
+ 41.25 / 166: -0.541  1.307
+ 41.5  / 167: -0.366  1.366
+ 41.75 / 168: -0.185  1.402
+ 42    / 169: -0.000  1.414
+ 42.25 / 170:  0.185  1.402
+ 42.5  / 171:  0.366  1.366
+ 42.75 / 172:  0.541  1.307
+ 43    / 173:  0.707  1.225
+ 43.25 / 174:  0.861  1.122
+ 43.5  / 175:  1.000  1.000
+ 43.75 / 176:  1.122  0.861
+ 44    / 177:  1.225  0.707
+ 44.25 / 178:  1.307  0.541
+ 44.5  / 179:  1.366  0.366
+ 44.75 / 180:  1.402  0.185
+ 45    / 181:  1.414 -0.000
+ 45.25 / 182:  1.402 -0.185
+ 45.5  / 183:  1.366 -0.366
+ 45.75 / 184:  1.307 -0.541
+ 46    / 185:  1.225 -0.707
+ 46.25 / 186:  1.122 -0.861
+ 46.5  / 187:  1.000 -1.000
+ 46.75 / 188:  0.861 -1.122
+ 47    / 189:  0.707 -1.225
+ 47.25 / 190:  0.541 -1.307
+ 47.5  / 191:  0.366 -1.366
+ 47.75 / 192:  0.185 -1.402
+ 48    / 193:  0.000 -1.414
+ 48.25 / 194: -0.185 -1.402
+ 48.5  / 195: -0.366 -1.366
+ 48.75 / 196: -0.541 -1.307
+ 49    / 197: -0.707 -1.225
+ 49.25 / 198: -0.861 -1.122
+ 49.5  / 199: -1.000 -1.000
+ 49.75 / 200: -1.122 -0.861
+ 50    / 201: -1.225 -0.707
+ 50.25 / 202: -1.307 -0.541
+ 50.5  / 203: -1.366 -0.366
+ 50.75 / 204: -1.402 -0.185
+ 51    / 205: -1.414 -0.000
+ 51.25 / 206: -1.402  0.185
+ 51.5  / 207: -1.366  0.366
+ 51.75 / 208: -1.307  0.541
+ 52    / 209: -1.225  0.707
+ 52.25 / 210: -1.122  0.861
+ 52.5  / 211: -1.000  1.000
+ 52.75 / 212: -0.861  1.122
+ 53    / 213: -0.707  1.225
+ 53.25 / 214: -0.541  1.307
+ 53.5  / 215: -0.366  1.366
+ 53.75 / 216: -0.185  1.402
+ 54    / 217: -0.000  1.414
+ 54.25 / 218:  0.185  1.402
+ 54.5  / 219:  0.366  1.366
+ 54.75 / 220:  0.541  1.307
+ 55    / 221:  0.707  1.225
+ 55.25 / 222:  0.861  1.122
+ 55.5  / 223:  1.000  1.000
+ 55.75 / 224:  1.122  0.861
+ 56    / 225:  1.225  0.707
+ 56.25 / 226:  1.307  0.541
+ 56.5  / 227:  1.366  0.366
+ 56.75 / 228:  1.402  0.185
+ 57    / 229:  1.414  0.000
+ 57.25 / 230:  1.402 -0.185
+ 57.5  / 231:  1.366 -0.366
+ 57.75 / 232:  1.307 -0.541
+ 58    / 233:  1.225 -0.707
+ 58.25 / 234:  1.122 -0.861
+ 58.5  / 235:  1.000 -1.000
+ 58.75 / 236:  0.861 -1.122
+ 59    / 237:  0.707 -1.225
+ 59.25 / 238:  0.541 -1.307
+ 59.5  / 239:  0.366 -1.366
+ 59.75 / 240:  0.185 -1.402
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0000 -0.7071    ....
+ 2   / 2: -0.7071 -0.0000    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1: -0.000 -1.414   ....
+ 0.25  /   2: -0.185 -1.402   ....
+ 0.5   /   3: -0.366 -1.366   ....
+ 0.75  /   4: -0.541 -1.307   ....
+ 1     /   5: -0.707 -1.225   ....
+ 1.25  /   6: -0.861 -1.122   ....
+ 1.5   /   7: -1.000 -1.000   ....
+ 1.75  /   8: -1.122 -0.861   ....
+ 2     /   9: -1.225 -0.707   ....
+ 2.25  /  10: -1.307 -0.541   ....
+ 2.5   /  11: -1.366 -0.366   ....
+ 2.75  /  12: -1.402 -0.185   ....
+ 3     /  13: -1.414 -0.000   ....
+ 3.25  /  14: -1.402  0.185   ....
+ 3.5   /  15: -1.366  0.366   ....
+ 3.75  /  16: -1.307  0.541   ....
+ 4     /  17: -1.225  0.707   ....
+ 4.25  /  18: -1.122  0.861   ....
+ 4.5   /  19: -1.000  1.000   ....
+ 4.75  /  20: -0.861  1.122   ....
+ 5     /  21: -0.707  1.225   ....
+ 5.25  /  22: -0.541  1.307   ....
+ 5.5   /  23: -0.366  1.366   ....
+ 5.75  /  24: -0.185  1.402   ....
+ 6     /  25: -0.000  1.414   ....
+ 6.25  /  26:  0.185  1.402   ....
+ 6.5   /  27:  0.366  1.366   ....
+ 6.75  /  28:  0.541  1.307   ....
+ 7     /  29:  0.707  1.225   ....
+ 7.25  /  30:  0.861  1.122   ....
+ 7.5   /  31:  1.000  1.000   ....
+ 7.75  /  32:  1.122  0.861   ....
+ 8     /  33:  1.225  0.707   ....
+ 8.25  /  34:  1.307  0.541   ....
+ 8.5   /  35:  1.366  0.366   ....
+ 8.75  /  36:  1.402  0.185   ....
+ 9     /  37:  1.414  0.000   ....
+ 9.25  /  38:  1.402 -0.185   ....
+ 9.5   /  39:  1.366 -0.366   ....
+ 9.75  /  40:  1.307 -0.541   ....
+ 10    /  41:  1.225 -0.707   ....
+ 10.25 /  42:  1.122 -0.861   ....
+ 10.5  /  43:  1.000 -1.000   ....
+ 10.75 /  44:  0.861 -1.122   ....
+ 11    /  45:  0.707 -1.225   ....
+ 11.25 /  46:  0.541 -1.307   ....
+ 11.5  /  47:  0.366 -1.366   ....
+ 11.75 /  48:  0.185 -1.402   ....
+ 12    /  49:  0.000 -1.414   ....
+ 12.25 /  50: -0.185 -1.402   ....
+ 12.5  /  51: -0.366 -1.366   ....
+ 12.75 /  52: -0.541 -1.307   ....
+ 13    /  53: -0.707 -1.225   ....
+ 13.25 /  54: -0.861 -1.122   ....
+ 13.5  /  55: -1.000 -1.000   ....
+ 13.75 /  56: -1.122 -0.861   ....
+ 14    /  57: -1.225 -0.707   ....
+ 14.25 /  58: -1.307 -0.541   ....
+ 14.5  /  59: -1.366 -0.366   ....
+ 14.75 /  60: -1.402 -0.185   ....
+ 15    /  61: -1.414 -0.000   ....
+ 15.25 /  62: -1.402  0.185   ....
+ 15.5  /  63: -1.366  0.366   ....
+ 15.75 /  64: -1.307  0.541   ....
+ 16    /  65: -1.225  0.707   ....
+ 16.25 /  66: -1.122  0.861   ....
+ 16.5  /  67: -1.000  1.000   ....
+ 16.75 /  68: -0.861  1.122   ....
+ 17    /  69: -0.707  1.225   ....
+ 17.25 /  70: -0.541  1.307   ....
+ 17.5  /  71: -0.366  1.366   ....
+ 17.75 /  72: -0.185  1.402   ....
+ 18    /  73: -0.000  1.414   ....
+ 18.25 /  74:  0.185  1.402   ....
+ 18.5  /  75:  0.366  1.366   ....
+ 18.75 /  76:  0.541  1.307   ....
+ 19    /  77:  0.707  1.225   ....
+ 19.25 /  78:  0.861  1.122   ....
+ 19.5  /  79:  1.000  1.000   ....
+ 19.75 /  80:  1.122  0.861   ....
+ 20    /  81:  1.225  0.707   ....
+ 20.25 /  82:  1.307  0.541   ....
+ 20.5  /  83:  1.366  0.366   ....
+ 20.75 /  84:  1.402  0.185   ....
+ 21    /  85:  1.414  0.000   ....
+ 21.25 /  86:  1.402 -0.185   ....
+ 21.5  /  87:  1.366 -0.366   ....
+ 21.75 /  88:  1.307 -0.541   ....
+ 22    /  89:  1.225 -0.707   ....
+ 22.25 /  90:  1.122 -0.861   ....
+ 22.5  /  91:  1.000 -1.000   ....
+ 22.75 /  92:  0.861 -1.122   ....
+ 23    /  93:  0.707 -1.225   ....
+ 23.25 /  94:  0.541 -1.307   ....
+ 23.5  /  95:  0.366 -1.366   ....
+ 23.75 /  96:  0.185 -1.402   ....
+ 24    /  97:  0.000 -1.414   ....
+ 24.25 /  98: -0.185 -1.402   ....
+ 24.5  /  99: -0.366 -1.366   ....
+ 24.75 / 100: -0.541 -1.307   ....
+ 25    / 101: -0.707 -1.225   ....
+ 25.25 / 102: -0.861 -1.122   ....
+ 25.5  / 103: -1.000 -1.000   ....
+ 25.75 / 104: -1.122 -0.861   ....
+ 26    / 105: -1.225 -0.707   ....
+ 26.25 / 106: -1.307 -0.541   ....
+ 26.5  / 107: -1.366 -0.366   ....
+ 26.75 / 108: -1.402 -0.185   ....
+ 27    / 109: -1.414 -0.000   ....
+ 27.25 / 110: -1.402  0.185   ....
+ 27.5  / 111: -1.366  0.366   ....
+ 27.75 / 112: -1.307  0.541   ....
+ 28    / 113: -1.225  0.707   ....
+ 28.25 / 114: -1.122  0.861   ....
+ 28.5  / 115: -1.000  1.000   ....
+ 28.75 / 116: -0.861  1.122   ....
+ 29    / 117: -0.707  1.225   ....
+ 29.25 / 118: -0.541  1.307   ....
+ 29.5  / 119: -0.366  1.366   ....
+ 29.75 / 120: -0.185  1.402   ....
+ 30    / 121: -0.000  1.414   ....
+ 30.25 / 122:  0.185  1.402   ....
+ 30.5  / 123:  0.366  1.366   ....
+ 30.75 / 124:  0.541  1.307   ....
+ 31    / 125:  0.707  1.225   ....
+ 31.25 / 126:  0.861  1.122   ....
+ 31.5  / 127:  1.000  1.000   ....
+ 31.75 / 128:  1.122  0.861   ....
+ 32    / 129:  1.225  0.707   ....
+ 32.25 / 130:  1.307  0.541   ....
+ 32.5  / 131:  1.366  0.366   ....
+ 32.75 / 132:  1.402  0.185   ....
+ 33    / 133:  1.414 -0.000   ....
+ 33.25 / 134:  1.402 -0.185   ....
+ 33.5  / 135:  1.366 -0.366   ....
+ 33.75 / 136:  1.307 -0.541   ....
+ 34    / 137:  1.225 -0.707   ....
+ 34.25 / 138:  1.122 -0.861   ....
+ 34.5  / 139:  1.000 -1.000   ....
+ 34.75 / 140:  0.861 -1.122   ....
+ 35    / 141:  0.707 -1.225   ....
+ 35.25 / 142:  0.541 -1.307   ....
+ 35.5  / 143:  0.366 -1.366   ....
+ 35.75 / 144:  0.185 -1.402   ....
+ 36    / 145:  0.000 -1.414   ....
+ 36.25 / 146: -0.185 -1.402   ....
+ 36.5  / 147: -0.366 -1.366   ....
+ 36.75 / 148: -0.541 -1.307   ....
+ 37    / 149: -0.707 -1.225   ....
+ 37.25 / 150: -0.861 -1.122   ....
+ 37.5  / 151: -1.000 -1.000   ....
+ 37.75 / 152: -1.122 -0.861   ....
+ 38    / 153: -1.225 -0.707   ....
+ 38.25 / 154: -1.307 -0.541   ....
+ 38.5  / 155: -1.366 -0.366   ....
+ 38.75 / 156: -1.402 -0.185   ....
+ 39    / 157: -1.414 -0.000   ....
+ 39.25 / 158: -1.402  0.185   ....
+ 39.5  / 159: -1.366  0.366   ....
+ 39.75 / 160: -1.307  0.541   ....
+ 40    / 161: -1.225  0.707   ....
+ 40.25 / 162: -1.122  0.861   ....
+ 40.5  / 163: -1.000  1.000   ....
+ 40.75 / 164: -0.861  1.122   ....
+ 41    / 165: -0.707  1.225   ....
+ 41.25 / 166: -0.541  1.307   ....
+ 41.5  / 167: -0.366  1.366   ....
+ 41.75 / 168: -0.185  1.402   ....
+ 42    / 169: -0.000  1.414   ....
+ 42.25 / 170:  0.185  1.402   ....
+ 42.5  / 171:  0.366  1.366   ....
+ 42.75 / 172:  0.541  1.307   ....
+ 43    / 173:  0.707  1.225   ....
+ 43.25 / 174:  0.861  1.122   ....
+ 43.5  / 175:  1.000  1.000   ....
+ 43.75 / 176:  1.122  0.861   ....
+ 44    / 177:  1.225  0.707   ....
+ 44.25 / 178:  1.307  0.541   ....
+ 44.5  / 179:  1.366  0.366   ....
+ 44.75 / 180:  1.402  0.185   ....
+ 45    / 181:  1.414 -0.000   ....
+ 45.25 / 182:  1.402 -0.185   ....
+ 45.5  / 183:  1.366 -0.366   ....
+ 45.75 / 184:  1.307 -0.541   ....
+ 46    / 185:  1.225 -0.707   ....
+ 46.25 / 186:  1.122 -0.861   ....
+ 46.5  / 187:  1.000 -1.000   ....
+ 46.75 / 188:  0.861 -1.122   ....
+ 47    / 189:  0.707 -1.225   ....
+ 47.25 / 190:  0.541 -1.307   ....
+ 47.5  / 191:  0.366 -1.366   ....
+ 47.75 / 192:  0.185 -1.402   ....
+ 48    / 193:  0.000 -1.414   ....
+ 48.25 / 194: -0.185 -1.402   ....
+ 48.5  / 195: -0.366 -1.366   ....
+ 48.75 / 196: -0.541 -1.307   ....
+ 49    / 197: -0.707 -1.225   ....
+ 49.25 / 198: -0.861 -1.122   ....
+ 49.5  / 199: -1.000 -1.000   ....
+ 49.75 / 200: -1.122 -0.861   ....
+ 50    / 201: -1.225 -0.707   ....
+ 50.25 / 202: -1.307 -0.541   ....
+ 50.5  / 203: -1.366 -0.366   ....
+ 50.75 / 204: -1.402 -0.185   ....
+ 51    / 205: -1.414 -0.000   ....
+ 51.25 / 206: -1.402  0.185   ....
+ 51.5  / 207: -1.366  0.366   ....
+ 51.75 / 208: -1.307  0.541   ....
+ 52    / 209: -1.225  0.707   ....
+ 52.25 / 210: -1.122  0.861   ....
+ 52.5  / 211: -1.000  1.000   ....
+ 52.75 / 212: -0.861  1.122   ....
+ 53    / 213: -0.707  1.225   ....
+ 53.25 / 214: -0.541  1.307   ....
+ 53.5  / 215: -0.366  1.366   ....
+ 53.75 / 216: -0.185  1.402   ....
+ 54    / 217: -0.000  1.414   ....
+ 54.25 / 218:  0.185  1.402   ....
+ 54.5  / 219:  0.366  1.366   ....
+ 54.75 / 220:  0.541  1.307   ....
+ 55    / 221:  0.707  1.225   ....
+ 55.25 / 222:  0.861  1.122   ....
+ 55.5  / 223:  1.000  1.000   ....
+ 55.75 / 224:  1.122  0.861   ....
+ 56    / 225:  1.225  0.707   ....
+ 56.25 / 226:  1.307  0.541   ....
+ 56.5  / 227:  1.366  0.366   ....
+ 56.75 / 228:  1.402  0.185   ....
+ 57    / 229:  1.414  0.000   ....
+ 57.25 / 230:  1.402 -0.185   ....
+ 57.5  / 231:  1.366 -0.366   ....
+ 57.75 / 232:  1.307 -0.541   ....
+ 58    / 233:  1.225 -0.707   ....
+ 58.25 / 234:  1.122 -0.861   ....
+ 58.5  / 235:  1.000 -1.000   ....
+ 58.75 / 236:  0.861 -1.122   ....
+ 59    / 237:  0.707 -1.225   ....
+ 59.25 / 238:  0.541 -1.307   ....
+ 59.5  / 239:  0.366 -1.366   ....
+ 59.75 / 240:  0.185 -1.402   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple2
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1:  0.0635 -0.3478
+ 2   / 2: -0.3478 -0.0635
+ ---- L:2 T:   2
+ 1   / 1:  0.3478  0.0635
+ 2   / 2:  0.0635 -0.3478
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.254  1.391
+ 0.1   /   2:  0.107  1.410
+ 0.2   /   3: -0.041  1.414
+ 0.3   /   4: -0.188  1.402
+ 0.4   /   5: -0.334  1.374
+ 0.5   /   6: -0.476  1.332
+ 0.6   /   7: -0.612  1.275
+ 0.7   /   8: -0.742  1.204
+ 0.8   /   9: -0.864  1.120
+ 0.9   /  10: -0.976  1.023
+ 1     /  11: -1.078  0.916
+ 1.1   /  12: -1.168  0.798
+ 1.2   /  13: -1.245  0.672
+ 1.3   /  14: -1.308  0.538
+ 1.4   /  15: -1.357  0.398
+ 1.5   /  16: -1.391  0.254
+ 1.6   /  17: -1.410  0.107
+ 1.7   /  18: -1.414 -0.041
+ 1.8   /  19: -1.402 -0.188
+ 1.9   /  20: -1.374 -0.334
+ 2     /  21: -1.332 -0.476
+ 2.1   /  22: -1.275 -0.612
+ 2.2   /  23: -1.204 -0.742
+ 2.3   /  24: -1.120 -0.864
+ 2.4   /  25: -1.023 -0.976
+ 2.5   /  26: -0.916 -1.078
+ 2.6   /  27: -0.798 -1.168
+ 2.7   /  28: -0.672 -1.245
+ 2.8   /  29: -0.538 -1.308
+ 2.9   /  30: -0.398 -1.357
+ 3     /  31: -0.254 -1.391
+ 3.1   /  32: -0.107 -1.410
+ 3.2   /  33:  0.041 -1.414
+ 3.3   /  34:  0.188 -1.402
+ 3.4   /  35:  0.334 -1.374
+ 3.5   /  36:  0.476 -1.332
+ 3.6   /  37:  0.612 -1.275
+ 3.7   /  38:  0.742 -1.204
+ 3.8   /  39:  0.864 -1.120
+ 3.9   /  40:  0.976 -1.023
+ 4     /  41:  1.078 -0.916
+ 4.1   /  42:  1.168 -0.798
+ 4.2   /  43:  1.245 -0.672
+ 4.3   /  44:  1.308 -0.538
+ 4.4   /  45:  1.357 -0.398
+ 4.5   /  46:  1.391 -0.254
+ 4.6   /  47:  1.410 -0.107
+ 4.7   /  48:  1.414  0.041
+ 4.8   /  49:  1.402  0.188
+ 4.9   /  50:  1.374  0.334
+ 5     /  51:  1.332  0.476
+ 5.1   /  52:  1.275  0.612
+ 5.2   /  53:  1.204  0.742
+ 5.3   /  54:  1.120  0.864
+ 5.4   /  55:  1.023  0.976
+ 5.5   /  56:  0.916  1.078
+ 5.6   /  57:  0.798  1.168
+ 5.7   /  58:  0.672  1.245
+ 5.8   /  59:  0.538  1.308
+ 5.9   /  60:  0.398  1.357
+ 6     /  61:  0.254  1.391
+ 6.1   /  62:  0.107  1.410
+ 6.2   /  63: -0.041  1.414
+ 6.3   /  64: -0.188  1.402
+ 6.4   /  65: -0.334  1.374
+ 6.5   /  66: -0.476  1.332
+ 6.6   /  67: -0.612  1.275
+ 6.7   /  68: -0.742  1.204
+ 6.8   /  69: -0.864  1.120
+ 6.9   /  70: -0.976  1.023
+ 7     /  71: -1.078  0.916
+ 7.1   /  72: -1.168  0.798
+ 7.2   /  73: -1.245  0.672
+ 7.3   /  74: -1.308  0.538
+ 7.4   /  75: -1.357  0.398
+ 7.5   /  76: -1.391  0.254
+ 7.6   /  77: -1.410  0.107
+ 7.7   /  78: -1.414 -0.041
+ 7.8   /  79: -1.402 -0.188
+ 7.9   /  80: -1.374 -0.334
+ 8     /  81: -1.332 -0.476
+ 8.1   /  82: -1.275 -0.612
+ 8.2   /  83: -1.204 -0.742
+ 8.3   /  84: -1.120 -0.864
+ 8.4   /  85: -1.023 -0.976
+ 8.5   /  86: -0.916 -1.078
+ 8.6   /  87: -0.798 -1.168
+ 8.7   /  88: -0.672 -1.245
+ 8.8   /  89: -0.538 -1.308
+ 8.9   /  90: -0.398 -1.357
+ 9     /  91: -0.254 -1.391
+ 9.1   /  92: -0.107 -1.410
+ 9.2   /  93:  0.041 -1.414
+ 9.3   /  94:  0.188 -1.402
+ 9.4   /  95:  0.334 -1.374
+ 9.5   /  96:  0.476 -1.332
+ 9.6   /  97:  0.612 -1.275
+ 9.7   /  98:  0.742 -1.204
+ 9.8   /  99:  0.864 -1.120
+ 9.9   / 100:  0.976 -1.023
+ 10    / 101:  1.078 -0.916
+ 10.1  / 102:  1.168 -0.798
+ 10.2  / 103:  1.245 -0.672
+ 10.3  / 104:  1.308 -0.538
+ 10.4  / 105:  1.357 -0.398
+ 10.5  / 106:  1.391 -0.254
+ 10.6  / 107:  1.410 -0.107
+ 10.7  / 108:  1.414  0.041
+ 10.8  / 109:  1.402  0.188
+ 10.9  / 110:  1.374  0.334
+ 11    / 111:  1.332  0.476
+ 11.1  / 112:  1.275  0.612
+ 11.2  / 113:  1.204  0.742
+ 11.3  / 114:  1.120  0.864
+ 11.4  / 115:  1.023  0.976
+ 11.5  / 116:  0.916  1.078
+ 11.6  / 117:  0.798  1.168
+ 11.7  / 118:  0.672  1.245
+ 11.8  / 119:  0.538  1.308
+ 11.9  / 120:  0.398  1.357
+ 12    / 121:  0.254  1.391
+ 12.1  / 122:  0.107  1.410
+ 12.2  / 123: -0.041  1.414
+ 12.3  / 124: -0.188  1.402
+ 12.4  / 125: -0.334  1.374
+ 12.5  / 126: -0.476  1.332
+ 12.6  / 127: -0.612  1.275
+ 12.7  / 128: -0.742  1.204
+ 12.8  / 129: -0.864  1.120
+ 12.9  / 130: -0.976  1.023
+ 13    / 131: -1.078  0.916
+ 13.1  / 132: -1.168  0.798
+ 13.2  / 133: -1.245  0.672
+ 13.3  / 134: -1.308  0.538
+ 13.4  / 135: -1.357  0.398
+ 13.5  / 136: -1.391  0.254
+ 13.6  / 137: -1.410  0.107
+ 13.7  / 138: -1.414 -0.041
+ 13.8  / 139: -1.402 -0.188
+ 13.9  / 140: -1.374 -0.334
+ 14    / 141: -1.332 -0.476
+ 14.1  / 142: -1.275 -0.612
+ 14.2  / 143: -1.204 -0.742
+ 14.3  / 144: -1.120 -0.864
+ 14.4  / 145: -1.023 -0.976
+ 14.5  / 146: -0.916 -1.078
+ 14.6  / 147: -0.798 -1.168
+ 14.7  / 148: -0.672 -1.245
+ 14.8  / 149: -0.538 -1.308
+ 14.9  / 150: -0.398 -1.357
+ 15    / 151: -0.254 -1.391
+ 15.1  / 152: -0.107 -1.410
+ 15.2  / 153:  0.041 -1.414
+ 15.3  / 154:  0.188 -1.402
+ 15.4  / 155:  0.334 -1.374
+ 15.5  / 156:  0.476 -1.332
+ 15.6  / 157:  0.612 -1.275
+ 15.7  / 158:  0.742 -1.204
+ 15.8  / 159:  0.864 -1.120
+ 15.9  / 160:  0.976 -1.023
+ 16    / 161:  1.078 -0.916
+ 16.1  / 162:  1.168 -0.798
+ 16.2  / 163:  1.245 -0.672
+ 16.3  / 164:  1.308 -0.538
+ 16.4  / 165:  1.357 -0.398
+ 16.5  / 166:  1.391 -0.254
+ 16.6  / 167:  1.410 -0.107
+ 16.7  / 168:  1.414  0.041
+ 16.8  / 169:  1.402  0.188
+ 16.9  / 170:  1.374  0.334
+ 17    / 171:  1.332  0.476
+ 17.1  / 172:  1.275  0.612
+ 17.2  / 173:  1.204  0.742
+ 17.3  / 174:  1.120  0.864
+ 17.4  / 175:  1.023  0.976
+ 17.5  / 176:  0.916  1.078
+ 17.6  / 177:  0.798  1.168
+ 17.7  / 178:  0.672  1.245
+ 17.8  / 179:  0.538  1.308
+ 17.9  / 180:  0.398  1.357
+ 18    / 181:  0.254  1.391
+ 18.1  / 182:  0.107  1.410
+ 18.2  / 183: -0.041  1.414
+ 18.3  / 184: -0.188  1.402
+ 18.4  / 185: -0.334  1.374
+ 18.5  / 186: -0.476  1.332
+ 18.6  / 187: -0.612  1.275
+ 18.7  / 188: -0.742  1.204
+ 18.8  / 189: -0.864  1.120
+ 18.9  / 190: -0.976  1.023
+ 19    / 191: -1.078  0.916
+ 19.1  / 192: -1.168  0.798
+ 19.2  / 193: -1.245  0.672
+ 19.3  / 194: -1.308  0.538
+ 19.4  / 195: -1.357  0.398
+ 19.5  / 196: -1.391  0.254
+ 19.6  / 197: -1.410  0.107
+ 19.7  / 198: -1.414 -0.041
+ 19.8  / 199: -1.402 -0.188
+ 19.9  / 200: -1.374 -0.334
+ 20    / 201: -1.332 -0.476
+ 20.1  / 202: -1.275 -0.612
+ 20.2  / 203: -1.204 -0.742
+ 20.3  / 204: -1.120 -0.864
+ 20.4  / 205: -1.023 -0.976
+ 20.5  / 206: -0.916 -1.078
+ 20.6  / 207: -0.798 -1.168
+ 20.7  / 208: -0.672 -1.245
+ 20.8  / 209: -0.538 -1.308
+ 20.9  / 210: -0.398 -1.357
+ 21    / 211: -0.254 -1.391
+ 21.1  / 212: -0.107 -1.410
+ 21.2  / 213:  0.041 -1.414
+ 21.3  / 214:  0.188 -1.402
+ 21.4  / 215:  0.334 -1.374
+ 21.5  / 216:  0.476 -1.332
+ 21.6  / 217:  0.612 -1.275
+ 21.7  / 218:  0.742 -1.204
+ 21.8  / 219:  0.864 -1.120
+ 21.9  / 220:  0.976 -1.023
+ 22    / 221:  1.078 -0.916
+ 22.1  / 222:  1.168 -0.798
+ 22.2  / 223:  1.245 -0.672
+ 22.3  / 224:  1.308 -0.538
+ 22.4  / 225:  1.357 -0.398
+ 22.5  / 226:  1.391 -0.254
+ 22.6  / 227:  1.410 -0.107
+ 22.7  / 228:  1.414  0.041
+ 22.8  / 229:  1.402  0.188
+ 22.9  / 230:  1.374  0.334
+ 23    / 231:  1.332  0.476
+ 23.1  / 232:  1.275  0.612
+ 23.2  / 233:  1.204  0.742
+ 23.3  / 234:  1.120  0.864
+ 23.4  / 235:  1.023  0.976
+ 23.5  / 236:  0.916  1.078
+ 23.6  / 237:  0.798  1.168
+ 23.7  / 238:  0.672  1.245
+ 23.8  / 239:  0.538  1.308
+ 23.9  / 240:  0.398  1.357
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+ 
+! 6D tests for Ferret v6.8
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate_6d
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_6d
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              4        6        8     
+              2        3        4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- M:3 E:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- M:4 E:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- M:3 E:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- M:4 E:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- M:3 E:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- M:4 E:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              5        7        9     
+              3        4        5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- M:4 E:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- M:5 E:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- M:4 E:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- M:5 E:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- M:4 E:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- M:5 E:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax_6d
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid G48
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.167N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+                6.17N  
+                50
+ 160.5W / 1:  3.70015
+ 159.5W / 2:  3.70015
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.833N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.00000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.00000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions_6d
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.0000
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+           3.0000   6.0000   9.0000  12.0000  15.0000
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          4.00000  5.00000  6.00000  7.00000  8.00000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000  0.00000  1.00000  2.00000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            1.000    8.000   27.000   64.000  125.000
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  0.00000  0.00000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.000000  0.000000  0.000000  0.000000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+             1         2         3         4         5      
+              1         2         3         4         5
+ ---- N:1 F:   1
+ N:1 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:2 F:   2
+ N:2 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:3 F:   3
+ N:3 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:4 F:   4
+ N:4 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:5 F:   5
+ N:5 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+             ....     ....     ....  4.00000  5.00000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  4.00000  5.00000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33300  0.33300  0.33300  4.00000 -9.00000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          3.00000  3.00000  3.00000  4.00000  5.00000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  3.00000  3.00000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          2.00000  1.00000  0.00000  1.00000  2.00000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            2.718    7.389   20.086   54.598  148.413
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.69315  1.09861  1.38629  1.60944
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.301030  0.477121  0.602060  0.698970
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.841471  0.909297  0.141120 -0.756802 -0.958924
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.47493
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.540302 -0.416147 -0.989992 -0.653644  0.283662
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.55741 -2.18504 -0.14255  1.15782 -3.38052
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333 -1.47493
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  0.00000  0.00000  0.00000  0.00000
+ 2   / 2:  1.57080  0.78540  0.46365  0.32175  0.24498
+ 3   / 3:  1.57080  1.10715  0.78540  0.58800  0.46365
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  0.00000  1.00000  2.00000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000     ....  1.00000  2.00000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000 -9.00000  1.00000  2.00000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.337575  0.723822  0.030403  0.849932  0.169352
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -0.26718  0.28276 -0.32292  1.21676 -0.30437
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+          EBOXLO   EBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+          FBOXLO   FBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_direction_fcns_6d
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+               C   M_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1   M_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+               C   N_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1   N_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+          TEMP    EX#2
+M / 1:  30.7500  34.7500
+M / 2:  31.7500  33.7500
+M / 3:  32.7500  32.7500
+M / 4:  33.7500  31.7500
+M / 5:  34.7500  30.7500
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+          TEMP    EX#2
+N / 1:  30.7500  31.3500
+N / 2:  30.9500  31.1500
+N / 3:  31.1500  30.9500
+N / 4:  31.3500  30.7500
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+                 A      A        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+                 B      B        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000  1.00000  0.00000  0.00000     ....     ....
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms_6d
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:120 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:114 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 00:00 (interpolated)
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE EX#1     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.3553  32.3552  32.5032  32.8652  33.3285
+ 1.17N / 45:  32.1766  32.1710  32.2834  32.5970  33.0244
+ 0.83N / 44:  32.0256  32.0016  32.0631  32.3109  32.6873
+ 0.5N  / 43:  31.9306  31.8902  31.8887  32.0374  32.3408
+ 0.17N / 42:  31.8944  31.8343  31.7825  31.8263  32.0336
+ 0.17S / 41:  31.9538  31.8657  31.7716  31.7285  31.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.3553  38.3552  38.5032  38.8652  39.3285
+ 1.17N / 45:  38.1766  38.1710  38.2834  38.5970  39.0244
+ 0.83N / 44:  38.0256  38.0016  38.0631  38.3109  38.6873
+ 0.5N  / 43:  37.9306  37.8902  37.8887  38.0374  38.3408
+ 0.17N / 42:  37.8944  37.8343  37.7825  37.8263  38.0336
+ 0.17S / 41:  37.9538  37.8657  37.7716  37.7285  37.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.7553  37.7552  37.9032  38.2652  38.7285
+ 1.17N / 45:  37.5766  37.5710  37.6834  37.9970  38.4244
+ 0.83N / 44:  37.4256  37.4016  37.4631  37.7109  38.0873
+ 0.5N  / 43:  37.3306  37.2902  37.2887  37.4374  37.7408
+ 0.17N / 42:  37.2944  37.2343  37.1825  37.2263  37.4336
+ 0.17S / 41:  37.3538  37.2657  37.1716  37.1285  37.2282
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.7553  43.7552  43.9032  44.2652  44.7285
+ 1.17N / 45:  43.5766  43.5710  43.6834  43.9970  44.4244
+ 0.83N / 44:  43.4256  43.4016  43.4631  43.7109  44.0873
+ 0.5N  / 43:  43.3306  43.2902  43.2887  43.4374  43.7408
+ 0.17N / 42:  43.2944  43.2343  43.1825  43.2263  43.4336
+ 0.17S / 41:  43.3538  43.2657  43.1716  43.1285  43.2282
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.3553  34.3552  34.5032  34.8652  35.3285
+ 1.17N / 45:  34.1766  34.1710  34.2834  34.5970  35.0244
+ 0.83N / 44:  34.0256  34.0016  34.0631  34.3109  34.6873
+ 0.5N  / 43:  33.9306  33.8902  33.8887  34.0374  34.3408
+ 0.17N / 42:  33.8944  33.8343  33.7825  33.8263  34.0336
+ 0.17S / 41:  33.9538  33.8657  33.7716  33.7285  33.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.3553  40.3552  40.5032  40.8652  41.3285
+ 1.17N / 45:  40.1766  40.1710  40.2834  40.5970  41.0244
+ 0.83N / 44:  40.0256  40.0016  40.0631  40.3109  40.6873
+ 0.5N  / 43:  39.9306  39.8902  39.8887  40.0374  40.3408
+ 0.17N / 42:  39.8944  39.8343  39.7825  39.8263  40.0336
+ 0.17S / 41:  39.9538  39.8657  39.7716  39.7285  39.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.0220  36.0219  36.1698  36.5318  36.9952
+ 1.17N / 45:  35.8433  35.8377  35.9501  36.2637  36.6910
+ 0.83N / 44:  35.6923  35.6682  35.7298  35.9776  36.3539
+ 0.5N  / 43:  35.5973  35.5568  35.5554  35.7040  36.0075
+ 0.17N / 42:  35.5610  35.5010  35.4491  35.4929  35.7003
+ 0.17S / 41:  35.6205  35.5323  35.4383  35.3952  35.4948
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.0220  42.0219  42.1698  42.5318  42.9952
+ 1.17N / 45:  41.8433  41.8377  41.9501  42.2637  42.6910
+ 0.83N / 44:  41.6923  41.6682  41.7298  41.9776  42.3539
+ 0.5N  / 43:  41.5973  41.5568  41.5554  41.7040  42.0075
+ 0.17N / 42:  41.5610  41.5010  41.4491  41.4929  41.7003
+ 0.17S / 41:  41.6205  41.5323  41.4383  41.3952  41.4948
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ reading TEMP     M:104 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 863  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M: 90 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 864  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 88 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 88 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 865  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 94 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 94 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 866  complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 78 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 80 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 867  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:106 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 868  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 869  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 870  complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 66 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  29593.5
+ 23-JAN-1982 00 /  3:     ....  29593.5
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  8878.05
+ 23-JAN-1982 00 /  3:     ....  8878.05
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:    213056.    355093.
+ 23-JAN-1982 00 /  3:  20028585.  33381003.
+ 27-JAN-1982 00 /  4:    213084.    355141.
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1       2.1    
+                           1         2
+ 15-JAN-1982 00 /  1:      ....      ....
+ 19-JAN-1982 00 /  2:      ....      ....
+ 23-JAN-1982 00 /  3:      ....  0.000000
+ 27-JAN-1982 00 /  4:      ....      ....
+ 31-JAN-1982 00 /  5:      ....      ....
+ 04-FEB-1982 00 /  6:      ....      ....
+ 08-FEB-1982 00 /  7:      ....      ....
+ 12-FEB-1982 00 /  8:      ....      ....
+ 16-FEB-1982 00 /  9:      ....      ....
+ 20-FEB-1982 00 / 10:      ....      ....
+ 24-FEB-1982 00 / 11:      ....      ....
+ 28-FEB-1982 00 / 12:      ....      ....
+ 04-MAR-1982 00 / 13:      ....      ....
+ 08-MAR-1982 00 / 14:      ....      ....
+ 12-MAR-1982 00 / 15:      ....      ....
+ 16-MAR-1982 00 / 16:      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 64 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G092)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:     ....
+ 2.1 / 2:  2.50000
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G101)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MIN
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.00000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @SUM
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.05000
+ 2.1 / 2:  4.20000
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ -DELETE _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G096)
+    GRID (G096)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G106)           @MAX
+ eval    AFCST    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ regrid  AFCST    M: 46 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_aggregate_e
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M: 64 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M: 62 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M: 56 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M: 54 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   28.513   28.441   27.892   27.457   26.726   25.561     ....     ....     ....
+ 2   / 2:   85.539   85.323   83.676   82.370   80.177   76.683     ....     ....     ....
+ 3   / 3:   57.026   56.882   55.784   54.913   53.452   51.122     ....     ....     ....
+ 4   / 4:  114.051  113.765  111.568  109.826  106.903  102.245     ....     ....     ....
+cancel data fourfiles
+ -DELETE SST      M: 66 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M: 74 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ getgrid AIRT     C:  5 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G109)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M: 74 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:120 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   27.675   27.570   27.061   26.673   25.793   25.207     ....     ....     ....
+ 2   / 2:   86.539   86.323   84.676   83.370   81.177   77.683     ....     ....     ....
+ 3   / 3:   58.026   57.882   56.784   55.913   54.452   52.122     ....     ....     ....
+ 4   / 4:  115.051  114.765  112.568  110.826  107.903  103.245     ....     ....     ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+                 UWND     UWND     UWND      VWND     UWND
+59W    / -30:  2.20244  0.934329  2.20244  0.934329  1.56839
+57W    / -29:  2.26128  0.812758  2.26128  0.812758  1.53702
+55W    / -28:  1.99826  0.681776  1.99826  0.681776  1.34002
+53W    / -27:  1.93361  0.507158  1.93361  0.507158  1.22038
+51W    / -26:  1.64932  0.330430  1.64932  0.330430  0.98987
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+                 UWND     UWND      VWND     UWND     VWND
+59W    / -30:  2.20244  0.934329  0.934329  2.20244  1.56839
+57W    / -29:  2.26128  0.812758  0.812758  2.26128  1.53702
+55W    / -28:  1.99826  0.681776  0.681776  1.99826  1.34002
+53W    / -27:  1.93361  0.507158  0.507158  1.93361  1.22038
+51W    / -26:  1.64932  0.330430  0.330430  1.64932  0.98987
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_6d_lab_mode
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT21         PSXT1     PSYT1     PSZT2     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=28.84S:51.43N at AV4,D=1]
+ reading TAUX     M:106 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.274203
+ 23-AUG-1982 14 / 2: -0.236318
+ 29-AUG-1982 16 / 3: -0.198434
+ 04-SEP-1982 18 / 4: -0.160549
+ 10-SEP-1982 20 / 5: -0.122665
+ 16-SEP-1982 22 / 6: -0.104062
+ 23-SEP-1982 00 / 7: -0.104740
+ 29-SEP-1982 02 / 8: -0.105418
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=28.84S:51.43N at SM4,D=1]
+ reading TAUX     M: 94 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.649
+ 23-AUG-1982 14 / 2:  -89.328
+ 29-AUG-1982 16 / 3:  -75.007
+ 04-SEP-1982 18 / 4:  -60.686
+ 10-SEP-1982 20 / 5:  -46.365
+ 16-SEP-1982 22 / 6:  -39.333
+ 23-SEP-1982 00 / 7:  -39.590
+ 29-SEP-1982 02 / 8:  -39.847
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+ 
+ 
+! *********** v6.82 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn682_bug_fixes
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+! *********** v6.83 Additions ***********
+!  (was released as v6.84)
+ 
+GO bn_reset
+cancel mode verify
+GO bn683_bug_fixes
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.625140
+ 02-NOV-2011 07:55:36 /  2:  0.220931
+ 02-NOV-2011 07:56:36 /  3:  0.607368
+ 02-NOV-2011 07:57:36 /  4:  0.322594
+ 02-NOV-2011 07:58:36 /  5:  0.107545
+ 02-NOV-2011 07:59:36 /  6:  0.225720
+ 02-NOV-2011 08:00:36 /  7:  0.081070
+ 02-NOV-2011 08:01:36 /  8:  0.898013
+ 02-NOV-2011 08:02:36 /  9:  0.716275
+ 02-NOV-2011 08:03:36 / 10:  0.664871
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:      ....
+ 02-NOV-2011 07:54:31 / 114872:      ....
+ 02-NOV-2011 07:54:32 / 114873:      ....
+ 02-NOV-2011 07:54:33 / 114874:      ....
+ 02-NOV-2011 07:54:34 / 114875:      ....
+ 02-NOV-2011 07:54:35 / 114876:      ....
+ 02-NOV-2011 07:54:36 / 114877:  0.625140
+ 02-NOV-2011 07:54:37 / 114878:      ....
+ 02-NOV-2011 07:54:38 / 114879:      ....
+ 02-NOV-2011 07:54:39 / 114880:      ....
+ 02-NOV-2011 07:54:40 / 114881:      ....
+ 02-NOV-2011 07:54:41 / 114882:      ....
+ 02-NOV-2011 07:54:42 / 114883:      ....
+ 02-NOV-2011 07:54:43 / 114884:      ....
+ 02-NOV-2011 07:54:44 / 114885:      ....
+ 02-NOV-2011 07:54:45 / 114886:      ....
+ 02-NOV-2011 07:54:46 / 114887:      ....
+ 02-NOV-2011 07:54:47 / 114888:      ....
+ 02-NOV-2011 07:54:48 / 114889:      ....
+ 02-NOV-2011 07:54:49 / 114890:      ....
+ 02-NOV-2011 07:54:50 / 114891:      ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+set mode/last upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_outtype
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ribbon_plot
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descr_4digit
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-1900 / 1:  28.36
+ 15-FEB-1900 / 2:  28.38
+ 18-MAR-1900 / 3:  28.00
+ 17-APR-1900 / 4:  27.99
+ 17-MAY-1900 / 5:  28.41
+ 17-JUN-1900 / 6:  28.23
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_outtype
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME101)              FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME101)              FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_nonmonotonic
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_mod
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+ 
+! *********** v6.85 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn685_bug_fixes
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	double A(TIME10) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	double E410(TIME10) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	float E410(TIME10) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON1</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dsg_e_x
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nco_append
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+	double DDAT_ORIG(ZAXIS_ORIG) ;
+		DDAT_ORIG:missing_value = -1.e+34 ;
+		DDAT_ORIG:_FillValue = -1.e+34 ;
+		DDAT_ORIG:long_name = "DDAT[GZ=ZAXIS_ORIG at ASN]" ;
+
+// global attributes:
+		:history = "Fri Mar 28 11:42:04 2014: ncks -h -A -h z1.nc append_to_this.nc\n",
+			"FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nobounds
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+		XIRREG:units = "meters" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:units = "meters" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_write_integer_att
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descriptor_mc
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-0000 / 1:  28.36
+ 15-FEB-0000 / 2:  28.38
+ 17-MAR-0000 / 3:  28.00
+ 16-APR-0000 / 4:  27.99
+ 16-MAY-0000 / 5:  28.41
+ 16-JUN-0000 / 6:  28.23
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 60W (interpolated)
+             LATITUDE : 10N (interpolated)
+ 17-MAR-0000 / 1:  26.70
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.39
+ 16-JUN-0000 / 4:  27.65
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_color_only
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vtree
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+ 
+ 
+! *********** v6.86 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn686_bug_fixes
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ribbon_by_val
+! err685_ribbon_by_val.jnl
+! 11/21/2013
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+ 
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ppl_palette
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+ 
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+ 
+pal  bluescale.spk
+use levitus_climatology; shade/k=1 temp
+ 
+pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+ 
+pal   default
+pattern   solid
+ 
+fill sst[l=@ave]
+pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+ 
+! restore defaults
+palette default
+pattern solid
+ 
+GO bn_reset
+cancel mode verify
+GO err685_show_grid_e
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+ 
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+sh grid /e gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       M     E                   EBOX      EBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+      11>  11                    1          10.5
+      12>  12                    1          11.5
+sh grid /f gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       N     F                   FBOX      FBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_lowercaseAxis
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+ 
+use lowercaseTime.nc
+sh dat
+     currently SET data sets:
+    1> ./lowercaseTime.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AA                                        ...       ...       ...       1:15      ...       ...
+ BB                                        ...       ...       ...       1:8       ...       ...
+ 
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+ 
+! All this was correct
+show axis uppercasetime
+ name       axis              # pts   start                end
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 8
+show grid bb
+    GRID GHC2
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+ normal    E
+ normal    F
+ 
+! This variable has axis time, lowercase in the file
+sh grid aa
+    GRID GHC1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME16    T                   15 r   1                    15
+ normal    E
+ normal    F
+set axis/t0=1-jan-2001/units=days time
+ 
+! showed no output
+show axis time
+ name       axis              # pts   start                end
+ TIME      TIME                 3 i   01-JAN-2001 00:00    04-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 4.5
+ 
+! The axis did get changed but is inconsistently listed in the
+! internal arrays that store axis info.
+ 
+list/L=1:5 aa
+             VARIABLE : AA
+             FILENAME : lowercaseTime.nc
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_redefine_uvar_att
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on,
+!   returned a runtime error.
+ 
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
+ 
+GO bn_reset
+cancel mode verify
+GO err685_use_no_extension
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+ 
+! The directory contains files with all three extensions
+sp ls duplicate.*
+duplicate.cdf
+duplicate.des
+duplicate.nc
+ 
+! The one that's used is .nc
+use duplicate
+sh dat
+     currently SET data sets:
+    1> ./duplicate.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:1       1:10      ...       1:3       ...       ...
+ 
+ 
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+ 
+! Specify a nonexistent file, no extension
+use nosuchfile
+ 
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+ 
+use snoopy.dat
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err685_samplexy
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error
+! sending sub-range of variable into samplexy
+ 
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+             VARIABLE : SAMPLEXY(SST[X=290:310,Y=0:20], LON, LAT)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  26.84  26.77  26.66
+ 15-FEB      / 2:  26.60  26.52  26.35
+ 17-MAR      / 3:  26.68  26.61  26.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_shade_set
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+ 
+can dat/all
+ 
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the
+! epression being SHADED, inside a SHADE/SET
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !GAVE A BLANK PLOT
+ 
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+ 
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+ !-> shade/title="DAYS" tseries*z[gz=1:5:1]
+ 
+can var/all; can mem
+can axis timax
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err686_individual_levels
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+ 
+use coads_climatology
+ 
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+ 
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+LEV_TEXT = "(10)(20)(30)(40)"
+LEV_MIN = "10"
+LEV_MAX = "40"
+LEV_NUM = "3"
+LEV_DEL = "10"
+ 
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
+LEV_TEXT = "(10)(15)(20)(25)(30)"
+LEV_MIN = "10"
+LEV_MAX = "30"
+LEV_NUM = "4"
+LEV_DEL = "5"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_symnames
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+ 
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+! SHOW
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+FERRET_TEMPERATURE_EQUILIBRATOR_MAX = "35"
+ 
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+ 
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+can sym *max
+ 
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "0"
+ 
+ 
+! bn_symbols had a line to
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567XXX = "6"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strdim
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+ 
+use strdimfile.nc
+ 
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+ 
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	ENSEMBLE = 3 ;
+	maxStrlen64 = 64 ;
+variables:
+	double ENSEMBLE(ENSEMBLE) ;
+		ENSEMBLE:long_name = "Ensemble of Realizations" ;
+		ENSEMBLE:axis = "E" ;
+		ENSEMBLE:point_spacing = "even" ;
+	char LABELS(ENSEMBLE, maxStrlen64) ;
+		LABELS:long_name = "Realizations" ;
+		LABELS:history = "From http://dunkel.pmel.noaa.gov:8930/thredds/dodsC/data/atmos3.ncml" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+ 
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_5 = 5 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char STRVAR(XAX1_3, STRING1_5) ;
+		STRVAR:long_name = "mystrings" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_single_colorlev
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when
+! single level is specified with a range of values
+ 
+use coads_climatology
+ 
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+ 
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+ 
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+ 
+ 
+ 
+! *********** v6.9 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn687_bug_fixes
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err686_long_list_varnames
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+ 
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+ 
+! The list was cut off after woa_land_marker.
+! Try to load a variable later than that in the list.
+ 
+list etopo2_depth
+             VARIABLE : ETOPO2_DEPTH
+             FILENAME : longvarnames.tsv
+             SUBSET   : 10 points (X)
+ 1    /  1: -97.00
+ 2    /  2: -97.00
+ 3    /  3: -97.00
+ 4    /  4: -97.00
+ 5    /  5: -97.00
+ 6    /  6: -97.00
+ 7    /  7: -97.00
+ 8    /  8: -99.00
+ 9    /  9: -99.00
+ 10   / 10: -99.00
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_faxis_label
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis
+! shouldn't automatically get it.
+ 
+! Define a variable with a Julian calendar axis, and an abstract F axis
+ 
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+ 
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! This label should be just F : 3
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "F : 3"
+ 
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "FORECAST : 03-JAN-2000 00:00:00 JULIAN"
+ 
+GO bn_reset
+cancel mode verify
+GO err686_dup_axnames
+! err686_dup_axnames
+! Ticket 1750
+!
+! Make some datasets. Same axis length and name,
+! different coordinates.
+ 
+def ax/x=1:4:1 xaxis_test
+let a = x[gx=xaxis_test]
+save/clob/file=a.nc a
+def ax/x=11:14:1 xaxis_test
+let b = x[gx=xaxis_test]
+save/clob/file=b.nc b
+can var/all; can dat/all
+ 
+! Check axis coords.
+use a; use b
+sh dat
+     currently SET data sets:
+    1> ./a.nc
+ name     title                             I         J         K         L         M         N
+ A        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+    2> ./b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+sh grid a[d=1]
+    GRID GSI1
+ name       axis              # pts   start                end
+ XAXIS_TEST1 X                  4 r   1                    4
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+sh grid b[d=2]
+    GRID GRR1
+ name       axis              # pts   start                end
+ XAXIS_TEST X                   4 r   11                   14
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! Write b with its Ferret internal axis name XAXIS_TEST1
+save/clob/file=c.nc a[d=1],b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST1 = 4 ;
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Yet more combinations
+save/clob/file=c.nc b, a[d=1]
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+	XAXIS_TEST1 = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! We can use /KEEP_AXISNAMES, changes XAXIS_TEST1 to XAXIS_TEST
+save/clobber/file=c.nc b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Subsets also use XAXIS_TEST1
+save/clobber/file=c.nc/i=2:4 b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST2_4 = 3 ;
+variables:
+	double XAXIS_TEST2_4(XAXIS_TEST2_4) ;
+		XAXIS_TEST2_4:point_spacing = "even" ;
+		XAXIS_TEST2_4:axis = "X" ;
+	double B(XAXIS_TEST2_4) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Unless we use /KEEP_AXISNAMES - which removes renaming
+! due to subsetting and also due to internal names
+save/clobber/file=c.nc/i=2:4/keep b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 3 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! If we try /KEEP_AXISNAMES but there is a conflict, it's an err
+set mode ignore
+save/clobber/keep/file=nc b,a[d=1]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_cancel_invalid_var
+! err686_cancel_invalid_var
+! ticket 2159
+ 
+! The cancel variable ran into an incorrect setting
+! for variable-in-memory
+ 
+set mode ignore
+let b = 1
+shade b
+ 
+set mode/last ignore
+cancel var b
+ 
+! Shade plot of a less-than-one cell region. Its where the bug came from.
+use coads_climatology
+shade/x=161.1:161.3/y=0.2:0.4/L=1 sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_redef_ascii_att
+! err686_redef_ascii_att.jnl
+! Bug 2161
+! DEFINE ATT to redefine title or units for variable
+! in ascii dataset caused crash
+ 
+columns/delim=" " EZ.DAT
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ 
+! A new attribuge causes no problems
+define att/output v1.comment = "First var from EZ.DAT"
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ 
+! Initial definition of units is ok.
+! Re-defining the title or units causes crash
+define att/output v1.long_name = "vee one"
+ 
+! Initial definition of units is ok.
+! Re-defining units causes crash
+define att/output v1.units="km"
+define att/output v1.units="meters"
+ 
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = vee one 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ V1.units = meters 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_sho_nonexist_att
+! err686_sho_nonexist_att.jnl
+! See ticket 2133
+ 
+!  Too many error messages were issued on this error
+set mode ignore
+ 
+use levitus_climatology
+show att temp.noexist[d=levitus_climatology]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_set_var_name
+! err686_set_var_name.jnl
+! ticket 2152
+! rename user var or file var. Err message was
+! wrong if the name already exists.
+ 
+SET MODE IGNORE
+ 
+let a = 1
+let b = 2
+! Intentional error, new name is already a defined variable
+set var/name=b a
+! This rename is ok
+set var/name=c a
+sh var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     B = 2
+     C = 1
+ 
+use gt4d011.cdf
+! Intentional error, new name already in file
+set var/name=temp salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+! This rename is ok
+set var/name=salinity salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+ 
+! Test LET/D variables:
+let/d=1 myvar = taux - tauy
+! This is an error, new name already in file
+set var/name=psi myvar
+! This is ok, new let/d name associated with the file
+set var/name=diff myvar
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ ------------------------------
+ DIFF[D=gt4d011] = TAUX - TAUY
+ 
+ 
+ 
+ 
+SET MODE/LAST ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bad_axis_bounds
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+ 
+use badbounds.nc
+show data
+     currently SET data sets:
+    1> ./badbounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MONTH_IRREG_BNDS
+                                           1:2       ...       ...       1:12      ...       ...
+       (invalid axis bounds)
+ TEMP2    TEMP[GT=MONTH_IRREG at ASN]         1:1       1:1       1:1       1:12      ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_enter_exit_GO
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+ 
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+ 
+set redirect/tee/journal
+go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ 
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+ !-> if 1 THEN GO bn_shortgo2
+! Enter_GO bn_shortgo2
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
+! Enter_GO bn_short.sub tvar ave
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+ 
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+ !-> LIST/nohead/norow tvar[t=-5:9 at ave]	! neg/pos t endpoints
+   2.000
+ 
+! Exit_GO
+! Exit_GO
+ 
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+ !-> repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+!-> REPEAT: L=1
+ !-> if 0 then go bn_shortgo
+ !-> def sym ok = 1
+!-> REPEAT: L=2
+ !-> if 1 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 2
+!-> REPEAT: L=3
+ !-> if 2 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 3
+ 
+cancel redirect
+ 
+GO bn_reset
+cancel mode verify
+GO bn_stddev
+! bn_std.jnl
+! New StdDev transform
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E (interpolated)
+             LATITUDE : 10N (interpolated)
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (standard deviation)
+          0.4323
+list/x=100/L=1 sst[y=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E (interpolated)
+             LATITUDE : 90S to 90N (standard deviation)
+             TIME     : 16-JAN 06:00
+          10.09
+list/y=10/L=1 sst[x=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (standard deviation)
+             LATITUDE : 10N (interpolated)
+             TIME     : 16-JAN 06:00
+          0.7935
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@STD]
+             VARIABLE : ZONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N (interpolated)
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          3.366
+list/y=3/l=1 temp[x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 3N (interpolated)
+             TIME     : 17-AUG-1982 12:00
+ 5     /  1:  0.2508
+ 15    /  2:  0.2559
+ 25    /  3:  0.2623
+ 35    /  4:  0.2318
+ 45    /  5:  0.1489
+ 55    /  6:  0.1136
+ 65    /  7:  0.2355
+ 75    /  8:  0.4054
+ 85    /  9:  0.5649
+ 95    / 10:  0.7755
+list/y=3/l=1 temp[z=@std,x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 3N (interpolated)
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          0.1946
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_axis_name
+! bn_set_axis_name.jnl
+! ticket 2160 Implementing new qualifier SET AXIS/NAME
+! 3/2014
+!
+!
+! Prepare a dataset with a time axis
+ 
+define axis/t=1-may-2010:5-may-2010:1/units=days daysaxis
+let a = t[gt=daysaxis]
+save/clobber/file=a.nc a
+ 
+cancel variable a
+cancel axis daysaxis
+ 
+!  We define some axis, then open a dataset with an axis of that name.
+ 
+define axis/t=1-jan-2000:31-jan-2000:1/units=days daysaxis
+ 
+use a.nc
+ 
+! The axis in the dataset has been renamed.
+say `a,return=taxis`
+ !-> MESSAGE/CONTINUE DAYSAXIS1
+DAYSAXIS1
+ 
+! So, rename our user-defined axis
+set axis/name=days2000 daysaxis
+ 
+! and now rename the one from the dataset back to its original name
+ 
+set axis/name=daysaxis `a,return=taxis`
+ !-> set axis/name=daysaxis DAYSAXIS1
+sh grid a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ daysaxis  TIME                 5 r   01-MAY-2010 00:00    05-MAY-2010 00:00
+ normal    E
+ normal    F
+ 
+cancel data/all
+ 
+! If an axis is used in several datsets, renaming it of course
+! changes the name for all grids.
+! The attribute structure gets updated as well.
+ 
+! Make several datasets with the same x axis.
+define axis/x=1:13:1/units=meters x13axis
+let a = x[gx=x13axis]
+let b = 3*x[gx=x13axis]
+let c = 5*x[gx=x13axis]
+save/clobber/file=a.nc a
+save/clobber/file=b.nc b
+save/clobber/file=c.nc c
+ 
+can var/all
+can axis x13axis
+ 
+! Open them in Ferret; all grids are the same.
+use a.nc, b.nc, c.nc
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+ 
+! Rename the axis
+set axis/name=x_in_meters x13axis
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+ 
+! For SHOW DAT/ATT we get info from the attribute structure.
+! It has the udated name.
+sh dat/att
+     currently SET data sets:
+    1> ./a.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ A                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        13   T       X[GX=X13AXIS]
+  
+    2> ./b.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ B                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       3*X[GX=X13AXIS]
+  
+    3> ./c.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.862   28-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ C                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       5*X[GX=X13AXIS]
+  
+ 
+! Intentional errors
+set mode ignore
+ 
+! Name already in use
+set axis/name=days2000 x_in_meters
+ 
+! Missing or illegal name
+set axis/name x_in_meters
+set axis/name=45 x_in_meters
+set axis/name=.fr x_in_meters
+ 
+set mode/last ignore
+ 
+ 
+!  *********** Always do a bn_reset  ***********
+!  *********** make sure things clean up well **
+GO bn_reset
+cancel mode verify
+ 
+! version 2.3 requires exit/command *sh* 3/92
+exit/command
+yes? ! bn_all_ef_shell.jnl
+yes? ! 5/05 *acm*
+yes? ! run bn_all_ef tests
+yes? 
+yes? GO bn_all_ef
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.862  
+ 	Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14
+ 	28-Mar-14 11:42     
+
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+ADD_9(A,B,C,D,E,F,G,H,I)
+    (demonstration function) adds 9 arguments
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+AVET(A)
+    (demonstration function) returns the time average
+    A: data to be averaged over the time axis
+show func pass_thru
+PASS_THRU(A)
+    (demonstration function) sets result equal to input
+    A: this arg is passed through
+show func sto*
+STORAGE(A)
+    sets result equal to input/10
+    A: input
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+list a
+             VARIABLE : ADD_9(A1,A2,A3,A1,A2,A3,A1,A2,A3)
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  263.6
+ 153E   / 67:  264.5
+ 155E   / 68:  264.2
+ 157E   / 69:  261.3
+ 159E   / 70:  260.9
+ 161E   / 71:  262.4
+ 163E   / 72:  264.0
+ 165E   / 73:  261.1
+ 167E   / 74:  260.9
+ 169E   / 75:  261.0
+ 171E   / 76:  259.3
+ 173E   / 77:  257.9
+ 175E   / 78:  257.0
+ 177E   / 79:  259.1
+ 179E   / 80:  254.8
+list  a - 3 * sst[d=1,l=1:3 at sum]
+             VARIABLE : A - 3 * SST[D=coads_climatology,L=1:3 at SUM]
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+set mode/last ignore_errors
+go bench_avet
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a = avet(sst)
+list a
+             VARIABLE : AVET(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+                1S    
+                45
+ 151E   / 66:  29.28
+ 153E   / 67:  29.39
+ 155E   / 68:  29.35
+ 157E   / 69:  29.03
+ 159E   / 70:  28.99
+ 161E   / 71:  29.15
+ 163E   / 72:  29.33
+ 165E   / 73:  29.01
+ 167E   / 74:  28.99
+ 169E   / 75:  29.00
+ 171E   / 76:  28.81
+ 173E   / 77:  28.66
+ 175E   / 78:  28.56
+ 177E   / 79:  28.79
+ 179E   / 80:  28.31
+list a - sst[l=@ave]
+             VARIABLE : A - SST[L=@AVE]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                  1S      
+                  45
+ 151E   / 66:  0.000E+00
+ 153E   / 67: -3.553E-15
+ 155E   / 68:  0.000E+00
+ 157E   / 69:  0.000E+00
+ 159E   / 70:  3.553E-15
+ 161E   / 71:  7.105E-15
+ 163E   / 72:  3.553E-15
+ 165E   / 73:  0.000E+00
+ 167E   / 74:  0.000E+00
+ 169E   / 75:  3.553E-15
+ 171E   / 76:  0.000E+00
+ 173E   / 77:  3.553E-15
+ 175E   / 78:  0.000E+00
+ 177E   / 79:  3.553E-15
+ 179E   / 80:  3.553E-15
+ 
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+             X: 0.5 to 9.5
+ Column  1: B is X[I=1:9,K=1:5]
+ Column  2: C is AVET(A)
+             B     C
+1   / 1:  1.000   4.00
+2   / 2:  2.000   5.00
+3   / 3:  3.000   6.00
+4   / 4:  4.000   7.00
+5   / 5:  5.000   8.00
+6   / 6:  6.000   9.00
+7   / 7:  7.000  10.00
+8   / 8:  8.000  11.00
+9   / 9:  9.000  12.00
+ 
+set mode/last ignore_errors
+go bench_pass_thru
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+             VARIABLE : PASS_THRU(X)
+             SUBSET   : 20 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 11   / 11:  11.00
+ 12   / 12:  12.00
+ 13   / 13:  13.00
+ 14   / 14:  14.00
+ 15   / 15:  15.00
+ 16   / 16:  16.00
+ 17   / 17:  17.00
+ 18   / 18:  18.00
+ 19   / 19:  19.00
+ 20   / 20:  20.00
+set region/i=1:20
+list sin(a)
+             VARIABLE : SIN(A)
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8415
+ 2    /  2:  0.9093
+ 3    /  3:  0.1411
+ 4    /  4: -0.7568
+ 5    /  5: -0.9589
+ 6    /  6: -0.2794
+ 7    /  7:  0.6570
+ 8    /  8:  0.9894
+ 9    /  9:  0.4121
+ 10   / 10: -0.5440
+ 11   / 11: -1.0000
+ 12   / 12: -0.5366
+ 13   / 13:  0.4202
+ 14   / 14:  0.9906
+ 15   / 15:  0.6503
+ 16   / 16: -0.2879
+ 17   / 17: -0.9614
+ 18   / 18: -0.7510
+ 19   / 19:  0.1499
+ 20   / 20:  0.9129
+can var/all
+can region
+ 
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+             VARIABLE : PASS_THRU(SST[L=@AVE,Y=@SBX:11])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+             VARIABLE : PASS_THRU(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 16-JAN 06:00
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   0.59
+ 71N   / 81:   0.62
+ 69N   / 80:   0.45
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   3.32
+ 43N   / 67:   4.72
+ 41N   / 66:   4.84
+ 39N   / 65:   8.63
+ 37N   / 64:   8.07
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:  18.91
+ 27N   / 59:  20.83
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:  25.41
+ 13N   / 52:  25.37
+ 11N   / 51:  25.82
+ 9N    / 50:  27.20
+ 7N    / 49:  26.11
+ 5N    / 48:  26.10
+ 3N    / 47:  26.25
+ 1N    / 46:  26.44
+ 1S    / 45:  27.01
+ 3S    / 44:  27.61
+ 5S    / 43:  28.24
+ 7S    / 42:  28.71
+ 9S    / 41:  28.46
+ 11S   / 40:  28.07
+ 13S   / 39:  28.15
+ 15S   / 38:  28.08
+ 17S   / 37:  28.29
+ 19S   / 36:  27.61
+ 21S   / 35:  27.59
+ 23S   / 34:  27.06
+ 25S   / 33:  26.70
+ 27S   / 32:  25.89
+ 29S   / 31:  24.65
+ 31S   / 30:  23.86
+ 33S   / 29:  22.16
+ 35S   / 28:  20.58
+ 37S   / 27:  19.20
+ 39S   / 26:  17.51
+ 41S   / 25:  14.44
+ 43S   / 24:   8.55
+ 45S   / 23:   7.51
+ 47S   / 22:   5.77
+ 49S   / 21:   4.21
+ 51S   / 20:   3.64
+ 53S   / 19:   2.87
+ 55S   / 18:   2.67
+ 57S   / 17:   2.05
+ 59S   / 16:   1.37
+ 61S   / 15:   1.33
+ 63S   / 14:   0.77
+ 65S   / 13:  -0.04
+ 67S   / 12:  -0.93
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+list/x=50 a[l=@ave,y=@sbx:11]
+             VARIABLE : PASS_THRU(SST)
+                        box smoothed by 11 pts on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (averaged)
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+ 
+set mode/last ignore_errors
+go bench_storage
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+              130.5E 131.5E 
+                1      2
+ 1.5N  / 50:   ....  2.955
+ 1.17N / 49:   ....  2.962
+ 0.83N / 48:   ....  2.966
+ 0.5N  / 47:   ....  2.973
+ 0.17N / 46:   ....  2.985
+ 0.17S / 45:   ....  2.990
+ 0.5S  / 44:   ....   ....
+ 
+can region
+set region/x=140w/y=10n/k=1
+list a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 140.5W
+             LATITUDE : 9.8N
+             DEPTH (m): 5
+                      140.5W 
+                       90
+ 15-JAN-1982 14 / 1:  2.656
+ 18-JAN-1982 15 / 2:  2.654
+ 21-JAN-1982 16 / 3:  2.652
+ 24-JAN-1982 17 / 4:  2.649
+ 27-JAN-1982 18 / 5:  2.646
+ 
+can region
+ 
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+             VARIABLE : STORAGE(B)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 0.7S to 1.7N (averaged)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+ 140.5E / 11:  2.953
+ 141.5E / 12:  2.956
+ 142.5E / 13:  2.961
+ 143.5E / 14:  2.966
+ 144.5E / 15:  2.968
+ 145.5E / 16:  2.968
+ 146.5E / 17:  2.967
+ 147.5E / 18:  2.970
+ 148.5E / 19:  2.974
+ 149.5E / 20:  2.979
+ 
+set mode/last ignore_errors
+ 
+go bench_subtract
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+ 
+set mode ignore_errors
+ 
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+             VARIABLE : SUBTRACT(OATEMP,SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+             VARIABLE : A - B
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+ 
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             DEPTH (m): 0
+                    179E   
+                     80
+ 16-JAN      / 1:  0.1934
+ 15-FEB      / 2:  0.1304
+ 17-MAR      / 3:    ....
+ 
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+             VARIABLE : SUBTRACT(A,B)
+             SUBSET   : 30 points (X)
+             Y        : 15
+              15    
+              15
+ 1    /  1: -14.00
+ 2    /  2: -13.00
+ 3    /  3: -12.00
+ 4    /  4: -11.00
+ 5    /  5: -10.00
+ 6    /  6:  -9.00
+ 7    /  7:  -8.00
+ 8    /  8:  -7.00
+ 9    /  9:  -6.00
+ 10   / 10:  -5.00
+ 11   / 11:  -4.00
+ 12   / 12:  -3.00
+ 13   / 13:  -2.00
+ 14   / 14:  -1.00
+ 15   / 15:   0.00
+ 16   / 16:   1.00
+ 17   / 17:   2.00
+ 18   / 18:   3.00
+ 19   / 19:   4.00
+ 20   / 20:   5.00
+ 21   / 21:   6.00
+ 22   / 22:   7.00
+ 23   / 23:   8.00
+ 24   / 24:   9.00
+ 25   / 25:  10.00
+ 26   / 26:  11.00
+ 27   / 27:  12.00
+ 28   / 28:  13.00
+ 29   / 29:  14.00
+ 30   / 30:  15.00
+ 
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+list/x=150:160/y=0 subtract(a,26)
+             VARIABLE : SUBTRACT(A,26)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+ 
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                1S    
+                45
+ 151E   / 66:  1.109
+ 153E   / 67:  1.124
+ 155E   / 68:  1.027
+ 157E   / 69:  0.883
+ 159E   / 70:  0.912
+ 
+set mode/last ignore_errors
+ 
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
+ 
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+!
+! 4/2006 all efs distributed with Ferret except writev5d and the
+!        examples tested in bench_examples.jnl are now internally linked.
+ 
+GO bn_reset
+cancel mode verify
+go bench_v5d
+! benchmark for Vis5D external function
+! 5/99 ACM
+ 
+ 
+!  Write data to a Vis5D file.  The first argument to the
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+ 
+can region
+ set mode ignore_error
+ 
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+To view the file with Vis5D say:   GO vis5d_start vis5d_out.v5d
+ 
+set mode/last ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_v5d_strings.jnl
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+ 
+go bn_reset
+cancel mode verify
+go bn_fcn_calls.jnl
+! Simple tests of external functions
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and
+!             fill_xy to bn_internal_external_functions.jnl
+ 
+exit
+ 
+exit/command
+ 
+-----
+Appending ncdump output
+ 
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_17 = 17 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_17) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348804, 27.9324667419545,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+		TIME4:bounds = "TIME4_bnds" ;
+	double TIME4_bnds(TIME4, bnds) ;
+	float SST(TIME4, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+
+ TIME4_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+	TIME4edges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+		TIME4:edges = "TIME4edges" ;
+	double TIME4edges(TIME4edges) ;
+		TIME4edges:edges = " " ;
+	float SST(TIME4, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+
+ TIME4edges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.862   28-Mar-14" ;
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+	float SST(TIME4, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME7 = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME7(TIME7) ;
+		TIME7:units = "hour since 0000-01-01 00:00:00" ;
+		TIME7:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME7:modulo = " " ;
+		TIME7:axis = "T" ;
+		TIME7:standard_name = "time" ;
+	float SST(TIME7, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME7 = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT1100_100 = 1 ;
+	PSYT135_56 = 22 ;
+	PSZT11_1 = 1 ;
+	TIME11 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT1100_100(PSXT1100_100) ;
+		PSXT1100_100:units = "degrees_east" ;
+		PSXT1100_100:point_spacing = "even" ;
+		PSXT1100_100:modulo = 360. ;
+		PSXT1100_100:axis = "X" ;
+		PSXT1100_100:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_1(PSZT11_1) ;
+		PSZT11_1:units = "meters" ;
+		PSZT11_1:positive = "down" ;
+		PSZT11_1:point_spacing = "uneven" ;
+		PSZT11_1:axis = "Z" ;
+		PSZT11_1:standard_name = "depth" ;
+		PSZT11_1:bounds = "PSZT11_1_bnds" ;
+	double PSZT11_1_bnds(PSZT11_1, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:point_spacing = "even" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	float TEMP(TIME11, PSZT11_1, PSYT135_56, PSXT1100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME11, PSZT11_1, PSYT148_48, PSXT191_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME11, PSZT11_1, PSYT148_48, PSXT191_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:new_att = "something" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "meters" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:new_att = "something" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "meters" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double FAREN(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	int FAREN(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	TDAY = UNLIMITED ; // (31 currently)
+	LON1_5 = 5 ;
+	LAT1_5 = 5 ;
+	bnds = 2 ;
+	ZT = 10 ;
+	TIME1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double TDAY(TDAY) ;
+		TDAY:units = "days since 1998-12-31 00:00:00" ;
+		TDAY:axis = "T" ;
+		TDAY:calendar = "GREGORIAN" ;
+		TDAY:time_origin = "31-DEC-1998" ;
+		TDAY:standard_name = "time" ;
+	double MyUpperLowerCaseVar(TDAY, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double LON1_5(LON1_5) ;
+		LON1_5:point_spacing = "even" ;
+		LON1_5:axis = "X" ;
+		LON1_5:standard_name = "longitude" ;
+	double LAT1_5(LAT1_5) ;
+		LAT1_5:point_spacing = "uneven" ;
+		LAT1_5:axis = "Y" ;
+		LAT1_5:standard_name = "latitude" ;
+		LAT1_5:bounds = "LAT1_5_bnds" ;
+	double LAT1_5_bnds(LAT1_5, bnds) ;
+	float ZT(ZT) ;
+		ZT:units = "meters" ;
+		ZT:positive = "down" ;
+		ZT:point_spacing = "uneven" ;
+		ZT:axis = "Z" ;
+		ZT:standard_name = "depth" ;
+		ZT:bounds = "ZT_bnds" ;
+	float ZT_bnds(ZT, bnds) ;
+	double TIME1478(TIME1478) ;
+		TIME1478:calendar = "NOLEAP" ;
+		TIME1478:point_spacing = "even" ;
+		TIME1478:axis = "T" ;
+		TIME1478:standard_name = "time" ;
+	double newvar(TIME1478, ZT, LAT1_5, LON1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:units = "deg" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:units = "degrees" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.862   28-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+-----
+end of ncdump output
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_startupfile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.862  
+ 	Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14
+ 	28-Mar-14 11:42     
+
+CAN MODE VERIFY
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "656"
+PPL$YPIXEL = "492"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.862"
+FERRET_PLATFORM = "Linux 2.6.32-431.5.1.el6.x86_64 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 10:43:06 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "28-Mar-14"
+SESSION_TIME = "11:42"
+SESSION_PID = "31005"
+DELTA_CPU = "0.040993"
+CLOCK_SECS = "0.304"
+CURRENT_DATE = "28-Mar-14"
+CURRENT_TIME = "11:42:09"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "startup_tests.plt"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "8.000"
+PPL$YLEN = "6.000"
+PPL$XORG = "1.200"
+PPL$YORG = "1.400"
+PPL$WIDTH = "10.20"
+PPL$HEIGHT = "8.800"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+WIN_TITLE = "28-Mar-14:11:42"
+VP_WIDTH = "10.2"
+VP_HEIGHT = "8.8"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1"
+VP_TOP_MARGIN = "1.4"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+GO_FILE = "./bn_startupfile.jnl"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE         SET         startup_tests.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_gif
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.862  
+ 	Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14
+ 	28-Mar-14 11:42     
+
+! bn450_gif.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of gif file in batch mode using
+! frame/file=bnplot.gif....will create three gif files
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= .gif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+frame/file=bnplot.gif
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+frame/file=bnplot.gif
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+frame/file=bnplot.gif
+ 
+! Prior to v5.8 could not get the window size in pixels when in gif mode
+show symbol ppl$xpixel
+PPL$XPIXEL = "1152"
+show symbol ppl$ypixel
+PPL$YPIXEL = "662"
+ 
+! V6.13
+! transparency with FRAME/TRANS
+!!
+! These gif images have the background color white or black
+! replaced by transparent color. This can be tested by putting
+! them into an HTML document with a colored background.
+! e.g. a file called test_transparent.html containing only this line:
+! <html> <body bgcolor="orange"> <img src="testfile.gif"/> </body> </html>
+ 
+can view
+use coads_climatology
+shade/nokey/lev=50 sst[L=1]
+frame/trans/file=testbackground.gif
+ 
+! moved here from bn500_bug_fixes.jnl. The frame/  command it contains
+! has trouble when running the benchmarks from remote desktop
+go bn_reset
+cancel mode verify
+go err491_long_gif_name
+! err491_long_gif_name.jnl
+! *sh* 4/99 - test 175 character gif name
+ 
+! name length extended with changes to save_frame.F and xeq_frame.F
+ 
+set wind/siz=0.03
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+sp rm -f abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+ 
+frame/file="abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif"
+ 
+spawn ls abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif
+ 
+ 
+! The fix for bug 1396
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=gif_dashbug.gif
+ 
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_ps
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.862  
+ 	Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14
+ 	28-Mar-14 11:42     
+
+! bn450_ps.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of ps files in batch mode using
+! "-batch bnplot.ps" command line option...will create on final ps file
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.ps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+ 
+set mode ignore
+frame/file=bnplot.ps    ! DELIBERATE ERROR MESSAGE
+can mode ignore
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_batch_metafile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.862  
+ 	Linux 2.6.32-431.5.1.el6.x86_64 64-bit - 03/28/14
+ 	28-Mar-14 11:42     
+
+! bn_batch_metafile.jnl
+! Run at the end of the benchmark scripts, starting ferret with the flags
+!   -batch bat.plt
+! Produces nine metafiles.
+ 
+cancel mode logo
+ 
+! test viewports and set window/clear; cancel viewport
+set view upper
+plot/i=1:150 sin(i/12)
+set view lower
+plot/color=red/i=1:150 cos(i/10)
+ 
+set window/clear
+ 
+set view left
+shade/i=1:15/j=1:15/lev=30 i*j
+set view right
+shade/i=1:15/j=1:15 cos(i)* sin(j)
+ 
+cancel viewports
+ 
+set view ur
+plot/i=1:12 1./i
+set view ll
+shade/i=1:150/j=1:150 cos(i/10) - sin(j/12)
+ 
+! polygon command and palette
+ 
+cancel viewports
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! more viewports, with pplus/reset
+ 
+set view upper; shade/i=1:10/j=1:10 i*j
+cancel viewports
+pplus/reset
+ 
+! cancel viewports when viewport wasnt set
+! and set window/clear after cancel viewports
+ 
+plot/vs/line/i=1:314 i*cos(i/20),i*sin(i/20)
+plot/vs/line/over/i=1:314 i*cos(i/30),i*sin(i/20)
+ 
+cancel viewports
+set window/clear
+ 
+! aspect ratio can be set
+ 
+set window/asp=3
+shade/i=1:15/j=1:15/lev=20 i*j
+ 
+set win/asp=1
+fill/i=1:15/j=1:15/lev=20 i*j
+ 
+pplus/reset
+ 
+ 
+! Bug 1396 fixed
+ 
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+cancel viewports
+ 
+! intentional errors and ignored commands
+! set and cancel mode metafile are ignored
+ 
+set mode metafile new.plt
+ 
+cancel mode metafile
+ 
+plot/i=1:12/title="after cancel mode metafile in batch mode" 1./i
+ 
+! set window commands are ignored, except for set window/aspect
+set window/new
+ 
+set window/location=0.1,0.1/title="another title"
+ 
+set mode/last logo
+exit/command
+Ended at Fri Mar 28 11:42:11 PDT 2014
diff --git a/bench/ansley_official.x86_64-linux_err b/bench/ansley_official.x86_64-linux_err
new file mode 100644
index 0000000..5a4e9e5
--- /dev/null
+++ b/bench/ansley_official.x86_64-linux_err
@@ -0,0 +1,3700 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/x86/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 53303709 Mar 26 15:36 /home/users/ansley/build/x86/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/x86/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: fixing ticket 2161: redefine long_name or units for ascii-file var
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/x86/FERRET/external_functions/ext_func
+FER_GO=. /home/users/tmap/ferret/x86_64-linux/go /home/users/tmap/ferret/x86_64-linux/examples /home/users/tmap/ferret/x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/x86_64-linux/ppl
+PWD=/home/users/ansley/build/x86/FERRET/bench
+Beginning at Wed Mar 26 15:37:53 PDT 2014
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO bn_dollar hello
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO bn_dollar hello
+say ($10)0
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          Legal range is 1 to 3
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+cont/over/i=1:10/color=noexist i
+ **ERROR: unknown command qualifier: thick=4
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: multiple specifications on X axis
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: multiple specifications on X axis
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G003) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+Replacing definition of grid G12
+Replacing definition of grid G24
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TCAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+Replacing definition of axis Y1
+Replacing definition of axis Y2
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+Replacing definition of grid TGRID
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X10
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of grid G1
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis Z1
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport LL6
+Re-defining viewport UL6
+Re-defining viewport LM6
+Re-defining viewport UM6
+Re-defining viewport LR6
+Re-defining viewport UR6
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+Replacing definition of axis TAX2
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G022)
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ *** NOTE: Not deleted: XEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: XODD
+ *** NOTE: Axis is in use by grid G13
+ *** NOTE: Not deleted: YEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: YODD
+ *** NOTE: Axis is in use by grid G2
+ *** NOTE: Not deleted: ZEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: ZODD
+ *** NOTE: Axis is in use by grid G3
+ *** NOTE: Not deleted: TEVEN
+ *** NOTE: Axis is in use by grid EVEN
+ *** NOTE: Not deleted: TODD
+ *** NOTE: Axis is in use by grid G4
+ *** NOTE: Not deleted: XCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: YFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: YCOARSE
+ *** NOTE: Axis is in use by grid GCOARSE
+ *** NOTE: Not deleted: XFINE
+ *** NOTE: Axis is in use by grid GFINE
+ *** NOTE: Not deleted: TAX48
+ *** NOTE: Axis is in use by grid G48
+ *** NOTE: Not deleted: XEZ1
+ *** NOTE: Axis is in use by grid GEZ1
+ *** NOTE: Not deleted: XEZ2
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: YEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: ZEZ
+ *** NOTE: Axis is in use by grid GEZ2
+ *** NOTE: Not deleted: XEZ3
+ *** NOTE: Axis is in use by grid GEZ3
+ *** NOTE: Not deleted: LON_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LAT_FIELD_J_AXIS
+ *** NOTE: Axis is in use by grid LAT_FIELD_GRID
+ *** NOTE: Not deleted: LON_FIELD_I_AXIS
+ *** NOTE: Axis is in use by grid LON_FIELD_GRID
+ *** NOTE: Not deleted: XIRREG
+ *** NOTE: Axis is in use by grid GIRREG
+ *** NOTE: Not deleted: TCENTURY
+ *** NOTE: Axis is in use by grid GCENTURY
+ *** NOTE: Not deleted: TAX5DAY
+ *** NOTE: Axis is in use by grid G5DAY
+ *** NOTE: Not deleted: XAX10
+ *** NOTE: Axis is in use by grid G5_10
+ *** NOTE: Not deleted: X5
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y5
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: TIME1
+ *** NOTE: Axis is in use by grid GHB1
+ *** NOTE: Not deleted: TIME2
+ *** NOTE: Axis is in use by grid GCQ1
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: X4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Y4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: Z4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: T4
+ *** NOTE: Axis is in use by grid G4D
+ *** NOTE: Not deleted: XCHANNEL
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: YRISE
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: ZLAYER
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: TIME
+ *** NOTE: Axis is in use by grid GSIGMA
+ *** NOTE: Not deleted: Z1
+ *** NOTE: Axis is in use by grid G1
+ *** NOTE: Not deleted: TCAL
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: XTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: YTROP
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: ZAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: Y1
+ *** NOTE: Axis is in use by grid GSRC
+ *** NOTE: Not deleted: Y2
+ *** NOTE: Axis is in use by grid G10X2
+ *** NOTE: Not deleted: JMONTHS
+ *** NOTE: Axis is in use by grid JGRID
+ *** NOTE: Not deleted: MONTHT
+ *** NOTE: Axis is in use by grid TGRID
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ *** NOTE: Not deleted: YAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: Not deleted: XAXLEVITR1_160
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: TIME4
+ *** NOTE: Axis is in use by grid GXYT
+ *** NOTE: Not deleted: TIME5
+ *** NOTE: Axis is in use by grid GLB1
+ *** NOTE: Not deleted: COADSX
+ *** NOTE: Axis is in use by grid GG
+ *** NOTE: Not deleted: COADSY
+ *** NOTE: Axis is in use by grid GG1
+ *** NOTE: Not deleted: YAXLEVITR1_90
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: ZAXLEVITR1_1
+ *** NOTE: Axis is in use by grid GG2
+ *** NOTE: Not deleted: (AX020)
+ *** NOTE: Axis is in use by grid GG3
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+Re-defining viewport MID2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ls: input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis Z1
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=JAN-1990
+          Axis extremes are T=DEC-1997:JAN-1998
+list/t=1-jan-1990 dummy
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=AUG-1980:JAN-1982
+          Axis extremes are T=AUG-1982:JAN-1983
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid TGRID
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: SOMETHING
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized: ZORRO
+ *** NOTE: They will not be convertible:
+ *** NOTE: Units  not recognized for T axis: METERS
+ *** NOTE: They will not be convertible
+ *** NOTE: Units  not recognized for Y axis: SECONDS
+ *** NOTE: They will not be convertible
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis YFINE
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+Replacing definition of axis TAX
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XQ
+Replacing definition of axis YQ
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TGREG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file revision.nc
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT1).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME4).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+Replacing definition of grid MYGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT1).units
+ *** NOTE: Changing the value of attribute (PSYT1).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).units
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: Changing the value of attribute (TIME7).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIR
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ LISTing to file a.nc
+ *** NOTE: Not deleted: TAX
+ *** NOTE: Axis is in use by grid GFORMAT
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME9
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX047)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+curl error details: 
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   5th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid GG
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis ZAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+Replacing definition of axis TAX
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X1
+Replacing definition of axis Y1
+Replacing definition of grid G1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: TIME13: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file list_of_numbers.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dummy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not deleted: X10
+ *** NOTE: Axis is in use by grid G10X5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid MYGRID
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.nc
+Replacing definition of axis YAX
+ LISTing to file a.nc
+Replacing definition of axis TAXIS
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis TNEW
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAXIS
+Replacing definition of axis TAXIS
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid EVEN
+Replacing definition of grid G1
+Replacing definition of grid G2
+Replacing definition of grid G3
+Replacing definition of grid G4
+Replacing definition of grid G13
+Replacing definition of grid G14
+Replacing definition of grid G23
+Replacing definition of grid G33
+Replacing definition of grid G234
+Replacing definition of grid G134
+Replacing definition of grid G124
+Replacing definition of grid G123
+Replacing definition of grid G1234
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+Replacing definition of grid G48
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid G5DAY
+Replacing definition of axis FAX4DAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TDAY
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ncks: WARNING Overwriting global attribute history
+ncks: WARNING Overwriting global attribute Conventions
+ncks: WARNING Overwriting attribute point_spacing for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute axis for output variable ZAXIS_ORIG
+ncks: WARNING Overwriting attribute standard_name for output variable ZAXIS_ORIG
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file append_to_this.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XIRREG
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis ZAX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+ *** NOTE: Not deleted: ENSEMBLE
+ *** NOTE: Axis is in use by grid (G103)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute a.ival
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             nosuchfile.nc
+SET DAT/FORM=CDF nosuchfile.nc
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for nosuchfile(.nc ,.cdf,.des)
+SET DAT/FORM=CDF nosuchfile
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for snoopy(.nc ,.cdf,.des)
+SET DAT/FORM=CDF snoopy
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./snoopy.dat
+SET DAT/FORM=CDF snoopy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis XAXIS_TEST
+ LISTing to file b.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file nc
+ **TMAP ERR: error in line definition
+             file coords dont match variable coords on axis XAXIS_TEST
+LIST/FORMAT=CDF/clobber/keep/file=nc b,a[d=1]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: must be a 2D region
+          shade b
+shade b
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute v1.long_name
+ *** NOTE: Changing the value of attribute v1.units
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis definition error on axis: MONTH_IRREG. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "MONTH_IRREG_bnds" or bounds do not enclose point on axis MONTH_IRREG
+ *** NOTE: Substituting coordinate midpoints
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unknown region name: @w
+set region/@w
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+          unknown function "writev5d"
+DEFINE VARIABLE/QUIET vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+ **ERROR: variable unknown or not in data set: VFLAG
+LOAD/TEMPORARY vflag
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ *** NOTE: Cannot create new windows when batch mode set
+Ended at Wed Mar 26 15:39:36 PDT 2014
diff --git a/bench/ansley_official.x86_64-linux_log b/bench/ansley_official.x86_64-linux_log
new file mode 100644
index 0000000..984b35c
--- /dev/null
+++ b/bench/ansley_official.x86_64-linux_log
@@ -0,0 +1,80298 @@
+Procedure run_all to run all FERRET benchmarks
+Running FERRET version /home/users/ansley/build/x86/FERRET/fer/ferret_c
+-rwxr-xr-x 1 ansley tmap 53303709 Mar 26 15:36 /home/users/ansley/build/x86/FERRET/fer/ferret_c
+Using external functions from /home/users/ansley/build/x86/FERRET/external_functions/ext_func
+Running the tests of external functions y
+Benchmark run by ansley
+Note: fixing ticket 2161: redefine long_name or units for ascii-file var
+ncdump output will be in all_ncdump.out, and appended to this log file 
+***** Restricting Ferret paths to bench directory *****
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/tmap/ferret/linux/fer_dsets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ansley/build/x86/FERRET/external_functions/ext_func
+FER_GO=. /home/users/tmap/ferret/x86_64-linux/go /home/users/tmap/ferret/x86_64-linux/examples /home/users/tmap/ferret/x86_64-linux/contrib /home/users/tmap/ferret/tmap_go
+FER_GRIDS=.
+FER_LIBS=/home/users/tmap/ferret/x86_64-linux/lib
+FER_LINK_DIR=/home/users/tmap/ferret_link/linux
+FER_PALETTE=. /home/users/tmap/ferret/x86_64-linux/ppl
+PWD=/home/users/ansley/build/x86/FERRET/bench
+Beginning at Wed Mar 26 15:37:53 PDT 2014
+! BN500_ALL.JNL
+! - run all the benchmark tests
+! - ordered (more or less) from least to most complex
+! V2.30: uses BN230_syntax instead of BN200_syntax
+!        added BN230_cdf
+!	 added BN230_regrid_transforms 8/92
+! V3.00: uses BN300_syntax instead of BN230_syntax
+! 	 added bn300_dollar 4/93
+! V3.01: adds bn301_axis_limits and ppl echo ON
+! V3.11: adds bn311_ez_order (/ORDER and /FORMAT=STREAM)
+! V3.12: adds bn312_user (tests SAMPLE and OBJECTIVE)
+! V3.13: for AIX testing: removed mem_mgmt & ignore errors during bn200_output
+! V3.20: to test SAVE/HEADING=enhanced (new BN320_cdf)
+! V4.00: added "*" tests to bnxxx_dollar and added new test bn400_grave
+!    6/95 - added bn401_symbols
+!    7/95 - modified bn*_syntax: bn401_syntax has var1[G=var2[d=dset]]
+!    8/95 - modified bn*_ez: bn401_ez tests FORM=unf
+! V4.20:
+!    9/95 - added test of LET/D and LIST/FORMAT=STREAM
+!	  - slightly modified syntax in bn420_regrid_transforms
+!	  - added bn420_dynamic_grids and bn420_comma_delimited
+!	  - added 2 small additional tests in bn420_grave
+!	  - added a small syntax test in bn420_syntax
+!	  - tested for commas inside args in bn420_dollar
+!	  - tested for enclosing parens in bn420_symbol
+! V4.30:
+!   5/96  - added IF tests
+!   9/96  - added MC data tests *kob*
+! V4.50:
+!   1/97  - eliminated MODE POLISH
+!	    (bn301_expressions.jnl -> bn450_expressions.jnl)
+!   8/97  - bn430_if -> bn450_if: added symbol substitution test
+!10/97*kob*- cancel metafile creation after bn420_syntax and turn it
+!	    on only before bn450_plot (upgraded from bn320_plot)
+!	   - also add test for negative time steps (bn450_negative_t)
+!	   - also add test for cuvilinear stuff
+!          - also added steve's "exact match" regridding
+!11/97 *kob* - added bn450_gc_functions
+! V4.91:
+!    1/98  - corrected bug in this script -- need to cancel viewports after
+!	     bn312_user or the plots which follow come up in a small viewport
+!    2/98 *kob* - moved bn450_curv.jnl up to right after bn450_plot.jnl in
+!		  order to have those metafiles saves as well for checking
+!		  also renamed it to bn491_curv.jnl and added some minor
+!		  cosmetic changes
+!    2/98 *kob* - add in bn491_bug_fixes.jnl
+!    4/98 *sh*  - replaced bn420_dynamic_grids with bn491_... (minor chg)
+! V5.00:
+!   2/99 *sh* -- bn420_regrid_transform ==> bn500_regrid_transform
+!   3/1/99 *kob* - removed bn200_budget from distributable benchmarks
+!   5/99 *kob* - added V50 bench files
+! V5.10:
+!  10/99 *sh* -- added bn_sample.jnl to test SAMPLEI,J,K,L
+!			bn_non_COARDS_netCDF.jnl
+!			bn_cache_hits.jnl, .sub
+!			bn_strides_revs_perms.jnl
+!			bn_regrid_to_user.jnl
+! V5.33:
+! 6/01 *sh* -- added bn_modulo_strides.jnl
+! 6/01 *acm*  -- add	bn_calendar
+!			bn_dash_dot
+!			bn_flowlines
+! 6/08 *kob*  -- add	bn_internal_external_functions
+!
+! V5.40:
+! 9/01 *sh* -- added bn_axis_viewports
+!           -- added bn_strings
+! 10/01 *acm* -- added bn_axcontrol
+!             -- add EOF's and cmprsi_by to bn_internal_external_functions.jnl
+! 11/01 *sh* -- added bn_delimited_read
+!
+! V5.41:
+! 3/02 *acm*-- Add bn540_bug_fixes.jnl
+!
+! V5.50:
+! 11/02 *sh*-- Add bn_subspan_modulo.jnl
+!
+! V5.52
+!  5/03 *acm* add bn_multi_line_labels.jnl, bn552_bug_fixes.jnl,
+!             bn_set_var_scale_off.jnl, bn_longvarnames.jnl, bn_shakey.jnl
+! v5.53
+!  9/03 *kob* added bn_test_nan
+ 
+! v5.81
+!  9/05 *acm* remove bn_curv_shade_mod.jnl which was duplicated by bn_curv_mod.jnl
+ 
+!  V6.00
+!  9/06 *acm* new scripts  bn_tab_comma_multivar.jnl, bn_element_functions.jnl,
+!             bn_long_revision_num.jnl, bn_window_title.jnl, bn_last_error.jnl,
+!             bn_deg_min.jnl, bn_dp_readscale.jnl, bn_bounds_defineax.jnl,
+!              bn_attributes.jnl, n600_bug_fixes.jnl
+!
+! 9/06 *acm* New bn601_bug_fixes for version 6.02
+ 
+! 6/06  *acm* add bn_transforms.jnl -- there was a benchmark testing regridding
+!             transforms but not the others: smoothers, fillers, etc.
+! 1/12  *acm* add bn_variance.jnl -- testing @VAR transform
+ 
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!
+! 11/06 *acm* New bn602_bug_fixes for version 6.02
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V685  *sh* 11/13 - added bn_vtree to test SHOW VAR/TREE
+ 
+! Include this statement to compare the outupt of 6D Ferret with
+! previous 4D benchmark logs.
+! cancel mode 6d_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      metafile.plt
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN ACTIVE
+   1    *
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+cancel mode metafile      !9/97
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dollar hello    ! test command arg
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+ 
+! added in bn400
+GO bn_reset
+cancel mode verify
+GO bn_grave
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  3 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+ 
+! added in bn420
+GO bn_reset
+cancel mode verify
+GO bn_letd
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+ 
+! added in bn430
+GO bn_reset
+cancel mode verify
+GO bn_if
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+ 
+GO bn_reset
+cancel mode verify
+GO bn_geometry
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+set mode ignore		! needed for AIX   11/94
+GO bn_output
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+cancel list/format
+can mode ignore		! needed for AIX
+ 
+GO bn_reset
+cancel mode verify
+GO bn_in_plane
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+ 
+GO bn_reset
+cancel mode verify
+GO bn_compress
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4        6        8     
+              2        3        4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- K:3 Z:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- K:4 Z:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- K:3 Z:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- K:4 Z:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- K:3 Z:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- K:4 Z:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5        7        9     
+              3        4        5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- K:4 Z:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- K:5 Z:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- K:4 Z:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- K:5 Z:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- K:4 Z:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- K:5 Z:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ez		! changed from bn200_ez 8/10/95
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.355000
+ 3   / 3:  0.410000
+ 4   / 4:  0.435000
+ 5   / 5:  0.478000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+               X1      X2
+1   / 1:  0.006000  0.886500
+2   / 2:  0.355000  0.664300
+3   / 3:  0.410000  0.607100
+4   / 4:  0.435000  0.553500
+5   / 5:  0.478000  0.533700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.006000
+ 2    /  2:  0.176000
+ 3    /  3:  0.282000
+ 4    /  4:  0.355000
+ 5    /  5:  0.379000
+ 6    /  6:  0.393000
+ 7    /  7:  0.410000
+ 8    /  8:  0.417000
+ 9    /  9:  0.467000
+ 10   / 10:  0.435000
+ 11   / 11:  0.444000
+ 12   / 12:  0.470000
+ 13   / 13:  0.478000
+ 14   / 14:  0.515000
+ 15   / 15:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.593500
+ 3   / 3:  0.435000
+ 4   / 4:  0.545800
+ 5   / 5:  0.478000
+ 6   / 6:  0.514700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.410000
+ 2   / 2:  0.417000
+ 3   / 3:  0.467000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+ 7   / 7:  0.478000
+ 8   / 8:  0.515000
+ 9   / 9:  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.355000
+ 2   / 2:  0.379000
+ 3   / 3:  0.393000
+ 4   / 4:  0.435000
+ 5   / 5:  0.444000
+ 6   / 6:  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+              1         2         3      
+               1         2         3
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ 3   / 3:  0.410000  0.417000  0.467000
+ 4   / 4:  0.435000  0.444000  0.470000
+ 5   / 5:  0.478000  0.515000  0.469000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+              1         2         3      
+               1         2         3
+ ---- L:1 T:   1
+ 1   / 1:  0.006000  0.176000  0.282000
+ 2   / 2:  0.355000  0.379000  0.393000
+ ---- L:2 T:   2
+ 1   / 1:  0.410000  0.417000  0.467000
+ 2   / 2:  0.435000  0.444000  0.470000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.006000
+ 2   / 2:  0.176000
+ 3   / 3:  0.282000
+ 4   / 4:  0.355000
+ 5   / 5:  0.379000
+ 6   / 6:  0.393000
+ 7   / 7:  0.410000
+ 8   / 8:  0.417000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+! ****
+! remove bn200_budgets for portable benchmarks *kob* 5/99
+! ****
+ 
+! ppl echo on turns on fort.41 to capture ppl commands.
+PPL ECHO ON		! added 10/27/93
+ 
+! 10/97 *kob* now set mode metafile
+set mode metafile bnplot.plt
+GO bn_reset
+cancel mode verify
+GO bn_plot		! upgraded from bn320_plot 10/1/97 *kob*
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+ 
+ 
+!added in bn450 10/97 *kob*
+! moved to right after bn450_plot to capture metafiles *kob* 2/98
+GO bn_reset
+cancel mode verify
+! 2/98 changed bn450_curv to bn491_curv - just some cosmetic changes *kob*
+GO bn_curv
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+ 
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! 8/25/92
+!CANCEL WINDOW/ALL    ! added 7/27/92
+! 10/97 *kob* now cancel mode metafile
+cancel mode metafile
+ 
+GO bn_reset
+cancel mode verify
+GO bn_symbols	! added 6/22/95
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+DELTA_CPU = "5.61515"
+CLOCK_SECS = "7.285"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:38:00"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+DELTA_CPU = "0.001"
+CLOCK_SECS = "7.286"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:38:00"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "4"
+Q23456789012345678901234567890AAAAA = "5"
+Q23456789012345678901234567XXXAAAAA = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LAB1 = "FERRET Ver. 6.861"
+LAB2 = "NOAA/PMEL TMAP"
+LAB3 = "26-MAR-2014 15:38:00"
+LABX = "X"
+LAB4 = "Y : 10"
+LABNUM_Y = "4"
+LAB5 = "Z : 5"
+LABNUM_Z = "5"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "4"
+LABNUM_Z = "5"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "4"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "406"
+PPL$YPIXEL = "406"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "24985"
+DELTA_CPU = "0.012998"
+CLOCK_SECS = "7.299"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:38:00"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_comma_delimited	! added 10/2/95
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6218
+1.167S,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6518,27.4892
+1.167S,27.51,27.3501
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W   ,134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.6218
+25,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.678,27.5239
+25,27.51,27.3501
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+16-SEP-1982 22,27.7751,27.6218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+16-SEP-1982 22,27.6518,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+16-SEP-1982 22,27.678,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+16-SEP-1982 22,27.51,27.3501
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.678
+134.5W,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.6518,27.51
+134.5W,27.4892,27.3501
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S   ,1.167S 
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.7751,27.678
+25,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.6218,27.5239
+25,27.4892,27.3501
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+16-SEP-1982 22,27.7751,27.678
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+16-SEP-1982 22,27.6518,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+16-SEP-1982 22,27.6218,27.5239
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+16-SEP-1982 22,27.4892,27.3501
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.7751,27.6518
+134.5W,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.678,27.51
+134.5W,27.5239,27.3501
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.7751,27.6518
+1.167S,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.6218,27.4892
+1.167S,27.5239,27.3501
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+16-SEP-1982 22,27.7751,27.6518
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+16-SEP-1982 22,27.678,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+16-SEP-1982 22,27.6218,27.4892
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+16-SEP-1982 22,27.5239,27.3501
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346,27.7751
+134.5W,27.2218,27.6218
+ ---- K:3 Z:   25
+135.5W,27.2481,27.6518
+134.5W,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382,27.678
+134.5W,27.1246,27.5239
+ ---- K:3 Z:   25
+135.5W,27.1293,27.51
+134.5W,27.011,27.3501
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346,27.7751
+1.167S,27.2382,27.678
+ ---- K:3 Z:   25
+1.5S,27.2481,27.6518
+1.167S,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218,27.6218
+1.167S,27.1246,27.5239
+ ---- K:3 Z:   25
+1.5S,27.1248,27.4892
+1.167S,27.011,27.3501
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- I:96 X:   134.5W
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+15,27.1246,27.5239
+25,27.011,27.3501
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346,27.7751
+25,27.2481,27.6518
+ ---- J:42 Y:   1.167S
+15,27.2382,27.678
+25,27.1293,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218,27.6218
+25,27.1248,27.4892
+ ---- J:42 Y:   1.167S
+15,27.1246,27.5239
+25,27.011,27.3501
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2481,27.1248
+1.167S,27.1293,27.011
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+25,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+25,27.1293,27.011
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1293,27.011
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2481,27.1293
+134.5W,27.1248,27.011
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+25,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+25,27.1248,27.011
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.2481,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.1248,27.011
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346,27.2481
+134.5W,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382,27.1293
+134.5W,27.1246,27.011
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346,27.2481
+1.167S,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218,27.1248
+1.167S,27.1246,27.011
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2481
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2481
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218,27.1248
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246,27.011
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- K:3 Z:   25
+135.5W,27.2481
+134.5W,27.1248
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+ ---- K:3 Z:   25
+135.5W,27.1293
+134.5W,27.011
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- K:3 Z:   25
+1.5S,27.2481
+1.167S,27.1293
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+ ---- K:3 Z:   25
+1.5S,27.1248
+1.167S,27.011
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+25,27.2481
+ ---- I:96 X:   134.5W
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+15,27.1246
+25,27.011
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+25,27.2481
+ ---- J:42 Y:   1.167S
+15,27.2382
+25,27.1293
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+25,27.1248
+ ---- J:42 Y:   1.167S
+15,27.1246
+25,27.011
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W   ,134.5W   
+1.5S,27.3346,27.2218
+1.167S,27.2382,27.1246
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+15,27.2382,27.1246
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2382,27.1246
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2382,27.1246
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S   ,1.167S 
+135.5W,27.3346,27.2382
+134.5W,27.2218,27.1246
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+15,27.2218,27.1246
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.2218,27.1246
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.3346,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.2218,27.1246
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.3346
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.1246
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.3346
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.2218
+ ---- J:42 Y:   1.167S
+10-SEP-1982 20,27.1246
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.3346
+134.5W,27.2218
+ ---- J:42 Y:   1.167S
+ ---- K:2 Z:   15
+135.5W,27.2382
+134.5W,27.1246
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.3346
+1.167S,27.2382
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.2218
+1.167S,27.1246
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.3346
+ ---- I:96 X:   134.5W
+15,27.2218
+ ---- J:42 Y:   1.167S
+ ---- I:95 X:   135.5W
+15,27.2382
+ ---- I:96 X:   134.5W
+15,27.1246
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.3346
+ ---- J:42 Y:   1.167S
+15,27.2382
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.2218
+ ---- J:42 Y:   1.167S
+15,27.1246
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W   ,134.5W   
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.167S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S   ,1.167S 
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.167S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S   ,1.167S 
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+1.5S,27.335
+1.167S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W   
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W   	134.5W   
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.3346	27.2218
+1.167S	27.2382	27.1246
+ ---- K:3 Z:   25
+1.5S	27.2481	27.1248
+1.167S	27.1293	27.011
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.7751	27.6218
+1.167S	27.678	27.5239
+ ---- K:3 Z:   25
+1.5S	27.6518	27.4892
+1.167S	27.51	27.3501
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,2.E+08,2.E+08
+1.167S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,1.6675084E+08,2.0208841E+08
+1.167S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.000002,0.000002
+1.167S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W   ,134.5W   
+1.5S,0.00000166750845,0.00000202088412
+1.167S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.833S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.333S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1     ,2     ,3     ,4     ,5     
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dynamic_grids	! added 9/27/95, V420 ->V491 4/98
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.67N / 50:  24.6561  24.4277  24.3118  24.3162  24.5191
+ 1.33N / 49:  24.4396  24.2439  24.1355  24.1369  24.3131
+ 1N    / 48:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.67N / 47:  24.0904  23.9463  23.8383  23.7928  23.8749
+ 0.33N / 46:  23.9899  23.8698  23.7654  23.6951  23.7076
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  24.5431  24.3351  24.2254  24.2312  24.4219
+ 1.17N / 49:  24.3362  24.1527  24.0455  24.0427  24.2042
+ 0.83N / 48:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.5N  / 47:  24.0242  23.8934  23.7879  23.7273  23.7728
+ 0.17N / 46:  23.9556  23.8461  23.7430  23.6629  23.6425
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  24.4391  24.2803  24.2283  24.3266  24.6189
+ 1.17N / 49:  24.2444  24.0991  24.0441  24.1235  24.3692
+ 0.83N / 48:  24.0779  23.9440  23.8736  23.9176  24.1125
+ 0.5N  / 47:  23.9588  23.8406  23.7576  23.7500  23.8696
+ 0.17N / 46:  23.9009  23.7946  23.7029  23.6527  23.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G003)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     128W     127W     126W     125W    
+               101      102      103      104      105
+ 1.5N  / 50:  29.4391  29.2803  29.2283  29.3266  29.6189
+ 1.17N / 49:  29.2444  29.0991  29.0441  29.1235  29.3692
+ 0.83N / 48:  29.0779  28.9440  28.8736  28.9176  29.1125
+ 0.5N  / 47:  28.9588  28.8406  28.7576  28.7500  28.8696
+ 0.17N / 46:  28.9009  28.7946  28.7029  28.6527  28.6934
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+                179.5W    178.5W    177.5W    176.5W    175.5W  
+                 51        52        53        54        55
+ 1.83N / 51: -0.627987 -0.652220 -0.659763 -0.663230 -0.662623
+ 1.5N  / 50: -0.631590 -0.653915 -0.653717 -0.650547 -0.644405
+ 1.17N / 49: -0.635168 -0.655610 -0.647673 -0.637865 -0.626188
+ 0.83N / 48: -0.627037 -0.647150 -0.637065 -0.626707 -0.616078
+ 0.5N  / 47: -0.607180 -0.628495 -0.621847 -0.617047 -0.614073
+ 0.17N / 46: -0.587298 -0.609840 -0.606630 -0.607388 -0.612068
+ 0.17S / 45: -0.567438 -0.591208 -0.591415 -0.597708 -0.610065
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 2N    / 51:  27.5799  27.5356  27.4992  27.4507  27.3693  27.2712
+ 1.67N / 50:  27.6149  27.5639  27.5186  27.4671  27.3903  27.2903
+ 1.33N / 49:  27.6580  27.6003  27.5494  27.4926  27.4148  27.3150
+ 1N    / 48:  27.7046  27.6371  27.5806  27.5195  27.4400  27.3410
+ 0.67N / 47:  27.7530  27.6753  27.6127  27.5468  27.4642  27.3648
+ 0.33N / 46:  27.8004  27.7159  27.6494  27.5789  27.4919  27.3900
+ 0     / 45:  27.8480  27.7622  27.6962  27.6232  27.5320  27.4267
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 (interpolated)
+             TIME     : 15-JAN-1982 14:00
+                180E    179W     178W     177W     176W     175W    
+                50       51       52       53       54       55
+ 1.83N / 51:  27.5946  27.5458  27.5038  27.4555  27.3787  27.2791
+ 1.5N  / 50:  27.6353  27.5819  27.5333  27.4787  27.4018  27.3015
+ 1.17N / 49:  27.6807  27.6187  27.5654  27.5064  27.4279  27.3285
+ 0.83N / 48:  27.7285  27.6555  27.5958  27.5327  27.4522  27.3536
+ 0.5N  / 47:  27.7775  27.6952  27.6296  27.5610  27.4762  27.3760
+ 0.17N / 46:  27.8234  27.7366  27.6691  27.5969  27.5077  27.4040
+ 0.17S / 45:  27.8727  27.7878  27.7232  27.6494  27.5563  27.4494
+show grid/dynamic
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                  A      A
+130.5E / 1:  130.500  130.500
+131.5E / 2:  131.500  131.500
+132.5E / 3:  132.500  132.500
+133.5E / 4:  133.500  133.500
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 6   / 6:  6.00000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.000
+ 134E   / 4:  134.000
+ 135E   / 5:  135.000
+ 136E   / 6:  136.000
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.500
+ 133.5E / 4:  133.500
+ 134.5E / 5:  134.500
+ 135.5E / 6:  135.500
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX003)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.10000
+ 0.2  /  2:  0.20000
+ 0.3  /  3:  0.30000
+ 0.4  /  4:  0.40000
+ 0.5  /  5:  0.50000
+ 0.6  /  6:  0.60000
+ 0.7  /  7:  0.70000
+ 0.8  /  8:  0.80000
+ 0.9  /  9:  0.90000
+ 1    / 10:  1.00000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.000
+ 132.5E / 2:  132.500
+ 135E   / 3:  135.000
+ 137.5E / 4:  137.500
+ 140E   / 5:  140.000
+ 142.5E / 6:  142.500
+ 145E   / 7:  145.000
+ 147.5E / 8:  147.500
+ 150E   / 9:  150.000
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 101   /  1:  101.100  102.600  104.100  105.600  107.100  108.600  110.100
+ 102   /  2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 103   /  3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 104   /  4:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 105   /  5:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+ 106   /  6:  106.100  107.600  109.100  110.600  112.100  113.600  115.100
+ 107   /  7:  107.100  108.600  110.100  111.600  113.100  114.600  116.100
+ 108   /  8:  108.100  109.600  111.100  112.600  114.100  115.600  117.100
+ 109   /  9:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+ 110   / 10:  110.100  111.600  113.100  114.600  116.100  117.600  119.100
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                 0.1      4.6      9.1   
+                 1        2        3
+ 101   /  1:  101.100  105.600  110.100
+ 102   /  2:  102.100  106.600  111.100
+ 103   /  3:  103.100  107.600  112.100
+ 104   /  4:  104.100  108.600  113.100
+ 105   /  5:  105.100  109.600  114.100
+ 106   /  6:  106.100  110.600  115.100
+ 107   /  7:  107.100  111.600  116.100
+ 108   /  8:  108.100  112.600  117.100
+ 109   /  9:  109.100  113.600  118.100
+ 110   / 10:  110.100  114.600  119.100
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                 0.1      7.6   
+                 1        2
+ 101   /  1:  101.100  108.600
+ 102   /  2:  102.100  109.600
+ 103   /  3:  103.100  110.600
+ 104   /  4:  104.100  111.600
+ 105   /  5:  105.100  112.600
+ 106   /  6:  106.100  113.600
+ 107   /  7:  107.100  114.600
+ 108   /  8:  108.100  115.600
+ 109   /  9:  109.100  116.600
+ 110   / 10:  110.100  117.600
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                 0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                 1        2        3        4        5        6        7
+ 102    / 1:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 102.5  / 2:  102.600  104.100  105.600  107.100  108.600  110.100  111.600
+ 103    / 3:  103.100  104.600  106.100  107.600  109.100  110.600  112.100
+ 103.5  / 4:  103.600  105.100  106.600  108.100  109.600  111.100  112.600
+ 104    / 5:  104.100  105.600  107.100  108.600  110.100  111.600  113.100
+ 104.5  / 6:  104.600  106.100  107.600  109.100  110.600  112.100  113.600
+ 105    / 7:  105.100  106.600  108.100  109.600  111.100  112.600  114.100
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+                0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+                1        2        3        4        5        6        7
+ 95    / 1:     ....     ....     ....     ....     ....     ....     ....
+ 102   / 2:  102.100  103.600  105.100  106.600  108.100  109.600  111.100
+ 109   / 3:  109.100  110.600  112.100  113.600  115.100  116.600  118.100
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX004)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    7 r   0.1                  9.1
+ (AX003)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX003)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+             0.1      1.6      3.1      4.6      6.1      7.6      9.1   
+             1        2        3        4        5        6        7
+           1.2000   4.2000   7.2000  10.2000  13.2000  16.2000  19.2000
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ (AX004)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.00
+ 121    /  2:   220.00
+ 441    /  3:   420.00
+ 961    /  4:   620.00
+ 1681   /  5:   820.00
+ 2601   /  6:  1020.00
+ 3721   /  7:  1220.00
+ 5041   /  8:  1420.00
+ 6561   /  9:  1620.00
+ 8281   / 10:  1720.00
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.500
+ 131.5E /  2:  131.500
+ 132.5E /  3:  132.500
+ 133.5E /  4:  133.500
+ 134.5E /  5:  134.500
+ 135.5E /  6:  135.500
+ 136.5E /  7:  136.500
+ 137.5E /  8:  137.500
+ 138.5E /  9:  138.500
+ 139.5E / 10:  139.500
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX003)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.000
+ 147.5W / 2:  212.500
+ 145W   / 3:  215.000
+ 142.5W / 4:  217.500
+ 140W   / 5:  220.000
+ 137.5W / 6:  222.500
+ 135W   / 7:  225.000
+ 132.5W / 8:  227.500
+ 130W   / 9:  230.000
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ 1.5N  / 50:  255.043  255.835  256.725  257.731  258.922
+ 1.17N / 49:  254.836  255.653  256.546  257.543  258.704
+ 0.83N / 48:  254.657  255.499  256.389  257.358  258.477
+ 0.5N  / 47:  254.524  255.393  256.288  257.227  258.273
+ 0.17N / 46:  254.456  255.346  256.243  257.163  258.142
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  125.543  129.422  134.545  137.119  141.562
+ 1.17N / 49:  125.336  129.204  134.163  136.896  141.270
+ 0.83N / 48:  125.157  128.977  133.703  136.690  140.960
+ 0.5N  / 47:  125.024  128.773  133.295  136.512  140.644
+ 0.17N / 46:  124.956  128.642  132.987  136.380  140.376
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129.5W   125.5W   121.5W   117.5W   113.5W  
+                 1        2        3        4        5
+ 1.5N  / 50:  255.043  258.922  264.045  266.619  271.062
+ 1.17N / 49:  254.836  258.704  263.663  266.396  270.770
+ 0.83N / 48:  254.657  258.477  263.203  266.190  270.460
+ 0.5N  / 47:  254.524  258.273  262.795  266.012  270.144
+ 0.17N / 46:  254.456  258.142  262.487  265.880  269.876
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX004)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               168.5E   170.5E   172.5E   174.5E   176.5E   178.5E  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  29.2186  29.1820  28.9284  28.6727  28.1158  27.7262
+ 1.17N / 49:  29.2537  29.1794  28.9683  28.7060  28.2175  27.8045
+ 0.83N / 48:  29.2747  29.1817  28.9842  28.7218  28.2984  27.8834
+ 0.5N  / 47:  29.3025  29.1943  28.9819  28.7306  28.3551  27.9545
+ 0.17N / 46:  29.3441  29.2219  28.9889  28.7493  28.3962  28.0105
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               108.5W   106.5W   104.5W   102.5W   100.5W   98.5W   
+                 1        2        3        4        5        6
+ 1.5N  / 50:  25.4248  25.2404  25.0453  25.2349  25.4898  25.8063
+ 1.17N / 49:  25.0178  24.8787  24.7362  24.9070  25.2015  25.5514
+ 0.83N / 48:  24.6455  24.5412  24.4230  24.5627  24.8753  25.2469
+ 0.5N  / 47:  24.2823  24.1999  24.1010  24.2162  24.5241  24.8980
+ 0.17N / 46:  23.9664  23.8958  23.8185  23.9163  24.1945  24.5649
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX004)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX004)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.8629  24.3351  24.2312  24.8158  25.6044  25.2192
+ 1.17N / 49:  24.5966  24.1527  24.0427  24.5341  25.2208  24.8153
+ 0.83N / 48:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.5N  / 47:  24.1928  23.8934  23.7273  23.9665  24.3603  24.0696
+ 0.17N / 46:  24.0902  23.8461  23.6629  23.7442  24.0341  23.8270
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4N   / 4:  26.0703  25.7627  25.4253  25.1684  25.1772
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 0.5S / 1:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.000
+ 170E   / 2:  170.000
+ 150W   / 3:  210.000
+ 110W   / 4:  250.000
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.0000
+ 2S    / 2:  -2.0000
+ 10S   / 1: -10.0000
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.0000
+ 30   / 2:  30.0000
+ 60   / 3:  60.0000
+ 90   / 4:  90.0000
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.00000
+ 6    / 2:  2.00000
+ 11   / 3:  3.00000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 2.8N / 4:  25.8760  25.1016  24.7591  25.3616  25.9523  26.1052
+ 1.8N / 3:  25.1492  24.5204  24.4013  25.0592  25.8372  25.5690
+ 0.8N / 2:  24.3667  23.9991  23.8583  24.2480  24.7736  24.4029
+ 0.2S / 1:  24.0844  23.8819  23.6864  23.6291  23.8094  23.6664
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130.5W   128.5W   126.5W   124.5W   122.5W   120.5W  
+               1        2        3        4        5        6
+ 4N   / 4:  26.3100  25.7627  25.1684  25.4169  26.0928  26.4324
+ 2.5N / 3:  25.6892  24.9014  24.6646  25.3345  25.9631  26.0034
+ 1N   / 2:  24.4816  24.0759  23.9505  24.3911  24.9972  24.6091
+ 0.5S / 1:  24.1489  23.9855  23.7919  23.6520  23.7144  23.6009
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 2.8N / 4:  25.6905  24.7917  25.5507  26.0875
+ 1.8N / 3:  24.9592  24.3997  25.3139  25.6838
+ 0.8N / 2:  24.2617  23.8736  24.4085  24.5531
+ 0.2S / 1:  24.0313  23.7330  23.6749  23.7233
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             130W     127W     124W     121W    
+               1        2        3        4
+ 4N   / 4:  26.1901  25.2969  25.5832  26.3921
+ 2.5N / 3:  25.4818  24.6784  25.5471  26.0151
+ 1N   / 2:  24.3640  23.9588  24.5740  24.7711
+ 0.5S / 1:  24.1087  23.8399  23.6597  23.6433
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX003)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   138.5W   136.5W   134.5W   132.5W   130.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:  24.9330  24.4927  25.4749  25.9529  25.6235  24.8629
+ 1.17N / 49:  24.8195  24.3658  25.1683  25.8306  25.3698  24.5966
+ 0.83N / 48:  24.6946  24.2521  24.7974  25.6708  25.1391  24.3667
+ 0.5N  / 47:  24.5726  24.1661  24.4685  25.4813  24.9214  24.1928
+ 0.17N / 46:  24.4684  24.1208  24.2760  25.1658  24.7013  24.0902
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W  
+                 1        2        3
+ 1.5N  / 50:  24.9330  25.4749  25.6235
+ 1.17N / 49:  24.8195  25.1683  25.3698
+ 0.83N / 48:  24.6946  24.7974  25.1391
+ 0.5N  / 47:  24.5726  24.4685  24.9214
+ 0.17N / 46:  24.4684  24.2760  24.7013
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               140.5W   136.5W   132.5W   128.5W  
+                 1        2        3        4
+ 1.5N  / 50:  24.9330  25.4749  25.6235  24.3351
+ 1.17N / 49:  24.8195  25.1683  25.3698  24.1527
+ 0.83N / 48:  24.6946  24.7974  25.1391  23.9991
+ 0.5N  / 47:  24.5726  24.4685  24.9214  23.8934
+ 0.17N / 46:  24.4684  24.2760  24.7013  23.8461
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               134.5W   132.5W   130.5W   128.5W   126.5W   124.5W  
+                 4        5        6        7        8        9
+ 1.5N  / 50:  25.9529  25.6235  24.8629  24.3351  24.2312  24.8158
+ 1.17N / 49:  25.8306  25.3698  24.5966  24.1527  24.0427  24.5341
+ 0.83N / 48:  25.6708  25.1391  24.3667  23.9991  23.8583  24.2480
+ 0.5N  / 47:  25.4813  24.9214  24.1928  23.8934  23.7273  23.9665
+ 0.17N / 46:  25.1658  24.7013  24.0902  23.8461  23.6629  23.7442
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               135W     132W     129W     126W    
+                 1        2        3        4
+ 1.5N  / 50:  25.8334  25.4333  24.4671  24.3773
+ 1.17N / 49:  25.6650  25.1765  24.2637  24.1656
+ 0.83N / 48:  25.4524  24.9460  24.0910  23.9557
+ 0.5N  / 47:  25.2281  24.7393  23.9683  23.7871
+ 0.17N / 46:  24.9433  24.5486  23.9072  23.6832
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     127W     124W     121W    
+                 1        2        3        4
+ 1.5N  / 50:  24.7030  24.2283  25.0596  25.3824
+ 1.17N / 49:  24.4664  24.0441  24.7395  24.9891
+ 0.83N / 48:  24.2617  23.8736  24.4085  24.5531
+ 0.5N  / 47:  24.1085  23.7576  24.0884  24.1823
+ 0.17N / 46:  24.0229  23.7029  23.8301  23.9069
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               130W     124W    
+                 1        2
+ 1.5N  / 50:  24.7030  25.0596
+ 1.17N / 49:  24.4664  24.7395
+ 0.83N / 48:  24.2617  24.4085
+ 0.5N  / 47:  24.1085  24.0884
+ 0.17N / 46:  24.0229  23.8301
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               129W     127W     125W     123W     121W    
+                 1        2        3        4        5
+ 1.5N  / 50:  24.5447  24.2283  24.7825  25.1672  25.3824
+ 1.17N / 49:  24.3256  24.0441  24.5077  24.8227  24.9891
+ 0.83N / 48:  24.1323  23.8736  24.2302  24.4567  24.5531
+ 0.5N  / 47:  23.9915  23.7576  23.9781  24.1197  24.1823
+ 0.17N / 46:  23.9163  23.7029  23.7877  23.8557  23.9069
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               138W     133W     128W     123W     118W     113W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....  24.3865  25.1672     ....     ....
+ 1.17N / 49:     ....     ....  24.1849  24.8227     ....     ....
+ 0.83N / 48:     ....     ....  24.0029  24.4567     ....     ....
+ 0.5N  / 47:     ....     ....  23.8746  24.1197     ....     ....
+ 0.17N / 46:     ....     ....  23.8096  23.8557     ....     ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 4.8N / 6:  26.3655  26.1878  26.0268  25.9290  25.9885
+ 3.8N / 5:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 2.8N / 4:  25.5051  25.1016  24.8243  24.7591  24.9401
+ 1.8N / 3:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.8N / 2:  24.1567  23.9991  23.8888  23.8583  23.9770
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 5.8N / 4:  26.6294  26.5670  26.5361  26.5638  26.6554
+ 3.8N / 3:  26.0047  25.6791  25.3175  25.0630  25.0886
+ 1.8N / 2:  24.7692  24.5204  24.3981  24.4013  24.6163
+ 0.2S / 1:  23.9783  23.8819  23.7796  23.6864  23.6174
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:  26.4095  26.2510  26.1116  26.0348  26.0997
+ 3N   / 3:  25.5883  25.1978  24.9065  24.8097  24.9649
+ 1N   / 2:  24.2587  24.0860  23.9737  23.9488  24.0835
+ 1S   / 1:     ....     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 2.5N / 3:  25.2743  24.9014  24.6921  24.6646  24.8801
+ 0.5S / 2:  24.0685  23.9855  23.8878  23.7919  23.7022
+ 3.5S / 1:  25.1885  25.1493  25.0939  25.0408  25.0261
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+             129.5W   128.5W   127.5W   126.5W   125.5W  
+             101      102      103      104      105
+ 7N   / 5:     ....     ....     ....     ....     ....
+ 5N   / 4:     ....     ....     ....     ....     ....
+ 3N   / 3:  25.5396  25.1885  24.9365  24.8326  24.9791
+ 1N   / 2:  24.2464  24.0759  23.9672  23.9505  24.0906
+ 1S   / 1:  24.2763  24.2177  24.1436  24.0651  23.9786
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W    63.5W    61.5W  
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966  29.4136  29.5107
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191  29.4462  29.5279
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689  29.4873  29.5544
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330  29.5361  29.5888
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966  29.5858  29.6187
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX002)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W  
+                 1        2        3
+ 1.5N  / 50:     ....     ....  29.5035
+ 1.17N / 49:     ....     ....  29.5373
+ 0.83N / 48:     ....     ....  29.6002
+ 0.5N  / 47:     ....     ....  29.6787
+ 0.17N / 46:     ....     ....  29.7929
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    71.5W    67.5W    63.5W  
+                 1        2        3        4
+ 1.5N  / 50:     ....     ....  29.5035  29.4136
+ 1.17N / 49:     ....     ....  29.5373  29.4462
+ 0.83N / 48:     ....     ....  29.6002  29.4873
+ 0.5N  / 47:     ....     ....  29.6787  29.5361
+ 0.17N / 46:     ....     ....  29.7929  29.5858
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                75.5W    73.5W    71.5W    69.5W    67.5W    65.5W  
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....     ....     ....     ....  29.5035  29.3966
+ 1.17N / 49:     ....     ....     ....     ....  29.5373  29.4191
+ 0.83N / 48:     ....     ....     ....     ....  29.6002  29.4689
+ 0.5N  / 47:     ....     ....     ....     ....  29.6787  29.5330
+ 0.17N / 46:     ....     ....     ....     ....  29.7929  29.5966
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                85W      80W      75W      70W      65W      60W      55W      50W      45W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....     ....     ....  29.4009     ....     ....     ....     ....
+ 1.17N / 49:     ....     ....     ....     ....  29.4259     ....     ....     ....     ....
+ 0.83N / 48:     ....     ....     ....     ....  29.4735     ....     ....     ....     ....
+ 0.5N  / 47:     ....     ....     ....     ....  29.5338     ....     ....     ....     ....
+ 0.17N / 46:     ....     ....     ....     ....  29.5939     ....     ....     ....     ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W      66W      62W    
+                 1        2        3        4        5        6        7        8
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....  29.3528  29.4885
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....  29.3882  29.5084
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....  29.4644  29.5380
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....  29.5482  29.5745
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....  29.6283  29.6082
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      86W      82W      78W      74W      70W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:  27.2194  27.5576  27.9470     ....     ....     ....
+ 1.17N / 49:  27.1122  27.4131  27.8883     ....     ....     ....
+ 0.83N / 48:  26.9645  27.2528  27.7639     ....     ....     ....
+ 0.5N  / 47:  26.7776  27.0851  27.5584     ....     ....     ....
+ 0.17N / 46:  26.5410  26.8980  27.2770     ....     ....     ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W    
+                 1        2        3
+ 1.5N  / 50:  27.2194  27.9470     ....
+ 1.17N / 49:  27.1122  27.8883     ....
+ 0.83N / 48:  26.9645  27.7639     ....
+ 0.5N  / 47:  26.7776  27.5584     ....
+ 0.17N / 46:  26.5410  27.2770     ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                90W      82W      74W      66W    
+                 1        2        3        4
+ 1.5N  / 50:  27.2194  27.9470     ....  29.3528
+ 1.17N / 49:  27.1122  27.8883     ....  29.3882
+ 0.83N / 48:  26.9645  27.7639     ....  29.4644
+ 0.5N  / 47:  26.7776  27.5584     ....  29.5482
+ 0.17N / 46:  26.5410  27.2770     ....  29.6283
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+                92W      89W      86W      83W      80W      77W    
+                 1        2        3        4        5        6
+ 1.5N  / 50:     ....  27.3039  27.5576  27.8497     ....     ....
+ 1.17N / 49:     ....  27.1874  27.4131  27.7695     ....     ....
+ 0.83N / 48:     ....  27.0366  27.2528  27.6362     ....     ....
+ 0.5N  / 47:     ....  26.8545  27.0851  27.4401     ....     ....
+ 0.17N / 46:     ....  26.6303  26.8980  27.1822     ....     ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               101W      95W      89W      83W      77W      71W      65W      59W      53W    
+                 1        2        3        4        5        6        7        8        9
+ 1.5N  / 50:     ....     ....  27.3039  27.8497     ....     ....  29.3867     ....     ....
+ 1.17N / 49:     ....     ....  27.1874  27.7695     ....     ....  29.4183     ....     ....
+ 0.83N / 48:     ....     ....  27.0366  27.6362     ....     ....  29.4828     ....     ....
+ 0.5N  / 47:     ....     ....  26.8545  27.4401     ....     ....  29.5548     ....     ....
+ 0.17N / 46:     ....     ....  26.6303  27.1822     ....     ....  29.6233     ....     ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+ 15-JAN-1982 00 / 1:  27.7767
+ 21-JAN-1982 00 / 2:  27.7818
+ 27-JAN-1982 00 / 3:  27.6992
+ 02-FEB-1982 00 / 4:  27.8253
+ 08-FEB-1982 00 / 5:  27.7319
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.7767
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX004)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G007_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+         FCN_NOR   FCN_REV
+J /  1:  0.633194 -0.633194
+J /  2:  0.645479 -0.645479
+J /  3:  0.499729 -0.499729
+J /  4:  0.231628 -0.231628
+J /  5: -0.093184  0.093184
+J /  6: -0.395181  0.395181
+J /  7: -0.600424  0.600424
+J /  8: -0.658663  0.658663
+J /  9: -0.555637  0.555637
+J / 10: -0.316573  0.316573
+J / 11:  0.000000  0.000000
+J / 12:  0.316573 -0.316573
+J / 13:  0.555637 -0.555637
+J / 14:  0.658663 -0.658663
+J / 15:  0.600424 -0.600424
+J / 16:  0.395181 -0.395181
+J / 17:  0.093184 -0.093184
+J / 18: -0.231628  0.231628
+J / 19: -0.499729  0.499729
+J / 20: -0.645479  0.645479
+J / 21: -0.633194  0.633194
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+               180E    
+                51
+ 8N   / 19:  0.499729
+ 7N   / 18:  0.231628
+ 6N   / 17: -0.093184
+ 5N   / 16: -0.395181
+ 4N   / 15: -0.600424
+ 3N   / 14: -0.658663
+ 2N   / 13: -0.555637
+ 1N   / 12: -0.316573
+ 0    / 11:  0.000000
+ 1S   / 10:  0.316573
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 57 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=@ave]   ! no target grid specified
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 55 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,g=w]   ! more than 1 target grid
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M: 45 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 43 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 39 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 36 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 33 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 31 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 28 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ reading TEMP     M: 22 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M: 16 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 16 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 10 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  7 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  7 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 27 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M: 27 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M: 27 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 49 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6373  25.0615  25.4410
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8705  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6495
+ 1N    / 48:  24.1494  24.2321  24.4464  24.8164  25.1767  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6691  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 18 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 48 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 48 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 40 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  6 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:  6 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 37 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 32 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2012  24.2556  24.4066  24.7485  25.2133  25.5037
+ 1N    / 48:  24.0581  24.0827  24.1835  24.4473  24.8567  25.1333
+ 0.67N / 47:  23.9772  23.9643  23.9994  24.1601  24.4838  24.7472
+ 0.33N / 46:  23.9584  23.9040  23.8788  23.9333  24.1419  24.3790
+ 0     / 45:  24.0357  23.9390  23.8536  23.8172  23.9069  24.0855
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9325  23.9890  24.1393  24.4928  25.0067  25.3582
+ 1N    / 48:  23.7314  23.7626  23.8716  24.1488  24.6053  24.9421
+ 0.67N / 47:  23.5951  23.5875  23.6312  23.8060  24.1706  24.4921
+ 0.33N / 46:  23.5385  23.4834  23.4619  23.5233  23.7598  24.0491
+ 0     / 45:  23.6210  23.5135  23.4199  23.3768  23.4767  23.6893
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  1 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2921  24.2593  24.2798  24.4459  24.8288  25.2942
+ 1N    / 48:  24.1296  24.0952  24.0995  24.2165  24.5387  24.9629
+ 0.67N / 47:  24.0124  23.9735  23.9541  24.0061  24.2416  24.6067
+ 0.33N / 46:  23.9590  23.9098  23.8662  23.8516  23.9772  24.2614
+ 0     / 45:  23.9901  23.9230  23.8503  23.7816  23.8003  23.9828
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0517  24.0117  24.0305  24.1957  24.5888  25.1042
+ 1N    / 48:  23.8384  23.7998  23.8085  23.9326  24.2677  24.7399
+ 0.67N / 47:  23.6606  23.6190  23.6065  23.6697  23.9240  24.3347
+ 0.33N / 46:  23.5549  23.5048  23.4677  23.4600  23.6025  23.9282
+ 0     / 45:  23.5662  23.4962  23.4251  23.3553  23.3775  23.5902
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2879  24.3481  24.5174  24.8892  25.3674  25.6544
+ 1N    / 48:  24.1297  24.1691  24.2950  24.5979  25.0350  25.3185
+ 0.67N / 47:  24.0177  24.0235  24.0914  24.3037  24.6703  24.9403
+ 0.33N / 46:  23.9678  23.9342  23.9391  24.0467  24.3128  24.5631
+ 0     / 45:  23.9971  23.9215  23.8662  23.8753  24.0244  24.2322
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0365  24.0951  24.2619  24.6460  25.1734  25.5187
+ 1N    / 48:  23.8319  23.8758  24.0055  24.3208  24.8060  25.1502
+ 0.67N / 47:  23.6632  23.6751  23.7514  23.9774  24.3880  24.7171
+ 0.33N / 46:  23.5668  23.5355  23.5465  23.6647  23.9652  24.2706
+ 0     / 45:  23.5798  23.4985  23.4409  23.4500  23.6182  23.8692
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 52 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 56 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.1864  24.1787  24.2594  24.5105  24.9134  25.2830
+ 1N    / 48:  24.0384  24.0160  24.0566  24.2448  24.5882  24.9167
+ 0.67N / 47:  23.9476  23.9116  23.9036  24.0029  24.2600  24.5428
+ 0.33N / 46:  23.9212  23.8644  23.8142  23.8259  23.9786  24.2058
+ 0     / 45:  23.9919  23.9089  23.8177  23.7561  23.8046  23.9579
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9233  23.9145  23.9973  24.2541  24.6864  25.1105
+ 1N    / 48:  23.7149  23.6938  23.7438  23.9462  24.3212  24.7033
+ 0.67N / 47:  23.5646  23.5317  23.5324  23.6475  23.9375  24.2709
+ 0.33N / 46:  23.4951  23.4409  23.3953  23.4150  23.5931  23.8658
+ 0     / 45:  23.5673  23.4804  23.3851  23.3179  23.3746  23.5590
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2284  24.3311  24.5775  24.9809  25.3585  25.4979
+ 1N    / 48:  24.0704  24.1331  24.3154  24.6520  24.9950  25.1205
+ 0.67N / 47:  23.9708  23.9819  24.0798  24.3220  24.6155  24.7426
+ 0.33N / 46:  23.9312  23.8914  23.9061  24.0376  24.2605  24.3979
+ 0     / 45:  23.9874  23.8963  23.8354  23.8620  23.9962  24.1237
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9608  24.0642  24.3160  24.7497  25.1824  25.3725
+ 1N    / 48:  23.7470  23.8171  24.0102  24.3770  24.7737  24.9496
+ 0.67N / 47:  23.5913  23.6093  23.7186  23.9883  24.3314  24.5067
+ 0.33N / 46:  23.5110  23.4726  23.4926  23.6415  23.9044  24.0873
+ 0     / 45:  23.5673  23.4667  23.3983  23.4267  23.5830  23.7431
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 20 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M: 44 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3180  24.4327  24.7033  25.1283  25.5109  25.6496
+ 1N    / 48:  24.1494  24.2321  24.4465  24.8165  25.1768  25.3092
+ 0.67N / 47:  24.0206  24.0575  24.1976  24.4870  24.8053  24.9316
+ 0.33N / 46:  23.9510  23.9366  23.9929  24.1798  24.4380  24.5703
+ 0     / 45:  23.9593  23.8939  23.8707  23.9498  24.1283  24.2608
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0658  24.1785  24.4540  24.9097  25.3460  25.5339
+ 1N    / 48:  23.8539  23.9406  24.1631  24.5634  24.9781  25.1610
+ 0.67N / 47:  23.6692  23.7132  23.8644  24.1827  24.5525  24.7281
+ 0.33N / 46:  23.5511  23.5410  23.6056  23.8149  24.1179  24.2970
+ 0     / 45:  23.5391  23.4697  23.4454  23.5341  23.7437  23.9152
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 41 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7799  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5330  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2438  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9739  25.1064
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 35 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 35 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 38 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 38 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  9 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:  9 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  5 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2029  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:  5 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 47 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3222  24.2574  24.2792  24.4559  24.8014  25.1989
+ 1N    / 48:  24.1494  24.0886  24.0899  24.2231  24.5192  24.8735
+ 0.67N / 47:  24.0194  23.9594  23.9338  24.0060  24.2309  24.5292
+ 0.33N / 46:  23.9494  23.8865  23.8348  23.8403  23.9749  24.2056
+ 0     / 45:  23.9610  23.8876  23.8101  23.7577  23.8012  23.9526
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0893  24.0128  24.0305  24.2093  24.5723  25.0111
+ 1N    / 48:  23.8655  23.7966  23.7992  23.9411  24.2590  24.6558
+ 0.67N / 47:  23.6732  23.6084  23.5863  23.6706  23.9224  24.2649
+ 0.33N / 46:  23.5483  23.4836  23.4354  23.4489  23.6072  23.8806
+ 0     / 45:  23.5360  23.4598  23.3824  23.3292  23.3833  23.5675
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3572  24.4967  24.7800  25.1728  25.4968  25.5979
+ 1N    / 48:  24.1819  24.2866  24.5172  24.8632  25.1660  25.2557
+ 0.67N / 47:  24.0430  24.0993  24.2582  24.5331  24.7997  24.8843
+ 0.33N / 46:  23.9617  23.9632  24.0394  24.2224  24.4405  24.5349
+ 0     / 45:  23.9585  23.9048  23.9006  23.9848  24.1378  24.2396
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1046  24.2439  24.5379  24.9641  25.3385  25.4831
+ 1N    / 48:  23.8866  23.9959  24.2403  24.6203  24.9740  25.1065
+ 0.67N / 47:  23.6926  23.7557  23.9301  24.2379  24.5528  24.6786
+ 0.33N / 46:  23.5623  23.5678  23.6554  23.8652  24.1261  24.2599
+ 0     / 45:  23.5376  23.4796  23.4768  23.5746  23.7580  23.8929
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 17 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 50 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M: 46 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 54 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 58 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3316  24.1982  24.1149  24.1101  24.2698  24.6194
+ 1N    / 48:  24.1534  24.0459  23.9640  23.9283  24.0343  24.3289
+ 0.67N / 47:  24.0296  23.9427  23.8693  23.8085  23.8334  24.0392
+ 0.33N / 46:  23.9776  23.9013  23.8273  23.7484  23.7068  23.8063
+ 0     / 45:  24.0264  23.9547  23.8708  23.7728  23.6845  23.6853
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0998  23.9419  23.8502  23.8473  24.0126  24.3725
+ 1N    / 48:  23.8568  23.7289  23.6389  23.6068  23.7315  24.0484
+ 0.67N / 47:  23.6628  23.5633  23.4870  23.4278  23.4670  23.7064
+ 0.33N / 46:  23.5593  23.4735  23.4013  23.3239  23.2836  23.4092
+ 0     / 45:  23.6053  23.5232  23.4384  23.3380  23.2391  23.2432
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2023  24.1706  24.1868  24.3320  24.6889  25.1380
+ 1N    / 48:  24.0570  24.0199  24.0121  24.1010  24.3886  24.7878
+ 0.67N / 47:  23.9679  23.9272  23.8960  23.9112  24.0946  24.4255
+ 0.33N / 46:  23.9500  23.8924  23.8363  23.7920  23.8598  24.0974
+ 0     / 45:  24.0303  23.9535  23.8642  23.7713  23.7408  23.8683
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9413  23.9053  23.9237  24.0709  24.4373  24.9355
+ 1N    / 48:  23.7355  23.6943  23.6933  23.7943  24.0980  24.5443
+ 0.67N / 47:  23.5856  23.5436  23.5197  23.5450  23.7499  24.1251
+ 0.33N / 46:  23.5242  23.4660  23.4157  23.3749  23.4550  23.7312
+ 0     / 45:  23.6083  23.5263  23.4345  23.3357  23.3000  23.4491
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 58 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 59 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 59 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 60 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3718  24.2759  24.2381  24.3143  24.5845  24.9998
+ 1N    / 48:  24.1915  24.1099  24.0666  24.1084  24.3268  24.6951
+ 0.67N / 47:  24.0557  23.9849  23.9336  23.9307  24.0730  24.3751
+ 0.33N / 46:  23.9834  23.9165  23.8564  23.8115  23.8637  24.0759
+ 0     / 45:  23.9966  23.9258  23.8496  23.7701  23.7430  23.8530
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1479  24.0348  23.9902  24.0651  24.3406  24.7844
+ 1N    / 48:  23.9151  23.8193  23.7735  23.8199  24.0509  24.4498
+ 0.67N / 47:  23.7150  23.6338  23.5826  23.5862  23.7461  24.0841
+ 0.33N / 46:  23.5857  23.5123  23.4548  23.4139  23.4780  23.7252
+ 0     / 45:  23.5750  23.4974  23.4222  23.3420  23.3139  23.4455
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2986  24.3714  24.5593  24.9405  25.4006  25.6571
+ 1N    / 48:  24.1387  24.1885  24.3309  24.6454  25.0684  25.3212
+ 0.67N / 47:  24.0238  24.0371  24.1191  24.3444  24.7020  24.9439
+ 0.33N / 46:  23.9705  23.9413  23.9571  24.0777  24.3415  24.5694
+ 0     / 45:  23.9960  23.9223  23.8745  23.8951  24.0474  24.2410
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0465  24.1179  24.3048  24.7018  25.2123  25.5259
+ 1N    / 48:  23.8411  23.8950  24.0422  24.3726  24.8452  25.1571
+ 0.67N / 47:  23.6700  23.6890  23.7799  24.0219  24.4252  24.7240
+ 0.33N / 46:  23.5701  23.5428  23.5650  23.6985  23.9987  24.2798
+ 0     / 45:  23.5791  23.4988  23.4489  23.4714  23.6448  23.8804
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 62 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2294  24.1666  24.1789  24.3348  24.6565  25.0363
+ 1N    / 48:  24.0720  24.0100  23.9961  24.1004  24.3654  24.6946
+ 0.67N / 47:  23.9687  23.9085  23.8682  23.9032  24.0827  24.3496
+ 0.33N / 46:  23.9312  23.8643  23.7997  23.7720  23.8569  24.0495
+ 0     / 45:  23.9912  23.9110  23.8200  23.7410  23.7390  23.8465
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9767  23.9044  23.9159  24.0764  24.4158  24.8366
+ 1N    / 48:  23.7576  23.6884  23.6775  23.7944  24.0849  24.4571
+ 0.67N / 47:  23.5912  23.5281  23.4913  23.5379  23.7453  24.0569
+ 0.33N / 46:  23.5068  23.4390  23.3774  23.3540  23.4579  23.6911
+ 0     / 45:  23.5656  23.4806  23.3868  23.3018  23.3015  23.4336
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2444  24.3616  24.6223  25.0230  25.3769  25.4884
+ 1N    / 48:  24.0827  24.1577  24.3539  24.6907  25.0127  25.1114
+ 0.67N / 47:  23.9782  23.9985  24.1095  24.3557  24.6332  24.7370
+ 0.33N / 46:  23.9336  23.8998  23.9253  24.0636  24.2777  24.3972
+ 0     / 45:  23.9847  23.8969  23.8444  23.8789  24.0106  24.1269
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.9764  24.0949  24.3635  24.7971  25.2062  25.3654
+ 1N    / 48:  23.7597  23.8423  24.0513  24.4207  24.7960  24.9418
+ 0.67N / 47:  23.5993  23.6266  23.7505  24.0264  24.3532  24.5021
+ 0.33N / 46:  23.5136  23.4812  23.5130  23.6709  23.9254  24.0877
+ 0     / 45:  23.5643  23.4665  23.4073  23.4453  23.5998  23.7470
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 62 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 64 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3238  24.2570  24.2762  24.4494  24.7922  25.1903
+ 1N    / 48:  24.1507  24.0883  24.0875  24.2176  24.5110  24.8654
+ 0.67N / 47:  24.0203  23.9592  23.9321  24.0018  24.2240  24.5221
+ 0.33N / 46:  23.9499  23.8864  23.8340  23.8376  23.9698  24.1996
+ 0     / 45:  23.9612  23.8877  23.8099  23.7565  23.7980  23.9480
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0913  24.0125  24.0276  24.2028  24.5625  25.0016
+ 1N    / 48:  23.8672  23.7964  23.7967  23.9354  24.2503  24.6469
+ 0.67N / 47:  23.6744  23.6082  23.5844  23.6661  23.9151  24.2570
+ 0.33N / 46:  23.5490  23.4835  23.4343  23.4459  23.6016  23.8740
+ 0     / 45:  23.5362  23.4598  23.3821  23.3279  23.3797  23.5624
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3350  24.4653  24.7499  25.1705  25.5289  25.6409
+ 1N    / 48:  24.1636  24.2597  24.4881  24.8569  25.1948  25.2999
+ 0.67N / 47:  24.0305  24.0781  24.2317  24.5232  24.8229  24.9242
+ 0.33N / 46:  23.9559  23.9492  24.0174  24.2096  24.4555  24.5671
+ 0     / 45:  23.9591  23.8984  23.8848  23.9713  24.1442  24.2621
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0822  24.2113  24.5033  24.9571  25.3691  25.5280
+ 1N    / 48:  23.8680  23.9686  24.2074  24.6089  25.0011  25.1536
+ 0.67N / 47:  23.6795  23.7345  23.9009  24.2235  24.5746  24.7220
+ 0.33N / 46:  23.5565  23.5539  23.6318  23.8486  24.1393  24.2949
+ 0     / 45:  23.5390  23.4739  23.4601  23.5581  23.7626  23.9173
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M: 63 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 66 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 65 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+               130W     129W     128W     127W     126W     125W    
+               100      101      102      103      104      105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.3636  24.2466  24.2047  24.2944  24.5700  24.9834
+ 1N    / 48:  24.1823  24.0808  24.0293  24.0856  24.3131  24.6721
+ 0.67N / 47:  24.0429  23.9555  23.8925  23.9012  24.0590  24.3508
+ 0.33N / 46:  23.9628  23.8852  23.8134  23.7743  23.8464  24.0554
+ 0     / 45:  23.9650  23.8885  23.8048  23.7281  23.7207  23.8377
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.1405  24.0053  23.9571  24.0466  24.3282  24.7726
+ 1N    / 48:  23.9068  23.7900  23.7358  23.7995  24.0412  24.4324
+ 0.67N / 47:  23.7030  23.6045  23.5401  23.5583  23.7383  24.0672
+ 0.33N / 46:  23.5647  23.4813  23.4100  23.3756  23.4665  23.7136
+ 0     / 45:  23.5403  23.4591  23.3754  23.2961  23.2938  23.4386
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.2757  24.2696  24.3629  24.6374  25.0615  25.4411
+ 1N    / 48:  24.1124  24.0973  24.1580  24.3776  24.7508  25.0998
+ 0.67N / 47:  23.9930  23.9638  23.9801  24.1238  24.4241  24.7297
+ 0.33N / 46:  23.9344  23.8880  23.8589  23.9144  24.1193  24.3743
+ 0     / 45:  23.9566  23.8866  23.8159  23.7910  23.8916  24.0818
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.0317  24.0211  24.1131  24.3923  24.8465  25.2791
+ 1N    / 48:  23.8191  23.8041  23.8706  24.1001  24.5038  24.9069
+ 0.67N / 47:  23.6398  23.6127  23.6381  23.7968  24.1294  24.4871
+ 0.33N / 46:  23.5298  23.4863  23.4638  23.5312  23.7653  24.0683
+ 0     / 45:  23.5312  23.4606  23.3902  23.3664  23.4839  23.7124
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 65 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8829  23.9742  24.1489  24.3750  24.6256
+ 25-JAN-1982 00 / 3:  23.8850  23.9834  24.1657  24.3983  24.6503
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 67 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 67 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 69 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 69 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 68 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.8838  23.9752  24.1501  24.3761  24.6265
+ 25-JAN-1982 00 / 3:  23.8774  23.9728  24.1535  24.3857  24.6381
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 68 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 71 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 71 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 70 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 70 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 72 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 72 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7487  23.7495  23.8474  24.0089  24.2076
+ 25-JAN-1982 00 / 3:  23.7491  23.7562  23.8550  24.0158  24.2086
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 73 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 74 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 75 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7485  23.7489  23.8463  24.0075  24.2057
+ 25-JAN-1982 00 / 3:  23.7481  23.7620  23.8678  24.0343  24.2309
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 75 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 77 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 76 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5859  29.5797  29.5756  29.5662  29.5590
+ 25-JAN-1982 00 / 3:  29.5787  29.5737  29.5698  29.5546  29.5421
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 76 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 78 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  29.5747  29.5654  29.5513  29.5344  29.5265
+ 25-JAN-1982 00 / 3:  29.5636  29.5536  29.5355  29.5146  29.5054
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 78 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 81 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 81 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 80 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7784  23.7190  23.7799  23.9148  24.1031
+ 25-JAN-1982 00 / 3:  23.7745  23.7236  23.7888  23.9212  24.1104
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 80 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 82 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 82 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.9612  23.9499  24.0203  24.1507  24.3238
+ 25-JAN-1982 00 / 3:  23.9591  23.9559  24.0305  24.1636  24.3350
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 83 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 84 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 84 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 85 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0        0.33N    0.67N    1N       1.33N  
+                        45       46       47       48       49
+ 20-JAN-1982 00 / 2:  23.7527  23.7638  23.8729  24.0446  24.2520
+ 25-JAN-1982 00 / 3:  23.7439  23.7321  23.8164  23.9658  24.1537
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 85 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 86 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 88 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 89 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 91 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ reading TEMP     M: 92 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 94 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 95 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 96 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 98 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 97 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M: 97 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 99 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:101 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:100 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:100 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:102 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:102 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:105 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:104 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:104 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:106 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M:108 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:107 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:107 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:109 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:110 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:111 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:112 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:113 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:114 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:115 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:116 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:118 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:117 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:117 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:120 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:121 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:122 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 76   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:125 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:126 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 77   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:130 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:132 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:131 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 78   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:135 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:137 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M:138 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:136 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 79   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:141 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:142 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 80   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:146 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:148 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:147 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 81   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:151 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:153 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M:154 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 82   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:157 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:159 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:158 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 83   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:162 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:163 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:164 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 84   complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:167 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:169 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:168 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 85   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:172 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:173 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:173 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:174 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 86   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:177 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:178 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:180 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:179 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 87   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:183 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:185 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:184 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 88   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ reading TEMP     M:188 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 89   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT1     PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:191 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:192 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 90   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:194 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:196 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:195 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 91   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:197 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:198 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:198 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:199 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 92   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ reading TEMP     M:201 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:202 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 93   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:204 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:206 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:205 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 94   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:207 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:208 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:208 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:209 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 95   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:211 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:213 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:212 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 96   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ reading TEMP     M:214 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:215 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:216 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 97   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:217 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:219 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:218 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 98   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ reading TEMP     M:220 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:221 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:221 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:222 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 99   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:223 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:225 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:225 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:224 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 100  complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:227 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:229 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:228 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 101  complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:231 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ reading TEMP     M:233 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ reading TEMP     M:235 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 102  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:238 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:239 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:241 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:242 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 103  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:244 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:247 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:246 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 104  complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:248 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:250 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:250 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:251 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 105  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:253 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:254 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ reading TEMP     M:256 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:257 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 106  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:259 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:262 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:261 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 107  complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:263 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:265 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:265 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:266 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 108  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:268 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:270 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:269 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:271 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:273 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:272 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 109  complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:274 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:276 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:275 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 110  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:278 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:279 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:281 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:282 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 111  complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:284 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:287 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:286 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 112  complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:288 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:290 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:290 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:291 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 113  complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ reading TEMP     M:293 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:295 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:294 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 114  complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  4.50000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a1[gx=xoffset at var] ! should be all missing
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ -DELETE X        M:299 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  5.00000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:301 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:  0.50000
+ 5.1 / 5:  5.10000
+ 6.1 / 6:  5.40000
+ 7.1 / 7:     ....
+list a2[gx=xoffset at var]
+ -DELETE X        M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:       ....
+ 2.1 / 2:       ....
+ 3.1 / 3:       ....
+ 4.1 / 4:       ....
+ 5.1 / 5:  0.0900000
+ 6.1 / 6:       ....
+ 7.1 / 7:       ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:301 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:296 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 5.1 / 5:     ....     ....     ....  10.0000  10.0000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:297 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  0.10000  0.90000     ....     ....
+ 5.1 / 5:     ....     ....     ....  0.90000  8.10000     ....     ....
+ 6.1 / 6:     ....     ....     ....     ....     ....     ....     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:298 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....  10.0000  10.1000  11.0000     ....
+ 5.1 / 5:     ....     ....     ....  10.1000  10.2000  11.1000     ....
+ 6.1 / 6:     ....     ....     ....  11.0000  11.1000  12.0000     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:297 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:298 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1      2.1      3.1      4.1      5.1      6.1      7.1   
+              1        2        3        4        5        6        7
+ 1.1 / 1:     ....     ....     ....     ....     ....     ....     ....
+ 2.1 / 2:     ....     ....     ....     ....     ....     ....     ....
+ 3.1 / 3:     ....     ....     ....     ....     ....     ....     ....
+ 4.1 / 4:     ....     ....     ....   0.1000   1.0100   0.9900     ....
+ 5.1 / 5:     ....     ....     ....   1.0100  10.2000   9.9900     ....
+ 6.1 / 6:     ....     ....     ....   0.9900   9.9900   9.7200     ....
+ 7.1 / 7:     ....     ....     ....     ....     ....     ....     ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:297 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:298 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:297 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:297 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+              1.1       2.1       3.1       4.1       5.1       6.1       7.1    
+               1         2         3         4         5         6         7
+ 1.1 / 1:      ....      ....      ....      ....      ....      ....      ....
+ 2.1 / 2:      ....      ....      ....      ....      ....      ....      ....
+ 3.1 / 3:      ....      ....      ....      ....      ....      ....      ....
+ 4.1 / 4:      ....      ....      ....      ....      ....      ....      ....
+ 5.1 / 5:      ....      ....      ....      ....  0.000000      ....      ....
+ 6.1 / 6:      ....      ....      ....      ....      ....      ....      ....
+ 7.1 / 7:      ....      ....      ....      ....      ....      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G006)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:298 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:299 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:300 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:303 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:301 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:302 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G011)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:302 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:296 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G006)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:296 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:303 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.50000
+ 6.1 / 6:  6.50000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:300 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @MIN
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  5.00000
+ 6.1 / 6:  6.00000
+ 7.1 / 7:     ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE X        M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:299 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G010)           @SUM
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:   8.8500
+ 6.1 / 6:  12.2000
+ 7.1 / 7:   1.9500
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ -DELETE X        M:299 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:298 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G008)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.50000
+ 2   / 2:  1.50000
+ 3   / 3:  2.50000
+ 4   / 4:  3.50000
+ 5   / 5:  5.50000
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G008)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:297 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:299 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:298 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:296 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:300 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:303 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:302 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:301 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  2.50000
+ 4   / 4:     ....
+ 5   / 5:     ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:301 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:303 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    3    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.50000
+list a5[gx=x5 at max,i=4]
+ -DELETE X        M:303 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G011)           @MAX
+ eval    A5       C:  7 dset:   0 I:    4    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ -DELETE X        M:300 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:296 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G006)           @MAX
+ eval    ATIME    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:296 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ regrid  ATIME    M:299 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset		! reordered reset before next test: 2/94
+cancel mode verify
+GO bn_axis_limits	! added 10/27/93
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+SET WINDOW/CLEAR/SIZE=0.2 ! added 2/94
+ 
+!GO bn_reset
+!GO bn301_mem_mgmt
+MESSAGE/CONTINUE  ***** bn301_mem_mgmt has been removed from run_all.
+***** bn301_mem_mgmt has been removed from run_all.
+MESSAGE/CONTINUE  ***** Its too slow!!!
+***** Its too slow
+MESSAGE/CONTINUE  ***** Remember to run it separately
+***** Remember to run it separately
+ 
+GO bn_reset
+cancel mode verify
+GO bn_movie
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+ 
+! added in bn311
+GO bn_reset
+cancel mode verify
+GO bn_ez_order	! was bn311 until 9/95
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+              1        2     
+              1        2
+ 1   / 1:  1.00000  4.00000
+ 2   / 2:  2.00000  5.00000
+ 3   / 3:  3.00000  6.00000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   4.0000
+ 2   / 2:   2.0000   5.0000
+ 3   / 3:   3.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  10.0000
+ 2   / 2:   8.0000  11.0000
+ 3   / 3:   9.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   2.0000   8.0000
+ 3   / 3:   3.0000   9.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  10.0000
+ 2   / 2:   5.0000  11.0000
+ 3   / 3:   6.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   7.0000
+ 2   / 2:   3.0000   9.0000
+ 3   / 3:   5.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000   8.0000
+ 2   / 2:   4.0000  10.0000
+ 3   / 3:   6.0000  12.0000
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  17.0000  18.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:  11.0000  12.0000
+ ---- K:2 Z:   2
+ 1   / 1:  15.0000  16.0000
+ 2   / 2:  19.0000  20.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  17.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   5.0000   6.0000
+ 2   / 2:  13.0000  14.0000
+ 3   / 3:  21.0000  22.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:  11.0000  12.0000
+ 3   / 3:  19.0000  20.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  23.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   2.0000  14.0000
+ 3   / 3:   3.0000  15.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:  10.0000  22.0000
+ 2   / 2:  11.0000  23.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   3.0000  15.0000
+ 3   / 3:   5.0000  17.0000
+ ---- K:2 Z:   2
+ 1   / 1:   7.0000  19.0000
+ 2   / 2:   9.0000  21.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   4.0000  16.0000
+ 3   / 3:   6.0000  18.0000
+ ---- K:2 Z:   2
+ 1   / 1:   8.0000  20.0000
+ 2   / 2:  10.0000  22.0000
+ 3   / 3:  12.0000  24.0000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+              1        2     
+              1        2
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1.00000  2.00000
+ 2   / 2:  3.00000  4.00000
+ 3   / 3:  5.00000  6.00000
+ ---- K:2 Z:   2
+ 1   / 1:     ....     ....
+ 2   / 2:     ....     ....
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              1        2     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   5.0000   6.0000
+ 3   / 3:   9.0000  10.0000
+ ---- K:2 Z:   2
+ 1   / 1:   3.0000   4.0000
+ 2   / 2:   7.0000   8.0000
+ 3   / 3:     ....     ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.20000
+ 2   / 2:  0.30000  0.40000
+ ---- K:2 Z:   2
+ 1   / 1:  0.50000  0.60000
+ 2   / 2:  0.70000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.00000
+ 2   / 2:  1.10000  1.20000
+ ---- K:2 Z:   2
+ 1   / 1:  1.30000  1.40000
+ 2   / 2:  1.50000  1.60000
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.10000  0.50000
+ 2   / 2:  0.20000  0.60000
+ ---- K:2 Z:   2
+ 1   / 1:  0.30000  0.70000
+ 2   / 2:  0.40000  0.80000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.90000  1.30000
+ 2   / 2:  1.00000  1.40000
+ ---- K:2 Z:   2
+ 1   / 1:  1.10000  1.50000
+ 2   / 2:  1.20000  1.60000
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.020000
+ 2   / 2:  0.030000  0.040000
+ ---- K:2 Z:   2
+ 1   / 1:  0.050000  0.060000
+ 2   / 2:  0.070000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.100000
+ 2   / 2:  0.110000  0.120000
+ ---- K:2 Z:   2
+ 1   / 1:  0.130000  0.140000
+ 2   / 2:  0.150000  0.160000
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.010000  0.050000
+ 2   / 2:  0.020000  0.060000
+ ---- K:2 Z:   2
+ 1   / 1:  0.030000  0.070000
+ 2   / 2:  0.040000  0.080000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.090000  0.130000
+ 2   / 2:  0.100000  0.140000
+ ---- K:2 Z:   2
+ 1   / 1:  0.110000  0.150000
+ 2   / 2:  0.120000  0.160000
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  1367.00
+ 2   / 2:  2357.00  2367.00
+ ---- K:2 Z:   2
+ 1   / 1:  1457.00  1467.00
+ 2   / 2:  2457.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  1368.00
+ 2   / 2:  2358.00  2368.00
+ ---- K:2 Z:   2
+ 1   / 1:  1458.00  1468.00
+ 2   / 2:  2458.00  2468.00
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.00  2357.00
+ 2   / 2:  1457.00  2457.00
+ ---- K:2 Z:   2
+ 1   / 1:  1367.00  2367.00
+ 2   / 2:  1467.00  2467.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.00  2358.00
+ 2   / 2:  1458.00  2458.00
+ ---- K:2 Z:   2
+ 1   / 1:  1368.00  2368.00
+ 2   / 2:  1468.00  2468.00
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+ 
+! added in bn312  6/3/94
+GO bn_reset
+cancel mode verify
+! cancel mode metafile   ! needed temporarily 6/94: PLOT+/XGKS interaction bug
+GO bn_user
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+set window 1		! clean up
+ 
+! added in bn420  1/96
+GO bn_reset
+cancel mode verify
+GO bn_stream
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:   1.0000   2.0000   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000  17.0000  18.0000  19.0000  20.0000
+ 3   / 3:  21.0000  22.0000  23.0000  24.0000  25.0000  26.0000  27.0000  28.0000  29.0000  30.0000
+ 4   / 4:  31.0000  32.0000  33.0000  34.0000  35.0000  36.0000  37.0000  38.0000  39.0000  40.0000
+ 5   / 5:  41.0000  42.0000  43.0000  44.0000  45.0000  46.0000  47.0000  48.0000  49.0000  50.0000
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+              MYV1    MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.0000  31.0000
+2    /  2:  12.0000  32.0000
+3    /  3:  13.0000  33.0000
+4    /  4:  14.0000  34.0000
+5    /  5:  15.0000  35.0000
+6    /  6:  16.0000  36.0000
+7    /  7:  17.0000  37.0000
+8    /  8:  18.0000  38.0000
+9    /  9:  19.0000  39.0000
+10   / 10:  20.0000  40.0000
+ ---- J:2 Y:   2
+1    /  1:  21.0000  41.0000
+2    /  2:  22.0000  42.0000
+3    /  3:  23.0000  43.0000
+4    /  4:  24.0000  44.0000
+5    /  5:  25.0000  45.0000
+6    /  6:  26.0000  46.0000
+7    /  7:  27.0000  47.0000
+8    /  8:  28.0000  48.0000
+9    /  9:  29.0000  49.0000
+10   / 10:  30.0000  50.0000
+cancel data stream_data_link.unf
+ 
+ 
+!added in bn430 9/96 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_mc
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     T (hour)             6 r   366                  4018.4
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              730.485    731.2425
+       3>  1826.97               730.485    1461.727
+       4>  2557.455              730.485    2192.213
+       5>  3287.94               730.485    2922.698
+       6>  4018.425              730.485    3653.183
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 1827   / 3:  28.2710  28.1010  27.1568  26.6065  26.5793  27.1318  27.1135  27.1007
+ 2557.5 / 4:  28.3570  28.5412  27.6643  27.2819  27.1998  27.4282  27.5459  27.4002
+ 3287.9 / 5:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+ 4018.4 / 6:  28.0824  27.9723  27.7204  26.8768  26.9810  27.7220  28.0643  27.8845
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 1827   / 3:  27.9375  27.9731  27.8331  27.5333  27.0461  27.2091  27.2154  27.0734  26.8618  26.6585
+ 2557.5 / 4:  27.9532  27.8072  27.9180  27.9515  27.7807  27.6695  27.5253  27.3922  27.3396  27.2409
+ 3287.9 / 5:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 4018.4 / 6:  28.1912  28.2880  28.4249  28.1785  27.8359  27.8262  27.5394  27.3811  27.1444  27.0317
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 4018.4
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     T (hour)             3 i   366                  3287.9
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  366                   730.485    0.7575
+       2>  1096.485              1460.97    731.2425
+       3>  3287.94               2191.455   2192.213
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-T (hour))
+             LONGITUDE: 140W (interpolated)
+                7S       5S       3S       1S       1N       3N       5N       7N     
+                42       43       44       45       46       47       48       49
+ 366    / 1:  27.4922  27.0790  26.2177  25.8117  25.8974  26.4319  26.8698  26.9781
+ 1096.5 / 2:  27.5431  27.4416  26.6992  26.3360  26.4503  26.8090  27.0577  26.9103
+ 3287.9 / 3:  28.2175  28.1635  27.4141  26.7167  26.9325  27.7459  27.7151  27.4877
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-T (hour))
+             LATITUDE : 0 (interpolated)
+      ... listing every   2th point
+               179W     175W     171W     167W     163W     159W     155W     151W     147W     143W    
+                81       83       85       87       89       91       93       95       97       99
+ 366    / 1:  28.5733  27.8591  27.7604  27.6391  27.4060  26.8263  26.5254  26.2984  26.0875  25.9927
+ 1096.5 / 2:  28.3556  28.1094  27.6296  27.2492  27.1351  26.6124  26.6061  26.5371  26.0686  26.4401
+ 3287.9 / 3:  28.3764  27.9455  28.2888  28.1323  27.9742  27.6899  27.5363  27.5056  26.9876  27.0593
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             T (hour): 0.7575 to 4383.7
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 366 to 3287.9
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-T (hour))
+      ... listing every  14th point
+                21E      49E      77E     105E     133E     161E     171W     143W     115W      87W      59W      31W      3W     
+                 1       15       29       43       57       71       85       99      113      127      141      155      169
+ ---- L:1 T:   366
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75N   / 83:   1.5550     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73N   / 82:   3.7205   0.5871     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.0000
+ 71N   / 81:   5.0934   0.6186     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   4.1287
+ 69N   / 80:   5.4500   0.4500     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.0000   4.8885
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   4.3120   4.5952
+ 65N   / 78:   0.0718     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.8767   5.0952   5.2194
+ 63N   / 77:   0.5111     ....     ....     ....     ....     ....  -0.8467     ....     ....     ....   0.8500   5.9579   6.4264
+ 61N   / 76:   1.2269     ....     ....     ....     ....   0.3500   0.1214   6.0000     ....     ....   0.8000   6.2213   8.1800
+ 59N   / 75:   2.9000     ....     ....     ....     ....   1.1500   1.6321   5.7458     ....     ....   2.7033   7.3962   7.6307
+ 57N   / 74:   3.0388     ....     ....     ....     ....   1.1250   2.8750   5.2914     ....     ....   0.5308   7.5317   6.4543
+ 55N   / 73:   3.2013     ....     ....     ....     ....   0.6459   3.6936   5.2583     ....     ....  -0.4622   7.4551   6.5806
+ 53N   / 72:     ....     ....     ....     ....     ....   1.1996   4.2880   5.7998     ....     ....   1.2333   7.7514   7.1047
+ 51N   / 71:     ....     ....     ....     ....     ....   2.1893   4.2290   6.2278     ....     ....  -0.2905  10.2702   9.3957
+ 49N   / 70:     ....     ....     ....     ....     ....   2.5412   4.6069   6.6250     ....   3.0125   0.6527  11.6186  10.2970
+ 47N   / 69:     ....     ....     ....     ....     ....   2.9602   5.5956   7.6881     ....   3.1794   1.2426  12.6823  11.3385
+ 45N   / 68:     ....   3.3167     ....     ....     ....   4.4480   7.0744   8.9556     ....   3.4525   2.2314  13.7819  12.2254
+ 43N   / 67:     ....   4.7221     ....     ....   2.4068   6.9255   8.9646  10.3486     ....   3.1277   6.3709  14.7211  13.0557
+ 41N   / 66:     ....   4.8365     ....     ....   4.3635   9.6898  10.9751  11.9288     ....     ....  15.5498  15.4318     ....
+ 39N   / 65:  15.4366   8.6262     ....     ....   8.8837  12.8097  12.5484  13.4077     ....     ....  18.6870  16.2119     ....
+ 37N   / 64:  16.0318   8.0667     ....     ....  12.3600  15.0324  13.9800  15.0021     ....     ....  19.2616  17.1874  15.1152
+ 35N   / 63:  16.2507     ....     ....     ....  13.3810  16.7364  15.4538  16.4689     ....     ....  19.5398  18.1828  15.5754
+ 33N   / 62:  16.7783     ....     ....     ....  18.5491  18.0244  16.8419  17.7790     ....     ....  20.1041  19.2886     ....
+ 31N   / 61:  17.9786     ....     ....     ....  19.9407  19.3074  18.5523  19.1648  17.8500  17.4183  20.8400  20.0450     ....
+ 29N   / 60:     ....  18.9119     ....     ....  20.5019  20.6291  20.1257  20.1026  16.8274  20.6176  22.0740  20.6790     ....
+ 27N   / 59:     ....  20.8300     ....     ....  21.3326  22.0026  21.6086  20.9032  17.8323  23.7582  23.1533  21.5070     ....
+ 25N   / 58:     ....     ....     ....     ....  22.3495  23.8248  23.2779  21.5841  18.8269  24.8593  24.0919  22.3336     ....
+ 23N   / 57:     ....     ....     ....     ....  23.6807  25.0783  24.0186  22.3034  20.2700  25.5195  24.7930  22.7905     ....
+ 21N   / 56:     ....     ....     ....     ....  24.7072  25.9688  24.7256  22.9079  22.0270  26.4860  25.3493  22.9386     ....
+ 19N   / 55:     ....     ....     ....  22.6383  25.9015  26.6802  25.6078  23.5313  23.8074  27.0339  25.8612  23.4342     ....
+ 17N   / 54:     ....     ....     ....     ....  26.8579  27.0091  25.9585  24.1694  25.2841  27.0695  26.1928  23.8282     ....
+ 15N   / 53:     ....  25.4074     ....     ....  27.4243  27.0312  26.1212  24.8069  26.3029  26.9280  26.3665  24.2289     ....
+ 13N   / 52:     ....  25.3684     ....     ....  27.7591  27.2962  26.4994  25.1181  26.6522  26.8229  26.6502  24.8118     ....
+ 11N   / 51:     ....  25.8188  27.8253  27.8789  27.8781  27.9126  26.8606  25.7058  27.0455  26.2577  26.8927  25.3867     ....
+ 9N    / 50:     ....  27.2000  27.8411  26.3897  28.1118  28.0045  27.4964  26.6136  26.7775  26.8093  27.0323  25.9038     ....
+ 7N    / 49:     ....  26.1127  27.5677  26.0238  28.0494  28.7383  27.8221  27.0807  26.9304  27.5097  26.8869  26.5924     ....
+ 5N    / 48:     ....  26.1020  27.8127  26.5939  28.3079  28.7465  28.1379  27.1305  27.5967  27.5257     ....  26.9872  27.8152
+ 3N    / 47:     ....  26.2525  27.9241  26.8579  28.5464  28.9967  27.6071  26.2341  25.5129  27.0847     ....  27.0516  28.3003
+ 1N    / 46:     ....  26.4437  28.2462  27.2532  28.7823  28.7893  27.5856  25.9683  24.2075  25.8155     ....  27.0482  27.9197
+ 1S    / 45:     ....  27.0068  28.1397  27.7957  28.9633  29.1200  27.9352  26.0170  24.4768  24.9226     ....  27.0957  27.0229
+ 3S    / 44:     ....  27.6137  28.2304  27.5868  28.9390  29.4694  27.9904  26.2519  24.6900  24.9094     ....  27.1568  26.8912
+ 5S    / 43:     ....  28.2419  28.1710  28.0148  28.8535  29.6225  28.6900  26.6985  24.8254  25.1700     ....  27.1489  26.2070
+ 7S    / 42:     ....  28.7080  28.1502  28.3020  28.9045  29.3650  29.1496  27.0025  25.1069  24.9153     ....  27.3142  25.4034
+ 9S    / 41:     ....  28.4648  28.3721  28.3145  28.9483  29.3450  28.9944  28.0900  25.3219  24.4950     ....  27.2335  24.8536
+ 11S   / 40:     ....  28.0725  28.3709  28.1023  29.6033  29.3462  29.1837  28.2076  25.4194  24.1157     ....  27.2170  24.0960
+ 13S   / 39:     ....  28.1510  28.0187  27.8073  30.0000  29.1755  29.0507  28.1889  25.3569  23.7371     ....  27.3476  23.4967
+ 15S   / 38:     ....  28.0800  27.7714  27.2320     ....  28.6954  28.8358  28.2165  25.5737  22.9877     ....  27.0100  23.0127
+ 17S   / 37:     ....  28.2857  26.9409  26.4882     ....  28.2425  28.1673  27.9296  25.5046  22.3944     ....  26.7405  22.9133
+ 19S   / 36:     ....  27.6122  26.1967  25.0514     ....  27.7552  27.8560  27.5000  25.4854  21.0467     ....  26.6053  22.7264
+ 21S   / 35:     ....  27.5942  25.6929  24.4583     ....  26.3083  26.9939  27.2162  25.5969  21.8550     ....  26.4333  22.5890
+ 23S   / 34:     ....  27.0610  25.3542  23.6893     ....  26.0250  26.0238  26.6869  25.5377  21.5647     ....  26.5500  22.9482
+ 25S   / 33:     ....  26.6974  25.2817  22.6691     ....  25.5528  25.4389  25.4775  25.2041  21.3664     ....  25.4338  23.1510
+ 27S   / 32:     ....  25.8897  24.5000  22.1500     ....  24.8603  24.1297  24.3742  24.8067  21.0300     ....  24.8628  22.9100
+ 29S   / 31:     ....  24.6453  23.8583  21.1592     ....  24.0408  23.2608  23.1950  24.4300  21.1500     ....  23.4096  22.5004
+ 31S   / 30:     ....  23.8611  22.6739  20.5028     ....  23.2794  21.8597  21.8462  22.7130  21.3700     ....  22.5936  22.0041
+ 33S   / 29:     ....  22.1584  21.2131  19.2542  18.8470  22.4742  20.8053  20.6944  22.4667  20.3670     ....  20.5743  20.8167
+ 35S   / 28:  21.0773  20.5794  19.8725  18.4359  18.1523  22.1463  20.1823  19.6000  20.4500  19.2450  21.7333  19.9441  19.5977
+ 37S   / 27:  21.2868  19.1969  17.8018  16.7463  16.9175  20.0833  19.0935  18.1643  18.1575  18.4543     ....  18.6379  17.6856
+ 39S   / 26:  20.7459  17.5123  15.9600  14.8400  16.3010  18.3956  18.3997  16.9135  16.9625  17.0514  18.6879  16.7446  15.4764
+ 41S   / 25:  16.4473  14.4439  14.4573  13.5944  14.4030  17.4141  17.2206  15.2329     ....  15.7317  16.7885  14.7942  12.6567
+ 43S   / 24:  14.3660   8.5494  12.8214  11.9753  13.3524  15.0229  16.4218  13.6950     ....  13.6375  13.9769  12.5075  10.4100
+ 45S   / 23:   8.4925   7.5150  11.1860  10.5093  11.8445  13.9774  14.9780  13.0112     ....  12.0000  12.2990  10.5100   7.9967
+ 47S   / 22:   6.0621   5.7733   7.4400   9.0110  10.8888  13.2065  13.4630  11.6550     ....  10.2400  11.1783   8.6200   6.4500
+ 49S   / 21:   4.4209   4.2067   6.0325   6.1945   9.7129  10.8775  12.9344     ....     ....   9.3675  10.3435   5.2987   4.5450
+ 51S   / 20:   1.8375   3.6387   3.1564   5.7656   8.0480  10.0143  11.0070  10.9750     ....   9.2000   9.8156   3.6350   2.5350
+ 53S   / 19:   1.0891   2.8667   2.1950   4.1600   6.5630   9.4455   9.7660     ....     ....   8.5500   8.5604   2.1900   1.0550
+ 55S   / 18:   0.6469   2.6750   2.3478   4.1000   5.1560   6.5700   8.0000     ....   7.8000   7.8786   6.9458   1.3933   0.5425
+ 57S   / 17:   0.4114   2.0529   1.8425   2.4260   4.2929   4.7383   7.0125   3.9825     ....   6.8667   5.7852   0.7771   0.5529
+ 59S   / 16:   0.6236   1.3700   1.4776   2.0189   3.2000   4.0325   4.4000   1.8360     ....   6.5150   2.7940   0.0694   0.0558
+ 61S   / 15:   0.8438   1.3312   1.2144   1.2400   1.9900   2.2237   3.2143   0.8080   3.6867     ....   1.6781   0.0830   0.6620
+ 63S   / 14:   0.8813   0.7700   1.1575   0.4750   1.2344   1.1619   1.6000   0.5280   2.3275   3.4000   1.1667  -0.3333   0.4050
+ 65S   / 13:   0.3667  -0.0356   0.8123   0.0871   0.1521   0.3286   0.5200   0.4550   0.5067   1.8325  -0.9000  -0.5500   0.2060
+ 67S   / 12:  -0.6667  -0.9250   0.5317     ....     ....  -0.3906  -0.0233  -1.2000  -0.1537   0.8722     ....  -0.2533   0.2300
+ 69S   / 11:   0.0425     ....   1.2033     ....     ....  -0.6200  -0.1364     ....  -0.4150   0.1786     ....   0.5000   0.0700
+ 71S   / 10:     ....     ....     ....     ....     ....     ....  -0.7040   0.0000     ....     ....     ....  -1.0167  -1.0100
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -0.3500     ....     ....     ....     ....  -1.2000     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -1.1750     ....     ....     ....     ....  -0.4233     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6250     ....     ....     ....     ....  -0.8678     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:2 T:   1096.5
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77N   / 84:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.0000
+ 75N   / 83:   2.5283     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -1.5500
+ 73N   / 82:   4.0984   0.3050     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.1087
+ 71N   / 81:   4.6724   0.1046     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.7960
+ 69N   / 80:   4.1971   0.0000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.8097
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   1.6000   3.7596   4.3979
+ 65N   / 78:  -0.0625     ....     ....     ....     ....     ....  -0.2000     ....     ....     ....   0.4221   4.4633   4.8655
+ 63N   / 77:   0.0745     ....     ....     ....     ....     ....  -1.7560     ....     ....     ....  -0.2712   5.8617   6.3740
+ 61N   / 76:   0.4814     ....     ....     ....     ....   2.4947  -1.5404   4.7000     ....     ....   2.1750   6.4468   7.9008
+ 59N   / 75:   1.6399     ....     ....     ....     ....   2.0000   0.0008   5.2586     ....     ....   1.3824   7.0788   6.9452
+ 57N   / 74:   2.0350     ....     ....     ....     ....   1.0500   2.0321   4.7989     ....     ....   1.5986   7.2850   5.6111
+ 55N   / 73:   2.0609     ....     ....     ....     ....   0.2492   3.3744   4.9032     ....     ....   1.1250   7.1357   5.8718
+ 53N   / 72:     ....     ....     ....     ....     ....   0.6807   3.7572   5.4648     ....     ....  -2.2000   7.5902   6.5032
+ 51N   / 71:     ....     ....     ....     ....     ....   1.6469   3.7090   5.7799     ....     ....  -1.1807  10.0328   8.4741
+ 49N   / 70:     ....     ....     ....     ....     ....   1.8588   4.3120   6.2452     ....     ....  -0.3648  11.3871   9.5089
+ 47N   / 69:     ....     ....     ....     ....     ....   2.3163   5.1206   7.3744     ....   1.9691  -0.0062  12.2219  10.1338
+ 45N   / 68:     ....   3.6500     ....     ....     ....   3.6392   6.7455   8.6209     ....   2.8224   0.9671  13.4022  11.7268
+ 43N   / 67:     ....   4.6473     ....     ....   1.3648   5.8679   8.5111   9.8453     ....   2.4835   5.0119  14.2248  12.1942
+ 41N   / 66:     ....   4.7861     ....     ....   3.0570   8.4719  10.3051  11.4213     ....     ....  14.7565  15.0002     ....
+ 39N   / 65:  15.0270   8.4385     ....     ....   7.3566  11.4912  12.1752  12.8504     ....     ....  18.0116  15.7098     ....
+ 37N   / 64:  15.3211     ....     ....     ....  10.8839  13.7783  13.3446  14.3616     ....     ....  18.5301  16.5598  14.7798
+ 35N   / 63:  15.5386     ....     ....     ....  11.5113  15.5093  14.6245  15.8741     ....     ....  18.7629  17.4589  15.1510
+ 33N   / 62:  16.0085     ....     ....     ....  18.0727  16.9360  16.0912  17.1296     ....     ....  19.2839  18.5539     ....
+ 31N   / 61:  15.5003     ....     ....     ....  19.3688  18.1290  17.7404  18.4996  16.6805  17.1886  20.0995  19.3186     ....
+ 29N   / 60:     ....  17.9540     ....     ....  19.6179  19.5035  19.2114  19.5065  16.2029  20.0335  21.3973  20.0384     ....
+ 27N   / 59:     ....  19.2895     ....     ....  20.5089  21.1212  20.6266  20.3709  17.2076  23.4895  22.6302  20.8561     ....
+ 25N   / 58:     ....     ....     ....     ....  21.6717  22.9821  22.7977  21.2932  18.4958  24.6577  23.6045  21.6921     ....
+ 23N   / 57:     ....     ....     ....     ....  23.0715  24.4551  23.5951  22.2253  19.8338  25.2474  24.2970  22.1740     ....
+ 21N   / 56:     ....     ....     ....     ....  24.4908  25.3921  24.3804  22.7672  21.2780  25.9320  24.9042  22.6199     ....
+ 19N   / 55:     ....     ....     ....  21.9809  25.6218  26.2087  25.0433  23.4827  23.0766  26.7496  25.4450  22.7637     ....
+ 17N   / 54:     ....     ....     ....     ....  26.5571  26.5915  25.7194  24.1352  24.9649  26.7912  25.7799  22.9853     ....
+ 15N   / 53:     ....  25.4092     ....     ....  27.2200  26.8560  25.9733  24.7324  26.0247  26.0114  26.0969  23.6629     ....
+ 13N   / 52:     ....  25.4771     ....     ....  27.5037  27.5150  26.1672  25.1314  26.5769  26.9127  26.4016  24.1635     ....
+ 11N   / 51:     ....  25.9857  28.0015  26.7764  27.5853  27.5652  26.8019  25.7690  27.0738  26.0525  26.6473  24.7404     ....
+ 9N    / 50:     ....  26.4544  28.2288  26.5501  27.7983  28.1491  27.4758  26.8996  26.9893  26.8687  26.7045  25.5850     ....
+ 7N    / 49:     ....  26.2609  27.8816  26.4870  27.6868  28.5162  27.7850  27.0898  27.0539  28.0777  26.7957  26.6243     ....
+ 5N    / 48:     ....  26.4131  27.9713  26.8734  27.7794  28.6949  27.8279  26.7964  26.6060  28.0647     ....  26.8913  28.0427
+ 3N    / 47:     ....  26.5913  28.1749  26.9865  28.4875  29.1712  27.8616  26.6257  26.2312  27.7434     ....  27.1225  28.5353
+ 1N    / 46:     ....  26.8491  28.6115  27.3775  28.2466  28.9555  27.5331  26.4050  26.4266  26.5208     ....  27.2455  28.5152
+ 1S    / 45:     ....  27.3064  28.4080  27.9040  28.4680  29.2010  27.7261  26.4751  24.6569  26.0235     ....  27.4196  27.9833
+ 3S    / 44:     ....  27.9602  28.2742  28.3296  28.8893  29.5794  28.3834  26.5213  25.4925  26.6125     ....  27.6638  27.3859
+ 5S    / 43:     ....  28.2396  28.0572  28.3176  28.7901  29.3721  28.2957  26.7982  25.7981  26.6252     ....  27.6334  27.2052
+ 7S    / 42:     ....  28.6815  28.2612  28.2786  28.7463  29.4168  28.8967  27.4410  26.1729  26.5534     ....  27.7374  26.6993
+ 9S    / 41:     ....  28.4790  28.3137  28.5841  28.7040  29.4256  29.1270  28.3372  25.9400  25.9795     ....  27.6607  26.1480
+ 11S   / 40:     ....  28.2829  28.6414  28.3339  29.3503  29.1771  29.1492  28.2032  25.9871  25.9624     ....  27.5419  25.5310
+ 13S   / 39:     ....  28.3226  28.3738  28.5679     ....  29.0269  29.1852  28.3130  25.7940  25.0490     ....  27.3347  25.0641
+ 15S   / 38:     ....  27.6600  28.2896  27.7713     ....  28.8387  29.0820  28.4626  25.9384  24.0311     ....  27.4378  24.5993
+ 17S   / 37:     ....  28.0370  27.5108  27.3368     ....  28.5764  28.4527  27.9555  26.0744  23.1143     ....  27.5051  24.0454
+ 19S   / 36:     ....  27.7741  27.0157  26.4074     ....  28.0387  28.2036  28.0002  26.1485  23.5125     ....  27.4665  23.8172
+ 21S   / 35:     ....  27.5781  26.3341  25.2805     ....  26.9356  27.5820  27.6097  26.0473  22.5984     ....  27.0379  23.6919
+ 23S   / 34:     ....  27.4302  26.2267  24.4780     ....  26.2735  26.9770  26.9149  25.9504  22.6780     ....  27.2712  23.6569
+ 25S   / 33:     ....  27.1106  25.3692  23.3572     ....  25.8933  25.9116  26.4028  25.5674  21.8153     ....  26.4321  23.8424
+ 27S   / 32:     ....  26.2136  25.2324  22.5225     ....  25.1302  24.7613  25.0533  25.4781  22.3270     ....  26.0936  23.3768
+ 29S   / 31:     ....  25.1187  23.9464  21.6124     ....  24.6507  24.1035  24.0470  24.7712  21.6070     ....  25.1327  23.1977
+ 31S   / 30:     ....  24.1655  22.8869  20.9082     ....  23.9437  22.8024  22.8395  23.8185  21.6885     ....  23.6302  22.7434
+ 33S   / 29:     ....  23.0193  21.8809  19.7883  19.8276  23.0018  21.7527  21.3169  21.5627  21.0475     ....  22.6172  21.4319
+ 35S   / 28:  20.9734  21.1547  20.7043  18.8851  18.9300  22.5357  20.8505  20.5353  22.0240  20.2323  22.8700  20.8750  20.1989
+ 37S   / 27:  21.7237  19.9086  18.4469  17.2227  17.7141  20.7386  19.8244  18.3687  19.8411  19.7704     ....  19.5269  18.6070
+ 39S   / 26:  22.0397  18.3765  16.5437  15.5140  17.0989  19.0830  18.8514  17.5866     ....  18.7405  19.1255  18.2102  15.7730
+ 41S   / 25:  17.8526  16.3651  15.5023  14.2290  15.4274  17.6752  17.4792  15.9576  18.1650  17.1268  17.4312  16.4894  13.9250
+ 43S   / 24:  13.4949   9.2836  13.3727  12.3420  13.9432  16.1595  17.0221  14.6650  16.3947  14.2424  14.2672  14.1820  10.6937
+ 45S   / 23:   8.3840   7.6307  11.6679  11.2457  12.8452  14.4788  15.0178  13.5082     ....  12.0600  12.7115  10.9652   8.1250
+ 47S   / 22:   6.7167   6.0540   8.2500   9.1190  10.9825  12.8255  13.8707  12.4650     ....  10.8575  11.1699   8.5767   5.5000
+ 49S   / 21:   4.8858   5.4150   5.9088   6.2255  10.1339  11.2443  12.5930  11.4167     ....  10.0842  10.6338   7.4442   4.9572
+ 51S   / 20:   2.3210   3.9822   3.9846   5.7576   7.7675   9.9738  10.8426  10.1840     ....  10.0000  10.2138   5.1999   3.5755
+ 53S   / 19:   1.6715   3.2515   2.9610   4.1500   6.9224   8.5819   9.1357     ....     ....   8.1500   8.4738   3.8071   2.1017
+ 55S   / 18:   1.3318   3.1000   2.6454   3.0000   5.7914   6.1994   7.9489   6.6000     ....   7.7692   7.2001   1.8440   1.0135
+ 57S   / 17:   0.9767   1.9018   1.9953   2.7540   5.2543   4.5237   6.5740   3.7000     ....   7.5635   6.0275   1.7052   1.1491
+ 59S   / 16:   1.1588   2.1100   1.9107   2.7212   3.8002   3.8360   4.9089   1.7892     ....   6.7092   3.6242   1.2592   0.7025
+ 61S   / 15:   0.9937   1.7382   1.5836   2.3000   3.0766   2.3196   3.4012   1.9993     ....   4.4088   2.4941   0.0903   0.4673
+ 63S   / 14:   1.0650   1.2982   1.6343   1.2108   1.5136   1.6090   1.8151   1.2050     ....   3.1150   1.2840   0.3114   0.9075
+ 65S   / 13:   0.6686   0.1303   0.8185   0.2022   0.5104   0.3644   1.0079   0.2598   1.8500   1.8860   0.7000   0.0021   0.9191
+ 67S   / 12:   0.4623  -0.5492   0.0874     ....     ....  -0.0052  -0.2830  -0.0203   1.1982   0.4323  -0.5000   0.2120  -0.0205
+ 69S   / 11:  -0.3438     ....  -0.2335     ....     ....  -1.3365  -0.1277     ....  -0.2716  -0.3135     ....  -0.7000  -0.2723
+ 71S   / 10:     ....     ....     ....     ....     ....  -1.6000  -1.0248     ....  -1.0000     ....     ....  -1.5633  -0.9349
+ 73S   /  9:     ....     ....     ....     ....     ....     ....  -1.0216     ....     ....     ....     ....  -1.4771     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....  -0.6115     ....     ....     ....  -1.6061  -1.2224     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....  -0.6974     ....     ....     ....     ....  -1.3728     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ ---- L:3 T:   3287.9
+ 89N   / 90:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87N   / 89:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85N   / 88:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83N   / 87:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81N   / 86:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79N   / 85:   2.5000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   0.3750
+ 77N   / 84:   3.4400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6250
+ 75N   / 83:   2.6000     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.8460
+ 73N   / 82:   4.4409   0.5100     ....     ....     ....     ....     ....     ....     ....     ....  -1.3667     ....  -0.8225
+ 71N   / 81:   5.4388   0.3400     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   3.6240
+ 69N   / 80:   5.9773     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....   7.0333   5.7596
+ 67N   / 79:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.6000   6.2775   5.0971
+ 65N   / 78:   1.4558     ....     ....     ....     ....     ....  -0.2350     ....     ....     ....  -0.0333   5.5736   5.9673
+ 63N   / 77:   3.4200     ....     ....     ....     ....     ....   0.6400     ....     ....     ....  -1.6700   6.6186   7.9123
+ 61N   / 76:   3.4160     ....     ....     ....     ....   2.5655   0.7717   6.6667     ....     ....   1.8667   7.0529   8.8649
+ 59N   / 75:   5.6405     ....     ....     ....     ....   2.0611   0.9867   6.9750     ....     ....   2.0100   7.4621   8.4868
+ 57N   / 74:   5.9800     ....     ....     ....     ....   3.0850   2.7321   6.8916     ....     ....   0.9500   8.2306   8.5784
+ 55N   / 73:   8.0252     ....     ....     ....     ....   2.3115   4.5506   6.4479     ....     ....   3.7000   8.3973   9.5559
+ 53N   / 72:     ....     ....     ....     ....     ....   2.6937   4.8088   6.7680     ....     ....   2.8900   9.2218  10.4003
+ 51N   / 71:     ....     ....     ....     ....     ....   3.2503   4.9117   6.8015     ....     ....   2.5529  11.3034  10.8005
+ 49N   / 70:     ....     ....     ....     ....     ....   3.0545   5.1517   7.2869     ....   2.7152   3.2139  12.3364  11.3225
+ 47N   / 69:     ....   2.7000     ....     ....     ....   3.3659   5.8927   8.3193     ....   2.7223   3.4114  13.6252  13.5042
+ 45N   / 68:     ....  10.0571     ....     ....     ....   4.8410   7.4161   9.4102     ....   3.6258   3.8275  14.6266  14.1615
+ 43N   / 67:     ....  12.7416     ....     ....   6.7189   6.9232   9.1093  10.6638     ....   4.2112   7.7514  15.5934  14.2717
+ 41N   / 66:     ....  12.2736     ....     ....   9.4889  10.0966  11.2221  12.2000     ....   7.4752  17.0025  16.5220     ....
+ 39N   / 65:  18.3061  17.6344     ....     ....  13.1272  13.1707  13.2898  13.6927     ....     ....  20.0227  17.1398     ....
+ 37N   / 64:  18.5141  17.9063     ....     ....  15.3549  15.3983  15.0444  15.3707     ....     ....  20.4579  18.0923  17.5707
+ 35N   / 63:  18.7384     ....     ....     ....  16.8426  17.6000  16.7552  16.7829     ....     ....  20.4300  19.0107  17.7344
+ 33N   / 62:  18.9508     ....     ....     ....  21.5277  18.7307  18.1471  17.9534     ....     ....  21.0125  20.0088     ....
+ 31N   / 61:  18.7025     ....     ....     ....  22.5800  20.5256  20.0583  19.4733  17.4200  24.2768  21.8716  20.6057     ....
+ 29N   / 60:     ....  25.7695     ....     ....  22.5733  22.5723  21.6635  20.2684  16.2180  24.9511  23.1845  21.2752     ....
+ 27N   / 59:     ....  25.4122     ....     ....  23.6602  24.0498  22.5812  21.2723  16.7570  26.3925  24.2020  21.7641     ....
+ 25N   / 58:     ....     ....     ....     ....  25.2143  25.5321  24.3246  21.9995  17.9540  26.9720  24.9484  22.4602     ....
+ 23N   / 57:     ....     ....     ....     ....  26.6917  26.0579  24.8529  22.5776  20.2795  27.1909  25.5700  22.9362     ....
+ 21N   / 56:     ....     ....     ....     ....  27.8576  26.6563  25.3957  23.1102  22.1345  27.7200  26.0730  23.0700     ....
+ 19N   / 55:     ....     ....     ....  26.8300  28.4227  27.1402  25.9305  23.6595  23.7516  28.1905  26.6716  23.3293     ....
+ 17N   / 54:     ....     ....     ....     ....  28.8737  27.3141  26.3835  24.2809  25.2149  28.3251  27.0405  23.5656     ....
+ 15N   / 53:     ....  29.6770     ....     ....  29.0020  27.5648  26.8352  25.0370  26.4873  28.2522  27.1788  24.0619     ....
+ 13N   / 52:     ....  29.7957     ....     ....  29.0452  27.9505  26.9712  25.7979  27.9270  29.0510  27.4940  24.9544     ....
+ 11N   / 51:     ....  29.9600  29.6100  29.9485  29.1975  28.5281  27.2419  26.2275  28.2569  28.6935  27.4943  25.4832     ....
+ 9N    / 50:     ....  29.0000  29.2055  29.9940  29.1339  28.5629  28.0300  26.8865  28.1333  28.7602  27.5655  26.2932     ....
+ 7N    / 49:     ....  28.0975  29.2157  29.8208  29.1260  28.9489  28.3765  27.6896  27.9185  28.6481  27.8075  26.9731     ....
+ 5N    / 48:     ....  28.5837  28.9960  29.6031  29.2848  28.8200  28.2841  28.0367  28.0050  28.1459     ....  27.4683  28.6742
+ 3N    / 47:     ....  28.8228  28.8738  29.6720  29.1708  29.1114  27.9356  27.4223  27.0792  27.4624     ....  27.7005  28.7616
+ 1N    / 46:     ....  28.9241  28.9488  29.6711  29.2204  29.2053  27.9759  26.7708  26.2331  24.6843     ....  27.7243  28.5300
+ 1S    / 45:     ....  28.8412  28.8305  29.7569  29.3532  29.1575  28.6016  27.3479  26.1727  23.7911     ....  27.7941  27.3629
+ 3S    / 44:     ....  28.7131  28.7504  29.7065  28.8744  29.3853  29.0300  27.7041  26.2321  24.2555     ....  27.9582  27.0115
+ 5S    / 43:     ....  28.2603  28.5437  29.3988  28.6953  29.4181  29.4700  28.0004  26.6977  25.2607     ....  28.0911  26.9673
+ 7S    / 42:     ....  28.4590  28.1998  29.0577  28.3900  29.3039  29.4132  28.1829  26.9186  25.5194     ....  28.0741  26.4868
+ 9S    / 41:     ....  27.4126  27.8088  28.6505  28.0595  29.3987  29.4488  28.6235  26.8222  25.9759     ....  27.9426  25.9048
+ 11S   / 40:     ....  27.3103  27.5905  28.4839  28.4948  28.7670  29.4367  28.7400  26.7212  25.1000     ....  27.5707  25.3691
+ 13S   / 39:     ....  27.6357  27.1885  28.1500  29.0750  28.2963  29.0007  28.3957  26.0152  23.9237     ....  27.2888  23.9450
+ 15S   / 38:     ....  27.4167  26.8054  27.3040     ....  27.6349  28.8591  28.2997  25.6416  22.9757     ....  26.8832  23.2593
+ 17S   / 37:     ....  26.5750  26.3315  26.3547     ....  26.9741  27.8112  27.7504  25.2758  22.2731     ....  26.9240  22.9660
+ 19S   / 36:     ....  26.3800  25.6018  25.5118     ....  26.2589  26.8355  27.3067  25.1597  21.8636     ....  26.4242  22.7498
+ 21S   / 35:     ....  26.3962  24.9433  24.4010     ....  25.0882  26.0626  26.7074  25.1090  21.2900     ....  26.0265  22.2924
+ 23S   / 34:     ....  25.5153  23.9938  23.6290     ....  23.7930  24.8873  25.7890  24.6791  21.6500     ....  25.0545  22.3546
+ 25S   / 33:     ....  25.0498  23.4605  22.4263     ....  23.5336  23.1886  24.5767  23.8922  21.0542     ....  24.0368  22.0510
+ 27S   / 32:     ....  24.0579  22.4800  21.3337     ....  22.9638  22.6794  22.9685  23.3845  20.5250     ....  23.4248  21.4712
+ 29S   / 31:     ....  22.2597  20.8924  20.4105     ....  22.1940  21.7986  21.7838  22.1056  20.3556     ....  22.2542  20.3204
+ 31S   / 30:     ....  21.4554  20.1326  19.0221     ....  21.7333  20.2379  20.6162  21.0963  19.7514     ....  21.3928  19.9943
+ 33S   / 29:     ....  20.1174  18.7177  17.8882  17.9775  20.9526  18.9529  18.9267  19.8433  18.7275     ....  19.5163  19.1597
+ 35S   / 28:  17.4848  19.0512  17.2736  16.4823  17.0525  20.2329  17.9626  17.6227  19.3250  17.7730  18.5000  18.2119  17.9181
+ 37S   / 27:  19.0393  18.4096  15.7970  14.9422  15.5643  18.4488  16.9900  16.4614  16.4140  16.1780     ....  17.4080  16.3346
+ 39S   / 26:  19.3745  17.0241  15.1964  13.3975  14.9817  16.2655  15.9971  15.1350  15.1000  15.0855  13.9982  15.9207  14.3391
+ 41S   / 25:  17.5125  14.8843  13.7848  11.6755  13.7962  15.6597  15.2020  13.3413     ....  13.7836  12.0222  14.1123  13.4425
+ 43S   / 24:  14.8667   8.6540  13.1967  10.4214  12.3867  14.4790  14.1935  12.8180     ....  12.5791   9.4489  13.2311  12.1000
+ 45S   / 23:  14.8333     ....  10.7300  10.0000  10.7150  12.2380  12.7589  11.4000     ....  11.8200   8.4016     ....     ....
+ 47S   / 22:     ....     ....   6.0500     ....     ....  11.8750  11.9511  10.9667     ....   9.6250   7.7883   7.6600     ....
+ 49S   / 21:     ....     ....   5.4000     ....     ....  10.7667  11.0757   9.8500     ....   8.9767   7.4821   6.6840     ....
+ 51S   / 20:     ....     ....   2.5333     ....     ....   8.8000     ....   9.2571     ....   7.6900   7.7200   3.7350     ....
+ 53S   / 19:     ....   3.4133     ....     ....     ....   8.4600     ....     ....   5.0000   6.6850   7.1267   1.1217     ....
+ 55S   / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....   6.5000   6.0667   1.4680     ....
+ 57S   / 17:     ....     ....     ....     ....     ....     ....     ....     ....     ....   5.2000   5.2657   1.0000     ....
+ 59S   / 16:     ....     ....  -0.4400     ....     ....     ....     ....     ....     ....     ....   1.5000  -0.8000     ....
+ 61S   / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  -0.4500     ....     ....
+ 63S   / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....   2.0700     ....     ....     ....
+ 65S   / 13:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 67S   / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 69S   / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 71S   / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 73S   /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 75S   /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 77S   /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 79S   /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 81S   /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 83S   /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 85S   /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 87S   /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 89S   /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_negative_t
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.66667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.000000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.0000
+ -2   / 5: -12.0000
+ 0    / 6: -12.0000
+ 2    / 7:  -8.0000
+ 4    / 8:   0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -20.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+ -2   / 5: -40.0000
+ 0    / 6: -40.0000
+ 2    / 7: -36.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.0000
+ -6   / 3: -28.0000
+ -4   / 4: -36.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.0000
+ -8    /  2: -36.0000
+ -6    /  3: -48.0000
+ -4    /  4: -56.0000
+ -2    /  5: -60.0000
+ 0     /  6: -60.0000
+ 2     /  7: -56.0000
+ 4     /  8: -48.0000
+ 6     /  9: -36.0000
+ 8     / 10: -20.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.000000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.000000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -6.00000
+ 0    / 6: -6.00000
+ 2    / 7: -4.00000
+ 4    / 8:  0.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+ -2   / 5: -20.0000
+ 0    / 6: -20.0000
+ 2    / 7: -18.0000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.0000
+ -6   / 3: -14.0000
+ -4   / 4: -18.0000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.0000
+ -8    /  2: -18.0000
+ -6    /  3: -24.0000
+ -4    /  4: -28.0000
+ -2    /  5: -30.0000
+ 0     /  6: -30.0000
+ 2     /  7: -28.0000
+ 4     /  8: -24.0000
+ 6     /  9: -18.0000
+ 8     / 10: -10.0000
+ 10    / 11:   0.0000
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+ 4    / 8:  6.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+ -2   / 5:  0.00000
+ 0    / 6:  2.00000
+ 2    / 7:  4.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.00000
+ -6   / 3: -4.00000
+ -4   / 4: -2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.0000
+ -8    /  2:  -6.0000
+ -6    /  3:  -4.0000
+ -4    /  4:  -2.0000
+ -2    /  5:   0.0000
+ 0     /  6:   2.0000
+ 2     /  7:   4.0000
+ 4     /  8:   6.0000
+ 6     /  9:   8.0000
+ 8     / 10:  10.0000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.0000
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.00000
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+ 4    / 8:  1.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+ -2   / 5:  1.00000
+ 0    / 6:  1.00000
+ 2    / 7:  1.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.00000
+ -6   / 3:  1.00000
+ -4   / 4:  1.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2:  1.00000
+ -6    /  3:  1.00000
+ -4    /  4:  1.00000
+ -2    /  5:  1.00000
+ 0     /  6:  1.00000
+ 2     /  7:  1.00000
+ 4     /  8:  1.00000
+ 6     /  9:  1.00000
+ 8     / 10:  1.00000
+ 10    / 11:  1.00000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.20000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.20000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.20000
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+ 4    / 8:      ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:      ....
+ -6   / 3:      ....
+ -4   / 4:  0.100000
+ -2   / 5:  0.900000
+ 0    / 6:      ....
+ 2    / 7:      ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:      ....
+ -8    /  2:      ....
+ -6    /  3:      ....
+ -4    /  4:  0.100000
+ -2    /  5:  0.900000
+ 0     /  6:      ....
+ 2     /  7:      ....
+ 4     /  8:      ....
+ 6     /  9:      ....
+ 8     / 10:      ....
+ 10    / 11:      ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.00000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  8.00000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.20000
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+ 4    / 8:  4.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -6.00000
+ -4    /  4: -4.00000
+ -2    /  5: -2.00000
+ 0     /  6:  0.00000
+ 2     /  7:  2.00000
+ 4     /  8:  4.00000
+ 6     /  9:  6.00000
+ 8     / 10:  8.00000
+ 10    / 11:  9.00000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+ 4    / 8: -2.00000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+ -2   / 5: -5.00000
+ 0    / 6: -4.00000
+ 2    / 7: -3.00000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -7.00000
+ -4   / 4: -6.00000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.00000
+ -8    /  2: -8.00000
+ -6    /  3: -7.00000
+ -4    /  4: -6.00000
+ -2    /  5: -5.00000
+ 0     /  6: -4.00000
+ 2     /  7: -3.00000
+ 4     /  8: -2.00000
+ 6     /  9: -1.00000
+ 8     / 10:  0.00000
+ 10    / 11:  1.00000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1: -9.00000
+ 692184   /  2: -8.00000
+ 692208   /  3: -7.00000
+ 692232   /  4: -6.00000
+ 692256   /  5: -5.00000
+ 692280   /  6: -4.00000
+ 692304   /  7: -3.00000
+ 692328   /  8: -2.00000
+ 692352   /  9: -1.00000
+ 692376   / 10:  0.00000
+ 692400   / 11:  1.00000
+ 692424   / 12:  2.00000
+ 692448   / 13:  3.00000
+ 692472   / 14:  4.00000
+ 692496   / 15:  5.00000
+ 692520   / 16:  6.00000
+ 692544   / 17:  7.00000
+ 692568   / 18:  8.00000
+ 692592   / 19:  9.00000
+ 692616   / 20:     ....
+ 692640   / 21:     ....
+ 692664   / 22:     ....
+ 692688   / 23:     ....
+ 692712   / 24:     ....
+ 692736   / 25:     ....
+ 692760   / 26:     ....
+ 692784   / 27:     ....
+ 692808   / 28:     ....
+ 692832   / 29:     ....
+ 692856   / 30:     ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T
+             SUBSET   : 30 points (T (HOURS))
+ 692160   /  1:....
+ 692184   /  2:....
+ 692208   /  3:....
+ 692232   /  4:....
+ 692256   /  5:....
+ 692280   /  6:....
+ 692304   /  7:....
+ 692328   /  8:....
+ 692352   /  9:....
+ 692376   / 10:....
+ 692400   / 11:....
+ 692424   / 12:....
+ 692448   / 13:....
+ 692472   / 14:....
+ 692496   / 15:....
+ 692520   / 16:....
+ 692544   / 17:....
+ 692568   / 18:....
+ 692592   / 19:....
+ 692616   / 20:....
+ 692640   / 21:....
+ 692664   / 22:....
+ 692688   / 23:....
+ 692712   / 24:....
+ 692736   / 25:....
+ 692760   / 26:....
+ 692784   / 27:....
+ 692808   / 28:....
+ 692832   / 29:....
+ 692856   / 30:....
+CANCEL MODE ignore_error
+ 
+ 
+!added in bn450 10/97 *kob*
+GO bn_reset
+cancel mode verify
+GO bn_xact_regrid
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.00000
+ 1.5  / 2:     ....
+ 2    / 3:  2.00000
+ 2.5  / 4:     ....
+ 3    / 5:  3.00000
+ 3.5  / 6:     ....
+ 4    / 7:  4.00000
+ 4.5  / 8:     ....
+ 5    / 9:  5.00000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:     ....
+ 1.5  / 2:  1.50000
+ 2    / 3:     ....
+ 2.5  / 4:  2.50000
+ 3    / 5:     ....
+ 3.5  / 6:  3.50000
+ 4    / 7:     ....
+ 4.5  / 8:  4.50000
+ 5    / 9:     ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+ 
+!added in bn450 11/97 *kob*
+! replace w/ bn500 *kob* 5/99
+GO bn_reset
+cancel mode verify
+GO bn_gc_functions
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+               1        2        3        4     
+               1        2        3        4
+ 0.1  / 1:  1.10000  2.10000  3.10000  4.10000
+ 0.2  / 2:  1.20000  2.20000  3.20000  4.20000
+ 0.3  / 3:  1.30000  2.30000  3.30000  4.30000
+ 0.4  / 4:  1.40000  2.40000  3.40000  4.40000
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+               1         2         3         4      
+                1         2         3         4
+ 0.1  / 1:  0.891207  0.863209  0.041581 -0.818277
+ 0.2  / 2:  0.932039  0.808496 -0.058374 -0.871576
+ 0.3  / 3:  0.963558  0.745705 -0.157746 -0.916166
+ 0.4  / 4:  0.985450  0.675463 -0.255541 -0.951602
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.10000
+ 2    /  2:  2.10000
+ 3    /  3:  3.10000
+ 4    /  4:  4.10000
+ 5    /  5:  1.20000
+ 6    /  6:  2.20000
+ 7    /  7:  3.20000
+ 8    /  8:  4.20000
+ 9    /  9:  1.30000
+ 10   / 10:  2.30000
+ 11   / 11:  3.30000
+ 12   / 12:  4.30000
+ 13   / 13:  1.40000
+ 14   / 14:  2.40000
+ 15   / 15:  3.40000
+ 16   / 16:  4.40000
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.45
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.10000
+ 4   / 4:  4.10000
+ 5   / 5:  1.20000
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+               2        3     
+               2        3
+ 0.2  / 2:  2.20000  3.20000
+ 0.3  / 3:  2.30000  3.30000
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.20000
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 4   / 4:  3.30000
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.20000
+ 3   / 3:  2.30000
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+                1        2        3        4     
+                1        2        3        4
+ 0.01  / 1:  2.21000  3.21000  2.31000  3.31000
+ 0.02  / 2:  2.22000  3.22000  2.32000  3.32000
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+               1        2        3     
+               1        2        3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11000  2.11000  3.11000
+ 0.2  / 2:  1.21000  2.21000  3.21000
+ 0.3  / 3:  1.31000  2.31000  3.31000
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12000  2.12000  3.12000
+ 0.2  / 2:  1.22000  2.22000  3.22000
+ 0.3  / 3:  1.32000  2.32000  3.32000
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13000  2.13000  3.13000
+ 0.2  / 2:  1.23000  2.23000  3.23000
+ 0.3  / 3:  1.33000  2.33000  3.33000
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.14000  2.14000  3.14000
+ 0.2  / 2:  1.24000  2.24000  3.24000
+ 0.3  / 3:  1.34000  2.34000  3.34000
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.15000  2.15000  3.15000
+ 0.2  / 2:  1.25000  2.25000  3.25000
+ 0.3  / 3:  1.35000  2.35000  3.35000
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.16000  2.16000  3.16000
+ 0.2  / 2:  1.26000  2.26000  3.26000
+ 0.3  / 3:  1.36000  2.36000  3.36000
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.17000  2.17000  3.17000
+ 0.2  / 2:  1.27000  2.27000  3.27000
+ 0.3  / 3:  1.37000  2.37000  3.37000
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.18000  2.18000  3.18000
+ 0.2  / 2:  1.28000  2.28000  3.28000
+ 0.3  / 3:  1.38000  2.38000  3.38000
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.19000  2.19000  3.19000
+ 0.2  / 2:  1.29000  2.29000  3.29000
+ 0.3  / 3:  1.39000  2.39000  3.39000
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+               1        2        3     
+               1        2        3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.11100  2.11100  3.11100
+ 0.2  / 2:  1.21100  2.21100  3.21100
+ 0.3  / 3:  1.31100  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.12100  2.12100  3.12100
+ 0.2  / 2:  1.22100  2.22100  3.22100
+ 0.3  / 3:  1.32100  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.13100  2.13100  3.13100
+ 0.2  / 2:  1.23100  2.23100  3.23100
+ 0.3  / 3:  1.33100  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.11200  2.11200  3.11200
+ 0.2  / 2:  1.21200  2.21200  3.21200
+ 0.3  / 3:  1.31200  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.12200  2.12200  3.12200
+ 0.2  / 2:  1.22200  2.22200  3.22200
+ 0.3  / 3:  1.32200  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.13200  2.13200  3.13200
+ 0.2  / 2:  1.23200  2.23200  3.23200
+ 0.3  / 3:  1.33200  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.11300  2.11300  3.11300
+ 0.2  / 2:  1.21300  2.21300  3.21300
+ 0.3  / 3:  1.31300  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.12300  2.12300  3.12300
+ 0.2  / 2:  1.22300  2.22300  3.22300
+ 0.3  / 3:  1.32300  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.13300  2.13300  3.13300
+ 0.2  / 2:  1.23300  2.23300  3.23300
+ 0.3  / 3:  1.33300  2.33300  3.33300
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.22200  3.22200
+ 0.3  / 3:  2.32200  3.32200
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.23200  3.23200
+ 0.3  / 3:  2.33200  3.33200
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.21300  3.21300
+ 0.3  / 3:  2.31300  3.31300
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.22300  3.22300
+ 0.3  / 3:  2.32300  3.32300
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.23300  3.23300
+ 0.3  / 3:  2.33300  3.33300
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.21100  3.21100
+ 0.3  / 3:  2.31100  3.31100
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.22100  3.22100
+ 0.3  / 3:  2.32100  3.32100
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+               2        3     
+               2        3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.23100  3.23100
+ 0.3  / 3:  2.33100  3.33100
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.21200  3.21200
+ 0.3  / 3:  2.31200  3.31200
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:  220.777  252.000  293.508  315.000  293.508  252.000  220.777
+ 3    / 2:  210.675  240.469  280.078  300.586  280.078  240.469  210.675
+ 5    / 3:  199.382  227.579  265.064  284.473  265.064  227.579  199.382
+ 7    / 4:  186.579  212.965  248.043  266.206  248.043  212.965  186.579
+ 9    / 5:  171.798  196.094  228.394  245.118  228.394  196.094  171.798
+ 11   / 6:  154.317  176.140  205.154  220.176  205.154  176.140  154.317
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+              -30      -20      -10       0       10       20       30     
+               1        2        3        4        5        6        7
+ 1    / 1:   15.459   13.544   11.629   10.835   11.629   13.544   15.459
+ 3    / 2:   46.534   40.768   35.003   32.614   35.003   40.768   46.534
+ 5    / 3:   77.920   68.266   58.612   54.613   58.612   68.266   77.920
+ 7    / 4:  109.622   96.040   82.458   76.832   82.458   96.040  109.622
+ 9    / 5:  141.642  124.093  106.544   99.274  106.544  124.093  141.642
+ 11   / 6:  173.985  152.428  130.872  121.943  130.872  152.428  173.985
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30      -20      -10       0       10       20       30     
+                 1        2        3        4        5        6        7
+ 0      / 1:     ....     ....     ....     ....     ....     ....     ....
+ 50     / 2:  209.428  236.141  270.541  287.852  270.541  236.141  209.428
+ 100    / 3:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 150    / 4:  167.281  177.850     ....     ....     ....  177.850  167.281
+ 200    / 5:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  219.301  249.266  288.698  308.935  288.698  249.266  219.301
+ 40     /  3:  212.799  240.795  276.900  295.177  276.900  240.795  212.799
+ 60     /  4:  205.830  231.454  264.073  280.044  264.073  231.454  205.830
+ 80     /  5:  198.542  221.405  249.798  263.229  249.798  221.405  198.542
+ 100    /  6:  190.465  210.583  233.732  244.319  233.732  210.583  190.465
+ 120    /  7:  181.788  198.556  215.539  222.313  215.539  198.556  181.788
+ 140    /  8:  172.556  184.892     ....     ....     ....  184.892  172.556
+ 160    /  9:  161.876     ....     ....     ....     ....     ....  161.876
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                 -30      -20      -10       0       10       20       30     
+                  1        2        3        4        5        6        7
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....
+ 20     /  2:  1.14612  1.23714  1.35815  1.42080  1.35815  1.23714  1.14612
+ 40     /  3:  1.78974  1.97179  2.21167  2.33573  2.21167  1.97179  1.78974
+ 60     /  4:  2.42905  2.69940  3.05822  3.24246  3.05822  2.69940  2.42905
+ 80     /  5:  3.06561  3.42249  3.89693  4.14116  3.89693  3.42249  3.06561
+ 100    /  6:  3.69649  4.14116  4.72832  5.03201  4.72832  4.14116  3.69649
+ 120    /  7:  4.32411  4.85410  5.55312  5.91430  5.55312  4.85410  4.32411
+ 140    /  8:  4.94871  5.56139     ....     ....     ....  5.56139  4.94871
+ 160    /  9:  5.56760     ....     ....     ....     ....     ....  5.56760
+ 180    / 10:     ....     ....     ....     ....     ....     ....     ....
+ 200    / 11:     ....     ....     ....     ....     ....     ....     ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  5.56760
+ -20   / 2:  5.56139
+ -10   / 3:  5.55312
+ 0     / 4:  5.91430
+ 10    / 5:  5.55312
+ 20    / 6:  5.56139
+ 30    / 7:  5.56760
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:  163.058
+ -20   / 2:  186.117
+ -10   / 3:  216.774
+ 0     / 4:  232.647
+ 10    / 5:  216.774
+ 20    / 6:  186.117
+ 30    / 7:  163.058
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   1.1817
+ -20   / 2:   1.2249
+ -10   / 3:   1.2346
+ 0     / 4:  10.3336
+ 10    / 5:   1.2346
+ 20    / 6:   1.2249
+ 30    / 7:   1.1817
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 10
+             T (HOURS): 1
+                0     
+                6
+ -30   / 1:   7.6679
+ -20   / 2:   9.6753
+ -10   / 3:  10.7875
+ 0     / 4:  10.3336
+ 10    / 5:  10.7875
+ 20    / 6:   9.6753
+ 30    / 7:   7.6679
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+ 
+!added in bn491 - originally had this in run_all, but moved it here to
+! properly echo commands  *kob*
+GO bn_reset
+cancel mode verify
+set mode verify  ! somehow this was off
+ 
+GO bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+can viewport
+can win/all
+set window 1
+ 
+!netcdf write error
+GO err490_cdf_childax
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+ 
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+!
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+ 
+ 
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+ 
+message/continue ********File successfully written******
+********File successfully written******
+ 
+ 
+! command parser
+GO bn_reset
+cancel mode verify
+GO err490_command_parser
+! err490_command_parser.jnl 12/1/98 - reported by billy kessler
+ 
+! ERROR Fixed:  command parser fix
+! the following caused an abort of ferret to occur
+!
+! routines modifed:  gnl/parse_command.F
+!	     	     rpn/init_uvar_sub.F
+!                    common/xvariables.cmn
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+label/nou `($ppl$xlen)-.3`  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ !-> PPL %LABEL/nou 8.44  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+ 
+! the following also caused an abort of ferret
+let sstb = if ( (i eq 172 and j eq 36) or (i ge 173 and i le 175 and j eq 35) or (i ge 176 and i le 178 and j eq 36) or (i eq 178 and j eq 35) ) then 1.e35 else sst
+message/continue ****Variable defined successfully******
+****Variable defined successfully******
+ 
+ 
+! tilde error
+!GO bn_reset
+!GO err490_tilde
+ 
+ 
+!repeat error
+GO bn_reset
+cancel mode verify
+GO err490_repeat_first_echo
+! err490_repeat_first_echo (created later 23/98)
+ 
+! for the first REPEAT loop on T the formatting of the "verify" output
+! is based on the last previous command given
+ 
+! fixed 1/98 sh&kob
+!  relevant routines (bug not yet fixed)
+!		       gnl/cs_command.F
+!                      xeq/xeq_repeat.F
+!                      ctx/cs_set_context.F
+ 
+set mode calendar
+can mode interp
+ 
+! cause the "last" command to be non-calendar
+stat t[t=15]
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+ 
+! now note the first loop echo
+set mode verify
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.42017
+ 14   / 14:  1.41077
+ 15   / 15:  2.06106
+ 16   / 16:  1.77316
+ 17   / 17:  0.81176
+ 18   / 18:  0.06077
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.693528
+ 12   / 12: -0.372132
+ 13   / 13:  0.291400
+ 14   / 14:  0.687021
+ 15   / 15:  0.450997
+ 16   / 16: -0.199671
+ 17   / 17: -0.666763
+ 18   / 18: -0.520836
+ 19   / 19:  0.103945
+ 20   / 20:  0.633159
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.99999
+ 12   / 12: -1.53656
+ 13   / 13: -1.11640
+ 14   / 14: -0.12579
+ 15   / 15:  0.52450
+ 16   / 16:  0.23660
+ 17   / 17: -0.72480
+ 18   / 18: -1.47579
+ 19   / 19: -1.32591
+ 20   / 20: -0.41297
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:     ....
+ -8    /  2: -8.00000
+ -6    /  3:     ....
+ -4    /  4: -4.00000
+ -2    /  5:     ....
+ 0     /  6:  0.00000
+ 2     /  7:     ....
+ 4     /  8:  4.00000
+ 6     /  9:     ....
+ 8     / 10:  8.00000
+ 10    / 11:     ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ -4   / 4: -4.00000
+ -2   / 5: -2.00000
+ 0    / 6:  0.00000
+ 2    / 7:  2.00000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.00000
+ -6   / 3: -6.00000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.19333
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME4     TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.0000
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.51W  135.469W 135.429W 135.389W 135.348W 135.308W 135.267W 135.227W 135.187W 135.146W 135.106W 135.066W 
+                     1        4        7       10       13       16       19       22       25       28       31       34
+ 59.4667N / 127:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4599N / 126:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.453N  / 125:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4462N / 124:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97638     ....
+ 59.4394N / 123:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4325N / 122:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4257N / 121:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.4189N / 120:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.412N  / 119:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.4052N / 118:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3983N / 117:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97500     ....     ....
+ 59.3915N / 116:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97528     ....     ....
+ 59.3846N / 115:     ....     ....     ....     ....     ....     ....     ....     ....     ....  2.97555     ....     ....
+ 59.3778N / 114:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3709N / 113:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3641N / 112:     ....     ....     ....     ....     ....     ....     ....     ....  2.98572     ....     ....     ....
+ 59.3572N / 111:     ....     ....     ....     ....     ....     ....     ....     ....  2.98764     ....     ....     ....
+ 59.3504N / 110:     ....     ....     ....     ....     ....     ....     ....     ....  2.98791     ....     ....     ....
+ 59.3435N / 109:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3366N / 108:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 59.3298N / 107:     ....     ....     ....     ....     ....     ....     ....  2.98599     ....     ....     ....     ....
+ 59.3229N / 106:     ....     ....     ....     ....  2.98956     ....     ....  2.98709     ....     ....     ....     ....
+ 59.3161N / 105:     ....     ....     ....     ....  2.98901     ....     ....  2.98627     ....     ....     ....     ....
+ 59.3092N / 104:     ....     ....     ....     ....  2.98846     ....  2.98379  2.98517     ....     ....     ....     ....
+ 59.3023N / 103:     ....     ....     ....     ....     ....  2.98379  2.98297  2.98407     ....     ....     ....     ....
+ 59.2955N / 102:     ....     ....     ....     ....     ....  2.98297     ....  2.98270     ....     ....     ....     ....
+ 59.2886N / 101:     ....  2.99863     ....     ....     ....  2.98297  2.98077  2.98105     ....     ....     ....     ....
+ 59.2817N / 100:     ....     ....  2.98956     ....     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2748N /  99:     ....     ....  2.99149     ....     ....  2.98462  2.98050     ....     ....     ....     ....     ....
+ 59.268N  /  98:     ....     ....  2.99341     ....     ....  2.98462  2.97967     ....     ....     ....     ....     ....
+ 59.2611N /  97:     ....     ....  2.99561     ....     ....     ....  2.97967     ....     ....     ....     ....     ....
+ 59.2542N /  96:     ....     ....  2.99615  3.00055     ....     ....  2.98132     ....     ....     ....     ....     ....
+ 59.2473N /  95:     ....     ....  2.99643  2.99945     ....  2.98434  2.98709     ....     ....     ....     ....     ....
+ 59.2405N /  94:     ....     ....     ....  2.99753     ....  2.98572  2.99286     ....     ....     ....     ....     ....
+ 59.2336N /  93:     ....     ....     ....  2.99561  2.99588  2.98627  2.99313     ....     ....     ....     ....     ....
+ 59.2267N /  92:     ....     ....     ....  2.99396  2.99451     ....  2.99588  2.99588     ....     ....     ....     ....
+ 59.2198N /  91:     ....     ....     ....  2.99231  2.99341     ....  2.99643  2.99698     ....     ....     ....     ....
+ 59.2129N /  90:     ....     ....     ....  2.99039  2.99176     ....  2.99561  2.99780     ....     ....     ....     ....
+ 59.2061N /  89:     ....     ....     ....  2.98984  2.99231     ....  2.99396  2.99725     ....     ....     ....     ....
+ 59.1992N /  88:     ....     ....     ....  2.98984  2.99176     ....     ....  2.99368     ....     ....     ....     ....
+ 59.1923N /  87:     ....     ....     ....     ....  2.99203     ....     ....  2.99039     ....     ....     ....     ....
+ 59.1854N /  86:     ....     ....     ....     ....  2.99451     ....     ....  2.98956     ....     ....     ....     ....
+ 59.1785N /  85:     ....     ....     ....  2.99313  2.99670  2.99918     ....  2.98956     ....     ....     ....     ....
+ 59.1716N /  84:     ....     ....     ....  2.99423  2.99808     ....     ....  2.99066     ....     ....     ....     ....
+ 59.1647N /  83:     ....     ....     ....  2.99561  2.99780  3.00494     ....  2.99149     ....     ....     ....     ....
+ 59.1578N /  82:     ....     ....     ....  2.99588  2.99835     ....     ....  2.99286     ....     ....     ....     ....
+ 59.1509N /  81:     ....     ....     ....  2.99588  2.99945     ....  2.99506  2.99423     ....     ....     ....     ....
+ 59.144N  /  80:     ....     ....     ....     ....  2.99973     ....  2.99561  2.99396     ....     ....     ....     ....
+ 59.1371N /  79:     ....     ....     ....     ....  2.99973     ....  2.99643  2.99396     ....     ....     ....     ....
+ 59.1302N /  78:     ....     ....     ....     ....  3.00055     ....  2.99808  2.99451     ....     ....     ....     ....
+ 59.1233N /  77:     ....     ....     ....     ....  3.00247     ....  3.00027  2.99561     ....     ....     ....     ....
+ 59.1164N /  76:     ....     ....     ....     ....  3.00385     ....  3.00110  2.99670     ....     ....     ....     ....
+ 59.1095N /  75:     ....     ....     ....     ....     ....  3.00330  3.00275  2.99753     ....     ....     ....     ....
+ 59.1026N /  74:     ....     ....     ....     ....     ....  3.00192     ....  2.99808     ....     ....     ....     ....
+ 59.0957N /  73:     ....     ....     ....     ....  2.99643  3.00027     ....  2.99973     ....     ....     ....     ....
+ 59.0888N /  72:     ....     ....     ....     ....  2.99615  3.00000     ....  3.00082     ....     ....     ....     ....
+ 59.0819N /  71:     ....     ....     ....     ....  2.99670  3.00055  3.00412  3.00110     ....     ....     ....     ....
+ 59.075N  /  70:     ....     ....     ....     ....  2.99780  3.00137  3.00302  3.00137     ....     ....     ....     ....
+ 59.0681N /  69:     ....     ....     ....     ....  2.99890  3.00137  3.00082  3.00055     ....     ....     ....     ....
+ 59.0612N /  68:     ....     ....     ....     ....  2.99863  3.00000     ....  2.99780     ....     ....     ....     ....
+ 59.0542N /  67:     ....     ....     ....     ....  2.99835  2.99780     ....  2.99533     ....     ....     ....     ....
+ 59.0473N /  66:     ....     ....     ....     ....  2.99808  2.99615     ....  2.99341     ....     ....     ....     ....
+ 59.0404N /  65:     ....     ....     ....     ....  2.99780  2.99588  2.99368  2.99094     ....     ....     ....     ....
+ 59.0335N /  64:     ....     ....     ....  2.99835  2.99753  2.99506  2.99286  2.98791     ....     ....     ....     ....
+ 59.0266N /  63:     ....     ....     ....  2.99780     ....  2.99396  2.99039  2.98599     ....     ....     ....     ....
+ 59.0196N /  62:     ....     ....     ....  2.99698     ....  2.99258     ....  2.98324     ....     ....     ....     ....
+ 59.0127N /  61:     ....     ....     ....  2.99561     ....  2.99203  2.98572  2.97995     ....     ....     ....     ....
+ 59.0058N /  60:     ....     ....     ....  2.99423     ....  2.99121  2.98572  2.97748     ....     ....     ....     ....
+ 58.9989N /  59:     ....     ....     ....  2.99506     ....  2.99094  2.98572  2.97748     ....     ....     ....     ....
+ 58.9919N /  58:     ....     ....     ....  2.99808     ....  2.99066  2.98489  2.97748     ....     ....     ....     ....
+ 58.985N  /  57:     ....     ....     ....  3.00027     ....  2.99011  2.98407  2.97720     ....     ....     ....     ....
+ 58.9781N /  56:     ....     ....     ....  3.00055     ....  2.98929  2.98160  2.97720     ....     ....     ....     ....
+ 58.9711N /  55:     ....     ....     ....  3.00000     ....  2.98819  2.97693  2.97638     ....     ....     ....     ....
+ 58.9642N /  54:     ....     ....     ....  2.99863     ....  2.98736  2.97775  2.97198     ....     ....     ....     ....
+ 58.9573N /  53:     ....     ....     ....  2.99670     ....  2.98682  2.97803  2.96512     ....     ....     ....     ....
+ 58.9503N /  52:     ....     ....     ....  2.99588  2.99203  2.98654  2.97830  2.96676     ....     ....     ....     ....
+ 58.9434N /  51:     ....     ....     ....  2.99588  2.99231  2.98654  2.97748  2.96814     ....     ....     ....     ....
+ 58.9365N /  50:     ....     ....     ....  2.99780  2.99258  2.98627  2.97665     ....     ....     ....     ....     ....
+ 58.9295N /  49:     ....     ....     ....     ....  2.99231  2.98572  2.97638     ....     ....     ....     ....     ....
+ 58.9226N /  48:     ....     ....     ....     ....  2.99286  2.98544  2.97610     ....     ....     ....     ....     ....
+ 58.9156N /  47:     ....     ....     ....  2.99478  2.99423  2.98544  2.97528     ....     ....     ....     ....     ....
+ 58.9087N /  46:     ....     ....     ....  2.99533  2.99368  2.98517  2.97500     ....     ....     ....     ....     ....
+ 58.9017N /  45:     ....     ....     ....  2.99506  2.99286  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8948N /  44:     ....     ....     ....  2.99533  2.99231  2.98489  2.97528     ....     ....     ....     ....     ....
+ 58.8878N /  43:     ....     ....     ....  2.99615  2.99176  2.98462  2.97555     ....     ....     ....     ....     ....
+ 58.8809N /  42:     ....     ....     ....  2.99698  2.99258  2.98489  2.97638     ....     ....     ....     ....     ....
+ 58.8739N /  41:     ....     ....     ....  2.99698  2.99341  2.98544  2.97555     ....     ....     ....     ....     ....
+ 58.867N  /  40:     ....     ....     ....  2.99698  2.99341  2.98544  2.97418     ....     ....     ....     ....     ....
+ 58.86N   /  39:     ....     ....     ....  2.99753  2.99368  2.98544  2.97171     ....     ....     ....     ....     ....
+ 58.8531N /  38:     ....     ....     ....  2.99835  2.99368  2.98572  2.96786     ....     ....     ....     ....     ....
+ 58.8461N /  37:     ....     ....     ....  2.99863  2.99368  2.98572  2.96621     ....     ....     ....     ....     ....
+ 58.8392N /  36:     ....     ....     ....  2.99890  2.99368  2.98517  2.96814     ....     ....     ....     ....     ....
+ 58.8322N /  35:     ....     ....     ....     ....  2.99313  2.98379  2.97061     ....     ....     ....     ....     ....
+ 58.8252N /  34:     ....     ....     ....     ....  2.99258  2.98215  2.96896     ....     ....     ....     ....     ....
+ 58.8183N /  33:     ....     ....     ....     ....  2.99121  2.98160  2.96814     ....     ....     ....     ....     ....
+ 58.8113N /  32:     ....     ....     ....     ....  2.99094  2.98242  2.96869     ....     ....     ....  2.93408  2.92254
+ 58.8043N /  31:     ....     ....     ....     ....  2.99341  2.98297  2.96759     ....     ....     ....  2.93463     ....
+ 58.7974N /  30:     ....     ....     ....  3.00247  2.99286  2.98242  2.96621  2.94754     ....     ....  2.93545     ....
+ 58.7904N /  29:     ....     ....     ....     ....  2.99149  2.98105  2.96567  2.94809     ....     ....     ....     ....
+ 58.7834N /  28:     ....     ....     ....     ....  2.99094  2.97967  2.96512  2.94644     ....     ....  2.96374     ....
+ 58.7765N /  27:     ....     ....     ....     ....  2.98956  2.97748  2.96347  2.94864     ....     ....  2.95880     ....
+ 58.7695N /  26:     ....     ....     ....     ....  2.98874  2.97940  2.96484  2.95440     ....  2.94781  2.95660     ....
+ 58.7625N /  25:     ....     ....     ....     ....  2.98846  2.98187  2.96869  2.95990     ....  2.95166  2.95495     ....
+ 58.7555N /  24:     ....     ....     ....     ....  2.98791  2.98160  2.96896  2.96264     ....  2.95358  2.95303     ....
+ 58.7486N /  23:     ....     ....     ....  2.98682  2.98627  2.97940  2.96841  2.96127     ....  2.95440  2.95056     ....
+ 58.7416N /  22:     ....     ....     ....  2.98544  2.98462  2.97693  2.96731  2.95935     ....  2.95276  2.94616     ....
+ 58.7346N /  21:     ....     ....     ....  2.98352  2.98297  2.97500  2.96484  2.95797  2.95166  2.94919  2.94507     ....
+ 58.7276N /  20:     ....     ....     ....     ....  2.98160  2.97226  2.96292  2.95605  2.95138  2.94644  2.94232     ....
+ 58.7206N /  19:     ....     ....     ....     ....  2.97995  2.96896  2.96209  2.95578  2.95056  2.94452     ....     ....
+ 58.7137N /  18:     ....     ....     ....     ....  2.97858  2.97088  2.96292  2.95440  2.94891  2.94424     ....     ....
+ 58.7067N /  17:     ....     ....     ....     ....  2.97775  2.97391  2.96402  2.95331  2.94699  2.94561     ....     ....
+ 58.6997N /  16:     ....     ....     ....     ....  2.97748  2.97446  2.96457  2.95248  2.94507  2.94616     ....     ....
+ 58.6927N /  15:     ....     ....     ....     ....  2.97803  2.97446  2.96457  2.95056  2.94424  2.94699     ....     ....
+ 58.6857N /  14:     ....     ....     ....     ....  2.97967  2.97446  2.96567  2.94836  2.94397  2.94726     ....     ....
+ 58.6787N /  13:     ....     ....     ....     ....  2.98050  2.97500  2.96924  2.95193  2.94534  2.94864     ....     ....
+ 58.6717N /  12:     ....     ....     ....     ....  2.98215  2.97638  2.96814  2.95550  2.94424  2.95193     ....     ....
+ 58.6647N /  11:     ....     ....     ....     ....  2.98270  2.97830  2.96539  2.94919     ....  2.95248     ....     ....
+ 58.6577N /  10:     ....     ....     ....     ....  2.98215  2.97885  2.96594  2.94534     ....     ....     ....     ....
+ 58.6507N /   9:     ....     ....     ....  2.98160  2.97995  2.97500  2.97088  2.95331     ....     ....     ....     ....
+ 58.6437N /   8:     ....     ....     ....     ....  2.97967  2.97116  2.97198  2.95852     ....     ....     ....     ....
+ 58.6367N /   7:     ....     ....     ....     ....  2.98160  2.97500  2.96841  2.96017     ....     ....     ....     ....
+ 58.6297N /   6:     ....     ....     ....     ....  2.98132  2.97693  2.96896  2.96292  2.94946     ....     ....     ....
+ 58.6227N /   5:     ....     ....     ....     ....  2.98160  2.97665  2.97143  2.96155  2.95221     ....     ....     ....
+ 58.6157N /   4:     ....     ....     ....     ....  2.96951  2.96814  2.96484  2.95660  2.95138     ....     ....     ....
+ 58.6087N /   3:     ....     ....     ....     ....  2.95276  2.95138  2.94397  2.96127  2.94644     ....     ....     ....
+ 58.6017N /   2:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 58.5947N /   1:     ....     ....     ....     ....  2.93957  2.93957  2.93957  2.93957  2.93957     ....     ....     ....
+ 
+ 
+! ******** V500 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_odd_variable_name
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.041581
+ 2    /  2: -0.058374
+ 3    /  3: -0.157746
+ 4    /  4: -0.255541
+ 5    /  5: -0.350783
+ 6    /  6: -0.442520
+ 7    /  7: -0.529836
+ 8    /  8: -0.611858
+ 9    /  9: -0.687766
+ 10   / 10: -0.756802
+ 11   / 11: -0.818277
+ 12   / 12: -0.871576
+ 13   / 13: -0.916166
+ 14   / 14: -0.951602
+ 15   / 15: -0.977530
+ 16   / 16: -0.993691
+ 17   / 17: -0.999923
+ 18   / 18: -0.996165
+ 19   / 19: -0.982453
+ 20   / 20: -0.958924
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.891207
+ 2    /  2:  0.932039
+ 3    /  3:  0.963558
+ 4    /  4:  0.985450
+ 5    /  5:  0.997495
+ 6    /  6:  0.999574
+ 7    /  7:  0.991665
+ 8    /  8:  0.973848
+ 9    /  9:  0.946300
+ 10   / 10:  0.909297
+ 11   / 11:  0.863209
+ 12   / 12:  0.808496
+ 13   / 13:  0.745705
+ 14   / 14:  0.675463
+ 15   / 15:  0.598472
+ 16   / 16:  0.515501
+ 17   / 17:  0.427380
+ 18   / 18:  0.334988
+ 19   / 19:  0.239249
+ 20   / 20:  0.141120
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.863209
+ 2    /  2:  0.808496
+ 3    /  3:  0.745705
+ 4    /  4:  0.675463
+ 5    /  5:  0.598472
+ 6    /  6:  0.515501
+ 7    /  7:  0.427380
+ 8    /  8:  0.334988
+ 9    /  9:  0.239249
+ 10   / 10:  0.141120
+ 11   / 11:  0.041581
+ 12   / 12: -0.058374
+ 13   / 13: -0.157746
+ 14   / 14: -0.255541
+ 15   / 15: -0.350783
+ 16   / 16: -0.442520
+ 17   / 17: -0.529836
+ 18   / 18: -0.611858
+ 19   / 19: -0.687766
+ 20   / 20: -0.756802
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.925815
+ 2    /  2: -0.883455
+ 3    /  3: -0.832267
+ 4    /  4: -0.772764
+ 5    /  5: -0.705540
+ 6    /  6: -0.631267
+ 7    /  7: -0.550686
+ 8    /  8: -0.464602
+ 9    /  9: -0.373877
+ 10   / 10: -0.279415
+ 11   / 11: -0.182163
+ 12   / 12: -0.083090
+ 13   / 13:  0.016814
+ 14   / 14:  0.116549
+ 15   / 15:  0.215120
+ 16   / 16:  0.311541
+ 17   / 17:  0.404850
+ 18   / 18:  0.494114
+ 19   / 19:  0.578440
+ 20   / 20:  0.656987
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.818277
+ 2    /  2: -0.871576
+ 3    /  3: -0.916166
+ 4    /  4: -0.951602
+ 5    /  5: -0.977530
+ 6    /  6: -0.993691
+ 7    /  7: -0.999923
+ 8    /  8: -0.996165
+ 9    /  9: -0.982453
+ 10   / 10: -0.958924
+ 11   / 11: -0.925815
+ 12   / 12: -0.883455
+ 13   / 13: -0.832267
+ 14   / 14: -0.772764
+ 15   / 15: -0.705540
+ 16   / 16: -0.631267
+ 17   / 17: -0.550686
+ 18   / 18: -0.464602
+ 19   / 19: -0.373877
+ 20   / 20: -0.279415
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.84963
+ 2    /  2: -0.99041
+ 3    /  3: -1.12130
+ 4    /  4: -1.24099
+ 5    /  5: -1.34828
+ 6    /  6: -1.44209
+ 7    /  7: -1.52150
+ 8    /  8: -1.58571
+ 9    /  9: -1.63407
+ 10   / 10: -1.66610
+ 11   / 11: -1.68149
+ 12   / 12: -1.68007
+ 13   / 13: -1.66187
+ 14   / 14: -1.62707
+ 15   / 15: -1.57600
+ 16   / 16: -1.50919
+ 17   / 17: -1.42730
+ 18   / 18: -1.33115
+ 19   / 19: -1.22170
+ 20   / 20: -1.10004
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.730346
+ 7    /  7: -0.736317
+ 8    /  8: -0.732716
+ 9    /  9: -0.719579
+ 10   / 10: -0.697038
+ 11   / 11: -0.665317
+ 12   / 12: -0.624734
+ 13   / 13: -0.575694
+ 14   / 14: -0.518687
+ 15   / 15: -0.454283
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.441047
+ 7    /  7: -0.528071
+ 8    /  8: -0.609820
+ 9    /  9: -0.685476
+ 10   / 10: -0.754282
+ 11   / 11: -0.815552
+ 12   / 12: -0.868673
+ 13   / 13: -0.913115
+ 14   / 14: -0.948433
+ 15   / 15: -0.974274
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.996244
+ 7    /  7:  0.988362
+ 8    /  8:  0.970604
+ 9    /  9:  0.943148
+ 10   / 10:  0.906269
+ 11   / 11:  0.860334
+ 12   / 12:  0.805804
+ 13   / 13:  0.743222
+ 14   / 14:  0.673213
+ 15   / 15:  0.596479
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.25425
+ 2    /  2:  0.22114
+ 3    /  3:  0.19991
+ 4    /  4:  0.19245
+ 5    /  5:  0.20137
+ 6    /  6:  0.23088
+ 7    /  7:  0.28859
+ 8    /  8:  0.39076
+ 9    /  9:  0.58026
+ 10   / 10:  1.02106
+ 11   / 11:  3.45512
+ 12   / 12: -2.30685
+ 13   / 13: -0.72568
+ 14   / 14: -0.31668
+ 15   / 15: -0.09228
+ 16   / 16:  0.07275
+ 17   / 17:  0.21342
+ 18   / 18:  0.34296
+ 19   / 19:  0.46716
+ 20   / 20:  0.58869
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.0415808
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.999574
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.0799809
+ 6    /  6: -0.0855462
+ 7    /  7: -0.0902566
+ 8    /  8: -0.0940653
+ 9    /  9: -0.0969341
+ 10   / 10: -0.0988342
+ 11   / 11: -0.0997471
+ 12   / 12: -0.0996632
+ 13   / 13: -0.0985835
+ 14   / 14: -0.0965188
+ 15   / 15: -0.0934896
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_stream
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   2.0000
+ 2   / 2:   3.0000   4.0000
+ 3   / 3:   5.0000   6.0000
+ ---- L:2 T:   2
+ 1   / 1:   7.0000   8.0000
+ 2   / 2:   9.0000  10.0000
+ 3   / 3:  11.0000  12.0000
+ ---- L:3 T:   3
+ 1   / 1:  13.0000  14.0000
+ 2   / 2:  15.0000  16.0000
+ 3   / 3:  17.0000  18.0000
+ ---- L:4 T:   4
+ 1   / 1:  19.0000  20.0000
+ 2   / 2:  21.0000  22.0000
+ 3   / 3:  23.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  26.0000
+ 2   / 2:  27.0000  28.0000
+ 3   / 3:  29.0000  30.0000
+ ---- L:2 T:   2
+ 1   / 1:  31.0000  32.0000
+ 2   / 2:  33.0000  34.0000
+ 3   / 3:  35.0000  36.0000
+ ---- L:3 T:   3
+ 1   / 1:  37.0000  38.0000
+ 2   / 2:  39.0000  40.0000
+ 3   / 3:  41.0000  42.0000
+ ---- L:4 T:   4
+ 1   / 1:  43.0000  44.0000
+ 2   / 2:  45.0000  46.0000
+ 3   / 3:  47.0000  48.0000
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000  13.0000
+ 2   / 2:   5.0000  17.0000
+ 3   / 3:   9.0000  21.0000
+ ---- L:2 T:   2
+ 1   / 1:   2.0000  14.0000
+ 2   / 2:   6.0000  18.0000
+ 3   / 3:  10.0000  22.0000
+ ---- L:3 T:   3
+ 1   / 1:   3.0000  15.0000
+ 2   / 2:   7.0000  19.0000
+ 3   / 3:  11.0000  23.0000
+ ---- L:4 T:   4
+ 1   / 1:   4.0000  16.0000
+ 2   / 2:   8.0000  20.0000
+ 3   / 3:  12.0000  24.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  25.0000  37.0000
+ 2   / 2:  29.0000  41.0000
+ 3   / 3:  33.0000  45.0000
+ ---- L:2 T:   2
+ 1   / 1:  26.0000  38.0000
+ 2   / 2:  30.0000  42.0000
+ 3   / 3:  34.0000  46.0000
+ ---- L:3 T:   3
+ 1   / 1:  27.0000  39.0000
+ 2   / 2:  31.0000  43.0000
+ 3   / 3:  35.0000  47.0000
+ ---- L:4 T:   4
+ 1   / 1:  28.0000  40.0000
+ 2   / 2:  32.0000  44.0000
+ 3   / 3:  36.0000  48.0000
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   1.0000   3.0000
+ 2   / 2:   5.0000   7.0000
+ 3   / 3:   9.0000  11.0000
+ ---- L:2 T:   2
+ 1   / 1:  13.0000  15.0000
+ 2   / 2:  17.0000  19.0000
+ 3   / 3:  21.0000  23.0000
+ ---- L:3 T:   3
+ 1   / 1:  25.0000  27.0000
+ 2   / 2:  29.0000  31.0000
+ 3   / 3:  33.0000  35.0000
+ ---- L:4 T:   4
+ 1   / 1:  37.0000  39.0000
+ 2   / 2:  41.0000  43.0000
+ 3   / 3:  45.0000  47.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   2.0000   4.0000
+ 2   / 2:   6.0000   8.0000
+ 3   / 3:  10.0000  12.0000
+ ---- L:2 T:   2
+ 1   / 1:  14.0000  16.0000
+ 2   / 2:  18.0000  20.0000
+ 3   / 3:  22.0000  24.0000
+ ---- L:3 T:   3
+ 1   / 1:  26.0000  28.0000
+ 2   / 2:  30.0000  32.0000
+ 3   / 3:  34.0000  36.0000
+ ---- L:4 T:   4
+ 1   / 1:  38.0000  40.0000
+ 2   / 2:  42.0000  44.0000
+ 3   / 3:  46.0000  48.0000
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:  24.0000  25.0000
+ 2   / 2:  26.0000  27.0000
+ 3   / 3:  28.0000  29.0000
+ ---- L:2 T:   2
+ 1   / 1:  30.0000  31.0000
+ 2   / 2:  32.0000  33.0000
+ 3   / 3:  34.0000  35.0000
+ ---- L:3 T:   3
+ 1   / 1:  36.0000  37.0000
+ 2   / 2:  38.0000  39.0000
+ 3   / 3:  40.0000  41.0000
+ ---- L:4 T:   4
+ 1   / 1:  42.0000  43.0000
+ 2   / 2:  44.0000  45.0000
+ 3   / 3:  46.0000  47.0000
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ 1   / 1:   0.0000   1.0000
+ 2   / 2:   2.0000   3.0000
+ 3   / 3:   4.0000   5.0000
+ ---- L:2 T:   2
+ 1   / 1:   6.0000   7.0000
+ 2   / 2:   8.0000   9.0000
+ 3   / 3:  10.0000  11.0000
+ ---- L:3 T:   3
+ 1   / 1:  12.0000  13.0000
+ 2   / 2:  14.0000  15.0000
+ 3   / 3:  16.0000  17.0000
+ ---- L:4 T:   4
+ 1   / 1:  18.0000  19.0000
+ 2   / 2:  20.0000  21.0000
+ 3   / 3:  22.0000  23.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_define_axes
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_external_functions  ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_pattern
+! pattern_bench.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+ 
+set view full
+ 
+use coads_climatology
+set reg/l=3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+ 
+! Note that colors are set in the usual way...
+ 
+set win 1
+ 
+set mode meta pattern_plot1.plt
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns/nolabel sst
+ 
+go land thick
+ 
+! Colors and patterns can be overlaid; patterns are transparent
+ 
+set win 2
+ 
+set data coads_climatology
+set data clim_airt_lev.cdf
+set reg/l=1:3/y=50s:60n/x=100e:60w
+set mode cal months
+ 
+set mode meta pattern_plot2.plt
+fill/lev=(0,33,3)/nolabel sst[l=@ave,d=1]
+ 
+fill/lev=(25,27,1)/over/nolab/pal=black/pat=angled_grid/nolabel airt[l=@ave]
+label/user,200,-30,-1,0,.15, at trAIRT gt 25 and lt 27 deg. C
+ 
+go land thick
+ 
+!can data/all
+can win 2
+set win 1
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn_polygon
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+ 
+GO bn_reset
+cancel mode verify
+GO bn500_bug_fixes
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.0000
+ 2   / 2:  20.0000
+ 3   / 3:  30.0000
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G012)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Wed Mar 26 15:38:06 PDT 2014
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+ 
+! ******** V510 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sample			! internal (optimized) SAMPLE* functions
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : JAN
+               79E      99E     119E    
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  28.5769  28.5925  28.1495
+ 1S   / 45:  28.3343  28.7146  28.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  29.1373  28.9243  28.3264
+ 1S   / 45:  28.8965  28.8240  28.5357
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : JAN
+                2     
+                2
+ 1N   / 46:  28.1992
+ 1S   / 45:  28.5607
+ -DELETE (C01,V02 M: 34 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 25 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 28 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 31 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992  28.4514
+ 1S   / 45:  28.1514  28.5607  28.8326
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 34 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 32 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N   / 46:  28.2222  28.1992     ....
+ 1S   / 45:  28.1514  28.5607     ....
+cancel memory/all
+ -DELETE A        M: 26 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 26 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 27 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 34 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE SST      M: 28 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 32 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 33 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : JAN
+                1     
+                1
+ 1N   / 46:  28.2222
+ 1S   / 45:  28.1514
+cancel memory/all
+ -DELETE A        M: 27 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 32 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 33 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=20E:20E(380)@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[X=20E:20E(380)@IIN,D=1]
+ -DELETE          M: 32 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 33 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 23 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 34 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                 1           2           3       
+                  1           2           3
+ 1N   / 46:  182881720.  245818833.  306844239.
+ 1S   / 45:  183667676.  246892478.  309487473.
+cancel memory/all
+ -DELETE FSST     M: 22 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 25 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 31 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 33 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 25 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 31 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 33 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 33 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 28 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+ -DELETE SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 31 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 34 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M: 22 dset:   1 I:   30   30  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 27 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 31 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+                1        2        3     
+                1        2        3
+ ---- L:1 T:   JAN
+ 1N   / 46:  29.2222  29.1992  29.4514
+ 1S   / 45:  29.1514  29.5607  29.8326
+ ---- L:2 T:   FEB
+ 1N   / 46:  29.5769  29.5925  29.1495
+ 1S   / 45:  29.3343  29.7146  29.4674
+ ---- L:3 T:   MAR
+ 1N   / 46:  30.1373  29.9243  29.3264
+ 1S   / 45:  29.8965  29.8240  29.5357
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G017)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX001)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3     
+                1        2        3
+ 1N    / 5:  28.2222  28.1992  28.4514
+ 0.5N  / 4:  28.2045  28.2896  28.5467
+ 0     / 3:  28.1868  28.3800  28.6420
+ 0.5S  / 2:  28.1691  28.4703  28.7373
+ 1S    / 1:  28.1514  28.5607  28.8326
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G017)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:  4.00000
+ 3   / 3:  7.00000
+ 4   / 4:     ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.000
+ 2   / 2:  114.000
+ 3   / 3:  117.000
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:     ....
+ 2   / 2:     ....
+ 3   / 3:  5.00000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.00000
+ 2   / 2:     ....
+ 3   / 3:     ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:  28.5607
+ 3   / 3:  28.8326
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.2222  28.1992     ....  28.4514
+ 1S   / 45:  28.1514  28.5607     ....  28.8326
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : JAN
+                1        2        3        4     
+                1        2        3        4
+ 1N   / 46:  28.1992     ....  28.4514  28.2222
+ 1S   / 45:  28.5607     ....  28.8326  28.1514
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+             1S     
+             45
+ 1   / 1:  28.1514
+ 2   / 2:     ....
+ 3   / 3:     ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.000
+ 2   / 2:     ....
+ 3   / 3:  170.000
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G017)          NORMAL    (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ABSTRACT  (AX001)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G006)          ABSTRACT  COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 29 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 25 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 20 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 18 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 33 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 26 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 28 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 34 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V01 C: 12 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 14 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V01 C: 12 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE Y        M: 31 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 27 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 19 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : JAN
+             5N     
+             48
+ 1   / 1:  27.5245
+ 2   / 2:  27.8502
+ 3   / 3:  27.9891
+ 4   / 4:  28.0330
+ 5   / 5:  26.2343
+ 6   / 6:  27.0648
+ 7   / 7:  27.2798
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1978
+            largest free region: 1976
+            number of free regions: 3
+            free memory table slots: 478
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : JAN
+            179E    
+             80
+ 0   / 1:  22.6389
+ 5   / 2:  27.6389
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : JAN
+              1        2        3        4     
+              1        2        3        4
+ 0   / 1:  22.6389  23.5251  26.9131  29.2606
+ 5   / 2:  27.6389  28.5251  31.9131  34.2606
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  22.6389
+ 2   / 2:  29.2606
+ 3   / 3:  27.7269
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  23.5649  22.6150  21.9434  22.5531  22.5856  22.4436  21.9629  22.2754  21.6575
+ 2   / 2:  29.3521  29.1692  29.2257  29.4440  29.0923  29.3430  29.1310  28.6520  28.9082
+ 3   / 3:  27.9696  28.0578  27.8618  27.9059  27.4280  27.4100  27.3646  27.3974  27.1177
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : JAN
+          173.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  178.202
+ 3   / 3:  198.202
+ 4   / 4:  223.202
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : JAN
+            179E    
+             80
+ 1   / 1:  173.202
+ 2   / 2:  223.202
+ 3   / 3:  273.202
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : JAN
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  174.169  174.225  173.963  173.313  173.532  172.803  172.991  172.548  171.929
+ 2   / 2:  224.169  224.225  223.963  223.313  223.532  222.803  222.991  222.548  221.929
+ 3   / 3:  274.169  274.225  273.963  273.313  273.532  272.803  272.991  272.548  271.929
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+            179E    
+             80
+ 0   / 1:  28.2022
+ 5   / 2:  33.2022
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+              0        5     
+              1        2
+ 1   / 1:  28.3646  33.3646
+ 2   / 2:  28.3538  33.3538
+ 3   / 3:  28.2022  33.2022
+ 4   / 4:  28.3646  33.3646
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+            179E    
+             80
+ 1   / 1:  28.2022
+ 2   / 2:  28.2022
+ 3   / 3:  28.3646
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+            160E     165E     170E     175E      180E    175W     170W     165W     160W    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 2   / 2:  29.1694  29.2247  28.9631  28.3130  28.5324  27.8029  27.9907  27.5481  26.9291
+ 3   / 3:  29.0509  29.1878  28.7239  29.5150  28.3287  28.1944  27.4815  27.4749  26.7886
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.000
+ 2   / 2:  140.000
+ 3   / 3:  170.000
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:     ....
+ 5   / 5:     ....
+ 6   / 6:  2.00000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strides_revs_perms	! netCDF fancy reads
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1124.00  1125.00  1126.00
+ 3   / 3:  1133.00  1134.00  1135.00  1136.00
+ 4   / 4:  1143.00  1144.00  1145.00  1146.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1224.00  1225.00  1226.00
+ 3   / 3:  1233.00  1234.00  1235.00  1236.00
+ 4   / 4:  1243.00  1244.00  1245.00  1246.00
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.00  1142.00  1152.00  1162.00
+ 3   / 3:  1133.00  1143.00  1153.00  1163.00
+ 4   / 4:  1134.00  1144.00  1154.00  1164.00
+ ---- K:2 Z:   2
+ 2   / 2:  1232.00  1242.00  1252.00  1262.00
+ 3   / 3:  1233.00  1243.00  1253.00  1263.00
+ 4   / 4:  1234.00  1244.00  1254.00  1264.00
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1421.00  1521.00  1621.00
+ 3   / 3:  1331.00  1431.00  1531.00  1631.00
+ 4   / 4:  1341.00  1441.00  1541.00  1641.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1332.00  1432.00  1532.00  1632.00
+ 4   / 4:  1342.00  1442.00  1542.00  1642.00
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1412.00  1512.00  1612.00
+ 3   / 3:  1313.00  1413.00  1513.00  1613.00
+ 4   / 4:  1314.00  1414.00  1514.00  1614.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1422.00  1522.00  1622.00
+ 3   / 3:  1323.00  1423.00  1523.00  1623.00
+ 4   / 4:  1324.00  1424.00  1524.00  1624.00
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1032.00  1033.00  1034.00
+ 2N   / 2:  1021.00  1022.00  1023.00  1024.00
+ 1N   / 1:  1011.00  1012.00  1013.00  1014.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2032.00  2033.00  2034.00
+ 2N   / 2:  2021.00  2022.00  2023.00  2024.00
+ 1N   / 1:  2011.00  2012.00  2013.00  2014.00
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1021.00  1031.00  1041.00
+ 142   / 2:  1012.00  1022.00  1032.00  1042.00
+ 143   / 3:  1013.00  1023.00  1033.00  1043.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2021.00  2031.00  2041.00
+ 142   / 2:  2012.00  2022.00  2032.00  2042.00
+ 143   / 3:  2013.00  2023.00  2033.00  2043.00
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  2031.00  3031.00  4031.00
+ 2N   / 2:  1021.00  2021.00  3021.00  4021.00
+ 1N   / 1:  1011.00  2011.00  3011.00  4011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  2032.00  3032.00  4032.00
+ 2N   / 2:  1022.00  2022.00  3022.00  4022.00
+ 1N   / 1:  1012.00  2012.00  3012.00  4012.00
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  2011.00  3011.00  4011.00
+ 142   / 2:  1012.00  2012.00  3012.00  4012.00
+ 143   / 3:  1013.00  2013.00  3013.00  4013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  2021.00  3021.00  4021.00
+ 142   / 2:  1022.00  2022.00  3022.00  4022.00
+ 143   / 3:  1023.00  2023.00  3023.00  4023.00
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 54 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M: 27 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M: 27 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G010)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 47 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G010)          (AX023)   (AX024)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G018)           @AVE
+ reading VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1113.67
+ 2   / 2:  1122.00  1123.67
+ 3   / 3:  1132.00  1133.67
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1213.67
+ 2   / 2:  1222.00  1223.67
+ 3   / 3:  1232.00  1233.67
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 47 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 47 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M: 54 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G010)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G010)          (AX024)   (AX025)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M: 49 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.3      0.48     0.6    
+             1        2        3        4
+          1111.00  1112.00  1113.00  1114.00
+cancel mem/all
+ -DELETE BIGVAR   M: 27 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 47 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G010)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX024)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 54 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 55 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G018)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+              0      
+               1
+ 0.3  / 1:  1112.00
+ 0.6  / 2:  1114.00
+ -DELETE UNE-NVAR M: 54 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0        0.9      1.87     2.65     3.3    
+             1        2        3        4        5
+          1111.00  1118.00  1115.00  1112.00  1119.00
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6    
+               1        2
+ 0    / 1:  1112.00  1114.00
+ 0.95 / 2:  1132.00  1134.00
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G010)          (AX023)   (AX025)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              0.3      0.6      0.78   
+               1        2        3
+ 0    / 1:  1112.00  1114.00  1116.00
+ 0.95 / 2:  1132.00  1134.00  1136.00
+ 1.4  / 3:  1152.00  1154.00  1156.00
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G010)          (AX024)   (AX026)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G010)          (AX026)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G010)           @AVE
+ reading UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G010)          (AX024)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 52 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.00  1125.00  1127.00  1129.00
+ 3   / 3:  1133.00  1135.00  1137.00  1139.00
+ 4   / 4:  1143.00  1145.00  1147.00  1149.00
+ ---- K:2 Z:   2
+ 2   / 2:  1223.00  1225.00  1227.00  1229.00
+ 3   / 3:  1233.00  1235.00  1237.00  1239.00
+ 4   / 4:  1243.00  1245.00  1247.00  1249.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G010)          (AX026)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1124.00  1125.00  1126.00
+ 4   / 2:  1143.00  1144.00  1145.00  1146.00
+ 6   / 3:  1163.00  1164.00  1165.00  1166.00
+ ---- K:2 Z:   2
+ 2   / 1:  1223.00  1224.00  1225.00  1226.00
+ 4   / 2:  1243.00  1244.00  1245.00  1246.00
+ 6   / 3:  1263.00  1264.00  1265.00  1266.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G010)          XAX1_40   (AX024)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G010)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 52 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE UNE-NVAR M: 49 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 55 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          (AX026)   (AX025)   (AX027)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.00  1521.00  1721.00  1921.00
+ 3   / 3:  1331.00  1531.00  1731.00  1931.00
+ 4   / 4:  1341.00  1541.00  1741.00  1941.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1332.00  1532.00  1732.00  1932.00
+ 4   / 4:  1342.00  1542.00  1742.00  1942.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1421.00  1521.00  1621.00
+ 4   / 2:  1341.00  1441.00  1541.00  1641.00
+ 6   / 3:  1361.00  1461.00  1561.00  1661.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1342.00  1442.00  1542.00  1642.00
+ 6   / 3:  1362.00  1462.00  1562.00  1662.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX023)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.00  1512.00  1712.00  1912.00
+ 3   / 3:  1313.00  1513.00  1713.00  1913.00
+ 4   / 4:  1314.00  1514.00  1714.00  1914.00
+ ---- K:2 Z:   2
+ 2   / 2:  1322.00  1522.00  1722.00  1922.00
+ 3   / 3:  1323.00  1523.00  1723.00  1923.00
+ 4   / 4:  1324.00  1524.00  1724.00  1924.00
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 55 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        4        5        6     
+              3        4        5        6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1412.00  1512.00  1612.00
+ 4   / 2:  1314.00  1414.00  1514.00  1614.00
+ 6   / 3:  1316.00  1416.00  1516.00  1616.00
+ ---- K:2 Z:   2
+ 2   / 1:  1322.00  1422.00  1522.00  1622.00
+ 4   / 2:  1324.00  1424.00  1524.00  1624.00
+ 6   / 3:  1326.00  1426.00  1526.00  1626.00
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G018)          ZAX1_20   (AX026)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G018)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 54 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.00  1512.00  1712.00  1912.00
+ 4   / 2:  1314.00  1514.00  1714.00  1914.00
+ 6   / 3:  1316.00  1516.00  1716.00  1916.00
+ ---- K:2 Z:   3
+ 2   / 1:  1332.00  1532.00  1732.00  1932.00
+ 4   / 2:  1334.00  1534.00  1734.00  1934.00
+ 6   / 3:  1336.00  1536.00  1736.00  1936.00
+canc data/all
+ -DELETE BIGVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 3N   / 3:  1031.00  1033.00  1035.00  1037.00
+ 2N   / 2:  1021.00  1023.00  1025.00  1027.00
+ 1N   / 1:  1011.00  1013.00  1015.00  1017.00
+ ---- L:2 T:   JAN-1995
+ 3N   / 3:  2031.00  2033.00  2035.00  2037.00
+ 2N   / 2:  2021.00  2023.00  2025.00  2027.00
+ 1N   / 1:  2011.00  2013.00  2015.00  2017.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     142E     143E     144E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  1061.00  1062.00  1063.00  1064.00
+ 4N   / 2:  1041.00  1042.00  1043.00  1044.00
+ 2N   / 1:  1021.00  1022.00  1023.00  1024.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  2061.00  2062.00  2063.00  2064.00
+ 4N   / 2:  2041.00  2042.00  2043.00  2044.00
+ 2N   / 1:  2021.00  2022.00  2023.00  2024.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          XLON      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 141   / 1:  1011.00  1031.00  1051.00  1071.00
+ 142   / 2:  1012.00  1032.00  1052.00  1072.00
+ 143   / 3:  1013.00  1033.00  1053.00  1073.00
+ ---- L:2 T:   JAN-1995
+ 141   / 1:  2011.00  2031.00  2051.00  2071.00
+ 142   / 2:  2012.00  2032.00  2052.00  2072.00
+ 143   / 3:  2013.00  2033.00  2053.00  2073.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        2        3        4     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  1012.00  1022.00  1032.00  1042.00
+ 144   / 2:  1014.00  1024.00  1034.00  1044.00
+ 146   / 3:  1016.00  1026.00  1036.00  1046.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  2012.00  2022.00  2032.00  2042.00
+ 144   / 2:  2014.00  2024.00  2034.00  2044.00
+ 146   / 3:  2016.00  2026.00  2036.00  2046.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          YLAT      (AX026)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+                1        3        5        7     
+                1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 142   / 1:  3012.00  3032.00  3052.00  3072.00
+ 144   / 2:  3014.00  3034.00  3054.00  3074.00
+ 146   / 3:  3016.00  3036.00  3056.00  3076.00
+ ---- L:2 T:   JAN-1995
+ 142   / 1:  5012.00  5032.00  5052.00  5072.00
+ 144   / 2:  5014.00  5034.00  5054.00  5074.00
+ 146   / 3:  5016.00  5036.00  5056.00  5076.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.00  3031.00  5031.00  7031.00
+ 2N   / 2:  1021.00  3021.00  5021.00  7021.00
+ 1N   / 1:  1011.00  3011.00  5011.00  7011.00
+ ---- L:2 T:   142
+ 3N   / 3:  1032.00  3032.00  5032.00  7032.00
+ 2N   / 2:  1022.00  3022.00  5022.00  7022.00
+ 1N   / 1:  1012.00  3012.00  5012.00  7012.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34320    34321    34322   
+               1        2        3        4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.00  2061.00  3061.00  4061.00
+ 4N   / 2:  1041.00  2041.00  3041.00  4041.00
+ 2N   / 1:  1021.00  2021.00  3021.00  4021.00
+ ---- L:2 T:   142
+ 6N   / 3:  1062.00  2062.00  3062.00  4062.00
+ 4N   / 2:  1042.00  2042.00  3042.00  4042.00
+ 2N   / 1:  1022.00  2022.00  3022.00  4022.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+             34319    34321    34323    34325   
+               1        2        3        4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.00  3063.00  5063.00  7063.00
+ 4N   / 2:  1043.00  3043.00  5043.00  7043.00
+ 2N   / 1:  1023.00  3023.00  5023.00  7023.00
+ ---- L:2 T:   145
+ 6N   / 3:  1065.00  3065.00  5065.00  7065.00
+ 4N   / 2:  1045.00  3045.00  5045.00  7045.00
+ 2N   / 1:  1025.00  3025.00  5025.00  7025.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   NORMAL    (AX026)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- L:2 T:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX025)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- L:1 T:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- L:2 T:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX026)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- L:1 T:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- L:2 T:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.00  3011.00  5011.00  7011.00
+ 142   / 2:  1012.00  3012.00  5012.00  7012.00
+ 143   / 3:  1013.00  3013.00  5013.00  7013.00
+ ---- K:2 Z:   2
+ 141   / 1:  1021.00  3021.00  5021.00  7021.00
+ 142   / 2:  1022.00  3022.00  5022.00  7022.00
+ 143   / 3:  1023.00  3023.00  5023.00  7023.00
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G018)          (AX027)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34320    34321    34322   
+                1        2        3        4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.00  2012.00  3012.00  4012.00
+ 144   / 2:  1014.00  2014.00  3014.00  4014.00
+ 146   / 3:  1016.00  2016.00  3016.00  4016.00
+ ---- K:2 Z:   2
+ 142   / 1:  1022.00  2022.00  3022.00  4022.00
+ 144   / 2:  1024.00  2024.00  3024.00  4024.00
+ 146   / 3:  1026.00  2026.00  3026.00  4026.00
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G018)          TTIME     (AX023)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G018)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 55 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M: 54 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.00  1342.00
+ 5   / 2:  1385.00  1345.00
+ ---- K:2 Z:   5
+ 2   / 1:  1582.00  1542.00
+ 5   / 2:  1585.00  1545.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX027)   (AX025)   (AX026)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G018)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 54 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M: 55 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX025)   (AX027)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+GO bn_reset
+cancel mode verify
+GO bn_non_COARDS_netCDF		! non-standard netCDF files
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME4     TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX1   LONGITUDE          180 r   1E                   180E
+ COADSY1   LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  3.00000
+ 3   / 3:  5.00000
+ 4   / 4:  2.00000
+ 5   / 5:  4.00000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:     ....
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.0000
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.0000
+ 2   / 2:  40.0000
+ 3   / 3:  30.0000
+ 4   / 4:  20.0000
+ 5   / 5:  10.0000
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cache_hits		! cache hits on unspecified (full) regions
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M: 54 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 49 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M: 49 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 27 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M: 44 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTX     M: 40 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 43 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M: 43 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 46 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 40 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 40 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST --> (G008)           @LIN
+ reading SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G008)          XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST      M: 39 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M: 37 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 32 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 33 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M: 26 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ reading SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M: 21 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M: 16 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ reading SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  3 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 53 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M: 53 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 42 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 42 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M: 42 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 45 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 45 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 58 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 61 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 68 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G008)           @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 69 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 72 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 74 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 78 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 80 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  7 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 81 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 87 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 88 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 86 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 90 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5X    M: 60 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5X    M: 64 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XTROP     COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M: 58 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 69 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 57 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 59 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 70 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 72 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 76 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 81 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 85 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTSBX   M:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTSBX   M: 56 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXAVE  M: 14 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXAVE  M: 17 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SSTXYT   M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTXYT   M: 28 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 24 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 56 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 84 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M: 81 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 75 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 70 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 67 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 51 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 69 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C:  9 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 60 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 92 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ eval    SST5     C: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 93 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.0000
+ 2    /  2:   2.0000
+ 3    /  3:   3.0000
+ 4    /  4:   4.0000
+ 5    /  5:   5.0000
+ 6    /  6:   6.0000
+ 7    /  7:   7.0000
+ 8    /  8:   8.0000
+ 9    /  9:   9.0000
+ 10   / 10:  10.0000
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 98 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 97 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 91 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 96 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XAVE M: 59 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XAVE M: 72 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5XYT  M: 14 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5XYT  M: 88 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME4     NORMAL    NORMAL
+ -DELETE SST5     M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 17 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 24 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 31 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 41 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 51 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 58 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 60 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 62 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 63 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 66 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 67 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 73 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 75 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 78 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 79 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 82 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 84 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 86 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 89 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 90 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 93 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 94 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 95 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 89 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C11,V11 M: 94 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE J        M: 95 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 86 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 84 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 86 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 79 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.00000
+ 2   / 2:  5.00000
+ 3   / 3:  3.00000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 82 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 95 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 86 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 89 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 90 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 84 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 90 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 95 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M: 93 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 79 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 78 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 94 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.0000
+ 2   / 2:  12.0000
+ 3   / 3:  13.0000
+ 4   / 4:  21.0000
+ 5   / 5:  22.0000
+ 6   / 6:  23.0000
+ 7   / 7:  31.0000
+ 8   / 8:  32.0000
+ 9   / 9:  33.0000
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+ 
+GO bn_reset
+cancel mode verify
+ -DELETE SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  2 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  3 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 11 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 18 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 19 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 20 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 21 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 22 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 23 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 25 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 26 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 27 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 28 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 29 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 30 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 32 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 33 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 34 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 35 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 36 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 37 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 38 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 39 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 40 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 42 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 43 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 44 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 45 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 46 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 47 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 48 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 49 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 50 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 52 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 53 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 54 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 55 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 56 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 57 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 61 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 64 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 65 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 68 dset:   1 I:   55  131  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 69 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 70 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 71 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 74 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 76 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 77 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 80 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 81 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 83 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 85 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 87 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 92 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C31,V11 M: 78 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C31,V11 M: 95 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 79 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C09,V11 M: 90 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 84 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 93 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 75 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 82 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 94 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 86 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE str      M: 89 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+GO bn_regrid_to_user		! G=user_var and related
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.00000
+ 23E   / 2:  2.00000
+ 25E   / 3:  3.00000
+ 27E   / 4:  4.00000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.0000
+ 23E   / 2:  23.0000
+ 25E   / 3:  25.0000
+ 27E   / 4:  27.0000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX020)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G012)
+    GRID (G012)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G012)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX012)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX012)                         use count:   1
+    AXIS (AX020)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 2   / 2:   5.0000   7.0000   9.0000     ....
+ 3   / 3:   6.0000   8.0000  10.0000     ....
+ 4   / 4:   7.0000   9.0000  11.0000     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   6.0000   8.0000     ....
+ 3   / 2:   6.0000   8.0000  10.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 2   / 2:   4.0000   6.0000   8.0000     ....
+ 3   / 3:   5.0000   7.0000   9.0000     ....
+ 4   / 4:   6.0000   8.0000  10.0000     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 2   / 2:   6.0000   8.0000  10.0000     ....
+ 3   / 3:   7.0000   9.0000  11.0000     ....
+ 4   / 4:   8.0000  10.0000  12.0000     ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX005)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G018)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G018)
+    GRID (G018)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G011)
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX002)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.00000
+ 9.4S   / 4:  4.00000
+ 9.6S   / 3:  3.00000
+ 9.8S   / 2:  2.00000
+ 10S    / 1:  1.00000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX002)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G011)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX002)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX002)                         use count:   2
+    AXIS (AX020)                         use count:   1
+ 
+ 
+! ******** V53 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_calendar
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.436165
+ 28-FEB-1988 00 / 58:  0.992873
+ 29-FEB-1988 00 / 59:  0.636738
+ 30-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 01-MAR-1988 00 / 60: -0.304811
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.8979
+ 03-DEC-1982 00 / 16:  32.9221
+ 10-DEC-1982 00 / 17:  32.9583
+ 17-DEC-1982 00 / 18:  32.9707
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 28-NOV-1982 00 / 15:  32.9508
+ 05-DEC-1982 00 / 16:  32.9011
+ 12-DEC-1982 00 / 17:  32.8862
+ 19-DEC-1982 00 / 18:  32.9099
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                        132.5W  
+                         98
+ 26-NOV-1982 00 / 15:  32.9099
+ 03-DEC-1982 00 / 16:  32.9287
+ 10-DEC-1982 00 / 17:  32.9658
+ 17-DEC-1982 00 / 18:  32.9710
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT191_100 LONGITUDE         10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+             TIME: AUG-1982 to JAN-1983 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                    132.5W  
+                     98
+ 18-SEP-1982 / 2:  27.2694
+ 18-OCT-1982 / 3:  31.3241
+ 18-NOV-1982 / 4:  32.9011
+ 18-DEC-1982 / 5:  32.9710
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.833N
+             DEPTH (m): 5
+                         132.5W  
+                          98
+ 05-DEC-1982 00 / 108:     ....
+ 06-DEC-1982 00 / 109:  32.9340
+ 07-DEC-1982 00 / 110:  32.9401
+ 08-DEC-1982 00 / 111:  32.9462
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                    179E    
+                     80
+ 16-JAN      / 1:  28.2022
+ 15-FEB      / 2:  28.3646
+ 17-MAR      / 3:  28.3538
+ 16-AUG      / 4:     ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                    JSST    NSST
+01-JAN      / 1:     ....  28.2022
+31-JAN      / 2:  28.2832  28.2022
+01-MAR      / 3:  28.3592  28.3646
+01-APR      / 4:     ....  28.3538
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dash_dot
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+ 
+GO bn_reset
+cancel mode verify
+GO bn_flowlines
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+ 
+! ******** V533 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_logaxes
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+ 
+! *kob* same tests for internal external functions but moved out of
+!       the bn_external_function jnl file.
+GO bn_reset
+cancel mode verify
+GO bn_internal_external_functions
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.013664
+ 0.00355 / 31:  0.021183
+ 0.00366 / 32:  0.048189
+ 0.00378 / 33:  0.498982
+ 0.00389 / 34:  0.052353
+ 0.00401 / 35:  0.032474
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.072791
+ 0.00584 / 51:  0.104108
+ 0.00595 / 52:  0.185372
+ 0.00607 / 53:  0.894540
+ 0.00618 / 54:  0.311122
+ 0.0063  / 55:  0.131705
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.057
+ 0       /  2: -176.112
+ 0       /  3: -174.161
+ 0       /  4: -172.203
+ 0       /  5: -170.234
+ 0       /  6: -168.251
+ 0       /  7: -166.250
+ 0       /  8: -164.228
+ 0.00103 /  9: -162.179
+ 0.00114 / 10: -160.100
+ 0.00126 / 11: -157.983
+ 0.00137 / 12: -155.821
+ 0.00149 / 13: -153.606
+ 0.0016  / 14: -151.326
+ 0.00172 / 15: -148.970
+ 0.00183 / 16: -146.520
+ 0.00195 / 17: -143.957
+ 0.00206 / 18: -141.255
+ 0.00217 / 19: -138.381
+ 0.00229 / 20: -135.294
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                  161W    
+                   90
+ 0        /  1:  1.99605
+ 0        /  2:  2.16839
+ 0        /  3:  0.17387
+ 0        /  4:  2.01530
+ 0        /  5:  0.35361
+ 0        /  6:  1.72488
+ 0        /  7:  1.25348
+ 0        /  8:  0.30416
+ 0        /  9:  1.65059
+ 0        / 10:  0.81359
+ 0        / 11:  0.15377
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                 1       
+                  21
+ 4     /  81:  0.249981
+ 4.05  /  82:  0.245294
+ 4.1   /  83:  0.240500
+ 4.15  /  84:  0.235600
+ 4.2   /  85:  0.230597
+ 4.25  /  86:  0.225493
+ 4.3   /  87:  0.220289
+ 4.35  /  88:  0.214988
+ 4.4   /  89:  0.209592
+ 4.45  /  90:  0.204102
+ 4.5   /  91:  0.198521
+ 4.55  /  92:  0.192851
+ 4.6   /  93:  0.187094
+ 4.65  /  94:  0.181253
+ 4.7   /  95:  0.175329
+ 4.75  /  96:  0.169325
+ 4.8   /  97:  0.163243
+ 4.85  /  98:  0.157086
+ 4.9   /  99:  0.150856
+ 4.95  / 100:  0.144555
+ 5     / 101:  0.138186
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.308984  0.361972  0.109085 -0.004967 -0.136744 -0.408450 -0.225496  0.151670  0.225024  0.073150
+ 1.5   /  2:  0.315638  0.371230  0.093750 -0.037386 -0.201756 -0.452435 -0.150009  0.278155  0.330914  0.069854
+ 2     /  3:  0.378812  0.315634  0.037083 -0.088708 -0.253832 -0.492242 -0.073700  0.374786  0.450968  0.081332
+ 2.5   /  4:  0.420045  0.252191 -0.063598 -0.144131 -0.252740 -0.466614  0.019391  0.439631  0.491399  0.089314
+ 3     /  5:  0.406392  0.198397 -0.139974 -0.197140 -0.279040 -0.425529  0.118978  0.432969  0.545303  0.085462
+ 3.5   /  6:  0.351014  0.169762 -0.201579 -0.257493 -0.283843 -0.357982  0.185850  0.585861  0.530755  0.058808
+ 4     /  7:  0.277107  0.096747 -0.246534 -0.289021 -0.258951 -0.329342  0.312474  0.641602  0.518714  0.021205
+ 4.5   /  8:  0.188951  0.044707 -0.312641 -0.319182 -0.213513 -0.222475  0.302121  0.626625  0.412068 -0.008475
+ 5     /  9:  0.139939 -0.037119 -0.323878 -0.333812 -0.199768 -0.134206  0.265570  0.577839  0.312094 -0.056718
+ 5.5   / 10:  0.078577 -0.096394 -0.338922 -0.312885 -0.172743 -0.085023  0.206702  0.482419  0.235803 -0.079778
+ 6     / 11:  0.007372 -0.135345 -0.377702 -0.274110 -0.121663 -0.019270  0.173802  0.354012  0.148779 -0.122582
+ 6.5   / 12: -0.071091 -0.209142 -0.370362 -0.249289 -0.041035  0.069505  0.148512  0.236838  0.045584 -0.173237
+ 7     / 13: -0.137482 -0.254334 -0.378632 -0.228148  0.063018  0.183000  0.135520  0.132174 -0.050976 -0.215292
+ 7.5   / 14: -0.202760 -0.266868 -0.346402 -0.210460  0.168372  0.279647  0.178541  0.064025 -0.115153 -0.228150
+ 8     / 15: -0.275191 -0.259180 -0.300179 -0.155421  0.233304  0.351951  0.219702  0.033928 -0.135697 -0.218938
+ 8.5   / 16: -0.326812 -0.273253 -0.245151 -0.113795  0.264889  0.402452  0.253275  0.029382 -0.138544 -0.200463
+ 9     / 17: -0.351551 -0.266762 -0.164899 -0.032110  0.276385  0.437033  0.281707  0.036426 -0.134209 -0.191118
+ 9.5   / 18: -0.364215 -0.240170 -0.093384  0.038122  0.276072  0.442607  0.294658  0.049712 -0.140883 -0.217410
+ 10    / 19: -0.369196 -0.210353 -0.040323  0.103110  0.280278  0.405237  0.298599  0.066760 -0.138644 -0.252572
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.290994  0.424162  0.097006  0.003143 -0.136744 -0.412297 -0.207808      ....  0.241076      ....
+ 1.5   /  2:  0.314929  0.373640  0.124083 -0.001456 -0.201756 -0.441151 -0.189145  0.331034  0.333491  0.005624
+ 2     /  3:  0.337643  0.312076  0.046130 -0.011788 -0.267158 -0.486359 -0.073700      ....  0.461555      ....
+ 2.5   /  4:  0.359734  0.242399 -0.066085      .... -0.243857 -0.457333 -0.031104  0.417939  0.473995  0.200894
+ 3     /  5:      ....  0.198698 -0.131262 -0.203700 -0.277160 -0.388506  0.065758  0.434211  0.539378      ....
+ 3.5   /  6:  0.310287  0.169976 -0.216298 -0.249436 -0.282498 -0.336468  0.156727  0.537358  0.505391  0.142444
+ 4     /  7:  0.274766  0.091884 -0.274252 -0.239529 -0.262206 -0.333969  0.312474  0.580377  0.520608  0.093618
+ 4.5   /  8:  0.184044  0.041657 -0.304953      .... -0.210582 -0.196012  0.326227  0.576412  0.366262  0.059061
+ 5     /  9:  0.146796 -0.044536 -0.353323 -0.375483 -0.190888 -0.106617  0.284743  0.521940  0.278387 -0.035055
+ 5.5   / 10:  0.041582 -0.109698 -0.335399 -0.325452      .... -0.088590  0.221990  0.438637  0.235803  0.041225
+ 6     / 11: -0.012273 -0.174380 -0.371063 -0.263403      ....      ....  0.172629  0.346297  0.219052      ....
+ 6.5   / 12: -0.064809 -0.127226 -0.366128 -0.245270      ....  0.104409  0.165680  0.242858  0.095140      ....
+ 7     / 13: -0.138619      .... -0.379843 -0.230018      ....  0.181947  0.135892  0.164309 -0.026041 -0.204659
+ 7.5   / 14: -0.203907 -0.289087 -0.346009 -0.209873  0.169451  0.272161  0.184553  0.103343 -0.114248      ....
+ 8     / 15: -0.285911 -0.258721 -0.300520 -0.170515  0.240968  0.352162  0.229361  0.066151 -0.135985      ....
+ 8.5   / 16: -0.329428 -0.279209 -0.236667 -0.125716  0.292407  0.388989  0.256564      .... -0.139683 -0.183944
+ 9     / 17: -0.341597 -0.268585 -0.177502 -0.064298  0.277369  0.431662  0.288204  0.023055 -0.139178 -0.195303
+ 9.5   / 18: -0.343919 -0.225702 -0.093580  0.013191  0.253357  0.442399  0.294693  0.034103 -0.137639 -0.211783
+ 10    / 19:      .... -0.204222 -0.021547      ....      ....  0.421118  0.287954      .... -0.144731 -0.203650
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.274901  0.351990  0.125870  0.000547 -0.130676 -0.409444 -0.196473  0.113026  0.291807  0.128390
+ 1.5   /  2:  0.299222  0.340543  0.124519 -0.061100 -0.263759 -0.435083 -0.176723  0.348424  0.372371  0.128390
+ 2     /  3:  0.281567  0.320514  0.026296 -0.110384 -0.295665 -0.434870 -0.190697  0.460511  0.445156  0.191902
+ 2.5   /  4:  0.290517  0.274621 -0.063970 -0.166628 -0.264776 -0.417589 -0.116164  0.537969  0.442169  0.264943
+ 3     /  5:  0.291464  0.248219 -0.125567 -0.223844 -0.256285 -0.371561  0.247717  0.497526  0.452304  0.276328
+ 3.5   /  6:  0.267037  0.177128 -0.170576 -0.230988 -0.274809 -0.281194  0.254637  0.510104  0.422794  0.248322
+ 4     /  7:  0.225394  0.114379 -0.176660 -0.227903 -0.272403 -0.244676  0.280180  0.544886  0.397193  0.212214
+ 4.5   /  8:  0.189285  0.081180 -0.332907 -0.343445 -0.230804 -0.244260  0.339829  0.530983  0.335082  0.061286
+ 5     /  9:  0.127042  0.039043 -0.356226 -0.369075 -0.177935 -0.153186  0.253590  0.499044  0.303545  0.025609
+ 5.5   / 10:  0.048635 -0.126901 -0.331398 -0.289789 -0.162591 -0.082396  0.192227  0.401098  0.303746  0.055576
+ 6     / 11: -0.037713 -0.136552 -0.336681 -0.268753 -0.197051  0.016254  0.209390  0.295370  0.263940 -0.135684
+ 6.5   / 12: -0.064917 -0.134912 -0.359398 -0.220212 -0.011644  0.110802  0.164667  0.259319  0.078530 -0.137706
+ 7     / 13: -0.103972 -0.140560 -0.362975 -0.166853  0.066535  0.193231  0.149487  0.141794 -0.113016 -0.143405
+ 7.5   / 14: -0.199710 -0.279592 -0.339043 -0.191829  0.185240  0.262158  0.152165  0.039367 -0.115781 -0.151274
+ 8     / 15: -0.235285 -0.278212 -0.283035 -0.157240  0.250258  0.333134  0.204490  0.017943 -0.115931 -0.171603
+ 8.5   / 16: -0.306008 -0.278546 -0.240470 -0.100659  0.251651  0.363846  0.251194  0.080410 -0.130532 -0.187823
+ 9     / 17: -0.335648 -0.266336 -0.213641  0.013456  0.288406  0.405273  0.272644  0.141238 -0.142601 -0.193561
+ 9.5   / 18: -0.349458 -0.212960 -0.108340  0.097657  0.205467  0.422547  0.294706  0.116317 -0.143410 -0.195569
+ 10    / 19: -0.353035 -0.181573 -0.086119  0.078837  0.108731  0.420380  0.321587  0.036216 -0.151253 -0.191472
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                 1         2         3         4         5         6         7         8         9        10      
+                  1         3         5         7         9        11        13        15        17        19
+ 1     /  1:  0.281552  0.312213  0.193558 -0.030592 -0.206961 -0.317374 -0.200235  0.035776  0.251615  0.217897
+ 1.5   /  2:  0.275271  0.296173  0.155526 -0.085149 -0.266966 -0.350539 -0.202341  0.168678  0.341517  0.274690
+ 2     /  3:  0.267170  0.260868  0.085385 -0.139671 -0.296632 -0.356898 -0.159219  0.302176  0.393862  0.319020
+ 2.5   /  4:  0.256878  0.203678  0.000735 -0.176300 -0.300338 -0.332200 -0.037496  0.393557  0.416391  0.336288
+ 3     /  5:  0.242290  0.152878 -0.057424 -0.197874 -0.288975 -0.265744  0.103144  0.430207  0.412825  0.327333
+ 3.5   /  6:  0.222556  0.121831 -0.090666 -0.216330 -0.271362 -0.184480  0.187704  0.436022  0.391648  0.301597
+ 4     /  7:  0.199438  0.094153 -0.126981 -0.240001 -0.252964 -0.137926  0.223192  0.431619  0.360695  0.262091
+ 4.5   /  8:  0.165055  0.052904 -0.183379 -0.267119 -0.231965 -0.117235  0.236822  0.416791  0.325354  0.213933
+ 5     /  9:  0.103166 -0.013463 -0.234016 -0.283000 -0.207964 -0.093414  0.234809  0.379625  0.299928  0.181999
+ 5.5   / 10:  0.019557 -0.082190 -0.253614 -0.280357 -0.179994 -0.046106  0.219394  0.327974  0.276824  0.165491
+ 6     / 11: -0.043123 -0.124439 -0.262702 -0.257404 -0.115678  0.036003  0.200459  0.273757  0.219858  0.088693
+ 6.5   / 12: -0.080238 -0.159570 -0.282392 -0.216326  0.011196  0.126375  0.181603  0.207992  0.109108 -0.036546
+ 7     / 13: -0.125137 -0.215907 -0.293904 -0.180571  0.098961  0.191463  0.171154  0.130122 -0.005575 -0.104958
+ 7.5   / 14: -0.186850 -0.262803 -0.283642 -0.149158  0.150674  0.242358  0.181345  0.073483 -0.066151 -0.129099
+ 8     / 15: -0.238052 -0.273211 -0.262614 -0.116643  0.191858  0.284230  0.210919  0.059208 -0.090155 -0.143986
+ 8.5   / 16: -0.274654 -0.269613 -0.239107 -0.087178  0.223535  0.315867  0.242668  0.071672 -0.107088 -0.159422
+ 9     / 17: -0.300031 -0.259464 -0.211792 -0.059935  0.246533  0.340287  0.266976  0.081553 -0.124034 -0.168991
+ 9.5   / 18: -0.314125 -0.241656 -0.177924 -0.031561  0.260916  0.358325  0.284307  0.073478 -0.135647 -0.172063
+ 10    / 19: -0.318713 -0.220992 -0.146630 -0.009841  0.266488  0.369766  0.296933  0.053734 -0.142473 -0.172360
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G010)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                 50E      52.1E    54.2E    56.3E    58.4E    60.5E    62.6E    64.7E    66.8E    68.9E  
+                  1        3        5        7        9       11       13       15       17       19
+ 20N    / 20:     ....     ....     ....     ....  143.990  241.090     ....     ....     ....     ....
+ 19.47N / 19:     ....     ....     ....     ....  117.831  207.449  172.925     ....     ....     ....
+ 18.95N / 18:     ....     ....     ....  137.758  107.307   98.003     ....     ....     ....     ....
+ 18.42N / 17:     ....     ....     ....  161.079  156.071    7.072   16.239     ....     ....     ....
+ 17.9N  / 16:     ....     ....     ....  179.862  189.128   81.665     ....     ....     ....     ....
+ 17.37N / 15:     ....     ....     ....  165.097  200.741  145.418     ....     ....     ....     ....
+ 16.84N / 14:     ....     ....     ....  128.322  183.027  168.029  182.582     ....     ....     ....
+ 16.32N / 13:     ....     ....   76.347   92.413  158.520  190.506  197.367     ....     ....     ....
+ 15.79N / 12:     ....     ....     ....   80.307     ....  189.841  195.829     ....     ....     ....
+ 15.26N / 11:     ....     ....     ....   72.161     ....  187.475  191.467     ....     ....     ....
+ 14.74N / 10:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 14.21N /  9:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.68N /  8:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 13.16N /  7:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.63N /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 12.11N /  5:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.58N /  4:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 11.05N /  3:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10.53N /  2:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10N    /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 28N   / 10:      ....  0.000000 -0.017348 -0.052117 -0.086972 -0.121869 -0.156767 -0.191621 -0.226391 -0.243739      ....
+ 26N   /  9:      ....  0.017348  0.000000 -0.034770 -0.069624 -0.104522 -0.139419 -0.174274 -0.209043 -0.226391      ....
+ 24N   /  8:      ....  0.052117  0.034770  0.000000 -0.034855 -0.069752 -0.104649 -0.139504 -0.174274 -0.191621      ....
+ 22N   /  7:      ....  0.086972  0.069624  0.034855  0.000000 -0.034897 -0.069794 -0.104649 -0.139419 -0.156767      ....
+ 20N   /  6:      ....  0.121869  0.104522  0.069752  0.034897  0.000000 -0.034897 -0.069752 -0.104522 -0.121869      ....
+ 18N   /  5:      ....  0.156767  0.139419  0.104649  0.069794  0.034897  0.000000 -0.034855 -0.069624 -0.086972      ....
+ 16N   /  4:      ....  0.191621  0.174274  0.139504  0.104649  0.069752  0.034855  0.000000 -0.034770 -0.052117      ....
+ 14N   /  3:      ....  0.226391  0.209043  0.174274  0.139419  0.104522  0.069624  0.034770  0.000000 -0.017348      ....
+ 12N   /  2:      ....  0.243739  0.226391  0.191621  0.156767  0.121869  0.086972  0.052117  0.017348  0.000000      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+                170E      172E      174E      176E      178E      180E      178W      176W      174W      172W      170W    
+                  1         2         3         4         5         6         7         8         9        10        11
+ 30N   / 11:      ....      .... -0.057531 -0.086987 -0.119152 -0.153259 -0.187881 -0.221435 -0.252146 -0.279109      ....
+ 28N   / 10:      ....  0.001469 -0.031719 -0.066314 -0.100631 -0.135459 -0.170322 -0.204898 -0.238648 -0.268796 -0.279109
+ 26N   /  9:      ....  0.030054  0.001289 -0.034598 -0.069227 -0.104122 -0.139020 -0.173835 -0.208160 -0.238648 -0.252146
+ 24N   /  8:      ....  0.062225  0.036296 -0.000330 -0.034822 -0.069721 -0.104621 -0.139444 -0.173835 -0.204898 -0.221435
+ 22N   /  7:      ....  0.096660  0.071306  0.034440  0.000001 -0.034898 -0.069798 -0.104621 -0.139020 -0.170322 -0.187881
+ 20N   /  6:      ....  0.131820  0.106170  0.069324  0.034901  0.000001 -0.034898 -0.069721 -0.104122 -0.135459 -0.153259
+ 18N   /  5:      ....  0.166766  0.141022  0.104198  0.069800  0.034901  0.000001 -0.034822 -0.069227 -0.100631 -0.119152
+ 16N   /  4:      ....  0.200738  0.175293  0.138438  0.104198  0.069324  0.034440 -0.000330 -0.034598 -0.066314 -0.086987
+ 14N   /  3:      ....  0.233148  0.215255  0.175293  0.141022  0.106170  0.071306  0.036296  0.001289 -0.031719 -0.057531
+ 12N   /  2:      ....      ....  0.233148  0.200738  0.166766  0.131820  0.096660  0.062225  0.030054  0.001469      ....
+ 10N   /  1:      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....      ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+           SMXZ_XS   SMXZ_ZS   SMXZ
+1    /  1:  173.000  15.0000  1.51981
+2    /  2:  174.000  15.0000  1.50247
+3    /  3:  175.000  15.0000  1.48510
+4    /  4:  176.000  15.0000  1.46770
+5    /  5:  177.000  15.0000  1.45028
+6    /  6:  178.000  15.0000  1.43284
+7    /  7:  179.000  15.0000  1.41539
+8    /  8:  180.000  15.0000  1.39794
+9    /  9: -179.000  15.0000  1.38049
+10   / 10: -178.000  15.0000  1.36304
+11   / 11: -177.000  15.0000  1.34560
+12   / 12: -176.000  15.0000  1.32818
+13   / 13: -175.000  15.0000  1.31078
+14   / 14: -174.000  15.0000  1.29341
+15   / 15: -173.000  15.0000  1.27607
+16   / 16:  173.000  20.0000  1.59899
+17   / 17:  174.000  20.0000  1.58165
+18   / 18:  175.000  20.0000  1.56428
+19   / 19:  176.000  20.0000  1.54688
+20   / 20:  177.000  20.0000  1.52946
+21   / 21:  178.000  20.0000  1.51202
+22   / 22:  179.000  20.0000  1.49457
+23   / 23:  180.000  20.0000  1.47712
+24   / 24: -179.000  20.0000  1.45967
+25   / 25: -178.000  20.0000  1.44222
+26   / 26: -177.000  20.0000  1.42479
+27   / 27: -176.000  20.0000  1.40736
+28   / 28: -175.000  20.0000  1.38997
+29   / 29: -174.000  20.0000  1.37259
+30   / 30: -173.000  20.0000  1.35525
+31   / 31:  173.000  25.0000  1.66594
+32   / 32:  174.000  25.0000  1.64860
+33   / 33:  175.000  25.0000  1.63122
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+                170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+           SMXT_XS   SMXT_TS   SMXT
+1    /  1:  173.000   273.75  2.63208
+2    /  2:  174.000   273.75  2.61474
+3    /  3:  175.000   273.75  2.59737
+4    /  4:  176.000   273.75  2.57997
+5    /  5:  177.000   273.75  2.56255
+6    /  6:  178.000   273.75  2.54511
+7    /  7:  179.000   273.75  2.52766
+8    /  8:  180.000   273.75  2.51021
+9    /  9: -179.000   273.75  2.49276
+10   / 10: -178.000   273.75  2.47531
+11   / 11: -177.000   273.75  2.45787
+12   / 12: -176.000   273.75  2.44045
+13   / 13: -175.000   273.75  2.42305
+14   / 14: -174.000   273.75  2.40568
+15   / 15: -173.000   273.75  2.38834
+16   / 16:  173.000   821.25  3.06201
+17   / 17:  174.000   821.25  3.04467
+18   / 18:  175.000   821.25  3.02730
+19   / 19:  176.000   821.25  3.00990
+20   / 20:  177.000   821.25  2.99248
+21   / 21:  178.000   821.25  2.97504
+22   / 22:  179.000   821.25  2.95760
+23   / 23:  180.000   821.25  2.94014
+24   / 24: -179.000   821.25  2.92269
+25   / 25: -178.000   821.25  2.90524
+26   / 26: -177.000   821.25  2.88781
+27   / 27: -176.000   821.25  2.87039
+28   / 28: -175.000   821.25  2.85299
+29   / 29: -174.000   821.25  2.83561
+30   / 30: -173.000   821.25  2.81827
+31   / 31:  173.000  1368.75  3.27378
+32   / 32:  174.000  1368.75  3.25643
+33   / 33:  175.000  1368.75  3.23906
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                     170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+           SMYZ_YS   SMYZ_ZS   SMYZ
+1    /  1:  13.0000  15.0000  1.51981
+2    /  2:  14.0000  15.0000  1.50247
+3    /  3:  15.0000  15.0000  1.48510
+4    /  4:  16.0000  15.0000  1.46770
+5    /  5:  17.0000  15.0000  1.45028
+6    /  6:  18.0000  15.0000  1.43284
+7    /  7:  19.0000  15.0000  1.41539
+8    /  8:  20.0000  15.0000  1.39794
+9    /  9:  21.0000  15.0000  1.38049
+10   / 10:  22.0000  15.0000  1.36304
+11   / 11:  23.0000  15.0000  1.34560
+12   / 12:  24.0000  15.0000  1.32818
+13   / 13:  25.0000  15.0000  1.31078
+14   / 14:  26.0000  15.0000  1.29341
+15   / 15:  27.0000  15.0000  1.27607
+16   / 16:  13.0000  20.0000  1.59899
+17   / 17:  14.0000  20.0000  1.58165
+18   / 18:  15.0000  20.0000  1.56428
+19   / 19:  16.0000  20.0000  1.54688
+20   / 20:  17.0000  20.0000  1.52946
+21   / 21:  18.0000  20.0000  1.51202
+22   / 22:  19.0000  20.0000  1.49457
+23   / 23:  20.0000  20.0000  1.47712
+24   / 24:  21.0000  20.0000  1.45967
+25   / 25:  22.0000  20.0000  1.44222
+26   / 26:  23.0000  20.0000  1.42479
+27   / 27:  24.0000  20.0000  1.40736
+28   / 28:  25.0000  20.0000  1.38997
+29   / 29:  26.0000  20.0000  1.37259
+30   / 30:  27.0000  20.0000  1.35525
+31   / 31:  13.0000  25.0000  1.66594
+32   / 32:  14.0000  25.0000  1.64860
+33   / 33:  15.0000  25.0000  1.63122
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....  1.51981  1.50246  1.46769  1.43284  1.39794  1.36304  1.32819  1.29342  1.27607     ....
+ 20     /  3:     ....  1.59640  1.57905  1.54428  1.50943  1.47453  1.43963  1.40478  1.37001  1.35266     ....
+ 30     /  4:     ....  1.72248  1.70513  1.67036  1.63551  1.60061  1.56571  1.53086  1.49609  1.47874     ....
+ 40     /  5:     ....  1.81991  1.80257  1.76780  1.73294  1.69804  1.66315  1.62829  1.59352  1.57618     ....
+ 50     /  6:     ....  1.89938  1.88203  1.84726  1.81241  1.77751  1.74261  1.70776  1.67299  1.65564     ....
+ 60     /  7:     ....  1.96650  1.94915  1.91438  1.87952  1.84463  1.80973  1.77488  1.74011  1.72276     ....
+ 70     /  8:     ....  2.02460  2.00725  1.97248  1.93763  1.90273  1.86783  1.83298  1.79821  1.78086     ....
+ 80     /  9:     ....  2.07583  2.05848  2.02371  1.98886  1.95396  1.91906  1.88421  1.84944  1.83209     ....
+ 90     / 10:     ....  2.09959  2.08225  2.04748  2.01262  1.97772  1.94283  1.90797  1.87320  1.85585     ....
+ 100    / 11:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                 10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                  1        2        3        4        5        6        7        8        9       10       11
+ 0      /  1:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 10     /  2:     ....     ....  1.45967  1.43260  1.40123  1.36726  1.33267  1.29921  1.26926  1.24478     ....
+ 20     /  3:     ....  1.62568  1.56605  1.53557  1.49928  1.46429  1.42936  1.39419  1.35912  1.33376  1.35199
+ 30     /  4:     ....  1.73005  1.71421  1.67498  1.64062  1.60574  1.57082  1.53602  1.50175  1.46915  1.44866
+ 40     /  5:     ....  1.82542  1.80687  1.76803  1.73385  1.69895  1.66405  1.62922  1.59477  1.56211  1.53941
+ 50     /  6:     ....  1.90691  1.88519  1.84729  1.81306  1.77816  1.74326  1.70844  1.67399  1.64174  1.61939
+ 60     /  7:     ....  1.97533  1.95176  1.91432  1.88001  1.84511  1.81021  1.77539  1.74096  1.70894  1.68765
+ 70     /  8:     ....  2.03275  2.00991  1.97225  1.93796  1.90306  1.86816  1.83334  1.79890  1.76672  1.74494
+ 80     /  9:     ....  2.08017  2.06127  2.02279  1.98867  1.95377  1.91888  1.88407  1.84963  1.81693  1.79226
+ 90     / 10:     ....  2.11888  2.10181  2.06484  2.03087  1.99606  1.96125  1.92672  1.89288  1.86059  1.83186
+ 100    / 11:     ....     ....  2.11777  2.08710  2.05439  2.02031  1.98599  1.95272  1.92201  1.89466     ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+           SMYT_YS   SMYT_TS   SMYT
+1    /  1:  13.0000   273.75  2.63208
+2    /  2:  14.0000   273.75  2.61474
+3    /  3:  15.0000   273.75  2.59737
+4    /  4:  16.0000   273.75  2.57997
+5    /  5:  17.0000   273.75  2.56255
+6    /  6:  18.0000   273.75  2.54511
+7    /  7:  19.0000   273.75  2.52766
+8    /  8:  20.0000   273.75  2.51021
+9    /  9:  21.0000   273.75  2.49276
+10   / 10:  22.0000   273.75  2.47531
+11   / 11:  23.0000   273.75  2.45787
+12   / 12:  24.0000   273.75  2.44045
+13   / 13:  25.0000   273.75  2.42305
+14   / 14:  26.0000   273.75  2.40568
+15   / 15:  27.0000   273.75  2.38834
+16   / 16:  13.0000   821.25  3.06201
+17   / 17:  14.0000   821.25  3.04467
+18   / 18:  15.0000   821.25  3.02730
+19   / 19:  16.0000   821.25  3.00990
+20   / 20:  17.0000   821.25  2.99248
+21   / 21:  18.0000   821.25  2.97504
+22   / 22:  19.0000   821.25  2.95760
+23   / 23:  20.0000   821.25  2.94014
+24   / 24:  21.0000   821.25  2.92269
+25   / 25:  22.0000   821.25  2.90524
+26   / 26:  23.0000   821.25  2.88781
+27   / 27:  24.0000   821.25  2.87039
+28   / 28:  25.0000   821.25  2.85299
+29   / 29:  26.0000   821.25  2.83561
+30   / 30:  27.0000   821.25  2.81827
+31   / 31:  13.0000  1368.75  3.27378
+32   / 32:  14.0000  1368.75  3.25643
+33   / 33:  15.0000  1368.75  3.23906
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.63208  2.61473  2.57996  2.54511  2.51021  2.47531  2.44046  2.40569  2.38834     ....
+ 15-FEB-1995 /  2:     ....  3.16789  3.15055  3.11578  3.08092  3.04602  3.01113  2.97627  2.94150  2.92415     ....
+ 18-MAR-1995 /  3:     ....  3.41551  3.39816  3.36339  3.32854  3.29364  3.25874  3.22389  3.18912  3.17177     ....
+ 17-APR-1995 /  4:     ....  3.52219  3.50484  3.47007  3.43522  3.40032  3.36542  3.33057  3.29580  3.27845     ....
+ 17-MAY-1995 /  5:     ....  3.64350  3.62615  3.59138  3.55653  3.52163  3.48673  3.45188  3.41711  3.39976     ....
+ 17-JUN-1995 /  6:     ....  3.74057  3.72322  3.68845  3.65360  3.61870  3.58380  3.54895  3.51418  3.49683     ....
+ 17-JUL-1995 /  7:     ....  3.79431  3.77697  3.74220  3.70734  3.67244  3.63755  3.60269  3.56792  3.55057     ....
+ 17-AUG-1995 /  8:     ....  3.86367  3.84632  3.81155  3.77670  3.74180  3.70690  3.67205  3.63728  3.61993     ....
+ 16-SEP-1995 /  9:     ....  3.92439  3.90704  3.87227  3.83741  3.80252  3.76762  3.73277  3.69800  3.68065     ....
+ 16-OCT-1995 / 10:     ....  3.96032  3.94298  3.90821  3.87335  3.83846  3.80356  3.76870  3.73393  3.71659     ....
+ 16-NOV-1995 / 11:     ....  4.00893  3.99158  3.95681  3.92196  3.88706  3.85217  3.81731  3.78254  3.76519     ....
+ 16-DEC-1995 / 12:     ....  4.05314  4.03579  4.00102  3.96616  3.93127  3.89637  3.86152  3.82675  3.80940     ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                      10N      12N      14N      16N      18N      20N      22N      24N      26N      28N      30N    
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  2.80021  2.65506  2.64695  2.61209  2.57719  2.54229  2.50743  2.47319  2.46266  2.52519
+ 15-FEB-1995 /  2:     ....  3.11975  3.18472  3.13605  3.10119  3.06629  3.03139  2.99653  2.96230  2.92477  2.84506
+ 18-MAR-1995 /  3:     ....  3.36860  3.39079  3.34236  3.30750  3.27260  3.23770  3.20284  3.16860  3.13125  3.09408
+ 17-APR-1995 /  4:     ....  3.53416  3.52162  3.48422  3.44936  3.41446  3.37956  3.34470  3.31046  3.28049  3.25971
+ 17-MAY-1995 /  5:     ....  3.65364  3.63083  3.59310  3.55824  3.52333  3.48843  3.45357  3.41934  3.38914  3.37928
+ 17-JUN-1995 /  6:     ....  3.74421  3.71833  3.67938  3.64452  3.60962  3.57471  3.53986  3.50562  3.47462  3.46992
+ 17-JUL-1995 /  7:     ....  3.81408  3.78571  3.74978  3.71492  3.68002  3.64512  3.61026  3.57602  3.54703  3.53974
+ 17-AUG-1995 /  8:     ....  3.87631  3.84944  3.81217  3.77731  3.74241  3.70751  3.67265  3.63841  3.60850  3.60176
+ 16-SEP-1995 /  9:     ....  3.93114  3.90481  3.86643  3.83157  3.79667  3.76177  3.72691  3.69268  3.66199  3.65626
+ 16-OCT-1995 / 10:     ....  3.97707  3.94990  3.91341  3.87855  3.84364  3.80874  3.77388  3.73965  3.71017  3.70185
+ 16-NOV-1995 / 11:     ....  4.01929  3.99483  3.95714  3.92228  3.88737  3.85247  3.81761  3.78338  3.75307  3.74382
+ 16-DEC-1995 / 12:     ....  4.05753  4.03432  3.99551  3.96065  3.92574  3.89084  3.85598  3.82175  3.79068  3.78192
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+           SMZT_ZS   SMZT_TS   SMZT
+1    /  1:  15.0000   273.75  3.90815
+2    /  2:  20.0000   273.75  3.98733
+3    /  3:  25.0000   273.75  4.05428
+4    /  4:  30.0000   273.75  4.11227
+5    /  5:  35.0000   273.75  4.16342
+6    /  6:  40.0000   273.75  4.20918
+7    /  7:  45.0000   273.75  4.25057
+8    /  8:  50.0000   273.75  4.28836
+9    /  9:  55.0000   273.75  4.32312
+10   / 10:  60.0000   273.75  4.35531
+11   / 11:  65.0000   273.75  4.38527
+12   / 12:  70.0000   273.75  4.41330
+13   / 13:  75.0000   273.75  4.43963
+14   / 14:  80.0000   273.75  4.46445
+15   / 15:  85.0000   273.75  4.48793
+16   / 16:  15.0000   821.25  4.33808
+17   / 17:  20.0000   821.25  4.41726
+18   / 18:  25.0000   821.25  4.48421
+19   / 19:  30.0000   821.25  4.54220
+20   / 20:  35.0000   821.25  4.59336
+21   / 21:  40.0000   821.25  4.63911
+22   / 22:  45.0000   821.25  4.68051
+23   / 23:  50.0000   821.25  4.71829
+24   / 24:  55.0000   821.25  4.75306
+25   / 25:  60.0000   821.25  4.78524
+26   / 26:  65.0000   821.25  4.81520
+27   / 27:  70.0000   821.25  4.84323
+28   / 28:  75.0000   821.25  4.86956
+29   / 29:  80.0000   821.25  4.89439
+30   / 30:  85.0000   821.25  4.91787
+31   / 31:  15.0000  1368.75  4.54985
+32   / 32:  20.0000  1368.75  4.62903
+33   / 33:  25.0000  1368.75  4.69597
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  3.90815  3.98474  4.11082  4.20825  4.28772  4.35484  4.41294  4.46417  4.48793     ....
+ 15-FEB-1995 /  2:     ....  4.44396  4.52055  4.64663  4.74407  4.82353  4.89065  4.94875  4.99998  5.02375     ....
+ 18-MAR-1995 /  3:     ....  4.69158  4.76817  4.89425  4.99168  5.07115  5.13827  5.19637  5.24760  5.27136     ....
+ 17-APR-1995 /  4:     ....  4.79826  4.87485  5.00093  5.09837  5.17783  5.24495  5.30305  5.35428  5.37805     ....
+ 17-MAY-1995 /  5:     ....  4.91957  4.99616  5.12224  5.21967  5.29914  5.36626  5.42436  5.47559  5.49935     ....
+ 17-JUN-1995 /  6:     ....  5.01664  5.09323  5.21931  5.31675  5.39621  5.46333  5.52143  5.57266  5.59643     ....
+ 17-JUL-1995 /  7:     ....  5.07038  5.14697  5.27305  5.37049  5.44995  5.51707  5.57517  5.62640  5.65017     ....
+ 17-AUG-1995 /  8:     ....  5.13974  5.21633  5.34241  5.43984  5.51931  5.58643  5.64453  5.69576  5.71952     ....
+ 16-SEP-1995 /  9:     ....  5.20046  5.27705  5.40313  5.50056  5.58003  5.64714  5.70525  5.75648  5.78024     ....
+ 16-OCT-1995 / 10:     ....  5.23640  5.31298  5.43907  5.53650  5.61597  5.68308  5.74119  5.79241  5.81618     ....
+ 16-NOV-1995 / 11:     ....  5.28500  5.36159  5.48767  5.58511  5.66457  5.73169  5.78979  5.84102  5.86479     ....
+ 16-DEC-1995 / 12:     ....  5.32921  5.40580  5.53188  5.62931  5.70878  5.77589  5.83400  5.88523  5.90899     ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                      0        10       20       30       40       50       60       70       80       90      100     
+                       1        2        3        4        5        6        7        8        9       10       11
+ 16-JAN-1995 /  1:     ....  4.01260  4.01103  4.18210  4.27779  4.35640  4.42302  4.48082  4.53115  4.59056  4.66549
+ 15-FEB-1995 /  2:     ....  4.33307  4.54051  4.67120  4.76690  4.84550  4.91213  4.96992  5.02025  5.05263  4.98503
+ 18-MAR-1995 /  3:     ....  4.58238  4.74650  4.87751  4.97320  5.05181  5.11843  5.17623  5.22656  5.25909  5.23387
+ 17-APR-1995 /  4:     ....  4.74816  4.87728  5.01937  5.11506  5.19367  5.26030  5.31809  5.36842  5.40831  5.39943
+ 17-MAY-1995 /  5:     ....  4.86788  4.98645  5.12825  5.22394  5.30254  5.36917  5.42697  5.47730  5.51696  5.51891
+ 17-JUN-1995 /  6:     ....  4.95864  5.07392  5.21453  5.31022  5.38882  5.45545  5.51325  5.56358  5.60243  5.60948
+ 17-JUL-1995 /  7:     ....  5.02839  5.14132  5.28493  5.38062  5.45923  5.52585  5.58365  5.63398  5.67485  5.67935
+ 17-AUG-1995 /  8:     ....  5.09002  5.20515  5.34732  5.44301  5.52162  5.58824  5.64604  5.69637  5.73635  5.74158
+ 16-SEP-1995 /  9:     ....  5.14392  5.26070  5.40159  5.49728  5.57588  5.64251  5.70031  5.75064  5.78987  5.79641
+ 16-OCT-1995 / 10:     ....  5.18891  5.30597  5.44856  5.54425  5.62285  5.68948  5.74728  5.79761  5.83810  5.84235
+ 16-NOV-1995 / 11:     ....  5.23042  5.35103  5.49229  5.58798  5.66658  5.73321  5.79101  5.84134  5.88103  5.88458
+ 16-DEC-1995 / 12:     ....  5.26827  5.39059  5.53066  5.62635  5.70495  5.77158  5.82938  5.87971  5.91865  5.92282
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G017)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                 68.25N   68.75N   69.25N   69.75N   70.25N   70.75N   71.25N   71.75N  
+                  43       44       45       46       47       48       49       50
+ 15.5E / -105:     ....     ....     ....     ....     ....     ....     ....     ....
+ 16.5E / -104:     ....     ....     ....     ....     ....     ....     ....     ....
+ 17.5E / -103:     ....     ....     ....     ....     ....     ....     ....     ....
+ 18.5E / -102:     ....     ....     ....  0.45146  0.25859     ....     ....     ....
+ 19.5E / -101:     ....     ....  0.67000  0.52258  0.17310  0.04000     ....     ....
+ 20.5E / -100:     ....     ....     ....  0.45141  0.25856     ....     ....     ....
+ 21.5E /  -99:     ....     ....     ....     ....     ....     ....     ....     ....
+ 22.5E /  -98:     ....     ....     ....     ....     ....     ....     ....     ....
+ 23.5E /  -97:     ....     ....     ....     ....     ....     ....     ....     ....
+ 24.5E /  -96:     ....     ....     ....     ....     ....     ....     ....     ....
+ 25.5E /  -95:     ....     ....     ....     ....     ....     ....     ....     ....
+ 26.5E /  -94:     ....     ....     ....     ....     ....     ....     ....     ....
+ 27.5E /  -93:     ....     ....     ....     ....     ....     ....     ....     ....
+ 28.5E /  -92:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 29.5E /  -91:     ....     ....     ....  1.17000  1.17000  1.17000     ....     ....
+ 30.5E /  -90:     ....     ....     ....     ....  1.17000     ....     ....     ....
+ 31.5E /  -89:     ....     ....     ....     ....     ....     ....     ....     ....
+ 32.5E /  -88:     ....     ....     ....     ....     ....     ....     ....     ....
+ 33.5E /  -87:     ....     ....     ....     ....     ....     ....     ....     ....
+ 34.5E /  -86:     ....     ....     ....     ....     ....     ....     ....     ....
+ 35.5E /  -85:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 36.5E /  -84:     ....  1.34000  1.34000  1.34000     ....     ....     ....     ....
+ 37.5E /  -83:     ....     ....  1.34000     ....     ....     ....     ....     ....
+ 38.5E /  -82:     ....     ....     ....     ....     ....     ....     ....     ....
+ 39.5E /  -81:     ....     ....     ....     ....     ....     ....     ....     ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.000
+ 172E   /  2:  172.000
+ 174E   /  3:  174.000
+ 176E   /  4:  176.000
+ 178E   /  5:  178.000
+ 180E   /  6:  180.000
+ 178W   /  7:  182.000
+ 176W   /  8:  184.000
+ 174W   /  9:  186.000
+ 172W   / 10:  188.000
+ 170W   / 11:  190.000
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+           SMXY_XS   SMXY_YS    SMXY
+1    /  1:  173.000  13.0000  0.243739
+2    /  2:  174.000  13.0000  0.226398
+3    /  3:  175.000  13.0000  0.209025
+4    /  4:  176.000  13.0000  0.191626
+5    /  5:  177.000  13.0000  0.174205
+6    /  6:  178.000  13.0000  0.156769
+7    /  7:  179.000  13.0000  0.139322
+8    /  8:  180.000  13.0000  0.121869
+9    /  9: -179.000  13.0000  0.104417
+10   / 10: -178.000  13.0000  0.086970
+11   / 11: -177.000  13.0000  0.069533
+12   / 12: -176.000  13.0000  0.052113
+13   / 13: -175.000  13.0000  0.034714
+14   / 14: -174.000  13.0000  0.017341
+15   / 15: -173.000  13.0000  0.000000
+16   / 16:  173.000  14.0000  0.226398
+17   / 17:  174.000  14.0000  0.209057
+18   / 18:  175.000  14.0000  0.191684
+19   / 19:  176.000  14.0000  0.174285
+20   / 20:  177.000  14.0000  0.156864
+21   / 21:  178.000  14.0000  0.139428
+22   / 22:  179.000  14.0000  0.121981
+23   / 23:  180.000  14.0000  0.104528
+24   / 24: -179.000  14.0000  0.087076
+25   / 25: -178.000  14.0000  0.069629
+26   / 26: -177.000  14.0000  0.052193
+27   / 27: -176.000  14.0000  0.034772
+28   / 28: -175.000  14.0000  0.017373
+29   / 29: -174.000  14.0000  0.000000
+30   / 30: -173.000  14.0000 -0.017341
+31   / 31:  173.000  15.0000  0.209025
+32   / 32:  174.000  15.0000  0.191684
+33   / 33:  175.000  15.0000  0.174311
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+          SMXYT_XS  SMXYT_YS SMXYT_TS   SMXYT
+1    /  1:  173.000  13.0000  273.750  2.75395
+2    /  2:  174.000  13.0000  273.750  2.73661
+3    /  3:  175.000  13.0000  273.750  2.71923
+4    /  4:  176.000  13.0000  273.750  2.70184
+5    /  5:  177.000  13.0000  273.750  2.68442
+6    /  6:  178.000  13.0000  273.750  2.66698
+7    /  7:  179.000  13.0000  273.750  2.64953
+8    /  8:  180.000  13.0000  273.750  2.63208
+9    /  9: -179.000  13.0000  273.750  2.61463
+10   / 10: -178.000  13.0000  273.750  2.59718
+11   / 11: -177.000  13.0000  273.750  2.57974
+12   / 12: -176.000  13.0000  273.750  2.56232
+13   / 13: -175.000  13.0000  273.750  2.54492
+14   / 14: -174.000  13.0000  273.750  2.52755
+15   / 15: -173.000  13.0000  273.750  2.51021
+16   / 16:  173.000  14.0000  273.750  2.73661
+17   / 17:  174.000  14.0000  273.750  2.71927
+18   / 18:  175.000  14.0000  273.750  2.70189
+19   / 19:  176.000  14.0000  273.750  2.68449
+20   / 20:  177.000  14.0000  273.750  2.66707
+21   / 21:  178.000  14.0000  273.750  2.64964
+22   / 22:  179.000  14.0000  273.750  2.63219
+23   / 23:  180.000  14.0000  273.750  2.61474
+24   / 24: -179.000  14.0000  273.750  2.59729
+25   / 25: -178.000  14.0000  273.750  2.57984
+26   / 26: -177.000  14.0000  273.750  2.56240
+27   / 27: -176.000  14.0000  273.750  2.54498
+28   / 28: -175.000  14.0000  273.750  2.52758
+29   / 29: -174.000  14.0000  273.750  2.51021
+30   / 30: -173.000  14.0000  273.750  2.49287
+31   / 31:  173.000  15.0000  273.750  2.71923
+32   / 32:  174.000  15.0000  273.750  2.70189
+33   / 33:  175.000  15.0000  273.750  2.68452
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+               170E     172E     174E     176E     178E      180E    178W     176W     174W     172W     170W    
+                 1        2        3        4        5        6        7        8        9       10       11
+ ---- L:1 T:   JAN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:2 T:   FEB-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:3 T:   MAR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:4 T:   APR-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:5 T:   MAY-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:6 T:   JUN-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:7 T:   JUL-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:8 T:   AUG-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:9 T:   SEP-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:10 T:   OCT-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:11 T:   NOV-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  8.00000  4.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ ---- L:12 T:   DEC-1995
+ 30N   / 11:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 28N   / 10:  0.00000  0.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  2.00000  1.00000  0.00000
+ 26N   /  9:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 24N   /  8:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 22N   /  7:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 20N   /  6:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 18N   /  5:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 16N   /  4:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 14N   /  3:  0.00000  0.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  4.00000  2.00000  0.00000
+ 12N   /  2:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 10N   /  1:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: JAN-1995 to JAN-1996
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                   LTP50_TAX   LOGTP50
+06-JAN-1995 16 /  1:   136.88  2.27155
+18-JAN-1995 02 /  2:   410.63  2.66335
+29-JAN-1995 12 /  3:   684.38  2.86592
+09-FEB-1995 22 /  4:   958.13  3.00351
+21-FEB-1995 07 /  5:  1231.88  3.10785
+04-MAR-1995 17 /  6:  1505.63  3.19190
+16-MAR-1995 03 /  7:  1779.38  3.26230
+27-MAR-1995 13 /  8:  2053.13  3.32287
+07-APR-1995 22 /  9:  2326.88  3.37601
+19-APR-1995 08 / 10:  2600.63  3.42335
+30-APR-1995 18 / 11:  2874.38  3.46603
+12-MAY-1995 04 / 12:  3148.13  3.50490
+23-MAY-1995 13 / 13:  3421.88  3.54056
+03-JUN-1995 23 / 14:  3695.63  3.57352
+15-JUN-1995 09 / 15:  3969.38  3.60416
+26-JUN-1995 19 / 16:  4243.13  3.63277
+08-JUL-1995 04 / 17:  4516.88  3.65962
+19-JUL-1995 14 / 18:  4790.63  3.68490
+31-JUL-1995 00 / 19:  5064.38  3.70879
+11-AUG-1995 10 / 20:  5338.13  3.73144
+22-AUG-1995 19 / 21:  5611.88  3.75296
+03-SEP-1995 05 / 22:  5885.63  3.77347
+14-SEP-1995 15 / 23:  6159.38  3.79305
+26-SEP-1995 01 / 24:  6433.13  3.81178
+07-OCT-1995 10 / 25:  6706.88  3.82975
+18-OCT-1995 20 / 26:  6980.63  3.84699
+30-OCT-1995 06 / 27:  7254.38  3.86358
+10-NOV-1995 16 / 28:  7528.13  3.87956
+22-NOV-1995 01 / 29:  7801.88  3.89497
+03-DEC-1995 11 / 30:  8075.63  3.90986
+14-DEC-1995 21 / 31:  8349.38  3.92425
+26-DEC-1995 07 / 32:  8623.13  3.93818
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: JAN-1995 to JAN-1996
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                  NEW_TAX    AVE_T    T_CNT
+16-JAN-1995 /  1:   365.00  2.60027  3.00000
+15-FEB-1995 /  2:  1095.00  3.05568  2.00000
+18-MAR-1995 /  3:  1825.00  3.25902  3.00000
+17-APR-1995 /  4:  2555.00  3.42180  3.00000
+17-MAY-1995 /  5:  3285.00  3.52273  2.00000
+17-JUN-1995 /  6:  4015.00  3.60349  3.00000
+17-JUL-1995 /  7:  4745.00  3.68444  3.00000
+17-AUG-1995 /  8:  5475.00  3.74220  2.00000
+16-SEP-1995 /  9:  6205.00  3.79277  3.00000
+16-OCT-1995 / 10:  6935.00  3.84677  3.00000
+16-NOV-1995 / 11:  7665.00  3.88727  2.00000
+16-DEC-1995 / 12:  8395.00  3.92409  3.00000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+              1        2        3        4     
+              1        2        3        4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    5.000   10.000   15.000
+ 2   / 2:    1.000    6.000   11.000   16.000
+ 3   / 3:    2.000    7.000   12.000   17.000
+ 4   / 4:    3.000    8.000   13.000   18.000
+ 5   / 5:    4.000    9.000   14.000   19.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   25.000   30.000   35.000
+ 2   / 2:   21.000   26.000   31.000   36.000
+ 3   / 3:   22.000   27.000   32.000   37.000
+ 4   / 4:   23.000   28.000   33.000   38.000
+ 5   / 5:   24.000   29.000   34.000   39.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   45.000   50.000   55.000
+ 2   / 2:   41.000   46.000   51.000   56.000
+ 3   / 3:   42.000   47.000   52.000   57.000
+ 4   / 4:   43.000   48.000   53.000   58.000
+ 5   / 5:   44.000   49.000   54.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.000   65.000   70.000   75.000
+ 2   / 2:   61.000   66.000   71.000   76.000
+ 3   / 3:   62.000   67.000   72.000   77.000
+ 4   / 4:   63.000   68.000   73.000   78.000
+ 5   / 5:   64.000   69.000   74.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   80.000   85.000   90.000   95.000
+ 2   / 2:   81.000   86.000   91.000   96.000
+ 3   / 3:   82.000   87.000   92.000   97.000
+ 4   / 4:   83.000   88.000   93.000   98.000
+ 5   / 5:   84.000   89.000   94.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:  100.000  105.000  110.000  115.000
+ 2   / 2:  101.000  106.000  111.000  116.000
+ 3   / 3:  102.000  107.000  112.000  117.000
+ 4   / 4:  103.000  108.000  113.000  118.000
+ 5   / 5:  104.000  109.000  114.000  119.000
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.000   20.000   40.000
+ 1   / 2:    5.000   25.000   45.000
+ 2   / 3:   10.000   30.000   50.000
+ 3   / 4:   15.000   35.000   55.000
+ ---- K:2 Z:   2
+ 0   / 1:    1.000   21.000   41.000
+ 1   / 2:    6.000   26.000   46.000
+ 2   / 3:   11.000   31.000   51.000
+ 3   / 4:   16.000   36.000   56.000
+ ---- K:3 Z:   3
+ 0   / 1:    2.000   22.000   42.000
+ 1   / 2:    7.000   27.000   47.000
+ 2   / 3:   12.000   32.000   52.000
+ 3   / 4:   17.000   37.000   57.000
+ ---- K:4 Z:   4
+ 0   / 1:    3.000   23.000   43.000
+ 1   / 2:    8.000   28.000   48.000
+ 2   / 3:   13.000   33.000   53.000
+ 3   / 4:   18.000   38.000   58.000
+ ---- K:5 Z:   5
+ 0   / 1:    4.000   24.000   44.000
+ 1   / 2:    9.000   29.000   49.000
+ 2   / 3:   14.000   34.000   54.000
+ 3   / 4:   19.000   39.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.000   80.000  100.000
+ 1   / 2:   65.000   85.000  105.000
+ 2   / 3:   70.000   90.000  110.000
+ 3   / 4:   75.000   95.000  115.000
+ ---- K:2 Z:   2
+ 0   / 1:   61.000   81.000  101.000
+ 1   / 2:   66.000   86.000  106.000
+ 2   / 3:   71.000   91.000  111.000
+ 3   / 4:   76.000   96.000  116.000
+ ---- K:3 Z:   3
+ 0   / 1:   62.000   82.000  102.000
+ 1   / 2:   67.000   87.000  107.000
+ 2   / 3:   72.000   92.000  112.000
+ 3   / 4:   77.000   97.000  117.000
+ ---- K:4 Z:   4
+ 0   / 1:   63.000   83.000  103.000
+ 1   / 2:   68.000   88.000  108.000
+ 2   / 3:   73.000   93.000  113.000
+ 3   / 4:   78.000   98.000  118.000
+ ---- K:5 Z:   5
+ 0   / 1:   64.000   84.000  104.000
+ 1   / 2:   69.000   89.000  109.000
+ 2   / 3:   74.000   94.000  114.000
+ 3   / 4:   79.000   99.000  119.000
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+              1        2     
+              1        2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.000   60.000
+ 1   / 2:    5.000   65.000
+ 2   / 3:   10.000   70.000
+ 3   / 4:   15.000   75.000
+ ---- K:2 Z:   1
+ 0   / 1:   20.000   80.000
+ 1   / 2:   25.000   85.000
+ 2   / 3:   30.000   90.000
+ 3   / 4:   35.000   95.000
+ ---- K:3 Z:   2
+ 0   / 1:   40.000  100.000
+ 1   / 2:   45.000  105.000
+ 2   / 3:   50.000  110.000
+ 3   / 4:   55.000  115.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.000   61.000
+ 1   / 2:    6.000   66.000
+ 2   / 3:   11.000   71.000
+ 3   / 4:   16.000   76.000
+ ---- K:2 Z:   1
+ 0   / 1:   21.000   81.000
+ 1   / 2:   26.000   86.000
+ 2   / 3:   31.000   91.000
+ 3   / 4:   36.000   96.000
+ ---- K:3 Z:   2
+ 0   / 1:   41.000  101.000
+ 1   / 2:   46.000  106.000
+ 2   / 3:   51.000  111.000
+ 3   / 4:   56.000  116.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.000   62.000
+ 1   / 2:    7.000   67.000
+ 2   / 3:   12.000   72.000
+ 3   / 4:   17.000   77.000
+ ---- K:2 Z:   1
+ 0   / 1:   22.000   82.000
+ 1   / 2:   27.000   87.000
+ 2   / 3:   32.000   92.000
+ 3   / 4:   37.000   97.000
+ ---- K:3 Z:   2
+ 0   / 1:   42.000  102.000
+ 1   / 2:   47.000  107.000
+ 2   / 3:   52.000  112.000
+ 3   / 4:   57.000  117.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.000   63.000
+ 1   / 2:    8.000   68.000
+ 2   / 3:   13.000   73.000
+ 3   / 4:   18.000   78.000
+ ---- K:2 Z:   1
+ 0   / 1:   23.000   83.000
+ 1   / 2:   28.000   88.000
+ 2   / 3:   33.000   93.000
+ 3   / 4:   38.000   98.000
+ ---- K:3 Z:   2
+ 0   / 1:   43.000  103.000
+ 1   / 2:   48.000  108.000
+ 2   / 3:   53.000  113.000
+ 3   / 4:   58.000  118.000
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.000   64.000
+ 1   / 2:    9.000   69.000
+ 2   / 3:   14.000   74.000
+ 3   / 4:   19.000   79.000
+ ---- K:2 Z:   1
+ 0   / 1:   24.000   84.000
+ 1   / 2:   29.000   89.000
+ 2   / 3:   34.000   94.000
+ 3   / 4:   39.000   99.000
+ ---- K:3 Z:   2
+ 0   / 1:   44.000  104.000
+ 1   / 2:   49.000  109.000
+ 2   / 3:   54.000  114.000
+ 3   / 4:   59.000  119.000
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   20.000   21.000   22.000   23.000   24.000
+ 3   / 3:   40.000   41.000   42.000   43.000   44.000
+ ---- K:2 Z:   2
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   25.000   26.000   27.000   28.000   29.000
+ 3   / 3:   45.000   46.000   47.000   48.000   49.000
+ ---- K:3 Z:   3
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   30.000   31.000   32.000   33.000   34.000
+ 3   / 3:   50.000   51.000   52.000   53.000   54.000
+ ---- K:4 Z:   4
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   35.000   36.000   37.000   38.000   39.000
+ 3   / 3:   55.000   56.000   57.000   58.000   59.000
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.000   61.000   62.000   63.000   64.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ 3   / 3:  100.000  101.000  102.000  103.000  104.000
+ ---- K:2 Z:   2
+ 1   / 1:   65.000   66.000   67.000   68.000   69.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ 3   / 3:  105.000  106.000  107.000  108.000  109.000
+ ---- K:3 Z:   3
+ 1   / 1:   70.000   71.000   72.000   73.000   74.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ 3   / 3:  110.000  111.000  112.000  113.000  114.000
+ ---- K:4 Z:   4
+ 1   / 1:   75.000   76.000   77.000   78.000   79.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ 3   / 3:  115.000  116.000  117.000  118.000  119.000
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.000    1.000    2.000    3.000    4.000
+ 2   / 2:   60.000   61.000   62.000   63.000   64.000
+ ---- K:2 Z:   1
+ 1   / 1:   20.000   21.000   22.000   23.000   24.000
+ 2   / 2:   80.000   81.000   82.000   83.000   84.000
+ ---- K:3 Z:   2
+ 1   / 1:   40.000   41.000   42.000   43.000   44.000
+ 2   / 2:  100.000  101.000  102.000  103.000  104.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.000    6.000    7.000    8.000    9.000
+ 2   / 2:   65.000   66.000   67.000   68.000   69.000
+ ---- K:2 Z:   1
+ 1   / 1:   25.000   26.000   27.000   28.000   29.000
+ 2   / 2:   85.000   86.000   87.000   88.000   89.000
+ ---- K:3 Z:   2
+ 1   / 1:   45.000   46.000   47.000   48.000   49.000
+ 2   / 2:  105.000  106.000  107.000  108.000  109.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.000   11.000   12.000   13.000   14.000
+ 2   / 2:   70.000   71.000   72.000   73.000   74.000
+ ---- K:2 Z:   1
+ 1   / 1:   30.000   31.000   32.000   33.000   34.000
+ 2   / 2:   90.000   91.000   92.000   93.000   94.000
+ ---- K:3 Z:   2
+ 1   / 1:   50.000   51.000   52.000   53.000   54.000
+ 2   / 2:  110.000  111.000  112.000  113.000  114.000
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.000   16.000   17.000   18.000   19.000
+ 2   / 2:   75.000   76.000   77.000   78.000   79.000
+ ---- K:2 Z:   1
+ 1   / 1:   35.000   36.000   37.000   38.000   39.000
+ 2   / 2:   95.000   96.000   97.000   98.000   99.000
+ ---- K:3 Z:   2
+ 1   / 1:   55.000   56.000   57.000   58.000   59.000
+ 2   / 2:  115.000  116.000  117.000  118.000  119.000
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+              0        1        2        3        4     
+              1        2        3        4        5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.000    1.000    2.000    3.000    4.000
+ 1   / 2:    5.000    6.000    7.000    8.000    9.000
+ 2   / 3:   10.000   11.000   12.000   13.000   14.000
+ 3   / 4:   15.000   16.000   17.000   18.000   19.000
+ ---- K:2 Z:   2
+ 0   / 1:   60.000   61.000   62.000   63.000   64.000
+ 1   / 2:   65.000   66.000   67.000   68.000   69.000
+ 2   / 3:   70.000   71.000   72.000   73.000   74.000
+ 3   / 4:   75.000   76.000   77.000   78.000   79.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.000   21.000   22.000   23.000   24.000
+ 1   / 2:   25.000   26.000   27.000   28.000   29.000
+ 2   / 3:   30.000   31.000   32.000   33.000   34.000
+ 3   / 4:   35.000   36.000   37.000   38.000   39.000
+ ---- K:2 Z:   2
+ 0   / 1:   80.000   81.000   82.000   83.000   84.000
+ 1   / 2:   85.000   86.000   87.000   88.000   89.000
+ 2   / 3:   90.000   91.000   92.000   93.000   94.000
+ 3   / 4:   95.000   96.000   97.000   98.000   99.000
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.000   41.000   42.000   43.000   44.000
+ 1   / 2:   45.000   46.000   47.000   48.000   49.000
+ 2   / 3:   50.000   51.000   52.000   53.000   54.000
+ 3   / 4:   55.000   56.000   57.000   58.000   59.000
+ ---- K:2 Z:   2
+ 0   / 1:  100.000  101.000  102.000  103.000  104.000
+ 1   / 2:  105.000  106.000  107.000  108.000  109.000
+ 2   / 3:  110.000  111.000  112.000  113.000  114.000
+ 3   / 4:  115.000  116.000  117.000  118.000  119.000
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+              EX#1                      ALIST
+1    /  1:  1.00000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.00000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.00000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.00000 ""                                           
+6    /  6:  5.00000 ""                                           
+7    /  7:  4.00000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.00000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.00000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.00000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.00000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+            EX#1                      BLIST
+1   / 1:  3.00000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.00000 ""                                           
+3   / 3:  6.00000 "Something new has been added"               
+4   / 4:  4.00000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.00000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.00000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+SORTI_STR(DAT)
+    Returns indices of string data, sorted on the I axis in increasing order
+    DAT: String variable to sort in I (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : FEB
+                 39N    
+                 65
+ 141E   / 61:   8.8575
+ 143E   / 62:   8.5178
+ 145E   / 63:   9.2910
+ 147E   / 64:  10.2489
+ 149E   / 65:  10.9823
+ 151E   / 66:  10.8754
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  62.0000   8.5178
+2   / 2:  61.0000   8.8575
+3   / 3:  63.0000   9.2910
+4   / 4:  64.0000  10.2489
+5   / 5:  66.0000  10.8754
+6   / 6:  65.0000  10.9823
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : JAN
+               1S     
+               45
+ 1    /  1:  23.7595
+ 2    /  2:  23.8632
+ 3    /  3:  23.8882
+ 4    /  4:  23.9519
+ 5    /  5:  23.9616
+ 6    /  6:  24.0241
+ 7    /  7:  24.0481
+ 8    /  8:  24.0854
+ 9    /  9:  24.2126
+ 10   / 10:  24.2807
+ 11   / 11:  24.3114
+ 12   / 12:  24.3562
+ 13   / 13:  24.3861
+ 14   / 14:  24.4567
+ 15   / 15:  24.4717
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : JAN
+          147.000
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : FEB
+               141E    
+                61
+ 49N   / 70:  1.88296
+ 47N   / 69:  2.01405
+ 45N   / 68:  3.44455
+ 43N   / 67:  4.55859
+ 41N   / 66:  6.47285
+ 39N   / 65:  8.85749
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: FEB
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+        TSORTED_  TSORTED_SST
+1   / 1:  70.0000  1.88296
+2   / 2:  69.0000  2.01405
+3   / 3:  68.0000  3.44455
+4   / 4:  67.0000  4.55859
+5   / 5:  66.0000  6.47285
+6   / 6:  65.0000  8.85749
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : JAN
+               19E    
+                0
+ 1    /  1: -0.12500
+ 2    /  2:  0.05400
+ 3    /  3:  0.18556
+ 4    /  4:  0.30000
+ 5    /  5:  0.43875
+ 6    /  6:  0.62500
+ 7    /  7:  0.66000
+ 8    /  8:  0.72750
+ 9    /  9:  0.79955
+ 10   / 10:  1.29667
+ 11   / 11:  1.58765
+ 12   / 12:  1.60684
+ 13   / 13:  1.91667
+ 14   / 14:  2.05857
+ 15   / 15:  2.69400
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : JAN
+          32.0000
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.833S
+             TIME     : AUG-1982
+              131.5W  
+               99
+ 1    /  1:  24.6576
+ 2    /  2:  25.2599
+ 3    /  3:  25.7023
+ 4    /  4:  26.0588
+ 5    /  5:  26.1281
+ 6    /  6:  26.1309
+ 7    /  7:  26.1387
+ 8    /  8:  26.1637
+ 9    /  9:  26.2191
+ 10   / 10:  26.3090
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : JAN
+          28.8626
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+          28.8626
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : JAN
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                    141E    
+                     61
+ 16-JAN      / 1:  11.0274
+ 15-FEB      / 2:   8.8575
+ 17-MAR      / 3:   8.3911
+ 16-AUG      / 4:     ....
+ 15-JAN      / 5:  11.0274
+ 14-FEB      / 6:   8.8575
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+            141E    
+             61
+ 1   / 1:  11.0274
+ 2   / 2:   8.3911
+ 3   / 3:  11.0274
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+        TSORTED_  TSORTED_SST
+1   / 1:  3.00000   8.3911
+2   / 2:  2.00000   8.8575
+3   / 3:  1.00000  11.0274
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-JAN-1946 12 /  1:     ....
+ 15-FEB-1946 00 /  2:     ....
+ 16-MAR-1946 12 /  3:     ....
+ 16-APR-1946 00 /  4:     ....
+ 16-MAY-1946 12 /  5:     ....
+ 16-JUN-1946 00 /  6:     ....
+ 16-JUL-1946 12 /  7:     ....
+ 16-AUG-1946 12 /  8:     ....
+ 16-SEP-1946 00 /  9:     ....
+ 16-OCT-1946 12 / 10:     ....
+ 16-NOV-1946 00 / 11:     ....
+ 16-DEC-1946 12 / 12:  12.3500
+ 16-JAN-1947 12 / 13:     ....
+ 15-FEB-1947 00 / 14:     ....
+ 16-MAR-1947 12 / 15:     ....
+ 16-APR-1947 00 / 16:   0.0000
+ 16-MAY-1947 12 / 17:     ....
+ 16-JUN-1947 00 / 18:     ....
+ 16-JUL-1947 12 / 19:     ....
+ 16-AUG-1947 12 / 20:     ....
+ 16-SEP-1947 00 / 21:   6.6000
+ 16-OCT-1947 12 / 22:     ....
+ 16-NOV-1947 00 / 23:     ....
+ 16-DEC-1947 12 / 24:     ....
+ 16-JAN-1948 12 / 25:   4.5000
+ 15-FEB-1948 12 / 26:     ....
+ 16-MAR-1948 12 / 27:     ....
+ 16-APR-1948 00 / 28:     ....
+ 16-MAY-1948 12 / 29:     ....
+ 16-JUN-1948 00 / 30:   4.7000
+ 16-JUL-1948 12 / 31:     ....
+ 16-AUG-1948 12 / 32:     ....
+ 16-SEP-1948 00 / 33:  -5.8000
+ 16-OCT-1948 12 / 34:   0.4500
+ 16-NOV-1948 00 / 35:     ....
+ 16-DEC-1948 12 / 36:     ....
+ 16-JAN-1949 12 / 37:   4.2300
+ 15-FEB-1949 00 / 38:  -1.0800
+ 16-MAR-1949 12 / 39:   2.0700
+ 16-APR-1949 00 / 40:   0.8300
+ 16-MAY-1949 12 / 41:   0.0000
+ 16-JUN-1949 00 / 42:   5.3700
+ 16-JUL-1949 12 / 43:  -1.3000
+ 16-AUG-1949 12 / 44:   1.3800
+ 16-SEP-1949 00 / 45:   5.9200
+ 16-OCT-1949 12 / 46:   0.7100
+ 16-NOV-1949 00 / 47:  -0.9400
+ 16-DEC-1949 12 / 48:  -0.5200
+ 16-JAN-1950 12 / 49:   1.5800
+ 15-FEB-1950 00 / 50:   4.9300
+ 16-MAR-1950 12 / 51:   3.5100
+ 16-APR-1950 00 / 52:   4.5400
+ 16-MAY-1950 12 / 53:   1.6000
+ 16-JUN-1950 00 / 54:   1.3300
+ 16-JUL-1950 12 / 55:   0.9000
+ 16-AUG-1950 12 / 56:  -0.4500
+ 16-SEP-1950 00 / 57:   3.5700
+ 16-OCT-1950 12 / 58:  -8.7500
+ 16-NOV-1950 00 / 59:  -5.2400
+ 16-DEC-1950 12 / 60:  -6.4700
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 61
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+        TSORTED_IN  TSORTED_WND
+1    /  1:  58.0000  -8.7500
+2    /  2:  60.0000  -6.4700
+3    /  3:  33.0000  -5.8000
+4    /  4:  59.0000  -5.2400
+5    /  5:  43.0000  -1.3000
+6    /  6:  38.0000  -1.0800
+7    /  7:  47.0000  -0.9400
+8    /  8:  48.0000  -0.5200
+9    /  9:  56.0000  -0.4500
+10   / 10:  41.0000   0.0000
+11   / 11:  16.0000   0.0000
+12   / 12:  34.0000   0.4500
+13   / 13:  46.0000   0.7100
+14   / 14:  40.0000   0.8300
+15   / 15:  55.0000   0.9000
+16   / 16:  54.0000   1.3300
+17   / 17:  44.0000   1.3800
+18   / 18:  49.0000   1.5800
+19   / 19:  53.0000   1.6000
+20   / 20:  39.0000   2.0700
+21   / 21:  51.0000   3.5100
+22   / 22:  57.0000   3.5700
+23   / 23:  37.0000   4.2300
+24   / 24:  25.0000   4.5000
+25   / 25:  52.0000   4.5400
+26   / 26:  30.0000   4.7000
+27   / 27:  50.0000   4.9300
+28   / 28:  42.0000   5.3700
+29   / 29:  45.0000   5.9200
+30   / 30:  21.0000   6.6000
+31   / 31:  12.0000  12.3500
+32   / 32:     ....     ....
+33   / 33:     ....     ....
+34   / 34:     ....     ....
+35   / 35:     ....     ....
+36   / 36:     ....     ....
+37   / 37:     ....     ....
+38   / 38:     ....     ....
+39   / 39:     ....     ....
+40   / 40:     ....     ....
+41   / 41:     ....     ....
+42   / 42:     ....     ....
+43   / 43:     ....     ....
+44   / 44:     ....     ....
+45   / 45:     ....     ....
+46   / 46:     ....     ....
+47   / 47:     ....     ....
+48   / 48:     ....     ....
+49   / 49:     ....     ....
+50   / 50:     ....     ....
+51   / 51:     ....     ....
+52   / 52:     ....     ....
+53   / 53:     ....     ....
+54   / 54:     ....     ....
+55   / 55:     ....     ....
+56   / 56:     ....     ....
+57   / 57:     ....     ....
+58   / 58:     ....     ....
+59   / 59:     ....     ....
+60   / 60:     ....     ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 61
+          31.0000
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 61
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955  26.7131
+ 15-FEB      / 2:  28.5508  28.2499  26.3700
+ 17-MAR      / 3:  28.8764  28.4775  26.3180
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  28.2696  26.7131
+ 15-FEB      / 2:  28.5508  28.4857  26.3700
+ 17-MAR      / 3:  28.8764  28.6147  26.3180
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.22661
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+            161W    
+             90
+ 1   / 1:  1.60000
+ 2   / 2: -0.40645
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+               27W       25W       23W     
+               157       158       159
+ ---- L:1 T:   1
+ 3N   / 47: -0.175348 -0.178392 -0.309239
+ 1N   / 46: -0.308620 -0.280936 -0.291017
+ 1S   / 45: -0.271470 -0.497559 -0.595639
+ ---- L:2 T:   2
+ 3N   / 47: -0.052492 -0.002775 -0.124133
+ 1N   / 46:  0.064590  0.057180 -0.069549
+ 1S   / 45:  0.121296  0.039745 -0.034207
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:   9.0000   9.0000   9.0000
+ 2   / 2:  95.8009   4.1991   0.0000
+ 3   / 3:   1.0931   0.0479   0.0000
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                      1        2     
+                      1        2
+ 16-JAN      / 1:  1.17837 -0.78194
+ 15-FEB      / 2:  0.08800  1.41147
+ 17-MAR      / 3: -1.26637 -0.62953
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:101 T:   101
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+ ---- L:102 T:   102
+ 10   / 10:  10.0000  30.0000  50.0000     ....     ....
+ 11   / 11:  10.0000  30.0000  50.0000     ....     ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                  1        2        3        4        5     
+                  1        2        3        4        5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.0000  30.0000  50.0000     ....     ....
+ 202   / 202:  20.0000  40.0000     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : JAN
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : JAN
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : JAN
+                91W    
+               125
+ 55N   / 73:     ....
+ 53N   / 72:     ....
+ 51N   / 71:     ....
+ 49N   / 70:     ....
+ 47N   / 69:   2.6969
+ 45N   / 68:  13.3500
+ 43N   / 67:     ....
+ 41N   / 66:     ....
+ 39N   / 65:     ....
+ 37N   / 64:     ....
+ 35N   / 63:     ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : JAN
+               91W    
+              125
+ 1    /  1:  13.3500
+ 2    /  2:   2.6969
+ 3    /  3:     ....
+ 4    /  4:     ....
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 11   / 11:     ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+               139.5W  
+                91
+ 5     /  1:     ....
+ 15    /  2:     ....
+ 25    /  3:     ....
+ 35    /  4:     ....
+ 45    /  5:     ....
+ 55    /  6:     ....
+ 65    /  7:  26.3984
+ 75    /  8:  26.0190
+ 85    /  9:  25.6663
+ 95    / 10:  25.3181
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : AUG-1982
+              139.5W  
+               91
+ 1    /  1:  26.3984
+ 2    /  2:  26.0190
+ 3    /  3:  25.6663
+ 4    /  4:  25.3181
+ 5    /  5:     ....
+ 6    /  6:     ....
+ 7    /  7:     ....
+ 8    /  8:     ....
+ 9    /  9:     ....
+ 10   / 10:     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.0000
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.000000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.0000
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.0000
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.785000
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  335.000  359.000  269.000   57.000  195.000   73.000  101.000  209.000   87.000  167.000
+ 2   / 2:  -69.000  -63.000  -25.000  -13.000  -13.000  -11.000  -11.000  -11.000   -9.000   -9.000
+ 3   / 3:    0.340    0.863   23.271   28.382   29.675   28.470   28.341   28.881   28.429   29.847
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : JAN
+              1        2        3        4        5        6        7        8        9       10     
+              1        2        3        4        5        6        7        8        9       10
+ 1   / 1:  331.000  365.000  147.000   79.000  119.000   65.000   83.000  125.000  157.000  237.000
+ 2   / 2:  -65.000  -61.000  -59.000  -53.000   -9.000   -7.000   -7.000   -7.000   -3.000   -1.000
+ 3   / 3:   -0.766   -0.063    0.400    1.607   28.333   27.646   27.757   28.387   28.721   23.888
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  13.0000
+ 2   / 2:  13.0000
+ 3   / 3:  13.0000
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16201 (number of valid)
+             TIME     : JAN
+ 1   / 1:  113.000
+ 2   / 2:  113.000
+ 3   / 3:  113.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ 1   / 1:     ....  1999.00  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    29.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00     0.00
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  2001.00  2001.00  2003.00   999.00
+ 2   / 2:     ....     7.00     7.00     7.00     8.00
+ 3   / 3:     ....    28.00    30.00    31.00     1.00
+ 4   / 4:     ....     0.00     0.00     0.00     0.00
+ 5   / 5:     ....     0.00     0.00     0.00     0.00
+ 6   / 6:     ....     0.00     0.00     0.00     0.00
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+            DDAT_A   DDAT_B   DDAT_C
+345   / 1:     ....     ....     ....
+346   / 2:     ....  1126.00  1126.00
+347   / 3:  1136.00  1136.00  1136.00
+348   / 4:  1141.00  1141.00     ....
+349   / 5:  1146.00  1146.00  1146.00
+350   / 6:  1156.00  1156.00  1156.00
+351   / 7:  1166.00  1166.00  1166.00
+352   / 8:     ....     ....     ....
+353   / 9:     ....     ....     ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                  (C001,V001)    EX#2
+10-NOV-1982 16 / 15:  0.666667  16.0000
+16-NOV-1982 18 / 16:  0.750000  18.0000
+22-NOV-1982 20 / 17:  0.833333  20.0000
+28-NOV-1982 22 / 18:  0.916667  22.0000
+05-DEC-1982 00 / 19:  0.000000   0.0000
+11-DEC-1982 02 / 20:  0.083333   2.0000
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  10.0000  314.000
+16-NOV-1982 18 / 16:  16.0000  320.000
+22-NOV-1982 20 / 17:  22.0000  326.000
+28-NOV-1982 22 / 18:  28.0000  332.000
+05-DEC-1982 00 / 19:   5.0000  339.000
+11-DEC-1982 02 / 20:  11.0000  345.000
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: NOV-1982 to DEC-1982
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                 (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:  11.0000  0.860274
+16-NOV-1982 18 / 16:  11.0000  0.876712
+22-NOV-1982 20 / 17:  11.0000  0.893151
+28-NOV-1982 22 / 18:  11.0000  0.909589
+05-DEC-1982 00 / 19:  12.0000  0.928767
+11-DEC-1982 02 / 20:  12.0000  0.945205
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.00
+ 16-NOV-1982 18 / 16:  1982.00
+ 22-NOV-1982 20 / 17:  1982.00
+ 28-NOV-1982 22 / 18:  1982.00
+ 05-DEC-1982 00 / 19:  1982.00
+ 11-DEC-1982 02 / 20:  1982.00
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.00
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_strides
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:322 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:322 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:322 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:319 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G023)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:325 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.0000
+ 4    / 2:   4.0000
+ 7    / 3:   7.0000
+ 10   / 4:  10.0000
+ 13   / 5:  13.0000
+ 16   / 6:  16.0000
+ 19   / 7:  19.0000
+ 22   / 8:   2.0000
+ 25   / 9:   5.0000
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:341 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G022)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:341 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:341 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:341 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:339 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.0000
+ 20   / 2:  20.0000
+ 22   / 3:   2.0000
+ 24   / 4:   4.0000
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.0000
+ 21   / 2:   1.0000
+ 23   / 3:   3.0000
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.0000
+ 22   / 2:   2.0000
+ 24   / 3:   4.0000
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.0000
+ 20   / 2:  20.0000
+ 23   / 3:   3.0000
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.0000
+ 21   / 2:   1.0000
+ 24   / 3:   4.0000
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.0000
+ 22   / 2:   2.0000
+ 25   / 3:   5.0000
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.0000
+ 23   / 2:   3.0000
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.0000
+ 6    / 2:   6.0000
+ 11   / 3:  11.0000
+ 16   / 4:  16.0000
+ 21   / 5:   1.0000
+ 26   / 6:   6.0000
+ 31   / 7:  11.0000
+ 36   / 8:  16.0000
+ 41   / 9:   1.0000
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.0000
+ 7    / 2:   7.0000
+ 12   / 3:  12.0000
+ 17   / 4:  17.0000
+ 22   / 5:   2.0000
+ 27   / 6:   7.0000
+ 32   / 7:  12.0000
+ 37   / 8:  17.0000
+ 42   / 9:   2.0000
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.0000
+ 8    / 2:   8.0000
+ 13   / 3:  13.0000
+ 18   / 4:  18.0000
+ 23   / 5:   3.0000
+ 28   / 6:   8.0000
+ 33   / 7:  13.0000
+ 38   / 8:  18.0000
+ 43   / 9:   3.0000
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.0000
+ 9    / 2:   9.0000
+ 14   / 3:  14.0000
+ 19   / 4:  19.0000
+ 24   / 5:   4.0000
+ 29   / 6:   9.0000
+ 34   / 7:  14.0000
+ 39   / 8:  19.0000
+ 44   / 9:   4.0000
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.0000
+ 10   / 2:  10.0000
+ 15   / 3:  15.0000
+ 20   / 4:  20.0000
+ 25   / 5:   5.0000
+ 30   / 6:  10.0000
+ 35   / 7:  15.0000
+ 40   / 8:  20.0000
+ 45   / 9:   5.0000
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.0000
+ 11   / 2:  11.0000
+ 16   / 3:  16.0000
+ 21   / 4:   1.0000
+ 26   / 5:   6.0000
+ 31   / 6:  11.0000
+ 36   / 7:  16.0000
+ 41   / 8:   1.0000
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.0000
+ 106   / 2:   6.0000
+ 111   / 3:  11.0000
+ 116   / 4:  16.0000
+ 121   / 5:   1.0000
+ 126   / 6:   6.0000
+ 131   / 7:  11.0000
+ 136   / 8:  16.0000
+ 141   / 9:   1.0000
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.0000
+ 107   / 2:   7.0000
+ 112   / 3:  12.0000
+ 117   / 4:  17.0000
+ 122   / 5:   2.0000
+ 127   / 6:   7.0000
+ 132   / 7:  12.0000
+ 137   / 8:  17.0000
+ 142   / 9:   2.0000
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.0000
+ 108   / 2:   8.0000
+ 113   / 3:  13.0000
+ 118   / 4:  18.0000
+ 123   / 5:   3.0000
+ 128   / 6:   8.0000
+ 133   / 7:  13.0000
+ 138   / 8:  18.0000
+ 143   / 9:   3.0000
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.0000
+ 109   / 2:   9.0000
+ 114   / 3:  14.0000
+ 119   / 4:  19.0000
+ 124   / 5:   4.0000
+ 129   / 6:   9.0000
+ 134   / 7:  14.0000
+ 139   / 8:  19.0000
+ 144   / 9:   4.0000
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.0000
+ 110   / 2:  10.0000
+ 115   / 3:  15.0000
+ 120   / 4:  20.0000
+ 125   / 5:   5.0000
+ 130   / 6:  10.0000
+ 135   / 7:  15.0000
+ 140   / 8:  20.0000
+ 145   / 9:   5.0000
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.0000
+ 111   / 2:  11.0000
+ 116   / 3:  16.0000
+ 121   / 4:   1.0000
+ 126   / 5:   6.0000
+ 131   / 6:  11.0000
+ 136   / 7:  16.0000
+ 141   / 8:   1.0000
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G023)          (AX010)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:335 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G022)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:335 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:335 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:335 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:334 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G022)          (AX017)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G023)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:334 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:318 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX014)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+ 
+! ******** V54 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_viewports
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/nolab {0,4.737}, {0,4.737}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/line {0,4.737}, {0,4.737}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.60   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.60   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 7.27E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.67E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strings
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string    cnst
+1   / 1: "string"            5.00000
+2   / 2: "s2"                5.00000
+3   / 3: "very long string"  5.00000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1.00000  0.00000  0.00000
+ 2   / 2:  0.00000  1.00000  0.00000
+ 3   / 3:  0.00000  0.00000  1.00000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+              1        2        3     
+              1        2        3
+ 1   / 1:  0.00000  1.00000  1.00000
+ 2   / 2:  1.00000  0.00000  1.00000
+ 3   / 3:  1.00000  1.00000  0.00000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  1.00000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  1.00000
+ 3   / 3:  0.00000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  0.00000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axcontrol
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_curv
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_delimited_read
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6     V7       V8     V9     V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      .... " "      " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000 "word 1" " "      ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     .... "word 2" " "      ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030 " wd 3 " " "      ....
+5   / 5: " "          " "    " "    " "    " "    " "      .... " "      " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000 "word 4" "aa"  77.0000
+7   / 7: "extra line" " "    " "    " "    " "    " "      .... " "      " "      ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6     A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "      ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.000
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"     ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.030
+5   / 5: " "          " "    " "    " "    " "    " "      ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.000
+7   / 7: "extra line" " "    " "    " "    " "    " "      ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2    V3       V4       V5     V6     V7       V8     V9     V10
+1   / 1: "one"       ...  1.10000 -24.0000  130.000 " "    10.000 "word 1" " "      ....
+2   / 2: "two"       ...  2.20000  24.0000 -130.000 "2S"     .... "word 2" " "      ....
+3   / 3: "three"     ...  3.30000  24.0000  130.000 "3N"    0.030 " wd 3 " " "      ....
+4   / 4: " "         ...     ....     ....     .... " "      .... " "      " "      ....
+5   / 5: "five"      ...  4.40000 -24.0000 -130.000 "91" -400.000 "word 4" "aa"  77.0000
+6   / 6: "extra line"...     ....     ....     .... " "      .... " "      " "      ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000     ....     ....     ....   10.000......     ....
+2   / 2:......  2.20000     ....     ....     ....     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000     ....    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2    V3       V4       V5       V6       V7    V8 V9    V10
+1   / 1:......  1.10000 -24.0000     ....     ....   10.000......     ....
+2   / 2:......  2.20000  24.0000     ....  -2.0000     ..........     ....
+3   / 3:......  3.30000  24.0000  130.000   3.0000    0.030......     ....
+4   / 4:......     ....     ....     ....     ....     ..........     ....
+5   / 5:......  4.40000 -24.0000 -130.000  91.0000 -400.000......  77.0000
+6   / 6:......     ....     ....     ....     ....     ..........     ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+              V1     V2
+1   / 1:  37965.0  12.5833
+2   / 2:     ....     ....
+3   / 3:  39051.0  13.7514
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5       V6       V7       V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.0  36218.0  12.0000  13.7601
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.0  36219.0   1.0037  14.7601
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.0  36220.0   2.0000  15.7500
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+              V1     V2    V3 V4    V5       V6    V7 V8
+1   / 1:  36493.0  36218.0......  36493.0  36218.0......
+2   / 2:  36494.0  36219.0......  36494.0  36219.0......
+3   / 3:     ....     ..........  36495.0  36220.0......
+4   / 4:  36496.0  36221.0......  36496.0  36221.0......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2    V3       V4    V5 V6    V7       V8
+1   / 1:......  12.0000  13.7601......  12.0000  13.7601
+2   / 2:......   1.0037  14.7601......   1.0037  14.7601
+3   / 3:......     ....     ..........   2.0000  15.7500
+4   / 4:......   3.0000  16.7601......   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+              V1     V2       V3       V4       V5       V6       V7       V8
+1   / 1:  36493.0  36218.0  12.0000  13.7601  36493.0  36218.0  12.0000  13.7601
+2   / 2:  36494.0  36219.0   1.0037  14.7601  36494.0  36219.0   1.0037  14.7601
+3   / 3:     ....     ....     ....     ....  36495.0  36220.0   2.0000  15.7500
+4   / 4:  36496.0  36221.0   3.0000  16.7601  36496.0  36221.0   3.0000  16.7601
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+              V1     V3       V5       V7
+1   / 1:  36493.0  12.0000  36493.0  12.0000
+2   / 2:  36494.0   1.0037  36494.0   1.0037
+3   / 3:     ....     ....  36495.0   2.0000
+4   / 4:  36496.0   3.0000  36496.0   3.0000
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+              V1     V2                        V3                       V4
+1   / 1:  12.0000  1.00000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.00000
+2   / 2:  12.0000  2.00000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.00000
+3   / 3:  12.0000  3.00000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.00000
+4   / 4:  12.0000  4.00000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.00000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+              V1     V2      V3        V4           V5           V6         V7       V8
+1   / 1:  12.0000  1.00000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6       V7           V8         V9       V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"  "12:00"      "13:45:36.5"  12.0000  1.00000
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"  "01:00:13.5" "14:45:36.5"  12.0000  2.00000
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x" "2:00x"      "15:45x"      12.0000  3.00000
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"  "03:00"      "16:45:36.5"  12.0000  4.00000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+              V1     V2      V3     V4       V5      V6     V7      V8     V9     V10
+1   / 1:  12.0000  1.00000 "99"   1999.00  3.00000 "01"   12.0000 "00"   13.0000 "45" 
+2   / 2:  12.0000  2.00000 "99"   1999.00  3.00000 "02"    1.0000 "00"   13.5000 "14" 
+3   / 3:  12.0000  3.00000 "99x"  1999.00  3.00000 "03x"   2.0000 "00x"  15.0000 "45x"
+4   / 4:  12.0000  4.00000 "99"   1999.00  3.00000 "04"    3.0000 "00"   16.0000 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20481  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1     V2     V3    V4       V5       V6       V7       V8       V9       V10      V11      V12      V13       V14      V15      V16      V17       V18      V19      V20       V21      V22      V23      V24      V25      V26
+1    /  1: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    10.00  21.1028  35.9408  0.00000  36.0000  0.000000  1.00000     9.80  224.641  0.000000   0.1172  0.00000  0.000000  0.00000   1.0156  0.00000  0.11621  0.00000  2.22900
+2    /  2: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    54.00  19.8913  35.9437  0.00000  35.0000  0.000000  1.00000    54.70  233.185  0.000000   0.1465  0.00000  0.000000  0.00000   1.0351  0.00000  0.13769  0.00000  2.43100
+3    /  3: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00    79.00  19.0138  35.9186  0.00000  34.0000  0.000000  1.00000    79.50  237.026  0.000000   0.1660  0.00000  0.000000  0.00000   1.0449  0.00000  0.13085  0.00000  2.51600
+4    /  4: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   104.00  18.0026  35.8627  0.00000  33.0000  0.000000  1.00000   104.60  233.766  0.000000   0.1855  0.00000  0.000000  0.00000   1.0645  0.00000  0.16602  0.00000  2.65000
+5    /  5: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   154.00  16.3595  35.7126  0.00000  32.0000  0.000000  1.00000   155.10  230.216  0.000000   0.9083  0.00000  0.146501  0.00000   0.8985  0.00000  0.26566  0.00000  2.84600
+6    /  6: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   204.00  14.8461  35.5541  0.00000  31.0000  0.000000  1.00000   206.00  222.307  0.000000   3.7899  0.00000  0.009768  0.00000   1.4359  0.00000  0.44542  0.00000  2.95400
+7    /  7: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   253.00  13.7175  35.3809  0.00000  29.0000  0.000000  1.00000   255.20  227.612  0.000000   5.5293  0.00000  0.009769  0.00000   1.6315  0.00000  0.55880  0.00000  3.00600
+8    /  8: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   254.00  13.7070  35.3835  0.00000  30.0000  0.000000  1.00000   255.60  227.350  0.000000   5.5098  0.00000  0.009769  0.00000   1.7877  0.00000  0.55489  0.00000  2.99600
+9    /  9: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   305.00  12.6234  35.2123  0.00000  28.0000  0.000000  1.00000   307.20  230.868  0.000000   7.6502  0.00000  0.009770  0.00000   2.1593  0.00000  0.68588  0.00000  3.13400
+10   / 10: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   353.00  12.0102  35.1165  0.00000  27.0000  0.000000  1.00000   355.70  235.378  0.000000   8.7158  0.00000  0.009771  0.00000   2.5209  0.00000  0.75335  0.00000  3.19000
+11   / 11: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   404.00  11.4592     ....  9.00000  26.0000  0.000000  1.00000   406.90     ....  0.000000     ....  9.00000      ....  9.00000     ....  9.00000     ....  9.00000  3.25500
+12   / 12: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   452.00  11.0375  34.9575  0.00000  25.0000  0.000000  1.00000   455.90  239.899  0.000000  10.9546  0.00000  0.000000  0.00000   3.0489  0.00000  0.88438  0.00000  3.24500
+13   / 13: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   502.00  10.5797  34.8825  0.00000  24.0000  0.000000  1.00000   506.00  241.090  0.000000  12.1377  0.00000  0.000000  0.00000   3.4009  0.00000  0.95871  0.00000  3.19500
+14   / 14: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   601.00   9.8037  34.7585  0.00000  23.0000  0.000000  1.00000   605.90  238.538  0.000000  14.4357  0.00000  0.000000  0.00000   4.2711  0.00000  1.11419  0.00000     ....
+15   / 15: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   701.00   9.0245  34.6510  0.00000  22.0000  0.000000  1.00000   706.70  229.219  0.000000  17.5353  0.00000  0.000000  0.00000   6.1774  0.00000  1.31173  0.00000  2.45400
+16   / 16: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   800.00   7.6879  34.5292  0.00000  21.0000  0.000000  1.00000   807.00  206.678  0.000000  22.7373  0.00000  0.000000  0.00000  13.2162  0.00000  1.63345  0.00000  1.32000
+17   / 17: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   899.00   6.2124  34.4434  0.00000  20.0000  0.000000  1.00000   907.30  194.602  0.000000  27.2943  0.00000  0.000000  0.00000  23.8630  0.00000  1.92683  0.00000  0.73200
+18   / 18: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00   999.00   4.9587  34.4055  0.00000  19.0000  0.000000  1.00000  1008.40  186.926  0.000000  30.2768  0.00000  0.000000  0.00000  36.3870  0.00000  2.15272  0.00000  0.42900
+19   / 19: "I8SI9S"  4.00000 "B"  34671.0  94.9940 -30.3000  1945.00  1098.00   4.3083  34.4383  0.00000  18.0000  0.000000  1.00000  1109.00  171.821  0.000000  32.2020  0.00000  0.000000  0.00000  50.4537  0.00000  2.29735  0.00000  0.19800
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+               V11     V19      V21      V23      V25
+8    /  8:  0.00000  0.00000  0.00000  0.00000  0.00000
+9    /  9:  0.00000  0.00000  0.00000  0.00000  0.00000
+10   / 10:  0.00000  0.00000  0.00000  0.00000  0.00000
+11   / 11:  9.00000  9.00000  9.00000  9.00000  9.00000
+12   / 12:  0.00000  0.00000  0.00000  0.00000  0.00000
+13   / 13:  0.00000  0.00000  0.00000  0.00000  0.00000
+14   / 14:  0.00000  0.00000  0.00000  0.00000  0.00000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+                V11     V19       V21       V23       V25
+8    /  8:  0.000000  0.000000  0.000000  0.000000  0.000000
+9    /  9:  0.000000  0.000000  0.000000  0.000000  0.000000
+10   / 10:  0.000000  0.000000  0.000000  0.000000  0.000000
+11   / 11:      ....      ....      ....      ....      ....
+12   / 12:  0.000000  0.000000  0.000000  0.000000  0.000000
+13   / 13:  0.000000  0.000000  0.000000  0.000000  0.000000
+14   / 14:  0.000000  0.000000  0.000000  0.000000  0.000000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+ 
+ 
+! ******** V5.41 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn541_bug_fixes
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              1        2     
+              1        2
+ ---- K:1 Z:   5
+ 3   / 1:  531.000  532.000
+ 4   / 2:  541.000  542.000
+ ---- K:2 Z:   6
+ 3   / 1:  631.000  632.000
+ 4   / 2:  641.000  642.000
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045  27.8955     ....
+ 15-FEB      / 2:  28.5508  28.2499     ....
+ 17-MAR      / 3:  28.8764  28.4775     ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                      1        2        3     
+                      1        2        3
+ 16-JAN      / 1:  29.0045     ....  26.9596
+ 15-FEB      / 2:  28.5508     ....  26.7875
+ 17-MAR      / 3:  28.8764     ....  27.1092
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX010)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G005)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX010)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 279  complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.00000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_axes
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+ 
+! ******** V5.42 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn542_bug_fixes
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+ 
+! ******** V5.50 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_subspan_modulo
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       43       44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  13.0000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M: 11 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  6 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  5 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M: 17 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.0000  12.0000  13.0000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.0000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.0000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.0000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+             ....     ....  11.9795  13.0784  14.0393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.0393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+             ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.9354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+             ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795  13.0784  14.0393  15.0582     ....     ....     ....  11.9795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+             ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....  13.0356  14.0408     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+            493.5    541      542      543      544      545      546      593.5  
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+             ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000  12.0000     ....  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+             ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  11.5000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+             ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000  13.0000  13.0000  13.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+             ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000     ....     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000  12.0000  14.0000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      / 2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      / 3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 15-FEB      /  2:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  3:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      /  4:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      /  5:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN      /  7:   11.000   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000
+ 14-FEB      /  8:   41.000   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000
+ 16-MAR      /  9:   71.000   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000
+ 15-APR      / 10:  101.000  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000
+ 15-MAY      / 11:  131.000  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0002 / 14:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0002 / 15:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+ 15-APR-0002 / 16:  102.000  103.000  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000
+ 15-MAY-0002 / 17:  132.000  133.000  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   13.000   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000
+ 14-FEB-0003 / 20:   42.000   43.000   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000
+ 16-MAR-0003 / 21:   72.000   73.000   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0002 / 14:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0002 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 / 16:  102.000     ....     ....     ....  106.000     ....  101.000  102.000     ....     ....     ....
+ 15-MAY-0002 / 17:  132.000     ....     ....     ....  136.000     ....  131.000  132.000     ....     ....     ....
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000     ....     ....     ....   16.000     ....   11.000   12.000     ....     ....     ....
+ 14-FEB-0003 / 20:   42.000     ....     ....     ....   46.000     ....   41.000   42.000     ....     ....     ....
+ 16-MAR-0003 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 / 13:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0002 / 14:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0002 / 15:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 15-APR-0002 / 16:  102.000  102.000  104.000  106.000  106.000     ....  101.000  102.000  102.000  104.000  106.000
+ 15-MAY-0002 / 17:  132.000  132.000  134.000  136.000  136.000     ....  131.000  132.000  132.000  134.000  136.000
+ 15-SEP-0002 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0003 / 19:   12.000   12.000   14.000   16.000   16.000     ....   11.000   12.000   12.000   14.000   16.000
+ 14-FEB-0003 / 20:   42.000   42.000   44.000   46.000   46.000     ....   41.000   42.000   42.000   44.000   46.000
+ 16-MAR-0003 / 21:   72.000   72.000   74.000   76.000   76.000     ....   71.000   72.000   72.000   74.000   76.000
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0002 / 13:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0002 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 / 15:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 15-APR-0002 / 16:   44.000   45.000   46.000     ....   41.000   42.000   43.000   44.000   45.000   46.000     ....
+ 15-MAY-0002 / 17:   74.000   75.000   76.000     ....   71.000   72.000   73.000   74.000   75.000   76.000     ....
+ 15-SEP-0002 / 18:  104.000  105.000  106.000     ....  101.000  102.000  103.000  104.000  105.000  106.000     ....
+ 15-JAN-0003 / 19:  134.000  135.000  136.000     ....  131.000  132.000  133.000  134.000  135.000  136.000     ....
+ 14-FEB-0003 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 / 21:   14.000   15.000   16.000     ....   11.000   12.000   13.000   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+             ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  13.0000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G008)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          (AX014)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  13.0000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G008)          (AX017)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G008)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G008)          XAX_SUBSPANORMAL    NORMAL    (AX014)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 16-MAR-0000 / 2:   71.000
+ 15-MAY-0000 / 3:  131.000
+ 15-JAN-0001 / 4:   11.000
+ 16-MAR-0001 / 5:   71.000
+ 15-MAY-0001 / 6:  131.000
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   71.000
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.000
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.000
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.000
+ 16-MAR-0001 / 3:   71.000
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0000 / 2:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 15-APR-0001 / 4:     ....  102.000  104.000  106.000  101.000  103.000  105.000     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   13.000   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.00000
+ 15-FEB      / 2:  2.00000
+ 16-MAR      / 3:  3.00000
+ 15-APR      / 4:  4.00000
+ 15-MAY      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.0000
+ 15-FEB      / 2:  10.0000
+ 16-MAR      / 3:  10.0000
+ 15-APR      / 4:  10.0000
+ 15-MAY      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.00000
+ 15-SEP-0166 / 1002:     ....
+ 16-JAN-0167 / 1003:  1.00000
+ 15-FEB-0167 / 1004:  2.00000
+ 17-MAR-0167 / 1005:  3.00000
+ 16-APR-0167 / 1006:  4.00000
+ 16-MAY-0167 / 1007:  5.00000
+ 16-SEP-0167 / 1008:     ....
+ 16-JAN-0168 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+            41       42       42.1     44       45       46     
+             1        2        3        4        5        6
+          11.0000  12.0000  12.1000  14.0000  15.0000  16.0000
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.0000  16.0000     ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .     ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....  12.0000  14.0000  16.0000
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.0000  12.0000  12.1000  14.0000  15.0000
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.1000  14.0000  15.0000  16.0000
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.1000  14.0000  15.0000  16.0000     ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.1000  14.0000  15.0000  16.0000     ....  11.0000
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.0582     ....     ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+             ....     ....  11.6795  12.7784  13.7393  15.0582
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.7393  15.0582     ....     ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+             ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566  12.0354  14.2434  14.9391  15.9921     ....  10.9466  12.0566
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+             ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795  12.7784  13.7393  15.0582     ....     ....     ....  11.6795
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+             ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....  12.8042  13.8351     ....     ....     ....     ....     ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5    541      542      542.1    544      545      546      593.5   
+            35       36       37       38       39       40       41       42
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+             ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000  12.1000  13.3667  14.0500  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+             ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000  12.1000  12.7750  12.7750  16.0000     ....  11.0000  12.0000
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+             ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000  12.1000     ....     ....  16.0000     ....  11.0000  12.0000
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+             ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000  12.1000  12.1000  16.0000  16.0000     ....  11.0000  12.0000
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      / 2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      / 3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      / 4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      / 5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 15-FEB 02      /  2:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 17      /  3:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 05      /  4:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 05      /  5:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 17      /  6:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN 17      /  7:   11.000   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000
+ 14-FEB 08      /  8:   42.000   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000
+ 15-MAR 23      /  9:   70.249   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249
+ 15-APR 11      / 10:  101.249  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249
+ 15-MAY 11      / 11:  131.249  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0002 05 / 15:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+ 15-APR-0002 17 / 16:  102.249  102.349  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000
+ 16-MAR-0003 11 / 21:   71.249   71.349   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0002 14 / 14:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0002 05 / 15:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-APR-0002 17 / 16:  102.249  102.349     ....     ....  106.249     ....  101.249  102.249  102.349     ....     ....
+ 15-MAY-0002 17 / 17:  132.249  132.349     ....     ....  136.249     ....  131.249  132.249  132.349     ....     ....
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100     ....     ....   16.000     ....   11.000   12.000   12.100     ....     ....
+ 14-FEB-0003 20 / 20:   43.000   43.100     ....     ....   47.000     ....   42.000   43.000   43.100     ....     ....
+ 16-MAR-0003 11 / 21:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 15-JAN-0002 23 / 13:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0002 14 / 14:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0002 05 / 15:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 15-APR-0002 17 / 16:  102.249  102.349  102.349  106.249  106.249     ....  101.249  102.249  102.349  102.349  106.249
+ 15-MAY-0002 17 / 17:  132.249  132.349  132.349  136.249  136.249     ....  131.249  132.249  132.349  132.349  136.249
+ 15-SEP-0002 05 / 18:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-JAN-0003 05 / 19:   12.000   12.100   12.100   16.000   16.000     ....   11.000   12.000   12.100   12.100   16.000
+ 14-FEB-0003 20 / 20:   43.000   43.100   43.100   47.000   47.000     ....   42.000   43.000   43.100   43.100   47.000
+ 16-MAR-0003 11 / 21:   72.624   72.724   72.724   76.624   76.624     ....   71.624   72.624   72.724   72.724   76.624
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 15-JAN-0002 23 / 13:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0002 14 / 14:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0002 05 / 15:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 15-APR-0002 17 / 16:   45.000   46.000   47.000     ....   42.000   43.000   43.100   45.000   46.000   47.000     ....
+ 15-MAY-0002 17 / 17:   73.249   74.249   75.249     ....   70.249   71.249   71.349   73.249   74.249   75.249     ....
+ 15-SEP-0002 05 / 18:  104.249  105.249  106.249     ....  101.249  102.249  102.349  104.249  105.249  106.249     ....
+ 16-JAN-0003 05 / 19:  134.249  135.249  136.249     ....  131.249  132.249  132.349  134.249  135.249  136.249     ....
+ 14-FEB-0003 20 / 20:     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....     ....
+ 16-MAR-0003 11 / 21:   14.000   15.000   16.000     ....   11.000   12.000   12.100   14.000   15.000   16.000     ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+             ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....  11.0000  12.0000  12.1000  14.0000  15.0000  16.0000     ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G018)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          (AX017)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+             ....  12.0000  14.0000  16.0000  11.0000  12.1000  15.0000     ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G018)          (AX010)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G018)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G018)          XIRREG_SUBNORMAL    NORMAL    (AX017)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.000
+ 15-MAR-0000 / 2:   70.249
+ 15-MAY-0000 / 3:  131.249
+ 15-JAN-0001 / 4:   11.000
+ 15-MAR-0001 / 5:   70.249
+ 15-MAY-0001 / 6:  131.249
+ 15-JAN-0002 / 7:   11.000
+ 16-MAR-0002 / 8:   70.249
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.000
+ 15-APR-0000 / 2:  101.249
+ 15-JAN-0001 / 3:   11.000
+ 15-APR-0001 / 4:  101.249
+ 15-JAN-0002 / 5:   11.000
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.000
+ 15-MAY-0000 / 2:  131.249
+ 15-MAR-0001 / 3:   70.249
+ 15-JAN-0002 / 4:   11.000
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0000 / 2:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0001 / 3:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 15-APR-0001 / 4:     ....  102.249  104.249  106.249  101.249  102.349  105.249     ....
+ 15-JAN-0002 / 5:     ....   12.000   14.000   16.000   11.000   12.100   15.000     ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.00000
+ 15-FEB 02      / 2:  2.00000
+ 15-MAR 17      / 3:  3.00000
+ 15-APR 05      / 4:  4.00000
+ 15-MAY 05      / 5:  5.00000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.0000
+ 15-FEB 02      / 2:  10.0000
+ 15-MAR 17      / 3:  10.0000
+ 15-APR 05      / 4:  10.0000
+ 15-MAY 05      / 5:  10.0000
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.00000
+ 15-SEP-0166 23 / 1002:     ....
+ 16-JAN-0167 23 / 1003:  1.00000
+ 15-FEB-0167 14 / 1004:  2.00000
+ 17-MAR-0167 05 / 1005:  3.00000
+ 16-APR-0167 17 / 1006:  4.00000
+ 16-MAY-0167 17 / 1007:  5.00000
+ 16-SEP-0167 05 / 1008:     ....
+ 17-JAN-0168 05 / 1009:  1.00000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dots
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lev_symbols
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+ 
+GO bn_reset
+cancel mode verify
+! GO bench_extrema  ! moved to bn_ef_bench_extrema; tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_logo_lab
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL       CANCELLED      ferret.jnl
+      LONG_LABEL       SET              -4
+      LATIT_LABEL      SET              -4
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         months
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      dots.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+plot/vs/over/line/color=white {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modulo_attribute
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_FIELD_J_AXIS Y             2 r   50                   65
+   Axis span (to cell edges) = 30
+ LON_FIELD_I_AXIS X             7 r   160                  208
+   Axis span (to cell edges) = 56
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 4382.91
+ TIME      T (HOURS)           20 r   1                    20
+   Axis span (to cell edges) = 20
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ TIME5     TIME                 2mr   16-MAY 23:56         16-JUN 10:25
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn550_bug_fixes
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+ 
+! ******** V5.51 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn551_bug_fixes
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.50000
+ 2.5 / 2:  2.50000
+ 3.5 / 3:  3.50000
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME3
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.00000
+ 10-JUN-1996 04:03:37 / 2:  1.00000
+ 10-JUN-1996 04:03:38 / 3:  2.00000
+ 10-JUN-1996 04:03:39 / 4:  3.00000
+ 10-JUN-1996 04:03:40 / 5:  4.00000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+ 
+! ******** V5.52 Additions below ***********
+ 
+GO bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 7.74
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+ 
+GO bn_reset
+cancel mode verify
+GO bn552_bug_fixes
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.00000
+ 2   / 2:  0.00000
+ 3   / 3:  1.00000
+ 4   / 4: -1.00000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : JAN
+                20N    
+                 6
+ 110W   / 1:  24.0382
+ 105W   / 2:  25.4564
+ 100W   / 3:  24.5714
+ 95W    / 4:  23.8243
+ 90W    / 5:  24.9977
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.00000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.00000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+              158.5E   159.5E   160.5E  
+              139      140      141
+ 4.5S / 86:  29.5110  29.4430  29.3800
+ 5.5S / 85:  29.5890  29.5250  29.4570
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.5170
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5        6     
+              1        2        3        4        5        6
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   4.0000   5.0000   6.0000   7.0000   8.0000
+ 2   / 2:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 3   / 3:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 4   / 4:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ ---- K:2 Z:   2
+ 1   / 1:   4.0000   5.0000   6.0000   7.0000   8.0000   9.0000
+ 2   / 2:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 3   / 3:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 4   / 4:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ ---- K:3 Z:   3
+ 1   / 1:   5.0000   6.0000   7.0000   8.0000   9.0000  10.0000
+ 2   / 2:   6.0000   7.0000   8.0000   9.0000  10.0000  11.0000
+ 3   / 3:   7.0000   8.0000   9.0000  10.0000  11.0000  12.0000
+ 4   / 4:   8.0000   9.0000  10.0000  11.0000  12.0000  13.0000
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+              1        3        5        7     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 1   / 1:   3.0000   5.0000   7.0000     ....
+ 3   / 2:   5.0000   7.0000   9.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.0000   7.0000   9.0000     ....
+ 3   / 2:   7.0000   9.0000  11.0000     ....
+ 5   / 3:     ....     ....     ....     ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.167S
+                     100.5W  
+                     130
+ 16-JUL-1966 /  1: -1.42152
+ 15-AUG-1966 /  2: -2.97198
+ 14-SEP-1966 /  3: -4.50335
+ 15-OCT-1966 /  4: -3.88179
+ 14-NOV-1966 /  5: -2.57982
+ 15-DEC-1966 /  6: -1.07968
+ 14-JAN-1967 /  7:  1.42391
+ 14-FEB-1967 /  8:  2.96231
+ 16-MAR-1967 /  9:  4.50322
+ 15-APR-1967 / 10:  3.83807
+ 16-MAY-1967 / 11:  2.60886
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                         90
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                        161W    
+                          1
+ 16-NOV-1947 00 / 23: -3.07590
+ 16-DEC-1947 12 / 24:  1.67401
+ 16-JAN-1948 12 / 25:  3.42908
+ 15-FEB-1948 12 / 26:  1.95365
+ 16-MAR-1948 12 / 27:  2.76119
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.00
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.00
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.00
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+        A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:  12.0000  14.0000
+2   / 2:  14.0000  20.0000
+3   / 3:  20.0000  28.0000
+4   / 4:  28.0000  22.0000
+5   / 5:  22.0000  10.0000
+6   / 6:  10.0000     ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.0000
+ 2   / 2:  14.0000
+ 3   / 3:  20.0000
+ 4   / 4:  28.0000
+ 5   / 5:  22.0000
+ 6   / 6:  10.0000
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+              1        2        3     
+              1        2        3
+ 1   / 1:  3.00000  5.00000  7.00000
+ 2   / 2:  4.00000  6.00000  8.00000
+ 3   / 3:  5.00000  7.00000  9.00000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:   5.0000   7.0000   9.0000  11.0000  13.0000
+ 2   / 2:   7.0000  11.0000  15.0000  19.0000  23.0000
+ 3   / 3:   9.0000  15.0000  21.0000  27.0000  33.0000
+ 4   / 4:  11.0000  19.0000  27.0000  35.0000  43.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.94
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.8
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.94,,1.8
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.94    10.23     1.80     7.21
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.94
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 6.405
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.94,,6.405
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.65     9.94     1.00     6.41
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.3
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 6.905
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.305
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,6.905,7.305
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30    10.04     6.91     7.30
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.2
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.94
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.4
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,8.94,1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.20     8.94     1.40     1.49
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.2  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.2  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.7,1.1
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.4
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.20     9.94    -1.40    -1.31
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.25380  2.34749  2.42382  2.47460  2.50064
+ 2.17S / 4:  2.26997  2.36147  2.43073  2.47739  2.50277
+ 2.5S  / 3:  2.26576  2.35100  2.41285  2.45516  2.48145
+ 2.83S / 2:  2.23354  2.30728  2.35946  2.39631  2.42393
+ 3.17S / 1:  2.16829  2.22692  2.26870  2.30046  2.33013
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  2.28179  2.37704  2.45447  2.50708  2.53486
+ 2.17S / 4:  2.29644  2.38952  2.46056  2.50887  2.53607
+ 2.5S  / 3:  2.29075  2.37736  2.44104  2.48452  2.51240
+ 2.83S / 2:  2.25743  2.33286  2.38636  2.42369  2.45233
+ 3.17S / 1:  2.19089  2.25118  2.29360  2.32531  2.35557
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.72333  1.84007  1.94120  2.00514  2.04715
+ 2.17S / 4:  1.63876  1.74435  1.83141  1.88234  1.91985
+ 2.5S  / 3:  1.51509  1.60488  1.67644  1.71352  1.74562
+ 2.83S / 2:  1.35750  1.42836  1.48145  1.50285  1.52819
+ 3.17S / 1:  1.17476  1.22230  1.25622  1.26294  1.28236
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+              139.5W   138.5W   137.5W   136.5W   135.5W  
+                1        2        3        4        5
+ 1.83S / 5:  1.21576  1.30112  1.37420  1.42210  1.45249
+ 2.17S / 4:  1.08595  1.16417  1.22895  1.26976  1.29822
+ 2.5S  / 3:  0.93683  1.00553  1.05923  1.09102  1.11580
+ 2.83S / 2:  0.77184  0.82972  0.86888  0.89054  0.91114
+ 3.17S / 1:  0.59936  0.64140  0.66649  0.68065  0.69951
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.81161
+ 23-AUG-1982 14 / 2: -1.75761
+ 29-AUG-1982 16 / 3: -1.67763
+ 04-SEP-1982 18 / 4: -1.57055
+ 10-SEP-1982 20 / 5: -1.42678
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -2.21821
+ 23-AUG-1982 14 / 2: -2.04941
+ 29-AUG-1982 16 / 3: -1.77359
+ 04-SEP-1982 18 / 4: -1.41208
+ 10-SEP-1982 20 / 5: -1.05323
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                         1     
+                         1
+ 17-AUG-1982 12 / 1: -1.77560
+ 23-AUG-1982 14 / 2: -1.45491
+ 29-AUG-1982 16 / 3: -1.24196
+ 04-SEP-1982 18 / 4: -1.05135
+ 10-SEP-1982 20 / 5: -0.84706
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=AUG-1982:JAN-1983
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                         1      
+                          1
+ 17-AUG-1982 12 / 1:  0.003693
+ 23-AUG-1982 14 / 2: -0.189178
+ 29-AUG-1982 16 / 3: -0.298222
+ 04-SEP-1982 18 / 4: -0.405668
+ 10-SEP-1982 20 / 5: -0.517797
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.0000
+ 15    /  2:  25.0000
+ 25    /  3:  25.0000
+ 35    /  4:  25.0000
+ 45    /  5:  25.0000
+ 55    /  6:  25.0000
+ 65    /  7:  25.0000
+ 75    /  8:  25.0000
+ 85    /  9:  25.0000
+ 95    / 10:  25.0000
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.2678   0.6794   0.0319   0.0157   0.0031
+ 45    / 2:  98.6525   1.1464   0.1451   0.0296   0.0198
+ 85    / 3:  95.1217   4.5698   0.2195   0.0744   0.0084
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.576
+ 2   / 2:    0.955
+ 3   / 3:    0.045
+ 4   / 4:    0.022
+ 5   / 5:    0.004
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.8576
+ 2   / 2:   0.1262
+ 3   / 3:   0.0160
+ 4   / 4:   0.0033
+ 5   / 5:   0.0022
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.23641
+ 2   / 2:  0.10744
+ 3   / 3:  0.00516
+ 4   / 4:  0.00175
+ 5   / 5:  0.00020
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+GO bn_reset
+cancel mode verify
+GO bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+ 
+GO bn_reset
+cancel mode verify
+! GO bn_zaxr_fcns.jnl ! move to tests of shared-obj efs.
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+ 
+! ******** V5.53 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT1
+<axes>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME6
+<axes>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="PSXT1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+</axis>
+<axis name="TIME6">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME4">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME6</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME4</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                     161W    
+                       1
+ 16-JAN      /  1:  3.43667
+ 15-FEB      /  2:  1.92500
+ 17-MAR      /  3:  2.79000
+ 16-APR      /  4:  1.79000
+ 16-MAY      /  5:  0.80000
+ 16-JUN      /  6:  3.80000
+ 16-JUL      /  7: -0.20000
+ 16-AUG      /  8:  0.46500
+ 15-SEP      /  9:  2.57250
+ 16-OCT      / 10: -2.53000
+ 15-NOV      / 11: -3.09000
+ 16-DEC      / 12:  1.78667
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+ 
+ 
+! ******** V5.6Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+SHADE/grat=(color=white) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=whi)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.00000
+!-> REPEAT: S:4
+          4.00000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.841471
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.909297
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.141120
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.0000  6.00000  480.000
+I / *:     80.0000  8.00000  640.000
+I / *:     80.0000  10.0000  800.000
+I / *:     60.0000  6.00000  360.000
+I / *:     60.0000  8.00000  480.000
+I / *:     60.0000  10.0000  600.000
+I / *:     40.0000  6.00000  240.000
+I / *:     40.0000  8.00000  320.000
+I / *:     40.0000  10.0000  400.000
+I / *:     20.0000  6.00000  120.000
+I / *:     20.0000  8.00000  160.000
+I / *:     20.0000  10.0000  200.000
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.000
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.000
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.00
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.00
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.00
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.00
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.00
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.00
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.00
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.00
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.00
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.0000
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.0000
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.00000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.00000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.00000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.000
+ 177W    / -98: -177.000
+ 175W    / -97: -175.000
+ 173W    / -96: -173.000
+ 171W    / -95: -171.000
+ 169W    / -94: -169.000
+ 167W    / -93: -167.000
+ 165W    / -92: -165.000
+ 163W    / -91: -163.000
+ 161W    / -90: -161.000
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.000
+ 177W    / -98: -354.000
+ 175W    / -97: -350.000
+ 173W    / -96: -346.000
+ 171W    / -95: -342.000
+ 169W    / -94: -338.000
+ 167W    / -93: -334.000
+ 165W    / -92: -330.000
+ 163W    / -91: -326.000
+ 161W    / -90: -322.000
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.000
+ 177W    / -98: -531.000
+ 175W    / -97: -525.000
+ 173W    / -96: -519.000
+ 171W    / -95: -513.000
+ 169W    / -94: -507.000
+ 167W    / -93: -501.000
+ 165W    / -92: -495.000
+ 163W    / -91: -489.000
+ 161W    / -90: -483.000
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.000
+ 177W    / -98: -708.000
+ 175W    / -97: -700.000
+ 173W    / -96: -692.000
+ 171W    / -95: -684.000
+ 169W    / -94: -676.000
+ 167W    / -93: -668.000
+ 165W    / -92: -660.000
+ 163W    / -91: -652.000
+ 161W    / -90: -644.000
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.000
+ 177W    / -98: -885.000
+ 175W    / -97: -875.000
+ 173W    / -96: -865.000
+ 171W    / -95: -855.000
+ 169W    / -94: -845.000
+ 167W    / -93: -835.000
+ 165W    / -92: -825.000
+ 163W    / -91: -815.000
+ 161W    / -90: -805.000
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.00000 "factorial"  1.00000
+I / *:     2.00000 "factorial"  2.00000
+I / *:     3.00000 "factorial"  6.00000
+I / *:     4.00000 "factorial"  24.0000
+I / *:     5.00000 "factorial"  120.000
+I / *:     6.00000 "factorial"  720.000
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 81E    / 2:  28.1147
+ 161E   / 3:  28.7893
+ 119W   / 4:  24.5394
+ 39W    / 5:  27.4849
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : JAN
+                1N     
+                46
+ 1E     / 1:  27.8258
+ 121E   / 2:  28.5914
+ 119W   / 3:  24.5394
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9844
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN-0002
+          20.9844
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:148 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:153 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:153 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.7890
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:141 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:143 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:143 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          21.2500
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M:130 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME4     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:130 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : JAN
+          20.9385
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.00000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.00000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.00000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.00000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.00000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : JAN
+          28.2839
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.7917
+ 16-NOV-0099 / 1187:  99.8750
+ 16-DEC-0099 / 1188:  99.9583
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.7937
+ 17-NOV-0099 / 1187:  99.8771
+ 17-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.7937
+ 16-NOV-0099 / 1187:  99.8771
+ 16-DEC-0099 / 1188:  99.9604
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.7917
+ 15-NOV-0099 23 / 1187:  99.8750
+ 15-DEC-0099 23 / 1188:  99.9583
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.2917
+ 15-MAY-0098 23 / 1169:  98.3750
+ 15-JUN-0098 23 / 1170:  98.4583
+ 15-JUL-0098 23 / 1171:  98.5417
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:146 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+can mem/all
+ -DELETE A        M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME6     NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX023)   (AX022)   NORMAL    (AX025)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G023)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M:151 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:146 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ dealloc  dynamic grid (G023)          (AX022)   (AX023)   NORMAL    (AX009)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:146 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.00  1124.00
+ 3   / 3:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 2   / 2:  1222.00  1224.00
+ 3   / 3:  1232.00  1234.00
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX040)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+CANC MEM/ALL
+ -DELETE VAR      M:146 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G014)          (AX005)   (AX041)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 1    / 1:  1111.00
+ 4    / 2:  1114.00
+ 7    / 3:  1113.00
+ 10   / 4:  1112.00
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:146 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G014)          (AX005)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:151 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G014)          (AX041)   (AX040)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G014)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:147 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              2        4     
+              1        2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.00  1114.00
+ 3   / 2:  1132.00  1134.00
+ ---- K:2 Z:   2
+ 1   / 1:  1212.00  1214.00
+ 3   / 2:  1232.00  1234.00
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G014)          (AX041)   (AX005)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+               1     
+               1
+ 11   / 3:  1121.00
+ 16   / 4:  1126.00
+ 21   / 5:  1131.00
+ -DELETE A        M:146 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G001)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:146 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+             11       16       21     
+              3        4        5
+ 1   / 1:  1121.00  1126.00  1131.00
+ 3   / 2:  1141.00  1146.00  1151.00
+ 5   / 3:  1161.00  1166.00  1171.00
+ 7   / 4:  1181.00  1186.00  1191.00
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M: 74 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:136 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:146 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:151 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G001)          (AX041)   (AX040)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G001)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:151 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+            0.3      0.6    
+             1        2
+          1112.00  1114.00
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G001)          (AX005)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:147 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G001)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:147 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.00  1125.00  1127.00  1129.00
+ 4   / 2:  1143.00  1145.00  1147.00  1149.00
+ 6   / 3:  1163.00  1165.00  1167.00  1169.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1325.00  1327.00  1329.00
+ 4   / 2:  1343.00  1345.00  1347.00  1349.00
+ 6   / 3:  1363.00  1365.00  1367.00  1369.00
+canc data/all
+ -DELETE BIGVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G001)          (AX040)   (AX042)   (AX043)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX041)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G014)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:151 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+              3        5        7        9     
+              1        2        3        4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.00  1521.00  1721.00  1921.00
+ 4   / 2:  1341.00  1541.00  1741.00  1941.00
+ 6   / 3:  1361.00  1561.00  1761.00  1961.00
+ ---- K:2 Z:   3
+ 2   / 1:  1323.00  1523.00  1723.00  1923.00
+ 4   / 2:  1343.00  1543.00  1743.00  1943.00
+ 6   / 3:  1363.00  1563.00  1763.00  1963.00
+canc data/all
+ -DELETE BIGVAR   M:147 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   NORMAL    (AX041)   NORMAL    NORMAL
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+             141E     143E     145E     147E    
+               1        2        3        4
+ ---- L:1 T:   JAN-1995
+ 6N   / 3:  3061.00  3063.00  3065.00  3067.00
+ 4N   / 2:  3041.00  3043.00  3045.00  3047.00
+ 2N   / 1:  3021.00  3023.00  3025.00  3027.00
+ ---- L:2 T:   JAN-1995
+ 6N   / 3:  5061.00  5063.00  5065.00  5067.00
+ 4N   / 2:  5041.00  5043.00  5045.00  5047.00
+ 2N   / 1:  5021.00  5023.00  5025.00  5027.00
+canc data/all
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   NORMAL    (AX040)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G014)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:147 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+              34319    34321    34323    34325   
+                1        2        3        4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.00  3032.00  5032.00  7032.00
+ 144   / 2:  1034.00  3034.00  5034.00  7034.00
+ 146   / 3:  1036.00  3036.00  5036.00  7036.00
+ ---- K:2 Z:   5
+ 142   / 1:  1052.00  3052.00  5052.00  7052.00
+ 144   / 2:  1054.00  3054.00  5054.00  7054.00
+ 146   / 3:  1056.00  3056.00  5056.00  7056.00
+canc data/all
+ -DELETE XYTVAR   M:151 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.00  1352.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1512.00  1552.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.00  1358.00
+ 5   / 2:  1315.00  1355.00
+ ---- K:2 Z:   5
+ 2   / 1:  1518.00  1558.00
+ 5   / 2:  1515.00  1555.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.00  5123.00
+ 5   / 2:  1153.00  5153.00
+ ---- K:2 Z:   5
+ 2   / 1:  1125.00  5125.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.00  2773.00
+ 5   / 2:  6743.00  2743.00
+ ---- K:2 Z:   5
+ 2   / 1:  6775.00  2775.00
+ 5   / 2:  6745.00  2745.00
+canc data/all
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.00  5132.00
+ 5   / 2:  1135.00  5135.00
+ ---- K:2 Z:   5
+ 2   / 1:  1152.00  5152.00
+ 5   / 2:  1155.00  5155.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX043)   (AX042)   (AX040)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G014)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:151 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+              1        5     
+              1        2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.00  2738.00
+ 5   / 2:  6735.00  2735.00
+ ---- K:2 Z:   5
+ 2   / 1:  6758.00  2758.00
+ 5   / 2:  6755.00  2755.00
+canc data/all
+ -DELETE MIDVAR   M:147 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G014)          (AX042)   (AX043)   (AX041)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.500  212.500
+214   / 2:  214.000  212.500  215.500
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+                 X   XBOXLO   XBOXHI
+211   / 1:  211.000  209.700  212.300
+213.6 / 2:  213.600  212.300  214.900
+216.2 / 3:  216.200  214.900  217.500
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+               A   B
+1   / 1:  1.00000 "a"
+2   / 2:  2.00000 "b"
+3   / 3:  3.00000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.00000
+ 2   / 2:  2.00000
+ 3   / 3:  3.00000
+ 4   / 4:  4.00000
+ 5   / 5:  5.00000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C       V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.00000
+2   / 2: "b" "spat"  1.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.00000
+2   / 2: "b" "that"  1.00000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.00000
+2   / 2: "b" "spat"  2.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.00000
+2   / 2: "b" "that"  2.00000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.00000
+2   / 2: "b" "spat"  3.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.00000
+2   / 2: "b" "that"  3.00000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.00000
+2   / 2: "b" "spat"  4.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.00000
+2   / 2: "b" "that"  4.00000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.00000
+2   / 2: "b" "spat"  5.00000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.00000
+2   / 2: "b" "that"  5.00000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       DEPTH (m)           26 r-  0                    1000
+   Axis span (to cell edges) = 1040
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.976269
+ 106.8W  /  2:  0.824340
+ 100.2W  /  3:  0.552644
+ 93.5W   /  4:  0.200690
+ 86.8W   /  5: -0.180415
+ 80.2W   /  6: -0.535314
+ 73.5W   /  7: -0.812473
+ 66.8W   /  8: -0.971589
+ 60.2W   /  9: -0.989574
+ 53.5W   / 10: -0.863802
+ 46.8W   / 11: -0.612560
+ 40.2W   / 12: -0.272341
+ 33.5W   / 13:  0.107469
+ 26.8W   / 14:  0.471639
+ 20.2W   / 15:  0.767299
+ 13.5W   / 16:  0.951514
+ 6.8W    / 17:  0.997495
+ 0.2W    / 18:  0.898583
+ 6.5E    / 19:  0.669123
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.976269
+ 96.8W   / 2: -0.383713
+ 80.2W   / 3: -0.535314
+ 63.5W   / 4:  0.998887
+ 46.8W   / 5: -0.612560
+ 30.2W   / 6: -0.294944
+ 13.5W   / 7:  0.951514
+ 3.2E    / 8: -0.798487
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.976269
+ 96.2W   / 2: -0.383713
+ 79.5W   / 3: -0.535314
+ 62.8W   / 4:  0.998887
+ 46.2W   / 5: -0.612560
+ 29.5W   / 6: -0.294944
+ 12.8W   / 7:  0.951514
+ 3.8E    / 8: -0.798487
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.83E(42.83)
+         -0.912341
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.996087
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  45th point
+              1       46       91       136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     238 [...]
+              1       46       91      136      181      226      271      316      361      406      451      496      541      586      631      676      721      766      811      856      901      946      991     1036     1081     1126     1171     1216     1261     1306     1351     1396     1441     1486     1531     1576     1621     1666     1711     1756     1801     1846     1891     1936     1981     2026     2071     2116     2161     2206     2251     2296     2341     2386 [...]
+ 1   / 1:  1.84147  1.90179  1.10599  0.20957  0.06355  0.80656  1.73321  1.96379  1.27939  0.32975  0.01642  0.63686  1.60205  1.99568  1.44406  0.47087  0.00001  0.47850  1.45208  1.99647  1.59486  0.62851  0.01484  0.33643  1.28799  1.96614  1.72708  0.79776  0.06044  0.21509  1.11490  1.90563  1.83659  0.97333  0.13539  0.11827  0.93823  1.81683  1.91997  1.14973  0.23734  0.04899  0.76349  1.70252  1.97461  1.32145  0.36312  0.00942  0.59613  1.56626  1.99881  1.48313  0.50879  0.00 [...]
+ 2   / 2:  2.84147  2.90179  2.10599  1.20957  1.06355  1.80656  2.73321  2.96379  2.27939  1.32975  1.01642  1.63686  2.60205  2.99568  2.44406  1.47087  1.00001  1.47850  2.45208  2.99647  2.59486  1.62851  1.01484  1.33643  2.28799  2.96614  2.72708  1.79776  1.06044  1.21509  2.11490  2.90563  2.83659  1.97333  1.13539  1.11827  1.93823  2.81683  2.91997  2.14973  1.23734  1.04899  1.76349  2.70252  2.97461  2.32145  1.36312  1.00942  1.59613  2.56626  2.99881  2.48313  1.50879  1.00 [...]
+ 
+can mode ignore
+ 
+ 
+! ******** V5.7 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                       179W     177W     175W    
+                         1        2        3
+ 16-JAN 12      / 1:  27.9765  28.2538  28.2807
+ 15-FEB 02      / 2:  28.3564  28.4117  27.9982
+ 15-MAR 17      / 3:  27.9418  28.0035  27.7238
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                        1N       3N       5N       7N     
+                         1        2        3        4
+ 16-JAN 12      / 1:  28.4146  28.2538  28.0640  28.1024
+ 15-FEB 02      / 2:  28.4018  28.4117  28.1639  27.7498
+ 15-MAR 17      / 3:  27.5907  28.0035  27.8730  27.8183
+ 15-APR 05      / 4:  28.0000  28.0000  28.0000  28.0000
+ 15-MAY 17      / 5:  28.0000  28.0000  28.0000  28.0000
+ 30-JUN 17      / 6:     ....     ....     ....     ....
+ 15-AUG 17      / 7:  28.0000  28.0000  28.0000  28.0000
+ 15-SEP 05      / 8:  28.0000  28.0000  28.0000  28.0000
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1.2 / 1:  1.20000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3.2 / 3:  3.20000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8.4 / 6:  8.40000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+               T   TBOXLO   TBOXHI    TBOX
+1   / 1:  1.00000  0.50000  1.50000  1.00000
+2   / 2:  2.00000  1.50000  2.50000  1.00000
+3   / 3:  3.00000  2.50000  3.50000  1.00000
+5   / 4:  5.00000  3.50000  6.50000  3.00000
+7   / 5:  7.00000  6.50000  7.50000  1.00000
+8   / 6:  8.00000  7.50000  8.50000  1.00000
+9   / 7:  9.00000  8.50000  9.50000  1.00000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: JAN to APR
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME4)
+ Column  3: TBOXLO is TBOXLO (axis TIME4)
+ Column  4: TBOXHI is TBOXHI (axis TIME4)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+                 V      Z     ZBOXLO   ZBOXHI
+0     / 1:    7.000    0.000   0.0000   10.000
+20    / 2:   27.000   20.000  10.0000   30.000
+50    / 3:   57.000   50.000  30.0000   60.000
+75    / 4:   82.000   75.000  60.0000   90.000
+120   / 5:  127.000  120.000  90.0000  150.000
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: JAN to OCT
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: JAN-1990 to JAN-1990
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+GO bn_reset
+cancel mode verify
+GO bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.992873
+ 28-FEB-1988 00 / 59:  0.636738
+ 29-FEB-1988 00 / 60: -0.304811
+ 01-MAR-1988 00 / 61: -0.966118
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.114755
+ 28-FEB-1989 00 / 425: -0.773910
+ 29-FEB-1989 00 / 426: -0.951045
+ 01-MAR-1989 00 / 427: -0.253794
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_reset_attributes.jnl
+! bn_reset_attributes.jnl
+! acm 6/14/2004
+! tests of SET AXIS/CALENDAR  /T0  /UNITS  also CANCEL AXIS/DEPTH
+! also RETURN=calendar
+ 
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+sh axis `temp,return=taxis`
+ !-> sh axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 11-DEC-1982 02 / 20:  25476.0
+ 17-DEC-1982 04 / 21:  25622.0
+ 23-DEC-1982 06 / 22:  25768.0
+ 29-DEC-1982 08 / 23:  25914.0
+ 04-JAN-1983 10 / 24:  26060.0
+ 10-JAN-1983 12 / 25:  26206.0
+ 
+! New RETURN=calendar
+def sym calname = `temp,return=calendar`
+ !-> def sym calname = GREGORIAN
+ 
+! SET AXIS/CALENDAR=  julian, 360-day, 365_day=julian, 366_day=all_leap, standard=gregorian
+set axis/calendar=julian `temp,return=taxis`
+ !-> set axis/calendar=julian TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE JULIAN
+JULIAN
+ 
+set axis/calendar=360_day `temp,return=taxis`
+ !-> set axis/calendar=360_day TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 26-DEC-1982 02 / 20:  32.6698
+ 02-JAN-1983 04 / 21:  32.7830
+ 08-JAN-1983 06 / 22:  32.7033
+ 14-JAN-1983 08 / 23:  32.4479
+ 20-JAN-1983 10 / 24:  32.2491
+ 26-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE 360_DAY
+360_DAY
+ 
+set axis/calendar=365_day `temp,return=taxis`
+ !-> set axis/calendar=365_day TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=nol `temp,return=taxis`
+ !-> set axis/calendar=nol TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 12-DEC-1982 02 / 20:  32.6698
+ 18-DEC-1982 04 / 21:  32.7830
+ 24-DEC-1982 06 / 22:  32.7033
+ 30-DEC-1982 08 / 23:  32.4479
+ 05-JAN-1983 10 / 24:  32.2491
+ 11-JAN-1983 12 / 25:  32.1819
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE NOLEAP
+NOLEAP
+ 
+set axis/calendar=366 `temp,return=taxis`
+ !-> set axis/calendar=366 TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+ 
+set axis/calendar=all_leap `temp,return=taxis`
+ !-> set axis/calendar=all_leap TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE ALL_LEAP
+ALL_LEAP
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             CALENDAR : ALL_LEAP
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 09-DEC-1982 02 / 20:  32.6698
+ 15-DEC-1982 04 / 21:  32.7830
+ 21-DEC-1982 06 / 22:  32.7033
+ 27-DEC-1982 08 / 23:  32.4479
+ 02-JAN-1983 10 / 24:  32.2491
+ 08-JAN-1983 12 / 25:  32.1819
+ 
+! Now resetting T0
+CAN DATA/ALL
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+ 
+set axis/calendar="standard" `temp,return=taxis`
+ !-> set axis/calendar="standard" TIME11
+list/l=20:25 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                        130.5W  
+                        100
+ 11-DEC-1982 02 / 20:  32.6698
+ 17-DEC-1982 04 / 21:  32.7830
+ 23-DEC-1982 06 / 22:  32.7033
+ 29-DEC-1982 08 / 23:  32.4479
+ 04-JAN-1983 10 / 24:  32.2491
+ 10-JAN-1983 12 / 25:  32.1819
+ 
+! One day earlier
+set axis/t0="13-jan-1980:14:00" `temp,return=taxis`
+ !-> set axis/t0="13-jan-1980:14:00" TIME11
+say `temp,return=calendar`
+ !-> MESSAGE/CONTINUE GREGORIAN
+GREGORIAN
+list/l=20:25 t[gt=temp]
+             VARIABLE : T
+                        axis TIME11
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-DEC-1982 02 / 20:  25476.0
+ 16-DEC-1982 04 / 21:  25622.0
+ 22-DEC-1982 06 / 22:  25768.0
+ 28-DEC-1982 08 / 23:  25914.0
+ 03-JAN-1983 10 / 24:  26060.0
+ 09-JAN-1983 12 / 25:  26206.0
+ 
+ 
+! Now resetting UNITS
+CAN DATA/ALL
+CAN REGION
+use gt4d011.cdf
+ 
+set axis/units=feet `temp,return=zaxis`
+ !-> set axis/units=feet PSZT
+show axis `temp,return=zaxis`
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (FEET)            27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+! unrecognized units
+set axis/units="something" `temp,return=xaxis`
+ !-> set axis/units="something" PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon
+set axis/units=lon `temp,return=xaxis`
+ !-> set axis/units=lon PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=something `temp,return=xaxis`
+ !-> set axis/units=something PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     X (SOMETHING)      160mr   130.5                289.5
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+! restore lon using word DEG
+set axis/units=deg `temp,return=xaxis`
+ !-> set axis/units=deg PSXT1
+show axis `temp,return=xaxis`
+ !-> show axis PSXT1
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+ 
+set axis/units=zorro  `temp,r=zaxis`
+ !-> set axis/units=zorro  PSZT
+list/x=130w/y=1/k=1/L=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                       130.5W  
+                       100
+ 17-AUG-1982 12 / 1:  25.9777
+ 23-AUG-1982 14 / 2:  26.2025
+ 29-AUG-1982 16 / 3:  26.4463
+ 04-SEP-1982 18 / 4:  26.6606
+ 10-SEP-1982 20 / 5:  26.7818
+ 
+! not a geographic axis
+set axis/units=meters `temp,return=yaxis`
+ !-> set axis/units=meters PSYT
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (Y (METERS))
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ -0.5  / 44:  26.3422
+ -0.17 / 45:  26.2807
+ 0.17  / 46:  26.2649
+ 0.5   / 47:  26.2916
+ 
+set axis/units=deg `temp,return=yaxis`
+ !-> set axis/units=deg PSYT
+show axis `temp,return=yaxis`
+ !-> show axis PSYT
+ name       axis              # pts   start                end
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+   Axis span (to cell edges) = 80.00004
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (LATITUDE)
+             LONGITUDE: 138.5W
+             Z (ZORRO): 5
+             TIME     : AUG-1982
+               138.5W  
+                92
+ 0.5N  / 47:  26.2916
+ 0.17N / 46:  26.2649
+ 0.17S / 45:  26.2807
+ 0.5S  / 44:  26.3422
+ 
+! inappropriate units for axis direction
+set axis/units=meters `temp,return=taxis`
+ !-> set axis/units=meters TIME11
+list/x=130w/y=1/k=1/l=1:5 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (T (METERS))
+             LONGITUDE: 130.5W
+             LATITUDE : 0.833N
+             Z (ZORRO): 5
+                130.5W  
+                100
+ 22702   / 1:  25.9777
+ 22848   / 2:  26.2025
+ 22994   / 3:  26.4463
+ 23140   / 4:  26.6606
+ 23286   / 5:  26.7818
+ 
+set axis/units=seconds  `temp,r=yaxis`
+ !-> set axis/units=seconds  PSYT
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT      Y (SECONDS)        100 i   -28.836              48.568
+ PSZT      Z (ZORRO)           27 i-  5                    3824
+ TIME11    T (METERS)          25 r   22702                26206
+ normal    E
+ normal    F
+ 
+! assign time units to an abstract axis
+def axis/t=1:5:1 tax
+ 
+set axis/units=days/t0=1-jan-1990 tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 5 r   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 5
+list t[gt=tax]
+             VARIABLE : T
+                        axis TAX
+             SUBSET   : 5 points (TIME)
+ 02-JAN-1990 00 / 1:  1.00000
+ 03-JAN-1990 00 / 2:  2.00000
+ 04-JAN-1990 00 / 3:  3.00000
+ 05-JAN-1990 00 / 4:  4.00000
+ 06-JAN-1990 00 / 5:  5.00000
+ 
+! assign longitude units to an abstract axis
+! by default this becomes modulo
+def axis/x=0:120:20 xax
+ 
+set axis/units=lon xax
+sh axis xax
+ name       axis              # pts   start                end
+ XAX       LONGITUDE            7mr   0E                   120E
+   Axis span (to cell edges) = 140 (modulo length = 360)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 7 points (LONGITUDE)
+ 0E     / 1:    0.000
+ 20E    / 2:   20.000
+ 40E    / 3:   40.000
+ 60E    / 4:   60.000
+ 80E    / 5:   80.000
+ 100E   / 6:  100.000
+ 120E   / 7:  120.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : FEB-1900
+          28.3646
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.00000
+ 114W   / 427:  1.00000
+ 113W   / 428:  1.00000
+ 112W   / 429:  1.00000
+ 111W   / 430:  1.00000
+ 110W   / 431:  1.00000
+ 109W   / 432:  1.00000
+ 108W   / 433:  1.00000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.000
+ 114W   / 427:  246.000
+ 113W   / 428:  247.000
+ 112W   / 429:  248.000
+ 111W   / 430:  249.000
+ 110W   / 431:  250.000
+ 109W   / 432:  251.000
+ 108W   / 433:  252.000
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+ 
+! ******** V5.8 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5559
+ 15-FEB      /  2:  29.5316
+ 17-MAR      /  3:  29.6615
+ 16-APR      /  4:  29.8829
+ 16-MAY      /  5:  29.8907
+ 16-JUN      /  6:  29.9644
+ 16-JUL      /  7:  29.6883
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.6661
+ 16-OCT      / 10:  29.7464
+ 15-NOV      / 11:  29.9058
+ 16-DEC      / 12:  29.7728
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                      139.5E   
+                       10
+ 16-JAN      /  1:  0.0020743
+ 15-FEB      /  2:  0.0005012
+ 17-MAR      /  3:  0.0079502
+ 16-APR      /  4:  0.0015034
+ 16-MAY      /  5:  0.0035104
+ 16-JUN      /  6:  0.0096970
+ 16-JUL      /  7:  0.0188794
+ 16-AUG      /  8:       ....
+ 15-SEP      /  9:  0.0055797
+ 16-OCT      / 10:  0.0068064
+ 15-NOV      / 11:  0.0019084
+ 16-DEC      / 12:  0.0048345
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.5018
+ 15-FEB      /  2:  29.5157
+ 17-MAR      /  3:  29.5182
+ 16-APR      /  4:  29.7809
+ 16-MAY      /  5:  29.7883
+ 16-JUN      /  6:  29.8047
+ 16-JUL      /  7:  29.5034
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.5334
+ 16-OCT      / 10:  29.6438
+ 15-NOV      / 11:  29.8575
+ 16-DEC      / 12:  29.6620
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  29.6371
+ 15-FEB      /  2:  29.5474
+ 17-MAR      /  3:  29.8171
+ 16-APR      /  4:  29.9306
+ 16-MAY      /  5:  29.9564
+ 16-JUN      /  6:  30.0834
+ 16-JUL      /  7:  29.8189
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  29.7498
+ 16-OCT      / 10:  29.9003
+ 15-NOV      / 11:  29.9684
+ 16-DEC      / 12:  29.8558
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  295.559
+ 15-FEB      /  2:   59.063
+ 17-MAR      /  3:  533.908
+ 16-APR      /  4:  597.657
+ 16-MAY      /  5:  597.813
+ 16-JUN      /  6:  359.572
+ 16-JUL      /  7:  207.818
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  237.329
+ 16-OCT      / 10:  297.464
+ 15-NOV      / 11:  299.058
+ 16-DEC      / 12:  297.728
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  10.0000
+ 15-FEB      /  2:   2.0000
+ 17-MAR      /  3:  18.0000
+ 16-APR      /  4:  20.0000
+ 16-MAY      /  5:  20.0000
+ 16-JUN      /  6:  12.0000
+ 16-JUL      /  7:   7.0000
+ 16-AUG      /  8:   0.0000
+ 15-SEP      /  9:   8.0000
+ 16-OCT      / 10:  10.0000
+ 15-NOV      / 11:  10.0000
+ 16-DEC      / 12:  10.0000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.5000
+ 02-JAN-1990 00 /  2:  -1.5000
+ 03-JAN-1990 00 /  3:  -2.5000
+ 04-JAN-1990 00 /  4:  -3.5000
+ 05-JAN-1990 00 /  5:  -4.5000
+ 06-JAN-1990 00 /  6:  -5.5000
+ 07-JAN-1990 00 /  7:  -6.5000
+ 08-JAN-1990 00 /  8:  -7.5000
+ 09-JAN-1990 00 /  9:  -8.5000
+ 10-JAN-1990 00 / 10:  -9.5000
+ 11-JAN-1990 00 / 11:   1.9800
+ 12-JAN-1990 00 / 12:   3.9800
+ 13-JAN-1990 00 / 13:   5.9800
+ 14-JAN-1990 00 / 14:   7.9800
+ 15-JAN-1990 00 / 15:   9.9800
+ 16-JAN-1990 00 / 16:  11.9800
+ 17-JAN-1990 00 / 17:  13.9800
+ 18-JAN-1990 00 / 18:  15.9800
+ 19-JAN-1990 00 / 19:  17.9800
+ 20-JAN-1990 00 / 20:  19.9800
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.50000
+ 03-JAN-1990 00 / 3: -2.50000
+ 04-JAN-1990 00 / 4: -3.50000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.00000  0.500000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.98000
+ 13-JAN-1990 00 / 13:  5.98000
+ 14-JAN-1990 00 / 14:  7.98000
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.00000 -0.0200000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,6.2,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  3.00000  2.00000  1.00000  1.00000  3.00000
+ 2   / 2:  1.00000  3.00000  2.00000  2.00000  3.00000
+ 3   / 3:  2.00000  3.00000  3.00000  2.00000  3.00000
+ 4   / 4:  3.00000  2.00000  1.00000  1.00000  2.00000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+              1        2        3        4        5     
+              1        2        3        4        5
+ ---- K:1 Z:   1
+ 1   / 1:  111.000  112.000  113.000  114.000  115.000
+ 2   / 2:  121.000  122.000  123.000  124.000  125.000
+ 3   / 3:  131.000  132.000  133.000  134.000  135.000
+ 4   / 4:  141.000  142.000  143.000  144.000  145.000
+ ---- K:2 Z:   2
+ 1   / 1:  211.000  212.000  213.000  214.000  215.000
+ 2   / 2:  221.000  222.000  223.000  224.000  225.000
+ 3   / 3:  231.000  232.000  233.000  234.000  235.000
+ 4   / 4:  241.000  242.000  243.000  244.000  245.000
+ ---- K:3 Z:   3
+ 1   / 1:  311.000  312.000  313.000  314.000  315.000
+ 2   / 2:  321.000  322.000  323.000  324.000  325.000
+ 3   / 3:  331.000  332.000  333.000  334.000  335.000
+ 4   / 4:  341.000  342.000  343.000  344.000  345.000
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:  311.000  212.000  113.000  114.000  315.000
+ 2   / 2:  121.000  322.000  223.000  224.000  325.000
+ 3   / 3:  231.000  332.000  333.000  234.000  335.000
+ 4   / 4:  341.000  242.000  143.000  144.000  245.000
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E     	100.E    	100.1E   	100.2E   	100.2E   	100.3E   
+0.11N	1.0011	1.0016	1.0021	1.0026	1.0031	1.0036
+0.128N	1.00128	1.00178	1.00228	1.00278	1.00328	1.00378
+0.146N	1.00146	1.00196	1.00246	1.00296	1.00346	1.00396
+0.164N	1.00164	1.00214	1.00264	1.00314	1.00364	1.00414
+0.182N	1.00182	1.00232	1.00282	1.00332	1.00382	1.00432
+0.2N	1.002	1.0025	1.003	1.0035	1.004	1.0045
+0.218N	1.00218	1.00268	1.00318	1.00368	1.00418	1.00468
+0.236N	1.00236	1.00286	1.00336	1.00386	1.00436	1.00486
+0.254N	1.00254	1.00304	1.00354	1.00404	1.00454	1.00504
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E     ,100E     ,100.1E   ,100.1E   
+0.11N,1.0011,1.00143,1.00176,1.00209
+0.128N,1.00128,1.00161,1.00194,1.00227
+0.146N,1.00146,1.00179,1.00212,1.00245
+0.164N,1.00164,1.00197,1.0023,1.00263
+0.182N,1.00182,1.00215,1.00248,1.00281
+0.2N,1.002,1.00233,1.00266,1.00299
+0.218N,1.00218,1.00251,1.00284,1.00317
+0.236N,1.00236,1.00269,1.00302,1.00335
+0.254N,1.00254,1.00287,1.0032,1.00353
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.000
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.00000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.000
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1W   	155.1W   	155.1W   	155.1W   	155.1W   
+19.7N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1W   ,155.1W   ,155.1W   ,155.1W   ,155.1W   
+19.7N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: FEB-1980
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  8.000E+00  7.200E+00 0.060    0  SYSTEM  @ASFERRET Ver. 6.861
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 2  8.000E+00  7.100E+00 0.060    0  SYSTEM  @ASNOAA/PMEL TMAP
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 3  8.000E+00  7.000E+00 0.060    0  SYSTEM  @AS26-MAR-2014 15:38:39
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  8.000E+00  6.540E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 7  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 8  8.000E+00  6.750E+00 0.073    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+ 
+! ******** V5.81 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.5
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.5
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: JAN-1946 to JUL-1946
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+ 
+GO bn_reset
+cancel mode verify
+GO bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+ 
+GO bn_reset
+cancel mode verify
+GO bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl fill
+ 
+GO bn_reset
+cancel mode verify
+GO bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME7     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME7     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+! can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+ 
+! ******** V6.00 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+ 
+GO bn_reset
+cancel mode verify
+GO bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : MAR
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.861"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET   version6.861:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE/SIGMA
+      /CURVILIN
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE/QUIET
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET/SIGMA/CURVILIN
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO
+ 
+ Use SHOW ALIAS to see alternative command names
+ 
+GO bn_reset
+cancel mode verify
+GO bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "26-Mar-14:15:37"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="26-Mar-14:15:37"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 26-Mar-14
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 15:37
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="26-Mar-14:15:37"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "26-Mar-14:15:37"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+GO bn_reset
+cancel mode verify
+GO bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT1)
+ Column  2: Z is Z (axis PSZT1)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT1)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+ 
+go bn_reset
+cancel mode verify
+go bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT1)                DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT1)                DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT1)                DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME4"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT1).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME4).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME4" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.6N
+             T (day): 1.8
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT1).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT1).units = degrees 
+ (PSXT1).point_spacing = even 
+ (PSXT1).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT1).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT1).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT1).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT1).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT1)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT1).units = meters 
+ (PSYT1).point_spacing = uneven 
+ (PSYT1).edges = PSYTedges 
+ (PSYT1).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = hour since 0000-01-01 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME7).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = days since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME7).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-JAN-0000 00:00:00 
+ (TIME7).time_origin = 1-JAN-0000 00:00:00 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME7).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 1-mar-1955 
+ (TIME7).time_origin = 1-mar-1955 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME7).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME7)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME7).units = months since 15-jan-2002 
+ (TIME7).time_origin = 15-jan-2002 
+ (TIME7).modulo =   
+ (TIME7).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME3)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME3[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME3).units = hour since 0000-01-01 00:00:00 
+ (TIME3).time_origin = 01-JAN-0000 00:00:00 
+ (TIME3).modulo =   
+ (TIME3).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+ 
+!=======
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!go bn_reset
+!go bn_nco_functions.jnl
+ 
+go bn_reset
+cancel mode verify
+go bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : JAN
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : JAN
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: JAN
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: JAN
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+ 
+go bn_reset
+cancel mode verify
+go bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : JAN to APR (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : JAN
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : JAN
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : AUG-1982
+          11.33
+ 
+go bn_reset
+cancel mode verify
+go bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+ 
+go bn_reset
+cancel mode verify
+go bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test (STRING)
+    VALUES: strings to search for (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME11
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+Unable to allocate 200.0 Mwords of memory.
+Restoring previous memory of 25.6 Mwords.
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+ 
+! ******** V6.01 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+             TIME     : MAR-1983
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6321)
+             LATITUDE : 5.167S
+             DEPTH (m): 5
+             TIME     : MAR-1983
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME9
+ 
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME9
+show att/all ($timeax)
+ !-> show att/all TIME9
+show axis ($timeax)
+ !-> show axis TIME9
+ name       axis              # pts   start                end
+ TIME9     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT1
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT1
+show att/all ($zax)
+ !-> show att/all PSZT1
+show axis ($zax)
+ !-> show axis PSZT1
+ name       axis              # pts   start                end
+ PSZT1     Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT191_108)          DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        11   F       PSXT191_108
+  
+(PSYT135_56)           DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        15   T       PSYT135_56_bnds
+                                 orig_file_axnameCHAR        10   F       PSYT135_56
+  
+ PSYT135_56_bnds       DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT191_108)          DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        11   F       PSXT191_108
+  
+(PSYT135_56)           DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        15   T       PSYT135_56_bnds
+                                 orig_file_axnameCHAR        10   F       PSYT135_56
+  
+ PSYT135_56_bnds       DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME111)              DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.19N to 59.16N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.39N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! ******** V6.02 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX047)
+show axis `sst,return=xaxis`
+ !-> show axis (AX047)
+ name       axis              # pts   start                end
+ (AX047)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : FEB-0012
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:   1
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX042)
+ name       axis              # pts   start                end
+ (AX042)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX042)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : JAN
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX049)
+ name       axis              # pts   start                end
+ (AX049)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : JAN
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME10
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX051)
+ name       axis              # pts   start                end
+ (AX051)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX048)
+ name       axis              # pts   start                end
+ (AX048)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME10
+ name       axis              # pts   start                end
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+ 
+GO bn_reset
+cancel mode verify
+GO bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: FEB-1982 to MAR-1982
+             LONGITUDE: 179.5E
+             LATITUDE: 0.167S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME3     TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      T                    5 r   1                    5
+   Axis span (to cell edges) = 5
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX1     X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX1     T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = 360)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+GO bn_reset
+cancel mode verify
+GO bn602_bug_fixes
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME11    TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.51N to 90.37N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+ 
+ 
+! ******** V6.03 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.833N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: JAN to DEC
+             LONGITUDE: 139.5E
+             LATITUDE: 0.833N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn603_bug_fixes
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+Unable to allocate 500000.0 Mwords of memory.
+Restoring previous memory of 0.2 Mwords.
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+ 
+! ******** V6.05 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  11.89756
+ 179W   / 81:  12.11905
+ 177W   / 82:  12.07976
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : MAR
+                 39N     
+                  65
+ 179E   / 80:  35.69268
+ 179W   / 81:  36.35714
+ 177W   / 82:  36.23927
+ 
+ 
+GO bn_reset
+cancel mode verify
+! This routine executes a ppl error which exits us from Ferret
+! when run in the benchmark suite. Should test this, but dont do it
+! here, for now.
+!GO bn_ppl_errors.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO bn_memory_symbol
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+ 
+GO bn_reset
+cancel mode verify
+GO bn605_bug_fixes
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: JAN to DEC
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                            T     TBOX
+16-JAN 12      /  1:   15.5000  31.00000
+15-FEB 02      /  2:   45.1213  28.24250
+15-MAR 17      /  3:   74.7425  31.00000
+15-APR 05      /  4:  105.2425  30.00000
+15-MAY 17      /  5:  135.7425  31.00000
+15-JUN 05      /  6:  166.2425  30.00000
+15-JUL 17      /  7:  196.7425  31.00000
+15-AUG 17      /  8:  227.7425  31.00000
+15-SEP 05      /  9:  258.2425  30.00000
+15-OCT 17      / 10:  288.7425  31.00000
+15-NOV 05      / 11:  319.2425  30.00000
+15-DEC 17      / 12:  349.7425  31.00000
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+ADD_9(A,B,C,D,E,F,G,H,I)
+APPENDE(ENS,VAR)
+AVET(A)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+DATES(Offsets)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+FACTORIAL(A)
+FFT_AMP(A)
+FFTA_SAMPLE(A)
+FFT_PHAS(A)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+PASS_THRU(A)
+PERCENT_GOOD_T(A)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SORTI_STR(DAT)
+STORAGE(A)
+STRING_ARG(Flags,NString)
+STUDENT_T_CUTOFF(P,nf)
+SUBTRACT(A,B)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn608_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT1</xaxis>
+<yaxis>PSYT1</yaxis>
+<taxis>TIME11</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000010E-04"
+YAXIS_MAX = "2.1000002E-03"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000012E-07"
+YAXIS_MAX = "2.1000003E-06"
+YAXNAM = "YAX_LEV94"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+YAXNAM = "YAX_LEV94"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXL = "4.737"
+XAXNAME = "XIRREG_SUBSPAN"
+XAXIS_MAX = "5.0050505E-06"
+XAXNAM = "(XAX_LEV9421_380)"
+YAXIS_REVERSED = "0"
+YAXL = "4.737"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+YAXNAM = "YAX_LEV94"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+ 
+ 
+! ******** V6.1 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_shade_trim
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_mode_nlevels
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_TEXT = "300"
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn61_bug_fixes
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+ 
+ 
+! ******** V6.11 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_test_opendap
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00000
+ 
+ 
+CANCEL MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO bn611_bug_fixes
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+fill/over/i=1:2/j=0:2/patt i+j
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME3"          
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT1"     
+ 2    /  2:"PSYT1"     
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT1"     
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME11"    
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G104)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+ 
+! ******** V6.13 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_no_valid_on_plot
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : JAN
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.530E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.780E+00 -7.900E-01 0.119    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.530E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+ 
+GO bn_reset
+cancel mode verify
+GO bn_median
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: NOV-1982 to JAN-1983
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                           VAR     VAR       VAR       VAR
+30-NOV-1982 23 / 106: -10.06812 -10.06812 -10.06812 -11.97891
+04-DEC-1982 00 / 107: -13.41848 -13.41848 -13.41848 -10.06812
+07-DEC-1982 01 / 108: -15.06836 -13.41848 -13.41848 -10.06812
+10-DEC-1982 02 / 109: -11.97891 -11.97891 -11.97891 -10.06812
+13-DEC-1982 03 / 110:  -4.63116  -4.63116  -4.63116  -4.63116
+16-DEC-1982 04 / 111:   0.77075   0.77075   0.77075   0.77075
+19-DEC-1982 05 / 112:   1.06240   1.06240   1.06240   1.06240
+22-DEC-1982 06 / 113:   2.75400   2.75400   2.75400   2.75400
+25-DEC-1982 07 / 114:   9.06758   9.06758   9.06758   4.21162
+28-DEC-1982 08 / 115:  10.80434   9.06758   9.06758   4.21162
+31-DEC-1982 09 / 116:   4.21162  10.80434  10.80434   9.06758
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: FEB-0002
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+                  VAR     VAR       VAR
+79W   / 131:      ....  25.98750  25.92824
+77W   / 132:      ....      ....  25.98750
+75W   / 133:      ....      ....  25.98750
+73W   / 134:      ....      ....      ....
+71W   / 135:      ....      ....      ....
+69W   / 136:      ....      ....      ....
+67W   / 137:      ....      ....      ....
+65W   / 138:      ....      ....      ....
+63W   / 139:      ....      ....  27.80000
+61W   / 140:      ....      ....  27.80000
+59W   / 141:      ....  27.80000  27.64737
+57W   / 142:  27.80000  27.80000  27.70333
+55W   / 143:  27.64737  27.64737  27.64737
+53W   / 144:  27.43500  27.64737  27.64737
+51W   / 145:  27.70333  27.43500  27.64737
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: FEB-0002
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+                 VAR     VAR       VAR
+19S   / 36:  28.32244  28.32244  28.32244
+17S   / 37:  28.56983  28.56983  28.56983
+15S   / 38:  29.05953  29.05953  29.05953
+13S   / 39:  29.43250  29.23719  29.23170
+11S   / 40:  29.23719  29.32561  29.23170
+9S    / 41:  29.32561  29.23719  29.23170
+7S    / 42:  29.23170  29.23170  29.23170
+5S    / 43:  28.96976  28.96976  28.96976
+3S    / 44:  28.39779  28.39779  28.44243
+1S    / 45:  28.36456  28.39779  28.39779
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+                VAR     VAR        VAR
+0     / 1:  1.900075  1.900075  0.3281405
+20    / 2:  1.322209  1.322209  0.3281405
+40    / 3:  0.328140  0.328140  0.2405229
+60    / 4: -0.253715 -0.157475  0.3281405
+80    / 5: -0.157475 -0.253715  0.3281405
+100   / 6: -0.785400 -0.157475  0.3281405
+120   / 7:  0.240523  0.240523  0.3281405
+140   / 8:  0.390383  0.390383  0.3903829
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn614_bug_fixes
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00000
+ 30-FEB-1909 00 / 2:  59.00000
+ 02-MAR-1909 00 / 3:  61.00000
+ 04-MAR-1909 00 / 4:  63.00000
+ 06-MAR-1909 00 / 5:  65.00000
+ 08-MAR-1909 00 / 6:  67.00000
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000000
+ 1   / 2:  1.000000
+ 3   / 3:  3.000000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME11    TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.53000
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+          27.50000
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1.011S
+                          141.3W   
+                            1
+ 16-JAN 12      /  1:  0.05848070
+ 15-FEB 00      /  2:  0.05188299
+ 16-MAR 12      /  3:  0.04782573
+ 16-APR 00      /  4:  0.03808421
+ 16-MAY 12      /  5:  0.05937929
+ 16-JUN 00      /  6:  0.06571895
+ 16-JUL 12      /  7:  0.06152720
+ 16-AUG 12      /  8:  0.07460730
+ 16-SEP 00      /  9:  0.05815475
+ 16-OCT 12      / 10:  0.06169292
+ 16-NOV 00      / 11:  0.05654943
+ 16-DEC 12      / 12:  0.05768678
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 1-JAN-0001
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 365 (modulo length = axis span)
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "50"
+LEV_DEL = "0.02"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_TEXT = "(-5,30,1)"
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "50"
+LEV_DEL = "0.02"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX3      TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+ 
+! ******** V6.14 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn_mode_nodata_lab
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_proleptic_gregorian_calendar
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME               733 r   01-JAN-1988 00:00    01-JAN-1990 00:00
+T0 = 15-JAN-1901
+CALENDAR = ALL_LEAP
+   Axis span (to cell edges) = 733
+ 
+GO bn_reset
+cancel mode verify
+GO bn_string_ngd_nbd
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  1.000000
+ 3   / 3:  2.000000
+ 4   / 4:  0.000000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000000
+ 2   / 2:  2.000000
+ 3   / 3:  1.000000
+ 4   / 4:  3.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000000
+ 2   / 2:  2.000000
+ 3   / 3:  3.000000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  0.000000  1.000000
+ 2   / 2:  1.000000  2.000000
+ 3   / 3:  0.000000  0.000000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+ ---- L:2 T:   2
+ 1   / 1:  1.000000  0.000000
+ 2   / 2:  2.000000  1.000000
+ 3   / 3:  0.000000  0.000000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+              1         2      
+               1         2
+ ---- L:1 T:   1
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+ ---- L:2 T:   2
+ 1   / 1:  2.000000  3.000000
+ 2   / 2:  1.000000  2.000000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+              1         2      
+               1         2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  0.000000  2.000000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000000  2.000000
+ 2   / 2:  0.000000  0.000000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000000  2.000000
+ 2   / 2:  2.000000  2.000000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000000
+ 2   / 2:  4.000000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cat_string
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_sort_strings
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+          INDX_AI                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+          INDX_BI   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+          INDX_AJ                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+          INDX_BJ   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+          INDX_AK                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+          INDX_BK   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+          INDX_AL                       EX#2
+1   / 1:  4.000000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:  2.000000 "a rat in the house will eat the ice cream"  
+3   / 3:  1.000000 "a rat in the house will eat the zucchini"   
+4   / 4:  3.000000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+          INDX_BL   EX#2
+1   / 1:  7.000000 "0"  
+2   / 2:  1.000000 "AB" 
+3   / 3:  2.000000 "C"  
+4   / 4:  4.000000 "aa" 
+5   / 5:  5.000000 "abc"
+6   / 6:      .... ""   
+7   / 7:      .... ""   
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_samplexyt
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+               YPTS     TPTS   SAMPL_PTS
+1    /  1:  20.53799    20.000      ....
+2    /  2: -29.07481    60.000      ....
+3    /  3:  26.64251   100.000      ....
+4    /  4: -28.97490   140.000      ....
+5    /  5: -17.10210   180.000      ....
+6    /  6:  -8.79040   220.000      ....
+7    /  7: -26.48790   260.000      ....
+8    /  8:  -9.00391   300.000      ....
+9    /  9: -19.19385   340.000      ....
+10   / 10: -19.84003   380.000  360.6600
+11   / 11: -44.10992   420.000  376.3901
+12   / 12:  34.07387   460.000  494.5739
+13   / 13:  34.62830   500.000  535.1283
+14   / 14:  -6.59559   540.000  533.9044
+15   / 15: -39.01164   580.000  541.4884
+16   / 16: -25.63370   620.000  594.8663
+17   / 17: -22.96677   660.000  637.5332
+18   / 18: -30.90969   700.000  669.5903
+19   / 19: -22.52078   740.000      ....
+20   / 20: -20.65415   780.000      ....
+21   / 21: -41.65880   820.000      ....
+22   / 22:  39.13533   860.000      ....
+23   / 23:  22.88071   900.000      ....
+24   / 24: -41.03287   940.000      ....
+25   / 25:  33.34976   980.000      ....
+26   / 26:  22.53505  1020.000      ....
+27   / 27:  13.97536  1060.000      ....
+28   / 28:  21.99063  1100.000      ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+ 
+GO bn_reset
+cancel mode verify
+GO bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 501
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=JAN-1902:JAN-1902 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=JAN-1902:JAN-1902)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: JAN-1902 to JAN-1902
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1      X                   10 r   1                    10
+ YAX1      Y                   20 r   1                    20
+ ZAX1      Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G093_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G093_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G104_NXT with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.84S:51.43N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.84S:51.43N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT1     DEPTH (m)           27 i-  5                    3824
+ TIME12    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.84S:51.43N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.84S:51.43N  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.11S:12.52S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=MAR-1983:MAR-1983)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.84S:51.43N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.11S:12.52S  Z=40:190  
+ 
+  time range: MAR-1983 to MAR-1983
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+          FCN_NOR    FCN_REV
+J /  1:  0.6331937 -0.6331937
+J /  2:  0.6454794 -0.6454794
+J /  3:  0.4997293 -0.4997293
+J /  4:  0.2316280 -0.2316280
+J /  5: -0.0931839  0.0931839
+J /  6: -0.3951811  0.3951811
+J /  7: -0.6004243  0.6004243
+J /  8: -0.6586626  0.6586626
+J /  9: -0.5556374  0.5556374
+J / 10: -0.3165727  0.3165727
+J / 11:  0.0000000  0.0000000
+J / 12:  0.3165727 -0.3165727
+J / 13:  0.5556374 -0.5556374
+J / 14:  0.6586626 -0.6586626
+J / 15:  0.6004243 -0.6004243
+J / 16:  0.3951811 -0.3951811
+J / 17:  0.0931839 -0.0931839
+J / 18: -0.2316280  0.2316280
+J / 19: -0.4997293  0.4997293
+J / 20: -0.6454794  0.6454794
+J / 21: -0.6331937  0.6331937
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+                180E    
+                51
+ 8N   / 19:  0.4997293
+ 7N   / 18:  0.2316280
+ 6N   / 17: -0.0931839
+ 5N   / 16: -0.3951811
+ 4N   / 15: -0.6004243
+ 3N   / 14: -0.6586626
+ 2N   / 13: -0.5556374
+ 1N   / 12: -0.3165727
+ 0    / 11:  0.0000000
+ 1S   / 10:  0.3165727
+ 
+GO bn_reset
+cancel mode verify
+GO bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+ 
+! ******** V6.2 Additions below ***********
+GO bn_reset
+cancel mode verify
+GO bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0000
+ 31-DEC-1999 12:00 / 792:  365.0000
+ 01-JAN-2000 00:00 / 793:    1.0000
+ 01-JAN-2000 12:00 / 794:    1.0000
+ 02-JAN-2000 00:00 / 795:    2.0000
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00000
+ 27-FEB-1999 12:00 / 178:  58.00000
+ 28-FEB-1999 00:00 / 179:  59.00000
+ 28-FEB-1999 12:00 / 180:  59.00000
+ 01-MAR-1999 00:00 / 181:  60.00000
+ 01-MAR-1999 12:00 / 182:  60.00000
+ 02-MAR-1999 00:00 / 183:  61.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A       A        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+                  B       B        EX#3       EX#4
+1    /  1:  0.000000       ....       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000  0.8000000
+3    /  3:  1.000000  0.7500000  0.7500000  0.6000000
+4    /  4:  0.000000  0.5000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000  0.4000000
+6    /  6:  0.000000  0.2500000  0.2500000  0.1000000
+7    /  7:  0.000000  0.0000000  0.0000000       ....
+8    /  8:  0.000000       ....       ....       ....
+9    /  9:      ....       ....       ....       ....
+10   / 10:  0.000000       ....       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000       ....
+12   / 12:  0.000000       ....       ....       ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+                  C       C        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 13
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+                  D       D        EX#3
+1    /  1:  0.000000       ....       ....
+2    /  2:  1.000000  0.7500000  0.7500000
+3    /  3:  1.000000  0.7500000  0.7500000
+4    /  4:  0.000000  0.5000000  0.5000000
+5    /  5:  1.000000  0.5000000  0.5000000
+6    /  6:  0.000000  0.2500000  0.2500000
+7    /  7:  0.000000  0.0000000  0.0000000
+8    /  8:  0.000000       ....       ....
+9    /  9:      ....       ....       ....
+10   / 10:  0.000000       ....       ....
+11   / 11:  0.000000  0.0000000  0.0000000
+12   / 12:  0.000000       ....       ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+                  A      A        EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000000      ....      ....
+2    /  2:  2.000000  1.750000  1.750000
+3    /  3:  2.000000  1.750000  1.750000
+4    /  4:  1.000000  1.500000  1.500000
+5    /  5:  2.000000  1.500000  1.500000
+6    /  6:  1.000000  1.250000  1.250000
+7    /  7:  1.000000  1.000000  1.000000
+8    /  8:  1.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  1.000000      ....      ....
+11   / 11:  1.000000  1.000000  1.000000
+12   / 12:  1.000000      ....      ....
+ ---- J:2 Y:   2
+1    /  1:  2.000000      ....      ....
+2    /  2:  3.000000  2.750000  2.750000
+3    /  3:  3.000000  2.750000  2.750000
+4    /  4:  2.000000  2.500000  2.500000
+5    /  5:  3.000000  2.500000  2.500000
+6    /  6:  2.000000  2.250000  2.250000
+7    /  7:  2.000000  2.000000  2.000000
+8    /  8:  2.000000      ....      ....
+9    /  9:      ....      ....      ....
+10   / 10:  2.000000      ....      ....
+11   / 11:  2.000000  2.000000  2.000000
+12   / 12:  2.000000      ....      ....
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3122928879.
+ 01-JAN-2000 00:14:41 / 441:  3122928881.
+ 01-JAN-2000 00:14:43 / 442:  3122928883.
+ 01-JAN-2000 00:14:45 / 443:  3122928885.
+ 01-JAN-2000 00:14:47 / 444:  3122928887.
+ 01-JAN-2000 00:14:49 / 445:  3122928889.
+ 01-JAN-2000 00:14:51 / 446:  3122928891.
+ 01-JAN-2000 00:14:53 / 447:  3122928893.
+ 01-JAN-2000 00:14:55 / 448:  3122928895.
+ 01-JAN-2000 00:14:57 / 449:  3122928897.
+ 01-JAN-2000 00:14:59 / 450:  3122928899.
+ 01-JAN-2000 00:15:01 / 451:  3122928901.
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_clock_syms
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "45.3061"
+CLOCK_SECS = "69.102"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:39:02"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.043993"
+CLOCK_SECS = "69.221"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.33195
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.001"
+CLOCK_SECS = "69.995"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "69.996"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.036994
+ !-> DEFINE VARIABLE sumcpu =0.036994
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.036994
+ !-> DEFINE VARIABLE sumcpu =0.073988
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.035994
+ !-> DEFINE VARIABLE sumcpu =0.109982
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.144977
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.032995
+ !-> DEFINE VARIABLE sumcpu =0.177972
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.034995
+ !-> DEFINE VARIABLE sumcpu =0.212967
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.033995
+ !-> DEFINE VARIABLE sumcpu =0.246962
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.034994
+ !-> DEFINE VARIABLE sumcpu =0.281956
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.036994
+ !-> DEFINE VARIABLE sumcpu =0.31895
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.036995
+ !-> DEFINE VARIABLE sumcpu =0.355945
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.355945
+0.355945
+sh sym CLOCK_SECS
+CLOCK_SECS = "71.231"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:37"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:39:04"
+ 
+ 
+! ******** V6.3 Additions below ***********
+! Note that allowing mouse-click operations in the current
+! window, not only in window 1, is implemented in v6.3. Not
+! tested in the benchmarks.
+ 
+GO bn_reset
+cancel mode verify
+GO bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+Set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                     Z    ZBOXLO    ZBOXHI
+-5000   /  1: -5000.000 -5000.000 -4500.000
+-4000   /  2: -4000.000 -4500.000 -3500.000
+-3000   /  3: -3000.000 -3500.000 -2500.000
+-2000   /  4: -2000.000 -2500.000 -1800.000
+-1500   /  5: -1500.000 -1800.000 -1300.000
+-1200   /  6: -1200.000 -1300.000 -1100.000
+-1000   /  7: -1000.000 -1100.000  -900.000
+-800    /  8:  -800.000  -900.000  -700.000
+-600    /  9:  -600.000  -700.000  -500.000
+-400    / 10:  -400.000  -500.000  -350.000
+-300    / 11:  -300.000  -350.000  -250.000
+-200    / 12:  -200.000  -250.000  -180.000
+-150    / 13:  -150.000  -180.000  -120.000
+-100    / 14:  -100.000  -120.000   -90.000
+-75     / 15:   -75.000   -90.000   -60.000
+-50     / 16:   -50.000   -60.000   -32.000
+-30     / 17:   -30.000   -32.000   -24.000
+-20     / 18:   -20.000   -24.000   -12.000
+-10     / 19:   -10.000   -12.000    -5.000
+0       / 20:     0.000    -5.000     0.000
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : JAN
+ 1   / 1:  27.46402
+ 2   / 2:  27.44937
+ 3   / 3:  27.53579
+ 4   / 4:  27.54567
+ 5   / 5:  27.55554
+ 6   / 6:  27.65924
+ 7   / 7:  27.74823
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+                 Z    ZBOXLO    ZBOXHI
+I / *:     5.000000  4.890000  5.110000
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+              YBOXLO    YBOXHI
+76.5S /  1: -90.00000 -70.81186
+66.4S /  2: -70.81186 -62.73396
+59.4S /  3: -62.73396 -56.44269
+53.7S /  4: -56.44269 -51.05756
+48.6S /  5: -51.05756 -46.23826
+44S   /  6: -46.23826 -41.81031
+39.7S /  7: -41.81031 -37.66989
+35.7S /  8: -37.66989 -33.74899
+31.9S /  9: -33.74899 -30.00000
+28.2S / 10: -30.00000 -26.38780
+24.6S / 11: -26.38780 -22.88538
+21.2S / 12: -22.88538 -19.47122
+17.8S / 13: -19.47122 -16.12762
+14.5S / 14: -16.12762 -12.83959
+11.2S / 15: -12.83959  -9.59407
+8S    / 16:  -9.59407  -6.37937
+4.8S  / 17:  -6.37937  -3.18474
+1.6S  / 18:  -3.18474   0.00000
+1.6N  / 19:   0.00000   3.18474
+4.8N  / 20:   3.18474   6.37937
+8N    / 21:   6.37937   9.59407
+11.2N / 22:   9.59407  12.83959
+14.5N / 23:  12.83959  16.12762
+17.8N / 24:  16.12762  19.47122
+21.2N / 25:  19.47122  22.88538
+24.6N / 26:  22.88538  26.38780
+28.2N / 27:  26.38780  30.00000
+31.9N / 28:  30.00000  33.74899
+35.7N / 29:  33.74899  37.66989
+39.7N / 30:  37.66989  41.81031
+44N   / 31:  41.81031  46.23826
+48.6N / 32:  46.23826  51.05756
+53.7N / 33:  51.05756  56.44269
+59.4N / 34:  56.44269  62.73396
+66.4N / 35:  62.73396  70.81186
+76.5N / 36:  70.81186  90.00000
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+                  EX#1      EX#2
+76.5S /  1:  0.03826170  0.02777778
+66.4S /  2:  0.02750340  0.02777778
+59.4S /  3:  0.02724976  0.02777778
+53.7S /  4:  0.02718343  0.02777778
+48.6S /  5:  0.02715676  0.02777778
+44S   /  6:  0.02714348  0.02777778
+39.7S /  7:  0.02713596  0.02777778
+35.7S /  8:  0.02713132  0.02777778
+31.9S /  9:  0.02712828  0.02777778
+28.2S / 10:  0.02712619  0.02777778
+24.6S / 11:  0.02712471  0.02777778
+21.2S / 12:  0.02712365  0.02777778
+17.8S / 13:  0.02712287  0.02777778
+14.5S / 14:  0.02712229  0.02777778
+11.2S / 15:  0.02712188  0.02777778
+8S    / 16:  0.02712159  0.02777778
+4.8S  / 17:  0.02712141  0.02777778
+1.6S  / 18:  0.02712133  0.02777778
+1.6N  / 19:  0.02712133  0.02777778
+4.8N  / 20:  0.02712141  0.02777778
+8N    / 21:  0.02712159  0.02777778
+11.2N / 22:  0.02712188  0.02777778
+14.5N / 23:  0.02712229  0.02777778
+17.8N / 24:  0.02712287  0.02777778
+21.2N / 25:  0.02712365  0.02777778
+24.6N / 26:  0.02712471  0.02777778
+28.2N / 27:  0.02712619  0.02777778
+31.9N / 28:  0.02712828  0.02777778
+35.7N / 29:  0.02713132  0.02777778
+39.7N / 30:  0.02713596  0.02777778
+44N   / 31:  0.02714348  0.02777778
+48.6N / 32:  0.02715676  0.02777778
+53.7N / 33:  0.02718343  0.02777778
+59.4N / 34:  0.02724976  0.02777778
+66.4N / 35:  0.02750340  0.02777778
+76.5N / 36:  0.03826170  0.02777778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777782
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777779
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02777777
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0000
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8458605
+ 16-JAN-1951 /  2: -0.4792148
+ 16-JAN-1952 /  3: -0.0086413
+ 16-JAN-1953 /  4:  0.5029880
+ 16-JAN-1954 /  5: -0.8600939
+ 16-JAN-1955 /  6:  0.9996375
+ 16-JAN-1956 /  7: -0.8863128
+ 16-JAN-1957 /  8:  0.5403982
+ 16-JAN-1958 /  9: -0.0624683
+ 16-JAN-1959 / 10: -0.4312768
+ 16-JAN-1960 / 11:  0.8159143
+ 16-JAN-1961 / 12: -0.9951944
+ 16-JAN-1962 / 13:  0.9169914
+ 16-JAN-1963 / 14: -0.6068212
+ 16-JAN-1964 / 15:  0.1431603
+ 16-JAN-1965 / 16:  0.3660465
+ 16-JAN-1966 / 17: -0.7727474
+ 16-JAN-1967 / 18:  0.9839827
+ 16-JAN-1968 / 19: -0.9463078
+ 16-JAN-1969 / 20:  0.6617913
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX139)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241199
+ DEC-1951 /  2:  0.2968155
+ DEC-1952 /  3:  0.2153545
+ DEC-1953 /  4: -0.6634768
+ DEC-1954 /  5:  0.9437761
+ DEC-1955 /  6: -0.9853337
+ DEC-1956 /  7:  0.7713169
+ DEC-1957 /  8: -0.3639512
+ DEC-1958 /  9: -0.1354919
+ DEC-1959 / 10:  0.6006479
+ DEC-1960 / 11: -0.9178868
+ DEC-1961 / 12:  0.9949715
+ DEC-1962 / 13: -0.8203671
+ DEC-1963 / 14:  0.4382506
+ DEC-1964 / 15:  0.0647143
+ DEC-1965 / 16: -0.5422904
+ DEC-1966 / 17:  0.8826929
+ DEC-1967 / 18: -0.9998160
+ DEC-1968 / 19:  0.8589436
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX130)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_reversed_syms
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_isdepth
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT1
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+ 
+ 
+! ******** V6.4 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn64_bug_fixes
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                  2         3      
+                   2         3
+ 21241   / 1:   2.00000  27.00000
+ 21242   / 2:   2.00000  28.00000
+ 21243   / 3:   2.00000  29.00000
+ 21244   / 4:   3.00000   1.00000
+ 21245   / 5:   3.00000   2.00000
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_grid_names
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20481  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+               1          2          3      
+               1          2          3
+ 1   / 1:  0.0060000  0.1760000  0.2820000
+ 2   / 2:  0.3550000  0.3790000  0.3930000
+ 3   / 3:  0.4100000  0.4170000  0.4670000
+ 4   / 4:  0.4350000  0.4440000  0.4700000
+ 5   / 5:  0.4780000  0.5150000  0.4690000
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              4         6         8      
+               2         3         4
+ ---- L:2 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2222.000  3222.000  4222.000
+ 6   / 3:  2322.000  3322.000  4322.000
+ 8   / 4:  2422.000  3422.000  4422.000
+ ---- K:3 Z:   6
+ 4   / 2:  2232.000  3232.000  4232.000
+ 6   / 3:  2332.000  3332.000  4332.000
+ 8   / 4:  2432.000  3432.000  4432.000
+ ---- K:4 Z:   8
+ 4   / 2:  2242.000  3242.000  4242.000
+ 6   / 3:  2342.000  3342.000  4342.000
+ 8   / 4:  2442.000  3442.000  4442.000
+ ---- L:3 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2223.000  3223.000  4223.000
+ 6   / 3:  2323.000  3323.000  4323.000
+ 8   / 4:  2423.000  3423.000  4423.000
+ ---- K:3 Z:   6
+ 4   / 2:  2233.000  3233.000  4233.000
+ 6   / 3:  2333.000  3333.000  4333.000
+ 8   / 4:  2433.000  3433.000  4433.000
+ ---- K:4 Z:   8
+ 4   / 2:  2243.000  3243.000  4243.000
+ 6   / 3:  2343.000  3343.000  4343.000
+ 8   / 4:  2443.000  3443.000  4443.000
+ ---- L:4 T:   JAN-1980
+ ---- K:2 Z:   4
+ 4   / 2:  2224.000  3224.000  4224.000
+ 6   / 3:  2324.000  3324.000  4324.000
+ 8   / 4:  2424.000  3424.000  4424.000
+ ---- K:3 Z:   6
+ 4   / 2:  2234.000  3234.000  4234.000
+ 6   / 3:  2334.000  3334.000  4334.000
+ 8   / 4:  2434.000  3434.000  4434.000
+ ---- K:4 Z:   8
+ 4   / 2:  2244.000  3244.000  4244.000
+ 6   / 3:  2344.000  3344.000  4344.000
+ 8   / 4:  2444.000  3444.000  4444.000
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+              5         7         9      
+               3         4         5
+ ---- L:3 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2777.500  3777.500  4777.500
+ 7   / 4:  2877.500  3877.500  4877.500
+ 9   / 5:  2977.500  3977.500  4977.500
+ ---- K:4 Z:   7
+ 5   / 3:  2787.500  3787.500  4787.500
+ 7   / 4:  2887.500  3887.500  4887.500
+ 9   / 5:  2987.500  3987.500  4987.500
+ ---- K:5 Z:   9
+ 5   / 3:  2797.500  3797.500  4797.500
+ 7   / 4:  2897.500  3897.500  4897.500
+ 9   / 5:  2997.500  3997.500  4997.500
+ ---- L:4 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2778.500  3778.500  4778.500
+ 7   / 4:  2878.500  3878.500  4878.500
+ 9   / 5:  2978.500  3978.500  4978.500
+ ---- K:4 Z:   7
+ 5   / 3:  2788.500  3788.500  4788.500
+ 7   / 4:  2888.500  3888.500  4888.500
+ 9   / 5:  2988.500  3988.500  4988.500
+ ---- K:5 Z:   9
+ 5   / 3:  2798.500  3798.500  4798.500
+ 7   / 4:  2898.500  3898.500  4898.500
+ 9   / 5:  2998.500  3998.500  4998.500
+ ---- L:5 T:   JAN-1980
+ ---- K:3 Z:   5
+ 5   / 3:  2779.500  3779.500  4779.500
+ 7   / 4:  2879.500  3879.500  4879.500
+ 9   / 5:  2979.500  3979.500  4979.500
+ ---- K:4 Z:   7
+ 5   / 3:  2789.500  3789.500  4789.500
+ 7   / 4:  2889.500  3889.500  4889.500
+ 9   / 5:  2989.500  3989.500  4989.500
+ ---- K:5 Z:   9
+ 5   / 3:  2799.500  3799.500  4799.500
+ 7   / 4:  2899.500  3899.500  4899.500
+ 9   / 5:  2999.500  3999.500  4999.500
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: JAN-1980 to JAN-1980
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT1     PSYT1     PSZW      TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 42 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88290  23.97420  24.14894  24.37499  24.62556
+ 25-JAN-1982 00 / 3:  23.88501  23.98344  24.16565  24.39832  24.65027
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.88380  23.97520  24.15006  24.37614  24.62650
+ 25-JAN-1982 00 / 3:  23.87741  23.97277  24.15346  24.38574  24.63814
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 43 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 34 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                        0         0.33N     0.67N     1N        1.33N   
+                         45        46        47        48        49
+ 20-JAN-1982 00 / 2:  23.75267  23.76377  23.87293  24.04456  24.25203
+ 25-JAN-1982 00 / 3:  23.74388  23.73211  23.81637  23.96577  24.15370
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M: 29 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 753  complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT1     PSYT1     PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 27 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 754  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 755  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 23 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 23 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 756  complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 26 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 757  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 36 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 758  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 759  complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 17 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 760  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 761  complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ found   TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+setting up plot
+PPL plot 762  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT2     TIME14    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 25 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 763  complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT2     TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 11 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 11 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 764  complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 18 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 765  complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+               158.5E    159.5E    160.5E  
+               139       140       141
+ 4.5S / 86:  29.51100  29.44300  29.38000
+ 5.5S / 85:  29.58900  29.52500  29.45700
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.51700
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000000
+ 23E   / 2:  2.000000
+ 25E   / 3:  3.000000
+ 27E   / 4:  4.000000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00000
+ 23E   / 2:  23.00000
+ 25E   / 3:  25.00000
+ 27E   / 4:  27.00000
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX020)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   3
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid GG2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is G
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G106)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX116)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME10    TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX116)                         use count:   1
+    AXIS (AX049)                         use count:  13
+    AXIS (AX047)                         use count:  13
+    AXIS (AX020)                         use count:   2
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX127)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_repl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+ 
+! ******** V6.5 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn65_bug_fixes
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.025S
+             Z (count): 1
+             TIME     : APR-2006
+                     0.03S  
+                      1
+ 179.972W  /  1:  27.49991
+ 179.922W  /  2:  27.47995
+ 179.872W  /  3:  27.46997
+ 179.822W  /  4:  27.46997
+ 179.772W  /  5:  27.44988
+ 179.722W  /  6:  27.42992
+ 179.672W  /  7:  27.42992
+ 179.622W  /  8:  27.42992
+ 179.572W  /  9:  27.44988
+ 179.522W  / 10:  27.45999
+ 179.472W  / 11:  27.46997
+ 179.422W  / 12:  27.45999
+ 179.372W  / 13:  27.46997
+ 179.322W  / 14:  27.47995
+ 179.272W  / 15:  27.48993
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.0
+ 16-OCT-1149 12 /  2:  419308.5
+ 16-NOV-1149 00 /  3:  419339.0
+ 16-DEC-1149 12 /  4:  419369.5
+ 16-JAN-1150 12 /  5:  419400.5
+ 15-FEB-1150 00 /  6:  419430.0
+ 16-MAR-1150 12 /  7:  419459.5
+ 16-APR-1150 00 /  8:  419490.0
+ 16-MAY-1150 12 /  9:  419520.5
+ 16-JUN-1150 00 / 10:  419551.0
+ 16-JUL-1150 12 / 11:  419581.5
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : FEB-1150 NOLEAP
+          419430.0
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_txtype_dmy
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+ 
+GO bn_reset
+cancel mode verify
+GO bn_n_open_dsets_sym
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_multi_decade
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+GO bn_reset
+cancel mode verify
+GO bn_show_xml_file
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+ 
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME3</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="TIME3">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+ 
+ 
+! GO bn_reset
+! GO bn_encode_url
+ 
+! ******** V6.6 Additions below ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn66_bug_fixes
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: AUG-1982 to JAN-1983 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: AUG-1982 to JAN-1983
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : AUG-1982 to JAN-1983 (XZT ave)
+ 3.5N  / 56:  27.59128
+ 3.17N / 55:  27.76072
+ 2.83N / 54:  27.89503
+ 2.5N  / 53:  28.00175
+ 2.17N / 52:  28.08330
+ 1.83N / 51:  28.13652
+ 1.5N  / 50:  28.15913
+ 1.17N / 49:  28.15796
+ 0.83N / 48:  28.14635
+ 0.5N  / 47:  28.13609
+ 0.17N / 46:  28.13627
+ 0.17S / 45:  28.15042
+ 0.5S  / 44:  28.17639
+ 0.83S / 43:  28.20504
+ 1.17S / 42:  28.22684
+ 1.5S  / 41:  28.23347
+ 1.83S / 40:  28.21657
+ 2.17S / 39:  28.16886
+ 2.5S  / 38:  28.08460
+ 2.83S / 37:  27.96112
+ 3.17S / 36:  27.80014
+ 3.5S  / 35:  27.60770
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: AUG-1982 to JAN-1983 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+ 
+GO bn_reset
+cancel mode verify
+GO bn_netcdf4
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G089)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G103)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.75 to 10.25
+             Y: 0.75 to 10.25
+             Z:  N/A
+             TIME: DEC-2009 to APR-2010
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : JAN-2010
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+ 
+! *********** v6.62 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_dir_symbols
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+AX_VERT = "Y"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+ 
+! *********** v6.63 Additions ***********
+ 
+GO bn_reset
+cancel mode verify
+GO bn663_bug_fixes
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_axis_regular
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.2563 to 10.74
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7437 to 10.26
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_set_cancel_redirect
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.861  "                                                         
+ 3    /  3:" ! Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14"                              
+ 4    /  4:" ! 26-Mar-14 15:37     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+ 
+GO bn_reset
+cancel mode verify
+GO bn_min_max_smoothers
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+ 
+auxiliary varible regridding transforms e.g.TEMP[GZ(depth)=zax at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @PLAVE      pc-wise linear ave
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: AUG-1982 to JAN-1983
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.667S to 3.667N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: AUG-1982
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vector_symbols
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+ 
+GO bn_reset
+cancel mode verify
+GO bn_variance_large
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: JAN
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+ 
+GO bn_reset
+cancel mode verify
+GO bn_labnum_calendar
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME12
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+ 
+ 
+! *********** v6.65 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn665_bug_fixes
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME13
+<axes>
+<axis name="TIME13">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME13</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME13
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_floatstr
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+ 
+! *********** v6.7 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn67_bug_fixes
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME13)               DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_NaN_note
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+ 
+! *********** v6.71 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn671_bug_fixes
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3662   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+ 
+! *********** v6.8 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn68_bug_fixes
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1.014
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX128)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G101)
+ name       axis              # pts   start                end
+ (AX120)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX128
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ifv
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_randu2_randn2
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+ 
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+ 
+can mode ver
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.784
+randu2_randn2       0.043
+randu2_randn2       0.635
+randu2_randn2       0.230
+randu2_randn2       0.359
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.333
+randu2_randn2       0.964
+randu2_randn2       0.686
+randu2_randn2       0.545
+randu2_randn2       0.931
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.227
+randu2_randn2       0.189
+randu2_randn2       0.115
+randu2_randn2       0.929
+randu2_randn2       0.823
+randu2_randn2       0.246
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.055
+randu2_randn2       0.504
+randu2_randn2       0.065
+randu2_randn2       0.168
+randu2_randn2       0.230
+randu2_randn2       0.900
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       1.084
+randu2_randn2       0.088
+randu2_randn2      -1.807
+randu2_randn2      -1.326
+randu2_randn2       0.638
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.364
+randu2_randn2       0.101
+randu2_randn2       1.394
+randu2_randn2       1.247
+randu2_randn2      -0.634
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -2.085
+randu2_randn2       0.109
+randu2_randn2       0.078
+randu2_randn2      -1.286
+randu2_randn2      -0.903
+randu2_randn2      -0.031
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.979
+randu2_randn2      -0.937
+randu2_randn2      -0.895
+randu2_randn2       0.456
+randu2_randn2       0.406
+randu2_randn2       0.199
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+randu2_randn2       1.276       1.276       0.849
+randu2_randn2       1.264       1.264       0.849
+randu2_randn2       0.849       0.849       0.214
+randu2_randn2       0.214       0.214       0.292
+randu2_randn2      -0.219      -0.219       0.292
+randu2_randn2      -0.456      -0.219       0.292
+randu2_randn2      -0.028      -0.028       0.292
+randu2_randn2       0.292       0.292       0.292
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_cf
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repeated_coords
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_xml_header
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME10</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME10">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+! Here's one where the dataset has a string variable
+ 
+can dat/all
+ 
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_numstring.jnl"
+use numstring
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out_string.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out_string.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out_string.xml" </data>
+ 
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
+<dimension>STRING1_7</dimension>
+<xaxis>XAX1_10</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+--
+<dimensions>
+<dimension name="STRING1_7">
+<attribute name="length" type="short">
+   <value>7</value>
+</attribute>
+</dimension>
+</dimensions>
+</data>
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1:  0.0000 -0.7071
+ 2   / 2: -0.7071  0.0000
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.000 -1.414
+ 0.25  /   2: -0.185 -1.402
+ 0.5   /   3: -0.366 -1.366
+ 0.75  /   4: -0.541 -1.307
+ 1     /   5: -0.707 -1.225
+ 1.25  /   6: -0.861 -1.122
+ 1.5   /   7: -1.000 -1.000
+ 1.75  /   8: -1.122 -0.861
+ 2     /   9: -1.225 -0.707
+ 2.25  /  10: -1.307 -0.541
+ 2.5   /  11: -1.366 -0.366
+ 2.75  /  12: -1.402 -0.185
+ 3     /  13: -1.414  0.000
+ 3.25  /  14: -1.402  0.185
+ 3.5   /  15: -1.366  0.366
+ 3.75  /  16: -1.307  0.541
+ 4     /  17: -1.225  0.707
+ 4.25  /  18: -1.122  0.861
+ 4.5   /  19: -1.000  1.000
+ 4.75  /  20: -0.861  1.122
+ 5     /  21: -0.707  1.225
+ 5.25  /  22: -0.541  1.307
+ 5.5   /  23: -0.366  1.366
+ 5.75  /  24: -0.185  1.402
+ 6     /  25:  0.000  1.414
+ 6.25  /  26:  0.185  1.402
+ 6.5   /  27:  0.366  1.366
+ 6.75  /  28:  0.541  1.307
+ 7     /  29:  0.707  1.225
+ 7.25  /  30:  0.861  1.122
+ 7.5   /  31:  1.000  1.000
+ 7.75  /  32:  1.122  0.861
+ 8     /  33:  1.225  0.707
+ 8.25  /  34:  1.307  0.541
+ 8.5   /  35:  1.366  0.366
+ 8.75  /  36:  1.402  0.185
+ 9     /  37:  1.414  0.000
+ 9.25  /  38:  1.402 -0.185
+ 9.5   /  39:  1.366 -0.366
+ 9.75  /  40:  1.307 -0.541
+ 10    /  41:  1.225 -0.707
+ 10.25 /  42:  1.122 -0.861
+ 10.5  /  43:  1.000 -1.000
+ 10.75 /  44:  0.861 -1.122
+ 11    /  45:  0.707 -1.225
+ 11.25 /  46:  0.541 -1.307
+ 11.5  /  47:  0.366 -1.366
+ 11.75 /  48:  0.185 -1.402
+ 12    /  49:  0.000 -1.414
+ 12.25 /  50: -0.185 -1.402
+ 12.5  /  51: -0.366 -1.366
+ 12.75 /  52: -0.541 -1.307
+ 13    /  53: -0.707 -1.225
+ 13.25 /  54: -0.861 -1.122
+ 13.5  /  55: -1.000 -1.000
+ 13.75 /  56: -1.122 -0.861
+ 14    /  57: -1.225 -0.707
+ 14.25 /  58: -1.307 -0.541
+ 14.5  /  59: -1.366 -0.366
+ 14.75 /  60: -1.402 -0.185
+ 15    /  61: -1.414  0.000
+ 15.25 /  62: -1.402  0.185
+ 15.5  /  63: -1.366  0.366
+ 15.75 /  64: -1.307  0.541
+ 16    /  65: -1.225  0.707
+ 16.25 /  66: -1.122  0.861
+ 16.5  /  67: -1.000  1.000
+ 16.75 /  68: -0.861  1.122
+ 17    /  69: -0.707  1.225
+ 17.25 /  70: -0.541  1.307
+ 17.5  /  71: -0.366  1.366
+ 17.75 /  72: -0.185  1.402
+ 18    /  73:  0.000  1.414
+ 18.25 /  74:  0.185  1.402
+ 18.5  /  75:  0.366  1.366
+ 18.75 /  76:  0.541  1.307
+ 19    /  77:  0.707  1.225
+ 19.25 /  78:  0.861  1.122
+ 19.5  /  79:  1.000  1.000
+ 19.75 /  80:  1.122  0.861
+ 20    /  81:  1.225  0.707
+ 20.25 /  82:  1.307  0.541
+ 20.5  /  83:  1.366  0.366
+ 20.75 /  84:  1.402  0.185
+ 21    /  85:  1.414  0.000
+ 21.25 /  86:  1.402 -0.185
+ 21.5  /  87:  1.366 -0.366
+ 21.75 /  88:  1.307 -0.541
+ 22    /  89:  1.225 -0.707
+ 22.25 /  90:  1.122 -0.861
+ 22.5  /  91:  1.000 -1.000
+ 22.75 /  92:  0.861 -1.122
+ 23    /  93:  0.707 -1.225
+ 23.25 /  94:  0.541 -1.307
+ 23.5  /  95:  0.366 -1.366
+ 23.75 /  96:  0.185 -1.402
+ 24    /  97:  0.000 -1.414
+ 24.25 /  98: -0.185 -1.402
+ 24.5  /  99: -0.366 -1.366
+ 24.75 / 100: -0.541 -1.307
+ 25    / 101: -0.707 -1.225
+ 25.25 / 102: -0.861 -1.122
+ 25.5  / 103: -1.000 -1.000
+ 25.75 / 104: -1.122 -0.861
+ 26    / 105: -1.225 -0.707
+ 26.25 / 106: -1.307 -0.541
+ 26.5  / 107: -1.366 -0.366
+ 26.75 / 108: -1.402 -0.185
+ 27    / 109: -1.414  0.000
+ 27.25 / 110: -1.402  0.185
+ 27.5  / 111: -1.366  0.366
+ 27.75 / 112: -1.307  0.541
+ 28    / 113: -1.225  0.707
+ 28.25 / 114: -1.122  0.861
+ 28.5  / 115: -1.000  1.000
+ 28.75 / 116: -0.861  1.122
+ 29    / 117: -0.707  1.225
+ 29.25 / 118: -0.541  1.307
+ 29.5  / 119: -0.366  1.366
+ 29.75 / 120: -0.185  1.402
+ 30    / 121:  0.000  1.414
+ 30.25 / 122:  0.185  1.402
+ 30.5  / 123:  0.366  1.366
+ 30.75 / 124:  0.541  1.307
+ 31    / 125:  0.707  1.225
+ 31.25 / 126:  0.861  1.122
+ 31.5  / 127:  1.000  1.000
+ 31.75 / 128:  1.122  0.861
+ 32    / 129:  1.225  0.707
+ 32.25 / 130:  1.307  0.541
+ 32.5  / 131:  1.366  0.366
+ 32.75 / 132:  1.402  0.185
+ 33    / 133:  1.414  0.000
+ 33.25 / 134:  1.402 -0.185
+ 33.5  / 135:  1.366 -0.366
+ 33.75 / 136:  1.307 -0.541
+ 34    / 137:  1.225 -0.707
+ 34.25 / 138:  1.122 -0.861
+ 34.5  / 139:  1.000 -1.000
+ 34.75 / 140:  0.861 -1.122
+ 35    / 141:  0.707 -1.225
+ 35.25 / 142:  0.541 -1.307
+ 35.5  / 143:  0.366 -1.366
+ 35.75 / 144:  0.185 -1.402
+ 36    / 145:  0.000 -1.414
+ 36.25 / 146: -0.185 -1.402
+ 36.5  / 147: -0.366 -1.366
+ 36.75 / 148: -0.541 -1.307
+ 37    / 149: -0.707 -1.225
+ 37.25 / 150: -0.861 -1.122
+ 37.5  / 151: -1.000 -1.000
+ 37.75 / 152: -1.122 -0.861
+ 38    / 153: -1.225 -0.707
+ 38.25 / 154: -1.307 -0.541
+ 38.5  / 155: -1.366 -0.366
+ 38.75 / 156: -1.402 -0.185
+ 39    / 157: -1.414  0.000
+ 39.25 / 158: -1.402  0.185
+ 39.5  / 159: -1.366  0.366
+ 39.75 / 160: -1.307  0.541
+ 40    / 161: -1.225  0.707
+ 40.25 / 162: -1.122  0.861
+ 40.5  / 163: -1.000  1.000
+ 40.75 / 164: -0.861  1.122
+ 41    / 165: -0.707  1.225
+ 41.25 / 166: -0.541  1.307
+ 41.5  / 167: -0.366  1.366
+ 41.75 / 168: -0.185  1.402
+ 42    / 169:  0.000  1.414
+ 42.25 / 170:  0.185  1.402
+ 42.5  / 171:  0.366  1.366
+ 42.75 / 172:  0.541  1.307
+ 43    / 173:  0.707  1.225
+ 43.25 / 174:  0.861  1.122
+ 43.5  / 175:  1.000  1.000
+ 43.75 / 176:  1.122  0.861
+ 44    / 177:  1.225  0.707
+ 44.25 / 178:  1.307  0.541
+ 44.5  / 179:  1.366  0.366
+ 44.75 / 180:  1.402  0.185
+ 45    / 181:  1.414  0.000
+ 45.25 / 182:  1.402 -0.185
+ 45.5  / 183:  1.366 -0.366
+ 45.75 / 184:  1.307 -0.541
+ 46    / 185:  1.225 -0.707
+ 46.25 / 186:  1.122 -0.861
+ 46.5  / 187:  1.000 -1.000
+ 46.75 / 188:  0.861 -1.122
+ 47    / 189:  0.707 -1.225
+ 47.25 / 190:  0.541 -1.307
+ 47.5  / 191:  0.366 -1.366
+ 47.75 / 192:  0.185 -1.402
+ 48    / 193:  0.000 -1.414
+ 48.25 / 194: -0.185 -1.402
+ 48.5  / 195: -0.366 -1.366
+ 48.75 / 196: -0.541 -1.307
+ 49    / 197: -0.707 -1.225
+ 49.25 / 198: -0.861 -1.122
+ 49.5  / 199: -1.000 -1.000
+ 49.75 / 200: -1.122 -0.861
+ 50    / 201: -1.225 -0.707
+ 50.25 / 202: -1.307 -0.541
+ 50.5  / 203: -1.366 -0.366
+ 50.75 / 204: -1.402 -0.185
+ 51    / 205: -1.414  0.000
+ 51.25 / 206: -1.402  0.185
+ 51.5  / 207: -1.366  0.366
+ 51.75 / 208: -1.307  0.541
+ 52    / 209: -1.225  0.707
+ 52.25 / 210: -1.122  0.861
+ 52.5  / 211: -1.000  1.000
+ 52.75 / 212: -0.861  1.122
+ 53    / 213: -0.707  1.225
+ 53.25 / 214: -0.541  1.307
+ 53.5  / 215: -0.366  1.366
+ 53.75 / 216: -0.185  1.402
+ 54    / 217:  0.000  1.414
+ 54.25 / 218:  0.185  1.402
+ 54.5  / 219:  0.366  1.366
+ 54.75 / 220:  0.541  1.307
+ 55    / 221:  0.707  1.225
+ 55.25 / 222:  0.861  1.122
+ 55.5  / 223:  1.000  1.000
+ 55.75 / 224:  1.122  0.861
+ 56    / 225:  1.225  0.707
+ 56.25 / 226:  1.307  0.541
+ 56.5  / 227:  1.366  0.366
+ 56.75 / 228:  1.402  0.185
+ 57    / 229:  1.414  0.000
+ 57.25 / 230:  1.402 -0.185
+ 57.5  / 231:  1.366 -0.366
+ 57.75 / 232:  1.307 -0.541
+ 58    / 233:  1.225 -0.707
+ 58.25 / 234:  1.122 -0.861
+ 58.5  / 235:  1.000 -1.000
+ 58.75 / 236:  0.861 -1.122
+ 59    / 237:  0.707 -1.225
+ 59.25 / 238:  0.541 -1.307
+ 59.5  / 239:  0.366 -1.366
+ 59.75 / 240:  0.185 -1.402
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0000 -0.7071    ....
+ 2   / 2: -0.7071  0.0000    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1:  0.000 -1.414   ....
+ 0.25  /   2: -0.185 -1.402   ....
+ 0.5   /   3: -0.366 -1.366   ....
+ 0.75  /   4: -0.541 -1.307   ....
+ 1     /   5: -0.707 -1.225   ....
+ 1.25  /   6: -0.861 -1.122   ....
+ 1.5   /   7: -1.000 -1.000   ....
+ 1.75  /   8: -1.122 -0.861   ....
+ 2     /   9: -1.225 -0.707   ....
+ 2.25  /  10: -1.307 -0.541   ....
+ 2.5   /  11: -1.366 -0.366   ....
+ 2.75  /  12: -1.402 -0.185   ....
+ 3     /  13: -1.414  0.000   ....
+ 3.25  /  14: -1.402  0.185   ....
+ 3.5   /  15: -1.366  0.366   ....
+ 3.75  /  16: -1.307  0.541   ....
+ 4     /  17: -1.225  0.707   ....
+ 4.25  /  18: -1.122  0.861   ....
+ 4.5   /  19: -1.000  1.000   ....
+ 4.75  /  20: -0.861  1.122   ....
+ 5     /  21: -0.707  1.225   ....
+ 5.25  /  22: -0.541  1.307   ....
+ 5.5   /  23: -0.366  1.366   ....
+ 5.75  /  24: -0.185  1.402   ....
+ 6     /  25:  0.000  1.414   ....
+ 6.25  /  26:  0.185  1.402   ....
+ 6.5   /  27:  0.366  1.366   ....
+ 6.75  /  28:  0.541  1.307   ....
+ 7     /  29:  0.707  1.225   ....
+ 7.25  /  30:  0.861  1.122   ....
+ 7.5   /  31:  1.000  1.000   ....
+ 7.75  /  32:  1.122  0.861   ....
+ 8     /  33:  1.225  0.707   ....
+ 8.25  /  34:  1.307  0.541   ....
+ 8.5   /  35:  1.366  0.366   ....
+ 8.75  /  36:  1.402  0.185   ....
+ 9     /  37:  1.414  0.000   ....
+ 9.25  /  38:  1.402 -0.185   ....
+ 9.5   /  39:  1.366 -0.366   ....
+ 9.75  /  40:  1.307 -0.541   ....
+ 10    /  41:  1.225 -0.707   ....
+ 10.25 /  42:  1.122 -0.861   ....
+ 10.5  /  43:  1.000 -1.000   ....
+ 10.75 /  44:  0.861 -1.122   ....
+ 11    /  45:  0.707 -1.225   ....
+ 11.25 /  46:  0.541 -1.307   ....
+ 11.5  /  47:  0.366 -1.366   ....
+ 11.75 /  48:  0.185 -1.402   ....
+ 12    /  49:  0.000 -1.414   ....
+ 12.25 /  50: -0.185 -1.402   ....
+ 12.5  /  51: -0.366 -1.366   ....
+ 12.75 /  52: -0.541 -1.307   ....
+ 13    /  53: -0.707 -1.225   ....
+ 13.25 /  54: -0.861 -1.122   ....
+ 13.5  /  55: -1.000 -1.000   ....
+ 13.75 /  56: -1.122 -0.861   ....
+ 14    /  57: -1.225 -0.707   ....
+ 14.25 /  58: -1.307 -0.541   ....
+ 14.5  /  59: -1.366 -0.366   ....
+ 14.75 /  60: -1.402 -0.185   ....
+ 15    /  61: -1.414  0.000   ....
+ 15.25 /  62: -1.402  0.185   ....
+ 15.5  /  63: -1.366  0.366   ....
+ 15.75 /  64: -1.307  0.541   ....
+ 16    /  65: -1.225  0.707   ....
+ 16.25 /  66: -1.122  0.861   ....
+ 16.5  /  67: -1.000  1.000   ....
+ 16.75 /  68: -0.861  1.122   ....
+ 17    /  69: -0.707  1.225   ....
+ 17.25 /  70: -0.541  1.307   ....
+ 17.5  /  71: -0.366  1.366   ....
+ 17.75 /  72: -0.185  1.402   ....
+ 18    /  73:  0.000  1.414   ....
+ 18.25 /  74:  0.185  1.402   ....
+ 18.5  /  75:  0.366  1.366   ....
+ 18.75 /  76:  0.541  1.307   ....
+ 19    /  77:  0.707  1.225   ....
+ 19.25 /  78:  0.861  1.122   ....
+ 19.5  /  79:  1.000  1.000   ....
+ 19.75 /  80:  1.122  0.861   ....
+ 20    /  81:  1.225  0.707   ....
+ 20.25 /  82:  1.307  0.541   ....
+ 20.5  /  83:  1.366  0.366   ....
+ 20.75 /  84:  1.402  0.185   ....
+ 21    /  85:  1.414  0.000   ....
+ 21.25 /  86:  1.402 -0.185   ....
+ 21.5  /  87:  1.366 -0.366   ....
+ 21.75 /  88:  1.307 -0.541   ....
+ 22    /  89:  1.225 -0.707   ....
+ 22.25 /  90:  1.122 -0.861   ....
+ 22.5  /  91:  1.000 -1.000   ....
+ 22.75 /  92:  0.861 -1.122   ....
+ 23    /  93:  0.707 -1.225   ....
+ 23.25 /  94:  0.541 -1.307   ....
+ 23.5  /  95:  0.366 -1.366   ....
+ 23.75 /  96:  0.185 -1.402   ....
+ 24    /  97:  0.000 -1.414   ....
+ 24.25 /  98: -0.185 -1.402   ....
+ 24.5  /  99: -0.366 -1.366   ....
+ 24.75 / 100: -0.541 -1.307   ....
+ 25    / 101: -0.707 -1.225   ....
+ 25.25 / 102: -0.861 -1.122   ....
+ 25.5  / 103: -1.000 -1.000   ....
+ 25.75 / 104: -1.122 -0.861   ....
+ 26    / 105: -1.225 -0.707   ....
+ 26.25 / 106: -1.307 -0.541   ....
+ 26.5  / 107: -1.366 -0.366   ....
+ 26.75 / 108: -1.402 -0.185   ....
+ 27    / 109: -1.414  0.000   ....
+ 27.25 / 110: -1.402  0.185   ....
+ 27.5  / 111: -1.366  0.366   ....
+ 27.75 / 112: -1.307  0.541   ....
+ 28    / 113: -1.225  0.707   ....
+ 28.25 / 114: -1.122  0.861   ....
+ 28.5  / 115: -1.000  1.000   ....
+ 28.75 / 116: -0.861  1.122   ....
+ 29    / 117: -0.707  1.225   ....
+ 29.25 / 118: -0.541  1.307   ....
+ 29.5  / 119: -0.366  1.366   ....
+ 29.75 / 120: -0.185  1.402   ....
+ 30    / 121:  0.000  1.414   ....
+ 30.25 / 122:  0.185  1.402   ....
+ 30.5  / 123:  0.366  1.366   ....
+ 30.75 / 124:  0.541  1.307   ....
+ 31    / 125:  0.707  1.225   ....
+ 31.25 / 126:  0.861  1.122   ....
+ 31.5  / 127:  1.000  1.000   ....
+ 31.75 / 128:  1.122  0.861   ....
+ 32    / 129:  1.225  0.707   ....
+ 32.25 / 130:  1.307  0.541   ....
+ 32.5  / 131:  1.366  0.366   ....
+ 32.75 / 132:  1.402  0.185   ....
+ 33    / 133:  1.414  0.000   ....
+ 33.25 / 134:  1.402 -0.185   ....
+ 33.5  / 135:  1.366 -0.366   ....
+ 33.75 / 136:  1.307 -0.541   ....
+ 34    / 137:  1.225 -0.707   ....
+ 34.25 / 138:  1.122 -0.861   ....
+ 34.5  / 139:  1.000 -1.000   ....
+ 34.75 / 140:  0.861 -1.122   ....
+ 35    / 141:  0.707 -1.225   ....
+ 35.25 / 142:  0.541 -1.307   ....
+ 35.5  / 143:  0.366 -1.366   ....
+ 35.75 / 144:  0.185 -1.402   ....
+ 36    / 145:  0.000 -1.414   ....
+ 36.25 / 146: -0.185 -1.402   ....
+ 36.5  / 147: -0.366 -1.366   ....
+ 36.75 / 148: -0.541 -1.307   ....
+ 37    / 149: -0.707 -1.225   ....
+ 37.25 / 150: -0.861 -1.122   ....
+ 37.5  / 151: -1.000 -1.000   ....
+ 37.75 / 152: -1.122 -0.861   ....
+ 38    / 153: -1.225 -0.707   ....
+ 38.25 / 154: -1.307 -0.541   ....
+ 38.5  / 155: -1.366 -0.366   ....
+ 38.75 / 156: -1.402 -0.185   ....
+ 39    / 157: -1.414  0.000   ....
+ 39.25 / 158: -1.402  0.185   ....
+ 39.5  / 159: -1.366  0.366   ....
+ 39.75 / 160: -1.307  0.541   ....
+ 40    / 161: -1.225  0.707   ....
+ 40.25 / 162: -1.122  0.861   ....
+ 40.5  / 163: -1.000  1.000   ....
+ 40.75 / 164: -0.861  1.122   ....
+ 41    / 165: -0.707  1.225   ....
+ 41.25 / 166: -0.541  1.307   ....
+ 41.5  / 167: -0.366  1.366   ....
+ 41.75 / 168: -0.185  1.402   ....
+ 42    / 169:  0.000  1.414   ....
+ 42.25 / 170:  0.185  1.402   ....
+ 42.5  / 171:  0.366  1.366   ....
+ 42.75 / 172:  0.541  1.307   ....
+ 43    / 173:  0.707  1.225   ....
+ 43.25 / 174:  0.861  1.122   ....
+ 43.5  / 175:  1.000  1.000   ....
+ 43.75 / 176:  1.122  0.861   ....
+ 44    / 177:  1.225  0.707   ....
+ 44.25 / 178:  1.307  0.541   ....
+ 44.5  / 179:  1.366  0.366   ....
+ 44.75 / 180:  1.402  0.185   ....
+ 45    / 181:  1.414  0.000   ....
+ 45.25 / 182:  1.402 -0.185   ....
+ 45.5  / 183:  1.366 -0.366   ....
+ 45.75 / 184:  1.307 -0.541   ....
+ 46    / 185:  1.225 -0.707   ....
+ 46.25 / 186:  1.122 -0.861   ....
+ 46.5  / 187:  1.000 -1.000   ....
+ 46.75 / 188:  0.861 -1.122   ....
+ 47    / 189:  0.707 -1.225   ....
+ 47.25 / 190:  0.541 -1.307   ....
+ 47.5  / 191:  0.366 -1.366   ....
+ 47.75 / 192:  0.185 -1.402   ....
+ 48    / 193:  0.000 -1.414   ....
+ 48.25 / 194: -0.185 -1.402   ....
+ 48.5  / 195: -0.366 -1.366   ....
+ 48.75 / 196: -0.541 -1.307   ....
+ 49    / 197: -0.707 -1.225   ....
+ 49.25 / 198: -0.861 -1.122   ....
+ 49.5  / 199: -1.000 -1.000   ....
+ 49.75 / 200: -1.122 -0.861   ....
+ 50    / 201: -1.225 -0.707   ....
+ 50.25 / 202: -1.307 -0.541   ....
+ 50.5  / 203: -1.366 -0.366   ....
+ 50.75 / 204: -1.402 -0.185   ....
+ 51    / 205: -1.414  0.000   ....
+ 51.25 / 206: -1.402  0.185   ....
+ 51.5  / 207: -1.366  0.366   ....
+ 51.75 / 208: -1.307  0.541   ....
+ 52    / 209: -1.225  0.707   ....
+ 52.25 / 210: -1.122  0.861   ....
+ 52.5  / 211: -1.000  1.000   ....
+ 52.75 / 212: -0.861  1.122   ....
+ 53    / 213: -0.707  1.225   ....
+ 53.25 / 214: -0.541  1.307   ....
+ 53.5  / 215: -0.366  1.366   ....
+ 53.75 / 216: -0.185  1.402   ....
+ 54    / 217:  0.000  1.414   ....
+ 54.25 / 218:  0.185  1.402   ....
+ 54.5  / 219:  0.366  1.366   ....
+ 54.75 / 220:  0.541  1.307   ....
+ 55    / 221:  0.707  1.225   ....
+ 55.25 / 222:  0.861  1.122   ....
+ 55.5  / 223:  1.000  1.000   ....
+ 55.75 / 224:  1.122  0.861   ....
+ 56    / 225:  1.225  0.707   ....
+ 56.25 / 226:  1.307  0.541   ....
+ 56.5  / 227:  1.366  0.366   ....
+ 56.75 / 228:  1.402  0.185   ....
+ 57    / 229:  1.414  0.000   ....
+ 57.25 / 230:  1.402 -0.185   ....
+ 57.5  / 231:  1.366 -0.366   ....
+ 57.75 / 232:  1.307 -0.541   ....
+ 58    / 233:  1.225 -0.707   ....
+ 58.25 / 234:  1.122 -0.861   ....
+ 58.5  / 235:  1.000 -1.000   ....
+ 58.75 / 236:  0.861 -1.122   ....
+ 59    / 237:  0.707 -1.225   ....
+ 59.25 / 238:  0.541 -1.307   ....
+ 59.5  / 239:  0.366 -1.366   ....
+ 59.75 / 240:  0.185 -1.402   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO bn_eof_simple2
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1:  0.0635 -0.3478
+ 2   / 2: -0.3478 -0.0635
+ ---- L:2 T:   2
+ 1   / 1:  0.3478  0.0635
+ 2   / 2:  0.0635 -0.3478
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.254  1.391
+ 0.1   /   2:  0.107  1.410
+ 0.2   /   3: -0.041  1.414
+ 0.3   /   4: -0.188  1.402
+ 0.4   /   5: -0.334  1.374
+ 0.5   /   6: -0.476  1.332
+ 0.6   /   7: -0.612  1.275
+ 0.7   /   8: -0.742  1.204
+ 0.8   /   9: -0.864  1.120
+ 0.9   /  10: -0.976  1.023
+ 1     /  11: -1.078  0.916
+ 1.1   /  12: -1.168  0.798
+ 1.2   /  13: -1.245  0.672
+ 1.3   /  14: -1.308  0.538
+ 1.4   /  15: -1.357  0.398
+ 1.5   /  16: -1.391  0.254
+ 1.6   /  17: -1.410  0.107
+ 1.7   /  18: -1.414 -0.041
+ 1.8   /  19: -1.402 -0.188
+ 1.9   /  20: -1.374 -0.334
+ 2     /  21: -1.332 -0.476
+ 2.1   /  22: -1.275 -0.612
+ 2.2   /  23: -1.204 -0.742
+ 2.3   /  24: -1.120 -0.864
+ 2.4   /  25: -1.023 -0.976
+ 2.5   /  26: -0.916 -1.078
+ 2.6   /  27: -0.798 -1.168
+ 2.7   /  28: -0.672 -1.245
+ 2.8   /  29: -0.538 -1.308
+ 2.9   /  30: -0.398 -1.357
+ 3     /  31: -0.254 -1.391
+ 3.1   /  32: -0.107 -1.410
+ 3.2   /  33:  0.041 -1.414
+ 3.3   /  34:  0.188 -1.402
+ 3.4   /  35:  0.334 -1.374
+ 3.5   /  36:  0.476 -1.332
+ 3.6   /  37:  0.612 -1.275
+ 3.7   /  38:  0.742 -1.204
+ 3.8   /  39:  0.864 -1.120
+ 3.9   /  40:  0.976 -1.023
+ 4     /  41:  1.078 -0.916
+ 4.1   /  42:  1.168 -0.798
+ 4.2   /  43:  1.245 -0.672
+ 4.3   /  44:  1.308 -0.538
+ 4.4   /  45:  1.357 -0.398
+ 4.5   /  46:  1.391 -0.254
+ 4.6   /  47:  1.410 -0.107
+ 4.7   /  48:  1.414  0.041
+ 4.8   /  49:  1.402  0.188
+ 4.9   /  50:  1.374  0.334
+ 5     /  51:  1.332  0.476
+ 5.1   /  52:  1.275  0.612
+ 5.2   /  53:  1.204  0.742
+ 5.3   /  54:  1.120  0.864
+ 5.4   /  55:  1.023  0.976
+ 5.5   /  56:  0.916  1.078
+ 5.6   /  57:  0.798  1.168
+ 5.7   /  58:  0.672  1.245
+ 5.8   /  59:  0.538  1.308
+ 5.9   /  60:  0.398  1.357
+ 6     /  61:  0.254  1.391
+ 6.1   /  62:  0.107  1.410
+ 6.2   /  63: -0.041  1.414
+ 6.3   /  64: -0.188  1.402
+ 6.4   /  65: -0.334  1.374
+ 6.5   /  66: -0.476  1.332
+ 6.6   /  67: -0.612  1.275
+ 6.7   /  68: -0.742  1.204
+ 6.8   /  69: -0.864  1.120
+ 6.9   /  70: -0.976  1.023
+ 7     /  71: -1.078  0.916
+ 7.1   /  72: -1.168  0.798
+ 7.2   /  73: -1.245  0.672
+ 7.3   /  74: -1.308  0.538
+ 7.4   /  75: -1.357  0.398
+ 7.5   /  76: -1.391  0.254
+ 7.6   /  77: -1.410  0.107
+ 7.7   /  78: -1.414 -0.041
+ 7.8   /  79: -1.402 -0.188
+ 7.9   /  80: -1.374 -0.334
+ 8     /  81: -1.332 -0.476
+ 8.1   /  82: -1.275 -0.612
+ 8.2   /  83: -1.204 -0.742
+ 8.3   /  84: -1.120 -0.864
+ 8.4   /  85: -1.023 -0.976
+ 8.5   /  86: -0.916 -1.078
+ 8.6   /  87: -0.798 -1.168
+ 8.7   /  88: -0.672 -1.245
+ 8.8   /  89: -0.538 -1.308
+ 8.9   /  90: -0.398 -1.357
+ 9     /  91: -0.254 -1.391
+ 9.1   /  92: -0.107 -1.410
+ 9.2   /  93:  0.041 -1.414
+ 9.3   /  94:  0.188 -1.402
+ 9.4   /  95:  0.334 -1.374
+ 9.5   /  96:  0.476 -1.332
+ 9.6   /  97:  0.612 -1.275
+ 9.7   /  98:  0.742 -1.204
+ 9.8   /  99:  0.864 -1.120
+ 9.9   / 100:  0.976 -1.023
+ 10    / 101:  1.078 -0.916
+ 10.1  / 102:  1.168 -0.798
+ 10.2  / 103:  1.245 -0.672
+ 10.3  / 104:  1.308 -0.538
+ 10.4  / 105:  1.357 -0.398
+ 10.5  / 106:  1.391 -0.254
+ 10.6  / 107:  1.410 -0.107
+ 10.7  / 108:  1.414  0.041
+ 10.8  / 109:  1.402  0.188
+ 10.9  / 110:  1.374  0.334
+ 11    / 111:  1.332  0.476
+ 11.1  / 112:  1.275  0.612
+ 11.2  / 113:  1.204  0.742
+ 11.3  / 114:  1.120  0.864
+ 11.4  / 115:  1.023  0.976
+ 11.5  / 116:  0.916  1.078
+ 11.6  / 117:  0.798  1.168
+ 11.7  / 118:  0.672  1.245
+ 11.8  / 119:  0.538  1.308
+ 11.9  / 120:  0.398  1.357
+ 12    / 121:  0.254  1.391
+ 12.1  / 122:  0.107  1.410
+ 12.2  / 123: -0.041  1.414
+ 12.3  / 124: -0.188  1.402
+ 12.4  / 125: -0.334  1.374
+ 12.5  / 126: -0.476  1.332
+ 12.6  / 127: -0.612  1.275
+ 12.7  / 128: -0.742  1.204
+ 12.8  / 129: -0.864  1.120
+ 12.9  / 130: -0.976  1.023
+ 13    / 131: -1.078  0.916
+ 13.1  / 132: -1.168  0.798
+ 13.2  / 133: -1.245  0.672
+ 13.3  / 134: -1.308  0.538
+ 13.4  / 135: -1.357  0.398
+ 13.5  / 136: -1.391  0.254
+ 13.6  / 137: -1.410  0.107
+ 13.7  / 138: -1.414 -0.041
+ 13.8  / 139: -1.402 -0.188
+ 13.9  / 140: -1.374 -0.334
+ 14    / 141: -1.332 -0.476
+ 14.1  / 142: -1.275 -0.612
+ 14.2  / 143: -1.204 -0.742
+ 14.3  / 144: -1.120 -0.864
+ 14.4  / 145: -1.023 -0.976
+ 14.5  / 146: -0.916 -1.078
+ 14.6  / 147: -0.798 -1.168
+ 14.7  / 148: -0.672 -1.245
+ 14.8  / 149: -0.538 -1.308
+ 14.9  / 150: -0.398 -1.357
+ 15    / 151: -0.254 -1.391
+ 15.1  / 152: -0.107 -1.410
+ 15.2  / 153:  0.041 -1.414
+ 15.3  / 154:  0.188 -1.402
+ 15.4  / 155:  0.334 -1.374
+ 15.5  / 156:  0.476 -1.332
+ 15.6  / 157:  0.612 -1.275
+ 15.7  / 158:  0.742 -1.204
+ 15.8  / 159:  0.864 -1.120
+ 15.9  / 160:  0.976 -1.023
+ 16    / 161:  1.078 -0.916
+ 16.1  / 162:  1.168 -0.798
+ 16.2  / 163:  1.245 -0.672
+ 16.3  / 164:  1.308 -0.538
+ 16.4  / 165:  1.357 -0.398
+ 16.5  / 166:  1.391 -0.254
+ 16.6  / 167:  1.410 -0.107
+ 16.7  / 168:  1.414  0.041
+ 16.8  / 169:  1.402  0.188
+ 16.9  / 170:  1.374  0.334
+ 17    / 171:  1.332  0.476
+ 17.1  / 172:  1.275  0.612
+ 17.2  / 173:  1.204  0.742
+ 17.3  / 174:  1.120  0.864
+ 17.4  / 175:  1.023  0.976
+ 17.5  / 176:  0.916  1.078
+ 17.6  / 177:  0.798  1.168
+ 17.7  / 178:  0.672  1.245
+ 17.8  / 179:  0.538  1.308
+ 17.9  / 180:  0.398  1.357
+ 18    / 181:  0.254  1.391
+ 18.1  / 182:  0.107  1.410
+ 18.2  / 183: -0.041  1.414
+ 18.3  / 184: -0.188  1.402
+ 18.4  / 185: -0.334  1.374
+ 18.5  / 186: -0.476  1.332
+ 18.6  / 187: -0.612  1.275
+ 18.7  / 188: -0.742  1.204
+ 18.8  / 189: -0.864  1.120
+ 18.9  / 190: -0.976  1.023
+ 19    / 191: -1.078  0.916
+ 19.1  / 192: -1.168  0.798
+ 19.2  / 193: -1.245  0.672
+ 19.3  / 194: -1.308  0.538
+ 19.4  / 195: -1.357  0.398
+ 19.5  / 196: -1.391  0.254
+ 19.6  / 197: -1.410  0.107
+ 19.7  / 198: -1.414 -0.041
+ 19.8  / 199: -1.402 -0.188
+ 19.9  / 200: -1.374 -0.334
+ 20    / 201: -1.332 -0.476
+ 20.1  / 202: -1.275 -0.612
+ 20.2  / 203: -1.204 -0.742
+ 20.3  / 204: -1.120 -0.864
+ 20.4  / 205: -1.023 -0.976
+ 20.5  / 206: -0.916 -1.078
+ 20.6  / 207: -0.798 -1.168
+ 20.7  / 208: -0.672 -1.245
+ 20.8  / 209: -0.538 -1.308
+ 20.9  / 210: -0.398 -1.357
+ 21    / 211: -0.254 -1.391
+ 21.1  / 212: -0.107 -1.410
+ 21.2  / 213:  0.041 -1.414
+ 21.3  / 214:  0.188 -1.402
+ 21.4  / 215:  0.334 -1.374
+ 21.5  / 216:  0.476 -1.332
+ 21.6  / 217:  0.612 -1.275
+ 21.7  / 218:  0.742 -1.204
+ 21.8  / 219:  0.864 -1.120
+ 21.9  / 220:  0.976 -1.023
+ 22    / 221:  1.078 -0.916
+ 22.1  / 222:  1.168 -0.798
+ 22.2  / 223:  1.245 -0.672
+ 22.3  / 224:  1.308 -0.538
+ 22.4  / 225:  1.357 -0.398
+ 22.5  / 226:  1.391 -0.254
+ 22.6  / 227:  1.410 -0.107
+ 22.7  / 228:  1.414  0.041
+ 22.8  / 229:  1.402  0.188
+ 22.9  / 230:  1.374  0.334
+ 23    / 231:  1.332  0.476
+ 23.1  / 232:  1.275  0.612
+ 23.2  / 233:  1.204  0.742
+ 23.3  / 234:  1.120  0.864
+ 23.4  / 235:  1.023  0.976
+ 23.5  / 236:  0.916  1.078
+ 23.6  / 237:  0.798  1.168
+ 23.7  / 238:  0.672  1.245
+ 23.8  / 239:  0.538  1.308
+ 23.9  / 240:  0.398  1.357
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+ 
+! 6D tests for Ferret v6.8
+ 
+GO bn_reset
+cancel mode verify
+GO bn_interpolate_6d
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_6d
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              4        6        8     
+              2        3        4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.00  3222.00  4222.00
+ 6   / 3:  2322.00  3322.00  4322.00
+ 8   / 4:  2422.00  3422.00  4422.00
+ ---- M:3 E:   6
+ 4   / 2:  2232.00  3232.00  4232.00
+ 6   / 3:  2332.00  3332.00  4332.00
+ 8   / 4:  2432.00  3432.00  4432.00
+ ---- M:4 E:   8
+ 4   / 2:  2242.00  3242.00  4242.00
+ 6   / 3:  2342.00  3342.00  4342.00
+ 8   / 4:  2442.00  3442.00  4442.00
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.00  3223.00  4223.00
+ 6   / 3:  2323.00  3323.00  4323.00
+ 8   / 4:  2423.00  3423.00  4423.00
+ ---- M:3 E:   6
+ 4   / 2:  2233.00  3233.00  4233.00
+ 6   / 3:  2333.00  3333.00  4333.00
+ 8   / 4:  2433.00  3433.00  4433.00
+ ---- M:4 E:   8
+ 4   / 2:  2243.00  3243.00  4243.00
+ 6   / 3:  2343.00  3343.00  4343.00
+ 8   / 4:  2443.00  3443.00  4443.00
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.00  3224.00  4224.00
+ 6   / 3:  2324.00  3324.00  4324.00
+ 8   / 4:  2424.00  3424.00  4424.00
+ ---- M:3 E:   6
+ 4   / 2:  2234.00  3234.00  4234.00
+ 6   / 3:  2334.00  3334.00  4334.00
+ 8   / 4:  2434.00  3434.00  4434.00
+ ---- M:4 E:   8
+ 4   / 2:  2244.00  3244.00  4244.00
+ 6   / 3:  2344.00  3344.00  4344.00
+ 8   / 4:  2444.00  3444.00  4444.00
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+              5        7        9     
+              3        4        5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2777.50  3777.50  4777.50
+ 7   / 4:  2877.50  3877.50  4877.50
+ 9   / 5:  2977.50  3977.50  4977.50
+ ---- M:4 E:   7
+ 5   / 3:  2787.50  3787.50  4787.50
+ 7   / 4:  2887.50  3887.50  4887.50
+ 9   / 5:  2987.50  3987.50  4987.50
+ ---- M:5 E:   9
+ 5   / 3:  2797.50  3797.50  4797.50
+ 7   / 4:  2897.50  3897.50  4897.50
+ 9   / 5:  2997.50  3997.50  4997.50
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.50  3778.50  4778.50
+ 7   / 4:  2878.50  3878.50  4878.50
+ 9   / 5:  2978.50  3978.50  4978.50
+ ---- M:4 E:   7
+ 5   / 3:  2788.50  3788.50  4788.50
+ 7   / 4:  2888.50  3888.50  4888.50
+ 9   / 5:  2988.50  3988.50  4988.50
+ ---- M:5 E:   9
+ 5   / 3:  2798.50  3798.50  4798.50
+ 7   / 4:  2898.50  3898.50  4898.50
+ 9   / 5:  2998.50  3998.50  4998.50
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.50  3779.50  4779.50
+ 7   / 4:  2879.50  3879.50  4879.50
+ 9   / 5:  2979.50  3979.50  4979.50
+ ---- M:4 E:   7
+ 5   / 3:  2789.50  3789.50  4789.50
+ 7   / 4:  2889.50  3889.50  4889.50
+ 9   / 5:  2989.50  3989.50  4989.50
+ ---- M:5 E:   9
+ 5   / 3:  2799.50  3799.50  4799.50
+ 7   / 4:  2899.50  3899.50  4899.50
+ 9   / 5:  2999.50  3999.50  4999.50
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+              25.5     35.5     45.5     55.5     65.5     75.5   
+               3        4        5        6        7        8
+ 25.5 / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+ 35.5 / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 45.5 / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 55.5 / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 65.5 / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 75.5 / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     101.000  101.000
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+               25.5E    35.5E    45.5E    55.5E    65.5E    75.5E  
+                3        4        5        6        7        8
+ 75.5N / 8:  101.000  111.000  121.000  131.000  141.000  151.000
+ 65.5N / 7:   91.000  101.000  111.000  121.000  131.000  141.000
+ 55.5N / 6:   81.000   91.000  101.000  111.000  121.000  131.000
+ 45.5N / 5:   71.000   81.000   91.000  101.000  111.000  121.000
+ 35.5N / 4:   61.000   71.000   81.000   91.000  101.000  111.000
+ 25.5N / 3:   51.000   61.000   71.000   81.000   91.000  101.000
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+          VCOARSE    VFINE
+I / *:     94.7056  94.5308
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 02-JAN-1980 00 / 2:  87672.0
+ 03-JAN-1980 00 / 3:  87696.0
+ 04-JAN-1980 00 / 4:  87720.0
+ 05-JAN-1980 00 / 5:  87744.0
+ 06-JAN-1980 00 / 6:  87768.0
+ 07-JAN-1980 00 / 7:  87792.0
+ 08-JAN-1980 00 / 8:  87816.0
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.0
+ 03-JAN-1980 00 / 2:  87696.0
+ 05-JAN-1980 00 / 3:  87744.0
+ 07-JAN-1980 00 / 4:  87792.0
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_syntax_6d
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid G48
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.167N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+                6.17N  
+                50
+ 160.5W / 1:  3.70015
+ 159.5W / 2:  3.70015
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.833N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.00000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.00000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.00000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_expressions_6d
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+             1        2        3     
+             1        2        3
+          3.00000  4.00000  5.00000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.0000
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+           3.0000   6.0000   9.0000  12.0000  15.0000
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          4.00000  5.00000  6.00000  7.00000  8.00000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000  0.00000  1.00000  2.00000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            1.000    8.000   27.000   64.000  125.000
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  1.00000  1.00000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  0.00000  0.00000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  1.00000  0.00000  1.00000  1.00000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  0.00000  0.00000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.000000  0.000000  0.000000  0.000000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+             1         2         3         4         5      
+              1         2         3         4         5
+ ---- N:1 F:   1
+ N:1 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:2 F:   2
+ N:2 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:3 F:   3
+ N:3 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:4 F:   4
+ N:4 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ ---- N:5 F:   5
+ N:5 F:   0.000000  0.000000  0.000000  0.000000  0.000000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+             ....     ....     ....  4.00000  5.00000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  0.00000  4.00000  5.00000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33300  0.33300  0.33300  4.00000 -9.00000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          3.00000  3.00000  3.00000  4.00000  5.00000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  3.00000  3.00000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.00000  1.00000  1.00000  1.00000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          2.00000  1.00000  0.00000  1.00000  2.00000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+            2.718    7.389   20.086   54.598  148.413
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.00000  0.69315  1.09861  1.38629  1.60944
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.000000  0.301030  0.477121  0.602060  0.698970
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  3.00000  4.00000  5.00000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.841471  0.909297  0.141120 -0.756802 -0.958924
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.47493
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.540302 -0.416147 -0.989992 -0.653644  0.283662
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333  1.66667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.55741 -2.18504 -0.14255  1.15782 -3.38052
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          0.33333  0.66667  1.00000  1.33333 -1.47493
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+              1        2        3        4        5     
+              1        2        3        4        5
+ 1   / 1:     ....  0.00000  0.00000  0.00000  0.00000
+ 2   / 2:  1.57080  0.78540  0.46365  0.32175  0.24498
+ 3   / 3:  1.57080  1.10715  0.78540  0.58800  0.46365
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+          1.00000  2.00000  0.00000  1.00000  2.00000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000     ....  1.00000  2.00000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -2.00000 -1.00000 -9.00000  1.00000  2.00000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+             1         2         3         4         5      
+              1         2         3         4         5
+          0.337575  0.723822  0.030403  0.849932  0.169352
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+             1        2        3        4        5     
+             1        2        3        4        5
+         -0.26718  0.28276 -0.32292  1.21676 -0.30437
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+          EBOXLO   EBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+          FBOXLO   FBOXHI
+5   / 5:  4.50000  5.50000
+6   / 6:  5.50000  6.50000
+7   / 7:  6.50000  7.50000
+ 
+GO bn_reset
+cancel mode verify
+GO bn_direction_fcns_6d
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+               C   M_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1   M_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+               C   N_INDEX   EX#3
+1   / 1:  5.00000  3.00000  3.00000
+2   / 2:  4.00000  2.00000  4.00000
+3   / 3:  3.00000  1.00000  5.00000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1   N_INDEX EX#3
+1   / 1: "q"  2.00000 "0"
+2   / 2: "0"  3.00000 "c"
+3   / 3: "c"  1.00000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+          TEMP    EX#2
+M / 1:  30.7500  34.7500
+M / 2:  31.7500  33.7500
+M / 3:  32.7500  32.7500
+M / 4:  33.7500  31.7500
+M / 5:  34.7500  30.7500
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+          TEMP    EX#2
+N / 1:  30.7500  31.3500
+N / 2:  30.9500  31.1500
+N / 3:  31.1500  30.9500
+N / 4:  31.3500  30.7500
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+                 A      A        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+                 B      B        EX#3      EX#4
+1    /  1:  0.00000      ....      ....      ....
+2    /  2:  1.00000  0.750000  0.750000  0.800000
+3    /  3:  1.00000  0.750000  0.750000  0.600000
+4    /  4:  0.00000  0.500000  0.500000  0.500000
+5    /  5:  1.00000  0.500000  0.500000  0.400000
+6    /  6:  0.00000  0.250000  0.250000  0.100000
+7    /  7:  0.00000  0.000000  0.000000      ....
+8    /  8:  0.00000      ....      ....      ....
+9    /  9:     ....      ....      ....      ....
+10   / 10:  0.00000      ....      ....      ....
+11   / 11:  0.00000  0.000000  0.000000      ....
+12   / 12:  0.00000      ....      ....      ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000  1.00000  0.00000  0.00000     ....     ....
+ 2   / 2:     ....     ....     ....     ....     ....     ....     ....     ....
+ 3   / 3:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:  1.00000  2.00000  2.00000  2.00000  1.00000  1.00000     ....     ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+              1        2        3        4        5        6        7        8     
+              1        2        3        4        5        6        7        8
+ 1   / 1:  0.00000  1.00000  1.00000     ....  1.00000  0.00000     ....  0.00000
+ 2   / 2:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 3   / 3:  1.00000  2.00000  2.00000     ....  2.00000  1.00000     ....  1.00000
+ 4   / 4:     ....     ....     ....     ....     ....     ....     ....     ....
+ 5   / 5:     ....     ....     ....     ....     ....     ....     ....     ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  1.00000  1.00000
+ 2   / 2:     ....     ....
+ 3   / 3:  1.00000  1.00000
+ 4   / 4:     ....     ....
+ 5   / 5:  1.00000  1.00000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+             101      102    
+            101      102
+ 1   / 1:  10.0000  10.0000
+ 2   / 2:  30.0000  30.0000
+ 3   / 3:  50.0000  50.0000
+ 4   / 4:     ....     ....
+ 5   / 5:     ....     ....
+ 
+GO bn_reset
+cancel mode verify
+GO bn_regrid_transforms_6d
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:120 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:114 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 00:00 (interpolated)
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE EX#1     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M:118 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.3553  32.3552  32.5032  32.8652  33.3285
+ 1.17N / 45:  32.1766  32.1710  32.2834  32.5970  33.0244
+ 0.83N / 44:  32.0256  32.0016  32.0631  32.3109  32.6873
+ 0.5N  / 43:  31.9306  31.8902  31.8887  32.0374  32.3408
+ 0.17N / 42:  31.8944  31.8343  31.7825  31.8263  32.0336
+ 0.17S / 41:  31.9538  31.8657  31.7716  31.7285  31.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.3553  38.3552  38.5032  38.8652  39.3285
+ 1.17N / 45:  38.1766  38.1710  38.2834  38.5970  39.0244
+ 0.83N / 44:  38.0256  38.0016  38.0631  38.3109  38.6873
+ 0.5N  / 43:  37.9306  37.8902  37.8887  38.0374  38.3408
+ 0.17N / 42:  37.8944  37.8343  37.7825  37.8263  38.0336
+ 0.17S / 41:  37.9538  37.8657  37.7716  37.7285  37.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.7553  37.7552  37.9032  38.2652  38.7285
+ 1.17N / 45:  37.5766  37.5710  37.6834  37.9970  38.4244
+ 0.83N / 44:  37.4256  37.4016  37.4631  37.7109  38.0873
+ 0.5N  / 43:  37.3306  37.2902  37.2887  37.4374  37.7408
+ 0.17N / 42:  37.2944  37.2343  37.1825  37.2263  37.4336
+ 0.17S / 41:  37.3538  37.2657  37.1716  37.1285  37.2282
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.7553  43.7552  43.9032  44.2652  44.7285
+ 1.17N / 45:  43.5766  43.5710  43.6834  43.9970  44.4244
+ 0.83N / 44:  43.4256  43.4016  43.4631  43.7109  44.0873
+ 0.5N  / 43:  43.3306  43.2902  43.2887  43.4374  43.7408
+ 0.17N / 42:  43.2944  43.2343  43.1825  43.2263  43.4336
+ 0.17S / 41:  43.3538  43.2657  43.1716  43.1285  43.2282
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:112 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 00:00 (interpolated)
+               129.5W   128.5W   127.5W   126.5W   125.5W  
+               101      102      103      104      105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.3553  34.3552  34.5032  34.8652  35.3285
+ 1.17N / 45:  34.1766  34.1710  34.2834  34.5970  35.0244
+ 0.83N / 44:  34.0256  34.0016  34.0631  34.3109  34.6873
+ 0.5N  / 43:  33.9306  33.8902  33.8887  34.0374  34.3408
+ 0.17N / 42:  33.8944  33.8343  33.7825  33.8263  34.0336
+ 0.17S / 41:  33.9538  33.8657  33.7716  33.7285  33.8282
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.3553  40.3552  40.5032  40.8652  41.3285
+ 1.17N / 45:  40.1766  40.1710  40.2834  40.5970  41.0244
+ 0.83N / 44:  40.0256  40.0016  40.0631  40.3109  40.6873
+ 0.5N  / 43:  39.9306  39.8902  39.8887  40.0374  40.3408
+ 0.17N / 42:  39.8944  39.8343  39.7825  39.8263  40.0336
+ 0.17S / 41:  39.9538  39.8657  39.7716  39.7285  39.8282
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.0220  36.0219  36.1698  36.5318  36.9952
+ 1.17N / 45:  35.8433  35.8377  35.9501  36.2637  36.6910
+ 0.83N / 44:  35.6923  35.6682  35.7298  35.9776  36.3539
+ 0.5N  / 43:  35.5973  35.5568  35.5554  35.7040  36.0075
+ 0.17N / 42:  35.5610  35.5010  35.4491  35.4929  35.7003
+ 0.17S / 41:  35.6205  35.5323  35.4383  35.3952  35.4948
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.0220  42.0219  42.1698  42.5318  42.9952
+ 1.17N / 45:  41.8433  41.8377  41.9501  42.2637  42.6910
+ 0.83N / 44:  41.6923  41.6682  41.7298  41.9776  42.3539
+ 0.5N  / 43:  41.5973  41.5568  41.5554  41.7040  42.0075
+ 0.17N / 42:  41.5610  41.5010  41.4491  41.4929  41.7003
+ 0.17S / 41:  41.6205  41.5323  41.4383  41.3952  41.4948
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M:102 dset:   1 I:  101  105  J:   41   46  K:    1    1  L: -999 -999  M:    1    2  N:    1    2
+ -DELETE TEMP     M:104 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ reading TEMP     M:104 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 863  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M: 90 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 864  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 88 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 88 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 865  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 94 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 94 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ regrid  TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 866  complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 58 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 72 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 78 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 80 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 80 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 867  complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:106 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 868  complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ reading TEMP     M: 98 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 869  complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ reading TEMP     M: 82 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ regrid  TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 870  complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT1     PSYT5_89  PSZT1_2   TIME21    EAXIS     FAX20
+ -DELETE TEMP     M: 66 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 70 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 74 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  29593.5
+ 23-JAN-1982 00 /  3:     ....  29593.5
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:     ....  8878.05
+ 23-JAN-1982 00 /  3:     ....  8878.05
+ 27-JAN-1982 00 /  4:     ....     ....
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G092)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:    213056.    355093.
+ 23-JAN-1982 00 /  3:  20028585.  33381003.
+ 27-JAN-1982 00 /  4:    213084.    355141.
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G101)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 70 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1       2.1    
+                           1         2
+ 15-JAN-1982 00 /  1:      ....      ....
+ 19-JAN-1982 00 /  2:      ....      ....
+ 23-JAN-1982 00 /  3:      ....  0.000000
+ 27-JAN-1982 00 /  4:      ....      ....
+ 31-JAN-1982 00 /  5:      ....      ....
+ 04-FEB-1982 00 /  6:      ....      ....
+ 08-FEB-1982 00 /  7:      ....      ....
+ 12-FEB-1982 00 /  8:      ....      ....
+ 16-FEB-1982 00 /  9:      ....      ....
+ 20-FEB-1982 00 / 10:      ....      ....
+ 24-FEB-1982 00 / 11:      ....      ....
+ 28-FEB-1982 00 / 12:      ....      ....
+ 04-MAR-1982 00 / 13:      ....      ....
+ 08-MAR-1982 00 / 14:      ....      ....
+ 12-MAR-1982 00 / 15:      ....      ....
+ 16-MAR-1982 00 / 16:      ....      ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 64 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ -DELETE A1       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G092)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G087)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:     ....
+ 2.1 / 2:  2.50000
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 66 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G101)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G092)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 54 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.50000
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 62 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @MIN
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.50000
+ 2.1 / 2:  2.00000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ -DELETE _E       M: 56 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G096)           @SUM
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G101)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.05000
+ 2.1 / 2:  4.20000
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ -DELETE _E       M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G096)
+    GRID (G096)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G106)           @MAX
+ eval    AFCST    C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 74 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G096)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ regrid  AFCST    M: 46 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G106)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.0
+ 02-JAN-1990 00 / 2:  32494.0
+ 03-JAN-1990 00 / 3:  32495.0
+ 04-JAN-1990 00 / 4:  32496.0
+ 05-JAN-1990 00 / 5:  32497.0
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G106)
+    GRID (G106)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+ 
+GO bn_reset
+cancel mode verify
+GO bn_aggregate_e
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M: 64 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M: 62 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M: 56 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M: 54 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   28.513   28.441   27.892   27.457   26.726   25.561     ....     ....     ....
+ 2   / 2:   85.539   85.323   83.676   82.370   80.177   76.683     ....     ....     ....
+ 3   / 3:   57.026   56.882   55.784   54.913   53.452   51.122     ....     ....     ....
+ 4   / 4:  114.051  113.765  111.568  109.826  106.903  102.245     ....     ....     ....
+cancel data fourfiles
+ -DELETE SST      M: 66 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M: 74 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G106)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ getgrid AIRT     C:  5 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME13    NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G109)          COADSX116_COADSY52_6NORMAL    TIME13    ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M: 74 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 70 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 50 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 50 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:120 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:120 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:114 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+             13N      15N      17N      19N      21N      23N      25N      27N      29N    
+              1        2        3        4        5        6        7        8        9
+ 1   / 1:   27.675   27.570   27.061   26.673   25.793   25.207     ....     ....     ....
+ 2   / 2:   86.539   86.323   84.676   83.370   81.177   77.683     ....     ....     ....
+ 3   / 3:   58.026   57.882   56.784   55.913   54.452   52.122     ....     ....     ....
+ 4   / 4:  115.051  114.765  112.568  110.826  107.903  103.245     ....     ....     ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+                 UWND     UWND     UWND      VWND     UWND
+59W    / -30:  2.20244  0.934329  2.20244  0.934329  1.56839
+57W    / -29:  2.26128  0.812758  2.26128  0.812758  1.53702
+55W    / -28:  1.99826  0.681776  1.99826  0.681776  1.34002
+53W    / -27:  1.93361  0.507158  1.93361  0.507158  1.22038
+51W    / -26:  1.64932  0.330430  1.64932  0.330430  0.98987
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 30N (interpolated)
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+                 UWND     UWND      VWND     UWND     VWND
+59W    / -30:  2.20244  0.934329  0.934329  2.20244  1.56839
+57W    / -29:  2.26128  0.812758  0.812758  2.26128  1.53702
+55W    / -28:  1.99826  0.681776  0.681776  1.99826  1.34002
+53W    / -27:  1.93361  0.507158  0.507158  1.93361  1.22038
+51W    / -26:  1.64932  0.330430  0.330430  1.64932  0.98987
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_6d_lab_mode
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT21
+ name       axis              # pts   start                end
+ PSXT1     LONGITUDE          160mr   130.5E               70.5W
+ PSYT1     LATITUDE           100 i   28.836S              48.568N
+ PSZT2     DEPTH (m)           27 i-  5                    3824
+ TIME13    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.667S to 3.667N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT21         PSXT1     PSYT1     PSZT2     TIME13    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=28.84S:51.43N at AV4,D=1]
+ reading TAUX     M:106 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.274203
+ 23-AUG-1982 14 / 2: -0.236318
+ 29-AUG-1982 16 / 3: -0.198434
+ 04-SEP-1982 18 / 4: -0.160549
+ 10-SEP-1982 20 / 5: -0.122665
+ 16-SEP-1982 22 / 6: -0.104062
+ 23-SEP-1982 00 / 7: -0.104740
+ 29-SEP-1982 02 / 8: -0.105418
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME13
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=28.84S:51.43N at SM4,D=1]
+ reading TAUX     M: 94 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.649
+ 23-AUG-1982 14 / 2:  -89.328
+ 29-AUG-1982 16 / 3:  -75.007
+ 04-SEP-1982 18 / 4:  -60.686
+ 10-SEP-1982 20 / 5:  -46.365
+ 16-SEP-1982 22 / 6:  -39.333
+ 23-SEP-1982 00 / 7:  -39.590
+ 29-SEP-1982 02 / 8:  -39.847
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+ 
+ 
+! *********** v6.82 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn682_bug_fixes
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+! *********** v6.83 Additions ***********
+!  (was released as v6.84)
+ 
+GO bn_reset
+cancel mode verify
+GO bn683_bug_fixes
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.625140
+ 02-NOV-2011 07:55:36 /  2:  0.220931
+ 02-NOV-2011 07:56:36 /  3:  0.607368
+ 02-NOV-2011 07:57:36 /  4:  0.322594
+ 02-NOV-2011 07:58:36 /  5:  0.107545
+ 02-NOV-2011 07:59:36 /  6:  0.225720
+ 02-NOV-2011 08:00:36 /  7:  0.081070
+ 02-NOV-2011 08:01:36 /  8:  0.898013
+ 02-NOV-2011 08:02:36 /  9:  0.716275
+ 02-NOV-2011 08:03:36 / 10:  0.664871
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:      ....
+ 02-NOV-2011 07:54:31 / 114872:      ....
+ 02-NOV-2011 07:54:32 / 114873:      ....
+ 02-NOV-2011 07:54:33 / 114874:      ....
+ 02-NOV-2011 07:54:34 / 114875:      ....
+ 02-NOV-2011 07:54:35 / 114876:      ....
+ 02-NOV-2011 07:54:36 / 114877:  0.625140
+ 02-NOV-2011 07:54:37 / 114878:      ....
+ 02-NOV-2011 07:54:38 / 114879:      ....
+ 02-NOV-2011 07:54:39 / 114880:      ....
+ 02-NOV-2011 07:54:40 / 114881:      ....
+ 02-NOV-2011 07:54:41 / 114882:      ....
+ 02-NOV-2011 07:54:42 / 114883:      ....
+ 02-NOV-2011 07:54:43 / 114884:      ....
+ 02-NOV-2011 07:54:44 / 114885:      ....
+ 02-NOV-2011 07:54:45 / 114886:      ....
+ 02-NOV-2011 07:54:46 / 114887:      ....
+ 02-NOV-2011 07:54:47 / 114888:      ....
+ 02-NOV-2011 07:54:48 / 114889:      ....
+ 02-NOV-2011 07:54:49 / 114890:      ....
+ 02-NOV-2011 07:54:50 / 114891:      ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.63183
+ 15-FEB-1960 12 / 122:  1.90067
+ 16-MAR-1960 12 / 123:  1.99973
+ 16-APR-1960 00 / 124:  1.91734
+ 16-MAY-1960 12 / 125:  1.65796
+ 16-JUN-1960 00 / 126:  1.24555
+ 16-JUL-1960 12 / 127:  0.71815
+ 16-AUG-1960 12 / 128:  0.11450
+ 16-SEP-1960 00 / 129: -0.49038
+ 16-OCT-1960 12 / 130: -1.05001
+ 16-NOV-1960 00 / 131: -1.51270
+ 16-DEC-1960 12 / 132: -1.83577
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E  
+                         1
+ 01-JAN-1994 12 / 1:  28.6949
+ 02-JAN-1994 12 / 2:  28.6344
+ 
+set mode/last upcase_output
+ 
+GO bn_reset
+cancel mode verify
+GO bn_outtype
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ribbon_plot
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descr_4digit
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-1900 / 1:  28.36
+ 15-FEB-1900 / 2:  28.38
+ 18-MAR-1900 / 3:  28.00
+ 17-APR-1900 / 4:  27.99
+ 17-MAY-1900 / 5:  28.41
+ 17-JUN-1900 / 6:  28.23
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_outtype
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME101)              FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME101)              FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME10
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME10)               DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME10
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+                                 long_name_mod   CHAR        9    F       X=60W at ITP
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        25   T       FERRET V6.861   26-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS1
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_axis_nonmonotonic
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vec_mod
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+ 
+! *********** v6.85 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn685_bug_fixes
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	double A(TIME10) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	double E410(TIME10) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME10 = UNLIMITED ; // (3 currently)
+variables:
+	double TIME10(TIME10) ;
+		TIME10:units = "hour since 0000-01-01 00:00:00" ;
+		TIME10:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME10:modulo = " " ;
+		TIME10:axis = "T" ;
+		TIME10:standard_name = "time" ;
+	float E410(TIME10) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME10 = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON1</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON1">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_dsg_e_x
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nco_append
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+	double DDAT_ORIG(ZAXIS_ORIG) ;
+		DDAT_ORIG:missing_value = -1.e+34 ;
+		DDAT_ORIG:_FillValue = -1.e+34 ;
+		DDAT_ORIG:long_name = "DDAT[GZ=ZAXIS_ORIG at ASN]" ;
+
+// global attributes:
+		:history = "Wed Mar 26 15:39:28 2014: ncks -h -A -h z1.nc append_to_this.nc\n",
+			"FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+GO bn_reset
+cancel mode verify
+GO bn_nobounds
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+		XIRREG:units = "meters" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:units = "meters" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_write_integer_att
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_descriptor_mc
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 180E (interpolated)
+             LATITUDE : 0 (interpolated)
+ 16-JAN-0000 / 1:  28.36
+ 15-FEB-0000 / 2:  28.38
+ 17-MAR-0000 / 3:  28.00
+ 16-APR-0000 / 4:  27.99
+ 16-MAY-0000 / 5:  28.41
+ 16-JUN-0000 / 6:  28.23
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 60W (interpolated)
+             LATITUDE : 10N (interpolated)
+ 17-MAR-0000 / 1:  26.70
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.39
+ 16-JUN-0000 / 4:  27.65
+ 
+GO bn_reset
+cancel mode verify
+GO bn_plot_color_only
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_vtree
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+ 
+ 
+! *********** v6.86 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn686_bug_fixes
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ribbon_by_val
+! err685_ribbon_by_val.jnl
+! 11/21/2013
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+ 
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ppl_palette
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+ 
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+ 
+pal  bluescale.spk
+use levitus_climatology; shade/k=1 temp
+ 
+pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+ 
+pal   default
+pattern   solid
+ 
+fill sst[l=@ave]
+pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+ 
+! restore defaults
+palette default
+pattern solid
+ 
+GO bn_reset
+cancel mode verify
+GO err685_show_grid_e
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+ 
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+sh grid /e gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       M     E                   EBOX      EBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+      11>  11                    1          10.5
+      12>  12                    1          11.5
+sh grid /f gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       N     F                   FBOX      FBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_lowercaseAxis
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+ 
+use lowercaseTime.nc
+sh dat
+     currently SET data sets:
+    1> ./lowercaseTime.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AA                                        ...       ...       ...       1:15      ...       ...
+ BB                                        ...       ...       ...       1:8       ...       ...
+ 
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+ 
+! All this was correct
+show axis uppercasetime
+ name       axis              # pts   start                end
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 8
+show grid bb
+    GRID GHC2
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+ normal    E
+ normal    F
+ 
+! This variable has axis time, lowercase in the file
+sh grid aa
+    GRID GHC1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME16    T                   15 r   1                    15
+ normal    E
+ normal    F
+set axis/t0=1-jan-2001/units=days time
+ 
+! showed no output
+show axis time
+ name       axis              # pts   start                end
+ TIME      TIME                 3 i   01-JAN-2001 00:00    04-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 4.5
+ 
+! The axis did get changed but is inconsistently listed in the
+! internal arrays that store axis info.
+ 
+list/L=1:5 aa
+             VARIABLE : AA
+             FILENAME : lowercaseTime.nc
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_redefine_uvar_att
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on,
+!   returned a runtime error.
+ 
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
+ 
+GO bn_reset
+cancel mode verify
+GO err685_use_no_extension
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+ 
+! The directory contains files with all three extensions
+sp ls duplicate.*
+duplicate.cdf
+duplicate.des
+duplicate.nc
+ 
+! The one that's used is .nc
+use duplicate
+sh dat
+     currently SET data sets:
+    1> ./duplicate.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:1       1:10      ...       1:3       ...       ...
+ 
+ 
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+ 
+! Specify a nonexistent file, no extension
+use nosuchfile
+ 
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+ 
+use snoopy.dat
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err685_samplexy
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error
+! sending sub-range of variable into samplexy
+ 
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+             VARIABLE : SAMPLEXY(SST[X=290:310,Y=0:20], LON, LAT)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  26.84  26.77  26.66
+ 15-FEB      / 2:  26.60  26.52  26.35
+ 17-MAR      / 3:  26.68  26.61  26.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_shade_set
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+ 
+can dat/all
+ 
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the
+! epression being SHADED, inside a SHADE/SET
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !GAVE A BLANK PLOT
+ 
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+ 
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+ !-> shade/title="DAYS" tseries*z[gz=1:5:1]
+ 
+can var/all; can mem
+can axis timax
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err686_individual_levels
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+ 
+use coads_climatology
+ 
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+ 
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+LEV_TEXT = "(10)(20)(30)(40)"
+LEV_MIN = "10"
+LEV_MAX = "40"
+LEV_NUM = "3"
+LEV_DEL = "10"
+ 
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
+LEV_TEXT = "(10)(15)(20)(25)(30)"
+LEV_MIN = "10"
+LEV_MAX = "30"
+LEV_NUM = "4"
+LEV_DEL = "5"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_long_symnames
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+ 
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+! SHOW
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+FERRET_TEMPERATURE_EQUILIBRATOR_MAX = "35"
+ 
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+ 
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+can sym *max
+ 
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "0"
+ 
+ 
+! bn_symbols had a line to
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567XXX = "6"
+ 
+GO bn_reset
+cancel mode verify
+GO bn_strdim
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+ 
+use strdimfile.nc
+ 
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+ 
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	ENSEMBLE = 3 ;
+	maxStrlen64 = 64 ;
+variables:
+	double ENSEMBLE(ENSEMBLE) ;
+		ENSEMBLE:long_name = "Ensemble of Realizations" ;
+		ENSEMBLE:axis = "E" ;
+		ENSEMBLE:point_spacing = "even" ;
+	char LABELS(ENSEMBLE, maxStrlen64) ;
+		LABELS:long_name = "Realizations" ;
+		LABELS:history = "From http://dunkel.pmel.noaa.gov:8930/thredds/dodsC/data/atmos3.ncml" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+ 
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_5 = 5 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char STRVAR(XAX1_3, STRING1_5) ;
+		STRVAR:long_name = "mystrings" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_single_colorlev
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when
+! single level is specified with a range of values
+ 
+use coads_climatology
+ 
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+ 
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+ 
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+ 
+ 
+ 
+! *********** v6.87 Additions ***********
+GO bn_reset
+cancel mode verify
+GO bn687_bug_fixes
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err686_long_list_varnames
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+ 
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+ 
+! The list was cut off after woa_land_marker.
+! Try to load a variable later than that in the list.
+ 
+list etopo2_depth
+             VARIABLE : ETOPO2_DEPTH
+             FILENAME : longvarnames.tsv
+             SUBSET   : 10 points (X)
+ 1    /  1: -97.00
+ 2    /  2: -97.00
+ 3    /  3: -97.00
+ 4    /  4: -97.00
+ 5    /  5: -97.00
+ 6    /  6: -97.00
+ 7    /  7: -97.00
+ 8    /  8: -99.00
+ 9    /  9: -99.00
+ 10   / 10: -99.00
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_faxis_label
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis
+! shouldn't automatically get it.
+ 
+! Define a variable with a Julian calendar axis, and an abstract F axis
+ 
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+ 
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! This label should be just F : 3
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "F : 3"
+ 
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
+ !-> sh sym lab5
+LAB5 = "FORECAST : 03-JAN-2000 00:00:00 JULIAN"
+ 
+GO bn_reset
+cancel mode verify
+GO err686_dup_axnames
+! err686_dup_axnames
+! Ticket 1750
+!
+! Make some datasets. Same axis length and name,
+! different coordinates.
+ 
+def ax/x=1:4:1 xaxis_test
+let a = x[gx=xaxis_test]
+save/clob/file=a.nc a
+def ax/x=11:14:1 xaxis_test
+let b = x[gx=xaxis_test]
+save/clob/file=b.nc b
+can var/all; can dat/all
+ 
+! Check axis coords.
+use a; use b
+sh dat
+     currently SET data sets:
+    1> ./a.nc
+ name     title                             I         J         K         L         M         N
+ A        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+    2> ./b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+sh grid a[d=1]
+    GRID GSI1
+ name       axis              # pts   start                end
+ XAXIS_TEST1 X                  4 r   1                    4
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+sh grid b[d=2]
+    GRID GRR1
+ name       axis              # pts   start                end
+ XAXIS_TEST X                   4 r   11                   14
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! Write b with its Ferret internal axis name XAXIS_TEST1
+save/clob/file=c.nc a[d=1],b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST1 = 4 ;
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Yet more combinations
+save/clob/file=c.nc b, a[d=1]
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+	XAXIS_TEST1 = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! We can use /KEEP_AXISNAMES, changes XAXIS_TEST1 to XAXIS_TEST
+save/clobber/file=c.nc b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Subsets also use XAXIS_TEST1
+save/clobber/file=c.nc/i=2:4 b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST2_4 = 3 ;
+variables:
+	double XAXIS_TEST2_4(XAXIS_TEST2_4) ;
+		XAXIS_TEST2_4:point_spacing = "even" ;
+		XAXIS_TEST2_4:axis = "X" ;
+	double B(XAXIS_TEST2_4) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Unless we use /KEEP_AXISNAMES - which removes renaming
+! due to subsetting and also due to internal names
+save/clobber/file=c.nc/i=2:4/keep b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 3 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! If we try /KEEP_AXISNAMES but there is a conflict, it's an err
+set mode ignore
+save/clobber/keep/file=nc b,a[d=1]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_cancel_invalid_var
+! err686_cancel_invalid_var
+! ticket 2159
+ 
+! The cancel variable ran into an incorrect setting
+! for variable-in-memory
+ 
+set mode ignore
+let b = 1
+shade b
+ 
+set mode/last ignore
+cancel var b
+ 
+! Shade plot of a less-than-one cell region. Its where the bug came from.
+use coads_climatology
+shade/x=161.1:161.3/y=0.2:0.4/L=1 sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_redef_ascii_att
+! err686_redef_ascii_att.jnl
+! Bug 2161
+! DEFINE ATT to redefine title or units for variable
+! in ascii dataset caused crash
+ 
+columns/delim=" " EZ.DAT
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ 
+! A new attribuge causes no problems
+define att/output v1.comment = "First var from EZ.DAT"
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ 
+! Initial definition of units is ok.
+! Re-defining the title or units causes crash
+define att/output v1.long_name = "vee one"
+ 
+! Initial definition of units is ok.
+! Re-defining units causes crash
+define att/output v1.units="km"
+define att/output v1.units="meters"
+ 
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = vee one 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ V1.units = meters 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_bad_axis_bounds
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+ 
+use badbounds.nc
+show data
+     currently SET data sets:
+    1> ./badbounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MONTH_IRREG_BNDS
+                                           1:2       ...       ...       1:12      ...       ...
+       (invalid axis bounds)
+ TEMP2    TEMP[GT=MONTH_IRREG at ASN]         1:1       1:1       1:1       1:12      ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_enter_exit_GO
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+ 
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+ 
+set redirect/tee/journal
+go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ 
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+ !-> if 1 THEN GO bn_shortgo2
+! Enter_GO bn_shortgo2
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
+! Enter_GO bn_short.sub tvar ave
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+ 
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+ !-> LIST/nohead/norow tvar[t=-5:9 at ave]	! neg/pos t endpoints
+   2.000
+ 
+! Exit_GO
+! Exit_GO
+ 
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+ !-> repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+!-> REPEAT: L=1
+ !-> if 0 then go bn_shortgo
+ !-> def sym ok = 1
+!-> REPEAT: L=2
+ !-> if 1 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 2
+!-> REPEAT: L=3
+ !-> if 2 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 3
+ 
+cancel redirect
+ 
+ 
+!  *********** Always do a bn_reset  ***********
+!  *********** make sure things clean up well **
+GO bn_reset
+cancel mode verify
+ 
+! version 2.3 requires exit/command *sh* 3/92
+exit/command
+yes? ! bn_all_ef_shell.jnl
+yes? ! 5/05 *acm*
+yes? ! run bn_all_ef tests
+yes? 
+yes? GO bn_all_ef
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14
+ 	26-Mar-14 15:39     
+
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+ADD_9(A,B,C,D,E,F,G,H,I)
+    (demonstration function) adds 9 arguments
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+AVET(A)
+    (demonstration function) returns the time average
+    A: data to be averaged over the time axis
+show func pass_thru
+PASS_THRU(A)
+    (demonstration function) sets result equal to input
+    A: this arg is passed through
+show func sto*
+STORAGE(A)
+    sets result equal to input/10
+    A: input
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+list a
+             VARIABLE : ADD_9(A1,A2,A3,A1,A2,A3,A1,A2,A3)
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  263.6
+ 153E   / 67:  264.5
+ 155E   / 68:  264.2
+ 157E   / 69:  261.3
+ 159E   / 70:  260.9
+ 161E   / 71:  262.4
+ 163E   / 72:  264.0
+ 165E   / 73:  261.1
+ 167E   / 74:  260.9
+ 169E   / 75:  261.0
+ 171E   / 76:  259.3
+ 173E   / 77:  257.9
+ 175E   / 78:  257.0
+ 177E   / 79:  259.1
+ 179E   / 80:  254.8
+list  a - 3 * sst[d=1,l=1:3 at sum]
+             VARIABLE : A - 3 * SST[D=coads_climatology,L=1:3 at SUM]
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+set mode/last ignore_errors
+go bench_avet
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a = avet(sst)
+list a
+             VARIABLE : AVET(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+                1S    
+                45
+ 151E   / 66:  29.28
+ 153E   / 67:  29.39
+ 155E   / 68:  29.35
+ 157E   / 69:  29.03
+ 159E   / 70:  28.99
+ 161E   / 71:  29.15
+ 163E   / 72:  29.33
+ 165E   / 73:  29.01
+ 167E   / 74:  28.99
+ 169E   / 75:  29.00
+ 171E   / 76:  28.81
+ 173E   / 77:  28.66
+ 175E   / 78:  28.56
+ 177E   / 79:  28.79
+ 179E   / 80:  28.31
+list a - sst[l=@ave]
+             VARIABLE : A - SST[L=@AVE]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                  1S      
+                  45
+ 151E   / 66:  0.000E+00
+ 153E   / 67: -3.553E-15
+ 155E   / 68:  0.000E+00
+ 157E   / 69:  0.000E+00
+ 159E   / 70:  3.553E-15
+ 161E   / 71:  7.105E-15
+ 163E   / 72:  3.553E-15
+ 165E   / 73:  0.000E+00
+ 167E   / 74:  0.000E+00
+ 169E   / 75:  3.553E-15
+ 171E   / 76:  0.000E+00
+ 173E   / 77:  3.553E-15
+ 175E   / 78:  0.000E+00
+ 177E   / 79:  3.553E-15
+ 179E   / 80:  3.553E-15
+ 
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+             X: 0.5 to 9.5
+ Column  1: B is X[I=1:9,K=1:5]
+ Column  2: C is AVET(A)
+             B     C
+1   / 1:  1.000   4.00
+2   / 2:  2.000   5.00
+3   / 3:  3.000   6.00
+4   / 4:  4.000   7.00
+5   / 5:  5.000   8.00
+6   / 6:  6.000   9.00
+7   / 7:  7.000  10.00
+8   / 8:  8.000  11.00
+9   / 9:  9.000  12.00
+ 
+set mode/last ignore_errors
+go bench_pass_thru
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+             VARIABLE : PASS_THRU(X)
+             SUBSET   : 20 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 11   / 11:  11.00
+ 12   / 12:  12.00
+ 13   / 13:  13.00
+ 14   / 14:  14.00
+ 15   / 15:  15.00
+ 16   / 16:  16.00
+ 17   / 17:  17.00
+ 18   / 18:  18.00
+ 19   / 19:  19.00
+ 20   / 20:  20.00
+set region/i=1:20
+list sin(a)
+             VARIABLE : SIN(A)
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8415
+ 2    /  2:  0.9093
+ 3    /  3:  0.1411
+ 4    /  4: -0.7568
+ 5    /  5: -0.9589
+ 6    /  6: -0.2794
+ 7    /  7:  0.6570
+ 8    /  8:  0.9894
+ 9    /  9:  0.4121
+ 10   / 10: -0.5440
+ 11   / 11: -1.0000
+ 12   / 12: -0.5366
+ 13   / 13:  0.4202
+ 14   / 14:  0.9906
+ 15   / 15:  0.6503
+ 16   / 16: -0.2879
+ 17   / 17: -0.9614
+ 18   / 18: -0.7510
+ 19   / 19:  0.1499
+ 20   / 20:  0.9129
+can var/all
+can region
+ 
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+             VARIABLE : PASS_THRU(SST[L=@AVE,Y=@SBX:11])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+             VARIABLE : PASS_THRU(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 16-JAN 06:00
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   0.59
+ 71N   / 81:   0.62
+ 69N   / 80:   0.45
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   3.32
+ 43N   / 67:   4.72
+ 41N   / 66:   4.84
+ 39N   / 65:   8.63
+ 37N   / 64:   8.07
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:  18.91
+ 27N   / 59:  20.83
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:  25.41
+ 13N   / 52:  25.37
+ 11N   / 51:  25.82
+ 9N    / 50:  27.20
+ 7N    / 49:  26.11
+ 5N    / 48:  26.10
+ 3N    / 47:  26.25
+ 1N    / 46:  26.44
+ 1S    / 45:  27.01
+ 3S    / 44:  27.61
+ 5S    / 43:  28.24
+ 7S    / 42:  28.71
+ 9S    / 41:  28.46
+ 11S   / 40:  28.07
+ 13S   / 39:  28.15
+ 15S   / 38:  28.08
+ 17S   / 37:  28.29
+ 19S   / 36:  27.61
+ 21S   / 35:  27.59
+ 23S   / 34:  27.06
+ 25S   / 33:  26.70
+ 27S   / 32:  25.89
+ 29S   / 31:  24.65
+ 31S   / 30:  23.86
+ 33S   / 29:  22.16
+ 35S   / 28:  20.58
+ 37S   / 27:  19.20
+ 39S   / 26:  17.51
+ 41S   / 25:  14.44
+ 43S   / 24:   8.55
+ 45S   / 23:   7.51
+ 47S   / 22:   5.77
+ 49S   / 21:   4.21
+ 51S   / 20:   3.64
+ 53S   / 19:   2.87
+ 55S   / 18:   2.67
+ 57S   / 17:   2.05
+ 59S   / 16:   1.37
+ 61S   / 15:   1.33
+ 63S   / 14:   0.77
+ 65S   / 13:  -0.04
+ 67S   / 12:  -0.93
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+list/x=50 a[l=@ave,y=@sbx:11]
+             VARIABLE : PASS_THRU(SST)
+                        box smoothed by 11 pts on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (averaged)
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+ 
+set mode/last ignore_errors
+go bench_storage
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+              130.5E 131.5E 
+                1      2
+ 1.5N  / 50:   ....  2.955
+ 1.17N / 49:   ....  2.962
+ 0.83N / 48:   ....  2.966
+ 0.5N  / 47:   ....  2.973
+ 0.17N / 46:   ....  2.985
+ 0.17S / 45:   ....  2.990
+ 0.5S  / 44:   ....   ....
+ 
+can region
+set region/x=140w/y=10n/k=1
+list a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 140.5W
+             LATITUDE : 9.8N
+             DEPTH (m): 5
+                      140.5W 
+                       90
+ 15-JAN-1982 14 / 1:  2.656
+ 18-JAN-1982 15 / 2:  2.654
+ 21-JAN-1982 16 / 3:  2.652
+ 24-JAN-1982 17 / 4:  2.649
+ 27-JAN-1982 18 / 5:  2.646
+ 
+can region
+ 
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+             VARIABLE : STORAGE(B)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 0.7S to 1.7N (averaged)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+ 140.5E / 11:  2.953
+ 141.5E / 12:  2.956
+ 142.5E / 13:  2.961
+ 143.5E / 14:  2.966
+ 144.5E / 15:  2.968
+ 145.5E / 16:  2.968
+ 146.5E / 17:  2.967
+ 147.5E / 18:  2.970
+ 148.5E / 19:  2.974
+ 149.5E / 20:  2.979
+ 
+set mode/last ignore_errors
+ 
+go bench_subtract
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+ 
+set mode ignore_errors
+ 
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+             VARIABLE : SUBTRACT(OATEMP,SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+             VARIABLE : A - B
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+ 
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             DEPTH (m): 0
+                    179E   
+                     80
+ 16-JAN      / 1:  0.1934
+ 15-FEB      / 2:  0.1304
+ 17-MAR      / 3:    ....
+ 
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+             VARIABLE : SUBTRACT(A,B)
+             SUBSET   : 30 points (X)
+             Y        : 15
+              15    
+              15
+ 1    /  1: -14.00
+ 2    /  2: -13.00
+ 3    /  3: -12.00
+ 4    /  4: -11.00
+ 5    /  5: -10.00
+ 6    /  6:  -9.00
+ 7    /  7:  -8.00
+ 8    /  8:  -7.00
+ 9    /  9:  -6.00
+ 10   / 10:  -5.00
+ 11   / 11:  -4.00
+ 12   / 12:  -3.00
+ 13   / 13:  -2.00
+ 14   / 14:  -1.00
+ 15   / 15:   0.00
+ 16   / 16:   1.00
+ 17   / 17:   2.00
+ 18   / 18:   3.00
+ 19   / 19:   4.00
+ 20   / 20:   5.00
+ 21   / 21:   6.00
+ 22   / 22:   7.00
+ 23   / 23:   8.00
+ 24   / 24:   9.00
+ 25   / 25:  10.00
+ 26   / 26:  11.00
+ 27   / 27:  12.00
+ 28   / 28:  13.00
+ 29   / 29:  14.00
+ 30   / 30:  15.00
+ 
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+list/x=150:160/y=0 subtract(a,26)
+             VARIABLE : SUBTRACT(A,26)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+ 
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                1S    
+                45
+ 151E   / 66:  1.109
+ 153E   / 67:  1.124
+ 155E   / 68:  1.027
+ 157E   / 69:  0.883
+ 159E   / 70:  0.912
+ 
+set mode/last ignore_errors
+ 
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
+ 
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+!
+! 4/2006 all efs distributed with Ferret except writev5d and the
+!        examples tested in bench_examples.jnl are now internally linked.
+ 
+GO bn_reset
+cancel mode verify
+go bench_v5d
+! benchmark for Vis5D external function
+! 5/99 ACM
+ 
+ 
+!  Write data to a Vis5D file.  The first argument to the
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+ 
+can region
+ set mode ignore_error
+ 
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+To view the file with Vis5D say:   GO vis5d_start vis5d_out.v5d
+ 
+set mode/last ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_v5d_strings.jnl
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+ 
+go bn_reset
+cancel mode verify
+go bn_fcn_calls.jnl
+! Simple tests of external functions
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and
+!             fill_xy to bn_internal_external_functions.jnl
+ 
+exit
+ 
+exit/command
+ 
+-----
+Appending ncdump output
+ 
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_17 = 17 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_17) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348804, 27.9324667419545,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+		TIME4:bounds = "TIME4_bnds" ;
+	double TIME4_bnds(TIME4, bnds) ;
+	float SST(TIME4, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+
+ TIME4_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+	TIME4edges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+		TIME4:edges = "TIME4edges" ;
+	double TIME4edges(TIME4edges) ;
+		TIME4edges:edges = " " ;
+	float SST(TIME4, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+
+ TIME4edges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.861   26-Mar-14" ;
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+		ZAX:bounds = "ZAX_bnds" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME4 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME4(TIME4) ;
+		TIME4:units = "hour since 0000-01-01 00:00:00" ;
+		TIME4:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME4:modulo = " " ;
+		TIME4:axis = "T" ;
+		TIME4:standard_name = "time" ;
+	float SST(TIME4, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME4 = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME7 = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME7(TIME7) ;
+		TIME7:units = "hour since 0000-01-01 00:00:00" ;
+		TIME7:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME7:modulo = " " ;
+		TIME7:axis = "T" ;
+		TIME7:standard_name = "time" ;
+	float SST(TIME7, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME7 = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT1100_100 = 1 ;
+	PSYT135_56 = 22 ;
+	PSZT11_1 = 1 ;
+	TIME11 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT1100_100(PSXT1100_100) ;
+		PSXT1100_100:units = "degrees_east" ;
+		PSXT1100_100:point_spacing = "even" ;
+		PSXT1100_100:modulo = 360. ;
+		PSXT1100_100:axis = "X" ;
+		PSXT1100_100:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_1(PSZT11_1) ;
+		PSZT11_1:units = "meters" ;
+		PSZT11_1:positive = "down" ;
+		PSZT11_1:point_spacing = "uneven" ;
+		PSZT11_1:axis = "Z" ;
+		PSZT11_1:standard_name = "depth" ;
+		PSZT11_1:bounds = "PSZT11_1_bnds" ;
+	double PSZT11_1_bnds(PSZT11_1, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:point_spacing = "even" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	float TEMP(TIME11, PSZT11_1, PSYT135_56, PSXT1100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME11, PSZT11_1, PSYT148_48, PSXT191_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME11, PSZT11_1, PSYT148_48, PSXT191_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:new_att = "something" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "meters" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:new_att = "something" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "meters" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double T2(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	double FAREN(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME11 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME11(TIME11) ;
+		TIME11:units = "hour since 1980-01-14 14:00:00" ;
+		TIME11:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME11:axis = "T" ;
+		TIME11:standard_name = "time" ;
+	int FAREN(TIME11, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME3 = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME3(TIME3) ;
+		TIME3:units = "hour since 0000-01-01 00:00:00" ;
+		TIME3:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME3:modulo = " " ;
+		TIME3:axis = "T" ;
+		TIME3:standard_name = "time" ;
+	float TEMP(TIME3, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	TDAY = UNLIMITED ; // (31 currently)
+	LON1_5 = 5 ;
+	LAT1_5 = 5 ;
+	bnds = 2 ;
+	ZT = 10 ;
+	TIME1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double TDAY(TDAY) ;
+		TDAY:units = "days since 1998-12-31 00:00:00" ;
+		TDAY:axis = "T" ;
+		TDAY:calendar = "GREGORIAN" ;
+		TDAY:time_origin = "31-DEC-1998" ;
+		TDAY:standard_name = "time" ;
+	double MyUpperLowerCaseVar(TDAY, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double LON1_5(LON1_5) ;
+		LON1_5:point_spacing = "even" ;
+		LON1_5:axis = "X" ;
+		LON1_5:standard_name = "longitude" ;
+	double LAT1_5(LAT1_5) ;
+		LAT1_5:point_spacing = "uneven" ;
+		LAT1_5:axis = "Y" ;
+		LAT1_5:standard_name = "latitude" ;
+		LAT1_5:bounds = "LAT1_5_bnds" ;
+	double LAT1_5_bnds(LAT1_5, bnds) ;
+	float ZT(ZT) ;
+		ZT:units = "meters" ;
+		ZT:positive = "down" ;
+		ZT:point_spacing = "uneven" ;
+		ZT:axis = "Z" ;
+		ZT:standard_name = "depth" ;
+		ZT:bounds = "ZT_bnds" ;
+	float ZT_bnds(ZT, bnds) ;
+	double TIME1478(TIME1478) ;
+		TIME1478:calendar = "NOLEAP" ;
+		TIME1478:point_spacing = "even" ;
+		TIME1478:axis = "T" ;
+		TIME1478:standard_name = "time" ;
+	double newvar(TIME1478, ZT, LAT1_5, LON1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:units = "deg" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:units = "degrees" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.861   26-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+-----
+end of ncdump output
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_startupfile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14
+ 	26-Mar-14 15:39     
+
+CAN MODE VERIFY
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "656"
+PPL$YPIXEL = "492"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.861"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "26-Mar-14"
+SESSION_TIME = "15:39"
+SESSION_PID = "25407"
+DELTA_CPU = "0.034994"
+CLOCK_SECS = "0.164"
+CURRENT_DATE = "26-Mar-14"
+CURRENT_TIME = "15:39:34"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "startup_tests.plt"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "8.000"
+PPL$YLEN = "6.000"
+PPL$XORG = "1.200"
+PPL$YORG = "1.400"
+PPL$WIDTH = "10.20"
+PPL$HEIGHT = "8.800"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+WIN_TITLE = "26-Mar-14:15:39"
+VP_WIDTH = "10.2"
+VP_HEIGHT = "8.8"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1"
+VP_TOP_MARGIN = "1.4"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+GO_FILE = "./bn_startupfile.jnl"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE         SET         startup_tests.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_gif
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14
+ 	26-Mar-14 15:39     
+
+! bn450_gif.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of gif file in batch mode using
+! frame/file=bnplot.gif....will create three gif files
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= .gif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+frame/file=bnplot.gif
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+frame/file=bnplot.gif
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+frame/file=bnplot.gif
+ 
+! Prior to v5.8 could not get the window size in pixels when in gif mode
+show symbol ppl$xpixel
+PPL$XPIXEL = "1152"
+show symbol ppl$ypixel
+PPL$YPIXEL = "662"
+ 
+! V6.13
+! transparency with FRAME/TRANS
+!!
+! These gif images have the background color white or black
+! replaced by transparent color. This can be tested by putting
+! them into an HTML document with a colored background.
+! e.g. a file called test_transparent.html containing only this line:
+! <html> <body bgcolor="orange"> <img src="testfile.gif"/> </body> </html>
+ 
+can view
+use coads_climatology
+shade/nokey/lev=50 sst[L=1]
+frame/trans/file=testbackground.gif
+ 
+! moved here from bn500_bug_fixes.jnl. The frame/  command it contains
+! has trouble when running the benchmarks from remote desktop
+go bn_reset
+cancel mode verify
+go err491_long_gif_name
+! err491_long_gif_name.jnl
+! *sh* 4/99 - test 175 character gif name
+ 
+! name length extended with changes to save_frame.F and xeq_frame.F
+ 
+set wind/siz=0.03
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+sp rm -f abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+ 
+frame/file="abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif"
+ 
+spawn ls abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif
+ 
+ 
+! The fix for bug 1396
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=gif_dashbug.gif
+ 
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_ps
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14
+ 	26-Mar-14 15:39     
+
+! bn450_ps.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of ps files in batch mode using
+! "-batch bnplot.ps" command line option...will create on final ps file
+! *kob*
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= bnplot.ps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+ 
+set mode ignore
+frame/file=bnplot.ps    ! DELIBERATE ERROR MESSAGE
+can mode ignore
+exit/command
+yes? ! this "shell" is used because the Unix redirection fails to echo commands
+yes? ! from the top level command file
+yes? ! ... havn't explored the reason ... they echo fine to the screen
+yes? ! *kob* 3/04/98 - newly created - copied from bn490_all_shell.jnl
+yes? 
+yes? 
+yes? GO bn_batch_metafile
+ 	NOAA/PMEL TMAP
+ 	FERRET v6.861  
+ 	Linux 2.6.18-371.4.1.el5 64-bit - 03/26/14
+ 	26-Mar-14 15:39     
+
+! bn_batch_metafile.jnl
+! Run at the end of the benchmark scripts, starting ferret with the flags
+!   -batch bat.plt
+! Produces nine metafiles.
+ 
+cancel mode logo
+ 
+! test viewports and set window/clear; cancel viewport
+set view upper
+plot/i=1:150 sin(i/12)
+set view lower
+plot/color=red/i=1:150 cos(i/10)
+ 
+set window/clear
+ 
+set view left
+shade/i=1:15/j=1:15/lev=30 i*j
+set view right
+shade/i=1:15/j=1:15 cos(i)* sin(j)
+ 
+cancel viewports
+ 
+set view ur
+plot/i=1:12 1./i
+set view ll
+shade/i=1:150/j=1:150 cos(i/10) - sin(j/12)
+ 
+! polygon command and palette
+ 
+cancel viewports
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! more viewports, with pplus/reset
+ 
+set view upper; shade/i=1:10/j=1:10 i*j
+cancel viewports
+pplus/reset
+ 
+! cancel viewports when viewport wasnt set
+! and set window/clear after cancel viewports
+ 
+plot/vs/line/i=1:314 i*cos(i/20),i*sin(i/20)
+plot/vs/line/over/i=1:314 i*cos(i/30),i*sin(i/20)
+ 
+cancel viewports
+set window/clear
+ 
+! aspect ratio can be set
+ 
+set window/asp=3
+shade/i=1:15/j=1:15/lev=20 i*j
+ 
+set win/asp=1
+fill/i=1:15/j=1:15/lev=20 i*j
+ 
+pplus/reset
+ 
+ 
+! Bug 1396 fixed
+ 
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+cancel viewports
+ 
+! intentional errors and ignored commands
+! set and cancel mode metafile are ignored
+ 
+set mode metafile new.plt
+ 
+cancel mode metafile
+ 
+plot/i=1:12/title="after cancel mode metafile in batch mode" 1./i
+ 
+! set window commands are ignored, except for set window/aspect
+set window/new
+ 
+set window/location=0.1,0.1/title="another title"
+ 
+set mode/last logo
+exit/command
+Ended at Wed Mar 26 15:39:36 PDT 2014
diff --git a/bench/append_pack.nc b/bench/append_pack.nc
new file mode 100644
index 0000000..0f73593
Binary files /dev/null and b/bench/append_pack.nc differ
diff --git a/bench/b1478.nc b/bench/b1478.nc
new file mode 100644
index 0000000..169febe
Binary files /dev/null and b/bench/b1478.nc differ
diff --git a/bench/bad_taxis.nc b/bench/bad_taxis.nc
new file mode 100644
index 0000000..be5a27b
Binary files /dev/null and b/bench/bad_taxis.nc differ
diff --git a/bench/badbounds.nc b/bench/badbounds.nc
new file mode 100644
index 0000000..9f92b28
Binary files /dev/null and b/bench/badbounds.nc differ
diff --git a/bench/bench_add_9.jnl b/bench/bench_add_9.jnl
new file mode 100644
index 0000000..72c9d2f
--- /dev/null
+++ b/bench/bench_add_9.jnl
@@ -0,0 +1,21 @@
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+
+set mode ignore_errors
+
+
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+
+list a
+list  a - 3 * sst[d=1,l=1:3 at sum]
+set mode/last ignore_errors
diff --git a/bench/bench_add_9_visual.jnl b/bench/bench_add_9_visual.jnl
new file mode 100644
index 0000000..5c66035
--- /dev/null
+++ b/bench/bench_add_9_visual.jnl
@@ -0,0 +1,32 @@
+set mode ignore_errors
+
+can region
+use coads_climatology
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+shade a
+shade a - 3 * sst[d=1,l=1:3 at sum]
+
+let a3 = sst[d=1,x=180]
+shade a                   ! DELIBERATE ERROR
+
+let a3 = sst[d=1,x=180,l=3]
+shade a
+
+let a3 = sst[d=1,x=180,y=0,l=1]
+shade a
+
+let a3 = 1000
+shade a
+
+use gtbc011
+let a3 = temp[k=1]
+shade a                   ! DELIBERATE ERROR
+
+let a = add_9(a1,a2,1000,a1,a2,1000,a1,a2,1000)
+shade a
+
+set mode/last ignore_errors
diff --git a/bench/bench_avet.jnl b/bench/bench_avet.jnl
new file mode 100644
index 0000000..a6f171a
--- /dev/null
+++ b/bench/bench_avet.jnl
@@ -0,0 +1,22 @@
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+
+set mode ignore_errors
+
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+
+let a = avet(sst)
+list a
+list a - sst[l=@ave]
+
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+
+set mode/last ignore_errors
\ No newline at end of file
diff --git a/bench/bench_avet_visual.jnl b/bench/bench_avet_visual.jnl
new file mode 100644
index 0000000..062793b
--- /dev/null
+++ b/bench/bench_avet_visual.jnl
@@ -0,0 +1,33 @@
+set mode ignore_errors
+
+can region
+use coads_climatology
+let a = avet(sst)
+shade a
+shade a - sst[l=@ave]
+shade a[l=1:3]
+set region/l=3
+shade a
+
+can region
+plot a[x=180]
+plot a                     ! DELIBERATE ERROR
+plot a[y=10s:10n at ave]
+
+set region/x=90:120/y=-90:-80
+shade a                    ! DELIBERATE ERROR
+
+set region/@w
+shade a
+shade a[x=180]             ! DELIBERATE ERROR
+let b = a[x=180:170w at min,l=1:3 at sbx]
+shade b
+
+can region
+let a = x[i=1:30,k=1:10] + t[l=1:10]
+let b = x[i=1:30,k=1:10]
+let c = avet(a)
+plot b
+plot/over c
+
+set mode/last ignore_errors
\ No newline at end of file
diff --git a/bench/bench_compress.jnl b/bench/bench_compress.jnl
new file mode 100644
index 0000000..32fde1e
--- /dev/null
+++ b/bench/bench_compress.jnl
@@ -0,0 +1,24 @@
+ ! NOAA/PMEL TMAP
+ ! Program FERRET  
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39     
+
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+list compressi(sst[l=5,j=66,i=125:131])
+
+list sst[l=5,j=63:73,i=125]
+list compressj(sst[l=5,j=63:73,i=125])
+
+list sst[j=67,i=125]
+list compressl(sst[j=67,i=125])
+
+
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+list compressk(a[i=91,j=35,l=1])
diff --git a/bench/bench_compress_by.jnl b/bench/bench_compress_by.jnl
new file mode 100644
index 0000000..e7376e6
--- /dev/null
+++ b/bench/bench_compress_by.jnl
@@ -0,0 +1,5 @@
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+
diff --git a/bench/bench_environment b/bench/bench_environment
new file mode 100644
index 0000000..029602e
--- /dev/null
+++ b/bench/bench_environment
@@ -0,0 +1,13 @@
+# 
+#  simple script to restrict the ferret environment when running
+#  benchmark suite.  
+#
+#  *kob* 1/01
+
+setenv FER_DATA .
+setenv FER_DESCR .
+setenv FER_DSETS .
+setenv FER_DAT .
+setenv FER_GRIDS .
+setenv FER_DIR .
+
diff --git a/bench/bench_eof.jnl b/bench/bench_eof.jnl
new file mode 100644
index 0000000..d0212ed
--- /dev/null
+++ b/bench/bench_eof.jnl
@@ -0,0 +1,49 @@
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+
+
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+
+set mode/last ignore
+
+! Test functions eofsvd*
+
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+
+
+exit/script
+! -----------------------------------------------
+! previous commands that called eof_space, eof_stat, eof_tfunc
+
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
diff --git a/bench/bench_examples.jnl b/bench/bench_examples.jnl
new file mode 100644
index 0000000..f6f20a0
--- /dev/null
+++ b/bench/bench_examples.jnl
@@ -0,0 +1,19 @@
+set mode ignore_error
+show func/ext add_9
+show func/ext ave*
+show func pass_thru
+show func sto*
+
+go bench_add_9
+go bench_avet
+go bench_pass_thru
+go bench_storage
+go bench_subtract
+
+
+
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
diff --git a/bench/bench_extrema.jnl b/bench/bench_extrema.jnl
new file mode 100644
index 0000000..e39da14
--- /dev/null
+++ b/bench/bench_extrema.jnl
@@ -0,0 +1,18 @@
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo 
+!  external functions; installed as .so files
+!  Ferret version 5.4  
+
+! ACM 28-Jan-02
+
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+
+list/x=1:10 findhi(sst,4,4)
+list/x=1:10 findlo(sst,4,4)
+
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+
+let a = findlo(sst,2,2)
+list a[i=@ngd]
diff --git a/bench/bench_fft.jnl b/bench/bench_fft.jnl
new file mode 100644
index 0000000..162d1f9
--- /dev/null
+++ b/bench/bench_fft.jnl
@@ -0,0 +1,69 @@
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.  
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results 
+
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+
+
+
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+
+
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+SET GRID tgrid
+
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+
+!  Use an analytic function.
+
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+
+LIST/L=30:35 days_fft
+LIST/L=50:55 days_fft
+
+!  Compute the phase spectrum 
+
+LET days_fftp = fftp(sample_function[l=1:365])
+
+LIST/l=1:20 days_fftp
+
+
+!PAUSE
+
+
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+
+SAY This should bail out with error msg about Time axis must be regular
+
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+
+SAY This one is ok
+LIST vw_fft
+
+CANCEL MODE IGNORE_ERRORS
diff --git a/bench/bench_fft_visual.jnl b/bench/bench_fft_visual.jnl
new file mode 100644
index 0000000..960a201
--- /dev/null
+++ b/bench/bench_fft_visual.jnl
@@ -0,0 +1,91 @@
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.  
+!   FFTP function computes the FFT phase
+
+SET MODE IGNORE_ERRORS
+
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+
+SET WIND/CLEAR
+
+
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+SET GRID tgrid
+
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+
+!  Plot an analytic function.
+
+LET sample_function = fcn1 - fcn2
+
+LET tpts = t
+SET VIEW ul
+PLOT/TITLE="An analytic function of time" sample_function
+
+LET days_fft = ffta(sample_function[l=1:365])
+
+SET VIEW ur
+PLOT/SET_UP days_fft
+PPL YLAB Amplitude Spectrum
+PPL PLOT FFTA
+!  Compute the inverted axis and plot the spectrum in period: months/cycle
+
+LET FFT_nf = `days_fft,return=lend`
+LET FFT_nyquist = 0.5
+LET FFT_freq1 = FFT_nyquist/ FFT_nf
+
+DEFINE AXIS/T=`FFT_freq1`:`FFT_nyquist`:`FFT_freq1` FAXIS
+DEFINE GRID/T=FAXIS gfftfreq
+LET a = T[g=gfftfreq]
+
+LET per = 1./a
+
+SET VIEW ll
+PLOT/VS/LINE/SET_UP per[l=1:`FFT_nf`],days_fft
+PPL XAXIS, 0, 30, 1
+PPL XFOR (I2)
+PPL XLAB Period, days/cycle
+PPL YLAB Amplitude Spectrum
+PPL PLOT FFT
+
+
+LET days_fftp = fftp(sample_function[l=1:365])
+
+!  Compute the phase spectrum,  cyc/month
+SET VIEW lr
+
+PLOT/SET_UP days_fftp
+PPL YLAB Phase Spectrum
+PPL PLOT FFTP
+
+PAUSE
+
+SET VIEW full
+SET WIND/CLEAR
+
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+PLOT vwnd
+
+SAY This should bail out w/Time axis error
+
+LET vw_fft = ffta(vwnd[l=37:60])
+PLOT vw_fft
+
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+
+SAY This one is ok
+PLOT vw_fft
+
+CANCEL MODE IGNORE_ERRORS
diff --git a/bench/bench_gridding.jnl b/bench/bench_gridding.jnl
new file mode 100644
index 0000000..487cb0f
--- /dev/null
+++ b/bench/bench_gridding.jnl
@@ -0,0 +1,71 @@
+! bench_gridding.jnl  
+! *acm* 8/99
+
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+
+! function definition from objective_analysis_demo.jnl
+
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+
+
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+
+LET sample_function = fcn1 + wave
+
+let xpts = x; let ypts = y
+
+list/x=4:5/y=1 sample_function
+
+can mem /all
+
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+
diff --git a/bench/bench_gridding_visual.jnl b/bench/bench_gridding_visual.jnl
new file mode 100644
index 0000000..1dc2cfb
--- /dev/null
+++ b/bench/bench_gridding_visual.jnl
@@ -0,0 +1,66 @@
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (GUI)
+ ! Version 4.91 - 05/19/98
+ ! 29-Jul-98 11:09     
+
+! Call scat2gridlaplace_xy 
+! to put scattered data onto a regularly spaced grid.
+
+! function definition from objective_analysis_demo.jnl
+
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+
+LET sample_function = fcn1 + wave
+
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function 
+
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+set wind/clear
+
+
+set view ul
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+SHADE/TITLE="Laplace Gridding (5,5) to 20x20 grid" sgrid 
+
+set view ur
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+SHADE/TITLE="Laplace Gridding (1,1) to 20x20" sgrid  
+
+set view ll
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+SHADE/TITLE="Gauss Gridding (2) to 20x20 grid" sgrid  
+
+set view lr
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.0, 1.0, 6,6)
+SHADE/TITLE="Gauss Gridding (6) to 20x20 grid" sgrid  
+
+set view full
+set wind/clear
+
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
diff --git a/bench/bench_internal_string_functions.jnl b/bench/bench_internal_string_functions.jnl
new file mode 100644
index 0000000..be2e248
--- /dev/null
+++ b/bench/bench_internal_string_functions.jnl
@@ -0,0 +1,67 @@
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat 
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+
+
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+! Result should be 0
+list strlen("")
+
+
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+
+! STRINDEX
+! Find first occurence string "fun" in longer string 
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+
+! STRRINDEX
+! Find last occurence string "fun" in longer string 
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+
+
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+
+
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+
+
+! the below are deliberate errors for incorrect argument detection 
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+
+set mode/last ignore
diff --git a/bench/bench_pass_thru.jnl b/bench/bench_pass_thru.jnl
new file mode 100644
index 0000000..2e66b16
--- /dev/null
+++ b/bench/bench_pass_thru.jnl
@@ -0,0 +1,24 @@
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+
+set mode ignore_errors
+
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+set region/i=1:20
+list sin(a)
+can var/all
+can region
+
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+list/x=50 a[l=@ave,y=@sbx:11]
+
+set mode/last ignore_errors
diff --git a/bench/bench_pass_thru_visual.jnl b/bench/bench_pass_thru_visual.jnl
new file mode 100644
index 0000000..2d909f9
--- /dev/null
+++ b/bench/bench_pass_thru_visual.jnl
@@ -0,0 +1,20 @@
+set mode ignore_errors
+
+can region
+let a = pass_thru(x)
+plot a[i=1:20]
+set region/i=1:20
+plot sin(a)
+can var/all
+can region
+
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+shade a
+let a = pass_thru(sst)
+set region/@w
+shade a                       ! DELIBERATE ERROR
+shade a[l=1]
+shade a[l=@ave,y=@sbx:11]
+
+set mode/last ignore_errors
diff --git a/bench/bench_samplet_date.jnl b/bench/bench_samplet_date.jnl
new file mode 100644
index 0000000..48a1459
--- /dev/null
+++ b/bench/bench_samplet_date.jnl
@@ -0,0 +1,13 @@
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+
+
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+
diff --git a/bench/bench_samplexy.jnl b/bench/bench_samplexy.jnl
new file mode 100644
index 0000000..34aa3ca
--- /dev/null
+++ b/bench/bench_samplexy.jnl
@@ -0,0 +1,12 @@
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36     
+
+use coads_climatology
+
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
diff --git a/bench/bench_sort.jnl b/bench/bench_sort.jnl
new file mode 100644
index 0000000..05e8814
--- /dev/null
+++ b/bench/bench_sort.jnl
@@ -0,0 +1,22 @@
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+
+sh func/ext sort*
+sh func/ext sample*
+
+go bench_sorti.jnl
+
+go bench_sortj.jnl
+
+go bench_sortk.jnl
+
+go bench_sortl.jnl
+
+go bench_samplexy.jnl
+
+go bench_samplet_date.jnl
+
+
diff --git a/bench/bench_sorti.jnl b/bench/bench_sorti.jnl
new file mode 100644
index 0000000..662e7fa
--- /dev/null
+++ b/bench/bench_sorti.jnl
@@ -0,0 +1,36 @@
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+
+list sst
+
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+
+list tsorted_indices, tsorted_sst
+
+
+! test on 2-d data
+
+can region
+!set data coads_climatology
+set region/l=5
+
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
diff --git a/bench/bench_sorti_visual.jnl b/bench/bench_sorti_visual.jnl
new file mode 100644
index 0000000..4123ba6
--- /dev/null
+++ b/bench/bench_sorti_visual.jnl
@@ -0,0 +1,31 @@
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+
+
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+
+list sst
+
+let tsorted_indices = sorti( sst[i=61:66])
+let tsorted_sst = samplei(sst, tsorted_indices)
+
+list tsorted_indices, tsorted_sst
+
+
+! 
+
+can region
+!set data coads_climatology
+set region/l=5/y=0
+
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices)
+plot xsorted_sst
+
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
diff --git a/bench/bench_sortj.jnl b/bench/bench_sortj.jnl
new file mode 100644
index 0000000..e993970
--- /dev/null
+++ b/bench/bench_sortj.jnl
@@ -0,0 +1,37 @@
+
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+
+list sst
+
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+
+list tsorted_indices, tsorted_sst
+
+! test on 2-D data.
+
+can region
+!set data coads_climatology
+set region/l=5
+
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+
diff --git a/bench/bench_sortj_visual.jnl b/bench/bench_sortj_visual.jnl
new file mode 100644
index 0000000..a09779b
--- /dev/null
+++ b/bench/bench_sortj_visual.jnl
@@ -0,0 +1,35 @@
+
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+
+list sst
+
+let tsorted_indices = sortj( sst[j=65:70])
+let tsorted_sst = samplej(sst, tsorted_indices)
+
+list tsorted_indices, tsorted_sst
+
+! 
+
+can region
+!set data coads_climatology
+set region/l=5
+
+
+let ysorted_indices = sortj(sst)
+shade ysorted_indices
+
+set region/l=5/x=0
+let ysorted_sst = samplej(sst, ysorted_indices)
+plot ysorted_sst
+
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+
diff --git a/bench/bench_sortk.jnl b/bench/bench_sortk.jnl
new file mode 100644
index 0000000..d401724
--- /dev/null
+++ b/bench/bench_sortk.jnl
@@ -0,0 +1,32 @@
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK 
+!   see notes in Bugzilla under bug 1187.
+
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+
+
+can region
+use ocean_atlas_temp
+
+set region/i=70/j=90/l=1
+list temp
+
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+
+! this should bail out with indices out of range:
+
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+
diff --git a/bench/bench_sortk_visual.jnl b/bench/bench_sortk_visual.jnl
new file mode 100644
index 0000000..fee52a8
--- /dev/null
+++ b/bench/bench_sortk_visual.jnl
@@ -0,0 +1,30 @@
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+
+
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+
+
+set region/i=100/j=40/l=1
+set view left
+plot temp
+
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices)
+set view right
+plot zsorted_temp
+
+! this should bail out with indices out of range:
+
+let zsorted_indices = sortk(temp) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+
diff --git a/bench/bench_sortl.jnl b/bench/bench_sortl.jnl
new file mode 100644
index 0000000..65c4066
--- /dev/null
+++ b/bench/bench_sortl.jnl
@@ -0,0 +1,52 @@
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL 
+!                see notes in Bugzilla under bug 1187.
+
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+
+list sst
+list samplel(sst, {1,3,5})
+
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+
+list tsorted_indices, tsorted_sst
+
+! test sortt with data containing bad/missing data.
+
+can region 
+
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+
+let len = tsorted_wnd[l=@ngd]
+list len
+
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+
diff --git a/bench/bench_sortl_visual.jnl b/bench/bench_sortl_visual.jnl
new file mode 100644
index 0000000..28f0725
--- /dev/null
+++ b/bench/bench_sortl_visual.jnl
@@ -0,0 +1,40 @@
+
+
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+
+list sst
+list samplel(sst, {1,3,5})
+
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices)
+
+list tsorted_indices, tsorted_sst
+
+
+! test sortt with data containing bad/missing data.
+
+can region 
+
+! use  "/home/ja4/kobrien/FERRET/bench/coads_vwnd.cdf"
+use  coads_vwnd.cdf
+set region/i=90/j=65
+plot vwnd
+
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices)
+list tsorted_indices, tsorted_wnd
+
+let len = tsorted_wnd[l=@ngd]
+list len
+
+!  This illustrates a problem with BAIL OUT of the function with
+!  out-of-range indices:
+
+ let tsorted_indices = sortl(vwnd) + 90
+ let tsorted_wnd = samplel(vwnd, tsorted_indices)
+ list tsorted_indices, tsorted_wnd
+
diff --git a/bench/bench_storage.jnl b/bench/bench_storage.jnl
new file mode 100644
index 0000000..0c947f1
--- /dev/null
+++ b/bench/bench_storage.jnl
@@ -0,0 +1,24 @@
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+
+set mode ignore_errors
+
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+
+can region
+set region/x=140w/y=10n/k=1
+list a
+
+can region
+
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+
+set mode/last ignore_errors
+
diff --git a/bench/bench_storage_visual.jnl b/bench/bench_storage_visual.jnl
new file mode 100644
index 0000000..93ca233
--- /dev/null
+++ b/bench/bench_storage_visual.jnl
@@ -0,0 +1,27 @@
+set mode ignore_errors
+
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5
+shade a
+
+can region
+set region/x=140w/y=10n/k=1
+plot a
+
+can region
+shade a                                   ! DELIBERATE ERROR
+
+set region/y=0:40n/x=150e
+shade a[k=1]
+
+can region
+shade a[k=1:2 at ave,l=1:5 at ave]
+
+let b = temp[x=140e:60w]
+let c = storage(b)
+shade c[k=1,l=5]
+
+shade c[x=20:380,t=15-jan-1983]          ! DELIBERATE ERROR
+
+set mode/last ignore_errors
diff --git a/bench/bench_subtract.jnl b/bench/bench_subtract.jnl
new file mode 100644
index 0000000..183e21e
--- /dev/null
+++ b/bench/bench_subtract.jnl
@@ -0,0 +1,42 @@
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+
+set mode ignore_errors
+
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+list/x=150:160/y=0 subtract(a,26)
+
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)         
+
+set mode/last ignore_errors
diff --git a/bench/bench_subtract_visual.jnl b/bench/bench_subtract_visual.jnl
new file mode 100644
index 0000000..95786a9
--- /dev/null
+++ b/bench/bench_subtract_visual.jnl
@@ -0,0 +1,46 @@
+set mode ignore_errors
+
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+shade a
+let b = oatemp- sst
+shade a - b
+
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+shade subtract(a,b)
+
+let a = oatemp[x=180]
+let b = sst[x=180]
+shade subtract(a,b)
+
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+plot subtract(a,b)          ! DELIBERATE ERROR
+shade subtract(a,b)
+
+can region
+let a = sst[l=1]
+let b = 26
+shade subtract(a,b)
+shade subtract(a,26)
+
+let b = sst[x=180,y=0,l=@ave]
+shade subtract(a,b)         
+
+can region
+let a = sst[l=1]
+let b = 20
+shade subtract(a,b)
+
+let b = sst[l=@ave]
+shade subtract(a,b)
+plot subtract(a,b)          ! DELIBERATE ERROR
+
+set mode/last ignore_errors
diff --git a/bench/bench_v5d.jnl b/bench/bench_v5d.jnl
new file mode 100644
index 0000000..994308e
--- /dev/null
+++ b/bench/bench_v5d.jnl
@@ -0,0 +1,19 @@
+! benchmark for Vis5D external function
+! 5/99 ACM
+
+
+!  Write data to a Vis5D file.  The first argument to the 
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+
+can region
+ set mode ignore_error
+
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+
+set mode/last ignore_error
+
diff --git a/bench/bn301_mem_mgmt.jnl b/bench/bn301_mem_mgmt.jnl
new file mode 100644
index 0000000..5b7571a
--- /dev/null
+++ b/bench/bn301_mem_mgmt.jnl
@@ -0,0 +1,58 @@
+! bn301_mem_mgmt.jnl
+! test a complex calculation that exercises the memory manager
+
+set list/precision=8
+set data gtaa014_demo
+set region/k=1:27/i=1:160/j=4:97
+
+define grid/x=temp/y=temp/t=temp gtemp2D
+
+let t1 = temp - temp[z=@ave]
+let t2 = u[g=temp]-u[g=temp,z=@ave]
+let t3 = v[g=temp]-v[g=temp,z=@ave]
+let t4 = salt - salt[z=@ave]
+let t5 = taux[g=gtemp2d] - taux[g=gtemp2d]
+let t6 = tauy[g=gtemp2d] - tauy[g=gtemp2d]
+let tbig = temp + t1 + t2 + t3 + t4 + t5 + t6
+
+! trial 1 - standard DESPARATE mode
+cancel memory/all
+set mode desparate:80000
+sp date
+list temp[x=@ave,y=@ave,z=@ave], tbig[x=@ave,y=@ave,z=@ave]
+sp date
+
+! trial 2 - stingy use of memory
+cancel memory/all
+set mode desparate:5000
+sp date
+list temp[x=@ave,y=@ave,z=@ave], tbig[x=@ave,y=@ave,z=@ave]
+sp date
+
+! trial 3 - overly generous use of memory - fragment, crash, and burn
+! ( large memory version sails through this 1/94)
+cancel memory/all
+set mode desparate:200000
+set mode ignore
+sp date
+list temp[x=@ave,y=@ave,z=@ave], tbig[x=@ave,y=@ave,z=@ave]
+sp date
+
+
+! trial 4 - memory overload for BIG memory FERRET, too (1/27/94)
+set region/x=130e:80w/y=20s:40n
+define axis/x=130e:80w:.1/unit=long xfine
+define axis/y=30s:50n:.1/unit=lat yfine
+define grid/like=temp/x=xfine/y=yfine gf3d
+define grid/like=taux/x=xfine/y=yfine gf2d
+let tbigger = temp[g=gf3d] + t1[g=gf3d] + t2[g=gf3d] + t3[g=gf3d] + t4[g=gf3d] + t5[g=gf2d] + t6[g=gf2d]
+cancel memory/all
+set mode desparate:200000
+sp date
+list temp[x=@ave,y=@ave,z=@ave], tbigger[x=@ave,y=@ave,z=@ave]
+show memory/free
+sp date
+cancel mode ignore
+
+! clean up
+set list/precision=6
diff --git a/bench/bn491_bug_fixes.jnl b/bench/bn491_bug_fixes.jnl
new file mode 100644
index 0000000..4aac47e
--- /dev/null
+++ b/bench/bn491_bug_fixes.jnl
@@ -0,0 +1,54 @@
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+
+set mode/last verify
+can viewport
+can win/all
+set window 1
+
+!netcdf write error 
+GO err490_cdf_childax
+
+! command parser
+GO bn_reset
+GO err490_command_parser
+
+! tilde error
+!GO bn_reset
+!GO err490_tilde
+
+
+!repeat error
+GO bn_reset
+GO err490_repeat_first_echo
+
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+
+! l=@ave compression failure
+GO bn_reset
+GO err490_l_ave.jnl 
+
+! neg time axis grid failure
+GO bn_reset
+GO err490_neg_time_show_grid.jnl
+
+!explicit limit problem
+GO bn_reset
+GO err491_explicit_limits.jnl
+
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+GO err491_asn.jnl
+
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+GO err491_attrib_dp.jnl
diff --git a/bench/bn500_bug_fixes.jnl b/bench/bn500_bug_fixes.jnl
new file mode 100644
index 0000000..10b7621
--- /dev/null
+++ b/bench/bn500_bug_fixes.jnl
@@ -0,0 +1,44 @@
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+
+GO bn_reset
+GO err491_RESHAPE_ctx.jnl
+
+GO bn_reset
+GO err491_delete_child_var.jnl
+
+GO bn_reset
+GO err491_dp_time_write.jnl
+
+GO bn_reset
+GO err491_gmax.jnl
+
+GO bn_reset
+GO err491_grid_from_name.jnl
+
+GO bn_reset
+GO err491_let_d.jnl
+
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+
+GO bn_reset
+GO err491_sh_var_templates.jnl
+
+GO bn_reset
+GO err491_single_char_replace.jnl
+
+GO bn_reset
+GO err491_spawn_quotes.jnl
+
+GO bn_reset
+GO err491_time_regridding.jnl
+
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+GO err491_unknown_function.jnl
+
+! *kob* added 6/11/1999 
+GO bn_reset
+GO err500_IF_THEN_ELSE_quote.jnl
diff --git a/bench/bn541_bug_fixes.jnl b/bench/bn541_bug_fixes.jnl
new file mode 100644
index 0000000..928d41d
--- /dev/null
+++ b/bench/bn541_bug_fixes.jnl
@@ -0,0 +1,75 @@
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+
+
+!missing vertices in polygon call
+GO bn_reset
+GO err540_polymissing
+
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+
+! formatting axis label numbers
+GO bn_reset
+GO err540_ill_format.jnl
+
+
+! variable permutation in netCDF writes
+GO bn_reset
+GO err540_write_order
+
+!@AVE error when plotting unlike grids together
+GO bn_reset
+GO err540_ax_ave
+
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+GO err540_axset
+
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+GO err540_vs_dash
+
+!overlay on polygon plots
+GO bn_reset
+GO err540_poly_overlay
+
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+GO err540_axis_symbols
+
+!nested repeat loops and parsing parentheses
+GO bn_reset
+GO err540_parse_repeat
+
+! appending a scalar to NetCDF file
+GO bn_reset
+GO err540_cd_use_recdim
+
+!missing data in xpts,ypts sample points wasnt checked 
+go bn_reset
+GO err540_samplexy_missing
+
+! test the fixed delta stride bug
+go bn_reset
+GO err540_strides_rev.jnl
+
+! unknown data type for clauses with constants only
+go bn_reset
+GO err540_data_type.jnl
+
+! gridding scattered points to modulo axis had bug
+go bn_reset
+GO err540_modscat.jnl
+
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+GO err540_use.jnl
diff --git a/bench/bn542_bug_fixes.jnl b/bench/bn542_bug_fixes.jnl
new file mode 100644
index 0000000..f989bba
--- /dev/null
+++ b/bench/bn542_bug_fixes.jnl
@@ -0,0 +1,31 @@
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+
+! Interior tics disappear on FILL plots
+GO bn_reset
+GO err541_fill_tics
+
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+GO err541_non_gregorian
+
+
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+GO err541_string4d
+
+
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+GO err541_cancel_axes
+
+
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+! GO err541_date_delim
+
diff --git a/bench/bn550_bug_fixes.jnl b/bench/bn550_bug_fixes.jnl
new file mode 100644
index 0000000..1c30d4e
--- /dev/null
+++ b/bench/bn550_bug_fixes.jnl
@@ -0,0 +1,9 @@
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+
+! Polygon/overlay calendar axis bug
+GO bn_reset
+GO err542_poly_over_calendar
+
diff --git a/bench/bn551_bug_fixes.jnl b/bench/bn551_bug_fixes.jnl
new file mode 100644
index 0000000..72304e6
--- /dev/null
+++ b/bench/bn551_bug_fixes.jnl
@@ -0,0 +1,36 @@
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+
+go bn_reset
+GO err550_view_axes_fill.jnl
+
+
+! position on page was incorrect, of first viewport plotted when 
+! defined as a VIEW/AXES viewport.
+go bn_reset
+GO err550_view_axes_position.jnl
+
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+GO err550_shade_limits.jnl
+
+! Redefining an axis with a new calendar definition
+go bn_reset
+GO err550_redefine_calendar_axis.jnl
+
+! Bug in defining axis from an expression.
+go bn_reset
+GO err550_define_axis_expression.jnl
+
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+GO err550_nc_seconds.jnl
+
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+GO err550_dots_thickpens.jnl
diff --git a/bench/bn552_bug_fixes.jnl b/bench/bn552_bug_fixes.jnl
new file mode 100644
index 0000000..27e6d5c
--- /dev/null
+++ b/bench/bn552_bug_fixes.jnl
@@ -0,0 +1,55 @@
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+GO err551_axes_set.jnl
+
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+GO err551_num_levels.jnl
+
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+GO err551_invalid_calendar.jnl
+
+! String bug fixes *kob*
+GO bn_reset
+GO err551_strings.jnl
+
+! 2-D @AVE bug fix
+GO bn_reset
+GO err551_2dave.jnl
+
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+GO err551_return_message.jnl
+
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+GO err551_streamread_directory.jnl
+
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+GO err551_regrid_undef_grid.jnl
+
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+GO err551_repeat_sym.jnl
+
+! data from nc file with time axis modulo=value, when regridded to 
+! another time axis, some times have missing data 
+GO bn_reset
+GO err551_modulo_nc_regrid.jnl
+
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+GO err551_fft_freqaxis.jnl
+
+! No error message on request for time on bad time axis
+GO bn_reset
+GO err551_no_taxis_errmsg.jnl
diff --git a/bench/bn553_bug_fixes.jnl b/bench/bn553_bug_fixes.jnl
new file mode 100644
index 0000000..b41752d
--- /dev/null
+++ b/bench/bn553_bug_fixes.jnl
@@ -0,0 +1,18 @@
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+
+! Make sure numeric filenames works
+GO bn_reset
+GO err553_numeric_filename.jnl
+
+
+! Make sure long string variables work
+GO bn_reset
+GO err553_long_string_var_name.jnl
+
+
+! Fixes for colorbar key labelling
+GO bn_reset
+GO err551_colorkey.jnl
diff --git a/bench/bn554_bug_fixes.jnl b/bench/bn554_bug_fixes.jnl
new file mode 100644
index 0000000..067af60
--- /dev/null
+++ b/bench/bn554_bug_fixes.jnl
@@ -0,0 +1,72 @@
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+
+! Test use of longer strings in region names
+GO bn_reset
+GO err553_regionname_lengths.jnl
+
+
+! Reqests for data at times outside range of data
+GO bn_reset
+GO err553_timeregion.jnl
+
+! Contour plot on fine grid has precision problems
+GO bn_reset
+GO err553_contour_fine_grid.jnl
+
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+GO err553_symsize.jnl
+
+! test labels on shade keys; consistent number of digits set by 5th shakey arg 
+GO bn_reset
+GO err553_shakey_labels.jnl
+
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+GO err553_xaxis_nsmtc.jnl
+
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+GO err553_year_yr.jnl
+
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+GO err553_stride_def_grid.jnl
+
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+GO err553_axis_too_long.jnl
+
+! Under linux, some shade and fill plots with /LEVELS=c had a 
+! non-centered shade key
+GO bn_reset
+GO err553_lev_c.jnl
+
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+GO err553_lon_ax_0_label.jnl
+
+! Errors listing string and numeric data together
+GO bn_reset
+GO err553_list_string_numeric.jnl
+
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+GO err553_set_axis_depth.jnl
+
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+GO err553_symbol_lev.jnl
+
+! Fixes for modulo striding bugs
+GO bn_reset
+GO err553_stride_modulo.jnl
+
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+GO err553_list_width.jnl
diff --git a/bench/bn570_bug_fixes.jnl b/bench/bn570_bug_fixes.jnl
new file mode 100644
index 0000000..b8ab2a6
--- /dev/null
+++ b/bench/bn570_bug_fixes.jnl
@@ -0,0 +1,38 @@
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+
+! Test use of automatic levels in SHADE
+GO bn_reset
+GO err560_shade_levels.jnl
+
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+GO err560_mc_irreg_t.jnl
+
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.     
+GO bn_reset
+GO err560_shade_noleap.jnl
+
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value 
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+GO err560_regridding_gaps.jnl
+
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year; 
+! bug in drawing the time axis.
+GO bn_reset
+GO err560_leap_years.jnl
+
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+GO err560_century
diff --git a/bench/bn580_bug_fixes.jnl b/bench/bn580_bug_fixes.jnl
new file mode 100644
index 0000000..a6cafcc
--- /dev/null
+++ b/bench/bn580_bug_fixes.jnl
@@ -0,0 +1,112 @@
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+GO err570_singlecolor.jnl
+
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+GO err570_shakeylab.jnl
+
+! Null input gives wierd error message
+GO bn_reset
+GO err570_null_symbol.jnl
+
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+GO err570_parse_labelcommand.jnl
+
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+GO err570_compressk_by.jnl
+
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+GO err570_long_label.jnl
+
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+GO err570_ppl_poly.jnl
+
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma 
+GO bn_reset
+GO err570_list_tab_coords.jnl
+
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+GO err570_many_variables.jnl
+
+
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+GO err570_cnnn_multiline.jnl
+
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+GO err570_fine_grid_list.jnl
+
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+GO err570_hlimit_onepoint
+
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+GO err570_index111.jnl
+
+
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL 
+! crashed on trying to format value for the output buffer.   
+GO bn_reset
+GO err570_sh_dat_nan.jnl
+
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset 
+GO err570_time_range.jnl
+
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+GO err570_poly_over_julian.jnl
+
+! Fix for bug 1077; return ERROR rather than NOTE when 
+! exiting from a script where query/ignore or other coached 
+! string substitution returns the user-given error message
+GO bn_reset
+GO err570_coaching hello
+
+! Fix for bug 485: say ($0) in a script should return the 
+! name of the script
+GO bn_reset
+GO err570_dollar_zero.jnl
+
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+GO err570_illegal_stride.jnl
+
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+GO err570_thick_colors.jnl 
+
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+GO err570_digit_filename.jnl
+
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+GO err570_dods_url_label.jnl
+
+
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+GO err570_keylabels.jnl
+
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+GO err570_poly_lonlat_axis.jnl
diff --git a/bench/bn581_bug_fixes.jnl b/bench/bn581_bug_fixes.jnl
new file mode 100644
index 0000000..19d136b
--- /dev/null
+++ b/bench/bn581_bug_fixes.jnl
@@ -0,0 +1,87 @@
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+GO err580_irreg_bounds.jnl
+
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+GO err580_cartesian_depth.jnl
+
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+GO err580_long_title.jnl
+
+! Bug 1180 Allow "use filename.des" 
+GO bn_reset
+GO err580_use_des.jnl
+
+
+! Bug 1180 Allow "use filename.des" 
+GO bn_reset
+GO err580_use_des.jnl
+
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+GO err580_long_dsettitle.jnl
+
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+GO err580_long_veckey.jnl
+
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+GO err580_cal360_region.jnl
+
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+GO err580_def_tax_norange.jnl
+
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+GO err580_cdb.jnl
+
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+GO err580_def_view_axes.jnl
+
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+GO err580_lev_del.jnl
+
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+GO err580_strfloat_errors.jnl
+
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+GO err580_arg_case.jnl
+
+
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+GO err580_cdc_timeaxis.jnl
+
+
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+GO err580_show_axis_t.jnl
+
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+GO err581_nlev.jnl
+
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+GO err581_vs_poly_axis.jnl  
+
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl  
+
diff --git a/bench/bn600_bug_fixes.jnl b/bench/bn600_bug_fixes.jnl
new file mode 100644
index 0000000..a3868b9
--- /dev/null
+++ b/bench/bn600_bug_fixes.jnl
@@ -0,0 +1,97 @@
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+GO err581_hlim_axislab.jnl
+
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+GO err581_list_stray_chars.jnl
+
+! pattern matching for SHO FUNC failed to match all EF's 
+GO bn_reset
+GO err581_sho_func_pattern_match.jnl
+
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+GO err581_subspanx_fill_bug.jnl
+
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+GO err581_use_bounds.jnl
+
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+GO err581_des_scale.jnl 
+
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+GO err581_contour_zero_lev.jnl
+
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+GO err581_shakey_inf.jnl
+
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+GO err581_if_conditional.jnl
+
+! Bug 899 
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+GO err581_illegal_trans.jnl
+
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+GO err581_missing_scale_off.jnl
+
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv  
+GO bn_reset
+GO err581_cal_dates_output.jnl
+
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar 
+GO bn_reset
+GO err581_noleap_mod.jnl
+
+
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+GO err581_cancel_data.jnl
+
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+GO err581_since_units.jnl
+
+
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+GO err581_exp_spaces.jnl
+
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+GO err581_command_cx.jnl
+
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+GO err581_define_1pt_bounds.jnl
+
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+GO err581_strrindex.jnl
+
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+GO err581_poly_rev.jnl
+
+
diff --git a/bench/bn601_bug_fixes.jnl b/bench/bn601_bug_fixes.jnl
new file mode 100644
index 0000000..2f37d37
--- /dev/null
+++ b/bench/bn601_bug_fixes.jnl
@@ -0,0 +1,98 @@
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+GO err600_long_bounds_name
+
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+GO err600_check_bounds_regular.jnl
+
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+GO err600_long_symbol_string.jnl
+
+! Global missing-value flag for dataset was not initialized and so was 
+! set to 0 when there was no global attribute in the file 
+! bug 1445
+GO bn_reset
+GO err600_missing_flag.jnl
+
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+GO err600_returnsize.jnl
+
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets 
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+GO err600_if_comments_tab.jnl
+
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+GO err600_set_var_title.jnl
+
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+GO err600_var_label.jnl
+
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+GO err600_upcase.jnl
+
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute 
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+GO err600_let_d.jnl
+
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+GO err600_nc_des_order.jnl
+
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+GO err600_reset_redefine_axis.jnl
+
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute 
+! orig_file_axname keeps the input name. 
+GO bn_reset
+GO err600_ferret_axis_names.jnl
+
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+GO err600_tab_comma_missingdat.jnl
+
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+GO err600_vec_aspect.jnl
+
+! err600_save_two.jnl 
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+GO err600_save_two.jnl 
+
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+GO err600_nc_des_order.jnl
diff --git a/bench/bn602_bug_fixes.jnl b/bench/bn602_bug_fixes.jnl
new file mode 100644
index 0000000..c6d7ea1
--- /dev/null
+++ b/bench/bn602_bug_fixes.jnl
@@ -0,0 +1,32 @@
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+GO err601_sho_ax_xml_calendar.jnl
+
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+GO err601_index_111.jnl
+
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+GO err601_irregular_axis.jnl
+
+
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+GO err601_check_missing_3arg.jnl
+
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+GO err601_missing_string_element.jnl
+
diff --git a/bench/bn603_bug_fixes.jnl b/bench/bn603_bug_fixes.jnl
new file mode 100644
index 0000000..1fbf235
--- /dev/null
+++ b/bench/bn603_bug_fixes.jnl
@@ -0,0 +1,18 @@
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+
+! Fix for bug 904 
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+GO err602_shade_line_lev.jnl
+
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+GO err602_curvi_modulo_cut
+
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+GO err602_list_prec
diff --git a/bench/bn605_bug_fixes.jnl b/bench/bn605_bug_fixes.jnl
new file mode 100644
index 0000000..6d0d561
--- /dev/null
+++ b/bench/bn605_bug_fixes.jnl
@@ -0,0 +1,11 @@
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+GO err604_irreg_axis.jnl
+
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+GO err605_show_func.jnl
diff --git a/bench/bn608_bug_fixes.jnl b/bench/bn608_bug_fixes.jnl
new file mode 100644
index 0000000..ece8ad2
--- /dev/null
+++ b/bench/bn608_bug_fixes.jnl
@@ -0,0 +1,19 @@
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+GO err607_show_var_xml
+
+! err607_set_new_history_att
+GO bn_reset
+GO err607_set_new_history_att
+
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+GO err607_axis_minmax_syms
+
+! Error message for too many contour levels requested
+GO bn_reset
+GO err607_lev_errmsg
diff --git a/bench/bn611_bug_fixes.jnl b/bench/bn611_bug_fixes.jnl
new file mode 100644
index 0000000..8d613db
--- /dev/null
+++ b/bench/bn611_bug_fixes.jnl
@@ -0,0 +1,33 @@
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+
+GO bn_reset
+GO err61_write_bounds
+
+GO bn_reset
+GO err61_poly_shade_over_noaxes
+
+GO bn_reset
+GO err61_context_scalar_strings
+
+GO bn_reset
+GO err61_exit_script
+
+GO bn_reset
+GO err61_new_attr_on_axis
+
+GO bn_reset
+GO bn_varcontext_attributes
+
+GO bn_reset 
+GO err61_show_dat_var_xml
+
+GO bn_reset 
+GO err61_360_calendar
+
+GO bn_reset 
+GO err611_exit_if.jnl
+
+GO bn_reset 
+GO err611_save_irreg.jnl
+
diff --git a/bench/bn614_bug_fixes.jnl b/bench/bn614_bug_fixes.jnl
new file mode 100644
index 0000000..d04fbb1
--- /dev/null
+++ b/bench/bn614_bug_fixes.jnl
@@ -0,0 +1,60 @@
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+
+GO bn_reset
+GO err611_axislab
+
+GO bn_reset 
+GO err61_360_calendar
+
+GO bn_reset 
+GO err611_exit_if.jnl
+
+GO bn_reset 
+GO err611_save_irreg.jnl
+
+GO bn_reset 
+GO err611_wrong_fineaxis_range
+
+GO bn_reset
+GO err611_digit_filename
+
+GO bn_reset
+GO err611_parse_semicolon
+
+GO bn_reset
+GO err611_ov_ax
+
+GO bn_reset
+GO err611_context_after_error
+
+GO bn_reset
+GO err611_isize_gc_fcns
+
+GO bn_reset
+GO err611_return_precision
+
+GO bn_reset
+GO err611_set_var_ez
+
+GO bn_reset
+GO err611_convert_missing_type
+
+GO bn_reset
+GO err611_shade_fill_levs
+
+GO bn_reset
+GO err611_set_uvar_outtyp
+
+GO bn_reset
+GO err611_save_from_desc
+
+GO bn_reset
+GO err611_irregular_axis
+
+GO bn_reset
+GO err611_ef_string_result
+
+GO bn_reset
+GO err61_contour_subspan_reps
+
diff --git a/bench/bn61_bug_fixes.jnl b/bench/bn61_bug_fixes.jnl
new file mode 100644
index 0000000..10f88d1
--- /dev/null
+++ b/bench/bn61_bug_fixes.jnl
@@ -0,0 +1,13 @@
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+
+! Fix for Bug 1556: 
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+GO err608_bug1556
+
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+GO err608_precision_neg_numbers
diff --git a/bench/bn62_bug_fixes.jnl b/bench/bn62_bug_fixes.jnl
new file mode 100644
index 0000000..f502192
--- /dev/null
+++ b/bench/bn62_bug_fixes.jnl
@@ -0,0 +1,8 @@
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+
+GO bn_reset
+GO err618_julday.jnl
+
+GO bn_reset
+GO err611_polygons.jnl
diff --git a/bench/bn63_bug_fixes.jnl b/bench/bn63_bug_fixes.jnl
new file mode 100644
index 0000000..38925a9
--- /dev/null
+++ b/bench/bn63_bug_fixes.jnl
@@ -0,0 +1,49 @@
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+
+GO bn_reset
+GO err62_string_write_nc
+
+GO bn_reset
+GO err62_levset
+
+GO bn_reset
+GO err62_thick_tic_time_axis
+
+GO bn_reset
+GO err62_reset_after_inf
+
+GO bn_reset
+GO err62_reversed_up
+
+GO bn_reset
+GO err62_samplexy
+
+GO bn_reset
+GO err62_one_point_bounds
+
+GO bn_reset
+GO err62_cos_lat_uncentered
+
+GO bn_reset
+GO err62_if_inside_repeat
+
+GO bn_reset
+GO err62_title_curvi_plot
+
+GO bn_reset
+go err62_save_missingcoordvar
+
+GO bn_reset
+GO err62_contourbug
+
+GO bn_reset
+GO err62_append_irreg_to_reg
+
+GO bn_reset
+GO err62_axis_stride_off
+
+
+GO bn_reset
+GO err62_compound_string_conditional
+
diff --git a/bench/bn64_bug_fixes.jnl b/bench/bn64_bug_fixes.jnl
new file mode 100644
index 0000000..cc3e130
--- /dev/null
+++ b/bench/bn64_bug_fixes.jnl
@@ -0,0 +1,14 @@
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+
+GO bn_reset
+GO err63_days1900toydmhms
+
+GO bn_reset
+GO err63_log_vaxis
+
+GO bn_reset
+GO err63_delim_E.jnl
diff --git a/bench/bn65_bug_fixes.jnl b/bench/bn65_bug_fixes.jnl
new file mode 100644
index 0000000..6438168
--- /dev/null
+++ b/bench/bn65_bug_fixes.jnl
@@ -0,0 +1,26 @@
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+
+GO bn_reset
+GO err64_very_small_latlon
+
+GO bn_reset
+GO err64_packed_data
+
+GO bn_reset
+GO bn_repl_9999999
+
+GO bn_reset
+GO err64_shakey_missingdata
+
+GO bn_reset
+GO err64_return_precision
+
+GO bn_reset
+GO err64_parse_equals
+
+GO bn_reset
+GO err64_regrid_noleap
+
+GO bn_reset
+GO err64_polymark_over_calendar
diff --git a/bench/bn663_bug_fixes.jnl b/bench/bn663_bug_fixes.jnl
new file mode 100644
index 0000000..b953fc6
--- /dev/null
+++ b/bench/bn663_bug_fixes.jnl
@@ -0,0 +1,9 @@
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+
+
+GO bn_reset
+GO err65_dots_in_dashes.jnl
+
+GO bn_reset
+GO err66_all_missing_lev_v.jnl
diff --git a/bench/bn665_bug_fixes.jnl b/bench/bn665_bug_fixes.jnl
new file mode 100644
index 0000000..a8023ff
--- /dev/null
+++ b/bench/bn665_bug_fixes.jnl
@@ -0,0 +1,17 @@
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+
+GO bn_reset
+GO err664_xml_keep_case
+
+GO bn_reset
+GO err664_xml_one_point_axis
+
+GO bn_reset
+GO err65_read_epic_cdf
+
+GO bn_reset
+GO err664_tax_fcns
+
diff --git a/bench/bn66_bug_fixes.jnl b/bench/bn66_bug_fixes.jnl
new file mode 100644
index 0000000..7caf025
--- /dev/null
+++ b/bench/bn66_bug_fixes.jnl
@@ -0,0 +1,6 @@
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+
+
+GO bn_reset
+GO err65_averages.jnl
diff --git a/bench/bn671_bug_fixes.jnl b/bench/bn671_bug_fixes.jnl
new file mode 100644
index 0000000..9407975
--- /dev/null
+++ b/bench/bn671_bug_fixes.jnl
@@ -0,0 +1,18 @@
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+
+GO bn_reset
+GO err67_tax_modtime
+
+GO bn_reset
+GO err67_save_append_open
+
+GO bn_reset
+GO err67_regridding_dyn
+
+GO bn_reset
+GO err67_reverse_bounds
+
+GO bn_reset
+GO err67_nrst_trans
diff --git a/bench/bn67_bug_fixes.jnl b/bench/bn67_bug_fixes.jnl
new file mode 100644
index 0000000..a639bdc
--- /dev/null
+++ b/bench/bn67_bug_fixes.jnl
@@ -0,0 +1,37 @@
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+
+GO bn_reset
+GO err665_sum_4d_labels
+
+GO bn_reset
+GO err665_din
+
+GO bn_reset
+GO err665_centered_lev
+
+GO bn_reset
+GO err665_hours_since_T
+
+GO bn_reset
+GO err667_att_too_long
+
+GO bn_reset
+GO err667_mode_desperate
+
+GO bn_reset
+GO err667_dup_axnames
+
+GO bn_reset
+GO err667_string_if
+
+GO bn_reset
+GO err667_show_var_twice
+
+GO bn_reset
+GO err667_5d_netcdf
+
+GO bn_reset
+GO err67_save_append_open
+
diff --git a/bench/bn682_bug_fixes.jnl b/bench/bn682_bug_fixes.jnl
new file mode 100644
index 0000000..d417e4f
--- /dev/null
+++ b/bench/bn682_bug_fixes.jnl
@@ -0,0 +1,7 @@
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+
+GO bn_reset
+GO err681_dims_direction
+
diff --git a/bench/bn683_bug_fixes.jnl b/bench/bn683_bug_fixes.jnl
new file mode 100644
index 0000000..b910e7c
--- /dev/null
+++ b/bench/bn683_bug_fixes.jnl
@@ -0,0 +1,27 @@
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+
+GO bn_reset
+GO err682_shrink_axlab
+
+GO bn_reset
+GO err682_xact_high_prec
+
+GO bn_reset
+GO err682_if_yes_exit
+
+GO bn_reset
+GO err682_use_no_quotes
+
+GO bn_reset
+GO err682_axis_no_clue
+
+GO bn_reset
+GO err682_grid_merge
+
+GO bn_reset
+GO err682_scale_no_offset
+
+GO bn_reset
+GO err682_append_packed
diff --git a/bench/bn685_bug_fixes.jnl b/bench/bn685_bug_fixes.jnl
new file mode 100644
index 0000000..38b2e1c
--- /dev/null
+++ b/bench/bn685_bug_fixes.jnl
@@ -0,0 +1,63 @@
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+
+GO bn_reset
+GO err684_label_quotes
+
+GO bn_reset
+GO err684_context_shape
+
+GO bn_reset
+GO err684_tax_fcns
+
+GO bn_reset
+GO err684_save_subset
+
+GO bn_reset
+GO err684_save_subset
+
+GO bn_reset
+GO err684_line_plot_zero
+
+GO bn_reset
+GO err684_delimited_precision
+
+GO bn_reset
+GO err6842_context_shape
+
+GO bn_reset
+GO err684_evnt_z
+
+GO bn_reset
+GO err684_save_expression
+
+GO bn_reset
+GO err684_degC_axlab
+
+GO bn_reset
+GO err684_null_stringwrite
+
+GO bn_reset
+GO err684_FillValue_xml
+
+GO bn_reset
+GO err684_axticlab
+
+GO bn_reset
+GO err684_dotstart
+
+GO bn_reset
+GO err684_vfine_to_coarse
+
+GO bn_reset
+GO err684_repeated_coordindates
+
+GO bn_reset
+GO err684_packed_output
+
+GO bn_reset
+GO err684_string_dim_name
+
+GO bn_reset
+GO err684_define_grid
diff --git a/bench/bn686_bug_fixes.jnl b/bench/bn686_bug_fixes.jnl
new file mode 100644
index 0000000..9565414
--- /dev/null
+++ b/bench/bn686_bug_fixes.jnl
@@ -0,0 +1,31 @@
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+
+GO bn_reset
+GO err685_ribbon_by_val
+
+GO bn_reset
+GO err685_ppl_palette
+
+GO bn_reset
+GO err685_show_grid_e
+
+GO bn_reset
+GO err685_lowercaseAxis
+
+GO bn_reset
+GO err685_redefine_uvar_att
+
+GO bn_reset
+GO err685_use_no_extension
+
+GO bn_reset
+GO err685_samplexy
+
+GO bn_reset
+GO err685_shade_set
+
+GO bn_reset
+GO err686_individual_levels
+
diff --git a/bench/bn68_bug_fixes.jnl b/bench/bn68_bug_fixes.jnl
new file mode 100644
index 0000000..d57d2a6
--- /dev/null
+++ b/bench/bn68_bug_fixes.jnl
@@ -0,0 +1,35 @@
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+! 
+GO bn_reset
+GO err672_stray_line
+
+GO bn_reset
+GO err672_tax_functions_prec
+
+GO bn_reset
+GO err672_subscr_precision
+
+GO bn_reset
+GO err672_vert_axislabel
+
+GO bn_reset
+GO err672_axis_label_prec
+
+GO bn_reset
+GO err672_long_show_axis
+
+GO bn_reset
+GO err672_axis_order
+
+GO bn_reset 
+GO err672_runoff_page
+
+GO bn_reset 
+GO err672_samplexy_modulo
+
+GO bn_reset
+GO err672_varnames
+
+GO bn_reset
+GO err672_dset_cx
diff --git a/bench/bn69_bug_fixes.jnl b/bench/bn69_bug_fixes.jnl
new file mode 100644
index 0000000..9a40ca0
--- /dev/null
+++ b/bench/bn69_bug_fixes.jnl
@@ -0,0 +1,24 @@
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+
+GO bn_reset
+GO err686_long_list_varnames
+
+GO bn_reset
+GO err686_faxis_label
+
+GO bn_reset
+GO err686_dup_axnames
+
+GO bn_reset
+GO err686_cancel_invalid_var
+
+GO bn_reset
+GO err686_redef_ascii_att
+
+GO bn_reset
+GO err686_sho_nonexist_att
+
+GO bn_reset
+GO err686_set_var_name
diff --git a/bench/bn_6d_lab_mode.jnl b/bench/bn_6d_lab_mode.jnl
new file mode 100644
index 0000000..2412844
--- /dev/null
+++ b/bench/bn_6d_lab_mode.jnl
@@ -0,0 +1,38 @@
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+
+! Mode affects output of SHOW
+
+set mode 6d_lab  ! this is the default setting
+show data
+cancel mode 6d_lab
+show data
+
+! Mode affects output of SHOW GRID 
+
+set mode 6d_lab
+show grid temp
+cancel mode 6d_lab
+show grid temp
+
+! Mode affects output of STAT
+
+set mode 6d_lab
+stat temp
+cancel mode 6d_lab
+stat temp
+
+! Mode affects diagnostic output
+
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+can mode diag
+
+! restore default setting
+set mode 6d_lab
diff --git a/bench/bn_NaN_note.jnl b/bench/bn_NaN_note.jnl
new file mode 100644
index 0000000..6c9e4f8
--- /dev/null
+++ b/bench/bn_NaN_note.jnl
@@ -0,0 +1,15 @@
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+SET MODE diag
+USE test0
+CANCEL MODE diag
diff --git a/bench/bn_abstract_axis_names.jnl b/bench/bn_abstract_axis_names.jnl
new file mode 100644
index 0000000..87d3f45
--- /dev/null
+++ b/bench/bn_abstract_axis_names.jnl
@@ -0,0 +1,110 @@
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+! 
+! Write and read datafiles with no clues about axis orientation from 
+! the units or axis name.  Getting the axis direction depends on the AXIS 
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX' 
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+
+show axis horiz
+show axis the
+show axis xxx
+show axis long
+
+! Write files with different combinations of axes.
+
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+
+
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+
+use confuse_xz.nc 
+sh grid r
+can data 1
+
+use confuse_yz.nc 
+sh grid s
+can data 1
+
+use confuse_yt.nc 
+sh grid u 
+can data 1
+
+use confuse_yzt.nc 
+sh grid v
+can data 1
+
+
+! Define axes with meaningless axis names.
+
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+
+show axis aaa
+show axis bbb
+show axis ccc
+show axis ddd
+
+! Write files with different combinations of axes.
+
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+
+
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+
+use confuse_xz.nc 
+sh grid r
+can data 1
+
+use confuse_yz.nc 
+sh grid s
+can data 1
+
+use confuse_yt.nc 
+sh grid u 
+can data 1
+
+use confuse_yzt.nc 
+sh grid v
+can data 1
diff --git a/bench/bn_aggregate_e.jnl b/bench/bn_aggregate_e.jnl
new file mode 100644
index 0000000..c6fe56e
--- /dev/null
+++ b/bench/bn_aggregate_e.jnl
@@ -0,0 +1,152 @@
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt. 
+
+set mode diag
+
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+
+! The grid of SST is known.
+show data fourfiles
+
+list/i=3 sst[T=@ave]
+cancel data fourfiles
+
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+show data fourfiles
+
+list/i=3 airt[T=@ave]
+
+cancel mode diag
+cancel data/all
+cancel var/all
+
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+
+! Define the ensemble dataset
+
+! intentional errors: 
+set mode ignore
+
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+
+! No variables on comparable grids.
+define data/agg windy = 1,2
+
+set mode/last ignore
+
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+
+! Define uwnd and vwnd in dataset 2 to have the grid of 
+! those variables in dataset 1
+
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+
+show data
+
+! Define the ensemble dataset
+define data/agg windy = 1,2
+
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+
+! Use the other order. As long as we have a file variable, we're ok
+
+cancel data 3
+
+! Define the ensemble dataset
+define data/agg windy = 2,1
+
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+
+can data/all
+can var/all
+
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+
+sh command define
+sh command show
+
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+
+! should just show the ensemble set
+sh dat
+
+! If ask for a member set by name or number, do show it
+sh dat 2
+sh dat ens3
+
+! should show all members plus ensemble
+sh dat/hidden
+
+! Should show original member datasets
+can dat fourfiles
+sh dat
+can dat/all
+
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+can dat  2
+sh dat
+
+! Cancel the ensemble, then hidden members get un-hidden.
+
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+
+! members hidden, showing only ensemble.
+sh dat
+can dat my_ens
+
+! Cancel ensemble dataset: members un-hidden
+sh dat
+
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+
+! Shows all the ensembles
+sh dat
+
+! Cancel a member of all the ensembles. 
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+
diff --git a/bench/bn_all.jnl b/bench/bn_all.jnl
new file mode 100644
index 0000000..9d2ccc2
--- /dev/null
+++ b/bench/bn_all.jnl
@@ -0,0 +1,911 @@
+SET MODE VERIFY
+! BN500_ALL.JNL
+! - run all the benchmark tests
+! - ordered (more or less) from least to most complex
+! V2.30: uses BN230_syntax instead of BN200_syntax
+!        added BN230_cdf
+!	 added BN230_regrid_transforms 8/92
+! V3.00: uses BN300_syntax instead of BN230_syntax
+! 	 added bn300_dollar 4/93
+! V3.01: adds bn301_axis_limits and ppl echo ON
+! V3.11: adds bn311_ez_order (/ORDER and /FORMAT=STREAM)
+! V3.12: adds bn312_user (tests SAMPLE and OBJECTIVE)
+! V3.13: for AIX testing: removed mem_mgmt & ignore errors during bn200_output
+! V3.20: to test SAVE/HEADING=enhanced (new BN320_cdf)
+! V4.00: added "*" tests to bnxxx_dollar and added new test bn400_grave
+!    6/95 - added bn401_symbols
+!    7/95 - modified bn*_syntax: bn401_syntax has var1[G=var2[d=dset]]
+!    8/95 - modified bn*_ez: bn401_ez tests FORM=unf
+! V4.20: 
+!    9/95 - added test of LET/D and LIST/FORMAT=STREAM
+!	  - slightly modified syntax in bn420_regrid_transforms
+!	  - added bn420_dynamic_grids and bn420_comma_delimited
+!	  - added 2 small additional tests in bn420_grave
+!	  - added a small syntax test in bn420_syntax
+!	  - tested for commas inside args in bn420_dollar
+!	  - tested for enclosing parens in bn420_symbol
+! V4.30:
+!   5/96  - added IF tests
+!   9/96  - added MC data tests *kob*
+! V4.50:
+!   1/97  - eliminated MODE POLISH
+!	    (bn301_expressions.jnl -> bn450_expressions.jnl)
+!   8/97  - bn430_if -> bn450_if: added symbol substitution test
+!10/97*kob*- cancel metafile creation after bn420_syntax and turn it
+!	    on only before bn450_plot (upgraded from bn320_plot)
+!	   - also add test for negative time steps (bn450_negative_t)
+!	   - also add test for cuvilinear stuff
+!          - also added steve's "exact match" regridding
+!11/97 *kob* - added bn450_gc_functions
+! V4.91:
+!    1/98  - corrected bug in this script -- need to cancel viewports after
+!	     bn312_user or the plots which follow come up in a small viewport
+!    2/98 *kob* - moved bn450_curv.jnl up to right after bn450_plot.jnl in 
+!		  order to have those metafiles saves as well for checking
+!		  also renamed it to bn491_curv.jnl and added some minor 
+!		  cosmetic changes
+!    2/98 *kob* - add in bn491_bug_fixes.jnl
+!    4/98 *sh*  - replaced bn420_dynamic_grids with bn491_... (minor chg)
+! V5.00:
+!   2/99 *sh* -- bn420_regrid_transform ==> bn500_regrid_transform
+!   3/1/99 *kob* - removed bn200_budget from distributable benchmarks 
+!   5/99 *kob* - added V50 bench files
+! V5.10:
+!  10/99 *sh* -- added bn_sample.jnl to test SAMPLEI,J,K,L
+!			bn_non_COARDS_netCDF.jnl
+!			bn_cache_hits.jnl, .sub
+!			bn_strides_revs_perms.jnl
+!			bn_regrid_to_user.jnl
+! V5.33:
+! 6/01 *sh* -- added bn_modulo_strides.jnl
+! 6/01 *acm*  -- add	bn_calendar
+!			bn_dash_dot
+!			bn_flowlines
+! 6/08 *kob*  -- add	bn_internal_external_functions
+!
+! V5.40:
+! 9/01 *sh* -- added bn_axis_viewports
+!           -- added bn_strings
+! 10/01 *acm* -- added bn_axcontrol
+!             -- add EOF's and cmprsi_by to bn_internal_external_functions.jnl
+! 11/01 *sh* -- added bn_delimited_read
+!
+! V5.41:
+! 3/02 *acm*-- Add bn540_bug_fixes.jnl
+!
+! V5.50:
+! 11/02 *sh*-- Add bn_subspan_modulo.jnl
+!
+! V5.52
+!  5/03 *acm* add bn_multi_line_labels.jnl, bn552_bug_fixes.jnl,
+!             bn_set_var_scale_off.jnl, bn_longvarnames.jnl, bn_shakey.jnl
+! v5.53
+!  9/03 *kob* added bn_test_nan
+
+! v5.81  
+!  9/05 *acm* remove bn_curv_shade_mod.jnl which was duplicated by bn_curv_mod.jnl
+
+!  V6.00
+!  9/06 *acm* new scripts  bn_tab_comma_multivar.jnl, bn_element_functions.jnl,
+!             bn_long_revision_num.jnl, bn_window_title.jnl, bn_last_error.jnl,
+!             bn_deg_min.jnl, bn_dp_readscale.jnl, bn_bounds_defineax.jnl,
+!              bn_attributes.jnl, n600_bug_fixes.jnl
+!
+! 9/06 *acm* New bn601_bug_fixes for version 6.02
+
+! 6/06  *acm* add bn_transforms.jnl -- there was a benchmark testing regridding
+!             transforms but not the others: smoothers, fillers, etc.
+! 1/12  *acm* add bn_variance.jnl -- testing @VAR transform
+
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!
+! 11/06 *acm* New bn602_bug_fixes for version 6.02
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V685  *sh* 11/13 - added bn_vtree to test SHOW VAR/TREE
+
+! Include this statement to compare the outupt of 6D Ferret with 
+! previous 4D benchmark logs.
+! cancel mode 6d_lab
+
+GO bn_reset
+GO bn_syntax
+cancel mode metafile      !9/97
+
+GO bn_reset
+GO bn_dollar hello    ! test command arg
+
+! added in bn400
+GO bn_reset
+GO bn_grave
+
+! added in bn420
+GO bn_reset
+GO bn_letd
+
+! added in bn430
+GO bn_reset
+GO bn_if
+
+GO bn_reset
+GO bn_expressions
+
+GO bn_reset
+GO bn_geometry
+
+GO bn_reset
+set mode ignore		! needed for AIX   11/94
+GO bn_output
+cancel list/format
+can mode ignore		! needed for AIX
+
+GO bn_reset
+GO bn_in_plane
+
+GO bn_reset
+GO bn_compress
+
+GO bn_reset
+GO bn_interpolate
+
+GO bn_reset
+GO bn_regrid
+
+GO bn_reset
+GO bn_ez		! changed from bn200_ez 8/10/95
+
+! ****
+! remove bn200_budgets for portable benchmarks *kob* 5/99
+! ****
+
+! ppl echo on turns on fort.41 to capture ppl commands.
+PPL ECHO ON		! added 10/27/93
+
+! 10/97 *kob* now set mode metafile
+set mode metafile bnplot.plt
+GO bn_reset
+GO bn_plot		! upgraded from bn320_plot 10/1/97 *kob*
+
+
+!added in bn450 10/97 *kob*
+! moved to right after bn450_plot to capture metafiles *kob* 2/98
+GO bn_reset
+! 2/98 changed bn450_curv to bn491_curv - just some cosmetic changes *kob*
+GO bn_curv
+
+SET WINDOW/CLEAR/SIZE=0.2 ! 8/25/92
+!CANCEL WINDOW/ALL    ! added 7/27/92
+! 10/97 *kob* now cancel mode metafile
+cancel mode metafile
+
+GO bn_reset
+GO bn_symbols	! added 6/22/95
+
+GO bn_reset
+GO bn_comma_delimited	! added 10/2/95
+
+GO bn_reset
+GO bn_dynamic_grids	! added 9/27/95, V420 ->V491 4/98
+
+GO bn_reset
+GO bn_cdf
+
+GO bn_reset
+GO bn_regrid_transforms
+
+GO bn_reset		! reordered reset before next test: 2/94
+GO bn_axis_limits	! added 10/27/93
+SET WINDOW/CLEAR/SIZE=0.2 ! added 2/94
+
+!GO bn_reset
+!GO bn301_mem_mgmt
+MESSAGE/CONTINUE  ***** bn301_mem_mgmt has been removed from run_all.
+MESSAGE/CONTINUE  ***** Its too slow!!!
+MESSAGE/CONTINUE  ***** Remember to run it separately
+
+GO bn_reset
+GO bn_movie
+
+! added in bn311
+GO bn_reset
+GO bn_ez_order	! was bn311 until 9/95
+
+! added in bn312  6/3/94
+GO bn_reset
+! cancel mode metafile   ! needed temporarily 6/94: PLOT+/XGKS interaction bug
+GO bn_user
+set window 1		! clean up
+
+! added in bn420  1/96
+GO bn_reset
+GO bn_stream
+
+!added in bn430 9/96 *kob*
+GO bn_reset
+GO bn_mc
+
+!added in bn450 10/97 *kob*
+GO bn_reset
+GO bn_negative_t
+
+!added in bn450 10/97 *kob*
+GO bn_reset
+GO bn_xact_regrid
+
+!added in bn450 11/97 *kob*
+! replace w/ bn500 *kob* 5/99
+GO bn_reset
+GO bn_gc_functions
+
+!added in bn491 - originally had this in run_all, but moved it here to 
+! properly echo commands  *kob*
+GO bn_reset
+set mode verify  ! somehow this was off
+
+GO bn491_bug_fixes.jnl
+
+! ******** V500 Additions below ***********
+
+GO bn_reset
+GO bn_odd_variable_name
+
+GO bn_reset
+GO bn_test_stream
+
+GO bn_reset
+GO bn_define_axes
+
+GO bn_reset
+! GO bn_external_functions  ! move to tests of shared-obj efs.
+
+GO bn_reset
+GO bn_pattern
+
+GO bn_reset
+GO bn_polygon
+
+GO bn_reset
+GO bn500_bug_fixes
+
+! ******** V510 Additions below ***********
+
+GO bn_reset
+GO bn_sample			! internal (optimized) SAMPLE* functions
+
+GO bn_reset
+GO bn_strides_revs_perms	! netCDF fancy reads
+
+GO bn_reset
+GO bn_non_COARDS_netCDF		! non-standard netCDF files
+
+GO bn_reset
+GO bn_cache_hits		! cache hits on unspecified (full) regions
+
+GO bn_reset
+GO bn_regrid_to_user		! G=user_var and related
+
+! ******** V53 Additions below ***********
+
+GO bn_reset
+GO bn_calendar
+
+GO bn_reset
+GO bn_dash_dot
+
+GO bn_reset
+GO bn_flowlines
+
+! ******** V533 Additions below ***********
+
+GO bn_reset
+GO bn_logaxes
+
+! *kob* same tests for internal external functions but moved out of
+!       the bn_external_function jnl file.  
+GO bn_reset
+GO bn_internal_external_functions
+
+GO bn_reset
+GO bn_modulo_strides
+
+! ******** V54 Additions below ***********
+
+GO bn_reset
+GO bn_axis_viewports
+
+GO bn_reset
+GO bn_strings
+
+GO bn_reset
+GO bn_axcontrol
+
+GO bn_reset
+GO bn_vec_curv
+
+GO bn_reset
+GO bn_delimited_read
+
+
+! ******** V5.41 Additions below ***********
+
+GO bn_reset
+GO bn541_bug_fixes
+
+GO bn_reset
+GO bn_cancel_axes
+
+! ******** V5.42 Additions below ***********
+
+GO bn_reset
+GO bn542_bug_fixes
+
+! ******** V5.50 Additions below ***********
+
+GO bn_reset
+GO bn_subspan_modulo
+
+GO bn_reset
+GO bn_dots
+
+GO bn_reset
+GO bn_lev_symbols
+
+GO bn_reset
+! GO bench_extrema  ! moved to bn_ef_bench_extrema; tests of shared-obj efs.
+
+GO bn_reset
+GO bn_mode_logo_lab
+
+GO bn_reset
+GO bn_modulo_attribute
+
+GO bn_reset
+GO bn550_bug_fixes
+
+! ******** V5.51 Additions below ***********
+
+GO bn_reset
+GO bn551_bug_fixes
+
+! ******** V5.52 Additions below ***********
+
+GO bn_multi_line_labels.jnl
+
+GO bn_reset
+GO bn552_bug_fixes
+
+GO bn_reset
+GO bn_set_var_scale_off.jnl
+
+GO bn_reset
+GO bn_longvarnames.jnl
+
+GO bn_reset
+GO bn_shakey.jnl
+
+GO bn_reset
+GO bn_eof_4d.jnl
+
+GO bn_reset
+GO bn_abstract_axis_names.jnl
+
+GO bn_reset
+GO bn_many_polygons.jnl
+
+GO bn_reset
+! GO bn_zaxr_fcns.jnl ! move to tests of shared-obj efs.
+
+GO bn_reset
+GO bn_fill_irregular.jnl
+
+! ******** V5.53 Additions below ***********
+GO bn_reset
+GO bn_xml_output.jnl
+
+GO bn_reset
+GO bn_test_nan.jnl
+
+GO bn_reset
+GO bn553_bug_fixes.jnl
+
+
+! ******** V5.6Additions below ***********
+
+GO bn_reset
+GO bn_graticules.jnl
+
+GO bn_reset
+GO bn_repeat_range.jnl
+
+GO bn_reset
+GO bn554_bug_fixes.jnl
+
+
+! ******** V5.7 Additions below ***********
+
+GO bn_reset
+GO bn_bounds.jnl
+
+GO bn_reset
+GO bn_all_leap.jnl
+
+GO bn_reset
+GO bn_reset_attributes.jnl
+
+GO bn_reset
+GO bn570_bug_fixes.jnl
+
+! ******** V5.8 Additions below ***********
+
+GO bn_reset
+GO bn_modstats.jnl
+
+GO bn_reset
+GO bn_mc_vary_scale.jnl
+
+GO bn_reset
+GO bn_plot_nokey.jnl
+
+GO bn_reset
+GO bn580_bug_fixes.jnl
+
+! ******** V5.81 Additions below ***********
+GO bn_reset
+GO bn_inf_levels.jnl 
+
+GO bn_reset
+GO bn_regulart.jnl
+
+GO bn_reset
+GO bn_labwid.jnl
+
+GO bn_reset
+GO bn_redefine_taxis_mc.jnl
+
+GO bn_reset
+GO bn_illegal_axisname.jnl
+
+GO bn_reset
+GO bn_exit_script.jnl
+
+GO bn_reset
+GO bn_exit_cycle.jnl
+
+GO bn_reset
+GO bn_curv_mod.jnl
+
+GO bn_reset
+GO bn_shade_keycont.jnl
+
+GO bn_reset
+GO bn581_bug_fixes.jnl
+
+! ******** V6.00 Additions below ***********
+GO bn_reset
+GO bn_tab_comma_multivar.jnl
+
+GO bn_reset
+GO bn_element_functions.jnl
+
+GO bn_reset
+GO bn_long_revision_num.jnl
+
+GO bn_reset
+GO bn_window_title.jnl
+
+GO bn_reset
+GO bn_last_error.jnl
+
+GO bn_reset
+GO bn_deg_min.jnl
+
+GO bn_reset
+GO bn_dp_readscale.jnl
+
+GO bn_reset
+GO bn_bounds_defineax.jnl
+
+go bn_reset
+go bn_attributes.jnl
+
+!=======
+! 10/06 *acm* Remove tests of nco funcions: we dont want to require them to be installed
+!             on a system in order for it to pass the benchmarks.
+!go bn_reset
+!go bn_nco_functions.jnl
+
+go bn_reset
+go bn_transforms.jnl
+
+go bn_reset
+go bn_variance.jnl
+
+go bn_reset
+go bn_linecolors.jnl
+
+go bn_reset
+go bn_cdf_errmsg.jnl
+
+GO bn_reset
+GO bn600_bug_fixes.jnl
+
+! ******** V6.01 Additions below ***********
+GO bn_reset
+GO bn601_bug_fixes.jnl
+
+! ******** V6.02 Additions below ***********
+GO bn_reset
+GO bn_set_strides.jnl
+
+GO bn_reset
+GO bn_lsl_lowpass.jnl
+
+GO bn_reset
+GO bn_return_xmod_tmod.jnl
+
+GO bn_reset
+GO bn602_bug_fixes
+
+
+! ******** V6.03 Additions below ***********
+GO bn_reset
+GO bn_modnbd.jnl
+
+GO bn_reset
+GO bn_fifty_files.jnl
+
+GO bn_reset
+GO bn603_bug_fixes
+
+! ******** V6.05 Additions below ***********
+
+GO bn_reset
+GO bn_set_var_name.jnl
+
+GO bn_reset
+! This routine executes a ppl error which exits us from Ferret
+! when run in the benchmark suite. Should test this, but dont do it
+! here, for now.
+!GO bn_ppl_errors.jnl
+
+GO bn_reset
+GO bn_memory_symbol
+
+GO bn_reset
+GO bn605_bug_fixes
+
+GO bn_reset
+GO bn608_bug_fixes
+
+
+! ******** V6.1 Additions below ***********
+
+GO bn_reset
+GO bn_shade_trim
+
+GO bn_reset
+GO bn_mode_nlevels
+
+GO bn_reset
+GO bn61_bug_fixes
+
+
+! ******** V6.11 Additions below ***********
+GO bn_reset
+GO bn_test_opendap
+
+GO bn_reset
+GO bn611_bug_fixes
+
+! ******** V6.13 Additions below ***********
+GO bn_reset
+GO bn_no_valid_on_plot
+
+GO bn_reset
+GO bn_median
+
+GO bn_reset
+GO bn614_bug_fixes
+
+! ******** V6.14 Additions below ***********
+GO bn_reset
+GO bn_mode_nodata_lab
+
+GO bn_reset
+GO bn_proleptic_gregorian_calendar
+
+GO bn_reset
+GO bn_string_ngd_nbd
+
+GO bn_reset
+GO bn_cat_string
+
+GO bn_reset
+GO bn_sort_strings
+
+GO bn_reset
+GO bn_samplexyt
+
+GO bn_reset
+GO bn_last_go_file.jnl
+
+GO bn_reset
+GO bn_cancel_upcase_uservar.jnl
+
+GO bn_reset
+GO bn_cdf_keepax.jnl
+
+GO bn_reset
+GO bn_keep_axisnames.jnl
+
+GO bn_reset
+GO bn_key_label_minmax.jnl
+
+! ******** V6.2 Additions below ***********
+GO bn_reset
+GO bn62_bug_fixes.jnl
+
+GO bn_reset
+GO bn_convolve.jnl
+
+GO bn_reset
+GO bn_tax_tstep.jnl
+
+GO bn_reset
+GO bn_grads_z.jnl
+
+GO bn_clock_syms
+
+
+! ******** V6.3 Additions below ***********
+! Note that allowing mouse-click operations in the current
+! window, not only in window 1, is implemented in v6.3. Not
+! tested in the benchmarks.
+
+GO bn_reset
+GO bn63_bug_fixes.jnl
+
+GO bn_reset
+GO bn_axis_reversed_syms
+
+GO bn_reset
+GO bn_isdepth
+
+GO bn_reset
+GO bn_var_hist_levels.jnl
+
+
+! ******** V6.4 Additions below ***********
+
+GO bn_reset
+GO bn64_bug_fixes
+
+GO bn_reset
+GO bn_long_grid_names
+
+GO bn_reset
+GO bn_xml_repl
+
+! ******** V6.5 Additions below ***********
+
+GO bn_reset
+GO bn65_bug_fixes
+
+GO bn_reset
+GO bn_txtype_dmy
+
+GO bn_reset
+GO bn_n_open_dsets_sym
+
+GO bn_reset
+GO bn_multi_decade
+
+GO bn_reset
+GO bn_show_xml_file
+
+
+! GO bn_reset
+! GO bn_encode_url
+
+! ******** V6.6 Additions below ***********
+
+GO bn_reset
+GO bn66_bug_fixes
+
+GO bn_reset
+GO bn_netcdf4
+
+GO bn_reset
+GO bn_scat2grid_bin.jnl
+
+! *********** v6.62 Additions ***********
+
+GO bn_reset
+GO bn_axis_dir_symbols
+
+! *********** v6.63 Additions ***********
+
+GO bn_reset
+GO bn663_bug_fixes
+
+GO bn_reset
+GO bn_set_axis_regular
+
+GO bn_reset
+GO bn_set_cancel_redirect
+
+GO bn_reset
+GO bn_min_max_smoothers
+
+GO bn_reset
+GO bn_vector_symbols
+
+GO bn_reset
+GO bn_variance_large
+
+GO bn_reset
+GO bn_labnum_calendar
+
+
+! *********** v6.65 Additions ***********
+GO bn_reset
+GO bn665_bug_fixes
+
+GO bn_reset
+GO bn_floatstr
+
+! *********** v6.7 Additions ***********
+GO bn_reset
+GO bn67_bug_fixes
+
+GO bn_reset
+GO bn_NaN_note
+
+! *********** v6.71 Additions ***********
+GO bn_reset
+GO bn671_bug_fixes
+
+! *********** v6.8 Additions ***********
+GO bn_reset
+GO bn68_bug_fixes
+
+GO bn_reset
+GO bn_ifv
+
+GO bn_reset
+GO bn_randu2_randn2
+
+GO bn_reset
+GO bn_axis_cf
+
+GO bn_reset
+GO bn_repeated_coords
+
+GO bn_reset
+GO bn_xml_header
+
+GO bn_reset
+GO bn_eof_simple
+
+GO bn_reset
+GO bn_eof_simple2
+
+! 6D tests for Ferret v6.8
+
+GO bn_reset
+GO bn_interpolate_6d
+
+GO bn_reset
+GO bn_regrid_6d
+
+GO bn_reset
+GO bn_syntax_6d
+
+GO bn_reset
+GO bn_expressions_6d
+
+GO bn_reset
+GO bn_direction_fcns_6d
+
+GO bn_reset
+GO bn_regrid_transforms_6d
+
+GO bn_reset
+GO bn_aggregate_e
+
+GO bn_reset
+GO bn_6d_lab_mode
+
+
+! *********** v6.82 Additions ***********
+GO bn_reset
+GO bn682_bug_fixes
+
+! *********** v6.83 Additions ***********
+!  (was released as v6.84)
+
+GO bn_reset
+GO bn683_bug_fixes
+
+GO bn_reset
+GO bn_outtype
+
+GO bn_reset
+GO bn_ribbon_plot
+
+GO bn_reset
+GO bn_descr_4digit
+
+GO bn_reset
+GO bn_axis_outtype
+
+GO bn_reset
+GO bn_axis_nonmonotonic
+
+GO bn_reset
+GO bn_vec_mod
+
+! *********** v6.85 Additions ***********
+GO bn_reset
+GO bn685_bug_fixes
+
+GO bn_reset
+GO bn_dsg_e_x
+
+GO bn_reset
+GO bn_nco_append
+
+GO bn_reset
+GO bn_nobounds
+
+GO bn_reset
+GO bn_write_integer_att
+
+GO bn_reset
+GO bn_descriptor_mc
+
+GO bn_reset
+GO bn_plot_color_only
+
+GO bn_reset
+GO bn_vtree
+
+
+! *********** v6.86 Additions ***********
+GO bn_reset
+GO bn686_bug_fixes
+
+GO bn_reset
+GO bn_long_symnames
+
+GO bn_reset
+GO bn_strdim
+
+GO bn_reset
+GO bn_single_colorlev
+
+
+! *********** v6.9 Additions ***********
+GO bn_reset
+GO bn69_bug_fixes
+
+GO bn_reset
+GO bn_bad_axis_bounds
+
+GO bn_reset
+GO bn_enter_exit_GO
+
+GO bn_reset
+GO bn_stddev
+
+GO bn_reset
+GO bn_set_axis_name
+
+
+!  *********** Always do a bn_reset  *********** 
+!  *********** make sure things clean up well **
+GO bn_reset
+
+! version 2.3 requires exit/command *sh* 3/92
+exit/command
+
diff --git a/bench/bn_all_ef.jnl b/bench/bn_all_ef.jnl
new file mode 100644
index 0000000..fda710d
--- /dev/null
+++ b/bench/bn_all_ef.jnl
@@ -0,0 +1,15 @@
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+
+
+GO bn_reset
+GO bn_ef_external_functions.jnl
+
+GO bn_reset
+GO bn_ef_v5d_strings.jnl
+
+go bn_reset
+go bn_fcn_calls.jnl
+
+exit/command
diff --git a/bench/bn_all_leap.jnl b/bench/bn_all_leap.jnl
new file mode 100644
index 0000000..c880e2e
--- /dev/null
+++ b/bench/bn_all_leap.jnl
@@ -0,0 +1,21 @@
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+list my_data[t="27-feb-1989":"1-mar-1989"]
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+
+list my_data[t="27-feb-1988":"1-mar-1988"]
+list my_data[t="27-feb-1989":"1-mar-1989"]
+
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+
+can mode ignore
diff --git a/bench/bn_appende.jnl b/bench/bn_appende.jnl
new file mode 100644
index 0000000..5966a6f
--- /dev/null
+++ b/bench/bn_appende.jnl
@@ -0,0 +1,51 @@
+! bn_appende.jnl
+
+set mode verify always
+
+show func /detail appende
+
+def axis /X=10E:50E:10 myxax
+def axis /Y=5S:5N:5 myyax
+! def axis /Z /depth /units=meters myzax={0,10,20}
+! def axis /T=01-JAN-2001:01-JAN-2002 /edges /t0=01-JAN-2001 /units=days /npoints=4 mytax
+! def grid /x=myxax /y=myyax /z=myzax /t=mytax mygrid
+def grid /x=myxax /y=myyax mygrid
+set grid mygrid
+
+! let val1 = x + y + log(z+10.0) + log(t+100.0)
+let val1 = x + y
+list val1
+! let val2 = x + y + log(z+10.0) - log(t+100.0)
+let val2 = x - y
+list val2
+! let val3 = x + y - log(z+10.0) - log(t+100.0)
+let val3 = x + y / 2.0
+list val3
+! let val4 = x - y - log(z+10.0) - log(t+100.0)
+let val4 = x - y / 2.0
+list val4
+
+let xtd12 = appende(val1,val2)
+list xtd12
+let xtd13 = appende(xtd12,val3)
+list xtd13
+let xtd14 = appende(xtd13,val4)
+list xtd14
+show grid xtd14
+
+list /format=cdf /file=xtdfile.cdf /clobber xtd14
+
+cancel mem /all
+cancel var /all
+set grid abstract
+cancel grid mygrid
+! cancel axis mytax
+! cancel axis myzax
+cancel axis myyax
+cancel axis myxax
+
+use xtdfile
+show data
+show grid xtd14
+list xtd14
+
diff --git a/bench/bn_attributes.jnl b/bench/bn_attributes.jnl
new file mode 100644
index 0000000..2e057d8
--- /dev/null
+++ b/bench/bn_attributes.jnl
@@ -0,0 +1,1014 @@
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the 
+! benchmark tests.
+
+
+!-----
+
+! SHOW ATTRIBUTE examples
+
+can data/all
+can var/all
+
+use ocean_atlas_temp
+sho att/all temp
+
+show attribute temp.units
+show attribute temp.missing_value
+
+!  specifying data set
+
+use gt4d011
+use levitus_climatology
+
+sh att/all temp[d=2]
+sh att temp.units[d=1]
+
+!  global attributes
+use err491_attval     
+
+show att ..remark
+show att/all .
+
+sho att/all .[d=1]
+
+!  Now SHOW DATA/ATT
+
+can data/all
+use ocean_atlas_temp
+sho data/att 
+
+use gt4d011
+use levitus_climatology
+
+sh data/att gt4d011
+
+!  error messages
+
+set mode ignore
+
+! no argument
+sho att/all
+
+! dataset not open
+can data 2
+show att/all temp[d=2]
+
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+
+can data/all
+
+! No datasets open
+sho att/all .
+
+can mode ignore
+ 
+go bn_reset
+ 
+!-----
+! attributes of string variables 
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+
+!-----
+! Demonstrate `var,return=` output for attributes
+
+use gt4d011
+
+! RETURN=size gives length of attribute: 
+! # values for numeric attributes 
+! string length for string attributes
+
+show att/all temp
+
+say `temp.2,return=size`
+say `temp.6,return=size`
+
+say `..history,return=size`
+
+! test0 is from the netcdf distribution; 
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+say `broiled.acf,return=size`
+ 
+go bn_reset
+
+!-----
+! define variables to contain attribute value(s) 
+
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+
+use ocean_atlas_temp
+let s = temp.units
+list s
+
+can data/all
+
+! global attribute
+use err491_attval     
+let s = ..remark
+list s
+ 
+go bn_reset
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+
+let anames = sst.attnames
+list nat
+list anames
+
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+list cnames
+
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd 
+list/d=1 vnames
+
+let vnames = ..varnames
+list/d=coads_climatology vnames
+list/d=gt4d011 vnames
+
+can data/all
+can var/all
+
+! global ..dimnames
+
+use coads_climatology
+use gt4d011
+
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames 
+list lnames
+
+can var/all
+can data/all
+
+! Global attributes ..attnames
+use err491_attval
+
+let v = ..ndims
+list v
+
+let na = ..nattrs
+list na
+
+let gnames = ..attnames
+list gnames
+
+! attributes of variable number 2
+
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ 
+go bn_reset
+ 
+
+!-----
+! more on number of attributes     
+
+can data/all
+can var/all
+
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+
+list (`temp,return=xaxis`).nattrs
+
+use gt4d011
+say `temp.nattrs[d=1]`
+
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+list `($xaxnam).nattrs[d=1]`
+
+say `(yax_lev94).nattrs[d=1]`
+ 
+go bn_reset
+ 
+!-----
+! more on access to attribute names and values as variables
+
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+
+let a = temp.units
+list/d=3 a
+
+list temp.units[d=3]
+list/d=3 temp.history
+
+can data/all
+can var/all
+
+use test0.nc
+sh data/att
+
+let a= broiled.acl
+list a
+
+let a= broiled.acf
+list a
+
+list/i=2 a
+
+list a[i=2:3]
+
+use coads_climatology
+list sst.dimnames[i=2]
+
+list/i=3 sst.dimnames
+let a= sst.dimnames
+
+list a
+list a[i=1]
+
+go bn_reset
+
+!-----
+! keyword . to refer to global properties and attributes
+
+use gt4d011
+list ..nvars
+
+use coads_climatology
+
+list/d=1 ..nvars
+list/d=2 ..nvars
+
+sh data
+list/d=2 ..varnames
+
+list/d=2 ..dimnames
+list/d=1 ..dimnames
+
+list/d=1 ..nattrs
+list/d=1 ..attnames
+
+list/d=1 ..ndims
+list/d=2 ..ndims
+
+list ..nvars[d=1]
+sh var
+
+let pp = ..varnames
+list pp[d=1]
+
+set data 1
+list/d=2 pp
+ 
+go bn_reset
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+let var = temp.some_text
+list/nohead var
+
+! add an attribute to a variable not in the default dataset
+
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+
+go bn_reset
+
+!-----
+! Edit existing attributes on variables
+
+use ocean_atlas_temp
+sh att/all temp
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+
+use ocean_atlas_temp
+use coads_climatology
+
+! Get attributes of a coordinate variable
+
+list (coadsx).units
+list (coadsx).modulo
+sho att/all (coadsx)
+
+! Set the attribute output flag
+
+set att/output (coadsx).modulo
+
+! Define a new attribute on a coordinate axis
+
+define att (`sst,return=xaxis`).newatt = 3
+set att/output (`sst,return=xaxis`).newatt 
+save/clobber/file=a.nc/x=130w/y=0 sst
+
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+! modfalse.nc is a file with modulo attribute on x axis 
+! explicitly set to FALSE
+
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+! Reset attributes as in SET AXIS
+
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+
+set data coads_climatology
+sho att (coadsx).modulo
+set att (coadsx).modulo=360
+
+! Note here that Ferret is using the name TIME1 instead of TIME. 
+! axis still found and edited.
+
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+list `($xaxnam).nattrs[d=1]`
+
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+list `(($yaxnam)).nattrs[d=1]`
+
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+
+! using dimension names from the linked list structure
+
+let cnames = sst.dimnames
+list cnames
+show axis (`cnames[i=1]`)
+list (`cnames[i=1]`).nattrs
+
+! Intentional errors. 
+
+SET MODE IGNORE
+
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+
+! Cannot change the direction of an axis 
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+
+can view
+ 
+can mode ignore
+go bn_reset
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+
+use gt4d011
+sh att/all salt
+
+set att/like=temp salt
+sh att/all salt
+
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be 
+! specified with qualifiers (/UNITS=) or with DEF ATT
+
+! Define a new attribute on a file variable, then a new var as fcn of that
+
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+sh att/all temp2
+
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+sh att/all temp2
+
+go bn_reset
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+
+! Change attribute values
+
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+let var = temp.some_text
+list/nohead var
+
+! Now change attribute types
+
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+
+list/nohead var
+let pq = temp.pp
+list pq
+
+! set an attribute when the variable is not in the default dataset.
+
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+
+! Edit the text in some of the attributes, make a plot where we see 
+! the resulting change in title and units.
+
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+
+! Define an attr that already exists: redefines 
+
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+ 
+go bn_reset
+
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves 
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+set mode/last upcase_output
+
+go bn_reset
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes  
+
+let aa = 12
+let bb = {3,4.5,6,7,4}
+
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+
+! Output just one of these new attributes
+
+set att/output bb.my_title
+
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+! Output all attributes
+
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+! Just output the default attributes
+
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+! Output none of the attributes for aa
+
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+
+go bn_reset
+
+
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes 
+
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+
+! Surpress output of an attribute that Ferret would otherwise add.
+
+can att/out (`temp,return=xaxis`).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+can att/out (`temp,return=xaxis`).point_spacing
+can att/out (`temp,return=xaxis`).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+
+! read file as an ez file
+
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+sh dat/att
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+! now read it as a delimited file
+
+can data/all
+
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+! and a stream dataset
+
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+
+define att/type=string num.new = "a string attribute"
+sh att/all num
+go bn_reset
+
+!-----
+! manipulate attributes of user-defined variables
+
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+sh dat/att
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+
+!-----
+! write global attributes (Note this implementation needs work; 
+! what is the right syntax?? Perhaps an undocumented feature for 
+! the first release)
+
+use err491_attval
+set att/out=all .   ! from the default data set
+
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+
+!-----
+
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor 
+! and offset attributes, then the data and its missing and fill 
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+
+! Both of these should be scaled the same by Ferret
+use a.nc 
+list/j=1 elev[d=1], elev[d=2]
+sp ncdump a.nc  >> all_ncdump.out
+
+go bn_reset
+ 
+!-----
+! Set type of data on output, uses netcdf call to output 
+! the requseted type.
+
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+
+can data/all
+use gt4d011
+
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+
+can data gt4d011
+
+! Force output type to equal input type (should we have a MODE setting for this??)
+
+use test0
+let nam = ..varnames
+
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+
+can data test0
+
+go bn_reset
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b 
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+
+! A new setting for the point_spacing attribute using either SET or DEFINE
+
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+! new attribute written to file
+
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+
+! shows up on the output of 
+
+SHOW ATT/ALL (`t2,return=yaxis`)
+
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+
+save/file=a.nc/clobber/L=1 t2  
+
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out 
+
+
+! intentional errors
+
+set mode ignore_error
+
+! missing value and fill value too large for INT output.
+
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+
+sp rm a.nc
+
+! specify incorrect output types
+
+use test0
+set var/outtype=char broiled
+
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+
+
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+
+use gt4d011.cdf
+
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+set att/output (`t2,return=xaxis`).point_spacing
+save/file=a.nc/clobber/L=1 t2
+
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+
+! A file variable is used to refer to the axes
+
+set att (`temp,return=xaxis`).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+sho att/all (`temp,return=yaxis`)
+save/file=a.nc/clobber/L=1 t2
+
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+
+! User-defined axes and variables
+
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+
+go bn_reset
+
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+sh dat/att
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+
+! defining more axes with attributes
+
+show axis x2ax
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+
+let axy = reshape (a,rvar)
+
+show att/all (z4ax)
+set att (z4ax).positive = "up"
+
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+
+go bn_reset
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+show att/all (`sst,return=taxis`)
+
+define attribute (`sst,return=taxis`).units = "months"
+show att/all (`sst,return=taxis`)
+
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+
+use coads_climatology
+show att/all (`sst,return=taxis`)
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+
+
+! Add a global attribute
+use test0
+
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+
+sp ncdump -h a.nc  >> all_ncdump.out
+
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+
+sp ncdump -h a.nc  >> all_ncdump.out
+
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+
+can data/all
+use ocean_atlas_temp
+sho att temp
+sho att ocean_atlas_temp
+sho att (`temp,return=xaxis`)
+
+use levitus_climatology
+sho att 1
+sho att 2
+
+sho att temp[d=1]
+sho att temp[d=2]
+
+sho att (`temp[d=1],return=taxis`[d=1])
+
+sho att .
diff --git a/bench/bn_ax_attrib.jnl b/bench/bn_ax_attrib.jnl
new file mode 100644
index 0000000..36285ce
--- /dev/null
+++ b/bench/bn_ax_attrib.jnl
@@ -0,0 +1,13 @@
+ ! Needs more examples, reading files with CARTESIAN_AXIS, and
+ ! testing order or precedence.  See files in /home/porter/ansley/ans_ferret/users/wittenberg/gtspp*
+
+! Write a file -- see that it has the attribute AXIS = 
+use coads_climatology
+save/clobber/x=180/y=0/file=ax_att.cdf sst
+sp echo "bn_ax_att.jnl --- attribute AXIS=" >> all_ncdump.out
+sp ncdump -c ax_att.cdf | grep "axis ="  >> all_ncdump.out
+
+! Read the file
+can data/all
+use ax_att
+sh data
diff --git a/bench/bn_axcontrol.jnl b/bench/bn_axcontrol.jnl
new file mode 100644
index 0000000..95f283f
--- /dev/null
+++ b/bench/bn_axcontrol.jnl
@@ -0,0 +1,38 @@
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47     
+
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+
+set view ll
+plot/axes/trans  sin(tpts/15)
+
+set view lr
+plot/noaxes  sin(tpts/15)
+
+! contour shade and fill, with /TRANS
+
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+
+set view lr
+fill/l=1/axes sst
+
+! polygon
+
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
diff --git a/bench/bn_axis_cf.jnl b/bench/bn_axis_cf.jnl
new file mode 100644
index 0000000..26f79cf
--- /dev/null
+++ b/bench/bn_axis_cf.jnl
@@ -0,0 +1,53 @@
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+
+
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+
+use degrees
+sh att/all (`var,return=xaxis`)
+save/clobber/file=a.nc var
+
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+
+use bn_strides
+sh att/all (TTIME)
+save/clobber/file=a.nc xytvar
+
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+
diff --git a/bench/bn_axis_dir_symbols.jnl b/bench/bn_axis_dir_symbols.jnl
new file mode 100644
index 0000000..4521d6f
--- /dev/null
+++ b/bench/bn_axis_dir_symbols.jnl
@@ -0,0 +1,18 @@
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+
+plot/i=1:10 i; show sym ax*; can sym ax*
+plot/j=1:10 j; show sym ax*; can sym ax*
+
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+shade/x=180 sst; show sym ax*; can sym ax*
diff --git a/bench/bn_axis_limits.jnl b/bench/bn_axis_limits.jnl
new file mode 100644
index 0000000..0075718
--- /dev/null
+++ b/bench/bn_axis_limits.jnl
@@ -0,0 +1,45 @@
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+
+set wind/asp=1:ax/size=1 1
+
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+
+GO bn_axis_limits.sub1   ! lines
+GO bn_axis_limits.sub2   ! 2D graphics
+
diff --git a/bench/bn_axis_limits.sub1 b/bench/bn_axis_limits.sub1
new file mode 100644
index 0000000..e4b5b6a
--- /dev/null
+++ b/bench/bn_axis_limits.sub1
@@ -0,0 +1,55 @@
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+
+set window/clear
+
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
diff --git a/bench/bn_axis_limits.sub2 b/bench/bn_axis_limits.sub2
new file mode 100644
index 0000000..0801dc7
--- /dev/null
+++ b/bench/bn_axis_limits.sub2
@@ -0,0 +1,51 @@
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+
+set window/clear
+
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
diff --git a/bench/bn_axis_nonmonotonic.jnl b/bench/bn_axis_nonmonotonic.jnl
new file mode 100644
index 0000000..61da6f1
--- /dev/null
+++ b/bench/bn_axis_nonmonotonic.jnl
@@ -0,0 +1,11 @@
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+
+! Intentional error
+
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+
+cancel mode ignore
diff --git a/bench/bn_axis_outtype.jnl b/bench/bn_axis_outtype.jnl
new file mode 100644
index 0000000..6486288
--- /dev/null
+++ b/bench/bn_axis_outtype.jnl
@@ -0,0 +1,68 @@
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+
+can dat/all
+use coads_climatology
+
+set axis/outtype=float `sst,return=xaxis`
+set axis/outtype=float `sst,return=yaxis`
+set axis/outtype=float `sst,return=taxis`
+
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! Restore the axis type from the file
+
+set axis/outtype=input `sst,return=xaxis`
+set axis/outtype=input `sst,return=yaxis`
+set axis/outtype=input `sst,return=taxis`
+
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! User-defined axes are output as double by default.
+
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! Restore the type of non-file axis, to double
+
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+
+
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+save/clobber/file=mytype.nc my_data
+
+set axis/outtype=int `my_data,return=taxis`
+save/clobber/file=mytype.nc my_data
+
+cancel mode ignore
+
diff --git a/bench/bn_axis_reversed_syms.jnl b/bench/bn_axis_reversed_syms.jnl
new file mode 100644
index 0000000..18dc855
--- /dev/null
+++ b/bench/bn_axis_reversed_syms.jnl
@@ -0,0 +1,49 @@
+! bn_axis_reversed_syms.jnl   
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is 
+! plotted upside-down, set to 1
+
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+
+! also set with  SHADE/SET
+cancel viewports
+
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+
diff --git a/bench/bn_axis_viewports.jnl b/bench/bn_axis_viewports.jnl
new file mode 100644
index 0000000..1fc640a
--- /dev/null
+++ b/bench/bn_axis_viewports.jnl
@@ -0,0 +1,128 @@
+! bn_axis_viewports
+! *sh* 9/01
+
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+
+! make guide lines
+show view allax   ! text = 1
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ppl list xaxis
+ppl list yaxis
+
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+define symbol yaxl `($PPL$HEIGHT)/2`
+ppl axlen `1.375 + ($xaxl) + 1.375`,`1.375 + ($yaxl) + 1.375`
+plot/vs/hlim=-1.375:`($xaxl)+1.375`:0.25/vlim=-1.375:`($yaxl)+1.375`:0.25/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ppl list xaxis
+ppl list yaxis
+
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+define symbol yaxl `($PPL$HEIGHT)/2`
+ppl axlen `1.375 + ($xaxl) + 1.375`,`1.375 + ($yaxl) + 1.375`
+plot/vs/hlim=-1.375:`($xaxl)+1.375`:0.25/vlim=-1.375:`($yaxl)+1.375`:0.25/nolab/line {0,($xaxl)}, {0,($yaxl)}
+
+set wind/clear
+
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+
+set wind/clear
+
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+! again with viewport scaling determined automatically
+set wind/clear
+
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+ppl list yaxis
+
+cancel view
+go ptest
+ppl list xaxis
+ppl list yaxis
diff --git a/bench/bn_bad_axis_bounds.jnl b/bench/bn_bad_axis_bounds.jnl
new file mode 100644
index 0000000..170226b
--- /dev/null
+++ b/bench/bn_bad_axis_bounds.jnl
@@ -0,0 +1,6 @@
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+
+use badbounds.nc
+show data
diff --git a/bench/bn_batch_metafile.jnl b/bench/bn_batch_metafile.jnl
new file mode 100644
index 0000000..b3ce06c
--- /dev/null
+++ b/bench/bn_batch_metafile.jnl
@@ -0,0 +1,83 @@
+! bn_batch_metafile.jnl
+! Run at the end of the benchmark scripts, starting ferret with the flags 
+!   -batch bat.plt
+! Produces nine metafiles.
+
+cancel mode logo
+
+! test viewports and set window/clear; cancel viewport
+set view upper
+plot/i=1:150 sin(i/12)
+set view lower
+plot/color=red/i=1:150 cos(i/10)
+
+set window/clear
+
+set view left
+shade/i=1:15/j=1:15/lev=30 i*j
+set view right
+shade/i=1:15/j=1:15 cos(i)* sin(j)
+
+cancel viewports
+
+set view ur
+plot/i=1:12 1./i
+set view ll
+shade/i=1:150/j=1:150 cos(i/10) - sin(j/12)
+
+! polygon command and palette
+
+cancel viewports
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+
+! more viewports, with pplus/reset
+
+set view upper; shade/i=1:10/j=1:10 i*j
+cancel viewports
+pplus/reset
+
+! cancel viewports when viewport wasnt set
+! and set window/clear after cancel viewports
+
+plot/vs/line/i=1:314 i*cos(i/20),i*sin(i/20)
+plot/vs/line/over/i=1:314 i*cos(i/30),i*sin(i/20)
+
+cancel viewports
+set window/clear
+
+! aspect ratio can be set
+
+set window/asp=3
+shade/i=1:15/j=1:15/lev=20 i*j
+
+set win/asp=1
+fill/i=1:15/j=1:15/lev=20 i*j
+
+pplus/reset
+
+
+! Bug 1396 fixed
+
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+cancel viewports
+
+! intentional errors and ignored commands
+! set and cancel mode metafile are ignored
+
+set mode metafile new.plt
+
+cancel mode metafile
+
+plot/i=1:12/title="after cancel mode metafile in batch mode" 1./i
+
+! set window commands are ignored, except for set window/aspect
+set window/new
+
+set window/location=0.1,0.1/title="another title"
+
+set mode/last logo
+exit/command
+
diff --git a/bench/bn_bounds.jnl b/bench/bn_bounds.jnl
new file mode 100644
index 0000000..c470fbc
--- /dev/null
+++ b/bench/bn_bounds.jnl
@@ -0,0 +1,205 @@
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds 
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the 
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+
+
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+
+! Now use coads with long irregular time axis.
+
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+! Append later time steps: we add a void point between non-contiguous bounds
+
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+
+! Depth axis; bounds {1,2} positive up
+
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+
+use a.nc
+list/y=3 v
+list/x=177w v
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5} 
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+
+
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120} 
+
+cancel axis tax
+can mode ignore
+
+! SAVE on regular time axis with bounds and edges attributes
+
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+
+can data/all
+
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with 
+! irregular time axis, possibly unintended large boxes.
+
+! 4/13 Increase precision for those list commands, see comment above
+
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+can data a
+
+! Now save with /bounds
+
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+
+list/prec=7 v, t[gt=v], tbox[gt=v]
+can data/all
+
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+
+cancel dat/all
+
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+
+use bounds_noenclose
+sh axis/t tax
+
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+
+use bounds_overlapping
+sh axis/t tax
diff --git a/bench/bn_bounds_defineax.jnl b/bench/bn_bounds_defineax.jnl
new file mode 100644
index 0000000..06d63a6
--- /dev/null
+++ b/bench/bn_bounds_defineax.jnl
@@ -0,0 +1,68 @@
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of 
+! coords, lo_bounds, hi_bounds
+! 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+
+! test of DEPTH axis
+
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200} 
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+
+
+! define some new bounds by subsampling:
+
+let n = `z[gz=zax],return=ksize`
+
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+let zh2 = boxhi[k=2:`n`:2]
+
+list  zl2,(zl2+zh2)/2,zh2
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+
+use gt4d011
+
+! define some new bounds by subsampling:
+
+let n = `z[gz=temp],return=ksize`
+
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+let zh2 = boxhi[k=2:`n`:2]
+
+list  zl2,(zl2+zh2)/2,zh2
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
diff --git a/bench/bn_cache_hits.jnl b/bench/bn_cache_hits.jnl
new file mode 100644
index 0000000..8d35a0e
--- /dev/null
+++ b/bench/bn_cache_hits.jnl
@@ -0,0 +1,47 @@
+! bn_cache_hits.jnl
+
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+
+define alias CONFUSE load/i=1:5 i
+
+set mode diag
+use coads_climatology
+set region/l=1
+
+GO bn_cache_hits.sub sst
+
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+
+GO bn_cache_hits_gcfcn.sub
+
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+
+! --------------------------
+! NOTE: the altered logic for handling unspecified regions will EFFECT THE
+! RESULTS of operations like "sst5[x=@sbx]" if X is a modulo axis. In the
+! pre-3/99 behavior this would compute the result based on the base X axis
+! span of sst5. In the post-3/99 version it will request "sst5[x=1:max at sbx]"
+! which will trigger the stack to request sst5[X=0:max+1]F to do the computation.
+! The result will be fewer missing values AND ALTERED STATISTICS, as a result.
+
+! see log files
+!     sferret_post_cache_hits.log and sferret_pre_cache_hits.log
+! Try
+!     diff sferret*.log | egrep -v 'DELETE|eval|strip|regrid|found|doing|constan'
+
+1289c1430
+<  # flagged as bad  data: 7173
+---
+>  # flagged as bad  data: 7234
+1292,1293c1433,1434
+<  Mean    value: 21.633       (unweighted average)
+<  Standard deviation: 10.112
+---
+>  Mean    value: 21.698       (unweighted average)
+>  Standard deviation: 10.097
+1305,1306c1446,1452
diff --git a/bench/bn_cache_hits.sub b/bench/bn_cache_hits.sub
new file mode 100644
index 0000000..5e9d1e9
--- /dev/null
+++ b/bench/bn_cache_hits.sub
@@ -0,0 +1,62 @@
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+
+stat $1
+CONFUSE
+stat $1
+
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+CONFUSE
+stat $1[gx=xtrop]
+
+let $1x = $1[gx=xtrop]
+stat $1x
+CONFUSE
+stat $1x
+
+define grid/x=xtrop gx
+stat $1[g=gx]
+CONFUSE
+stat $1[g=gx]
+
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+CONFUSE
+stat $1[gx=xtrop,gy=ytrop]
+
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+stat $1[g=gxyt]
+CONFUSE
+stat $1[g=gxyt]
+
+let $1xyt = $1[g=gxyt]
+stat $1xyt
+CONFUSE
+stat $1xyt
+
+let $1xyt = $1[g=gxyt]
+stat $1xyt
+CONFUSE
+stat $1xyt
+
+stat $1[x=@ave]
+CONFUSE	
+stat $1[x=@ave]
+
+let $1xave = $1[x=@ave]
+stat $1xave
+CONFUSE
+stat $1xave
+
+stat $1[x=@sbx]
+CONFUSE
+stat $1[x=@sbx]
+
+let $1sbx = $1[x=@sbx]
+stat $1sbx
+CONFUSE
+stat $1sbx
+
+
diff --git a/bench/bn_cache_hits_gcfcn.sub b/bench/bn_cache_hits_gcfcn.sub
new file mode 100644
index 0000000..8c0d0e6
--- /dev/null
+++ b/bench/bn_cache_hits_gcfcn.sub
@@ -0,0 +1,32 @@
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+
+! test cache hits on grid-changing functions
+
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+list/nohead a            ! evaluate it now
+
+let a = XSEQUENCE(j[j=1:5])
+say `a,return=isize`     ! evaluate it now
+list/nohead a            ! cache hit
+
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+say `a,return=isize`     ! evaluate it now
+list/nohead a            ! cache hit
+
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+say `a,return=isize`     ! evaluate it now
+list/nohead a            ! cache hit
+
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+say `a,return=isize`
+list/nohead a            ! no cache hit
+
+set mode/last diag
diff --git a/bench/bn_calendar.jnl b/bench/bn_calendar.jnl
new file mode 100644
index 0000000..0e234c7
--- /dev/null
+++ b/bench/bn_calendar.jnl
@@ -0,0 +1,125 @@
+! bn_calendar.jnl
+! Version 5.3  
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+
+
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+
+
+
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+
+
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+
+
+
+
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+
+use gt4d011
+
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+
+can data/all
+can var/all
+can region
+
+use calsst
+sh data
+sh grid ndata
+sh axis tweeks
+
+stat/x=135w/y=0 ndata
+
+sp rm -f calsst.cdf
+
+
+can data/all
+can var/all
+can region
+
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+
+
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+
+
+
+! Regrid to a modulo calendar axis.
+
+can data/all
+can var/all
+can region
+
+use coads_climatology
+set region/x=180/y=0
+
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+
+list/l=1:4 sst
+list/l=1:4 jsst, nsst
+
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
diff --git a/bench/bn_cancel_axes.jnl b/bench/bn_cancel_axes.jnl
new file mode 100644
index 0000000..9b4265f
--- /dev/null
+++ b/bench/bn_cancel_axes.jnl
@@ -0,0 +1,48 @@
+! bn_cancel_axes.jnl
+
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+
+go bn_reset
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+
+ go bn_reset
+! longax cancel axis/all
+
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+
+! test remaining axes are intact when we cancel one.
+go bn_reset
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+can axis ax1
+sh axis/x ax2
+
+! Test interaction with irreg axes from datasets
+
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+
+cancel axis test_irreg
+
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+can axis ax1
+
+sh axis/t test_irreg
+sh axis/t test_seas
+
diff --git a/bench/bn_cancel_axes_1.sub b/bench/bn_cancel_axes_1.sub
new file mode 100644
index 0000000..ed8cdc2
--- /dev/null
+++ b/bench/bn_cancel_axes_1.sub
@@ -0,0 +1,11 @@
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+
diff --git a/bench/bn_cancel_axes_2.sub b/bench/bn_cancel_axes_2.sub
new file mode 100644
index 0000000..b0ad8af
--- /dev/null
+++ b/bench/bn_cancel_axes_2.sub
@@ -0,0 +1,7 @@
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
diff --git a/bench/bn_cancel_upcase_uservar.jnl b/bench/bn_cancel_upcase_uservar.jnl
new file mode 100644
index 0000000..02898c6
--- /dev/null
+++ b/bench/bn_cancel_upcase_uservar.jnl
@@ -0,0 +1,31 @@
+! bn_cancel_upcase_uservar.jnl 
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+
+CANCEL MODE upcase
+
+! User variable with lowercase letters in the name
+
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+
+SET MODE/LAST upcase_output
diff --git a/bench/bn_cat_string.jnl b/bench/bn_cat_string.jnl
new file mode 100644
index 0000000..cf37a69
--- /dev/null
+++ b/bench/bn_cat_string.jnl
@@ -0,0 +1,25 @@
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+
+! (when xcat is called, and its args are strings, 
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
diff --git a/bench/bn_cdf.jnl b/bench/bn_cdf.jnl
new file mode 100644
index 0000000..5c667d7
--- /dev/null
+++ b/bench/bn_cdf.jnl
@@ -0,0 +1,45 @@
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+
+! test abstract variable io
+GO bn_cdf.sub2
+
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+
+
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+cancel data test_abs
+
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4  
+GO bn_cdf_reversed.sub
diff --git a/bench/bn_cdf.sub1 b/bench/bn_cdf.sub1
new file mode 100644
index 0000000..6646025
--- /dev/null
+++ b/bench/bn_cdf.sub1
@@ -0,0 +1,43 @@
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 -- clean up files before writing
+
+cancel region
+canc var/all
+cancel data/all
+
+! delete old ones
+sp rm -f test0[a-p].cdf
+
+! write a bunch of em 
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+show data/br
+
+! test access to one
+stat l_[d=1]
+
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+cancel data/all
diff --git a/bench/bn_cdf.sub2 b/bench/bn_cdf.sub2
new file mode 100644
index 0000000..5c7d956
--- /dev/null
+++ b/bench/bn_cdf.sub2
@@ -0,0 +1,98 @@
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 added /CLOBBER
+
+cancel region
+canc var/all
+cancel data/all
+
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_abs
+
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+show grid ijkl
+
diff --git a/bench/bn_cdf.sub3 b/bench/bn_cdf.sub3
new file mode 100644
index 0000000..3078941
--- /dev/null
+++ b/bench/bn_cdf.sub3
@@ -0,0 +1,79 @@
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+
+! V5 *sh* 7/99 added /CLOBBER
+
+cancel data/all
+cancel variables/all
+cancel region
+
+use gtbc011
+
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+set region/l=1:2  ! i,j, and k unspecified
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil0
diff --git a/bench/bn_cdf.sub4 b/bench/bn_cdf.sub4
new file mode 100644
index 0000000..1a4b965
--- /dev/null
+++ b/bench/bn_cdf.sub4
@@ -0,0 +1,80 @@
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 -- added /CLOBBER
+
+cancel data/all
+cancel variables/all
+cancel region
+
+use gtbc011
+
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+set region/l=1:2  ! i,j, and k unspecified
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
diff --git a/bench/bn_cdf_errmsg.jnl b/bench/bn_cdf_errmsg.jnl
new file mode 100644
index 0000000..4928ae0
--- /dev/null
+++ b/bench/bn_cdf_errmsg.jnl
@@ -0,0 +1,41 @@
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+
+set mode ignore
+
+! bad file names; file missing or misspelled 
+use this_is_not_a_file.nc
+
+
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+
+! bad server
+use  "http://noserver/a/nofile.cdf"
+
+! Not a netCDF file: Create an ascii file with extension .nc
+
+list/nohead/file=asc.dat {1,2,3}
+
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+
+set mode/last ignore
+
diff --git a/bench/bn_cdf_keepax.jnl b/bench/bn_cdf_keepax.jnl
new file mode 100644
index 0000000..dbc5e89
--- /dev/null
+++ b/bench/bn_cdf_keepax.jnl
@@ -0,0 +1,41 @@
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+cancel data test_abs
+
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4  
+GO bn_cdf_reversed_keepax.sub
diff --git a/bench/bn_cdf_keepax.sub1 b/bench/bn_cdf_keepax.sub1
new file mode 100644
index 0000000..fd26a24
--- /dev/null
+++ b/bench/bn_cdf_keepax.sub1
@@ -0,0 +1,43 @@
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 -- clean up files before writing
+
+cancel region
+canc var/all
+cancel data/all
+
+! delete old ones
+sp rm -f test0[a-p].cdf
+
+! write a bunch of em 
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+show data/br
+
+! test access to one
+stat l_[d=1]
+
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+cancel data/all
diff --git a/bench/bn_cdf_keepax.sub2 b/bench/bn_cdf_keepax.sub2
new file mode 100644
index 0000000..5dd9108
--- /dev/null
+++ b/bench/bn_cdf_keepax.sub2
@@ -0,0 +1,98 @@
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 added /CLOBBER
+
+cancel region
+canc var/all
+cancel data/all
+
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_abs
+
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+show grid ijkl
+
diff --git a/bench/bn_cdf_keepax.sub3 b/bench/bn_cdf_keepax.sub3
new file mode 100644
index 0000000..0127ce8
--- /dev/null
+++ b/bench/bn_cdf_keepax.sub3
@@ -0,0 +1,79 @@
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+
+! V5 *sh* 7/99 added /CLOBBER
+
+cancel data/all
+cancel variables/all
+cancel region
+
+use gtbc011
+
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+set region/l=1:2  ! i,j, and k unspecified
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil0
diff --git a/bench/bn_cdf_keepax.sub4 b/bench/bn_cdf_keepax.sub4
new file mode 100644
index 0000000..f6da99c
--- /dev/null
+++ b/bench/bn_cdf_keepax.sub4
@@ -0,0 +1,87 @@
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+
+! V5 *sh* 7/99 -- added /CLOBBER
+
+cancel data/all
+cancel variables/all
+cancel region
+
+use gtbc011
+
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+
+set region/l=1:2  ! i,j, and k unspecified
+
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+
+!3D
+! The following is an error - axis already in the file
+! 
+set mode ignore
+
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+
+set mode/last ignore
+
diff --git a/bench/bn_cdf_reversed.sub b/bench/bn_cdf_reversed.sub
new file mode 100644
index 0000000..e9bf5df
--- /dev/null
+++ b/bench/bn_cdf_reversed.sub
@@ -0,0 +1,14 @@
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+
+cancel data/all
+cancel variables/all
+cancel region
+
+set data reverse_axes
+
+show data/var
+
+list/x=180 fcn_norm,fcn_rev
+list/x=180 fcn_rev_sub
diff --git a/bench/bn_cdf_reversed_keepax.sub b/bench/bn_cdf_reversed_keepax.sub
new file mode 100644
index 0000000..e9bf5df
--- /dev/null
+++ b/bench/bn_cdf_reversed_keepax.sub
@@ -0,0 +1,14 @@
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+
+cancel data/all
+cancel variables/all
+cancel region
+
+set data reverse_axes
+
+show data/var
+
+list/x=180 fcn_norm,fcn_rev
+list/x=180 fcn_rev_sub
diff --git a/bench/bn_clock_syms.jnl b/bench/bn_clock_syms.jnl
new file mode 100644
index 0000000..5e7a09d
--- /dev/null
+++ b/bench/bn_clock_syms.jnl
@@ -0,0 +1,24 @@
+SH SYM delta_cpu, clock_secs, current_date, current_time
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+
+repeat/k=1:10 shade temp[L=@ave]
+let ten_plots = ($DELTA_CPU)
+sh sym DELTA_CPU, CLOCK_SECS
+
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+
+say `sumcpu`
+sh sym CLOCK_SECS
+
+SH SYM session_date, current_date, session_time, current_time
diff --git a/bench/bn_comma_delimited.jnl b/bench/bn_comma_delimited.jnl
new file mode 100644
index 0000000..985fbeb
--- /dev/null
+++ b/bench/bn_comma_delimited.jnl
@@ -0,0 +1,83 @@
+! bn420_comma_delimited
+
+! 10/2/95 - test comma and tab-delimited outputs
+
+use gt4d011
+
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+LIST/FORMAT=comma/precision=5/order=zx temp
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+LIST/FORMAT=comma/precision=5/order=tx temp
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+LIST/FORMAT=comma/precision=5/order=zy temp
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+LIST/FORMAT=comma/precision=5/order=ty temp
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+LIST/FORMAT=comma/precision=5/order=tz temp
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+LIST/FORMAT=comma/precision=5/order=y temp
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+LIST/FORMAT=comma/precision=5/order=x temp
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+LIST/FORMAT=comma/precision=5/order=x temp
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+LIST/FORMAT=comma/precision=5/order=x temp
+
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
diff --git a/bench/bn_comma_delimited.sub b/bench/bn_comma_delimited.sub
new file mode 100644
index 0000000..2532d11
--- /dev/null
+++ b/bench/bn_comma_delimited.sub
@@ -0,0 +1,37 @@
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+
+LOAD $2
+
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+
diff --git a/bench/bn_compress.jnl b/bench/bn_compress.jnl
new file mode 100644
index 0000000..e8d179f
--- /dev/null
+++ b/bench/bn_compress.jnl
@@ -0,0 +1,23 @@
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
diff --git a/bench/bn_compress.sub_v b/bench/bn_compress.sub_v
new file mode 100644
index 0000000..5a4ce83
--- /dev/null
+++ b/bench/bn_compress.sub_v
@@ -0,0 +1,30 @@
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+
+! this routine assumes that a 4-D region and an expression are already set
+
+! full data region
+LIST v
+
+! cubes of data
+LIST v[l=@ave]
+LIST v[k=@ave]
+LIST v[j=@ave]
+LIST v[i=@ave]
+
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+LIST v[j=@ave,l=@ave]	!XZ
+LIST v[j=@ave,k=@ave]	!XT
+LIST v[i=@ave,l=@ave]	!YZ
+LIST v[i=@ave,k=@ave]	!YT
+LIST v[i=@ave,j=@ave]	!ZT
+
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
diff --git a/bench/bn_convolve.jnl b/bench/bn_convolve.jnl
new file mode 100644
index 0000000..a45613f
--- /dev/null
+++ b/bench/bn_convolve.jnl
@@ -0,0 +1,26 @@
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+
+
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+
+
diff --git a/bench/bn_curv.jnl b/bench/bn_curv.jnl
new file mode 100644
index 0000000..b42ef4b
--- /dev/null
+++ b/bench/bn_curv.jnl
@@ -0,0 +1,88 @@
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+
+can mode meta  
+set view full
+set wind/clear/asp=1 
+
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.  
+
+go bn_mp_zoo.jnl
+
+!
+! What can go wrong
+!
+
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad 
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+
+
+can win 1
+set win 1
+
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+
+set mode meta bnplot.plt
diff --git a/bench/bn_curv_mod.jnl b/bench/bn_curv_mod.jnl
new file mode 100644
index 0000000..8080031
--- /dev/null
+++ b/bench/bn_curv_mod.jnl
@@ -0,0 +1,17 @@
+! bn_curv_mod
+! Test of fill/mod and contour/mod 
+! 5/24/2005 Ferret v5.81
+
+! The dataset is a portion of example tripolar grid.
+
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+
diff --git a/bench/bn_dash_dot.jnl b/bench/bn_dash_dot.jnl
new file mode 100644
index 0000000..261203f
--- /dev/null
+++ b/bench/bn_dash_dot.jnl
@@ -0,0 +1,19 @@
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
diff --git a/bench/bn_define_axes.jnl b/bench/bn_define_axes.jnl
new file mode 100644
index 0000000..d385905
--- /dev/null
+++ b/bench/bn_define_axes.jnl
@@ -0,0 +1,126 @@
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+
+! exercise the DEFINE AXIS command
+
+
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+define axis/x=1:5:1/edges xax
+show axis/x xax
+
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+
+
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+show axis/l=1:20 tax
+show axis/l=1:240:12 tax
+
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+show axis/l=1:6 tax
+show axis/l=1:6000:1200 tax
+
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+define axis/Y=0:80n:5 yax2
+show axis yax2
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+
+! cleanup
+set mode/last ignore
diff --git a/bench/bn_deg_min.jnl b/bench/bn_deg_min.jnl
new file mode 100644
index 0000000..1cd752c
--- /dev/null
+++ b/bench/bn_deg_min.jnl
@@ -0,0 +1,33 @@
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+
+use ss_small.nc
+
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+
+! Restore the default settings
+ppl axlint,2,2
diff --git a/bench/bn_delimited_read.jnl b/bench/bn_delimited_read.jnl
new file mode 100644
index 0000000..55394ee
--- /dev/null
+++ b/bench/bn_delimited_read.jnl
@@ -0,0 +1,129 @@
+! bn_delimited_read.jnl
+! 10/01 *sh*
+
+! test delimiited (spreadsheet) reads in Ferret
+
+! look at the file
+spawn cat bn_delimited_read_1.dat
+
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+list a1,a2,a3,a4,a5
+
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10  
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+list v1,v2
+
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+show data 2
+
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+show data 2
+
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+show data 2
+
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+show data 2
+
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+show data 2
+
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+! ---
+sp cat bn_delimited_read_date_time.dat
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+list/i=8:14 v11,v19,v21,v23,v25
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+
diff --git a/bench/bn_delimited_read_1.dat b/bench/bn_delimited_read_1.dat
new file mode 100644
index 0000000..a3e53a4
--- /dev/null
+++ b/bench/bn_delimited_read_1.dat
@@ -0,0 +1,7 @@
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
diff --git a/bench/bn_delimited_read_2.dat b/bench/bn_delimited_read_2.dat
new file mode 100644
index 0000000..62a700c
--- /dev/null
+++ b/bench/bn_delimited_read_2.dat
@@ -0,0 +1,3 @@
+  1981/12/03     12:35:00    
+                         
+1895/2/6 13:45:05
diff --git a/bench/bn_delimited_read_CO2.dat b/bench/bn_delimited_read_CO2.dat
new file mode 100644
index 0000000..360fd9a
--- /dev/null
+++ b/bench/bn_delimited_read_CO2.dat
@@ -0,0 +1,20 @@
+Cruise	Station	Type	mm/dd/yy	Lon[E]	Lat[N]	BotDep[m]	Depth[m]	Temperature[C]	Salinity	QF	Bottle	QF	Cast	Pressure[dbar]	Oxygen[umol/kg]	QF	Nitrate[umol/kg]	QF	Nitrite[umol/kg]	QF	Silicate[umol/kg]	QF	Phosphate[umol/kg]	QF	CFC-11[pmol/kg]	QF	CFC-12[pmol/kg]	QF	TCO2[umol/kg]	QF	Alk[umol/kg]	QF	theta	sigma0	sigma1	sigma2	sigma3	sigma4	AOU[umol/kg]	QF	pf11[uatm]	f11age[yrs]	pf12[uatm]	f12age[yrs]	region	tco2p[umol/kg]	tco2pe[umol/kg]	tco2ex[umol/kg]	QF	dcstar[umol/kg]	QF	cstar[umol/kg]	QF	nst [...]
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	10	21.1028	35.9408	0	36	0	1	9.8	224.641	0	0.117181	0	0	0	1.01557	0	0.116205	0	2.229	0	1.255	0	2039.16	0		9	21.1009	25.1841	29.4335	33.5898	37.6559	41.6346	-5.36063	0	268.483	0.428767	541.331	0	4			15.5152	0		9		9	1.0303	0		9			9		9	1985.78	0				-0.550132	0		9
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	54	19.8913	35.9437	0	35	0	1	54.7	233.185	0	0.146476	0	0	0	1.0351	0	0.137688	0	2.431	0	1.3	0	2047.46	0		9	19.8812	25.5145	29.7824	33.9566	38.04	42.0355	-9.03391	0	276.935	0.428767	533.787	0	4				4		9		9	0.75148	0		9			9		9	1993.7	0				-0.479826	0		9
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	79	19.0138	35.9186	0	34	0	1	79.5	237.026	0	0.16601	0	0	0	1.04488	0	0.130855	0	2.516	0	1.366	0	2047.15	0		9	18.9996	25.7248	30.0066	34.1944	38.291	42.2991	-9.17994	0	275.026	0.428767	540.787	0	4				4		9		9	0.865747	0		9			9		9	1994.8	0				-0.464713	0		9
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	104	18.0026	35.8627	0	33	0	1	104.6	233.766	0	0.185548	0	0	0	1.06446	0	0.166016	0	2.65	0	1.357	0	2057.28	0	2353.13	0	17.9846	25.9379	30.2366	34.4406	38.5529	42.5763	-1.47666	0	275.944	0.428767	514.644	0	4	2065.6	1.24303	14.1773	4	43.2408	0	1052.6	0	0.384207	0	-2.09407	0	-2.09407	45.3348	0	2296.52	0	2007.79	0	2011.95	4.89604	3.17328	-0.448179	0	0.874274	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	154	16.3595	35.7126	0	32	0	1	155.1	230.216	0	0.908308	0	0.146501	0	0.898541	0	0.265656	0	2.846	0	1.421	0	2074.05	0	2342.88	0	16.3345	26.2194	30.5469	34.779	38.9185	42.968	9.75586	0	273.211	0.428767	501.507	1.59136	4	2079.22	1.05614	17.3326	4	42.3515	0	1071.89	0	-0.38855	0	-2.2298	0	-3.4	45.7515	0	2296.13	0	2032.66	0	2028.3	4.42658	2.85902	-0.368822	0	0.885257	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	204	14.8461	35.5541	0	31	0	1	206	222.307	0	3.78994	0	0.0097679	0	1.43588	0	0.445416	0	2.954	0	1.46	0	2088.36	0	2358.67	4	14.815	26.4408	30.7965	35.0558	39.2217	43.2967	25.2095	0	262.543	0.428767	481.297	3.62139	4				9	24.7748	4	1072.49	4	-0.3837	0	-19.2231	4	-5.6	30.3748	4	2321.91	4	2055.81	0	2057.99	4.40404	2.83602	-0.234259	0	0.885397	4
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	253	13.7175	35.3809	0	29	0	1	255.2	227.612	0	5.52934	0	0.00976915	0	1.63145	0	0.558795	0	3.006	0	1.515	0	2093.25	0	2325.66	0	13.6809	26.5492	30.9271	35.2082	39.3949	43.4901	25.9254	0	251.764	3.9129	473.843	4.15264	4	2099.07	0.756005	16.682	0	36.7264	0	1097.78	0	-0.449914	0	-7.19765	0	-7.1	43.8264	0	2300.62	0	2070.71	0	2049.42	3.78532	2.43267	-0.0905627	0	0.900067	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	254	13.707	35.3835	0	30	0	1	255.6	227.35	0	5.50979	0	0.00976913	0	1.78775	0	0.554886	0	2.996	0	1.497	0	2093.45	0	2326.96	0	13.6704	26.5534	30.9315	35.2127	39.3997	43.495	26.2374	0	250.798	4.08502	468.001	4.54425	4	2100.01	0.759771	15.9433	0	35.9724	0	1097.14	0	-0.411793	0	-7.77245	0	-7.2	43.1724	0	2301.74	0	2070.76	0	2050.28	3.80139	2.44296	-0.0959692	0	0.89965	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	305	12.6234	35.2123	0	28	0	1	307.2	230.868	0	7.65019	0	0.00977036	0	2.15925	0	0.685879	0	3.134	0	1.515	0	2097.46	0	2321.19	0	12.5817	26.6415	31.0418	35.3446	39.5524	43.6679	28.7698	0	247.536	4.5838	449.86	5.58941	4	2105.75	0.661598	14.2134	0	32.5633	0	1106.62	0	-0.372318	0	-10.375	0	-7.2	39.7633	4	2307.2	0	2084.81	0	2057.7	3.61412	2.31846	0.0551275	0	0.903614	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	353	12.0102	35.1165	0	27	0	1	355.7	235.378	0	8.71578	0	0.00977105	0	2.52093	0	0.753348	0	3.19	0	1.551	0	2100.1	0	2310.15	0	11.9634	26.6872	31.1005	35.4159	39.6359	43.7631	27.8133	0	243.665	5.03326	447.096	5.73407	4	2103.52	0.614545	19.0828	0	36.5449	0	1118.1	0	-0.384657	0	-6.18741	0	-8.9	45.4449	0	2302.49	0	2093.13	0	2054.66	3.37899	2.16602	0.148364	0	0.909075	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	404	11.4592		9	26	0	1	406.9		0		9		9		9		9	3.255	0	1.578	0	2102.84	0	2311.83	0								9					4				9		9		9		9		9			9		0		0					9	0.9096	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	452	11.0375	34.9575	0	25	0	1	455.9	239.899	0	10.9546	0	0	0	3.04893	0	0.884384	0	3.245	0	1.582	0	2103.56	0	2298.46	0	10.9805	26.7465	31.181	35.517	39.7569	43.9033	29.1387	0	234.837	6.0401	434.729	6.38116	4	2104.83	0.589642	21.2291	0	37.32	0	1130.73	0	-0.258491	0	-4.57162	0	-8.9	46.22	0	2301.25	0	2106.12	0	2057.34	3.09522	1.98246	0.305234	0	0.915204	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	502	10.5797	34.8825	0	24	0	1	506	241.09	0	12.1377	0	0	0	3.40091	0	0.958706	0	3.195	0	1.542	0	2107.23	0	2299.79	0	10.518	26.7707	31.2154	35.5613	39.8108	43.9665	30.7812	0	225.347	6.98028	414.189	7.32037	4	2109.51	0.584375	20.2178	0	35.4702	0	1134.61	0	-0.263847	0	-5.38242	0	-9.1	44.5702	0	2307.54	0	2114.33	0	2062.66	3.03107	1.94074	0.386363	0	0.916271	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	601	9.8037	34.7585	0	23	0	1	605.9	238.538	0	14.4357	0	0	0	4.27108	0	1.11419	0		9		9	2112.29	0	2294.52	0	9.73299	26.809	31.2714	35.6345	39.9006	44.0723	38.2626	0					4	2117.11	0.594126	17.678	0	31.2581	0	1140.43	0	-0.432239	0		0	-9.1	40.3581	0	2310.46	0	2126.97	0	2071.93	2.8285	1.81043	0.527268	0	0.92058	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	701	9.0245	34.651	0	22	0	1	706.7	229.219	0	17.5353	0	0	0	6.17743	0	1.31173	0	2.454	0	1.202	0	2123.57	0	2285.86	0	8.9457	26.8539	31.3343	35.7149	39.998	44.1861	52.6555	0	158.387	14.4191	298.457	13.8959	4	2128.03	0.622284	18.0438	0	29.7327	0	1149.18	0	-0.486215	0	-4.93476	0	-11.2	40.9327	0	2308.88	0	2144.96	0	2082.64	2.5106	1.60658	0.671547	0	0.929003	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	800	7.6879	34.5292	0	21	0	1	807	206.678	0	22.7373	0	0	0	13.2162	0	1.63345	0	1.32	0	0.667	0	2149.45	0	2296.67	0	7.60546	26.9624	31.4742	35.8853	40.1979	44.4144	84.1015	0	78.9008	21.3898	154.739	21.7029	4	2164.26	0.600377	7.69126	0	15.4414	0	1153.08	0	-0.437949	0	-13.2	0	-12.2	27.6414	0	2327.98	0	2178.76	0	2121.81	2.26905	1.45051	0.864466	0	0.935898	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	899	6.2124	34.4434	0	20	0	1	907.3	194.602	0	27.2943	0	0	0	23.863	0	1.92683	0	0.732	0	0.375	0	2175.08	0	2297.9	0	6.12918	27.0965	31.6441	36.09	40.4363	44.6853	106.485	0	40.143	25.9543	80.6149	26.9755	4	2190.45	0.625895	7.13214	0	10.2637	0	1169.22	0	-0.5595	0	-14.826	0	-15.2	25.4637	0	2335.03	0	2210.23	0	2149.62	1.92817	1.23141	1.08884	0	0.946551	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	999	4.9587	34.4055	0	19	0	1	1008.4	186.926	0	30.2768	0	0	0	36.387	0	2.15272	0	0.429	0	0.217	0	2198.04	0	2309.35	0	4.8751	27.2183	31.7975	36.274	40.65	44.9275	123.368	0	21.8359	29.5528	43.6726	31.4533	4	2216.41	0.607059	4.13134	0	2.50688	0	1180.81	0	-1.1196	0	-20.0291	0	-19.5	22.0069	0	2349.25	0	2236.02	0	2176.03	1.75466	1.12015	1.27086	0	0.9518	0
+I8SI9S	4	B	12/5/94	94.994	-30.3	1945	1098	4.3083	34.4383	0	18	0	1	1109	171.821	0	32.202	0	0	0	50.4537	0	2.29735	0	0.198	0	0.104	0	2222.27	0	2316.91	0	4.22098	27.3163	31.9119	36.4046	40.7961	45.0887	143.356	0	9.6926	33.8882	20.2222	37.0858	4	2238.85	0.569559	5.92441	0	1.07315	0	1190.15	0	-1.46452	0	-19.2797	0	-9.1	10.1731	0	2354.7	0	2258.52	0	2212.1	1.54419	0.986321	1.32918	0	0.959153	0
diff --git a/bench/bn_delimited_read_date_time.dat b/bench/bn_delimited_read_date_time.dat
new file mode 100644
index 0000000..28dd64c
--- /dev/null
+++ b/bench/bn_delimited_read_date_time.dat
@@ -0,0 +1,4 @@
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
diff --git a/bench/bn_descr_4digit.jnl b/bench/bn_descr_4digit.jnl
new file mode 100644
index 0000000..2c914d6
--- /dev/null
+++ b/bench/bn_descr_4digit.jnl
@@ -0,0 +1,7 @@
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+
+use coads_clim_4digit.des
+sh dat
+list/x=180/y=0 sst
diff --git a/bench/bn_descriptor_mc.jnl b/bench/bn_descriptor_mc.jnl
new file mode 100644
index 0000000..d35d8c6
--- /dev/null
+++ b/bench/bn_descriptor_mc.jnl
@@ -0,0 +1,14 @@
+! bn_descriptor_mc.jnl 
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!  
+use des.mc
+list/x=180/y=0 sst
+
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
diff --git a/bench/bn_direction_fcns_6d.jnl b/bench/bn_direction_fcns_6d.jnl
new file mode 100644
index 0000000..1945ef1
--- /dev/null
+++ b/bench/bn_direction_fcns_6d.jnl
@@ -0,0 +1,56 @@
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by 
+! functions in the E and F directions.
+
+! Sort and sort-string in E direction
+
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+
+
+! Sort and sort-string in F direction
+
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+
+! Ereverse and Freverse
+use 6dfile
+
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+can dat/all
+
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+list compressm(a)
+list compressn(a)
+
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+list compressm_by(esequence({10,20,30,40,50}),mask)
+
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+list compressn_by(fsequence({10,20,30,40,50}),mask)
diff --git a/bench/bn_dods_strides.jnl b/bench/bn_dods_strides.jnl
new file mode 100644
index 0000000..3f93cfb
--- /dev/null
+++ b/bench/bn_dods_strides.jnl
@@ -0,0 +1,239 @@
+! bn_dods_strides.jnl
+! *sh* 3/00
+
+! drawn identically from bn_strides_revs_perms.jnl on 3/16/00
+
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+
+canc data/all
+cancel mode diagnostic
+
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+!use bn_strides
+! use "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+set data "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+
+
+!! If the above is also down, here is a good one.
+!!set data "http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NCEP/.EMC/.CMB/.Pacific/.monthly/dods"
+
+
+list temp
+canc data/all
+
+use/order=yx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp
+canc data/all
+
+use/order=zyx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp
+canc data/all
+
+use/order=zxy "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp
+canc data/all
+
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=40:43/l=1:2
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=yx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=tyx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=txy "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list xytvar
+canc data/all
+
+! map into Z instead of T
+use/order=zxy "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list/k=1:2 xytvar
+canc data/all
+
+! ambiguous mapping
+use/order=tx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+list xytvar
+canc data/all
+
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+show grid xytvar
+show grid var
+canc data/all
+
+! * * * * * STRIDES * * * * *
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+set mode diag
+cancel memory/all
+
+SHOW DATA
+
+! basic strides
+LIST VAR[i=2:4:2]
+
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+list a		! from cache ...
+
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+load var
+LIST VAR[i=2:4:2]
+LIST VAR[i=2:4:2,j=40:43:2]
+CANC MEM/ALL
+
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=40,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+cancel axis/modulo XAX1_4
+
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=40:46:2]
+LIST VAR[i=2:6:2,j=41:45:2]
+
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+
+! test sub-region selection on strides axis
+let a = temp[i=1:40:5]
+list/j=41/k=1/l=1 a[i=3:5]
+list/k=1/l=1 a[i=3:5,j=41:48:2]
+
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/i=1/j=41/l=1 TEMP
+cancel mem/all
+
+! basic strides
+LIST/j=41/i=1/l=1 TEMP[k=2:4:2]
+
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/i=1/j=41/l=1 TEMP[k=2:4:2]
+
+! cache hit through non-file variable
+let a = TEMP[k=2:4:2]
+list/i=1/j=41/l=1 a
+list/i=1/j=41/l=1 a		! from cache ...
+
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+load/i=1/l=1 TEMP
+LIST/j=41/i=1/l=1 TEMP[k=2:4:2]
+LIST/j=41/i=1/l=1 TEMP[k=2:4:2,j=1:5:2]
+CANC MEM/ALL
+
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/i=1/l=1 TEMP[k=2:4:2,j=40:43:2]
+LIST/i=1/l=1 TEMP[i=2:6:2,j=1:5:2]
+
+! averaging causes bypass of strides
+LIST/j=1/i=1/l=1/precision=9 TEMP[k=2:8:2 at ave]
+LIST/j=1/i=1/l=1/precision=9 TEMP[k=2:8:2]		! for comparison
+
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/i=1/l=1/precision=9 TEMP[k=1:10:2 at ave]
+
+
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+
+set region/i=3:6/j=2:4/k=1:2/l=1
+
+use/order=yx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp[i=3:9:2]
+list temp[j=42:46:2]
+list temp[i=3:9:2, j=42:46:2, k=1:3:2]
+canc data/all
+
+use/order=zyx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp[i=3:9:2]
+list temp[j=42:46:2]
+list temp[i=3:9:2, j=42:46:2, k=1:3:2]
+canc data/all
+
+use/order=zxy "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list temp[i=3:9:2]
+list temp[j=42:46:2]
+list temp[i=3:9:2, j=42:46:2, k=1:3:2]
+canc data/all
+
+
+
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+
+cancel region; set region/l=1
+
+! reference output
+use/order=yx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-yx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=y-x "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=tyx "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=txy "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-t-x-y "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc"
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
diff --git a/bench/bn_dollar.jnl b/bench/bn_dollar.jnl
new file mode 100644
index 0000000..80659e3
--- /dev/null
+++ b/bench/bn_dollar.jnl
@@ -0,0 +1,112 @@
+! test this with GO journal hello
+
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+
+set mode ignore
+message/continue $1
+
+message/continue here is: $1"some text" and some more stuff
+
+message/cont here is a big $1 and $3&some text&      ! default provided
+
+message/cont $3			! error - no default
+
+message/cont $3"<my error message"	! error - with message
+
+message/cont $*
+
+message/continue here is: $*"some text" and some more stuff
+
+message/continue $no_digit_text   ! no substitution
+
+!!!!!!!!!!!!!!!!!!
+
+message/cont $1"|hello|goodbye<my error message"
+
+message/cont $1"greetings|hello|goodbye"
+
+message/cont $1">greetings|hello|goodbye"
+
+message/cont $1">greetings|hello|goodbye<my error message"
+
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+
+! doesn't match on "hello"
+
+message/cont $1"|xxxxx|goodbye<my error message"
+
+message/cont $1"greetings|xxxxx|goodbye"
+
+message/cont $1">greetings|xxxxx|goodbye"
+
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+
+! no argument supplied
+
+message/cont $3"|hello|goodbye<my error message"
+
+message/cont $3"greetings|hello|goodbye"
+
+message/cont $3">greetings|hello|goodbye"
+
+message/cont $3">greetings|hello|goodbye<my error message"
+
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+
+set mode/last ignore
+
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
diff --git a/bench/bn_dollar.sub b/bench/bn_dollar.sub
new file mode 100644
index 0000000..18ed3ca
--- /dev/null
+++ b/bench/bn_dollar.sub
@@ -0,0 +1,15 @@
+\cancel mode verify
+! bn_dollar.sub
+! updated 5/01 to allow up to 99 arguments
+
+! basic arguments 1-9 (no parentheses)
+say $1"1-n/a"  $2"2-n/a"  $3"3-n/a"  $4"4-n/a"
+
+! parenthesized arguments (only executed if argument 5 exists)
+IF $5"0|*>1" THEN
+  say ($1)999  ($2"2-parens")  ($3"3-parens")
+  say  $11"11-n/a"   $12"12-n/a"  $13"13-n/a"
+  say ($41"41-n/a|*>star 41")  ($42"42-n/a|arg 42>subst 42")  ($43"43-n/a")
+ENDIF
+
+set mode/last verify
diff --git a/bench/bn_dots.jnl b/bench/bn_dots.jnl
new file mode 100644
index 0000000..ae41e72
--- /dev/null
+++ b/bench/bn_dots.jnl
@@ -0,0 +1,19 @@
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+
+! Vector plots with null-size vectors
+
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
diff --git a/bench/bn_dp_readscale.jnl b/bench/bn_dp_readscale.jnl
new file mode 100644
index 0000000..4f6a32e
--- /dev/null
+++ b/bench/bn_dp_readscale.jnl
@@ -0,0 +1,39 @@
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+
+! When there is a double precision variable, 
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+
+set list/prec=8
+
+use adouble.nc
+
+list xax
+let xlon = 140
+
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+can mem
+
+list xax
+
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ppl plot
+
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+list xax
+
+cancel list/precision
diff --git a/bench/bn_dsg_e_x.jnl b/bench/bn_dsg_e_x.jnl
new file mode 100644
index 0000000..af0f8e4
--- /dev/null
+++ b/bench/bn_dsg_e_x.jnl
@@ -0,0 +1,13 @@
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+
+use dsg.nc
+sh dat
+sh att profile
+sh grid rowsize
+sh grid sal
diff --git a/bench/bn_dynamic_grids.jnl b/bench/bn_dynamic_grids.jnl
new file mode 100644
index 0000000..65b6596
--- /dev/null
+++ b/bench/bn_dynamic_grids.jnl
@@ -0,0 +1,363 @@
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to 
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The 
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+
+! deliberate dynamic grid errors
+
+can mode diag
+
+use gtsa056_1
+
+set region/l=1/k=1/i=101:105/j=46:50
+
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+
+
+set mode ignore_errors
+
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+
+! now similar error tests but nested one level down on stack
+
+let a = u
+list temp[gx=a]			! uvar for grid name
+show grid/dynamic
+
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+
+!    SET MEM smaller to make sure to get the intended error, 
+!    else we list huge amount of adata
+
+let save_mem = ($ferret_memory)
+set mem/siz = 10
+
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+set mem/siz=`save_mem`
+
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+
+set mode/last ignore
+
+! =================================
+
+! basic implicit grid accesses
+list temp[gx=psxu]
+show grid/dyn
+
+list temp[gy=psyu]
+
+list temp[gx=u]
+show grid/dyn
+
+list temp[gx=w]
+
+list  temp[gx=psxu] + 5
+show grid/dyn
+
+list  5 + temp[gx=psxu]
+show grid/dyn
+
+let tu = temp[gx=psxu]
+list tu
+show grid/dyn
+show grid tu
+
+let tu = temp[gx=psxu] + 5
+list tu
+show grid/dyn
+
+
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+list temp[gx=taux,gy=taux]
+list temp[gx=taux]		! X only
+show grid/dynamic
+
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+
+list/i=3:6 X		! abstract
+list/i=3:6 X[g=u]	! PS3DU
+list/i=3:6 X[gx=u]	! PS3DU
+list/i=3:6 X[gx=PSXT]	! PS3DT
+
+let ax = x
+list/i=3:6 ax		! abstract
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+show grid/dyn
+
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+list a[i=1:10:3]
+list a[i=-1:20:5]		! clips to allowed limits
+list a[y=102:105:.5]
+list a[y=95:115:7]
+show grid/dyn
+
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+show grid/dyn
+
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+show grid/dyn
+
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+show grid/dynamic
+
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+
+
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+canc mode ignore
+show grid/dyn
+
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+! ... by world coord
+list temp[x=130w:120W:3]
+
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+show grid/dyn
+
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+! ... by world coord
+list temp[gx=130w:120W:3]
+
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+list/nohead Y[GY=10s:10n:8]
+list/nohead Z[GZ=0:100:30]
+list/nohead T[GT=0:100:30]
+list/nohead i[gi=1:11:5]
+list/nohead j[gj=1:11:5]
+list/nohead k[gk=1:11:5]
+list/nohead l[gl=1:11:5]
+
+! ========
+
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+list temp[x=130w:120W:3,j=45:55:3]
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+show grid/dyn
+
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+list a[i=1:6:2]
+list a[i=-2:8:2]		! clips to allowed limits
+list a[x=135w:125w]
+list a[x=135w:125w:3]
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:4]
+list a[i=1:4:2]
+list a[i=-2:8:2]		! clips to allowed limits
+list a[x=129w:120w:2]
+list a[x=138w:110w:5]
+show grid/dyn
+
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+list a[j=1:6:2]
+list a[j=-2:8:2]		! clips to allowed limits
+list a[y=1S:8N:2]
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+list a[j=-2:8:2]
+list a[y=1S:8N:2]
+
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+! ... by world coord
+list temp[x=90w:60W:4]
+show grid/dyn
+
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+list a[i=1:6:2]
+list a[i=-2:8:2]		! clips to allowed limits
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+list a[x=85w:45w:5]
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+list a[i=1:6:2]
+list a[i=-2:8:2]
+list a[x=129w:120w:2]		! no overlap
+list a[x=92w:75w:3]
+list a[x=101w:50w:6]
+cancel axis/modulo psxt
+show grid/dyn
+
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+
+cancel var/all
+show grid/dyn
+set axis/modulo psxt
+
+set mode/last diag
diff --git a/bench/bn_ef_bench_extrema.jnl b/bench/bn_ef_bench_extrema.jnl
new file mode 100644
index 0000000..e39da14
--- /dev/null
+++ b/bench/bn_ef_bench_extrema.jnl
@@ -0,0 +1,18 @@
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo 
+!  external functions; installed as .so files
+!  Ferret version 5.4  
+
+! ACM 28-Jan-02
+
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+
+list/x=1:10 findhi(sst,4,4)
+list/x=1:10 findlo(sst,4,4)
+
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+
+let a = findlo(sst,2,2)
+list a[i=@ngd]
diff --git a/bench/bn_ef_curv_to_rect.jnl b/bench/bn_ef_curv_to_rect.jnl
new file mode 100644
index 0000000..12f0299
--- /dev/null
+++ b/bench/bn_ef_curv_to_rect.jnl
@@ -0,0 +1,23 @@
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+
+show func curv*
+
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+
+! Define output grid
+
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
diff --git a/bench/bn_ef_err541_date_delim.jnl b/bench/bn_ef_err541_date_delim.jnl
new file mode 100644
index 0000000..f2ca334
--- /dev/null
+++ b/bench/bn_ef_err541_date_delim.jnl
@@ -0,0 +1,39 @@
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+! 
+! *kob* 11/02
+
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+
+
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+
+
+
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+
diff --git a/bench/bn_ef_external_functions.jnl b/bench/bn_ef_external_functions.jnl
new file mode 100644
index 0000000..9fe94b1
--- /dev/null
+++ b/bench/bn_ef_external_functions.jnl
@@ -0,0 +1,14 @@
+! Tests of external functions that are distributed as shared object files.
+
+! Jon's benchmarks
+go bench_examples
+
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+! 
+! 4/2006 all efs distributed with Ferret except writev5d and the 
+!        examples tested in bench_examples.jnl are now internally linked.
+
+GO bn_reset
+go bench_v5d 
diff --git a/bench/bn_ef_v5d_strings.jnl b/bench/bn_ef_v5d_strings.jnl
new file mode 100644
index 0000000..2e7c83e
--- /dev/null
+++ b/bench/bn_ef_v5d_strings.jnl
@@ -0,0 +1,35 @@
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+set mode ignore_error
+
+sp rm -f testa.v5d
+let a = "testa.v5d"
+
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+
+load WRITEV5D(tr[i=95:100,j=1:40,k=1:3],1/0,1/0,1/0,1/0,1/0,1/0,1/0,a)
+sp ls -l testa.v5d
+
+can region
+let vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+load vflag
+
+sp rm -f test.v5d
+load WRITEV5D(tr[i=95:100,j=1:40,k=1:3],1/0,1/0,1/0,1/0,1/0,1/0,1/0,"test.v5d")
+sp ls -l test.v5d
+
+! removed because it is internal and largely unintelligible
+!show mem/all
+!cancel mem/all
+!show mem/all
+
+! test error: non-string argument passed
+set mode ignore
+  load WRITEV5D(tr[i=95:100,j=1:40,k=1:3],1/0,1/0,1/0,1/0,1/0,1/0,1/0,55.0)
+set mode/last ignore
diff --git a/bench/bn_ef_zaxr_fcns.jnl b/bench/bn_ef_zaxr_fcns.jnl
new file mode 100644
index 0000000..e5c5de0
--- /dev/null
+++ b/bench/bn_ef_zaxr_fcns.jnl
@@ -0,0 +1,33 @@
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+! 
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+
+
+! Define some original source data:
+
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+
+! Put that data on the following original source grid:
+
+Define axis/z=10:50:10 zaxis_orig
+
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+
+! Define a destination axis
+
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+
diff --git a/bench/bn_element_functions.jnl b/bench/bn_element_functions.jnl
new file mode 100644
index 0000000..cd1057e
--- /dev/null
+++ b/bench/bn_element_functions.jnl
@@ -0,0 +1,22 @@
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81  
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36     
+
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+list is_element_of (a, -6003)
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+use string4d.nc
+list/j=1:2/k=1:2 axy
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+
diff --git a/bench/bn_encode_url.jnl b/bench/bn_encode_url.jnl
new file mode 100644
index 0000000..174acf1
--- /dev/null
+++ b/bench/bn_encode_url.jnl
@@ -0,0 +1,41 @@
+! bn_encode_url.jnl
+!
+! Encode a URL inside Ferret
+
+IF `TEST_OPENDAP("http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl") NE 0` THEN
+   EXIT/SCRIPT
+ENDIF
+
+! This from the example Roland cooked up.
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_%7B%7D%7Blet%20top=T0112AN1%5Bz=0%3A100%40ave%5D%7D"
+
+! Now the same thing, encoded in Ferret
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_{}{let/UNITS=DEG top=T0112AN1[z=0:100 at ave]}"
+
+shade/L=6 top[d=2] - top[d=1]
+
+! Define title or units, allowing there to be spaces...
+
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_{}{let/TITLE="Average over Lower 1000m"/units="Deg C" bot=T0112AN1[z=500:1500 at ave]}"
+sho dat
+shade/L=6 bot
+
+
+! THESE THINGS DO NOT WORK:
+! 1) executing more than 1 command separated by semicolons. Does not work
+! when viewed through the browser either.
+! Trying to escape semicolon-separated commands in a F-TDS URL. _expr_{}{let/TITLE="Upper_100M"/units=M top=T0112AN1[z=0:100 at ave]; set var/units=Q top}
+! Note that the url does NOT work in the browser; get an error:
+!     Error in URL
+!     The URL extension did not match any that are known by this server. ...
+! http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_{}{let/TITLE="Upper_100M"/units=M top=T0112AN1[z=0:100 at ave]; set var/units=Q top}.html
+!
+!use "http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_{}{let/TITLE="Upper_100M"/units=M top=T0112AN1[z=0:100 at ave]; set var/units=Q top}"
+
+! 2) A command which has a grave-accent evaluation of something from the dataset. The set is not 
+! open when the encoding is done, so Ferret cant get information out of it.
+! Trying to escape return= grave accents in a F-TDS URL.
+!
+!use "http://ferret.pmel.noaa.gov/thredds/dodsC/las/woa05_monthly/data_ferret.pmel.noaa.gov_thredds_dodsC_data_PMEL_WOA05nc_monthly_A0112an1.nc.jnl_expr_{}{let/units="`T0112AN1,return=units`" top=T0112AN1[z=0:1000 at ave]}"
+
+
diff --git a/bench/bn_enter_exit_GO.jnl b/bench/bn_enter_exit_GO.jnl
new file mode 100644
index 0000000..86228f3
--- /dev/null
+++ b/bench/bn_enter_exit_GO.jnl
@@ -0,0 +1,20 @@
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+
+set redirect/tee/journal
+go bn_shortgo
+
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+
+cancel redirect
diff --git a/bench/bn_eof_4d.jnl b/bench/bn_eof_4d.jnl
new file mode 100644
index 0000000..d68b1e2
--- /dev/null
+++ b/bench/bn_eof_4d.jnl
@@ -0,0 +1,159 @@
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+
+
+! dataset with 4 dimensions; compute EOF at each vertical level.
+
+use gt4d011.cdf
+
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+
+can data/all
+can var/all
+use eofsp
+
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+
+can data/all
+
+
+use gt4d011.cdf
+
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+
+can data/all
+can var/all
+can view
+use eofti
+
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+
+can data/all
+
+
+
+use gt4d011.cdf
+
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+
+can data/all
+can var/all
+use eofst
+
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+list/nohead/i=1:5/j=3/k=5 eofst
+list/nohead/i=1:5/j=3/k=9 eofst
+
+
+exit/script
+! -----------------------------------------------
+! previous commands that called eof_space, eof_stat, eof_tfunc
+
+! dataset with 4 dimensions; compute EOF at each vertical level.
+
+use gt4d011.cdf
+
+let eofsp = eof_space (temp[i=91:95,j=36:40,k=1:4], 1.)
+save/file=eofsp.cdf/clobber eofsp
+
+can data/all
+can var/all
+use eofsp
+
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+
+can data/all
+
+
+use gt4d011.cdf
+
+let eofti = eof_tfunc (temp[i=91:95,j=36:40,k=1:10], 1.)
+save/file=eofti.cdf/clobber eofti
+
+can data/all
+can var/all
+can view
+use eofti
+
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+
+can data/all
+
+
+
+use gt4d011.cdf
+
+let eofst = eof_stat (temp[i=91:95,j=36:40,k=1:10], 1.)
+save/file=eofst.cdf/clobber eofst
+
+can data/all
+can var/all
+use eofst
+
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+list/nohead/i=1:5/j=3/k=5 eofst
+list/nohead/i=1:5/j=3/k=9 eofst
+
+
diff --git a/bench/bn_eof_simple.jnl b/bench/bn_eof_simple.jnl
new file mode 100644
index 0000000..fbc83e4
--- /dev/null
+++ b/bench/bn_eof_simple.jnl
@@ -0,0 +1,147 @@
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+
+
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time. 
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+
+show func eofsvd_stat
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+
+show func eofsvd_space
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+
+show func eofsvd_tfunc
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.  
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+
+! The sum over all significant EOFs of the outer product of 
+! EOF(i) and TAF(i) should return the zero-time-meaned data 
+! (original data with the time-series mean subtracted to give 
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete 
+! (as in a dataset where missing data represents land), return a result 
+! based only locations with complete timeseries.
+
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+
+list eofsvd_stat(space12)
+list eofsvd_space(space12)
+list eofsvd_tfunc(space12)
+
+
+! If there are no complete time series, the functions should bail with an error
+
+let spacegap = if L ne 2 then spacetime
+
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+
+
+exit/script
+! -----------------------------------------------
+! previous commands that called eof_space, eof_stat, eof_tfunc
+
+
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time. 
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+
+show func eof_stat
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eof_stat(spacetime, 1.0)
+
+show func eof_space
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eof_space(spacetime, 1.0)
+
+show func eof_tfunc
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.  
+! TAF vectors are always orthogonal to each other.
+list eof_tfunc(spacetime, 1.0)
+
+! The sum over all significant EOFs of the outer product of 
+! EOF(i) and TAF(i) should return the zero-time-meaned data 
+! (original data with the time-series mean subtracted to give 
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+
+! clean-up
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+
diff --git a/bench/bn_eof_simple2.jnl b/bench/bn_eof_simple2.jnl
new file mode 100644
index 0000000..233e1a5
--- /dev/null
+++ b/bench/bn_eof_simple2.jnl
@@ -0,0 +1,158 @@
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+
+show func eofsvd_stat
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+
+show func eofsvd_space
+! Ideally:
+! +- [ 0.35355,  0.0,  
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2) 
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,  
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT 
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+
+show func eofsvd_tfunc
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+
+exit/script
+! -----------------------------------------------
+! previous commands that called eof_space, eof_stat, eof_tfunc
+
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+
+show func eof_stat
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eof_stat(spacetime, 1.0)
+
+show func eof_space
+! Ideally:
+! +- [ 0.35355,  0.0,  
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2) 
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,  
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT 
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eof_space(spacetime, 1.0)
+! T axis of eof_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+
+show func eof_tfunc
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eof_tfunc(spacetime, 1.0)
+! X axis of eof_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+
+
diff --git a/bench/bn_exit_cycle.jnl b/bench/bn_exit_cycle.jnl
new file mode 100644
index 0000000..0b71dc2
--- /dev/null
+++ b/bench/bn_exit_cycle.jnl
@@ -0,0 +1,21 @@
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+
+can mode ver
+let a = 1
+repeat/i=1:10 (let a = `2*a`; if `a LT 20` then exit/cycle; say `a`)
+
+
+say " "
+say " test exit/loop combined with exit/cycle"
+let a = 1
+repeat/i=1:20 (let a = `2*a`; if `a LT 20` then exit/cycle; \
+ if `a gt 500` then say "say `a` if bigger than 500" ; \
+ if `a gt 10000` then exit/loop; \
+ if `a gt 2000` then exit/cycle; \
+ say `a`)
+say " "
+say "loop finished `a` gt 10000"
+
+set mode/last verify
diff --git a/bench/bn_exit_script.jnl b/bench/bn_exit_script.jnl
new file mode 100644
index 0000000..1e5ba00
--- /dev/null
+++ b/bench/bn_exit_script.jnl
@@ -0,0 +1,31 @@
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+
+cancel mode verify
+REPEAT/I=1:3 (GO exit_script_inloop `i`; SAY loop)
+
+set mode/last verify
diff --git a/bench/bn_expressions.jnl b/bench/bn_expressions.jnl
new file mode 100644
index 0000000..399d92f
--- /dev/null
+++ b/bench/bn_expressions.jnl
@@ -0,0 +1,141 @@
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+
+! . . . constants
+list 4
+list 2 + 2
+list c1 + 2
+list 2 + c1
+list c1 + c1
+
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+list/order=x 2 + i
+list/order=x i1 + 2
+list/order=x 2 + i1
+list/order=x i + c1
+list/order=x c1 + i
+list/order=x i1 + c1
+list/order=x c1 + i1
+
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+list/order=x 2 + i[i=1:3]
+list/order=x i1[i=1:3] + 2
+list/order=x 2 + i1[i=1:3]
+list/order=x i[i=1:3] + c1
+list/order=x c1 + i[i=1:3]
+list/order=x i1[i=1:3] + c1
+list/order=x c1 + i1[i=1:3]
+
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+list/order=x i + k1
+list/order=x k1 + i
+
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+list/order=x i + k1[k=2]
+! ... crash here ...
+list/order=x k1[k=2] + i
+
+
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+LIST/ORDER=X  I
+LIST/ORDER=X  I*3
+LIST/ORDER=X  I/3
+LIST/ORDER=X  I+3
+LIST/ORDER=X  I-3
+LIST/ORDER=X  I^3
+LIST/ORDER=X  I EQ 3
+LIST/ORDER=X  I NE 3
+LIST/ORDER=X  I GT 3
+LIST/ORDER=X  I GE 3
+LIST/ORDER=X  I LT 3
+LIST/ORDER=X  I LE 3
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+
+! functions
+LIST/ORDER=X  MAX(I,3)
+LIST/ORDER=X  MIN(I,3)
+LIST/ORDER=X  INT(I/3)
+LIST/ORDER=X  ABS(I-3)
+LIST/ORDER=X  EXP(I)
+LIST/ORDER=X  LN(I)
+LIST/ORDER=X  LN(EXP(I))
+LIST/ORDER=X  EXP(LN(I))
+LIST/ORDER=X  LOG(I)
+LIST/ORDER=X  LOG(10^I)
+LIST/ORDER=X  10^LOG(I)
+LIST/ORDER=X  SIN(I)
+LIST/ORDER=X  ASIN(SIN(I/3))
+LIST/ORDER=X  COS(I)
+LIST/ORDER=X  ACOS(COS(I/3))
+LIST/ORDER=X  TAN(I)
+LIST/ORDER=X  ATAN(TAN(I/3))
+LIST/J=1:3    ATAN2(J-1,I-1)
+LIST/ORDER=X  MOD(I,3)
+LIST/ORDER=X  IGNORE0(I-3)
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+LIST/ORDER=X  RANDU(I)
+LIST/ORDER=X  RANDN(I)
+
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI 
+LIST/J=5:7 YBOXLO, YBOXHI 
+LIST/K=5:7 ZBOXLO, ZBOXHI 
+LIST/L=5:7 TBOXLO, TBOXHI 
diff --git a/bench/bn_expressions_6d.jnl b/bench/bn_expressions_6d.jnl
new file mode 100644
index 0000000..643b602
--- /dev/null
+++ b/bench/bn_expressions_6d.jnl
@@ -0,0 +1,112 @@
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E, 
+
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+list/order=e 2 + _m
+list/order=e m1 + 2
+list/order=e 2 + m1
+list/order=e _m + c1
+list/order=e c1 + _m
+list/order=e m1 + c1
+list/order=e c1 + m1
+
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+list/order=e 2 + _m[m=1:3]
+list/order=e m1[m=1:3] + 2
+list/order=e 2 + m1[m=1:3]
+list/order=e _m[m=1:3] + c1
+list/order=e c1 + _m[m=1:3]
+list/order=e m1[m=1:3] + c1
+list/order=e c1 + m1[m=1:3]
+
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+list/order=e _m + n1
+list/order=e n1 + _m
+
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+list/order=e _m + n1[n=2]
+list/order=e n1[n=2] + _m
+
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+LIST/order=e  _m
+LIST/order=e  _m*3
+LIST/order=e  _m/3
+LIST/order=e  _m+3
+LIST/order=e  _m-3
+LIST/order=e  _m^3
+LIST/order=e  _m EQ 3
+LIST/order=e  _m NE 3
+LIST/order=e  _m GT 3
+LIST/order=e  _m GE 3
+LIST/order=e  _m LT 3
+LIST/order=e  _m LE 3
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+
+! functions
+LIST/order=e  MAX(_m,3)
+LIST/order=e  MIN(_m,3)
+LIST/order=e  INT(_m/3)
+LIST/order=e  ABS(_m-3)
+LIST/order=e  EXP(_m)
+LIST/order=e  LN(_m)
+LIST/order=e  LN(EXP(_m))
+LIST/order=e  EXP(LN(_m))
+LIST/order=e  LOG(_m)
+LIST/order=e  LOG(10^_m)
+LIST/order=e  10^LOG(_m)
+LIST/order=e  SIN(_m)
+LIST/order=e  ASIN(SIN(_m/3))
+LIST/order=e  COS(_m)
+LIST/order=e  ACOS(COS(_m/3))
+LIST/order=e  TAN(_m)
+LIST/order=e  ATAN(TAN(_m/3))
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+LIST/order=e  MOD(_m,3)
+LIST/order=e  IGNORE0(_m-3)
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+LIST/order=e  RANDU(_m)
+LIST/order=e  RANDN(_m)
+
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI 
+LIST/n=5:7 FBOXLO, FBOXHI 
diff --git a/bench/bn_external_functions.jnl b/bench/bn_external_functions.jnl
new file mode 100644
index 0000000..8815d72
--- /dev/null
+++ b/bench/bn_external_functions.jnl
@@ -0,0 +1,15 @@
+! Jon's benchmarks
+go bench_examples
+
+!Ansley's benchmarks
+! *kob* move bench tests that test internal external functions to their
+!       own file
+exit/script  ! dont have the writev5d function on this machine...
+GO bn_reset
+
+GO bn_reset
+GO bn_ef_v5d_strings.jnl
+
+GO bn_reset
+go bench_v5d 
+
diff --git a/bench/bn_ez.jnl b/bench/bn_ez.jnl
new file mode 100644
index 0000000..cb84249
--- /dev/null
+++ b/bench/bn_ez.jnl
@@ -0,0 +1,82 @@
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+
+
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+LIST V1
+SHOW DATA
+
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+LIST X1,X2
+SHOW DATA
+
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
diff --git a/bench/bn_ez_order.jnl b/bench/bn_ez_order.jnl
new file mode 100644
index 0000000..27cb72f
--- /dev/null
+++ b/bench/bn_ez_order.jnl
@@ -0,0 +1,197 @@
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+file/grid=g6/order=yx test_perm48.dat
+list v1
+file/grid=g6yt test_perm48.dat
+list v1
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+
+
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+
+
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+
+
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+show data
+
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+show data
+
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+show data
+
+
+
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1 
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+
diff --git a/bench/bn_fcn_calls.jnl b/bench/bn_fcn_calls.jnl
new file mode 100644
index 0000000..00912f3
--- /dev/null
+++ b/bench/bn_fcn_calls.jnl
@@ -0,0 +1,7 @@
+! Simple tests of external functions 
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and 
+!             fill_xy to bn_internal_external_functions.jnl
+
+exit
diff --git a/bench/bn_fifty_files.jnl b/bench/bn_fifty_files.jnl
new file mode 100644
index 0000000..ae1f6f8
--- /dev/null
+++ b/bench/bn_fifty_files.jnl
@@ -0,0 +1,59 @@
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+
+set mode ignore_error
+
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+
+cancel mode ignore_error
+
diff --git a/bench/bn_fill_irregular.jnl b/bench/bn_fill_irregular.jnl
new file mode 100644
index 0000000..6f60c30
--- /dev/null
+++ b/bench/bn_fill_irregular.jnl
@@ -0,0 +1,20 @@
+! FILL on vars with irregular axes
+
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+
+def ax/t tax = {1,5,6,7} 
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+
+def ax/x xax = {1,5,6,7} 
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+
+use coads_clim_irreg.des
+fill/x=180 sst
diff --git a/bench/bn_floatstr.jnl b/bench/bn_floatstr.jnl
new file mode 100644
index 0000000..5703a98
--- /dev/null
+++ b/bench/bn_floatstr.jnl
@@ -0,0 +1,28 @@
+! bn_floatstr.jnl
+! testing new function to convert floating-point 
+! variables to strings.
+
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+
+! Result shape is inherited from the input variable
+USE gt4d011.cdf 
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+
+LIST/X=165W:135W/Y=-50/L=1 var
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
diff --git a/bench/bn_flowlines.jnl b/bench/bn_flowlines.jnl
new file mode 100644
index 0000000..bfef73f
--- /dev/null
+++ b/bench/bn_flowlines.jnl
@@ -0,0 +1,43 @@
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+
+GO bn_reset
+set mode meta flowlines.plt
+can mode logo
+
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+
+
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+
+set mode logo
diff --git a/bench/bn_gc_functions.jnl b/bench/bn_gc_functions.jnl
new file mode 100644
index 0000000..80d5113
--- /dev/null
+++ b/bench/bn_gc_functions.jnl
@@ -0,0 +1,136 @@
+! bn500_gc_functions.jnl
+
+! 10/97 - first version - test GC functions released in V4.9 
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+
+CANCEL REGION
+CANCEL VIEWPORTS
+
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+LIST SIN(v)	! preserves source grid
+LIST XSEQUENCE(v)	! replaces source grid
+STAT v, XSEQUENCE(v)
+
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+
+LIST v[I=2:3,J=2:3]
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+LIST RESHAPE(v4d, v3d)
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+
+LIST/x=0/l=1 flow
+LIST/x=0/l=1 depth
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+LIST/x=0/l=1 Kdepth[k=@max]
+
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
diff --git a/bench/bn_geometry.jnl b/bench/bn_geometry.jnl
new file mode 100644
index 0000000..e4b00f8
--- /dev/null
+++ b/bench/bn_geometry.jnl
@@ -0,0 +1,79 @@
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+GO bn_geometry.sub
+SET MODE/LAST DIAGNOSTIC
+
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+SET MODE/LAST DIAGNOSTIC
+
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+
+
diff --git a/bench/bn_geometry.sub b/bench/bn_geometry.sub
new file mode 100644
index 0000000..0d86325
--- /dev/null
+++ b/bench/bn_geometry.sub
@@ -0,0 +1,27 @@
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+
+! this routine assumes that a 4-D region and an expression are already set
+
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+LIST/@IPT/@JPT/@KPT/ORDER=T
+
+! planes of data
+LIST/@KPT/@LPT	!XY
+LIST/@JPT/@LPT	!XZ
+LIST/@JPT/@KPT	!XT
+LIST/@IPT/@LPT	!YZ
+LIST/@IPT/@KPT	!YT
+LIST/@IPT/@JPT	!ZT
+
+! cubes of data
+LIST/@LPT
+LIST/@KPT
+LIST/@JPT
+LIST/@IPT
+
+! 4D region
+LOAD
diff --git a/bench/bn_gif.jnl b/bench/bn_gif.jnl
new file mode 100644
index 0000000..6abf095
--- /dev/null
+++ b/bench/bn_gif.jnl
@@ -0,0 +1,164 @@
+! bn450_gif.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of gif file in batch mode using
+! frame/file=bnplot.gif....will create three gif files
+! *kob*
+
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+frame/file=bnplot.gif
+set wind/clear
+
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+frame/file=bnplot.gif
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+frame/file=bnplot.gif
+
+! Prior to v5.8 could not get the window size in pixels when in gif mode
+show symbol ppl$xpixel
+show symbol ppl$ypixel
+
+! V6.13
+! transparency with FRAME/TRANS
+!!
+! These gif images have the background color white or black
+! replaced by transparent color. This can be tested by putting
+! them into an HTML document with a colored background.
+! e.g. a file called test_transparent.html containing only this line:
+! <html> <body bgcolor="orange"> <img src="testfile.gif"/> </body> </html> 
+
+can view
+use coads_climatology
+shade/nokey/lev=50 sst[L=1]
+frame/trans/file=testbackground.gif
+
+! moved here from bn500_bug_fixes.jnl. The frame/  command it contains
+! has trouble when running the benchmarks from remote desktop
+go bn_reset
+go err491_long_gif_name
+
+
+! The fix for bug 1396
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=gif_dashbug.gif
+
+exit/command
+
+
diff --git a/bench/bn_grads_z.jnl b/bench/bn_grads_z.jnl
new file mode 100644
index 0000000..019f631
--- /dev/null
+++ b/bench/bn_grads_z.jnl
@@ -0,0 +1,32 @@
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name, 
+! does not contain any other clues that Ferret uses to get a Z 
+! axis direction but for variable AR, has attribute  
+! DAXIS:long_name = "depth" ; This bug came from a question about the file 
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+
+USE grads_bug_file.nc
+
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev 
+! A2 has z axis with long name height
+! A3 has z axis with long name level 
+! A4 has z axis with long name layer
+SHOW DATA
+
+! The z axis of AM has no useful clues about its direction. 
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+
+! Can redefine the axis for variable AM to make it a z depth axis
+
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+SH GRID am
diff --git a/bench/bn_graticules.jnl b/bench/bn_graticules.jnl
new file mode 100644
index 0000000..1a1ed55
--- /dev/null
+++ b/bench/bn_graticules.jnl
@@ -0,0 +1,104 @@
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+
+ppl axnmtc,2,2
+
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+! KMS - white changed to green for PyFerret - white causing problems
+SHADE/grat=(color=green) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1} 
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+! KMS - white changed to green for PyFerret - white causing problems
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=green)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+
+! Log axes: VLOG and HLOG with large and small tics
+
+set mode meta graticules.plt
+can mode logo 
+
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+
+can mode meta
+set mode logo
+
+can view
+
+! HLOG and VLOG
+
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+set mode graticule
+show mode graticule
+
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+
+PLOT/i=1:100 cos(i/5)
+
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+
+pplus/reset   ! restore tics etc
+
diff --git a/bench/bn_grave.jnl b/bench/bn_grave.jnl
new file mode 100644
index 0000000..48dd691
--- /dev/null
+++ b/bench/bn_grave.jnl
@@ -0,0 +1,142 @@
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+
+! 2/96 - added tests of PRECISION=n abd BAD=string
+
+message/continue "2+2=`2+2`"
+
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+
+message/continue "50/0 =`50/0`"	! invalid result
+
+repeat/i=1:3 message/continue "I=`I`"
+
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+message/continue "1/300=`1/300 , precision=10`"
+message/continue "1/0=`1/0,  b=-999`"
+message/continue "1/0=`1/0  ,BAD=missing`"
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+say \`2+2\`	! these grave accents should pass through
+say \`2+2\`
+say \`2+`1+1`\` ! should translate 1+1=>2
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+say `sst2,return=lend`    ! should inherit L=5:8
+set mode/last diagnostic
+
+say `sst,return=shape`
+say `sst,return=T0`
+say `sst,return=TITLE`
+say `sst,return=units`
+say `sst,return=GRID`
+
+say `sst,ret=isize`
+say `sst,ret=jsize`
+say `sst,ret=ksize`
+say `sst,ret=lsize`
+
+say `sst,r=istart`
+say `sst,r=jstart`
+say `sst,r=kstart`
+say `sst,r=lstart`
+
+say `sst,R=iend`
+say `sst,R=jend`
+say `sst,R=kend`
+say `sst,R=LEND`
+
+say `sst,return=xstart`
+say `sst,return=ystart`
+say `sst,return=zstart`
+say `sst,return=tstart`
+
+say `sst,return=xend`
+say `sst,return=yend`
+say `sst,return=zend`
+say `sst,return=tend`
+
+say `sst,return=xunit`
+say `sst,return=junits`
+say `sst,return=kunit`
+say `sst,return=tunits`
+
+say `sst^2,return=size` 
+say `sst[L=1]+sst,return=lsize`
+say `sst[L=1:3 at ave],return=lsize`
+say `sst[L=1:3 at ave]+sst,return=lsize`
+
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+set mode/last diagnostic
+
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+
diff --git a/bench/bn_if.jnl b/bench/bn_if.jnl
new file mode 100644
index 0000000..721ce3a
--- /dev/null
+++ b/bench/bn_if.jnl
@@ -0,0 +1,166 @@
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+
+CANC MODE VERIFY
+
+! various syntaxes for TRUE
+if yes then say ---->CORRECT
+if YES then say ---->CORRECT
+if y then say ---->CORRECT
+if true then say ---->CORRECT
+if T then say ---->CORRECT
+if 1 then say ---->CORRECT
+if `2+2` then say ---->CORRECT
+say ---->all is well after checking TRUE
+
+! various syntaxes for FALSE
+if no then say -->WRONG ELSE say ---->CORRECT
+if n then say -->WRONG ELSE say ---->CORRECT
+if f then say -->WRONG ELSE say ---->CORRECT
+if FALSE then say -->WRONG ELSE say ---->CORRECT
+if bad then say -->WRONG ELSE say ---->CORRECT
+if missing then say -->WRONG ELSE say ---->CORRECT
+if 0 then say -->WRONG ELSE say ---->CORRECT
+if `1/0` then say -->WRONG ELSE say ---->CORRECT
+say ---->all is well after checking FALSE
+
+! single line IF tests
+if yes then say ---->CORRECT
+if yes then say ---->CORRECT endif
+if yes then say ---->CORRECT else say goodbye
+if yes then say ---->CORRECT else say goodbye endif
+if no then say -->WRONG
+if no then say -->WRONG endif
+if no then say -->WRONG else say ---->CORRECT
+if no then say -->WRONG else say ---->CORRECT endif
+say ---->all is well after checking single line IFs
+
+! IF combined with command groups
+if yes then (say ---->CORRECT; say ---->CORRECT, again) ENDIF
+set reg/i=3; if `i` then (set reg/i=100; say `i`); cancel region
+set reg/i=100;if `i` then (set reg/i=2;repeat/j=1:`i` say `j`); cancel region
+say ---->all is well after command group and loop tests
+
+! IF combined with symbols (8/97)
+define symbol TEST_IF $1%no%
+if ($TEST_IF"|yes>1|no>0|*>0") then say ERROR:sym sub else say CORRECT:sym sub
+
+! multi-line IF tests
+IF yes THEN
+  say ---->CORRECT
+  say ---->CORRECT again
+ELSE
+  SAY ---->WRONG
+ENDIF
+say ---->all is well
+
+IF yes THEN
+  say ---->CORRECT
+ENDIF
+say ---->all is well
+
+IF no THEN
+  say ----> WRONG: took first clause
+ELSE
+  SAY ---->CORRECT: took ELSE
+  say ---->CORRECT again
+ENDIF
+say ---->all is well
+
+IF no THEN
+  say ----> WRONG: took first clause
+ELIF yes THEN
+  say ---->CORRECT: took ELIF
+ELSE
+  SAY ---->WRONG: took ELSE
+ENDIF
+say ---->all is well
+
+IF no THEN
+  say ---->WRONG: took first clause
+ELIF no THEN
+  say ---->WRONG: took ELIF
+ELSE
+  SAY ---->CORRECT
+ENDIF
+say ---->all is well following multi-line IF tests
+
+! pathological use of multi-line IF
+!(IF yes THEN; say -->CORRECT; say CORRECT, again; ELSE say --> WRONG; ENDIF)
+say ---->all is well following weird multi-line IF
+
+! nested single line IF's
+IF yes THEN (IF no THEN say --->WRONG ELSE say -->CORRECT: nested single line IFs ENDIF) 
+IF yes THEN (IF no THEN say --->WRONG ELSE say -->CORRECT: nested single line IFs ENDIF) ENDIF
+IF yes THEN (IF no THEN say --->WRONG ELSE say -->CORRECT: nested single line IFs ENDIF) ELSE say -->WRONG ENDIF
+
+! nested multi-line IF's
+! case 1: nested IF inside ACCEPTED clause
+IF no THEN
+  say ----> WRONG: took first clause
+ELIF yes THEN
+  say ---->CORRECT: took ELIF -- starting nested IF
+  IF no THEN
+    say ----> WRONG: took first clause
+  ELIF no THEN
+    SAY ---->WRONG: took ELSE
+  ELSE
+    say ---->CORRECT: took ELSE inside nested IF
+  ENDIF
+ELSE
+  SAY ---->WRONG: took ELSE
+ENDIF
+! case 2: nested IF inside REJECTED clause
+IF yes THEN
+  say ----> CORRECT: took non-nested IF clause
+ELIF yes THEN
+  say ---->WRONG: took ELIF
+  IF no THEN
+    say ----> WRONG: took first clause
+  ELIF no THEN
+    SAY ---->WRONG: took ELSE
+  ELSE
+    say ---->CORRECT: took ELSE inside nested IF
+  ENDIF
+ELSE
+  SAY ---->WRONG: took ELSE
+ENDIF
+say ---->all is well following nested multi-line IF
+
+! single line IF nested into multi-line
+IF no THEN
+  say ----> WRONG: took first clause
+ELIF no THEN
+  SAY ---->WRONG: took ELIF
+ELSE
+  say ---->CORRECT: took ELIF -- starting single line nested IF
+  IF no THEN say ---> WRONG: ELSE say ---->CORRECT: took inside nested IF
+ENDIF
+say ---->all is well following embedded single line IF
+
+! test command control source nesting with IF's
+GO bn_if.sub
+IF yes THEN
+  say ---->CORRECT
+ELSE
+  SAY ---->WRONG
+ENDIF
+say ---->all is well following unclosed nested IF
+
+SAY ">>> DELIBERATE ERRORS <<<"
+set mode ignore
+else
+endif
+elif
+cancel mode ignore
+set mode/last verify
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+IF yes THEN
+  say ---->... now inside of IF clause
+
+
+
+
diff --git a/bench/bn_if.sub b/bench/bn_if.sub
new file mode 100644
index 0000000..00929b4
--- /dev/null
+++ b/bench/bn_if.sub
@@ -0,0 +1,25 @@
+! bn430_if.sub
+! 5/6/96
+
+! test closed and unclosed IF in a nested GO command
+
+! single line IF test
+if no then say -->WRONG else say ---->CORRECT endif
+say ---->nested: all is well after single line IF
+
+! IF combined with command groups
+if yes then (say ---->CORRECT; say ---->CORRECT, again) ENDIF
+say ---->nested: all is well after command group and loop tests
+
+! multi-line IF tests
+IF yes THEN
+  say ---->CORRECT
+  say ---->CORRECT again
+ELSE
+  SAY ---->WRONG
+ENDIF
+say ---->nested: all is well after multi-line IF
+
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<"
+IF yes THEN
+  say ---->... now inside of nested IF clause
diff --git a/bench/bn_ifv.jnl b/bench/bn_ifv.jnl
new file mode 100644
index 0000000..02f8855
--- /dev/null
+++ b/bench/bn_ifv.jnl
@@ -0,0 +1,51 @@
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+
+
+
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+CANCEL REGION
+
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+  
+! IFV on string arguments behaves just like IF.
+
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
diff --git a/bench/bn_illegal_axisname.jnl b/bench/bn_illegal_axisname.jnl
new file mode 100644
index 0000000..fe96453
--- /dev/null
+++ b/bench/bn_illegal_axisname.jnl
@@ -0,0 +1,17 @@
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain 
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain 
+! geographic coordinates that we want to substitute for the axes.
+
+use illeg_axname.nc
+sh data
+list/i=1:5 x[gx=sst]
+set view upper; shade sst
+
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+
+list/i=1:5 x[gx=sst]
+set view lower; shade sst
+sh grid sst
diff --git a/bench/bn_in_plane.jnl b/bench/bn_in_plane.jnl
new file mode 100644
index 0000000..535853a
--- /dev/null
+++ b/bench/bn_in_plane.jnl
@@ -0,0 +1,20 @@
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
diff --git a/bench/bn_in_plane.sub b/bench/bn_in_plane.sub
new file mode 100644
index 0000000..a29b9a1
--- /dev/null
+++ b/bench/bn_in_plane.sub
@@ -0,0 +1,27 @@
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+
+! this routine assumes that a 4-D region and an expression are already set
+
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
diff --git a/bench/bn_inf_levels.jnl b/bench/bn_inf_levels.jnl
new file mode 100644
index 0000000..f574af3
--- /dev/null
+++ b/bench/bn_inf_levels.jnl
@@ -0,0 +1,75 @@
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+
+can mode logo
+set win/siz=0.4
+
+use coads_climatology
+
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ppl shade
+
+can view
+
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which 
+!  did not plot color in the entire area for FILL plots.)
+
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+
+
+can view
+
+! horizontal.
+
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ppl fill
+
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ppl shade
+
+! Some one-sided examples
+can view
+
+fill/lev=(-2,28,1)(inf) sst[l=1]
+
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ppl shade
+
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+
+can view
+
+! polygon command
+
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+
+
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+
diff --git a/bench/bn_internal_external_functions.jnl b/bench/bn_internal_external_functions.jnl
new file mode 100644
index 0000000..5947586
--- /dev/null
+++ b/bench/bn_internal_external_functions.jnl
@@ -0,0 +1,88 @@
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+
+GO bn_reset
+go bench_fft
+
+GO bn_reset
+go bench_gridding 
+
+GO bn_reset
+go bn_scat2grid_test
+
+GO bn_reset
+go bn_scat2grid_gl
+
+GO bn_reset
+go bn_scat2gridlaplace_tarasoff
+
+GO bn_reset
+go bn_scat2grid_nobs
+
+GO bn_reset
+go bn_scat2grid_t
+
+GO bn_reset
+go bn_transpose
+
+GO bn_reset
+go bn_unique_str2int
+
+GO bn_reset
+go bench_sort
+
+GO bn_reset
+go bench_eof
+
+GO bn_reset
+go bench_compress_by
+
+GO bn_reset
+go bench_compress
+
+GO bn_reset
+GO bench_internal_string_functions
+
+! 4/2006 these functions now are also internally linked
+
+GO bn_reset
+GO bn_ef_bench_extrema.jnl
+
+GO bn_reset
+GO bn_ef_err541_date_delim.jnl
+
+GO bn_reset
+GO bn_ef_zaxr_fcns.jnl
+
+GO bn_reset
+GO bn_ef_curv_to_rect.jnl
+
+
+! tax_ functions 
+use gt4d011
+
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp) 
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+list/L=15:20 tax_year(t[gt=temp],temp)
+list tax_units(temp)
+
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+
diff --git a/bench/bn_interpolate.jnl b/bench/bn_interpolate.jnl
new file mode 100644
index 0000000..1e3721d
--- /dev/null
+++ b/bench/bn_interpolate.jnl
@@ -0,0 +1,20 @@
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
diff --git a/bench/bn_interpolate.sub b/bench/bn_interpolate.sub
new file mode 100644
index 0000000..136ffac
--- /dev/null
+++ b/bench/bn_interpolate.sub
@@ -0,0 +1,27 @@
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+
+! this routine assumes that a 4-D region and an expression are already set
+
+! cubes of data
+LIST v[@xpt]
+LIST v[@ypt]
+LIST v[@zpt]
+LIST v[@tpt]
+
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+LIST v[@ypt, at tpt]	!XZ
+LIST v[@ypt, at zpt]	!XT
+LIST v[@xpt, at tpt]	!YZ
+LIST v[@xpt, at zpt]	!YT
+LIST v[@xpt, at ypt]	!ZT
+
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
diff --git a/bench/bn_interpolate_6d.jnl b/bench/bn_interpolate_6d.jnl
new file mode 100644
index 0000000..b09fe0d
--- /dev/null
+++ b/bench/bn_interpolate_6d.jnl
@@ -0,0 +1,21 @@
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes 
+! including the E and F axis
+
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
diff --git a/bench/bn_interpolate_6d.sub b/bench/bn_interpolate_6d.sub
new file mode 100644
index 0000000..a61bc5f
--- /dev/null
+++ b/bench/bn_interpolate_6d.sub
@@ -0,0 +1,27 @@
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+
+! this routine assumes that a 4-D region and an expression are already set
+
+! cubes of data
+LIST v[@xpt]
+LIST v[@ypt]
+LIST v[@ept]
+LIST v[@fpt]
+
+! planes of data
+LIST v[@ept, at fpt]	!XY
+LIST v[@ypt, at fpt]	!XE
+LIST v[@ypt, at ept]	!XF
+LIST v[@xpt, at fpt]	!YE
+LIST v[@xpt, at ept]	!YF
+LIST v[@xpt, at ypt]	!EF
+
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
diff --git a/bench/bn_isdepth.jnl b/bench/bn_isdepth.jnl
new file mode 100644
index 0000000..5d74943
--- /dev/null
+++ b/bench/bn_isdepth.jnl
@@ -0,0 +1,21 @@
+! Tests of `var,RETURN=ISDEPTH`
+
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+
+use gtbc011
+say `temp,return=isdepth`
+
+use coads_climatology
+say `sst,return=isdepth`
+
+can data 2
+
+cancel axis/depth `temp,return=zaxis`
+say `temp,return=isdepth`
+
diff --git a/bench/bn_keep_axisnames.jnl b/bench/bn_keep_axisnames.jnl
new file mode 100644
index 0000000..4fd5aac
--- /dev/null
+++ b/bench/bn_keep_axisnames.jnl
@@ -0,0 +1,20 @@
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+
+! save/KEEP_AXISNAMES prevents changes to 
+! axis name when a subset is written.
+
+sh command list
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
diff --git a/bench/bn_keep_axnames.jnl b/bench/bn_keep_axnames.jnl
new file mode 100644
index 0000000..af0ddd6
--- /dev/null
+++ b/bench/bn_keep_axnames.jnl
@@ -0,0 +1,20 @@
+! bn_keep_axnames.jnl
+! 2/2009 ACM
+
+! save/keep_axnames prevents changes to 
+! axis name when a subset is written.
+
+sh command list
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXNAMES a
+
+sp echo "bn_keep_axnames.jnl --- test SAVE/KEEP_AXNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+
+sp echo "bn_keep_axnames.jnl --- without /KEEP_AXNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+
diff --git a/bench/bn_key_label_minmax.jnl b/bench/bn_key_label_minmax.jnl
new file mode 100644
index 0000000..dce4ef4
--- /dev/null
+++ b/bench/bn_key_label_minmax.jnl
@@ -0,0 +1,77 @@
+! bn_key_label_minmax.jnl
+
+! Label data min and max on vertical and horizontal keys
+
+can mode logo
+
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1 
+
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+
+! FILL with min and max on vertical and horizontal keys
+
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+
+! POLYGON with min and max on vertical key
+
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+
+
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+
+! FILL with min and max on vertical and horizontal keys
+
+fill/lev=(4,28,1) temp[z=0]
+
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+
+! POLYGON with min and max on vertical key
+
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+
+! restore setting: keys not annotated
+KEYMARK 0
+
+set mode/last logo
+shade/lev=35 sst[L=1]
+
diff --git a/bench/bn_labnum_calendar.jnl b/bench/bn_labnum_calendar.jnl
new file mode 100644
index 0000000..4cc4c24
--- /dev/null
+++ b/bench/bn_labnum_calendar.jnl
@@ -0,0 +1,13 @@
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+sh sym lab($labnum_calend)
+
diff --git a/bench/bn_labwid.jnl b/bench/bn_labwid.jnl
new file mode 100644
index 0000000..2bc5bcc
--- /dev/null
+++ b/bench/bn_labwid.jnl
@@ -0,0 +1,21 @@
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+
+LIST LABWID("aaaaabbbbb", .15)
+LIST LABWID("aaaaabbbbb", .10)
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+
+
+LIST LABWID("@IISTRING", .15)
+LIST LABWID("@SSSTRING", .15)
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+
+
+go ptest
+
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
diff --git a/bench/bn_last_error.jnl b/bench/bn_last_error.jnl
new file mode 100644
index 0000000..f39d520
--- /dev/null
+++ b/bench/bn_last_error.jnl
@@ -0,0 +1,45 @@
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts) 
+
+
+
+SET MODE IGNORE_ERRORS
+
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+
+
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+
+
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+
+
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+
+
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+
+
+! external function errors via ef_bail_out
+
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+
+
+SET MODE/LAST IGNORE_ERROR
\ No newline at end of file
diff --git a/bench/bn_last_go_file.jnl b/bench/bn_last_go_file.jnl
new file mode 100644
index 0000000..a616aa8
--- /dev/null
+++ b/bench/bn_last_go_file.jnl
@@ -0,0 +1,5 @@
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+
+show sym last_go_file
+
diff --git a/bench/bn_letd.jnl b/bench/bn_letd.jnl
new file mode 100644
index 0000000..b9c017b
--- /dev/null
+++ b/bench/bn_letd.jnl
@@ -0,0 +1,118 @@
+! bn420_letd.jnl
+! 9/1/95
+
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+
+sp touch snoopy.dat
+
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+show var/d
+let/d a = global_default
+show var
+show var/d
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+show var/d=clim_airt_lev
+show data clim_airt_lev
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+show var/d=clim_airt_lev
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+canc data/all
+list/l=1/x=180/y=0 airt
+show var
+
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+show data/full 1
+show var
+
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+can var t3[d=clim_airt_lev]
+show var
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+can var/d=clim_airt_lev t1
+show var
+can var/all/d=clim_airt_lev
+show var
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+
+! test for the behavior of bug 1336 by listing contents of variables;
+
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+
+use v12file
+use v1file
+
+list v1  ! from vfile
+let/d v1 = 0
+let/d v2 = 2
+
+list v1  ! v1 exists in default data set so use dataset variable
+
+list v2  ! v2 does not exist in default dset so use let/d definition
+
+let/d q = v2
+list q
+list q[d=v12file]
+
diff --git a/bench/bn_lev_symbols.jnl b/bench/bn_lev_symbols.jnl
new file mode 100644
index 0000000..bef3d0d
--- /dev/null
+++ b/bench/bn_lev_symbols.jnl
@@ -0,0 +1,34 @@
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+
+can sym lev*
+define symbol lev_text = ""
+
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+
+
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
diff --git a/bench/bn_linecolors.jnl b/bench/bn_linecolors.jnl
new file mode 100644
index 0000000..204039f
--- /dev/null
+++ b/bench/bn_linecolors.jnl
@@ -0,0 +1,60 @@
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+
+set mode meta linecolors.plt
+
+set mode linec:12
+sho mode linecolors
+
+can win/all
+set win/new
+
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+
+set mode/last meta
+
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+
+can mode linecolors
+sho mode linecolors
+
+! resetting line colors with cancel mode does not 
+! take effect until we do a SET WIN/NEW
+
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+
+can win/all
+set win/new
+
diff --git a/bench/bn_logaxes.jnl b/bench/bn_logaxes.jnl
new file mode 100644
index 0000000..9e30609
--- /dev/null
+++ b/bench/bn_logaxes.jnl
@@ -0,0 +1,41 @@
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+
+! intentional error
+! This wont work - no log of negative values on axis
+
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
diff --git a/bench/bn_long_grid_names.jnl b/bench/bn_long_grid_names.jnl
new file mode 100644
index 0000000..a025b6e
--- /dev/null
+++ b/bench/bn_long_grid_names.jnl
@@ -0,0 +1,163 @@
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+LIST X1
+SHOW DATA
+CAN DATA/ALL
+
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+
+list veven
+list v1234
+stat veven
+
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+
+go bn_reset
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+
+use gtsa056_1    	!kob 4/99
+
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+plot temp
+plot/over temp[g=u]
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+plot/over temp[g=u at ave]
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+plot/over temp[g=u at asn]
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+plot/over temp[g=u,gt=u at ave]
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+
+
+set mode/last diag
+
+go bn_reset
+! regrid_to_user
+
+use coads_climatology
+use levitus_climatology
+
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+show grid
+
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+show grid
+
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+show grid
+
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+let d = c
+list/i=1:4 x[gx=d]
+
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+show grid/dynamic
+
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+show grid/dynamic
+
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+show grid/dynamic
+
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+
+set mode/last ignore
+
+go bn_reset
+
+! dynamic grid commands
+
+use coads_climatology
+use levitus_climatology
+
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
diff --git a/bench/bn_long_revision_num.jnl b/bench/bn_long_revision_num.jnl
new file mode 100644
index 0000000..dbf1cb4
--- /dev/null
+++ b/bench/bn_long_revision_num.jnl
@@ -0,0 +1,18 @@
+! bn_long_revision_num.jnl 
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+
+! ferret version
+sh sym FERRET_VERSION
+
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+
+! label in upper right
+go ptest; sh sym lab1
+
+! show commands without an argument, lists version number at the top
+sho command
diff --git a/bench/bn_long_symnames.jnl b/bench/bn_long_symnames.jnl
new file mode 100644
index 0000000..69ec602
--- /dev/null
+++ b/bench/bn_long_symnames.jnl
@@ -0,0 +1,30 @@
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+
+! SHOW
+show symbol ferret_temperature_*
+
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+
+can sym *max
+
+show symbol ferret_temperature_*
+
+
+! bn_symbols had a line to 
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
diff --git a/bench/bn_longvarnames.jnl b/bench/bn_longvarnames.jnl
new file mode 100644
index 0000000..fddaec0
--- /dev/null
+++ b/bench/bn_longvarnames.jnl
@@ -0,0 +1,38 @@
+! variable names up to 128 characters long 
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+
+! With a transformation, which makes the whole specification longer 
+
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+
+
+
+! save to a file a variable that is 128 long
+GO bn_reset
+
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+
+! read from the file
+GO bn_reset
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+
+! save a 4-D variable
+GO bn_reset
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+
+GO bn_reset
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
diff --git a/bench/bn_lsl_lowpass.jnl b/bench/bn_lsl_lowpass.jnl
new file mode 100644
index 0000000..13814ee
--- /dev/null
+++ b/bench/bn_lsl_lowpass.jnl
@@ -0,0 +1,13 @@
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+
+! List the output so its not just a graphical test; 
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+
diff --git a/bench/bn_many_polygons.jnl b/bench/bn_many_polygons.jnl
new file mode 100644
index 0000000..dbbeed0
--- /dev/null
+++ b/bench/bn_many_polygons.jnl
@@ -0,0 +1,26 @@
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+
+! Test that everythings properly reset afterwards. 
+! single polygon.
+
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+
+! Now test that is still also works with the 2-D mode of polygons.
+
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
diff --git a/bench/bn_mc.jnl b/bench/bn_mc.jnl
new file mode 100644
index 0000000..a6d693a
--- /dev/null
+++ b/bench/bn_mc.jnl
@@ -0,0 +1,47 @@
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+
+!look at data set with regular time axis
+set data coads_clim.des
+sh data/var 
+sh grid/t sst
+list/x=140w/y=-8:8 sst
+list/y=0/x=180e:140w sst
+stat sst
+
+! move next to irregular data set
+set data coads_clim_irreg.des
+sh data/var
+sh grid/t sst
+list/x=140w/y=-8:8 sst
+list/y=0/x=180e:140w sst
+stat sst
+
+! now test a delta in the descriptor equal to zero...should get an error message
+set mode ignore
+set data coads_clim_bad_delta.des
+
+!now test out of order stpe file
+set data coads_clim_step_order.des
+
+!Now check for missing first step file
+can data/all
+set data coads_clim_missing_step1.des
+sh data/var
+list sst
+
+!Now check for a missing step file other than the first
+can data/all
+set data coads_clim_missing_stepN.des
+sh data/var
+list sst
+can mode ignore
+set mode/last verify
+
+
diff --git a/bench/bn_mc_vary_scale.jnl b/bench/bn_mc_vary_scale.jnl
new file mode 100644
index 0000000..6c91c17
--- /dev/null
+++ b/bench/bn_mc_vary_scale.jnl
@@ -0,0 +1,33 @@
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the 
+!   scale and offset from the first stepfile were applied. 
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the 
+!   latest scaling applied
+
+
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+
+list tt
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+
+
+can data/all
+can mem
+set data vary_scale.des
+
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+
+
+can data/all
+can mem
+set data vary_scale.des
+
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+
diff --git a/bench/bn_median.jnl b/bench/bn_median.jnl
new file mode 100644
index 0000000..d6feabf
--- /dev/null
+++ b/bench/bn_median.jnl
@@ -0,0 +1,29 @@
+! Test median smoothing tranform
+! Default length is 3
+
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+
+set mode ignore
+! Argument to the median smoother must be odd.
+
+plot/trans var, var[z=@med:4]
+
+set mode/last ignore
+
diff --git a/bench/bn_memory_symbol.jnl b/bench/bn_memory_symbol.jnl
new file mode 100644
index 0000000..89c49e3
--- /dev/null
+++ b/bench/bn_memory_symbol.jnl
@@ -0,0 +1,18 @@
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07 
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+     
+sh sym ferret_memory
+
+set mem/siz=90
+sh sym ferret_memory
+show memory
+
+set mem/size=0.05
+sh sym ferret_memory
+
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+
+set mem/siz=25.6  ! return to the default setting
+show memory
diff --git a/bench/bn_min_max_smoothers.jnl b/bench/bn_min_max_smoothers.jnl
new file mode 100644
index 0000000..f7eea5d
--- /dev/null
+++ b/bench/bn_min_max_smoothers.jnl
@@ -0,0 +1,27 @@
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window. 
+sh trans
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+
diff --git a/bench/bn_mn_fcns.jnl b/bench/bn_mn_fcns.jnl
new file mode 100644
index 0000000..3a2e82e
--- /dev/null
+++ b/bench/bn_mn_fcns.jnl
@@ -0,0 +1,77 @@
+! bn_mn_fcns.jnl
+! test functions in the E/F directions: 
+! compress, reverse, sort, sample, convolve
+
+
+define axis/y=-20:20:1/units=degrees_north yaxis
+define axis/e=1:22:2 eaxis
+define axis/f=1-jan-1990:9-jan-1990:1/units=days/t0=1-jan-1980 faxis
+
+let yfvar = y[gy=yaxis] + 30*sin(_f[gf=faxis])
+
+let/bad=999 fgap = if yfvar gt  -30  and yfvar lt -19 then 999 else yfvar
+set view ul;
+shade fgap
+
+set view ur; shade compressn(fgap)
+
+set view ll; shade freverse(fgap)
+
+let sortv = sortn(yfvar[y=5])
+set view lr; shade samplen(yfvar, sortv[y=5])
+
+list/y=5 yfvar, fgap, compressn(fgap), freverse(fgap), samplen(yfvar[y=5], sortv)
+
+can view
+
+let ee = e[ge=eaxis]
+let yevar = y[gy=yaxis] + 30*sin(_e[ge=eaxis]/6)
+
+let/bad=999 egap = if yevar gt 20  and yevar lt 23 then 999 else yevar
+
+
+set view ul; shade/trans egap
+
+set view ur; shade/trans compressm(egap)
+set view ll; shade/trans ereverse(egap)
+
+let sortv = sortm(yevar[y=5])
+set view lr; shade/trans samplem(yevar,sortv)
+
+list/y=5 yevar, egap, compressm(egap), ereverse(egap), samplem(yevar[y=5], sortv)
+
+
+
+
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+
+! In I
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+
+! In M
+let b = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = esequence({.25,.5,.25})
+list b, b[l=@spz], convolvem(b,{.25,.5,.25})
+
+! in N
+let d = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = fsequence({.25,.5,.25})
+list d, d[l=@spz], convolven(d,{.25,.5,.25})
+
+! In I
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+
+! In M
+! 2D - convolvem convolves in e ...
+let a = b + y[y=1:2]
+list/order=ey  a, a[n=@spz], convolvem(a,{.25,.5,.25})
+
+! In N
+! 2D - convolvem convolves in e ...
+let a = d + y[y=1:2]
+list/order=fy  a, a[n=@spz], convolven(a,{.25,.5,.25})
+
diff --git a/bench/bn_mode_logo_lab.jnl b/bench/bn_mode_logo_lab.jnl
new file mode 100644
index 0000000..c18d71d
--- /dev/null
+++ b/bench/bn_mode_logo_lab.jnl
@@ -0,0 +1,57 @@
+
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+
+
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+
+
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+contour/i=1:10/j=1:10 i/j 
+
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+
+
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+! KMS - white changed to green for PyFerret - white causing problems
+plot/vs/over/line/color=green {1,4}, {1,9}
+
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
diff --git a/bench/bn_mode_nlevels.jnl b/bench/bn_mode_nlevels.jnl
new file mode 100644
index 0000000..0dd6bf3
--- /dev/null
+++ b/bench/bn_mode_nlevels.jnl
@@ -0,0 +1,23 @@
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+
+show mode nlevels
+use levitus_climatology
+
+shade temp
+show sym lev*
+
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+
+! restore (new) default
+set mode nlevels 40
+
diff --git a/bench/bn_mode_nodata_lab.jnl b/bench/bn_mode_nodata_lab.jnl
new file mode 100644
index 0000000..1d05371
--- /dev/null
+++ b/bench/bn_mode_nodata_lab.jnl
@@ -0,0 +1,26 @@
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+
+SHOW MODE nodata_lab
+
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+
+set mode/last nodata_lab
+
diff --git a/bench/bn_modnbd.jnl b/bench/bn_modnbd.jnl
new file mode 100644
index 0000000..0adfa8b
--- /dev/null
+++ b/bench/bn_modnbd.jnl
@@ -0,0 +1,18 @@
+! Test MODNBD regridding statistic.
+
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+
+set region/x=140/y=1/k=1
+
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+
+! Define a new var with some missing data. See what MODNGD and MODNBD 
+! are, and check that the sum is the same as the number of pts in each 
+! month in the no-missing-data variable
+
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
diff --git a/bench/bn_modstats.jnl b/bench/bn_modstats.jnl
new file mode 100644
index 0000000..6641e8c
--- /dev/null
+++ b/bench/bn_modstats.jnl
@@ -0,0 +1,20 @@
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+
+!use climatological_axes
+!can data climatological_axes
+
+list var[gt=month_reg at mod]
+
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+list var[gt=month_reg at modmin]
+list var[gt=month_reg at modmax]
+list var[gt=month_reg at modsum]
+list var[gt=month_reg at modngd]
diff --git a/bench/bn_modulo_attribute.jnl b/bench/bn_modulo_attribute.jnl
new file mode 100644
index 0000000..ed8d022
--- /dev/null
+++ b/bench/bn_modulo_attribute.jnl
@@ -0,0 +1,11 @@
+! Ferret V5.50 m
+
+! Modulo attribute can take numerical values to indicate 
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute             
+
+use modulo_lon_time
+
+sh ax lon*
+sh ax tim*
+
diff --git a/bench/bn_modulo_strides.jnl b/bench/bn_modulo_strides.jnl
new file mode 100644
index 0000000..b79c0a8
--- /dev/null
+++ b/bench/bn_modulo_strides.jnl
@@ -0,0 +1,80 @@
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2] 
+list/nohead b            ! using rdstride
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+list/nohead b            ! reuse of cached result
+set mode/last diag
+
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+list/nohead a[i=19:23:2]
+list/nohead a[i=20:23:2]
+list/nohead a[i=18:24:2]
+list/nohead a[i=19:24:2]
+list/nohead a[i=20:24:2]
+
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+list/nohead a[i=18:23:3]
+list/nohead a[i=19:23:3]
+list/nohead a[i=20:23:3]
+list/nohead a[i=17:24:3]
+list/nohead a[i=18:24:3]
+list/nohead a[i=19:24:3]
+list/nohead a[i=20:24:3]
+list/nohead a[i=17:25:3]
+list/nohead a[i=18:25:3]
+list/nohead a[i=19:25:3]
+list/nohead a[i=20:25:3]
+
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+list/nohead a[i=2:45:5]
+list/nohead a[i=3:45:5]
+list/nohead a[i=4:45:5]
+list/nohead a[i=5:45:5]
+list/nohead a[i=6:45:5]
+list/nohead a[i=101:145:5]
+list/nohead a[i=102:145:5]
+list/nohead a[i=103:145:5]
+list/nohead a[i=104:145:5]
+list/nohead a[i=105:145:5]
+list/nohead a[i=106:145:5]
+
+
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+set mode/last diag
+
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+list/nohead str[i=20:23:2]
+
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+list/nohead str[i=18:23:3]
+
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+list/nohead str[i=5:45:5]
+list/nohead str[i=101:145:5]
+list/nohead str[i=105:145:5]
diff --git a/bench/bn_movie.jnl b/bench/bn_movie.jnl
new file mode 100644
index 0000000..4a9ee3a
--- /dev/null
+++ b/bench/bn_movie.jnl
@@ -0,0 +1,24 @@
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+
+! Dont run this script - fails with hdf5 libraries 
+exit/script
+
+sp rm bench.mgm
+SHOW MOVIE
+SET MOVIE/FILE=bench.mgm
+SHOW MOVIE
+SET WIND/SIZE=.2
+
+contour/i=1:100/j=1:100/lev=(-1,1,.5) sin(i/10)*cos(j/7)
+contour/i=1:100/j=1:100/lev=(-1,1,.5)/over sin(i/10)*cos(j/7+3.14/2)
+FRAME
+
+sp ls -l bench.mgm
+
+REPEAT/K=1:14 (contour/i=1:100/j=1:100/lev=(-1,1,.5) sin(i/10+k*3.14/15)*cos(j/7); contour/i=1:100/j=1:100/lev=(-1,1,.5)/over sin(i/10-k*3.14/15)*cos(j/7+3.14/2); FRAME)
+
+sp ls -l bench.mgm
diff --git a/bench/bn_mp_zoo.jnl b/bench/bn_mp_zoo.jnl
new file mode 100644
index 0000000..4a9ee58
--- /dev/null
+++ b/bench/bn_mp_zoo.jnl
@@ -0,0 +1,80 @@
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml 
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr 
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+
+use coads_climatology
+set region/l=1/y=0:90
+
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+
+can region
+cancel viewport
+exit
+
diff --git a/bench/bn_multi_decade.jnl b/bench/bn_multi_decade.jnl
new file mode 100644
index 0000000..e7c435f
--- /dev/null
+++ b/bench/bn_multi_decade.jnl
@@ -0,0 +1,60 @@
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot 
+
+cancel view
+
+! Test vertical time axes.
+
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot 
diff --git a/bench/bn_multi_line_labels.jnl b/bench/bn_multi_line_labels.jnl
new file mode 100644
index 0000000..201ded2
--- /dev/null
+++ b/bench/bn_multi_line_labels.jnl
@@ -0,0 +1,126 @@
+     ! bn_multi_line_labels.jnl     
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+
+
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+
+   
+
+plot/i=1:100 i*cos(i/8)
+
+
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+
+
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+
+
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+
+set view lower
+ppl axlen `($ppl$xlen)-1`
+
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+
+! reset
+can view
+ppl axlen,8
+
+! size and rotate moveable labels.
+
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+
+ppl rlabs,4,0
diff --git a/bench/bn_n_open_dsets_sym.jnl b/bench/bn_n_open_dsets_sym.jnl
new file mode 100644
index 0000000..8a319c9
--- /dev/null
+++ b/bench/bn_n_open_dsets_sym.jnl
@@ -0,0 +1,35 @@
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+
+! Initially should be zero
+sh sym N_OPEN_DSETS
+
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+
+! Check
+sh sym N_OPEN_DSETS
+
+! Open a few more. Any type of data
+set data tok_short.des
+
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+
+! now  there are five
+sh sym N_OPEN_DSETS
+
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+
+! Now three
+sh sym N_OPEN_DSETS
+
+can dat/all
+sh sym N_OPEN_DSETS
+
diff --git a/bench/bn_nco_append.jnl b/bench/bn_nco_append.jnl
new file mode 100644
index 0000000..11d8b3c
--- /dev/null
+++ b/bench/bn_nco_append.jnl
@@ -0,0 +1,18 @@
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+
+! Write a file to be appended to and append variable in z1.nc to the file.
+
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
diff --git a/bench/bn_nco_functions.jnl b/bench/bn_nco_functions.jnl
new file mode 100644
index 0000000..067ead5
--- /dev/null
+++ b/bench/bn_nco_functions.jnl
@@ -0,0 +1,43 @@
+ ! tests of external functions NCO and NCO_ATTR  
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+
+sh func nco*
+
+
+let a = {1,2,3,4,5}
+let b = {1,2,3,4,5}
+save/clobber/file=x.nc a, b
+can var/all
+use x
+
+! nco_attr for issuing nco_attr command
+
+let status = nco_attr("x.nc", "`a,return=xaxis`", "cartesian_axis", "c", "o", "X")
+load status
+let status = nco_attr("x.nc", "B", "units", "c", "o", "lon")
+load status
+let status = nco_attr("x.nc", "global", "history", "c","a"," Add text to history attribute")
+load status
+sp echo "bn_nco_functions.jnl --- original file" >> all_ncdump.out
+sp ncdump -h x.nc >> all_ncdump.out
+let status = nco_attr("x.nc", "global", "history", "c","a","\nAdd a new line  to the history")
+load status
+sp echo "bn_nco_functions.jnl --- add line to history" >> all_ncdump.out
+sp ncdump -h x.nc >> all_ncdump.out
+
+use coads_climatology
+save/clobber/file=s1.nc/L=1/x=181:185/y=9 sst
+save/clobber/file=s2.nc/L=2/x=181:185/y=9 sst
+save/clobber/file=s3.nc/L=3/x=181:185/y=9 sst
+can data coads_climatology
+
+! function nco makes any nco call
+
+let status = nco("ncrcat", "s1.nc s2.nc s3.nc s123.nc")
+load status
+sp echo "bn_nco_functions.jnl --- ncrcat call" >> all_ncdump.out
+sp ncdump -h s123.nc >> all_ncdump.out
+use s123.nc
+list/i=1 sst
diff --git a/bench/bn_negative_t.jnl b/bench/bn_negative_t.jnl
new file mode 100644
index 0000000..4112440
--- /dev/null
+++ b/bench/bn_negative_t.jnl
@@ -0,0 +1,64 @@
+! bn450_negative_t - 10/97
+
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+
+
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+
+! ****** test transformations ********
+
+GO bn_negative_t.sub tvar ave  ! like var and din
+GO bn_negative_t.sub tvar iin
+GO bn_negative_t.sub tvar sum
+GO bn_negative_t.sub tvar rsu
+GO bn_negative_t.sub tvar shf
+GO bn_negative_t.sub tvar min   ! like @max
+GO bn_negative_t.sub tvar ddf
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+GO bn_negative_t.sub tvar loc:-2.2
+GO bn_negative_t.sub tvar weq:-2.2
+
+! transformations requiring gappy data to test
+LIST tgap
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+
+
+! ****** test regridding ********
+
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+GO bn_negative_t.sub bave nul
+GO bn_negative_t.sub basn nul
+
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+CANCEL MODE ignore_error
+
diff --git a/bench/bn_negative_t.sub b/bench/bn_negative_t.sub
new file mode 100644
index 0000000..23c2142
--- /dev/null
+++ b/bench/bn_negative_t.sub
@@ -0,0 +1,15 @@
+! bn450_neg_t_trans.sub
+
+! support routine for bn450_negative_t.jnl
+
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+
+! tvar axis runs from -10 to 10 by 1's
+
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+
diff --git a/bench/bn_netcdf4.jnl b/bench/bn_netcdf4.jnl
new file mode 100644
index 0000000..e9d94c2
--- /dev/null
+++ b/bench/bn_netcdf4.jnl
@@ -0,0 +1,82 @@
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+
+
+
+show nccache
+
+set nccache/siz=4
+
+show nccache
+cancel nccache
+
+show nccache
+
+set nccache/siz=8
+show nccache
+cancel nccache 
+
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+
+
+set var/title=undeflated sst
+
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+
+
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+
+cancel list/all
+
+! Check SHOW LIST, and CANCEL LIST
+
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+
+can list/all
+sh list/all
+
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+
diff --git a/bench/bn_no_valid_on_plot.jnl b/bench/bn_no_valid_on_plot.jnl
new file mode 100644
index 0000000..eee5152
--- /dev/null
+++ b/bench/bn_no_valid_on_plot.jnl
@@ -0,0 +1,32 @@
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+
+! and now valid data overlaid with all-missing data
+
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+
+SET MODE/last nodata_lab
diff --git a/bench/bn_nobounds.jnl b/bench/bn_nobounds.jnl
new file mode 100644
index 0000000..a385500
--- /dev/null
+++ b/bench/bn_nobounds.jnl
@@ -0,0 +1,31 @@
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+
+! See the bounds attribute on the t axis
+sh dat/att
+
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+
+! On a SAVE either with /BOUNDS or no bounds qualifier, 
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+
+sp ncdump -h a.nc	
+
diff --git a/bench/bn_nocoords.jnl b/bench/bn_nocoords.jnl
new file mode 100644
index 0000000..2141a4d
--- /dev/null
+++ b/bench/bn_nocoords.jnl
@@ -0,0 +1,39 @@
+! bn_nocoords.jnl
+!  5/2013
+! Save data with the /NOCOORDS option.
+! This puts dimensions in the dataset but 
+! does not write coordinate axes.
+
+use test_100x100.nc
+sh dat/att
+
+save/clobber/file=aa.nc/nocoords/i=50:55/j=48:52 a
+
+! This is what we SAVEd.
+list/i=50:55/j=48:52 a
+
+can mem; can data/all
+
+! The same data is in the file, but with no coordinate axes.
+use aa.nc
+sh dat/att
+
+! When it uses this dataset, Ferret just creates abstract axes.
+list a
+
+! For writing a Discrete Geometries file, dont write coordinate variables.
+! Keep things in lowercase, keep original axis names, and add a global attribute.
+can dat/all
+can var/all
+
+use dsg.nc
+
+! Add a global attribute on the next SAVE
+define att/output ..featureType = "profile"
+
+can mode upcase
+save/nocoord/file=dsg_nocoord.nc/keep/clobber rowsize, profile, time, latitude, longitude, pot_temp_degc, sal
+sp ncdump -h dsg_nocoord.nc
+
+set mode/last upcase
+
diff --git a/bench/bn_non_COARDS_netCDF.jnl b/bench/bn_non_COARDS_netCDF.jnl
new file mode 100644
index 0000000..fdd25c6
--- /dev/null
+++ b/bench/bn_non_COARDS_netCDF.jnl
@@ -0,0 +1,33 @@
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+
+! test robust treatment of non-standard netCDF files
+
+use non_COARDS
+
+show data
+show grid/x HAS_NO_AXIS
+show grid/x HAS_UNORDERED_AXIS
+show grid/x HAS_GAPPY_AXIS
+show grid/x HAS_BACKWARDS_AXIS
+show grid/x SCALAR_VAR
+
+show grid/i=1:5 USES_BIG_IRREG
+
+show grid MASKED_SST
+show grid COADSX
+show grid COADSY
+
+show data
+list UNORDERED_AXIS
+list GAPPY_AXIS
+list SCALAR_VAR
+list TRUE_SCALAR
+list HAS_BACKWARDS_AXIS
+
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+
+! list/i=1:5 BIG_IRREG
diff --git a/bench/bn_odd_variable_name.jnl b/bench/bn_odd_variable_name.jnl
new file mode 100644
index 0000000..20c2a31
--- /dev/null
+++ b/bench/bn_odd_variable_name.jnl
@@ -0,0 +1,26 @@
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+set mem /size=10
+use weird_name1.cdf
+sh data
+set mode ignore
+list v1
+list 'v1'
+list v2-and-minus    		! Deliberate error 
+list 'v2-and-minus'  		! Now the proper syntax
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+list 'V1' - 'v1'
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+list v1[i=6:15 at sbx:3]
+list 'v1'[i=6:15 at sbx:3]
+list 'I'-'X'/'v2-and-minus'
+list v1[i=@max]
+list 'v1'[i=@max] 
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+! restore orginal memory size
+set mem /size=`save_mem`
diff --git a/bench/bn_output.jnl b/bench/bn_output.jnl
new file mode 100644
index 0000000..cae3634
--- /dev/null
+++ b/bench/bn_output.jnl
@@ -0,0 +1,44 @@
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD 
+SET LIST/PRECISION=6
+LIST
+SHOW LIST
+CANCEL LIST/PRECISION
+LIST
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+LIST/FORMAT=(1X,10F6.1)
+CANCEL LIST/FORMAT
+LIST
+CANCEL LIST/HEAD
+LIST
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
diff --git a/bench/bn_output.sub b/bench/bn_output.sub
new file mode 100644
index 0000000..2862a61
--- /dev/null
+++ b/bench/bn_output.sub
@@ -0,0 +1,95 @@
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+LIST/ORDER=XYTZ
+LIST/ORDER=XZYT
+LIST/ORDER=XZTY
+LIST/ORDER=XTYZ
+LIST/ORDER=XTZY
+LIST/ORDER=YXZT
+LIST/ORDER=YXTZ
+LIST/ORDER=YZXT
+LIST/ORDER=YZTX
+LIST/ORDER=YTXZ
+LIST/ORDER=YTZX
+LIST/ORDER=ZXYT
+LIST/ORDER=ZXTY
+LIST/ORDER=ZYXT
+LIST/ORDER=ZYTX
+LIST/ORDER=ZTXY
+LIST/ORDER=ZTYX
+LIST/ORDER=TXYZ
+LIST/ORDER=TXZY
+LIST/ORDER=TYXZ
+LIST/ORDER=TYZX
+LIST/ORDER=TZXY
+LIST/ORDER=TZYX
+
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+LIST/ORDER=YTZ
+LIST/ORDER=ZYT
+LIST/ORDER=ZTY
+LIST/ORDER=TYZ
+LIST/ORDER=TZY
+
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+LIST/ORDER=XTZ
+LIST/ORDER=ZXT
+LIST/ORDER=ZTX
+LIST/ORDER=TXZ
+LIST/ORDER=TZX
+
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+LIST/ORDER=XTY
+LIST/ORDER=YXT
+LIST/ORDER=YTX
+LIST/ORDER=TXY
+LIST/ORDER=TYX
+
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+LIST/ORDER=XZY
+LIST/ORDER=YXZ
+LIST/ORDER=YZX
+LIST/ORDER=ZXY
+LIST/ORDER=ZYX
+
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+LIST/ORDER=TZ
+
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+LIST/ORDER=TY
+
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+LIST/ORDER=ZY
+
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+LIST/ORDER=TX
+
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+LIST/ORDER=ZX
+
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+LIST/ORDER=YX
+
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+LIST/I=1/J=3:4/K=5/L=7
+LIST/I=1/J=3/K=5:6/L=7
+LIST/I=1/J=3/K=5/L=7:8
diff --git a/bench/bn_outtype.jnl b/bench/bn_outtype.jnl
new file mode 100644
index 0000000..267b56f
--- /dev/null
+++ b/bench/bn_outtype.jnl
@@ -0,0 +1,102 @@
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+
+let sst2 = 2*sst
+set var/outtype=double sst2
+
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! shows the outtype
+show list
+
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+cancel list/all
+show list
+
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+
+
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+
+! Go back to default setting.
+can list/outtype
diff --git a/bench/bn_packed_coordinates.jnl b/bench/bn_packed_coordinates.jnl
new file mode 100644
index 0000000..e4dd673
--- /dev/null
+++ b/bench/bn_packed_coordinates.jnl
@@ -0,0 +1,77 @@
+! bn_packed_coordinates
+! NCO operator ncpdq packs all the data including
+! coords, in a file. Need to implement unpacking coordinates
+! Also ncpdq handles missing-data differently than the CF conventions.
+
+SP rm -f packed.nc
+SP ncpdq fine_x_axis.nc packed.nc
+USE packed.nc
+
+! Check that the coordinates packed by ncpdq are unpacked ok.
+LIST/i=1:15 sst
+
+
+! We can write the data out - saving the scaling to re-pack.
+SET ATT/OUTPUT sst.scale_factor
+SET ATT/OUTPUT sst.add_offset
+
+SAVE/CLOBBER/FILE=mypack.nc/I=1:15 sst
+
+USE mypack
+SH ATT/ALL sst
+CANCEL DATA mypack
+SET DATA packed
+
+! Ferret does not allow writing packed axis because
+! of loss of precision - cant verify coordinates.
+! If we try, then Ferret returns a warning and does not pack.
+
+SET MODE IGNORE
+LET allatts = (`sst,return=xaxis`).attnames
+IF `IS_ELEMENT_OF_STR(allatts, "scale_factor")` THEN SET ATT/OUTPUT (`sst,RETURN=xaxis`).scale_factor
+IF `IS_ELEMENT_OF_STR(allatts, "add_offset")` THEN SET ATT/OUTPUT (`sst,RETURN=xaxis`).add_offset
+
+SAVE/CLOBBER/FILE=mypack.nc/I=1:15 sst
+SET MODE/LAST IGNORE
+
+USE mypack
+SH ATT/ALL sst
+CANCEL DATA mypack
+
+
+! Notice that the missing-values were not packed by ncpdq
+! in a way that corresponds to the CF conventions.
+! (ncpdq scales the missing data but does not list the
+!  scaled VALUE of the missing-data flag. It assumes we
+!  will apply the scaling and THEN look for values of 
+!  missing-flag. This is the opposite order of ops compared 
+!  to what CF specifies.)
+
+USE packed.nc
+PLOT sst
+
+! Will pack the data value using Ferret 
+! But not the coord values.
+
+! Get the scale and offset as determined by ncpdq
+LET scale_to_use = `sst.scale_factor`
+LET off_to_use = `sst.add_offset`
+
+CAN DATA/ALL
+USE fine_x_axis.nc
+SET VAR/NAME=sst_in sst
+
+LET/units="`sst_in,RETURN=units`" sst = MISSING(sst_in,2000)
+SET VAR/BAD=2000 sst
+SET VAR/OUTTYPE=short sst
+
+DEFINE ATTRIBUTE sst.scale_factor = `scale_to_use`
+DEFINE ATTRIBUTE sst.add_offset = `off_to_use`
+SET ATT/OUTPUT  sst.scale_factor
+SET ATT/OUTPUT  sst.add_offset
+SAVE/CLOBBER/FILE=short_sst.nc sst
+
+
+CAN VAR/ALL
+USE short_sst
+PLOT sst_in[d=1], sst[d=2]
diff --git a/bench/bn_pattern.jnl b/bench/bn_pattern.jnl
new file mode 100644
index 0000000..67fa384
--- /dev/null
+++ b/bench/bn_pattern.jnl
@@ -0,0 +1,43 @@
+! pattern_bench.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+
+set view full
+
+use coads_climatology
+set reg/l=3/y=50s:60n/x=100e:60w
+set mode cal months
+
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+
+! Note that colors are set in the usual way...
+
+set win 1
+
+set mode meta pattern_plot1.plt
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns/nolabel sst
+
+go land thick
+
+! Colors and patterns can be overlaid; patterns are transparent
+
+set win 2
+
+set data coads_climatology
+set data clim_airt_lev.cdf
+set reg/l=1:3/y=50s:60n/x=100e:60w
+set mode cal months
+
+set mode meta pattern_plot2.plt
+fill/lev=(0,33,3)/nolabel sst[l=@ave,d=1]
+
+fill/lev=(25,27,1)/over/nolab/pal=black/pat=angled_grid/nolabel airt[l=@ave]
+label/user,200,-30,-1,0,.15, at trAIRT gt 25 and lt 27 deg. C
+
+go land thick
+
+!can data/all
+can win 2
+set win 1
+can mode meta
diff --git a/bench/bn_plot.jnl b/bench/bn_plot.jnl
new file mode 100644
index 0000000..61653b0
--- /dev/null
+++ b/bench/bn_plot.jnl
@@ -0,0 +1,174 @@
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+
+set mode/last logo
diff --git a/bench/bn_plot_color_only.jnl b/bench/bn_plot_color_only.jnl
new file mode 100644
index 0000000..77f85b4
--- /dev/null
+++ b/bench/bn_plot_color_only.jnl
@@ -0,0 +1,74 @@
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+
+
+set view upper
+plot/color b, b[i=@shf:20]
+
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+
+cancel mode linecolors
+can win/all; set win/new
+
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+
+can view
+set mode ignore
+
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+
+set mode/last ignore
+
+
diff --git a/bench/bn_plot_nokey.jnl b/bench/bn_plot_nokey.jnl
new file mode 100644
index 0000000..70148ad
--- /dev/null
+++ b/bench/bn_plot_nokey.jnl
@@ -0,0 +1,18 @@
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004  
+
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
diff --git a/bench/bn_polygon.jnl b/bench/bn_polygon.jnl
new file mode 100644
index 0000000..790104e
--- /dev/null
+++ b/bench/bn_polygon.jnl
@@ -0,0 +1,21 @@
+! Demo of new POLYGON command
+! *jd * 3.99
+
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+
+let ypts = x/10
+let xpts = cos(x/10)
+
+set win/asp=.4
+
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+polygon/trans/line=6/fill/over/lev/i=1:100/opac=25/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+
+can mode meta
diff --git a/bench/bn_ppl_errors.jnl b/bench/bn_ppl_errors.jnl
new file mode 100644
index 0000000..7bf61a0
--- /dev/null
+++ b/bench/bn_ppl_errors.jnl
@@ -0,0 +1,17 @@
+! bn_ppl_errors.jnl
+! ACM 8/2007
+ 
+! Routine cmderr used to send its messages to std output rather than std error.
+! Collect here some pplus error messages.
+
+SET MODE ignore  ! needed only for Ferret errors not PPLUS errors
+
+use coads_climatology
+shade/l=1/set sst  
+ppl yremar nr  ! cmderr
+
+shade/L=1/levels=(a,b,c) sst  ! cmderr
+
+shade/L=1/levels=300 sst  ! This is caught on the Ferret side.
+
+CANCEL MODE ignore
diff --git a/bench/bn_proleptic_gregorian_calendar.jnl b/bench/bn_proleptic_gregorian_calendar.jnl
new file mode 100644
index 0000000..dac0bc3
--- /dev/null
+++ b/bench/bn_proleptic_gregorian_calendar.jnl
@@ -0,0 +1,7 @@
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+
+set data proleptic_gregorian.nc
+show data
+show axis tdays
diff --git a/bench/bn_ps.jnl b/bench/bn_ps.jnl
new file mode 100644
index 0000000..4f5d073
--- /dev/null
+++ b/bench/bn_ps.jnl
@@ -0,0 +1,82 @@
+! bn450_ps.JNL - copied from bn450_plot.jnl
+! this journal file only tests the writing of ps files in batch mode using
+! "-batch bnplot.ps" command line option...will create on final ps file
+! *kob*
+
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+
+set mode ignore
+frame/file=bnplot.ps    ! DELIBERATE ERROR MESSAGE
+can mode ignore
+exit/command
+
+
+
diff --git a/bench/bn_randu2_randn2.jnl b/bench/bn_randu2_randn2.jnl
new file mode 100644
index 0000000..3148589
--- /dev/null
+++ b/bench/bn_randu2_randn2.jnl
@@ -0,0 +1,67 @@
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+
+can mode ver
+
+let xbig = x[i=1:20000:1]
+let xx = x[i=1:6:1]
+
+! RANDU2 with seed init via system clock. These should be different
+! load the variable to make sure some time has passed on the clock.
+
+! ******** This result may differ with each run of the benchmark scripts
+load randu2(xbig,-1)
+list/format=("randu2_randn2", f12.3)/i=1:5 randu2(xbig,-1)
+can mem
+list/format=("randu2_randn2", f12.3)/i=1:5 randu2(xbig,-1)
+
+! ******** This result may differ with each run of the benchmark scripts
+! RANDU2 with 0 seed to continue from previous seed. These should be different
+list/format=("randu2_randn2", f12.3) randu2(xx,0)
+can mem
+list/format=("randu2_randn2", f12.3) randu2(xx,0)
+
+! ******** This result should be consistent with each run of the benchmark scripts
+! RANDU2 with user-set seed. These should be duplicates
+list/format=("randu2_randn2", f12.3) randu2(xx,12436)
+can mem
+list/format=("randu2_randn2", f12.3) randu2(xx,12436)
+
+!same tests with RANDN2
+
+! ******** This result may differ with each run of the benchmark scripts
+! RANDN2 with clock-set seed. These should be different
+load randn2(xbig,-1)
+list/format=("randu2_randn2", f12.3)/i=1:5 randn2(xbig,-1)
+can mem
+list/format=("randu2_randn2", f12.3)/i=1:5 randn2(xbig,-1)
+
+! ******** This result may differ with each run of the benchmark scripts
+! RANDN2 with 0 seed to continue from previous seed. These should be different
+list/format=("randu2_randn2", f12.3) randn2(xx,0)
+can mem
+list/format=("randu2_randn2", f12.3) randn2(xx,0)
+
+! ******** This result should be consistent with each run of the benchmark scripts
+! RANDN2 with user-set seed. These should be duplicates
+list/format=("randu2_randn2", f12.3) randn2(xx,12436)
+can mem
+list/format=("randu2_randn2", f12.3) randn2(xx,12436)
+
+! A test from the median-smoothing benchmark
+
+! ******** This result may differ with each run of the benchmark scripts
+define axis/z=0:1000:20/depth zax
+let var2 = cos(z[gz=zax]/30) + randu2(1+k[gz=zax],-1)
+plot/trans var2, var2[z=@med:3], var2[z=@med:9]
+list/format=("randu2_randn2", 3f12.3)/z=1:140 var2, var2[z=@med:3], var2[z=@med:9]
+
+set mode/last ver
diff --git a/bench/bn_redefine_taxis_mc.jnl b/bench/bn_redefine_taxis_mc.jnl
new file mode 100644
index 0000000..cb9832b
--- /dev/null
+++ b/bench/bn_redefine_taxis_mc.jnl
@@ -0,0 +1,17 @@
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+
+! Redefine the time axis of a multi-file data set. 
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+
+set data coads_clim.des
+list/x=180/y=0 sst
+
+def sym taxisname  `sst,return=taxis`
+
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+list/x=180/y=0 sst
+
+def axis/t=1:6:1 ($taxisname)
+list/x=180/y=0 sst
diff --git a/bench/bn_regrid.jnl b/bench/bn_regrid.jnl
new file mode 100644
index 0000000..d603f9e
--- /dev/null
+++ b/bench/bn_regrid.jnl
@@ -0,0 +1,129 @@
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+
+! third test consists of time axis regridding with differing time steps
+
+set mode latit_label -4
+set mode long_label -4
+
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+
+! background
+list veven
+list v1234
+stat veven
+
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+stat vcoarse,vfine
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+stat vcoarse,vfine
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+list a48
+list a24[g=g48]
+list a24[g=g48]-a48
diff --git a/bench/bn_regrid.sub b/bench/bn_regrid.sub
new file mode 100644
index 0000000..276d950
--- /dev/null
+++ b/bench/bn_regrid.sub
@@ -0,0 +1,18 @@
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+
+stat v1[g=even]-veven, v1
+stat v2[g=even]-veven, v2
+stat v3[g=even]-veven, v3
+stat v4[g=even]-veven, v4
+stat v12[g=even]-veven, v12
+stat v13[g=even]-veven, v13
+stat v14[g=even]-veven, v14
+stat v23[g=even]-veven, v23
+stat v24[g=even]-veven, v24
+stat v33[g=even]-veven, v33
+stat v234[g=even]-veven, v234
+stat v134[g=even]-veven, v134
+stat v124[g=even]-veven, v124
+stat v123[g=even]-veven, v123
+stat v1234[g=even]-veven, v1234
diff --git a/bench/bn_regrid_6d.jnl b/bench/bn_regrid_6d.jnl
new file mode 100644
index 0000000..486bbf4
--- /dev/null
+++ b/bench/bn_regrid_6d.jnl
@@ -0,0 +1,123 @@
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+
+set mode latit_label -4
+set mode long_label -4
+
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+
+! background
+list veven
+list v1234
+stat veven
+
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+stat vcoarse,vfine
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+stat vcoarse,vfine
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+list a48
+
+list a24[g=g48]
+list a24[g=g48]-a48
+
diff --git a/bench/bn_regrid_to_user.jnl b/bench/bn_regrid_to_user.jnl
new file mode 100644
index 0000000..b1ae0d2
--- /dev/null
+++ b/bench/bn_regrid_to_user.jnl
@@ -0,0 +1,113 @@
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+
+! test various regridding combos that involve user-defined variables
+! for the target grids
+
+use coads_climatology
+use levitus_climatology
+
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+show grid
+
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+show grid
+
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+show grid
+
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+let d = c
+list/i=1:4 x[gx=d]
+
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+show grid/dynamic
+
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+show grid/dynamic
+
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+show grid/dynamic
+
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+list a1[gx=a2]
+list a1[gxy=a2]
+list a1[gzxy=a2]
+list a1[gxz=a2]
+
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])  
+
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+list/j=1:5 j
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+SHOW GRID/DYNAMIC
+
diff --git a/bench/bn_regrid_transforms.jnl b/bench/bn_regrid_transforms.jnl
new file mode 100644
index 0000000..16df6e3
--- /dev/null
+++ b/bench/bn_regrid_transforms.jnl
@@ -0,0 +1,260 @@
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that 
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+
+use gtsa056_1    	!kob 4/99
+
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+load temp[gx=@ave]   ! no target grid specified
+load temp[g=u,g=w]   ! more than 1 target grid
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+set mode/last ignore
+
+! valid syntax tests
+load temp
+load temp[g=u]
+load temp[g=u at lin]
+load temp[g=u at ave,gy=@asn]
+load temp[g=u at lin,gy=@asn]
+load temp[g=u,gx=@ave,gy=@asn]
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+
+! basic regrid tests
+LIST temp[g=u at ave]
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+
+LIST temp[g=u]
+LIST temp[g=u at asn]
+LIST temp[g=u,gx=u at asn]
+LIST temp[g=u,gy=u at asn]
+LIST temp[g=u,gz=u at asn]
+LIST temp[g=u,gt=u at asn]
+
+! Z and T axes different
+LIST temp[g=g5day at ave]
+LIST temp[g=g5day,gx=g5day at ave]
+LIST temp[g=g5day,gy=g5day at ave]
+LIST temp[g=g5day,gz=g5day at ave]
+LIST temp[g=g5day,gt=g5day at ave]
+
+LIST temp[g=g5day]
+LIST temp[g=g5day at asn]
+LIST temp[g=g5day,gx=g5day at asn]
+LIST temp[g=g5day,gy=g5day at asn]
+LIST temp[g=g5day,gz=g5day at asn]
+LIST temp[g=g5day,gt=g5day at asn]
+
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+LIST temp[g=g5_10,gx=g5_10 at ave]
+LIST temp[g=g5_10,gy=g5_10 at ave]
+LIST temp[g=g5_10,gz=g5_10 at ave]
+LIST temp[g=g5_10,gt=g5_10 at ave]
+
+LIST temp[g=g5_10 at asn]
+LIST temp[g=g5_10,gx=g5_10 at asn]
+LIST temp[g=g5_10,gy=g5_10 at asn]
+LIST temp[g=g5_10,gz=g5_10 at asn]
+LIST temp[g=g5_10,gt=g5_10 at asn]
+
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+load temp[g=u]
+load temp[g=u at lin]
+
+load temp[g=u at ave]
+load temp[g=u,gx=u at ave]
+load temp[g=u,gy=u at ave]
+
+load temp[g=u at asn]
+load temp[g=u,gx=u at asn]
+load temp[g=u,gy=u at asn]
+
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+
+load temp[g=u at ave]
+load temp[g=u,gz=u at ave]
+load temp[g=u,gt=u at ave]
+
+load temp[g=u at asn]
+load temp[g=u,gz=u at asn]
+load temp[g=u,gt=u at asn]
+SET MODE/LAST IGNORE	! V.5 change
+
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+plot/over temp[g=u]
+plot/over temp[g=g5day]
+plot/over temp[g=g5_10]
+plot/over temp[g=u at ave]
+plot/over temp[g=g5day at ave]
+plot/over temp[g=g5_10 at ave]
+plot/over temp[g=u at asn]
+plot/over temp[g=g5day at asn]
+plot/over temp[g=u,gx=u at ave]
+plot/over temp[g=g5day,gx=g5day at ave]
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+plot/over temp[g=u]
+plot/over temp[g=g5day]
+plot/over temp[g=g5_10]
+plot/over temp[g=u at ave]
+plot/over temp[g=g5day at ave]
+plot/over temp[g=g5_10 at ave]
+plot/over temp[g=u at asn]
+plot/over temp[g=g5day at asn]
+plot/over temp[g=u,gy=u at ave]
+plot/over temp[g=g5day,gy=g5day at ave]
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+plot temp
+plot/over temp[g=u]
+plot/over temp[g=g5day]
+plot/over temp[g=g5_10]
+plot/over temp[g=u at ave]
+plot/over temp[g=g5day at ave]
+plot/over temp[g=g5_10 at ave]
+plot/over temp[g=u at asn]
+plot/over temp[g=g5_10 at asn]
+plot/over temp[g=u,gt=u at ave]
+plot/over temp[g=g5day,gt=g5day at ave]
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+
+set mode/last interp
+cancel region
+
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+
+list a1[gx=xoffset at ave]
+list a1[gx=xoffset at sum] ! should sum to 5
+list a1[gx=xoffset at var] ! should be all missing
+
+list a2[gx=xoffset at ave]
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+list a2[gx=xoffset at var]
+
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+
+let a1 = x[gx=x1pt]
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+
+list a1[gx=xoffset at max]
+list a2[gx=xoffset at max]
+list a4[gx=xoffset at max]
+list a4[gx=xoffset at min]
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+let a5 = x[gx=x5_edges, i=3]
+list a5[gx=x5 at max]
+list a5[gx=x5 at max,i=3]
+list a5[gx=x5 at max,i=4]
+
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+show grid
+list atime[gt=thour at max]
+show grid
+
+set mode/last diag
+
+
+
+
+
diff --git a/bench/bn_regrid_transforms_6d.jnl b/bench/bn_regrid_transforms_6d.jnl
new file mode 100644
index 0000000..4c687b6
--- /dev/null
+++ b/bench/bn_regrid_transforms_6d.jnl
@@ -0,0 +1,99 @@
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+
+use gtsa056_1_ef
+set mode diag
+
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+
+use gtsa056_1_ef    	!kob 4/99
+
+stat temp[g=g5day] - temp[g=g5day at ave]  
+
+! basic regrid tests
+LIST temp[g=g5day at ave]
+LIST temp[g=g5day]	
+
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+
+SET MODE/LAST IGNORE	! V.5 change
+
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+plot/over temp[g=g5day]
+plot/over temp[g=g5day at ave]
+plot/over temp[g=g5day at asn]
+
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+plot/over temp[g=g5day]
+plot/over temp[g=g5day at ave]
+plot/over temp[g=g5day at asn]
+
+set mode/last interp
+cancel region
+
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+
+
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+list a1[ge=eoffset at var, gf=fax4day at var]
+
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+list a2[ge=eoffset at sum, gf=fax4day at sum] 
+list a2[ge=eoffset at var, gf=fax4day at var]
+
+! 1/00 additions to check details of @MIN, at MAX bevavior
+
+let a1 = _e[ge=e1pt]
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+
+list a1[ge=eoffset at max]
+list a2[ge=eoffset at max]
+list a4[ge=eoffset at max]
+list a4[ge=eoffset at min]
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+show grid
+list afcst[gf=ehour at max]
+show grid
+
+set mode/last diag
diff --git a/bench/bn_regulart.jnl b/bench/bn_regulart.jnl
new file mode 100644
index 0000000..6509f79
--- /dev/null
+++ b/bench/bn_regulart.jnl
@@ -0,0 +1,15 @@
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+
+use coads_vwnd
+show axis tcoads
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+can data/all
+
+use/regulart coads_vwnd
+show axis tcoads
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+
diff --git a/bench/bn_repeat_range.jnl b/bench/bn_repeat_range.jnl
new file mode 100644
index 0000000..92cfcb5
--- /dev/null
+++ b/bench/bn_repeat_range.jnl
@@ -0,0 +1,100 @@
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+
+! simplest syntax
+
+repeat/range=5:1:-1 say what
+repeat/range=1:5:3/name=s (list/nohead s)
+sh var s  ! counter variable goes away after a repeat
+
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+
+! Nested, use counter variables in computation
+can mode ver
+repeat/range=80:1:-20/name=m (can mode ver; repeat/ran=6:10/name=p \
+ (if `mod(p,2) eq 0` then list/nohead m, p, p*m)  )
+set mode ver
+
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+repeat/range=1:5/name=p (let a = 6; list p)
+
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+
+can region
+
+! factorial
+can mode ver
+let a = 0; let f = 1
+let labl = "factorial"
+repeat/range=1:6 (let/quiet a = `a+1`; let/quiet f = `f*a`; list/nohead a,labl, f)
+set mode ver
+
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+cancel mode diag
+
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a` 
+
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+list/l=1/x=181/y=1 sst
+can data/all
+
+! Intentional errors 
+set mode ignore
+
+! /NAME without /RANGE
+rep/name=a say `a`  
+
+! Cannot use pseudo-variables.
+
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+
+
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+cancel mode ignore
diff --git a/bench/bn_repeated_coords.jnl b/bench/bn_repeated_coords.jnl
new file mode 100644
index 0000000..dff21b3
--- /dev/null
+++ b/bench/bn_repeated_coords.jnl
@@ -0,0 +1,23 @@
+! Test the use of micro-adjusting on NetCDF read 
+! when coordinates are repeated.
+! See ticket 1910
+
+! Axis has repeated coordinate values. 
+
+use repeat_t_coord.nc
+show grid a
+show axis tmin
+list a[L=1:71:10]
+
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+
+use/strict repeat_t_coord.nc
+show grid a
+show axis tmin
+
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+
diff --git a/bench/bn_repl_9999999.jnl b/bench/bn_repl_9999999.jnl
new file mode 100644
index 0000000..43a7848
--- /dev/null
+++ b/bench/bn_repl_9999999.jnl
@@ -0,0 +1,9 @@
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999   
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+can view view9999999
diff --git a/bench/bn_reset.jnl b/bench/bn_reset.jnl
new file mode 100644
index 0000000..88811d1
--- /dev/null
+++ b/bench/bn_reset.jnl
@@ -0,0 +1,20 @@
+cancel mode verify
+
+! 11/99 *sh* for V5.1 - added CANCEL MODE DIAGNOSTIC
+!		-- outputs were getting too long and difficult to read
+!		-- individual benchmarks must now specify MODE DIAG if needed
+!  5/00 *acm* added CANCEL MODE IGNORE_ERRORS
+!  7/09 *acm* added CANCEL VIEWPORTS
+
+! reset FERRET to prepare for another benchmark test
+CANCEL REGION/ALL
+CANCEL DATA/ALL
+CANCEL VARIABLES/ALL
+CANCEL MEMORY/ALL
+SET GRID ABSTRACT
+CANCEL MODE DIAGNOSTIC
+CANCEL MODE IGNORE_ERROR
+CANCEL VIEWPORTS
+PPL TICS .125,.25,.125,.25 !reset tics to default
+
+set mode/last verify
diff --git a/bench/bn_reset_attributes.jnl b/bench/bn_reset_attributes.jnl
new file mode 100644
index 0000000..594625d
--- /dev/null
+++ b/bench/bn_reset_attributes.jnl
@@ -0,0 +1,107 @@
+! bn_reset_attributes.jnl
+! acm 6/14/2004
+! tests of SET AXIS/CALENDAR  /T0  /UNITS  also CANCEL AXIS/DEPTH
+! also RETURN=calendar
+
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+
+sh axis `temp,return=taxis`
+list/l=20:25 t[gt=temp]
+
+! New RETURN=calendar
+def sym calname = `temp,return=calendar`
+
+! SET AXIS/CALENDAR=  julian, 360-day, 365_day=julian, 366_day=all_leap, standard=gregorian
+set axis/calendar=julian `temp,return=taxis`
+list/l=20:25 temp
+say `temp,return=calendar`
+
+set axis/calendar=360_day `temp,return=taxis`
+list/l=20:25 temp
+say `temp,return=calendar`
+
+set axis/calendar=365_day `temp,return=taxis`
+say `temp,return=calendar`
+
+set axis/calendar=nol `temp,return=taxis`
+list/l=20:25 temp
+say `temp,return=calendar`
+
+set axis/calendar=366 `temp,return=taxis`
+say `temp,return=calendar`
+
+set axis/calendar=all_leap `temp,return=taxis`
+say `temp,return=calendar`
+list/l=20:25 temp
+
+! Now resetting T0
+CAN DATA/ALL
+use gt4d011.cdf
+set region/x=130w/y=1/k=1
+
+set axis/calendar="standard" `temp,return=taxis`
+list/l=20:25 temp
+
+! One day earlier
+set axis/t0="13-jan-1980:14:00" `temp,return=taxis`
+say `temp,return=calendar`
+list/l=20:25 t[gt=temp]
+
+
+! Now resetting UNITS
+CAN DATA/ALL
+CAN REGION
+use gt4d011.cdf
+
+set axis/units=feet `temp,return=zaxis`
+show axis `temp,return=zaxis`
+
+! unrecognized units
+set axis/units="something" `temp,return=xaxis`
+show axis `temp,return=xaxis`
+
+! restore lon
+set axis/units=lon `temp,return=xaxis`
+show axis `temp,return=xaxis`
+
+set axis/units=something `temp,return=xaxis`
+show axis `temp,return=xaxis`
+
+! restore lon using word DEG
+set axis/units=deg `temp,return=xaxis`
+show axis `temp,return=xaxis`
+
+set axis/units=zorro  `temp,r=zaxis`
+list/x=130w/y=1/k=1/L=1:5 temp
+
+! not a geographic axis
+set axis/units=meters `temp,return=yaxis`
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+
+set axis/units=deg `temp,return=yaxis`
+show axis `temp,return=yaxis`
+list/x=222/k=1/l=1/y=-0.5:0.5 temp
+
+! inappropriate units for axis direction
+set axis/units=meters `temp,return=taxis`
+list/x=130w/y=1/k=1/l=1:5 temp
+
+set axis/units=seconds  `temp,r=yaxis`
+show grid temp
+
+! assign time units to an abstract axis
+def axis/t=1:5:1 tax
+
+set axis/units=days/t0=1-jan-1990 tax
+sh axis tax
+list t[gt=tax]
+
+! assign longitude units to an abstract axis
+! by default this becomes modulo
+def axis/x=0:120:20 xax
+
+set axis/units=lon xax
+sh axis xax
+list x[gx=xax]
+
diff --git a/bench/bn_return_xmod_tmod.jnl b/bench/bn_return_xmod_tmod.jnl
new file mode 100644
index 0000000..3e9c7b4
--- /dev/null
+++ b/bench/bn_return_xmod_tmod.jnl
@@ -0,0 +1,32 @@
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+
+use ocean_atlas_temp
+sh grid temp
+sh axis XAX_LEV9421_380
+sh axis time
+say `temp,return=xmod`
+say `temp,return=tmod`
+
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+say `temp,return=tmod`
+
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub 
+let a = x[gx=xsub]
+say `a,return=xmod`
+
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+show axis x2ax
+say `axy,return=xmod`
diff --git a/bench/bn_ribbon_plot.jnl b/bench/bn_ribbon_plot.jnl
new file mode 100644
index 0000000..48b03d2
--- /dev/null
+++ b/bench/bn_ribbon_plot.jnl
@@ -0,0 +1,114 @@
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+
+show alias ribbon
+
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+
+! xpts, ypts all present, compare when var has missing.
+
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+
+
+! Testing other palettes
+
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+
+
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+
+PLOT/vs/over/sym=20 xpts,ypts
+
+
+can view
+
+! Do an overlay on a map. 
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
diff --git a/bench/bn_sample.jnl b/bench/bn_sample.jnl
new file mode 100644
index 0000000..4c6addb
--- /dev/null
+++ b/bench/bn_sample.jnl
@@ -0,0 +1,153 @@
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+
+! test the internally optimized version of the SAMPLE* commands
+
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+SHOW MEM/FREE
+
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result 
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+
+! these should NOT break up the access into chunks
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+let/quiet a = sst[i=30:40]
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+cancel memory/all
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+cancel memory/all
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+cancel memory/all
+
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+cancel memory/all
+load/l=1/y=0 sst[I=30:39]
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+cancel memory/all
+load/l=1/y=0 sst[I=30:40]
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+cancel memory/all
+load/l=1/y=0 sst[I=30:41]
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+set mode/last diagnostic
+
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+show grid/dyn
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+show grid/dyn
+
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+set mode/last diagnostic
+
+SHOW MEM/FREE
+
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+
diff --git a/bench/bn_samplexyt.jnl b/bench/bn_samplexyt.jnl
new file mode 100644
index 0000000..9f9a26b
--- /dev/null
+++ b/bench/bn_samplexyt.jnl
@@ -0,0 +1,36 @@
+! bn_samplexyt.jnl
+! 1/2009
+
+! Check the SAMPLEXYT function, should give missing results for T sample points 
+! that lie beyond the ends of the T axis of the grid being sampled
+
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+
+
+set mode calendar
diff --git a/bench/bn_samplexz.jnl b/bench/bn_samplexz.jnl
new file mode 100644
index 0000000..88518df
--- /dev/null
+++ b/bench/bn_samplexz.jnl
@@ -0,0 +1,20 @@
+! bn_samplexz.jnl
+! check the samplexz function
+
+define axis /x=0:360:30 /units=longitude /edges /modulo=360 xlong
+define axis /z /depth /units=meters zdep={0,10,20,30,50,75,100,150,250}
+define grid /x=xlong /z=zdep xzgrid
+
+let my_data = x[g=xzgrid] + z[g=xzgrid]
+show var my_data
+show grid my_data
+list z[g=xzgrid]
+
+define axis /z=-25:325:50 /depth /units=meters zsampax
+let zpts = xsequence(z[gz=zsampax])
+let xpts = xsequence((randu(zpts) - 0.5) * 360)
+let sampl_pts = samplexz(my_data,xpts,zpts)
+ 
+! check the results with a listing
+list xpts, zpts, sampl_pts
+
diff --git a/bench/bn_sampleyz.jnl b/bench/bn_sampleyz.jnl
new file mode 100644
index 0000000..07edff3
--- /dev/null
+++ b/bench/bn_sampleyz.jnl
@@ -0,0 +1,20 @@
+! bn_samplexz.jnl
+! check the samplexz function
+
+define axis /y=-90:90:10 /units=latitude /edges ylat
+define axis /z /depth /units=meters zdep={0,10,20,30,50,75,100,150,250}
+define grid /y=ylat /z=zdep yzgrid
+
+let my_data = y[g=yzgrid] + z[g=yzgrid]
+show var my_data
+show grid my_data
+list z[g=yzgrid]
+
+define axis /z=-25:325:50 /depth /units=meters zsampax
+let zpts = ysequence(z[gz=zsampax])
+let ypts = ysequence((randu(zpts) - 0.5) * 90)
+let sampl_pts = sampleyz(my_data,ypts,zpts)
+ 
+! check the results with a listing
+list ypts, zpts, sampl_pts
+
diff --git a/bench/bn_scat2grid_bin.jnl b/bench/bn_scat2grid_bin.jnl
new file mode 100644
index 0000000..af1e24e
--- /dev/null
+++ b/bench/bn_scat2grid_bin.jnl
@@ -0,0 +1,92 @@
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+
+! define some variables (as in bench_gridding)
+
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+
+
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+
+! Now the NBIN functios
+
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+
+
+! Now the XYT functions
+
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+
+
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+
+can var/all
+use a.nc
+stat sgrid
+stat ngrid
+list/x=2:3/L=3 sgrid
+list/x=2:3/L=3 ngrid
+
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+
diff --git a/bench/bn_scat2grid_gl.jnl b/bench/bn_scat2grid_gl.jnl
new file mode 100644
index 0000000..d5f993b
--- /dev/null
+++ b/bench/bn_scat2grid_gl.jnl
@@ -0,0 +1,95 @@
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+
+list X[gx=x_11]
+
+list /i=1:33 smxy_xs, smxy_ys, smxy
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+
+list /i=1:33 smxz_xs, smxz_zs, smxz
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+
+list /i=1:33 smxt_xs, smxt_ts, smxt
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+
+list /j=1:33 smyz_ys, smyz_zs, smyz
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+
+list /j=1:33 smyt_ys, smyt_ts, smyt
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+
+list /k=1:33 smzt_zs, smzt_ts, smzt
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+
diff --git a/bench/bn_scat2grid_nobs.jnl b/bench/bn_scat2grid_nobs.jnl
new file mode 100644
index 0000000..7559b87
--- /dev/null
+++ b/bench/bn_scat2grid_nobs.jnl
@@ -0,0 +1,45 @@
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+
+list X[gx=x_11]
+
+list /i=1:33 smxy_xs, smxy_ys, smxy
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+
diff --git a/bench/bn_scat2grid_t.jnl b/bench/bn_scat2grid_t.jnl
new file mode 100644
index 0000000..15b05fd
--- /dev/null
+++ b/bench/bn_scat2grid_t.jnl
@@ -0,0 +1,22 @@
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+
diff --git a/bench/bn_scat2grid_test.jnl b/bench/bn_scat2grid_test.jnl
new file mode 100644
index 0000000..6c0ec4e
--- /dev/null
+++ b/bench/bn_scat2grid_test.jnl
@@ -0,0 +1,111 @@
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+
+set data scat2grid.nc
+
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+
+! XZ
+
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+
+! XT
+
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+
+! YZ
+
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+
+! YT
+
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+
+! ZT
+
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+
+can mem/all
+
+! SCAT2GRIDLAPLACE functions
+
+! XY
+
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+
+! XZ
+
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+
+! XT
+
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+
+! YZ
+
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+
+! YT
+
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+
+! ZT
+
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+
diff --git a/bench/bn_scat2gridlaplace_tarasoff.jnl b/bench/bn_scat2gridlaplace_tarasoff.jnl
new file mode 100644
index 0000000..5db28f3
--- /dev/null
+++ b/bench/bn_scat2gridlaplace_tarasoff.jnl
@@ -0,0 +1,33 @@
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+
+show grid wgtl
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+
+! the folowing are listed /order=yx so no data will be skipped
+
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
diff --git a/bench/bn_set_axis_name.jnl b/bench/bn_set_axis_name.jnl
new file mode 100644
index 0000000..8207933
--- /dev/null
+++ b/bench/bn_set_axis_name.jnl
@@ -0,0 +1,76 @@
+! bn_set_axis_name.jnl
+! ticket 2160 Implementing new qualifier SET AXIS/NAME
+! 3/2014
+!
+!
+! Prepare a dataset with a time axis
+
+define axis/t=1-may-2010:5-may-2010:1/units=days daysaxis
+let a = t[gt=daysaxis]
+save/clobber/file=a.nc a
+
+cancel variable a
+cancel axis daysaxis
+
+!  We define some axis, then open a dataset with an axis of that name.
+
+define axis/t=1-jan-2000:31-jan-2000:1/units=days daysaxis
+
+use a.nc
+
+! The axis in the dataset has been renamed.
+say `a,return=taxis`
+
+! So, rename our user-defined axis
+set axis/name=days2000 daysaxis
+
+! and now rename the one from the dataset back to its original name
+set axis/name=daysaxis `a,return=taxis`
+sh grid a
+
+cancel data/all
+
+! If an axis is used in several datsets, renaming it of course
+! changes the name for all grids.
+! The attribute structure gets updated as well.
+
+! Make several datasets with the same x axis.
+define axis/x=1:13:1/units=meters x13axis
+let a = x[gx=x13axis]
+let b = 3*x[gx=x13axis]
+let c = 5*x[gx=x13axis]
+save/clobber/file=a.nc a
+save/clobber/file=b.nc b
+save/clobber/file=c.nc c
+
+can var/all
+can axis x13axis
+
+! Open them in Ferret; all grids are the same.
+use a.nc, b.nc, c.nc
+say `a[d=1],return=xaxis`
+say `b[d=2],return=xaxis`
+say `c[d=3],return=xaxis`
+
+! Rename the axis
+set axis/name=x_in_meters x13axis
+say `a[d=1],return=xaxis`
+say `b[d=2],return=xaxis`
+say `c[d=3],return=xaxis`
+
+! For SHOW DAT/ATT we get info from the attribute structure.
+! It has the udated name.
+sh dat/att
+
+! Intentional errors
+set mode ignore
+
+! Name already in use
+set axis/name=days2000 x_in_meters
+
+! Missing or illegal name
+set axis/name x_in_meters
+set axis/name=45 x_in_meters
+set axis/name=.fr x_in_meters
+
+set mode/last ignore
diff --git a/bench/bn_set_axis_regular.jnl b/bench/bn_set_axis_regular.jnl
new file mode 100644
index 0000000..8926575
--- /dev/null
+++ b/bench/bn_set_axis_regular.jnl
@@ -0,0 +1,53 @@
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+list /format=(F8.5) y
+list myvar
+show grid
+
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+list /format=(F8.5) y
+list myvar
+show grid
+
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+list /format=(F8.5) y
+list myvar
+show grid
+
+! --- clean up
+go bn_reset
+cancel grid mygrid
+
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+list mydata
+show grid
+
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+list mydata
+show grid
+
diff --git a/bench/bn_set_axis_regular.nc b/bench/bn_set_axis_regular.nc
new file mode 100644
index 0000000..69dd75a
Binary files /dev/null and b/bench/bn_set_axis_regular.nc differ
diff --git a/bench/bn_set_cancel_redirect.jnl b/bench/bn_set_cancel_redirect.jnl
new file mode 100644
index 0000000..5a651fa
--- /dev/null
+++ b/bench/bn_set_cancel_redirect.jnl
@@ -0,0 +1,156 @@
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+go /help
+
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+go /help
+
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+go /help
+
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+cancel var contents
+
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+
+! --- 7. produce output to both stdout and stderr
+list wave
+go /help
+
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+go /help
+
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+go /help
+
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8. 
+let contents = { spawn:"cat redirect.txt" }
+list contents
+cancel var contents
+
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13, 
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+list wave
+go /help
+
+! --- 13. cancel the redirection and show the redirect file contents
+! ---     should be the "missing" stdout of 12.
+cancel redirect stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+cancel var contents
+
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+go /help
+
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+cancel var contents
+
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+
+! --- 17. produce some output 
+show grid mygrid
+go /help
+
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+cancel var contents
+
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+
+! --- 22. produce some output to stdout and stderr
+list wave
+go /help
+
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+go /help
+
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+go /help
+
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+go /help
+
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22., 
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+cancel var contents
+
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+
+!!! NOTE: journal mode is now turned off !!!
diff --git a/bench/bn_set_strides.jnl b/bench/bn_set_strides.jnl
new file mode 100644
index 0000000..39c2060
--- /dev/null
+++ b/bench/bn_set_strides.jnl
@@ -0,0 +1,162 @@
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES 
+
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of 
+!            seeing the desired output.
+
+set mode ignore_error
+
+!..............1. ignore STRIDE = 1                             
+use coads_climatology
+show axis `sst,return=xaxis`
+show axis `sst,return=yaxis`
+show axis `sst,return=taxis`
+set axis/stride=1/offset=1 `sst, return=xaxis`
+show axis `sst,return=xaxis`
+cancel data/all
+
+!..............2. illegal to stride an already strided axis   
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+show axis `sst,return=xaxis`
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+show axis `sst,return=xaxis`
+cancel data/all
+
+!..............3. only set STRIDE                                 
+use coads_climatology
+
+! --- before striding
+
+list sst[i=21:30,j=50,k=1,l=50]
+
+! --- after set striding
+
+set axis/stride=2 `sst, return=xaxis`
+list sst[i=11:15,j=50,k=1,l=50]
+
+
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+list sst[i=21:30,j=50,k=1,l=50]
+cancel data/all
+
+!.............4. only set OFFSET                               
+! ingored if you only set OFFSET
+
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+show axis `sst,return=xaxis`
+cancel axis/stride `sst,return=xaxis`
+cancel data/all
+
+
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+cancel data/all
+
+!.............6. SHOW GRID/DYNAMIC          
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+show grid/dynamic
+cancel data/all
+
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+cancel data/all
+
+!.............8. striding on a modulo axis
+
+! --- 8.1 stride value is an integer factor of the axis length 
+! the strided axis will inherit the modulo property of its parent
+
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+show axis `sst,return=xaxis`
+cancel axis/stride `sst,return=xaxis`
+
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+show axis `sst,return=xaxis`
+cancel axis/stride `sst,return=xaxis`
+cancel data/all
+
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+cancel data/all
+
+!.............9. two datasets share the same grid
+
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis` 
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+list/x=180:195/j=30/L=1 sst[d=d2]
+
+cancel data/all
+
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+
+can data/all
+
+!.............10. strides on permuted and reversed axes
+
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+set axis/stride=5 `sst,return=yaxis`
+show axis `sst,return=yaxis`
+
+can data/all
+
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+set axis/stride=5/offset=3 `sst,return=yaxis`
+list/x=180/l=5  sst
+list/x=180/l=5 sst[j=3:14:2]
+
+cancel data/all
+
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+set axis/stride=2 `sst, return=yaxis`
+set axis/stride=2 `sst, return=taxis`
+
+show axis `sst,return=xaxis`
+show axis `sst,return=yaxis`
+show axis `sst,return=taxis`
+
+can data/all
+
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+set mode/last ignore_error
+
+show axis `sst,return=xaxis`
+show axis `sst,return=yaxis`
+show axis `sst,return=taxis`
diff --git a/bench/bn_set_var_name.jnl b/bench/bn_set_var_name.jnl
new file mode 100644
index 0000000..fb231e4
--- /dev/null
+++ b/bench/bn_set_var_name.jnl
@@ -0,0 +1,19 @@
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+
+USE coads_climatology
+
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+
+LIST/X=179:183/Y=40/L=3 my_sst
+
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+
diff --git a/bench/bn_set_var_scale_off.jnl b/bench/bn_set_var_scale_off.jnl
new file mode 100644
index 0000000..77c8584
--- /dev/null
+++ b/bench/bn_set_var_scale_off.jnl
@@ -0,0 +1,33 @@
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+
+! This dataset has scale_factor and add_offset attributes.
+
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+
+! Output the values of the scales and offsets
+
+SAY `elev,RETURN=nc_scale`
+SAY `elev,RETURN=nc_off`
+SAY `elev,RETURN=user_scale`
+SAY `elev,RETURN=user_off`
+
+! These SET VAR will produce error msgs: qualifiers are set up only for 
+! variables in NetCDF files
+
+SET MODE IGNORE_ERROR
+
+FILE/VAR=x1,x2 EZ.DAT
+
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+
+SET MODE/LAST IGNORE_ERROR
diff --git a/bench/bn_shade_keycont.jnl b/bench/bn_shade_keycont.jnl
new file mode 100644
index 0000000..07426db
--- /dev/null
+++ b/bench/bn_shade_keycont.jnl
@@ -0,0 +1,62 @@
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+
+set view ul
+shade/title="default shade key" temp[l=1]
+
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+
+let/quiet x1 = `($ppl$xorg)+0.1`
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+let/quiet y1 = `($ppl$yorg)`
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ppl shade
+
+can view
+
+set view ul
+fill/title="default fill key" temp[l=1]
+
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+
+let/quiet x1 = `($ppl$xorg)+0.1`
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+let/quiet y1 = `($ppl$yorg)`
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ppl fill
diff --git a/bench/bn_shade_trim.jnl b/bench/bn_shade_trim.jnl
new file mode 100644
index 0000000..aae7ae7
--- /dev/null
+++ b/bench/bn_shade_trim.jnl
@@ -0,0 +1,21 @@
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of 
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+
+USE ocean_atlas_temp
+
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+
+! SHADE/TRIM trims the region as for a FILL plot 
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+
diff --git a/bench/bn_shakey.jnl b/bench/bn_shakey.jnl
new file mode 100644
index 0000000..2b4b2d9
--- /dev/null
+++ b/bench/bn_shakey.jnl
@@ -0,0 +1,70 @@
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them 
+!   were applied. With changes as of 3/3/03 can set any of these independently.  
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default 
+!   width and/or height.
+
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+
+shade/title="shift shakey left and up"/set temp[l=1]
+
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+let y1 = `($ppl$yorg)+.4`
+
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ppl shade
+ppl list shakey
+
+shade/title="set only x2,y2"/set temp[l=1]
+
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ppl shade
+ppl list shakey
+
+
+! resetting location of horizontal shade keys
+
+shade/title="shakey labels above it"/set temp[l=1]
+
+let x1 = `($ppl$xorg)+0.1`
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+
+let x1 = `($ppl$xorg)+1`
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+let y1 = `($ppl$yorg)`
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ppl shade
+ppl list shakey
+
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+
+let x1 = `($ppl$xorg)`  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ppl shade
+
+ppl axlabp, -1, -1
+
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ppl shade
+ppl list shakey
diff --git a/bench/bn_short.sub b/bench/bn_short.sub
new file mode 100644
index 0000000..07344a1
--- /dev/null
+++ b/bench/bn_short.sub
@@ -0,0 +1,5 @@
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+
diff --git a/bench/bn_shortgo.jnl b/bench/bn_shortgo.jnl
new file mode 100644
index 0000000..067647e
--- /dev/null
+++ b/bench/bn_shortgo.jnl
@@ -0,0 +1,4 @@
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+
+plot/i=1:15/color=red/thick i
diff --git a/bench/bn_shortgo2.jnl b/bench/bn_shortgo2.jnl
new file mode 100644
index 0000000..176f9c6
--- /dev/null
+++ b/bench/bn_shortgo2.jnl
@@ -0,0 +1,6 @@
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
\ No newline at end of file
diff --git a/bench/bn_show_xml_file.jnl b/bench/bn_show_xml_file.jnl
new file mode 100644
index 0000000..eea13c9
--- /dev/null
+++ b/bench/bn_show_xml_file.jnl
@@ -0,0 +1,33 @@
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+
+USE ocean_atlas_temp.cdf
+
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+
+show var/xml/append/outfile=($output_xml_file)
+show data/var/xml/append/outfile=($output_xml_file)
+say/quiet/outfile=($output_xml_file)/append </data>
+
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1  
+
+
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+
diff --git a/bench/bn_single_colorlev.jnl b/bench/bn_single_colorlev.jnl
new file mode 100644
index 0000000..35a417c
--- /dev/null
+++ b/bench/bn_single_colorlev.jnl
@@ -0,0 +1,16 @@
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when 
+! single level is specified with a range of values
+
+use coads_climatology
+
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+
diff --git a/bench/bn_sort_strings.jnl b/bench/bn_sort_strings.jnl
new file mode 100644
index 0000000..51de901
--- /dev/null
+++ b/bench/bn_sort_strings.jnl
@@ -0,0 +1,62 @@
+! bn_sort_strings.jnl
+! 11/08 acm
+
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+
+SHOW FUNC/DETAIL sorti
+
+
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+
+
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+
+
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+
+
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+
diff --git a/bench/bn_startupfile.jnl b/bench/bn_startupfile.jnl
new file mode 100644
index 0000000..c19274b
--- /dev/null
+++ b/bench/bn_startupfile.jnl
@@ -0,0 +1,19 @@
+! bn_startupfile.jnl
+! When a .ferret startup file is present, test memory and other settings.
+
+SHOW MEMORY
+SH SYM/ALL
+SHOW MODE
+
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+
+SHOW DATA
+
+SHADE/I=71/L=1/TITLE="graticule on, latit labels off, 100 nlevels" temp
+
+SET MODE meta startup_tests2.plt
+PLOT/THICK/LINE/i=1:100/TITLE="Seven colors" \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), cos(i/36), cos(i/40), cos(i/44)
+
+EXIT/COMMAND
diff --git a/bench/bn_stddev.jnl b/bench/bn_stddev.jnl
new file mode 100644
index 0000000..f91a463
--- /dev/null
+++ b/bench/bn_stddev.jnl
@@ -0,0 +1,12 @@
+! bn_std.jnl
+! New StdDev transform
+
+use coads_climatology
+list/x=100/y=10 sst[t=@STD]
+list/x=100/L=1 sst[y=@STD]
+list/y=10/L=1 sst[x=@STD]
+
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@STD]
+list/y=3/l=1 temp[x=@std]
+list/y=3/l=1 temp[z=@std,x=@std]
diff --git a/bench/bn_strdim.jnl b/bench/bn_strdim.jnl
new file mode 100644
index 0000000..eb2db88
--- /dev/null
+++ b/bench/bn_strdim.jnl
@@ -0,0 +1,20 @@
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+
+use strdimfile.nc
+
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+
diff --git a/bench/bn_stream.jnl b/bench/bn_stream.jnl
new file mode 100644
index 0000000..f7ac7b7
--- /dev/null
+++ b/bench/bn_stream.jnl
@@ -0,0 +1,22 @@
+! bn420_stream.jnl
+
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+cancel data stream_data_link.unf
+
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+cancel data stream_data_link.unf
+
diff --git a/bench/bn_strides.cdf b/bench/bn_strides.cdf
new file mode 100644
index 0000000..fd51a3b
Binary files /dev/null and b/bench/bn_strides.cdf differ
diff --git a/bench/bn_strides.cdl b/bench/bn_strides.cdl
new file mode 100644
index 0000000..edf97fe
--- /dev/null
+++ b/bench/bn_strides.cdl
@@ -0,0 +1,27114 @@
+netcdf test_strides {
+dimensions:
+	XAX1_4 = 4 ;
+	YAX1_3 = 3 ;
+	ZAX1_2 = 2 ;
+	TAX1_1 = UNLIMITED ; // (1 currently)
+	XAX1_9 = 9 ;
+	YAX1_8 = 8 ;
+	ZAX1_7 = 7 ;
+	TAX1_6 = 6 ;
+	XAX1_40 = 40 ;
+	YAX1_30 = 30 ;
+	ZAX1_20 = 20 ;
+	TAX1_10 = 10 ;
+	XUNEVEN = 10 ;
+	XUNEVENedges = 11 ;
+	YUNEVEN = 8 ;
+	YUNEVENedges = 9 ;
+	ZAX1_6 = 6 ;
+	TAX1_4 = 4 ;
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = 20 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	double ZAX1_2(ZAX1_2) ;
+		ZAX1_2:point_spacing = "even" ;
+		ZAX1_2:axis = "Z" ;
+	double TAX1_1(TAX1_1) ;
+		TAX1_1:axis = "T" ;
+	float VAR(TAX1_1, ZAX1_2, YAX1_3, XAX1_4) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "L*1000 + K*100 + J*10 + I" ;
+	double XAX1_9(XAX1_9) ;
+		XAX1_9:point_spacing = "even" ;
+		XAX1_9:axis = "X" ;
+	double YAX1_8(YAX1_8) ;
+		YAX1_8:point_spacing = "even" ;
+		YAX1_8:axis = "Y" ;
+	double ZAX1_7(ZAX1_7) ;
+		ZAX1_7:point_spacing = "even" ;
+		ZAX1_7:axis = "Z" ;
+	double TAX1_6(TAX1_6) ;
+		TAX1_6:point_spacing = "even" ;
+		TAX1_6:axis = "T" ;
+	float MIDVAR(TAX1_6, ZAX1_7, YAX1_8, XAX1_9) ;
+		MIDVAR:missing_value = -1.e+34f ;
+		MIDVAR:_FillValue = -1.e+34f ;
+		MIDVAR:long_name = "VAR" ;
+	double XAX1_40(XAX1_40) ;
+		XAX1_40:point_spacing = "even" ;
+		XAX1_40:axis = "X" ;
+	double YAX1_30(YAX1_30) ;
+		YAX1_30:point_spacing = "even" ;
+		YAX1_30:axis = "Y" ;
+	double ZAX1_20(ZAX1_20) ;
+		ZAX1_20:point_spacing = "even" ;
+		ZAX1_20:axis = "Z" ;
+	double TAX1_10(TAX1_10) ;
+		TAX1_10:point_spacing = "even" ;
+		TAX1_10:axis = "T" ;
+	float BIGVAR(TAX1_10, ZAX1_20, YAX1_30, XAX1_40) ;
+		BIGVAR:missing_value = -1.e+34f ;
+		BIGVAR:_FillValue = -1.e+34f ;
+		BIGVAR:long_name = "VAR" ;
+	double XUNEVEN(XUNEVEN) ;
+		XUNEVEN:point_spacing = "uneven" ;
+		XUNEVEN:axis = "X" ;
+		XUNEVEN:edges = "XUNEVENedges" ;
+	double XUNEVENedges(XUNEVENedges) ;
+		XUNEVENedges:edges = " " ;
+	double YUNEVEN(YUNEVEN) ;
+		YUNEVEN:point_spacing = "uneven" ;
+		YUNEVEN:axis = "Y" ;
+		YUNEVEN:edges = "YUNEVENedges" ;
+	double YUNEVENedges(YUNEVENedges) ;
+		YUNEVENedges:edges = " " ;
+	double ZAX1_6(ZAX1_6) ;
+		ZAX1_6:point_spacing = "even" ;
+		ZAX1_6:axis = "Z" ;
+	double TAX1_4(TAX1_4) ;
+		TAX1_4:point_spacing = "even" ;
+		TAX1_4:axis = "T" ;
+	float UNEVENVAR(TAX1_4, ZAX1_6, YUNEVEN, XUNEVEN) ;
+		UNEVENVAR:missing_value = -1.e+34f ;
+		UNEVENVAR:_FillValue = -1.e+34f ;
+		UNEVENVAR:long_name = "L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]" ;
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "DAYS since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901" ;
+		TTIME:point_spacing = "even" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+
+// global attributes:
+		:history = "FERRET V5.00 (debug)  8-Jul-99" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ ZAX1_2 = 1, 2 ;
+
+ TAX1_1 = 1 ;
+
+ VAR =
+  1111, 1112, 1113, 1114,
+  1121, 1122, 1123, 1124,
+  1131, 1132, 1133, 1134,
+  1211, 1212, 1213, 1214,
+  1221, 1222, 1223, 1224,
+  1231, 1232, 1233, 1234 ;
+
+ XAX1_9 = 1, 2, 3, 4, 5, 6, 7, 8, 9 ;
+
+ YAX1_8 = 1, 2, 3, 4, 5, 6, 7, 8 ;
+
+ ZAX1_7 = 1, 2, 3, 4, 5, 6, 7 ;
+
+ TAX1_6 = 1, 2, 3, 4, 5, 6 ;
+
+ MIDVAR =
+  1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119,
+  1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129,
+  1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139,
+  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,
+  1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159,
+  1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169,
+  1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179,
+  1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189,
+  1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219,
+  1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229,
+  1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239,
+  1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249,
+  1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259,
+  1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269,
+  1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279,
+  1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289,
+  1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319,
+  1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329,
+  1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339,
+  1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349,
+  1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359,
+  1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369,
+  1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379,
+  1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389,
+  1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419,
+  1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429,
+  1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439,
+  1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449,
+  1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459,
+  1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469,
+  1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479,
+  1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489,
+  1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519,
+  1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529,
+  1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539,
+  1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549,
+  1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559,
+  1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569,
+  1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579,
+  1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589,
+  1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619,
+  1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629,
+  1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639,
+  1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649,
+  1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659,
+  1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669,
+  1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679,
+  1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689,
+  1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719,
+  1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729,
+  1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739,
+  1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749,
+  1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759,
+  1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769,
+  1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779,
+  1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789 ;
+
+ XAX1_40 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
+    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 
+    38, 39, 40 ;
+
+ YAX1_30 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
+    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ;
+
+ ZAX1_20 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ;
+
+ TAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ BIGVAR =
+  1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 
+    1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 
+    1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 
+    1147, 1148, 1149, 1150,
+  1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 
+    1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 
+    1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 
+    1157, 1158, 1159, 1160,
+  1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 
+    1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 
+    1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 
+    1167, 1168, 1169, 1170,
+  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 
+    1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 
+    1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 
+    1177, 1178, 1179, 1180,
+  1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 
+    1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 
+    1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 
+    1187, 1188, 1189, 1190,
+  1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 
+    1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 
+    1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 
+    1197, 1198, 1199, 1200,
+  1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 
+    1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 
+    1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 
+    1207, 1208, 1209, 1210,
+  1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 
+    1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 
+    1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 
+    1217, 1218, 1219, 1220,
+  1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 
+    1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 
+    1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 
+    1227, 1228, 1229, 1230,
+  1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 
+    1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 
+    1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 
+    1237, 1238, 1239, 1240,
+  1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 
+    1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 
+    1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 
+    1247, 1248, 1249, 1250,
+  1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 
+    1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 
+    1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 
+    1257, 1258, 1259, 1260,
+  1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 
+    1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 
+    1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 
+    1267, 1268, 1269, 1270,
+  1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 
+    1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 
+    1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 
+    1277, 1278, 1279, 1280,
+  1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 
+    1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 
+    1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 
+    1287, 1288, 1289, 1290,
+  1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 
+    1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 
+    1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 
+    1297, 1298, 1299, 1300,
+  1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 
+    1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 
+    1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 
+    1307, 1308, 1309, 1310,
+  1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 
+    1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 
+    1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 
+    1317, 1318, 1319, 1320,
+  1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 
+    1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 
+    1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 
+    1327, 1328, 1329, 1330,
+  1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 
+    1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 
+    1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 
+    1337, 1338, 1339, 1340,
+  1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 
+    1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 
+    1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 
+    1347, 1348, 1349, 1350,
+  1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 
+    1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 
+    1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 
+    1357, 1358, 1359, 1360,
+  1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 
+    1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 
+    1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 
+    1367, 1368, 1369, 1370,
+  1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 
+    1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 
+    1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 
+    1377, 1378, 1379, 1380,
+  1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 
+    1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 
+    1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 
+    1387, 1388, 1389, 1390,
+  1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 
+    1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 
+    1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 
+    1397, 1398, 1399, 1400,
+  1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 
+    1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 
+    1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 
+    1407, 1408, 1409, 1410,
+  1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 
+    1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 
+    1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 
+    1417, 1418, 1419, 1420,
+  1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 
+    1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 
+    1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 
+    1427, 1428, 1429, 1430,
+  1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 
+    1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 
+    1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 
+    1437, 1438, 1439, 1440,
+  1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 
+    1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 
+    1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 
+    1247, 1248, 1249, 1250,
+  1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 
+    1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 
+    1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 
+    1257, 1258, 1259, 1260,
+  1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 
+    1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 
+    1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 
+    1267, 1268, 1269, 1270,
+  1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 
+    1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 
+    1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 
+    1277, 1278, 1279, 1280,
+  1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 
+    1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 
+    1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 
+    1287, 1288, 1289, 1290,
+  1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 
+    1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 
+    1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 
+    1297, 1298, 1299, 1300,
+  1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 
+    1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 
+    1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 
+    1307, 1308, 1309, 1310,
+  1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 
+    1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 
+    1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 
+    1317, 1318, 1319, 1320,
+  1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 
+    1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 
+    1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 
+    1327, 1328, 1329, 1330,
+  1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 
+    1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 
+    1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 
+    1337, 1338, 1339, 1340,
+  1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 
+    1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 
+    1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 
+    1347, 1348, 1349, 1350,
+  1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 
+    1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 
+    1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 
+    1357, 1358, 1359, 1360,
+  1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 
+    1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 
+    1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 
+    1367, 1368, 1369, 1370,
+  1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 
+    1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 
+    1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 
+    1377, 1378, 1379, 1380,
+  1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 
+    1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 
+    1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 
+    1387, 1388, 1389, 1390,
+  1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 
+    1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 
+    1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 
+    1397, 1398, 1399, 1400,
+  1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 
+    1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 
+    1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 
+    1407, 1408, 1409, 1410,
+  1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 
+    1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 
+    1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 
+    1417, 1418, 1419, 1420,
+  1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 
+    1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 
+    1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 
+    1427, 1428, 1429, 1430,
+  1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 
+    1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 
+    1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 
+    1437, 1438, 1439, 1440,
+  1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 
+    1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 
+    1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 
+    1447, 1448, 1449, 1450,
+  1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 
+    1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 
+    1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 
+    1457, 1458, 1459, 1460,
+  1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 
+    1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 
+    1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 
+    1467, 1468, 1469, 1470,
+  1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 
+    1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 
+    1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 
+    1477, 1478, 1479, 1480,
+  1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 
+    1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 
+    1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 
+    1487, 1488, 1489, 1490,
+  1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 
+    1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 
+    1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 
+    1497, 1498, 1499, 1500,
+  1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 
+    1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 
+    1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 
+    1507, 1508, 1509, 1510,
+  1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 
+    1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 
+    1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 
+    1517, 1518, 1519, 1520,
+  1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 
+    1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 
+    1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 
+    1527, 1528, 1529, 1530,
+  1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 
+    1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 
+    1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 
+    1537, 1538, 1539, 1540,
+  1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 
+    1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 
+    1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 
+    1347, 1348, 1349, 1350,
+  1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 
+    1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 
+    1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 
+    1357, 1358, 1359, 1360,
+  1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 
+    1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 
+    1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 
+    1367, 1368, 1369, 1370,
+  1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 
+    1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 
+    1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 
+    1377, 1378, 1379, 1380,
+  1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 
+    1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 
+    1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 
+    1387, 1388, 1389, 1390,
+  1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 
+    1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 
+    1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 
+    1397, 1398, 1399, 1400,
+  1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 
+    1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 
+    1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 
+    1407, 1408, 1409, 1410,
+  1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 
+    1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 
+    1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 
+    1417, 1418, 1419, 1420,
+  1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 
+    1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 
+    1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 
+    1427, 1428, 1429, 1430,
+  1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 
+    1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 
+    1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 
+    1437, 1438, 1439, 1440,
+  1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 
+    1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 
+    1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 
+    1447, 1448, 1449, 1450,
+  1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 
+    1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 
+    1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 
+    1457, 1458, 1459, 1460,
+  1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 
+    1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 
+    1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 
+    1467, 1468, 1469, 1470,
+  1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 
+    1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 
+    1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 
+    1477, 1478, 1479, 1480,
+  1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 
+    1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 
+    1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 
+    1487, 1488, 1489, 1490,
+  1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 
+    1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 
+    1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 
+    1497, 1498, 1499, 1500,
+  1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 
+    1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 
+    1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 
+    1507, 1508, 1509, 1510,
+  1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 
+    1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 
+    1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 
+    1517, 1518, 1519, 1520,
+  1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 
+    1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 
+    1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 
+    1527, 1528, 1529, 1530,
+  1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 
+    1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 
+    1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 
+    1537, 1538, 1539, 1540,
+  1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 
+    1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 
+    1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 
+    1547, 1548, 1549, 1550,
+  1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 
+    1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 
+    1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 
+    1557, 1558, 1559, 1560,
+  1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 
+    1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 
+    1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 
+    1567, 1568, 1569, 1570,
+  1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 
+    1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 
+    1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 
+    1577, 1578, 1579, 1580,
+  1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 
+    1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 
+    1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 
+    1587, 1588, 1589, 1590,
+  1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 
+    1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 
+    1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 
+    1597, 1598, 1599, 1600,
+  1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 
+    1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 
+    1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 
+    1607, 1608, 1609, 1610,
+  1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 
+    1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 
+    1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 
+    1617, 1618, 1619, 1620,
+  1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 
+    1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 
+    1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 
+    1627, 1628, 1629, 1630,
+  1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 
+    1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 
+    1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 
+    1637, 1638, 1639, 1640,
+  1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 
+    1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 
+    1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 
+    1447, 1448, 1449, 1450,
+  1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 
+    1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 
+    1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 
+    1457, 1458, 1459, 1460,
+  1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 
+    1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 
+    1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 
+    1467, 1468, 1469, 1470,
+  1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 
+    1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 
+    1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 
+    1477, 1478, 1479, 1480,
+  1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 
+    1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 
+    1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 
+    1487, 1488, 1489, 1490,
+  1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 
+    1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 
+    1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 
+    1497, 1498, 1499, 1500,
+  1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 
+    1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 
+    1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 
+    1507, 1508, 1509, 1510,
+  1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 
+    1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 
+    1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 
+    1517, 1518, 1519, 1520,
+  1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 
+    1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 
+    1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 
+    1527, 1528, 1529, 1530,
+  1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 
+    1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 
+    1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 
+    1537, 1538, 1539, 1540,
+  1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 
+    1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 
+    1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 
+    1547, 1548, 1549, 1550,
+  1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 
+    1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 
+    1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 
+    1557, 1558, 1559, 1560,
+  1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 
+    1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 
+    1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 
+    1567, 1568, 1569, 1570,
+  1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 
+    1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 
+    1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 
+    1577, 1578, 1579, 1580,
+  1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 
+    1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 
+    1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 
+    1587, 1588, 1589, 1590,
+  1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 
+    1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 
+    1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 
+    1597, 1598, 1599, 1600,
+  1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 
+    1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 
+    1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 
+    1607, 1608, 1609, 1610,
+  1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 
+    1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 
+    1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 
+    1617, 1618, 1619, 1620,
+  1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 
+    1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 
+    1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 
+    1627, 1628, 1629, 1630,
+  1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 
+    1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 
+    1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 
+    1637, 1638, 1639, 1640,
+  1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 
+    1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 
+    1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 
+    1647, 1648, 1649, 1650,
+  1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 
+    1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 
+    1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 
+    1657, 1658, 1659, 1660,
+  1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 
+    1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 
+    1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 
+    1667, 1668, 1669, 1670,
+  1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 
+    1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 
+    1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 
+    1677, 1678, 1679, 1680,
+  1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 
+    1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 
+    1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 
+    1687, 1688, 1689, 1690,
+  1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 
+    1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 
+    1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 
+    1697, 1698, 1699, 1700,
+  1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 
+    1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 
+    1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 
+    1707, 1708, 1709, 1710,
+  1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 
+    1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 
+    1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 
+    1717, 1718, 1719, 1720,
+  1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 
+    1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 
+    1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 
+    1727, 1728, 1729, 1730,
+  1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 
+    1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 
+    1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 
+    1737, 1738, 1739, 1740,
+  1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 
+    1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 
+    1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 
+    1547, 1548, 1549, 1550,
+  1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 
+    1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 
+    1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 
+    1557, 1558, 1559, 1560,
+  1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 
+    1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 
+    1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 
+    1567, 1568, 1569, 1570,
+  1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 
+    1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 
+    1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 
+    1577, 1578, 1579, 1580,
+  1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 
+    1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 
+    1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 
+    1587, 1588, 1589, 1590,
+  1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 
+    1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 
+    1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 
+    1597, 1598, 1599, 1600,
+  1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 
+    1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 
+    1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 
+    1607, 1608, 1609, 1610,
+  1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 
+    1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 
+    1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 
+    1617, 1618, 1619, 1620,
+  1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 
+    1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 
+    1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 
+    1627, 1628, 1629, 1630,
+  1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 
+    1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 
+    1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 
+    1637, 1638, 1639, 1640,
+  1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 
+    1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 
+    1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 
+    1647, 1648, 1649, 1650,
+  1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 
+    1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 
+    1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 
+    1657, 1658, 1659, 1660,
+  1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 
+    1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 
+    1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 
+    1667, 1668, 1669, 1670,
+  1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 
+    1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 
+    1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 
+    1677, 1678, 1679, 1680,
+  1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 
+    1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 
+    1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 
+    1687, 1688, 1689, 1690,
+  1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 
+    1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 
+    1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 
+    1697, 1698, 1699, 1700,
+  1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 
+    1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 
+    1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 
+    1707, 1708, 1709, 1710,
+  1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 
+    1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 
+    1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 
+    1717, 1718, 1719, 1720,
+  1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 
+    1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 
+    1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 
+    1727, 1728, 1729, 1730,
+  1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 
+    1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 
+    1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 
+    1737, 1738, 1739, 1740,
+  1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 
+    1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 
+    1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 
+    1747, 1748, 1749, 1750,
+  1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 
+    1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 
+    1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 
+    1757, 1758, 1759, 1760,
+  1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 
+    1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 
+    1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 
+    1767, 1768, 1769, 1770,
+  1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 
+    1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 
+    1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 
+    1777, 1778, 1779, 1780,
+  1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 
+    1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 
+    1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 
+    1787, 1788, 1789, 1790,
+  1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 
+    1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 
+    1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 
+    1797, 1798, 1799, 1800,
+  1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 
+    1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 
+    1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 
+    1807, 1808, 1809, 1810,
+  1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 
+    1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 
+    1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 
+    1817, 1818, 1819, 1820,
+  1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 
+    1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 
+    1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 
+    1827, 1828, 1829, 1830,
+  1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 
+    1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 
+    1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 
+    1837, 1838, 1839, 1840,
+  1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 
+    1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 
+    1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 
+    1647, 1648, 1649, 1650,
+  1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 
+    1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 
+    1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 
+    1657, 1658, 1659, 1660,
+  1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 
+    1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 
+    1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 
+    1667, 1668, 1669, 1670,
+  1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 
+    1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 
+    1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 
+    1677, 1678, 1679, 1680,
+  1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 
+    1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 
+    1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 
+    1687, 1688, 1689, 1690,
+  1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 
+    1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 
+    1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 
+    1697, 1698, 1699, 1700,
+  1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 
+    1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 
+    1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 
+    1707, 1708, 1709, 1710,
+  1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 
+    1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 
+    1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 
+    1717, 1718, 1719, 1720,
+  1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 
+    1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 
+    1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 
+    1727, 1728, 1729, 1730,
+  1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 
+    1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 
+    1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 
+    1737, 1738, 1739, 1740,
+  1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 
+    1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 
+    1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 
+    1747, 1748, 1749, 1750,
+  1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 
+    1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 
+    1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 
+    1757, 1758, 1759, 1760,
+  1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 
+    1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 
+    1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 
+    1767, 1768, 1769, 1770,
+  1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 
+    1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 
+    1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 
+    1777, 1778, 1779, 1780,
+  1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 
+    1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 
+    1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 
+    1787, 1788, 1789, 1790,
+  1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 
+    1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 
+    1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 
+    1797, 1798, 1799, 1800,
+  1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 
+    1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 
+    1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 
+    1807, 1808, 1809, 1810,
+  1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 
+    1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 
+    1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 
+    1817, 1818, 1819, 1820,
+  1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 
+    1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 
+    1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 
+    1827, 1828, 1829, 1830,
+  1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 
+    1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 
+    1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 
+    1837, 1838, 1839, 1840,
+  1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 
+    1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 
+    1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 
+    1847, 1848, 1849, 1850,
+  1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 
+    1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 
+    1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 
+    1857, 1858, 1859, 1860,
+  1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 
+    1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 
+    1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 
+    1867, 1868, 1869, 1870,
+  1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 
+    1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 
+    1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 
+    1877, 1878, 1879, 1880,
+  1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 
+    1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 
+    1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 
+    1887, 1888, 1889, 1890,
+  1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 
+    1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 
+    1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 
+    1897, 1898, 1899, 1900,
+  1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 
+    1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 
+    1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 
+    1907, 1908, 1909, 1910,
+  1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 
+    1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 
+    1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 
+    1917, 1918, 1919, 1920,
+  1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 
+    1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 
+    1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 
+    1927, 1928, 1929, 1930,
+  1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 
+    1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 
+    1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 
+    1937, 1938, 1939, 1940,
+  1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 
+    1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 
+    1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 
+    1747, 1748, 1749, 1750,
+  1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 
+    1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 
+    1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 
+    1757, 1758, 1759, 1760,
+  1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 
+    1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 
+    1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 
+    1767, 1768, 1769, 1770,
+  1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 
+    1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 
+    1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 
+    1777, 1778, 1779, 1780,
+  1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 
+    1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 
+    1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 
+    1787, 1788, 1789, 1790,
+  1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 
+    1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 
+    1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 
+    1797, 1798, 1799, 1800,
+  1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 
+    1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 
+    1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 
+    1807, 1808, 1809, 1810,
+  1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 
+    1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 
+    1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 
+    1817, 1818, 1819, 1820,
+  1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 
+    1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 
+    1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 
+    1827, 1828, 1829, 1830,
+  1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 
+    1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 
+    1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 
+    1837, 1838, 1839, 1840,
+  1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 
+    1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 
+    1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 
+    1847, 1848, 1849, 1850,
+  1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 
+    1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 
+    1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 
+    1857, 1858, 1859, 1860,
+  1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 
+    1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 
+    1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 
+    1867, 1868, 1869, 1870,
+  1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 
+    1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 
+    1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 
+    1877, 1878, 1879, 1880,
+  1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 
+    1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 
+    1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 
+    1887, 1888, 1889, 1890,
+  1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 
+    1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 
+    1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 
+    1897, 1898, 1899, 1900,
+  1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 
+    1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 
+    1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 
+    1907, 1908, 1909, 1910,
+  1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 
+    1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 
+    1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 
+    1917, 1918, 1919, 1920,
+  1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 
+    1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 
+    1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 
+    1927, 1928, 1929, 1930,
+  1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 
+    1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 
+    1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 
+    1937, 1938, 1939, 1940,
+  1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 
+    1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 
+    1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 
+    1947, 1948, 1949, 1950,
+  1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 
+    1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 
+    1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 
+    1957, 1958, 1959, 1960,
+  1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 
+    1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 
+    1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 
+    1967, 1968, 1969, 1970,
+  1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 
+    1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 
+    1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 
+    1977, 1978, 1979, 1980,
+  1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 
+    1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 
+    1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 
+    1987, 1988, 1989, 1990,
+  1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 
+    1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 
+    1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 
+    1997, 1998, 1999, 2000,
+  1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 
+    1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 
+    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
+    2007, 2008, 2009, 2010,
+  1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 
+    1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 
+    2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 
+    2017, 2018, 2019, 2020,
+  1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 
+    2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 
+    2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 
+    2027, 2028, 2029, 2030,
+  2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 
+    2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 
+    2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 
+    2037, 2038, 2039, 2040,
+  1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 
+    1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 
+    1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 
+    1847, 1848, 1849, 1850,
+  1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 
+    1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 
+    1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 
+    1857, 1858, 1859, 1860,
+  1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 
+    1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 
+    1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 
+    1867, 1868, 1869, 1870,
+  1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 
+    1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 
+    1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 
+    1877, 1878, 1879, 1880,
+  1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 
+    1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 
+    1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 
+    1887, 1888, 1889, 1890,
+  1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 
+    1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 
+    1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 
+    1897, 1898, 1899, 1900,
+  1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 
+    1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 
+    1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 
+    1907, 1908, 1909, 1910,
+  1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 
+    1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 
+    1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 
+    1917, 1918, 1919, 1920,
+  1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 
+    1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 
+    1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 
+    1927, 1928, 1929, 1930,
+  1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 
+    1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 
+    1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 
+    1937, 1938, 1939, 1940,
+  1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 
+    1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 
+    1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 
+    1947, 1948, 1949, 1950,
+  1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 
+    1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 
+    1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 
+    1957, 1958, 1959, 1960,
+  1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 
+    1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 
+    1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 
+    1967, 1968, 1969, 1970,
+  1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 
+    1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 
+    1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 
+    1977, 1978, 1979, 1980,
+  1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 
+    1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 
+    1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 
+    1987, 1988, 1989, 1990,
+  1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 
+    1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 
+    1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 
+    1997, 1998, 1999, 2000,
+  1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 
+    1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 
+    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
+    2007, 2008, 2009, 2010,
+  1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 
+    1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 
+    2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 
+    2017, 2018, 2019, 2020,
+  1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 
+    2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 
+    2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 
+    2027, 2028, 2029, 2030,
+  2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 
+    2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 
+    2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 
+    2037, 2038, 2039, 2040,
+  2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
+    2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 
+    2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 
+    2047, 2048, 2049, 2050,
+  2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 
+    2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 
+    2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 
+    2057, 2058, 2059, 2060,
+  2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 
+    2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 
+    2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 
+    2067, 2068, 2069, 2070,
+  2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 
+    2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 
+    2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 
+    2077, 2078, 2079, 2080,
+  2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 
+    2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 
+    2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 
+    2087, 2088, 2089, 2090,
+  2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 
+    2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 
+    2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 
+    2097, 2098, 2099, 2100,
+  2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 
+    2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 
+    2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 
+    2107, 2108, 2109, 2110,
+  2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 
+    2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 
+    2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 
+    2117, 2118, 2119, 2120,
+  2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 
+    2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 
+    2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 
+    2127, 2128, 2129, 2130,
+  2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 
+    2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 
+    2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 
+    2137, 2138, 2139, 2140,
+  1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 
+    1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 
+    1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 
+    1947, 1948, 1949, 1950,
+  1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 
+    1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 
+    1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 
+    1957, 1958, 1959, 1960,
+  1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 
+    1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 
+    1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 
+    1967, 1968, 1969, 1970,
+  1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 
+    1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 
+    1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 
+    1977, 1978, 1979, 1980,
+  1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 
+    1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 
+    1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 
+    1987, 1988, 1989, 1990,
+  1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 
+    1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 
+    1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 
+    1997, 1998, 1999, 2000,
+  1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 
+    1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 
+    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
+    2007, 2008, 2009, 2010,
+  1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 
+    1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 
+    2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 
+    2017, 2018, 2019, 2020,
+  1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 
+    2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 
+    2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 
+    2027, 2028, 2029, 2030,
+  2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 
+    2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 
+    2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 
+    2037, 2038, 2039, 2040,
+  2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
+    2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 
+    2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 
+    2047, 2048, 2049, 2050,
+  2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 
+    2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 
+    2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 
+    2057, 2058, 2059, 2060,
+  2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 
+    2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 
+    2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 
+    2067, 2068, 2069, 2070,
+  2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 
+    2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 
+    2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 
+    2077, 2078, 2079, 2080,
+  2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 
+    2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 
+    2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 
+    2087, 2088, 2089, 2090,
+  2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 
+    2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 
+    2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 
+    2097, 2098, 2099, 2100,
+  2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 
+    2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 
+    2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 
+    2107, 2108, 2109, 2110,
+  2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 
+    2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 
+    2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 
+    2117, 2118, 2119, 2120,
+  2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 
+    2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 
+    2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 
+    2127, 2128, 2129, 2130,
+  2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 
+    2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 
+    2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 
+    2137, 2138, 2139, 2140,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 
+    2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 
+    2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 
+    2147, 2148, 2149, 2150,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 
+    2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 
+    2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 
+    2157, 2158, 2159, 2160,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 
+    2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 
+    2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 
+    2177, 2178, 2179, 2180,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 
+    2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 
+    2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 
+    2187, 2188, 2189, 2190,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 
+    2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 
+    2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 
+    2197, 2198, 2199, 2200,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 
+    2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 
+    2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 
+    2207, 2208, 2209, 2210,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 
+    2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 
+    2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 
+    2217, 2218, 2219, 2220,
+  2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230,
+  2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 
+    2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 
+    2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 
+    2237, 2238, 2239, 2240,
+  2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
+    2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 
+    2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 
+    2047, 2048, 2049, 2050,
+  2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 
+    2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 
+    2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 
+    2057, 2058, 2059, 2060,
+  2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 
+    2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 
+    2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 
+    2067, 2068, 2069, 2070,
+  2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 
+    2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 
+    2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 
+    2077, 2078, 2079, 2080,
+  2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 
+    2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 
+    2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 
+    2087, 2088, 2089, 2090,
+  2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 
+    2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 
+    2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 
+    2097, 2098, 2099, 2100,
+  2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 
+    2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 
+    2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 
+    2107, 2108, 2109, 2110,
+  2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 
+    2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 
+    2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 
+    2117, 2118, 2119, 2120,
+  2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 
+    2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 
+    2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 
+    2127, 2128, 2129, 2130,
+  2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 
+    2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 
+    2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 
+    2137, 2138, 2139, 2140,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 
+    2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 
+    2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 
+    2147, 2148, 2149, 2150,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 
+    2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 
+    2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 
+    2157, 2158, 2159, 2160,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 
+    2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 
+    2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 
+    2177, 2178, 2179, 2180,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 
+    2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 
+    2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 
+    2187, 2188, 2189, 2190,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 
+    2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 
+    2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 
+    2197, 2198, 2199, 2200,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 
+    2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 
+    2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 
+    2207, 2208, 2209, 2210,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 
+    2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 
+    2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 
+    2217, 2218, 2219, 2220,
+  2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230,
+  2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 
+    2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 
+    2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 
+    2237, 2238, 2239, 2240,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 
+    2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 
+    2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 
+    2147, 2148, 2149, 2150,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 
+    2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 
+    2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 
+    2157, 2158, 2159, 2160,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 
+    2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 
+    2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 
+    2177, 2178, 2179, 2180,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 
+    2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 
+    2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 
+    2187, 2188, 2189, 2190,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 
+    2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 
+    2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 
+    2197, 2198, 2199, 2200,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 
+    2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 
+    2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 
+    2207, 2208, 2209, 2210,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 
+    2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 
+    2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 
+    2217, 2218, 2219, 2220,
+  2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230,
+  2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 
+    2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 
+    2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 
+    2237, 2238, 2239, 2240,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 
+    2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 
+    2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 
+    2147, 2148, 2149, 2150,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 
+    2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 
+    2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 
+    2157, 2158, 2159, 2160,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 
+    2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 
+    2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 
+    2177, 2178, 2179, 2180,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 
+    2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 
+    2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 
+    2187, 2188, 2189, 2190,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 
+    2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 
+    2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 
+    2197, 2198, 2199, 2200,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 
+    2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 
+    2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 
+    2207, 2208, 2209, 2210,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 
+    2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 
+    2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 
+    2217, 2218, 2219, 2220,
+  2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230,
+  2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 
+    2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 
+    2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 
+    2237, 2238, 2239, 2240,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 
+    2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 
+    2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
+    2357, 2358, 2359, 2360,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 
+    2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 
+    2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 
+    2367, 2368, 2369, 2370,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 
+    2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 
+    2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 
+    2377, 2378, 2379, 2380,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 
+    2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 
+    2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 
+    2387, 2388, 2389, 2390,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 
+    2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 
+    2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 
+    2397, 2398, 2399, 2400,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 
+    2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 
+    2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 
+    2417, 2418, 2419, 2420,
+  2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 
+    2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 
+    2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 
+    2427, 2428, 2429, 2430,
+  2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 
+    2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 
+    2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 
+    2437, 2438, 2439, 2440,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 
+    2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 
+    2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 
+    2447, 2448, 2449, 2450,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 
+    2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 
+    2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 
+    2457, 2458, 2459, 2460,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 
+    2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 
+    2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 
+    2477, 2478, 2479, 2480,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 
+    2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 
+    2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 
+    2487, 2488, 2489, 2490,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 
+    2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 
+    2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 
+    2497, 2498, 2499, 2500,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 
+    2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 
+    2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 
+    2507, 2508, 2509, 2510,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 
+    2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 
+    2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 
+    2517, 2518, 2519, 2520,
+  2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530,
+  2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 
+    2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 
+    2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 
+    2537, 2538, 2539, 2540,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 
+    2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 
+    2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 
+    2547, 2548, 2549, 2550,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 
+    2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 
+    2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 
+    2557, 2558, 2559, 2560,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 
+    2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 
+    2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 
+    2567, 2568, 2569, 2570,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 
+    2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 
+    2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 
+    2577, 2578, 2579, 2580,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 
+    2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 
+    2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 
+    2597, 2598, 2599, 2600,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 
+    2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 
+    2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 
+    2607, 2608, 2609, 2610,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 
+    2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 
+    2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 
+    2617, 2618, 2619, 2620,
+  2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 
+    2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 
+    2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 
+    2627, 2628, 2629, 2630,
+  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 
+    2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 
+    2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 
+    2637, 2638, 2639, 2640,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 
+    2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 
+    2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 
+    2657, 2658, 2659, 2660,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 
+    2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 
+    2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 
+    2667, 2668, 2669, 2670,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 
+    2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 
+    2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 
+    2677, 2678, 2679, 2680,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 
+    2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 
+    2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 
+    2687, 2688, 2689, 2690,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 
+    2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 
+    2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 
+    2697, 2698, 2699, 2700,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 
+    2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 
+    2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 
+    2717, 2718, 2719, 2720,
+  2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 
+    2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 
+    2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 
+    2727, 2728, 2729, 2730,
+  2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 
+    2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 
+    2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 
+    2737, 2738, 2739, 2740,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 
+    2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 
+    2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 
+    2747, 2748, 2749, 2750,
+  2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 
+    2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 
+    2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 
+    2757, 2758, 2759, 2760,
+  2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770,
+  2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 
+    2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 
+    2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 
+    2777, 2778, 2779, 2780,
+  2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 
+    2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 
+    2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 
+    2787, 2788, 2789, 2790,
+  2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 
+    2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 
+    2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 
+    2797, 2798, 2799, 2800,
+  2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 
+    2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 
+    2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 
+    2807, 2808, 2809, 2810,
+  2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 
+    2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 
+    2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 
+    2817, 2818, 2819, 2820,
+  2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830,
+  2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 
+    2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 
+    2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 
+    2837, 2838, 2839, 2840,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 
+    2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 
+    2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 
+    2847, 2848, 2849, 2850,
+  2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 
+    2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 
+    2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 
+    2857, 2858, 2859, 2860,
+  2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 
+    2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 
+    2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 
+    2867, 2868, 2869, 2870,
+  2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 
+    2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 
+    2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 
+    2877, 2878, 2879, 2880,
+  2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890,
+  2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 
+    2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 
+    2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 
+    2897, 2898, 2899, 2900,
+  2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+    2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 
+    2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 
+    2907, 2908, 2909, 2910,
+  2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 
+    2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 
+    2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+    2917, 2918, 2919, 2920,
+  2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 
+    2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 
+    2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 
+    2927, 2928, 2929, 2930,
+  2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 
+    2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 
+    2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 
+    2937, 2938, 2939, 2940,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950,
+  2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 
+    2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 
+    2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 
+    2957, 2958, 2959, 2960,
+  2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 
+    2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 
+    2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 
+    2967, 2968, 2969, 2970,
+  2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 
+    2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 
+    2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 
+    2977, 2978, 2979, 2980,
+  2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 
+    2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 
+    2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 
+    2987, 2988, 2989, 2990,
+  2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 
+    2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 
+    2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 
+    2997, 2998, 2999, 3000,
+  2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010,
+  2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 
+    2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 
+    3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 
+    3017, 3018, 3019, 3020,
+  2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 
+    3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 
+    3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 
+    3027, 3028, 3029, 3030,
+  3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 
+    3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 
+    3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 
+    3037, 3038, 3039, 3040,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 
+    3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 
+    3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 
+    3347, 3348, 3349, 3350,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 
+    3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 
+    3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 
+    3357, 3358, 3359, 3360,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 
+    3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 
+    3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 
+    3377, 3378, 3379, 3380,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 
+    3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 
+    3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 
+    3387, 3388, 3389, 3390,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 
+    3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 
+    3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 
+    3397, 3398, 3399, 3400,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 
+    3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 
+    3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 
+    3407, 3408, 3409, 3410,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 
+    3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 
+    3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 
+    3417, 3418, 3419, 3420,
+  3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430,
+  3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 
+    3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 
+    3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 
+    3437, 3438, 3439, 3440,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 
+    3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 
+    3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 
+    3447, 3448, 3449, 3450,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 
+    3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 
+    3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 
+    3457, 3458, 3459, 3460,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 
+    3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 
+    3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 
+    3467, 3468, 3469, 3470,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 
+    3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 
+    3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 
+    3477, 3478, 3479, 3480,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 
+    3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 
+    3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 
+    3497, 3498, 3499, 3500,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 
+    3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 
+    3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 
+    3507, 3508, 3509, 3510,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 
+    3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 
+    3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 
+    3517, 3518, 3519, 3520,
+  3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 
+    3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 
+    3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 
+    3527, 3528, 3529, 3530,
+  3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 
+    3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 
+    3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 
+    3537, 3538, 3539, 3540,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 
+    3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 
+    3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 
+    3557, 3558, 3559, 3560,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 
+    3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 
+    3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 
+    3567, 3568, 3569, 3570,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 
+    3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 
+    3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 
+    3577, 3578, 3579, 3580,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 
+    3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 
+    3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 
+    3587, 3588, 3589, 3590,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 
+    3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 
+    3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 
+    3597, 3598, 3599, 3600,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 
+    3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 
+    3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 
+    3617, 3618, 3619, 3620,
+  3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 
+    3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 
+    3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 
+    3627, 3628, 3629, 3630,
+  3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 
+    3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 
+    3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 
+    3637, 3638, 3639, 3640,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 
+    3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 
+    3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 
+    3647, 3648, 3649, 3650,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 
+    3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 
+    3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 
+    3657, 3658, 3659, 3660,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 
+    3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 
+    3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 
+    3677, 3678, 3679, 3680,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 
+    3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 
+    3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 
+    3687, 3688, 3689, 3690,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 
+    3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 
+    3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 
+    3697, 3698, 3699, 3700,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 
+    3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 
+    3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 
+    3707, 3708, 3709, 3710,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 
+    3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 
+    3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 
+    3717, 3718, 3719, 3720,
+  3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730,
+  3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 
+    3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 
+    3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 
+    3737, 3738, 3739, 3740,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 
+    3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 
+    3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 
+    3747, 3748, 3749, 3750,
+  3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 
+    3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 
+    3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 
+    3757, 3758, 3759, 3760,
+  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 
+    3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 
+    3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 
+    3767, 3768, 3769, 3770,
+  3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 
+    3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 
+    3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 
+    3777, 3778, 3779, 3780,
+  3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790,
+  3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 
+    3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 
+    3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 
+    3797, 3798, 3799, 3800,
+  3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 
+    3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 
+    3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 
+    3807, 3808, 3809, 3810,
+  3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 
+    3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 
+    3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 
+    3817, 3818, 3819, 3820,
+  3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 
+    3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 
+    3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 
+    3827, 3828, 3829, 3830,
+  3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 
+    3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 
+    3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 
+    3837, 3838, 3839, 3840,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850,
+  3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 
+    3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 
+    3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 
+    3857, 3858, 3859, 3860,
+  3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 
+    3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 
+    3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 
+    3867, 3868, 3869, 3870,
+  3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 
+    3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 
+    3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 
+    3877, 3878, 3879, 3880,
+  3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 
+    3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 
+    3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 
+    3887, 3888, 3889, 3890,
+  3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 
+    3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 
+    3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 
+    3897, 3898, 3899, 3900,
+  3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910,
+  3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 
+    3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 
+    3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 
+    3917, 3918, 3919, 3920,
+  3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 
+    3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 
+    3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 
+    3927, 3928, 3929, 3930,
+  3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 
+    3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 
+    3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 
+    3937, 3938, 3939, 3940,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 
+    3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 
+    3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 
+    3947, 3948, 3949, 3950,
+  3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 
+    3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 
+    3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 
+    3957, 3958, 3959, 3960,
+  3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970,
+  3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 
+    3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 
+    3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 
+    3977, 3978, 3979, 3980,
+  3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 
+    3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 
+    3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 
+    3987, 3988, 3989, 3990,
+  3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 
+    3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 
+    3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 
+    3997, 3998, 3999, 4000,
+  3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 
+    3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 
+    3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 
+    4007, 4008, 4009, 4010,
+  3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 
+    3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 
+    4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 
+    4017, 4018, 4019, 4020,
+  3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030,
+  4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 
+    4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 
+    4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 
+    4037, 4038, 4039, 4040,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 
+    4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 
+    4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 
+    4347, 4348, 4349, 4350,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 
+    4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 
+    4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 
+    4357, 4358, 4359, 4360,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 
+    4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 
+    4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 
+    4367, 4368, 4369, 4370,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 
+    4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 
+    4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 
+    4377, 4378, 4379, 4380,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 
+    4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 
+    4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 
+    4397, 4398, 4399, 4400,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 
+    4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 
+    4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 
+    4407, 4408, 4409, 4410,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 
+    4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 
+    4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 
+    4417, 4418, 4419, 4420,
+  4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 
+    4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 
+    4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 
+    4427, 4428, 4429, 4430,
+  4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 
+    4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 
+    4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 
+    4437, 4438, 4439, 4440,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 
+    4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 
+    4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 
+    4457, 4458, 4459, 4460,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 
+    4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 
+    4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 
+    4467, 4468, 4469, 4470,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 
+    4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 
+    4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 
+    4477, 4478, 4479, 4480,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 
+    4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 
+    4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 
+    4487, 4488, 4489, 4490,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 
+    4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 
+    4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 
+    4497, 4498, 4499, 4500,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 
+    4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 
+    4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 
+    4517, 4518, 4519, 4520,
+  4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 
+    4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 
+    4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 
+    4527, 4528, 4529, 4530,
+  4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 
+    4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 
+    4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 
+    4537, 4538, 4539, 4540,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 
+    4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 
+    4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 
+    4547, 4548, 4549, 4550,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 
+    4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 
+    4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 
+    4557, 4558, 4559, 4560,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 
+    4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 
+    4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 
+    4577, 4578, 4579, 4580,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 
+    4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 
+    4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 
+    4587, 4588, 4589, 4590,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 
+    4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 
+    4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 
+    4597, 4598, 4599, 4600,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 
+    4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 
+    4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 
+    4607, 4608, 4609, 4610,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 
+    4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 
+    4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 
+    4617, 4618, 4619, 4620,
+  4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630,
+  4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 
+    4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 
+    4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 
+    4637, 4638, 4639, 4640,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 
+    4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 
+    4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 
+    4647, 4648, 4649, 4650,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 
+    4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 
+    4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 
+    4657, 4658, 4659, 4660,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 
+    4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 
+    4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 
+    4667, 4668, 4669, 4670,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 
+    4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 
+    4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 
+    4677, 4678, 4679, 4680,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 
+    4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 
+    4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 
+    4697, 4698, 4699, 4700,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 
+    4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 
+    4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 
+    4707, 4708, 4709, 4710,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 
+    4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 
+    4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 
+    4717, 4718, 4719, 4720,
+  4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 
+    4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 
+    4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 
+    4727, 4728, 4729, 4730,
+  4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 
+    4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 
+    4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 
+    4737, 4738, 4739, 4740,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750,
+  4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 
+    4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 
+    4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 
+    4757, 4758, 4759, 4760,
+  4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 
+    4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 
+    4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 
+    4767, 4768, 4769, 4770,
+  4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 
+    4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 
+    4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 
+    4777, 4778, 4779, 4780,
+  4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 
+    4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 
+    4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 
+    4787, 4788, 4789, 4790,
+  4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 
+    4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 
+    4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 
+    4797, 4798, 4799, 4800,
+  4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810,
+  4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 
+    4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 
+    4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 
+    4817, 4818, 4819, 4820,
+  4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 
+    4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 
+    4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 
+    4827, 4828, 4829, 4830,
+  4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 
+    4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 
+    4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 
+    4837, 4838, 4839, 4840,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 
+    4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 
+    4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 
+    4847, 4848, 4849, 4850,
+  4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 
+    4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 
+    4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 
+    4857, 4858, 4859, 4860,
+  4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870,
+  4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 
+    4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 
+    4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 
+    4877, 4878, 4879, 4880,
+  4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 
+    4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 
+    4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 
+    4887, 4888, 4889, 4890,
+  4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 
+    4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 
+    4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 
+    4897, 4898, 4899, 4900,
+  4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 
+    4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 
+    4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 
+    4907, 4908, 4909, 4910,
+  4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 
+    4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 
+    4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 
+    4917, 4918, 4919, 4920,
+  4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930,
+  4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 
+    4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 
+    4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 
+    4937, 4938, 4939, 4940,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 
+    4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 
+    4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 
+    4947, 4948, 4949, 4950,
+  4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 
+    4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 
+    4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 
+    4957, 4958, 4959, 4960,
+  4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 
+    4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 
+    4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 
+    4967, 4968, 4969, 4970,
+  4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 
+    4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 
+    4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 
+    4977, 4978, 4979, 4980,
+  4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990,
+  4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 
+    4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 
+    4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 
+    4997, 4998, 4999, 5000,
+  4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 
+    4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 
+    4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 
+    5007, 5008, 5009, 5010,
+  4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 
+    4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 
+    5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 
+    5017, 5018, 5019, 5020,
+  4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 
+    5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 
+    5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
+    5027, 5028, 5029, 5030,
+  5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 
+    5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 
+    5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 
+    5037, 5038, 5039, 5040,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350,
+  5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 
+    5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 
+    5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 
+    5357, 5358, 5359, 5360,
+  5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 
+    5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 
+    5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 
+    5367, 5368, 5369, 5370,
+  5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 
+    5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 
+    5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 
+    5377, 5378, 5379, 5380,
+  5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 
+    5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 
+    5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 
+    5387, 5388, 5389, 5390,
+  5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 
+    5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 
+    5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 
+    5397, 5398, 5399, 5400,
+  5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410,
+  5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 
+    5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 
+    5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 
+    5417, 5418, 5419, 5420,
+  5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 
+    5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 
+    5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 
+    5427, 5428, 5429, 5430,
+  5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 
+    5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 
+    5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 
+    5437, 5438, 5439, 5440,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 
+    5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 
+    5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 
+    5447, 5448, 5449, 5450,
+  5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 
+    5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 
+    5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 
+    5457, 5458, 5459, 5460,
+  5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470,
+  5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 
+    5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 
+    5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 
+    5477, 5478, 5479, 5480,
+  5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 
+    5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 
+    5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 
+    5487, 5488, 5489, 5490,
+  5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 
+    5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 
+    5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 
+    5497, 5498, 5499, 5500,
+  5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 
+    5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 
+    5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 
+    5507, 5508, 5509, 5510,
+  5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 
+    5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 
+    5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 
+    5517, 5518, 5519, 5520,
+  5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530,
+  5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 
+    5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 
+    5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 
+    5537, 5538, 5539, 5540,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 
+    5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 
+    5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 
+    5547, 5548, 5549, 5550,
+  5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 
+    5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 
+    5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 
+    5557, 5558, 5559, 5560,
+  5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 
+    5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 
+    5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 
+    5567, 5568, 5569, 5570,
+  5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 
+    5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 
+    5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 
+    5577, 5578, 5579, 5580,
+  5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590,
+  5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 
+    5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 
+    5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 
+    5597, 5598, 5599, 5600,
+  5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 
+    5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 
+    5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 
+    5607, 5608, 5609, 5610,
+  5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 
+    5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 
+    5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 
+    5617, 5618, 5619, 5620,
+  5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 
+    5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 
+    5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 
+    5627, 5628, 5629, 5630,
+  5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 
+    5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 
+    5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 
+    5637, 5638, 5639, 5640,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650,
+  5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 
+    5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 
+    5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 
+    5657, 5658, 5659, 5660,
+  5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 
+    5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 
+    5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 
+    5667, 5668, 5669, 5670,
+  5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 
+    5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 
+    5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 
+    5677, 5678, 5679, 5680,
+  5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 
+    5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 
+    5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 
+    5687, 5688, 5689, 5690,
+  5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 
+    5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 
+    5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 
+    5697, 5698, 5699, 5700,
+  5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710,
+  5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 
+    5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 
+    5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 
+    5717, 5718, 5719, 5720,
+  5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 
+    5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 
+    5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 
+    5727, 5728, 5729, 5730,
+  5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 
+    5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 
+    5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 
+    5737, 5738, 5739, 5740,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 
+    5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 
+    5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 
+    5747, 5748, 5749, 5750,
+  5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 
+    5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 
+    5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 
+    5757, 5758, 5759, 5760,
+  5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770,
+  5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 
+    5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 
+    5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 
+    5777, 5778, 5779, 5780,
+  5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 
+    5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 
+    5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 
+    5787, 5788, 5789, 5790,
+  5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 
+    5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 
+    5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 
+    5797, 5798, 5799, 5800,
+  5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 
+    5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 
+    5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 
+    5807, 5808, 5809, 5810,
+  5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 
+    5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 
+    5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 
+    5817, 5818, 5819, 5820,
+  5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830,
+  5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 
+    5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 
+    5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 
+    5837, 5838, 5839, 5840,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 
+    5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 
+    5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 
+    5847, 5848, 5849, 5850,
+  5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 
+    5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 
+    5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 
+    5857, 5858, 5859, 5860,
+  5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 
+    5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 
+    5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 
+    5867, 5868, 5869, 5870,
+  5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 
+    5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 
+    5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 
+    5877, 5878, 5879, 5880,
+  5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890,
+  5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 
+    5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 
+    5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 
+    5897, 5898, 5899, 5900,
+  5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 
+    5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 
+    5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 
+    5907, 5908, 5909, 5910,
+  5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 
+    5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 
+    5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 
+    5917, 5918, 5919, 5920,
+  5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 
+    5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 
+    5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 
+    5927, 5928, 5929, 5930,
+  5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 
+    5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 
+    5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 
+    5937, 5938, 5939, 5940,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950,
+  5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 
+    5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 
+    5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 
+    5957, 5958, 5959, 5960,
+  5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 
+    5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 
+    5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 
+    5967, 5968, 5969, 5970,
+  5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 
+    5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 
+    5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 
+    5977, 5978, 5979, 5980,
+  5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 
+    5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 
+    5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 
+    5987, 5988, 5989, 5990,
+  5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 
+    5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 
+    5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 
+    5997, 5998, 5999, 6000,
+  5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010,
+  5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 
+    5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 
+    6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 
+    6017, 6018, 6019, 6020,
+  5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 
+    6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 
+    6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 
+    6027, 6028, 6029, 6030,
+  6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 
+    6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 
+    6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 
+    6037, 6038, 6039, 6040,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 
+    6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 
+    6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 
+    6347, 6348, 6349, 6350,
+  6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 
+    6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 
+    6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 
+    6357, 6358, 6359, 6360,
+  6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370,
+  6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 
+    6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 
+    6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 
+    6377, 6378, 6379, 6380,
+  6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 
+    6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 
+    6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 
+    6387, 6388, 6389, 6390,
+  6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 
+    6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 
+    6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 
+    6397, 6398, 6399, 6400,
+  6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 
+    6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 
+    6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 
+    6407, 6408, 6409, 6410,
+  6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 
+    6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 
+    6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 
+    6417, 6418, 6419, 6420,
+  6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430,
+  6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 
+    6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 
+    6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 
+    6437, 6438, 6439, 6440,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 
+    6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 
+    6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 
+    6447, 6448, 6449, 6450,
+  6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 
+    6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 
+    6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 
+    6457, 6458, 6459, 6460,
+  6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 
+    6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 
+    6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 
+    6467, 6468, 6469, 6470,
+  6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 
+    6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 
+    6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 
+    6477, 6478, 6479, 6480,
+  6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490,
+  6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 
+    6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 
+    6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 
+    6497, 6498, 6499, 6500,
+  6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 
+    6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 
+    6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 
+    6507, 6508, 6509, 6510,
+  6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 
+    6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 
+    6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 
+    6517, 6518, 6519, 6520,
+  6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 
+    6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 
+    6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 
+    6527, 6528, 6529, 6530,
+  6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 
+    6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 
+    6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 
+    6537, 6538, 6539, 6540,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550,
+  6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 
+    6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 
+    6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 
+    6557, 6558, 6559, 6560,
+  6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 
+    6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 
+    6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 
+    6567, 6568, 6569, 6570,
+  6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 
+    6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 
+    6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 
+    6577, 6578, 6579, 6580,
+  6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 
+    6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 
+    6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 
+    6587, 6588, 6589, 6590,
+  6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 
+    6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 
+    6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 
+    6597, 6598, 6599, 6600,
+  6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610,
+  6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 
+    6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 
+    6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 
+    6617, 6618, 6619, 6620,
+  6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 
+    6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 
+    6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 
+    6627, 6628, 6629, 6630,
+  6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 
+    6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 
+    6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 
+    6637, 6638, 6639, 6640,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 
+    6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 
+    6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 
+    6647, 6648, 6649, 6650,
+  6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 
+    6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 
+    6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 
+    6657, 6658, 6659, 6660,
+  6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670,
+  6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 
+    6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 
+    6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 
+    6677, 6678, 6679, 6680,
+  6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 
+    6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 
+    6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 
+    6687, 6688, 6689, 6690,
+  6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 
+    6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 
+    6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 
+    6697, 6698, 6699, 6700,
+  6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 
+    6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
+    6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 
+    6707, 6708, 6709, 6710,
+  6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 
+    6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 
+    6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 
+    6717, 6718, 6719, 6720,
+  6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730,
+  6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 
+    6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 
+    6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 
+    6737, 6738, 6739, 6740,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 
+    6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 
+    6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 
+    6747, 6748, 6749, 6750,
+  6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 
+    6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 
+    6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 
+    6757, 6758, 6759, 6760,
+  6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 
+    6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 
+    6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 
+    6767, 6768, 6769, 6770,
+  6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 
+    6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 
+    6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 
+    6777, 6778, 6779, 6780,
+  6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790,
+  6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 
+    6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 
+    6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 
+    6797, 6798, 6799, 6800,
+  6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 
+    6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 
+    6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 
+    6807, 6808, 6809, 6810,
+  6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 
+    6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 
+    6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 
+    6817, 6818, 6819, 6820,
+  6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 
+    6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 
+    6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 
+    6827, 6828, 6829, 6830,
+  6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 
+    6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 
+    6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 
+    6837, 6838, 6839, 6840,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850,
+  6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 
+    6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 
+    6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 
+    6857, 6858, 6859, 6860,
+  6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 
+    6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 
+    6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 
+    6867, 6868, 6869, 6870,
+  6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 
+    6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 
+    6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 
+    6877, 6878, 6879, 6880,
+  6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 
+    6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 
+    6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 
+    6887, 6888, 6889, 6890,
+  6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 
+    6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 
+    6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 
+    6897, 6898, 6899, 6900,
+  6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910,
+  6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 
+    6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 
+    6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 
+    6917, 6918, 6919, 6920,
+  6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 
+    6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 
+    6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 
+    6927, 6928, 6929, 6930,
+  6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 
+    6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 
+    6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 
+    6937, 6938, 6939, 6940,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 
+    6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 
+    6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 
+    6947, 6948, 6949, 6950,
+  6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 
+    6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 
+    6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 
+    6957, 6958, 6959, 6960,
+  6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970,
+  6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 
+    6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 
+    6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 
+    6977, 6978, 6979, 6980,
+  6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 
+    6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 
+    6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 
+    6987, 6988, 6989, 6990,
+  6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 
+    6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 
+    6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 
+    6997, 6998, 6999, 7000,
+  6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 
+    6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 
+    6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 
+    7007, 7008, 7009, 7010,
+  6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 
+    6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 
+    7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 
+    7017, 7018, 7019, 7020,
+  6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030,
+  7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 
+    7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 
+    7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 
+    7037, 7038, 7039, 7040,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 
+    7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 
+    7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 
+    7347, 7348, 7349, 7350,
+  7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 
+    7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 
+    7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 
+    7357, 7358, 7359, 7360,
+  7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 
+    7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 
+    7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 
+    7367, 7368, 7369, 7370,
+  7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 
+    7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 
+    7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 
+    7377, 7378, 7379, 7380,
+  7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390,
+  7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 
+    7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 
+    7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 
+    7397, 7398, 7399, 7400,
+  7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 
+    7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 
+    7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 
+    7407, 7408, 7409, 7410,
+  7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 
+    7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 
+    7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 
+    7417, 7418, 7419, 7420,
+  7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 
+    7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 
+    7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 
+    7427, 7428, 7429, 7430,
+  7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 
+    7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 
+    7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 
+    7437, 7438, 7439, 7440,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450,
+  7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 
+    7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 
+    7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 
+    7457, 7458, 7459, 7460,
+  7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 
+    7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 
+    7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 
+    7467, 7468, 7469, 7470,
+  7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 
+    7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 
+    7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 
+    7477, 7478, 7479, 7480,
+  7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 
+    7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 
+    7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 
+    7487, 7488, 7489, 7490,
+  7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 
+    7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 
+    7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 
+    7497, 7498, 7499, 7500,
+  7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510,
+  7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 
+    7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 
+    7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 
+    7517, 7518, 7519, 7520,
+  7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 
+    7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 
+    7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 
+    7527, 7528, 7529, 7530,
+  7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 
+    7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 
+    7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 
+    7537, 7538, 7539, 7540,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 
+    7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 
+    7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 
+    7547, 7548, 7549, 7550,
+  7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 
+    7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 
+    7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 
+    7557, 7558, 7559, 7560,
+  7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570,
+  7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 
+    7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 
+    7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 
+    7577, 7578, 7579, 7580,
+  7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 
+    7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 
+    7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 
+    7587, 7588, 7589, 7590,
+  7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 
+    7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 
+    7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 
+    7597, 7598, 7599, 7600,
+  7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 
+    7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 
+    7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 
+    7607, 7608, 7609, 7610,
+  7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 
+    7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 
+    7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 
+    7617, 7618, 7619, 7620,
+  7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630,
+  7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 
+    7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 
+    7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 
+    7637, 7638, 7639, 7640,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 
+    7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 
+    7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 
+    7647, 7648, 7649, 7650,
+  7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 
+    7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 
+    7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 
+    7657, 7658, 7659, 7660,
+  7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 
+    7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 
+    7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 
+    7667, 7668, 7669, 7670,
+  7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 
+    7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 
+    7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 
+    7677, 7678, 7679, 7680,
+  7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690,
+  7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 
+    7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 
+    7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 
+    7697, 7698, 7699, 7700,
+  7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 
+    7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 
+    7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 
+    7707, 7708, 7709, 7710,
+  7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 
+    7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 
+    7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 
+    7717, 7718, 7719, 7720,
+  7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 
+    7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 
+    7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 
+    7727, 7728, 7729, 7730,
+  7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 
+    7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 
+    7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 
+    7737, 7738, 7739, 7740,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750,
+  7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 
+    7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 
+    7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 
+    7757, 7758, 7759, 7760,
+  7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 
+    7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 
+    7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 
+    7767, 7768, 7769, 7770,
+  7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 
+    7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 
+    7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 
+    7777, 7778, 7779, 7780,
+  7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 
+    7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 
+    7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 
+    7787, 7788, 7789, 7790,
+  7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 
+    7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 
+    7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 
+    7797, 7798, 7799, 7800,
+  7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810,
+  7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 
+    7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 
+    7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 
+    7817, 7818, 7819, 7820,
+  7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 
+    7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 
+    7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 
+    7827, 7828, 7829, 7830,
+  7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 
+    7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 
+    7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 
+    7837, 7838, 7839, 7840,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 
+    7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 
+    7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 
+    7847, 7848, 7849, 7850,
+  7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 
+    7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 
+    7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 
+    7857, 7858, 7859, 7860,
+  7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870,
+  7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 
+    7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 
+    7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 
+    7877, 7878, 7879, 7880,
+  7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 
+    7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 
+    7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 
+    7887, 7888, 7889, 7890,
+  7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 
+    7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 
+    7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 
+    7897, 7898, 7899, 7900,
+  7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 
+    7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 
+    7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 
+    7907, 7908, 7909, 7910,
+  7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 
+    7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 
+    7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 
+    7917, 7918, 7919, 7920,
+  7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930,
+  7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 
+    7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 
+    7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 
+    7937, 7938, 7939, 7940,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 
+    7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 
+    7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 
+    7947, 7948, 7949, 7950,
+  7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 
+    7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 
+    7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 
+    7957, 7958, 7959, 7960,
+  7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 
+    7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 
+    7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 
+    7967, 7968, 7969, 7970,
+  7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 
+    7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 
+    7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 
+    7977, 7978, 7979, 7980,
+  7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990,
+  7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 
+    7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 
+    7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 
+    7997, 7998, 7999, 8000,
+  7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 
+    7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 
+    7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 
+    8007, 8008, 8009, 8010,
+  7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 
+    7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 
+    8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 
+    8017, 8018, 8019, 8020,
+  7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 
+    8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 
+    8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 
+    8027, 8028, 8029, 8030,
+  8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 
+    8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 
+    8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 
+    8037, 8038, 8039, 8040,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350,
+  8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 
+    8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 
+    8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 
+    8357, 8358, 8359, 8360,
+  8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 
+    8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 
+    8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 
+    8367, 8368, 8369, 8370,
+  8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 
+    8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 
+    8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 
+    8377, 8378, 8379, 8380,
+  8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 
+    8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 
+    8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 
+    8387, 8388, 8389, 8390,
+  8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 
+    8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 
+    8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 
+    8397, 8398, 8399, 8400,
+  8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410,
+  8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 
+    8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 
+    8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 
+    8417, 8418, 8419, 8420,
+  8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 
+    8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 
+    8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 
+    8427, 8428, 8429, 8430,
+  8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 
+    8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 
+    8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 
+    8437, 8438, 8439, 8440,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 
+    8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 
+    8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 
+    8447, 8448, 8449, 8450,
+  8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 
+    8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 
+    8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 
+    8457, 8458, 8459, 8460,
+  8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470,
+  8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 
+    8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 
+    8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 
+    8477, 8478, 8479, 8480,
+  8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 
+    8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 
+    8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 
+    8487, 8488, 8489, 8490,
+  8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 
+    8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 
+    8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 
+    8497, 8498, 8499, 8500,
+  8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 
+    8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 
+    8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 
+    8507, 8508, 8509, 8510,
+  8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 
+    8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 
+    8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 
+    8517, 8518, 8519, 8520,
+  8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530,
+  8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 
+    8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 
+    8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 
+    8537, 8538, 8539, 8540,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 
+    8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 
+    8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 
+    8547, 8548, 8549, 8550,
+  8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 
+    8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 
+    8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 
+    8557, 8558, 8559, 8560,
+  8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 
+    8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 
+    8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 
+    8567, 8568, 8569, 8570,
+  8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 
+    8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 
+    8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 
+    8577, 8578, 8579, 8580,
+  8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590,
+  8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 
+    8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 
+    8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 
+    8597, 8598, 8599, 8600,
+  8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 
+    8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 
+    8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 
+    8607, 8608, 8609, 8610,
+  8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 
+    8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 
+    8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 
+    8617, 8618, 8619, 8620,
+  8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 
+    8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 
+    8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 
+    8627, 8628, 8629, 8630,
+  8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 
+    8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 
+    8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 
+    8637, 8638, 8639, 8640,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650,
+  8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 
+    8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 
+    8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 
+    8657, 8658, 8659, 8660,
+  8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 
+    8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 
+    8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 
+    8667, 8668, 8669, 8670,
+  8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 
+    8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 
+    8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 
+    8677, 8678, 8679, 8680,
+  8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 
+    8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 
+    8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 
+    8687, 8688, 8689, 8690,
+  8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 
+    8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 
+    8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 
+    8697, 8698, 8699, 8700,
+  8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710,
+  8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 
+    8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 
+    8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 
+    8717, 8718, 8719, 8720,
+  8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 
+    8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 
+    8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 
+    8727, 8728, 8729, 8730,
+  8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 
+    8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 
+    8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 
+    8737, 8738, 8739, 8740,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 
+    8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 
+    8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 
+    8747, 8748, 8749, 8750,
+  8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 
+    8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 
+    8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 
+    8757, 8758, 8759, 8760,
+  8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770,
+  8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 
+    8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 
+    8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 
+    8777, 8778, 8779, 8780,
+  8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 
+    8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 
+    8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 
+    8787, 8788, 8789, 8790,
+  8761, 8762, 8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 
+    8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 8783, 8784, 
+    8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 8795, 8796, 
+    8797, 8798, 8799, 8800,
+  8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 8779, 8780, 8781, 8782, 
+    8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 8793, 8794, 
+    8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 8805, 8806, 
+    8807, 8808, 8809, 8810,
+  8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 8791, 8792, 
+    8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 8803, 8804, 
+    8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 8815, 8816, 
+    8817, 8818, 8819, 8820,
+  8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830,
+  8801, 8802, 8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 
+    8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 
+    8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 
+    8837, 8838, 8839, 8840,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  8811, 8812, 8813, 8814, 8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 
+    8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 
+    8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 
+    8847, 8848, 8849, 8850,
+  8821, 8822, 8823, 8824, 8825, 8826, 8827, 8828, 8829, 8830, 8831, 8832, 
+    8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 8843, 8844, 
+    8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 8855, 8856, 
+    8857, 8858, 8859, 8860,
+  8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 8839, 8840, 8841, 8842, 
+    8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 8853, 8854, 
+    8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 8865, 8866, 
+    8867, 8868, 8869, 8870,
+  8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 8851, 8852, 
+    8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 8863, 8864, 
+    8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 8875, 8876, 
+    8877, 8878, 8879, 8880,
+  8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890,
+  8861, 8862, 8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 
+    8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 
+    8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 
+    8897, 8898, 8899, 8900,
+  8871, 8872, 8873, 8874, 8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 
+    8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 
+    8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 
+    8907, 8908, 8909, 8910,
+  8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 8891, 8892, 
+    8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 8903, 8904, 
+    8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 8915, 8916, 
+    8917, 8918, 8919, 8920,
+  8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 8899, 8900, 8901, 8902, 
+    8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 8913, 8914, 
+    8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 8925, 8926, 
+    8927, 8928, 8929, 8930,
+  8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 8911, 8912, 
+    8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 8923, 8924, 
+    8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 8935, 8936, 
+    8937, 8938, 8939, 8940,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950,
+  8921, 8922, 8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 
+    8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 
+    8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 
+    8957, 8958, 8959, 8960,
+  8931, 8932, 8933, 8934, 8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 
+    8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 
+    8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 
+    8967, 8968, 8969, 8970,
+  8941, 8942, 8943, 8944, 8945, 8946, 8947, 8948, 8949, 8950, 8951, 8952, 
+    8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 8963, 8964, 
+    8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 8975, 8976, 
+    8977, 8978, 8979, 8980,
+  8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 8959, 8960, 8961, 8962, 
+    8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 8973, 8974, 
+    8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 8985, 8986, 
+    8987, 8988, 8989, 8990,
+  8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8971, 8972, 
+    8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 8983, 8984, 
+    8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 8995, 8996, 
+    8997, 8998, 8999, 9000,
+  8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010,
+  8981, 8982, 8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 
+    8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 
+    9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 
+    9017, 9018, 9019, 9020,
+  8991, 8992, 8993, 8994, 8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 
+    9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 
+    9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 
+    9027, 9028, 9029, 9030,
+  9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 
+    9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 
+    9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 
+    9037, 9038, 9039, 9040,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 
+    9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 
+    9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 9345, 9346, 
+    9347, 9348, 9349, 9350,
+  9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 
+    9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 9343, 9344, 
+    9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 9355, 9356, 
+    9357, 9358, 9359, 9360,
+  9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370,
+  9341, 9342, 9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 
+    9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 
+    9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 
+    9377, 9378, 9379, 9380,
+  9351, 9352, 9353, 9354, 9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 
+    9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 
+    9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 
+    9387, 9388, 9389, 9390,
+  9361, 9362, 9363, 9364, 9365, 9366, 9367, 9368, 9369, 9370, 9371, 9372, 
+    9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 9383, 9384, 
+    9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 9395, 9396, 
+    9397, 9398, 9399, 9400,
+  9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 9379, 9380, 9381, 9382, 
+    9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 9393, 9394, 
+    9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 9405, 9406, 
+    9407, 9408, 9409, 9410,
+  9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 9391, 9392, 
+    9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 9403, 9404, 
+    9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 
+    9417, 9418, 9419, 9420,
+  9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430,
+  9401, 9402, 9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 
+    9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 
+    9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 
+    9437, 9438, 9439, 9440,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 
+    9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 
+    9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 
+    9447, 9448, 9449, 9450,
+  9421, 9422, 9423, 9424, 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, 
+    9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 9443, 9444, 
+    9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 9455, 9456, 
+    9457, 9458, 9459, 9460,
+  9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, 9441, 9442, 
+    9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 9453, 9454, 
+    9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 9465, 9466, 
+    9467, 9468, 9469, 9470,
+  9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 9451, 9452, 
+    9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 9463, 9464, 
+    9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 9475, 9476, 
+    9477, 9478, 9479, 9480,
+  9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490,
+  9461, 9462, 9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 
+    9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 
+    9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 
+    9497, 9498, 9499, 9500,
+  9471, 9472, 9473, 9474, 9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 
+    9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 
+    9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 
+    9507, 9508, 9509, 9510,
+  9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 
+    9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 9503, 9504, 
+    9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 
+    9517, 9518, 9519, 9520,
+  9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 9499, 9500, 9501, 9502, 
+    9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 9513, 9514, 
+    9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 9525, 9526, 
+    9527, 9528, 9529, 9530,
+  9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 9511, 9512, 
+    9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 9523, 9524, 
+    9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 9535, 9536, 
+    9537, 9538, 9539, 9540,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550,
+  9521, 9522, 9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 
+    9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 
+    9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 
+    9557, 9558, 9559, 9560,
+  9531, 9532, 9533, 9534, 9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 
+    9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 
+    9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 
+    9567, 9568, 9569, 9570,
+  9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 
+    9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 
+    9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 
+    9577, 9578, 9579, 9580,
+  9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 
+    9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 
+    9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 9585, 9586, 
+    9587, 9588, 9589, 9590,
+  9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 
+    9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 9583, 9584, 
+    9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 9595, 9596, 
+    9597, 9598, 9599, 9600,
+  9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610,
+  9581, 9582, 9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 
+    9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 
+    9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 
+    9617, 9618, 9619, 9620,
+  9591, 9592, 9593, 9594, 9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 
+    9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 
+    9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 
+    9627, 9628, 9629, 9630,
+  9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608, 9609, 9610, 9611, 9612, 
+    9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 9623, 9624, 
+    9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 9635, 9636, 
+    9637, 9638, 9639, 9640,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 9619, 9620, 9621, 9622, 
+    9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 9633, 9634, 
+    9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 9645, 9646, 
+    9647, 9648, 9649, 9650,
+  9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 9631, 9632, 
+    9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 9643, 9644, 
+    9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 9655, 9656, 
+    9657, 9658, 9659, 9660,
+  9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670,
+  9641, 9642, 9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 
+    9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 
+    9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 
+    9677, 9678, 9679, 9680,
+  9651, 9652, 9653, 9654, 9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 
+    9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 
+    9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 
+    9687, 9688, 9689, 9690,
+  9661, 9662, 9663, 9664, 9665, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 
+    9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 
+    9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 
+    9697, 9698, 9699, 9700,
+  9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 
+    9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 
+    9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 
+    9707, 9708, 9709, 9710,
+  9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 
+    9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 
+    9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 
+    9717, 9718, 9719, 9720,
+  9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730,
+  9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 
+    9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 
+    9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 
+    9737, 9738, 9739, 9740,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 
+    9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 
+    9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 
+    9747, 9748, 9749, 9750,
+  9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 
+    9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 
+    9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 
+    9757, 9758, 9759, 9760,
+  9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 
+    9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 
+    9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 
+    9767, 9768, 9769, 9770,
+  9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 
+    9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 
+    9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 
+    9777, 9778, 9779, 9780,
+  9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790,
+  9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 
+    9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 
+    9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 
+    9797, 9798, 9799, 9800,
+  9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 
+    9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 
+    9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 
+    9807, 9808, 9809, 9810,
+  9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 
+    9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 
+    9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 
+    9817, 9818, 9819, 9820,
+  9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 
+    9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 
+    9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 
+    9827, 9828, 9829, 9830,
+  9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 
+    9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 
+    9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 
+    9837, 9838, 9839, 9840,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850,
+  9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 
+    9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 
+    9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 
+    9857, 9858, 9859, 9860,
+  9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 
+    9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 
+    9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 
+    9867, 9868, 9869, 9870,
+  9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 
+    9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 
+    9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 
+    9877, 9878, 9879, 9880,
+  9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 
+    9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 
+    9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 
+    9887, 9888, 9889, 9890,
+  9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 
+    9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 
+    9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 
+    9897, 9898, 9899, 9900,
+  9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910,
+  9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 
+    9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 
+    9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 
+    9917, 9918, 9919, 9920,
+  9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 
+    9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 
+    9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 
+    9927, 9928, 9929, 9930,
+  9901, 9902, 9903, 9904, 9905, 9906, 9907, 9908, 9909, 9910, 9911, 9912, 
+    9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 9923, 9924, 
+    9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 9935, 9936, 
+    9937, 9938, 9939, 9940,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 9919, 9920, 9921, 9922, 
+    9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 9933, 9934, 
+    9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 9945, 9946, 
+    9947, 9948, 9949, 9950,
+  9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 9931, 9932, 
+    9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 9943, 9944, 
+    9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 9955, 9956, 
+    9957, 9958, 9959, 9960,
+  9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970,
+  9941, 9942, 9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 
+    9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 
+    9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 
+    9977, 9978, 9979, 9980,
+  9951, 9952, 9953, 9954, 9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 
+    9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 
+    9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 
+    9987, 9988, 9989, 9990,
+  9961, 9962, 9963, 9964, 9965, 9966, 9967, 9968, 9969, 9970, 9971, 9972, 
+    9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 9983, 9984, 
+    9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 
+    9997, 9998, 9999, 10000,
+  9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 9979, 9980, 9981, 9982, 
+    9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9994, 
+    9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 
+    10006, 10007, 10008, 10009, 10010,
+  9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 9991, 9992, 
+    9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 
+    10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 
+    10014, 10015, 10016, 10017, 10018, 10019, 10020,
+  9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 
+    10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 
+    10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 10022, 
+    10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
+  10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 
+    10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250,
+  11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260,
+  11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270,
+  11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280,
+  11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290,
+  11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300,
+  11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310,
+  11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320,
+  11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330,
+  11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350,
+  10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360,
+  10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 
+    10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370,
+  10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 
+    10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380,
+  10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 
+    10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390,
+  10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 
+    10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400,
+  10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 
+    10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410,
+  10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 
+    10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420,
+  10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 
+    10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430,
+  10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 
+    10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 
+    10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450,
+  10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 
+    10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460,
+  10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 
+    10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470,
+  10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 
+    10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480,
+  10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 
+    10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490,
+  10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 
+    10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500,
+  10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 
+    10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510,
+  10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 
+    10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520,
+  10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 
+    10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530,
+  10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 
+    10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 
+    10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550,
+  10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 
+    10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560,
+  10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 
+    10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570,
+  10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 
+    10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580,
+  10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 
+    10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590,
+  10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 
+    10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600,
+  10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 
+    10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610,
+  10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 
+    10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620,
+  10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 
+    10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630,
+  10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 
+    10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 
+    10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650,
+  10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 
+    10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660,
+  10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 
+    10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670,
+  10641, 10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 
+    10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680,
+  10651, 10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 
+    10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690,
+  10661, 10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 
+    10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700,
+  10671, 10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 
+    10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710,
+  10681, 10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 
+    10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720,
+  10691, 10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 
+    10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730,
+  10701, 10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 
+    10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 
+    10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750,
+  10721, 10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 
+    10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760,
+  10731, 10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 
+    10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770,
+  10741, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 
+    10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780,
+  10751, 10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 
+    10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790,
+  10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 
+    10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800,
+  10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 
+    10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810,
+  10781, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 
+    10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820,
+  10791, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 
+    10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830,
+  10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 
+    10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 
+    10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850,
+  10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 
+    10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860,
+  10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 
+    10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870,
+  10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 
+    10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880,
+  10851, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 
+    10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890,
+  10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 
+    10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900,
+  10871, 10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 
+    10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910,
+  10881, 10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 
+    10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920,
+  10891, 10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 
+    10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930,
+  10901, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 
+    10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  10911, 10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 
+    10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950,
+  10921, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 
+    10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960,
+  10931, 10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 
+    10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970,
+  10941, 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 
+    10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980,
+  10951, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 
+    10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990,
+  10961, 10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 
+    10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000,
+  10971, 10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 
+    10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010,
+  10981, 10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 
+    10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020,
+  10991, 10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 
+    11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030,
+  11001, 11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 
+    11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250,
+  11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260,
+  11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270,
+  11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280,
+  11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290,
+  11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300,
+  11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310,
+  11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320,
+  11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330,
+  11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250,
+  11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260,
+  11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270,
+  11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280,
+  11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290,
+  11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300,
+  11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310,
+  11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320,
+  11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330,
+  11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340,
+  11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350,
+  11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360,
+  11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370,
+  11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380,
+  11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390,
+  11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400,
+  11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410,
+  11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420,
+  11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430,
+  11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440,
+  11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250,
+  11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260,
+  11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270,
+  11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280,
+  11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290,
+  11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300,
+  11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310,
+  11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320,
+  11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330,
+  11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340,
+  11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350,
+  11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360,
+  11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370,
+  11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380,
+  11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390,
+  11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400,
+  11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410,
+  11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420,
+  11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430,
+  11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440,
+  11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450,
+  11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460,
+  11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470,
+  11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480,
+  11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490,
+  11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500,
+  11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510,
+  11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520,
+  11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530,
+  11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540,
+  11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350,
+  11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360,
+  11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 
+    11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370,
+  11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 
+    11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380,
+  11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 
+    11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390,
+  11361, 11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 
+    11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400,
+  11371, 11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 
+    11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410,
+  11381, 11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 
+    11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420,
+  11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 
+    11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430,
+  11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 
+    11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440,
+  11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450,
+  11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460,
+  11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470,
+  11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480,
+  11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490,
+  11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500,
+  11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510,
+  11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520,
+  11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530,
+  11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540,
+  11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550,
+  11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560,
+  11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570,
+  11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580,
+  11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590,
+  11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600,
+  11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610,
+  11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620,
+  11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630,
+  11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640,
+  11411, 11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 
+    11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450,
+  11421, 11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 
+    11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460,
+  11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 
+    11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470,
+  11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 
+    11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480,
+  11451, 11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 
+    11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490,
+  11461, 11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 
+    11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500,
+  11471, 11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 
+    11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510,
+  11481, 11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 
+    11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520,
+  11491, 11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 
+    11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530,
+  11501, 11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 
+    11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540,
+  11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550,
+  11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560,
+  11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570,
+  11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580,
+  11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590,
+  11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600,
+  11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610,
+  11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620,
+  11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630,
+  11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640,
+  11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650,
+  11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660,
+  11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670,
+  11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680,
+  11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690,
+  11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700,
+  11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710,
+  11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720,
+  11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730,
+  11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740,
+  11511, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 
+    11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550,
+  11521, 11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 
+    11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560,
+  11531, 11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 
+    11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570,
+  11541, 11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 
+    11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580,
+  11551, 11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 
+    11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590,
+  11561, 11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 
+    11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600,
+  11571, 11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 
+    11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610,
+  11581, 11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 
+    11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620,
+  11591, 11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 
+    11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630,
+  11601, 11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 
+    11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640,
+  11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650,
+  11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660,
+  11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670,
+  11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680,
+  11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690,
+  11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700,
+  11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710,
+  11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720,
+  11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730,
+  11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740,
+  11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750,
+  11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760,
+  11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770,
+  11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780,
+  11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790,
+  11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800,
+  11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810,
+  11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820,
+  11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830,
+  11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840,
+  11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 
+    11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650,
+  11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 
+    11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660,
+  11631, 11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 
+    11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670,
+  11641, 11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 
+    11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680,
+  11651, 11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 
+    11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690,
+  11661, 11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 
+    11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700,
+  11671, 11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 
+    11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710,
+  11681, 11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 
+    11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720,
+  11691, 11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 
+    11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730,
+  11701, 11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 
+    11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740,
+  11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750,
+  11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760,
+  11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770,
+  11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780,
+  11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790,
+  11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800,
+  11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810,
+  11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820,
+  11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830,
+  11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840,
+  11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850,
+  11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860,
+  11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870,
+  11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880,
+  11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890,
+  11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900,
+  11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910,
+  11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920,
+  11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930,
+  11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940,
+  11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 
+    11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750,
+  11721, 11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 
+    11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760,
+  11731, 11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 
+    11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770,
+  11741, 11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 
+    11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780,
+  11751, 11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 
+    11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790,
+  11761, 11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 
+    11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800,
+  11771, 11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 
+    11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810,
+  11781, 11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 
+    11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820,
+  11791, 11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 
+    11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830,
+  11801, 11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 
+    11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840,
+  11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850,
+  11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860,
+  11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870,
+  11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880,
+  11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890,
+  11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900,
+  11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910,
+  11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920,
+  11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930,
+  11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940,
+  11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950,
+  11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960,
+  11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970,
+  11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980,
+  11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990,
+  11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000,
+  11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010,
+  11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020,
+  11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030,
+  12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040,
+  11811, 11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 
+    11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850,
+  11821, 11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 
+    11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860,
+  11831, 11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 
+    11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870,
+  11841, 11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 
+    11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880,
+  11851, 11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 
+    11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890,
+  11861, 11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 
+    11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900,
+  11871, 11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 
+    11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910,
+  11881, 11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 
+    11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920,
+  11891, 11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 
+    11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930,
+  11901, 11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 
+    11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940,
+  11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950,
+  11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960,
+  11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970,
+  11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980,
+  11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990,
+  11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000,
+  11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010,
+  11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020,
+  11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030,
+  12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040,
+  12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050,
+  12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060,
+  12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070,
+  12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080,
+  12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090,
+  12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100,
+  12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110,
+  12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120,
+  12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130,
+  12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140,
+  11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 
+    11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950,
+  11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 
+    11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960,
+  11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 
+    11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970,
+  11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 
+    11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980,
+  11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 
+    11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990,
+  11961, 11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 
+    11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000,
+  11971, 11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 
+    11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010,
+  11981, 11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 
+    11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020,
+  11991, 11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 
+    12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030,
+  12001, 12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 
+    12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040,
+  12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050,
+  12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060,
+  12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070,
+  12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080,
+  12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090,
+  12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100,
+  12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110,
+  12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120,
+  12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130,
+  12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140,
+  12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150,
+  12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160,
+  12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170,
+  12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180,
+  12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190,
+  12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200,
+  12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210,
+  12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220,
+  12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230,
+  12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240,
+  12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050,
+  12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060,
+  12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070,
+  12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080,
+  12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090,
+  12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100,
+  12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110,
+  12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120,
+  12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130,
+  12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140,
+  12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150,
+  12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160,
+  12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170,
+  12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180,
+  12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190,
+  12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200,
+  12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210,
+  12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220,
+  12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230,
+  12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240,
+  12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250,
+  12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260,
+  12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270,
+  12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280,
+  12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290,
+  12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300,
+  12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310,
+  12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320,
+  12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320, 
+    12321, 12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330,
+  12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320, 
+    12321, 12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330, 
+    12331, 12332, 12333, 12334, 12335, 12336, 12337, 12338, 12339, 12340 ;
+
+ XUNEVEN = 0, 0.30103000998497, 0.477121263742447, 0.60206001996994, 
+    0.698970019817352, 0.778151273727417, 0.84509801864624, 
+    0.903090000152588, 0.954242527484894, 1 ;
+
+ XUNEVENedges = -0.150515004992485, 0.150515004992485, 0.389075636863708, 
+    0.539590641856194, 0.650515019893646, 0.738560646772385, 
+    0.811624646186829, 0.874094009399414, 0.928666263818741, 
+    0.977121263742447, 1.02287873625755 ;
+
+ YUNEVEN = 0, 0.60206001996994, 0.954242527484894, 1.20412003993988, 
+    1.3979400396347, 1.55630254745483, 1.69019603729248, 1.80618000030518 ;
+
+ YUNEVENedges = -0.30103000998497, 0.30103000998497, 0.778151273727417, 
+    1.07918128371239, 1.30103003978729, 1.47712129354477, 1.62324929237366, 
+    1.74818801879883, 1.86417198181152 ;
+
+ ZAX1_6 = 1, 2, 3, 4, 5, 6 ;
+
+ TAX1_4 = 1, 2, 3, 4 ;
+
+ UNEVENVAR =
+  1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120,
+  1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130,
+  1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140,
+  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150,
+  1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160,
+  1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170,
+  1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180,
+  1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190,
+  1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220,
+  1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230,
+  1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240,
+  1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250,
+  1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260,
+  1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270,
+  1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280,
+  1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290,
+  1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320,
+  1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330,
+  1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340,
+  1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350,
+  1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360,
+  1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370,
+  1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380,
+  1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390,
+  1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420,
+  1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430,
+  1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440,
+  1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450,
+  1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460,
+  1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470,
+  1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480,
+  1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490,
+  1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520,
+  1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530,
+  1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540,
+  1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550,
+  1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560,
+  1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570,
+  1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580,
+  1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590,
+  1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620,
+  1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630,
+  1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640,
+  1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650,
+  1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660,
+  1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670,
+  1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680,
+  1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290,
+  2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320,
+  2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330,
+  2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340,
+  2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350,
+  2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360,
+  2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370,
+  2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380,
+  2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390,
+  2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420,
+  2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430,
+  2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440,
+  2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450,
+  2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460,
+  2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470,
+  2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480,
+  2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490,
+  2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520,
+  2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530,
+  2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540,
+  2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550,
+  2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560,
+  2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570,
+  2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580,
+  2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590,
+  2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620,
+  2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630,
+  2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640,
+  2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650,
+  2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660,
+  2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670,
+  2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680,
+  2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290,
+  3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320,
+  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330,
+  3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340,
+  3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350,
+  3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360,
+  3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370,
+  3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380,
+  3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390,
+  3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420,
+  3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430,
+  3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440,
+  3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450,
+  3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460,
+  3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470,
+  3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480,
+  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490,
+  3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520,
+  3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530,
+  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540,
+  3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550,
+  3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560,
+  3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570,
+  3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580,
+  3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590,
+  3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620,
+  3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630,
+  3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640,
+  3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650,
+  3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660,
+  3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670,
+  3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680,
+  3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290,
+  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320,
+  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330,
+  4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340,
+  4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350,
+  4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360,
+  4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370,
+  4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380,
+  4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390,
+  4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420,
+  4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430,
+  4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440,
+  4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450,
+  4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460,
+  4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470,
+  4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480,
+  4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490,
+  4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520,
+  4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530,
+  4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540,
+  4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550,
+  4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560,
+  4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570,
+  4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580,
+  4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590,
+  4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620,
+  4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630,
+  4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640,
+  4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650,
+  4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660,
+  4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670,
+  4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680,
+  4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690 ;
+
+ XLON = 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 
+    155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 
+    169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180 ;
+
+ YLAT = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
+    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ;
+
+ TTIME = 34319, 34320, 34321, 34322, 34323, 34324, 34325, 34326, 34327, 
+    34328, 34329, 34330, 34331, 34332, 34333, 34334, 34335, 34336, 34337, 
+    34338 ;
+
+ XYTVAR =
+  1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 
+    1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 
+    1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 
+    1047, 1048, 1049, 1050,
+  1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 
+    1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 
+    1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 
+    1057, 1058, 1059, 1060,
+  1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 
+    1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 
+    1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 
+    1067, 1068, 1069, 1070,
+  1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 
+    1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 
+    1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 
+    1077, 1078, 1079, 1080,
+  1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 
+    1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 
+    1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 
+    1087, 1088, 1089, 1090,
+  1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 
+    1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 
+    1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 
+    1097, 1098, 1099, 1100,
+  1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 
+    1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 
+    1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 
+    1107, 1108, 1109, 1110,
+  1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 
+    1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 
+    1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 
+    1117, 1118, 1119, 1120,
+  1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 
+    1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 
+    1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 
+    1127, 1128, 1129, 1130,
+  1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 
+    1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 
+    1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 
+    1137, 1138, 1139, 1140,
+  1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 
+    1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 
+    1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 
+    1147, 1148, 1149, 1150,
+  1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 
+    1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 
+    1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 
+    1157, 1158, 1159, 1160,
+  1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 
+    1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 
+    1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 
+    1167, 1168, 1169, 1170,
+  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 
+    1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 
+    1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 
+    1177, 1178, 1179, 1180,
+  1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 
+    1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 
+    1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 
+    1187, 1188, 1189, 1190,
+  1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 
+    1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 
+    1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 
+    1197, 1198, 1199, 1200,
+  1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 
+    1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 
+    1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 
+    1207, 1208, 1209, 1210,
+  1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 
+    1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 
+    1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 
+    1217, 1218, 1219, 1220,
+  1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 
+    1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 
+    1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 
+    1227, 1228, 1229, 1230,
+  1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 
+    1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 
+    1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 
+    1237, 1238, 1239, 1240,
+  1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 
+    1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 
+    1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 
+    1247, 1248, 1249, 1250,
+  1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 
+    1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 
+    1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 
+    1257, 1258, 1259, 1260,
+  1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 
+    1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 
+    1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 
+    1267, 1268, 1269, 1270,
+  1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 
+    1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 
+    1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 
+    1277, 1278, 1279, 1280,
+  1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 
+    1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 
+    1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 
+    1287, 1288, 1289, 1290,
+  1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 
+    1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 
+    1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 
+    1297, 1298, 1299, 1300,
+  1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 
+    1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 
+    1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 
+    1307, 1308, 1309, 1310,
+  1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 
+    1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 
+    1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 
+    1317, 1318, 1319, 1320,
+  1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 
+    1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 
+    1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 
+    1327, 1328, 1329, 1330,
+  1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 
+    1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 
+    1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 
+    1337, 1338, 1339, 1340,
+  2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
+    2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 
+    2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 
+    2047, 2048, 2049, 2050,
+  2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 
+    2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 
+    2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 
+    2057, 2058, 2059, 2060,
+  2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 
+    2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 
+    2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 
+    2067, 2068, 2069, 2070,
+  2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 
+    2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 
+    2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 
+    2077, 2078, 2079, 2080,
+  2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 
+    2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 
+    2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 
+    2087, 2088, 2089, 2090,
+  2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 
+    2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 
+    2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 
+    2097, 2098, 2099, 2100,
+  2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 
+    2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 
+    2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 
+    2107, 2108, 2109, 2110,
+  2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 
+    2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 
+    2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 
+    2117, 2118, 2119, 2120,
+  2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 
+    2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 
+    2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 
+    2127, 2128, 2129, 2130,
+  2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 
+    2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 
+    2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 
+    2137, 2138, 2139, 2140,
+  2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 
+    2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 
+    2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 
+    2147, 2148, 2149, 2150,
+  2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 
+    2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 
+    2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 
+    2157, 2158, 2159, 2160,
+  2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170,
+  2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 
+    2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 
+    2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 
+    2177, 2178, 2179, 2180,
+  2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 
+    2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 
+    2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 
+    2187, 2188, 2189, 2190,
+  2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 
+    2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 
+    2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 
+    2197, 2198, 2199, 2200,
+  2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 
+    2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 
+    2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 
+    2207, 2208, 2209, 2210,
+  2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 
+    2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 
+    2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 
+    2217, 2218, 2219, 2220,
+  2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230,
+  2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 
+    2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 
+    2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 
+    2237, 2238, 2239, 2240,
+  2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 
+    2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 
+    2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 
+    2247, 2248, 2249, 2250,
+  2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 
+    2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 
+    2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 
+    2257, 2258, 2259, 2260,
+  2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 
+    2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 
+    2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 
+    2267, 2268, 2269, 2270,
+  2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 
+    2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 
+    2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 
+    2277, 2278, 2279, 2280,
+  2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290,
+  2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 
+    2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 
+    2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 
+    2297, 2298, 2299, 2300,
+  2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 
+    2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 
+    2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 
+    2307, 2308, 2309, 2310,
+  2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 
+    2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 
+    2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 
+    2317, 2318, 2319, 2320,
+  2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 
+    2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 
+    2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 
+    2327, 2328, 2329, 2330,
+  2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 
+    2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 
+    2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 
+    2337, 2338, 2339, 2340,
+  3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 
+    3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 
+    3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 
+    3047, 3048, 3049, 3050,
+  3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 
+    3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 
+    3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 
+    3057, 3058, 3059, 3060,
+  3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070,
+  3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 
+    3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 
+    3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 
+    3077, 3078, 3079, 3080,
+  3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 
+    3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 
+    3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 
+    3087, 3088, 3089, 3090,
+  3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 
+    3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 
+    3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 
+    3097, 3098, 3099, 3100,
+  3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 
+    3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 
+    3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 
+    3107, 3108, 3109, 3110,
+  3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 
+    3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 
+    3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 
+    3117, 3118, 3119, 3120,
+  3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130,
+  3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 
+    3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 
+    3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 
+    3137, 3138, 3139, 3140,
+  3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 
+    3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 
+    3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 
+    3147, 3148, 3149, 3150,
+  3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 
+    3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 
+    3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 
+    3157, 3158, 3159, 3160,
+  3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 
+    3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 
+    3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 
+    3167, 3168, 3169, 3170,
+  3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 
+    3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 
+    3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 
+    3177, 3178, 3179, 3180,
+  3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190,
+  3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 
+    3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 
+    3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 
+    3197, 3198, 3199, 3200,
+  3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 
+    3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 
+    3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 
+    3207, 3208, 3209, 3210,
+  3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 
+    3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 
+    3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 
+    3217, 3218, 3219, 3220,
+  3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 
+    3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 
+    3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 
+    3227, 3228, 3229, 3230,
+  3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 
+    3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 
+    3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 
+    3237, 3238, 3239, 3240,
+  3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250,
+  3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 
+    3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 
+    3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 
+    3257, 3258, 3259, 3260,
+  3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 
+    3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 
+    3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 
+    3267, 3268, 3269, 3270,
+  3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 
+    3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 
+    3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 
+    3277, 3278, 3279, 3280,
+  3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 
+    3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 
+    3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 
+    3287, 3288, 3289, 3290,
+  3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 
+    3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 
+    3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 
+    3297, 3298, 3299, 3300,
+  3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310,
+  3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 
+    3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 
+    3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 
+    3317, 3318, 3319, 3320,
+  3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 
+    3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 
+    3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 
+    3327, 3328, 3329, 3330,
+  3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 
+    3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 
+    3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 
+    3337, 3338, 3339, 3340,
+  4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 
+    4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 
+    4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 
+    4047, 4048, 4049, 4050,
+  4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 
+    4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 
+    4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 
+    4057, 4058, 4059, 4060,
+  4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 
+    4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 
+    4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 
+    4067, 4068, 4069, 4070,
+  4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 
+    4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 
+    4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 
+    4077, 4078, 4079, 4080,
+  4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090,
+  4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 
+    4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 
+    4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 
+    4097, 4098, 4099, 4100,
+  4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 
+    4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 
+    4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 
+    4107, 4108, 4109, 4110,
+  4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 
+    4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 
+    4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 
+    4117, 4118, 4119, 4120,
+  4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 
+    4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 
+    4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 
+    4127, 4128, 4129, 4130,
+  4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 
+    4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 
+    4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 
+    4137, 4138, 4139, 4140,
+  4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150,
+  4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 
+    4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 
+    4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 
+    4157, 4158, 4159, 4160,
+  4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 
+    4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 
+    4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 
+    4167, 4168, 4169, 4170,
+  4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 
+    4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 
+    4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 
+    4177, 4178, 4179, 4180,
+  4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 
+    4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 
+    4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 
+    4187, 4188, 4189, 4190,
+  4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 
+    4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 
+    4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 
+    4197, 4198, 4199, 4200,
+  4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210,
+  4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 
+    4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 
+    4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 
+    4217, 4218, 4219, 4220,
+  4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 
+    4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 
+    4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 
+    4227, 4228, 4229, 4230,
+  4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 
+    4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 
+    4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 
+    4237, 4238, 4239, 4240,
+  4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 
+    4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 
+    4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 
+    4247, 4248, 4249, 4250,
+  4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 
+    4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 
+    4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 
+    4257, 4258, 4259, 4260,
+  4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270,
+  4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 
+    4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 
+    4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 
+    4277, 4278, 4279, 4280,
+  4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 
+    4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 
+    4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 
+    4287, 4288, 4289, 4290,
+  4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 
+    4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 
+    4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 
+    4297, 4298, 4299, 4300,
+  4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 
+    4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 
+    4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 
+    4307, 4308, 4309, 4310,
+  4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 
+    4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 
+    4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 
+    4317, 4318, 4319, 4320,
+  4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330,
+  4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 
+    4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 
+    4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 
+    4337, 4338, 4339, 4340,
+  5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050,
+  5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 
+    5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 
+    5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 
+    5057, 5058, 5059, 5060,
+  5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 
+    5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 
+    5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 
+    5067, 5068, 5069, 5070,
+  5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 
+    5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 
+    5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 
+    5077, 5078, 5079, 5080,
+  5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 
+    5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 
+    5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 
+    5087, 5088, 5089, 5090,
+  5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 
+    5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 
+    5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 
+    5097, 5098, 5099, 5100,
+  5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110,
+  5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 
+    5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 
+    5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 
+    5117, 5118, 5119, 5120,
+  5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 
+    5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 
+    5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 
+    5127, 5128, 5129, 5130,
+  5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 
+    5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 
+    5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 
+    5137, 5138, 5139, 5140,
+  5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 
+    5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 
+    5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 
+    5147, 5148, 5149, 5150,
+  5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 
+    5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 
+    5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 
+    5157, 5158, 5159, 5160,
+  5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170,
+  5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 
+    5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 
+    5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 
+    5177, 5178, 5179, 5180,
+  5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 
+    5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 
+    5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 
+    5187, 5188, 5189, 5190,
+  5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 
+    5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 
+    5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 
+    5197, 5198, 5199, 5200,
+  5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 
+    5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 
+    5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 
+    5207, 5208, 5209, 5210,
+  5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 
+    5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 
+    5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 
+    5217, 5218, 5219, 5220,
+  5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230,
+  5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 
+    5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 
+    5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 
+    5237, 5238, 5239, 5240,
+  5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 
+    5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 
+    5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 
+    5247, 5248, 5249, 5250,
+  5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 
+    5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 
+    5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 
+    5257, 5258, 5259, 5260,
+  5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 
+    5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 
+    5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 
+    5267, 5268, 5269, 5270,
+  5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 
+    5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 
+    5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 
+    5277, 5278, 5279, 5280,
+  5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290,
+  5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 
+    5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 
+    5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 
+    5297, 5298, 5299, 5300,
+  5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 
+    5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 
+    5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 
+    5307, 5308, 5309, 5310,
+  5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 
+    5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 
+    5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 
+    5317, 5318, 5319, 5320,
+  5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 
+    5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 
+    5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 
+    5327, 5328, 5329, 5330,
+  5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 
+    5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 
+    5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 
+    5337, 5338, 5339, 5340,
+  6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 
+    6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 
+    6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 
+    6047, 6048, 6049, 6050,
+  6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 
+    6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 
+    6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 
+    6057, 6058, 6059, 6060,
+  6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070,
+  6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 
+    6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 
+    6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 
+    6077, 6078, 6079, 6080,
+  6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 
+    6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 
+    6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 
+    6087, 6088, 6089, 6090,
+  6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 
+    6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 
+    6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 
+    6097, 6098, 6099, 6100,
+  6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 
+    6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 
+    6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 
+    6107, 6108, 6109, 6110,
+  6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 
+    6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 
+    6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 
+    6117, 6118, 6119, 6120,
+  6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130,
+  6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 
+    6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 
+    6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 
+    6137, 6138, 6139, 6140,
+  6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 
+    6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 
+    6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 
+    6147, 6148, 6149, 6150,
+  6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 
+    6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 
+    6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 
+    6157, 6158, 6159, 6160,
+  6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 
+    6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 
+    6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 
+    6167, 6168, 6169, 6170,
+  6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 
+    6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 
+    6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 
+    6177, 6178, 6179, 6180,
+  6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190,
+  6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 
+    6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 
+    6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 
+    6197, 6198, 6199, 6200,
+  6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 
+    6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 
+    6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 
+    6207, 6208, 6209, 6210,
+  6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 
+    6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 
+    6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 
+    6217, 6218, 6219, 6220,
+  6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 
+    6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 
+    6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 
+    6227, 6228, 6229, 6230,
+  6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 
+    6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 
+    6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 
+    6237, 6238, 6239, 6240,
+  6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250,
+  6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 
+    6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 
+    6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 
+    6257, 6258, 6259, 6260,
+  6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 
+    6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 
+    6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 
+    6267, 6268, 6269, 6270,
+  6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 
+    6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 
+    6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 
+    6277, 6278, 6279, 6280,
+  6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 
+    6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 
+    6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 
+    6287, 6288, 6289, 6290,
+  6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 
+    6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 
+    6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 
+    6297, 6298, 6299, 6300,
+  6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310,
+  6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 
+    6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 
+    6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 
+    6317, 6318, 6319, 6320,
+  6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 
+    6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 
+    6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 
+    6327, 6328, 6329, 6330,
+  6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 
+    6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 
+    6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 
+    6337, 6338, 6339, 6340,
+  7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 
+    7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 
+    7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 
+    7047, 7048, 7049, 7050,
+  7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 
+    7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 
+    7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 
+    7057, 7058, 7059, 7060,
+  7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 
+    7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 
+    7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 
+    7067, 7068, 7069, 7070,
+  7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 
+    7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 
+    7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 
+    7077, 7078, 7079, 7080,
+  7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090,
+  7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 
+    7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 
+    7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 
+    7097, 7098, 7099, 7100,
+  7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 
+    7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 
+    7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 
+    7107, 7108, 7109, 7110,
+  7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 
+    7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 
+    7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 
+    7117, 7118, 7119, 7120,
+  7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 
+    7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 
+    7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 
+    7127, 7128, 7129, 7130,
+  7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 
+    7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 
+    7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 
+    7137, 7138, 7139, 7140,
+  7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150,
+  7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 
+    7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 
+    7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 
+    7157, 7158, 7159, 7160,
+  7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 
+    7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 
+    7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 
+    7167, 7168, 7169, 7170,
+  7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 
+    7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 
+    7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 
+    7177, 7178, 7179, 7180,
+  7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 
+    7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 
+    7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 
+    7187, 7188, 7189, 7190,
+  7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 
+    7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 
+    7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 
+    7197, 7198, 7199, 7200,
+  7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210,
+  7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 
+    7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 
+    7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 
+    7217, 7218, 7219, 7220,
+  7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 
+    7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 
+    7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 
+    7227, 7228, 7229, 7230,
+  7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 
+    7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 
+    7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 
+    7237, 7238, 7239, 7240,
+  7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 
+    7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 
+    7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 
+    7247, 7248, 7249, 7250,
+  7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 
+    7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 
+    7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 
+    7257, 7258, 7259, 7260,
+  7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270,
+  7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 
+    7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 
+    7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 
+    7277, 7278, 7279, 7280,
+  7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 
+    7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 
+    7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 
+    7287, 7288, 7289, 7290,
+  7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 
+    7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 
+    7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 
+    7297, 7298, 7299, 7300,
+  7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 
+    7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 
+    7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 
+    7307, 7308, 7309, 7310,
+  7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 
+    7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 
+    7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 
+    7317, 7318, 7319, 7320,
+  7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330,
+  7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 
+    7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 
+    7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 
+    7337, 7338, 7339, 7340,
+  8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050,
+  8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 
+    8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 
+    8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 
+    8057, 8058, 8059, 8060,
+  8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 
+    8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 
+    8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 
+    8067, 8068, 8069, 8070,
+  8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 
+    8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 
+    8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 
+    8077, 8078, 8079, 8080,
+  8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 
+    8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 
+    8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 
+    8087, 8088, 8089, 8090,
+  8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 
+    8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 
+    8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 
+    8097, 8098, 8099, 8100,
+  8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110,
+  8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 
+    8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 
+    8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 
+    8117, 8118, 8119, 8120,
+  8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 
+    8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 
+    8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 
+    8127, 8128, 8129, 8130,
+  8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 
+    8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 
+    8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 
+    8137, 8138, 8139, 8140,
+  8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 
+    8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 
+    8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 
+    8147, 8148, 8149, 8150,
+  8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 
+    8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 
+    8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 
+    8157, 8158, 8159, 8160,
+  8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170,
+  8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 
+    8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 
+    8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 
+    8177, 8178, 8179, 8180,
+  8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 
+    8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 
+    8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 
+    8187, 8188, 8189, 8190,
+  8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 
+    8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 
+    8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 
+    8197, 8198, 8199, 8200,
+  8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 
+    8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 
+    8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 
+    8207, 8208, 8209, 8210,
+  8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 
+    8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 
+    8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 
+    8217, 8218, 8219, 8220,
+  8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230,
+  8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 
+    8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 
+    8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 
+    8237, 8238, 8239, 8240,
+  8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 
+    8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 
+    8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 
+    8247, 8248, 8249, 8250,
+  8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 
+    8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 
+    8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 
+    8257, 8258, 8259, 8260,
+  8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 
+    8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 
+    8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 
+    8267, 8268, 8269, 8270,
+  8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 
+    8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 
+    8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 
+    8277, 8278, 8279, 8280,
+  8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290,
+  8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 
+    8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 
+    8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 
+    8297, 8298, 8299, 8300,
+  8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 
+    8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 
+    8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 
+    8307, 8308, 8309, 8310,
+  8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 
+    8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 
+    8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 
+    8317, 8318, 8319, 8320,
+  8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 
+    8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 
+    8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 
+    8327, 8328, 8329, 8330,
+  8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 
+    8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 
+    8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 
+    8337, 8338, 8339, 8340,
+  9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 
+    9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 
+    9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 
+    9047, 9048, 9049, 9050,
+  9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 
+    9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 
+    9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 
+    9057, 9058, 9059, 9060,
+  9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070,
+  9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 
+    9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 
+    9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 
+    9077, 9078, 9079, 9080,
+  9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 
+    9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 
+    9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 
+    9087, 9088, 9089, 9090,
+  9061, 9062, 9063, 9064, 9065, 9066, 9067, 9068, 9069, 9070, 9071, 9072, 
+    9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 9083, 9084, 
+    9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 9095, 9096, 
+    9097, 9098, 9099, 9100,
+  9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 9079, 9080, 9081, 9082, 
+    9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 9093, 9094, 
+    9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 9105, 9106, 
+    9107, 9108, 9109, 9110,
+  9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 9091, 9092, 
+    9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 9103, 9104, 
+    9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 9115, 9116, 
+    9117, 9118, 9119, 9120,
+  9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130,
+  9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 
+    9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 
+    9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 
+    9137, 9138, 9139, 9140,
+  9111, 9112, 9113, 9114, 9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 
+    9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 
+    9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 
+    9147, 9148, 9149, 9150,
+  9121, 9122, 9123, 9124, 9125, 9126, 9127, 9128, 9129, 9130, 9131, 9132, 
+    9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 9143, 9144, 
+    9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 9155, 9156, 
+    9157, 9158, 9159, 9160,
+  9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139, 9140, 9141, 9142, 
+    9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 9153, 9154, 
+    9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 9165, 9166, 
+    9167, 9168, 9169, 9170,
+  9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 9151, 9152, 
+    9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 9163, 9164, 
+    9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 9175, 9176, 
+    9177, 9178, 9179, 9180,
+  9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190,
+  9161, 9162, 9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 
+    9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 
+    9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 
+    9197, 9198, 9199, 9200,
+  9171, 9172, 9173, 9174, 9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 
+    9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 
+    9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 
+    9207, 9208, 9209, 9210,
+  9181, 9182, 9183, 9184, 9185, 9186, 9187, 9188, 9189, 9190, 9191, 9192, 
+    9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 
+    9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 
+    9217, 9218, 9219, 9220,
+  9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 
+    9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 9213, 9214, 
+    9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 9225, 9226, 
+    9227, 9228, 9229, 9230,
+  9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 9211, 9212, 
+    9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 9223, 9224, 
+    9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 9235, 9236, 
+    9237, 9238, 9239, 9240,
+  9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250,
+  9221, 9222, 9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 
+    9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 
+    9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 
+    9257, 9258, 9259, 9260,
+  9231, 9232, 9233, 9234, 9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 
+    9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 
+    9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 
+    9267, 9268, 9269, 9270,
+  9241, 9242, 9243, 9244, 9245, 9246, 9247, 9248, 9249, 9250, 9251, 9252, 
+    9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 9263, 9264, 
+    9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 9275, 9276, 
+    9277, 9278, 9279, 9280,
+  9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 9259, 9260, 9261, 9262, 
+    9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 9273, 9274, 
+    9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 9285, 9286, 
+    9287, 9288, 9289, 9290,
+  9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 9271, 9272, 
+    9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 9283, 9284, 
+    9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 9295, 9296, 
+    9297, 9298, 9299, 9300,
+  9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310,
+  9281, 9282, 9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 
+    9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 
+    9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 
+    9317, 9318, 9319, 9320,
+  9291, 9292, 9293, 9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 
+    9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 
+    9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 
+    9327, 9328, 9329, 9330,
+  9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, 9312, 
+    9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320, 9321, 9322, 9323, 9324, 
+    9325, 9326, 9327, 9328, 9329, 9330, 9331, 9332, 9333, 9334, 9335, 9336, 
+    9337, 9338, 9339, 9340,
+  10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 
+    10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050,
+  10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 
+    10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060,
+  10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 
+    10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
+  10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 
+    10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080,
+  10051, 10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 
+    10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090,
+  10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 
+    10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100,
+  10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 
+    10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110,
+  10081, 10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 
+    10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120,
+  10091, 10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 
+    10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130,
+  10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 
+    10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140,
+  10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 
+    10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150,
+  10121, 10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 
+    10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160,
+  10131, 10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 
+    10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170,
+  10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 
+    10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180,
+  10151, 10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 
+    10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190,
+  10161, 10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 
+    10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200,
+  10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 
+    10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210,
+  10181, 10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 
+    10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220,
+  10191, 10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 
+    10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230,
+  10201, 10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 
+    10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240,
+  10211, 10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 
+    10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250,
+  10221, 10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 
+    10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260,
+  10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 
+    10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
+  10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 
+    10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280,
+  10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 
+    10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290,
+  10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 
+    10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300,
+  10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 
+    10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310,
+  10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 
+    10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320,
+  10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 
+    10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330,
+  10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 
+    10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 
+    10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 
+    10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340,
+  11011, 11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 
+    11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050,
+  11021, 11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 
+    11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060,
+  11031, 11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 
+    11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070,
+  11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 
+    11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080,
+  11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 
+    11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090,
+  11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 
+    11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100,
+  11071, 11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 
+    11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110,
+  11081, 11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 
+    11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120,
+  11091, 11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 
+    11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130,
+  11101, 11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 
+    11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140,
+  11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 
+    11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150,
+  11121, 11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 
+    11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160,
+  11131, 11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 
+    11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
+  11141, 11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 
+    11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180,
+  11151, 11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 
+    11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190,
+  11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 
+    11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200,
+  11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 
+    11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
+  11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 
+    11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
+  11191, 11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 
+    11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230,
+  11201, 11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 
+    11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240,
+  11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 
+    11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250,
+  11221, 11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 
+    11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260,
+  11231, 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 
+    11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270,
+  11241, 11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 
+    11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280,
+  11251, 11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 
+    11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290,
+  11261, 11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 
+    11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300,
+  11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 
+    11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310,
+  11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 
+    11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320,
+  11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 
+    11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330,
+  11301, 11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 
+    11311, 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 
+    11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 
+    11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340,
+  12011, 12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 
+    12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050,
+  12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 
+    12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060,
+  12031, 12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 
+    12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070,
+  12041, 12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 
+    12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080,
+  12051, 12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 
+    12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090,
+  12061, 12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 
+    12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100,
+  12071, 12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 
+    12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110,
+  12081, 12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 
+    12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120,
+  12091, 12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 
+    12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130,
+  12101, 12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 
+    12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140,
+  12111, 12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 
+    12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150,
+  12121, 12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 
+    12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160,
+  12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 
+    12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170,
+  12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 
+    12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180,
+  12151, 12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 
+    12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190,
+  12161, 12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 
+    12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200,
+  12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 
+    12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210,
+  12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 
+    12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220,
+  12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 
+    12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230,
+  12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 
+    12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240,
+  12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 
+    12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250,
+  12221, 12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 
+    12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260,
+  12231, 12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 
+    12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270,
+  12241, 12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 
+    12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280,
+  12251, 12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 
+    12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290,
+  12261, 12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 
+    12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300,
+  12271, 12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 
+    12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310,
+  12281, 12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 
+    12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320,
+  12291, 12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 
+    12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320, 
+    12321, 12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330,
+  12301, 12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 
+    12311, 12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320, 
+    12321, 12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330, 
+    12331, 12332, 12333, 12334, 12335, 12336, 12337, 12338, 12339, 12340,
+  13011, 13012, 13013, 13014, 13015, 13016, 13017, 13018, 13019, 13020, 
+    13021, 13022, 13023, 13024, 13025, 13026, 13027, 13028, 13029, 13030, 
+    13031, 13032, 13033, 13034, 13035, 13036, 13037, 13038, 13039, 13040, 
+    13041, 13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050,
+  13021, 13022, 13023, 13024, 13025, 13026, 13027, 13028, 13029, 13030, 
+    13031, 13032, 13033, 13034, 13035, 13036, 13037, 13038, 13039, 13040, 
+    13041, 13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050, 
+    13051, 13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060,
+  13031, 13032, 13033, 13034, 13035, 13036, 13037, 13038, 13039, 13040, 
+    13041, 13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050, 
+    13051, 13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060, 
+    13061, 13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070,
+  13041, 13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050, 
+    13051, 13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060, 
+    13061, 13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070, 
+    13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080,
+  13051, 13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060, 
+    13061, 13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070, 
+    13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 
+    13081, 13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090,
+  13061, 13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070, 
+    13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 
+    13081, 13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090, 
+    13091, 13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100,
+  13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 
+    13081, 13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090, 
+    13091, 13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100, 
+    13101, 13102, 13103, 13104, 13105, 13106, 13107, 13108, 13109, 13110,
+  13081, 13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090, 
+    13091, 13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100, 
+    13101, 13102, 13103, 13104, 13105, 13106, 13107, 13108, 13109, 13110, 
+    13111, 13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120,
+  13091, 13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100, 
+    13101, 13102, 13103, 13104, 13105, 13106, 13107, 13108, 13109, 13110, 
+    13111, 13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120, 
+    13121, 13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130,
+  13101, 13102, 13103, 13104, 13105, 13106, 13107, 13108, 13109, 13110, 
+    13111, 13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120, 
+    13121, 13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130, 
+    13131, 13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140,
+  13111, 13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120, 
+    13121, 13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130, 
+    13131, 13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140, 
+    13141, 13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150,
+  13121, 13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130, 
+    13131, 13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140, 
+    13141, 13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150, 
+    13151, 13152, 13153, 13154, 13155, 13156, 13157, 13158, 13159, 13160,
+  13131, 13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140, 
+    13141, 13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150, 
+    13151, 13152, 13153, 13154, 13155, 13156, 13157, 13158, 13159, 13160, 
+    13161, 13162, 13163, 13164, 13165, 13166, 13167, 13168, 13169, 13170,
+  13141, 13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150, 
+    13151, 13152, 13153, 13154, 13155, 13156, 13157, 13158, 13159, 13160, 
+    13161, 13162, 13163, 13164, 13165, 13166, 13167, 13168, 13169, 13170, 
+    13171, 13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180,
+  13151, 13152, 13153, 13154, 13155, 13156, 13157, 13158, 13159, 13160, 
+    13161, 13162, 13163, 13164, 13165, 13166, 13167, 13168, 13169, 13170, 
+    13171, 13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180, 
+    13181, 13182, 13183, 13184, 13185, 13186, 13187, 13188, 13189, 13190,
+  13161, 13162, 13163, 13164, 13165, 13166, 13167, 13168, 13169, 13170, 
+    13171, 13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180, 
+    13181, 13182, 13183, 13184, 13185, 13186, 13187, 13188, 13189, 13190, 
+    13191, 13192, 13193, 13194, 13195, 13196, 13197, 13198, 13199, 13200,
+  13171, 13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180, 
+    13181, 13182, 13183, 13184, 13185, 13186, 13187, 13188, 13189, 13190, 
+    13191, 13192, 13193, 13194, 13195, 13196, 13197, 13198, 13199, 13200, 
+    13201, 13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210,
+  13181, 13182, 13183, 13184, 13185, 13186, 13187, 13188, 13189, 13190, 
+    13191, 13192, 13193, 13194, 13195, 13196, 13197, 13198, 13199, 13200, 
+    13201, 13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210, 
+    13211, 13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220,
+  13191, 13192, 13193, 13194, 13195, 13196, 13197, 13198, 13199, 13200, 
+    13201, 13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210, 
+    13211, 13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220, 
+    13221, 13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230,
+  13201, 13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210, 
+    13211, 13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220, 
+    13221, 13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230, 
+    13231, 13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240,
+  13211, 13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220, 
+    13221, 13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230, 
+    13231, 13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240, 
+    13241, 13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250,
+  13221, 13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230, 
+    13231, 13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240, 
+    13241, 13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250, 
+    13251, 13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260,
+  13231, 13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240, 
+    13241, 13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250, 
+    13251, 13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260, 
+    13261, 13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270,
+  13241, 13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250, 
+    13251, 13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260, 
+    13261, 13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270, 
+    13271, 13272, 13273, 13274, 13275, 13276, 13277, 13278, 13279, 13280,
+  13251, 13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260, 
+    13261, 13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270, 
+    13271, 13272, 13273, 13274, 13275, 13276, 13277, 13278, 13279, 13280, 
+    13281, 13282, 13283, 13284, 13285, 13286, 13287, 13288, 13289, 13290,
+  13261, 13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270, 
+    13271, 13272, 13273, 13274, 13275, 13276, 13277, 13278, 13279, 13280, 
+    13281, 13282, 13283, 13284, 13285, 13286, 13287, 13288, 13289, 13290, 
+    13291, 13292, 13293, 13294, 13295, 13296, 13297, 13298, 13299, 13300,
+  13271, 13272, 13273, 13274, 13275, 13276, 13277, 13278, 13279, 13280, 
+    13281, 13282, 13283, 13284, 13285, 13286, 13287, 13288, 13289, 13290, 
+    13291, 13292, 13293, 13294, 13295, 13296, 13297, 13298, 13299, 13300, 
+    13301, 13302, 13303, 13304, 13305, 13306, 13307, 13308, 13309, 13310,
+  13281, 13282, 13283, 13284, 13285, 13286, 13287, 13288, 13289, 13290, 
+    13291, 13292, 13293, 13294, 13295, 13296, 13297, 13298, 13299, 13300, 
+    13301, 13302, 13303, 13304, 13305, 13306, 13307, 13308, 13309, 13310, 
+    13311, 13312, 13313, 13314, 13315, 13316, 13317, 13318, 13319, 13320,
+  13291, 13292, 13293, 13294, 13295, 13296, 13297, 13298, 13299, 13300, 
+    13301, 13302, 13303, 13304, 13305, 13306, 13307, 13308, 13309, 13310, 
+    13311, 13312, 13313, 13314, 13315, 13316, 13317, 13318, 13319, 13320, 
+    13321, 13322, 13323, 13324, 13325, 13326, 13327, 13328, 13329, 13330,
+  13301, 13302, 13303, 13304, 13305, 13306, 13307, 13308, 13309, 13310, 
+    13311, 13312, 13313, 13314, 13315, 13316, 13317, 13318, 13319, 13320, 
+    13321, 13322, 13323, 13324, 13325, 13326, 13327, 13328, 13329, 13330, 
+    13331, 13332, 13333, 13334, 13335, 13336, 13337, 13338, 13339, 13340,
+  14011, 14012, 14013, 14014, 14015, 14016, 14017, 14018, 14019, 14020, 
+    14021, 14022, 14023, 14024, 14025, 14026, 14027, 14028, 14029, 14030, 
+    14031, 14032, 14033, 14034, 14035, 14036, 14037, 14038, 14039, 14040, 
+    14041, 14042, 14043, 14044, 14045, 14046, 14047, 14048, 14049, 14050,
+  14021, 14022, 14023, 14024, 14025, 14026, 14027, 14028, 14029, 14030, 
+    14031, 14032, 14033, 14034, 14035, 14036, 14037, 14038, 14039, 14040, 
+    14041, 14042, 14043, 14044, 14045, 14046, 14047, 14048, 14049, 14050, 
+    14051, 14052, 14053, 14054, 14055, 14056, 14057, 14058, 14059, 14060,
+  14031, 14032, 14033, 14034, 14035, 14036, 14037, 14038, 14039, 14040, 
+    14041, 14042, 14043, 14044, 14045, 14046, 14047, 14048, 14049, 14050, 
+    14051, 14052, 14053, 14054, 14055, 14056, 14057, 14058, 14059, 14060, 
+    14061, 14062, 14063, 14064, 14065, 14066, 14067, 14068, 14069, 14070,
+  14041, 14042, 14043, 14044, 14045, 14046, 14047, 14048, 14049, 14050, 
+    14051, 14052, 14053, 14054, 14055, 14056, 14057, 14058, 14059, 14060, 
+    14061, 14062, 14063, 14064, 14065, 14066, 14067, 14068, 14069, 14070, 
+    14071, 14072, 14073, 14074, 14075, 14076, 14077, 14078, 14079, 14080,
+  14051, 14052, 14053, 14054, 14055, 14056, 14057, 14058, 14059, 14060, 
+    14061, 14062, 14063, 14064, 14065, 14066, 14067, 14068, 14069, 14070, 
+    14071, 14072, 14073, 14074, 14075, 14076, 14077, 14078, 14079, 14080, 
+    14081, 14082, 14083, 14084, 14085, 14086, 14087, 14088, 14089, 14090,
+  14061, 14062, 14063, 14064, 14065, 14066, 14067, 14068, 14069, 14070, 
+    14071, 14072, 14073, 14074, 14075, 14076, 14077, 14078, 14079, 14080, 
+    14081, 14082, 14083, 14084, 14085, 14086, 14087, 14088, 14089, 14090, 
+    14091, 14092, 14093, 14094, 14095, 14096, 14097, 14098, 14099, 14100,
+  14071, 14072, 14073, 14074, 14075, 14076, 14077, 14078, 14079, 14080, 
+    14081, 14082, 14083, 14084, 14085, 14086, 14087, 14088, 14089, 14090, 
+    14091, 14092, 14093, 14094, 14095, 14096, 14097, 14098, 14099, 14100, 
+    14101, 14102, 14103, 14104, 14105, 14106, 14107, 14108, 14109, 14110,
+  14081, 14082, 14083, 14084, 14085, 14086, 14087, 14088, 14089, 14090, 
+    14091, 14092, 14093, 14094, 14095, 14096, 14097, 14098, 14099, 14100, 
+    14101, 14102, 14103, 14104, 14105, 14106, 14107, 14108, 14109, 14110, 
+    14111, 14112, 14113, 14114, 14115, 14116, 14117, 14118, 14119, 14120,
+  14091, 14092, 14093, 14094, 14095, 14096, 14097, 14098, 14099, 14100, 
+    14101, 14102, 14103, 14104, 14105, 14106, 14107, 14108, 14109, 14110, 
+    14111, 14112, 14113, 14114, 14115, 14116, 14117, 14118, 14119, 14120, 
+    14121, 14122, 14123, 14124, 14125, 14126, 14127, 14128, 14129, 14130,
+  14101, 14102, 14103, 14104, 14105, 14106, 14107, 14108, 14109, 14110, 
+    14111, 14112, 14113, 14114, 14115, 14116, 14117, 14118, 14119, 14120, 
+    14121, 14122, 14123, 14124, 14125, 14126, 14127, 14128, 14129, 14130, 
+    14131, 14132, 14133, 14134, 14135, 14136, 14137, 14138, 14139, 14140,
+  14111, 14112, 14113, 14114, 14115, 14116, 14117, 14118, 14119, 14120, 
+    14121, 14122, 14123, 14124, 14125, 14126, 14127, 14128, 14129, 14130, 
+    14131, 14132, 14133, 14134, 14135, 14136, 14137, 14138, 14139, 14140, 
+    14141, 14142, 14143, 14144, 14145, 14146, 14147, 14148, 14149, 14150,
+  14121, 14122, 14123, 14124, 14125, 14126, 14127, 14128, 14129, 14130, 
+    14131, 14132, 14133, 14134, 14135, 14136, 14137, 14138, 14139, 14140, 
+    14141, 14142, 14143, 14144, 14145, 14146, 14147, 14148, 14149, 14150, 
+    14151, 14152, 14153, 14154, 14155, 14156, 14157, 14158, 14159, 14160,
+  14131, 14132, 14133, 14134, 14135, 14136, 14137, 14138, 14139, 14140, 
+    14141, 14142, 14143, 14144, 14145, 14146, 14147, 14148, 14149, 14150, 
+    14151, 14152, 14153, 14154, 14155, 14156, 14157, 14158, 14159, 14160, 
+    14161, 14162, 14163, 14164, 14165, 14166, 14167, 14168, 14169, 14170,
+  14141, 14142, 14143, 14144, 14145, 14146, 14147, 14148, 14149, 14150, 
+    14151, 14152, 14153, 14154, 14155, 14156, 14157, 14158, 14159, 14160, 
+    14161, 14162, 14163, 14164, 14165, 14166, 14167, 14168, 14169, 14170, 
+    14171, 14172, 14173, 14174, 14175, 14176, 14177, 14178, 14179, 14180,
+  14151, 14152, 14153, 14154, 14155, 14156, 14157, 14158, 14159, 14160, 
+    14161, 14162, 14163, 14164, 14165, 14166, 14167, 14168, 14169, 14170, 
+    14171, 14172, 14173, 14174, 14175, 14176, 14177, 14178, 14179, 14180, 
+    14181, 14182, 14183, 14184, 14185, 14186, 14187, 14188, 14189, 14190,
+  14161, 14162, 14163, 14164, 14165, 14166, 14167, 14168, 14169, 14170, 
+    14171, 14172, 14173, 14174, 14175, 14176, 14177, 14178, 14179, 14180, 
+    14181, 14182, 14183, 14184, 14185, 14186, 14187, 14188, 14189, 14190, 
+    14191, 14192, 14193, 14194, 14195, 14196, 14197, 14198, 14199, 14200,
+  14171, 14172, 14173, 14174, 14175, 14176, 14177, 14178, 14179, 14180, 
+    14181, 14182, 14183, 14184, 14185, 14186, 14187, 14188, 14189, 14190, 
+    14191, 14192, 14193, 14194, 14195, 14196, 14197, 14198, 14199, 14200, 
+    14201, 14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210,
+  14181, 14182, 14183, 14184, 14185, 14186, 14187, 14188, 14189, 14190, 
+    14191, 14192, 14193, 14194, 14195, 14196, 14197, 14198, 14199, 14200, 
+    14201, 14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210, 
+    14211, 14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220,
+  14191, 14192, 14193, 14194, 14195, 14196, 14197, 14198, 14199, 14200, 
+    14201, 14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210, 
+    14211, 14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220, 
+    14221, 14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230,
+  14201, 14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210, 
+    14211, 14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220, 
+    14221, 14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230, 
+    14231, 14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240,
+  14211, 14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220, 
+    14221, 14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230, 
+    14231, 14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240, 
+    14241, 14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250,
+  14221, 14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230, 
+    14231, 14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240, 
+    14241, 14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250, 
+    14251, 14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260,
+  14231, 14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240, 
+    14241, 14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250, 
+    14251, 14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260, 
+    14261, 14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270,
+  14241, 14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250, 
+    14251, 14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260, 
+    14261, 14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270, 
+    14271, 14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280,
+  14251, 14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260, 
+    14261, 14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270, 
+    14271, 14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280, 
+    14281, 14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290,
+  14261, 14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270, 
+    14271, 14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280, 
+    14281, 14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290, 
+    14291, 14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300,
+  14271, 14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280, 
+    14281, 14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290, 
+    14291, 14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300, 
+    14301, 14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310,
+  14281, 14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290, 
+    14291, 14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300, 
+    14301, 14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310, 
+    14311, 14312, 14313, 14314, 14315, 14316, 14317, 14318, 14319, 14320,
+  14291, 14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300, 
+    14301, 14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310, 
+    14311, 14312, 14313, 14314, 14315, 14316, 14317, 14318, 14319, 14320, 
+    14321, 14322, 14323, 14324, 14325, 14326, 14327, 14328, 14329, 14330,
+  14301, 14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310, 
+    14311, 14312, 14313, 14314, 14315, 14316, 14317, 14318, 14319, 14320, 
+    14321, 14322, 14323, 14324, 14325, 14326, 14327, 14328, 14329, 14330, 
+    14331, 14332, 14333, 14334, 14335, 14336, 14337, 14338, 14339, 14340,
+  15011, 15012, 15013, 15014, 15015, 15016, 15017, 15018, 15019, 15020, 
+    15021, 15022, 15023, 15024, 15025, 15026, 15027, 15028, 15029, 15030, 
+    15031, 15032, 15033, 15034, 15035, 15036, 15037, 15038, 15039, 15040, 
+    15041, 15042, 15043, 15044, 15045, 15046, 15047, 15048, 15049, 15050,
+  15021, 15022, 15023, 15024, 15025, 15026, 15027, 15028, 15029, 15030, 
+    15031, 15032, 15033, 15034, 15035, 15036, 15037, 15038, 15039, 15040, 
+    15041, 15042, 15043, 15044, 15045, 15046, 15047, 15048, 15049, 15050, 
+    15051, 15052, 15053, 15054, 15055, 15056, 15057, 15058, 15059, 15060,
+  15031, 15032, 15033, 15034, 15035, 15036, 15037, 15038, 15039, 15040, 
+    15041, 15042, 15043, 15044, 15045, 15046, 15047, 15048, 15049, 15050, 
+    15051, 15052, 15053, 15054, 15055, 15056, 15057, 15058, 15059, 15060, 
+    15061, 15062, 15063, 15064, 15065, 15066, 15067, 15068, 15069, 15070,
+  15041, 15042, 15043, 15044, 15045, 15046, 15047, 15048, 15049, 15050, 
+    15051, 15052, 15053, 15054, 15055, 15056, 15057, 15058, 15059, 15060, 
+    15061, 15062, 15063, 15064, 15065, 15066, 15067, 15068, 15069, 15070, 
+    15071, 15072, 15073, 15074, 15075, 15076, 15077, 15078, 15079, 15080,
+  15051, 15052, 15053, 15054, 15055, 15056, 15057, 15058, 15059, 15060, 
+    15061, 15062, 15063, 15064, 15065, 15066, 15067, 15068, 15069, 15070, 
+    15071, 15072, 15073, 15074, 15075, 15076, 15077, 15078, 15079, 15080, 
+    15081, 15082, 15083, 15084, 15085, 15086, 15087, 15088, 15089, 15090,
+  15061, 15062, 15063, 15064, 15065, 15066, 15067, 15068, 15069, 15070, 
+    15071, 15072, 15073, 15074, 15075, 15076, 15077, 15078, 15079, 15080, 
+    15081, 15082, 15083, 15084, 15085, 15086, 15087, 15088, 15089, 15090, 
+    15091, 15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100,
+  15071, 15072, 15073, 15074, 15075, 15076, 15077, 15078, 15079, 15080, 
+    15081, 15082, 15083, 15084, 15085, 15086, 15087, 15088, 15089, 15090, 
+    15091, 15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100, 
+    15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110,
+  15081, 15082, 15083, 15084, 15085, 15086, 15087, 15088, 15089, 15090, 
+    15091, 15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100, 
+    15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 
+    15111, 15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120,
+  15091, 15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100, 
+    15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 
+    15111, 15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120, 
+    15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130,
+  15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 
+    15111, 15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120, 
+    15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 
+    15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140,
+  15111, 15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120, 
+    15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 
+    15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 
+    15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150,
+  15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 
+    15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 
+    15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 
+    15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160,
+  15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 
+    15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 
+    15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 
+    15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170,
+  15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 
+    15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 
+    15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 
+    15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180,
+  15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 
+    15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 
+    15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 
+    15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190,
+  15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 
+    15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 
+    15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 
+    15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200,
+  15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 
+    15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 
+    15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 
+    15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210,
+  15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 
+    15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 
+    15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 
+    15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220,
+  15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 
+    15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 
+    15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 
+    15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230,
+  15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 
+    15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 
+    15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 
+    15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240,
+  15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 
+    15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 
+    15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 
+    15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250,
+  15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 
+    15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 
+    15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 
+    15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260,
+  15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 
+    15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 
+    15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 
+    15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270,
+  15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 
+    15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 
+    15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 
+    15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280,
+  15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 
+    15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 
+    15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 
+    15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290,
+  15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 
+    15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 
+    15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 
+    15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300,
+  15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 
+    15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 
+    15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 
+    15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310,
+  15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 
+    15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 
+    15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 
+    15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320,
+  15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 
+    15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 
+    15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320, 
+    15321, 15322, 15323, 15324, 15325, 15326, 15327, 15328, 15329, 15330,
+  15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 
+    15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320, 
+    15321, 15322, 15323, 15324, 15325, 15326, 15327, 15328, 15329, 15330, 
+    15331, 15332, 15333, 15334, 15335, 15336, 15337, 15338, 15339, 15340,
+  16011, 16012, 16013, 16014, 16015, 16016, 16017, 16018, 16019, 16020, 
+    16021, 16022, 16023, 16024, 16025, 16026, 16027, 16028, 16029, 16030, 
+    16031, 16032, 16033, 16034, 16035, 16036, 16037, 16038, 16039, 16040, 
+    16041, 16042, 16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050,
+  16021, 16022, 16023, 16024, 16025, 16026, 16027, 16028, 16029, 16030, 
+    16031, 16032, 16033, 16034, 16035, 16036, 16037, 16038, 16039, 16040, 
+    16041, 16042, 16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050, 
+    16051, 16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060,
+  16031, 16032, 16033, 16034, 16035, 16036, 16037, 16038, 16039, 16040, 
+    16041, 16042, 16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050, 
+    16051, 16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060, 
+    16061, 16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069, 16070,
+  16041, 16042, 16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050, 
+    16051, 16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060, 
+    16061, 16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069, 16070, 
+    16071, 16072, 16073, 16074, 16075, 16076, 16077, 16078, 16079, 16080,
+  16051, 16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060, 
+    16061, 16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069, 16070, 
+    16071, 16072, 16073, 16074, 16075, 16076, 16077, 16078, 16079, 16080, 
+    16081, 16082, 16083, 16084, 16085, 16086, 16087, 16088, 16089, 16090,
+  16061, 16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069, 16070, 
+    16071, 16072, 16073, 16074, 16075, 16076, 16077, 16078, 16079, 16080, 
+    16081, 16082, 16083, 16084, 16085, 16086, 16087, 16088, 16089, 16090, 
+    16091, 16092, 16093, 16094, 16095, 16096, 16097, 16098, 16099, 16100,
+  16071, 16072, 16073, 16074, 16075, 16076, 16077, 16078, 16079, 16080, 
+    16081, 16082, 16083, 16084, 16085, 16086, 16087, 16088, 16089, 16090, 
+    16091, 16092, 16093, 16094, 16095, 16096, 16097, 16098, 16099, 16100, 
+    16101, 16102, 16103, 16104, 16105, 16106, 16107, 16108, 16109, 16110,
+  16081, 16082, 16083, 16084, 16085, 16086, 16087, 16088, 16089, 16090, 
+    16091, 16092, 16093, 16094, 16095, 16096, 16097, 16098, 16099, 16100, 
+    16101, 16102, 16103, 16104, 16105, 16106, 16107, 16108, 16109, 16110, 
+    16111, 16112, 16113, 16114, 16115, 16116, 16117, 16118, 16119, 16120,
+  16091, 16092, 16093, 16094, 16095, 16096, 16097, 16098, 16099, 16100, 
+    16101, 16102, 16103, 16104, 16105, 16106, 16107, 16108, 16109, 16110, 
+    16111, 16112, 16113, 16114, 16115, 16116, 16117, 16118, 16119, 16120, 
+    16121, 16122, 16123, 16124, 16125, 16126, 16127, 16128, 16129, 16130,
+  16101, 16102, 16103, 16104, 16105, 16106, 16107, 16108, 16109, 16110, 
+    16111, 16112, 16113, 16114, 16115, 16116, 16117, 16118, 16119, 16120, 
+    16121, 16122, 16123, 16124, 16125, 16126, 16127, 16128, 16129, 16130, 
+    16131, 16132, 16133, 16134, 16135, 16136, 16137, 16138, 16139, 16140,
+  16111, 16112, 16113, 16114, 16115, 16116, 16117, 16118, 16119, 16120, 
+    16121, 16122, 16123, 16124, 16125, 16126, 16127, 16128, 16129, 16130, 
+    16131, 16132, 16133, 16134, 16135, 16136, 16137, 16138, 16139, 16140, 
+    16141, 16142, 16143, 16144, 16145, 16146, 16147, 16148, 16149, 16150,
+  16121, 16122, 16123, 16124, 16125, 16126, 16127, 16128, 16129, 16130, 
+    16131, 16132, 16133, 16134, 16135, 16136, 16137, 16138, 16139, 16140, 
+    16141, 16142, 16143, 16144, 16145, 16146, 16147, 16148, 16149, 16150, 
+    16151, 16152, 16153, 16154, 16155, 16156, 16157, 16158, 16159, 16160,
+  16131, 16132, 16133, 16134, 16135, 16136, 16137, 16138, 16139, 16140, 
+    16141, 16142, 16143, 16144, 16145, 16146, 16147, 16148, 16149, 16150, 
+    16151, 16152, 16153, 16154, 16155, 16156, 16157, 16158, 16159, 16160, 
+    16161, 16162, 16163, 16164, 16165, 16166, 16167, 16168, 16169, 16170,
+  16141, 16142, 16143, 16144, 16145, 16146, 16147, 16148, 16149, 16150, 
+    16151, 16152, 16153, 16154, 16155, 16156, 16157, 16158, 16159, 16160, 
+    16161, 16162, 16163, 16164, 16165, 16166, 16167, 16168, 16169, 16170, 
+    16171, 16172, 16173, 16174, 16175, 16176, 16177, 16178, 16179, 16180,
+  16151, 16152, 16153, 16154, 16155, 16156, 16157, 16158, 16159, 16160, 
+    16161, 16162, 16163, 16164, 16165, 16166, 16167, 16168, 16169, 16170, 
+    16171, 16172, 16173, 16174, 16175, 16176, 16177, 16178, 16179, 16180, 
+    16181, 16182, 16183, 16184, 16185, 16186, 16187, 16188, 16189, 16190,
+  16161, 16162, 16163, 16164, 16165, 16166, 16167, 16168, 16169, 16170, 
+    16171, 16172, 16173, 16174, 16175, 16176, 16177, 16178, 16179, 16180, 
+    16181, 16182, 16183, 16184, 16185, 16186, 16187, 16188, 16189, 16190, 
+    16191, 16192, 16193, 16194, 16195, 16196, 16197, 16198, 16199, 16200,
+  16171, 16172, 16173, 16174, 16175, 16176, 16177, 16178, 16179, 16180, 
+    16181, 16182, 16183, 16184, 16185, 16186, 16187, 16188, 16189, 16190, 
+    16191, 16192, 16193, 16194, 16195, 16196, 16197, 16198, 16199, 16200, 
+    16201, 16202, 16203, 16204, 16205, 16206, 16207, 16208, 16209, 16210,
+  16181, 16182, 16183, 16184, 16185, 16186, 16187, 16188, 16189, 16190, 
+    16191, 16192, 16193, 16194, 16195, 16196, 16197, 16198, 16199, 16200, 
+    16201, 16202, 16203, 16204, 16205, 16206, 16207, 16208, 16209, 16210, 
+    16211, 16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 16220,
+  16191, 16192, 16193, 16194, 16195, 16196, 16197, 16198, 16199, 16200, 
+    16201, 16202, 16203, 16204, 16205, 16206, 16207, 16208, 16209, 16210, 
+    16211, 16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 16220, 
+    16221, 16222, 16223, 16224, 16225, 16226, 16227, 16228, 16229, 16230,
+  16201, 16202, 16203, 16204, 16205, 16206, 16207, 16208, 16209, 16210, 
+    16211, 16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 16220, 
+    16221, 16222, 16223, 16224, 16225, 16226, 16227, 16228, 16229, 16230, 
+    16231, 16232, 16233, 16234, 16235, 16236, 16237, 16238, 16239, 16240,
+  16211, 16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 16220, 
+    16221, 16222, 16223, 16224, 16225, 16226, 16227, 16228, 16229, 16230, 
+    16231, 16232, 16233, 16234, 16235, 16236, 16237, 16238, 16239, 16240, 
+    16241, 16242, 16243, 16244, 16245, 16246, 16247, 16248, 16249, 16250,
+  16221, 16222, 16223, 16224, 16225, 16226, 16227, 16228, 16229, 16230, 
+    16231, 16232, 16233, 16234, 16235, 16236, 16237, 16238, 16239, 16240, 
+    16241, 16242, 16243, 16244, 16245, 16246, 16247, 16248, 16249, 16250, 
+    16251, 16252, 16253, 16254, 16255, 16256, 16257, 16258, 16259, 16260,
+  16231, 16232, 16233, 16234, 16235, 16236, 16237, 16238, 16239, 16240, 
+    16241, 16242, 16243, 16244, 16245, 16246, 16247, 16248, 16249, 16250, 
+    16251, 16252, 16253, 16254, 16255, 16256, 16257, 16258, 16259, 16260, 
+    16261, 16262, 16263, 16264, 16265, 16266, 16267, 16268, 16269, 16270,
+  16241, 16242, 16243, 16244, 16245, 16246, 16247, 16248, 16249, 16250, 
+    16251, 16252, 16253, 16254, 16255, 16256, 16257, 16258, 16259, 16260, 
+    16261, 16262, 16263, 16264, 16265, 16266, 16267, 16268, 16269, 16270, 
+    16271, 16272, 16273, 16274, 16275, 16276, 16277, 16278, 16279, 16280,
+  16251, 16252, 16253, 16254, 16255, 16256, 16257, 16258, 16259, 16260, 
+    16261, 16262, 16263, 16264, 16265, 16266, 16267, 16268, 16269, 16270, 
+    16271, 16272, 16273, 16274, 16275, 16276, 16277, 16278, 16279, 16280, 
+    16281, 16282, 16283, 16284, 16285, 16286, 16287, 16288, 16289, 16290,
+  16261, 16262, 16263, 16264, 16265, 16266, 16267, 16268, 16269, 16270, 
+    16271, 16272, 16273, 16274, 16275, 16276, 16277, 16278, 16279, 16280, 
+    16281, 16282, 16283, 16284, 16285, 16286, 16287, 16288, 16289, 16290, 
+    16291, 16292, 16293, 16294, 16295, 16296, 16297, 16298, 16299, 16300,
+  16271, 16272, 16273, 16274, 16275, 16276, 16277, 16278, 16279, 16280, 
+    16281, 16282, 16283, 16284, 16285, 16286, 16287, 16288, 16289, 16290, 
+    16291, 16292, 16293, 16294, 16295, 16296, 16297, 16298, 16299, 16300, 
+    16301, 16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309, 16310,
+  16281, 16282, 16283, 16284, 16285, 16286, 16287, 16288, 16289, 16290, 
+    16291, 16292, 16293, 16294, 16295, 16296, 16297, 16298, 16299, 16300, 
+    16301, 16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309, 16310, 
+    16311, 16312, 16313, 16314, 16315, 16316, 16317, 16318, 16319, 16320,
+  16291, 16292, 16293, 16294, 16295, 16296, 16297, 16298, 16299, 16300, 
+    16301, 16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309, 16310, 
+    16311, 16312, 16313, 16314, 16315, 16316, 16317, 16318, 16319, 16320, 
+    16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330,
+  16301, 16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309, 16310, 
+    16311, 16312, 16313, 16314, 16315, 16316, 16317, 16318, 16319, 16320, 
+    16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 
+    16331, 16332, 16333, 16334, 16335, 16336, 16337, 16338, 16339, 16340,
+  17011, 17012, 17013, 17014, 17015, 17016, 17017, 17018, 17019, 17020, 
+    17021, 17022, 17023, 17024, 17025, 17026, 17027, 17028, 17029, 17030, 
+    17031, 17032, 17033, 17034, 17035, 17036, 17037, 17038, 17039, 17040, 
+    17041, 17042, 17043, 17044, 17045, 17046, 17047, 17048, 17049, 17050,
+  17021, 17022, 17023, 17024, 17025, 17026, 17027, 17028, 17029, 17030, 
+    17031, 17032, 17033, 17034, 17035, 17036, 17037, 17038, 17039, 17040, 
+    17041, 17042, 17043, 17044, 17045, 17046, 17047, 17048, 17049, 17050, 
+    17051, 17052, 17053, 17054, 17055, 17056, 17057, 17058, 17059, 17060,
+  17031, 17032, 17033, 17034, 17035, 17036, 17037, 17038, 17039, 17040, 
+    17041, 17042, 17043, 17044, 17045, 17046, 17047, 17048, 17049, 17050, 
+    17051, 17052, 17053, 17054, 17055, 17056, 17057, 17058, 17059, 17060, 
+    17061, 17062, 17063, 17064, 17065, 17066, 17067, 17068, 17069, 17070,
+  17041, 17042, 17043, 17044, 17045, 17046, 17047, 17048, 17049, 17050, 
+    17051, 17052, 17053, 17054, 17055, 17056, 17057, 17058, 17059, 17060, 
+    17061, 17062, 17063, 17064, 17065, 17066, 17067, 17068, 17069, 17070, 
+    17071, 17072, 17073, 17074, 17075, 17076, 17077, 17078, 17079, 17080,
+  17051, 17052, 17053, 17054, 17055, 17056, 17057, 17058, 17059, 17060, 
+    17061, 17062, 17063, 17064, 17065, 17066, 17067, 17068, 17069, 17070, 
+    17071, 17072, 17073, 17074, 17075, 17076, 17077, 17078, 17079, 17080, 
+    17081, 17082, 17083, 17084, 17085, 17086, 17087, 17088, 17089, 17090,
+  17061, 17062, 17063, 17064, 17065, 17066, 17067, 17068, 17069, 17070, 
+    17071, 17072, 17073, 17074, 17075, 17076, 17077, 17078, 17079, 17080, 
+    17081, 17082, 17083, 17084, 17085, 17086, 17087, 17088, 17089, 17090, 
+    17091, 17092, 17093, 17094, 17095, 17096, 17097, 17098, 17099, 17100,
+  17071, 17072, 17073, 17074, 17075, 17076, 17077, 17078, 17079, 17080, 
+    17081, 17082, 17083, 17084, 17085, 17086, 17087, 17088, 17089, 17090, 
+    17091, 17092, 17093, 17094, 17095, 17096, 17097, 17098, 17099, 17100, 
+    17101, 17102, 17103, 17104, 17105, 17106, 17107, 17108, 17109, 17110,
+  17081, 17082, 17083, 17084, 17085, 17086, 17087, 17088, 17089, 17090, 
+    17091, 17092, 17093, 17094, 17095, 17096, 17097, 17098, 17099, 17100, 
+    17101, 17102, 17103, 17104, 17105, 17106, 17107, 17108, 17109, 17110, 
+    17111, 17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 17120,
+  17091, 17092, 17093, 17094, 17095, 17096, 17097, 17098, 17099, 17100, 
+    17101, 17102, 17103, 17104, 17105, 17106, 17107, 17108, 17109, 17110, 
+    17111, 17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 17120, 
+    17121, 17122, 17123, 17124, 17125, 17126, 17127, 17128, 17129, 17130,
+  17101, 17102, 17103, 17104, 17105, 17106, 17107, 17108, 17109, 17110, 
+    17111, 17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 17120, 
+    17121, 17122, 17123, 17124, 17125, 17126, 17127, 17128, 17129, 17130, 
+    17131, 17132, 17133, 17134, 17135, 17136, 17137, 17138, 17139, 17140,
+  17111, 17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 17120, 
+    17121, 17122, 17123, 17124, 17125, 17126, 17127, 17128, 17129, 17130, 
+    17131, 17132, 17133, 17134, 17135, 17136, 17137, 17138, 17139, 17140, 
+    17141, 17142, 17143, 17144, 17145, 17146, 17147, 17148, 17149, 17150,
+  17121, 17122, 17123, 17124, 17125, 17126, 17127, 17128, 17129, 17130, 
+    17131, 17132, 17133, 17134, 17135, 17136, 17137, 17138, 17139, 17140, 
+    17141, 17142, 17143, 17144, 17145, 17146, 17147, 17148, 17149, 17150, 
+    17151, 17152, 17153, 17154, 17155, 17156, 17157, 17158, 17159, 17160,
+  17131, 17132, 17133, 17134, 17135, 17136, 17137, 17138, 17139, 17140, 
+    17141, 17142, 17143, 17144, 17145, 17146, 17147, 17148, 17149, 17150, 
+    17151, 17152, 17153, 17154, 17155, 17156, 17157, 17158, 17159, 17160, 
+    17161, 17162, 17163, 17164, 17165, 17166, 17167, 17168, 17169, 17170,
+  17141, 17142, 17143, 17144, 17145, 17146, 17147, 17148, 17149, 17150, 
+    17151, 17152, 17153, 17154, 17155, 17156, 17157, 17158, 17159, 17160, 
+    17161, 17162, 17163, 17164, 17165, 17166, 17167, 17168, 17169, 17170, 
+    17171, 17172, 17173, 17174, 17175, 17176, 17177, 17178, 17179, 17180,
+  17151, 17152, 17153, 17154, 17155, 17156, 17157, 17158, 17159, 17160, 
+    17161, 17162, 17163, 17164, 17165, 17166, 17167, 17168, 17169, 17170, 
+    17171, 17172, 17173, 17174, 17175, 17176, 17177, 17178, 17179, 17180, 
+    17181, 17182, 17183, 17184, 17185, 17186, 17187, 17188, 17189, 17190,
+  17161, 17162, 17163, 17164, 17165, 17166, 17167, 17168, 17169, 17170, 
+    17171, 17172, 17173, 17174, 17175, 17176, 17177, 17178, 17179, 17180, 
+    17181, 17182, 17183, 17184, 17185, 17186, 17187, 17188, 17189, 17190, 
+    17191, 17192, 17193, 17194, 17195, 17196, 17197, 17198, 17199, 17200,
+  17171, 17172, 17173, 17174, 17175, 17176, 17177, 17178, 17179, 17180, 
+    17181, 17182, 17183, 17184, 17185, 17186, 17187, 17188, 17189, 17190, 
+    17191, 17192, 17193, 17194, 17195, 17196, 17197, 17198, 17199, 17200, 
+    17201, 17202, 17203, 17204, 17205, 17206, 17207, 17208, 17209, 17210,
+  17181, 17182, 17183, 17184, 17185, 17186, 17187, 17188, 17189, 17190, 
+    17191, 17192, 17193, 17194, 17195, 17196, 17197, 17198, 17199, 17200, 
+    17201, 17202, 17203, 17204, 17205, 17206, 17207, 17208, 17209, 17210, 
+    17211, 17212, 17213, 17214, 17215, 17216, 17217, 17218, 17219, 17220,
+  17191, 17192, 17193, 17194, 17195, 17196, 17197, 17198, 17199, 17200, 
+    17201, 17202, 17203, 17204, 17205, 17206, 17207, 17208, 17209, 17210, 
+    17211, 17212, 17213, 17214, 17215, 17216, 17217, 17218, 17219, 17220, 
+    17221, 17222, 17223, 17224, 17225, 17226, 17227, 17228, 17229, 17230,
+  17201, 17202, 17203, 17204, 17205, 17206, 17207, 17208, 17209, 17210, 
+    17211, 17212, 17213, 17214, 17215, 17216, 17217, 17218, 17219, 17220, 
+    17221, 17222, 17223, 17224, 17225, 17226, 17227, 17228, 17229, 17230, 
+    17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17240,
+  17211, 17212, 17213, 17214, 17215, 17216, 17217, 17218, 17219, 17220, 
+    17221, 17222, 17223, 17224, 17225, 17226, 17227, 17228, 17229, 17230, 
+    17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17240, 
+    17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250,
+  17221, 17222, 17223, 17224, 17225, 17226, 17227, 17228, 17229, 17230, 
+    17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17240, 
+    17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250, 
+    17251, 17252, 17253, 17254, 17255, 17256, 17257, 17258, 17259, 17260,
+  17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17240, 
+    17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250, 
+    17251, 17252, 17253, 17254, 17255, 17256, 17257, 17258, 17259, 17260, 
+    17261, 17262, 17263, 17264, 17265, 17266, 17267, 17268, 17269, 17270,
+  17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250, 
+    17251, 17252, 17253, 17254, 17255, 17256, 17257, 17258, 17259, 17260, 
+    17261, 17262, 17263, 17264, 17265, 17266, 17267, 17268, 17269, 17270, 
+    17271, 17272, 17273, 17274, 17275, 17276, 17277, 17278, 17279, 17280,
+  17251, 17252, 17253, 17254, 17255, 17256, 17257, 17258, 17259, 17260, 
+    17261, 17262, 17263, 17264, 17265, 17266, 17267, 17268, 17269, 17270, 
+    17271, 17272, 17273, 17274, 17275, 17276, 17277, 17278, 17279, 17280, 
+    17281, 17282, 17283, 17284, 17285, 17286, 17287, 17288, 17289, 17290,
+  17261, 17262, 17263, 17264, 17265, 17266, 17267, 17268, 17269, 17270, 
+    17271, 17272, 17273, 17274, 17275, 17276, 17277, 17278, 17279, 17280, 
+    17281, 17282, 17283, 17284, 17285, 17286, 17287, 17288, 17289, 17290, 
+    17291, 17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 17300,
+  17271, 17272, 17273, 17274, 17275, 17276, 17277, 17278, 17279, 17280, 
+    17281, 17282, 17283, 17284, 17285, 17286, 17287, 17288, 17289, 17290, 
+    17291, 17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 17300, 
+    17301, 17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17310,
+  17281, 17282, 17283, 17284, 17285, 17286, 17287, 17288, 17289, 17290, 
+    17291, 17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 17300, 
+    17301, 17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17310, 
+    17311, 17312, 17313, 17314, 17315, 17316, 17317, 17318, 17319, 17320,
+  17291, 17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 17300, 
+    17301, 17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17310, 
+    17311, 17312, 17313, 17314, 17315, 17316, 17317, 17318, 17319, 17320, 
+    17321, 17322, 17323, 17324, 17325, 17326, 17327, 17328, 17329, 17330,
+  17301, 17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17310, 
+    17311, 17312, 17313, 17314, 17315, 17316, 17317, 17318, 17319, 17320, 
+    17321, 17322, 17323, 17324, 17325, 17326, 17327, 17328, 17329, 17330, 
+    17331, 17332, 17333, 17334, 17335, 17336, 17337, 17338, 17339, 17340,
+  18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020, 
+    18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 
+    18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 
+    18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050,
+  18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 
+    18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 
+    18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 
+    18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060,
+  18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 
+    18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 
+    18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 
+    18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070,
+  18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 
+    18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 
+    18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 
+    18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080,
+  18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 
+    18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 
+    18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 
+    18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090,
+  18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 
+    18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 
+    18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 
+    18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100,
+  18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 
+    18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 
+    18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 
+    18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110,
+  18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 
+    18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 
+    18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 
+    18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120,
+  18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 
+    18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 
+    18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 
+    18121, 18122, 18123, 18124, 18125, 18126, 18127, 18128, 18129, 18130,
+  18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 
+    18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 
+    18121, 18122, 18123, 18124, 18125, 18126, 18127, 18128, 18129, 18130, 
+    18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140,
+  18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 
+    18121, 18122, 18123, 18124, 18125, 18126, 18127, 18128, 18129, 18130, 
+    18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140, 
+    18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150,
+  18121, 18122, 18123, 18124, 18125, 18126, 18127, 18128, 18129, 18130, 
+    18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140, 
+    18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 
+    18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160,
+  18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140, 
+    18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 
+    18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 
+    18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170,
+  18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 
+    18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 
+    18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 
+    18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180,
+  18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 
+    18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 
+    18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 
+    18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190,
+  18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 
+    18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 
+    18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 
+    18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200,
+  18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 
+    18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 
+    18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 
+    18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210,
+  18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 
+    18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 
+    18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 
+    18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220,
+  18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 
+    18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 
+    18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 
+    18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230,
+  18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 
+    18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 
+    18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 
+    18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240,
+  18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 
+    18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 
+    18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 
+    18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250,
+  18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 
+    18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 
+    18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 
+    18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260,
+  18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 
+    18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 
+    18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 
+    18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270,
+  18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 
+    18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 
+    18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 
+    18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280,
+  18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 
+    18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 
+    18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 
+    18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290,
+  18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 
+    18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 
+    18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 
+    18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300,
+  18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 
+    18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 
+    18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 
+    18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310,
+  18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 
+    18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 
+    18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 
+    18311, 18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320,
+  18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 
+    18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 
+    18311, 18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320, 
+    18321, 18322, 18323, 18324, 18325, 18326, 18327, 18328, 18329, 18330,
+  18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 
+    18311, 18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320, 
+    18321, 18322, 18323, 18324, 18325, 18326, 18327, 18328, 18329, 18330, 
+    18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 18340,
+  19011, 19012, 19013, 19014, 19015, 19016, 19017, 19018, 19019, 19020, 
+    19021, 19022, 19023, 19024, 19025, 19026, 19027, 19028, 19029, 19030, 
+    19031, 19032, 19033, 19034, 19035, 19036, 19037, 19038, 19039, 19040, 
+    19041, 19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050,
+  19021, 19022, 19023, 19024, 19025, 19026, 19027, 19028, 19029, 19030, 
+    19031, 19032, 19033, 19034, 19035, 19036, 19037, 19038, 19039, 19040, 
+    19041, 19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050, 
+    19051, 19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059, 19060,
+  19031, 19032, 19033, 19034, 19035, 19036, 19037, 19038, 19039, 19040, 
+    19041, 19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050, 
+    19051, 19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059, 19060, 
+    19061, 19062, 19063, 19064, 19065, 19066, 19067, 19068, 19069, 19070,
+  19041, 19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050, 
+    19051, 19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059, 19060, 
+    19061, 19062, 19063, 19064, 19065, 19066, 19067, 19068, 19069, 19070, 
+    19071, 19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080,
+  19051, 19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059, 19060, 
+    19061, 19062, 19063, 19064, 19065, 19066, 19067, 19068, 19069, 19070, 
+    19071, 19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080, 
+    19081, 19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090,
+  19061, 19062, 19063, 19064, 19065, 19066, 19067, 19068, 19069, 19070, 
+    19071, 19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080, 
+    19081, 19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090, 
+    19091, 19092, 19093, 19094, 19095, 19096, 19097, 19098, 19099, 19100,
+  19071, 19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080, 
+    19081, 19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090, 
+    19091, 19092, 19093, 19094, 19095, 19096, 19097, 19098, 19099, 19100, 
+    19101, 19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110,
+  19081, 19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090, 
+    19091, 19092, 19093, 19094, 19095, 19096, 19097, 19098, 19099, 19100, 
+    19101, 19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110, 
+    19111, 19112, 19113, 19114, 19115, 19116, 19117, 19118, 19119, 19120,
+  19091, 19092, 19093, 19094, 19095, 19096, 19097, 19098, 19099, 19100, 
+    19101, 19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110, 
+    19111, 19112, 19113, 19114, 19115, 19116, 19117, 19118, 19119, 19120, 
+    19121, 19122, 19123, 19124, 19125, 19126, 19127, 19128, 19129, 19130,
+  19101, 19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110, 
+    19111, 19112, 19113, 19114, 19115, 19116, 19117, 19118, 19119, 19120, 
+    19121, 19122, 19123, 19124, 19125, 19126, 19127, 19128, 19129, 19130, 
+    19131, 19132, 19133, 19134, 19135, 19136, 19137, 19138, 19139, 19140,
+  19111, 19112, 19113, 19114, 19115, 19116, 19117, 19118, 19119, 19120, 
+    19121, 19122, 19123, 19124, 19125, 19126, 19127, 19128, 19129, 19130, 
+    19131, 19132, 19133, 19134, 19135, 19136, 19137, 19138, 19139, 19140, 
+    19141, 19142, 19143, 19144, 19145, 19146, 19147, 19148, 19149, 19150,
+  19121, 19122, 19123, 19124, 19125, 19126, 19127, 19128, 19129, 19130, 
+    19131, 19132, 19133, 19134, 19135, 19136, 19137, 19138, 19139, 19140, 
+    19141, 19142, 19143, 19144, 19145, 19146, 19147, 19148, 19149, 19150, 
+    19151, 19152, 19153, 19154, 19155, 19156, 19157, 19158, 19159, 19160,
+  19131, 19132, 19133, 19134, 19135, 19136, 19137, 19138, 19139, 19140, 
+    19141, 19142, 19143, 19144, 19145, 19146, 19147, 19148, 19149, 19150, 
+    19151, 19152, 19153, 19154, 19155, 19156, 19157, 19158, 19159, 19160, 
+    19161, 19162, 19163, 19164, 19165, 19166, 19167, 19168, 19169, 19170,
+  19141, 19142, 19143, 19144, 19145, 19146, 19147, 19148, 19149, 19150, 
+    19151, 19152, 19153, 19154, 19155, 19156, 19157, 19158, 19159, 19160, 
+    19161, 19162, 19163, 19164, 19165, 19166, 19167, 19168, 19169, 19170, 
+    19171, 19172, 19173, 19174, 19175, 19176, 19177, 19178, 19179, 19180,
+  19151, 19152, 19153, 19154, 19155, 19156, 19157, 19158, 19159, 19160, 
+    19161, 19162, 19163, 19164, 19165, 19166, 19167, 19168, 19169, 19170, 
+    19171, 19172, 19173, 19174, 19175, 19176, 19177, 19178, 19179, 19180, 
+    19181, 19182, 19183, 19184, 19185, 19186, 19187, 19188, 19189, 19190,
+  19161, 19162, 19163, 19164, 19165, 19166, 19167, 19168, 19169, 19170, 
+    19171, 19172, 19173, 19174, 19175, 19176, 19177, 19178, 19179, 19180, 
+    19181, 19182, 19183, 19184, 19185, 19186, 19187, 19188, 19189, 19190, 
+    19191, 19192, 19193, 19194, 19195, 19196, 19197, 19198, 19199, 19200,
+  19171, 19172, 19173, 19174, 19175, 19176, 19177, 19178, 19179, 19180, 
+    19181, 19182, 19183, 19184, 19185, 19186, 19187, 19188, 19189, 19190, 
+    19191, 19192, 19193, 19194, 19195, 19196, 19197, 19198, 19199, 19200, 
+    19201, 19202, 19203, 19204, 19205, 19206, 19207, 19208, 19209, 19210,
+  19181, 19182, 19183, 19184, 19185, 19186, 19187, 19188, 19189, 19190, 
+    19191, 19192, 19193, 19194, 19195, 19196, 19197, 19198, 19199, 19200, 
+    19201, 19202, 19203, 19204, 19205, 19206, 19207, 19208, 19209, 19210, 
+    19211, 19212, 19213, 19214, 19215, 19216, 19217, 19218, 19219, 19220,
+  19191, 19192, 19193, 19194, 19195, 19196, 19197, 19198, 19199, 19200, 
+    19201, 19202, 19203, 19204, 19205, 19206, 19207, 19208, 19209, 19210, 
+    19211, 19212, 19213, 19214, 19215, 19216, 19217, 19218, 19219, 19220, 
+    19221, 19222, 19223, 19224, 19225, 19226, 19227, 19228, 19229, 19230,
+  19201, 19202, 19203, 19204, 19205, 19206, 19207, 19208, 19209, 19210, 
+    19211, 19212, 19213, 19214, 19215, 19216, 19217, 19218, 19219, 19220, 
+    19221, 19222, 19223, 19224, 19225, 19226, 19227, 19228, 19229, 19230, 
+    19231, 19232, 19233, 19234, 19235, 19236, 19237, 19238, 19239, 19240,
+  19211, 19212, 19213, 19214, 19215, 19216, 19217, 19218, 19219, 19220, 
+    19221, 19222, 19223, 19224, 19225, 19226, 19227, 19228, 19229, 19230, 
+    19231, 19232, 19233, 19234, 19235, 19236, 19237, 19238, 19239, 19240, 
+    19241, 19242, 19243, 19244, 19245, 19246, 19247, 19248, 19249, 19250,
+  19221, 19222, 19223, 19224, 19225, 19226, 19227, 19228, 19229, 19230, 
+    19231, 19232, 19233, 19234, 19235, 19236, 19237, 19238, 19239, 19240, 
+    19241, 19242, 19243, 19244, 19245, 19246, 19247, 19248, 19249, 19250, 
+    19251, 19252, 19253, 19254, 19255, 19256, 19257, 19258, 19259, 19260,
+  19231, 19232, 19233, 19234, 19235, 19236, 19237, 19238, 19239, 19240, 
+    19241, 19242, 19243, 19244, 19245, 19246, 19247, 19248, 19249, 19250, 
+    19251, 19252, 19253, 19254, 19255, 19256, 19257, 19258, 19259, 19260, 
+    19261, 19262, 19263, 19264, 19265, 19266, 19267, 19268, 19269, 19270,
+  19241, 19242, 19243, 19244, 19245, 19246, 19247, 19248, 19249, 19250, 
+    19251, 19252, 19253, 19254, 19255, 19256, 19257, 19258, 19259, 19260, 
+    19261, 19262, 19263, 19264, 19265, 19266, 19267, 19268, 19269, 19270, 
+    19271, 19272, 19273, 19274, 19275, 19276, 19277, 19278, 19279, 19280,
+  19251, 19252, 19253, 19254, 19255, 19256, 19257, 19258, 19259, 19260, 
+    19261, 19262, 19263, 19264, 19265, 19266, 19267, 19268, 19269, 19270, 
+    19271, 19272, 19273, 19274, 19275, 19276, 19277, 19278, 19279, 19280, 
+    19281, 19282, 19283, 19284, 19285, 19286, 19287, 19288, 19289, 19290,
+  19261, 19262, 19263, 19264, 19265, 19266, 19267, 19268, 19269, 19270, 
+    19271, 19272, 19273, 19274, 19275, 19276, 19277, 19278, 19279, 19280, 
+    19281, 19282, 19283, 19284, 19285, 19286, 19287, 19288, 19289, 19290, 
+    19291, 19292, 19293, 19294, 19295, 19296, 19297, 19298, 19299, 19300,
+  19271, 19272, 19273, 19274, 19275, 19276, 19277, 19278, 19279, 19280, 
+    19281, 19282, 19283, 19284, 19285, 19286, 19287, 19288, 19289, 19290, 
+    19291, 19292, 19293, 19294, 19295, 19296, 19297, 19298, 19299, 19300, 
+    19301, 19302, 19303, 19304, 19305, 19306, 19307, 19308, 19309, 19310,
+  19281, 19282, 19283, 19284, 19285, 19286, 19287, 19288, 19289, 19290, 
+    19291, 19292, 19293, 19294, 19295, 19296, 19297, 19298, 19299, 19300, 
+    19301, 19302, 19303, 19304, 19305, 19306, 19307, 19308, 19309, 19310, 
+    19311, 19312, 19313, 19314, 19315, 19316, 19317, 19318, 19319, 19320,
+  19291, 19292, 19293, 19294, 19295, 19296, 19297, 19298, 19299, 19300, 
+    19301, 19302, 19303, 19304, 19305, 19306, 19307, 19308, 19309, 19310, 
+    19311, 19312, 19313, 19314, 19315, 19316, 19317, 19318, 19319, 19320, 
+    19321, 19322, 19323, 19324, 19325, 19326, 19327, 19328, 19329, 19330,
+  19301, 19302, 19303, 19304, 19305, 19306, 19307, 19308, 19309, 19310, 
+    19311, 19312, 19313, 19314, 19315, 19316, 19317, 19318, 19319, 19320, 
+    19321, 19322, 19323, 19324, 19325, 19326, 19327, 19328, 19329, 19330, 
+    19331, 19332, 19333, 19334, 19335, 19336, 19337, 19338, 19339, 19340,
+  20011, 20012, 20013, 20014, 20015, 20016, 20017, 20018, 20019, 20020, 
+    20021, 20022, 20023, 20024, 20025, 20026, 20027, 20028, 20029, 20030, 
+    20031, 20032, 20033, 20034, 20035, 20036, 20037, 20038, 20039, 20040, 
+    20041, 20042, 20043, 20044, 20045, 20046, 20047, 20048, 20049, 20050,
+  20021, 20022, 20023, 20024, 20025, 20026, 20027, 20028, 20029, 20030, 
+    20031, 20032, 20033, 20034, 20035, 20036, 20037, 20038, 20039, 20040, 
+    20041, 20042, 20043, 20044, 20045, 20046, 20047, 20048, 20049, 20050, 
+    20051, 20052, 20053, 20054, 20055, 20056, 20057, 20058, 20059, 20060,
+  20031, 20032, 20033, 20034, 20035, 20036, 20037, 20038, 20039, 20040, 
+    20041, 20042, 20043, 20044, 20045, 20046, 20047, 20048, 20049, 20050, 
+    20051, 20052, 20053, 20054, 20055, 20056, 20057, 20058, 20059, 20060, 
+    20061, 20062, 20063, 20064, 20065, 20066, 20067, 20068, 20069, 20070,
+  20041, 20042, 20043, 20044, 20045, 20046, 20047, 20048, 20049, 20050, 
+    20051, 20052, 20053, 20054, 20055, 20056, 20057, 20058, 20059, 20060, 
+    20061, 20062, 20063, 20064, 20065, 20066, 20067, 20068, 20069, 20070, 
+    20071, 20072, 20073, 20074, 20075, 20076, 20077, 20078, 20079, 20080,
+  20051, 20052, 20053, 20054, 20055, 20056, 20057, 20058, 20059, 20060, 
+    20061, 20062, 20063, 20064, 20065, 20066, 20067, 20068, 20069, 20070, 
+    20071, 20072, 20073, 20074, 20075, 20076, 20077, 20078, 20079, 20080, 
+    20081, 20082, 20083, 20084, 20085, 20086, 20087, 20088, 20089, 20090,
+  20061, 20062, 20063, 20064, 20065, 20066, 20067, 20068, 20069, 20070, 
+    20071, 20072, 20073, 20074, 20075, 20076, 20077, 20078, 20079, 20080, 
+    20081, 20082, 20083, 20084, 20085, 20086, 20087, 20088, 20089, 20090, 
+    20091, 20092, 20093, 20094, 20095, 20096, 20097, 20098, 20099, 20100,
+  20071, 20072, 20073, 20074, 20075, 20076, 20077, 20078, 20079, 20080, 
+    20081, 20082, 20083, 20084, 20085, 20086, 20087, 20088, 20089, 20090, 
+    20091, 20092, 20093, 20094, 20095, 20096, 20097, 20098, 20099, 20100, 
+    20101, 20102, 20103, 20104, 20105, 20106, 20107, 20108, 20109, 20110,
+  20081, 20082, 20083, 20084, 20085, 20086, 20087, 20088, 20089, 20090, 
+    20091, 20092, 20093, 20094, 20095, 20096, 20097, 20098, 20099, 20100, 
+    20101, 20102, 20103, 20104, 20105, 20106, 20107, 20108, 20109, 20110, 
+    20111, 20112, 20113, 20114, 20115, 20116, 20117, 20118, 20119, 20120,
+  20091, 20092, 20093, 20094, 20095, 20096, 20097, 20098, 20099, 20100, 
+    20101, 20102, 20103, 20104, 20105, 20106, 20107, 20108, 20109, 20110, 
+    20111, 20112, 20113, 20114, 20115, 20116, 20117, 20118, 20119, 20120, 
+    20121, 20122, 20123, 20124, 20125, 20126, 20127, 20128, 20129, 20130,
+  20101, 20102, 20103, 20104, 20105, 20106, 20107, 20108, 20109, 20110, 
+    20111, 20112, 20113, 20114, 20115, 20116, 20117, 20118, 20119, 20120, 
+    20121, 20122, 20123, 20124, 20125, 20126, 20127, 20128, 20129, 20130, 
+    20131, 20132, 20133, 20134, 20135, 20136, 20137, 20138, 20139, 20140,
+  20111, 20112, 20113, 20114, 20115, 20116, 20117, 20118, 20119, 20120, 
+    20121, 20122, 20123, 20124, 20125, 20126, 20127, 20128, 20129, 20130, 
+    20131, 20132, 20133, 20134, 20135, 20136, 20137, 20138, 20139, 20140, 
+    20141, 20142, 20143, 20144, 20145, 20146, 20147, 20148, 20149, 20150,
+  20121, 20122, 20123, 20124, 20125, 20126, 20127, 20128, 20129, 20130, 
+    20131, 20132, 20133, 20134, 20135, 20136, 20137, 20138, 20139, 20140, 
+    20141, 20142, 20143, 20144, 20145, 20146, 20147, 20148, 20149, 20150, 
+    20151, 20152, 20153, 20154, 20155, 20156, 20157, 20158, 20159, 20160,
+  20131, 20132, 20133, 20134, 20135, 20136, 20137, 20138, 20139, 20140, 
+    20141, 20142, 20143, 20144, 20145, 20146, 20147, 20148, 20149, 20150, 
+    20151, 20152, 20153, 20154, 20155, 20156, 20157, 20158, 20159, 20160, 
+    20161, 20162, 20163, 20164, 20165, 20166, 20167, 20168, 20169, 20170,
+  20141, 20142, 20143, 20144, 20145, 20146, 20147, 20148, 20149, 20150, 
+    20151, 20152, 20153, 20154, 20155, 20156, 20157, 20158, 20159, 20160, 
+    20161, 20162, 20163, 20164, 20165, 20166, 20167, 20168, 20169, 20170, 
+    20171, 20172, 20173, 20174, 20175, 20176, 20177, 20178, 20179, 20180,
+  20151, 20152, 20153, 20154, 20155, 20156, 20157, 20158, 20159, 20160, 
+    20161, 20162, 20163, 20164, 20165, 20166, 20167, 20168, 20169, 20170, 
+    20171, 20172, 20173, 20174, 20175, 20176, 20177, 20178, 20179, 20180, 
+    20181, 20182, 20183, 20184, 20185, 20186, 20187, 20188, 20189, 20190,
+  20161, 20162, 20163, 20164, 20165, 20166, 20167, 20168, 20169, 20170, 
+    20171, 20172, 20173, 20174, 20175, 20176, 20177, 20178, 20179, 20180, 
+    20181, 20182, 20183, 20184, 20185, 20186, 20187, 20188, 20189, 20190, 
+    20191, 20192, 20193, 20194, 20195, 20196, 20197, 20198, 20199, 20200,
+  20171, 20172, 20173, 20174, 20175, 20176, 20177, 20178, 20179, 20180, 
+    20181, 20182, 20183, 20184, 20185, 20186, 20187, 20188, 20189, 20190, 
+    20191, 20192, 20193, 20194, 20195, 20196, 20197, 20198, 20199, 20200, 
+    20201, 20202, 20203, 20204, 20205, 20206, 20207, 20208, 20209, 20210,
+  20181, 20182, 20183, 20184, 20185, 20186, 20187, 20188, 20189, 20190, 
+    20191, 20192, 20193, 20194, 20195, 20196, 20197, 20198, 20199, 20200, 
+    20201, 20202, 20203, 20204, 20205, 20206, 20207, 20208, 20209, 20210, 
+    20211, 20212, 20213, 20214, 20215, 20216, 20217, 20218, 20219, 20220,
+  20191, 20192, 20193, 20194, 20195, 20196, 20197, 20198, 20199, 20200, 
+    20201, 20202, 20203, 20204, 20205, 20206, 20207, 20208, 20209, 20210, 
+    20211, 20212, 20213, 20214, 20215, 20216, 20217, 20218, 20219, 20220, 
+    20221, 20222, 20223, 20224, 20225, 20226, 20227, 20228, 20229, 20230,
+  20201, 20202, 20203, 20204, 20205, 20206, 20207, 20208, 20209, 20210, 
+    20211, 20212, 20213, 20214, 20215, 20216, 20217, 20218, 20219, 20220, 
+    20221, 20222, 20223, 20224, 20225, 20226, 20227, 20228, 20229, 20230, 
+    20231, 20232, 20233, 20234, 20235, 20236, 20237, 20238, 20239, 20240,
+  20211, 20212, 20213, 20214, 20215, 20216, 20217, 20218, 20219, 20220, 
+    20221, 20222, 20223, 20224, 20225, 20226, 20227, 20228, 20229, 20230, 
+    20231, 20232, 20233, 20234, 20235, 20236, 20237, 20238, 20239, 20240, 
+    20241, 20242, 20243, 20244, 20245, 20246, 20247, 20248, 20249, 20250,
+  20221, 20222, 20223, 20224, 20225, 20226, 20227, 20228, 20229, 20230, 
+    20231, 20232, 20233, 20234, 20235, 20236, 20237, 20238, 20239, 20240, 
+    20241, 20242, 20243, 20244, 20245, 20246, 20247, 20248, 20249, 20250, 
+    20251, 20252, 20253, 20254, 20255, 20256, 20257, 20258, 20259, 20260,
+  20231, 20232, 20233, 20234, 20235, 20236, 20237, 20238, 20239, 20240, 
+    20241, 20242, 20243, 20244, 20245, 20246, 20247, 20248, 20249, 20250, 
+    20251, 20252, 20253, 20254, 20255, 20256, 20257, 20258, 20259, 20260, 
+    20261, 20262, 20263, 20264, 20265, 20266, 20267, 20268, 20269, 20270,
+  20241, 20242, 20243, 20244, 20245, 20246, 20247, 20248, 20249, 20250, 
+    20251, 20252, 20253, 20254, 20255, 20256, 20257, 20258, 20259, 20260, 
+    20261, 20262, 20263, 20264, 20265, 20266, 20267, 20268, 20269, 20270, 
+    20271, 20272, 20273, 20274, 20275, 20276, 20277, 20278, 20279, 20280,
+  20251, 20252, 20253, 20254, 20255, 20256, 20257, 20258, 20259, 20260, 
+    20261, 20262, 20263, 20264, 20265, 20266, 20267, 20268, 20269, 20270, 
+    20271, 20272, 20273, 20274, 20275, 20276, 20277, 20278, 20279, 20280, 
+    20281, 20282, 20283, 20284, 20285, 20286, 20287, 20288, 20289, 20290,
+  20261, 20262, 20263, 20264, 20265, 20266, 20267, 20268, 20269, 20270, 
+    20271, 20272, 20273, 20274, 20275, 20276, 20277, 20278, 20279, 20280, 
+    20281, 20282, 20283, 20284, 20285, 20286, 20287, 20288, 20289, 20290, 
+    20291, 20292, 20293, 20294, 20295, 20296, 20297, 20298, 20299, 20300,
+  20271, 20272, 20273, 20274, 20275, 20276, 20277, 20278, 20279, 20280, 
+    20281, 20282, 20283, 20284, 20285, 20286, 20287, 20288, 20289, 20290, 
+    20291, 20292, 20293, 20294, 20295, 20296, 20297, 20298, 20299, 20300, 
+    20301, 20302, 20303, 20304, 20305, 20306, 20307, 20308, 20309, 20310,
+  20281, 20282, 20283, 20284, 20285, 20286, 20287, 20288, 20289, 20290, 
+    20291, 20292, 20293, 20294, 20295, 20296, 20297, 20298, 20299, 20300, 
+    20301, 20302, 20303, 20304, 20305, 20306, 20307, 20308, 20309, 20310, 
+    20311, 20312, 20313, 20314, 20315, 20316, 20317, 20318, 20319, 20320,
+  20291, 20292, 20293, 20294, 20295, 20296, 20297, 20298, 20299, 20300, 
+    20301, 20302, 20303, 20304, 20305, 20306, 20307, 20308, 20309, 20310, 
+    20311, 20312, 20313, 20314, 20315, 20316, 20317, 20318, 20319, 20320, 
+    20321, 20322, 20323, 20324, 20325, 20326, 20327, 20328, 20329, 20330,
+  20301, 20302, 20303, 20304, 20305, 20306, 20307, 20308, 20309, 20310, 
+    20311, 20312, 20313, 20314, 20315, 20316, 20317, 20318, 20319, 20320, 
+    20321, 20322, 20323, 20324, 20325, 20326, 20327, 20328, 20329, 20330, 
+    20331, 20332, 20333, 20334, 20335, 20336, 20337, 20338, 20339, 20340 ;
+}
diff --git a/bench/bn_strides_revs_perms.jnl b/bench/bn_strides_revs_perms.jnl
new file mode 100644
index 0000000..d80f3e5
--- /dev/null
+++ b/bench/bn_strides_revs_perms.jnl
@@ -0,0 +1,272 @@
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+
+canc data/all
+cancel mode diagnostic
+
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+canc data/all
+
+use/order=yx bn_strides
+list bigvar
+canc data/all
+
+use/order=zyx bn_strides
+list bigvar
+canc data/all
+
+use/order=zxy bn_strides
+list bigvar
+canc data/all
+
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=yx bn_strides
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=tyx bn_strides
+show grid xytvar
+list xytvar
+canc data/all
+
+use/order=txy bn_strides
+show grid xytvar
+list xytvar
+canc data/all
+
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+list/k=1:2 xytvar
+canc data/all
+
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+list xytvar
+canc data/all
+
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+show grid var
+canc data/all
+
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+
+SHOW DATA
+
+! basic strides
+LIST VAR[i=2:4:2]
+
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+list a		! from cache ...
+
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+load var
+LIST VAR[i=2:4:2]
+LIST VAR[i=2:4:2,j=1:3:2]
+CANC MEM/ALL
+
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+cancel axis/modulo XAX1_4
+
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+LIST VAR[i=2:6:2,j=1:5:2]
+
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+list/j=1/k=1/l=1 a[i=3:5]
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+cancel mem/all
+
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+list/order=x/j=1/k=1/l=1 a
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+load/k=1/l=1 UNEVENVAR
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+CANC MEM/ALL
+
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+cancel axis/modulo XUNEVEN
+
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+
+
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+
+set region/i=3:6/j=2:4/k=1:2/l=1
+
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+list bigvar[j=2:6:2]
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+canc data/all
+
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+list bigvar[j=2:6:2]
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+canc data/all
+
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+list bigvar[j=2:6:2]
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+canc data/all
+
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+list xytvar[i=1:7:2]
+list xytvar[j=2:6:2]
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+canc data/all
+
+use/order=yx bn_strides
+show grid xytvar
+list xytvar[i=1:7:2]
+list xytvar[j=2:6:2]
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+canc data/all
+
+use/order=tyx bn_strides
+show grid xytvar
+list xytvar[i=1:7:2]
+list xytvar[j=2:6:2]
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+canc data/all
+
+use/order=txy bn_strides
+show grid xytvar
+list xytvar[i=1:7:2]
+list xytvar[j=2:6:2]
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+canc data/all
+
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+list/k=1:2 xytvar[i=1:7:2]
+list/k=1:2 xytvar[j=2:6:2]
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+canc data/all
+
+
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+
+cancel region; set region/l=1
+
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
diff --git a/bench/bn_string_ngd_nbd.jnl b/bench/bn_string_ngd_nbd.jnl
new file mode 100644
index 0000000..e763d9d
--- /dev/null
+++ b/bench/bn_string_ngd_nbd.jnl
@@ -0,0 +1,76 @@
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+list b[i=@nbd]
+
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+list bv[i=@ngd]
+list av[j=@ngd]
+list bv[j=@ngd]
+list av[i=@ngd,j=@ngd]
+list bv[i=@ngd,j=@ngd]
+
+
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+
+let av = reshape (a,v)
+list av[i=@nbd]
+list bv[i=@nbd]
+list av[k=@nbd]
+list bv[k=@nbd]
+list av[i=@nbd,k=@nbd]
+list bv[i=@nbd,k=@nbd]
+
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+
+let av = reshape (a,v)
+list av[i=@ngd]
+list bv[i=@ngd]
+list av[L=@ngd]
+list bv[L=@ngd]
+list av[i=@ngd,L=@ngd]
+list bv[i=@ngd,L=@ngd]
+
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+
+let av = reshape (a,v)
+list av[i=@nbd]
+list bv[i=@nbd]
+list av[j=@nbd]
+list bv[j=@nbd]
+list av[k=@ngd]
+list bv[k=@ngd]
+list av[L=@ngd]
+list bv[L=@ngd]
+
+list av[i=@nbd,j=@nbd,k=@nbd]
+list bv[i=@nbd,j=@nbd,k=@nbd]
+
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
diff --git a/bench/bn_strings.jnl b/bench/bn_strings.jnl
new file mode 100644
index 0000000..c150b7d
--- /dev/null
+++ b/bench/bn_strings.jnl
@@ -0,0 +1,193 @@
+! bn_strings.jnl
+
+! 7/01 - test string syntax and behaviors
+
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+
+sh mode stupid
+cancel mode stupid  ! for testing in double precision 
+
+
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+
+cancel data/all
+
+let a = "testa.v5d"
+list a
+
+let b = "goodbye"
+list a,b
+
+let a = {"hello","goodbye", "wave to me"}
+list a
+list a[i=2:3]
+list/order=x a[i=2:3]
+
+let e = {,"string1",, "string2"}
+list e
+
+list {"string","s2","very long string"},5
+
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+
+* mixed single and double quotes
+list/nohead {",a",',b'}
+list/nohead {'"'}, {"'"}
+
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+stat d
+load d
+
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+list a
+canc data test_string
+
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+list b
+canc data test_string
+
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string 
+list/nohead a
+list/nohead b
+
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+list d
+
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+sh grid
+list/nohead  ysequence({"a","b","c","d","e"})
+sh grid
+list/nohead  zsequence({"a","b","c","d","e"})
+sh grid
+list/nohead  tsequence({"a","b","c","d","e"})
+sh grid
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+
+list/nohead  {"a",,"b"}
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+list/i=2:3 a
+list  reshape(a,I[I=1:2]+J[J=1:3])
+list  reshape(a,I[I=1:3]+J[J=1:3])
+list reshape(a,I[I=1:1]+J[J=1:3])
+
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+list/nohead "b" LT {"a","b","c"}
+list/nohead "b" LE {"a","b","c"}
+list/nohead "b" EQ {"a","b","c"}
+list/nohead "b" GE {"a","b","c"}
+list/nohead "b" GT {"a","b","c"}
+
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+list/nohead "b" * {"a","b"}
+list/nohead "b" / {"a","b"}
+list/nohead "b" ^ {"a","b"}
+list/nohead {"a","b"} + 1
+list/nohead 1 + {"a","b"}
+list/nohead 1 - {"a","b"}
+list/nohead SIN({"a","b","c"})
+list/nohead MAX("a",{"a","b","c"})
+list/nohead MAX(1,{"a","b","c"})
+
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+list a[i=@shf:-1]
+list a[i=@ave]
+list a[i=@sbx]
+list a[i=@rsum]
+
+set mode/last stupid
diff --git a/bench/bn_subspan_modulo.jnl b/bench/bn_subspan_modulo.jnl
new file mode 100644
index 0000000..472afa4
--- /dev/null
+++ b/bench/bn_subspan_modulo.jnl
@@ -0,0 +1,98 @@
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+
+
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+
+canc var/all
+use test_subspan_modulo.nc
+
+go bn_subspan_modulo.sub2 vreg v2d_reg
+SAY **********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+
+
diff --git a/bench/bn_subspan_modulo.sub1 b/bench/bn_subspan_modulo.sub1
new file mode 100644
index 0000000..7dc6882
--- /dev/null
+++ b/bench/bn_subspan_modulo.sub1
@@ -0,0 +1,25 @@
+\canc mode verify
+! bn_subspan_modulo.sub1
+! *sh* 11/2002
+
+! test that a netCDF file which *lacks* a modulo length can autimatically assign it
+
+! usage yes? GO bn_subspan_modulo.sub1 X
+
+! show the axis as it comes in
+say "Axis as created:"
+show axis ($1)sub
+
+! write the axis into a netCDF file
+let A = ($1)[g($1)=($1)sub]
+save/file=test_mod.cdf/clobber a
+sp ncdump -c test_mod.cdf | sed -e '/modulo/d' | ncgen3 -o test_nomod.cdf
+cancel var A; cancel axis ($1)sub
+
+! examine the axis that is read back
+sp ncdump -h test_nomod.cdf | grep modulo
+use test_nomod
+say "Axis as inferred from netCDF file:"
+show axis ($1)sub
+cancel data test_nomod
+set mode/last verify
diff --git a/bench/bn_subspan_modulo.sub2 b/bench/bn_subspan_modulo.sub2
new file mode 100644
index 0000000..ffc7f66
--- /dev/null
+++ b/bench/bn_subspan_modulo.sub2
@@ -0,0 +1,124 @@
+! bn_subspan_modulo.sub
+! *sh* 11/02
+
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with 
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+show axis/x=-60:141 ($XAXNAME)
+show axis/x=-60:141:2 ($XAXNAME)
+show axis/x=-60:141:7 ($XAXNAME)
+
+define symbox taxname `$2,return=taxis`
+show axis/l=3:10 ($TAXNAME)
+show axis/l=3:10:3 ($TAXNAME)
+show axis/l=3:10:6 ($TAXNAME)
+
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+lsxn/x=-100:40 $1 ! modulo below
+lsxn/x=-100:160 $1  ! modulo above & below
+
+! end point testing
+lsxn/i=-8:-2 $1
+lsxn/i=-7:-2 $1
+lsxn/i=-6:-2 $1
+lsxn/i=17:20 $1
+lsxn/i=17:21 $1
+lsxn/i=17:22 $1
+set mode/last stupid
+
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+lsxn/x=500:600 $1_ragged[x=@sbx]
+lsxn/x=500:545 $1_ragged[x=@sbx]
+lsxn/x=545:600 $1_ragged[x=@sbx]
+
+lsxn/x=-100:0 $1_ragged
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+
+lsxn/x=-100:142/wid=200 $1_ragged
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+lsxn/x=500:600 $1_void[x=@fav]
+
+lsxn/x=-100:0    $1_void
+lsxn/x=-100:0    $1_void[x=@fav]
+
+lsxn/x=-100:142/wid=200 $1_void
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+
+! @FLN
+lsxn/x=500:600 $1_void
+lsxn/x=500:600 $1_void[x=@fln]
+
+lsxn/x=-100:0    $1_void
+lsxn/x=-100:0    $1_void[x=@fln]
+
+lsxn/x=-100:142/wid=200 $1_void
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+
+! @FNR
+lsxn/x=500:600 $1_void
+lsxn/x=500:600 $1_void[x=@fnr]
+
+lsxn/x=-100:0    $1_void
+lsxn/x=-100:0    $1_void[x=@fnr]
+
+lsxn/x=-100:142/wid=200 $1_void
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+l200n/l=1:12 $2
+l200n/l=1:12/i=1:11 $2
+l200n/l=12:21/i=-19:-9 $2
+l200n/l=12:21/i=-19:-9 $2_void
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+l200n/order=x $2[l=1,i=0:14:7]
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+l200n $2[i=1,l=1:15:3]
+l200n $2[i=1,l=1:15:4]
+l200n $2[i=0:14:2,l=1:15:3]
+
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+list time_series[gt=($TAXNAME)@modngd]
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+list $1_strings[i=1013:1024] 	! via IS_MODULO
diff --git a/bench/bn_symbols.jnl b/bench/bn_symbols.jnl
new file mode 100644
index 0000000..e33afe2
--- /dev/null
+++ b/bench/bn_symbols.jnl
@@ -0,0 +1,109 @@
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+
+cancel symbols/all
+show symbols/all
+
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+
+! exercise SHOW SYMBOL
+show symbol/all
+show symbol s*
+show symbol s2
+
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+show symbol S*
+cancel symbol s2	! already deleted
+
+! exercise symbol translation
+message/continue ($s1)
+message/continue ($s1) and ($S3)
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+show symbol lab*y
+
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+message/continue ($test"default")
+message/continue ($test2"default")
+
+message/continue ($t2"|hello|bye|")
+message/continue ($t2"|hello>really hello|bye|")
+message/continue ($t2"|hello>you said: *|bye|")
+message/continue ($test"|*>you said: *|bye|")
+
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+define symbol ss "\"hello\""
+show symbol ss
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+say ($delayed_eval)         ! translate symbol and then evaluate
+
+
+! cleanup
+cancel symbols/all
+show symbols/all
+
diff --git a/bench/bn_syntax.jnl b/bench/bn_syntax.jnl
new file mode 100644
index 0000000..72ab6cc
--- /dev/null
+++ b/bench/bn_syntax.jnl
@@ -0,0 +1,254 @@
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+SHOW DATA
+SHOW DATA/VARIABLES
+SHOW DATA/FILES
+SHOW DATA/FULL
+CANCEL DATA 1
+SHOW DATA
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+SHOW DATA/BRIEF gtbc011
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+SET DATA 2
+SHOW DATA/BRIEF
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+SHOW REGION SAVE
+SHOW REGION/ALL
+SET REGION SAVE
+SHOW REGION
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+DEFINE REGION/dX=5 W
+SHOW REGION W
+
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+SET MODE IGNORE_ERROR
+SHOW MODES
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+SHOW MODE STUPID
+SET MODE STUPID
+SHOW MODE STUPID
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+set mode journal ferret.jnl
+ppl list plot
+set mode ppllist:ppllist.out
+show mode ppllist
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+cancel mode journal
+show mode journal
+
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+set mode metafile newmetafile1.plt
+show mode metafile
+set mode metafile:newmetafile2.plt
+show mode metafile
+set mode metafile: newmetafile3.plt
+show mode metafile
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+set mode metafile newmetafile7.plt
+show mode metafile
+set mode metafile "newmetafile8.plt"
+show mode metafile
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+set mode metafile ./newmetafile10.plt
+show mode metafile
+set mode metafile metafile.plt
+can mode metafile
+
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+LIST/i=1:3/j=6:8
+
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+LIST/I=101:105/J=50/K=1/L=5 SALT
+SHOW GRID
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+SHOW GRID/X=180:165W SALT
+SET GRID/RESTORE
+SHOW GRID
+
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+SHOW VARIABLES/DIAGNOSTIC  Q
+LET A=i
+SHOW VARIABLES
+CANC VARIABLES/ALL
+SHOW VARIABLES
+
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+SHOW MEMORY/TEMPORARY
+SHOW MEMORY/PERMANENT
+SHOW MEMORY/ALL
+
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+SHOW MEMORY/FREE
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+SHOW MEMORY/FREE
+
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+show data;show data
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+
+
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+
+say \/help	! "/" should pass through
+set mode ignore
+say /help
+canc mode ignore
+
+say this\;that	! ";" should pass through
+set mode ignore
+say this;that
+canc mode ignore
+
+say yes\! "\!" passes through
+say yes! "!" passes through
+
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+\             ! and an extra for good measure
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+
+! weird little blank line inputs
+\ ! ignorable 
+
+\
+\
+
+cancel region  ! to make next output predictable
+show region\
+! comment
+
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any 
+! 	       longer and the program is aborted
+
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+
diff --git a/bench/bn_syntax_6d.jnl b/bench/bn_syntax_6d.jnl
new file mode 100644
index 0000000..84530c4
--- /dev/null
+++ b/bench/bn_syntax_6d.jnl
@@ -0,0 +1,32 @@
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+
+! SET - SHOW - CANCEL DATA
+
+! 6D file based on gtbc011
+USE 6dfile
+
+SHOW GRID
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+SHOW GRID
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+SHOW GRID/X=180:165W SALT
+SET GRID/RESTORE
+SHOW GRID
+
+can dat/all
+
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
diff --git a/bench/bn_tab_comma_multivar.jnl b/bench/bn_tab_comma_multivar.jnl
new file mode 100644
index 0000000..f2cd06e
--- /dev/null
+++ b/bench/bn_tab_comma_multivar.jnl
@@ -0,0 +1,19 @@
+! bn_tab_comma_multivar.jnl
+! 
+! Fixes for bug 1273
+! v5.90 8/9/2005 
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier 
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+
+
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
diff --git a/bench/bn_tax_tstep.jnl b/bench/bn_tax_tstep.jnl
new file mode 100644
index 0000000..7c144d6
--- /dev/null
+++ b/bench/bn_tax_tstep.jnl
@@ -0,0 +1,32 @@
+! bn_tax_tstep.jnl   
+!
+! Working with the coordinates of this axis loses accuracy because its 
+! time origin is so far back from the time it represents
+
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+
+! Test  with TAX_DATESTRING to set the date (but argument to 
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
diff --git a/bench/bn_test_nan.jnl b/bench/bn_test_nan.jnl
new file mode 100644
index 0000000..d0f43fc
--- /dev/null
+++ b/bench/bn_test_nan.jnl
@@ -0,0 +1,36 @@
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+! 
+! 9/03 *kob*
+!
+
+
+
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+can data/all
+can var/all
+
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+can data/all
+can var/all
+
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+can data/all
+can var/all
+
+
+
+
+
diff --git a/bench/bn_test_opendap.jnl b/bench/bn_test_opendap.jnl
new file mode 100644
index 0000000..d192c2e
--- /dev/null
+++ b/bench/bn_test_opendap.jnl
@@ -0,0 +1,13 @@
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+
+
+CANCEL MODE IGNORE
diff --git a/bench/bn_test_stream_big.jnl b/bench/bn_test_stream_big.jnl
new file mode 100644
index 0000000..bf5e525
--- /dev/null
+++ b/bench/bn_test_stream_big.jnl
@@ -0,0 +1,152 @@
+    
+canc data/all
+
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+
+
+set mode ignore
+
+!
+! Following are intentional errors...
+
+!
+! Ultra large grid
+
+canc data/all
+
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+!
+! Semilarge grid
+!
+
+canc data/all
+
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+!
+! Non-existent file
+
+canc data/all
+
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+
+canc dat/all
+canc mode ignore
+
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+list num1
+
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+list num1
+
+
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+list num1
+
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+list num1
+
+!! Test stuff for different data types (files previously generated by matlab)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i2 short.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i4 int.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r4 float.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r8 double.dat
+list num1
+
+
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/swap/type=i1 byteSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/swap/type=i2 shortSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/swap/type=i4 intSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/swap/type=r4 floatSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/swap/type=r8 doubleSwapped.dat
+list num1
+
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error, 
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+
+
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1 twoType.dat
+list num
+list num1
+
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt finale.dat
+list num
+list num1
diff --git a/bench/bn_test_stream_little.jnl b/bench/bn_test_stream_little.jnl
new file mode 100644
index 0000000..701b056
--- /dev/null
+++ b/bench/bn_test_stream_little.jnl
@@ -0,0 +1,154 @@
+    
+canc data/all
+
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+
+
+
+!
+! Following are intentional errors...
+!
+set mode ignore
+
+!
+! Ultra large grid
+
+canc data/all
+
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+!
+! Semilarge grid
+!
+
+canc data/all
+
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+canc data/all
+
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+
+
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+
+canc dat/all
+canc mode ignore
+
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+list num1
+
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+list num1
+
+
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+list num1
+
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+list num1
+
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+
+
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error, 
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+
+
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+list num1
+
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+list num1
diff --git a/bench/bn_transforms.jnl b/bench/bn_transforms.jnl
new file mode 100644
index 0000000..fd0df36
--- /dev/null
+++ b/bench/bn_transforms.jnl
@@ -0,0 +1,27 @@
+! Test the transforms 
+
+use coads_climatology
+
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
diff --git a/bench/bn_transpose.jnl b/bench/bn_transpose.jnl
new file mode 100644
index 0000000..f069aae
--- /dev/null
+++ b/bench/bn_transpose.jnl
@@ -0,0 +1,30 @@
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd 
+set grid mygrd
+
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+
+list myvar
+list transpose_xy(myvar)
+list transpose_xz(myvar)
+list transpose_xt(myvar)
+list transpose_yz(myvar)
+list transpose_yt(myvar)
+list transpose_zt(myvar)
+
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+
diff --git a/bench/bn_txtype_dmy.jnl b/bench/bn_txtype_dmy.jnl
new file mode 100644
index 0000000..5f98f05
--- /dev/null
+++ b/bench/bn_txtype_dmy.jnl
@@ -0,0 +1,98 @@
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+
+set win/asp=1
+use gtsa056_2.cdf
+
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl plot
+
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl shade
+
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl contour
+
+
+! Is DAY so setting not changed.
+
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl plot
+
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ppl plot
+
+! If the type is going to be EITHER DAY or MON then set 
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ppl plot
+
+
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl plot
+
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl shade
+
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl contour
+
+
+! Is DAY so setting not changed.
+
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ppl plot
+
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ppl plot
+
+! If the type is going to be EITHER DAY or MON then set 
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ppl plot
+
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
diff --git a/bench/bn_unique_str2int.jnl b/bench/bn_unique_str2int.jnl
new file mode 100644
index 0000000..56e41ed
--- /dev/null
+++ b/bench/bn_unique_str2int.jnl
@@ -0,0 +1,33 @@
+! bn_unique_str2int.jnl
+
+SHOW FUNC/DETAIL unique_str2int
+
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+
+! check that it works when first called
+list unique_str2int(alist), alist
+
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+
diff --git a/bench/bn_user.jnl b/bench/bn_user.jnl
new file mode 100644
index 0000000..73f3ebb
--- /dev/null
+++ b/bench/bn_user.jnl
@@ -0,0 +1,13 @@
+! bn312_user.jnl
+
+! test the USER command options
+
+! test the SAMPLE command using the polar plotting scripts
+
+! Skip for 6D: USER command not implemented
+
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+
+exit/script
diff --git a/bench/bn_var_hist_levels.jnl b/bench/bn_var_hist_levels.jnl
new file mode 100644
index 0000000..880a9f6
--- /dev/null
+++ b/bench/bn_var_hist_levels.jnl
@@ -0,0 +1,50 @@
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+
+use levitus_climatology
+
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+
+let negvar = -1* temp
+
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+
+
+! Need some tests with centered levels and with /LINE
+
+let cvar = temp - 15
+
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+
+
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+
diff --git a/bench/bn_varcontext_attributes.jnl b/bench/bn_varcontext_attributes.jnl
new file mode 100644
index 0000000..8dbc793
--- /dev/null
+++ b/bench/bn_varcontext_attributes.jnl
@@ -0,0 +1,103 @@
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+
+!-----
+
+! SHOW ATTRIBUTE examples
+
+can data/all
+can var/all
+
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+
+sh att temp[d=1].units
+
+
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames 
+list lnames
+
+go bn_reset
+ 
+
+!-----
+! more on number of attributes     
+
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+
+list (`temp,return=xaxis`)[d=2].nattrs
+
+use gt4d011
+say `temp[d=1].nattrs`
+
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+list `($xaxnam)[d=1].nattrs`
+say `($yaxnam)[d=1].nattrs`
+
+go bn_reset
+ 
+!-----
+! more on access to attribute names and values as variables
+
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+
+let a = temp.units
+list/d=3 a
+list temp[d=3].units
+list/d=3 temp.history
+
+can data/all
+can var/all
+
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+
+go bn_reset
+
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+
+go bn_reset
+
+use levitus_climatology
+use coads_climatology
+
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+
+list ($xaxnam)[d=1].modulo
+list ($yaxnam).point_spacing[d=1]
+
diff --git a/bench/bn_variance.jnl b/bench/bn_variance.jnl
new file mode 100644
index 0000000..a6ba99d
--- /dev/null
+++ b/bench/bn_variance.jnl
@@ -0,0 +1,10 @@
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+list/x=100/L=1 sst[y=@var]
+list/y=10/L=1 sst[x=@var]
+
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
diff --git a/bench/bn_variance_large.jnl b/bench/bn_variance_large.jnl
new file mode 100644
index 0000000..46d4ead
--- /dev/null
+++ b/bench/bn_variance_large.jnl
@@ -0,0 +1,13 @@
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+SHADE/L=1/LEV=v huge
+
+LET huge = sst*1.e25
+STAT/L=1 huge
+SHADE/L=1/LEV=v huge
+
+CANCEL SYMBOL lev*
diff --git a/bench/bn_vec_curv.jnl b/bench/bn_vec_curv.jnl
new file mode 100644
index 0000000..ca9266f
--- /dev/null
+++ b/bench/bn_vec_curv.jnl
@@ -0,0 +1,70 @@
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01 
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+
+can mode meta
+
+! Sinusoidal projection; put data at the poles
+
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+
+! Now stretch the grid
+
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+
+can mode meta
+set mode logo
diff --git a/bench/bn_vec_mod.jnl b/bench/bn_vec_mod.jnl
new file mode 100644
index 0000000..7697dc1
--- /dev/null
+++ b/bench/bn_vec_mod.jnl
@@ -0,0 +1,20 @@
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see 
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+
+use tripolar_subset.nc
+
+! Define a V component for vectors
+
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+
+can view
diff --git a/bench/bn_vector_symbols.jnl b/bench/bn_vector_symbols.jnl
new file mode 100644
index 0000000..6b6c78f
--- /dev/null
+++ b/bench/bn_vector_symbols.jnl
@@ -0,0 +1,29 @@
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3 
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
diff --git a/bench/bn_vtree.jnl b/bench/bn_vtree.jnl
new file mode 100644
index 0000000..0c524f6
--- /dev/null
+++ b/bench/bn_vtree.jnl
@@ -0,0 +1,173 @@
+! bn_tree.jnl
+
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+
+let b = 1
+let c = SIN(b)
+show var/tree c
+
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+
+! ================
+
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+
+! file variables
+go bn_vtree.sub fv1
+show var/tree/d=other_file_vars fv1
+
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+vtree=all a
+vtree=all /d=1 a
+vtree=all /d=2 a
+\say "********************************"
+
+! unrecognized variable names
+go bn_vtree.sub noexist
+
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+
+let b = noexist
+go bn_vtree.sub b
+
+! grid-changing functions 
+go bn_vtree.sub RESHAPE(fvx,fvz)
+
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+show var/tree/d=my_uvar_agg     fv
+show var/tree/d=other_file_vars uv
+show var/tree/d=my_uvar_agg     uv
+\say "***************************"
+
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+go bn_vtree.sub v3
+
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+
+! reporting other errors in definitions
+  set mode ignore
+
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+  list b
+
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+  list c
+
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+  list d
+
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+  list e
+
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+  list f
+
+  set mode/last ignore
+
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+let a = ..history[d=1]
+show var/tree a
diff --git a/bench/bn_vtree.sub b/bench/bn_vtree.sub
new file mode 100644
index 0000000..b0139b2
--- /dev/null
+++ b/bench/bn_vtree.sub
@@ -0,0 +1,18 @@
+\cancel mode verify
+
+say "/TREE=ALL"
+vtree=all ($1)
+say "/TREE=USER"
+vtree=user ($1)
+say "/TREE=FILE"
+vtree=file ($1)
+
+if `($1),return=IsReady` then
+  say ($1) is ready and `($1),return=status`
+else
+  say the problem is `($1),return=status`
+endif
+
+say "************************"
+
+set mode/last verify
diff --git a/bench/bn_window_title.jnl b/bench/bn_window_title.jnl
new file mode 100644
index 0000000..a406934
--- /dev/null
+++ b/bench/bn_window_title.jnl
@@ -0,0 +1,30 @@
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+
+go ptest
+sh sym win_title
+
+set win/title="set the title"
+sho sym win_title
+
+go ptest
+set win/new
+set win/title=""/new
+sho sym win_title
+
+set win/title="($session_date):($session_time)"
+
+! If the date or time starts with a blank then we get an extra 
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+SET WIN/TITLE="($the_date):($the_time)"
+
+can win/all
+set win/new
+sh sym win_title
diff --git a/bench/bn_write_integer_att.jnl b/bench/bn_write_integer_att.jnl
new file mode 100644
index 0000000..4d0b301
--- /dev/null
+++ b/bench/bn_write_integer_att.jnl
@@ -0,0 +1,17 @@
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute 
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP 
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+
+use write_int_att.nc
+sh att mhchla
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+
+sp ncdump a.nc | grep numberOfObservations
+
+
diff --git a/bench/bn_xact_regrid.jnl b/bench/bn_xact_regrid.jnl
new file mode 100644
index 0000000..f23a799
--- /dev/null
+++ b/bench/bn_xact_regrid.jnl
@@ -0,0 +1,55 @@
+! BN450_xact_regrid.jnl
+
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+
+
diff --git a/bench/bn_xact_regrid.sub b/bench/bn_xact_regrid.sub
new file mode 100644
index 0000000..35bfe56
--- /dev/null
+++ b/bench/bn_xact_regrid.sub
@@ -0,0 +1,31 @@
+\cancel mode ver
+! bn450_xact_regrid.sub -- support routine
+! 10/97
+
+! DEFINE AXES
+! "D" FOR DESTINATION
+! "S" FOR SOURCE
+DEFINE AXIS/$1=1:5:1 $1Dcoarse
+DEFINE AXIS/$1=1:5:.5 $1Dfine
+
+DEFINE AXIS/$1=1:5:1 $1Scoarse
+DEFINE AXIS/$1=0.5:5.5:1 $1Soffsetbig
+DEFINE AXIS/$1=1.5:4.5:1 $1Soffsetsmall
+DEFINE AXIS/$1=1:5:.5 $1Sfine
+DEFINE AXIS/$1=0.25:5.25:.5 $1Sfineoffset
+
+! SOURCE DATA
+LET/QUIET Scoarse = $1[G$1=$1Scoarse]
+LET/QUIET Soffsetbig = $1[G$1=$1Soffsetbig]
+LET/QUIET Soffsetsmall = $1[G$1=$1Soffsetsmall]
+LET/QUIET Sfine = $1[G$1=$1Sfine]
+LET/QUIET Sfineoffset = $1[G$1=$1Sfineoffset]
+
+SET MODE/LAST verify
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
diff --git a/bench/bn_xml_header.jnl b/bench/bn_xml_header.jnl
new file mode 100644
index 0000000..f293d7d
--- /dev/null
+++ b/bench/bn_xml_header.jnl
@@ -0,0 +1,14 @@
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+sp cat xml_out.xml
+
+! Here's one where the dataset has a string variable
+
+can dat/all
+
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
diff --git a/bench/bn_xml_output.jnl b/bench/bn_xml_output.jnl
new file mode 100644
index 0000000..a82cdcd
--- /dev/null
+++ b/bench/bn_xml_output.jnl
@@ -0,0 +1,78 @@
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME) 
+! may have been defined in other benchmark scrips.
+
+USE gtsa056_2.cdf
+
+SHO DATA/XML
+
+SHO DATA/VAR/XML
+
+SHO GRID/XML ps3du1
+
+SHO AXIS/XML `temp,return=xaxis`
+SHO AXIS/XML `temp,return=yaxis`
+SHO AXIS/XML `temp,return=zaxis`
+SHO AXIS/XML `temp,return=taxis`
+
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+
+USE coads_climatology
+
+SHOW DATA/XML
+SHO DATA/VAR/XML
+
+
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+
+USE coads_climatology
+USE gtsa056_2
+
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+
+! Define a constant
+LET pi = 3.14
+
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+
+! This lists all the variables except my_sst
+
+SHO VAR/XML
+
+! Now change datasets, so my_sst has a context, but t30 
+! does not temp_20 is listed because it is defined on a dataset
+
+SET DATA coads_climatology
+SHO VAR/XML
+
+! Change default dataset. Now we should just see pi and my_sst 
+
+CAN DATA gtsa056_2
+SHOW VAR/XML
+
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+
+USE coads_climatology 
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+
diff --git a/bench/bn_xml_repl.jnl b/bench/bn_xml_repl.jnl
new file mode 100644
index 0000000..495979a
--- /dev/null
+++ b/bench/bn_xml_repl.jnl
@@ -0,0 +1,9 @@
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+shade/l=1 sst
diff --git a/bench/bn_zaxr_fcns.jnl b/bench/bn_zaxr_fcns.jnl
new file mode 100644
index 0000000..7af149b
--- /dev/null
+++ b/bench/bn_zaxr_fcns.jnl
@@ -0,0 +1,31 @@
+
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+
+
+! Define some original source data:
+
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+
+! Put that data on the following original source grid:
+
+Define axis/z=10:50:10 zaxis_orig
+
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+
+! Define a destination axis
+
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+
diff --git a/bench/bounds_noenclose.nc b/bench/bounds_noenclose.nc
new file mode 100644
index 0000000..be3445f
Binary files /dev/null and b/bench/bounds_noenclose.nc differ
diff --git a/bench/bounds_overlapping.nc b/bench/bounds_overlapping.nc
new file mode 100644
index 0000000..4d0be3b
Binary files /dev/null and b/bench/bounds_overlapping.nc differ
diff --git a/bench/bug1421_a.nc b/bench/bug1421_a.nc
new file mode 100644
index 0000000..31d6322
Binary files /dev/null and b/bench/bug1421_a.nc differ
diff --git a/bench/bug1421_b.nc b/bench/bug1421_b.nc
new file mode 100644
index 0000000..157d3aa
Binary files /dev/null and b/bench/bug1421_b.nc differ
diff --git a/bench/bug_save_subset.nc b/bench/bug_save_subset.nc
new file mode 100644
index 0000000..c252bfe
Binary files /dev/null and b/bench/bug_save_subset.nc differ
diff --git a/bench/byte.dat b/bench/byte.dat
new file mode 100644
index 0000000..4c954b3
Binary files /dev/null and b/bench/byte.dat differ
diff --git a/bench/byteSwapped.dat b/bench/byteSwapped.dat
new file mode 100644
index 0000000..4c954b3
Binary files /dev/null and b/bench/byteSwapped.dat differ
diff --git a/bench/cc_irreg.nc b/bench/cc_irreg.nc
new file mode 100644
index 0000000..47fd6e7
Binary files /dev/null and b/bench/cc_irreg.nc differ
diff --git a/bench/check_metafiles_rh6 b/bench/check_metafiles_rh6
new file mode 100755
index 0000000..19397da
--- /dev/null
+++ b/bench/check_metafiles_rh6
@@ -0,0 +1,93 @@
+#!/bin/csh -f
+# script to check metafiles (.plt*, .gif* and .ps) created after a run of the 
+# benchmark routine against master metafiles. 
+
+set plt_files = ( bn*.plt dots.plt flowlines.plt graticules.plt linecolors.plt multi_line_labels.plt \
+pattern*.plt polygon*.plt vec_curv*.plt)
+set gif_files = ( bn*.gif )
+set ps_files = (bn*.ps)
+set mb_files = (bat.plt_*)
+set num_plt_files = `ls -l *.plt | wc -l `
+
+set err_plt = 0
+set total_plt_files = 23
+foreach plt_file ($plt_files)
+   set size = `ls -l $plt_file | awk '{print $5}'`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$plt_file | awk '{print $5}'`
+   if ($size != $size2) then
+      set err_plt = 1
+      echo "plt files differ $plt_file size $size metafile_masters_64bit_rh6/ size $size2" 
+   endif
+   if ($num_plt_files != $total_plt_files ) set err_plt = 1
+end
+
+set err_gif = 0
+foreach gif_file ($gif_files)
+   set size = `ls -l $gif_file | awk '{print $5}'`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$gif_file | awk '{print $5}'`
+   if ($size != $size2) then
+      set err_gif = 1
+      echo "gif files differ $gif_file size $size metafile_masters_64bit_rh6/ size $size2" 
+   endif
+end
+ 
+set err_ps = 0
+foreach ps_file ($ps_files)
+   set size = `ls -l $ps_file | cut -b 21-27`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$ps_file | cut -b 21-27`
+   set size = `ls -l $ps_file | awk '{print $5}'`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$ps_file | awk '{print $5}'`
+   if ($size != $size2) then
+      set err_ps = 1
+      echo "ps files differ $ps_file size $size metafile_masters_64bit_rh6/ size $size2" 
+   endif
+end
+
+set err_mb = 0
+foreach mb_file ($mb_files)
+   set size = `ls -l $mb_file | cut -b 21-27`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$mb_file | cut -b 21-27`
+   set size = `ls -l $mb_file | awk '{print $5}'`
+   set size2 = `ls -l metafile_masters_64bit_rh6/$mb_file | awk '{print $5}'`
+   if ($size != $size2) then
+      set err_mb = 1
+      echo "metafile batch files differ $mb_file size $size metafile_masters_64bit_rh6/ size $size2" 
+   endif
+end
+
+set any_error = 0
+if ($err_plt) then
+	echo "CHECK PLT FILES - THERE HAS BEEN AN ERROR"
+	if ($num_plt_files != $total_plt_files ) then 
+	  echo "num_plt_files $num_plt_files There should be $total_plt_files"
+	endif
+        set any_error = 1
+else
+	echo "    PLT files look good....."
+endif 
+if ($err_gif) then
+	echo "CHECK GIF FILES - THERE HAS BEEN AN ERROR"
+        set any_error = 1
+else
+	echo "    GIF files look good....."
+endif
+if ($err_ps) then
+	echo "CHECK PS FILES - THERE HAS BEEN AN ERROR"
+        set any_error = 1
+else
+	echo "    PS files look good......"
+endif
+if ($err_mb) then
+	echo "CHECK metafile batch FILES - THERE HAS BEEN AN ERROR"
+        set any_error = 1
+else
+	echo "    metafile batch files look good......"
+endif
+
+if ($any_error) then
+	echo "  "
+	echo " If ImageMagick is available, run check_metafiles_ImageMagick_rh6 to see plot differences. "
+	echo " As the script runs, it shows the standard plot, the plot from this benchmark run, and a diff plot. "
+	echo " Delete the standard and benchmark plots first, then the diff plot. "
+	echo "  "
+endif
diff --git a/bench/clean b/bench/clean
new file mode 100755
index 0000000..788d6e8
--- /dev/null
+++ b/bench/clean
@@ -0,0 +1,13 @@
+#! /bin/csh -f
+# *sh* 12/99
+
+# clean the specified benchmark log file for easier diff-ing
+#    o replace specifi dynamic axis and grid numbers with generic
+#    o remove many diagnostic outputs
+
+# usage:
+    # clean log_file_name
+
+# produces output file name "clean_{log_file_name}"
+
+sed -e s/\(G...\)/\(G999\)/g -e s/\(AX...\)/\(AX999\)/g < $argv[1] | egrep -v '^ alloc|^ deallo|^ \-DELE|^ getgrid|^ eval|^PPL plot' >! clean_$argv[1]
diff --git a/bench/clean_draconian b/bench/clean_draconian
new file mode 100755
index 0000000..39d2461
--- /dev/null
+++ b/bench/clean_draconian
@@ -0,0 +1,13 @@
+#! /bin/csh -f
+# *sh* 9/00
+
+# like clean_ultra but removes more -- everything with a time stamp
+# ==> this means it chops out some valid lines showing time units, etc.
+# ==> [0-9][0-9]:[0-9][0-9]:[0-9][0-9]'
+
+# usage:
+    # ultra_clean log_file_name
+
+# produces output file name "clean_ultra_{log_file_name}"
+
+sed -e s/\(G...\)/\(G999\)/g -e s/\(AX...\)/\(AX999\)/g < $argv[1] | egrep -v '^ alloc|^ deallo|^ \-DELE|^ getgrid|^ found|^ eval|^PPL plot|^ reading|^ regrid|^ nulgrd|^ nulrgd|^ rdstride|^ pseudo|^ constan cnst|^ const_v|^ pseudo|^ string str|FERRET|^ pass #2|SESSION|DELTA_CPU|CLOCK_SECS|bn_RAND|randu2_randn2|history|Linux|CURRENT_DATE|DEFINE VARIABLE dt|DEFINE VARIABLE sumcpu|DEFINE VARIABLE ten_plots|[0-9][0-9]:[0-9][0-9]:[0-9][0-9]|[0-9]-[DJFMASON][a-z][a-z]-[0-9][0-9] [0-9][0-9]:[0- [...]
diff --git a/bench/clean_ultra b/bench/clean_ultra
new file mode 100755
index 0000000..c9f1b73
--- /dev/null
+++ b/bench/clean_ultra
@@ -0,0 +1,11 @@
+#! /bin/csh -f
+# *sh* 9/00
+
+# like clean but eliminates all diagnostic outputs
+
+# usage:
+    # ultra_clean log_file_name
+
+# produces output file name "clean_ultra_{log_file_name}"
+
+sed -e s/\(G...\)/\(G999\)/g -e s/\(AX...\)/\(AX999\)/g < $argv[1] | egrep -v '^ alloc|^ deallo|^ \-DELE|^ getgrid|^ found|^ eval|^PPL plot|^ reading|^ regrid|^ nulgrd|^ nulrgd|^ rdstride|^ pseudo|^ constan cnst|^ const_v|^ pseudo|^ string str|^		:history = "FERRET|^ pass #2|SESSION_DATE|SESSION_TIME' >! clean_ultra_$argv[1]
diff --git a/bench/clim_airt_lev.cdf b/bench/clim_airt_lev.cdf
new file mode 100644
index 0000000..8b55dbb
Binary files /dev/null and b/bench/clim_airt_lev.cdf differ
diff --git a/bench/climatological_axes.cdf b/bench/climatological_axes.cdf
new file mode 100644
index 0000000..d3bbef4
Binary files /dev/null and b/bench/climatological_axes.cdf differ
diff --git a/bench/coads_clim.001 b/bench/coads_clim.001
new file mode 100644
index 0000000..9325dbe
Binary files /dev/null and b/bench/coads_clim.001 differ
diff --git a/bench/coads_clim.002 b/bench/coads_clim.002
new file mode 100644
index 0000000..1a09eef
Binary files /dev/null and b/bench/coads_clim.002 differ
diff --git a/bench/coads_clim.003 b/bench/coads_clim.003
new file mode 100644
index 0000000..5eef5ef
Binary files /dev/null and b/bench/coads_clim.003 differ
diff --git a/bench/coads_clim.003b b/bench/coads_clim.003b
new file mode 100644
index 0000000..a27d960
Binary files /dev/null and b/bench/coads_clim.003b differ
diff --git a/bench/coads_clim.1000 b/bench/coads_clim.1000
new file mode 100644
index 0000000..5d79a4b
Binary files /dev/null and b/bench/coads_clim.1000 differ
diff --git a/bench/coads_clim.1001 b/bench/coads_clim.1001
new file mode 100644
index 0000000..9f9a962
Binary files /dev/null and b/bench/coads_clim.1001 differ
diff --git a/bench/coads_clim.999 b/bench/coads_clim.999
new file mode 100644
index 0000000..9fdc37b
Binary files /dev/null and b/bench/coads_clim.999 differ
diff --git a/bench/coads_clim.des b/bench/coads_clim.des
new file mode 100644
index 0000000..a542de2
--- /dev/null
+++ b/bench/coads_clim.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 2557.455,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 2,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003'
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 4018.425,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_4digit.des b/bench/coads_clim_4digit.des
new file mode 100644
index 0000000..277bb49
--- /dev/null
+++ b/bench/coads_clim_4digit.des
@@ -0,0 +1,54 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ *  This is a version of coads_clim.des but with the filenames                  *
+ *  coads_clim.999 coads_clim.1000 coads_clim.1001                              *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.999',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 4018.425,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 3,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_bad_delta.des b/bench/coads_clim_bad_delta.des
new file mode 100644
index 0000000..89d7393
--- /dev/null
+++ b/bench/coads_clim_bad_delta.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 0,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_irreg.des b/bench/coads_clim_irreg.des
new file mode 100644
index 0000000..cf11dc2
--- /dev/null
+++ b/bench/coads_clim_irreg.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_missing_step1.des b/bench/coads_clim_missing_step1.des
new file mode 100644
index 0000000..6d5bdf9
--- /dev/null
+++ b/bench/coads_clim_missing_step1.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001b',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_missing_stepN.des b/bench/coads_clim_missing_stepN.des
new file mode 100644
index 0000000..04589cd
--- /dev/null
+++ b/bench/coads_clim_missing_stepN.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003b',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_clim_step_order.des b/bench/coads_clim_step_order.des
new file mode 100644
index 0000000..9dd7880
--- /dev/null
+++ b/bench/coads_clim_step_order.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/coads_climatology.cdf b/bench/coads_climatology.cdf
new file mode 100644
index 0000000..ad311d5
Binary files /dev/null and b/bench/coads_climatology.cdf differ
diff --git a/bench/coads_uw.nc b/bench/coads_uw.nc
new file mode 100644
index 0000000..01cb445
Binary files /dev/null and b/bench/coads_uw.nc differ
diff --git a/bench/coads_vwnd.cdf b/bench/coads_vwnd.cdf
new file mode 100644
index 0000000..0015259
Binary files /dev/null and b/bench/coads_vwnd.cdf differ
diff --git a/bench/dates_bug.dat b/bench/dates_bug.dat
new file mode 100644
index 0000000..f6a5441
--- /dev/null
+++ b/bench/dates_bug.dat
@@ -0,0 +1,6 @@
+12-27-1999
+1999-07-28
+07/29/2001
+20010730
+07/31/03
+08/01/999
diff --git a/bench/default.ferret b/bench/default.ferret
new file mode 100644
index 0000000..68acc63
--- /dev/null
+++ b/bench/default.ferret
@@ -0,0 +1,3 @@
+CAN MODE LOGO
+SET MEM /SIZE=25.6
+SET MODE VERIFY
diff --git a/bench/degrees.nc b/bench/degrees.nc
new file mode 100644
index 0000000..77e2786
Binary files /dev/null and b/bench/degrees.nc differ
diff --git a/bench/delim_prec.dat b/bench/delim_prec.dat
new file mode 100644
index 0000000..5b68c1c
--- /dev/null
+++ b/bench/delim_prec.dat
@@ -0,0 +1,4 @@
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
diff --git a/bench/des.mc b/bench/des.mc
new file mode 100644
index 0000000..fc33e56
--- /dev/null
+++ b/bench/des.mc
@@ -0,0 +1,55 @@
+&FORMAT_RECORD
+   D_TYPE             = '  MC'
+   D_FORMAT           = '  1A'
+/
+
+&BACKGROUND_RECORD
+   D_TITLE            = ''
+   D_T0TIME           = '01-JAN-0000 00:00:00'
+   D_TIME_UNIT        = 3600
+   D_TIME_MODULO      = .FALSE.
+   D_CALTYPE          = 'GREGORIAN'
+/
+
+&MESSAGE_RECORD
+   D_MESSAGE          = ' '
+   D_ALERT_ON_OPEN    = .FALSE.
+   D_ALERT_ON_OUTPUT  = .FALSE.
+/
+
+&EXTRA_RECORD
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = 'coads_clim.001'
+   S_AUX_SET_NUM      = 0
+   S_START            = 366
+   S_END              = 1096.485
+   S_DELTA            = 730.485
+   S_NUM_OF_FILES     = 1
+   S_REGVARFLAG       = ' '
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = 'coads_clim.002'
+   S_AUX_SET_NUM      = 0
+   S_START            = 1826.97
+   S_END              = 2557.455
+   S_DELTA            = 730.485
+   S_NUM_OF_FILES     = 1
+   S_REGVARFLAG       = ' '
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = 'coads_clim.003'
+   S_AUX_SET_NUM      = 0
+   S_START            = 3287.94
+   S_END              = 4018.425
+   S_DELTA            = 730.485
+   S_NUM_OF_FILES     = 1
+   S_REGVARFLAG       = ' '
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = '**END OF STEPFILES**'
+/
diff --git a/bench/des.my_descriptor b/bench/des.my_descriptor
new file mode 100644
index 0000000..30210ce
--- /dev/null
+++ b/bench/des.my_descriptor
@@ -0,0 +1,45 @@
+&FORMAT_RECORD
+   D_TYPE             = '  MC'
+   D_FORMAT           = '  1A'
+/
+
+&BACKGROUND_RECORD
+   D_TITLE            = ''
+   D_T0TIME           = '01-JAN-0000 00:00:00'
+   D_TIME_UNIT        = 3600
+   D_TIME_MODULO      = .FALSE.
+   D_CALTYPE          = 'GREGORIAN'
+/
+
+&MESSAGE_RECORD
+   D_MESSAGE          = ' '
+   D_ALERT_ON_OPEN    = .FALSE.
+   D_ALERT_ON_OUTPUT  = .FALSE.
+/
+
+&EXTRA_RECORD
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = 'coads_clim.002'
+   S_AUX_SET_NUM      = 0
+   S_START            = 1826.97
+   S_END              = 2557.455
+   S_DELTA            = 730.485
+   S_NUM_OF_FILES     = 1
+   S_REGVARFLAG       = ' '
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = 'coads_clim.003'
+   S_AUX_SET_NUM      = 0
+   S_START            = 3287.94
+   S_END              = 4018.425
+   S_DELTA            = 730.485
+   S_NUM_OF_FILES     = 1
+   S_REGVARFLAG       = ' '
+/
+
+&STEPFILE_RECORD
+   S_FILENAME         = '**END OF STEPFILES**'
+/
diff --git a/bench/dims_not_coord.nc b/bench/dims_not_coord.nc
new file mode 100644
index 0000000..df98571
Binary files /dev/null and b/bench/dims_not_coord.nc differ
diff --git a/bench/double.dat b/bench/double.dat
new file mode 100644
index 0000000..511b58d
Binary files /dev/null and b/bench/double.dat differ
diff --git a/bench/doubleSwapped.dat b/bench/doubleSwapped.dat
new file mode 100644
index 0000000..92b2698
Binary files /dev/null and b/bench/doubleSwapped.dat differ
diff --git a/bench/dsg.nc b/bench/dsg.nc
new file mode 100644
index 0000000..35b0c33
Binary files /dev/null and b/bench/dsg.nc differ
diff --git a/bench/dstitle.nc b/bench/dstitle.nc
new file mode 100644
index 0000000..6a36148
Binary files /dev/null and b/bench/dstitle.nc differ
diff --git a/bench/duplicate.cdf b/bench/duplicate.cdf
new file mode 100644
index 0000000..f604a82
Binary files /dev/null and b/bench/duplicate.cdf differ
diff --git a/bench/duplicate.des b/bench/duplicate.des
new file mode 100644
index 0000000..cf11dc2
--- /dev/null
+++ b/bench/duplicate.des
@@ -0,0 +1,61 @@
+ ********************************************************************************
+ *        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+ *                      created by MAKE_DESCRIPT rev. 4.01                      *
+ ********************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE             = 'COAD',
+   D_SUBSOURCE          = 'GLOBAL',
+ $END
+ $BACKGROUND_RECORD
+   D_EXPNUM             = '    ',
+   D_MODNUM             = '    ',
+   D_TITLE              = 'COAD',
+   D_FORCING_SET        = '    ',
+   D_T0TIME             = '01-JAN-1900',
+   D_TIME_UNIT          = 3600.0,
+   D_TIME_MODULO        = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN           = '29-aug-1996',
+   D_WHO_RANIT          = 'kob',
+   D_TIME_MADE          = '29-aug-1996',
+   D_WHO_MADEIT         = ' ',
+   D_AUX_MODNUM         =  6*' ',
+   D_ADD_PARM           = 15*' ',
+   D_GRID_FILENAME      =  6*' ',
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.001',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 366.0,
+   S_END                = 1096.485,
+   S_DELTA              = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = 'coads_clim.003',
+   S_AUX_SET_NUM        = 0,
+   S_START              = 3287.94,
+   S_END                = 3287.94,
+   S_DELTA              = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG         = ' ',
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
+
diff --git a/bench/duplicate.nc b/bench/duplicate.nc
new file mode 100644
index 0000000..f604a82
Binary files /dev/null and b/bench/duplicate.nc differ
diff --git a/bench/ens1.nc b/bench/ens1.nc
new file mode 100644
index 0000000..c7d7143
Binary files /dev/null and b/bench/ens1.nc differ
diff --git a/bench/ens2.nc b/bench/ens2.nc
new file mode 100644
index 0000000..9bd9cdf
Binary files /dev/null and b/bench/ens2.nc differ
diff --git a/bench/ens3.nc b/bench/ens3.nc
new file mode 100644
index 0000000..d5638f6
Binary files /dev/null and b/bench/ens3.nc differ
diff --git a/bench/ens4.nc b/bench/ens4.nc
new file mode 100644
index 0000000..022cb3e
Binary files /dev/null and b/bench/ens4.nc differ
diff --git a/bench/epic_formatted_file.nc b/bench/epic_formatted_file.nc
new file mode 100644
index 0000000..9fb3afe
Binary files /dev/null and b/bench/epic_formatted_file.nc differ
diff --git a/bench/err490_cdf_childax.jnl b/bench/err490_cdf_childax.jnl
new file mode 100644
index 0000000..44e785d
--- /dev/null
+++ b/bench/err490_cdf_childax.jnl
@@ -0,0 +1,19 @@
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+! 
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+
+
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+
+message/continue ********File successfully written******
+
diff --git a/bench/err490_command_parser.jnl b/bench/err490_command_parser.jnl
new file mode 100644
index 0000000..e7bfc2c
--- /dev/null
+++ b/bench/err490_command_parser.jnl
@@ -0,0 +1,16 @@
+! err490_command_parser.jnl 12/1/98 - reported by billy kessler
+
+! ERROR Fixed:  command parser fix
+! the following caused an abort of ferret to occur
+! 
+! routines modifed:  gnl/parse_command.F
+!	     	     rpn/init_uvar_sub.F
+!                    common/xvariables.cmn
+
+go ptest
+label/nou `($ppl$xlen)-.3`  -1.1 0 0 .16 a b c d e f g h i j k l m n o p
+
+! the following also caused an abort of ferret
+let sstb = if ( (i eq 172 and j eq 36) or (i ge 173 and i le 175 and j eq 35) or (i ge 176 and i le 178 and j eq 36) or (i eq 178 and j eq 35) ) then 1.e35 else sst
+message/continue ****Variable defined successfully******
+
diff --git a/bench/err490_fixed_var_size.jnl b/bench/err490_fixed_var_size.jnl
new file mode 100644
index 0000000..912e051
--- /dev/null
+++ b/bench/err490_fixed_var_size.jnl
@@ -0,0 +1,45 @@
+! 1/2/98 *sh*
+
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+
+
+!set mode diag - removed *sh* 10/99
+
+let vx = SIN(X[X=1:60:1])
+stat vx
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+
+! now test a special problem that can occur with filling transforms -- 
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
diff --git a/bench/err490_l_ave.jnl b/bench/err490_l_ave.jnl
new file mode 100644
index 0000000..a27eaa1
--- /dev/null
+++ b/bench/err490_l_ave.jnl
@@ -0,0 +1,60 @@
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+
+! *kob* set data coads
+set data coads_vwnd
+
+set region/x=160w/y=40n
+set region/l=1:50
+
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+
+quit
diff --git a/bench/err490_neg_time_show_grid.jnl b/bench/err490_neg_time_show_grid.jnl
new file mode 100644
index 0000000..9e6a262
--- /dev/null
+++ b/bench/err490_neg_time_show_grid.jnl
@@ -0,0 +1,8 @@
+! err490_neg_time_show_grid
+
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+
diff --git a/bench/err490_repeat_first_echo.jnl b/bench/err490_repeat_first_echo.jnl
new file mode 100644
index 0000000..b35305d
--- /dev/null
+++ b/bench/err490_repeat_first_echo.jnl
@@ -0,0 +1,23 @@
+! err490_repeat_first_echo (created later 23/98)
+
+! for the first REPEAT loop on T the formatting of the "verify" output
+! is based on the last previous command given
+
+! fixed 1/98 sh&kob
+!  relevant routines (bug not yet fixed)
+!		       gnl/cs_command.F
+!                      xeq/xeq_repeat.F
+!                      ctx/cs_set_context.F
+
+set mode calendar
+can mode interp
+
+! cause the "last" command to be non-calendar
+stat t[t=15]
+
+! now note the first loop echo
+set mode verify
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
diff --git a/bench/err490_tilde.jnl b/bench/err490_tilde.jnl
new file mode 100644
index 0000000..78bb4ea
--- /dev/null
+++ b/bench/err490_tilde.jnl
@@ -0,0 +1,15 @@
+! err490_tilde.jnl  12/9/97 - *kob* reported by kob
+
+! ERROR: "~" char crashing ferret
+! go ~/xxxx would cause a Trace/BPT trap
+! this will result in an error ( "file not found") message, which is correct 
+! because absolute paths have to be in quotes
+! 
+!  routine modified:  fmt/src/tm_path_list.F
+
+
+set mode ignore
+go ~/bench/echo.jnl  ! ERROR
+can mode ignore
+go "~/bench/echo.jnl" 
+ 
diff --git a/bench/err491_RESHAPE_ctx.jnl b/bench/err491_RESHAPE_ctx.jnl
new file mode 100644
index 0000000..fd80010
--- /dev/null
+++ b/bench/err491_RESHAPE_ctx.jnl
@@ -0,0 +1,34 @@
+! err491_RESHAPE_ctx
+
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+
+list src
+
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+
diff --git a/bench/err491_asn.jnl b/bench/err491_asn.jnl
new file mode 100644
index 0000000..002116f
--- /dev/null
+++ b/bench/err491_asn.jnl
@@ -0,0 +1,44 @@
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+
+! fixed with repair to RECVD_REGRID
+
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+
+cancel mode ignore	! added for benchmark suite...
+
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+!quit !=====================================
+
+list test2[gy=y50 at asn]          ! request association onto 1:50
+ getgrid EX#1     D:-9  I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ getgrid TEST2    D:-9  I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ getgrid TEST     D:-9  I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ allocate dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ allocate dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ allocate dynamic grid (G002)          ABSTRACT  Y50       ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G002)          ABSTRACT  Y50       ABSTRACT  ABSTRACT
+ allocate dynamic grid (G002)          ABSTRACT  Y50       ABSTRACT  ABSTRACT
+ eval    EX#1     D:-9  I: -111 -111  J: -111 -111  K: -111 -111  L: -111 -111
+ allocate dynamic grid (G002)          ABSTRACT  Y50       ABSTRACT  ABSTRACT
+ strip regrid on Y: TEST2 --> (G002)           @ASN
+ eval    TEST2    D: 0  I: -111 -111  J: -111 -111  K: -111 -111  L: -111 -111
+ eval    TEST     D: 0  I: -111 -111  J:   51  100  K: -111 -111  L: -111 -111
+ allocate dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ pseudo  Y        D:-9  I: -111 -111  J:    1  100  K: -111 -111  L: -111 -111
+ dealloc  dynamic grid (G001)          ABSTRACT  (AX002)   ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G002)          ABSTRACT  Y50       ABSTRACT  ABSTRACT
+Trace/BPT trap
diff --git a/bench/err491_attrib_dp.jnl b/bench/err491_attrib_dp.jnl
new file mode 100644
index 0000000..4b785ee
--- /dev/null
+++ b/bench/err491_attrib_dp.jnl
@@ -0,0 +1,17 @@
+! err491_attrib_dp.jnl
+! kob  4/23/98
+
+! bug reported by  Donald S. Dunbar 4/21/98
+! 
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F 
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+
+
+use err491_attval.cdf 
+list elev
+
diff --git a/bench/err491_attval.cdf b/bench/err491_attval.cdf
new file mode 100644
index 0000000..6ad45ca
Binary files /dev/null and b/bench/err491_attval.cdf differ
diff --git a/bench/err491_cdf_childax.jnl b/bench/err491_cdf_childax.jnl
new file mode 100644
index 0000000..813faa9
--- /dev/null
+++ b/bench/err491_cdf_childax.jnl
@@ -0,0 +1,25 @@
+!err490_cdf_childax  *kob*  12/10/97 - initial crash reported by jerry
+
+! ERROR Fixed: listing a netcdf file w/ an extended child axis caused OSF
+!              core dump
+! 
+!  routines modified:    fmt/src/cd_childax_name.F
+!			 fmt/src/cd_write_axis.F
+!                        fmt/src/cd_make_var.F
+! 3.4.98 *kob* add define region statement - needed to include the
+!              bn491_bug_fixes.jnl in w/ bn491_all
+! 5.04.98 *kob* added a readin of the created file.  it turns out that the file wasn't
+! 		able to be read in, because of a bug in the lenght of the line_name variable. it
+!		wasn't long enough to hold the newly created child-axe name
+!		routine modified:  fmt/cmn/xtm_grid.cmn_text
+
+define region/x=130:290/y=-23.5:23.5 t
+set data ocean_atlas_temp
+set reg/@t/z=0/l=1
+save/file=test.cdf/clobber temp
+
+message/continue ********File successfully written******
+
+# new stuff - read the file in
+use test.cdf
+
diff --git a/bench/err491_days1900.jnl b/bench/err491_days1900.jnl
new file mode 100644
index 0000000..c53ef7c
--- /dev/null
+++ b/bench/err491_days1900.jnl
@@ -0,0 +1,20 @@
+! err491_days1900.jnl
+
+! 4/16/98 *kob*
+
+! crash w/ scalar variable passed to days1900 function
+
+! fixed in stk/operate.F:  array references were incorrect for com2 and
+! 			   com3 arrays at line ~1101
+
+
+let day = randu(i) * 30
+let year = 1901 + randu(i)*50
+let month = 5 + 0*i		! array
+
+let jday = days1900(year,month,day)
+list/i=1:5 jday			! OK
+
+let month = 5			! scalar
+list/i=1:5 jday			! crash!!
+
diff --git a/bench/err491_delete_child_var.jnl b/bench/err491_delete_child_var.jnl
new file mode 100644
index 0000000..86a3962
--- /dev/null
+++ b/bench/err491_delete_child_var.jnl
@@ -0,0 +1,23 @@
+! err491_delete_child_var.jnl
+! *sh* 4/99
+
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+
+! fixed with mod to XEQ_DEFINE
+
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+
+list  ypolymark  ! correct values: 1,2,3
+
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+
+list  ypolymark	! incorrect values: 10, 20, 30
diff --git a/bench/err491_dp_time_write.jnl b/bench/err491_dp_time_write.jnl
new file mode 100644
index 0000000..988cbf5
--- /dev/null
+++ b/bench/err491_dp_time_write.jnl
@@ -0,0 +1,18 @@
+! err491_dp_time_write.jnl
+! *sh* 10/98
+
+
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+
+
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
diff --git a/bench/err491_explicit_limits.jnl b/bench/err491_explicit_limits.jnl
new file mode 100644
index 0000000..0856d82
--- /dev/null
+++ b/bench/err491_explicit_limits.jnl
@@ -0,0 +1,28 @@
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+
+! fixed by change in MERGE_GRID (2/23/98)
+
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+
+
+
diff --git a/bench/err491_gmax.jnl b/bench/err491_gmax.jnl
new file mode 100644
index 0000000..5209a2a
--- /dev/null
+++ b/bench/err491_gmax.jnl
@@ -0,0 +1,12 @@
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+
+! .. crash when attempting a time regridding with g=@MAX
+
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
diff --git a/bench/err491_grid_from_name.jnl b/bench/err491_grid_from_name.jnl
new file mode 100644
index 0000000..3c78d81
--- /dev/null
+++ b/bench/err491_grid_from_name.jnl
@@ -0,0 +1,12 @@
+! err491_grid_from_name.jnl
+! *sh* 3/99
+
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+can mode ignore
diff --git a/bench/err491_gt_syntax.jnl b/bench/err491_gt_syntax.jnl
new file mode 100644
index 0000000..5ed0fd8
--- /dev/null
+++ b/bench/err491_gt_syntax.jnl
@@ -0,0 +1,15 @@
+! err491_gt_syntax.jnl
+
+! 3/2/98 *sh*
+
+! parse error interpreting   gt="date":"date":delta
+
+! fixed in GET_CONTEXT_MODS:  variable "name" too short to hold date string
+!			    and check for lo:hi:delta wasn't allowing date
+!			    in quotes
+
+
+let tday t[t="1-jan-1990:12:00":"15-jan-1990:12:00":24]
+list tday[gt="1-jan-1990:12:00":"15-jan-1990:12:00":120]
+
+! **ERROR: regridding: GT="1-JAN-1990:12:00":"15-JAN-1990:12:00":120 : @ttt syntax
diff --git a/bench/err491_interp.jnl b/bench/err491_interp.jnl
new file mode 100644
index 0000000..520e3cf
--- /dev/null
+++ b/bench/err491_interp.jnl
@@ -0,0 +1,31 @@
+!
+! err491_interp.jnl 
+
+! bug reported by billy kessler
+
+! below script caused the following error message:
+! Subscript out of range on file do_fill_interp.F, line 333, procedure do_fill_interp.
+! Subscript number 4 has value 157 in array com.
+! Abort
+
+! fixed by *sh*  w/ mod to utl/confine_axis.F
+! 
+
+
+define axis/t=15-jan-1984:15-dec-1996/npoints=156/unit=mon tax180mon
+define axis/y=10s:10n:1/unit=lat yax180by1
+define grid/t=tax180mon/y=yax180by1 gytdegbymonb
+
+file/format=unf/col=`156*21*8`/g=gytdegbymonb/var="smax,smz,smt,smd,so25,dh,sss,to25"/ord=ty epic-180-sal-map.dat
+
+set variable/bad=1.e35 so25
+
+! eliminate a single bad point
+let so25fx1 = if l ne 98 then so25 else 1.e35
+let so25fl = so25fx1[d=epic-180-sal-map.dat,l=@fln]
+let so25flsm = so25fl[l=@spz:3]
+
+
+! crashes
+plot/t=1-jan-1987:31-dec-1996 so25flsm[y=6s:3s at ave]
+
diff --git a/bench/err491_let_d.jnl b/bench/err491_let_d.jnl
new file mode 100644
index 0000000..27888f7
--- /dev/null
+++ b/bench/err491_let_d.jnl
@@ -0,0 +1,7 @@
+! err491_let_d.jnl
+! *sh* 10/98
+
+! using /d in the definition of a data-set independent variable causes a crash
+
+let/d a = x+y
+stat/i=1:3/j=1:3 a
diff --git a/bench/err491_long_gif_name.jnl b/bench/err491_long_gif_name.jnl
new file mode 100644
index 0000000..29c8b5c
--- /dev/null
+++ b/bench/err491_long_gif_name.jnl
@@ -0,0 +1,13 @@
+! err491_long_gif_name.jnl
+! *sh* 4/99 - test 175 character gif name
+
+! name length extended with changes to save_frame.F and xeq_frame.F
+
+set wind/siz=0.03
+go ptest
+
+sp rm -f abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
+
+frame/file="abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy.gif"
+
+spawn ls abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy*
diff --git a/bench/err491_mc.jnl b/bench/err491_mc.jnl
new file mode 100644
index 0000000..dd4e797
--- /dev/null
+++ b/bench/err491_mc.jnl
@@ -0,0 +1,9 @@
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (PMEL v4.91b2-kessle
+ ! Version 4.91 - 04/29/98
+ ! 30-Apr-98 14:42     
+
+set data coads_clim_irreg.des
+stat sst
+can data/all
+
diff --git a/bench/err491_reshape_limits.jnl b/bench/err491_reshape_limits.jnl
new file mode 100644
index 0000000..57ec06b
--- /dev/null
+++ b/bench/err491_reshape_limits.jnl
@@ -0,0 +1,24 @@
+
+! err491_reshape - 10/98 *sh*
+! RESHAPE function producing impossible result: 540 points in X
+
+! reason is that GCF_IMPOSE_RESULT_LIMS, when computing the RESHAPE
+! output limits, does not trim result context to limits of axis
+
+! ==> need CONFINE_AXIS call inside DO 370 loop
+
+
+use coads_climatology
+
+define axis/x=1:360:1 x360
+define grid/like=sst/x=x360 gg
+
+let sst2 = reshape(sst[x=1:180,y=5s:5n,l=1],x[g=gg])
+
+stat sst[x=1:180,y=5s:5n,l=1]
+
+! 540 points in X ??
+stat sst2
+show grid
+
+
diff --git a/bench/err491_sh_var_templates.jnl b/bench/err491_sh_var_templates.jnl
new file mode 100644
index 0000000..772d249
--- /dev/null
+++ b/bench/err491_sh_var_templates.jnl
@@ -0,0 +1,9 @@
+! SHOW VARIABLE templates are not robust
+
+let mld5dec = 1
+
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+
+
diff --git a/bench/err491_shade_lev_roundoff.jnl b/bench/err491_shade_lev_roundoff.jnl
new file mode 100644
index 0000000..ea8d346
--- /dev/null
+++ b/bench/err491_shade_lev_roundoff.jnl
@@ -0,0 +1,13 @@
+! err491_shade_lev_roundoff
+! *sh* 4/98
+
+! the default levels chosen by PLOT+ fail to capture the one data value
+
+let onept = if i[i=1:3]+j[j=1:3] eq 6 then 0.8573645353
+list/prec=10 onept
+shade onept
+ppl list levels
+
+! but manual levels work OK
+message
+shade/lev=(0,1,1) onept
diff --git a/bench/err491_single_char_replace.jnl b/bench/err491_single_char_replace.jnl
new file mode 100644
index 0000000..fd9a72a
--- /dev/null
+++ b/bench/err491_single_char_replace.jnl
@@ -0,0 +1,10 @@
+! err491_single_char_replace.jnl
+
+! 4/99 *sh*
+
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+
+! but OK in this case
+SAY ($undefined|"hh")
diff --git a/bench/err491_spawn_quotes.jnl b/bench/err491_spawn_quotes.jnl
new file mode 100644
index 0000000..afe9619
--- /dev/null
+++ b/bench/err491_spawn_quotes.jnl
@@ -0,0 +1,6 @@
+! err491_spawn_quotes.jnl
+
+! fixed in xeq_spawn 1/99 *sh*
+
+! this should be a valid command
+SPAWN "date"
diff --git a/bench/err491_time_regridding.jnl b/bench/err491_time_regridding.jnl
new file mode 100644
index 0000000..b442ef2
--- /dev/null
+++ b/bench/err491_time_regridding.jnl
@@ -0,0 +1,30 @@
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+
+!set mode diag
+set wind/siz=.3
+
+set data TAO_SST_clim.cdf
+
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+
+set region/x=125w/y=0n/l=13:48
+
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+
+
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
diff --git a/bench/err491_unknown_function.jnl b/bench/err491_unknown_function.jnl
new file mode 100644
index 0000000..1541ada
--- /dev/null
+++ b/bench/err491_unknown_function.jnl
@@ -0,0 +1,12 @@
+! err491_unknown_function
+! 3/99 *sh*
+
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+
+set mode ignore 
+stat i, noname(i)
+can mode ignore
\ No newline at end of file
diff --git a/bench/err491_zaxreplace.jnl b/bench/err491_zaxreplace.jnl
new file mode 100644
index 0000000..540cec0
--- /dev/null
+++ b/bench/err491_zaxreplace.jnl
@@ -0,0 +1,46 @@
+! April 98
+! this script, provided by Denise Worthen, demonstrates misbehavior
+! of the ZAXREPLACE function.
+! 5 kinds of misbehavior:
+!    1) crashes if the argument K limits don't begin at subscript 1
+!	(fixed in extract_z_line)
+!    2) ignoring missing value flag in arg 1 (temperature)
+!	(fixed in do_internal_gc_fcn)
+!    3) using the cached (mr) arg Z size rather that the requested (cx)
+!	(fixed with new calling arg in EXTRACT_Z_LINE)
+!    4) inconsistent behavior -- pre-loading effected behavior
+!	(fixed by changes Jon made to gcf_impose_arg_lim_dflts.F or
+!		possibly init_empty_context.F)
+!    5) SET REGION/I=lo:hi ignored
+!	( fixed somehow in the course of other changes ...)
+
+!set mode diag - removed *sh* 10/99
+
+use dlw
+
+define axis/z=0:5000:100/units=meter/depth zdepth
+
+! failure to preload gets wrong answer
+!load/y=24 temp[k=1:20]
+!load/y=24 hsigc[k=1:20]
+shade/y=24 ZAXREPLACE(TEMP[k=1:20],HSIGC[k=1:20],Z[GZ=ZDEPTH])
+
+! crash
+!set region/x=25:28
+set mode ignore
+shade/y=24 ZAXREPLACE(TEMP[k=13:15],HSIGC[k=13:15],Z[GZ=ZDEPTH,k=3:5])
+cancel mode ignore
+
+! note that the same plot is mistakenly re-drawn (K=1:15 ignored)
+shade/y=24 ZAXREPLACE(TEMP[k=1:15],HSIGC[k=1:15],Z[GZ=ZDEPTH])
+
+! the set region is ignored
+set region/i=1:10
+shade/y=24 ZAXREPLACE(TEMP[k=1:15],HSIGC[k=1:15],Z[GZ=ZDEPTH])
+
+! now here's the correct plot
+quit
+canc mem/all
+shade/y=24 ZAXREPLACE(TEMP[k=1:15],HSIGC[k=1:15],Z[GZ=ZDEPTH])
+
+
diff --git a/bench/err500_IF_THEN_ELSE_quote.jnl b/bench/err500_IF_THEN_ELSE_quote.jnl
new file mode 100644
index 0000000..4622c6c
--- /dev/null
+++ b/bench/err500_IF_THEN_ELSE_quote.jnl
@@ -0,0 +1,8 @@
+! err500_IF_THEN_ELSE_quote.jnl
+
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+
+! solved 6/11/99 in xeq_if.F
+
+
+IF 1 THEN SAY "I is too big" ENDIF
diff --git a/bench/err500_logcontour.jnl b/bench/err500_logcontour.jnl
new file mode 100644
index 0000000..52b3aaf
--- /dev/null
+++ b/bench/err500_logcontour.jnl
@@ -0,0 +1,26 @@
+! err500_logcontour.jnl
+
+! 2/99
+! the log axes, as set in the PPL AXTYPE command are not applied to
+!  contour
+! plots
+
+! *sh* -- I suspect that the PLOT+ code never attempts to apply the log
+! transform to the 2D plots.
+
+! usage:
+!       yes? GO err500_logcontour SHADE  [or FILL or CONTOUR]
+
+define symbol ptype $1"contour"
+set window/clear
+
+set view upper
+ppl axtype 1,1
+($ptype)/i=1:100/j=1:100 LOG(I/8)+J/100
+set view lower
+ppl axtype 2,1
+($ptype)/i=1:100/j=1:100/xlimits=0:2 LOG(I/8)+J/100
+message
+
+ppl axtype 2,2
+($ptype)/i=1:100/j=1:100/xlimits=0:2/ylimits=0:2 LOG(I/8)+J/100
diff --git a/bench/err540_ax_ave.jnl b/bench/err540_ax_ave.jnl
new file mode 100644
index 0000000..b683a66
--- /dev/null
+++ b/bench/err540_ax_ave.jnl
@@ -0,0 +1,11 @@
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+
+use coads_climatology 
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2 
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
diff --git a/bench/err540_axis_symbols.jnl b/bench/err540_axis_symbols.jnl
new file mode 100644
index 0000000..2a77450
--- /dev/null
+++ b/bench/err540_axis_symbols.jnl
@@ -0,0 +1,25 @@
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols 
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+
+can var/all
+
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+
+set view right
+
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+!go polytube polygon/trans/over xpts,ypts,zpts
diff --git a/bench/err540_axset.jnl b/bench/err540_axset.jnl
new file mode 100644
index 0000000..fdc7103
--- /dev/null
+++ b/bench/err540_axset.jnl
@@ -0,0 +1,29 @@
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and 
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+
+! define a 6 viewport window 
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6  
+
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+
+PPL AXSET 0,1,1,0 
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+
+PPL axset 1,1,1,1
+
diff --git a/bench/err540_cd_use_recdim.jnl b/bench/err540_cd_use_recdim.jnl
new file mode 100644
index 0000000..241a6c0
--- /dev/null
+++ b/bench/err540_cd_use_recdim.jnl
@@ -0,0 +1,31 @@
+! err540_cd_use_recdim
+! 3/02 *sh*
+
+! crash appending scalar variable into file
+
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+
+use profiles.nc
+sh data
+sp rm -f profiles.nc
+
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+
+
+
diff --git a/bench/err540_data_type.jnl b/bench/err540_data_type.jnl
new file mode 100644
index 0000000..584fc84
--- /dev/null
+++ b/bench/err540_data_type.jnl
@@ -0,0 +1,28 @@
+! err540_data_type
+! 2/19/02 *sh*
+
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+
+!set mode diag
+
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
\ No newline at end of file
diff --git a/bench/err540_dods_bad_dataset.jnl b/bench/err540_dods_bad_dataset.jnl
new file mode 100644
index 0000000..f022e15
--- /dev/null
+++ b/bench/err540_dods_bad_dataset.jnl
@@ -0,0 +1,13 @@
+! err540_dods_bad_dataset.jnl
+!
+!  test access to a bad/nonexistent DODS dataset.  Old bug would cause ferret to 
+!    essentially hang
+!  Correct behavior is to generate an error
+
+
+! DELIBERATE ERROR
+set mode ignore
+
+use "http://www.noway_pal.com/nodata.nc"
+
+set mode/last ignore
diff --git a/bench/err540_dods_bad_strides.jnl b/bench/err540_dods_bad_strides.jnl
new file mode 100644
index 0000000..bcd531a
--- /dev/null
+++ b/bench/err540_dods_bad_strides.jnl
@@ -0,0 +1,30 @@
+! err540_dods_set_bad.jnl
+! reported by Joe Sirott  4/02
+! 11/2004 change address from old ferret.wrc to www.ferret.noaa.gov
+
+set mode diag
+
+!! Change to another dataset, our server down...
+!!use "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/S19972441997273.L3m_MO_CHLO.hdf"
+!!set var/bad=0 L3M_DATA  ! if omitted it works fine
+!!stat L3M_DATA[i=1:4096:16,j=1:2048:16]
+
+use "http://remora.jpl.nasa.gov/dods-bin/nph-hdf/pub/ocean_wind/ssmi/atlas_ssmi_ver10/data/level3.0/1990/atlas.ssmi.ver10.level3.0.jan1990.hdf"
+set var/bad=0 u10m
+stat u10m[i=1:360:3,j=1:181:2, L=1]
+
+quit
+=============
+dies in rdstride ... so appears to be a DODS bug
+yes? stat data_values[i=1:4096:16,j=1:4096:16]
+ getgrid EX#1     C:  5 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid (G002)          (AX004)   (AX005)   NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          (AX004)   (AX005)   NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX004)   (AX005)   NORMAL    NORMAL
+ eval    EX#1     C:  4 I:    1  256  J:    1  256  K: -111 -111  L: -111 -111
+ allocate dynamic grid (G002)          (AX004)   (AX005)   NORMAL    NORMAL
+ strip regrid on X: DATA_VALUES --> (G002)           @XACT
+ rdstride DAT-LUES C:  7 I:    1 4081  J:    1 4081  K: -111 -111  L: -111 -111
+Segmentation fault
+
+
diff --git a/bench/err540_ill_format.jnl b/bench/err540_ill_format.jnl
new file mode 100644
index 0000000..838d434
--- /dev/null
+++ b/bench/err540_ill_format.jnl
@@ -0,0 +1,12 @@
+! err540_ill_format.jnl
+! 3/02 *acm*
+
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+
+plot/i=1:100  0.001 - 0.002/ i
+
+plot/trans/i=1:100  0.001 - 0.002/ i
+
+
diff --git a/bench/err540_modscat.jnl b/bench/err540_modscat.jnl
new file mode 100644
index 0000000..e6a7779
--- /dev/null
+++ b/bench/err540_modscat.jnl
@@ -0,0 +1,18 @@
+! test gridding scattered points to modulo axis. 
+! Show Southern hemisphere.
+
+use coads_climatology
+
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
diff --git a/bench/err540_parse_repeat.jnl b/bench/err540_parse_repeat.jnl
new file mode 100644
index 0000000..3409c04
--- /dev/null
+++ b/bench/err540_parse_repeat.jnl
@@ -0,0 +1,18 @@
+! err540_parse_repeat.jnl
+! 3/03 *acm
+
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+
+
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+
+rep/k=1:2 (rep/j=1:1 (say hello))
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
diff --git a/bench/err540_poly_overlay.jnl b/bench/err540_poly_overlay.jnl
new file mode 100644
index 0000000..969d585
--- /dev/null
+++ b/bench/err540_poly_overlay.jnl
@@ -0,0 +1,6 @@
+!overlay on polygon plots
+
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! shade/over/i=1:2/j=0:2/patt i+j
+shade/over/i=1:2/j=0:2/opac=25 i+j
diff --git a/bench/err540_polymissing.jnl b/bench/err540_polymissing.jnl
new file mode 100644
index 0000000..1584bdb
--- /dev/null
+++ b/bench/err540_polymissing.jnl
@@ -0,0 +1,22 @@
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+
+
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
diff --git a/bench/err540_samplexy_missing.jnl b/bench/err540_samplexy_missing.jnl
new file mode 100644
index 0000000..985e55a
--- /dev/null
+++ b/bench/err540_samplexy_missing.jnl
@@ -0,0 +1,11 @@
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+
+! previously missing data in the sample points caused Ferret to hang
+
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
diff --git a/bench/err540_strides_rev.jnl b/bench/err540_strides_rev.jnl
new file mode 100644
index 0000000..bc01c88
--- /dev/null
+++ b/bench/err540_strides_rev.jnl
@@ -0,0 +1,50 @@
+! err540_strides_rev.jnl
+
+! reported Feb '02
+! fixed April 17, '02
+
+! Symptom: plots appear to be "tiled" -- repreating content
+
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc 
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+show grid
+
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ppl list stats
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+can mode stupid
+can mode diag
+set mem/size=25.6
diff --git a/bench/err540_use.jnl b/bench/err540_use.jnl
new file mode 100644
index 0000000..5660371
--- /dev/null
+++ b/bench/err540_use.jnl
@@ -0,0 +1,43 @@
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C) 
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly 
+! set the similarly named variable in dataset C to lower case, making it inaccessible.  
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.  
+
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+can data/all
+
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+use g.nc
+sh data
+can dat 1
+
+! Now open the f2 file which as both a and b variables
+use f2.nc
+
+! All variables from BOTH datasets should be capitals.
+show dat
+
+! This should work
+list b[d=1]
+
+
diff --git a/bench/err540_vs_dash.jnl b/bench/err540_vs_dash.jnl
new file mode 100644
index 0000000..1f77c9e
--- /dev/null
+++ b/bench/err540_vs_dash.jnl
@@ -0,0 +1,38 @@
+! PLOT/VS/DASH  previously was not allowed.
+
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+
diff --git a/bench/err540_write_order.jnl b/bench/err540_write_order.jnl
new file mode 100644
index 0000000..c3fd33e
--- /dev/null
+++ b/bench/err540_write_order.jnl
@@ -0,0 +1,41 @@
+! err540_write_order.jnl
+! *sh* 3/02
+
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+
+
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+
+! before
+list xyz
+
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+
+! after
+use test_good_order
+list xyz
+use test_bad_order
+list xyz
+
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
diff --git a/bench/err541_cancel_axes.jnl b/bench/err541_cancel_axes.jnl
new file mode 100644
index 0000000..c2aac7f
--- /dev/null
+++ b/bench/err541_cancel_axes.jnl
@@ -0,0 +1,24 @@
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+
+use test_axes
+cancel data test_axes
+
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+
+show axis test_i*
+cancel axis test_irreg
+
+show axis test_i*
+
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+
+cancel var tt
+cancel axis/all
+
+show axis test_i*
+
diff --git a/bench/err541_date_delim.jnl b/bench/err541_date_delim.jnl
new file mode 100644
index 0000000..f2ca334
--- /dev/null
+++ b/bench/err541_date_delim.jnl
@@ -0,0 +1,39 @@
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+! 
+! *kob* 11/02
+
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+
+
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+
+
+
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+
diff --git a/bench/err541_fill_tics.jnl b/bench/err541_fill_tics.jnl
new file mode 100644
index 0000000..449a32d
--- /dev/null
+++ b/bench/err541_fill_tics.jnl
@@ -0,0 +1,12 @@
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+
+ppl tics,,.25,,.25,-1,-1
diff --git a/bench/err541_non_gregorian.jnl b/bench/err541_non_gregorian.jnl
new file mode 100644
index 0000000..ac5d489
--- /dev/null
+++ b/bench/err541_non_gregorian.jnl
@@ -0,0 +1,12 @@
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002 
+! pre-542, second axis has just one point.
+
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+
+! For comparison, use the dates that start and end tax2 
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
diff --git a/bench/err541_string4d.jnl b/bench/err541_string4d.jnl
new file mode 100644
index 0000000..29b54d5
--- /dev/null
+++ b/bench/err541_string4d.jnl
@@ -0,0 +1,28 @@
+ ! Write a 4-D NetCDF file with a string variable.
+
+sp rm -f string4d.nc
+
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+save/clobber/file=string4d.nc axy
+
+can var/all
+can data/all
+use string4d.nc
+sh data
+list axy
diff --git a/bench/err542_poly_over_calendar.jnl b/bench/err542_poly_over_calendar.jnl
new file mode 100644
index 0000000..2b2726b
--- /dev/null
+++ b/bench/err542_poly_over_calendar.jnl
@@ -0,0 +1,6 @@
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
diff --git a/bench/err542_poly_over_calendar.nc b/bench/err542_poly_over_calendar.nc
new file mode 100644
index 0000000..438ab80
Binary files /dev/null and b/bench/err542_poly_over_calendar.nc differ
diff --git a/bench/err550_define_axis_expression.jnl b/bench/err550_define_axis_expression.jnl
new file mode 100644
index 0000000..55371ec
--- /dev/null
+++ b/bench/err550_define_axis_expression.jnl
@@ -0,0 +1,22 @@
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+
+let a = {1,2,3}
+let b = {2,3,4}
+
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+
+
+!  Note (acm)  The older syntax defines the axis correctly
+
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
diff --git a/bench/err550_dots_thickpens.jnl b/bench/err550_dots_thickpens.jnl
new file mode 100644
index 0000000..b3813ae
--- /dev/null
+++ b/bench/err550_dots_thickpens.jnl
@@ -0,0 +1,5 @@
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+
+plot/sym=dot/color=8/i=1:10 i
diff --git a/bench/err550_nc_seconds.jnl b/bench/err550_nc_seconds.jnl
new file mode 100644
index 0000000..a8f95ed
--- /dev/null
+++ b/bench/err550_nc_seconds.jnl
@@ -0,0 +1,12 @@
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+
+! When the time origin is specified in a NetCDF file as 
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly. 
+! If it's written as "1996-06-10 04:03:36" it is read OK
+
+use time_axis_seconds.nc
+
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
diff --git a/bench/err550_redefine_calendar_axis.jnl b/bench/err550_redefine_calendar_axis.jnl
new file mode 100644
index 0000000..ca48261
--- /dev/null
+++ b/bench/err550_redefine_calendar_axis.jnl
@@ -0,0 +1,9 @@
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.   
+
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+
diff --git a/bench/err550_shade_limits.jnl b/bench/err550_shade_limits.jnl
new file mode 100644
index 0000000..34b2d1f
--- /dev/null
+++ b/bench/err550_shade_limits.jnl
@@ -0,0 +1,9 @@
+! err550_shade_limits.jnl
+! acm 2/5/03
+
+! SHADE bug: hlimits, vlimits without effect
+
+use coads_climatology
+set view upper; shade sst[l=1]
+
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
diff --git a/bench/err550_view_axes_fill.jnl b/bench/err550_view_axes_fill.jnl
new file mode 100644
index 0000000..0edca49
--- /dev/null
+++ b/bench/err550_view_axes_fill.jnl
@@ -0,0 +1,74 @@
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+
+can mode logo
+set win/asp=.5/siz=0.5
+
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+
+set vi bot1
+fill/nokey test
+contour/over test
+
+set vi bot
+fill test
+contour/over test
+
+set vi mid1
+shade/nokey test
+contour/over test
+
+set vi mid
+shade test
+contour/over test
+
+set vi top1
+fill/nokey test
+contour/over test
+
+set vi top
+fill test
+contour/over test
+
+
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+
+set vi bot
+fill test
+contour/over test
+
+set vi mid1
+shade/nokey test
+contour/over test
+
+set vi mid
+shade test
+contour/over test
+
+set vi top1
+fill/nokey test
+contour/over test
+
+set vi top
+fill test
+contour/over test
+
+set win/clear
+set win/aspect=0.75
diff --git a/bench/err550_view_axes_position.jnl b/bench/err550_view_axes_position.jnl
new file mode 100644
index 0000000..78dbd98
--- /dev/null
+++ b/bench/err550_view_axes_position.jnl
@@ -0,0 +1,13 @@
+! err550_view_axes_position.jnl
+! acm 2/5/03
+
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
diff --git a/bench/err551_2dave.jnl b/bench/err551_2dave.jnl
new file mode 100644
index 0000000..b530340
--- /dev/null
+++ b/bench/err551_2dave.jnl
@@ -0,0 +1,11 @@
+! Bug in 2-D averaging, if source data thats loaded has a 
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+
+use coads_climatology
+load/l=1 sst
+
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
diff --git a/bench/err551_axes_set.jnl b/bench/err551_axes_set.jnl
new file mode 100644
index 0000000..abbf92a
--- /dev/null
+++ b/bench/err551_axes_set.jnl
@@ -0,0 +1,13 @@
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES= 
+
+SET VIEW lower  
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
diff --git a/bench/err551_colorkey.jnl b/bench/err551_colorkey.jnl
new file mode 100644
index 0000000..a1bd45a
--- /dev/null
+++ b/bench/err551_colorkey.jnl
@@ -0,0 +1,17 @@
+
+! colorkey label bugs
+
+
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+
diff --git a/bench/err551_fft_freqaxis.jnl b/bench/err551_fft_freqaxis.jnl
new file mode 100644
index 0000000..0b03fd3
--- /dev/null
+++ b/bench/err551_fft_freqaxis.jnl
@@ -0,0 +1,14 @@
+
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+
+list FFT_nf
+list 2*FFT_nf
+list `tpts,return=lend`
+
diff --git a/bench/err551_invalid_calendar.jnl b/bench/err551_invalid_calendar.jnl
new file mode 100644
index 0000000..4223395
--- /dev/null
+++ b/bench/err551_invalid_calendar.jnl
@@ -0,0 +1,6 @@
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name, 
+! give an error message and use an abstract axis.
+
+set data err_calendar.nc
+sh data
diff --git a/bench/err551_modulo_nc_regrid.jnl b/bench/err551_modulo_nc_regrid.jnl
new file mode 100644
index 0000000..58d86ef
--- /dev/null
+++ b/bench/err551_modulo_nc_regrid.jnl
@@ -0,0 +1,30 @@
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data 
+
+! First write a file with a monthly climatology:
+
+use coads_vwnd 
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+
+let vwnd_clim = vwnd[gt=month_reg at mod]
+
+save/clobber/file=clim.nc vwnd_clim
+
+! File clim.nc is a climatology with the attribute 
+!		MONTH_REG:modulo = 8765.82 ;
+
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data 
+
+can data/all
+can var/all
+
+use coads_vwnd 
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+
diff --git a/bench/err551_no_taxis_errmsg.jnl b/bench/err551_no_taxis_errmsg.jnl
new file mode 100644
index 0000000..da60643
--- /dev/null
+++ b/bench/err551_no_taxis_errmsg.jnl
@@ -0,0 +1,9 @@
+! The time axis is bad, having repeated values, so an abstract axis is 
+! used by Ferret and the list/t=time should result in an error.
+
+SET MODE IGNORE_ERROR
+
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+
+SET MODE/LAST IGNORE_ERROR
diff --git a/bench/err551_num_levels.jnl b/bench/err551_num_levels.jnl
new file mode 100644
index 0000000..6362957
--- /dev/null
+++ b/bench/err551_num_levels.jnl
@@ -0,0 +1,20 @@
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+
+SHADE/L=1/LEV=0.01d sst
+can data/all
+
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
diff --git a/bench/err551_regrid_undef_grid.jnl b/bench/err551_regrid_undef_grid.jnl
new file mode 100644
index 0000000..39cb84d
--- /dev/null
+++ b/bench/err551_regrid_undef_grid.jnl
@@ -0,0 +1,57 @@
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+
+! test various regridding combos that involve user-defined variables
+! for the target grids
+
+
+set mode ignore_errors
+
+use coads_climatology
+use levitus_climatology
+
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+show grid
+
+can data/all
+can var/all
+can grid
+
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+list a1[gzxy=a2]
+
+can data/all
+can var/all
+
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+
diff --git a/bench/err551_repeat_sym.jnl b/bench/err551_repeat_sym.jnl
new file mode 100644
index 0000000..068ca19
--- /dev/null
+++ b/bench/err551_repeat_sym.jnl
@@ -0,0 +1,8 @@
+
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
diff --git a/bench/err551_return_message.jnl b/bench/err551_return_message.jnl
new file mode 100644
index 0000000..996629c
--- /dev/null
+++ b/bench/err551_return_message.jnl
@@ -0,0 +1,16 @@
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM  
+
+SET MODE IGNORE_ERROR
+
+use dstitle
+
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+
+say `axy, return=xx`
+
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+
+SET MODE/LAST IGNORE_ERROR
diff --git a/bench/err551_streamread_directory.jnl b/bench/err551_streamread_directory.jnl
new file mode 100644
index 0000000..0d0a9e8
--- /dev/null
+++ b/bench/err551_streamread_directory.jnl
@@ -0,0 +1,15 @@
+! Bug: file/form=stream doesnt see file in another directory
+
+sp rm -f subdir/a.dat
+
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a              
+
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a                     
diff --git a/bench/err551_strings.jnl b/bench/err551_strings.jnl
new file mode 100644
index 0000000..8b03112
--- /dev/null
+++ b/bench/err551_strings.jnl
@@ -0,0 +1,36 @@
+
+
+! first make sure file is non-existent
+sp rm input.txt
+
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+list a
+
+
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+
+! last one - make sure bug gabe found is fixed as well 
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+list strcmp("b", mystring)
+
diff --git a/bench/err553_axis_too_long.jnl b/bench/err553_axis_too_long.jnl
new file mode 100644
index 0000000..5cebebe
--- /dev/null
+++ b/bench/err553_axis_too_long.jnl
@@ -0,0 +1,9 @@
+! From Ned Cokelet
+! First definition of axis had last grid cell completely 
+! beyond requested end.
+
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
diff --git a/bench/err553_contour_fine_grid.jnl b/bench/err553_contour_fine_grid.jnl
new file mode 100644
index 0000000..e360f71
--- /dev/null
+++ b/bench/err553_contour_fine_grid.jnl
@@ -0,0 +1,30 @@
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+
+PPLUS/RESET   ! reset aspect ratio
diff --git a/bench/err553_lev_c.jnl b/bench/err553_lev_c.jnl
new file mode 100644
index 0000000..1e493e4
--- /dev/null
+++ b/bench/err553_lev_c.jnl
@@ -0,0 +1,8 @@
+ ! under linux only, this has a non-centered shade key
+
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
diff --git a/bench/err553_list_string_numeric.jnl b/bench/err553_list_string_numeric.jnl
new file mode 100644
index 0000000..4e57bdb
--- /dev/null
+++ b/bench/err553_list_string_numeric.jnl
@@ -0,0 +1,17 @@
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.   
+
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+
+let v = y[y=1:5]
+list v
+list/i=3:4/l=1:2 b, c, v
+
diff --git a/bench/err553_list_width.jnl b/bench/err553_list_width.jnl
new file mode 100644
index 0000000..dda8a2e
--- /dev/null
+++ b/bench/err553_list_width.jnl
@@ -0,0 +1,17 @@
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing  
+! (this caused an outright crash)
+
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+
+can mode ignore
diff --git a/bench/err553_lon_ax_0_label.jnl b/bench/err553_lon_ax_0_label.jnl
new file mode 100644
index 0000000..ee6ade6
--- /dev/null
+++ b/bench/err553_lon_ax_0_label.jnl
@@ -0,0 +1,8 @@
+! Label longitude axes with the degree sign only 
+! at x=0 (previously had an E).  
+
+! ACM 1/6/04
+
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+
diff --git a/bench/err553_long_string_var_name.jnl b/bench/err553_long_string_var_name.jnl
new file mode 100644
index 0000000..b2ff905
--- /dev/null
+++ b/bench/err553_long_string_var_name.jnl
@@ -0,0 +1,15 @@
+! err553_long_string_var_name.jnl
+! 9/03 kob
+
+
+
+! test long string variables - the were being truncated
+! at 100 characters
+
+
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+
+list a
+
+
+
diff --git a/bench/err553_numeric_filename.jnl b/bench/err553_numeric_filename.jnl
new file mode 100644
index 0000000..29fddf2
--- /dev/null
+++ b/bench/err553_numeric_filename.jnl
@@ -0,0 +1,10 @@
+! err553_numeric_filename.jnl
+! 9/03 kob
+
+
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+
+list vwnd_clim
+
diff --git a/bench/err553_regionname_lengths.jnl b/bench/err553_regionname_lengths.jnl
new file mode 100644
index 0000000..4cc3abf
--- /dev/null
+++ b/bench/err553_regionname_lengths.jnl
@@ -0,0 +1,15 @@
+! In v5.50, we upped the region name storage to 
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+
+SET MODE IGNORE_ERRORS
+
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+set region southeast_asia
+show region
+
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+
+SET MODE/LAST IGNORE_ERRORS
diff --git a/bench/err553_set_axis_depth.jnl b/bench/err553_set_axis_depth.jnl
new file mode 100644
index 0000000..841a6c6
--- /dev/null
+++ b/bench/err553_set_axis_depth.jnl
@@ -0,0 +1,10 @@
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53  
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58     
+
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+show axis zax
+q
diff --git a/bench/err553_shakey_labels.jnl b/bench/err553_shakey_labels.jnl
new file mode 100644
index 0000000..84282c4
--- /dev/null
+++ b/bench/err553_shakey_labels.jnl
@@ -0,0 +1,11 @@
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+
diff --git a/bench/err553_stride_def_grid.jnl b/bench/err553_stride_def_grid.jnl
new file mode 100644
index 0000000..2e9e447
--- /dev/null
+++ b/bench/err553_stride_def_grid.jnl
@@ -0,0 +1,120 @@
+
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+can mem/all
+
+def grid/like=taux agrid
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+
+can mem/all
+can data/all
+
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+define grid/like=midvar bgrid
+define grid/like=bigvar cgrid
+define grid/like=unevenvar dgrid
+define grid/like=xytvar egrid
+canc data/all
+
+
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+LIST VAR[i=2:4:2]
+LIST VAR[i=2:4:2,j=1:3:2]
+CANC MEM/ALL
+
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+cancel axis/modulo XAX1_4
+
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+LIST VAR[i=2:6:2,j=1:5:2]
+
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+list/j=1/k=1/l=1 a[i=3:5]
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+
+! ****** unequally spaced points on parent axis
+
+cancel mem/all
+
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+
+set region/i=3:6/j=2:4/k=1:2/l=1
+
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+canc data/all
+
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+canc data/all
+
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+
+use/order=tyx bn_strides
+show grid xytvar
+
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+canc data/all
+
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+canc data/all
+
+
+cancel region; set region/l=1
+
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
+
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+canc data/all
diff --git a/bench/err553_stride_modulo.jnl b/bench/err553_stride_modulo.jnl
new file mode 100644
index 0000000..733ab86
--- /dev/null
+++ b/bench/err553_stride_modulo.jnl
@@ -0,0 +1,27 @@
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+
+use mylon
+list var[i=-400:-40:20]
+list var[i=-400:-40:50]
+
+! This list, using modulo-ing to go out to a second replication 
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+
+list var[i=`2*1081-400`:`2*1082-40`:50]
+
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+can mem; list/y=0 var[i=69]
+can mem; list/y=0 var[i=68]
diff --git a/bench/err553_symbol_lev.jnl b/bench/err553_symbol_lev.jnl
new file mode 100644
index 0000000..5bf2950
--- /dev/null
+++ b/bench/err553_symbol_lev.jnl
@@ -0,0 +1,36 @@
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created 
+! for polygon plots
+
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+
+show symb lev*
+
+can sym lev*
+! Now with /LEV=(min,max,del)
+
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+
+can sym lev*
+! Now with /LEV=nl
+
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+sh sym lev*
+can sym lev*
diff --git a/bench/err553_symsize.jnl b/bench/err553_symsize.jnl
new file mode 100644
index 0000000..5fa213a
--- /dev/null
+++ b/bench/err553_symsize.jnl
@@ -0,0 +1,5 @@
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+! 
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
diff --git a/bench/err553_timeregion.jnl b/bench/err553_timeregion.jnl
new file mode 100644
index 0000000..c926d78
--- /dev/null
+++ b/bench/err553_timeregion.jnl
@@ -0,0 +1,13 @@
+! try to apply a region whose limits are both below, 
+! or both above, the data bounds. In v5.53 the error 
+! handling for this got broken for time axes (an error 
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+
+SET MODE IGNORE_ERRORS
+
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+
+
+SET MODE/LAST IGNORE_ERRORS
diff --git a/bench/err553_xaxis_nsmtc.jnl b/bench/err553_xaxis_nsmtc.jnl
new file mode 100644
index 0000000..11003fa
--- /dev/null
+++ b/bench/err553_xaxis_nsmtc.jnl
@@ -0,0 +1,10 @@
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.  
+
+! ACM 12/12/03
+
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+
diff --git a/bench/err553_year_yr.jnl b/bench/err553_year_yr.jnl
new file mode 100644
index 0000000..08dee77
--- /dev/null
+++ b/bench/err553_year_yr.jnl
@@ -0,0 +1,47 @@
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in 
+! the specified calendar
+
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+show axis tax1
+show axis tax2
+list/l=1186:1189 t[gt=tax1]
+list/l=1186:1189 t[gt=tax2]
+
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+show axis tax1
+show axis tax2
+list/l=1186:1189 t[gt=tax1]
+list/l=1186:1189 t[gt=tax2]
+
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+show axis tax1
+show axis tax2
+list/l=1186:1189 t[gt=tax1]
+list/l=1186:1189 t[gt=tax2]
+
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+show axis tax1
+show axis tax2
+list/l=1186:1189 t[gt=tax1]
+list/l=1186:1189 t[gt=tax2]
+
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+show axis tax1
+show axis tax2
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+list/l=1186:1189 t[gt=tax2]
+list/l=1168:1171 t[gt=tax1]
+list/l=1168:1171 t[gt=tax2]
+can mode ignore
diff --git a/bench/err560_century.jnl b/bench/err560_century.jnl
new file mode 100644
index 0000000..420a074
--- /dev/null
+++ b/bench/err560_century.jnl
@@ -0,0 +1,17 @@
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+
+! Crashes Ferret with STOP: ,2
+
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+
+plot v[gt=tax at asn]
+
+
+! Also need to test this, years 599 - 600
+
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
diff --git a/bench/err560_leap_years.jnl b/bench/err560_leap_years.jnl
new file mode 100644
index 0000000..8351a77
--- /dev/null
+++ b/bench/err560_leap_years.jnl
@@ -0,0 +1,7 @@
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
diff --git a/bench/err560_mc_irreg_t.jnl b/bench/err560_mc_irreg_t.jnl
new file mode 100644
index 0000000..0e83214
--- /dev/null
+++ b/bench/err560_mc_irreg_t.jnl
@@ -0,0 +1,17 @@
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error. 
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+
diff --git a/bench/err560_regridding_gaps.jnl b/bench/err560_regridding_gaps.jnl
new file mode 100644
index 0000000..a90f64c
--- /dev/null
+++ b/bench/err560_regridding_gaps.jnl
@@ -0,0 +1,34 @@
+! err560_regrid
+! 
+! If the index has a negative range including the value 
+! -111, was treated as missing rather than a valid index.
+
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+
+can data/all
+can var/all
+use xlongshift
+use xlong
+
+list/x=115w:108w a[gx=b[d=1]]
+
+list/x=115w:108w a[gx=b[d=1]@ave]
+
+list/x=115w:108w a[gx=b[d=1]@ave]
+
+list/x=115w:108w a[gx=b[d=1]@sum]
+
+list/x=115w:108w a[gx=b[d=1]@ngd]
+
+list/x=115w:108w a[gx=b[d=1]@nrst]
+
+list/x=115w:108w a[gx=b[d=1]@xact]
+
+sp rm xlong.nc
+sp rm xlongshift.nc
diff --git a/bench/err560_shade_levels.jnl b/bench/err560_shade_levels.jnl
new file mode 100644
index 0000000..cf7f539
--- /dev/null
+++ b/bench/err560_shade_levels.jnl
@@ -0,0 +1,9 @@
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level 
+
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034  
diff --git a/bench/err560_shade_noleap.jnl b/bench/err560_shade_noleap.jnl
new file mode 100644
index 0000000..0d5b62f
--- /dev/null
+++ b/bench/err560_shade_noleap.jnl
@@ -0,0 +1,10 @@
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.     
+
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+
+shade/t=4-jan-2000:10-nov-2000 a
diff --git a/bench/err570_cnnn_multiline.jnl b/bench/err570_cnnn_multiline.jnl
new file mode 100644
index 0000000..1c390e2
--- /dev/null
+++ b/bench/err570_cnnn_multiline.jnl
@@ -0,0 +1,9 @@
+! Changing pen with @Cnnn did not work in 
+! multi-line labels    
+
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
diff --git a/bench/err570_coaching.jnl b/bench/err570_coaching.jnl
new file mode 100644
index 0000000..900c2a7
--- /dev/null
+++ b/bench/err570_coaching.jnl
@@ -0,0 +1,38 @@
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+
+! test this with GO err570_coaching hello
+
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+
+set mode ignore_errors
+
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+
+! These example message commands taken from bn_dollar
+
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+   
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+
+set mode/last ignore_errors
diff --git a/bench/err570_compressk_by.jnl b/bench/err570_compressk_by.jnl
new file mode 100644
index 0000000..8c75a27
--- /dev/null
+++ b/bench/err570_compressk_by.jnl
@@ -0,0 +1,52 @@
+! err570_compress_by.jnl
+! fix for bug 925
+
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+
+list ind
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+
+list temp
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+
+list tlev[k=1]
+
+
diff --git a/bench/err570_digit_filename.jnl b/bench/err570_digit_filename.jnl
new file mode 100644
index 0000000..396ccc4
--- /dev/null
+++ b/bench/err570_digit_filename.jnl
@@ -0,0 +1,18 @@
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+list a[x=1:4,d=1]
+
+
+use coads_climatology
+list a[x=1:4,d=1]
+list a[i=1:4,d=1]
+
+list a[i=1:4,d=10a]
+list a[i=1:4,d=10a.nc]
diff --git a/bench/err570_dods_url_label.jnl b/bench/err570_dods_url_label.jnl
new file mode 100644
index 0000000..3f8d210
--- /dev/null
+++ b/bench/err570_dods_url_label.jnl
@@ -0,0 +1,40 @@
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.  
+! acm 11/04
+
+
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt 
+!!ppl list labels
+
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp 
+!!ppl list labels
+
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst 
+!!ppl list labels
+
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+
+
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+plot/x=180/y=0 sst 
+ppl list labels
\ No newline at end of file
diff --git a/bench/err570_dollar_zero.jnl b/bench/err570_dollar_zero.jnl
new file mode 100644
index 0000000..505ab64
--- /dev/null
+++ b/bench/err570_dollar_zero.jnl
@@ -0,0 +1,8 @@
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+
+SET MODE ignore_error
+SAY ($0)
+
+SET MODE/LAST ignore_error
diff --git a/bench/err570_fine_grid_list.jnl b/bench/err570_fine_grid_list.jnl
new file mode 100644
index 0000000..7f5bc2f
--- /dev/null
+++ b/bench/err570_fine_grid_list.jnl
@@ -0,0 +1,27 @@
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+
+
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+
+let myvar = x[gx=xfine] + y[gy=yfine]
+
+set list/prec=8
+list/form=tab myvar
+
+set list/prec=8
+list/form=comma myvar
+
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+sp rm -f fine.dat
+
+cancel list/precision
diff --git a/bench/err570_hlimit_onepoint.jnl b/bench/err570_hlimit_onepoint.jnl
new file mode 100644
index 0000000..a6be3c8
--- /dev/null
+++ b/bench/err570_hlimit_onepoint.jnl
@@ -0,0 +1,16 @@
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave 
+! misleading error)
+! If no /HLIMIT, should issue an error 
+
+set mode ignore_error
+
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
diff --git a/bench/err570_illegal_stride.jnl b/bench/err570_illegal_stride.jnl
new file mode 100644
index 0000000..0edaaf7
--- /dev/null
+++ b/bench/err570_illegal_stride.jnl
@@ -0,0 +1,8 @@
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+
+SET MODE/LAST ignore_error
diff --git a/bench/err570_index111.jnl b/bench/err570_index111.jnl
new file mode 100644
index 0000000..20c18b3
--- /dev/null
+++ b/bench/err570_index111.jnl
@@ -0,0 +1,24 @@
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+! 
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+
+
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
diff --git a/bench/err570_keylabels.jnl b/bench/err570_keylabels.jnl
new file mode 100644
index 0000000..518c25d
--- /dev/null
+++ b/bench/err570_keylabels.jnl
@@ -0,0 +1,9 @@
+! err570_keylabels.jnl
+! 11/2004
+
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
diff --git a/bench/err570_list_tab_coords.jnl b/bench/err570_list_tab_coords.jnl
new file mode 100644
index 0000000..53e380a
--- /dev/null
+++ b/bench/err570_list_tab_coords.jnl
@@ -0,0 +1,12 @@
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
diff --git a/bench/err570_long_label.jnl b/bench/err570_long_label.jnl
new file mode 100644
index 0000000..2392e74
--- /dev/null
+++ b/bench/err570_long_label.jnl
@@ -0,0 +1,35 @@
+! err570_long_label.jnl
+! Fix for bug 956
+
+! Very long multi-line label truncated on %LABEL command 
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+
+PLOT/i=1:10  1/i
+
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+
+  define symbol lenline = `strlen(source_list)+8`
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+      list/noheader tsulab
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+
+set mode/last verify
diff --git a/bench/err570_many_variables.jnl b/bench/err570_many_variables.jnl
new file mode 100644
index 0000000..d80f0c3
--- /dev/null
+++ b/bench/err570_many_variables.jnl
@@ -0,0 +1,245 @@
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+! 
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+! 
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+! 
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+! 
+!set mode diag
+
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+
+
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+
+let str1a = STRLEN("($source_list)")
+let lstr1 = STRLEN("+")
+
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+
+let lstr2 = STRLEN("($alist)")
+
+let str3a = STRLEN("($source_list)")
+list str3a 
+
+!let a = 12; list a
+
+LET STR3 = STRLEN("abcd")
+list str3
+
+let str4a = STRLEN("($source_list)")
+
+list str4a
diff --git a/bench/err570_null_symbol.jnl b/bench/err570_null_symbol.jnl
new file mode 100644
index 0000000..73232aa
--- /dev/null
+++ b/bench/err570_null_symbol.jnl
@@ -0,0 +1,12 @@
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+! 
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+
+set mode ignore
+
+def sym a " "
+($a)
+
+can mode ignore
diff --git a/bench/err570_parse_labelcommand.jnl b/bench/err570_parse_labelcommand.jnl
new file mode 100644
index 0000000..538ef47
--- /dev/null
+++ b/bench/err570_parse_labelcommand.jnl
@@ -0,0 +1,22 @@
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to 
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
diff --git a/bench/err570_poly_lonlat_axis.jnl b/bench/err570_poly_lonlat_axis.jnl
new file mode 100644
index 0000000..e570038
--- /dev/null
+++ b/bench/err570_poly_lonlat_axis.jnl
@@ -0,0 +1,21 @@
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7 
+!    Symbol not found              
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret. 
+
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10] 
+
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+
+PLOT/VS XT, YT
diff --git a/bench/err570_poly_over_julian.jnl b/bench/err570_poly_over_julian.jnl
new file mode 100644
index 0000000..2ab43d7
--- /dev/null
+++ b/bench/err570_poly_over_julian.jnl
@@ -0,0 +1,15 @@
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+
diff --git a/bench/err570_ppl_poly.jnl b/bench/err570_ppl_poly.jnl
new file mode 100644
index 0000000..f5a3b6c
--- /dev/null
+++ b/bench/err570_ppl_poly.jnl
@@ -0,0 +1,17 @@
+! err570_ppl_poly.jnl
+
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon 
+! to control the vector key, the numerical labels on 
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+
+let ypts = x/10
+let xpts = cos(x/10)
+
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
diff --git a/bench/err570_sh_dat_nan.jnl b/bench/err570_sh_dat_nan.jnl
new file mode 100644
index 0000000..c024241
--- /dev/null
+++ b/bench/err570_sh_dat_nan.jnl
@@ -0,0 +1,10 @@
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL 
+! crashed on trying to format value for the output buffer.   
+
+use nan_missing.nc
+show data/full
+
diff --git a/bench/err570_shakeylab.jnl b/bench/err570_shakeylab.jnl
new file mode 100644
index 0000000..8e15355
--- /dev/null
+++ b/bench/err570_shakeylab.jnl
@@ -0,0 +1,48 @@
+
+! err570_shakeylab.jnl
+! 7/6/2004
+
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+
+
+use coads_climatology
+ppl dfltfnt cr
+
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+set viewport vp_1
+
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl fill 
+
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl fill 
+
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl fill 
+
+!
+
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+set viewport vp_1
+
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl shade 
+
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl shade 
+
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ppl shade 
+
+
+ppl dfltfnt sr
diff --git a/bench/err570_singlecolor.jnl b/bench/err570_singlecolor.jnl
new file mode 100644
index 0000000..6593c68
--- /dev/null
+++ b/bench/err570_singlecolor.jnl
@@ -0,0 +1,38 @@
+! err570_singlecolor.jnl
+! 7/6/2004
+
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command 
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+
+! FILL doesnt make the graphics call to do the fil plot 
+! when there is just one level ...
+
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just 
+! one level.
+
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+
+
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
diff --git a/bench/err570_thick_colors.jnl b/bench/err570_thick_colors.jnl
new file mode 100644
index 0000000..5d7dca0
--- /dev/null
+++ b/bench/err570_thick_colors.jnl
@@ -0,0 +1,19 @@
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30) 
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+
diff --git a/bench/err570_time_range.jnl b/bench/err570_time_range.jnl
new file mode 100644
index 0000000..7109f78
--- /dev/null
+++ b/bench/err570_time_range.jnl
@@ -0,0 +1,16 @@
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+!  error message on this last command; noleap calendar not treated correctly.
diff --git a/bench/err580_arg_case.jnl b/bench/err580_arg_case.jnl
new file mode 100644
index 0000000..ce6fdd9
--- /dev/null
+++ b/bench/err580_arg_case.jnl
@@ -0,0 +1,13 @@
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+! 
+! key=CONTINUOUS and step=CONNECTED 
+! were not recognized if the value was in uppercase
+
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+
diff --git a/bench/err580_cal360_region.jnl b/bench/err580_cal360_region.jnl
new file mode 100644
index 0000000..daf34c1
--- /dev/null
+++ b/bench/err580_cal360_region.jnl
@@ -0,0 +1,9 @@
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated 
+
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+
diff --git a/bench/err580_cartesian_depth.jnl b/bench/err580_cartesian_depth.jnl
new file mode 100644
index 0000000..aaebfcf
--- /dev/null
+++ b/bench/err580_cartesian_depth.jnl
@@ -0,0 +1,8 @@
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down" 
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+
+use a_cartesian_bug1179.nc
+sh grid temp
diff --git a/bench/err580_cdb.jnl b/bench/err580_cdb.jnl
new file mode 100644
index 0000000..475bdf9
--- /dev/null
+++ b/bench/err580_cdb.jnl
@@ -0,0 +1,20 @@
+! err580_cdb.jnl
+! bug 1207
+
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.  
+! Instead it asked for a range above AND below the specified index. 
+! So result is missing when it should not be.
+
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+
+list var[i=15 at cdb:5]
+list var[i=14 at cdb:5]
+
+! These returned MISSING data with the bug, should not be missing.
+
+list var[i=15 at cdb:10]
+list var[i=15 at cib:10]
+list var[i=5 at cda:10]
+list var[i=5 at cia:10]
diff --git a/bench/err580_cdc_timeaxis.jnl b/bench/err580_cdc_timeaxis.jnl
new file mode 100644
index 0000000..455be56
--- /dev/null
+++ b/bench/err580_cdc_timeaxis.jnl
@@ -0,0 +1,37 @@
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations, 
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00 
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+
+
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+
+
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+
+sh axis tcdc
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+
diff --git a/bench/err580_def_t_norange.jnl b/bench/err580_def_t_norange.jnl
new file mode 100644
index 0000000..a2a01db
--- /dev/null
+++ b/bench/err580_def_t_norange.jnl
@@ -0,0 +1,8 @@
+! err580_def_t_norange.jnl
+! bug 1203. Without the T range, these statements cause a crash.
+!           There SHOULD be error messages, error in start,end,delta.
+
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
diff --git a/bench/err580_def_tax_norange.jnl b/bench/err580_def_tax_norange.jnl
new file mode 100644
index 0000000..d4581cb
--- /dev/null
+++ b/bench/err580_def_tax_norange.jnl
@@ -0,0 +1,7 @@
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
diff --git a/bench/err580_def_view_axes.jnl b/bench/err580_def_view_axes.jnl
new file mode 100644
index 0000000..921eb77
--- /dev/null
+++ b/bench/err580_def_view_axes.jnl
@@ -0,0 +1,30 @@
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+
+! Does not crash with Ferret v5.50 
+
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+
+set window/clear
+set mode metafile viewaxes.plt
+
+set view v1
+go ptest
+
+set window/clear
+
+can mode meta
+set mode meta
+
+set view v1
+shade/i=1:12/j=1:12 i+j
+
+can mode metafile
+sp rm -f viewaxes.plt*
+
diff --git a/bench/err580_irreg_bounds.jnl b/bench/err580_irreg_bounds.jnl
new file mode 100644
index 0000000..0cc199e
--- /dev/null
+++ b/bench/err580_irreg_bounds.jnl
@@ -0,0 +1,21 @@
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds, 
+! and then read it into Ferret.  When the file is read in, 
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+
+can data/all
+can var/all
+can mem
+
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
diff --git a/bench/err580_lev_del.jnl b/bench/err580_lev_del.jnl
new file mode 100644
index 0000000..0c03499
--- /dev/null
+++ b/bench/err580_lev_del.jnl
@@ -0,0 +1,11 @@
+! err580_lev_del.jnl    
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+show sym lev*
+
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+
+show sym lev*
diff --git a/bench/err580_long_dsettitle.jnl b/bench/err580_long_dsettitle.jnl
new file mode 100644
index 0000000..4a7f165
--- /dev/null
+++ b/bench/err580_long_dsettitle.jnl
@@ -0,0 +1,13 @@
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc 
+say `a,return=dsettitle`
+
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
diff --git a/bench/err580_long_title.jnl b/bench/err580_long_title.jnl
new file mode 100644
index 0000000..1d520fa
--- /dev/null
+++ b/bench/err580_long_title.jnl
@@ -0,0 +1,8 @@
+
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
diff --git a/bench/err580_long_veckey.jnl b/bench/err580_long_veckey.jnl
new file mode 100644
index 0000000..5cb23d6
--- /dev/null
+++ b/bench/err580_long_veckey.jnl
@@ -0,0 +1,10 @@
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
diff --git a/bench/err580_show_axis_t.jnl b/bench/err580_show_axis_t.jnl
new file mode 100644
index 0000000..c138b04
--- /dev/null
+++ b/bench/err580_show_axis_t.jnl
@@ -0,0 +1,12 @@
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar 
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+
+
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
diff --git a/bench/err580_strfloat_errors.jnl b/bench/err580_strfloat_errors.jnl
new file mode 100644
index 0000000..353509d
--- /dev/null
+++ b/bench/err580_strfloat_errors.jnl
@@ -0,0 +1,6 @@
+! err580_strfloat_errors.jnl     
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
diff --git a/bench/err580_use_des.jnl b/bench/err580_use_des.jnl
new file mode 100644
index 0000000..dd19246
--- /dev/null
+++ b/bench/err580_use_des.jnl
@@ -0,0 +1,5 @@
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+
+use vary_scale.des
+sh data
diff --git a/bench/err581_cal_dates_output.jnl b/bench/err581_cal_dates_output.jnl
new file mode 100644
index 0000000..2d673b7
--- /dev/null
+++ b/bench/err581_cal_dates_output.jnl
@@ -0,0 +1,14 @@
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv  
+
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005 
+set data t3file
+sho grid t3
diff --git a/bench/err581_cancel_data.jnl b/bench/err581_cancel_data.jnl
new file mode 100644
index 0000000..677642c
--- /dev/null
+++ b/bench/err581_cancel_data.jnl
@@ -0,0 +1,32 @@
+! err581_cancel_data.jnl
+
+!  test fixes for bug 1392: 
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+can data "subdir/a.nc"
+sh data
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
diff --git a/bench/err581_command_cx.jnl b/bench/err581_command_cx.jnl
new file mode 100644
index 0000000..fa65c18
--- /dev/null
+++ b/bench/err581_command_cx.jnl
@@ -0,0 +1,17 @@
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+let n = `temp,r=lsize`
+def ax/np=`n`/t=0:100 tax
+
+
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+
+can mode ignore
diff --git a/bench/err581_contour_zero_lev.jnl b/bench/err581_contour_zero_lev.jnl
new file mode 100644
index 0000000..b8d6ad6
--- /dev/null
+++ b/bench/err581_contour_zero_lev.jnl
@@ -0,0 +1,7 @@
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
diff --git a/bench/err581_define_1pt_bounds.jnl b/bench/err581_define_1pt_bounds.jnl
new file mode 100644
index 0000000..da60201
--- /dev/null
+++ b/bench/err581_define_1pt_bounds.jnl
@@ -0,0 +1,16 @@
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and 
+! the result is wrong.  Then we repeat the first multipoint axis definition 
+! again, and even that result is now very wrong!! Same results in both v5.81 
+! for Linux and v5.70 for Irix.
+
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
diff --git a/bench/err581_des_scale.jnl b/bench/err581_des_scale.jnl
new file mode 100644
index 0000000..ddeade9
--- /dev/null
+++ b/bench/err581_des_scale.jnl
@@ -0,0 +1,26 @@
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and 
+! a varriable has scale_factor and/or add_offset attributes, the 
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+
+EXIT/SCRIPT   ! error in namelist record...
+
+set data tok_short
+list/i=1:5 sst
+say `sst, return=nc_scale`
+say `sst, return=nc_off`
+
+can data/all; can mem
+
+!set data tnok_short
+!list/i=1:5 sst
+!say `sst, return=nc_scale`
+!say `sst, return=nc_offset`
diff --git a/bench/err581_exp_spaces.jnl b/bench/err581_exp_spaces.jnl
new file mode 100644
index 0000000..e046ccb
--- /dev/null
+++ b/bench/err581_exp_spaces.jnl
@@ -0,0 +1,22 @@
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator 
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+
+set mode ignore
+
+list 1.0e-5+ 0*7
+list 1.0e-5 + 0*7
+list 1.0e-5+0*7
+list 1000.6+ 0*7
+
+let xx= x[x=1:5]
+
+list 1.0e-5 + 0*xx
+list 1.0e-5 + 0*xx
+list 1.0e-5+0*xx
+
+can mode ignore
diff --git a/bench/err581_hlim_axislab.jnl b/bench/err581_hlim_axislab.jnl
new file mode 100644
index 0000000..b30ee19
--- /dev/null
+++ b/bench/err581_hlim_axislab.jnl
@@ -0,0 +1,15 @@
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS 
+! axis labels do not have longitude labelling
+
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis 
+
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis 
diff --git a/bench/err581_if_conditional.jnl b/bench/err581_if_conditional.jnl
new file mode 100644
index 0000000..25b1e04
--- /dev/null
+++ b/bench/err581_if_conditional.jnl
@@ -0,0 +1,79 @@
+! err581_if_conditional.jnl  bug 918. 
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+
+if 0 then
+let a = 1
+  if `a` then
+  say ok
+     if 1 then 
+        say "this is an inner if."
+        say "we should NOT see these lines"
+     endif
+  endif
+endif
+
+say "finished the if block"
+
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+
+define symbol xend -180
+let key_flag = 0
+
+IF `($xend) GT 360` THEN
+  SAY "point E1"
+  IF `key_flag EQ 0` THEN SAY "point E2"
+  IF `key_flag EQ 0` THEN SAY "point E2 with a comment"   ! comment after the IF command
+  SAY "point E3"
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+  SAY "point F"
+elif `dxymin lt 0.25` then
+  SAY "point G"
+endif
+
+
+
+! try yet another test with a nested block if, not executed.
+
+define symbol xend -180
+let key_flag = 0
+
+IF `($xend) GT 360` THEN
+  SAY "point E1"
+  IF `key_flag gt 0` THEN 
+     SAY "point E2"
+  ENDIF
+  SAY "point E3"
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+  SAY "point F"
+elif `dxymin lt 0.25` then
+  SAY "point G"
+endif
+
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+
+IF `($xend) GT 360` THEN
+   IF 1 THEN
+        say "this if block should not execute at all"
+   ELSE
+        say "this ELSE should ot execute either"
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+ENDIF
+
+! ELIF examples
+
+go non_std_refmap 122.0 228.5 5 5 xline 0
diff --git a/bench/err581_illegal_trans.jnl b/bench/err581_illegal_trans.jnl
new file mode 100644
index 0000000..4bc8ba6
--- /dev/null
+++ b/bench/err581_illegal_trans.jnl
@@ -0,0 +1,10 @@
+! err581_illegal_trans.jnl 
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+
diff --git a/bench/err581_list_stray_chars.jnl b/bench/err581_list_stray_chars.jnl
new file mode 100644
index 0000000..4f4138f
--- /dev/null
+++ b/bench/err581_list_stray_chars.jnl
@@ -0,0 +1,14 @@
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing 
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+
+list/i=1:5 id, type, country
+
+list/i=1:5 id, country, type
+
+
diff --git a/bench/err581_missing_scale_off.jnl b/bench/err581_missing_scale_off.jnl
new file mode 100644
index 0000000..0c9da55
--- /dev/null
+++ b/bench/err581_missing_scale_off.jnl
@@ -0,0 +1,12 @@
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+
+! data contains missing value flag of -999 and scale of 0.1 
+! Previously this resulted in data values of -99 where should be missing.
+
+use missing_scale_off.nc
+say `tt,return=bad`
+list tt
+
diff --git a/bench/err581_nlev.jnl b/bench/err581_nlev.jnl
new file mode 100644
index 0000000..82b57c2
--- /dev/null
+++ b/bench/err581_nlev.jnl
@@ -0,0 +1,8 @@
+! err580_nlev.jnl
+! bug 1279
+
+!FILL/lev=n var 
+! gave us exactly n levels, not approximately n levels.
+
+use coads_climatology
+fill/lev=30 sst[l=2]
diff --git a/bench/err581_noleap_mod.jnl b/bench/err581_noleap_mod.jnl
new file mode 100644
index 0000000..d61e996
--- /dev/null
+++ b/bench/err581_noleap_mod.jnl
@@ -0,0 +1,11 @@
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command  
+! when modulo-regridding a time-limited NOLEAP calendar 
+
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
diff --git a/bench/err581_poly_rev.jnl b/bench/err581_poly_rev.jnl
new file mode 100644
index 0000000..355b071
--- /dev/null
+++ b/bench/err581_poly_rev.jnl
@@ -0,0 +1,47 @@
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+
+! From Patrick, polygon/line on a depth axis 
+
+set mem /size=200
+
+use gt4d011
+
+shade temp[i=@ave,l=1]
+
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3} 
+
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3} 
+
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3} 
+
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+
+! And, from Andrew with other reversed axes. 
+
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+
+ppl cross 0
+
+set mem /size=25.6
diff --git a/bench/err581_shakey_inf.jnl b/bench/err581_shakey_inf.jnl
new file mode 100644
index 0000000..3749aad
--- /dev/null
+++ b/bench/err581_shakey_inf.jnl
@@ -0,0 +1,13 @@
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+
+ppl/reset  ! undo the SHAKEY setting.
+
diff --git a/bench/err581_sho_func_pattern_match.jnl b/bench/err581_sho_func_pattern_match.jnl
new file mode 100644
index 0000000..6304fcf
--- /dev/null
+++ b/bench/err581_sho_func_pattern_match.jnl
@@ -0,0 +1,10 @@
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+
+! Should list SIN and ASIN
+sh func *sin
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
diff --git a/bench/err581_since_units.jnl b/bench/err581_since_units.jnl
new file mode 100644
index 0000000..16a33a0
--- /dev/null
+++ b/bench/err581_since_units.jnl
@@ -0,0 +1,16 @@
+! err581_since_units.jnl
+! bug 1394: units of months_since_event 
+! the "since" causes Ferret to try to parse "event" as a 
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+list a
diff --git a/bench/err581_strrindex.jnl b/bench/err581_strrindex.jnl
new file mode 100644
index 0000000..6a27aef
--- /dev/null
+++ b/bench/err581_strrindex.jnl
@@ -0,0 +1,7 @@
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
diff --git a/bench/err581_subspanx_fill_bug.jnl b/bench/err581_subspanx_fill_bug.jnl
new file mode 100644
index 0000000..8f57290
--- /dev/null
+++ b/bench/err581_subspanx_fill_bug.jnl
@@ -0,0 +1,15 @@
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+
+set view left; shade/x=120e:80w sst  ! works correctly
+
+set view right; fill/x=120e:80w sst
+
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+
+sp rm -f err581_subspanx_fill_bug.nc
diff --git a/bench/err581_use_bounds.jnl b/bench/err581_use_bounds.jnl
new file mode 100644
index 0000000..1e83c61
--- /dev/null
+++ b/bench/err581_use_bounds.jnl
@@ -0,0 +1,10 @@
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+
+save/clobber/file=xyir.nc aa
+use xyir
diff --git a/bench/err581_vs_poly_axis.jnl b/bench/err581_vs_poly_axis.jnl
new file mode 100644
index 0000000..8b6f1f7
--- /dev/null
+++ b/bench/err581_vs_poly_axis.jnl
@@ -0,0 +1,18 @@
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
diff --git a/bench/err600_check_bounds_regular.jnl b/bench/err600_check_bounds_regular.jnl
new file mode 100644
index 0000000..4e94f78
--- /dev/null
+++ b/bench/err600_check_bounds_regular.jnl
@@ -0,0 +1,14 @@
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+
+! 19-Sep-2006 ACM
+
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
diff --git a/bench/err600_ferret_axis_names.jnl b/bench/err600_ferret_axis_names.jnl
new file mode 100644
index 0000000..607a524
--- /dev/null
+++ b/bench/err600_ferret_axis_names.jnl
@@ -0,0 +1,21 @@
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute 
+! orig_file_axname with the input name. That orig name is used only on output.
+
+def axis/t=1:5:1 time
+use coads_climatology
+
+! Note TIME1 with attribute orig_file_axname
+sh dat/att 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+
+use t2.nc; use t12.nc
+
+sho dat/att
diff --git a/bench/err600_if_comments_tab.jnl b/bench/err600_if_comments_tab.jnl
new file mode 100644
index 0000000..39ffedd
--- /dev/null
+++ b/bench/err600_if_comments_tab.jnl
@@ -0,0 +1,19 @@
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets 
+! thrown off and we got an error about an invalid ENDIF
+
+IF 0 THEN
+   LET a = 12
+   IF `a` THEN  ! a comment
+   	   say "variable a is defined"
+   ENDIF
+ENDIF
+
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   LET a = 12
+   IF `a` THEN	! a comment
+   	   say "variable a is defined"
+   ENDIF
+ENDIF
diff --git a/bench/err600_let_d.jnl b/bench/err600_let_d.jnl
new file mode 100644
index 0000000..ef9f810
--- /dev/null
+++ b/bench/err600_let_d.jnl
@@ -0,0 +1,10 @@
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of 
+! variable names was incorrect.
+! 28-Nov-2006
+
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+list ..varnames
diff --git a/bench/err600_long_bounds_name.jnl b/bench/err600_long_bounds_name.jnl
new file mode 100644
index 0000000..1c93f0c
--- /dev/null
+++ b/bench/err600_long_bounds_name.jnl
@@ -0,0 +1,16 @@
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+
+
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+
+save/clobber/file=a.nc var
+can var/all
+
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+
diff --git a/bench/err600_long_symbol_string.jnl b/bench/err600_long_symbol_string.jnl
new file mode 100644
index 0000000..f7b91a3
--- /dev/null
+++ b/bench/err600_long_symbol_string.jnl
@@ -0,0 +1,23 @@
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+
+! Define a long symbol and use it in a function call
+
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+
+LIST STRINDEX(($longsym_a),($longsym_b))
+
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+
+SHOW SYMBOL longsym_1000
+
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+SHOW SYMBOL longsym_very_long
+
+CANCEL SYMBOL longsym*
diff --git a/bench/err600_missing_flag.jnl b/bench/err600_missing_flag.jnl
new file mode 100644
index 0000000..880e899
--- /dev/null
+++ b/bench/err600_missing_flag.jnl
@@ -0,0 +1,9 @@
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+
+use noglobalhistory.nc
+list b
+
+! should be 0,1,2,3; bug had first value missing.
+
diff --git a/bench/err600_nc_des_order.jnl b/bench/err600_nc_des_order.jnl
new file mode 100644
index 0000000..9a1cb5e
--- /dev/null
+++ b/bench/err600_nc_des_order.jnl
@@ -0,0 +1,22 @@
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+
+stat rose[d=2]
+
+can data/all
+
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+
+stat rose[j=12,d=1]
diff --git a/bench/err600_reset_redefine_axis.jnl b/bench/err600_reset_redefine_axis.jnl
new file mode 100644
index 0000000..5d332c6
--- /dev/null
+++ b/bench/err600_reset_redefine_axis.jnl
@@ -0,0 +1,43 @@
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+
+use coads_climatology
+def sym timeax = `sst,return=taxis` 
+
+show att/all ($timeax)
+show axis ($timeax)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+show att/all ($timeax)
+show axis ($timeax)
+
+! Changing axis with the SET AXIS command
+
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis` 
+show att/all ($timeax)
+show axis ($timeax)
+
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+show att/all ($timeax)
+show axis ($timeax)
+
+
+! Changing axis with the CANCEL AXIS/ command
+
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis` 
+def sym zax = `temp,return=zaxis` 
+show att/all ($timeax)
+show axis ($zax)
+
+cancel axis/modulo ($timeax)
+show att/all ($timeax)
+show axis ($timeax)
+cancel axis/depth ($zax)
+show att/all ($zax)
+show axis ($zax)
+
diff --git a/bench/err600_returnsize.jnl b/bench/err600_returnsize.jnl
new file mode 100644
index 0000000..3dc546e
--- /dev/null
+++ b/bench/err600_returnsize.jnl
@@ -0,0 +1,13 @@
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+
+
+use coads_climatology.cdf
+
+say `sst[d=coads_climatology.cdf],return=size`
+say `sst.units,return=size`
+
+define symbol the_x_axis = `sst,return=xaxis`
+say `(($the_x_axis)).units,return=size`
diff --git a/bench/err600_save_two.jnl b/bench/err600_save_two.jnl
new file mode 100644
index 0000000..5df9730
--- /dev/null
+++ b/bench/err600_save_two.jnl
@@ -0,0 +1,11 @@
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
diff --git a/bench/err600_set_var_title.jnl b/bench/err600_set_var_title.jnl
new file mode 100644
index 0000000..c8a3337
--- /dev/null
+++ b/bench/err600_set_var_title.jnl
@@ -0,0 +1,17 @@
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06 
+
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units 
+ list/y=1/k=1/l=1 temp
diff --git a/bench/err600_tab_comma_missingdat.jnl b/bench/err600_tab_comma_missingdat.jnl
new file mode 100644
index 0000000..c201c3b
--- /dev/null
+++ b/bench/err600_tab_comma_missingdat.jnl
@@ -0,0 +1,16 @@
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+list/form=comma a,b,a
+
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+list/form=tab a,b,a
diff --git a/bench/err600_upcase.jnl b/bench/err600_upcase.jnl
new file mode 100644
index 0000000..a93013a
--- /dev/null
+++ b/bench/err600_upcase.jnl
@@ -0,0 +1,17 @@
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+
+SET MODE ignore_error
+
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
diff --git a/bench/err600_upcase.nc b/bench/err600_upcase.nc
new file mode 100644
index 0000000..1c5632b
Binary files /dev/null and b/bench/err600_upcase.nc differ
diff --git a/bench/err600_var_label.jnl b/bench/err600_var_label.jnl
new file mode 100644
index 0000000..0114f23
--- /dev/null
+++ b/bench/err600_var_label.jnl
@@ -0,0 +1,20 @@
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+
+use gtbc011
+
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+
+can data/all
+use a.nc
+sh att/all temp
+
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
diff --git a/bench/err600_vec_aspect.jnl b/bench/err600_vec_aspect.jnl
new file mode 100644
index 0000000..ad2ce99
--- /dev/null
+++ b/bench/err600_vec_aspect.jnl
@@ -0,0 +1,16 @@
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+
+! Irregular axes
+
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
diff --git a/bench/err601_check_missing_3arg.jnl b/bench/err601_check_missing_3arg.jnl
new file mode 100644
index 0000000..400da94
--- /dev/null
+++ b/bench/err601_check_missing_3arg.jnl
@@ -0,0 +1,28 @@
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+shade/i=50:100 HT,lon,lat
+
+! The STAT command loads all the coordinates, then when 
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was 
+! X coordinates missing value where val is needed
+
+can mem/all
+stat LON, LAT
+shade/i=50:100 HT,lon,lat
+
+sp rm -f tripolar_missing_lon.nc
+
diff --git a/bench/err601_index_111.jnl b/bench/err601_index_111.jnl
new file mode 100644
index 0000000..9208e1a
--- /dev/null
+++ b/bench/err601_index_111.jnl
@@ -0,0 +1,10 @@
+
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+
diff --git a/bench/err601_irregular_axis.jnl b/bench/err601_irregular_axis.jnl
new file mode 100644
index 0000000..4a9bbca
--- /dev/null
+++ b/bench/err601_irregular_axis.jnl
@@ -0,0 +1,7 @@
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
diff --git a/bench/err601_missing_string_element.jnl b/bench/err601_missing_string_element.jnl
new file mode 100644
index 0000000..ca81a5c
--- /dev/null
+++ b/bench/err601_missing_string_element.jnl
@@ -0,0 +1,6 @@
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+
+let a = {"a", "b",  }
+list a
diff --git a/bench/err601_sho_ax_xml_calendar.jnl b/bench/err601_sho_ax_xml_calendar.jnl
new file mode 100644
index 0000000..c20e034
--- /dev/null
+++ b/bench/err601_sho_ax_xml_calendar.jnl
@@ -0,0 +1,10 @@
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
diff --git a/bench/err602_curvi_modulo_cut.jnl b/bench/err602_curvi_modulo_cut.jnl
new file mode 100644
index 0000000..3c2f0a4
--- /dev/null
+++ b/bench/err602_curvi_modulo_cut.jnl
@@ -0,0 +1,16 @@
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to 
+! be some inconsistency in plotting across the modulo cut.  SHADE omits 
+! the half-cells that ought to touch the modulo cut.  FILL looks like 
+! it's tryingto interpolate across the cut, but something's wrong.
+
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
diff --git a/bench/err602_list_prec.jnl b/bench/err602_list_prec.jnl
new file mode 100644
index 0000000..45c5891
--- /dev/null
+++ b/bench/err602_list_prec.jnl
@@ -0,0 +1,22 @@
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+
+use gt4d011.cdf
+
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+
diff --git a/bench/err602_shade_line_lev.jnl b/bench/err602_shade_line_lev.jnl
new file mode 100644
index 0000000..7886335
--- /dev/null
+++ b/bench/err602_shade_line_lev.jnl
@@ -0,0 +1,14 @@
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+set view ur; shade/lev a; sh sym lev*
+set view ll; shade/line/key a; sh sym lev*
+set view lr; shade/lev a; sh sym lev*
diff --git a/bench/err604_irreg_axis.jnl b/bench/err604_irreg_axis.jnl
new file mode 100644
index 0000000..fc3cdc9
--- /dev/null
+++ b/bench/err604_irreg_axis.jnl
@@ -0,0 +1,6 @@
+! Bug 1524: irregular axis detected as REGULAR!
+
+!use climatological_axes
+sh ax MONTH_IRREG
+list t[gt=month_irreg], tbox[gt=month_irreg]
+
diff --git a/bench/err605_show_func.jnl b/bench/err605_show_func.jnl
new file mode 100644
index 0000000..7b32824
--- /dev/null
+++ b/bench/err605_show_func.jnl
@@ -0,0 +1,7 @@
+! err605_show_func.jnl
+! Reported by Andrew W. 
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+
+SHOW FUNCTION/BRIEF
+
diff --git a/bench/err607_axis_minmax_syms.jnl b/bench/err607_axis_minmax_syms.jnl
new file mode 100644
index 0000000..7e499bc
--- /dev/null
+++ b/bench/err607_axis_minmax_syms.jnl
@@ -0,0 +1,16 @@
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation 
+
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+plot/y=35 plotvar/10000000; sh sym yax*
+plot/y=35 plotvar*10000000; sh sym yax*
+
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+
+
diff --git a/bench/err607_lev_errmsg.jnl b/bench/err607_lev_errmsg.jnl
new file mode 100644
index 0000000..c9315b5
--- /dev/null
+++ b/bench/err607_lev_errmsg.jnl
@@ -0,0 +1,8 @@
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+
+SET MODE/LAST ignore
diff --git a/bench/err607_set_new_history_att.jnl b/bench/err607_set_new_history_att.jnl
new file mode 100644
index 0000000..8e12550
--- /dev/null
+++ b/bench/err607_set_new_history_att.jnl
@@ -0,0 +1,14 @@
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that 
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+
+can data/all
+use a.nc
+show data
+show att/all var
diff --git a/bench/err607_show_var_xml.jnl b/bench/err607_show_var_xml.jnl
new file mode 100644
index 0000000..e158846
--- /dev/null
+++ b/bench/err607_show_var_xml.jnl
@@ -0,0 +1,15 @@
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+
+
+use gt4d011.cdf
+use coads_climatology
+
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+
+! This shows all 3 vars
+show var
+
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
diff --git a/bench/err608_bug1556.jnl b/bench/err608_bug1556.jnl
new file mode 100644
index 0000000..a09a249
--- /dev/null
+++ b/bench/err608_bug1556.jnl
@@ -0,0 +1,21 @@
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE 
+! in a separate Ferret session to see the bug.
+! 
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+
diff --git a/bench/err608_bug1556.nc b/bench/err608_bug1556.nc
new file mode 100644
index 0000000..3ba538a
Binary files /dev/null and b/bench/err608_bug1556.nc differ
diff --git a/bench/err608_precision_neg_numbers.jnl b/bench/err608_precision_neg_numbers.jnl
new file mode 100644
index 0000000..63023be
--- /dev/null
+++ b/bench/err608_precision_neg_numbers.jnl
@@ -0,0 +1,11 @@
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+SAY `1.23456789e-15,prec=10`
diff --git a/bench/err611_axislab.jnl b/bench/err611_axislab.jnl
new file mode 100644
index 0000000..149ad61
--- /dev/null
+++ b/bench/err611_axislab.jnl
@@ -0,0 +1,10 @@
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+
diff --git a/bench/err611_context_after_error.jnl b/bench/err611_context_after_error.jnl
new file mode 100644
index 0000000..5b8f0aa
--- /dev/null
+++ b/bench/err611_context_after_error.jnl
@@ -0,0 +1,33 @@
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after 
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod] 
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+
+
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+
+SHOW DATA
+SHOW AXIS LON88_88
+SHOW AXIS LAT45_45
+SHOW AXIS MON_IRREG_NLP
+
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+SHOW AXIS LAT45_45
+SHOW AXIS MON_IRREG_NLP
+
+SET MODE/LAST ignore_error
diff --git a/bench/err611_convert_missing_type.jnl b/bench/err611_convert_missing_type.jnl
new file mode 100644
index 0000000..4ea0752
--- /dev/null
+++ b/bench/err611_convert_missing_type.jnl
@@ -0,0 +1,18 @@
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of 
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+
+! Save some data and read it in as a delimited file
+
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+
+! On this SAVE, previously got a NOTE about converting the type of the 
+! missing-value attribute to match the type of the variable.
+
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
diff --git a/bench/err611_digit_filename.jnl b/bench/err611_digit_filename.jnl
new file mode 100644
index 0000000..c75f0e3
--- /dev/null
+++ b/bench/err611_digit_filename.jnl
@@ -0,0 +1,10 @@
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+
+! bug 287 (never had a benchmark test)
+
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+SHOW DATA
diff --git a/bench/err611_ef_string_result.jnl b/bench/err611_ef_string_result.jnl
new file mode 100644
index 0000000..e8067bd
--- /dev/null
+++ b/bench/err611_ef_string_result.jnl
@@ -0,0 +1,21 @@
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+! 
+
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+
+! Combine tax_datestring call with *cat_str function
+
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+
+let xt = xcat_str(v, yr)
+list xt
+
diff --git a/bench/err611_exit_if.jnl b/bench/err611_exit_if.jnl
new file mode 100644
index 0000000..72fef3f
--- /dev/null
+++ b/bench/err611_exit_if.jnl
@@ -0,0 +1,15 @@
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug 
+! Fixed in xeq_exit.F
+
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
diff --git a/bench/err611_irregular_axis.jnl b/bench/err611_irregular_axis.jnl
new file mode 100644
index 0000000..c0047c8
--- /dev/null
+++ b/bench/err611_irregular_axis.jnl
@@ -0,0 +1,20 @@
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+
+! Previous versions of this detected the axis as regular.
+
+use cc_irreg.nc
+sh grid cc
+
diff --git a/bench/err611_isize_gc_fcns.jnl b/bench/err611_isize_gc_fcns.jnl
new file mode 100644
index 0000000..40e4de2
--- /dev/null
+++ b/bench/err611_isize_gc_fcns.jnl
@@ -0,0 +1,25 @@
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+
+LET a = {1,2,3,4,5,6}
+
+! Should be 6
+SAY `a,RETURN=isize`
+SAY `XSEQUENCE(a),RETURN=isize`
+
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+SAY `XSEQUENCE(a),RETURN=size`
diff --git a/bench/err611_ov_ax.jnl b/bench/err611_ov_ax.jnl
new file mode 100644
index 0000000..724d6bc
--- /dev/null
+++ b/bench/err611_ov_ax.jnl
@@ -0,0 +1,16 @@
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
diff --git a/bench/err611_parse_semicolon.jnl b/bench/err611_parse_semicolon.jnl
new file mode 100644
index 0000000..e191f8a
--- /dev/null
+++ b/bench/err611_parse_semicolon.jnl
@@ -0,0 +1,11 @@
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+
+say "c ; d"
+say "c //d"
+say "c (d"
+say "c (d"; say "a ; b"
+say "c (d; say a ; b"
+
diff --git a/bench/err611_polygons.jnl b/bench/err611_polygons.jnl
new file mode 100644
index 0000000..644d9b9
--- /dev/null
+++ b/bench/err611_polygons.jnl
@@ -0,0 +1,15 @@
+! err611_polygons.jnl
+! bug 1661
+
+! Polygons over a depth axis, where the 
+! plot is transposed, didnt appear.
+
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+
diff --git a/bench/err611_return_precision.jnl b/bench/err611_return_precision.jnl
new file mode 100644
index 0000000..099227b
--- /dev/null
+++ b/bench/err611_return_precision.jnl
@@ -0,0 +1,63 @@
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+
+say "a`95,p=1`"
+say "a`94,p=1`"
+say "a`95,p=1`"
+say "a`949,p=1`"
+say "a`950,p=1`"
+
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+say "a`94,p=0`"
+say "a`95,p=0`"
+say "a`949,p=0`"
+say "a`950,p=0`"
+
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+
+say "a`-95,p=1`"
+say "a`-95.99,p=1`"
+say "a`-95.001,p=1`"
+
+say "a`-94,p=1`"
+say "a`-94.99,p=1`"
+say "a`-94.001,p=1`"
+
+say "a`-95,p=1`"
+say "a`-95.99,p=1`"
+say "a`-95.001,p=1`"
+
+say "a`-949,p=1`"
+say "a`-949.99,p=1`"
+say "a`-949.001,p=1`"
+
+say "a`-950,p=1`"
+say "a`-950.99,p=1`"
+say "a`-950.001,p=1`"
+
+
+say "a`-95,p=0`"
+say "a`-95.99,p=0`"
+say "a`-95.001,p=0`"
+
+say "a`-94,p=0`"
+say "a`-94.99,p=0`"
+say "a`-94.001,p=0`"
+
+say "a`-95,p=0`"
+say "a`-95.99,p=0`"
+say "a`-95.001,p=0`"
+
+say "a`-949,p=0`"
+say "a`-949.99,p=0`"
+say "a`-949.001,p=0`"
+
+say "a`-950,p=0`"
+say "a`-950.99,p=0`"
+say "a`-950.001,p=0`"
diff --git a/bench/err611_save_from_desc.jnl b/bench/err611_save_from_desc.jnl
new file mode 100644
index 0000000..13dbdaa
--- /dev/null
+++ b/bench/err611_save_from_desc.jnl
@@ -0,0 +1,7 @@
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with 
+!  ** netCDF error: Failed creating coord variable %%
+
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
diff --git a/bench/err611_save_irreg.jnl b/bench/err611_save_irreg.jnl
new file mode 100644
index 0000000..6dfe639
--- /dev/null
+++ b/bench/err611_save_irreg.jnl
@@ -0,0 +1,14 @@
+! err611_save_irreg.jnl
+!
+! bug1587  
+
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+save/clob/file=b.nc b
diff --git a/bench/err611_set_uvar_outtyp.jnl b/bench/err611_set_uvar_outtyp.jnl
new file mode 100644
index 0000000..413f69a
--- /dev/null
+++ b/bench/err611_set_uvar_outtyp.jnl
@@ -0,0 +1,18 @@
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+
+
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+
diff --git a/bench/err611_set_var_ez.jnl b/bench/err611_set_var_ez.jnl
new file mode 100644
index 0000000..cac429c
--- /dev/null
+++ b/bench/err611_set_var_ez.jnl
@@ -0,0 +1,31 @@
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+
diff --git a/bench/err611_shade_fill_levs.jnl b/bench/err611_shade_fill_levs.jnl
new file mode 100644
index 0000000..2f6101f
--- /dev/null
+++ b/bench/err611_shade_fill_levs.jnl
@@ -0,0 +1,9 @@
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different 
+! sets of levels. They should be the same.
+
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+
+
diff --git a/bench/err611_wrong_fineaxis_range.jnl b/bench/err611_wrong_fineaxis_range.jnl
new file mode 100644
index 0000000..b7aa7b0
--- /dev/null
+++ b/bench/err611_wrong_fineaxis_range.jnl
@@ -0,0 +1,28 @@
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725, 
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index 
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+
+! File saved from 
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+
+use fine_x_axis
+sh grid sst
+
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+
+list/i=7200 sst
+list/x=-180 sst
+list/i=1 sst
+
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
diff --git a/bench/err618_julday.jnl b/bench/err618_julday.jnl
new file mode 100644
index 0000000..366b8f4
--- /dev/null
+++ b/bench/err618_julday.jnl
@@ -0,0 +1,20 @@
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
diff --git a/bench/err61_360_calendar.jnl b/bench/err61_360_calendar.jnl
new file mode 100644
index 0000000..d948b64
--- /dev/null
+++ b/bench/err61_360_calendar.jnl
@@ -0,0 +1,11 @@
+! err61_360_calendar.jnl
+!
+
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+
diff --git a/bench/err61_context_scalar_strings.jnl b/bench/err61_context_scalar_strings.jnl
new file mode 100644
index 0000000..0aa0dd4
--- /dev/null
+++ b/bench/err61_context_scalar_strings.jnl
@@ -0,0 +1,8 @@
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+
+say `"a" EQ "a"`
+set grid ez
+say `"a" EQ "a"`
+
diff --git a/bench/err61_contour_subspan_reps.jnl b/bench/err61_contour_subspan_reps.jnl
new file mode 100644
index 0000000..4f44a32
--- /dev/null
+++ b/bench/err61_contour_subspan_reps.jnl
@@ -0,0 +1,33 @@
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis, 
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo 
+! axis coordinates are supplied on the positive vs. the negative modulo branch. 
+
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+
+! Now region in negative x
+
+can dat/all; can var/all
+
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
diff --git a/bench/err61_exit_script.jnl b/bench/err61_exit_script.jnl
new file mode 100644
index 0000000..29ab9a1
--- /dev/null
+++ b/bench/err61_exit_script.jnl
@@ -0,0 +1,30 @@
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+! 
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+
+!        NOAA/PMEL TMAP
+!        FERRET v6.08  
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32     
+
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+rep/l=1:7 go b1566.jnl
+
+!!  IFs nested too deep
+
+rep/l=1:7 go b1566.jnl
+rep/l=1:7 go b1566.jnl
+
+
diff --git a/bench/err61_new_attr_on_axis.jnl b/bench/err61_new_attr_on_axis.jnl
new file mode 100644
index 0000000..65f31c9
--- /dev/null
+++ b/bench/err61_new_attr_on_axis.jnl
@@ -0,0 +1,22 @@
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+
+use ocean_atlas_temp
+sh dat
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+
+DEFINE att/output (yaxis).standard_name = "latitude" 
+
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+
diff --git a/bench/err61_poly_shade_over_noaxes.jnl b/bench/err61_poly_shade_over_noaxes.jnl
new file mode 100644
index 0000000..3ab2904
--- /dev/null
+++ b/bench/err61_poly_shade_over_noaxes.jnl
@@ -0,0 +1,49 @@
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! shade/over/i=1:2/j=0:2/patt i+j
+shade/over/i=1:2/j=0:2/opac=25 i+j
+
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! fill/over/i=1:2/j=0:2/patt i+j
+fill/over/i=1:2/j=0:2/opac=25 i+j
+
+can view
+
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+
+! Polygon over fill 
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2 
diff --git a/bench/err61_show_dat_var_xml.jnl b/bench/err61_show_dat_var_xml.jnl
new file mode 100644
index 0000000..d02a065
--- /dev/null
+++ b/bench/err61_show_dat_var_xml.jnl
@@ -0,0 +1,39 @@
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a 
+! variable that uses a grid-changing function should be 
+! skipped when writing variables by SHOW DATA/VAR/XML
+
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+
+! Now use this data and define a user variable 
+! associated with datset 2 using ZAXREPLACE
+
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+
+! Note how there are intermediate variables associated with the 
+! regridding operation
+
+SHOW DATA 2
+
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML 
+
+SHOW DATA/VAR/XML 2
diff --git a/bench/err61_write_bounds.jnl b/bench/err61_write_bounds.jnl
new file mode 100644
index 0000000..628810e
--- /dev/null
+++ b/bench/err61_write_bounds.jnl
@@ -0,0 +1,25 @@
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
diff --git a/bench/err62_append_irreg_to_reg.jnl b/bench/err62_append_irreg_to_reg.jnl
new file mode 100644
index 0000000..ad34b4b
--- /dev/null
+++ b/bench/err62_append_irreg_to_reg.jnl
@@ -0,0 +1,28 @@
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+
+! See Patrick's report: 
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+
+SET MODE IGNORE
+
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+
+! previously the message just said 
+! ** netCDF error: Variable not found
+
+! Msg should explain that it was the bounds variable, needed 
+! for the append, but not found in the existing file.
+
+SET MODE/LAST IGNORE
diff --git a/bench/err62_axis_stride_off.jnl b/bench/err62_axis_stride_off.jnl
new file mode 100644
index 0000000..5c9ee04
--- /dev/null
+++ b/bench/err62_axis_stride_off.jnl
@@ -0,0 +1,24 @@
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+
+USE truemonth.nc
+
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+
+CAN AXIS/STRIDE `var,return=taxis`
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth 
+
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth 
+
+SET MODE/LAST IGNORE
+
+
+
diff --git a/bench/err62_compound_string_conditional.jnl b/bench/err62_compound_string_conditional.jnl
new file mode 100644
index 0000000..28cc8ac
--- /dev/null
+++ b/bench/err62_compound_string_conditional.jnl
@@ -0,0 +1,13 @@
+! err62_compound_string_conditional
+! Bug 1380
+
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+
+LIST "a" EQ "b"
+LIST "b" EQ "b"
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
diff --git a/bench/err62_contourbug.jnl b/bench/err62_contourbug.jnl
new file mode 100644
index 0000000..4da8902
--- /dev/null
+++ b/bench/err62_contourbug.jnl
@@ -0,0 +1,18 @@
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+
diff --git a/bench/err62_cos_lat_uncentered.jnl b/bench/err62_cos_lat_uncentered.jnl
new file mode 100644
index 0000000..e6b22d9
--- /dev/null
+++ b/bench/err62_cos_lat_uncentered.jnl
@@ -0,0 +1,34 @@
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+
+use uncentered.nc
+define grid/like=test grd
+
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+list cell2[x=@din,y=@din]/total_area
+list cell3[x=@din,y=@din]/total_area
+list cell4[x=@din,y=@din]/total_area
+list cell5[x=@din,y=@din]/total_area
+list cell18[x=@din,y=@din]/total_area
diff --git a/bench/err62_if_inside_repeat.jnl b/bench/err62_if_inside_repeat.jnl
new file mode 100644
index 0000000..33db2cd
--- /dev/null
+++ b/bench/err62_if_inside_repeat.jnl
@@ -0,0 +1,220 @@
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+
+! the fix for this bug causes a worse bug for GFDL (see #1706). 
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+
+cancel mode verify
+
+say "test1"
+if 0 then
+  repeat/RANGE=1:2 (if 0 then; say "  hello1"; endif)
+endif
+
+say "test2"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 0 then;\
+      say "  hello2"; endif)
+endif
+
+say "test3"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 0 then;\
+      say "  hello3";\
+    endif)
+endif
+
+say Now try the same tests with IF 1 inside the REPEATs
+
+say "test4"
+if 0 then
+  repeat/RANGE=1:2 (if 1 then; say "  hello4"; endif)
+endif
+
+say "test5"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello5"; endif)
+endif
+
+say "test6"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello6";\
+    endif)
+endif
+
+say Now try the same tests with IF 1 to execute everything.
+
+say "test7"
+if 1 then
+  repeat/RANGE=1:2 (if 1 then; say "  hello7"; endif)
+endif
+
+say "test8"
+if 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello8"; endif)
+endif
+
+say "test9"
+if 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello9";\
+    endif)
+endif
+
+say Now try the same tests with IF 1 and ELSE.
+
+say "test10"
+if 1 then
+  repeat/RANGE=1:2 (if 1 then; say "  hello10"; endif)
+else
+  repeat/RANGE=1:2 (if 1 then; say "  else10"; endif)
+endif
+
+say "test11"
+if 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello11"; endif)
+else
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  else11"; endif)
+endif
+
+say "test12"
+if 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello12";\
+    endif)
+else
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello12";\
+    endif)
+endif
+
+say Now try the same tests with IF 0 and ELSE.
+
+say "test13"
+if 0 then
+  repeat/RANGE=1:2 (if 1 then; say "  hello13"; endif)
+else
+  repeat/RANGE=1:2 (if 1 then; say "  else13"; endif)
+endif
+
+say "test14"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello14"; endif)
+else
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  else14"; endif)
+endif
+
+say "test15"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello15";\
+    endif)
+else
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  else15";\
+    endif)
+endif
+
+
+say Now try the same tests with IF 0 and ELIF.
+
+say "test16"
+if 0 then
+  repeat/RANGE=1:2 (if 1 then; say "  hello16"; endif)
+elif 1 then
+  repeat/RANGE=1:2 (if 1 then; say "  elif16"; endif)
+endif
+
+say "test17"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello17"; endif)
+elif 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  elif17"; endif)
+endif
+
+say "test18"
+if 0 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  hello18";\
+    endif)
+elif 1 then
+  repeat/RANGE=1:2 (\
+    if 1 then;\
+      say "  elif18";\
+    endif)
+endif
+
+! Here are the bugs that were caused by the original fix 
+! to bug 1681, and which are in Ferret v6.3;
+! but which werent detected by the benchmarks
+
+SAY "Next should a line that says --->here"
+say "And then    a line that says 201."
+
+! 1706 The second block is never reached; the output should be
+! "here".
+
+def sym a say hi\; say hi
+
+IF 0 THEN
+   say not
+ENDIF
+
+IF 1 THEN
+   say --->here
+ENDIF
+
+! And this, similar to what caused troubles in the LAS scripts,
+! the continuation marks were misinterpreted so the ENDIF was never
+! reached and we never hit the say "done".
+
+
+IF 0 then
+   IF `3 GT 4` THEN \
+     LIST/NOHEADER/NOROWHEADER \
+       1 + 2
+ENDIF
+
+IF 1 THEN
+   IF `3 GT 4` THEN \
+     LIST/NOHEADER/NOROWHEADER \
+       12*8
+ENDIF
+
+IF 1 THEN
+   IF `6 GT 4` THEN \
+     LIST/NOHEADER/NOROWHEADER \
+       3*67
+ENDIF
+
+say "done"
+set mode/last verify
diff --git a/bench/err62_levset.jnl b/bench/err62_levset.jnl
new file mode 100644
index 0000000..999ec3c
--- /dev/null
+++ b/bench/err62_levset.jnl
@@ -0,0 +1,7 @@
+! err62_levset.jnl 
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+
diff --git a/bench/err62_one_point_bounds.jnl b/bench/err62_one_point_bounds.jnl
new file mode 100644
index 0000000..cc3769d
--- /dev/null
+++ b/bench/err62_one_point_bounds.jnl
@@ -0,0 +1,15 @@
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the 
+! correct bounds (but instead saved coord+/- 0.5)
+
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
diff --git a/bench/err62_reset_after_inf.jnl b/bench/err62_reset_after_inf.jnl
new file mode 100644
index 0000000..50d7ff9
--- /dev/null
+++ b/bench/err62_reset_after_inf.jnl
@@ -0,0 +1,15 @@
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+
+set mode meta closed_lev.plt
+
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+
diff --git a/bench/err62_reversed_up.jnl b/bench/err62_reversed_up.jnl
new file mode 100644
index 0000000..ca8f301
--- /dev/null
+++ b/bench/err62_reversed_up.jnl
@@ -0,0 +1,16 @@
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would 
+! just use midpts between coordinates as edges
+
+use lev_rev_up.nc
+
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
diff --git a/bench/err62_samplexy.jnl b/bench/err62_samplexy.jnl
new file mode 100644
index 0000000..ba3934c
--- /dev/null
+++ b/bench/err62_samplexy.jnl
@@ -0,0 +1,19 @@
+! err62_samplexy
+! bug 1677
+
+use coads_climatology
+
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+
+use xz
+
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+
+! previously the middle 3 points of this were missing.
+list sr
+
diff --git a/bench/err62_save_missingcoordvar.jnl b/bench/err62_save_missingcoordvar.jnl
new file mode 100644
index 0000000..005096c
--- /dev/null
+++ b/bench/err62_save_missingcoordvar.jnl
@@ -0,0 +1,12 @@
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+
diff --git a/bench/err62_string_write.nc b/bench/err62_string_write.nc
new file mode 100644
index 0000000..ea092f2
Binary files /dev/null and b/bench/err62_string_write.nc differ
diff --git a/bench/err62_string_write_nc.jnl b/bench/err62_string_write_nc.jnl
new file mode 100644
index 0000000..49b9607
--- /dev/null
+++ b/bench/err62_string_write_nc.jnl
@@ -0,0 +1,44 @@
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+! 
+
+!!!! Make a smaller file from the original file:
+
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+
+let I1d = i[g=cruise_no]
+
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+let mask = MISSING(cm1, cm2)
+
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT 
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+list/i=1:10 cruise_id_xz
+
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+
+! Check the file
+canc var/all
+use a.nc
+
+! Should be the same strings as above.
+list cruise_id_xz
diff --git a/bench/err62_thick_tic_time_axis.jnl b/bench/err62_thick_tic_time_axis.jnl
new file mode 100644
index 0000000..5a95f7d
--- /dev/null
+++ b/bench/err62_thick_tic_time_axis.jnl
@@ -0,0 +1,45 @@
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes 
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+
+
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+
+! Check that we get the thick dark black line for the tics on 
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+
+can win/all
+set win/new
+
+set mode meta timetics2.plt
+
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+
+
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+
+can mode linecolors
+can win/all
+set win/new
+
diff --git a/bench/err62_title_curvi_plot.jnl b/bench/err62_title_curvi_plot.jnl
new file mode 100644
index 0000000..dce2cd8
--- /dev/null
+++ b/bench/err62_title_curvi_plot.jnl
@@ -0,0 +1,25 @@
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
diff --git a/bench/err63_days1900toydmhms.jnl b/bench/err63_days1900toydmhms.jnl
new file mode 100644
index 0000000..dd8d6eb
--- /dev/null
+++ b/bench/err63_days1900toydmhms.jnl
@@ -0,0 +1,11 @@
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
diff --git a/bench/err63_delim_E.jnl b/bench/err63_delim_E.jnl
new file mode 100644
index 0000000..1a8987a
--- /dev/null
+++ b/bench/err63_delim_E.jnl
@@ -0,0 +1,22 @@
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes. 
+! But need to check if its just a string ending in E such as ZAIRE
+
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
diff --git a/bench/err63_log_vaxis.jnl b/bench/err63_log_vaxis.jnl
new file mode 100644
index 0000000..7f9cdb9
--- /dev/null
+++ b/bench/err63_log_vaxis.jnl
@@ -0,0 +1,14 @@
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+
+
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
diff --git a/bench/err64_packed_data.jnl b/bench/err64_packed_data.jnl
new file mode 100644
index 0000000..6f758a2
--- /dev/null
+++ b/bench/err64_packed_data.jnl
@@ -0,0 +1,27 @@
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+
+! ncpdq from NCO operators 
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted. 
+
+set var/outtype=float sst
+
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+
+list/i=1:15 sst
+
diff --git a/bench/err64_packed_data.nc b/bench/err64_packed_data.nc
new file mode 100644
index 0000000..5c6d21b
Binary files /dev/null and b/bench/err64_packed_data.nc differ
diff --git a/bench/err64_parse_equals.jnl b/bench/err64_parse_equals.jnl
new file mode 100644
index 0000000..0794228
--- /dev/null
+++ b/bench/err64_parse_equals.jnl
@@ -0,0 +1,11 @@
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within 
+! grave accents. 
+
+say `"+" EQ " "`
+
+say `"=" EQ "="`
+
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+
diff --git a/bench/err64_polymark_over_calendar.jnl b/bench/err64_polymark_over_calendar.jnl
new file mode 100644
index 0000000..cc2c3de
--- /dev/null
+++ b/bench/err64_polymark_over_calendar.jnl
@@ -0,0 +1,13 @@
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+poly/ov/nolab/line=15 pos,pos      ! this works
+
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+
diff --git a/bench/err64_regrid_noleap.jnl b/bench/err64_regrid_noleap.jnl
new file mode 100644
index 0000000..e114c98
--- /dev/null
+++ b/bench/err64_regrid_noleap.jnl
@@ -0,0 +1,19 @@
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+
+list b  ! includes Feb 15 1150, not missing...
+
+list b[t=15-feb-1150]  ! Now ok??
diff --git a/bench/err64_return_precision.jnl b/bench/err64_return_precision.jnl
new file mode 100644
index 0000000..3bc5741
--- /dev/null
+++ b/bench/err64_return_precision.jnl
@@ -0,0 +1,16 @@
+!err64_return_precision.jnl 
+! most of these resulted in *** - format too small.
+! see bug1611
+
+say `.099,p=-1`
+
+say `.99,p=-1`
+
+say `9.99,p=-1`
+
+say `99.99,p=-1`
+
+say `999.99,p=-1`
+
+say `999.999,p=-2`
+
diff --git a/bench/err64_shakey_missingdata.jnl b/bench/err64_shakey_missingdata.jnl
new file mode 100644
index 0000000..0097108
--- /dev/null
+++ b/bench/err64_shakey_missingdata.jnl
@@ -0,0 +1,20 @@
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194  
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+
diff --git a/bench/err64_small_latlon.nc b/bench/err64_small_latlon.nc
new file mode 100644
index 0000000..6d37909
Binary files /dev/null and b/bench/err64_small_latlon.nc differ
diff --git a/bench/err64_very_small_latlon.jnl b/bench/err64_very_small_latlon.jnl
new file mode 100644
index 0000000..ad0ce45
--- /dev/null
+++ b/bench/err64_very_small_latlon.jnl
@@ -0,0 +1,10 @@
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+
+use err64_small_latlon
+
+! crashed because of formats for lon/lat axis labels.
+shade bathy  
+
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
diff --git a/bench/err65_averages.jnl b/bench/err65_averages.jnl
new file mode 100644
index 0000000..5663b6e
--- /dev/null
+++ b/bench/err65_averages.jnl
@@ -0,0 +1,12 @@
+
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+
+stat temp[x=@ave,z=@ave]
+
+list temp[x=@ave,z=@ave,t=@ave]
+
+stat temp[z=@ave,t=@ave,y=-2:2]
+
+cancel region
diff --git a/bench/err65_dots_in_dashes.jnl b/bench/err65_dots_in_dashes.jnl
new file mode 100644
index 0000000..8540efa
--- /dev/null
+++ b/bench/err65_dots_in_dashes.jnl
@@ -0,0 +1,16 @@
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and 
+! metafile batch mode
+
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+
+cancel mode meta
+
diff --git a/bench/err65_read_epic_cdf.jnl b/bench/err65_read_epic_cdf.jnl
new file mode 100644
index 0000000..c081571
--- /dev/null
+++ b/bench/err65_read_epic_cdf.jnl
@@ -0,0 +1,8 @@
+! Ned Cokelet reports that the time coordinate is read incorrectly 
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+
diff --git a/bench/err664_tax_fcns.jnl b/bench/err664_tax_fcns.jnl
new file mode 100644
index 0000000..c5ed935
--- /dev/null
+++ b/bench/err664_tax_fcns.jnl
@@ -0,0 +1,23 @@
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+
+! 1765 Functions did not test for missing data.
+ 
+
+! tax_ functions 
+use gt4d011
+let tval = t[gt=temp]
+
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+
+! 1766 tax_year retured 0 for year 0001
+
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
diff --git a/bench/err664_xml_keep_case.jnl b/bench/err664_xml_keep_case.jnl
new file mode 100644
index 0000000..59a46d5
--- /dev/null
+++ b/bench/err664_xml_keep_case.jnl
@@ -0,0 +1,24 @@
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of 
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases: 
+! upper case axis TIME 
+! lower case axis zt, variable temp 
+! mixed case axes grid_x_T, grid_y_T
+
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+
+use a_cartesian_bug1179.nc
+sh var/xml
+
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+
diff --git a/bench/err664_xml_one_point_axis.jnl b/bench/err664_xml_one_point_axis.jnl
new file mode 100644
index 0000000..ace74ae
--- /dev/null
+++ b/bench/err664_xml_one_point_axis.jnl
@@ -0,0 +1,21 @@
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+
+USE a_cartesian_bug1179.nc
+SH DAT
+
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+
+CANCEL VAR a
+
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+
diff --git a/bench/err665_centered_lev.jnl b/bench/err665_centered_lev.jnl
new file mode 100644
index 0000000..0610c31
--- /dev/null
+++ b/bench/err665_centered_lev.jnl
@@ -0,0 +1,16 @@
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
diff --git a/bench/err665_din.jnl b/bench/err665_din.jnl
new file mode 100644
index 0000000..7526973
--- /dev/null
+++ b/bench/err665_din.jnl
@@ -0,0 +1,41 @@
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1 
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+
+
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
diff --git a/bench/err665_hours_since_T.jnl b/bench/err665_hours_since_T.jnl
new file mode 100644
index 0000000..aca4e5c
--- /dev/null
+++ b/bench/err665_hours_since_T.jnl
@@ -0,0 +1,10 @@
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to 
+! be written with a T between the date and time parts, 
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+
+use hourst.nc
+sh axis/all hourax
diff --git a/bench/err665_sum_4d_labels.jnl b/bench/err665_sum_4d_labels.jnl
new file mode 100644
index 0000000..d99b54c
--- /dev/null
+++ b/bench/err665_sum_4d_labels.jnl
@@ -0,0 +1,6 @@
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
diff --git a/bench/err667_5d_netcdf.jnl b/bench/err667_5d_netcdf.jnl
new file mode 100644
index 0000000..32c340a
--- /dev/null
+++ b/bench/err667_5d_netcdf.jnl
@@ -0,0 +1,11 @@
+exit/script  ! this test is not valid for 6D Ferret.
+
+
+! err66_5d_netcdf.jnl
+! see ticket 1848.  If more than 4D for numeric or 5D for strings, issue a warning and
+! ignore the variable.
+
+use nc5d.nc
+use string5d.nc
+show data
+
diff --git a/bench/err667_att_too_long.jnl b/bench/err667_att_too_long.jnl
new file mode 100644
index 0000000..571afd4
--- /dev/null
+++ b/bench/err667_att_too_long.jnl
@@ -0,0 +1,8 @@
+! err667_att_too_long.jnl 
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang 
+
+use toolong.nc
+sh dat/att
+save/file=aa.nc/clobber sfco2
+
diff --git a/bench/err667_dup_axnames.jnl b/bench/err667_dup_axnames.jnl
new file mode 100644
index 0000000..f3a5341
--- /dev/null
+++ b/bench/err667_dup_axnames.jnl
@@ -0,0 +1,26 @@
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+
+save/clob/file="gh.nc" g[d=1], h[d=2]
+
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1. 
+! If there is not a duplicate name in the output file, we want to write H with 
+! the original axis name. Check for that. 
+
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
diff --git a/bench/err667_mode_desperate.jnl b/bench/err667_mode_desperate.jnl
new file mode 100644
index 0000000..e75820c
--- /dev/null
+++ b/bench/err667_mode_desperate.jnl
@@ -0,0 +1,22 @@
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+
+set mode ignore
+
+! setting too large
+set mode desperate `9999999999`
+show mode desperate
+
+! another setting too large (previously value 
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+show mode desperate
+can mode ignore
diff --git a/bench/err667_show_var_twice.jnl b/bench/err667_show_var_twice.jnl
new file mode 100644
index 0000000..2235ebc
--- /dev/null
+++ b/bench/err667_show_var_twice.jnl
@@ -0,0 +1,13 @@
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+
+use coads_climatology
+sh var sst[d=1]
+sh var sst[d=1]
+
+!should return nothing
+sh var airt
+
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+sh var airt2[d=1]
\ No newline at end of file
diff --git a/bench/err667_string_if.jnl b/bench/err667_string_if.jnl
new file mode 100644
index 0000000..24ca67e
--- /dev/null
+++ b/bench/err667_string_if.jnl
@@ -0,0 +1,13 @@
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+! 
+
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+
+
diff --git a/bench/err66_all_missing_lev_v.jnl b/bench/err66_all_missing_lev_v.jnl
new file mode 100644
index 0000000..3600eb7
--- /dev/null
+++ b/bench/err66_all_missing_lev_v.jnl
@@ -0,0 +1,7 @@
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
diff --git a/bench/err672_axis_label_prec.jnl b/bench/err672_axis_label_prec.jnl
new file mode 100644
index 0000000..b32ee2e
--- /dev/null
+++ b/bench/err672_axis_label_prec.jnl
@@ -0,0 +1,29 @@
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels 
+! for some cases where the range is between -1 and 1.
+
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+
+can view
+
+! Here are more variables that caused similar
+! inadequate precision in the format.
+
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1 
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
diff --git a/bench/err672_axis_order.jnl b/bench/err672_axis_order.jnl
new file mode 100644
index 0000000..43e4bfc
--- /dev/null
+++ b/bench/err672_axis_order.jnl
@@ -0,0 +1,13 @@
+! err672_axis_order   
+! See comment 5 under ticket 1774.
+
+
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+list/k=3/i=1 ucov[d=2]
+
diff --git a/bench/err672_dset_cx.jnl b/bench/err672_dset_cx.jnl
new file mode 100644
index 0000000..4156ba6
--- /dev/null
+++ b/bench/err672_dset_cx.jnl
@@ -0,0 +1,41 @@
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+! 
+
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+
+can var/all; can dat/all
+
+! It's already strange that the first axis is named AX002 and the second AX001, 
+! but oh well. Let's use the first dataset, and list the axis values in two ways 
+! that give identical answers. No problem here.
+
+use a1
+list x[gx=a[d=1]]
+list x[gx=a[d=1,i=1:3]]
+
+! Next we use the second dataset, and repeat the exact same commands as above -- 
+! note that we are again listing the variables from the first dataset, not the 
+! second one. Our results shouldn't have changed, since they explicitly refer to 
+! dataset 1 -- but one of them does change!
+
+use a2
+
+list x[gx=a[d=1]]
+
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+
+! The second LIST has somehow associated variable A from the first file 
+! with AX001 from the second file!
+! 
+! The only thing that the second USE should have changed about Ferret's state, 
+! was that it brought a new dataset into memory and made it the default. Why should 
+! that have affected the second evaluation of the variable from dataset 1?
+
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
diff --git a/bench/err672_long_show_axis.jnl b/bench/err672_long_show_axis.jnl
new file mode 100644
index 0000000..8169261
--- /dev/null
+++ b/bench/err672_long_show_axis.jnl
@@ -0,0 +1,7 @@
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+can axis huge
+
diff --git a/bench/err672_runoff_page.jnl b/bench/err672_runoff_page.jnl
new file mode 100644
index 0000000..b8eb83c
--- /dev/null
+++ b/bench/err672_runoff_page.jnl
@@ -0,0 +1,16 @@
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if 
+! MODE shrink_ylab is set. (ticket 1958)
+
+SET MODE shrink_ylab
+
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+
+SET MODE/LAST shrink_ylab
diff --git a/bench/err672_samplexy_modulo.jnl b/bench/err672_samplexy_modulo.jnl
new file mode 100644
index 0000000..8254029
--- /dev/null
+++ b/bench/err672_samplexy_modulo.jnl
@@ -0,0 +1,20 @@
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+
+
+
diff --git a/bench/err672_stray_line.jnl b/bench/err672_stray_line.jnl
new file mode 100644
index 0000000..34f5c0b
--- /dev/null
+++ b/bench/err672_stray_line.jnl
@@ -0,0 +1,16 @@
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer 
+! corners of the plot, either from the bottom to the left side 
+! of the plot, or from the top to the left, but not crossing 
+! any axis, may cause a stray line to be drawn outward from the 
+! corner.
+
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
diff --git a/bench/err672_subscr_precision.jnl b/bench/err672_subscr_precision.jnl
new file mode 100644
index 0000000..cb4ceea
--- /dev/null
+++ b/bench/err672_subscr_precision.jnl
@@ -0,0 +1,10 @@
+! err672_subscr_precision.jnl
+! See ticket 1888. 
+
+
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
diff --git a/bench/err672_tax_functions_prec.jnl b/bench/err672_tax_functions_prec.jnl
new file mode 100644
index 0000000..10fca10
--- /dev/null
+++ b/bench/err672_tax_functions_prec.jnl
@@ -0,0 +1,64 @@
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+
+
+set mode ignore
+
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+list/l=1:7 TAX_jday(t[gt=var], var)
+list/l=1:7 TAX_month(t[gt=var], var)
+list/l=1:7 TAX_year(t[gt=var], var)
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values 
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+
+list/l=1:7 TAX_DAY(t[gt=var], var)
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+list/l=1:7 TAX_jday(t[gt=var], var)
+list/l=1:7 TAX_month(t[gt=var], var)
+list/l=1:7 TAX_year(t[gt=var], var)
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+
+list/prec=7 a
+list/prec=7 b
+list/prec=7 c
+
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+
+list/prec=7 a
+list/prec=7 b
+list/prec=7 c
+
+can mode ignore
\ No newline at end of file
diff --git a/bench/err672_varnames.jnl b/bench/err672_varnames.jnl
new file mode 100644
index 0000000..cb9e12c
--- /dev/null
+++ b/bench/err672_varnames.jnl
@@ -0,0 +1,26 @@
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+
+SET MODE IGNORE
+
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+
+CAN MODE IGNORE
diff --git a/bench/err672_vert_axislabel.jnl b/bench/err672_vert_axislabel.jnl
new file mode 100644
index 0000000..b97836d
--- /dev/null
+++ b/bench/err672_vert_axislabel.jnl
@@ -0,0 +1,26 @@
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+
+! starting w/ v683, shrink yaxis lab size only if 
+! MODE shrink_ylab is set. (ticket 1958)
+
+SET MODE shrink_ylab
+
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+
+use gt4d011
+plot/x=130w psi[t=@din]
+
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+
+go margins "reset"
+
+SET MODE/LAST shrink_ylab
diff --git a/bench/err67_axis_order.nc b/bench/err67_axis_order.nc
new file mode 100644
index 0000000..9a78ebe
Binary files /dev/null and b/bench/err67_axis_order.nc differ
diff --git a/bench/err67_nrst_trans.jnl b/bench/err67_nrst_trans.jnl
new file mode 100644
index 0000000..d3900ef
--- /dev/null
+++ b/bench/err67_nrst_trans.jnl
@@ -0,0 +1,10 @@
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform 
+! missed points - no valid data was returned from this LIST.
+
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
diff --git a/bench/err67_regridding_dyn.jnl b/bench/err67_regridding_dyn.jnl
new file mode 100644
index 0000000..f57598a
--- /dev/null
+++ b/bench/err67_regridding_dyn.jnl
@@ -0,0 +1,40 @@
+! err67_regridding_dyn.jnl 
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+
+can dat/all; can mem; can var/all;
+
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
diff --git a/bench/err67_reverse_bounds.jnl b/bench/err67_reverse_bounds.jnl
new file mode 100644
index 0000000..e84c0c0
--- /dev/null
+++ b/bench/err67_reverse_bounds.jnl
@@ -0,0 +1,8 @@
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
diff --git a/bench/err67_save_append_open.jnl b/bench/err67_save_append_open.jnl
new file mode 100644
index 0000000..98a1c5e
--- /dev/null
+++ b/bench/err67_save_append_open.jnl
@@ -0,0 +1,25 @@
+! err67_save_append_open.jnl
+! ticket 1832   
+! SAVE to a file that's open for reading
+
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+
+! The dataset still shows just the original contents
+sh dat
+can dat/all
+
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
diff --git a/bench/err67_tax_modtime.jnl b/bench/err67_tax_modtime.jnl
new file mode 100644
index 0000000..e4412e9
--- /dev/null
+++ b/bench/err67_tax_modtime.jnl
@@ -0,0 +1,18 @@
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar) 
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
diff --git a/bench/err681_dims_direction.jnl b/bench/err681_dims_direction.jnl
new file mode 100644
index 0000000..6abfc69
--- /dev/null
+++ b/bench/err681_dims_direction.jnl
@@ -0,0 +1,25 @@
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't 
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+
+use dims_not_coord
+sh dat
+sho grid lon_c
diff --git a/bench/err682_append_packed.jnl b/bench/err682_append_packed.jnl
new file mode 100644
index 0000000..49a734b
--- /dev/null
+++ b/bench/err682_append_packed.jnl
@@ -0,0 +1,18 @@
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+
+can data/all
+use a.nc
+
+list temp  ! values should match those above.
+
+set mode/last upcase_output
diff --git a/bench/err682_axis_no_clue.jnl b/bench/err682_axis_no_clue.jnl
new file mode 100644
index 0000000..b1f0883
--- /dev/null
+++ b/bench/err682_axis_no_clue.jnl
@@ -0,0 +1,8 @@
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are 
+! TEMP(zax, sax, xax). The grid should be XYZ but 
+! Ferret v6.82 created a grid thats XZT instead.
+
+use xsz.nc
+sh dat
diff --git a/bench/err682_grid_merge.jnl b/bench/err682_grid_merge.jnl
new file mode 100644
index 0000000..3b59bd1
--- /dev/null
+++ b/bench/err682_grid_merge.jnl
@@ -0,0 +1,12 @@
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+
diff --git a/bench/err682_if_yes_exit.jnl b/bench/err682_if_yes_exit.jnl
new file mode 100644
index 0000000..ab8d8fa
--- /dev/null
+++ b/bench/err682_if_yes_exit.jnl
@@ -0,0 +1,19 @@
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle 
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+
+let test = 1
+if `test` then exit
+say Should not have gotten here since test =  `test`  but we did
+exit
+
+!if `test` then exit/script  ! This also works
+if `test` then
+exit
+endif
+say Should not have gotten here since test =  `test`  and we did not.
diff --git a/bench/err682_scale_no_offset.jnl b/bench/err682_scale_no_offset.jnl
new file mode 100644
index 0000000..be803a9
--- /dev/null
+++ b/bench/err682_scale_no_offset.jnl
@@ -0,0 +1,21 @@
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+
+
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+use tripolar_subset
+can dat 2
+
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+load sst_rms
+
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
diff --git a/bench/err682_scale_no_offset.nc b/bench/err682_scale_no_offset.nc
new file mode 100644
index 0000000..9436702
Binary files /dev/null and b/bench/err682_scale_no_offset.nc differ
diff --git a/bench/err682_shrink_axlab.jnl b/bench/err682_shrink_axlab.jnl
new file mode 100644
index 0000000..3e1be5f
--- /dev/null
+++ b/bench/err682_shrink_axlab.jnl
@@ -0,0 +1,23 @@
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+
+set mode shrink_ylab
+
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1} 
+
+set mode/last shrink_ylab
+
diff --git a/bench/err682_use_no_quotes.jnl b/bench/err682_use_no_quotes.jnl
new file mode 100644
index 0000000..a4bc6d2
--- /dev/null
+++ b/bench/err682_use_no_quotes.jnl
@@ -0,0 +1,9 @@
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+
+SET MODE ignore
+use ./z1.nc
+
+CANCEL MODE ignore
diff --git a/bench/err682_xact_high_prec.jnl b/bench/err682_xact_high_prec.jnl
new file mode 100644
index 0000000..5aa9ebb
--- /dev/null
+++ b/bench/err682_xact_high_prec.jnl
@@ -0,0 +1,46 @@
+! err682_xact_high_prec.jnl
+! based on an example from the Users List, 
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+
+! shows that the @XACT regridding in double-precision Ferret is broken.
+
+
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too 
+! much matching precision.
+
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+
+! Here we got no good data, should be one at 7:54:36.
+
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+
diff --git a/bench/err6842_context_shape.jnl b/bench/err6842_context_shape.jnl
new file mode 100644
index 0000000..41f2c16
--- /dev/null
+++ b/bench/err6842_context_shape.jnl
@@ -0,0 +1,34 @@
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and 
+! see err68_context_shape.jnl
+
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+
+use coads_climatology
+
+! All the returns in this script should say XYT
+
+! Here the second used to just say XY
+
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+say `b,ret=shape`
+
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+say `b,ret=shape`
+
+! The second used to just say XY
+! and the third said XY
+
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+say `b,ret=shape`
+say `c,ret=shape`
+
diff --git a/bench/err684_FillValue_xml.jnl b/bench/err684_FillValue_xml.jnl
new file mode 100644
index 0000000..79ce1ec
--- /dev/null
+++ b/bench/err684_FillValue_xml.jnl
@@ -0,0 +1,13 @@
+! err684_FillValue_xml.jnl
+! ACM 6/2013 
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+
+use fill_value_int.nc
+sh dat/var/xml
diff --git a/bench/err684_axticlab.jnl b/bench/err684_axticlab.jnl
new file mode 100644
index 0000000..f9ee2bc
--- /dev/null
+++ b/bench/err684_axticlab.jnl
@@ -0,0 +1,15 @@
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+
+set mode meta axticlabel.plt
+
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+
diff --git a/bench/err684_cancel_att.jnl b/bench/err684_cancel_att.jnl
new file mode 100644
index 0000000..7970b90
--- /dev/null
+++ b/bench/err684_cancel_att.jnl
@@ -0,0 +1,10 @@
+! err684_cancel_att.jnl
+! Fix bug 2048: cancel attribute of a user-defined variable
+
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+
+can att sst2.history
+sh att sst2
diff --git a/bench/err684_context_shape.jnl b/bench/err684_context_shape.jnl
new file mode 100644
index 0000000..496a87c
--- /dev/null
+++ b/bench/err684_context_shape.jnl
@@ -0,0 +1,18 @@
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+
+! The fix is to simulate this action inside of INTERP_CONTEXT
+
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+say `sst[l=@ave],ret=shape`
+
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+say `b,ret=shape`
diff --git a/bench/err684_define_grid.jnl b/bench/err684_define_grid.jnl
new file mode 100644
index 0000000..94849e7
--- /dev/null
+++ b/bench/err684_define_grid.jnl
@@ -0,0 +1,12 @@
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+
diff --git a/bench/err684_degC_axlab.jnl b/bench/err684_degC_axlab.jnl
new file mode 100644
index 0000000..cc99d2a
--- /dev/null
+++ b/bench/err684_degC_axlab.jnl
@@ -0,0 +1,15 @@
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+
+set mode/last meta
+set mode/last logo
diff --git a/bench/err684_delimited_precision.jnl b/bench/err684_delimited_precision.jnl
new file mode 100644
index 0000000..2ed95a0
--- /dev/null
+++ b/bench/err684_delimited_precision.jnl
@@ -0,0 +1,17 @@
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+
diff --git a/bench/err684_dotstart.jnl b/bench/err684_dotstart.jnl
new file mode 100644
index 0000000..2bce8dd
--- /dev/null
+++ b/bench/err684_dotstart.jnl
@@ -0,0 +1,20 @@
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+
+set mode ignore
+
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+
+! Just a dot is interpretd as a number.
+list .
+
+set mode/last ignore
diff --git a/bench/err684_evnt_z.jnl b/bench/err684_evnt_z.jnl
new file mode 100644
index 0000000..a43d78a
--- /dev/null
+++ b/bench/err684_evnt_z.jnl
@@ -0,0 +1,16 @@
+! err684_evnt_z.jnl
+! see ticket 2054
+
+! Result of @EVNT is correct in x direction
+
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+
+! Should be same in the Z direction:
+
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+
+
diff --git a/bench/err684_label_quotes.jnl b/bench/err684_label_quotes.jnl
new file mode 100644
index 0000000..decdf68
--- /dev/null
+++ b/bench/err684_label_quotes.jnl
@@ -0,0 +1,22 @@
+! err684_label_quotes.jnl
+! See ticket 1298. 
+
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+
+
+! Here is the example from the ticket
+
+! This is ok
+say "'hello'"
+
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
diff --git a/bench/err684_line_plot_zero.jnl b/bench/err684_line_plot_zero.jnl
new file mode 100644
index 0000000..3b3142b
--- /dev/null
+++ b/bench/err684_line_plot_zero.jnl
@@ -0,0 +1,7 @@
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot. 
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0 
+
+plot {0,0,0}
+sh sym yaxis*
+
diff --git a/bench/err684_null_stringwrite.jnl b/bench/err684_null_stringwrite.jnl
new file mode 100644
index 0000000..6efe668
--- /dev/null
+++ b/bench/err684_null_stringwrite.jnl
@@ -0,0 +1,18 @@
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+
+! Write just a null value resulted in a NetCDF library error
+
+set mode ignore
+let anull = avar[i=2]
+
+save/clobber/file=a.nc anull
+set mode/last ignore
+
diff --git a/bench/err684_packed_output.jnl b/bench/err684_packed_output.jnl
new file mode 100644
index 0000000..9cdae6c
--- /dev/null
+++ b/bench/err684_packed_output.jnl
@@ -0,0 +1,16 @@
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+
+use err684_packed_output.nc
+list/i=1:3 sst
+
+! data is SHORT, is not scaled
+
+save/clobber/file=sst_new.nc sst 
+
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+
diff --git a/bench/err684_packed_output.nc b/bench/err684_packed_output.nc
new file mode 100644
index 0000000..b4cda36
Binary files /dev/null and b/bench/err684_packed_output.nc differ
diff --git a/bench/err684_repeated_coordindates.jnl b/bench/err684_repeated_coordindates.jnl
new file mode 100644
index 0000000..ea651c2
--- /dev/null
+++ b/bench/err684_repeated_coordindates.jnl
@@ -0,0 +1,5 @@
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+
+use latestOb.nc
+
diff --git a/bench/err684_save_expression.jnl b/bench/err684_save_expression.jnl
new file mode 100644
index 0000000..2520af6
--- /dev/null
+++ b/bench/err684_save_expression.jnl
@@ -0,0 +1,44 @@
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined 
+! as a user-variable, the variable didn't have missing_value and _FillValue 
+! attributes and was written as single-precision float.
+
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+
+! Double check the missing-value matches what is written.
+
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+
+can dat 2
+
+! Can we ask to save as another data type? 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to 
+! data type so will fail.
+
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+
+can dat 2
+
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to 
+! data type so will return an error.
+
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+
+set mode/last ignore
diff --git a/bench/err684_save_subset.jnl b/bench/err684_save_subset.jnl
new file mode 100644
index 0000000..7b7d1be
--- /dev/null
+++ b/bench/err684_save_subset.jnl
@@ -0,0 +1,8 @@
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+
+! previously gave a message about inconsistent coords
+
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+
diff --git a/bench/err684_string_dim_name.jnl b/bench/err684_string_dim_name.jnl
new file mode 100644
index 0000000..5f210b1
--- /dev/null
+++ b/bench/err684_string_dim_name.jnl
@@ -0,0 +1,10 @@
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+
diff --git a/bench/err684_tax_fcns.jnl b/bench/err684_tax_fcns.jnl
new file mode 100644
index 0000000..61c66d4
--- /dev/null
+++ b/bench/err684_tax_fcns.jnl
@@ -0,0 +1,28 @@
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+
+ let var = t[gt=tday]
+
+
+ list/L=3:7 tax_datestring(var, var, "second")
+
+ list/L=3:7 tax_day(var, var)
+
+ list/L=3:7 tax_dayfrac(var, var)
+
+ list/L=3:7 tax_jday(var, var)
+ 
+ list/L=3:7 tax_jday1900(var, var)
+ 
+ list/L=3:7 tax_month(var, var)
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+ 
+ list/L=3:7 tax_year(var, var)
+
diff --git a/bench/err684_vfine_to_coarse.jnl b/bench/err684_vfine_to_coarse.jnl
new file mode 100644
index 0000000..a6a93a9
--- /dev/null
+++ b/bench/err684_vfine_to_coarse.jnl
@@ -0,0 +1,77 @@
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[gx=v at ave]
+
+
+! Y direction
+can var/all
+
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[gy=v at ave]
+
+
+! Z direction
+can var/all
+
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[gz=v at ave]
+
+
+! T direction
+can var/all
+
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[gt=v at ave]
+
+
+! E direction
+can var/all
+
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[ge=v at ave]
+
+
+
+! F direction
+can var/all
+
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+
+list v_coarse
+list v eq v_coarse[gf=v at ave]
diff --git a/bench/err685_lowercaseAxis.jnl b/bench/err685_lowercaseAxis.jnl
new file mode 100644
index 0000000..27fc7b7
--- /dev/null
+++ b/bench/err685_lowercaseAxis.jnl
@@ -0,0 +1,27 @@
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands 
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+
+use lowercaseTime.nc
+sh dat
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+
+! All this was correct
+show axis uppercasetime
+show grid bb
+
+! This variable has axis time, lowercase in the file
+sh grid aa
+set axis/t0=1-jan-2001/units=days time
+
+! showed no output
+show axis time
+
+! The axis did get changed but is inconsistently listed in the 
+! internal arrays that store axis info.
+
+list/L=1:5 aa
+
+
diff --git a/bench/err685_ppl_palette.jnl b/bench/err685_ppl_palette.jnl
new file mode 100644
index 0000000..5f5d2e6
--- /dev/null
+++ b/bench/err685_ppl_palette.jnl
@@ -0,0 +1,29 @@
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+
+pal  bluescale.spk  
+use levitus_climatology; shade/k=1 temp
+
+! pyferret does not yet support patterns
+! pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+
+pal   default
+! pyferret does not yet support patterns
+! pattern   solid
+
+fill sst[l=@ave]
+! pyferret does not yet support patterns
+! pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+
+! restore defaults
+palette default
+! pyferret does not yet support patterns
+! pattern solid
diff --git a/bench/err685_redefine_uvar_att.jnl b/bench/err685_redefine_uvar_att.jnl
new file mode 100644
index 0000000..8a838b3
--- /dev/null
+++ b/bench/err685_redefine_uvar_att.jnl
@@ -0,0 +1,8 @@
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on, 
+!   returned a runtime error.
+
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
diff --git a/bench/err685_ribbon_by_val.jnl b/bench/err685_ribbon_by_val.jnl
new file mode 100644
index 0000000..ca48113
--- /dev/null
+++ b/bench/err685_ribbon_by_val.jnl
@@ -0,0 +1,11 @@
+! err685_ribbon_by_val.jnl
+! 11/21/2013 
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+
diff --git a/bench/err685_samplexy.jnl b/bench/err685_samplexy.jnl
new file mode 100644
index 0000000..6fccb7d
--- /dev/null
+++ b/bench/err685_samplexy.jnl
@@ -0,0 +1,10 @@
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error 
+! sending sub-range of variable into samplexy
+
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+
diff --git a/bench/err685_shade_set.jnl b/bench/err685_shade_set.jnl
new file mode 100644
index 0000000..4192e96
--- /dev/null
+++ b/bench/err685_shade_set.jnl
@@ -0,0 +1,36 @@
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+
+can dat/all
+
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the 
+! epression being SHADED, inside a SHADE/SET 
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ppl shade !GAVE A BLANK PLOT
+
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ppl shade !and this works
+
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ppl shade !and this works
+
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+
+can var/all; can mem
+can axis timax
+set mode/last logo
diff --git a/bench/err685_show_grid_e.jnl b/bench/err685_show_grid_e.jnl
new file mode 100644
index 0000000..87fa650
--- /dev/null
+++ b/bench/err685_show_grid_e.jnl
@@ -0,0 +1,12 @@
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+sh grid /e gensy
+sh grid /f gensy
+
diff --git a/bench/err685_use_no_extension.jnl b/bench/err685_use_no_extension.jnl
new file mode 100644
index 0000000..9407931
--- /dev/null
+++ b/bench/err685_use_no_extension.jnl
@@ -0,0 +1,24 @@
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+
+! The directory contains files with all three extensions
+sp ls duplicate.*
+
+! The one that's used is .nc
+use duplicate
+sh dat
+
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+
+! Specify a nonexistent file, no extension
+use nosuchfile
+
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+
+use snoopy.dat
+
+set mode/last ignore
diff --git a/bench/err686_cancel_invalid_var.jnl b/bench/err686_cancel_invalid_var.jnl
new file mode 100644
index 0000000..7b96d83
--- /dev/null
+++ b/bench/err686_cancel_invalid_var.jnl
@@ -0,0 +1,17 @@
+! err686_cancel_invalid_var
+! ticket 2159
+
+! The cancel variable ran into an incorrect setting 
+! for variable-in-memory 
+
+set mode ignore
+let b = 1
+shade b
+
+set mode/last ignore
+cancel var b
+
+! Shade plot of a less-than-one cell region. Its where the bug came from.
+use coads_climatology
+shade/x=161.1:161.3/y=0.2:0.4/L=1 sst
+
diff --git a/bench/err686_dup_axnames.jnl b/bench/err686_dup_axnames.jnl
new file mode 100644
index 0000000..6444a16
--- /dev/null
+++ b/bench/err686_dup_axnames.jnl
@@ -0,0 +1,47 @@
+! err686_dup_axnames
+! Ticket 1750
+!
+! Make some datasets. Same axis length and name, 
+! different coordinates.
+
+def ax/x=1:4:1 xaxis_test
+let a = x[gx=xaxis_test]
+save/clob/file=a.nc a
+def ax/x=11:14:1 xaxis_test
+let b = x[gx=xaxis_test]
+save/clob/file=b.nc b
+can var/all; can dat/all
+
+! Check axis coords.
+use a; use b
+sh dat
+sh grid a[d=1]
+sh grid b[d=2]
+
+! Write b with its Ferret internal axis name XAXIS_TEST1
+save/clob/file=c.nc a[d=1],b
+sp ncdump -h c.nc
+
+! Yet more combinations
+save/clob/file=c.nc b, a[d=1]
+sp ncdump -h c.nc
+
+! We can use /KEEP_AXISNAMES, changes XAXIS_TEST1 to XAXIS_TEST
+save/clobber/file=c.nc b
+sp ncdump -h c.nc
+
+! Subsets also use XAXIS_TEST1 
+save/clobber/file=c.nc/i=2:4 b
+sp ncdump -h c.nc
+
+! Unless we use /KEEP_AXISNAMES - which removes renaming
+! due to subsetting and also due to internal names
+save/clobber/file=c.nc/i=2:4/keep b
+sp ncdump -h c.nc
+
+! If we try /KEEP_AXISNAMES but there is a conflict, it's an err
+set mode ignore
+save/clobber/keep/file=nc b,a[d=1]
+
+set mode/last ignore
+
diff --git a/bench/err686_faxis_label.jnl b/bench/err686_faxis_label.jnl
new file mode 100644
index 0000000..7b686c6
--- /dev/null
+++ b/bench/err686_faxis_label.jnl
@@ -0,0 +1,25 @@
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis 
+! shouldn't automatically get it. 
+
+! Define a variable with a Julian calendar axis, and an abstract F axis
+
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+
+! This label should be just F : 3
+sh sym lab($labnum_f)
+
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
diff --git a/bench/err686_individual_levels.jnl b/bench/err686_individual_levels.jnl
new file mode 100644
index 0000000..3ceab4b
--- /dev/null
+++ b/bench/err686_individual_levels.jnl
@@ -0,0 +1,15 @@
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+
+use coads_climatology
+
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
diff --git a/bench/err686_long_list_varnames.jnl b/bench/err686_long_list_varnames.jnl
new file mode 100644
index 0000000..a9c57d1
--- /dev/null
+++ b/bench/err686_long_list_varnames.jnl
@@ -0,0 +1,70 @@
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+
+! The list was cut off after woa_land_marker. 
+! Try to load a variable later than that in the list.
+
+list etopo2_depth
+
+
diff --git a/bench/err686_redef_ascii_att.jnl b/bench/err686_redef_ascii_att.jnl
new file mode 100644
index 0000000..660d341
--- /dev/null
+++ b/bench/err686_redef_ascii_att.jnl
@@ -0,0 +1,22 @@
+! err686_redef_ascii_att.jnl
+! Bug 2161
+! DEFINE ATT to redefine title or units for variable 
+! in ascii dataset caused crash
+
+columns/delim=" " EZ.DAT
+sh att v1
+
+! A new attribuge causes no problems
+define att/output v1.comment = "First var from EZ.DAT"
+sh att v1
+
+! Initial definition of units is ok.
+! Re-defining the title or units causes crash
+define att/output v1.long_name = "vee one"
+
+! Initial definition of units is ok.
+! Re-defining units causes crash
+define att/output v1.units="km"
+define att/output v1.units="meters"
+
+sh att v1
diff --git a/bench/err686_set_var_name.jnl b/bench/err686_set_var_name.jnl
new file mode 100644
index 0000000..6adf569
--- /dev/null
+++ b/bench/err686_set_var_name.jnl
@@ -0,0 +1,34 @@
+! err686_set_var_name.jnl
+! ticket 2152
+! rename user var or file var. Err message was
+! wrong if the name already exists.
+
+SET MODE IGNORE
+
+let a = 1
+let b = 2
+! Intentional error, new name is already a defined variable
+set var/name=b a
+! This rename is ok
+set var/name=c a
+sh var
+
+use gt4d011.cdf
+! Intentional error, new name already in file
+set var/name=temp salt
+show dat
+! This rename is ok
+set var/name=salinity salt
+show dat
+
+! Test LET/D variables:
+let/d=1 myvar = taux - tauy
+! This is an error, new name already in file
+set var/name=psi myvar
+! This is ok, new let/d name associated with the file
+set var/name=diff myvar
+show dat
+
+
+
+SET MODE/LAST ignore
diff --git a/bench/err686_sho_nonexist_att.jnl b/bench/err686_sho_nonexist_att.jnl
new file mode 100644
index 0000000..dbaf4f7
--- /dev/null
+++ b/bench/err686_sho_nonexist_att.jnl
@@ -0,0 +1,11 @@
+! err686_sho_nonexist_att.jnl
+! See ticket 2133
+
+!  Too many error messages were issued on this error
+set mode ignore
+
+use levitus_climatology
+show att temp.noexist[d=levitus_climatology]
+
+set mode/last ignore
+
diff --git a/bench/err_calendar.nc b/bench/err_calendar.nc
new file mode 100644
index 0000000..8784551
Binary files /dev/null and b/bench/err_calendar.nc differ
diff --git a/bench/euro_dates_bug.dat b/bench/euro_dates_bug.dat
new file mode 100644
index 0000000..66c4318
--- /dev/null
+++ b/bench/euro_dates_bug.dat
@@ -0,0 +1,5 @@
+27-07-1999
+28/07/2001
+20013007
+31/07/03
+01/08/999
diff --git a/bench/exit_script_1.jnl b/bench/exit_script_1.jnl
new file mode 100644
index 0000000..fd28de6
--- /dev/null
+++ b/bench/exit_script_1.jnl
@@ -0,0 +1,6 @@
+! test exit/script
+
+exit/script
+
+say "exit/script: should have exited from the script"
+say "these lines should not be printed"
diff --git a/bench/exit_script_if.jnl b/bench/exit_script_if.jnl
new file mode 100644
index 0000000..2c8be2e
--- /dev/null
+++ b/bench/exit_script_if.jnl
@@ -0,0 +1,9 @@
+! test exit/script from an IF clause
+
+let a = 1
+if `a lt 10` then exit/script
+
+say "exit/script in an IF clause: should have exited from the script"
+say "these lines should not be printed"
+list a
+
diff --git a/bench/exit_script_if_loop.jnl b/bench/exit_script_if_loop.jnl
new file mode 100644
index 0000000..f9e993b
--- /dev/null
+++ b/bench/exit_script_if_loop.jnl
@@ -0,0 +1,7 @@
+! test exit/script with IF clause and REPEAT loop
+
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+
+say "exit/script in a REPEAT loop: should have exited from the script"
+say "these lines should not be printed"
+list a
diff --git a/bench/exit_script_inloop.jnl b/bench/exit_script_inloop.jnl
new file mode 100644
index 0000000..1d075b2
--- /dev/null
+++ b/bench/exit_script_inloop.jnl
@@ -0,0 +1,8 @@
+! When this script is executed within a loop, all the repeats of the loop
+! should executet but but not the SAY SCRIPT at each iteration of the loop
+! that is inside the script.
+
+SAY $1 
+EXIT/SCRIPT 
+SAY "should not see this line, inside the script 
+
diff --git a/bench/exit_script_loop.jnl b/bench/exit_script_loop.jnl
new file mode 100644
index 0000000..28a9876
--- /dev/null
+++ b/bench/exit_script_loop.jnl
@@ -0,0 +1,7 @@
+! test exit/script inside REPEAT loop
+
+repeat/i=3:5 (list/nohead i; exit/script)
+
+say "exit/script in a REPEAT loop: should have exited from the script"
+say "these lines should not be printed"
+list a
diff --git a/bench/exit_script_twolev.jnl b/bench/exit_script_twolev.jnl
new file mode 100644
index 0000000..232865e
--- /dev/null
+++ b/bench/exit_script_twolev.jnl
@@ -0,0 +1,6 @@
+! test exit/script called another level down
+
+go exit_script_if
+
+say "returned from exit_script_if"
+say "here is the next line"
diff --git a/bench/ferret_startup b/bench/ferret_startup
new file mode 100644
index 0000000..c0343e9
--- /dev/null
+++ b/bench/ferret_startup
@@ -0,0 +1,18 @@
+CAN MODE VERIFY
+
+! This file will be copied to .ferret as part
+! pf the benchmark testing
+
+SET MEMORY/SIZE=31
+SET MODE journal startup_tests.jnl
+! KMS - commented out for PyFerret - .plt not supported
+! SET MODE meta startup_tests.plt
+
+SET MODE NLEVELS 100
+SET MODE LINEC:7
+ppl color,7,100,50,0   ! orange
+
+CANCEL MODE latit_label
+
+SET MODE GRATICULE
+
diff --git a/bench/fill_value_int.nc b/bench/fill_value_int.nc
new file mode 100644
index 0000000..3a6e362
Binary files /dev/null and b/bench/fill_value_int.nc differ
diff --git a/bench/finale.dat b/bench/finale.dat
new file mode 100644
index 0000000..39c333b
Binary files /dev/null and b/bench/finale.dat differ
diff --git a/bench/fine_x_axis.nc b/bench/fine_x_axis.nc
new file mode 100644
index 0000000..858a962
Binary files /dev/null and b/bench/fine_x_axis.nc differ
diff --git a/bench/float.dat b/bench/float.dat
new file mode 100644
index 0000000..7c4e01e
Binary files /dev/null and b/bench/float.dat differ
diff --git a/bench/floatSwapped.dat b/bench/floatSwapped.dat
new file mode 100644
index 0000000..68f0b13
Binary files /dev/null and b/bench/floatSwapped.dat differ
diff --git a/bench/gappy_bounds.nc b/bench/gappy_bounds.nc
new file mode 100644
index 0000000..bbb362e
Binary files /dev/null and b/bench/gappy_bounds.nc differ
diff --git a/bench/geo_borders.cdf b/bench/geo_borders.cdf
new file mode 100644
index 0000000..ed35285
Binary files /dev/null and b/bench/geo_borders.cdf differ
diff --git a/bench/grads_bug_file.nc b/bench/grads_bug_file.nc
new file mode 100644
index 0000000..012aab7
Binary files /dev/null and b/bench/grads_bug_file.nc differ
diff --git a/bench/gt160w011_nts30.des b/bench/gt160w011_nts30.des
new file mode 100644
index 0000000..05858ee
--- /dev/null
+++ b/bench/gt160w011_nts30.des
@@ -0,0 +1,169 @@
+********************************************************************************
+*        NOAA/PMEL Tropical Modeling and Analysis Program, Seattle, WA.        *
+********************************************************************************
+*	---  north/south slab at 160W   ---
+ $FORMAT_RECORD
+	d_type            = '  GT',
+	d_format          = '  1C',
+	d_source_class    = 'MODEL OUTPUT',
+	d_source          = 'PHIL/SIEG',
+	d_subsource       = 'TROPICAL PACIFIC',
+ $END
+ $BACKGROUND_RECORD
+	d_expnum          = '0011',
+	d_modnum          = '  BC',
+	d_title           = 'NMC diagnostic run with momentum terms',     
+	d_mod_title       = ' ',
+	d_forcing_set     = 'NMC',
+	d_t0time          = '14-JAN-1980 14:00:00',
+	d_time_unit       = 3600.,
+	d_ntegrate_tstep  = 1.0,
+	d_ntuple          = 1,
+	d_time_run        = '13-APR-87 00:00:00',
+	d_who_ranit       = 'MARK VERSCHELL',
+	d_time_made       = '12-DEC-1986 00:00:00',
+	d_who_madeit	  = 'MARK VERSCHELL',
+	d_aux_modnum      = ' ',' ',' ',' ',' ',' ',
+	d_add_parm        = 'NTS30 WIND STRESS MOD',' ',' ',' ',' ',' ',
+	d_grid_filename   = ' ',' ',' ',' ',' ',' ',
+ $END
+ $MESSAGE_RECORD
+	d_message         = 'Exp 11 - 3 vertical slabs at 160W, T=27740:42',
+	d_alert_on_open   = .TRUE.,
+	d_alert_on_output = .FALSE.,
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'TEMP',
+	d_var_title       = 'TEMPERATURE',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'deg. C',
+	d_grid_name       = 'PS3DT',
+	d_missing_flag    = 0.0,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 70,  1,  1, -1,
+	d_grid_end        = 72, 100, 27, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'SALT',
+	d_var_title       = '(SALINITY(ppt) - 35) /1000',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'frac. by wt. less .035',
+	d_grid_name       = 'PS3DT',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = .01,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 70,   1,  1, -1,
+	d_grid_end        = 71, 100, 27, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'U   ',
+	d_var_title       = 'ZONAL VELOCITY',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'cm/sec',
+	d_grid_name       = 'PS3DU',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 69,   1,  1, -1,
+	d_grid_end        = 72, 100, 27, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'V   ',
+	d_var_title       = 'MERIDIONAL VELOCITY',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'cm/sec',
+	d_grid_name       = 'PS3DU',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 69,   1,  1, -1,
+	d_grid_end        = 72, 100, 27, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'W   ',
+	d_var_title       = 'VERTICAL VELOCITY',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'cm/sec',
+	d_grid_name       = 'PS3DW',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 70,   1,  1, -1,
+	d_grid_end        = 71, 100, 27, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'TAUX',
+	d_var_title       = 'ZONAL WIND STRESS',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'dynes/cm**2',
+	d_grid_name       = 'PS2DU',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 69,   1,  1, -1,
+	d_grid_end        = 71, 100,  1, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'TAUY',
+	d_var_title       = 'MERIDIONAL WIND STRESS',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'dynes/cm**2',
+	d_grid_name       = 'PS2DU',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 69,   1,  1, -1,
+	d_grid_end        = 71, 100,  1, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = 'PSI',
+	d_var_title       = 'STREAM FUNCTION',
+	d_var_titl_mod    = ' ',
+	d_var_units       = 'cm**3/sec',
+	d_grid_name       = 'PS2DU',
+	d_missing_flag    = -1E+34,
+	d_bad_flag        = -1E+34,
+	d_ordering        = 'SN','WE','UD','TI',
+	d_grid_start      = 69,   1,  1, -1,
+	d_grid_end        = 73, 100,  1, -1,
+	d_precision       = 'SINGLE',
+	d_aux_set_num     = 0,
+ $END
+ $VARIABLE_RECORD
+	d_var_code        = '**END OF VARS**',
+ $END
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+	s_filename        = 'gtbc011.001',
+	s_aux_set_num     = 0,
+	s_start           = 27740.,
+	s_end             = 27742.,
+	s_delta           = 1.,
+	s_num_of_files    = 1,
+	s_regvarflag      = ' ',
+	s_index           = ' ',
+ $END
+ $STEPFILE_RECORD
+	s_filename        = '**END OF STEPFILES**',
+ $END
diff --git a/bench/gt4d011.cdf b/bench/gt4d011.cdf
new file mode 100644
index 0000000..3ebb481
Binary files /dev/null and b/bench/gt4d011.cdf differ
diff --git a/bench/gtbc011.cdf b/bench/gtbc011.cdf
new file mode 100644
index 0000000..f77c115
Binary files /dev/null and b/bench/gtbc011.cdf differ
diff --git a/bench/gtsa056_1.cdf b/bench/gtsa056_1.cdf
new file mode 100644
index 0000000..c939e1a
Binary files /dev/null and b/bench/gtsa056_1.cdf differ
diff --git a/bench/gtsa056_1_ef.nc b/bench/gtsa056_1_ef.nc
new file mode 100644
index 0000000..8ff9782
Binary files /dev/null and b/bench/gtsa056_1_ef.nc differ
diff --git a/bench/gtsa056_2.cdf b/bench/gtsa056_2.cdf
new file mode 100644
index 0000000..ed3a2d3
Binary files /dev/null and b/bench/gtsa056_2.cdf differ
diff --git a/bench/hourst.nc b/bench/hourst.nc
new file mode 100644
index 0000000..11cb4f5
Binary files /dev/null and b/bench/hourst.nc differ
diff --git a/bench/illeg_axname.nc b/bench/illeg_axname.nc
new file mode 100644
index 0000000..5ea9044
Binary files /dev/null and b/bench/illeg_axname.nc differ
diff --git a/bench/int.dat b/bench/int.dat
new file mode 100644
index 0000000..d0a1398
Binary files /dev/null and b/bench/int.dat differ
diff --git a/bench/intSwapped.dat b/bench/intSwapped.dat
new file mode 100644
index 0000000..dbdf543
Binary files /dev/null and b/bench/intSwapped.dat differ
diff --git a/bench/latestOb.nc b/bench/latestOb.nc
new file mode 100644
index 0000000..6731dac
Binary files /dev/null and b/bench/latestOb.nc differ
diff --git a/bench/lev_rev_up.nc b/bench/lev_rev_up.nc
new file mode 100644
index 0000000..fa8e1c5
Binary files /dev/null and b/bench/lev_rev_up.nc differ
diff --git a/bench/levitus_climatology.cdf b/bench/levitus_climatology.cdf
new file mode 100644
index 0000000..8755e98
Binary files /dev/null and b/bench/levitus_climatology.cdf differ
diff --git a/bench/longtitle1000.nc b/bench/longtitle1000.nc
new file mode 100644
index 0000000..3e76b9a
Binary files /dev/null and b/bench/longtitle1000.nc differ
diff --git a/bench/longvarnames.tsv b/bench/longvarnames.tsv
new file mode 100644
index 0000000..595c78c
--- /dev/null
+++ b/bench/longvarnames.tsv
@@ -0,0 +1,11 @@
+sta	type	mon	day	yr	hh	mm	long	lat	bottomD	depth	depthW	temp	sal	xCO2_water_sst_wet_ppm	xCO2_water_equi_temp_wet_ppm	xCO2_water_sst_dry_ppm	xCO2_water_equi_temp_dry_ppm	fCO2_water_sst_100humidity_uatm	fCO2_water_corr_25_uatm	fCO2_water_corr_to_20	fCO2_water_equi_uatm	pCO2_water_sst_100humidity_uatm	pCO2_water_equi_temp	pCO2_theta_SW_corrected_to_sst	Temperature_equi	Pressure_atm	Pressure_equi	wind_direc_deg	wind_speed	ship_speed	ship_direc	Humidity	woa_sss	woa_land_marker	ncep_slp	speed_ [...]
+74E320041213_1	C	12	13	2004	15	06	26.1397	-34.0005	5	5	NaN	21.073	35.215	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.482	1012.6	NaN	NaN	NaN	11.9	114	NaN	35.207298	0.000000	1013.100000	13.102482	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_2	C	12	13	2004	15	07	26.1437	-34.002	5	5	NaN	21.072	35.213	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.418	1012.6	NaN	NaN	NaN	12.2	115	NaN	35.207298	0.000000	1013.100000	12.830961	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_3	C	12	13	2004	15	08	26.1476	-34.0035	5	5	NaN	21.064	35.211	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.45	1012.6	NaN	NaN	NaN	12	115	NaN	35.207298	0.000000	1013.100000	12.683475	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_4	C	12	13	2004	15	09	26.1515	-34.0049	5	5	NaN	21.065	35.212	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.482	1012.6	NaN	NaN	NaN	11.9	114	NaN	35.207298	0.000000	1013.100000	12.830598	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_5	C	12	13	2004	15	10	26.1554	-34.0064	5	5	NaN	21.048	35.209	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.418	1012.6	NaN	NaN	NaN	11.9	114	NaN	35.207298	0.000000	1013.100000	12.830414	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_6	C	12	13	2004	15	11	26.1593	-34.0079	5	5	NaN	21.014	35.206	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.385	1012.6	NaN	NaN	NaN	12.1	116	NaN	35.207298	0.000000	1013.100000	13.101534	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_7	C	12	13	2004	15	12	26.1633	-34.0094	5	5	NaN	20.95	35.204	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.32	1012.6	NaN	NaN	NaN	12.1	115	NaN	35.207298	0.000000	1013.100000	12.830039	-97.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_8	C	12	13	2004	15	13	26.1672	-34.0109	5	5	NaN	20.898	35.203	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.255	1012.6	NaN	NaN	NaN	12.2	114	NaN	35.207298	0.000000	1013.100000	6.761483	-99.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_9	C	12	13	2004	15	15	26.1713	-34.0125	5	5	NaN	20.861	35.201	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	21.223	1012.6	NaN	NaN	NaN	12.3	115	NaN	35.207298	0.000000	1013.100000	12.409078	-99.000000	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN	NaN
+74E320041213_10	C	12	13	2004	15	16	26.1751	-34.0139	5	5	NaN	20.834	35.2	NaN	NaN	NaN	318.376	313.714	NaN	NaN	NaN	314.77	NaN	NaN	21.158	1012.6	NaN	NaN	NaN	12.3	115	NaN	35.207298	0.000000	1013.100000	13.793138	-99.000000	306.111531	NaN	NaN	313.710569	NaN	313.714000	NaN	313.710048	306.111561	NaN	306.265473	NaN	306.265503	NaN	306.111531	1.000000
diff --git a/bench/lowercaseTime.nc b/bench/lowercaseTime.nc
new file mode 100644
index 0000000..33c2c3d
Binary files /dev/null and b/bench/lowercaseTime.nc differ
diff --git a/bench/make_stream_file.F b/bench/make_stream_file.F
new file mode 100644
index 0000000..a5da27d
--- /dev/null
+++ b/bench/make_stream_file.F
@@ -0,0 +1,57 @@
+	PROGRAM TEST_STREAM
+
+* For gfortran under linux 2/2012, with double-precision Ferret,
+* gfortran -o make_stream_file -Dreclen_in_bytes -Ddouble_p -fdefault-real-8 -fdefault-double-8 make_stream_file.F
+
+	INTEGER i,j
+
+	REAL myvar(10,5)
+
+* generates a test file of REAL direct access values
+!	  1  2  3  4  5  6  7  8  9 10
+!	 11 12 13 14 15 16 17 18 19 20
+!	 21 22 23 24 25 26 27 28 29 30
+!	 31 32 33 34 35 36 37 38 39 40
+!	 41 42 43 44 45 46 47 48 49 50
+
+* fill with dummy data
+	DO 5 j = 1,5
+	DO 5 i = 1,10
+ 5	myvar(i,j) = (j-1)*10+i
+
+
+* messages to user
+	WRITE (6,*)
+     .		'Creating machine-specific binary file stream10by5.unf'
+	WRITE (6,*)
+     .		'Remember to mv stream10by5.unf to stream10by5_{$machine}.unf'
+
+#ifdef double_p
+* create output file
+	OPEN(UNIT=20,
+     .	     STATUS='unknown',
+     .	     FILE='stream10by5.unf',
+     .	     ACCESS='DIRECT',
+#ifdef reclen_in_bytes
+     .	     RECL=80)
+#else
+     .	     RECL=20)
+#endif
+
+#else
+	OPEN(UNIT=20,
+     .	     STATUS='unknown',
+     .	     FILE='stream10by5.unf',
+     .	     ACCESS='DIRECT',
+#ifdef reclen_in_bytes
+     .	     RECL=40)
+#else
+     .	     RECL=10)
+#endif
+#endif
+
+	DO 100 j = 1, 5
+ 100	WRITE (20,REC=j) (myvar(i,j),i=1,10)
+
+	STOP
+	END
diff --git a/bench/mc_test.des b/bench/mc_test.des
new file mode 100644
index 0000000..def49fd
--- /dev/null
+++ b/bench/mc_test.des
@@ -0,0 +1,53 @@
+ &FORMAT_RECORD
+   D_TYPE        = '  MC',
+   D_FORMAT      = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+   D_SOURCE      = 'COAD',
+   D_SUBSOURCE   = 'GLOBAL',
+ /
+ &BACKGROUND_RECORD
+   D_EXPNUM      = '    ',
+   D_MODNUM      = '    ',
+   D_TITLE       = 'COAD',
+   D_FORCING_SET = '    ',
+   D_T0TIME      = '01-JAN-1900',
+   D_TIME_UNIT   = 3600.0,
+   D_TIME_MODULO = .false.,
+   D_NTEGRATE_TSTEP     = 1.0,
+   D_TIME_RUN    = '29-aug-1996',
+   D_WHO_RANIT   = 'kob',
+   D_TIME_MADE   = '29-aug-1996',
+   D_WHO_MADEIT  = ' ',
+   D_AUX_MODNUM  =  6*' ',
+   D_GRID_FILENAME      =  6*' ',
+ /
+ &MESSAGE_RECORD
+   D_MESSAGE     = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ /
+ &EXTRA_RECORD
+ /
+ &STEPFILE_RECORD
+   S_FILENAME    = 'coads_clim.001',
+   S_AUX_SET_NUM = 0,
+   S_START       = 366.0,
+   S_END  = 1096.485,
+   S_DELTA       = 730.485,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG  = ' ',
+ /
+ &STEPFILE_RECORD
+   S_FILENAME    = 'coads_clim.003',
+   S_AUX_SET_NUM = 0,
+   S_START       = 3287.94,
+   S_END  = 3287.94,
+   S_DELTA       = 1,
+   S_NUM_OF_FILES       = 1,
+   S_REGVARFLAG  = ' ',
+ /
+
+ &STEPFILE_RECORD
+   S_FILENAME    = '**END OF STEPFILES**'
+ /
+
diff --git a/bench/memleak.jnl b/bench/memleak.jnl
new file mode 100644
index 0000000..71282a4
--- /dev/null
+++ b/bench/memleak.jnl
@@ -0,0 +1,7 @@
+ ! Run TOP and watch memory use as this runs; memory leak fixed by Remik 
+ ! 12-Oct-2007 Ferret v6.08 
+
+! Can use j=1:1000 on slower machines ...
+
+can mode verif; rep/i=1:50 rep/j=1:5000 let a = 0
+
diff --git a/bench/missing_scale_off.nc b/bench/missing_scale_off.nc
new file mode 100644
index 0000000..8530445
Binary files /dev/null and b/bench/missing_scale_off.nc differ
diff --git a/bench/modfalse.nc b/bench/modfalse.nc
new file mode 100644
index 0000000..5b27b4f
Binary files /dev/null and b/bench/modfalse.nc differ
diff --git a/bench/modulo_lon_time.nc b/bench/modulo_lon_time.nc
new file mode 100644
index 0000000..7abde58
Binary files /dev/null and b/bench/modulo_lon_time.nc differ
diff --git a/bench/mylon.nc b/bench/mylon.nc
new file mode 100644
index 0000000..d1fe139
Binary files /dev/null and b/bench/mylon.nc differ
diff --git a/bench/nan_missing.nc b/bench/nan_missing.nc
new file mode 100644
index 0000000..9311198
Binary files /dev/null and b/bench/nan_missing.nc differ
diff --git a/bench/navy_uw.nc b/bench/navy_uw.nc
new file mode 100644
index 0000000..e9b100a
Binary files /dev/null and b/bench/navy_uw.nc differ
diff --git a/bench/nc5d.nc b/bench/nc5d.nc
new file mode 100644
index 0000000..71479a0
Binary files /dev/null and b/bench/nc5d.nc differ
diff --git a/bench/noglobalhistory.nc b/bench/noglobalhistory.nc
new file mode 100644
index 0000000..d12e2ad
Binary files /dev/null and b/bench/noglobalhistory.nc differ
diff --git a/bench/non_COARDS.cdf b/bench/non_COARDS.cdf
new file mode 100644
index 0000000..842ba41
Binary files /dev/null and b/bench/non_COARDS.cdf differ
diff --git a/bench/non_COARDS.cdl b/bench/non_COARDS.cdl
new file mode 100644
index 0000000..8fd842f
--- /dev/null
+++ b/bench/non_COARDS.cdl
@@ -0,0 +1,44328 @@
+netcdf non_COARDS {
+dimensions:
+	NO_AXIS = 5 ;
+	BACKWARDS_AXIS = 5 ;
+	GAPPY_AXIS = 5 ;
+	UNORDERED_AXIS = 5 ;
+	SCALAR = 1 ;
+	COADSX = 180 ;
+	COADSY = 90 ;
+	TIME = UNLIMITED ; // (1 currently)
+	BIG_IRREG = 200000 ;
+variables:
+	float BIG_IRREG(BIG_IRREG) ;
+		BIG_IRREG:long_name = "Overlong, irregular axis" ;
+		BIG_IRREG:units = "hours" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "1-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+	int UNORDERED_AXIS(UNORDERED_AXIS) ;
+		UNORDERED_AXIS:long_name = "disordered axis" ;
+	byte GAPPY_AXIS(GAPPY_AXIS) ;
+		GAPPY_AXIS:_FillValue = -9b ;
+		GAPPY_AXIS:long_name = "gappy axis" ;
+	int BACKWARDS_AXIS(BACKWARDS_AXIS) ;
+		BACKWARDS_AXIS:long_name = "backwards axis" ;
+	float SCALAR_VAR(SCALAR) ;
+		SCALAR_VAR:long_name = "a good way to encode model parms" ;
+	float TRUE_SCALAR ;
+		TRUE_SCALAR:long_name = "with no dims at all" ;
+		TRUE_SCALAR:_FillValue = -99.f ;
+	float MASKED_SST(TIME, COADSY, COADSX) ;
+		MASKED_SST:missing_value = -1.e+34f ;
+		MASKED_SST:_FillValue = -1.e+34f ;
+		MASKED_SST:long_name = "SST * MP_MASK" ;
+		MASKED_SST:history = "From coads_climatology" ;
+	float COADSX(COADSY, COADSX) ;
+		COADSX:units = "degrees_east" ;
+		COADSX:missing_value = -1.e+34f ;
+		COADSX:_FillValue = -1.e+34f ;
+		COADSX:long_name = "Longitude page positions" ;
+	float COADSY(COADSY, COADSX) ;
+		COADSY:units = "degrees_north" ;
+		COADSY:missing_value = -1.e+34f ;
+		COADSY:_FillValue = -1.e+34f ;
+		COADSY:long_name = "Latitude page positions" ;
+	double HAS_NO_AXIS(NO_AXIS) ;
+		HAS_NO_AXIS:long_name = "variable with no axis" ;
+		HAS_NO_AXIS:_FillValue = -99. ;
+	int HAS_UNORDERED_AXIS(UNORDERED_AXIS) ;
+		HAS_UNORDERED_AXIS:long_name = "variable with disordered axis" ;
+	byte HAS_GAPPY_AXIS(GAPPY_AXIS) ;
+		HAS_GAPPY_AXIS:long_name = "variable with gappy axis" ;
+	int HAS_BACKWARDS_AXIS(BACKWARDS_AXIS) ;
+		HAS_BACKWARDS_AXIS:long_name = "variable with backwards axis" ;
+	byte USES_BIG_IRREG(BIG_IRREG) ;
+		USES_BIG_IRREG:long_name = "variable defined on too-long irreg axis" ;
+
+// global attributes:
+		:history = "non-COARDS netCDF example" ;
+		:h1 = "has 2D coordinate variables (COADSX, COADSY)" ;
+data:
+
+ BIG_IRREG = 1, 2.1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
+    19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 
+    37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 
+    55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 
+    73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 
+    91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 
+    107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 
+    121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 
+    135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 
+    149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 
+    163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 
+    177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 
+    191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 
+    205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 
+    219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 
+    233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 
+    247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 
+    261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 
+    275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 
+    289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 
+    303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 
+    317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 
+    331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 
+    345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 
+    359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 
+    373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 
+    387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 
+    401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 
+    415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 
+    429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 
+    443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 
+    457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 
+    471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 
+    485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 
+    499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 
+    513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 
+    527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 
+    541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 
+    555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 
+    569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 
+    583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 
+    597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 
+    611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 
+    625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 
+    639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 
+    653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 
+    667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 
+    681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 
+    695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 
+    709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 
+    723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 
+    737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 
+    751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 
+    765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 
+    779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 
+    793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 
+    807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 
+    821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 
+    835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 
+    849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 
+    863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 
+    877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 
+    891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 
+    905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 
+    919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 
+    933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 
+    947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 
+    961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 
+    975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 
+    989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 
+    1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 
+    1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 
+    1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 
+    1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 
+    1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 
+    1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 
+    1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 
+    1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 
+    1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 
+    1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 
+    1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 
+    1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 
+    1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 
+    1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 
+    1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 
+    1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 
+    1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 
+    1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 
+    1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 
+    1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 
+    1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 
+    1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 
+    1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 
+    1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 
+    1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 
+    1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 
+    1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 
+    1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 
+    1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 
+    1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 
+    1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 
+    1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 
+    1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 
+    1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 
+    1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 
+    1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 
+    1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 
+    1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 
+    1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 
+    1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 
+    1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 
+    1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 
+    1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 
+    1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 
+    1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 
+    1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 
+    1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 
+    1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 
+    1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 
+    1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 
+    1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 
+    1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 
+    1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 
+    1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 
+    1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 
+    1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 
+    1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 
+    1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 
+    1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 
+    1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 
+    1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 
+    1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 
+    1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 
+    1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 
+    1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 
+    1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 
+    1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 
+    1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 
+    1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 
+    1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 
+    1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 
+    1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 
+    1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 
+    1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 
+    1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 
+    1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 
+    1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 
+    1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 
+    1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 
+    1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 
+    1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 
+    1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 
+    1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 
+    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 
+    2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
+    2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 
+    2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 
+    2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 
+    2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 
+    2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 
+    2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 
+    2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 
+    2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 
+    2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 
+    2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 
+    2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
+    2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 
+    2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 
+    2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 
+    2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 
+    2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 
+    2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 
+    2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 
+    2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 
+    2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 
+    2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 
+    2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 
+    2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 
+    2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 
+    2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 
+    2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 
+    2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 
+    2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 
+    2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 
+    2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 
+    2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 
+    2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 
+    2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 
+    2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 
+    2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 
+    2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 
+    2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 
+    2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 
+    2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 
+    2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 
+    2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 
+    2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 
+    2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 
+    2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 
+    2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 
+    2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 
+    2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 
+    2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 
+    2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 
+    2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 
+    2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 
+    2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 
+    2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 
+    2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 
+    2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 
+    2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 
+    2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 
+    2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 
+    2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 
+    2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 
+    2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 
+    2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 
+    2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 
+    2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 
+    2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 
+    2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 
+    2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 
+    2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 
+    2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 
+    2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 
+    2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 
+    2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 
+    2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 
+    2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 
+    2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 
+    2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 
+    2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 
+    2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 
+    2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 
+    2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 
+    2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 
+    2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 
+    3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 
+    3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 
+    3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 
+    3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 
+    3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 
+    3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 
+    3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 
+    3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 
+    3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 
+    3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 
+    3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 
+    3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 
+    3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 
+    3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 
+    3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 
+    3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 
+    3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 
+    3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 
+    3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 
+    3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 
+    3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 
+    3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 
+    3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 
+    3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 
+    3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 
+    3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 
+    3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 
+    3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 
+    3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 
+    3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 
+    3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 
+    3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 
+    3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 
+    3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 
+    3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 
+    3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 
+    3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 
+    3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 
+    3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 
+    3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 
+    3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 
+    3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 
+    3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 
+    3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 
+    3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 
+    3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 
+    3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 
+    3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 
+    3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 
+    3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 
+    3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 
+    3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 
+    3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 
+    3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 
+    3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 
+    3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 
+    3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 
+    3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 
+    3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 
+    3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 
+    3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 
+    3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 
+    3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 
+    3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 
+    3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 
+    3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 
+    3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 
+    3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 
+    3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 
+    3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 
+    3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 
+    3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 
+    3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 
+    3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 
+    3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 
+    3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 
+    3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 
+    3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 
+    3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 
+    3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 
+    3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 
+    3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 
+    3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 
+    4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 
+    4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 
+    4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 
+    4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 
+    4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 
+    4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 
+    4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 
+    4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 
+    4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 
+    4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 
+    4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 
+    4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 
+    4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 
+    4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 
+    4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 
+    4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 
+    4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 
+    4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 
+    4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 
+    4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 
+    4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 
+    4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 
+    4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 
+    4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 
+    4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 
+    4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 
+    4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 
+    4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 
+    4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 
+    4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 
+    4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 
+    4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 
+    4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 
+    4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 
+    4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 
+    4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 
+    4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 
+    4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 
+    4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 
+    4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 
+    4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 
+    4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 
+    4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 
+    4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 
+    4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 
+    4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 
+    4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 
+    4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 
+    4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 
+    4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 
+    4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 
+    4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 
+    4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 
+    4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 
+    4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 
+    4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 
+    4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 
+    4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 
+    4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 
+    4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 
+    4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 
+    4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 
+    4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 
+    4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 
+    4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 
+    4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 
+    4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 
+    4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 
+    4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 
+    4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 
+    4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 
+    4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 
+    4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 
+    4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 
+    4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 
+    4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 
+    4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 
+    4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 
+    4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 
+    4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 
+    4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 
+    4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 
+    4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 
+    4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 
+    5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 
+    5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 
+    5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 
+    5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 
+    5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 
+    5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 
+    5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 
+    5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 
+    5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 
+    5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 
+    5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 
+    5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 
+    5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 
+    5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 
+    5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 
+    5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 
+    5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 
+    5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 
+    5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 
+    5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 
+    5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 
+    5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 
+    5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 
+    5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 
+    5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 
+    5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 
+    5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 
+    5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 
+    5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 
+    5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 
+    5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 
+    5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 
+    5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 
+    5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 
+    5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 
+    5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 
+    5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 
+    5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 
+    5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 
+    5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 
+    5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 
+    5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 
+    5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 
+    5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 
+    5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 
+    5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 
+    5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 
+    5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 
+    5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 
+    5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 
+    5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 
+    5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 
+    5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 
+    5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 
+    5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 
+    5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 
+    5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 
+    5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 
+    5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 
+    5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 
+    5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 
+    5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 
+    5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 
+    5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 
+    5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 
+    5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 
+    5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 
+    5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 
+    5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 
+    5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 
+    5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 
+    5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 
+    5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 
+    5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 
+    5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 
+    5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 
+    5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 
+    5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 
+    5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 
+    5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 
+    5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 
+    5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 
+    5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 
+    6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 
+    6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 
+    6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 
+    6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 
+    6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 
+    6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 
+    6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 
+    6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 
+    6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 
+    6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 
+    6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 
+    6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 
+    6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 
+    6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 
+    6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 
+    6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 
+    6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 
+    6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 
+    6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 
+    6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 
+    6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 
+    6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 
+    6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 
+    6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 
+    6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 
+    6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 
+    6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 
+    6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 
+    6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 
+    6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 
+    6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 
+    6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 
+    6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 
+    6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 
+    6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 
+    6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 
+    6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 
+    6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 
+    6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 
+    6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 
+    6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 
+    6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 
+    6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 
+    6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 
+    6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 
+    6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 
+    6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 
+    6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 
+    6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 
+    6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 
+    6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 
+    6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 
+    6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 
+    6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 
+    6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 
+    6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 
+    6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 
+    6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 
+    6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 
+    6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 
+    6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 
+    6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 
+    6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 
+    6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 
+    6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 
+    6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 
+    6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 
+    6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 
+    6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 
+    6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 
+    6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 
+    6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 
+    6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 
+    6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 
+    6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 
+    6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 
+    6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 
+    6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 
+    6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 
+    6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 
+    6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 
+    6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 
+    6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 
+    7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 
+    7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 
+    7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 
+    7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 
+    7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 
+    7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 
+    7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 
+    7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 
+    7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 
+    7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 
+    7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 
+    7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 
+    7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 
+    7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 
+    7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 
+    7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 
+    7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 
+    7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 
+    7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 
+    7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 
+    7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 
+    7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 
+    7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 
+    7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 
+    7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 
+    7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 
+    7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 
+    7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 
+    7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 
+    7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 
+    7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 
+    7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 
+    7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 
+    7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 
+    7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 
+    7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 
+    7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 
+    7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 
+    7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 
+    7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 
+    7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 
+    7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 
+    7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 
+    7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 
+    7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 
+    7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 
+    7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 
+    7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 
+    7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 
+    7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 
+    7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 
+    7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 
+    7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 
+    7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 
+    7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 
+    7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 
+    7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 
+    7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 
+    7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 
+    7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 
+    7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 
+    7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 
+    7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 
+    7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 
+    7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 
+    7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 
+    7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 
+    7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 
+    7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 
+    7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 
+    7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 
+    7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 
+    7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 
+    7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 
+    7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 
+    7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 
+    7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 
+    7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 
+    7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 
+    7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 
+    7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 
+    7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 
+    7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 
+    7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 
+    8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 
+    8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 
+    8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 
+    8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 
+    8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 
+    8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 
+    8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 
+    8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 
+    8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 
+    8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 
+    8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 
+    8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 
+    8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 
+    8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 
+    8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 
+    8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 
+    8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 
+    8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 
+    8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 
+    8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 
+    8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 
+    8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 
+    8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 
+    8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 
+    8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 
+    8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 
+    8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 
+    8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 
+    8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 
+    8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 
+    8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 
+    8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 
+    8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 
+    8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 
+    8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 
+    8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 
+    8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 
+    8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 
+    8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 
+    8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 
+    8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 
+    8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 
+    8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 
+    8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 
+    8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 
+    8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 
+    8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 
+    8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 
+    8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 
+    8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 
+    8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 
+    8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 
+    8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 
+    8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 
+    8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 
+    8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 
+    8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 
+    8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 
+    8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 
+    8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 
+    8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 
+    8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 
+    8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, 
+    8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776, 8777, 8778, 
+    8779, 8780, 8781, 8782, 8783, 8784, 8785, 8786, 8787, 8788, 8789, 8790, 
+    8791, 8792, 8793, 8794, 8795, 8796, 8797, 8798, 8799, 8800, 8801, 8802, 
+    8803, 8804, 8805, 8806, 8807, 8808, 8809, 8810, 8811, 8812, 8813, 8814, 
+    8815, 8816, 8817, 8818, 8819, 8820, 8821, 8822, 8823, 8824, 8825, 8826, 
+    8827, 8828, 8829, 8830, 8831, 8832, 8833, 8834, 8835, 8836, 8837, 8838, 
+    8839, 8840, 8841, 8842, 8843, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 
+    8851, 8852, 8853, 8854, 8855, 8856, 8857, 8858, 8859, 8860, 8861, 8862, 
+    8863, 8864, 8865, 8866, 8867, 8868, 8869, 8870, 8871, 8872, 8873, 8874, 
+    8875, 8876, 8877, 8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 
+    8887, 8888, 8889, 8890, 8891, 8892, 8893, 8894, 8895, 8896, 8897, 8898, 
+    8899, 8900, 8901, 8902, 8903, 8904, 8905, 8906, 8907, 8908, 8909, 8910, 
+    8911, 8912, 8913, 8914, 8915, 8916, 8917, 8918, 8919, 8920, 8921, 8922, 
+    8923, 8924, 8925, 8926, 8927, 8928, 8929, 8930, 8931, 8932, 8933, 8934, 
+    8935, 8936, 8937, 8938, 8939, 8940, 8941, 8942, 8943, 8944, 8945, 8946, 
+    8947, 8948, 8949, 8950, 8951, 8952, 8953, 8954, 8955, 8956, 8957, 8958, 
+    8959, 8960, 8961, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 
+    8971, 8972, 8973, 8974, 8975, 8976, 8977, 8978, 8979, 8980, 8981, 8982, 
+    8983, 8984, 8985, 8986, 8987, 8988, 8989, 8990, 8991, 8992, 8993, 8994, 
+    8995, 8996, 8997, 8998, 8999, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 
+    9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 
+    9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 
+    9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 
+    9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 
+    9055, 9056, 9057, 9058, 9059, 9060, 9061, 9062, 9063, 9064, 9065, 9066, 
+    9067, 9068, 9069, 9070, 9071, 9072, 9073, 9074, 9075, 9076, 9077, 9078, 
+    9079, 9080, 9081, 9082, 9083, 9084, 9085, 9086, 9087, 9088, 9089, 9090, 
+    9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099, 9100, 9101, 9102, 
+    9103, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113, 9114, 
+    9115, 9116, 9117, 9118, 9119, 9120, 9121, 9122, 9123, 9124, 9125, 9126, 
+    9127, 9128, 9129, 9130, 9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 
+    9139, 9140, 9141, 9142, 9143, 9144, 9145, 9146, 9147, 9148, 9149, 9150, 
+    9151, 9152, 9153, 9154, 9155, 9156, 9157, 9158, 9159, 9160, 9161, 9162, 
+    9163, 9164, 9165, 9166, 9167, 9168, 9169, 9170, 9171, 9172, 9173, 9174, 
+    9175, 9176, 9177, 9178, 9179, 9180, 9181, 9182, 9183, 9184, 9185, 9186, 
+    9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 
+    9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9210, 
+    9211, 9212, 9213, 9214, 9215, 9216, 9217, 9218, 9219, 9220, 9221, 9222, 
+    9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232, 9233, 9234, 
+    9235, 9236, 9237, 9238, 9239, 9240, 9241, 9242, 9243, 9244, 9245, 9246, 
+    9247, 9248, 9249, 9250, 9251, 9252, 9253, 9254, 9255, 9256, 9257, 9258, 
+    9259, 9260, 9261, 9262, 9263, 9264, 9265, 9266, 9267, 9268, 9269, 9270, 
+    9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9280, 9281, 9282, 
+    9283, 9284, 9285, 9286, 9287, 9288, 9289, 9290, 9291, 9292, 9293, 9294, 
+    9295, 9296, 9297, 9298, 9299, 9300, 9301, 9302, 9303, 9304, 9305, 9306, 
+    9307, 9308, 9309, 9310, 9311, 9312, 9313, 9314, 9315, 9316, 9317, 9318, 
+    9319, 9320, 9321, 9322, 9323, 9324, 9325, 9326, 9327, 9328, 9329, 9330, 
+    9331, 9332, 9333, 9334, 9335, 9336, 9337, 9338, 9339, 9340, 9341, 9342, 
+    9343, 9344, 9345, 9346, 9347, 9348, 9349, 9350, 9351, 9352, 9353, 9354, 
+    9355, 9356, 9357, 9358, 9359, 9360, 9361, 9362, 9363, 9364, 9365, 9366, 
+    9367, 9368, 9369, 9370, 9371, 9372, 9373, 9374, 9375, 9376, 9377, 9378, 
+    9379, 9380, 9381, 9382, 9383, 9384, 9385, 9386, 9387, 9388, 9389, 9390, 
+    9391, 9392, 9393, 9394, 9395, 9396, 9397, 9398, 9399, 9400, 9401, 9402, 
+    9403, 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, 9412, 9413, 9414, 
+    9415, 9416, 9417, 9418, 9419, 9420, 9421, 9422, 9423, 9424, 9425, 9426, 
+    9427, 9428, 9429, 9430, 9431, 9432, 9433, 9434, 9435, 9436, 9437, 9438, 
+    9439, 9440, 9441, 9442, 9443, 9444, 9445, 9446, 9447, 9448, 9449, 9450, 
+    9451, 9452, 9453, 9454, 9455, 9456, 9457, 9458, 9459, 9460, 9461, 9462, 
+    9463, 9464, 9465, 9466, 9467, 9468, 9469, 9470, 9471, 9472, 9473, 9474, 
+    9475, 9476, 9477, 9478, 9479, 9480, 9481, 9482, 9483, 9484, 9485, 9486, 
+    9487, 9488, 9489, 9490, 9491, 9492, 9493, 9494, 9495, 9496, 9497, 9498, 
+    9499, 9500, 9501, 9502, 9503, 9504, 9505, 9506, 9507, 9508, 9509, 9510, 
+    9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518, 9519, 9520, 9521, 9522, 
+    9523, 9524, 9525, 9526, 9527, 9528, 9529, 9530, 9531, 9532, 9533, 9534, 
+    9535, 9536, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 
+    9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 
+    9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 
+    9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9581, 9582, 
+    9583, 9584, 9585, 9586, 9587, 9588, 9589, 9590, 9591, 9592, 9593, 9594, 
+    9595, 9596, 9597, 9598, 9599, 9600, 9601, 9602, 9603, 9604, 9605, 9606, 
+    9607, 9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 9617, 9618, 
+    9619, 9620, 9621, 9622, 9623, 9624, 9625, 9626, 9627, 9628, 9629, 9630, 
+    9631, 9632, 9633, 9634, 9635, 9636, 9637, 9638, 9639, 9640, 9641, 9642, 
+    9643, 9644, 9645, 9646, 9647, 9648, 9649, 9650, 9651, 9652, 9653, 9654, 
+    9655, 9656, 9657, 9658, 9659, 9660, 9661, 9662, 9663, 9664, 9665, 9666, 
+    9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 
+    9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 
+    9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 
+    9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 
+    9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 
+    9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 
+    9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 
+    9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 
+    9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 
+    9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 
+    9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 
+    9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 
+    9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 
+    9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 
+    9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 
+    9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 
+    9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 
+    9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 
+    9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 
+    9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 
+    9907, 9908, 9909, 9910, 9911, 9912, 9913, 9914, 9915, 9916, 9917, 9918, 
+    9919, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 9930, 
+    9931, 9932, 9933, 9934, 9935, 9936, 9937, 9938, 9939, 9940, 9941, 9942, 
+    9943, 9944, 9945, 9946, 9947, 9948, 9949, 9950, 9951, 9952, 9953, 9954, 
+    9955, 9956, 9957, 9958, 9959, 9960, 9961, 9962, 9963, 9964, 9965, 9966, 
+    9967, 9968, 9969, 9970, 9971, 9972, 9973, 9974, 9975, 9976, 9977, 9978, 
+    9979, 9980, 9981, 9982, 9983, 9984, 9985, 9986, 9987, 9988, 9989, 9990, 
+    9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 
+    10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 
+    10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, 
+    10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030, 10031, 
+    10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 10041, 
+    10042, 10043, 10044, 10045, 10046, 10047, 10048, 10049, 10050, 10051, 
+    10052, 10053, 10054, 10055, 10056, 10057, 10058, 10059, 10060, 10061, 
+    10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070, 10071, 
+    10072, 10073, 10074, 10075, 10076, 10077, 10078, 10079, 10080, 10081, 
+    10082, 10083, 10084, 10085, 10086, 10087, 10088, 10089, 10090, 10091, 
+    10092, 10093, 10094, 10095, 10096, 10097, 10098, 10099, 10100, 10101, 
+    10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 10111, 
+    10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 10121, 
+    10122, 10123, 10124, 10125, 10126, 10127, 10128, 10129, 10130, 10131, 
+    10132, 10133, 10134, 10135, 10136, 10137, 10138, 10139, 10140, 10141, 
+    10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 10151, 
+    10152, 10153, 10154, 10155, 10156, 10157, 10158, 10159, 10160, 10161, 
+    10162, 10163, 10164, 10165, 10166, 10167, 10168, 10169, 10170, 10171, 
+    10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 10181, 
+    10182, 10183, 10184, 10185, 10186, 10187, 10188, 10189, 10190, 10191, 
+    10192, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10200, 10201, 
+    10202, 10203, 10204, 10205, 10206, 10207, 10208, 10209, 10210, 10211, 
+    10212, 10213, 10214, 10215, 10216, 10217, 10218, 10219, 10220, 10221, 
+    10222, 10223, 10224, 10225, 10226, 10227, 10228, 10229, 10230, 10231, 
+    10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 10241, 
+    10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 10251, 
+    10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 10261, 
+    10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 10271, 
+    10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 10281, 
+    10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 10291, 
+    10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 10301, 
+    10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 10311, 
+    10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 10321, 
+    10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 10331, 
+    10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 10341, 
+    10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 10351, 
+    10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 10361, 
+    10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 10371, 
+    10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 10381, 
+    10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 10391, 
+    10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 10401, 
+    10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 10411, 
+    10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 10421, 
+    10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 10431, 
+    10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 10441, 
+    10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 10451, 
+    10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 10461, 
+    10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 10471, 
+    10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 10481, 
+    10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 10491, 
+    10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 10501, 
+    10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 10511, 
+    10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 10521, 
+    10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 10531, 
+    10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 10541, 
+    10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 10551, 
+    10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 10561, 
+    10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 10571, 
+    10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 10581, 
+    10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 10591, 
+    10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 10601, 
+    10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 10611, 
+    10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 10621, 
+    10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 10631, 
+    10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 10641, 
+    10642, 10643, 10644, 10645, 10646, 10647, 10648, 10649, 10650, 10651, 
+    10652, 10653, 10654, 10655, 10656, 10657, 10658, 10659, 10660, 10661, 
+    10662, 10663, 10664, 10665, 10666, 10667, 10668, 10669, 10670, 10671, 
+    10672, 10673, 10674, 10675, 10676, 10677, 10678, 10679, 10680, 10681, 
+    10682, 10683, 10684, 10685, 10686, 10687, 10688, 10689, 10690, 10691, 
+    10692, 10693, 10694, 10695, 10696, 10697, 10698, 10699, 10700, 10701, 
+    10702, 10703, 10704, 10705, 10706, 10707, 10708, 10709, 10710, 10711, 
+    10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 10721, 
+    10722, 10723, 10724, 10725, 10726, 10727, 10728, 10729, 10730, 10731, 
+    10732, 10733, 10734, 10735, 10736, 10737, 10738, 10739, 10740, 10741, 
+    10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 10751, 
+    10752, 10753, 10754, 10755, 10756, 10757, 10758, 10759, 10760, 10761, 
+    10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 10771, 
+    10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 10781, 
+    10782, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 10791, 
+    10792, 10793, 10794, 10795, 10796, 10797, 10798, 10799, 10800, 10801, 
+    10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811, 
+    10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 10821, 
+    10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 10831, 
+    10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 10841, 
+    10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 10851, 
+    10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 10861, 
+    10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 10871, 
+    10872, 10873, 10874, 10875, 10876, 10877, 10878, 10879, 10880, 10881, 
+    10882, 10883, 10884, 10885, 10886, 10887, 10888, 10889, 10890, 10891, 
+    10892, 10893, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 10901, 
+    10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10910, 10911, 
+    10912, 10913, 10914, 10915, 10916, 10917, 10918, 10919, 10920, 10921, 
+    10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 10931, 
+    10932, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 10940, 10941, 
+    10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 10951, 
+    10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 10961, 
+    10962, 10963, 10964, 10965, 10966, 10967, 10968, 10969, 10970, 10971, 
+    10972, 10973, 10974, 10975, 10976, 10977, 10978, 10979, 10980, 10981, 
+    10982, 10983, 10984, 10985, 10986, 10987, 10988, 10989, 10990, 10991, 
+    10992, 10993, 10994, 10995, 10996, 10997, 10998, 10999, 11000, 11001, 
+    11002, 11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 11011, 
+    11012, 11013, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 11021, 
+    11022, 11023, 11024, 11025, 11026, 11027, 11028, 11029, 11030, 11031, 
+    11032, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11040, 11041, 
+    11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 11051, 
+    11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 11061, 
+    11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069, 11070, 11071, 
+    11072, 11073, 11074, 11075, 11076, 11077, 11078, 11079, 11080, 11081, 
+    11082, 11083, 11084, 11085, 11086, 11087, 11088, 11089, 11090, 11091, 
+    11092, 11093, 11094, 11095, 11096, 11097, 11098, 11099, 11100, 11101, 
+    11102, 11103, 11104, 11105, 11106, 11107, 11108, 11109, 11110, 11111, 
+    11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 11121, 
+    11122, 11123, 11124, 11125, 11126, 11127, 11128, 11129, 11130, 11131, 
+    11132, 11133, 11134, 11135, 11136, 11137, 11138, 11139, 11140, 11141, 
+    11142, 11143, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 11151, 
+    11152, 11153, 11154, 11155, 11156, 11157, 11158, 11159, 11160, 11161, 
+    11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170, 11171, 
+    11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 11181, 
+    11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 11191, 
+    11192, 11193, 11194, 11195, 11196, 11197, 11198, 11199, 11200, 11201, 
+    11202, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210, 11211, 
+    11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220, 11221, 
+    11222, 11223, 11224, 11225, 11226, 11227, 11228, 11229, 11230, 11231, 
+    11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11240, 11241, 
+    11242, 11243, 11244, 11245, 11246, 11247, 11248, 11249, 11250, 11251, 
+    11252, 11253, 11254, 11255, 11256, 11257, 11258, 11259, 11260, 11261, 
+    11262, 11263, 11264, 11265, 11266, 11267, 11268, 11269, 11270, 11271, 
+    11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 11281, 
+    11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 11291, 
+    11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 11301, 
+    11302, 11303, 11304, 11305, 11306, 11307, 11308, 11309, 11310, 11311, 
+    11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 11321, 
+    11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 11331, 
+    11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 11341, 
+    11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 11351, 
+    11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11360, 11361, 
+    11362, 11363, 11364, 11365, 11366, 11367, 11368, 11369, 11370, 11371, 
+    11372, 11373, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 11381, 
+    11382, 11383, 11384, 11385, 11386, 11387, 11388, 11389, 11390, 11391, 
+    11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 11401, 
+    11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 11411, 
+    11412, 11413, 11414, 11415, 11416, 11417, 11418, 11419, 11420, 11421, 
+    11422, 11423, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 11431, 
+    11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 11441, 
+    11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 
+    11452, 11453, 11454, 11455, 11456, 11457, 11458, 11459, 11460, 11461, 
+    11462, 11463, 11464, 11465, 11466, 11467, 11468, 11469, 11470, 11471, 
+    11472, 11473, 11474, 11475, 11476, 11477, 11478, 11479, 11480, 11481, 
+    11482, 11483, 11484, 11485, 11486, 11487, 11488, 11489, 11490, 11491, 
+    11492, 11493, 11494, 11495, 11496, 11497, 11498, 11499, 11500, 11501, 
+    11502, 11503, 11504, 11505, 11506, 11507, 11508, 11509, 11510, 11511, 
+    11512, 11513, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 11521, 
+    11522, 11523, 11524, 11525, 11526, 11527, 11528, 11529, 11530, 11531, 
+    11532, 11533, 11534, 11535, 11536, 11537, 11538, 11539, 11540, 11541, 
+    11542, 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, 11551, 
+    11552, 11553, 11554, 11555, 11556, 11557, 11558, 11559, 11560, 11561, 
+    11562, 11563, 11564, 11565, 11566, 11567, 11568, 11569, 11570, 11571, 
+    11572, 11573, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 11581, 
+    11582, 11583, 11584, 11585, 11586, 11587, 11588, 11589, 11590, 11591, 
+    11592, 11593, 11594, 11595, 11596, 11597, 11598, 11599, 11600, 11601, 
+    11602, 11603, 11604, 11605, 11606, 11607, 11608, 11609, 11610, 11611, 
+    11612, 11613, 11614, 11615, 11616, 11617, 11618, 11619, 11620, 11621, 
+    11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629, 11630, 11631, 
+    11632, 11633, 11634, 11635, 11636, 11637, 11638, 11639, 11640, 11641, 
+    11642, 11643, 11644, 11645, 11646, 11647, 11648, 11649, 11650, 11651, 
+    11652, 11653, 11654, 11655, 11656, 11657, 11658, 11659, 11660, 11661, 
+    11662, 11663, 11664, 11665, 11666, 11667, 11668, 11669, 11670, 11671, 
+    11672, 11673, 11674, 11675, 11676, 11677, 11678, 11679, 11680, 11681, 
+    11682, 11683, 11684, 11685, 11686, 11687, 11688, 11689, 11690, 11691, 
+    11692, 11693, 11694, 11695, 11696, 11697, 11698, 11699, 11700, 11701, 
+    11702, 11703, 11704, 11705, 11706, 11707, 11708, 11709, 11710, 11711, 
+    11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 11720, 11721, 
+    11722, 11723, 11724, 11725, 11726, 11727, 11728, 11729, 11730, 11731, 
+    11732, 11733, 11734, 11735, 11736, 11737, 11738, 11739, 11740, 11741, 
+    11742, 11743, 11744, 11745, 11746, 11747, 11748, 11749, 11750, 11751, 
+    11752, 11753, 11754, 11755, 11756, 11757, 11758, 11759, 11760, 11761, 
+    11762, 11763, 11764, 11765, 11766, 11767, 11768, 11769, 11770, 11771, 
+    11772, 11773, 11774, 11775, 11776, 11777, 11778, 11779, 11780, 11781, 
+    11782, 11783, 11784, 11785, 11786, 11787, 11788, 11789, 11790, 11791, 
+    11792, 11793, 11794, 11795, 11796, 11797, 11798, 11799, 11800, 11801, 
+    11802, 11803, 11804, 11805, 11806, 11807, 11808, 11809, 11810, 11811, 
+    11812, 11813, 11814, 11815, 11816, 11817, 11818, 11819, 11820, 11821, 
+    11822, 11823, 11824, 11825, 11826, 11827, 11828, 11829, 11830, 11831, 
+    11832, 11833, 11834, 11835, 11836, 11837, 11838, 11839, 11840, 11841, 
+    11842, 11843, 11844, 11845, 11846, 11847, 11848, 11849, 11850, 11851, 
+    11852, 11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 11861, 
+    11862, 11863, 11864, 11865, 11866, 11867, 11868, 11869, 11870, 11871, 
+    11872, 11873, 11874, 11875, 11876, 11877, 11878, 11879, 11880, 11881, 
+    11882, 11883, 11884, 11885, 11886, 11887, 11888, 11889, 11890, 11891, 
+    11892, 11893, 11894, 11895, 11896, 11897, 11898, 11899, 11900, 11901, 
+    11902, 11903, 11904, 11905, 11906, 11907, 11908, 11909, 11910, 11911, 
+    11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919, 11920, 11921, 
+    11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 11931, 
+    11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 11941, 
+    11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 11951, 
+    11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 11961, 
+    11962, 11963, 11964, 11965, 11966, 11967, 11968, 11969, 11970, 11971, 
+    11972, 11973, 11974, 11975, 11976, 11977, 11978, 11979, 11980, 11981, 
+    11982, 11983, 11984, 11985, 11986, 11987, 11988, 11989, 11990, 11991, 
+    11992, 11993, 11994, 11995, 11996, 11997, 11998, 11999, 12000, 12001, 
+    12002, 12003, 12004, 12005, 12006, 12007, 12008, 12009, 12010, 12011, 
+    12012, 12013, 12014, 12015, 12016, 12017, 12018, 12019, 12020, 12021, 
+    12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 12031, 
+    12032, 12033, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 12041, 
+    12042, 12043, 12044, 12045, 12046, 12047, 12048, 12049, 12050, 12051, 
+    12052, 12053, 12054, 12055, 12056, 12057, 12058, 12059, 12060, 12061, 
+    12062, 12063, 12064, 12065, 12066, 12067, 12068, 12069, 12070, 12071, 
+    12072, 12073, 12074, 12075, 12076, 12077, 12078, 12079, 12080, 12081, 
+    12082, 12083, 12084, 12085, 12086, 12087, 12088, 12089, 12090, 12091, 
+    12092, 12093, 12094, 12095, 12096, 12097, 12098, 12099, 12100, 12101, 
+    12102, 12103, 12104, 12105, 12106, 12107, 12108, 12109, 12110, 12111, 
+    12112, 12113, 12114, 12115, 12116, 12117, 12118, 12119, 12120, 12121, 
+    12122, 12123, 12124, 12125, 12126, 12127, 12128, 12129, 12130, 12131, 
+    12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 12141, 
+    12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 
+    12152, 12153, 12154, 12155, 12156, 12157, 12158, 12159, 12160, 12161, 
+    12162, 12163, 12164, 12165, 12166, 12167, 12168, 12169, 12170, 12171, 
+    12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12181, 
+    12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 12191, 
+    12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 12201, 
+    12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 
+    12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 12221, 
+    12222, 12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 12231, 
+    12232, 12233, 12234, 12235, 12236, 12237, 12238, 12239, 12240, 12241, 
+    12242, 12243, 12244, 12245, 12246, 12247, 12248, 12249, 12250, 12251, 
+    12252, 12253, 12254, 12255, 12256, 12257, 12258, 12259, 12260, 12261, 
+    12262, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 12271, 
+    12272, 12273, 12274, 12275, 12276, 12277, 12278, 12279, 12280, 12281, 
+    12282, 12283, 12284, 12285, 12286, 12287, 12288, 12289, 12290, 12291, 
+    12292, 12293, 12294, 12295, 12296, 12297, 12298, 12299, 12300, 12301, 
+    12302, 12303, 12304, 12305, 12306, 12307, 12308, 12309, 12310, 12311, 
+    12312, 12313, 12314, 12315, 12316, 12317, 12318, 12319, 12320, 12321, 
+    12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330, 12331, 
+    12332, 12333, 12334, 12335, 12336, 12337, 12338, 12339, 12340, 12341, 
+    12342, 12343, 12344, 12345, 12346, 12347, 12348, 12349, 12350, 12351, 
+    12352, 12353, 12354, 12355, 12356, 12357, 12358, 12359, 12360, 12361, 
+    12362, 12363, 12364, 12365, 12366, 12367, 12368, 12369, 12370, 12371, 
+    12372, 12373, 12374, 12375, 12376, 12377, 12378, 12379, 12380, 12381, 
+    12382, 12383, 12384, 12385, 12386, 12387, 12388, 12389, 12390, 12391, 
+    12392, 12393, 12394, 12395, 12396, 12397, 12398, 12399, 12400, 12401, 
+    12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 
+    12412, 12413, 12414, 12415, 12416, 12417, 12418, 12419, 12420, 12421, 
+    12422, 12423, 12424, 12425, 12426, 12427, 12428, 12429, 12430, 12431, 
+    12432, 12433, 12434, 12435, 12436, 12437, 12438, 12439, 12440, 12441, 
+    12442, 12443, 12444, 12445, 12446, 12447, 12448, 12449, 12450, 12451, 
+    12452, 12453, 12454, 12455, 12456, 12457, 12458, 12459, 12460, 12461, 
+    12462, 12463, 12464, 12465, 12466, 12467, 12468, 12469, 12470, 12471, 
+    12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 
+    12482, 12483, 12484, 12485, 12486, 12487, 12488, 12489, 12490, 12491, 
+    12492, 12493, 12494, 12495, 12496, 12497, 12498, 12499, 12500, 12501, 
+    12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 12510, 12511, 
+    12512, 12513, 12514, 12515, 12516, 12517, 12518, 12519, 12520, 12521, 
+    12522, 12523, 12524, 12525, 12526, 12527, 12528, 12529, 12530, 12531, 
+    12532, 12533, 12534, 12535, 12536, 12537, 12538, 12539, 12540, 12541, 
+    12542, 12543, 12544, 12545, 12546, 12547, 12548, 12549, 12550, 12551, 
+    12552, 12553, 12554, 12555, 12556, 12557, 12558, 12559, 12560, 12561, 
+    12562, 12563, 12564, 12565, 12566, 12567, 12568, 12569, 12570, 12571, 
+    12572, 12573, 12574, 12575, 12576, 12577, 12578, 12579, 12580, 12581, 
+    12582, 12583, 12584, 12585, 12586, 12587, 12588, 12589, 12590, 12591, 
+    12592, 12593, 12594, 12595, 12596, 12597, 12598, 12599, 12600, 12601, 
+    12602, 12603, 12604, 12605, 12606, 12607, 12608, 12609, 12610, 12611, 
+    12612, 12613, 12614, 12615, 12616, 12617, 12618, 12619, 12620, 12621, 
+    12622, 12623, 12624, 12625, 12626, 12627, 12628, 12629, 12630, 12631, 
+    12632, 12633, 12634, 12635, 12636, 12637, 12638, 12639, 12640, 12641, 
+    12642, 12643, 12644, 12645, 12646, 12647, 12648, 12649, 12650, 12651, 
+    12652, 12653, 12654, 12655, 12656, 12657, 12658, 12659, 12660, 12661, 
+    12662, 12663, 12664, 12665, 12666, 12667, 12668, 12669, 12670, 12671, 
+    12672, 12673, 12674, 12675, 12676, 12677, 12678, 12679, 12680, 12681, 
+    12682, 12683, 12684, 12685, 12686, 12687, 12688, 12689, 12690, 12691, 
+    12692, 12693, 12694, 12695, 12696, 12697, 12698, 12699, 12700, 12701, 
+    12702, 12703, 12704, 12705, 12706, 12707, 12708, 12709, 12710, 12711, 
+    12712, 12713, 12714, 12715, 12716, 12717, 12718, 12719, 12720, 12721, 
+    12722, 12723, 12724, 12725, 12726, 12727, 12728, 12729, 12730, 12731, 
+    12732, 12733, 12734, 12735, 12736, 12737, 12738, 12739, 12740, 12741, 
+    12742, 12743, 12744, 12745, 12746, 12747, 12748, 12749, 12750, 12751, 
+    12752, 12753, 12754, 12755, 12756, 12757, 12758, 12759, 12760, 12761, 
+    12762, 12763, 12764, 12765, 12766, 12767, 12768, 12769, 12770, 12771, 
+    12772, 12773, 12774, 12775, 12776, 12777, 12778, 12779, 12780, 12781, 
+    12782, 12783, 12784, 12785, 12786, 12787, 12788, 12789, 12790, 12791, 
+    12792, 12793, 12794, 12795, 12796, 12797, 12798, 12799, 12800, 12801, 
+    12802, 12803, 12804, 12805, 12806, 12807, 12808, 12809, 12810, 12811, 
+    12812, 12813, 12814, 12815, 12816, 12817, 12818, 12819, 12820, 12821, 
+    12822, 12823, 12824, 12825, 12826, 12827, 12828, 12829, 12830, 12831, 
+    12832, 12833, 12834, 12835, 12836, 12837, 12838, 12839, 12840, 12841, 
+    12842, 12843, 12844, 12845, 12846, 12847, 12848, 12849, 12850, 12851, 
+    12852, 12853, 12854, 12855, 12856, 12857, 12858, 12859, 12860, 12861, 
+    12862, 12863, 12864, 12865, 12866, 12867, 12868, 12869, 12870, 12871, 
+    12872, 12873, 12874, 12875, 12876, 12877, 12878, 12879, 12880, 12881, 
+    12882, 12883, 12884, 12885, 12886, 12887, 12888, 12889, 12890, 12891, 
+    12892, 12893, 12894, 12895, 12896, 12897, 12898, 12899, 12900, 12901, 
+    12902, 12903, 12904, 12905, 12906, 12907, 12908, 12909, 12910, 12911, 
+    12912, 12913, 12914, 12915, 12916, 12917, 12918, 12919, 12920, 12921, 
+    12922, 12923, 12924, 12925, 12926, 12927, 12928, 12929, 12930, 12931, 
+    12932, 12933, 12934, 12935, 12936, 12937, 12938, 12939, 12940, 12941, 
+    12942, 12943, 12944, 12945, 12946, 12947, 12948, 12949, 12950, 12951, 
+    12952, 12953, 12954, 12955, 12956, 12957, 12958, 12959, 12960, 12961, 
+    12962, 12963, 12964, 12965, 12966, 12967, 12968, 12969, 12970, 12971, 
+    12972, 12973, 12974, 12975, 12976, 12977, 12978, 12979, 12980, 12981, 
+    12982, 12983, 12984, 12985, 12986, 12987, 12988, 12989, 12990, 12991, 
+    12992, 12993, 12994, 12995, 12996, 12997, 12998, 12999, 13000, 13001, 
+    13002, 13003, 13004, 13005, 13006, 13007, 13008, 13009, 13010, 13011, 
+    13012, 13013, 13014, 13015, 13016, 13017, 13018, 13019, 13020, 13021, 
+    13022, 13023, 13024, 13025, 13026, 13027, 13028, 13029, 13030, 13031, 
+    13032, 13033, 13034, 13035, 13036, 13037, 13038, 13039, 13040, 13041, 
+    13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050, 13051, 
+    13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060, 13061, 
+    13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070, 13071, 
+    13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 13081, 
+    13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090, 13091, 
+    13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100, 13101, 
+    13102, 13103, 13104, 13105, 13106, 13107, 13108, 13109, 13110, 13111, 
+    13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120, 13121, 
+    13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130, 13131, 
+    13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140, 13141, 
+    13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150, 13151, 
+    13152, 13153, 13154, 13155, 13156, 13157, 13158, 13159, 13160, 13161, 
+    13162, 13163, 13164, 13165, 13166, 13167, 13168, 13169, 13170, 13171, 
+    13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180, 13181, 
+    13182, 13183, 13184, 13185, 13186, 13187, 13188, 13189, 13190, 13191, 
+    13192, 13193, 13194, 13195, 13196, 13197, 13198, 13199, 13200, 13201, 
+    13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210, 13211, 
+    13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220, 13221, 
+    13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230, 13231, 
+    13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240, 13241, 
+    13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250, 13251, 
+    13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260, 13261, 
+    13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270, 13271, 
+    13272, 13273, 13274, 13275, 13276, 13277, 13278, 13279, 13280, 13281, 
+    13282, 13283, 13284, 13285, 13286, 13287, 13288, 13289, 13290, 13291, 
+    13292, 13293, 13294, 13295, 13296, 13297, 13298, 13299, 13300, 13301, 
+    13302, 13303, 13304, 13305, 13306, 13307, 13308, 13309, 13310, 13311, 
+    13312, 13313, 13314, 13315, 13316, 13317, 13318, 13319, 13320, 13321, 
+    13322, 13323, 13324, 13325, 13326, 13327, 13328, 13329, 13330, 13331, 
+    13332, 13333, 13334, 13335, 13336, 13337, 13338, 13339, 13340, 13341, 
+    13342, 13343, 13344, 13345, 13346, 13347, 13348, 13349, 13350, 13351, 
+    13352, 13353, 13354, 13355, 13356, 13357, 13358, 13359, 13360, 13361, 
+    13362, 13363, 13364, 13365, 13366, 13367, 13368, 13369, 13370, 13371, 
+    13372, 13373, 13374, 13375, 13376, 13377, 13378, 13379, 13380, 13381, 
+    13382, 13383, 13384, 13385, 13386, 13387, 13388, 13389, 13390, 13391, 
+    13392, 13393, 13394, 13395, 13396, 13397, 13398, 13399, 13400, 13401, 
+    13402, 13403, 13404, 13405, 13406, 13407, 13408, 13409, 13410, 13411, 
+    13412, 13413, 13414, 13415, 13416, 13417, 13418, 13419, 13420, 13421, 
+    13422, 13423, 13424, 13425, 13426, 13427, 13428, 13429, 13430, 13431, 
+    13432, 13433, 13434, 13435, 13436, 13437, 13438, 13439, 13440, 13441, 
+    13442, 13443, 13444, 13445, 13446, 13447, 13448, 13449, 13450, 13451, 
+    13452, 13453, 13454, 13455, 13456, 13457, 13458, 13459, 13460, 13461, 
+    13462, 13463, 13464, 13465, 13466, 13467, 13468, 13469, 13470, 13471, 
+    13472, 13473, 13474, 13475, 13476, 13477, 13478, 13479, 13480, 13481, 
+    13482, 13483, 13484, 13485, 13486, 13487, 13488, 13489, 13490, 13491, 
+    13492, 13493, 13494, 13495, 13496, 13497, 13498, 13499, 13500, 13501, 
+    13502, 13503, 13504, 13505, 13506, 13507, 13508, 13509, 13510, 13511, 
+    13512, 13513, 13514, 13515, 13516, 13517, 13518, 13519, 13520, 13521, 
+    13522, 13523, 13524, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 
+    13532, 13533, 13534, 13535, 13536, 13537, 13538, 13539, 13540, 13541, 
+    13542, 13543, 13544, 13545, 13546, 13547, 13548, 13549, 13550, 13551, 
+    13552, 13553, 13554, 13555, 13556, 13557, 13558, 13559, 13560, 13561, 
+    13562, 13563, 13564, 13565, 13566, 13567, 13568, 13569, 13570, 13571, 
+    13572, 13573, 13574, 13575, 13576, 13577, 13578, 13579, 13580, 13581, 
+    13582, 13583, 13584, 13585, 13586, 13587, 13588, 13589, 13590, 13591, 
+    13592, 13593, 13594, 13595, 13596, 13597, 13598, 13599, 13600, 13601, 
+    13602, 13603, 13604, 13605, 13606, 13607, 13608, 13609, 13610, 13611, 
+    13612, 13613, 13614, 13615, 13616, 13617, 13618, 13619, 13620, 13621, 
+    13622, 13623, 13624, 13625, 13626, 13627, 13628, 13629, 13630, 13631, 
+    13632, 13633, 13634, 13635, 13636, 13637, 13638, 13639, 13640, 13641, 
+    13642, 13643, 13644, 13645, 13646, 13647, 13648, 13649, 13650, 13651, 
+    13652, 13653, 13654, 13655, 13656, 13657, 13658, 13659, 13660, 13661, 
+    13662, 13663, 13664, 13665, 13666, 13667, 13668, 13669, 13670, 13671, 
+    13672, 13673, 13674, 13675, 13676, 13677, 13678, 13679, 13680, 13681, 
+    13682, 13683, 13684, 13685, 13686, 13687, 13688, 13689, 13690, 13691, 
+    13692, 13693, 13694, 13695, 13696, 13697, 13698, 13699, 13700, 13701, 
+    13702, 13703, 13704, 13705, 13706, 13707, 13708, 13709, 13710, 13711, 
+    13712, 13713, 13714, 13715, 13716, 13717, 13718, 13719, 13720, 13721, 
+    13722, 13723, 13724, 13725, 13726, 13727, 13728, 13729, 13730, 13731, 
+    13732, 13733, 13734, 13735, 13736, 13737, 13738, 13739, 13740, 13741, 
+    13742, 13743, 13744, 13745, 13746, 13747, 13748, 13749, 13750, 13751, 
+    13752, 13753, 13754, 13755, 13756, 13757, 13758, 13759, 13760, 13761, 
+    13762, 13763, 13764, 13765, 13766, 13767, 13768, 13769, 13770, 13771, 
+    13772, 13773, 13774, 13775, 13776, 13777, 13778, 13779, 13780, 13781, 
+    13782, 13783, 13784, 13785, 13786, 13787, 13788, 13789, 13790, 13791, 
+    13792, 13793, 13794, 13795, 13796, 13797, 13798, 13799, 13800, 13801, 
+    13802, 13803, 13804, 13805, 13806, 13807, 13808, 13809, 13810, 13811, 
+    13812, 13813, 13814, 13815, 13816, 13817, 13818, 13819, 13820, 13821, 
+    13822, 13823, 13824, 13825, 13826, 13827, 13828, 13829, 13830, 13831, 
+    13832, 13833, 13834, 13835, 13836, 13837, 13838, 13839, 13840, 13841, 
+    13842, 13843, 13844, 13845, 13846, 13847, 13848, 13849, 13850, 13851, 
+    13852, 13853, 13854, 13855, 13856, 13857, 13858, 13859, 13860, 13861, 
+    13862, 13863, 13864, 13865, 13866, 13867, 13868, 13869, 13870, 13871, 
+    13872, 13873, 13874, 13875, 13876, 13877, 13878, 13879, 13880, 13881, 
+    13882, 13883, 13884, 13885, 13886, 13887, 13888, 13889, 13890, 13891, 
+    13892, 13893, 13894, 13895, 13896, 13897, 13898, 13899, 13900, 13901, 
+    13902, 13903, 13904, 13905, 13906, 13907, 13908, 13909, 13910, 13911, 
+    13912, 13913, 13914, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 
+    13922, 13923, 13924, 13925, 13926, 13927, 13928, 13929, 13930, 13931, 
+    13932, 13933, 13934, 13935, 13936, 13937, 13938, 13939, 13940, 13941, 
+    13942, 13943, 13944, 13945, 13946, 13947, 13948, 13949, 13950, 13951, 
+    13952, 13953, 13954, 13955, 13956, 13957, 13958, 13959, 13960, 13961, 
+    13962, 13963, 13964, 13965, 13966, 13967, 13968, 13969, 13970, 13971, 
+    13972, 13973, 13974, 13975, 13976, 13977, 13978, 13979, 13980, 13981, 
+    13982, 13983, 13984, 13985, 13986, 13987, 13988, 13989, 13990, 13991, 
+    13992, 13993, 13994, 13995, 13996, 13997, 13998, 13999, 14000, 14001, 
+    14002, 14003, 14004, 14005, 14006, 14007, 14008, 14009, 14010, 14011, 
+    14012, 14013, 14014, 14015, 14016, 14017, 14018, 14019, 14020, 14021, 
+    14022, 14023, 14024, 14025, 14026, 14027, 14028, 14029, 14030, 14031, 
+    14032, 14033, 14034, 14035, 14036, 14037, 14038, 14039, 14040, 14041, 
+    14042, 14043, 14044, 14045, 14046, 14047, 14048, 14049, 14050, 14051, 
+    14052, 14053, 14054, 14055, 14056, 14057, 14058, 14059, 14060, 14061, 
+    14062, 14063, 14064, 14065, 14066, 14067, 14068, 14069, 14070, 14071, 
+    14072, 14073, 14074, 14075, 14076, 14077, 14078, 14079, 14080, 14081, 
+    14082, 14083, 14084, 14085, 14086, 14087, 14088, 14089, 14090, 14091, 
+    14092, 14093, 14094, 14095, 14096, 14097, 14098, 14099, 14100, 14101, 
+    14102, 14103, 14104, 14105, 14106, 14107, 14108, 14109, 14110, 14111, 
+    14112, 14113, 14114, 14115, 14116, 14117, 14118, 14119, 14120, 14121, 
+    14122, 14123, 14124, 14125, 14126, 14127, 14128, 14129, 14130, 14131, 
+    14132, 14133, 14134, 14135, 14136, 14137, 14138, 14139, 14140, 14141, 
+    14142, 14143, 14144, 14145, 14146, 14147, 14148, 14149, 14150, 14151, 
+    14152, 14153, 14154, 14155, 14156, 14157, 14158, 14159, 14160, 14161, 
+    14162, 14163, 14164, 14165, 14166, 14167, 14168, 14169, 14170, 14171, 
+    14172, 14173, 14174, 14175, 14176, 14177, 14178, 14179, 14180, 14181, 
+    14182, 14183, 14184, 14185, 14186, 14187, 14188, 14189, 14190, 14191, 
+    14192, 14193, 14194, 14195, 14196, 14197, 14198, 14199, 14200, 14201, 
+    14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210, 14211, 
+    14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220, 14221, 
+    14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230, 14231, 
+    14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240, 14241, 
+    14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250, 14251, 
+    14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260, 14261, 
+    14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270, 14271, 
+    14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280, 14281, 
+    14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290, 14291, 
+    14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300, 14301, 
+    14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310, 14311, 
+    14312, 14313, 14314, 14315, 14316, 14317, 14318, 14319, 14320, 14321, 
+    14322, 14323, 14324, 14325, 14326, 14327, 14328, 14329, 14330, 14331, 
+    14332, 14333, 14334, 14335, 14336, 14337, 14338, 14339, 14340, 14341, 
+    14342, 14343, 14344, 14345, 14346, 14347, 14348, 14349, 14350, 14351, 
+    14352, 14353, 14354, 14355, 14356, 14357, 14358, 14359, 14360, 14361, 
+    14362, 14363, 14364, 14365, 14366, 14367, 14368, 14369, 14370, 14371, 
+    14372, 14373, 14374, 14375, 14376, 14377, 14378, 14379, 14380, 14381, 
+    14382, 14383, 14384, 14385, 14386, 14387, 14388, 14389, 14390, 14391, 
+    14392, 14393, 14394, 14395, 14396, 14397, 14398, 14399, 14400, 14401, 
+    14402, 14403, 14404, 14405, 14406, 14407, 14408, 14409, 14410, 14411, 
+    14412, 14413, 14414, 14415, 14416, 14417, 14418, 14419, 14420, 14421, 
+    14422, 14423, 14424, 14425, 14426, 14427, 14428, 14429, 14430, 14431, 
+    14432, 14433, 14434, 14435, 14436, 14437, 14438, 14439, 14440, 14441, 
+    14442, 14443, 14444, 14445, 14446, 14447, 14448, 14449, 14450, 14451, 
+    14452, 14453, 14454, 14455, 14456, 14457, 14458, 14459, 14460, 14461, 
+    14462, 14463, 14464, 14465, 14466, 14467, 14468, 14469, 14470, 14471, 
+    14472, 14473, 14474, 14475, 14476, 14477, 14478, 14479, 14480, 14481, 
+    14482, 14483, 14484, 14485, 14486, 14487, 14488, 14489, 14490, 14491, 
+    14492, 14493, 14494, 14495, 14496, 14497, 14498, 14499, 14500, 14501, 
+    14502, 14503, 14504, 14505, 14506, 14507, 14508, 14509, 14510, 14511, 
+    14512, 14513, 14514, 14515, 14516, 14517, 14518, 14519, 14520, 14521, 
+    14522, 14523, 14524, 14525, 14526, 14527, 14528, 14529, 14530, 14531, 
+    14532, 14533, 14534, 14535, 14536, 14537, 14538, 14539, 14540, 14541, 
+    14542, 14543, 14544, 14545, 14546, 14547, 14548, 14549, 14550, 14551, 
+    14552, 14553, 14554, 14555, 14556, 14557, 14558, 14559, 14560, 14561, 
+    14562, 14563, 14564, 14565, 14566, 14567, 14568, 14569, 14570, 14571, 
+    14572, 14573, 14574, 14575, 14576, 14577, 14578, 14579, 14580, 14581, 
+    14582, 14583, 14584, 14585, 14586, 14587, 14588, 14589, 14590, 14591, 
+    14592, 14593, 14594, 14595, 14596, 14597, 14598, 14599, 14600, 14601, 
+    14602, 14603, 14604, 14605, 14606, 14607, 14608, 14609, 14610, 14611, 
+    14612, 14613, 14614, 14615, 14616, 14617, 14618, 14619, 14620, 14621, 
+    14622, 14623, 14624, 14625, 14626, 14627, 14628, 14629, 14630, 14631, 
+    14632, 14633, 14634, 14635, 14636, 14637, 14638, 14639, 14640, 14641, 
+    14642, 14643, 14644, 14645, 14646, 14647, 14648, 14649, 14650, 14651, 
+    14652, 14653, 14654, 14655, 14656, 14657, 14658, 14659, 14660, 14661, 
+    14662, 14663, 14664, 14665, 14666, 14667, 14668, 14669, 14670, 14671, 
+    14672, 14673, 14674, 14675, 14676, 14677, 14678, 14679, 14680, 14681, 
+    14682, 14683, 14684, 14685, 14686, 14687, 14688, 14689, 14690, 14691, 
+    14692, 14693, 14694, 14695, 14696, 14697, 14698, 14699, 14700, 14701, 
+    14702, 14703, 14704, 14705, 14706, 14707, 14708, 14709, 14710, 14711, 
+    14712, 14713, 14714, 14715, 14716, 14717, 14718, 14719, 14720, 14721, 
+    14722, 14723, 14724, 14725, 14726, 14727, 14728, 14729, 14730, 14731, 
+    14732, 14733, 14734, 14735, 14736, 14737, 14738, 14739, 14740, 14741, 
+    14742, 14743, 14744, 14745, 14746, 14747, 14748, 14749, 14750, 14751, 
+    14752, 14753, 14754, 14755, 14756, 14757, 14758, 14759, 14760, 14761, 
+    14762, 14763, 14764, 14765, 14766, 14767, 14768, 14769, 14770, 14771, 
+    14772, 14773, 14774, 14775, 14776, 14777, 14778, 14779, 14780, 14781, 
+    14782, 14783, 14784, 14785, 14786, 14787, 14788, 14789, 14790, 14791, 
+    14792, 14793, 14794, 14795, 14796, 14797, 14798, 14799, 14800, 14801, 
+    14802, 14803, 14804, 14805, 14806, 14807, 14808, 14809, 14810, 14811, 
+    14812, 14813, 14814, 14815, 14816, 14817, 14818, 14819, 14820, 14821, 
+    14822, 14823, 14824, 14825, 14826, 14827, 14828, 14829, 14830, 14831, 
+    14832, 14833, 14834, 14835, 14836, 14837, 14838, 14839, 14840, 14841, 
+    14842, 14843, 14844, 14845, 14846, 14847, 14848, 14849, 14850, 14851, 
+    14852, 14853, 14854, 14855, 14856, 14857, 14858, 14859, 14860, 14861, 
+    14862, 14863, 14864, 14865, 14866, 14867, 14868, 14869, 14870, 14871, 
+    14872, 14873, 14874, 14875, 14876, 14877, 14878, 14879, 14880, 14881, 
+    14882, 14883, 14884, 14885, 14886, 14887, 14888, 14889, 14890, 14891, 
+    14892, 14893, 14894, 14895, 14896, 14897, 14898, 14899, 14900, 14901, 
+    14902, 14903, 14904, 14905, 14906, 14907, 14908, 14909, 14910, 14911, 
+    14912, 14913, 14914, 14915, 14916, 14917, 14918, 14919, 14920, 14921, 
+    14922, 14923, 14924, 14925, 14926, 14927, 14928, 14929, 14930, 14931, 
+    14932, 14933, 14934, 14935, 14936, 14937, 14938, 14939, 14940, 14941, 
+    14942, 14943, 14944, 14945, 14946, 14947, 14948, 14949, 14950, 14951, 
+    14952, 14953, 14954, 14955, 14956, 14957, 14958, 14959, 14960, 14961, 
+    14962, 14963, 14964, 14965, 14966, 14967, 14968, 14969, 14970, 14971, 
+    14972, 14973, 14974, 14975, 14976, 14977, 14978, 14979, 14980, 14981, 
+    14982, 14983, 14984, 14985, 14986, 14987, 14988, 14989, 14990, 14991, 
+    14992, 14993, 14994, 14995, 14996, 14997, 14998, 14999, 15000, 15001, 
+    15002, 15003, 15004, 15005, 15006, 15007, 15008, 15009, 15010, 15011, 
+    15012, 15013, 15014, 15015, 15016, 15017, 15018, 15019, 15020, 15021, 
+    15022, 15023, 15024, 15025, 15026, 15027, 15028, 15029, 15030, 15031, 
+    15032, 15033, 15034, 15035, 15036, 15037, 15038, 15039, 15040, 15041, 
+    15042, 15043, 15044, 15045, 15046, 15047, 15048, 15049, 15050, 15051, 
+    15052, 15053, 15054, 15055, 15056, 15057, 15058, 15059, 15060, 15061, 
+    15062, 15063, 15064, 15065, 15066, 15067, 15068, 15069, 15070, 15071, 
+    15072, 15073, 15074, 15075, 15076, 15077, 15078, 15079, 15080, 15081, 
+    15082, 15083, 15084, 15085, 15086, 15087, 15088, 15089, 15090, 15091, 
+    15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100, 15101, 
+    15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 15111, 
+    15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120, 15121, 
+    15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 15131, 
+    15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 15141, 
+    15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 15151, 
+    15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 15161, 
+    15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 15171, 
+    15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 15181, 
+    15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 15191, 
+    15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 
+    15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 15211, 
+    15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 15221, 
+    15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 15231, 
+    15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 15241, 
+    15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 15251, 
+    15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 15261, 
+    15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 15271, 
+    15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 15281, 
+    15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 15291, 
+    15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 15301, 
+    15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 15311, 
+    15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320, 15321, 
+    15322, 15323, 15324, 15325, 15326, 15327, 15328, 15329, 15330, 15331, 
+    15332, 15333, 15334, 15335, 15336, 15337, 15338, 15339, 15340, 15341, 
+    15342, 15343, 15344, 15345, 15346, 15347, 15348, 15349, 15350, 15351, 
+    15352, 15353, 15354, 15355, 15356, 15357, 15358, 15359, 15360, 15361, 
+    15362, 15363, 15364, 15365, 15366, 15367, 15368, 15369, 15370, 15371, 
+    15372, 15373, 15374, 15375, 15376, 15377, 15378, 15379, 15380, 15381, 
+    15382, 15383, 15384, 15385, 15386, 15387, 15388, 15389, 15390, 15391, 
+    15392, 15393, 15394, 15395, 15396, 15397, 15398, 15399, 15400, 15401, 
+    15402, 15403, 15404, 15405, 15406, 15407, 15408, 15409, 15410, 15411, 
+    15412, 15413, 15414, 15415, 15416, 15417, 15418, 15419, 15420, 15421, 
+    15422, 15423, 15424, 15425, 15426, 15427, 15428, 15429, 15430, 15431, 
+    15432, 15433, 15434, 15435, 15436, 15437, 15438, 15439, 15440, 15441, 
+    15442, 15443, 15444, 15445, 15446, 15447, 15448, 15449, 15450, 15451, 
+    15452, 15453, 15454, 15455, 15456, 15457, 15458, 15459, 15460, 15461, 
+    15462, 15463, 15464, 15465, 15466, 15467, 15468, 15469, 15470, 15471, 
+    15472, 15473, 15474, 15475, 15476, 15477, 15478, 15479, 15480, 15481, 
+    15482, 15483, 15484, 15485, 15486, 15487, 15488, 15489, 15490, 15491, 
+    15492, 15493, 15494, 15495, 15496, 15497, 15498, 15499, 15500, 15501, 
+    15502, 15503, 15504, 15505, 15506, 15507, 15508, 15509, 15510, 15511, 
+    15512, 15513, 15514, 15515, 15516, 15517, 15518, 15519, 15520, 15521, 
+    15522, 15523, 15524, 15525, 15526, 15527, 15528, 15529, 15530, 15531, 
+    15532, 15533, 15534, 15535, 15536, 15537, 15538, 15539, 15540, 15541, 
+    15542, 15543, 15544, 15545, 15546, 15547, 15548, 15549, 15550, 15551, 
+    15552, 15553, 15554, 15555, 15556, 15557, 15558, 15559, 15560, 15561, 
+    15562, 15563, 15564, 15565, 15566, 15567, 15568, 15569, 15570, 15571, 
+    15572, 15573, 15574, 15575, 15576, 15577, 15578, 15579, 15580, 15581, 
+    15582, 15583, 15584, 15585, 15586, 15587, 15588, 15589, 15590, 15591, 
+    15592, 15593, 15594, 15595, 15596, 15597, 15598, 15599, 15600, 15601, 
+    15602, 15603, 15604, 15605, 15606, 15607, 15608, 15609, 15610, 15611, 
+    15612, 15613, 15614, 15615, 15616, 15617, 15618, 15619, 15620, 15621, 
+    15622, 15623, 15624, 15625, 15626, 15627, 15628, 15629, 15630, 15631, 
+    15632, 15633, 15634, 15635, 15636, 15637, 15638, 15639, 15640, 15641, 
+    15642, 15643, 15644, 15645, 15646, 15647, 15648, 15649, 15650, 15651, 
+    15652, 15653, 15654, 15655, 15656, 15657, 15658, 15659, 15660, 15661, 
+    15662, 15663, 15664, 15665, 15666, 15667, 15668, 15669, 15670, 15671, 
+    15672, 15673, 15674, 15675, 15676, 15677, 15678, 15679, 15680, 15681, 
+    15682, 15683, 15684, 15685, 15686, 15687, 15688, 15689, 15690, 15691, 
+    15692, 15693, 15694, 15695, 15696, 15697, 15698, 15699, 15700, 15701, 
+    15702, 15703, 15704, 15705, 15706, 15707, 15708, 15709, 15710, 15711, 
+    15712, 15713, 15714, 15715, 15716, 15717, 15718, 15719, 15720, 15721, 
+    15722, 15723, 15724, 15725, 15726, 15727, 15728, 15729, 15730, 15731, 
+    15732, 15733, 15734, 15735, 15736, 15737, 15738, 15739, 15740, 15741, 
+    15742, 15743, 15744, 15745, 15746, 15747, 15748, 15749, 15750, 15751, 
+    15752, 15753, 15754, 15755, 15756, 15757, 15758, 15759, 15760, 15761, 
+    15762, 15763, 15764, 15765, 15766, 15767, 15768, 15769, 15770, 15771, 
+    15772, 15773, 15774, 15775, 15776, 15777, 15778, 15779, 15780, 15781, 
+    15782, 15783, 15784, 15785, 15786, 15787, 15788, 15789, 15790, 15791, 
+    15792, 15793, 15794, 15795, 15796, 15797, 15798, 15799, 15800, 15801, 
+    15802, 15803, 15804, 15805, 15806, 15807, 15808, 15809, 15810, 15811, 
+    15812, 15813, 15814, 15815, 15816, 15817, 15818, 15819, 15820, 15821, 
+    15822, 15823, 15824, 15825, 15826, 15827, 15828, 15829, 15830, 15831, 
+    15832, 15833, 15834, 15835, 15836, 15837, 15838, 15839, 15840, 15841, 
+    15842, 15843, 15844, 15845, 15846, 15847, 15848, 15849, 15850, 15851, 
+    15852, 15853, 15854, 15855, 15856, 15857, 15858, 15859, 15860, 15861, 
+    15862, 15863, 15864, 15865, 15866, 15867, 15868, 15869, 15870, 15871, 
+    15872, 15873, 15874, 15875, 15876, 15877, 15878, 15879, 15880, 15881, 
+    15882, 15883, 15884, 15885, 15886, 15887, 15888, 15889, 15890, 15891, 
+    15892, 15893, 15894, 15895, 15896, 15897, 15898, 15899, 15900, 15901, 
+    15902, 15903, 15904, 15905, 15906, 15907, 15908, 15909, 15910, 15911, 
+    15912, 15913, 15914, 15915, 15916, 15917, 15918, 15919, 15920, 15921, 
+    15922, 15923, 15924, 15925, 15926, 15927, 15928, 15929, 15930, 15931, 
+    15932, 15933, 15934, 15935, 15936, 15937, 15938, 15939, 15940, 15941, 
+    15942, 15943, 15944, 15945, 15946, 15947, 15948, 15949, 15950, 15951, 
+    15952, 15953, 15954, 15955, 15956, 15957, 15958, 15959, 15960, 15961, 
+    15962, 15963, 15964, 15965, 15966, 15967, 15968, 15969, 15970, 15971, 
+    15972, 15973, 15974, 15975, 15976, 15977, 15978, 15979, 15980, 15981, 
+    15982, 15983, 15984, 15985, 15986, 15987, 15988, 15989, 15990, 15991, 
+    15992, 15993, 15994, 15995, 15996, 15997, 15998, 15999, 16000, 16001, 
+    16002, 16003, 16004, 16005, 16006, 16007, 16008, 16009, 16010, 16011, 
+    16012, 16013, 16014, 16015, 16016, 16017, 16018, 16019, 16020, 16021, 
+    16022, 16023, 16024, 16025, 16026, 16027, 16028, 16029, 16030, 16031, 
+    16032, 16033, 16034, 16035, 16036, 16037, 16038, 16039, 16040, 16041, 
+    16042, 16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050, 16051, 
+    16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060, 16061, 
+    16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069, 16070, 16071, 
+    16072, 16073, 16074, 16075, 16076, 16077, 16078, 16079, 16080, 16081, 
+    16082, 16083, 16084, 16085, 16086, 16087, 16088, 16089, 16090, 16091, 
+    16092, 16093, 16094, 16095, 16096, 16097, 16098, 16099, 16100, 16101, 
+    16102, 16103, 16104, 16105, 16106, 16107, 16108, 16109, 16110, 16111, 
+    16112, 16113, 16114, 16115, 16116, 16117, 16118, 16119, 16120, 16121, 
+    16122, 16123, 16124, 16125, 16126, 16127, 16128, 16129, 16130, 16131, 
+    16132, 16133, 16134, 16135, 16136, 16137, 16138, 16139, 16140, 16141, 
+    16142, 16143, 16144, 16145, 16146, 16147, 16148, 16149, 16150, 16151, 
+    16152, 16153, 16154, 16155, 16156, 16157, 16158, 16159, 16160, 16161, 
+    16162, 16163, 16164, 16165, 16166, 16167, 16168, 16169, 16170, 16171, 
+    16172, 16173, 16174, 16175, 16176, 16177, 16178, 16179, 16180, 16181, 
+    16182, 16183, 16184, 16185, 16186, 16187, 16188, 16189, 16190, 16191, 
+    16192, 16193, 16194, 16195, 16196, 16197, 16198, 16199, 16200, 16201, 
+    16202, 16203, 16204, 16205, 16206, 16207, 16208, 16209, 16210, 16211, 
+    16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 16220, 16221, 
+    16222, 16223, 16224, 16225, 16226, 16227, 16228, 16229, 16230, 16231, 
+    16232, 16233, 16234, 16235, 16236, 16237, 16238, 16239, 16240, 16241, 
+    16242, 16243, 16244, 16245, 16246, 16247, 16248, 16249, 16250, 16251, 
+    16252, 16253, 16254, 16255, 16256, 16257, 16258, 16259, 16260, 16261, 
+    16262, 16263, 16264, 16265, 16266, 16267, 16268, 16269, 16270, 16271, 
+    16272, 16273, 16274, 16275, 16276, 16277, 16278, 16279, 16280, 16281, 
+    16282, 16283, 16284, 16285, 16286, 16287, 16288, 16289, 16290, 16291, 
+    16292, 16293, 16294, 16295, 16296, 16297, 16298, 16299, 16300, 16301, 
+    16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309, 16310, 16311, 
+    16312, 16313, 16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321, 
+    16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 
+    16332, 16333, 16334, 16335, 16336, 16337, 16338, 16339, 16340, 16341, 
+    16342, 16343, 16344, 16345, 16346, 16347, 16348, 16349, 16350, 16351, 
+    16352, 16353, 16354, 16355, 16356, 16357, 16358, 16359, 16360, 16361, 
+    16362, 16363, 16364, 16365, 16366, 16367, 16368, 16369, 16370, 16371, 
+    16372, 16373, 16374, 16375, 16376, 16377, 16378, 16379, 16380, 16381, 
+    16382, 16383, 16384, 16385, 16386, 16387, 16388, 16389, 16390, 16391, 
+    16392, 16393, 16394, 16395, 16396, 16397, 16398, 16399, 16400, 16401, 
+    16402, 16403, 16404, 16405, 16406, 16407, 16408, 16409, 16410, 16411, 
+    16412, 16413, 16414, 16415, 16416, 16417, 16418, 16419, 16420, 16421, 
+    16422, 16423, 16424, 16425, 16426, 16427, 16428, 16429, 16430, 16431, 
+    16432, 16433, 16434, 16435, 16436, 16437, 16438, 16439, 16440, 16441, 
+    16442, 16443, 16444, 16445, 16446, 16447, 16448, 16449, 16450, 16451, 
+    16452, 16453, 16454, 16455, 16456, 16457, 16458, 16459, 16460, 16461, 
+    16462, 16463, 16464, 16465, 16466, 16467, 16468, 16469, 16470, 16471, 
+    16472, 16473, 16474, 16475, 16476, 16477, 16478, 16479, 16480, 16481, 
+    16482, 16483, 16484, 16485, 16486, 16487, 16488, 16489, 16490, 16491, 
+    16492, 16493, 16494, 16495, 16496, 16497, 16498, 16499, 16500, 16501, 
+    16502, 16503, 16504, 16505, 16506, 16507, 16508, 16509, 16510, 16511, 
+    16512, 16513, 16514, 16515, 16516, 16517, 16518, 16519, 16520, 16521, 
+    16522, 16523, 16524, 16525, 16526, 16527, 16528, 16529, 16530, 16531, 
+    16532, 16533, 16534, 16535, 16536, 16537, 16538, 16539, 16540, 16541, 
+    16542, 16543, 16544, 16545, 16546, 16547, 16548, 16549, 16550, 16551, 
+    16552, 16553, 16554, 16555, 16556, 16557, 16558, 16559, 16560, 16561, 
+    16562, 16563, 16564, 16565, 16566, 16567, 16568, 16569, 16570, 16571, 
+    16572, 16573, 16574, 16575, 16576, 16577, 16578, 16579, 16580, 16581, 
+    16582, 16583, 16584, 16585, 16586, 16587, 16588, 16589, 16590, 16591, 
+    16592, 16593, 16594, 16595, 16596, 16597, 16598, 16599, 16600, 16601, 
+    16602, 16603, 16604, 16605, 16606, 16607, 16608, 16609, 16610, 16611, 
+    16612, 16613, 16614, 16615, 16616, 16617, 16618, 16619, 16620, 16621, 
+    16622, 16623, 16624, 16625, 16626, 16627, 16628, 16629, 16630, 16631, 
+    16632, 16633, 16634, 16635, 16636, 16637, 16638, 16639, 16640, 16641, 
+    16642, 16643, 16644, 16645, 16646, 16647, 16648, 16649, 16650, 16651, 
+    16652, 16653, 16654, 16655, 16656, 16657, 16658, 16659, 16660, 16661, 
+    16662, 16663, 16664, 16665, 16666, 16667, 16668, 16669, 16670, 16671, 
+    16672, 16673, 16674, 16675, 16676, 16677, 16678, 16679, 16680, 16681, 
+    16682, 16683, 16684, 16685, 16686, 16687, 16688, 16689, 16690, 16691, 
+    16692, 16693, 16694, 16695, 16696, 16697, 16698, 16699, 16700, 16701, 
+    16702, 16703, 16704, 16705, 16706, 16707, 16708, 16709, 16710, 16711, 
+    16712, 16713, 16714, 16715, 16716, 16717, 16718, 16719, 16720, 16721, 
+    16722, 16723, 16724, 16725, 16726, 16727, 16728, 16729, 16730, 16731, 
+    16732, 16733, 16734, 16735, 16736, 16737, 16738, 16739, 16740, 16741, 
+    16742, 16743, 16744, 16745, 16746, 16747, 16748, 16749, 16750, 16751, 
+    16752, 16753, 16754, 16755, 16756, 16757, 16758, 16759, 16760, 16761, 
+    16762, 16763, 16764, 16765, 16766, 16767, 16768, 16769, 16770, 16771, 
+    16772, 16773, 16774, 16775, 16776, 16777, 16778, 16779, 16780, 16781, 
+    16782, 16783, 16784, 16785, 16786, 16787, 16788, 16789, 16790, 16791, 
+    16792, 16793, 16794, 16795, 16796, 16797, 16798, 16799, 16800, 16801, 
+    16802, 16803, 16804, 16805, 16806, 16807, 16808, 16809, 16810, 16811, 
+    16812, 16813, 16814, 16815, 16816, 16817, 16818, 16819, 16820, 16821, 
+    16822, 16823, 16824, 16825, 16826, 16827, 16828, 16829, 16830, 16831, 
+    16832, 16833, 16834, 16835, 16836, 16837, 16838, 16839, 16840, 16841, 
+    16842, 16843, 16844, 16845, 16846, 16847, 16848, 16849, 16850, 16851, 
+    16852, 16853, 16854, 16855, 16856, 16857, 16858, 16859, 16860, 16861, 
+    16862, 16863, 16864, 16865, 16866, 16867, 16868, 16869, 16870, 16871, 
+    16872, 16873, 16874, 16875, 16876, 16877, 16878, 16879, 16880, 16881, 
+    16882, 16883, 16884, 16885, 16886, 16887, 16888, 16889, 16890, 16891, 
+    16892, 16893, 16894, 16895, 16896, 16897, 16898, 16899, 16900, 16901, 
+    16902, 16903, 16904, 16905, 16906, 16907, 16908, 16909, 16910, 16911, 
+    16912, 16913, 16914, 16915, 16916, 16917, 16918, 16919, 16920, 16921, 
+    16922, 16923, 16924, 16925, 16926, 16927, 16928, 16929, 16930, 16931, 
+    16932, 16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 
+    16942, 16943, 16944, 16945, 16946, 16947, 16948, 16949, 16950, 16951, 
+    16952, 16953, 16954, 16955, 16956, 16957, 16958, 16959, 16960, 16961, 
+    16962, 16963, 16964, 16965, 16966, 16967, 16968, 16969, 16970, 16971, 
+    16972, 16973, 16974, 16975, 16976, 16977, 16978, 16979, 16980, 16981, 
+    16982, 16983, 16984, 16985, 16986, 16987, 16988, 16989, 16990, 16991, 
+    16992, 16993, 16994, 16995, 16996, 16997, 16998, 16999, 17000, 17001, 
+    17002, 17003, 17004, 17005, 17006, 17007, 17008, 17009, 17010, 17011, 
+    17012, 17013, 17014, 17015, 17016, 17017, 17018, 17019, 17020, 17021, 
+    17022, 17023, 17024, 17025, 17026, 17027, 17028, 17029, 17030, 17031, 
+    17032, 17033, 17034, 17035, 17036, 17037, 17038, 17039, 17040, 17041, 
+    17042, 17043, 17044, 17045, 17046, 17047, 17048, 17049, 17050, 17051, 
+    17052, 17053, 17054, 17055, 17056, 17057, 17058, 17059, 17060, 17061, 
+    17062, 17063, 17064, 17065, 17066, 17067, 17068, 17069, 17070, 17071, 
+    17072, 17073, 17074, 17075, 17076, 17077, 17078, 17079, 17080, 17081, 
+    17082, 17083, 17084, 17085, 17086, 17087, 17088, 17089, 17090, 17091, 
+    17092, 17093, 17094, 17095, 17096, 17097, 17098, 17099, 17100, 17101, 
+    17102, 17103, 17104, 17105, 17106, 17107, 17108, 17109, 17110, 17111, 
+    17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 17120, 17121, 
+    17122, 17123, 17124, 17125, 17126, 17127, 17128, 17129, 17130, 17131, 
+    17132, 17133, 17134, 17135, 17136, 17137, 17138, 17139, 17140, 17141, 
+    17142, 17143, 17144, 17145, 17146, 17147, 17148, 17149, 17150, 17151, 
+    17152, 17153, 17154, 17155, 17156, 17157, 17158, 17159, 17160, 17161, 
+    17162, 17163, 17164, 17165, 17166, 17167, 17168, 17169, 17170, 17171, 
+    17172, 17173, 17174, 17175, 17176, 17177, 17178, 17179, 17180, 17181, 
+    17182, 17183, 17184, 17185, 17186, 17187, 17188, 17189, 17190, 17191, 
+    17192, 17193, 17194, 17195, 17196, 17197, 17198, 17199, 17200, 17201, 
+    17202, 17203, 17204, 17205, 17206, 17207, 17208, 17209, 17210, 17211, 
+    17212, 17213, 17214, 17215, 17216, 17217, 17218, 17219, 17220, 17221, 
+    17222, 17223, 17224, 17225, 17226, 17227, 17228, 17229, 17230, 17231, 
+    17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17240, 17241, 
+    17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250, 17251, 
+    17252, 17253, 17254, 17255, 17256, 17257, 17258, 17259, 17260, 17261, 
+    17262, 17263, 17264, 17265, 17266, 17267, 17268, 17269, 17270, 17271, 
+    17272, 17273, 17274, 17275, 17276, 17277, 17278, 17279, 17280, 17281, 
+    17282, 17283, 17284, 17285, 17286, 17287, 17288, 17289, 17290, 17291, 
+    17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 17300, 17301, 
+    17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17310, 17311, 
+    17312, 17313, 17314, 17315, 17316, 17317, 17318, 17319, 17320, 17321, 
+    17322, 17323, 17324, 17325, 17326, 17327, 17328, 17329, 17330, 17331, 
+    17332, 17333, 17334, 17335, 17336, 17337, 17338, 17339, 17340, 17341, 
+    17342, 17343, 17344, 17345, 17346, 17347, 17348, 17349, 17350, 17351, 
+    17352, 17353, 17354, 17355, 17356, 17357, 17358, 17359, 17360, 17361, 
+    17362, 17363, 17364, 17365, 17366, 17367, 17368, 17369, 17370, 17371, 
+    17372, 17373, 17374, 17375, 17376, 17377, 17378, 17379, 17380, 17381, 
+    17382, 17383, 17384, 17385, 17386, 17387, 17388, 17389, 17390, 17391, 
+    17392, 17393, 17394, 17395, 17396, 17397, 17398, 17399, 17400, 17401, 
+    17402, 17403, 17404, 17405, 17406, 17407, 17408, 17409, 17410, 17411, 
+    17412, 17413, 17414, 17415, 17416, 17417, 17418, 17419, 17420, 17421, 
+    17422, 17423, 17424, 17425, 17426, 17427, 17428, 17429, 17430, 17431, 
+    17432, 17433, 17434, 17435, 17436, 17437, 17438, 17439, 17440, 17441, 
+    17442, 17443, 17444, 17445, 17446, 17447, 17448, 17449, 17450, 17451, 
+    17452, 17453, 17454, 17455, 17456, 17457, 17458, 17459, 17460, 17461, 
+    17462, 17463, 17464, 17465, 17466, 17467, 17468, 17469, 17470, 17471, 
+    17472, 17473, 17474, 17475, 17476, 17477, 17478, 17479, 17480, 17481, 
+    17482, 17483, 17484, 17485, 17486, 17487, 17488, 17489, 17490, 17491, 
+    17492, 17493, 17494, 17495, 17496, 17497, 17498, 17499, 17500, 17501, 
+    17502, 17503, 17504, 17505, 17506, 17507, 17508, 17509, 17510, 17511, 
+    17512, 17513, 17514, 17515, 17516, 17517, 17518, 17519, 17520, 17521, 
+    17522, 17523, 17524, 17525, 17526, 17527, 17528, 17529, 17530, 17531, 
+    17532, 17533, 17534, 17535, 17536, 17537, 17538, 17539, 17540, 17541, 
+    17542, 17543, 17544, 17545, 17546, 17547, 17548, 17549, 17550, 17551, 
+    17552, 17553, 17554, 17555, 17556, 17557, 17558, 17559, 17560, 17561, 
+    17562, 17563, 17564, 17565, 17566, 17567, 17568, 17569, 17570, 17571, 
+    17572, 17573, 17574, 17575, 17576, 17577, 17578, 17579, 17580, 17581, 
+    17582, 17583, 17584, 17585, 17586, 17587, 17588, 17589, 17590, 17591, 
+    17592, 17593, 17594, 17595, 17596, 17597, 17598, 17599, 17600, 17601, 
+    17602, 17603, 17604, 17605, 17606, 17607, 17608, 17609, 17610, 17611, 
+    17612, 17613, 17614, 17615, 17616, 17617, 17618, 17619, 17620, 17621, 
+    17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630, 17631, 
+    17632, 17633, 17634, 17635, 17636, 17637, 17638, 17639, 17640, 17641, 
+    17642, 17643, 17644, 17645, 17646, 17647, 17648, 17649, 17650, 17651, 
+    17652, 17653, 17654, 17655, 17656, 17657, 17658, 17659, 17660, 17661, 
+    17662, 17663, 17664, 17665, 17666, 17667, 17668, 17669, 17670, 17671, 
+    17672, 17673, 17674, 17675, 17676, 17677, 17678, 17679, 17680, 17681, 
+    17682, 17683, 17684, 17685, 17686, 17687, 17688, 17689, 17690, 17691, 
+    17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17701, 
+    17702, 17703, 17704, 17705, 17706, 17707, 17708, 17709, 17710, 17711, 
+    17712, 17713, 17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 
+    17722, 17723, 17724, 17725, 17726, 17727, 17728, 17729, 17730, 17731, 
+    17732, 17733, 17734, 17735, 17736, 17737, 17738, 17739, 17740, 17741, 
+    17742, 17743, 17744, 17745, 17746, 17747, 17748, 17749, 17750, 17751, 
+    17752, 17753, 17754, 17755, 17756, 17757, 17758, 17759, 17760, 17761, 
+    17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770, 17771, 
+    17772, 17773, 17774, 17775, 17776, 17777, 17778, 17779, 17780, 17781, 
+    17782, 17783, 17784, 17785, 17786, 17787, 17788, 17789, 17790, 17791, 
+    17792, 17793, 17794, 17795, 17796, 17797, 17798, 17799, 17800, 17801, 
+    17802, 17803, 17804, 17805, 17806, 17807, 17808, 17809, 17810, 17811, 
+    17812, 17813, 17814, 17815, 17816, 17817, 17818, 17819, 17820, 17821, 
+    17822, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830, 17831, 
+    17832, 17833, 17834, 17835, 17836, 17837, 17838, 17839, 17840, 17841, 
+    17842, 17843, 17844, 17845, 17846, 17847, 17848, 17849, 17850, 17851, 
+    17852, 17853, 17854, 17855, 17856, 17857, 17858, 17859, 17860, 17861, 
+    17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870, 17871, 
+    17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880, 17881, 
+    17882, 17883, 17884, 17885, 17886, 17887, 17888, 17889, 17890, 17891, 
+    17892, 17893, 17894, 17895, 17896, 17897, 17898, 17899, 17900, 17901, 
+    17902, 17903, 17904, 17905, 17906, 17907, 17908, 17909, 17910, 17911, 
+    17912, 17913, 17914, 17915, 17916, 17917, 17918, 17919, 17920, 17921, 
+    17922, 17923, 17924, 17925, 17926, 17927, 17928, 17929, 17930, 17931, 
+    17932, 17933, 17934, 17935, 17936, 17937, 17938, 17939, 17940, 17941, 
+    17942, 17943, 17944, 17945, 17946, 17947, 17948, 17949, 17950, 17951, 
+    17952, 17953, 17954, 17955, 17956, 17957, 17958, 17959, 17960, 17961, 
+    17962, 17963, 17964, 17965, 17966, 17967, 17968, 17969, 17970, 17971, 
+    17972, 17973, 17974, 17975, 17976, 17977, 17978, 17979, 17980, 17981, 
+    17982, 17983, 17984, 17985, 17986, 17987, 17988, 17989, 17990, 17991, 
+    17992, 17993, 17994, 17995, 17996, 17997, 17998, 17999, 18000, 18001, 
+    18002, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 
+    18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020, 18021, 
+    18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 
+    18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 18041, 
+    18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 18051, 
+    18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 
+    18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 18071, 
+    18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 18081, 
+    18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 18091, 
+    18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 18101, 
+    18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 18111, 
+    18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 18121, 
+    18122, 18123, 18124, 18125, 18126, 18127, 18128, 18129, 18130, 18131, 
+    18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140, 18141, 
+    18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 18151, 
+    18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 18161, 
+    18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 18171, 
+    18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 18181, 
+    18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 18191, 
+    18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 18201, 
+    18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 18211, 
+    18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 18221, 
+    18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 18231, 
+    18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 18241, 
+    18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 18251, 
+    18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 18261, 
+    18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 18271, 
+    18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 18281, 
+    18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 18291, 
+    18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 18301, 
+    18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 18311, 
+    18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320, 18321, 
+    18322, 18323, 18324, 18325, 18326, 18327, 18328, 18329, 18330, 18331, 
+    18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 18340, 18341, 
+    18342, 18343, 18344, 18345, 18346, 18347, 18348, 18349, 18350, 18351, 
+    18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361, 
+    18362, 18363, 18364, 18365, 18366, 18367, 18368, 18369, 18370, 18371, 
+    18372, 18373, 18374, 18375, 18376, 18377, 18378, 18379, 18380, 18381, 
+    18382, 18383, 18384, 18385, 18386, 18387, 18388, 18389, 18390, 18391, 
+    18392, 18393, 18394, 18395, 18396, 18397, 18398, 18399, 18400, 18401, 
+    18402, 18403, 18404, 18405, 18406, 18407, 18408, 18409, 18410, 18411, 
+    18412, 18413, 18414, 18415, 18416, 18417, 18418, 18419, 18420, 18421, 
+    18422, 18423, 18424, 18425, 18426, 18427, 18428, 18429, 18430, 18431, 
+    18432, 18433, 18434, 18435, 18436, 18437, 18438, 18439, 18440, 18441, 
+    18442, 18443, 18444, 18445, 18446, 18447, 18448, 18449, 18450, 18451, 
+    18452, 18453, 18454, 18455, 18456, 18457, 18458, 18459, 18460, 18461, 
+    18462, 18463, 18464, 18465, 18466, 18467, 18468, 18469, 18470, 18471, 
+    18472, 18473, 18474, 18475, 18476, 18477, 18478, 18479, 18480, 18481, 
+    18482, 18483, 18484, 18485, 18486, 18487, 18488, 18489, 18490, 18491, 
+    18492, 18493, 18494, 18495, 18496, 18497, 18498, 18499, 18500, 18501, 
+    18502, 18503, 18504, 18505, 18506, 18507, 18508, 18509, 18510, 18511, 
+    18512, 18513, 18514, 18515, 18516, 18517, 18518, 18519, 18520, 18521, 
+    18522, 18523, 18524, 18525, 18526, 18527, 18528, 18529, 18530, 18531, 
+    18532, 18533, 18534, 18535, 18536, 18537, 18538, 18539, 18540, 18541, 
+    18542, 18543, 18544, 18545, 18546, 18547, 18548, 18549, 18550, 18551, 
+    18552, 18553, 18554, 18555, 18556, 18557, 18558, 18559, 18560, 18561, 
+    18562, 18563, 18564, 18565, 18566, 18567, 18568, 18569, 18570, 18571, 
+    18572, 18573, 18574, 18575, 18576, 18577, 18578, 18579, 18580, 18581, 
+    18582, 18583, 18584, 18585, 18586, 18587, 18588, 18589, 18590, 18591, 
+    18592, 18593, 18594, 18595, 18596, 18597, 18598, 18599, 18600, 18601, 
+    18602, 18603, 18604, 18605, 18606, 18607, 18608, 18609, 18610, 18611, 
+    18612, 18613, 18614, 18615, 18616, 18617, 18618, 18619, 18620, 18621, 
+    18622, 18623, 18624, 18625, 18626, 18627, 18628, 18629, 18630, 18631, 
+    18632, 18633, 18634, 18635, 18636, 18637, 18638, 18639, 18640, 18641, 
+    18642, 18643, 18644, 18645, 18646, 18647, 18648, 18649, 18650, 18651, 
+    18652, 18653, 18654, 18655, 18656, 18657, 18658, 18659, 18660, 18661, 
+    18662, 18663, 18664, 18665, 18666, 18667, 18668, 18669, 18670, 18671, 
+    18672, 18673, 18674, 18675, 18676, 18677, 18678, 18679, 18680, 18681, 
+    18682, 18683, 18684, 18685, 18686, 18687, 18688, 18689, 18690, 18691, 
+    18692, 18693, 18694, 18695, 18696, 18697, 18698, 18699, 18700, 18701, 
+    18702, 18703, 18704, 18705, 18706, 18707, 18708, 18709, 18710, 18711, 
+    18712, 18713, 18714, 18715, 18716, 18717, 18718, 18719, 18720, 18721, 
+    18722, 18723, 18724, 18725, 18726, 18727, 18728, 18729, 18730, 18731, 
+    18732, 18733, 18734, 18735, 18736, 18737, 18738, 18739, 18740, 18741, 
+    18742, 18743, 18744, 18745, 18746, 18747, 18748, 18749, 18750, 18751, 
+    18752, 18753, 18754, 18755, 18756, 18757, 18758, 18759, 18760, 18761, 
+    18762, 18763, 18764, 18765, 18766, 18767, 18768, 18769, 18770, 18771, 
+    18772, 18773, 18774, 18775, 18776, 18777, 18778, 18779, 18780, 18781, 
+    18782, 18783, 18784, 18785, 18786, 18787, 18788, 18789, 18790, 18791, 
+    18792, 18793, 18794, 18795, 18796, 18797, 18798, 18799, 18800, 18801, 
+    18802, 18803, 18804, 18805, 18806, 18807, 18808, 18809, 18810, 18811, 
+    18812, 18813, 18814, 18815, 18816, 18817, 18818, 18819, 18820, 18821, 
+    18822, 18823, 18824, 18825, 18826, 18827, 18828, 18829, 18830, 18831, 
+    18832, 18833, 18834, 18835, 18836, 18837, 18838, 18839, 18840, 18841, 
+    18842, 18843, 18844, 18845, 18846, 18847, 18848, 18849, 18850, 18851, 
+    18852, 18853, 18854, 18855, 18856, 18857, 18858, 18859, 18860, 18861, 
+    18862, 18863, 18864, 18865, 18866, 18867, 18868, 18869, 18870, 18871, 
+    18872, 18873, 18874, 18875, 18876, 18877, 18878, 18879, 18880, 18881, 
+    18882, 18883, 18884, 18885, 18886, 18887, 18888, 18889, 18890, 18891, 
+    18892, 18893, 18894, 18895, 18896, 18897, 18898, 18899, 18900, 18901, 
+    18902, 18903, 18904, 18905, 18906, 18907, 18908, 18909, 18910, 18911, 
+    18912, 18913, 18914, 18915, 18916, 18917, 18918, 18919, 18920, 18921, 
+    18922, 18923, 18924, 18925, 18926, 18927, 18928, 18929, 18930, 18931, 
+    18932, 18933, 18934, 18935, 18936, 18937, 18938, 18939, 18940, 18941, 
+    18942, 18943, 18944, 18945, 18946, 18947, 18948, 18949, 18950, 18951, 
+    18952, 18953, 18954, 18955, 18956, 18957, 18958, 18959, 18960, 18961, 
+    18962, 18963, 18964, 18965, 18966, 18967, 18968, 18969, 18970, 18971, 
+    18972, 18973, 18974, 18975, 18976, 18977, 18978, 18979, 18980, 18981, 
+    18982, 18983, 18984, 18985, 18986, 18987, 18988, 18989, 18990, 18991, 
+    18992, 18993, 18994, 18995, 18996, 18997, 18998, 18999, 19000, 19001, 
+    19002, 19003, 19004, 19005, 19006, 19007, 19008, 19009, 19010, 19011, 
+    19012, 19013, 19014, 19015, 19016, 19017, 19018, 19019, 19020, 19021, 
+    19022, 19023, 19024, 19025, 19026, 19027, 19028, 19029, 19030, 19031, 
+    19032, 19033, 19034, 19035, 19036, 19037, 19038, 19039, 19040, 19041, 
+    19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050, 19051, 
+    19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059, 19060, 19061, 
+    19062, 19063, 19064, 19065, 19066, 19067, 19068, 19069, 19070, 19071, 
+    19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080, 19081, 
+    19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090, 19091, 
+    19092, 19093, 19094, 19095, 19096, 19097, 19098, 19099, 19100, 19101, 
+    19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110, 19111, 
+    19112, 19113, 19114, 19115, 19116, 19117, 19118, 19119, 19120, 19121, 
+    19122, 19123, 19124, 19125, 19126, 19127, 19128, 19129, 19130, 19131, 
+    19132, 19133, 19134, 19135, 19136, 19137, 19138, 19139, 19140, 19141, 
+    19142, 19143, 19144, 19145, 19146, 19147, 19148, 19149, 19150, 19151, 
+    19152, 19153, 19154, 19155, 19156, 19157, 19158, 19159, 19160, 19161, 
+    19162, 19163, 19164, 19165, 19166, 19167, 19168, 19169, 19170, 19171, 
+    19172, 19173, 19174, 19175, 19176, 19177, 19178, 19179, 19180, 19181, 
+    19182, 19183, 19184, 19185, 19186, 19187, 19188, 19189, 19190, 19191, 
+    19192, 19193, 19194, 19195, 19196, 19197, 19198, 19199, 19200, 19201, 
+    19202, 19203, 19204, 19205, 19206, 19207, 19208, 19209, 19210, 19211, 
+    19212, 19213, 19214, 19215, 19216, 19217, 19218, 19219, 19220, 19221, 
+    19222, 19223, 19224, 19225, 19226, 19227, 19228, 19229, 19230, 19231, 
+    19232, 19233, 19234, 19235, 19236, 19237, 19238, 19239, 19240, 19241, 
+    19242, 19243, 19244, 19245, 19246, 19247, 19248, 19249, 19250, 19251, 
+    19252, 19253, 19254, 19255, 19256, 19257, 19258, 19259, 19260, 19261, 
+    19262, 19263, 19264, 19265, 19266, 19267, 19268, 19269, 19270, 19271, 
+    19272, 19273, 19274, 19275, 19276, 19277, 19278, 19279, 19280, 19281, 
+    19282, 19283, 19284, 19285, 19286, 19287, 19288, 19289, 19290, 19291, 
+    19292, 19293, 19294, 19295, 19296, 19297, 19298, 19299, 19300, 19301, 
+    19302, 19303, 19304, 19305, 19306, 19307, 19308, 19309, 19310, 19311, 
+    19312, 19313, 19314, 19315, 19316, 19317, 19318, 19319, 19320, 19321, 
+    19322, 19323, 19324, 19325, 19326, 19327, 19328, 19329, 19330, 19331, 
+    19332, 19333, 19334, 19335, 19336, 19337, 19338, 19339, 19340, 19341, 
+    19342, 19343, 19344, 19345, 19346, 19347, 19348, 19349, 19350, 19351, 
+    19352, 19353, 19354, 19355, 19356, 19357, 19358, 19359, 19360, 19361, 
+    19362, 19363, 19364, 19365, 19366, 19367, 19368, 19369, 19370, 19371, 
+    19372, 19373, 19374, 19375, 19376, 19377, 19378, 19379, 19380, 19381, 
+    19382, 19383, 19384, 19385, 19386, 19387, 19388, 19389, 19390, 19391, 
+    19392, 19393, 19394, 19395, 19396, 19397, 19398, 19399, 19400, 19401, 
+    19402, 19403, 19404, 19405, 19406, 19407, 19408, 19409, 19410, 19411, 
+    19412, 19413, 19414, 19415, 19416, 19417, 19418, 19419, 19420, 19421, 
+    19422, 19423, 19424, 19425, 19426, 19427, 19428, 19429, 19430, 19431, 
+    19432, 19433, 19434, 19435, 19436, 19437, 19438, 19439, 19440, 19441, 
+    19442, 19443, 19444, 19445, 19446, 19447, 19448, 19449, 19450, 19451, 
+    19452, 19453, 19454, 19455, 19456, 19457, 19458, 19459, 19460, 19461, 
+    19462, 19463, 19464, 19465, 19466, 19467, 19468, 19469, 19470, 19471, 
+    19472, 19473, 19474, 19475, 19476, 19477, 19478, 19479, 19480, 19481, 
+    19482, 19483, 19484, 19485, 19486, 19487, 19488, 19489, 19490, 19491, 
+    19492, 19493, 19494, 19495, 19496, 19497, 19498, 19499, 19500, 19501, 
+    19502, 19503, 19504, 19505, 19506, 19507, 19508, 19509, 19510, 19511, 
+    19512, 19513, 19514, 19515, 19516, 19517, 19518, 19519, 19520, 19521, 
+    19522, 19523, 19524, 19525, 19526, 19527, 19528, 19529, 19530, 19531, 
+    19532, 19533, 19534, 19535, 19536, 19537, 19538, 19539, 19540, 19541, 
+    19542, 19543, 19544, 19545, 19546, 19547, 19548, 19549, 19550, 19551, 
+    19552, 19553, 19554, 19555, 19556, 19557, 19558, 19559, 19560, 19561, 
+    19562, 19563, 19564, 19565, 19566, 19567, 19568, 19569, 19570, 19571, 
+    19572, 19573, 19574, 19575, 19576, 19577, 19578, 19579, 19580, 19581, 
+    19582, 19583, 19584, 19585, 19586, 19587, 19588, 19589, 19590, 19591, 
+    19592, 19593, 19594, 19595, 19596, 19597, 19598, 19599, 19600, 19601, 
+    19602, 19603, 19604, 19605, 19606, 19607, 19608, 19609, 19610, 19611, 
+    19612, 19613, 19614, 19615, 19616, 19617, 19618, 19619, 19620, 19621, 
+    19622, 19623, 19624, 19625, 19626, 19627, 19628, 19629, 19630, 19631, 
+    19632, 19633, 19634, 19635, 19636, 19637, 19638, 19639, 19640, 19641, 
+    19642, 19643, 19644, 19645, 19646, 19647, 19648, 19649, 19650, 19651, 
+    19652, 19653, 19654, 19655, 19656, 19657, 19658, 19659, 19660, 19661, 
+    19662, 19663, 19664, 19665, 19666, 19667, 19668, 19669, 19670, 19671, 
+    19672, 19673, 19674, 19675, 19676, 19677, 19678, 19679, 19680, 19681, 
+    19682, 19683, 19684, 19685, 19686, 19687, 19688, 19689, 19690, 19691, 
+    19692, 19693, 19694, 19695, 19696, 19697, 19698, 19699, 19700, 19701, 
+    19702, 19703, 19704, 19705, 19706, 19707, 19708, 19709, 19710, 19711, 
+    19712, 19713, 19714, 19715, 19716, 19717, 19718, 19719, 19720, 19721, 
+    19722, 19723, 19724, 19725, 19726, 19727, 19728, 19729, 19730, 19731, 
+    19732, 19733, 19734, 19735, 19736, 19737, 19738, 19739, 19740, 19741, 
+    19742, 19743, 19744, 19745, 19746, 19747, 19748, 19749, 19750, 19751, 
+    19752, 19753, 19754, 19755, 19756, 19757, 19758, 19759, 19760, 19761, 
+    19762, 19763, 19764, 19765, 19766, 19767, 19768, 19769, 19770, 19771, 
+    19772, 19773, 19774, 19775, 19776, 19777, 19778, 19779, 19780, 19781, 
+    19782, 19783, 19784, 19785, 19786, 19787, 19788, 19789, 19790, 19791, 
+    19792, 19793, 19794, 19795, 19796, 19797, 19798, 19799, 19800, 19801, 
+    19802, 19803, 19804, 19805, 19806, 19807, 19808, 19809, 19810, 19811, 
+    19812, 19813, 19814, 19815, 19816, 19817, 19818, 19819, 19820, 19821, 
+    19822, 19823, 19824, 19825, 19826, 19827, 19828, 19829, 19830, 19831, 
+    19832, 19833, 19834, 19835, 19836, 19837, 19838, 19839, 19840, 19841, 
+    19842, 19843, 19844, 19845, 19846, 19847, 19848, 19849, 19850, 19851, 
+    19852, 19853, 19854, 19855, 19856, 19857, 19858, 19859, 19860, 19861, 
+    19862, 19863, 19864, 19865, 19866, 19867, 19868, 19869, 19870, 19871, 
+    19872, 19873, 19874, 19875, 19876, 19877, 19878, 19879, 19880, 19881, 
+    19882, 19883, 19884, 19885, 19886, 19887, 19888, 19889, 19890, 19891, 
+    19892, 19893, 19894, 19895, 19896, 19897, 19898, 19899, 19900, 19901, 
+    19902, 19903, 19904, 19905, 19906, 19907, 19908, 19909, 19910, 19911, 
+    19912, 19913, 19914, 19915, 19916, 19917, 19918, 19919, 19920, 19921, 
+    19922, 19923, 19924, 19925, 19926, 19927, 19928, 19929, 19930, 19931, 
+    19932, 19933, 19934, 19935, 19936, 19937, 19938, 19939, 19940, 19941, 
+    19942, 19943, 19944, 19945, 19946, 19947, 19948, 19949, 19950, 19951, 
+    19952, 19953, 19954, 19955, 19956, 19957, 19958, 19959, 19960, 19961, 
+    19962, 19963, 19964, 19965, 19966, 19967, 19968, 19969, 19970, 19971, 
+    19972, 19973, 19974, 19975, 19976, 19977, 19978, 19979, 19980, 19981, 
+    19982, 19983, 19984, 19985, 19986, 19987, 19988, 19989, 19990, 19991, 
+    19992, 19993, 19994, 19995, 19996, 19997, 19998, 19999, 20000, 20001, 
+    20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20011, 
+    20012, 20013, 20014, 20015, 20016, 20017, 20018, 20019, 20020, 20021, 
+    20022, 20023, 20024, 20025, 20026, 20027, 20028, 20029, 20030, 20031, 
+    20032, 20033, 20034, 20035, 20036, 20037, 20038, 20039, 20040, 20041, 
+    20042, 20043, 20044, 20045, 20046, 20047, 20048, 20049, 20050, 20051, 
+    20052, 20053, 20054, 20055, 20056, 20057, 20058, 20059, 20060, 20061, 
+    20062, 20063, 20064, 20065, 20066, 20067, 20068, 20069, 20070, 20071, 
+    20072, 20073, 20074, 20075, 20076, 20077, 20078, 20079, 20080, 20081, 
+    20082, 20083, 20084, 20085, 20086, 20087, 20088, 20089, 20090, 20091, 
+    20092, 20093, 20094, 20095, 20096, 20097, 20098, 20099, 20100, 20101, 
+    20102, 20103, 20104, 20105, 20106, 20107, 20108, 20109, 20110, 20111, 
+    20112, 20113, 20114, 20115, 20116, 20117, 20118, 20119, 20120, 20121, 
+    20122, 20123, 20124, 20125, 20126, 20127, 20128, 20129, 20130, 20131, 
+    20132, 20133, 20134, 20135, 20136, 20137, 20138, 20139, 20140, 20141, 
+    20142, 20143, 20144, 20145, 20146, 20147, 20148, 20149, 20150, 20151, 
+    20152, 20153, 20154, 20155, 20156, 20157, 20158, 20159, 20160, 20161, 
+    20162, 20163, 20164, 20165, 20166, 20167, 20168, 20169, 20170, 20171, 
+    20172, 20173, 20174, 20175, 20176, 20177, 20178, 20179, 20180, 20181, 
+    20182, 20183, 20184, 20185, 20186, 20187, 20188, 20189, 20190, 20191, 
+    20192, 20193, 20194, 20195, 20196, 20197, 20198, 20199, 20200, 20201, 
+    20202, 20203, 20204, 20205, 20206, 20207, 20208, 20209, 20210, 20211, 
+    20212, 20213, 20214, 20215, 20216, 20217, 20218, 20219, 20220, 20221, 
+    20222, 20223, 20224, 20225, 20226, 20227, 20228, 20229, 20230, 20231, 
+    20232, 20233, 20234, 20235, 20236, 20237, 20238, 20239, 20240, 20241, 
+    20242, 20243, 20244, 20245, 20246, 20247, 20248, 20249, 20250, 20251, 
+    20252, 20253, 20254, 20255, 20256, 20257, 20258, 20259, 20260, 20261, 
+    20262, 20263, 20264, 20265, 20266, 20267, 20268, 20269, 20270, 20271, 
+    20272, 20273, 20274, 20275, 20276, 20277, 20278, 20279, 20280, 20281, 
+    20282, 20283, 20284, 20285, 20286, 20287, 20288, 20289, 20290, 20291, 
+    20292, 20293, 20294, 20295, 20296, 20297, 20298, 20299, 20300, 20301, 
+    20302, 20303, 20304, 20305, 20306, 20307, 20308, 20309, 20310, 20311, 
+    20312, 20313, 20314, 20315, 20316, 20317, 20318, 20319, 20320, 20321, 
+    20322, 20323, 20324, 20325, 20326, 20327, 20328, 20329, 20330, 20331, 
+    20332, 20333, 20334, 20335, 20336, 20337, 20338, 20339, 20340, 20341, 
+    20342, 20343, 20344, 20345, 20346, 20347, 20348, 20349, 20350, 20351, 
+    20352, 20353, 20354, 20355, 20356, 20357, 20358, 20359, 20360, 20361, 
+    20362, 20363, 20364, 20365, 20366, 20367, 20368, 20369, 20370, 20371, 
+    20372, 20373, 20374, 20375, 20376, 20377, 20378, 20379, 20380, 20381, 
+    20382, 20383, 20384, 20385, 20386, 20387, 20388, 20389, 20390, 20391, 
+    20392, 20393, 20394, 20395, 20396, 20397, 20398, 20399, 20400, 20401, 
+    20402, 20403, 20404, 20405, 20406, 20407, 20408, 20409, 20410, 20411, 
+    20412, 20413, 20414, 20415, 20416, 20417, 20418, 20419, 20420, 20421, 
+    20422, 20423, 20424, 20425, 20426, 20427, 20428, 20429, 20430, 20431, 
+    20432, 20433, 20434, 20435, 20436, 20437, 20438, 20439, 20440, 20441, 
+    20442, 20443, 20444, 20445, 20446, 20447, 20448, 20449, 20450, 20451, 
+    20452, 20453, 20454, 20455, 20456, 20457, 20458, 20459, 20460, 20461, 
+    20462, 20463, 20464, 20465, 20466, 20467, 20468, 20469, 20470, 20471, 
+    20472, 20473, 20474, 20475, 20476, 20477, 20478, 20479, 20480, 20481, 
+    20482, 20483, 20484, 20485, 20486, 20487, 20488, 20489, 20490, 20491, 
+    20492, 20493, 20494, 20495, 20496, 20497, 20498, 20499, 20500, 20501, 
+    20502, 20503, 20504, 20505, 20506, 20507, 20508, 20509, 20510, 20511, 
+    20512, 20513, 20514, 20515, 20516, 20517, 20518, 20519, 20520, 20521, 
+    20522, 20523, 20524, 20525, 20526, 20527, 20528, 20529, 20530, 20531, 
+    20532, 20533, 20534, 20535, 20536, 20537, 20538, 20539, 20540, 20541, 
+    20542, 20543, 20544, 20545, 20546, 20547, 20548, 20549, 20550, 20551, 
+    20552, 20553, 20554, 20555, 20556, 20557, 20558, 20559, 20560, 20561, 
+    20562, 20563, 20564, 20565, 20566, 20567, 20568, 20569, 20570, 20571, 
+    20572, 20573, 20574, 20575, 20576, 20577, 20578, 20579, 20580, 20581, 
+    20582, 20583, 20584, 20585, 20586, 20587, 20588, 20589, 20590, 20591, 
+    20592, 20593, 20594, 20595, 20596, 20597, 20598, 20599, 20600, 20601, 
+    20602, 20603, 20604, 20605, 20606, 20607, 20608, 20609, 20610, 20611, 
+    20612, 20613, 20614, 20615, 20616, 20617, 20618, 20619, 20620, 20621, 
+    20622, 20623, 20624, 20625, 20626, 20627, 20628, 20629, 20630, 20631, 
+    20632, 20633, 20634, 20635, 20636, 20637, 20638, 20639, 20640, 20641, 
+    20642, 20643, 20644, 20645, 20646, 20647, 20648, 20649, 20650, 20651, 
+    20652, 20653, 20654, 20655, 20656, 20657, 20658, 20659, 20660, 20661, 
+    20662, 20663, 20664, 20665, 20666, 20667, 20668, 20669, 20670, 20671, 
+    20672, 20673, 20674, 20675, 20676, 20677, 20678, 20679, 20680, 20681, 
+    20682, 20683, 20684, 20685, 20686, 20687, 20688, 20689, 20690, 20691, 
+    20692, 20693, 20694, 20695, 20696, 20697, 20698, 20699, 20700, 20701, 
+    20702, 20703, 20704, 20705, 20706, 20707, 20708, 20709, 20710, 20711, 
+    20712, 20713, 20714, 20715, 20716, 20717, 20718, 20719, 20720, 20721, 
+    20722, 20723, 20724, 20725, 20726, 20727, 20728, 20729, 20730, 20731, 
+    20732, 20733, 20734, 20735, 20736, 20737, 20738, 20739, 20740, 20741, 
+    20742, 20743, 20744, 20745, 20746, 20747, 20748, 20749, 20750, 20751, 
+    20752, 20753, 20754, 20755, 20756, 20757, 20758, 20759, 20760, 20761, 
+    20762, 20763, 20764, 20765, 20766, 20767, 20768, 20769, 20770, 20771, 
+    20772, 20773, 20774, 20775, 20776, 20777, 20778, 20779, 20780, 20781, 
+    20782, 20783, 20784, 20785, 20786, 20787, 20788, 20789, 20790, 20791, 
+    20792, 20793, 20794, 20795, 20796, 20797, 20798, 20799, 20800, 20801, 
+    20802, 20803, 20804, 20805, 20806, 20807, 20808, 20809, 20810, 20811, 
+    20812, 20813, 20814, 20815, 20816, 20817, 20818, 20819, 20820, 20821, 
+    20822, 20823, 20824, 20825, 20826, 20827, 20828, 20829, 20830, 20831, 
+    20832, 20833, 20834, 20835, 20836, 20837, 20838, 20839, 20840, 20841, 
+    20842, 20843, 20844, 20845, 20846, 20847, 20848, 20849, 20850, 20851, 
+    20852, 20853, 20854, 20855, 20856, 20857, 20858, 20859, 20860, 20861, 
+    20862, 20863, 20864, 20865, 20866, 20867, 20868, 20869, 20870, 20871, 
+    20872, 20873, 20874, 20875, 20876, 20877, 20878, 20879, 20880, 20881, 
+    20882, 20883, 20884, 20885, 20886, 20887, 20888, 20889, 20890, 20891, 
+    20892, 20893, 20894, 20895, 20896, 20897, 20898, 20899, 20900, 20901, 
+    20902, 20903, 20904, 20905, 20906, 20907, 20908, 20909, 20910, 20911, 
+    20912, 20913, 20914, 20915, 20916, 20917, 20918, 20919, 20920, 20921, 
+    20922, 20923, 20924, 20925, 20926, 20927, 20928, 20929, 20930, 20931, 
+    20932, 20933, 20934, 20935, 20936, 20937, 20938, 20939, 20940, 20941, 
+    20942, 20943, 20944, 20945, 20946, 20947, 20948, 20949, 20950, 20951, 
+    20952, 20953, 20954, 20955, 20956, 20957, 20958, 20959, 20960, 20961, 
+    20962, 20963, 20964, 20965, 20966, 20967, 20968, 20969, 20970, 20971, 
+    20972, 20973, 20974, 20975, 20976, 20977, 20978, 20979, 20980, 20981, 
+    20982, 20983, 20984, 20985, 20986, 20987, 20988, 20989, 20990, 20991, 
+    20992, 20993, 20994, 20995, 20996, 20997, 20998, 20999, 21000, 21001, 
+    21002, 21003, 21004, 21005, 21006, 21007, 21008, 21009, 21010, 21011, 
+    21012, 21013, 21014, 21015, 21016, 21017, 21018, 21019, 21020, 21021, 
+    21022, 21023, 21024, 21025, 21026, 21027, 21028, 21029, 21030, 21031, 
+    21032, 21033, 21034, 21035, 21036, 21037, 21038, 21039, 21040, 21041, 
+    21042, 21043, 21044, 21045, 21046, 21047, 21048, 21049, 21050, 21051, 
+    21052, 21053, 21054, 21055, 21056, 21057, 21058, 21059, 21060, 21061, 
+    21062, 21063, 21064, 21065, 21066, 21067, 21068, 21069, 21070, 21071, 
+    21072, 21073, 21074, 21075, 21076, 21077, 21078, 21079, 21080, 21081, 
+    21082, 21083, 21084, 21085, 21086, 21087, 21088, 21089, 21090, 21091, 
+    21092, 21093, 21094, 21095, 21096, 21097, 21098, 21099, 21100, 21101, 
+    21102, 21103, 21104, 21105, 21106, 21107, 21108, 21109, 21110, 21111, 
+    21112, 21113, 21114, 21115, 21116, 21117, 21118, 21119, 21120, 21121, 
+    21122, 21123, 21124, 21125, 21126, 21127, 21128, 21129, 21130, 21131, 
+    21132, 21133, 21134, 21135, 21136, 21137, 21138, 21139, 21140, 21141, 
+    21142, 21143, 21144, 21145, 21146, 21147, 21148, 21149, 21150, 21151, 
+    21152, 21153, 21154, 21155, 21156, 21157, 21158, 21159, 21160, 21161, 
+    21162, 21163, 21164, 21165, 21166, 21167, 21168, 21169, 21170, 21171, 
+    21172, 21173, 21174, 21175, 21176, 21177, 21178, 21179, 21180, 21181, 
+    21182, 21183, 21184, 21185, 21186, 21187, 21188, 21189, 21190, 21191, 
+    21192, 21193, 21194, 21195, 21196, 21197, 21198, 21199, 21200, 21201, 
+    21202, 21203, 21204, 21205, 21206, 21207, 21208, 21209, 21210, 21211, 
+    21212, 21213, 21214, 21215, 21216, 21217, 21218, 21219, 21220, 21221, 
+    21222, 21223, 21224, 21225, 21226, 21227, 21228, 21229, 21230, 21231, 
+    21232, 21233, 21234, 21235, 21236, 21237, 21238, 21239, 21240, 21241, 
+    21242, 21243, 21244, 21245, 21246, 21247, 21248, 21249, 21250, 21251, 
+    21252, 21253, 21254, 21255, 21256, 21257, 21258, 21259, 21260, 21261, 
+    21262, 21263, 21264, 21265, 21266, 21267, 21268, 21269, 21270, 21271, 
+    21272, 21273, 21274, 21275, 21276, 21277, 21278, 21279, 21280, 21281, 
+    21282, 21283, 21284, 21285, 21286, 21287, 21288, 21289, 21290, 21291, 
+    21292, 21293, 21294, 21295, 21296, 21297, 21298, 21299, 21300, 21301, 
+    21302, 21303, 21304, 21305, 21306, 21307, 21308, 21309, 21310, 21311, 
+    21312, 21313, 21314, 21315, 21316, 21317, 21318, 21319, 21320, 21321, 
+    21322, 21323, 21324, 21325, 21326, 21327, 21328, 21329, 21330, 21331, 
+    21332, 21333, 21334, 21335, 21336, 21337, 21338, 21339, 21340, 21341, 
+    21342, 21343, 21344, 21345, 21346, 21347, 21348, 21349, 21350, 21351, 
+    21352, 21353, 21354, 21355, 21356, 21357, 21358, 21359, 21360, 21361, 
+    21362, 21363, 21364, 21365, 21366, 21367, 21368, 21369, 21370, 21371, 
+    21372, 21373, 21374, 21375, 21376, 21377, 21378, 21379, 21380, 21381, 
+    21382, 21383, 21384, 21385, 21386, 21387, 21388, 21389, 21390, 21391, 
+    21392, 21393, 21394, 21395, 21396, 21397, 21398, 21399, 21400, 21401, 
+    21402, 21403, 21404, 21405, 21406, 21407, 21408, 21409, 21410, 21411, 
+    21412, 21413, 21414, 21415, 21416, 21417, 21418, 21419, 21420, 21421, 
+    21422, 21423, 21424, 21425, 21426, 21427, 21428, 21429, 21430, 21431, 
+    21432, 21433, 21434, 21435, 21436, 21437, 21438, 21439, 21440, 21441, 
+    21442, 21443, 21444, 21445, 21446, 21447, 21448, 21449, 21450, 21451, 
+    21452, 21453, 21454, 21455, 21456, 21457, 21458, 21459, 21460, 21461, 
+    21462, 21463, 21464, 21465, 21466, 21467, 21468, 21469, 21470, 21471, 
+    21472, 21473, 21474, 21475, 21476, 21477, 21478, 21479, 21480, 21481, 
+    21482, 21483, 21484, 21485, 21486, 21487, 21488, 21489, 21490, 21491, 
+    21492, 21493, 21494, 21495, 21496, 21497, 21498, 21499, 21500, 21501, 
+    21502, 21503, 21504, 21505, 21506, 21507, 21508, 21509, 21510, 21511, 
+    21512, 21513, 21514, 21515, 21516, 21517, 21518, 21519, 21520, 21521, 
+    21522, 21523, 21524, 21525, 21526, 21527, 21528, 21529, 21530, 21531, 
+    21532, 21533, 21534, 21535, 21536, 21537, 21538, 21539, 21540, 21541, 
+    21542, 21543, 21544, 21545, 21546, 21547, 21548, 21549, 21550, 21551, 
+    21552, 21553, 21554, 21555, 21556, 21557, 21558, 21559, 21560, 21561, 
+    21562, 21563, 21564, 21565, 21566, 21567, 21568, 21569, 21570, 21571, 
+    21572, 21573, 21574, 21575, 21576, 21577, 21578, 21579, 21580, 21581, 
+    21582, 21583, 21584, 21585, 21586, 21587, 21588, 21589, 21590, 21591, 
+    21592, 21593, 21594, 21595, 21596, 21597, 21598, 21599, 21600, 21601, 
+    21602, 21603, 21604, 21605, 21606, 21607, 21608, 21609, 21610, 21611, 
+    21612, 21613, 21614, 21615, 21616, 21617, 21618, 21619, 21620, 21621, 
+    21622, 21623, 21624, 21625, 21626, 21627, 21628, 21629, 21630, 21631, 
+    21632, 21633, 21634, 21635, 21636, 21637, 21638, 21639, 21640, 21641, 
+    21642, 21643, 21644, 21645, 21646, 21647, 21648, 21649, 21650, 21651, 
+    21652, 21653, 21654, 21655, 21656, 21657, 21658, 21659, 21660, 21661, 
+    21662, 21663, 21664, 21665, 21666, 21667, 21668, 21669, 21670, 21671, 
+    21672, 21673, 21674, 21675, 21676, 21677, 21678, 21679, 21680, 21681, 
+    21682, 21683, 21684, 21685, 21686, 21687, 21688, 21689, 21690, 21691, 
+    21692, 21693, 21694, 21695, 21696, 21697, 21698, 21699, 21700, 21701, 
+    21702, 21703, 21704, 21705, 21706, 21707, 21708, 21709, 21710, 21711, 
+    21712, 21713, 21714, 21715, 21716, 21717, 21718, 21719, 21720, 21721, 
+    21722, 21723, 21724, 21725, 21726, 21727, 21728, 21729, 21730, 21731, 
+    21732, 21733, 21734, 21735, 21736, 21737, 21738, 21739, 21740, 21741, 
+    21742, 21743, 21744, 21745, 21746, 21747, 21748, 21749, 21750, 21751, 
+    21752, 21753, 21754, 21755, 21756, 21757, 21758, 21759, 21760, 21761, 
+    21762, 21763, 21764, 21765, 21766, 21767, 21768, 21769, 21770, 21771, 
+    21772, 21773, 21774, 21775, 21776, 21777, 21778, 21779, 21780, 21781, 
+    21782, 21783, 21784, 21785, 21786, 21787, 21788, 21789, 21790, 21791, 
+    21792, 21793, 21794, 21795, 21796, 21797, 21798, 21799, 21800, 21801, 
+    21802, 21803, 21804, 21805, 21806, 21807, 21808, 21809, 21810, 21811, 
+    21812, 21813, 21814, 21815, 21816, 21817, 21818, 21819, 21820, 21821, 
+    21822, 21823, 21824, 21825, 21826, 21827, 21828, 21829, 21830, 21831, 
+    21832, 21833, 21834, 21835, 21836, 21837, 21838, 21839, 21840, 21841, 
+    21842, 21843, 21844, 21845, 21846, 21847, 21848, 21849, 21850, 21851, 
+    21852, 21853, 21854, 21855, 21856, 21857, 21858, 21859, 21860, 21861, 
+    21862, 21863, 21864, 21865, 21866, 21867, 21868, 21869, 21870, 21871, 
+    21872, 21873, 21874, 21875, 21876, 21877, 21878, 21879, 21880, 21881, 
+    21882, 21883, 21884, 21885, 21886, 21887, 21888, 21889, 21890, 21891, 
+    21892, 21893, 21894, 21895, 21896, 21897, 21898, 21899, 21900, 21901, 
+    21902, 21903, 21904, 21905, 21906, 21907, 21908, 21909, 21910, 21911, 
+    21912, 21913, 21914, 21915, 21916, 21917, 21918, 21919, 21920, 21921, 
+    21922, 21923, 21924, 21925, 21926, 21927, 21928, 21929, 21930, 21931, 
+    21932, 21933, 21934, 21935, 21936, 21937, 21938, 21939, 21940, 21941, 
+    21942, 21943, 21944, 21945, 21946, 21947, 21948, 21949, 21950, 21951, 
+    21952, 21953, 21954, 21955, 21956, 21957, 21958, 21959, 21960, 21961, 
+    21962, 21963, 21964, 21965, 21966, 21967, 21968, 21969, 21970, 21971, 
+    21972, 21973, 21974, 21975, 21976, 21977, 21978, 21979, 21980, 21981, 
+    21982, 21983, 21984, 21985, 21986, 21987, 21988, 21989, 21990, 21991, 
+    21992, 21993, 21994, 21995, 21996, 21997, 21998, 21999, 22000, 22001, 
+    22002, 22003, 22004, 22005, 22006, 22007, 22008, 22009, 22010, 22011, 
+    22012, 22013, 22014, 22015, 22016, 22017, 22018, 22019, 22020, 22021, 
+    22022, 22023, 22024, 22025, 22026, 22027, 22028, 22029, 22030, 22031, 
+    22032, 22033, 22034, 22035, 22036, 22037, 22038, 22039, 22040, 22041, 
+    22042, 22043, 22044, 22045, 22046, 22047, 22048, 22049, 22050, 22051, 
+    22052, 22053, 22054, 22055, 22056, 22057, 22058, 22059, 22060, 22061, 
+    22062, 22063, 22064, 22065, 22066, 22067, 22068, 22069, 22070, 22071, 
+    22072, 22073, 22074, 22075, 22076, 22077, 22078, 22079, 22080, 22081, 
+    22082, 22083, 22084, 22085, 22086, 22087, 22088, 22089, 22090, 22091, 
+    22092, 22093, 22094, 22095, 22096, 22097, 22098, 22099, 22100, 22101, 
+    22102, 22103, 22104, 22105, 22106, 22107, 22108, 22109, 22110, 22111, 
+    22112, 22113, 22114, 22115, 22116, 22117, 22118, 22119, 22120, 22121, 
+    22122, 22123, 22124, 22125, 22126, 22127, 22128, 22129, 22130, 22131, 
+    22132, 22133, 22134, 22135, 22136, 22137, 22138, 22139, 22140, 22141, 
+    22142, 22143, 22144, 22145, 22146, 22147, 22148, 22149, 22150, 22151, 
+    22152, 22153, 22154, 22155, 22156, 22157, 22158, 22159, 22160, 22161, 
+    22162, 22163, 22164, 22165, 22166, 22167, 22168, 22169, 22170, 22171, 
+    22172, 22173, 22174, 22175, 22176, 22177, 22178, 22179, 22180, 22181, 
+    22182, 22183, 22184, 22185, 22186, 22187, 22188, 22189, 22190, 22191, 
+    22192, 22193, 22194, 22195, 22196, 22197, 22198, 22199, 22200, 22201, 
+    22202, 22203, 22204, 22205, 22206, 22207, 22208, 22209, 22210, 22211, 
+    22212, 22213, 22214, 22215, 22216, 22217, 22218, 22219, 22220, 22221, 
+    22222, 22223, 22224, 22225, 22226, 22227, 22228, 22229, 22230, 22231, 
+    22232, 22233, 22234, 22235, 22236, 22237, 22238, 22239, 22240, 22241, 
+    22242, 22243, 22244, 22245, 22246, 22247, 22248, 22249, 22250, 22251, 
+    22252, 22253, 22254, 22255, 22256, 22257, 22258, 22259, 22260, 22261, 
+    22262, 22263, 22264, 22265, 22266, 22267, 22268, 22269, 22270, 22271, 
+    22272, 22273, 22274, 22275, 22276, 22277, 22278, 22279, 22280, 22281, 
+    22282, 22283, 22284, 22285, 22286, 22287, 22288, 22289, 22290, 22291, 
+    22292, 22293, 22294, 22295, 22296, 22297, 22298, 22299, 22300, 22301, 
+    22302, 22303, 22304, 22305, 22306, 22307, 22308, 22309, 22310, 22311, 
+    22312, 22313, 22314, 22315, 22316, 22317, 22318, 22319, 22320, 22321, 
+    22322, 22323, 22324, 22325, 22326, 22327, 22328, 22329, 22330, 22331, 
+    22332, 22333, 22334, 22335, 22336, 22337, 22338, 22339, 22340, 22341, 
+    22342, 22343, 22344, 22345, 22346, 22347, 22348, 22349, 22350, 22351, 
+    22352, 22353, 22354, 22355, 22356, 22357, 22358, 22359, 22360, 22361, 
+    22362, 22363, 22364, 22365, 22366, 22367, 22368, 22369, 22370, 22371, 
+    22372, 22373, 22374, 22375, 22376, 22377, 22378, 22379, 22380, 22381, 
+    22382, 22383, 22384, 22385, 22386, 22387, 22388, 22389, 22390, 22391, 
+    22392, 22393, 22394, 22395, 22396, 22397, 22398, 22399, 22400, 22401, 
+    22402, 22403, 22404, 22405, 22406, 22407, 22408, 22409, 22410, 22411, 
+    22412, 22413, 22414, 22415, 22416, 22417, 22418, 22419, 22420, 22421, 
+    22422, 22423, 22424, 22425, 22426, 22427, 22428, 22429, 22430, 22431, 
+    22432, 22433, 22434, 22435, 22436, 22437, 22438, 22439, 22440, 22441, 
+    22442, 22443, 22444, 22445, 22446, 22447, 22448, 22449, 22450, 22451, 
+    22452, 22453, 22454, 22455, 22456, 22457, 22458, 22459, 22460, 22461, 
+    22462, 22463, 22464, 22465, 22466, 22467, 22468, 22469, 22470, 22471, 
+    22472, 22473, 22474, 22475, 22476, 22477, 22478, 22479, 22480, 22481, 
+    22482, 22483, 22484, 22485, 22486, 22487, 22488, 22489, 22490, 22491, 
+    22492, 22493, 22494, 22495, 22496, 22497, 22498, 22499, 22500, 22501, 
+    22502, 22503, 22504, 22505, 22506, 22507, 22508, 22509, 22510, 22511, 
+    22512, 22513, 22514, 22515, 22516, 22517, 22518, 22519, 22520, 22521, 
+    22522, 22523, 22524, 22525, 22526, 22527, 22528, 22529, 22530, 22531, 
+    22532, 22533, 22534, 22535, 22536, 22537, 22538, 22539, 22540, 22541, 
+    22542, 22543, 22544, 22545, 22546, 22547, 22548, 22549, 22550, 22551, 
+    22552, 22553, 22554, 22555, 22556, 22557, 22558, 22559, 22560, 22561, 
+    22562, 22563, 22564, 22565, 22566, 22567, 22568, 22569, 22570, 22571, 
+    22572, 22573, 22574, 22575, 22576, 22577, 22578, 22579, 22580, 22581, 
+    22582, 22583, 22584, 22585, 22586, 22587, 22588, 22589, 22590, 22591, 
+    22592, 22593, 22594, 22595, 22596, 22597, 22598, 22599, 22600, 22601, 
+    22602, 22603, 22604, 22605, 22606, 22607, 22608, 22609, 22610, 22611, 
+    22612, 22613, 22614, 22615, 22616, 22617, 22618, 22619, 22620, 22621, 
+    22622, 22623, 22624, 22625, 22626, 22627, 22628, 22629, 22630, 22631, 
+    22632, 22633, 22634, 22635, 22636, 22637, 22638, 22639, 22640, 22641, 
+    22642, 22643, 22644, 22645, 22646, 22647, 22648, 22649, 22650, 22651, 
+    22652, 22653, 22654, 22655, 22656, 22657, 22658, 22659, 22660, 22661, 
+    22662, 22663, 22664, 22665, 22666, 22667, 22668, 22669, 22670, 22671, 
+    22672, 22673, 22674, 22675, 22676, 22677, 22678, 22679, 22680, 22681, 
+    22682, 22683, 22684, 22685, 22686, 22687, 22688, 22689, 22690, 22691, 
+    22692, 22693, 22694, 22695, 22696, 22697, 22698, 22699, 22700, 22701, 
+    22702, 22703, 22704, 22705, 22706, 22707, 22708, 22709, 22710, 22711, 
+    22712, 22713, 22714, 22715, 22716, 22717, 22718, 22719, 22720, 22721, 
+    22722, 22723, 22724, 22725, 22726, 22727, 22728, 22729, 22730, 22731, 
+    22732, 22733, 22734, 22735, 22736, 22737, 22738, 22739, 22740, 22741, 
+    22742, 22743, 22744, 22745, 22746, 22747, 22748, 22749, 22750, 22751, 
+    22752, 22753, 22754, 22755, 22756, 22757, 22758, 22759, 22760, 22761, 
+    22762, 22763, 22764, 22765, 22766, 22767, 22768, 22769, 22770, 22771, 
+    22772, 22773, 22774, 22775, 22776, 22777, 22778, 22779, 22780, 22781, 
+    22782, 22783, 22784, 22785, 22786, 22787, 22788, 22789, 22790, 22791, 
+    22792, 22793, 22794, 22795, 22796, 22797, 22798, 22799, 22800, 22801, 
+    22802, 22803, 22804, 22805, 22806, 22807, 22808, 22809, 22810, 22811, 
+    22812, 22813, 22814, 22815, 22816, 22817, 22818, 22819, 22820, 22821, 
+    22822, 22823, 22824, 22825, 22826, 22827, 22828, 22829, 22830, 22831, 
+    22832, 22833, 22834, 22835, 22836, 22837, 22838, 22839, 22840, 22841, 
+    22842, 22843, 22844, 22845, 22846, 22847, 22848, 22849, 22850, 22851, 
+    22852, 22853, 22854, 22855, 22856, 22857, 22858, 22859, 22860, 22861, 
+    22862, 22863, 22864, 22865, 22866, 22867, 22868, 22869, 22870, 22871, 
+    22872, 22873, 22874, 22875, 22876, 22877, 22878, 22879, 22880, 22881, 
+    22882, 22883, 22884, 22885, 22886, 22887, 22888, 22889, 22890, 22891, 
+    22892, 22893, 22894, 22895, 22896, 22897, 22898, 22899, 22900, 22901, 
+    22902, 22903, 22904, 22905, 22906, 22907, 22908, 22909, 22910, 22911, 
+    22912, 22913, 22914, 22915, 22916, 22917, 22918, 22919, 22920, 22921, 
+    22922, 22923, 22924, 22925, 22926, 22927, 22928, 22929, 22930, 22931, 
+    22932, 22933, 22934, 22935, 22936, 22937, 22938, 22939, 22940, 22941, 
+    22942, 22943, 22944, 22945, 22946, 22947, 22948, 22949, 22950, 22951, 
+    22952, 22953, 22954, 22955, 22956, 22957, 22958, 22959, 22960, 22961, 
+    22962, 22963, 22964, 22965, 22966, 22967, 22968, 22969, 22970, 22971, 
+    22972, 22973, 22974, 22975, 22976, 22977, 22978, 22979, 22980, 22981, 
+    22982, 22983, 22984, 22985, 22986, 22987, 22988, 22989, 22990, 22991, 
+    22992, 22993, 22994, 22995, 22996, 22997, 22998, 22999, 23000, 23001, 
+    23002, 23003, 23004, 23005, 23006, 23007, 23008, 23009, 23010, 23011, 
+    23012, 23013, 23014, 23015, 23016, 23017, 23018, 23019, 23020, 23021, 
+    23022, 23023, 23024, 23025, 23026, 23027, 23028, 23029, 23030, 23031, 
+    23032, 23033, 23034, 23035, 23036, 23037, 23038, 23039, 23040, 23041, 
+    23042, 23043, 23044, 23045, 23046, 23047, 23048, 23049, 23050, 23051, 
+    23052, 23053, 23054, 23055, 23056, 23057, 23058, 23059, 23060, 23061, 
+    23062, 23063, 23064, 23065, 23066, 23067, 23068, 23069, 23070, 23071, 
+    23072, 23073, 23074, 23075, 23076, 23077, 23078, 23079, 23080, 23081, 
+    23082, 23083, 23084, 23085, 23086, 23087, 23088, 23089, 23090, 23091, 
+    23092, 23093, 23094, 23095, 23096, 23097, 23098, 23099, 23100, 23101, 
+    23102, 23103, 23104, 23105, 23106, 23107, 23108, 23109, 23110, 23111, 
+    23112, 23113, 23114, 23115, 23116, 23117, 23118, 23119, 23120, 23121, 
+    23122, 23123, 23124, 23125, 23126, 23127, 23128, 23129, 23130, 23131, 
+    23132, 23133, 23134, 23135, 23136, 23137, 23138, 23139, 23140, 23141, 
+    23142, 23143, 23144, 23145, 23146, 23147, 23148, 23149, 23150, 23151, 
+    23152, 23153, 23154, 23155, 23156, 23157, 23158, 23159, 23160, 23161, 
+    23162, 23163, 23164, 23165, 23166, 23167, 23168, 23169, 23170, 23171, 
+    23172, 23173, 23174, 23175, 23176, 23177, 23178, 23179, 23180, 23181, 
+    23182, 23183, 23184, 23185, 23186, 23187, 23188, 23189, 23190, 23191, 
+    23192, 23193, 23194, 23195, 23196, 23197, 23198, 23199, 23200, 23201, 
+    23202, 23203, 23204, 23205, 23206, 23207, 23208, 23209, 23210, 23211, 
+    23212, 23213, 23214, 23215, 23216, 23217, 23218, 23219, 23220, 23221, 
+    23222, 23223, 23224, 23225, 23226, 23227, 23228, 23229, 23230, 23231, 
+    23232, 23233, 23234, 23235, 23236, 23237, 23238, 23239, 23240, 23241, 
+    23242, 23243, 23244, 23245, 23246, 23247, 23248, 23249, 23250, 23251, 
+    23252, 23253, 23254, 23255, 23256, 23257, 23258, 23259, 23260, 23261, 
+    23262, 23263, 23264, 23265, 23266, 23267, 23268, 23269, 23270, 23271, 
+    23272, 23273, 23274, 23275, 23276, 23277, 23278, 23279, 23280, 23281, 
+    23282, 23283, 23284, 23285, 23286, 23287, 23288, 23289, 23290, 23291, 
+    23292, 23293, 23294, 23295, 23296, 23297, 23298, 23299, 23300, 23301, 
+    23302, 23303, 23304, 23305, 23306, 23307, 23308, 23309, 23310, 23311, 
+    23312, 23313, 23314, 23315, 23316, 23317, 23318, 23319, 23320, 23321, 
+    23322, 23323, 23324, 23325, 23326, 23327, 23328, 23329, 23330, 23331, 
+    23332, 23333, 23334, 23335, 23336, 23337, 23338, 23339, 23340, 23341, 
+    23342, 23343, 23344, 23345, 23346, 23347, 23348, 23349, 23350, 23351, 
+    23352, 23353, 23354, 23355, 23356, 23357, 23358, 23359, 23360, 23361, 
+    23362, 23363, 23364, 23365, 23366, 23367, 23368, 23369, 23370, 23371, 
+    23372, 23373, 23374, 23375, 23376, 23377, 23378, 23379, 23380, 23381, 
+    23382, 23383, 23384, 23385, 23386, 23387, 23388, 23389, 23390, 23391, 
+    23392, 23393, 23394, 23395, 23396, 23397, 23398, 23399, 23400, 23401, 
+    23402, 23403, 23404, 23405, 23406, 23407, 23408, 23409, 23410, 23411, 
+    23412, 23413, 23414, 23415, 23416, 23417, 23418, 23419, 23420, 23421, 
+    23422, 23423, 23424, 23425, 23426, 23427, 23428, 23429, 23430, 23431, 
+    23432, 23433, 23434, 23435, 23436, 23437, 23438, 23439, 23440, 23441, 
+    23442, 23443, 23444, 23445, 23446, 23447, 23448, 23449, 23450, 23451, 
+    23452, 23453, 23454, 23455, 23456, 23457, 23458, 23459, 23460, 23461, 
+    23462, 23463, 23464, 23465, 23466, 23467, 23468, 23469, 23470, 23471, 
+    23472, 23473, 23474, 23475, 23476, 23477, 23478, 23479, 23480, 23481, 
+    23482, 23483, 23484, 23485, 23486, 23487, 23488, 23489, 23490, 23491, 
+    23492, 23493, 23494, 23495, 23496, 23497, 23498, 23499, 23500, 23501, 
+    23502, 23503, 23504, 23505, 23506, 23507, 23508, 23509, 23510, 23511, 
+    23512, 23513, 23514, 23515, 23516, 23517, 23518, 23519, 23520, 23521, 
+    23522, 23523, 23524, 23525, 23526, 23527, 23528, 23529, 23530, 23531, 
+    23532, 23533, 23534, 23535, 23536, 23537, 23538, 23539, 23540, 23541, 
+    23542, 23543, 23544, 23545, 23546, 23547, 23548, 23549, 23550, 23551, 
+    23552, 23553, 23554, 23555, 23556, 23557, 23558, 23559, 23560, 23561, 
+    23562, 23563, 23564, 23565, 23566, 23567, 23568, 23569, 23570, 23571, 
+    23572, 23573, 23574, 23575, 23576, 23577, 23578, 23579, 23580, 23581, 
+    23582, 23583, 23584, 23585, 23586, 23587, 23588, 23589, 23590, 23591, 
+    23592, 23593, 23594, 23595, 23596, 23597, 23598, 23599, 23600, 23601, 
+    23602, 23603, 23604, 23605, 23606, 23607, 23608, 23609, 23610, 23611, 
+    23612, 23613, 23614, 23615, 23616, 23617, 23618, 23619, 23620, 23621, 
+    23622, 23623, 23624, 23625, 23626, 23627, 23628, 23629, 23630, 23631, 
+    23632, 23633, 23634, 23635, 23636, 23637, 23638, 23639, 23640, 23641, 
+    23642, 23643, 23644, 23645, 23646, 23647, 23648, 23649, 23650, 23651, 
+    23652, 23653, 23654, 23655, 23656, 23657, 23658, 23659, 23660, 23661, 
+    23662, 23663, 23664, 23665, 23666, 23667, 23668, 23669, 23670, 23671, 
+    23672, 23673, 23674, 23675, 23676, 23677, 23678, 23679, 23680, 23681, 
+    23682, 23683, 23684, 23685, 23686, 23687, 23688, 23689, 23690, 23691, 
+    23692, 23693, 23694, 23695, 23696, 23697, 23698, 23699, 23700, 23701, 
+    23702, 23703, 23704, 23705, 23706, 23707, 23708, 23709, 23710, 23711, 
+    23712, 23713, 23714, 23715, 23716, 23717, 23718, 23719, 23720, 23721, 
+    23722, 23723, 23724, 23725, 23726, 23727, 23728, 23729, 23730, 23731, 
+    23732, 23733, 23734, 23735, 23736, 23737, 23738, 23739, 23740, 23741, 
+    23742, 23743, 23744, 23745, 23746, 23747, 23748, 23749, 23750, 23751, 
+    23752, 23753, 23754, 23755, 23756, 23757, 23758, 23759, 23760, 23761, 
+    23762, 23763, 23764, 23765, 23766, 23767, 23768, 23769, 23770, 23771, 
+    23772, 23773, 23774, 23775, 23776, 23777, 23778, 23779, 23780, 23781, 
+    23782, 23783, 23784, 23785, 23786, 23787, 23788, 23789, 23790, 23791, 
+    23792, 23793, 23794, 23795, 23796, 23797, 23798, 23799, 23800, 23801, 
+    23802, 23803, 23804, 23805, 23806, 23807, 23808, 23809, 23810, 23811, 
+    23812, 23813, 23814, 23815, 23816, 23817, 23818, 23819, 23820, 23821, 
+    23822, 23823, 23824, 23825, 23826, 23827, 23828, 23829, 23830, 23831, 
+    23832, 23833, 23834, 23835, 23836, 23837, 23838, 23839, 23840, 23841, 
+    23842, 23843, 23844, 23845, 23846, 23847, 23848, 23849, 23850, 23851, 
+    23852, 23853, 23854, 23855, 23856, 23857, 23858, 23859, 23860, 23861, 
+    23862, 23863, 23864, 23865, 23866, 23867, 23868, 23869, 23870, 23871, 
+    23872, 23873, 23874, 23875, 23876, 23877, 23878, 23879, 23880, 23881, 
+    23882, 23883, 23884, 23885, 23886, 23887, 23888, 23889, 23890, 23891, 
+    23892, 23893, 23894, 23895, 23896, 23897, 23898, 23899, 23900, 23901, 
+    23902, 23903, 23904, 23905, 23906, 23907, 23908, 23909, 23910, 23911, 
+    23912, 23913, 23914, 23915, 23916, 23917, 23918, 23919, 23920, 23921, 
+    23922, 23923, 23924, 23925, 23926, 23927, 23928, 23929, 23930, 23931, 
+    23932, 23933, 23934, 23935, 23936, 23937, 23938, 23939, 23940, 23941, 
+    23942, 23943, 23944, 23945, 23946, 23947, 23948, 23949, 23950, 23951, 
+    23952, 23953, 23954, 23955, 23956, 23957, 23958, 23959, 23960, 23961, 
+    23962, 23963, 23964, 23965, 23966, 23967, 23968, 23969, 23970, 23971, 
+    23972, 23973, 23974, 23975, 23976, 23977, 23978, 23979, 23980, 23981, 
+    23982, 23983, 23984, 23985, 23986, 23987, 23988, 23989, 23990, 23991, 
+    23992, 23993, 23994, 23995, 23996, 23997, 23998, 23999, 24000, 24001, 
+    24002, 24003, 24004, 24005, 24006, 24007, 24008, 24009, 24010, 24011, 
+    24012, 24013, 24014, 24015, 24016, 24017, 24018, 24019, 24020, 24021, 
+    24022, 24023, 24024, 24025, 24026, 24027, 24028, 24029, 24030, 24031, 
+    24032, 24033, 24034, 24035, 24036, 24037, 24038, 24039, 24040, 24041, 
+    24042, 24043, 24044, 24045, 24046, 24047, 24048, 24049, 24050, 24051, 
+    24052, 24053, 24054, 24055, 24056, 24057, 24058, 24059, 24060, 24061, 
+    24062, 24063, 24064, 24065, 24066, 24067, 24068, 24069, 24070, 24071, 
+    24072, 24073, 24074, 24075, 24076, 24077, 24078, 24079, 24080, 24081, 
+    24082, 24083, 24084, 24085, 24086, 24087, 24088, 24089, 24090, 24091, 
+    24092, 24093, 24094, 24095, 24096, 24097, 24098, 24099, 24100, 24101, 
+    24102, 24103, 24104, 24105, 24106, 24107, 24108, 24109, 24110, 24111, 
+    24112, 24113, 24114, 24115, 24116, 24117, 24118, 24119, 24120, 24121, 
+    24122, 24123, 24124, 24125, 24126, 24127, 24128, 24129, 24130, 24131, 
+    24132, 24133, 24134, 24135, 24136, 24137, 24138, 24139, 24140, 24141, 
+    24142, 24143, 24144, 24145, 24146, 24147, 24148, 24149, 24150, 24151, 
+    24152, 24153, 24154, 24155, 24156, 24157, 24158, 24159, 24160, 24161, 
+    24162, 24163, 24164, 24165, 24166, 24167, 24168, 24169, 24170, 24171, 
+    24172, 24173, 24174, 24175, 24176, 24177, 24178, 24179, 24180, 24181, 
+    24182, 24183, 24184, 24185, 24186, 24187, 24188, 24189, 24190, 24191, 
+    24192, 24193, 24194, 24195, 24196, 24197, 24198, 24199, 24200, 24201, 
+    24202, 24203, 24204, 24205, 24206, 24207, 24208, 24209, 24210, 24211, 
+    24212, 24213, 24214, 24215, 24216, 24217, 24218, 24219, 24220, 24221, 
+    24222, 24223, 24224, 24225, 24226, 24227, 24228, 24229, 24230, 24231, 
+    24232, 24233, 24234, 24235, 24236, 24237, 24238, 24239, 24240, 24241, 
+    24242, 24243, 24244, 24245, 24246, 24247, 24248, 24249, 24250, 24251, 
+    24252, 24253, 24254, 24255, 24256, 24257, 24258, 24259, 24260, 24261, 
+    24262, 24263, 24264, 24265, 24266, 24267, 24268, 24269, 24270, 24271, 
+    24272, 24273, 24274, 24275, 24276, 24277, 24278, 24279, 24280, 24281, 
+    24282, 24283, 24284, 24285, 24286, 24287, 24288, 24289, 24290, 24291, 
+    24292, 24293, 24294, 24295, 24296, 24297, 24298, 24299, 24300, 24301, 
+    24302, 24303, 24304, 24305, 24306, 24307, 24308, 24309, 24310, 24311, 
+    24312, 24313, 24314, 24315, 24316, 24317, 24318, 24319, 24320, 24321, 
+    24322, 24323, 24324, 24325, 24326, 24327, 24328, 24329, 24330, 24331, 
+    24332, 24333, 24334, 24335, 24336, 24337, 24338, 24339, 24340, 24341, 
+    24342, 24343, 24344, 24345, 24346, 24347, 24348, 24349, 24350, 24351, 
+    24352, 24353, 24354, 24355, 24356, 24357, 24358, 24359, 24360, 24361, 
+    24362, 24363, 24364, 24365, 24366, 24367, 24368, 24369, 24370, 24371, 
+    24372, 24373, 24374, 24375, 24376, 24377, 24378, 24379, 24380, 24381, 
+    24382, 24383, 24384, 24385, 24386, 24387, 24388, 24389, 24390, 24391, 
+    24392, 24393, 24394, 24395, 24396, 24397, 24398, 24399, 24400, 24401, 
+    24402, 24403, 24404, 24405, 24406, 24407, 24408, 24409, 24410, 24411, 
+    24412, 24413, 24414, 24415, 24416, 24417, 24418, 24419, 24420, 24421, 
+    24422, 24423, 24424, 24425, 24426, 24427, 24428, 24429, 24430, 24431, 
+    24432, 24433, 24434, 24435, 24436, 24437, 24438, 24439, 24440, 24441, 
+    24442, 24443, 24444, 24445, 24446, 24447, 24448, 24449, 24450, 24451, 
+    24452, 24453, 24454, 24455, 24456, 24457, 24458, 24459, 24460, 24461, 
+    24462, 24463, 24464, 24465, 24466, 24467, 24468, 24469, 24470, 24471, 
+    24472, 24473, 24474, 24475, 24476, 24477, 24478, 24479, 24480, 24481, 
+    24482, 24483, 24484, 24485, 24486, 24487, 24488, 24489, 24490, 24491, 
+    24492, 24493, 24494, 24495, 24496, 24497, 24498, 24499, 24500, 24501, 
+    24502, 24503, 24504, 24505, 24506, 24507, 24508, 24509, 24510, 24511, 
+    24512, 24513, 24514, 24515, 24516, 24517, 24518, 24519, 24520, 24521, 
+    24522, 24523, 24524, 24525, 24526, 24527, 24528, 24529, 24530, 24531, 
+    24532, 24533, 24534, 24535, 24536, 24537, 24538, 24539, 24540, 24541, 
+    24542, 24543, 24544, 24545, 24546, 24547, 24548, 24549, 24550, 24551, 
+    24552, 24553, 24554, 24555, 24556, 24557, 24558, 24559, 24560, 24561, 
+    24562, 24563, 24564, 24565, 24566, 24567, 24568, 24569, 24570, 24571, 
+    24572, 24573, 24574, 24575, 24576, 24577, 24578, 24579, 24580, 24581, 
+    24582, 24583, 24584, 24585, 24586, 24587, 24588, 24589, 24590, 24591, 
+    24592, 24593, 24594, 24595, 24596, 24597, 24598, 24599, 24600, 24601, 
+    24602, 24603, 24604, 24605, 24606, 24607, 24608, 24609, 24610, 24611, 
+    24612, 24613, 24614, 24615, 24616, 24617, 24618, 24619, 24620, 24621, 
+    24622, 24623, 24624, 24625, 24626, 24627, 24628, 24629, 24630, 24631, 
+    24632, 24633, 24634, 24635, 24636, 24637, 24638, 24639, 24640, 24641, 
+    24642, 24643, 24644, 24645, 24646, 24647, 24648, 24649, 24650, 24651, 
+    24652, 24653, 24654, 24655, 24656, 24657, 24658, 24659, 24660, 24661, 
+    24662, 24663, 24664, 24665, 24666, 24667, 24668, 24669, 24670, 24671, 
+    24672, 24673, 24674, 24675, 24676, 24677, 24678, 24679, 24680, 24681, 
+    24682, 24683, 24684, 24685, 24686, 24687, 24688, 24689, 24690, 24691, 
+    24692, 24693, 24694, 24695, 24696, 24697, 24698, 24699, 24700, 24701, 
+    24702, 24703, 24704, 24705, 24706, 24707, 24708, 24709, 24710, 24711, 
+    24712, 24713, 24714, 24715, 24716, 24717, 24718, 24719, 24720, 24721, 
+    24722, 24723, 24724, 24725, 24726, 24727, 24728, 24729, 24730, 24731, 
+    24732, 24733, 24734, 24735, 24736, 24737, 24738, 24739, 24740, 24741, 
+    24742, 24743, 24744, 24745, 24746, 24747, 24748, 24749, 24750, 24751, 
+    24752, 24753, 24754, 24755, 24756, 24757, 24758, 24759, 24760, 24761, 
+    24762, 24763, 24764, 24765, 24766, 24767, 24768, 24769, 24770, 24771, 
+    24772, 24773, 24774, 24775, 24776, 24777, 24778, 24779, 24780, 24781, 
+    24782, 24783, 24784, 24785, 24786, 24787, 24788, 24789, 24790, 24791, 
+    24792, 24793, 24794, 24795, 24796, 24797, 24798, 24799, 24800, 24801, 
+    24802, 24803, 24804, 24805, 24806, 24807, 24808, 24809, 24810, 24811, 
+    24812, 24813, 24814, 24815, 24816, 24817, 24818, 24819, 24820, 24821, 
+    24822, 24823, 24824, 24825, 24826, 24827, 24828, 24829, 24830, 24831, 
+    24832, 24833, 24834, 24835, 24836, 24837, 24838, 24839, 24840, 24841, 
+    24842, 24843, 24844, 24845, 24846, 24847, 24848, 24849, 24850, 24851, 
+    24852, 24853, 24854, 24855, 24856, 24857, 24858, 24859, 24860, 24861, 
+    24862, 24863, 24864, 24865, 24866, 24867, 24868, 24869, 24870, 24871, 
+    24872, 24873, 24874, 24875, 24876, 24877, 24878, 24879, 24880, 24881, 
+    24882, 24883, 24884, 24885, 24886, 24887, 24888, 24889, 24890, 24891, 
+    24892, 24893, 24894, 24895, 24896, 24897, 24898, 24899, 24900, 24901, 
+    24902, 24903, 24904, 24905, 24906, 24907, 24908, 24909, 24910, 24911, 
+    24912, 24913, 24914, 24915, 24916, 24917, 24918, 24919, 24920, 24921, 
+    24922, 24923, 24924, 24925, 24926, 24927, 24928, 24929, 24930, 24931, 
+    24932, 24933, 24934, 24935, 24936, 24937, 24938, 24939, 24940, 24941, 
+    24942, 24943, 24944, 24945, 24946, 24947, 24948, 24949, 24950, 24951, 
+    24952, 24953, 24954, 24955, 24956, 24957, 24958, 24959, 24960, 24961, 
+    24962, 24963, 24964, 24965, 24966, 24967, 24968, 24969, 24970, 24971, 
+    24972, 24973, 24974, 24975, 24976, 24977, 24978, 24979, 24980, 24981, 
+    24982, 24983, 24984, 24985, 24986, 24987, 24988, 24989, 24990, 24991, 
+    24992, 24993, 24994, 24995, 24996, 24997, 24998, 24999, 25000, 25001, 
+    25002, 25003, 25004, 25005, 25006, 25007, 25008, 25009, 25010, 25011, 
+    25012, 25013, 25014, 25015, 25016, 25017, 25018, 25019, 25020, 25021, 
+    25022, 25023, 25024, 25025, 25026, 25027, 25028, 25029, 25030, 25031, 
+    25032, 25033, 25034, 25035, 25036, 25037, 25038, 25039, 25040, 25041, 
+    25042, 25043, 25044, 25045, 25046, 25047, 25048, 25049, 25050, 25051, 
+    25052, 25053, 25054, 25055, 25056, 25057, 25058, 25059, 25060, 25061, 
+    25062, 25063, 25064, 25065, 25066, 25067, 25068, 25069, 25070, 25071, 
+    25072, 25073, 25074, 25075, 25076, 25077, 25078, 25079, 25080, 25081, 
+    25082, 25083, 25084, 25085, 25086, 25087, 25088, 25089, 25090, 25091, 
+    25092, 25093, 25094, 25095, 25096, 25097, 25098, 25099, 25100, 25101, 
+    25102, 25103, 25104, 25105, 25106, 25107, 25108, 25109, 25110, 25111, 
+    25112, 25113, 25114, 25115, 25116, 25117, 25118, 25119, 25120, 25121, 
+    25122, 25123, 25124, 25125, 25126, 25127, 25128, 25129, 25130, 25131, 
+    25132, 25133, 25134, 25135, 25136, 25137, 25138, 25139, 25140, 25141, 
+    25142, 25143, 25144, 25145, 25146, 25147, 25148, 25149, 25150, 25151, 
+    25152, 25153, 25154, 25155, 25156, 25157, 25158, 25159, 25160, 25161, 
+    25162, 25163, 25164, 25165, 25166, 25167, 25168, 25169, 25170, 25171, 
+    25172, 25173, 25174, 25175, 25176, 25177, 25178, 25179, 25180, 25181, 
+    25182, 25183, 25184, 25185, 25186, 25187, 25188, 25189, 25190, 25191, 
+    25192, 25193, 25194, 25195, 25196, 25197, 25198, 25199, 25200, 25201, 
+    25202, 25203, 25204, 25205, 25206, 25207, 25208, 25209, 25210, 25211, 
+    25212, 25213, 25214, 25215, 25216, 25217, 25218, 25219, 25220, 25221, 
+    25222, 25223, 25224, 25225, 25226, 25227, 25228, 25229, 25230, 25231, 
+    25232, 25233, 25234, 25235, 25236, 25237, 25238, 25239, 25240, 25241, 
+    25242, 25243, 25244, 25245, 25246, 25247, 25248, 25249, 25250, 25251, 
+    25252, 25253, 25254, 25255, 25256, 25257, 25258, 25259, 25260, 25261, 
+    25262, 25263, 25264, 25265, 25266, 25267, 25268, 25269, 25270, 25271, 
+    25272, 25273, 25274, 25275, 25276, 25277, 25278, 25279, 25280, 25281, 
+    25282, 25283, 25284, 25285, 25286, 25287, 25288, 25289, 25290, 25291, 
+    25292, 25293, 25294, 25295, 25296, 25297, 25298, 25299, 25300, 25301, 
+    25302, 25303, 25304, 25305, 25306, 25307, 25308, 25309, 25310, 25311, 
+    25312, 25313, 25314, 25315, 25316, 25317, 25318, 25319, 25320, 25321, 
+    25322, 25323, 25324, 25325, 25326, 25327, 25328, 25329, 25330, 25331, 
+    25332, 25333, 25334, 25335, 25336, 25337, 25338, 25339, 25340, 25341, 
+    25342, 25343, 25344, 25345, 25346, 25347, 25348, 25349, 25350, 25351, 
+    25352, 25353, 25354, 25355, 25356, 25357, 25358, 25359, 25360, 25361, 
+    25362, 25363, 25364, 25365, 25366, 25367, 25368, 25369, 25370, 25371, 
+    25372, 25373, 25374, 25375, 25376, 25377, 25378, 25379, 25380, 25381, 
+    25382, 25383, 25384, 25385, 25386, 25387, 25388, 25389, 25390, 25391, 
+    25392, 25393, 25394, 25395, 25396, 25397, 25398, 25399, 25400, 25401, 
+    25402, 25403, 25404, 25405, 25406, 25407, 25408, 25409, 25410, 25411, 
+    25412, 25413, 25414, 25415, 25416, 25417, 25418, 25419, 25420, 25421, 
+    25422, 25423, 25424, 25425, 25426, 25427, 25428, 25429, 25430, 25431, 
+    25432, 25433, 25434, 25435, 25436, 25437, 25438, 25439, 25440, 25441, 
+    25442, 25443, 25444, 25445, 25446, 25447, 25448, 25449, 25450, 25451, 
+    25452, 25453, 25454, 25455, 25456, 25457, 25458, 25459, 25460, 25461, 
+    25462, 25463, 25464, 25465, 25466, 25467, 25468, 25469, 25470, 25471, 
+    25472, 25473, 25474, 25475, 25476, 25477, 25478, 25479, 25480, 25481, 
+    25482, 25483, 25484, 25485, 25486, 25487, 25488, 25489, 25490, 25491, 
+    25492, 25493, 25494, 25495, 25496, 25497, 25498, 25499, 25500, 25501, 
+    25502, 25503, 25504, 25505, 25506, 25507, 25508, 25509, 25510, 25511, 
+    25512, 25513, 25514, 25515, 25516, 25517, 25518, 25519, 25520, 25521, 
+    25522, 25523, 25524, 25525, 25526, 25527, 25528, 25529, 25530, 25531, 
+    25532, 25533, 25534, 25535, 25536, 25537, 25538, 25539, 25540, 25541, 
+    25542, 25543, 25544, 25545, 25546, 25547, 25548, 25549, 25550, 25551, 
+    25552, 25553, 25554, 25555, 25556, 25557, 25558, 25559, 25560, 25561, 
+    25562, 25563, 25564, 25565, 25566, 25567, 25568, 25569, 25570, 25571, 
+    25572, 25573, 25574, 25575, 25576, 25577, 25578, 25579, 25580, 25581, 
+    25582, 25583, 25584, 25585, 25586, 25587, 25588, 25589, 25590, 25591, 
+    25592, 25593, 25594, 25595, 25596, 25597, 25598, 25599, 25600, 25601, 
+    25602, 25603, 25604, 25605, 25606, 25607, 25608, 25609, 25610, 25611, 
+    25612, 25613, 25614, 25615, 25616, 25617, 25618, 25619, 25620, 25621, 
+    25622, 25623, 25624, 25625, 25626, 25627, 25628, 25629, 25630, 25631, 
+    25632, 25633, 25634, 25635, 25636, 25637, 25638, 25639, 25640, 25641, 
+    25642, 25643, 25644, 25645, 25646, 25647, 25648, 25649, 25650, 25651, 
+    25652, 25653, 25654, 25655, 25656, 25657, 25658, 25659, 25660, 25661, 
+    25662, 25663, 25664, 25665, 25666, 25667, 25668, 25669, 25670, 25671, 
+    25672, 25673, 25674, 25675, 25676, 25677, 25678, 25679, 25680, 25681, 
+    25682, 25683, 25684, 25685, 25686, 25687, 25688, 25689, 25690, 25691, 
+    25692, 25693, 25694, 25695, 25696, 25697, 25698, 25699, 25700, 25701, 
+    25702, 25703, 25704, 25705, 25706, 25707, 25708, 25709, 25710, 25711, 
+    25712, 25713, 25714, 25715, 25716, 25717, 25718, 25719, 25720, 25721, 
+    25722, 25723, 25724, 25725, 25726, 25727, 25728, 25729, 25730, 25731, 
+    25732, 25733, 25734, 25735, 25736, 25737, 25738, 25739, 25740, 25741, 
+    25742, 25743, 25744, 25745, 25746, 25747, 25748, 25749, 25750, 25751, 
+    25752, 25753, 25754, 25755, 25756, 25757, 25758, 25759, 25760, 25761, 
+    25762, 25763, 25764, 25765, 25766, 25767, 25768, 25769, 25770, 25771, 
+    25772, 25773, 25774, 25775, 25776, 25777, 25778, 25779, 25780, 25781, 
+    25782, 25783, 25784, 25785, 25786, 25787, 25788, 25789, 25790, 25791, 
+    25792, 25793, 25794, 25795, 25796, 25797, 25798, 25799, 25800, 25801, 
+    25802, 25803, 25804, 25805, 25806, 25807, 25808, 25809, 25810, 25811, 
+    25812, 25813, 25814, 25815, 25816, 25817, 25818, 25819, 25820, 25821, 
+    25822, 25823, 25824, 25825, 25826, 25827, 25828, 25829, 25830, 25831, 
+    25832, 25833, 25834, 25835, 25836, 25837, 25838, 25839, 25840, 25841, 
+    25842, 25843, 25844, 25845, 25846, 25847, 25848, 25849, 25850, 25851, 
+    25852, 25853, 25854, 25855, 25856, 25857, 25858, 25859, 25860, 25861, 
+    25862, 25863, 25864, 25865, 25866, 25867, 25868, 25869, 25870, 25871, 
+    25872, 25873, 25874, 25875, 25876, 25877, 25878, 25879, 25880, 25881, 
+    25882, 25883, 25884, 25885, 25886, 25887, 25888, 25889, 25890, 25891, 
+    25892, 25893, 25894, 25895, 25896, 25897, 25898, 25899, 25900, 25901, 
+    25902, 25903, 25904, 25905, 25906, 25907, 25908, 25909, 25910, 25911, 
+    25912, 25913, 25914, 25915, 25916, 25917, 25918, 25919, 25920, 25921, 
+    25922, 25923, 25924, 25925, 25926, 25927, 25928, 25929, 25930, 25931, 
+    25932, 25933, 25934, 25935, 25936, 25937, 25938, 25939, 25940, 25941, 
+    25942, 25943, 25944, 25945, 25946, 25947, 25948, 25949, 25950, 25951, 
+    25952, 25953, 25954, 25955, 25956, 25957, 25958, 25959, 25960, 25961, 
+    25962, 25963, 25964, 25965, 25966, 25967, 25968, 25969, 25970, 25971, 
+    25972, 25973, 25974, 25975, 25976, 25977, 25978, 25979, 25980, 25981, 
+    25982, 25983, 25984, 25985, 25986, 25987, 25988, 25989, 25990, 25991, 
+    25992, 25993, 25994, 25995, 25996, 25997, 25998, 25999, 26000, 26001, 
+    26002, 26003, 26004, 26005, 26006, 26007, 26008, 26009, 26010, 26011, 
+    26012, 26013, 26014, 26015, 26016, 26017, 26018, 26019, 26020, 26021, 
+    26022, 26023, 26024, 26025, 26026, 26027, 26028, 26029, 26030, 26031, 
+    26032, 26033, 26034, 26035, 26036, 26037, 26038, 26039, 26040, 26041, 
+    26042, 26043, 26044, 26045, 26046, 26047, 26048, 26049, 26050, 26051, 
+    26052, 26053, 26054, 26055, 26056, 26057, 26058, 26059, 26060, 26061, 
+    26062, 26063, 26064, 26065, 26066, 26067, 26068, 26069, 26070, 26071, 
+    26072, 26073, 26074, 26075, 26076, 26077, 26078, 26079, 26080, 26081, 
+    26082, 26083, 26084, 26085, 26086, 26087, 26088, 26089, 26090, 26091, 
+    26092, 26093, 26094, 26095, 26096, 26097, 26098, 26099, 26100, 26101, 
+    26102, 26103, 26104, 26105, 26106, 26107, 26108, 26109, 26110, 26111, 
+    26112, 26113, 26114, 26115, 26116, 26117, 26118, 26119, 26120, 26121, 
+    26122, 26123, 26124, 26125, 26126, 26127, 26128, 26129, 26130, 26131, 
+    26132, 26133, 26134, 26135, 26136, 26137, 26138, 26139, 26140, 26141, 
+    26142, 26143, 26144, 26145, 26146, 26147, 26148, 26149, 26150, 26151, 
+    26152, 26153, 26154, 26155, 26156, 26157, 26158, 26159, 26160, 26161, 
+    26162, 26163, 26164, 26165, 26166, 26167, 26168, 26169, 26170, 26171, 
+    26172, 26173, 26174, 26175, 26176, 26177, 26178, 26179, 26180, 26181, 
+    26182, 26183, 26184, 26185, 26186, 26187, 26188, 26189, 26190, 26191, 
+    26192, 26193, 26194, 26195, 26196, 26197, 26198, 26199, 26200, 26201, 
+    26202, 26203, 26204, 26205, 26206, 26207, 26208, 26209, 26210, 26211, 
+    26212, 26213, 26214, 26215, 26216, 26217, 26218, 26219, 26220, 26221, 
+    26222, 26223, 26224, 26225, 26226, 26227, 26228, 26229, 26230, 26231, 
+    26232, 26233, 26234, 26235, 26236, 26237, 26238, 26239, 26240, 26241, 
+    26242, 26243, 26244, 26245, 26246, 26247, 26248, 26249, 26250, 26251, 
+    26252, 26253, 26254, 26255, 26256, 26257, 26258, 26259, 26260, 26261, 
+    26262, 26263, 26264, 26265, 26266, 26267, 26268, 26269, 26270, 26271, 
+    26272, 26273, 26274, 26275, 26276, 26277, 26278, 26279, 26280, 26281, 
+    26282, 26283, 26284, 26285, 26286, 26287, 26288, 26289, 26290, 26291, 
+    26292, 26293, 26294, 26295, 26296, 26297, 26298, 26299, 26300, 26301, 
+    26302, 26303, 26304, 26305, 26306, 26307, 26308, 26309, 26310, 26311, 
+    26312, 26313, 26314, 26315, 26316, 26317, 26318, 26319, 26320, 26321, 
+    26322, 26323, 26324, 26325, 26326, 26327, 26328, 26329, 26330, 26331, 
+    26332, 26333, 26334, 26335, 26336, 26337, 26338, 26339, 26340, 26341, 
+    26342, 26343, 26344, 26345, 26346, 26347, 26348, 26349, 26350, 26351, 
+    26352, 26353, 26354, 26355, 26356, 26357, 26358, 26359, 26360, 26361, 
+    26362, 26363, 26364, 26365, 26366, 26367, 26368, 26369, 26370, 26371, 
+    26372, 26373, 26374, 26375, 26376, 26377, 26378, 26379, 26380, 26381, 
+    26382, 26383, 26384, 26385, 26386, 26387, 26388, 26389, 26390, 26391, 
+    26392, 26393, 26394, 26395, 26396, 26397, 26398, 26399, 26400, 26401, 
+    26402, 26403, 26404, 26405, 26406, 26407, 26408, 26409, 26410, 26411, 
+    26412, 26413, 26414, 26415, 26416, 26417, 26418, 26419, 26420, 26421, 
+    26422, 26423, 26424, 26425, 26426, 26427, 26428, 26429, 26430, 26431, 
+    26432, 26433, 26434, 26435, 26436, 26437, 26438, 26439, 26440, 26441, 
+    26442, 26443, 26444, 26445, 26446, 26447, 26448, 26449, 26450, 26451, 
+    26452, 26453, 26454, 26455, 26456, 26457, 26458, 26459, 26460, 26461, 
+    26462, 26463, 26464, 26465, 26466, 26467, 26468, 26469, 26470, 26471, 
+    26472, 26473, 26474, 26475, 26476, 26477, 26478, 26479, 26480, 26481, 
+    26482, 26483, 26484, 26485, 26486, 26487, 26488, 26489, 26490, 26491, 
+    26492, 26493, 26494, 26495, 26496, 26497, 26498, 26499, 26500, 26501, 
+    26502, 26503, 26504, 26505, 26506, 26507, 26508, 26509, 26510, 26511, 
+    26512, 26513, 26514, 26515, 26516, 26517, 26518, 26519, 26520, 26521, 
+    26522, 26523, 26524, 26525, 26526, 26527, 26528, 26529, 26530, 26531, 
+    26532, 26533, 26534, 26535, 26536, 26537, 26538, 26539, 26540, 26541, 
+    26542, 26543, 26544, 26545, 26546, 26547, 26548, 26549, 26550, 26551, 
+    26552, 26553, 26554, 26555, 26556, 26557, 26558, 26559, 26560, 26561, 
+    26562, 26563, 26564, 26565, 26566, 26567, 26568, 26569, 26570, 26571, 
+    26572, 26573, 26574, 26575, 26576, 26577, 26578, 26579, 26580, 26581, 
+    26582, 26583, 26584, 26585, 26586, 26587, 26588, 26589, 26590, 26591, 
+    26592, 26593, 26594, 26595, 26596, 26597, 26598, 26599, 26600, 26601, 
+    26602, 26603, 26604, 26605, 26606, 26607, 26608, 26609, 26610, 26611, 
+    26612, 26613, 26614, 26615, 26616, 26617, 26618, 26619, 26620, 26621, 
+    26622, 26623, 26624, 26625, 26626, 26627, 26628, 26629, 26630, 26631, 
+    26632, 26633, 26634, 26635, 26636, 26637, 26638, 26639, 26640, 26641, 
+    26642, 26643, 26644, 26645, 26646, 26647, 26648, 26649, 26650, 26651, 
+    26652, 26653, 26654, 26655, 26656, 26657, 26658, 26659, 26660, 26661, 
+    26662, 26663, 26664, 26665, 26666, 26667, 26668, 26669, 26670, 26671, 
+    26672, 26673, 26674, 26675, 26676, 26677, 26678, 26679, 26680, 26681, 
+    26682, 26683, 26684, 26685, 26686, 26687, 26688, 26689, 26690, 26691, 
+    26692, 26693, 26694, 26695, 26696, 26697, 26698, 26699, 26700, 26701, 
+    26702, 26703, 26704, 26705, 26706, 26707, 26708, 26709, 26710, 26711, 
+    26712, 26713, 26714, 26715, 26716, 26717, 26718, 26719, 26720, 26721, 
+    26722, 26723, 26724, 26725, 26726, 26727, 26728, 26729, 26730, 26731, 
+    26732, 26733, 26734, 26735, 26736, 26737, 26738, 26739, 26740, 26741, 
+    26742, 26743, 26744, 26745, 26746, 26747, 26748, 26749, 26750, 26751, 
+    26752, 26753, 26754, 26755, 26756, 26757, 26758, 26759, 26760, 26761, 
+    26762, 26763, 26764, 26765, 26766, 26767, 26768, 26769, 26770, 26771, 
+    26772, 26773, 26774, 26775, 26776, 26777, 26778, 26779, 26780, 26781, 
+    26782, 26783, 26784, 26785, 26786, 26787, 26788, 26789, 26790, 26791, 
+    26792, 26793, 26794, 26795, 26796, 26797, 26798, 26799, 26800, 26801, 
+    26802, 26803, 26804, 26805, 26806, 26807, 26808, 26809, 26810, 26811, 
+    26812, 26813, 26814, 26815, 26816, 26817, 26818, 26819, 26820, 26821, 
+    26822, 26823, 26824, 26825, 26826, 26827, 26828, 26829, 26830, 26831, 
+    26832, 26833, 26834, 26835, 26836, 26837, 26838, 26839, 26840, 26841, 
+    26842, 26843, 26844, 26845, 26846, 26847, 26848, 26849, 26850, 26851, 
+    26852, 26853, 26854, 26855, 26856, 26857, 26858, 26859, 26860, 26861, 
+    26862, 26863, 26864, 26865, 26866, 26867, 26868, 26869, 26870, 26871, 
+    26872, 26873, 26874, 26875, 26876, 26877, 26878, 26879, 26880, 26881, 
+    26882, 26883, 26884, 26885, 26886, 26887, 26888, 26889, 26890, 26891, 
+    26892, 26893, 26894, 26895, 26896, 26897, 26898, 26899, 26900, 26901, 
+    26902, 26903, 26904, 26905, 26906, 26907, 26908, 26909, 26910, 26911, 
+    26912, 26913, 26914, 26915, 26916, 26917, 26918, 26919, 26920, 26921, 
+    26922, 26923, 26924, 26925, 26926, 26927, 26928, 26929, 26930, 26931, 
+    26932, 26933, 26934, 26935, 26936, 26937, 26938, 26939, 26940, 26941, 
+    26942, 26943, 26944, 26945, 26946, 26947, 26948, 26949, 26950, 26951, 
+    26952, 26953, 26954, 26955, 26956, 26957, 26958, 26959, 26960, 26961, 
+    26962, 26963, 26964, 26965, 26966, 26967, 26968, 26969, 26970, 26971, 
+    26972, 26973, 26974, 26975, 26976, 26977, 26978, 26979, 26980, 26981, 
+    26982, 26983, 26984, 26985, 26986, 26987, 26988, 26989, 26990, 26991, 
+    26992, 26993, 26994, 26995, 26996, 26997, 26998, 26999, 27000, 27001, 
+    27002, 27003, 27004, 27005, 27006, 27007, 27008, 27009, 27010, 27011, 
+    27012, 27013, 27014, 27015, 27016, 27017, 27018, 27019, 27020, 27021, 
+    27022, 27023, 27024, 27025, 27026, 27027, 27028, 27029, 27030, 27031, 
+    27032, 27033, 27034, 27035, 27036, 27037, 27038, 27039, 27040, 27041, 
+    27042, 27043, 27044, 27045, 27046, 27047, 27048, 27049, 27050, 27051, 
+    27052, 27053, 27054, 27055, 27056, 27057, 27058, 27059, 27060, 27061, 
+    27062, 27063, 27064, 27065, 27066, 27067, 27068, 27069, 27070, 27071, 
+    27072, 27073, 27074, 27075, 27076, 27077, 27078, 27079, 27080, 27081, 
+    27082, 27083, 27084, 27085, 27086, 27087, 27088, 27089, 27090, 27091, 
+    27092, 27093, 27094, 27095, 27096, 27097, 27098, 27099, 27100, 27101, 
+    27102, 27103, 27104, 27105, 27106, 27107, 27108, 27109, 27110, 27111, 
+    27112, 27113, 27114, 27115, 27116, 27117, 27118, 27119, 27120, 27121, 
+    27122, 27123, 27124, 27125, 27126, 27127, 27128, 27129, 27130, 27131, 
+    27132, 27133, 27134, 27135, 27136, 27137, 27138, 27139, 27140, 27141, 
+    27142, 27143, 27144, 27145, 27146, 27147, 27148, 27149, 27150, 27151, 
+    27152, 27153, 27154, 27155, 27156, 27157, 27158, 27159, 27160, 27161, 
+    27162, 27163, 27164, 27165, 27166, 27167, 27168, 27169, 27170, 27171, 
+    27172, 27173, 27174, 27175, 27176, 27177, 27178, 27179, 27180, 27181, 
+    27182, 27183, 27184, 27185, 27186, 27187, 27188, 27189, 27190, 27191, 
+    27192, 27193, 27194, 27195, 27196, 27197, 27198, 27199, 27200, 27201, 
+    27202, 27203, 27204, 27205, 27206, 27207, 27208, 27209, 27210, 27211, 
+    27212, 27213, 27214, 27215, 27216, 27217, 27218, 27219, 27220, 27221, 
+    27222, 27223, 27224, 27225, 27226, 27227, 27228, 27229, 27230, 27231, 
+    27232, 27233, 27234, 27235, 27236, 27237, 27238, 27239, 27240, 27241, 
+    27242, 27243, 27244, 27245, 27246, 27247, 27248, 27249, 27250, 27251, 
+    27252, 27253, 27254, 27255, 27256, 27257, 27258, 27259, 27260, 27261, 
+    27262, 27263, 27264, 27265, 27266, 27267, 27268, 27269, 27270, 27271, 
+    27272, 27273, 27274, 27275, 27276, 27277, 27278, 27279, 27280, 27281, 
+    27282, 27283, 27284, 27285, 27286, 27287, 27288, 27289, 27290, 27291, 
+    27292, 27293, 27294, 27295, 27296, 27297, 27298, 27299, 27300, 27301, 
+    27302, 27303, 27304, 27305, 27306, 27307, 27308, 27309, 27310, 27311, 
+    27312, 27313, 27314, 27315, 27316, 27317, 27318, 27319, 27320, 27321, 
+    27322, 27323, 27324, 27325, 27326, 27327, 27328, 27329, 27330, 27331, 
+    27332, 27333, 27334, 27335, 27336, 27337, 27338, 27339, 27340, 27341, 
+    27342, 27343, 27344, 27345, 27346, 27347, 27348, 27349, 27350, 27351, 
+    27352, 27353, 27354, 27355, 27356, 27357, 27358, 27359, 27360, 27361, 
+    27362, 27363, 27364, 27365, 27366, 27367, 27368, 27369, 27370, 27371, 
+    27372, 27373, 27374, 27375, 27376, 27377, 27378, 27379, 27380, 27381, 
+    27382, 27383, 27384, 27385, 27386, 27387, 27388, 27389, 27390, 27391, 
+    27392, 27393, 27394, 27395, 27396, 27397, 27398, 27399, 27400, 27401, 
+    27402, 27403, 27404, 27405, 27406, 27407, 27408, 27409, 27410, 27411, 
+    27412, 27413, 27414, 27415, 27416, 27417, 27418, 27419, 27420, 27421, 
+    27422, 27423, 27424, 27425, 27426, 27427, 27428, 27429, 27430, 27431, 
+    27432, 27433, 27434, 27435, 27436, 27437, 27438, 27439, 27440, 27441, 
+    27442, 27443, 27444, 27445, 27446, 27447, 27448, 27449, 27450, 27451, 
+    27452, 27453, 27454, 27455, 27456, 27457, 27458, 27459, 27460, 27461, 
+    27462, 27463, 27464, 27465, 27466, 27467, 27468, 27469, 27470, 27471, 
+    27472, 27473, 27474, 27475, 27476, 27477, 27478, 27479, 27480, 27481, 
+    27482, 27483, 27484, 27485, 27486, 27487, 27488, 27489, 27490, 27491, 
+    27492, 27493, 27494, 27495, 27496, 27497, 27498, 27499, 27500, 27501, 
+    27502, 27503, 27504, 27505, 27506, 27507, 27508, 27509, 27510, 27511, 
+    27512, 27513, 27514, 27515, 27516, 27517, 27518, 27519, 27520, 27521, 
+    27522, 27523, 27524, 27525, 27526, 27527, 27528, 27529, 27530, 27531, 
+    27532, 27533, 27534, 27535, 27536, 27537, 27538, 27539, 27540, 27541, 
+    27542, 27543, 27544, 27545, 27546, 27547, 27548, 27549, 27550, 27551, 
+    27552, 27553, 27554, 27555, 27556, 27557, 27558, 27559, 27560, 27561, 
+    27562, 27563, 27564, 27565, 27566, 27567, 27568, 27569, 27570, 27571, 
+    27572, 27573, 27574, 27575, 27576, 27577, 27578, 27579, 27580, 27581, 
+    27582, 27583, 27584, 27585, 27586, 27587, 27588, 27589, 27590, 27591, 
+    27592, 27593, 27594, 27595, 27596, 27597, 27598, 27599, 27600, 27601, 
+    27602, 27603, 27604, 27605, 27606, 27607, 27608, 27609, 27610, 27611, 
+    27612, 27613, 27614, 27615, 27616, 27617, 27618, 27619, 27620, 27621, 
+    27622, 27623, 27624, 27625, 27626, 27627, 27628, 27629, 27630, 27631, 
+    27632, 27633, 27634, 27635, 27636, 27637, 27638, 27639, 27640, 27641, 
+    27642, 27643, 27644, 27645, 27646, 27647, 27648, 27649, 27650, 27651, 
+    27652, 27653, 27654, 27655, 27656, 27657, 27658, 27659, 27660, 27661, 
+    27662, 27663, 27664, 27665, 27666, 27667, 27668, 27669, 27670, 27671, 
+    27672, 27673, 27674, 27675, 27676, 27677, 27678, 27679, 27680, 27681, 
+    27682, 27683, 27684, 27685, 27686, 27687, 27688, 27689, 27690, 27691, 
+    27692, 27693, 27694, 27695, 27696, 27697, 27698, 27699, 27700, 27701, 
+    27702, 27703, 27704, 27705, 27706, 27707, 27708, 27709, 27710, 27711, 
+    27712, 27713, 27714, 27715, 27716, 27717, 27718, 27719, 27720, 27721, 
+    27722, 27723, 27724, 27725, 27726, 27727, 27728, 27729, 27730, 27731, 
+    27732, 27733, 27734, 27735, 27736, 27737, 27738, 27739, 27740, 27741, 
+    27742, 27743, 27744, 27745, 27746, 27747, 27748, 27749, 27750, 27751, 
+    27752, 27753, 27754, 27755, 27756, 27757, 27758, 27759, 27760, 27761, 
+    27762, 27763, 27764, 27765, 27766, 27767, 27768, 27769, 27770, 27771, 
+    27772, 27773, 27774, 27775, 27776, 27777, 27778, 27779, 27780, 27781, 
+    27782, 27783, 27784, 27785, 27786, 27787, 27788, 27789, 27790, 27791, 
+    27792, 27793, 27794, 27795, 27796, 27797, 27798, 27799, 27800, 27801, 
+    27802, 27803, 27804, 27805, 27806, 27807, 27808, 27809, 27810, 27811, 
+    27812, 27813, 27814, 27815, 27816, 27817, 27818, 27819, 27820, 27821, 
+    27822, 27823, 27824, 27825, 27826, 27827, 27828, 27829, 27830, 27831, 
+    27832, 27833, 27834, 27835, 27836, 27837, 27838, 27839, 27840, 27841, 
+    27842, 27843, 27844, 27845, 27846, 27847, 27848, 27849, 27850, 27851, 
+    27852, 27853, 27854, 27855, 27856, 27857, 27858, 27859, 27860, 27861, 
+    27862, 27863, 27864, 27865, 27866, 27867, 27868, 27869, 27870, 27871, 
+    27872, 27873, 27874, 27875, 27876, 27877, 27878, 27879, 27880, 27881, 
+    27882, 27883, 27884, 27885, 27886, 27887, 27888, 27889, 27890, 27891, 
+    27892, 27893, 27894, 27895, 27896, 27897, 27898, 27899, 27900, 27901, 
+    27902, 27903, 27904, 27905, 27906, 27907, 27908, 27909, 27910, 27911, 
+    27912, 27913, 27914, 27915, 27916, 27917, 27918, 27919, 27920, 27921, 
+    27922, 27923, 27924, 27925, 27926, 27927, 27928, 27929, 27930, 27931, 
+    27932, 27933, 27934, 27935, 27936, 27937, 27938, 27939, 27940, 27941, 
+    27942, 27943, 27944, 27945, 27946, 27947, 27948, 27949, 27950, 27951, 
+    27952, 27953, 27954, 27955, 27956, 27957, 27958, 27959, 27960, 27961, 
+    27962, 27963, 27964, 27965, 27966, 27967, 27968, 27969, 27970, 27971, 
+    27972, 27973, 27974, 27975, 27976, 27977, 27978, 27979, 27980, 27981, 
+    27982, 27983, 27984, 27985, 27986, 27987, 27988, 27989, 27990, 27991, 
+    27992, 27993, 27994, 27995, 27996, 27997, 27998, 27999, 28000, 28001, 
+    28002, 28003, 28004, 28005, 28006, 28007, 28008, 28009, 28010, 28011, 
+    28012, 28013, 28014, 28015, 28016, 28017, 28018, 28019, 28020, 28021, 
+    28022, 28023, 28024, 28025, 28026, 28027, 28028, 28029, 28030, 28031, 
+    28032, 28033, 28034, 28035, 28036, 28037, 28038, 28039, 28040, 28041, 
+    28042, 28043, 28044, 28045, 28046, 28047, 28048, 28049, 28050, 28051, 
+    28052, 28053, 28054, 28055, 28056, 28057, 28058, 28059, 28060, 28061, 
+    28062, 28063, 28064, 28065, 28066, 28067, 28068, 28069, 28070, 28071, 
+    28072, 28073, 28074, 28075, 28076, 28077, 28078, 28079, 28080, 28081, 
+    28082, 28083, 28084, 28085, 28086, 28087, 28088, 28089, 28090, 28091, 
+    28092, 28093, 28094, 28095, 28096, 28097, 28098, 28099, 28100, 28101, 
+    28102, 28103, 28104, 28105, 28106, 28107, 28108, 28109, 28110, 28111, 
+    28112, 28113, 28114, 28115, 28116, 28117, 28118, 28119, 28120, 28121, 
+    28122, 28123, 28124, 28125, 28126, 28127, 28128, 28129, 28130, 28131, 
+    28132, 28133, 28134, 28135, 28136, 28137, 28138, 28139, 28140, 28141, 
+    28142, 28143, 28144, 28145, 28146, 28147, 28148, 28149, 28150, 28151, 
+    28152, 28153, 28154, 28155, 28156, 28157, 28158, 28159, 28160, 28161, 
+    28162, 28163, 28164, 28165, 28166, 28167, 28168, 28169, 28170, 28171, 
+    28172, 28173, 28174, 28175, 28176, 28177, 28178, 28179, 28180, 28181, 
+    28182, 28183, 28184, 28185, 28186, 28187, 28188, 28189, 28190, 28191, 
+    28192, 28193, 28194, 28195, 28196, 28197, 28198, 28199, 28200, 28201, 
+    28202, 28203, 28204, 28205, 28206, 28207, 28208, 28209, 28210, 28211, 
+    28212, 28213, 28214, 28215, 28216, 28217, 28218, 28219, 28220, 28221, 
+    28222, 28223, 28224, 28225, 28226, 28227, 28228, 28229, 28230, 28231, 
+    28232, 28233, 28234, 28235, 28236, 28237, 28238, 28239, 28240, 28241, 
+    28242, 28243, 28244, 28245, 28246, 28247, 28248, 28249, 28250, 28251, 
+    28252, 28253, 28254, 28255, 28256, 28257, 28258, 28259, 28260, 28261, 
+    28262, 28263, 28264, 28265, 28266, 28267, 28268, 28269, 28270, 28271, 
+    28272, 28273, 28274, 28275, 28276, 28277, 28278, 28279, 28280, 28281, 
+    28282, 28283, 28284, 28285, 28286, 28287, 28288, 28289, 28290, 28291, 
+    28292, 28293, 28294, 28295, 28296, 28297, 28298, 28299, 28300, 28301, 
+    28302, 28303, 28304, 28305, 28306, 28307, 28308, 28309, 28310, 28311, 
+    28312, 28313, 28314, 28315, 28316, 28317, 28318, 28319, 28320, 28321, 
+    28322, 28323, 28324, 28325, 28326, 28327, 28328, 28329, 28330, 28331, 
+    28332, 28333, 28334, 28335, 28336, 28337, 28338, 28339, 28340, 28341, 
+    28342, 28343, 28344, 28345, 28346, 28347, 28348, 28349, 28350, 28351, 
+    28352, 28353, 28354, 28355, 28356, 28357, 28358, 28359, 28360, 28361, 
+    28362, 28363, 28364, 28365, 28366, 28367, 28368, 28369, 28370, 28371, 
+    28372, 28373, 28374, 28375, 28376, 28377, 28378, 28379, 28380, 28381, 
+    28382, 28383, 28384, 28385, 28386, 28387, 28388, 28389, 28390, 28391, 
+    28392, 28393, 28394, 28395, 28396, 28397, 28398, 28399, 28400, 28401, 
+    28402, 28403, 28404, 28405, 28406, 28407, 28408, 28409, 28410, 28411, 
+    28412, 28413, 28414, 28415, 28416, 28417, 28418, 28419, 28420, 28421, 
+    28422, 28423, 28424, 28425, 28426, 28427, 28428, 28429, 28430, 28431, 
+    28432, 28433, 28434, 28435, 28436, 28437, 28438, 28439, 28440, 28441, 
+    28442, 28443, 28444, 28445, 28446, 28447, 28448, 28449, 28450, 28451, 
+    28452, 28453, 28454, 28455, 28456, 28457, 28458, 28459, 28460, 28461, 
+    28462, 28463, 28464, 28465, 28466, 28467, 28468, 28469, 28470, 28471, 
+    28472, 28473, 28474, 28475, 28476, 28477, 28478, 28479, 28480, 28481, 
+    28482, 28483, 28484, 28485, 28486, 28487, 28488, 28489, 28490, 28491, 
+    28492, 28493, 28494, 28495, 28496, 28497, 28498, 28499, 28500, 28501, 
+    28502, 28503, 28504, 28505, 28506, 28507, 28508, 28509, 28510, 28511, 
+    28512, 28513, 28514, 28515, 28516, 28517, 28518, 28519, 28520, 28521, 
+    28522, 28523, 28524, 28525, 28526, 28527, 28528, 28529, 28530, 28531, 
+    28532, 28533, 28534, 28535, 28536, 28537, 28538, 28539, 28540, 28541, 
+    28542, 28543, 28544, 28545, 28546, 28547, 28548, 28549, 28550, 28551, 
+    28552, 28553, 28554, 28555, 28556, 28557, 28558, 28559, 28560, 28561, 
+    28562, 28563, 28564, 28565, 28566, 28567, 28568, 28569, 28570, 28571, 
+    28572, 28573, 28574, 28575, 28576, 28577, 28578, 28579, 28580, 28581, 
+    28582, 28583, 28584, 28585, 28586, 28587, 28588, 28589, 28590, 28591, 
+    28592, 28593, 28594, 28595, 28596, 28597, 28598, 28599, 28600, 28601, 
+    28602, 28603, 28604, 28605, 28606, 28607, 28608, 28609, 28610, 28611, 
+    28612, 28613, 28614, 28615, 28616, 28617, 28618, 28619, 28620, 28621, 
+    28622, 28623, 28624, 28625, 28626, 28627, 28628, 28629, 28630, 28631, 
+    28632, 28633, 28634, 28635, 28636, 28637, 28638, 28639, 28640, 28641, 
+    28642, 28643, 28644, 28645, 28646, 28647, 28648, 28649, 28650, 28651, 
+    28652, 28653, 28654, 28655, 28656, 28657, 28658, 28659, 28660, 28661, 
+    28662, 28663, 28664, 28665, 28666, 28667, 28668, 28669, 28670, 28671, 
+    28672, 28673, 28674, 28675, 28676, 28677, 28678, 28679, 28680, 28681, 
+    28682, 28683, 28684, 28685, 28686, 28687, 28688, 28689, 28690, 28691, 
+    28692, 28693, 28694, 28695, 28696, 28697, 28698, 28699, 28700, 28701, 
+    28702, 28703, 28704, 28705, 28706, 28707, 28708, 28709, 28710, 28711, 
+    28712, 28713, 28714, 28715, 28716, 28717, 28718, 28719, 28720, 28721, 
+    28722, 28723, 28724, 28725, 28726, 28727, 28728, 28729, 28730, 28731, 
+    28732, 28733, 28734, 28735, 28736, 28737, 28738, 28739, 28740, 28741, 
+    28742, 28743, 28744, 28745, 28746, 28747, 28748, 28749, 28750, 28751, 
+    28752, 28753, 28754, 28755, 28756, 28757, 28758, 28759, 28760, 28761, 
+    28762, 28763, 28764, 28765, 28766, 28767, 28768, 28769, 28770, 28771, 
+    28772, 28773, 28774, 28775, 28776, 28777, 28778, 28779, 28780, 28781, 
+    28782, 28783, 28784, 28785, 28786, 28787, 28788, 28789, 28790, 28791, 
+    28792, 28793, 28794, 28795, 28796, 28797, 28798, 28799, 28800, 28801, 
+    28802, 28803, 28804, 28805, 28806, 28807, 28808, 28809, 28810, 28811, 
+    28812, 28813, 28814, 28815, 28816, 28817, 28818, 28819, 28820, 28821, 
+    28822, 28823, 28824, 28825, 28826, 28827, 28828, 28829, 28830, 28831, 
+    28832, 28833, 28834, 28835, 28836, 28837, 28838, 28839, 28840, 28841, 
+    28842, 28843, 28844, 28845, 28846, 28847, 28848, 28849, 28850, 28851, 
+    28852, 28853, 28854, 28855, 28856, 28857, 28858, 28859, 28860, 28861, 
+    28862, 28863, 28864, 28865, 28866, 28867, 28868, 28869, 28870, 28871, 
+    28872, 28873, 28874, 28875, 28876, 28877, 28878, 28879, 28880, 28881, 
+    28882, 28883, 28884, 28885, 28886, 28887, 28888, 28889, 28890, 28891, 
+    28892, 28893, 28894, 28895, 28896, 28897, 28898, 28899, 28900, 28901, 
+    28902, 28903, 28904, 28905, 28906, 28907, 28908, 28909, 28910, 28911, 
+    28912, 28913, 28914, 28915, 28916, 28917, 28918, 28919, 28920, 28921, 
+    28922, 28923, 28924, 28925, 28926, 28927, 28928, 28929, 28930, 28931, 
+    28932, 28933, 28934, 28935, 28936, 28937, 28938, 28939, 28940, 28941, 
+    28942, 28943, 28944, 28945, 28946, 28947, 28948, 28949, 28950, 28951, 
+    28952, 28953, 28954, 28955, 28956, 28957, 28958, 28959, 28960, 28961, 
+    28962, 28963, 28964, 28965, 28966, 28967, 28968, 28969, 28970, 28971, 
+    28972, 28973, 28974, 28975, 28976, 28977, 28978, 28979, 28980, 28981, 
+    28982, 28983, 28984, 28985, 28986, 28987, 28988, 28989, 28990, 28991, 
+    28992, 28993, 28994, 28995, 28996, 28997, 28998, 28999, 29000, 29001, 
+    29002, 29003, 29004, 29005, 29006, 29007, 29008, 29009, 29010, 29011, 
+    29012, 29013, 29014, 29015, 29016, 29017, 29018, 29019, 29020, 29021, 
+    29022, 29023, 29024, 29025, 29026, 29027, 29028, 29029, 29030, 29031, 
+    29032, 29033, 29034, 29035, 29036, 29037, 29038, 29039, 29040, 29041, 
+    29042, 29043, 29044, 29045, 29046, 29047, 29048, 29049, 29050, 29051, 
+    29052, 29053, 29054, 29055, 29056, 29057, 29058, 29059, 29060, 29061, 
+    29062, 29063, 29064, 29065, 29066, 29067, 29068, 29069, 29070, 29071, 
+    29072, 29073, 29074, 29075, 29076, 29077, 29078, 29079, 29080, 29081, 
+    29082, 29083, 29084, 29085, 29086, 29087, 29088, 29089, 29090, 29091, 
+    29092, 29093, 29094, 29095, 29096, 29097, 29098, 29099, 29100, 29101, 
+    29102, 29103, 29104, 29105, 29106, 29107, 29108, 29109, 29110, 29111, 
+    29112, 29113, 29114, 29115, 29116, 29117, 29118, 29119, 29120, 29121, 
+    29122, 29123, 29124, 29125, 29126, 29127, 29128, 29129, 29130, 29131, 
+    29132, 29133, 29134, 29135, 29136, 29137, 29138, 29139, 29140, 29141, 
+    29142, 29143, 29144, 29145, 29146, 29147, 29148, 29149, 29150, 29151, 
+    29152, 29153, 29154, 29155, 29156, 29157, 29158, 29159, 29160, 29161, 
+    29162, 29163, 29164, 29165, 29166, 29167, 29168, 29169, 29170, 29171, 
+    29172, 29173, 29174, 29175, 29176, 29177, 29178, 29179, 29180, 29181, 
+    29182, 29183, 29184, 29185, 29186, 29187, 29188, 29189, 29190, 29191, 
+    29192, 29193, 29194, 29195, 29196, 29197, 29198, 29199, 29200, 29201, 
+    29202, 29203, 29204, 29205, 29206, 29207, 29208, 29209, 29210, 29211, 
+    29212, 29213, 29214, 29215, 29216, 29217, 29218, 29219, 29220, 29221, 
+    29222, 29223, 29224, 29225, 29226, 29227, 29228, 29229, 29230, 29231, 
+    29232, 29233, 29234, 29235, 29236, 29237, 29238, 29239, 29240, 29241, 
+    29242, 29243, 29244, 29245, 29246, 29247, 29248, 29249, 29250, 29251, 
+    29252, 29253, 29254, 29255, 29256, 29257, 29258, 29259, 29260, 29261, 
+    29262, 29263, 29264, 29265, 29266, 29267, 29268, 29269, 29270, 29271, 
+    29272, 29273, 29274, 29275, 29276, 29277, 29278, 29279, 29280, 29281, 
+    29282, 29283, 29284, 29285, 29286, 29287, 29288, 29289, 29290, 29291, 
+    29292, 29293, 29294, 29295, 29296, 29297, 29298, 29299, 29300, 29301, 
+    29302, 29303, 29304, 29305, 29306, 29307, 29308, 29309, 29310, 29311, 
+    29312, 29313, 29314, 29315, 29316, 29317, 29318, 29319, 29320, 29321, 
+    29322, 29323, 29324, 29325, 29326, 29327, 29328, 29329, 29330, 29331, 
+    29332, 29333, 29334, 29335, 29336, 29337, 29338, 29339, 29340, 29341, 
+    29342, 29343, 29344, 29345, 29346, 29347, 29348, 29349, 29350, 29351, 
+    29352, 29353, 29354, 29355, 29356, 29357, 29358, 29359, 29360, 29361, 
+    29362, 29363, 29364, 29365, 29366, 29367, 29368, 29369, 29370, 29371, 
+    29372, 29373, 29374, 29375, 29376, 29377, 29378, 29379, 29380, 29381, 
+    29382, 29383, 29384, 29385, 29386, 29387, 29388, 29389, 29390, 29391, 
+    29392, 29393, 29394, 29395, 29396, 29397, 29398, 29399, 29400, 29401, 
+    29402, 29403, 29404, 29405, 29406, 29407, 29408, 29409, 29410, 29411, 
+    29412, 29413, 29414, 29415, 29416, 29417, 29418, 29419, 29420, 29421, 
+    29422, 29423, 29424, 29425, 29426, 29427, 29428, 29429, 29430, 29431, 
+    29432, 29433, 29434, 29435, 29436, 29437, 29438, 29439, 29440, 29441, 
+    29442, 29443, 29444, 29445, 29446, 29447, 29448, 29449, 29450, 29451, 
+    29452, 29453, 29454, 29455, 29456, 29457, 29458, 29459, 29460, 29461, 
+    29462, 29463, 29464, 29465, 29466, 29467, 29468, 29469, 29470, 29471, 
+    29472, 29473, 29474, 29475, 29476, 29477, 29478, 29479, 29480, 29481, 
+    29482, 29483, 29484, 29485, 29486, 29487, 29488, 29489, 29490, 29491, 
+    29492, 29493, 29494, 29495, 29496, 29497, 29498, 29499, 29500, 29501, 
+    29502, 29503, 29504, 29505, 29506, 29507, 29508, 29509, 29510, 29511, 
+    29512, 29513, 29514, 29515, 29516, 29517, 29518, 29519, 29520, 29521, 
+    29522, 29523, 29524, 29525, 29526, 29527, 29528, 29529, 29530, 29531, 
+    29532, 29533, 29534, 29535, 29536, 29537, 29538, 29539, 29540, 29541, 
+    29542, 29543, 29544, 29545, 29546, 29547, 29548, 29549, 29550, 29551, 
+    29552, 29553, 29554, 29555, 29556, 29557, 29558, 29559, 29560, 29561, 
+    29562, 29563, 29564, 29565, 29566, 29567, 29568, 29569, 29570, 29571, 
+    29572, 29573, 29574, 29575, 29576, 29577, 29578, 29579, 29580, 29581, 
+    29582, 29583, 29584, 29585, 29586, 29587, 29588, 29589, 29590, 29591, 
+    29592, 29593, 29594, 29595, 29596, 29597, 29598, 29599, 29600, 29601, 
+    29602, 29603, 29604, 29605, 29606, 29607, 29608, 29609, 29610, 29611, 
+    29612, 29613, 29614, 29615, 29616, 29617, 29618, 29619, 29620, 29621, 
+    29622, 29623, 29624, 29625, 29626, 29627, 29628, 29629, 29630, 29631, 
+    29632, 29633, 29634, 29635, 29636, 29637, 29638, 29639, 29640, 29641, 
+    29642, 29643, 29644, 29645, 29646, 29647, 29648, 29649, 29650, 29651, 
+    29652, 29653, 29654, 29655, 29656, 29657, 29658, 29659, 29660, 29661, 
+    29662, 29663, 29664, 29665, 29666, 29667, 29668, 29669, 29670, 29671, 
+    29672, 29673, 29674, 29675, 29676, 29677, 29678, 29679, 29680, 29681, 
+    29682, 29683, 29684, 29685, 29686, 29687, 29688, 29689, 29690, 29691, 
+    29692, 29693, 29694, 29695, 29696, 29697, 29698, 29699, 29700, 29701, 
+    29702, 29703, 29704, 29705, 29706, 29707, 29708, 29709, 29710, 29711, 
+    29712, 29713, 29714, 29715, 29716, 29717, 29718, 29719, 29720, 29721, 
+    29722, 29723, 29724, 29725, 29726, 29727, 29728, 29729, 29730, 29731, 
+    29732, 29733, 29734, 29735, 29736, 29737, 29738, 29739, 29740, 29741, 
+    29742, 29743, 29744, 29745, 29746, 29747, 29748, 29749, 29750, 29751, 
+    29752, 29753, 29754, 29755, 29756, 29757, 29758, 29759, 29760, 29761, 
+    29762, 29763, 29764, 29765, 29766, 29767, 29768, 29769, 29770, 29771, 
+    29772, 29773, 29774, 29775, 29776, 29777, 29778, 29779, 29780, 29781, 
+    29782, 29783, 29784, 29785, 29786, 29787, 29788, 29789, 29790, 29791, 
+    29792, 29793, 29794, 29795, 29796, 29797, 29798, 29799, 29800, 29801, 
+    29802, 29803, 29804, 29805, 29806, 29807, 29808, 29809, 29810, 29811, 
+    29812, 29813, 29814, 29815, 29816, 29817, 29818, 29819, 29820, 29821, 
+    29822, 29823, 29824, 29825, 29826, 29827, 29828, 29829, 29830, 29831, 
+    29832, 29833, 29834, 29835, 29836, 29837, 29838, 29839, 29840, 29841, 
+    29842, 29843, 29844, 29845, 29846, 29847, 29848, 29849, 29850, 29851, 
+    29852, 29853, 29854, 29855, 29856, 29857, 29858, 29859, 29860, 29861, 
+    29862, 29863, 29864, 29865, 29866, 29867, 29868, 29869, 29870, 29871, 
+    29872, 29873, 29874, 29875, 29876, 29877, 29878, 29879, 29880, 29881, 
+    29882, 29883, 29884, 29885, 29886, 29887, 29888, 29889, 29890, 29891, 
+    29892, 29893, 29894, 29895, 29896, 29897, 29898, 29899, 29900, 29901, 
+    29902, 29903, 29904, 29905, 29906, 29907, 29908, 29909, 29910, 29911, 
+    29912, 29913, 29914, 29915, 29916, 29917, 29918, 29919, 29920, 29921, 
+    29922, 29923, 29924, 29925, 29926, 29927, 29928, 29929, 29930, 29931, 
+    29932, 29933, 29934, 29935, 29936, 29937, 29938, 29939, 29940, 29941, 
+    29942, 29943, 29944, 29945, 29946, 29947, 29948, 29949, 29950, 29951, 
+    29952, 29953, 29954, 29955, 29956, 29957, 29958, 29959, 29960, 29961, 
+    29962, 29963, 29964, 29965, 29966, 29967, 29968, 29969, 29970, 29971, 
+    29972, 29973, 29974, 29975, 29976, 29977, 29978, 29979, 29980, 29981, 
+    29982, 29983, 29984, 29985, 29986, 29987, 29988, 29989, 29990, 29991, 
+    29992, 29993, 29994, 29995, 29996, 29997, 29998, 29999, 30000, 30001, 
+    30002, 30003, 30004, 30005, 30006, 30007, 30008, 30009, 30010, 30011, 
+    30012, 30013, 30014, 30015, 30016, 30017, 30018, 30019, 30020, 30021, 
+    30022, 30023, 30024, 30025, 30026, 30027, 30028, 30029, 30030, 30031, 
+    30032, 30033, 30034, 30035, 30036, 30037, 30038, 30039, 30040, 30041, 
+    30042, 30043, 30044, 30045, 30046, 30047, 30048, 30049, 30050, 30051, 
+    30052, 30053, 30054, 30055, 30056, 30057, 30058, 30059, 30060, 30061, 
+    30062, 30063, 30064, 30065, 30066, 30067, 30068, 30069, 30070, 30071, 
+    30072, 30073, 30074, 30075, 30076, 30077, 30078, 30079, 30080, 30081, 
+    30082, 30083, 30084, 30085, 30086, 30087, 30088, 30089, 30090, 30091, 
+    30092, 30093, 30094, 30095, 30096, 30097, 30098, 30099, 30100, 30101, 
+    30102, 30103, 30104, 30105, 30106, 30107, 30108, 30109, 30110, 30111, 
+    30112, 30113, 30114, 30115, 30116, 30117, 30118, 30119, 30120, 30121, 
+    30122, 30123, 30124, 30125, 30126, 30127, 30128, 30129, 30130, 30131, 
+    30132, 30133, 30134, 30135, 30136, 30137, 30138, 30139, 30140, 30141, 
+    30142, 30143, 30144, 30145, 30146, 30147, 30148, 30149, 30150, 30151, 
+    30152, 30153, 30154, 30155, 30156, 30157, 30158, 30159, 30160, 30161, 
+    30162, 30163, 30164, 30165, 30166, 30167, 30168, 30169, 30170, 30171, 
+    30172, 30173, 30174, 30175, 30176, 30177, 30178, 30179, 30180, 30181, 
+    30182, 30183, 30184, 30185, 30186, 30187, 30188, 30189, 30190, 30191, 
+    30192, 30193, 30194, 30195, 30196, 30197, 30198, 30199, 30200, 30201, 
+    30202, 30203, 30204, 30205, 30206, 30207, 30208, 30209, 30210, 30211, 
+    30212, 30213, 30214, 30215, 30216, 30217, 30218, 30219, 30220, 30221, 
+    30222, 30223, 30224, 30225, 30226, 30227, 30228, 30229, 30230, 30231, 
+    30232, 30233, 30234, 30235, 30236, 30237, 30238, 30239, 30240, 30241, 
+    30242, 30243, 30244, 30245, 30246, 30247, 30248, 30249, 30250, 30251, 
+    30252, 30253, 30254, 30255, 30256, 30257, 30258, 30259, 30260, 30261, 
+    30262, 30263, 30264, 30265, 30266, 30267, 30268, 30269, 30270, 30271, 
+    30272, 30273, 30274, 30275, 30276, 30277, 30278, 30279, 30280, 30281, 
+    30282, 30283, 30284, 30285, 30286, 30287, 30288, 30289, 30290, 30291, 
+    30292, 30293, 30294, 30295, 30296, 30297, 30298, 30299, 30300, 30301, 
+    30302, 30303, 30304, 30305, 30306, 30307, 30308, 30309, 30310, 30311, 
+    30312, 30313, 30314, 30315, 30316, 30317, 30318, 30319, 30320, 30321, 
+    30322, 30323, 30324, 30325, 30326, 30327, 30328, 30329, 30330, 30331, 
+    30332, 30333, 30334, 30335, 30336, 30337, 30338, 30339, 30340, 30341, 
+    30342, 30343, 30344, 30345, 30346, 30347, 30348, 30349, 30350, 30351, 
+    30352, 30353, 30354, 30355, 30356, 30357, 30358, 30359, 30360, 30361, 
+    30362, 30363, 30364, 30365, 30366, 30367, 30368, 30369, 30370, 30371, 
+    30372, 30373, 30374, 30375, 30376, 30377, 30378, 30379, 30380, 30381, 
+    30382, 30383, 30384, 30385, 30386, 30387, 30388, 30389, 30390, 30391, 
+    30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 
+    30402, 30403, 30404, 30405, 30406, 30407, 30408, 30409, 30410, 30411, 
+    30412, 30413, 30414, 30415, 30416, 30417, 30418, 30419, 30420, 30421, 
+    30422, 30423, 30424, 30425, 30426, 30427, 30428, 30429, 30430, 30431, 
+    30432, 30433, 30434, 30435, 30436, 30437, 30438, 30439, 30440, 30441, 
+    30442, 30443, 30444, 30445, 30446, 30447, 30448, 30449, 30450, 30451, 
+    30452, 30453, 30454, 30455, 30456, 30457, 30458, 30459, 30460, 30461, 
+    30462, 30463, 30464, 30465, 30466, 30467, 30468, 30469, 30470, 30471, 
+    30472, 30473, 30474, 30475, 30476, 30477, 30478, 30479, 30480, 30481, 
+    30482, 30483, 30484, 30485, 30486, 30487, 30488, 30489, 30490, 30491, 
+    30492, 30493, 30494, 30495, 30496, 30497, 30498, 30499, 30500, 30501, 
+    30502, 30503, 30504, 30505, 30506, 30507, 30508, 30509, 30510, 30511, 
+    30512, 30513, 30514, 30515, 30516, 30517, 30518, 30519, 30520, 30521, 
+    30522, 30523, 30524, 30525, 30526, 30527, 30528, 30529, 30530, 30531, 
+    30532, 30533, 30534, 30535, 30536, 30537, 30538, 30539, 30540, 30541, 
+    30542, 30543, 30544, 30545, 30546, 30547, 30548, 30549, 30550, 30551, 
+    30552, 30553, 30554, 30555, 30556, 30557, 30558, 30559, 30560, 30561, 
+    30562, 30563, 30564, 30565, 30566, 30567, 30568, 30569, 30570, 30571, 
+    30572, 30573, 30574, 30575, 30576, 30577, 30578, 30579, 30580, 30581, 
+    30582, 30583, 30584, 30585, 30586, 30587, 30588, 30589, 30590, 30591, 
+    30592, 30593, 30594, 30595, 30596, 30597, 30598, 30599, 30600, 30601, 
+    30602, 30603, 30604, 30605, 30606, 30607, 30608, 30609, 30610, 30611, 
+    30612, 30613, 30614, 30615, 30616, 30617, 30618, 30619, 30620, 30621, 
+    30622, 30623, 30624, 30625, 30626, 30627, 30628, 30629, 30630, 30631, 
+    30632, 30633, 30634, 30635, 30636, 30637, 30638, 30639, 30640, 30641, 
+    30642, 30643, 30644, 30645, 30646, 30647, 30648, 30649, 30650, 30651, 
+    30652, 30653, 30654, 30655, 30656, 30657, 30658, 30659, 30660, 30661, 
+    30662, 30663, 30664, 30665, 30666, 30667, 30668, 30669, 30670, 30671, 
+    30672, 30673, 30674, 30675, 30676, 30677, 30678, 30679, 30680, 30681, 
+    30682, 30683, 30684, 30685, 30686, 30687, 30688, 30689, 30690, 30691, 
+    30692, 30693, 30694, 30695, 30696, 30697, 30698, 30699, 30700, 30701, 
+    30702, 30703, 30704, 30705, 30706, 30707, 30708, 30709, 30710, 30711, 
+    30712, 30713, 30714, 30715, 30716, 30717, 30718, 30719, 30720, 30721, 
+    30722, 30723, 30724, 30725, 30726, 30727, 30728, 30729, 30730, 30731, 
+    30732, 30733, 30734, 30735, 30736, 30737, 30738, 30739, 30740, 30741, 
+    30742, 30743, 30744, 30745, 30746, 30747, 30748, 30749, 30750, 30751, 
+    30752, 30753, 30754, 30755, 30756, 30757, 30758, 30759, 30760, 30761, 
+    30762, 30763, 30764, 30765, 30766, 30767, 30768, 30769, 30770, 30771, 
+    30772, 30773, 30774, 30775, 30776, 30777, 30778, 30779, 30780, 30781, 
+    30782, 30783, 30784, 30785, 30786, 30787, 30788, 30789, 30790, 30791, 
+    30792, 30793, 30794, 30795, 30796, 30797, 30798, 30799, 30800, 30801, 
+    30802, 30803, 30804, 30805, 30806, 30807, 30808, 30809, 30810, 30811, 
+    30812, 30813, 30814, 30815, 30816, 30817, 30818, 30819, 30820, 30821, 
+    30822, 30823, 30824, 30825, 30826, 30827, 30828, 30829, 30830, 30831, 
+    30832, 30833, 30834, 30835, 30836, 30837, 30838, 30839, 30840, 30841, 
+    30842, 30843, 30844, 30845, 30846, 30847, 30848, 30849, 30850, 30851, 
+    30852, 30853, 30854, 30855, 30856, 30857, 30858, 30859, 30860, 30861, 
+    30862, 30863, 30864, 30865, 30866, 30867, 30868, 30869, 30870, 30871, 
+    30872, 30873, 30874, 30875, 30876, 30877, 30878, 30879, 30880, 30881, 
+    30882, 30883, 30884, 30885, 30886, 30887, 30888, 30889, 30890, 30891, 
+    30892, 30893, 30894, 30895, 30896, 30897, 30898, 30899, 30900, 30901, 
+    30902, 30903, 30904, 30905, 30906, 30907, 30908, 30909, 30910, 30911, 
+    30912, 30913, 30914, 30915, 30916, 30917, 30918, 30919, 30920, 30921, 
+    30922, 30923, 30924, 30925, 30926, 30927, 30928, 30929, 30930, 30931, 
+    30932, 30933, 30934, 30935, 30936, 30937, 30938, 30939, 30940, 30941, 
+    30942, 30943, 30944, 30945, 30946, 30947, 30948, 30949, 30950, 30951, 
+    30952, 30953, 30954, 30955, 30956, 30957, 30958, 30959, 30960, 30961, 
+    30962, 30963, 30964, 30965, 30966, 30967, 30968, 30969, 30970, 30971, 
+    30972, 30973, 30974, 30975, 30976, 30977, 30978, 30979, 30980, 30981, 
+    30982, 30983, 30984, 30985, 30986, 30987, 30988, 30989, 30990, 30991, 
+    30992, 30993, 30994, 30995, 30996, 30997, 30998, 30999, 31000, 31001, 
+    31002, 31003, 31004, 31005, 31006, 31007, 31008, 31009, 31010, 31011, 
+    31012, 31013, 31014, 31015, 31016, 31017, 31018, 31019, 31020, 31021, 
+    31022, 31023, 31024, 31025, 31026, 31027, 31028, 31029, 31030, 31031, 
+    31032, 31033, 31034, 31035, 31036, 31037, 31038, 31039, 31040, 31041, 
+    31042, 31043, 31044, 31045, 31046, 31047, 31048, 31049, 31050, 31051, 
+    31052, 31053, 31054, 31055, 31056, 31057, 31058, 31059, 31060, 31061, 
+    31062, 31063, 31064, 31065, 31066, 31067, 31068, 31069, 31070, 31071, 
+    31072, 31073, 31074, 31075, 31076, 31077, 31078, 31079, 31080, 31081, 
+    31082, 31083, 31084, 31085, 31086, 31087, 31088, 31089, 31090, 31091, 
+    31092, 31093, 31094, 31095, 31096, 31097, 31098, 31099, 31100, 31101, 
+    31102, 31103, 31104, 31105, 31106, 31107, 31108, 31109, 31110, 31111, 
+    31112, 31113, 31114, 31115, 31116, 31117, 31118, 31119, 31120, 31121, 
+    31122, 31123, 31124, 31125, 31126, 31127, 31128, 31129, 31130, 31131, 
+    31132, 31133, 31134, 31135, 31136, 31137, 31138, 31139, 31140, 31141, 
+    31142, 31143, 31144, 31145, 31146, 31147, 31148, 31149, 31150, 31151, 
+    31152, 31153, 31154, 31155, 31156, 31157, 31158, 31159, 31160, 31161, 
+    31162, 31163, 31164, 31165, 31166, 31167, 31168, 31169, 31170, 31171, 
+    31172, 31173, 31174, 31175, 31176, 31177, 31178, 31179, 31180, 31181, 
+    31182, 31183, 31184, 31185, 31186, 31187, 31188, 31189, 31190, 31191, 
+    31192, 31193, 31194, 31195, 31196, 31197, 31198, 31199, 31200, 31201, 
+    31202, 31203, 31204, 31205, 31206, 31207, 31208, 31209, 31210, 31211, 
+    31212, 31213, 31214, 31215, 31216, 31217, 31218, 31219, 31220, 31221, 
+    31222, 31223, 31224, 31225, 31226, 31227, 31228, 31229, 31230, 31231, 
+    31232, 31233, 31234, 31235, 31236, 31237, 31238, 31239, 31240, 31241, 
+    31242, 31243, 31244, 31245, 31246, 31247, 31248, 31249, 31250, 31251, 
+    31252, 31253, 31254, 31255, 31256, 31257, 31258, 31259, 31260, 31261, 
+    31262, 31263, 31264, 31265, 31266, 31267, 31268, 31269, 31270, 31271, 
+    31272, 31273, 31274, 31275, 31276, 31277, 31278, 31279, 31280, 31281, 
+    31282, 31283, 31284, 31285, 31286, 31287, 31288, 31289, 31290, 31291, 
+    31292, 31293, 31294, 31295, 31296, 31297, 31298, 31299, 31300, 31301, 
+    31302, 31303, 31304, 31305, 31306, 31307, 31308, 31309, 31310, 31311, 
+    31312, 31313, 31314, 31315, 31316, 31317, 31318, 31319, 31320, 31321, 
+    31322, 31323, 31324, 31325, 31326, 31327, 31328, 31329, 31330, 31331, 
+    31332, 31333, 31334, 31335, 31336, 31337, 31338, 31339, 31340, 31341, 
+    31342, 31343, 31344, 31345, 31346, 31347, 31348, 31349, 31350, 31351, 
+    31352, 31353, 31354, 31355, 31356, 31357, 31358, 31359, 31360, 31361, 
+    31362, 31363, 31364, 31365, 31366, 31367, 31368, 31369, 31370, 31371, 
+    31372, 31373, 31374, 31375, 31376, 31377, 31378, 31379, 31380, 31381, 
+    31382, 31383, 31384, 31385, 31386, 31387, 31388, 31389, 31390, 31391, 
+    31392, 31393, 31394, 31395, 31396, 31397, 31398, 31399, 31400, 31401, 
+    31402, 31403, 31404, 31405, 31406, 31407, 31408, 31409, 31410, 31411, 
+    31412, 31413, 31414, 31415, 31416, 31417, 31418, 31419, 31420, 31421, 
+    31422, 31423, 31424, 31425, 31426, 31427, 31428, 31429, 31430, 31431, 
+    31432, 31433, 31434, 31435, 31436, 31437, 31438, 31439, 31440, 31441, 
+    31442, 31443, 31444, 31445, 31446, 31447, 31448, 31449, 31450, 31451, 
+    31452, 31453, 31454, 31455, 31456, 31457, 31458, 31459, 31460, 31461, 
+    31462, 31463, 31464, 31465, 31466, 31467, 31468, 31469, 31470, 31471, 
+    31472, 31473, 31474, 31475, 31476, 31477, 31478, 31479, 31480, 31481, 
+    31482, 31483, 31484, 31485, 31486, 31487, 31488, 31489, 31490, 31491, 
+    31492, 31493, 31494, 31495, 31496, 31497, 31498, 31499, 31500, 31501, 
+    31502, 31503, 31504, 31505, 31506, 31507, 31508, 31509, 31510, 31511, 
+    31512, 31513, 31514, 31515, 31516, 31517, 31518, 31519, 31520, 31521, 
+    31522, 31523, 31524, 31525, 31526, 31527, 31528, 31529, 31530, 31531, 
+    31532, 31533, 31534, 31535, 31536, 31537, 31538, 31539, 31540, 31541, 
+    31542, 31543, 31544, 31545, 31546, 31547, 31548, 31549, 31550, 31551, 
+    31552, 31553, 31554, 31555, 31556, 31557, 31558, 31559, 31560, 31561, 
+    31562, 31563, 31564, 31565, 31566, 31567, 31568, 31569, 31570, 31571, 
+    31572, 31573, 31574, 31575, 31576, 31577, 31578, 31579, 31580, 31581, 
+    31582, 31583, 31584, 31585, 31586, 31587, 31588, 31589, 31590, 31591, 
+    31592, 31593, 31594, 31595, 31596, 31597, 31598, 31599, 31600, 31601, 
+    31602, 31603, 31604, 31605, 31606, 31607, 31608, 31609, 31610, 31611, 
+    31612, 31613, 31614, 31615, 31616, 31617, 31618, 31619, 31620, 31621, 
+    31622, 31623, 31624, 31625, 31626, 31627, 31628, 31629, 31630, 31631, 
+    31632, 31633, 31634, 31635, 31636, 31637, 31638, 31639, 31640, 31641, 
+    31642, 31643, 31644, 31645, 31646, 31647, 31648, 31649, 31650, 31651, 
+    31652, 31653, 31654, 31655, 31656, 31657, 31658, 31659, 31660, 31661, 
+    31662, 31663, 31664, 31665, 31666, 31667, 31668, 31669, 31670, 31671, 
+    31672, 31673, 31674, 31675, 31676, 31677, 31678, 31679, 31680, 31681, 
+    31682, 31683, 31684, 31685, 31686, 31687, 31688, 31689, 31690, 31691, 
+    31692, 31693, 31694, 31695, 31696, 31697, 31698, 31699, 31700, 31701, 
+    31702, 31703, 31704, 31705, 31706, 31707, 31708, 31709, 31710, 31711, 
+    31712, 31713, 31714, 31715, 31716, 31717, 31718, 31719, 31720, 31721, 
+    31722, 31723, 31724, 31725, 31726, 31727, 31728, 31729, 31730, 31731, 
+    31732, 31733, 31734, 31735, 31736, 31737, 31738, 31739, 31740, 31741, 
+    31742, 31743, 31744, 31745, 31746, 31747, 31748, 31749, 31750, 31751, 
+    31752, 31753, 31754, 31755, 31756, 31757, 31758, 31759, 31760, 31761, 
+    31762, 31763, 31764, 31765, 31766, 31767, 31768, 31769, 31770, 31771, 
+    31772, 31773, 31774, 31775, 31776, 31777, 31778, 31779, 31780, 31781, 
+    31782, 31783, 31784, 31785, 31786, 31787, 31788, 31789, 31790, 31791, 
+    31792, 31793, 31794, 31795, 31796, 31797, 31798, 31799, 31800, 31801, 
+    31802, 31803, 31804, 31805, 31806, 31807, 31808, 31809, 31810, 31811, 
+    31812, 31813, 31814, 31815, 31816, 31817, 31818, 31819, 31820, 31821, 
+    31822, 31823, 31824, 31825, 31826, 31827, 31828, 31829, 31830, 31831, 
+    31832, 31833, 31834, 31835, 31836, 31837, 31838, 31839, 31840, 31841, 
+    31842, 31843, 31844, 31845, 31846, 31847, 31848, 31849, 31850, 31851, 
+    31852, 31853, 31854, 31855, 31856, 31857, 31858, 31859, 31860, 31861, 
+    31862, 31863, 31864, 31865, 31866, 31867, 31868, 31869, 31870, 31871, 
+    31872, 31873, 31874, 31875, 31876, 31877, 31878, 31879, 31880, 31881, 
+    31882, 31883, 31884, 31885, 31886, 31887, 31888, 31889, 31890, 31891, 
+    31892, 31893, 31894, 31895, 31896, 31897, 31898, 31899, 31900, 31901, 
+    31902, 31903, 31904, 31905, 31906, 31907, 31908, 31909, 31910, 31911, 
+    31912, 31913, 31914, 31915, 31916, 31917, 31918, 31919, 31920, 31921, 
+    31922, 31923, 31924, 31925, 31926, 31927, 31928, 31929, 31930, 31931, 
+    31932, 31933, 31934, 31935, 31936, 31937, 31938, 31939, 31940, 31941, 
+    31942, 31943, 31944, 31945, 31946, 31947, 31948, 31949, 31950, 31951, 
+    31952, 31953, 31954, 31955, 31956, 31957, 31958, 31959, 31960, 31961, 
+    31962, 31963, 31964, 31965, 31966, 31967, 31968, 31969, 31970, 31971, 
+    31972, 31973, 31974, 31975, 31976, 31977, 31978, 31979, 31980, 31981, 
+    31982, 31983, 31984, 31985, 31986, 31987, 31988, 31989, 31990, 31991, 
+    31992, 31993, 31994, 31995, 31996, 31997, 31998, 31999, 32000, 32001, 
+    32002, 32003, 32004, 32005, 32006, 32007, 32008, 32009, 32010, 32011, 
+    32012, 32013, 32014, 32015, 32016, 32017, 32018, 32019, 32020, 32021, 
+    32022, 32023, 32024, 32025, 32026, 32027, 32028, 32029, 32030, 32031, 
+    32032, 32033, 32034, 32035, 32036, 32037, 32038, 32039, 32040, 32041, 
+    32042, 32043, 32044, 32045, 32046, 32047, 32048, 32049, 32050, 32051, 
+    32052, 32053, 32054, 32055, 32056, 32057, 32058, 32059, 32060, 32061, 
+    32062, 32063, 32064, 32065, 32066, 32067, 32068, 32069, 32070, 32071, 
+    32072, 32073, 32074, 32075, 32076, 32077, 32078, 32079, 32080, 32081, 
+    32082, 32083, 32084, 32085, 32086, 32087, 32088, 32089, 32090, 32091, 
+    32092, 32093, 32094, 32095, 32096, 32097, 32098, 32099, 32100, 32101, 
+    32102, 32103, 32104, 32105, 32106, 32107, 32108, 32109, 32110, 32111, 
+    32112, 32113, 32114, 32115, 32116, 32117, 32118, 32119, 32120, 32121, 
+    32122, 32123, 32124, 32125, 32126, 32127, 32128, 32129, 32130, 32131, 
+    32132, 32133, 32134, 32135, 32136, 32137, 32138, 32139, 32140, 32141, 
+    32142, 32143, 32144, 32145, 32146, 32147, 32148, 32149, 32150, 32151, 
+    32152, 32153, 32154, 32155, 32156, 32157, 32158, 32159, 32160, 32161, 
+    32162, 32163, 32164, 32165, 32166, 32167, 32168, 32169, 32170, 32171, 
+    32172, 32173, 32174, 32175, 32176, 32177, 32178, 32179, 32180, 32181, 
+    32182, 32183, 32184, 32185, 32186, 32187, 32188, 32189, 32190, 32191, 
+    32192, 32193, 32194, 32195, 32196, 32197, 32198, 32199, 32200, 32201, 
+    32202, 32203, 32204, 32205, 32206, 32207, 32208, 32209, 32210, 32211, 
+    32212, 32213, 32214, 32215, 32216, 32217, 32218, 32219, 32220, 32221, 
+    32222, 32223, 32224, 32225, 32226, 32227, 32228, 32229, 32230, 32231, 
+    32232, 32233, 32234, 32235, 32236, 32237, 32238, 32239, 32240, 32241, 
+    32242, 32243, 32244, 32245, 32246, 32247, 32248, 32249, 32250, 32251, 
+    32252, 32253, 32254, 32255, 32256, 32257, 32258, 32259, 32260, 32261, 
+    32262, 32263, 32264, 32265, 32266, 32267, 32268, 32269, 32270, 32271, 
+    32272, 32273, 32274, 32275, 32276, 32277, 32278, 32279, 32280, 32281, 
+    32282, 32283, 32284, 32285, 32286, 32287, 32288, 32289, 32290, 32291, 
+    32292, 32293, 32294, 32295, 32296, 32297, 32298, 32299, 32300, 32301, 
+    32302, 32303, 32304, 32305, 32306, 32307, 32308, 32309, 32310, 32311, 
+    32312, 32313, 32314, 32315, 32316, 32317, 32318, 32319, 32320, 32321, 
+    32322, 32323, 32324, 32325, 32326, 32327, 32328, 32329, 32330, 32331, 
+    32332, 32333, 32334, 32335, 32336, 32337, 32338, 32339, 32340, 32341, 
+    32342, 32343, 32344, 32345, 32346, 32347, 32348, 32349, 32350, 32351, 
+    32352, 32353, 32354, 32355, 32356, 32357, 32358, 32359, 32360, 32361, 
+    32362, 32363, 32364, 32365, 32366, 32367, 32368, 32369, 32370, 32371, 
+    32372, 32373, 32374, 32375, 32376, 32377, 32378, 32379, 32380, 32381, 
+    32382, 32383, 32384, 32385, 32386, 32387, 32388, 32389, 32390, 32391, 
+    32392, 32393, 32394, 32395, 32396, 32397, 32398, 32399, 32400, 32401, 
+    32402, 32403, 32404, 32405, 32406, 32407, 32408, 32409, 32410, 32411, 
+    32412, 32413, 32414, 32415, 32416, 32417, 32418, 32419, 32420, 32421, 
+    32422, 32423, 32424, 32425, 32426, 32427, 32428, 32429, 32430, 32431, 
+    32432, 32433, 32434, 32435, 32436, 32437, 32438, 32439, 32440, 32441, 
+    32442, 32443, 32444, 32445, 32446, 32447, 32448, 32449, 32450, 32451, 
+    32452, 32453, 32454, 32455, 32456, 32457, 32458, 32459, 32460, 32461, 
+    32462, 32463, 32464, 32465, 32466, 32467, 32468, 32469, 32470, 32471, 
+    32472, 32473, 32474, 32475, 32476, 32477, 32478, 32479, 32480, 32481, 
+    32482, 32483, 32484, 32485, 32486, 32487, 32488, 32489, 32490, 32491, 
+    32492, 32493, 32494, 32495, 32496, 32497, 32498, 32499, 32500, 32501, 
+    32502, 32503, 32504, 32505, 32506, 32507, 32508, 32509, 32510, 32511, 
+    32512, 32513, 32514, 32515, 32516, 32517, 32518, 32519, 32520, 32521, 
+    32522, 32523, 32524, 32525, 32526, 32527, 32528, 32529, 32530, 32531, 
+    32532, 32533, 32534, 32535, 32536, 32537, 32538, 32539, 32540, 32541, 
+    32542, 32543, 32544, 32545, 32546, 32547, 32548, 32549, 32550, 32551, 
+    32552, 32553, 32554, 32555, 32556, 32557, 32558, 32559, 32560, 32561, 
+    32562, 32563, 32564, 32565, 32566, 32567, 32568, 32569, 32570, 32571, 
+    32572, 32573, 32574, 32575, 32576, 32577, 32578, 32579, 32580, 32581, 
+    32582, 32583, 32584, 32585, 32586, 32587, 32588, 32589, 32590, 32591, 
+    32592, 32593, 32594, 32595, 32596, 32597, 32598, 32599, 32600, 32601, 
+    32602, 32603, 32604, 32605, 32606, 32607, 32608, 32609, 32610, 32611, 
+    32612, 32613, 32614, 32615, 32616, 32617, 32618, 32619, 32620, 32621, 
+    32622, 32623, 32624, 32625, 32626, 32627, 32628, 32629, 32630, 32631, 
+    32632, 32633, 32634, 32635, 32636, 32637, 32638, 32639, 32640, 32641, 
+    32642, 32643, 32644, 32645, 32646, 32647, 32648, 32649, 32650, 32651, 
+    32652, 32653, 32654, 32655, 32656, 32657, 32658, 32659, 32660, 32661, 
+    32662, 32663, 32664, 32665, 32666, 32667, 32668, 32669, 32670, 32671, 
+    32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681, 
+    32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 
+    32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701, 
+    32702, 32703, 32704, 32705, 32706, 32707, 32708, 32709, 32710, 32711, 
+    32712, 32713, 32714, 32715, 32716, 32717, 32718, 32719, 32720, 32721, 
+    32722, 32723, 32724, 32725, 32726, 32727, 32728, 32729, 32730, 32731, 
+    32732, 32733, 32734, 32735, 32736, 32737, 32738, 32739, 32740, 32741, 
+    32742, 32743, 32744, 32745, 32746, 32747, 32748, 32749, 32750, 32751, 
+    32752, 32753, 32754, 32755, 32756, 32757, 32758, 32759, 32760, 32761, 
+    32762, 32763, 32764, 32765, 32766, 32767, 32768, 32769, 32770, 32771, 
+    32772, 32773, 32774, 32775, 32776, 32777, 32778, 32779, 32780, 32781, 
+    32782, 32783, 32784, 32785, 32786, 32787, 32788, 32789, 32790, 32791, 
+    32792, 32793, 32794, 32795, 32796, 32797, 32798, 32799, 32800, 32801, 
+    32802, 32803, 32804, 32805, 32806, 32807, 32808, 32809, 32810, 32811, 
+    32812, 32813, 32814, 32815, 32816, 32817, 32818, 32819, 32820, 32821, 
+    32822, 32823, 32824, 32825, 32826, 32827, 32828, 32829, 32830, 32831, 
+    32832, 32833, 32834, 32835, 32836, 32837, 32838, 32839, 32840, 32841, 
+    32842, 32843, 32844, 32845, 32846, 32847, 32848, 32849, 32850, 32851, 
+    32852, 32853, 32854, 32855, 32856, 32857, 32858, 32859, 32860, 32861, 
+    32862, 32863, 32864, 32865, 32866, 32867, 32868, 32869, 32870, 32871, 
+    32872, 32873, 32874, 32875, 32876, 32877, 32878, 32879, 32880, 32881, 
+    32882, 32883, 32884, 32885, 32886, 32887, 32888, 32889, 32890, 32891, 
+    32892, 32893, 32894, 32895, 32896, 32897, 32898, 32899, 32900, 32901, 
+    32902, 32903, 32904, 32905, 32906, 32907, 32908, 32909, 32910, 32911, 
+    32912, 32913, 32914, 32915, 32916, 32917, 32918, 32919, 32920, 32921, 
+    32922, 32923, 32924, 32925, 32926, 32927, 32928, 32929, 32930, 32931, 
+    32932, 32933, 32934, 32935, 32936, 32937, 32938, 32939, 32940, 32941, 
+    32942, 32943, 32944, 32945, 32946, 32947, 32948, 32949, 32950, 32951, 
+    32952, 32953, 32954, 32955, 32956, 32957, 32958, 32959, 32960, 32961, 
+    32962, 32963, 32964, 32965, 32966, 32967, 32968, 32969, 32970, 32971, 
+    32972, 32973, 32974, 32975, 32976, 32977, 32978, 32979, 32980, 32981, 
+    32982, 32983, 32984, 32985, 32986, 32987, 32988, 32989, 32990, 32991, 
+    32992, 32993, 32994, 32995, 32996, 32997, 32998, 32999, 33000, 33001, 
+    33002, 33003, 33004, 33005, 33006, 33007, 33008, 33009, 33010, 33011, 
+    33012, 33013, 33014, 33015, 33016, 33017, 33018, 33019, 33020, 33021, 
+    33022, 33023, 33024, 33025, 33026, 33027, 33028, 33029, 33030, 33031, 
+    33032, 33033, 33034, 33035, 33036, 33037, 33038, 33039, 33040, 33041, 
+    33042, 33043, 33044, 33045, 33046, 33047, 33048, 33049, 33050, 33051, 
+    33052, 33053, 33054, 33055, 33056, 33057, 33058, 33059, 33060, 33061, 
+    33062, 33063, 33064, 33065, 33066, 33067, 33068, 33069, 33070, 33071, 
+    33072, 33073, 33074, 33075, 33076, 33077, 33078, 33079, 33080, 33081, 
+    33082, 33083, 33084, 33085, 33086, 33087, 33088, 33089, 33090, 33091, 
+    33092, 33093, 33094, 33095, 33096, 33097, 33098, 33099, 33100, 33101, 
+    33102, 33103, 33104, 33105, 33106, 33107, 33108, 33109, 33110, 33111, 
+    33112, 33113, 33114, 33115, 33116, 33117, 33118, 33119, 33120, 33121, 
+    33122, 33123, 33124, 33125, 33126, 33127, 33128, 33129, 33130, 33131, 
+    33132, 33133, 33134, 33135, 33136, 33137, 33138, 33139, 33140, 33141, 
+    33142, 33143, 33144, 33145, 33146, 33147, 33148, 33149, 33150, 33151, 
+    33152, 33153, 33154, 33155, 33156, 33157, 33158, 33159, 33160, 33161, 
+    33162, 33163, 33164, 33165, 33166, 33167, 33168, 33169, 33170, 33171, 
+    33172, 33173, 33174, 33175, 33176, 33177, 33178, 33179, 33180, 33181, 
+    33182, 33183, 33184, 33185, 33186, 33187, 33188, 33189, 33190, 33191, 
+    33192, 33193, 33194, 33195, 33196, 33197, 33198, 33199, 33200, 33201, 
+    33202, 33203, 33204, 33205, 33206, 33207, 33208, 33209, 33210, 33211, 
+    33212, 33213, 33214, 33215, 33216, 33217, 33218, 33219, 33220, 33221, 
+    33222, 33223, 33224, 33225, 33226, 33227, 33228, 33229, 33230, 33231, 
+    33232, 33233, 33234, 33235, 33236, 33237, 33238, 33239, 33240, 33241, 
+    33242, 33243, 33244, 33245, 33246, 33247, 33248, 33249, 33250, 33251, 
+    33252, 33253, 33254, 33255, 33256, 33257, 33258, 33259, 33260, 33261, 
+    33262, 33263, 33264, 33265, 33266, 33267, 33268, 33269, 33270, 33271, 
+    33272, 33273, 33274, 33275, 33276, 33277, 33278, 33279, 33280, 33281, 
+    33282, 33283, 33284, 33285, 33286, 33287, 33288, 33289, 33290, 33291, 
+    33292, 33293, 33294, 33295, 33296, 33297, 33298, 33299, 33300, 33301, 
+    33302, 33303, 33304, 33305, 33306, 33307, 33308, 33309, 33310, 33311, 
+    33312, 33313, 33314, 33315, 33316, 33317, 33318, 33319, 33320, 33321, 
+    33322, 33323, 33324, 33325, 33326, 33327, 33328, 33329, 33330, 33331, 
+    33332, 33333, 33334, 33335, 33336, 33337, 33338, 33339, 33340, 33341, 
+    33342, 33343, 33344, 33345, 33346, 33347, 33348, 33349, 33350, 33351, 
+    33352, 33353, 33354, 33355, 33356, 33357, 33358, 33359, 33360, 33361, 
+    33362, 33363, 33364, 33365, 33366, 33367, 33368, 33369, 33370, 33371, 
+    33372, 33373, 33374, 33375, 33376, 33377, 33378, 33379, 33380, 33381, 
+    33382, 33383, 33384, 33385, 33386, 33387, 33388, 33389, 33390, 33391, 
+    33392, 33393, 33394, 33395, 33396, 33397, 33398, 33399, 33400, 33401, 
+    33402, 33403, 33404, 33405, 33406, 33407, 33408, 33409, 33410, 33411, 
+    33412, 33413, 33414, 33415, 33416, 33417, 33418, 33419, 33420, 33421, 
+    33422, 33423, 33424, 33425, 33426, 33427, 33428, 33429, 33430, 33431, 
+    33432, 33433, 33434, 33435, 33436, 33437, 33438, 33439, 33440, 33441, 
+    33442, 33443, 33444, 33445, 33446, 33447, 33448, 33449, 33450, 33451, 
+    33452, 33453, 33454, 33455, 33456, 33457, 33458, 33459, 33460, 33461, 
+    33462, 33463, 33464, 33465, 33466, 33467, 33468, 33469, 33470, 33471, 
+    33472, 33473, 33474, 33475, 33476, 33477, 33478, 33479, 33480, 33481, 
+    33482, 33483, 33484, 33485, 33486, 33487, 33488, 33489, 33490, 33491, 
+    33492, 33493, 33494, 33495, 33496, 33497, 33498, 33499, 33500, 33501, 
+    33502, 33503, 33504, 33505, 33506, 33507, 33508, 33509, 33510, 33511, 
+    33512, 33513, 33514, 33515, 33516, 33517, 33518, 33519, 33520, 33521, 
+    33522, 33523, 33524, 33525, 33526, 33527, 33528, 33529, 33530, 33531, 
+    33532, 33533, 33534, 33535, 33536, 33537, 33538, 33539, 33540, 33541, 
+    33542, 33543, 33544, 33545, 33546, 33547, 33548, 33549, 33550, 33551, 
+    33552, 33553, 33554, 33555, 33556, 33557, 33558, 33559, 33560, 33561, 
+    33562, 33563, 33564, 33565, 33566, 33567, 33568, 33569, 33570, 33571, 
+    33572, 33573, 33574, 33575, 33576, 33577, 33578, 33579, 33580, 33581, 
+    33582, 33583, 33584, 33585, 33586, 33587, 33588, 33589, 33590, 33591, 
+    33592, 33593, 33594, 33595, 33596, 33597, 33598, 33599, 33600, 33601, 
+    33602, 33603, 33604, 33605, 33606, 33607, 33608, 33609, 33610, 33611, 
+    33612, 33613, 33614, 33615, 33616, 33617, 33618, 33619, 33620, 33621, 
+    33622, 33623, 33624, 33625, 33626, 33627, 33628, 33629, 33630, 33631, 
+    33632, 33633, 33634, 33635, 33636, 33637, 33638, 33639, 33640, 33641, 
+    33642, 33643, 33644, 33645, 33646, 33647, 33648, 33649, 33650, 33651, 
+    33652, 33653, 33654, 33655, 33656, 33657, 33658, 33659, 33660, 33661, 
+    33662, 33663, 33664, 33665, 33666, 33667, 33668, 33669, 33670, 33671, 
+    33672, 33673, 33674, 33675, 33676, 33677, 33678, 33679, 33680, 33681, 
+    33682, 33683, 33684, 33685, 33686, 33687, 33688, 33689, 33690, 33691, 
+    33692, 33693, 33694, 33695, 33696, 33697, 33698, 33699, 33700, 33701, 
+    33702, 33703, 33704, 33705, 33706, 33707, 33708, 33709, 33710, 33711, 
+    33712, 33713, 33714, 33715, 33716, 33717, 33718, 33719, 33720, 33721, 
+    33722, 33723, 33724, 33725, 33726, 33727, 33728, 33729, 33730, 33731, 
+    33732, 33733, 33734, 33735, 33736, 33737, 33738, 33739, 33740, 33741, 
+    33742, 33743, 33744, 33745, 33746, 33747, 33748, 33749, 33750, 33751, 
+    33752, 33753, 33754, 33755, 33756, 33757, 33758, 33759, 33760, 33761, 
+    33762, 33763, 33764, 33765, 33766, 33767, 33768, 33769, 33770, 33771, 
+    33772, 33773, 33774, 33775, 33776, 33777, 33778, 33779, 33780, 33781, 
+    33782, 33783, 33784, 33785, 33786, 33787, 33788, 33789, 33790, 33791, 
+    33792, 33793, 33794, 33795, 33796, 33797, 33798, 33799, 33800, 33801, 
+    33802, 33803, 33804, 33805, 33806, 33807, 33808, 33809, 33810, 33811, 
+    33812, 33813, 33814, 33815, 33816, 33817, 33818, 33819, 33820, 33821, 
+    33822, 33823, 33824, 33825, 33826, 33827, 33828, 33829, 33830, 33831, 
+    33832, 33833, 33834, 33835, 33836, 33837, 33838, 33839, 33840, 33841, 
+    33842, 33843, 33844, 33845, 33846, 33847, 33848, 33849, 33850, 33851, 
+    33852, 33853, 33854, 33855, 33856, 33857, 33858, 33859, 33860, 33861, 
+    33862, 33863, 33864, 33865, 33866, 33867, 33868, 33869, 33870, 33871, 
+    33872, 33873, 33874, 33875, 33876, 33877, 33878, 33879, 33880, 33881, 
+    33882, 33883, 33884, 33885, 33886, 33887, 33888, 33889, 33890, 33891, 
+    33892, 33893, 33894, 33895, 33896, 33897, 33898, 33899, 33900, 33901, 
+    33902, 33903, 33904, 33905, 33906, 33907, 33908, 33909, 33910, 33911, 
+    33912, 33913, 33914, 33915, 33916, 33917, 33918, 33919, 33920, 33921, 
+    33922, 33923, 33924, 33925, 33926, 33927, 33928, 33929, 33930, 33931, 
+    33932, 33933, 33934, 33935, 33936, 33937, 33938, 33939, 33940, 33941, 
+    33942, 33943, 33944, 33945, 33946, 33947, 33948, 33949, 33950, 33951, 
+    33952, 33953, 33954, 33955, 33956, 33957, 33958, 33959, 33960, 33961, 
+    33962, 33963, 33964, 33965, 33966, 33967, 33968, 33969, 33970, 33971, 
+    33972, 33973, 33974, 33975, 33976, 33977, 33978, 33979, 33980, 33981, 
+    33982, 33983, 33984, 33985, 33986, 33987, 33988, 33989, 33990, 33991, 
+    33992, 33993, 33994, 33995, 33996, 33997, 33998, 33999, 34000, 34001, 
+    34002, 34003, 34004, 34005, 34006, 34007, 34008, 34009, 34010, 34011, 
+    34012, 34013, 34014, 34015, 34016, 34017, 34018, 34019, 34020, 34021, 
+    34022, 34023, 34024, 34025, 34026, 34027, 34028, 34029, 34030, 34031, 
+    34032, 34033, 34034, 34035, 34036, 34037, 34038, 34039, 34040, 34041, 
+    34042, 34043, 34044, 34045, 34046, 34047, 34048, 34049, 34050, 34051, 
+    34052, 34053, 34054, 34055, 34056, 34057, 34058, 34059, 34060, 34061, 
+    34062, 34063, 34064, 34065, 34066, 34067, 34068, 34069, 34070, 34071, 
+    34072, 34073, 34074, 34075, 34076, 34077, 34078, 34079, 34080, 34081, 
+    34082, 34083, 34084, 34085, 34086, 34087, 34088, 34089, 34090, 34091, 
+    34092, 34093, 34094, 34095, 34096, 34097, 34098, 34099, 34100, 34101, 
+    34102, 34103, 34104, 34105, 34106, 34107, 34108, 34109, 34110, 34111, 
+    34112, 34113, 34114, 34115, 34116, 34117, 34118, 34119, 34120, 34121, 
+    34122, 34123, 34124, 34125, 34126, 34127, 34128, 34129, 34130, 34131, 
+    34132, 34133, 34134, 34135, 34136, 34137, 34138, 34139, 34140, 34141, 
+    34142, 34143, 34144, 34145, 34146, 34147, 34148, 34149, 34150, 34151, 
+    34152, 34153, 34154, 34155, 34156, 34157, 34158, 34159, 34160, 34161, 
+    34162, 34163, 34164, 34165, 34166, 34167, 34168, 34169, 34170, 34171, 
+    34172, 34173, 34174, 34175, 34176, 34177, 34178, 34179, 34180, 34181, 
+    34182, 34183, 34184, 34185, 34186, 34187, 34188, 34189, 34190, 34191, 
+    34192, 34193, 34194, 34195, 34196, 34197, 34198, 34199, 34200, 34201, 
+    34202, 34203, 34204, 34205, 34206, 34207, 34208, 34209, 34210, 34211, 
+    34212, 34213, 34214, 34215, 34216, 34217, 34218, 34219, 34220, 34221, 
+    34222, 34223, 34224, 34225, 34226, 34227, 34228, 34229, 34230, 34231, 
+    34232, 34233, 34234, 34235, 34236, 34237, 34238, 34239, 34240, 34241, 
+    34242, 34243, 34244, 34245, 34246, 34247, 34248, 34249, 34250, 34251, 
+    34252, 34253, 34254, 34255, 34256, 34257, 34258, 34259, 34260, 34261, 
+    34262, 34263, 34264, 34265, 34266, 34267, 34268, 34269, 34270, 34271, 
+    34272, 34273, 34274, 34275, 34276, 34277, 34278, 34279, 34280, 34281, 
+    34282, 34283, 34284, 34285, 34286, 34287, 34288, 34289, 34290, 34291, 
+    34292, 34293, 34294, 34295, 34296, 34297, 34298, 34299, 34300, 34301, 
+    34302, 34303, 34304, 34305, 34306, 34307, 34308, 34309, 34310, 34311, 
+    34312, 34313, 34314, 34315, 34316, 34317, 34318, 34319, 34320, 34321, 
+    34322, 34323, 34324, 34325, 34326, 34327, 34328, 34329, 34330, 34331, 
+    34332, 34333, 34334, 34335, 34336, 34337, 34338, 34339, 34340, 34341, 
+    34342, 34343, 34344, 34345, 34346, 34347, 34348, 34349, 34350, 34351, 
+    34352, 34353, 34354, 34355, 34356, 34357, 34358, 34359, 34360, 34361, 
+    34362, 34363, 34364, 34365, 34366, 34367, 34368, 34369, 34370, 34371, 
+    34372, 34373, 34374, 34375, 34376, 34377, 34378, 34379, 34380, 34381, 
+    34382, 34383, 34384, 34385, 34386, 34387, 34388, 34389, 34390, 34391, 
+    34392, 34393, 34394, 34395, 34396, 34397, 34398, 34399, 34400, 34401, 
+    34402, 34403, 34404, 34405, 34406, 34407, 34408, 34409, 34410, 34411, 
+    34412, 34413, 34414, 34415, 34416, 34417, 34418, 34419, 34420, 34421, 
+    34422, 34423, 34424, 34425, 34426, 34427, 34428, 34429, 34430, 34431, 
+    34432, 34433, 34434, 34435, 34436, 34437, 34438, 34439, 34440, 34441, 
+    34442, 34443, 34444, 34445, 34446, 34447, 34448, 34449, 34450, 34451, 
+    34452, 34453, 34454, 34455, 34456, 34457, 34458, 34459, 34460, 34461, 
+    34462, 34463, 34464, 34465, 34466, 34467, 34468, 34469, 34470, 34471, 
+    34472, 34473, 34474, 34475, 34476, 34477, 34478, 34479, 34480, 34481, 
+    34482, 34483, 34484, 34485, 34486, 34487, 34488, 34489, 34490, 34491, 
+    34492, 34493, 34494, 34495, 34496, 34497, 34498, 34499, 34500, 34501, 
+    34502, 34503, 34504, 34505, 34506, 34507, 34508, 34509, 34510, 34511, 
+    34512, 34513, 34514, 34515, 34516, 34517, 34518, 34519, 34520, 34521, 
+    34522, 34523, 34524, 34525, 34526, 34527, 34528, 34529, 34530, 34531, 
+    34532, 34533, 34534, 34535, 34536, 34537, 34538, 34539, 34540, 34541, 
+    34542, 34543, 34544, 34545, 34546, 34547, 34548, 34549, 34550, 34551, 
+    34552, 34553, 34554, 34555, 34556, 34557, 34558, 34559, 34560, 34561, 
+    34562, 34563, 34564, 34565, 34566, 34567, 34568, 34569, 34570, 34571, 
+    34572, 34573, 34574, 34575, 34576, 34577, 34578, 34579, 34580, 34581, 
+    34582, 34583, 34584, 34585, 34586, 34587, 34588, 34589, 34590, 34591, 
+    34592, 34593, 34594, 34595, 34596, 34597, 34598, 34599, 34600, 34601, 
+    34602, 34603, 34604, 34605, 34606, 34607, 34608, 34609, 34610, 34611, 
+    34612, 34613, 34614, 34615, 34616, 34617, 34618, 34619, 34620, 34621, 
+    34622, 34623, 34624, 34625, 34626, 34627, 34628, 34629, 34630, 34631, 
+    34632, 34633, 34634, 34635, 34636, 34637, 34638, 34639, 34640, 34641, 
+    34642, 34643, 34644, 34645, 34646, 34647, 34648, 34649, 34650, 34651, 
+    34652, 34653, 34654, 34655, 34656, 34657, 34658, 34659, 34660, 34661, 
+    34662, 34663, 34664, 34665, 34666, 34667, 34668, 34669, 34670, 34671, 
+    34672, 34673, 34674, 34675, 34676, 34677, 34678, 34679, 34680, 34681, 
+    34682, 34683, 34684, 34685, 34686, 34687, 34688, 34689, 34690, 34691, 
+    34692, 34693, 34694, 34695, 34696, 34697, 34698, 34699, 34700, 34701, 
+    34702, 34703, 34704, 34705, 34706, 34707, 34708, 34709, 34710, 34711, 
+    34712, 34713, 34714, 34715, 34716, 34717, 34718, 34719, 34720, 34721, 
+    34722, 34723, 34724, 34725, 34726, 34727, 34728, 34729, 34730, 34731, 
+    34732, 34733, 34734, 34735, 34736, 34737, 34738, 34739, 34740, 34741, 
+    34742, 34743, 34744, 34745, 34746, 34747, 34748, 34749, 34750, 34751, 
+    34752, 34753, 34754, 34755, 34756, 34757, 34758, 34759, 34760, 34761, 
+    34762, 34763, 34764, 34765, 34766, 34767, 34768, 34769, 34770, 34771, 
+    34772, 34773, 34774, 34775, 34776, 34777, 34778, 34779, 34780, 34781, 
+    34782, 34783, 34784, 34785, 34786, 34787, 34788, 34789, 34790, 34791, 
+    34792, 34793, 34794, 34795, 34796, 34797, 34798, 34799, 34800, 34801, 
+    34802, 34803, 34804, 34805, 34806, 34807, 34808, 34809, 34810, 34811, 
+    34812, 34813, 34814, 34815, 34816, 34817, 34818, 34819, 34820, 34821, 
+    34822, 34823, 34824, 34825, 34826, 34827, 34828, 34829, 34830, 34831, 
+    34832, 34833, 34834, 34835, 34836, 34837, 34838, 34839, 34840, 34841, 
+    34842, 34843, 34844, 34845, 34846, 34847, 34848, 34849, 34850, 34851, 
+    34852, 34853, 34854, 34855, 34856, 34857, 34858, 34859, 34860, 34861, 
+    34862, 34863, 34864, 34865, 34866, 34867, 34868, 34869, 34870, 34871, 
+    34872, 34873, 34874, 34875, 34876, 34877, 34878, 34879, 34880, 34881, 
+    34882, 34883, 34884, 34885, 34886, 34887, 34888, 34889, 34890, 34891, 
+    34892, 34893, 34894, 34895, 34896, 34897, 34898, 34899, 34900, 34901, 
+    34902, 34903, 34904, 34905, 34906, 34907, 34908, 34909, 34910, 34911, 
+    34912, 34913, 34914, 34915, 34916, 34917, 34918, 34919, 34920, 34921, 
+    34922, 34923, 34924, 34925, 34926, 34927, 34928, 34929, 34930, 34931, 
+    34932, 34933, 34934, 34935, 34936, 34937, 34938, 34939, 34940, 34941, 
+    34942, 34943, 34944, 34945, 34946, 34947, 34948, 34949, 34950, 34951, 
+    34952, 34953, 34954, 34955, 34956, 34957, 34958, 34959, 34960, 34961, 
+    34962, 34963, 34964, 34965, 34966, 34967, 34968, 34969, 34970, 34971, 
+    34972, 34973, 34974, 34975, 34976, 34977, 34978, 34979, 34980, 34981, 
+    34982, 34983, 34984, 34985, 34986, 34987, 34988, 34989, 34990, 34991, 
+    34992, 34993, 34994, 34995, 34996, 34997, 34998, 34999, 35000, 35001, 
+    35002, 35003, 35004, 35005, 35006, 35007, 35008, 35009, 35010, 35011, 
+    35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 
+    35022, 35023, 35024, 35025, 35026, 35027, 35028, 35029, 35030, 35031, 
+    35032, 35033, 35034, 35035, 35036, 35037, 35038, 35039, 35040, 35041, 
+    35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 
+    35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, 
+    35062, 35063, 35064, 35065, 35066, 35067, 35068, 35069, 35070, 35071, 
+    35072, 35073, 35074, 35075, 35076, 35077, 35078, 35079, 35080, 35081, 
+    35082, 35083, 35084, 35085, 35086, 35087, 35088, 35089, 35090, 35091, 
+    35092, 35093, 35094, 35095, 35096, 35097, 35098, 35099, 35100, 35101, 
+    35102, 35103, 35104, 35105, 35106, 35107, 35108, 35109, 35110, 35111, 
+    35112, 35113, 35114, 35115, 35116, 35117, 35118, 35119, 35120, 35121, 
+    35122, 35123, 35124, 35125, 35126, 35127, 35128, 35129, 35130, 35131, 
+    35132, 35133, 35134, 35135, 35136, 35137, 35138, 35139, 35140, 35141, 
+    35142, 35143, 35144, 35145, 35146, 35147, 35148, 35149, 35150, 35151, 
+    35152, 35153, 35154, 35155, 35156, 35157, 35158, 35159, 35160, 35161, 
+    35162, 35163, 35164, 35165, 35166, 35167, 35168, 35169, 35170, 35171, 
+    35172, 35173, 35174, 35175, 35176, 35177, 35178, 35179, 35180, 35181, 
+    35182, 35183, 35184, 35185, 35186, 35187, 35188, 35189, 35190, 35191, 
+    35192, 35193, 35194, 35195, 35196, 35197, 35198, 35199, 35200, 35201, 
+    35202, 35203, 35204, 35205, 35206, 35207, 35208, 35209, 35210, 35211, 
+    35212, 35213, 35214, 35215, 35216, 35217, 35218, 35219, 35220, 35221, 
+    35222, 35223, 35224, 35225, 35226, 35227, 35228, 35229, 35230, 35231, 
+    35232, 35233, 35234, 35235, 35236, 35237, 35238, 35239, 35240, 35241, 
+    35242, 35243, 35244, 35245, 35246, 35247, 35248, 35249, 35250, 35251, 
+    35252, 35253, 35254, 35255, 35256, 35257, 35258, 35259, 35260, 35261, 
+    35262, 35263, 35264, 35265, 35266, 35267, 35268, 35269, 35270, 35271, 
+    35272, 35273, 35274, 35275, 35276, 35277, 35278, 35279, 35280, 35281, 
+    35282, 35283, 35284, 35285, 35286, 35287, 35288, 35289, 35290, 35291, 
+    35292, 35293, 35294, 35295, 35296, 35297, 35298, 35299, 35300, 35301, 
+    35302, 35303, 35304, 35305, 35306, 35307, 35308, 35309, 35310, 35311, 
+    35312, 35313, 35314, 35315, 35316, 35317, 35318, 35319, 35320, 35321, 
+    35322, 35323, 35324, 35325, 35326, 35327, 35328, 35329, 35330, 35331, 
+    35332, 35333, 35334, 35335, 35336, 35337, 35338, 35339, 35340, 35341, 
+    35342, 35343, 35344, 35345, 35346, 35347, 35348, 35349, 35350, 35351, 
+    35352, 35353, 35354, 35355, 35356, 35357, 35358, 35359, 35360, 35361, 
+    35362, 35363, 35364, 35365, 35366, 35367, 35368, 35369, 35370, 35371, 
+    35372, 35373, 35374, 35375, 35376, 35377, 35378, 35379, 35380, 35381, 
+    35382, 35383, 35384, 35385, 35386, 35387, 35388, 35389, 35390, 35391, 
+    35392, 35393, 35394, 35395, 35396, 35397, 35398, 35399, 35400, 35401, 
+    35402, 35403, 35404, 35405, 35406, 35407, 35408, 35409, 35410, 35411, 
+    35412, 35413, 35414, 35415, 35416, 35417, 35418, 35419, 35420, 35421, 
+    35422, 35423, 35424, 35425, 35426, 35427, 35428, 35429, 35430, 35431, 
+    35432, 35433, 35434, 35435, 35436, 35437, 35438, 35439, 35440, 35441, 
+    35442, 35443, 35444, 35445, 35446, 35447, 35448, 35449, 35450, 35451, 
+    35452, 35453, 35454, 35455, 35456, 35457, 35458, 35459, 35460, 35461, 
+    35462, 35463, 35464, 35465, 35466, 35467, 35468, 35469, 35470, 35471, 
+    35472, 35473, 35474, 35475, 35476, 35477, 35478, 35479, 35480, 35481, 
+    35482, 35483, 35484, 35485, 35486, 35487, 35488, 35489, 35490, 35491, 
+    35492, 35493, 35494, 35495, 35496, 35497, 35498, 35499, 35500, 35501, 
+    35502, 35503, 35504, 35505, 35506, 35507, 35508, 35509, 35510, 35511, 
+    35512, 35513, 35514, 35515, 35516, 35517, 35518, 35519, 35520, 35521, 
+    35522, 35523, 35524, 35525, 35526, 35527, 35528, 35529, 35530, 35531, 
+    35532, 35533, 35534, 35535, 35536, 35537, 35538, 35539, 35540, 35541, 
+    35542, 35543, 35544, 35545, 35546, 35547, 35548, 35549, 35550, 35551, 
+    35552, 35553, 35554, 35555, 35556, 35557, 35558, 35559, 35560, 35561, 
+    35562, 35563, 35564, 35565, 35566, 35567, 35568, 35569, 35570, 35571, 
+    35572, 35573, 35574, 35575, 35576, 35577, 35578, 35579, 35580, 35581, 
+    35582, 35583, 35584, 35585, 35586, 35587, 35588, 35589, 35590, 35591, 
+    35592, 35593, 35594, 35595, 35596, 35597, 35598, 35599, 35600, 35601, 
+    35602, 35603, 35604, 35605, 35606, 35607, 35608, 35609, 35610, 35611, 
+    35612, 35613, 35614, 35615, 35616, 35617, 35618, 35619, 35620, 35621, 
+    35622, 35623, 35624, 35625, 35626, 35627, 35628, 35629, 35630, 35631, 
+    35632, 35633, 35634, 35635, 35636, 35637, 35638, 35639, 35640, 35641, 
+    35642, 35643, 35644, 35645, 35646, 35647, 35648, 35649, 35650, 35651, 
+    35652, 35653, 35654, 35655, 35656, 35657, 35658, 35659, 35660, 35661, 
+    35662, 35663, 35664, 35665, 35666, 35667, 35668, 35669, 35670, 35671, 
+    35672, 35673, 35674, 35675, 35676, 35677, 35678, 35679, 35680, 35681, 
+    35682, 35683, 35684, 35685, 35686, 35687, 35688, 35689, 35690, 35691, 
+    35692, 35693, 35694, 35695, 35696, 35697, 35698, 35699, 35700, 35701, 
+    35702, 35703, 35704, 35705, 35706, 35707, 35708, 35709, 35710, 35711, 
+    35712, 35713, 35714, 35715, 35716, 35717, 35718, 35719, 35720, 35721, 
+    35722, 35723, 35724, 35725, 35726, 35727, 35728, 35729, 35730, 35731, 
+    35732, 35733, 35734, 35735, 35736, 35737, 35738, 35739, 35740, 35741, 
+    35742, 35743, 35744, 35745, 35746, 35747, 35748, 35749, 35750, 35751, 
+    35752, 35753, 35754, 35755, 35756, 35757, 35758, 35759, 35760, 35761, 
+    35762, 35763, 35764, 35765, 35766, 35767, 35768, 35769, 35770, 35771, 
+    35772, 35773, 35774, 35775, 35776, 35777, 35778, 35779, 35780, 35781, 
+    35782, 35783, 35784, 35785, 35786, 35787, 35788, 35789, 35790, 35791, 
+    35792, 35793, 35794, 35795, 35796, 35797, 35798, 35799, 35800, 35801, 
+    35802, 35803, 35804, 35805, 35806, 35807, 35808, 35809, 35810, 35811, 
+    35812, 35813, 35814, 35815, 35816, 35817, 35818, 35819, 35820, 35821, 
+    35822, 35823, 35824, 35825, 35826, 35827, 35828, 35829, 35830, 35831, 
+    35832, 35833, 35834, 35835, 35836, 35837, 35838, 35839, 35840, 35841, 
+    35842, 35843, 35844, 35845, 35846, 35847, 35848, 35849, 35850, 35851, 
+    35852, 35853, 35854, 35855, 35856, 35857, 35858, 35859, 35860, 35861, 
+    35862, 35863, 35864, 35865, 35866, 35867, 35868, 35869, 35870, 35871, 
+    35872, 35873, 35874, 35875, 35876, 35877, 35878, 35879, 35880, 35881, 
+    35882, 35883, 35884, 35885, 35886, 35887, 35888, 35889, 35890, 35891, 
+    35892, 35893, 35894, 35895, 35896, 35897, 35898, 35899, 35900, 35901, 
+    35902, 35903, 35904, 35905, 35906, 35907, 35908, 35909, 35910, 35911, 
+    35912, 35913, 35914, 35915, 35916, 35917, 35918, 35919, 35920, 35921, 
+    35922, 35923, 35924, 35925, 35926, 35927, 35928, 35929, 35930, 35931, 
+    35932, 35933, 35934, 35935, 35936, 35937, 35938, 35939, 35940, 35941, 
+    35942, 35943, 35944, 35945, 35946, 35947, 35948, 35949, 35950, 35951, 
+    35952, 35953, 35954, 35955, 35956, 35957, 35958, 35959, 35960, 35961, 
+    35962, 35963, 35964, 35965, 35966, 35967, 35968, 35969, 35970, 35971, 
+    35972, 35973, 35974, 35975, 35976, 35977, 35978, 35979, 35980, 35981, 
+    35982, 35983, 35984, 35985, 35986, 35987, 35988, 35989, 35990, 35991, 
+    35992, 35993, 35994, 35995, 35996, 35997, 35998, 35999, 36000, 36001, 
+    36002, 36003, 36004, 36005, 36006, 36007, 36008, 36009, 36010, 36011, 
+    36012, 36013, 36014, 36015, 36016, 36017, 36018, 36019, 36020, 36021, 
+    36022, 36023, 36024, 36025, 36026, 36027, 36028, 36029, 36030, 36031, 
+    36032, 36033, 36034, 36035, 36036, 36037, 36038, 36039, 36040, 36041, 
+    36042, 36043, 36044, 36045, 36046, 36047, 36048, 36049, 36050, 36051, 
+    36052, 36053, 36054, 36055, 36056, 36057, 36058, 36059, 36060, 36061, 
+    36062, 36063, 36064, 36065, 36066, 36067, 36068, 36069, 36070, 36071, 
+    36072, 36073, 36074, 36075, 36076, 36077, 36078, 36079, 36080, 36081, 
+    36082, 36083, 36084, 36085, 36086, 36087, 36088, 36089, 36090, 36091, 
+    36092, 36093, 36094, 36095, 36096, 36097, 36098, 36099, 36100, 36101, 
+    36102, 36103, 36104, 36105, 36106, 36107, 36108, 36109, 36110, 36111, 
+    36112, 36113, 36114, 36115, 36116, 36117, 36118, 36119, 36120, 36121, 
+    36122, 36123, 36124, 36125, 36126, 36127, 36128, 36129, 36130, 36131, 
+    36132, 36133, 36134, 36135, 36136, 36137, 36138, 36139, 36140, 36141, 
+    36142, 36143, 36144, 36145, 36146, 36147, 36148, 36149, 36150, 36151, 
+    36152, 36153, 36154, 36155, 36156, 36157, 36158, 36159, 36160, 36161, 
+    36162, 36163, 36164, 36165, 36166, 36167, 36168, 36169, 36170, 36171, 
+    36172, 36173, 36174, 36175, 36176, 36177, 36178, 36179, 36180, 36181, 
+    36182, 36183, 36184, 36185, 36186, 36187, 36188, 36189, 36190, 36191, 
+    36192, 36193, 36194, 36195, 36196, 36197, 36198, 36199, 36200, 36201, 
+    36202, 36203, 36204, 36205, 36206, 36207, 36208, 36209, 36210, 36211, 
+    36212, 36213, 36214, 36215, 36216, 36217, 36218, 36219, 36220, 36221, 
+    36222, 36223, 36224, 36225, 36226, 36227, 36228, 36229, 36230, 36231, 
+    36232, 36233, 36234, 36235, 36236, 36237, 36238, 36239, 36240, 36241, 
+    36242, 36243, 36244, 36245, 36246, 36247, 36248, 36249, 36250, 36251, 
+    36252, 36253, 36254, 36255, 36256, 36257, 36258, 36259, 36260, 36261, 
+    36262, 36263, 36264, 36265, 36266, 36267, 36268, 36269, 36270, 36271, 
+    36272, 36273, 36274, 36275, 36276, 36277, 36278, 36279, 36280, 36281, 
+    36282, 36283, 36284, 36285, 36286, 36287, 36288, 36289, 36290, 36291, 
+    36292, 36293, 36294, 36295, 36296, 36297, 36298, 36299, 36300, 36301, 
+    36302, 36303, 36304, 36305, 36306, 36307, 36308, 36309, 36310, 36311, 
+    36312, 36313, 36314, 36315, 36316, 36317, 36318, 36319, 36320, 36321, 
+    36322, 36323, 36324, 36325, 36326, 36327, 36328, 36329, 36330, 36331, 
+    36332, 36333, 36334, 36335, 36336, 36337, 36338, 36339, 36340, 36341, 
+    36342, 36343, 36344, 36345, 36346, 36347, 36348, 36349, 36350, 36351, 
+    36352, 36353, 36354, 36355, 36356, 36357, 36358, 36359, 36360, 36361, 
+    36362, 36363, 36364, 36365, 36366, 36367, 36368, 36369, 36370, 36371, 
+    36372, 36373, 36374, 36375, 36376, 36377, 36378, 36379, 36380, 36381, 
+    36382, 36383, 36384, 36385, 36386, 36387, 36388, 36389, 36390, 36391, 
+    36392, 36393, 36394, 36395, 36396, 36397, 36398, 36399, 36400, 36401, 
+    36402, 36403, 36404, 36405, 36406, 36407, 36408, 36409, 36410, 36411, 
+    36412, 36413, 36414, 36415, 36416, 36417, 36418, 36419, 36420, 36421, 
+    36422, 36423, 36424, 36425, 36426, 36427, 36428, 36429, 36430, 36431, 
+    36432, 36433, 36434, 36435, 36436, 36437, 36438, 36439, 36440, 36441, 
+    36442, 36443, 36444, 36445, 36446, 36447, 36448, 36449, 36450, 36451, 
+    36452, 36453, 36454, 36455, 36456, 36457, 36458, 36459, 36460, 36461, 
+    36462, 36463, 36464, 36465, 36466, 36467, 36468, 36469, 36470, 36471, 
+    36472, 36473, 36474, 36475, 36476, 36477, 36478, 36479, 36480, 36481, 
+    36482, 36483, 36484, 36485, 36486, 36487, 36488, 36489, 36490, 36491, 
+    36492, 36493, 36494, 36495, 36496, 36497, 36498, 36499, 36500, 36501, 
+    36502, 36503, 36504, 36505, 36506, 36507, 36508, 36509, 36510, 36511, 
+    36512, 36513, 36514, 36515, 36516, 36517, 36518, 36519, 36520, 36521, 
+    36522, 36523, 36524, 36525, 36526, 36527, 36528, 36529, 36530, 36531, 
+    36532, 36533, 36534, 36535, 36536, 36537, 36538, 36539, 36540, 36541, 
+    36542, 36543, 36544, 36545, 36546, 36547, 36548, 36549, 36550, 36551, 
+    36552, 36553, 36554, 36555, 36556, 36557, 36558, 36559, 36560, 36561, 
+    36562, 36563, 36564, 36565, 36566, 36567, 36568, 36569, 36570, 36571, 
+    36572, 36573, 36574, 36575, 36576, 36577, 36578, 36579, 36580, 36581, 
+    36582, 36583, 36584, 36585, 36586, 36587, 36588, 36589, 36590, 36591, 
+    36592, 36593, 36594, 36595, 36596, 36597, 36598, 36599, 36600, 36601, 
+    36602, 36603, 36604, 36605, 36606, 36607, 36608, 36609, 36610, 36611, 
+    36612, 36613, 36614, 36615, 36616, 36617, 36618, 36619, 36620, 36621, 
+    36622, 36623, 36624, 36625, 36626, 36627, 36628, 36629, 36630, 36631, 
+    36632, 36633, 36634, 36635, 36636, 36637, 36638, 36639, 36640, 36641, 
+    36642, 36643, 36644, 36645, 36646, 36647, 36648, 36649, 36650, 36651, 
+    36652, 36653, 36654, 36655, 36656, 36657, 36658, 36659, 36660, 36661, 
+    36662, 36663, 36664, 36665, 36666, 36667, 36668, 36669, 36670, 36671, 
+    36672, 36673, 36674, 36675, 36676, 36677, 36678, 36679, 36680, 36681, 
+    36682, 36683, 36684, 36685, 36686, 36687, 36688, 36689, 36690, 36691, 
+    36692, 36693, 36694, 36695, 36696, 36697, 36698, 36699, 36700, 36701, 
+    36702, 36703, 36704, 36705, 36706, 36707, 36708, 36709, 36710, 36711, 
+    36712, 36713, 36714, 36715, 36716, 36717, 36718, 36719, 36720, 36721, 
+    36722, 36723, 36724, 36725, 36726, 36727, 36728, 36729, 36730, 36731, 
+    36732, 36733, 36734, 36735, 36736, 36737, 36738, 36739, 36740, 36741, 
+    36742, 36743, 36744, 36745, 36746, 36747, 36748, 36749, 36750, 36751, 
+    36752, 36753, 36754, 36755, 36756, 36757, 36758, 36759, 36760, 36761, 
+    36762, 36763, 36764, 36765, 36766, 36767, 36768, 36769, 36770, 36771, 
+    36772, 36773, 36774, 36775, 36776, 36777, 36778, 36779, 36780, 36781, 
+    36782, 36783, 36784, 36785, 36786, 36787, 36788, 36789, 36790, 36791, 
+    36792, 36793, 36794, 36795, 36796, 36797, 36798, 36799, 36800, 36801, 
+    36802, 36803, 36804, 36805, 36806, 36807, 36808, 36809, 36810, 36811, 
+    36812, 36813, 36814, 36815, 36816, 36817, 36818, 36819, 36820, 36821, 
+    36822, 36823, 36824, 36825, 36826, 36827, 36828, 36829, 36830, 36831, 
+    36832, 36833, 36834, 36835, 36836, 36837, 36838, 36839, 36840, 36841, 
+    36842, 36843, 36844, 36845, 36846, 36847, 36848, 36849, 36850, 36851, 
+    36852, 36853, 36854, 36855, 36856, 36857, 36858, 36859, 36860, 36861, 
+    36862, 36863, 36864, 36865, 36866, 36867, 36868, 36869, 36870, 36871, 
+    36872, 36873, 36874, 36875, 36876, 36877, 36878, 36879, 36880, 36881, 
+    36882, 36883, 36884, 36885, 36886, 36887, 36888, 36889, 36890, 36891, 
+    36892, 36893, 36894, 36895, 36896, 36897, 36898, 36899, 36900, 36901, 
+    36902, 36903, 36904, 36905, 36906, 36907, 36908, 36909, 36910, 36911, 
+    36912, 36913, 36914, 36915, 36916, 36917, 36918, 36919, 36920, 36921, 
+    36922, 36923, 36924, 36925, 36926, 36927, 36928, 36929, 36930, 36931, 
+    36932, 36933, 36934, 36935, 36936, 36937, 36938, 36939, 36940, 36941, 
+    36942, 36943, 36944, 36945, 36946, 36947, 36948, 36949, 36950, 36951, 
+    36952, 36953, 36954, 36955, 36956, 36957, 36958, 36959, 36960, 36961, 
+    36962, 36963, 36964, 36965, 36966, 36967, 36968, 36969, 36970, 36971, 
+    36972, 36973, 36974, 36975, 36976, 36977, 36978, 36979, 36980, 36981, 
+    36982, 36983, 36984, 36985, 36986, 36987, 36988, 36989, 36990, 36991, 
+    36992, 36993, 36994, 36995, 36996, 36997, 36998, 36999, 37000, 37001, 
+    37002, 37003, 37004, 37005, 37006, 37007, 37008, 37009, 37010, 37011, 
+    37012, 37013, 37014, 37015, 37016, 37017, 37018, 37019, 37020, 37021, 
+    37022, 37023, 37024, 37025, 37026, 37027, 37028, 37029, 37030, 37031, 
+    37032, 37033, 37034, 37035, 37036, 37037, 37038, 37039, 37040, 37041, 
+    37042, 37043, 37044, 37045, 37046, 37047, 37048, 37049, 37050, 37051, 
+    37052, 37053, 37054, 37055, 37056, 37057, 37058, 37059, 37060, 37061, 
+    37062, 37063, 37064, 37065, 37066, 37067, 37068, 37069, 37070, 37071, 
+    37072, 37073, 37074, 37075, 37076, 37077, 37078, 37079, 37080, 37081, 
+    37082, 37083, 37084, 37085, 37086, 37087, 37088, 37089, 37090, 37091, 
+    37092, 37093, 37094, 37095, 37096, 37097, 37098, 37099, 37100, 37101, 
+    37102, 37103, 37104, 37105, 37106, 37107, 37108, 37109, 37110, 37111, 
+    37112, 37113, 37114, 37115, 37116, 37117, 37118, 37119, 37120, 37121, 
+    37122, 37123, 37124, 37125, 37126, 37127, 37128, 37129, 37130, 37131, 
+    37132, 37133, 37134, 37135, 37136, 37137, 37138, 37139, 37140, 37141, 
+    37142, 37143, 37144, 37145, 37146, 37147, 37148, 37149, 37150, 37151, 
+    37152, 37153, 37154, 37155, 37156, 37157, 37158, 37159, 37160, 37161, 
+    37162, 37163, 37164, 37165, 37166, 37167, 37168, 37169, 37170, 37171, 
+    37172, 37173, 37174, 37175, 37176, 37177, 37178, 37179, 37180, 37181, 
+    37182, 37183, 37184, 37185, 37186, 37187, 37188, 37189, 37190, 37191, 
+    37192, 37193, 37194, 37195, 37196, 37197, 37198, 37199, 37200, 37201, 
+    37202, 37203, 37204, 37205, 37206, 37207, 37208, 37209, 37210, 37211, 
+    37212, 37213, 37214, 37215, 37216, 37217, 37218, 37219, 37220, 37221, 
+    37222, 37223, 37224, 37225, 37226, 37227, 37228, 37229, 37230, 37231, 
+    37232, 37233, 37234, 37235, 37236, 37237, 37238, 37239, 37240, 37241, 
+    37242, 37243, 37244, 37245, 37246, 37247, 37248, 37249, 37250, 37251, 
+    37252, 37253, 37254, 37255, 37256, 37257, 37258, 37259, 37260, 37261, 
+    37262, 37263, 37264, 37265, 37266, 37267, 37268, 37269, 37270, 37271, 
+    37272, 37273, 37274, 37275, 37276, 37277, 37278, 37279, 37280, 37281, 
+    37282, 37283, 37284, 37285, 37286, 37287, 37288, 37289, 37290, 37291, 
+    37292, 37293, 37294, 37295, 37296, 37297, 37298, 37299, 37300, 37301, 
+    37302, 37303, 37304, 37305, 37306, 37307, 37308, 37309, 37310, 37311, 
+    37312, 37313, 37314, 37315, 37316, 37317, 37318, 37319, 37320, 37321, 
+    37322, 37323, 37324, 37325, 37326, 37327, 37328, 37329, 37330, 37331, 
+    37332, 37333, 37334, 37335, 37336, 37337, 37338, 37339, 37340, 37341, 
+    37342, 37343, 37344, 37345, 37346, 37347, 37348, 37349, 37350, 37351, 
+    37352, 37353, 37354, 37355, 37356, 37357, 37358, 37359, 37360, 37361, 
+    37362, 37363, 37364, 37365, 37366, 37367, 37368, 37369, 37370, 37371, 
+    37372, 37373, 37374, 37375, 37376, 37377, 37378, 37379, 37380, 37381, 
+    37382, 37383, 37384, 37385, 37386, 37387, 37388, 37389, 37390, 37391, 
+    37392, 37393, 37394, 37395, 37396, 37397, 37398, 37399, 37400, 37401, 
+    37402, 37403, 37404, 37405, 37406, 37407, 37408, 37409, 37410, 37411, 
+    37412, 37413, 37414, 37415, 37416, 37417, 37418, 37419, 37420, 37421, 
+    37422, 37423, 37424, 37425, 37426, 37427, 37428, 37429, 37430, 37431, 
+    37432, 37433, 37434, 37435, 37436, 37437, 37438, 37439, 37440, 37441, 
+    37442, 37443, 37444, 37445, 37446, 37447, 37448, 37449, 37450, 37451, 
+    37452, 37453, 37454, 37455, 37456, 37457, 37458, 37459, 37460, 37461, 
+    37462, 37463, 37464, 37465, 37466, 37467, 37468, 37469, 37470, 37471, 
+    37472, 37473, 37474, 37475, 37476, 37477, 37478, 37479, 37480, 37481, 
+    37482, 37483, 37484, 37485, 37486, 37487, 37488, 37489, 37490, 37491, 
+    37492, 37493, 37494, 37495, 37496, 37497, 37498, 37499, 37500, 37501, 
+    37502, 37503, 37504, 37505, 37506, 37507, 37508, 37509, 37510, 37511, 
+    37512, 37513, 37514, 37515, 37516, 37517, 37518, 37519, 37520, 37521, 
+    37522, 37523, 37524, 37525, 37526, 37527, 37528, 37529, 37530, 37531, 
+    37532, 37533, 37534, 37535, 37536, 37537, 37538, 37539, 37540, 37541, 
+    37542, 37543, 37544, 37545, 37546, 37547, 37548, 37549, 37550, 37551, 
+    37552, 37553, 37554, 37555, 37556, 37557, 37558, 37559, 37560, 37561, 
+    37562, 37563, 37564, 37565, 37566, 37567, 37568, 37569, 37570, 37571, 
+    37572, 37573, 37574, 37575, 37576, 37577, 37578, 37579, 37580, 37581, 
+    37582, 37583, 37584, 37585, 37586, 37587, 37588, 37589, 37590, 37591, 
+    37592, 37593, 37594, 37595, 37596, 37597, 37598, 37599, 37600, 37601, 
+    37602, 37603, 37604, 37605, 37606, 37607, 37608, 37609, 37610, 37611, 
+    37612, 37613, 37614, 37615, 37616, 37617, 37618, 37619, 37620, 37621, 
+    37622, 37623, 37624, 37625, 37626, 37627, 37628, 37629, 37630, 37631, 
+    37632, 37633, 37634, 37635, 37636, 37637, 37638, 37639, 37640, 37641, 
+    37642, 37643, 37644, 37645, 37646, 37647, 37648, 37649, 37650, 37651, 
+    37652, 37653, 37654, 37655, 37656, 37657, 37658, 37659, 37660, 37661, 
+    37662, 37663, 37664, 37665, 37666, 37667, 37668, 37669, 37670, 37671, 
+    37672, 37673, 37674, 37675, 37676, 37677, 37678, 37679, 37680, 37681, 
+    37682, 37683, 37684, 37685, 37686, 37687, 37688, 37689, 37690, 37691, 
+    37692, 37693, 37694, 37695, 37696, 37697, 37698, 37699, 37700, 37701, 
+    37702, 37703, 37704, 37705, 37706, 37707, 37708, 37709, 37710, 37711, 
+    37712, 37713, 37714, 37715, 37716, 37717, 37718, 37719, 37720, 37721, 
+    37722, 37723, 37724, 37725, 37726, 37727, 37728, 37729, 37730, 37731, 
+    37732, 37733, 37734, 37735, 37736, 37737, 37738, 37739, 37740, 37741, 
+    37742, 37743, 37744, 37745, 37746, 37747, 37748, 37749, 37750, 37751, 
+    37752, 37753, 37754, 37755, 37756, 37757, 37758, 37759, 37760, 37761, 
+    37762, 37763, 37764, 37765, 37766, 37767, 37768, 37769, 37770, 37771, 
+    37772, 37773, 37774, 37775, 37776, 37777, 37778, 37779, 37780, 37781, 
+    37782, 37783, 37784, 37785, 37786, 37787, 37788, 37789, 37790, 37791, 
+    37792, 37793, 37794, 37795, 37796, 37797, 37798, 37799, 37800, 37801, 
+    37802, 37803, 37804, 37805, 37806, 37807, 37808, 37809, 37810, 37811, 
+    37812, 37813, 37814, 37815, 37816, 37817, 37818, 37819, 37820, 37821, 
+    37822, 37823, 37824, 37825, 37826, 37827, 37828, 37829, 37830, 37831, 
+    37832, 37833, 37834, 37835, 37836, 37837, 37838, 37839, 37840, 37841, 
+    37842, 37843, 37844, 37845, 37846, 37847, 37848, 37849, 37850, 37851, 
+    37852, 37853, 37854, 37855, 37856, 37857, 37858, 37859, 37860, 37861, 
+    37862, 37863, 37864, 37865, 37866, 37867, 37868, 37869, 37870, 37871, 
+    37872, 37873, 37874, 37875, 37876, 37877, 37878, 37879, 37880, 37881, 
+    37882, 37883, 37884, 37885, 37886, 37887, 37888, 37889, 37890, 37891, 
+    37892, 37893, 37894, 37895, 37896, 37897, 37898, 37899, 37900, 37901, 
+    37902, 37903, 37904, 37905, 37906, 37907, 37908, 37909, 37910, 37911, 
+    37912, 37913, 37914, 37915, 37916, 37917, 37918, 37919, 37920, 37921, 
+    37922, 37923, 37924, 37925, 37926, 37927, 37928, 37929, 37930, 37931, 
+    37932, 37933, 37934, 37935, 37936, 37937, 37938, 37939, 37940, 37941, 
+    37942, 37943, 37944, 37945, 37946, 37947, 37948, 37949, 37950, 37951, 
+    37952, 37953, 37954, 37955, 37956, 37957, 37958, 37959, 37960, 37961, 
+    37962, 37963, 37964, 37965, 37966, 37967, 37968, 37969, 37970, 37971, 
+    37972, 37973, 37974, 37975, 37976, 37977, 37978, 37979, 37980, 37981, 
+    37982, 37983, 37984, 37985, 37986, 37987, 37988, 37989, 37990, 37991, 
+    37992, 37993, 37994, 37995, 37996, 37997, 37998, 37999, 38000, 38001, 
+    38002, 38003, 38004, 38005, 38006, 38007, 38008, 38009, 38010, 38011, 
+    38012, 38013, 38014, 38015, 38016, 38017, 38018, 38019, 38020, 38021, 
+    38022, 38023, 38024, 38025, 38026, 38027, 38028, 38029, 38030, 38031, 
+    38032, 38033, 38034, 38035, 38036, 38037, 38038, 38039, 38040, 38041, 
+    38042, 38043, 38044, 38045, 38046, 38047, 38048, 38049, 38050, 38051, 
+    38052, 38053, 38054, 38055, 38056, 38057, 38058, 38059, 38060, 38061, 
+    38062, 38063, 38064, 38065, 38066, 38067, 38068, 38069, 38070, 38071, 
+    38072, 38073, 38074, 38075, 38076, 38077, 38078, 38079, 38080, 38081, 
+    38082, 38083, 38084, 38085, 38086, 38087, 38088, 38089, 38090, 38091, 
+    38092, 38093, 38094, 38095, 38096, 38097, 38098, 38099, 38100, 38101, 
+    38102, 38103, 38104, 38105, 38106, 38107, 38108, 38109, 38110, 38111, 
+    38112, 38113, 38114, 38115, 38116, 38117, 38118, 38119, 38120, 38121, 
+    38122, 38123, 38124, 38125, 38126, 38127, 38128, 38129, 38130, 38131, 
+    38132, 38133, 38134, 38135, 38136, 38137, 38138, 38139, 38140, 38141, 
+    38142, 38143, 38144, 38145, 38146, 38147, 38148, 38149, 38150, 38151, 
+    38152, 38153, 38154, 38155, 38156, 38157, 38158, 38159, 38160, 38161, 
+    38162, 38163, 38164, 38165, 38166, 38167, 38168, 38169, 38170, 38171, 
+    38172, 38173, 38174, 38175, 38176, 38177, 38178, 38179, 38180, 38181, 
+    38182, 38183, 38184, 38185, 38186, 38187, 38188, 38189, 38190, 38191, 
+    38192, 38193, 38194, 38195, 38196, 38197, 38198, 38199, 38200, 38201, 
+    38202, 38203, 38204, 38205, 38206, 38207, 38208, 38209, 38210, 38211, 
+    38212, 38213, 38214, 38215, 38216, 38217, 38218, 38219, 38220, 38221, 
+    38222, 38223, 38224, 38225, 38226, 38227, 38228, 38229, 38230, 38231, 
+    38232, 38233, 38234, 38235, 38236, 38237, 38238, 38239, 38240, 38241, 
+    38242, 38243, 38244, 38245, 38246, 38247, 38248, 38249, 38250, 38251, 
+    38252, 38253, 38254, 38255, 38256, 38257, 38258, 38259, 38260, 38261, 
+    38262, 38263, 38264, 38265, 38266, 38267, 38268, 38269, 38270, 38271, 
+    38272, 38273, 38274, 38275, 38276, 38277, 38278, 38279, 38280, 38281, 
+    38282, 38283, 38284, 38285, 38286, 38287, 38288, 38289, 38290, 38291, 
+    38292, 38293, 38294, 38295, 38296, 38297, 38298, 38299, 38300, 38301, 
+    38302, 38303, 38304, 38305, 38306, 38307, 38308, 38309, 38310, 38311, 
+    38312, 38313, 38314, 38315, 38316, 38317, 38318, 38319, 38320, 38321, 
+    38322, 38323, 38324, 38325, 38326, 38327, 38328, 38329, 38330, 38331, 
+    38332, 38333, 38334, 38335, 38336, 38337, 38338, 38339, 38340, 38341, 
+    38342, 38343, 38344, 38345, 38346, 38347, 38348, 38349, 38350, 38351, 
+    38352, 38353, 38354, 38355, 38356, 38357, 38358, 38359, 38360, 38361, 
+    38362, 38363, 38364, 38365, 38366, 38367, 38368, 38369, 38370, 38371, 
+    38372, 38373, 38374, 38375, 38376, 38377, 38378, 38379, 38380, 38381, 
+    38382, 38383, 38384, 38385, 38386, 38387, 38388, 38389, 38390, 38391, 
+    38392, 38393, 38394, 38395, 38396, 38397, 38398, 38399, 38400, 38401, 
+    38402, 38403, 38404, 38405, 38406, 38407, 38408, 38409, 38410, 38411, 
+    38412, 38413, 38414, 38415, 38416, 38417, 38418, 38419, 38420, 38421, 
+    38422, 38423, 38424, 38425, 38426, 38427, 38428, 38429, 38430, 38431, 
+    38432, 38433, 38434, 38435, 38436, 38437, 38438, 38439, 38440, 38441, 
+    38442, 38443, 38444, 38445, 38446, 38447, 38448, 38449, 38450, 38451, 
+    38452, 38453, 38454, 38455, 38456, 38457, 38458, 38459, 38460, 38461, 
+    38462, 38463, 38464, 38465, 38466, 38467, 38468, 38469, 38470, 38471, 
+    38472, 38473, 38474, 38475, 38476, 38477, 38478, 38479, 38480, 38481, 
+    38482, 38483, 38484, 38485, 38486, 38487, 38488, 38489, 38490, 38491, 
+    38492, 38493, 38494, 38495, 38496, 38497, 38498, 38499, 38500, 38501, 
+    38502, 38503, 38504, 38505, 38506, 38507, 38508, 38509, 38510, 38511, 
+    38512, 38513, 38514, 38515, 38516, 38517, 38518, 38519, 38520, 38521, 
+    38522, 38523, 38524, 38525, 38526, 38527, 38528, 38529, 38530, 38531, 
+    38532, 38533, 38534, 38535, 38536, 38537, 38538, 38539, 38540, 38541, 
+    38542, 38543, 38544, 38545, 38546, 38547, 38548, 38549, 38550, 38551, 
+    38552, 38553, 38554, 38555, 38556, 38557, 38558, 38559, 38560, 38561, 
+    38562, 38563, 38564, 38565, 38566, 38567, 38568, 38569, 38570, 38571, 
+    38572, 38573, 38574, 38575, 38576, 38577, 38578, 38579, 38580, 38581, 
+    38582, 38583, 38584, 38585, 38586, 38587, 38588, 38589, 38590, 38591, 
+    38592, 38593, 38594, 38595, 38596, 38597, 38598, 38599, 38600, 38601, 
+    38602, 38603, 38604, 38605, 38606, 38607, 38608, 38609, 38610, 38611, 
+    38612, 38613, 38614, 38615, 38616, 38617, 38618, 38619, 38620, 38621, 
+    38622, 38623, 38624, 38625, 38626, 38627, 38628, 38629, 38630, 38631, 
+    38632, 38633, 38634, 38635, 38636, 38637, 38638, 38639, 38640, 38641, 
+    38642, 38643, 38644, 38645, 38646, 38647, 38648, 38649, 38650, 38651, 
+    38652, 38653, 38654, 38655, 38656, 38657, 38658, 38659, 38660, 38661, 
+    38662, 38663, 38664, 38665, 38666, 38667, 38668, 38669, 38670, 38671, 
+    38672, 38673, 38674, 38675, 38676, 38677, 38678, 38679, 38680, 38681, 
+    38682, 38683, 38684, 38685, 38686, 38687, 38688, 38689, 38690, 38691, 
+    38692, 38693, 38694, 38695, 38696, 38697, 38698, 38699, 38700, 38701, 
+    38702, 38703, 38704, 38705, 38706, 38707, 38708, 38709, 38710, 38711, 
+    38712, 38713, 38714, 38715, 38716, 38717, 38718, 38719, 38720, 38721, 
+    38722, 38723, 38724, 38725, 38726, 38727, 38728, 38729, 38730, 38731, 
+    38732, 38733, 38734, 38735, 38736, 38737, 38738, 38739, 38740, 38741, 
+    38742, 38743, 38744, 38745, 38746, 38747, 38748, 38749, 38750, 38751, 
+    38752, 38753, 38754, 38755, 38756, 38757, 38758, 38759, 38760, 38761, 
+    38762, 38763, 38764, 38765, 38766, 38767, 38768, 38769, 38770, 38771, 
+    38772, 38773, 38774, 38775, 38776, 38777, 38778, 38779, 38780, 38781, 
+    38782, 38783, 38784, 38785, 38786, 38787, 38788, 38789, 38790, 38791, 
+    38792, 38793, 38794, 38795, 38796, 38797, 38798, 38799, 38800, 38801, 
+    38802, 38803, 38804, 38805, 38806, 38807, 38808, 38809, 38810, 38811, 
+    38812, 38813, 38814, 38815, 38816, 38817, 38818, 38819, 38820, 38821, 
+    38822, 38823, 38824, 38825, 38826, 38827, 38828, 38829, 38830, 38831, 
+    38832, 38833, 38834, 38835, 38836, 38837, 38838, 38839, 38840, 38841, 
+    38842, 38843, 38844, 38845, 38846, 38847, 38848, 38849, 38850, 38851, 
+    38852, 38853, 38854, 38855, 38856, 38857, 38858, 38859, 38860, 38861, 
+    38862, 38863, 38864, 38865, 38866, 38867, 38868, 38869, 38870, 38871, 
+    38872, 38873, 38874, 38875, 38876, 38877, 38878, 38879, 38880, 38881, 
+    38882, 38883, 38884, 38885, 38886, 38887, 38888, 38889, 38890, 38891, 
+    38892, 38893, 38894, 38895, 38896, 38897, 38898, 38899, 38900, 38901, 
+    38902, 38903, 38904, 38905, 38906, 38907, 38908, 38909, 38910, 38911, 
+    38912, 38913, 38914, 38915, 38916, 38917, 38918, 38919, 38920, 38921, 
+    38922, 38923, 38924, 38925, 38926, 38927, 38928, 38929, 38930, 38931, 
+    38932, 38933, 38934, 38935, 38936, 38937, 38938, 38939, 38940, 38941, 
+    38942, 38943, 38944, 38945, 38946, 38947, 38948, 38949, 38950, 38951, 
+    38952, 38953, 38954, 38955, 38956, 38957, 38958, 38959, 38960, 38961, 
+    38962, 38963, 38964, 38965, 38966, 38967, 38968, 38969, 38970, 38971, 
+    38972, 38973, 38974, 38975, 38976, 38977, 38978, 38979, 38980, 38981, 
+    38982, 38983, 38984, 38985, 38986, 38987, 38988, 38989, 38990, 38991, 
+    38992, 38993, 38994, 38995, 38996, 38997, 38998, 38999, 39000, 39001, 
+    39002, 39003, 39004, 39005, 39006, 39007, 39008, 39009, 39010, 39011, 
+    39012, 39013, 39014, 39015, 39016, 39017, 39018, 39019, 39020, 39021, 
+    39022, 39023, 39024, 39025, 39026, 39027, 39028, 39029, 39030, 39031, 
+    39032, 39033, 39034, 39035, 39036, 39037, 39038, 39039, 39040, 39041, 
+    39042, 39043, 39044, 39045, 39046, 39047, 39048, 39049, 39050, 39051, 
+    39052, 39053, 39054, 39055, 39056, 39057, 39058, 39059, 39060, 39061, 
+    39062, 39063, 39064, 39065, 39066, 39067, 39068, 39069, 39070, 39071, 
+    39072, 39073, 39074, 39075, 39076, 39077, 39078, 39079, 39080, 39081, 
+    39082, 39083, 39084, 39085, 39086, 39087, 39088, 39089, 39090, 39091, 
+    39092, 39093, 39094, 39095, 39096, 39097, 39098, 39099, 39100, 39101, 
+    39102, 39103, 39104, 39105, 39106, 39107, 39108, 39109, 39110, 39111, 
+    39112, 39113, 39114, 39115, 39116, 39117, 39118, 39119, 39120, 39121, 
+    39122, 39123, 39124, 39125, 39126, 39127, 39128, 39129, 39130, 39131, 
+    39132, 39133, 39134, 39135, 39136, 39137, 39138, 39139, 39140, 39141, 
+    39142, 39143, 39144, 39145, 39146, 39147, 39148, 39149, 39150, 39151, 
+    39152, 39153, 39154, 39155, 39156, 39157, 39158, 39159, 39160, 39161, 
+    39162, 39163, 39164, 39165, 39166, 39167, 39168, 39169, 39170, 39171, 
+    39172, 39173, 39174, 39175, 39176, 39177, 39178, 39179, 39180, 39181, 
+    39182, 39183, 39184, 39185, 39186, 39187, 39188, 39189, 39190, 39191, 
+    39192, 39193, 39194, 39195, 39196, 39197, 39198, 39199, 39200, 39201, 
+    39202, 39203, 39204, 39205, 39206, 39207, 39208, 39209, 39210, 39211, 
+    39212, 39213, 39214, 39215, 39216, 39217, 39218, 39219, 39220, 39221, 
+    39222, 39223, 39224, 39225, 39226, 39227, 39228, 39229, 39230, 39231, 
+    39232, 39233, 39234, 39235, 39236, 39237, 39238, 39239, 39240, 39241, 
+    39242, 39243, 39244, 39245, 39246, 39247, 39248, 39249, 39250, 39251, 
+    39252, 39253, 39254, 39255, 39256, 39257, 39258, 39259, 39260, 39261, 
+    39262, 39263, 39264, 39265, 39266, 39267, 39268, 39269, 39270, 39271, 
+    39272, 39273, 39274, 39275, 39276, 39277, 39278, 39279, 39280, 39281, 
+    39282, 39283, 39284, 39285, 39286, 39287, 39288, 39289, 39290, 39291, 
+    39292, 39293, 39294, 39295, 39296, 39297, 39298, 39299, 39300, 39301, 
+    39302, 39303, 39304, 39305, 39306, 39307, 39308, 39309, 39310, 39311, 
+    39312, 39313, 39314, 39315, 39316, 39317, 39318, 39319, 39320, 39321, 
+    39322, 39323, 39324, 39325, 39326, 39327, 39328, 39329, 39330, 39331, 
+    39332, 39333, 39334, 39335, 39336, 39337, 39338, 39339, 39340, 39341, 
+    39342, 39343, 39344, 39345, 39346, 39347, 39348, 39349, 39350, 39351, 
+    39352, 39353, 39354, 39355, 39356, 39357, 39358, 39359, 39360, 39361, 
+    39362, 39363, 39364, 39365, 39366, 39367, 39368, 39369, 39370, 39371, 
+    39372, 39373, 39374, 39375, 39376, 39377, 39378, 39379, 39380, 39381, 
+    39382, 39383, 39384, 39385, 39386, 39387, 39388, 39389, 39390, 39391, 
+    39392, 39393, 39394, 39395, 39396, 39397, 39398, 39399, 39400, 39401, 
+    39402, 39403, 39404, 39405, 39406, 39407, 39408, 39409, 39410, 39411, 
+    39412, 39413, 39414, 39415, 39416, 39417, 39418, 39419, 39420, 39421, 
+    39422, 39423, 39424, 39425, 39426, 39427, 39428, 39429, 39430, 39431, 
+    39432, 39433, 39434, 39435, 39436, 39437, 39438, 39439, 39440, 39441, 
+    39442, 39443, 39444, 39445, 39446, 39447, 39448, 39449, 39450, 39451, 
+    39452, 39453, 39454, 39455, 39456, 39457, 39458, 39459, 39460, 39461, 
+    39462, 39463, 39464, 39465, 39466, 39467, 39468, 39469, 39470, 39471, 
+    39472, 39473, 39474, 39475, 39476, 39477, 39478, 39479, 39480, 39481, 
+    39482, 39483, 39484, 39485, 39486, 39487, 39488, 39489, 39490, 39491, 
+    39492, 39493, 39494, 39495, 39496, 39497, 39498, 39499, 39500, 39501, 
+    39502, 39503, 39504, 39505, 39506, 39507, 39508, 39509, 39510, 39511, 
+    39512, 39513, 39514, 39515, 39516, 39517, 39518, 39519, 39520, 39521, 
+    39522, 39523, 39524, 39525, 39526, 39527, 39528, 39529, 39530, 39531, 
+    39532, 39533, 39534, 39535, 39536, 39537, 39538, 39539, 39540, 39541, 
+    39542, 39543, 39544, 39545, 39546, 39547, 39548, 39549, 39550, 39551, 
+    39552, 39553, 39554, 39555, 39556, 39557, 39558, 39559, 39560, 39561, 
+    39562, 39563, 39564, 39565, 39566, 39567, 39568, 39569, 39570, 39571, 
+    39572, 39573, 39574, 39575, 39576, 39577, 39578, 39579, 39580, 39581, 
+    39582, 39583, 39584, 39585, 39586, 39587, 39588, 39589, 39590, 39591, 
+    39592, 39593, 39594, 39595, 39596, 39597, 39598, 39599, 39600, 39601, 
+    39602, 39603, 39604, 39605, 39606, 39607, 39608, 39609, 39610, 39611, 
+    39612, 39613, 39614, 39615, 39616, 39617, 39618, 39619, 39620, 39621, 
+    39622, 39623, 39624, 39625, 39626, 39627, 39628, 39629, 39630, 39631, 
+    39632, 39633, 39634, 39635, 39636, 39637, 39638, 39639, 39640, 39641, 
+    39642, 39643, 39644, 39645, 39646, 39647, 39648, 39649, 39650, 39651, 
+    39652, 39653, 39654, 39655, 39656, 39657, 39658, 39659, 39660, 39661, 
+    39662, 39663, 39664, 39665, 39666, 39667, 39668, 39669, 39670, 39671, 
+    39672, 39673, 39674, 39675, 39676, 39677, 39678, 39679, 39680, 39681, 
+    39682, 39683, 39684, 39685, 39686, 39687, 39688, 39689, 39690, 39691, 
+    39692, 39693, 39694, 39695, 39696, 39697, 39698, 39699, 39700, 39701, 
+    39702, 39703, 39704, 39705, 39706, 39707, 39708, 39709, 39710, 39711, 
+    39712, 39713, 39714, 39715, 39716, 39717, 39718, 39719, 39720, 39721, 
+    39722, 39723, 39724, 39725, 39726, 39727, 39728, 39729, 39730, 39731, 
+    39732, 39733, 39734, 39735, 39736, 39737, 39738, 39739, 39740, 39741, 
+    39742, 39743, 39744, 39745, 39746, 39747, 39748, 39749, 39750, 39751, 
+    39752, 39753, 39754, 39755, 39756, 39757, 39758, 39759, 39760, 39761, 
+    39762, 39763, 39764, 39765, 39766, 39767, 39768, 39769, 39770, 39771, 
+    39772, 39773, 39774, 39775, 39776, 39777, 39778, 39779, 39780, 39781, 
+    39782, 39783, 39784, 39785, 39786, 39787, 39788, 39789, 39790, 39791, 
+    39792, 39793, 39794, 39795, 39796, 39797, 39798, 39799, 39800, 39801, 
+    39802, 39803, 39804, 39805, 39806, 39807, 39808, 39809, 39810, 39811, 
+    39812, 39813, 39814, 39815, 39816, 39817, 39818, 39819, 39820, 39821, 
+    39822, 39823, 39824, 39825, 39826, 39827, 39828, 39829, 39830, 39831, 
+    39832, 39833, 39834, 39835, 39836, 39837, 39838, 39839, 39840, 39841, 
+    39842, 39843, 39844, 39845, 39846, 39847, 39848, 39849, 39850, 39851, 
+    39852, 39853, 39854, 39855, 39856, 39857, 39858, 39859, 39860, 39861, 
+    39862, 39863, 39864, 39865, 39866, 39867, 39868, 39869, 39870, 39871, 
+    39872, 39873, 39874, 39875, 39876, 39877, 39878, 39879, 39880, 39881, 
+    39882, 39883, 39884, 39885, 39886, 39887, 39888, 39889, 39890, 39891, 
+    39892, 39893, 39894, 39895, 39896, 39897, 39898, 39899, 39900, 39901, 
+    39902, 39903, 39904, 39905, 39906, 39907, 39908, 39909, 39910, 39911, 
+    39912, 39913, 39914, 39915, 39916, 39917, 39918, 39919, 39920, 39921, 
+    39922, 39923, 39924, 39925, 39926, 39927, 39928, 39929, 39930, 39931, 
+    39932, 39933, 39934, 39935, 39936, 39937, 39938, 39939, 39940, 39941, 
+    39942, 39943, 39944, 39945, 39946, 39947, 39948, 39949, 39950, 39951, 
+    39952, 39953, 39954, 39955, 39956, 39957, 39958, 39959, 39960, 39961, 
+    39962, 39963, 39964, 39965, 39966, 39967, 39968, 39969, 39970, 39971, 
+    39972, 39973, 39974, 39975, 39976, 39977, 39978, 39979, 39980, 39981, 
+    39982, 39983, 39984, 39985, 39986, 39987, 39988, 39989, 39990, 39991, 
+    39992, 39993, 39994, 39995, 39996, 39997, 39998, 39999, 40000, 40001, 
+    40002, 40003, 40004, 40005, 40006, 40007, 40008, 40009, 40010, 40011, 
+    40012, 40013, 40014, 40015, 40016, 40017, 40018, 40019, 40020, 40021, 
+    40022, 40023, 40024, 40025, 40026, 40027, 40028, 40029, 40030, 40031, 
+    40032, 40033, 40034, 40035, 40036, 40037, 40038, 40039, 40040, 40041, 
+    40042, 40043, 40044, 40045, 40046, 40047, 40048, 40049, 40050, 40051, 
+    40052, 40053, 40054, 40055, 40056, 40057, 40058, 40059, 40060, 40061, 
+    40062, 40063, 40064, 40065, 40066, 40067, 40068, 40069, 40070, 40071, 
+    40072, 40073, 40074, 40075, 40076, 40077, 40078, 40079, 40080, 40081, 
+    40082, 40083, 40084, 40085, 40086, 40087, 40088, 40089, 40090, 40091, 
+    40092, 40093, 40094, 40095, 40096, 40097, 40098, 40099, 40100, 40101, 
+    40102, 40103, 40104, 40105, 40106, 40107, 40108, 40109, 40110, 40111, 
+    40112, 40113, 40114, 40115, 40116, 40117, 40118, 40119, 40120, 40121, 
+    40122, 40123, 40124, 40125, 40126, 40127, 40128, 40129, 40130, 40131, 
+    40132, 40133, 40134, 40135, 40136, 40137, 40138, 40139, 40140, 40141, 
+    40142, 40143, 40144, 40145, 40146, 40147, 40148, 40149, 40150, 40151, 
+    40152, 40153, 40154, 40155, 40156, 40157, 40158, 40159, 40160, 40161, 
+    40162, 40163, 40164, 40165, 40166, 40167, 40168, 40169, 40170, 40171, 
+    40172, 40173, 40174, 40175, 40176, 40177, 40178, 40179, 40180, 40181, 
+    40182, 40183, 40184, 40185, 40186, 40187, 40188, 40189, 40190, 40191, 
+    40192, 40193, 40194, 40195, 40196, 40197, 40198, 40199, 40200, 40201, 
+    40202, 40203, 40204, 40205, 40206, 40207, 40208, 40209, 40210, 40211, 
+    40212, 40213, 40214, 40215, 40216, 40217, 40218, 40219, 40220, 40221, 
+    40222, 40223, 40224, 40225, 40226, 40227, 40228, 40229, 40230, 40231, 
+    40232, 40233, 40234, 40235, 40236, 40237, 40238, 40239, 40240, 40241, 
+    40242, 40243, 40244, 40245, 40246, 40247, 40248, 40249, 40250, 40251, 
+    40252, 40253, 40254, 40255, 40256, 40257, 40258, 40259, 40260, 40261, 
+    40262, 40263, 40264, 40265, 40266, 40267, 40268, 40269, 40270, 40271, 
+    40272, 40273, 40274, 40275, 40276, 40277, 40278, 40279, 40280, 40281, 
+    40282, 40283, 40284, 40285, 40286, 40287, 40288, 40289, 40290, 40291, 
+    40292, 40293, 40294, 40295, 40296, 40297, 40298, 40299, 40300, 40301, 
+    40302, 40303, 40304, 40305, 40306, 40307, 40308, 40309, 40310, 40311, 
+    40312, 40313, 40314, 40315, 40316, 40317, 40318, 40319, 40320, 40321, 
+    40322, 40323, 40324, 40325, 40326, 40327, 40328, 40329, 40330, 40331, 
+    40332, 40333, 40334, 40335, 40336, 40337, 40338, 40339, 40340, 40341, 
+    40342, 40343, 40344, 40345, 40346, 40347, 40348, 40349, 40350, 40351, 
+    40352, 40353, 40354, 40355, 40356, 40357, 40358, 40359, 40360, 40361, 
+    40362, 40363, 40364, 40365, 40366, 40367, 40368, 40369, 40370, 40371, 
+    40372, 40373, 40374, 40375, 40376, 40377, 40378, 40379, 40380, 40381, 
+    40382, 40383, 40384, 40385, 40386, 40387, 40388, 40389, 40390, 40391, 
+    40392, 40393, 40394, 40395, 40396, 40397, 40398, 40399, 40400, 40401, 
+    40402, 40403, 40404, 40405, 40406, 40407, 40408, 40409, 40410, 40411, 
+    40412, 40413, 40414, 40415, 40416, 40417, 40418, 40419, 40420, 40421, 
+    40422, 40423, 40424, 40425, 40426, 40427, 40428, 40429, 40430, 40431, 
+    40432, 40433, 40434, 40435, 40436, 40437, 40438, 40439, 40440, 40441, 
+    40442, 40443, 40444, 40445, 40446, 40447, 40448, 40449, 40450, 40451, 
+    40452, 40453, 40454, 40455, 40456, 40457, 40458, 40459, 40460, 40461, 
+    40462, 40463, 40464, 40465, 40466, 40467, 40468, 40469, 40470, 40471, 
+    40472, 40473, 40474, 40475, 40476, 40477, 40478, 40479, 40480, 40481, 
+    40482, 40483, 40484, 40485, 40486, 40487, 40488, 40489, 40490, 40491, 
+    40492, 40493, 40494, 40495, 40496, 40497, 40498, 40499, 40500, 40501, 
+    40502, 40503, 40504, 40505, 40506, 40507, 40508, 40509, 40510, 40511, 
+    40512, 40513, 40514, 40515, 40516, 40517, 40518, 40519, 40520, 40521, 
+    40522, 40523, 40524, 40525, 40526, 40527, 40528, 40529, 40530, 40531, 
+    40532, 40533, 40534, 40535, 40536, 40537, 40538, 40539, 40540, 40541, 
+    40542, 40543, 40544, 40545, 40546, 40547, 40548, 40549, 40550, 40551, 
+    40552, 40553, 40554, 40555, 40556, 40557, 40558, 40559, 40560, 40561, 
+    40562, 40563, 40564, 40565, 40566, 40567, 40568, 40569, 40570, 40571, 
+    40572, 40573, 40574, 40575, 40576, 40577, 40578, 40579, 40580, 40581, 
+    40582, 40583, 40584, 40585, 40586, 40587, 40588, 40589, 40590, 40591, 
+    40592, 40593, 40594, 40595, 40596, 40597, 40598, 40599, 40600, 40601, 
+    40602, 40603, 40604, 40605, 40606, 40607, 40608, 40609, 40610, 40611, 
+    40612, 40613, 40614, 40615, 40616, 40617, 40618, 40619, 40620, 40621, 
+    40622, 40623, 40624, 40625, 40626, 40627, 40628, 40629, 40630, 40631, 
+    40632, 40633, 40634, 40635, 40636, 40637, 40638, 40639, 40640, 40641, 
+    40642, 40643, 40644, 40645, 40646, 40647, 40648, 40649, 40650, 40651, 
+    40652, 40653, 40654, 40655, 40656, 40657, 40658, 40659, 40660, 40661, 
+    40662, 40663, 40664, 40665, 40666, 40667, 40668, 40669, 40670, 40671, 
+    40672, 40673, 40674, 40675, 40676, 40677, 40678, 40679, 40680, 40681, 
+    40682, 40683, 40684, 40685, 40686, 40687, 40688, 40689, 40690, 40691, 
+    40692, 40693, 40694, 40695, 40696, 40697, 40698, 40699, 40700, 40701, 
+    40702, 40703, 40704, 40705, 40706, 40707, 40708, 40709, 40710, 40711, 
+    40712, 40713, 40714, 40715, 40716, 40717, 40718, 40719, 40720, 40721, 
+    40722, 40723, 40724, 40725, 40726, 40727, 40728, 40729, 40730, 40731, 
+    40732, 40733, 40734, 40735, 40736, 40737, 40738, 40739, 40740, 40741, 
+    40742, 40743, 40744, 40745, 40746, 40747, 40748, 40749, 40750, 40751, 
+    40752, 40753, 40754, 40755, 40756, 40757, 40758, 40759, 40760, 40761, 
+    40762, 40763, 40764, 40765, 40766, 40767, 40768, 40769, 40770, 40771, 
+    40772, 40773, 40774, 40775, 40776, 40777, 40778, 40779, 40780, 40781, 
+    40782, 40783, 40784, 40785, 40786, 40787, 40788, 40789, 40790, 40791, 
+    40792, 40793, 40794, 40795, 40796, 40797, 40798, 40799, 40800, 40801, 
+    40802, 40803, 40804, 40805, 40806, 40807, 40808, 40809, 40810, 40811, 
+    40812, 40813, 40814, 40815, 40816, 40817, 40818, 40819, 40820, 40821, 
+    40822, 40823, 40824, 40825, 40826, 40827, 40828, 40829, 40830, 40831, 
+    40832, 40833, 40834, 40835, 40836, 40837, 40838, 40839, 40840, 40841, 
+    40842, 40843, 40844, 40845, 40846, 40847, 40848, 40849, 40850, 40851, 
+    40852, 40853, 40854, 40855, 40856, 40857, 40858, 40859, 40860, 40861, 
+    40862, 40863, 40864, 40865, 40866, 40867, 40868, 40869, 40870, 40871, 
+    40872, 40873, 40874, 40875, 40876, 40877, 40878, 40879, 40880, 40881, 
+    40882, 40883, 40884, 40885, 40886, 40887, 40888, 40889, 40890, 40891, 
+    40892, 40893, 40894, 40895, 40896, 40897, 40898, 40899, 40900, 40901, 
+    40902, 40903, 40904, 40905, 40906, 40907, 40908, 40909, 40910, 40911, 
+    40912, 40913, 40914, 40915, 40916, 40917, 40918, 40919, 40920, 40921, 
+    40922, 40923, 40924, 40925, 40926, 40927, 40928, 40929, 40930, 40931, 
+    40932, 40933, 40934, 40935, 40936, 40937, 40938, 40939, 40940, 40941, 
+    40942, 40943, 40944, 40945, 40946, 40947, 40948, 40949, 40950, 40951, 
+    40952, 40953, 40954, 40955, 40956, 40957, 40958, 40959, 40960, 40961, 
+    40962, 40963, 40964, 40965, 40966, 40967, 40968, 40969, 40970, 40971, 
+    40972, 40973, 40974, 40975, 40976, 40977, 40978, 40979, 40980, 40981, 
+    40982, 40983, 40984, 40985, 40986, 40987, 40988, 40989, 40990, 40991, 
+    40992, 40993, 40994, 40995, 40996, 40997, 40998, 40999, 41000, 41001, 
+    41002, 41003, 41004, 41005, 41006, 41007, 41008, 41009, 41010, 41011, 
+    41012, 41013, 41014, 41015, 41016, 41017, 41018, 41019, 41020, 41021, 
+    41022, 41023, 41024, 41025, 41026, 41027, 41028, 41029, 41030, 41031, 
+    41032, 41033, 41034, 41035, 41036, 41037, 41038, 41039, 41040, 41041, 
+    41042, 41043, 41044, 41045, 41046, 41047, 41048, 41049, 41050, 41051, 
+    41052, 41053, 41054, 41055, 41056, 41057, 41058, 41059, 41060, 41061, 
+    41062, 41063, 41064, 41065, 41066, 41067, 41068, 41069, 41070, 41071, 
+    41072, 41073, 41074, 41075, 41076, 41077, 41078, 41079, 41080, 41081, 
+    41082, 41083, 41084, 41085, 41086, 41087, 41088, 41089, 41090, 41091, 
+    41092, 41093, 41094, 41095, 41096, 41097, 41098, 41099, 41100, 41101, 
+    41102, 41103, 41104, 41105, 41106, 41107, 41108, 41109, 41110, 41111, 
+    41112, 41113, 41114, 41115, 41116, 41117, 41118, 41119, 41120, 41121, 
+    41122, 41123, 41124, 41125, 41126, 41127, 41128, 41129, 41130, 41131, 
+    41132, 41133, 41134, 41135, 41136, 41137, 41138, 41139, 41140, 41141, 
+    41142, 41143, 41144, 41145, 41146, 41147, 41148, 41149, 41150, 41151, 
+    41152, 41153, 41154, 41155, 41156, 41157, 41158, 41159, 41160, 41161, 
+    41162, 41163, 41164, 41165, 41166, 41167, 41168, 41169, 41170, 41171, 
+    41172, 41173, 41174, 41175, 41176, 41177, 41178, 41179, 41180, 41181, 
+    41182, 41183, 41184, 41185, 41186, 41187, 41188, 41189, 41190, 41191, 
+    41192, 41193, 41194, 41195, 41196, 41197, 41198, 41199, 41200, 41201, 
+    41202, 41203, 41204, 41205, 41206, 41207, 41208, 41209, 41210, 41211, 
+    41212, 41213, 41214, 41215, 41216, 41217, 41218, 41219, 41220, 41221, 
+    41222, 41223, 41224, 41225, 41226, 41227, 41228, 41229, 41230, 41231, 
+    41232, 41233, 41234, 41235, 41236, 41237, 41238, 41239, 41240, 41241, 
+    41242, 41243, 41244, 41245, 41246, 41247, 41248, 41249, 41250, 41251, 
+    41252, 41253, 41254, 41255, 41256, 41257, 41258, 41259, 41260, 41261, 
+    41262, 41263, 41264, 41265, 41266, 41267, 41268, 41269, 41270, 41271, 
+    41272, 41273, 41274, 41275, 41276, 41277, 41278, 41279, 41280, 41281, 
+    41282, 41283, 41284, 41285, 41286, 41287, 41288, 41289, 41290, 41291, 
+    41292, 41293, 41294, 41295, 41296, 41297, 41298, 41299, 41300, 41301, 
+    41302, 41303, 41304, 41305, 41306, 41307, 41308, 41309, 41310, 41311, 
+    41312, 41313, 41314, 41315, 41316, 41317, 41318, 41319, 41320, 41321, 
+    41322, 41323, 41324, 41325, 41326, 41327, 41328, 41329, 41330, 41331, 
+    41332, 41333, 41334, 41335, 41336, 41337, 41338, 41339, 41340, 41341, 
+    41342, 41343, 41344, 41345, 41346, 41347, 41348, 41349, 41350, 41351, 
+    41352, 41353, 41354, 41355, 41356, 41357, 41358, 41359, 41360, 41361, 
+    41362, 41363, 41364, 41365, 41366, 41367, 41368, 41369, 41370, 41371, 
+    41372, 41373, 41374, 41375, 41376, 41377, 41378, 41379, 41380, 41381, 
+    41382, 41383, 41384, 41385, 41386, 41387, 41388, 41389, 41390, 41391, 
+    41392, 41393, 41394, 41395, 41396, 41397, 41398, 41399, 41400, 41401, 
+    41402, 41403, 41404, 41405, 41406, 41407, 41408, 41409, 41410, 41411, 
+    41412, 41413, 41414, 41415, 41416, 41417, 41418, 41419, 41420, 41421, 
+    41422, 41423, 41424, 41425, 41426, 41427, 41428, 41429, 41430, 41431, 
+    41432, 41433, 41434, 41435, 41436, 41437, 41438, 41439, 41440, 41441, 
+    41442, 41443, 41444, 41445, 41446, 41447, 41448, 41449, 41450, 41451, 
+    41452, 41453, 41454, 41455, 41456, 41457, 41458, 41459, 41460, 41461, 
+    41462, 41463, 41464, 41465, 41466, 41467, 41468, 41469, 41470, 41471, 
+    41472, 41473, 41474, 41475, 41476, 41477, 41478, 41479, 41480, 41481, 
+    41482, 41483, 41484, 41485, 41486, 41487, 41488, 41489, 41490, 41491, 
+    41492, 41493, 41494, 41495, 41496, 41497, 41498, 41499, 41500, 41501, 
+    41502, 41503, 41504, 41505, 41506, 41507, 41508, 41509, 41510, 41511, 
+    41512, 41513, 41514, 41515, 41516, 41517, 41518, 41519, 41520, 41521, 
+    41522, 41523, 41524, 41525, 41526, 41527, 41528, 41529, 41530, 41531, 
+    41532, 41533, 41534, 41535, 41536, 41537, 41538, 41539, 41540, 41541, 
+    41542, 41543, 41544, 41545, 41546, 41547, 41548, 41549, 41550, 41551, 
+    41552, 41553, 41554, 41555, 41556, 41557, 41558, 41559, 41560, 41561, 
+    41562, 41563, 41564, 41565, 41566, 41567, 41568, 41569, 41570, 41571, 
+    41572, 41573, 41574, 41575, 41576, 41577, 41578, 41579, 41580, 41581, 
+    41582, 41583, 41584, 41585, 41586, 41587, 41588, 41589, 41590, 41591, 
+    41592, 41593, 41594, 41595, 41596, 41597, 41598, 41599, 41600, 41601, 
+    41602, 41603, 41604, 41605, 41606, 41607, 41608, 41609, 41610, 41611, 
+    41612, 41613, 41614, 41615, 41616, 41617, 41618, 41619, 41620, 41621, 
+    41622, 41623, 41624, 41625, 41626, 41627, 41628, 41629, 41630, 41631, 
+    41632, 41633, 41634, 41635, 41636, 41637, 41638, 41639, 41640, 41641, 
+    41642, 41643, 41644, 41645, 41646, 41647, 41648, 41649, 41650, 41651, 
+    41652, 41653, 41654, 41655, 41656, 41657, 41658, 41659, 41660, 41661, 
+    41662, 41663, 41664, 41665, 41666, 41667, 41668, 41669, 41670, 41671, 
+    41672, 41673, 41674, 41675, 41676, 41677, 41678, 41679, 41680, 41681, 
+    41682, 41683, 41684, 41685, 41686, 41687, 41688, 41689, 41690, 41691, 
+    41692, 41693, 41694, 41695, 41696, 41697, 41698, 41699, 41700, 41701, 
+    41702, 41703, 41704, 41705, 41706, 41707, 41708, 41709, 41710, 41711, 
+    41712, 41713, 41714, 41715, 41716, 41717, 41718, 41719, 41720, 41721, 
+    41722, 41723, 41724, 41725, 41726, 41727, 41728, 41729, 41730, 41731, 
+    41732, 41733, 41734, 41735, 41736, 41737, 41738, 41739, 41740, 41741, 
+    41742, 41743, 41744, 41745, 41746, 41747, 41748, 41749, 41750, 41751, 
+    41752, 41753, 41754, 41755, 41756, 41757, 41758, 41759, 41760, 41761, 
+    41762, 41763, 41764, 41765, 41766, 41767, 41768, 41769, 41770, 41771, 
+    41772, 41773, 41774, 41775, 41776, 41777, 41778, 41779, 41780, 41781, 
+    41782, 41783, 41784, 41785, 41786, 41787, 41788, 41789, 41790, 41791, 
+    41792, 41793, 41794, 41795, 41796, 41797, 41798, 41799, 41800, 41801, 
+    41802, 41803, 41804, 41805, 41806, 41807, 41808, 41809, 41810, 41811, 
+    41812, 41813, 41814, 41815, 41816, 41817, 41818, 41819, 41820, 41821, 
+    41822, 41823, 41824, 41825, 41826, 41827, 41828, 41829, 41830, 41831, 
+    41832, 41833, 41834, 41835, 41836, 41837, 41838, 41839, 41840, 41841, 
+    41842, 41843, 41844, 41845, 41846, 41847, 41848, 41849, 41850, 41851, 
+    41852, 41853, 41854, 41855, 41856, 41857, 41858, 41859, 41860, 41861, 
+    41862, 41863, 41864, 41865, 41866, 41867, 41868, 41869, 41870, 41871, 
+    41872, 41873, 41874, 41875, 41876, 41877, 41878, 41879, 41880, 41881, 
+    41882, 41883, 41884, 41885, 41886, 41887, 41888, 41889, 41890, 41891, 
+    41892, 41893, 41894, 41895, 41896, 41897, 41898, 41899, 41900, 41901, 
+    41902, 41903, 41904, 41905, 41906, 41907, 41908, 41909, 41910, 41911, 
+    41912, 41913, 41914, 41915, 41916, 41917, 41918, 41919, 41920, 41921, 
+    41922, 41923, 41924, 41925, 41926, 41927, 41928, 41929, 41930, 41931, 
+    41932, 41933, 41934, 41935, 41936, 41937, 41938, 41939, 41940, 41941, 
+    41942, 41943, 41944, 41945, 41946, 41947, 41948, 41949, 41950, 41951, 
+    41952, 41953, 41954, 41955, 41956, 41957, 41958, 41959, 41960, 41961, 
+    41962, 41963, 41964, 41965, 41966, 41967, 41968, 41969, 41970, 41971, 
+    41972, 41973, 41974, 41975, 41976, 41977, 41978, 41979, 41980, 41981, 
+    41982, 41983, 41984, 41985, 41986, 41987, 41988, 41989, 41990, 41991, 
+    41992, 41993, 41994, 41995, 41996, 41997, 41998, 41999, 42000, 42001, 
+    42002, 42003, 42004, 42005, 42006, 42007, 42008, 42009, 42010, 42011, 
+    42012, 42013, 42014, 42015, 42016, 42017, 42018, 42019, 42020, 42021, 
+    42022, 42023, 42024, 42025, 42026, 42027, 42028, 42029, 42030, 42031, 
+    42032, 42033, 42034, 42035, 42036, 42037, 42038, 42039, 42040, 42041, 
+    42042, 42043, 42044, 42045, 42046, 42047, 42048, 42049, 42050, 42051, 
+    42052, 42053, 42054, 42055, 42056, 42057, 42058, 42059, 42060, 42061, 
+    42062, 42063, 42064, 42065, 42066, 42067, 42068, 42069, 42070, 42071, 
+    42072, 42073, 42074, 42075, 42076, 42077, 42078, 42079, 42080, 42081, 
+    42082, 42083, 42084, 42085, 42086, 42087, 42088, 42089, 42090, 42091, 
+    42092, 42093, 42094, 42095, 42096, 42097, 42098, 42099, 42100, 42101, 
+    42102, 42103, 42104, 42105, 42106, 42107, 42108, 42109, 42110, 42111, 
+    42112, 42113, 42114, 42115, 42116, 42117, 42118, 42119, 42120, 42121, 
+    42122, 42123, 42124, 42125, 42126, 42127, 42128, 42129, 42130, 42131, 
+    42132, 42133, 42134, 42135, 42136, 42137, 42138, 42139, 42140, 42141, 
+    42142, 42143, 42144, 42145, 42146, 42147, 42148, 42149, 42150, 42151, 
+    42152, 42153, 42154, 42155, 42156, 42157, 42158, 42159, 42160, 42161, 
+    42162, 42163, 42164, 42165, 42166, 42167, 42168, 42169, 42170, 42171, 
+    42172, 42173, 42174, 42175, 42176, 42177, 42178, 42179, 42180, 42181, 
+    42182, 42183, 42184, 42185, 42186, 42187, 42188, 42189, 42190, 42191, 
+    42192, 42193, 42194, 42195, 42196, 42197, 42198, 42199, 42200, 42201, 
+    42202, 42203, 42204, 42205, 42206, 42207, 42208, 42209, 42210, 42211, 
+    42212, 42213, 42214, 42215, 42216, 42217, 42218, 42219, 42220, 42221, 
+    42222, 42223, 42224, 42225, 42226, 42227, 42228, 42229, 42230, 42231, 
+    42232, 42233, 42234, 42235, 42236, 42237, 42238, 42239, 42240, 42241, 
+    42242, 42243, 42244, 42245, 42246, 42247, 42248, 42249, 42250, 42251, 
+    42252, 42253, 42254, 42255, 42256, 42257, 42258, 42259, 42260, 42261, 
+    42262, 42263, 42264, 42265, 42266, 42267, 42268, 42269, 42270, 42271, 
+    42272, 42273, 42274, 42275, 42276, 42277, 42278, 42279, 42280, 42281, 
+    42282, 42283, 42284, 42285, 42286, 42287, 42288, 42289, 42290, 42291, 
+    42292, 42293, 42294, 42295, 42296, 42297, 42298, 42299, 42300, 42301, 
+    42302, 42303, 42304, 42305, 42306, 42307, 42308, 42309, 42310, 42311, 
+    42312, 42313, 42314, 42315, 42316, 42317, 42318, 42319, 42320, 42321, 
+    42322, 42323, 42324, 42325, 42326, 42327, 42328, 42329, 42330, 42331, 
+    42332, 42333, 42334, 42335, 42336, 42337, 42338, 42339, 42340, 42341, 
+    42342, 42343, 42344, 42345, 42346, 42347, 42348, 42349, 42350, 42351, 
+    42352, 42353, 42354, 42355, 42356, 42357, 42358, 42359, 42360, 42361, 
+    42362, 42363, 42364, 42365, 42366, 42367, 42368, 42369, 42370, 42371, 
+    42372, 42373, 42374, 42375, 42376, 42377, 42378, 42379, 42380, 42381, 
+    42382, 42383, 42384, 42385, 42386, 42387, 42388, 42389, 42390, 42391, 
+    42392, 42393, 42394, 42395, 42396, 42397, 42398, 42399, 42400, 42401, 
+    42402, 42403, 42404, 42405, 42406, 42407, 42408, 42409, 42410, 42411, 
+    42412, 42413, 42414, 42415, 42416, 42417, 42418, 42419, 42420, 42421, 
+    42422, 42423, 42424, 42425, 42426, 42427, 42428, 42429, 42430, 42431, 
+    42432, 42433, 42434, 42435, 42436, 42437, 42438, 42439, 42440, 42441, 
+    42442, 42443, 42444, 42445, 42446, 42447, 42448, 42449, 42450, 42451, 
+    42452, 42453, 42454, 42455, 42456, 42457, 42458, 42459, 42460, 42461, 
+    42462, 42463, 42464, 42465, 42466, 42467, 42468, 42469, 42470, 42471, 
+    42472, 42473, 42474, 42475, 42476, 42477, 42478, 42479, 42480, 42481, 
+    42482, 42483, 42484, 42485, 42486, 42487, 42488, 42489, 42490, 42491, 
+    42492, 42493, 42494, 42495, 42496, 42497, 42498, 42499, 42500, 42501, 
+    42502, 42503, 42504, 42505, 42506, 42507, 42508, 42509, 42510, 42511, 
+    42512, 42513, 42514, 42515, 42516, 42517, 42518, 42519, 42520, 42521, 
+    42522, 42523, 42524, 42525, 42526, 42527, 42528, 42529, 42530, 42531, 
+    42532, 42533, 42534, 42535, 42536, 42537, 42538, 42539, 42540, 42541, 
+    42542, 42543, 42544, 42545, 42546, 42547, 42548, 42549, 42550, 42551, 
+    42552, 42553, 42554, 42555, 42556, 42557, 42558, 42559, 42560, 42561, 
+    42562, 42563, 42564, 42565, 42566, 42567, 42568, 42569, 42570, 42571, 
+    42572, 42573, 42574, 42575, 42576, 42577, 42578, 42579, 42580, 42581, 
+    42582, 42583, 42584, 42585, 42586, 42587, 42588, 42589, 42590, 42591, 
+    42592, 42593, 42594, 42595, 42596, 42597, 42598, 42599, 42600, 42601, 
+    42602, 42603, 42604, 42605, 42606, 42607, 42608, 42609, 42610, 42611, 
+    42612, 42613, 42614, 42615, 42616, 42617, 42618, 42619, 42620, 42621, 
+    42622, 42623, 42624, 42625, 42626, 42627, 42628, 42629, 42630, 42631, 
+    42632, 42633, 42634, 42635, 42636, 42637, 42638, 42639, 42640, 42641, 
+    42642, 42643, 42644, 42645, 42646, 42647, 42648, 42649, 42650, 42651, 
+    42652, 42653, 42654, 42655, 42656, 42657, 42658, 42659, 42660, 42661, 
+    42662, 42663, 42664, 42665, 42666, 42667, 42668, 42669, 42670, 42671, 
+    42672, 42673, 42674, 42675, 42676, 42677, 42678, 42679, 42680, 42681, 
+    42682, 42683, 42684, 42685, 42686, 42687, 42688, 42689, 42690, 42691, 
+    42692, 42693, 42694, 42695, 42696, 42697, 42698, 42699, 42700, 42701, 
+    42702, 42703, 42704, 42705, 42706, 42707, 42708, 42709, 42710, 42711, 
+    42712, 42713, 42714, 42715, 42716, 42717, 42718, 42719, 42720, 42721, 
+    42722, 42723, 42724, 42725, 42726, 42727, 42728, 42729, 42730, 42731, 
+    42732, 42733, 42734, 42735, 42736, 42737, 42738, 42739, 42740, 42741, 
+    42742, 42743, 42744, 42745, 42746, 42747, 42748, 42749, 42750, 42751, 
+    42752, 42753, 42754, 42755, 42756, 42757, 42758, 42759, 42760, 42761, 
+    42762, 42763, 42764, 42765, 42766, 42767, 42768, 42769, 42770, 42771, 
+    42772, 42773, 42774, 42775, 42776, 42777, 42778, 42779, 42780, 42781, 
+    42782, 42783, 42784, 42785, 42786, 42787, 42788, 42789, 42790, 42791, 
+    42792, 42793, 42794, 42795, 42796, 42797, 42798, 42799, 42800, 42801, 
+    42802, 42803, 42804, 42805, 42806, 42807, 42808, 42809, 42810, 42811, 
+    42812, 42813, 42814, 42815, 42816, 42817, 42818, 42819, 42820, 42821, 
+    42822, 42823, 42824, 42825, 42826, 42827, 42828, 42829, 42830, 42831, 
+    42832, 42833, 42834, 42835, 42836, 42837, 42838, 42839, 42840, 42841, 
+    42842, 42843, 42844, 42845, 42846, 42847, 42848, 42849, 42850, 42851, 
+    42852, 42853, 42854, 42855, 42856, 42857, 42858, 42859, 42860, 42861, 
+    42862, 42863, 42864, 42865, 42866, 42867, 42868, 42869, 42870, 42871, 
+    42872, 42873, 42874, 42875, 42876, 42877, 42878, 42879, 42880, 42881, 
+    42882, 42883, 42884, 42885, 42886, 42887, 42888, 42889, 42890, 42891, 
+    42892, 42893, 42894, 42895, 42896, 42897, 42898, 42899, 42900, 42901, 
+    42902, 42903, 42904, 42905, 42906, 42907, 42908, 42909, 42910, 42911, 
+    42912, 42913, 42914, 42915, 42916, 42917, 42918, 42919, 42920, 42921, 
+    42922, 42923, 42924, 42925, 42926, 42927, 42928, 42929, 42930, 42931, 
+    42932, 42933, 42934, 42935, 42936, 42937, 42938, 42939, 42940, 42941, 
+    42942, 42943, 42944, 42945, 42946, 42947, 42948, 42949, 42950, 42951, 
+    42952, 42953, 42954, 42955, 42956, 42957, 42958, 42959, 42960, 42961, 
+    42962, 42963, 42964, 42965, 42966, 42967, 42968, 42969, 42970, 42971, 
+    42972, 42973, 42974, 42975, 42976, 42977, 42978, 42979, 42980, 42981, 
+    42982, 42983, 42984, 42985, 42986, 42987, 42988, 42989, 42990, 42991, 
+    42992, 42993, 42994, 42995, 42996, 42997, 42998, 42999, 43000, 43001, 
+    43002, 43003, 43004, 43005, 43006, 43007, 43008, 43009, 43010, 43011, 
+    43012, 43013, 43014, 43015, 43016, 43017, 43018, 43019, 43020, 43021, 
+    43022, 43023, 43024, 43025, 43026, 43027, 43028, 43029, 43030, 43031, 
+    43032, 43033, 43034, 43035, 43036, 43037, 43038, 43039, 43040, 43041, 
+    43042, 43043, 43044, 43045, 43046, 43047, 43048, 43049, 43050, 43051, 
+    43052, 43053, 43054, 43055, 43056, 43057, 43058, 43059, 43060, 43061, 
+    43062, 43063, 43064, 43065, 43066, 43067, 43068, 43069, 43070, 43071, 
+    43072, 43073, 43074, 43075, 43076, 43077, 43078, 43079, 43080, 43081, 
+    43082, 43083, 43084, 43085, 43086, 43087, 43088, 43089, 43090, 43091, 
+    43092, 43093, 43094, 43095, 43096, 43097, 43098, 43099, 43100, 43101, 
+    43102, 43103, 43104, 43105, 43106, 43107, 43108, 43109, 43110, 43111, 
+    43112, 43113, 43114, 43115, 43116, 43117, 43118, 43119, 43120, 43121, 
+    43122, 43123, 43124, 43125, 43126, 43127, 43128, 43129, 43130, 43131, 
+    43132, 43133, 43134, 43135, 43136, 43137, 43138, 43139, 43140, 43141, 
+    43142, 43143, 43144, 43145, 43146, 43147, 43148, 43149, 43150, 43151, 
+    43152, 43153, 43154, 43155, 43156, 43157, 43158, 43159, 43160, 43161, 
+    43162, 43163, 43164, 43165, 43166, 43167, 43168, 43169, 43170, 43171, 
+    43172, 43173, 43174, 43175, 43176, 43177, 43178, 43179, 43180, 43181, 
+    43182, 43183, 43184, 43185, 43186, 43187, 43188, 43189, 43190, 43191, 
+    43192, 43193, 43194, 43195, 43196, 43197, 43198, 43199, 43200, 43201, 
+    43202, 43203, 43204, 43205, 43206, 43207, 43208, 43209, 43210, 43211, 
+    43212, 43213, 43214, 43215, 43216, 43217, 43218, 43219, 43220, 43221, 
+    43222, 43223, 43224, 43225, 43226, 43227, 43228, 43229, 43230, 43231, 
+    43232, 43233, 43234, 43235, 43236, 43237, 43238, 43239, 43240, 43241, 
+    43242, 43243, 43244, 43245, 43246, 43247, 43248, 43249, 43250, 43251, 
+    43252, 43253, 43254, 43255, 43256, 43257, 43258, 43259, 43260, 43261, 
+    43262, 43263, 43264, 43265, 43266, 43267, 43268, 43269, 43270, 43271, 
+    43272, 43273, 43274, 43275, 43276, 43277, 43278, 43279, 43280, 43281, 
+    43282, 43283, 43284, 43285, 43286, 43287, 43288, 43289, 43290, 43291, 
+    43292, 43293, 43294, 43295, 43296, 43297, 43298, 43299, 43300, 43301, 
+    43302, 43303, 43304, 43305, 43306, 43307, 43308, 43309, 43310, 43311, 
+    43312, 43313, 43314, 43315, 43316, 43317, 43318, 43319, 43320, 43321, 
+    43322, 43323, 43324, 43325, 43326, 43327, 43328, 43329, 43330, 43331, 
+    43332, 43333, 43334, 43335, 43336, 43337, 43338, 43339, 43340, 43341, 
+    43342, 43343, 43344, 43345, 43346, 43347, 43348, 43349, 43350, 43351, 
+    43352, 43353, 43354, 43355, 43356, 43357, 43358, 43359, 43360, 43361, 
+    43362, 43363, 43364, 43365, 43366, 43367, 43368, 43369, 43370, 43371, 
+    43372, 43373, 43374, 43375, 43376, 43377, 43378, 43379, 43380, 43381, 
+    43382, 43383, 43384, 43385, 43386, 43387, 43388, 43389, 43390, 43391, 
+    43392, 43393, 43394, 43395, 43396, 43397, 43398, 43399, 43400, 43401, 
+    43402, 43403, 43404, 43405, 43406, 43407, 43408, 43409, 43410, 43411, 
+    43412, 43413, 43414, 43415, 43416, 43417, 43418, 43419, 43420, 43421, 
+    43422, 43423, 43424, 43425, 43426, 43427, 43428, 43429, 43430, 43431, 
+    43432, 43433, 43434, 43435, 43436, 43437, 43438, 43439, 43440, 43441, 
+    43442, 43443, 43444, 43445, 43446, 43447, 43448, 43449, 43450, 43451, 
+    43452, 43453, 43454, 43455, 43456, 43457, 43458, 43459, 43460, 43461, 
+    43462, 43463, 43464, 43465, 43466, 43467, 43468, 43469, 43470, 43471, 
+    43472, 43473, 43474, 43475, 43476, 43477, 43478, 43479, 43480, 43481, 
+    43482, 43483, 43484, 43485, 43486, 43487, 43488, 43489, 43490, 43491, 
+    43492, 43493, 43494, 43495, 43496, 43497, 43498, 43499, 43500, 43501, 
+    43502, 43503, 43504, 43505, 43506, 43507, 43508, 43509, 43510, 43511, 
+    43512, 43513, 43514, 43515, 43516, 43517, 43518, 43519, 43520, 43521, 
+    43522, 43523, 43524, 43525, 43526, 43527, 43528, 43529, 43530, 43531, 
+    43532, 43533, 43534, 43535, 43536, 43537, 43538, 43539, 43540, 43541, 
+    43542, 43543, 43544, 43545, 43546, 43547, 43548, 43549, 43550, 43551, 
+    43552, 43553, 43554, 43555, 43556, 43557, 43558, 43559, 43560, 43561, 
+    43562, 43563, 43564, 43565, 43566, 43567, 43568, 43569, 43570, 43571, 
+    43572, 43573, 43574, 43575, 43576, 43577, 43578, 43579, 43580, 43581, 
+    43582, 43583, 43584, 43585, 43586, 43587, 43588, 43589, 43590, 43591, 
+    43592, 43593, 43594, 43595, 43596, 43597, 43598, 43599, 43600, 43601, 
+    43602, 43603, 43604, 43605, 43606, 43607, 43608, 43609, 43610, 43611, 
+    43612, 43613, 43614, 43615, 43616, 43617, 43618, 43619, 43620, 43621, 
+    43622, 43623, 43624, 43625, 43626, 43627, 43628, 43629, 43630, 43631, 
+    43632, 43633, 43634, 43635, 43636, 43637, 43638, 43639, 43640, 43641, 
+    43642, 43643, 43644, 43645, 43646, 43647, 43648, 43649, 43650, 43651, 
+    43652, 43653, 43654, 43655, 43656, 43657, 43658, 43659, 43660, 43661, 
+    43662, 43663, 43664, 43665, 43666, 43667, 43668, 43669, 43670, 43671, 
+    43672, 43673, 43674, 43675, 43676, 43677, 43678, 43679, 43680, 43681, 
+    43682, 43683, 43684, 43685, 43686, 43687, 43688, 43689, 43690, 43691, 
+    43692, 43693, 43694, 43695, 43696, 43697, 43698, 43699, 43700, 43701, 
+    43702, 43703, 43704, 43705, 43706, 43707, 43708, 43709, 43710, 43711, 
+    43712, 43713, 43714, 43715, 43716, 43717, 43718, 43719, 43720, 43721, 
+    43722, 43723, 43724, 43725, 43726, 43727, 43728, 43729, 43730, 43731, 
+    43732, 43733, 43734, 43735, 43736, 43737, 43738, 43739, 43740, 43741, 
+    43742, 43743, 43744, 43745, 43746, 43747, 43748, 43749, 43750, 43751, 
+    43752, 43753, 43754, 43755, 43756, 43757, 43758, 43759, 43760, 43761, 
+    43762, 43763, 43764, 43765, 43766, 43767, 43768, 43769, 43770, 43771, 
+    43772, 43773, 43774, 43775, 43776, 43777, 43778, 43779, 43780, 43781, 
+    43782, 43783, 43784, 43785, 43786, 43787, 43788, 43789, 43790, 43791, 
+    43792, 43793, 43794, 43795, 43796, 43797, 43798, 43799, 43800, 43801, 
+    43802, 43803, 43804, 43805, 43806, 43807, 43808, 43809, 43810, 43811, 
+    43812, 43813, 43814, 43815, 43816, 43817, 43818, 43819, 43820, 43821, 
+    43822, 43823, 43824, 43825, 43826, 43827, 43828, 43829, 43830, 43831, 
+    43832, 43833, 43834, 43835, 43836, 43837, 43838, 43839, 43840, 43841, 
+    43842, 43843, 43844, 43845, 43846, 43847, 43848, 43849, 43850, 43851, 
+    43852, 43853, 43854, 43855, 43856, 43857, 43858, 43859, 43860, 43861, 
+    43862, 43863, 43864, 43865, 43866, 43867, 43868, 43869, 43870, 43871, 
+    43872, 43873, 43874, 43875, 43876, 43877, 43878, 43879, 43880, 43881, 
+    43882, 43883, 43884, 43885, 43886, 43887, 43888, 43889, 43890, 43891, 
+    43892, 43893, 43894, 43895, 43896, 43897, 43898, 43899, 43900, 43901, 
+    43902, 43903, 43904, 43905, 43906, 43907, 43908, 43909, 43910, 43911, 
+    43912, 43913, 43914, 43915, 43916, 43917, 43918, 43919, 43920, 43921, 
+    43922, 43923, 43924, 43925, 43926, 43927, 43928, 43929, 43930, 43931, 
+    43932, 43933, 43934, 43935, 43936, 43937, 43938, 43939, 43940, 43941, 
+    43942, 43943, 43944, 43945, 43946, 43947, 43948, 43949, 43950, 43951, 
+    43952, 43953, 43954, 43955, 43956, 43957, 43958, 43959, 43960, 43961, 
+    43962, 43963, 43964, 43965, 43966, 43967, 43968, 43969, 43970, 43971, 
+    43972, 43973, 43974, 43975, 43976, 43977, 43978, 43979, 43980, 43981, 
+    43982, 43983, 43984, 43985, 43986, 43987, 43988, 43989, 43990, 43991, 
+    43992, 43993, 43994, 43995, 43996, 43997, 43998, 43999, 44000, 44001, 
+    44002, 44003, 44004, 44005, 44006, 44007, 44008, 44009, 44010, 44011, 
+    44012, 44013, 44014, 44015, 44016, 44017, 44018, 44019, 44020, 44021, 
+    44022, 44023, 44024, 44025, 44026, 44027, 44028, 44029, 44030, 44031, 
+    44032, 44033, 44034, 44035, 44036, 44037, 44038, 44039, 44040, 44041, 
+    44042, 44043, 44044, 44045, 44046, 44047, 44048, 44049, 44050, 44051, 
+    44052, 44053, 44054, 44055, 44056, 44057, 44058, 44059, 44060, 44061, 
+    44062, 44063, 44064, 44065, 44066, 44067, 44068, 44069, 44070, 44071, 
+    44072, 44073, 44074, 44075, 44076, 44077, 44078, 44079, 44080, 44081, 
+    44082, 44083, 44084, 44085, 44086, 44087, 44088, 44089, 44090, 44091, 
+    44092, 44093, 44094, 44095, 44096, 44097, 44098, 44099, 44100, 44101, 
+    44102, 44103, 44104, 44105, 44106, 44107, 44108, 44109, 44110, 44111, 
+    44112, 44113, 44114, 44115, 44116, 44117, 44118, 44119, 44120, 44121, 
+    44122, 44123, 44124, 44125, 44126, 44127, 44128, 44129, 44130, 44131, 
+    44132, 44133, 44134, 44135, 44136, 44137, 44138, 44139, 44140, 44141, 
+    44142, 44143, 44144, 44145, 44146, 44147, 44148, 44149, 44150, 44151, 
+    44152, 44153, 44154, 44155, 44156, 44157, 44158, 44159, 44160, 44161, 
+    44162, 44163, 44164, 44165, 44166, 44167, 44168, 44169, 44170, 44171, 
+    44172, 44173, 44174, 44175, 44176, 44177, 44178, 44179, 44180, 44181, 
+    44182, 44183, 44184, 44185, 44186, 44187, 44188, 44189, 44190, 44191, 
+    44192, 44193, 44194, 44195, 44196, 44197, 44198, 44199, 44200, 44201, 
+    44202, 44203, 44204, 44205, 44206, 44207, 44208, 44209, 44210, 44211, 
+    44212, 44213, 44214, 44215, 44216, 44217, 44218, 44219, 44220, 44221, 
+    44222, 44223, 44224, 44225, 44226, 44227, 44228, 44229, 44230, 44231, 
+    44232, 44233, 44234, 44235, 44236, 44237, 44238, 44239, 44240, 44241, 
+    44242, 44243, 44244, 44245, 44246, 44247, 44248, 44249, 44250, 44251, 
+    44252, 44253, 44254, 44255, 44256, 44257, 44258, 44259, 44260, 44261, 
+    44262, 44263, 44264, 44265, 44266, 44267, 44268, 44269, 44270, 44271, 
+    44272, 44273, 44274, 44275, 44276, 44277, 44278, 44279, 44280, 44281, 
+    44282, 44283, 44284, 44285, 44286, 44287, 44288, 44289, 44290, 44291, 
+    44292, 44293, 44294, 44295, 44296, 44297, 44298, 44299, 44300, 44301, 
+    44302, 44303, 44304, 44305, 44306, 44307, 44308, 44309, 44310, 44311, 
+    44312, 44313, 44314, 44315, 44316, 44317, 44318, 44319, 44320, 44321, 
+    44322, 44323, 44324, 44325, 44326, 44327, 44328, 44329, 44330, 44331, 
+    44332, 44333, 44334, 44335, 44336, 44337, 44338, 44339, 44340, 44341, 
+    44342, 44343, 44344, 44345, 44346, 44347, 44348, 44349, 44350, 44351, 
+    44352, 44353, 44354, 44355, 44356, 44357, 44358, 44359, 44360, 44361, 
+    44362, 44363, 44364, 44365, 44366, 44367, 44368, 44369, 44370, 44371, 
+    44372, 44373, 44374, 44375, 44376, 44377, 44378, 44379, 44380, 44381, 
+    44382, 44383, 44384, 44385, 44386, 44387, 44388, 44389, 44390, 44391, 
+    44392, 44393, 44394, 44395, 44396, 44397, 44398, 44399, 44400, 44401, 
+    44402, 44403, 44404, 44405, 44406, 44407, 44408, 44409, 44410, 44411, 
+    44412, 44413, 44414, 44415, 44416, 44417, 44418, 44419, 44420, 44421, 
+    44422, 44423, 44424, 44425, 44426, 44427, 44428, 44429, 44430, 44431, 
+    44432, 44433, 44434, 44435, 44436, 44437, 44438, 44439, 44440, 44441, 
+    44442, 44443, 44444, 44445, 44446, 44447, 44448, 44449, 44450, 44451, 
+    44452, 44453, 44454, 44455, 44456, 44457, 44458, 44459, 44460, 44461, 
+    44462, 44463, 44464, 44465, 44466, 44467, 44468, 44469, 44470, 44471, 
+    44472, 44473, 44474, 44475, 44476, 44477, 44478, 44479, 44480, 44481, 
+    44482, 44483, 44484, 44485, 44486, 44487, 44488, 44489, 44490, 44491, 
+    44492, 44493, 44494, 44495, 44496, 44497, 44498, 44499, 44500, 44501, 
+    44502, 44503, 44504, 44505, 44506, 44507, 44508, 44509, 44510, 44511, 
+    44512, 44513, 44514, 44515, 44516, 44517, 44518, 44519, 44520, 44521, 
+    44522, 44523, 44524, 44525, 44526, 44527, 44528, 44529, 44530, 44531, 
+    44532, 44533, 44534, 44535, 44536, 44537, 44538, 44539, 44540, 44541, 
+    44542, 44543, 44544, 44545, 44546, 44547, 44548, 44549, 44550, 44551, 
+    44552, 44553, 44554, 44555, 44556, 44557, 44558, 44559, 44560, 44561, 
+    44562, 44563, 44564, 44565, 44566, 44567, 44568, 44569, 44570, 44571, 
+    44572, 44573, 44574, 44575, 44576, 44577, 44578, 44579, 44580, 44581, 
+    44582, 44583, 44584, 44585, 44586, 44587, 44588, 44589, 44590, 44591, 
+    44592, 44593, 44594, 44595, 44596, 44597, 44598, 44599, 44600, 44601, 
+    44602, 44603, 44604, 44605, 44606, 44607, 44608, 44609, 44610, 44611, 
+    44612, 44613, 44614, 44615, 44616, 44617, 44618, 44619, 44620, 44621, 
+    44622, 44623, 44624, 44625, 44626, 44627, 44628, 44629, 44630, 44631, 
+    44632, 44633, 44634, 44635, 44636, 44637, 44638, 44639, 44640, 44641, 
+    44642, 44643, 44644, 44645, 44646, 44647, 44648, 44649, 44650, 44651, 
+    44652, 44653, 44654, 44655, 44656, 44657, 44658, 44659, 44660, 44661, 
+    44662, 44663, 44664, 44665, 44666, 44667, 44668, 44669, 44670, 44671, 
+    44672, 44673, 44674, 44675, 44676, 44677, 44678, 44679, 44680, 44681, 
+    44682, 44683, 44684, 44685, 44686, 44687, 44688, 44689, 44690, 44691, 
+    44692, 44693, 44694, 44695, 44696, 44697, 44698, 44699, 44700, 44701, 
+    44702, 44703, 44704, 44705, 44706, 44707, 44708, 44709, 44710, 44711, 
+    44712, 44713, 44714, 44715, 44716, 44717, 44718, 44719, 44720, 44721, 
+    44722, 44723, 44724, 44725, 44726, 44727, 44728, 44729, 44730, 44731, 
+    44732, 44733, 44734, 44735, 44736, 44737, 44738, 44739, 44740, 44741, 
+    44742, 44743, 44744, 44745, 44746, 44747, 44748, 44749, 44750, 44751, 
+    44752, 44753, 44754, 44755, 44756, 44757, 44758, 44759, 44760, 44761, 
+    44762, 44763, 44764, 44765, 44766, 44767, 44768, 44769, 44770, 44771, 
+    44772, 44773, 44774, 44775, 44776, 44777, 44778, 44779, 44780, 44781, 
+    44782, 44783, 44784, 44785, 44786, 44787, 44788, 44789, 44790, 44791, 
+    44792, 44793, 44794, 44795, 44796, 44797, 44798, 44799, 44800, 44801, 
+    44802, 44803, 44804, 44805, 44806, 44807, 44808, 44809, 44810, 44811, 
+    44812, 44813, 44814, 44815, 44816, 44817, 44818, 44819, 44820, 44821, 
+    44822, 44823, 44824, 44825, 44826, 44827, 44828, 44829, 44830, 44831, 
+    44832, 44833, 44834, 44835, 44836, 44837, 44838, 44839, 44840, 44841, 
+    44842, 44843, 44844, 44845, 44846, 44847, 44848, 44849, 44850, 44851, 
+    44852, 44853, 44854, 44855, 44856, 44857, 44858, 44859, 44860, 44861, 
+    44862, 44863, 44864, 44865, 44866, 44867, 44868, 44869, 44870, 44871, 
+    44872, 44873, 44874, 44875, 44876, 44877, 44878, 44879, 44880, 44881, 
+    44882, 44883, 44884, 44885, 44886, 44887, 44888, 44889, 44890, 44891, 
+    44892, 44893, 44894, 44895, 44896, 44897, 44898, 44899, 44900, 44901, 
+    44902, 44903, 44904, 44905, 44906, 44907, 44908, 44909, 44910, 44911, 
+    44912, 44913, 44914, 44915, 44916, 44917, 44918, 44919, 44920, 44921, 
+    44922, 44923, 44924, 44925, 44926, 44927, 44928, 44929, 44930, 44931, 
+    44932, 44933, 44934, 44935, 44936, 44937, 44938, 44939, 44940, 44941, 
+    44942, 44943, 44944, 44945, 44946, 44947, 44948, 44949, 44950, 44951, 
+    44952, 44953, 44954, 44955, 44956, 44957, 44958, 44959, 44960, 44961, 
+    44962, 44963, 44964, 44965, 44966, 44967, 44968, 44969, 44970, 44971, 
+    44972, 44973, 44974, 44975, 44976, 44977, 44978, 44979, 44980, 44981, 
+    44982, 44983, 44984, 44985, 44986, 44987, 44988, 44989, 44990, 44991, 
+    44992, 44993, 44994, 44995, 44996, 44997, 44998, 44999, 45000, 45001, 
+    45002, 45003, 45004, 45005, 45006, 45007, 45008, 45009, 45010, 45011, 
+    45012, 45013, 45014, 45015, 45016, 45017, 45018, 45019, 45020, 45021, 
+    45022, 45023, 45024, 45025, 45026, 45027, 45028, 45029, 45030, 45031, 
+    45032, 45033, 45034, 45035, 45036, 45037, 45038, 45039, 45040, 45041, 
+    45042, 45043, 45044, 45045, 45046, 45047, 45048, 45049, 45050, 45051, 
+    45052, 45053, 45054, 45055, 45056, 45057, 45058, 45059, 45060, 45061, 
+    45062, 45063, 45064, 45065, 45066, 45067, 45068, 45069, 45070, 45071, 
+    45072, 45073, 45074, 45075, 45076, 45077, 45078, 45079, 45080, 45081, 
+    45082, 45083, 45084, 45085, 45086, 45087, 45088, 45089, 45090, 45091, 
+    45092, 45093, 45094, 45095, 45096, 45097, 45098, 45099, 45100, 45101, 
+    45102, 45103, 45104, 45105, 45106, 45107, 45108, 45109, 45110, 45111, 
+    45112, 45113, 45114, 45115, 45116, 45117, 45118, 45119, 45120, 45121, 
+    45122, 45123, 45124, 45125, 45126, 45127, 45128, 45129, 45130, 45131, 
+    45132, 45133, 45134, 45135, 45136, 45137, 45138, 45139, 45140, 45141, 
+    45142, 45143, 45144, 45145, 45146, 45147, 45148, 45149, 45150, 45151, 
+    45152, 45153, 45154, 45155, 45156, 45157, 45158, 45159, 45160, 45161, 
+    45162, 45163, 45164, 45165, 45166, 45167, 45168, 45169, 45170, 45171, 
+    45172, 45173, 45174, 45175, 45176, 45177, 45178, 45179, 45180, 45181, 
+    45182, 45183, 45184, 45185, 45186, 45187, 45188, 45189, 45190, 45191, 
+    45192, 45193, 45194, 45195, 45196, 45197, 45198, 45199, 45200, 45201, 
+    45202, 45203, 45204, 45205, 45206, 45207, 45208, 45209, 45210, 45211, 
+    45212, 45213, 45214, 45215, 45216, 45217, 45218, 45219, 45220, 45221, 
+    45222, 45223, 45224, 45225, 45226, 45227, 45228, 45229, 45230, 45231, 
+    45232, 45233, 45234, 45235, 45236, 45237, 45238, 45239, 45240, 45241, 
+    45242, 45243, 45244, 45245, 45246, 45247, 45248, 45249, 45250, 45251, 
+    45252, 45253, 45254, 45255, 45256, 45257, 45258, 45259, 45260, 45261, 
+    45262, 45263, 45264, 45265, 45266, 45267, 45268, 45269, 45270, 45271, 
+    45272, 45273, 45274, 45275, 45276, 45277, 45278, 45279, 45280, 45281, 
+    45282, 45283, 45284, 45285, 45286, 45287, 45288, 45289, 45290, 45291, 
+    45292, 45293, 45294, 45295, 45296, 45297, 45298, 45299, 45300, 45301, 
+    45302, 45303, 45304, 45305, 45306, 45307, 45308, 45309, 45310, 45311, 
+    45312, 45313, 45314, 45315, 45316, 45317, 45318, 45319, 45320, 45321, 
+    45322, 45323, 45324, 45325, 45326, 45327, 45328, 45329, 45330, 45331, 
+    45332, 45333, 45334, 45335, 45336, 45337, 45338, 45339, 45340, 45341, 
+    45342, 45343, 45344, 45345, 45346, 45347, 45348, 45349, 45350, 45351, 
+    45352, 45353, 45354, 45355, 45356, 45357, 45358, 45359, 45360, 45361, 
+    45362, 45363, 45364, 45365, 45366, 45367, 45368, 45369, 45370, 45371, 
+    45372, 45373, 45374, 45375, 45376, 45377, 45378, 45379, 45380, 45381, 
+    45382, 45383, 45384, 45385, 45386, 45387, 45388, 45389, 45390, 45391, 
+    45392, 45393, 45394, 45395, 45396, 45397, 45398, 45399, 45400, 45401, 
+    45402, 45403, 45404, 45405, 45406, 45407, 45408, 45409, 45410, 45411, 
+    45412, 45413, 45414, 45415, 45416, 45417, 45418, 45419, 45420, 45421, 
+    45422, 45423, 45424, 45425, 45426, 45427, 45428, 45429, 45430, 45431, 
+    45432, 45433, 45434, 45435, 45436, 45437, 45438, 45439, 45440, 45441, 
+    45442, 45443, 45444, 45445, 45446, 45447, 45448, 45449, 45450, 45451, 
+    45452, 45453, 45454, 45455, 45456, 45457, 45458, 45459, 45460, 45461, 
+    45462, 45463, 45464, 45465, 45466, 45467, 45468, 45469, 45470, 45471, 
+    45472, 45473, 45474, 45475, 45476, 45477, 45478, 45479, 45480, 45481, 
+    45482, 45483, 45484, 45485, 45486, 45487, 45488, 45489, 45490, 45491, 
+    45492, 45493, 45494, 45495, 45496, 45497, 45498, 45499, 45500, 45501, 
+    45502, 45503, 45504, 45505, 45506, 45507, 45508, 45509, 45510, 45511, 
+    45512, 45513, 45514, 45515, 45516, 45517, 45518, 45519, 45520, 45521, 
+    45522, 45523, 45524, 45525, 45526, 45527, 45528, 45529, 45530, 45531, 
+    45532, 45533, 45534, 45535, 45536, 45537, 45538, 45539, 45540, 45541, 
+    45542, 45543, 45544, 45545, 45546, 45547, 45548, 45549, 45550, 45551, 
+    45552, 45553, 45554, 45555, 45556, 45557, 45558, 45559, 45560, 45561, 
+    45562, 45563, 45564, 45565, 45566, 45567, 45568, 45569, 45570, 45571, 
+    45572, 45573, 45574, 45575, 45576, 45577, 45578, 45579, 45580, 45581, 
+    45582, 45583, 45584, 45585, 45586, 45587, 45588, 45589, 45590, 45591, 
+    45592, 45593, 45594, 45595, 45596, 45597, 45598, 45599, 45600, 45601, 
+    45602, 45603, 45604, 45605, 45606, 45607, 45608, 45609, 45610, 45611, 
+    45612, 45613, 45614, 45615, 45616, 45617, 45618, 45619, 45620, 45621, 
+    45622, 45623, 45624, 45625, 45626, 45627, 45628, 45629, 45630, 45631, 
+    45632, 45633, 45634, 45635, 45636, 45637, 45638, 45639, 45640, 45641, 
+    45642, 45643, 45644, 45645, 45646, 45647, 45648, 45649, 45650, 45651, 
+    45652, 45653, 45654, 45655, 45656, 45657, 45658, 45659, 45660, 45661, 
+    45662, 45663, 45664, 45665, 45666, 45667, 45668, 45669, 45670, 45671, 
+    45672, 45673, 45674, 45675, 45676, 45677, 45678, 45679, 45680, 45681, 
+    45682, 45683, 45684, 45685, 45686, 45687, 45688, 45689, 45690, 45691, 
+    45692, 45693, 45694, 45695, 45696, 45697, 45698, 45699, 45700, 45701, 
+    45702, 45703, 45704, 45705, 45706, 45707, 45708, 45709, 45710, 45711, 
+    45712, 45713, 45714, 45715, 45716, 45717, 45718, 45719, 45720, 45721, 
+    45722, 45723, 45724, 45725, 45726, 45727, 45728, 45729, 45730, 45731, 
+    45732, 45733, 45734, 45735, 45736, 45737, 45738, 45739, 45740, 45741, 
+    45742, 45743, 45744, 45745, 45746, 45747, 45748, 45749, 45750, 45751, 
+    45752, 45753, 45754, 45755, 45756, 45757, 45758, 45759, 45760, 45761, 
+    45762, 45763, 45764, 45765, 45766, 45767, 45768, 45769, 45770, 45771, 
+    45772, 45773, 45774, 45775, 45776, 45777, 45778, 45779, 45780, 45781, 
+    45782, 45783, 45784, 45785, 45786, 45787, 45788, 45789, 45790, 45791, 
+    45792, 45793, 45794, 45795, 45796, 45797, 45798, 45799, 45800, 45801, 
+    45802, 45803, 45804, 45805, 45806, 45807, 45808, 45809, 45810, 45811, 
+    45812, 45813, 45814, 45815, 45816, 45817, 45818, 45819, 45820, 45821, 
+    45822, 45823, 45824, 45825, 45826, 45827, 45828, 45829, 45830, 45831, 
+    45832, 45833, 45834, 45835, 45836, 45837, 45838, 45839, 45840, 45841, 
+    45842, 45843, 45844, 45845, 45846, 45847, 45848, 45849, 45850, 45851, 
+    45852, 45853, 45854, 45855, 45856, 45857, 45858, 45859, 45860, 45861, 
+    45862, 45863, 45864, 45865, 45866, 45867, 45868, 45869, 45870, 45871, 
+    45872, 45873, 45874, 45875, 45876, 45877, 45878, 45879, 45880, 45881, 
+    45882, 45883, 45884, 45885, 45886, 45887, 45888, 45889, 45890, 45891, 
+    45892, 45893, 45894, 45895, 45896, 45897, 45898, 45899, 45900, 45901, 
+    45902, 45903, 45904, 45905, 45906, 45907, 45908, 45909, 45910, 45911, 
+    45912, 45913, 45914, 45915, 45916, 45917, 45918, 45919, 45920, 45921, 
+    45922, 45923, 45924, 45925, 45926, 45927, 45928, 45929, 45930, 45931, 
+    45932, 45933, 45934, 45935, 45936, 45937, 45938, 45939, 45940, 45941, 
+    45942, 45943, 45944, 45945, 45946, 45947, 45948, 45949, 45950, 45951, 
+    45952, 45953, 45954, 45955, 45956, 45957, 45958, 45959, 45960, 45961, 
+    45962, 45963, 45964, 45965, 45966, 45967, 45968, 45969, 45970, 45971, 
+    45972, 45973, 45974, 45975, 45976, 45977, 45978, 45979, 45980, 45981, 
+    45982, 45983, 45984, 45985, 45986, 45987, 45988, 45989, 45990, 45991, 
+    45992, 45993, 45994, 45995, 45996, 45997, 45998, 45999, 46000, 46001, 
+    46002, 46003, 46004, 46005, 46006, 46007, 46008, 46009, 46010, 46011, 
+    46012, 46013, 46014, 46015, 46016, 46017, 46018, 46019, 46020, 46021, 
+    46022, 46023, 46024, 46025, 46026, 46027, 46028, 46029, 46030, 46031, 
+    46032, 46033, 46034, 46035, 46036, 46037, 46038, 46039, 46040, 46041, 
+    46042, 46043, 46044, 46045, 46046, 46047, 46048, 46049, 46050, 46051, 
+    46052, 46053, 46054, 46055, 46056, 46057, 46058, 46059, 46060, 46061, 
+    46062, 46063, 46064, 46065, 46066, 46067, 46068, 46069, 46070, 46071, 
+    46072, 46073, 46074, 46075, 46076, 46077, 46078, 46079, 46080, 46081, 
+    46082, 46083, 46084, 46085, 46086, 46087, 46088, 46089, 46090, 46091, 
+    46092, 46093, 46094, 46095, 46096, 46097, 46098, 46099, 46100, 46101, 
+    46102, 46103, 46104, 46105, 46106, 46107, 46108, 46109, 46110, 46111, 
+    46112, 46113, 46114, 46115, 46116, 46117, 46118, 46119, 46120, 46121, 
+    46122, 46123, 46124, 46125, 46126, 46127, 46128, 46129, 46130, 46131, 
+    46132, 46133, 46134, 46135, 46136, 46137, 46138, 46139, 46140, 46141, 
+    46142, 46143, 46144, 46145, 46146, 46147, 46148, 46149, 46150, 46151, 
+    46152, 46153, 46154, 46155, 46156, 46157, 46158, 46159, 46160, 46161, 
+    46162, 46163, 46164, 46165, 46166, 46167, 46168, 46169, 46170, 46171, 
+    46172, 46173, 46174, 46175, 46176, 46177, 46178, 46179, 46180, 46181, 
+    46182, 46183, 46184, 46185, 46186, 46187, 46188, 46189, 46190, 46191, 
+    46192, 46193, 46194, 46195, 46196, 46197, 46198, 46199, 46200, 46201, 
+    46202, 46203, 46204, 46205, 46206, 46207, 46208, 46209, 46210, 46211, 
+    46212, 46213, 46214, 46215, 46216, 46217, 46218, 46219, 46220, 46221, 
+    46222, 46223, 46224, 46225, 46226, 46227, 46228, 46229, 46230, 46231, 
+    46232, 46233, 46234, 46235, 46236, 46237, 46238, 46239, 46240, 46241, 
+    46242, 46243, 46244, 46245, 46246, 46247, 46248, 46249, 46250, 46251, 
+    46252, 46253, 46254, 46255, 46256, 46257, 46258, 46259, 46260, 46261, 
+    46262, 46263, 46264, 46265, 46266, 46267, 46268, 46269, 46270, 46271, 
+    46272, 46273, 46274, 46275, 46276, 46277, 46278, 46279, 46280, 46281, 
+    46282, 46283, 46284, 46285, 46286, 46287, 46288, 46289, 46290, 46291, 
+    46292, 46293, 46294, 46295, 46296, 46297, 46298, 46299, 46300, 46301, 
+    46302, 46303, 46304, 46305, 46306, 46307, 46308, 46309, 46310, 46311, 
+    46312, 46313, 46314, 46315, 46316, 46317, 46318, 46319, 46320, 46321, 
+    46322, 46323, 46324, 46325, 46326, 46327, 46328, 46329, 46330, 46331, 
+    46332, 46333, 46334, 46335, 46336, 46337, 46338, 46339, 46340, 46341, 
+    46342, 46343, 46344, 46345, 46346, 46347, 46348, 46349, 46350, 46351, 
+    46352, 46353, 46354, 46355, 46356, 46357, 46358, 46359, 46360, 46361, 
+    46362, 46363, 46364, 46365, 46366, 46367, 46368, 46369, 46370, 46371, 
+    46372, 46373, 46374, 46375, 46376, 46377, 46378, 46379, 46380, 46381, 
+    46382, 46383, 46384, 46385, 46386, 46387, 46388, 46389, 46390, 46391, 
+    46392, 46393, 46394, 46395, 46396, 46397, 46398, 46399, 46400, 46401, 
+    46402, 46403, 46404, 46405, 46406, 46407, 46408, 46409, 46410, 46411, 
+    46412, 46413, 46414, 46415, 46416, 46417, 46418, 46419, 46420, 46421, 
+    46422, 46423, 46424, 46425, 46426, 46427, 46428, 46429, 46430, 46431, 
+    46432, 46433, 46434, 46435, 46436, 46437, 46438, 46439, 46440, 46441, 
+    46442, 46443, 46444, 46445, 46446, 46447, 46448, 46449, 46450, 46451, 
+    46452, 46453, 46454, 46455, 46456, 46457, 46458, 46459, 46460, 46461, 
+    46462, 46463, 46464, 46465, 46466, 46467, 46468, 46469, 46470, 46471, 
+    46472, 46473, 46474, 46475, 46476, 46477, 46478, 46479, 46480, 46481, 
+    46482, 46483, 46484, 46485, 46486, 46487, 46488, 46489, 46490, 46491, 
+    46492, 46493, 46494, 46495, 46496, 46497, 46498, 46499, 46500, 46501, 
+    46502, 46503, 46504, 46505, 46506, 46507, 46508, 46509, 46510, 46511, 
+    46512, 46513, 46514, 46515, 46516, 46517, 46518, 46519, 46520, 46521, 
+    46522, 46523, 46524, 46525, 46526, 46527, 46528, 46529, 46530, 46531, 
+    46532, 46533, 46534, 46535, 46536, 46537, 46538, 46539, 46540, 46541, 
+    46542, 46543, 46544, 46545, 46546, 46547, 46548, 46549, 46550, 46551, 
+    46552, 46553, 46554, 46555, 46556, 46557, 46558, 46559, 46560, 46561, 
+    46562, 46563, 46564, 46565, 46566, 46567, 46568, 46569, 46570, 46571, 
+    46572, 46573, 46574, 46575, 46576, 46577, 46578, 46579, 46580, 46581, 
+    46582, 46583, 46584, 46585, 46586, 46587, 46588, 46589, 46590, 46591, 
+    46592, 46593, 46594, 46595, 46596, 46597, 46598, 46599, 46600, 46601, 
+    46602, 46603, 46604, 46605, 46606, 46607, 46608, 46609, 46610, 46611, 
+    46612, 46613, 46614, 46615, 46616, 46617, 46618, 46619, 46620, 46621, 
+    46622, 46623, 46624, 46625, 46626, 46627, 46628, 46629, 46630, 46631, 
+    46632, 46633, 46634, 46635, 46636, 46637, 46638, 46639, 46640, 46641, 
+    46642, 46643, 46644, 46645, 46646, 46647, 46648, 46649, 46650, 46651, 
+    46652, 46653, 46654, 46655, 46656, 46657, 46658, 46659, 46660, 46661, 
+    46662, 46663, 46664, 46665, 46666, 46667, 46668, 46669, 46670, 46671, 
+    46672, 46673, 46674, 46675, 46676, 46677, 46678, 46679, 46680, 46681, 
+    46682, 46683, 46684, 46685, 46686, 46687, 46688, 46689, 46690, 46691, 
+    46692, 46693, 46694, 46695, 46696, 46697, 46698, 46699, 46700, 46701, 
+    46702, 46703, 46704, 46705, 46706, 46707, 46708, 46709, 46710, 46711, 
+    46712, 46713, 46714, 46715, 46716, 46717, 46718, 46719, 46720, 46721, 
+    46722, 46723, 46724, 46725, 46726, 46727, 46728, 46729, 46730, 46731, 
+    46732, 46733, 46734, 46735, 46736, 46737, 46738, 46739, 46740, 46741, 
+    46742, 46743, 46744, 46745, 46746, 46747, 46748, 46749, 46750, 46751, 
+    46752, 46753, 46754, 46755, 46756, 46757, 46758, 46759, 46760, 46761, 
+    46762, 46763, 46764, 46765, 46766, 46767, 46768, 46769, 46770, 46771, 
+    46772, 46773, 46774, 46775, 46776, 46777, 46778, 46779, 46780, 46781, 
+    46782, 46783, 46784, 46785, 46786, 46787, 46788, 46789, 46790, 46791, 
+    46792, 46793, 46794, 46795, 46796, 46797, 46798, 46799, 46800, 46801, 
+    46802, 46803, 46804, 46805, 46806, 46807, 46808, 46809, 46810, 46811, 
+    46812, 46813, 46814, 46815, 46816, 46817, 46818, 46819, 46820, 46821, 
+    46822, 46823, 46824, 46825, 46826, 46827, 46828, 46829, 46830, 46831, 
+    46832, 46833, 46834, 46835, 46836, 46837, 46838, 46839, 46840, 46841, 
+    46842, 46843, 46844, 46845, 46846, 46847, 46848, 46849, 46850, 46851, 
+    46852, 46853, 46854, 46855, 46856, 46857, 46858, 46859, 46860, 46861, 
+    46862, 46863, 46864, 46865, 46866, 46867, 46868, 46869, 46870, 46871, 
+    46872, 46873, 46874, 46875, 46876, 46877, 46878, 46879, 46880, 46881, 
+    46882, 46883, 46884, 46885, 46886, 46887, 46888, 46889, 46890, 46891, 
+    46892, 46893, 46894, 46895, 46896, 46897, 46898, 46899, 46900, 46901, 
+    46902, 46903, 46904, 46905, 46906, 46907, 46908, 46909, 46910, 46911, 
+    46912, 46913, 46914, 46915, 46916, 46917, 46918, 46919, 46920, 46921, 
+    46922, 46923, 46924, 46925, 46926, 46927, 46928, 46929, 46930, 46931, 
+    46932, 46933, 46934, 46935, 46936, 46937, 46938, 46939, 46940, 46941, 
+    46942, 46943, 46944, 46945, 46946, 46947, 46948, 46949, 46950, 46951, 
+    46952, 46953, 46954, 46955, 46956, 46957, 46958, 46959, 46960, 46961, 
+    46962, 46963, 46964, 46965, 46966, 46967, 46968, 46969, 46970, 46971, 
+    46972, 46973, 46974, 46975, 46976, 46977, 46978, 46979, 46980, 46981, 
+    46982, 46983, 46984, 46985, 46986, 46987, 46988, 46989, 46990, 46991, 
+    46992, 46993, 46994, 46995, 46996, 46997, 46998, 46999, 47000, 47001, 
+    47002, 47003, 47004, 47005, 47006, 47007, 47008, 47009, 47010, 47011, 
+    47012, 47013, 47014, 47015, 47016, 47017, 47018, 47019, 47020, 47021, 
+    47022, 47023, 47024, 47025, 47026, 47027, 47028, 47029, 47030, 47031, 
+    47032, 47033, 47034, 47035, 47036, 47037, 47038, 47039, 47040, 47041, 
+    47042, 47043, 47044, 47045, 47046, 47047, 47048, 47049, 47050, 47051, 
+    47052, 47053, 47054, 47055, 47056, 47057, 47058, 47059, 47060, 47061, 
+    47062, 47063, 47064, 47065, 47066, 47067, 47068, 47069, 47070, 47071, 
+    47072, 47073, 47074, 47075, 47076, 47077, 47078, 47079, 47080, 47081, 
+    47082, 47083, 47084, 47085, 47086, 47087, 47088, 47089, 47090, 47091, 
+    47092, 47093, 47094, 47095, 47096, 47097, 47098, 47099, 47100, 47101, 
+    47102, 47103, 47104, 47105, 47106, 47107, 47108, 47109, 47110, 47111, 
+    47112, 47113, 47114, 47115, 47116, 47117, 47118, 47119, 47120, 47121, 
+    47122, 47123, 47124, 47125, 47126, 47127, 47128, 47129, 47130, 47131, 
+    47132, 47133, 47134, 47135, 47136, 47137, 47138, 47139, 47140, 47141, 
+    47142, 47143, 47144, 47145, 47146, 47147, 47148, 47149, 47150, 47151, 
+    47152, 47153, 47154, 47155, 47156, 47157, 47158, 47159, 47160, 47161, 
+    47162, 47163, 47164, 47165, 47166, 47167, 47168, 47169, 47170, 47171, 
+    47172, 47173, 47174, 47175, 47176, 47177, 47178, 47179, 47180, 47181, 
+    47182, 47183, 47184, 47185, 47186, 47187, 47188, 47189, 47190, 47191, 
+    47192, 47193, 47194, 47195, 47196, 47197, 47198, 47199, 47200, 47201, 
+    47202, 47203, 47204, 47205, 47206, 47207, 47208, 47209, 47210, 47211, 
+    47212, 47213, 47214, 47215, 47216, 47217, 47218, 47219, 47220, 47221, 
+    47222, 47223, 47224, 47225, 47226, 47227, 47228, 47229, 47230, 47231, 
+    47232, 47233, 47234, 47235, 47236, 47237, 47238, 47239, 47240, 47241, 
+    47242, 47243, 47244, 47245, 47246, 47247, 47248, 47249, 47250, 47251, 
+    47252, 47253, 47254, 47255, 47256, 47257, 47258, 47259, 47260, 47261, 
+    47262, 47263, 47264, 47265, 47266, 47267, 47268, 47269, 47270, 47271, 
+    47272, 47273, 47274, 47275, 47276, 47277, 47278, 47279, 47280, 47281, 
+    47282, 47283, 47284, 47285, 47286, 47287, 47288, 47289, 47290, 47291, 
+    47292, 47293, 47294, 47295, 47296, 47297, 47298, 47299, 47300, 47301, 
+    47302, 47303, 47304, 47305, 47306, 47307, 47308, 47309, 47310, 47311, 
+    47312, 47313, 47314, 47315, 47316, 47317, 47318, 47319, 47320, 47321, 
+    47322, 47323, 47324, 47325, 47326, 47327, 47328, 47329, 47330, 47331, 
+    47332, 47333, 47334, 47335, 47336, 47337, 47338, 47339, 47340, 47341, 
+    47342, 47343, 47344, 47345, 47346, 47347, 47348, 47349, 47350, 47351, 
+    47352, 47353, 47354, 47355, 47356, 47357, 47358, 47359, 47360, 47361, 
+    47362, 47363, 47364, 47365, 47366, 47367, 47368, 47369, 47370, 47371, 
+    47372, 47373, 47374, 47375, 47376, 47377, 47378, 47379, 47380, 47381, 
+    47382, 47383, 47384, 47385, 47386, 47387, 47388, 47389, 47390, 47391, 
+    47392, 47393, 47394, 47395, 47396, 47397, 47398, 47399, 47400, 47401, 
+    47402, 47403, 47404, 47405, 47406, 47407, 47408, 47409, 47410, 47411, 
+    47412, 47413, 47414, 47415, 47416, 47417, 47418, 47419, 47420, 47421, 
+    47422, 47423, 47424, 47425, 47426, 47427, 47428, 47429, 47430, 47431, 
+    47432, 47433, 47434, 47435, 47436, 47437, 47438, 47439, 47440, 47441, 
+    47442, 47443, 47444, 47445, 47446, 47447, 47448, 47449, 47450, 47451, 
+    47452, 47453, 47454, 47455, 47456, 47457, 47458, 47459, 47460, 47461, 
+    47462, 47463, 47464, 47465, 47466, 47467, 47468, 47469, 47470, 47471, 
+    47472, 47473, 47474, 47475, 47476, 47477, 47478, 47479, 47480, 47481, 
+    47482, 47483, 47484, 47485, 47486, 47487, 47488, 47489, 47490, 47491, 
+    47492, 47493, 47494, 47495, 47496, 47497, 47498, 47499, 47500, 47501, 
+    47502, 47503, 47504, 47505, 47506, 47507, 47508, 47509, 47510, 47511, 
+    47512, 47513, 47514, 47515, 47516, 47517, 47518, 47519, 47520, 47521, 
+    47522, 47523, 47524, 47525, 47526, 47527, 47528, 47529, 47530, 47531, 
+    47532, 47533, 47534, 47535, 47536, 47537, 47538, 47539, 47540, 47541, 
+    47542, 47543, 47544, 47545, 47546, 47547, 47548, 47549, 47550, 47551, 
+    47552, 47553, 47554, 47555, 47556, 47557, 47558, 47559, 47560, 47561, 
+    47562, 47563, 47564, 47565, 47566, 47567, 47568, 47569, 47570, 47571, 
+    47572, 47573, 47574, 47575, 47576, 47577, 47578, 47579, 47580, 47581, 
+    47582, 47583, 47584, 47585, 47586, 47587, 47588, 47589, 47590, 47591, 
+    47592, 47593, 47594, 47595, 47596, 47597, 47598, 47599, 47600, 47601, 
+    47602, 47603, 47604, 47605, 47606, 47607, 47608, 47609, 47610, 47611, 
+    47612, 47613, 47614, 47615, 47616, 47617, 47618, 47619, 47620, 47621, 
+    47622, 47623, 47624, 47625, 47626, 47627, 47628, 47629, 47630, 47631, 
+    47632, 47633, 47634, 47635, 47636, 47637, 47638, 47639, 47640, 47641, 
+    47642, 47643, 47644, 47645, 47646, 47647, 47648, 47649, 47650, 47651, 
+    47652, 47653, 47654, 47655, 47656, 47657, 47658, 47659, 47660, 47661, 
+    47662, 47663, 47664, 47665, 47666, 47667, 47668, 47669, 47670, 47671, 
+    47672, 47673, 47674, 47675, 47676, 47677, 47678, 47679, 47680, 47681, 
+    47682, 47683, 47684, 47685, 47686, 47687, 47688, 47689, 47690, 47691, 
+    47692, 47693, 47694, 47695, 47696, 47697, 47698, 47699, 47700, 47701, 
+    47702, 47703, 47704, 47705, 47706, 47707, 47708, 47709, 47710, 47711, 
+    47712, 47713, 47714, 47715, 47716, 47717, 47718, 47719, 47720, 47721, 
+    47722, 47723, 47724, 47725, 47726, 47727, 47728, 47729, 47730, 47731, 
+    47732, 47733, 47734, 47735, 47736, 47737, 47738, 47739, 47740, 47741, 
+    47742, 47743, 47744, 47745, 47746, 47747, 47748, 47749, 47750, 47751, 
+    47752, 47753, 47754, 47755, 47756, 47757, 47758, 47759, 47760, 47761, 
+    47762, 47763, 47764, 47765, 47766, 47767, 47768, 47769, 47770, 47771, 
+    47772, 47773, 47774, 47775, 47776, 47777, 47778, 47779, 47780, 47781, 
+    47782, 47783, 47784, 47785, 47786, 47787, 47788, 47789, 47790, 47791, 
+    47792, 47793, 47794, 47795, 47796, 47797, 47798, 47799, 47800, 47801, 
+    47802, 47803, 47804, 47805, 47806, 47807, 47808, 47809, 47810, 47811, 
+    47812, 47813, 47814, 47815, 47816, 47817, 47818, 47819, 47820, 47821, 
+    47822, 47823, 47824, 47825, 47826, 47827, 47828, 47829, 47830, 47831, 
+    47832, 47833, 47834, 47835, 47836, 47837, 47838, 47839, 47840, 47841, 
+    47842, 47843, 47844, 47845, 47846, 47847, 47848, 47849, 47850, 47851, 
+    47852, 47853, 47854, 47855, 47856, 47857, 47858, 47859, 47860, 47861, 
+    47862, 47863, 47864, 47865, 47866, 47867, 47868, 47869, 47870, 47871, 
+    47872, 47873, 47874, 47875, 47876, 47877, 47878, 47879, 47880, 47881, 
+    47882, 47883, 47884, 47885, 47886, 47887, 47888, 47889, 47890, 47891, 
+    47892, 47893, 47894, 47895, 47896, 47897, 47898, 47899, 47900, 47901, 
+    47902, 47903, 47904, 47905, 47906, 47907, 47908, 47909, 47910, 47911, 
+    47912, 47913, 47914, 47915, 47916, 47917, 47918, 47919, 47920, 47921, 
+    47922, 47923, 47924, 47925, 47926, 47927, 47928, 47929, 47930, 47931, 
+    47932, 47933, 47934, 47935, 47936, 47937, 47938, 47939, 47940, 47941, 
+    47942, 47943, 47944, 47945, 47946, 47947, 47948, 47949, 47950, 47951, 
+    47952, 47953, 47954, 47955, 47956, 47957, 47958, 47959, 47960, 47961, 
+    47962, 47963, 47964, 47965, 47966, 47967, 47968, 47969, 47970, 47971, 
+    47972, 47973, 47974, 47975, 47976, 47977, 47978, 47979, 47980, 47981, 
+    47982, 47983, 47984, 47985, 47986, 47987, 47988, 47989, 47990, 47991, 
+    47992, 47993, 47994, 47995, 47996, 47997, 47998, 47999, 48000, 48001, 
+    48002, 48003, 48004, 48005, 48006, 48007, 48008, 48009, 48010, 48011, 
+    48012, 48013, 48014, 48015, 48016, 48017, 48018, 48019, 48020, 48021, 
+    48022, 48023, 48024, 48025, 48026, 48027, 48028, 48029, 48030, 48031, 
+    48032, 48033, 48034, 48035, 48036, 48037, 48038, 48039, 48040, 48041, 
+    48042, 48043, 48044, 48045, 48046, 48047, 48048, 48049, 48050, 48051, 
+    48052, 48053, 48054, 48055, 48056, 48057, 48058, 48059, 48060, 48061, 
+    48062, 48063, 48064, 48065, 48066, 48067, 48068, 48069, 48070, 48071, 
+    48072, 48073, 48074, 48075, 48076, 48077, 48078, 48079, 48080, 48081, 
+    48082, 48083, 48084, 48085, 48086, 48087, 48088, 48089, 48090, 48091, 
+    48092, 48093, 48094, 48095, 48096, 48097, 48098, 48099, 48100, 48101, 
+    48102, 48103, 48104, 48105, 48106, 48107, 48108, 48109, 48110, 48111, 
+    48112, 48113, 48114, 48115, 48116, 48117, 48118, 48119, 48120, 48121, 
+    48122, 48123, 48124, 48125, 48126, 48127, 48128, 48129, 48130, 48131, 
+    48132, 48133, 48134, 48135, 48136, 48137, 48138, 48139, 48140, 48141, 
+    48142, 48143, 48144, 48145, 48146, 48147, 48148, 48149, 48150, 48151, 
+    48152, 48153, 48154, 48155, 48156, 48157, 48158, 48159, 48160, 48161, 
+    48162, 48163, 48164, 48165, 48166, 48167, 48168, 48169, 48170, 48171, 
+    48172, 48173, 48174, 48175, 48176, 48177, 48178, 48179, 48180, 48181, 
+    48182, 48183, 48184, 48185, 48186, 48187, 48188, 48189, 48190, 48191, 
+    48192, 48193, 48194, 48195, 48196, 48197, 48198, 48199, 48200, 48201, 
+    48202, 48203, 48204, 48205, 48206, 48207, 48208, 48209, 48210, 48211, 
+    48212, 48213, 48214, 48215, 48216, 48217, 48218, 48219, 48220, 48221, 
+    48222, 48223, 48224, 48225, 48226, 48227, 48228, 48229, 48230, 48231, 
+    48232, 48233, 48234, 48235, 48236, 48237, 48238, 48239, 48240, 48241, 
+    48242, 48243, 48244, 48245, 48246, 48247, 48248, 48249, 48250, 48251, 
+    48252, 48253, 48254, 48255, 48256, 48257, 48258, 48259, 48260, 48261, 
+    48262, 48263, 48264, 48265, 48266, 48267, 48268, 48269, 48270, 48271, 
+    48272, 48273, 48274, 48275, 48276, 48277, 48278, 48279, 48280, 48281, 
+    48282, 48283, 48284, 48285, 48286, 48287, 48288, 48289, 48290, 48291, 
+    48292, 48293, 48294, 48295, 48296, 48297, 48298, 48299, 48300, 48301, 
+    48302, 48303, 48304, 48305, 48306, 48307, 48308, 48309, 48310, 48311, 
+    48312, 48313, 48314, 48315, 48316, 48317, 48318, 48319, 48320, 48321, 
+    48322, 48323, 48324, 48325, 48326, 48327, 48328, 48329, 48330, 48331, 
+    48332, 48333, 48334, 48335, 48336, 48337, 48338, 48339, 48340, 48341, 
+    48342, 48343, 48344, 48345, 48346, 48347, 48348, 48349, 48350, 48351, 
+    48352, 48353, 48354, 48355, 48356, 48357, 48358, 48359, 48360, 48361, 
+    48362, 48363, 48364, 48365, 48366, 48367, 48368, 48369, 48370, 48371, 
+    48372, 48373, 48374, 48375, 48376, 48377, 48378, 48379, 48380, 48381, 
+    48382, 48383, 48384, 48385, 48386, 48387, 48388, 48389, 48390, 48391, 
+    48392, 48393, 48394, 48395, 48396, 48397, 48398, 48399, 48400, 48401, 
+    48402, 48403, 48404, 48405, 48406, 48407, 48408, 48409, 48410, 48411, 
+    48412, 48413, 48414, 48415, 48416, 48417, 48418, 48419, 48420, 48421, 
+    48422, 48423, 48424, 48425, 48426, 48427, 48428, 48429, 48430, 48431, 
+    48432, 48433, 48434, 48435, 48436, 48437, 48438, 48439, 48440, 48441, 
+    48442, 48443, 48444, 48445, 48446, 48447, 48448, 48449, 48450, 48451, 
+    48452, 48453, 48454, 48455, 48456, 48457, 48458, 48459, 48460, 48461, 
+    48462, 48463, 48464, 48465, 48466, 48467, 48468, 48469, 48470, 48471, 
+    48472, 48473, 48474, 48475, 48476, 48477, 48478, 48479, 48480, 48481, 
+    48482, 48483, 48484, 48485, 48486, 48487, 48488, 48489, 48490, 48491, 
+    48492, 48493, 48494, 48495, 48496, 48497, 48498, 48499, 48500, 48501, 
+    48502, 48503, 48504, 48505, 48506, 48507, 48508, 48509, 48510, 48511, 
+    48512, 48513, 48514, 48515, 48516, 48517, 48518, 48519, 48520, 48521, 
+    48522, 48523, 48524, 48525, 48526, 48527, 48528, 48529, 48530, 48531, 
+    48532, 48533, 48534, 48535, 48536, 48537, 48538, 48539, 48540, 48541, 
+    48542, 48543, 48544, 48545, 48546, 48547, 48548, 48549, 48550, 48551, 
+    48552, 48553, 48554, 48555, 48556, 48557, 48558, 48559, 48560, 48561, 
+    48562, 48563, 48564, 48565, 48566, 48567, 48568, 48569, 48570, 48571, 
+    48572, 48573, 48574, 48575, 48576, 48577, 48578, 48579, 48580, 48581, 
+    48582, 48583, 48584, 48585, 48586, 48587, 48588, 48589, 48590, 48591, 
+    48592, 48593, 48594, 48595, 48596, 48597, 48598, 48599, 48600, 48601, 
+    48602, 48603, 48604, 48605, 48606, 48607, 48608, 48609, 48610, 48611, 
+    48612, 48613, 48614, 48615, 48616, 48617, 48618, 48619, 48620, 48621, 
+    48622, 48623, 48624, 48625, 48626, 48627, 48628, 48629, 48630, 48631, 
+    48632, 48633, 48634, 48635, 48636, 48637, 48638, 48639, 48640, 48641, 
+    48642, 48643, 48644, 48645, 48646, 48647, 48648, 48649, 48650, 48651, 
+    48652, 48653, 48654, 48655, 48656, 48657, 48658, 48659, 48660, 48661, 
+    48662, 48663, 48664, 48665, 48666, 48667, 48668, 48669, 48670, 48671, 
+    48672, 48673, 48674, 48675, 48676, 48677, 48678, 48679, 48680, 48681, 
+    48682, 48683, 48684, 48685, 48686, 48687, 48688, 48689, 48690, 48691, 
+    48692, 48693, 48694, 48695, 48696, 48697, 48698, 48699, 48700, 48701, 
+    48702, 48703, 48704, 48705, 48706, 48707, 48708, 48709, 48710, 48711, 
+    48712, 48713, 48714, 48715, 48716, 48717, 48718, 48719, 48720, 48721, 
+    48722, 48723, 48724, 48725, 48726, 48727, 48728, 48729, 48730, 48731, 
+    48732, 48733, 48734, 48735, 48736, 48737, 48738, 48739, 48740, 48741, 
+    48742, 48743, 48744, 48745, 48746, 48747, 48748, 48749, 48750, 48751, 
+    48752, 48753, 48754, 48755, 48756, 48757, 48758, 48759, 48760, 48761, 
+    48762, 48763, 48764, 48765, 48766, 48767, 48768, 48769, 48770, 48771, 
+    48772, 48773, 48774, 48775, 48776, 48777, 48778, 48779, 48780, 48781, 
+    48782, 48783, 48784, 48785, 48786, 48787, 48788, 48789, 48790, 48791, 
+    48792, 48793, 48794, 48795, 48796, 48797, 48798, 48799, 48800, 48801, 
+    48802, 48803, 48804, 48805, 48806, 48807, 48808, 48809, 48810, 48811, 
+    48812, 48813, 48814, 48815, 48816, 48817, 48818, 48819, 48820, 48821, 
+    48822, 48823, 48824, 48825, 48826, 48827, 48828, 48829, 48830, 48831, 
+    48832, 48833, 48834, 48835, 48836, 48837, 48838, 48839, 48840, 48841, 
+    48842, 48843, 48844, 48845, 48846, 48847, 48848, 48849, 48850, 48851, 
+    48852, 48853, 48854, 48855, 48856, 48857, 48858, 48859, 48860, 48861, 
+    48862, 48863, 48864, 48865, 48866, 48867, 48868, 48869, 48870, 48871, 
+    48872, 48873, 48874, 48875, 48876, 48877, 48878, 48879, 48880, 48881, 
+    48882, 48883, 48884, 48885, 48886, 48887, 48888, 48889, 48890, 48891, 
+    48892, 48893, 48894, 48895, 48896, 48897, 48898, 48899, 48900, 48901, 
+    48902, 48903, 48904, 48905, 48906, 48907, 48908, 48909, 48910, 48911, 
+    48912, 48913, 48914, 48915, 48916, 48917, 48918, 48919, 48920, 48921, 
+    48922, 48923, 48924, 48925, 48926, 48927, 48928, 48929, 48930, 48931, 
+    48932, 48933, 48934, 48935, 48936, 48937, 48938, 48939, 48940, 48941, 
+    48942, 48943, 48944, 48945, 48946, 48947, 48948, 48949, 48950, 48951, 
+    48952, 48953, 48954, 48955, 48956, 48957, 48958, 48959, 48960, 48961, 
+    48962, 48963, 48964, 48965, 48966, 48967, 48968, 48969, 48970, 48971, 
+    48972, 48973, 48974, 48975, 48976, 48977, 48978, 48979, 48980, 48981, 
+    48982, 48983, 48984, 48985, 48986, 48987, 48988, 48989, 48990, 48991, 
+    48992, 48993, 48994, 48995, 48996, 48997, 48998, 48999, 49000, 49001, 
+    49002, 49003, 49004, 49005, 49006, 49007, 49008, 49009, 49010, 49011, 
+    49012, 49013, 49014, 49015, 49016, 49017, 49018, 49019, 49020, 49021, 
+    49022, 49023, 49024, 49025, 49026, 49027, 49028, 49029, 49030, 49031, 
+    49032, 49033, 49034, 49035, 49036, 49037, 49038, 49039, 49040, 49041, 
+    49042, 49043, 49044, 49045, 49046, 49047, 49048, 49049, 49050, 49051, 
+    49052, 49053, 49054, 49055, 49056, 49057, 49058, 49059, 49060, 49061, 
+    49062, 49063, 49064, 49065, 49066, 49067, 49068, 49069, 49070, 49071, 
+    49072, 49073, 49074, 49075, 49076, 49077, 49078, 49079, 49080, 49081, 
+    49082, 49083, 49084, 49085, 49086, 49087, 49088, 49089, 49090, 49091, 
+    49092, 49093, 49094, 49095, 49096, 49097, 49098, 49099, 49100, 49101, 
+    49102, 49103, 49104, 49105, 49106, 49107, 49108, 49109, 49110, 49111, 
+    49112, 49113, 49114, 49115, 49116, 49117, 49118, 49119, 49120, 49121, 
+    49122, 49123, 49124, 49125, 49126, 49127, 49128, 49129, 49130, 49131, 
+    49132, 49133, 49134, 49135, 49136, 49137, 49138, 49139, 49140, 49141, 
+    49142, 49143, 49144, 49145, 49146, 49147, 49148, 49149, 49150, 49151, 
+    49152, 49153, 49154, 49155, 49156, 49157, 49158, 49159, 49160, 49161, 
+    49162, 49163, 49164, 49165, 49166, 49167, 49168, 49169, 49170, 49171, 
+    49172, 49173, 49174, 49175, 49176, 49177, 49178, 49179, 49180, 49181, 
+    49182, 49183, 49184, 49185, 49186, 49187, 49188, 49189, 49190, 49191, 
+    49192, 49193, 49194, 49195, 49196, 49197, 49198, 49199, 49200, 49201, 
+    49202, 49203, 49204, 49205, 49206, 49207, 49208, 49209, 49210, 49211, 
+    49212, 49213, 49214, 49215, 49216, 49217, 49218, 49219, 49220, 49221, 
+    49222, 49223, 49224, 49225, 49226, 49227, 49228, 49229, 49230, 49231, 
+    49232, 49233, 49234, 49235, 49236, 49237, 49238, 49239, 49240, 49241, 
+    49242, 49243, 49244, 49245, 49246, 49247, 49248, 49249, 49250, 49251, 
+    49252, 49253, 49254, 49255, 49256, 49257, 49258, 49259, 49260, 49261, 
+    49262, 49263, 49264, 49265, 49266, 49267, 49268, 49269, 49270, 49271, 
+    49272, 49273, 49274, 49275, 49276, 49277, 49278, 49279, 49280, 49281, 
+    49282, 49283, 49284, 49285, 49286, 49287, 49288, 49289, 49290, 49291, 
+    49292, 49293, 49294, 49295, 49296, 49297, 49298, 49299, 49300, 49301, 
+    49302, 49303, 49304, 49305, 49306, 49307, 49308, 49309, 49310, 49311, 
+    49312, 49313, 49314, 49315, 49316, 49317, 49318, 49319, 49320, 49321, 
+    49322, 49323, 49324, 49325, 49326, 49327, 49328, 49329, 49330, 49331, 
+    49332, 49333, 49334, 49335, 49336, 49337, 49338, 49339, 49340, 49341, 
+    49342, 49343, 49344, 49345, 49346, 49347, 49348, 49349, 49350, 49351, 
+    49352, 49353, 49354, 49355, 49356, 49357, 49358, 49359, 49360, 49361, 
+    49362, 49363, 49364, 49365, 49366, 49367, 49368, 49369, 49370, 49371, 
+    49372, 49373, 49374, 49375, 49376, 49377, 49378, 49379, 49380, 49381, 
+    49382, 49383, 49384, 49385, 49386, 49387, 49388, 49389, 49390, 49391, 
+    49392, 49393, 49394, 49395, 49396, 49397, 49398, 49399, 49400, 49401, 
+    49402, 49403, 49404, 49405, 49406, 49407, 49408, 49409, 49410, 49411, 
+    49412, 49413, 49414, 49415, 49416, 49417, 49418, 49419, 49420, 49421, 
+    49422, 49423, 49424, 49425, 49426, 49427, 49428, 49429, 49430, 49431, 
+    49432, 49433, 49434, 49435, 49436, 49437, 49438, 49439, 49440, 49441, 
+    49442, 49443, 49444, 49445, 49446, 49447, 49448, 49449, 49450, 49451, 
+    49452, 49453, 49454, 49455, 49456, 49457, 49458, 49459, 49460, 49461, 
+    49462, 49463, 49464, 49465, 49466, 49467, 49468, 49469, 49470, 49471, 
+    49472, 49473, 49474, 49475, 49476, 49477, 49478, 49479, 49480, 49481, 
+    49482, 49483, 49484, 49485, 49486, 49487, 49488, 49489, 49490, 49491, 
+    49492, 49493, 49494, 49495, 49496, 49497, 49498, 49499, 49500, 49501, 
+    49502, 49503, 49504, 49505, 49506, 49507, 49508, 49509, 49510, 49511, 
+    49512, 49513, 49514, 49515, 49516, 49517, 49518, 49519, 49520, 49521, 
+    49522, 49523, 49524, 49525, 49526, 49527, 49528, 49529, 49530, 49531, 
+    49532, 49533, 49534, 49535, 49536, 49537, 49538, 49539, 49540, 49541, 
+    49542, 49543, 49544, 49545, 49546, 49547, 49548, 49549, 49550, 49551, 
+    49552, 49553, 49554, 49555, 49556, 49557, 49558, 49559, 49560, 49561, 
+    49562, 49563, 49564, 49565, 49566, 49567, 49568, 49569, 49570, 49571, 
+    49572, 49573, 49574, 49575, 49576, 49577, 49578, 49579, 49580, 49581, 
+    49582, 49583, 49584, 49585, 49586, 49587, 49588, 49589, 49590, 49591, 
+    49592, 49593, 49594, 49595, 49596, 49597, 49598, 49599, 49600, 49601, 
+    49602, 49603, 49604, 49605, 49606, 49607, 49608, 49609, 49610, 49611, 
+    49612, 49613, 49614, 49615, 49616, 49617, 49618, 49619, 49620, 49621, 
+    49622, 49623, 49624, 49625, 49626, 49627, 49628, 49629, 49630, 49631, 
+    49632, 49633, 49634, 49635, 49636, 49637, 49638, 49639, 49640, 49641, 
+    49642, 49643, 49644, 49645, 49646, 49647, 49648, 49649, 49650, 49651, 
+    49652, 49653, 49654, 49655, 49656, 49657, 49658, 49659, 49660, 49661, 
+    49662, 49663, 49664, 49665, 49666, 49667, 49668, 49669, 49670, 49671, 
+    49672, 49673, 49674, 49675, 49676, 49677, 49678, 49679, 49680, 49681, 
+    49682, 49683, 49684, 49685, 49686, 49687, 49688, 49689, 49690, 49691, 
+    49692, 49693, 49694, 49695, 49696, 49697, 49698, 49699, 49700, 49701, 
+    49702, 49703, 49704, 49705, 49706, 49707, 49708, 49709, 49710, 49711, 
+    49712, 49713, 49714, 49715, 49716, 49717, 49718, 49719, 49720, 49721, 
+    49722, 49723, 49724, 49725, 49726, 49727, 49728, 49729, 49730, 49731, 
+    49732, 49733, 49734, 49735, 49736, 49737, 49738, 49739, 49740, 49741, 
+    49742, 49743, 49744, 49745, 49746, 49747, 49748, 49749, 49750, 49751, 
+    49752, 49753, 49754, 49755, 49756, 49757, 49758, 49759, 49760, 49761, 
+    49762, 49763, 49764, 49765, 49766, 49767, 49768, 49769, 49770, 49771, 
+    49772, 49773, 49774, 49775, 49776, 49777, 49778, 49779, 49780, 49781, 
+    49782, 49783, 49784, 49785, 49786, 49787, 49788, 49789, 49790, 49791, 
+    49792, 49793, 49794, 49795, 49796, 49797, 49798, 49799, 49800, 49801, 
+    49802, 49803, 49804, 49805, 49806, 49807, 49808, 49809, 49810, 49811, 
+    49812, 49813, 49814, 49815, 49816, 49817, 49818, 49819, 49820, 49821, 
+    49822, 49823, 49824, 49825, 49826, 49827, 49828, 49829, 49830, 49831, 
+    49832, 49833, 49834, 49835, 49836, 49837, 49838, 49839, 49840, 49841, 
+    49842, 49843, 49844, 49845, 49846, 49847, 49848, 49849, 49850, 49851, 
+    49852, 49853, 49854, 49855, 49856, 49857, 49858, 49859, 49860, 49861, 
+    49862, 49863, 49864, 49865, 49866, 49867, 49868, 49869, 49870, 49871, 
+    49872, 49873, 49874, 49875, 49876, 49877, 49878, 49879, 49880, 49881, 
+    49882, 49883, 49884, 49885, 49886, 49887, 49888, 49889, 49890, 49891, 
+    49892, 49893, 49894, 49895, 49896, 49897, 49898, 49899, 49900, 49901, 
+    49902, 49903, 49904, 49905, 49906, 49907, 49908, 49909, 49910, 49911, 
+    49912, 49913, 49914, 49915, 49916, 49917, 49918, 49919, 49920, 49921, 
+    49922, 49923, 49924, 49925, 49926, 49927, 49928, 49929, 49930, 49931, 
+    49932, 49933, 49934, 49935, 49936, 49937, 49938, 49939, 49940, 49941, 
+    49942, 49943, 49944, 49945, 49946, 49947, 49948, 49949, 49950, 49951, 
+    49952, 49953, 49954, 49955, 49956, 49957, 49958, 49959, 49960, 49961, 
+    49962, 49963, 49964, 49965, 49966, 49967, 49968, 49969, 49970, 49971, 
+    49972, 49973, 49974, 49975, 49976, 49977, 49978, 49979, 49980, 49981, 
+    49982, 49983, 49984, 49985, 49986, 49987, 49988, 49989, 49990, 49991, 
+    49992, 49993, 49994, 49995, 49996, 49997, 49998, 49999, 50000, 50001, 
+    50002, 50003, 50004, 50005, 50006, 50007, 50008, 50009, 50010, 50011, 
+    50012, 50013, 50014, 50015, 50016, 50017, 50018, 50019, 50020, 50021, 
+    50022, 50023, 50024, 50025, 50026, 50027, 50028, 50029, 50030, 50031, 
+    50032, 50033, 50034, 50035, 50036, 50037, 50038, 50039, 50040, 50041, 
+    50042, 50043, 50044, 50045, 50046, 50047, 50048, 50049, 50050, 50051, 
+    50052, 50053, 50054, 50055, 50056, 50057, 50058, 50059, 50060, 50061, 
+    50062, 50063, 50064, 50065, 50066, 50067, 50068, 50069, 50070, 50071, 
+    50072, 50073, 50074, 50075, 50076, 50077, 50078, 50079, 50080, 50081, 
+    50082, 50083, 50084, 50085, 50086, 50087, 50088, 50089, 50090, 50091, 
+    50092, 50093, 50094, 50095, 50096, 50097, 50098, 50099, 50100, 50101, 
+    50102, 50103, 50104, 50105, 50106, 50107, 50108, 50109, 50110, 50111, 
+    50112, 50113, 50114, 50115, 50116, 50117, 50118, 50119, 50120, 50121, 
+    50122, 50123, 50124, 50125, 50126, 50127, 50128, 50129, 50130, 50131, 
+    50132, 50133, 50134, 50135, 50136, 50137, 50138, 50139, 50140, 50141, 
+    50142, 50143, 50144, 50145, 50146, 50147, 50148, 50149, 50150, 50151, 
+    50152, 50153, 50154, 50155, 50156, 50157, 50158, 50159, 50160, 50161, 
+    50162, 50163, 50164, 50165, 50166, 50167, 50168, 50169, 50170, 50171, 
+    50172, 50173, 50174, 50175, 50176, 50177, 50178, 50179, 50180, 50181, 
+    50182, 50183, 50184, 50185, 50186, 50187, 50188, 50189, 50190, 50191, 
+    50192, 50193, 50194, 50195, 50196, 50197, 50198, 50199, 50200, 50201, 
+    50202, 50203, 50204, 50205, 50206, 50207, 50208, 50209, 50210, 50211, 
+    50212, 50213, 50214, 50215, 50216, 50217, 50218, 50219, 50220, 50221, 
+    50222, 50223, 50224, 50225, 50226, 50227, 50228, 50229, 50230, 50231, 
+    50232, 50233, 50234, 50235, 50236, 50237, 50238, 50239, 50240, 50241, 
+    50242, 50243, 50244, 50245, 50246, 50247, 50248, 50249, 50250, 50251, 
+    50252, 50253, 50254, 50255, 50256, 50257, 50258, 50259, 50260, 50261, 
+    50262, 50263, 50264, 50265, 50266, 50267, 50268, 50269, 50270, 50271, 
+    50272, 50273, 50274, 50275, 50276, 50277, 50278, 50279, 50280, 50281, 
+    50282, 50283, 50284, 50285, 50286, 50287, 50288, 50289, 50290, 50291, 
+    50292, 50293, 50294, 50295, 50296, 50297, 50298, 50299, 50300, 50301, 
+    50302, 50303, 50304, 50305, 50306, 50307, 50308, 50309, 50310, 50311, 
+    50312, 50313, 50314, 50315, 50316, 50317, 50318, 50319, 50320, 50321, 
+    50322, 50323, 50324, 50325, 50326, 50327, 50328, 50329, 50330, 50331, 
+    50332, 50333, 50334, 50335, 50336, 50337, 50338, 50339, 50340, 50341, 
+    50342, 50343, 50344, 50345, 50346, 50347, 50348, 50349, 50350, 50351, 
+    50352, 50353, 50354, 50355, 50356, 50357, 50358, 50359, 50360, 50361, 
+    50362, 50363, 50364, 50365, 50366, 50367, 50368, 50369, 50370, 50371, 
+    50372, 50373, 50374, 50375, 50376, 50377, 50378, 50379, 50380, 50381, 
+    50382, 50383, 50384, 50385, 50386, 50387, 50388, 50389, 50390, 50391, 
+    50392, 50393, 50394, 50395, 50396, 50397, 50398, 50399, 50400, 50401, 
+    50402, 50403, 50404, 50405, 50406, 50407, 50408, 50409, 50410, 50411, 
+    50412, 50413, 50414, 50415, 50416, 50417, 50418, 50419, 50420, 50421, 
+    50422, 50423, 50424, 50425, 50426, 50427, 50428, 50429, 50430, 50431, 
+    50432, 50433, 50434, 50435, 50436, 50437, 50438, 50439, 50440, 50441, 
+    50442, 50443, 50444, 50445, 50446, 50447, 50448, 50449, 50450, 50451, 
+    50452, 50453, 50454, 50455, 50456, 50457, 50458, 50459, 50460, 50461, 
+    50462, 50463, 50464, 50465, 50466, 50467, 50468, 50469, 50470, 50471, 
+    50472, 50473, 50474, 50475, 50476, 50477, 50478, 50479, 50480, 50481, 
+    50482, 50483, 50484, 50485, 50486, 50487, 50488, 50489, 50490, 50491, 
+    50492, 50493, 50494, 50495, 50496, 50497, 50498, 50499, 50500, 50501, 
+    50502, 50503, 50504, 50505, 50506, 50507, 50508, 50509, 50510, 50511, 
+    50512, 50513, 50514, 50515, 50516, 50517, 50518, 50519, 50520, 50521, 
+    50522, 50523, 50524, 50525, 50526, 50527, 50528, 50529, 50530, 50531, 
+    50532, 50533, 50534, 50535, 50536, 50537, 50538, 50539, 50540, 50541, 
+    50542, 50543, 50544, 50545, 50546, 50547, 50548, 50549, 50550, 50551, 
+    50552, 50553, 50554, 50555, 50556, 50557, 50558, 50559, 50560, 50561, 
+    50562, 50563, 50564, 50565, 50566, 50567, 50568, 50569, 50570, 50571, 
+    50572, 50573, 50574, 50575, 50576, 50577, 50578, 50579, 50580, 50581, 
+    50582, 50583, 50584, 50585, 50586, 50587, 50588, 50589, 50590, 50591, 
+    50592, 50593, 50594, 50595, 50596, 50597, 50598, 50599, 50600, 50601, 
+    50602, 50603, 50604, 50605, 50606, 50607, 50608, 50609, 50610, 50611, 
+    50612, 50613, 50614, 50615, 50616, 50617, 50618, 50619, 50620, 50621, 
+    50622, 50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 
+    50632, 50633, 50634, 50635, 50636, 50637, 50638, 50639, 50640, 50641, 
+    50642, 50643, 50644, 50645, 50646, 50647, 50648, 50649, 50650, 50651, 
+    50652, 50653, 50654, 50655, 50656, 50657, 50658, 50659, 50660, 50661, 
+    50662, 50663, 50664, 50665, 50666, 50667, 50668, 50669, 50670, 50671, 
+    50672, 50673, 50674, 50675, 50676, 50677, 50678, 50679, 50680, 50681, 
+    50682, 50683, 50684, 50685, 50686, 50687, 50688, 50689, 50690, 50691, 
+    50692, 50693, 50694, 50695, 50696, 50697, 50698, 50699, 50700, 50701, 
+    50702, 50703, 50704, 50705, 50706, 50707, 50708, 50709, 50710, 50711, 
+    50712, 50713, 50714, 50715, 50716, 50717, 50718, 50719, 50720, 50721, 
+    50722, 50723, 50724, 50725, 50726, 50727, 50728, 50729, 50730, 50731, 
+    50732, 50733, 50734, 50735, 50736, 50737, 50738, 50739, 50740, 50741, 
+    50742, 50743, 50744, 50745, 50746, 50747, 50748, 50749, 50750, 50751, 
+    50752, 50753, 50754, 50755, 50756, 50757, 50758, 50759, 50760, 50761, 
+    50762, 50763, 50764, 50765, 50766, 50767, 50768, 50769, 50770, 50771, 
+    50772, 50773, 50774, 50775, 50776, 50777, 50778, 50779, 50780, 50781, 
+    50782, 50783, 50784, 50785, 50786, 50787, 50788, 50789, 50790, 50791, 
+    50792, 50793, 50794, 50795, 50796, 50797, 50798, 50799, 50800, 50801, 
+    50802, 50803, 50804, 50805, 50806, 50807, 50808, 50809, 50810, 50811, 
+    50812, 50813, 50814, 50815, 50816, 50817, 50818, 50819, 50820, 50821, 
+    50822, 50823, 50824, 50825, 50826, 50827, 50828, 50829, 50830, 50831, 
+    50832, 50833, 50834, 50835, 50836, 50837, 50838, 50839, 50840, 50841, 
+    50842, 50843, 50844, 50845, 50846, 50847, 50848, 50849, 50850, 50851, 
+    50852, 50853, 50854, 50855, 50856, 50857, 50858, 50859, 50860, 50861, 
+    50862, 50863, 50864, 50865, 50866, 50867, 50868, 50869, 50870, 50871, 
+    50872, 50873, 50874, 50875, 50876, 50877, 50878, 50879, 50880, 50881, 
+    50882, 50883, 50884, 50885, 50886, 50887, 50888, 50889, 50890, 50891, 
+    50892, 50893, 50894, 50895, 50896, 50897, 50898, 50899, 50900, 50901, 
+    50902, 50903, 50904, 50905, 50906, 50907, 50908, 50909, 50910, 50911, 
+    50912, 50913, 50914, 50915, 50916, 50917, 50918, 50919, 50920, 50921, 
+    50922, 50923, 50924, 50925, 50926, 50927, 50928, 50929, 50930, 50931, 
+    50932, 50933, 50934, 50935, 50936, 50937, 50938, 50939, 50940, 50941, 
+    50942, 50943, 50944, 50945, 50946, 50947, 50948, 50949, 50950, 50951, 
+    50952, 50953, 50954, 50955, 50956, 50957, 50958, 50959, 50960, 50961, 
+    50962, 50963, 50964, 50965, 50966, 50967, 50968, 50969, 50970, 50971, 
+    50972, 50973, 50974, 50975, 50976, 50977, 50978, 50979, 50980, 50981, 
+    50982, 50983, 50984, 50985, 50986, 50987, 50988, 50989, 50990, 50991, 
+    50992, 50993, 50994, 50995, 50996, 50997, 50998, 50999, 51000, 51001, 
+    51002, 51003, 51004, 51005, 51006, 51007, 51008, 51009, 51010, 51011, 
+    51012, 51013, 51014, 51015, 51016, 51017, 51018, 51019, 51020, 51021, 
+    51022, 51023, 51024, 51025, 51026, 51027, 51028, 51029, 51030, 51031, 
+    51032, 51033, 51034, 51035, 51036, 51037, 51038, 51039, 51040, 51041, 
+    51042, 51043, 51044, 51045, 51046, 51047, 51048, 51049, 51050, 51051, 
+    51052, 51053, 51054, 51055, 51056, 51057, 51058, 51059, 51060, 51061, 
+    51062, 51063, 51064, 51065, 51066, 51067, 51068, 51069, 51070, 51071, 
+    51072, 51073, 51074, 51075, 51076, 51077, 51078, 51079, 51080, 51081, 
+    51082, 51083, 51084, 51085, 51086, 51087, 51088, 51089, 51090, 51091, 
+    51092, 51093, 51094, 51095, 51096, 51097, 51098, 51099, 51100, 51101, 
+    51102, 51103, 51104, 51105, 51106, 51107, 51108, 51109, 51110, 51111, 
+    51112, 51113, 51114, 51115, 51116, 51117, 51118, 51119, 51120, 51121, 
+    51122, 51123, 51124, 51125, 51126, 51127, 51128, 51129, 51130, 51131, 
+    51132, 51133, 51134, 51135, 51136, 51137, 51138, 51139, 51140, 51141, 
+    51142, 51143, 51144, 51145, 51146, 51147, 51148, 51149, 51150, 51151, 
+    51152, 51153, 51154, 51155, 51156, 51157, 51158, 51159, 51160, 51161, 
+    51162, 51163, 51164, 51165, 51166, 51167, 51168, 51169, 51170, 51171, 
+    51172, 51173, 51174, 51175, 51176, 51177, 51178, 51179, 51180, 51181, 
+    51182, 51183, 51184, 51185, 51186, 51187, 51188, 51189, 51190, 51191, 
+    51192, 51193, 51194, 51195, 51196, 51197, 51198, 51199, 51200, 51201, 
+    51202, 51203, 51204, 51205, 51206, 51207, 51208, 51209, 51210, 51211, 
+    51212, 51213, 51214, 51215, 51216, 51217, 51218, 51219, 51220, 51221, 
+    51222, 51223, 51224, 51225, 51226, 51227, 51228, 51229, 51230, 51231, 
+    51232, 51233, 51234, 51235, 51236, 51237, 51238, 51239, 51240, 51241, 
+    51242, 51243, 51244, 51245, 51246, 51247, 51248, 51249, 51250, 51251, 
+    51252, 51253, 51254, 51255, 51256, 51257, 51258, 51259, 51260, 51261, 
+    51262, 51263, 51264, 51265, 51266, 51267, 51268, 51269, 51270, 51271, 
+    51272, 51273, 51274, 51275, 51276, 51277, 51278, 51279, 51280, 51281, 
+    51282, 51283, 51284, 51285, 51286, 51287, 51288, 51289, 51290, 51291, 
+    51292, 51293, 51294, 51295, 51296, 51297, 51298, 51299, 51300, 51301, 
+    51302, 51303, 51304, 51305, 51306, 51307, 51308, 51309, 51310, 51311, 
+    51312, 51313, 51314, 51315, 51316, 51317, 51318, 51319, 51320, 51321, 
+    51322, 51323, 51324, 51325, 51326, 51327, 51328, 51329, 51330, 51331, 
+    51332, 51333, 51334, 51335, 51336, 51337, 51338, 51339, 51340, 51341, 
+    51342, 51343, 51344, 51345, 51346, 51347, 51348, 51349, 51350, 51351, 
+    51352, 51353, 51354, 51355, 51356, 51357, 51358, 51359, 51360, 51361, 
+    51362, 51363, 51364, 51365, 51366, 51367, 51368, 51369, 51370, 51371, 
+    51372, 51373, 51374, 51375, 51376, 51377, 51378, 51379, 51380, 51381, 
+    51382, 51383, 51384, 51385, 51386, 51387, 51388, 51389, 51390, 51391, 
+    51392, 51393, 51394, 51395, 51396, 51397, 51398, 51399, 51400, 51401, 
+    51402, 51403, 51404, 51405, 51406, 51407, 51408, 51409, 51410, 51411, 
+    51412, 51413, 51414, 51415, 51416, 51417, 51418, 51419, 51420, 51421, 
+    51422, 51423, 51424, 51425, 51426, 51427, 51428, 51429, 51430, 51431, 
+    51432, 51433, 51434, 51435, 51436, 51437, 51438, 51439, 51440, 51441, 
+    51442, 51443, 51444, 51445, 51446, 51447, 51448, 51449, 51450, 51451, 
+    51452, 51453, 51454, 51455, 51456, 51457, 51458, 51459, 51460, 51461, 
+    51462, 51463, 51464, 51465, 51466, 51467, 51468, 51469, 51470, 51471, 
+    51472, 51473, 51474, 51475, 51476, 51477, 51478, 51479, 51480, 51481, 
+    51482, 51483, 51484, 51485, 51486, 51487, 51488, 51489, 51490, 51491, 
+    51492, 51493, 51494, 51495, 51496, 51497, 51498, 51499, 51500, 51501, 
+    51502, 51503, 51504, 51505, 51506, 51507, 51508, 51509, 51510, 51511, 
+    51512, 51513, 51514, 51515, 51516, 51517, 51518, 51519, 51520, 51521, 
+    51522, 51523, 51524, 51525, 51526, 51527, 51528, 51529, 51530, 51531, 
+    51532, 51533, 51534, 51535, 51536, 51537, 51538, 51539, 51540, 51541, 
+    51542, 51543, 51544, 51545, 51546, 51547, 51548, 51549, 51550, 51551, 
+    51552, 51553, 51554, 51555, 51556, 51557, 51558, 51559, 51560, 51561, 
+    51562, 51563, 51564, 51565, 51566, 51567, 51568, 51569, 51570, 51571, 
+    51572, 51573, 51574, 51575, 51576, 51577, 51578, 51579, 51580, 51581, 
+    51582, 51583, 51584, 51585, 51586, 51587, 51588, 51589, 51590, 51591, 
+    51592, 51593, 51594, 51595, 51596, 51597, 51598, 51599, 51600, 51601, 
+    51602, 51603, 51604, 51605, 51606, 51607, 51608, 51609, 51610, 51611, 
+    51612, 51613, 51614, 51615, 51616, 51617, 51618, 51619, 51620, 51621, 
+    51622, 51623, 51624, 51625, 51626, 51627, 51628, 51629, 51630, 51631, 
+    51632, 51633, 51634, 51635, 51636, 51637, 51638, 51639, 51640, 51641, 
+    51642, 51643, 51644, 51645, 51646, 51647, 51648, 51649, 51650, 51651, 
+    51652, 51653, 51654, 51655, 51656, 51657, 51658, 51659, 51660, 51661, 
+    51662, 51663, 51664, 51665, 51666, 51667, 51668, 51669, 51670, 51671, 
+    51672, 51673, 51674, 51675, 51676, 51677, 51678, 51679, 51680, 51681, 
+    51682, 51683, 51684, 51685, 51686, 51687, 51688, 51689, 51690, 51691, 
+    51692, 51693, 51694, 51695, 51696, 51697, 51698, 51699, 51700, 51701, 
+    51702, 51703, 51704, 51705, 51706, 51707, 51708, 51709, 51710, 51711, 
+    51712, 51713, 51714, 51715, 51716, 51717, 51718, 51719, 51720, 51721, 
+    51722, 51723, 51724, 51725, 51726, 51727, 51728, 51729, 51730, 51731, 
+    51732, 51733, 51734, 51735, 51736, 51737, 51738, 51739, 51740, 51741, 
+    51742, 51743, 51744, 51745, 51746, 51747, 51748, 51749, 51750, 51751, 
+    51752, 51753, 51754, 51755, 51756, 51757, 51758, 51759, 51760, 51761, 
+    51762, 51763, 51764, 51765, 51766, 51767, 51768, 51769, 51770, 51771, 
+    51772, 51773, 51774, 51775, 51776, 51777, 51778, 51779, 51780, 51781, 
+    51782, 51783, 51784, 51785, 51786, 51787, 51788, 51789, 51790, 51791, 
+    51792, 51793, 51794, 51795, 51796, 51797, 51798, 51799, 51800, 51801, 
+    51802, 51803, 51804, 51805, 51806, 51807, 51808, 51809, 51810, 51811, 
+    51812, 51813, 51814, 51815, 51816, 51817, 51818, 51819, 51820, 51821, 
+    51822, 51823, 51824, 51825, 51826, 51827, 51828, 51829, 51830, 51831, 
+    51832, 51833, 51834, 51835, 51836, 51837, 51838, 51839, 51840, 51841, 
+    51842, 51843, 51844, 51845, 51846, 51847, 51848, 51849, 51850, 51851, 
+    51852, 51853, 51854, 51855, 51856, 51857, 51858, 51859, 51860, 51861, 
+    51862, 51863, 51864, 51865, 51866, 51867, 51868, 51869, 51870, 51871, 
+    51872, 51873, 51874, 51875, 51876, 51877, 51878, 51879, 51880, 51881, 
+    51882, 51883, 51884, 51885, 51886, 51887, 51888, 51889, 51890, 51891, 
+    51892, 51893, 51894, 51895, 51896, 51897, 51898, 51899, 51900, 51901, 
+    51902, 51903, 51904, 51905, 51906, 51907, 51908, 51909, 51910, 51911, 
+    51912, 51913, 51914, 51915, 51916, 51917, 51918, 51919, 51920, 51921, 
+    51922, 51923, 51924, 51925, 51926, 51927, 51928, 51929, 51930, 51931, 
+    51932, 51933, 51934, 51935, 51936, 51937, 51938, 51939, 51940, 51941, 
+    51942, 51943, 51944, 51945, 51946, 51947, 51948, 51949, 51950, 51951, 
+    51952, 51953, 51954, 51955, 51956, 51957, 51958, 51959, 51960, 51961, 
+    51962, 51963, 51964, 51965, 51966, 51967, 51968, 51969, 51970, 51971, 
+    51972, 51973, 51974, 51975, 51976, 51977, 51978, 51979, 51980, 51981, 
+    51982, 51983, 51984, 51985, 51986, 51987, 51988, 51989, 51990, 51991, 
+    51992, 51993, 51994, 51995, 51996, 51997, 51998, 51999, 52000, 52001, 
+    52002, 52003, 52004, 52005, 52006, 52007, 52008, 52009, 52010, 52011, 
+    52012, 52013, 52014, 52015, 52016, 52017, 52018, 52019, 52020, 52021, 
+    52022, 52023, 52024, 52025, 52026, 52027, 52028, 52029, 52030, 52031, 
+    52032, 52033, 52034, 52035, 52036, 52037, 52038, 52039, 52040, 52041, 
+    52042, 52043, 52044, 52045, 52046, 52047, 52048, 52049, 52050, 52051, 
+    52052, 52053, 52054, 52055, 52056, 52057, 52058, 52059, 52060, 52061, 
+    52062, 52063, 52064, 52065, 52066, 52067, 52068, 52069, 52070, 52071, 
+    52072, 52073, 52074, 52075, 52076, 52077, 52078, 52079, 52080, 52081, 
+    52082, 52083, 52084, 52085, 52086, 52087, 52088, 52089, 52090, 52091, 
+    52092, 52093, 52094, 52095, 52096, 52097, 52098, 52099, 52100, 52101, 
+    52102, 52103, 52104, 52105, 52106, 52107, 52108, 52109, 52110, 52111, 
+    52112, 52113, 52114, 52115, 52116, 52117, 52118, 52119, 52120, 52121, 
+    52122, 52123, 52124, 52125, 52126, 52127, 52128, 52129, 52130, 52131, 
+    52132, 52133, 52134, 52135, 52136, 52137, 52138, 52139, 52140, 52141, 
+    52142, 52143, 52144, 52145, 52146, 52147, 52148, 52149, 52150, 52151, 
+    52152, 52153, 52154, 52155, 52156, 52157, 52158, 52159, 52160, 52161, 
+    52162, 52163, 52164, 52165, 52166, 52167, 52168, 52169, 52170, 52171, 
+    52172, 52173, 52174, 52175, 52176, 52177, 52178, 52179, 52180, 52181, 
+    52182, 52183, 52184, 52185, 52186, 52187, 52188, 52189, 52190, 52191, 
+    52192, 52193, 52194, 52195, 52196, 52197, 52198, 52199, 52200, 52201, 
+    52202, 52203, 52204, 52205, 52206, 52207, 52208, 52209, 52210, 52211, 
+    52212, 52213, 52214, 52215, 52216, 52217, 52218, 52219, 52220, 52221, 
+    52222, 52223, 52224, 52225, 52226, 52227, 52228, 52229, 52230, 52231, 
+    52232, 52233, 52234, 52235, 52236, 52237, 52238, 52239, 52240, 52241, 
+    52242, 52243, 52244, 52245, 52246, 52247, 52248, 52249, 52250, 52251, 
+    52252, 52253, 52254, 52255, 52256, 52257, 52258, 52259, 52260, 52261, 
+    52262, 52263, 52264, 52265, 52266, 52267, 52268, 52269, 52270, 52271, 
+    52272, 52273, 52274, 52275, 52276, 52277, 52278, 52279, 52280, 52281, 
+    52282, 52283, 52284, 52285, 52286, 52287, 52288, 52289, 52290, 52291, 
+    52292, 52293, 52294, 52295, 52296, 52297, 52298, 52299, 52300, 52301, 
+    52302, 52303, 52304, 52305, 52306, 52307, 52308, 52309, 52310, 52311, 
+    52312, 52313, 52314, 52315, 52316, 52317, 52318, 52319, 52320, 52321, 
+    52322, 52323, 52324, 52325, 52326, 52327, 52328, 52329, 52330, 52331, 
+    52332, 52333, 52334, 52335, 52336, 52337, 52338, 52339, 52340, 52341, 
+    52342, 52343, 52344, 52345, 52346, 52347, 52348, 52349, 52350, 52351, 
+    52352, 52353, 52354, 52355, 52356, 52357, 52358, 52359, 52360, 52361, 
+    52362, 52363, 52364, 52365, 52366, 52367, 52368, 52369, 52370, 52371, 
+    52372, 52373, 52374, 52375, 52376, 52377, 52378, 52379, 52380, 52381, 
+    52382, 52383, 52384, 52385, 52386, 52387, 52388, 52389, 52390, 52391, 
+    52392, 52393, 52394, 52395, 52396, 52397, 52398, 52399, 52400, 52401, 
+    52402, 52403, 52404, 52405, 52406, 52407, 52408, 52409, 52410, 52411, 
+    52412, 52413, 52414, 52415, 52416, 52417, 52418, 52419, 52420, 52421, 
+    52422, 52423, 52424, 52425, 52426, 52427, 52428, 52429, 52430, 52431, 
+    52432, 52433, 52434, 52435, 52436, 52437, 52438, 52439, 52440, 52441, 
+    52442, 52443, 52444, 52445, 52446, 52447, 52448, 52449, 52450, 52451, 
+    52452, 52453, 52454, 52455, 52456, 52457, 52458, 52459, 52460, 52461, 
+    52462, 52463, 52464, 52465, 52466, 52467, 52468, 52469, 52470, 52471, 
+    52472, 52473, 52474, 52475, 52476, 52477, 52478, 52479, 52480, 52481, 
+    52482, 52483, 52484, 52485, 52486, 52487, 52488, 52489, 52490, 52491, 
+    52492, 52493, 52494, 52495, 52496, 52497, 52498, 52499, 52500, 52501, 
+    52502, 52503, 52504, 52505, 52506, 52507, 52508, 52509, 52510, 52511, 
+    52512, 52513, 52514, 52515, 52516, 52517, 52518, 52519, 52520, 52521, 
+    52522, 52523, 52524, 52525, 52526, 52527, 52528, 52529, 52530, 52531, 
+    52532, 52533, 52534, 52535, 52536, 52537, 52538, 52539, 52540, 52541, 
+    52542, 52543, 52544, 52545, 52546, 52547, 52548, 52549, 52550, 52551, 
+    52552, 52553, 52554, 52555, 52556, 52557, 52558, 52559, 52560, 52561, 
+    52562, 52563, 52564, 52565, 52566, 52567, 52568, 52569, 52570, 52571, 
+    52572, 52573, 52574, 52575, 52576, 52577, 52578, 52579, 52580, 52581, 
+    52582, 52583, 52584, 52585, 52586, 52587, 52588, 52589, 52590, 52591, 
+    52592, 52593, 52594, 52595, 52596, 52597, 52598, 52599, 52600, 52601, 
+    52602, 52603, 52604, 52605, 52606, 52607, 52608, 52609, 52610, 52611, 
+    52612, 52613, 52614, 52615, 52616, 52617, 52618, 52619, 52620, 52621, 
+    52622, 52623, 52624, 52625, 52626, 52627, 52628, 52629, 52630, 52631, 
+    52632, 52633, 52634, 52635, 52636, 52637, 52638, 52639, 52640, 52641, 
+    52642, 52643, 52644, 52645, 52646, 52647, 52648, 52649, 52650, 52651, 
+    52652, 52653, 52654, 52655, 52656, 52657, 52658, 52659, 52660, 52661, 
+    52662, 52663, 52664, 52665, 52666, 52667, 52668, 52669, 52670, 52671, 
+    52672, 52673, 52674, 52675, 52676, 52677, 52678, 52679, 52680, 52681, 
+    52682, 52683, 52684, 52685, 52686, 52687, 52688, 52689, 52690, 52691, 
+    52692, 52693, 52694, 52695, 52696, 52697, 52698, 52699, 52700, 52701, 
+    52702, 52703, 52704, 52705, 52706, 52707, 52708, 52709, 52710, 52711, 
+    52712, 52713, 52714, 52715, 52716, 52717, 52718, 52719, 52720, 52721, 
+    52722, 52723, 52724, 52725, 52726, 52727, 52728, 52729, 52730, 52731, 
+    52732, 52733, 52734, 52735, 52736, 52737, 52738, 52739, 52740, 52741, 
+    52742, 52743, 52744, 52745, 52746, 52747, 52748, 52749, 52750, 52751, 
+    52752, 52753, 52754, 52755, 52756, 52757, 52758, 52759, 52760, 52761, 
+    52762, 52763, 52764, 52765, 52766, 52767, 52768, 52769, 52770, 52771, 
+    52772, 52773, 52774, 52775, 52776, 52777, 52778, 52779, 52780, 52781, 
+    52782, 52783, 52784, 52785, 52786, 52787, 52788, 52789, 52790, 52791, 
+    52792, 52793, 52794, 52795, 52796, 52797, 52798, 52799, 52800, 52801, 
+    52802, 52803, 52804, 52805, 52806, 52807, 52808, 52809, 52810, 52811, 
+    52812, 52813, 52814, 52815, 52816, 52817, 52818, 52819, 52820, 52821, 
+    52822, 52823, 52824, 52825, 52826, 52827, 52828, 52829, 52830, 52831, 
+    52832, 52833, 52834, 52835, 52836, 52837, 52838, 52839, 52840, 52841, 
+    52842, 52843, 52844, 52845, 52846, 52847, 52848, 52849, 52850, 52851, 
+    52852, 52853, 52854, 52855, 52856, 52857, 52858, 52859, 52860, 52861, 
+    52862, 52863, 52864, 52865, 52866, 52867, 52868, 52869, 52870, 52871, 
+    52872, 52873, 52874, 52875, 52876, 52877, 52878, 52879, 52880, 52881, 
+    52882, 52883, 52884, 52885, 52886, 52887, 52888, 52889, 52890, 52891, 
+    52892, 52893, 52894, 52895, 52896, 52897, 52898, 52899, 52900, 52901, 
+    52902, 52903, 52904, 52905, 52906, 52907, 52908, 52909, 52910, 52911, 
+    52912, 52913, 52914, 52915, 52916, 52917, 52918, 52919, 52920, 52921, 
+    52922, 52923, 52924, 52925, 52926, 52927, 52928, 52929, 52930, 52931, 
+    52932, 52933, 52934, 52935, 52936, 52937, 52938, 52939, 52940, 52941, 
+    52942, 52943, 52944, 52945, 52946, 52947, 52948, 52949, 52950, 52951, 
+    52952, 52953, 52954, 52955, 52956, 52957, 52958, 52959, 52960, 52961, 
+    52962, 52963, 52964, 52965, 52966, 52967, 52968, 52969, 52970, 52971, 
+    52972, 52973, 52974, 52975, 52976, 52977, 52978, 52979, 52980, 52981, 
+    52982, 52983, 52984, 52985, 52986, 52987, 52988, 52989, 52990, 52991, 
+    52992, 52993, 52994, 52995, 52996, 52997, 52998, 52999, 53000, 53001, 
+    53002, 53003, 53004, 53005, 53006, 53007, 53008, 53009, 53010, 53011, 
+    53012, 53013, 53014, 53015, 53016, 53017, 53018, 53019, 53020, 53021, 
+    53022, 53023, 53024, 53025, 53026, 53027, 53028, 53029, 53030, 53031, 
+    53032, 53033, 53034, 53035, 53036, 53037, 53038, 53039, 53040, 53041, 
+    53042, 53043, 53044, 53045, 53046, 53047, 53048, 53049, 53050, 53051, 
+    53052, 53053, 53054, 53055, 53056, 53057, 53058, 53059, 53060, 53061, 
+    53062, 53063, 53064, 53065, 53066, 53067, 53068, 53069, 53070, 53071, 
+    53072, 53073, 53074, 53075, 53076, 53077, 53078, 53079, 53080, 53081, 
+    53082, 53083, 53084, 53085, 53086, 53087, 53088, 53089, 53090, 53091, 
+    53092, 53093, 53094, 53095, 53096, 53097, 53098, 53099, 53100, 53101, 
+    53102, 53103, 53104, 53105, 53106, 53107, 53108, 53109, 53110, 53111, 
+    53112, 53113, 53114, 53115, 53116, 53117, 53118, 53119, 53120, 53121, 
+    53122, 53123, 53124, 53125, 53126, 53127, 53128, 53129, 53130, 53131, 
+    53132, 53133, 53134, 53135, 53136, 53137, 53138, 53139, 53140, 53141, 
+    53142, 53143, 53144, 53145, 53146, 53147, 53148, 53149, 53150, 53151, 
+    53152, 53153, 53154, 53155, 53156, 53157, 53158, 53159, 53160, 53161, 
+    53162, 53163, 53164, 53165, 53166, 53167, 53168, 53169, 53170, 53171, 
+    53172, 53173, 53174, 53175, 53176, 53177, 53178, 53179, 53180, 53181, 
+    53182, 53183, 53184, 53185, 53186, 53187, 53188, 53189, 53190, 53191, 
+    53192, 53193, 53194, 53195, 53196, 53197, 53198, 53199, 53200, 53201, 
+    53202, 53203, 53204, 53205, 53206, 53207, 53208, 53209, 53210, 53211, 
+    53212, 53213, 53214, 53215, 53216, 53217, 53218, 53219, 53220, 53221, 
+    53222, 53223, 53224, 53225, 53226, 53227, 53228, 53229, 53230, 53231, 
+    53232, 53233, 53234, 53235, 53236, 53237, 53238, 53239, 53240, 53241, 
+    53242, 53243, 53244, 53245, 53246, 53247, 53248, 53249, 53250, 53251, 
+    53252, 53253, 53254, 53255, 53256, 53257, 53258, 53259, 53260, 53261, 
+    53262, 53263, 53264, 53265, 53266, 53267, 53268, 53269, 53270, 53271, 
+    53272, 53273, 53274, 53275, 53276, 53277, 53278, 53279, 53280, 53281, 
+    53282, 53283, 53284, 53285, 53286, 53287, 53288, 53289, 53290, 53291, 
+    53292, 53293, 53294, 53295, 53296, 53297, 53298, 53299, 53300, 53301, 
+    53302, 53303, 53304, 53305, 53306, 53307, 53308, 53309, 53310, 53311, 
+    53312, 53313, 53314, 53315, 53316, 53317, 53318, 53319, 53320, 53321, 
+    53322, 53323, 53324, 53325, 53326, 53327, 53328, 53329, 53330, 53331, 
+    53332, 53333, 53334, 53335, 53336, 53337, 53338, 53339, 53340, 53341, 
+    53342, 53343, 53344, 53345, 53346, 53347, 53348, 53349, 53350, 53351, 
+    53352, 53353, 53354, 53355, 53356, 53357, 53358, 53359, 53360, 53361, 
+    53362, 53363, 53364, 53365, 53366, 53367, 53368, 53369, 53370, 53371, 
+    53372, 53373, 53374, 53375, 53376, 53377, 53378, 53379, 53380, 53381, 
+    53382, 53383, 53384, 53385, 53386, 53387, 53388, 53389, 53390, 53391, 
+    53392, 53393, 53394, 53395, 53396, 53397, 53398, 53399, 53400, 53401, 
+    53402, 53403, 53404, 53405, 53406, 53407, 53408, 53409, 53410, 53411, 
+    53412, 53413, 53414, 53415, 53416, 53417, 53418, 53419, 53420, 53421, 
+    53422, 53423, 53424, 53425, 53426, 53427, 53428, 53429, 53430, 53431, 
+    53432, 53433, 53434, 53435, 53436, 53437, 53438, 53439, 53440, 53441, 
+    53442, 53443, 53444, 53445, 53446, 53447, 53448, 53449, 53450, 53451, 
+    53452, 53453, 53454, 53455, 53456, 53457, 53458, 53459, 53460, 53461, 
+    53462, 53463, 53464, 53465, 53466, 53467, 53468, 53469, 53470, 53471, 
+    53472, 53473, 53474, 53475, 53476, 53477, 53478, 53479, 53480, 53481, 
+    53482, 53483, 53484, 53485, 53486, 53487, 53488, 53489, 53490, 53491, 
+    53492, 53493, 53494, 53495, 53496, 53497, 53498, 53499, 53500, 53501, 
+    53502, 53503, 53504, 53505, 53506, 53507, 53508, 53509, 53510, 53511, 
+    53512, 53513, 53514, 53515, 53516, 53517, 53518, 53519, 53520, 53521, 
+    53522, 53523, 53524, 53525, 53526, 53527, 53528, 53529, 53530, 53531, 
+    53532, 53533, 53534, 53535, 53536, 53537, 53538, 53539, 53540, 53541, 
+    53542, 53543, 53544, 53545, 53546, 53547, 53548, 53549, 53550, 53551, 
+    53552, 53553, 53554, 53555, 53556, 53557, 53558, 53559, 53560, 53561, 
+    53562, 53563, 53564, 53565, 53566, 53567, 53568, 53569, 53570, 53571, 
+    53572, 53573, 53574, 53575, 53576, 53577, 53578, 53579, 53580, 53581, 
+    53582, 53583, 53584, 53585, 53586, 53587, 53588, 53589, 53590, 53591, 
+    53592, 53593, 53594, 53595, 53596, 53597, 53598, 53599, 53600, 53601, 
+    53602, 53603, 53604, 53605, 53606, 53607, 53608, 53609, 53610, 53611, 
+    53612, 53613, 53614, 53615, 53616, 53617, 53618, 53619, 53620, 53621, 
+    53622, 53623, 53624, 53625, 53626, 53627, 53628, 53629, 53630, 53631, 
+    53632, 53633, 53634, 53635, 53636, 53637, 53638, 53639, 53640, 53641, 
+    53642, 53643, 53644, 53645, 53646, 53647, 53648, 53649, 53650, 53651, 
+    53652, 53653, 53654, 53655, 53656, 53657, 53658, 53659, 53660, 53661, 
+    53662, 53663, 53664, 53665, 53666, 53667, 53668, 53669, 53670, 53671, 
+    53672, 53673, 53674, 53675, 53676, 53677, 53678, 53679, 53680, 53681, 
+    53682, 53683, 53684, 53685, 53686, 53687, 53688, 53689, 53690, 53691, 
+    53692, 53693, 53694, 53695, 53696, 53697, 53698, 53699, 53700, 53701, 
+    53702, 53703, 53704, 53705, 53706, 53707, 53708, 53709, 53710, 53711, 
+    53712, 53713, 53714, 53715, 53716, 53717, 53718, 53719, 53720, 53721, 
+    53722, 53723, 53724, 53725, 53726, 53727, 53728, 53729, 53730, 53731, 
+    53732, 53733, 53734, 53735, 53736, 53737, 53738, 53739, 53740, 53741, 
+    53742, 53743, 53744, 53745, 53746, 53747, 53748, 53749, 53750, 53751, 
+    53752, 53753, 53754, 53755, 53756, 53757, 53758, 53759, 53760, 53761, 
+    53762, 53763, 53764, 53765, 53766, 53767, 53768, 53769, 53770, 53771, 
+    53772, 53773, 53774, 53775, 53776, 53777, 53778, 53779, 53780, 53781, 
+    53782, 53783, 53784, 53785, 53786, 53787, 53788, 53789, 53790, 53791, 
+    53792, 53793, 53794, 53795, 53796, 53797, 53798, 53799, 53800, 53801, 
+    53802, 53803, 53804, 53805, 53806, 53807, 53808, 53809, 53810, 53811, 
+    53812, 53813, 53814, 53815, 53816, 53817, 53818, 53819, 53820, 53821, 
+    53822, 53823, 53824, 53825, 53826, 53827, 53828, 53829, 53830, 53831, 
+    53832, 53833, 53834, 53835, 53836, 53837, 53838, 53839, 53840, 53841, 
+    53842, 53843, 53844, 53845, 53846, 53847, 53848, 53849, 53850, 53851, 
+    53852, 53853, 53854, 53855, 53856, 53857, 53858, 53859, 53860, 53861, 
+    53862, 53863, 53864, 53865, 53866, 53867, 53868, 53869, 53870, 53871, 
+    53872, 53873, 53874, 53875, 53876, 53877, 53878, 53879, 53880, 53881, 
+    53882, 53883, 53884, 53885, 53886, 53887, 53888, 53889, 53890, 53891, 
+    53892, 53893, 53894, 53895, 53896, 53897, 53898, 53899, 53900, 53901, 
+    53902, 53903, 53904, 53905, 53906, 53907, 53908, 53909, 53910, 53911, 
+    53912, 53913, 53914, 53915, 53916, 53917, 53918, 53919, 53920, 53921, 
+    53922, 53923, 53924, 53925, 53926, 53927, 53928, 53929, 53930, 53931, 
+    53932, 53933, 53934, 53935, 53936, 53937, 53938, 53939, 53940, 53941, 
+    53942, 53943, 53944, 53945, 53946, 53947, 53948, 53949, 53950, 53951, 
+    53952, 53953, 53954, 53955, 53956, 53957, 53958, 53959, 53960, 53961, 
+    53962, 53963, 53964, 53965, 53966, 53967, 53968, 53969, 53970, 53971, 
+    53972, 53973, 53974, 53975, 53976, 53977, 53978, 53979, 53980, 53981, 
+    53982, 53983, 53984, 53985, 53986, 53987, 53988, 53989, 53990, 53991, 
+    53992, 53993, 53994, 53995, 53996, 53997, 53998, 53999, 54000, 54001, 
+    54002, 54003, 54004, 54005, 54006, 54007, 54008, 54009, 54010, 54011, 
+    54012, 54013, 54014, 54015, 54016, 54017, 54018, 54019, 54020, 54021, 
+    54022, 54023, 54024, 54025, 54026, 54027, 54028, 54029, 54030, 54031, 
+    54032, 54033, 54034, 54035, 54036, 54037, 54038, 54039, 54040, 54041, 
+    54042, 54043, 54044, 54045, 54046, 54047, 54048, 54049, 54050, 54051, 
+    54052, 54053, 54054, 54055, 54056, 54057, 54058, 54059, 54060, 54061, 
+    54062, 54063, 54064, 54065, 54066, 54067, 54068, 54069, 54070, 54071, 
+    54072, 54073, 54074, 54075, 54076, 54077, 54078, 54079, 54080, 54081, 
+    54082, 54083, 54084, 54085, 54086, 54087, 54088, 54089, 54090, 54091, 
+    54092, 54093, 54094, 54095, 54096, 54097, 54098, 54099, 54100, 54101, 
+    54102, 54103, 54104, 54105, 54106, 54107, 54108, 54109, 54110, 54111, 
+    54112, 54113, 54114, 54115, 54116, 54117, 54118, 54119, 54120, 54121, 
+    54122, 54123, 54124, 54125, 54126, 54127, 54128, 54129, 54130, 54131, 
+    54132, 54133, 54134, 54135, 54136, 54137, 54138, 54139, 54140, 54141, 
+    54142, 54143, 54144, 54145, 54146, 54147, 54148, 54149, 54150, 54151, 
+    54152, 54153, 54154, 54155, 54156, 54157, 54158, 54159, 54160, 54161, 
+    54162, 54163, 54164, 54165, 54166, 54167, 54168, 54169, 54170, 54171, 
+    54172, 54173, 54174, 54175, 54176, 54177, 54178, 54179, 54180, 54181, 
+    54182, 54183, 54184, 54185, 54186, 54187, 54188, 54189, 54190, 54191, 
+    54192, 54193, 54194, 54195, 54196, 54197, 54198, 54199, 54200, 54201, 
+    54202, 54203, 54204, 54205, 54206, 54207, 54208, 54209, 54210, 54211, 
+    54212, 54213, 54214, 54215, 54216, 54217, 54218, 54219, 54220, 54221, 
+    54222, 54223, 54224, 54225, 54226, 54227, 54228, 54229, 54230, 54231, 
+    54232, 54233, 54234, 54235, 54236, 54237, 54238, 54239, 54240, 54241, 
+    54242, 54243, 54244, 54245, 54246, 54247, 54248, 54249, 54250, 54251, 
+    54252, 54253, 54254, 54255, 54256, 54257, 54258, 54259, 54260, 54261, 
+    54262, 54263, 54264, 54265, 54266, 54267, 54268, 54269, 54270, 54271, 
+    54272, 54273, 54274, 54275, 54276, 54277, 54278, 54279, 54280, 54281, 
+    54282, 54283, 54284, 54285, 54286, 54287, 54288, 54289, 54290, 54291, 
+    54292, 54293, 54294, 54295, 54296, 54297, 54298, 54299, 54300, 54301, 
+    54302, 54303, 54304, 54305, 54306, 54307, 54308, 54309, 54310, 54311, 
+    54312, 54313, 54314, 54315, 54316, 54317, 54318, 54319, 54320, 54321, 
+    54322, 54323, 54324, 54325, 54326, 54327, 54328, 54329, 54330, 54331, 
+    54332, 54333, 54334, 54335, 54336, 54337, 54338, 54339, 54340, 54341, 
+    54342, 54343, 54344, 54345, 54346, 54347, 54348, 54349, 54350, 54351, 
+    54352, 54353, 54354, 54355, 54356, 54357, 54358, 54359, 54360, 54361, 
+    54362, 54363, 54364, 54365, 54366, 54367, 54368, 54369, 54370, 54371, 
+    54372, 54373, 54374, 54375, 54376, 54377, 54378, 54379, 54380, 54381, 
+    54382, 54383, 54384, 54385, 54386, 54387, 54388, 54389, 54390, 54391, 
+    54392, 54393, 54394, 54395, 54396, 54397, 54398, 54399, 54400, 54401, 
+    54402, 54403, 54404, 54405, 54406, 54407, 54408, 54409, 54410, 54411, 
+    54412, 54413, 54414, 54415, 54416, 54417, 54418, 54419, 54420, 54421, 
+    54422, 54423, 54424, 54425, 54426, 54427, 54428, 54429, 54430, 54431, 
+    54432, 54433, 54434, 54435, 54436, 54437, 54438, 54439, 54440, 54441, 
+    54442, 54443, 54444, 54445, 54446, 54447, 54448, 54449, 54450, 54451, 
+    54452, 54453, 54454, 54455, 54456, 54457, 54458, 54459, 54460, 54461, 
+    54462, 54463, 54464, 54465, 54466, 54467, 54468, 54469, 54470, 54471, 
+    54472, 54473, 54474, 54475, 54476, 54477, 54478, 54479, 54480, 54481, 
+    54482, 54483, 54484, 54485, 54486, 54487, 54488, 54489, 54490, 54491, 
+    54492, 54493, 54494, 54495, 54496, 54497, 54498, 54499, 54500, 54501, 
+    54502, 54503, 54504, 54505, 54506, 54507, 54508, 54509, 54510, 54511, 
+    54512, 54513, 54514, 54515, 54516, 54517, 54518, 54519, 54520, 54521, 
+    54522, 54523, 54524, 54525, 54526, 54527, 54528, 54529, 54530, 54531, 
+    54532, 54533, 54534, 54535, 54536, 54537, 54538, 54539, 54540, 54541, 
+    54542, 54543, 54544, 54545, 54546, 54547, 54548, 54549, 54550, 54551, 
+    54552, 54553, 54554, 54555, 54556, 54557, 54558, 54559, 54560, 54561, 
+    54562, 54563, 54564, 54565, 54566, 54567, 54568, 54569, 54570, 54571, 
+    54572, 54573, 54574, 54575, 54576, 54577, 54578, 54579, 54580, 54581, 
+    54582, 54583, 54584, 54585, 54586, 54587, 54588, 54589, 54590, 54591, 
+    54592, 54593, 54594, 54595, 54596, 54597, 54598, 54599, 54600, 54601, 
+    54602, 54603, 54604, 54605, 54606, 54607, 54608, 54609, 54610, 54611, 
+    54612, 54613, 54614, 54615, 54616, 54617, 54618, 54619, 54620, 54621, 
+    54622, 54623, 54624, 54625, 54626, 54627, 54628, 54629, 54630, 54631, 
+    54632, 54633, 54634, 54635, 54636, 54637, 54638, 54639, 54640, 54641, 
+    54642, 54643, 54644, 54645, 54646, 54647, 54648, 54649, 54650, 54651, 
+    54652, 54653, 54654, 54655, 54656, 54657, 54658, 54659, 54660, 54661, 
+    54662, 54663, 54664, 54665, 54666, 54667, 54668, 54669, 54670, 54671, 
+    54672, 54673, 54674, 54675, 54676, 54677, 54678, 54679, 54680, 54681, 
+    54682, 54683, 54684, 54685, 54686, 54687, 54688, 54689, 54690, 54691, 
+    54692, 54693, 54694, 54695, 54696, 54697, 54698, 54699, 54700, 54701, 
+    54702, 54703, 54704, 54705, 54706, 54707, 54708, 54709, 54710, 54711, 
+    54712, 54713, 54714, 54715, 54716, 54717, 54718, 54719, 54720, 54721, 
+    54722, 54723, 54724, 54725, 54726, 54727, 54728, 54729, 54730, 54731, 
+    54732, 54733, 54734, 54735, 54736, 54737, 54738, 54739, 54740, 54741, 
+    54742, 54743, 54744, 54745, 54746, 54747, 54748, 54749, 54750, 54751, 
+    54752, 54753, 54754, 54755, 54756, 54757, 54758, 54759, 54760, 54761, 
+    54762, 54763, 54764, 54765, 54766, 54767, 54768, 54769, 54770, 54771, 
+    54772, 54773, 54774, 54775, 54776, 54777, 54778, 54779, 54780, 54781, 
+    54782, 54783, 54784, 54785, 54786, 54787, 54788, 54789, 54790, 54791, 
+    54792, 54793, 54794, 54795, 54796, 54797, 54798, 54799, 54800, 54801, 
+    54802, 54803, 54804, 54805, 54806, 54807, 54808, 54809, 54810, 54811, 
+    54812, 54813, 54814, 54815, 54816, 54817, 54818, 54819, 54820, 54821, 
+    54822, 54823, 54824, 54825, 54826, 54827, 54828, 54829, 54830, 54831, 
+    54832, 54833, 54834, 54835, 54836, 54837, 54838, 54839, 54840, 54841, 
+    54842, 54843, 54844, 54845, 54846, 54847, 54848, 54849, 54850, 54851, 
+    54852, 54853, 54854, 54855, 54856, 54857, 54858, 54859, 54860, 54861, 
+    54862, 54863, 54864, 54865, 54866, 54867, 54868, 54869, 54870, 54871, 
+    54872, 54873, 54874, 54875, 54876, 54877, 54878, 54879, 54880, 54881, 
+    54882, 54883, 54884, 54885, 54886, 54887, 54888, 54889, 54890, 54891, 
+    54892, 54893, 54894, 54895, 54896, 54897, 54898, 54899, 54900, 54901, 
+    54902, 54903, 54904, 54905, 54906, 54907, 54908, 54909, 54910, 54911, 
+    54912, 54913, 54914, 54915, 54916, 54917, 54918, 54919, 54920, 54921, 
+    54922, 54923, 54924, 54925, 54926, 54927, 54928, 54929, 54930, 54931, 
+    54932, 54933, 54934, 54935, 54936, 54937, 54938, 54939, 54940, 54941, 
+    54942, 54943, 54944, 54945, 54946, 54947, 54948, 54949, 54950, 54951, 
+    54952, 54953, 54954, 54955, 54956, 54957, 54958, 54959, 54960, 54961, 
+    54962, 54963, 54964, 54965, 54966, 54967, 54968, 54969, 54970, 54971, 
+    54972, 54973, 54974, 54975, 54976, 54977, 54978, 54979, 54980, 54981, 
+    54982, 54983, 54984, 54985, 54986, 54987, 54988, 54989, 54990, 54991, 
+    54992, 54993, 54994, 54995, 54996, 54997, 54998, 54999, 55000, 55001, 
+    55002, 55003, 55004, 55005, 55006, 55007, 55008, 55009, 55010, 55011, 
+    55012, 55013, 55014, 55015, 55016, 55017, 55018, 55019, 55020, 55021, 
+    55022, 55023, 55024, 55025, 55026, 55027, 55028, 55029, 55030, 55031, 
+    55032, 55033, 55034, 55035, 55036, 55037, 55038, 55039, 55040, 55041, 
+    55042, 55043, 55044, 55045, 55046, 55047, 55048, 55049, 55050, 55051, 
+    55052, 55053, 55054, 55055, 55056, 55057, 55058, 55059, 55060, 55061, 
+    55062, 55063, 55064, 55065, 55066, 55067, 55068, 55069, 55070, 55071, 
+    55072, 55073, 55074, 55075, 55076, 55077, 55078, 55079, 55080, 55081, 
+    55082, 55083, 55084, 55085, 55086, 55087, 55088, 55089, 55090, 55091, 
+    55092, 55093, 55094, 55095, 55096, 55097, 55098, 55099, 55100, 55101, 
+    55102, 55103, 55104, 55105, 55106, 55107, 55108, 55109, 55110, 55111, 
+    55112, 55113, 55114, 55115, 55116, 55117, 55118, 55119, 55120, 55121, 
+    55122, 55123, 55124, 55125, 55126, 55127, 55128, 55129, 55130, 55131, 
+    55132, 55133, 55134, 55135, 55136, 55137, 55138, 55139, 55140, 55141, 
+    55142, 55143, 55144, 55145, 55146, 55147, 55148, 55149, 55150, 55151, 
+    55152, 55153, 55154, 55155, 55156, 55157, 55158, 55159, 55160, 55161, 
+    55162, 55163, 55164, 55165, 55166, 55167, 55168, 55169, 55170, 55171, 
+    55172, 55173, 55174, 55175, 55176, 55177, 55178, 55179, 55180, 55181, 
+    55182, 55183, 55184, 55185, 55186, 55187, 55188, 55189, 55190, 55191, 
+    55192, 55193, 55194, 55195, 55196, 55197, 55198, 55199, 55200, 55201, 
+    55202, 55203, 55204, 55205, 55206, 55207, 55208, 55209, 55210, 55211, 
+    55212, 55213, 55214, 55215, 55216, 55217, 55218, 55219, 55220, 55221, 
+    55222, 55223, 55224, 55225, 55226, 55227, 55228, 55229, 55230, 55231, 
+    55232, 55233, 55234, 55235, 55236, 55237, 55238, 55239, 55240, 55241, 
+    55242, 55243, 55244, 55245, 55246, 55247, 55248, 55249, 55250, 55251, 
+    55252, 55253, 55254, 55255, 55256, 55257, 55258, 55259, 55260, 55261, 
+    55262, 55263, 55264, 55265, 55266, 55267, 55268, 55269, 55270, 55271, 
+    55272, 55273, 55274, 55275, 55276, 55277, 55278, 55279, 55280, 55281, 
+    55282, 55283, 55284, 55285, 55286, 55287, 55288, 55289, 55290, 55291, 
+    55292, 55293, 55294, 55295, 55296, 55297, 55298, 55299, 55300, 55301, 
+    55302, 55303, 55304, 55305, 55306, 55307, 55308, 55309, 55310, 55311, 
+    55312, 55313, 55314, 55315, 55316, 55317, 55318, 55319, 55320, 55321, 
+    55322, 55323, 55324, 55325, 55326, 55327, 55328, 55329, 55330, 55331, 
+    55332, 55333, 55334, 55335, 55336, 55337, 55338, 55339, 55340, 55341, 
+    55342, 55343, 55344, 55345, 55346, 55347, 55348, 55349, 55350, 55351, 
+    55352, 55353, 55354, 55355, 55356, 55357, 55358, 55359, 55360, 55361, 
+    55362, 55363, 55364, 55365, 55366, 55367, 55368, 55369, 55370, 55371, 
+    55372, 55373, 55374, 55375, 55376, 55377, 55378, 55379, 55380, 55381, 
+    55382, 55383, 55384, 55385, 55386, 55387, 55388, 55389, 55390, 55391, 
+    55392, 55393, 55394, 55395, 55396, 55397, 55398, 55399, 55400, 55401, 
+    55402, 55403, 55404, 55405, 55406, 55407, 55408, 55409, 55410, 55411, 
+    55412, 55413, 55414, 55415, 55416, 55417, 55418, 55419, 55420, 55421, 
+    55422, 55423, 55424, 55425, 55426, 55427, 55428, 55429, 55430, 55431, 
+    55432, 55433, 55434, 55435, 55436, 55437, 55438, 55439, 55440, 55441, 
+    55442, 55443, 55444, 55445, 55446, 55447, 55448, 55449, 55450, 55451, 
+    55452, 55453, 55454, 55455, 55456, 55457, 55458, 55459, 55460, 55461, 
+    55462, 55463, 55464, 55465, 55466, 55467, 55468, 55469, 55470, 55471, 
+    55472, 55473, 55474, 55475, 55476, 55477, 55478, 55479, 55480, 55481, 
+    55482, 55483, 55484, 55485, 55486, 55487, 55488, 55489, 55490, 55491, 
+    55492, 55493, 55494, 55495, 55496, 55497, 55498, 55499, 55500, 55501, 
+    55502, 55503, 55504, 55505, 55506, 55507, 55508, 55509, 55510, 55511, 
+    55512, 55513, 55514, 55515, 55516, 55517, 55518, 55519, 55520, 55521, 
+    55522, 55523, 55524, 55525, 55526, 55527, 55528, 55529, 55530, 55531, 
+    55532, 55533, 55534, 55535, 55536, 55537, 55538, 55539, 55540, 55541, 
+    55542, 55543, 55544, 55545, 55546, 55547, 55548, 55549, 55550, 55551, 
+    55552, 55553, 55554, 55555, 55556, 55557, 55558, 55559, 55560, 55561, 
+    55562, 55563, 55564, 55565, 55566, 55567, 55568, 55569, 55570, 55571, 
+    55572, 55573, 55574, 55575, 55576, 55577, 55578, 55579, 55580, 55581, 
+    55582, 55583, 55584, 55585, 55586, 55587, 55588, 55589, 55590, 55591, 
+    55592, 55593, 55594, 55595, 55596, 55597, 55598, 55599, 55600, 55601, 
+    55602, 55603, 55604, 55605, 55606, 55607, 55608, 55609, 55610, 55611, 
+    55612, 55613, 55614, 55615, 55616, 55617, 55618, 55619, 55620, 55621, 
+    55622, 55623, 55624, 55625, 55626, 55627, 55628, 55629, 55630, 55631, 
+    55632, 55633, 55634, 55635, 55636, 55637, 55638, 55639, 55640, 55641, 
+    55642, 55643, 55644, 55645, 55646, 55647, 55648, 55649, 55650, 55651, 
+    55652, 55653, 55654, 55655, 55656, 55657, 55658, 55659, 55660, 55661, 
+    55662, 55663, 55664, 55665, 55666, 55667, 55668, 55669, 55670, 55671, 
+    55672, 55673, 55674, 55675, 55676, 55677, 55678, 55679, 55680, 55681, 
+    55682, 55683, 55684, 55685, 55686, 55687, 55688, 55689, 55690, 55691, 
+    55692, 55693, 55694, 55695, 55696, 55697, 55698, 55699, 55700, 55701, 
+    55702, 55703, 55704, 55705, 55706, 55707, 55708, 55709, 55710, 55711, 
+    55712, 55713, 55714, 55715, 55716, 55717, 55718, 55719, 55720, 55721, 
+    55722, 55723, 55724, 55725, 55726, 55727, 55728, 55729, 55730, 55731, 
+    55732, 55733, 55734, 55735, 55736, 55737, 55738, 55739, 55740, 55741, 
+    55742, 55743, 55744, 55745, 55746, 55747, 55748, 55749, 55750, 55751, 
+    55752, 55753, 55754, 55755, 55756, 55757, 55758, 55759, 55760, 55761, 
+    55762, 55763, 55764, 55765, 55766, 55767, 55768, 55769, 55770, 55771, 
+    55772, 55773, 55774, 55775, 55776, 55777, 55778, 55779, 55780, 55781, 
+    55782, 55783, 55784, 55785, 55786, 55787, 55788, 55789, 55790, 55791, 
+    55792, 55793, 55794, 55795, 55796, 55797, 55798, 55799, 55800, 55801, 
+    55802, 55803, 55804, 55805, 55806, 55807, 55808, 55809, 55810, 55811, 
+    55812, 55813, 55814, 55815, 55816, 55817, 55818, 55819, 55820, 55821, 
+    55822, 55823, 55824, 55825, 55826, 55827, 55828, 55829, 55830, 55831, 
+    55832, 55833, 55834, 55835, 55836, 55837, 55838, 55839, 55840, 55841, 
+    55842, 55843, 55844, 55845, 55846, 55847, 55848, 55849, 55850, 55851, 
+    55852, 55853, 55854, 55855, 55856, 55857, 55858, 55859, 55860, 55861, 
+    55862, 55863, 55864, 55865, 55866, 55867, 55868, 55869, 55870, 55871, 
+    55872, 55873, 55874, 55875, 55876, 55877, 55878, 55879, 55880, 55881, 
+    55882, 55883, 55884, 55885, 55886, 55887, 55888, 55889, 55890, 55891, 
+    55892, 55893, 55894, 55895, 55896, 55897, 55898, 55899, 55900, 55901, 
+    55902, 55903, 55904, 55905, 55906, 55907, 55908, 55909, 55910, 55911, 
+    55912, 55913, 55914, 55915, 55916, 55917, 55918, 55919, 55920, 55921, 
+    55922, 55923, 55924, 55925, 55926, 55927, 55928, 55929, 55930, 55931, 
+    55932, 55933, 55934, 55935, 55936, 55937, 55938, 55939, 55940, 55941, 
+    55942, 55943, 55944, 55945, 55946, 55947, 55948, 55949, 55950, 55951, 
+    55952, 55953, 55954, 55955, 55956, 55957, 55958, 55959, 55960, 55961, 
+    55962, 55963, 55964, 55965, 55966, 55967, 55968, 55969, 55970, 55971, 
+    55972, 55973, 55974, 55975, 55976, 55977, 55978, 55979, 55980, 55981, 
+    55982, 55983, 55984, 55985, 55986, 55987, 55988, 55989, 55990, 55991, 
+    55992, 55993, 55994, 55995, 55996, 55997, 55998, 55999, 56000, 56001, 
+    56002, 56003, 56004, 56005, 56006, 56007, 56008, 56009, 56010, 56011, 
+    56012, 56013, 56014, 56015, 56016, 56017, 56018, 56019, 56020, 56021, 
+    56022, 56023, 56024, 56025, 56026, 56027, 56028, 56029, 56030, 56031, 
+    56032, 56033, 56034, 56035, 56036, 56037, 56038, 56039, 56040, 56041, 
+    56042, 56043, 56044, 56045, 56046, 56047, 56048, 56049, 56050, 56051, 
+    56052, 56053, 56054, 56055, 56056, 56057, 56058, 56059, 56060, 56061, 
+    56062, 56063, 56064, 56065, 56066, 56067, 56068, 56069, 56070, 56071, 
+    56072, 56073, 56074, 56075, 56076, 56077, 56078, 56079, 56080, 56081, 
+    56082, 56083, 56084, 56085, 56086, 56087, 56088, 56089, 56090, 56091, 
+    56092, 56093, 56094, 56095, 56096, 56097, 56098, 56099, 56100, 56101, 
+    56102, 56103, 56104, 56105, 56106, 56107, 56108, 56109, 56110, 56111, 
+    56112, 56113, 56114, 56115, 56116, 56117, 56118, 56119, 56120, 56121, 
+    56122, 56123, 56124, 56125, 56126, 56127, 56128, 56129, 56130, 56131, 
+    56132, 56133, 56134, 56135, 56136, 56137, 56138, 56139, 56140, 56141, 
+    56142, 56143, 56144, 56145, 56146, 56147, 56148, 56149, 56150, 56151, 
+    56152, 56153, 56154, 56155, 56156, 56157, 56158, 56159, 56160, 56161, 
+    56162, 56163, 56164, 56165, 56166, 56167, 56168, 56169, 56170, 56171, 
+    56172, 56173, 56174, 56175, 56176, 56177, 56178, 56179, 56180, 56181, 
+    56182, 56183, 56184, 56185, 56186, 56187, 56188, 56189, 56190, 56191, 
+    56192, 56193, 56194, 56195, 56196, 56197, 56198, 56199, 56200, 56201, 
+    56202, 56203, 56204, 56205, 56206, 56207, 56208, 56209, 56210, 56211, 
+    56212, 56213, 56214, 56215, 56216, 56217, 56218, 56219, 56220, 56221, 
+    56222, 56223, 56224, 56225, 56226, 56227, 56228, 56229, 56230, 56231, 
+    56232, 56233, 56234, 56235, 56236, 56237, 56238, 56239, 56240, 56241, 
+    56242, 56243, 56244, 56245, 56246, 56247, 56248, 56249, 56250, 56251, 
+    56252, 56253, 56254, 56255, 56256, 56257, 56258, 56259, 56260, 56261, 
+    56262, 56263, 56264, 56265, 56266, 56267, 56268, 56269, 56270, 56271, 
+    56272, 56273, 56274, 56275, 56276, 56277, 56278, 56279, 56280, 56281, 
+    56282, 56283, 56284, 56285, 56286, 56287, 56288, 56289, 56290, 56291, 
+    56292, 56293, 56294, 56295, 56296, 56297, 56298, 56299, 56300, 56301, 
+    56302, 56303, 56304, 56305, 56306, 56307, 56308, 56309, 56310, 56311, 
+    56312, 56313, 56314, 56315, 56316, 56317, 56318, 56319, 56320, 56321, 
+    56322, 56323, 56324, 56325, 56326, 56327, 56328, 56329, 56330, 56331, 
+    56332, 56333, 56334, 56335, 56336, 56337, 56338, 56339, 56340, 56341, 
+    56342, 56343, 56344, 56345, 56346, 56347, 56348, 56349, 56350, 56351, 
+    56352, 56353, 56354, 56355, 56356, 56357, 56358, 56359, 56360, 56361, 
+    56362, 56363, 56364, 56365, 56366, 56367, 56368, 56369, 56370, 56371, 
+    56372, 56373, 56374, 56375, 56376, 56377, 56378, 56379, 56380, 56381, 
+    56382, 56383, 56384, 56385, 56386, 56387, 56388, 56389, 56390, 56391, 
+    56392, 56393, 56394, 56395, 56396, 56397, 56398, 56399, 56400, 56401, 
+    56402, 56403, 56404, 56405, 56406, 56407, 56408, 56409, 56410, 56411, 
+    56412, 56413, 56414, 56415, 56416, 56417, 56418, 56419, 56420, 56421, 
+    56422, 56423, 56424, 56425, 56426, 56427, 56428, 56429, 56430, 56431, 
+    56432, 56433, 56434, 56435, 56436, 56437, 56438, 56439, 56440, 56441, 
+    56442, 56443, 56444, 56445, 56446, 56447, 56448, 56449, 56450, 56451, 
+    56452, 56453, 56454, 56455, 56456, 56457, 56458, 56459, 56460, 56461, 
+    56462, 56463, 56464, 56465, 56466, 56467, 56468, 56469, 56470, 56471, 
+    56472, 56473, 56474, 56475, 56476, 56477, 56478, 56479, 56480, 56481, 
+    56482, 56483, 56484, 56485, 56486, 56487, 56488, 56489, 56490, 56491, 
+    56492, 56493, 56494, 56495, 56496, 56497, 56498, 56499, 56500, 56501, 
+    56502, 56503, 56504, 56505, 56506, 56507, 56508, 56509, 56510, 56511, 
+    56512, 56513, 56514, 56515, 56516, 56517, 56518, 56519, 56520, 56521, 
+    56522, 56523, 56524, 56525, 56526, 56527, 56528, 56529, 56530, 56531, 
+    56532, 56533, 56534, 56535, 56536, 56537, 56538, 56539, 56540, 56541, 
+    56542, 56543, 56544, 56545, 56546, 56547, 56548, 56549, 56550, 56551, 
+    56552, 56553, 56554, 56555, 56556, 56557, 56558, 56559, 56560, 56561, 
+    56562, 56563, 56564, 56565, 56566, 56567, 56568, 56569, 56570, 56571, 
+    56572, 56573, 56574, 56575, 56576, 56577, 56578, 56579, 56580, 56581, 
+    56582, 56583, 56584, 56585, 56586, 56587, 56588, 56589, 56590, 56591, 
+    56592, 56593, 56594, 56595, 56596, 56597, 56598, 56599, 56600, 56601, 
+    56602, 56603, 56604, 56605, 56606, 56607, 56608, 56609, 56610, 56611, 
+    56612, 56613, 56614, 56615, 56616, 56617, 56618, 56619, 56620, 56621, 
+    56622, 56623, 56624, 56625, 56626, 56627, 56628, 56629, 56630, 56631, 
+    56632, 56633, 56634, 56635, 56636, 56637, 56638, 56639, 56640, 56641, 
+    56642, 56643, 56644, 56645, 56646, 56647, 56648, 56649, 56650, 56651, 
+    56652, 56653, 56654, 56655, 56656, 56657, 56658, 56659, 56660, 56661, 
+    56662, 56663, 56664, 56665, 56666, 56667, 56668, 56669, 56670, 56671, 
+    56672, 56673, 56674, 56675, 56676, 56677, 56678, 56679, 56680, 56681, 
+    56682, 56683, 56684, 56685, 56686, 56687, 56688, 56689, 56690, 56691, 
+    56692, 56693, 56694, 56695, 56696, 56697, 56698, 56699, 56700, 56701, 
+    56702, 56703, 56704, 56705, 56706, 56707, 56708, 56709, 56710, 56711, 
+    56712, 56713, 56714, 56715, 56716, 56717, 56718, 56719, 56720, 56721, 
+    56722, 56723, 56724, 56725, 56726, 56727, 56728, 56729, 56730, 56731, 
+    56732, 56733, 56734, 56735, 56736, 56737, 56738, 56739, 56740, 56741, 
+    56742, 56743, 56744, 56745, 56746, 56747, 56748, 56749, 56750, 56751, 
+    56752, 56753, 56754, 56755, 56756, 56757, 56758, 56759, 56760, 56761, 
+    56762, 56763, 56764, 56765, 56766, 56767, 56768, 56769, 56770, 56771, 
+    56772, 56773, 56774, 56775, 56776, 56777, 56778, 56779, 56780, 56781, 
+    56782, 56783, 56784, 56785, 56786, 56787, 56788, 56789, 56790, 56791, 
+    56792, 56793, 56794, 56795, 56796, 56797, 56798, 56799, 56800, 56801, 
+    56802, 56803, 56804, 56805, 56806, 56807, 56808, 56809, 56810, 56811, 
+    56812, 56813, 56814, 56815, 56816, 56817, 56818, 56819, 56820, 56821, 
+    56822, 56823, 56824, 56825, 56826, 56827, 56828, 56829, 56830, 56831, 
+    56832, 56833, 56834, 56835, 56836, 56837, 56838, 56839, 56840, 56841, 
+    56842, 56843, 56844, 56845, 56846, 56847, 56848, 56849, 56850, 56851, 
+    56852, 56853, 56854, 56855, 56856, 56857, 56858, 56859, 56860, 56861, 
+    56862, 56863, 56864, 56865, 56866, 56867, 56868, 56869, 56870, 56871, 
+    56872, 56873, 56874, 56875, 56876, 56877, 56878, 56879, 56880, 56881, 
+    56882, 56883, 56884, 56885, 56886, 56887, 56888, 56889, 56890, 56891, 
+    56892, 56893, 56894, 56895, 56896, 56897, 56898, 56899, 56900, 56901, 
+    56902, 56903, 56904, 56905, 56906, 56907, 56908, 56909, 56910, 56911, 
+    56912, 56913, 56914, 56915, 56916, 56917, 56918, 56919, 56920, 56921, 
+    56922, 56923, 56924, 56925, 56926, 56927, 56928, 56929, 56930, 56931, 
+    56932, 56933, 56934, 56935, 56936, 56937, 56938, 56939, 56940, 56941, 
+    56942, 56943, 56944, 56945, 56946, 56947, 56948, 56949, 56950, 56951, 
+    56952, 56953, 56954, 56955, 56956, 56957, 56958, 56959, 56960, 56961, 
+    56962, 56963, 56964, 56965, 56966, 56967, 56968, 56969, 56970, 56971, 
+    56972, 56973, 56974, 56975, 56976, 56977, 56978, 56979, 56980, 56981, 
+    56982, 56983, 56984, 56985, 56986, 56987, 56988, 56989, 56990, 56991, 
+    56992, 56993, 56994, 56995, 56996, 56997, 56998, 56999, 57000, 57001, 
+    57002, 57003, 57004, 57005, 57006, 57007, 57008, 57009, 57010, 57011, 
+    57012, 57013, 57014, 57015, 57016, 57017, 57018, 57019, 57020, 57021, 
+    57022, 57023, 57024, 57025, 57026, 57027, 57028, 57029, 57030, 57031, 
+    57032, 57033, 57034, 57035, 57036, 57037, 57038, 57039, 57040, 57041, 
+    57042, 57043, 57044, 57045, 57046, 57047, 57048, 57049, 57050, 57051, 
+    57052, 57053, 57054, 57055, 57056, 57057, 57058, 57059, 57060, 57061, 
+    57062, 57063, 57064, 57065, 57066, 57067, 57068, 57069, 57070, 57071, 
+    57072, 57073, 57074, 57075, 57076, 57077, 57078, 57079, 57080, 57081, 
+    57082, 57083, 57084, 57085, 57086, 57087, 57088, 57089, 57090, 57091, 
+    57092, 57093, 57094, 57095, 57096, 57097, 57098, 57099, 57100, 57101, 
+    57102, 57103, 57104, 57105, 57106, 57107, 57108, 57109, 57110, 57111, 
+    57112, 57113, 57114, 57115, 57116, 57117, 57118, 57119, 57120, 57121, 
+    57122, 57123, 57124, 57125, 57126, 57127, 57128, 57129, 57130, 57131, 
+    57132, 57133, 57134, 57135, 57136, 57137, 57138, 57139, 57140, 57141, 
+    57142, 57143, 57144, 57145, 57146, 57147, 57148, 57149, 57150, 57151, 
+    57152, 57153, 57154, 57155, 57156, 57157, 57158, 57159, 57160, 57161, 
+    57162, 57163, 57164, 57165, 57166, 57167, 57168, 57169, 57170, 57171, 
+    57172, 57173, 57174, 57175, 57176, 57177, 57178, 57179, 57180, 57181, 
+    57182, 57183, 57184, 57185, 57186, 57187, 57188, 57189, 57190, 57191, 
+    57192, 57193, 57194, 57195, 57196, 57197, 57198, 57199, 57200, 57201, 
+    57202, 57203, 57204, 57205, 57206, 57207, 57208, 57209, 57210, 57211, 
+    57212, 57213, 57214, 57215, 57216, 57217, 57218, 57219, 57220, 57221, 
+    57222, 57223, 57224, 57225, 57226, 57227, 57228, 57229, 57230, 57231, 
+    57232, 57233, 57234, 57235, 57236, 57237, 57238, 57239, 57240, 57241, 
+    57242, 57243, 57244, 57245, 57246, 57247, 57248, 57249, 57250, 57251, 
+    57252, 57253, 57254, 57255, 57256, 57257, 57258, 57259, 57260, 57261, 
+    57262, 57263, 57264, 57265, 57266, 57267, 57268, 57269, 57270, 57271, 
+    57272, 57273, 57274, 57275, 57276, 57277, 57278, 57279, 57280, 57281, 
+    57282, 57283, 57284, 57285, 57286, 57287, 57288, 57289, 57290, 57291, 
+    57292, 57293, 57294, 57295, 57296, 57297, 57298, 57299, 57300, 57301, 
+    57302, 57303, 57304, 57305, 57306, 57307, 57308, 57309, 57310, 57311, 
+    57312, 57313, 57314, 57315, 57316, 57317, 57318, 57319, 57320, 57321, 
+    57322, 57323, 57324, 57325, 57326, 57327, 57328, 57329, 57330, 57331, 
+    57332, 57333, 57334, 57335, 57336, 57337, 57338, 57339, 57340, 57341, 
+    57342, 57343, 57344, 57345, 57346, 57347, 57348, 57349, 57350, 57351, 
+    57352, 57353, 57354, 57355, 57356, 57357, 57358, 57359, 57360, 57361, 
+    57362, 57363, 57364, 57365, 57366, 57367, 57368, 57369, 57370, 57371, 
+    57372, 57373, 57374, 57375, 57376, 57377, 57378, 57379, 57380, 57381, 
+    57382, 57383, 57384, 57385, 57386, 57387, 57388, 57389, 57390, 57391, 
+    57392, 57393, 57394, 57395, 57396, 57397, 57398, 57399, 57400, 57401, 
+    57402, 57403, 57404, 57405, 57406, 57407, 57408, 57409, 57410, 57411, 
+    57412, 57413, 57414, 57415, 57416, 57417, 57418, 57419, 57420, 57421, 
+    57422, 57423, 57424, 57425, 57426, 57427, 57428, 57429, 57430, 57431, 
+    57432, 57433, 57434, 57435, 57436, 57437, 57438, 57439, 57440, 57441, 
+    57442, 57443, 57444, 57445, 57446, 57447, 57448, 57449, 57450, 57451, 
+    57452, 57453, 57454, 57455, 57456, 57457, 57458, 57459, 57460, 57461, 
+    57462, 57463, 57464, 57465, 57466, 57467, 57468, 57469, 57470, 57471, 
+    57472, 57473, 57474, 57475, 57476, 57477, 57478, 57479, 57480, 57481, 
+    57482, 57483, 57484, 57485, 57486, 57487, 57488, 57489, 57490, 57491, 
+    57492, 57493, 57494, 57495, 57496, 57497, 57498, 57499, 57500, 57501, 
+    57502, 57503, 57504, 57505, 57506, 57507, 57508, 57509, 57510, 57511, 
+    57512, 57513, 57514, 57515, 57516, 57517, 57518, 57519, 57520, 57521, 
+    57522, 57523, 57524, 57525, 57526, 57527, 57528, 57529, 57530, 57531, 
+    57532, 57533, 57534, 57535, 57536, 57537, 57538, 57539, 57540, 57541, 
+    57542, 57543, 57544, 57545, 57546, 57547, 57548, 57549, 57550, 57551, 
+    57552, 57553, 57554, 57555, 57556, 57557, 57558, 57559, 57560, 57561, 
+    57562, 57563, 57564, 57565, 57566, 57567, 57568, 57569, 57570, 57571, 
+    57572, 57573, 57574, 57575, 57576, 57577, 57578, 57579, 57580, 57581, 
+    57582, 57583, 57584, 57585, 57586, 57587, 57588, 57589, 57590, 57591, 
+    57592, 57593, 57594, 57595, 57596, 57597, 57598, 57599, 57600, 57601, 
+    57602, 57603, 57604, 57605, 57606, 57607, 57608, 57609, 57610, 57611, 
+    57612, 57613, 57614, 57615, 57616, 57617, 57618, 57619, 57620, 57621, 
+    57622, 57623, 57624, 57625, 57626, 57627, 57628, 57629, 57630, 57631, 
+    57632, 57633, 57634, 57635, 57636, 57637, 57638, 57639, 57640, 57641, 
+    57642, 57643, 57644, 57645, 57646, 57647, 57648, 57649, 57650, 57651, 
+    57652, 57653, 57654, 57655, 57656, 57657, 57658, 57659, 57660, 57661, 
+    57662, 57663, 57664, 57665, 57666, 57667, 57668, 57669, 57670, 57671, 
+    57672, 57673, 57674, 57675, 57676, 57677, 57678, 57679, 57680, 57681, 
+    57682, 57683, 57684, 57685, 57686, 57687, 57688, 57689, 57690, 57691, 
+    57692, 57693, 57694, 57695, 57696, 57697, 57698, 57699, 57700, 57701, 
+    57702, 57703, 57704, 57705, 57706, 57707, 57708, 57709, 57710, 57711, 
+    57712, 57713, 57714, 57715, 57716, 57717, 57718, 57719, 57720, 57721, 
+    57722, 57723, 57724, 57725, 57726, 57727, 57728, 57729, 57730, 57731, 
+    57732, 57733, 57734, 57735, 57736, 57737, 57738, 57739, 57740, 57741, 
+    57742, 57743, 57744, 57745, 57746, 57747, 57748, 57749, 57750, 57751, 
+    57752, 57753, 57754, 57755, 57756, 57757, 57758, 57759, 57760, 57761, 
+    57762, 57763, 57764, 57765, 57766, 57767, 57768, 57769, 57770, 57771, 
+    57772, 57773, 57774, 57775, 57776, 57777, 57778, 57779, 57780, 57781, 
+    57782, 57783, 57784, 57785, 57786, 57787, 57788, 57789, 57790, 57791, 
+    57792, 57793, 57794, 57795, 57796, 57797, 57798, 57799, 57800, 57801, 
+    57802, 57803, 57804, 57805, 57806, 57807, 57808, 57809, 57810, 57811, 
+    57812, 57813, 57814, 57815, 57816, 57817, 57818, 57819, 57820, 57821, 
+    57822, 57823, 57824, 57825, 57826, 57827, 57828, 57829, 57830, 57831, 
+    57832, 57833, 57834, 57835, 57836, 57837, 57838, 57839, 57840, 57841, 
+    57842, 57843, 57844, 57845, 57846, 57847, 57848, 57849, 57850, 57851, 
+    57852, 57853, 57854, 57855, 57856, 57857, 57858, 57859, 57860, 57861, 
+    57862, 57863, 57864, 57865, 57866, 57867, 57868, 57869, 57870, 57871, 
+    57872, 57873, 57874, 57875, 57876, 57877, 57878, 57879, 57880, 57881, 
+    57882, 57883, 57884, 57885, 57886, 57887, 57888, 57889, 57890, 57891, 
+    57892, 57893, 57894, 57895, 57896, 57897, 57898, 57899, 57900, 57901, 
+    57902, 57903, 57904, 57905, 57906, 57907, 57908, 57909, 57910, 57911, 
+    57912, 57913, 57914, 57915, 57916, 57917, 57918, 57919, 57920, 57921, 
+    57922, 57923, 57924, 57925, 57926, 57927, 57928, 57929, 57930, 57931, 
+    57932, 57933, 57934, 57935, 57936, 57937, 57938, 57939, 57940, 57941, 
+    57942, 57943, 57944, 57945, 57946, 57947, 57948, 57949, 57950, 57951, 
+    57952, 57953, 57954, 57955, 57956, 57957, 57958, 57959, 57960, 57961, 
+    57962, 57963, 57964, 57965, 57966, 57967, 57968, 57969, 57970, 57971, 
+    57972, 57973, 57974, 57975, 57976, 57977, 57978, 57979, 57980, 57981, 
+    57982, 57983, 57984, 57985, 57986, 57987, 57988, 57989, 57990, 57991, 
+    57992, 57993, 57994, 57995, 57996, 57997, 57998, 57999, 58000, 58001, 
+    58002, 58003, 58004, 58005, 58006, 58007, 58008, 58009, 58010, 58011, 
+    58012, 58013, 58014, 58015, 58016, 58017, 58018, 58019, 58020, 58021, 
+    58022, 58023, 58024, 58025, 58026, 58027, 58028, 58029, 58030, 58031, 
+    58032, 58033, 58034, 58035, 58036, 58037, 58038, 58039, 58040, 58041, 
+    58042, 58043, 58044, 58045, 58046, 58047, 58048, 58049, 58050, 58051, 
+    58052, 58053, 58054, 58055, 58056, 58057, 58058, 58059, 58060, 58061, 
+    58062, 58063, 58064, 58065, 58066, 58067, 58068, 58069, 58070, 58071, 
+    58072, 58073, 58074, 58075, 58076, 58077, 58078, 58079, 58080, 58081, 
+    58082, 58083, 58084, 58085, 58086, 58087, 58088, 58089, 58090, 58091, 
+    58092, 58093, 58094, 58095, 58096, 58097, 58098, 58099, 58100, 58101, 
+    58102, 58103, 58104, 58105, 58106, 58107, 58108, 58109, 58110, 58111, 
+    58112, 58113, 58114, 58115, 58116, 58117, 58118, 58119, 58120, 58121, 
+    58122, 58123, 58124, 58125, 58126, 58127, 58128, 58129, 58130, 58131, 
+    58132, 58133, 58134, 58135, 58136, 58137, 58138, 58139, 58140, 58141, 
+    58142, 58143, 58144, 58145, 58146, 58147, 58148, 58149, 58150, 58151, 
+    58152, 58153, 58154, 58155, 58156, 58157, 58158, 58159, 58160, 58161, 
+    58162, 58163, 58164, 58165, 58166, 58167, 58168, 58169, 58170, 58171, 
+    58172, 58173, 58174, 58175, 58176, 58177, 58178, 58179, 58180, 58181, 
+    58182, 58183, 58184, 58185, 58186, 58187, 58188, 58189, 58190, 58191, 
+    58192, 58193, 58194, 58195, 58196, 58197, 58198, 58199, 58200, 58201, 
+    58202, 58203, 58204, 58205, 58206, 58207, 58208, 58209, 58210, 58211, 
+    58212, 58213, 58214, 58215, 58216, 58217, 58218, 58219, 58220, 58221, 
+    58222, 58223, 58224, 58225, 58226, 58227, 58228, 58229, 58230, 58231, 
+    58232, 58233, 58234, 58235, 58236, 58237, 58238, 58239, 58240, 58241, 
+    58242, 58243, 58244, 58245, 58246, 58247, 58248, 58249, 58250, 58251, 
+    58252, 58253, 58254, 58255, 58256, 58257, 58258, 58259, 58260, 58261, 
+    58262, 58263, 58264, 58265, 58266, 58267, 58268, 58269, 58270, 58271, 
+    58272, 58273, 58274, 58275, 58276, 58277, 58278, 58279, 58280, 58281, 
+    58282, 58283, 58284, 58285, 58286, 58287, 58288, 58289, 58290, 58291, 
+    58292, 58293, 58294, 58295, 58296, 58297, 58298, 58299, 58300, 58301, 
+    58302, 58303, 58304, 58305, 58306, 58307, 58308, 58309, 58310, 58311, 
+    58312, 58313, 58314, 58315, 58316, 58317, 58318, 58319, 58320, 58321, 
+    58322, 58323, 58324, 58325, 58326, 58327, 58328, 58329, 58330, 58331, 
+    58332, 58333, 58334, 58335, 58336, 58337, 58338, 58339, 58340, 58341, 
+    58342, 58343, 58344, 58345, 58346, 58347, 58348, 58349, 58350, 58351, 
+    58352, 58353, 58354, 58355, 58356, 58357, 58358, 58359, 58360, 58361, 
+    58362, 58363, 58364, 58365, 58366, 58367, 58368, 58369, 58370, 58371, 
+    58372, 58373, 58374, 58375, 58376, 58377, 58378, 58379, 58380, 58381, 
+    58382, 58383, 58384, 58385, 58386, 58387, 58388, 58389, 58390, 58391, 
+    58392, 58393, 58394, 58395, 58396, 58397, 58398, 58399, 58400, 58401, 
+    58402, 58403, 58404, 58405, 58406, 58407, 58408, 58409, 58410, 58411, 
+    58412, 58413, 58414, 58415, 58416, 58417, 58418, 58419, 58420, 58421, 
+    58422, 58423, 58424, 58425, 58426, 58427, 58428, 58429, 58430, 58431, 
+    58432, 58433, 58434, 58435, 58436, 58437, 58438, 58439, 58440, 58441, 
+    58442, 58443, 58444, 58445, 58446, 58447, 58448, 58449, 58450, 58451, 
+    58452, 58453, 58454, 58455, 58456, 58457, 58458, 58459, 58460, 58461, 
+    58462, 58463, 58464, 58465, 58466, 58467, 58468, 58469, 58470, 58471, 
+    58472, 58473, 58474, 58475, 58476, 58477, 58478, 58479, 58480, 58481, 
+    58482, 58483, 58484, 58485, 58486, 58487, 58488, 58489, 58490, 58491, 
+    58492, 58493, 58494, 58495, 58496, 58497, 58498, 58499, 58500, 58501, 
+    58502, 58503, 58504, 58505, 58506, 58507, 58508, 58509, 58510, 58511, 
+    58512, 58513, 58514, 58515, 58516, 58517, 58518, 58519, 58520, 58521, 
+    58522, 58523, 58524, 58525, 58526, 58527, 58528, 58529, 58530, 58531, 
+    58532, 58533, 58534, 58535, 58536, 58537, 58538, 58539, 58540, 58541, 
+    58542, 58543, 58544, 58545, 58546, 58547, 58548, 58549, 58550, 58551, 
+    58552, 58553, 58554, 58555, 58556, 58557, 58558, 58559, 58560, 58561, 
+    58562, 58563, 58564, 58565, 58566, 58567, 58568, 58569, 58570, 58571, 
+    58572, 58573, 58574, 58575, 58576, 58577, 58578, 58579, 58580, 58581, 
+    58582, 58583, 58584, 58585, 58586, 58587, 58588, 58589, 58590, 58591, 
+    58592, 58593, 58594, 58595, 58596, 58597, 58598, 58599, 58600, 58601, 
+    58602, 58603, 58604, 58605, 58606, 58607, 58608, 58609, 58610, 58611, 
+    58612, 58613, 58614, 58615, 58616, 58617, 58618, 58619, 58620, 58621, 
+    58622, 58623, 58624, 58625, 58626, 58627, 58628, 58629, 58630, 58631, 
+    58632, 58633, 58634, 58635, 58636, 58637, 58638, 58639, 58640, 58641, 
+    58642, 58643, 58644, 58645, 58646, 58647, 58648, 58649, 58650, 58651, 
+    58652, 58653, 58654, 58655, 58656, 58657, 58658, 58659, 58660, 58661, 
+    58662, 58663, 58664, 58665, 58666, 58667, 58668, 58669, 58670, 58671, 
+    58672, 58673, 58674, 58675, 58676, 58677, 58678, 58679, 58680, 58681, 
+    58682, 58683, 58684, 58685, 58686, 58687, 58688, 58689, 58690, 58691, 
+    58692, 58693, 58694, 58695, 58696, 58697, 58698, 58699, 58700, 58701, 
+    58702, 58703, 58704, 58705, 58706, 58707, 58708, 58709, 58710, 58711, 
+    58712, 58713, 58714, 58715, 58716, 58717, 58718, 58719, 58720, 58721, 
+    58722, 58723, 58724, 58725, 58726, 58727, 58728, 58729, 58730, 58731, 
+    58732, 58733, 58734, 58735, 58736, 58737, 58738, 58739, 58740, 58741, 
+    58742, 58743, 58744, 58745, 58746, 58747, 58748, 58749, 58750, 58751, 
+    58752, 58753, 58754, 58755, 58756, 58757, 58758, 58759, 58760, 58761, 
+    58762, 58763, 58764, 58765, 58766, 58767, 58768, 58769, 58770, 58771, 
+    58772, 58773, 58774, 58775, 58776, 58777, 58778, 58779, 58780, 58781, 
+    58782, 58783, 58784, 58785, 58786, 58787, 58788, 58789, 58790, 58791, 
+    58792, 58793, 58794, 58795, 58796, 58797, 58798, 58799, 58800, 58801, 
+    58802, 58803, 58804, 58805, 58806, 58807, 58808, 58809, 58810, 58811, 
+    58812, 58813, 58814, 58815, 58816, 58817, 58818, 58819, 58820, 58821, 
+    58822, 58823, 58824, 58825, 58826, 58827, 58828, 58829, 58830, 58831, 
+    58832, 58833, 58834, 58835, 58836, 58837, 58838, 58839, 58840, 58841, 
+    58842, 58843, 58844, 58845, 58846, 58847, 58848, 58849, 58850, 58851, 
+    58852, 58853, 58854, 58855, 58856, 58857, 58858, 58859, 58860, 58861, 
+    58862, 58863, 58864, 58865, 58866, 58867, 58868, 58869, 58870, 58871, 
+    58872, 58873, 58874, 58875, 58876, 58877, 58878, 58879, 58880, 58881, 
+    58882, 58883, 58884, 58885, 58886, 58887, 58888, 58889, 58890, 58891, 
+    58892, 58893, 58894, 58895, 58896, 58897, 58898, 58899, 58900, 58901, 
+    58902, 58903, 58904, 58905, 58906, 58907, 58908, 58909, 58910, 58911, 
+    58912, 58913, 58914, 58915, 58916, 58917, 58918, 58919, 58920, 58921, 
+    58922, 58923, 58924, 58925, 58926, 58927, 58928, 58929, 58930, 58931, 
+    58932, 58933, 58934, 58935, 58936, 58937, 58938, 58939, 58940, 58941, 
+    58942, 58943, 58944, 58945, 58946, 58947, 58948, 58949, 58950, 58951, 
+    58952, 58953, 58954, 58955, 58956, 58957, 58958, 58959, 58960, 58961, 
+    58962, 58963, 58964, 58965, 58966, 58967, 58968, 58969, 58970, 58971, 
+    58972, 58973, 58974, 58975, 58976, 58977, 58978, 58979, 58980, 58981, 
+    58982, 58983, 58984, 58985, 58986, 58987, 58988, 58989, 58990, 58991, 
+    58992, 58993, 58994, 58995, 58996, 58997, 58998, 58999, 59000, 59001, 
+    59002, 59003, 59004, 59005, 59006, 59007, 59008, 59009, 59010, 59011, 
+    59012, 59013, 59014, 59015, 59016, 59017, 59018, 59019, 59020, 59021, 
+    59022, 59023, 59024, 59025, 59026, 59027, 59028, 59029, 59030, 59031, 
+    59032, 59033, 59034, 59035, 59036, 59037, 59038, 59039, 59040, 59041, 
+    59042, 59043, 59044, 59045, 59046, 59047, 59048, 59049, 59050, 59051, 
+    59052, 59053, 59054, 59055, 59056, 59057, 59058, 59059, 59060, 59061, 
+    59062, 59063, 59064, 59065, 59066, 59067, 59068, 59069, 59070, 59071, 
+    59072, 59073, 59074, 59075, 59076, 59077, 59078, 59079, 59080, 59081, 
+    59082, 59083, 59084, 59085, 59086, 59087, 59088, 59089, 59090, 59091, 
+    59092, 59093, 59094, 59095, 59096, 59097, 59098, 59099, 59100, 59101, 
+    59102, 59103, 59104, 59105, 59106, 59107, 59108, 59109, 59110, 59111, 
+    59112, 59113, 59114, 59115, 59116, 59117, 59118, 59119, 59120, 59121, 
+    59122, 59123, 59124, 59125, 59126, 59127, 59128, 59129, 59130, 59131, 
+    59132, 59133, 59134, 59135, 59136, 59137, 59138, 59139, 59140, 59141, 
+    59142, 59143, 59144, 59145, 59146, 59147, 59148, 59149, 59150, 59151, 
+    59152, 59153, 59154, 59155, 59156, 59157, 59158, 59159, 59160, 59161, 
+    59162, 59163, 59164, 59165, 59166, 59167, 59168, 59169, 59170, 59171, 
+    59172, 59173, 59174, 59175, 59176, 59177, 59178, 59179, 59180, 59181, 
+    59182, 59183, 59184, 59185, 59186, 59187, 59188, 59189, 59190, 59191, 
+    59192, 59193, 59194, 59195, 59196, 59197, 59198, 59199, 59200, 59201, 
+    59202, 59203, 59204, 59205, 59206, 59207, 59208, 59209, 59210, 59211, 
+    59212, 59213, 59214, 59215, 59216, 59217, 59218, 59219, 59220, 59221, 
+    59222, 59223, 59224, 59225, 59226, 59227, 59228, 59229, 59230, 59231, 
+    59232, 59233, 59234, 59235, 59236, 59237, 59238, 59239, 59240, 59241, 
+    59242, 59243, 59244, 59245, 59246, 59247, 59248, 59249, 59250, 59251, 
+    59252, 59253, 59254, 59255, 59256, 59257, 59258, 59259, 59260, 59261, 
+    59262, 59263, 59264, 59265, 59266, 59267, 59268, 59269, 59270, 59271, 
+    59272, 59273, 59274, 59275, 59276, 59277, 59278, 59279, 59280, 59281, 
+    59282, 59283, 59284, 59285, 59286, 59287, 59288, 59289, 59290, 59291, 
+    59292, 59293, 59294, 59295, 59296, 59297, 59298, 59299, 59300, 59301, 
+    59302, 59303, 59304, 59305, 59306, 59307, 59308, 59309, 59310, 59311, 
+    59312, 59313, 59314, 59315, 59316, 59317, 59318, 59319, 59320, 59321, 
+    59322, 59323, 59324, 59325, 59326, 59327, 59328, 59329, 59330, 59331, 
+    59332, 59333, 59334, 59335, 59336, 59337, 59338, 59339, 59340, 59341, 
+    59342, 59343, 59344, 59345, 59346, 59347, 59348, 59349, 59350, 59351, 
+    59352, 59353, 59354, 59355, 59356, 59357, 59358, 59359, 59360, 59361, 
+    59362, 59363, 59364, 59365, 59366, 59367, 59368, 59369, 59370, 59371, 
+    59372, 59373, 59374, 59375, 59376, 59377, 59378, 59379, 59380, 59381, 
+    59382, 59383, 59384, 59385, 59386, 59387, 59388, 59389, 59390, 59391, 
+    59392, 59393, 59394, 59395, 59396, 59397, 59398, 59399, 59400, 59401, 
+    59402, 59403, 59404, 59405, 59406, 59407, 59408, 59409, 59410, 59411, 
+    59412, 59413, 59414, 59415, 59416, 59417, 59418, 59419, 59420, 59421, 
+    59422, 59423, 59424, 59425, 59426, 59427, 59428, 59429, 59430, 59431, 
+    59432, 59433, 59434, 59435, 59436, 59437, 59438, 59439, 59440, 59441, 
+    59442, 59443, 59444, 59445, 59446, 59447, 59448, 59449, 59450, 59451, 
+    59452, 59453, 59454, 59455, 59456, 59457, 59458, 59459, 59460, 59461, 
+    59462, 59463, 59464, 59465, 59466, 59467, 59468, 59469, 59470, 59471, 
+    59472, 59473, 59474, 59475, 59476, 59477, 59478, 59479, 59480, 59481, 
+    59482, 59483, 59484, 59485, 59486, 59487, 59488, 59489, 59490, 59491, 
+    59492, 59493, 59494, 59495, 59496, 59497, 59498, 59499, 59500, 59501, 
+    59502, 59503, 59504, 59505, 59506, 59507, 59508, 59509, 59510, 59511, 
+    59512, 59513, 59514, 59515, 59516, 59517, 59518, 59519, 59520, 59521, 
+    59522, 59523, 59524, 59525, 59526, 59527, 59528, 59529, 59530, 59531, 
+    59532, 59533, 59534, 59535, 59536, 59537, 59538, 59539, 59540, 59541, 
+    59542, 59543, 59544, 59545, 59546, 59547, 59548, 59549, 59550, 59551, 
+    59552, 59553, 59554, 59555, 59556, 59557, 59558, 59559, 59560, 59561, 
+    59562, 59563, 59564, 59565, 59566, 59567, 59568, 59569, 59570, 59571, 
+    59572, 59573, 59574, 59575, 59576, 59577, 59578, 59579, 59580, 59581, 
+    59582, 59583, 59584, 59585, 59586, 59587, 59588, 59589, 59590, 59591, 
+    59592, 59593, 59594, 59595, 59596, 59597, 59598, 59599, 59600, 59601, 
+    59602, 59603, 59604, 59605, 59606, 59607, 59608, 59609, 59610, 59611, 
+    59612, 59613, 59614, 59615, 59616, 59617, 59618, 59619, 59620, 59621, 
+    59622, 59623, 59624, 59625, 59626, 59627, 59628, 59629, 59630, 59631, 
+    59632, 59633, 59634, 59635, 59636, 59637, 59638, 59639, 59640, 59641, 
+    59642, 59643, 59644, 59645, 59646, 59647, 59648, 59649, 59650, 59651, 
+    59652, 59653, 59654, 59655, 59656, 59657, 59658, 59659, 59660, 59661, 
+    59662, 59663, 59664, 59665, 59666, 59667, 59668, 59669, 59670, 59671, 
+    59672, 59673, 59674, 59675, 59676, 59677, 59678, 59679, 59680, 59681, 
+    59682, 59683, 59684, 59685, 59686, 59687, 59688, 59689, 59690, 59691, 
+    59692, 59693, 59694, 59695, 59696, 59697, 59698, 59699, 59700, 59701, 
+    59702, 59703, 59704, 59705, 59706, 59707, 59708, 59709, 59710, 59711, 
+    59712, 59713, 59714, 59715, 59716, 59717, 59718, 59719, 59720, 59721, 
+    59722, 59723, 59724, 59725, 59726, 59727, 59728, 59729, 59730, 59731, 
+    59732, 59733, 59734, 59735, 59736, 59737, 59738, 59739, 59740, 59741, 
+    59742, 59743, 59744, 59745, 59746, 59747, 59748, 59749, 59750, 59751, 
+    59752, 59753, 59754, 59755, 59756, 59757, 59758, 59759, 59760, 59761, 
+    59762, 59763, 59764, 59765, 59766, 59767, 59768, 59769, 59770, 59771, 
+    59772, 59773, 59774, 59775, 59776, 59777, 59778, 59779, 59780, 59781, 
+    59782, 59783, 59784, 59785, 59786, 59787, 59788, 59789, 59790, 59791, 
+    59792, 59793, 59794, 59795, 59796, 59797, 59798, 59799, 59800, 59801, 
+    59802, 59803, 59804, 59805, 59806, 59807, 59808, 59809, 59810, 59811, 
+    59812, 59813, 59814, 59815, 59816, 59817, 59818, 59819, 59820, 59821, 
+    59822, 59823, 59824, 59825, 59826, 59827, 59828, 59829, 59830, 59831, 
+    59832, 59833, 59834, 59835, 59836, 59837, 59838, 59839, 59840, 59841, 
+    59842, 59843, 59844, 59845, 59846, 59847, 59848, 59849, 59850, 59851, 
+    59852, 59853, 59854, 59855, 59856, 59857, 59858, 59859, 59860, 59861, 
+    59862, 59863, 59864, 59865, 59866, 59867, 59868, 59869, 59870, 59871, 
+    59872, 59873, 59874, 59875, 59876, 59877, 59878, 59879, 59880, 59881, 
+    59882, 59883, 59884, 59885, 59886, 59887, 59888, 59889, 59890, 59891, 
+    59892, 59893, 59894, 59895, 59896, 59897, 59898, 59899, 59900, 59901, 
+    59902, 59903, 59904, 59905, 59906, 59907, 59908, 59909, 59910, 59911, 
+    59912, 59913, 59914, 59915, 59916, 59917, 59918, 59919, 59920, 59921, 
+    59922, 59923, 59924, 59925, 59926, 59927, 59928, 59929, 59930, 59931, 
+    59932, 59933, 59934, 59935, 59936, 59937, 59938, 59939, 59940, 59941, 
+    59942, 59943, 59944, 59945, 59946, 59947, 59948, 59949, 59950, 59951, 
+    59952, 59953, 59954, 59955, 59956, 59957, 59958, 59959, 59960, 59961, 
+    59962, 59963, 59964, 59965, 59966, 59967, 59968, 59969, 59970, 59971, 
+    59972, 59973, 59974, 59975, 59976, 59977, 59978, 59979, 59980, 59981, 
+    59982, 59983, 59984, 59985, 59986, 59987, 59988, 59989, 59990, 59991, 
+    59992, 59993, 59994, 59995, 59996, 59997, 59998, 59999, 60000, 60001, 
+    60002, 60003, 60004, 60005, 60006, 60007, 60008, 60009, 60010, 60011, 
+    60012, 60013, 60014, 60015, 60016, 60017, 60018, 60019, 60020, 60021, 
+    60022, 60023, 60024, 60025, 60026, 60027, 60028, 60029, 60030, 60031, 
+    60032, 60033, 60034, 60035, 60036, 60037, 60038, 60039, 60040, 60041, 
+    60042, 60043, 60044, 60045, 60046, 60047, 60048, 60049, 60050, 60051, 
+    60052, 60053, 60054, 60055, 60056, 60057, 60058, 60059, 60060, 60061, 
+    60062, 60063, 60064, 60065, 60066, 60067, 60068, 60069, 60070, 60071, 
+    60072, 60073, 60074, 60075, 60076, 60077, 60078, 60079, 60080, 60081, 
+    60082, 60083, 60084, 60085, 60086, 60087, 60088, 60089, 60090, 60091, 
+    60092, 60093, 60094, 60095, 60096, 60097, 60098, 60099, 60100, 60101, 
+    60102, 60103, 60104, 60105, 60106, 60107, 60108, 60109, 60110, 60111, 
+    60112, 60113, 60114, 60115, 60116, 60117, 60118, 60119, 60120, 60121, 
+    60122, 60123, 60124, 60125, 60126, 60127, 60128, 60129, 60130, 60131, 
+    60132, 60133, 60134, 60135, 60136, 60137, 60138, 60139, 60140, 60141, 
+    60142, 60143, 60144, 60145, 60146, 60147, 60148, 60149, 60150, 60151, 
+    60152, 60153, 60154, 60155, 60156, 60157, 60158, 60159, 60160, 60161, 
+    60162, 60163, 60164, 60165, 60166, 60167, 60168, 60169, 60170, 60171, 
+    60172, 60173, 60174, 60175, 60176, 60177, 60178, 60179, 60180, 60181, 
+    60182, 60183, 60184, 60185, 60186, 60187, 60188, 60189, 60190, 60191, 
+    60192, 60193, 60194, 60195, 60196, 60197, 60198, 60199, 60200, 60201, 
+    60202, 60203, 60204, 60205, 60206, 60207, 60208, 60209, 60210, 60211, 
+    60212, 60213, 60214, 60215, 60216, 60217, 60218, 60219, 60220, 60221, 
+    60222, 60223, 60224, 60225, 60226, 60227, 60228, 60229, 60230, 60231, 
+    60232, 60233, 60234, 60235, 60236, 60237, 60238, 60239, 60240, 60241, 
+    60242, 60243, 60244, 60245, 60246, 60247, 60248, 60249, 60250, 60251, 
+    60252, 60253, 60254, 60255, 60256, 60257, 60258, 60259, 60260, 60261, 
+    60262, 60263, 60264, 60265, 60266, 60267, 60268, 60269, 60270, 60271, 
+    60272, 60273, 60274, 60275, 60276, 60277, 60278, 60279, 60280, 60281, 
+    60282, 60283, 60284, 60285, 60286, 60287, 60288, 60289, 60290, 60291, 
+    60292, 60293, 60294, 60295, 60296, 60297, 60298, 60299, 60300, 60301, 
+    60302, 60303, 60304, 60305, 60306, 60307, 60308, 60309, 60310, 60311, 
+    60312, 60313, 60314, 60315, 60316, 60317, 60318, 60319, 60320, 60321, 
+    60322, 60323, 60324, 60325, 60326, 60327, 60328, 60329, 60330, 60331, 
+    60332, 60333, 60334, 60335, 60336, 60337, 60338, 60339, 60340, 60341, 
+    60342, 60343, 60344, 60345, 60346, 60347, 60348, 60349, 60350, 60351, 
+    60352, 60353, 60354, 60355, 60356, 60357, 60358, 60359, 60360, 60361, 
+    60362, 60363, 60364, 60365, 60366, 60367, 60368, 60369, 60370, 60371, 
+    60372, 60373, 60374, 60375, 60376, 60377, 60378, 60379, 60380, 60381, 
+    60382, 60383, 60384, 60385, 60386, 60387, 60388, 60389, 60390, 60391, 
+    60392, 60393, 60394, 60395, 60396, 60397, 60398, 60399, 60400, 60401, 
+    60402, 60403, 60404, 60405, 60406, 60407, 60408, 60409, 60410, 60411, 
+    60412, 60413, 60414, 60415, 60416, 60417, 60418, 60419, 60420, 60421, 
+    60422, 60423, 60424, 60425, 60426, 60427, 60428, 60429, 60430, 60431, 
+    60432, 60433, 60434, 60435, 60436, 60437, 60438, 60439, 60440, 60441, 
+    60442, 60443, 60444, 60445, 60446, 60447, 60448, 60449, 60450, 60451, 
+    60452, 60453, 60454, 60455, 60456, 60457, 60458, 60459, 60460, 60461, 
+    60462, 60463, 60464, 60465, 60466, 60467, 60468, 60469, 60470, 60471, 
+    60472, 60473, 60474, 60475, 60476, 60477, 60478, 60479, 60480, 60481, 
+    60482, 60483, 60484, 60485, 60486, 60487, 60488, 60489, 60490, 60491, 
+    60492, 60493, 60494, 60495, 60496, 60497, 60498, 60499, 60500, 60501, 
+    60502, 60503, 60504, 60505, 60506, 60507, 60508, 60509, 60510, 60511, 
+    60512, 60513, 60514, 60515, 60516, 60517, 60518, 60519, 60520, 60521, 
+    60522, 60523, 60524, 60525, 60526, 60527, 60528, 60529, 60530, 60531, 
+    60532, 60533, 60534, 60535, 60536, 60537, 60538, 60539, 60540, 60541, 
+    60542, 60543, 60544, 60545, 60546, 60547, 60548, 60549, 60550, 60551, 
+    60552, 60553, 60554, 60555, 60556, 60557, 60558, 60559, 60560, 60561, 
+    60562, 60563, 60564, 60565, 60566, 60567, 60568, 60569, 60570, 60571, 
+    60572, 60573, 60574, 60575, 60576, 60577, 60578, 60579, 60580, 60581, 
+    60582, 60583, 60584, 60585, 60586, 60587, 60588, 60589, 60590, 60591, 
+    60592, 60593, 60594, 60595, 60596, 60597, 60598, 60599, 60600, 60601, 
+    60602, 60603, 60604, 60605, 60606, 60607, 60608, 60609, 60610, 60611, 
+    60612, 60613, 60614, 60615, 60616, 60617, 60618, 60619, 60620, 60621, 
+    60622, 60623, 60624, 60625, 60626, 60627, 60628, 60629, 60630, 60631, 
+    60632, 60633, 60634, 60635, 60636, 60637, 60638, 60639, 60640, 60641, 
+    60642, 60643, 60644, 60645, 60646, 60647, 60648, 60649, 60650, 60651, 
+    60652, 60653, 60654, 60655, 60656, 60657, 60658, 60659, 60660, 60661, 
+    60662, 60663, 60664, 60665, 60666, 60667, 60668, 60669, 60670, 60671, 
+    60672, 60673, 60674, 60675, 60676, 60677, 60678, 60679, 60680, 60681, 
+    60682, 60683, 60684, 60685, 60686, 60687, 60688, 60689, 60690, 60691, 
+    60692, 60693, 60694, 60695, 60696, 60697, 60698, 60699, 60700, 60701, 
+    60702, 60703, 60704, 60705, 60706, 60707, 60708, 60709, 60710, 60711, 
+    60712, 60713, 60714, 60715, 60716, 60717, 60718, 60719, 60720, 60721, 
+    60722, 60723, 60724, 60725, 60726, 60727, 60728, 60729, 60730, 60731, 
+    60732, 60733, 60734, 60735, 60736, 60737, 60738, 60739, 60740, 60741, 
+    60742, 60743, 60744, 60745, 60746, 60747, 60748, 60749, 60750, 60751, 
+    60752, 60753, 60754, 60755, 60756, 60757, 60758, 60759, 60760, 60761, 
+    60762, 60763, 60764, 60765, 60766, 60767, 60768, 60769, 60770, 60771, 
+    60772, 60773, 60774, 60775, 60776, 60777, 60778, 60779, 60780, 60781, 
+    60782, 60783, 60784, 60785, 60786, 60787, 60788, 60789, 60790, 60791, 
+    60792, 60793, 60794, 60795, 60796, 60797, 60798, 60799, 60800, 60801, 
+    60802, 60803, 60804, 60805, 60806, 60807, 60808, 60809, 60810, 60811, 
+    60812, 60813, 60814, 60815, 60816, 60817, 60818, 60819, 60820, 60821, 
+    60822, 60823, 60824, 60825, 60826, 60827, 60828, 60829, 60830, 60831, 
+    60832, 60833, 60834, 60835, 60836, 60837, 60838, 60839, 60840, 60841, 
+    60842, 60843, 60844, 60845, 60846, 60847, 60848, 60849, 60850, 60851, 
+    60852, 60853, 60854, 60855, 60856, 60857, 60858, 60859, 60860, 60861, 
+    60862, 60863, 60864, 60865, 60866, 60867, 60868, 60869, 60870, 60871, 
+    60872, 60873, 60874, 60875, 60876, 60877, 60878, 60879, 60880, 60881, 
+    60882, 60883, 60884, 60885, 60886, 60887, 60888, 60889, 60890, 60891, 
+    60892, 60893, 60894, 60895, 60896, 60897, 60898, 60899, 60900, 60901, 
+    60902, 60903, 60904, 60905, 60906, 60907, 60908, 60909, 60910, 60911, 
+    60912, 60913, 60914, 60915, 60916, 60917, 60918, 60919, 60920, 60921, 
+    60922, 60923, 60924, 60925, 60926, 60927, 60928, 60929, 60930, 60931, 
+    60932, 60933, 60934, 60935, 60936, 60937, 60938, 60939, 60940, 60941, 
+    60942, 60943, 60944, 60945, 60946, 60947, 60948, 60949, 60950, 60951, 
+    60952, 60953, 60954, 60955, 60956, 60957, 60958, 60959, 60960, 60961, 
+    60962, 60963, 60964, 60965, 60966, 60967, 60968, 60969, 60970, 60971, 
+    60972, 60973, 60974, 60975, 60976, 60977, 60978, 60979, 60980, 60981, 
+    60982, 60983, 60984, 60985, 60986, 60987, 60988, 60989, 60990, 60991, 
+    60992, 60993, 60994, 60995, 60996, 60997, 60998, 60999, 61000, 61001, 
+    61002, 61003, 61004, 61005, 61006, 61007, 61008, 61009, 61010, 61011, 
+    61012, 61013, 61014, 61015, 61016, 61017, 61018, 61019, 61020, 61021, 
+    61022, 61023, 61024, 61025, 61026, 61027, 61028, 61029, 61030, 61031, 
+    61032, 61033, 61034, 61035, 61036, 61037, 61038, 61039, 61040, 61041, 
+    61042, 61043, 61044, 61045, 61046, 61047, 61048, 61049, 61050, 61051, 
+    61052, 61053, 61054, 61055, 61056, 61057, 61058, 61059, 61060, 61061, 
+    61062, 61063, 61064, 61065, 61066, 61067, 61068, 61069, 61070, 61071, 
+    61072, 61073, 61074, 61075, 61076, 61077, 61078, 61079, 61080, 61081, 
+    61082, 61083, 61084, 61085, 61086, 61087, 61088, 61089, 61090, 61091, 
+    61092, 61093, 61094, 61095, 61096, 61097, 61098, 61099, 61100, 61101, 
+    61102, 61103, 61104, 61105, 61106, 61107, 61108, 61109, 61110, 61111, 
+    61112, 61113, 61114, 61115, 61116, 61117, 61118, 61119, 61120, 61121, 
+    61122, 61123, 61124, 61125, 61126, 61127, 61128, 61129, 61130, 61131, 
+    61132, 61133, 61134, 61135, 61136, 61137, 61138, 61139, 61140, 61141, 
+    61142, 61143, 61144, 61145, 61146, 61147, 61148, 61149, 61150, 61151, 
+    61152, 61153, 61154, 61155, 61156, 61157, 61158, 61159, 61160, 61161, 
+    61162, 61163, 61164, 61165, 61166, 61167, 61168, 61169, 61170, 61171, 
+    61172, 61173, 61174, 61175, 61176, 61177, 61178, 61179, 61180, 61181, 
+    61182, 61183, 61184, 61185, 61186, 61187, 61188, 61189, 61190, 61191, 
+    61192, 61193, 61194, 61195, 61196, 61197, 61198, 61199, 61200, 61201, 
+    61202, 61203, 61204, 61205, 61206, 61207, 61208, 61209, 61210, 61211, 
+    61212, 61213, 61214, 61215, 61216, 61217, 61218, 61219, 61220, 61221, 
+    61222, 61223, 61224, 61225, 61226, 61227, 61228, 61229, 61230, 61231, 
+    61232, 61233, 61234, 61235, 61236, 61237, 61238, 61239, 61240, 61241, 
+    61242, 61243, 61244, 61245, 61246, 61247, 61248, 61249, 61250, 61251, 
+    61252, 61253, 61254, 61255, 61256, 61257, 61258, 61259, 61260, 61261, 
+    61262, 61263, 61264, 61265, 61266, 61267, 61268, 61269, 61270, 61271, 
+    61272, 61273, 61274, 61275, 61276, 61277, 61278, 61279, 61280, 61281, 
+    61282, 61283, 61284, 61285, 61286, 61287, 61288, 61289, 61290, 61291, 
+    61292, 61293, 61294, 61295, 61296, 61297, 61298, 61299, 61300, 61301, 
+    61302, 61303, 61304, 61305, 61306, 61307, 61308, 61309, 61310, 61311, 
+    61312, 61313, 61314, 61315, 61316, 61317, 61318, 61319, 61320, 61321, 
+    61322, 61323, 61324, 61325, 61326, 61327, 61328, 61329, 61330, 61331, 
+    61332, 61333, 61334, 61335, 61336, 61337, 61338, 61339, 61340, 61341, 
+    61342, 61343, 61344, 61345, 61346, 61347, 61348, 61349, 61350, 61351, 
+    61352, 61353, 61354, 61355, 61356, 61357, 61358, 61359, 61360, 61361, 
+    61362, 61363, 61364, 61365, 61366, 61367, 61368, 61369, 61370, 61371, 
+    61372, 61373, 61374, 61375, 61376, 61377, 61378, 61379, 61380, 61381, 
+    61382, 61383, 61384, 61385, 61386, 61387, 61388, 61389, 61390, 61391, 
+    61392, 61393, 61394, 61395, 61396, 61397, 61398, 61399, 61400, 61401, 
+    61402, 61403, 61404, 61405, 61406, 61407, 61408, 61409, 61410, 61411, 
+    61412, 61413, 61414, 61415, 61416, 61417, 61418, 61419, 61420, 61421, 
+    61422, 61423, 61424, 61425, 61426, 61427, 61428, 61429, 61430, 61431, 
+    61432, 61433, 61434, 61435, 61436, 61437, 61438, 61439, 61440, 61441, 
+    61442, 61443, 61444, 61445, 61446, 61447, 61448, 61449, 61450, 61451, 
+    61452, 61453, 61454, 61455, 61456, 61457, 61458, 61459, 61460, 61461, 
+    61462, 61463, 61464, 61465, 61466, 61467, 61468, 61469, 61470, 61471, 
+    61472, 61473, 61474, 61475, 61476, 61477, 61478, 61479, 61480, 61481, 
+    61482, 61483, 61484, 61485, 61486, 61487, 61488, 61489, 61490, 61491, 
+    61492, 61493, 61494, 61495, 61496, 61497, 61498, 61499, 61500, 61501, 
+    61502, 61503, 61504, 61505, 61506, 61507, 61508, 61509, 61510, 61511, 
+    61512, 61513, 61514, 61515, 61516, 61517, 61518, 61519, 61520, 61521, 
+    61522, 61523, 61524, 61525, 61526, 61527, 61528, 61529, 61530, 61531, 
+    61532, 61533, 61534, 61535, 61536, 61537, 61538, 61539, 61540, 61541, 
+    61542, 61543, 61544, 61545, 61546, 61547, 61548, 61549, 61550, 61551, 
+    61552, 61553, 61554, 61555, 61556, 61557, 61558, 61559, 61560, 61561, 
+    61562, 61563, 61564, 61565, 61566, 61567, 61568, 61569, 61570, 61571, 
+    61572, 61573, 61574, 61575, 61576, 61577, 61578, 61579, 61580, 61581, 
+    61582, 61583, 61584, 61585, 61586, 61587, 61588, 61589, 61590, 61591, 
+    61592, 61593, 61594, 61595, 61596, 61597, 61598, 61599, 61600, 61601, 
+    61602, 61603, 61604, 61605, 61606, 61607, 61608, 61609, 61610, 61611, 
+    61612, 61613, 61614, 61615, 61616, 61617, 61618, 61619, 61620, 61621, 
+    61622, 61623, 61624, 61625, 61626, 61627, 61628, 61629, 61630, 61631, 
+    61632, 61633, 61634, 61635, 61636, 61637, 61638, 61639, 61640, 61641, 
+    61642, 61643, 61644, 61645, 61646, 61647, 61648, 61649, 61650, 61651, 
+    61652, 61653, 61654, 61655, 61656, 61657, 61658, 61659, 61660, 61661, 
+    61662, 61663, 61664, 61665, 61666, 61667, 61668, 61669, 61670, 61671, 
+    61672, 61673, 61674, 61675, 61676, 61677, 61678, 61679, 61680, 61681, 
+    61682, 61683, 61684, 61685, 61686, 61687, 61688, 61689, 61690, 61691, 
+    61692, 61693, 61694, 61695, 61696, 61697, 61698, 61699, 61700, 61701, 
+    61702, 61703, 61704, 61705, 61706, 61707, 61708, 61709, 61710, 61711, 
+    61712, 61713, 61714, 61715, 61716, 61717, 61718, 61719, 61720, 61721, 
+    61722, 61723, 61724, 61725, 61726, 61727, 61728, 61729, 61730, 61731, 
+    61732, 61733, 61734, 61735, 61736, 61737, 61738, 61739, 61740, 61741, 
+    61742, 61743, 61744, 61745, 61746, 61747, 61748, 61749, 61750, 61751, 
+    61752, 61753, 61754, 61755, 61756, 61757, 61758, 61759, 61760, 61761, 
+    61762, 61763, 61764, 61765, 61766, 61767, 61768, 61769, 61770, 61771, 
+    61772, 61773, 61774, 61775, 61776, 61777, 61778, 61779, 61780, 61781, 
+    61782, 61783, 61784, 61785, 61786, 61787, 61788, 61789, 61790, 61791, 
+    61792, 61793, 61794, 61795, 61796, 61797, 61798, 61799, 61800, 61801, 
+    61802, 61803, 61804, 61805, 61806, 61807, 61808, 61809, 61810, 61811, 
+    61812, 61813, 61814, 61815, 61816, 61817, 61818, 61819, 61820, 61821, 
+    61822, 61823, 61824, 61825, 61826, 61827, 61828, 61829, 61830, 61831, 
+    61832, 61833, 61834, 61835, 61836, 61837, 61838, 61839, 61840, 61841, 
+    61842, 61843, 61844, 61845, 61846, 61847, 61848, 61849, 61850, 61851, 
+    61852, 61853, 61854, 61855, 61856, 61857, 61858, 61859, 61860, 61861, 
+    61862, 61863, 61864, 61865, 61866, 61867, 61868, 61869, 61870, 61871, 
+    61872, 61873, 61874, 61875, 61876, 61877, 61878, 61879, 61880, 61881, 
+    61882, 61883, 61884, 61885, 61886, 61887, 61888, 61889, 61890, 61891, 
+    61892, 61893, 61894, 61895, 61896, 61897, 61898, 61899, 61900, 61901, 
+    61902, 61903, 61904, 61905, 61906, 61907, 61908, 61909, 61910, 61911, 
+    61912, 61913, 61914, 61915, 61916, 61917, 61918, 61919, 61920, 61921, 
+    61922, 61923, 61924, 61925, 61926, 61927, 61928, 61929, 61930, 61931, 
+    61932, 61933, 61934, 61935, 61936, 61937, 61938, 61939, 61940, 61941, 
+    61942, 61943, 61944, 61945, 61946, 61947, 61948, 61949, 61950, 61951, 
+    61952, 61953, 61954, 61955, 61956, 61957, 61958, 61959, 61960, 61961, 
+    61962, 61963, 61964, 61965, 61966, 61967, 61968, 61969, 61970, 61971, 
+    61972, 61973, 61974, 61975, 61976, 61977, 61978, 61979, 61980, 61981, 
+    61982, 61983, 61984, 61985, 61986, 61987, 61988, 61989, 61990, 61991, 
+    61992, 61993, 61994, 61995, 61996, 61997, 61998, 61999, 62000, 62001, 
+    62002, 62003, 62004, 62005, 62006, 62007, 62008, 62009, 62010, 62011, 
+    62012, 62013, 62014, 62015, 62016, 62017, 62018, 62019, 62020, 62021, 
+    62022, 62023, 62024, 62025, 62026, 62027, 62028, 62029, 62030, 62031, 
+    62032, 62033, 62034, 62035, 62036, 62037, 62038, 62039, 62040, 62041, 
+    62042, 62043, 62044, 62045, 62046, 62047, 62048, 62049, 62050, 62051, 
+    62052, 62053, 62054, 62055, 62056, 62057, 62058, 62059, 62060, 62061, 
+    62062, 62063, 62064, 62065, 62066, 62067, 62068, 62069, 62070, 62071, 
+    62072, 62073, 62074, 62075, 62076, 62077, 62078, 62079, 62080, 62081, 
+    62082, 62083, 62084, 62085, 62086, 62087, 62088, 62089, 62090, 62091, 
+    62092, 62093, 62094, 62095, 62096, 62097, 62098, 62099, 62100, 62101, 
+    62102, 62103, 62104, 62105, 62106, 62107, 62108, 62109, 62110, 62111, 
+    62112, 62113, 62114, 62115, 62116, 62117, 62118, 62119, 62120, 62121, 
+    62122, 62123, 62124, 62125, 62126, 62127, 62128, 62129, 62130, 62131, 
+    62132, 62133, 62134, 62135, 62136, 62137, 62138, 62139, 62140, 62141, 
+    62142, 62143, 62144, 62145, 62146, 62147, 62148, 62149, 62150, 62151, 
+    62152, 62153, 62154, 62155, 62156, 62157, 62158, 62159, 62160, 62161, 
+    62162, 62163, 62164, 62165, 62166, 62167, 62168, 62169, 62170, 62171, 
+    62172, 62173, 62174, 62175, 62176, 62177, 62178, 62179, 62180, 62181, 
+    62182, 62183, 62184, 62185, 62186, 62187, 62188, 62189, 62190, 62191, 
+    62192, 62193, 62194, 62195, 62196, 62197, 62198, 62199, 62200, 62201, 
+    62202, 62203, 62204, 62205, 62206, 62207, 62208, 62209, 62210, 62211, 
+    62212, 62213, 62214, 62215, 62216, 62217, 62218, 62219, 62220, 62221, 
+    62222, 62223, 62224, 62225, 62226, 62227, 62228, 62229, 62230, 62231, 
+    62232, 62233, 62234, 62235, 62236, 62237, 62238, 62239, 62240, 62241, 
+    62242, 62243, 62244, 62245, 62246, 62247, 62248, 62249, 62250, 62251, 
+    62252, 62253, 62254, 62255, 62256, 62257, 62258, 62259, 62260, 62261, 
+    62262, 62263, 62264, 62265, 62266, 62267, 62268, 62269, 62270, 62271, 
+    62272, 62273, 62274, 62275, 62276, 62277, 62278, 62279, 62280, 62281, 
+    62282, 62283, 62284, 62285, 62286, 62287, 62288, 62289, 62290, 62291, 
+    62292, 62293, 62294, 62295, 62296, 62297, 62298, 62299, 62300, 62301, 
+    62302, 62303, 62304, 62305, 62306, 62307, 62308, 62309, 62310, 62311, 
+    62312, 62313, 62314, 62315, 62316, 62317, 62318, 62319, 62320, 62321, 
+    62322, 62323, 62324, 62325, 62326, 62327, 62328, 62329, 62330, 62331, 
+    62332, 62333, 62334, 62335, 62336, 62337, 62338, 62339, 62340, 62341, 
+    62342, 62343, 62344, 62345, 62346, 62347, 62348, 62349, 62350, 62351, 
+    62352, 62353, 62354, 62355, 62356, 62357, 62358, 62359, 62360, 62361, 
+    62362, 62363, 62364, 62365, 62366, 62367, 62368, 62369, 62370, 62371, 
+    62372, 62373, 62374, 62375, 62376, 62377, 62378, 62379, 62380, 62381, 
+    62382, 62383, 62384, 62385, 62386, 62387, 62388, 62389, 62390, 62391, 
+    62392, 62393, 62394, 62395, 62396, 62397, 62398, 62399, 62400, 62401, 
+    62402, 62403, 62404, 62405, 62406, 62407, 62408, 62409, 62410, 62411, 
+    62412, 62413, 62414, 62415, 62416, 62417, 62418, 62419, 62420, 62421, 
+    62422, 62423, 62424, 62425, 62426, 62427, 62428, 62429, 62430, 62431, 
+    62432, 62433, 62434, 62435, 62436, 62437, 62438, 62439, 62440, 62441, 
+    62442, 62443, 62444, 62445, 62446, 62447, 62448, 62449, 62450, 62451, 
+    62452, 62453, 62454, 62455, 62456, 62457, 62458, 62459, 62460, 62461, 
+    62462, 62463, 62464, 62465, 62466, 62467, 62468, 62469, 62470, 62471, 
+    62472, 62473, 62474, 62475, 62476, 62477, 62478, 62479, 62480, 62481, 
+    62482, 62483, 62484, 62485, 62486, 62487, 62488, 62489, 62490, 62491, 
+    62492, 62493, 62494, 62495, 62496, 62497, 62498, 62499, 62500, 62501, 
+    62502, 62503, 62504, 62505, 62506, 62507, 62508, 62509, 62510, 62511, 
+    62512, 62513, 62514, 62515, 62516, 62517, 62518, 62519, 62520, 62521, 
+    62522, 62523, 62524, 62525, 62526, 62527, 62528, 62529, 62530, 62531, 
+    62532, 62533, 62534, 62535, 62536, 62537, 62538, 62539, 62540, 62541, 
+    62542, 62543, 62544, 62545, 62546, 62547, 62548, 62549, 62550, 62551, 
+    62552, 62553, 62554, 62555, 62556, 62557, 62558, 62559, 62560, 62561, 
+    62562, 62563, 62564, 62565, 62566, 62567, 62568, 62569, 62570, 62571, 
+    62572, 62573, 62574, 62575, 62576, 62577, 62578, 62579, 62580, 62581, 
+    62582, 62583, 62584, 62585, 62586, 62587, 62588, 62589, 62590, 62591, 
+    62592, 62593, 62594, 62595, 62596, 62597, 62598, 62599, 62600, 62601, 
+    62602, 62603, 62604, 62605, 62606, 62607, 62608, 62609, 62610, 62611, 
+    62612, 62613, 62614, 62615, 62616, 62617, 62618, 62619, 62620, 62621, 
+    62622, 62623, 62624, 62625, 62626, 62627, 62628, 62629, 62630, 62631, 
+    62632, 62633, 62634, 62635, 62636, 62637, 62638, 62639, 62640, 62641, 
+    62642, 62643, 62644, 62645, 62646, 62647, 62648, 62649, 62650, 62651, 
+    62652, 62653, 62654, 62655, 62656, 62657, 62658, 62659, 62660, 62661, 
+    62662, 62663, 62664, 62665, 62666, 62667, 62668, 62669, 62670, 62671, 
+    62672, 62673, 62674, 62675, 62676, 62677, 62678, 62679, 62680, 62681, 
+    62682, 62683, 62684, 62685, 62686, 62687, 62688, 62689, 62690, 62691, 
+    62692, 62693, 62694, 62695, 62696, 62697, 62698, 62699, 62700, 62701, 
+    62702, 62703, 62704, 62705, 62706, 62707, 62708, 62709, 62710, 62711, 
+    62712, 62713, 62714, 62715, 62716, 62717, 62718, 62719, 62720, 62721, 
+    62722, 62723, 62724, 62725, 62726, 62727, 62728, 62729, 62730, 62731, 
+    62732, 62733, 62734, 62735, 62736, 62737, 62738, 62739, 62740, 62741, 
+    62742, 62743, 62744, 62745, 62746, 62747, 62748, 62749, 62750, 62751, 
+    62752, 62753, 62754, 62755, 62756, 62757, 62758, 62759, 62760, 62761, 
+    62762, 62763, 62764, 62765, 62766, 62767, 62768, 62769, 62770, 62771, 
+    62772, 62773, 62774, 62775, 62776, 62777, 62778, 62779, 62780, 62781, 
+    62782, 62783, 62784, 62785, 62786, 62787, 62788, 62789, 62790, 62791, 
+    62792, 62793, 62794, 62795, 62796, 62797, 62798, 62799, 62800, 62801, 
+    62802, 62803, 62804, 62805, 62806, 62807, 62808, 62809, 62810, 62811, 
+    62812, 62813, 62814, 62815, 62816, 62817, 62818, 62819, 62820, 62821, 
+    62822, 62823, 62824, 62825, 62826, 62827, 62828, 62829, 62830, 62831, 
+    62832, 62833, 62834, 62835, 62836, 62837, 62838, 62839, 62840, 62841, 
+    62842, 62843, 62844, 62845, 62846, 62847, 62848, 62849, 62850, 62851, 
+    62852, 62853, 62854, 62855, 62856, 62857, 62858, 62859, 62860, 62861, 
+    62862, 62863, 62864, 62865, 62866, 62867, 62868, 62869, 62870, 62871, 
+    62872, 62873, 62874, 62875, 62876, 62877, 62878, 62879, 62880, 62881, 
+    62882, 62883, 62884, 62885, 62886, 62887, 62888, 62889, 62890, 62891, 
+    62892, 62893, 62894, 62895, 62896, 62897, 62898, 62899, 62900, 62901, 
+    62902, 62903, 62904, 62905, 62906, 62907, 62908, 62909, 62910, 62911, 
+    62912, 62913, 62914, 62915, 62916, 62917, 62918, 62919, 62920, 62921, 
+    62922, 62923, 62924, 62925, 62926, 62927, 62928, 62929, 62930, 62931, 
+    62932, 62933, 62934, 62935, 62936, 62937, 62938, 62939, 62940, 62941, 
+    62942, 62943, 62944, 62945, 62946, 62947, 62948, 62949, 62950, 62951, 
+    62952, 62953, 62954, 62955, 62956, 62957, 62958, 62959, 62960, 62961, 
+    62962, 62963, 62964, 62965, 62966, 62967, 62968, 62969, 62970, 62971, 
+    62972, 62973, 62974, 62975, 62976, 62977, 62978, 62979, 62980, 62981, 
+    62982, 62983, 62984, 62985, 62986, 62987, 62988, 62989, 62990, 62991, 
+    62992, 62993, 62994, 62995, 62996, 62997, 62998, 62999, 63000, 63001, 
+    63002, 63003, 63004, 63005, 63006, 63007, 63008, 63009, 63010, 63011, 
+    63012, 63013, 63014, 63015, 63016, 63017, 63018, 63019, 63020, 63021, 
+    63022, 63023, 63024, 63025, 63026, 63027, 63028, 63029, 63030, 63031, 
+    63032, 63033, 63034, 63035, 63036, 63037, 63038, 63039, 63040, 63041, 
+    63042, 63043, 63044, 63045, 63046, 63047, 63048, 63049, 63050, 63051, 
+    63052, 63053, 63054, 63055, 63056, 63057, 63058, 63059, 63060, 63061, 
+    63062, 63063, 63064, 63065, 63066, 63067, 63068, 63069, 63070, 63071, 
+    63072, 63073, 63074, 63075, 63076, 63077, 63078, 63079, 63080, 63081, 
+    63082, 63083, 63084, 63085, 63086, 63087, 63088, 63089, 63090, 63091, 
+    63092, 63093, 63094, 63095, 63096, 63097, 63098, 63099, 63100, 63101, 
+    63102, 63103, 63104, 63105, 63106, 63107, 63108, 63109, 63110, 63111, 
+    63112, 63113, 63114, 63115, 63116, 63117, 63118, 63119, 63120, 63121, 
+    63122, 63123, 63124, 63125, 63126, 63127, 63128, 63129, 63130, 63131, 
+    63132, 63133, 63134, 63135, 63136, 63137, 63138, 63139, 63140, 63141, 
+    63142, 63143, 63144, 63145, 63146, 63147, 63148, 63149, 63150, 63151, 
+    63152, 63153, 63154, 63155, 63156, 63157, 63158, 63159, 63160, 63161, 
+    63162, 63163, 63164, 63165, 63166, 63167, 63168, 63169, 63170, 63171, 
+    63172, 63173, 63174, 63175, 63176, 63177, 63178, 63179, 63180, 63181, 
+    63182, 63183, 63184, 63185, 63186, 63187, 63188, 63189, 63190, 63191, 
+    63192, 63193, 63194, 63195, 63196, 63197, 63198, 63199, 63200, 63201, 
+    63202, 63203, 63204, 63205, 63206, 63207, 63208, 63209, 63210, 63211, 
+    63212, 63213, 63214, 63215, 63216, 63217, 63218, 63219, 63220, 63221, 
+    63222, 63223, 63224, 63225, 63226, 63227, 63228, 63229, 63230, 63231, 
+    63232, 63233, 63234, 63235, 63236, 63237, 63238, 63239, 63240, 63241, 
+    63242, 63243, 63244, 63245, 63246, 63247, 63248, 63249, 63250, 63251, 
+    63252, 63253, 63254, 63255, 63256, 63257, 63258, 63259, 63260, 63261, 
+    63262, 63263, 63264, 63265, 63266, 63267, 63268, 63269, 63270, 63271, 
+    63272, 63273, 63274, 63275, 63276, 63277, 63278, 63279, 63280, 63281, 
+    63282, 63283, 63284, 63285, 63286, 63287, 63288, 63289, 63290, 63291, 
+    63292, 63293, 63294, 63295, 63296, 63297, 63298, 63299, 63300, 63301, 
+    63302, 63303, 63304, 63305, 63306, 63307, 63308, 63309, 63310, 63311, 
+    63312, 63313, 63314, 63315, 63316, 63317, 63318, 63319, 63320, 63321, 
+    63322, 63323, 63324, 63325, 63326, 63327, 63328, 63329, 63330, 63331, 
+    63332, 63333, 63334, 63335, 63336, 63337, 63338, 63339, 63340, 63341, 
+    63342, 63343, 63344, 63345, 63346, 63347, 63348, 63349, 63350, 63351, 
+    63352, 63353, 63354, 63355, 63356, 63357, 63358, 63359, 63360, 63361, 
+    63362, 63363, 63364, 63365, 63366, 63367, 63368, 63369, 63370, 63371, 
+    63372, 63373, 63374, 63375, 63376, 63377, 63378, 63379, 63380, 63381, 
+    63382, 63383, 63384, 63385, 63386, 63387, 63388, 63389, 63390, 63391, 
+    63392, 63393, 63394, 63395, 63396, 63397, 63398, 63399, 63400, 63401, 
+    63402, 63403, 63404, 63405, 63406, 63407, 63408, 63409, 63410, 63411, 
+    63412, 63413, 63414, 63415, 63416, 63417, 63418, 63419, 63420, 63421, 
+    63422, 63423, 63424, 63425, 63426, 63427, 63428, 63429, 63430, 63431, 
+    63432, 63433, 63434, 63435, 63436, 63437, 63438, 63439, 63440, 63441, 
+    63442, 63443, 63444, 63445, 63446, 63447, 63448, 63449, 63450, 63451, 
+    63452, 63453, 63454, 63455, 63456, 63457, 63458, 63459, 63460, 63461, 
+    63462, 63463, 63464, 63465, 63466, 63467, 63468, 63469, 63470, 63471, 
+    63472, 63473, 63474, 63475, 63476, 63477, 63478, 63479, 63480, 63481, 
+    63482, 63483, 63484, 63485, 63486, 63487, 63488, 63489, 63490, 63491, 
+    63492, 63493, 63494, 63495, 63496, 63497, 63498, 63499, 63500, 63501, 
+    63502, 63503, 63504, 63505, 63506, 63507, 63508, 63509, 63510, 63511, 
+    63512, 63513, 63514, 63515, 63516, 63517, 63518, 63519, 63520, 63521, 
+    63522, 63523, 63524, 63525, 63526, 63527, 63528, 63529, 63530, 63531, 
+    63532, 63533, 63534, 63535, 63536, 63537, 63538, 63539, 63540, 63541, 
+    63542, 63543, 63544, 63545, 63546, 63547, 63548, 63549, 63550, 63551, 
+    63552, 63553, 63554, 63555, 63556, 63557, 63558, 63559, 63560, 63561, 
+    63562, 63563, 63564, 63565, 63566, 63567, 63568, 63569, 63570, 63571, 
+    63572, 63573, 63574, 63575, 63576, 63577, 63578, 63579, 63580, 63581, 
+    63582, 63583, 63584, 63585, 63586, 63587, 63588, 63589, 63590, 63591, 
+    63592, 63593, 63594, 63595, 63596, 63597, 63598, 63599, 63600, 63601, 
+    63602, 63603, 63604, 63605, 63606, 63607, 63608, 63609, 63610, 63611, 
+    63612, 63613, 63614, 63615, 63616, 63617, 63618, 63619, 63620, 63621, 
+    63622, 63623, 63624, 63625, 63626, 63627, 63628, 63629, 63630, 63631, 
+    63632, 63633, 63634, 63635, 63636, 63637, 63638, 63639, 63640, 63641, 
+    63642, 63643, 63644, 63645, 63646, 63647, 63648, 63649, 63650, 63651, 
+    63652, 63653, 63654, 63655, 63656, 63657, 63658, 63659, 63660, 63661, 
+    63662, 63663, 63664, 63665, 63666, 63667, 63668, 63669, 63670, 63671, 
+    63672, 63673, 63674, 63675, 63676, 63677, 63678, 63679, 63680, 63681, 
+    63682, 63683, 63684, 63685, 63686, 63687, 63688, 63689, 63690, 63691, 
+    63692, 63693, 63694, 63695, 63696, 63697, 63698, 63699, 63700, 63701, 
+    63702, 63703, 63704, 63705, 63706, 63707, 63708, 63709, 63710, 63711, 
+    63712, 63713, 63714, 63715, 63716, 63717, 63718, 63719, 63720, 63721, 
+    63722, 63723, 63724, 63725, 63726, 63727, 63728, 63729, 63730, 63731, 
+    63732, 63733, 63734, 63735, 63736, 63737, 63738, 63739, 63740, 63741, 
+    63742, 63743, 63744, 63745, 63746, 63747, 63748, 63749, 63750, 63751, 
+    63752, 63753, 63754, 63755, 63756, 63757, 63758, 63759, 63760, 63761, 
+    63762, 63763, 63764, 63765, 63766, 63767, 63768, 63769, 63770, 63771, 
+    63772, 63773, 63774, 63775, 63776, 63777, 63778, 63779, 63780, 63781, 
+    63782, 63783, 63784, 63785, 63786, 63787, 63788, 63789, 63790, 63791, 
+    63792, 63793, 63794, 63795, 63796, 63797, 63798, 63799, 63800, 63801, 
+    63802, 63803, 63804, 63805, 63806, 63807, 63808, 63809, 63810, 63811, 
+    63812, 63813, 63814, 63815, 63816, 63817, 63818, 63819, 63820, 63821, 
+    63822, 63823, 63824, 63825, 63826, 63827, 63828, 63829, 63830, 63831, 
+    63832, 63833, 63834, 63835, 63836, 63837, 63838, 63839, 63840, 63841, 
+    63842, 63843, 63844, 63845, 63846, 63847, 63848, 63849, 63850, 63851, 
+    63852, 63853, 63854, 63855, 63856, 63857, 63858, 63859, 63860, 63861, 
+    63862, 63863, 63864, 63865, 63866, 63867, 63868, 63869, 63870, 63871, 
+    63872, 63873, 63874, 63875, 63876, 63877, 63878, 63879, 63880, 63881, 
+    63882, 63883, 63884, 63885, 63886, 63887, 63888, 63889, 63890, 63891, 
+    63892, 63893, 63894, 63895, 63896, 63897, 63898, 63899, 63900, 63901, 
+    63902, 63903, 63904, 63905, 63906, 63907, 63908, 63909, 63910, 63911, 
+    63912, 63913, 63914, 63915, 63916, 63917, 63918, 63919, 63920, 63921, 
+    63922, 63923, 63924, 63925, 63926, 63927, 63928, 63929, 63930, 63931, 
+    63932, 63933, 63934, 63935, 63936, 63937, 63938, 63939, 63940, 63941, 
+    63942, 63943, 63944, 63945, 63946, 63947, 63948, 63949, 63950, 63951, 
+    63952, 63953, 63954, 63955, 63956, 63957, 63958, 63959, 63960, 63961, 
+    63962, 63963, 63964, 63965, 63966, 63967, 63968, 63969, 63970, 63971, 
+    63972, 63973, 63974, 63975, 63976, 63977, 63978, 63979, 63980, 63981, 
+    63982, 63983, 63984, 63985, 63986, 63987, 63988, 63989, 63990, 63991, 
+    63992, 63993, 63994, 63995, 63996, 63997, 63998, 63999, 64000, 64001, 
+    64002, 64003, 64004, 64005, 64006, 64007, 64008, 64009, 64010, 64011, 
+    64012, 64013, 64014, 64015, 64016, 64017, 64018, 64019, 64020, 64021, 
+    64022, 64023, 64024, 64025, 64026, 64027, 64028, 64029, 64030, 64031, 
+    64032, 64033, 64034, 64035, 64036, 64037, 64038, 64039, 64040, 64041, 
+    64042, 64043, 64044, 64045, 64046, 64047, 64048, 64049, 64050, 64051, 
+    64052, 64053, 64054, 64055, 64056, 64057, 64058, 64059, 64060, 64061, 
+    64062, 64063, 64064, 64065, 64066, 64067, 64068, 64069, 64070, 64071, 
+    64072, 64073, 64074, 64075, 64076, 64077, 64078, 64079, 64080, 64081, 
+    64082, 64083, 64084, 64085, 64086, 64087, 64088, 64089, 64090, 64091, 
+    64092, 64093, 64094, 64095, 64096, 64097, 64098, 64099, 64100, 64101, 
+    64102, 64103, 64104, 64105, 64106, 64107, 64108, 64109, 64110, 64111, 
+    64112, 64113, 64114, 64115, 64116, 64117, 64118, 64119, 64120, 64121, 
+    64122, 64123, 64124, 64125, 64126, 64127, 64128, 64129, 64130, 64131, 
+    64132, 64133, 64134, 64135, 64136, 64137, 64138, 64139, 64140, 64141, 
+    64142, 64143, 64144, 64145, 64146, 64147, 64148, 64149, 64150, 64151, 
+    64152, 64153, 64154, 64155, 64156, 64157, 64158, 64159, 64160, 64161, 
+    64162, 64163, 64164, 64165, 64166, 64167, 64168, 64169, 64170, 64171, 
+    64172, 64173, 64174, 64175, 64176, 64177, 64178, 64179, 64180, 64181, 
+    64182, 64183, 64184, 64185, 64186, 64187, 64188, 64189, 64190, 64191, 
+    64192, 64193, 64194, 64195, 64196, 64197, 64198, 64199, 64200, 64201, 
+    64202, 64203, 64204, 64205, 64206, 64207, 64208, 64209, 64210, 64211, 
+    64212, 64213, 64214, 64215, 64216, 64217, 64218, 64219, 64220, 64221, 
+    64222, 64223, 64224, 64225, 64226, 64227, 64228, 64229, 64230, 64231, 
+    64232, 64233, 64234, 64235, 64236, 64237, 64238, 64239, 64240, 64241, 
+    64242, 64243, 64244, 64245, 64246, 64247, 64248, 64249, 64250, 64251, 
+    64252, 64253, 64254, 64255, 64256, 64257, 64258, 64259, 64260, 64261, 
+    64262, 64263, 64264, 64265, 64266, 64267, 64268, 64269, 64270, 64271, 
+    64272, 64273, 64274, 64275, 64276, 64277, 64278, 64279, 64280, 64281, 
+    64282, 64283, 64284, 64285, 64286, 64287, 64288, 64289, 64290, 64291, 
+    64292, 64293, 64294, 64295, 64296, 64297, 64298, 64299, 64300, 64301, 
+    64302, 64303, 64304, 64305, 64306, 64307, 64308, 64309, 64310, 64311, 
+    64312, 64313, 64314, 64315, 64316, 64317, 64318, 64319, 64320, 64321, 
+    64322, 64323, 64324, 64325, 64326, 64327, 64328, 64329, 64330, 64331, 
+    64332, 64333, 64334, 64335, 64336, 64337, 64338, 64339, 64340, 64341, 
+    64342, 64343, 64344, 64345, 64346, 64347, 64348, 64349, 64350, 64351, 
+    64352, 64353, 64354, 64355, 64356, 64357, 64358, 64359, 64360, 64361, 
+    64362, 64363, 64364, 64365, 64366, 64367, 64368, 64369, 64370, 64371, 
+    64372, 64373, 64374, 64375, 64376, 64377, 64378, 64379, 64380, 64381, 
+    64382, 64383, 64384, 64385, 64386, 64387, 64388, 64389, 64390, 64391, 
+    64392, 64393, 64394, 64395, 64396, 64397, 64398, 64399, 64400, 64401, 
+    64402, 64403, 64404, 64405, 64406, 64407, 64408, 64409, 64410, 64411, 
+    64412, 64413, 64414, 64415, 64416, 64417, 64418, 64419, 64420, 64421, 
+    64422, 64423, 64424, 64425, 64426, 64427, 64428, 64429, 64430, 64431, 
+    64432, 64433, 64434, 64435, 64436, 64437, 64438, 64439, 64440, 64441, 
+    64442, 64443, 64444, 64445, 64446, 64447, 64448, 64449, 64450, 64451, 
+    64452, 64453, 64454, 64455, 64456, 64457, 64458, 64459, 64460, 64461, 
+    64462, 64463, 64464, 64465, 64466, 64467, 64468, 64469, 64470, 64471, 
+    64472, 64473, 64474, 64475, 64476, 64477, 64478, 64479, 64480, 64481, 
+    64482, 64483, 64484, 64485, 64486, 64487, 64488, 64489, 64490, 64491, 
+    64492, 64493, 64494, 64495, 64496, 64497, 64498, 64499, 64500, 64501, 
+    64502, 64503, 64504, 64505, 64506, 64507, 64508, 64509, 64510, 64511, 
+    64512, 64513, 64514, 64515, 64516, 64517, 64518, 64519, 64520, 64521, 
+    64522, 64523, 64524, 64525, 64526, 64527, 64528, 64529, 64530, 64531, 
+    64532, 64533, 64534, 64535, 64536, 64537, 64538, 64539, 64540, 64541, 
+    64542, 64543, 64544, 64545, 64546, 64547, 64548, 64549, 64550, 64551, 
+    64552, 64553, 64554, 64555, 64556, 64557, 64558, 64559, 64560, 64561, 
+    64562, 64563, 64564, 64565, 64566, 64567, 64568, 64569, 64570, 64571, 
+    64572, 64573, 64574, 64575, 64576, 64577, 64578, 64579, 64580, 64581, 
+    64582, 64583, 64584, 64585, 64586, 64587, 64588, 64589, 64590, 64591, 
+    64592, 64593, 64594, 64595, 64596, 64597, 64598, 64599, 64600, 64601, 
+    64602, 64603, 64604, 64605, 64606, 64607, 64608, 64609, 64610, 64611, 
+    64612, 64613, 64614, 64615, 64616, 64617, 64618, 64619, 64620, 64621, 
+    64622, 64623, 64624, 64625, 64626, 64627, 64628, 64629, 64630, 64631, 
+    64632, 64633, 64634, 64635, 64636, 64637, 64638, 64639, 64640, 64641, 
+    64642, 64643, 64644, 64645, 64646, 64647, 64648, 64649, 64650, 64651, 
+    64652, 64653, 64654, 64655, 64656, 64657, 64658, 64659, 64660, 64661, 
+    64662, 64663, 64664, 64665, 64666, 64667, 64668, 64669, 64670, 64671, 
+    64672, 64673, 64674, 64675, 64676, 64677, 64678, 64679, 64680, 64681, 
+    64682, 64683, 64684, 64685, 64686, 64687, 64688, 64689, 64690, 64691, 
+    64692, 64693, 64694, 64695, 64696, 64697, 64698, 64699, 64700, 64701, 
+    64702, 64703, 64704, 64705, 64706, 64707, 64708, 64709, 64710, 64711, 
+    64712, 64713, 64714, 64715, 64716, 64717, 64718, 64719, 64720, 64721, 
+    64722, 64723, 64724, 64725, 64726, 64727, 64728, 64729, 64730, 64731, 
+    64732, 64733, 64734, 64735, 64736, 64737, 64738, 64739, 64740, 64741, 
+    64742, 64743, 64744, 64745, 64746, 64747, 64748, 64749, 64750, 64751, 
+    64752, 64753, 64754, 64755, 64756, 64757, 64758, 64759, 64760, 64761, 
+    64762, 64763, 64764, 64765, 64766, 64767, 64768, 64769, 64770, 64771, 
+    64772, 64773, 64774, 64775, 64776, 64777, 64778, 64779, 64780, 64781, 
+    64782, 64783, 64784, 64785, 64786, 64787, 64788, 64789, 64790, 64791, 
+    64792, 64793, 64794, 64795, 64796, 64797, 64798, 64799, 64800, 64801, 
+    64802, 64803, 64804, 64805, 64806, 64807, 64808, 64809, 64810, 64811, 
+    64812, 64813, 64814, 64815, 64816, 64817, 64818, 64819, 64820, 64821, 
+    64822, 64823, 64824, 64825, 64826, 64827, 64828, 64829, 64830, 64831, 
+    64832, 64833, 64834, 64835, 64836, 64837, 64838, 64839, 64840, 64841, 
+    64842, 64843, 64844, 64845, 64846, 64847, 64848, 64849, 64850, 64851, 
+    64852, 64853, 64854, 64855, 64856, 64857, 64858, 64859, 64860, 64861, 
+    64862, 64863, 64864, 64865, 64866, 64867, 64868, 64869, 64870, 64871, 
+    64872, 64873, 64874, 64875, 64876, 64877, 64878, 64879, 64880, 64881, 
+    64882, 64883, 64884, 64885, 64886, 64887, 64888, 64889, 64890, 64891, 
+    64892, 64893, 64894, 64895, 64896, 64897, 64898, 64899, 64900, 64901, 
+    64902, 64903, 64904, 64905, 64906, 64907, 64908, 64909, 64910, 64911, 
+    64912, 64913, 64914, 64915, 64916, 64917, 64918, 64919, 64920, 64921, 
+    64922, 64923, 64924, 64925, 64926, 64927, 64928, 64929, 64930, 64931, 
+    64932, 64933, 64934, 64935, 64936, 64937, 64938, 64939, 64940, 64941, 
+    64942, 64943, 64944, 64945, 64946, 64947, 64948, 64949, 64950, 64951, 
+    64952, 64953, 64954, 64955, 64956, 64957, 64958, 64959, 64960, 64961, 
+    64962, 64963, 64964, 64965, 64966, 64967, 64968, 64969, 64970, 64971, 
+    64972, 64973, 64974, 64975, 64976, 64977, 64978, 64979, 64980, 64981, 
+    64982, 64983, 64984, 64985, 64986, 64987, 64988, 64989, 64990, 64991, 
+    64992, 64993, 64994, 64995, 64996, 64997, 64998, 64999, 65000, 65001, 
+    65002, 65003, 65004, 65005, 65006, 65007, 65008, 65009, 65010, 65011, 
+    65012, 65013, 65014, 65015, 65016, 65017, 65018, 65019, 65020, 65021, 
+    65022, 65023, 65024, 65025, 65026, 65027, 65028, 65029, 65030, 65031, 
+    65032, 65033, 65034, 65035, 65036, 65037, 65038, 65039, 65040, 65041, 
+    65042, 65043, 65044, 65045, 65046, 65047, 65048, 65049, 65050, 65051, 
+    65052, 65053, 65054, 65055, 65056, 65057, 65058, 65059, 65060, 65061, 
+    65062, 65063, 65064, 65065, 65066, 65067, 65068, 65069, 65070, 65071, 
+    65072, 65073, 65074, 65075, 65076, 65077, 65078, 65079, 65080, 65081, 
+    65082, 65083, 65084, 65085, 65086, 65087, 65088, 65089, 65090, 65091, 
+    65092, 65093, 65094, 65095, 65096, 65097, 65098, 65099, 65100, 65101, 
+    65102, 65103, 65104, 65105, 65106, 65107, 65108, 65109, 65110, 65111, 
+    65112, 65113, 65114, 65115, 65116, 65117, 65118, 65119, 65120, 65121, 
+    65122, 65123, 65124, 65125, 65126, 65127, 65128, 65129, 65130, 65131, 
+    65132, 65133, 65134, 65135, 65136, 65137, 65138, 65139, 65140, 65141, 
+    65142, 65143, 65144, 65145, 65146, 65147, 65148, 65149, 65150, 65151, 
+    65152, 65153, 65154, 65155, 65156, 65157, 65158, 65159, 65160, 65161, 
+    65162, 65163, 65164, 65165, 65166, 65167, 65168, 65169, 65170, 65171, 
+    65172, 65173, 65174, 65175, 65176, 65177, 65178, 65179, 65180, 65181, 
+    65182, 65183, 65184, 65185, 65186, 65187, 65188, 65189, 65190, 65191, 
+    65192, 65193, 65194, 65195, 65196, 65197, 65198, 65199, 65200, 65201, 
+    65202, 65203, 65204, 65205, 65206, 65207, 65208, 65209, 65210, 65211, 
+    65212, 65213, 65214, 65215, 65216, 65217, 65218, 65219, 65220, 65221, 
+    65222, 65223, 65224, 65225, 65226, 65227, 65228, 65229, 65230, 65231, 
+    65232, 65233, 65234, 65235, 65236, 65237, 65238, 65239, 65240, 65241, 
+    65242, 65243, 65244, 65245, 65246, 65247, 65248, 65249, 65250, 65251, 
+    65252, 65253, 65254, 65255, 65256, 65257, 65258, 65259, 65260, 65261, 
+    65262, 65263, 65264, 65265, 65266, 65267, 65268, 65269, 65270, 65271, 
+    65272, 65273, 65274, 65275, 65276, 65277, 65278, 65279, 65280, 65281, 
+    65282, 65283, 65284, 65285, 65286, 65287, 65288, 65289, 65290, 65291, 
+    65292, 65293, 65294, 65295, 65296, 65297, 65298, 65299, 65300, 65301, 
+    65302, 65303, 65304, 65305, 65306, 65307, 65308, 65309, 65310, 65311, 
+    65312, 65313, 65314, 65315, 65316, 65317, 65318, 65319, 65320, 65321, 
+    65322, 65323, 65324, 65325, 65326, 65327, 65328, 65329, 65330, 65331, 
+    65332, 65333, 65334, 65335, 65336, 65337, 65338, 65339, 65340, 65341, 
+    65342, 65343, 65344, 65345, 65346, 65347, 65348, 65349, 65350, 65351, 
+    65352, 65353, 65354, 65355, 65356, 65357, 65358, 65359, 65360, 65361, 
+    65362, 65363, 65364, 65365, 65366, 65367, 65368, 65369, 65370, 65371, 
+    65372, 65373, 65374, 65375, 65376, 65377, 65378, 65379, 65380, 65381, 
+    65382, 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, 65391, 
+    65392, 65393, 65394, 65395, 65396, 65397, 65398, 65399, 65400, 65401, 
+    65402, 65403, 65404, 65405, 65406, 65407, 65408, 65409, 65410, 65411, 
+    65412, 65413, 65414, 65415, 65416, 65417, 65418, 65419, 65420, 65421, 
+    65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 
+    65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 
+    65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 
+    65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 
+    65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 
+    65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 
+    65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 
+    65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 
+    65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 
+    65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 
+    65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 
+    65532, 65533, 65534, 65535, 65536, 65537, 65538, 65539, 65540, 65541, 
+    65542, 65543, 65544, 65545, 65546, 65547, 65548, 65549, 65550, 65551, 
+    65552, 65553, 65554, 65555, 65556, 65557, 65558, 65559, 65560, 65561, 
+    65562, 65563, 65564, 65565, 65566, 65567, 65568, 65569, 65570, 65571, 
+    65572, 65573, 65574, 65575, 65576, 65577, 65578, 65579, 65580, 65581, 
+    65582, 65583, 65584, 65585, 65586, 65587, 65588, 65589, 65590, 65591, 
+    65592, 65593, 65594, 65595, 65596, 65597, 65598, 65599, 65600, 65601, 
+    65602, 65603, 65604, 65605, 65606, 65607, 65608, 65609, 65610, 65611, 
+    65612, 65613, 65614, 65615, 65616, 65617, 65618, 65619, 65620, 65621, 
+    65622, 65623, 65624, 65625, 65626, 65627, 65628, 65629, 65630, 65631, 
+    65632, 65633, 65634, 65635, 65636, 65637, 65638, 65639, 65640, 65641, 
+    65642, 65643, 65644, 65645, 65646, 65647, 65648, 65649, 65650, 65651, 
+    65652, 65653, 65654, 65655, 65656, 65657, 65658, 65659, 65660, 65661, 
+    65662, 65663, 65664, 65665, 65666, 65667, 65668, 65669, 65670, 65671, 
+    65672, 65673, 65674, 65675, 65676, 65677, 65678, 65679, 65680, 65681, 
+    65682, 65683, 65684, 65685, 65686, 65687, 65688, 65689, 65690, 65691, 
+    65692, 65693, 65694, 65695, 65696, 65697, 65698, 65699, 65700, 65701, 
+    65702, 65703, 65704, 65705, 65706, 65707, 65708, 65709, 65710, 65711, 
+    65712, 65713, 65714, 65715, 65716, 65717, 65718, 65719, 65720, 65721, 
+    65722, 65723, 65724, 65725, 65726, 65727, 65728, 65729, 65730, 65731, 
+    65732, 65733, 65734, 65735, 65736, 65737, 65738, 65739, 65740, 65741, 
+    65742, 65743, 65744, 65745, 65746, 65747, 65748, 65749, 65750, 65751, 
+    65752, 65753, 65754, 65755, 65756, 65757, 65758, 65759, 65760, 65761, 
+    65762, 65763, 65764, 65765, 65766, 65767, 65768, 65769, 65770, 65771, 
+    65772, 65773, 65774, 65775, 65776, 65777, 65778, 65779, 65780, 65781, 
+    65782, 65783, 65784, 65785, 65786, 65787, 65788, 65789, 65790, 65791, 
+    65792, 65793, 65794, 65795, 65796, 65797, 65798, 65799, 65800, 65801, 
+    65802, 65803, 65804, 65805, 65806, 65807, 65808, 65809, 65810, 65811, 
+    65812, 65813, 65814, 65815, 65816, 65817, 65818, 65819, 65820, 65821, 
+    65822, 65823, 65824, 65825, 65826, 65827, 65828, 65829, 65830, 65831, 
+    65832, 65833, 65834, 65835, 65836, 65837, 65838, 65839, 65840, 65841, 
+    65842, 65843, 65844, 65845, 65846, 65847, 65848, 65849, 65850, 65851, 
+    65852, 65853, 65854, 65855, 65856, 65857, 65858, 65859, 65860, 65861, 
+    65862, 65863, 65864, 65865, 65866, 65867, 65868, 65869, 65870, 65871, 
+    65872, 65873, 65874, 65875, 65876, 65877, 65878, 65879, 65880, 65881, 
+    65882, 65883, 65884, 65885, 65886, 65887, 65888, 65889, 65890, 65891, 
+    65892, 65893, 65894, 65895, 65896, 65897, 65898, 65899, 65900, 65901, 
+    65902, 65903, 65904, 65905, 65906, 65907, 65908, 65909, 65910, 65911, 
+    65912, 65913, 65914, 65915, 65916, 65917, 65918, 65919, 65920, 65921, 
+    65922, 65923, 65924, 65925, 65926, 65927, 65928, 65929, 65930, 65931, 
+    65932, 65933, 65934, 65935, 65936, 65937, 65938, 65939, 65940, 65941, 
+    65942, 65943, 65944, 65945, 65946, 65947, 65948, 65949, 65950, 65951, 
+    65952, 65953, 65954, 65955, 65956, 65957, 65958, 65959, 65960, 65961, 
+    65962, 65963, 65964, 65965, 65966, 65967, 65968, 65969, 65970, 65971, 
+    65972, 65973, 65974, 65975, 65976, 65977, 65978, 65979, 65980, 65981, 
+    65982, 65983, 65984, 65985, 65986, 65987, 65988, 65989, 65990, 65991, 
+    65992, 65993, 65994, 65995, 65996, 65997, 65998, 65999, 66000, 66001, 
+    66002, 66003, 66004, 66005, 66006, 66007, 66008, 66009, 66010, 66011, 
+    66012, 66013, 66014, 66015, 66016, 66017, 66018, 66019, 66020, 66021, 
+    66022, 66023, 66024, 66025, 66026, 66027, 66028, 66029, 66030, 66031, 
+    66032, 66033, 66034, 66035, 66036, 66037, 66038, 66039, 66040, 66041, 
+    66042, 66043, 66044, 66045, 66046, 66047, 66048, 66049, 66050, 66051, 
+    66052, 66053, 66054, 66055, 66056, 66057, 66058, 66059, 66060, 66061, 
+    66062, 66063, 66064, 66065, 66066, 66067, 66068, 66069, 66070, 66071, 
+    66072, 66073, 66074, 66075, 66076, 66077, 66078, 66079, 66080, 66081, 
+    66082, 66083, 66084, 66085, 66086, 66087, 66088, 66089, 66090, 66091, 
+    66092, 66093, 66094, 66095, 66096, 66097, 66098, 66099, 66100, 66101, 
+    66102, 66103, 66104, 66105, 66106, 66107, 66108, 66109, 66110, 66111, 
+    66112, 66113, 66114, 66115, 66116, 66117, 66118, 66119, 66120, 66121, 
+    66122, 66123, 66124, 66125, 66126, 66127, 66128, 66129, 66130, 66131, 
+    66132, 66133, 66134, 66135, 66136, 66137, 66138, 66139, 66140, 66141, 
+    66142, 66143, 66144, 66145, 66146, 66147, 66148, 66149, 66150, 66151, 
+    66152, 66153, 66154, 66155, 66156, 66157, 66158, 66159, 66160, 66161, 
+    66162, 66163, 66164, 66165, 66166, 66167, 66168, 66169, 66170, 66171, 
+    66172, 66173, 66174, 66175, 66176, 66177, 66178, 66179, 66180, 66181, 
+    66182, 66183, 66184, 66185, 66186, 66187, 66188, 66189, 66190, 66191, 
+    66192, 66193, 66194, 66195, 66196, 66197, 66198, 66199, 66200, 66201, 
+    66202, 66203, 66204, 66205, 66206, 66207, 66208, 66209, 66210, 66211, 
+    66212, 66213, 66214, 66215, 66216, 66217, 66218, 66219, 66220, 66221, 
+    66222, 66223, 66224, 66225, 66226, 66227, 66228, 66229, 66230, 66231, 
+    66232, 66233, 66234, 66235, 66236, 66237, 66238, 66239, 66240, 66241, 
+    66242, 66243, 66244, 66245, 66246, 66247, 66248, 66249, 66250, 66251, 
+    66252, 66253, 66254, 66255, 66256, 66257, 66258, 66259, 66260, 66261, 
+    66262, 66263, 66264, 66265, 66266, 66267, 66268, 66269, 66270, 66271, 
+    66272, 66273, 66274, 66275, 66276, 66277, 66278, 66279, 66280, 66281, 
+    66282, 66283, 66284, 66285, 66286, 66287, 66288, 66289, 66290, 66291, 
+    66292, 66293, 66294, 66295, 66296, 66297, 66298, 66299, 66300, 66301, 
+    66302, 66303, 66304, 66305, 66306, 66307, 66308, 66309, 66310, 66311, 
+    66312, 66313, 66314, 66315, 66316, 66317, 66318, 66319, 66320, 66321, 
+    66322, 66323, 66324, 66325, 66326, 66327, 66328, 66329, 66330, 66331, 
+    66332, 66333, 66334, 66335, 66336, 66337, 66338, 66339, 66340, 66341, 
+    66342, 66343, 66344, 66345, 66346, 66347, 66348, 66349, 66350, 66351, 
+    66352, 66353, 66354, 66355, 66356, 66357, 66358, 66359, 66360, 66361, 
+    66362, 66363, 66364, 66365, 66366, 66367, 66368, 66369, 66370, 66371, 
+    66372, 66373, 66374, 66375, 66376, 66377, 66378, 66379, 66380, 66381, 
+    66382, 66383, 66384, 66385, 66386, 66387, 66388, 66389, 66390, 66391, 
+    66392, 66393, 66394, 66395, 66396, 66397, 66398, 66399, 66400, 66401, 
+    66402, 66403, 66404, 66405, 66406, 66407, 66408, 66409, 66410, 66411, 
+    66412, 66413, 66414, 66415, 66416, 66417, 66418, 66419, 66420, 66421, 
+    66422, 66423, 66424, 66425, 66426, 66427, 66428, 66429, 66430, 66431, 
+    66432, 66433, 66434, 66435, 66436, 66437, 66438, 66439, 66440, 66441, 
+    66442, 66443, 66444, 66445, 66446, 66447, 66448, 66449, 66450, 66451, 
+    66452, 66453, 66454, 66455, 66456, 66457, 66458, 66459, 66460, 66461, 
+    66462, 66463, 66464, 66465, 66466, 66467, 66468, 66469, 66470, 66471, 
+    66472, 66473, 66474, 66475, 66476, 66477, 66478, 66479, 66480, 66481, 
+    66482, 66483, 66484, 66485, 66486, 66487, 66488, 66489, 66490, 66491, 
+    66492, 66493, 66494, 66495, 66496, 66497, 66498, 66499, 66500, 66501, 
+    66502, 66503, 66504, 66505, 66506, 66507, 66508, 66509, 66510, 66511, 
+    66512, 66513, 66514, 66515, 66516, 66517, 66518, 66519, 66520, 66521, 
+    66522, 66523, 66524, 66525, 66526, 66527, 66528, 66529, 66530, 66531, 
+    66532, 66533, 66534, 66535, 66536, 66537, 66538, 66539, 66540, 66541, 
+    66542, 66543, 66544, 66545, 66546, 66547, 66548, 66549, 66550, 66551, 
+    66552, 66553, 66554, 66555, 66556, 66557, 66558, 66559, 66560, 66561, 
+    66562, 66563, 66564, 66565, 66566, 66567, 66568, 66569, 66570, 66571, 
+    66572, 66573, 66574, 66575, 66576, 66577, 66578, 66579, 66580, 66581, 
+    66582, 66583, 66584, 66585, 66586, 66587, 66588, 66589, 66590, 66591, 
+    66592, 66593, 66594, 66595, 66596, 66597, 66598, 66599, 66600, 66601, 
+    66602, 66603, 66604, 66605, 66606, 66607, 66608, 66609, 66610, 66611, 
+    66612, 66613, 66614, 66615, 66616, 66617, 66618, 66619, 66620, 66621, 
+    66622, 66623, 66624, 66625, 66626, 66627, 66628, 66629, 66630, 66631, 
+    66632, 66633, 66634, 66635, 66636, 66637, 66638, 66639, 66640, 66641, 
+    66642, 66643, 66644, 66645, 66646, 66647, 66648, 66649, 66650, 66651, 
+    66652, 66653, 66654, 66655, 66656, 66657, 66658, 66659, 66660, 66661, 
+    66662, 66663, 66664, 66665, 66666, 66667, 66668, 66669, 66670, 66671, 
+    66672, 66673, 66674, 66675, 66676, 66677, 66678, 66679, 66680, 66681, 
+    66682, 66683, 66684, 66685, 66686, 66687, 66688, 66689, 66690, 66691, 
+    66692, 66693, 66694, 66695, 66696, 66697, 66698, 66699, 66700, 66701, 
+    66702, 66703, 66704, 66705, 66706, 66707, 66708, 66709, 66710, 66711, 
+    66712, 66713, 66714, 66715, 66716, 66717, 66718, 66719, 66720, 66721, 
+    66722, 66723, 66724, 66725, 66726, 66727, 66728, 66729, 66730, 66731, 
+    66732, 66733, 66734, 66735, 66736, 66737, 66738, 66739, 66740, 66741, 
+    66742, 66743, 66744, 66745, 66746, 66747, 66748, 66749, 66750, 66751, 
+    66752, 66753, 66754, 66755, 66756, 66757, 66758, 66759, 66760, 66761, 
+    66762, 66763, 66764, 66765, 66766, 66767, 66768, 66769, 66770, 66771, 
+    66772, 66773, 66774, 66775, 66776, 66777, 66778, 66779, 66780, 66781, 
+    66782, 66783, 66784, 66785, 66786, 66787, 66788, 66789, 66790, 66791, 
+    66792, 66793, 66794, 66795, 66796, 66797, 66798, 66799, 66800, 66801, 
+    66802, 66803, 66804, 66805, 66806, 66807, 66808, 66809, 66810, 66811, 
+    66812, 66813, 66814, 66815, 66816, 66817, 66818, 66819, 66820, 66821, 
+    66822, 66823, 66824, 66825, 66826, 66827, 66828, 66829, 66830, 66831, 
+    66832, 66833, 66834, 66835, 66836, 66837, 66838, 66839, 66840, 66841, 
+    66842, 66843, 66844, 66845, 66846, 66847, 66848, 66849, 66850, 66851, 
+    66852, 66853, 66854, 66855, 66856, 66857, 66858, 66859, 66860, 66861, 
+    66862, 66863, 66864, 66865, 66866, 66867, 66868, 66869, 66870, 66871, 
+    66872, 66873, 66874, 66875, 66876, 66877, 66878, 66879, 66880, 66881, 
+    66882, 66883, 66884, 66885, 66886, 66887, 66888, 66889, 66890, 66891, 
+    66892, 66893, 66894, 66895, 66896, 66897, 66898, 66899, 66900, 66901, 
+    66902, 66903, 66904, 66905, 66906, 66907, 66908, 66909, 66910, 66911, 
+    66912, 66913, 66914, 66915, 66916, 66917, 66918, 66919, 66920, 66921, 
+    66922, 66923, 66924, 66925, 66926, 66927, 66928, 66929, 66930, 66931, 
+    66932, 66933, 66934, 66935, 66936, 66937, 66938, 66939, 66940, 66941, 
+    66942, 66943, 66944, 66945, 66946, 66947, 66948, 66949, 66950, 66951, 
+    66952, 66953, 66954, 66955, 66956, 66957, 66958, 66959, 66960, 66961, 
+    66962, 66963, 66964, 66965, 66966, 66967, 66968, 66969, 66970, 66971, 
+    66972, 66973, 66974, 66975, 66976, 66977, 66978, 66979, 66980, 66981, 
+    66982, 66983, 66984, 66985, 66986, 66987, 66988, 66989, 66990, 66991, 
+    66992, 66993, 66994, 66995, 66996, 66997, 66998, 66999, 67000, 67001, 
+    67002, 67003, 67004, 67005, 67006, 67007, 67008, 67009, 67010, 67011, 
+    67012, 67013, 67014, 67015, 67016, 67017, 67018, 67019, 67020, 67021, 
+    67022, 67023, 67024, 67025, 67026, 67027, 67028, 67029, 67030, 67031, 
+    67032, 67033, 67034, 67035, 67036, 67037, 67038, 67039, 67040, 67041, 
+    67042, 67043, 67044, 67045, 67046, 67047, 67048, 67049, 67050, 67051, 
+    67052, 67053, 67054, 67055, 67056, 67057, 67058, 67059, 67060, 67061, 
+    67062, 67063, 67064, 67065, 67066, 67067, 67068, 67069, 67070, 67071, 
+    67072, 67073, 67074, 67075, 67076, 67077, 67078, 67079, 67080, 67081, 
+    67082, 67083, 67084, 67085, 67086, 67087, 67088, 67089, 67090, 67091, 
+    67092, 67093, 67094, 67095, 67096, 67097, 67098, 67099, 67100, 67101, 
+    67102, 67103, 67104, 67105, 67106, 67107, 67108, 67109, 67110, 67111, 
+    67112, 67113, 67114, 67115, 67116, 67117, 67118, 67119, 67120, 67121, 
+    67122, 67123, 67124, 67125, 67126, 67127, 67128, 67129, 67130, 67131, 
+    67132, 67133, 67134, 67135, 67136, 67137, 67138, 67139, 67140, 67141, 
+    67142, 67143, 67144, 67145, 67146, 67147, 67148, 67149, 67150, 67151, 
+    67152, 67153, 67154, 67155, 67156, 67157, 67158, 67159, 67160, 67161, 
+    67162, 67163, 67164, 67165, 67166, 67167, 67168, 67169, 67170, 67171, 
+    67172, 67173, 67174, 67175, 67176, 67177, 67178, 67179, 67180, 67181, 
+    67182, 67183, 67184, 67185, 67186, 67187, 67188, 67189, 67190, 67191, 
+    67192, 67193, 67194, 67195, 67196, 67197, 67198, 67199, 67200, 67201, 
+    67202, 67203, 67204, 67205, 67206, 67207, 67208, 67209, 67210, 67211, 
+    67212, 67213, 67214, 67215, 67216, 67217, 67218, 67219, 67220, 67221, 
+    67222, 67223, 67224, 67225, 67226, 67227, 67228, 67229, 67230, 67231, 
+    67232, 67233, 67234, 67235, 67236, 67237, 67238, 67239, 67240, 67241, 
+    67242, 67243, 67244, 67245, 67246, 67247, 67248, 67249, 67250, 67251, 
+    67252, 67253, 67254, 67255, 67256, 67257, 67258, 67259, 67260, 67261, 
+    67262, 67263, 67264, 67265, 67266, 67267, 67268, 67269, 67270, 67271, 
+    67272, 67273, 67274, 67275, 67276, 67277, 67278, 67279, 67280, 67281, 
+    67282, 67283, 67284, 67285, 67286, 67287, 67288, 67289, 67290, 67291, 
+    67292, 67293, 67294, 67295, 67296, 67297, 67298, 67299, 67300, 67301, 
+    67302, 67303, 67304, 67305, 67306, 67307, 67308, 67309, 67310, 67311, 
+    67312, 67313, 67314, 67315, 67316, 67317, 67318, 67319, 67320, 67321, 
+    67322, 67323, 67324, 67325, 67326, 67327, 67328, 67329, 67330, 67331, 
+    67332, 67333, 67334, 67335, 67336, 67337, 67338, 67339, 67340, 67341, 
+    67342, 67343, 67344, 67345, 67346, 67347, 67348, 67349, 67350, 67351, 
+    67352, 67353, 67354, 67355, 67356, 67357, 67358, 67359, 67360, 67361, 
+    67362, 67363, 67364, 67365, 67366, 67367, 67368, 67369, 67370, 67371, 
+    67372, 67373, 67374, 67375, 67376, 67377, 67378, 67379, 67380, 67381, 
+    67382, 67383, 67384, 67385, 67386, 67387, 67388, 67389, 67390, 67391, 
+    67392, 67393, 67394, 67395, 67396, 67397, 67398, 67399, 67400, 67401, 
+    67402, 67403, 67404, 67405, 67406, 67407, 67408, 67409, 67410, 67411, 
+    67412, 67413, 67414, 67415, 67416, 67417, 67418, 67419, 67420, 67421, 
+    67422, 67423, 67424, 67425, 67426, 67427, 67428, 67429, 67430, 67431, 
+    67432, 67433, 67434, 67435, 67436, 67437, 67438, 67439, 67440, 67441, 
+    67442, 67443, 67444, 67445, 67446, 67447, 67448, 67449, 67450, 67451, 
+    67452, 67453, 67454, 67455, 67456, 67457, 67458, 67459, 67460, 67461, 
+    67462, 67463, 67464, 67465, 67466, 67467, 67468, 67469, 67470, 67471, 
+    67472, 67473, 67474, 67475, 67476, 67477, 67478, 67479, 67480, 67481, 
+    67482, 67483, 67484, 67485, 67486, 67487, 67488, 67489, 67490, 67491, 
+    67492, 67493, 67494, 67495, 67496, 67497, 67498, 67499, 67500, 67501, 
+    67502, 67503, 67504, 67505, 67506, 67507, 67508, 67509, 67510, 67511, 
+    67512, 67513, 67514, 67515, 67516, 67517, 67518, 67519, 67520, 67521, 
+    67522, 67523, 67524, 67525, 67526, 67527, 67528, 67529, 67530, 67531, 
+    67532, 67533, 67534, 67535, 67536, 67537, 67538, 67539, 67540, 67541, 
+    67542, 67543, 67544, 67545, 67546, 67547, 67548, 67549, 67550, 67551, 
+    67552, 67553, 67554, 67555, 67556, 67557, 67558, 67559, 67560, 67561, 
+    67562, 67563, 67564, 67565, 67566, 67567, 67568, 67569, 67570, 67571, 
+    67572, 67573, 67574, 67575, 67576, 67577, 67578, 67579, 67580, 67581, 
+    67582, 67583, 67584, 67585, 67586, 67587, 67588, 67589, 67590, 67591, 
+    67592, 67593, 67594, 67595, 67596, 67597, 67598, 67599, 67600, 67601, 
+    67602, 67603, 67604, 67605, 67606, 67607, 67608, 67609, 67610, 67611, 
+    67612, 67613, 67614, 67615, 67616, 67617, 67618, 67619, 67620, 67621, 
+    67622, 67623, 67624, 67625, 67626, 67627, 67628, 67629, 67630, 67631, 
+    67632, 67633, 67634, 67635, 67636, 67637, 67638, 67639, 67640, 67641, 
+    67642, 67643, 67644, 67645, 67646, 67647, 67648, 67649, 67650, 67651, 
+    67652, 67653, 67654, 67655, 67656, 67657, 67658, 67659, 67660, 67661, 
+    67662, 67663, 67664, 67665, 67666, 67667, 67668, 67669, 67670, 67671, 
+    67672, 67673, 67674, 67675, 67676, 67677, 67678, 67679, 67680, 67681, 
+    67682, 67683, 67684, 67685, 67686, 67687, 67688, 67689, 67690, 67691, 
+    67692, 67693, 67694, 67695, 67696, 67697, 67698, 67699, 67700, 67701, 
+    67702, 67703, 67704, 67705, 67706, 67707, 67708, 67709, 67710, 67711, 
+    67712, 67713, 67714, 67715, 67716, 67717, 67718, 67719, 67720, 67721, 
+    67722, 67723, 67724, 67725, 67726, 67727, 67728, 67729, 67730, 67731, 
+    67732, 67733, 67734, 67735, 67736, 67737, 67738, 67739, 67740, 67741, 
+    67742, 67743, 67744, 67745, 67746, 67747, 67748, 67749, 67750, 67751, 
+    67752, 67753, 67754, 67755, 67756, 67757, 67758, 67759, 67760, 67761, 
+    67762, 67763, 67764, 67765, 67766, 67767, 67768, 67769, 67770, 67771, 
+    67772, 67773, 67774, 67775, 67776, 67777, 67778, 67779, 67780, 67781, 
+    67782, 67783, 67784, 67785, 67786, 67787, 67788, 67789, 67790, 67791, 
+    67792, 67793, 67794, 67795, 67796, 67797, 67798, 67799, 67800, 67801, 
+    67802, 67803, 67804, 67805, 67806, 67807, 67808, 67809, 67810, 67811, 
+    67812, 67813, 67814, 67815, 67816, 67817, 67818, 67819, 67820, 67821, 
+    67822, 67823, 67824, 67825, 67826, 67827, 67828, 67829, 67830, 67831, 
+    67832, 67833, 67834, 67835, 67836, 67837, 67838, 67839, 67840, 67841, 
+    67842, 67843, 67844, 67845, 67846, 67847, 67848, 67849, 67850, 67851, 
+    67852, 67853, 67854, 67855, 67856, 67857, 67858, 67859, 67860, 67861, 
+    67862, 67863, 67864, 67865, 67866, 67867, 67868, 67869, 67870, 67871, 
+    67872, 67873, 67874, 67875, 67876, 67877, 67878, 67879, 67880, 67881, 
+    67882, 67883, 67884, 67885, 67886, 67887, 67888, 67889, 67890, 67891, 
+    67892, 67893, 67894, 67895, 67896, 67897, 67898, 67899, 67900, 67901, 
+    67902, 67903, 67904, 67905, 67906, 67907, 67908, 67909, 67910, 67911, 
+    67912, 67913, 67914, 67915, 67916, 67917, 67918, 67919, 67920, 67921, 
+    67922, 67923, 67924, 67925, 67926, 67927, 67928, 67929, 67930, 67931, 
+    67932, 67933, 67934, 67935, 67936, 67937, 67938, 67939, 67940, 67941, 
+    67942, 67943, 67944, 67945, 67946, 67947, 67948, 67949, 67950, 67951, 
+    67952, 67953, 67954, 67955, 67956, 67957, 67958, 67959, 67960, 67961, 
+    67962, 67963, 67964, 67965, 67966, 67967, 67968, 67969, 67970, 67971, 
+    67972, 67973, 67974, 67975, 67976, 67977, 67978, 67979, 67980, 67981, 
+    67982, 67983, 67984, 67985, 67986, 67987, 67988, 67989, 67990, 67991, 
+    67992, 67993, 67994, 67995, 67996, 67997, 67998, 67999, 68000, 68001, 
+    68002, 68003, 68004, 68005, 68006, 68007, 68008, 68009, 68010, 68011, 
+    68012, 68013, 68014, 68015, 68016, 68017, 68018, 68019, 68020, 68021, 
+    68022, 68023, 68024, 68025, 68026, 68027, 68028, 68029, 68030, 68031, 
+    68032, 68033, 68034, 68035, 68036, 68037, 68038, 68039, 68040, 68041, 
+    68042, 68043, 68044, 68045, 68046, 68047, 68048, 68049, 68050, 68051, 
+    68052, 68053, 68054, 68055, 68056, 68057, 68058, 68059, 68060, 68061, 
+    68062, 68063, 68064, 68065, 68066, 68067, 68068, 68069, 68070, 68071, 
+    68072, 68073, 68074, 68075, 68076, 68077, 68078, 68079, 68080, 68081, 
+    68082, 68083, 68084, 68085, 68086, 68087, 68088, 68089, 68090, 68091, 
+    68092, 68093, 68094, 68095, 68096, 68097, 68098, 68099, 68100, 68101, 
+    68102, 68103, 68104, 68105, 68106, 68107, 68108, 68109, 68110, 68111, 
+    68112, 68113, 68114, 68115, 68116, 68117, 68118, 68119, 68120, 68121, 
+    68122, 68123, 68124, 68125, 68126, 68127, 68128, 68129, 68130, 68131, 
+    68132, 68133, 68134, 68135, 68136, 68137, 68138, 68139, 68140, 68141, 
+    68142, 68143, 68144, 68145, 68146, 68147, 68148, 68149, 68150, 68151, 
+    68152, 68153, 68154, 68155, 68156, 68157, 68158, 68159, 68160, 68161, 
+    68162, 68163, 68164, 68165, 68166, 68167, 68168, 68169, 68170, 68171, 
+    68172, 68173, 68174, 68175, 68176, 68177, 68178, 68179, 68180, 68181, 
+    68182, 68183, 68184, 68185, 68186, 68187, 68188, 68189, 68190, 68191, 
+    68192, 68193, 68194, 68195, 68196, 68197, 68198, 68199, 68200, 68201, 
+    68202, 68203, 68204, 68205, 68206, 68207, 68208, 68209, 68210, 68211, 
+    68212, 68213, 68214, 68215, 68216, 68217, 68218, 68219, 68220, 68221, 
+    68222, 68223, 68224, 68225, 68226, 68227, 68228, 68229, 68230, 68231, 
+    68232, 68233, 68234, 68235, 68236, 68237, 68238, 68239, 68240, 68241, 
+    68242, 68243, 68244, 68245, 68246, 68247, 68248, 68249, 68250, 68251, 
+    68252, 68253, 68254, 68255, 68256, 68257, 68258, 68259, 68260, 68261, 
+    68262, 68263, 68264, 68265, 68266, 68267, 68268, 68269, 68270, 68271, 
+    68272, 68273, 68274, 68275, 68276, 68277, 68278, 68279, 68280, 68281, 
+    68282, 68283, 68284, 68285, 68286, 68287, 68288, 68289, 68290, 68291, 
+    68292, 68293, 68294, 68295, 68296, 68297, 68298, 68299, 68300, 68301, 
+    68302, 68303, 68304, 68305, 68306, 68307, 68308, 68309, 68310, 68311, 
+    68312, 68313, 68314, 68315, 68316, 68317, 68318, 68319, 68320, 68321, 
+    68322, 68323, 68324, 68325, 68326, 68327, 68328, 68329, 68330, 68331, 
+    68332, 68333, 68334, 68335, 68336, 68337, 68338, 68339, 68340, 68341, 
+    68342, 68343, 68344, 68345, 68346, 68347, 68348, 68349, 68350, 68351, 
+    68352, 68353, 68354, 68355, 68356, 68357, 68358, 68359, 68360, 68361, 
+    68362, 68363, 68364, 68365, 68366, 68367, 68368, 68369, 68370, 68371, 
+    68372, 68373, 68374, 68375, 68376, 68377, 68378, 68379, 68380, 68381, 
+    68382, 68383, 68384, 68385, 68386, 68387, 68388, 68389, 68390, 68391, 
+    68392, 68393, 68394, 68395, 68396, 68397, 68398, 68399, 68400, 68401, 
+    68402, 68403, 68404, 68405, 68406, 68407, 68408, 68409, 68410, 68411, 
+    68412, 68413, 68414, 68415, 68416, 68417, 68418, 68419, 68420, 68421, 
+    68422, 68423, 68424, 68425, 68426, 68427, 68428, 68429, 68430, 68431, 
+    68432, 68433, 68434, 68435, 68436, 68437, 68438, 68439, 68440, 68441, 
+    68442, 68443, 68444, 68445, 68446, 68447, 68448, 68449, 68450, 68451, 
+    68452, 68453, 68454, 68455, 68456, 68457, 68458, 68459, 68460, 68461, 
+    68462, 68463, 68464, 68465, 68466, 68467, 68468, 68469, 68470, 68471, 
+    68472, 68473, 68474, 68475, 68476, 68477, 68478, 68479, 68480, 68481, 
+    68482, 68483, 68484, 68485, 68486, 68487, 68488, 68489, 68490, 68491, 
+    68492, 68493, 68494, 68495, 68496, 68497, 68498, 68499, 68500, 68501, 
+    68502, 68503, 68504, 68505, 68506, 68507, 68508, 68509, 68510, 68511, 
+    68512, 68513, 68514, 68515, 68516, 68517, 68518, 68519, 68520, 68521, 
+    68522, 68523, 68524, 68525, 68526, 68527, 68528, 68529, 68530, 68531, 
+    68532, 68533, 68534, 68535, 68536, 68537, 68538, 68539, 68540, 68541, 
+    68542, 68543, 68544, 68545, 68546, 68547, 68548, 68549, 68550, 68551, 
+    68552, 68553, 68554, 68555, 68556, 68557, 68558, 68559, 68560, 68561, 
+    68562, 68563, 68564, 68565, 68566, 68567, 68568, 68569, 68570, 68571, 
+    68572, 68573, 68574, 68575, 68576, 68577, 68578, 68579, 68580, 68581, 
+    68582, 68583, 68584, 68585, 68586, 68587, 68588, 68589, 68590, 68591, 
+    68592, 68593, 68594, 68595, 68596, 68597, 68598, 68599, 68600, 68601, 
+    68602, 68603, 68604, 68605, 68606, 68607, 68608, 68609, 68610, 68611, 
+    68612, 68613, 68614, 68615, 68616, 68617, 68618, 68619, 68620, 68621, 
+    68622, 68623, 68624, 68625, 68626, 68627, 68628, 68629, 68630, 68631, 
+    68632, 68633, 68634, 68635, 68636, 68637, 68638, 68639, 68640, 68641, 
+    68642, 68643, 68644, 68645, 68646, 68647, 68648, 68649, 68650, 68651, 
+    68652, 68653, 68654, 68655, 68656, 68657, 68658, 68659, 68660, 68661, 
+    68662, 68663, 68664, 68665, 68666, 68667, 68668, 68669, 68670, 68671, 
+    68672, 68673, 68674, 68675, 68676, 68677, 68678, 68679, 68680, 68681, 
+    68682, 68683, 68684, 68685, 68686, 68687, 68688, 68689, 68690, 68691, 
+    68692, 68693, 68694, 68695, 68696, 68697, 68698, 68699, 68700, 68701, 
+    68702, 68703, 68704, 68705, 68706, 68707, 68708, 68709, 68710, 68711, 
+    68712, 68713, 68714, 68715, 68716, 68717, 68718, 68719, 68720, 68721, 
+    68722, 68723, 68724, 68725, 68726, 68727, 68728, 68729, 68730, 68731, 
+    68732, 68733, 68734, 68735, 68736, 68737, 68738, 68739, 68740, 68741, 
+    68742, 68743, 68744, 68745, 68746, 68747, 68748, 68749, 68750, 68751, 
+    68752, 68753, 68754, 68755, 68756, 68757, 68758, 68759, 68760, 68761, 
+    68762, 68763, 68764, 68765, 68766, 68767, 68768, 68769, 68770, 68771, 
+    68772, 68773, 68774, 68775, 68776, 68777, 68778, 68779, 68780, 68781, 
+    68782, 68783, 68784, 68785, 68786, 68787, 68788, 68789, 68790, 68791, 
+    68792, 68793, 68794, 68795, 68796, 68797, 68798, 68799, 68800, 68801, 
+    68802, 68803, 68804, 68805, 68806, 68807, 68808, 68809, 68810, 68811, 
+    68812, 68813, 68814, 68815, 68816, 68817, 68818, 68819, 68820, 68821, 
+    68822, 68823, 68824, 68825, 68826, 68827, 68828, 68829, 68830, 68831, 
+    68832, 68833, 68834, 68835, 68836, 68837, 68838, 68839, 68840, 68841, 
+    68842, 68843, 68844, 68845, 68846, 68847, 68848, 68849, 68850, 68851, 
+    68852, 68853, 68854, 68855, 68856, 68857, 68858, 68859, 68860, 68861, 
+    68862, 68863, 68864, 68865, 68866, 68867, 68868, 68869, 68870, 68871, 
+    68872, 68873, 68874, 68875, 68876, 68877, 68878, 68879, 68880, 68881, 
+    68882, 68883, 68884, 68885, 68886, 68887, 68888, 68889, 68890, 68891, 
+    68892, 68893, 68894, 68895, 68896, 68897, 68898, 68899, 68900, 68901, 
+    68902, 68903, 68904, 68905, 68906, 68907, 68908, 68909, 68910, 68911, 
+    68912, 68913, 68914, 68915, 68916, 68917, 68918, 68919, 68920, 68921, 
+    68922, 68923, 68924, 68925, 68926, 68927, 68928, 68929, 68930, 68931, 
+    68932, 68933, 68934, 68935, 68936, 68937, 68938, 68939, 68940, 68941, 
+    68942, 68943, 68944, 68945, 68946, 68947, 68948, 68949, 68950, 68951, 
+    68952, 68953, 68954, 68955, 68956, 68957, 68958, 68959, 68960, 68961, 
+    68962, 68963, 68964, 68965, 68966, 68967, 68968, 68969, 68970, 68971, 
+    68972, 68973, 68974, 68975, 68976, 68977, 68978, 68979, 68980, 68981, 
+    68982, 68983, 68984, 68985, 68986, 68987, 68988, 68989, 68990, 68991, 
+    68992, 68993, 68994, 68995, 68996, 68997, 68998, 68999, 69000, 69001, 
+    69002, 69003, 69004, 69005, 69006, 69007, 69008, 69009, 69010, 69011, 
+    69012, 69013, 69014, 69015, 69016, 69017, 69018, 69019, 69020, 69021, 
+    69022, 69023, 69024, 69025, 69026, 69027, 69028, 69029, 69030, 69031, 
+    69032, 69033, 69034, 69035, 69036, 69037, 69038, 69039, 69040, 69041, 
+    69042, 69043, 69044, 69045, 69046, 69047, 69048, 69049, 69050, 69051, 
+    69052, 69053, 69054, 69055, 69056, 69057, 69058, 69059, 69060, 69061, 
+    69062, 69063, 69064, 69065, 69066, 69067, 69068, 69069, 69070, 69071, 
+    69072, 69073, 69074, 69075, 69076, 69077, 69078, 69079, 69080, 69081, 
+    69082, 69083, 69084, 69085, 69086, 69087, 69088, 69089, 69090, 69091, 
+    69092, 69093, 69094, 69095, 69096, 69097, 69098, 69099, 69100, 69101, 
+    69102, 69103, 69104, 69105, 69106, 69107, 69108, 69109, 69110, 69111, 
+    69112, 69113, 69114, 69115, 69116, 69117, 69118, 69119, 69120, 69121, 
+    69122, 69123, 69124, 69125, 69126, 69127, 69128, 69129, 69130, 69131, 
+    69132, 69133, 69134, 69135, 69136, 69137, 69138, 69139, 69140, 69141, 
+    69142, 69143, 69144, 69145, 69146, 69147, 69148, 69149, 69150, 69151, 
+    69152, 69153, 69154, 69155, 69156, 69157, 69158, 69159, 69160, 69161, 
+    69162, 69163, 69164, 69165, 69166, 69167, 69168, 69169, 69170, 69171, 
+    69172, 69173, 69174, 69175, 69176, 69177, 69178, 69179, 69180, 69181, 
+    69182, 69183, 69184, 69185, 69186, 69187, 69188, 69189, 69190, 69191, 
+    69192, 69193, 69194, 69195, 69196, 69197, 69198, 69199, 69200, 69201, 
+    69202, 69203, 69204, 69205, 69206, 69207, 69208, 69209, 69210, 69211, 
+    69212, 69213, 69214, 69215, 69216, 69217, 69218, 69219, 69220, 69221, 
+    69222, 69223, 69224, 69225, 69226, 69227, 69228, 69229, 69230, 69231, 
+    69232, 69233, 69234, 69235, 69236, 69237, 69238, 69239, 69240, 69241, 
+    69242, 69243, 69244, 69245, 69246, 69247, 69248, 69249, 69250, 69251, 
+    69252, 69253, 69254, 69255, 69256, 69257, 69258, 69259, 69260, 69261, 
+    69262, 69263, 69264, 69265, 69266, 69267, 69268, 69269, 69270, 69271, 
+    69272, 69273, 69274, 69275, 69276, 69277, 69278, 69279, 69280, 69281, 
+    69282, 69283, 69284, 69285, 69286, 69287, 69288, 69289, 69290, 69291, 
+    69292, 69293, 69294, 69295, 69296, 69297, 69298, 69299, 69300, 69301, 
+    69302, 69303, 69304, 69305, 69306, 69307, 69308, 69309, 69310, 69311, 
+    69312, 69313, 69314, 69315, 69316, 69317, 69318, 69319, 69320, 69321, 
+    69322, 69323, 69324, 69325, 69326, 69327, 69328, 69329, 69330, 69331, 
+    69332, 69333, 69334, 69335, 69336, 69337, 69338, 69339, 69340, 69341, 
+    69342, 69343, 69344, 69345, 69346, 69347, 69348, 69349, 69350, 69351, 
+    69352, 69353, 69354, 69355, 69356, 69357, 69358, 69359, 69360, 69361, 
+    69362, 69363, 69364, 69365, 69366, 69367, 69368, 69369, 69370, 69371, 
+    69372, 69373, 69374, 69375, 69376, 69377, 69378, 69379, 69380, 69381, 
+    69382, 69383, 69384, 69385, 69386, 69387, 69388, 69389, 69390, 69391, 
+    69392, 69393, 69394, 69395, 69396, 69397, 69398, 69399, 69400, 69401, 
+    69402, 69403, 69404, 69405, 69406, 69407, 69408, 69409, 69410, 69411, 
+    69412, 69413, 69414, 69415, 69416, 69417, 69418, 69419, 69420, 69421, 
+    69422, 69423, 69424, 69425, 69426, 69427, 69428, 69429, 69430, 69431, 
+    69432, 69433, 69434, 69435, 69436, 69437, 69438, 69439, 69440, 69441, 
+    69442, 69443, 69444, 69445, 69446, 69447, 69448, 69449, 69450, 69451, 
+    69452, 69453, 69454, 69455, 69456, 69457, 69458, 69459, 69460, 69461, 
+    69462, 69463, 69464, 69465, 69466, 69467, 69468, 69469, 69470, 69471, 
+    69472, 69473, 69474, 69475, 69476, 69477, 69478, 69479, 69480, 69481, 
+    69482, 69483, 69484, 69485, 69486, 69487, 69488, 69489, 69490, 69491, 
+    69492, 69493, 69494, 69495, 69496, 69497, 69498, 69499, 69500, 69501, 
+    69502, 69503, 69504, 69505, 69506, 69507, 69508, 69509, 69510, 69511, 
+    69512, 69513, 69514, 69515, 69516, 69517, 69518, 69519, 69520, 69521, 
+    69522, 69523, 69524, 69525, 69526, 69527, 69528, 69529, 69530, 69531, 
+    69532, 69533, 69534, 69535, 69536, 69537, 69538, 69539, 69540, 69541, 
+    69542, 69543, 69544, 69545, 69546, 69547, 69548, 69549, 69550, 69551, 
+    69552, 69553, 69554, 69555, 69556, 69557, 69558, 69559, 69560, 69561, 
+    69562, 69563, 69564, 69565, 69566, 69567, 69568, 69569, 69570, 69571, 
+    69572, 69573, 69574, 69575, 69576, 69577, 69578, 69579, 69580, 69581, 
+    69582, 69583, 69584, 69585, 69586, 69587, 69588, 69589, 69590, 69591, 
+    69592, 69593, 69594, 69595, 69596, 69597, 69598, 69599, 69600, 69601, 
+    69602, 69603, 69604, 69605, 69606, 69607, 69608, 69609, 69610, 69611, 
+    69612, 69613, 69614, 69615, 69616, 69617, 69618, 69619, 69620, 69621, 
+    69622, 69623, 69624, 69625, 69626, 69627, 69628, 69629, 69630, 69631, 
+    69632, 69633, 69634, 69635, 69636, 69637, 69638, 69639, 69640, 69641, 
+    69642, 69643, 69644, 69645, 69646, 69647, 69648, 69649, 69650, 69651, 
+    69652, 69653, 69654, 69655, 69656, 69657, 69658, 69659, 69660, 69661, 
+    69662, 69663, 69664, 69665, 69666, 69667, 69668, 69669, 69670, 69671, 
+    69672, 69673, 69674, 69675, 69676, 69677, 69678, 69679, 69680, 69681, 
+    69682, 69683, 69684, 69685, 69686, 69687, 69688, 69689, 69690, 69691, 
+    69692, 69693, 69694, 69695, 69696, 69697, 69698, 69699, 69700, 69701, 
+    69702, 69703, 69704, 69705, 69706, 69707, 69708, 69709, 69710, 69711, 
+    69712, 69713, 69714, 69715, 69716, 69717, 69718, 69719, 69720, 69721, 
+    69722, 69723, 69724, 69725, 69726, 69727, 69728, 69729, 69730, 69731, 
+    69732, 69733, 69734, 69735, 69736, 69737, 69738, 69739, 69740, 69741, 
+    69742, 69743, 69744, 69745, 69746, 69747, 69748, 69749, 69750, 69751, 
+    69752, 69753, 69754, 69755, 69756, 69757, 69758, 69759, 69760, 69761, 
+    69762, 69763, 69764, 69765, 69766, 69767, 69768, 69769, 69770, 69771, 
+    69772, 69773, 69774, 69775, 69776, 69777, 69778, 69779, 69780, 69781, 
+    69782, 69783, 69784, 69785, 69786, 69787, 69788, 69789, 69790, 69791, 
+    69792, 69793, 69794, 69795, 69796, 69797, 69798, 69799, 69800, 69801, 
+    69802, 69803, 69804, 69805, 69806, 69807, 69808, 69809, 69810, 69811, 
+    69812, 69813, 69814, 69815, 69816, 69817, 69818, 69819, 69820, 69821, 
+    69822, 69823, 69824, 69825, 69826, 69827, 69828, 69829, 69830, 69831, 
+    69832, 69833, 69834, 69835, 69836, 69837, 69838, 69839, 69840, 69841, 
+    69842, 69843, 69844, 69845, 69846, 69847, 69848, 69849, 69850, 69851, 
+    69852, 69853, 69854, 69855, 69856, 69857, 69858, 69859, 69860, 69861, 
+    69862, 69863, 69864, 69865, 69866, 69867, 69868, 69869, 69870, 69871, 
+    69872, 69873, 69874, 69875, 69876, 69877, 69878, 69879, 69880, 69881, 
+    69882, 69883, 69884, 69885, 69886, 69887, 69888, 69889, 69890, 69891, 
+    69892, 69893, 69894, 69895, 69896, 69897, 69898, 69899, 69900, 69901, 
+    69902, 69903, 69904, 69905, 69906, 69907, 69908, 69909, 69910, 69911, 
+    69912, 69913, 69914, 69915, 69916, 69917, 69918, 69919, 69920, 69921, 
+    69922, 69923, 69924, 69925, 69926, 69927, 69928, 69929, 69930, 69931, 
+    69932, 69933, 69934, 69935, 69936, 69937, 69938, 69939, 69940, 69941, 
+    69942, 69943, 69944, 69945, 69946, 69947, 69948, 69949, 69950, 69951, 
+    69952, 69953, 69954, 69955, 69956, 69957, 69958, 69959, 69960, 69961, 
+    69962, 69963, 69964, 69965, 69966, 69967, 69968, 69969, 69970, 69971, 
+    69972, 69973, 69974, 69975, 69976, 69977, 69978, 69979, 69980, 69981, 
+    69982, 69983, 69984, 69985, 69986, 69987, 69988, 69989, 69990, 69991, 
+    69992, 69993, 69994, 69995, 69996, 69997, 69998, 69999, 70000, 70001, 
+    70002, 70003, 70004, 70005, 70006, 70007, 70008, 70009, 70010, 70011, 
+    70012, 70013, 70014, 70015, 70016, 70017, 70018, 70019, 70020, 70021, 
+    70022, 70023, 70024, 70025, 70026, 70027, 70028, 70029, 70030, 70031, 
+    70032, 70033, 70034, 70035, 70036, 70037, 70038, 70039, 70040, 70041, 
+    70042, 70043, 70044, 70045, 70046, 70047, 70048, 70049, 70050, 70051, 
+    70052, 70053, 70054, 70055, 70056, 70057, 70058, 70059, 70060, 70061, 
+    70062, 70063, 70064, 70065, 70066, 70067, 70068, 70069, 70070, 70071, 
+    70072, 70073, 70074, 70075, 70076, 70077, 70078, 70079, 70080, 70081, 
+    70082, 70083, 70084, 70085, 70086, 70087, 70088, 70089, 70090, 70091, 
+    70092, 70093, 70094, 70095, 70096, 70097, 70098, 70099, 70100, 70101, 
+    70102, 70103, 70104, 70105, 70106, 70107, 70108, 70109, 70110, 70111, 
+    70112, 70113, 70114, 70115, 70116, 70117, 70118, 70119, 70120, 70121, 
+    70122, 70123, 70124, 70125, 70126, 70127, 70128, 70129, 70130, 70131, 
+    70132, 70133, 70134, 70135, 70136, 70137, 70138, 70139, 70140, 70141, 
+    70142, 70143, 70144, 70145, 70146, 70147, 70148, 70149, 70150, 70151, 
+    70152, 70153, 70154, 70155, 70156, 70157, 70158, 70159, 70160, 70161, 
+    70162, 70163, 70164, 70165, 70166, 70167, 70168, 70169, 70170, 70171, 
+    70172, 70173, 70174, 70175, 70176, 70177, 70178, 70179, 70180, 70181, 
+    70182, 70183, 70184, 70185, 70186, 70187, 70188, 70189, 70190, 70191, 
+    70192, 70193, 70194, 70195, 70196, 70197, 70198, 70199, 70200, 70201, 
+    70202, 70203, 70204, 70205, 70206, 70207, 70208, 70209, 70210, 70211, 
+    70212, 70213, 70214, 70215, 70216, 70217, 70218, 70219, 70220, 70221, 
+    70222, 70223, 70224, 70225, 70226, 70227, 70228, 70229, 70230, 70231, 
+    70232, 70233, 70234, 70235, 70236, 70237, 70238, 70239, 70240, 70241, 
+    70242, 70243, 70244, 70245, 70246, 70247, 70248, 70249, 70250, 70251, 
+    70252, 70253, 70254, 70255, 70256, 70257, 70258, 70259, 70260, 70261, 
+    70262, 70263, 70264, 70265, 70266, 70267, 70268, 70269, 70270, 70271, 
+    70272, 70273, 70274, 70275, 70276, 70277, 70278, 70279, 70280, 70281, 
+    70282, 70283, 70284, 70285, 70286, 70287, 70288, 70289, 70290, 70291, 
+    70292, 70293, 70294, 70295, 70296, 70297, 70298, 70299, 70300, 70301, 
+    70302, 70303, 70304, 70305, 70306, 70307, 70308, 70309, 70310, 70311, 
+    70312, 70313, 70314, 70315, 70316, 70317, 70318, 70319, 70320, 70321, 
+    70322, 70323, 70324, 70325, 70326, 70327, 70328, 70329, 70330, 70331, 
+    70332, 70333, 70334, 70335, 70336, 70337, 70338, 70339, 70340, 70341, 
+    70342, 70343, 70344, 70345, 70346, 70347, 70348, 70349, 70350, 70351, 
+    70352, 70353, 70354, 70355, 70356, 70357, 70358, 70359, 70360, 70361, 
+    70362, 70363, 70364, 70365, 70366, 70367, 70368, 70369, 70370, 70371, 
+    70372, 70373, 70374, 70375, 70376, 70377, 70378, 70379, 70380, 70381, 
+    70382, 70383, 70384, 70385, 70386, 70387, 70388, 70389, 70390, 70391, 
+    70392, 70393, 70394, 70395, 70396, 70397, 70398, 70399, 70400, 70401, 
+    70402, 70403, 70404, 70405, 70406, 70407, 70408, 70409, 70410, 70411, 
+    70412, 70413, 70414, 70415, 70416, 70417, 70418, 70419, 70420, 70421, 
+    70422, 70423, 70424, 70425, 70426, 70427, 70428, 70429, 70430, 70431, 
+    70432, 70433, 70434, 70435, 70436, 70437, 70438, 70439, 70440, 70441, 
+    70442, 70443, 70444, 70445, 70446, 70447, 70448, 70449, 70450, 70451, 
+    70452, 70453, 70454, 70455, 70456, 70457, 70458, 70459, 70460, 70461, 
+    70462, 70463, 70464, 70465, 70466, 70467, 70468, 70469, 70470, 70471, 
+    70472, 70473, 70474, 70475, 70476, 70477, 70478, 70479, 70480, 70481, 
+    70482, 70483, 70484, 70485, 70486, 70487, 70488, 70489, 70490, 70491, 
+    70492, 70493, 70494, 70495, 70496, 70497, 70498, 70499, 70500, 70501, 
+    70502, 70503, 70504, 70505, 70506, 70507, 70508, 70509, 70510, 70511, 
+    70512, 70513, 70514, 70515, 70516, 70517, 70518, 70519, 70520, 70521, 
+    70522, 70523, 70524, 70525, 70526, 70527, 70528, 70529, 70530, 70531, 
+    70532, 70533, 70534, 70535, 70536, 70537, 70538, 70539, 70540, 70541, 
+    70542, 70543, 70544, 70545, 70546, 70547, 70548, 70549, 70550, 70551, 
+    70552, 70553, 70554, 70555, 70556, 70557, 70558, 70559, 70560, 70561, 
+    70562, 70563, 70564, 70565, 70566, 70567, 70568, 70569, 70570, 70571, 
+    70572, 70573, 70574, 70575, 70576, 70577, 70578, 70579, 70580, 70581, 
+    70582, 70583, 70584, 70585, 70586, 70587, 70588, 70589, 70590, 70591, 
+    70592, 70593, 70594, 70595, 70596, 70597, 70598, 70599, 70600, 70601, 
+    70602, 70603, 70604, 70605, 70606, 70607, 70608, 70609, 70610, 70611, 
+    70612, 70613, 70614, 70615, 70616, 70617, 70618, 70619, 70620, 70621, 
+    70622, 70623, 70624, 70625, 70626, 70627, 70628, 70629, 70630, 70631, 
+    70632, 70633, 70634, 70635, 70636, 70637, 70638, 70639, 70640, 70641, 
+    70642, 70643, 70644, 70645, 70646, 70647, 70648, 70649, 70650, 70651, 
+    70652, 70653, 70654, 70655, 70656, 70657, 70658, 70659, 70660, 70661, 
+    70662, 70663, 70664, 70665, 70666, 70667, 70668, 70669, 70670, 70671, 
+    70672, 70673, 70674, 70675, 70676, 70677, 70678, 70679, 70680, 70681, 
+    70682, 70683, 70684, 70685, 70686, 70687, 70688, 70689, 70690, 70691, 
+    70692, 70693, 70694, 70695, 70696, 70697, 70698, 70699, 70700, 70701, 
+    70702, 70703, 70704, 70705, 70706, 70707, 70708, 70709, 70710, 70711, 
+    70712, 70713, 70714, 70715, 70716, 70717, 70718, 70719, 70720, 70721, 
+    70722, 70723, 70724, 70725, 70726, 70727, 70728, 70729, 70730, 70731, 
+    70732, 70733, 70734, 70735, 70736, 70737, 70738, 70739, 70740, 70741, 
+    70742, 70743, 70744, 70745, 70746, 70747, 70748, 70749, 70750, 70751, 
+    70752, 70753, 70754, 70755, 70756, 70757, 70758, 70759, 70760, 70761, 
+    70762, 70763, 70764, 70765, 70766, 70767, 70768, 70769, 70770, 70771, 
+    70772, 70773, 70774, 70775, 70776, 70777, 70778, 70779, 70780, 70781, 
+    70782, 70783, 70784, 70785, 70786, 70787, 70788, 70789, 70790, 70791, 
+    70792, 70793, 70794, 70795, 70796, 70797, 70798, 70799, 70800, 70801, 
+    70802, 70803, 70804, 70805, 70806, 70807, 70808, 70809, 70810, 70811, 
+    70812, 70813, 70814, 70815, 70816, 70817, 70818, 70819, 70820, 70821, 
+    70822, 70823, 70824, 70825, 70826, 70827, 70828, 70829, 70830, 70831, 
+    70832, 70833, 70834, 70835, 70836, 70837, 70838, 70839, 70840, 70841, 
+    70842, 70843, 70844, 70845, 70846, 70847, 70848, 70849, 70850, 70851, 
+    70852, 70853, 70854, 70855, 70856, 70857, 70858, 70859, 70860, 70861, 
+    70862, 70863, 70864, 70865, 70866, 70867, 70868, 70869, 70870, 70871, 
+    70872, 70873, 70874, 70875, 70876, 70877, 70878, 70879, 70880, 70881, 
+    70882, 70883, 70884, 70885, 70886, 70887, 70888, 70889, 70890, 70891, 
+    70892, 70893, 70894, 70895, 70896, 70897, 70898, 70899, 70900, 70901, 
+    70902, 70903, 70904, 70905, 70906, 70907, 70908, 70909, 70910, 70911, 
+    70912, 70913, 70914, 70915, 70916, 70917, 70918, 70919, 70920, 70921, 
+    70922, 70923, 70924, 70925, 70926, 70927, 70928, 70929, 70930, 70931, 
+    70932, 70933, 70934, 70935, 70936, 70937, 70938, 70939, 70940, 70941, 
+    70942, 70943, 70944, 70945, 70946, 70947, 70948, 70949, 70950, 70951, 
+    70952, 70953, 70954, 70955, 70956, 70957, 70958, 70959, 70960, 70961, 
+    70962, 70963, 70964, 70965, 70966, 70967, 70968, 70969, 70970, 70971, 
+    70972, 70973, 70974, 70975, 70976, 70977, 70978, 70979, 70980, 70981, 
+    70982, 70983, 70984, 70985, 70986, 70987, 70988, 70989, 70990, 70991, 
+    70992, 70993, 70994, 70995, 70996, 70997, 70998, 70999, 71000, 71001, 
+    71002, 71003, 71004, 71005, 71006, 71007, 71008, 71009, 71010, 71011, 
+    71012, 71013, 71014, 71015, 71016, 71017, 71018, 71019, 71020, 71021, 
+    71022, 71023, 71024, 71025, 71026, 71027, 71028, 71029, 71030, 71031, 
+    71032, 71033, 71034, 71035, 71036, 71037, 71038, 71039, 71040, 71041, 
+    71042, 71043, 71044, 71045, 71046, 71047, 71048, 71049, 71050, 71051, 
+    71052, 71053, 71054, 71055, 71056, 71057, 71058, 71059, 71060, 71061, 
+    71062, 71063, 71064, 71065, 71066, 71067, 71068, 71069, 71070, 71071, 
+    71072, 71073, 71074, 71075, 71076, 71077, 71078, 71079, 71080, 71081, 
+    71082, 71083, 71084, 71085, 71086, 71087, 71088, 71089, 71090, 71091, 
+    71092, 71093, 71094, 71095, 71096, 71097, 71098, 71099, 71100, 71101, 
+    71102, 71103, 71104, 71105, 71106, 71107, 71108, 71109, 71110, 71111, 
+    71112, 71113, 71114, 71115, 71116, 71117, 71118, 71119, 71120, 71121, 
+    71122, 71123, 71124, 71125, 71126, 71127, 71128, 71129, 71130, 71131, 
+    71132, 71133, 71134, 71135, 71136, 71137, 71138, 71139, 71140, 71141, 
+    71142, 71143, 71144, 71145, 71146, 71147, 71148, 71149, 71150, 71151, 
+    71152, 71153, 71154, 71155, 71156, 71157, 71158, 71159, 71160, 71161, 
+    71162, 71163, 71164, 71165, 71166, 71167, 71168, 71169, 71170, 71171, 
+    71172, 71173, 71174, 71175, 71176, 71177, 71178, 71179, 71180, 71181, 
+    71182, 71183, 71184, 71185, 71186, 71187, 71188, 71189, 71190, 71191, 
+    71192, 71193, 71194, 71195, 71196, 71197, 71198, 71199, 71200, 71201, 
+    71202, 71203, 71204, 71205, 71206, 71207, 71208, 71209, 71210, 71211, 
+    71212, 71213, 71214, 71215, 71216, 71217, 71218, 71219, 71220, 71221, 
+    71222, 71223, 71224, 71225, 71226, 71227, 71228, 71229, 71230, 71231, 
+    71232, 71233, 71234, 71235, 71236, 71237, 71238, 71239, 71240, 71241, 
+    71242, 71243, 71244, 71245, 71246, 71247, 71248, 71249, 71250, 71251, 
+    71252, 71253, 71254, 71255, 71256, 71257, 71258, 71259, 71260, 71261, 
+    71262, 71263, 71264, 71265, 71266, 71267, 71268, 71269, 71270, 71271, 
+    71272, 71273, 71274, 71275, 71276, 71277, 71278, 71279, 71280, 71281, 
+    71282, 71283, 71284, 71285, 71286, 71287, 71288, 71289, 71290, 71291, 
+    71292, 71293, 71294, 71295, 71296, 71297, 71298, 71299, 71300, 71301, 
+    71302, 71303, 71304, 71305, 71306, 71307, 71308, 71309, 71310, 71311, 
+    71312, 71313, 71314, 71315, 71316, 71317, 71318, 71319, 71320, 71321, 
+    71322, 71323, 71324, 71325, 71326, 71327, 71328, 71329, 71330, 71331, 
+    71332, 71333, 71334, 71335, 71336, 71337, 71338, 71339, 71340, 71341, 
+    71342, 71343, 71344, 71345, 71346, 71347, 71348, 71349, 71350, 71351, 
+    71352, 71353, 71354, 71355, 71356, 71357, 71358, 71359, 71360, 71361, 
+    71362, 71363, 71364, 71365, 71366, 71367, 71368, 71369, 71370, 71371, 
+    71372, 71373, 71374, 71375, 71376, 71377, 71378, 71379, 71380, 71381, 
+    71382, 71383, 71384, 71385, 71386, 71387, 71388, 71389, 71390, 71391, 
+    71392, 71393, 71394, 71395, 71396, 71397, 71398, 71399, 71400, 71401, 
+    71402, 71403, 71404, 71405, 71406, 71407, 71408, 71409, 71410, 71411, 
+    71412, 71413, 71414, 71415, 71416, 71417, 71418, 71419, 71420, 71421, 
+    71422, 71423, 71424, 71425, 71426, 71427, 71428, 71429, 71430, 71431, 
+    71432, 71433, 71434, 71435, 71436, 71437, 71438, 71439, 71440, 71441, 
+    71442, 71443, 71444, 71445, 71446, 71447, 71448, 71449, 71450, 71451, 
+    71452, 71453, 71454, 71455, 71456, 71457, 71458, 71459, 71460, 71461, 
+    71462, 71463, 71464, 71465, 71466, 71467, 71468, 71469, 71470, 71471, 
+    71472, 71473, 71474, 71475, 71476, 71477, 71478, 71479, 71480, 71481, 
+    71482, 71483, 71484, 71485, 71486, 71487, 71488, 71489, 71490, 71491, 
+    71492, 71493, 71494, 71495, 71496, 71497, 71498, 71499, 71500, 71501, 
+    71502, 71503, 71504, 71505, 71506, 71507, 71508, 71509, 71510, 71511, 
+    71512, 71513, 71514, 71515, 71516, 71517, 71518, 71519, 71520, 71521, 
+    71522, 71523, 71524, 71525, 71526, 71527, 71528, 71529, 71530, 71531, 
+    71532, 71533, 71534, 71535, 71536, 71537, 71538, 71539, 71540, 71541, 
+    71542, 71543, 71544, 71545, 71546, 71547, 71548, 71549, 71550, 71551, 
+    71552, 71553, 71554, 71555, 71556, 71557, 71558, 71559, 71560, 71561, 
+    71562, 71563, 71564, 71565, 71566, 71567, 71568, 71569, 71570, 71571, 
+    71572, 71573, 71574, 71575, 71576, 71577, 71578, 71579, 71580, 71581, 
+    71582, 71583, 71584, 71585, 71586, 71587, 71588, 71589, 71590, 71591, 
+    71592, 71593, 71594, 71595, 71596, 71597, 71598, 71599, 71600, 71601, 
+    71602, 71603, 71604, 71605, 71606, 71607, 71608, 71609, 71610, 71611, 
+    71612, 71613, 71614, 71615, 71616, 71617, 71618, 71619, 71620, 71621, 
+    71622, 71623, 71624, 71625, 71626, 71627, 71628, 71629, 71630, 71631, 
+    71632, 71633, 71634, 71635, 71636, 71637, 71638, 71639, 71640, 71641, 
+    71642, 71643, 71644, 71645, 71646, 71647, 71648, 71649, 71650, 71651, 
+    71652, 71653, 71654, 71655, 71656, 71657, 71658, 71659, 71660, 71661, 
+    71662, 71663, 71664, 71665, 71666, 71667, 71668, 71669, 71670, 71671, 
+    71672, 71673, 71674, 71675, 71676, 71677, 71678, 71679, 71680, 71681, 
+    71682, 71683, 71684, 71685, 71686, 71687, 71688, 71689, 71690, 71691, 
+    71692, 71693, 71694, 71695, 71696, 71697, 71698, 71699, 71700, 71701, 
+    71702, 71703, 71704, 71705, 71706, 71707, 71708, 71709, 71710, 71711, 
+    71712, 71713, 71714, 71715, 71716, 71717, 71718, 71719, 71720, 71721, 
+    71722, 71723, 71724, 71725, 71726, 71727, 71728, 71729, 71730, 71731, 
+    71732, 71733, 71734, 71735, 71736, 71737, 71738, 71739, 71740, 71741, 
+    71742, 71743, 71744, 71745, 71746, 71747, 71748, 71749, 71750, 71751, 
+    71752, 71753, 71754, 71755, 71756, 71757, 71758, 71759, 71760, 71761, 
+    71762, 71763, 71764, 71765, 71766, 71767, 71768, 71769, 71770, 71771, 
+    71772, 71773, 71774, 71775, 71776, 71777, 71778, 71779, 71780, 71781, 
+    71782, 71783, 71784, 71785, 71786, 71787, 71788, 71789, 71790, 71791, 
+    71792, 71793, 71794, 71795, 71796, 71797, 71798, 71799, 71800, 71801, 
+    71802, 71803, 71804, 71805, 71806, 71807, 71808, 71809, 71810, 71811, 
+    71812, 71813, 71814, 71815, 71816, 71817, 71818, 71819, 71820, 71821, 
+    71822, 71823, 71824, 71825, 71826, 71827, 71828, 71829, 71830, 71831, 
+    71832, 71833, 71834, 71835, 71836, 71837, 71838, 71839, 71840, 71841, 
+    71842, 71843, 71844, 71845, 71846, 71847, 71848, 71849, 71850, 71851, 
+    71852, 71853, 71854, 71855, 71856, 71857, 71858, 71859, 71860, 71861, 
+    71862, 71863, 71864, 71865, 71866, 71867, 71868, 71869, 71870, 71871, 
+    71872, 71873, 71874, 71875, 71876, 71877, 71878, 71879, 71880, 71881, 
+    71882, 71883, 71884, 71885, 71886, 71887, 71888, 71889, 71890, 71891, 
+    71892, 71893, 71894, 71895, 71896, 71897, 71898, 71899, 71900, 71901, 
+    71902, 71903, 71904, 71905, 71906, 71907, 71908, 71909, 71910, 71911, 
+    71912, 71913, 71914, 71915, 71916, 71917, 71918, 71919, 71920, 71921, 
+    71922, 71923, 71924, 71925, 71926, 71927, 71928, 71929, 71930, 71931, 
+    71932, 71933, 71934, 71935, 71936, 71937, 71938, 71939, 71940, 71941, 
+    71942, 71943, 71944, 71945, 71946, 71947, 71948, 71949, 71950, 71951, 
+    71952, 71953, 71954, 71955, 71956, 71957, 71958, 71959, 71960, 71961, 
+    71962, 71963, 71964, 71965, 71966, 71967, 71968, 71969, 71970, 71971, 
+    71972, 71973, 71974, 71975, 71976, 71977, 71978, 71979, 71980, 71981, 
+    71982, 71983, 71984, 71985, 71986, 71987, 71988, 71989, 71990, 71991, 
+    71992, 71993, 71994, 71995, 71996, 71997, 71998, 71999, 72000, 72001, 
+    72002, 72003, 72004, 72005, 72006, 72007, 72008, 72009, 72010, 72011, 
+    72012, 72013, 72014, 72015, 72016, 72017, 72018, 72019, 72020, 72021, 
+    72022, 72023, 72024, 72025, 72026, 72027, 72028, 72029, 72030, 72031, 
+    72032, 72033, 72034, 72035, 72036, 72037, 72038, 72039, 72040, 72041, 
+    72042, 72043, 72044, 72045, 72046, 72047, 72048, 72049, 72050, 72051, 
+    72052, 72053, 72054, 72055, 72056, 72057, 72058, 72059, 72060, 72061, 
+    72062, 72063, 72064, 72065, 72066, 72067, 72068, 72069, 72070, 72071, 
+    72072, 72073, 72074, 72075, 72076, 72077, 72078, 72079, 72080, 72081, 
+    72082, 72083, 72084, 72085, 72086, 72087, 72088, 72089, 72090, 72091, 
+    72092, 72093, 72094, 72095, 72096, 72097, 72098, 72099, 72100, 72101, 
+    72102, 72103, 72104, 72105, 72106, 72107, 72108, 72109, 72110, 72111, 
+    72112, 72113, 72114, 72115, 72116, 72117, 72118, 72119, 72120, 72121, 
+    72122, 72123, 72124, 72125, 72126, 72127, 72128, 72129, 72130, 72131, 
+    72132, 72133, 72134, 72135, 72136, 72137, 72138, 72139, 72140, 72141, 
+    72142, 72143, 72144, 72145, 72146, 72147, 72148, 72149, 72150, 72151, 
+    72152, 72153, 72154, 72155, 72156, 72157, 72158, 72159, 72160, 72161, 
+    72162, 72163, 72164, 72165, 72166, 72167, 72168, 72169, 72170, 72171, 
+    72172, 72173, 72174, 72175, 72176, 72177, 72178, 72179, 72180, 72181, 
+    72182, 72183, 72184, 72185, 72186, 72187, 72188, 72189, 72190, 72191, 
+    72192, 72193, 72194, 72195, 72196, 72197, 72198, 72199, 72200, 72201, 
+    72202, 72203, 72204, 72205, 72206, 72207, 72208, 72209, 72210, 72211, 
+    72212, 72213, 72214, 72215, 72216, 72217, 72218, 72219, 72220, 72221, 
+    72222, 72223, 72224, 72225, 72226, 72227, 72228, 72229, 72230, 72231, 
+    72232, 72233, 72234, 72235, 72236, 72237, 72238, 72239, 72240, 72241, 
+    72242, 72243, 72244, 72245, 72246, 72247, 72248, 72249, 72250, 72251, 
+    72252, 72253, 72254, 72255, 72256, 72257, 72258, 72259, 72260, 72261, 
+    72262, 72263, 72264, 72265, 72266, 72267, 72268, 72269, 72270, 72271, 
+    72272, 72273, 72274, 72275, 72276, 72277, 72278, 72279, 72280, 72281, 
+    72282, 72283, 72284, 72285, 72286, 72287, 72288, 72289, 72290, 72291, 
+    72292, 72293, 72294, 72295, 72296, 72297, 72298, 72299, 72300, 72301, 
+    72302, 72303, 72304, 72305, 72306, 72307, 72308, 72309, 72310, 72311, 
+    72312, 72313, 72314, 72315, 72316, 72317, 72318, 72319, 72320, 72321, 
+    72322, 72323, 72324, 72325, 72326, 72327, 72328, 72329, 72330, 72331, 
+    72332, 72333, 72334, 72335, 72336, 72337, 72338, 72339, 72340, 72341, 
+    72342, 72343, 72344, 72345, 72346, 72347, 72348, 72349, 72350, 72351, 
+    72352, 72353, 72354, 72355, 72356, 72357, 72358, 72359, 72360, 72361, 
+    72362, 72363, 72364, 72365, 72366, 72367, 72368, 72369, 72370, 72371, 
+    72372, 72373, 72374, 72375, 72376, 72377, 72378, 72379, 72380, 72381, 
+    72382, 72383, 72384, 72385, 72386, 72387, 72388, 72389, 72390, 72391, 
+    72392, 72393, 72394, 72395, 72396, 72397, 72398, 72399, 72400, 72401, 
+    72402, 72403, 72404, 72405, 72406, 72407, 72408, 72409, 72410, 72411, 
+    72412, 72413, 72414, 72415, 72416, 72417, 72418, 72419, 72420, 72421, 
+    72422, 72423, 72424, 72425, 72426, 72427, 72428, 72429, 72430, 72431, 
+    72432, 72433, 72434, 72435, 72436, 72437, 72438, 72439, 72440, 72441, 
+    72442, 72443, 72444, 72445, 72446, 72447, 72448, 72449, 72450, 72451, 
+    72452, 72453, 72454, 72455, 72456, 72457, 72458, 72459, 72460, 72461, 
+    72462, 72463, 72464, 72465, 72466, 72467, 72468, 72469, 72470, 72471, 
+    72472, 72473, 72474, 72475, 72476, 72477, 72478, 72479, 72480, 72481, 
+    72482, 72483, 72484, 72485, 72486, 72487, 72488, 72489, 72490, 72491, 
+    72492, 72493, 72494, 72495, 72496, 72497, 72498, 72499, 72500, 72501, 
+    72502, 72503, 72504, 72505, 72506, 72507, 72508, 72509, 72510, 72511, 
+    72512, 72513, 72514, 72515, 72516, 72517, 72518, 72519, 72520, 72521, 
+    72522, 72523, 72524, 72525, 72526, 72527, 72528, 72529, 72530, 72531, 
+    72532, 72533, 72534, 72535, 72536, 72537, 72538, 72539, 72540, 72541, 
+    72542, 72543, 72544, 72545, 72546, 72547, 72548, 72549, 72550, 72551, 
+    72552, 72553, 72554, 72555, 72556, 72557, 72558, 72559, 72560, 72561, 
+    72562, 72563, 72564, 72565, 72566, 72567, 72568, 72569, 72570, 72571, 
+    72572, 72573, 72574, 72575, 72576, 72577, 72578, 72579, 72580, 72581, 
+    72582, 72583, 72584, 72585, 72586, 72587, 72588, 72589, 72590, 72591, 
+    72592, 72593, 72594, 72595, 72596, 72597, 72598, 72599, 72600, 72601, 
+    72602, 72603, 72604, 72605, 72606, 72607, 72608, 72609, 72610, 72611, 
+    72612, 72613, 72614, 72615, 72616, 72617, 72618, 72619, 72620, 72621, 
+    72622, 72623, 72624, 72625, 72626, 72627, 72628, 72629, 72630, 72631, 
+    72632, 72633, 72634, 72635, 72636, 72637, 72638, 72639, 72640, 72641, 
+    72642, 72643, 72644, 72645, 72646, 72647, 72648, 72649, 72650, 72651, 
+    72652, 72653, 72654, 72655, 72656, 72657, 72658, 72659, 72660, 72661, 
+    72662, 72663, 72664, 72665, 72666, 72667, 72668, 72669, 72670, 72671, 
+    72672, 72673, 72674, 72675, 72676, 72677, 72678, 72679, 72680, 72681, 
+    72682, 72683, 72684, 72685, 72686, 72687, 72688, 72689, 72690, 72691, 
+    72692, 72693, 72694, 72695, 72696, 72697, 72698, 72699, 72700, 72701, 
+    72702, 72703, 72704, 72705, 72706, 72707, 72708, 72709, 72710, 72711, 
+    72712, 72713, 72714, 72715, 72716, 72717, 72718, 72719, 72720, 72721, 
+    72722, 72723, 72724, 72725, 72726, 72727, 72728, 72729, 72730, 72731, 
+    72732, 72733, 72734, 72735, 72736, 72737, 72738, 72739, 72740, 72741, 
+    72742, 72743, 72744, 72745, 72746, 72747, 72748, 72749, 72750, 72751, 
+    72752, 72753, 72754, 72755, 72756, 72757, 72758, 72759, 72760, 72761, 
+    72762, 72763, 72764, 72765, 72766, 72767, 72768, 72769, 72770, 72771, 
+    72772, 72773, 72774, 72775, 72776, 72777, 72778, 72779, 72780, 72781, 
+    72782, 72783, 72784, 72785, 72786, 72787, 72788, 72789, 72790, 72791, 
+    72792, 72793, 72794, 72795, 72796, 72797, 72798, 72799, 72800, 72801, 
+    72802, 72803, 72804, 72805, 72806, 72807, 72808, 72809, 72810, 72811, 
+    72812, 72813, 72814, 72815, 72816, 72817, 72818, 72819, 72820, 72821, 
+    72822, 72823, 72824, 72825, 72826, 72827, 72828, 72829, 72830, 72831, 
+    72832, 72833, 72834, 72835, 72836, 72837, 72838, 72839, 72840, 72841, 
+    72842, 72843, 72844, 72845, 72846, 72847, 72848, 72849, 72850, 72851, 
+    72852, 72853, 72854, 72855, 72856, 72857, 72858, 72859, 72860, 72861, 
+    72862, 72863, 72864, 72865, 72866, 72867, 72868, 72869, 72870, 72871, 
+    72872, 72873, 72874, 72875, 72876, 72877, 72878, 72879, 72880, 72881, 
+    72882, 72883, 72884, 72885, 72886, 72887, 72888, 72889, 72890, 72891, 
+    72892, 72893, 72894, 72895, 72896, 72897, 72898, 72899, 72900, 72901, 
+    72902, 72903, 72904, 72905, 72906, 72907, 72908, 72909, 72910, 72911, 
+    72912, 72913, 72914, 72915, 72916, 72917, 72918, 72919, 72920, 72921, 
+    72922, 72923, 72924, 72925, 72926, 72927, 72928, 72929, 72930, 72931, 
+    72932, 72933, 72934, 72935, 72936, 72937, 72938, 72939, 72940, 72941, 
+    72942, 72943, 72944, 72945, 72946, 72947, 72948, 72949, 72950, 72951, 
+    72952, 72953, 72954, 72955, 72956, 72957, 72958, 72959, 72960, 72961, 
+    72962, 72963, 72964, 72965, 72966, 72967, 72968, 72969, 72970, 72971, 
+    72972, 72973, 72974, 72975, 72976, 72977, 72978, 72979, 72980, 72981, 
+    72982, 72983, 72984, 72985, 72986, 72987, 72988, 72989, 72990, 72991, 
+    72992, 72993, 72994, 72995, 72996, 72997, 72998, 72999, 73000, 73001, 
+    73002, 73003, 73004, 73005, 73006, 73007, 73008, 73009, 73010, 73011, 
+    73012, 73013, 73014, 73015, 73016, 73017, 73018, 73019, 73020, 73021, 
+    73022, 73023, 73024, 73025, 73026, 73027, 73028, 73029, 73030, 73031, 
+    73032, 73033, 73034, 73035, 73036, 73037, 73038, 73039, 73040, 73041, 
+    73042, 73043, 73044, 73045, 73046, 73047, 73048, 73049, 73050, 73051, 
+    73052, 73053, 73054, 73055, 73056, 73057, 73058, 73059, 73060, 73061, 
+    73062, 73063, 73064, 73065, 73066, 73067, 73068, 73069, 73070, 73071, 
+    73072, 73073, 73074, 73075, 73076, 73077, 73078, 73079, 73080, 73081, 
+    73082, 73083, 73084, 73085, 73086, 73087, 73088, 73089, 73090, 73091, 
+    73092, 73093, 73094, 73095, 73096, 73097, 73098, 73099, 73100, 73101, 
+    73102, 73103, 73104, 73105, 73106, 73107, 73108, 73109, 73110, 73111, 
+    73112, 73113, 73114, 73115, 73116, 73117, 73118, 73119, 73120, 73121, 
+    73122, 73123, 73124, 73125, 73126, 73127, 73128, 73129, 73130, 73131, 
+    73132, 73133, 73134, 73135, 73136, 73137, 73138, 73139, 73140, 73141, 
+    73142, 73143, 73144, 73145, 73146, 73147, 73148, 73149, 73150, 73151, 
+    73152, 73153, 73154, 73155, 73156, 73157, 73158, 73159, 73160, 73161, 
+    73162, 73163, 73164, 73165, 73166, 73167, 73168, 73169, 73170, 73171, 
+    73172, 73173, 73174, 73175, 73176, 73177, 73178, 73179, 73180, 73181, 
+    73182, 73183, 73184, 73185, 73186, 73187, 73188, 73189, 73190, 73191, 
+    73192, 73193, 73194, 73195, 73196, 73197, 73198, 73199, 73200, 73201, 
+    73202, 73203, 73204, 73205, 73206, 73207, 73208, 73209, 73210, 73211, 
+    73212, 73213, 73214, 73215, 73216, 73217, 73218, 73219, 73220, 73221, 
+    73222, 73223, 73224, 73225, 73226, 73227, 73228, 73229, 73230, 73231, 
+    73232, 73233, 73234, 73235, 73236, 73237, 73238, 73239, 73240, 73241, 
+    73242, 73243, 73244, 73245, 73246, 73247, 73248, 73249, 73250, 73251, 
+    73252, 73253, 73254, 73255, 73256, 73257, 73258, 73259, 73260, 73261, 
+    73262, 73263, 73264, 73265, 73266, 73267, 73268, 73269, 73270, 73271, 
+    73272, 73273, 73274, 73275, 73276, 73277, 73278, 73279, 73280, 73281, 
+    73282, 73283, 73284, 73285, 73286, 73287, 73288, 73289, 73290, 73291, 
+    73292, 73293, 73294, 73295, 73296, 73297, 73298, 73299, 73300, 73301, 
+    73302, 73303, 73304, 73305, 73306, 73307, 73308, 73309, 73310, 73311, 
+    73312, 73313, 73314, 73315, 73316, 73317, 73318, 73319, 73320, 73321, 
+    73322, 73323, 73324, 73325, 73326, 73327, 73328, 73329, 73330, 73331, 
+    73332, 73333, 73334, 73335, 73336, 73337, 73338, 73339, 73340, 73341, 
+    73342, 73343, 73344, 73345, 73346, 73347, 73348, 73349, 73350, 73351, 
+    73352, 73353, 73354, 73355, 73356, 73357, 73358, 73359, 73360, 73361, 
+    73362, 73363, 73364, 73365, 73366, 73367, 73368, 73369, 73370, 73371, 
+    73372, 73373, 73374, 73375, 73376, 73377, 73378, 73379, 73380, 73381, 
+    73382, 73383, 73384, 73385, 73386, 73387, 73388, 73389, 73390, 73391, 
+    73392, 73393, 73394, 73395, 73396, 73397, 73398, 73399, 73400, 73401, 
+    73402, 73403, 73404, 73405, 73406, 73407, 73408, 73409, 73410, 73411, 
+    73412, 73413, 73414, 73415, 73416, 73417, 73418, 73419, 73420, 73421, 
+    73422, 73423, 73424, 73425, 73426, 73427, 73428, 73429, 73430, 73431, 
+    73432, 73433, 73434, 73435, 73436, 73437, 73438, 73439, 73440, 73441, 
+    73442, 73443, 73444, 73445, 73446, 73447, 73448, 73449, 73450, 73451, 
+    73452, 73453, 73454, 73455, 73456, 73457, 73458, 73459, 73460, 73461, 
+    73462, 73463, 73464, 73465, 73466, 73467, 73468, 73469, 73470, 73471, 
+    73472, 73473, 73474, 73475, 73476, 73477, 73478, 73479, 73480, 73481, 
+    73482, 73483, 73484, 73485, 73486, 73487, 73488, 73489, 73490, 73491, 
+    73492, 73493, 73494, 73495, 73496, 73497, 73498, 73499, 73500, 73501, 
+    73502, 73503, 73504, 73505, 73506, 73507, 73508, 73509, 73510, 73511, 
+    73512, 73513, 73514, 73515, 73516, 73517, 73518, 73519, 73520, 73521, 
+    73522, 73523, 73524, 73525, 73526, 73527, 73528, 73529, 73530, 73531, 
+    73532, 73533, 73534, 73535, 73536, 73537, 73538, 73539, 73540, 73541, 
+    73542, 73543, 73544, 73545, 73546, 73547, 73548, 73549, 73550, 73551, 
+    73552, 73553, 73554, 73555, 73556, 73557, 73558, 73559, 73560, 73561, 
+    73562, 73563, 73564, 73565, 73566, 73567, 73568, 73569, 73570, 73571, 
+    73572, 73573, 73574, 73575, 73576, 73577, 73578, 73579, 73580, 73581, 
+    73582, 73583, 73584, 73585, 73586, 73587, 73588, 73589, 73590, 73591, 
+    73592, 73593, 73594, 73595, 73596, 73597, 73598, 73599, 73600, 73601, 
+    73602, 73603, 73604, 73605, 73606, 73607, 73608, 73609, 73610, 73611, 
+    73612, 73613, 73614, 73615, 73616, 73617, 73618, 73619, 73620, 73621, 
+    73622, 73623, 73624, 73625, 73626, 73627, 73628, 73629, 73630, 73631, 
+    73632, 73633, 73634, 73635, 73636, 73637, 73638, 73639, 73640, 73641, 
+    73642, 73643, 73644, 73645, 73646, 73647, 73648, 73649, 73650, 73651, 
+    73652, 73653, 73654, 73655, 73656, 73657, 73658, 73659, 73660, 73661, 
+    73662, 73663, 73664, 73665, 73666, 73667, 73668, 73669, 73670, 73671, 
+    73672, 73673, 73674, 73675, 73676, 73677, 73678, 73679, 73680, 73681, 
+    73682, 73683, 73684, 73685, 73686, 73687, 73688, 73689, 73690, 73691, 
+    73692, 73693, 73694, 73695, 73696, 73697, 73698, 73699, 73700, 73701, 
+    73702, 73703, 73704, 73705, 73706, 73707, 73708, 73709, 73710, 73711, 
+    73712, 73713, 73714, 73715, 73716, 73717, 73718, 73719, 73720, 73721, 
+    73722, 73723, 73724, 73725, 73726, 73727, 73728, 73729, 73730, 73731, 
+    73732, 73733, 73734, 73735, 73736, 73737, 73738, 73739, 73740, 73741, 
+    73742, 73743, 73744, 73745, 73746, 73747, 73748, 73749, 73750, 73751, 
+    73752, 73753, 73754, 73755, 73756, 73757, 73758, 73759, 73760, 73761, 
+    73762, 73763, 73764, 73765, 73766, 73767, 73768, 73769, 73770, 73771, 
+    73772, 73773, 73774, 73775, 73776, 73777, 73778, 73779, 73780, 73781, 
+    73782, 73783, 73784, 73785, 73786, 73787, 73788, 73789, 73790, 73791, 
+    73792, 73793, 73794, 73795, 73796, 73797, 73798, 73799, 73800, 73801, 
+    73802, 73803, 73804, 73805, 73806, 73807, 73808, 73809, 73810, 73811, 
+    73812, 73813, 73814, 73815, 73816, 73817, 73818, 73819, 73820, 73821, 
+    73822, 73823, 73824, 73825, 73826, 73827, 73828, 73829, 73830, 73831, 
+    73832, 73833, 73834, 73835, 73836, 73837, 73838, 73839, 73840, 73841, 
+    73842, 73843, 73844, 73845, 73846, 73847, 73848, 73849, 73850, 73851, 
+    73852, 73853, 73854, 73855, 73856, 73857, 73858, 73859, 73860, 73861, 
+    73862, 73863, 73864, 73865, 73866, 73867, 73868, 73869, 73870, 73871, 
+    73872, 73873, 73874, 73875, 73876, 73877, 73878, 73879, 73880, 73881, 
+    73882, 73883, 73884, 73885, 73886, 73887, 73888, 73889, 73890, 73891, 
+    73892, 73893, 73894, 73895, 73896, 73897, 73898, 73899, 73900, 73901, 
+    73902, 73903, 73904, 73905, 73906, 73907, 73908, 73909, 73910, 73911, 
+    73912, 73913, 73914, 73915, 73916, 73917, 73918, 73919, 73920, 73921, 
+    73922, 73923, 73924, 73925, 73926, 73927, 73928, 73929, 73930, 73931, 
+    73932, 73933, 73934, 73935, 73936, 73937, 73938, 73939, 73940, 73941, 
+    73942, 73943, 73944, 73945, 73946, 73947, 73948, 73949, 73950, 73951, 
+    73952, 73953, 73954, 73955, 73956, 73957, 73958, 73959, 73960, 73961, 
+    73962, 73963, 73964, 73965, 73966, 73967, 73968, 73969, 73970, 73971, 
+    73972, 73973, 73974, 73975, 73976, 73977, 73978, 73979, 73980, 73981, 
+    73982, 73983, 73984, 73985, 73986, 73987, 73988, 73989, 73990, 73991, 
+    73992, 73993, 73994, 73995, 73996, 73997, 73998, 73999, 74000, 74001, 
+    74002, 74003, 74004, 74005, 74006, 74007, 74008, 74009, 74010, 74011, 
+    74012, 74013, 74014, 74015, 74016, 74017, 74018, 74019, 74020, 74021, 
+    74022, 74023, 74024, 74025, 74026, 74027, 74028, 74029, 74030, 74031, 
+    74032, 74033, 74034, 74035, 74036, 74037, 74038, 74039, 74040, 74041, 
+    74042, 74043, 74044, 74045, 74046, 74047, 74048, 74049, 74050, 74051, 
+    74052, 74053, 74054, 74055, 74056, 74057, 74058, 74059, 74060, 74061, 
+    74062, 74063, 74064, 74065, 74066, 74067, 74068, 74069, 74070, 74071, 
+    74072, 74073, 74074, 74075, 74076, 74077, 74078, 74079, 74080, 74081, 
+    74082, 74083, 74084, 74085, 74086, 74087, 74088, 74089, 74090, 74091, 
+    74092, 74093, 74094, 74095, 74096, 74097, 74098, 74099, 74100, 74101, 
+    74102, 74103, 74104, 74105, 74106, 74107, 74108, 74109, 74110, 74111, 
+    74112, 74113, 74114, 74115, 74116, 74117, 74118, 74119, 74120, 74121, 
+    74122, 74123, 74124, 74125, 74126, 74127, 74128, 74129, 74130, 74131, 
+    74132, 74133, 74134, 74135, 74136, 74137, 74138, 74139, 74140, 74141, 
+    74142, 74143, 74144, 74145, 74146, 74147, 74148, 74149, 74150, 74151, 
+    74152, 74153, 74154, 74155, 74156, 74157, 74158, 74159, 74160, 74161, 
+    74162, 74163, 74164, 74165, 74166, 74167, 74168, 74169, 74170, 74171, 
+    74172, 74173, 74174, 74175, 74176, 74177, 74178, 74179, 74180, 74181, 
+    74182, 74183, 74184, 74185, 74186, 74187, 74188, 74189, 74190, 74191, 
+    74192, 74193, 74194, 74195, 74196, 74197, 74198, 74199, 74200, 74201, 
+    74202, 74203, 74204, 74205, 74206, 74207, 74208, 74209, 74210, 74211, 
+    74212, 74213, 74214, 74215, 74216, 74217, 74218, 74219, 74220, 74221, 
+    74222, 74223, 74224, 74225, 74226, 74227, 74228, 74229, 74230, 74231, 
+    74232, 74233, 74234, 74235, 74236, 74237, 74238, 74239, 74240, 74241, 
+    74242, 74243, 74244, 74245, 74246, 74247, 74248, 74249, 74250, 74251, 
+    74252, 74253, 74254, 74255, 74256, 74257, 74258, 74259, 74260, 74261, 
+    74262, 74263, 74264, 74265, 74266, 74267, 74268, 74269, 74270, 74271, 
+    74272, 74273, 74274, 74275, 74276, 74277, 74278, 74279, 74280, 74281, 
+    74282, 74283, 74284, 74285, 74286, 74287, 74288, 74289, 74290, 74291, 
+    74292, 74293, 74294, 74295, 74296, 74297, 74298, 74299, 74300, 74301, 
+    74302, 74303, 74304, 74305, 74306, 74307, 74308, 74309, 74310, 74311, 
+    74312, 74313, 74314, 74315, 74316, 74317, 74318, 74319, 74320, 74321, 
+    74322, 74323, 74324, 74325, 74326, 74327, 74328, 74329, 74330, 74331, 
+    74332, 74333, 74334, 74335, 74336, 74337, 74338, 74339, 74340, 74341, 
+    74342, 74343, 74344, 74345, 74346, 74347, 74348, 74349, 74350, 74351, 
+    74352, 74353, 74354, 74355, 74356, 74357, 74358, 74359, 74360, 74361, 
+    74362, 74363, 74364, 74365, 74366, 74367, 74368, 74369, 74370, 74371, 
+    74372, 74373, 74374, 74375, 74376, 74377, 74378, 74379, 74380, 74381, 
+    74382, 74383, 74384, 74385, 74386, 74387, 74388, 74389, 74390, 74391, 
+    74392, 74393, 74394, 74395, 74396, 74397, 74398, 74399, 74400, 74401, 
+    74402, 74403, 74404, 74405, 74406, 74407, 74408, 74409, 74410, 74411, 
+    74412, 74413, 74414, 74415, 74416, 74417, 74418, 74419, 74420, 74421, 
+    74422, 74423, 74424, 74425, 74426, 74427, 74428, 74429, 74430, 74431, 
+    74432, 74433, 74434, 74435, 74436, 74437, 74438, 74439, 74440, 74441, 
+    74442, 74443, 74444, 74445, 74446, 74447, 74448, 74449, 74450, 74451, 
+    74452, 74453, 74454, 74455, 74456, 74457, 74458, 74459, 74460, 74461, 
+    74462, 74463, 74464, 74465, 74466, 74467, 74468, 74469, 74470, 74471, 
+    74472, 74473, 74474, 74475, 74476, 74477, 74478, 74479, 74480, 74481, 
+    74482, 74483, 74484, 74485, 74486, 74487, 74488, 74489, 74490, 74491, 
+    74492, 74493, 74494, 74495, 74496, 74497, 74498, 74499, 74500, 74501, 
+    74502, 74503, 74504, 74505, 74506, 74507, 74508, 74509, 74510, 74511, 
+    74512, 74513, 74514, 74515, 74516, 74517, 74518, 74519, 74520, 74521, 
+    74522, 74523, 74524, 74525, 74526, 74527, 74528, 74529, 74530, 74531, 
+    74532, 74533, 74534, 74535, 74536, 74537, 74538, 74539, 74540, 74541, 
+    74542, 74543, 74544, 74545, 74546, 74547, 74548, 74549, 74550, 74551, 
+    74552, 74553, 74554, 74555, 74556, 74557, 74558, 74559, 74560, 74561, 
+    74562, 74563, 74564, 74565, 74566, 74567, 74568, 74569, 74570, 74571, 
+    74572, 74573, 74574, 74575, 74576, 74577, 74578, 74579, 74580, 74581, 
+    74582, 74583, 74584, 74585, 74586, 74587, 74588, 74589, 74590, 74591, 
+    74592, 74593, 74594, 74595, 74596, 74597, 74598, 74599, 74600, 74601, 
+    74602, 74603, 74604, 74605, 74606, 74607, 74608, 74609, 74610, 74611, 
+    74612, 74613, 74614, 74615, 74616, 74617, 74618, 74619, 74620, 74621, 
+    74622, 74623, 74624, 74625, 74626, 74627, 74628, 74629, 74630, 74631, 
+    74632, 74633, 74634, 74635, 74636, 74637, 74638, 74639, 74640, 74641, 
+    74642, 74643, 74644, 74645, 74646, 74647, 74648, 74649, 74650, 74651, 
+    74652, 74653, 74654, 74655, 74656, 74657, 74658, 74659, 74660, 74661, 
+    74662, 74663, 74664, 74665, 74666, 74667, 74668, 74669, 74670, 74671, 
+    74672, 74673, 74674, 74675, 74676, 74677, 74678, 74679, 74680, 74681, 
+    74682, 74683, 74684, 74685, 74686, 74687, 74688, 74689, 74690, 74691, 
+    74692, 74693, 74694, 74695, 74696, 74697, 74698, 74699, 74700, 74701, 
+    74702, 74703, 74704, 74705, 74706, 74707, 74708, 74709, 74710, 74711, 
+    74712, 74713, 74714, 74715, 74716, 74717, 74718, 74719, 74720, 74721, 
+    74722, 74723, 74724, 74725, 74726, 74727, 74728, 74729, 74730, 74731, 
+    74732, 74733, 74734, 74735, 74736, 74737, 74738, 74739, 74740, 74741, 
+    74742, 74743, 74744, 74745, 74746, 74747, 74748, 74749, 74750, 74751, 
+    74752, 74753, 74754, 74755, 74756, 74757, 74758, 74759, 74760, 74761, 
+    74762, 74763, 74764, 74765, 74766, 74767, 74768, 74769, 74770, 74771, 
+    74772, 74773, 74774, 74775, 74776, 74777, 74778, 74779, 74780, 74781, 
+    74782, 74783, 74784, 74785, 74786, 74787, 74788, 74789, 74790, 74791, 
+    74792, 74793, 74794, 74795, 74796, 74797, 74798, 74799, 74800, 74801, 
+    74802, 74803, 74804, 74805, 74806, 74807, 74808, 74809, 74810, 74811, 
+    74812, 74813, 74814, 74815, 74816, 74817, 74818, 74819, 74820, 74821, 
+    74822, 74823, 74824, 74825, 74826, 74827, 74828, 74829, 74830, 74831, 
+    74832, 74833, 74834, 74835, 74836, 74837, 74838, 74839, 74840, 74841, 
+    74842, 74843, 74844, 74845, 74846, 74847, 74848, 74849, 74850, 74851, 
+    74852, 74853, 74854, 74855, 74856, 74857, 74858, 74859, 74860, 74861, 
+    74862, 74863, 74864, 74865, 74866, 74867, 74868, 74869, 74870, 74871, 
+    74872, 74873, 74874, 74875, 74876, 74877, 74878, 74879, 74880, 74881, 
+    74882, 74883, 74884, 74885, 74886, 74887, 74888, 74889, 74890, 74891, 
+    74892, 74893, 74894, 74895, 74896, 74897, 74898, 74899, 74900, 74901, 
+    74902, 74903, 74904, 74905, 74906, 74907, 74908, 74909, 74910, 74911, 
+    74912, 74913, 74914, 74915, 74916, 74917, 74918, 74919, 74920, 74921, 
+    74922, 74923, 74924, 74925, 74926, 74927, 74928, 74929, 74930, 74931, 
+    74932, 74933, 74934, 74935, 74936, 74937, 74938, 74939, 74940, 74941, 
+    74942, 74943, 74944, 74945, 74946, 74947, 74948, 74949, 74950, 74951, 
+    74952, 74953, 74954, 74955, 74956, 74957, 74958, 74959, 74960, 74961, 
+    74962, 74963, 74964, 74965, 74966, 74967, 74968, 74969, 74970, 74971, 
+    74972, 74973, 74974, 74975, 74976, 74977, 74978, 74979, 74980, 74981, 
+    74982, 74983, 74984, 74985, 74986, 74987, 74988, 74989, 74990, 74991, 
+    74992, 74993, 74994, 74995, 74996, 74997, 74998, 74999, 75000, 75001, 
+    75002, 75003, 75004, 75005, 75006, 75007, 75008, 75009, 75010, 75011, 
+    75012, 75013, 75014, 75015, 75016, 75017, 75018, 75019, 75020, 75021, 
+    75022, 75023, 75024, 75025, 75026, 75027, 75028, 75029, 75030, 75031, 
+    75032, 75033, 75034, 75035, 75036, 75037, 75038, 75039, 75040, 75041, 
+    75042, 75043, 75044, 75045, 75046, 75047, 75048, 75049, 75050, 75051, 
+    75052, 75053, 75054, 75055, 75056, 75057, 75058, 75059, 75060, 75061, 
+    75062, 75063, 75064, 75065, 75066, 75067, 75068, 75069, 75070, 75071, 
+    75072, 75073, 75074, 75075, 75076, 75077, 75078, 75079, 75080, 75081, 
+    75082, 75083, 75084, 75085, 75086, 75087, 75088, 75089, 75090, 75091, 
+    75092, 75093, 75094, 75095, 75096, 75097, 75098, 75099, 75100, 75101, 
+    75102, 75103, 75104, 75105, 75106, 75107, 75108, 75109, 75110, 75111, 
+    75112, 75113, 75114, 75115, 75116, 75117, 75118, 75119, 75120, 75121, 
+    75122, 75123, 75124, 75125, 75126, 75127, 75128, 75129, 75130, 75131, 
+    75132, 75133, 75134, 75135, 75136, 75137, 75138, 75139, 75140, 75141, 
+    75142, 75143, 75144, 75145, 75146, 75147, 75148, 75149, 75150, 75151, 
+    75152, 75153, 75154, 75155, 75156, 75157, 75158, 75159, 75160, 75161, 
+    75162, 75163, 75164, 75165, 75166, 75167, 75168, 75169, 75170, 75171, 
+    75172, 75173, 75174, 75175, 75176, 75177, 75178, 75179, 75180, 75181, 
+    75182, 75183, 75184, 75185, 75186, 75187, 75188, 75189, 75190, 75191, 
+    75192, 75193, 75194, 75195, 75196, 75197, 75198, 75199, 75200, 75201, 
+    75202, 75203, 75204, 75205, 75206, 75207, 75208, 75209, 75210, 75211, 
+    75212, 75213, 75214, 75215, 75216, 75217, 75218, 75219, 75220, 75221, 
+    75222, 75223, 75224, 75225, 75226, 75227, 75228, 75229, 75230, 75231, 
+    75232, 75233, 75234, 75235, 75236, 75237, 75238, 75239, 75240, 75241, 
+    75242, 75243, 75244, 75245, 75246, 75247, 75248, 75249, 75250, 75251, 
+    75252, 75253, 75254, 75255, 75256, 75257, 75258, 75259, 75260, 75261, 
+    75262, 75263, 75264, 75265, 75266, 75267, 75268, 75269, 75270, 75271, 
+    75272, 75273, 75274, 75275, 75276, 75277, 75278, 75279, 75280, 75281, 
+    75282, 75283, 75284, 75285, 75286, 75287, 75288, 75289, 75290, 75291, 
+    75292, 75293, 75294, 75295, 75296, 75297, 75298, 75299, 75300, 75301, 
+    75302, 75303, 75304, 75305, 75306, 75307, 75308, 75309, 75310, 75311, 
+    75312, 75313, 75314, 75315, 75316, 75317, 75318, 75319, 75320, 75321, 
+    75322, 75323, 75324, 75325, 75326, 75327, 75328, 75329, 75330, 75331, 
+    75332, 75333, 75334, 75335, 75336, 75337, 75338, 75339, 75340, 75341, 
+    75342, 75343, 75344, 75345, 75346, 75347, 75348, 75349, 75350, 75351, 
+    75352, 75353, 75354, 75355, 75356, 75357, 75358, 75359, 75360, 75361, 
+    75362, 75363, 75364, 75365, 75366, 75367, 75368, 75369, 75370, 75371, 
+    75372, 75373, 75374, 75375, 75376, 75377, 75378, 75379, 75380, 75381, 
+    75382, 75383, 75384, 75385, 75386, 75387, 75388, 75389, 75390, 75391, 
+    75392, 75393, 75394, 75395, 75396, 75397, 75398, 75399, 75400, 75401, 
+    75402, 75403, 75404, 75405, 75406, 75407, 75408, 75409, 75410, 75411, 
+    75412, 75413, 75414, 75415, 75416, 75417, 75418, 75419, 75420, 75421, 
+    75422, 75423, 75424, 75425, 75426, 75427, 75428, 75429, 75430, 75431, 
+    75432, 75433, 75434, 75435, 75436, 75437, 75438, 75439, 75440, 75441, 
+    75442, 75443, 75444, 75445, 75446, 75447, 75448, 75449, 75450, 75451, 
+    75452, 75453, 75454, 75455, 75456, 75457, 75458, 75459, 75460, 75461, 
+    75462, 75463, 75464, 75465, 75466, 75467, 75468, 75469, 75470, 75471, 
+    75472, 75473, 75474, 75475, 75476, 75477, 75478, 75479, 75480, 75481, 
+    75482, 75483, 75484, 75485, 75486, 75487, 75488, 75489, 75490, 75491, 
+    75492, 75493, 75494, 75495, 75496, 75497, 75498, 75499, 75500, 75501, 
+    75502, 75503, 75504, 75505, 75506, 75507, 75508, 75509, 75510, 75511, 
+    75512, 75513, 75514, 75515, 75516, 75517, 75518, 75519, 75520, 75521, 
+    75522, 75523, 75524, 75525, 75526, 75527, 75528, 75529, 75530, 75531, 
+    75532, 75533, 75534, 75535, 75536, 75537, 75538, 75539, 75540, 75541, 
+    75542, 75543, 75544, 75545, 75546, 75547, 75548, 75549, 75550, 75551, 
+    75552, 75553, 75554, 75555, 75556, 75557, 75558, 75559, 75560, 75561, 
+    75562, 75563, 75564, 75565, 75566, 75567, 75568, 75569, 75570, 75571, 
+    75572, 75573, 75574, 75575, 75576, 75577, 75578, 75579, 75580, 75581, 
+    75582, 75583, 75584, 75585, 75586, 75587, 75588, 75589, 75590, 75591, 
+    75592, 75593, 75594, 75595, 75596, 75597, 75598, 75599, 75600, 75601, 
+    75602, 75603, 75604, 75605, 75606, 75607, 75608, 75609, 75610, 75611, 
+    75612, 75613, 75614, 75615, 75616, 75617, 75618, 75619, 75620, 75621, 
+    75622, 75623, 75624, 75625, 75626, 75627, 75628, 75629, 75630, 75631, 
+    75632, 75633, 75634, 75635, 75636, 75637, 75638, 75639, 75640, 75641, 
+    75642, 75643, 75644, 75645, 75646, 75647, 75648, 75649, 75650, 75651, 
+    75652, 75653, 75654, 75655, 75656, 75657, 75658, 75659, 75660, 75661, 
+    75662, 75663, 75664, 75665, 75666, 75667, 75668, 75669, 75670, 75671, 
+    75672, 75673, 75674, 75675, 75676, 75677, 75678, 75679, 75680, 75681, 
+    75682, 75683, 75684, 75685, 75686, 75687, 75688, 75689, 75690, 75691, 
+    75692, 75693, 75694, 75695, 75696, 75697, 75698, 75699, 75700, 75701, 
+    75702, 75703, 75704, 75705, 75706, 75707, 75708, 75709, 75710, 75711, 
+    75712, 75713, 75714, 75715, 75716, 75717, 75718, 75719, 75720, 75721, 
+    75722, 75723, 75724, 75725, 75726, 75727, 75728, 75729, 75730, 75731, 
+    75732, 75733, 75734, 75735, 75736, 75737, 75738, 75739, 75740, 75741, 
+    75742, 75743, 75744, 75745, 75746, 75747, 75748, 75749, 75750, 75751, 
+    75752, 75753, 75754, 75755, 75756, 75757, 75758, 75759, 75760, 75761, 
+    75762, 75763, 75764, 75765, 75766, 75767, 75768, 75769, 75770, 75771, 
+    75772, 75773, 75774, 75775, 75776, 75777, 75778, 75779, 75780, 75781, 
+    75782, 75783, 75784, 75785, 75786, 75787, 75788, 75789, 75790, 75791, 
+    75792, 75793, 75794, 75795, 75796, 75797, 75798, 75799, 75800, 75801, 
+    75802, 75803, 75804, 75805, 75806, 75807, 75808, 75809, 75810, 75811, 
+    75812, 75813, 75814, 75815, 75816, 75817, 75818, 75819, 75820, 75821, 
+    75822, 75823, 75824, 75825, 75826, 75827, 75828, 75829, 75830, 75831, 
+    75832, 75833, 75834, 75835, 75836, 75837, 75838, 75839, 75840, 75841, 
+    75842, 75843, 75844, 75845, 75846, 75847, 75848, 75849, 75850, 75851, 
+    75852, 75853, 75854, 75855, 75856, 75857, 75858, 75859, 75860, 75861, 
+    75862, 75863, 75864, 75865, 75866, 75867, 75868, 75869, 75870, 75871, 
+    75872, 75873, 75874, 75875, 75876, 75877, 75878, 75879, 75880, 75881, 
+    75882, 75883, 75884, 75885, 75886, 75887, 75888, 75889, 75890, 75891, 
+    75892, 75893, 75894, 75895, 75896, 75897, 75898, 75899, 75900, 75901, 
+    75902, 75903, 75904, 75905, 75906, 75907, 75908, 75909, 75910, 75911, 
+    75912, 75913, 75914, 75915, 75916, 75917, 75918, 75919, 75920, 75921, 
+    75922, 75923, 75924, 75925, 75926, 75927, 75928, 75929, 75930, 75931, 
+    75932, 75933, 75934, 75935, 75936, 75937, 75938, 75939, 75940, 75941, 
+    75942, 75943, 75944, 75945, 75946, 75947, 75948, 75949, 75950, 75951, 
+    75952, 75953, 75954, 75955, 75956, 75957, 75958, 75959, 75960, 75961, 
+    75962, 75963, 75964, 75965, 75966, 75967, 75968, 75969, 75970, 75971, 
+    75972, 75973, 75974, 75975, 75976, 75977, 75978, 75979, 75980, 75981, 
+    75982, 75983, 75984, 75985, 75986, 75987, 75988, 75989, 75990, 75991, 
+    75992, 75993, 75994, 75995, 75996, 75997, 75998, 75999, 76000, 76001, 
+    76002, 76003, 76004, 76005, 76006, 76007, 76008, 76009, 76010, 76011, 
+    76012, 76013, 76014, 76015, 76016, 76017, 76018, 76019, 76020, 76021, 
+    76022, 76023, 76024, 76025, 76026, 76027, 76028, 76029, 76030, 76031, 
+    76032, 76033, 76034, 76035, 76036, 76037, 76038, 76039, 76040, 76041, 
+    76042, 76043, 76044, 76045, 76046, 76047, 76048, 76049, 76050, 76051, 
+    76052, 76053, 76054, 76055, 76056, 76057, 76058, 76059, 76060, 76061, 
+    76062, 76063, 76064, 76065, 76066, 76067, 76068, 76069, 76070, 76071, 
+    76072, 76073, 76074, 76075, 76076, 76077, 76078, 76079, 76080, 76081, 
+    76082, 76083, 76084, 76085, 76086, 76087, 76088, 76089, 76090, 76091, 
+    76092, 76093, 76094, 76095, 76096, 76097, 76098, 76099, 76100, 76101, 
+    76102, 76103, 76104, 76105, 76106, 76107, 76108, 76109, 76110, 76111, 
+    76112, 76113, 76114, 76115, 76116, 76117, 76118, 76119, 76120, 76121, 
+    76122, 76123, 76124, 76125, 76126, 76127, 76128, 76129, 76130, 76131, 
+    76132, 76133, 76134, 76135, 76136, 76137, 76138, 76139, 76140, 76141, 
+    76142, 76143, 76144, 76145, 76146, 76147, 76148, 76149, 76150, 76151, 
+    76152, 76153, 76154, 76155, 76156, 76157, 76158, 76159, 76160, 76161, 
+    76162, 76163, 76164, 76165, 76166, 76167, 76168, 76169, 76170, 76171, 
+    76172, 76173, 76174, 76175, 76176, 76177, 76178, 76179, 76180, 76181, 
+    76182, 76183, 76184, 76185, 76186, 76187, 76188, 76189, 76190, 76191, 
+    76192, 76193, 76194, 76195, 76196, 76197, 76198, 76199, 76200, 76201, 
+    76202, 76203, 76204, 76205, 76206, 76207, 76208, 76209, 76210, 76211, 
+    76212, 76213, 76214, 76215, 76216, 76217, 76218, 76219, 76220, 76221, 
+    76222, 76223, 76224, 76225, 76226, 76227, 76228, 76229, 76230, 76231, 
+    76232, 76233, 76234, 76235, 76236, 76237, 76238, 76239, 76240, 76241, 
+    76242, 76243, 76244, 76245, 76246, 76247, 76248, 76249, 76250, 76251, 
+    76252, 76253, 76254, 76255, 76256, 76257, 76258, 76259, 76260, 76261, 
+    76262, 76263, 76264, 76265, 76266, 76267, 76268, 76269, 76270, 76271, 
+    76272, 76273, 76274, 76275, 76276, 76277, 76278, 76279, 76280, 76281, 
+    76282, 76283, 76284, 76285, 76286, 76287, 76288, 76289, 76290, 76291, 
+    76292, 76293, 76294, 76295, 76296, 76297, 76298, 76299, 76300, 76301, 
+    76302, 76303, 76304, 76305, 76306, 76307, 76308, 76309, 76310, 76311, 
+    76312, 76313, 76314, 76315, 76316, 76317, 76318, 76319, 76320, 76321, 
+    76322, 76323, 76324, 76325, 76326, 76327, 76328, 76329, 76330, 76331, 
+    76332, 76333, 76334, 76335, 76336, 76337, 76338, 76339, 76340, 76341, 
+    76342, 76343, 76344, 76345, 76346, 76347, 76348, 76349, 76350, 76351, 
+    76352, 76353, 76354, 76355, 76356, 76357, 76358, 76359, 76360, 76361, 
+    76362, 76363, 76364, 76365, 76366, 76367, 76368, 76369, 76370, 76371, 
+    76372, 76373, 76374, 76375, 76376, 76377, 76378, 76379, 76380, 76381, 
+    76382, 76383, 76384, 76385, 76386, 76387, 76388, 76389, 76390, 76391, 
+    76392, 76393, 76394, 76395, 76396, 76397, 76398, 76399, 76400, 76401, 
+    76402, 76403, 76404, 76405, 76406, 76407, 76408, 76409, 76410, 76411, 
+    76412, 76413, 76414, 76415, 76416, 76417, 76418, 76419, 76420, 76421, 
+    76422, 76423, 76424, 76425, 76426, 76427, 76428, 76429, 76430, 76431, 
+    76432, 76433, 76434, 76435, 76436, 76437, 76438, 76439, 76440, 76441, 
+    76442, 76443, 76444, 76445, 76446, 76447, 76448, 76449, 76450, 76451, 
+    76452, 76453, 76454, 76455, 76456, 76457, 76458, 76459, 76460, 76461, 
+    76462, 76463, 76464, 76465, 76466, 76467, 76468, 76469, 76470, 76471, 
+    76472, 76473, 76474, 76475, 76476, 76477, 76478, 76479, 76480, 76481, 
+    76482, 76483, 76484, 76485, 76486, 76487, 76488, 76489, 76490, 76491, 
+    76492, 76493, 76494, 76495, 76496, 76497, 76498, 76499, 76500, 76501, 
+    76502, 76503, 76504, 76505, 76506, 76507, 76508, 76509, 76510, 76511, 
+    76512, 76513, 76514, 76515, 76516, 76517, 76518, 76519, 76520, 76521, 
+    76522, 76523, 76524, 76525, 76526, 76527, 76528, 76529, 76530, 76531, 
+    76532, 76533, 76534, 76535, 76536, 76537, 76538, 76539, 76540, 76541, 
+    76542, 76543, 76544, 76545, 76546, 76547, 76548, 76549, 76550, 76551, 
+    76552, 76553, 76554, 76555, 76556, 76557, 76558, 76559, 76560, 76561, 
+    76562, 76563, 76564, 76565, 76566, 76567, 76568, 76569, 76570, 76571, 
+    76572, 76573, 76574, 76575, 76576, 76577, 76578, 76579, 76580, 76581, 
+    76582, 76583, 76584, 76585, 76586, 76587, 76588, 76589, 76590, 76591, 
+    76592, 76593, 76594, 76595, 76596, 76597, 76598, 76599, 76600, 76601, 
+    76602, 76603, 76604, 76605, 76606, 76607, 76608, 76609, 76610, 76611, 
+    76612, 76613, 76614, 76615, 76616, 76617, 76618, 76619, 76620, 76621, 
+    76622, 76623, 76624, 76625, 76626, 76627, 76628, 76629, 76630, 76631, 
+    76632, 76633, 76634, 76635, 76636, 76637, 76638, 76639, 76640, 76641, 
+    76642, 76643, 76644, 76645, 76646, 76647, 76648, 76649, 76650, 76651, 
+    76652, 76653, 76654, 76655, 76656, 76657, 76658, 76659, 76660, 76661, 
+    76662, 76663, 76664, 76665, 76666, 76667, 76668, 76669, 76670, 76671, 
+    76672, 76673, 76674, 76675, 76676, 76677, 76678, 76679, 76680, 76681, 
+    76682, 76683, 76684, 76685, 76686, 76687, 76688, 76689, 76690, 76691, 
+    76692, 76693, 76694, 76695, 76696, 76697, 76698, 76699, 76700, 76701, 
+    76702, 76703, 76704, 76705, 76706, 76707, 76708, 76709, 76710, 76711, 
+    76712, 76713, 76714, 76715, 76716, 76717, 76718, 76719, 76720, 76721, 
+    76722, 76723, 76724, 76725, 76726, 76727, 76728, 76729, 76730, 76731, 
+    76732, 76733, 76734, 76735, 76736, 76737, 76738, 76739, 76740, 76741, 
+    76742, 76743, 76744, 76745, 76746, 76747, 76748, 76749, 76750, 76751, 
+    76752, 76753, 76754, 76755, 76756, 76757, 76758, 76759, 76760, 76761, 
+    76762, 76763, 76764, 76765, 76766, 76767, 76768, 76769, 76770, 76771, 
+    76772, 76773, 76774, 76775, 76776, 76777, 76778, 76779, 76780, 76781, 
+    76782, 76783, 76784, 76785, 76786, 76787, 76788, 76789, 76790, 76791, 
+    76792, 76793, 76794, 76795, 76796, 76797, 76798, 76799, 76800, 76801, 
+    76802, 76803, 76804, 76805, 76806, 76807, 76808, 76809, 76810, 76811, 
+    76812, 76813, 76814, 76815, 76816, 76817, 76818, 76819, 76820, 76821, 
+    76822, 76823, 76824, 76825, 76826, 76827, 76828, 76829, 76830, 76831, 
+    76832, 76833, 76834, 76835, 76836, 76837, 76838, 76839, 76840, 76841, 
+    76842, 76843, 76844, 76845, 76846, 76847, 76848, 76849, 76850, 76851, 
+    76852, 76853, 76854, 76855, 76856, 76857, 76858, 76859, 76860, 76861, 
+    76862, 76863, 76864, 76865, 76866, 76867, 76868, 76869, 76870, 76871, 
+    76872, 76873, 76874, 76875, 76876, 76877, 76878, 76879, 76880, 76881, 
+    76882, 76883, 76884, 76885, 76886, 76887, 76888, 76889, 76890, 76891, 
+    76892, 76893, 76894, 76895, 76896, 76897, 76898, 76899, 76900, 76901, 
+    76902, 76903, 76904, 76905, 76906, 76907, 76908, 76909, 76910, 76911, 
+    76912, 76913, 76914, 76915, 76916, 76917, 76918, 76919, 76920, 76921, 
+    76922, 76923, 76924, 76925, 76926, 76927, 76928, 76929, 76930, 76931, 
+    76932, 76933, 76934, 76935, 76936, 76937, 76938, 76939, 76940, 76941, 
+    76942, 76943, 76944, 76945, 76946, 76947, 76948, 76949, 76950, 76951, 
+    76952, 76953, 76954, 76955, 76956, 76957, 76958, 76959, 76960, 76961, 
+    76962, 76963, 76964, 76965, 76966, 76967, 76968, 76969, 76970, 76971, 
+    76972, 76973, 76974, 76975, 76976, 76977, 76978, 76979, 76980, 76981, 
+    76982, 76983, 76984, 76985, 76986, 76987, 76988, 76989, 76990, 76991, 
+    76992, 76993, 76994, 76995, 76996, 76997, 76998, 76999, 77000, 77001, 
+    77002, 77003, 77004, 77005, 77006, 77007, 77008, 77009, 77010, 77011, 
+    77012, 77013, 77014, 77015, 77016, 77017, 77018, 77019, 77020, 77021, 
+    77022, 77023, 77024, 77025, 77026, 77027, 77028, 77029, 77030, 77031, 
+    77032, 77033, 77034, 77035, 77036, 77037, 77038, 77039, 77040, 77041, 
+    77042, 77043, 77044, 77045, 77046, 77047, 77048, 77049, 77050, 77051, 
+    77052, 77053, 77054, 77055, 77056, 77057, 77058, 77059, 77060, 77061, 
+    77062, 77063, 77064, 77065, 77066, 77067, 77068, 77069, 77070, 77071, 
+    77072, 77073, 77074, 77075, 77076, 77077, 77078, 77079, 77080, 77081, 
+    77082, 77083, 77084, 77085, 77086, 77087, 77088, 77089, 77090, 77091, 
+    77092, 77093, 77094, 77095, 77096, 77097, 77098, 77099, 77100, 77101, 
+    77102, 77103, 77104, 77105, 77106, 77107, 77108, 77109, 77110, 77111, 
+    77112, 77113, 77114, 77115, 77116, 77117, 77118, 77119, 77120, 77121, 
+    77122, 77123, 77124, 77125, 77126, 77127, 77128, 77129, 77130, 77131, 
+    77132, 77133, 77134, 77135, 77136, 77137, 77138, 77139, 77140, 77141, 
+    77142, 77143, 77144, 77145, 77146, 77147, 77148, 77149, 77150, 77151, 
+    77152, 77153, 77154, 77155, 77156, 77157, 77158, 77159, 77160, 77161, 
+    77162, 77163, 77164, 77165, 77166, 77167, 77168, 77169, 77170, 77171, 
+    77172, 77173, 77174, 77175, 77176, 77177, 77178, 77179, 77180, 77181, 
+    77182, 77183, 77184, 77185, 77186, 77187, 77188, 77189, 77190, 77191, 
+    77192, 77193, 77194, 77195, 77196, 77197, 77198, 77199, 77200, 77201, 
+    77202, 77203, 77204, 77205, 77206, 77207, 77208, 77209, 77210, 77211, 
+    77212, 77213, 77214, 77215, 77216, 77217, 77218, 77219, 77220, 77221, 
+    77222, 77223, 77224, 77225, 77226, 77227, 77228, 77229, 77230, 77231, 
+    77232, 77233, 77234, 77235, 77236, 77237, 77238, 77239, 77240, 77241, 
+    77242, 77243, 77244, 77245, 77246, 77247, 77248, 77249, 77250, 77251, 
+    77252, 77253, 77254, 77255, 77256, 77257, 77258, 77259, 77260, 77261, 
+    77262, 77263, 77264, 77265, 77266, 77267, 77268, 77269, 77270, 77271, 
+    77272, 77273, 77274, 77275, 77276, 77277, 77278, 77279, 77280, 77281, 
+    77282, 77283, 77284, 77285, 77286, 77287, 77288, 77289, 77290, 77291, 
+    77292, 77293, 77294, 77295, 77296, 77297, 77298, 77299, 77300, 77301, 
+    77302, 77303, 77304, 77305, 77306, 77307, 77308, 77309, 77310, 77311, 
+    77312, 77313, 77314, 77315, 77316, 77317, 77318, 77319, 77320, 77321, 
+    77322, 77323, 77324, 77325, 77326, 77327, 77328, 77329, 77330, 77331, 
+    77332, 77333, 77334, 77335, 77336, 77337, 77338, 77339, 77340, 77341, 
+    77342, 77343, 77344, 77345, 77346, 77347, 77348, 77349, 77350, 77351, 
+    77352, 77353, 77354, 77355, 77356, 77357, 77358, 77359, 77360, 77361, 
+    77362, 77363, 77364, 77365, 77366, 77367, 77368, 77369, 77370, 77371, 
+    77372, 77373, 77374, 77375, 77376, 77377, 77378, 77379, 77380, 77381, 
+    77382, 77383, 77384, 77385, 77386, 77387, 77388, 77389, 77390, 77391, 
+    77392, 77393, 77394, 77395, 77396, 77397, 77398, 77399, 77400, 77401, 
+    77402, 77403, 77404, 77405, 77406, 77407, 77408, 77409, 77410, 77411, 
+    77412, 77413, 77414, 77415, 77416, 77417, 77418, 77419, 77420, 77421, 
+    77422, 77423, 77424, 77425, 77426, 77427, 77428, 77429, 77430, 77431, 
+    77432, 77433, 77434, 77435, 77436, 77437, 77438, 77439, 77440, 77441, 
+    77442, 77443, 77444, 77445, 77446, 77447, 77448, 77449, 77450, 77451, 
+    77452, 77453, 77454, 77455, 77456, 77457, 77458, 77459, 77460, 77461, 
+    77462, 77463, 77464, 77465, 77466, 77467, 77468, 77469, 77470, 77471, 
+    77472, 77473, 77474, 77475, 77476, 77477, 77478, 77479, 77480, 77481, 
+    77482, 77483, 77484, 77485, 77486, 77487, 77488, 77489, 77490, 77491, 
+    77492, 77493, 77494, 77495, 77496, 77497, 77498, 77499, 77500, 77501, 
+    77502, 77503, 77504, 77505, 77506, 77507, 77508, 77509, 77510, 77511, 
+    77512, 77513, 77514, 77515, 77516, 77517, 77518, 77519, 77520, 77521, 
+    77522, 77523, 77524, 77525, 77526, 77527, 77528, 77529, 77530, 77531, 
+    77532, 77533, 77534, 77535, 77536, 77537, 77538, 77539, 77540, 77541, 
+    77542, 77543, 77544, 77545, 77546, 77547, 77548, 77549, 77550, 77551, 
+    77552, 77553, 77554, 77555, 77556, 77557, 77558, 77559, 77560, 77561, 
+    77562, 77563, 77564, 77565, 77566, 77567, 77568, 77569, 77570, 77571, 
+    77572, 77573, 77574, 77575, 77576, 77577, 77578, 77579, 77580, 77581, 
+    77582, 77583, 77584, 77585, 77586, 77587, 77588, 77589, 77590, 77591, 
+    77592, 77593, 77594, 77595, 77596, 77597, 77598, 77599, 77600, 77601, 
+    77602, 77603, 77604, 77605, 77606, 77607, 77608, 77609, 77610, 77611, 
+    77612, 77613, 77614, 77615, 77616, 77617, 77618, 77619, 77620, 77621, 
+    77622, 77623, 77624, 77625, 77626, 77627, 77628, 77629, 77630, 77631, 
+    77632, 77633, 77634, 77635, 77636, 77637, 77638, 77639, 77640, 77641, 
+    77642, 77643, 77644, 77645, 77646, 77647, 77648, 77649, 77650, 77651, 
+    77652, 77653, 77654, 77655, 77656, 77657, 77658, 77659, 77660, 77661, 
+    77662, 77663, 77664, 77665, 77666, 77667, 77668, 77669, 77670, 77671, 
+    77672, 77673, 77674, 77675, 77676, 77677, 77678, 77679, 77680, 77681, 
+    77682, 77683, 77684, 77685, 77686, 77687, 77688, 77689, 77690, 77691, 
+    77692, 77693, 77694, 77695, 77696, 77697, 77698, 77699, 77700, 77701, 
+    77702, 77703, 77704, 77705, 77706, 77707, 77708, 77709, 77710, 77711, 
+    77712, 77713, 77714, 77715, 77716, 77717, 77718, 77719, 77720, 77721, 
+    77722, 77723, 77724, 77725, 77726, 77727, 77728, 77729, 77730, 77731, 
+    77732, 77733, 77734, 77735, 77736, 77737, 77738, 77739, 77740, 77741, 
+    77742, 77743, 77744, 77745, 77746, 77747, 77748, 77749, 77750, 77751, 
+    77752, 77753, 77754, 77755, 77756, 77757, 77758, 77759, 77760, 77761, 
+    77762, 77763, 77764, 77765, 77766, 77767, 77768, 77769, 77770, 77771, 
+    77772, 77773, 77774, 77775, 77776, 77777, 77778, 77779, 77780, 77781, 
+    77782, 77783, 77784, 77785, 77786, 77787, 77788, 77789, 77790, 77791, 
+    77792, 77793, 77794, 77795, 77796, 77797, 77798, 77799, 77800, 77801, 
+    77802, 77803, 77804, 77805, 77806, 77807, 77808, 77809, 77810, 77811, 
+    77812, 77813, 77814, 77815, 77816, 77817, 77818, 77819, 77820, 77821, 
+    77822, 77823, 77824, 77825, 77826, 77827, 77828, 77829, 77830, 77831, 
+    77832, 77833, 77834, 77835, 77836, 77837, 77838, 77839, 77840, 77841, 
+    77842, 77843, 77844, 77845, 77846, 77847, 77848, 77849, 77850, 77851, 
+    77852, 77853, 77854, 77855, 77856, 77857, 77858, 77859, 77860, 77861, 
+    77862, 77863, 77864, 77865, 77866, 77867, 77868, 77869, 77870, 77871, 
+    77872, 77873, 77874, 77875, 77876, 77877, 77878, 77879, 77880, 77881, 
+    77882, 77883, 77884, 77885, 77886, 77887, 77888, 77889, 77890, 77891, 
+    77892, 77893, 77894, 77895, 77896, 77897, 77898, 77899, 77900, 77901, 
+    77902, 77903, 77904, 77905, 77906, 77907, 77908, 77909, 77910, 77911, 
+    77912, 77913, 77914, 77915, 77916, 77917, 77918, 77919, 77920, 77921, 
+    77922, 77923, 77924, 77925, 77926, 77927, 77928, 77929, 77930, 77931, 
+    77932, 77933, 77934, 77935, 77936, 77937, 77938, 77939, 77940, 77941, 
+    77942, 77943, 77944, 77945, 77946, 77947, 77948, 77949, 77950, 77951, 
+    77952, 77953, 77954, 77955, 77956, 77957, 77958, 77959, 77960, 77961, 
+    77962, 77963, 77964, 77965, 77966, 77967, 77968, 77969, 77970, 77971, 
+    77972, 77973, 77974, 77975, 77976, 77977, 77978, 77979, 77980, 77981, 
+    77982, 77983, 77984, 77985, 77986, 77987, 77988, 77989, 77990, 77991, 
+    77992, 77993, 77994, 77995, 77996, 77997, 77998, 77999, 78000, 78001, 
+    78002, 78003, 78004, 78005, 78006, 78007, 78008, 78009, 78010, 78011, 
+    78012, 78013, 78014, 78015, 78016, 78017, 78018, 78019, 78020, 78021, 
+    78022, 78023, 78024, 78025, 78026, 78027, 78028, 78029, 78030, 78031, 
+    78032, 78033, 78034, 78035, 78036, 78037, 78038, 78039, 78040, 78041, 
+    78042, 78043, 78044, 78045, 78046, 78047, 78048, 78049, 78050, 78051, 
+    78052, 78053, 78054, 78055, 78056, 78057, 78058, 78059, 78060, 78061, 
+    78062, 78063, 78064, 78065, 78066, 78067, 78068, 78069, 78070, 78071, 
+    78072, 78073, 78074, 78075, 78076, 78077, 78078, 78079, 78080, 78081, 
+    78082, 78083, 78084, 78085, 78086, 78087, 78088, 78089, 78090, 78091, 
+    78092, 78093, 78094, 78095, 78096, 78097, 78098, 78099, 78100, 78101, 
+    78102, 78103, 78104, 78105, 78106, 78107, 78108, 78109, 78110, 78111, 
+    78112, 78113, 78114, 78115, 78116, 78117, 78118, 78119, 78120, 78121, 
+    78122, 78123, 78124, 78125, 78126, 78127, 78128, 78129, 78130, 78131, 
+    78132, 78133, 78134, 78135, 78136, 78137, 78138, 78139, 78140, 78141, 
+    78142, 78143, 78144, 78145, 78146, 78147, 78148, 78149, 78150, 78151, 
+    78152, 78153, 78154, 78155, 78156, 78157, 78158, 78159, 78160, 78161, 
+    78162, 78163, 78164, 78165, 78166, 78167, 78168, 78169, 78170, 78171, 
+    78172, 78173, 78174, 78175, 78176, 78177, 78178, 78179, 78180, 78181, 
+    78182, 78183, 78184, 78185, 78186, 78187, 78188, 78189, 78190, 78191, 
+    78192, 78193, 78194, 78195, 78196, 78197, 78198, 78199, 78200, 78201, 
+    78202, 78203, 78204, 78205, 78206, 78207, 78208, 78209, 78210, 78211, 
+    78212, 78213, 78214, 78215, 78216, 78217, 78218, 78219, 78220, 78221, 
+    78222, 78223, 78224, 78225, 78226, 78227, 78228, 78229, 78230, 78231, 
+    78232, 78233, 78234, 78235, 78236, 78237, 78238, 78239, 78240, 78241, 
+    78242, 78243, 78244, 78245, 78246, 78247, 78248, 78249, 78250, 78251, 
+    78252, 78253, 78254, 78255, 78256, 78257, 78258, 78259, 78260, 78261, 
+    78262, 78263, 78264, 78265, 78266, 78267, 78268, 78269, 78270, 78271, 
+    78272, 78273, 78274, 78275, 78276, 78277, 78278, 78279, 78280, 78281, 
+    78282, 78283, 78284, 78285, 78286, 78287, 78288, 78289, 78290, 78291, 
+    78292, 78293, 78294, 78295, 78296, 78297, 78298, 78299, 78300, 78301, 
+    78302, 78303, 78304, 78305, 78306, 78307, 78308, 78309, 78310, 78311, 
+    78312, 78313, 78314, 78315, 78316, 78317, 78318, 78319, 78320, 78321, 
+    78322, 78323, 78324, 78325, 78326, 78327, 78328, 78329, 78330, 78331, 
+    78332, 78333, 78334, 78335, 78336, 78337, 78338, 78339, 78340, 78341, 
+    78342, 78343, 78344, 78345, 78346, 78347, 78348, 78349, 78350, 78351, 
+    78352, 78353, 78354, 78355, 78356, 78357, 78358, 78359, 78360, 78361, 
+    78362, 78363, 78364, 78365, 78366, 78367, 78368, 78369, 78370, 78371, 
+    78372, 78373, 78374, 78375, 78376, 78377, 78378, 78379, 78380, 78381, 
+    78382, 78383, 78384, 78385, 78386, 78387, 78388, 78389, 78390, 78391, 
+    78392, 78393, 78394, 78395, 78396, 78397, 78398, 78399, 78400, 78401, 
+    78402, 78403, 78404, 78405, 78406, 78407, 78408, 78409, 78410, 78411, 
+    78412, 78413, 78414, 78415, 78416, 78417, 78418, 78419, 78420, 78421, 
+    78422, 78423, 78424, 78425, 78426, 78427, 78428, 78429, 78430, 78431, 
+    78432, 78433, 78434, 78435, 78436, 78437, 78438, 78439, 78440, 78441, 
+    78442, 78443, 78444, 78445, 78446, 78447, 78448, 78449, 78450, 78451, 
+    78452, 78453, 78454, 78455, 78456, 78457, 78458, 78459, 78460, 78461, 
+    78462, 78463, 78464, 78465, 78466, 78467, 78468, 78469, 78470, 78471, 
+    78472, 78473, 78474, 78475, 78476, 78477, 78478, 78479, 78480, 78481, 
+    78482, 78483, 78484, 78485, 78486, 78487, 78488, 78489, 78490, 78491, 
+    78492, 78493, 78494, 78495, 78496, 78497, 78498, 78499, 78500, 78501, 
+    78502, 78503, 78504, 78505, 78506, 78507, 78508, 78509, 78510, 78511, 
+    78512, 78513, 78514, 78515, 78516, 78517, 78518, 78519, 78520, 78521, 
+    78522, 78523, 78524, 78525, 78526, 78527, 78528, 78529, 78530, 78531, 
+    78532, 78533, 78534, 78535, 78536, 78537, 78538, 78539, 78540, 78541, 
+    78542, 78543, 78544, 78545, 78546, 78547, 78548, 78549, 78550, 78551, 
+    78552, 78553, 78554, 78555, 78556, 78557, 78558, 78559, 78560, 78561, 
+    78562, 78563, 78564, 78565, 78566, 78567, 78568, 78569, 78570, 78571, 
+    78572, 78573, 78574, 78575, 78576, 78577, 78578, 78579, 78580, 78581, 
+    78582, 78583, 78584, 78585, 78586, 78587, 78588, 78589, 78590, 78591, 
+    78592, 78593, 78594, 78595, 78596, 78597, 78598, 78599, 78600, 78601, 
+    78602, 78603, 78604, 78605, 78606, 78607, 78608, 78609, 78610, 78611, 
+    78612, 78613, 78614, 78615, 78616, 78617, 78618, 78619, 78620, 78621, 
+    78622, 78623, 78624, 78625, 78626, 78627, 78628, 78629, 78630, 78631, 
+    78632, 78633, 78634, 78635, 78636, 78637, 78638, 78639, 78640, 78641, 
+    78642, 78643, 78644, 78645, 78646, 78647, 78648, 78649, 78650, 78651, 
+    78652, 78653, 78654, 78655, 78656, 78657, 78658, 78659, 78660, 78661, 
+    78662, 78663, 78664, 78665, 78666, 78667, 78668, 78669, 78670, 78671, 
+    78672, 78673, 78674, 78675, 78676, 78677, 78678, 78679, 78680, 78681, 
+    78682, 78683, 78684, 78685, 78686, 78687, 78688, 78689, 78690, 78691, 
+    78692, 78693, 78694, 78695, 78696, 78697, 78698, 78699, 78700, 78701, 
+    78702, 78703, 78704, 78705, 78706, 78707, 78708, 78709, 78710, 78711, 
+    78712, 78713, 78714, 78715, 78716, 78717, 78718, 78719, 78720, 78721, 
+    78722, 78723, 78724, 78725, 78726, 78727, 78728, 78729, 78730, 78731, 
+    78732, 78733, 78734, 78735, 78736, 78737, 78738, 78739, 78740, 78741, 
+    78742, 78743, 78744, 78745, 78746, 78747, 78748, 78749, 78750, 78751, 
+    78752, 78753, 78754, 78755, 78756, 78757, 78758, 78759, 78760, 78761, 
+    78762, 78763, 78764, 78765, 78766, 78767, 78768, 78769, 78770, 78771, 
+    78772, 78773, 78774, 78775, 78776, 78777, 78778, 78779, 78780, 78781, 
+    78782, 78783, 78784, 78785, 78786, 78787, 78788, 78789, 78790, 78791, 
+    78792, 78793, 78794, 78795, 78796, 78797, 78798, 78799, 78800, 78801, 
+    78802, 78803, 78804, 78805, 78806, 78807, 78808, 78809, 78810, 78811, 
+    78812, 78813, 78814, 78815, 78816, 78817, 78818, 78819, 78820, 78821, 
+    78822, 78823, 78824, 78825, 78826, 78827, 78828, 78829, 78830, 78831, 
+    78832, 78833, 78834, 78835, 78836, 78837, 78838, 78839, 78840, 78841, 
+    78842, 78843, 78844, 78845, 78846, 78847, 78848, 78849, 78850, 78851, 
+    78852, 78853, 78854, 78855, 78856, 78857, 78858, 78859, 78860, 78861, 
+    78862, 78863, 78864, 78865, 78866, 78867, 78868, 78869, 78870, 78871, 
+    78872, 78873, 78874, 78875, 78876, 78877, 78878, 78879, 78880, 78881, 
+    78882, 78883, 78884, 78885, 78886, 78887, 78888, 78889, 78890, 78891, 
+    78892, 78893, 78894, 78895, 78896, 78897, 78898, 78899, 78900, 78901, 
+    78902, 78903, 78904, 78905, 78906, 78907, 78908, 78909, 78910, 78911, 
+    78912, 78913, 78914, 78915, 78916, 78917, 78918, 78919, 78920, 78921, 
+    78922, 78923, 78924, 78925, 78926, 78927, 78928, 78929, 78930, 78931, 
+    78932, 78933, 78934, 78935, 78936, 78937, 78938, 78939, 78940, 78941, 
+    78942, 78943, 78944, 78945, 78946, 78947, 78948, 78949, 78950, 78951, 
+    78952, 78953, 78954, 78955, 78956, 78957, 78958, 78959, 78960, 78961, 
+    78962, 78963, 78964, 78965, 78966, 78967, 78968, 78969, 78970, 78971, 
+    78972, 78973, 78974, 78975, 78976, 78977, 78978, 78979, 78980, 78981, 
+    78982, 78983, 78984, 78985, 78986, 78987, 78988, 78989, 78990, 78991, 
+    78992, 78993, 78994, 78995, 78996, 78997, 78998, 78999, 79000, 79001, 
+    79002, 79003, 79004, 79005, 79006, 79007, 79008, 79009, 79010, 79011, 
+    79012, 79013, 79014, 79015, 79016, 79017, 79018, 79019, 79020, 79021, 
+    79022, 79023, 79024, 79025, 79026, 79027, 79028, 79029, 79030, 79031, 
+    79032, 79033, 79034, 79035, 79036, 79037, 79038, 79039, 79040, 79041, 
+    79042, 79043, 79044, 79045, 79046, 79047, 79048, 79049, 79050, 79051, 
+    79052, 79053, 79054, 79055, 79056, 79057, 79058, 79059, 79060, 79061, 
+    79062, 79063, 79064, 79065, 79066, 79067, 79068, 79069, 79070, 79071, 
+    79072, 79073, 79074, 79075, 79076, 79077, 79078, 79079, 79080, 79081, 
+    79082, 79083, 79084, 79085, 79086, 79087, 79088, 79089, 79090, 79091, 
+    79092, 79093, 79094, 79095, 79096, 79097, 79098, 79099, 79100, 79101, 
+    79102, 79103, 79104, 79105, 79106, 79107, 79108, 79109, 79110, 79111, 
+    79112, 79113, 79114, 79115, 79116, 79117, 79118, 79119, 79120, 79121, 
+    79122, 79123, 79124, 79125, 79126, 79127, 79128, 79129, 79130, 79131, 
+    79132, 79133, 79134, 79135, 79136, 79137, 79138, 79139, 79140, 79141, 
+    79142, 79143, 79144, 79145, 79146, 79147, 79148, 79149, 79150, 79151, 
+    79152, 79153, 79154, 79155, 79156, 79157, 79158, 79159, 79160, 79161, 
+    79162, 79163, 79164, 79165, 79166, 79167, 79168, 79169, 79170, 79171, 
+    79172, 79173, 79174, 79175, 79176, 79177, 79178, 79179, 79180, 79181, 
+    79182, 79183, 79184, 79185, 79186, 79187, 79188, 79189, 79190, 79191, 
+    79192, 79193, 79194, 79195, 79196, 79197, 79198, 79199, 79200, 79201, 
+    79202, 79203, 79204, 79205, 79206, 79207, 79208, 79209, 79210, 79211, 
+    79212, 79213, 79214, 79215, 79216, 79217, 79218, 79219, 79220, 79221, 
+    79222, 79223, 79224, 79225, 79226, 79227, 79228, 79229, 79230, 79231, 
+    79232, 79233, 79234, 79235, 79236, 79237, 79238, 79239, 79240, 79241, 
+    79242, 79243, 79244, 79245, 79246, 79247, 79248, 79249, 79250, 79251, 
+    79252, 79253, 79254, 79255, 79256, 79257, 79258, 79259, 79260, 79261, 
+    79262, 79263, 79264, 79265, 79266, 79267, 79268, 79269, 79270, 79271, 
+    79272, 79273, 79274, 79275, 79276, 79277, 79278, 79279, 79280, 79281, 
+    79282, 79283, 79284, 79285, 79286, 79287, 79288, 79289, 79290, 79291, 
+    79292, 79293, 79294, 79295, 79296, 79297, 79298, 79299, 79300, 79301, 
+    79302, 79303, 79304, 79305, 79306, 79307, 79308, 79309, 79310, 79311, 
+    79312, 79313, 79314, 79315, 79316, 79317, 79318, 79319, 79320, 79321, 
+    79322, 79323, 79324, 79325, 79326, 79327, 79328, 79329, 79330, 79331, 
+    79332, 79333, 79334, 79335, 79336, 79337, 79338, 79339, 79340, 79341, 
+    79342, 79343, 79344, 79345, 79346, 79347, 79348, 79349, 79350, 79351, 
+    79352, 79353, 79354, 79355, 79356, 79357, 79358, 79359, 79360, 79361, 
+    79362, 79363, 79364, 79365, 79366, 79367, 79368, 79369, 79370, 79371, 
+    79372, 79373, 79374, 79375, 79376, 79377, 79378, 79379, 79380, 79381, 
+    79382, 79383, 79384, 79385, 79386, 79387, 79388, 79389, 79390, 79391, 
+    79392, 79393, 79394, 79395, 79396, 79397, 79398, 79399, 79400, 79401, 
+    79402, 79403, 79404, 79405, 79406, 79407, 79408, 79409, 79410, 79411, 
+    79412, 79413, 79414, 79415, 79416, 79417, 79418, 79419, 79420, 79421, 
+    79422, 79423, 79424, 79425, 79426, 79427, 79428, 79429, 79430, 79431, 
+    79432, 79433, 79434, 79435, 79436, 79437, 79438, 79439, 79440, 79441, 
+    79442, 79443, 79444, 79445, 79446, 79447, 79448, 79449, 79450, 79451, 
+    79452, 79453, 79454, 79455, 79456, 79457, 79458, 79459, 79460, 79461, 
+    79462, 79463, 79464, 79465, 79466, 79467, 79468, 79469, 79470, 79471, 
+    79472, 79473, 79474, 79475, 79476, 79477, 79478, 79479, 79480, 79481, 
+    79482, 79483, 79484, 79485, 79486, 79487, 79488, 79489, 79490, 79491, 
+    79492, 79493, 79494, 79495, 79496, 79497, 79498, 79499, 79500, 79501, 
+    79502, 79503, 79504, 79505, 79506, 79507, 79508, 79509, 79510, 79511, 
+    79512, 79513, 79514, 79515, 79516, 79517, 79518, 79519, 79520, 79521, 
+    79522, 79523, 79524, 79525, 79526, 79527, 79528, 79529, 79530, 79531, 
+    79532, 79533, 79534, 79535, 79536, 79537, 79538, 79539, 79540, 79541, 
+    79542, 79543, 79544, 79545, 79546, 79547, 79548, 79549, 79550, 79551, 
+    79552, 79553, 79554, 79555, 79556, 79557, 79558, 79559, 79560, 79561, 
+    79562, 79563, 79564, 79565, 79566, 79567, 79568, 79569, 79570, 79571, 
+    79572, 79573, 79574, 79575, 79576, 79577, 79578, 79579, 79580, 79581, 
+    79582, 79583, 79584, 79585, 79586, 79587, 79588, 79589, 79590, 79591, 
+    79592, 79593, 79594, 79595, 79596, 79597, 79598, 79599, 79600, 79601, 
+    79602, 79603, 79604, 79605, 79606, 79607, 79608, 79609, 79610, 79611, 
+    79612, 79613, 79614, 79615, 79616, 79617, 79618, 79619, 79620, 79621, 
+    79622, 79623, 79624, 79625, 79626, 79627, 79628, 79629, 79630, 79631, 
+    79632, 79633, 79634, 79635, 79636, 79637, 79638, 79639, 79640, 79641, 
+    79642, 79643, 79644, 79645, 79646, 79647, 79648, 79649, 79650, 79651, 
+    79652, 79653, 79654, 79655, 79656, 79657, 79658, 79659, 79660, 79661, 
+    79662, 79663, 79664, 79665, 79666, 79667, 79668, 79669, 79670, 79671, 
+    79672, 79673, 79674, 79675, 79676, 79677, 79678, 79679, 79680, 79681, 
+    79682, 79683, 79684, 79685, 79686, 79687, 79688, 79689, 79690, 79691, 
+    79692, 79693, 79694, 79695, 79696, 79697, 79698, 79699, 79700, 79701, 
+    79702, 79703, 79704, 79705, 79706, 79707, 79708, 79709, 79710, 79711, 
+    79712, 79713, 79714, 79715, 79716, 79717, 79718, 79719, 79720, 79721, 
+    79722, 79723, 79724, 79725, 79726, 79727, 79728, 79729, 79730, 79731, 
+    79732, 79733, 79734, 79735, 79736, 79737, 79738, 79739, 79740, 79741, 
+    79742, 79743, 79744, 79745, 79746, 79747, 79748, 79749, 79750, 79751, 
+    79752, 79753, 79754, 79755, 79756, 79757, 79758, 79759, 79760, 79761, 
+    79762, 79763, 79764, 79765, 79766, 79767, 79768, 79769, 79770, 79771, 
+    79772, 79773, 79774, 79775, 79776, 79777, 79778, 79779, 79780, 79781, 
+    79782, 79783, 79784, 79785, 79786, 79787, 79788, 79789, 79790, 79791, 
+    79792, 79793, 79794, 79795, 79796, 79797, 79798, 79799, 79800, 79801, 
+    79802, 79803, 79804, 79805, 79806, 79807, 79808, 79809, 79810, 79811, 
+    79812, 79813, 79814, 79815, 79816, 79817, 79818, 79819, 79820, 79821, 
+    79822, 79823, 79824, 79825, 79826, 79827, 79828, 79829, 79830, 79831, 
+    79832, 79833, 79834, 79835, 79836, 79837, 79838, 79839, 79840, 79841, 
+    79842, 79843, 79844, 79845, 79846, 79847, 79848, 79849, 79850, 79851, 
+    79852, 79853, 79854, 79855, 79856, 79857, 79858, 79859, 79860, 79861, 
+    79862, 79863, 79864, 79865, 79866, 79867, 79868, 79869, 79870, 79871, 
+    79872, 79873, 79874, 79875, 79876, 79877, 79878, 79879, 79880, 79881, 
+    79882, 79883, 79884, 79885, 79886, 79887, 79888, 79889, 79890, 79891, 
+    79892, 79893, 79894, 79895, 79896, 79897, 79898, 79899, 79900, 79901, 
+    79902, 79903, 79904, 79905, 79906, 79907, 79908, 79909, 79910, 79911, 
+    79912, 79913, 79914, 79915, 79916, 79917, 79918, 79919, 79920, 79921, 
+    79922, 79923, 79924, 79925, 79926, 79927, 79928, 79929, 79930, 79931, 
+    79932, 79933, 79934, 79935, 79936, 79937, 79938, 79939, 79940, 79941, 
+    79942, 79943, 79944, 79945, 79946, 79947, 79948, 79949, 79950, 79951, 
+    79952, 79953, 79954, 79955, 79956, 79957, 79958, 79959, 79960, 79961, 
+    79962, 79963, 79964, 79965, 79966, 79967, 79968, 79969, 79970, 79971, 
+    79972, 79973, 79974, 79975, 79976, 79977, 79978, 79979, 79980, 79981, 
+    79982, 79983, 79984, 79985, 79986, 79987, 79988, 79989, 79990, 79991, 
+    79992, 79993, 79994, 79995, 79996, 79997, 79998, 79999, 80000, 80001, 
+    80002, 80003, 80004, 80005, 80006, 80007, 80008, 80009, 80010, 80011, 
+    80012, 80013, 80014, 80015, 80016, 80017, 80018, 80019, 80020, 80021, 
+    80022, 80023, 80024, 80025, 80026, 80027, 80028, 80029, 80030, 80031, 
+    80032, 80033, 80034, 80035, 80036, 80037, 80038, 80039, 80040, 80041, 
+    80042, 80043, 80044, 80045, 80046, 80047, 80048, 80049, 80050, 80051, 
+    80052, 80053, 80054, 80055, 80056, 80057, 80058, 80059, 80060, 80061, 
+    80062, 80063, 80064, 80065, 80066, 80067, 80068, 80069, 80070, 80071, 
+    80072, 80073, 80074, 80075, 80076, 80077, 80078, 80079, 80080, 80081, 
+    80082, 80083, 80084, 80085, 80086, 80087, 80088, 80089, 80090, 80091, 
+    80092, 80093, 80094, 80095, 80096, 80097, 80098, 80099, 80100, 80101, 
+    80102, 80103, 80104, 80105, 80106, 80107, 80108, 80109, 80110, 80111, 
+    80112, 80113, 80114, 80115, 80116, 80117, 80118, 80119, 80120, 80121, 
+    80122, 80123, 80124, 80125, 80126, 80127, 80128, 80129, 80130, 80131, 
+    80132, 80133, 80134, 80135, 80136, 80137, 80138, 80139, 80140, 80141, 
+    80142, 80143, 80144, 80145, 80146, 80147, 80148, 80149, 80150, 80151, 
+    80152, 80153, 80154, 80155, 80156, 80157, 80158, 80159, 80160, 80161, 
+    80162, 80163, 80164, 80165, 80166, 80167, 80168, 80169, 80170, 80171, 
+    80172, 80173, 80174, 80175, 80176, 80177, 80178, 80179, 80180, 80181, 
+    80182, 80183, 80184, 80185, 80186, 80187, 80188, 80189, 80190, 80191, 
+    80192, 80193, 80194, 80195, 80196, 80197, 80198, 80199, 80200, 80201, 
+    80202, 80203, 80204, 80205, 80206, 80207, 80208, 80209, 80210, 80211, 
+    80212, 80213, 80214, 80215, 80216, 80217, 80218, 80219, 80220, 80221, 
+    80222, 80223, 80224, 80225, 80226, 80227, 80228, 80229, 80230, 80231, 
+    80232, 80233, 80234, 80235, 80236, 80237, 80238, 80239, 80240, 80241, 
+    80242, 80243, 80244, 80245, 80246, 80247, 80248, 80249, 80250, 80251, 
+    80252, 80253, 80254, 80255, 80256, 80257, 80258, 80259, 80260, 80261, 
+    80262, 80263, 80264, 80265, 80266, 80267, 80268, 80269, 80270, 80271, 
+    80272, 80273, 80274, 80275, 80276, 80277, 80278, 80279, 80280, 80281, 
+    80282, 80283, 80284, 80285, 80286, 80287, 80288, 80289, 80290, 80291, 
+    80292, 80293, 80294, 80295, 80296, 80297, 80298, 80299, 80300, 80301, 
+    80302, 80303, 80304, 80305, 80306, 80307, 80308, 80309, 80310, 80311, 
+    80312, 80313, 80314, 80315, 80316, 80317, 80318, 80319, 80320, 80321, 
+    80322, 80323, 80324, 80325, 80326, 80327, 80328, 80329, 80330, 80331, 
+    80332, 80333, 80334, 80335, 80336, 80337, 80338, 80339, 80340, 80341, 
+    80342, 80343, 80344, 80345, 80346, 80347, 80348, 80349, 80350, 80351, 
+    80352, 80353, 80354, 80355, 80356, 80357, 80358, 80359, 80360, 80361, 
+    80362, 80363, 80364, 80365, 80366, 80367, 80368, 80369, 80370, 80371, 
+    80372, 80373, 80374, 80375, 80376, 80377, 80378, 80379, 80380, 80381, 
+    80382, 80383, 80384, 80385, 80386, 80387, 80388, 80389, 80390, 80391, 
+    80392, 80393, 80394, 80395, 80396, 80397, 80398, 80399, 80400, 80401, 
+    80402, 80403, 80404, 80405, 80406, 80407, 80408, 80409, 80410, 80411, 
+    80412, 80413, 80414, 80415, 80416, 80417, 80418, 80419, 80420, 80421, 
+    80422, 80423, 80424, 80425, 80426, 80427, 80428, 80429, 80430, 80431, 
+    80432, 80433, 80434, 80435, 80436, 80437, 80438, 80439, 80440, 80441, 
+    80442, 80443, 80444, 80445, 80446, 80447, 80448, 80449, 80450, 80451, 
+    80452, 80453, 80454, 80455, 80456, 80457, 80458, 80459, 80460, 80461, 
+    80462, 80463, 80464, 80465, 80466, 80467, 80468, 80469, 80470, 80471, 
+    80472, 80473, 80474, 80475, 80476, 80477, 80478, 80479, 80480, 80481, 
+    80482, 80483, 80484, 80485, 80486, 80487, 80488, 80489, 80490, 80491, 
+    80492, 80493, 80494, 80495, 80496, 80497, 80498, 80499, 80500, 80501, 
+    80502, 80503, 80504, 80505, 80506, 80507, 80508, 80509, 80510, 80511, 
+    80512, 80513, 80514, 80515, 80516, 80517, 80518, 80519, 80520, 80521, 
+    80522, 80523, 80524, 80525, 80526, 80527, 80528, 80529, 80530, 80531, 
+    80532, 80533, 80534, 80535, 80536, 80537, 80538, 80539, 80540, 80541, 
+    80542, 80543, 80544, 80545, 80546, 80547, 80548, 80549, 80550, 80551, 
+    80552, 80553, 80554, 80555, 80556, 80557, 80558, 80559, 80560, 80561, 
+    80562, 80563, 80564, 80565, 80566, 80567, 80568, 80569, 80570, 80571, 
+    80572, 80573, 80574, 80575, 80576, 80577, 80578, 80579, 80580, 80581, 
+    80582, 80583, 80584, 80585, 80586, 80587, 80588, 80589, 80590, 80591, 
+    80592, 80593, 80594, 80595, 80596, 80597, 80598, 80599, 80600, 80601, 
+    80602, 80603, 80604, 80605, 80606, 80607, 80608, 80609, 80610, 80611, 
+    80612, 80613, 80614, 80615, 80616, 80617, 80618, 80619, 80620, 80621, 
+    80622, 80623, 80624, 80625, 80626, 80627, 80628, 80629, 80630, 80631, 
+    80632, 80633, 80634, 80635, 80636, 80637, 80638, 80639, 80640, 80641, 
+    80642, 80643, 80644, 80645, 80646, 80647, 80648, 80649, 80650, 80651, 
+    80652, 80653, 80654, 80655, 80656, 80657, 80658, 80659, 80660, 80661, 
+    80662, 80663, 80664, 80665, 80666, 80667, 80668, 80669, 80670, 80671, 
+    80672, 80673, 80674, 80675, 80676, 80677, 80678, 80679, 80680, 80681, 
+    80682, 80683, 80684, 80685, 80686, 80687, 80688, 80689, 80690, 80691, 
+    80692, 80693, 80694, 80695, 80696, 80697, 80698, 80699, 80700, 80701, 
+    80702, 80703, 80704, 80705, 80706, 80707, 80708, 80709, 80710, 80711, 
+    80712, 80713, 80714, 80715, 80716, 80717, 80718, 80719, 80720, 80721, 
+    80722, 80723, 80724, 80725, 80726, 80727, 80728, 80729, 80730, 80731, 
+    80732, 80733, 80734, 80735, 80736, 80737, 80738, 80739, 80740, 80741, 
+    80742, 80743, 80744, 80745, 80746, 80747, 80748, 80749, 80750, 80751, 
+    80752, 80753, 80754, 80755, 80756, 80757, 80758, 80759, 80760, 80761, 
+    80762, 80763, 80764, 80765, 80766, 80767, 80768, 80769, 80770, 80771, 
+    80772, 80773, 80774, 80775, 80776, 80777, 80778, 80779, 80780, 80781, 
+    80782, 80783, 80784, 80785, 80786, 80787, 80788, 80789, 80790, 80791, 
+    80792, 80793, 80794, 80795, 80796, 80797, 80798, 80799, 80800, 80801, 
+    80802, 80803, 80804, 80805, 80806, 80807, 80808, 80809, 80810, 80811, 
+    80812, 80813, 80814, 80815, 80816, 80817, 80818, 80819, 80820, 80821, 
+    80822, 80823, 80824, 80825, 80826, 80827, 80828, 80829, 80830, 80831, 
+    80832, 80833, 80834, 80835, 80836, 80837, 80838, 80839, 80840, 80841, 
+    80842, 80843, 80844, 80845, 80846, 80847, 80848, 80849, 80850, 80851, 
+    80852, 80853, 80854, 80855, 80856, 80857, 80858, 80859, 80860, 80861, 
+    80862, 80863, 80864, 80865, 80866, 80867, 80868, 80869, 80870, 80871, 
+    80872, 80873, 80874, 80875, 80876, 80877, 80878, 80879, 80880, 80881, 
+    80882, 80883, 80884, 80885, 80886, 80887, 80888, 80889, 80890, 80891, 
+    80892, 80893, 80894, 80895, 80896, 80897, 80898, 80899, 80900, 80901, 
+    80902, 80903, 80904, 80905, 80906, 80907, 80908, 80909, 80910, 80911, 
+    80912, 80913, 80914, 80915, 80916, 80917, 80918, 80919, 80920, 80921, 
+    80922, 80923, 80924, 80925, 80926, 80927, 80928, 80929, 80930, 80931, 
+    80932, 80933, 80934, 80935, 80936, 80937, 80938, 80939, 80940, 80941, 
+    80942, 80943, 80944, 80945, 80946, 80947, 80948, 80949, 80950, 80951, 
+    80952, 80953, 80954, 80955, 80956, 80957, 80958, 80959, 80960, 80961, 
+    80962, 80963, 80964, 80965, 80966, 80967, 80968, 80969, 80970, 80971, 
+    80972, 80973, 80974, 80975, 80976, 80977, 80978, 80979, 80980, 80981, 
+    80982, 80983, 80984, 80985, 80986, 80987, 80988, 80989, 80990, 80991, 
+    80992, 80993, 80994, 80995, 80996, 80997, 80998, 80999, 81000, 81001, 
+    81002, 81003, 81004, 81005, 81006, 81007, 81008, 81009, 81010, 81011, 
+    81012, 81013, 81014, 81015, 81016, 81017, 81018, 81019, 81020, 81021, 
+    81022, 81023, 81024, 81025, 81026, 81027, 81028, 81029, 81030, 81031, 
+    81032, 81033, 81034, 81035, 81036, 81037, 81038, 81039, 81040, 81041, 
+    81042, 81043, 81044, 81045, 81046, 81047, 81048, 81049, 81050, 81051, 
+    81052, 81053, 81054, 81055, 81056, 81057, 81058, 81059, 81060, 81061, 
+    81062, 81063, 81064, 81065, 81066, 81067, 81068, 81069, 81070, 81071, 
+    81072, 81073, 81074, 81075, 81076, 81077, 81078, 81079, 81080, 81081, 
+    81082, 81083, 81084, 81085, 81086, 81087, 81088, 81089, 81090, 81091, 
+    81092, 81093, 81094, 81095, 81096, 81097, 81098, 81099, 81100, 81101, 
+    81102, 81103, 81104, 81105, 81106, 81107, 81108, 81109, 81110, 81111, 
+    81112, 81113, 81114, 81115, 81116, 81117, 81118, 81119, 81120, 81121, 
+    81122, 81123, 81124, 81125, 81126, 81127, 81128, 81129, 81130, 81131, 
+    81132, 81133, 81134, 81135, 81136, 81137, 81138, 81139, 81140, 81141, 
+    81142, 81143, 81144, 81145, 81146, 81147, 81148, 81149, 81150, 81151, 
+    81152, 81153, 81154, 81155, 81156, 81157, 81158, 81159, 81160, 81161, 
+    81162, 81163, 81164, 81165, 81166, 81167, 81168, 81169, 81170, 81171, 
+    81172, 81173, 81174, 81175, 81176, 81177, 81178, 81179, 81180, 81181, 
+    81182, 81183, 81184, 81185, 81186, 81187, 81188, 81189, 81190, 81191, 
+    81192, 81193, 81194, 81195, 81196, 81197, 81198, 81199, 81200, 81201, 
+    81202, 81203, 81204, 81205, 81206, 81207, 81208, 81209, 81210, 81211, 
+    81212, 81213, 81214, 81215, 81216, 81217, 81218, 81219, 81220, 81221, 
+    81222, 81223, 81224, 81225, 81226, 81227, 81228, 81229, 81230, 81231, 
+    81232, 81233, 81234, 81235, 81236, 81237, 81238, 81239, 81240, 81241, 
+    81242, 81243, 81244, 81245, 81246, 81247, 81248, 81249, 81250, 81251, 
+    81252, 81253, 81254, 81255, 81256, 81257, 81258, 81259, 81260, 81261, 
+    81262, 81263, 81264, 81265, 81266, 81267, 81268, 81269, 81270, 81271, 
+    81272, 81273, 81274, 81275, 81276, 81277, 81278, 81279, 81280, 81281, 
+    81282, 81283, 81284, 81285, 81286, 81287, 81288, 81289, 81290, 81291, 
+    81292, 81293, 81294, 81295, 81296, 81297, 81298, 81299, 81300, 81301, 
+    81302, 81303, 81304, 81305, 81306, 81307, 81308, 81309, 81310, 81311, 
+    81312, 81313, 81314, 81315, 81316, 81317, 81318, 81319, 81320, 81321, 
+    81322, 81323, 81324, 81325, 81326, 81327, 81328, 81329, 81330, 81331, 
+    81332, 81333, 81334, 81335, 81336, 81337, 81338, 81339, 81340, 81341, 
+    81342, 81343, 81344, 81345, 81346, 81347, 81348, 81349, 81350, 81351, 
+    81352, 81353, 81354, 81355, 81356, 81357, 81358, 81359, 81360, 81361, 
+    81362, 81363, 81364, 81365, 81366, 81367, 81368, 81369, 81370, 81371, 
+    81372, 81373, 81374, 81375, 81376, 81377, 81378, 81379, 81380, 81381, 
+    81382, 81383, 81384, 81385, 81386, 81387, 81388, 81389, 81390, 81391, 
+    81392, 81393, 81394, 81395, 81396, 81397, 81398, 81399, 81400, 81401, 
+    81402, 81403, 81404, 81405, 81406, 81407, 81408, 81409, 81410, 81411, 
+    81412, 81413, 81414, 81415, 81416, 81417, 81418, 81419, 81420, 81421, 
+    81422, 81423, 81424, 81425, 81426, 81427, 81428, 81429, 81430, 81431, 
+    81432, 81433, 81434, 81435, 81436, 81437, 81438, 81439, 81440, 81441, 
+    81442, 81443, 81444, 81445, 81446, 81447, 81448, 81449, 81450, 81451, 
+    81452, 81453, 81454, 81455, 81456, 81457, 81458, 81459, 81460, 81461, 
+    81462, 81463, 81464, 81465, 81466, 81467, 81468, 81469, 81470, 81471, 
+    81472, 81473, 81474, 81475, 81476, 81477, 81478, 81479, 81480, 81481, 
+    81482, 81483, 81484, 81485, 81486, 81487, 81488, 81489, 81490, 81491, 
+    81492, 81493, 81494, 81495, 81496, 81497, 81498, 81499, 81500, 81501, 
+    81502, 81503, 81504, 81505, 81506, 81507, 81508, 81509, 81510, 81511, 
+    81512, 81513, 81514, 81515, 81516, 81517, 81518, 81519, 81520, 81521, 
+    81522, 81523, 81524, 81525, 81526, 81527, 81528, 81529, 81530, 81531, 
+    81532, 81533, 81534, 81535, 81536, 81537, 81538, 81539, 81540, 81541, 
+    81542, 81543, 81544, 81545, 81546, 81547, 81548, 81549, 81550, 81551, 
+    81552, 81553, 81554, 81555, 81556, 81557, 81558, 81559, 81560, 81561, 
+    81562, 81563, 81564, 81565, 81566, 81567, 81568, 81569, 81570, 81571, 
+    81572, 81573, 81574, 81575, 81576, 81577, 81578, 81579, 81580, 81581, 
+    81582, 81583, 81584, 81585, 81586, 81587, 81588, 81589, 81590, 81591, 
+    81592, 81593, 81594, 81595, 81596, 81597, 81598, 81599, 81600, 81601, 
+    81602, 81603, 81604, 81605, 81606, 81607, 81608, 81609, 81610, 81611, 
+    81612, 81613, 81614, 81615, 81616, 81617, 81618, 81619, 81620, 81621, 
+    81622, 81623, 81624, 81625, 81626, 81627, 81628, 81629, 81630, 81631, 
+    81632, 81633, 81634, 81635, 81636, 81637, 81638, 81639, 81640, 81641, 
+    81642, 81643, 81644, 81645, 81646, 81647, 81648, 81649, 81650, 81651, 
+    81652, 81653, 81654, 81655, 81656, 81657, 81658, 81659, 81660, 81661, 
+    81662, 81663, 81664, 81665, 81666, 81667, 81668, 81669, 81670, 81671, 
+    81672, 81673, 81674, 81675, 81676, 81677, 81678, 81679, 81680, 81681, 
+    81682, 81683, 81684, 81685, 81686, 81687, 81688, 81689, 81690, 81691, 
+    81692, 81693, 81694, 81695, 81696, 81697, 81698, 81699, 81700, 81701, 
+    81702, 81703, 81704, 81705, 81706, 81707, 81708, 81709, 81710, 81711, 
+    81712, 81713, 81714, 81715, 81716, 81717, 81718, 81719, 81720, 81721, 
+    81722, 81723, 81724, 81725, 81726, 81727, 81728, 81729, 81730, 81731, 
+    81732, 81733, 81734, 81735, 81736, 81737, 81738, 81739, 81740, 81741, 
+    81742, 81743, 81744, 81745, 81746, 81747, 81748, 81749, 81750, 81751, 
+    81752, 81753, 81754, 81755, 81756, 81757, 81758, 81759, 81760, 81761, 
+    81762, 81763, 81764, 81765, 81766, 81767, 81768, 81769, 81770, 81771, 
+    81772, 81773, 81774, 81775, 81776, 81777, 81778, 81779, 81780, 81781, 
+    81782, 81783, 81784, 81785, 81786, 81787, 81788, 81789, 81790, 81791, 
+    81792, 81793, 81794, 81795, 81796, 81797, 81798, 81799, 81800, 81801, 
+    81802, 81803, 81804, 81805, 81806, 81807, 81808, 81809, 81810, 81811, 
+    81812, 81813, 81814, 81815, 81816, 81817, 81818, 81819, 81820, 81821, 
+    81822, 81823, 81824, 81825, 81826, 81827, 81828, 81829, 81830, 81831, 
+    81832, 81833, 81834, 81835, 81836, 81837, 81838, 81839, 81840, 81841, 
+    81842, 81843, 81844, 81845, 81846, 81847, 81848, 81849, 81850, 81851, 
+    81852, 81853, 81854, 81855, 81856, 81857, 81858, 81859, 81860, 81861, 
+    81862, 81863, 81864, 81865, 81866, 81867, 81868, 81869, 81870, 81871, 
+    81872, 81873, 81874, 81875, 81876, 81877, 81878, 81879, 81880, 81881, 
+    81882, 81883, 81884, 81885, 81886, 81887, 81888, 81889, 81890, 81891, 
+    81892, 81893, 81894, 81895, 81896, 81897, 81898, 81899, 81900, 81901, 
+    81902, 81903, 81904, 81905, 81906, 81907, 81908, 81909, 81910, 81911, 
+    81912, 81913, 81914, 81915, 81916, 81917, 81918, 81919, 81920, 81921, 
+    81922, 81923, 81924, 81925, 81926, 81927, 81928, 81929, 81930, 81931, 
+    81932, 81933, 81934, 81935, 81936, 81937, 81938, 81939, 81940, 81941, 
+    81942, 81943, 81944, 81945, 81946, 81947, 81948, 81949, 81950, 81951, 
+    81952, 81953, 81954, 81955, 81956, 81957, 81958, 81959, 81960, 81961, 
+    81962, 81963, 81964, 81965, 81966, 81967, 81968, 81969, 81970, 81971, 
+    81972, 81973, 81974, 81975, 81976, 81977, 81978, 81979, 81980, 81981, 
+    81982, 81983, 81984, 81985, 81986, 81987, 81988, 81989, 81990, 81991, 
+    81992, 81993, 81994, 81995, 81996, 81997, 81998, 81999, 82000, 82001, 
+    82002, 82003, 82004, 82005, 82006, 82007, 82008, 82009, 82010, 82011, 
+    82012, 82013, 82014, 82015, 82016, 82017, 82018, 82019, 82020, 82021, 
+    82022, 82023, 82024, 82025, 82026, 82027, 82028, 82029, 82030, 82031, 
+    82032, 82033, 82034, 82035, 82036, 82037, 82038, 82039, 82040, 82041, 
+    82042, 82043, 82044, 82045, 82046, 82047, 82048, 82049, 82050, 82051, 
+    82052, 82053, 82054, 82055, 82056, 82057, 82058, 82059, 82060, 82061, 
+    82062, 82063, 82064, 82065, 82066, 82067, 82068, 82069, 82070, 82071, 
+    82072, 82073, 82074, 82075, 82076, 82077, 82078, 82079, 82080, 82081, 
+    82082, 82083, 82084, 82085, 82086, 82087, 82088, 82089, 82090, 82091, 
+    82092, 82093, 82094, 82095, 82096, 82097, 82098, 82099, 82100, 82101, 
+    82102, 82103, 82104, 82105, 82106, 82107, 82108, 82109, 82110, 82111, 
+    82112, 82113, 82114, 82115, 82116, 82117, 82118, 82119, 82120, 82121, 
+    82122, 82123, 82124, 82125, 82126, 82127, 82128, 82129, 82130, 82131, 
+    82132, 82133, 82134, 82135, 82136, 82137, 82138, 82139, 82140, 82141, 
+    82142, 82143, 82144, 82145, 82146, 82147, 82148, 82149, 82150, 82151, 
+    82152, 82153, 82154, 82155, 82156, 82157, 82158, 82159, 82160, 82161, 
+    82162, 82163, 82164, 82165, 82166, 82167, 82168, 82169, 82170, 82171, 
+    82172, 82173, 82174, 82175, 82176, 82177, 82178, 82179, 82180, 82181, 
+    82182, 82183, 82184, 82185, 82186, 82187, 82188, 82189, 82190, 82191, 
+    82192, 82193, 82194, 82195, 82196, 82197, 82198, 82199, 82200, 82201, 
+    82202, 82203, 82204, 82205, 82206, 82207, 82208, 82209, 82210, 82211, 
+    82212, 82213, 82214, 82215, 82216, 82217, 82218, 82219, 82220, 82221, 
+    82222, 82223, 82224, 82225, 82226, 82227, 82228, 82229, 82230, 82231, 
+    82232, 82233, 82234, 82235, 82236, 82237, 82238, 82239, 82240, 82241, 
+    82242, 82243, 82244, 82245, 82246, 82247, 82248, 82249, 82250, 82251, 
+    82252, 82253, 82254, 82255, 82256, 82257, 82258, 82259, 82260, 82261, 
+    82262, 82263, 82264, 82265, 82266, 82267, 82268, 82269, 82270, 82271, 
+    82272, 82273, 82274, 82275, 82276, 82277, 82278, 82279, 82280, 82281, 
+    82282, 82283, 82284, 82285, 82286, 82287, 82288, 82289, 82290, 82291, 
+    82292, 82293, 82294, 82295, 82296, 82297, 82298, 82299, 82300, 82301, 
+    82302, 82303, 82304, 82305, 82306, 82307, 82308, 82309, 82310, 82311, 
+    82312, 82313, 82314, 82315, 82316, 82317, 82318, 82319, 82320, 82321, 
+    82322, 82323, 82324, 82325, 82326, 82327, 82328, 82329, 82330, 82331, 
+    82332, 82333, 82334, 82335, 82336, 82337, 82338, 82339, 82340, 82341, 
+    82342, 82343, 82344, 82345, 82346, 82347, 82348, 82349, 82350, 82351, 
+    82352, 82353, 82354, 82355, 82356, 82357, 82358, 82359, 82360, 82361, 
+    82362, 82363, 82364, 82365, 82366, 82367, 82368, 82369, 82370, 82371, 
+    82372, 82373, 82374, 82375, 82376, 82377, 82378, 82379, 82380, 82381, 
+    82382, 82383, 82384, 82385, 82386, 82387, 82388, 82389, 82390, 82391, 
+    82392, 82393, 82394, 82395, 82396, 82397, 82398, 82399, 82400, 82401, 
+    82402, 82403, 82404, 82405, 82406, 82407, 82408, 82409, 82410, 82411, 
+    82412, 82413, 82414, 82415, 82416, 82417, 82418, 82419, 82420, 82421, 
+    82422, 82423, 82424, 82425, 82426, 82427, 82428, 82429, 82430, 82431, 
+    82432, 82433, 82434, 82435, 82436, 82437, 82438, 82439, 82440, 82441, 
+    82442, 82443, 82444, 82445, 82446, 82447, 82448, 82449, 82450, 82451, 
+    82452, 82453, 82454, 82455, 82456, 82457, 82458, 82459, 82460, 82461, 
+    82462, 82463, 82464, 82465, 82466, 82467, 82468, 82469, 82470, 82471, 
+    82472, 82473, 82474, 82475, 82476, 82477, 82478, 82479, 82480, 82481, 
+    82482, 82483, 82484, 82485, 82486, 82487, 82488, 82489, 82490, 82491, 
+    82492, 82493, 82494, 82495, 82496, 82497, 82498, 82499, 82500, 82501, 
+    82502, 82503, 82504, 82505, 82506, 82507, 82508, 82509, 82510, 82511, 
+    82512, 82513, 82514, 82515, 82516, 82517, 82518, 82519, 82520, 82521, 
+    82522, 82523, 82524, 82525, 82526, 82527, 82528, 82529, 82530, 82531, 
+    82532, 82533, 82534, 82535, 82536, 82537, 82538, 82539, 82540, 82541, 
+    82542, 82543, 82544, 82545, 82546, 82547, 82548, 82549, 82550, 82551, 
+    82552, 82553, 82554, 82555, 82556, 82557, 82558, 82559, 82560, 82561, 
+    82562, 82563, 82564, 82565, 82566, 82567, 82568, 82569, 82570, 82571, 
+    82572, 82573, 82574, 82575, 82576, 82577, 82578, 82579, 82580, 82581, 
+    82582, 82583, 82584, 82585, 82586, 82587, 82588, 82589, 82590, 82591, 
+    82592, 82593, 82594, 82595, 82596, 82597, 82598, 82599, 82600, 82601, 
+    82602, 82603, 82604, 82605, 82606, 82607, 82608, 82609, 82610, 82611, 
+    82612, 82613, 82614, 82615, 82616, 82617, 82618, 82619, 82620, 82621, 
+    82622, 82623, 82624, 82625, 82626, 82627, 82628, 82629, 82630, 82631, 
+    82632, 82633, 82634, 82635, 82636, 82637, 82638, 82639, 82640, 82641, 
+    82642, 82643, 82644, 82645, 82646, 82647, 82648, 82649, 82650, 82651, 
+    82652, 82653, 82654, 82655, 82656, 82657, 82658, 82659, 82660, 82661, 
+    82662, 82663, 82664, 82665, 82666, 82667, 82668, 82669, 82670, 82671, 
+    82672, 82673, 82674, 82675, 82676, 82677, 82678, 82679, 82680, 82681, 
+    82682, 82683, 82684, 82685, 82686, 82687, 82688, 82689, 82690, 82691, 
+    82692, 82693, 82694, 82695, 82696, 82697, 82698, 82699, 82700, 82701, 
+    82702, 82703, 82704, 82705, 82706, 82707, 82708, 82709, 82710, 82711, 
+    82712, 82713, 82714, 82715, 82716, 82717, 82718, 82719, 82720, 82721, 
+    82722, 82723, 82724, 82725, 82726, 82727, 82728, 82729, 82730, 82731, 
+    82732, 82733, 82734, 82735, 82736, 82737, 82738, 82739, 82740, 82741, 
+    82742, 82743, 82744, 82745, 82746, 82747, 82748, 82749, 82750, 82751, 
+    82752, 82753, 82754, 82755, 82756, 82757, 82758, 82759, 82760, 82761, 
+    82762, 82763, 82764, 82765, 82766, 82767, 82768, 82769, 82770, 82771, 
+    82772, 82773, 82774, 82775, 82776, 82777, 82778, 82779, 82780, 82781, 
+    82782, 82783, 82784, 82785, 82786, 82787, 82788, 82789, 82790, 82791, 
+    82792, 82793, 82794, 82795, 82796, 82797, 82798, 82799, 82800, 82801, 
+    82802, 82803, 82804, 82805, 82806, 82807, 82808, 82809, 82810, 82811, 
+    82812, 82813, 82814, 82815, 82816, 82817, 82818, 82819, 82820, 82821, 
+    82822, 82823, 82824, 82825, 82826, 82827, 82828, 82829, 82830, 82831, 
+    82832, 82833, 82834, 82835, 82836, 82837, 82838, 82839, 82840, 82841, 
+    82842, 82843, 82844, 82845, 82846, 82847, 82848, 82849, 82850, 82851, 
+    82852, 82853, 82854, 82855, 82856, 82857, 82858, 82859, 82860, 82861, 
+    82862, 82863, 82864, 82865, 82866, 82867, 82868, 82869, 82870, 82871, 
+    82872, 82873, 82874, 82875, 82876, 82877, 82878, 82879, 82880, 82881, 
+    82882, 82883, 82884, 82885, 82886, 82887, 82888, 82889, 82890, 82891, 
+    82892, 82893, 82894, 82895, 82896, 82897, 82898, 82899, 82900, 82901, 
+    82902, 82903, 82904, 82905, 82906, 82907, 82908, 82909, 82910, 82911, 
+    82912, 82913, 82914, 82915, 82916, 82917, 82918, 82919, 82920, 82921, 
+    82922, 82923, 82924, 82925, 82926, 82927, 82928, 82929, 82930, 82931, 
+    82932, 82933, 82934, 82935, 82936, 82937, 82938, 82939, 82940, 82941, 
+    82942, 82943, 82944, 82945, 82946, 82947, 82948, 82949, 82950, 82951, 
+    82952, 82953, 82954, 82955, 82956, 82957, 82958, 82959, 82960, 82961, 
+    82962, 82963, 82964, 82965, 82966, 82967, 82968, 82969, 82970, 82971, 
+    82972, 82973, 82974, 82975, 82976, 82977, 82978, 82979, 82980, 82981, 
+    82982, 82983, 82984, 82985, 82986, 82987, 82988, 82989, 82990, 82991, 
+    82992, 82993, 82994, 82995, 82996, 82997, 82998, 82999, 83000, 83001, 
+    83002, 83003, 83004, 83005, 83006, 83007, 83008, 83009, 83010, 83011, 
+    83012, 83013, 83014, 83015, 83016, 83017, 83018, 83019, 83020, 83021, 
+    83022, 83023, 83024, 83025, 83026, 83027, 83028, 83029, 83030, 83031, 
+    83032, 83033, 83034, 83035, 83036, 83037, 83038, 83039, 83040, 83041, 
+    83042, 83043, 83044, 83045, 83046, 83047, 83048, 83049, 83050, 83051, 
+    83052, 83053, 83054, 83055, 83056, 83057, 83058, 83059, 83060, 83061, 
+    83062, 83063, 83064, 83065, 83066, 83067, 83068, 83069, 83070, 83071, 
+    83072, 83073, 83074, 83075, 83076, 83077, 83078, 83079, 83080, 83081, 
+    83082, 83083, 83084, 83085, 83086, 83087, 83088, 83089, 83090, 83091, 
+    83092, 83093, 83094, 83095, 83096, 83097, 83098, 83099, 83100, 83101, 
+    83102, 83103, 83104, 83105, 83106, 83107, 83108, 83109, 83110, 83111, 
+    83112, 83113, 83114, 83115, 83116, 83117, 83118, 83119, 83120, 83121, 
+    83122, 83123, 83124, 83125, 83126, 83127, 83128, 83129, 83130, 83131, 
+    83132, 83133, 83134, 83135, 83136, 83137, 83138, 83139, 83140, 83141, 
+    83142, 83143, 83144, 83145, 83146, 83147, 83148, 83149, 83150, 83151, 
+    83152, 83153, 83154, 83155, 83156, 83157, 83158, 83159, 83160, 83161, 
+    83162, 83163, 83164, 83165, 83166, 83167, 83168, 83169, 83170, 83171, 
+    83172, 83173, 83174, 83175, 83176, 83177, 83178, 83179, 83180, 83181, 
+    83182, 83183, 83184, 83185, 83186, 83187, 83188, 83189, 83190, 83191, 
+    83192, 83193, 83194, 83195, 83196, 83197, 83198, 83199, 83200, 83201, 
+    83202, 83203, 83204, 83205, 83206, 83207, 83208, 83209, 83210, 83211, 
+    83212, 83213, 83214, 83215, 83216, 83217, 83218, 83219, 83220, 83221, 
+    83222, 83223, 83224, 83225, 83226, 83227, 83228, 83229, 83230, 83231, 
+    83232, 83233, 83234, 83235, 83236, 83237, 83238, 83239, 83240, 83241, 
+    83242, 83243, 83244, 83245, 83246, 83247, 83248, 83249, 83250, 83251, 
+    83252, 83253, 83254, 83255, 83256, 83257, 83258, 83259, 83260, 83261, 
+    83262, 83263, 83264, 83265, 83266, 83267, 83268, 83269, 83270, 83271, 
+    83272, 83273, 83274, 83275, 83276, 83277, 83278, 83279, 83280, 83281, 
+    83282, 83283, 83284, 83285, 83286, 83287, 83288, 83289, 83290, 83291, 
+    83292, 83293, 83294, 83295, 83296, 83297, 83298, 83299, 83300, 83301, 
+    83302, 83303, 83304, 83305, 83306, 83307, 83308, 83309, 83310, 83311, 
+    83312, 83313, 83314, 83315, 83316, 83317, 83318, 83319, 83320, 83321, 
+    83322, 83323, 83324, 83325, 83326, 83327, 83328, 83329, 83330, 83331, 
+    83332, 83333, 83334, 83335, 83336, 83337, 83338, 83339, 83340, 83341, 
+    83342, 83343, 83344, 83345, 83346, 83347, 83348, 83349, 83350, 83351, 
+    83352, 83353, 83354, 83355, 83356, 83357, 83358, 83359, 83360, 83361, 
+    83362, 83363, 83364, 83365, 83366, 83367, 83368, 83369, 83370, 83371, 
+    83372, 83373, 83374, 83375, 83376, 83377, 83378, 83379, 83380, 83381, 
+    83382, 83383, 83384, 83385, 83386, 83387, 83388, 83389, 83390, 83391, 
+    83392, 83393, 83394, 83395, 83396, 83397, 83398, 83399, 83400, 83401, 
+    83402, 83403, 83404, 83405, 83406, 83407, 83408, 83409, 83410, 83411, 
+    83412, 83413, 83414, 83415, 83416, 83417, 83418, 83419, 83420, 83421, 
+    83422, 83423, 83424, 83425, 83426, 83427, 83428, 83429, 83430, 83431, 
+    83432, 83433, 83434, 83435, 83436, 83437, 83438, 83439, 83440, 83441, 
+    83442, 83443, 83444, 83445, 83446, 83447, 83448, 83449, 83450, 83451, 
+    83452, 83453, 83454, 83455, 83456, 83457, 83458, 83459, 83460, 83461, 
+    83462, 83463, 83464, 83465, 83466, 83467, 83468, 83469, 83470, 83471, 
+    83472, 83473, 83474, 83475, 83476, 83477, 83478, 83479, 83480, 83481, 
+    83482, 83483, 83484, 83485, 83486, 83487, 83488, 83489, 83490, 83491, 
+    83492, 83493, 83494, 83495, 83496, 83497, 83498, 83499, 83500, 83501, 
+    83502, 83503, 83504, 83505, 83506, 83507, 83508, 83509, 83510, 83511, 
+    83512, 83513, 83514, 83515, 83516, 83517, 83518, 83519, 83520, 83521, 
+    83522, 83523, 83524, 83525, 83526, 83527, 83528, 83529, 83530, 83531, 
+    83532, 83533, 83534, 83535, 83536, 83537, 83538, 83539, 83540, 83541, 
+    83542, 83543, 83544, 83545, 83546, 83547, 83548, 83549, 83550, 83551, 
+    83552, 83553, 83554, 83555, 83556, 83557, 83558, 83559, 83560, 83561, 
+    83562, 83563, 83564, 83565, 83566, 83567, 83568, 83569, 83570, 83571, 
+    83572, 83573, 83574, 83575, 83576, 83577, 83578, 83579, 83580, 83581, 
+    83582, 83583, 83584, 83585, 83586, 83587, 83588, 83589, 83590, 83591, 
+    83592, 83593, 83594, 83595, 83596, 83597, 83598, 83599, 83600, 83601, 
+    83602, 83603, 83604, 83605, 83606, 83607, 83608, 83609, 83610, 83611, 
+    83612, 83613, 83614, 83615, 83616, 83617, 83618, 83619, 83620, 83621, 
+    83622, 83623, 83624, 83625, 83626, 83627, 83628, 83629, 83630, 83631, 
+    83632, 83633, 83634, 83635, 83636, 83637, 83638, 83639, 83640, 83641, 
+    83642, 83643, 83644, 83645, 83646, 83647, 83648, 83649, 83650, 83651, 
+    83652, 83653, 83654, 83655, 83656, 83657, 83658, 83659, 83660, 83661, 
+    83662, 83663, 83664, 83665, 83666, 83667, 83668, 83669, 83670, 83671, 
+    83672, 83673, 83674, 83675, 83676, 83677, 83678, 83679, 83680, 83681, 
+    83682, 83683, 83684, 83685, 83686, 83687, 83688, 83689, 83690, 83691, 
+    83692, 83693, 83694, 83695, 83696, 83697, 83698, 83699, 83700, 83701, 
+    83702, 83703, 83704, 83705, 83706, 83707, 83708, 83709, 83710, 83711, 
+    83712, 83713, 83714, 83715, 83716, 83717, 83718, 83719, 83720, 83721, 
+    83722, 83723, 83724, 83725, 83726, 83727, 83728, 83729, 83730, 83731, 
+    83732, 83733, 83734, 83735, 83736, 83737, 83738, 83739, 83740, 83741, 
+    83742, 83743, 83744, 83745, 83746, 83747, 83748, 83749, 83750, 83751, 
+    83752, 83753, 83754, 83755, 83756, 83757, 83758, 83759, 83760, 83761, 
+    83762, 83763, 83764, 83765, 83766, 83767, 83768, 83769, 83770, 83771, 
+    83772, 83773, 83774, 83775, 83776, 83777, 83778, 83779, 83780, 83781, 
+    83782, 83783, 83784, 83785, 83786, 83787, 83788, 83789, 83790, 83791, 
+    83792, 83793, 83794, 83795, 83796, 83797, 83798, 83799, 83800, 83801, 
+    83802, 83803, 83804, 83805, 83806, 83807, 83808, 83809, 83810, 83811, 
+    83812, 83813, 83814, 83815, 83816, 83817, 83818, 83819, 83820, 83821, 
+    83822, 83823, 83824, 83825, 83826, 83827, 83828, 83829, 83830, 83831, 
+    83832, 83833, 83834, 83835, 83836, 83837, 83838, 83839, 83840, 83841, 
+    83842, 83843, 83844, 83845, 83846, 83847, 83848, 83849, 83850, 83851, 
+    83852, 83853, 83854, 83855, 83856, 83857, 83858, 83859, 83860, 83861, 
+    83862, 83863, 83864, 83865, 83866, 83867, 83868, 83869, 83870, 83871, 
+    83872, 83873, 83874, 83875, 83876, 83877, 83878, 83879, 83880, 83881, 
+    83882, 83883, 83884, 83885, 83886, 83887, 83888, 83889, 83890, 83891, 
+    83892, 83893, 83894, 83895, 83896, 83897, 83898, 83899, 83900, 83901, 
+    83902, 83903, 83904, 83905, 83906, 83907, 83908, 83909, 83910, 83911, 
+    83912, 83913, 83914, 83915, 83916, 83917, 83918, 83919, 83920, 83921, 
+    83922, 83923, 83924, 83925, 83926, 83927, 83928, 83929, 83930, 83931, 
+    83932, 83933, 83934, 83935, 83936, 83937, 83938, 83939, 83940, 83941, 
+    83942, 83943, 83944, 83945, 83946, 83947, 83948, 83949, 83950, 83951, 
+    83952, 83953, 83954, 83955, 83956, 83957, 83958, 83959, 83960, 83961, 
+    83962, 83963, 83964, 83965, 83966, 83967, 83968, 83969, 83970, 83971, 
+    83972, 83973, 83974, 83975, 83976, 83977, 83978, 83979, 83980, 83981, 
+    83982, 83983, 83984, 83985, 83986, 83987, 83988, 83989, 83990, 83991, 
+    83992, 83993, 83994, 83995, 83996, 83997, 83998, 83999, 84000, 84001, 
+    84002, 84003, 84004, 84005, 84006, 84007, 84008, 84009, 84010, 84011, 
+    84012, 84013, 84014, 84015, 84016, 84017, 84018, 84019, 84020, 84021, 
+    84022, 84023, 84024, 84025, 84026, 84027, 84028, 84029, 84030, 84031, 
+    84032, 84033, 84034, 84035, 84036, 84037, 84038, 84039, 84040, 84041, 
+    84042, 84043, 84044, 84045, 84046, 84047, 84048, 84049, 84050, 84051, 
+    84052, 84053, 84054, 84055, 84056, 84057, 84058, 84059, 84060, 84061, 
+    84062, 84063, 84064, 84065, 84066, 84067, 84068, 84069, 84070, 84071, 
+    84072, 84073, 84074, 84075, 84076, 84077, 84078, 84079, 84080, 84081, 
+    84082, 84083, 84084, 84085, 84086, 84087, 84088, 84089, 84090, 84091, 
+    84092, 84093, 84094, 84095, 84096, 84097, 84098, 84099, 84100, 84101, 
+    84102, 84103, 84104, 84105, 84106, 84107, 84108, 84109, 84110, 84111, 
+    84112, 84113, 84114, 84115, 84116, 84117, 84118, 84119, 84120, 84121, 
+    84122, 84123, 84124, 84125, 84126, 84127, 84128, 84129, 84130, 84131, 
+    84132, 84133, 84134, 84135, 84136, 84137, 84138, 84139, 84140, 84141, 
+    84142, 84143, 84144, 84145, 84146, 84147, 84148, 84149, 84150, 84151, 
+    84152, 84153, 84154, 84155, 84156, 84157, 84158, 84159, 84160, 84161, 
+    84162, 84163, 84164, 84165, 84166, 84167, 84168, 84169, 84170, 84171, 
+    84172, 84173, 84174, 84175, 84176, 84177, 84178, 84179, 84180, 84181, 
+    84182, 84183, 84184, 84185, 84186, 84187, 84188, 84189, 84190, 84191, 
+    84192, 84193, 84194, 84195, 84196, 84197, 84198, 84199, 84200, 84201, 
+    84202, 84203, 84204, 84205, 84206, 84207, 84208, 84209, 84210, 84211, 
+    84212, 84213, 84214, 84215, 84216, 84217, 84218, 84219, 84220, 84221, 
+    84222, 84223, 84224, 84225, 84226, 84227, 84228, 84229, 84230, 84231, 
+    84232, 84233, 84234, 84235, 84236, 84237, 84238, 84239, 84240, 84241, 
+    84242, 84243, 84244, 84245, 84246, 84247, 84248, 84249, 84250, 84251, 
+    84252, 84253, 84254, 84255, 84256, 84257, 84258, 84259, 84260, 84261, 
+    84262, 84263, 84264, 84265, 84266, 84267, 84268, 84269, 84270, 84271, 
+    84272, 84273, 84274, 84275, 84276, 84277, 84278, 84279, 84280, 84281, 
+    84282, 84283, 84284, 84285, 84286, 84287, 84288, 84289, 84290, 84291, 
+    84292, 84293, 84294, 84295, 84296, 84297, 84298, 84299, 84300, 84301, 
+    84302, 84303, 84304, 84305, 84306, 84307, 84308, 84309, 84310, 84311, 
+    84312, 84313, 84314, 84315, 84316, 84317, 84318, 84319, 84320, 84321, 
+    84322, 84323, 84324, 84325, 84326, 84327, 84328, 84329, 84330, 84331, 
+    84332, 84333, 84334, 84335, 84336, 84337, 84338, 84339, 84340, 84341, 
+    84342, 84343, 84344, 84345, 84346, 84347, 84348, 84349, 84350, 84351, 
+    84352, 84353, 84354, 84355, 84356, 84357, 84358, 84359, 84360, 84361, 
+    84362, 84363, 84364, 84365, 84366, 84367, 84368, 84369, 84370, 84371, 
+    84372, 84373, 84374, 84375, 84376, 84377, 84378, 84379, 84380, 84381, 
+    84382, 84383, 84384, 84385, 84386, 84387, 84388, 84389, 84390, 84391, 
+    84392, 84393, 84394, 84395, 84396, 84397, 84398, 84399, 84400, 84401, 
+    84402, 84403, 84404, 84405, 84406, 84407, 84408, 84409, 84410, 84411, 
+    84412, 84413, 84414, 84415, 84416, 84417, 84418, 84419, 84420, 84421, 
+    84422, 84423, 84424, 84425, 84426, 84427, 84428, 84429, 84430, 84431, 
+    84432, 84433, 84434, 84435, 84436, 84437, 84438, 84439, 84440, 84441, 
+    84442, 84443, 84444, 84445, 84446, 84447, 84448, 84449, 84450, 84451, 
+    84452, 84453, 84454, 84455, 84456, 84457, 84458, 84459, 84460, 84461, 
+    84462, 84463, 84464, 84465, 84466, 84467, 84468, 84469, 84470, 84471, 
+    84472, 84473, 84474, 84475, 84476, 84477, 84478, 84479, 84480, 84481, 
+    84482, 84483, 84484, 84485, 84486, 84487, 84488, 84489, 84490, 84491, 
+    84492, 84493, 84494, 84495, 84496, 84497, 84498, 84499, 84500, 84501, 
+    84502, 84503, 84504, 84505, 84506, 84507, 84508, 84509, 84510, 84511, 
+    84512, 84513, 84514, 84515, 84516, 84517, 84518, 84519, 84520, 84521, 
+    84522, 84523, 84524, 84525, 84526, 84527, 84528, 84529, 84530, 84531, 
+    84532, 84533, 84534, 84535, 84536, 84537, 84538, 84539, 84540, 84541, 
+    84542, 84543, 84544, 84545, 84546, 84547, 84548, 84549, 84550, 84551, 
+    84552, 84553, 84554, 84555, 84556, 84557, 84558, 84559, 84560, 84561, 
+    84562, 84563, 84564, 84565, 84566, 84567, 84568, 84569, 84570, 84571, 
+    84572, 84573, 84574, 84575, 84576, 84577, 84578, 84579, 84580, 84581, 
+    84582, 84583, 84584, 84585, 84586, 84587, 84588, 84589, 84590, 84591, 
+    84592, 84593, 84594, 84595, 84596, 84597, 84598, 84599, 84600, 84601, 
+    84602, 84603, 84604, 84605, 84606, 84607, 84608, 84609, 84610, 84611, 
+    84612, 84613, 84614, 84615, 84616, 84617, 84618, 84619, 84620, 84621, 
+    84622, 84623, 84624, 84625, 84626, 84627, 84628, 84629, 84630, 84631, 
+    84632, 84633, 84634, 84635, 84636, 84637, 84638, 84639, 84640, 84641, 
+    84642, 84643, 84644, 84645, 84646, 84647, 84648, 84649, 84650, 84651, 
+    84652, 84653, 84654, 84655, 84656, 84657, 84658, 84659, 84660, 84661, 
+    84662, 84663, 84664, 84665, 84666, 84667, 84668, 84669, 84670, 84671, 
+    84672, 84673, 84674, 84675, 84676, 84677, 84678, 84679, 84680, 84681, 
+    84682, 84683, 84684, 84685, 84686, 84687, 84688, 84689, 84690, 84691, 
+    84692, 84693, 84694, 84695, 84696, 84697, 84698, 84699, 84700, 84701, 
+    84702, 84703, 84704, 84705, 84706, 84707, 84708, 84709, 84710, 84711, 
+    84712, 84713, 84714, 84715, 84716, 84717, 84718, 84719, 84720, 84721, 
+    84722, 84723, 84724, 84725, 84726, 84727, 84728, 84729, 84730, 84731, 
+    84732, 84733, 84734, 84735, 84736, 84737, 84738, 84739, 84740, 84741, 
+    84742, 84743, 84744, 84745, 84746, 84747, 84748, 84749, 84750, 84751, 
+    84752, 84753, 84754, 84755, 84756, 84757, 84758, 84759, 84760, 84761, 
+    84762, 84763, 84764, 84765, 84766, 84767, 84768, 84769, 84770, 84771, 
+    84772, 84773, 84774, 84775, 84776, 84777, 84778, 84779, 84780, 84781, 
+    84782, 84783, 84784, 84785, 84786, 84787, 84788, 84789, 84790, 84791, 
+    84792, 84793, 84794, 84795, 84796, 84797, 84798, 84799, 84800, 84801, 
+    84802, 84803, 84804, 84805, 84806, 84807, 84808, 84809, 84810, 84811, 
+    84812, 84813, 84814, 84815, 84816, 84817, 84818, 84819, 84820, 84821, 
+    84822, 84823, 84824, 84825, 84826, 84827, 84828, 84829, 84830, 84831, 
+    84832, 84833, 84834, 84835, 84836, 84837, 84838, 84839, 84840, 84841, 
+    84842, 84843, 84844, 84845, 84846, 84847, 84848, 84849, 84850, 84851, 
+    84852, 84853, 84854, 84855, 84856, 84857, 84858, 84859, 84860, 84861, 
+    84862, 84863, 84864, 84865, 84866, 84867, 84868, 84869, 84870, 84871, 
+    84872, 84873, 84874, 84875, 84876, 84877, 84878, 84879, 84880, 84881, 
+    84882, 84883, 84884, 84885, 84886, 84887, 84888, 84889, 84890, 84891, 
+    84892, 84893, 84894, 84895, 84896, 84897, 84898, 84899, 84900, 84901, 
+    84902, 84903, 84904, 84905, 84906, 84907, 84908, 84909, 84910, 84911, 
+    84912, 84913, 84914, 84915, 84916, 84917, 84918, 84919, 84920, 84921, 
+    84922, 84923, 84924, 84925, 84926, 84927, 84928, 84929, 84930, 84931, 
+    84932, 84933, 84934, 84935, 84936, 84937, 84938, 84939, 84940, 84941, 
+    84942, 84943, 84944, 84945, 84946, 84947, 84948, 84949, 84950, 84951, 
+    84952, 84953, 84954, 84955, 84956, 84957, 84958, 84959, 84960, 84961, 
+    84962, 84963, 84964, 84965, 84966, 84967, 84968, 84969, 84970, 84971, 
+    84972, 84973, 84974, 84975, 84976, 84977, 84978, 84979, 84980, 84981, 
+    84982, 84983, 84984, 84985, 84986, 84987, 84988, 84989, 84990, 84991, 
+    84992, 84993, 84994, 84995, 84996, 84997, 84998, 84999, 85000, 85001, 
+    85002, 85003, 85004, 85005, 85006, 85007, 85008, 85009, 85010, 85011, 
+    85012, 85013, 85014, 85015, 85016, 85017, 85018, 85019, 85020, 85021, 
+    85022, 85023, 85024, 85025, 85026, 85027, 85028, 85029, 85030, 85031, 
+    85032, 85033, 85034, 85035, 85036, 85037, 85038, 85039, 85040, 85041, 
+    85042, 85043, 85044, 85045, 85046, 85047, 85048, 85049, 85050, 85051, 
+    85052, 85053, 85054, 85055, 85056, 85057, 85058, 85059, 85060, 85061, 
+    85062, 85063, 85064, 85065, 85066, 85067, 85068, 85069, 85070, 85071, 
+    85072, 85073, 85074, 85075, 85076, 85077, 85078, 85079, 85080, 85081, 
+    85082, 85083, 85084, 85085, 85086, 85087, 85088, 85089, 85090, 85091, 
+    85092, 85093, 85094, 85095, 85096, 85097, 85098, 85099, 85100, 85101, 
+    85102, 85103, 85104, 85105, 85106, 85107, 85108, 85109, 85110, 85111, 
+    85112, 85113, 85114, 85115, 85116, 85117, 85118, 85119, 85120, 85121, 
+    85122, 85123, 85124, 85125, 85126, 85127, 85128, 85129, 85130, 85131, 
+    85132, 85133, 85134, 85135, 85136, 85137, 85138, 85139, 85140, 85141, 
+    85142, 85143, 85144, 85145, 85146, 85147, 85148, 85149, 85150, 85151, 
+    85152, 85153, 85154, 85155, 85156, 85157, 85158, 85159, 85160, 85161, 
+    85162, 85163, 85164, 85165, 85166, 85167, 85168, 85169, 85170, 85171, 
+    85172, 85173, 85174, 85175, 85176, 85177, 85178, 85179, 85180, 85181, 
+    85182, 85183, 85184, 85185, 85186, 85187, 85188, 85189, 85190, 85191, 
+    85192, 85193, 85194, 85195, 85196, 85197, 85198, 85199, 85200, 85201, 
+    85202, 85203, 85204, 85205, 85206, 85207, 85208, 85209, 85210, 85211, 
+    85212, 85213, 85214, 85215, 85216, 85217, 85218, 85219, 85220, 85221, 
+    85222, 85223, 85224, 85225, 85226, 85227, 85228, 85229, 85230, 85231, 
+    85232, 85233, 85234, 85235, 85236, 85237, 85238, 85239, 85240, 85241, 
+    85242, 85243, 85244, 85245, 85246, 85247, 85248, 85249, 85250, 85251, 
+    85252, 85253, 85254, 85255, 85256, 85257, 85258, 85259, 85260, 85261, 
+    85262, 85263, 85264, 85265, 85266, 85267, 85268, 85269, 85270, 85271, 
+    85272, 85273, 85274, 85275, 85276, 85277, 85278, 85279, 85280, 85281, 
+    85282, 85283, 85284, 85285, 85286, 85287, 85288, 85289, 85290, 85291, 
+    85292, 85293, 85294, 85295, 85296, 85297, 85298, 85299, 85300, 85301, 
+    85302, 85303, 85304, 85305, 85306, 85307, 85308, 85309, 85310, 85311, 
+    85312, 85313, 85314, 85315, 85316, 85317, 85318, 85319, 85320, 85321, 
+    85322, 85323, 85324, 85325, 85326, 85327, 85328, 85329, 85330, 85331, 
+    85332, 85333, 85334, 85335, 85336, 85337, 85338, 85339, 85340, 85341, 
+    85342, 85343, 85344, 85345, 85346, 85347, 85348, 85349, 85350, 85351, 
+    85352, 85353, 85354, 85355, 85356, 85357, 85358, 85359, 85360, 85361, 
+    85362, 85363, 85364, 85365, 85366, 85367, 85368, 85369, 85370, 85371, 
+    85372, 85373, 85374, 85375, 85376, 85377, 85378, 85379, 85380, 85381, 
+    85382, 85383, 85384, 85385, 85386, 85387, 85388, 85389, 85390, 85391, 
+    85392, 85393, 85394, 85395, 85396, 85397, 85398, 85399, 85400, 85401, 
+    85402, 85403, 85404, 85405, 85406, 85407, 85408, 85409, 85410, 85411, 
+    85412, 85413, 85414, 85415, 85416, 85417, 85418, 85419, 85420, 85421, 
+    85422, 85423, 85424, 85425, 85426, 85427, 85428, 85429, 85430, 85431, 
+    85432, 85433, 85434, 85435, 85436, 85437, 85438, 85439, 85440, 85441, 
+    85442, 85443, 85444, 85445, 85446, 85447, 85448, 85449, 85450, 85451, 
+    85452, 85453, 85454, 85455, 85456, 85457, 85458, 85459, 85460, 85461, 
+    85462, 85463, 85464, 85465, 85466, 85467, 85468, 85469, 85470, 85471, 
+    85472, 85473, 85474, 85475, 85476, 85477, 85478, 85479, 85480, 85481, 
+    85482, 85483, 85484, 85485, 85486, 85487, 85488, 85489, 85490, 85491, 
+    85492, 85493, 85494, 85495, 85496, 85497, 85498, 85499, 85500, 85501, 
+    85502, 85503, 85504, 85505, 85506, 85507, 85508, 85509, 85510, 85511, 
+    85512, 85513, 85514, 85515, 85516, 85517, 85518, 85519, 85520, 85521, 
+    85522, 85523, 85524, 85525, 85526, 85527, 85528, 85529, 85530, 85531, 
+    85532, 85533, 85534, 85535, 85536, 85537, 85538, 85539, 85540, 85541, 
+    85542, 85543, 85544, 85545, 85546, 85547, 85548, 85549, 85550, 85551, 
+    85552, 85553, 85554, 85555, 85556, 85557, 85558, 85559, 85560, 85561, 
+    85562, 85563, 85564, 85565, 85566, 85567, 85568, 85569, 85570, 85571, 
+    85572, 85573, 85574, 85575, 85576, 85577, 85578, 85579, 85580, 85581, 
+    85582, 85583, 85584, 85585, 85586, 85587, 85588, 85589, 85590, 85591, 
+    85592, 85593, 85594, 85595, 85596, 85597, 85598, 85599, 85600, 85601, 
+    85602, 85603, 85604, 85605, 85606, 85607, 85608, 85609, 85610, 85611, 
+    85612, 85613, 85614, 85615, 85616, 85617, 85618, 85619, 85620, 85621, 
+    85622, 85623, 85624, 85625, 85626, 85627, 85628, 85629, 85630, 85631, 
+    85632, 85633, 85634, 85635, 85636, 85637, 85638, 85639, 85640, 85641, 
+    85642, 85643, 85644, 85645, 85646, 85647, 85648, 85649, 85650, 85651, 
+    85652, 85653, 85654, 85655, 85656, 85657, 85658, 85659, 85660, 85661, 
+    85662, 85663, 85664, 85665, 85666, 85667, 85668, 85669, 85670, 85671, 
+    85672, 85673, 85674, 85675, 85676, 85677, 85678, 85679, 85680, 85681, 
+    85682, 85683, 85684, 85685, 85686, 85687, 85688, 85689, 85690, 85691, 
+    85692, 85693, 85694, 85695, 85696, 85697, 85698, 85699, 85700, 85701, 
+    85702, 85703, 85704, 85705, 85706, 85707, 85708, 85709, 85710, 85711, 
+    85712, 85713, 85714, 85715, 85716, 85717, 85718, 85719, 85720, 85721, 
+    85722, 85723, 85724, 85725, 85726, 85727, 85728, 85729, 85730, 85731, 
+    85732, 85733, 85734, 85735, 85736, 85737, 85738, 85739, 85740, 85741, 
+    85742, 85743, 85744, 85745, 85746, 85747, 85748, 85749, 85750, 85751, 
+    85752, 85753, 85754, 85755, 85756, 85757, 85758, 85759, 85760, 85761, 
+    85762, 85763, 85764, 85765, 85766, 85767, 85768, 85769, 85770, 85771, 
+    85772, 85773, 85774, 85775, 85776, 85777, 85778, 85779, 85780, 85781, 
+    85782, 85783, 85784, 85785, 85786, 85787, 85788, 85789, 85790, 85791, 
+    85792, 85793, 85794, 85795, 85796, 85797, 85798, 85799, 85800, 85801, 
+    85802, 85803, 85804, 85805, 85806, 85807, 85808, 85809, 85810, 85811, 
+    85812, 85813, 85814, 85815, 85816, 85817, 85818, 85819, 85820, 85821, 
+    85822, 85823, 85824, 85825, 85826, 85827, 85828, 85829, 85830, 85831, 
+    85832, 85833, 85834, 85835, 85836, 85837, 85838, 85839, 85840, 85841, 
+    85842, 85843, 85844, 85845, 85846, 85847, 85848, 85849, 85850, 85851, 
+    85852, 85853, 85854, 85855, 85856, 85857, 85858, 85859, 85860, 85861, 
+    85862, 85863, 85864, 85865, 85866, 85867, 85868, 85869, 85870, 85871, 
+    85872, 85873, 85874, 85875, 85876, 85877, 85878, 85879, 85880, 85881, 
+    85882, 85883, 85884, 85885, 85886, 85887, 85888, 85889, 85890, 85891, 
+    85892, 85893, 85894, 85895, 85896, 85897, 85898, 85899, 85900, 85901, 
+    85902, 85903, 85904, 85905, 85906, 85907, 85908, 85909, 85910, 85911, 
+    85912, 85913, 85914, 85915, 85916, 85917, 85918, 85919, 85920, 85921, 
+    85922, 85923, 85924, 85925, 85926, 85927, 85928, 85929, 85930, 85931, 
+    85932, 85933, 85934, 85935, 85936, 85937, 85938, 85939, 85940, 85941, 
+    85942, 85943, 85944, 85945, 85946, 85947, 85948, 85949, 85950, 85951, 
+    85952, 85953, 85954, 85955, 85956, 85957, 85958, 85959, 85960, 85961, 
+    85962, 85963, 85964, 85965, 85966, 85967, 85968, 85969, 85970, 85971, 
+    85972, 85973, 85974, 85975, 85976, 85977, 85978, 85979, 85980, 85981, 
+    85982, 85983, 85984, 85985, 85986, 85987, 85988, 85989, 85990, 85991, 
+    85992, 85993, 85994, 85995, 85996, 85997, 85998, 85999, 86000, 86001, 
+    86002, 86003, 86004, 86005, 86006, 86007, 86008, 86009, 86010, 86011, 
+    86012, 86013, 86014, 86015, 86016, 86017, 86018, 86019, 86020, 86021, 
+    86022, 86023, 86024, 86025, 86026, 86027, 86028, 86029, 86030, 86031, 
+    86032, 86033, 86034, 86035, 86036, 86037, 86038, 86039, 86040, 86041, 
+    86042, 86043, 86044, 86045, 86046, 86047, 86048, 86049, 86050, 86051, 
+    86052, 86053, 86054, 86055, 86056, 86057, 86058, 86059, 86060, 86061, 
+    86062, 86063, 86064, 86065, 86066, 86067, 86068, 86069, 86070, 86071, 
+    86072, 86073, 86074, 86075, 86076, 86077, 86078, 86079, 86080, 86081, 
+    86082, 86083, 86084, 86085, 86086, 86087, 86088, 86089, 86090, 86091, 
+    86092, 86093, 86094, 86095, 86096, 86097, 86098, 86099, 86100, 86101, 
+    86102, 86103, 86104, 86105, 86106, 86107, 86108, 86109, 86110, 86111, 
+    86112, 86113, 86114, 86115, 86116, 86117, 86118, 86119, 86120, 86121, 
+    86122, 86123, 86124, 86125, 86126, 86127, 86128, 86129, 86130, 86131, 
+    86132, 86133, 86134, 86135, 86136, 86137, 86138, 86139, 86140, 86141, 
+    86142, 86143, 86144, 86145, 86146, 86147, 86148, 86149, 86150, 86151, 
+    86152, 86153, 86154, 86155, 86156, 86157, 86158, 86159, 86160, 86161, 
+    86162, 86163, 86164, 86165, 86166, 86167, 86168, 86169, 86170, 86171, 
+    86172, 86173, 86174, 86175, 86176, 86177, 86178, 86179, 86180, 86181, 
+    86182, 86183, 86184, 86185, 86186, 86187, 86188, 86189, 86190, 86191, 
+    86192, 86193, 86194, 86195, 86196, 86197, 86198, 86199, 86200, 86201, 
+    86202, 86203, 86204, 86205, 86206, 86207, 86208, 86209, 86210, 86211, 
+    86212, 86213, 86214, 86215, 86216, 86217, 86218, 86219, 86220, 86221, 
+    86222, 86223, 86224, 86225, 86226, 86227, 86228, 86229, 86230, 86231, 
+    86232, 86233, 86234, 86235, 86236, 86237, 86238, 86239, 86240, 86241, 
+    86242, 86243, 86244, 86245, 86246, 86247, 86248, 86249, 86250, 86251, 
+    86252, 86253, 86254, 86255, 86256, 86257, 86258, 86259, 86260, 86261, 
+    86262, 86263, 86264, 86265, 86266, 86267, 86268, 86269, 86270, 86271, 
+    86272, 86273, 86274, 86275, 86276, 86277, 86278, 86279, 86280, 86281, 
+    86282, 86283, 86284, 86285, 86286, 86287, 86288, 86289, 86290, 86291, 
+    86292, 86293, 86294, 86295, 86296, 86297, 86298, 86299, 86300, 86301, 
+    86302, 86303, 86304, 86305, 86306, 86307, 86308, 86309, 86310, 86311, 
+    86312, 86313, 86314, 86315, 86316, 86317, 86318, 86319, 86320, 86321, 
+    86322, 86323, 86324, 86325, 86326, 86327, 86328, 86329, 86330, 86331, 
+    86332, 86333, 86334, 86335, 86336, 86337, 86338, 86339, 86340, 86341, 
+    86342, 86343, 86344, 86345, 86346, 86347, 86348, 86349, 86350, 86351, 
+    86352, 86353, 86354, 86355, 86356, 86357, 86358, 86359, 86360, 86361, 
+    86362, 86363, 86364, 86365, 86366, 86367, 86368, 86369, 86370, 86371, 
+    86372, 86373, 86374, 86375, 86376, 86377, 86378, 86379, 86380, 86381, 
+    86382, 86383, 86384, 86385, 86386, 86387, 86388, 86389, 86390, 86391, 
+    86392, 86393, 86394, 86395, 86396, 86397, 86398, 86399, 86400, 86401, 
+    86402, 86403, 86404, 86405, 86406, 86407, 86408, 86409, 86410, 86411, 
+    86412, 86413, 86414, 86415, 86416, 86417, 86418, 86419, 86420, 86421, 
+    86422, 86423, 86424, 86425, 86426, 86427, 86428, 86429, 86430, 86431, 
+    86432, 86433, 86434, 86435, 86436, 86437, 86438, 86439, 86440, 86441, 
+    86442, 86443, 86444, 86445, 86446, 86447, 86448, 86449, 86450, 86451, 
+    86452, 86453, 86454, 86455, 86456, 86457, 86458, 86459, 86460, 86461, 
+    86462, 86463, 86464, 86465, 86466, 86467, 86468, 86469, 86470, 86471, 
+    86472, 86473, 86474, 86475, 86476, 86477, 86478, 86479, 86480, 86481, 
+    86482, 86483, 86484, 86485, 86486, 86487, 86488, 86489, 86490, 86491, 
+    86492, 86493, 86494, 86495, 86496, 86497, 86498, 86499, 86500, 86501, 
+    86502, 86503, 86504, 86505, 86506, 86507, 86508, 86509, 86510, 86511, 
+    86512, 86513, 86514, 86515, 86516, 86517, 86518, 86519, 86520, 86521, 
+    86522, 86523, 86524, 86525, 86526, 86527, 86528, 86529, 86530, 86531, 
+    86532, 86533, 86534, 86535, 86536, 86537, 86538, 86539, 86540, 86541, 
+    86542, 86543, 86544, 86545, 86546, 86547, 86548, 86549, 86550, 86551, 
+    86552, 86553, 86554, 86555, 86556, 86557, 86558, 86559, 86560, 86561, 
+    86562, 86563, 86564, 86565, 86566, 86567, 86568, 86569, 86570, 86571, 
+    86572, 86573, 86574, 86575, 86576, 86577, 86578, 86579, 86580, 86581, 
+    86582, 86583, 86584, 86585, 86586, 86587, 86588, 86589, 86590, 86591, 
+    86592, 86593, 86594, 86595, 86596, 86597, 86598, 86599, 86600, 86601, 
+    86602, 86603, 86604, 86605, 86606, 86607, 86608, 86609, 86610, 86611, 
+    86612, 86613, 86614, 86615, 86616, 86617, 86618, 86619, 86620, 86621, 
+    86622, 86623, 86624, 86625, 86626, 86627, 86628, 86629, 86630, 86631, 
+    86632, 86633, 86634, 86635, 86636, 86637, 86638, 86639, 86640, 86641, 
+    86642, 86643, 86644, 86645, 86646, 86647, 86648, 86649, 86650, 86651, 
+    86652, 86653, 86654, 86655, 86656, 86657, 86658, 86659, 86660, 86661, 
+    86662, 86663, 86664, 86665, 86666, 86667, 86668, 86669, 86670, 86671, 
+    86672, 86673, 86674, 86675, 86676, 86677, 86678, 86679, 86680, 86681, 
+    86682, 86683, 86684, 86685, 86686, 86687, 86688, 86689, 86690, 86691, 
+    86692, 86693, 86694, 86695, 86696, 86697, 86698, 86699, 86700, 86701, 
+    86702, 86703, 86704, 86705, 86706, 86707, 86708, 86709, 86710, 86711, 
+    86712, 86713, 86714, 86715, 86716, 86717, 86718, 86719, 86720, 86721, 
+    86722, 86723, 86724, 86725, 86726, 86727, 86728, 86729, 86730, 86731, 
+    86732, 86733, 86734, 86735, 86736, 86737, 86738, 86739, 86740, 86741, 
+    86742, 86743, 86744, 86745, 86746, 86747, 86748, 86749, 86750, 86751, 
+    86752, 86753, 86754, 86755, 86756, 86757, 86758, 86759, 86760, 86761, 
+    86762, 86763, 86764, 86765, 86766, 86767, 86768, 86769, 86770, 86771, 
+    86772, 86773, 86774, 86775, 86776, 86777, 86778, 86779, 86780, 86781, 
+    86782, 86783, 86784, 86785, 86786, 86787, 86788, 86789, 86790, 86791, 
+    86792, 86793, 86794, 86795, 86796, 86797, 86798, 86799, 86800, 86801, 
+    86802, 86803, 86804, 86805, 86806, 86807, 86808, 86809, 86810, 86811, 
+    86812, 86813, 86814, 86815, 86816, 86817, 86818, 86819, 86820, 86821, 
+    86822, 86823, 86824, 86825, 86826, 86827, 86828, 86829, 86830, 86831, 
+    86832, 86833, 86834, 86835, 86836, 86837, 86838, 86839, 86840, 86841, 
+    86842, 86843, 86844, 86845, 86846, 86847, 86848, 86849, 86850, 86851, 
+    86852, 86853, 86854, 86855, 86856, 86857, 86858, 86859, 86860, 86861, 
+    86862, 86863, 86864, 86865, 86866, 86867, 86868, 86869, 86870, 86871, 
+    86872, 86873, 86874, 86875, 86876, 86877, 86878, 86879, 86880, 86881, 
+    86882, 86883, 86884, 86885, 86886, 86887, 86888, 86889, 86890, 86891, 
+    86892, 86893, 86894, 86895, 86896, 86897, 86898, 86899, 86900, 86901, 
+    86902, 86903, 86904, 86905, 86906, 86907, 86908, 86909, 86910, 86911, 
+    86912, 86913, 86914, 86915, 86916, 86917, 86918, 86919, 86920, 86921, 
+    86922, 86923, 86924, 86925, 86926, 86927, 86928, 86929, 86930, 86931, 
+    86932, 86933, 86934, 86935, 86936, 86937, 86938, 86939, 86940, 86941, 
+    86942, 86943, 86944, 86945, 86946, 86947, 86948, 86949, 86950, 86951, 
+    86952, 86953, 86954, 86955, 86956, 86957, 86958, 86959, 86960, 86961, 
+    86962, 86963, 86964, 86965, 86966, 86967, 86968, 86969, 86970, 86971, 
+    86972, 86973, 86974, 86975, 86976, 86977, 86978, 86979, 86980, 86981, 
+    86982, 86983, 86984, 86985, 86986, 86987, 86988, 86989, 86990, 86991, 
+    86992, 86993, 86994, 86995, 86996, 86997, 86998, 86999, 87000, 87001, 
+    87002, 87003, 87004, 87005, 87006, 87007, 87008, 87009, 87010, 87011, 
+    87012, 87013, 87014, 87015, 87016, 87017, 87018, 87019, 87020, 87021, 
+    87022, 87023, 87024, 87025, 87026, 87027, 87028, 87029, 87030, 87031, 
+    87032, 87033, 87034, 87035, 87036, 87037, 87038, 87039, 87040, 87041, 
+    87042, 87043, 87044, 87045, 87046, 87047, 87048, 87049, 87050, 87051, 
+    87052, 87053, 87054, 87055, 87056, 87057, 87058, 87059, 87060, 87061, 
+    87062, 87063, 87064, 87065, 87066, 87067, 87068, 87069, 87070, 87071, 
+    87072, 87073, 87074, 87075, 87076, 87077, 87078, 87079, 87080, 87081, 
+    87082, 87083, 87084, 87085, 87086, 87087, 87088, 87089, 87090, 87091, 
+    87092, 87093, 87094, 87095, 87096, 87097, 87098, 87099, 87100, 87101, 
+    87102, 87103, 87104, 87105, 87106, 87107, 87108, 87109, 87110, 87111, 
+    87112, 87113, 87114, 87115, 87116, 87117, 87118, 87119, 87120, 87121, 
+    87122, 87123, 87124, 87125, 87126, 87127, 87128, 87129, 87130, 87131, 
+    87132, 87133, 87134, 87135, 87136, 87137, 87138, 87139, 87140, 87141, 
+    87142, 87143, 87144, 87145, 87146, 87147, 87148, 87149, 87150, 87151, 
+    87152, 87153, 87154, 87155, 87156, 87157, 87158, 87159, 87160, 87161, 
+    87162, 87163, 87164, 87165, 87166, 87167, 87168, 87169, 87170, 87171, 
+    87172, 87173, 87174, 87175, 87176, 87177, 87178, 87179, 87180, 87181, 
+    87182, 87183, 87184, 87185, 87186, 87187, 87188, 87189, 87190, 87191, 
+    87192, 87193, 87194, 87195, 87196, 87197, 87198, 87199, 87200, 87201, 
+    87202, 87203, 87204, 87205, 87206, 87207, 87208, 87209, 87210, 87211, 
+    87212, 87213, 87214, 87215, 87216, 87217, 87218, 87219, 87220, 87221, 
+    87222, 87223, 87224, 87225, 87226, 87227, 87228, 87229, 87230, 87231, 
+    87232, 87233, 87234, 87235, 87236, 87237, 87238, 87239, 87240, 87241, 
+    87242, 87243, 87244, 87245, 87246, 87247, 87248, 87249, 87250, 87251, 
+    87252, 87253, 87254, 87255, 87256, 87257, 87258, 87259, 87260, 87261, 
+    87262, 87263, 87264, 87265, 87266, 87267, 87268, 87269, 87270, 87271, 
+    87272, 87273, 87274, 87275, 87276, 87277, 87278, 87279, 87280, 87281, 
+    87282, 87283, 87284, 87285, 87286, 87287, 87288, 87289, 87290, 87291, 
+    87292, 87293, 87294, 87295, 87296, 87297, 87298, 87299, 87300, 87301, 
+    87302, 87303, 87304, 87305, 87306, 87307, 87308, 87309, 87310, 87311, 
+    87312, 87313, 87314, 87315, 87316, 87317, 87318, 87319, 87320, 87321, 
+    87322, 87323, 87324, 87325, 87326, 87327, 87328, 87329, 87330, 87331, 
+    87332, 87333, 87334, 87335, 87336, 87337, 87338, 87339, 87340, 87341, 
+    87342, 87343, 87344, 87345, 87346, 87347, 87348, 87349, 87350, 87351, 
+    87352, 87353, 87354, 87355, 87356, 87357, 87358, 87359, 87360, 87361, 
+    87362, 87363, 87364, 87365, 87366, 87367, 87368, 87369, 87370, 87371, 
+    87372, 87373, 87374, 87375, 87376, 87377, 87378, 87379, 87380, 87381, 
+    87382, 87383, 87384, 87385, 87386, 87387, 87388, 87389, 87390, 87391, 
+    87392, 87393, 87394, 87395, 87396, 87397, 87398, 87399, 87400, 87401, 
+    87402, 87403, 87404, 87405, 87406, 87407, 87408, 87409, 87410, 87411, 
+    87412, 87413, 87414, 87415, 87416, 87417, 87418, 87419, 87420, 87421, 
+    87422, 87423, 87424, 87425, 87426, 87427, 87428, 87429, 87430, 87431, 
+    87432, 87433, 87434, 87435, 87436, 87437, 87438, 87439, 87440, 87441, 
+    87442, 87443, 87444, 87445, 87446, 87447, 87448, 87449, 87450, 87451, 
+    87452, 87453, 87454, 87455, 87456, 87457, 87458, 87459, 87460, 87461, 
+    87462, 87463, 87464, 87465, 87466, 87467, 87468, 87469, 87470, 87471, 
+    87472, 87473, 87474, 87475, 87476, 87477, 87478, 87479, 87480, 87481, 
+    87482, 87483, 87484, 87485, 87486, 87487, 87488, 87489, 87490, 87491, 
+    87492, 87493, 87494, 87495, 87496, 87497, 87498, 87499, 87500, 87501, 
+    87502, 87503, 87504, 87505, 87506, 87507, 87508, 87509, 87510, 87511, 
+    87512, 87513, 87514, 87515, 87516, 87517, 87518, 87519, 87520, 87521, 
+    87522, 87523, 87524, 87525, 87526, 87527, 87528, 87529, 87530, 87531, 
+    87532, 87533, 87534, 87535, 87536, 87537, 87538, 87539, 87540, 87541, 
+    87542, 87543, 87544, 87545, 87546, 87547, 87548, 87549, 87550, 87551, 
+    87552, 87553, 87554, 87555, 87556, 87557, 87558, 87559, 87560, 87561, 
+    87562, 87563, 87564, 87565, 87566, 87567, 87568, 87569, 87570, 87571, 
+    87572, 87573, 87574, 87575, 87576, 87577, 87578, 87579, 87580, 87581, 
+    87582, 87583, 87584, 87585, 87586, 87587, 87588, 87589, 87590, 87591, 
+    87592, 87593, 87594, 87595, 87596, 87597, 87598, 87599, 87600, 87601, 
+    87602, 87603, 87604, 87605, 87606, 87607, 87608, 87609, 87610, 87611, 
+    87612, 87613, 87614, 87615, 87616, 87617, 87618, 87619, 87620, 87621, 
+    87622, 87623, 87624, 87625, 87626, 87627, 87628, 87629, 87630, 87631, 
+    87632, 87633, 87634, 87635, 87636, 87637, 87638, 87639, 87640, 87641, 
+    87642, 87643, 87644, 87645, 87646, 87647, 87648, 87649, 87650, 87651, 
+    87652, 87653, 87654, 87655, 87656, 87657, 87658, 87659, 87660, 87661, 
+    87662, 87663, 87664, 87665, 87666, 87667, 87668, 87669, 87670, 87671, 
+    87672, 87673, 87674, 87675, 87676, 87677, 87678, 87679, 87680, 87681, 
+    87682, 87683, 87684, 87685, 87686, 87687, 87688, 87689, 87690, 87691, 
+    87692, 87693, 87694, 87695, 87696, 87697, 87698, 87699, 87700, 87701, 
+    87702, 87703, 87704, 87705, 87706, 87707, 87708, 87709, 87710, 87711, 
+    87712, 87713, 87714, 87715, 87716, 87717, 87718, 87719, 87720, 87721, 
+    87722, 87723, 87724, 87725, 87726, 87727, 87728, 87729, 87730, 87731, 
+    87732, 87733, 87734, 87735, 87736, 87737, 87738, 87739, 87740, 87741, 
+    87742, 87743, 87744, 87745, 87746, 87747, 87748, 87749, 87750, 87751, 
+    87752, 87753, 87754, 87755, 87756, 87757, 87758, 87759, 87760, 87761, 
+    87762, 87763, 87764, 87765, 87766, 87767, 87768, 87769, 87770, 87771, 
+    87772, 87773, 87774, 87775, 87776, 87777, 87778, 87779, 87780, 87781, 
+    87782, 87783, 87784, 87785, 87786, 87787, 87788, 87789, 87790, 87791, 
+    87792, 87793, 87794, 87795, 87796, 87797, 87798, 87799, 87800, 87801, 
+    87802, 87803, 87804, 87805, 87806, 87807, 87808, 87809, 87810, 87811, 
+    87812, 87813, 87814, 87815, 87816, 87817, 87818, 87819, 87820, 87821, 
+    87822, 87823, 87824, 87825, 87826, 87827, 87828, 87829, 87830, 87831, 
+    87832, 87833, 87834, 87835, 87836, 87837, 87838, 87839, 87840, 87841, 
+    87842, 87843, 87844, 87845, 87846, 87847, 87848, 87849, 87850, 87851, 
+    87852, 87853, 87854, 87855, 87856, 87857, 87858, 87859, 87860, 87861, 
+    87862, 87863, 87864, 87865, 87866, 87867, 87868, 87869, 87870, 87871, 
+    87872, 87873, 87874, 87875, 87876, 87877, 87878, 87879, 87880, 87881, 
+    87882, 87883, 87884, 87885, 87886, 87887, 87888, 87889, 87890, 87891, 
+    87892, 87893, 87894, 87895, 87896, 87897, 87898, 87899, 87900, 87901, 
+    87902, 87903, 87904, 87905, 87906, 87907, 87908, 87909, 87910, 87911, 
+    87912, 87913, 87914, 87915, 87916, 87917, 87918, 87919, 87920, 87921, 
+    87922, 87923, 87924, 87925, 87926, 87927, 87928, 87929, 87930, 87931, 
+    87932, 87933, 87934, 87935, 87936, 87937, 87938, 87939, 87940, 87941, 
+    87942, 87943, 87944, 87945, 87946, 87947, 87948, 87949, 87950, 87951, 
+    87952, 87953, 87954, 87955, 87956, 87957, 87958, 87959, 87960, 87961, 
+    87962, 87963, 87964, 87965, 87966, 87967, 87968, 87969, 87970, 87971, 
+    87972, 87973, 87974, 87975, 87976, 87977, 87978, 87979, 87980, 87981, 
+    87982, 87983, 87984, 87985, 87986, 87987, 87988, 87989, 87990, 87991, 
+    87992, 87993, 87994, 87995, 87996, 87997, 87998, 87999, 88000, 88001, 
+    88002, 88003, 88004, 88005, 88006, 88007, 88008, 88009, 88010, 88011, 
+    88012, 88013, 88014, 88015, 88016, 88017, 88018, 88019, 88020, 88021, 
+    88022, 88023, 88024, 88025, 88026, 88027, 88028, 88029, 88030, 88031, 
+    88032, 88033, 88034, 88035, 88036, 88037, 88038, 88039, 88040, 88041, 
+    88042, 88043, 88044, 88045, 88046, 88047, 88048, 88049, 88050, 88051, 
+    88052, 88053, 88054, 88055, 88056, 88057, 88058, 88059, 88060, 88061, 
+    88062, 88063, 88064, 88065, 88066, 88067, 88068, 88069, 88070, 88071, 
+    88072, 88073, 88074, 88075, 88076, 88077, 88078, 88079, 88080, 88081, 
+    88082, 88083, 88084, 88085, 88086, 88087, 88088, 88089, 88090, 88091, 
+    88092, 88093, 88094, 88095, 88096, 88097, 88098, 88099, 88100, 88101, 
+    88102, 88103, 88104, 88105, 88106, 88107, 88108, 88109, 88110, 88111, 
+    88112, 88113, 88114, 88115, 88116, 88117, 88118, 88119, 88120, 88121, 
+    88122, 88123, 88124, 88125, 88126, 88127, 88128, 88129, 88130, 88131, 
+    88132, 88133, 88134, 88135, 88136, 88137, 88138, 88139, 88140, 88141, 
+    88142, 88143, 88144, 88145, 88146, 88147, 88148, 88149, 88150, 88151, 
+    88152, 88153, 88154, 88155, 88156, 88157, 88158, 88159, 88160, 88161, 
+    88162, 88163, 88164, 88165, 88166, 88167, 88168, 88169, 88170, 88171, 
+    88172, 88173, 88174, 88175, 88176, 88177, 88178, 88179, 88180, 88181, 
+    88182, 88183, 88184, 88185, 88186, 88187, 88188, 88189, 88190, 88191, 
+    88192, 88193, 88194, 88195, 88196, 88197, 88198, 88199, 88200, 88201, 
+    88202, 88203, 88204, 88205, 88206, 88207, 88208, 88209, 88210, 88211, 
+    88212, 88213, 88214, 88215, 88216, 88217, 88218, 88219, 88220, 88221, 
+    88222, 88223, 88224, 88225, 88226, 88227, 88228, 88229, 88230, 88231, 
+    88232, 88233, 88234, 88235, 88236, 88237, 88238, 88239, 88240, 88241, 
+    88242, 88243, 88244, 88245, 88246, 88247, 88248, 88249, 88250, 88251, 
+    88252, 88253, 88254, 88255, 88256, 88257, 88258, 88259, 88260, 88261, 
+    88262, 88263, 88264, 88265, 88266, 88267, 88268, 88269, 88270, 88271, 
+    88272, 88273, 88274, 88275, 88276, 88277, 88278, 88279, 88280, 88281, 
+    88282, 88283, 88284, 88285, 88286, 88287, 88288, 88289, 88290, 88291, 
+    88292, 88293, 88294, 88295, 88296, 88297, 88298, 88299, 88300, 88301, 
+    88302, 88303, 88304, 88305, 88306, 88307, 88308, 88309, 88310, 88311, 
+    88312, 88313, 88314, 88315, 88316, 88317, 88318, 88319, 88320, 88321, 
+    88322, 88323, 88324, 88325, 88326, 88327, 88328, 88329, 88330, 88331, 
+    88332, 88333, 88334, 88335, 88336, 88337, 88338, 88339, 88340, 88341, 
+    88342, 88343, 88344, 88345, 88346, 88347, 88348, 88349, 88350, 88351, 
+    88352, 88353, 88354, 88355, 88356, 88357, 88358, 88359, 88360, 88361, 
+    88362, 88363, 88364, 88365, 88366, 88367, 88368, 88369, 88370, 88371, 
+    88372, 88373, 88374, 88375, 88376, 88377, 88378, 88379, 88380, 88381, 
+    88382, 88383, 88384, 88385, 88386, 88387, 88388, 88389, 88390, 88391, 
+    88392, 88393, 88394, 88395, 88396, 88397, 88398, 88399, 88400, 88401, 
+    88402, 88403, 88404, 88405, 88406, 88407, 88408, 88409, 88410, 88411, 
+    88412, 88413, 88414, 88415, 88416, 88417, 88418, 88419, 88420, 88421, 
+    88422, 88423, 88424, 88425, 88426, 88427, 88428, 88429, 88430, 88431, 
+    88432, 88433, 88434, 88435, 88436, 88437, 88438, 88439, 88440, 88441, 
+    88442, 88443, 88444, 88445, 88446, 88447, 88448, 88449, 88450, 88451, 
+    88452, 88453, 88454, 88455, 88456, 88457, 88458, 88459, 88460, 88461, 
+    88462, 88463, 88464, 88465, 88466, 88467, 88468, 88469, 88470, 88471, 
+    88472, 88473, 88474, 88475, 88476, 88477, 88478, 88479, 88480, 88481, 
+    88482, 88483, 88484, 88485, 88486, 88487, 88488, 88489, 88490, 88491, 
+    88492, 88493, 88494, 88495, 88496, 88497, 88498, 88499, 88500, 88501, 
+    88502, 88503, 88504, 88505, 88506, 88507, 88508, 88509, 88510, 88511, 
+    88512, 88513, 88514, 88515, 88516, 88517, 88518, 88519, 88520, 88521, 
+    88522, 88523, 88524, 88525, 88526, 88527, 88528, 88529, 88530, 88531, 
+    88532, 88533, 88534, 88535, 88536, 88537, 88538, 88539, 88540, 88541, 
+    88542, 88543, 88544, 88545, 88546, 88547, 88548, 88549, 88550, 88551, 
+    88552, 88553, 88554, 88555, 88556, 88557, 88558, 88559, 88560, 88561, 
+    88562, 88563, 88564, 88565, 88566, 88567, 88568, 88569, 88570, 88571, 
+    88572, 88573, 88574, 88575, 88576, 88577, 88578, 88579, 88580, 88581, 
+    88582, 88583, 88584, 88585, 88586, 88587, 88588, 88589, 88590, 88591, 
+    88592, 88593, 88594, 88595, 88596, 88597, 88598, 88599, 88600, 88601, 
+    88602, 88603, 88604, 88605, 88606, 88607, 88608, 88609, 88610, 88611, 
+    88612, 88613, 88614, 88615, 88616, 88617, 88618, 88619, 88620, 88621, 
+    88622, 88623, 88624, 88625, 88626, 88627, 88628, 88629, 88630, 88631, 
+    88632, 88633, 88634, 88635, 88636, 88637, 88638, 88639, 88640, 88641, 
+    88642, 88643, 88644, 88645, 88646, 88647, 88648, 88649, 88650, 88651, 
+    88652, 88653, 88654, 88655, 88656, 88657, 88658, 88659, 88660, 88661, 
+    88662, 88663, 88664, 88665, 88666, 88667, 88668, 88669, 88670, 88671, 
+    88672, 88673, 88674, 88675, 88676, 88677, 88678, 88679, 88680, 88681, 
+    88682, 88683, 88684, 88685, 88686, 88687, 88688, 88689, 88690, 88691, 
+    88692, 88693, 88694, 88695, 88696, 88697, 88698, 88699, 88700, 88701, 
+    88702, 88703, 88704, 88705, 88706, 88707, 88708, 88709, 88710, 88711, 
+    88712, 88713, 88714, 88715, 88716, 88717, 88718, 88719, 88720, 88721, 
+    88722, 88723, 88724, 88725, 88726, 88727, 88728, 88729, 88730, 88731, 
+    88732, 88733, 88734, 88735, 88736, 88737, 88738, 88739, 88740, 88741, 
+    88742, 88743, 88744, 88745, 88746, 88747, 88748, 88749, 88750, 88751, 
+    88752, 88753, 88754, 88755, 88756, 88757, 88758, 88759, 88760, 88761, 
+    88762, 88763, 88764, 88765, 88766, 88767, 88768, 88769, 88770, 88771, 
+    88772, 88773, 88774, 88775, 88776, 88777, 88778, 88779, 88780, 88781, 
+    88782, 88783, 88784, 88785, 88786, 88787, 88788, 88789, 88790, 88791, 
+    88792, 88793, 88794, 88795, 88796, 88797, 88798, 88799, 88800, 88801, 
+    88802, 88803, 88804, 88805, 88806, 88807, 88808, 88809, 88810, 88811, 
+    88812, 88813, 88814, 88815, 88816, 88817, 88818, 88819, 88820, 88821, 
+    88822, 88823, 88824, 88825, 88826, 88827, 88828, 88829, 88830, 88831, 
+    88832, 88833, 88834, 88835, 88836, 88837, 88838, 88839, 88840, 88841, 
+    88842, 88843, 88844, 88845, 88846, 88847, 88848, 88849, 88850, 88851, 
+    88852, 88853, 88854, 88855, 88856, 88857, 88858, 88859, 88860, 88861, 
+    88862, 88863, 88864, 88865, 88866, 88867, 88868, 88869, 88870, 88871, 
+    88872, 88873, 88874, 88875, 88876, 88877, 88878, 88879, 88880, 88881, 
+    88882, 88883, 88884, 88885, 88886, 88887, 88888, 88889, 88890, 88891, 
+    88892, 88893, 88894, 88895, 88896, 88897, 88898, 88899, 88900, 88901, 
+    88902, 88903, 88904, 88905, 88906, 88907, 88908, 88909, 88910, 88911, 
+    88912, 88913, 88914, 88915, 88916, 88917, 88918, 88919, 88920, 88921, 
+    88922, 88923, 88924, 88925, 88926, 88927, 88928, 88929, 88930, 88931, 
+    88932, 88933, 88934, 88935, 88936, 88937, 88938, 88939, 88940, 88941, 
+    88942, 88943, 88944, 88945, 88946, 88947, 88948, 88949, 88950, 88951, 
+    88952, 88953, 88954, 88955, 88956, 88957, 88958, 88959, 88960, 88961, 
+    88962, 88963, 88964, 88965, 88966, 88967, 88968, 88969, 88970, 88971, 
+    88972, 88973, 88974, 88975, 88976, 88977, 88978, 88979, 88980, 88981, 
+    88982, 88983, 88984, 88985, 88986, 88987, 88988, 88989, 88990, 88991, 
+    88992, 88993, 88994, 88995, 88996, 88997, 88998, 88999, 89000, 89001, 
+    89002, 89003, 89004, 89005, 89006, 89007, 89008, 89009, 89010, 89011, 
+    89012, 89013, 89014, 89015, 89016, 89017, 89018, 89019, 89020, 89021, 
+    89022, 89023, 89024, 89025, 89026, 89027, 89028, 89029, 89030, 89031, 
+    89032, 89033, 89034, 89035, 89036, 89037, 89038, 89039, 89040, 89041, 
+    89042, 89043, 89044, 89045, 89046, 89047, 89048, 89049, 89050, 89051, 
+    89052, 89053, 89054, 89055, 89056, 89057, 89058, 89059, 89060, 89061, 
+    89062, 89063, 89064, 89065, 89066, 89067, 89068, 89069, 89070, 89071, 
+    89072, 89073, 89074, 89075, 89076, 89077, 89078, 89079, 89080, 89081, 
+    89082, 89083, 89084, 89085, 89086, 89087, 89088, 89089, 89090, 89091, 
+    89092, 89093, 89094, 89095, 89096, 89097, 89098, 89099, 89100, 89101, 
+    89102, 89103, 89104, 89105, 89106, 89107, 89108, 89109, 89110, 89111, 
+    89112, 89113, 89114, 89115, 89116, 89117, 89118, 89119, 89120, 89121, 
+    89122, 89123, 89124, 89125, 89126, 89127, 89128, 89129, 89130, 89131, 
+    89132, 89133, 89134, 89135, 89136, 89137, 89138, 89139, 89140, 89141, 
+    89142, 89143, 89144, 89145, 89146, 89147, 89148, 89149, 89150, 89151, 
+    89152, 89153, 89154, 89155, 89156, 89157, 89158, 89159, 89160, 89161, 
+    89162, 89163, 89164, 89165, 89166, 89167, 89168, 89169, 89170, 89171, 
+    89172, 89173, 89174, 89175, 89176, 89177, 89178, 89179, 89180, 89181, 
+    89182, 89183, 89184, 89185, 89186, 89187, 89188, 89189, 89190, 89191, 
+    89192, 89193, 89194, 89195, 89196, 89197, 89198, 89199, 89200, 89201, 
+    89202, 89203, 89204, 89205, 89206, 89207, 89208, 89209, 89210, 89211, 
+    89212, 89213, 89214, 89215, 89216, 89217, 89218, 89219, 89220, 89221, 
+    89222, 89223, 89224, 89225, 89226, 89227, 89228, 89229, 89230, 89231, 
+    89232, 89233, 89234, 89235, 89236, 89237, 89238, 89239, 89240, 89241, 
+    89242, 89243, 89244, 89245, 89246, 89247, 89248, 89249, 89250, 89251, 
+    89252, 89253, 89254, 89255, 89256, 89257, 89258, 89259, 89260, 89261, 
+    89262, 89263, 89264, 89265, 89266, 89267, 89268, 89269, 89270, 89271, 
+    89272, 89273, 89274, 89275, 89276, 89277, 89278, 89279, 89280, 89281, 
+    89282, 89283, 89284, 89285, 89286, 89287, 89288, 89289, 89290, 89291, 
+    89292, 89293, 89294, 89295, 89296, 89297, 89298, 89299, 89300, 89301, 
+    89302, 89303, 89304, 89305, 89306, 89307, 89308, 89309, 89310, 89311, 
+    89312, 89313, 89314, 89315, 89316, 89317, 89318, 89319, 89320, 89321, 
+    89322, 89323, 89324, 89325, 89326, 89327, 89328, 89329, 89330, 89331, 
+    89332, 89333, 89334, 89335, 89336, 89337, 89338, 89339, 89340, 89341, 
+    89342, 89343, 89344, 89345, 89346, 89347, 89348, 89349, 89350, 89351, 
+    89352, 89353, 89354, 89355, 89356, 89357, 89358, 89359, 89360, 89361, 
+    89362, 89363, 89364, 89365, 89366, 89367, 89368, 89369, 89370, 89371, 
+    89372, 89373, 89374, 89375, 89376, 89377, 89378, 89379, 89380, 89381, 
+    89382, 89383, 89384, 89385, 89386, 89387, 89388, 89389, 89390, 89391, 
+    89392, 89393, 89394, 89395, 89396, 89397, 89398, 89399, 89400, 89401, 
+    89402, 89403, 89404, 89405, 89406, 89407, 89408, 89409, 89410, 89411, 
+    89412, 89413, 89414, 89415, 89416, 89417, 89418, 89419, 89420, 89421, 
+    89422, 89423, 89424, 89425, 89426, 89427, 89428, 89429, 89430, 89431, 
+    89432, 89433, 89434, 89435, 89436, 89437, 89438, 89439, 89440, 89441, 
+    89442, 89443, 89444, 89445, 89446, 89447, 89448, 89449, 89450, 89451, 
+    89452, 89453, 89454, 89455, 89456, 89457, 89458, 89459, 89460, 89461, 
+    89462, 89463, 89464, 89465, 89466, 89467, 89468, 89469, 89470, 89471, 
+    89472, 89473, 89474, 89475, 89476, 89477, 89478, 89479, 89480, 89481, 
+    89482, 89483, 89484, 89485, 89486, 89487, 89488, 89489, 89490, 89491, 
+    89492, 89493, 89494, 89495, 89496, 89497, 89498, 89499, 89500, 89501, 
+    89502, 89503, 89504, 89505, 89506, 89507, 89508, 89509, 89510, 89511, 
+    89512, 89513, 89514, 89515, 89516, 89517, 89518, 89519, 89520, 89521, 
+    89522, 89523, 89524, 89525, 89526, 89527, 89528, 89529, 89530, 89531, 
+    89532, 89533, 89534, 89535, 89536, 89537, 89538, 89539, 89540, 89541, 
+    89542, 89543, 89544, 89545, 89546, 89547, 89548, 89549, 89550, 89551, 
+    89552, 89553, 89554, 89555, 89556, 89557, 89558, 89559, 89560, 89561, 
+    89562, 89563, 89564, 89565, 89566, 89567, 89568, 89569, 89570, 89571, 
+    89572, 89573, 89574, 89575, 89576, 89577, 89578, 89579, 89580, 89581, 
+    89582, 89583, 89584, 89585, 89586, 89587, 89588, 89589, 89590, 89591, 
+    89592, 89593, 89594, 89595, 89596, 89597, 89598, 89599, 89600, 89601, 
+    89602, 89603, 89604, 89605, 89606, 89607, 89608, 89609, 89610, 89611, 
+    89612, 89613, 89614, 89615, 89616, 89617, 89618, 89619, 89620, 89621, 
+    89622, 89623, 89624, 89625, 89626, 89627, 89628, 89629, 89630, 89631, 
+    89632, 89633, 89634, 89635, 89636, 89637, 89638, 89639, 89640, 89641, 
+    89642, 89643, 89644, 89645, 89646, 89647, 89648, 89649, 89650, 89651, 
+    89652, 89653, 89654, 89655, 89656, 89657, 89658, 89659, 89660, 89661, 
+    89662, 89663, 89664, 89665, 89666, 89667, 89668, 89669, 89670, 89671, 
+    89672, 89673, 89674, 89675, 89676, 89677, 89678, 89679, 89680, 89681, 
+    89682, 89683, 89684, 89685, 89686, 89687, 89688, 89689, 89690, 89691, 
+    89692, 89693, 89694, 89695, 89696, 89697, 89698, 89699, 89700, 89701, 
+    89702, 89703, 89704, 89705, 89706, 89707, 89708, 89709, 89710, 89711, 
+    89712, 89713, 89714, 89715, 89716, 89717, 89718, 89719, 89720, 89721, 
+    89722, 89723, 89724, 89725, 89726, 89727, 89728, 89729, 89730, 89731, 
+    89732, 89733, 89734, 89735, 89736, 89737, 89738, 89739, 89740, 89741, 
+    89742, 89743, 89744, 89745, 89746, 89747, 89748, 89749, 89750, 89751, 
+    89752, 89753, 89754, 89755, 89756, 89757, 89758, 89759, 89760, 89761, 
+    89762, 89763, 89764, 89765, 89766, 89767, 89768, 89769, 89770, 89771, 
+    89772, 89773, 89774, 89775, 89776, 89777, 89778, 89779, 89780, 89781, 
+    89782, 89783, 89784, 89785, 89786, 89787, 89788, 89789, 89790, 89791, 
+    89792, 89793, 89794, 89795, 89796, 89797, 89798, 89799, 89800, 89801, 
+    89802, 89803, 89804, 89805, 89806, 89807, 89808, 89809, 89810, 89811, 
+    89812, 89813, 89814, 89815, 89816, 89817, 89818, 89819, 89820, 89821, 
+    89822, 89823, 89824, 89825, 89826, 89827, 89828, 89829, 89830, 89831, 
+    89832, 89833, 89834, 89835, 89836, 89837, 89838, 89839, 89840, 89841, 
+    89842, 89843, 89844, 89845, 89846, 89847, 89848, 89849, 89850, 89851, 
+    89852, 89853, 89854, 89855, 89856, 89857, 89858, 89859, 89860, 89861, 
+    89862, 89863, 89864, 89865, 89866, 89867, 89868, 89869, 89870, 89871, 
+    89872, 89873, 89874, 89875, 89876, 89877, 89878, 89879, 89880, 89881, 
+    89882, 89883, 89884, 89885, 89886, 89887, 89888, 89889, 89890, 89891, 
+    89892, 89893, 89894, 89895, 89896, 89897, 89898, 89899, 89900, 89901, 
+    89902, 89903, 89904, 89905, 89906, 89907, 89908, 89909, 89910, 89911, 
+    89912, 89913, 89914, 89915, 89916, 89917, 89918, 89919, 89920, 89921, 
+    89922, 89923, 89924, 89925, 89926, 89927, 89928, 89929, 89930, 89931, 
+    89932, 89933, 89934, 89935, 89936, 89937, 89938, 89939, 89940, 89941, 
+    89942, 89943, 89944, 89945, 89946, 89947, 89948, 89949, 89950, 89951, 
+    89952, 89953, 89954, 89955, 89956, 89957, 89958, 89959, 89960, 89961, 
+    89962, 89963, 89964, 89965, 89966, 89967, 89968, 89969, 89970, 89971, 
+    89972, 89973, 89974, 89975, 89976, 89977, 89978, 89979, 89980, 89981, 
+    89982, 89983, 89984, 89985, 89986, 89987, 89988, 89989, 89990, 89991, 
+    89992, 89993, 89994, 89995, 89996, 89997, 89998, 89999, 90000, 90001, 
+    90002, 90003, 90004, 90005, 90006, 90007, 90008, 90009, 90010, 90011, 
+    90012, 90013, 90014, 90015, 90016, 90017, 90018, 90019, 90020, 90021, 
+    90022, 90023, 90024, 90025, 90026, 90027, 90028, 90029, 90030, 90031, 
+    90032, 90033, 90034, 90035, 90036, 90037, 90038, 90039, 90040, 90041, 
+    90042, 90043, 90044, 90045, 90046, 90047, 90048, 90049, 90050, 90051, 
+    90052, 90053, 90054, 90055, 90056, 90057, 90058, 90059, 90060, 90061, 
+    90062, 90063, 90064, 90065, 90066, 90067, 90068, 90069, 90070, 90071, 
+    90072, 90073, 90074, 90075, 90076, 90077, 90078, 90079, 90080, 90081, 
+    90082, 90083, 90084, 90085, 90086, 90087, 90088, 90089, 90090, 90091, 
+    90092, 90093, 90094, 90095, 90096, 90097, 90098, 90099, 90100, 90101, 
+    90102, 90103, 90104, 90105, 90106, 90107, 90108, 90109, 90110, 90111, 
+    90112, 90113, 90114, 90115, 90116, 90117, 90118, 90119, 90120, 90121, 
+    90122, 90123, 90124, 90125, 90126, 90127, 90128, 90129, 90130, 90131, 
+    90132, 90133, 90134, 90135, 90136, 90137, 90138, 90139, 90140, 90141, 
+    90142, 90143, 90144, 90145, 90146, 90147, 90148, 90149, 90150, 90151, 
+    90152, 90153, 90154, 90155, 90156, 90157, 90158, 90159, 90160, 90161, 
+    90162, 90163, 90164, 90165, 90166, 90167, 90168, 90169, 90170, 90171, 
+    90172, 90173, 90174, 90175, 90176, 90177, 90178, 90179, 90180, 90181, 
+    90182, 90183, 90184, 90185, 90186, 90187, 90188, 90189, 90190, 90191, 
+    90192, 90193, 90194, 90195, 90196, 90197, 90198, 90199, 90200, 90201, 
+    90202, 90203, 90204, 90205, 90206, 90207, 90208, 90209, 90210, 90211, 
+    90212, 90213, 90214, 90215, 90216, 90217, 90218, 90219, 90220, 90221, 
+    90222, 90223, 90224, 90225, 90226, 90227, 90228, 90229, 90230, 90231, 
+    90232, 90233, 90234, 90235, 90236, 90237, 90238, 90239, 90240, 90241, 
+    90242, 90243, 90244, 90245, 90246, 90247, 90248, 90249, 90250, 90251, 
+    90252, 90253, 90254, 90255, 90256, 90257, 90258, 90259, 90260, 90261, 
+    90262, 90263, 90264, 90265, 90266, 90267, 90268, 90269, 90270, 90271, 
+    90272, 90273, 90274, 90275, 90276, 90277, 90278, 90279, 90280, 90281, 
+    90282, 90283, 90284, 90285, 90286, 90287, 90288, 90289, 90290, 90291, 
+    90292, 90293, 90294, 90295, 90296, 90297, 90298, 90299, 90300, 90301, 
+    90302, 90303, 90304, 90305, 90306, 90307, 90308, 90309, 90310, 90311, 
+    90312, 90313, 90314, 90315, 90316, 90317, 90318, 90319, 90320, 90321, 
+    90322, 90323, 90324, 90325, 90326, 90327, 90328, 90329, 90330, 90331, 
+    90332, 90333, 90334, 90335, 90336, 90337, 90338, 90339, 90340, 90341, 
+    90342, 90343, 90344, 90345, 90346, 90347, 90348, 90349, 90350, 90351, 
+    90352, 90353, 90354, 90355, 90356, 90357, 90358, 90359, 90360, 90361, 
+    90362, 90363, 90364, 90365, 90366, 90367, 90368, 90369, 90370, 90371, 
+    90372, 90373, 90374, 90375, 90376, 90377, 90378, 90379, 90380, 90381, 
+    90382, 90383, 90384, 90385, 90386, 90387, 90388, 90389, 90390, 90391, 
+    90392, 90393, 90394, 90395, 90396, 90397, 90398, 90399, 90400, 90401, 
+    90402, 90403, 90404, 90405, 90406, 90407, 90408, 90409, 90410, 90411, 
+    90412, 90413, 90414, 90415, 90416, 90417, 90418, 90419, 90420, 90421, 
+    90422, 90423, 90424, 90425, 90426, 90427, 90428, 90429, 90430, 90431, 
+    90432, 90433, 90434, 90435, 90436, 90437, 90438, 90439, 90440, 90441, 
+    90442, 90443, 90444, 90445, 90446, 90447, 90448, 90449, 90450, 90451, 
+    90452, 90453, 90454, 90455, 90456, 90457, 90458, 90459, 90460, 90461, 
+    90462, 90463, 90464, 90465, 90466, 90467, 90468, 90469, 90470, 90471, 
+    90472, 90473, 90474, 90475, 90476, 90477, 90478, 90479, 90480, 90481, 
+    90482, 90483, 90484, 90485, 90486, 90487, 90488, 90489, 90490, 90491, 
+    90492, 90493, 90494, 90495, 90496, 90497, 90498, 90499, 90500, 90501, 
+    90502, 90503, 90504, 90505, 90506, 90507, 90508, 90509, 90510, 90511, 
+    90512, 90513, 90514, 90515, 90516, 90517, 90518, 90519, 90520, 90521, 
+    90522, 90523, 90524, 90525, 90526, 90527, 90528, 90529, 90530, 90531, 
+    90532, 90533, 90534, 90535, 90536, 90537, 90538, 90539, 90540, 90541, 
+    90542, 90543, 90544, 90545, 90546, 90547, 90548, 90549, 90550, 90551, 
+    90552, 90553, 90554, 90555, 90556, 90557, 90558, 90559, 90560, 90561, 
+    90562, 90563, 90564, 90565, 90566, 90567, 90568, 90569, 90570, 90571, 
+    90572, 90573, 90574, 90575, 90576, 90577, 90578, 90579, 90580, 90581, 
+    90582, 90583, 90584, 90585, 90586, 90587, 90588, 90589, 90590, 90591, 
+    90592, 90593, 90594, 90595, 90596, 90597, 90598, 90599, 90600, 90601, 
+    90602, 90603, 90604, 90605, 90606, 90607, 90608, 90609, 90610, 90611, 
+    90612, 90613, 90614, 90615, 90616, 90617, 90618, 90619, 90620, 90621, 
+    90622, 90623, 90624, 90625, 90626, 90627, 90628, 90629, 90630, 90631, 
+    90632, 90633, 90634, 90635, 90636, 90637, 90638, 90639, 90640, 90641, 
+    90642, 90643, 90644, 90645, 90646, 90647, 90648, 90649, 90650, 90651, 
+    90652, 90653, 90654, 90655, 90656, 90657, 90658, 90659, 90660, 90661, 
+    90662, 90663, 90664, 90665, 90666, 90667, 90668, 90669, 90670, 90671, 
+    90672, 90673, 90674, 90675, 90676, 90677, 90678, 90679, 90680, 90681, 
+    90682, 90683, 90684, 90685, 90686, 90687, 90688, 90689, 90690, 90691, 
+    90692, 90693, 90694, 90695, 90696, 90697, 90698, 90699, 90700, 90701, 
+    90702, 90703, 90704, 90705, 90706, 90707, 90708, 90709, 90710, 90711, 
+    90712, 90713, 90714, 90715, 90716, 90717, 90718, 90719, 90720, 90721, 
+    90722, 90723, 90724, 90725, 90726, 90727, 90728, 90729, 90730, 90731, 
+    90732, 90733, 90734, 90735, 90736, 90737, 90738, 90739, 90740, 90741, 
+    90742, 90743, 90744, 90745, 90746, 90747, 90748, 90749, 90750, 90751, 
+    90752, 90753, 90754, 90755, 90756, 90757, 90758, 90759, 90760, 90761, 
+    90762, 90763, 90764, 90765, 90766, 90767, 90768, 90769, 90770, 90771, 
+    90772, 90773, 90774, 90775, 90776, 90777, 90778, 90779, 90780, 90781, 
+    90782, 90783, 90784, 90785, 90786, 90787, 90788, 90789, 90790, 90791, 
+    90792, 90793, 90794, 90795, 90796, 90797, 90798, 90799, 90800, 90801, 
+    90802, 90803, 90804, 90805, 90806, 90807, 90808, 90809, 90810, 90811, 
+    90812, 90813, 90814, 90815, 90816, 90817, 90818, 90819, 90820, 90821, 
+    90822, 90823, 90824, 90825, 90826, 90827, 90828, 90829, 90830, 90831, 
+    90832, 90833, 90834, 90835, 90836, 90837, 90838, 90839, 90840, 90841, 
+    90842, 90843, 90844, 90845, 90846, 90847, 90848, 90849, 90850, 90851, 
+    90852, 90853, 90854, 90855, 90856, 90857, 90858, 90859, 90860, 90861, 
+    90862, 90863, 90864, 90865, 90866, 90867, 90868, 90869, 90870, 90871, 
+    90872, 90873, 90874, 90875, 90876, 90877, 90878, 90879, 90880, 90881, 
+    90882, 90883, 90884, 90885, 90886, 90887, 90888, 90889, 90890, 90891, 
+    90892, 90893, 90894, 90895, 90896, 90897, 90898, 90899, 90900, 90901, 
+    90902, 90903, 90904, 90905, 90906, 90907, 90908, 90909, 90910, 90911, 
+    90912, 90913, 90914, 90915, 90916, 90917, 90918, 90919, 90920, 90921, 
+    90922, 90923, 90924, 90925, 90926, 90927, 90928, 90929, 90930, 90931, 
+    90932, 90933, 90934, 90935, 90936, 90937, 90938, 90939, 90940, 90941, 
+    90942, 90943, 90944, 90945, 90946, 90947, 90948, 90949, 90950, 90951, 
+    90952, 90953, 90954, 90955, 90956, 90957, 90958, 90959, 90960, 90961, 
+    90962, 90963, 90964, 90965, 90966, 90967, 90968, 90969, 90970, 90971, 
+    90972, 90973, 90974, 90975, 90976, 90977, 90978, 90979, 90980, 90981, 
+    90982, 90983, 90984, 90985, 90986, 90987, 90988, 90989, 90990, 90991, 
+    90992, 90993, 90994, 90995, 90996, 90997, 90998, 90999, 91000, 91001, 
+    91002, 91003, 91004, 91005, 91006, 91007, 91008, 91009, 91010, 91011, 
+    91012, 91013, 91014, 91015, 91016, 91017, 91018, 91019, 91020, 91021, 
+    91022, 91023, 91024, 91025, 91026, 91027, 91028, 91029, 91030, 91031, 
+    91032, 91033, 91034, 91035, 91036, 91037, 91038, 91039, 91040, 91041, 
+    91042, 91043, 91044, 91045, 91046, 91047, 91048, 91049, 91050, 91051, 
+    91052, 91053, 91054, 91055, 91056, 91057, 91058, 91059, 91060, 91061, 
+    91062, 91063, 91064, 91065, 91066, 91067, 91068, 91069, 91070, 91071, 
+    91072, 91073, 91074, 91075, 91076, 91077, 91078, 91079, 91080, 91081, 
+    91082, 91083, 91084, 91085, 91086, 91087, 91088, 91089, 91090, 91091, 
+    91092, 91093, 91094, 91095, 91096, 91097, 91098, 91099, 91100, 91101, 
+    91102, 91103, 91104, 91105, 91106, 91107, 91108, 91109, 91110, 91111, 
+    91112, 91113, 91114, 91115, 91116, 91117, 91118, 91119, 91120, 91121, 
+    91122, 91123, 91124, 91125, 91126, 91127, 91128, 91129, 91130, 91131, 
+    91132, 91133, 91134, 91135, 91136, 91137, 91138, 91139, 91140, 91141, 
+    91142, 91143, 91144, 91145, 91146, 91147, 91148, 91149, 91150, 91151, 
+    91152, 91153, 91154, 91155, 91156, 91157, 91158, 91159, 91160, 91161, 
+    91162, 91163, 91164, 91165, 91166, 91167, 91168, 91169, 91170, 91171, 
+    91172, 91173, 91174, 91175, 91176, 91177, 91178, 91179, 91180, 91181, 
+    91182, 91183, 91184, 91185, 91186, 91187, 91188, 91189, 91190, 91191, 
+    91192, 91193, 91194, 91195, 91196, 91197, 91198, 91199, 91200, 91201, 
+    91202, 91203, 91204, 91205, 91206, 91207, 91208, 91209, 91210, 91211, 
+    91212, 91213, 91214, 91215, 91216, 91217, 91218, 91219, 91220, 91221, 
+    91222, 91223, 91224, 91225, 91226, 91227, 91228, 91229, 91230, 91231, 
+    91232, 91233, 91234, 91235, 91236, 91237, 91238, 91239, 91240, 91241, 
+    91242, 91243, 91244, 91245, 91246, 91247, 91248, 91249, 91250, 91251, 
+    91252, 91253, 91254, 91255, 91256, 91257, 91258, 91259, 91260, 91261, 
+    91262, 91263, 91264, 91265, 91266, 91267, 91268, 91269, 91270, 91271, 
+    91272, 91273, 91274, 91275, 91276, 91277, 91278, 91279, 91280, 91281, 
+    91282, 91283, 91284, 91285, 91286, 91287, 91288, 91289, 91290, 91291, 
+    91292, 91293, 91294, 91295, 91296, 91297, 91298, 91299, 91300, 91301, 
+    91302, 91303, 91304, 91305, 91306, 91307, 91308, 91309, 91310, 91311, 
+    91312, 91313, 91314, 91315, 91316, 91317, 91318, 91319, 91320, 91321, 
+    91322, 91323, 91324, 91325, 91326, 91327, 91328, 91329, 91330, 91331, 
+    91332, 91333, 91334, 91335, 91336, 91337, 91338, 91339, 91340, 91341, 
+    91342, 91343, 91344, 91345, 91346, 91347, 91348, 91349, 91350, 91351, 
+    91352, 91353, 91354, 91355, 91356, 91357, 91358, 91359, 91360, 91361, 
+    91362, 91363, 91364, 91365, 91366, 91367, 91368, 91369, 91370, 91371, 
+    91372, 91373, 91374, 91375, 91376, 91377, 91378, 91379, 91380, 91381, 
+    91382, 91383, 91384, 91385, 91386, 91387, 91388, 91389, 91390, 91391, 
+    91392, 91393, 91394, 91395, 91396, 91397, 91398, 91399, 91400, 91401, 
+    91402, 91403, 91404, 91405, 91406, 91407, 91408, 91409, 91410, 91411, 
+    91412, 91413, 91414, 91415, 91416, 91417, 91418, 91419, 91420, 91421, 
+    91422, 91423, 91424, 91425, 91426, 91427, 91428, 91429, 91430, 91431, 
+    91432, 91433, 91434, 91435, 91436, 91437, 91438, 91439, 91440, 91441, 
+    91442, 91443, 91444, 91445, 91446, 91447, 91448, 91449, 91450, 91451, 
+    91452, 91453, 91454, 91455, 91456, 91457, 91458, 91459, 91460, 91461, 
+    91462, 91463, 91464, 91465, 91466, 91467, 91468, 91469, 91470, 91471, 
+    91472, 91473, 91474, 91475, 91476, 91477, 91478, 91479, 91480, 91481, 
+    91482, 91483, 91484, 91485, 91486, 91487, 91488, 91489, 91490, 91491, 
+    91492, 91493, 91494, 91495, 91496, 91497, 91498, 91499, 91500, 91501, 
+    91502, 91503, 91504, 91505, 91506, 91507, 91508, 91509, 91510, 91511, 
+    91512, 91513, 91514, 91515, 91516, 91517, 91518, 91519, 91520, 91521, 
+    91522, 91523, 91524, 91525, 91526, 91527, 91528, 91529, 91530, 91531, 
+    91532, 91533, 91534, 91535, 91536, 91537, 91538, 91539, 91540, 91541, 
+    91542, 91543, 91544, 91545, 91546, 91547, 91548, 91549, 91550, 91551, 
+    91552, 91553, 91554, 91555, 91556, 91557, 91558, 91559, 91560, 91561, 
+    91562, 91563, 91564, 91565, 91566, 91567, 91568, 91569, 91570, 91571, 
+    91572, 91573, 91574, 91575, 91576, 91577, 91578, 91579, 91580, 91581, 
+    91582, 91583, 91584, 91585, 91586, 91587, 91588, 91589, 91590, 91591, 
+    91592, 91593, 91594, 91595, 91596, 91597, 91598, 91599, 91600, 91601, 
+    91602, 91603, 91604, 91605, 91606, 91607, 91608, 91609, 91610, 91611, 
+    91612, 91613, 91614, 91615, 91616, 91617, 91618, 91619, 91620, 91621, 
+    91622, 91623, 91624, 91625, 91626, 91627, 91628, 91629, 91630, 91631, 
+    91632, 91633, 91634, 91635, 91636, 91637, 91638, 91639, 91640, 91641, 
+    91642, 91643, 91644, 91645, 91646, 91647, 91648, 91649, 91650, 91651, 
+    91652, 91653, 91654, 91655, 91656, 91657, 91658, 91659, 91660, 91661, 
+    91662, 91663, 91664, 91665, 91666, 91667, 91668, 91669, 91670, 91671, 
+    91672, 91673, 91674, 91675, 91676, 91677, 91678, 91679, 91680, 91681, 
+    91682, 91683, 91684, 91685, 91686, 91687, 91688, 91689, 91690, 91691, 
+    91692, 91693, 91694, 91695, 91696, 91697, 91698, 91699, 91700, 91701, 
+    91702, 91703, 91704, 91705, 91706, 91707, 91708, 91709, 91710, 91711, 
+    91712, 91713, 91714, 91715, 91716, 91717, 91718, 91719, 91720, 91721, 
+    91722, 91723, 91724, 91725, 91726, 91727, 91728, 91729, 91730, 91731, 
+    91732, 91733, 91734, 91735, 91736, 91737, 91738, 91739, 91740, 91741, 
+    91742, 91743, 91744, 91745, 91746, 91747, 91748, 91749, 91750, 91751, 
+    91752, 91753, 91754, 91755, 91756, 91757, 91758, 91759, 91760, 91761, 
+    91762, 91763, 91764, 91765, 91766, 91767, 91768, 91769, 91770, 91771, 
+    91772, 91773, 91774, 91775, 91776, 91777, 91778, 91779, 91780, 91781, 
+    91782, 91783, 91784, 91785, 91786, 91787, 91788, 91789, 91790, 91791, 
+    91792, 91793, 91794, 91795, 91796, 91797, 91798, 91799, 91800, 91801, 
+    91802, 91803, 91804, 91805, 91806, 91807, 91808, 91809, 91810, 91811, 
+    91812, 91813, 91814, 91815, 91816, 91817, 91818, 91819, 91820, 91821, 
+    91822, 91823, 91824, 91825, 91826, 91827, 91828, 91829, 91830, 91831, 
+    91832, 91833, 91834, 91835, 91836, 91837, 91838, 91839, 91840, 91841, 
+    91842, 91843, 91844, 91845, 91846, 91847, 91848, 91849, 91850, 91851, 
+    91852, 91853, 91854, 91855, 91856, 91857, 91858, 91859, 91860, 91861, 
+    91862, 91863, 91864, 91865, 91866, 91867, 91868, 91869, 91870, 91871, 
+    91872, 91873, 91874, 91875, 91876, 91877, 91878, 91879, 91880, 91881, 
+    91882, 91883, 91884, 91885, 91886, 91887, 91888, 91889, 91890, 91891, 
+    91892, 91893, 91894, 91895, 91896, 91897, 91898, 91899, 91900, 91901, 
+    91902, 91903, 91904, 91905, 91906, 91907, 91908, 91909, 91910, 91911, 
+    91912, 91913, 91914, 91915, 91916, 91917, 91918, 91919, 91920, 91921, 
+    91922, 91923, 91924, 91925, 91926, 91927, 91928, 91929, 91930, 91931, 
+    91932, 91933, 91934, 91935, 91936, 91937, 91938, 91939, 91940, 91941, 
+    91942, 91943, 91944, 91945, 91946, 91947, 91948, 91949, 91950, 91951, 
+    91952, 91953, 91954, 91955, 91956, 91957, 91958, 91959, 91960, 91961, 
+    91962, 91963, 91964, 91965, 91966, 91967, 91968, 91969, 91970, 91971, 
+    91972, 91973, 91974, 91975, 91976, 91977, 91978, 91979, 91980, 91981, 
+    91982, 91983, 91984, 91985, 91986, 91987, 91988, 91989, 91990, 91991, 
+    91992, 91993, 91994, 91995, 91996, 91997, 91998, 91999, 92000, 92001, 
+    92002, 92003, 92004, 92005, 92006, 92007, 92008, 92009, 92010, 92011, 
+    92012, 92013, 92014, 92015, 92016, 92017, 92018, 92019, 92020, 92021, 
+    92022, 92023, 92024, 92025, 92026, 92027, 92028, 92029, 92030, 92031, 
+    92032, 92033, 92034, 92035, 92036, 92037, 92038, 92039, 92040, 92041, 
+    92042, 92043, 92044, 92045, 92046, 92047, 92048, 92049, 92050, 92051, 
+    92052, 92053, 92054, 92055, 92056, 92057, 92058, 92059, 92060, 92061, 
+    92062, 92063, 92064, 92065, 92066, 92067, 92068, 92069, 92070, 92071, 
+    92072, 92073, 92074, 92075, 92076, 92077, 92078, 92079, 92080, 92081, 
+    92082, 92083, 92084, 92085, 92086, 92087, 92088, 92089, 92090, 92091, 
+    92092, 92093, 92094, 92095, 92096, 92097, 92098, 92099, 92100, 92101, 
+    92102, 92103, 92104, 92105, 92106, 92107, 92108, 92109, 92110, 92111, 
+    92112, 92113, 92114, 92115, 92116, 92117, 92118, 92119, 92120, 92121, 
+    92122, 92123, 92124, 92125, 92126, 92127, 92128, 92129, 92130, 92131, 
+    92132, 92133, 92134, 92135, 92136, 92137, 92138, 92139, 92140, 92141, 
+    92142, 92143, 92144, 92145, 92146, 92147, 92148, 92149, 92150, 92151, 
+    92152, 92153, 92154, 92155, 92156, 92157, 92158, 92159, 92160, 92161, 
+    92162, 92163, 92164, 92165, 92166, 92167, 92168, 92169, 92170, 92171, 
+    92172, 92173, 92174, 92175, 92176, 92177, 92178, 92179, 92180, 92181, 
+    92182, 92183, 92184, 92185, 92186, 92187, 92188, 92189, 92190, 92191, 
+    92192, 92193, 92194, 92195, 92196, 92197, 92198, 92199, 92200, 92201, 
+    92202, 92203, 92204, 92205, 92206, 92207, 92208, 92209, 92210, 92211, 
+    92212, 92213, 92214, 92215, 92216, 92217, 92218, 92219, 92220, 92221, 
+    92222, 92223, 92224, 92225, 92226, 92227, 92228, 92229, 92230, 92231, 
+    92232, 92233, 92234, 92235, 92236, 92237, 92238, 92239, 92240, 92241, 
+    92242, 92243, 92244, 92245, 92246, 92247, 92248, 92249, 92250, 92251, 
+    92252, 92253, 92254, 92255, 92256, 92257, 92258, 92259, 92260, 92261, 
+    92262, 92263, 92264, 92265, 92266, 92267, 92268, 92269, 92270, 92271, 
+    92272, 92273, 92274, 92275, 92276, 92277, 92278, 92279, 92280, 92281, 
+    92282, 92283, 92284, 92285, 92286, 92287, 92288, 92289, 92290, 92291, 
+    92292, 92293, 92294, 92295, 92296, 92297, 92298, 92299, 92300, 92301, 
+    92302, 92303, 92304, 92305, 92306, 92307, 92308, 92309, 92310, 92311, 
+    92312, 92313, 92314, 92315, 92316, 92317, 92318, 92319, 92320, 92321, 
+    92322, 92323, 92324, 92325, 92326, 92327, 92328, 92329, 92330, 92331, 
+    92332, 92333, 92334, 92335, 92336, 92337, 92338, 92339, 92340, 92341, 
+    92342, 92343, 92344, 92345, 92346, 92347, 92348, 92349, 92350, 92351, 
+    92352, 92353, 92354, 92355, 92356, 92357, 92358, 92359, 92360, 92361, 
+    92362, 92363, 92364, 92365, 92366, 92367, 92368, 92369, 92370, 92371, 
+    92372, 92373, 92374, 92375, 92376, 92377, 92378, 92379, 92380, 92381, 
+    92382, 92383, 92384, 92385, 92386, 92387, 92388, 92389, 92390, 92391, 
+    92392, 92393, 92394, 92395, 92396, 92397, 92398, 92399, 92400, 92401, 
+    92402, 92403, 92404, 92405, 92406, 92407, 92408, 92409, 92410, 92411, 
+    92412, 92413, 92414, 92415, 92416, 92417, 92418, 92419, 92420, 92421, 
+    92422, 92423, 92424, 92425, 92426, 92427, 92428, 92429, 92430, 92431, 
+    92432, 92433, 92434, 92435, 92436, 92437, 92438, 92439, 92440, 92441, 
+    92442, 92443, 92444, 92445, 92446, 92447, 92448, 92449, 92450, 92451, 
+    92452, 92453, 92454, 92455, 92456, 92457, 92458, 92459, 92460, 92461, 
+    92462, 92463, 92464, 92465, 92466, 92467, 92468, 92469, 92470, 92471, 
+    92472, 92473, 92474, 92475, 92476, 92477, 92478, 92479, 92480, 92481, 
+    92482, 92483, 92484, 92485, 92486, 92487, 92488, 92489, 92490, 92491, 
+    92492, 92493, 92494, 92495, 92496, 92497, 92498, 92499, 92500, 92501, 
+    92502, 92503, 92504, 92505, 92506, 92507, 92508, 92509, 92510, 92511, 
+    92512, 92513, 92514, 92515, 92516, 92517, 92518, 92519, 92520, 92521, 
+    92522, 92523, 92524, 92525, 92526, 92527, 92528, 92529, 92530, 92531, 
+    92532, 92533, 92534, 92535, 92536, 92537, 92538, 92539, 92540, 92541, 
+    92542, 92543, 92544, 92545, 92546, 92547, 92548, 92549, 92550, 92551, 
+    92552, 92553, 92554, 92555, 92556, 92557, 92558, 92559, 92560, 92561, 
+    92562, 92563, 92564, 92565, 92566, 92567, 92568, 92569, 92570, 92571, 
+    92572, 92573, 92574, 92575, 92576, 92577, 92578, 92579, 92580, 92581, 
+    92582, 92583, 92584, 92585, 92586, 92587, 92588, 92589, 92590, 92591, 
+    92592, 92593, 92594, 92595, 92596, 92597, 92598, 92599, 92600, 92601, 
+    92602, 92603, 92604, 92605, 92606, 92607, 92608, 92609, 92610, 92611, 
+    92612, 92613, 92614, 92615, 92616, 92617, 92618, 92619, 92620, 92621, 
+    92622, 92623, 92624, 92625, 92626, 92627, 92628, 92629, 92630, 92631, 
+    92632, 92633, 92634, 92635, 92636, 92637, 92638, 92639, 92640, 92641, 
+    92642, 92643, 92644, 92645, 92646, 92647, 92648, 92649, 92650, 92651, 
+    92652, 92653, 92654, 92655, 92656, 92657, 92658, 92659, 92660, 92661, 
+    92662, 92663, 92664, 92665, 92666, 92667, 92668, 92669, 92670, 92671, 
+    92672, 92673, 92674, 92675, 92676, 92677, 92678, 92679, 92680, 92681, 
+    92682, 92683, 92684, 92685, 92686, 92687, 92688, 92689, 92690, 92691, 
+    92692, 92693, 92694, 92695, 92696, 92697, 92698, 92699, 92700, 92701, 
+    92702, 92703, 92704, 92705, 92706, 92707, 92708, 92709, 92710, 92711, 
+    92712, 92713, 92714, 92715, 92716, 92717, 92718, 92719, 92720, 92721, 
+    92722, 92723, 92724, 92725, 92726, 92727, 92728, 92729, 92730, 92731, 
+    92732, 92733, 92734, 92735, 92736, 92737, 92738, 92739, 92740, 92741, 
+    92742, 92743, 92744, 92745, 92746, 92747, 92748, 92749, 92750, 92751, 
+    92752, 92753, 92754, 92755, 92756, 92757, 92758, 92759, 92760, 92761, 
+    92762, 92763, 92764, 92765, 92766, 92767, 92768, 92769, 92770, 92771, 
+    92772, 92773, 92774, 92775, 92776, 92777, 92778, 92779, 92780, 92781, 
+    92782, 92783, 92784, 92785, 92786, 92787, 92788, 92789, 92790, 92791, 
+    92792, 92793, 92794, 92795, 92796, 92797, 92798, 92799, 92800, 92801, 
+    92802, 92803, 92804, 92805, 92806, 92807, 92808, 92809, 92810, 92811, 
+    92812, 92813, 92814, 92815, 92816, 92817, 92818, 92819, 92820, 92821, 
+    92822, 92823, 92824, 92825, 92826, 92827, 92828, 92829, 92830, 92831, 
+    92832, 92833, 92834, 92835, 92836, 92837, 92838, 92839, 92840, 92841, 
+    92842, 92843, 92844, 92845, 92846, 92847, 92848, 92849, 92850, 92851, 
+    92852, 92853, 92854, 92855, 92856, 92857, 92858, 92859, 92860, 92861, 
+    92862, 92863, 92864, 92865, 92866, 92867, 92868, 92869, 92870, 92871, 
+    92872, 92873, 92874, 92875, 92876, 92877, 92878, 92879, 92880, 92881, 
+    92882, 92883, 92884, 92885, 92886, 92887, 92888, 92889, 92890, 92891, 
+    92892, 92893, 92894, 92895, 92896, 92897, 92898, 92899, 92900, 92901, 
+    92902, 92903, 92904, 92905, 92906, 92907, 92908, 92909, 92910, 92911, 
+    92912, 92913, 92914, 92915, 92916, 92917, 92918, 92919, 92920, 92921, 
+    92922, 92923, 92924, 92925, 92926, 92927, 92928, 92929, 92930, 92931, 
+    92932, 92933, 92934, 92935, 92936, 92937, 92938, 92939, 92940, 92941, 
+    92942, 92943, 92944, 92945, 92946, 92947, 92948, 92949, 92950, 92951, 
+    92952, 92953, 92954, 92955, 92956, 92957, 92958, 92959, 92960, 92961, 
+    92962, 92963, 92964, 92965, 92966, 92967, 92968, 92969, 92970, 92971, 
+    92972, 92973, 92974, 92975, 92976, 92977, 92978, 92979, 92980, 92981, 
+    92982, 92983, 92984, 92985, 92986, 92987, 92988, 92989, 92990, 92991, 
+    92992, 92993, 92994, 92995, 92996, 92997, 92998, 92999, 93000, 93001, 
+    93002, 93003, 93004, 93005, 93006, 93007, 93008, 93009, 93010, 93011, 
+    93012, 93013, 93014, 93015, 93016, 93017, 93018, 93019, 93020, 93021, 
+    93022, 93023, 93024, 93025, 93026, 93027, 93028, 93029, 93030, 93031, 
+    93032, 93033, 93034, 93035, 93036, 93037, 93038, 93039, 93040, 93041, 
+    93042, 93043, 93044, 93045, 93046, 93047, 93048, 93049, 93050, 93051, 
+    93052, 93053, 93054, 93055, 93056, 93057, 93058, 93059, 93060, 93061, 
+    93062, 93063, 93064, 93065, 93066, 93067, 93068, 93069, 93070, 93071, 
+    93072, 93073, 93074, 93075, 93076, 93077, 93078, 93079, 93080, 93081, 
+    93082, 93083, 93084, 93085, 93086, 93087, 93088, 93089, 93090, 93091, 
+    93092, 93093, 93094, 93095, 93096, 93097, 93098, 93099, 93100, 93101, 
+    93102, 93103, 93104, 93105, 93106, 93107, 93108, 93109, 93110, 93111, 
+    93112, 93113, 93114, 93115, 93116, 93117, 93118, 93119, 93120, 93121, 
+    93122, 93123, 93124, 93125, 93126, 93127, 93128, 93129, 93130, 93131, 
+    93132, 93133, 93134, 93135, 93136, 93137, 93138, 93139, 93140, 93141, 
+    93142, 93143, 93144, 93145, 93146, 93147, 93148, 93149, 93150, 93151, 
+    93152, 93153, 93154, 93155, 93156, 93157, 93158, 93159, 93160, 93161, 
+    93162, 93163, 93164, 93165, 93166, 93167, 93168, 93169, 93170, 93171, 
+    93172, 93173, 93174, 93175, 93176, 93177, 93178, 93179, 93180, 93181, 
+    93182, 93183, 93184, 93185, 93186, 93187, 93188, 93189, 93190, 93191, 
+    93192, 93193, 93194, 93195, 93196, 93197, 93198, 93199, 93200, 93201, 
+    93202, 93203, 93204, 93205, 93206, 93207, 93208, 93209, 93210, 93211, 
+    93212, 93213, 93214, 93215, 93216, 93217, 93218, 93219, 93220, 93221, 
+    93222, 93223, 93224, 93225, 93226, 93227, 93228, 93229, 93230, 93231, 
+    93232, 93233, 93234, 93235, 93236, 93237, 93238, 93239, 93240, 93241, 
+    93242, 93243, 93244, 93245, 93246, 93247, 93248, 93249, 93250, 93251, 
+    93252, 93253, 93254, 93255, 93256, 93257, 93258, 93259, 93260, 93261, 
+    93262, 93263, 93264, 93265, 93266, 93267, 93268, 93269, 93270, 93271, 
+    93272, 93273, 93274, 93275, 93276, 93277, 93278, 93279, 93280, 93281, 
+    93282, 93283, 93284, 93285, 93286, 93287, 93288, 93289, 93290, 93291, 
+    93292, 93293, 93294, 93295, 93296, 93297, 93298, 93299, 93300, 93301, 
+    93302, 93303, 93304, 93305, 93306, 93307, 93308, 93309, 93310, 93311, 
+    93312, 93313, 93314, 93315, 93316, 93317, 93318, 93319, 93320, 93321, 
+    93322, 93323, 93324, 93325, 93326, 93327, 93328, 93329, 93330, 93331, 
+    93332, 93333, 93334, 93335, 93336, 93337, 93338, 93339, 93340, 93341, 
+    93342, 93343, 93344, 93345, 93346, 93347, 93348, 93349, 93350, 93351, 
+    93352, 93353, 93354, 93355, 93356, 93357, 93358, 93359, 93360, 93361, 
+    93362, 93363, 93364, 93365, 93366, 93367, 93368, 93369, 93370, 93371, 
+    93372, 93373, 93374, 93375, 93376, 93377, 93378, 93379, 93380, 93381, 
+    93382, 93383, 93384, 93385, 93386, 93387, 93388, 93389, 93390, 93391, 
+    93392, 93393, 93394, 93395, 93396, 93397, 93398, 93399, 93400, 93401, 
+    93402, 93403, 93404, 93405, 93406, 93407, 93408, 93409, 93410, 93411, 
+    93412, 93413, 93414, 93415, 93416, 93417, 93418, 93419, 93420, 93421, 
+    93422, 93423, 93424, 93425, 93426, 93427, 93428, 93429, 93430, 93431, 
+    93432, 93433, 93434, 93435, 93436, 93437, 93438, 93439, 93440, 93441, 
+    93442, 93443, 93444, 93445, 93446, 93447, 93448, 93449, 93450, 93451, 
+    93452, 93453, 93454, 93455, 93456, 93457, 93458, 93459, 93460, 93461, 
+    93462, 93463, 93464, 93465, 93466, 93467, 93468, 93469, 93470, 93471, 
+    93472, 93473, 93474, 93475, 93476, 93477, 93478, 93479, 93480, 93481, 
+    93482, 93483, 93484, 93485, 93486, 93487, 93488, 93489, 93490, 93491, 
+    93492, 93493, 93494, 93495, 93496, 93497, 93498, 93499, 93500, 93501, 
+    93502, 93503, 93504, 93505, 93506, 93507, 93508, 93509, 93510, 93511, 
+    93512, 93513, 93514, 93515, 93516, 93517, 93518, 93519, 93520, 93521, 
+    93522, 93523, 93524, 93525, 93526, 93527, 93528, 93529, 93530, 93531, 
+    93532, 93533, 93534, 93535, 93536, 93537, 93538, 93539, 93540, 93541, 
+    93542, 93543, 93544, 93545, 93546, 93547, 93548, 93549, 93550, 93551, 
+    93552, 93553, 93554, 93555, 93556, 93557, 93558, 93559, 93560, 93561, 
+    93562, 93563, 93564, 93565, 93566, 93567, 93568, 93569, 93570, 93571, 
+    93572, 93573, 93574, 93575, 93576, 93577, 93578, 93579, 93580, 93581, 
+    93582, 93583, 93584, 93585, 93586, 93587, 93588, 93589, 93590, 93591, 
+    93592, 93593, 93594, 93595, 93596, 93597, 93598, 93599, 93600, 93601, 
+    93602, 93603, 93604, 93605, 93606, 93607, 93608, 93609, 93610, 93611, 
+    93612, 93613, 93614, 93615, 93616, 93617, 93618, 93619, 93620, 93621, 
+    93622, 93623, 93624, 93625, 93626, 93627, 93628, 93629, 93630, 93631, 
+    93632, 93633, 93634, 93635, 93636, 93637, 93638, 93639, 93640, 93641, 
+    93642, 93643, 93644, 93645, 93646, 93647, 93648, 93649, 93650, 93651, 
+    93652, 93653, 93654, 93655, 93656, 93657, 93658, 93659, 93660, 93661, 
+    93662, 93663, 93664, 93665, 93666, 93667, 93668, 93669, 93670, 93671, 
+    93672, 93673, 93674, 93675, 93676, 93677, 93678, 93679, 93680, 93681, 
+    93682, 93683, 93684, 93685, 93686, 93687, 93688, 93689, 93690, 93691, 
+    93692, 93693, 93694, 93695, 93696, 93697, 93698, 93699, 93700, 93701, 
+    93702, 93703, 93704, 93705, 93706, 93707, 93708, 93709, 93710, 93711, 
+    93712, 93713, 93714, 93715, 93716, 93717, 93718, 93719, 93720, 93721, 
+    93722, 93723, 93724, 93725, 93726, 93727, 93728, 93729, 93730, 93731, 
+    93732, 93733, 93734, 93735, 93736, 93737, 93738, 93739, 93740, 93741, 
+    93742, 93743, 93744, 93745, 93746, 93747, 93748, 93749, 93750, 93751, 
+    93752, 93753, 93754, 93755, 93756, 93757, 93758, 93759, 93760, 93761, 
+    93762, 93763, 93764, 93765, 93766, 93767, 93768, 93769, 93770, 93771, 
+    93772, 93773, 93774, 93775, 93776, 93777, 93778, 93779, 93780, 93781, 
+    93782, 93783, 93784, 93785, 93786, 93787, 93788, 93789, 93790, 93791, 
+    93792, 93793, 93794, 93795, 93796, 93797, 93798, 93799, 93800, 93801, 
+    93802, 93803, 93804, 93805, 93806, 93807, 93808, 93809, 93810, 93811, 
+    93812, 93813, 93814, 93815, 93816, 93817, 93818, 93819, 93820, 93821, 
+    93822, 93823, 93824, 93825, 93826, 93827, 93828, 93829, 93830, 93831, 
+    93832, 93833, 93834, 93835, 93836, 93837, 93838, 93839, 93840, 93841, 
+    93842, 93843, 93844, 93845, 93846, 93847, 93848, 93849, 93850, 93851, 
+    93852, 93853, 93854, 93855, 93856, 93857, 93858, 93859, 93860, 93861, 
+    93862, 93863, 93864, 93865, 93866, 93867, 93868, 93869, 93870, 93871, 
+    93872, 93873, 93874, 93875, 93876, 93877, 93878, 93879, 93880, 93881, 
+    93882, 93883, 93884, 93885, 93886, 93887, 93888, 93889, 93890, 93891, 
+    93892, 93893, 93894, 93895, 93896, 93897, 93898, 93899, 93900, 93901, 
+    93902, 93903, 93904, 93905, 93906, 93907, 93908, 93909, 93910, 93911, 
+    93912, 93913, 93914, 93915, 93916, 93917, 93918, 93919, 93920, 93921, 
+    93922, 93923, 93924, 93925, 93926, 93927, 93928, 93929, 93930, 93931, 
+    93932, 93933, 93934, 93935, 93936, 93937, 93938, 93939, 93940, 93941, 
+    93942, 93943, 93944, 93945, 93946, 93947, 93948, 93949, 93950, 93951, 
+    93952, 93953, 93954, 93955, 93956, 93957, 93958, 93959, 93960, 93961, 
+    93962, 93963, 93964, 93965, 93966, 93967, 93968, 93969, 93970, 93971, 
+    93972, 93973, 93974, 93975, 93976, 93977, 93978, 93979, 93980, 93981, 
+    93982, 93983, 93984, 93985, 93986, 93987, 93988, 93989, 93990, 93991, 
+    93992, 93993, 93994, 93995, 93996, 93997, 93998, 93999, 94000, 94001, 
+    94002, 94003, 94004, 94005, 94006, 94007, 94008, 94009, 94010, 94011, 
+    94012, 94013, 94014, 94015, 94016, 94017, 94018, 94019, 94020, 94021, 
+    94022, 94023, 94024, 94025, 94026, 94027, 94028, 94029, 94030, 94031, 
+    94032, 94033, 94034, 94035, 94036, 94037, 94038, 94039, 94040, 94041, 
+    94042, 94043, 94044, 94045, 94046, 94047, 94048, 94049, 94050, 94051, 
+    94052, 94053, 94054, 94055, 94056, 94057, 94058, 94059, 94060, 94061, 
+    94062, 94063, 94064, 94065, 94066, 94067, 94068, 94069, 94070, 94071, 
+    94072, 94073, 94074, 94075, 94076, 94077, 94078, 94079, 94080, 94081, 
+    94082, 94083, 94084, 94085, 94086, 94087, 94088, 94089, 94090, 94091, 
+    94092, 94093, 94094, 94095, 94096, 94097, 94098, 94099, 94100, 94101, 
+    94102, 94103, 94104, 94105, 94106, 94107, 94108, 94109, 94110, 94111, 
+    94112, 94113, 94114, 94115, 94116, 94117, 94118, 94119, 94120, 94121, 
+    94122, 94123, 94124, 94125, 94126, 94127, 94128, 94129, 94130, 94131, 
+    94132, 94133, 94134, 94135, 94136, 94137, 94138, 94139, 94140, 94141, 
+    94142, 94143, 94144, 94145, 94146, 94147, 94148, 94149, 94150, 94151, 
+    94152, 94153, 94154, 94155, 94156, 94157, 94158, 94159, 94160, 94161, 
+    94162, 94163, 94164, 94165, 94166, 94167, 94168, 94169, 94170, 94171, 
+    94172, 94173, 94174, 94175, 94176, 94177, 94178, 94179, 94180, 94181, 
+    94182, 94183, 94184, 94185, 94186, 94187, 94188, 94189, 94190, 94191, 
+    94192, 94193, 94194, 94195, 94196, 94197, 94198, 94199, 94200, 94201, 
+    94202, 94203, 94204, 94205, 94206, 94207, 94208, 94209, 94210, 94211, 
+    94212, 94213, 94214, 94215, 94216, 94217, 94218, 94219, 94220, 94221, 
+    94222, 94223, 94224, 94225, 94226, 94227, 94228, 94229, 94230, 94231, 
+    94232, 94233, 94234, 94235, 94236, 94237, 94238, 94239, 94240, 94241, 
+    94242, 94243, 94244, 94245, 94246, 94247, 94248, 94249, 94250, 94251, 
+    94252, 94253, 94254, 94255, 94256, 94257, 94258, 94259, 94260, 94261, 
+    94262, 94263, 94264, 94265, 94266, 94267, 94268, 94269, 94270, 94271, 
+    94272, 94273, 94274, 94275, 94276, 94277, 94278, 94279, 94280, 94281, 
+    94282, 94283, 94284, 94285, 94286, 94287, 94288, 94289, 94290, 94291, 
+    94292, 94293, 94294, 94295, 94296, 94297, 94298, 94299, 94300, 94301, 
+    94302, 94303, 94304, 94305, 94306, 94307, 94308, 94309, 94310, 94311, 
+    94312, 94313, 94314, 94315, 94316, 94317, 94318, 94319, 94320, 94321, 
+    94322, 94323, 94324, 94325, 94326, 94327, 94328, 94329, 94330, 94331, 
+    94332, 94333, 94334, 94335, 94336, 94337, 94338, 94339, 94340, 94341, 
+    94342, 94343, 94344, 94345, 94346, 94347, 94348, 94349, 94350, 94351, 
+    94352, 94353, 94354, 94355, 94356, 94357, 94358, 94359, 94360, 94361, 
+    94362, 94363, 94364, 94365, 94366, 94367, 94368, 94369, 94370, 94371, 
+    94372, 94373, 94374, 94375, 94376, 94377, 94378, 94379, 94380, 94381, 
+    94382, 94383, 94384, 94385, 94386, 94387, 94388, 94389, 94390, 94391, 
+    94392, 94393, 94394, 94395, 94396, 94397, 94398, 94399, 94400, 94401, 
+    94402, 94403, 94404, 94405, 94406, 94407, 94408, 94409, 94410, 94411, 
+    94412, 94413, 94414, 94415, 94416, 94417, 94418, 94419, 94420, 94421, 
+    94422, 94423, 94424, 94425, 94426, 94427, 94428, 94429, 94430, 94431, 
+    94432, 94433, 94434, 94435, 94436, 94437, 94438, 94439, 94440, 94441, 
+    94442, 94443, 94444, 94445, 94446, 94447, 94448, 94449, 94450, 94451, 
+    94452, 94453, 94454, 94455, 94456, 94457, 94458, 94459, 94460, 94461, 
+    94462, 94463, 94464, 94465, 94466, 94467, 94468, 94469, 94470, 94471, 
+    94472, 94473, 94474, 94475, 94476, 94477, 94478, 94479, 94480, 94481, 
+    94482, 94483, 94484, 94485, 94486, 94487, 94488, 94489, 94490, 94491, 
+    94492, 94493, 94494, 94495, 94496, 94497, 94498, 94499, 94500, 94501, 
+    94502, 94503, 94504, 94505, 94506, 94507, 94508, 94509, 94510, 94511, 
+    94512, 94513, 94514, 94515, 94516, 94517, 94518, 94519, 94520, 94521, 
+    94522, 94523, 94524, 94525, 94526, 94527, 94528, 94529, 94530, 94531, 
+    94532, 94533, 94534, 94535, 94536, 94537, 94538, 94539, 94540, 94541, 
+    94542, 94543, 94544, 94545, 94546, 94547, 94548, 94549, 94550, 94551, 
+    94552, 94553, 94554, 94555, 94556, 94557, 94558, 94559, 94560, 94561, 
+    94562, 94563, 94564, 94565, 94566, 94567, 94568, 94569, 94570, 94571, 
+    94572, 94573, 94574, 94575, 94576, 94577, 94578, 94579, 94580, 94581, 
+    94582, 94583, 94584, 94585, 94586, 94587, 94588, 94589, 94590, 94591, 
+    94592, 94593, 94594, 94595, 94596, 94597, 94598, 94599, 94600, 94601, 
+    94602, 94603, 94604, 94605, 94606, 94607, 94608, 94609, 94610, 94611, 
+    94612, 94613, 94614, 94615, 94616, 94617, 94618, 94619, 94620, 94621, 
+    94622, 94623, 94624, 94625, 94626, 94627, 94628, 94629, 94630, 94631, 
+    94632, 94633, 94634, 94635, 94636, 94637, 94638, 94639, 94640, 94641, 
+    94642, 94643, 94644, 94645, 94646, 94647, 94648, 94649, 94650, 94651, 
+    94652, 94653, 94654, 94655, 94656, 94657, 94658, 94659, 94660, 94661, 
+    94662, 94663, 94664, 94665, 94666, 94667, 94668, 94669, 94670, 94671, 
+    94672, 94673, 94674, 94675, 94676, 94677, 94678, 94679, 94680, 94681, 
+    94682, 94683, 94684, 94685, 94686, 94687, 94688, 94689, 94690, 94691, 
+    94692, 94693, 94694, 94695, 94696, 94697, 94698, 94699, 94700, 94701, 
+    94702, 94703, 94704, 94705, 94706, 94707, 94708, 94709, 94710, 94711, 
+    94712, 94713, 94714, 94715, 94716, 94717, 94718, 94719, 94720, 94721, 
+    94722, 94723, 94724, 94725, 94726, 94727, 94728, 94729, 94730, 94731, 
+    94732, 94733, 94734, 94735, 94736, 94737, 94738, 94739, 94740, 94741, 
+    94742, 94743, 94744, 94745, 94746, 94747, 94748, 94749, 94750, 94751, 
+    94752, 94753, 94754, 94755, 94756, 94757, 94758, 94759, 94760, 94761, 
+    94762, 94763, 94764, 94765, 94766, 94767, 94768, 94769, 94770, 94771, 
+    94772, 94773, 94774, 94775, 94776, 94777, 94778, 94779, 94780, 94781, 
+    94782, 94783, 94784, 94785, 94786, 94787, 94788, 94789, 94790, 94791, 
+    94792, 94793, 94794, 94795, 94796, 94797, 94798, 94799, 94800, 94801, 
+    94802, 94803, 94804, 94805, 94806, 94807, 94808, 94809, 94810, 94811, 
+    94812, 94813, 94814, 94815, 94816, 94817, 94818, 94819, 94820, 94821, 
+    94822, 94823, 94824, 94825, 94826, 94827, 94828, 94829, 94830, 94831, 
+    94832, 94833, 94834, 94835, 94836, 94837, 94838, 94839, 94840, 94841, 
+    94842, 94843, 94844, 94845, 94846, 94847, 94848, 94849, 94850, 94851, 
+    94852, 94853, 94854, 94855, 94856, 94857, 94858, 94859, 94860, 94861, 
+    94862, 94863, 94864, 94865, 94866, 94867, 94868, 94869, 94870, 94871, 
+    94872, 94873, 94874, 94875, 94876, 94877, 94878, 94879, 94880, 94881, 
+    94882, 94883, 94884, 94885, 94886, 94887, 94888, 94889, 94890, 94891, 
+    94892, 94893, 94894, 94895, 94896, 94897, 94898, 94899, 94900, 94901, 
+    94902, 94903, 94904, 94905, 94906, 94907, 94908, 94909, 94910, 94911, 
+    94912, 94913, 94914, 94915, 94916, 94917, 94918, 94919, 94920, 94921, 
+    94922, 94923, 94924, 94925, 94926, 94927, 94928, 94929, 94930, 94931, 
+    94932, 94933, 94934, 94935, 94936, 94937, 94938, 94939, 94940, 94941, 
+    94942, 94943, 94944, 94945, 94946, 94947, 94948, 94949, 94950, 94951, 
+    94952, 94953, 94954, 94955, 94956, 94957, 94958, 94959, 94960, 94961, 
+    94962, 94963, 94964, 94965, 94966, 94967, 94968, 94969, 94970, 94971, 
+    94972, 94973, 94974, 94975, 94976, 94977, 94978, 94979, 94980, 94981, 
+    94982, 94983, 94984, 94985, 94986, 94987, 94988, 94989, 94990, 94991, 
+    94992, 94993, 94994, 94995, 94996, 94997, 94998, 94999, 95000, 95001, 
+    95002, 95003, 95004, 95005, 95006, 95007, 95008, 95009, 95010, 95011, 
+    95012, 95013, 95014, 95015, 95016, 95017, 95018, 95019, 95020, 95021, 
+    95022, 95023, 95024, 95025, 95026, 95027, 95028, 95029, 95030, 95031, 
+    95032, 95033, 95034, 95035, 95036, 95037, 95038, 95039, 95040, 95041, 
+    95042, 95043, 95044, 95045, 95046, 95047, 95048, 95049, 95050, 95051, 
+    95052, 95053, 95054, 95055, 95056, 95057, 95058, 95059, 95060, 95061, 
+    95062, 95063, 95064, 95065, 95066, 95067, 95068, 95069, 95070, 95071, 
+    95072, 95073, 95074, 95075, 95076, 95077, 95078, 95079, 95080, 95081, 
+    95082, 95083, 95084, 95085, 95086, 95087, 95088, 95089, 95090, 95091, 
+    95092, 95093, 95094, 95095, 95096, 95097, 95098, 95099, 95100, 95101, 
+    95102, 95103, 95104, 95105, 95106, 95107, 95108, 95109, 95110, 95111, 
+    95112, 95113, 95114, 95115, 95116, 95117, 95118, 95119, 95120, 95121, 
+    95122, 95123, 95124, 95125, 95126, 95127, 95128, 95129, 95130, 95131, 
+    95132, 95133, 95134, 95135, 95136, 95137, 95138, 95139, 95140, 95141, 
+    95142, 95143, 95144, 95145, 95146, 95147, 95148, 95149, 95150, 95151, 
+    95152, 95153, 95154, 95155, 95156, 95157, 95158, 95159, 95160, 95161, 
+    95162, 95163, 95164, 95165, 95166, 95167, 95168, 95169, 95170, 95171, 
+    95172, 95173, 95174, 95175, 95176, 95177, 95178, 95179, 95180, 95181, 
+    95182, 95183, 95184, 95185, 95186, 95187, 95188, 95189, 95190, 95191, 
+    95192, 95193, 95194, 95195, 95196, 95197, 95198, 95199, 95200, 95201, 
+    95202, 95203, 95204, 95205, 95206, 95207, 95208, 95209, 95210, 95211, 
+    95212, 95213, 95214, 95215, 95216, 95217, 95218, 95219, 95220, 95221, 
+    95222, 95223, 95224, 95225, 95226, 95227, 95228, 95229, 95230, 95231, 
+    95232, 95233, 95234, 95235, 95236, 95237, 95238, 95239, 95240, 95241, 
+    95242, 95243, 95244, 95245, 95246, 95247, 95248, 95249, 95250, 95251, 
+    95252, 95253, 95254, 95255, 95256, 95257, 95258, 95259, 95260, 95261, 
+    95262, 95263, 95264, 95265, 95266, 95267, 95268, 95269, 95270, 95271, 
+    95272, 95273, 95274, 95275, 95276, 95277, 95278, 95279, 95280, 95281, 
+    95282, 95283, 95284, 95285, 95286, 95287, 95288, 95289, 95290, 95291, 
+    95292, 95293, 95294, 95295, 95296, 95297, 95298, 95299, 95300, 95301, 
+    95302, 95303, 95304, 95305, 95306, 95307, 95308, 95309, 95310, 95311, 
+    95312, 95313, 95314, 95315, 95316, 95317, 95318, 95319, 95320, 95321, 
+    95322, 95323, 95324, 95325, 95326, 95327, 95328, 95329, 95330, 95331, 
+    95332, 95333, 95334, 95335, 95336, 95337, 95338, 95339, 95340, 95341, 
+    95342, 95343, 95344, 95345, 95346, 95347, 95348, 95349, 95350, 95351, 
+    95352, 95353, 95354, 95355, 95356, 95357, 95358, 95359, 95360, 95361, 
+    95362, 95363, 95364, 95365, 95366, 95367, 95368, 95369, 95370, 95371, 
+    95372, 95373, 95374, 95375, 95376, 95377, 95378, 95379, 95380, 95381, 
+    95382, 95383, 95384, 95385, 95386, 95387, 95388, 95389, 95390, 95391, 
+    95392, 95393, 95394, 95395, 95396, 95397, 95398, 95399, 95400, 95401, 
+    95402, 95403, 95404, 95405, 95406, 95407, 95408, 95409, 95410, 95411, 
+    95412, 95413, 95414, 95415, 95416, 95417, 95418, 95419, 95420, 95421, 
+    95422, 95423, 95424, 95425, 95426, 95427, 95428, 95429, 95430, 95431, 
+    95432, 95433, 95434, 95435, 95436, 95437, 95438, 95439, 95440, 95441, 
+    95442, 95443, 95444, 95445, 95446, 95447, 95448, 95449, 95450, 95451, 
+    95452, 95453, 95454, 95455, 95456, 95457, 95458, 95459, 95460, 95461, 
+    95462, 95463, 95464, 95465, 95466, 95467, 95468, 95469, 95470, 95471, 
+    95472, 95473, 95474, 95475, 95476, 95477, 95478, 95479, 95480, 95481, 
+    95482, 95483, 95484, 95485, 95486, 95487, 95488, 95489, 95490, 95491, 
+    95492, 95493, 95494, 95495, 95496, 95497, 95498, 95499, 95500, 95501, 
+    95502, 95503, 95504, 95505, 95506, 95507, 95508, 95509, 95510, 95511, 
+    95512, 95513, 95514, 95515, 95516, 95517, 95518, 95519, 95520, 95521, 
+    95522, 95523, 95524, 95525, 95526, 95527, 95528, 95529, 95530, 95531, 
+    95532, 95533, 95534, 95535, 95536, 95537, 95538, 95539, 95540, 95541, 
+    95542, 95543, 95544, 95545, 95546, 95547, 95548, 95549, 95550, 95551, 
+    95552, 95553, 95554, 95555, 95556, 95557, 95558, 95559, 95560, 95561, 
+    95562, 95563, 95564, 95565, 95566, 95567, 95568, 95569, 95570, 95571, 
+    95572, 95573, 95574, 95575, 95576, 95577, 95578, 95579, 95580, 95581, 
+    95582, 95583, 95584, 95585, 95586, 95587, 95588, 95589, 95590, 95591, 
+    95592, 95593, 95594, 95595, 95596, 95597, 95598, 95599, 95600, 95601, 
+    95602, 95603, 95604, 95605, 95606, 95607, 95608, 95609, 95610, 95611, 
+    95612, 95613, 95614, 95615, 95616, 95617, 95618, 95619, 95620, 95621, 
+    95622, 95623, 95624, 95625, 95626, 95627, 95628, 95629, 95630, 95631, 
+    95632, 95633, 95634, 95635, 95636, 95637, 95638, 95639, 95640, 95641, 
+    95642, 95643, 95644, 95645, 95646, 95647, 95648, 95649, 95650, 95651, 
+    95652, 95653, 95654, 95655, 95656, 95657, 95658, 95659, 95660, 95661, 
+    95662, 95663, 95664, 95665, 95666, 95667, 95668, 95669, 95670, 95671, 
+    95672, 95673, 95674, 95675, 95676, 95677, 95678, 95679, 95680, 95681, 
+    95682, 95683, 95684, 95685, 95686, 95687, 95688, 95689, 95690, 95691, 
+    95692, 95693, 95694, 95695, 95696, 95697, 95698, 95699, 95700, 95701, 
+    95702, 95703, 95704, 95705, 95706, 95707, 95708, 95709, 95710, 95711, 
+    95712, 95713, 95714, 95715, 95716, 95717, 95718, 95719, 95720, 95721, 
+    95722, 95723, 95724, 95725, 95726, 95727, 95728, 95729, 95730, 95731, 
+    95732, 95733, 95734, 95735, 95736, 95737, 95738, 95739, 95740, 95741, 
+    95742, 95743, 95744, 95745, 95746, 95747, 95748, 95749, 95750, 95751, 
+    95752, 95753, 95754, 95755, 95756, 95757, 95758, 95759, 95760, 95761, 
+    95762, 95763, 95764, 95765, 95766, 95767, 95768, 95769, 95770, 95771, 
+    95772, 95773, 95774, 95775, 95776, 95777, 95778, 95779, 95780, 95781, 
+    95782, 95783, 95784, 95785, 95786, 95787, 95788, 95789, 95790, 95791, 
+    95792, 95793, 95794, 95795, 95796, 95797, 95798, 95799, 95800, 95801, 
+    95802, 95803, 95804, 95805, 95806, 95807, 95808, 95809, 95810, 95811, 
+    95812, 95813, 95814, 95815, 95816, 95817, 95818, 95819, 95820, 95821, 
+    95822, 95823, 95824, 95825, 95826, 95827, 95828, 95829, 95830, 95831, 
+    95832, 95833, 95834, 95835, 95836, 95837, 95838, 95839, 95840, 95841, 
+    95842, 95843, 95844, 95845, 95846, 95847, 95848, 95849, 95850, 95851, 
+    95852, 95853, 95854, 95855, 95856, 95857, 95858, 95859, 95860, 95861, 
+    95862, 95863, 95864, 95865, 95866, 95867, 95868, 95869, 95870, 95871, 
+    95872, 95873, 95874, 95875, 95876, 95877, 95878, 95879, 95880, 95881, 
+    95882, 95883, 95884, 95885, 95886, 95887, 95888, 95889, 95890, 95891, 
+    95892, 95893, 95894, 95895, 95896, 95897, 95898, 95899, 95900, 95901, 
+    95902, 95903, 95904, 95905, 95906, 95907, 95908, 95909, 95910, 95911, 
+    95912, 95913, 95914, 95915, 95916, 95917, 95918, 95919, 95920, 95921, 
+    95922, 95923, 95924, 95925, 95926, 95927, 95928, 95929, 95930, 95931, 
+    95932, 95933, 95934, 95935, 95936, 95937, 95938, 95939, 95940, 95941, 
+    95942, 95943, 95944, 95945, 95946, 95947, 95948, 95949, 95950, 95951, 
+    95952, 95953, 95954, 95955, 95956, 95957, 95958, 95959, 95960, 95961, 
+    95962, 95963, 95964, 95965, 95966, 95967, 95968, 95969, 95970, 95971, 
+    95972, 95973, 95974, 95975, 95976, 95977, 95978, 95979, 95980, 95981, 
+    95982, 95983, 95984, 95985, 95986, 95987, 95988, 95989, 95990, 95991, 
+    95992, 95993, 95994, 95995, 95996, 95997, 95998, 95999, 96000, 96001, 
+    96002, 96003, 96004, 96005, 96006, 96007, 96008, 96009, 96010, 96011, 
+    96012, 96013, 96014, 96015, 96016, 96017, 96018, 96019, 96020, 96021, 
+    96022, 96023, 96024, 96025, 96026, 96027, 96028, 96029, 96030, 96031, 
+    96032, 96033, 96034, 96035, 96036, 96037, 96038, 96039, 96040, 96041, 
+    96042, 96043, 96044, 96045, 96046, 96047, 96048, 96049, 96050, 96051, 
+    96052, 96053, 96054, 96055, 96056, 96057, 96058, 96059, 96060, 96061, 
+    96062, 96063, 96064, 96065, 96066, 96067, 96068, 96069, 96070, 96071, 
+    96072, 96073, 96074, 96075, 96076, 96077, 96078, 96079, 96080, 96081, 
+    96082, 96083, 96084, 96085, 96086, 96087, 96088, 96089, 96090, 96091, 
+    96092, 96093, 96094, 96095, 96096, 96097, 96098, 96099, 96100, 96101, 
+    96102, 96103, 96104, 96105, 96106, 96107, 96108, 96109, 96110, 96111, 
+    96112, 96113, 96114, 96115, 96116, 96117, 96118, 96119, 96120, 96121, 
+    96122, 96123, 96124, 96125, 96126, 96127, 96128, 96129, 96130, 96131, 
+    96132, 96133, 96134, 96135, 96136, 96137, 96138, 96139, 96140, 96141, 
+    96142, 96143, 96144, 96145, 96146, 96147, 96148, 96149, 96150, 96151, 
+    96152, 96153, 96154, 96155, 96156, 96157, 96158, 96159, 96160, 96161, 
+    96162, 96163, 96164, 96165, 96166, 96167, 96168, 96169, 96170, 96171, 
+    96172, 96173, 96174, 96175, 96176, 96177, 96178, 96179, 96180, 96181, 
+    96182, 96183, 96184, 96185, 96186, 96187, 96188, 96189, 96190, 96191, 
+    96192, 96193, 96194, 96195, 96196, 96197, 96198, 96199, 96200, 96201, 
+    96202, 96203, 96204, 96205, 96206, 96207, 96208, 96209, 96210, 96211, 
+    96212, 96213, 96214, 96215, 96216, 96217, 96218, 96219, 96220, 96221, 
+    96222, 96223, 96224, 96225, 96226, 96227, 96228, 96229, 96230, 96231, 
+    96232, 96233, 96234, 96235, 96236, 96237, 96238, 96239, 96240, 96241, 
+    96242, 96243, 96244, 96245, 96246, 96247, 96248, 96249, 96250, 96251, 
+    96252, 96253, 96254, 96255, 96256, 96257, 96258, 96259, 96260, 96261, 
+    96262, 96263, 96264, 96265, 96266, 96267, 96268, 96269, 96270, 96271, 
+    96272, 96273, 96274, 96275, 96276, 96277, 96278, 96279, 96280, 96281, 
+    96282, 96283, 96284, 96285, 96286, 96287, 96288, 96289, 96290, 96291, 
+    96292, 96293, 96294, 96295, 96296, 96297, 96298, 96299, 96300, 96301, 
+    96302, 96303, 96304, 96305, 96306, 96307, 96308, 96309, 96310, 96311, 
+    96312, 96313, 96314, 96315, 96316, 96317, 96318, 96319, 96320, 96321, 
+    96322, 96323, 96324, 96325, 96326, 96327, 96328, 96329, 96330, 96331, 
+    96332, 96333, 96334, 96335, 96336, 96337, 96338, 96339, 96340, 96341, 
+    96342, 96343, 96344, 96345, 96346, 96347, 96348, 96349, 96350, 96351, 
+    96352, 96353, 96354, 96355, 96356, 96357, 96358, 96359, 96360, 96361, 
+    96362, 96363, 96364, 96365, 96366, 96367, 96368, 96369, 96370, 96371, 
+    96372, 96373, 96374, 96375, 96376, 96377, 96378, 96379, 96380, 96381, 
+    96382, 96383, 96384, 96385, 96386, 96387, 96388, 96389, 96390, 96391, 
+    96392, 96393, 96394, 96395, 96396, 96397, 96398, 96399, 96400, 96401, 
+    96402, 96403, 96404, 96405, 96406, 96407, 96408, 96409, 96410, 96411, 
+    96412, 96413, 96414, 96415, 96416, 96417, 96418, 96419, 96420, 96421, 
+    96422, 96423, 96424, 96425, 96426, 96427, 96428, 96429, 96430, 96431, 
+    96432, 96433, 96434, 96435, 96436, 96437, 96438, 96439, 96440, 96441, 
+    96442, 96443, 96444, 96445, 96446, 96447, 96448, 96449, 96450, 96451, 
+    96452, 96453, 96454, 96455, 96456, 96457, 96458, 96459, 96460, 96461, 
+    96462, 96463, 96464, 96465, 96466, 96467, 96468, 96469, 96470, 96471, 
+    96472, 96473, 96474, 96475, 96476, 96477, 96478, 96479, 96480, 96481, 
+    96482, 96483, 96484, 96485, 96486, 96487, 96488, 96489, 96490, 96491, 
+    96492, 96493, 96494, 96495, 96496, 96497, 96498, 96499, 96500, 96501, 
+    96502, 96503, 96504, 96505, 96506, 96507, 96508, 96509, 96510, 96511, 
+    96512, 96513, 96514, 96515, 96516, 96517, 96518, 96519, 96520, 96521, 
+    96522, 96523, 96524, 96525, 96526, 96527, 96528, 96529, 96530, 96531, 
+    96532, 96533, 96534, 96535, 96536, 96537, 96538, 96539, 96540, 96541, 
+    96542, 96543, 96544, 96545, 96546, 96547, 96548, 96549, 96550, 96551, 
+    96552, 96553, 96554, 96555, 96556, 96557, 96558, 96559, 96560, 96561, 
+    96562, 96563, 96564, 96565, 96566, 96567, 96568, 96569, 96570, 96571, 
+    96572, 96573, 96574, 96575, 96576, 96577, 96578, 96579, 96580, 96581, 
+    96582, 96583, 96584, 96585, 96586, 96587, 96588, 96589, 96590, 96591, 
+    96592, 96593, 96594, 96595, 96596, 96597, 96598, 96599, 96600, 96601, 
+    96602, 96603, 96604, 96605, 96606, 96607, 96608, 96609, 96610, 96611, 
+    96612, 96613, 96614, 96615, 96616, 96617, 96618, 96619, 96620, 96621, 
+    96622, 96623, 96624, 96625, 96626, 96627, 96628, 96629, 96630, 96631, 
+    96632, 96633, 96634, 96635, 96636, 96637, 96638, 96639, 96640, 96641, 
+    96642, 96643, 96644, 96645, 96646, 96647, 96648, 96649, 96650, 96651, 
+    96652, 96653, 96654, 96655, 96656, 96657, 96658, 96659, 96660, 96661, 
+    96662, 96663, 96664, 96665, 96666, 96667, 96668, 96669, 96670, 96671, 
+    96672, 96673, 96674, 96675, 96676, 96677, 96678, 96679, 96680, 96681, 
+    96682, 96683, 96684, 96685, 96686, 96687, 96688, 96689, 96690, 96691, 
+    96692, 96693, 96694, 96695, 96696, 96697, 96698, 96699, 96700, 96701, 
+    96702, 96703, 96704, 96705, 96706, 96707, 96708, 96709, 96710, 96711, 
+    96712, 96713, 96714, 96715, 96716, 96717, 96718, 96719, 96720, 96721, 
+    96722, 96723, 96724, 96725, 96726, 96727, 96728, 96729, 96730, 96731, 
+    96732, 96733, 96734, 96735, 96736, 96737, 96738, 96739, 96740, 96741, 
+    96742, 96743, 96744, 96745, 96746, 96747, 96748, 96749, 96750, 96751, 
+    96752, 96753, 96754, 96755, 96756, 96757, 96758, 96759, 96760, 96761, 
+    96762, 96763, 96764, 96765, 96766, 96767, 96768, 96769, 96770, 96771, 
+    96772, 96773, 96774, 96775, 96776, 96777, 96778, 96779, 96780, 96781, 
+    96782, 96783, 96784, 96785, 96786, 96787, 96788, 96789, 96790, 96791, 
+    96792, 96793, 96794, 96795, 96796, 96797, 96798, 96799, 96800, 96801, 
+    96802, 96803, 96804, 96805, 96806, 96807, 96808, 96809, 96810, 96811, 
+    96812, 96813, 96814, 96815, 96816, 96817, 96818, 96819, 96820, 96821, 
+    96822, 96823, 96824, 96825, 96826, 96827, 96828, 96829, 96830, 96831, 
+    96832, 96833, 96834, 96835, 96836, 96837, 96838, 96839, 96840, 96841, 
+    96842, 96843, 96844, 96845, 96846, 96847, 96848, 96849, 96850, 96851, 
+    96852, 96853, 96854, 96855, 96856, 96857, 96858, 96859, 96860, 96861, 
+    96862, 96863, 96864, 96865, 96866, 96867, 96868, 96869, 96870, 96871, 
+    96872, 96873, 96874, 96875, 96876, 96877, 96878, 96879, 96880, 96881, 
+    96882, 96883, 96884, 96885, 96886, 96887, 96888, 96889, 96890, 96891, 
+    96892, 96893, 96894, 96895, 96896, 96897, 96898, 96899, 96900, 96901, 
+    96902, 96903, 96904, 96905, 96906, 96907, 96908, 96909, 96910, 96911, 
+    96912, 96913, 96914, 96915, 96916, 96917, 96918, 96919, 96920, 96921, 
+    96922, 96923, 96924, 96925, 96926, 96927, 96928, 96929, 96930, 96931, 
+    96932, 96933, 96934, 96935, 96936, 96937, 96938, 96939, 96940, 96941, 
+    96942, 96943, 96944, 96945, 96946, 96947, 96948, 96949, 96950, 96951, 
+    96952, 96953, 96954, 96955, 96956, 96957, 96958, 96959, 96960, 96961, 
+    96962, 96963, 96964, 96965, 96966, 96967, 96968, 96969, 96970, 96971, 
+    96972, 96973, 96974, 96975, 96976, 96977, 96978, 96979, 96980, 96981, 
+    96982, 96983, 96984, 96985, 96986, 96987, 96988, 96989, 96990, 96991, 
+    96992, 96993, 96994, 96995, 96996, 96997, 96998, 96999, 97000, 97001, 
+    97002, 97003, 97004, 97005, 97006, 97007, 97008, 97009, 97010, 97011, 
+    97012, 97013, 97014, 97015, 97016, 97017, 97018, 97019, 97020, 97021, 
+    97022, 97023, 97024, 97025, 97026, 97027, 97028, 97029, 97030, 97031, 
+    97032, 97033, 97034, 97035, 97036, 97037, 97038, 97039, 97040, 97041, 
+    97042, 97043, 97044, 97045, 97046, 97047, 97048, 97049, 97050, 97051, 
+    97052, 97053, 97054, 97055, 97056, 97057, 97058, 97059, 97060, 97061, 
+    97062, 97063, 97064, 97065, 97066, 97067, 97068, 97069, 97070, 97071, 
+    97072, 97073, 97074, 97075, 97076, 97077, 97078, 97079, 97080, 97081, 
+    97082, 97083, 97084, 97085, 97086, 97087, 97088, 97089, 97090, 97091, 
+    97092, 97093, 97094, 97095, 97096, 97097, 97098, 97099, 97100, 97101, 
+    97102, 97103, 97104, 97105, 97106, 97107, 97108, 97109, 97110, 97111, 
+    97112, 97113, 97114, 97115, 97116, 97117, 97118, 97119, 97120, 97121, 
+    97122, 97123, 97124, 97125, 97126, 97127, 97128, 97129, 97130, 97131, 
+    97132, 97133, 97134, 97135, 97136, 97137, 97138, 97139, 97140, 97141, 
+    97142, 97143, 97144, 97145, 97146, 97147, 97148, 97149, 97150, 97151, 
+    97152, 97153, 97154, 97155, 97156, 97157, 97158, 97159, 97160, 97161, 
+    97162, 97163, 97164, 97165, 97166, 97167, 97168, 97169, 97170, 97171, 
+    97172, 97173, 97174, 97175, 97176, 97177, 97178, 97179, 97180, 97181, 
+    97182, 97183, 97184, 97185, 97186, 97187, 97188, 97189, 97190, 97191, 
+    97192, 97193, 97194, 97195, 97196, 97197, 97198, 97199, 97200, 97201, 
+    97202, 97203, 97204, 97205, 97206, 97207, 97208, 97209, 97210, 97211, 
+    97212, 97213, 97214, 97215, 97216, 97217, 97218, 97219, 97220, 97221, 
+    97222, 97223, 97224, 97225, 97226, 97227, 97228, 97229, 97230, 97231, 
+    97232, 97233, 97234, 97235, 97236, 97237, 97238, 97239, 97240, 97241, 
+    97242, 97243, 97244, 97245, 97246, 97247, 97248, 97249, 97250, 97251, 
+    97252, 97253, 97254, 97255, 97256, 97257, 97258, 97259, 97260, 97261, 
+    97262, 97263, 97264, 97265, 97266, 97267, 97268, 97269, 97270, 97271, 
+    97272, 97273, 97274, 97275, 97276, 97277, 97278, 97279, 97280, 97281, 
+    97282, 97283, 97284, 97285, 97286, 97287, 97288, 97289, 97290, 97291, 
+    97292, 97293, 97294, 97295, 97296, 97297, 97298, 97299, 97300, 97301, 
+    97302, 97303, 97304, 97305, 97306, 97307, 97308, 97309, 97310, 97311, 
+    97312, 97313, 97314, 97315, 97316, 97317, 97318, 97319, 97320, 97321, 
+    97322, 97323, 97324, 97325, 97326, 97327, 97328, 97329, 97330, 97331, 
+    97332, 97333, 97334, 97335, 97336, 97337, 97338, 97339, 97340, 97341, 
+    97342, 97343, 97344, 97345, 97346, 97347, 97348, 97349, 97350, 97351, 
+    97352, 97353, 97354, 97355, 97356, 97357, 97358, 97359, 97360, 97361, 
+    97362, 97363, 97364, 97365, 97366, 97367, 97368, 97369, 97370, 97371, 
+    97372, 97373, 97374, 97375, 97376, 97377, 97378, 97379, 97380, 97381, 
+    97382, 97383, 97384, 97385, 97386, 97387, 97388, 97389, 97390, 97391, 
+    97392, 97393, 97394, 97395, 97396, 97397, 97398, 97399, 97400, 97401, 
+    97402, 97403, 97404, 97405, 97406, 97407, 97408, 97409, 97410, 97411, 
+    97412, 97413, 97414, 97415, 97416, 97417, 97418, 97419, 97420, 97421, 
+    97422, 97423, 97424, 97425, 97426, 97427, 97428, 97429, 97430, 97431, 
+    97432, 97433, 97434, 97435, 97436, 97437, 97438, 97439, 97440, 97441, 
+    97442, 97443, 97444, 97445, 97446, 97447, 97448, 97449, 97450, 97451, 
+    97452, 97453, 97454, 97455, 97456, 97457, 97458, 97459, 97460, 97461, 
+    97462, 97463, 97464, 97465, 97466, 97467, 97468, 97469, 97470, 97471, 
+    97472, 97473, 97474, 97475, 97476, 97477, 97478, 97479, 97480, 97481, 
+    97482, 97483, 97484, 97485, 97486, 97487, 97488, 97489, 97490, 97491, 
+    97492, 97493, 97494, 97495, 97496, 97497, 97498, 97499, 97500, 97501, 
+    97502, 97503, 97504, 97505, 97506, 97507, 97508, 97509, 97510, 97511, 
+    97512, 97513, 97514, 97515, 97516, 97517, 97518, 97519, 97520, 97521, 
+    97522, 97523, 97524, 97525, 97526, 97527, 97528, 97529, 97530, 97531, 
+    97532, 97533, 97534, 97535, 97536, 97537, 97538, 97539, 97540, 97541, 
+    97542, 97543, 97544, 97545, 97546, 97547, 97548, 97549, 97550, 97551, 
+    97552, 97553, 97554, 97555, 97556, 97557, 97558, 97559, 97560, 97561, 
+    97562, 97563, 97564, 97565, 97566, 97567, 97568, 97569, 97570, 97571, 
+    97572, 97573, 97574, 97575, 97576, 97577, 97578, 97579, 97580, 97581, 
+    97582, 97583, 97584, 97585, 97586, 97587, 97588, 97589, 97590, 97591, 
+    97592, 97593, 97594, 97595, 97596, 97597, 97598, 97599, 97600, 97601, 
+    97602, 97603, 97604, 97605, 97606, 97607, 97608, 97609, 97610, 97611, 
+    97612, 97613, 97614, 97615, 97616, 97617, 97618, 97619, 97620, 97621, 
+    97622, 97623, 97624, 97625, 97626, 97627, 97628, 97629, 97630, 97631, 
+    97632, 97633, 97634, 97635, 97636, 97637, 97638, 97639, 97640, 97641, 
+    97642, 97643, 97644, 97645, 97646, 97647, 97648, 97649, 97650, 97651, 
+    97652, 97653, 97654, 97655, 97656, 97657, 97658, 97659, 97660, 97661, 
+    97662, 97663, 97664, 97665, 97666, 97667, 97668, 97669, 97670, 97671, 
+    97672, 97673, 97674, 97675, 97676, 97677, 97678, 97679, 97680, 97681, 
+    97682, 97683, 97684, 97685, 97686, 97687, 97688, 97689, 97690, 97691, 
+    97692, 97693, 97694, 97695, 97696, 97697, 97698, 97699, 97700, 97701, 
+    97702, 97703, 97704, 97705, 97706, 97707, 97708, 97709, 97710, 97711, 
+    97712, 97713, 97714, 97715, 97716, 97717, 97718, 97719, 97720, 97721, 
+    97722, 97723, 97724, 97725, 97726, 97727, 97728, 97729, 97730, 97731, 
+    97732, 97733, 97734, 97735, 97736, 97737, 97738, 97739, 97740, 97741, 
+    97742, 97743, 97744, 97745, 97746, 97747, 97748, 97749, 97750, 97751, 
+    97752, 97753, 97754, 97755, 97756, 97757, 97758, 97759, 97760, 97761, 
+    97762, 97763, 97764, 97765, 97766, 97767, 97768, 97769, 97770, 97771, 
+    97772, 97773, 97774, 97775, 97776, 97777, 97778, 97779, 97780, 97781, 
+    97782, 97783, 97784, 97785, 97786, 97787, 97788, 97789, 97790, 97791, 
+    97792, 97793, 97794, 97795, 97796, 97797, 97798, 97799, 97800, 97801, 
+    97802, 97803, 97804, 97805, 97806, 97807, 97808, 97809, 97810, 97811, 
+    97812, 97813, 97814, 97815, 97816, 97817, 97818, 97819, 97820, 97821, 
+    97822, 97823, 97824, 97825, 97826, 97827, 97828, 97829, 97830, 97831, 
+    97832, 97833, 97834, 97835, 97836, 97837, 97838, 97839, 97840, 97841, 
+    97842, 97843, 97844, 97845, 97846, 97847, 97848, 97849, 97850, 97851, 
+    97852, 97853, 97854, 97855, 97856, 97857, 97858, 97859, 97860, 97861, 
+    97862, 97863, 97864, 97865, 97866, 97867, 97868, 97869, 97870, 97871, 
+    97872, 97873, 97874, 97875, 97876, 97877, 97878, 97879, 97880, 97881, 
+    97882, 97883, 97884, 97885, 97886, 97887, 97888, 97889, 97890, 97891, 
+    97892, 97893, 97894, 97895, 97896, 97897, 97898, 97899, 97900, 97901, 
+    97902, 97903, 97904, 97905, 97906, 97907, 97908, 97909, 97910, 97911, 
+    97912, 97913, 97914, 97915, 97916, 97917, 97918, 97919, 97920, 97921, 
+    97922, 97923, 97924, 97925, 97926, 97927, 97928, 97929, 97930, 97931, 
+    97932, 97933, 97934, 97935, 97936, 97937, 97938, 97939, 97940, 97941, 
+    97942, 97943, 97944, 97945, 97946, 97947, 97948, 97949, 97950, 97951, 
+    97952, 97953, 97954, 97955, 97956, 97957, 97958, 97959, 97960, 97961, 
+    97962, 97963, 97964, 97965, 97966, 97967, 97968, 97969, 97970, 97971, 
+    97972, 97973, 97974, 97975, 97976, 97977, 97978, 97979, 97980, 97981, 
+    97982, 97983, 97984, 97985, 97986, 97987, 97988, 97989, 97990, 97991, 
+    97992, 97993, 97994, 97995, 97996, 97997, 97998, 97999, 98000, 98001, 
+    98002, 98003, 98004, 98005, 98006, 98007, 98008, 98009, 98010, 98011, 
+    98012, 98013, 98014, 98015, 98016, 98017, 98018, 98019, 98020, 98021, 
+    98022, 98023, 98024, 98025, 98026, 98027, 98028, 98029, 98030, 98031, 
+    98032, 98033, 98034, 98035, 98036, 98037, 98038, 98039, 98040, 98041, 
+    98042, 98043, 98044, 98045, 98046, 98047, 98048, 98049, 98050, 98051, 
+    98052, 98053, 98054, 98055, 98056, 98057, 98058, 98059, 98060, 98061, 
+    98062, 98063, 98064, 98065, 98066, 98067, 98068, 98069, 98070, 98071, 
+    98072, 98073, 98074, 98075, 98076, 98077, 98078, 98079, 98080, 98081, 
+    98082, 98083, 98084, 98085, 98086, 98087, 98088, 98089, 98090, 98091, 
+    98092, 98093, 98094, 98095, 98096, 98097, 98098, 98099, 98100, 98101, 
+    98102, 98103, 98104, 98105, 98106, 98107, 98108, 98109, 98110, 98111, 
+    98112, 98113, 98114, 98115, 98116, 98117, 98118, 98119, 98120, 98121, 
+    98122, 98123, 98124, 98125, 98126, 98127, 98128, 98129, 98130, 98131, 
+    98132, 98133, 98134, 98135, 98136, 98137, 98138, 98139, 98140, 98141, 
+    98142, 98143, 98144, 98145, 98146, 98147, 98148, 98149, 98150, 98151, 
+    98152, 98153, 98154, 98155, 98156, 98157, 98158, 98159, 98160, 98161, 
+    98162, 98163, 98164, 98165, 98166, 98167, 98168, 98169, 98170, 98171, 
+    98172, 98173, 98174, 98175, 98176, 98177, 98178, 98179, 98180, 98181, 
+    98182, 98183, 98184, 98185, 98186, 98187, 98188, 98189, 98190, 98191, 
+    98192, 98193, 98194, 98195, 98196, 98197, 98198, 98199, 98200, 98201, 
+    98202, 98203, 98204, 98205, 98206, 98207, 98208, 98209, 98210, 98211, 
+    98212, 98213, 98214, 98215, 98216, 98217, 98218, 98219, 98220, 98221, 
+    98222, 98223, 98224, 98225, 98226, 98227, 98228, 98229, 98230, 98231, 
+    98232, 98233, 98234, 98235, 98236, 98237, 98238, 98239, 98240, 98241, 
+    98242, 98243, 98244, 98245, 98246, 98247, 98248, 98249, 98250, 98251, 
+    98252, 98253, 98254, 98255, 98256, 98257, 98258, 98259, 98260, 98261, 
+    98262, 98263, 98264, 98265, 98266, 98267, 98268, 98269, 98270, 98271, 
+    98272, 98273, 98274, 98275, 98276, 98277, 98278, 98279, 98280, 98281, 
+    98282, 98283, 98284, 98285, 98286, 98287, 98288, 98289, 98290, 98291, 
+    98292, 98293, 98294, 98295, 98296, 98297, 98298, 98299, 98300, 98301, 
+    98302, 98303, 98304, 98305, 98306, 98307, 98308, 98309, 98310, 98311, 
+    98312, 98313, 98314, 98315, 98316, 98317, 98318, 98319, 98320, 98321, 
+    98322, 98323, 98324, 98325, 98326, 98327, 98328, 98329, 98330, 98331, 
+    98332, 98333, 98334, 98335, 98336, 98337, 98338, 98339, 98340, 98341, 
+    98342, 98343, 98344, 98345, 98346, 98347, 98348, 98349, 98350, 98351, 
+    98352, 98353, 98354, 98355, 98356, 98357, 98358, 98359, 98360, 98361, 
+    98362, 98363, 98364, 98365, 98366, 98367, 98368, 98369, 98370, 98371, 
+    98372, 98373, 98374, 98375, 98376, 98377, 98378, 98379, 98380, 98381, 
+    98382, 98383, 98384, 98385, 98386, 98387, 98388, 98389, 98390, 98391, 
+    98392, 98393, 98394, 98395, 98396, 98397, 98398, 98399, 98400, 98401, 
+    98402, 98403, 98404, 98405, 98406, 98407, 98408, 98409, 98410, 98411, 
+    98412, 98413, 98414, 98415, 98416, 98417, 98418, 98419, 98420, 98421, 
+    98422, 98423, 98424, 98425, 98426, 98427, 98428, 98429, 98430, 98431, 
+    98432, 98433, 98434, 98435, 98436, 98437, 98438, 98439, 98440, 98441, 
+    98442, 98443, 98444, 98445, 98446, 98447, 98448, 98449, 98450, 98451, 
+    98452, 98453, 98454, 98455, 98456, 98457, 98458, 98459, 98460, 98461, 
+    98462, 98463, 98464, 98465, 98466, 98467, 98468, 98469, 98470, 98471, 
+    98472, 98473, 98474, 98475, 98476, 98477, 98478, 98479, 98480, 98481, 
+    98482, 98483, 98484, 98485, 98486, 98487, 98488, 98489, 98490, 98491, 
+    98492, 98493, 98494, 98495, 98496, 98497, 98498, 98499, 98500, 98501, 
+    98502, 98503, 98504, 98505, 98506, 98507, 98508, 98509, 98510, 98511, 
+    98512, 98513, 98514, 98515, 98516, 98517, 98518, 98519, 98520, 98521, 
+    98522, 98523, 98524, 98525, 98526, 98527, 98528, 98529, 98530, 98531, 
+    98532, 98533, 98534, 98535, 98536, 98537, 98538, 98539, 98540, 98541, 
+    98542, 98543, 98544, 98545, 98546, 98547, 98548, 98549, 98550, 98551, 
+    98552, 98553, 98554, 98555, 98556, 98557, 98558, 98559, 98560, 98561, 
+    98562, 98563, 98564, 98565, 98566, 98567, 98568, 98569, 98570, 98571, 
+    98572, 98573, 98574, 98575, 98576, 98577, 98578, 98579, 98580, 98581, 
+    98582, 98583, 98584, 98585, 98586, 98587, 98588, 98589, 98590, 98591, 
+    98592, 98593, 98594, 98595, 98596, 98597, 98598, 98599, 98600, 98601, 
+    98602, 98603, 98604, 98605, 98606, 98607, 98608, 98609, 98610, 98611, 
+    98612, 98613, 98614, 98615, 98616, 98617, 98618, 98619, 98620, 98621, 
+    98622, 98623, 98624, 98625, 98626, 98627, 98628, 98629, 98630, 98631, 
+    98632, 98633, 98634, 98635, 98636, 98637, 98638, 98639, 98640, 98641, 
+    98642, 98643, 98644, 98645, 98646, 98647, 98648, 98649, 98650, 98651, 
+    98652, 98653, 98654, 98655, 98656, 98657, 98658, 98659, 98660, 98661, 
+    98662, 98663, 98664, 98665, 98666, 98667, 98668, 98669, 98670, 98671, 
+    98672, 98673, 98674, 98675, 98676, 98677, 98678, 98679, 98680, 98681, 
+    98682, 98683, 98684, 98685, 98686, 98687, 98688, 98689, 98690, 98691, 
+    98692, 98693, 98694, 98695, 98696, 98697, 98698, 98699, 98700, 98701, 
+    98702, 98703, 98704, 98705, 98706, 98707, 98708, 98709, 98710, 98711, 
+    98712, 98713, 98714, 98715, 98716, 98717, 98718, 98719, 98720, 98721, 
+    98722, 98723, 98724, 98725, 98726, 98727, 98728, 98729, 98730, 98731, 
+    98732, 98733, 98734, 98735, 98736, 98737, 98738, 98739, 98740, 98741, 
+    98742, 98743, 98744, 98745, 98746, 98747, 98748, 98749, 98750, 98751, 
+    98752, 98753, 98754, 98755, 98756, 98757, 98758, 98759, 98760, 98761, 
+    98762, 98763, 98764, 98765, 98766, 98767, 98768, 98769, 98770, 98771, 
+    98772, 98773, 98774, 98775, 98776, 98777, 98778, 98779, 98780, 98781, 
+    98782, 98783, 98784, 98785, 98786, 98787, 98788, 98789, 98790, 98791, 
+    98792, 98793, 98794, 98795, 98796, 98797, 98798, 98799, 98800, 98801, 
+    98802, 98803, 98804, 98805, 98806, 98807, 98808, 98809, 98810, 98811, 
+    98812, 98813, 98814, 98815, 98816, 98817, 98818, 98819, 98820, 98821, 
+    98822, 98823, 98824, 98825, 98826, 98827, 98828, 98829, 98830, 98831, 
+    98832, 98833, 98834, 98835, 98836, 98837, 98838, 98839, 98840, 98841, 
+    98842, 98843, 98844, 98845, 98846, 98847, 98848, 98849, 98850, 98851, 
+    98852, 98853, 98854, 98855, 98856, 98857, 98858, 98859, 98860, 98861, 
+    98862, 98863, 98864, 98865, 98866, 98867, 98868, 98869, 98870, 98871, 
+    98872, 98873, 98874, 98875, 98876, 98877, 98878, 98879, 98880, 98881, 
+    98882, 98883, 98884, 98885, 98886, 98887, 98888, 98889, 98890, 98891, 
+    98892, 98893, 98894, 98895, 98896, 98897, 98898, 98899, 98900, 98901, 
+    98902, 98903, 98904, 98905, 98906, 98907, 98908, 98909, 98910, 98911, 
+    98912, 98913, 98914, 98915, 98916, 98917, 98918, 98919, 98920, 98921, 
+    98922, 98923, 98924, 98925, 98926, 98927, 98928, 98929, 98930, 98931, 
+    98932, 98933, 98934, 98935, 98936, 98937, 98938, 98939, 98940, 98941, 
+    98942, 98943, 98944, 98945, 98946, 98947, 98948, 98949, 98950, 98951, 
+    98952, 98953, 98954, 98955, 98956, 98957, 98958, 98959, 98960, 98961, 
+    98962, 98963, 98964, 98965, 98966, 98967, 98968, 98969, 98970, 98971, 
+    98972, 98973, 98974, 98975, 98976, 98977, 98978, 98979, 98980, 98981, 
+    98982, 98983, 98984, 98985, 98986, 98987, 98988, 98989, 98990, 98991, 
+    98992, 98993, 98994, 98995, 98996, 98997, 98998, 98999, 99000, 99001, 
+    99002, 99003, 99004, 99005, 99006, 99007, 99008, 99009, 99010, 99011, 
+    99012, 99013, 99014, 99015, 99016, 99017, 99018, 99019, 99020, 99021, 
+    99022, 99023, 99024, 99025, 99026, 99027, 99028, 99029, 99030, 99031, 
+    99032, 99033, 99034, 99035, 99036, 99037, 99038, 99039, 99040, 99041, 
+    99042, 99043, 99044, 99045, 99046, 99047, 99048, 99049, 99050, 99051, 
+    99052, 99053, 99054, 99055, 99056, 99057, 99058, 99059, 99060, 99061, 
+    99062, 99063, 99064, 99065, 99066, 99067, 99068, 99069, 99070, 99071, 
+    99072, 99073, 99074, 99075, 99076, 99077, 99078, 99079, 99080, 99081, 
+    99082, 99083, 99084, 99085, 99086, 99087, 99088, 99089, 99090, 99091, 
+    99092, 99093, 99094, 99095, 99096, 99097, 99098, 99099, 99100, 99101, 
+    99102, 99103, 99104, 99105, 99106, 99107, 99108, 99109, 99110, 99111, 
+    99112, 99113, 99114, 99115, 99116, 99117, 99118, 99119, 99120, 99121, 
+    99122, 99123, 99124, 99125, 99126, 99127, 99128, 99129, 99130, 99131, 
+    99132, 99133, 99134, 99135, 99136, 99137, 99138, 99139, 99140, 99141, 
+    99142, 99143, 99144, 99145, 99146, 99147, 99148, 99149, 99150, 99151, 
+    99152, 99153, 99154, 99155, 99156, 99157, 99158, 99159, 99160, 99161, 
+    99162, 99163, 99164, 99165, 99166, 99167, 99168, 99169, 99170, 99171, 
+    99172, 99173, 99174, 99175, 99176, 99177, 99178, 99179, 99180, 99181, 
+    99182, 99183, 99184, 99185, 99186, 99187, 99188, 99189, 99190, 99191, 
+    99192, 99193, 99194, 99195, 99196, 99197, 99198, 99199, 99200, 99201, 
+    99202, 99203, 99204, 99205, 99206, 99207, 99208, 99209, 99210, 99211, 
+    99212, 99213, 99214, 99215, 99216, 99217, 99218, 99219, 99220, 99221, 
+    99222, 99223, 99224, 99225, 99226, 99227, 99228, 99229, 99230, 99231, 
+    99232, 99233, 99234, 99235, 99236, 99237, 99238, 99239, 99240, 99241, 
+    99242, 99243, 99244, 99245, 99246, 99247, 99248, 99249, 99250, 99251, 
+    99252, 99253, 99254, 99255, 99256, 99257, 99258, 99259, 99260, 99261, 
+    99262, 99263, 99264, 99265, 99266, 99267, 99268, 99269, 99270, 99271, 
+    99272, 99273, 99274, 99275, 99276, 99277, 99278, 99279, 99280, 99281, 
+    99282, 99283, 99284, 99285, 99286, 99287, 99288, 99289, 99290, 99291, 
+    99292, 99293, 99294, 99295, 99296, 99297, 99298, 99299, 99300, 99301, 
+    99302, 99303, 99304, 99305, 99306, 99307, 99308, 99309, 99310, 99311, 
+    99312, 99313, 99314, 99315, 99316, 99317, 99318, 99319, 99320, 99321, 
+    99322, 99323, 99324, 99325, 99326, 99327, 99328, 99329, 99330, 99331, 
+    99332, 99333, 99334, 99335, 99336, 99337, 99338, 99339, 99340, 99341, 
+    99342, 99343, 99344, 99345, 99346, 99347, 99348, 99349, 99350, 99351, 
+    99352, 99353, 99354, 99355, 99356, 99357, 99358, 99359, 99360, 99361, 
+    99362, 99363, 99364, 99365, 99366, 99367, 99368, 99369, 99370, 99371, 
+    99372, 99373, 99374, 99375, 99376, 99377, 99378, 99379, 99380, 99381, 
+    99382, 99383, 99384, 99385, 99386, 99387, 99388, 99389, 99390, 99391, 
+    99392, 99393, 99394, 99395, 99396, 99397, 99398, 99399, 99400, 99401, 
+    99402, 99403, 99404, 99405, 99406, 99407, 99408, 99409, 99410, 99411, 
+    99412, 99413, 99414, 99415, 99416, 99417, 99418, 99419, 99420, 99421, 
+    99422, 99423, 99424, 99425, 99426, 99427, 99428, 99429, 99430, 99431, 
+    99432, 99433, 99434, 99435, 99436, 99437, 99438, 99439, 99440, 99441, 
+    99442, 99443, 99444, 99445, 99446, 99447, 99448, 99449, 99450, 99451, 
+    99452, 99453, 99454, 99455, 99456, 99457, 99458, 99459, 99460, 99461, 
+    99462, 99463, 99464, 99465, 99466, 99467, 99468, 99469, 99470, 99471, 
+    99472, 99473, 99474, 99475, 99476, 99477, 99478, 99479, 99480, 99481, 
+    99482, 99483, 99484, 99485, 99486, 99487, 99488, 99489, 99490, 99491, 
+    99492, 99493, 99494, 99495, 99496, 99497, 99498, 99499, 99500, 99501, 
+    99502, 99503, 99504, 99505, 99506, 99507, 99508, 99509, 99510, 99511, 
+    99512, 99513, 99514, 99515, 99516, 99517, 99518, 99519, 99520, 99521, 
+    99522, 99523, 99524, 99525, 99526, 99527, 99528, 99529, 99530, 99531, 
+    99532, 99533, 99534, 99535, 99536, 99537, 99538, 99539, 99540, 99541, 
+    99542, 99543, 99544, 99545, 99546, 99547, 99548, 99549, 99550, 99551, 
+    99552, 99553, 99554, 99555, 99556, 99557, 99558, 99559, 99560, 99561, 
+    99562, 99563, 99564, 99565, 99566, 99567, 99568, 99569, 99570, 99571, 
+    99572, 99573, 99574, 99575, 99576, 99577, 99578, 99579, 99580, 99581, 
+    99582, 99583, 99584, 99585, 99586, 99587, 99588, 99589, 99590, 99591, 
+    99592, 99593, 99594, 99595, 99596, 99597, 99598, 99599, 99600, 99601, 
+    99602, 99603, 99604, 99605, 99606, 99607, 99608, 99609, 99610, 99611, 
+    99612, 99613, 99614, 99615, 99616, 99617, 99618, 99619, 99620, 99621, 
+    99622, 99623, 99624, 99625, 99626, 99627, 99628, 99629, 99630, 99631, 
+    99632, 99633, 99634, 99635, 99636, 99637, 99638, 99639, 99640, 99641, 
+    99642, 99643, 99644, 99645, 99646, 99647, 99648, 99649, 99650, 99651, 
+    99652, 99653, 99654, 99655, 99656, 99657, 99658, 99659, 99660, 99661, 
+    99662, 99663, 99664, 99665, 99666, 99667, 99668, 99669, 99670, 99671, 
+    99672, 99673, 99674, 99675, 99676, 99677, 99678, 99679, 99680, 99681, 
+    99682, 99683, 99684, 99685, 99686, 99687, 99688, 99689, 99690, 99691, 
+    99692, 99693, 99694, 99695, 99696, 99697, 99698, 99699, 99700, 99701, 
+    99702, 99703, 99704, 99705, 99706, 99707, 99708, 99709, 99710, 99711, 
+    99712, 99713, 99714, 99715, 99716, 99717, 99718, 99719, 99720, 99721, 
+    99722, 99723, 99724, 99725, 99726, 99727, 99728, 99729, 99730, 99731, 
+    99732, 99733, 99734, 99735, 99736, 99737, 99738, 99739, 99740, 99741, 
+    99742, 99743, 99744, 99745, 99746, 99747, 99748, 99749, 99750, 99751, 
+    99752, 99753, 99754, 99755, 99756, 99757, 99758, 99759, 99760, 99761, 
+    99762, 99763, 99764, 99765, 99766, 99767, 99768, 99769, 99770, 99771, 
+    99772, 99773, 99774, 99775, 99776, 99777, 99778, 99779, 99780, 99781, 
+    99782, 99783, 99784, 99785, 99786, 99787, 99788, 99789, 99790, 99791, 
+    99792, 99793, 99794, 99795, 99796, 99797, 99798, 99799, 99800, 99801, 
+    99802, 99803, 99804, 99805, 99806, 99807, 99808, 99809, 99810, 99811, 
+    99812, 99813, 99814, 99815, 99816, 99817, 99818, 99819, 99820, 99821, 
+    99822, 99823, 99824, 99825, 99826, 99827, 99828, 99829, 99830, 99831, 
+    99832, 99833, 99834, 99835, 99836, 99837, 99838, 99839, 99840, 99841, 
+    99842, 99843, 99844, 99845, 99846, 99847, 99848, 99849, 99850, 99851, 
+    99852, 99853, 99854, 99855, 99856, 99857, 99858, 99859, 99860, 99861, 
+    99862, 99863, 99864, 99865, 99866, 99867, 99868, 99869, 99870, 99871, 
+    99872, 99873, 99874, 99875, 99876, 99877, 99878, 99879, 99880, 99881, 
+    99882, 99883, 99884, 99885, 99886, 99887, 99888, 99889, 99890, 99891, 
+    99892, 99893, 99894, 99895, 99896, 99897, 99898, 99899, 99900, 99901, 
+    99902, 99903, 99904, 99905, 99906, 99907, 99908, 99909, 99910, 99911, 
+    99912, 99913, 99914, 99915, 99916, 99917, 99918, 99919, 99920, 99921, 
+    99922, 99923, 99924, 99925, 99926, 99927, 99928, 99929, 99930, 99931, 
+    99932, 99933, 99934, 99935, 99936, 99937, 99938, 99939, 99940, 99941, 
+    99942, 99943, 99944, 99945, 99946, 99947, 99948, 99949, 99950, 99951, 
+    99952, 99953, 99954, 99955, 99956, 99957, 99958, 99959, 99960, 99961, 
+    99962, 99963, 99964, 99965, 99966, 99967, 99968, 99969, 99970, 99971, 
+    99972, 99973, 99974, 99975, 99976, 99977, 99978, 99979, 99980, 99981, 
+    99982, 99983, 99984, 99985, 99986, 99987, 99988, 99989, 99990, 99991, 
+    99992, 99993, 99994, 99995, 99996, 99997, 99998, 99999, 100000, 100001, 
+    100002, 100003, 100004, 100005, 100006, 100007, 100008, 100009, 100010, 
+    100011, 100012, 100013, 100014, 100015, 100016, 100017, 100018, 100019, 
+    100020, 100021, 100022, 100023, 100024, 100025, 100026, 100027, 100028, 
+    100029, 100030, 100031, 100032, 100033, 100034, 100035, 100036, 100037, 
+    100038, 100039, 100040, 100041, 100042, 100043, 100044, 100045, 100046, 
+    100047, 100048, 100049, 100050, 100051, 100052, 100053, 100054, 100055, 
+    100056, 100057, 100058, 100059, 100060, 100061, 100062, 100063, 100064, 
+    100065, 100066, 100067, 100068, 100069, 100070, 100071, 100072, 100073, 
+    100074, 100075, 100076, 100077, 100078, 100079, 100080, 100081, 100082, 
+    100083, 100084, 100085, 100086, 100087, 100088, 100089, 100090, 100091, 
+    100092, 100093, 100094, 100095, 100096, 100097, 100098, 100099, 100100, 
+    100101, 100102, 100103, 100104, 100105, 100106, 100107, 100108, 100109, 
+    100110, 100111, 100112, 100113, 100114, 100115, 100116, 100117, 100118, 
+    100119, 100120, 100121, 100122, 100123, 100124, 100125, 100126, 100127, 
+    100128, 100129, 100130, 100131, 100132, 100133, 100134, 100135, 100136, 
+    100137, 100138, 100139, 100140, 100141, 100142, 100143, 100144, 100145, 
+    100146, 100147, 100148, 100149, 100150, 100151, 100152, 100153, 100154, 
+    100155, 100156, 100157, 100158, 100159, 100160, 100161, 100162, 100163, 
+    100164, 100165, 100166, 100167, 100168, 100169, 100170, 100171, 100172, 
+    100173, 100174, 100175, 100176, 100177, 100178, 100179, 100180, 100181, 
+    100182, 100183, 100184, 100185, 100186, 100187, 100188, 100189, 100190, 
+    100191, 100192, 100193, 100194, 100195, 100196, 100197, 100198, 100199, 
+    100200, 100201, 100202, 100203, 100204, 100205, 100206, 100207, 100208, 
+    100209, 100210, 100211, 100212, 100213, 100214, 100215, 100216, 100217, 
+    100218, 100219, 100220, 100221, 100222, 100223, 100224, 100225, 100226, 
+    100227, 100228, 100229, 100230, 100231, 100232, 100233, 100234, 100235, 
+    100236, 100237, 100238, 100239, 100240, 100241, 100242, 100243, 100244, 
+    100245, 100246, 100247, 100248, 100249, 100250, 100251, 100252, 100253, 
+    100254, 100255, 100256, 100257, 100258, 100259, 100260, 100261, 100262, 
+    100263, 100264, 100265, 100266, 100267, 100268, 100269, 100270, 100271, 
+    100272, 100273, 100274, 100275, 100276, 100277, 100278, 100279, 100280, 
+    100281, 100282, 100283, 100284, 100285, 100286, 100287, 100288, 100289, 
+    100290, 100291, 100292, 100293, 100294, 100295, 100296, 100297, 100298, 
+    100299, 100300, 100301, 100302, 100303, 100304, 100305, 100306, 100307, 
+    100308, 100309, 100310, 100311, 100312, 100313, 100314, 100315, 100316, 
+    100317, 100318, 100319, 100320, 100321, 100322, 100323, 100324, 100325, 
+    100326, 100327, 100328, 100329, 100330, 100331, 100332, 100333, 100334, 
+    100335, 100336, 100337, 100338, 100339, 100340, 100341, 100342, 100343, 
+    100344, 100345, 100346, 100347, 100348, 100349, 100350, 100351, 100352, 
+    100353, 100354, 100355, 100356, 100357, 100358, 100359, 100360, 100361, 
+    100362, 100363, 100364, 100365, 100366, 100367, 100368, 100369, 100370, 
+    100371, 100372, 100373, 100374, 100375, 100376, 100377, 100378, 100379, 
+    100380, 100381, 100382, 100383, 100384, 100385, 100386, 100387, 100388, 
+    100389, 100390, 100391, 100392, 100393, 100394, 100395, 100396, 100397, 
+    100398, 100399, 100400, 100401, 100402, 100403, 100404, 100405, 100406, 
+    100407, 100408, 100409, 100410, 100411, 100412, 100413, 100414, 100415, 
+    100416, 100417, 100418, 100419, 100420, 100421, 100422, 100423, 100424, 
+    100425, 100426, 100427, 100428, 100429, 100430, 100431, 100432, 100433, 
+    100434, 100435, 100436, 100437, 100438, 100439, 100440, 100441, 100442, 
+    100443, 100444, 100445, 100446, 100447, 100448, 100449, 100450, 100451, 
+    100452, 100453, 100454, 100455, 100456, 100457, 100458, 100459, 100460, 
+    100461, 100462, 100463, 100464, 100465, 100466, 100467, 100468, 100469, 
+    100470, 100471, 100472, 100473, 100474, 100475, 100476, 100477, 100478, 
+    100479, 100480, 100481, 100482, 100483, 100484, 100485, 100486, 100487, 
+    100488, 100489, 100490, 100491, 100492, 100493, 100494, 100495, 100496, 
+    100497, 100498, 100499, 100500, 100501, 100502, 100503, 100504, 100505, 
+    100506, 100507, 100508, 100509, 100510, 100511, 100512, 100513, 100514, 
+    100515, 100516, 100517, 100518, 100519, 100520, 100521, 100522, 100523, 
+    100524, 100525, 100526, 100527, 100528, 100529, 100530, 100531, 100532, 
+    100533, 100534, 100535, 100536, 100537, 100538, 100539, 100540, 100541, 
+    100542, 100543, 100544, 100545, 100546, 100547, 100548, 100549, 100550, 
+    100551, 100552, 100553, 100554, 100555, 100556, 100557, 100558, 100559, 
+    100560, 100561, 100562, 100563, 100564, 100565, 100566, 100567, 100568, 
+    100569, 100570, 100571, 100572, 100573, 100574, 100575, 100576, 100577, 
+    100578, 100579, 100580, 100581, 100582, 100583, 100584, 100585, 100586, 
+    100587, 100588, 100589, 100590, 100591, 100592, 100593, 100594, 100595, 
+    100596, 100597, 100598, 100599, 100600, 100601, 100602, 100603, 100604, 
+    100605, 100606, 100607, 100608, 100609, 100610, 100611, 100612, 100613, 
+    100614, 100615, 100616, 100617, 100618, 100619, 100620, 100621, 100622, 
+    100623, 100624, 100625, 100626, 100627, 100628, 100629, 100630, 100631, 
+    100632, 100633, 100634, 100635, 100636, 100637, 100638, 100639, 100640, 
+    100641, 100642, 100643, 100644, 100645, 100646, 100647, 100648, 100649, 
+    100650, 100651, 100652, 100653, 100654, 100655, 100656, 100657, 100658, 
+    100659, 100660, 100661, 100662, 100663, 100664, 100665, 100666, 100667, 
+    100668, 100669, 100670, 100671, 100672, 100673, 100674, 100675, 100676, 
+    100677, 100678, 100679, 100680, 100681, 100682, 100683, 100684, 100685, 
+    100686, 100687, 100688, 100689, 100690, 100691, 100692, 100693, 100694, 
+    100695, 100696, 100697, 100698, 100699, 100700, 100701, 100702, 100703, 
+    100704, 100705, 100706, 100707, 100708, 100709, 100710, 100711, 100712, 
+    100713, 100714, 100715, 100716, 100717, 100718, 100719, 100720, 100721, 
+    100722, 100723, 100724, 100725, 100726, 100727, 100728, 100729, 100730, 
+    100731, 100732, 100733, 100734, 100735, 100736, 100737, 100738, 100739, 
+    100740, 100741, 100742, 100743, 100744, 100745, 100746, 100747, 100748, 
+    100749, 100750, 100751, 100752, 100753, 100754, 100755, 100756, 100757, 
+    100758, 100759, 100760, 100761, 100762, 100763, 100764, 100765, 100766, 
+    100767, 100768, 100769, 100770, 100771, 100772, 100773, 100774, 100775, 
+    100776, 100777, 100778, 100779, 100780, 100781, 100782, 100783, 100784, 
+    100785, 100786, 100787, 100788, 100789, 100790, 100791, 100792, 100793, 
+    100794, 100795, 100796, 100797, 100798, 100799, 100800, 100801, 100802, 
+    100803, 100804, 100805, 100806, 100807, 100808, 100809, 100810, 100811, 
+    100812, 100813, 100814, 100815, 100816, 100817, 100818, 100819, 100820, 
+    100821, 100822, 100823, 100824, 100825, 100826, 100827, 100828, 100829, 
+    100830, 100831, 100832, 100833, 100834, 100835, 100836, 100837, 100838, 
+    100839, 100840, 100841, 100842, 100843, 100844, 100845, 100846, 100847, 
+    100848, 100849, 100850, 100851, 100852, 100853, 100854, 100855, 100856, 
+    100857, 100858, 100859, 100860, 100861, 100862, 100863, 100864, 100865, 
+    100866, 100867, 100868, 100869, 100870, 100871, 100872, 100873, 100874, 
+    100875, 100876, 100877, 100878, 100879, 100880, 100881, 100882, 100883, 
+    100884, 100885, 100886, 100887, 100888, 100889, 100890, 100891, 100892, 
+    100893, 100894, 100895, 100896, 100897, 100898, 100899, 100900, 100901, 
+    100902, 100903, 100904, 100905, 100906, 100907, 100908, 100909, 100910, 
+    100911, 100912, 100913, 100914, 100915, 100916, 100917, 100918, 100919, 
+    100920, 100921, 100922, 100923, 100924, 100925, 100926, 100927, 100928, 
+    100929, 100930, 100931, 100932, 100933, 100934, 100935, 100936, 100937, 
+    100938, 100939, 100940, 100941, 100942, 100943, 100944, 100945, 100946, 
+    100947, 100948, 100949, 100950, 100951, 100952, 100953, 100954, 100955, 
+    100956, 100957, 100958, 100959, 100960, 100961, 100962, 100963, 100964, 
+    100965, 100966, 100967, 100968, 100969, 100970, 100971, 100972, 100973, 
+    100974, 100975, 100976, 100977, 100978, 100979, 100980, 100981, 100982, 
+    100983, 100984, 100985, 100986, 100987, 100988, 100989, 100990, 100991, 
+    100992, 100993, 100994, 100995, 100996, 100997, 100998, 100999, 101000, 
+    101001, 101002, 101003, 101004, 101005, 101006, 101007, 101008, 101009, 
+    101010, 101011, 101012, 101013, 101014, 101015, 101016, 101017, 101018, 
+    101019, 101020, 101021, 101022, 101023, 101024, 101025, 101026, 101027, 
+    101028, 101029, 101030, 101031, 101032, 101033, 101034, 101035, 101036, 
+    101037, 101038, 101039, 101040, 101041, 101042, 101043, 101044, 101045, 
+    101046, 101047, 101048, 101049, 101050, 101051, 101052, 101053, 101054, 
+    101055, 101056, 101057, 101058, 101059, 101060, 101061, 101062, 101063, 
+    101064, 101065, 101066, 101067, 101068, 101069, 101070, 101071, 101072, 
+    101073, 101074, 101075, 101076, 101077, 101078, 101079, 101080, 101081, 
+    101082, 101083, 101084, 101085, 101086, 101087, 101088, 101089, 101090, 
+    101091, 101092, 101093, 101094, 101095, 101096, 101097, 101098, 101099, 
+    101100, 101101, 101102, 101103, 101104, 101105, 101106, 101107, 101108, 
+    101109, 101110, 101111, 101112, 101113, 101114, 101115, 101116, 101117, 
+    101118, 101119, 101120, 101121, 101122, 101123, 101124, 101125, 101126, 
+    101127, 101128, 101129, 101130, 101131, 101132, 101133, 101134, 101135, 
+    101136, 101137, 101138, 101139, 101140, 101141, 101142, 101143, 101144, 
+    101145, 101146, 101147, 101148, 101149, 101150, 101151, 101152, 101153, 
+    101154, 101155, 101156, 101157, 101158, 101159, 101160, 101161, 101162, 
+    101163, 101164, 101165, 101166, 101167, 101168, 101169, 101170, 101171, 
+    101172, 101173, 101174, 101175, 101176, 101177, 101178, 101179, 101180, 
+    101181, 101182, 101183, 101184, 101185, 101186, 101187, 101188, 101189, 
+    101190, 101191, 101192, 101193, 101194, 101195, 101196, 101197, 101198, 
+    101199, 101200, 101201, 101202, 101203, 101204, 101205, 101206, 101207, 
+    101208, 101209, 101210, 101211, 101212, 101213, 101214, 101215, 101216, 
+    101217, 101218, 101219, 101220, 101221, 101222, 101223, 101224, 101225, 
+    101226, 101227, 101228, 101229, 101230, 101231, 101232, 101233, 101234, 
+    101235, 101236, 101237, 101238, 101239, 101240, 101241, 101242, 101243, 
+    101244, 101245, 101246, 101247, 101248, 101249, 101250, 101251, 101252, 
+    101253, 101254, 101255, 101256, 101257, 101258, 101259, 101260, 101261, 
+    101262, 101263, 101264, 101265, 101266, 101267, 101268, 101269, 101270, 
+    101271, 101272, 101273, 101274, 101275, 101276, 101277, 101278, 101279, 
+    101280, 101281, 101282, 101283, 101284, 101285, 101286, 101287, 101288, 
+    101289, 101290, 101291, 101292, 101293, 101294, 101295, 101296, 101297, 
+    101298, 101299, 101300, 101301, 101302, 101303, 101304, 101305, 101306, 
+    101307, 101308, 101309, 101310, 101311, 101312, 101313, 101314, 101315, 
+    101316, 101317, 101318, 101319, 101320, 101321, 101322, 101323, 101324, 
+    101325, 101326, 101327, 101328, 101329, 101330, 101331, 101332, 101333, 
+    101334, 101335, 101336, 101337, 101338, 101339, 101340, 101341, 101342, 
+    101343, 101344, 101345, 101346, 101347, 101348, 101349, 101350, 101351, 
+    101352, 101353, 101354, 101355, 101356, 101357, 101358, 101359, 101360, 
+    101361, 101362, 101363, 101364, 101365, 101366, 101367, 101368, 101369, 
+    101370, 101371, 101372, 101373, 101374, 101375, 101376, 101377, 101378, 
+    101379, 101380, 101381, 101382, 101383, 101384, 101385, 101386, 101387, 
+    101388, 101389, 101390, 101391, 101392, 101393, 101394, 101395, 101396, 
+    101397, 101398, 101399, 101400, 101401, 101402, 101403, 101404, 101405, 
+    101406, 101407, 101408, 101409, 101410, 101411, 101412, 101413, 101414, 
+    101415, 101416, 101417, 101418, 101419, 101420, 101421, 101422, 101423, 
+    101424, 101425, 101426, 101427, 101428, 101429, 101430, 101431, 101432, 
+    101433, 101434, 101435, 101436, 101437, 101438, 101439, 101440, 101441, 
+    101442, 101443, 101444, 101445, 101446, 101447, 101448, 101449, 101450, 
+    101451, 101452, 101453, 101454, 101455, 101456, 101457, 101458, 101459, 
+    101460, 101461, 101462, 101463, 101464, 101465, 101466, 101467, 101468, 
+    101469, 101470, 101471, 101472, 101473, 101474, 101475, 101476, 101477, 
+    101478, 101479, 101480, 101481, 101482, 101483, 101484, 101485, 101486, 
+    101487, 101488, 101489, 101490, 101491, 101492, 101493, 101494, 101495, 
+    101496, 101497, 101498, 101499, 101500, 101501, 101502, 101503, 101504, 
+    101505, 101506, 101507, 101508, 101509, 101510, 101511, 101512, 101513, 
+    101514, 101515, 101516, 101517, 101518, 101519, 101520, 101521, 101522, 
+    101523, 101524, 101525, 101526, 101527, 101528, 101529, 101530, 101531, 
+    101532, 101533, 101534, 101535, 101536, 101537, 101538, 101539, 101540, 
+    101541, 101542, 101543, 101544, 101545, 101546, 101547, 101548, 101549, 
+    101550, 101551, 101552, 101553, 101554, 101555, 101556, 101557, 101558, 
+    101559, 101560, 101561, 101562, 101563, 101564, 101565, 101566, 101567, 
+    101568, 101569, 101570, 101571, 101572, 101573, 101574, 101575, 101576, 
+    101577, 101578, 101579, 101580, 101581, 101582, 101583, 101584, 101585, 
+    101586, 101587, 101588, 101589, 101590, 101591, 101592, 101593, 101594, 
+    101595, 101596, 101597, 101598, 101599, 101600, 101601, 101602, 101603, 
+    101604, 101605, 101606, 101607, 101608, 101609, 101610, 101611, 101612, 
+    101613, 101614, 101615, 101616, 101617, 101618, 101619, 101620, 101621, 
+    101622, 101623, 101624, 101625, 101626, 101627, 101628, 101629, 101630, 
+    101631, 101632, 101633, 101634, 101635, 101636, 101637, 101638, 101639, 
+    101640, 101641, 101642, 101643, 101644, 101645, 101646, 101647, 101648, 
+    101649, 101650, 101651, 101652, 101653, 101654, 101655, 101656, 101657, 
+    101658, 101659, 101660, 101661, 101662, 101663, 101664, 101665, 101666, 
+    101667, 101668, 101669, 101670, 101671, 101672, 101673, 101674, 101675, 
+    101676, 101677, 101678, 101679, 101680, 101681, 101682, 101683, 101684, 
+    101685, 101686, 101687, 101688, 101689, 101690, 101691, 101692, 101693, 
+    101694, 101695, 101696, 101697, 101698, 101699, 101700, 101701, 101702, 
+    101703, 101704, 101705, 101706, 101707, 101708, 101709, 101710, 101711, 
+    101712, 101713, 101714, 101715, 101716, 101717, 101718, 101719, 101720, 
+    101721, 101722, 101723, 101724, 101725, 101726, 101727, 101728, 101729, 
+    101730, 101731, 101732, 101733, 101734, 101735, 101736, 101737, 101738, 
+    101739, 101740, 101741, 101742, 101743, 101744, 101745, 101746, 101747, 
+    101748, 101749, 101750, 101751, 101752, 101753, 101754, 101755, 101756, 
+    101757, 101758, 101759, 101760, 101761, 101762, 101763, 101764, 101765, 
+    101766, 101767, 101768, 101769, 101770, 101771, 101772, 101773, 101774, 
+    101775, 101776, 101777, 101778, 101779, 101780, 101781, 101782, 101783, 
+    101784, 101785, 101786, 101787, 101788, 101789, 101790, 101791, 101792, 
+    101793, 101794, 101795, 101796, 101797, 101798, 101799, 101800, 101801, 
+    101802, 101803, 101804, 101805, 101806, 101807, 101808, 101809, 101810, 
+    101811, 101812, 101813, 101814, 101815, 101816, 101817, 101818, 101819, 
+    101820, 101821, 101822, 101823, 101824, 101825, 101826, 101827, 101828, 
+    101829, 101830, 101831, 101832, 101833, 101834, 101835, 101836, 101837, 
+    101838, 101839, 101840, 101841, 101842, 101843, 101844, 101845, 101846, 
+    101847, 101848, 101849, 101850, 101851, 101852, 101853, 101854, 101855, 
+    101856, 101857, 101858, 101859, 101860, 101861, 101862, 101863, 101864, 
+    101865, 101866, 101867, 101868, 101869, 101870, 101871, 101872, 101873, 
+    101874, 101875, 101876, 101877, 101878, 101879, 101880, 101881, 101882, 
+    101883, 101884, 101885, 101886, 101887, 101888, 101889, 101890, 101891, 
+    101892, 101893, 101894, 101895, 101896, 101897, 101898, 101899, 101900, 
+    101901, 101902, 101903, 101904, 101905, 101906, 101907, 101908, 101909, 
+    101910, 101911, 101912, 101913, 101914, 101915, 101916, 101917, 101918, 
+    101919, 101920, 101921, 101922, 101923, 101924, 101925, 101926, 101927, 
+    101928, 101929, 101930, 101931, 101932, 101933, 101934, 101935, 101936, 
+    101937, 101938, 101939, 101940, 101941, 101942, 101943, 101944, 101945, 
+    101946, 101947, 101948, 101949, 101950, 101951, 101952, 101953, 101954, 
+    101955, 101956, 101957, 101958, 101959, 101960, 101961, 101962, 101963, 
+    101964, 101965, 101966, 101967, 101968, 101969, 101970, 101971, 101972, 
+    101973, 101974, 101975, 101976, 101977, 101978, 101979, 101980, 101981, 
+    101982, 101983, 101984, 101985, 101986, 101987, 101988, 101989, 101990, 
+    101991, 101992, 101993, 101994, 101995, 101996, 101997, 101998, 101999, 
+    102000, 102001, 102002, 102003, 102004, 102005, 102006, 102007, 102008, 
+    102009, 102010, 102011, 102012, 102013, 102014, 102015, 102016, 102017, 
+    102018, 102019, 102020, 102021, 102022, 102023, 102024, 102025, 102026, 
+    102027, 102028, 102029, 102030, 102031, 102032, 102033, 102034, 102035, 
+    102036, 102037, 102038, 102039, 102040, 102041, 102042, 102043, 102044, 
+    102045, 102046, 102047, 102048, 102049, 102050, 102051, 102052, 102053, 
+    102054, 102055, 102056, 102057, 102058, 102059, 102060, 102061, 102062, 
+    102063, 102064, 102065, 102066, 102067, 102068, 102069, 102070, 102071, 
+    102072, 102073, 102074, 102075, 102076, 102077, 102078, 102079, 102080, 
+    102081, 102082, 102083, 102084, 102085, 102086, 102087, 102088, 102089, 
+    102090, 102091, 102092, 102093, 102094, 102095, 102096, 102097, 102098, 
+    102099, 102100, 102101, 102102, 102103, 102104, 102105, 102106, 102107, 
+    102108, 102109, 102110, 102111, 102112, 102113, 102114, 102115, 102116, 
+    102117, 102118, 102119, 102120, 102121, 102122, 102123, 102124, 102125, 
+    102126, 102127, 102128, 102129, 102130, 102131, 102132, 102133, 102134, 
+    102135, 102136, 102137, 102138, 102139, 102140, 102141, 102142, 102143, 
+    102144, 102145, 102146, 102147, 102148, 102149, 102150, 102151, 102152, 
+    102153, 102154, 102155, 102156, 102157, 102158, 102159, 102160, 102161, 
+    102162, 102163, 102164, 102165, 102166, 102167, 102168, 102169, 102170, 
+    102171, 102172, 102173, 102174, 102175, 102176, 102177, 102178, 102179, 
+    102180, 102181, 102182, 102183, 102184, 102185, 102186, 102187, 102188, 
+    102189, 102190, 102191, 102192, 102193, 102194, 102195, 102196, 102197, 
+    102198, 102199, 102200, 102201, 102202, 102203, 102204, 102205, 102206, 
+    102207, 102208, 102209, 102210, 102211, 102212, 102213, 102214, 102215, 
+    102216, 102217, 102218, 102219, 102220, 102221, 102222, 102223, 102224, 
+    102225, 102226, 102227, 102228, 102229, 102230, 102231, 102232, 102233, 
+    102234, 102235, 102236, 102237, 102238, 102239, 102240, 102241, 102242, 
+    102243, 102244, 102245, 102246, 102247, 102248, 102249, 102250, 102251, 
+    102252, 102253, 102254, 102255, 102256, 102257, 102258, 102259, 102260, 
+    102261, 102262, 102263, 102264, 102265, 102266, 102267, 102268, 102269, 
+    102270, 102271, 102272, 102273, 102274, 102275, 102276, 102277, 102278, 
+    102279, 102280, 102281, 102282, 102283, 102284, 102285, 102286, 102287, 
+    102288, 102289, 102290, 102291, 102292, 102293, 102294, 102295, 102296, 
+    102297, 102298, 102299, 102300, 102301, 102302, 102303, 102304, 102305, 
+    102306, 102307, 102308, 102309, 102310, 102311, 102312, 102313, 102314, 
+    102315, 102316, 102317, 102318, 102319, 102320, 102321, 102322, 102323, 
+    102324, 102325, 102326, 102327, 102328, 102329, 102330, 102331, 102332, 
+    102333, 102334, 102335, 102336, 102337, 102338, 102339, 102340, 102341, 
+    102342, 102343, 102344, 102345, 102346, 102347, 102348, 102349, 102350, 
+    102351, 102352, 102353, 102354, 102355, 102356, 102357, 102358, 102359, 
+    102360, 102361, 102362, 102363, 102364, 102365, 102366, 102367, 102368, 
+    102369, 102370, 102371, 102372, 102373, 102374, 102375, 102376, 102377, 
+    102378, 102379, 102380, 102381, 102382, 102383, 102384, 102385, 102386, 
+    102387, 102388, 102389, 102390, 102391, 102392, 102393, 102394, 102395, 
+    102396, 102397, 102398, 102399, 102400, 102401, 102402, 102403, 102404, 
+    102405, 102406, 102407, 102408, 102409, 102410, 102411, 102412, 102413, 
+    102414, 102415, 102416, 102417, 102418, 102419, 102420, 102421, 102422, 
+    102423, 102424, 102425, 102426, 102427, 102428, 102429, 102430, 102431, 
+    102432, 102433, 102434, 102435, 102436, 102437, 102438, 102439, 102440, 
+    102441, 102442, 102443, 102444, 102445, 102446, 102447, 102448, 102449, 
+    102450, 102451, 102452, 102453, 102454, 102455, 102456, 102457, 102458, 
+    102459, 102460, 102461, 102462, 102463, 102464, 102465, 102466, 102467, 
+    102468, 102469, 102470, 102471, 102472, 102473, 102474, 102475, 102476, 
+    102477, 102478, 102479, 102480, 102481, 102482, 102483, 102484, 102485, 
+    102486, 102487, 102488, 102489, 102490, 102491, 102492, 102493, 102494, 
+    102495, 102496, 102497, 102498, 102499, 102500, 102501, 102502, 102503, 
+    102504, 102505, 102506, 102507, 102508, 102509, 102510, 102511, 102512, 
+    102513, 102514, 102515, 102516, 102517, 102518, 102519, 102520, 102521, 
+    102522, 102523, 102524, 102525, 102526, 102527, 102528, 102529, 102530, 
+    102531, 102532, 102533, 102534, 102535, 102536, 102537, 102538, 102539, 
+    102540, 102541, 102542, 102543, 102544, 102545, 102546, 102547, 102548, 
+    102549, 102550, 102551, 102552, 102553, 102554, 102555, 102556, 102557, 
+    102558, 102559, 102560, 102561, 102562, 102563, 102564, 102565, 102566, 
+    102567, 102568, 102569, 102570, 102571, 102572, 102573, 102574, 102575, 
+    102576, 102577, 102578, 102579, 102580, 102581, 102582, 102583, 102584, 
+    102585, 102586, 102587, 102588, 102589, 102590, 102591, 102592, 102593, 
+    102594, 102595, 102596, 102597, 102598, 102599, 102600, 102601, 102602, 
+    102603, 102604, 102605, 102606, 102607, 102608, 102609, 102610, 102611, 
+    102612, 102613, 102614, 102615, 102616, 102617, 102618, 102619, 102620, 
+    102621, 102622, 102623, 102624, 102625, 102626, 102627, 102628, 102629, 
+    102630, 102631, 102632, 102633, 102634, 102635, 102636, 102637, 102638, 
+    102639, 102640, 102641, 102642, 102643, 102644, 102645, 102646, 102647, 
+    102648, 102649, 102650, 102651, 102652, 102653, 102654, 102655, 102656, 
+    102657, 102658, 102659, 102660, 102661, 102662, 102663, 102664, 102665, 
+    102666, 102667, 102668, 102669, 102670, 102671, 102672, 102673, 102674, 
+    102675, 102676, 102677, 102678, 102679, 102680, 102681, 102682, 102683, 
+    102684, 102685, 102686, 102687, 102688, 102689, 102690, 102691, 102692, 
+    102693, 102694, 102695, 102696, 102697, 102698, 102699, 102700, 102701, 
+    102702, 102703, 102704, 102705, 102706, 102707, 102708, 102709, 102710, 
+    102711, 102712, 102713, 102714, 102715, 102716, 102717, 102718, 102719, 
+    102720, 102721, 102722, 102723, 102724, 102725, 102726, 102727, 102728, 
+    102729, 102730, 102731, 102732, 102733, 102734, 102735, 102736, 102737, 
+    102738, 102739, 102740, 102741, 102742, 102743, 102744, 102745, 102746, 
+    102747, 102748, 102749, 102750, 102751, 102752, 102753, 102754, 102755, 
+    102756, 102757, 102758, 102759, 102760, 102761, 102762, 102763, 102764, 
+    102765, 102766, 102767, 102768, 102769, 102770, 102771, 102772, 102773, 
+    102774, 102775, 102776, 102777, 102778, 102779, 102780, 102781, 102782, 
+    102783, 102784, 102785, 102786, 102787, 102788, 102789, 102790, 102791, 
+    102792, 102793, 102794, 102795, 102796, 102797, 102798, 102799, 102800, 
+    102801, 102802, 102803, 102804, 102805, 102806, 102807, 102808, 102809, 
+    102810, 102811, 102812, 102813, 102814, 102815, 102816, 102817, 102818, 
+    102819, 102820, 102821, 102822, 102823, 102824, 102825, 102826, 102827, 
+    102828, 102829, 102830, 102831, 102832, 102833, 102834, 102835, 102836, 
+    102837, 102838, 102839, 102840, 102841, 102842, 102843, 102844, 102845, 
+    102846, 102847, 102848, 102849, 102850, 102851, 102852, 102853, 102854, 
+    102855, 102856, 102857, 102858, 102859, 102860, 102861, 102862, 102863, 
+    102864, 102865, 102866, 102867, 102868, 102869, 102870, 102871, 102872, 
+    102873, 102874, 102875, 102876, 102877, 102878, 102879, 102880, 102881, 
+    102882, 102883, 102884, 102885, 102886, 102887, 102888, 102889, 102890, 
+    102891, 102892, 102893, 102894, 102895, 102896, 102897, 102898, 102899, 
+    102900, 102901, 102902, 102903, 102904, 102905, 102906, 102907, 102908, 
+    102909, 102910, 102911, 102912, 102913, 102914, 102915, 102916, 102917, 
+    102918, 102919, 102920, 102921, 102922, 102923, 102924, 102925, 102926, 
+    102927, 102928, 102929, 102930, 102931, 102932, 102933, 102934, 102935, 
+    102936, 102937, 102938, 102939, 102940, 102941, 102942, 102943, 102944, 
+    102945, 102946, 102947, 102948, 102949, 102950, 102951, 102952, 102953, 
+    102954, 102955, 102956, 102957, 102958, 102959, 102960, 102961, 102962, 
+    102963, 102964, 102965, 102966, 102967, 102968, 102969, 102970, 102971, 
+    102972, 102973, 102974, 102975, 102976, 102977, 102978, 102979, 102980, 
+    102981, 102982, 102983, 102984, 102985, 102986, 102987, 102988, 102989, 
+    102990, 102991, 102992, 102993, 102994, 102995, 102996, 102997, 102998, 
+    102999, 103000, 103001, 103002, 103003, 103004, 103005, 103006, 103007, 
+    103008, 103009, 103010, 103011, 103012, 103013, 103014, 103015, 103016, 
+    103017, 103018, 103019, 103020, 103021, 103022, 103023, 103024, 103025, 
+    103026, 103027, 103028, 103029, 103030, 103031, 103032, 103033, 103034, 
+    103035, 103036, 103037, 103038, 103039, 103040, 103041, 103042, 103043, 
+    103044, 103045, 103046, 103047, 103048, 103049, 103050, 103051, 103052, 
+    103053, 103054, 103055, 103056, 103057, 103058, 103059, 103060, 103061, 
+    103062, 103063, 103064, 103065, 103066, 103067, 103068, 103069, 103070, 
+    103071, 103072, 103073, 103074, 103075, 103076, 103077, 103078, 103079, 
+    103080, 103081, 103082, 103083, 103084, 103085, 103086, 103087, 103088, 
+    103089, 103090, 103091, 103092, 103093, 103094, 103095, 103096, 103097, 
+    103098, 103099, 103100, 103101, 103102, 103103, 103104, 103105, 103106, 
+    103107, 103108, 103109, 103110, 103111, 103112, 103113, 103114, 103115, 
+    103116, 103117, 103118, 103119, 103120, 103121, 103122, 103123, 103124, 
+    103125, 103126, 103127, 103128, 103129, 103130, 103131, 103132, 103133, 
+    103134, 103135, 103136, 103137, 103138, 103139, 103140, 103141, 103142, 
+    103143, 103144, 103145, 103146, 103147, 103148, 103149, 103150, 103151, 
+    103152, 103153, 103154, 103155, 103156, 103157, 103158, 103159, 103160, 
+    103161, 103162, 103163, 103164, 103165, 103166, 103167, 103168, 103169, 
+    103170, 103171, 103172, 103173, 103174, 103175, 103176, 103177, 103178, 
+    103179, 103180, 103181, 103182, 103183, 103184, 103185, 103186, 103187, 
+    103188, 103189, 103190, 103191, 103192, 103193, 103194, 103195, 103196, 
+    103197, 103198, 103199, 103200, 103201, 103202, 103203, 103204, 103205, 
+    103206, 103207, 103208, 103209, 103210, 103211, 103212, 103213, 103214, 
+    103215, 103216, 103217, 103218, 103219, 103220, 103221, 103222, 103223, 
+    103224, 103225, 103226, 103227, 103228, 103229, 103230, 103231, 103232, 
+    103233, 103234, 103235, 103236, 103237, 103238, 103239, 103240, 103241, 
+    103242, 103243, 103244, 103245, 103246, 103247, 103248, 103249, 103250, 
+    103251, 103252, 103253, 103254, 103255, 103256, 103257, 103258, 103259, 
+    103260, 103261, 103262, 103263, 103264, 103265, 103266, 103267, 103268, 
+    103269, 103270, 103271, 103272, 103273, 103274, 103275, 103276, 103277, 
+    103278, 103279, 103280, 103281, 103282, 103283, 103284, 103285, 103286, 
+    103287, 103288, 103289, 103290, 103291, 103292, 103293, 103294, 103295, 
+    103296, 103297, 103298, 103299, 103300, 103301, 103302, 103303, 103304, 
+    103305, 103306, 103307, 103308, 103309, 103310, 103311, 103312, 103313, 
+    103314, 103315, 103316, 103317, 103318, 103319, 103320, 103321, 103322, 
+    103323, 103324, 103325, 103326, 103327, 103328, 103329, 103330, 103331, 
+    103332, 103333, 103334, 103335, 103336, 103337, 103338, 103339, 103340, 
+    103341, 103342, 103343, 103344, 103345, 103346, 103347, 103348, 103349, 
+    103350, 103351, 103352, 103353, 103354, 103355, 103356, 103357, 103358, 
+    103359, 103360, 103361, 103362, 103363, 103364, 103365, 103366, 103367, 
+    103368, 103369, 103370, 103371, 103372, 103373, 103374, 103375, 103376, 
+    103377, 103378, 103379, 103380, 103381, 103382, 103383, 103384, 103385, 
+    103386, 103387, 103388, 103389, 103390, 103391, 103392, 103393, 103394, 
+    103395, 103396, 103397, 103398, 103399, 103400, 103401, 103402, 103403, 
+    103404, 103405, 103406, 103407, 103408, 103409, 103410, 103411, 103412, 
+    103413, 103414, 103415, 103416, 103417, 103418, 103419, 103420, 103421, 
+    103422, 103423, 103424, 103425, 103426, 103427, 103428, 103429, 103430, 
+    103431, 103432, 103433, 103434, 103435, 103436, 103437, 103438, 103439, 
+    103440, 103441, 103442, 103443, 103444, 103445, 103446, 103447, 103448, 
+    103449, 103450, 103451, 103452, 103453, 103454, 103455, 103456, 103457, 
+    103458, 103459, 103460, 103461, 103462, 103463, 103464, 103465, 103466, 
+    103467, 103468, 103469, 103470, 103471, 103472, 103473, 103474, 103475, 
+    103476, 103477, 103478, 103479, 103480, 103481, 103482, 103483, 103484, 
+    103485, 103486, 103487, 103488, 103489, 103490, 103491, 103492, 103493, 
+    103494, 103495, 103496, 103497, 103498, 103499, 103500, 103501, 103502, 
+    103503, 103504, 103505, 103506, 103507, 103508, 103509, 103510, 103511, 
+    103512, 103513, 103514, 103515, 103516, 103517, 103518, 103519, 103520, 
+    103521, 103522, 103523, 103524, 103525, 103526, 103527, 103528, 103529, 
+    103530, 103531, 103532, 103533, 103534, 103535, 103536, 103537, 103538, 
+    103539, 103540, 103541, 103542, 103543, 103544, 103545, 103546, 103547, 
+    103548, 103549, 103550, 103551, 103552, 103553, 103554, 103555, 103556, 
+    103557, 103558, 103559, 103560, 103561, 103562, 103563, 103564, 103565, 
+    103566, 103567, 103568, 103569, 103570, 103571, 103572, 103573, 103574, 
+    103575, 103576, 103577, 103578, 103579, 103580, 103581, 103582, 103583, 
+    103584, 103585, 103586, 103587, 103588, 103589, 103590, 103591, 103592, 
+    103593, 103594, 103595, 103596, 103597, 103598, 103599, 103600, 103601, 
+    103602, 103603, 103604, 103605, 103606, 103607, 103608, 103609, 103610, 
+    103611, 103612, 103613, 103614, 103615, 103616, 103617, 103618, 103619, 
+    103620, 103621, 103622, 103623, 103624, 103625, 103626, 103627, 103628, 
+    103629, 103630, 103631, 103632, 103633, 103634, 103635, 103636, 103637, 
+    103638, 103639, 103640, 103641, 103642, 103643, 103644, 103645, 103646, 
+    103647, 103648, 103649, 103650, 103651, 103652, 103653, 103654, 103655, 
+    103656, 103657, 103658, 103659, 103660, 103661, 103662, 103663, 103664, 
+    103665, 103666, 103667, 103668, 103669, 103670, 103671, 103672, 103673, 
+    103674, 103675, 103676, 103677, 103678, 103679, 103680, 103681, 103682, 
+    103683, 103684, 103685, 103686, 103687, 103688, 103689, 103690, 103691, 
+    103692, 103693, 103694, 103695, 103696, 103697, 103698, 103699, 103700, 
+    103701, 103702, 103703, 103704, 103705, 103706, 103707, 103708, 103709, 
+    103710, 103711, 103712, 103713, 103714, 103715, 103716, 103717, 103718, 
+    103719, 103720, 103721, 103722, 103723, 103724, 103725, 103726, 103727, 
+    103728, 103729, 103730, 103731, 103732, 103733, 103734, 103735, 103736, 
+    103737, 103738, 103739, 103740, 103741, 103742, 103743, 103744, 103745, 
+    103746, 103747, 103748, 103749, 103750, 103751, 103752, 103753, 103754, 
+    103755, 103756, 103757, 103758, 103759, 103760, 103761, 103762, 103763, 
+    103764, 103765, 103766, 103767, 103768, 103769, 103770, 103771, 103772, 
+    103773, 103774, 103775, 103776, 103777, 103778, 103779, 103780, 103781, 
+    103782, 103783, 103784, 103785, 103786, 103787, 103788, 103789, 103790, 
+    103791, 103792, 103793, 103794, 103795, 103796, 103797, 103798, 103799, 
+    103800, 103801, 103802, 103803, 103804, 103805, 103806, 103807, 103808, 
+    103809, 103810, 103811, 103812, 103813, 103814, 103815, 103816, 103817, 
+    103818, 103819, 103820, 103821, 103822, 103823, 103824, 103825, 103826, 
+    103827, 103828, 103829, 103830, 103831, 103832, 103833, 103834, 103835, 
+    103836, 103837, 103838, 103839, 103840, 103841, 103842, 103843, 103844, 
+    103845, 103846, 103847, 103848, 103849, 103850, 103851, 103852, 103853, 
+    103854, 103855, 103856, 103857, 103858, 103859, 103860, 103861, 103862, 
+    103863, 103864, 103865, 103866, 103867, 103868, 103869, 103870, 103871, 
+    103872, 103873, 103874, 103875, 103876, 103877, 103878, 103879, 103880, 
+    103881, 103882, 103883, 103884, 103885, 103886, 103887, 103888, 103889, 
+    103890, 103891, 103892, 103893, 103894, 103895, 103896, 103897, 103898, 
+    103899, 103900, 103901, 103902, 103903, 103904, 103905, 103906, 103907, 
+    103908, 103909, 103910, 103911, 103912, 103913, 103914, 103915, 103916, 
+    103917, 103918, 103919, 103920, 103921, 103922, 103923, 103924, 103925, 
+    103926, 103927, 103928, 103929, 103930, 103931, 103932, 103933, 103934, 
+    103935, 103936, 103937, 103938, 103939, 103940, 103941, 103942, 103943, 
+    103944, 103945, 103946, 103947, 103948, 103949, 103950, 103951, 103952, 
+    103953, 103954, 103955, 103956, 103957, 103958, 103959, 103960, 103961, 
+    103962, 103963, 103964, 103965, 103966, 103967, 103968, 103969, 103970, 
+    103971, 103972, 103973, 103974, 103975, 103976, 103977, 103978, 103979, 
+    103980, 103981, 103982, 103983, 103984, 103985, 103986, 103987, 103988, 
+    103989, 103990, 103991, 103992, 103993, 103994, 103995, 103996, 103997, 
+    103998, 103999, 104000, 104001, 104002, 104003, 104004, 104005, 104006, 
+    104007, 104008, 104009, 104010, 104011, 104012, 104013, 104014, 104015, 
+    104016, 104017, 104018, 104019, 104020, 104021, 104022, 104023, 104024, 
+    104025, 104026, 104027, 104028, 104029, 104030, 104031, 104032, 104033, 
+    104034, 104035, 104036, 104037, 104038, 104039, 104040, 104041, 104042, 
+    104043, 104044, 104045, 104046, 104047, 104048, 104049, 104050, 104051, 
+    104052, 104053, 104054, 104055, 104056, 104057, 104058, 104059, 104060, 
+    104061, 104062, 104063, 104064, 104065, 104066, 104067, 104068, 104069, 
+    104070, 104071, 104072, 104073, 104074, 104075, 104076, 104077, 104078, 
+    104079, 104080, 104081, 104082, 104083, 104084, 104085, 104086, 104087, 
+    104088, 104089, 104090, 104091, 104092, 104093, 104094, 104095, 104096, 
+    104097, 104098, 104099, 104100, 104101, 104102, 104103, 104104, 104105, 
+    104106, 104107, 104108, 104109, 104110, 104111, 104112, 104113, 104114, 
+    104115, 104116, 104117, 104118, 104119, 104120, 104121, 104122, 104123, 
+    104124, 104125, 104126, 104127, 104128, 104129, 104130, 104131, 104132, 
+    104133, 104134, 104135, 104136, 104137, 104138, 104139, 104140, 104141, 
+    104142, 104143, 104144, 104145, 104146, 104147, 104148, 104149, 104150, 
+    104151, 104152, 104153, 104154, 104155, 104156, 104157, 104158, 104159, 
+    104160, 104161, 104162, 104163, 104164, 104165, 104166, 104167, 104168, 
+    104169, 104170, 104171, 104172, 104173, 104174, 104175, 104176, 104177, 
+    104178, 104179, 104180, 104181, 104182, 104183, 104184, 104185, 104186, 
+    104187, 104188, 104189, 104190, 104191, 104192, 104193, 104194, 104195, 
+    104196, 104197, 104198, 104199, 104200, 104201, 104202, 104203, 104204, 
+    104205, 104206, 104207, 104208, 104209, 104210, 104211, 104212, 104213, 
+    104214, 104215, 104216, 104217, 104218, 104219, 104220, 104221, 104222, 
+    104223, 104224, 104225, 104226, 104227, 104228, 104229, 104230, 104231, 
+    104232, 104233, 104234, 104235, 104236, 104237, 104238, 104239, 104240, 
+    104241, 104242, 104243, 104244, 104245, 104246, 104247, 104248, 104249, 
+    104250, 104251, 104252, 104253, 104254, 104255, 104256, 104257, 104258, 
+    104259, 104260, 104261, 104262, 104263, 104264, 104265, 104266, 104267, 
+    104268, 104269, 104270, 104271, 104272, 104273, 104274, 104275, 104276, 
+    104277, 104278, 104279, 104280, 104281, 104282, 104283, 104284, 104285, 
+    104286, 104287, 104288, 104289, 104290, 104291, 104292, 104293, 104294, 
+    104295, 104296, 104297, 104298, 104299, 104300, 104301, 104302, 104303, 
+    104304, 104305, 104306, 104307, 104308, 104309, 104310, 104311, 104312, 
+    104313, 104314, 104315, 104316, 104317, 104318, 104319, 104320, 104321, 
+    104322, 104323, 104324, 104325, 104326, 104327, 104328, 104329, 104330, 
+    104331, 104332, 104333, 104334, 104335, 104336, 104337, 104338, 104339, 
+    104340, 104341, 104342, 104343, 104344, 104345, 104346, 104347, 104348, 
+    104349, 104350, 104351, 104352, 104353, 104354, 104355, 104356, 104357, 
+    104358, 104359, 104360, 104361, 104362, 104363, 104364, 104365, 104366, 
+    104367, 104368, 104369, 104370, 104371, 104372, 104373, 104374, 104375, 
+    104376, 104377, 104378, 104379, 104380, 104381, 104382, 104383, 104384, 
+    104385, 104386, 104387, 104388, 104389, 104390, 104391, 104392, 104393, 
+    104394, 104395, 104396, 104397, 104398, 104399, 104400, 104401, 104402, 
+    104403, 104404, 104405, 104406, 104407, 104408, 104409, 104410, 104411, 
+    104412, 104413, 104414, 104415, 104416, 104417, 104418, 104419, 104420, 
+    104421, 104422, 104423, 104424, 104425, 104426, 104427, 104428, 104429, 
+    104430, 104431, 104432, 104433, 104434, 104435, 104436, 104437, 104438, 
+    104439, 104440, 104441, 104442, 104443, 104444, 104445, 104446, 104447, 
+    104448, 104449, 104450, 104451, 104452, 104453, 104454, 104455, 104456, 
+    104457, 104458, 104459, 104460, 104461, 104462, 104463, 104464, 104465, 
+    104466, 104467, 104468, 104469, 104470, 104471, 104472, 104473, 104474, 
+    104475, 104476, 104477, 104478, 104479, 104480, 104481, 104482, 104483, 
+    104484, 104485, 104486, 104487, 104488, 104489, 104490, 104491, 104492, 
+    104493, 104494, 104495, 104496, 104497, 104498, 104499, 104500, 104501, 
+    104502, 104503, 104504, 104505, 104506, 104507, 104508, 104509, 104510, 
+    104511, 104512, 104513, 104514, 104515, 104516, 104517, 104518, 104519, 
+    104520, 104521, 104522, 104523, 104524, 104525, 104526, 104527, 104528, 
+    104529, 104530, 104531, 104532, 104533, 104534, 104535, 104536, 104537, 
+    104538, 104539, 104540, 104541, 104542, 104543, 104544, 104545, 104546, 
+    104547, 104548, 104549, 104550, 104551, 104552, 104553, 104554, 104555, 
+    104556, 104557, 104558, 104559, 104560, 104561, 104562, 104563, 104564, 
+    104565, 104566, 104567, 104568, 104569, 104570, 104571, 104572, 104573, 
+    104574, 104575, 104576, 104577, 104578, 104579, 104580, 104581, 104582, 
+    104583, 104584, 104585, 104586, 104587, 104588, 104589, 104590, 104591, 
+    104592, 104593, 104594, 104595, 104596, 104597, 104598, 104599, 104600, 
+    104601, 104602, 104603, 104604, 104605, 104606, 104607, 104608, 104609, 
+    104610, 104611, 104612, 104613, 104614, 104615, 104616, 104617, 104618, 
+    104619, 104620, 104621, 104622, 104623, 104624, 104625, 104626, 104627, 
+    104628, 104629, 104630, 104631, 104632, 104633, 104634, 104635, 104636, 
+    104637, 104638, 104639, 104640, 104641, 104642, 104643, 104644, 104645, 
+    104646, 104647, 104648, 104649, 104650, 104651, 104652, 104653, 104654, 
+    104655, 104656, 104657, 104658, 104659, 104660, 104661, 104662, 104663, 
+    104664, 104665, 104666, 104667, 104668, 104669, 104670, 104671, 104672, 
+    104673, 104674, 104675, 104676, 104677, 104678, 104679, 104680, 104681, 
+    104682, 104683, 104684, 104685, 104686, 104687, 104688, 104689, 104690, 
+    104691, 104692, 104693, 104694, 104695, 104696, 104697, 104698, 104699, 
+    104700, 104701, 104702, 104703, 104704, 104705, 104706, 104707, 104708, 
+    104709, 104710, 104711, 104712, 104713, 104714, 104715, 104716, 104717, 
+    104718, 104719, 104720, 104721, 104722, 104723, 104724, 104725, 104726, 
+    104727, 104728, 104729, 104730, 104731, 104732, 104733, 104734, 104735, 
+    104736, 104737, 104738, 104739, 104740, 104741, 104742, 104743, 104744, 
+    104745, 104746, 104747, 104748, 104749, 104750, 104751, 104752, 104753, 
+    104754, 104755, 104756, 104757, 104758, 104759, 104760, 104761, 104762, 
+    104763, 104764, 104765, 104766, 104767, 104768, 104769, 104770, 104771, 
+    104772, 104773, 104774, 104775, 104776, 104777, 104778, 104779, 104780, 
+    104781, 104782, 104783, 104784, 104785, 104786, 104787, 104788, 104789, 
+    104790, 104791, 104792, 104793, 104794, 104795, 104796, 104797, 104798, 
+    104799, 104800, 104801, 104802, 104803, 104804, 104805, 104806, 104807, 
+    104808, 104809, 104810, 104811, 104812, 104813, 104814, 104815, 104816, 
+    104817, 104818, 104819, 104820, 104821, 104822, 104823, 104824, 104825, 
+    104826, 104827, 104828, 104829, 104830, 104831, 104832, 104833, 104834, 
+    104835, 104836, 104837, 104838, 104839, 104840, 104841, 104842, 104843, 
+    104844, 104845, 104846, 104847, 104848, 104849, 104850, 104851, 104852, 
+    104853, 104854, 104855, 104856, 104857, 104858, 104859, 104860, 104861, 
+    104862, 104863, 104864, 104865, 104866, 104867, 104868, 104869, 104870, 
+    104871, 104872, 104873, 104874, 104875, 104876, 104877, 104878, 104879, 
+    104880, 104881, 104882, 104883, 104884, 104885, 104886, 104887, 104888, 
+    104889, 104890, 104891, 104892, 104893, 104894, 104895, 104896, 104897, 
+    104898, 104899, 104900, 104901, 104902, 104903, 104904, 104905, 104906, 
+    104907, 104908, 104909, 104910, 104911, 104912, 104913, 104914, 104915, 
+    104916, 104917, 104918, 104919, 104920, 104921, 104922, 104923, 104924, 
+    104925, 104926, 104927, 104928, 104929, 104930, 104931, 104932, 104933, 
+    104934, 104935, 104936, 104937, 104938, 104939, 104940, 104941, 104942, 
+    104943, 104944, 104945, 104946, 104947, 104948, 104949, 104950, 104951, 
+    104952, 104953, 104954, 104955, 104956, 104957, 104958, 104959, 104960, 
+    104961, 104962, 104963, 104964, 104965, 104966, 104967, 104968, 104969, 
+    104970, 104971, 104972, 104973, 104974, 104975, 104976, 104977, 104978, 
+    104979, 104980, 104981, 104982, 104983, 104984, 104985, 104986, 104987, 
+    104988, 104989, 104990, 104991, 104992, 104993, 104994, 104995, 104996, 
+    104997, 104998, 104999, 105000, 105001, 105002, 105003, 105004, 105005, 
+    105006, 105007, 105008, 105009, 105010, 105011, 105012, 105013, 105014, 
+    105015, 105016, 105017, 105018, 105019, 105020, 105021, 105022, 105023, 
+    105024, 105025, 105026, 105027, 105028, 105029, 105030, 105031, 105032, 
+    105033, 105034, 105035, 105036, 105037, 105038, 105039, 105040, 105041, 
+    105042, 105043, 105044, 105045, 105046, 105047, 105048, 105049, 105050, 
+    105051, 105052, 105053, 105054, 105055, 105056, 105057, 105058, 105059, 
+    105060, 105061, 105062, 105063, 105064, 105065, 105066, 105067, 105068, 
+    105069, 105070, 105071, 105072, 105073, 105074, 105075, 105076, 105077, 
+    105078, 105079, 105080, 105081, 105082, 105083, 105084, 105085, 105086, 
+    105087, 105088, 105089, 105090, 105091, 105092, 105093, 105094, 105095, 
+    105096, 105097, 105098, 105099, 105100, 105101, 105102, 105103, 105104, 
+    105105, 105106, 105107, 105108, 105109, 105110, 105111, 105112, 105113, 
+    105114, 105115, 105116, 105117, 105118, 105119, 105120, 105121, 105122, 
+    105123, 105124, 105125, 105126, 105127, 105128, 105129, 105130, 105131, 
+    105132, 105133, 105134, 105135, 105136, 105137, 105138, 105139, 105140, 
+    105141, 105142, 105143, 105144, 105145, 105146, 105147, 105148, 105149, 
+    105150, 105151, 105152, 105153, 105154, 105155, 105156, 105157, 105158, 
+    105159, 105160, 105161, 105162, 105163, 105164, 105165, 105166, 105167, 
+    105168, 105169, 105170, 105171, 105172, 105173, 105174, 105175, 105176, 
+    105177, 105178, 105179, 105180, 105181, 105182, 105183, 105184, 105185, 
+    105186, 105187, 105188, 105189, 105190, 105191, 105192, 105193, 105194, 
+    105195, 105196, 105197, 105198, 105199, 105200, 105201, 105202, 105203, 
+    105204, 105205, 105206, 105207, 105208, 105209, 105210, 105211, 105212, 
+    105213, 105214, 105215, 105216, 105217, 105218, 105219, 105220, 105221, 
+    105222, 105223, 105224, 105225, 105226, 105227, 105228, 105229, 105230, 
+    105231, 105232, 105233, 105234, 105235, 105236, 105237, 105238, 105239, 
+    105240, 105241, 105242, 105243, 105244, 105245, 105246, 105247, 105248, 
+    105249, 105250, 105251, 105252, 105253, 105254, 105255, 105256, 105257, 
+    105258, 105259, 105260, 105261, 105262, 105263, 105264, 105265, 105266, 
+    105267, 105268, 105269, 105270, 105271, 105272, 105273, 105274, 105275, 
+    105276, 105277, 105278, 105279, 105280, 105281, 105282, 105283, 105284, 
+    105285, 105286, 105287, 105288, 105289, 105290, 105291, 105292, 105293, 
+    105294, 105295, 105296, 105297, 105298, 105299, 105300, 105301, 105302, 
+    105303, 105304, 105305, 105306, 105307, 105308, 105309, 105310, 105311, 
+    105312, 105313, 105314, 105315, 105316, 105317, 105318, 105319, 105320, 
+    105321, 105322, 105323, 105324, 105325, 105326, 105327, 105328, 105329, 
+    105330, 105331, 105332, 105333, 105334, 105335, 105336, 105337, 105338, 
+    105339, 105340, 105341, 105342, 105343, 105344, 105345, 105346, 105347, 
+    105348, 105349, 105350, 105351, 105352, 105353, 105354, 105355, 105356, 
+    105357, 105358, 105359, 105360, 105361, 105362, 105363, 105364, 105365, 
+    105366, 105367, 105368, 105369, 105370, 105371, 105372, 105373, 105374, 
+    105375, 105376, 105377, 105378, 105379, 105380, 105381, 105382, 105383, 
+    105384, 105385, 105386, 105387, 105388, 105389, 105390, 105391, 105392, 
+    105393, 105394, 105395, 105396, 105397, 105398, 105399, 105400, 105401, 
+    105402, 105403, 105404, 105405, 105406, 105407, 105408, 105409, 105410, 
+    105411, 105412, 105413, 105414, 105415, 105416, 105417, 105418, 105419, 
+    105420, 105421, 105422, 105423, 105424, 105425, 105426, 105427, 105428, 
+    105429, 105430, 105431, 105432, 105433, 105434, 105435, 105436, 105437, 
+    105438, 105439, 105440, 105441, 105442, 105443, 105444, 105445, 105446, 
+    105447, 105448, 105449, 105450, 105451, 105452, 105453, 105454, 105455, 
+    105456, 105457, 105458, 105459, 105460, 105461, 105462, 105463, 105464, 
+    105465, 105466, 105467, 105468, 105469, 105470, 105471, 105472, 105473, 
+    105474, 105475, 105476, 105477, 105478, 105479, 105480, 105481, 105482, 
+    105483, 105484, 105485, 105486, 105487, 105488, 105489, 105490, 105491, 
+    105492, 105493, 105494, 105495, 105496, 105497, 105498, 105499, 105500, 
+    105501, 105502, 105503, 105504, 105505, 105506, 105507, 105508, 105509, 
+    105510, 105511, 105512, 105513, 105514, 105515, 105516, 105517, 105518, 
+    105519, 105520, 105521, 105522, 105523, 105524, 105525, 105526, 105527, 
+    105528, 105529, 105530, 105531, 105532, 105533, 105534, 105535, 105536, 
+    105537, 105538, 105539, 105540, 105541, 105542, 105543, 105544, 105545, 
+    105546, 105547, 105548, 105549, 105550, 105551, 105552, 105553, 105554, 
+    105555, 105556, 105557, 105558, 105559, 105560, 105561, 105562, 105563, 
+    105564, 105565, 105566, 105567, 105568, 105569, 105570, 105571, 105572, 
+    105573, 105574, 105575, 105576, 105577, 105578, 105579, 105580, 105581, 
+    105582, 105583, 105584, 105585, 105586, 105587, 105588, 105589, 105590, 
+    105591, 105592, 105593, 105594, 105595, 105596, 105597, 105598, 105599, 
+    105600, 105601, 105602, 105603, 105604, 105605, 105606, 105607, 105608, 
+    105609, 105610, 105611, 105612, 105613, 105614, 105615, 105616, 105617, 
+    105618, 105619, 105620, 105621, 105622, 105623, 105624, 105625, 105626, 
+    105627, 105628, 105629, 105630, 105631, 105632, 105633, 105634, 105635, 
+    105636, 105637, 105638, 105639, 105640, 105641, 105642, 105643, 105644, 
+    105645, 105646, 105647, 105648, 105649, 105650, 105651, 105652, 105653, 
+    105654, 105655, 105656, 105657, 105658, 105659, 105660, 105661, 105662, 
+    105663, 105664, 105665, 105666, 105667, 105668, 105669, 105670, 105671, 
+    105672, 105673, 105674, 105675, 105676, 105677, 105678, 105679, 105680, 
+    105681, 105682, 105683, 105684, 105685, 105686, 105687, 105688, 105689, 
+    105690, 105691, 105692, 105693, 105694, 105695, 105696, 105697, 105698, 
+    105699, 105700, 105701, 105702, 105703, 105704, 105705, 105706, 105707, 
+    105708, 105709, 105710, 105711, 105712, 105713, 105714, 105715, 105716, 
+    105717, 105718, 105719, 105720, 105721, 105722, 105723, 105724, 105725, 
+    105726, 105727, 105728, 105729, 105730, 105731, 105732, 105733, 105734, 
+    105735, 105736, 105737, 105738, 105739, 105740, 105741, 105742, 105743, 
+    105744, 105745, 105746, 105747, 105748, 105749, 105750, 105751, 105752, 
+    105753, 105754, 105755, 105756, 105757, 105758, 105759, 105760, 105761, 
+    105762, 105763, 105764, 105765, 105766, 105767, 105768, 105769, 105770, 
+    105771, 105772, 105773, 105774, 105775, 105776, 105777, 105778, 105779, 
+    105780, 105781, 105782, 105783, 105784, 105785, 105786, 105787, 105788, 
+    105789, 105790, 105791, 105792, 105793, 105794, 105795, 105796, 105797, 
+    105798, 105799, 105800, 105801, 105802, 105803, 105804, 105805, 105806, 
+    105807, 105808, 105809, 105810, 105811, 105812, 105813, 105814, 105815, 
+    105816, 105817, 105818, 105819, 105820, 105821, 105822, 105823, 105824, 
+    105825, 105826, 105827, 105828, 105829, 105830, 105831, 105832, 105833, 
+    105834, 105835, 105836, 105837, 105838, 105839, 105840, 105841, 105842, 
+    105843, 105844, 105845, 105846, 105847, 105848, 105849, 105850, 105851, 
+    105852, 105853, 105854, 105855, 105856, 105857, 105858, 105859, 105860, 
+    105861, 105862, 105863, 105864, 105865, 105866, 105867, 105868, 105869, 
+    105870, 105871, 105872, 105873, 105874, 105875, 105876, 105877, 105878, 
+    105879, 105880, 105881, 105882, 105883, 105884, 105885, 105886, 105887, 
+    105888, 105889, 105890, 105891, 105892, 105893, 105894, 105895, 105896, 
+    105897, 105898, 105899, 105900, 105901, 105902, 105903, 105904, 105905, 
+    105906, 105907, 105908, 105909, 105910, 105911, 105912, 105913, 105914, 
+    105915, 105916, 105917, 105918, 105919, 105920, 105921, 105922, 105923, 
+    105924, 105925, 105926, 105927, 105928, 105929, 105930, 105931, 105932, 
+    105933, 105934, 105935, 105936, 105937, 105938, 105939, 105940, 105941, 
+    105942, 105943, 105944, 105945, 105946, 105947, 105948, 105949, 105950, 
+    105951, 105952, 105953, 105954, 105955, 105956, 105957, 105958, 105959, 
+    105960, 105961, 105962, 105963, 105964, 105965, 105966, 105967, 105968, 
+    105969, 105970, 105971, 105972, 105973, 105974, 105975, 105976, 105977, 
+    105978, 105979, 105980, 105981, 105982, 105983, 105984, 105985, 105986, 
+    105987, 105988, 105989, 105990, 105991, 105992, 105993, 105994, 105995, 
+    105996, 105997, 105998, 105999, 106000, 106001, 106002, 106003, 106004, 
+    106005, 106006, 106007, 106008, 106009, 106010, 106011, 106012, 106013, 
+    106014, 106015, 106016, 106017, 106018, 106019, 106020, 106021, 106022, 
+    106023, 106024, 106025, 106026, 106027, 106028, 106029, 106030, 106031, 
+    106032, 106033, 106034, 106035, 106036, 106037, 106038, 106039, 106040, 
+    106041, 106042, 106043, 106044, 106045, 106046, 106047, 106048, 106049, 
+    106050, 106051, 106052, 106053, 106054, 106055, 106056, 106057, 106058, 
+    106059, 106060, 106061, 106062, 106063, 106064, 106065, 106066, 106067, 
+    106068, 106069, 106070, 106071, 106072, 106073, 106074, 106075, 106076, 
+    106077, 106078, 106079, 106080, 106081, 106082, 106083, 106084, 106085, 
+    106086, 106087, 106088, 106089, 106090, 106091, 106092, 106093, 106094, 
+    106095, 106096, 106097, 106098, 106099, 106100, 106101, 106102, 106103, 
+    106104, 106105, 106106, 106107, 106108, 106109, 106110, 106111, 106112, 
+    106113, 106114, 106115, 106116, 106117, 106118, 106119, 106120, 106121, 
+    106122, 106123, 106124, 106125, 106126, 106127, 106128, 106129, 106130, 
+    106131, 106132, 106133, 106134, 106135, 106136, 106137, 106138, 106139, 
+    106140, 106141, 106142, 106143, 106144, 106145, 106146, 106147, 106148, 
+    106149, 106150, 106151, 106152, 106153, 106154, 106155, 106156, 106157, 
+    106158, 106159, 106160, 106161, 106162, 106163, 106164, 106165, 106166, 
+    106167, 106168, 106169, 106170, 106171, 106172, 106173, 106174, 106175, 
+    106176, 106177, 106178, 106179, 106180, 106181, 106182, 106183, 106184, 
+    106185, 106186, 106187, 106188, 106189, 106190, 106191, 106192, 106193, 
+    106194, 106195, 106196, 106197, 106198, 106199, 106200, 106201, 106202, 
+    106203, 106204, 106205, 106206, 106207, 106208, 106209, 106210, 106211, 
+    106212, 106213, 106214, 106215, 106216, 106217, 106218, 106219, 106220, 
+    106221, 106222, 106223, 106224, 106225, 106226, 106227, 106228, 106229, 
+    106230, 106231, 106232, 106233, 106234, 106235, 106236, 106237, 106238, 
+    106239, 106240, 106241, 106242, 106243, 106244, 106245, 106246, 106247, 
+    106248, 106249, 106250, 106251, 106252, 106253, 106254, 106255, 106256, 
+    106257, 106258, 106259, 106260, 106261, 106262, 106263, 106264, 106265, 
+    106266, 106267, 106268, 106269, 106270, 106271, 106272, 106273, 106274, 
+    106275, 106276, 106277, 106278, 106279, 106280, 106281, 106282, 106283, 
+    106284, 106285, 106286, 106287, 106288, 106289, 106290, 106291, 106292, 
+    106293, 106294, 106295, 106296, 106297, 106298, 106299, 106300, 106301, 
+    106302, 106303, 106304, 106305, 106306, 106307, 106308, 106309, 106310, 
+    106311, 106312, 106313, 106314, 106315, 106316, 106317, 106318, 106319, 
+    106320, 106321, 106322, 106323, 106324, 106325, 106326, 106327, 106328, 
+    106329, 106330, 106331, 106332, 106333, 106334, 106335, 106336, 106337, 
+    106338, 106339, 106340, 106341, 106342, 106343, 106344, 106345, 106346, 
+    106347, 106348, 106349, 106350, 106351, 106352, 106353, 106354, 106355, 
+    106356, 106357, 106358, 106359, 106360, 106361, 106362, 106363, 106364, 
+    106365, 106366, 106367, 106368, 106369, 106370, 106371, 106372, 106373, 
+    106374, 106375, 106376, 106377, 106378, 106379, 106380, 106381, 106382, 
+    106383, 106384, 106385, 106386, 106387, 106388, 106389, 106390, 106391, 
+    106392, 106393, 106394, 106395, 106396, 106397, 106398, 106399, 106400, 
+    106401, 106402, 106403, 106404, 106405, 106406, 106407, 106408, 106409, 
+    106410, 106411, 106412, 106413, 106414, 106415, 106416, 106417, 106418, 
+    106419, 106420, 106421, 106422, 106423, 106424, 106425, 106426, 106427, 
+    106428, 106429, 106430, 106431, 106432, 106433, 106434, 106435, 106436, 
+    106437, 106438, 106439, 106440, 106441, 106442, 106443, 106444, 106445, 
+    106446, 106447, 106448, 106449, 106450, 106451, 106452, 106453, 106454, 
+    106455, 106456, 106457, 106458, 106459, 106460, 106461, 106462, 106463, 
+    106464, 106465, 106466, 106467, 106468, 106469, 106470, 106471, 106472, 
+    106473, 106474, 106475, 106476, 106477, 106478, 106479, 106480, 106481, 
+    106482, 106483, 106484, 106485, 106486, 106487, 106488, 106489, 106490, 
+    106491, 106492, 106493, 106494, 106495, 106496, 106497, 106498, 106499, 
+    106500, 106501, 106502, 106503, 106504, 106505, 106506, 106507, 106508, 
+    106509, 106510, 106511, 106512, 106513, 106514, 106515, 106516, 106517, 
+    106518, 106519, 106520, 106521, 106522, 106523, 106524, 106525, 106526, 
+    106527, 106528, 106529, 106530, 106531, 106532, 106533, 106534, 106535, 
+    106536, 106537, 106538, 106539, 106540, 106541, 106542, 106543, 106544, 
+    106545, 106546, 106547, 106548, 106549, 106550, 106551, 106552, 106553, 
+    106554, 106555, 106556, 106557, 106558, 106559, 106560, 106561, 106562, 
+    106563, 106564, 106565, 106566, 106567, 106568, 106569, 106570, 106571, 
+    106572, 106573, 106574, 106575, 106576, 106577, 106578, 106579, 106580, 
+    106581, 106582, 106583, 106584, 106585, 106586, 106587, 106588, 106589, 
+    106590, 106591, 106592, 106593, 106594, 106595, 106596, 106597, 106598, 
+    106599, 106600, 106601, 106602, 106603, 106604, 106605, 106606, 106607, 
+    106608, 106609, 106610, 106611, 106612, 106613, 106614, 106615, 106616, 
+    106617, 106618, 106619, 106620, 106621, 106622, 106623, 106624, 106625, 
+    106626, 106627, 106628, 106629, 106630, 106631, 106632, 106633, 106634, 
+    106635, 106636, 106637, 106638, 106639, 106640, 106641, 106642, 106643, 
+    106644, 106645, 106646, 106647, 106648, 106649, 106650, 106651, 106652, 
+    106653, 106654, 106655, 106656, 106657, 106658, 106659, 106660, 106661, 
+    106662, 106663, 106664, 106665, 106666, 106667, 106668, 106669, 106670, 
+    106671, 106672, 106673, 106674, 106675, 106676, 106677, 106678, 106679, 
+    106680, 106681, 106682, 106683, 106684, 106685, 106686, 106687, 106688, 
+    106689, 106690, 106691, 106692, 106693, 106694, 106695, 106696, 106697, 
+    106698, 106699, 106700, 106701, 106702, 106703, 106704, 106705, 106706, 
+    106707, 106708, 106709, 106710, 106711, 106712, 106713, 106714, 106715, 
+    106716, 106717, 106718, 106719, 106720, 106721, 106722, 106723, 106724, 
+    106725, 106726, 106727, 106728, 106729, 106730, 106731, 106732, 106733, 
+    106734, 106735, 106736, 106737, 106738, 106739, 106740, 106741, 106742, 
+    106743, 106744, 106745, 106746, 106747, 106748, 106749, 106750, 106751, 
+    106752, 106753, 106754, 106755, 106756, 106757, 106758, 106759, 106760, 
+    106761, 106762, 106763, 106764, 106765, 106766, 106767, 106768, 106769, 
+    106770, 106771, 106772, 106773, 106774, 106775, 106776, 106777, 106778, 
+    106779, 106780, 106781, 106782, 106783, 106784, 106785, 106786, 106787, 
+    106788, 106789, 106790, 106791, 106792, 106793, 106794, 106795, 106796, 
+    106797, 106798, 106799, 106800, 106801, 106802, 106803, 106804, 106805, 
+    106806, 106807, 106808, 106809, 106810, 106811, 106812, 106813, 106814, 
+    106815, 106816, 106817, 106818, 106819, 106820, 106821, 106822, 106823, 
+    106824, 106825, 106826, 106827, 106828, 106829, 106830, 106831, 106832, 
+    106833, 106834, 106835, 106836, 106837, 106838, 106839, 106840, 106841, 
+    106842, 106843, 106844, 106845, 106846, 106847, 106848, 106849, 106850, 
+    106851, 106852, 106853, 106854, 106855, 106856, 106857, 106858, 106859, 
+    106860, 106861, 106862, 106863, 106864, 106865, 106866, 106867, 106868, 
+    106869, 106870, 106871, 106872, 106873, 106874, 106875, 106876, 106877, 
+    106878, 106879, 106880, 106881, 106882, 106883, 106884, 106885, 106886, 
+    106887, 106888, 106889, 106890, 106891, 106892, 106893, 106894, 106895, 
+    106896, 106897, 106898, 106899, 106900, 106901, 106902, 106903, 106904, 
+    106905, 106906, 106907, 106908, 106909, 106910, 106911, 106912, 106913, 
+    106914, 106915, 106916, 106917, 106918, 106919, 106920, 106921, 106922, 
+    106923, 106924, 106925, 106926, 106927, 106928, 106929, 106930, 106931, 
+    106932, 106933, 106934, 106935, 106936, 106937, 106938, 106939, 106940, 
+    106941, 106942, 106943, 106944, 106945, 106946, 106947, 106948, 106949, 
+    106950, 106951, 106952, 106953, 106954, 106955, 106956, 106957, 106958, 
+    106959, 106960, 106961, 106962, 106963, 106964, 106965, 106966, 106967, 
+    106968, 106969, 106970, 106971, 106972, 106973, 106974, 106975, 106976, 
+    106977, 106978, 106979, 106980, 106981, 106982, 106983, 106984, 106985, 
+    106986, 106987, 106988, 106989, 106990, 106991, 106992, 106993, 106994, 
+    106995, 106996, 106997, 106998, 106999, 107000, 107001, 107002, 107003, 
+    107004, 107005, 107006, 107007, 107008, 107009, 107010, 107011, 107012, 
+    107013, 107014, 107015, 107016, 107017, 107018, 107019, 107020, 107021, 
+    107022, 107023, 107024, 107025, 107026, 107027, 107028, 107029, 107030, 
+    107031, 107032, 107033, 107034, 107035, 107036, 107037, 107038, 107039, 
+    107040, 107041, 107042, 107043, 107044, 107045, 107046, 107047, 107048, 
+    107049, 107050, 107051, 107052, 107053, 107054, 107055, 107056, 107057, 
+    107058, 107059, 107060, 107061, 107062, 107063, 107064, 107065, 107066, 
+    107067, 107068, 107069, 107070, 107071, 107072, 107073, 107074, 107075, 
+    107076, 107077, 107078, 107079, 107080, 107081, 107082, 107083, 107084, 
+    107085, 107086, 107087, 107088, 107089, 107090, 107091, 107092, 107093, 
+    107094, 107095, 107096, 107097, 107098, 107099, 107100, 107101, 107102, 
+    107103, 107104, 107105, 107106, 107107, 107108, 107109, 107110, 107111, 
+    107112, 107113, 107114, 107115, 107116, 107117, 107118, 107119, 107120, 
+    107121, 107122, 107123, 107124, 107125, 107126, 107127, 107128, 107129, 
+    107130, 107131, 107132, 107133, 107134, 107135, 107136, 107137, 107138, 
+    107139, 107140, 107141, 107142, 107143, 107144, 107145, 107146, 107147, 
+    107148, 107149, 107150, 107151, 107152, 107153, 107154, 107155, 107156, 
+    107157, 107158, 107159, 107160, 107161, 107162, 107163, 107164, 107165, 
+    107166, 107167, 107168, 107169, 107170, 107171, 107172, 107173, 107174, 
+    107175, 107176, 107177, 107178, 107179, 107180, 107181, 107182, 107183, 
+    107184, 107185, 107186, 107187, 107188, 107189, 107190, 107191, 107192, 
+    107193, 107194, 107195, 107196, 107197, 107198, 107199, 107200, 107201, 
+    107202, 107203, 107204, 107205, 107206, 107207, 107208, 107209, 107210, 
+    107211, 107212, 107213, 107214, 107215, 107216, 107217, 107218, 107219, 
+    107220, 107221, 107222, 107223, 107224, 107225, 107226, 107227, 107228, 
+    107229, 107230, 107231, 107232, 107233, 107234, 107235, 107236, 107237, 
+    107238, 107239, 107240, 107241, 107242, 107243, 107244, 107245, 107246, 
+    107247, 107248, 107249, 107250, 107251, 107252, 107253, 107254, 107255, 
+    107256, 107257, 107258, 107259, 107260, 107261, 107262, 107263, 107264, 
+    107265, 107266, 107267, 107268, 107269, 107270, 107271, 107272, 107273, 
+    107274, 107275, 107276, 107277, 107278, 107279, 107280, 107281, 107282, 
+    107283, 107284, 107285, 107286, 107287, 107288, 107289, 107290, 107291, 
+    107292, 107293, 107294, 107295, 107296, 107297, 107298, 107299, 107300, 
+    107301, 107302, 107303, 107304, 107305, 107306, 107307, 107308, 107309, 
+    107310, 107311, 107312, 107313, 107314, 107315, 107316, 107317, 107318, 
+    107319, 107320, 107321, 107322, 107323, 107324, 107325, 107326, 107327, 
+    107328, 107329, 107330, 107331, 107332, 107333, 107334, 107335, 107336, 
+    107337, 107338, 107339, 107340, 107341, 107342, 107343, 107344, 107345, 
+    107346, 107347, 107348, 107349, 107350, 107351, 107352, 107353, 107354, 
+    107355, 107356, 107357, 107358, 107359, 107360, 107361, 107362, 107363, 
+    107364, 107365, 107366, 107367, 107368, 107369, 107370, 107371, 107372, 
+    107373, 107374, 107375, 107376, 107377, 107378, 107379, 107380, 107381, 
+    107382, 107383, 107384, 107385, 107386, 107387, 107388, 107389, 107390, 
+    107391, 107392, 107393, 107394, 107395, 107396, 107397, 107398, 107399, 
+    107400, 107401, 107402, 107403, 107404, 107405, 107406, 107407, 107408, 
+    107409, 107410, 107411, 107412, 107413, 107414, 107415, 107416, 107417, 
+    107418, 107419, 107420, 107421, 107422, 107423, 107424, 107425, 107426, 
+    107427, 107428, 107429, 107430, 107431, 107432, 107433, 107434, 107435, 
+    107436, 107437, 107438, 107439, 107440, 107441, 107442, 107443, 107444, 
+    107445, 107446, 107447, 107448, 107449, 107450, 107451, 107452, 107453, 
+    107454, 107455, 107456, 107457, 107458, 107459, 107460, 107461, 107462, 
+    107463, 107464, 107465, 107466, 107467, 107468, 107469, 107470, 107471, 
+    107472, 107473, 107474, 107475, 107476, 107477, 107478, 107479, 107480, 
+    107481, 107482, 107483, 107484, 107485, 107486, 107487, 107488, 107489, 
+    107490, 107491, 107492, 107493, 107494, 107495, 107496, 107497, 107498, 
+    107499, 107500, 107501, 107502, 107503, 107504, 107505, 107506, 107507, 
+    107508, 107509, 107510, 107511, 107512, 107513, 107514, 107515, 107516, 
+    107517, 107518, 107519, 107520, 107521, 107522, 107523, 107524, 107525, 
+    107526, 107527, 107528, 107529, 107530, 107531, 107532, 107533, 107534, 
+    107535, 107536, 107537, 107538, 107539, 107540, 107541, 107542, 107543, 
+    107544, 107545, 107546, 107547, 107548, 107549, 107550, 107551, 107552, 
+    107553, 107554, 107555, 107556, 107557, 107558, 107559, 107560, 107561, 
+    107562, 107563, 107564, 107565, 107566, 107567, 107568, 107569, 107570, 
+    107571, 107572, 107573, 107574, 107575, 107576, 107577, 107578, 107579, 
+    107580, 107581, 107582, 107583, 107584, 107585, 107586, 107587, 107588, 
+    107589, 107590, 107591, 107592, 107593, 107594, 107595, 107596, 107597, 
+    107598, 107599, 107600, 107601, 107602, 107603, 107604, 107605, 107606, 
+    107607, 107608, 107609, 107610, 107611, 107612, 107613, 107614, 107615, 
+    107616, 107617, 107618, 107619, 107620, 107621, 107622, 107623, 107624, 
+    107625, 107626, 107627, 107628, 107629, 107630, 107631, 107632, 107633, 
+    107634, 107635, 107636, 107637, 107638, 107639, 107640, 107641, 107642, 
+    107643, 107644, 107645, 107646, 107647, 107648, 107649, 107650, 107651, 
+    107652, 107653, 107654, 107655, 107656, 107657, 107658, 107659, 107660, 
+    107661, 107662, 107663, 107664, 107665, 107666, 107667, 107668, 107669, 
+    107670, 107671, 107672, 107673, 107674, 107675, 107676, 107677, 107678, 
+    107679, 107680, 107681, 107682, 107683, 107684, 107685, 107686, 107687, 
+    107688, 107689, 107690, 107691, 107692, 107693, 107694, 107695, 107696, 
+    107697, 107698, 107699, 107700, 107701, 107702, 107703, 107704, 107705, 
+    107706, 107707, 107708, 107709, 107710, 107711, 107712, 107713, 107714, 
+    107715, 107716, 107717, 107718, 107719, 107720, 107721, 107722, 107723, 
+    107724, 107725, 107726, 107727, 107728, 107729, 107730, 107731, 107732, 
+    107733, 107734, 107735, 107736, 107737, 107738, 107739, 107740, 107741, 
+    107742, 107743, 107744, 107745, 107746, 107747, 107748, 107749, 107750, 
+    107751, 107752, 107753, 107754, 107755, 107756, 107757, 107758, 107759, 
+    107760, 107761, 107762, 107763, 107764, 107765, 107766, 107767, 107768, 
+    107769, 107770, 107771, 107772, 107773, 107774, 107775, 107776, 107777, 
+    107778, 107779, 107780, 107781, 107782, 107783, 107784, 107785, 107786, 
+    107787, 107788, 107789, 107790, 107791, 107792, 107793, 107794, 107795, 
+    107796, 107797, 107798, 107799, 107800, 107801, 107802, 107803, 107804, 
+    107805, 107806, 107807, 107808, 107809, 107810, 107811, 107812, 107813, 
+    107814, 107815, 107816, 107817, 107818, 107819, 107820, 107821, 107822, 
+    107823, 107824, 107825, 107826, 107827, 107828, 107829, 107830, 107831, 
+    107832, 107833, 107834, 107835, 107836, 107837, 107838, 107839, 107840, 
+    107841, 107842, 107843, 107844, 107845, 107846, 107847, 107848, 107849, 
+    107850, 107851, 107852, 107853, 107854, 107855, 107856, 107857, 107858, 
+    107859, 107860, 107861, 107862, 107863, 107864, 107865, 107866, 107867, 
+    107868, 107869, 107870, 107871, 107872, 107873, 107874, 107875, 107876, 
+    107877, 107878, 107879, 107880, 107881, 107882, 107883, 107884, 107885, 
+    107886, 107887, 107888, 107889, 107890, 107891, 107892, 107893, 107894, 
+    107895, 107896, 107897, 107898, 107899, 107900, 107901, 107902, 107903, 
+    107904, 107905, 107906, 107907, 107908, 107909, 107910, 107911, 107912, 
+    107913, 107914, 107915, 107916, 107917, 107918, 107919, 107920, 107921, 
+    107922, 107923, 107924, 107925, 107926, 107927, 107928, 107929, 107930, 
+    107931, 107932, 107933, 107934, 107935, 107936, 107937, 107938, 107939, 
+    107940, 107941, 107942, 107943, 107944, 107945, 107946, 107947, 107948, 
+    107949, 107950, 107951, 107952, 107953, 107954, 107955, 107956, 107957, 
+    107958, 107959, 107960, 107961, 107962, 107963, 107964, 107965, 107966, 
+    107967, 107968, 107969, 107970, 107971, 107972, 107973, 107974, 107975, 
+    107976, 107977, 107978, 107979, 107980, 107981, 107982, 107983, 107984, 
+    107985, 107986, 107987, 107988, 107989, 107990, 107991, 107992, 107993, 
+    107994, 107995, 107996, 107997, 107998, 107999, 108000, 108001, 108002, 
+    108003, 108004, 108005, 108006, 108007, 108008, 108009, 108010, 108011, 
+    108012, 108013, 108014, 108015, 108016, 108017, 108018, 108019, 108020, 
+    108021, 108022, 108023, 108024, 108025, 108026, 108027, 108028, 108029, 
+    108030, 108031, 108032, 108033, 108034, 108035, 108036, 108037, 108038, 
+    108039, 108040, 108041, 108042, 108043, 108044, 108045, 108046, 108047, 
+    108048, 108049, 108050, 108051, 108052, 108053, 108054, 108055, 108056, 
+    108057, 108058, 108059, 108060, 108061, 108062, 108063, 108064, 108065, 
+    108066, 108067, 108068, 108069, 108070, 108071, 108072, 108073, 108074, 
+    108075, 108076, 108077, 108078, 108079, 108080, 108081, 108082, 108083, 
+    108084, 108085, 108086, 108087, 108088, 108089, 108090, 108091, 108092, 
+    108093, 108094, 108095, 108096, 108097, 108098, 108099, 108100, 108101, 
+    108102, 108103, 108104, 108105, 108106, 108107, 108108, 108109, 108110, 
+    108111, 108112, 108113, 108114, 108115, 108116, 108117, 108118, 108119, 
+    108120, 108121, 108122, 108123, 108124, 108125, 108126, 108127, 108128, 
+    108129, 108130, 108131, 108132, 108133, 108134, 108135, 108136, 108137, 
+    108138, 108139, 108140, 108141, 108142, 108143, 108144, 108145, 108146, 
+    108147, 108148, 108149, 108150, 108151, 108152, 108153, 108154, 108155, 
+    108156, 108157, 108158, 108159, 108160, 108161, 108162, 108163, 108164, 
+    108165, 108166, 108167, 108168, 108169, 108170, 108171, 108172, 108173, 
+    108174, 108175, 108176, 108177, 108178, 108179, 108180, 108181, 108182, 
+    108183, 108184, 108185, 108186, 108187, 108188, 108189, 108190, 108191, 
+    108192, 108193, 108194, 108195, 108196, 108197, 108198, 108199, 108200, 
+    108201, 108202, 108203, 108204, 108205, 108206, 108207, 108208, 108209, 
+    108210, 108211, 108212, 108213, 108214, 108215, 108216, 108217, 108218, 
+    108219, 108220, 108221, 108222, 108223, 108224, 108225, 108226, 108227, 
+    108228, 108229, 108230, 108231, 108232, 108233, 108234, 108235, 108236, 
+    108237, 108238, 108239, 108240, 108241, 108242, 108243, 108244, 108245, 
+    108246, 108247, 108248, 108249, 108250, 108251, 108252, 108253, 108254, 
+    108255, 108256, 108257, 108258, 108259, 108260, 108261, 108262, 108263, 
+    108264, 108265, 108266, 108267, 108268, 108269, 108270, 108271, 108272, 
+    108273, 108274, 108275, 108276, 108277, 108278, 108279, 108280, 108281, 
+    108282, 108283, 108284, 108285, 108286, 108287, 108288, 108289, 108290, 
+    108291, 108292, 108293, 108294, 108295, 108296, 108297, 108298, 108299, 
+    108300, 108301, 108302, 108303, 108304, 108305, 108306, 108307, 108308, 
+    108309, 108310, 108311, 108312, 108313, 108314, 108315, 108316, 108317, 
+    108318, 108319, 108320, 108321, 108322, 108323, 108324, 108325, 108326, 
+    108327, 108328, 108329, 108330, 108331, 108332, 108333, 108334, 108335, 
+    108336, 108337, 108338, 108339, 108340, 108341, 108342, 108343, 108344, 
+    108345, 108346, 108347, 108348, 108349, 108350, 108351, 108352, 108353, 
+    108354, 108355, 108356, 108357, 108358, 108359, 108360, 108361, 108362, 
+    108363, 108364, 108365, 108366, 108367, 108368, 108369, 108370, 108371, 
+    108372, 108373, 108374, 108375, 108376, 108377, 108378, 108379, 108380, 
+    108381, 108382, 108383, 108384, 108385, 108386, 108387, 108388, 108389, 
+    108390, 108391, 108392, 108393, 108394, 108395, 108396, 108397, 108398, 
+    108399, 108400, 108401, 108402, 108403, 108404, 108405, 108406, 108407, 
+    108408, 108409, 108410, 108411, 108412, 108413, 108414, 108415, 108416, 
+    108417, 108418, 108419, 108420, 108421, 108422, 108423, 108424, 108425, 
+    108426, 108427, 108428, 108429, 108430, 108431, 108432, 108433, 108434, 
+    108435, 108436, 108437, 108438, 108439, 108440, 108441, 108442, 108443, 
+    108444, 108445, 108446, 108447, 108448, 108449, 108450, 108451, 108452, 
+    108453, 108454, 108455, 108456, 108457, 108458, 108459, 108460, 108461, 
+    108462, 108463, 108464, 108465, 108466, 108467, 108468, 108469, 108470, 
+    108471, 108472, 108473, 108474, 108475, 108476, 108477, 108478, 108479, 
+    108480, 108481, 108482, 108483, 108484, 108485, 108486, 108487, 108488, 
+    108489, 108490, 108491, 108492, 108493, 108494, 108495, 108496, 108497, 
+    108498, 108499, 108500, 108501, 108502, 108503, 108504, 108505, 108506, 
+    108507, 108508, 108509, 108510, 108511, 108512, 108513, 108514, 108515, 
+    108516, 108517, 108518, 108519, 108520, 108521, 108522, 108523, 108524, 
+    108525, 108526, 108527, 108528, 108529, 108530, 108531, 108532, 108533, 
+    108534, 108535, 108536, 108537, 108538, 108539, 108540, 108541, 108542, 
+    108543, 108544, 108545, 108546, 108547, 108548, 108549, 108550, 108551, 
+    108552, 108553, 108554, 108555, 108556, 108557, 108558, 108559, 108560, 
+    108561, 108562, 108563, 108564, 108565, 108566, 108567, 108568, 108569, 
+    108570, 108571, 108572, 108573, 108574, 108575, 108576, 108577, 108578, 
+    108579, 108580, 108581, 108582, 108583, 108584, 108585, 108586, 108587, 
+    108588, 108589, 108590, 108591, 108592, 108593, 108594, 108595, 108596, 
+    108597, 108598, 108599, 108600, 108601, 108602, 108603, 108604, 108605, 
+    108606, 108607, 108608, 108609, 108610, 108611, 108612, 108613, 108614, 
+    108615, 108616, 108617, 108618, 108619, 108620, 108621, 108622, 108623, 
+    108624, 108625, 108626, 108627, 108628, 108629, 108630, 108631, 108632, 
+    108633, 108634, 108635, 108636, 108637, 108638, 108639, 108640, 108641, 
+    108642, 108643, 108644, 108645, 108646, 108647, 108648, 108649, 108650, 
+    108651, 108652, 108653, 108654, 108655, 108656, 108657, 108658, 108659, 
+    108660, 108661, 108662, 108663, 108664, 108665, 108666, 108667, 108668, 
+    108669, 108670, 108671, 108672, 108673, 108674, 108675, 108676, 108677, 
+    108678, 108679, 108680, 108681, 108682, 108683, 108684, 108685, 108686, 
+    108687, 108688, 108689, 108690, 108691, 108692, 108693, 108694, 108695, 
+    108696, 108697, 108698, 108699, 108700, 108701, 108702, 108703, 108704, 
+    108705, 108706, 108707, 108708, 108709, 108710, 108711, 108712, 108713, 
+    108714, 108715, 108716, 108717, 108718, 108719, 108720, 108721, 108722, 
+    108723, 108724, 108725, 108726, 108727, 108728, 108729, 108730, 108731, 
+    108732, 108733, 108734, 108735, 108736, 108737, 108738, 108739, 108740, 
+    108741, 108742, 108743, 108744, 108745, 108746, 108747, 108748, 108749, 
+    108750, 108751, 108752, 108753, 108754, 108755, 108756, 108757, 108758, 
+    108759, 108760, 108761, 108762, 108763, 108764, 108765, 108766, 108767, 
+    108768, 108769, 108770, 108771, 108772, 108773, 108774, 108775, 108776, 
+    108777, 108778, 108779, 108780, 108781, 108782, 108783, 108784, 108785, 
+    108786, 108787, 108788, 108789, 108790, 108791, 108792, 108793, 108794, 
+    108795, 108796, 108797, 108798, 108799, 108800, 108801, 108802, 108803, 
+    108804, 108805, 108806, 108807, 108808, 108809, 108810, 108811, 108812, 
+    108813, 108814, 108815, 108816, 108817, 108818, 108819, 108820, 108821, 
+    108822, 108823, 108824, 108825, 108826, 108827, 108828, 108829, 108830, 
+    108831, 108832, 108833, 108834, 108835, 108836, 108837, 108838, 108839, 
+    108840, 108841, 108842, 108843, 108844, 108845, 108846, 108847, 108848, 
+    108849, 108850, 108851, 108852, 108853, 108854, 108855, 108856, 108857, 
+    108858, 108859, 108860, 108861, 108862, 108863, 108864, 108865, 108866, 
+    108867, 108868, 108869, 108870, 108871, 108872, 108873, 108874, 108875, 
+    108876, 108877, 108878, 108879, 108880, 108881, 108882, 108883, 108884, 
+    108885, 108886, 108887, 108888, 108889, 108890, 108891, 108892, 108893, 
+    108894, 108895, 108896, 108897, 108898, 108899, 108900, 108901, 108902, 
+    108903, 108904, 108905, 108906, 108907, 108908, 108909, 108910, 108911, 
+    108912, 108913, 108914, 108915, 108916, 108917, 108918, 108919, 108920, 
+    108921, 108922, 108923, 108924, 108925, 108926, 108927, 108928, 108929, 
+    108930, 108931, 108932, 108933, 108934, 108935, 108936, 108937, 108938, 
+    108939, 108940, 108941, 108942, 108943, 108944, 108945, 108946, 108947, 
+    108948, 108949, 108950, 108951, 108952, 108953, 108954, 108955, 108956, 
+    108957, 108958, 108959, 108960, 108961, 108962, 108963, 108964, 108965, 
+    108966, 108967, 108968, 108969, 108970, 108971, 108972, 108973, 108974, 
+    108975, 108976, 108977, 108978, 108979, 108980, 108981, 108982, 108983, 
+    108984, 108985, 108986, 108987, 108988, 108989, 108990, 108991, 108992, 
+    108993, 108994, 108995, 108996, 108997, 108998, 108999, 109000, 109001, 
+    109002, 109003, 109004, 109005, 109006, 109007, 109008, 109009, 109010, 
+    109011, 109012, 109013, 109014, 109015, 109016, 109017, 109018, 109019, 
+    109020, 109021, 109022, 109023, 109024, 109025, 109026, 109027, 109028, 
+    109029, 109030, 109031, 109032, 109033, 109034, 109035, 109036, 109037, 
+    109038, 109039, 109040, 109041, 109042, 109043, 109044, 109045, 109046, 
+    109047, 109048, 109049, 109050, 109051, 109052, 109053, 109054, 109055, 
+    109056, 109057, 109058, 109059, 109060, 109061, 109062, 109063, 109064, 
+    109065, 109066, 109067, 109068, 109069, 109070, 109071, 109072, 109073, 
+    109074, 109075, 109076, 109077, 109078, 109079, 109080, 109081, 109082, 
+    109083, 109084, 109085, 109086, 109087, 109088, 109089, 109090, 109091, 
+    109092, 109093, 109094, 109095, 109096, 109097, 109098, 109099, 109100, 
+    109101, 109102, 109103, 109104, 109105, 109106, 109107, 109108, 109109, 
+    109110, 109111, 109112, 109113, 109114, 109115, 109116, 109117, 109118, 
+    109119, 109120, 109121, 109122, 109123, 109124, 109125, 109126, 109127, 
+    109128, 109129, 109130, 109131, 109132, 109133, 109134, 109135, 109136, 
+    109137, 109138, 109139, 109140, 109141, 109142, 109143, 109144, 109145, 
+    109146, 109147, 109148, 109149, 109150, 109151, 109152, 109153, 109154, 
+    109155, 109156, 109157, 109158, 109159, 109160, 109161, 109162, 109163, 
+    109164, 109165, 109166, 109167, 109168, 109169, 109170, 109171, 109172, 
+    109173, 109174, 109175, 109176, 109177, 109178, 109179, 109180, 109181, 
+    109182, 109183, 109184, 109185, 109186, 109187, 109188, 109189, 109190, 
+    109191, 109192, 109193, 109194, 109195, 109196, 109197, 109198, 109199, 
+    109200, 109201, 109202, 109203, 109204, 109205, 109206, 109207, 109208, 
+    109209, 109210, 109211, 109212, 109213, 109214, 109215, 109216, 109217, 
+    109218, 109219, 109220, 109221, 109222, 109223, 109224, 109225, 109226, 
+    109227, 109228, 109229, 109230, 109231, 109232, 109233, 109234, 109235, 
+    109236, 109237, 109238, 109239, 109240, 109241, 109242, 109243, 109244, 
+    109245, 109246, 109247, 109248, 109249, 109250, 109251, 109252, 109253, 
+    109254, 109255, 109256, 109257, 109258, 109259, 109260, 109261, 109262, 
+    109263, 109264, 109265, 109266, 109267, 109268, 109269, 109270, 109271, 
+    109272, 109273, 109274, 109275, 109276, 109277, 109278, 109279, 109280, 
+    109281, 109282, 109283, 109284, 109285, 109286, 109287, 109288, 109289, 
+    109290, 109291, 109292, 109293, 109294, 109295, 109296, 109297, 109298, 
+    109299, 109300, 109301, 109302, 109303, 109304, 109305, 109306, 109307, 
+    109308, 109309, 109310, 109311, 109312, 109313, 109314, 109315, 109316, 
+    109317, 109318, 109319, 109320, 109321, 109322, 109323, 109324, 109325, 
+    109326, 109327, 109328, 109329, 109330, 109331, 109332, 109333, 109334, 
+    109335, 109336, 109337, 109338, 109339, 109340, 109341, 109342, 109343, 
+    109344, 109345, 109346, 109347, 109348, 109349, 109350, 109351, 109352, 
+    109353, 109354, 109355, 109356, 109357, 109358, 109359, 109360, 109361, 
+    109362, 109363, 109364, 109365, 109366, 109367, 109368, 109369, 109370, 
+    109371, 109372, 109373, 109374, 109375, 109376, 109377, 109378, 109379, 
+    109380, 109381, 109382, 109383, 109384, 109385, 109386, 109387, 109388, 
+    109389, 109390, 109391, 109392, 109393, 109394, 109395, 109396, 109397, 
+    109398, 109399, 109400, 109401, 109402, 109403, 109404, 109405, 109406, 
+    109407, 109408, 109409, 109410, 109411, 109412, 109413, 109414, 109415, 
+    109416, 109417, 109418, 109419, 109420, 109421, 109422, 109423, 109424, 
+    109425, 109426, 109427, 109428, 109429, 109430, 109431, 109432, 109433, 
+    109434, 109435, 109436, 109437, 109438, 109439, 109440, 109441, 109442, 
+    109443, 109444, 109445, 109446, 109447, 109448, 109449, 109450, 109451, 
+    109452, 109453, 109454, 109455, 109456, 109457, 109458, 109459, 109460, 
+    109461, 109462, 109463, 109464, 109465, 109466, 109467, 109468, 109469, 
+    109470, 109471, 109472, 109473, 109474, 109475, 109476, 109477, 109478, 
+    109479, 109480, 109481, 109482, 109483, 109484, 109485, 109486, 109487, 
+    109488, 109489, 109490, 109491, 109492, 109493, 109494, 109495, 109496, 
+    109497, 109498, 109499, 109500, 109501, 109502, 109503, 109504, 109505, 
+    109506, 109507, 109508, 109509, 109510, 109511, 109512, 109513, 109514, 
+    109515, 109516, 109517, 109518, 109519, 109520, 109521, 109522, 109523, 
+    109524, 109525, 109526, 109527, 109528, 109529, 109530, 109531, 109532, 
+    109533, 109534, 109535, 109536, 109537, 109538, 109539, 109540, 109541, 
+    109542, 109543, 109544, 109545, 109546, 109547, 109548, 109549, 109550, 
+    109551, 109552, 109553, 109554, 109555, 109556, 109557, 109558, 109559, 
+    109560, 109561, 109562, 109563, 109564, 109565, 109566, 109567, 109568, 
+    109569, 109570, 109571, 109572, 109573, 109574, 109575, 109576, 109577, 
+    109578, 109579, 109580, 109581, 109582, 109583, 109584, 109585, 109586, 
+    109587, 109588, 109589, 109590, 109591, 109592, 109593, 109594, 109595, 
+    109596, 109597, 109598, 109599, 109600, 109601, 109602, 109603, 109604, 
+    109605, 109606, 109607, 109608, 109609, 109610, 109611, 109612, 109613, 
+    109614, 109615, 109616, 109617, 109618, 109619, 109620, 109621, 109622, 
+    109623, 109624, 109625, 109626, 109627, 109628, 109629, 109630, 109631, 
+    109632, 109633, 109634, 109635, 109636, 109637, 109638, 109639, 109640, 
+    109641, 109642, 109643, 109644, 109645, 109646, 109647, 109648, 109649, 
+    109650, 109651, 109652, 109653, 109654, 109655, 109656, 109657, 109658, 
+    109659, 109660, 109661, 109662, 109663, 109664, 109665, 109666, 109667, 
+    109668, 109669, 109670, 109671, 109672, 109673, 109674, 109675, 109676, 
+    109677, 109678, 109679, 109680, 109681, 109682, 109683, 109684, 109685, 
+    109686, 109687, 109688, 109689, 109690, 109691, 109692, 109693, 109694, 
+    109695, 109696, 109697, 109698, 109699, 109700, 109701, 109702, 109703, 
+    109704, 109705, 109706, 109707, 109708, 109709, 109710, 109711, 109712, 
+    109713, 109714, 109715, 109716, 109717, 109718, 109719, 109720, 109721, 
+    109722, 109723, 109724, 109725, 109726, 109727, 109728, 109729, 109730, 
+    109731, 109732, 109733, 109734, 109735, 109736, 109737, 109738, 109739, 
+    109740, 109741, 109742, 109743, 109744, 109745, 109746, 109747, 109748, 
+    109749, 109750, 109751, 109752, 109753, 109754, 109755, 109756, 109757, 
+    109758, 109759, 109760, 109761, 109762, 109763, 109764, 109765, 109766, 
+    109767, 109768, 109769, 109770, 109771, 109772, 109773, 109774, 109775, 
+    109776, 109777, 109778, 109779, 109780, 109781, 109782, 109783, 109784, 
+    109785, 109786, 109787, 109788, 109789, 109790, 109791, 109792, 109793, 
+    109794, 109795, 109796, 109797, 109798, 109799, 109800, 109801, 109802, 
+    109803, 109804, 109805, 109806, 109807, 109808, 109809, 109810, 109811, 
+    109812, 109813, 109814, 109815, 109816, 109817, 109818, 109819, 109820, 
+    109821, 109822, 109823, 109824, 109825, 109826, 109827, 109828, 109829, 
+    109830, 109831, 109832, 109833, 109834, 109835, 109836, 109837, 109838, 
+    109839, 109840, 109841, 109842, 109843, 109844, 109845, 109846, 109847, 
+    109848, 109849, 109850, 109851, 109852, 109853, 109854, 109855, 109856, 
+    109857, 109858, 109859, 109860, 109861, 109862, 109863, 109864, 109865, 
+    109866, 109867, 109868, 109869, 109870, 109871, 109872, 109873, 109874, 
+    109875, 109876, 109877, 109878, 109879, 109880, 109881, 109882, 109883, 
+    109884, 109885, 109886, 109887, 109888, 109889, 109890, 109891, 109892, 
+    109893, 109894, 109895, 109896, 109897, 109898, 109899, 109900, 109901, 
+    109902, 109903, 109904, 109905, 109906, 109907, 109908, 109909, 109910, 
+    109911, 109912, 109913, 109914, 109915, 109916, 109917, 109918, 109919, 
+    109920, 109921, 109922, 109923, 109924, 109925, 109926, 109927, 109928, 
+    109929, 109930, 109931, 109932, 109933, 109934, 109935, 109936, 109937, 
+    109938, 109939, 109940, 109941, 109942, 109943, 109944, 109945, 109946, 
+    109947, 109948, 109949, 109950, 109951, 109952, 109953, 109954, 109955, 
+    109956, 109957, 109958, 109959, 109960, 109961, 109962, 109963, 109964, 
+    109965, 109966, 109967, 109968, 109969, 109970, 109971, 109972, 109973, 
+    109974, 109975, 109976, 109977, 109978, 109979, 109980, 109981, 109982, 
+    109983, 109984, 109985, 109986, 109987, 109988, 109989, 109990, 109991, 
+    109992, 109993, 109994, 109995, 109996, 109997, 109998, 109999, 110000, 
+    110001, 110002, 110003, 110004, 110005, 110006, 110007, 110008, 110009, 
+    110010, 110011, 110012, 110013, 110014, 110015, 110016, 110017, 110018, 
+    110019, 110020, 110021, 110022, 110023, 110024, 110025, 110026, 110027, 
+    110028, 110029, 110030, 110031, 110032, 110033, 110034, 110035, 110036, 
+    110037, 110038, 110039, 110040, 110041, 110042, 110043, 110044, 110045, 
+    110046, 110047, 110048, 110049, 110050, 110051, 110052, 110053, 110054, 
+    110055, 110056, 110057, 110058, 110059, 110060, 110061, 110062, 110063, 
+    110064, 110065, 110066, 110067, 110068, 110069, 110070, 110071, 110072, 
+    110073, 110074, 110075, 110076, 110077, 110078, 110079, 110080, 110081, 
+    110082, 110083, 110084, 110085, 110086, 110087, 110088, 110089, 110090, 
+    110091, 110092, 110093, 110094, 110095, 110096, 110097, 110098, 110099, 
+    110100, 110101, 110102, 110103, 110104, 110105, 110106, 110107, 110108, 
+    110109, 110110, 110111, 110112, 110113, 110114, 110115, 110116, 110117, 
+    110118, 110119, 110120, 110121, 110122, 110123, 110124, 110125, 110126, 
+    110127, 110128, 110129, 110130, 110131, 110132, 110133, 110134, 110135, 
+    110136, 110137, 110138, 110139, 110140, 110141, 110142, 110143, 110144, 
+    110145, 110146, 110147, 110148, 110149, 110150, 110151, 110152, 110153, 
+    110154, 110155, 110156, 110157, 110158, 110159, 110160, 110161, 110162, 
+    110163, 110164, 110165, 110166, 110167, 110168, 110169, 110170, 110171, 
+    110172, 110173, 110174, 110175, 110176, 110177, 110178, 110179, 110180, 
+    110181, 110182, 110183, 110184, 110185, 110186, 110187, 110188, 110189, 
+    110190, 110191, 110192, 110193, 110194, 110195, 110196, 110197, 110198, 
+    110199, 110200, 110201, 110202, 110203, 110204, 110205, 110206, 110207, 
+    110208, 110209, 110210, 110211, 110212, 110213, 110214, 110215, 110216, 
+    110217, 110218, 110219, 110220, 110221, 110222, 110223, 110224, 110225, 
+    110226, 110227, 110228, 110229, 110230, 110231, 110232, 110233, 110234, 
+    110235, 110236, 110237, 110238, 110239, 110240, 110241, 110242, 110243, 
+    110244, 110245, 110246, 110247, 110248, 110249, 110250, 110251, 110252, 
+    110253, 110254, 110255, 110256, 110257, 110258, 110259, 110260, 110261, 
+    110262, 110263, 110264, 110265, 110266, 110267, 110268, 110269, 110270, 
+    110271, 110272, 110273, 110274, 110275, 110276, 110277, 110278, 110279, 
+    110280, 110281, 110282, 110283, 110284, 110285, 110286, 110287, 110288, 
+    110289, 110290, 110291, 110292, 110293, 110294, 110295, 110296, 110297, 
+    110298, 110299, 110300, 110301, 110302, 110303, 110304, 110305, 110306, 
+    110307, 110308, 110309, 110310, 110311, 110312, 110313, 110314, 110315, 
+    110316, 110317, 110318, 110319, 110320, 110321, 110322, 110323, 110324, 
+    110325, 110326, 110327, 110328, 110329, 110330, 110331, 110332, 110333, 
+    110334, 110335, 110336, 110337, 110338, 110339, 110340, 110341, 110342, 
+    110343, 110344, 110345, 110346, 110347, 110348, 110349, 110350, 110351, 
+    110352, 110353, 110354, 110355, 110356, 110357, 110358, 110359, 110360, 
+    110361, 110362, 110363, 110364, 110365, 110366, 110367, 110368, 110369, 
+    110370, 110371, 110372, 110373, 110374, 110375, 110376, 110377, 110378, 
+    110379, 110380, 110381, 110382, 110383, 110384, 110385, 110386, 110387, 
+    110388, 110389, 110390, 110391, 110392, 110393, 110394, 110395, 110396, 
+    110397, 110398, 110399, 110400, 110401, 110402, 110403, 110404, 110405, 
+    110406, 110407, 110408, 110409, 110410, 110411, 110412, 110413, 110414, 
+    110415, 110416, 110417, 110418, 110419, 110420, 110421, 110422, 110423, 
+    110424, 110425, 110426, 110427, 110428, 110429, 110430, 110431, 110432, 
+    110433, 110434, 110435, 110436, 110437, 110438, 110439, 110440, 110441, 
+    110442, 110443, 110444, 110445, 110446, 110447, 110448, 110449, 110450, 
+    110451, 110452, 110453, 110454, 110455, 110456, 110457, 110458, 110459, 
+    110460, 110461, 110462, 110463, 110464, 110465, 110466, 110467, 110468, 
+    110469, 110470, 110471, 110472, 110473, 110474, 110475, 110476, 110477, 
+    110478, 110479, 110480, 110481, 110482, 110483, 110484, 110485, 110486, 
+    110487, 110488, 110489, 110490, 110491, 110492, 110493, 110494, 110495, 
+    110496, 110497, 110498, 110499, 110500, 110501, 110502, 110503, 110504, 
+    110505, 110506, 110507, 110508, 110509, 110510, 110511, 110512, 110513, 
+    110514, 110515, 110516, 110517, 110518, 110519, 110520, 110521, 110522, 
+    110523, 110524, 110525, 110526, 110527, 110528, 110529, 110530, 110531, 
+    110532, 110533, 110534, 110535, 110536, 110537, 110538, 110539, 110540, 
+    110541, 110542, 110543, 110544, 110545, 110546, 110547, 110548, 110549, 
+    110550, 110551, 110552, 110553, 110554, 110555, 110556, 110557, 110558, 
+    110559, 110560, 110561, 110562, 110563, 110564, 110565, 110566, 110567, 
+    110568, 110569, 110570, 110571, 110572, 110573, 110574, 110575, 110576, 
+    110577, 110578, 110579, 110580, 110581, 110582, 110583, 110584, 110585, 
+    110586, 110587, 110588, 110589, 110590, 110591, 110592, 110593, 110594, 
+    110595, 110596, 110597, 110598, 110599, 110600, 110601, 110602, 110603, 
+    110604, 110605, 110606, 110607, 110608, 110609, 110610, 110611, 110612, 
+    110613, 110614, 110615, 110616, 110617, 110618, 110619, 110620, 110621, 
+    110622, 110623, 110624, 110625, 110626, 110627, 110628, 110629, 110630, 
+    110631, 110632, 110633, 110634, 110635, 110636, 110637, 110638, 110639, 
+    110640, 110641, 110642, 110643, 110644, 110645, 110646, 110647, 110648, 
+    110649, 110650, 110651, 110652, 110653, 110654, 110655, 110656, 110657, 
+    110658, 110659, 110660, 110661, 110662, 110663, 110664, 110665, 110666, 
+    110667, 110668, 110669, 110670, 110671, 110672, 110673, 110674, 110675, 
+    110676, 110677, 110678, 110679, 110680, 110681, 110682, 110683, 110684, 
+    110685, 110686, 110687, 110688, 110689, 110690, 110691, 110692, 110693, 
+    110694, 110695, 110696, 110697, 110698, 110699, 110700, 110701, 110702, 
+    110703, 110704, 110705, 110706, 110707, 110708, 110709, 110710, 110711, 
+    110712, 110713, 110714, 110715, 110716, 110717, 110718, 110719, 110720, 
+    110721, 110722, 110723, 110724, 110725, 110726, 110727, 110728, 110729, 
+    110730, 110731, 110732, 110733, 110734, 110735, 110736, 110737, 110738, 
+    110739, 110740, 110741, 110742, 110743, 110744, 110745, 110746, 110747, 
+    110748, 110749, 110750, 110751, 110752, 110753, 110754, 110755, 110756, 
+    110757, 110758, 110759, 110760, 110761, 110762, 110763, 110764, 110765, 
+    110766, 110767, 110768, 110769, 110770, 110771, 110772, 110773, 110774, 
+    110775, 110776, 110777, 110778, 110779, 110780, 110781, 110782, 110783, 
+    110784, 110785, 110786, 110787, 110788, 110789, 110790, 110791, 110792, 
+    110793, 110794, 110795, 110796, 110797, 110798, 110799, 110800, 110801, 
+    110802, 110803, 110804, 110805, 110806, 110807, 110808, 110809, 110810, 
+    110811, 110812, 110813, 110814, 110815, 110816, 110817, 110818, 110819, 
+    110820, 110821, 110822, 110823, 110824, 110825, 110826, 110827, 110828, 
+    110829, 110830, 110831, 110832, 110833, 110834, 110835, 110836, 110837, 
+    110838, 110839, 110840, 110841, 110842, 110843, 110844, 110845, 110846, 
+    110847, 110848, 110849, 110850, 110851, 110852, 110853, 110854, 110855, 
+    110856, 110857, 110858, 110859, 110860, 110861, 110862, 110863, 110864, 
+    110865, 110866, 110867, 110868, 110869, 110870, 110871, 110872, 110873, 
+    110874, 110875, 110876, 110877, 110878, 110879, 110880, 110881, 110882, 
+    110883, 110884, 110885, 110886, 110887, 110888, 110889, 110890, 110891, 
+    110892, 110893, 110894, 110895, 110896, 110897, 110898, 110899, 110900, 
+    110901, 110902, 110903, 110904, 110905, 110906, 110907, 110908, 110909, 
+    110910, 110911, 110912, 110913, 110914, 110915, 110916, 110917, 110918, 
+    110919, 110920, 110921, 110922, 110923, 110924, 110925, 110926, 110927, 
+    110928, 110929, 110930, 110931, 110932, 110933, 110934, 110935, 110936, 
+    110937, 110938, 110939, 110940, 110941, 110942, 110943, 110944, 110945, 
+    110946, 110947, 110948, 110949, 110950, 110951, 110952, 110953, 110954, 
+    110955, 110956, 110957, 110958, 110959, 110960, 110961, 110962, 110963, 
+    110964, 110965, 110966, 110967, 110968, 110969, 110970, 110971, 110972, 
+    110973, 110974, 110975, 110976, 110977, 110978, 110979, 110980, 110981, 
+    110982, 110983, 110984, 110985, 110986, 110987, 110988, 110989, 110990, 
+    110991, 110992, 110993, 110994, 110995, 110996, 110997, 110998, 110999, 
+    111000, 111001, 111002, 111003, 111004, 111005, 111006, 111007, 111008, 
+    111009, 111010, 111011, 111012, 111013, 111014, 111015, 111016, 111017, 
+    111018, 111019, 111020, 111021, 111022, 111023, 111024, 111025, 111026, 
+    111027, 111028, 111029, 111030, 111031, 111032, 111033, 111034, 111035, 
+    111036, 111037, 111038, 111039, 111040, 111041, 111042, 111043, 111044, 
+    111045, 111046, 111047, 111048, 111049, 111050, 111051, 111052, 111053, 
+    111054, 111055, 111056, 111057, 111058, 111059, 111060, 111061, 111062, 
+    111063, 111064, 111065, 111066, 111067, 111068, 111069, 111070, 111071, 
+    111072, 111073, 111074, 111075, 111076, 111077, 111078, 111079, 111080, 
+    111081, 111082, 111083, 111084, 111085, 111086, 111087, 111088, 111089, 
+    111090, 111091, 111092, 111093, 111094, 111095, 111096, 111097, 111098, 
+    111099, 111100, 111101, 111102, 111103, 111104, 111105, 111106, 111107, 
+    111108, 111109, 111110, 111111, 111112, 111113, 111114, 111115, 111116, 
+    111117, 111118, 111119, 111120, 111121, 111122, 111123, 111124, 111125, 
+    111126, 111127, 111128, 111129, 111130, 111131, 111132, 111133, 111134, 
+    111135, 111136, 111137, 111138, 111139, 111140, 111141, 111142, 111143, 
+    111144, 111145, 111146, 111147, 111148, 111149, 111150, 111151, 111152, 
+    111153, 111154, 111155, 111156, 111157, 111158, 111159, 111160, 111161, 
+    111162, 111163, 111164, 111165, 111166, 111167, 111168, 111169, 111170, 
+    111171, 111172, 111173, 111174, 111175, 111176, 111177, 111178, 111179, 
+    111180, 111181, 111182, 111183, 111184, 111185, 111186, 111187, 111188, 
+    111189, 111190, 111191, 111192, 111193, 111194, 111195, 111196, 111197, 
+    111198, 111199, 111200, 111201, 111202, 111203, 111204, 111205, 111206, 
+    111207, 111208, 111209, 111210, 111211, 111212, 111213, 111214, 111215, 
+    111216, 111217, 111218, 111219, 111220, 111221, 111222, 111223, 111224, 
+    111225, 111226, 111227, 111228, 111229, 111230, 111231, 111232, 111233, 
+    111234, 111235, 111236, 111237, 111238, 111239, 111240, 111241, 111242, 
+    111243, 111244, 111245, 111246, 111247, 111248, 111249, 111250, 111251, 
+    111252, 111253, 111254, 111255, 111256, 111257, 111258, 111259, 111260, 
+    111261, 111262, 111263, 111264, 111265, 111266, 111267, 111268, 111269, 
+    111270, 111271, 111272, 111273, 111274, 111275, 111276, 111277, 111278, 
+    111279, 111280, 111281, 111282, 111283, 111284, 111285, 111286, 111287, 
+    111288, 111289, 111290, 111291, 111292, 111293, 111294, 111295, 111296, 
+    111297, 111298, 111299, 111300, 111301, 111302, 111303, 111304, 111305, 
+    111306, 111307, 111308, 111309, 111310, 111311, 111312, 111313, 111314, 
+    111315, 111316, 111317, 111318, 111319, 111320, 111321, 111322, 111323, 
+    111324, 111325, 111326, 111327, 111328, 111329, 111330, 111331, 111332, 
+    111333, 111334, 111335, 111336, 111337, 111338, 111339, 111340, 111341, 
+    111342, 111343, 111344, 111345, 111346, 111347, 111348, 111349, 111350, 
+    111351, 111352, 111353, 111354, 111355, 111356, 111357, 111358, 111359, 
+    111360, 111361, 111362, 111363, 111364, 111365, 111366, 111367, 111368, 
+    111369, 111370, 111371, 111372, 111373, 111374, 111375, 111376, 111377, 
+    111378, 111379, 111380, 111381, 111382, 111383, 111384, 111385, 111386, 
+    111387, 111388, 111389, 111390, 111391, 111392, 111393, 111394, 111395, 
+    111396, 111397, 111398, 111399, 111400, 111401, 111402, 111403, 111404, 
+    111405, 111406, 111407, 111408, 111409, 111410, 111411, 111412, 111413, 
+    111414, 111415, 111416, 111417, 111418, 111419, 111420, 111421, 111422, 
+    111423, 111424, 111425, 111426, 111427, 111428, 111429, 111430, 111431, 
+    111432, 111433, 111434, 111435, 111436, 111437, 111438, 111439, 111440, 
+    111441, 111442, 111443, 111444, 111445, 111446, 111447, 111448, 111449, 
+    111450, 111451, 111452, 111453, 111454, 111455, 111456, 111457, 111458, 
+    111459, 111460, 111461, 111462, 111463, 111464, 111465, 111466, 111467, 
+    111468, 111469, 111470, 111471, 111472, 111473, 111474, 111475, 111476, 
+    111477, 111478, 111479, 111480, 111481, 111482, 111483, 111484, 111485, 
+    111486, 111487, 111488, 111489, 111490, 111491, 111492, 111493, 111494, 
+    111495, 111496, 111497, 111498, 111499, 111500, 111501, 111502, 111503, 
+    111504, 111505, 111506, 111507, 111508, 111509, 111510, 111511, 111512, 
+    111513, 111514, 111515, 111516, 111517, 111518, 111519, 111520, 111521, 
+    111522, 111523, 111524, 111525, 111526, 111527, 111528, 111529, 111530, 
+    111531, 111532, 111533, 111534, 111535, 111536, 111537, 111538, 111539, 
+    111540, 111541, 111542, 111543, 111544, 111545, 111546, 111547, 111548, 
+    111549, 111550, 111551, 111552, 111553, 111554, 111555, 111556, 111557, 
+    111558, 111559, 111560, 111561, 111562, 111563, 111564, 111565, 111566, 
+    111567, 111568, 111569, 111570, 111571, 111572, 111573, 111574, 111575, 
+    111576, 111577, 111578, 111579, 111580, 111581, 111582, 111583, 111584, 
+    111585, 111586, 111587, 111588, 111589, 111590, 111591, 111592, 111593, 
+    111594, 111595, 111596, 111597, 111598, 111599, 111600, 111601, 111602, 
+    111603, 111604, 111605, 111606, 111607, 111608, 111609, 111610, 111611, 
+    111612, 111613, 111614, 111615, 111616, 111617, 111618, 111619, 111620, 
+    111621, 111622, 111623, 111624, 111625, 111626, 111627, 111628, 111629, 
+    111630, 111631, 111632, 111633, 111634, 111635, 111636, 111637, 111638, 
+    111639, 111640, 111641, 111642, 111643, 111644, 111645, 111646, 111647, 
+    111648, 111649, 111650, 111651, 111652, 111653, 111654, 111655, 111656, 
+    111657, 111658, 111659, 111660, 111661, 111662, 111663, 111664, 111665, 
+    111666, 111667, 111668, 111669, 111670, 111671, 111672, 111673, 111674, 
+    111675, 111676, 111677, 111678, 111679, 111680, 111681, 111682, 111683, 
+    111684, 111685, 111686, 111687, 111688, 111689, 111690, 111691, 111692, 
+    111693, 111694, 111695, 111696, 111697, 111698, 111699, 111700, 111701, 
+    111702, 111703, 111704, 111705, 111706, 111707, 111708, 111709, 111710, 
+    111711, 111712, 111713, 111714, 111715, 111716, 111717, 111718, 111719, 
+    111720, 111721, 111722, 111723, 111724, 111725, 111726, 111727, 111728, 
+    111729, 111730, 111731, 111732, 111733, 111734, 111735, 111736, 111737, 
+    111738, 111739, 111740, 111741, 111742, 111743, 111744, 111745, 111746, 
+    111747, 111748, 111749, 111750, 111751, 111752, 111753, 111754, 111755, 
+    111756, 111757, 111758, 111759, 111760, 111761, 111762, 111763, 111764, 
+    111765, 111766, 111767, 111768, 111769, 111770, 111771, 111772, 111773, 
+    111774, 111775, 111776, 111777, 111778, 111779, 111780, 111781, 111782, 
+    111783, 111784, 111785, 111786, 111787, 111788, 111789, 111790, 111791, 
+    111792, 111793, 111794, 111795, 111796, 111797, 111798, 111799, 111800, 
+    111801, 111802, 111803, 111804, 111805, 111806, 111807, 111808, 111809, 
+    111810, 111811, 111812, 111813, 111814, 111815, 111816, 111817, 111818, 
+    111819, 111820, 111821, 111822, 111823, 111824, 111825, 111826, 111827, 
+    111828, 111829, 111830, 111831, 111832, 111833, 111834, 111835, 111836, 
+    111837, 111838, 111839, 111840, 111841, 111842, 111843, 111844, 111845, 
+    111846, 111847, 111848, 111849, 111850, 111851, 111852, 111853, 111854, 
+    111855, 111856, 111857, 111858, 111859, 111860, 111861, 111862, 111863, 
+    111864, 111865, 111866, 111867, 111868, 111869, 111870, 111871, 111872, 
+    111873, 111874, 111875, 111876, 111877, 111878, 111879, 111880, 111881, 
+    111882, 111883, 111884, 111885, 111886, 111887, 111888, 111889, 111890, 
+    111891, 111892, 111893, 111894, 111895, 111896, 111897, 111898, 111899, 
+    111900, 111901, 111902, 111903, 111904, 111905, 111906, 111907, 111908, 
+    111909, 111910, 111911, 111912, 111913, 111914, 111915, 111916, 111917, 
+    111918, 111919, 111920, 111921, 111922, 111923, 111924, 111925, 111926, 
+    111927, 111928, 111929, 111930, 111931, 111932, 111933, 111934, 111935, 
+    111936, 111937, 111938, 111939, 111940, 111941, 111942, 111943, 111944, 
+    111945, 111946, 111947, 111948, 111949, 111950, 111951, 111952, 111953, 
+    111954, 111955, 111956, 111957, 111958, 111959, 111960, 111961, 111962, 
+    111963, 111964, 111965, 111966, 111967, 111968, 111969, 111970, 111971, 
+    111972, 111973, 111974, 111975, 111976, 111977, 111978, 111979, 111980, 
+    111981, 111982, 111983, 111984, 111985, 111986, 111987, 111988, 111989, 
+    111990, 111991, 111992, 111993, 111994, 111995, 111996, 111997, 111998, 
+    111999, 112000, 112001, 112002, 112003, 112004, 112005, 112006, 112007, 
+    112008, 112009, 112010, 112011, 112012, 112013, 112014, 112015, 112016, 
+    112017, 112018, 112019, 112020, 112021, 112022, 112023, 112024, 112025, 
+    112026, 112027, 112028, 112029, 112030, 112031, 112032, 112033, 112034, 
+    112035, 112036, 112037, 112038, 112039, 112040, 112041, 112042, 112043, 
+    112044, 112045, 112046, 112047, 112048, 112049, 112050, 112051, 112052, 
+    112053, 112054, 112055, 112056, 112057, 112058, 112059, 112060, 112061, 
+    112062, 112063, 112064, 112065, 112066, 112067, 112068, 112069, 112070, 
+    112071, 112072, 112073, 112074, 112075, 112076, 112077, 112078, 112079, 
+    112080, 112081, 112082, 112083, 112084, 112085, 112086, 112087, 112088, 
+    112089, 112090, 112091, 112092, 112093, 112094, 112095, 112096, 112097, 
+    112098, 112099, 112100, 112101, 112102, 112103, 112104, 112105, 112106, 
+    112107, 112108, 112109, 112110, 112111, 112112, 112113, 112114, 112115, 
+    112116, 112117, 112118, 112119, 112120, 112121, 112122, 112123, 112124, 
+    112125, 112126, 112127, 112128, 112129, 112130, 112131, 112132, 112133, 
+    112134, 112135, 112136, 112137, 112138, 112139, 112140, 112141, 112142, 
+    112143, 112144, 112145, 112146, 112147, 112148, 112149, 112150, 112151, 
+    112152, 112153, 112154, 112155, 112156, 112157, 112158, 112159, 112160, 
+    112161, 112162, 112163, 112164, 112165, 112166, 112167, 112168, 112169, 
+    112170, 112171, 112172, 112173, 112174, 112175, 112176, 112177, 112178, 
+    112179, 112180, 112181, 112182, 112183, 112184, 112185, 112186, 112187, 
+    112188, 112189, 112190, 112191, 112192, 112193, 112194, 112195, 112196, 
+    112197, 112198, 112199, 112200, 112201, 112202, 112203, 112204, 112205, 
+    112206, 112207, 112208, 112209, 112210, 112211, 112212, 112213, 112214, 
+    112215, 112216, 112217, 112218, 112219, 112220, 112221, 112222, 112223, 
+    112224, 112225, 112226, 112227, 112228, 112229, 112230, 112231, 112232, 
+    112233, 112234, 112235, 112236, 112237, 112238, 112239, 112240, 112241, 
+    112242, 112243, 112244, 112245, 112246, 112247, 112248, 112249, 112250, 
+    112251, 112252, 112253, 112254, 112255, 112256, 112257, 112258, 112259, 
+    112260, 112261, 112262, 112263, 112264, 112265, 112266, 112267, 112268, 
+    112269, 112270, 112271, 112272, 112273, 112274, 112275, 112276, 112277, 
+    112278, 112279, 112280, 112281, 112282, 112283, 112284, 112285, 112286, 
+    112287, 112288, 112289, 112290, 112291, 112292, 112293, 112294, 112295, 
+    112296, 112297, 112298, 112299, 112300, 112301, 112302, 112303, 112304, 
+    112305, 112306, 112307, 112308, 112309, 112310, 112311, 112312, 112313, 
+    112314, 112315, 112316, 112317, 112318, 112319, 112320, 112321, 112322, 
+    112323, 112324, 112325, 112326, 112327, 112328, 112329, 112330, 112331, 
+    112332, 112333, 112334, 112335, 112336, 112337, 112338, 112339, 112340, 
+    112341, 112342, 112343, 112344, 112345, 112346, 112347, 112348, 112349, 
+    112350, 112351, 112352, 112353, 112354, 112355, 112356, 112357, 112358, 
+    112359, 112360, 112361, 112362, 112363, 112364, 112365, 112366, 112367, 
+    112368, 112369, 112370, 112371, 112372, 112373, 112374, 112375, 112376, 
+    112377, 112378, 112379, 112380, 112381, 112382, 112383, 112384, 112385, 
+    112386, 112387, 112388, 112389, 112390, 112391, 112392, 112393, 112394, 
+    112395, 112396, 112397, 112398, 112399, 112400, 112401, 112402, 112403, 
+    112404, 112405, 112406, 112407, 112408, 112409, 112410, 112411, 112412, 
+    112413, 112414, 112415, 112416, 112417, 112418, 112419, 112420, 112421, 
+    112422, 112423, 112424, 112425, 112426, 112427, 112428, 112429, 112430, 
+    112431, 112432, 112433, 112434, 112435, 112436, 112437, 112438, 112439, 
+    112440, 112441, 112442, 112443, 112444, 112445, 112446, 112447, 112448, 
+    112449, 112450, 112451, 112452, 112453, 112454, 112455, 112456, 112457, 
+    112458, 112459, 112460, 112461, 112462, 112463, 112464, 112465, 112466, 
+    112467, 112468, 112469, 112470, 112471, 112472, 112473, 112474, 112475, 
+    112476, 112477, 112478, 112479, 112480, 112481, 112482, 112483, 112484, 
+    112485, 112486, 112487, 112488, 112489, 112490, 112491, 112492, 112493, 
+    112494, 112495, 112496, 112497, 112498, 112499, 112500, 112501, 112502, 
+    112503, 112504, 112505, 112506, 112507, 112508, 112509, 112510, 112511, 
+    112512, 112513, 112514, 112515, 112516, 112517, 112518, 112519, 112520, 
+    112521, 112522, 112523, 112524, 112525, 112526, 112527, 112528, 112529, 
+    112530, 112531, 112532, 112533, 112534, 112535, 112536, 112537, 112538, 
+    112539, 112540, 112541, 112542, 112543, 112544, 112545, 112546, 112547, 
+    112548, 112549, 112550, 112551, 112552, 112553, 112554, 112555, 112556, 
+    112557, 112558, 112559, 112560, 112561, 112562, 112563, 112564, 112565, 
+    112566, 112567, 112568, 112569, 112570, 112571, 112572, 112573, 112574, 
+    112575, 112576, 112577, 112578, 112579, 112580, 112581, 112582, 112583, 
+    112584, 112585, 112586, 112587, 112588, 112589, 112590, 112591, 112592, 
+    112593, 112594, 112595, 112596, 112597, 112598, 112599, 112600, 112601, 
+    112602, 112603, 112604, 112605, 112606, 112607, 112608, 112609, 112610, 
+    112611, 112612, 112613, 112614, 112615, 112616, 112617, 112618, 112619, 
+    112620, 112621, 112622, 112623, 112624, 112625, 112626, 112627, 112628, 
+    112629, 112630, 112631, 112632, 112633, 112634, 112635, 112636, 112637, 
+    112638, 112639, 112640, 112641, 112642, 112643, 112644, 112645, 112646, 
+    112647, 112648, 112649, 112650, 112651, 112652, 112653, 112654, 112655, 
+    112656, 112657, 112658, 112659, 112660, 112661, 112662, 112663, 112664, 
+    112665, 112666, 112667, 112668, 112669, 112670, 112671, 112672, 112673, 
+    112674, 112675, 112676, 112677, 112678, 112679, 112680, 112681, 112682, 
+    112683, 112684, 112685, 112686, 112687, 112688, 112689, 112690, 112691, 
+    112692, 112693, 112694, 112695, 112696, 112697, 112698, 112699, 112700, 
+    112701, 112702, 112703, 112704, 112705, 112706, 112707, 112708, 112709, 
+    112710, 112711, 112712, 112713, 112714, 112715, 112716, 112717, 112718, 
+    112719, 112720, 112721, 112722, 112723, 112724, 112725, 112726, 112727, 
+    112728, 112729, 112730, 112731, 112732, 112733, 112734, 112735, 112736, 
+    112737, 112738, 112739, 112740, 112741, 112742, 112743, 112744, 112745, 
+    112746, 112747, 112748, 112749, 112750, 112751, 112752, 112753, 112754, 
+    112755, 112756, 112757, 112758, 112759, 112760, 112761, 112762, 112763, 
+    112764, 112765, 112766, 112767, 112768, 112769, 112770, 112771, 112772, 
+    112773, 112774, 112775, 112776, 112777, 112778, 112779, 112780, 112781, 
+    112782, 112783, 112784, 112785, 112786, 112787, 112788, 112789, 112790, 
+    112791, 112792, 112793, 112794, 112795, 112796, 112797, 112798, 112799, 
+    112800, 112801, 112802, 112803, 112804, 112805, 112806, 112807, 112808, 
+    112809, 112810, 112811, 112812, 112813, 112814, 112815, 112816, 112817, 
+    112818, 112819, 112820, 112821, 112822, 112823, 112824, 112825, 112826, 
+    112827, 112828, 112829, 112830, 112831, 112832, 112833, 112834, 112835, 
+    112836, 112837, 112838, 112839, 112840, 112841, 112842, 112843, 112844, 
+    112845, 112846, 112847, 112848, 112849, 112850, 112851, 112852, 112853, 
+    112854, 112855, 112856, 112857, 112858, 112859, 112860, 112861, 112862, 
+    112863, 112864, 112865, 112866, 112867, 112868, 112869, 112870, 112871, 
+    112872, 112873, 112874, 112875, 112876, 112877, 112878, 112879, 112880, 
+    112881, 112882, 112883, 112884, 112885, 112886, 112887, 112888, 112889, 
+    112890, 112891, 112892, 112893, 112894, 112895, 112896, 112897, 112898, 
+    112899, 112900, 112901, 112902, 112903, 112904, 112905, 112906, 112907, 
+    112908, 112909, 112910, 112911, 112912, 112913, 112914, 112915, 112916, 
+    112917, 112918, 112919, 112920, 112921, 112922, 112923, 112924, 112925, 
+    112926, 112927, 112928, 112929, 112930, 112931, 112932, 112933, 112934, 
+    112935, 112936, 112937, 112938, 112939, 112940, 112941, 112942, 112943, 
+    112944, 112945, 112946, 112947, 112948, 112949, 112950, 112951, 112952, 
+    112953, 112954, 112955, 112956, 112957, 112958, 112959, 112960, 112961, 
+    112962, 112963, 112964, 112965, 112966, 112967, 112968, 112969, 112970, 
+    112971, 112972, 112973, 112974, 112975, 112976, 112977, 112978, 112979, 
+    112980, 112981, 112982, 112983, 112984, 112985, 112986, 112987, 112988, 
+    112989, 112990, 112991, 112992, 112993, 112994, 112995, 112996, 112997, 
+    112998, 112999, 113000, 113001, 113002, 113003, 113004, 113005, 113006, 
+    113007, 113008, 113009, 113010, 113011, 113012, 113013, 113014, 113015, 
+    113016, 113017, 113018, 113019, 113020, 113021, 113022, 113023, 113024, 
+    113025, 113026, 113027, 113028, 113029, 113030, 113031, 113032, 113033, 
+    113034, 113035, 113036, 113037, 113038, 113039, 113040, 113041, 113042, 
+    113043, 113044, 113045, 113046, 113047, 113048, 113049, 113050, 113051, 
+    113052, 113053, 113054, 113055, 113056, 113057, 113058, 113059, 113060, 
+    113061, 113062, 113063, 113064, 113065, 113066, 113067, 113068, 113069, 
+    113070, 113071, 113072, 113073, 113074, 113075, 113076, 113077, 113078, 
+    113079, 113080, 113081, 113082, 113083, 113084, 113085, 113086, 113087, 
+    113088, 113089, 113090, 113091, 113092, 113093, 113094, 113095, 113096, 
+    113097, 113098, 113099, 113100, 113101, 113102, 113103, 113104, 113105, 
+    113106, 113107, 113108, 113109, 113110, 113111, 113112, 113113, 113114, 
+    113115, 113116, 113117, 113118, 113119, 113120, 113121, 113122, 113123, 
+    113124, 113125, 113126, 113127, 113128, 113129, 113130, 113131, 113132, 
+    113133, 113134, 113135, 113136, 113137, 113138, 113139, 113140, 113141, 
+    113142, 113143, 113144, 113145, 113146, 113147, 113148, 113149, 113150, 
+    113151, 113152, 113153, 113154, 113155, 113156, 113157, 113158, 113159, 
+    113160, 113161, 113162, 113163, 113164, 113165, 113166, 113167, 113168, 
+    113169, 113170, 113171, 113172, 113173, 113174, 113175, 113176, 113177, 
+    113178, 113179, 113180, 113181, 113182, 113183, 113184, 113185, 113186, 
+    113187, 113188, 113189, 113190, 113191, 113192, 113193, 113194, 113195, 
+    113196, 113197, 113198, 113199, 113200, 113201, 113202, 113203, 113204, 
+    113205, 113206, 113207, 113208, 113209, 113210, 113211, 113212, 113213, 
+    113214, 113215, 113216, 113217, 113218, 113219, 113220, 113221, 113222, 
+    113223, 113224, 113225, 113226, 113227, 113228, 113229, 113230, 113231, 
+    113232, 113233, 113234, 113235, 113236, 113237, 113238, 113239, 113240, 
+    113241, 113242, 113243, 113244, 113245, 113246, 113247, 113248, 113249, 
+    113250, 113251, 113252, 113253, 113254, 113255, 113256, 113257, 113258, 
+    113259, 113260, 113261, 113262, 113263, 113264, 113265, 113266, 113267, 
+    113268, 113269, 113270, 113271, 113272, 113273, 113274, 113275, 113276, 
+    113277, 113278, 113279, 113280, 113281, 113282, 113283, 113284, 113285, 
+    113286, 113287, 113288, 113289, 113290, 113291, 113292, 113293, 113294, 
+    113295, 113296, 113297, 113298, 113299, 113300, 113301, 113302, 113303, 
+    113304, 113305, 113306, 113307, 113308, 113309, 113310, 113311, 113312, 
+    113313, 113314, 113315, 113316, 113317, 113318, 113319, 113320, 113321, 
+    113322, 113323, 113324, 113325, 113326, 113327, 113328, 113329, 113330, 
+    113331, 113332, 113333, 113334, 113335, 113336, 113337, 113338, 113339, 
+    113340, 113341, 113342, 113343, 113344, 113345, 113346, 113347, 113348, 
+    113349, 113350, 113351, 113352, 113353, 113354, 113355, 113356, 113357, 
+    113358, 113359, 113360, 113361, 113362, 113363, 113364, 113365, 113366, 
+    113367, 113368, 113369, 113370, 113371, 113372, 113373, 113374, 113375, 
+    113376, 113377, 113378, 113379, 113380, 113381, 113382, 113383, 113384, 
+    113385, 113386, 113387, 113388, 113389, 113390, 113391, 113392, 113393, 
+    113394, 113395, 113396, 113397, 113398, 113399, 113400, 113401, 113402, 
+    113403, 113404, 113405, 113406, 113407, 113408, 113409, 113410, 113411, 
+    113412, 113413, 113414, 113415, 113416, 113417, 113418, 113419, 113420, 
+    113421, 113422, 113423, 113424, 113425, 113426, 113427, 113428, 113429, 
+    113430, 113431, 113432, 113433, 113434, 113435, 113436, 113437, 113438, 
+    113439, 113440, 113441, 113442, 113443, 113444, 113445, 113446, 113447, 
+    113448, 113449, 113450, 113451, 113452, 113453, 113454, 113455, 113456, 
+    113457, 113458, 113459, 113460, 113461, 113462, 113463, 113464, 113465, 
+    113466, 113467, 113468, 113469, 113470, 113471, 113472, 113473, 113474, 
+    113475, 113476, 113477, 113478, 113479, 113480, 113481, 113482, 113483, 
+    113484, 113485, 113486, 113487, 113488, 113489, 113490, 113491, 113492, 
+    113493, 113494, 113495, 113496, 113497, 113498, 113499, 113500, 113501, 
+    113502, 113503, 113504, 113505, 113506, 113507, 113508, 113509, 113510, 
+    113511, 113512, 113513, 113514, 113515, 113516, 113517, 113518, 113519, 
+    113520, 113521, 113522, 113523, 113524, 113525, 113526, 113527, 113528, 
+    113529, 113530, 113531, 113532, 113533, 113534, 113535, 113536, 113537, 
+    113538, 113539, 113540, 113541, 113542, 113543, 113544, 113545, 113546, 
+    113547, 113548, 113549, 113550, 113551, 113552, 113553, 113554, 113555, 
+    113556, 113557, 113558, 113559, 113560, 113561, 113562, 113563, 113564, 
+    113565, 113566, 113567, 113568, 113569, 113570, 113571, 113572, 113573, 
+    113574, 113575, 113576, 113577, 113578, 113579, 113580, 113581, 113582, 
+    113583, 113584, 113585, 113586, 113587, 113588, 113589, 113590, 113591, 
+    113592, 113593, 113594, 113595, 113596, 113597, 113598, 113599, 113600, 
+    113601, 113602, 113603, 113604, 113605, 113606, 113607, 113608, 113609, 
+    113610, 113611, 113612, 113613, 113614, 113615, 113616, 113617, 113618, 
+    113619, 113620, 113621, 113622, 113623, 113624, 113625, 113626, 113627, 
+    113628, 113629, 113630, 113631, 113632, 113633, 113634, 113635, 113636, 
+    113637, 113638, 113639, 113640, 113641, 113642, 113643, 113644, 113645, 
+    113646, 113647, 113648, 113649, 113650, 113651, 113652, 113653, 113654, 
+    113655, 113656, 113657, 113658, 113659, 113660, 113661, 113662, 113663, 
+    113664, 113665, 113666, 113667, 113668, 113669, 113670, 113671, 113672, 
+    113673, 113674, 113675, 113676, 113677, 113678, 113679, 113680, 113681, 
+    113682, 113683, 113684, 113685, 113686, 113687, 113688, 113689, 113690, 
+    113691, 113692, 113693, 113694, 113695, 113696, 113697, 113698, 113699, 
+    113700, 113701, 113702, 113703, 113704, 113705, 113706, 113707, 113708, 
+    113709, 113710, 113711, 113712, 113713, 113714, 113715, 113716, 113717, 
+    113718, 113719, 113720, 113721, 113722, 113723, 113724, 113725, 113726, 
+    113727, 113728, 113729, 113730, 113731, 113732, 113733, 113734, 113735, 
+    113736, 113737, 113738, 113739, 113740, 113741, 113742, 113743, 113744, 
+    113745, 113746, 113747, 113748, 113749, 113750, 113751, 113752, 113753, 
+    113754, 113755, 113756, 113757, 113758, 113759, 113760, 113761, 113762, 
+    113763, 113764, 113765, 113766, 113767, 113768, 113769, 113770, 113771, 
+    113772, 113773, 113774, 113775, 113776, 113777, 113778, 113779, 113780, 
+    113781, 113782, 113783, 113784, 113785, 113786, 113787, 113788, 113789, 
+    113790, 113791, 113792, 113793, 113794, 113795, 113796, 113797, 113798, 
+    113799, 113800, 113801, 113802, 113803, 113804, 113805, 113806, 113807, 
+    113808, 113809, 113810, 113811, 113812, 113813, 113814, 113815, 113816, 
+    113817, 113818, 113819, 113820, 113821, 113822, 113823, 113824, 113825, 
+    113826, 113827, 113828, 113829, 113830, 113831, 113832, 113833, 113834, 
+    113835, 113836, 113837, 113838, 113839, 113840, 113841, 113842, 113843, 
+    113844, 113845, 113846, 113847, 113848, 113849, 113850, 113851, 113852, 
+    113853, 113854, 113855, 113856, 113857, 113858, 113859, 113860, 113861, 
+    113862, 113863, 113864, 113865, 113866, 113867, 113868, 113869, 113870, 
+    113871, 113872, 113873, 113874, 113875, 113876, 113877, 113878, 113879, 
+    113880, 113881, 113882, 113883, 113884, 113885, 113886, 113887, 113888, 
+    113889, 113890, 113891, 113892, 113893, 113894, 113895, 113896, 113897, 
+    113898, 113899, 113900, 113901, 113902, 113903, 113904, 113905, 113906, 
+    113907, 113908, 113909, 113910, 113911, 113912, 113913, 113914, 113915, 
+    113916, 113917, 113918, 113919, 113920, 113921, 113922, 113923, 113924, 
+    113925, 113926, 113927, 113928, 113929, 113930, 113931, 113932, 113933, 
+    113934, 113935, 113936, 113937, 113938, 113939, 113940, 113941, 113942, 
+    113943, 113944, 113945, 113946, 113947, 113948, 113949, 113950, 113951, 
+    113952, 113953, 113954, 113955, 113956, 113957, 113958, 113959, 113960, 
+    113961, 113962, 113963, 113964, 113965, 113966, 113967, 113968, 113969, 
+    113970, 113971, 113972, 113973, 113974, 113975, 113976, 113977, 113978, 
+    113979, 113980, 113981, 113982, 113983, 113984, 113985, 113986, 113987, 
+    113988, 113989, 113990, 113991, 113992, 113993, 113994, 113995, 113996, 
+    113997, 113998, 113999, 114000, 114001, 114002, 114003, 114004, 114005, 
+    114006, 114007, 114008, 114009, 114010, 114011, 114012, 114013, 114014, 
+    114015, 114016, 114017, 114018, 114019, 114020, 114021, 114022, 114023, 
+    114024, 114025, 114026, 114027, 114028, 114029, 114030, 114031, 114032, 
+    114033, 114034, 114035, 114036, 114037, 114038, 114039, 114040, 114041, 
+    114042, 114043, 114044, 114045, 114046, 114047, 114048, 114049, 114050, 
+    114051, 114052, 114053, 114054, 114055, 114056, 114057, 114058, 114059, 
+    114060, 114061, 114062, 114063, 114064, 114065, 114066, 114067, 114068, 
+    114069, 114070, 114071, 114072, 114073, 114074, 114075, 114076, 114077, 
+    114078, 114079, 114080, 114081, 114082, 114083, 114084, 114085, 114086, 
+    114087, 114088, 114089, 114090, 114091, 114092, 114093, 114094, 114095, 
+    114096, 114097, 114098, 114099, 114100, 114101, 114102, 114103, 114104, 
+    114105, 114106, 114107, 114108, 114109, 114110, 114111, 114112, 114113, 
+    114114, 114115, 114116, 114117, 114118, 114119, 114120, 114121, 114122, 
+    114123, 114124, 114125, 114126, 114127, 114128, 114129, 114130, 114131, 
+    114132, 114133, 114134, 114135, 114136, 114137, 114138, 114139, 114140, 
+    114141, 114142, 114143, 114144, 114145, 114146, 114147, 114148, 114149, 
+    114150, 114151, 114152, 114153, 114154, 114155, 114156, 114157, 114158, 
+    114159, 114160, 114161, 114162, 114163, 114164, 114165, 114166, 114167, 
+    114168, 114169, 114170, 114171, 114172, 114173, 114174, 114175, 114176, 
+    114177, 114178, 114179, 114180, 114181, 114182, 114183, 114184, 114185, 
+    114186, 114187, 114188, 114189, 114190, 114191, 114192, 114193, 114194, 
+    114195, 114196, 114197, 114198, 114199, 114200, 114201, 114202, 114203, 
+    114204, 114205, 114206, 114207, 114208, 114209, 114210, 114211, 114212, 
+    114213, 114214, 114215, 114216, 114217, 114218, 114219, 114220, 114221, 
+    114222, 114223, 114224, 114225, 114226, 114227, 114228, 114229, 114230, 
+    114231, 114232, 114233, 114234, 114235, 114236, 114237, 114238, 114239, 
+    114240, 114241, 114242, 114243, 114244, 114245, 114246, 114247, 114248, 
+    114249, 114250, 114251, 114252, 114253, 114254, 114255, 114256, 114257, 
+    114258, 114259, 114260, 114261, 114262, 114263, 114264, 114265, 114266, 
+    114267, 114268, 114269, 114270, 114271, 114272, 114273, 114274, 114275, 
+    114276, 114277, 114278, 114279, 114280, 114281, 114282, 114283, 114284, 
+    114285, 114286, 114287, 114288, 114289, 114290, 114291, 114292, 114293, 
+    114294, 114295, 114296, 114297, 114298, 114299, 114300, 114301, 114302, 
+    114303, 114304, 114305, 114306, 114307, 114308, 114309, 114310, 114311, 
+    114312, 114313, 114314, 114315, 114316, 114317, 114318, 114319, 114320, 
+    114321, 114322, 114323, 114324, 114325, 114326, 114327, 114328, 114329, 
+    114330, 114331, 114332, 114333, 114334, 114335, 114336, 114337, 114338, 
+    114339, 114340, 114341, 114342, 114343, 114344, 114345, 114346, 114347, 
+    114348, 114349, 114350, 114351, 114352, 114353, 114354, 114355, 114356, 
+    114357, 114358, 114359, 114360, 114361, 114362, 114363, 114364, 114365, 
+    114366, 114367, 114368, 114369, 114370, 114371, 114372, 114373, 114374, 
+    114375, 114376, 114377, 114378, 114379, 114380, 114381, 114382, 114383, 
+    114384, 114385, 114386, 114387, 114388, 114389, 114390, 114391, 114392, 
+    114393, 114394, 114395, 114396, 114397, 114398, 114399, 114400, 114401, 
+    114402, 114403, 114404, 114405, 114406, 114407, 114408, 114409, 114410, 
+    114411, 114412, 114413, 114414, 114415, 114416, 114417, 114418, 114419, 
+    114420, 114421, 114422, 114423, 114424, 114425, 114426, 114427, 114428, 
+    114429, 114430, 114431, 114432, 114433, 114434, 114435, 114436, 114437, 
+    114438, 114439, 114440, 114441, 114442, 114443, 114444, 114445, 114446, 
+    114447, 114448, 114449, 114450, 114451, 114452, 114453, 114454, 114455, 
+    114456, 114457, 114458, 114459, 114460, 114461, 114462, 114463, 114464, 
+    114465, 114466, 114467, 114468, 114469, 114470, 114471, 114472, 114473, 
+    114474, 114475, 114476, 114477, 114478, 114479, 114480, 114481, 114482, 
+    114483, 114484, 114485, 114486, 114487, 114488, 114489, 114490, 114491, 
+    114492, 114493, 114494, 114495, 114496, 114497, 114498, 114499, 114500, 
+    114501, 114502, 114503, 114504, 114505, 114506, 114507, 114508, 114509, 
+    114510, 114511, 114512, 114513, 114514, 114515, 114516, 114517, 114518, 
+    114519, 114520, 114521, 114522, 114523, 114524, 114525, 114526, 114527, 
+    114528, 114529, 114530, 114531, 114532, 114533, 114534, 114535, 114536, 
+    114537, 114538, 114539, 114540, 114541, 114542, 114543, 114544, 114545, 
+    114546, 114547, 114548, 114549, 114550, 114551, 114552, 114553, 114554, 
+    114555, 114556, 114557, 114558, 114559, 114560, 114561, 114562, 114563, 
+    114564, 114565, 114566, 114567, 114568, 114569, 114570, 114571, 114572, 
+    114573, 114574, 114575, 114576, 114577, 114578, 114579, 114580, 114581, 
+    114582, 114583, 114584, 114585, 114586, 114587, 114588, 114589, 114590, 
+    114591, 114592, 114593, 114594, 114595, 114596, 114597, 114598, 114599, 
+    114600, 114601, 114602, 114603, 114604, 114605, 114606, 114607, 114608, 
+    114609, 114610, 114611, 114612, 114613, 114614, 114615, 114616, 114617, 
+    114618, 114619, 114620, 114621, 114622, 114623, 114624, 114625, 114626, 
+    114627, 114628, 114629, 114630, 114631, 114632, 114633, 114634, 114635, 
+    114636, 114637, 114638, 114639, 114640, 114641, 114642, 114643, 114644, 
+    114645, 114646, 114647, 114648, 114649, 114650, 114651, 114652, 114653, 
+    114654, 114655, 114656, 114657, 114658, 114659, 114660, 114661, 114662, 
+    114663, 114664, 114665, 114666, 114667, 114668, 114669, 114670, 114671, 
+    114672, 114673, 114674, 114675, 114676, 114677, 114678, 114679, 114680, 
+    114681, 114682, 114683, 114684, 114685, 114686, 114687, 114688, 114689, 
+    114690, 114691, 114692, 114693, 114694, 114695, 114696, 114697, 114698, 
+    114699, 114700, 114701, 114702, 114703, 114704, 114705, 114706, 114707, 
+    114708, 114709, 114710, 114711, 114712, 114713, 114714, 114715, 114716, 
+    114717, 114718, 114719, 114720, 114721, 114722, 114723, 114724, 114725, 
+    114726, 114727, 114728, 114729, 114730, 114731, 114732, 114733, 114734, 
+    114735, 114736, 114737, 114738, 114739, 114740, 114741, 114742, 114743, 
+    114744, 114745, 114746, 114747, 114748, 114749, 114750, 114751, 114752, 
+    114753, 114754, 114755, 114756, 114757, 114758, 114759, 114760, 114761, 
+    114762, 114763, 114764, 114765, 114766, 114767, 114768, 114769, 114770, 
+    114771, 114772, 114773, 114774, 114775, 114776, 114777, 114778, 114779, 
+    114780, 114781, 114782, 114783, 114784, 114785, 114786, 114787, 114788, 
+    114789, 114790, 114791, 114792, 114793, 114794, 114795, 114796, 114797, 
+    114798, 114799, 114800, 114801, 114802, 114803, 114804, 114805, 114806, 
+    114807, 114808, 114809, 114810, 114811, 114812, 114813, 114814, 114815, 
+    114816, 114817, 114818, 114819, 114820, 114821, 114822, 114823, 114824, 
+    114825, 114826, 114827, 114828, 114829, 114830, 114831, 114832, 114833, 
+    114834, 114835, 114836, 114837, 114838, 114839, 114840, 114841, 114842, 
+    114843, 114844, 114845, 114846, 114847, 114848, 114849, 114850, 114851, 
+    114852, 114853, 114854, 114855, 114856, 114857, 114858, 114859, 114860, 
+    114861, 114862, 114863, 114864, 114865, 114866, 114867, 114868, 114869, 
+    114870, 114871, 114872, 114873, 114874, 114875, 114876, 114877, 114878, 
+    114879, 114880, 114881, 114882, 114883, 114884, 114885, 114886, 114887, 
+    114888, 114889, 114890, 114891, 114892, 114893, 114894, 114895, 114896, 
+    114897, 114898, 114899, 114900, 114901, 114902, 114903, 114904, 114905, 
+    114906, 114907, 114908, 114909, 114910, 114911, 114912, 114913, 114914, 
+    114915, 114916, 114917, 114918, 114919, 114920, 114921, 114922, 114923, 
+    114924, 114925, 114926, 114927, 114928, 114929, 114930, 114931, 114932, 
+    114933, 114934, 114935, 114936, 114937, 114938, 114939, 114940, 114941, 
+    114942, 114943, 114944, 114945, 114946, 114947, 114948, 114949, 114950, 
+    114951, 114952, 114953, 114954, 114955, 114956, 114957, 114958, 114959, 
+    114960, 114961, 114962, 114963, 114964, 114965, 114966, 114967, 114968, 
+    114969, 114970, 114971, 114972, 114973, 114974, 114975, 114976, 114977, 
+    114978, 114979, 114980, 114981, 114982, 114983, 114984, 114985, 114986, 
+    114987, 114988, 114989, 114990, 114991, 114992, 114993, 114994, 114995, 
+    114996, 114997, 114998, 114999, 115000, 115001, 115002, 115003, 115004, 
+    115005, 115006, 115007, 115008, 115009, 115010, 115011, 115012, 115013, 
+    115014, 115015, 115016, 115017, 115018, 115019, 115020, 115021, 115022, 
+    115023, 115024, 115025, 115026, 115027, 115028, 115029, 115030, 115031, 
+    115032, 115033, 115034, 115035, 115036, 115037, 115038, 115039, 115040, 
+    115041, 115042, 115043, 115044, 115045, 115046, 115047, 115048, 115049, 
+    115050, 115051, 115052, 115053, 115054, 115055, 115056, 115057, 115058, 
+    115059, 115060, 115061, 115062, 115063, 115064, 115065, 115066, 115067, 
+    115068, 115069, 115070, 115071, 115072, 115073, 115074, 115075, 115076, 
+    115077, 115078, 115079, 115080, 115081, 115082, 115083, 115084, 115085, 
+    115086, 115087, 115088, 115089, 115090, 115091, 115092, 115093, 115094, 
+    115095, 115096, 115097, 115098, 115099, 115100, 115101, 115102, 115103, 
+    115104, 115105, 115106, 115107, 115108, 115109, 115110, 115111, 115112, 
+    115113, 115114, 115115, 115116, 115117, 115118, 115119, 115120, 115121, 
+    115122, 115123, 115124, 115125, 115126, 115127, 115128, 115129, 115130, 
+    115131, 115132, 115133, 115134, 115135, 115136, 115137, 115138, 115139, 
+    115140, 115141, 115142, 115143, 115144, 115145, 115146, 115147, 115148, 
+    115149, 115150, 115151, 115152, 115153, 115154, 115155, 115156, 115157, 
+    115158, 115159, 115160, 115161, 115162, 115163, 115164, 115165, 115166, 
+    115167, 115168, 115169, 115170, 115171, 115172, 115173, 115174, 115175, 
+    115176, 115177, 115178, 115179, 115180, 115181, 115182, 115183, 115184, 
+    115185, 115186, 115187, 115188, 115189, 115190, 115191, 115192, 115193, 
+    115194, 115195, 115196, 115197, 115198, 115199, 115200, 115201, 115202, 
+    115203, 115204, 115205, 115206, 115207, 115208, 115209, 115210, 115211, 
+    115212, 115213, 115214, 115215, 115216, 115217, 115218, 115219, 115220, 
+    115221, 115222, 115223, 115224, 115225, 115226, 115227, 115228, 115229, 
+    115230, 115231, 115232, 115233, 115234, 115235, 115236, 115237, 115238, 
+    115239, 115240, 115241, 115242, 115243, 115244, 115245, 115246, 115247, 
+    115248, 115249, 115250, 115251, 115252, 115253, 115254, 115255, 115256, 
+    115257, 115258, 115259, 115260, 115261, 115262, 115263, 115264, 115265, 
+    115266, 115267, 115268, 115269, 115270, 115271, 115272, 115273, 115274, 
+    115275, 115276, 115277, 115278, 115279, 115280, 115281, 115282, 115283, 
+    115284, 115285, 115286, 115287, 115288, 115289, 115290, 115291, 115292, 
+    115293, 115294, 115295, 115296, 115297, 115298, 115299, 115300, 115301, 
+    115302, 115303, 115304, 115305, 115306, 115307, 115308, 115309, 115310, 
+    115311, 115312, 115313, 115314, 115315, 115316, 115317, 115318, 115319, 
+    115320, 115321, 115322, 115323, 115324, 115325, 115326, 115327, 115328, 
+    115329, 115330, 115331, 115332, 115333, 115334, 115335, 115336, 115337, 
+    115338, 115339, 115340, 115341, 115342, 115343, 115344, 115345, 115346, 
+    115347, 115348, 115349, 115350, 115351, 115352, 115353, 115354, 115355, 
+    115356, 115357, 115358, 115359, 115360, 115361, 115362, 115363, 115364, 
+    115365, 115366, 115367, 115368, 115369, 115370, 115371, 115372, 115373, 
+    115374, 115375, 115376, 115377, 115378, 115379, 115380, 115381, 115382, 
+    115383, 115384, 115385, 115386, 115387, 115388, 115389, 115390, 115391, 
+    115392, 115393, 115394, 115395, 115396, 115397, 115398, 115399, 115400, 
+    115401, 115402, 115403, 115404, 115405, 115406, 115407, 115408, 115409, 
+    115410, 115411, 115412, 115413, 115414, 115415, 115416, 115417, 115418, 
+    115419, 115420, 115421, 115422, 115423, 115424, 115425, 115426, 115427, 
+    115428, 115429, 115430, 115431, 115432, 115433, 115434, 115435, 115436, 
+    115437, 115438, 115439, 115440, 115441, 115442, 115443, 115444, 115445, 
+    115446, 115447, 115448, 115449, 115450, 115451, 115452, 115453, 115454, 
+    115455, 115456, 115457, 115458, 115459, 115460, 115461, 115462, 115463, 
+    115464, 115465, 115466, 115467, 115468, 115469, 115470, 115471, 115472, 
+    115473, 115474, 115475, 115476, 115477, 115478, 115479, 115480, 115481, 
+    115482, 115483, 115484, 115485, 115486, 115487, 115488, 115489, 115490, 
+    115491, 115492, 115493, 115494, 115495, 115496, 115497, 115498, 115499, 
+    115500, 115501, 115502, 115503, 115504, 115505, 115506, 115507, 115508, 
+    115509, 115510, 115511, 115512, 115513, 115514, 115515, 115516, 115517, 
+    115518, 115519, 115520, 115521, 115522, 115523, 115524, 115525, 115526, 
+    115527, 115528, 115529, 115530, 115531, 115532, 115533, 115534, 115535, 
+    115536, 115537, 115538, 115539, 115540, 115541, 115542, 115543, 115544, 
+    115545, 115546, 115547, 115548, 115549, 115550, 115551, 115552, 115553, 
+    115554, 115555, 115556, 115557, 115558, 115559, 115560, 115561, 115562, 
+    115563, 115564, 115565, 115566, 115567, 115568, 115569, 115570, 115571, 
+    115572, 115573, 115574, 115575, 115576, 115577, 115578, 115579, 115580, 
+    115581, 115582, 115583, 115584, 115585, 115586, 115587, 115588, 115589, 
+    115590, 115591, 115592, 115593, 115594, 115595, 115596, 115597, 115598, 
+    115599, 115600, 115601, 115602, 115603, 115604, 115605, 115606, 115607, 
+    115608, 115609, 115610, 115611, 115612, 115613, 115614, 115615, 115616, 
+    115617, 115618, 115619, 115620, 115621, 115622, 115623, 115624, 115625, 
+    115626, 115627, 115628, 115629, 115630, 115631, 115632, 115633, 115634, 
+    115635, 115636, 115637, 115638, 115639, 115640, 115641, 115642, 115643, 
+    115644, 115645, 115646, 115647, 115648, 115649, 115650, 115651, 115652, 
+    115653, 115654, 115655, 115656, 115657, 115658, 115659, 115660, 115661, 
+    115662, 115663, 115664, 115665, 115666, 115667, 115668, 115669, 115670, 
+    115671, 115672, 115673, 115674, 115675, 115676, 115677, 115678, 115679, 
+    115680, 115681, 115682, 115683, 115684, 115685, 115686, 115687, 115688, 
+    115689, 115690, 115691, 115692, 115693, 115694, 115695, 115696, 115697, 
+    115698, 115699, 115700, 115701, 115702, 115703, 115704, 115705, 115706, 
+    115707, 115708, 115709, 115710, 115711, 115712, 115713, 115714, 115715, 
+    115716, 115717, 115718, 115719, 115720, 115721, 115722, 115723, 115724, 
+    115725, 115726, 115727, 115728, 115729, 115730, 115731, 115732, 115733, 
+    115734, 115735, 115736, 115737, 115738, 115739, 115740, 115741, 115742, 
+    115743, 115744, 115745, 115746, 115747, 115748, 115749, 115750, 115751, 
+    115752, 115753, 115754, 115755, 115756, 115757, 115758, 115759, 115760, 
+    115761, 115762, 115763, 115764, 115765, 115766, 115767, 115768, 115769, 
+    115770, 115771, 115772, 115773, 115774, 115775, 115776, 115777, 115778, 
+    115779, 115780, 115781, 115782, 115783, 115784, 115785, 115786, 115787, 
+    115788, 115789, 115790, 115791, 115792, 115793, 115794, 115795, 115796, 
+    115797, 115798, 115799, 115800, 115801, 115802, 115803, 115804, 115805, 
+    115806, 115807, 115808, 115809, 115810, 115811, 115812, 115813, 115814, 
+    115815, 115816, 115817, 115818, 115819, 115820, 115821, 115822, 115823, 
+    115824, 115825, 115826, 115827, 115828, 115829, 115830, 115831, 115832, 
+    115833, 115834, 115835, 115836, 115837, 115838, 115839, 115840, 115841, 
+    115842, 115843, 115844, 115845, 115846, 115847, 115848, 115849, 115850, 
+    115851, 115852, 115853, 115854, 115855, 115856, 115857, 115858, 115859, 
+    115860, 115861, 115862, 115863, 115864, 115865, 115866, 115867, 115868, 
+    115869, 115870, 115871, 115872, 115873, 115874, 115875, 115876, 115877, 
+    115878, 115879, 115880, 115881, 115882, 115883, 115884, 115885, 115886, 
+    115887, 115888, 115889, 115890, 115891, 115892, 115893, 115894, 115895, 
+    115896, 115897, 115898, 115899, 115900, 115901, 115902, 115903, 115904, 
+    115905, 115906, 115907, 115908, 115909, 115910, 115911, 115912, 115913, 
+    115914, 115915, 115916, 115917, 115918, 115919, 115920, 115921, 115922, 
+    115923, 115924, 115925, 115926, 115927, 115928, 115929, 115930, 115931, 
+    115932, 115933, 115934, 115935, 115936, 115937, 115938, 115939, 115940, 
+    115941, 115942, 115943, 115944, 115945, 115946, 115947, 115948, 115949, 
+    115950, 115951, 115952, 115953, 115954, 115955, 115956, 115957, 115958, 
+    115959, 115960, 115961, 115962, 115963, 115964, 115965, 115966, 115967, 
+    115968, 115969, 115970, 115971, 115972, 115973, 115974, 115975, 115976, 
+    115977, 115978, 115979, 115980, 115981, 115982, 115983, 115984, 115985, 
+    115986, 115987, 115988, 115989, 115990, 115991, 115992, 115993, 115994, 
+    115995, 115996, 115997, 115998, 115999, 116000, 116001, 116002, 116003, 
+    116004, 116005, 116006, 116007, 116008, 116009, 116010, 116011, 116012, 
+    116013, 116014, 116015, 116016, 116017, 116018, 116019, 116020, 116021, 
+    116022, 116023, 116024, 116025, 116026, 116027, 116028, 116029, 116030, 
+    116031, 116032, 116033, 116034, 116035, 116036, 116037, 116038, 116039, 
+    116040, 116041, 116042, 116043, 116044, 116045, 116046, 116047, 116048, 
+    116049, 116050, 116051, 116052, 116053, 116054, 116055, 116056, 116057, 
+    116058, 116059, 116060, 116061, 116062, 116063, 116064, 116065, 116066, 
+    116067, 116068, 116069, 116070, 116071, 116072, 116073, 116074, 116075, 
+    116076, 116077, 116078, 116079, 116080, 116081, 116082, 116083, 116084, 
+    116085, 116086, 116087, 116088, 116089, 116090, 116091, 116092, 116093, 
+    116094, 116095, 116096, 116097, 116098, 116099, 116100, 116101, 116102, 
+    116103, 116104, 116105, 116106, 116107, 116108, 116109, 116110, 116111, 
+    116112, 116113, 116114, 116115, 116116, 116117, 116118, 116119, 116120, 
+    116121, 116122, 116123, 116124, 116125, 116126, 116127, 116128, 116129, 
+    116130, 116131, 116132, 116133, 116134, 116135, 116136, 116137, 116138, 
+    116139, 116140, 116141, 116142, 116143, 116144, 116145, 116146, 116147, 
+    116148, 116149, 116150, 116151, 116152, 116153, 116154, 116155, 116156, 
+    116157, 116158, 116159, 116160, 116161, 116162, 116163, 116164, 116165, 
+    116166, 116167, 116168, 116169, 116170, 116171, 116172, 116173, 116174, 
+    116175, 116176, 116177, 116178, 116179, 116180, 116181, 116182, 116183, 
+    116184, 116185, 116186, 116187, 116188, 116189, 116190, 116191, 116192, 
+    116193, 116194, 116195, 116196, 116197, 116198, 116199, 116200, 116201, 
+    116202, 116203, 116204, 116205, 116206, 116207, 116208, 116209, 116210, 
+    116211, 116212, 116213, 116214, 116215, 116216, 116217, 116218, 116219, 
+    116220, 116221, 116222, 116223, 116224, 116225, 116226, 116227, 116228, 
+    116229, 116230, 116231, 116232, 116233, 116234, 116235, 116236, 116237, 
+    116238, 116239, 116240, 116241, 116242, 116243, 116244, 116245, 116246, 
+    116247, 116248, 116249, 116250, 116251, 116252, 116253, 116254, 116255, 
+    116256, 116257, 116258, 116259, 116260, 116261, 116262, 116263, 116264, 
+    116265, 116266, 116267, 116268, 116269, 116270, 116271, 116272, 116273, 
+    116274, 116275, 116276, 116277, 116278, 116279, 116280, 116281, 116282, 
+    116283, 116284, 116285, 116286, 116287, 116288, 116289, 116290, 116291, 
+    116292, 116293, 116294, 116295, 116296, 116297, 116298, 116299, 116300, 
+    116301, 116302, 116303, 116304, 116305, 116306, 116307, 116308, 116309, 
+    116310, 116311, 116312, 116313, 116314, 116315, 116316, 116317, 116318, 
+    116319, 116320, 116321, 116322, 116323, 116324, 116325, 116326, 116327, 
+    116328, 116329, 116330, 116331, 116332, 116333, 116334, 116335, 116336, 
+    116337, 116338, 116339, 116340, 116341, 116342, 116343, 116344, 116345, 
+    116346, 116347, 116348, 116349, 116350, 116351, 116352, 116353, 116354, 
+    116355, 116356, 116357, 116358, 116359, 116360, 116361, 116362, 116363, 
+    116364, 116365, 116366, 116367, 116368, 116369, 116370, 116371, 116372, 
+    116373, 116374, 116375, 116376, 116377, 116378, 116379, 116380, 116381, 
+    116382, 116383, 116384, 116385, 116386, 116387, 116388, 116389, 116390, 
+    116391, 116392, 116393, 116394, 116395, 116396, 116397, 116398, 116399, 
+    116400, 116401, 116402, 116403, 116404, 116405, 116406, 116407, 116408, 
+    116409, 116410, 116411, 116412, 116413, 116414, 116415, 116416, 116417, 
+    116418, 116419, 116420, 116421, 116422, 116423, 116424, 116425, 116426, 
+    116427, 116428, 116429, 116430, 116431, 116432, 116433, 116434, 116435, 
+    116436, 116437, 116438, 116439, 116440, 116441, 116442, 116443, 116444, 
+    116445, 116446, 116447, 116448, 116449, 116450, 116451, 116452, 116453, 
+    116454, 116455, 116456, 116457, 116458, 116459, 116460, 116461, 116462, 
+    116463, 116464, 116465, 116466, 116467, 116468, 116469, 116470, 116471, 
+    116472, 116473, 116474, 116475, 116476, 116477, 116478, 116479, 116480, 
+    116481, 116482, 116483, 116484, 116485, 116486, 116487, 116488, 116489, 
+    116490, 116491, 116492, 116493, 116494, 116495, 116496, 116497, 116498, 
+    116499, 116500, 116501, 116502, 116503, 116504, 116505, 116506, 116507, 
+    116508, 116509, 116510, 116511, 116512, 116513, 116514, 116515, 116516, 
+    116517, 116518, 116519, 116520, 116521, 116522, 116523, 116524, 116525, 
+    116526, 116527, 116528, 116529, 116530, 116531, 116532, 116533, 116534, 
+    116535, 116536, 116537, 116538, 116539, 116540, 116541, 116542, 116543, 
+    116544, 116545, 116546, 116547, 116548, 116549, 116550, 116551, 116552, 
+    116553, 116554, 116555, 116556, 116557, 116558, 116559, 116560, 116561, 
+    116562, 116563, 116564, 116565, 116566, 116567, 116568, 116569, 116570, 
+    116571, 116572, 116573, 116574, 116575, 116576, 116577, 116578, 116579, 
+    116580, 116581, 116582, 116583, 116584, 116585, 116586, 116587, 116588, 
+    116589, 116590, 116591, 116592, 116593, 116594, 116595, 116596, 116597, 
+    116598, 116599, 116600, 116601, 116602, 116603, 116604, 116605, 116606, 
+    116607, 116608, 116609, 116610, 116611, 116612, 116613, 116614, 116615, 
+    116616, 116617, 116618, 116619, 116620, 116621, 116622, 116623, 116624, 
+    116625, 116626, 116627, 116628, 116629, 116630, 116631, 116632, 116633, 
+    116634, 116635, 116636, 116637, 116638, 116639, 116640, 116641, 116642, 
+    116643, 116644, 116645, 116646, 116647, 116648, 116649, 116650, 116651, 
+    116652, 116653, 116654, 116655, 116656, 116657, 116658, 116659, 116660, 
+    116661, 116662, 116663, 116664, 116665, 116666, 116667, 116668, 116669, 
+    116670, 116671, 116672, 116673, 116674, 116675, 116676, 116677, 116678, 
+    116679, 116680, 116681, 116682, 116683, 116684, 116685, 116686, 116687, 
+    116688, 116689, 116690, 116691, 116692, 116693, 116694, 116695, 116696, 
+    116697, 116698, 116699, 116700, 116701, 116702, 116703, 116704, 116705, 
+    116706, 116707, 116708, 116709, 116710, 116711, 116712, 116713, 116714, 
+    116715, 116716, 116717, 116718, 116719, 116720, 116721, 116722, 116723, 
+    116724, 116725, 116726, 116727, 116728, 116729, 116730, 116731, 116732, 
+    116733, 116734, 116735, 116736, 116737, 116738, 116739, 116740, 116741, 
+    116742, 116743, 116744, 116745, 116746, 116747, 116748, 116749, 116750, 
+    116751, 116752, 116753, 116754, 116755, 116756, 116757, 116758, 116759, 
+    116760, 116761, 116762, 116763, 116764, 116765, 116766, 116767, 116768, 
+    116769, 116770, 116771, 116772, 116773, 116774, 116775, 116776, 116777, 
+    116778, 116779, 116780, 116781, 116782, 116783, 116784, 116785, 116786, 
+    116787, 116788, 116789, 116790, 116791, 116792, 116793, 116794, 116795, 
+    116796, 116797, 116798, 116799, 116800, 116801, 116802, 116803, 116804, 
+    116805, 116806, 116807, 116808, 116809, 116810, 116811, 116812, 116813, 
+    116814, 116815, 116816, 116817, 116818, 116819, 116820, 116821, 116822, 
+    116823, 116824, 116825, 116826, 116827, 116828, 116829, 116830, 116831, 
+    116832, 116833, 116834, 116835, 116836, 116837, 116838, 116839, 116840, 
+    116841, 116842, 116843, 116844, 116845, 116846, 116847, 116848, 116849, 
+    116850, 116851, 116852, 116853, 116854, 116855, 116856, 116857, 116858, 
+    116859, 116860, 116861, 116862, 116863, 116864, 116865, 116866, 116867, 
+    116868, 116869, 116870, 116871, 116872, 116873, 116874, 116875, 116876, 
+    116877, 116878, 116879, 116880, 116881, 116882, 116883, 116884, 116885, 
+    116886, 116887, 116888, 116889, 116890, 116891, 116892, 116893, 116894, 
+    116895, 116896, 116897, 116898, 116899, 116900, 116901, 116902, 116903, 
+    116904, 116905, 116906, 116907, 116908, 116909, 116910, 116911, 116912, 
+    116913, 116914, 116915, 116916, 116917, 116918, 116919, 116920, 116921, 
+    116922, 116923, 116924, 116925, 116926, 116927, 116928, 116929, 116930, 
+    116931, 116932, 116933, 116934, 116935, 116936, 116937, 116938, 116939, 
+    116940, 116941, 116942, 116943, 116944, 116945, 116946, 116947, 116948, 
+    116949, 116950, 116951, 116952, 116953, 116954, 116955, 116956, 116957, 
+    116958, 116959, 116960, 116961, 116962, 116963, 116964, 116965, 116966, 
+    116967, 116968, 116969, 116970, 116971, 116972, 116973, 116974, 116975, 
+    116976, 116977, 116978, 116979, 116980, 116981, 116982, 116983, 116984, 
+    116985, 116986, 116987, 116988, 116989, 116990, 116991, 116992, 116993, 
+    116994, 116995, 116996, 116997, 116998, 116999, 117000, 117001, 117002, 
+    117003, 117004, 117005, 117006, 117007, 117008, 117009, 117010, 117011, 
+    117012, 117013, 117014, 117015, 117016, 117017, 117018, 117019, 117020, 
+    117021, 117022, 117023, 117024, 117025, 117026, 117027, 117028, 117029, 
+    117030, 117031, 117032, 117033, 117034, 117035, 117036, 117037, 117038, 
+    117039, 117040, 117041, 117042, 117043, 117044, 117045, 117046, 117047, 
+    117048, 117049, 117050, 117051, 117052, 117053, 117054, 117055, 117056, 
+    117057, 117058, 117059, 117060, 117061, 117062, 117063, 117064, 117065, 
+    117066, 117067, 117068, 117069, 117070, 117071, 117072, 117073, 117074, 
+    117075, 117076, 117077, 117078, 117079, 117080, 117081, 117082, 117083, 
+    117084, 117085, 117086, 117087, 117088, 117089, 117090, 117091, 117092, 
+    117093, 117094, 117095, 117096, 117097, 117098, 117099, 117100, 117101, 
+    117102, 117103, 117104, 117105, 117106, 117107, 117108, 117109, 117110, 
+    117111, 117112, 117113, 117114, 117115, 117116, 117117, 117118, 117119, 
+    117120, 117121, 117122, 117123, 117124, 117125, 117126, 117127, 117128, 
+    117129, 117130, 117131, 117132, 117133, 117134, 117135, 117136, 117137, 
+    117138, 117139, 117140, 117141, 117142, 117143, 117144, 117145, 117146, 
+    117147, 117148, 117149, 117150, 117151, 117152, 117153, 117154, 117155, 
+    117156, 117157, 117158, 117159, 117160, 117161, 117162, 117163, 117164, 
+    117165, 117166, 117167, 117168, 117169, 117170, 117171, 117172, 117173, 
+    117174, 117175, 117176, 117177, 117178, 117179, 117180, 117181, 117182, 
+    117183, 117184, 117185, 117186, 117187, 117188, 117189, 117190, 117191, 
+    117192, 117193, 117194, 117195, 117196, 117197, 117198, 117199, 117200, 
+    117201, 117202, 117203, 117204, 117205, 117206, 117207, 117208, 117209, 
+    117210, 117211, 117212, 117213, 117214, 117215, 117216, 117217, 117218, 
+    117219, 117220, 117221, 117222, 117223, 117224, 117225, 117226, 117227, 
+    117228, 117229, 117230, 117231, 117232, 117233, 117234, 117235, 117236, 
+    117237, 117238, 117239, 117240, 117241, 117242, 117243, 117244, 117245, 
+    117246, 117247, 117248, 117249, 117250, 117251, 117252, 117253, 117254, 
+    117255, 117256, 117257, 117258, 117259, 117260, 117261, 117262, 117263, 
+    117264, 117265, 117266, 117267, 117268, 117269, 117270, 117271, 117272, 
+    117273, 117274, 117275, 117276, 117277, 117278, 117279, 117280, 117281, 
+    117282, 117283, 117284, 117285, 117286, 117287, 117288, 117289, 117290, 
+    117291, 117292, 117293, 117294, 117295, 117296, 117297, 117298, 117299, 
+    117300, 117301, 117302, 117303, 117304, 117305, 117306, 117307, 117308, 
+    117309, 117310, 117311, 117312, 117313, 117314, 117315, 117316, 117317, 
+    117318, 117319, 117320, 117321, 117322, 117323, 117324, 117325, 117326, 
+    117327, 117328, 117329, 117330, 117331, 117332, 117333, 117334, 117335, 
+    117336, 117337, 117338, 117339, 117340, 117341, 117342, 117343, 117344, 
+    117345, 117346, 117347, 117348, 117349, 117350, 117351, 117352, 117353, 
+    117354, 117355, 117356, 117357, 117358, 117359, 117360, 117361, 117362, 
+    117363, 117364, 117365, 117366, 117367, 117368, 117369, 117370, 117371, 
+    117372, 117373, 117374, 117375, 117376, 117377, 117378, 117379, 117380, 
+    117381, 117382, 117383, 117384, 117385, 117386, 117387, 117388, 117389, 
+    117390, 117391, 117392, 117393, 117394, 117395, 117396, 117397, 117398, 
+    117399, 117400, 117401, 117402, 117403, 117404, 117405, 117406, 117407, 
+    117408, 117409, 117410, 117411, 117412, 117413, 117414, 117415, 117416, 
+    117417, 117418, 117419, 117420, 117421, 117422, 117423, 117424, 117425, 
+    117426, 117427, 117428, 117429, 117430, 117431, 117432, 117433, 117434, 
+    117435, 117436, 117437, 117438, 117439, 117440, 117441, 117442, 117443, 
+    117444, 117445, 117446, 117447, 117448, 117449, 117450, 117451, 117452, 
+    117453, 117454, 117455, 117456, 117457, 117458, 117459, 117460, 117461, 
+    117462, 117463, 117464, 117465, 117466, 117467, 117468, 117469, 117470, 
+    117471, 117472, 117473, 117474, 117475, 117476, 117477, 117478, 117479, 
+    117480, 117481, 117482, 117483, 117484, 117485, 117486, 117487, 117488, 
+    117489, 117490, 117491, 117492, 117493, 117494, 117495, 117496, 117497, 
+    117498, 117499, 117500, 117501, 117502, 117503, 117504, 117505, 117506, 
+    117507, 117508, 117509, 117510, 117511, 117512, 117513, 117514, 117515, 
+    117516, 117517, 117518, 117519, 117520, 117521, 117522, 117523, 117524, 
+    117525, 117526, 117527, 117528, 117529, 117530, 117531, 117532, 117533, 
+    117534, 117535, 117536, 117537, 117538, 117539, 117540, 117541, 117542, 
+    117543, 117544, 117545, 117546, 117547, 117548, 117549, 117550, 117551, 
+    117552, 117553, 117554, 117555, 117556, 117557, 117558, 117559, 117560, 
+    117561, 117562, 117563, 117564, 117565, 117566, 117567, 117568, 117569, 
+    117570, 117571, 117572, 117573, 117574, 117575, 117576, 117577, 117578, 
+    117579, 117580, 117581, 117582, 117583, 117584, 117585, 117586, 117587, 
+    117588, 117589, 117590, 117591, 117592, 117593, 117594, 117595, 117596, 
+    117597, 117598, 117599, 117600, 117601, 117602, 117603, 117604, 117605, 
+    117606, 117607, 117608, 117609, 117610, 117611, 117612, 117613, 117614, 
+    117615, 117616, 117617, 117618, 117619, 117620, 117621, 117622, 117623, 
+    117624, 117625, 117626, 117627, 117628, 117629, 117630, 117631, 117632, 
+    117633, 117634, 117635, 117636, 117637, 117638, 117639, 117640, 117641, 
+    117642, 117643, 117644, 117645, 117646, 117647, 117648, 117649, 117650, 
+    117651, 117652, 117653, 117654, 117655, 117656, 117657, 117658, 117659, 
+    117660, 117661, 117662, 117663, 117664, 117665, 117666, 117667, 117668, 
+    117669, 117670, 117671, 117672, 117673, 117674, 117675, 117676, 117677, 
+    117678, 117679, 117680, 117681, 117682, 117683, 117684, 117685, 117686, 
+    117687, 117688, 117689, 117690, 117691, 117692, 117693, 117694, 117695, 
+    117696, 117697, 117698, 117699, 117700, 117701, 117702, 117703, 117704, 
+    117705, 117706, 117707, 117708, 117709, 117710, 117711, 117712, 117713, 
+    117714, 117715, 117716, 117717, 117718, 117719, 117720, 117721, 117722, 
+    117723, 117724, 117725, 117726, 117727, 117728, 117729, 117730, 117731, 
+    117732, 117733, 117734, 117735, 117736, 117737, 117738, 117739, 117740, 
+    117741, 117742, 117743, 117744, 117745, 117746, 117747, 117748, 117749, 
+    117750, 117751, 117752, 117753, 117754, 117755, 117756, 117757, 117758, 
+    117759, 117760, 117761, 117762, 117763, 117764, 117765, 117766, 117767, 
+    117768, 117769, 117770, 117771, 117772, 117773, 117774, 117775, 117776, 
+    117777, 117778, 117779, 117780, 117781, 117782, 117783, 117784, 117785, 
+    117786, 117787, 117788, 117789, 117790, 117791, 117792, 117793, 117794, 
+    117795, 117796, 117797, 117798, 117799, 117800, 117801, 117802, 117803, 
+    117804, 117805, 117806, 117807, 117808, 117809, 117810, 117811, 117812, 
+    117813, 117814, 117815, 117816, 117817, 117818, 117819, 117820, 117821, 
+    117822, 117823, 117824, 117825, 117826, 117827, 117828, 117829, 117830, 
+    117831, 117832, 117833, 117834, 117835, 117836, 117837, 117838, 117839, 
+    117840, 117841, 117842, 117843, 117844, 117845, 117846, 117847, 117848, 
+    117849, 117850, 117851, 117852, 117853, 117854, 117855, 117856, 117857, 
+    117858, 117859, 117860, 117861, 117862, 117863, 117864, 117865, 117866, 
+    117867, 117868, 117869, 117870, 117871, 117872, 117873, 117874, 117875, 
+    117876, 117877, 117878, 117879, 117880, 117881, 117882, 117883, 117884, 
+    117885, 117886, 117887, 117888, 117889, 117890, 117891, 117892, 117893, 
+    117894, 117895, 117896, 117897, 117898, 117899, 117900, 117901, 117902, 
+    117903, 117904, 117905, 117906, 117907, 117908, 117909, 117910, 117911, 
+    117912, 117913, 117914, 117915, 117916, 117917, 117918, 117919, 117920, 
+    117921, 117922, 117923, 117924, 117925, 117926, 117927, 117928, 117929, 
+    117930, 117931, 117932, 117933, 117934, 117935, 117936, 117937, 117938, 
+    117939, 117940, 117941, 117942, 117943, 117944, 117945, 117946, 117947, 
+    117948, 117949, 117950, 117951, 117952, 117953, 117954, 117955, 117956, 
+    117957, 117958, 117959, 117960, 117961, 117962, 117963, 117964, 117965, 
+    117966, 117967, 117968, 117969, 117970, 117971, 117972, 117973, 117974, 
+    117975, 117976, 117977, 117978, 117979, 117980, 117981, 117982, 117983, 
+    117984, 117985, 117986, 117987, 117988, 117989, 117990, 117991, 117992, 
+    117993, 117994, 117995, 117996, 117997, 117998, 117999, 118000, 118001, 
+    118002, 118003, 118004, 118005, 118006, 118007, 118008, 118009, 118010, 
+    118011, 118012, 118013, 118014, 118015, 118016, 118017, 118018, 118019, 
+    118020, 118021, 118022, 118023, 118024, 118025, 118026, 118027, 118028, 
+    118029, 118030, 118031, 118032, 118033, 118034, 118035, 118036, 118037, 
+    118038, 118039, 118040, 118041, 118042, 118043, 118044, 118045, 118046, 
+    118047, 118048, 118049, 118050, 118051, 118052, 118053, 118054, 118055, 
+    118056, 118057, 118058, 118059, 118060, 118061, 118062, 118063, 118064, 
+    118065, 118066, 118067, 118068, 118069, 118070, 118071, 118072, 118073, 
+    118074, 118075, 118076, 118077, 118078, 118079, 118080, 118081, 118082, 
+    118083, 118084, 118085, 118086, 118087, 118088, 118089, 118090, 118091, 
+    118092, 118093, 118094, 118095, 118096, 118097, 118098, 118099, 118100, 
+    118101, 118102, 118103, 118104, 118105, 118106, 118107, 118108, 118109, 
+    118110, 118111, 118112, 118113, 118114, 118115, 118116, 118117, 118118, 
+    118119, 118120, 118121, 118122, 118123, 118124, 118125, 118126, 118127, 
+    118128, 118129, 118130, 118131, 118132, 118133, 118134, 118135, 118136, 
+    118137, 118138, 118139, 118140, 118141, 118142, 118143, 118144, 118145, 
+    118146, 118147, 118148, 118149, 118150, 118151, 118152, 118153, 118154, 
+    118155, 118156, 118157, 118158, 118159, 118160, 118161, 118162, 118163, 
+    118164, 118165, 118166, 118167, 118168, 118169, 118170, 118171, 118172, 
+    118173, 118174, 118175, 118176, 118177, 118178, 118179, 118180, 118181, 
+    118182, 118183, 118184, 118185, 118186, 118187, 118188, 118189, 118190, 
+    118191, 118192, 118193, 118194, 118195, 118196, 118197, 118198, 118199, 
+    118200, 118201, 118202, 118203, 118204, 118205, 118206, 118207, 118208, 
+    118209, 118210, 118211, 118212, 118213, 118214, 118215, 118216, 118217, 
+    118218, 118219, 118220, 118221, 118222, 118223, 118224, 118225, 118226, 
+    118227, 118228, 118229, 118230, 118231, 118232, 118233, 118234, 118235, 
+    118236, 118237, 118238, 118239, 118240, 118241, 118242, 118243, 118244, 
+    118245, 118246, 118247, 118248, 118249, 118250, 118251, 118252, 118253, 
+    118254, 118255, 118256, 118257, 118258, 118259, 118260, 118261, 118262, 
+    118263, 118264, 118265, 118266, 118267, 118268, 118269, 118270, 118271, 
+    118272, 118273, 118274, 118275, 118276, 118277, 118278, 118279, 118280, 
+    118281, 118282, 118283, 118284, 118285, 118286, 118287, 118288, 118289, 
+    118290, 118291, 118292, 118293, 118294, 118295, 118296, 118297, 118298, 
+    118299, 118300, 118301, 118302, 118303, 118304, 118305, 118306, 118307, 
+    118308, 118309, 118310, 118311, 118312, 118313, 118314, 118315, 118316, 
+    118317, 118318, 118319, 118320, 118321, 118322, 118323, 118324, 118325, 
+    118326, 118327, 118328, 118329, 118330, 118331, 118332, 118333, 118334, 
+    118335, 118336, 118337, 118338, 118339, 118340, 118341, 118342, 118343, 
+    118344, 118345, 118346, 118347, 118348, 118349, 118350, 118351, 118352, 
+    118353, 118354, 118355, 118356, 118357, 118358, 118359, 118360, 118361, 
+    118362, 118363, 118364, 118365, 118366, 118367, 118368, 118369, 118370, 
+    118371, 118372, 118373, 118374, 118375, 118376, 118377, 118378, 118379, 
+    118380, 118381, 118382, 118383, 118384, 118385, 118386, 118387, 118388, 
+    118389, 118390, 118391, 118392, 118393, 118394, 118395, 118396, 118397, 
+    118398, 118399, 118400, 118401, 118402, 118403, 118404, 118405, 118406, 
+    118407, 118408, 118409, 118410, 118411, 118412, 118413, 118414, 118415, 
+    118416, 118417, 118418, 118419, 118420, 118421, 118422, 118423, 118424, 
+    118425, 118426, 118427, 118428, 118429, 118430, 118431, 118432, 118433, 
+    118434, 118435, 118436, 118437, 118438, 118439, 118440, 118441, 118442, 
+    118443, 118444, 118445, 118446, 118447, 118448, 118449, 118450, 118451, 
+    118452, 118453, 118454, 118455, 118456, 118457, 118458, 118459, 118460, 
+    118461, 118462, 118463, 118464, 118465, 118466, 118467, 118468, 118469, 
+    118470, 118471, 118472, 118473, 118474, 118475, 118476, 118477, 118478, 
+    118479, 118480, 118481, 118482, 118483, 118484, 118485, 118486, 118487, 
+    118488, 118489, 118490, 118491, 118492, 118493, 118494, 118495, 118496, 
+    118497, 118498, 118499, 118500, 118501, 118502, 118503, 118504, 118505, 
+    118506, 118507, 118508, 118509, 118510, 118511, 118512, 118513, 118514, 
+    118515, 118516, 118517, 118518, 118519, 118520, 118521, 118522, 118523, 
+    118524, 118525, 118526, 118527, 118528, 118529, 118530, 118531, 118532, 
+    118533, 118534, 118535, 118536, 118537, 118538, 118539, 118540, 118541, 
+    118542, 118543, 118544, 118545, 118546, 118547, 118548, 118549, 118550, 
+    118551, 118552, 118553, 118554, 118555, 118556, 118557, 118558, 118559, 
+    118560, 118561, 118562, 118563, 118564, 118565, 118566, 118567, 118568, 
+    118569, 118570, 118571, 118572, 118573, 118574, 118575, 118576, 118577, 
+    118578, 118579, 118580, 118581, 118582, 118583, 118584, 118585, 118586, 
+    118587, 118588, 118589, 118590, 118591, 118592, 118593, 118594, 118595, 
+    118596, 118597, 118598, 118599, 118600, 118601, 118602, 118603, 118604, 
+    118605, 118606, 118607, 118608, 118609, 118610, 118611, 118612, 118613, 
+    118614, 118615, 118616, 118617, 118618, 118619, 118620, 118621, 118622, 
+    118623, 118624, 118625, 118626, 118627, 118628, 118629, 118630, 118631, 
+    118632, 118633, 118634, 118635, 118636, 118637, 118638, 118639, 118640, 
+    118641, 118642, 118643, 118644, 118645, 118646, 118647, 118648, 118649, 
+    118650, 118651, 118652, 118653, 118654, 118655, 118656, 118657, 118658, 
+    118659, 118660, 118661, 118662, 118663, 118664, 118665, 118666, 118667, 
+    118668, 118669, 118670, 118671, 118672, 118673, 118674, 118675, 118676, 
+    118677, 118678, 118679, 118680, 118681, 118682, 118683, 118684, 118685, 
+    118686, 118687, 118688, 118689, 118690, 118691, 118692, 118693, 118694, 
+    118695, 118696, 118697, 118698, 118699, 118700, 118701, 118702, 118703, 
+    118704, 118705, 118706, 118707, 118708, 118709, 118710, 118711, 118712, 
+    118713, 118714, 118715, 118716, 118717, 118718, 118719, 118720, 118721, 
+    118722, 118723, 118724, 118725, 118726, 118727, 118728, 118729, 118730, 
+    118731, 118732, 118733, 118734, 118735, 118736, 118737, 118738, 118739, 
+    118740, 118741, 118742, 118743, 118744, 118745, 118746, 118747, 118748, 
+    118749, 118750, 118751, 118752, 118753, 118754, 118755, 118756, 118757, 
+    118758, 118759, 118760, 118761, 118762, 118763, 118764, 118765, 118766, 
+    118767, 118768, 118769, 118770, 118771, 118772, 118773, 118774, 118775, 
+    118776, 118777, 118778, 118779, 118780, 118781, 118782, 118783, 118784, 
+    118785, 118786, 118787, 118788, 118789, 118790, 118791, 118792, 118793, 
+    118794, 118795, 118796, 118797, 118798, 118799, 118800, 118801, 118802, 
+    118803, 118804, 118805, 118806, 118807, 118808, 118809, 118810, 118811, 
+    118812, 118813, 118814, 118815, 118816, 118817, 118818, 118819, 118820, 
+    118821, 118822, 118823, 118824, 118825, 118826, 118827, 118828, 118829, 
+    118830, 118831, 118832, 118833, 118834, 118835, 118836, 118837, 118838, 
+    118839, 118840, 118841, 118842, 118843, 118844, 118845, 118846, 118847, 
+    118848, 118849, 118850, 118851, 118852, 118853, 118854, 118855, 118856, 
+    118857, 118858, 118859, 118860, 118861, 118862, 118863, 118864, 118865, 
+    118866, 118867, 118868, 118869, 118870, 118871, 118872, 118873, 118874, 
+    118875, 118876, 118877, 118878, 118879, 118880, 118881, 118882, 118883, 
+    118884, 118885, 118886, 118887, 118888, 118889, 118890, 118891, 118892, 
+    118893, 118894, 118895, 118896, 118897, 118898, 118899, 118900, 118901, 
+    118902, 118903, 118904, 118905, 118906, 118907, 118908, 118909, 118910, 
+    118911, 118912, 118913, 118914, 118915, 118916, 118917, 118918, 118919, 
+    118920, 118921, 118922, 118923, 118924, 118925, 118926, 118927, 118928, 
+    118929, 118930, 118931, 118932, 118933, 118934, 118935, 118936, 118937, 
+    118938, 118939, 118940, 118941, 118942, 118943, 118944, 118945, 118946, 
+    118947, 118948, 118949, 118950, 118951, 118952, 118953, 118954, 118955, 
+    118956, 118957, 118958, 118959, 118960, 118961, 118962, 118963, 118964, 
+    118965, 118966, 118967, 118968, 118969, 118970, 118971, 118972, 118973, 
+    118974, 118975, 118976, 118977, 118978, 118979, 118980, 118981, 118982, 
+    118983, 118984, 118985, 118986, 118987, 118988, 118989, 118990, 118991, 
+    118992, 118993, 118994, 118995, 118996, 118997, 118998, 118999, 119000, 
+    119001, 119002, 119003, 119004, 119005, 119006, 119007, 119008, 119009, 
+    119010, 119011, 119012, 119013, 119014, 119015, 119016, 119017, 119018, 
+    119019, 119020, 119021, 119022, 119023, 119024, 119025, 119026, 119027, 
+    119028, 119029, 119030, 119031, 119032, 119033, 119034, 119035, 119036, 
+    119037, 119038, 119039, 119040, 119041, 119042, 119043, 119044, 119045, 
+    119046, 119047, 119048, 119049, 119050, 119051, 119052, 119053, 119054, 
+    119055, 119056, 119057, 119058, 119059, 119060, 119061, 119062, 119063, 
+    119064, 119065, 119066, 119067, 119068, 119069, 119070, 119071, 119072, 
+    119073, 119074, 119075, 119076, 119077, 119078, 119079, 119080, 119081, 
+    119082, 119083, 119084, 119085, 119086, 119087, 119088, 119089, 119090, 
+    119091, 119092, 119093, 119094, 119095, 119096, 119097, 119098, 119099, 
+    119100, 119101, 119102, 119103, 119104, 119105, 119106, 119107, 119108, 
+    119109, 119110, 119111, 119112, 119113, 119114, 119115, 119116, 119117, 
+    119118, 119119, 119120, 119121, 119122, 119123, 119124, 119125, 119126, 
+    119127, 119128, 119129, 119130, 119131, 119132, 119133, 119134, 119135, 
+    119136, 119137, 119138, 119139, 119140, 119141, 119142, 119143, 119144, 
+    119145, 119146, 119147, 119148, 119149, 119150, 119151, 119152, 119153, 
+    119154, 119155, 119156, 119157, 119158, 119159, 119160, 119161, 119162, 
+    119163, 119164, 119165, 119166, 119167, 119168, 119169, 119170, 119171, 
+    119172, 119173, 119174, 119175, 119176, 119177, 119178, 119179, 119180, 
+    119181, 119182, 119183, 119184, 119185, 119186, 119187, 119188, 119189, 
+    119190, 119191, 119192, 119193, 119194, 119195, 119196, 119197, 119198, 
+    119199, 119200, 119201, 119202, 119203, 119204, 119205, 119206, 119207, 
+    119208, 119209, 119210, 119211, 119212, 119213, 119214, 119215, 119216, 
+    119217, 119218, 119219, 119220, 119221, 119222, 119223, 119224, 119225, 
+    119226, 119227, 119228, 119229, 119230, 119231, 119232, 119233, 119234, 
+    119235, 119236, 119237, 119238, 119239, 119240, 119241, 119242, 119243, 
+    119244, 119245, 119246, 119247, 119248, 119249, 119250, 119251, 119252, 
+    119253, 119254, 119255, 119256, 119257, 119258, 119259, 119260, 119261, 
+    119262, 119263, 119264, 119265, 119266, 119267, 119268, 119269, 119270, 
+    119271, 119272, 119273, 119274, 119275, 119276, 119277, 119278, 119279, 
+    119280, 119281, 119282, 119283, 119284, 119285, 119286, 119287, 119288, 
+    119289, 119290, 119291, 119292, 119293, 119294, 119295, 119296, 119297, 
+    119298, 119299, 119300, 119301, 119302, 119303, 119304, 119305, 119306, 
+    119307, 119308, 119309, 119310, 119311, 119312, 119313, 119314, 119315, 
+    119316, 119317, 119318, 119319, 119320, 119321, 119322, 119323, 119324, 
+    119325, 119326, 119327, 119328, 119329, 119330, 119331, 119332, 119333, 
+    119334, 119335, 119336, 119337, 119338, 119339, 119340, 119341, 119342, 
+    119343, 119344, 119345, 119346, 119347, 119348, 119349, 119350, 119351, 
+    119352, 119353, 119354, 119355, 119356, 119357, 119358, 119359, 119360, 
+    119361, 119362, 119363, 119364, 119365, 119366, 119367, 119368, 119369, 
+    119370, 119371, 119372, 119373, 119374, 119375, 119376, 119377, 119378, 
+    119379, 119380, 119381, 119382, 119383, 119384, 119385, 119386, 119387, 
+    119388, 119389, 119390, 119391, 119392, 119393, 119394, 119395, 119396, 
+    119397, 119398, 119399, 119400, 119401, 119402, 119403, 119404, 119405, 
+    119406, 119407, 119408, 119409, 119410, 119411, 119412, 119413, 119414, 
+    119415, 119416, 119417, 119418, 119419, 119420, 119421, 119422, 119423, 
+    119424, 119425, 119426, 119427, 119428, 119429, 119430, 119431, 119432, 
+    119433, 119434, 119435, 119436, 119437, 119438, 119439, 119440, 119441, 
+    119442, 119443, 119444, 119445, 119446, 119447, 119448, 119449, 119450, 
+    119451, 119452, 119453, 119454, 119455, 119456, 119457, 119458, 119459, 
+    119460, 119461, 119462, 119463, 119464, 119465, 119466, 119467, 119468, 
+    119469, 119470, 119471, 119472, 119473, 119474, 119475, 119476, 119477, 
+    119478, 119479, 119480, 119481, 119482, 119483, 119484, 119485, 119486, 
+    119487, 119488, 119489, 119490, 119491, 119492, 119493, 119494, 119495, 
+    119496, 119497, 119498, 119499, 119500, 119501, 119502, 119503, 119504, 
+    119505, 119506, 119507, 119508, 119509, 119510, 119511, 119512, 119513, 
+    119514, 119515, 119516, 119517, 119518, 119519, 119520, 119521, 119522, 
+    119523, 119524, 119525, 119526, 119527, 119528, 119529, 119530, 119531, 
+    119532, 119533, 119534, 119535, 119536, 119537, 119538, 119539, 119540, 
+    119541, 119542, 119543, 119544, 119545, 119546, 119547, 119548, 119549, 
+    119550, 119551, 119552, 119553, 119554, 119555, 119556, 119557, 119558, 
+    119559, 119560, 119561, 119562, 119563, 119564, 119565, 119566, 119567, 
+    119568, 119569, 119570, 119571, 119572, 119573, 119574, 119575, 119576, 
+    119577, 119578, 119579, 119580, 119581, 119582, 119583, 119584, 119585, 
+    119586, 119587, 119588, 119589, 119590, 119591, 119592, 119593, 119594, 
+    119595, 119596, 119597, 119598, 119599, 119600, 119601, 119602, 119603, 
+    119604, 119605, 119606, 119607, 119608, 119609, 119610, 119611, 119612, 
+    119613, 119614, 119615, 119616, 119617, 119618, 119619, 119620, 119621, 
+    119622, 119623, 119624, 119625, 119626, 119627, 119628, 119629, 119630, 
+    119631, 119632, 119633, 119634, 119635, 119636, 119637, 119638, 119639, 
+    119640, 119641, 119642, 119643, 119644, 119645, 119646, 119647, 119648, 
+    119649, 119650, 119651, 119652, 119653, 119654, 119655, 119656, 119657, 
+    119658, 119659, 119660, 119661, 119662, 119663, 119664, 119665, 119666, 
+    119667, 119668, 119669, 119670, 119671, 119672, 119673, 119674, 119675, 
+    119676, 119677, 119678, 119679, 119680, 119681, 119682, 119683, 119684, 
+    119685, 119686, 119687, 119688, 119689, 119690, 119691, 119692, 119693, 
+    119694, 119695, 119696, 119697, 119698, 119699, 119700, 119701, 119702, 
+    119703, 119704, 119705, 119706, 119707, 119708, 119709, 119710, 119711, 
+    119712, 119713, 119714, 119715, 119716, 119717, 119718, 119719, 119720, 
+    119721, 119722, 119723, 119724, 119725, 119726, 119727, 119728, 119729, 
+    119730, 119731, 119732, 119733, 119734, 119735, 119736, 119737, 119738, 
+    119739, 119740, 119741, 119742, 119743, 119744, 119745, 119746, 119747, 
+    119748, 119749, 119750, 119751, 119752, 119753, 119754, 119755, 119756, 
+    119757, 119758, 119759, 119760, 119761, 119762, 119763, 119764, 119765, 
+    119766, 119767, 119768, 119769, 119770, 119771, 119772, 119773, 119774, 
+    119775, 119776, 119777, 119778, 119779, 119780, 119781, 119782, 119783, 
+    119784, 119785, 119786, 119787, 119788, 119789, 119790, 119791, 119792, 
+    119793, 119794, 119795, 119796, 119797, 119798, 119799, 119800, 119801, 
+    119802, 119803, 119804, 119805, 119806, 119807, 119808, 119809, 119810, 
+    119811, 119812, 119813, 119814, 119815, 119816, 119817, 119818, 119819, 
+    119820, 119821, 119822, 119823, 119824, 119825, 119826, 119827, 119828, 
+    119829, 119830, 119831, 119832, 119833, 119834, 119835, 119836, 119837, 
+    119838, 119839, 119840, 119841, 119842, 119843, 119844, 119845, 119846, 
+    119847, 119848, 119849, 119850, 119851, 119852, 119853, 119854, 119855, 
+    119856, 119857, 119858, 119859, 119860, 119861, 119862, 119863, 119864, 
+    119865, 119866, 119867, 119868, 119869, 119870, 119871, 119872, 119873, 
+    119874, 119875, 119876, 119877, 119878, 119879, 119880, 119881, 119882, 
+    119883, 119884, 119885, 119886, 119887, 119888, 119889, 119890, 119891, 
+    119892, 119893, 119894, 119895, 119896, 119897, 119898, 119899, 119900, 
+    119901, 119902, 119903, 119904, 119905, 119906, 119907, 119908, 119909, 
+    119910, 119911, 119912, 119913, 119914, 119915, 119916, 119917, 119918, 
+    119919, 119920, 119921, 119922, 119923, 119924, 119925, 119926, 119927, 
+    119928, 119929, 119930, 119931, 119932, 119933, 119934, 119935, 119936, 
+    119937, 119938, 119939, 119940, 119941, 119942, 119943, 119944, 119945, 
+    119946, 119947, 119948, 119949, 119950, 119951, 119952, 119953, 119954, 
+    119955, 119956, 119957, 119958, 119959, 119960, 119961, 119962, 119963, 
+    119964, 119965, 119966, 119967, 119968, 119969, 119970, 119971, 119972, 
+    119973, 119974, 119975, 119976, 119977, 119978, 119979, 119980, 119981, 
+    119982, 119983, 119984, 119985, 119986, 119987, 119988, 119989, 119990, 
+    119991, 119992, 119993, 119994, 119995, 119996, 119997, 119998, 119999, 
+    120000, 120001, 120002, 120003, 120004, 120005, 120006, 120007, 120008, 
+    120009, 120010, 120011, 120012, 120013, 120014, 120015, 120016, 120017, 
+    120018, 120019, 120020, 120021, 120022, 120023, 120024, 120025, 120026, 
+    120027, 120028, 120029, 120030, 120031, 120032, 120033, 120034, 120035, 
+    120036, 120037, 120038, 120039, 120040, 120041, 120042, 120043, 120044, 
+    120045, 120046, 120047, 120048, 120049, 120050, 120051, 120052, 120053, 
+    120054, 120055, 120056, 120057, 120058, 120059, 120060, 120061, 120062, 
+    120063, 120064, 120065, 120066, 120067, 120068, 120069, 120070, 120071, 
+    120072, 120073, 120074, 120075, 120076, 120077, 120078, 120079, 120080, 
+    120081, 120082, 120083, 120084, 120085, 120086, 120087, 120088, 120089, 
+    120090, 120091, 120092, 120093, 120094, 120095, 120096, 120097, 120098, 
+    120099, 120100, 120101, 120102, 120103, 120104, 120105, 120106, 120107, 
+    120108, 120109, 120110, 120111, 120112, 120113, 120114, 120115, 120116, 
+    120117, 120118, 120119, 120120, 120121, 120122, 120123, 120124, 120125, 
+    120126, 120127, 120128, 120129, 120130, 120131, 120132, 120133, 120134, 
+    120135, 120136, 120137, 120138, 120139, 120140, 120141, 120142, 120143, 
+    120144, 120145, 120146, 120147, 120148, 120149, 120150, 120151, 120152, 
+    120153, 120154, 120155, 120156, 120157, 120158, 120159, 120160, 120161, 
+    120162, 120163, 120164, 120165, 120166, 120167, 120168, 120169, 120170, 
+    120171, 120172, 120173, 120174, 120175, 120176, 120177, 120178, 120179, 
+    120180, 120181, 120182, 120183, 120184, 120185, 120186, 120187, 120188, 
+    120189, 120190, 120191, 120192, 120193, 120194, 120195, 120196, 120197, 
+    120198, 120199, 120200, 120201, 120202, 120203, 120204, 120205, 120206, 
+    120207, 120208, 120209, 120210, 120211, 120212, 120213, 120214, 120215, 
+    120216, 120217, 120218, 120219, 120220, 120221, 120222, 120223, 120224, 
+    120225, 120226, 120227, 120228, 120229, 120230, 120231, 120232, 120233, 
+    120234, 120235, 120236, 120237, 120238, 120239, 120240, 120241, 120242, 
+    120243, 120244, 120245, 120246, 120247, 120248, 120249, 120250, 120251, 
+    120252, 120253, 120254, 120255, 120256, 120257, 120258, 120259, 120260, 
+    120261, 120262, 120263, 120264, 120265, 120266, 120267, 120268, 120269, 
+    120270, 120271, 120272, 120273, 120274, 120275, 120276, 120277, 120278, 
+    120279, 120280, 120281, 120282, 120283, 120284, 120285, 120286, 120287, 
+    120288, 120289, 120290, 120291, 120292, 120293, 120294, 120295, 120296, 
+    120297, 120298, 120299, 120300, 120301, 120302, 120303, 120304, 120305, 
+    120306, 120307, 120308, 120309, 120310, 120311, 120312, 120313, 120314, 
+    120315, 120316, 120317, 120318, 120319, 120320, 120321, 120322, 120323, 
+    120324, 120325, 120326, 120327, 120328, 120329, 120330, 120331, 120332, 
+    120333, 120334, 120335, 120336, 120337, 120338, 120339, 120340, 120341, 
+    120342, 120343, 120344, 120345, 120346, 120347, 120348, 120349, 120350, 
+    120351, 120352, 120353, 120354, 120355, 120356, 120357, 120358, 120359, 
+    120360, 120361, 120362, 120363, 120364, 120365, 120366, 120367, 120368, 
+    120369, 120370, 120371, 120372, 120373, 120374, 120375, 120376, 120377, 
+    120378, 120379, 120380, 120381, 120382, 120383, 120384, 120385, 120386, 
+    120387, 120388, 120389, 120390, 120391, 120392, 120393, 120394, 120395, 
+    120396, 120397, 120398, 120399, 120400, 120401, 120402, 120403, 120404, 
+    120405, 120406, 120407, 120408, 120409, 120410, 120411, 120412, 120413, 
+    120414, 120415, 120416, 120417, 120418, 120419, 120420, 120421, 120422, 
+    120423, 120424, 120425, 120426, 120427, 120428, 120429, 120430, 120431, 
+    120432, 120433, 120434, 120435, 120436, 120437, 120438, 120439, 120440, 
+    120441, 120442, 120443, 120444, 120445, 120446, 120447, 120448, 120449, 
+    120450, 120451, 120452, 120453, 120454, 120455, 120456, 120457, 120458, 
+    120459, 120460, 120461, 120462, 120463, 120464, 120465, 120466, 120467, 
+    120468, 120469, 120470, 120471, 120472, 120473, 120474, 120475, 120476, 
+    120477, 120478, 120479, 120480, 120481, 120482, 120483, 120484, 120485, 
+    120486, 120487, 120488, 120489, 120490, 120491, 120492, 120493, 120494, 
+    120495, 120496, 120497, 120498, 120499, 120500, 120501, 120502, 120503, 
+    120504, 120505, 120506, 120507, 120508, 120509, 120510, 120511, 120512, 
+    120513, 120514, 120515, 120516, 120517, 120518, 120519, 120520, 120521, 
+    120522, 120523, 120524, 120525, 120526, 120527, 120528, 120529, 120530, 
+    120531, 120532, 120533, 120534, 120535, 120536, 120537, 120538, 120539, 
+    120540, 120541, 120542, 120543, 120544, 120545, 120546, 120547, 120548, 
+    120549, 120550, 120551, 120552, 120553, 120554, 120555, 120556, 120557, 
+    120558, 120559, 120560, 120561, 120562, 120563, 120564, 120565, 120566, 
+    120567, 120568, 120569, 120570, 120571, 120572, 120573, 120574, 120575, 
+    120576, 120577, 120578, 120579, 120580, 120581, 120582, 120583, 120584, 
+    120585, 120586, 120587, 120588, 120589, 120590, 120591, 120592, 120593, 
+    120594, 120595, 120596, 120597, 120598, 120599, 120600, 120601, 120602, 
+    120603, 120604, 120605, 120606, 120607, 120608, 120609, 120610, 120611, 
+    120612, 120613, 120614, 120615, 120616, 120617, 120618, 120619, 120620, 
+    120621, 120622, 120623, 120624, 120625, 120626, 120627, 120628, 120629, 
+    120630, 120631, 120632, 120633, 120634, 120635, 120636, 120637, 120638, 
+    120639, 120640, 120641, 120642, 120643, 120644, 120645, 120646, 120647, 
+    120648, 120649, 120650, 120651, 120652, 120653, 120654, 120655, 120656, 
+    120657, 120658, 120659, 120660, 120661, 120662, 120663, 120664, 120665, 
+    120666, 120667, 120668, 120669, 120670, 120671, 120672, 120673, 120674, 
+    120675, 120676, 120677, 120678, 120679, 120680, 120681, 120682, 120683, 
+    120684, 120685, 120686, 120687, 120688, 120689, 120690, 120691, 120692, 
+    120693, 120694, 120695, 120696, 120697, 120698, 120699, 120700, 120701, 
+    120702, 120703, 120704, 120705, 120706, 120707, 120708, 120709, 120710, 
+    120711, 120712, 120713, 120714, 120715, 120716, 120717, 120718, 120719, 
+    120720, 120721, 120722, 120723, 120724, 120725, 120726, 120727, 120728, 
+    120729, 120730, 120731, 120732, 120733, 120734, 120735, 120736, 120737, 
+    120738, 120739, 120740, 120741, 120742, 120743, 120744, 120745, 120746, 
+    120747, 120748, 120749, 120750, 120751, 120752, 120753, 120754, 120755, 
+    120756, 120757, 120758, 120759, 120760, 120761, 120762, 120763, 120764, 
+    120765, 120766, 120767, 120768, 120769, 120770, 120771, 120772, 120773, 
+    120774, 120775, 120776, 120777, 120778, 120779, 120780, 120781, 120782, 
+    120783, 120784, 120785, 120786, 120787, 120788, 120789, 120790, 120791, 
+    120792, 120793, 120794, 120795, 120796, 120797, 120798, 120799, 120800, 
+    120801, 120802, 120803, 120804, 120805, 120806, 120807, 120808, 120809, 
+    120810, 120811, 120812, 120813, 120814, 120815, 120816, 120817, 120818, 
+    120819, 120820, 120821, 120822, 120823, 120824, 120825, 120826, 120827, 
+    120828, 120829, 120830, 120831, 120832, 120833, 120834, 120835, 120836, 
+    120837, 120838, 120839, 120840, 120841, 120842, 120843, 120844, 120845, 
+    120846, 120847, 120848, 120849, 120850, 120851, 120852, 120853, 120854, 
+    120855, 120856, 120857, 120858, 120859, 120860, 120861, 120862, 120863, 
+    120864, 120865, 120866, 120867, 120868, 120869, 120870, 120871, 120872, 
+    120873, 120874, 120875, 120876, 120877, 120878, 120879, 120880, 120881, 
+    120882, 120883, 120884, 120885, 120886, 120887, 120888, 120889, 120890, 
+    120891, 120892, 120893, 120894, 120895, 120896, 120897, 120898, 120899, 
+    120900, 120901, 120902, 120903, 120904, 120905, 120906, 120907, 120908, 
+    120909, 120910, 120911, 120912, 120913, 120914, 120915, 120916, 120917, 
+    120918, 120919, 120920, 120921, 120922, 120923, 120924, 120925, 120926, 
+    120927, 120928, 120929, 120930, 120931, 120932, 120933, 120934, 120935, 
+    120936, 120937, 120938, 120939, 120940, 120941, 120942, 120943, 120944, 
+    120945, 120946, 120947, 120948, 120949, 120950, 120951, 120952, 120953, 
+    120954, 120955, 120956, 120957, 120958, 120959, 120960, 120961, 120962, 
+    120963, 120964, 120965, 120966, 120967, 120968, 120969, 120970, 120971, 
+    120972, 120973, 120974, 120975, 120976, 120977, 120978, 120979, 120980, 
+    120981, 120982, 120983, 120984, 120985, 120986, 120987, 120988, 120989, 
+    120990, 120991, 120992, 120993, 120994, 120995, 120996, 120997, 120998, 
+    120999, 121000, 121001, 121002, 121003, 121004, 121005, 121006, 121007, 
+    121008, 121009, 121010, 121011, 121012, 121013, 121014, 121015, 121016, 
+    121017, 121018, 121019, 121020, 121021, 121022, 121023, 121024, 121025, 
+    121026, 121027, 121028, 121029, 121030, 121031, 121032, 121033, 121034, 
+    121035, 121036, 121037, 121038, 121039, 121040, 121041, 121042, 121043, 
+    121044, 121045, 121046, 121047, 121048, 121049, 121050, 121051, 121052, 
+    121053, 121054, 121055, 121056, 121057, 121058, 121059, 121060, 121061, 
+    121062, 121063, 121064, 121065, 121066, 121067, 121068, 121069, 121070, 
+    121071, 121072, 121073, 121074, 121075, 121076, 121077, 121078, 121079, 
+    121080, 121081, 121082, 121083, 121084, 121085, 121086, 121087, 121088, 
+    121089, 121090, 121091, 121092, 121093, 121094, 121095, 121096, 121097, 
+    121098, 121099, 121100, 121101, 121102, 121103, 121104, 121105, 121106, 
+    121107, 121108, 121109, 121110, 121111, 121112, 121113, 121114, 121115, 
+    121116, 121117, 121118, 121119, 121120, 121121, 121122, 121123, 121124, 
+    121125, 121126, 121127, 121128, 121129, 121130, 121131, 121132, 121133, 
+    121134, 121135, 121136, 121137, 121138, 121139, 121140, 121141, 121142, 
+    121143, 121144, 121145, 121146, 121147, 121148, 121149, 121150, 121151, 
+    121152, 121153, 121154, 121155, 121156, 121157, 121158, 121159, 121160, 
+    121161, 121162, 121163, 121164, 121165, 121166, 121167, 121168, 121169, 
+    121170, 121171, 121172, 121173, 121174, 121175, 121176, 121177, 121178, 
+    121179, 121180, 121181, 121182, 121183, 121184, 121185, 121186, 121187, 
+    121188, 121189, 121190, 121191, 121192, 121193, 121194, 121195, 121196, 
+    121197, 121198, 121199, 121200, 121201, 121202, 121203, 121204, 121205, 
+    121206, 121207, 121208, 121209, 121210, 121211, 121212, 121213, 121214, 
+    121215, 121216, 121217, 121218, 121219, 121220, 121221, 121222, 121223, 
+    121224, 121225, 121226, 121227, 121228, 121229, 121230, 121231, 121232, 
+    121233, 121234, 121235, 121236, 121237, 121238, 121239, 121240, 121241, 
+    121242, 121243, 121244, 121245, 121246, 121247, 121248, 121249, 121250, 
+    121251, 121252, 121253, 121254, 121255, 121256, 121257, 121258, 121259, 
+    121260, 121261, 121262, 121263, 121264, 121265, 121266, 121267, 121268, 
+    121269, 121270, 121271, 121272, 121273, 121274, 121275, 121276, 121277, 
+    121278, 121279, 121280, 121281, 121282, 121283, 121284, 121285, 121286, 
+    121287, 121288, 121289, 121290, 121291, 121292, 121293, 121294, 121295, 
+    121296, 121297, 121298, 121299, 121300, 121301, 121302, 121303, 121304, 
+    121305, 121306, 121307, 121308, 121309, 121310, 121311, 121312, 121313, 
+    121314, 121315, 121316, 121317, 121318, 121319, 121320, 121321, 121322, 
+    121323, 121324, 121325, 121326, 121327, 121328, 121329, 121330, 121331, 
+    121332, 121333, 121334, 121335, 121336, 121337, 121338, 121339, 121340, 
+    121341, 121342, 121343, 121344, 121345, 121346, 121347, 121348, 121349, 
+    121350, 121351, 121352, 121353, 121354, 121355, 121356, 121357, 121358, 
+    121359, 121360, 121361, 121362, 121363, 121364, 121365, 121366, 121367, 
+    121368, 121369, 121370, 121371, 121372, 121373, 121374, 121375, 121376, 
+    121377, 121378, 121379, 121380, 121381, 121382, 121383, 121384, 121385, 
+    121386, 121387, 121388, 121389, 121390, 121391, 121392, 121393, 121394, 
+    121395, 121396, 121397, 121398, 121399, 121400, 121401, 121402, 121403, 
+    121404, 121405, 121406, 121407, 121408, 121409, 121410, 121411, 121412, 
+    121413, 121414, 121415, 121416, 121417, 121418, 121419, 121420, 121421, 
+    121422, 121423, 121424, 121425, 121426, 121427, 121428, 121429, 121430, 
+    121431, 121432, 121433, 121434, 121435, 121436, 121437, 121438, 121439, 
+    121440, 121441, 121442, 121443, 121444, 121445, 121446, 121447, 121448, 
+    121449, 121450, 121451, 121452, 121453, 121454, 121455, 121456, 121457, 
+    121458, 121459, 121460, 121461, 121462, 121463, 121464, 121465, 121466, 
+    121467, 121468, 121469, 121470, 121471, 121472, 121473, 121474, 121475, 
+    121476, 121477, 121478, 121479, 121480, 121481, 121482, 121483, 121484, 
+    121485, 121486, 121487, 121488, 121489, 121490, 121491, 121492, 121493, 
+    121494, 121495, 121496, 121497, 121498, 121499, 121500, 121501, 121502, 
+    121503, 121504, 121505, 121506, 121507, 121508, 121509, 121510, 121511, 
+    121512, 121513, 121514, 121515, 121516, 121517, 121518, 121519, 121520, 
+    121521, 121522, 121523, 121524, 121525, 121526, 121527, 121528, 121529, 
+    121530, 121531, 121532, 121533, 121534, 121535, 121536, 121537, 121538, 
+    121539, 121540, 121541, 121542, 121543, 121544, 121545, 121546, 121547, 
+    121548, 121549, 121550, 121551, 121552, 121553, 121554, 121555, 121556, 
+    121557, 121558, 121559, 121560, 121561, 121562, 121563, 121564, 121565, 
+    121566, 121567, 121568, 121569, 121570, 121571, 121572, 121573, 121574, 
+    121575, 121576, 121577, 121578, 121579, 121580, 121581, 121582, 121583, 
+    121584, 121585, 121586, 121587, 121588, 121589, 121590, 121591, 121592, 
+    121593, 121594, 121595, 121596, 121597, 121598, 121599, 121600, 121601, 
+    121602, 121603, 121604, 121605, 121606, 121607, 121608, 121609, 121610, 
+    121611, 121612, 121613, 121614, 121615, 121616, 121617, 121618, 121619, 
+    121620, 121621, 121622, 121623, 121624, 121625, 121626, 121627, 121628, 
+    121629, 121630, 121631, 121632, 121633, 121634, 121635, 121636, 121637, 
+    121638, 121639, 121640, 121641, 121642, 121643, 121644, 121645, 121646, 
+    121647, 121648, 121649, 121650, 121651, 121652, 121653, 121654, 121655, 
+    121656, 121657, 121658, 121659, 121660, 121661, 121662, 121663, 121664, 
+    121665, 121666, 121667, 121668, 121669, 121670, 121671, 121672, 121673, 
+    121674, 121675, 121676, 121677, 121678, 121679, 121680, 121681, 121682, 
+    121683, 121684, 121685, 121686, 121687, 121688, 121689, 121690, 121691, 
+    121692, 121693, 121694, 121695, 121696, 121697, 121698, 121699, 121700, 
+    121701, 121702, 121703, 121704, 121705, 121706, 121707, 121708, 121709, 
+    121710, 121711, 121712, 121713, 121714, 121715, 121716, 121717, 121718, 
+    121719, 121720, 121721, 121722, 121723, 121724, 121725, 121726, 121727, 
+    121728, 121729, 121730, 121731, 121732, 121733, 121734, 121735, 121736, 
+    121737, 121738, 121739, 121740, 121741, 121742, 121743, 121744, 121745, 
+    121746, 121747, 121748, 121749, 121750, 121751, 121752, 121753, 121754, 
+    121755, 121756, 121757, 121758, 121759, 121760, 121761, 121762, 121763, 
+    121764, 121765, 121766, 121767, 121768, 121769, 121770, 121771, 121772, 
+    121773, 121774, 121775, 121776, 121777, 121778, 121779, 121780, 121781, 
+    121782, 121783, 121784, 121785, 121786, 121787, 121788, 121789, 121790, 
+    121791, 121792, 121793, 121794, 121795, 121796, 121797, 121798, 121799, 
+    121800, 121801, 121802, 121803, 121804, 121805, 121806, 121807, 121808, 
+    121809, 121810, 121811, 121812, 121813, 121814, 121815, 121816, 121817, 
+    121818, 121819, 121820, 121821, 121822, 121823, 121824, 121825, 121826, 
+    121827, 121828, 121829, 121830, 121831, 121832, 121833, 121834, 121835, 
+    121836, 121837, 121838, 121839, 121840, 121841, 121842, 121843, 121844, 
+    121845, 121846, 121847, 121848, 121849, 121850, 121851, 121852, 121853, 
+    121854, 121855, 121856, 121857, 121858, 121859, 121860, 121861, 121862, 
+    121863, 121864, 121865, 121866, 121867, 121868, 121869, 121870, 121871, 
+    121872, 121873, 121874, 121875, 121876, 121877, 121878, 121879, 121880, 
+    121881, 121882, 121883, 121884, 121885, 121886, 121887, 121888, 121889, 
+    121890, 121891, 121892, 121893, 121894, 121895, 121896, 121897, 121898, 
+    121899, 121900, 121901, 121902, 121903, 121904, 121905, 121906, 121907, 
+    121908, 121909, 121910, 121911, 121912, 121913, 121914, 121915, 121916, 
+    121917, 121918, 121919, 121920, 121921, 121922, 121923, 121924, 121925, 
+    121926, 121927, 121928, 121929, 121930, 121931, 121932, 121933, 121934, 
+    121935, 121936, 121937, 121938, 121939, 121940, 121941, 121942, 121943, 
+    121944, 121945, 121946, 121947, 121948, 121949, 121950, 121951, 121952, 
+    121953, 121954, 121955, 121956, 121957, 121958, 121959, 121960, 121961, 
+    121962, 121963, 121964, 121965, 121966, 121967, 121968, 121969, 121970, 
+    121971, 121972, 121973, 121974, 121975, 121976, 121977, 121978, 121979, 
+    121980, 121981, 121982, 121983, 121984, 121985, 121986, 121987, 121988, 
+    121989, 121990, 121991, 121992, 121993, 121994, 121995, 121996, 121997, 
+    121998, 121999, 122000, 122001, 122002, 122003, 122004, 122005, 122006, 
+    122007, 122008, 122009, 122010, 122011, 122012, 122013, 122014, 122015, 
+    122016, 122017, 122018, 122019, 122020, 122021, 122022, 122023, 122024, 
+    122025, 122026, 122027, 122028, 122029, 122030, 122031, 122032, 122033, 
+    122034, 122035, 122036, 122037, 122038, 122039, 122040, 122041, 122042, 
+    122043, 122044, 122045, 122046, 122047, 122048, 122049, 122050, 122051, 
+    122052, 122053, 122054, 122055, 122056, 122057, 122058, 122059, 122060, 
+    122061, 122062, 122063, 122064, 122065, 122066, 122067, 122068, 122069, 
+    122070, 122071, 122072, 122073, 122074, 122075, 122076, 122077, 122078, 
+    122079, 122080, 122081, 122082, 122083, 122084, 122085, 122086, 122087, 
+    122088, 122089, 122090, 122091, 122092, 122093, 122094, 122095, 122096, 
+    122097, 122098, 122099, 122100, 122101, 122102, 122103, 122104, 122105, 
+    122106, 122107, 122108, 122109, 122110, 122111, 122112, 122113, 122114, 
+    122115, 122116, 122117, 122118, 122119, 122120, 122121, 122122, 122123, 
+    122124, 122125, 122126, 122127, 122128, 122129, 122130, 122131, 122132, 
+    122133, 122134, 122135, 122136, 122137, 122138, 122139, 122140, 122141, 
+    122142, 122143, 122144, 122145, 122146, 122147, 122148, 122149, 122150, 
+    122151, 122152, 122153, 122154, 122155, 122156, 122157, 122158, 122159, 
+    122160, 122161, 122162, 122163, 122164, 122165, 122166, 122167, 122168, 
+    122169, 122170, 122171, 122172, 122173, 122174, 122175, 122176, 122177, 
+    122178, 122179, 122180, 122181, 122182, 122183, 122184, 122185, 122186, 
+    122187, 122188, 122189, 122190, 122191, 122192, 122193, 122194, 122195, 
+    122196, 122197, 122198, 122199, 122200, 122201, 122202, 122203, 122204, 
+    122205, 122206, 122207, 122208, 122209, 122210, 122211, 122212, 122213, 
+    122214, 122215, 122216, 122217, 122218, 122219, 122220, 122221, 122222, 
+    122223, 122224, 122225, 122226, 122227, 122228, 122229, 122230, 122231, 
+    122232, 122233, 122234, 122235, 122236, 122237, 122238, 122239, 122240, 
+    122241, 122242, 122243, 122244, 122245, 122246, 122247, 122248, 122249, 
+    122250, 122251, 122252, 122253, 122254, 122255, 122256, 122257, 122258, 
+    122259, 122260, 122261, 122262, 122263, 122264, 122265, 122266, 122267, 
+    122268, 122269, 122270, 122271, 122272, 122273, 122274, 122275, 122276, 
+    122277, 122278, 122279, 122280, 122281, 122282, 122283, 122284, 122285, 
+    122286, 122287, 122288, 122289, 122290, 122291, 122292, 122293, 122294, 
+    122295, 122296, 122297, 122298, 122299, 122300, 122301, 122302, 122303, 
+    122304, 122305, 122306, 122307, 122308, 122309, 122310, 122311, 122312, 
+    122313, 122314, 122315, 122316, 122317, 122318, 122319, 122320, 122321, 
+    122322, 122323, 122324, 122325, 122326, 122327, 122328, 122329, 122330, 
+    122331, 122332, 122333, 122334, 122335, 122336, 122337, 122338, 122339, 
+    122340, 122341, 122342, 122343, 122344, 122345, 122346, 122347, 122348, 
+    122349, 122350, 122351, 122352, 122353, 122354, 122355, 122356, 122357, 
+    122358, 122359, 122360, 122361, 122362, 122363, 122364, 122365, 122366, 
+    122367, 122368, 122369, 122370, 122371, 122372, 122373, 122374, 122375, 
+    122376, 122377, 122378, 122379, 122380, 122381, 122382, 122383, 122384, 
+    122385, 122386, 122387, 122388, 122389, 122390, 122391, 122392, 122393, 
+    122394, 122395, 122396, 122397, 122398, 122399, 122400, 122401, 122402, 
+    122403, 122404, 122405, 122406, 122407, 122408, 122409, 122410, 122411, 
+    122412, 122413, 122414, 122415, 122416, 122417, 122418, 122419, 122420, 
+    122421, 122422, 122423, 122424, 122425, 122426, 122427, 122428, 122429, 
+    122430, 122431, 122432, 122433, 122434, 122435, 122436, 122437, 122438, 
+    122439, 122440, 122441, 122442, 122443, 122444, 122445, 122446, 122447, 
+    122448, 122449, 122450, 122451, 122452, 122453, 122454, 122455, 122456, 
+    122457, 122458, 122459, 122460, 122461, 122462, 122463, 122464, 122465, 
+    122466, 122467, 122468, 122469, 122470, 122471, 122472, 122473, 122474, 
+    122475, 122476, 122477, 122478, 122479, 122480, 122481, 122482, 122483, 
+    122484, 122485, 122486, 122487, 122488, 122489, 122490, 122491, 122492, 
+    122493, 122494, 122495, 122496, 122497, 122498, 122499, 122500, 122501, 
+    122502, 122503, 122504, 122505, 122506, 122507, 122508, 122509, 122510, 
+    122511, 122512, 122513, 122514, 122515, 122516, 122517, 122518, 122519, 
+    122520, 122521, 122522, 122523, 122524, 122525, 122526, 122527, 122528, 
+    122529, 122530, 122531, 122532, 122533, 122534, 122535, 122536, 122537, 
+    122538, 122539, 122540, 122541, 122542, 122543, 122544, 122545, 122546, 
+    122547, 122548, 122549, 122550, 122551, 122552, 122553, 122554, 122555, 
+    122556, 122557, 122558, 122559, 122560, 122561, 122562, 122563, 122564, 
+    122565, 122566, 122567, 122568, 122569, 122570, 122571, 122572, 122573, 
+    122574, 122575, 122576, 122577, 122578, 122579, 122580, 122581, 122582, 
+    122583, 122584, 122585, 122586, 122587, 122588, 122589, 122590, 122591, 
+    122592, 122593, 122594, 122595, 122596, 122597, 122598, 122599, 122600, 
+    122601, 122602, 122603, 122604, 122605, 122606, 122607, 122608, 122609, 
+    122610, 122611, 122612, 122613, 122614, 122615, 122616, 122617, 122618, 
+    122619, 122620, 122621, 122622, 122623, 122624, 122625, 122626, 122627, 
+    122628, 122629, 122630, 122631, 122632, 122633, 122634, 122635, 122636, 
+    122637, 122638, 122639, 122640, 122641, 122642, 122643, 122644, 122645, 
+    122646, 122647, 122648, 122649, 122650, 122651, 122652, 122653, 122654, 
+    122655, 122656, 122657, 122658, 122659, 122660, 122661, 122662, 122663, 
+    122664, 122665, 122666, 122667, 122668, 122669, 122670, 122671, 122672, 
+    122673, 122674, 122675, 122676, 122677, 122678, 122679, 122680, 122681, 
+    122682, 122683, 122684, 122685, 122686, 122687, 122688, 122689, 122690, 
+    122691, 122692, 122693, 122694, 122695, 122696, 122697, 122698, 122699, 
+    122700, 122701, 122702, 122703, 122704, 122705, 122706, 122707, 122708, 
+    122709, 122710, 122711, 122712, 122713, 122714, 122715, 122716, 122717, 
+    122718, 122719, 122720, 122721, 122722, 122723, 122724, 122725, 122726, 
+    122727, 122728, 122729, 122730, 122731, 122732, 122733, 122734, 122735, 
+    122736, 122737, 122738, 122739, 122740, 122741, 122742, 122743, 122744, 
+    122745, 122746, 122747, 122748, 122749, 122750, 122751, 122752, 122753, 
+    122754, 122755, 122756, 122757, 122758, 122759, 122760, 122761, 122762, 
+    122763, 122764, 122765, 122766, 122767, 122768, 122769, 122770, 122771, 
+    122772, 122773, 122774, 122775, 122776, 122777, 122778, 122779, 122780, 
+    122781, 122782, 122783, 122784, 122785, 122786, 122787, 122788, 122789, 
+    122790, 122791, 122792, 122793, 122794, 122795, 122796, 122797, 122798, 
+    122799, 122800, 122801, 122802, 122803, 122804, 122805, 122806, 122807, 
+    122808, 122809, 122810, 122811, 122812, 122813, 122814, 122815, 122816, 
+    122817, 122818, 122819, 122820, 122821, 122822, 122823, 122824, 122825, 
+    122826, 122827, 122828, 122829, 122830, 122831, 122832, 122833, 122834, 
+    122835, 122836, 122837, 122838, 122839, 122840, 122841, 122842, 122843, 
+    122844, 122845, 122846, 122847, 122848, 122849, 122850, 122851, 122852, 
+    122853, 122854, 122855, 122856, 122857, 122858, 122859, 122860, 122861, 
+    122862, 122863, 122864, 122865, 122866, 122867, 122868, 122869, 122870, 
+    122871, 122872, 122873, 122874, 122875, 122876, 122877, 122878, 122879, 
+    122880, 122881, 122882, 122883, 122884, 122885, 122886, 122887, 122888, 
+    122889, 122890, 122891, 122892, 122893, 122894, 122895, 122896, 122897, 
+    122898, 122899, 122900, 122901, 122902, 122903, 122904, 122905, 122906, 
+    122907, 122908, 122909, 122910, 122911, 122912, 122913, 122914, 122915, 
+    122916, 122917, 122918, 122919, 122920, 122921, 122922, 122923, 122924, 
+    122925, 122926, 122927, 122928, 122929, 122930, 122931, 122932, 122933, 
+    122934, 122935, 122936, 122937, 122938, 122939, 122940, 122941, 122942, 
+    122943, 122944, 122945, 122946, 122947, 122948, 122949, 122950, 122951, 
+    122952, 122953, 122954, 122955, 122956, 122957, 122958, 122959, 122960, 
+    122961, 122962, 122963, 122964, 122965, 122966, 122967, 122968, 122969, 
+    122970, 122971, 122972, 122973, 122974, 122975, 122976, 122977, 122978, 
+    122979, 122980, 122981, 122982, 122983, 122984, 122985, 122986, 122987, 
+    122988, 122989, 122990, 122991, 122992, 122993, 122994, 122995, 122996, 
+    122997, 122998, 122999, 123000, 123001, 123002, 123003, 123004, 123005, 
+    123006, 123007, 123008, 123009, 123010, 123011, 123012, 123013, 123014, 
+    123015, 123016, 123017, 123018, 123019, 123020, 123021, 123022, 123023, 
+    123024, 123025, 123026, 123027, 123028, 123029, 123030, 123031, 123032, 
+    123033, 123034, 123035, 123036, 123037, 123038, 123039, 123040, 123041, 
+    123042, 123043, 123044, 123045, 123046, 123047, 123048, 123049, 123050, 
+    123051, 123052, 123053, 123054, 123055, 123056, 123057, 123058, 123059, 
+    123060, 123061, 123062, 123063, 123064, 123065, 123066, 123067, 123068, 
+    123069, 123070, 123071, 123072, 123073, 123074, 123075, 123076, 123077, 
+    123078, 123079, 123080, 123081, 123082, 123083, 123084, 123085, 123086, 
+    123087, 123088, 123089, 123090, 123091, 123092, 123093, 123094, 123095, 
+    123096, 123097, 123098, 123099, 123100, 123101, 123102, 123103, 123104, 
+    123105, 123106, 123107, 123108, 123109, 123110, 123111, 123112, 123113, 
+    123114, 123115, 123116, 123117, 123118, 123119, 123120, 123121, 123122, 
+    123123, 123124, 123125, 123126, 123127, 123128, 123129, 123130, 123131, 
+    123132, 123133, 123134, 123135, 123136, 123137, 123138, 123139, 123140, 
+    123141, 123142, 123143, 123144, 123145, 123146, 123147, 123148, 123149, 
+    123150, 123151, 123152, 123153, 123154, 123155, 123156, 123157, 123158, 
+    123159, 123160, 123161, 123162, 123163, 123164, 123165, 123166, 123167, 
+    123168, 123169, 123170, 123171, 123172, 123173, 123174, 123175, 123176, 
+    123177, 123178, 123179, 123180, 123181, 123182, 123183, 123184, 123185, 
+    123186, 123187, 123188, 123189, 123190, 123191, 123192, 123193, 123194, 
+    123195, 123196, 123197, 123198, 123199, 123200, 123201, 123202, 123203, 
+    123204, 123205, 123206, 123207, 123208, 123209, 123210, 123211, 123212, 
+    123213, 123214, 123215, 123216, 123217, 123218, 123219, 123220, 123221, 
+    123222, 123223, 123224, 123225, 123226, 123227, 123228, 123229, 123230, 
+    123231, 123232, 123233, 123234, 123235, 123236, 123237, 123238, 123239, 
+    123240, 123241, 123242, 123243, 123244, 123245, 123246, 123247, 123248, 
+    123249, 123250, 123251, 123252, 123253, 123254, 123255, 123256, 123257, 
+    123258, 123259, 123260, 123261, 123262, 123263, 123264, 123265, 123266, 
+    123267, 123268, 123269, 123270, 123271, 123272, 123273, 123274, 123275, 
+    123276, 123277, 123278, 123279, 123280, 123281, 123282, 123283, 123284, 
+    123285, 123286, 123287, 123288, 123289, 123290, 123291, 123292, 123293, 
+    123294, 123295, 123296, 123297, 123298, 123299, 123300, 123301, 123302, 
+    123303, 123304, 123305, 123306, 123307, 123308, 123309, 123310, 123311, 
+    123312, 123313, 123314, 123315, 123316, 123317, 123318, 123319, 123320, 
+    123321, 123322, 123323, 123324, 123325, 123326, 123327, 123328, 123329, 
+    123330, 123331, 123332, 123333, 123334, 123335, 123336, 123337, 123338, 
+    123339, 123340, 123341, 123342, 123343, 123344, 123345, 123346, 123347, 
+    123348, 123349, 123350, 123351, 123352, 123353, 123354, 123355, 123356, 
+    123357, 123358, 123359, 123360, 123361, 123362, 123363, 123364, 123365, 
+    123366, 123367, 123368, 123369, 123370, 123371, 123372, 123373, 123374, 
+    123375, 123376, 123377, 123378, 123379, 123380, 123381, 123382, 123383, 
+    123384, 123385, 123386, 123387, 123388, 123389, 123390, 123391, 123392, 
+    123393, 123394, 123395, 123396, 123397, 123398, 123399, 123400, 123401, 
+    123402, 123403, 123404, 123405, 123406, 123407, 123408, 123409, 123410, 
+    123411, 123412, 123413, 123414, 123415, 123416, 123417, 123418, 123419, 
+    123420, 123421, 123422, 123423, 123424, 123425, 123426, 123427, 123428, 
+    123429, 123430, 123431, 123432, 123433, 123434, 123435, 123436, 123437, 
+    123438, 123439, 123440, 123441, 123442, 123443, 123444, 123445, 123446, 
+    123447, 123448, 123449, 123450, 123451, 123452, 123453, 123454, 123455, 
+    123456, 123457, 123458, 123459, 123460, 123461, 123462, 123463, 123464, 
+    123465, 123466, 123467, 123468, 123469, 123470, 123471, 123472, 123473, 
+    123474, 123475, 123476, 123477, 123478, 123479, 123480, 123481, 123482, 
+    123483, 123484, 123485, 123486, 123487, 123488, 123489, 123490, 123491, 
+    123492, 123493, 123494, 123495, 123496, 123497, 123498, 123499, 123500, 
+    123501, 123502, 123503, 123504, 123505, 123506, 123507, 123508, 123509, 
+    123510, 123511, 123512, 123513, 123514, 123515, 123516, 123517, 123518, 
+    123519, 123520, 123521, 123522, 123523, 123524, 123525, 123526, 123527, 
+    123528, 123529, 123530, 123531, 123532, 123533, 123534, 123535, 123536, 
+    123537, 123538, 123539, 123540, 123541, 123542, 123543, 123544, 123545, 
+    123546, 123547, 123548, 123549, 123550, 123551, 123552, 123553, 123554, 
+    123555, 123556, 123557, 123558, 123559, 123560, 123561, 123562, 123563, 
+    123564, 123565, 123566, 123567, 123568, 123569, 123570, 123571, 123572, 
+    123573, 123574, 123575, 123576, 123577, 123578, 123579, 123580, 123581, 
+    123582, 123583, 123584, 123585, 123586, 123587, 123588, 123589, 123590, 
+    123591, 123592, 123593, 123594, 123595, 123596, 123597, 123598, 123599, 
+    123600, 123601, 123602, 123603, 123604, 123605, 123606, 123607, 123608, 
+    123609, 123610, 123611, 123612, 123613, 123614, 123615, 123616, 123617, 
+    123618, 123619, 123620, 123621, 123622, 123623, 123624, 123625, 123626, 
+    123627, 123628, 123629, 123630, 123631, 123632, 123633, 123634, 123635, 
+    123636, 123637, 123638, 123639, 123640, 123641, 123642, 123643, 123644, 
+    123645, 123646, 123647, 123648, 123649, 123650, 123651, 123652, 123653, 
+    123654, 123655, 123656, 123657, 123658, 123659, 123660, 123661, 123662, 
+    123663, 123664, 123665, 123666, 123667, 123668, 123669, 123670, 123671, 
+    123672, 123673, 123674, 123675, 123676, 123677, 123678, 123679, 123680, 
+    123681, 123682, 123683, 123684, 123685, 123686, 123687, 123688, 123689, 
+    123690, 123691, 123692, 123693, 123694, 123695, 123696, 123697, 123698, 
+    123699, 123700, 123701, 123702, 123703, 123704, 123705, 123706, 123707, 
+    123708, 123709, 123710, 123711, 123712, 123713, 123714, 123715, 123716, 
+    123717, 123718, 123719, 123720, 123721, 123722, 123723, 123724, 123725, 
+    123726, 123727, 123728, 123729, 123730, 123731, 123732, 123733, 123734, 
+    123735, 123736, 123737, 123738, 123739, 123740, 123741, 123742, 123743, 
+    123744, 123745, 123746, 123747, 123748, 123749, 123750, 123751, 123752, 
+    123753, 123754, 123755, 123756, 123757, 123758, 123759, 123760, 123761, 
+    123762, 123763, 123764, 123765, 123766, 123767, 123768, 123769, 123770, 
+    123771, 123772, 123773, 123774, 123775, 123776, 123777, 123778, 123779, 
+    123780, 123781, 123782, 123783, 123784, 123785, 123786, 123787, 123788, 
+    123789, 123790, 123791, 123792, 123793, 123794, 123795, 123796, 123797, 
+    123798, 123799, 123800, 123801, 123802, 123803, 123804, 123805, 123806, 
+    123807, 123808, 123809, 123810, 123811, 123812, 123813, 123814, 123815, 
+    123816, 123817, 123818, 123819, 123820, 123821, 123822, 123823, 123824, 
+    123825, 123826, 123827, 123828, 123829, 123830, 123831, 123832, 123833, 
+    123834, 123835, 123836, 123837, 123838, 123839, 123840, 123841, 123842, 
+    123843, 123844, 123845, 123846, 123847, 123848, 123849, 123850, 123851, 
+    123852, 123853, 123854, 123855, 123856, 123857, 123858, 123859, 123860, 
+    123861, 123862, 123863, 123864, 123865, 123866, 123867, 123868, 123869, 
+    123870, 123871, 123872, 123873, 123874, 123875, 123876, 123877, 123878, 
+    123879, 123880, 123881, 123882, 123883, 123884, 123885, 123886, 123887, 
+    123888, 123889, 123890, 123891, 123892, 123893, 123894, 123895, 123896, 
+    123897, 123898, 123899, 123900, 123901, 123902, 123903, 123904, 123905, 
+    123906, 123907, 123908, 123909, 123910, 123911, 123912, 123913, 123914, 
+    123915, 123916, 123917, 123918, 123919, 123920, 123921, 123922, 123923, 
+    123924, 123925, 123926, 123927, 123928, 123929, 123930, 123931, 123932, 
+    123933, 123934, 123935, 123936, 123937, 123938, 123939, 123940, 123941, 
+    123942, 123943, 123944, 123945, 123946, 123947, 123948, 123949, 123950, 
+    123951, 123952, 123953, 123954, 123955, 123956, 123957, 123958, 123959, 
+    123960, 123961, 123962, 123963, 123964, 123965, 123966, 123967, 123968, 
+    123969, 123970, 123971, 123972, 123973, 123974, 123975, 123976, 123977, 
+    123978, 123979, 123980, 123981, 123982, 123983, 123984, 123985, 123986, 
+    123987, 123988, 123989, 123990, 123991, 123992, 123993, 123994, 123995, 
+    123996, 123997, 123998, 123999, 124000, 124001, 124002, 124003, 124004, 
+    124005, 124006, 124007, 124008, 124009, 124010, 124011, 124012, 124013, 
+    124014, 124015, 124016, 124017, 124018, 124019, 124020, 124021, 124022, 
+    124023, 124024, 124025, 124026, 124027, 124028, 124029, 124030, 124031, 
+    124032, 124033, 124034, 124035, 124036, 124037, 124038, 124039, 124040, 
+    124041, 124042, 124043, 124044, 124045, 124046, 124047, 124048, 124049, 
+    124050, 124051, 124052, 124053, 124054, 124055, 124056, 124057, 124058, 
+    124059, 124060, 124061, 124062, 124063, 124064, 124065, 124066, 124067, 
+    124068, 124069, 124070, 124071, 124072, 124073, 124074, 124075, 124076, 
+    124077, 124078, 124079, 124080, 124081, 124082, 124083, 124084, 124085, 
+    124086, 124087, 124088, 124089, 124090, 124091, 124092, 124093, 124094, 
+    124095, 124096, 124097, 124098, 124099, 124100, 124101, 124102, 124103, 
+    124104, 124105, 124106, 124107, 124108, 124109, 124110, 124111, 124112, 
+    124113, 124114, 124115, 124116, 124117, 124118, 124119, 124120, 124121, 
+    124122, 124123, 124124, 124125, 124126, 124127, 124128, 124129, 124130, 
+    124131, 124132, 124133, 124134, 124135, 124136, 124137, 124138, 124139, 
+    124140, 124141, 124142, 124143, 124144, 124145, 124146, 124147, 124148, 
+    124149, 124150, 124151, 124152, 124153, 124154, 124155, 124156, 124157, 
+    124158, 124159, 124160, 124161, 124162, 124163, 124164, 124165, 124166, 
+    124167, 124168, 124169, 124170, 124171, 124172, 124173, 124174, 124175, 
+    124176, 124177, 124178, 124179, 124180, 124181, 124182, 124183, 124184, 
+    124185, 124186, 124187, 124188, 124189, 124190, 124191, 124192, 124193, 
+    124194, 124195, 124196, 124197, 124198, 124199, 124200, 124201, 124202, 
+    124203, 124204, 124205, 124206, 124207, 124208, 124209, 124210, 124211, 
+    124212, 124213, 124214, 124215, 124216, 124217, 124218, 124219, 124220, 
+    124221, 124222, 124223, 124224, 124225, 124226, 124227, 124228, 124229, 
+    124230, 124231, 124232, 124233, 124234, 124235, 124236, 124237, 124238, 
+    124239, 124240, 124241, 124242, 124243, 124244, 124245, 124246, 124247, 
+    124248, 124249, 124250, 124251, 124252, 124253, 124254, 124255, 124256, 
+    124257, 124258, 124259, 124260, 124261, 124262, 124263, 124264, 124265, 
+    124266, 124267, 124268, 124269, 124270, 124271, 124272, 124273, 124274, 
+    124275, 124276, 124277, 124278, 124279, 124280, 124281, 124282, 124283, 
+    124284, 124285, 124286, 124287, 124288, 124289, 124290, 124291, 124292, 
+    124293, 124294, 124295, 124296, 124297, 124298, 124299, 124300, 124301, 
+    124302, 124303, 124304, 124305, 124306, 124307, 124308, 124309, 124310, 
+    124311, 124312, 124313, 124314, 124315, 124316, 124317, 124318, 124319, 
+    124320, 124321, 124322, 124323, 124324, 124325, 124326, 124327, 124328, 
+    124329, 124330, 124331, 124332, 124333, 124334, 124335, 124336, 124337, 
+    124338, 124339, 124340, 124341, 124342, 124343, 124344, 124345, 124346, 
+    124347, 124348, 124349, 124350, 124351, 124352, 124353, 124354, 124355, 
+    124356, 124357, 124358, 124359, 124360, 124361, 124362, 124363, 124364, 
+    124365, 124366, 124367, 124368, 124369, 124370, 124371, 124372, 124373, 
+    124374, 124375, 124376, 124377, 124378, 124379, 124380, 124381, 124382, 
+    124383, 124384, 124385, 124386, 124387, 124388, 124389, 124390, 124391, 
+    124392, 124393, 124394, 124395, 124396, 124397, 124398, 124399, 124400, 
+    124401, 124402, 124403, 124404, 124405, 124406, 124407, 124408, 124409, 
+    124410, 124411, 124412, 124413, 124414, 124415, 124416, 124417, 124418, 
+    124419, 124420, 124421, 124422, 124423, 124424, 124425, 124426, 124427, 
+    124428, 124429, 124430, 124431, 124432, 124433, 124434, 124435, 124436, 
+    124437, 124438, 124439, 124440, 124441, 124442, 124443, 124444, 124445, 
+    124446, 124447, 124448, 124449, 124450, 124451, 124452, 124453, 124454, 
+    124455, 124456, 124457, 124458, 124459, 124460, 124461, 124462, 124463, 
+    124464, 124465, 124466, 124467, 124468, 124469, 124470, 124471, 124472, 
+    124473, 124474, 124475, 124476, 124477, 124478, 124479, 124480, 124481, 
+    124482, 124483, 124484, 124485, 124486, 124487, 124488, 124489, 124490, 
+    124491, 124492, 124493, 124494, 124495, 124496, 124497, 124498, 124499, 
+    124500, 124501, 124502, 124503, 124504, 124505, 124506, 124507, 124508, 
+    124509, 124510, 124511, 124512, 124513, 124514, 124515, 124516, 124517, 
+    124518, 124519, 124520, 124521, 124522, 124523, 124524, 124525, 124526, 
+    124527, 124528, 124529, 124530, 124531, 124532, 124533, 124534, 124535, 
+    124536, 124537, 124538, 124539, 124540, 124541, 124542, 124543, 124544, 
+    124545, 124546, 124547, 124548, 124549, 124550, 124551, 124552, 124553, 
+    124554, 124555, 124556, 124557, 124558, 124559, 124560, 124561, 124562, 
+    124563, 124564, 124565, 124566, 124567, 124568, 124569, 124570, 124571, 
+    124572, 124573, 124574, 124575, 124576, 124577, 124578, 124579, 124580, 
+    124581, 124582, 124583, 124584, 124585, 124586, 124587, 124588, 124589, 
+    124590, 124591, 124592, 124593, 124594, 124595, 124596, 124597, 124598, 
+    124599, 124600, 124601, 124602, 124603, 124604, 124605, 124606, 124607, 
+    124608, 124609, 124610, 124611, 124612, 124613, 124614, 124615, 124616, 
+    124617, 124618, 124619, 124620, 124621, 124622, 124623, 124624, 124625, 
+    124626, 124627, 124628, 124629, 124630, 124631, 124632, 124633, 124634, 
+    124635, 124636, 124637, 124638, 124639, 124640, 124641, 124642, 124643, 
+    124644, 124645, 124646, 124647, 124648, 124649, 124650, 124651, 124652, 
+    124653, 124654, 124655, 124656, 124657, 124658, 124659, 124660, 124661, 
+    124662, 124663, 124664, 124665, 124666, 124667, 124668, 124669, 124670, 
+    124671, 124672, 124673, 124674, 124675, 124676, 124677, 124678, 124679, 
+    124680, 124681, 124682, 124683, 124684, 124685, 124686, 124687, 124688, 
+    124689, 124690, 124691, 124692, 124693, 124694, 124695, 124696, 124697, 
+    124698, 124699, 124700, 124701, 124702, 124703, 124704, 124705, 124706, 
+    124707, 124708, 124709, 124710, 124711, 124712, 124713, 124714, 124715, 
+    124716, 124717, 124718, 124719, 124720, 124721, 124722, 124723, 124724, 
+    124725, 124726, 124727, 124728, 124729, 124730, 124731, 124732, 124733, 
+    124734, 124735, 124736, 124737, 124738, 124739, 124740, 124741, 124742, 
+    124743, 124744, 124745, 124746, 124747, 124748, 124749, 124750, 124751, 
+    124752, 124753, 124754, 124755, 124756, 124757, 124758, 124759, 124760, 
+    124761, 124762, 124763, 124764, 124765, 124766, 124767, 124768, 124769, 
+    124770, 124771, 124772, 124773, 124774, 124775, 124776, 124777, 124778, 
+    124779, 124780, 124781, 124782, 124783, 124784, 124785, 124786, 124787, 
+    124788, 124789, 124790, 124791, 124792, 124793, 124794, 124795, 124796, 
+    124797, 124798, 124799, 124800, 124801, 124802, 124803, 124804, 124805, 
+    124806, 124807, 124808, 124809, 124810, 124811, 124812, 124813, 124814, 
+    124815, 124816, 124817, 124818, 124819, 124820, 124821, 124822, 124823, 
+    124824, 124825, 124826, 124827, 124828, 124829, 124830, 124831, 124832, 
+    124833, 124834, 124835, 124836, 124837, 124838, 124839, 124840, 124841, 
+    124842, 124843, 124844, 124845, 124846, 124847, 124848, 124849, 124850, 
+    124851, 124852, 124853, 124854, 124855, 124856, 124857, 124858, 124859, 
+    124860, 124861, 124862, 124863, 124864, 124865, 124866, 124867, 124868, 
+    124869, 124870, 124871, 124872, 124873, 124874, 124875, 124876, 124877, 
+    124878, 124879, 124880, 124881, 124882, 124883, 124884, 124885, 124886, 
+    124887, 124888, 124889, 124890, 124891, 124892, 124893, 124894, 124895, 
+    124896, 124897, 124898, 124899, 124900, 124901, 124902, 124903, 124904, 
+    124905, 124906, 124907, 124908, 124909, 124910, 124911, 124912, 124913, 
+    124914, 124915, 124916, 124917, 124918, 124919, 124920, 124921, 124922, 
+    124923, 124924, 124925, 124926, 124927, 124928, 124929, 124930, 124931, 
+    124932, 124933, 124934, 124935, 124936, 124937, 124938, 124939, 124940, 
+    124941, 124942, 124943, 124944, 124945, 124946, 124947, 124948, 124949, 
+    124950, 124951, 124952, 124953, 124954, 124955, 124956, 124957, 124958, 
+    124959, 124960, 124961, 124962, 124963, 124964, 124965, 124966, 124967, 
+    124968, 124969, 124970, 124971, 124972, 124973, 124974, 124975, 124976, 
+    124977, 124978, 124979, 124980, 124981, 124982, 124983, 124984, 124985, 
+    124986, 124987, 124988, 124989, 124990, 124991, 124992, 124993, 124994, 
+    124995, 124996, 124997, 124998, 124999, 125000, 125001, 125002, 125003, 
+    125004, 125005, 125006, 125007, 125008, 125009, 125010, 125011, 125012, 
+    125013, 125014, 125015, 125016, 125017, 125018, 125019, 125020, 125021, 
+    125022, 125023, 125024, 125025, 125026, 125027, 125028, 125029, 125030, 
+    125031, 125032, 125033, 125034, 125035, 125036, 125037, 125038, 125039, 
+    125040, 125041, 125042, 125043, 125044, 125045, 125046, 125047, 125048, 
+    125049, 125050, 125051, 125052, 125053, 125054, 125055, 125056, 125057, 
+    125058, 125059, 125060, 125061, 125062, 125063, 125064, 125065, 125066, 
+    125067, 125068, 125069, 125070, 125071, 125072, 125073, 125074, 125075, 
+    125076, 125077, 125078, 125079, 125080, 125081, 125082, 125083, 125084, 
+    125085, 125086, 125087, 125088, 125089, 125090, 125091, 125092, 125093, 
+    125094, 125095, 125096, 125097, 125098, 125099, 125100, 125101, 125102, 
+    125103, 125104, 125105, 125106, 125107, 125108, 125109, 125110, 125111, 
+    125112, 125113, 125114, 125115, 125116, 125117, 125118, 125119, 125120, 
+    125121, 125122, 125123, 125124, 125125, 125126, 125127, 125128, 125129, 
+    125130, 125131, 125132, 125133, 125134, 125135, 125136, 125137, 125138, 
+    125139, 125140, 125141, 125142, 125143, 125144, 125145, 125146, 125147, 
+    125148, 125149, 125150, 125151, 125152, 125153, 125154, 125155, 125156, 
+    125157, 125158, 125159, 125160, 125161, 125162, 125163, 125164, 125165, 
+    125166, 125167, 125168, 125169, 125170, 125171, 125172, 125173, 125174, 
+    125175, 125176, 125177, 125178, 125179, 125180, 125181, 125182, 125183, 
+    125184, 125185, 125186, 125187, 125188, 125189, 125190, 125191, 125192, 
+    125193, 125194, 125195, 125196, 125197, 125198, 125199, 125200, 125201, 
+    125202, 125203, 125204, 125205, 125206, 125207, 125208, 125209, 125210, 
+    125211, 125212, 125213, 125214, 125215, 125216, 125217, 125218, 125219, 
+    125220, 125221, 125222, 125223, 125224, 125225, 125226, 125227, 125228, 
+    125229, 125230, 125231, 125232, 125233, 125234, 125235, 125236, 125237, 
+    125238, 125239, 125240, 125241, 125242, 125243, 125244, 125245, 125246, 
+    125247, 125248, 125249, 125250, 125251, 125252, 125253, 125254, 125255, 
+    125256, 125257, 125258, 125259, 125260, 125261, 125262, 125263, 125264, 
+    125265, 125266, 125267, 125268, 125269, 125270, 125271, 125272, 125273, 
+    125274, 125275, 125276, 125277, 125278, 125279, 125280, 125281, 125282, 
+    125283, 125284, 125285, 125286, 125287, 125288, 125289, 125290, 125291, 
+    125292, 125293, 125294, 125295, 125296, 125297, 125298, 125299, 125300, 
+    125301, 125302, 125303, 125304, 125305, 125306, 125307, 125308, 125309, 
+    125310, 125311, 125312, 125313, 125314, 125315, 125316, 125317, 125318, 
+    125319, 125320, 125321, 125322, 125323, 125324, 125325, 125326, 125327, 
+    125328, 125329, 125330, 125331, 125332, 125333, 125334, 125335, 125336, 
+    125337, 125338, 125339, 125340, 125341, 125342, 125343, 125344, 125345, 
+    125346, 125347, 125348, 125349, 125350, 125351, 125352, 125353, 125354, 
+    125355, 125356, 125357, 125358, 125359, 125360, 125361, 125362, 125363, 
+    125364, 125365, 125366, 125367, 125368, 125369, 125370, 125371, 125372, 
+    125373, 125374, 125375, 125376, 125377, 125378, 125379, 125380, 125381, 
+    125382, 125383, 125384, 125385, 125386, 125387, 125388, 125389, 125390, 
+    125391, 125392, 125393, 125394, 125395, 125396, 125397, 125398, 125399, 
+    125400, 125401, 125402, 125403, 125404, 125405, 125406, 125407, 125408, 
+    125409, 125410, 125411, 125412, 125413, 125414, 125415, 125416, 125417, 
+    125418, 125419, 125420, 125421, 125422, 125423, 125424, 125425, 125426, 
+    125427, 125428, 125429, 125430, 125431, 125432, 125433, 125434, 125435, 
+    125436, 125437, 125438, 125439, 125440, 125441, 125442, 125443, 125444, 
+    125445, 125446, 125447, 125448, 125449, 125450, 125451, 125452, 125453, 
+    125454, 125455, 125456, 125457, 125458, 125459, 125460, 125461, 125462, 
+    125463, 125464, 125465, 125466, 125467, 125468, 125469, 125470, 125471, 
+    125472, 125473, 125474, 125475, 125476, 125477, 125478, 125479, 125480, 
+    125481, 125482, 125483, 125484, 125485, 125486, 125487, 125488, 125489, 
+    125490, 125491, 125492, 125493, 125494, 125495, 125496, 125497, 125498, 
+    125499, 125500, 125501, 125502, 125503, 125504, 125505, 125506, 125507, 
+    125508, 125509, 125510, 125511, 125512, 125513, 125514, 125515, 125516, 
+    125517, 125518, 125519, 125520, 125521, 125522, 125523, 125524, 125525, 
+    125526, 125527, 125528, 125529, 125530, 125531, 125532, 125533, 125534, 
+    125535, 125536, 125537, 125538, 125539, 125540, 125541, 125542, 125543, 
+    125544, 125545, 125546, 125547, 125548, 125549, 125550, 125551, 125552, 
+    125553, 125554, 125555, 125556, 125557, 125558, 125559, 125560, 125561, 
+    125562, 125563, 125564, 125565, 125566, 125567, 125568, 125569, 125570, 
+    125571, 125572, 125573, 125574, 125575, 125576, 125577, 125578, 125579, 
+    125580, 125581, 125582, 125583, 125584, 125585, 125586, 125587, 125588, 
+    125589, 125590, 125591, 125592, 125593, 125594, 125595, 125596, 125597, 
+    125598, 125599, 125600, 125601, 125602, 125603, 125604, 125605, 125606, 
+    125607, 125608, 125609, 125610, 125611, 125612, 125613, 125614, 125615, 
+    125616, 125617, 125618, 125619, 125620, 125621, 125622, 125623, 125624, 
+    125625, 125626, 125627, 125628, 125629, 125630, 125631, 125632, 125633, 
+    125634, 125635, 125636, 125637, 125638, 125639, 125640, 125641, 125642, 
+    125643, 125644, 125645, 125646, 125647, 125648, 125649, 125650, 125651, 
+    125652, 125653, 125654, 125655, 125656, 125657, 125658, 125659, 125660, 
+    125661, 125662, 125663, 125664, 125665, 125666, 125667, 125668, 125669, 
+    125670, 125671, 125672, 125673, 125674, 125675, 125676, 125677, 125678, 
+    125679, 125680, 125681, 125682, 125683, 125684, 125685, 125686, 125687, 
+    125688, 125689, 125690, 125691, 125692, 125693, 125694, 125695, 125696, 
+    125697, 125698, 125699, 125700, 125701, 125702, 125703, 125704, 125705, 
+    125706, 125707, 125708, 125709, 125710, 125711, 125712, 125713, 125714, 
+    125715, 125716, 125717, 125718, 125719, 125720, 125721, 125722, 125723, 
+    125724, 125725, 125726, 125727, 125728, 125729, 125730, 125731, 125732, 
+    125733, 125734, 125735, 125736, 125737, 125738, 125739, 125740, 125741, 
+    125742, 125743, 125744, 125745, 125746, 125747, 125748, 125749, 125750, 
+    125751, 125752, 125753, 125754, 125755, 125756, 125757, 125758, 125759, 
+    125760, 125761, 125762, 125763, 125764, 125765, 125766, 125767, 125768, 
+    125769, 125770, 125771, 125772, 125773, 125774, 125775, 125776, 125777, 
+    125778, 125779, 125780, 125781, 125782, 125783, 125784, 125785, 125786, 
+    125787, 125788, 125789, 125790, 125791, 125792, 125793, 125794, 125795, 
+    125796, 125797, 125798, 125799, 125800, 125801, 125802, 125803, 125804, 
+    125805, 125806, 125807, 125808, 125809, 125810, 125811, 125812, 125813, 
+    125814, 125815, 125816, 125817, 125818, 125819, 125820, 125821, 125822, 
+    125823, 125824, 125825, 125826, 125827, 125828, 125829, 125830, 125831, 
+    125832, 125833, 125834, 125835, 125836, 125837, 125838, 125839, 125840, 
+    125841, 125842, 125843, 125844, 125845, 125846, 125847, 125848, 125849, 
+    125850, 125851, 125852, 125853, 125854, 125855, 125856, 125857, 125858, 
+    125859, 125860, 125861, 125862, 125863, 125864, 125865, 125866, 125867, 
+    125868, 125869, 125870, 125871, 125872, 125873, 125874, 125875, 125876, 
+    125877, 125878, 125879, 125880, 125881, 125882, 125883, 125884, 125885, 
+    125886, 125887, 125888, 125889, 125890, 125891, 125892, 125893, 125894, 
+    125895, 125896, 125897, 125898, 125899, 125900, 125901, 125902, 125903, 
+    125904, 125905, 125906, 125907, 125908, 125909, 125910, 125911, 125912, 
+    125913, 125914, 125915, 125916, 125917, 125918, 125919, 125920, 125921, 
+    125922, 125923, 125924, 125925, 125926, 125927, 125928, 125929, 125930, 
+    125931, 125932, 125933, 125934, 125935, 125936, 125937, 125938, 125939, 
+    125940, 125941, 125942, 125943, 125944, 125945, 125946, 125947, 125948, 
+    125949, 125950, 125951, 125952, 125953, 125954, 125955, 125956, 125957, 
+    125958, 125959, 125960, 125961, 125962, 125963, 125964, 125965, 125966, 
+    125967, 125968, 125969, 125970, 125971, 125972, 125973, 125974, 125975, 
+    125976, 125977, 125978, 125979, 125980, 125981, 125982, 125983, 125984, 
+    125985, 125986, 125987, 125988, 125989, 125990, 125991, 125992, 125993, 
+    125994, 125995, 125996, 125997, 125998, 125999, 126000, 126001, 126002, 
+    126003, 126004, 126005, 126006, 126007, 126008, 126009, 126010, 126011, 
+    126012, 126013, 126014, 126015, 126016, 126017, 126018, 126019, 126020, 
+    126021, 126022, 126023, 126024, 126025, 126026, 126027, 126028, 126029, 
+    126030, 126031, 126032, 126033, 126034, 126035, 126036, 126037, 126038, 
+    126039, 126040, 126041, 126042, 126043, 126044, 126045, 126046, 126047, 
+    126048, 126049, 126050, 126051, 126052, 126053, 126054, 126055, 126056, 
+    126057, 126058, 126059, 126060, 126061, 126062, 126063, 126064, 126065, 
+    126066, 126067, 126068, 126069, 126070, 126071, 126072, 126073, 126074, 
+    126075, 126076, 126077, 126078, 126079, 126080, 126081, 126082, 126083, 
+    126084, 126085, 126086, 126087, 126088, 126089, 126090, 126091, 126092, 
+    126093, 126094, 126095, 126096, 126097, 126098, 126099, 126100, 126101, 
+    126102, 126103, 126104, 126105, 126106, 126107, 126108, 126109, 126110, 
+    126111, 126112, 126113, 126114, 126115, 126116, 126117, 126118, 126119, 
+    126120, 126121, 126122, 126123, 126124, 126125, 126126, 126127, 126128, 
+    126129, 126130, 126131, 126132, 126133, 126134, 126135, 126136, 126137, 
+    126138, 126139, 126140, 126141, 126142, 126143, 126144, 126145, 126146, 
+    126147, 126148, 126149, 126150, 126151, 126152, 126153, 126154, 126155, 
+    126156, 126157, 126158, 126159, 126160, 126161, 126162, 126163, 126164, 
+    126165, 126166, 126167, 126168, 126169, 126170, 126171, 126172, 126173, 
+    126174, 126175, 126176, 126177, 126178, 126179, 126180, 126181, 126182, 
+    126183, 126184, 126185, 126186, 126187, 126188, 126189, 126190, 126191, 
+    126192, 126193, 126194, 126195, 126196, 126197, 126198, 126199, 126200, 
+    126201, 126202, 126203, 126204, 126205, 126206, 126207, 126208, 126209, 
+    126210, 126211, 126212, 126213, 126214, 126215, 126216, 126217, 126218, 
+    126219, 126220, 126221, 126222, 126223, 126224, 126225, 126226, 126227, 
+    126228, 126229, 126230, 126231, 126232, 126233, 126234, 126235, 126236, 
+    126237, 126238, 126239, 126240, 126241, 126242, 126243, 126244, 126245, 
+    126246, 126247, 126248, 126249, 126250, 126251, 126252, 126253, 126254, 
+    126255, 126256, 126257, 126258, 126259, 126260, 126261, 126262, 126263, 
+    126264, 126265, 126266, 126267, 126268, 126269, 126270, 126271, 126272, 
+    126273, 126274, 126275, 126276, 126277, 126278, 126279, 126280, 126281, 
+    126282, 126283, 126284, 126285, 126286, 126287, 126288, 126289, 126290, 
+    126291, 126292, 126293, 126294, 126295, 126296, 126297, 126298, 126299, 
+    126300, 126301, 126302, 126303, 126304, 126305, 126306, 126307, 126308, 
+    126309, 126310, 126311, 126312, 126313, 126314, 126315, 126316, 126317, 
+    126318, 126319, 126320, 126321, 126322, 126323, 126324, 126325, 126326, 
+    126327, 126328, 126329, 126330, 126331, 126332, 126333, 126334, 126335, 
+    126336, 126337, 126338, 126339, 126340, 126341, 126342, 126343, 126344, 
+    126345, 126346, 126347, 126348, 126349, 126350, 126351, 126352, 126353, 
+    126354, 126355, 126356, 126357, 126358, 126359, 126360, 126361, 126362, 
+    126363, 126364, 126365, 126366, 126367, 126368, 126369, 126370, 126371, 
+    126372, 126373, 126374, 126375, 126376, 126377, 126378, 126379, 126380, 
+    126381, 126382, 126383, 126384, 126385, 126386, 126387, 126388, 126389, 
+    126390, 126391, 126392, 126393, 126394, 126395, 126396, 126397, 126398, 
+    126399, 126400, 126401, 126402, 126403, 126404, 126405, 126406, 126407, 
+    126408, 126409, 126410, 126411, 126412, 126413, 126414, 126415, 126416, 
+    126417, 126418, 126419, 126420, 126421, 126422, 126423, 126424, 126425, 
+    126426, 126427, 126428, 126429, 126430, 126431, 126432, 126433, 126434, 
+    126435, 126436, 126437, 126438, 126439, 126440, 126441, 126442, 126443, 
+    126444, 126445, 126446, 126447, 126448, 126449, 126450, 126451, 126452, 
+    126453, 126454, 126455, 126456, 126457, 126458, 126459, 126460, 126461, 
+    126462, 126463, 126464, 126465, 126466, 126467, 126468, 126469, 126470, 
+    126471, 126472, 126473, 126474, 126475, 126476, 126477, 126478, 126479, 
+    126480, 126481, 126482, 126483, 126484, 126485, 126486, 126487, 126488, 
+    126489, 126490, 126491, 126492, 126493, 126494, 126495, 126496, 126497, 
+    126498, 126499, 126500, 126501, 126502, 126503, 126504, 126505, 126506, 
+    126507, 126508, 126509, 126510, 126511, 126512, 126513, 126514, 126515, 
+    126516, 126517, 126518, 126519, 126520, 126521, 126522, 126523, 126524, 
+    126525, 126526, 126527, 126528, 126529, 126530, 126531, 126532, 126533, 
+    126534, 126535, 126536, 126537, 126538, 126539, 126540, 126541, 126542, 
+    126543, 126544, 126545, 126546, 126547, 126548, 126549, 126550, 126551, 
+    126552, 126553, 126554, 126555, 126556, 126557, 126558, 126559, 126560, 
+    126561, 126562, 126563, 126564, 126565, 126566, 126567, 126568, 126569, 
+    126570, 126571, 126572, 126573, 126574, 126575, 126576, 126577, 126578, 
+    126579, 126580, 126581, 126582, 126583, 126584, 126585, 126586, 126587, 
+    126588, 126589, 126590, 126591, 126592, 126593, 126594, 126595, 126596, 
+    126597, 126598, 126599, 126600, 126601, 126602, 126603, 126604, 126605, 
+    126606, 126607, 126608, 126609, 126610, 126611, 126612, 126613, 126614, 
+    126615, 126616, 126617, 126618, 126619, 126620, 126621, 126622, 126623, 
+    126624, 126625, 126626, 126627, 126628, 126629, 126630, 126631, 126632, 
+    126633, 126634, 126635, 126636, 126637, 126638, 126639, 126640, 126641, 
+    126642, 126643, 126644, 126645, 126646, 126647, 126648, 126649, 126650, 
+    126651, 126652, 126653, 126654, 126655, 126656, 126657, 126658, 126659, 
+    126660, 126661, 126662, 126663, 126664, 126665, 126666, 126667, 126668, 
+    126669, 126670, 126671, 126672, 126673, 126674, 126675, 126676, 126677, 
+    126678, 126679, 126680, 126681, 126682, 126683, 126684, 126685, 126686, 
+    126687, 126688, 126689, 126690, 126691, 126692, 126693, 126694, 126695, 
+    126696, 126697, 126698, 126699, 126700, 126701, 126702, 126703, 126704, 
+    126705, 126706, 126707, 126708, 126709, 126710, 126711, 126712, 126713, 
+    126714, 126715, 126716, 126717, 126718, 126719, 126720, 126721, 126722, 
+    126723, 126724, 126725, 126726, 126727, 126728, 126729, 126730, 126731, 
+    126732, 126733, 126734, 126735, 126736, 126737, 126738, 126739, 126740, 
+    126741, 126742, 126743, 126744, 126745, 126746, 126747, 126748, 126749, 
+    126750, 126751, 126752, 126753, 126754, 126755, 126756, 126757, 126758, 
+    126759, 126760, 126761, 126762, 126763, 126764, 126765, 126766, 126767, 
+    126768, 126769, 126770, 126771, 126772, 126773, 126774, 126775, 126776, 
+    126777, 126778, 126779, 126780, 126781, 126782, 126783, 126784, 126785, 
+    126786, 126787, 126788, 126789, 126790, 126791, 126792, 126793, 126794, 
+    126795, 126796, 126797, 126798, 126799, 126800, 126801, 126802, 126803, 
+    126804, 126805, 126806, 126807, 126808, 126809, 126810, 126811, 126812, 
+    126813, 126814, 126815, 126816, 126817, 126818, 126819, 126820, 126821, 
+    126822, 126823, 126824, 126825, 126826, 126827, 126828, 126829, 126830, 
+    126831, 126832, 126833, 126834, 126835, 126836, 126837, 126838, 126839, 
+    126840, 126841, 126842, 126843, 126844, 126845, 126846, 126847, 126848, 
+    126849, 126850, 126851, 126852, 126853, 126854, 126855, 126856, 126857, 
+    126858, 126859, 126860, 126861, 126862, 126863, 126864, 126865, 126866, 
+    126867, 126868, 126869, 126870, 126871, 126872, 126873, 126874, 126875, 
+    126876, 126877, 126878, 126879, 126880, 126881, 126882, 126883, 126884, 
+    126885, 126886, 126887, 126888, 126889, 126890, 126891, 126892, 126893, 
+    126894, 126895, 126896, 126897, 126898, 126899, 126900, 126901, 126902, 
+    126903, 126904, 126905, 126906, 126907, 126908, 126909, 126910, 126911, 
+    126912, 126913, 126914, 126915, 126916, 126917, 126918, 126919, 126920, 
+    126921, 126922, 126923, 126924, 126925, 126926, 126927, 126928, 126929, 
+    126930, 126931, 126932, 126933, 126934, 126935, 126936, 126937, 126938, 
+    126939, 126940, 126941, 126942, 126943, 126944, 126945, 126946, 126947, 
+    126948, 126949, 126950, 126951, 126952, 126953, 126954, 126955, 126956, 
+    126957, 126958, 126959, 126960, 126961, 126962, 126963, 126964, 126965, 
+    126966, 126967, 126968, 126969, 126970, 126971, 126972, 126973, 126974, 
+    126975, 126976, 126977, 126978, 126979, 126980, 126981, 126982, 126983, 
+    126984, 126985, 126986, 126987, 126988, 126989, 126990, 126991, 126992, 
+    126993, 126994, 126995, 126996, 126997, 126998, 126999, 127000, 127001, 
+    127002, 127003, 127004, 127005, 127006, 127007, 127008, 127009, 127010, 
+    127011, 127012, 127013, 127014, 127015, 127016, 127017, 127018, 127019, 
+    127020, 127021, 127022, 127023, 127024, 127025, 127026, 127027, 127028, 
+    127029, 127030, 127031, 127032, 127033, 127034, 127035, 127036, 127037, 
+    127038, 127039, 127040, 127041, 127042, 127043, 127044, 127045, 127046, 
+    127047, 127048, 127049, 127050, 127051, 127052, 127053, 127054, 127055, 
+    127056, 127057, 127058, 127059, 127060, 127061, 127062, 127063, 127064, 
+    127065, 127066, 127067, 127068, 127069, 127070, 127071, 127072, 127073, 
+    127074, 127075, 127076, 127077, 127078, 127079, 127080, 127081, 127082, 
+    127083, 127084, 127085, 127086, 127087, 127088, 127089, 127090, 127091, 
+    127092, 127093, 127094, 127095, 127096, 127097, 127098, 127099, 127100, 
+    127101, 127102, 127103, 127104, 127105, 127106, 127107, 127108, 127109, 
+    127110, 127111, 127112, 127113, 127114, 127115, 127116, 127117, 127118, 
+    127119, 127120, 127121, 127122, 127123, 127124, 127125, 127126, 127127, 
+    127128, 127129, 127130, 127131, 127132, 127133, 127134, 127135, 127136, 
+    127137, 127138, 127139, 127140, 127141, 127142, 127143, 127144, 127145, 
+    127146, 127147, 127148, 127149, 127150, 127151, 127152, 127153, 127154, 
+    127155, 127156, 127157, 127158, 127159, 127160, 127161, 127162, 127163, 
+    127164, 127165, 127166, 127167, 127168, 127169, 127170, 127171, 127172, 
+    127173, 127174, 127175, 127176, 127177, 127178, 127179, 127180, 127181, 
+    127182, 127183, 127184, 127185, 127186, 127187, 127188, 127189, 127190, 
+    127191, 127192, 127193, 127194, 127195, 127196, 127197, 127198, 127199, 
+    127200, 127201, 127202, 127203, 127204, 127205, 127206, 127207, 127208, 
+    127209, 127210, 127211, 127212, 127213, 127214, 127215, 127216, 127217, 
+    127218, 127219, 127220, 127221, 127222, 127223, 127224, 127225, 127226, 
+    127227, 127228, 127229, 127230, 127231, 127232, 127233, 127234, 127235, 
+    127236, 127237, 127238, 127239, 127240, 127241, 127242, 127243, 127244, 
+    127245, 127246, 127247, 127248, 127249, 127250, 127251, 127252, 127253, 
+    127254, 127255, 127256, 127257, 127258, 127259, 127260, 127261, 127262, 
+    127263, 127264, 127265, 127266, 127267, 127268, 127269, 127270, 127271, 
+    127272, 127273, 127274, 127275, 127276, 127277, 127278, 127279, 127280, 
+    127281, 127282, 127283, 127284, 127285, 127286, 127287, 127288, 127289, 
+    127290, 127291, 127292, 127293, 127294, 127295, 127296, 127297, 127298, 
+    127299, 127300, 127301, 127302, 127303, 127304, 127305, 127306, 127307, 
+    127308, 127309, 127310, 127311, 127312, 127313, 127314, 127315, 127316, 
+    127317, 127318, 127319, 127320, 127321, 127322, 127323, 127324, 127325, 
+    127326, 127327, 127328, 127329, 127330, 127331, 127332, 127333, 127334, 
+    127335, 127336, 127337, 127338, 127339, 127340, 127341, 127342, 127343, 
+    127344, 127345, 127346, 127347, 127348, 127349, 127350, 127351, 127352, 
+    127353, 127354, 127355, 127356, 127357, 127358, 127359, 127360, 127361, 
+    127362, 127363, 127364, 127365, 127366, 127367, 127368, 127369, 127370, 
+    127371, 127372, 127373, 127374, 127375, 127376, 127377, 127378, 127379, 
+    127380, 127381, 127382, 127383, 127384, 127385, 127386, 127387, 127388, 
+    127389, 127390, 127391, 127392, 127393, 127394, 127395, 127396, 127397, 
+    127398, 127399, 127400, 127401, 127402, 127403, 127404, 127405, 127406, 
+    127407, 127408, 127409, 127410, 127411, 127412, 127413, 127414, 127415, 
+    127416, 127417, 127418, 127419, 127420, 127421, 127422, 127423, 127424, 
+    127425, 127426, 127427, 127428, 127429, 127430, 127431, 127432, 127433, 
+    127434, 127435, 127436, 127437, 127438, 127439, 127440, 127441, 127442, 
+    127443, 127444, 127445, 127446, 127447, 127448, 127449, 127450, 127451, 
+    127452, 127453, 127454, 127455, 127456, 127457, 127458, 127459, 127460, 
+    127461, 127462, 127463, 127464, 127465, 127466, 127467, 127468, 127469, 
+    127470, 127471, 127472, 127473, 127474, 127475, 127476, 127477, 127478, 
+    127479, 127480, 127481, 127482, 127483, 127484, 127485, 127486, 127487, 
+    127488, 127489, 127490, 127491, 127492, 127493, 127494, 127495, 127496, 
+    127497, 127498, 127499, 127500, 127501, 127502, 127503, 127504, 127505, 
+    127506, 127507, 127508, 127509, 127510, 127511, 127512, 127513, 127514, 
+    127515, 127516, 127517, 127518, 127519, 127520, 127521, 127522, 127523, 
+    127524, 127525, 127526, 127527, 127528, 127529, 127530, 127531, 127532, 
+    127533, 127534, 127535, 127536, 127537, 127538, 127539, 127540, 127541, 
+    127542, 127543, 127544, 127545, 127546, 127547, 127548, 127549, 127550, 
+    127551, 127552, 127553, 127554, 127555, 127556, 127557, 127558, 127559, 
+    127560, 127561, 127562, 127563, 127564, 127565, 127566, 127567, 127568, 
+    127569, 127570, 127571, 127572, 127573, 127574, 127575, 127576, 127577, 
+    127578, 127579, 127580, 127581, 127582, 127583, 127584, 127585, 127586, 
+    127587, 127588, 127589, 127590, 127591, 127592, 127593, 127594, 127595, 
+    127596, 127597, 127598, 127599, 127600, 127601, 127602, 127603, 127604, 
+    127605, 127606, 127607, 127608, 127609, 127610, 127611, 127612, 127613, 
+    127614, 127615, 127616, 127617, 127618, 127619, 127620, 127621, 127622, 
+    127623, 127624, 127625, 127626, 127627, 127628, 127629, 127630, 127631, 
+    127632, 127633, 127634, 127635, 127636, 127637, 127638, 127639, 127640, 
+    127641, 127642, 127643, 127644, 127645, 127646, 127647, 127648, 127649, 
+    127650, 127651, 127652, 127653, 127654, 127655, 127656, 127657, 127658, 
+    127659, 127660, 127661, 127662, 127663, 127664, 127665, 127666, 127667, 
+    127668, 127669, 127670, 127671, 127672, 127673, 127674, 127675, 127676, 
+    127677, 127678, 127679, 127680, 127681, 127682, 127683, 127684, 127685, 
+    127686, 127687, 127688, 127689, 127690, 127691, 127692, 127693, 127694, 
+    127695, 127696, 127697, 127698, 127699, 127700, 127701, 127702, 127703, 
+    127704, 127705, 127706, 127707, 127708, 127709, 127710, 127711, 127712, 
+    127713, 127714, 127715, 127716, 127717, 127718, 127719, 127720, 127721, 
+    127722, 127723, 127724, 127725, 127726, 127727, 127728, 127729, 127730, 
+    127731, 127732, 127733, 127734, 127735, 127736, 127737, 127738, 127739, 
+    127740, 127741, 127742, 127743, 127744, 127745, 127746, 127747, 127748, 
+    127749, 127750, 127751, 127752, 127753, 127754, 127755, 127756, 127757, 
+    127758, 127759, 127760, 127761, 127762, 127763, 127764, 127765, 127766, 
+    127767, 127768, 127769, 127770, 127771, 127772, 127773, 127774, 127775, 
+    127776, 127777, 127778, 127779, 127780, 127781, 127782, 127783, 127784, 
+    127785, 127786, 127787, 127788, 127789, 127790, 127791, 127792, 127793, 
+    127794, 127795, 127796, 127797, 127798, 127799, 127800, 127801, 127802, 
+    127803, 127804, 127805, 127806, 127807, 127808, 127809, 127810, 127811, 
+    127812, 127813, 127814, 127815, 127816, 127817, 127818, 127819, 127820, 
+    127821, 127822, 127823, 127824, 127825, 127826, 127827, 127828, 127829, 
+    127830, 127831, 127832, 127833, 127834, 127835, 127836, 127837, 127838, 
+    127839, 127840, 127841, 127842, 127843, 127844, 127845, 127846, 127847, 
+    127848, 127849, 127850, 127851, 127852, 127853, 127854, 127855, 127856, 
+    127857, 127858, 127859, 127860, 127861, 127862, 127863, 127864, 127865, 
+    127866, 127867, 127868, 127869, 127870, 127871, 127872, 127873, 127874, 
+    127875, 127876, 127877, 127878, 127879, 127880, 127881, 127882, 127883, 
+    127884, 127885, 127886, 127887, 127888, 127889, 127890, 127891, 127892, 
+    127893, 127894, 127895, 127896, 127897, 127898, 127899, 127900, 127901, 
+    127902, 127903, 127904, 127905, 127906, 127907, 127908, 127909, 127910, 
+    127911, 127912, 127913, 127914, 127915, 127916, 127917, 127918, 127919, 
+    127920, 127921, 127922, 127923, 127924, 127925, 127926, 127927, 127928, 
+    127929, 127930, 127931, 127932, 127933, 127934, 127935, 127936, 127937, 
+    127938, 127939, 127940, 127941, 127942, 127943, 127944, 127945, 127946, 
+    127947, 127948, 127949, 127950, 127951, 127952, 127953, 127954, 127955, 
+    127956, 127957, 127958, 127959, 127960, 127961, 127962, 127963, 127964, 
+    127965, 127966, 127967, 127968, 127969, 127970, 127971, 127972, 127973, 
+    127974, 127975, 127976, 127977, 127978, 127979, 127980, 127981, 127982, 
+    127983, 127984, 127985, 127986, 127987, 127988, 127989, 127990, 127991, 
+    127992, 127993, 127994, 127995, 127996, 127997, 127998, 127999, 128000, 
+    128001, 128002, 128003, 128004, 128005, 128006, 128007, 128008, 128009, 
+    128010, 128011, 128012, 128013, 128014, 128015, 128016, 128017, 128018, 
+    128019, 128020, 128021, 128022, 128023, 128024, 128025, 128026, 128027, 
+    128028, 128029, 128030, 128031, 128032, 128033, 128034, 128035, 128036, 
+    128037, 128038, 128039, 128040, 128041, 128042, 128043, 128044, 128045, 
+    128046, 128047, 128048, 128049, 128050, 128051, 128052, 128053, 128054, 
+    128055, 128056, 128057, 128058, 128059, 128060, 128061, 128062, 128063, 
+    128064, 128065, 128066, 128067, 128068, 128069, 128070, 128071, 128072, 
+    128073, 128074, 128075, 128076, 128077, 128078, 128079, 128080, 128081, 
+    128082, 128083, 128084, 128085, 128086, 128087, 128088, 128089, 128090, 
+    128091, 128092, 128093, 128094, 128095, 128096, 128097, 128098, 128099, 
+    128100, 128101, 128102, 128103, 128104, 128105, 128106, 128107, 128108, 
+    128109, 128110, 128111, 128112, 128113, 128114, 128115, 128116, 128117, 
+    128118, 128119, 128120, 128121, 128122, 128123, 128124, 128125, 128126, 
+    128127, 128128, 128129, 128130, 128131, 128132, 128133, 128134, 128135, 
+    128136, 128137, 128138, 128139, 128140, 128141, 128142, 128143, 128144, 
+    128145, 128146, 128147, 128148, 128149, 128150, 128151, 128152, 128153, 
+    128154, 128155, 128156, 128157, 128158, 128159, 128160, 128161, 128162, 
+    128163, 128164, 128165, 128166, 128167, 128168, 128169, 128170, 128171, 
+    128172, 128173, 128174, 128175, 128176, 128177, 128178, 128179, 128180, 
+    128181, 128182, 128183, 128184, 128185, 128186, 128187, 128188, 128189, 
+    128190, 128191, 128192, 128193, 128194, 128195, 128196, 128197, 128198, 
+    128199, 128200, 128201, 128202, 128203, 128204, 128205, 128206, 128207, 
+    128208, 128209, 128210, 128211, 128212, 128213, 128214, 128215, 128216, 
+    128217, 128218, 128219, 128220, 128221, 128222, 128223, 128224, 128225, 
+    128226, 128227, 128228, 128229, 128230, 128231, 128232, 128233, 128234, 
+    128235, 128236, 128237, 128238, 128239, 128240, 128241, 128242, 128243, 
+    128244, 128245, 128246, 128247, 128248, 128249, 128250, 128251, 128252, 
+    128253, 128254, 128255, 128256, 128257, 128258, 128259, 128260, 128261, 
+    128262, 128263, 128264, 128265, 128266, 128267, 128268, 128269, 128270, 
+    128271, 128272, 128273, 128274, 128275, 128276, 128277, 128278, 128279, 
+    128280, 128281, 128282, 128283, 128284, 128285, 128286, 128287, 128288, 
+    128289, 128290, 128291, 128292, 128293, 128294, 128295, 128296, 128297, 
+    128298, 128299, 128300, 128301, 128302, 128303, 128304, 128305, 128306, 
+    128307, 128308, 128309, 128310, 128311, 128312, 128313, 128314, 128315, 
+    128316, 128317, 128318, 128319, 128320, 128321, 128322, 128323, 128324, 
+    128325, 128326, 128327, 128328, 128329, 128330, 128331, 128332, 128333, 
+    128334, 128335, 128336, 128337, 128338, 128339, 128340, 128341, 128342, 
+    128343, 128344, 128345, 128346, 128347, 128348, 128349, 128350, 128351, 
+    128352, 128353, 128354, 128355, 128356, 128357, 128358, 128359, 128360, 
+    128361, 128362, 128363, 128364, 128365, 128366, 128367, 128368, 128369, 
+    128370, 128371, 128372, 128373, 128374, 128375, 128376, 128377, 128378, 
+    128379, 128380, 128381, 128382, 128383, 128384, 128385, 128386, 128387, 
+    128388, 128389, 128390, 128391, 128392, 128393, 128394, 128395, 128396, 
+    128397, 128398, 128399, 128400, 128401, 128402, 128403, 128404, 128405, 
+    128406, 128407, 128408, 128409, 128410, 128411, 128412, 128413, 128414, 
+    128415, 128416, 128417, 128418, 128419, 128420, 128421, 128422, 128423, 
+    128424, 128425, 128426, 128427, 128428, 128429, 128430, 128431, 128432, 
+    128433, 128434, 128435, 128436, 128437, 128438, 128439, 128440, 128441, 
+    128442, 128443, 128444, 128445, 128446, 128447, 128448, 128449, 128450, 
+    128451, 128452, 128453, 128454, 128455, 128456, 128457, 128458, 128459, 
+    128460, 128461, 128462, 128463, 128464, 128465, 128466, 128467, 128468, 
+    128469, 128470, 128471, 128472, 128473, 128474, 128475, 128476, 128477, 
+    128478, 128479, 128480, 128481, 128482, 128483, 128484, 128485, 128486, 
+    128487, 128488, 128489, 128490, 128491, 128492, 128493, 128494, 128495, 
+    128496, 128497, 128498, 128499, 128500, 128501, 128502, 128503, 128504, 
+    128505, 128506, 128507, 128508, 128509, 128510, 128511, 128512, 128513, 
+    128514, 128515, 128516, 128517, 128518, 128519, 128520, 128521, 128522, 
+    128523, 128524, 128525, 128526, 128527, 128528, 128529, 128530, 128531, 
+    128532, 128533, 128534, 128535, 128536, 128537, 128538, 128539, 128540, 
+    128541, 128542, 128543, 128544, 128545, 128546, 128547, 128548, 128549, 
+    128550, 128551, 128552, 128553, 128554, 128555, 128556, 128557, 128558, 
+    128559, 128560, 128561, 128562, 128563, 128564, 128565, 128566, 128567, 
+    128568, 128569, 128570, 128571, 128572, 128573, 128574, 128575, 128576, 
+    128577, 128578, 128579, 128580, 128581, 128582, 128583, 128584, 128585, 
+    128586, 128587, 128588, 128589, 128590, 128591, 128592, 128593, 128594, 
+    128595, 128596, 128597, 128598, 128599, 128600, 128601, 128602, 128603, 
+    128604, 128605, 128606, 128607, 128608, 128609, 128610, 128611, 128612, 
+    128613, 128614, 128615, 128616, 128617, 128618, 128619, 128620, 128621, 
+    128622, 128623, 128624, 128625, 128626, 128627, 128628, 128629, 128630, 
+    128631, 128632, 128633, 128634, 128635, 128636, 128637, 128638, 128639, 
+    128640, 128641, 128642, 128643, 128644, 128645, 128646, 128647, 128648, 
+    128649, 128650, 128651, 128652, 128653, 128654, 128655, 128656, 128657, 
+    128658, 128659, 128660, 128661, 128662, 128663, 128664, 128665, 128666, 
+    128667, 128668, 128669, 128670, 128671, 128672, 128673, 128674, 128675, 
+    128676, 128677, 128678, 128679, 128680, 128681, 128682, 128683, 128684, 
+    128685, 128686, 128687, 128688, 128689, 128690, 128691, 128692, 128693, 
+    128694, 128695, 128696, 128697, 128698, 128699, 128700, 128701, 128702, 
+    128703, 128704, 128705, 128706, 128707, 128708, 128709, 128710, 128711, 
+    128712, 128713, 128714, 128715, 128716, 128717, 128718, 128719, 128720, 
+    128721, 128722, 128723, 128724, 128725, 128726, 128727, 128728, 128729, 
+    128730, 128731, 128732, 128733, 128734, 128735, 128736, 128737, 128738, 
+    128739, 128740, 128741, 128742, 128743, 128744, 128745, 128746, 128747, 
+    128748, 128749, 128750, 128751, 128752, 128753, 128754, 128755, 128756, 
+    128757, 128758, 128759, 128760, 128761, 128762, 128763, 128764, 128765, 
+    128766, 128767, 128768, 128769, 128770, 128771, 128772, 128773, 128774, 
+    128775, 128776, 128777, 128778, 128779, 128780, 128781, 128782, 128783, 
+    128784, 128785, 128786, 128787, 128788, 128789, 128790, 128791, 128792, 
+    128793, 128794, 128795, 128796, 128797, 128798, 128799, 128800, 128801, 
+    128802, 128803, 128804, 128805, 128806, 128807, 128808, 128809, 128810, 
+    128811, 128812, 128813, 128814, 128815, 128816, 128817, 128818, 128819, 
+    128820, 128821, 128822, 128823, 128824, 128825, 128826, 128827, 128828, 
+    128829, 128830, 128831, 128832, 128833, 128834, 128835, 128836, 128837, 
+    128838, 128839, 128840, 128841, 128842, 128843, 128844, 128845, 128846, 
+    128847, 128848, 128849, 128850, 128851, 128852, 128853, 128854, 128855, 
+    128856, 128857, 128858, 128859, 128860, 128861, 128862, 128863, 128864, 
+    128865, 128866, 128867, 128868, 128869, 128870, 128871, 128872, 128873, 
+    128874, 128875, 128876, 128877, 128878, 128879, 128880, 128881, 128882, 
+    128883, 128884, 128885, 128886, 128887, 128888, 128889, 128890, 128891, 
+    128892, 128893, 128894, 128895, 128896, 128897, 128898, 128899, 128900, 
+    128901, 128902, 128903, 128904, 128905, 128906, 128907, 128908, 128909, 
+    128910, 128911, 128912, 128913, 128914, 128915, 128916, 128917, 128918, 
+    128919, 128920, 128921, 128922, 128923, 128924, 128925, 128926, 128927, 
+    128928, 128929, 128930, 128931, 128932, 128933, 128934, 128935, 128936, 
+    128937, 128938, 128939, 128940, 128941, 128942, 128943, 128944, 128945, 
+    128946, 128947, 128948, 128949, 128950, 128951, 128952, 128953, 128954, 
+    128955, 128956, 128957, 128958, 128959, 128960, 128961, 128962, 128963, 
+    128964, 128965, 128966, 128967, 128968, 128969, 128970, 128971, 128972, 
+    128973, 128974, 128975, 128976, 128977, 128978, 128979, 128980, 128981, 
+    128982, 128983, 128984, 128985, 128986, 128987, 128988, 128989, 128990, 
+    128991, 128992, 128993, 128994, 128995, 128996, 128997, 128998, 128999, 
+    129000, 129001, 129002, 129003, 129004, 129005, 129006, 129007, 129008, 
+    129009, 129010, 129011, 129012, 129013, 129014, 129015, 129016, 129017, 
+    129018, 129019, 129020, 129021, 129022, 129023, 129024, 129025, 129026, 
+    129027, 129028, 129029, 129030, 129031, 129032, 129033, 129034, 129035, 
+    129036, 129037, 129038, 129039, 129040, 129041, 129042, 129043, 129044, 
+    129045, 129046, 129047, 129048, 129049, 129050, 129051, 129052, 129053, 
+    129054, 129055, 129056, 129057, 129058, 129059, 129060, 129061, 129062, 
+    129063, 129064, 129065, 129066, 129067, 129068, 129069, 129070, 129071, 
+    129072, 129073, 129074, 129075, 129076, 129077, 129078, 129079, 129080, 
+    129081, 129082, 129083, 129084, 129085, 129086, 129087, 129088, 129089, 
+    129090, 129091, 129092, 129093, 129094, 129095, 129096, 129097, 129098, 
+    129099, 129100, 129101, 129102, 129103, 129104, 129105, 129106, 129107, 
+    129108, 129109, 129110, 129111, 129112, 129113, 129114, 129115, 129116, 
+    129117, 129118, 129119, 129120, 129121, 129122, 129123, 129124, 129125, 
+    129126, 129127, 129128, 129129, 129130, 129131, 129132, 129133, 129134, 
+    129135, 129136, 129137, 129138, 129139, 129140, 129141, 129142, 129143, 
+    129144, 129145, 129146, 129147, 129148, 129149, 129150, 129151, 129152, 
+    129153, 129154, 129155, 129156, 129157, 129158, 129159, 129160, 129161, 
+    129162, 129163, 129164, 129165, 129166, 129167, 129168, 129169, 129170, 
+    129171, 129172, 129173, 129174, 129175, 129176, 129177, 129178, 129179, 
+    129180, 129181, 129182, 129183, 129184, 129185, 129186, 129187, 129188, 
+    129189, 129190, 129191, 129192, 129193, 129194, 129195, 129196, 129197, 
+    129198, 129199, 129200, 129201, 129202, 129203, 129204, 129205, 129206, 
+    129207, 129208, 129209, 129210, 129211, 129212, 129213, 129214, 129215, 
+    129216, 129217, 129218, 129219, 129220, 129221, 129222, 129223, 129224, 
+    129225, 129226, 129227, 129228, 129229, 129230, 129231, 129232, 129233, 
+    129234, 129235, 129236, 129237, 129238, 129239, 129240, 129241, 129242, 
+    129243, 129244, 129245, 129246, 129247, 129248, 129249, 129250, 129251, 
+    129252, 129253, 129254, 129255, 129256, 129257, 129258, 129259, 129260, 
+    129261, 129262, 129263, 129264, 129265, 129266, 129267, 129268, 129269, 
+    129270, 129271, 129272, 129273, 129274, 129275, 129276, 129277, 129278, 
+    129279, 129280, 129281, 129282, 129283, 129284, 129285, 129286, 129287, 
+    129288, 129289, 129290, 129291, 129292, 129293, 129294, 129295, 129296, 
+    129297, 129298, 129299, 129300, 129301, 129302, 129303, 129304, 129305, 
+    129306, 129307, 129308, 129309, 129310, 129311, 129312, 129313, 129314, 
+    129315, 129316, 129317, 129318, 129319, 129320, 129321, 129322, 129323, 
+    129324, 129325, 129326, 129327, 129328, 129329, 129330, 129331, 129332, 
+    129333, 129334, 129335, 129336, 129337, 129338, 129339, 129340, 129341, 
+    129342, 129343, 129344, 129345, 129346, 129347, 129348, 129349, 129350, 
+    129351, 129352, 129353, 129354, 129355, 129356, 129357, 129358, 129359, 
+    129360, 129361, 129362, 129363, 129364, 129365, 129366, 129367, 129368, 
+    129369, 129370, 129371, 129372, 129373, 129374, 129375, 129376, 129377, 
+    129378, 129379, 129380, 129381, 129382, 129383, 129384, 129385, 129386, 
+    129387, 129388, 129389, 129390, 129391, 129392, 129393, 129394, 129395, 
+    129396, 129397, 129398, 129399, 129400, 129401, 129402, 129403, 129404, 
+    129405, 129406, 129407, 129408, 129409, 129410, 129411, 129412, 129413, 
+    129414, 129415, 129416, 129417, 129418, 129419, 129420, 129421, 129422, 
+    129423, 129424, 129425, 129426, 129427, 129428, 129429, 129430, 129431, 
+    129432, 129433, 129434, 129435, 129436, 129437, 129438, 129439, 129440, 
+    129441, 129442, 129443, 129444, 129445, 129446, 129447, 129448, 129449, 
+    129450, 129451, 129452, 129453, 129454, 129455, 129456, 129457, 129458, 
+    129459, 129460, 129461, 129462, 129463, 129464, 129465, 129466, 129467, 
+    129468, 129469, 129470, 129471, 129472, 129473, 129474, 129475, 129476, 
+    129477, 129478, 129479, 129480, 129481, 129482, 129483, 129484, 129485, 
+    129486, 129487, 129488, 129489, 129490, 129491, 129492, 129493, 129494, 
+    129495, 129496, 129497, 129498, 129499, 129500, 129501, 129502, 129503, 
+    129504, 129505, 129506, 129507, 129508, 129509, 129510, 129511, 129512, 
+    129513, 129514, 129515, 129516, 129517, 129518, 129519, 129520, 129521, 
+    129522, 129523, 129524, 129525, 129526, 129527, 129528, 129529, 129530, 
+    129531, 129532, 129533, 129534, 129535, 129536, 129537, 129538, 129539, 
+    129540, 129541, 129542, 129543, 129544, 129545, 129546, 129547, 129548, 
+    129549, 129550, 129551, 129552, 129553, 129554, 129555, 129556, 129557, 
+    129558, 129559, 129560, 129561, 129562, 129563, 129564, 129565, 129566, 
+    129567, 129568, 129569, 129570, 129571, 129572, 129573, 129574, 129575, 
+    129576, 129577, 129578, 129579, 129580, 129581, 129582, 129583, 129584, 
+    129585, 129586, 129587, 129588, 129589, 129590, 129591, 129592, 129593, 
+    129594, 129595, 129596, 129597, 129598, 129599, 129600, 129601, 129602, 
+    129603, 129604, 129605, 129606, 129607, 129608, 129609, 129610, 129611, 
+    129612, 129613, 129614, 129615, 129616, 129617, 129618, 129619, 129620, 
+    129621, 129622, 129623, 129624, 129625, 129626, 129627, 129628, 129629, 
+    129630, 129631, 129632, 129633, 129634, 129635, 129636, 129637, 129638, 
+    129639, 129640, 129641, 129642, 129643, 129644, 129645, 129646, 129647, 
+    129648, 129649, 129650, 129651, 129652, 129653, 129654, 129655, 129656, 
+    129657, 129658, 129659, 129660, 129661, 129662, 129663, 129664, 129665, 
+    129666, 129667, 129668, 129669, 129670, 129671, 129672, 129673, 129674, 
+    129675, 129676, 129677, 129678, 129679, 129680, 129681, 129682, 129683, 
+    129684, 129685, 129686, 129687, 129688, 129689, 129690, 129691, 129692, 
+    129693, 129694, 129695, 129696, 129697, 129698, 129699, 129700, 129701, 
+    129702, 129703, 129704, 129705, 129706, 129707, 129708, 129709, 129710, 
+    129711, 129712, 129713, 129714, 129715, 129716, 129717, 129718, 129719, 
+    129720, 129721, 129722, 129723, 129724, 129725, 129726, 129727, 129728, 
+    129729, 129730, 129731, 129732, 129733, 129734, 129735, 129736, 129737, 
+    129738, 129739, 129740, 129741, 129742, 129743, 129744, 129745, 129746, 
+    129747, 129748, 129749, 129750, 129751, 129752, 129753, 129754, 129755, 
+    129756, 129757, 129758, 129759, 129760, 129761, 129762, 129763, 129764, 
+    129765, 129766, 129767, 129768, 129769, 129770, 129771, 129772, 129773, 
+    129774, 129775, 129776, 129777, 129778, 129779, 129780, 129781, 129782, 
+    129783, 129784, 129785, 129786, 129787, 129788, 129789, 129790, 129791, 
+    129792, 129793, 129794, 129795, 129796, 129797, 129798, 129799, 129800, 
+    129801, 129802, 129803, 129804, 129805, 129806, 129807, 129808, 129809, 
+    129810, 129811, 129812, 129813, 129814, 129815, 129816, 129817, 129818, 
+    129819, 129820, 129821, 129822, 129823, 129824, 129825, 129826, 129827, 
+    129828, 129829, 129830, 129831, 129832, 129833, 129834, 129835, 129836, 
+    129837, 129838, 129839, 129840, 129841, 129842, 129843, 129844, 129845, 
+    129846, 129847, 129848, 129849, 129850, 129851, 129852, 129853, 129854, 
+    129855, 129856, 129857, 129858, 129859, 129860, 129861, 129862, 129863, 
+    129864, 129865, 129866, 129867, 129868, 129869, 129870, 129871, 129872, 
+    129873, 129874, 129875, 129876, 129877, 129878, 129879, 129880, 129881, 
+    129882, 129883, 129884, 129885, 129886, 129887, 129888, 129889, 129890, 
+    129891, 129892, 129893, 129894, 129895, 129896, 129897, 129898, 129899, 
+    129900, 129901, 129902, 129903, 129904, 129905, 129906, 129907, 129908, 
+    129909, 129910, 129911, 129912, 129913, 129914, 129915, 129916, 129917, 
+    129918, 129919, 129920, 129921, 129922, 129923, 129924, 129925, 129926, 
+    129927, 129928, 129929, 129930, 129931, 129932, 129933, 129934, 129935, 
+    129936, 129937, 129938, 129939, 129940, 129941, 129942, 129943, 129944, 
+    129945, 129946, 129947, 129948, 129949, 129950, 129951, 129952, 129953, 
+    129954, 129955, 129956, 129957, 129958, 129959, 129960, 129961, 129962, 
+    129963, 129964, 129965, 129966, 129967, 129968, 129969, 129970, 129971, 
+    129972, 129973, 129974, 129975, 129976, 129977, 129978, 129979, 129980, 
+    129981, 129982, 129983, 129984, 129985, 129986, 129987, 129988, 129989, 
+    129990, 129991, 129992, 129993, 129994, 129995, 129996, 129997, 129998, 
+    129999, 130000, 130001, 130002, 130003, 130004, 130005, 130006, 130007, 
+    130008, 130009, 130010, 130011, 130012, 130013, 130014, 130015, 130016, 
+    130017, 130018, 130019, 130020, 130021, 130022, 130023, 130024, 130025, 
+    130026, 130027, 130028, 130029, 130030, 130031, 130032, 130033, 130034, 
+    130035, 130036, 130037, 130038, 130039, 130040, 130041, 130042, 130043, 
+    130044, 130045, 130046, 130047, 130048, 130049, 130050, 130051, 130052, 
+    130053, 130054, 130055, 130056, 130057, 130058, 130059, 130060, 130061, 
+    130062, 130063, 130064, 130065, 130066, 130067, 130068, 130069, 130070, 
+    130071, 130072, 130073, 130074, 130075, 130076, 130077, 130078, 130079, 
+    130080, 130081, 130082, 130083, 130084, 130085, 130086, 130087, 130088, 
+    130089, 130090, 130091, 130092, 130093, 130094, 130095, 130096, 130097, 
+    130098, 130099, 130100, 130101, 130102, 130103, 130104, 130105, 130106, 
+    130107, 130108, 130109, 130110, 130111, 130112, 130113, 130114, 130115, 
+    130116, 130117, 130118, 130119, 130120, 130121, 130122, 130123, 130124, 
+    130125, 130126, 130127, 130128, 130129, 130130, 130131, 130132, 130133, 
+    130134, 130135, 130136, 130137, 130138, 130139, 130140, 130141, 130142, 
+    130143, 130144, 130145, 130146, 130147, 130148, 130149, 130150, 130151, 
+    130152, 130153, 130154, 130155, 130156, 130157, 130158, 130159, 130160, 
+    130161, 130162, 130163, 130164, 130165, 130166, 130167, 130168, 130169, 
+    130170, 130171, 130172, 130173, 130174, 130175, 130176, 130177, 130178, 
+    130179, 130180, 130181, 130182, 130183, 130184, 130185, 130186, 130187, 
+    130188, 130189, 130190, 130191, 130192, 130193, 130194, 130195, 130196, 
+    130197, 130198, 130199, 130200, 130201, 130202, 130203, 130204, 130205, 
+    130206, 130207, 130208, 130209, 130210, 130211, 130212, 130213, 130214, 
+    130215, 130216, 130217, 130218, 130219, 130220, 130221, 130222, 130223, 
+    130224, 130225, 130226, 130227, 130228, 130229, 130230, 130231, 130232, 
+    130233, 130234, 130235, 130236, 130237, 130238, 130239, 130240, 130241, 
+    130242, 130243, 130244, 130245, 130246, 130247, 130248, 130249, 130250, 
+    130251, 130252, 130253, 130254, 130255, 130256, 130257, 130258, 130259, 
+    130260, 130261, 130262, 130263, 130264, 130265, 130266, 130267, 130268, 
+    130269, 130270, 130271, 130272, 130273, 130274, 130275, 130276, 130277, 
+    130278, 130279, 130280, 130281, 130282, 130283, 130284, 130285, 130286, 
+    130287, 130288, 130289, 130290, 130291, 130292, 130293, 130294, 130295, 
+    130296, 130297, 130298, 130299, 130300, 130301, 130302, 130303, 130304, 
+    130305, 130306, 130307, 130308, 130309, 130310, 130311, 130312, 130313, 
+    130314, 130315, 130316, 130317, 130318, 130319, 130320, 130321, 130322, 
+    130323, 130324, 130325, 130326, 130327, 130328, 130329, 130330, 130331, 
+    130332, 130333, 130334, 130335, 130336, 130337, 130338, 130339, 130340, 
+    130341, 130342, 130343, 130344, 130345, 130346, 130347, 130348, 130349, 
+    130350, 130351, 130352, 130353, 130354, 130355, 130356, 130357, 130358, 
+    130359, 130360, 130361, 130362, 130363, 130364, 130365, 130366, 130367, 
+    130368, 130369, 130370, 130371, 130372, 130373, 130374, 130375, 130376, 
+    130377, 130378, 130379, 130380, 130381, 130382, 130383, 130384, 130385, 
+    130386, 130387, 130388, 130389, 130390, 130391, 130392, 130393, 130394, 
+    130395, 130396, 130397, 130398, 130399, 130400, 130401, 130402, 130403, 
+    130404, 130405, 130406, 130407, 130408, 130409, 130410, 130411, 130412, 
+    130413, 130414, 130415, 130416, 130417, 130418, 130419, 130420, 130421, 
+    130422, 130423, 130424, 130425, 130426, 130427, 130428, 130429, 130430, 
+    130431, 130432, 130433, 130434, 130435, 130436, 130437, 130438, 130439, 
+    130440, 130441, 130442, 130443, 130444, 130445, 130446, 130447, 130448, 
+    130449, 130450, 130451, 130452, 130453, 130454, 130455, 130456, 130457, 
+    130458, 130459, 130460, 130461, 130462, 130463, 130464, 130465, 130466, 
+    130467, 130468, 130469, 130470, 130471, 130472, 130473, 130474, 130475, 
+    130476, 130477, 130478, 130479, 130480, 130481, 130482, 130483, 130484, 
+    130485, 130486, 130487, 130488, 130489, 130490, 130491, 130492, 130493, 
+    130494, 130495, 130496, 130497, 130498, 130499, 130500, 130501, 130502, 
+    130503, 130504, 130505, 130506, 130507, 130508, 130509, 130510, 130511, 
+    130512, 130513, 130514, 130515, 130516, 130517, 130518, 130519, 130520, 
+    130521, 130522, 130523, 130524, 130525, 130526, 130527, 130528, 130529, 
+    130530, 130531, 130532, 130533, 130534, 130535, 130536, 130537, 130538, 
+    130539, 130540, 130541, 130542, 130543, 130544, 130545, 130546, 130547, 
+    130548, 130549, 130550, 130551, 130552, 130553, 130554, 130555, 130556, 
+    130557, 130558, 130559, 130560, 130561, 130562, 130563, 130564, 130565, 
+    130566, 130567, 130568, 130569, 130570, 130571, 130572, 130573, 130574, 
+    130575, 130576, 130577, 130578, 130579, 130580, 130581, 130582, 130583, 
+    130584, 130585, 130586, 130587, 130588, 130589, 130590, 130591, 130592, 
+    130593, 130594, 130595, 130596, 130597, 130598, 130599, 130600, 130601, 
+    130602, 130603, 130604, 130605, 130606, 130607, 130608, 130609, 130610, 
+    130611, 130612, 130613, 130614, 130615, 130616, 130617, 130618, 130619, 
+    130620, 130621, 130622, 130623, 130624, 130625, 130626, 130627, 130628, 
+    130629, 130630, 130631, 130632, 130633, 130634, 130635, 130636, 130637, 
+    130638, 130639, 130640, 130641, 130642, 130643, 130644, 130645, 130646, 
+    130647, 130648, 130649, 130650, 130651, 130652, 130653, 130654, 130655, 
+    130656, 130657, 130658, 130659, 130660, 130661, 130662, 130663, 130664, 
+    130665, 130666, 130667, 130668, 130669, 130670, 130671, 130672, 130673, 
+    130674, 130675, 130676, 130677, 130678, 130679, 130680, 130681, 130682, 
+    130683, 130684, 130685, 130686, 130687, 130688, 130689, 130690, 130691, 
+    130692, 130693, 130694, 130695, 130696, 130697, 130698, 130699, 130700, 
+    130701, 130702, 130703, 130704, 130705, 130706, 130707, 130708, 130709, 
+    130710, 130711, 130712, 130713, 130714, 130715, 130716, 130717, 130718, 
+    130719, 130720, 130721, 130722, 130723, 130724, 130725, 130726, 130727, 
+    130728, 130729, 130730, 130731, 130732, 130733, 130734, 130735, 130736, 
+    130737, 130738, 130739, 130740, 130741, 130742, 130743, 130744, 130745, 
+    130746, 130747, 130748, 130749, 130750, 130751, 130752, 130753, 130754, 
+    130755, 130756, 130757, 130758, 130759, 130760, 130761, 130762, 130763, 
+    130764, 130765, 130766, 130767, 130768, 130769, 130770, 130771, 130772, 
+    130773, 130774, 130775, 130776, 130777, 130778, 130779, 130780, 130781, 
+    130782, 130783, 130784, 130785, 130786, 130787, 130788, 130789, 130790, 
+    130791, 130792, 130793, 130794, 130795, 130796, 130797, 130798, 130799, 
+    130800, 130801, 130802, 130803, 130804, 130805, 130806, 130807, 130808, 
+    130809, 130810, 130811, 130812, 130813, 130814, 130815, 130816, 130817, 
+    130818, 130819, 130820, 130821, 130822, 130823, 130824, 130825, 130826, 
+    130827, 130828, 130829, 130830, 130831, 130832, 130833, 130834, 130835, 
+    130836, 130837, 130838, 130839, 130840, 130841, 130842, 130843, 130844, 
+    130845, 130846, 130847, 130848, 130849, 130850, 130851, 130852, 130853, 
+    130854, 130855, 130856, 130857, 130858, 130859, 130860, 130861, 130862, 
+    130863, 130864, 130865, 130866, 130867, 130868, 130869, 130870, 130871, 
+    130872, 130873, 130874, 130875, 130876, 130877, 130878, 130879, 130880, 
+    130881, 130882, 130883, 130884, 130885, 130886, 130887, 130888, 130889, 
+    130890, 130891, 130892, 130893, 130894, 130895, 130896, 130897, 130898, 
+    130899, 130900, 130901, 130902, 130903, 130904, 130905, 130906, 130907, 
+    130908, 130909, 130910, 130911, 130912, 130913, 130914, 130915, 130916, 
+    130917, 130918, 130919, 130920, 130921, 130922, 130923, 130924, 130925, 
+    130926, 130927, 130928, 130929, 130930, 130931, 130932, 130933, 130934, 
+    130935, 130936, 130937, 130938, 130939, 130940, 130941, 130942, 130943, 
+    130944, 130945, 130946, 130947, 130948, 130949, 130950, 130951, 130952, 
+    130953, 130954, 130955, 130956, 130957, 130958, 130959, 130960, 130961, 
+    130962, 130963, 130964, 130965, 130966, 130967, 130968, 130969, 130970, 
+    130971, 130972, 130973, 130974, 130975, 130976, 130977, 130978, 130979, 
+    130980, 130981, 130982, 130983, 130984, 130985, 130986, 130987, 130988, 
+    130989, 130990, 130991, 130992, 130993, 130994, 130995, 130996, 130997, 
+    130998, 130999, 131000, 131001, 131002, 131003, 131004, 131005, 131006, 
+    131007, 131008, 131009, 131010, 131011, 131012, 131013, 131014, 131015, 
+    131016, 131017, 131018, 131019, 131020, 131021, 131022, 131023, 131024, 
+    131025, 131026, 131027, 131028, 131029, 131030, 131031, 131032, 131033, 
+    131034, 131035, 131036, 131037, 131038, 131039, 131040, 131041, 131042, 
+    131043, 131044, 131045, 131046, 131047, 131048, 131049, 131050, 131051, 
+    131052, 131053, 131054, 131055, 131056, 131057, 131058, 131059, 131060, 
+    131061, 131062, 131063, 131064, 131065, 131066, 131067, 131068, 131069, 
+    131070, 131071, 131072, 131073, 131074, 131075, 131076, 131077, 131078, 
+    131079, 131080, 131081, 131082, 131083, 131084, 131085, 131086, 131087, 
+    131088, 131089, 131090, 131091, 131092, 131093, 131094, 131095, 131096, 
+    131097, 131098, 131099, 131100, 131101, 131102, 131103, 131104, 131105, 
+    131106, 131107, 131108, 131109, 131110, 131111, 131112, 131113, 131114, 
+    131115, 131116, 131117, 131118, 131119, 131120, 131121, 131122, 131123, 
+    131124, 131125, 131126, 131127, 131128, 131129, 131130, 131131, 131132, 
+    131133, 131134, 131135, 131136, 131137, 131138, 131139, 131140, 131141, 
+    131142, 131143, 131144, 131145, 131146, 131147, 131148, 131149, 131150, 
+    131151, 131152, 131153, 131154, 131155, 131156, 131157, 131158, 131159, 
+    131160, 131161, 131162, 131163, 131164, 131165, 131166, 131167, 131168, 
+    131169, 131170, 131171, 131172, 131173, 131174, 131175, 131176, 131177, 
+    131178, 131179, 131180, 131181, 131182, 131183, 131184, 131185, 131186, 
+    131187, 131188, 131189, 131190, 131191, 131192, 131193, 131194, 131195, 
+    131196, 131197, 131198, 131199, 131200, 131201, 131202, 131203, 131204, 
+    131205, 131206, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 
+    131214, 131215, 131216, 131217, 131218, 131219, 131220, 131221, 131222, 
+    131223, 131224, 131225, 131226, 131227, 131228, 131229, 131230, 131231, 
+    131232, 131233, 131234, 131235, 131236, 131237, 131238, 131239, 131240, 
+    131241, 131242, 131243, 131244, 131245, 131246, 131247, 131248, 131249, 
+    131250, 131251, 131252, 131253, 131254, 131255, 131256, 131257, 131258, 
+    131259, 131260, 131261, 131262, 131263, 131264, 131265, 131266, 131267, 
+    131268, 131269, 131270, 131271, 131272, 131273, 131274, 131275, 131276, 
+    131277, 131278, 131279, 131280, 131281, 131282, 131283, 131284, 131285, 
+    131286, 131287, 131288, 131289, 131290, 131291, 131292, 131293, 131294, 
+    131295, 131296, 131297, 131298, 131299, 131300, 131301, 131302, 131303, 
+    131304, 131305, 131306, 131307, 131308, 131309, 131310, 131311, 131312, 
+    131313, 131314, 131315, 131316, 131317, 131318, 131319, 131320, 131321, 
+    131322, 131323, 131324, 131325, 131326, 131327, 131328, 131329, 131330, 
+    131331, 131332, 131333, 131334, 131335, 131336, 131337, 131338, 131339, 
+    131340, 131341, 131342, 131343, 131344, 131345, 131346, 131347, 131348, 
+    131349, 131350, 131351, 131352, 131353, 131354, 131355, 131356, 131357, 
+    131358, 131359, 131360, 131361, 131362, 131363, 131364, 131365, 131366, 
+    131367, 131368, 131369, 131370, 131371, 131372, 131373, 131374, 131375, 
+    131376, 131377, 131378, 131379, 131380, 131381, 131382, 131383, 131384, 
+    131385, 131386, 131387, 131388, 131389, 131390, 131391, 131392, 131393, 
+    131394, 131395, 131396, 131397, 131398, 131399, 131400, 131401, 131402, 
+    131403, 131404, 131405, 131406, 131407, 131408, 131409, 131410, 131411, 
+    131412, 131413, 131414, 131415, 131416, 131417, 131418, 131419, 131420, 
+    131421, 131422, 131423, 131424, 131425, 131426, 131427, 131428, 131429, 
+    131430, 131431, 131432, 131433, 131434, 131435, 131436, 131437, 131438, 
+    131439, 131440, 131441, 131442, 131443, 131444, 131445, 131446, 131447, 
+    131448, 131449, 131450, 131451, 131452, 131453, 131454, 131455, 131456, 
+    131457, 131458, 131459, 131460, 131461, 131462, 131463, 131464, 131465, 
+    131466, 131467, 131468, 131469, 131470, 131471, 131472, 131473, 131474, 
+    131475, 131476, 131477, 131478, 131479, 131480, 131481, 131482, 131483, 
+    131484, 131485, 131486, 131487, 131488, 131489, 131490, 131491, 131492, 
+    131493, 131494, 131495, 131496, 131497, 131498, 131499, 131500, 131501, 
+    131502, 131503, 131504, 131505, 131506, 131507, 131508, 131509, 131510, 
+    131511, 131512, 131513, 131514, 131515, 131516, 131517, 131518, 131519, 
+    131520, 131521, 131522, 131523, 131524, 131525, 131526, 131527, 131528, 
+    131529, 131530, 131531, 131532, 131533, 131534, 131535, 131536, 131537, 
+    131538, 131539, 131540, 131541, 131542, 131543, 131544, 131545, 131546, 
+    131547, 131548, 131549, 131550, 131551, 131552, 131553, 131554, 131555, 
+    131556, 131557, 131558, 131559, 131560, 131561, 131562, 131563, 131564, 
+    131565, 131566, 131567, 131568, 131569, 131570, 131571, 131572, 131573, 
+    131574, 131575, 131576, 131577, 131578, 131579, 131580, 131581, 131582, 
+    131583, 131584, 131585, 131586, 131587, 131588, 131589, 131590, 131591, 
+    131592, 131593, 131594, 131595, 131596, 131597, 131598, 131599, 131600, 
+    131601, 131602, 131603, 131604, 131605, 131606, 131607, 131608, 131609, 
+    131610, 131611, 131612, 131613, 131614, 131615, 131616, 131617, 131618, 
+    131619, 131620, 131621, 131622, 131623, 131624, 131625, 131626, 131627, 
+    131628, 131629, 131630, 131631, 131632, 131633, 131634, 131635, 131636, 
+    131637, 131638, 131639, 131640, 131641, 131642, 131643, 131644, 131645, 
+    131646, 131647, 131648, 131649, 131650, 131651, 131652, 131653, 131654, 
+    131655, 131656, 131657, 131658, 131659, 131660, 131661, 131662, 131663, 
+    131664, 131665, 131666, 131667, 131668, 131669, 131670, 131671, 131672, 
+    131673, 131674, 131675, 131676, 131677, 131678, 131679, 131680, 131681, 
+    131682, 131683, 131684, 131685, 131686, 131687, 131688, 131689, 131690, 
+    131691, 131692, 131693, 131694, 131695, 131696, 131697, 131698, 131699, 
+    131700, 131701, 131702, 131703, 131704, 131705, 131706, 131707, 131708, 
+    131709, 131710, 131711, 131712, 131713, 131714, 131715, 131716, 131717, 
+    131718, 131719, 131720, 131721, 131722, 131723, 131724, 131725, 131726, 
+    131727, 131728, 131729, 131730, 131731, 131732, 131733, 131734, 131735, 
+    131736, 131737, 131738, 131739, 131740, 131741, 131742, 131743, 131744, 
+    131745, 131746, 131747, 131748, 131749, 131750, 131751, 131752, 131753, 
+    131754, 131755, 131756, 131757, 131758, 131759, 131760, 131761, 131762, 
+    131763, 131764, 131765, 131766, 131767, 131768, 131769, 131770, 131771, 
+    131772, 131773, 131774, 131775, 131776, 131777, 131778, 131779, 131780, 
+    131781, 131782, 131783, 131784, 131785, 131786, 131787, 131788, 131789, 
+    131790, 131791, 131792, 131793, 131794, 131795, 131796, 131797, 131798, 
+    131799, 131800, 131801, 131802, 131803, 131804, 131805, 131806, 131807, 
+    131808, 131809, 131810, 131811, 131812, 131813, 131814, 131815, 131816, 
+    131817, 131818, 131819, 131820, 131821, 131822, 131823, 131824, 131825, 
+    131826, 131827, 131828, 131829, 131830, 131831, 131832, 131833, 131834, 
+    131835, 131836, 131837, 131838, 131839, 131840, 131841, 131842, 131843, 
+    131844, 131845, 131846, 131847, 131848, 131849, 131850, 131851, 131852, 
+    131853, 131854, 131855, 131856, 131857, 131858, 131859, 131860, 131861, 
+    131862, 131863, 131864, 131865, 131866, 131867, 131868, 131869, 131870, 
+    131871, 131872, 131873, 131874, 131875, 131876, 131877, 131878, 131879, 
+    131880, 131881, 131882, 131883, 131884, 131885, 131886, 131887, 131888, 
+    131889, 131890, 131891, 131892, 131893, 131894, 131895, 131896, 131897, 
+    131898, 131899, 131900, 131901, 131902, 131903, 131904, 131905, 131906, 
+    131907, 131908, 131909, 131910, 131911, 131912, 131913, 131914, 131915, 
+    131916, 131917, 131918, 131919, 131920, 131921, 131922, 131923, 131924, 
+    131925, 131926, 131927, 131928, 131929, 131930, 131931, 131932, 131933, 
+    131934, 131935, 131936, 131937, 131938, 131939, 131940, 131941, 131942, 
+    131943, 131944, 131945, 131946, 131947, 131948, 131949, 131950, 131951, 
+    131952, 131953, 131954, 131955, 131956, 131957, 131958, 131959, 131960, 
+    131961, 131962, 131963, 131964, 131965, 131966, 131967, 131968, 131969, 
+    131970, 131971, 131972, 131973, 131974, 131975, 131976, 131977, 131978, 
+    131979, 131980, 131981, 131982, 131983, 131984, 131985, 131986, 131987, 
+    131988, 131989, 131990, 131991, 131992, 131993, 131994, 131995, 131996, 
+    131997, 131998, 131999, 132000, 132001, 132002, 132003, 132004, 132005, 
+    132006, 132007, 132008, 132009, 132010, 132011, 132012, 132013, 132014, 
+    132015, 132016, 132017, 132018, 132019, 132020, 132021, 132022, 132023, 
+    132024, 132025, 132026, 132027, 132028, 132029, 132030, 132031, 132032, 
+    132033, 132034, 132035, 132036, 132037, 132038, 132039, 132040, 132041, 
+    132042, 132043, 132044, 132045, 132046, 132047, 132048, 132049, 132050, 
+    132051, 132052, 132053, 132054, 132055, 132056, 132057, 132058, 132059, 
+    132060, 132061, 132062, 132063, 132064, 132065, 132066, 132067, 132068, 
+    132069, 132070, 132071, 132072, 132073, 132074, 132075, 132076, 132077, 
+    132078, 132079, 132080, 132081, 132082, 132083, 132084, 132085, 132086, 
+    132087, 132088, 132089, 132090, 132091, 132092, 132093, 132094, 132095, 
+    132096, 132097, 132098, 132099, 132100, 132101, 132102, 132103, 132104, 
+    132105, 132106, 132107, 132108, 132109, 132110, 132111, 132112, 132113, 
+    132114, 132115, 132116, 132117, 132118, 132119, 132120, 132121, 132122, 
+    132123, 132124, 132125, 132126, 132127, 132128, 132129, 132130, 132131, 
+    132132, 132133, 132134, 132135, 132136, 132137, 132138, 132139, 132140, 
+    132141, 132142, 132143, 132144, 132145, 132146, 132147, 132148, 132149, 
+    132150, 132151, 132152, 132153, 132154, 132155, 132156, 132157, 132158, 
+    132159, 132160, 132161, 132162, 132163, 132164, 132165, 132166, 132167, 
+    132168, 132169, 132170, 132171, 132172, 132173, 132174, 132175, 132176, 
+    132177, 132178, 132179, 132180, 132181, 132182, 132183, 132184, 132185, 
+    132186, 132187, 132188, 132189, 132190, 132191, 132192, 132193, 132194, 
+    132195, 132196, 132197, 132198, 132199, 132200, 132201, 132202, 132203, 
+    132204, 132205, 132206, 132207, 132208, 132209, 132210, 132211, 132212, 
+    132213, 132214, 132215, 132216, 132217, 132218, 132219, 132220, 132221, 
+    132222, 132223, 132224, 132225, 132226, 132227, 132228, 132229, 132230, 
+    132231, 132232, 132233, 132234, 132235, 132236, 132237, 132238, 132239, 
+    132240, 132241, 132242, 132243, 132244, 132245, 132246, 132247, 132248, 
+    132249, 132250, 132251, 132252, 132253, 132254, 132255, 132256, 132257, 
+    132258, 132259, 132260, 132261, 132262, 132263, 132264, 132265, 132266, 
+    132267, 132268, 132269, 132270, 132271, 132272, 132273, 132274, 132275, 
+    132276, 132277, 132278, 132279, 132280, 132281, 132282, 132283, 132284, 
+    132285, 132286, 132287, 132288, 132289, 132290, 132291, 132292, 132293, 
+    132294, 132295, 132296, 132297, 132298, 132299, 132300, 132301, 132302, 
+    132303, 132304, 132305, 132306, 132307, 132308, 132309, 132310, 132311, 
+    132312, 132313, 132314, 132315, 132316, 132317, 132318, 132319, 132320, 
+    132321, 132322, 132323, 132324, 132325, 132326, 132327, 132328, 132329, 
+    132330, 132331, 132332, 132333, 132334, 132335, 132336, 132337, 132338, 
+    132339, 132340, 132341, 132342, 132343, 132344, 132345, 132346, 132347, 
+    132348, 132349, 132350, 132351, 132352, 132353, 132354, 132355, 132356, 
+    132357, 132358, 132359, 132360, 132361, 132362, 132363, 132364, 132365, 
+    132366, 132367, 132368, 132369, 132370, 132371, 132372, 132373, 132374, 
+    132375, 132376, 132377, 132378, 132379, 132380, 132381, 132382, 132383, 
+    132384, 132385, 132386, 132387, 132388, 132389, 132390, 132391, 132392, 
+    132393, 132394, 132395, 132396, 132397, 132398, 132399, 132400, 132401, 
+    132402, 132403, 132404, 132405, 132406, 132407, 132408, 132409, 132410, 
+    132411, 132412, 132413, 132414, 132415, 132416, 132417, 132418, 132419, 
+    132420, 132421, 132422, 132423, 132424, 132425, 132426, 132427, 132428, 
+    132429, 132430, 132431, 132432, 132433, 132434, 132435, 132436, 132437, 
+    132438, 132439, 132440, 132441, 132442, 132443, 132444, 132445, 132446, 
+    132447, 132448, 132449, 132450, 132451, 132452, 132453, 132454, 132455, 
+    132456, 132457, 132458, 132459, 132460, 132461, 132462, 132463, 132464, 
+    132465, 132466, 132467, 132468, 132469, 132470, 132471, 132472, 132473, 
+    132474, 132475, 132476, 132477, 132478, 132479, 132480, 132481, 132482, 
+    132483, 132484, 132485, 132486, 132487, 132488, 132489, 132490, 132491, 
+    132492, 132493, 132494, 132495, 132496, 132497, 132498, 132499, 132500, 
+    132501, 132502, 132503, 132504, 132505, 132506, 132507, 132508, 132509, 
+    132510, 132511, 132512, 132513, 132514, 132515, 132516, 132517, 132518, 
+    132519, 132520, 132521, 132522, 132523, 132524, 132525, 132526, 132527, 
+    132528, 132529, 132530, 132531, 132532, 132533, 132534, 132535, 132536, 
+    132537, 132538, 132539, 132540, 132541, 132542, 132543, 132544, 132545, 
+    132546, 132547, 132548, 132549, 132550, 132551, 132552, 132553, 132554, 
+    132555, 132556, 132557, 132558, 132559, 132560, 132561, 132562, 132563, 
+    132564, 132565, 132566, 132567, 132568, 132569, 132570, 132571, 132572, 
+    132573, 132574, 132575, 132576, 132577, 132578, 132579, 132580, 132581, 
+    132582, 132583, 132584, 132585, 132586, 132587, 132588, 132589, 132590, 
+    132591, 132592, 132593, 132594, 132595, 132596, 132597, 132598, 132599, 
+    132600, 132601, 132602, 132603, 132604, 132605, 132606, 132607, 132608, 
+    132609, 132610, 132611, 132612, 132613, 132614, 132615, 132616, 132617, 
+    132618, 132619, 132620, 132621, 132622, 132623, 132624, 132625, 132626, 
+    132627, 132628, 132629, 132630, 132631, 132632, 132633, 132634, 132635, 
+    132636, 132637, 132638, 132639, 132640, 132641, 132642, 132643, 132644, 
+    132645, 132646, 132647, 132648, 132649, 132650, 132651, 132652, 132653, 
+    132654, 132655, 132656, 132657, 132658, 132659, 132660, 132661, 132662, 
+    132663, 132664, 132665, 132666, 132667, 132668, 132669, 132670, 132671, 
+    132672, 132673, 132674, 132675, 132676, 132677, 132678, 132679, 132680, 
+    132681, 132682, 132683, 132684, 132685, 132686, 132687, 132688, 132689, 
+    132690, 132691, 132692, 132693, 132694, 132695, 132696, 132697, 132698, 
+    132699, 132700, 132701, 132702, 132703, 132704, 132705, 132706, 132707, 
+    132708, 132709, 132710, 132711, 132712, 132713, 132714, 132715, 132716, 
+    132717, 132718, 132719, 132720, 132721, 132722, 132723, 132724, 132725, 
+    132726, 132727, 132728, 132729, 132730, 132731, 132732, 132733, 132734, 
+    132735, 132736, 132737, 132738, 132739, 132740, 132741, 132742, 132743, 
+    132744, 132745, 132746, 132747, 132748, 132749, 132750, 132751, 132752, 
+    132753, 132754, 132755, 132756, 132757, 132758, 132759, 132760, 132761, 
+    132762, 132763, 132764, 132765, 132766, 132767, 132768, 132769, 132770, 
+    132771, 132772, 132773, 132774, 132775, 132776, 132777, 132778, 132779, 
+    132780, 132781, 132782, 132783, 132784, 132785, 132786, 132787, 132788, 
+    132789, 132790, 132791, 132792, 132793, 132794, 132795, 132796, 132797, 
+    132798, 132799, 132800, 132801, 132802, 132803, 132804, 132805, 132806, 
+    132807, 132808, 132809, 132810, 132811, 132812, 132813, 132814, 132815, 
+    132816, 132817, 132818, 132819, 132820, 132821, 132822, 132823, 132824, 
+    132825, 132826, 132827, 132828, 132829, 132830, 132831, 132832, 132833, 
+    132834, 132835, 132836, 132837, 132838, 132839, 132840, 132841, 132842, 
+    132843, 132844, 132845, 132846, 132847, 132848, 132849, 132850, 132851, 
+    132852, 132853, 132854, 132855, 132856, 132857, 132858, 132859, 132860, 
+    132861, 132862, 132863, 132864, 132865, 132866, 132867, 132868, 132869, 
+    132870, 132871, 132872, 132873, 132874, 132875, 132876, 132877, 132878, 
+    132879, 132880, 132881, 132882, 132883, 132884, 132885, 132886, 132887, 
+    132888, 132889, 132890, 132891, 132892, 132893, 132894, 132895, 132896, 
+    132897, 132898, 132899, 132900, 132901, 132902, 132903, 132904, 132905, 
+    132906, 132907, 132908, 132909, 132910, 132911, 132912, 132913, 132914, 
+    132915, 132916, 132917, 132918, 132919, 132920, 132921, 132922, 132923, 
+    132924, 132925, 132926, 132927, 132928, 132929, 132930, 132931, 132932, 
+    132933, 132934, 132935, 132936, 132937, 132938, 132939, 132940, 132941, 
+    132942, 132943, 132944, 132945, 132946, 132947, 132948, 132949, 132950, 
+    132951, 132952, 132953, 132954, 132955, 132956, 132957, 132958, 132959, 
+    132960, 132961, 132962, 132963, 132964, 132965, 132966, 132967, 132968, 
+    132969, 132970, 132971, 132972, 132973, 132974, 132975, 132976, 132977, 
+    132978, 132979, 132980, 132981, 132982, 132983, 132984, 132985, 132986, 
+    132987, 132988, 132989, 132990, 132991, 132992, 132993, 132994, 132995, 
+    132996, 132997, 132998, 132999, 133000, 133001, 133002, 133003, 133004, 
+    133005, 133006, 133007, 133008, 133009, 133010, 133011, 133012, 133013, 
+    133014, 133015, 133016, 133017, 133018, 133019, 133020, 133021, 133022, 
+    133023, 133024, 133025, 133026, 133027, 133028, 133029, 133030, 133031, 
+    133032, 133033, 133034, 133035, 133036, 133037, 133038, 133039, 133040, 
+    133041, 133042, 133043, 133044, 133045, 133046, 133047, 133048, 133049, 
+    133050, 133051, 133052, 133053, 133054, 133055, 133056, 133057, 133058, 
+    133059, 133060, 133061, 133062, 133063, 133064, 133065, 133066, 133067, 
+    133068, 133069, 133070, 133071, 133072, 133073, 133074, 133075, 133076, 
+    133077, 133078, 133079, 133080, 133081, 133082, 133083, 133084, 133085, 
+    133086, 133087, 133088, 133089, 133090, 133091, 133092, 133093, 133094, 
+    133095, 133096, 133097, 133098, 133099, 133100, 133101, 133102, 133103, 
+    133104, 133105, 133106, 133107, 133108, 133109, 133110, 133111, 133112, 
+    133113, 133114, 133115, 133116, 133117, 133118, 133119, 133120, 133121, 
+    133122, 133123, 133124, 133125, 133126, 133127, 133128, 133129, 133130, 
+    133131, 133132, 133133, 133134, 133135, 133136, 133137, 133138, 133139, 
+    133140, 133141, 133142, 133143, 133144, 133145, 133146, 133147, 133148, 
+    133149, 133150, 133151, 133152, 133153, 133154, 133155, 133156, 133157, 
+    133158, 133159, 133160, 133161, 133162, 133163, 133164, 133165, 133166, 
+    133167, 133168, 133169, 133170, 133171, 133172, 133173, 133174, 133175, 
+    133176, 133177, 133178, 133179, 133180, 133181, 133182, 133183, 133184, 
+    133185, 133186, 133187, 133188, 133189, 133190, 133191, 133192, 133193, 
+    133194, 133195, 133196, 133197, 133198, 133199, 133200, 133201, 133202, 
+    133203, 133204, 133205, 133206, 133207, 133208, 133209, 133210, 133211, 
+    133212, 133213, 133214, 133215, 133216, 133217, 133218, 133219, 133220, 
+    133221, 133222, 133223, 133224, 133225, 133226, 133227, 133228, 133229, 
+    133230, 133231, 133232, 133233, 133234, 133235, 133236, 133237, 133238, 
+    133239, 133240, 133241, 133242, 133243, 133244, 133245, 133246, 133247, 
+    133248, 133249, 133250, 133251, 133252, 133253, 133254, 133255, 133256, 
+    133257, 133258, 133259, 133260, 133261, 133262, 133263, 133264, 133265, 
+    133266, 133267, 133268, 133269, 133270, 133271, 133272, 133273, 133274, 
+    133275, 133276, 133277, 133278, 133279, 133280, 133281, 133282, 133283, 
+    133284, 133285, 133286, 133287, 133288, 133289, 133290, 133291, 133292, 
+    133293, 133294, 133295, 133296, 133297, 133298, 133299, 133300, 133301, 
+    133302, 133303, 133304, 133305, 133306, 133307, 133308, 133309, 133310, 
+    133311, 133312, 133313, 133314, 133315, 133316, 133317, 133318, 133319, 
+    133320, 133321, 133322, 133323, 133324, 133325, 133326, 133327, 133328, 
+    133329, 133330, 133331, 133332, 133333, 133334, 133335, 133336, 133337, 
+    133338, 133339, 133340, 133341, 133342, 133343, 133344, 133345, 133346, 
+    133347, 133348, 133349, 133350, 133351, 133352, 133353, 133354, 133355, 
+    133356, 133357, 133358, 133359, 133360, 133361, 133362, 133363, 133364, 
+    133365, 133366, 133367, 133368, 133369, 133370, 133371, 133372, 133373, 
+    133374, 133375, 133376, 133377, 133378, 133379, 133380, 133381, 133382, 
+    133383, 133384, 133385, 133386, 133387, 133388, 133389, 133390, 133391, 
+    133392, 133393, 133394, 133395, 133396, 133397, 133398, 133399, 133400, 
+    133401, 133402, 133403, 133404, 133405, 133406, 133407, 133408, 133409, 
+    133410, 133411, 133412, 133413, 133414, 133415, 133416, 133417, 133418, 
+    133419, 133420, 133421, 133422, 133423, 133424, 133425, 133426, 133427, 
+    133428, 133429, 133430, 133431, 133432, 133433, 133434, 133435, 133436, 
+    133437, 133438, 133439, 133440, 133441, 133442, 133443, 133444, 133445, 
+    133446, 133447, 133448, 133449, 133450, 133451, 133452, 133453, 133454, 
+    133455, 133456, 133457, 133458, 133459, 133460, 133461, 133462, 133463, 
+    133464, 133465, 133466, 133467, 133468, 133469, 133470, 133471, 133472, 
+    133473, 133474, 133475, 133476, 133477, 133478, 133479, 133480, 133481, 
+    133482, 133483, 133484, 133485, 133486, 133487, 133488, 133489, 133490, 
+    133491, 133492, 133493, 133494, 133495, 133496, 133497, 133498, 133499, 
+    133500, 133501, 133502, 133503, 133504, 133505, 133506, 133507, 133508, 
+    133509, 133510, 133511, 133512, 133513, 133514, 133515, 133516, 133517, 
+    133518, 133519, 133520, 133521, 133522, 133523, 133524, 133525, 133526, 
+    133527, 133528, 133529, 133530, 133531, 133532, 133533, 133534, 133535, 
+    133536, 133537, 133538, 133539, 133540, 133541, 133542, 133543, 133544, 
+    133545, 133546, 133547, 133548, 133549, 133550, 133551, 133552, 133553, 
+    133554, 133555, 133556, 133557, 133558, 133559, 133560, 133561, 133562, 
+    133563, 133564, 133565, 133566, 133567, 133568, 133569, 133570, 133571, 
+    133572, 133573, 133574, 133575, 133576, 133577, 133578, 133579, 133580, 
+    133581, 133582, 133583, 133584, 133585, 133586, 133587, 133588, 133589, 
+    133590, 133591, 133592, 133593, 133594, 133595, 133596, 133597, 133598, 
+    133599, 133600, 133601, 133602, 133603, 133604, 133605, 133606, 133607, 
+    133608, 133609, 133610, 133611, 133612, 133613, 133614, 133615, 133616, 
+    133617, 133618, 133619, 133620, 133621, 133622, 133623, 133624, 133625, 
+    133626, 133627, 133628, 133629, 133630, 133631, 133632, 133633, 133634, 
+    133635, 133636, 133637, 133638, 133639, 133640, 133641, 133642, 133643, 
+    133644, 133645, 133646, 133647, 133648, 133649, 133650, 133651, 133652, 
+    133653, 133654, 133655, 133656, 133657, 133658, 133659, 133660, 133661, 
+    133662, 133663, 133664, 133665, 133666, 133667, 133668, 133669, 133670, 
+    133671, 133672, 133673, 133674, 133675, 133676, 133677, 133678, 133679, 
+    133680, 133681, 133682, 133683, 133684, 133685, 133686, 133687, 133688, 
+    133689, 133690, 133691, 133692, 133693, 133694, 133695, 133696, 133697, 
+    133698, 133699, 133700, 133701, 133702, 133703, 133704, 133705, 133706, 
+    133707, 133708, 133709, 133710, 133711, 133712, 133713, 133714, 133715, 
+    133716, 133717, 133718, 133719, 133720, 133721, 133722, 133723, 133724, 
+    133725, 133726, 133727, 133728, 133729, 133730, 133731, 133732, 133733, 
+    133734, 133735, 133736, 133737, 133738, 133739, 133740, 133741, 133742, 
+    133743, 133744, 133745, 133746, 133747, 133748, 133749, 133750, 133751, 
+    133752, 133753, 133754, 133755, 133756, 133757, 133758, 133759, 133760, 
+    133761, 133762, 133763, 133764, 133765, 133766, 133767, 133768, 133769, 
+    133770, 133771, 133772, 133773, 133774, 133775, 133776, 133777, 133778, 
+    133779, 133780, 133781, 133782, 133783, 133784, 133785, 133786, 133787, 
+    133788, 133789, 133790, 133791, 133792, 133793, 133794, 133795, 133796, 
+    133797, 133798, 133799, 133800, 133801, 133802, 133803, 133804, 133805, 
+    133806, 133807, 133808, 133809, 133810, 133811, 133812, 133813, 133814, 
+    133815, 133816, 133817, 133818, 133819, 133820, 133821, 133822, 133823, 
+    133824, 133825, 133826, 133827, 133828, 133829, 133830, 133831, 133832, 
+    133833, 133834, 133835, 133836, 133837, 133838, 133839, 133840, 133841, 
+    133842, 133843, 133844, 133845, 133846, 133847, 133848, 133849, 133850, 
+    133851, 133852, 133853, 133854, 133855, 133856, 133857, 133858, 133859, 
+    133860, 133861, 133862, 133863, 133864, 133865, 133866, 133867, 133868, 
+    133869, 133870, 133871, 133872, 133873, 133874, 133875, 133876, 133877, 
+    133878, 133879, 133880, 133881, 133882, 133883, 133884, 133885, 133886, 
+    133887, 133888, 133889, 133890, 133891, 133892, 133893, 133894, 133895, 
+    133896, 133897, 133898, 133899, 133900, 133901, 133902, 133903, 133904, 
+    133905, 133906, 133907, 133908, 133909, 133910, 133911, 133912, 133913, 
+    133914, 133915, 133916, 133917, 133918, 133919, 133920, 133921, 133922, 
+    133923, 133924, 133925, 133926, 133927, 133928, 133929, 133930, 133931, 
+    133932, 133933, 133934, 133935, 133936, 133937, 133938, 133939, 133940, 
+    133941, 133942, 133943, 133944, 133945, 133946, 133947, 133948, 133949, 
+    133950, 133951, 133952, 133953, 133954, 133955, 133956, 133957, 133958, 
+    133959, 133960, 133961, 133962, 133963, 133964, 133965, 133966, 133967, 
+    133968, 133969, 133970, 133971, 133972, 133973, 133974, 133975, 133976, 
+    133977, 133978, 133979, 133980, 133981, 133982, 133983, 133984, 133985, 
+    133986, 133987, 133988, 133989, 133990, 133991, 133992, 133993, 133994, 
+    133995, 133996, 133997, 133998, 133999, 134000, 134001, 134002, 134003, 
+    134004, 134005, 134006, 134007, 134008, 134009, 134010, 134011, 134012, 
+    134013, 134014, 134015, 134016, 134017, 134018, 134019, 134020, 134021, 
+    134022, 134023, 134024, 134025, 134026, 134027, 134028, 134029, 134030, 
+    134031, 134032, 134033, 134034, 134035, 134036, 134037, 134038, 134039, 
+    134040, 134041, 134042, 134043, 134044, 134045, 134046, 134047, 134048, 
+    134049, 134050, 134051, 134052, 134053, 134054, 134055, 134056, 134057, 
+    134058, 134059, 134060, 134061, 134062, 134063, 134064, 134065, 134066, 
+    134067, 134068, 134069, 134070, 134071, 134072, 134073, 134074, 134075, 
+    134076, 134077, 134078, 134079, 134080, 134081, 134082, 134083, 134084, 
+    134085, 134086, 134087, 134088, 134089, 134090, 134091, 134092, 134093, 
+    134094, 134095, 134096, 134097, 134098, 134099, 134100, 134101, 134102, 
+    134103, 134104, 134105, 134106, 134107, 134108, 134109, 134110, 134111, 
+    134112, 134113, 134114, 134115, 134116, 134117, 134118, 134119, 134120, 
+    134121, 134122, 134123, 134124, 134125, 134126, 134127, 134128, 134129, 
+    134130, 134131, 134132, 134133, 134134, 134135, 134136, 134137, 134138, 
+    134139, 134140, 134141, 134142, 134143, 134144, 134145, 134146, 134147, 
+    134148, 134149, 134150, 134151, 134152, 134153, 134154, 134155, 134156, 
+    134157, 134158, 134159, 134160, 134161, 134162, 134163, 134164, 134165, 
+    134166, 134167, 134168, 134169, 134170, 134171, 134172, 134173, 134174, 
+    134175, 134176, 134177, 134178, 134179, 134180, 134181, 134182, 134183, 
+    134184, 134185, 134186, 134187, 134188, 134189, 134190, 134191, 134192, 
+    134193, 134194, 134195, 134196, 134197, 134198, 134199, 134200, 134201, 
+    134202, 134203, 134204, 134205, 134206, 134207, 134208, 134209, 134210, 
+    134211, 134212, 134213, 134214, 134215, 134216, 134217, 134218, 134219, 
+    134220, 134221, 134222, 134223, 134224, 134225, 134226, 134227, 134228, 
+    134229, 134230, 134231, 134232, 134233, 134234, 134235, 134236, 134237, 
+    134238, 134239, 134240, 134241, 134242, 134243, 134244, 134245, 134246, 
+    134247, 134248, 134249, 134250, 134251, 134252, 134253, 134254, 134255, 
+    134256, 134257, 134258, 134259, 134260, 134261, 134262, 134263, 134264, 
+    134265, 134266, 134267, 134268, 134269, 134270, 134271, 134272, 134273, 
+    134274, 134275, 134276, 134277, 134278, 134279, 134280, 134281, 134282, 
+    134283, 134284, 134285, 134286, 134287, 134288, 134289, 134290, 134291, 
+    134292, 134293, 134294, 134295, 134296, 134297, 134298, 134299, 134300, 
+    134301, 134302, 134303, 134304, 134305, 134306, 134307, 134308, 134309, 
+    134310, 134311, 134312, 134313, 134314, 134315, 134316, 134317, 134318, 
+    134319, 134320, 134321, 134322, 134323, 134324, 134325, 134326, 134327, 
+    134328, 134329, 134330, 134331, 134332, 134333, 134334, 134335, 134336, 
+    134337, 134338, 134339, 134340, 134341, 134342, 134343, 134344, 134345, 
+    134346, 134347, 134348, 134349, 134350, 134351, 134352, 134353, 134354, 
+    134355, 134356, 134357, 134358, 134359, 134360, 134361, 134362, 134363, 
+    134364, 134365, 134366, 134367, 134368, 134369, 134370, 134371, 134372, 
+    134373, 134374, 134375, 134376, 134377, 134378, 134379, 134380, 134381, 
+    134382, 134383, 134384, 134385, 134386, 134387, 134388, 134389, 134390, 
+    134391, 134392, 134393, 134394, 134395, 134396, 134397, 134398, 134399, 
+    134400, 134401, 134402, 134403, 134404, 134405, 134406, 134407, 134408, 
+    134409, 134410, 134411, 134412, 134413, 134414, 134415, 134416, 134417, 
+    134418, 134419, 134420, 134421, 134422, 134423, 134424, 134425, 134426, 
+    134427, 134428, 134429, 134430, 134431, 134432, 134433, 134434, 134435, 
+    134436, 134437, 134438, 134439, 134440, 134441, 134442, 134443, 134444, 
+    134445, 134446, 134447, 134448, 134449, 134450, 134451, 134452, 134453, 
+    134454, 134455, 134456, 134457, 134458, 134459, 134460, 134461, 134462, 
+    134463, 134464, 134465, 134466, 134467, 134468, 134469, 134470, 134471, 
+    134472, 134473, 134474, 134475, 134476, 134477, 134478, 134479, 134480, 
+    134481, 134482, 134483, 134484, 134485, 134486, 134487, 134488, 134489, 
+    134490, 134491, 134492, 134493, 134494, 134495, 134496, 134497, 134498, 
+    134499, 134500, 134501, 134502, 134503, 134504, 134505, 134506, 134507, 
+    134508, 134509, 134510, 134511, 134512, 134513, 134514, 134515, 134516, 
+    134517, 134518, 134519, 134520, 134521, 134522, 134523, 134524, 134525, 
+    134526, 134527, 134528, 134529, 134530, 134531, 134532, 134533, 134534, 
+    134535, 134536, 134537, 134538, 134539, 134540, 134541, 134542, 134543, 
+    134544, 134545, 134546, 134547, 134548, 134549, 134550, 134551, 134552, 
+    134553, 134554, 134555, 134556, 134557, 134558, 134559, 134560, 134561, 
+    134562, 134563, 134564, 134565, 134566, 134567, 134568, 134569, 134570, 
+    134571, 134572, 134573, 134574, 134575, 134576, 134577, 134578, 134579, 
+    134580, 134581, 134582, 134583, 134584, 134585, 134586, 134587, 134588, 
+    134589, 134590, 134591, 134592, 134593, 134594, 134595, 134596, 134597, 
+    134598, 134599, 134600, 134601, 134602, 134603, 134604, 134605, 134606, 
+    134607, 134608, 134609, 134610, 134611, 134612, 134613, 134614, 134615, 
+    134616, 134617, 134618, 134619, 134620, 134621, 134622, 134623, 134624, 
+    134625, 134626, 134627, 134628, 134629, 134630, 134631, 134632, 134633, 
+    134634, 134635, 134636, 134637, 134638, 134639, 134640, 134641, 134642, 
+    134643, 134644, 134645, 134646, 134647, 134648, 134649, 134650, 134651, 
+    134652, 134653, 134654, 134655, 134656, 134657, 134658, 134659, 134660, 
+    134661, 134662, 134663, 134664, 134665, 134666, 134667, 134668, 134669, 
+    134670, 134671, 134672, 134673, 134674, 134675, 134676, 134677, 134678, 
+    134679, 134680, 134681, 134682, 134683, 134684, 134685, 134686, 134687, 
+    134688, 134689, 134690, 134691, 134692, 134693, 134694, 134695, 134696, 
+    134697, 134698, 134699, 134700, 134701, 134702, 134703, 134704, 134705, 
+    134706, 134707, 134708, 134709, 134710, 134711, 134712, 134713, 134714, 
+    134715, 134716, 134717, 134718, 134719, 134720, 134721, 134722, 134723, 
+    134724, 134725, 134726, 134727, 134728, 134729, 134730, 134731, 134732, 
+    134733, 134734, 134735, 134736, 134737, 134738, 134739, 134740, 134741, 
+    134742, 134743, 134744, 134745, 134746, 134747, 134748, 134749, 134750, 
+    134751, 134752, 134753, 134754, 134755, 134756, 134757, 134758, 134759, 
+    134760, 134761, 134762, 134763, 134764, 134765, 134766, 134767, 134768, 
+    134769, 134770, 134771, 134772, 134773, 134774, 134775, 134776, 134777, 
+    134778, 134779, 134780, 134781, 134782, 134783, 134784, 134785, 134786, 
+    134787, 134788, 134789, 134790, 134791, 134792, 134793, 134794, 134795, 
+    134796, 134797, 134798, 134799, 134800, 134801, 134802, 134803, 134804, 
+    134805, 134806, 134807, 134808, 134809, 134810, 134811, 134812, 134813, 
+    134814, 134815, 134816, 134817, 134818, 134819, 134820, 134821, 134822, 
+    134823, 134824, 134825, 134826, 134827, 134828, 134829, 134830, 134831, 
+    134832, 134833, 134834, 134835, 134836, 134837, 134838, 134839, 134840, 
+    134841, 134842, 134843, 134844, 134845, 134846, 134847, 134848, 134849, 
+    134850, 134851, 134852, 134853, 134854, 134855, 134856, 134857, 134858, 
+    134859, 134860, 134861, 134862, 134863, 134864, 134865, 134866, 134867, 
+    134868, 134869, 134870, 134871, 134872, 134873, 134874, 134875, 134876, 
+    134877, 134878, 134879, 134880, 134881, 134882, 134883, 134884, 134885, 
+    134886, 134887, 134888, 134889, 134890, 134891, 134892, 134893, 134894, 
+    134895, 134896, 134897, 134898, 134899, 134900, 134901, 134902, 134903, 
+    134904, 134905, 134906, 134907, 134908, 134909, 134910, 134911, 134912, 
+    134913, 134914, 134915, 134916, 134917, 134918, 134919, 134920, 134921, 
+    134922, 134923, 134924, 134925, 134926, 134927, 134928, 134929, 134930, 
+    134931, 134932, 134933, 134934, 134935, 134936, 134937, 134938, 134939, 
+    134940, 134941, 134942, 134943, 134944, 134945, 134946, 134947, 134948, 
+    134949, 134950, 134951, 134952, 134953, 134954, 134955, 134956, 134957, 
+    134958, 134959, 134960, 134961, 134962, 134963, 134964, 134965, 134966, 
+    134967, 134968, 134969, 134970, 134971, 134972, 134973, 134974, 134975, 
+    134976, 134977, 134978, 134979, 134980, 134981, 134982, 134983, 134984, 
+    134985, 134986, 134987, 134988, 134989, 134990, 134991, 134992, 134993, 
+    134994, 134995, 134996, 134997, 134998, 134999, 135000, 135001, 135002, 
+    135003, 135004, 135005, 135006, 135007, 135008, 135009, 135010, 135011, 
+    135012, 135013, 135014, 135015, 135016, 135017, 135018, 135019, 135020, 
+    135021, 135022, 135023, 135024, 135025, 135026, 135027, 135028, 135029, 
+    135030, 135031, 135032, 135033, 135034, 135035, 135036, 135037, 135038, 
+    135039, 135040, 135041, 135042, 135043, 135044, 135045, 135046, 135047, 
+    135048, 135049, 135050, 135051, 135052, 135053, 135054, 135055, 135056, 
+    135057, 135058, 135059, 135060, 135061, 135062, 135063, 135064, 135065, 
+    135066, 135067, 135068, 135069, 135070, 135071, 135072, 135073, 135074, 
+    135075, 135076, 135077, 135078, 135079, 135080, 135081, 135082, 135083, 
+    135084, 135085, 135086, 135087, 135088, 135089, 135090, 135091, 135092, 
+    135093, 135094, 135095, 135096, 135097, 135098, 135099, 135100, 135101, 
+    135102, 135103, 135104, 135105, 135106, 135107, 135108, 135109, 135110, 
+    135111, 135112, 135113, 135114, 135115, 135116, 135117, 135118, 135119, 
+    135120, 135121, 135122, 135123, 135124, 135125, 135126, 135127, 135128, 
+    135129, 135130, 135131, 135132, 135133, 135134, 135135, 135136, 135137, 
+    135138, 135139, 135140, 135141, 135142, 135143, 135144, 135145, 135146, 
+    135147, 135148, 135149, 135150, 135151, 135152, 135153, 135154, 135155, 
+    135156, 135157, 135158, 135159, 135160, 135161, 135162, 135163, 135164, 
+    135165, 135166, 135167, 135168, 135169, 135170, 135171, 135172, 135173, 
+    135174, 135175, 135176, 135177, 135178, 135179, 135180, 135181, 135182, 
+    135183, 135184, 135185, 135186, 135187, 135188, 135189, 135190, 135191, 
+    135192, 135193, 135194, 135195, 135196, 135197, 135198, 135199, 135200, 
+    135201, 135202, 135203, 135204, 135205, 135206, 135207, 135208, 135209, 
+    135210, 135211, 135212, 135213, 135214, 135215, 135216, 135217, 135218, 
+    135219, 135220, 135221, 135222, 135223, 135224, 135225, 135226, 135227, 
+    135228, 135229, 135230, 135231, 135232, 135233, 135234, 135235, 135236, 
+    135237, 135238, 135239, 135240, 135241, 135242, 135243, 135244, 135245, 
+    135246, 135247, 135248, 135249, 135250, 135251, 135252, 135253, 135254, 
+    135255, 135256, 135257, 135258, 135259, 135260, 135261, 135262, 135263, 
+    135264, 135265, 135266, 135267, 135268, 135269, 135270, 135271, 135272, 
+    135273, 135274, 135275, 135276, 135277, 135278, 135279, 135280, 135281, 
+    135282, 135283, 135284, 135285, 135286, 135287, 135288, 135289, 135290, 
+    135291, 135292, 135293, 135294, 135295, 135296, 135297, 135298, 135299, 
+    135300, 135301, 135302, 135303, 135304, 135305, 135306, 135307, 135308, 
+    135309, 135310, 135311, 135312, 135313, 135314, 135315, 135316, 135317, 
+    135318, 135319, 135320, 135321, 135322, 135323, 135324, 135325, 135326, 
+    135327, 135328, 135329, 135330, 135331, 135332, 135333, 135334, 135335, 
+    135336, 135337, 135338, 135339, 135340, 135341, 135342, 135343, 135344, 
+    135345, 135346, 135347, 135348, 135349, 135350, 135351, 135352, 135353, 
+    135354, 135355, 135356, 135357, 135358, 135359, 135360, 135361, 135362, 
+    135363, 135364, 135365, 135366, 135367, 135368, 135369, 135370, 135371, 
+    135372, 135373, 135374, 135375, 135376, 135377, 135378, 135379, 135380, 
+    135381, 135382, 135383, 135384, 135385, 135386, 135387, 135388, 135389, 
+    135390, 135391, 135392, 135393, 135394, 135395, 135396, 135397, 135398, 
+    135399, 135400, 135401, 135402, 135403, 135404, 135405, 135406, 135407, 
+    135408, 135409, 135410, 135411, 135412, 135413, 135414, 135415, 135416, 
+    135417, 135418, 135419, 135420, 135421, 135422, 135423, 135424, 135425, 
+    135426, 135427, 135428, 135429, 135430, 135431, 135432, 135433, 135434, 
+    135435, 135436, 135437, 135438, 135439, 135440, 135441, 135442, 135443, 
+    135444, 135445, 135446, 135447, 135448, 135449, 135450, 135451, 135452, 
+    135453, 135454, 135455, 135456, 135457, 135458, 135459, 135460, 135461, 
+    135462, 135463, 135464, 135465, 135466, 135467, 135468, 135469, 135470, 
+    135471, 135472, 135473, 135474, 135475, 135476, 135477, 135478, 135479, 
+    135480, 135481, 135482, 135483, 135484, 135485, 135486, 135487, 135488, 
+    135489, 135490, 135491, 135492, 135493, 135494, 135495, 135496, 135497, 
+    135498, 135499, 135500, 135501, 135502, 135503, 135504, 135505, 135506, 
+    135507, 135508, 135509, 135510, 135511, 135512, 135513, 135514, 135515, 
+    135516, 135517, 135518, 135519, 135520, 135521, 135522, 135523, 135524, 
+    135525, 135526, 135527, 135528, 135529, 135530, 135531, 135532, 135533, 
+    135534, 135535, 135536, 135537, 135538, 135539, 135540, 135541, 135542, 
+    135543, 135544, 135545, 135546, 135547, 135548, 135549, 135550, 135551, 
+    135552, 135553, 135554, 135555, 135556, 135557, 135558, 135559, 135560, 
+    135561, 135562, 135563, 135564, 135565, 135566, 135567, 135568, 135569, 
+    135570, 135571, 135572, 135573, 135574, 135575, 135576, 135577, 135578, 
+    135579, 135580, 135581, 135582, 135583, 135584, 135585, 135586, 135587, 
+    135588, 135589, 135590, 135591, 135592, 135593, 135594, 135595, 135596, 
+    135597, 135598, 135599, 135600, 135601, 135602, 135603, 135604, 135605, 
+    135606, 135607, 135608, 135609, 135610, 135611, 135612, 135613, 135614, 
+    135615, 135616, 135617, 135618, 135619, 135620, 135621, 135622, 135623, 
+    135624, 135625, 135626, 135627, 135628, 135629, 135630, 135631, 135632, 
+    135633, 135634, 135635, 135636, 135637, 135638, 135639, 135640, 135641, 
+    135642, 135643, 135644, 135645, 135646, 135647, 135648, 135649, 135650, 
+    135651, 135652, 135653, 135654, 135655, 135656, 135657, 135658, 135659, 
+    135660, 135661, 135662, 135663, 135664, 135665, 135666, 135667, 135668, 
+    135669, 135670, 135671, 135672, 135673, 135674, 135675, 135676, 135677, 
+    135678, 135679, 135680, 135681, 135682, 135683, 135684, 135685, 135686, 
+    135687, 135688, 135689, 135690, 135691, 135692, 135693, 135694, 135695, 
+    135696, 135697, 135698, 135699, 135700, 135701, 135702, 135703, 135704, 
+    135705, 135706, 135707, 135708, 135709, 135710, 135711, 135712, 135713, 
+    135714, 135715, 135716, 135717, 135718, 135719, 135720, 135721, 135722, 
+    135723, 135724, 135725, 135726, 135727, 135728, 135729, 135730, 135731, 
+    135732, 135733, 135734, 135735, 135736, 135737, 135738, 135739, 135740, 
+    135741, 135742, 135743, 135744, 135745, 135746, 135747, 135748, 135749, 
+    135750, 135751, 135752, 135753, 135754, 135755, 135756, 135757, 135758, 
+    135759, 135760, 135761, 135762, 135763, 135764, 135765, 135766, 135767, 
+    135768, 135769, 135770, 135771, 135772, 135773, 135774, 135775, 135776, 
+    135777, 135778, 135779, 135780, 135781, 135782, 135783, 135784, 135785, 
+    135786, 135787, 135788, 135789, 135790, 135791, 135792, 135793, 135794, 
+    135795, 135796, 135797, 135798, 135799, 135800, 135801, 135802, 135803, 
+    135804, 135805, 135806, 135807, 135808, 135809, 135810, 135811, 135812, 
+    135813, 135814, 135815, 135816, 135817, 135818, 135819, 135820, 135821, 
+    135822, 135823, 135824, 135825, 135826, 135827, 135828, 135829, 135830, 
+    135831, 135832, 135833, 135834, 135835, 135836, 135837, 135838, 135839, 
+    135840, 135841, 135842, 135843, 135844, 135845, 135846, 135847, 135848, 
+    135849, 135850, 135851, 135852, 135853, 135854, 135855, 135856, 135857, 
+    135858, 135859, 135860, 135861, 135862, 135863, 135864, 135865, 135866, 
+    135867, 135868, 135869, 135870, 135871, 135872, 135873, 135874, 135875, 
+    135876, 135877, 135878, 135879, 135880, 135881, 135882, 135883, 135884, 
+    135885, 135886, 135887, 135888, 135889, 135890, 135891, 135892, 135893, 
+    135894, 135895, 135896, 135897, 135898, 135899, 135900, 135901, 135902, 
+    135903, 135904, 135905, 135906, 135907, 135908, 135909, 135910, 135911, 
+    135912, 135913, 135914, 135915, 135916, 135917, 135918, 135919, 135920, 
+    135921, 135922, 135923, 135924, 135925, 135926, 135927, 135928, 135929, 
+    135930, 135931, 135932, 135933, 135934, 135935, 135936, 135937, 135938, 
+    135939, 135940, 135941, 135942, 135943, 135944, 135945, 135946, 135947, 
+    135948, 135949, 135950, 135951, 135952, 135953, 135954, 135955, 135956, 
+    135957, 135958, 135959, 135960, 135961, 135962, 135963, 135964, 135965, 
+    135966, 135967, 135968, 135969, 135970, 135971, 135972, 135973, 135974, 
+    135975, 135976, 135977, 135978, 135979, 135980, 135981, 135982, 135983, 
+    135984, 135985, 135986, 135987, 135988, 135989, 135990, 135991, 135992, 
+    135993, 135994, 135995, 135996, 135997, 135998, 135999, 136000, 136001, 
+    136002, 136003, 136004, 136005, 136006, 136007, 136008, 136009, 136010, 
+    136011, 136012, 136013, 136014, 136015, 136016, 136017, 136018, 136019, 
+    136020, 136021, 136022, 136023, 136024, 136025, 136026, 136027, 136028, 
+    136029, 136030, 136031, 136032, 136033, 136034, 136035, 136036, 136037, 
+    136038, 136039, 136040, 136041, 136042, 136043, 136044, 136045, 136046, 
+    136047, 136048, 136049, 136050, 136051, 136052, 136053, 136054, 136055, 
+    136056, 136057, 136058, 136059, 136060, 136061, 136062, 136063, 136064, 
+    136065, 136066, 136067, 136068, 136069, 136070, 136071, 136072, 136073, 
+    136074, 136075, 136076, 136077, 136078, 136079, 136080, 136081, 136082, 
+    136083, 136084, 136085, 136086, 136087, 136088, 136089, 136090, 136091, 
+    136092, 136093, 136094, 136095, 136096, 136097, 136098, 136099, 136100, 
+    136101, 136102, 136103, 136104, 136105, 136106, 136107, 136108, 136109, 
+    136110, 136111, 136112, 136113, 136114, 136115, 136116, 136117, 136118, 
+    136119, 136120, 136121, 136122, 136123, 136124, 136125, 136126, 136127, 
+    136128, 136129, 136130, 136131, 136132, 136133, 136134, 136135, 136136, 
+    136137, 136138, 136139, 136140, 136141, 136142, 136143, 136144, 136145, 
+    136146, 136147, 136148, 136149, 136150, 136151, 136152, 136153, 136154, 
+    136155, 136156, 136157, 136158, 136159, 136160, 136161, 136162, 136163, 
+    136164, 136165, 136166, 136167, 136168, 136169, 136170, 136171, 136172, 
+    136173, 136174, 136175, 136176, 136177, 136178, 136179, 136180, 136181, 
+    136182, 136183, 136184, 136185, 136186, 136187, 136188, 136189, 136190, 
+    136191, 136192, 136193, 136194, 136195, 136196, 136197, 136198, 136199, 
+    136200, 136201, 136202, 136203, 136204, 136205, 136206, 136207, 136208, 
+    136209, 136210, 136211, 136212, 136213, 136214, 136215, 136216, 136217, 
+    136218, 136219, 136220, 136221, 136222, 136223, 136224, 136225, 136226, 
+    136227, 136228, 136229, 136230, 136231, 136232, 136233, 136234, 136235, 
+    136236, 136237, 136238, 136239, 136240, 136241, 136242, 136243, 136244, 
+    136245, 136246, 136247, 136248, 136249, 136250, 136251, 136252, 136253, 
+    136254, 136255, 136256, 136257, 136258, 136259, 136260, 136261, 136262, 
+    136263, 136264, 136265, 136266, 136267, 136268, 136269, 136270, 136271, 
+    136272, 136273, 136274, 136275, 136276, 136277, 136278, 136279, 136280, 
+    136281, 136282, 136283, 136284, 136285, 136286, 136287, 136288, 136289, 
+    136290, 136291, 136292, 136293, 136294, 136295, 136296, 136297, 136298, 
+    136299, 136300, 136301, 136302, 136303, 136304, 136305, 136306, 136307, 
+    136308, 136309, 136310, 136311, 136312, 136313, 136314, 136315, 136316, 
+    136317, 136318, 136319, 136320, 136321, 136322, 136323, 136324, 136325, 
+    136326, 136327, 136328, 136329, 136330, 136331, 136332, 136333, 136334, 
+    136335, 136336, 136337, 136338, 136339, 136340, 136341, 136342, 136343, 
+    136344, 136345, 136346, 136347, 136348, 136349, 136350, 136351, 136352, 
+    136353, 136354, 136355, 136356, 136357, 136358, 136359, 136360, 136361, 
+    136362, 136363, 136364, 136365, 136366, 136367, 136368, 136369, 136370, 
+    136371, 136372, 136373, 136374, 136375, 136376, 136377, 136378, 136379, 
+    136380, 136381, 136382, 136383, 136384, 136385, 136386, 136387, 136388, 
+    136389, 136390, 136391, 136392, 136393, 136394, 136395, 136396, 136397, 
+    136398, 136399, 136400, 136401, 136402, 136403, 136404, 136405, 136406, 
+    136407, 136408, 136409, 136410, 136411, 136412, 136413, 136414, 136415, 
+    136416, 136417, 136418, 136419, 136420, 136421, 136422, 136423, 136424, 
+    136425, 136426, 136427, 136428, 136429, 136430, 136431, 136432, 136433, 
+    136434, 136435, 136436, 136437, 136438, 136439, 136440, 136441, 136442, 
+    136443, 136444, 136445, 136446, 136447, 136448, 136449, 136450, 136451, 
+    136452, 136453, 136454, 136455, 136456, 136457, 136458, 136459, 136460, 
+    136461, 136462, 136463, 136464, 136465, 136466, 136467, 136468, 136469, 
+    136470, 136471, 136472, 136473, 136474, 136475, 136476, 136477, 136478, 
+    136479, 136480, 136481, 136482, 136483, 136484, 136485, 136486, 136487, 
+    136488, 136489, 136490, 136491, 136492, 136493, 136494, 136495, 136496, 
+    136497, 136498, 136499, 136500, 136501, 136502, 136503, 136504, 136505, 
+    136506, 136507, 136508, 136509, 136510, 136511, 136512, 136513, 136514, 
+    136515, 136516, 136517, 136518, 136519, 136520, 136521, 136522, 136523, 
+    136524, 136525, 136526, 136527, 136528, 136529, 136530, 136531, 136532, 
+    136533, 136534, 136535, 136536, 136537, 136538, 136539, 136540, 136541, 
+    136542, 136543, 136544, 136545, 136546, 136547, 136548, 136549, 136550, 
+    136551, 136552, 136553, 136554, 136555, 136556, 136557, 136558, 136559, 
+    136560, 136561, 136562, 136563, 136564, 136565, 136566, 136567, 136568, 
+    136569, 136570, 136571, 136572, 136573, 136574, 136575, 136576, 136577, 
+    136578, 136579, 136580, 136581, 136582, 136583, 136584, 136585, 136586, 
+    136587, 136588, 136589, 136590, 136591, 136592, 136593, 136594, 136595, 
+    136596, 136597, 136598, 136599, 136600, 136601, 136602, 136603, 136604, 
+    136605, 136606, 136607, 136608, 136609, 136610, 136611, 136612, 136613, 
+    136614, 136615, 136616, 136617, 136618, 136619, 136620, 136621, 136622, 
+    136623, 136624, 136625, 136626, 136627, 136628, 136629, 136630, 136631, 
+    136632, 136633, 136634, 136635, 136636, 136637, 136638, 136639, 136640, 
+    136641, 136642, 136643, 136644, 136645, 136646, 136647, 136648, 136649, 
+    136650, 136651, 136652, 136653, 136654, 136655, 136656, 136657, 136658, 
+    136659, 136660, 136661, 136662, 136663, 136664, 136665, 136666, 136667, 
+    136668, 136669, 136670, 136671, 136672, 136673, 136674, 136675, 136676, 
+    136677, 136678, 136679, 136680, 136681, 136682, 136683, 136684, 136685, 
+    136686, 136687, 136688, 136689, 136690, 136691, 136692, 136693, 136694, 
+    136695, 136696, 136697, 136698, 136699, 136700, 136701, 136702, 136703, 
+    136704, 136705, 136706, 136707, 136708, 136709, 136710, 136711, 136712, 
+    136713, 136714, 136715, 136716, 136717, 136718, 136719, 136720, 136721, 
+    136722, 136723, 136724, 136725, 136726, 136727, 136728, 136729, 136730, 
+    136731, 136732, 136733, 136734, 136735, 136736, 136737, 136738, 136739, 
+    136740, 136741, 136742, 136743, 136744, 136745, 136746, 136747, 136748, 
+    136749, 136750, 136751, 136752, 136753, 136754, 136755, 136756, 136757, 
+    136758, 136759, 136760, 136761, 136762, 136763, 136764, 136765, 136766, 
+    136767, 136768, 136769, 136770, 136771, 136772, 136773, 136774, 136775, 
+    136776, 136777, 136778, 136779, 136780, 136781, 136782, 136783, 136784, 
+    136785, 136786, 136787, 136788, 136789, 136790, 136791, 136792, 136793, 
+    136794, 136795, 136796, 136797, 136798, 136799, 136800, 136801, 136802, 
+    136803, 136804, 136805, 136806, 136807, 136808, 136809, 136810, 136811, 
+    136812, 136813, 136814, 136815, 136816, 136817, 136818, 136819, 136820, 
+    136821, 136822, 136823, 136824, 136825, 136826, 136827, 136828, 136829, 
+    136830, 136831, 136832, 136833, 136834, 136835, 136836, 136837, 136838, 
+    136839, 136840, 136841, 136842, 136843, 136844, 136845, 136846, 136847, 
+    136848, 136849, 136850, 136851, 136852, 136853, 136854, 136855, 136856, 
+    136857, 136858, 136859, 136860, 136861, 136862, 136863, 136864, 136865, 
+    136866, 136867, 136868, 136869, 136870, 136871, 136872, 136873, 136874, 
+    136875, 136876, 136877, 136878, 136879, 136880, 136881, 136882, 136883, 
+    136884, 136885, 136886, 136887, 136888, 136889, 136890, 136891, 136892, 
+    136893, 136894, 136895, 136896, 136897, 136898, 136899, 136900, 136901, 
+    136902, 136903, 136904, 136905, 136906, 136907, 136908, 136909, 136910, 
+    136911, 136912, 136913, 136914, 136915, 136916, 136917, 136918, 136919, 
+    136920, 136921, 136922, 136923, 136924, 136925, 136926, 136927, 136928, 
+    136929, 136930, 136931, 136932, 136933, 136934, 136935, 136936, 136937, 
+    136938, 136939, 136940, 136941, 136942, 136943, 136944, 136945, 136946, 
+    136947, 136948, 136949, 136950, 136951, 136952, 136953, 136954, 136955, 
+    136956, 136957, 136958, 136959, 136960, 136961, 136962, 136963, 136964, 
+    136965, 136966, 136967, 136968, 136969, 136970, 136971, 136972, 136973, 
+    136974, 136975, 136976, 136977, 136978, 136979, 136980, 136981, 136982, 
+    136983, 136984, 136985, 136986, 136987, 136988, 136989, 136990, 136991, 
+    136992, 136993, 136994, 136995, 136996, 136997, 136998, 136999, 137000, 
+    137001, 137002, 137003, 137004, 137005, 137006, 137007, 137008, 137009, 
+    137010, 137011, 137012, 137013, 137014, 137015, 137016, 137017, 137018, 
+    137019, 137020, 137021, 137022, 137023, 137024, 137025, 137026, 137027, 
+    137028, 137029, 137030, 137031, 137032, 137033, 137034, 137035, 137036, 
+    137037, 137038, 137039, 137040, 137041, 137042, 137043, 137044, 137045, 
+    137046, 137047, 137048, 137049, 137050, 137051, 137052, 137053, 137054, 
+    137055, 137056, 137057, 137058, 137059, 137060, 137061, 137062, 137063, 
+    137064, 137065, 137066, 137067, 137068, 137069, 137070, 137071, 137072, 
+    137073, 137074, 137075, 137076, 137077, 137078, 137079, 137080, 137081, 
+    137082, 137083, 137084, 137085, 137086, 137087, 137088, 137089, 137090, 
+    137091, 137092, 137093, 137094, 137095, 137096, 137097, 137098, 137099, 
+    137100, 137101, 137102, 137103, 137104, 137105, 137106, 137107, 137108, 
+    137109, 137110, 137111, 137112, 137113, 137114, 137115, 137116, 137117, 
+    137118, 137119, 137120, 137121, 137122, 137123, 137124, 137125, 137126, 
+    137127, 137128, 137129, 137130, 137131, 137132, 137133, 137134, 137135, 
+    137136, 137137, 137138, 137139, 137140, 137141, 137142, 137143, 137144, 
+    137145, 137146, 137147, 137148, 137149, 137150, 137151, 137152, 137153, 
+    137154, 137155, 137156, 137157, 137158, 137159, 137160, 137161, 137162, 
+    137163, 137164, 137165, 137166, 137167, 137168, 137169, 137170, 137171, 
+    137172, 137173, 137174, 137175, 137176, 137177, 137178, 137179, 137180, 
+    137181, 137182, 137183, 137184, 137185, 137186, 137187, 137188, 137189, 
+    137190, 137191, 137192, 137193, 137194, 137195, 137196, 137197, 137198, 
+    137199, 137200, 137201, 137202, 137203, 137204, 137205, 137206, 137207, 
+    137208, 137209, 137210, 137211, 137212, 137213, 137214, 137215, 137216, 
+    137217, 137218, 137219, 137220, 137221, 137222, 137223, 137224, 137225, 
+    137226, 137227, 137228, 137229, 137230, 137231, 137232, 137233, 137234, 
+    137235, 137236, 137237, 137238, 137239, 137240, 137241, 137242, 137243, 
+    137244, 137245, 137246, 137247, 137248, 137249, 137250, 137251, 137252, 
+    137253, 137254, 137255, 137256, 137257, 137258, 137259, 137260, 137261, 
+    137262, 137263, 137264, 137265, 137266, 137267, 137268, 137269, 137270, 
+    137271, 137272, 137273, 137274, 137275, 137276, 137277, 137278, 137279, 
+    137280, 137281, 137282, 137283, 137284, 137285, 137286, 137287, 137288, 
+    137289, 137290, 137291, 137292, 137293, 137294, 137295, 137296, 137297, 
+    137298, 137299, 137300, 137301, 137302, 137303, 137304, 137305, 137306, 
+    137307, 137308, 137309, 137310, 137311, 137312, 137313, 137314, 137315, 
+    137316, 137317, 137318, 137319, 137320, 137321, 137322, 137323, 137324, 
+    137325, 137326, 137327, 137328, 137329, 137330, 137331, 137332, 137333, 
+    137334, 137335, 137336, 137337, 137338, 137339, 137340, 137341, 137342, 
+    137343, 137344, 137345, 137346, 137347, 137348, 137349, 137350, 137351, 
+    137352, 137353, 137354, 137355, 137356, 137357, 137358, 137359, 137360, 
+    137361, 137362, 137363, 137364, 137365, 137366, 137367, 137368, 137369, 
+    137370, 137371, 137372, 137373, 137374, 137375, 137376, 137377, 137378, 
+    137379, 137380, 137381, 137382, 137383, 137384, 137385, 137386, 137387, 
+    137388, 137389, 137390, 137391, 137392, 137393, 137394, 137395, 137396, 
+    137397, 137398, 137399, 137400, 137401, 137402, 137403, 137404, 137405, 
+    137406, 137407, 137408, 137409, 137410, 137411, 137412, 137413, 137414, 
+    137415, 137416, 137417, 137418, 137419, 137420, 137421, 137422, 137423, 
+    137424, 137425, 137426, 137427, 137428, 137429, 137430, 137431, 137432, 
+    137433, 137434, 137435, 137436, 137437, 137438, 137439, 137440, 137441, 
+    137442, 137443, 137444, 137445, 137446, 137447, 137448, 137449, 137450, 
+    137451, 137452, 137453, 137454, 137455, 137456, 137457, 137458, 137459, 
+    137460, 137461, 137462, 137463, 137464, 137465, 137466, 137467, 137468, 
+    137469, 137470, 137471, 137472, 137473, 137474, 137475, 137476, 137477, 
+    137478, 137479, 137480, 137481, 137482, 137483, 137484, 137485, 137486, 
+    137487, 137488, 137489, 137490, 137491, 137492, 137493, 137494, 137495, 
+    137496, 137497, 137498, 137499, 137500, 137501, 137502, 137503, 137504, 
+    137505, 137506, 137507, 137508, 137509, 137510, 137511, 137512, 137513, 
+    137514, 137515, 137516, 137517, 137518, 137519, 137520, 137521, 137522, 
+    137523, 137524, 137525, 137526, 137527, 137528, 137529, 137530, 137531, 
+    137532, 137533, 137534, 137535, 137536, 137537, 137538, 137539, 137540, 
+    137541, 137542, 137543, 137544, 137545, 137546, 137547, 137548, 137549, 
+    137550, 137551, 137552, 137553, 137554, 137555, 137556, 137557, 137558, 
+    137559, 137560, 137561, 137562, 137563, 137564, 137565, 137566, 137567, 
+    137568, 137569, 137570, 137571, 137572, 137573, 137574, 137575, 137576, 
+    137577, 137578, 137579, 137580, 137581, 137582, 137583, 137584, 137585, 
+    137586, 137587, 137588, 137589, 137590, 137591, 137592, 137593, 137594, 
+    137595, 137596, 137597, 137598, 137599, 137600, 137601, 137602, 137603, 
+    137604, 137605, 137606, 137607, 137608, 137609, 137610, 137611, 137612, 
+    137613, 137614, 137615, 137616, 137617, 137618, 137619, 137620, 137621, 
+    137622, 137623, 137624, 137625, 137626, 137627, 137628, 137629, 137630, 
+    137631, 137632, 137633, 137634, 137635, 137636, 137637, 137638, 137639, 
+    137640, 137641, 137642, 137643, 137644, 137645, 137646, 137647, 137648, 
+    137649, 137650, 137651, 137652, 137653, 137654, 137655, 137656, 137657, 
+    137658, 137659, 137660, 137661, 137662, 137663, 137664, 137665, 137666, 
+    137667, 137668, 137669, 137670, 137671, 137672, 137673, 137674, 137675, 
+    137676, 137677, 137678, 137679, 137680, 137681, 137682, 137683, 137684, 
+    137685, 137686, 137687, 137688, 137689, 137690, 137691, 137692, 137693, 
+    137694, 137695, 137696, 137697, 137698, 137699, 137700, 137701, 137702, 
+    137703, 137704, 137705, 137706, 137707, 137708, 137709, 137710, 137711, 
+    137712, 137713, 137714, 137715, 137716, 137717, 137718, 137719, 137720, 
+    137721, 137722, 137723, 137724, 137725, 137726, 137727, 137728, 137729, 
+    137730, 137731, 137732, 137733, 137734, 137735, 137736, 137737, 137738, 
+    137739, 137740, 137741, 137742, 137743, 137744, 137745, 137746, 137747, 
+    137748, 137749, 137750, 137751, 137752, 137753, 137754, 137755, 137756, 
+    137757, 137758, 137759, 137760, 137761, 137762, 137763, 137764, 137765, 
+    137766, 137767, 137768, 137769, 137770, 137771, 137772, 137773, 137774, 
+    137775, 137776, 137777, 137778, 137779, 137780, 137781, 137782, 137783, 
+    137784, 137785, 137786, 137787, 137788, 137789, 137790, 137791, 137792, 
+    137793, 137794, 137795, 137796, 137797, 137798, 137799, 137800, 137801, 
+    137802, 137803, 137804, 137805, 137806, 137807, 137808, 137809, 137810, 
+    137811, 137812, 137813, 137814, 137815, 137816, 137817, 137818, 137819, 
+    137820, 137821, 137822, 137823, 137824, 137825, 137826, 137827, 137828, 
+    137829, 137830, 137831, 137832, 137833, 137834, 137835, 137836, 137837, 
+    137838, 137839, 137840, 137841, 137842, 137843, 137844, 137845, 137846, 
+    137847, 137848, 137849, 137850, 137851, 137852, 137853, 137854, 137855, 
+    137856, 137857, 137858, 137859, 137860, 137861, 137862, 137863, 137864, 
+    137865, 137866, 137867, 137868, 137869, 137870, 137871, 137872, 137873, 
+    137874, 137875, 137876, 137877, 137878, 137879, 137880, 137881, 137882, 
+    137883, 137884, 137885, 137886, 137887, 137888, 137889, 137890, 137891, 
+    137892, 137893, 137894, 137895, 137896, 137897, 137898, 137899, 137900, 
+    137901, 137902, 137903, 137904, 137905, 137906, 137907, 137908, 137909, 
+    137910, 137911, 137912, 137913, 137914, 137915, 137916, 137917, 137918, 
+    137919, 137920, 137921, 137922, 137923, 137924, 137925, 137926, 137927, 
+    137928, 137929, 137930, 137931, 137932, 137933, 137934, 137935, 137936, 
+    137937, 137938, 137939, 137940, 137941, 137942, 137943, 137944, 137945, 
+    137946, 137947, 137948, 137949, 137950, 137951, 137952, 137953, 137954, 
+    137955, 137956, 137957, 137958, 137959, 137960, 137961, 137962, 137963, 
+    137964, 137965, 137966, 137967, 137968, 137969, 137970, 137971, 137972, 
+    137973, 137974, 137975, 137976, 137977, 137978, 137979, 137980, 137981, 
+    137982, 137983, 137984, 137985, 137986, 137987, 137988, 137989, 137990, 
+    137991, 137992, 137993, 137994, 137995, 137996, 137997, 137998, 137999, 
+    138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138008, 
+    138009, 138010, 138011, 138012, 138013, 138014, 138015, 138016, 138017, 
+    138018, 138019, 138020, 138021, 138022, 138023, 138024, 138025, 138026, 
+    138027, 138028, 138029, 138030, 138031, 138032, 138033, 138034, 138035, 
+    138036, 138037, 138038, 138039, 138040, 138041, 138042, 138043, 138044, 
+    138045, 138046, 138047, 138048, 138049, 138050, 138051, 138052, 138053, 
+    138054, 138055, 138056, 138057, 138058, 138059, 138060, 138061, 138062, 
+    138063, 138064, 138065, 138066, 138067, 138068, 138069, 138070, 138071, 
+    138072, 138073, 138074, 138075, 138076, 138077, 138078, 138079, 138080, 
+    138081, 138082, 138083, 138084, 138085, 138086, 138087, 138088, 138089, 
+    138090, 138091, 138092, 138093, 138094, 138095, 138096, 138097, 138098, 
+    138099, 138100, 138101, 138102, 138103, 138104, 138105, 138106, 138107, 
+    138108, 138109, 138110, 138111, 138112, 138113, 138114, 138115, 138116, 
+    138117, 138118, 138119, 138120, 138121, 138122, 138123, 138124, 138125, 
+    138126, 138127, 138128, 138129, 138130, 138131, 138132, 138133, 138134, 
+    138135, 138136, 138137, 138138, 138139, 138140, 138141, 138142, 138143, 
+    138144, 138145, 138146, 138147, 138148, 138149, 138150, 138151, 138152, 
+    138153, 138154, 138155, 138156, 138157, 138158, 138159, 138160, 138161, 
+    138162, 138163, 138164, 138165, 138166, 138167, 138168, 138169, 138170, 
+    138171, 138172, 138173, 138174, 138175, 138176, 138177, 138178, 138179, 
+    138180, 138181, 138182, 138183, 138184, 138185, 138186, 138187, 138188, 
+    138189, 138190, 138191, 138192, 138193, 138194, 138195, 138196, 138197, 
+    138198, 138199, 138200, 138201, 138202, 138203, 138204, 138205, 138206, 
+    138207, 138208, 138209, 138210, 138211, 138212, 138213, 138214, 138215, 
+    138216, 138217, 138218, 138219, 138220, 138221, 138222, 138223, 138224, 
+    138225, 138226, 138227, 138228, 138229, 138230, 138231, 138232, 138233, 
+    138234, 138235, 138236, 138237, 138238, 138239, 138240, 138241, 138242, 
+    138243, 138244, 138245, 138246, 138247, 138248, 138249, 138250, 138251, 
+    138252, 138253, 138254, 138255, 138256, 138257, 138258, 138259, 138260, 
+    138261, 138262, 138263, 138264, 138265, 138266, 138267, 138268, 138269, 
+    138270, 138271, 138272, 138273, 138274, 138275, 138276, 138277, 138278, 
+    138279, 138280, 138281, 138282, 138283, 138284, 138285, 138286, 138287, 
+    138288, 138289, 138290, 138291, 138292, 138293, 138294, 138295, 138296, 
+    138297, 138298, 138299, 138300, 138301, 138302, 138303, 138304, 138305, 
+    138306, 138307, 138308, 138309, 138310, 138311, 138312, 138313, 138314, 
+    138315, 138316, 138317, 138318, 138319, 138320, 138321, 138322, 138323, 
+    138324, 138325, 138326, 138327, 138328, 138329, 138330, 138331, 138332, 
+    138333, 138334, 138335, 138336, 138337, 138338, 138339, 138340, 138341, 
+    138342, 138343, 138344, 138345, 138346, 138347, 138348, 138349, 138350, 
+    138351, 138352, 138353, 138354, 138355, 138356, 138357, 138358, 138359, 
+    138360, 138361, 138362, 138363, 138364, 138365, 138366, 138367, 138368, 
+    138369, 138370, 138371, 138372, 138373, 138374, 138375, 138376, 138377, 
+    138378, 138379, 138380, 138381, 138382, 138383, 138384, 138385, 138386, 
+    138387, 138388, 138389, 138390, 138391, 138392, 138393, 138394, 138395, 
+    138396, 138397, 138398, 138399, 138400, 138401, 138402, 138403, 138404, 
+    138405, 138406, 138407, 138408, 138409, 138410, 138411, 138412, 138413, 
+    138414, 138415, 138416, 138417, 138418, 138419, 138420, 138421, 138422, 
+    138423, 138424, 138425, 138426, 138427, 138428, 138429, 138430, 138431, 
+    138432, 138433, 138434, 138435, 138436, 138437, 138438, 138439, 138440, 
+    138441, 138442, 138443, 138444, 138445, 138446, 138447, 138448, 138449, 
+    138450, 138451, 138452, 138453, 138454, 138455, 138456, 138457, 138458, 
+    138459, 138460, 138461, 138462, 138463, 138464, 138465, 138466, 138467, 
+    138468, 138469, 138470, 138471, 138472, 138473, 138474, 138475, 138476, 
+    138477, 138478, 138479, 138480, 138481, 138482, 138483, 138484, 138485, 
+    138486, 138487, 138488, 138489, 138490, 138491, 138492, 138493, 138494, 
+    138495, 138496, 138497, 138498, 138499, 138500, 138501, 138502, 138503, 
+    138504, 138505, 138506, 138507, 138508, 138509, 138510, 138511, 138512, 
+    138513, 138514, 138515, 138516, 138517, 138518, 138519, 138520, 138521, 
+    138522, 138523, 138524, 138525, 138526, 138527, 138528, 138529, 138530, 
+    138531, 138532, 138533, 138534, 138535, 138536, 138537, 138538, 138539, 
+    138540, 138541, 138542, 138543, 138544, 138545, 138546, 138547, 138548, 
+    138549, 138550, 138551, 138552, 138553, 138554, 138555, 138556, 138557, 
+    138558, 138559, 138560, 138561, 138562, 138563, 138564, 138565, 138566, 
+    138567, 138568, 138569, 138570, 138571, 138572, 138573, 138574, 138575, 
+    138576, 138577, 138578, 138579, 138580, 138581, 138582, 138583, 138584, 
+    138585, 138586, 138587, 138588, 138589, 138590, 138591, 138592, 138593, 
+    138594, 138595, 138596, 138597, 138598, 138599, 138600, 138601, 138602, 
+    138603, 138604, 138605, 138606, 138607, 138608, 138609, 138610, 138611, 
+    138612, 138613, 138614, 138615, 138616, 138617, 138618, 138619, 138620, 
+    138621, 138622, 138623, 138624, 138625, 138626, 138627, 138628, 138629, 
+    138630, 138631, 138632, 138633, 138634, 138635, 138636, 138637, 138638, 
+    138639, 138640, 138641, 138642, 138643, 138644, 138645, 138646, 138647, 
+    138648, 138649, 138650, 138651, 138652, 138653, 138654, 138655, 138656, 
+    138657, 138658, 138659, 138660, 138661, 138662, 138663, 138664, 138665, 
+    138666, 138667, 138668, 138669, 138670, 138671, 138672, 138673, 138674, 
+    138675, 138676, 138677, 138678, 138679, 138680, 138681, 138682, 138683, 
+    138684, 138685, 138686, 138687, 138688, 138689, 138690, 138691, 138692, 
+    138693, 138694, 138695, 138696, 138697, 138698, 138699, 138700, 138701, 
+    138702, 138703, 138704, 138705, 138706, 138707, 138708, 138709, 138710, 
+    138711, 138712, 138713, 138714, 138715, 138716, 138717, 138718, 138719, 
+    138720, 138721, 138722, 138723, 138724, 138725, 138726, 138727, 138728, 
+    138729, 138730, 138731, 138732, 138733, 138734, 138735, 138736, 138737, 
+    138738, 138739, 138740, 138741, 138742, 138743, 138744, 138745, 138746, 
+    138747, 138748, 138749, 138750, 138751, 138752, 138753, 138754, 138755, 
+    138756, 138757, 138758, 138759, 138760, 138761, 138762, 138763, 138764, 
+    138765, 138766, 138767, 138768, 138769, 138770, 138771, 138772, 138773, 
+    138774, 138775, 138776, 138777, 138778, 138779, 138780, 138781, 138782, 
+    138783, 138784, 138785, 138786, 138787, 138788, 138789, 138790, 138791, 
+    138792, 138793, 138794, 138795, 138796, 138797, 138798, 138799, 138800, 
+    138801, 138802, 138803, 138804, 138805, 138806, 138807, 138808, 138809, 
+    138810, 138811, 138812, 138813, 138814, 138815, 138816, 138817, 138818, 
+    138819, 138820, 138821, 138822, 138823, 138824, 138825, 138826, 138827, 
+    138828, 138829, 138830, 138831, 138832, 138833, 138834, 138835, 138836, 
+    138837, 138838, 138839, 138840, 138841, 138842, 138843, 138844, 138845, 
+    138846, 138847, 138848, 138849, 138850, 138851, 138852, 138853, 138854, 
+    138855, 138856, 138857, 138858, 138859, 138860, 138861, 138862, 138863, 
+    138864, 138865, 138866, 138867, 138868, 138869, 138870, 138871, 138872, 
+    138873, 138874, 138875, 138876, 138877, 138878, 138879, 138880, 138881, 
+    138882, 138883, 138884, 138885, 138886, 138887, 138888, 138889, 138890, 
+    138891, 138892, 138893, 138894, 138895, 138896, 138897, 138898, 138899, 
+    138900, 138901, 138902, 138903, 138904, 138905, 138906, 138907, 138908, 
+    138909, 138910, 138911, 138912, 138913, 138914, 138915, 138916, 138917, 
+    138918, 138919, 138920, 138921, 138922, 138923, 138924, 138925, 138926, 
+    138927, 138928, 138929, 138930, 138931, 138932, 138933, 138934, 138935, 
+    138936, 138937, 138938, 138939, 138940, 138941, 138942, 138943, 138944, 
+    138945, 138946, 138947, 138948, 138949, 138950, 138951, 138952, 138953, 
+    138954, 138955, 138956, 138957, 138958, 138959, 138960, 138961, 138962, 
+    138963, 138964, 138965, 138966, 138967, 138968, 138969, 138970, 138971, 
+    138972, 138973, 138974, 138975, 138976, 138977, 138978, 138979, 138980, 
+    138981, 138982, 138983, 138984, 138985, 138986, 138987, 138988, 138989, 
+    138990, 138991, 138992, 138993, 138994, 138995, 138996, 138997, 138998, 
+    138999, 139000, 139001, 139002, 139003, 139004, 139005, 139006, 139007, 
+    139008, 139009, 139010, 139011, 139012, 139013, 139014, 139015, 139016, 
+    139017, 139018, 139019, 139020, 139021, 139022, 139023, 139024, 139025, 
+    139026, 139027, 139028, 139029, 139030, 139031, 139032, 139033, 139034, 
+    139035, 139036, 139037, 139038, 139039, 139040, 139041, 139042, 139043, 
+    139044, 139045, 139046, 139047, 139048, 139049, 139050, 139051, 139052, 
+    139053, 139054, 139055, 139056, 139057, 139058, 139059, 139060, 139061, 
+    139062, 139063, 139064, 139065, 139066, 139067, 139068, 139069, 139070, 
+    139071, 139072, 139073, 139074, 139075, 139076, 139077, 139078, 139079, 
+    139080, 139081, 139082, 139083, 139084, 139085, 139086, 139087, 139088, 
+    139089, 139090, 139091, 139092, 139093, 139094, 139095, 139096, 139097, 
+    139098, 139099, 139100, 139101, 139102, 139103, 139104, 139105, 139106, 
+    139107, 139108, 139109, 139110, 139111, 139112, 139113, 139114, 139115, 
+    139116, 139117, 139118, 139119, 139120, 139121, 139122, 139123, 139124, 
+    139125, 139126, 139127, 139128, 139129, 139130, 139131, 139132, 139133, 
+    139134, 139135, 139136, 139137, 139138, 139139, 139140, 139141, 139142, 
+    139143, 139144, 139145, 139146, 139147, 139148, 139149, 139150, 139151, 
+    139152, 139153, 139154, 139155, 139156, 139157, 139158, 139159, 139160, 
+    139161, 139162, 139163, 139164, 139165, 139166, 139167, 139168, 139169, 
+    139170, 139171, 139172, 139173, 139174, 139175, 139176, 139177, 139178, 
+    139179, 139180, 139181, 139182, 139183, 139184, 139185, 139186, 139187, 
+    139188, 139189, 139190, 139191, 139192, 139193, 139194, 139195, 139196, 
+    139197, 139198, 139199, 139200, 139201, 139202, 139203, 139204, 139205, 
+    139206, 139207, 139208, 139209, 139210, 139211, 139212, 139213, 139214, 
+    139215, 139216, 139217, 139218, 139219, 139220, 139221, 139222, 139223, 
+    139224, 139225, 139226, 139227, 139228, 139229, 139230, 139231, 139232, 
+    139233, 139234, 139235, 139236, 139237, 139238, 139239, 139240, 139241, 
+    139242, 139243, 139244, 139245, 139246, 139247, 139248, 139249, 139250, 
+    139251, 139252, 139253, 139254, 139255, 139256, 139257, 139258, 139259, 
+    139260, 139261, 139262, 139263, 139264, 139265, 139266, 139267, 139268, 
+    139269, 139270, 139271, 139272, 139273, 139274, 139275, 139276, 139277, 
+    139278, 139279, 139280, 139281, 139282, 139283, 139284, 139285, 139286, 
+    139287, 139288, 139289, 139290, 139291, 139292, 139293, 139294, 139295, 
+    139296, 139297, 139298, 139299, 139300, 139301, 139302, 139303, 139304, 
+    139305, 139306, 139307, 139308, 139309, 139310, 139311, 139312, 139313, 
+    139314, 139315, 139316, 139317, 139318, 139319, 139320, 139321, 139322, 
+    139323, 139324, 139325, 139326, 139327, 139328, 139329, 139330, 139331, 
+    139332, 139333, 139334, 139335, 139336, 139337, 139338, 139339, 139340, 
+    139341, 139342, 139343, 139344, 139345, 139346, 139347, 139348, 139349, 
+    139350, 139351, 139352, 139353, 139354, 139355, 139356, 139357, 139358, 
+    139359, 139360, 139361, 139362, 139363, 139364, 139365, 139366, 139367, 
+    139368, 139369, 139370, 139371, 139372, 139373, 139374, 139375, 139376, 
+    139377, 139378, 139379, 139380, 139381, 139382, 139383, 139384, 139385, 
+    139386, 139387, 139388, 139389, 139390, 139391, 139392, 139393, 139394, 
+    139395, 139396, 139397, 139398, 139399, 139400, 139401, 139402, 139403, 
+    139404, 139405, 139406, 139407, 139408, 139409, 139410, 139411, 139412, 
+    139413, 139414, 139415, 139416, 139417, 139418, 139419, 139420, 139421, 
+    139422, 139423, 139424, 139425, 139426, 139427, 139428, 139429, 139430, 
+    139431, 139432, 139433, 139434, 139435, 139436, 139437, 139438, 139439, 
+    139440, 139441, 139442, 139443, 139444, 139445, 139446, 139447, 139448, 
+    139449, 139450, 139451, 139452, 139453, 139454, 139455, 139456, 139457, 
+    139458, 139459, 139460, 139461, 139462, 139463, 139464, 139465, 139466, 
+    139467, 139468, 139469, 139470, 139471, 139472, 139473, 139474, 139475, 
+    139476, 139477, 139478, 139479, 139480, 139481, 139482, 139483, 139484, 
+    139485, 139486, 139487, 139488, 139489, 139490, 139491, 139492, 139493, 
+    139494, 139495, 139496, 139497, 139498, 139499, 139500, 139501, 139502, 
+    139503, 139504, 139505, 139506, 139507, 139508, 139509, 139510, 139511, 
+    139512, 139513, 139514, 139515, 139516, 139517, 139518, 139519, 139520, 
+    139521, 139522, 139523, 139524, 139525, 139526, 139527, 139528, 139529, 
+    139530, 139531, 139532, 139533, 139534, 139535, 139536, 139537, 139538, 
+    139539, 139540, 139541, 139542, 139543, 139544, 139545, 139546, 139547, 
+    139548, 139549, 139550, 139551, 139552, 139553, 139554, 139555, 139556, 
+    139557, 139558, 139559, 139560, 139561, 139562, 139563, 139564, 139565, 
+    139566, 139567, 139568, 139569, 139570, 139571, 139572, 139573, 139574, 
+    139575, 139576, 139577, 139578, 139579, 139580, 139581, 139582, 139583, 
+    139584, 139585, 139586, 139587, 139588, 139589, 139590, 139591, 139592, 
+    139593, 139594, 139595, 139596, 139597, 139598, 139599, 139600, 139601, 
+    139602, 139603, 139604, 139605, 139606, 139607, 139608, 139609, 139610, 
+    139611, 139612, 139613, 139614, 139615, 139616, 139617, 139618, 139619, 
+    139620, 139621, 139622, 139623, 139624, 139625, 139626, 139627, 139628, 
+    139629, 139630, 139631, 139632, 139633, 139634, 139635, 139636, 139637, 
+    139638, 139639, 139640, 139641, 139642, 139643, 139644, 139645, 139646, 
+    139647, 139648, 139649, 139650, 139651, 139652, 139653, 139654, 139655, 
+    139656, 139657, 139658, 139659, 139660, 139661, 139662, 139663, 139664, 
+    139665, 139666, 139667, 139668, 139669, 139670, 139671, 139672, 139673, 
+    139674, 139675, 139676, 139677, 139678, 139679, 139680, 139681, 139682, 
+    139683, 139684, 139685, 139686, 139687, 139688, 139689, 139690, 139691, 
+    139692, 139693, 139694, 139695, 139696, 139697, 139698, 139699, 139700, 
+    139701, 139702, 139703, 139704, 139705, 139706, 139707, 139708, 139709, 
+    139710, 139711, 139712, 139713, 139714, 139715, 139716, 139717, 139718, 
+    139719, 139720, 139721, 139722, 139723, 139724, 139725, 139726, 139727, 
+    139728, 139729, 139730, 139731, 139732, 139733, 139734, 139735, 139736, 
+    139737, 139738, 139739, 139740, 139741, 139742, 139743, 139744, 139745, 
+    139746, 139747, 139748, 139749, 139750, 139751, 139752, 139753, 139754, 
+    139755, 139756, 139757, 139758, 139759, 139760, 139761, 139762, 139763, 
+    139764, 139765, 139766, 139767, 139768, 139769, 139770, 139771, 139772, 
+    139773, 139774, 139775, 139776, 139777, 139778, 139779, 139780, 139781, 
+    139782, 139783, 139784, 139785, 139786, 139787, 139788, 139789, 139790, 
+    139791, 139792, 139793, 139794, 139795, 139796, 139797, 139798, 139799, 
+    139800, 139801, 139802, 139803, 139804, 139805, 139806, 139807, 139808, 
+    139809, 139810, 139811, 139812, 139813, 139814, 139815, 139816, 139817, 
+    139818, 139819, 139820, 139821, 139822, 139823, 139824, 139825, 139826, 
+    139827, 139828, 139829, 139830, 139831, 139832, 139833, 139834, 139835, 
+    139836, 139837, 139838, 139839, 139840, 139841, 139842, 139843, 139844, 
+    139845, 139846, 139847, 139848, 139849, 139850, 139851, 139852, 139853, 
+    139854, 139855, 139856, 139857, 139858, 139859, 139860, 139861, 139862, 
+    139863, 139864, 139865, 139866, 139867, 139868, 139869, 139870, 139871, 
+    139872, 139873, 139874, 139875, 139876, 139877, 139878, 139879, 139880, 
+    139881, 139882, 139883, 139884, 139885, 139886, 139887, 139888, 139889, 
+    139890, 139891, 139892, 139893, 139894, 139895, 139896, 139897, 139898, 
+    139899, 139900, 139901, 139902, 139903, 139904, 139905, 139906, 139907, 
+    139908, 139909, 139910, 139911, 139912, 139913, 139914, 139915, 139916, 
+    139917, 139918, 139919, 139920, 139921, 139922, 139923, 139924, 139925, 
+    139926, 139927, 139928, 139929, 139930, 139931, 139932, 139933, 139934, 
+    139935, 139936, 139937, 139938, 139939, 139940, 139941, 139942, 139943, 
+    139944, 139945, 139946, 139947, 139948, 139949, 139950, 139951, 139952, 
+    139953, 139954, 139955, 139956, 139957, 139958, 139959, 139960, 139961, 
+    139962, 139963, 139964, 139965, 139966, 139967, 139968, 139969, 139970, 
+    139971, 139972, 139973, 139974, 139975, 139976, 139977, 139978, 139979, 
+    139980, 139981, 139982, 139983, 139984, 139985, 139986, 139987, 139988, 
+    139989, 139990, 139991, 139992, 139993, 139994, 139995, 139996, 139997, 
+    139998, 139999, 140000, 140001, 140002, 140003, 140004, 140005, 140006, 
+    140007, 140008, 140009, 140010, 140011, 140012, 140013, 140014, 140015, 
+    140016, 140017, 140018, 140019, 140020, 140021, 140022, 140023, 140024, 
+    140025, 140026, 140027, 140028, 140029, 140030, 140031, 140032, 140033, 
+    140034, 140035, 140036, 140037, 140038, 140039, 140040, 140041, 140042, 
+    140043, 140044, 140045, 140046, 140047, 140048, 140049, 140050, 140051, 
+    140052, 140053, 140054, 140055, 140056, 140057, 140058, 140059, 140060, 
+    140061, 140062, 140063, 140064, 140065, 140066, 140067, 140068, 140069, 
+    140070, 140071, 140072, 140073, 140074, 140075, 140076, 140077, 140078, 
+    140079, 140080, 140081, 140082, 140083, 140084, 140085, 140086, 140087, 
+    140088, 140089, 140090, 140091, 140092, 140093, 140094, 140095, 140096, 
+    140097, 140098, 140099, 140100, 140101, 140102, 140103, 140104, 140105, 
+    140106, 140107, 140108, 140109, 140110, 140111, 140112, 140113, 140114, 
+    140115, 140116, 140117, 140118, 140119, 140120, 140121, 140122, 140123, 
+    140124, 140125, 140126, 140127, 140128, 140129, 140130, 140131, 140132, 
+    140133, 140134, 140135, 140136, 140137, 140138, 140139, 140140, 140141, 
+    140142, 140143, 140144, 140145, 140146, 140147, 140148, 140149, 140150, 
+    140151, 140152, 140153, 140154, 140155, 140156, 140157, 140158, 140159, 
+    140160, 140161, 140162, 140163, 140164, 140165, 140166, 140167, 140168, 
+    140169, 140170, 140171, 140172, 140173, 140174, 140175, 140176, 140177, 
+    140178, 140179, 140180, 140181, 140182, 140183, 140184, 140185, 140186, 
+    140187, 140188, 140189, 140190, 140191, 140192, 140193, 140194, 140195, 
+    140196, 140197, 140198, 140199, 140200, 140201, 140202, 140203, 140204, 
+    140205, 140206, 140207, 140208, 140209, 140210, 140211, 140212, 140213, 
+    140214, 140215, 140216, 140217, 140218, 140219, 140220, 140221, 140222, 
+    140223, 140224, 140225, 140226, 140227, 140228, 140229, 140230, 140231, 
+    140232, 140233, 140234, 140235, 140236, 140237, 140238, 140239, 140240, 
+    140241, 140242, 140243, 140244, 140245, 140246, 140247, 140248, 140249, 
+    140250, 140251, 140252, 140253, 140254, 140255, 140256, 140257, 140258, 
+    140259, 140260, 140261, 140262, 140263, 140264, 140265, 140266, 140267, 
+    140268, 140269, 140270, 140271, 140272, 140273, 140274, 140275, 140276, 
+    140277, 140278, 140279, 140280, 140281, 140282, 140283, 140284, 140285, 
+    140286, 140287, 140288, 140289, 140290, 140291, 140292, 140293, 140294, 
+    140295, 140296, 140297, 140298, 140299, 140300, 140301, 140302, 140303, 
+    140304, 140305, 140306, 140307, 140308, 140309, 140310, 140311, 140312, 
+    140313, 140314, 140315, 140316, 140317, 140318, 140319, 140320, 140321, 
+    140322, 140323, 140324, 140325, 140326, 140327, 140328, 140329, 140330, 
+    140331, 140332, 140333, 140334, 140335, 140336, 140337, 140338, 140339, 
+    140340, 140341, 140342, 140343, 140344, 140345, 140346, 140347, 140348, 
+    140349, 140350, 140351, 140352, 140353, 140354, 140355, 140356, 140357, 
+    140358, 140359, 140360, 140361, 140362, 140363, 140364, 140365, 140366, 
+    140367, 140368, 140369, 140370, 140371, 140372, 140373, 140374, 140375, 
+    140376, 140377, 140378, 140379, 140380, 140381, 140382, 140383, 140384, 
+    140385, 140386, 140387, 140388, 140389, 140390, 140391, 140392, 140393, 
+    140394, 140395, 140396, 140397, 140398, 140399, 140400, 140401, 140402, 
+    140403, 140404, 140405, 140406, 140407, 140408, 140409, 140410, 140411, 
+    140412, 140413, 140414, 140415, 140416, 140417, 140418, 140419, 140420, 
+    140421, 140422, 140423, 140424, 140425, 140426, 140427, 140428, 140429, 
+    140430, 140431, 140432, 140433, 140434, 140435, 140436, 140437, 140438, 
+    140439, 140440, 140441, 140442, 140443, 140444, 140445, 140446, 140447, 
+    140448, 140449, 140450, 140451, 140452, 140453, 140454, 140455, 140456, 
+    140457, 140458, 140459, 140460, 140461, 140462, 140463, 140464, 140465, 
+    140466, 140467, 140468, 140469, 140470, 140471, 140472, 140473, 140474, 
+    140475, 140476, 140477, 140478, 140479, 140480, 140481, 140482, 140483, 
+    140484, 140485, 140486, 140487, 140488, 140489, 140490, 140491, 140492, 
+    140493, 140494, 140495, 140496, 140497, 140498, 140499, 140500, 140501, 
+    140502, 140503, 140504, 140505, 140506, 140507, 140508, 140509, 140510, 
+    140511, 140512, 140513, 140514, 140515, 140516, 140517, 140518, 140519, 
+    140520, 140521, 140522, 140523, 140524, 140525, 140526, 140527, 140528, 
+    140529, 140530, 140531, 140532, 140533, 140534, 140535, 140536, 140537, 
+    140538, 140539, 140540, 140541, 140542, 140543, 140544, 140545, 140546, 
+    140547, 140548, 140549, 140550, 140551, 140552, 140553, 140554, 140555, 
+    140556, 140557, 140558, 140559, 140560, 140561, 140562, 140563, 140564, 
+    140565, 140566, 140567, 140568, 140569, 140570, 140571, 140572, 140573, 
+    140574, 140575, 140576, 140577, 140578, 140579, 140580, 140581, 140582, 
+    140583, 140584, 140585, 140586, 140587, 140588, 140589, 140590, 140591, 
+    140592, 140593, 140594, 140595, 140596, 140597, 140598, 140599, 140600, 
+    140601, 140602, 140603, 140604, 140605, 140606, 140607, 140608, 140609, 
+    140610, 140611, 140612, 140613, 140614, 140615, 140616, 140617, 140618, 
+    140619, 140620, 140621, 140622, 140623, 140624, 140625, 140626, 140627, 
+    140628, 140629, 140630, 140631, 140632, 140633, 140634, 140635, 140636, 
+    140637, 140638, 140639, 140640, 140641, 140642, 140643, 140644, 140645, 
+    140646, 140647, 140648, 140649, 140650, 140651, 140652, 140653, 140654, 
+    140655, 140656, 140657, 140658, 140659, 140660, 140661, 140662, 140663, 
+    140664, 140665, 140666, 140667, 140668, 140669, 140670, 140671, 140672, 
+    140673, 140674, 140675, 140676, 140677, 140678, 140679, 140680, 140681, 
+    140682, 140683, 140684, 140685, 140686, 140687, 140688, 140689, 140690, 
+    140691, 140692, 140693, 140694, 140695, 140696, 140697, 140698, 140699, 
+    140700, 140701, 140702, 140703, 140704, 140705, 140706, 140707, 140708, 
+    140709, 140710, 140711, 140712, 140713, 140714, 140715, 140716, 140717, 
+    140718, 140719, 140720, 140721, 140722, 140723, 140724, 140725, 140726, 
+    140727, 140728, 140729, 140730, 140731, 140732, 140733, 140734, 140735, 
+    140736, 140737, 140738, 140739, 140740, 140741, 140742, 140743, 140744, 
+    140745, 140746, 140747, 140748, 140749, 140750, 140751, 140752, 140753, 
+    140754, 140755, 140756, 140757, 140758, 140759, 140760, 140761, 140762, 
+    140763, 140764, 140765, 140766, 140767, 140768, 140769, 140770, 140771, 
+    140772, 140773, 140774, 140775, 140776, 140777, 140778, 140779, 140780, 
+    140781, 140782, 140783, 140784, 140785, 140786, 140787, 140788, 140789, 
+    140790, 140791, 140792, 140793, 140794, 140795, 140796, 140797, 140798, 
+    140799, 140800, 140801, 140802, 140803, 140804, 140805, 140806, 140807, 
+    140808, 140809, 140810, 140811, 140812, 140813, 140814, 140815, 140816, 
+    140817, 140818, 140819, 140820, 140821, 140822, 140823, 140824, 140825, 
+    140826, 140827, 140828, 140829, 140830, 140831, 140832, 140833, 140834, 
+    140835, 140836, 140837, 140838, 140839, 140840, 140841, 140842, 140843, 
+    140844, 140845, 140846, 140847, 140848, 140849, 140850, 140851, 140852, 
+    140853, 140854, 140855, 140856, 140857, 140858, 140859, 140860, 140861, 
+    140862, 140863, 140864, 140865, 140866, 140867, 140868, 140869, 140870, 
+    140871, 140872, 140873, 140874, 140875, 140876, 140877, 140878, 140879, 
+    140880, 140881, 140882, 140883, 140884, 140885, 140886, 140887, 140888, 
+    140889, 140890, 140891, 140892, 140893, 140894, 140895, 140896, 140897, 
+    140898, 140899, 140900, 140901, 140902, 140903, 140904, 140905, 140906, 
+    140907, 140908, 140909, 140910, 140911, 140912, 140913, 140914, 140915, 
+    140916, 140917, 140918, 140919, 140920, 140921, 140922, 140923, 140924, 
+    140925, 140926, 140927, 140928, 140929, 140930, 140931, 140932, 140933, 
+    140934, 140935, 140936, 140937, 140938, 140939, 140940, 140941, 140942, 
+    140943, 140944, 140945, 140946, 140947, 140948, 140949, 140950, 140951, 
+    140952, 140953, 140954, 140955, 140956, 140957, 140958, 140959, 140960, 
+    140961, 140962, 140963, 140964, 140965, 140966, 140967, 140968, 140969, 
+    140970, 140971, 140972, 140973, 140974, 140975, 140976, 140977, 140978, 
+    140979, 140980, 140981, 140982, 140983, 140984, 140985, 140986, 140987, 
+    140988, 140989, 140990, 140991, 140992, 140993, 140994, 140995, 140996, 
+    140997, 140998, 140999, 141000, 141001, 141002, 141003, 141004, 141005, 
+    141006, 141007, 141008, 141009, 141010, 141011, 141012, 141013, 141014, 
+    141015, 141016, 141017, 141018, 141019, 141020, 141021, 141022, 141023, 
+    141024, 141025, 141026, 141027, 141028, 141029, 141030, 141031, 141032, 
+    141033, 141034, 141035, 141036, 141037, 141038, 141039, 141040, 141041, 
+    141042, 141043, 141044, 141045, 141046, 141047, 141048, 141049, 141050, 
+    141051, 141052, 141053, 141054, 141055, 141056, 141057, 141058, 141059, 
+    141060, 141061, 141062, 141063, 141064, 141065, 141066, 141067, 141068, 
+    141069, 141070, 141071, 141072, 141073, 141074, 141075, 141076, 141077, 
+    141078, 141079, 141080, 141081, 141082, 141083, 141084, 141085, 141086, 
+    141087, 141088, 141089, 141090, 141091, 141092, 141093, 141094, 141095, 
+    141096, 141097, 141098, 141099, 141100, 141101, 141102, 141103, 141104, 
+    141105, 141106, 141107, 141108, 141109, 141110, 141111, 141112, 141113, 
+    141114, 141115, 141116, 141117, 141118, 141119, 141120, 141121, 141122, 
+    141123, 141124, 141125, 141126, 141127, 141128, 141129, 141130, 141131, 
+    141132, 141133, 141134, 141135, 141136, 141137, 141138, 141139, 141140, 
+    141141, 141142, 141143, 141144, 141145, 141146, 141147, 141148, 141149, 
+    141150, 141151, 141152, 141153, 141154, 141155, 141156, 141157, 141158, 
+    141159, 141160, 141161, 141162, 141163, 141164, 141165, 141166, 141167, 
+    141168, 141169, 141170, 141171, 141172, 141173, 141174, 141175, 141176, 
+    141177, 141178, 141179, 141180, 141181, 141182, 141183, 141184, 141185, 
+    141186, 141187, 141188, 141189, 141190, 141191, 141192, 141193, 141194, 
+    141195, 141196, 141197, 141198, 141199, 141200, 141201, 141202, 141203, 
+    141204, 141205, 141206, 141207, 141208, 141209, 141210, 141211, 141212, 
+    141213, 141214, 141215, 141216, 141217, 141218, 141219, 141220, 141221, 
+    141222, 141223, 141224, 141225, 141226, 141227, 141228, 141229, 141230, 
+    141231, 141232, 141233, 141234, 141235, 141236, 141237, 141238, 141239, 
+    141240, 141241, 141242, 141243, 141244, 141245, 141246, 141247, 141248, 
+    141249, 141250, 141251, 141252, 141253, 141254, 141255, 141256, 141257, 
+    141258, 141259, 141260, 141261, 141262, 141263, 141264, 141265, 141266, 
+    141267, 141268, 141269, 141270, 141271, 141272, 141273, 141274, 141275, 
+    141276, 141277, 141278, 141279, 141280, 141281, 141282, 141283, 141284, 
+    141285, 141286, 141287, 141288, 141289, 141290, 141291, 141292, 141293, 
+    141294, 141295, 141296, 141297, 141298, 141299, 141300, 141301, 141302, 
+    141303, 141304, 141305, 141306, 141307, 141308, 141309, 141310, 141311, 
+    141312, 141313, 141314, 141315, 141316, 141317, 141318, 141319, 141320, 
+    141321, 141322, 141323, 141324, 141325, 141326, 141327, 141328, 141329, 
+    141330, 141331, 141332, 141333, 141334, 141335, 141336, 141337, 141338, 
+    141339, 141340, 141341, 141342, 141343, 141344, 141345, 141346, 141347, 
+    141348, 141349, 141350, 141351, 141352, 141353, 141354, 141355, 141356, 
+    141357, 141358, 141359, 141360, 141361, 141362, 141363, 141364, 141365, 
+    141366, 141367, 141368, 141369, 141370, 141371, 141372, 141373, 141374, 
+    141375, 141376, 141377, 141378, 141379, 141380, 141381, 141382, 141383, 
+    141384, 141385, 141386, 141387, 141388, 141389, 141390, 141391, 141392, 
+    141393, 141394, 141395, 141396, 141397, 141398, 141399, 141400, 141401, 
+    141402, 141403, 141404, 141405, 141406, 141407, 141408, 141409, 141410, 
+    141411, 141412, 141413, 141414, 141415, 141416, 141417, 141418, 141419, 
+    141420, 141421, 141422, 141423, 141424, 141425, 141426, 141427, 141428, 
+    141429, 141430, 141431, 141432, 141433, 141434, 141435, 141436, 141437, 
+    141438, 141439, 141440, 141441, 141442, 141443, 141444, 141445, 141446, 
+    141447, 141448, 141449, 141450, 141451, 141452, 141453, 141454, 141455, 
+    141456, 141457, 141458, 141459, 141460, 141461, 141462, 141463, 141464, 
+    141465, 141466, 141467, 141468, 141469, 141470, 141471, 141472, 141473, 
+    141474, 141475, 141476, 141477, 141478, 141479, 141480, 141481, 141482, 
+    141483, 141484, 141485, 141486, 141487, 141488, 141489, 141490, 141491, 
+    141492, 141493, 141494, 141495, 141496, 141497, 141498, 141499, 141500, 
+    141501, 141502, 141503, 141504, 141505, 141506, 141507, 141508, 141509, 
+    141510, 141511, 141512, 141513, 141514, 141515, 141516, 141517, 141518, 
+    141519, 141520, 141521, 141522, 141523, 141524, 141525, 141526, 141527, 
+    141528, 141529, 141530, 141531, 141532, 141533, 141534, 141535, 141536, 
+    141537, 141538, 141539, 141540, 141541, 141542, 141543, 141544, 141545, 
+    141546, 141547, 141548, 141549, 141550, 141551, 141552, 141553, 141554, 
+    141555, 141556, 141557, 141558, 141559, 141560, 141561, 141562, 141563, 
+    141564, 141565, 141566, 141567, 141568, 141569, 141570, 141571, 141572, 
+    141573, 141574, 141575, 141576, 141577, 141578, 141579, 141580, 141581, 
+    141582, 141583, 141584, 141585, 141586, 141587, 141588, 141589, 141590, 
+    141591, 141592, 141593, 141594, 141595, 141596, 141597, 141598, 141599, 
+    141600, 141601, 141602, 141603, 141604, 141605, 141606, 141607, 141608, 
+    141609, 141610, 141611, 141612, 141613, 141614, 141615, 141616, 141617, 
+    141618, 141619, 141620, 141621, 141622, 141623, 141624, 141625, 141626, 
+    141627, 141628, 141629, 141630, 141631, 141632, 141633, 141634, 141635, 
+    141636, 141637, 141638, 141639, 141640, 141641, 141642, 141643, 141644, 
+    141645, 141646, 141647, 141648, 141649, 141650, 141651, 141652, 141653, 
+    141654, 141655, 141656, 141657, 141658, 141659, 141660, 141661, 141662, 
+    141663, 141664, 141665, 141666, 141667, 141668, 141669, 141670, 141671, 
+    141672, 141673, 141674, 141675, 141676, 141677, 141678, 141679, 141680, 
+    141681, 141682, 141683, 141684, 141685, 141686, 141687, 141688, 141689, 
+    141690, 141691, 141692, 141693, 141694, 141695, 141696, 141697, 141698, 
+    141699, 141700, 141701, 141702, 141703, 141704, 141705, 141706, 141707, 
+    141708, 141709, 141710, 141711, 141712, 141713, 141714, 141715, 141716, 
+    141717, 141718, 141719, 141720, 141721, 141722, 141723, 141724, 141725, 
+    141726, 141727, 141728, 141729, 141730, 141731, 141732, 141733, 141734, 
+    141735, 141736, 141737, 141738, 141739, 141740, 141741, 141742, 141743, 
+    141744, 141745, 141746, 141747, 141748, 141749, 141750, 141751, 141752, 
+    141753, 141754, 141755, 141756, 141757, 141758, 141759, 141760, 141761, 
+    141762, 141763, 141764, 141765, 141766, 141767, 141768, 141769, 141770, 
+    141771, 141772, 141773, 141774, 141775, 141776, 141777, 141778, 141779, 
+    141780, 141781, 141782, 141783, 141784, 141785, 141786, 141787, 141788, 
+    141789, 141790, 141791, 141792, 141793, 141794, 141795, 141796, 141797, 
+    141798, 141799, 141800, 141801, 141802, 141803, 141804, 141805, 141806, 
+    141807, 141808, 141809, 141810, 141811, 141812, 141813, 141814, 141815, 
+    141816, 141817, 141818, 141819, 141820, 141821, 141822, 141823, 141824, 
+    141825, 141826, 141827, 141828, 141829, 141830, 141831, 141832, 141833, 
+    141834, 141835, 141836, 141837, 141838, 141839, 141840, 141841, 141842, 
+    141843, 141844, 141845, 141846, 141847, 141848, 141849, 141850, 141851, 
+    141852, 141853, 141854, 141855, 141856, 141857, 141858, 141859, 141860, 
+    141861, 141862, 141863, 141864, 141865, 141866, 141867, 141868, 141869, 
+    141870, 141871, 141872, 141873, 141874, 141875, 141876, 141877, 141878, 
+    141879, 141880, 141881, 141882, 141883, 141884, 141885, 141886, 141887, 
+    141888, 141889, 141890, 141891, 141892, 141893, 141894, 141895, 141896, 
+    141897, 141898, 141899, 141900, 141901, 141902, 141903, 141904, 141905, 
+    141906, 141907, 141908, 141909, 141910, 141911, 141912, 141913, 141914, 
+    141915, 141916, 141917, 141918, 141919, 141920, 141921, 141922, 141923, 
+    141924, 141925, 141926, 141927, 141928, 141929, 141930, 141931, 141932, 
+    141933, 141934, 141935, 141936, 141937, 141938, 141939, 141940, 141941, 
+    141942, 141943, 141944, 141945, 141946, 141947, 141948, 141949, 141950, 
+    141951, 141952, 141953, 141954, 141955, 141956, 141957, 141958, 141959, 
+    141960, 141961, 141962, 141963, 141964, 141965, 141966, 141967, 141968, 
+    141969, 141970, 141971, 141972, 141973, 141974, 141975, 141976, 141977, 
+    141978, 141979, 141980, 141981, 141982, 141983, 141984, 141985, 141986, 
+    141987, 141988, 141989, 141990, 141991, 141992, 141993, 141994, 141995, 
+    141996, 141997, 141998, 141999, 142000, 142001, 142002, 142003, 142004, 
+    142005, 142006, 142007, 142008, 142009, 142010, 142011, 142012, 142013, 
+    142014, 142015, 142016, 142017, 142018, 142019, 142020, 142021, 142022, 
+    142023, 142024, 142025, 142026, 142027, 142028, 142029, 142030, 142031, 
+    142032, 142033, 142034, 142035, 142036, 142037, 142038, 142039, 142040, 
+    142041, 142042, 142043, 142044, 142045, 142046, 142047, 142048, 142049, 
+    142050, 142051, 142052, 142053, 142054, 142055, 142056, 142057, 142058, 
+    142059, 142060, 142061, 142062, 142063, 142064, 142065, 142066, 142067, 
+    142068, 142069, 142070, 142071, 142072, 142073, 142074, 142075, 142076, 
+    142077, 142078, 142079, 142080, 142081, 142082, 142083, 142084, 142085, 
+    142086, 142087, 142088, 142089, 142090, 142091, 142092, 142093, 142094, 
+    142095, 142096, 142097, 142098, 142099, 142100, 142101, 142102, 142103, 
+    142104, 142105, 142106, 142107, 142108, 142109, 142110, 142111, 142112, 
+    142113, 142114, 142115, 142116, 142117, 142118, 142119, 142120, 142121, 
+    142122, 142123, 142124, 142125, 142126, 142127, 142128, 142129, 142130, 
+    142131, 142132, 142133, 142134, 142135, 142136, 142137, 142138, 142139, 
+    142140, 142141, 142142, 142143, 142144, 142145, 142146, 142147, 142148, 
+    142149, 142150, 142151, 142152, 142153, 142154, 142155, 142156, 142157, 
+    142158, 142159, 142160, 142161, 142162, 142163, 142164, 142165, 142166, 
+    142167, 142168, 142169, 142170, 142171, 142172, 142173, 142174, 142175, 
+    142176, 142177, 142178, 142179, 142180, 142181, 142182, 142183, 142184, 
+    142185, 142186, 142187, 142188, 142189, 142190, 142191, 142192, 142193, 
+    142194, 142195, 142196, 142197, 142198, 142199, 142200, 142201, 142202, 
+    142203, 142204, 142205, 142206, 142207, 142208, 142209, 142210, 142211, 
+    142212, 142213, 142214, 142215, 142216, 142217, 142218, 142219, 142220, 
+    142221, 142222, 142223, 142224, 142225, 142226, 142227, 142228, 142229, 
+    142230, 142231, 142232, 142233, 142234, 142235, 142236, 142237, 142238, 
+    142239, 142240, 142241, 142242, 142243, 142244, 142245, 142246, 142247, 
+    142248, 142249, 142250, 142251, 142252, 142253, 142254, 142255, 142256, 
+    142257, 142258, 142259, 142260, 142261, 142262, 142263, 142264, 142265, 
+    142266, 142267, 142268, 142269, 142270, 142271, 142272, 142273, 142274, 
+    142275, 142276, 142277, 142278, 142279, 142280, 142281, 142282, 142283, 
+    142284, 142285, 142286, 142287, 142288, 142289, 142290, 142291, 142292, 
+    142293, 142294, 142295, 142296, 142297, 142298, 142299, 142300, 142301, 
+    142302, 142303, 142304, 142305, 142306, 142307, 142308, 142309, 142310, 
+    142311, 142312, 142313, 142314, 142315, 142316, 142317, 142318, 142319, 
+    142320, 142321, 142322, 142323, 142324, 142325, 142326, 142327, 142328, 
+    142329, 142330, 142331, 142332, 142333, 142334, 142335, 142336, 142337, 
+    142338, 142339, 142340, 142341, 142342, 142343, 142344, 142345, 142346, 
+    142347, 142348, 142349, 142350, 142351, 142352, 142353, 142354, 142355, 
+    142356, 142357, 142358, 142359, 142360, 142361, 142362, 142363, 142364, 
+    142365, 142366, 142367, 142368, 142369, 142370, 142371, 142372, 142373, 
+    142374, 142375, 142376, 142377, 142378, 142379, 142380, 142381, 142382, 
+    142383, 142384, 142385, 142386, 142387, 142388, 142389, 142390, 142391, 
+    142392, 142393, 142394, 142395, 142396, 142397, 142398, 142399, 142400, 
+    142401, 142402, 142403, 142404, 142405, 142406, 142407, 142408, 142409, 
+    142410, 142411, 142412, 142413, 142414, 142415, 142416, 142417, 142418, 
+    142419, 142420, 142421, 142422, 142423, 142424, 142425, 142426, 142427, 
+    142428, 142429, 142430, 142431, 142432, 142433, 142434, 142435, 142436, 
+    142437, 142438, 142439, 142440, 142441, 142442, 142443, 142444, 142445, 
+    142446, 142447, 142448, 142449, 142450, 142451, 142452, 142453, 142454, 
+    142455, 142456, 142457, 142458, 142459, 142460, 142461, 142462, 142463, 
+    142464, 142465, 142466, 142467, 142468, 142469, 142470, 142471, 142472, 
+    142473, 142474, 142475, 142476, 142477, 142478, 142479, 142480, 142481, 
+    142482, 142483, 142484, 142485, 142486, 142487, 142488, 142489, 142490, 
+    142491, 142492, 142493, 142494, 142495, 142496, 142497, 142498, 142499, 
+    142500, 142501, 142502, 142503, 142504, 142505, 142506, 142507, 142508, 
+    142509, 142510, 142511, 142512, 142513, 142514, 142515, 142516, 142517, 
+    142518, 142519, 142520, 142521, 142522, 142523, 142524, 142525, 142526, 
+    142527, 142528, 142529, 142530, 142531, 142532, 142533, 142534, 142535, 
+    142536, 142537, 142538, 142539, 142540, 142541, 142542, 142543, 142544, 
+    142545, 142546, 142547, 142548, 142549, 142550, 142551, 142552, 142553, 
+    142554, 142555, 142556, 142557, 142558, 142559, 142560, 142561, 142562, 
+    142563, 142564, 142565, 142566, 142567, 142568, 142569, 142570, 142571, 
+    142572, 142573, 142574, 142575, 142576, 142577, 142578, 142579, 142580, 
+    142581, 142582, 142583, 142584, 142585, 142586, 142587, 142588, 142589, 
+    142590, 142591, 142592, 142593, 142594, 142595, 142596, 142597, 142598, 
+    142599, 142600, 142601, 142602, 142603, 142604, 142605, 142606, 142607, 
+    142608, 142609, 142610, 142611, 142612, 142613, 142614, 142615, 142616, 
+    142617, 142618, 142619, 142620, 142621, 142622, 142623, 142624, 142625, 
+    142626, 142627, 142628, 142629, 142630, 142631, 142632, 142633, 142634, 
+    142635, 142636, 142637, 142638, 142639, 142640, 142641, 142642, 142643, 
+    142644, 142645, 142646, 142647, 142648, 142649, 142650, 142651, 142652, 
+    142653, 142654, 142655, 142656, 142657, 142658, 142659, 142660, 142661, 
+    142662, 142663, 142664, 142665, 142666, 142667, 142668, 142669, 142670, 
+    142671, 142672, 142673, 142674, 142675, 142676, 142677, 142678, 142679, 
+    142680, 142681, 142682, 142683, 142684, 142685, 142686, 142687, 142688, 
+    142689, 142690, 142691, 142692, 142693, 142694, 142695, 142696, 142697, 
+    142698, 142699, 142700, 142701, 142702, 142703, 142704, 142705, 142706, 
+    142707, 142708, 142709, 142710, 142711, 142712, 142713, 142714, 142715, 
+    142716, 142717, 142718, 142719, 142720, 142721, 142722, 142723, 142724, 
+    142725, 142726, 142727, 142728, 142729, 142730, 142731, 142732, 142733, 
+    142734, 142735, 142736, 142737, 142738, 142739, 142740, 142741, 142742, 
+    142743, 142744, 142745, 142746, 142747, 142748, 142749, 142750, 142751, 
+    142752, 142753, 142754, 142755, 142756, 142757, 142758, 142759, 142760, 
+    142761, 142762, 142763, 142764, 142765, 142766, 142767, 142768, 142769, 
+    142770, 142771, 142772, 142773, 142774, 142775, 142776, 142777, 142778, 
+    142779, 142780, 142781, 142782, 142783, 142784, 142785, 142786, 142787, 
+    142788, 142789, 142790, 142791, 142792, 142793, 142794, 142795, 142796, 
+    142797, 142798, 142799, 142800, 142801, 142802, 142803, 142804, 142805, 
+    142806, 142807, 142808, 142809, 142810, 142811, 142812, 142813, 142814, 
+    142815, 142816, 142817, 142818, 142819, 142820, 142821, 142822, 142823, 
+    142824, 142825, 142826, 142827, 142828, 142829, 142830, 142831, 142832, 
+    142833, 142834, 142835, 142836, 142837, 142838, 142839, 142840, 142841, 
+    142842, 142843, 142844, 142845, 142846, 142847, 142848, 142849, 142850, 
+    142851, 142852, 142853, 142854, 142855, 142856, 142857, 142858, 142859, 
+    142860, 142861, 142862, 142863, 142864, 142865, 142866, 142867, 142868, 
+    142869, 142870, 142871, 142872, 142873, 142874, 142875, 142876, 142877, 
+    142878, 142879, 142880, 142881, 142882, 142883, 142884, 142885, 142886, 
+    142887, 142888, 142889, 142890, 142891, 142892, 142893, 142894, 142895, 
+    142896, 142897, 142898, 142899, 142900, 142901, 142902, 142903, 142904, 
+    142905, 142906, 142907, 142908, 142909, 142910, 142911, 142912, 142913, 
+    142914, 142915, 142916, 142917, 142918, 142919, 142920, 142921, 142922, 
+    142923, 142924, 142925, 142926, 142927, 142928, 142929, 142930, 142931, 
+    142932, 142933, 142934, 142935, 142936, 142937, 142938, 142939, 142940, 
+    142941, 142942, 142943, 142944, 142945, 142946, 142947, 142948, 142949, 
+    142950, 142951, 142952, 142953, 142954, 142955, 142956, 142957, 142958, 
+    142959, 142960, 142961, 142962, 142963, 142964, 142965, 142966, 142967, 
+    142968, 142969, 142970, 142971, 142972, 142973, 142974, 142975, 142976, 
+    142977, 142978, 142979, 142980, 142981, 142982, 142983, 142984, 142985, 
+    142986, 142987, 142988, 142989, 142990, 142991, 142992, 142993, 142994, 
+    142995, 142996, 142997, 142998, 142999, 143000, 143001, 143002, 143003, 
+    143004, 143005, 143006, 143007, 143008, 143009, 143010, 143011, 143012, 
+    143013, 143014, 143015, 143016, 143017, 143018, 143019, 143020, 143021, 
+    143022, 143023, 143024, 143025, 143026, 143027, 143028, 143029, 143030, 
+    143031, 143032, 143033, 143034, 143035, 143036, 143037, 143038, 143039, 
+    143040, 143041, 143042, 143043, 143044, 143045, 143046, 143047, 143048, 
+    143049, 143050, 143051, 143052, 143053, 143054, 143055, 143056, 143057, 
+    143058, 143059, 143060, 143061, 143062, 143063, 143064, 143065, 143066, 
+    143067, 143068, 143069, 143070, 143071, 143072, 143073, 143074, 143075, 
+    143076, 143077, 143078, 143079, 143080, 143081, 143082, 143083, 143084, 
+    143085, 143086, 143087, 143088, 143089, 143090, 143091, 143092, 143093, 
+    143094, 143095, 143096, 143097, 143098, 143099, 143100, 143101, 143102, 
+    143103, 143104, 143105, 143106, 143107, 143108, 143109, 143110, 143111, 
+    143112, 143113, 143114, 143115, 143116, 143117, 143118, 143119, 143120, 
+    143121, 143122, 143123, 143124, 143125, 143126, 143127, 143128, 143129, 
+    143130, 143131, 143132, 143133, 143134, 143135, 143136, 143137, 143138, 
+    143139, 143140, 143141, 143142, 143143, 143144, 143145, 143146, 143147, 
+    143148, 143149, 143150, 143151, 143152, 143153, 143154, 143155, 143156, 
+    143157, 143158, 143159, 143160, 143161, 143162, 143163, 143164, 143165, 
+    143166, 143167, 143168, 143169, 143170, 143171, 143172, 143173, 143174, 
+    143175, 143176, 143177, 143178, 143179, 143180, 143181, 143182, 143183, 
+    143184, 143185, 143186, 143187, 143188, 143189, 143190, 143191, 143192, 
+    143193, 143194, 143195, 143196, 143197, 143198, 143199, 143200, 143201, 
+    143202, 143203, 143204, 143205, 143206, 143207, 143208, 143209, 143210, 
+    143211, 143212, 143213, 143214, 143215, 143216, 143217, 143218, 143219, 
+    143220, 143221, 143222, 143223, 143224, 143225, 143226, 143227, 143228, 
+    143229, 143230, 143231, 143232, 143233, 143234, 143235, 143236, 143237, 
+    143238, 143239, 143240, 143241, 143242, 143243, 143244, 143245, 143246, 
+    143247, 143248, 143249, 143250, 143251, 143252, 143253, 143254, 143255, 
+    143256, 143257, 143258, 143259, 143260, 143261, 143262, 143263, 143264, 
+    143265, 143266, 143267, 143268, 143269, 143270, 143271, 143272, 143273, 
+    143274, 143275, 143276, 143277, 143278, 143279, 143280, 143281, 143282, 
+    143283, 143284, 143285, 143286, 143287, 143288, 143289, 143290, 143291, 
+    143292, 143293, 143294, 143295, 143296, 143297, 143298, 143299, 143300, 
+    143301, 143302, 143303, 143304, 143305, 143306, 143307, 143308, 143309, 
+    143310, 143311, 143312, 143313, 143314, 143315, 143316, 143317, 143318, 
+    143319, 143320, 143321, 143322, 143323, 143324, 143325, 143326, 143327, 
+    143328, 143329, 143330, 143331, 143332, 143333, 143334, 143335, 143336, 
+    143337, 143338, 143339, 143340, 143341, 143342, 143343, 143344, 143345, 
+    143346, 143347, 143348, 143349, 143350, 143351, 143352, 143353, 143354, 
+    143355, 143356, 143357, 143358, 143359, 143360, 143361, 143362, 143363, 
+    143364, 143365, 143366, 143367, 143368, 143369, 143370, 143371, 143372, 
+    143373, 143374, 143375, 143376, 143377, 143378, 143379, 143380, 143381, 
+    143382, 143383, 143384, 143385, 143386, 143387, 143388, 143389, 143390, 
+    143391, 143392, 143393, 143394, 143395, 143396, 143397, 143398, 143399, 
+    143400, 143401, 143402, 143403, 143404, 143405, 143406, 143407, 143408, 
+    143409, 143410, 143411, 143412, 143413, 143414, 143415, 143416, 143417, 
+    143418, 143419, 143420, 143421, 143422, 143423, 143424, 143425, 143426, 
+    143427, 143428, 143429, 143430, 143431, 143432, 143433, 143434, 143435, 
+    143436, 143437, 143438, 143439, 143440, 143441, 143442, 143443, 143444, 
+    143445, 143446, 143447, 143448, 143449, 143450, 143451, 143452, 143453, 
+    143454, 143455, 143456, 143457, 143458, 143459, 143460, 143461, 143462, 
+    143463, 143464, 143465, 143466, 143467, 143468, 143469, 143470, 143471, 
+    143472, 143473, 143474, 143475, 143476, 143477, 143478, 143479, 143480, 
+    143481, 143482, 143483, 143484, 143485, 143486, 143487, 143488, 143489, 
+    143490, 143491, 143492, 143493, 143494, 143495, 143496, 143497, 143498, 
+    143499, 143500, 143501, 143502, 143503, 143504, 143505, 143506, 143507, 
+    143508, 143509, 143510, 143511, 143512, 143513, 143514, 143515, 143516, 
+    143517, 143518, 143519, 143520, 143521, 143522, 143523, 143524, 143525, 
+    143526, 143527, 143528, 143529, 143530, 143531, 143532, 143533, 143534, 
+    143535, 143536, 143537, 143538, 143539, 143540, 143541, 143542, 143543, 
+    143544, 143545, 143546, 143547, 143548, 143549, 143550, 143551, 143552, 
+    143553, 143554, 143555, 143556, 143557, 143558, 143559, 143560, 143561, 
+    143562, 143563, 143564, 143565, 143566, 143567, 143568, 143569, 143570, 
+    143571, 143572, 143573, 143574, 143575, 143576, 143577, 143578, 143579, 
+    143580, 143581, 143582, 143583, 143584, 143585, 143586, 143587, 143588, 
+    143589, 143590, 143591, 143592, 143593, 143594, 143595, 143596, 143597, 
+    143598, 143599, 143600, 143601, 143602, 143603, 143604, 143605, 143606, 
+    143607, 143608, 143609, 143610, 143611, 143612, 143613, 143614, 143615, 
+    143616, 143617, 143618, 143619, 143620, 143621, 143622, 143623, 143624, 
+    143625, 143626, 143627, 143628, 143629, 143630, 143631, 143632, 143633, 
+    143634, 143635, 143636, 143637, 143638, 143639, 143640, 143641, 143642, 
+    143643, 143644, 143645, 143646, 143647, 143648, 143649, 143650, 143651, 
+    143652, 143653, 143654, 143655, 143656, 143657, 143658, 143659, 143660, 
+    143661, 143662, 143663, 143664, 143665, 143666, 143667, 143668, 143669, 
+    143670, 143671, 143672, 143673, 143674, 143675, 143676, 143677, 143678, 
+    143679, 143680, 143681, 143682, 143683, 143684, 143685, 143686, 143687, 
+    143688, 143689, 143690, 143691, 143692, 143693, 143694, 143695, 143696, 
+    143697, 143698, 143699, 143700, 143701, 143702, 143703, 143704, 143705, 
+    143706, 143707, 143708, 143709, 143710, 143711, 143712, 143713, 143714, 
+    143715, 143716, 143717, 143718, 143719, 143720, 143721, 143722, 143723, 
+    143724, 143725, 143726, 143727, 143728, 143729, 143730, 143731, 143732, 
+    143733, 143734, 143735, 143736, 143737, 143738, 143739, 143740, 143741, 
+    143742, 143743, 143744, 143745, 143746, 143747, 143748, 143749, 143750, 
+    143751, 143752, 143753, 143754, 143755, 143756, 143757, 143758, 143759, 
+    143760, 143761, 143762, 143763, 143764, 143765, 143766, 143767, 143768, 
+    143769, 143770, 143771, 143772, 143773, 143774, 143775, 143776, 143777, 
+    143778, 143779, 143780, 143781, 143782, 143783, 143784, 143785, 143786, 
+    143787, 143788, 143789, 143790, 143791, 143792, 143793, 143794, 143795, 
+    143796, 143797, 143798, 143799, 143800, 143801, 143802, 143803, 143804, 
+    143805, 143806, 143807, 143808, 143809, 143810, 143811, 143812, 143813, 
+    143814, 143815, 143816, 143817, 143818, 143819, 143820, 143821, 143822, 
+    143823, 143824, 143825, 143826, 143827, 143828, 143829, 143830, 143831, 
+    143832, 143833, 143834, 143835, 143836, 143837, 143838, 143839, 143840, 
+    143841, 143842, 143843, 143844, 143845, 143846, 143847, 143848, 143849, 
+    143850, 143851, 143852, 143853, 143854, 143855, 143856, 143857, 143858, 
+    143859, 143860, 143861, 143862, 143863, 143864, 143865, 143866, 143867, 
+    143868, 143869, 143870, 143871, 143872, 143873, 143874, 143875, 143876, 
+    143877, 143878, 143879, 143880, 143881, 143882, 143883, 143884, 143885, 
+    143886, 143887, 143888, 143889, 143890, 143891, 143892, 143893, 143894, 
+    143895, 143896, 143897, 143898, 143899, 143900, 143901, 143902, 143903, 
+    143904, 143905, 143906, 143907, 143908, 143909, 143910, 143911, 143912, 
+    143913, 143914, 143915, 143916, 143917, 143918, 143919, 143920, 143921, 
+    143922, 143923, 143924, 143925, 143926, 143927, 143928, 143929, 143930, 
+    143931, 143932, 143933, 143934, 143935, 143936, 143937, 143938, 143939, 
+    143940, 143941, 143942, 143943, 143944, 143945, 143946, 143947, 143948, 
+    143949, 143950, 143951, 143952, 143953, 143954, 143955, 143956, 143957, 
+    143958, 143959, 143960, 143961, 143962, 143963, 143964, 143965, 143966, 
+    143967, 143968, 143969, 143970, 143971, 143972, 143973, 143974, 143975, 
+    143976, 143977, 143978, 143979, 143980, 143981, 143982, 143983, 143984, 
+    143985, 143986, 143987, 143988, 143989, 143990, 143991, 143992, 143993, 
+    143994, 143995, 143996, 143997, 143998, 143999, 144000, 144001, 144002, 
+    144003, 144004, 144005, 144006, 144007, 144008, 144009, 144010, 144011, 
+    144012, 144013, 144014, 144015, 144016, 144017, 144018, 144019, 144020, 
+    144021, 144022, 144023, 144024, 144025, 144026, 144027, 144028, 144029, 
+    144030, 144031, 144032, 144033, 144034, 144035, 144036, 144037, 144038, 
+    144039, 144040, 144041, 144042, 144043, 144044, 144045, 144046, 144047, 
+    144048, 144049, 144050, 144051, 144052, 144053, 144054, 144055, 144056, 
+    144057, 144058, 144059, 144060, 144061, 144062, 144063, 144064, 144065, 
+    144066, 144067, 144068, 144069, 144070, 144071, 144072, 144073, 144074, 
+    144075, 144076, 144077, 144078, 144079, 144080, 144081, 144082, 144083, 
+    144084, 144085, 144086, 144087, 144088, 144089, 144090, 144091, 144092, 
+    144093, 144094, 144095, 144096, 144097, 144098, 144099, 144100, 144101, 
+    144102, 144103, 144104, 144105, 144106, 144107, 144108, 144109, 144110, 
+    144111, 144112, 144113, 144114, 144115, 144116, 144117, 144118, 144119, 
+    144120, 144121, 144122, 144123, 144124, 144125, 144126, 144127, 144128, 
+    144129, 144130, 144131, 144132, 144133, 144134, 144135, 144136, 144137, 
+    144138, 144139, 144140, 144141, 144142, 144143, 144144, 144145, 144146, 
+    144147, 144148, 144149, 144150, 144151, 144152, 144153, 144154, 144155, 
+    144156, 144157, 144158, 144159, 144160, 144161, 144162, 144163, 144164, 
+    144165, 144166, 144167, 144168, 144169, 144170, 144171, 144172, 144173, 
+    144174, 144175, 144176, 144177, 144178, 144179, 144180, 144181, 144182, 
+    144183, 144184, 144185, 144186, 144187, 144188, 144189, 144190, 144191, 
+    144192, 144193, 144194, 144195, 144196, 144197, 144198, 144199, 144200, 
+    144201, 144202, 144203, 144204, 144205, 144206, 144207, 144208, 144209, 
+    144210, 144211, 144212, 144213, 144214, 144215, 144216, 144217, 144218, 
+    144219, 144220, 144221, 144222, 144223, 144224, 144225, 144226, 144227, 
+    144228, 144229, 144230, 144231, 144232, 144233, 144234, 144235, 144236, 
+    144237, 144238, 144239, 144240, 144241, 144242, 144243, 144244, 144245, 
+    144246, 144247, 144248, 144249, 144250, 144251, 144252, 144253, 144254, 
+    144255, 144256, 144257, 144258, 144259, 144260, 144261, 144262, 144263, 
+    144264, 144265, 144266, 144267, 144268, 144269, 144270, 144271, 144272, 
+    144273, 144274, 144275, 144276, 144277, 144278, 144279, 144280, 144281, 
+    144282, 144283, 144284, 144285, 144286, 144287, 144288, 144289, 144290, 
+    144291, 144292, 144293, 144294, 144295, 144296, 144297, 144298, 144299, 
+    144300, 144301, 144302, 144303, 144304, 144305, 144306, 144307, 144308, 
+    144309, 144310, 144311, 144312, 144313, 144314, 144315, 144316, 144317, 
+    144318, 144319, 144320, 144321, 144322, 144323, 144324, 144325, 144326, 
+    144327, 144328, 144329, 144330, 144331, 144332, 144333, 144334, 144335, 
+    144336, 144337, 144338, 144339, 144340, 144341, 144342, 144343, 144344, 
+    144345, 144346, 144347, 144348, 144349, 144350, 144351, 144352, 144353, 
+    144354, 144355, 144356, 144357, 144358, 144359, 144360, 144361, 144362, 
+    144363, 144364, 144365, 144366, 144367, 144368, 144369, 144370, 144371, 
+    144372, 144373, 144374, 144375, 144376, 144377, 144378, 144379, 144380, 
+    144381, 144382, 144383, 144384, 144385, 144386, 144387, 144388, 144389, 
+    144390, 144391, 144392, 144393, 144394, 144395, 144396, 144397, 144398, 
+    144399, 144400, 144401, 144402, 144403, 144404, 144405, 144406, 144407, 
+    144408, 144409, 144410, 144411, 144412, 144413, 144414, 144415, 144416, 
+    144417, 144418, 144419, 144420, 144421, 144422, 144423, 144424, 144425, 
+    144426, 144427, 144428, 144429, 144430, 144431, 144432, 144433, 144434, 
+    144435, 144436, 144437, 144438, 144439, 144440, 144441, 144442, 144443, 
+    144444, 144445, 144446, 144447, 144448, 144449, 144450, 144451, 144452, 
+    144453, 144454, 144455, 144456, 144457, 144458, 144459, 144460, 144461, 
+    144462, 144463, 144464, 144465, 144466, 144467, 144468, 144469, 144470, 
+    144471, 144472, 144473, 144474, 144475, 144476, 144477, 144478, 144479, 
+    144480, 144481, 144482, 144483, 144484, 144485, 144486, 144487, 144488, 
+    144489, 144490, 144491, 144492, 144493, 144494, 144495, 144496, 144497, 
+    144498, 144499, 144500, 144501, 144502, 144503, 144504, 144505, 144506, 
+    144507, 144508, 144509, 144510, 144511, 144512, 144513, 144514, 144515, 
+    144516, 144517, 144518, 144519, 144520, 144521, 144522, 144523, 144524, 
+    144525, 144526, 144527, 144528, 144529, 144530, 144531, 144532, 144533, 
+    144534, 144535, 144536, 144537, 144538, 144539, 144540, 144541, 144542, 
+    144543, 144544, 144545, 144546, 144547, 144548, 144549, 144550, 144551, 
+    144552, 144553, 144554, 144555, 144556, 144557, 144558, 144559, 144560, 
+    144561, 144562, 144563, 144564, 144565, 144566, 144567, 144568, 144569, 
+    144570, 144571, 144572, 144573, 144574, 144575, 144576, 144577, 144578, 
+    144579, 144580, 144581, 144582, 144583, 144584, 144585, 144586, 144587, 
+    144588, 144589, 144590, 144591, 144592, 144593, 144594, 144595, 144596, 
+    144597, 144598, 144599, 144600, 144601, 144602, 144603, 144604, 144605, 
+    144606, 144607, 144608, 144609, 144610, 144611, 144612, 144613, 144614, 
+    144615, 144616, 144617, 144618, 144619, 144620, 144621, 144622, 144623, 
+    144624, 144625, 144626, 144627, 144628, 144629, 144630, 144631, 144632, 
+    144633, 144634, 144635, 144636, 144637, 144638, 144639, 144640, 144641, 
+    144642, 144643, 144644, 144645, 144646, 144647, 144648, 144649, 144650, 
+    144651, 144652, 144653, 144654, 144655, 144656, 144657, 144658, 144659, 
+    144660, 144661, 144662, 144663, 144664, 144665, 144666, 144667, 144668, 
+    144669, 144670, 144671, 144672, 144673, 144674, 144675, 144676, 144677, 
+    144678, 144679, 144680, 144681, 144682, 144683, 144684, 144685, 144686, 
+    144687, 144688, 144689, 144690, 144691, 144692, 144693, 144694, 144695, 
+    144696, 144697, 144698, 144699, 144700, 144701, 144702, 144703, 144704, 
+    144705, 144706, 144707, 144708, 144709, 144710, 144711, 144712, 144713, 
+    144714, 144715, 144716, 144717, 144718, 144719, 144720, 144721, 144722, 
+    144723, 144724, 144725, 144726, 144727, 144728, 144729, 144730, 144731, 
+    144732, 144733, 144734, 144735, 144736, 144737, 144738, 144739, 144740, 
+    144741, 144742, 144743, 144744, 144745, 144746, 144747, 144748, 144749, 
+    144750, 144751, 144752, 144753, 144754, 144755, 144756, 144757, 144758, 
+    144759, 144760, 144761, 144762, 144763, 144764, 144765, 144766, 144767, 
+    144768, 144769, 144770, 144771, 144772, 144773, 144774, 144775, 144776, 
+    144777, 144778, 144779, 144780, 144781, 144782, 144783, 144784, 144785, 
+    144786, 144787, 144788, 144789, 144790, 144791, 144792, 144793, 144794, 
+    144795, 144796, 144797, 144798, 144799, 144800, 144801, 144802, 144803, 
+    144804, 144805, 144806, 144807, 144808, 144809, 144810, 144811, 144812, 
+    144813, 144814, 144815, 144816, 144817, 144818, 144819, 144820, 144821, 
+    144822, 144823, 144824, 144825, 144826, 144827, 144828, 144829, 144830, 
+    144831, 144832, 144833, 144834, 144835, 144836, 144837, 144838, 144839, 
+    144840, 144841, 144842, 144843, 144844, 144845, 144846, 144847, 144848, 
+    144849, 144850, 144851, 144852, 144853, 144854, 144855, 144856, 144857, 
+    144858, 144859, 144860, 144861, 144862, 144863, 144864, 144865, 144866, 
+    144867, 144868, 144869, 144870, 144871, 144872, 144873, 144874, 144875, 
+    144876, 144877, 144878, 144879, 144880, 144881, 144882, 144883, 144884, 
+    144885, 144886, 144887, 144888, 144889, 144890, 144891, 144892, 144893, 
+    144894, 144895, 144896, 144897, 144898, 144899, 144900, 144901, 144902, 
+    144903, 144904, 144905, 144906, 144907, 144908, 144909, 144910, 144911, 
+    144912, 144913, 144914, 144915, 144916, 144917, 144918, 144919, 144920, 
+    144921, 144922, 144923, 144924, 144925, 144926, 144927, 144928, 144929, 
+    144930, 144931, 144932, 144933, 144934, 144935, 144936, 144937, 144938, 
+    144939, 144940, 144941, 144942, 144943, 144944, 144945, 144946, 144947, 
+    144948, 144949, 144950, 144951, 144952, 144953, 144954, 144955, 144956, 
+    144957, 144958, 144959, 144960, 144961, 144962, 144963, 144964, 144965, 
+    144966, 144967, 144968, 144969, 144970, 144971, 144972, 144973, 144974, 
+    144975, 144976, 144977, 144978, 144979, 144980, 144981, 144982, 144983, 
+    144984, 144985, 144986, 144987, 144988, 144989, 144990, 144991, 144992, 
+    144993, 144994, 144995, 144996, 144997, 144998, 144999, 145000, 145001, 
+    145002, 145003, 145004, 145005, 145006, 145007, 145008, 145009, 145010, 
+    145011, 145012, 145013, 145014, 145015, 145016, 145017, 145018, 145019, 
+    145020, 145021, 145022, 145023, 145024, 145025, 145026, 145027, 145028, 
+    145029, 145030, 145031, 145032, 145033, 145034, 145035, 145036, 145037, 
+    145038, 145039, 145040, 145041, 145042, 145043, 145044, 145045, 145046, 
+    145047, 145048, 145049, 145050, 145051, 145052, 145053, 145054, 145055, 
+    145056, 145057, 145058, 145059, 145060, 145061, 145062, 145063, 145064, 
+    145065, 145066, 145067, 145068, 145069, 145070, 145071, 145072, 145073, 
+    145074, 145075, 145076, 145077, 145078, 145079, 145080, 145081, 145082, 
+    145083, 145084, 145085, 145086, 145087, 145088, 145089, 145090, 145091, 
+    145092, 145093, 145094, 145095, 145096, 145097, 145098, 145099, 145100, 
+    145101, 145102, 145103, 145104, 145105, 145106, 145107, 145108, 145109, 
+    145110, 145111, 145112, 145113, 145114, 145115, 145116, 145117, 145118, 
+    145119, 145120, 145121, 145122, 145123, 145124, 145125, 145126, 145127, 
+    145128, 145129, 145130, 145131, 145132, 145133, 145134, 145135, 145136, 
+    145137, 145138, 145139, 145140, 145141, 145142, 145143, 145144, 145145, 
+    145146, 145147, 145148, 145149, 145150, 145151, 145152, 145153, 145154, 
+    145155, 145156, 145157, 145158, 145159, 145160, 145161, 145162, 145163, 
+    145164, 145165, 145166, 145167, 145168, 145169, 145170, 145171, 145172, 
+    145173, 145174, 145175, 145176, 145177, 145178, 145179, 145180, 145181, 
+    145182, 145183, 145184, 145185, 145186, 145187, 145188, 145189, 145190, 
+    145191, 145192, 145193, 145194, 145195, 145196, 145197, 145198, 145199, 
+    145200, 145201, 145202, 145203, 145204, 145205, 145206, 145207, 145208, 
+    145209, 145210, 145211, 145212, 145213, 145214, 145215, 145216, 145217, 
+    145218, 145219, 145220, 145221, 145222, 145223, 145224, 145225, 145226, 
+    145227, 145228, 145229, 145230, 145231, 145232, 145233, 145234, 145235, 
+    145236, 145237, 145238, 145239, 145240, 145241, 145242, 145243, 145244, 
+    145245, 145246, 145247, 145248, 145249, 145250, 145251, 145252, 145253, 
+    145254, 145255, 145256, 145257, 145258, 145259, 145260, 145261, 145262, 
+    145263, 145264, 145265, 145266, 145267, 145268, 145269, 145270, 145271, 
+    145272, 145273, 145274, 145275, 145276, 145277, 145278, 145279, 145280, 
+    145281, 145282, 145283, 145284, 145285, 145286, 145287, 145288, 145289, 
+    145290, 145291, 145292, 145293, 145294, 145295, 145296, 145297, 145298, 
+    145299, 145300, 145301, 145302, 145303, 145304, 145305, 145306, 145307, 
+    145308, 145309, 145310, 145311, 145312, 145313, 145314, 145315, 145316, 
+    145317, 145318, 145319, 145320, 145321, 145322, 145323, 145324, 145325, 
+    145326, 145327, 145328, 145329, 145330, 145331, 145332, 145333, 145334, 
+    145335, 145336, 145337, 145338, 145339, 145340, 145341, 145342, 145343, 
+    145344, 145345, 145346, 145347, 145348, 145349, 145350, 145351, 145352, 
+    145353, 145354, 145355, 145356, 145357, 145358, 145359, 145360, 145361, 
+    145362, 145363, 145364, 145365, 145366, 145367, 145368, 145369, 145370, 
+    145371, 145372, 145373, 145374, 145375, 145376, 145377, 145378, 145379, 
+    145380, 145381, 145382, 145383, 145384, 145385, 145386, 145387, 145388, 
+    145389, 145390, 145391, 145392, 145393, 145394, 145395, 145396, 145397, 
+    145398, 145399, 145400, 145401, 145402, 145403, 145404, 145405, 145406, 
+    145407, 145408, 145409, 145410, 145411, 145412, 145413, 145414, 145415, 
+    145416, 145417, 145418, 145419, 145420, 145421, 145422, 145423, 145424, 
+    145425, 145426, 145427, 145428, 145429, 145430, 145431, 145432, 145433, 
+    145434, 145435, 145436, 145437, 145438, 145439, 145440, 145441, 145442, 
+    145443, 145444, 145445, 145446, 145447, 145448, 145449, 145450, 145451, 
+    145452, 145453, 145454, 145455, 145456, 145457, 145458, 145459, 145460, 
+    145461, 145462, 145463, 145464, 145465, 145466, 145467, 145468, 145469, 
+    145470, 145471, 145472, 145473, 145474, 145475, 145476, 145477, 145478, 
+    145479, 145480, 145481, 145482, 145483, 145484, 145485, 145486, 145487, 
+    145488, 145489, 145490, 145491, 145492, 145493, 145494, 145495, 145496, 
+    145497, 145498, 145499, 145500, 145501, 145502, 145503, 145504, 145505, 
+    145506, 145507, 145508, 145509, 145510, 145511, 145512, 145513, 145514, 
+    145515, 145516, 145517, 145518, 145519, 145520, 145521, 145522, 145523, 
+    145524, 145525, 145526, 145527, 145528, 145529, 145530, 145531, 145532, 
+    145533, 145534, 145535, 145536, 145537, 145538, 145539, 145540, 145541, 
+    145542, 145543, 145544, 145545, 145546, 145547, 145548, 145549, 145550, 
+    145551, 145552, 145553, 145554, 145555, 145556, 145557, 145558, 145559, 
+    145560, 145561, 145562, 145563, 145564, 145565, 145566, 145567, 145568, 
+    145569, 145570, 145571, 145572, 145573, 145574, 145575, 145576, 145577, 
+    145578, 145579, 145580, 145581, 145582, 145583, 145584, 145585, 145586, 
+    145587, 145588, 145589, 145590, 145591, 145592, 145593, 145594, 145595, 
+    145596, 145597, 145598, 145599, 145600, 145601, 145602, 145603, 145604, 
+    145605, 145606, 145607, 145608, 145609, 145610, 145611, 145612, 145613, 
+    145614, 145615, 145616, 145617, 145618, 145619, 145620, 145621, 145622, 
+    145623, 145624, 145625, 145626, 145627, 145628, 145629, 145630, 145631, 
+    145632, 145633, 145634, 145635, 145636, 145637, 145638, 145639, 145640, 
+    145641, 145642, 145643, 145644, 145645, 145646, 145647, 145648, 145649, 
+    145650, 145651, 145652, 145653, 145654, 145655, 145656, 145657, 145658, 
+    145659, 145660, 145661, 145662, 145663, 145664, 145665, 145666, 145667, 
+    145668, 145669, 145670, 145671, 145672, 145673, 145674, 145675, 145676, 
+    145677, 145678, 145679, 145680, 145681, 145682, 145683, 145684, 145685, 
+    145686, 145687, 145688, 145689, 145690, 145691, 145692, 145693, 145694, 
+    145695, 145696, 145697, 145698, 145699, 145700, 145701, 145702, 145703, 
+    145704, 145705, 145706, 145707, 145708, 145709, 145710, 145711, 145712, 
+    145713, 145714, 145715, 145716, 145717, 145718, 145719, 145720, 145721, 
+    145722, 145723, 145724, 145725, 145726, 145727, 145728, 145729, 145730, 
+    145731, 145732, 145733, 145734, 145735, 145736, 145737, 145738, 145739, 
+    145740, 145741, 145742, 145743, 145744, 145745, 145746, 145747, 145748, 
+    145749, 145750, 145751, 145752, 145753, 145754, 145755, 145756, 145757, 
+    145758, 145759, 145760, 145761, 145762, 145763, 145764, 145765, 145766, 
+    145767, 145768, 145769, 145770, 145771, 145772, 145773, 145774, 145775, 
+    145776, 145777, 145778, 145779, 145780, 145781, 145782, 145783, 145784, 
+    145785, 145786, 145787, 145788, 145789, 145790, 145791, 145792, 145793, 
+    145794, 145795, 145796, 145797, 145798, 145799, 145800, 145801, 145802, 
+    145803, 145804, 145805, 145806, 145807, 145808, 145809, 145810, 145811, 
+    145812, 145813, 145814, 145815, 145816, 145817, 145818, 145819, 145820, 
+    145821, 145822, 145823, 145824, 145825, 145826, 145827, 145828, 145829, 
+    145830, 145831, 145832, 145833, 145834, 145835, 145836, 145837, 145838, 
+    145839, 145840, 145841, 145842, 145843, 145844, 145845, 145846, 145847, 
+    145848, 145849, 145850, 145851, 145852, 145853, 145854, 145855, 145856, 
+    145857, 145858, 145859, 145860, 145861, 145862, 145863, 145864, 145865, 
+    145866, 145867, 145868, 145869, 145870, 145871, 145872, 145873, 145874, 
+    145875, 145876, 145877, 145878, 145879, 145880, 145881, 145882, 145883, 
+    145884, 145885, 145886, 145887, 145888, 145889, 145890, 145891, 145892, 
+    145893, 145894, 145895, 145896, 145897, 145898, 145899, 145900, 145901, 
+    145902, 145903, 145904, 145905, 145906, 145907, 145908, 145909, 145910, 
+    145911, 145912, 145913, 145914, 145915, 145916, 145917, 145918, 145919, 
+    145920, 145921, 145922, 145923, 145924, 145925, 145926, 145927, 145928, 
+    145929, 145930, 145931, 145932, 145933, 145934, 145935, 145936, 145937, 
+    145938, 145939, 145940, 145941, 145942, 145943, 145944, 145945, 145946, 
+    145947, 145948, 145949, 145950, 145951, 145952, 145953, 145954, 145955, 
+    145956, 145957, 145958, 145959, 145960, 145961, 145962, 145963, 145964, 
+    145965, 145966, 145967, 145968, 145969, 145970, 145971, 145972, 145973, 
+    145974, 145975, 145976, 145977, 145978, 145979, 145980, 145981, 145982, 
+    145983, 145984, 145985, 145986, 145987, 145988, 145989, 145990, 145991, 
+    145992, 145993, 145994, 145995, 145996, 145997, 145998, 145999, 146000, 
+    146001, 146002, 146003, 146004, 146005, 146006, 146007, 146008, 146009, 
+    146010, 146011, 146012, 146013, 146014, 146015, 146016, 146017, 146018, 
+    146019, 146020, 146021, 146022, 146023, 146024, 146025, 146026, 146027, 
+    146028, 146029, 146030, 146031, 146032, 146033, 146034, 146035, 146036, 
+    146037, 146038, 146039, 146040, 146041, 146042, 146043, 146044, 146045, 
+    146046, 146047, 146048, 146049, 146050, 146051, 146052, 146053, 146054, 
+    146055, 146056, 146057, 146058, 146059, 146060, 146061, 146062, 146063, 
+    146064, 146065, 146066, 146067, 146068, 146069, 146070, 146071, 146072, 
+    146073, 146074, 146075, 146076, 146077, 146078, 146079, 146080, 146081, 
+    146082, 146083, 146084, 146085, 146086, 146087, 146088, 146089, 146090, 
+    146091, 146092, 146093, 146094, 146095, 146096, 146097, 146098, 146099, 
+    146100, 146101, 146102, 146103, 146104, 146105, 146106, 146107, 146108, 
+    146109, 146110, 146111, 146112, 146113, 146114, 146115, 146116, 146117, 
+    146118, 146119, 146120, 146121, 146122, 146123, 146124, 146125, 146126, 
+    146127, 146128, 146129, 146130, 146131, 146132, 146133, 146134, 146135, 
+    146136, 146137, 146138, 146139, 146140, 146141, 146142, 146143, 146144, 
+    146145, 146146, 146147, 146148, 146149, 146150, 146151, 146152, 146153, 
+    146154, 146155, 146156, 146157, 146158, 146159, 146160, 146161, 146162, 
+    146163, 146164, 146165, 146166, 146167, 146168, 146169, 146170, 146171, 
+    146172, 146173, 146174, 146175, 146176, 146177, 146178, 146179, 146180, 
+    146181, 146182, 146183, 146184, 146185, 146186, 146187, 146188, 146189, 
+    146190, 146191, 146192, 146193, 146194, 146195, 146196, 146197, 146198, 
+    146199, 146200, 146201, 146202, 146203, 146204, 146205, 146206, 146207, 
+    146208, 146209, 146210, 146211, 146212, 146213, 146214, 146215, 146216, 
+    146217, 146218, 146219, 146220, 146221, 146222, 146223, 146224, 146225, 
+    146226, 146227, 146228, 146229, 146230, 146231, 146232, 146233, 146234, 
+    146235, 146236, 146237, 146238, 146239, 146240, 146241, 146242, 146243, 
+    146244, 146245, 146246, 146247, 146248, 146249, 146250, 146251, 146252, 
+    146253, 146254, 146255, 146256, 146257, 146258, 146259, 146260, 146261, 
+    146262, 146263, 146264, 146265, 146266, 146267, 146268, 146269, 146270, 
+    146271, 146272, 146273, 146274, 146275, 146276, 146277, 146278, 146279, 
+    146280, 146281, 146282, 146283, 146284, 146285, 146286, 146287, 146288, 
+    146289, 146290, 146291, 146292, 146293, 146294, 146295, 146296, 146297, 
+    146298, 146299, 146300, 146301, 146302, 146303, 146304, 146305, 146306, 
+    146307, 146308, 146309, 146310, 146311, 146312, 146313, 146314, 146315, 
+    146316, 146317, 146318, 146319, 146320, 146321, 146322, 146323, 146324, 
+    146325, 146326, 146327, 146328, 146329, 146330, 146331, 146332, 146333, 
+    146334, 146335, 146336, 146337, 146338, 146339, 146340, 146341, 146342, 
+    146343, 146344, 146345, 146346, 146347, 146348, 146349, 146350, 146351, 
+    146352, 146353, 146354, 146355, 146356, 146357, 146358, 146359, 146360, 
+    146361, 146362, 146363, 146364, 146365, 146366, 146367, 146368, 146369, 
+    146370, 146371, 146372, 146373, 146374, 146375, 146376, 146377, 146378, 
+    146379, 146380, 146381, 146382, 146383, 146384, 146385, 146386, 146387, 
+    146388, 146389, 146390, 146391, 146392, 146393, 146394, 146395, 146396, 
+    146397, 146398, 146399, 146400, 146401, 146402, 146403, 146404, 146405, 
+    146406, 146407, 146408, 146409, 146410, 146411, 146412, 146413, 146414, 
+    146415, 146416, 146417, 146418, 146419, 146420, 146421, 146422, 146423, 
+    146424, 146425, 146426, 146427, 146428, 146429, 146430, 146431, 146432, 
+    146433, 146434, 146435, 146436, 146437, 146438, 146439, 146440, 146441, 
+    146442, 146443, 146444, 146445, 146446, 146447, 146448, 146449, 146450, 
+    146451, 146452, 146453, 146454, 146455, 146456, 146457, 146458, 146459, 
+    146460, 146461, 146462, 146463, 146464, 146465, 146466, 146467, 146468, 
+    146469, 146470, 146471, 146472, 146473, 146474, 146475, 146476, 146477, 
+    146478, 146479, 146480, 146481, 146482, 146483, 146484, 146485, 146486, 
+    146487, 146488, 146489, 146490, 146491, 146492, 146493, 146494, 146495, 
+    146496, 146497, 146498, 146499, 146500, 146501, 146502, 146503, 146504, 
+    146505, 146506, 146507, 146508, 146509, 146510, 146511, 146512, 146513, 
+    146514, 146515, 146516, 146517, 146518, 146519, 146520, 146521, 146522, 
+    146523, 146524, 146525, 146526, 146527, 146528, 146529, 146530, 146531, 
+    146532, 146533, 146534, 146535, 146536, 146537, 146538, 146539, 146540, 
+    146541, 146542, 146543, 146544, 146545, 146546, 146547, 146548, 146549, 
+    146550, 146551, 146552, 146553, 146554, 146555, 146556, 146557, 146558, 
+    146559, 146560, 146561, 146562, 146563, 146564, 146565, 146566, 146567, 
+    146568, 146569, 146570, 146571, 146572, 146573, 146574, 146575, 146576, 
+    146577, 146578, 146579, 146580, 146581, 146582, 146583, 146584, 146585, 
+    146586, 146587, 146588, 146589, 146590, 146591, 146592, 146593, 146594, 
+    146595, 146596, 146597, 146598, 146599, 146600, 146601, 146602, 146603, 
+    146604, 146605, 146606, 146607, 146608, 146609, 146610, 146611, 146612, 
+    146613, 146614, 146615, 146616, 146617, 146618, 146619, 146620, 146621, 
+    146622, 146623, 146624, 146625, 146626, 146627, 146628, 146629, 146630, 
+    146631, 146632, 146633, 146634, 146635, 146636, 146637, 146638, 146639, 
+    146640, 146641, 146642, 146643, 146644, 146645, 146646, 146647, 146648, 
+    146649, 146650, 146651, 146652, 146653, 146654, 146655, 146656, 146657, 
+    146658, 146659, 146660, 146661, 146662, 146663, 146664, 146665, 146666, 
+    146667, 146668, 146669, 146670, 146671, 146672, 146673, 146674, 146675, 
+    146676, 146677, 146678, 146679, 146680, 146681, 146682, 146683, 146684, 
+    146685, 146686, 146687, 146688, 146689, 146690, 146691, 146692, 146693, 
+    146694, 146695, 146696, 146697, 146698, 146699, 146700, 146701, 146702, 
+    146703, 146704, 146705, 146706, 146707, 146708, 146709, 146710, 146711, 
+    146712, 146713, 146714, 146715, 146716, 146717, 146718, 146719, 146720, 
+    146721, 146722, 146723, 146724, 146725, 146726, 146727, 146728, 146729, 
+    146730, 146731, 146732, 146733, 146734, 146735, 146736, 146737, 146738, 
+    146739, 146740, 146741, 146742, 146743, 146744, 146745, 146746, 146747, 
+    146748, 146749, 146750, 146751, 146752, 146753, 146754, 146755, 146756, 
+    146757, 146758, 146759, 146760, 146761, 146762, 146763, 146764, 146765, 
+    146766, 146767, 146768, 146769, 146770, 146771, 146772, 146773, 146774, 
+    146775, 146776, 146777, 146778, 146779, 146780, 146781, 146782, 146783, 
+    146784, 146785, 146786, 146787, 146788, 146789, 146790, 146791, 146792, 
+    146793, 146794, 146795, 146796, 146797, 146798, 146799, 146800, 146801, 
+    146802, 146803, 146804, 146805, 146806, 146807, 146808, 146809, 146810, 
+    146811, 146812, 146813, 146814, 146815, 146816, 146817, 146818, 146819, 
+    146820, 146821, 146822, 146823, 146824, 146825, 146826, 146827, 146828, 
+    146829, 146830, 146831, 146832, 146833, 146834, 146835, 146836, 146837, 
+    146838, 146839, 146840, 146841, 146842, 146843, 146844, 146845, 146846, 
+    146847, 146848, 146849, 146850, 146851, 146852, 146853, 146854, 146855, 
+    146856, 146857, 146858, 146859, 146860, 146861, 146862, 146863, 146864, 
+    146865, 146866, 146867, 146868, 146869, 146870, 146871, 146872, 146873, 
+    146874, 146875, 146876, 146877, 146878, 146879, 146880, 146881, 146882, 
+    146883, 146884, 146885, 146886, 146887, 146888, 146889, 146890, 146891, 
+    146892, 146893, 146894, 146895, 146896, 146897, 146898, 146899, 146900, 
+    146901, 146902, 146903, 146904, 146905, 146906, 146907, 146908, 146909, 
+    146910, 146911, 146912, 146913, 146914, 146915, 146916, 146917, 146918, 
+    146919, 146920, 146921, 146922, 146923, 146924, 146925, 146926, 146927, 
+    146928, 146929, 146930, 146931, 146932, 146933, 146934, 146935, 146936, 
+    146937, 146938, 146939, 146940, 146941, 146942, 146943, 146944, 146945, 
+    146946, 146947, 146948, 146949, 146950, 146951, 146952, 146953, 146954, 
+    146955, 146956, 146957, 146958, 146959, 146960, 146961, 146962, 146963, 
+    146964, 146965, 146966, 146967, 146968, 146969, 146970, 146971, 146972, 
+    146973, 146974, 146975, 146976, 146977, 146978, 146979, 146980, 146981, 
+    146982, 146983, 146984, 146985, 146986, 146987, 146988, 146989, 146990, 
+    146991, 146992, 146993, 146994, 146995, 146996, 146997, 146998, 146999, 
+    147000, 147001, 147002, 147003, 147004, 147005, 147006, 147007, 147008, 
+    147009, 147010, 147011, 147012, 147013, 147014, 147015, 147016, 147017, 
+    147018, 147019, 147020, 147021, 147022, 147023, 147024, 147025, 147026, 
+    147027, 147028, 147029, 147030, 147031, 147032, 147033, 147034, 147035, 
+    147036, 147037, 147038, 147039, 147040, 147041, 147042, 147043, 147044, 
+    147045, 147046, 147047, 147048, 147049, 147050, 147051, 147052, 147053, 
+    147054, 147055, 147056, 147057, 147058, 147059, 147060, 147061, 147062, 
+    147063, 147064, 147065, 147066, 147067, 147068, 147069, 147070, 147071, 
+    147072, 147073, 147074, 147075, 147076, 147077, 147078, 147079, 147080, 
+    147081, 147082, 147083, 147084, 147085, 147086, 147087, 147088, 147089, 
+    147090, 147091, 147092, 147093, 147094, 147095, 147096, 147097, 147098, 
+    147099, 147100, 147101, 147102, 147103, 147104, 147105, 147106, 147107, 
+    147108, 147109, 147110, 147111, 147112, 147113, 147114, 147115, 147116, 
+    147117, 147118, 147119, 147120, 147121, 147122, 147123, 147124, 147125, 
+    147126, 147127, 147128, 147129, 147130, 147131, 147132, 147133, 147134, 
+    147135, 147136, 147137, 147138, 147139, 147140, 147141, 147142, 147143, 
+    147144, 147145, 147146, 147147, 147148, 147149, 147150, 147151, 147152, 
+    147153, 147154, 147155, 147156, 147157, 147158, 147159, 147160, 147161, 
+    147162, 147163, 147164, 147165, 147166, 147167, 147168, 147169, 147170, 
+    147171, 147172, 147173, 147174, 147175, 147176, 147177, 147178, 147179, 
+    147180, 147181, 147182, 147183, 147184, 147185, 147186, 147187, 147188, 
+    147189, 147190, 147191, 147192, 147193, 147194, 147195, 147196, 147197, 
+    147198, 147199, 147200, 147201, 147202, 147203, 147204, 147205, 147206, 
+    147207, 147208, 147209, 147210, 147211, 147212, 147213, 147214, 147215, 
+    147216, 147217, 147218, 147219, 147220, 147221, 147222, 147223, 147224, 
+    147225, 147226, 147227, 147228, 147229, 147230, 147231, 147232, 147233, 
+    147234, 147235, 147236, 147237, 147238, 147239, 147240, 147241, 147242, 
+    147243, 147244, 147245, 147246, 147247, 147248, 147249, 147250, 147251, 
+    147252, 147253, 147254, 147255, 147256, 147257, 147258, 147259, 147260, 
+    147261, 147262, 147263, 147264, 147265, 147266, 147267, 147268, 147269, 
+    147270, 147271, 147272, 147273, 147274, 147275, 147276, 147277, 147278, 
+    147279, 147280, 147281, 147282, 147283, 147284, 147285, 147286, 147287, 
+    147288, 147289, 147290, 147291, 147292, 147293, 147294, 147295, 147296, 
+    147297, 147298, 147299, 147300, 147301, 147302, 147303, 147304, 147305, 
+    147306, 147307, 147308, 147309, 147310, 147311, 147312, 147313, 147314, 
+    147315, 147316, 147317, 147318, 147319, 147320, 147321, 147322, 147323, 
+    147324, 147325, 147326, 147327, 147328, 147329, 147330, 147331, 147332, 
+    147333, 147334, 147335, 147336, 147337, 147338, 147339, 147340, 147341, 
+    147342, 147343, 147344, 147345, 147346, 147347, 147348, 147349, 147350, 
+    147351, 147352, 147353, 147354, 147355, 147356, 147357, 147358, 147359, 
+    147360, 147361, 147362, 147363, 147364, 147365, 147366, 147367, 147368, 
+    147369, 147370, 147371, 147372, 147373, 147374, 147375, 147376, 147377, 
+    147378, 147379, 147380, 147381, 147382, 147383, 147384, 147385, 147386, 
+    147387, 147388, 147389, 147390, 147391, 147392, 147393, 147394, 147395, 
+    147396, 147397, 147398, 147399, 147400, 147401, 147402, 147403, 147404, 
+    147405, 147406, 147407, 147408, 147409, 147410, 147411, 147412, 147413, 
+    147414, 147415, 147416, 147417, 147418, 147419, 147420, 147421, 147422, 
+    147423, 147424, 147425, 147426, 147427, 147428, 147429, 147430, 147431, 
+    147432, 147433, 147434, 147435, 147436, 147437, 147438, 147439, 147440, 
+    147441, 147442, 147443, 147444, 147445, 147446, 147447, 147448, 147449, 
+    147450, 147451, 147452, 147453, 147454, 147455, 147456, 147457, 147458, 
+    147459, 147460, 147461, 147462, 147463, 147464, 147465, 147466, 147467, 
+    147468, 147469, 147470, 147471, 147472, 147473, 147474, 147475, 147476, 
+    147477, 147478, 147479, 147480, 147481, 147482, 147483, 147484, 147485, 
+    147486, 147487, 147488, 147489, 147490, 147491, 147492, 147493, 147494, 
+    147495, 147496, 147497, 147498, 147499, 147500, 147501, 147502, 147503, 
+    147504, 147505, 147506, 147507, 147508, 147509, 147510, 147511, 147512, 
+    147513, 147514, 147515, 147516, 147517, 147518, 147519, 147520, 147521, 
+    147522, 147523, 147524, 147525, 147526, 147527, 147528, 147529, 147530, 
+    147531, 147532, 147533, 147534, 147535, 147536, 147537, 147538, 147539, 
+    147540, 147541, 147542, 147543, 147544, 147545, 147546, 147547, 147548, 
+    147549, 147550, 147551, 147552, 147553, 147554, 147555, 147556, 147557, 
+    147558, 147559, 147560, 147561, 147562, 147563, 147564, 147565, 147566, 
+    147567, 147568, 147569, 147570, 147571, 147572, 147573, 147574, 147575, 
+    147576, 147577, 147578, 147579, 147580, 147581, 147582, 147583, 147584, 
+    147585, 147586, 147587, 147588, 147589, 147590, 147591, 147592, 147593, 
+    147594, 147595, 147596, 147597, 147598, 147599, 147600, 147601, 147602, 
+    147603, 147604, 147605, 147606, 147607, 147608, 147609, 147610, 147611, 
+    147612, 147613, 147614, 147615, 147616, 147617, 147618, 147619, 147620, 
+    147621, 147622, 147623, 147624, 147625, 147626, 147627, 147628, 147629, 
+    147630, 147631, 147632, 147633, 147634, 147635, 147636, 147637, 147638, 
+    147639, 147640, 147641, 147642, 147643, 147644, 147645, 147646, 147647, 
+    147648, 147649, 147650, 147651, 147652, 147653, 147654, 147655, 147656, 
+    147657, 147658, 147659, 147660, 147661, 147662, 147663, 147664, 147665, 
+    147666, 147667, 147668, 147669, 147670, 147671, 147672, 147673, 147674, 
+    147675, 147676, 147677, 147678, 147679, 147680, 147681, 147682, 147683, 
+    147684, 147685, 147686, 147687, 147688, 147689, 147690, 147691, 147692, 
+    147693, 147694, 147695, 147696, 147697, 147698, 147699, 147700, 147701, 
+    147702, 147703, 147704, 147705, 147706, 147707, 147708, 147709, 147710, 
+    147711, 147712, 147713, 147714, 147715, 147716, 147717, 147718, 147719, 
+    147720, 147721, 147722, 147723, 147724, 147725, 147726, 147727, 147728, 
+    147729, 147730, 147731, 147732, 147733, 147734, 147735, 147736, 147737, 
+    147738, 147739, 147740, 147741, 147742, 147743, 147744, 147745, 147746, 
+    147747, 147748, 147749, 147750, 147751, 147752, 147753, 147754, 147755, 
+    147756, 147757, 147758, 147759, 147760, 147761, 147762, 147763, 147764, 
+    147765, 147766, 147767, 147768, 147769, 147770, 147771, 147772, 147773, 
+    147774, 147775, 147776, 147777, 147778, 147779, 147780, 147781, 147782, 
+    147783, 147784, 147785, 147786, 147787, 147788, 147789, 147790, 147791, 
+    147792, 147793, 147794, 147795, 147796, 147797, 147798, 147799, 147800, 
+    147801, 147802, 147803, 147804, 147805, 147806, 147807, 147808, 147809, 
+    147810, 147811, 147812, 147813, 147814, 147815, 147816, 147817, 147818, 
+    147819, 147820, 147821, 147822, 147823, 147824, 147825, 147826, 147827, 
+    147828, 147829, 147830, 147831, 147832, 147833, 147834, 147835, 147836, 
+    147837, 147838, 147839, 147840, 147841, 147842, 147843, 147844, 147845, 
+    147846, 147847, 147848, 147849, 147850, 147851, 147852, 147853, 147854, 
+    147855, 147856, 147857, 147858, 147859, 147860, 147861, 147862, 147863, 
+    147864, 147865, 147866, 147867, 147868, 147869, 147870, 147871, 147872, 
+    147873, 147874, 147875, 147876, 147877, 147878, 147879, 147880, 147881, 
+    147882, 147883, 147884, 147885, 147886, 147887, 147888, 147889, 147890, 
+    147891, 147892, 147893, 147894, 147895, 147896, 147897, 147898, 147899, 
+    147900, 147901, 147902, 147903, 147904, 147905, 147906, 147907, 147908, 
+    147909, 147910, 147911, 147912, 147913, 147914, 147915, 147916, 147917, 
+    147918, 147919, 147920, 147921, 147922, 147923, 147924, 147925, 147926, 
+    147927, 147928, 147929, 147930, 147931, 147932, 147933, 147934, 147935, 
+    147936, 147937, 147938, 147939, 147940, 147941, 147942, 147943, 147944, 
+    147945, 147946, 147947, 147948, 147949, 147950, 147951, 147952, 147953, 
+    147954, 147955, 147956, 147957, 147958, 147959, 147960, 147961, 147962, 
+    147963, 147964, 147965, 147966, 147967, 147968, 147969, 147970, 147971, 
+    147972, 147973, 147974, 147975, 147976, 147977, 147978, 147979, 147980, 
+    147981, 147982, 147983, 147984, 147985, 147986, 147987, 147988, 147989, 
+    147990, 147991, 147992, 147993, 147994, 147995, 147996, 147997, 147998, 
+    147999, 148000, 148001, 148002, 148003, 148004, 148005, 148006, 148007, 
+    148008, 148009, 148010, 148011, 148012, 148013, 148014, 148015, 148016, 
+    148017, 148018, 148019, 148020, 148021, 148022, 148023, 148024, 148025, 
+    148026, 148027, 148028, 148029, 148030, 148031, 148032, 148033, 148034, 
+    148035, 148036, 148037, 148038, 148039, 148040, 148041, 148042, 148043, 
+    148044, 148045, 148046, 148047, 148048, 148049, 148050, 148051, 148052, 
+    148053, 148054, 148055, 148056, 148057, 148058, 148059, 148060, 148061, 
+    148062, 148063, 148064, 148065, 148066, 148067, 148068, 148069, 148070, 
+    148071, 148072, 148073, 148074, 148075, 148076, 148077, 148078, 148079, 
+    148080, 148081, 148082, 148083, 148084, 148085, 148086, 148087, 148088, 
+    148089, 148090, 148091, 148092, 148093, 148094, 148095, 148096, 148097, 
+    148098, 148099, 148100, 148101, 148102, 148103, 148104, 148105, 148106, 
+    148107, 148108, 148109, 148110, 148111, 148112, 148113, 148114, 148115, 
+    148116, 148117, 148118, 148119, 148120, 148121, 148122, 148123, 148124, 
+    148125, 148126, 148127, 148128, 148129, 148130, 148131, 148132, 148133, 
+    148134, 148135, 148136, 148137, 148138, 148139, 148140, 148141, 148142, 
+    148143, 148144, 148145, 148146, 148147, 148148, 148149, 148150, 148151, 
+    148152, 148153, 148154, 148155, 148156, 148157, 148158, 148159, 148160, 
+    148161, 148162, 148163, 148164, 148165, 148166, 148167, 148168, 148169, 
+    148170, 148171, 148172, 148173, 148174, 148175, 148176, 148177, 148178, 
+    148179, 148180, 148181, 148182, 148183, 148184, 148185, 148186, 148187, 
+    148188, 148189, 148190, 148191, 148192, 148193, 148194, 148195, 148196, 
+    148197, 148198, 148199, 148200, 148201, 148202, 148203, 148204, 148205, 
+    148206, 148207, 148208, 148209, 148210, 148211, 148212, 148213, 148214, 
+    148215, 148216, 148217, 148218, 148219, 148220, 148221, 148222, 148223, 
+    148224, 148225, 148226, 148227, 148228, 148229, 148230, 148231, 148232, 
+    148233, 148234, 148235, 148236, 148237, 148238, 148239, 148240, 148241, 
+    148242, 148243, 148244, 148245, 148246, 148247, 148248, 148249, 148250, 
+    148251, 148252, 148253, 148254, 148255, 148256, 148257, 148258, 148259, 
+    148260, 148261, 148262, 148263, 148264, 148265, 148266, 148267, 148268, 
+    148269, 148270, 148271, 148272, 148273, 148274, 148275, 148276, 148277, 
+    148278, 148279, 148280, 148281, 148282, 148283, 148284, 148285, 148286, 
+    148287, 148288, 148289, 148290, 148291, 148292, 148293, 148294, 148295, 
+    148296, 148297, 148298, 148299, 148300, 148301, 148302, 148303, 148304, 
+    148305, 148306, 148307, 148308, 148309, 148310, 148311, 148312, 148313, 
+    148314, 148315, 148316, 148317, 148318, 148319, 148320, 148321, 148322, 
+    148323, 148324, 148325, 148326, 148327, 148328, 148329, 148330, 148331, 
+    148332, 148333, 148334, 148335, 148336, 148337, 148338, 148339, 148340, 
+    148341, 148342, 148343, 148344, 148345, 148346, 148347, 148348, 148349, 
+    148350, 148351, 148352, 148353, 148354, 148355, 148356, 148357, 148358, 
+    148359, 148360, 148361, 148362, 148363, 148364, 148365, 148366, 148367, 
+    148368, 148369, 148370, 148371, 148372, 148373, 148374, 148375, 148376, 
+    148377, 148378, 148379, 148380, 148381, 148382, 148383, 148384, 148385, 
+    148386, 148387, 148388, 148389, 148390, 148391, 148392, 148393, 148394, 
+    148395, 148396, 148397, 148398, 148399, 148400, 148401, 148402, 148403, 
+    148404, 148405, 148406, 148407, 148408, 148409, 148410, 148411, 148412, 
+    148413, 148414, 148415, 148416, 148417, 148418, 148419, 148420, 148421, 
+    148422, 148423, 148424, 148425, 148426, 148427, 148428, 148429, 148430, 
+    148431, 148432, 148433, 148434, 148435, 148436, 148437, 148438, 148439, 
+    148440, 148441, 148442, 148443, 148444, 148445, 148446, 148447, 148448, 
+    148449, 148450, 148451, 148452, 148453, 148454, 148455, 148456, 148457, 
+    148458, 148459, 148460, 148461, 148462, 148463, 148464, 148465, 148466, 
+    148467, 148468, 148469, 148470, 148471, 148472, 148473, 148474, 148475, 
+    148476, 148477, 148478, 148479, 148480, 148481, 148482, 148483, 148484, 
+    148485, 148486, 148487, 148488, 148489, 148490, 148491, 148492, 148493, 
+    148494, 148495, 148496, 148497, 148498, 148499, 148500, 148501, 148502, 
+    148503, 148504, 148505, 148506, 148507, 148508, 148509, 148510, 148511, 
+    148512, 148513, 148514, 148515, 148516, 148517, 148518, 148519, 148520, 
+    148521, 148522, 148523, 148524, 148525, 148526, 148527, 148528, 148529, 
+    148530, 148531, 148532, 148533, 148534, 148535, 148536, 148537, 148538, 
+    148539, 148540, 148541, 148542, 148543, 148544, 148545, 148546, 148547, 
+    148548, 148549, 148550, 148551, 148552, 148553, 148554, 148555, 148556, 
+    148557, 148558, 148559, 148560, 148561, 148562, 148563, 148564, 148565, 
+    148566, 148567, 148568, 148569, 148570, 148571, 148572, 148573, 148574, 
+    148575, 148576, 148577, 148578, 148579, 148580, 148581, 148582, 148583, 
+    148584, 148585, 148586, 148587, 148588, 148589, 148590, 148591, 148592, 
+    148593, 148594, 148595, 148596, 148597, 148598, 148599, 148600, 148601, 
+    148602, 148603, 148604, 148605, 148606, 148607, 148608, 148609, 148610, 
+    148611, 148612, 148613, 148614, 148615, 148616, 148617, 148618, 148619, 
+    148620, 148621, 148622, 148623, 148624, 148625, 148626, 148627, 148628, 
+    148629, 148630, 148631, 148632, 148633, 148634, 148635, 148636, 148637, 
+    148638, 148639, 148640, 148641, 148642, 148643, 148644, 148645, 148646, 
+    148647, 148648, 148649, 148650, 148651, 148652, 148653, 148654, 148655, 
+    148656, 148657, 148658, 148659, 148660, 148661, 148662, 148663, 148664, 
+    148665, 148666, 148667, 148668, 148669, 148670, 148671, 148672, 148673, 
+    148674, 148675, 148676, 148677, 148678, 148679, 148680, 148681, 148682, 
+    148683, 148684, 148685, 148686, 148687, 148688, 148689, 148690, 148691, 
+    148692, 148693, 148694, 148695, 148696, 148697, 148698, 148699, 148700, 
+    148701, 148702, 148703, 148704, 148705, 148706, 148707, 148708, 148709, 
+    148710, 148711, 148712, 148713, 148714, 148715, 148716, 148717, 148718, 
+    148719, 148720, 148721, 148722, 148723, 148724, 148725, 148726, 148727, 
+    148728, 148729, 148730, 148731, 148732, 148733, 148734, 148735, 148736, 
+    148737, 148738, 148739, 148740, 148741, 148742, 148743, 148744, 148745, 
+    148746, 148747, 148748, 148749, 148750, 148751, 148752, 148753, 148754, 
+    148755, 148756, 148757, 148758, 148759, 148760, 148761, 148762, 148763, 
+    148764, 148765, 148766, 148767, 148768, 148769, 148770, 148771, 148772, 
+    148773, 148774, 148775, 148776, 148777, 148778, 148779, 148780, 148781, 
+    148782, 148783, 148784, 148785, 148786, 148787, 148788, 148789, 148790, 
+    148791, 148792, 148793, 148794, 148795, 148796, 148797, 148798, 148799, 
+    148800, 148801, 148802, 148803, 148804, 148805, 148806, 148807, 148808, 
+    148809, 148810, 148811, 148812, 148813, 148814, 148815, 148816, 148817, 
+    148818, 148819, 148820, 148821, 148822, 148823, 148824, 148825, 148826, 
+    148827, 148828, 148829, 148830, 148831, 148832, 148833, 148834, 148835, 
+    148836, 148837, 148838, 148839, 148840, 148841, 148842, 148843, 148844, 
+    148845, 148846, 148847, 148848, 148849, 148850, 148851, 148852, 148853, 
+    148854, 148855, 148856, 148857, 148858, 148859, 148860, 148861, 148862, 
+    148863, 148864, 148865, 148866, 148867, 148868, 148869, 148870, 148871, 
+    148872, 148873, 148874, 148875, 148876, 148877, 148878, 148879, 148880, 
+    148881, 148882, 148883, 148884, 148885, 148886, 148887, 148888, 148889, 
+    148890, 148891, 148892, 148893, 148894, 148895, 148896, 148897, 148898, 
+    148899, 148900, 148901, 148902, 148903, 148904, 148905, 148906, 148907, 
+    148908, 148909, 148910, 148911, 148912, 148913, 148914, 148915, 148916, 
+    148917, 148918, 148919, 148920, 148921, 148922, 148923, 148924, 148925, 
+    148926, 148927, 148928, 148929, 148930, 148931, 148932, 148933, 148934, 
+    148935, 148936, 148937, 148938, 148939, 148940, 148941, 148942, 148943, 
+    148944, 148945, 148946, 148947, 148948, 148949, 148950, 148951, 148952, 
+    148953, 148954, 148955, 148956, 148957, 148958, 148959, 148960, 148961, 
+    148962, 148963, 148964, 148965, 148966, 148967, 148968, 148969, 148970, 
+    148971, 148972, 148973, 148974, 148975, 148976, 148977, 148978, 148979, 
+    148980, 148981, 148982, 148983, 148984, 148985, 148986, 148987, 148988, 
+    148989, 148990, 148991, 148992, 148993, 148994, 148995, 148996, 148997, 
+    148998, 148999, 149000, 149001, 149002, 149003, 149004, 149005, 149006, 
+    149007, 149008, 149009, 149010, 149011, 149012, 149013, 149014, 149015, 
+    149016, 149017, 149018, 149019, 149020, 149021, 149022, 149023, 149024, 
+    149025, 149026, 149027, 149028, 149029, 149030, 149031, 149032, 149033, 
+    149034, 149035, 149036, 149037, 149038, 149039, 149040, 149041, 149042, 
+    149043, 149044, 149045, 149046, 149047, 149048, 149049, 149050, 149051, 
+    149052, 149053, 149054, 149055, 149056, 149057, 149058, 149059, 149060, 
+    149061, 149062, 149063, 149064, 149065, 149066, 149067, 149068, 149069, 
+    149070, 149071, 149072, 149073, 149074, 149075, 149076, 149077, 149078, 
+    149079, 149080, 149081, 149082, 149083, 149084, 149085, 149086, 149087, 
+    149088, 149089, 149090, 149091, 149092, 149093, 149094, 149095, 149096, 
+    149097, 149098, 149099, 149100, 149101, 149102, 149103, 149104, 149105, 
+    149106, 149107, 149108, 149109, 149110, 149111, 149112, 149113, 149114, 
+    149115, 149116, 149117, 149118, 149119, 149120, 149121, 149122, 149123, 
+    149124, 149125, 149126, 149127, 149128, 149129, 149130, 149131, 149132, 
+    149133, 149134, 149135, 149136, 149137, 149138, 149139, 149140, 149141, 
+    149142, 149143, 149144, 149145, 149146, 149147, 149148, 149149, 149150, 
+    149151, 149152, 149153, 149154, 149155, 149156, 149157, 149158, 149159, 
+    149160, 149161, 149162, 149163, 149164, 149165, 149166, 149167, 149168, 
+    149169, 149170, 149171, 149172, 149173, 149174, 149175, 149176, 149177, 
+    149178, 149179, 149180, 149181, 149182, 149183, 149184, 149185, 149186, 
+    149187, 149188, 149189, 149190, 149191, 149192, 149193, 149194, 149195, 
+    149196, 149197, 149198, 149199, 149200, 149201, 149202, 149203, 149204, 
+    149205, 149206, 149207, 149208, 149209, 149210, 149211, 149212, 149213, 
+    149214, 149215, 149216, 149217, 149218, 149219, 149220, 149221, 149222, 
+    149223, 149224, 149225, 149226, 149227, 149228, 149229, 149230, 149231, 
+    149232, 149233, 149234, 149235, 149236, 149237, 149238, 149239, 149240, 
+    149241, 149242, 149243, 149244, 149245, 149246, 149247, 149248, 149249, 
+    149250, 149251, 149252, 149253, 149254, 149255, 149256, 149257, 149258, 
+    149259, 149260, 149261, 149262, 149263, 149264, 149265, 149266, 149267, 
+    149268, 149269, 149270, 149271, 149272, 149273, 149274, 149275, 149276, 
+    149277, 149278, 149279, 149280, 149281, 149282, 149283, 149284, 149285, 
+    149286, 149287, 149288, 149289, 149290, 149291, 149292, 149293, 149294, 
+    149295, 149296, 149297, 149298, 149299, 149300, 149301, 149302, 149303, 
+    149304, 149305, 149306, 149307, 149308, 149309, 149310, 149311, 149312, 
+    149313, 149314, 149315, 149316, 149317, 149318, 149319, 149320, 149321, 
+    149322, 149323, 149324, 149325, 149326, 149327, 149328, 149329, 149330, 
+    149331, 149332, 149333, 149334, 149335, 149336, 149337, 149338, 149339, 
+    149340, 149341, 149342, 149343, 149344, 149345, 149346, 149347, 149348, 
+    149349, 149350, 149351, 149352, 149353, 149354, 149355, 149356, 149357, 
+    149358, 149359, 149360, 149361, 149362, 149363, 149364, 149365, 149366, 
+    149367, 149368, 149369, 149370, 149371, 149372, 149373, 149374, 149375, 
+    149376, 149377, 149378, 149379, 149380, 149381, 149382, 149383, 149384, 
+    149385, 149386, 149387, 149388, 149389, 149390, 149391, 149392, 149393, 
+    149394, 149395, 149396, 149397, 149398, 149399, 149400, 149401, 149402, 
+    149403, 149404, 149405, 149406, 149407, 149408, 149409, 149410, 149411, 
+    149412, 149413, 149414, 149415, 149416, 149417, 149418, 149419, 149420, 
+    149421, 149422, 149423, 149424, 149425, 149426, 149427, 149428, 149429, 
+    149430, 149431, 149432, 149433, 149434, 149435, 149436, 149437, 149438, 
+    149439, 149440, 149441, 149442, 149443, 149444, 149445, 149446, 149447, 
+    149448, 149449, 149450, 149451, 149452, 149453, 149454, 149455, 149456, 
+    149457, 149458, 149459, 149460, 149461, 149462, 149463, 149464, 149465, 
+    149466, 149467, 149468, 149469, 149470, 149471, 149472, 149473, 149474, 
+    149475, 149476, 149477, 149478, 149479, 149480, 149481, 149482, 149483, 
+    149484, 149485, 149486, 149487, 149488, 149489, 149490, 149491, 149492, 
+    149493, 149494, 149495, 149496, 149497, 149498, 149499, 149500, 149501, 
+    149502, 149503, 149504, 149505, 149506, 149507, 149508, 149509, 149510, 
+    149511, 149512, 149513, 149514, 149515, 149516, 149517, 149518, 149519, 
+    149520, 149521, 149522, 149523, 149524, 149525, 149526, 149527, 149528, 
+    149529, 149530, 149531, 149532, 149533, 149534, 149535, 149536, 149537, 
+    149538, 149539, 149540, 149541, 149542, 149543, 149544, 149545, 149546, 
+    149547, 149548, 149549, 149550, 149551, 149552, 149553, 149554, 149555, 
+    149556, 149557, 149558, 149559, 149560, 149561, 149562, 149563, 149564, 
+    149565, 149566, 149567, 149568, 149569, 149570, 149571, 149572, 149573, 
+    149574, 149575, 149576, 149577, 149578, 149579, 149580, 149581, 149582, 
+    149583, 149584, 149585, 149586, 149587, 149588, 149589, 149590, 149591, 
+    149592, 149593, 149594, 149595, 149596, 149597, 149598, 149599, 149600, 
+    149601, 149602, 149603, 149604, 149605, 149606, 149607, 149608, 149609, 
+    149610, 149611, 149612, 149613, 149614, 149615, 149616, 149617, 149618, 
+    149619, 149620, 149621, 149622, 149623, 149624, 149625, 149626, 149627, 
+    149628, 149629, 149630, 149631, 149632, 149633, 149634, 149635, 149636, 
+    149637, 149638, 149639, 149640, 149641, 149642, 149643, 149644, 149645, 
+    149646, 149647, 149648, 149649, 149650, 149651, 149652, 149653, 149654, 
+    149655, 149656, 149657, 149658, 149659, 149660, 149661, 149662, 149663, 
+    149664, 149665, 149666, 149667, 149668, 149669, 149670, 149671, 149672, 
+    149673, 149674, 149675, 149676, 149677, 149678, 149679, 149680, 149681, 
+    149682, 149683, 149684, 149685, 149686, 149687, 149688, 149689, 149690, 
+    149691, 149692, 149693, 149694, 149695, 149696, 149697, 149698, 149699, 
+    149700, 149701, 149702, 149703, 149704, 149705, 149706, 149707, 149708, 
+    149709, 149710, 149711, 149712, 149713, 149714, 149715, 149716, 149717, 
+    149718, 149719, 149720, 149721, 149722, 149723, 149724, 149725, 149726, 
+    149727, 149728, 149729, 149730, 149731, 149732, 149733, 149734, 149735, 
+    149736, 149737, 149738, 149739, 149740, 149741, 149742, 149743, 149744, 
+    149745, 149746, 149747, 149748, 149749, 149750, 149751, 149752, 149753, 
+    149754, 149755, 149756, 149757, 149758, 149759, 149760, 149761, 149762, 
+    149763, 149764, 149765, 149766, 149767, 149768, 149769, 149770, 149771, 
+    149772, 149773, 149774, 149775, 149776, 149777, 149778, 149779, 149780, 
+    149781, 149782, 149783, 149784, 149785, 149786, 149787, 149788, 149789, 
+    149790, 149791, 149792, 149793, 149794, 149795, 149796, 149797, 149798, 
+    149799, 149800, 149801, 149802, 149803, 149804, 149805, 149806, 149807, 
+    149808, 149809, 149810, 149811, 149812, 149813, 149814, 149815, 149816, 
+    149817, 149818, 149819, 149820, 149821, 149822, 149823, 149824, 149825, 
+    149826, 149827, 149828, 149829, 149830, 149831, 149832, 149833, 149834, 
+    149835, 149836, 149837, 149838, 149839, 149840, 149841, 149842, 149843, 
+    149844, 149845, 149846, 149847, 149848, 149849, 149850, 149851, 149852, 
+    149853, 149854, 149855, 149856, 149857, 149858, 149859, 149860, 149861, 
+    149862, 149863, 149864, 149865, 149866, 149867, 149868, 149869, 149870, 
+    149871, 149872, 149873, 149874, 149875, 149876, 149877, 149878, 149879, 
+    149880, 149881, 149882, 149883, 149884, 149885, 149886, 149887, 149888, 
+    149889, 149890, 149891, 149892, 149893, 149894, 149895, 149896, 149897, 
+    149898, 149899, 149900, 149901, 149902, 149903, 149904, 149905, 149906, 
+    149907, 149908, 149909, 149910, 149911, 149912, 149913, 149914, 149915, 
+    149916, 149917, 149918, 149919, 149920, 149921, 149922, 149923, 149924, 
+    149925, 149926, 149927, 149928, 149929, 149930, 149931, 149932, 149933, 
+    149934, 149935, 149936, 149937, 149938, 149939, 149940, 149941, 149942, 
+    149943, 149944, 149945, 149946, 149947, 149948, 149949, 149950, 149951, 
+    149952, 149953, 149954, 149955, 149956, 149957, 149958, 149959, 149960, 
+    149961, 149962, 149963, 149964, 149965, 149966, 149967, 149968, 149969, 
+    149970, 149971, 149972, 149973, 149974, 149975, 149976, 149977, 149978, 
+    149979, 149980, 149981, 149982, 149983, 149984, 149985, 149986, 149987, 
+    149988, 149989, 149990, 149991, 149992, 149993, 149994, 149995, 149996, 
+    149997, 149998, 149999, 150000, 150001, 150002, 150003, 150004, 150005, 
+    150006, 150007, 150008, 150009, 150010, 150011, 150012, 150013, 150014, 
+    150015, 150016, 150017, 150018, 150019, 150020, 150021, 150022, 150023, 
+    150024, 150025, 150026, 150027, 150028, 150029, 150030, 150031, 150032, 
+    150033, 150034, 150035, 150036, 150037, 150038, 150039, 150040, 150041, 
+    150042, 150043, 150044, 150045, 150046, 150047, 150048, 150049, 150050, 
+    150051, 150052, 150053, 150054, 150055, 150056, 150057, 150058, 150059, 
+    150060, 150061, 150062, 150063, 150064, 150065, 150066, 150067, 150068, 
+    150069, 150070, 150071, 150072, 150073, 150074, 150075, 150076, 150077, 
+    150078, 150079, 150080, 150081, 150082, 150083, 150084, 150085, 150086, 
+    150087, 150088, 150089, 150090, 150091, 150092, 150093, 150094, 150095, 
+    150096, 150097, 150098, 150099, 150100, 150101, 150102, 150103, 150104, 
+    150105, 150106, 150107, 150108, 150109, 150110, 150111, 150112, 150113, 
+    150114, 150115, 150116, 150117, 150118, 150119, 150120, 150121, 150122, 
+    150123, 150124, 150125, 150126, 150127, 150128, 150129, 150130, 150131, 
+    150132, 150133, 150134, 150135, 150136, 150137, 150138, 150139, 150140, 
+    150141, 150142, 150143, 150144, 150145, 150146, 150147, 150148, 150149, 
+    150150, 150151, 150152, 150153, 150154, 150155, 150156, 150157, 150158, 
+    150159, 150160, 150161, 150162, 150163, 150164, 150165, 150166, 150167, 
+    150168, 150169, 150170, 150171, 150172, 150173, 150174, 150175, 150176, 
+    150177, 150178, 150179, 150180, 150181, 150182, 150183, 150184, 150185, 
+    150186, 150187, 150188, 150189, 150190, 150191, 150192, 150193, 150194, 
+    150195, 150196, 150197, 150198, 150199, 150200, 150201, 150202, 150203, 
+    150204, 150205, 150206, 150207, 150208, 150209, 150210, 150211, 150212, 
+    150213, 150214, 150215, 150216, 150217, 150218, 150219, 150220, 150221, 
+    150222, 150223, 150224, 150225, 150226, 150227, 150228, 150229, 150230, 
+    150231, 150232, 150233, 150234, 150235, 150236, 150237, 150238, 150239, 
+    150240, 150241, 150242, 150243, 150244, 150245, 150246, 150247, 150248, 
+    150249, 150250, 150251, 150252, 150253, 150254, 150255, 150256, 150257, 
+    150258, 150259, 150260, 150261, 150262, 150263, 150264, 150265, 150266, 
+    150267, 150268, 150269, 150270, 150271, 150272, 150273, 150274, 150275, 
+    150276, 150277, 150278, 150279, 150280, 150281, 150282, 150283, 150284, 
+    150285, 150286, 150287, 150288, 150289, 150290, 150291, 150292, 150293, 
+    150294, 150295, 150296, 150297, 150298, 150299, 150300, 150301, 150302, 
+    150303, 150304, 150305, 150306, 150307, 150308, 150309, 150310, 150311, 
+    150312, 150313, 150314, 150315, 150316, 150317, 150318, 150319, 150320, 
+    150321, 150322, 150323, 150324, 150325, 150326, 150327, 150328, 150329, 
+    150330, 150331, 150332, 150333, 150334, 150335, 150336, 150337, 150338, 
+    150339, 150340, 150341, 150342, 150343, 150344, 150345, 150346, 150347, 
+    150348, 150349, 150350, 150351, 150352, 150353, 150354, 150355, 150356, 
+    150357, 150358, 150359, 150360, 150361, 150362, 150363, 150364, 150365, 
+    150366, 150367, 150368, 150369, 150370, 150371, 150372, 150373, 150374, 
+    150375, 150376, 150377, 150378, 150379, 150380, 150381, 150382, 150383, 
+    150384, 150385, 150386, 150387, 150388, 150389, 150390, 150391, 150392, 
+    150393, 150394, 150395, 150396, 150397, 150398, 150399, 150400, 150401, 
+    150402, 150403, 150404, 150405, 150406, 150407, 150408, 150409, 150410, 
+    150411, 150412, 150413, 150414, 150415, 150416, 150417, 150418, 150419, 
+    150420, 150421, 150422, 150423, 150424, 150425, 150426, 150427, 150428, 
+    150429, 150430, 150431, 150432, 150433, 150434, 150435, 150436, 150437, 
+    150438, 150439, 150440, 150441, 150442, 150443, 150444, 150445, 150446, 
+    150447, 150448, 150449, 150450, 150451, 150452, 150453, 150454, 150455, 
+    150456, 150457, 150458, 150459, 150460, 150461, 150462, 150463, 150464, 
+    150465, 150466, 150467, 150468, 150469, 150470, 150471, 150472, 150473, 
+    150474, 150475, 150476, 150477, 150478, 150479, 150480, 150481, 150482, 
+    150483, 150484, 150485, 150486, 150487, 150488, 150489, 150490, 150491, 
+    150492, 150493, 150494, 150495, 150496, 150497, 150498, 150499, 150500, 
+    150501, 150502, 150503, 150504, 150505, 150506, 150507, 150508, 150509, 
+    150510, 150511, 150512, 150513, 150514, 150515, 150516, 150517, 150518, 
+    150519, 150520, 150521, 150522, 150523, 150524, 150525, 150526, 150527, 
+    150528, 150529, 150530, 150531, 150532, 150533, 150534, 150535, 150536, 
+    150537, 150538, 150539, 150540, 150541, 150542, 150543, 150544, 150545, 
+    150546, 150547, 150548, 150549, 150550, 150551, 150552, 150553, 150554, 
+    150555, 150556, 150557, 150558, 150559, 150560, 150561, 150562, 150563, 
+    150564, 150565, 150566, 150567, 150568, 150569, 150570, 150571, 150572, 
+    150573, 150574, 150575, 150576, 150577, 150578, 150579, 150580, 150581, 
+    150582, 150583, 150584, 150585, 150586, 150587, 150588, 150589, 150590, 
+    150591, 150592, 150593, 150594, 150595, 150596, 150597, 150598, 150599, 
+    150600, 150601, 150602, 150603, 150604, 150605, 150606, 150607, 150608, 
+    150609, 150610, 150611, 150612, 150613, 150614, 150615, 150616, 150617, 
+    150618, 150619, 150620, 150621, 150622, 150623, 150624, 150625, 150626, 
+    150627, 150628, 150629, 150630, 150631, 150632, 150633, 150634, 150635, 
+    150636, 150637, 150638, 150639, 150640, 150641, 150642, 150643, 150644, 
+    150645, 150646, 150647, 150648, 150649, 150650, 150651, 150652, 150653, 
+    150654, 150655, 150656, 150657, 150658, 150659, 150660, 150661, 150662, 
+    150663, 150664, 150665, 150666, 150667, 150668, 150669, 150670, 150671, 
+    150672, 150673, 150674, 150675, 150676, 150677, 150678, 150679, 150680, 
+    150681, 150682, 150683, 150684, 150685, 150686, 150687, 150688, 150689, 
+    150690, 150691, 150692, 150693, 150694, 150695, 150696, 150697, 150698, 
+    150699, 150700, 150701, 150702, 150703, 150704, 150705, 150706, 150707, 
+    150708, 150709, 150710, 150711, 150712, 150713, 150714, 150715, 150716, 
+    150717, 150718, 150719, 150720, 150721, 150722, 150723, 150724, 150725, 
+    150726, 150727, 150728, 150729, 150730, 150731, 150732, 150733, 150734, 
+    150735, 150736, 150737, 150738, 150739, 150740, 150741, 150742, 150743, 
+    150744, 150745, 150746, 150747, 150748, 150749, 150750, 150751, 150752, 
+    150753, 150754, 150755, 150756, 150757, 150758, 150759, 150760, 150761, 
+    150762, 150763, 150764, 150765, 150766, 150767, 150768, 150769, 150770, 
+    150771, 150772, 150773, 150774, 150775, 150776, 150777, 150778, 150779, 
+    150780, 150781, 150782, 150783, 150784, 150785, 150786, 150787, 150788, 
+    150789, 150790, 150791, 150792, 150793, 150794, 150795, 150796, 150797, 
+    150798, 150799, 150800, 150801, 150802, 150803, 150804, 150805, 150806, 
+    150807, 150808, 150809, 150810, 150811, 150812, 150813, 150814, 150815, 
+    150816, 150817, 150818, 150819, 150820, 150821, 150822, 150823, 150824, 
+    150825, 150826, 150827, 150828, 150829, 150830, 150831, 150832, 150833, 
+    150834, 150835, 150836, 150837, 150838, 150839, 150840, 150841, 150842, 
+    150843, 150844, 150845, 150846, 150847, 150848, 150849, 150850, 150851, 
+    150852, 150853, 150854, 150855, 150856, 150857, 150858, 150859, 150860, 
+    150861, 150862, 150863, 150864, 150865, 150866, 150867, 150868, 150869, 
+    150870, 150871, 150872, 150873, 150874, 150875, 150876, 150877, 150878, 
+    150879, 150880, 150881, 150882, 150883, 150884, 150885, 150886, 150887, 
+    150888, 150889, 150890, 150891, 150892, 150893, 150894, 150895, 150896, 
+    150897, 150898, 150899, 150900, 150901, 150902, 150903, 150904, 150905, 
+    150906, 150907, 150908, 150909, 150910, 150911, 150912, 150913, 150914, 
+    150915, 150916, 150917, 150918, 150919, 150920, 150921, 150922, 150923, 
+    150924, 150925, 150926, 150927, 150928, 150929, 150930, 150931, 150932, 
+    150933, 150934, 150935, 150936, 150937, 150938, 150939, 150940, 150941, 
+    150942, 150943, 150944, 150945, 150946, 150947, 150948, 150949, 150950, 
+    150951, 150952, 150953, 150954, 150955, 150956, 150957, 150958, 150959, 
+    150960, 150961, 150962, 150963, 150964, 150965, 150966, 150967, 150968, 
+    150969, 150970, 150971, 150972, 150973, 150974, 150975, 150976, 150977, 
+    150978, 150979, 150980, 150981, 150982, 150983, 150984, 150985, 150986, 
+    150987, 150988, 150989, 150990, 150991, 150992, 150993, 150994, 150995, 
+    150996, 150997, 150998, 150999, 151000, 151001, 151002, 151003, 151004, 
+    151005, 151006, 151007, 151008, 151009, 151010, 151011, 151012, 151013, 
+    151014, 151015, 151016, 151017, 151018, 151019, 151020, 151021, 151022, 
+    151023, 151024, 151025, 151026, 151027, 151028, 151029, 151030, 151031, 
+    151032, 151033, 151034, 151035, 151036, 151037, 151038, 151039, 151040, 
+    151041, 151042, 151043, 151044, 151045, 151046, 151047, 151048, 151049, 
+    151050, 151051, 151052, 151053, 151054, 151055, 151056, 151057, 151058, 
+    151059, 151060, 151061, 151062, 151063, 151064, 151065, 151066, 151067, 
+    151068, 151069, 151070, 151071, 151072, 151073, 151074, 151075, 151076, 
+    151077, 151078, 151079, 151080, 151081, 151082, 151083, 151084, 151085, 
+    151086, 151087, 151088, 151089, 151090, 151091, 151092, 151093, 151094, 
+    151095, 151096, 151097, 151098, 151099, 151100, 151101, 151102, 151103, 
+    151104, 151105, 151106, 151107, 151108, 151109, 151110, 151111, 151112, 
+    151113, 151114, 151115, 151116, 151117, 151118, 151119, 151120, 151121, 
+    151122, 151123, 151124, 151125, 151126, 151127, 151128, 151129, 151130, 
+    151131, 151132, 151133, 151134, 151135, 151136, 151137, 151138, 151139, 
+    151140, 151141, 151142, 151143, 151144, 151145, 151146, 151147, 151148, 
+    151149, 151150, 151151, 151152, 151153, 151154, 151155, 151156, 151157, 
+    151158, 151159, 151160, 151161, 151162, 151163, 151164, 151165, 151166, 
+    151167, 151168, 151169, 151170, 151171, 151172, 151173, 151174, 151175, 
+    151176, 151177, 151178, 151179, 151180, 151181, 151182, 151183, 151184, 
+    151185, 151186, 151187, 151188, 151189, 151190, 151191, 151192, 151193, 
+    151194, 151195, 151196, 151197, 151198, 151199, 151200, 151201, 151202, 
+    151203, 151204, 151205, 151206, 151207, 151208, 151209, 151210, 151211, 
+    151212, 151213, 151214, 151215, 151216, 151217, 151218, 151219, 151220, 
+    151221, 151222, 151223, 151224, 151225, 151226, 151227, 151228, 151229, 
+    151230, 151231, 151232, 151233, 151234, 151235, 151236, 151237, 151238, 
+    151239, 151240, 151241, 151242, 151243, 151244, 151245, 151246, 151247, 
+    151248, 151249, 151250, 151251, 151252, 151253, 151254, 151255, 151256, 
+    151257, 151258, 151259, 151260, 151261, 151262, 151263, 151264, 151265, 
+    151266, 151267, 151268, 151269, 151270, 151271, 151272, 151273, 151274, 
+    151275, 151276, 151277, 151278, 151279, 151280, 151281, 151282, 151283, 
+    151284, 151285, 151286, 151287, 151288, 151289, 151290, 151291, 151292, 
+    151293, 151294, 151295, 151296, 151297, 151298, 151299, 151300, 151301, 
+    151302, 151303, 151304, 151305, 151306, 151307, 151308, 151309, 151310, 
+    151311, 151312, 151313, 151314, 151315, 151316, 151317, 151318, 151319, 
+    151320, 151321, 151322, 151323, 151324, 151325, 151326, 151327, 151328, 
+    151329, 151330, 151331, 151332, 151333, 151334, 151335, 151336, 151337, 
+    151338, 151339, 151340, 151341, 151342, 151343, 151344, 151345, 151346, 
+    151347, 151348, 151349, 151350, 151351, 151352, 151353, 151354, 151355, 
+    151356, 151357, 151358, 151359, 151360, 151361, 151362, 151363, 151364, 
+    151365, 151366, 151367, 151368, 151369, 151370, 151371, 151372, 151373, 
+    151374, 151375, 151376, 151377, 151378, 151379, 151380, 151381, 151382, 
+    151383, 151384, 151385, 151386, 151387, 151388, 151389, 151390, 151391, 
+    151392, 151393, 151394, 151395, 151396, 151397, 151398, 151399, 151400, 
+    151401, 151402, 151403, 151404, 151405, 151406, 151407, 151408, 151409, 
+    151410, 151411, 151412, 151413, 151414, 151415, 151416, 151417, 151418, 
+    151419, 151420, 151421, 151422, 151423, 151424, 151425, 151426, 151427, 
+    151428, 151429, 151430, 151431, 151432, 151433, 151434, 151435, 151436, 
+    151437, 151438, 151439, 151440, 151441, 151442, 151443, 151444, 151445, 
+    151446, 151447, 151448, 151449, 151450, 151451, 151452, 151453, 151454, 
+    151455, 151456, 151457, 151458, 151459, 151460, 151461, 151462, 151463, 
+    151464, 151465, 151466, 151467, 151468, 151469, 151470, 151471, 151472, 
+    151473, 151474, 151475, 151476, 151477, 151478, 151479, 151480, 151481, 
+    151482, 151483, 151484, 151485, 151486, 151487, 151488, 151489, 151490, 
+    151491, 151492, 151493, 151494, 151495, 151496, 151497, 151498, 151499, 
+    151500, 151501, 151502, 151503, 151504, 151505, 151506, 151507, 151508, 
+    151509, 151510, 151511, 151512, 151513, 151514, 151515, 151516, 151517, 
+    151518, 151519, 151520, 151521, 151522, 151523, 151524, 151525, 151526, 
+    151527, 151528, 151529, 151530, 151531, 151532, 151533, 151534, 151535, 
+    151536, 151537, 151538, 151539, 151540, 151541, 151542, 151543, 151544, 
+    151545, 151546, 151547, 151548, 151549, 151550, 151551, 151552, 151553, 
+    151554, 151555, 151556, 151557, 151558, 151559, 151560, 151561, 151562, 
+    151563, 151564, 151565, 151566, 151567, 151568, 151569, 151570, 151571, 
+    151572, 151573, 151574, 151575, 151576, 151577, 151578, 151579, 151580, 
+    151581, 151582, 151583, 151584, 151585, 151586, 151587, 151588, 151589, 
+    151590, 151591, 151592, 151593, 151594, 151595, 151596, 151597, 151598, 
+    151599, 151600, 151601, 151602, 151603, 151604, 151605, 151606, 151607, 
+    151608, 151609, 151610, 151611, 151612, 151613, 151614, 151615, 151616, 
+    151617, 151618, 151619, 151620, 151621, 151622, 151623, 151624, 151625, 
+    151626, 151627, 151628, 151629, 151630, 151631, 151632, 151633, 151634, 
+    151635, 151636, 151637, 151638, 151639, 151640, 151641, 151642, 151643, 
+    151644, 151645, 151646, 151647, 151648, 151649, 151650, 151651, 151652, 
+    151653, 151654, 151655, 151656, 151657, 151658, 151659, 151660, 151661, 
+    151662, 151663, 151664, 151665, 151666, 151667, 151668, 151669, 151670, 
+    151671, 151672, 151673, 151674, 151675, 151676, 151677, 151678, 151679, 
+    151680, 151681, 151682, 151683, 151684, 151685, 151686, 151687, 151688, 
+    151689, 151690, 151691, 151692, 151693, 151694, 151695, 151696, 151697, 
+    151698, 151699, 151700, 151701, 151702, 151703, 151704, 151705, 151706, 
+    151707, 151708, 151709, 151710, 151711, 151712, 151713, 151714, 151715, 
+    151716, 151717, 151718, 151719, 151720, 151721, 151722, 151723, 151724, 
+    151725, 151726, 151727, 151728, 151729, 151730, 151731, 151732, 151733, 
+    151734, 151735, 151736, 151737, 151738, 151739, 151740, 151741, 151742, 
+    151743, 151744, 151745, 151746, 151747, 151748, 151749, 151750, 151751, 
+    151752, 151753, 151754, 151755, 151756, 151757, 151758, 151759, 151760, 
+    151761, 151762, 151763, 151764, 151765, 151766, 151767, 151768, 151769, 
+    151770, 151771, 151772, 151773, 151774, 151775, 151776, 151777, 151778, 
+    151779, 151780, 151781, 151782, 151783, 151784, 151785, 151786, 151787, 
+    151788, 151789, 151790, 151791, 151792, 151793, 151794, 151795, 151796, 
+    151797, 151798, 151799, 151800, 151801, 151802, 151803, 151804, 151805, 
+    151806, 151807, 151808, 151809, 151810, 151811, 151812, 151813, 151814, 
+    151815, 151816, 151817, 151818, 151819, 151820, 151821, 151822, 151823, 
+    151824, 151825, 151826, 151827, 151828, 151829, 151830, 151831, 151832, 
+    151833, 151834, 151835, 151836, 151837, 151838, 151839, 151840, 151841, 
+    151842, 151843, 151844, 151845, 151846, 151847, 151848, 151849, 151850, 
+    151851, 151852, 151853, 151854, 151855, 151856, 151857, 151858, 151859, 
+    151860, 151861, 151862, 151863, 151864, 151865, 151866, 151867, 151868, 
+    151869, 151870, 151871, 151872, 151873, 151874, 151875, 151876, 151877, 
+    151878, 151879, 151880, 151881, 151882, 151883, 151884, 151885, 151886, 
+    151887, 151888, 151889, 151890, 151891, 151892, 151893, 151894, 151895, 
+    151896, 151897, 151898, 151899, 151900, 151901, 151902, 151903, 151904, 
+    151905, 151906, 151907, 151908, 151909, 151910, 151911, 151912, 151913, 
+    151914, 151915, 151916, 151917, 151918, 151919, 151920, 151921, 151922, 
+    151923, 151924, 151925, 151926, 151927, 151928, 151929, 151930, 151931, 
+    151932, 151933, 151934, 151935, 151936, 151937, 151938, 151939, 151940, 
+    151941, 151942, 151943, 151944, 151945, 151946, 151947, 151948, 151949, 
+    151950, 151951, 151952, 151953, 151954, 151955, 151956, 151957, 151958, 
+    151959, 151960, 151961, 151962, 151963, 151964, 151965, 151966, 151967, 
+    151968, 151969, 151970, 151971, 151972, 151973, 151974, 151975, 151976, 
+    151977, 151978, 151979, 151980, 151981, 151982, 151983, 151984, 151985, 
+    151986, 151987, 151988, 151989, 151990, 151991, 151992, 151993, 151994, 
+    151995, 151996, 151997, 151998, 151999, 152000, 152001, 152002, 152003, 
+    152004, 152005, 152006, 152007, 152008, 152009, 152010, 152011, 152012, 
+    152013, 152014, 152015, 152016, 152017, 152018, 152019, 152020, 152021, 
+    152022, 152023, 152024, 152025, 152026, 152027, 152028, 152029, 152030, 
+    152031, 152032, 152033, 152034, 152035, 152036, 152037, 152038, 152039, 
+    152040, 152041, 152042, 152043, 152044, 152045, 152046, 152047, 152048, 
+    152049, 152050, 152051, 152052, 152053, 152054, 152055, 152056, 152057, 
+    152058, 152059, 152060, 152061, 152062, 152063, 152064, 152065, 152066, 
+    152067, 152068, 152069, 152070, 152071, 152072, 152073, 152074, 152075, 
+    152076, 152077, 152078, 152079, 152080, 152081, 152082, 152083, 152084, 
+    152085, 152086, 152087, 152088, 152089, 152090, 152091, 152092, 152093, 
+    152094, 152095, 152096, 152097, 152098, 152099, 152100, 152101, 152102, 
+    152103, 152104, 152105, 152106, 152107, 152108, 152109, 152110, 152111, 
+    152112, 152113, 152114, 152115, 152116, 152117, 152118, 152119, 152120, 
+    152121, 152122, 152123, 152124, 152125, 152126, 152127, 152128, 152129, 
+    152130, 152131, 152132, 152133, 152134, 152135, 152136, 152137, 152138, 
+    152139, 152140, 152141, 152142, 152143, 152144, 152145, 152146, 152147, 
+    152148, 152149, 152150, 152151, 152152, 152153, 152154, 152155, 152156, 
+    152157, 152158, 152159, 152160, 152161, 152162, 152163, 152164, 152165, 
+    152166, 152167, 152168, 152169, 152170, 152171, 152172, 152173, 152174, 
+    152175, 152176, 152177, 152178, 152179, 152180, 152181, 152182, 152183, 
+    152184, 152185, 152186, 152187, 152188, 152189, 152190, 152191, 152192, 
+    152193, 152194, 152195, 152196, 152197, 152198, 152199, 152200, 152201, 
+    152202, 152203, 152204, 152205, 152206, 152207, 152208, 152209, 152210, 
+    152211, 152212, 152213, 152214, 152215, 152216, 152217, 152218, 152219, 
+    152220, 152221, 152222, 152223, 152224, 152225, 152226, 152227, 152228, 
+    152229, 152230, 152231, 152232, 152233, 152234, 152235, 152236, 152237, 
+    152238, 152239, 152240, 152241, 152242, 152243, 152244, 152245, 152246, 
+    152247, 152248, 152249, 152250, 152251, 152252, 152253, 152254, 152255, 
+    152256, 152257, 152258, 152259, 152260, 152261, 152262, 152263, 152264, 
+    152265, 152266, 152267, 152268, 152269, 152270, 152271, 152272, 152273, 
+    152274, 152275, 152276, 152277, 152278, 152279, 152280, 152281, 152282, 
+    152283, 152284, 152285, 152286, 152287, 152288, 152289, 152290, 152291, 
+    152292, 152293, 152294, 152295, 152296, 152297, 152298, 152299, 152300, 
+    152301, 152302, 152303, 152304, 152305, 152306, 152307, 152308, 152309, 
+    152310, 152311, 152312, 152313, 152314, 152315, 152316, 152317, 152318, 
+    152319, 152320, 152321, 152322, 152323, 152324, 152325, 152326, 152327, 
+    152328, 152329, 152330, 152331, 152332, 152333, 152334, 152335, 152336, 
+    152337, 152338, 152339, 152340, 152341, 152342, 152343, 152344, 152345, 
+    152346, 152347, 152348, 152349, 152350, 152351, 152352, 152353, 152354, 
+    152355, 152356, 152357, 152358, 152359, 152360, 152361, 152362, 152363, 
+    152364, 152365, 152366, 152367, 152368, 152369, 152370, 152371, 152372, 
+    152373, 152374, 152375, 152376, 152377, 152378, 152379, 152380, 152381, 
+    152382, 152383, 152384, 152385, 152386, 152387, 152388, 152389, 152390, 
+    152391, 152392, 152393, 152394, 152395, 152396, 152397, 152398, 152399, 
+    152400, 152401, 152402, 152403, 152404, 152405, 152406, 152407, 152408, 
+    152409, 152410, 152411, 152412, 152413, 152414, 152415, 152416, 152417, 
+    152418, 152419, 152420, 152421, 152422, 152423, 152424, 152425, 152426, 
+    152427, 152428, 152429, 152430, 152431, 152432, 152433, 152434, 152435, 
+    152436, 152437, 152438, 152439, 152440, 152441, 152442, 152443, 152444, 
+    152445, 152446, 152447, 152448, 152449, 152450, 152451, 152452, 152453, 
+    152454, 152455, 152456, 152457, 152458, 152459, 152460, 152461, 152462, 
+    152463, 152464, 152465, 152466, 152467, 152468, 152469, 152470, 152471, 
+    152472, 152473, 152474, 152475, 152476, 152477, 152478, 152479, 152480, 
+    152481, 152482, 152483, 152484, 152485, 152486, 152487, 152488, 152489, 
+    152490, 152491, 152492, 152493, 152494, 152495, 152496, 152497, 152498, 
+    152499, 152500, 152501, 152502, 152503, 152504, 152505, 152506, 152507, 
+    152508, 152509, 152510, 152511, 152512, 152513, 152514, 152515, 152516, 
+    152517, 152518, 152519, 152520, 152521, 152522, 152523, 152524, 152525, 
+    152526, 152527, 152528, 152529, 152530, 152531, 152532, 152533, 152534, 
+    152535, 152536, 152537, 152538, 152539, 152540, 152541, 152542, 152543, 
+    152544, 152545, 152546, 152547, 152548, 152549, 152550, 152551, 152552, 
+    152553, 152554, 152555, 152556, 152557, 152558, 152559, 152560, 152561, 
+    152562, 152563, 152564, 152565, 152566, 152567, 152568, 152569, 152570, 
+    152571, 152572, 152573, 152574, 152575, 152576, 152577, 152578, 152579, 
+    152580, 152581, 152582, 152583, 152584, 152585, 152586, 152587, 152588, 
+    152589, 152590, 152591, 152592, 152593, 152594, 152595, 152596, 152597, 
+    152598, 152599, 152600, 152601, 152602, 152603, 152604, 152605, 152606, 
+    152607, 152608, 152609, 152610, 152611, 152612, 152613, 152614, 152615, 
+    152616, 152617, 152618, 152619, 152620, 152621, 152622, 152623, 152624, 
+    152625, 152626, 152627, 152628, 152629, 152630, 152631, 152632, 152633, 
+    152634, 152635, 152636, 152637, 152638, 152639, 152640, 152641, 152642, 
+    152643, 152644, 152645, 152646, 152647, 152648, 152649, 152650, 152651, 
+    152652, 152653, 152654, 152655, 152656, 152657, 152658, 152659, 152660, 
+    152661, 152662, 152663, 152664, 152665, 152666, 152667, 152668, 152669, 
+    152670, 152671, 152672, 152673, 152674, 152675, 152676, 152677, 152678, 
+    152679, 152680, 152681, 152682, 152683, 152684, 152685, 152686, 152687, 
+    152688, 152689, 152690, 152691, 152692, 152693, 152694, 152695, 152696, 
+    152697, 152698, 152699, 152700, 152701, 152702, 152703, 152704, 152705, 
+    152706, 152707, 152708, 152709, 152710, 152711, 152712, 152713, 152714, 
+    152715, 152716, 152717, 152718, 152719, 152720, 152721, 152722, 152723, 
+    152724, 152725, 152726, 152727, 152728, 152729, 152730, 152731, 152732, 
+    152733, 152734, 152735, 152736, 152737, 152738, 152739, 152740, 152741, 
+    152742, 152743, 152744, 152745, 152746, 152747, 152748, 152749, 152750, 
+    152751, 152752, 152753, 152754, 152755, 152756, 152757, 152758, 152759, 
+    152760, 152761, 152762, 152763, 152764, 152765, 152766, 152767, 152768, 
+    152769, 152770, 152771, 152772, 152773, 152774, 152775, 152776, 152777, 
+    152778, 152779, 152780, 152781, 152782, 152783, 152784, 152785, 152786, 
+    152787, 152788, 152789, 152790, 152791, 152792, 152793, 152794, 152795, 
+    152796, 152797, 152798, 152799, 152800, 152801, 152802, 152803, 152804, 
+    152805, 152806, 152807, 152808, 152809, 152810, 152811, 152812, 152813, 
+    152814, 152815, 152816, 152817, 152818, 152819, 152820, 152821, 152822, 
+    152823, 152824, 152825, 152826, 152827, 152828, 152829, 152830, 152831, 
+    152832, 152833, 152834, 152835, 152836, 152837, 152838, 152839, 152840, 
+    152841, 152842, 152843, 152844, 152845, 152846, 152847, 152848, 152849, 
+    152850, 152851, 152852, 152853, 152854, 152855, 152856, 152857, 152858, 
+    152859, 152860, 152861, 152862, 152863, 152864, 152865, 152866, 152867, 
+    152868, 152869, 152870, 152871, 152872, 152873, 152874, 152875, 152876, 
+    152877, 152878, 152879, 152880, 152881, 152882, 152883, 152884, 152885, 
+    152886, 152887, 152888, 152889, 152890, 152891, 152892, 152893, 152894, 
+    152895, 152896, 152897, 152898, 152899, 152900, 152901, 152902, 152903, 
+    152904, 152905, 152906, 152907, 152908, 152909, 152910, 152911, 152912, 
+    152913, 152914, 152915, 152916, 152917, 152918, 152919, 152920, 152921, 
+    152922, 152923, 152924, 152925, 152926, 152927, 152928, 152929, 152930, 
+    152931, 152932, 152933, 152934, 152935, 152936, 152937, 152938, 152939, 
+    152940, 152941, 152942, 152943, 152944, 152945, 152946, 152947, 152948, 
+    152949, 152950, 152951, 152952, 152953, 152954, 152955, 152956, 152957, 
+    152958, 152959, 152960, 152961, 152962, 152963, 152964, 152965, 152966, 
+    152967, 152968, 152969, 152970, 152971, 152972, 152973, 152974, 152975, 
+    152976, 152977, 152978, 152979, 152980, 152981, 152982, 152983, 152984, 
+    152985, 152986, 152987, 152988, 152989, 152990, 152991, 152992, 152993, 
+    152994, 152995, 152996, 152997, 152998, 152999, 153000, 153001, 153002, 
+    153003, 153004, 153005, 153006, 153007, 153008, 153009, 153010, 153011, 
+    153012, 153013, 153014, 153015, 153016, 153017, 153018, 153019, 153020, 
+    153021, 153022, 153023, 153024, 153025, 153026, 153027, 153028, 153029, 
+    153030, 153031, 153032, 153033, 153034, 153035, 153036, 153037, 153038, 
+    153039, 153040, 153041, 153042, 153043, 153044, 153045, 153046, 153047, 
+    153048, 153049, 153050, 153051, 153052, 153053, 153054, 153055, 153056, 
+    153057, 153058, 153059, 153060, 153061, 153062, 153063, 153064, 153065, 
+    153066, 153067, 153068, 153069, 153070, 153071, 153072, 153073, 153074, 
+    153075, 153076, 153077, 153078, 153079, 153080, 153081, 153082, 153083, 
+    153084, 153085, 153086, 153087, 153088, 153089, 153090, 153091, 153092, 
+    153093, 153094, 153095, 153096, 153097, 153098, 153099, 153100, 153101, 
+    153102, 153103, 153104, 153105, 153106, 153107, 153108, 153109, 153110, 
+    153111, 153112, 153113, 153114, 153115, 153116, 153117, 153118, 153119, 
+    153120, 153121, 153122, 153123, 153124, 153125, 153126, 153127, 153128, 
+    153129, 153130, 153131, 153132, 153133, 153134, 153135, 153136, 153137, 
+    153138, 153139, 153140, 153141, 153142, 153143, 153144, 153145, 153146, 
+    153147, 153148, 153149, 153150, 153151, 153152, 153153, 153154, 153155, 
+    153156, 153157, 153158, 153159, 153160, 153161, 153162, 153163, 153164, 
+    153165, 153166, 153167, 153168, 153169, 153170, 153171, 153172, 153173, 
+    153174, 153175, 153176, 153177, 153178, 153179, 153180, 153181, 153182, 
+    153183, 153184, 153185, 153186, 153187, 153188, 153189, 153190, 153191, 
+    153192, 153193, 153194, 153195, 153196, 153197, 153198, 153199, 153200, 
+    153201, 153202, 153203, 153204, 153205, 153206, 153207, 153208, 153209, 
+    153210, 153211, 153212, 153213, 153214, 153215, 153216, 153217, 153218, 
+    153219, 153220, 153221, 153222, 153223, 153224, 153225, 153226, 153227, 
+    153228, 153229, 153230, 153231, 153232, 153233, 153234, 153235, 153236, 
+    153237, 153238, 153239, 153240, 153241, 153242, 153243, 153244, 153245, 
+    153246, 153247, 153248, 153249, 153250, 153251, 153252, 153253, 153254, 
+    153255, 153256, 153257, 153258, 153259, 153260, 153261, 153262, 153263, 
+    153264, 153265, 153266, 153267, 153268, 153269, 153270, 153271, 153272, 
+    153273, 153274, 153275, 153276, 153277, 153278, 153279, 153280, 153281, 
+    153282, 153283, 153284, 153285, 153286, 153287, 153288, 153289, 153290, 
+    153291, 153292, 153293, 153294, 153295, 153296, 153297, 153298, 153299, 
+    153300, 153301, 153302, 153303, 153304, 153305, 153306, 153307, 153308, 
+    153309, 153310, 153311, 153312, 153313, 153314, 153315, 153316, 153317, 
+    153318, 153319, 153320, 153321, 153322, 153323, 153324, 153325, 153326, 
+    153327, 153328, 153329, 153330, 153331, 153332, 153333, 153334, 153335, 
+    153336, 153337, 153338, 153339, 153340, 153341, 153342, 153343, 153344, 
+    153345, 153346, 153347, 153348, 153349, 153350, 153351, 153352, 153353, 
+    153354, 153355, 153356, 153357, 153358, 153359, 153360, 153361, 153362, 
+    153363, 153364, 153365, 153366, 153367, 153368, 153369, 153370, 153371, 
+    153372, 153373, 153374, 153375, 153376, 153377, 153378, 153379, 153380, 
+    153381, 153382, 153383, 153384, 153385, 153386, 153387, 153388, 153389, 
+    153390, 153391, 153392, 153393, 153394, 153395, 153396, 153397, 153398, 
+    153399, 153400, 153401, 153402, 153403, 153404, 153405, 153406, 153407, 
+    153408, 153409, 153410, 153411, 153412, 153413, 153414, 153415, 153416, 
+    153417, 153418, 153419, 153420, 153421, 153422, 153423, 153424, 153425, 
+    153426, 153427, 153428, 153429, 153430, 153431, 153432, 153433, 153434, 
+    153435, 153436, 153437, 153438, 153439, 153440, 153441, 153442, 153443, 
+    153444, 153445, 153446, 153447, 153448, 153449, 153450, 153451, 153452, 
+    153453, 153454, 153455, 153456, 153457, 153458, 153459, 153460, 153461, 
+    153462, 153463, 153464, 153465, 153466, 153467, 153468, 153469, 153470, 
+    153471, 153472, 153473, 153474, 153475, 153476, 153477, 153478, 153479, 
+    153480, 153481, 153482, 153483, 153484, 153485, 153486, 153487, 153488, 
+    153489, 153490, 153491, 153492, 153493, 153494, 153495, 153496, 153497, 
+    153498, 153499, 153500, 153501, 153502, 153503, 153504, 153505, 153506, 
+    153507, 153508, 153509, 153510, 153511, 153512, 153513, 153514, 153515, 
+    153516, 153517, 153518, 153519, 153520, 153521, 153522, 153523, 153524, 
+    153525, 153526, 153527, 153528, 153529, 153530, 153531, 153532, 153533, 
+    153534, 153535, 153536, 153537, 153538, 153539, 153540, 153541, 153542, 
+    153543, 153544, 153545, 153546, 153547, 153548, 153549, 153550, 153551, 
+    153552, 153553, 153554, 153555, 153556, 153557, 153558, 153559, 153560, 
+    153561, 153562, 153563, 153564, 153565, 153566, 153567, 153568, 153569, 
+    153570, 153571, 153572, 153573, 153574, 153575, 153576, 153577, 153578, 
+    153579, 153580, 153581, 153582, 153583, 153584, 153585, 153586, 153587, 
+    153588, 153589, 153590, 153591, 153592, 153593, 153594, 153595, 153596, 
+    153597, 153598, 153599, 153600, 153601, 153602, 153603, 153604, 153605, 
+    153606, 153607, 153608, 153609, 153610, 153611, 153612, 153613, 153614, 
+    153615, 153616, 153617, 153618, 153619, 153620, 153621, 153622, 153623, 
+    153624, 153625, 153626, 153627, 153628, 153629, 153630, 153631, 153632, 
+    153633, 153634, 153635, 153636, 153637, 153638, 153639, 153640, 153641, 
+    153642, 153643, 153644, 153645, 153646, 153647, 153648, 153649, 153650, 
+    153651, 153652, 153653, 153654, 153655, 153656, 153657, 153658, 153659, 
+    153660, 153661, 153662, 153663, 153664, 153665, 153666, 153667, 153668, 
+    153669, 153670, 153671, 153672, 153673, 153674, 153675, 153676, 153677, 
+    153678, 153679, 153680, 153681, 153682, 153683, 153684, 153685, 153686, 
+    153687, 153688, 153689, 153690, 153691, 153692, 153693, 153694, 153695, 
+    153696, 153697, 153698, 153699, 153700, 153701, 153702, 153703, 153704, 
+    153705, 153706, 153707, 153708, 153709, 153710, 153711, 153712, 153713, 
+    153714, 153715, 153716, 153717, 153718, 153719, 153720, 153721, 153722, 
+    153723, 153724, 153725, 153726, 153727, 153728, 153729, 153730, 153731, 
+    153732, 153733, 153734, 153735, 153736, 153737, 153738, 153739, 153740, 
+    153741, 153742, 153743, 153744, 153745, 153746, 153747, 153748, 153749, 
+    153750, 153751, 153752, 153753, 153754, 153755, 153756, 153757, 153758, 
+    153759, 153760, 153761, 153762, 153763, 153764, 153765, 153766, 153767, 
+    153768, 153769, 153770, 153771, 153772, 153773, 153774, 153775, 153776, 
+    153777, 153778, 153779, 153780, 153781, 153782, 153783, 153784, 153785, 
+    153786, 153787, 153788, 153789, 153790, 153791, 153792, 153793, 153794, 
+    153795, 153796, 153797, 153798, 153799, 153800, 153801, 153802, 153803, 
+    153804, 153805, 153806, 153807, 153808, 153809, 153810, 153811, 153812, 
+    153813, 153814, 153815, 153816, 153817, 153818, 153819, 153820, 153821, 
+    153822, 153823, 153824, 153825, 153826, 153827, 153828, 153829, 153830, 
+    153831, 153832, 153833, 153834, 153835, 153836, 153837, 153838, 153839, 
+    153840, 153841, 153842, 153843, 153844, 153845, 153846, 153847, 153848, 
+    153849, 153850, 153851, 153852, 153853, 153854, 153855, 153856, 153857, 
+    153858, 153859, 153860, 153861, 153862, 153863, 153864, 153865, 153866, 
+    153867, 153868, 153869, 153870, 153871, 153872, 153873, 153874, 153875, 
+    153876, 153877, 153878, 153879, 153880, 153881, 153882, 153883, 153884, 
+    153885, 153886, 153887, 153888, 153889, 153890, 153891, 153892, 153893, 
+    153894, 153895, 153896, 153897, 153898, 153899, 153900, 153901, 153902, 
+    153903, 153904, 153905, 153906, 153907, 153908, 153909, 153910, 153911, 
+    153912, 153913, 153914, 153915, 153916, 153917, 153918, 153919, 153920, 
+    153921, 153922, 153923, 153924, 153925, 153926, 153927, 153928, 153929, 
+    153930, 153931, 153932, 153933, 153934, 153935, 153936, 153937, 153938, 
+    153939, 153940, 153941, 153942, 153943, 153944, 153945, 153946, 153947, 
+    153948, 153949, 153950, 153951, 153952, 153953, 153954, 153955, 153956, 
+    153957, 153958, 153959, 153960, 153961, 153962, 153963, 153964, 153965, 
+    153966, 153967, 153968, 153969, 153970, 153971, 153972, 153973, 153974, 
+    153975, 153976, 153977, 153978, 153979, 153980, 153981, 153982, 153983, 
+    153984, 153985, 153986, 153987, 153988, 153989, 153990, 153991, 153992, 
+    153993, 153994, 153995, 153996, 153997, 153998, 153999, 154000, 154001, 
+    154002, 154003, 154004, 154005, 154006, 154007, 154008, 154009, 154010, 
+    154011, 154012, 154013, 154014, 154015, 154016, 154017, 154018, 154019, 
+    154020, 154021, 154022, 154023, 154024, 154025, 154026, 154027, 154028, 
+    154029, 154030, 154031, 154032, 154033, 154034, 154035, 154036, 154037, 
+    154038, 154039, 154040, 154041, 154042, 154043, 154044, 154045, 154046, 
+    154047, 154048, 154049, 154050, 154051, 154052, 154053, 154054, 154055, 
+    154056, 154057, 154058, 154059, 154060, 154061, 154062, 154063, 154064, 
+    154065, 154066, 154067, 154068, 154069, 154070, 154071, 154072, 154073, 
+    154074, 154075, 154076, 154077, 154078, 154079, 154080, 154081, 154082, 
+    154083, 154084, 154085, 154086, 154087, 154088, 154089, 154090, 154091, 
+    154092, 154093, 154094, 154095, 154096, 154097, 154098, 154099, 154100, 
+    154101, 154102, 154103, 154104, 154105, 154106, 154107, 154108, 154109, 
+    154110, 154111, 154112, 154113, 154114, 154115, 154116, 154117, 154118, 
+    154119, 154120, 154121, 154122, 154123, 154124, 154125, 154126, 154127, 
+    154128, 154129, 154130, 154131, 154132, 154133, 154134, 154135, 154136, 
+    154137, 154138, 154139, 154140, 154141, 154142, 154143, 154144, 154145, 
+    154146, 154147, 154148, 154149, 154150, 154151, 154152, 154153, 154154, 
+    154155, 154156, 154157, 154158, 154159, 154160, 154161, 154162, 154163, 
+    154164, 154165, 154166, 154167, 154168, 154169, 154170, 154171, 154172, 
+    154173, 154174, 154175, 154176, 154177, 154178, 154179, 154180, 154181, 
+    154182, 154183, 154184, 154185, 154186, 154187, 154188, 154189, 154190, 
+    154191, 154192, 154193, 154194, 154195, 154196, 154197, 154198, 154199, 
+    154200, 154201, 154202, 154203, 154204, 154205, 154206, 154207, 154208, 
+    154209, 154210, 154211, 154212, 154213, 154214, 154215, 154216, 154217, 
+    154218, 154219, 154220, 154221, 154222, 154223, 154224, 154225, 154226, 
+    154227, 154228, 154229, 154230, 154231, 154232, 154233, 154234, 154235, 
+    154236, 154237, 154238, 154239, 154240, 154241, 154242, 154243, 154244, 
+    154245, 154246, 154247, 154248, 154249, 154250, 154251, 154252, 154253, 
+    154254, 154255, 154256, 154257, 154258, 154259, 154260, 154261, 154262, 
+    154263, 154264, 154265, 154266, 154267, 154268, 154269, 154270, 154271, 
+    154272, 154273, 154274, 154275, 154276, 154277, 154278, 154279, 154280, 
+    154281, 154282, 154283, 154284, 154285, 154286, 154287, 154288, 154289, 
+    154290, 154291, 154292, 154293, 154294, 154295, 154296, 154297, 154298, 
+    154299, 154300, 154301, 154302, 154303, 154304, 154305, 154306, 154307, 
+    154308, 154309, 154310, 154311, 154312, 154313, 154314, 154315, 154316, 
+    154317, 154318, 154319, 154320, 154321, 154322, 154323, 154324, 154325, 
+    154326, 154327, 154328, 154329, 154330, 154331, 154332, 154333, 154334, 
+    154335, 154336, 154337, 154338, 154339, 154340, 154341, 154342, 154343, 
+    154344, 154345, 154346, 154347, 154348, 154349, 154350, 154351, 154352, 
+    154353, 154354, 154355, 154356, 154357, 154358, 154359, 154360, 154361, 
+    154362, 154363, 154364, 154365, 154366, 154367, 154368, 154369, 154370, 
+    154371, 154372, 154373, 154374, 154375, 154376, 154377, 154378, 154379, 
+    154380, 154381, 154382, 154383, 154384, 154385, 154386, 154387, 154388, 
+    154389, 154390, 154391, 154392, 154393, 154394, 154395, 154396, 154397, 
+    154398, 154399, 154400, 154401, 154402, 154403, 154404, 154405, 154406, 
+    154407, 154408, 154409, 154410, 154411, 154412, 154413, 154414, 154415, 
+    154416, 154417, 154418, 154419, 154420, 154421, 154422, 154423, 154424, 
+    154425, 154426, 154427, 154428, 154429, 154430, 154431, 154432, 154433, 
+    154434, 154435, 154436, 154437, 154438, 154439, 154440, 154441, 154442, 
+    154443, 154444, 154445, 154446, 154447, 154448, 154449, 154450, 154451, 
+    154452, 154453, 154454, 154455, 154456, 154457, 154458, 154459, 154460, 
+    154461, 154462, 154463, 154464, 154465, 154466, 154467, 154468, 154469, 
+    154470, 154471, 154472, 154473, 154474, 154475, 154476, 154477, 154478, 
+    154479, 154480, 154481, 154482, 154483, 154484, 154485, 154486, 154487, 
+    154488, 154489, 154490, 154491, 154492, 154493, 154494, 154495, 154496, 
+    154497, 154498, 154499, 154500, 154501, 154502, 154503, 154504, 154505, 
+    154506, 154507, 154508, 154509, 154510, 154511, 154512, 154513, 154514, 
+    154515, 154516, 154517, 154518, 154519, 154520, 154521, 154522, 154523, 
+    154524, 154525, 154526, 154527, 154528, 154529, 154530, 154531, 154532, 
+    154533, 154534, 154535, 154536, 154537, 154538, 154539, 154540, 154541, 
+    154542, 154543, 154544, 154545, 154546, 154547, 154548, 154549, 154550, 
+    154551, 154552, 154553, 154554, 154555, 154556, 154557, 154558, 154559, 
+    154560, 154561, 154562, 154563, 154564, 154565, 154566, 154567, 154568, 
+    154569, 154570, 154571, 154572, 154573, 154574, 154575, 154576, 154577, 
+    154578, 154579, 154580, 154581, 154582, 154583, 154584, 154585, 154586, 
+    154587, 154588, 154589, 154590, 154591, 154592, 154593, 154594, 154595, 
+    154596, 154597, 154598, 154599, 154600, 154601, 154602, 154603, 154604, 
+    154605, 154606, 154607, 154608, 154609, 154610, 154611, 154612, 154613, 
+    154614, 154615, 154616, 154617, 154618, 154619, 154620, 154621, 154622, 
+    154623, 154624, 154625, 154626, 154627, 154628, 154629, 154630, 154631, 
+    154632, 154633, 154634, 154635, 154636, 154637, 154638, 154639, 154640, 
+    154641, 154642, 154643, 154644, 154645, 154646, 154647, 154648, 154649, 
+    154650, 154651, 154652, 154653, 154654, 154655, 154656, 154657, 154658, 
+    154659, 154660, 154661, 154662, 154663, 154664, 154665, 154666, 154667, 
+    154668, 154669, 154670, 154671, 154672, 154673, 154674, 154675, 154676, 
+    154677, 154678, 154679, 154680, 154681, 154682, 154683, 154684, 154685, 
+    154686, 154687, 154688, 154689, 154690, 154691, 154692, 154693, 154694, 
+    154695, 154696, 154697, 154698, 154699, 154700, 154701, 154702, 154703, 
+    154704, 154705, 154706, 154707, 154708, 154709, 154710, 154711, 154712, 
+    154713, 154714, 154715, 154716, 154717, 154718, 154719, 154720, 154721, 
+    154722, 154723, 154724, 154725, 154726, 154727, 154728, 154729, 154730, 
+    154731, 154732, 154733, 154734, 154735, 154736, 154737, 154738, 154739, 
+    154740, 154741, 154742, 154743, 154744, 154745, 154746, 154747, 154748, 
+    154749, 154750, 154751, 154752, 154753, 154754, 154755, 154756, 154757, 
+    154758, 154759, 154760, 154761, 154762, 154763, 154764, 154765, 154766, 
+    154767, 154768, 154769, 154770, 154771, 154772, 154773, 154774, 154775, 
+    154776, 154777, 154778, 154779, 154780, 154781, 154782, 154783, 154784, 
+    154785, 154786, 154787, 154788, 154789, 154790, 154791, 154792, 154793, 
+    154794, 154795, 154796, 154797, 154798, 154799, 154800, 154801, 154802, 
+    154803, 154804, 154805, 154806, 154807, 154808, 154809, 154810, 154811, 
+    154812, 154813, 154814, 154815, 154816, 154817, 154818, 154819, 154820, 
+    154821, 154822, 154823, 154824, 154825, 154826, 154827, 154828, 154829, 
+    154830, 154831, 154832, 154833, 154834, 154835, 154836, 154837, 154838, 
+    154839, 154840, 154841, 154842, 154843, 154844, 154845, 154846, 154847, 
+    154848, 154849, 154850, 154851, 154852, 154853, 154854, 154855, 154856, 
+    154857, 154858, 154859, 154860, 154861, 154862, 154863, 154864, 154865, 
+    154866, 154867, 154868, 154869, 154870, 154871, 154872, 154873, 154874, 
+    154875, 154876, 154877, 154878, 154879, 154880, 154881, 154882, 154883, 
+    154884, 154885, 154886, 154887, 154888, 154889, 154890, 154891, 154892, 
+    154893, 154894, 154895, 154896, 154897, 154898, 154899, 154900, 154901, 
+    154902, 154903, 154904, 154905, 154906, 154907, 154908, 154909, 154910, 
+    154911, 154912, 154913, 154914, 154915, 154916, 154917, 154918, 154919, 
+    154920, 154921, 154922, 154923, 154924, 154925, 154926, 154927, 154928, 
+    154929, 154930, 154931, 154932, 154933, 154934, 154935, 154936, 154937, 
+    154938, 154939, 154940, 154941, 154942, 154943, 154944, 154945, 154946, 
+    154947, 154948, 154949, 154950, 154951, 154952, 154953, 154954, 154955, 
+    154956, 154957, 154958, 154959, 154960, 154961, 154962, 154963, 154964, 
+    154965, 154966, 154967, 154968, 154969, 154970, 154971, 154972, 154973, 
+    154974, 154975, 154976, 154977, 154978, 154979, 154980, 154981, 154982, 
+    154983, 154984, 154985, 154986, 154987, 154988, 154989, 154990, 154991, 
+    154992, 154993, 154994, 154995, 154996, 154997, 154998, 154999, 155000, 
+    155001, 155002, 155003, 155004, 155005, 155006, 155007, 155008, 155009, 
+    155010, 155011, 155012, 155013, 155014, 155015, 155016, 155017, 155018, 
+    155019, 155020, 155021, 155022, 155023, 155024, 155025, 155026, 155027, 
+    155028, 155029, 155030, 155031, 155032, 155033, 155034, 155035, 155036, 
+    155037, 155038, 155039, 155040, 155041, 155042, 155043, 155044, 155045, 
+    155046, 155047, 155048, 155049, 155050, 155051, 155052, 155053, 155054, 
+    155055, 155056, 155057, 155058, 155059, 155060, 155061, 155062, 155063, 
+    155064, 155065, 155066, 155067, 155068, 155069, 155070, 155071, 155072, 
+    155073, 155074, 155075, 155076, 155077, 155078, 155079, 155080, 155081, 
+    155082, 155083, 155084, 155085, 155086, 155087, 155088, 155089, 155090, 
+    155091, 155092, 155093, 155094, 155095, 155096, 155097, 155098, 155099, 
+    155100, 155101, 155102, 155103, 155104, 155105, 155106, 155107, 155108, 
+    155109, 155110, 155111, 155112, 155113, 155114, 155115, 155116, 155117, 
+    155118, 155119, 155120, 155121, 155122, 155123, 155124, 155125, 155126, 
+    155127, 155128, 155129, 155130, 155131, 155132, 155133, 155134, 155135, 
+    155136, 155137, 155138, 155139, 155140, 155141, 155142, 155143, 155144, 
+    155145, 155146, 155147, 155148, 155149, 155150, 155151, 155152, 155153, 
+    155154, 155155, 155156, 155157, 155158, 155159, 155160, 155161, 155162, 
+    155163, 155164, 155165, 155166, 155167, 155168, 155169, 155170, 155171, 
+    155172, 155173, 155174, 155175, 155176, 155177, 155178, 155179, 155180, 
+    155181, 155182, 155183, 155184, 155185, 155186, 155187, 155188, 155189, 
+    155190, 155191, 155192, 155193, 155194, 155195, 155196, 155197, 155198, 
+    155199, 155200, 155201, 155202, 155203, 155204, 155205, 155206, 155207, 
+    155208, 155209, 155210, 155211, 155212, 155213, 155214, 155215, 155216, 
+    155217, 155218, 155219, 155220, 155221, 155222, 155223, 155224, 155225, 
+    155226, 155227, 155228, 155229, 155230, 155231, 155232, 155233, 155234, 
+    155235, 155236, 155237, 155238, 155239, 155240, 155241, 155242, 155243, 
+    155244, 155245, 155246, 155247, 155248, 155249, 155250, 155251, 155252, 
+    155253, 155254, 155255, 155256, 155257, 155258, 155259, 155260, 155261, 
+    155262, 155263, 155264, 155265, 155266, 155267, 155268, 155269, 155270, 
+    155271, 155272, 155273, 155274, 155275, 155276, 155277, 155278, 155279, 
+    155280, 155281, 155282, 155283, 155284, 155285, 155286, 155287, 155288, 
+    155289, 155290, 155291, 155292, 155293, 155294, 155295, 155296, 155297, 
+    155298, 155299, 155300, 155301, 155302, 155303, 155304, 155305, 155306, 
+    155307, 155308, 155309, 155310, 155311, 155312, 155313, 155314, 155315, 
+    155316, 155317, 155318, 155319, 155320, 155321, 155322, 155323, 155324, 
+    155325, 155326, 155327, 155328, 155329, 155330, 155331, 155332, 155333, 
+    155334, 155335, 155336, 155337, 155338, 155339, 155340, 155341, 155342, 
+    155343, 155344, 155345, 155346, 155347, 155348, 155349, 155350, 155351, 
+    155352, 155353, 155354, 155355, 155356, 155357, 155358, 155359, 155360, 
+    155361, 155362, 155363, 155364, 155365, 155366, 155367, 155368, 155369, 
+    155370, 155371, 155372, 155373, 155374, 155375, 155376, 155377, 155378, 
+    155379, 155380, 155381, 155382, 155383, 155384, 155385, 155386, 155387, 
+    155388, 155389, 155390, 155391, 155392, 155393, 155394, 155395, 155396, 
+    155397, 155398, 155399, 155400, 155401, 155402, 155403, 155404, 155405, 
+    155406, 155407, 155408, 155409, 155410, 155411, 155412, 155413, 155414, 
+    155415, 155416, 155417, 155418, 155419, 155420, 155421, 155422, 155423, 
+    155424, 155425, 155426, 155427, 155428, 155429, 155430, 155431, 155432, 
+    155433, 155434, 155435, 155436, 155437, 155438, 155439, 155440, 155441, 
+    155442, 155443, 155444, 155445, 155446, 155447, 155448, 155449, 155450, 
+    155451, 155452, 155453, 155454, 155455, 155456, 155457, 155458, 155459, 
+    155460, 155461, 155462, 155463, 155464, 155465, 155466, 155467, 155468, 
+    155469, 155470, 155471, 155472, 155473, 155474, 155475, 155476, 155477, 
+    155478, 155479, 155480, 155481, 155482, 155483, 155484, 155485, 155486, 
+    155487, 155488, 155489, 155490, 155491, 155492, 155493, 155494, 155495, 
+    155496, 155497, 155498, 155499, 155500, 155501, 155502, 155503, 155504, 
+    155505, 155506, 155507, 155508, 155509, 155510, 155511, 155512, 155513, 
+    155514, 155515, 155516, 155517, 155518, 155519, 155520, 155521, 155522, 
+    155523, 155524, 155525, 155526, 155527, 155528, 155529, 155530, 155531, 
+    155532, 155533, 155534, 155535, 155536, 155537, 155538, 155539, 155540, 
+    155541, 155542, 155543, 155544, 155545, 155546, 155547, 155548, 155549, 
+    155550, 155551, 155552, 155553, 155554, 155555, 155556, 155557, 155558, 
+    155559, 155560, 155561, 155562, 155563, 155564, 155565, 155566, 155567, 
+    155568, 155569, 155570, 155571, 155572, 155573, 155574, 155575, 155576, 
+    155577, 155578, 155579, 155580, 155581, 155582, 155583, 155584, 155585, 
+    155586, 155587, 155588, 155589, 155590, 155591, 155592, 155593, 155594, 
+    155595, 155596, 155597, 155598, 155599, 155600, 155601, 155602, 155603, 
+    155604, 155605, 155606, 155607, 155608, 155609, 155610, 155611, 155612, 
+    155613, 155614, 155615, 155616, 155617, 155618, 155619, 155620, 155621, 
+    155622, 155623, 155624, 155625, 155626, 155627, 155628, 155629, 155630, 
+    155631, 155632, 155633, 155634, 155635, 155636, 155637, 155638, 155639, 
+    155640, 155641, 155642, 155643, 155644, 155645, 155646, 155647, 155648, 
+    155649, 155650, 155651, 155652, 155653, 155654, 155655, 155656, 155657, 
+    155658, 155659, 155660, 155661, 155662, 155663, 155664, 155665, 155666, 
+    155667, 155668, 155669, 155670, 155671, 155672, 155673, 155674, 155675, 
+    155676, 155677, 155678, 155679, 155680, 155681, 155682, 155683, 155684, 
+    155685, 155686, 155687, 155688, 155689, 155690, 155691, 155692, 155693, 
+    155694, 155695, 155696, 155697, 155698, 155699, 155700, 155701, 155702, 
+    155703, 155704, 155705, 155706, 155707, 155708, 155709, 155710, 155711, 
+    155712, 155713, 155714, 155715, 155716, 155717, 155718, 155719, 155720, 
+    155721, 155722, 155723, 155724, 155725, 155726, 155727, 155728, 155729, 
+    155730, 155731, 155732, 155733, 155734, 155735, 155736, 155737, 155738, 
+    155739, 155740, 155741, 155742, 155743, 155744, 155745, 155746, 155747, 
+    155748, 155749, 155750, 155751, 155752, 155753, 155754, 155755, 155756, 
+    155757, 155758, 155759, 155760, 155761, 155762, 155763, 155764, 155765, 
+    155766, 155767, 155768, 155769, 155770, 155771, 155772, 155773, 155774, 
+    155775, 155776, 155777, 155778, 155779, 155780, 155781, 155782, 155783, 
+    155784, 155785, 155786, 155787, 155788, 155789, 155790, 155791, 155792, 
+    155793, 155794, 155795, 155796, 155797, 155798, 155799, 155800, 155801, 
+    155802, 155803, 155804, 155805, 155806, 155807, 155808, 155809, 155810, 
+    155811, 155812, 155813, 155814, 155815, 155816, 155817, 155818, 155819, 
+    155820, 155821, 155822, 155823, 155824, 155825, 155826, 155827, 155828, 
+    155829, 155830, 155831, 155832, 155833, 155834, 155835, 155836, 155837, 
+    155838, 155839, 155840, 155841, 155842, 155843, 155844, 155845, 155846, 
+    155847, 155848, 155849, 155850, 155851, 155852, 155853, 155854, 155855, 
+    155856, 155857, 155858, 155859, 155860, 155861, 155862, 155863, 155864, 
+    155865, 155866, 155867, 155868, 155869, 155870, 155871, 155872, 155873, 
+    155874, 155875, 155876, 155877, 155878, 155879, 155880, 155881, 155882, 
+    155883, 155884, 155885, 155886, 155887, 155888, 155889, 155890, 155891, 
+    155892, 155893, 155894, 155895, 155896, 155897, 155898, 155899, 155900, 
+    155901, 155902, 155903, 155904, 155905, 155906, 155907, 155908, 155909, 
+    155910, 155911, 155912, 155913, 155914, 155915, 155916, 155917, 155918, 
+    155919, 155920, 155921, 155922, 155923, 155924, 155925, 155926, 155927, 
+    155928, 155929, 155930, 155931, 155932, 155933, 155934, 155935, 155936, 
+    155937, 155938, 155939, 155940, 155941, 155942, 155943, 155944, 155945, 
+    155946, 155947, 155948, 155949, 155950, 155951, 155952, 155953, 155954, 
+    155955, 155956, 155957, 155958, 155959, 155960, 155961, 155962, 155963, 
+    155964, 155965, 155966, 155967, 155968, 155969, 155970, 155971, 155972, 
+    155973, 155974, 155975, 155976, 155977, 155978, 155979, 155980, 155981, 
+    155982, 155983, 155984, 155985, 155986, 155987, 155988, 155989, 155990, 
+    155991, 155992, 155993, 155994, 155995, 155996, 155997, 155998, 155999, 
+    156000, 156001, 156002, 156003, 156004, 156005, 156006, 156007, 156008, 
+    156009, 156010, 156011, 156012, 156013, 156014, 156015, 156016, 156017, 
+    156018, 156019, 156020, 156021, 156022, 156023, 156024, 156025, 156026, 
+    156027, 156028, 156029, 156030, 156031, 156032, 156033, 156034, 156035, 
+    156036, 156037, 156038, 156039, 156040, 156041, 156042, 156043, 156044, 
+    156045, 156046, 156047, 156048, 156049, 156050, 156051, 156052, 156053, 
+    156054, 156055, 156056, 156057, 156058, 156059, 156060, 156061, 156062, 
+    156063, 156064, 156065, 156066, 156067, 156068, 156069, 156070, 156071, 
+    156072, 156073, 156074, 156075, 156076, 156077, 156078, 156079, 156080, 
+    156081, 156082, 156083, 156084, 156085, 156086, 156087, 156088, 156089, 
+    156090, 156091, 156092, 156093, 156094, 156095, 156096, 156097, 156098, 
+    156099, 156100, 156101, 156102, 156103, 156104, 156105, 156106, 156107, 
+    156108, 156109, 156110, 156111, 156112, 156113, 156114, 156115, 156116, 
+    156117, 156118, 156119, 156120, 156121, 156122, 156123, 156124, 156125, 
+    156126, 156127, 156128, 156129, 156130, 156131, 156132, 156133, 156134, 
+    156135, 156136, 156137, 156138, 156139, 156140, 156141, 156142, 156143, 
+    156144, 156145, 156146, 156147, 156148, 156149, 156150, 156151, 156152, 
+    156153, 156154, 156155, 156156, 156157, 156158, 156159, 156160, 156161, 
+    156162, 156163, 156164, 156165, 156166, 156167, 156168, 156169, 156170, 
+    156171, 156172, 156173, 156174, 156175, 156176, 156177, 156178, 156179, 
+    156180, 156181, 156182, 156183, 156184, 156185, 156186, 156187, 156188, 
+    156189, 156190, 156191, 156192, 156193, 156194, 156195, 156196, 156197, 
+    156198, 156199, 156200, 156201, 156202, 156203, 156204, 156205, 156206, 
+    156207, 156208, 156209, 156210, 156211, 156212, 156213, 156214, 156215, 
+    156216, 156217, 156218, 156219, 156220, 156221, 156222, 156223, 156224, 
+    156225, 156226, 156227, 156228, 156229, 156230, 156231, 156232, 156233, 
+    156234, 156235, 156236, 156237, 156238, 156239, 156240, 156241, 156242, 
+    156243, 156244, 156245, 156246, 156247, 156248, 156249, 156250, 156251, 
+    156252, 156253, 156254, 156255, 156256, 156257, 156258, 156259, 156260, 
+    156261, 156262, 156263, 156264, 156265, 156266, 156267, 156268, 156269, 
+    156270, 156271, 156272, 156273, 156274, 156275, 156276, 156277, 156278, 
+    156279, 156280, 156281, 156282, 156283, 156284, 156285, 156286, 156287, 
+    156288, 156289, 156290, 156291, 156292, 156293, 156294, 156295, 156296, 
+    156297, 156298, 156299, 156300, 156301, 156302, 156303, 156304, 156305, 
+    156306, 156307, 156308, 156309, 156310, 156311, 156312, 156313, 156314, 
+    156315, 156316, 156317, 156318, 156319, 156320, 156321, 156322, 156323, 
+    156324, 156325, 156326, 156327, 156328, 156329, 156330, 156331, 156332, 
+    156333, 156334, 156335, 156336, 156337, 156338, 156339, 156340, 156341, 
+    156342, 156343, 156344, 156345, 156346, 156347, 156348, 156349, 156350, 
+    156351, 156352, 156353, 156354, 156355, 156356, 156357, 156358, 156359, 
+    156360, 156361, 156362, 156363, 156364, 156365, 156366, 156367, 156368, 
+    156369, 156370, 156371, 156372, 156373, 156374, 156375, 156376, 156377, 
+    156378, 156379, 156380, 156381, 156382, 156383, 156384, 156385, 156386, 
+    156387, 156388, 156389, 156390, 156391, 156392, 156393, 156394, 156395, 
+    156396, 156397, 156398, 156399, 156400, 156401, 156402, 156403, 156404, 
+    156405, 156406, 156407, 156408, 156409, 156410, 156411, 156412, 156413, 
+    156414, 156415, 156416, 156417, 156418, 156419, 156420, 156421, 156422, 
+    156423, 156424, 156425, 156426, 156427, 156428, 156429, 156430, 156431, 
+    156432, 156433, 156434, 156435, 156436, 156437, 156438, 156439, 156440, 
+    156441, 156442, 156443, 156444, 156445, 156446, 156447, 156448, 156449, 
+    156450, 156451, 156452, 156453, 156454, 156455, 156456, 156457, 156458, 
+    156459, 156460, 156461, 156462, 156463, 156464, 156465, 156466, 156467, 
+    156468, 156469, 156470, 156471, 156472, 156473, 156474, 156475, 156476, 
+    156477, 156478, 156479, 156480, 156481, 156482, 156483, 156484, 156485, 
+    156486, 156487, 156488, 156489, 156490, 156491, 156492, 156493, 156494, 
+    156495, 156496, 156497, 156498, 156499, 156500, 156501, 156502, 156503, 
+    156504, 156505, 156506, 156507, 156508, 156509, 156510, 156511, 156512, 
+    156513, 156514, 156515, 156516, 156517, 156518, 156519, 156520, 156521, 
+    156522, 156523, 156524, 156525, 156526, 156527, 156528, 156529, 156530, 
+    156531, 156532, 156533, 156534, 156535, 156536, 156537, 156538, 156539, 
+    156540, 156541, 156542, 156543, 156544, 156545, 156546, 156547, 156548, 
+    156549, 156550, 156551, 156552, 156553, 156554, 156555, 156556, 156557, 
+    156558, 156559, 156560, 156561, 156562, 156563, 156564, 156565, 156566, 
+    156567, 156568, 156569, 156570, 156571, 156572, 156573, 156574, 156575, 
+    156576, 156577, 156578, 156579, 156580, 156581, 156582, 156583, 156584, 
+    156585, 156586, 156587, 156588, 156589, 156590, 156591, 156592, 156593, 
+    156594, 156595, 156596, 156597, 156598, 156599, 156600, 156601, 156602, 
+    156603, 156604, 156605, 156606, 156607, 156608, 156609, 156610, 156611, 
+    156612, 156613, 156614, 156615, 156616, 156617, 156618, 156619, 156620, 
+    156621, 156622, 156623, 156624, 156625, 156626, 156627, 156628, 156629, 
+    156630, 156631, 156632, 156633, 156634, 156635, 156636, 156637, 156638, 
+    156639, 156640, 156641, 156642, 156643, 156644, 156645, 156646, 156647, 
+    156648, 156649, 156650, 156651, 156652, 156653, 156654, 156655, 156656, 
+    156657, 156658, 156659, 156660, 156661, 156662, 156663, 156664, 156665, 
+    156666, 156667, 156668, 156669, 156670, 156671, 156672, 156673, 156674, 
+    156675, 156676, 156677, 156678, 156679, 156680, 156681, 156682, 156683, 
+    156684, 156685, 156686, 156687, 156688, 156689, 156690, 156691, 156692, 
+    156693, 156694, 156695, 156696, 156697, 156698, 156699, 156700, 156701, 
+    156702, 156703, 156704, 156705, 156706, 156707, 156708, 156709, 156710, 
+    156711, 156712, 156713, 156714, 156715, 156716, 156717, 156718, 156719, 
+    156720, 156721, 156722, 156723, 156724, 156725, 156726, 156727, 156728, 
+    156729, 156730, 156731, 156732, 156733, 156734, 156735, 156736, 156737, 
+    156738, 156739, 156740, 156741, 156742, 156743, 156744, 156745, 156746, 
+    156747, 156748, 156749, 156750, 156751, 156752, 156753, 156754, 156755, 
+    156756, 156757, 156758, 156759, 156760, 156761, 156762, 156763, 156764, 
+    156765, 156766, 156767, 156768, 156769, 156770, 156771, 156772, 156773, 
+    156774, 156775, 156776, 156777, 156778, 156779, 156780, 156781, 156782, 
+    156783, 156784, 156785, 156786, 156787, 156788, 156789, 156790, 156791, 
+    156792, 156793, 156794, 156795, 156796, 156797, 156798, 156799, 156800, 
+    156801, 156802, 156803, 156804, 156805, 156806, 156807, 156808, 156809, 
+    156810, 156811, 156812, 156813, 156814, 156815, 156816, 156817, 156818, 
+    156819, 156820, 156821, 156822, 156823, 156824, 156825, 156826, 156827, 
+    156828, 156829, 156830, 156831, 156832, 156833, 156834, 156835, 156836, 
+    156837, 156838, 156839, 156840, 156841, 156842, 156843, 156844, 156845, 
+    156846, 156847, 156848, 156849, 156850, 156851, 156852, 156853, 156854, 
+    156855, 156856, 156857, 156858, 156859, 156860, 156861, 156862, 156863, 
+    156864, 156865, 156866, 156867, 156868, 156869, 156870, 156871, 156872, 
+    156873, 156874, 156875, 156876, 156877, 156878, 156879, 156880, 156881, 
+    156882, 156883, 156884, 156885, 156886, 156887, 156888, 156889, 156890, 
+    156891, 156892, 156893, 156894, 156895, 156896, 156897, 156898, 156899, 
+    156900, 156901, 156902, 156903, 156904, 156905, 156906, 156907, 156908, 
+    156909, 156910, 156911, 156912, 156913, 156914, 156915, 156916, 156917, 
+    156918, 156919, 156920, 156921, 156922, 156923, 156924, 156925, 156926, 
+    156927, 156928, 156929, 156930, 156931, 156932, 156933, 156934, 156935, 
+    156936, 156937, 156938, 156939, 156940, 156941, 156942, 156943, 156944, 
+    156945, 156946, 156947, 156948, 156949, 156950, 156951, 156952, 156953, 
+    156954, 156955, 156956, 156957, 156958, 156959, 156960, 156961, 156962, 
+    156963, 156964, 156965, 156966, 156967, 156968, 156969, 156970, 156971, 
+    156972, 156973, 156974, 156975, 156976, 156977, 156978, 156979, 156980, 
+    156981, 156982, 156983, 156984, 156985, 156986, 156987, 156988, 156989, 
+    156990, 156991, 156992, 156993, 156994, 156995, 156996, 156997, 156998, 
+    156999, 157000, 157001, 157002, 157003, 157004, 157005, 157006, 157007, 
+    157008, 157009, 157010, 157011, 157012, 157013, 157014, 157015, 157016, 
+    157017, 157018, 157019, 157020, 157021, 157022, 157023, 157024, 157025, 
+    157026, 157027, 157028, 157029, 157030, 157031, 157032, 157033, 157034, 
+    157035, 157036, 157037, 157038, 157039, 157040, 157041, 157042, 157043, 
+    157044, 157045, 157046, 157047, 157048, 157049, 157050, 157051, 157052, 
+    157053, 157054, 157055, 157056, 157057, 157058, 157059, 157060, 157061, 
+    157062, 157063, 157064, 157065, 157066, 157067, 157068, 157069, 157070, 
+    157071, 157072, 157073, 157074, 157075, 157076, 157077, 157078, 157079, 
+    157080, 157081, 157082, 157083, 157084, 157085, 157086, 157087, 157088, 
+    157089, 157090, 157091, 157092, 157093, 157094, 157095, 157096, 157097, 
+    157098, 157099, 157100, 157101, 157102, 157103, 157104, 157105, 157106, 
+    157107, 157108, 157109, 157110, 157111, 157112, 157113, 157114, 157115, 
+    157116, 157117, 157118, 157119, 157120, 157121, 157122, 157123, 157124, 
+    157125, 157126, 157127, 157128, 157129, 157130, 157131, 157132, 157133, 
+    157134, 157135, 157136, 157137, 157138, 157139, 157140, 157141, 157142, 
+    157143, 157144, 157145, 157146, 157147, 157148, 157149, 157150, 157151, 
+    157152, 157153, 157154, 157155, 157156, 157157, 157158, 157159, 157160, 
+    157161, 157162, 157163, 157164, 157165, 157166, 157167, 157168, 157169, 
+    157170, 157171, 157172, 157173, 157174, 157175, 157176, 157177, 157178, 
+    157179, 157180, 157181, 157182, 157183, 157184, 157185, 157186, 157187, 
+    157188, 157189, 157190, 157191, 157192, 157193, 157194, 157195, 157196, 
+    157197, 157198, 157199, 157200, 157201, 157202, 157203, 157204, 157205, 
+    157206, 157207, 157208, 157209, 157210, 157211, 157212, 157213, 157214, 
+    157215, 157216, 157217, 157218, 157219, 157220, 157221, 157222, 157223, 
+    157224, 157225, 157226, 157227, 157228, 157229, 157230, 157231, 157232, 
+    157233, 157234, 157235, 157236, 157237, 157238, 157239, 157240, 157241, 
+    157242, 157243, 157244, 157245, 157246, 157247, 157248, 157249, 157250, 
+    157251, 157252, 157253, 157254, 157255, 157256, 157257, 157258, 157259, 
+    157260, 157261, 157262, 157263, 157264, 157265, 157266, 157267, 157268, 
+    157269, 157270, 157271, 157272, 157273, 157274, 157275, 157276, 157277, 
+    157278, 157279, 157280, 157281, 157282, 157283, 157284, 157285, 157286, 
+    157287, 157288, 157289, 157290, 157291, 157292, 157293, 157294, 157295, 
+    157296, 157297, 157298, 157299, 157300, 157301, 157302, 157303, 157304, 
+    157305, 157306, 157307, 157308, 157309, 157310, 157311, 157312, 157313, 
+    157314, 157315, 157316, 157317, 157318, 157319, 157320, 157321, 157322, 
+    157323, 157324, 157325, 157326, 157327, 157328, 157329, 157330, 157331, 
+    157332, 157333, 157334, 157335, 157336, 157337, 157338, 157339, 157340, 
+    157341, 157342, 157343, 157344, 157345, 157346, 157347, 157348, 157349, 
+    157350, 157351, 157352, 157353, 157354, 157355, 157356, 157357, 157358, 
+    157359, 157360, 157361, 157362, 157363, 157364, 157365, 157366, 157367, 
+    157368, 157369, 157370, 157371, 157372, 157373, 157374, 157375, 157376, 
+    157377, 157378, 157379, 157380, 157381, 157382, 157383, 157384, 157385, 
+    157386, 157387, 157388, 157389, 157390, 157391, 157392, 157393, 157394, 
+    157395, 157396, 157397, 157398, 157399, 157400, 157401, 157402, 157403, 
+    157404, 157405, 157406, 157407, 157408, 157409, 157410, 157411, 157412, 
+    157413, 157414, 157415, 157416, 157417, 157418, 157419, 157420, 157421, 
+    157422, 157423, 157424, 157425, 157426, 157427, 157428, 157429, 157430, 
+    157431, 157432, 157433, 157434, 157435, 157436, 157437, 157438, 157439, 
+    157440, 157441, 157442, 157443, 157444, 157445, 157446, 157447, 157448, 
+    157449, 157450, 157451, 157452, 157453, 157454, 157455, 157456, 157457, 
+    157458, 157459, 157460, 157461, 157462, 157463, 157464, 157465, 157466, 
+    157467, 157468, 157469, 157470, 157471, 157472, 157473, 157474, 157475, 
+    157476, 157477, 157478, 157479, 157480, 157481, 157482, 157483, 157484, 
+    157485, 157486, 157487, 157488, 157489, 157490, 157491, 157492, 157493, 
+    157494, 157495, 157496, 157497, 157498, 157499, 157500, 157501, 157502, 
+    157503, 157504, 157505, 157506, 157507, 157508, 157509, 157510, 157511, 
+    157512, 157513, 157514, 157515, 157516, 157517, 157518, 157519, 157520, 
+    157521, 157522, 157523, 157524, 157525, 157526, 157527, 157528, 157529, 
+    157530, 157531, 157532, 157533, 157534, 157535, 157536, 157537, 157538, 
+    157539, 157540, 157541, 157542, 157543, 157544, 157545, 157546, 157547, 
+    157548, 157549, 157550, 157551, 157552, 157553, 157554, 157555, 157556, 
+    157557, 157558, 157559, 157560, 157561, 157562, 157563, 157564, 157565, 
+    157566, 157567, 157568, 157569, 157570, 157571, 157572, 157573, 157574, 
+    157575, 157576, 157577, 157578, 157579, 157580, 157581, 157582, 157583, 
+    157584, 157585, 157586, 157587, 157588, 157589, 157590, 157591, 157592, 
+    157593, 157594, 157595, 157596, 157597, 157598, 157599, 157600, 157601, 
+    157602, 157603, 157604, 157605, 157606, 157607, 157608, 157609, 157610, 
+    157611, 157612, 157613, 157614, 157615, 157616, 157617, 157618, 157619, 
+    157620, 157621, 157622, 157623, 157624, 157625, 157626, 157627, 157628, 
+    157629, 157630, 157631, 157632, 157633, 157634, 157635, 157636, 157637, 
+    157638, 157639, 157640, 157641, 157642, 157643, 157644, 157645, 157646, 
+    157647, 157648, 157649, 157650, 157651, 157652, 157653, 157654, 157655, 
+    157656, 157657, 157658, 157659, 157660, 157661, 157662, 157663, 157664, 
+    157665, 157666, 157667, 157668, 157669, 157670, 157671, 157672, 157673, 
+    157674, 157675, 157676, 157677, 157678, 157679, 157680, 157681, 157682, 
+    157683, 157684, 157685, 157686, 157687, 157688, 157689, 157690, 157691, 
+    157692, 157693, 157694, 157695, 157696, 157697, 157698, 157699, 157700, 
+    157701, 157702, 157703, 157704, 157705, 157706, 157707, 157708, 157709, 
+    157710, 157711, 157712, 157713, 157714, 157715, 157716, 157717, 157718, 
+    157719, 157720, 157721, 157722, 157723, 157724, 157725, 157726, 157727, 
+    157728, 157729, 157730, 157731, 157732, 157733, 157734, 157735, 157736, 
+    157737, 157738, 157739, 157740, 157741, 157742, 157743, 157744, 157745, 
+    157746, 157747, 157748, 157749, 157750, 157751, 157752, 157753, 157754, 
+    157755, 157756, 157757, 157758, 157759, 157760, 157761, 157762, 157763, 
+    157764, 157765, 157766, 157767, 157768, 157769, 157770, 157771, 157772, 
+    157773, 157774, 157775, 157776, 157777, 157778, 157779, 157780, 157781, 
+    157782, 157783, 157784, 157785, 157786, 157787, 157788, 157789, 157790, 
+    157791, 157792, 157793, 157794, 157795, 157796, 157797, 157798, 157799, 
+    157800, 157801, 157802, 157803, 157804, 157805, 157806, 157807, 157808, 
+    157809, 157810, 157811, 157812, 157813, 157814, 157815, 157816, 157817, 
+    157818, 157819, 157820, 157821, 157822, 157823, 157824, 157825, 157826, 
+    157827, 157828, 157829, 157830, 157831, 157832, 157833, 157834, 157835, 
+    157836, 157837, 157838, 157839, 157840, 157841, 157842, 157843, 157844, 
+    157845, 157846, 157847, 157848, 157849, 157850, 157851, 157852, 157853, 
+    157854, 157855, 157856, 157857, 157858, 157859, 157860, 157861, 157862, 
+    157863, 157864, 157865, 157866, 157867, 157868, 157869, 157870, 157871, 
+    157872, 157873, 157874, 157875, 157876, 157877, 157878, 157879, 157880, 
+    157881, 157882, 157883, 157884, 157885, 157886, 157887, 157888, 157889, 
+    157890, 157891, 157892, 157893, 157894, 157895, 157896, 157897, 157898, 
+    157899, 157900, 157901, 157902, 157903, 157904, 157905, 157906, 157907, 
+    157908, 157909, 157910, 157911, 157912, 157913, 157914, 157915, 157916, 
+    157917, 157918, 157919, 157920, 157921, 157922, 157923, 157924, 157925, 
+    157926, 157927, 157928, 157929, 157930, 157931, 157932, 157933, 157934, 
+    157935, 157936, 157937, 157938, 157939, 157940, 157941, 157942, 157943, 
+    157944, 157945, 157946, 157947, 157948, 157949, 157950, 157951, 157952, 
+    157953, 157954, 157955, 157956, 157957, 157958, 157959, 157960, 157961, 
+    157962, 157963, 157964, 157965, 157966, 157967, 157968, 157969, 157970, 
+    157971, 157972, 157973, 157974, 157975, 157976, 157977, 157978, 157979, 
+    157980, 157981, 157982, 157983, 157984, 157985, 157986, 157987, 157988, 
+    157989, 157990, 157991, 157992, 157993, 157994, 157995, 157996, 157997, 
+    157998, 157999, 158000, 158001, 158002, 158003, 158004, 158005, 158006, 
+    158007, 158008, 158009, 158010, 158011, 158012, 158013, 158014, 158015, 
+    158016, 158017, 158018, 158019, 158020, 158021, 158022, 158023, 158024, 
+    158025, 158026, 158027, 158028, 158029, 158030, 158031, 158032, 158033, 
+    158034, 158035, 158036, 158037, 158038, 158039, 158040, 158041, 158042, 
+    158043, 158044, 158045, 158046, 158047, 158048, 158049, 158050, 158051, 
+    158052, 158053, 158054, 158055, 158056, 158057, 158058, 158059, 158060, 
+    158061, 158062, 158063, 158064, 158065, 158066, 158067, 158068, 158069, 
+    158070, 158071, 158072, 158073, 158074, 158075, 158076, 158077, 158078, 
+    158079, 158080, 158081, 158082, 158083, 158084, 158085, 158086, 158087, 
+    158088, 158089, 158090, 158091, 158092, 158093, 158094, 158095, 158096, 
+    158097, 158098, 158099, 158100, 158101, 158102, 158103, 158104, 158105, 
+    158106, 158107, 158108, 158109, 158110, 158111, 158112, 158113, 158114, 
+    158115, 158116, 158117, 158118, 158119, 158120, 158121, 158122, 158123, 
+    158124, 158125, 158126, 158127, 158128, 158129, 158130, 158131, 158132, 
+    158133, 158134, 158135, 158136, 158137, 158138, 158139, 158140, 158141, 
+    158142, 158143, 158144, 158145, 158146, 158147, 158148, 158149, 158150, 
+    158151, 158152, 158153, 158154, 158155, 158156, 158157, 158158, 158159, 
+    158160, 158161, 158162, 158163, 158164, 158165, 158166, 158167, 158168, 
+    158169, 158170, 158171, 158172, 158173, 158174, 158175, 158176, 158177, 
+    158178, 158179, 158180, 158181, 158182, 158183, 158184, 158185, 158186, 
+    158187, 158188, 158189, 158190, 158191, 158192, 158193, 158194, 158195, 
+    158196, 158197, 158198, 158199, 158200, 158201, 158202, 158203, 158204, 
+    158205, 158206, 158207, 158208, 158209, 158210, 158211, 158212, 158213, 
+    158214, 158215, 158216, 158217, 158218, 158219, 158220, 158221, 158222, 
+    158223, 158224, 158225, 158226, 158227, 158228, 158229, 158230, 158231, 
+    158232, 158233, 158234, 158235, 158236, 158237, 158238, 158239, 158240, 
+    158241, 158242, 158243, 158244, 158245, 158246, 158247, 158248, 158249, 
+    158250, 158251, 158252, 158253, 158254, 158255, 158256, 158257, 158258, 
+    158259, 158260, 158261, 158262, 158263, 158264, 158265, 158266, 158267, 
+    158268, 158269, 158270, 158271, 158272, 158273, 158274, 158275, 158276, 
+    158277, 158278, 158279, 158280, 158281, 158282, 158283, 158284, 158285, 
+    158286, 158287, 158288, 158289, 158290, 158291, 158292, 158293, 158294, 
+    158295, 158296, 158297, 158298, 158299, 158300, 158301, 158302, 158303, 
+    158304, 158305, 158306, 158307, 158308, 158309, 158310, 158311, 158312, 
+    158313, 158314, 158315, 158316, 158317, 158318, 158319, 158320, 158321, 
+    158322, 158323, 158324, 158325, 158326, 158327, 158328, 158329, 158330, 
+    158331, 158332, 158333, 158334, 158335, 158336, 158337, 158338, 158339, 
+    158340, 158341, 158342, 158343, 158344, 158345, 158346, 158347, 158348, 
+    158349, 158350, 158351, 158352, 158353, 158354, 158355, 158356, 158357, 
+    158358, 158359, 158360, 158361, 158362, 158363, 158364, 158365, 158366, 
+    158367, 158368, 158369, 158370, 158371, 158372, 158373, 158374, 158375, 
+    158376, 158377, 158378, 158379, 158380, 158381, 158382, 158383, 158384, 
+    158385, 158386, 158387, 158388, 158389, 158390, 158391, 158392, 158393, 
+    158394, 158395, 158396, 158397, 158398, 158399, 158400, 158401, 158402, 
+    158403, 158404, 158405, 158406, 158407, 158408, 158409, 158410, 158411, 
+    158412, 158413, 158414, 158415, 158416, 158417, 158418, 158419, 158420, 
+    158421, 158422, 158423, 158424, 158425, 158426, 158427, 158428, 158429, 
+    158430, 158431, 158432, 158433, 158434, 158435, 158436, 158437, 158438, 
+    158439, 158440, 158441, 158442, 158443, 158444, 158445, 158446, 158447, 
+    158448, 158449, 158450, 158451, 158452, 158453, 158454, 158455, 158456, 
+    158457, 158458, 158459, 158460, 158461, 158462, 158463, 158464, 158465, 
+    158466, 158467, 158468, 158469, 158470, 158471, 158472, 158473, 158474, 
+    158475, 158476, 158477, 158478, 158479, 158480, 158481, 158482, 158483, 
+    158484, 158485, 158486, 158487, 158488, 158489, 158490, 158491, 158492, 
+    158493, 158494, 158495, 158496, 158497, 158498, 158499, 158500, 158501, 
+    158502, 158503, 158504, 158505, 158506, 158507, 158508, 158509, 158510, 
+    158511, 158512, 158513, 158514, 158515, 158516, 158517, 158518, 158519, 
+    158520, 158521, 158522, 158523, 158524, 158525, 158526, 158527, 158528, 
+    158529, 158530, 158531, 158532, 158533, 158534, 158535, 158536, 158537, 
+    158538, 158539, 158540, 158541, 158542, 158543, 158544, 158545, 158546, 
+    158547, 158548, 158549, 158550, 158551, 158552, 158553, 158554, 158555, 
+    158556, 158557, 158558, 158559, 158560, 158561, 158562, 158563, 158564, 
+    158565, 158566, 158567, 158568, 158569, 158570, 158571, 158572, 158573, 
+    158574, 158575, 158576, 158577, 158578, 158579, 158580, 158581, 158582, 
+    158583, 158584, 158585, 158586, 158587, 158588, 158589, 158590, 158591, 
+    158592, 158593, 158594, 158595, 158596, 158597, 158598, 158599, 158600, 
+    158601, 158602, 158603, 158604, 158605, 158606, 158607, 158608, 158609, 
+    158610, 158611, 158612, 158613, 158614, 158615, 158616, 158617, 158618, 
+    158619, 158620, 158621, 158622, 158623, 158624, 158625, 158626, 158627, 
+    158628, 158629, 158630, 158631, 158632, 158633, 158634, 158635, 158636, 
+    158637, 158638, 158639, 158640, 158641, 158642, 158643, 158644, 158645, 
+    158646, 158647, 158648, 158649, 158650, 158651, 158652, 158653, 158654, 
+    158655, 158656, 158657, 158658, 158659, 158660, 158661, 158662, 158663, 
+    158664, 158665, 158666, 158667, 158668, 158669, 158670, 158671, 158672, 
+    158673, 158674, 158675, 158676, 158677, 158678, 158679, 158680, 158681, 
+    158682, 158683, 158684, 158685, 158686, 158687, 158688, 158689, 158690, 
+    158691, 158692, 158693, 158694, 158695, 158696, 158697, 158698, 158699, 
+    158700, 158701, 158702, 158703, 158704, 158705, 158706, 158707, 158708, 
+    158709, 158710, 158711, 158712, 158713, 158714, 158715, 158716, 158717, 
+    158718, 158719, 158720, 158721, 158722, 158723, 158724, 158725, 158726, 
+    158727, 158728, 158729, 158730, 158731, 158732, 158733, 158734, 158735, 
+    158736, 158737, 158738, 158739, 158740, 158741, 158742, 158743, 158744, 
+    158745, 158746, 158747, 158748, 158749, 158750, 158751, 158752, 158753, 
+    158754, 158755, 158756, 158757, 158758, 158759, 158760, 158761, 158762, 
+    158763, 158764, 158765, 158766, 158767, 158768, 158769, 158770, 158771, 
+    158772, 158773, 158774, 158775, 158776, 158777, 158778, 158779, 158780, 
+    158781, 158782, 158783, 158784, 158785, 158786, 158787, 158788, 158789, 
+    158790, 158791, 158792, 158793, 158794, 158795, 158796, 158797, 158798, 
+    158799, 158800, 158801, 158802, 158803, 158804, 158805, 158806, 158807, 
+    158808, 158809, 158810, 158811, 158812, 158813, 158814, 158815, 158816, 
+    158817, 158818, 158819, 158820, 158821, 158822, 158823, 158824, 158825, 
+    158826, 158827, 158828, 158829, 158830, 158831, 158832, 158833, 158834, 
+    158835, 158836, 158837, 158838, 158839, 158840, 158841, 158842, 158843, 
+    158844, 158845, 158846, 158847, 158848, 158849, 158850, 158851, 158852, 
+    158853, 158854, 158855, 158856, 158857, 158858, 158859, 158860, 158861, 
+    158862, 158863, 158864, 158865, 158866, 158867, 158868, 158869, 158870, 
+    158871, 158872, 158873, 158874, 158875, 158876, 158877, 158878, 158879, 
+    158880, 158881, 158882, 158883, 158884, 158885, 158886, 158887, 158888, 
+    158889, 158890, 158891, 158892, 158893, 158894, 158895, 158896, 158897, 
+    158898, 158899, 158900, 158901, 158902, 158903, 158904, 158905, 158906, 
+    158907, 158908, 158909, 158910, 158911, 158912, 158913, 158914, 158915, 
+    158916, 158917, 158918, 158919, 158920, 158921, 158922, 158923, 158924, 
+    158925, 158926, 158927, 158928, 158929, 158930, 158931, 158932, 158933, 
+    158934, 158935, 158936, 158937, 158938, 158939, 158940, 158941, 158942, 
+    158943, 158944, 158945, 158946, 158947, 158948, 158949, 158950, 158951, 
+    158952, 158953, 158954, 158955, 158956, 158957, 158958, 158959, 158960, 
+    158961, 158962, 158963, 158964, 158965, 158966, 158967, 158968, 158969, 
+    158970, 158971, 158972, 158973, 158974, 158975, 158976, 158977, 158978, 
+    158979, 158980, 158981, 158982, 158983, 158984, 158985, 158986, 158987, 
+    158988, 158989, 158990, 158991, 158992, 158993, 158994, 158995, 158996, 
+    158997, 158998, 158999, 159000, 159001, 159002, 159003, 159004, 159005, 
+    159006, 159007, 159008, 159009, 159010, 159011, 159012, 159013, 159014, 
+    159015, 159016, 159017, 159018, 159019, 159020, 159021, 159022, 159023, 
+    159024, 159025, 159026, 159027, 159028, 159029, 159030, 159031, 159032, 
+    159033, 159034, 159035, 159036, 159037, 159038, 159039, 159040, 159041, 
+    159042, 159043, 159044, 159045, 159046, 159047, 159048, 159049, 159050, 
+    159051, 159052, 159053, 159054, 159055, 159056, 159057, 159058, 159059, 
+    159060, 159061, 159062, 159063, 159064, 159065, 159066, 159067, 159068, 
+    159069, 159070, 159071, 159072, 159073, 159074, 159075, 159076, 159077, 
+    159078, 159079, 159080, 159081, 159082, 159083, 159084, 159085, 159086, 
+    159087, 159088, 159089, 159090, 159091, 159092, 159093, 159094, 159095, 
+    159096, 159097, 159098, 159099, 159100, 159101, 159102, 159103, 159104, 
+    159105, 159106, 159107, 159108, 159109, 159110, 159111, 159112, 159113, 
+    159114, 159115, 159116, 159117, 159118, 159119, 159120, 159121, 159122, 
+    159123, 159124, 159125, 159126, 159127, 159128, 159129, 159130, 159131, 
+    159132, 159133, 159134, 159135, 159136, 159137, 159138, 159139, 159140, 
+    159141, 159142, 159143, 159144, 159145, 159146, 159147, 159148, 159149, 
+    159150, 159151, 159152, 159153, 159154, 159155, 159156, 159157, 159158, 
+    159159, 159160, 159161, 159162, 159163, 159164, 159165, 159166, 159167, 
+    159168, 159169, 159170, 159171, 159172, 159173, 159174, 159175, 159176, 
+    159177, 159178, 159179, 159180, 159181, 159182, 159183, 159184, 159185, 
+    159186, 159187, 159188, 159189, 159190, 159191, 159192, 159193, 159194, 
+    159195, 159196, 159197, 159198, 159199, 159200, 159201, 159202, 159203, 
+    159204, 159205, 159206, 159207, 159208, 159209, 159210, 159211, 159212, 
+    159213, 159214, 159215, 159216, 159217, 159218, 159219, 159220, 159221, 
+    159222, 159223, 159224, 159225, 159226, 159227, 159228, 159229, 159230, 
+    159231, 159232, 159233, 159234, 159235, 159236, 159237, 159238, 159239, 
+    159240, 159241, 159242, 159243, 159244, 159245, 159246, 159247, 159248, 
+    159249, 159250, 159251, 159252, 159253, 159254, 159255, 159256, 159257, 
+    159258, 159259, 159260, 159261, 159262, 159263, 159264, 159265, 159266, 
+    159267, 159268, 159269, 159270, 159271, 159272, 159273, 159274, 159275, 
+    159276, 159277, 159278, 159279, 159280, 159281, 159282, 159283, 159284, 
+    159285, 159286, 159287, 159288, 159289, 159290, 159291, 159292, 159293, 
+    159294, 159295, 159296, 159297, 159298, 159299, 159300, 159301, 159302, 
+    159303, 159304, 159305, 159306, 159307, 159308, 159309, 159310, 159311, 
+    159312, 159313, 159314, 159315, 159316, 159317, 159318, 159319, 159320, 
+    159321, 159322, 159323, 159324, 159325, 159326, 159327, 159328, 159329, 
+    159330, 159331, 159332, 159333, 159334, 159335, 159336, 159337, 159338, 
+    159339, 159340, 159341, 159342, 159343, 159344, 159345, 159346, 159347, 
+    159348, 159349, 159350, 159351, 159352, 159353, 159354, 159355, 159356, 
+    159357, 159358, 159359, 159360, 159361, 159362, 159363, 159364, 159365, 
+    159366, 159367, 159368, 159369, 159370, 159371, 159372, 159373, 159374, 
+    159375, 159376, 159377, 159378, 159379, 159380, 159381, 159382, 159383, 
+    159384, 159385, 159386, 159387, 159388, 159389, 159390, 159391, 159392, 
+    159393, 159394, 159395, 159396, 159397, 159398, 159399, 159400, 159401, 
+    159402, 159403, 159404, 159405, 159406, 159407, 159408, 159409, 159410, 
+    159411, 159412, 159413, 159414, 159415, 159416, 159417, 159418, 159419, 
+    159420, 159421, 159422, 159423, 159424, 159425, 159426, 159427, 159428, 
+    159429, 159430, 159431, 159432, 159433, 159434, 159435, 159436, 159437, 
+    159438, 159439, 159440, 159441, 159442, 159443, 159444, 159445, 159446, 
+    159447, 159448, 159449, 159450, 159451, 159452, 159453, 159454, 159455, 
+    159456, 159457, 159458, 159459, 159460, 159461, 159462, 159463, 159464, 
+    159465, 159466, 159467, 159468, 159469, 159470, 159471, 159472, 159473, 
+    159474, 159475, 159476, 159477, 159478, 159479, 159480, 159481, 159482, 
+    159483, 159484, 159485, 159486, 159487, 159488, 159489, 159490, 159491, 
+    159492, 159493, 159494, 159495, 159496, 159497, 159498, 159499, 159500, 
+    159501, 159502, 159503, 159504, 159505, 159506, 159507, 159508, 159509, 
+    159510, 159511, 159512, 159513, 159514, 159515, 159516, 159517, 159518, 
+    159519, 159520, 159521, 159522, 159523, 159524, 159525, 159526, 159527, 
+    159528, 159529, 159530, 159531, 159532, 159533, 159534, 159535, 159536, 
+    159537, 159538, 159539, 159540, 159541, 159542, 159543, 159544, 159545, 
+    159546, 159547, 159548, 159549, 159550, 159551, 159552, 159553, 159554, 
+    159555, 159556, 159557, 159558, 159559, 159560, 159561, 159562, 159563, 
+    159564, 159565, 159566, 159567, 159568, 159569, 159570, 159571, 159572, 
+    159573, 159574, 159575, 159576, 159577, 159578, 159579, 159580, 159581, 
+    159582, 159583, 159584, 159585, 159586, 159587, 159588, 159589, 159590, 
+    159591, 159592, 159593, 159594, 159595, 159596, 159597, 159598, 159599, 
+    159600, 159601, 159602, 159603, 159604, 159605, 159606, 159607, 159608, 
+    159609, 159610, 159611, 159612, 159613, 159614, 159615, 159616, 159617, 
+    159618, 159619, 159620, 159621, 159622, 159623, 159624, 159625, 159626, 
+    159627, 159628, 159629, 159630, 159631, 159632, 159633, 159634, 159635, 
+    159636, 159637, 159638, 159639, 159640, 159641, 159642, 159643, 159644, 
+    159645, 159646, 159647, 159648, 159649, 159650, 159651, 159652, 159653, 
+    159654, 159655, 159656, 159657, 159658, 159659, 159660, 159661, 159662, 
+    159663, 159664, 159665, 159666, 159667, 159668, 159669, 159670, 159671, 
+    159672, 159673, 159674, 159675, 159676, 159677, 159678, 159679, 159680, 
+    159681, 159682, 159683, 159684, 159685, 159686, 159687, 159688, 159689, 
+    159690, 159691, 159692, 159693, 159694, 159695, 159696, 159697, 159698, 
+    159699, 159700, 159701, 159702, 159703, 159704, 159705, 159706, 159707, 
+    159708, 159709, 159710, 159711, 159712, 159713, 159714, 159715, 159716, 
+    159717, 159718, 159719, 159720, 159721, 159722, 159723, 159724, 159725, 
+    159726, 159727, 159728, 159729, 159730, 159731, 159732, 159733, 159734, 
+    159735, 159736, 159737, 159738, 159739, 159740, 159741, 159742, 159743, 
+    159744, 159745, 159746, 159747, 159748, 159749, 159750, 159751, 159752, 
+    159753, 159754, 159755, 159756, 159757, 159758, 159759, 159760, 159761, 
+    159762, 159763, 159764, 159765, 159766, 159767, 159768, 159769, 159770, 
+    159771, 159772, 159773, 159774, 159775, 159776, 159777, 159778, 159779, 
+    159780, 159781, 159782, 159783, 159784, 159785, 159786, 159787, 159788, 
+    159789, 159790, 159791, 159792, 159793, 159794, 159795, 159796, 159797, 
+    159798, 159799, 159800, 159801, 159802, 159803, 159804, 159805, 159806, 
+    159807, 159808, 159809, 159810, 159811, 159812, 159813, 159814, 159815, 
+    159816, 159817, 159818, 159819, 159820, 159821, 159822, 159823, 159824, 
+    159825, 159826, 159827, 159828, 159829, 159830, 159831, 159832, 159833, 
+    159834, 159835, 159836, 159837, 159838, 159839, 159840, 159841, 159842, 
+    159843, 159844, 159845, 159846, 159847, 159848, 159849, 159850, 159851, 
+    159852, 159853, 159854, 159855, 159856, 159857, 159858, 159859, 159860, 
+    159861, 159862, 159863, 159864, 159865, 159866, 159867, 159868, 159869, 
+    159870, 159871, 159872, 159873, 159874, 159875, 159876, 159877, 159878, 
+    159879, 159880, 159881, 159882, 159883, 159884, 159885, 159886, 159887, 
+    159888, 159889, 159890, 159891, 159892, 159893, 159894, 159895, 159896, 
+    159897, 159898, 159899, 159900, 159901, 159902, 159903, 159904, 159905, 
+    159906, 159907, 159908, 159909, 159910, 159911, 159912, 159913, 159914, 
+    159915, 159916, 159917, 159918, 159919, 159920, 159921, 159922, 159923, 
+    159924, 159925, 159926, 159927, 159928, 159929, 159930, 159931, 159932, 
+    159933, 159934, 159935, 159936, 159937, 159938, 159939, 159940, 159941, 
+    159942, 159943, 159944, 159945, 159946, 159947, 159948, 159949, 159950, 
+    159951, 159952, 159953, 159954, 159955, 159956, 159957, 159958, 159959, 
+    159960, 159961, 159962, 159963, 159964, 159965, 159966, 159967, 159968, 
+    159969, 159970, 159971, 159972, 159973, 159974, 159975, 159976, 159977, 
+    159978, 159979, 159980, 159981, 159982, 159983, 159984, 159985, 159986, 
+    159987, 159988, 159989, 159990, 159991, 159992, 159993, 159994, 159995, 
+    159996, 159997, 159998, 159999, 160000, 160001, 160002, 160003, 160004, 
+    160005, 160006, 160007, 160008, 160009, 160010, 160011, 160012, 160013, 
+    160014, 160015, 160016, 160017, 160018, 160019, 160020, 160021, 160022, 
+    160023, 160024, 160025, 160026, 160027, 160028, 160029, 160030, 160031, 
+    160032, 160033, 160034, 160035, 160036, 160037, 160038, 160039, 160040, 
+    160041, 160042, 160043, 160044, 160045, 160046, 160047, 160048, 160049, 
+    160050, 160051, 160052, 160053, 160054, 160055, 160056, 160057, 160058, 
+    160059, 160060, 160061, 160062, 160063, 160064, 160065, 160066, 160067, 
+    160068, 160069, 160070, 160071, 160072, 160073, 160074, 160075, 160076, 
+    160077, 160078, 160079, 160080, 160081, 160082, 160083, 160084, 160085, 
+    160086, 160087, 160088, 160089, 160090, 160091, 160092, 160093, 160094, 
+    160095, 160096, 160097, 160098, 160099, 160100, 160101, 160102, 160103, 
+    160104, 160105, 160106, 160107, 160108, 160109, 160110, 160111, 160112, 
+    160113, 160114, 160115, 160116, 160117, 160118, 160119, 160120, 160121, 
+    160122, 160123, 160124, 160125, 160126, 160127, 160128, 160129, 160130, 
+    160131, 160132, 160133, 160134, 160135, 160136, 160137, 160138, 160139, 
+    160140, 160141, 160142, 160143, 160144, 160145, 160146, 160147, 160148, 
+    160149, 160150, 160151, 160152, 160153, 160154, 160155, 160156, 160157, 
+    160158, 160159, 160160, 160161, 160162, 160163, 160164, 160165, 160166, 
+    160167, 160168, 160169, 160170, 160171, 160172, 160173, 160174, 160175, 
+    160176, 160177, 160178, 160179, 160180, 160181, 160182, 160183, 160184, 
+    160185, 160186, 160187, 160188, 160189, 160190, 160191, 160192, 160193, 
+    160194, 160195, 160196, 160197, 160198, 160199, 160200, 160201, 160202, 
+    160203, 160204, 160205, 160206, 160207, 160208, 160209, 160210, 160211, 
+    160212, 160213, 160214, 160215, 160216, 160217, 160218, 160219, 160220, 
+    160221, 160222, 160223, 160224, 160225, 160226, 160227, 160228, 160229, 
+    160230, 160231, 160232, 160233, 160234, 160235, 160236, 160237, 160238, 
+    160239, 160240, 160241, 160242, 160243, 160244, 160245, 160246, 160247, 
+    160248, 160249, 160250, 160251, 160252, 160253, 160254, 160255, 160256, 
+    160257, 160258, 160259, 160260, 160261, 160262, 160263, 160264, 160265, 
+    160266, 160267, 160268, 160269, 160270, 160271, 160272, 160273, 160274, 
+    160275, 160276, 160277, 160278, 160279, 160280, 160281, 160282, 160283, 
+    160284, 160285, 160286, 160287, 160288, 160289, 160290, 160291, 160292, 
+    160293, 160294, 160295, 160296, 160297, 160298, 160299, 160300, 160301, 
+    160302, 160303, 160304, 160305, 160306, 160307, 160308, 160309, 160310, 
+    160311, 160312, 160313, 160314, 160315, 160316, 160317, 160318, 160319, 
+    160320, 160321, 160322, 160323, 160324, 160325, 160326, 160327, 160328, 
+    160329, 160330, 160331, 160332, 160333, 160334, 160335, 160336, 160337, 
+    160338, 160339, 160340, 160341, 160342, 160343, 160344, 160345, 160346, 
+    160347, 160348, 160349, 160350, 160351, 160352, 160353, 160354, 160355, 
+    160356, 160357, 160358, 160359, 160360, 160361, 160362, 160363, 160364, 
+    160365, 160366, 160367, 160368, 160369, 160370, 160371, 160372, 160373, 
+    160374, 160375, 160376, 160377, 160378, 160379, 160380, 160381, 160382, 
+    160383, 160384, 160385, 160386, 160387, 160388, 160389, 160390, 160391, 
+    160392, 160393, 160394, 160395, 160396, 160397, 160398, 160399, 160400, 
+    160401, 160402, 160403, 160404, 160405, 160406, 160407, 160408, 160409, 
+    160410, 160411, 160412, 160413, 160414, 160415, 160416, 160417, 160418, 
+    160419, 160420, 160421, 160422, 160423, 160424, 160425, 160426, 160427, 
+    160428, 160429, 160430, 160431, 160432, 160433, 160434, 160435, 160436, 
+    160437, 160438, 160439, 160440, 160441, 160442, 160443, 160444, 160445, 
+    160446, 160447, 160448, 160449, 160450, 160451, 160452, 160453, 160454, 
+    160455, 160456, 160457, 160458, 160459, 160460, 160461, 160462, 160463, 
+    160464, 160465, 160466, 160467, 160468, 160469, 160470, 160471, 160472, 
+    160473, 160474, 160475, 160476, 160477, 160478, 160479, 160480, 160481, 
+    160482, 160483, 160484, 160485, 160486, 160487, 160488, 160489, 160490, 
+    160491, 160492, 160493, 160494, 160495, 160496, 160497, 160498, 160499, 
+    160500, 160501, 160502, 160503, 160504, 160505, 160506, 160507, 160508, 
+    160509, 160510, 160511, 160512, 160513, 160514, 160515, 160516, 160517, 
+    160518, 160519, 160520, 160521, 160522, 160523, 160524, 160525, 160526, 
+    160527, 160528, 160529, 160530, 160531, 160532, 160533, 160534, 160535, 
+    160536, 160537, 160538, 160539, 160540, 160541, 160542, 160543, 160544, 
+    160545, 160546, 160547, 160548, 160549, 160550, 160551, 160552, 160553, 
+    160554, 160555, 160556, 160557, 160558, 160559, 160560, 160561, 160562, 
+    160563, 160564, 160565, 160566, 160567, 160568, 160569, 160570, 160571, 
+    160572, 160573, 160574, 160575, 160576, 160577, 160578, 160579, 160580, 
+    160581, 160582, 160583, 160584, 160585, 160586, 160587, 160588, 160589, 
+    160590, 160591, 160592, 160593, 160594, 160595, 160596, 160597, 160598, 
+    160599, 160600, 160601, 160602, 160603, 160604, 160605, 160606, 160607, 
+    160608, 160609, 160610, 160611, 160612, 160613, 160614, 160615, 160616, 
+    160617, 160618, 160619, 160620, 160621, 160622, 160623, 160624, 160625, 
+    160626, 160627, 160628, 160629, 160630, 160631, 160632, 160633, 160634, 
+    160635, 160636, 160637, 160638, 160639, 160640, 160641, 160642, 160643, 
+    160644, 160645, 160646, 160647, 160648, 160649, 160650, 160651, 160652, 
+    160653, 160654, 160655, 160656, 160657, 160658, 160659, 160660, 160661, 
+    160662, 160663, 160664, 160665, 160666, 160667, 160668, 160669, 160670, 
+    160671, 160672, 160673, 160674, 160675, 160676, 160677, 160678, 160679, 
+    160680, 160681, 160682, 160683, 160684, 160685, 160686, 160687, 160688, 
+    160689, 160690, 160691, 160692, 160693, 160694, 160695, 160696, 160697, 
+    160698, 160699, 160700, 160701, 160702, 160703, 160704, 160705, 160706, 
+    160707, 160708, 160709, 160710, 160711, 160712, 160713, 160714, 160715, 
+    160716, 160717, 160718, 160719, 160720, 160721, 160722, 160723, 160724, 
+    160725, 160726, 160727, 160728, 160729, 160730, 160731, 160732, 160733, 
+    160734, 160735, 160736, 160737, 160738, 160739, 160740, 160741, 160742, 
+    160743, 160744, 160745, 160746, 160747, 160748, 160749, 160750, 160751, 
+    160752, 160753, 160754, 160755, 160756, 160757, 160758, 160759, 160760, 
+    160761, 160762, 160763, 160764, 160765, 160766, 160767, 160768, 160769, 
+    160770, 160771, 160772, 160773, 160774, 160775, 160776, 160777, 160778, 
+    160779, 160780, 160781, 160782, 160783, 160784, 160785, 160786, 160787, 
+    160788, 160789, 160790, 160791, 160792, 160793, 160794, 160795, 160796, 
+    160797, 160798, 160799, 160800, 160801, 160802, 160803, 160804, 160805, 
+    160806, 160807, 160808, 160809, 160810, 160811, 160812, 160813, 160814, 
+    160815, 160816, 160817, 160818, 160819, 160820, 160821, 160822, 160823, 
+    160824, 160825, 160826, 160827, 160828, 160829, 160830, 160831, 160832, 
+    160833, 160834, 160835, 160836, 160837, 160838, 160839, 160840, 160841, 
+    160842, 160843, 160844, 160845, 160846, 160847, 160848, 160849, 160850, 
+    160851, 160852, 160853, 160854, 160855, 160856, 160857, 160858, 160859, 
+    160860, 160861, 160862, 160863, 160864, 160865, 160866, 160867, 160868, 
+    160869, 160870, 160871, 160872, 160873, 160874, 160875, 160876, 160877, 
+    160878, 160879, 160880, 160881, 160882, 160883, 160884, 160885, 160886, 
+    160887, 160888, 160889, 160890, 160891, 160892, 160893, 160894, 160895, 
+    160896, 160897, 160898, 160899, 160900, 160901, 160902, 160903, 160904, 
+    160905, 160906, 160907, 160908, 160909, 160910, 160911, 160912, 160913, 
+    160914, 160915, 160916, 160917, 160918, 160919, 160920, 160921, 160922, 
+    160923, 160924, 160925, 160926, 160927, 160928, 160929, 160930, 160931, 
+    160932, 160933, 160934, 160935, 160936, 160937, 160938, 160939, 160940, 
+    160941, 160942, 160943, 160944, 160945, 160946, 160947, 160948, 160949, 
+    160950, 160951, 160952, 160953, 160954, 160955, 160956, 160957, 160958, 
+    160959, 160960, 160961, 160962, 160963, 160964, 160965, 160966, 160967, 
+    160968, 160969, 160970, 160971, 160972, 160973, 160974, 160975, 160976, 
+    160977, 160978, 160979, 160980, 160981, 160982, 160983, 160984, 160985, 
+    160986, 160987, 160988, 160989, 160990, 160991, 160992, 160993, 160994, 
+    160995, 160996, 160997, 160998, 160999, 161000, 161001, 161002, 161003, 
+    161004, 161005, 161006, 161007, 161008, 161009, 161010, 161011, 161012, 
+    161013, 161014, 161015, 161016, 161017, 161018, 161019, 161020, 161021, 
+    161022, 161023, 161024, 161025, 161026, 161027, 161028, 161029, 161030, 
+    161031, 161032, 161033, 161034, 161035, 161036, 161037, 161038, 161039, 
+    161040, 161041, 161042, 161043, 161044, 161045, 161046, 161047, 161048, 
+    161049, 161050, 161051, 161052, 161053, 161054, 161055, 161056, 161057, 
+    161058, 161059, 161060, 161061, 161062, 161063, 161064, 161065, 161066, 
+    161067, 161068, 161069, 161070, 161071, 161072, 161073, 161074, 161075, 
+    161076, 161077, 161078, 161079, 161080, 161081, 161082, 161083, 161084, 
+    161085, 161086, 161087, 161088, 161089, 161090, 161091, 161092, 161093, 
+    161094, 161095, 161096, 161097, 161098, 161099, 161100, 161101, 161102, 
+    161103, 161104, 161105, 161106, 161107, 161108, 161109, 161110, 161111, 
+    161112, 161113, 161114, 161115, 161116, 161117, 161118, 161119, 161120, 
+    161121, 161122, 161123, 161124, 161125, 161126, 161127, 161128, 161129, 
+    161130, 161131, 161132, 161133, 161134, 161135, 161136, 161137, 161138, 
+    161139, 161140, 161141, 161142, 161143, 161144, 161145, 161146, 161147, 
+    161148, 161149, 161150, 161151, 161152, 161153, 161154, 161155, 161156, 
+    161157, 161158, 161159, 161160, 161161, 161162, 161163, 161164, 161165, 
+    161166, 161167, 161168, 161169, 161170, 161171, 161172, 161173, 161174, 
+    161175, 161176, 161177, 161178, 161179, 161180, 161181, 161182, 161183, 
+    161184, 161185, 161186, 161187, 161188, 161189, 161190, 161191, 161192, 
+    161193, 161194, 161195, 161196, 161197, 161198, 161199, 161200, 161201, 
+    161202, 161203, 161204, 161205, 161206, 161207, 161208, 161209, 161210, 
+    161211, 161212, 161213, 161214, 161215, 161216, 161217, 161218, 161219, 
+    161220, 161221, 161222, 161223, 161224, 161225, 161226, 161227, 161228, 
+    161229, 161230, 161231, 161232, 161233, 161234, 161235, 161236, 161237, 
+    161238, 161239, 161240, 161241, 161242, 161243, 161244, 161245, 161246, 
+    161247, 161248, 161249, 161250, 161251, 161252, 161253, 161254, 161255, 
+    161256, 161257, 161258, 161259, 161260, 161261, 161262, 161263, 161264, 
+    161265, 161266, 161267, 161268, 161269, 161270, 161271, 161272, 161273, 
+    161274, 161275, 161276, 161277, 161278, 161279, 161280, 161281, 161282, 
+    161283, 161284, 161285, 161286, 161287, 161288, 161289, 161290, 161291, 
+    161292, 161293, 161294, 161295, 161296, 161297, 161298, 161299, 161300, 
+    161301, 161302, 161303, 161304, 161305, 161306, 161307, 161308, 161309, 
+    161310, 161311, 161312, 161313, 161314, 161315, 161316, 161317, 161318, 
+    161319, 161320, 161321, 161322, 161323, 161324, 161325, 161326, 161327, 
+    161328, 161329, 161330, 161331, 161332, 161333, 161334, 161335, 161336, 
+    161337, 161338, 161339, 161340, 161341, 161342, 161343, 161344, 161345, 
+    161346, 161347, 161348, 161349, 161350, 161351, 161352, 161353, 161354, 
+    161355, 161356, 161357, 161358, 161359, 161360, 161361, 161362, 161363, 
+    161364, 161365, 161366, 161367, 161368, 161369, 161370, 161371, 161372, 
+    161373, 161374, 161375, 161376, 161377, 161378, 161379, 161380, 161381, 
+    161382, 161383, 161384, 161385, 161386, 161387, 161388, 161389, 161390, 
+    161391, 161392, 161393, 161394, 161395, 161396, 161397, 161398, 161399, 
+    161400, 161401, 161402, 161403, 161404, 161405, 161406, 161407, 161408, 
+    161409, 161410, 161411, 161412, 161413, 161414, 161415, 161416, 161417, 
+    161418, 161419, 161420, 161421, 161422, 161423, 161424, 161425, 161426, 
+    161427, 161428, 161429, 161430, 161431, 161432, 161433, 161434, 161435, 
+    161436, 161437, 161438, 161439, 161440, 161441, 161442, 161443, 161444, 
+    161445, 161446, 161447, 161448, 161449, 161450, 161451, 161452, 161453, 
+    161454, 161455, 161456, 161457, 161458, 161459, 161460, 161461, 161462, 
+    161463, 161464, 161465, 161466, 161467, 161468, 161469, 161470, 161471, 
+    161472, 161473, 161474, 161475, 161476, 161477, 161478, 161479, 161480, 
+    161481, 161482, 161483, 161484, 161485, 161486, 161487, 161488, 161489, 
+    161490, 161491, 161492, 161493, 161494, 161495, 161496, 161497, 161498, 
+    161499, 161500, 161501, 161502, 161503, 161504, 161505, 161506, 161507, 
+    161508, 161509, 161510, 161511, 161512, 161513, 161514, 161515, 161516, 
+    161517, 161518, 161519, 161520, 161521, 161522, 161523, 161524, 161525, 
+    161526, 161527, 161528, 161529, 161530, 161531, 161532, 161533, 161534, 
+    161535, 161536, 161537, 161538, 161539, 161540, 161541, 161542, 161543, 
+    161544, 161545, 161546, 161547, 161548, 161549, 161550, 161551, 161552, 
+    161553, 161554, 161555, 161556, 161557, 161558, 161559, 161560, 161561, 
+    161562, 161563, 161564, 161565, 161566, 161567, 161568, 161569, 161570, 
+    161571, 161572, 161573, 161574, 161575, 161576, 161577, 161578, 161579, 
+    161580, 161581, 161582, 161583, 161584, 161585, 161586, 161587, 161588, 
+    161589, 161590, 161591, 161592, 161593, 161594, 161595, 161596, 161597, 
+    161598, 161599, 161600, 161601, 161602, 161603, 161604, 161605, 161606, 
+    161607, 161608, 161609, 161610, 161611, 161612, 161613, 161614, 161615, 
+    161616, 161617, 161618, 161619, 161620, 161621, 161622, 161623, 161624, 
+    161625, 161626, 161627, 161628, 161629, 161630, 161631, 161632, 161633, 
+    161634, 161635, 161636, 161637, 161638, 161639, 161640, 161641, 161642, 
+    161643, 161644, 161645, 161646, 161647, 161648, 161649, 161650, 161651, 
+    161652, 161653, 161654, 161655, 161656, 161657, 161658, 161659, 161660, 
+    161661, 161662, 161663, 161664, 161665, 161666, 161667, 161668, 161669, 
+    161670, 161671, 161672, 161673, 161674, 161675, 161676, 161677, 161678, 
+    161679, 161680, 161681, 161682, 161683, 161684, 161685, 161686, 161687, 
+    161688, 161689, 161690, 161691, 161692, 161693, 161694, 161695, 161696, 
+    161697, 161698, 161699, 161700, 161701, 161702, 161703, 161704, 161705, 
+    161706, 161707, 161708, 161709, 161710, 161711, 161712, 161713, 161714, 
+    161715, 161716, 161717, 161718, 161719, 161720, 161721, 161722, 161723, 
+    161724, 161725, 161726, 161727, 161728, 161729, 161730, 161731, 161732, 
+    161733, 161734, 161735, 161736, 161737, 161738, 161739, 161740, 161741, 
+    161742, 161743, 161744, 161745, 161746, 161747, 161748, 161749, 161750, 
+    161751, 161752, 161753, 161754, 161755, 161756, 161757, 161758, 161759, 
+    161760, 161761, 161762, 161763, 161764, 161765, 161766, 161767, 161768, 
+    161769, 161770, 161771, 161772, 161773, 161774, 161775, 161776, 161777, 
+    161778, 161779, 161780, 161781, 161782, 161783, 161784, 161785, 161786, 
+    161787, 161788, 161789, 161790, 161791, 161792, 161793, 161794, 161795, 
+    161796, 161797, 161798, 161799, 161800, 161801, 161802, 161803, 161804, 
+    161805, 161806, 161807, 161808, 161809, 161810, 161811, 161812, 161813, 
+    161814, 161815, 161816, 161817, 161818, 161819, 161820, 161821, 161822, 
+    161823, 161824, 161825, 161826, 161827, 161828, 161829, 161830, 161831, 
+    161832, 161833, 161834, 161835, 161836, 161837, 161838, 161839, 161840, 
+    161841, 161842, 161843, 161844, 161845, 161846, 161847, 161848, 161849, 
+    161850, 161851, 161852, 161853, 161854, 161855, 161856, 161857, 161858, 
+    161859, 161860, 161861, 161862, 161863, 161864, 161865, 161866, 161867, 
+    161868, 161869, 161870, 161871, 161872, 161873, 161874, 161875, 161876, 
+    161877, 161878, 161879, 161880, 161881, 161882, 161883, 161884, 161885, 
+    161886, 161887, 161888, 161889, 161890, 161891, 161892, 161893, 161894, 
+    161895, 161896, 161897, 161898, 161899, 161900, 161901, 161902, 161903, 
+    161904, 161905, 161906, 161907, 161908, 161909, 161910, 161911, 161912, 
+    161913, 161914, 161915, 161916, 161917, 161918, 161919, 161920, 161921, 
+    161922, 161923, 161924, 161925, 161926, 161927, 161928, 161929, 161930, 
+    161931, 161932, 161933, 161934, 161935, 161936, 161937, 161938, 161939, 
+    161940, 161941, 161942, 161943, 161944, 161945, 161946, 161947, 161948, 
+    161949, 161950, 161951, 161952, 161953, 161954, 161955, 161956, 161957, 
+    161958, 161959, 161960, 161961, 161962, 161963, 161964, 161965, 161966, 
+    161967, 161968, 161969, 161970, 161971, 161972, 161973, 161974, 161975, 
+    161976, 161977, 161978, 161979, 161980, 161981, 161982, 161983, 161984, 
+    161985, 161986, 161987, 161988, 161989, 161990, 161991, 161992, 161993, 
+    161994, 161995, 161996, 161997, 161998, 161999, 162000, 162001, 162002, 
+    162003, 162004, 162005, 162006, 162007, 162008, 162009, 162010, 162011, 
+    162012, 162013, 162014, 162015, 162016, 162017, 162018, 162019, 162020, 
+    162021, 162022, 162023, 162024, 162025, 162026, 162027, 162028, 162029, 
+    162030, 162031, 162032, 162033, 162034, 162035, 162036, 162037, 162038, 
+    162039, 162040, 162041, 162042, 162043, 162044, 162045, 162046, 162047, 
+    162048, 162049, 162050, 162051, 162052, 162053, 162054, 162055, 162056, 
+    162057, 162058, 162059, 162060, 162061, 162062, 162063, 162064, 162065, 
+    162066, 162067, 162068, 162069, 162070, 162071, 162072, 162073, 162074, 
+    162075, 162076, 162077, 162078, 162079, 162080, 162081, 162082, 162083, 
+    162084, 162085, 162086, 162087, 162088, 162089, 162090, 162091, 162092, 
+    162093, 162094, 162095, 162096, 162097, 162098, 162099, 162100, 162101, 
+    162102, 162103, 162104, 162105, 162106, 162107, 162108, 162109, 162110, 
+    162111, 162112, 162113, 162114, 162115, 162116, 162117, 162118, 162119, 
+    162120, 162121, 162122, 162123, 162124, 162125, 162126, 162127, 162128, 
+    162129, 162130, 162131, 162132, 162133, 162134, 162135, 162136, 162137, 
+    162138, 162139, 162140, 162141, 162142, 162143, 162144, 162145, 162146, 
+    162147, 162148, 162149, 162150, 162151, 162152, 162153, 162154, 162155, 
+    162156, 162157, 162158, 162159, 162160, 162161, 162162, 162163, 162164, 
+    162165, 162166, 162167, 162168, 162169, 162170, 162171, 162172, 162173, 
+    162174, 162175, 162176, 162177, 162178, 162179, 162180, 162181, 162182, 
+    162183, 162184, 162185, 162186, 162187, 162188, 162189, 162190, 162191, 
+    162192, 162193, 162194, 162195, 162196, 162197, 162198, 162199, 162200, 
+    162201, 162202, 162203, 162204, 162205, 162206, 162207, 162208, 162209, 
+    162210, 162211, 162212, 162213, 162214, 162215, 162216, 162217, 162218, 
+    162219, 162220, 162221, 162222, 162223, 162224, 162225, 162226, 162227, 
+    162228, 162229, 162230, 162231, 162232, 162233, 162234, 162235, 162236, 
+    162237, 162238, 162239, 162240, 162241, 162242, 162243, 162244, 162245, 
+    162246, 162247, 162248, 162249, 162250, 162251, 162252, 162253, 162254, 
+    162255, 162256, 162257, 162258, 162259, 162260, 162261, 162262, 162263, 
+    162264, 162265, 162266, 162267, 162268, 162269, 162270, 162271, 162272, 
+    162273, 162274, 162275, 162276, 162277, 162278, 162279, 162280, 162281, 
+    162282, 162283, 162284, 162285, 162286, 162287, 162288, 162289, 162290, 
+    162291, 162292, 162293, 162294, 162295, 162296, 162297, 162298, 162299, 
+    162300, 162301, 162302, 162303, 162304, 162305, 162306, 162307, 162308, 
+    162309, 162310, 162311, 162312, 162313, 162314, 162315, 162316, 162317, 
+    162318, 162319, 162320, 162321, 162322, 162323, 162324, 162325, 162326, 
+    162327, 162328, 162329, 162330, 162331, 162332, 162333, 162334, 162335, 
+    162336, 162337, 162338, 162339, 162340, 162341, 162342, 162343, 162344, 
+    162345, 162346, 162347, 162348, 162349, 162350, 162351, 162352, 162353, 
+    162354, 162355, 162356, 162357, 162358, 162359, 162360, 162361, 162362, 
+    162363, 162364, 162365, 162366, 162367, 162368, 162369, 162370, 162371, 
+    162372, 162373, 162374, 162375, 162376, 162377, 162378, 162379, 162380, 
+    162381, 162382, 162383, 162384, 162385, 162386, 162387, 162388, 162389, 
+    162390, 162391, 162392, 162393, 162394, 162395, 162396, 162397, 162398, 
+    162399, 162400, 162401, 162402, 162403, 162404, 162405, 162406, 162407, 
+    162408, 162409, 162410, 162411, 162412, 162413, 162414, 162415, 162416, 
+    162417, 162418, 162419, 162420, 162421, 162422, 162423, 162424, 162425, 
+    162426, 162427, 162428, 162429, 162430, 162431, 162432, 162433, 162434, 
+    162435, 162436, 162437, 162438, 162439, 162440, 162441, 162442, 162443, 
+    162444, 162445, 162446, 162447, 162448, 162449, 162450, 162451, 162452, 
+    162453, 162454, 162455, 162456, 162457, 162458, 162459, 162460, 162461, 
+    162462, 162463, 162464, 162465, 162466, 162467, 162468, 162469, 162470, 
+    162471, 162472, 162473, 162474, 162475, 162476, 162477, 162478, 162479, 
+    162480, 162481, 162482, 162483, 162484, 162485, 162486, 162487, 162488, 
+    162489, 162490, 162491, 162492, 162493, 162494, 162495, 162496, 162497, 
+    162498, 162499, 162500, 162501, 162502, 162503, 162504, 162505, 162506, 
+    162507, 162508, 162509, 162510, 162511, 162512, 162513, 162514, 162515, 
+    162516, 162517, 162518, 162519, 162520, 162521, 162522, 162523, 162524, 
+    162525, 162526, 162527, 162528, 162529, 162530, 162531, 162532, 162533, 
+    162534, 162535, 162536, 162537, 162538, 162539, 162540, 162541, 162542, 
+    162543, 162544, 162545, 162546, 162547, 162548, 162549, 162550, 162551, 
+    162552, 162553, 162554, 162555, 162556, 162557, 162558, 162559, 162560, 
+    162561, 162562, 162563, 162564, 162565, 162566, 162567, 162568, 162569, 
+    162570, 162571, 162572, 162573, 162574, 162575, 162576, 162577, 162578, 
+    162579, 162580, 162581, 162582, 162583, 162584, 162585, 162586, 162587, 
+    162588, 162589, 162590, 162591, 162592, 162593, 162594, 162595, 162596, 
+    162597, 162598, 162599, 162600, 162601, 162602, 162603, 162604, 162605, 
+    162606, 162607, 162608, 162609, 162610, 162611, 162612, 162613, 162614, 
+    162615, 162616, 162617, 162618, 162619, 162620, 162621, 162622, 162623, 
+    162624, 162625, 162626, 162627, 162628, 162629, 162630, 162631, 162632, 
+    162633, 162634, 162635, 162636, 162637, 162638, 162639, 162640, 162641, 
+    162642, 162643, 162644, 162645, 162646, 162647, 162648, 162649, 162650, 
+    162651, 162652, 162653, 162654, 162655, 162656, 162657, 162658, 162659, 
+    162660, 162661, 162662, 162663, 162664, 162665, 162666, 162667, 162668, 
+    162669, 162670, 162671, 162672, 162673, 162674, 162675, 162676, 162677, 
+    162678, 162679, 162680, 162681, 162682, 162683, 162684, 162685, 162686, 
+    162687, 162688, 162689, 162690, 162691, 162692, 162693, 162694, 162695, 
+    162696, 162697, 162698, 162699, 162700, 162701, 162702, 162703, 162704, 
+    162705, 162706, 162707, 162708, 162709, 162710, 162711, 162712, 162713, 
+    162714, 162715, 162716, 162717, 162718, 162719, 162720, 162721, 162722, 
+    162723, 162724, 162725, 162726, 162727, 162728, 162729, 162730, 162731, 
+    162732, 162733, 162734, 162735, 162736, 162737, 162738, 162739, 162740, 
+    162741, 162742, 162743, 162744, 162745, 162746, 162747, 162748, 162749, 
+    162750, 162751, 162752, 162753, 162754, 162755, 162756, 162757, 162758, 
+    162759, 162760, 162761, 162762, 162763, 162764, 162765, 162766, 162767, 
+    162768, 162769, 162770, 162771, 162772, 162773, 162774, 162775, 162776, 
+    162777, 162778, 162779, 162780, 162781, 162782, 162783, 162784, 162785, 
+    162786, 162787, 162788, 162789, 162790, 162791, 162792, 162793, 162794, 
+    162795, 162796, 162797, 162798, 162799, 162800, 162801, 162802, 162803, 
+    162804, 162805, 162806, 162807, 162808, 162809, 162810, 162811, 162812, 
+    162813, 162814, 162815, 162816, 162817, 162818, 162819, 162820, 162821, 
+    162822, 162823, 162824, 162825, 162826, 162827, 162828, 162829, 162830, 
+    162831, 162832, 162833, 162834, 162835, 162836, 162837, 162838, 162839, 
+    162840, 162841, 162842, 162843, 162844, 162845, 162846, 162847, 162848, 
+    162849, 162850, 162851, 162852, 162853, 162854, 162855, 162856, 162857, 
+    162858, 162859, 162860, 162861, 162862, 162863, 162864, 162865, 162866, 
+    162867, 162868, 162869, 162870, 162871, 162872, 162873, 162874, 162875, 
+    162876, 162877, 162878, 162879, 162880, 162881, 162882, 162883, 162884, 
+    162885, 162886, 162887, 162888, 162889, 162890, 162891, 162892, 162893, 
+    162894, 162895, 162896, 162897, 162898, 162899, 162900, 162901, 162902, 
+    162903, 162904, 162905, 162906, 162907, 162908, 162909, 162910, 162911, 
+    162912, 162913, 162914, 162915, 162916, 162917, 162918, 162919, 162920, 
+    162921, 162922, 162923, 162924, 162925, 162926, 162927, 162928, 162929, 
+    162930, 162931, 162932, 162933, 162934, 162935, 162936, 162937, 162938, 
+    162939, 162940, 162941, 162942, 162943, 162944, 162945, 162946, 162947, 
+    162948, 162949, 162950, 162951, 162952, 162953, 162954, 162955, 162956, 
+    162957, 162958, 162959, 162960, 162961, 162962, 162963, 162964, 162965, 
+    162966, 162967, 162968, 162969, 162970, 162971, 162972, 162973, 162974, 
+    162975, 162976, 162977, 162978, 162979, 162980, 162981, 162982, 162983, 
+    162984, 162985, 162986, 162987, 162988, 162989, 162990, 162991, 162992, 
+    162993, 162994, 162995, 162996, 162997, 162998, 162999, 163000, 163001, 
+    163002, 163003, 163004, 163005, 163006, 163007, 163008, 163009, 163010, 
+    163011, 163012, 163013, 163014, 163015, 163016, 163017, 163018, 163019, 
+    163020, 163021, 163022, 163023, 163024, 163025, 163026, 163027, 163028, 
+    163029, 163030, 163031, 163032, 163033, 163034, 163035, 163036, 163037, 
+    163038, 163039, 163040, 163041, 163042, 163043, 163044, 163045, 163046, 
+    163047, 163048, 163049, 163050, 163051, 163052, 163053, 163054, 163055, 
+    163056, 163057, 163058, 163059, 163060, 163061, 163062, 163063, 163064, 
+    163065, 163066, 163067, 163068, 163069, 163070, 163071, 163072, 163073, 
+    163074, 163075, 163076, 163077, 163078, 163079, 163080, 163081, 163082, 
+    163083, 163084, 163085, 163086, 163087, 163088, 163089, 163090, 163091, 
+    163092, 163093, 163094, 163095, 163096, 163097, 163098, 163099, 163100, 
+    163101, 163102, 163103, 163104, 163105, 163106, 163107, 163108, 163109, 
+    163110, 163111, 163112, 163113, 163114, 163115, 163116, 163117, 163118, 
+    163119, 163120, 163121, 163122, 163123, 163124, 163125, 163126, 163127, 
+    163128, 163129, 163130, 163131, 163132, 163133, 163134, 163135, 163136, 
+    163137, 163138, 163139, 163140, 163141, 163142, 163143, 163144, 163145, 
+    163146, 163147, 163148, 163149, 163150, 163151, 163152, 163153, 163154, 
+    163155, 163156, 163157, 163158, 163159, 163160, 163161, 163162, 163163, 
+    163164, 163165, 163166, 163167, 163168, 163169, 163170, 163171, 163172, 
+    163173, 163174, 163175, 163176, 163177, 163178, 163179, 163180, 163181, 
+    163182, 163183, 163184, 163185, 163186, 163187, 163188, 163189, 163190, 
+    163191, 163192, 163193, 163194, 163195, 163196, 163197, 163198, 163199, 
+    163200, 163201, 163202, 163203, 163204, 163205, 163206, 163207, 163208, 
+    163209, 163210, 163211, 163212, 163213, 163214, 163215, 163216, 163217, 
+    163218, 163219, 163220, 163221, 163222, 163223, 163224, 163225, 163226, 
+    163227, 163228, 163229, 163230, 163231, 163232, 163233, 163234, 163235, 
+    163236, 163237, 163238, 163239, 163240, 163241, 163242, 163243, 163244, 
+    163245, 163246, 163247, 163248, 163249, 163250, 163251, 163252, 163253, 
+    163254, 163255, 163256, 163257, 163258, 163259, 163260, 163261, 163262, 
+    163263, 163264, 163265, 163266, 163267, 163268, 163269, 163270, 163271, 
+    163272, 163273, 163274, 163275, 163276, 163277, 163278, 163279, 163280, 
+    163281, 163282, 163283, 163284, 163285, 163286, 163287, 163288, 163289, 
+    163290, 163291, 163292, 163293, 163294, 163295, 163296, 163297, 163298, 
+    163299, 163300, 163301, 163302, 163303, 163304, 163305, 163306, 163307, 
+    163308, 163309, 163310, 163311, 163312, 163313, 163314, 163315, 163316, 
+    163317, 163318, 163319, 163320, 163321, 163322, 163323, 163324, 163325, 
+    163326, 163327, 163328, 163329, 163330, 163331, 163332, 163333, 163334, 
+    163335, 163336, 163337, 163338, 163339, 163340, 163341, 163342, 163343, 
+    163344, 163345, 163346, 163347, 163348, 163349, 163350, 163351, 163352, 
+    163353, 163354, 163355, 163356, 163357, 163358, 163359, 163360, 163361, 
+    163362, 163363, 163364, 163365, 163366, 163367, 163368, 163369, 163370, 
+    163371, 163372, 163373, 163374, 163375, 163376, 163377, 163378, 163379, 
+    163380, 163381, 163382, 163383, 163384, 163385, 163386, 163387, 163388, 
+    163389, 163390, 163391, 163392, 163393, 163394, 163395, 163396, 163397, 
+    163398, 163399, 163400, 163401, 163402, 163403, 163404, 163405, 163406, 
+    163407, 163408, 163409, 163410, 163411, 163412, 163413, 163414, 163415, 
+    163416, 163417, 163418, 163419, 163420, 163421, 163422, 163423, 163424, 
+    163425, 163426, 163427, 163428, 163429, 163430, 163431, 163432, 163433, 
+    163434, 163435, 163436, 163437, 163438, 163439, 163440, 163441, 163442, 
+    163443, 163444, 163445, 163446, 163447, 163448, 163449, 163450, 163451, 
+    163452, 163453, 163454, 163455, 163456, 163457, 163458, 163459, 163460, 
+    163461, 163462, 163463, 163464, 163465, 163466, 163467, 163468, 163469, 
+    163470, 163471, 163472, 163473, 163474, 163475, 163476, 163477, 163478, 
+    163479, 163480, 163481, 163482, 163483, 163484, 163485, 163486, 163487, 
+    163488, 163489, 163490, 163491, 163492, 163493, 163494, 163495, 163496, 
+    163497, 163498, 163499, 163500, 163501, 163502, 163503, 163504, 163505, 
+    163506, 163507, 163508, 163509, 163510, 163511, 163512, 163513, 163514, 
+    163515, 163516, 163517, 163518, 163519, 163520, 163521, 163522, 163523, 
+    163524, 163525, 163526, 163527, 163528, 163529, 163530, 163531, 163532, 
+    163533, 163534, 163535, 163536, 163537, 163538, 163539, 163540, 163541, 
+    163542, 163543, 163544, 163545, 163546, 163547, 163548, 163549, 163550, 
+    163551, 163552, 163553, 163554, 163555, 163556, 163557, 163558, 163559, 
+    163560, 163561, 163562, 163563, 163564, 163565, 163566, 163567, 163568, 
+    163569, 163570, 163571, 163572, 163573, 163574, 163575, 163576, 163577, 
+    163578, 163579, 163580, 163581, 163582, 163583, 163584, 163585, 163586, 
+    163587, 163588, 163589, 163590, 163591, 163592, 163593, 163594, 163595, 
+    163596, 163597, 163598, 163599, 163600, 163601, 163602, 163603, 163604, 
+    163605, 163606, 163607, 163608, 163609, 163610, 163611, 163612, 163613, 
+    163614, 163615, 163616, 163617, 163618, 163619, 163620, 163621, 163622, 
+    163623, 163624, 163625, 163626, 163627, 163628, 163629, 163630, 163631, 
+    163632, 163633, 163634, 163635, 163636, 163637, 163638, 163639, 163640, 
+    163641, 163642, 163643, 163644, 163645, 163646, 163647, 163648, 163649, 
+    163650, 163651, 163652, 163653, 163654, 163655, 163656, 163657, 163658, 
+    163659, 163660, 163661, 163662, 163663, 163664, 163665, 163666, 163667, 
+    163668, 163669, 163670, 163671, 163672, 163673, 163674, 163675, 163676, 
+    163677, 163678, 163679, 163680, 163681, 163682, 163683, 163684, 163685, 
+    163686, 163687, 163688, 163689, 163690, 163691, 163692, 163693, 163694, 
+    163695, 163696, 163697, 163698, 163699, 163700, 163701, 163702, 163703, 
+    163704, 163705, 163706, 163707, 163708, 163709, 163710, 163711, 163712, 
+    163713, 163714, 163715, 163716, 163717, 163718, 163719, 163720, 163721, 
+    163722, 163723, 163724, 163725, 163726, 163727, 163728, 163729, 163730, 
+    163731, 163732, 163733, 163734, 163735, 163736, 163737, 163738, 163739, 
+    163740, 163741, 163742, 163743, 163744, 163745, 163746, 163747, 163748, 
+    163749, 163750, 163751, 163752, 163753, 163754, 163755, 163756, 163757, 
+    163758, 163759, 163760, 163761, 163762, 163763, 163764, 163765, 163766, 
+    163767, 163768, 163769, 163770, 163771, 163772, 163773, 163774, 163775, 
+    163776, 163777, 163778, 163779, 163780, 163781, 163782, 163783, 163784, 
+    163785, 163786, 163787, 163788, 163789, 163790, 163791, 163792, 163793, 
+    163794, 163795, 163796, 163797, 163798, 163799, 163800, 163801, 163802, 
+    163803, 163804, 163805, 163806, 163807, 163808, 163809, 163810, 163811, 
+    163812, 163813, 163814, 163815, 163816, 163817, 163818, 163819, 163820, 
+    163821, 163822, 163823, 163824, 163825, 163826, 163827, 163828, 163829, 
+    163830, 163831, 163832, 163833, 163834, 163835, 163836, 163837, 163838, 
+    163839, 163840, 163841, 163842, 163843, 163844, 163845, 163846, 163847, 
+    163848, 163849, 163850, 163851, 163852, 163853, 163854, 163855, 163856, 
+    163857, 163858, 163859, 163860, 163861, 163862, 163863, 163864, 163865, 
+    163866, 163867, 163868, 163869, 163870, 163871, 163872, 163873, 163874, 
+    163875, 163876, 163877, 163878, 163879, 163880, 163881, 163882, 163883, 
+    163884, 163885, 163886, 163887, 163888, 163889, 163890, 163891, 163892, 
+    163893, 163894, 163895, 163896, 163897, 163898, 163899, 163900, 163901, 
+    163902, 163903, 163904, 163905, 163906, 163907, 163908, 163909, 163910, 
+    163911, 163912, 163913, 163914, 163915, 163916, 163917, 163918, 163919, 
+    163920, 163921, 163922, 163923, 163924, 163925, 163926, 163927, 163928, 
+    163929, 163930, 163931, 163932, 163933, 163934, 163935, 163936, 163937, 
+    163938, 163939, 163940, 163941, 163942, 163943, 163944, 163945, 163946, 
+    163947, 163948, 163949, 163950, 163951, 163952, 163953, 163954, 163955, 
+    163956, 163957, 163958, 163959, 163960, 163961, 163962, 163963, 163964, 
+    163965, 163966, 163967, 163968, 163969, 163970, 163971, 163972, 163973, 
+    163974, 163975, 163976, 163977, 163978, 163979, 163980, 163981, 163982, 
+    163983, 163984, 163985, 163986, 163987, 163988, 163989, 163990, 163991, 
+    163992, 163993, 163994, 163995, 163996, 163997, 163998, 163999, 164000, 
+    164001, 164002, 164003, 164004, 164005, 164006, 164007, 164008, 164009, 
+    164010, 164011, 164012, 164013, 164014, 164015, 164016, 164017, 164018, 
+    164019, 164020, 164021, 164022, 164023, 164024, 164025, 164026, 164027, 
+    164028, 164029, 164030, 164031, 164032, 164033, 164034, 164035, 164036, 
+    164037, 164038, 164039, 164040, 164041, 164042, 164043, 164044, 164045, 
+    164046, 164047, 164048, 164049, 164050, 164051, 164052, 164053, 164054, 
+    164055, 164056, 164057, 164058, 164059, 164060, 164061, 164062, 164063, 
+    164064, 164065, 164066, 164067, 164068, 164069, 164070, 164071, 164072, 
+    164073, 164074, 164075, 164076, 164077, 164078, 164079, 164080, 164081, 
+    164082, 164083, 164084, 164085, 164086, 164087, 164088, 164089, 164090, 
+    164091, 164092, 164093, 164094, 164095, 164096, 164097, 164098, 164099, 
+    164100, 164101, 164102, 164103, 164104, 164105, 164106, 164107, 164108, 
+    164109, 164110, 164111, 164112, 164113, 164114, 164115, 164116, 164117, 
+    164118, 164119, 164120, 164121, 164122, 164123, 164124, 164125, 164126, 
+    164127, 164128, 164129, 164130, 164131, 164132, 164133, 164134, 164135, 
+    164136, 164137, 164138, 164139, 164140, 164141, 164142, 164143, 164144, 
+    164145, 164146, 164147, 164148, 164149, 164150, 164151, 164152, 164153, 
+    164154, 164155, 164156, 164157, 164158, 164159, 164160, 164161, 164162, 
+    164163, 164164, 164165, 164166, 164167, 164168, 164169, 164170, 164171, 
+    164172, 164173, 164174, 164175, 164176, 164177, 164178, 164179, 164180, 
+    164181, 164182, 164183, 164184, 164185, 164186, 164187, 164188, 164189, 
+    164190, 164191, 164192, 164193, 164194, 164195, 164196, 164197, 164198, 
+    164199, 164200, 164201, 164202, 164203, 164204, 164205, 164206, 164207, 
+    164208, 164209, 164210, 164211, 164212, 164213, 164214, 164215, 164216, 
+    164217, 164218, 164219, 164220, 164221, 164222, 164223, 164224, 164225, 
+    164226, 164227, 164228, 164229, 164230, 164231, 164232, 164233, 164234, 
+    164235, 164236, 164237, 164238, 164239, 164240, 164241, 164242, 164243, 
+    164244, 164245, 164246, 164247, 164248, 164249, 164250, 164251, 164252, 
+    164253, 164254, 164255, 164256, 164257, 164258, 164259, 164260, 164261, 
+    164262, 164263, 164264, 164265, 164266, 164267, 164268, 164269, 164270, 
+    164271, 164272, 164273, 164274, 164275, 164276, 164277, 164278, 164279, 
+    164280, 164281, 164282, 164283, 164284, 164285, 164286, 164287, 164288, 
+    164289, 164290, 164291, 164292, 164293, 164294, 164295, 164296, 164297, 
+    164298, 164299, 164300, 164301, 164302, 164303, 164304, 164305, 164306, 
+    164307, 164308, 164309, 164310, 164311, 164312, 164313, 164314, 164315, 
+    164316, 164317, 164318, 164319, 164320, 164321, 164322, 164323, 164324, 
+    164325, 164326, 164327, 164328, 164329, 164330, 164331, 164332, 164333, 
+    164334, 164335, 164336, 164337, 164338, 164339, 164340, 164341, 164342, 
+    164343, 164344, 164345, 164346, 164347, 164348, 164349, 164350, 164351, 
+    164352, 164353, 164354, 164355, 164356, 164357, 164358, 164359, 164360, 
+    164361, 164362, 164363, 164364, 164365, 164366, 164367, 164368, 164369, 
+    164370, 164371, 164372, 164373, 164374, 164375, 164376, 164377, 164378, 
+    164379, 164380, 164381, 164382, 164383, 164384, 164385, 164386, 164387, 
+    164388, 164389, 164390, 164391, 164392, 164393, 164394, 164395, 164396, 
+    164397, 164398, 164399, 164400, 164401, 164402, 164403, 164404, 164405, 
+    164406, 164407, 164408, 164409, 164410, 164411, 164412, 164413, 164414, 
+    164415, 164416, 164417, 164418, 164419, 164420, 164421, 164422, 164423, 
+    164424, 164425, 164426, 164427, 164428, 164429, 164430, 164431, 164432, 
+    164433, 164434, 164435, 164436, 164437, 164438, 164439, 164440, 164441, 
+    164442, 164443, 164444, 164445, 164446, 164447, 164448, 164449, 164450, 
+    164451, 164452, 164453, 164454, 164455, 164456, 164457, 164458, 164459, 
+    164460, 164461, 164462, 164463, 164464, 164465, 164466, 164467, 164468, 
+    164469, 164470, 164471, 164472, 164473, 164474, 164475, 164476, 164477, 
+    164478, 164479, 164480, 164481, 164482, 164483, 164484, 164485, 164486, 
+    164487, 164488, 164489, 164490, 164491, 164492, 164493, 164494, 164495, 
+    164496, 164497, 164498, 164499, 164500, 164501, 164502, 164503, 164504, 
+    164505, 164506, 164507, 164508, 164509, 164510, 164511, 164512, 164513, 
+    164514, 164515, 164516, 164517, 164518, 164519, 164520, 164521, 164522, 
+    164523, 164524, 164525, 164526, 164527, 164528, 164529, 164530, 164531, 
+    164532, 164533, 164534, 164535, 164536, 164537, 164538, 164539, 164540, 
+    164541, 164542, 164543, 164544, 164545, 164546, 164547, 164548, 164549, 
+    164550, 164551, 164552, 164553, 164554, 164555, 164556, 164557, 164558, 
+    164559, 164560, 164561, 164562, 164563, 164564, 164565, 164566, 164567, 
+    164568, 164569, 164570, 164571, 164572, 164573, 164574, 164575, 164576, 
+    164577, 164578, 164579, 164580, 164581, 164582, 164583, 164584, 164585, 
+    164586, 164587, 164588, 164589, 164590, 164591, 164592, 164593, 164594, 
+    164595, 164596, 164597, 164598, 164599, 164600, 164601, 164602, 164603, 
+    164604, 164605, 164606, 164607, 164608, 164609, 164610, 164611, 164612, 
+    164613, 164614, 164615, 164616, 164617, 164618, 164619, 164620, 164621, 
+    164622, 164623, 164624, 164625, 164626, 164627, 164628, 164629, 164630, 
+    164631, 164632, 164633, 164634, 164635, 164636, 164637, 164638, 164639, 
+    164640, 164641, 164642, 164643, 164644, 164645, 164646, 164647, 164648, 
+    164649, 164650, 164651, 164652, 164653, 164654, 164655, 164656, 164657, 
+    164658, 164659, 164660, 164661, 164662, 164663, 164664, 164665, 164666, 
+    164667, 164668, 164669, 164670, 164671, 164672, 164673, 164674, 164675, 
+    164676, 164677, 164678, 164679, 164680, 164681, 164682, 164683, 164684, 
+    164685, 164686, 164687, 164688, 164689, 164690, 164691, 164692, 164693, 
+    164694, 164695, 164696, 164697, 164698, 164699, 164700, 164701, 164702, 
+    164703, 164704, 164705, 164706, 164707, 164708, 164709, 164710, 164711, 
+    164712, 164713, 164714, 164715, 164716, 164717, 164718, 164719, 164720, 
+    164721, 164722, 164723, 164724, 164725, 164726, 164727, 164728, 164729, 
+    164730, 164731, 164732, 164733, 164734, 164735, 164736, 164737, 164738, 
+    164739, 164740, 164741, 164742, 164743, 164744, 164745, 164746, 164747, 
+    164748, 164749, 164750, 164751, 164752, 164753, 164754, 164755, 164756, 
+    164757, 164758, 164759, 164760, 164761, 164762, 164763, 164764, 164765, 
+    164766, 164767, 164768, 164769, 164770, 164771, 164772, 164773, 164774, 
+    164775, 164776, 164777, 164778, 164779, 164780, 164781, 164782, 164783, 
+    164784, 164785, 164786, 164787, 164788, 164789, 164790, 164791, 164792, 
+    164793, 164794, 164795, 164796, 164797, 164798, 164799, 164800, 164801, 
+    164802, 164803, 164804, 164805, 164806, 164807, 164808, 164809, 164810, 
+    164811, 164812, 164813, 164814, 164815, 164816, 164817, 164818, 164819, 
+    164820, 164821, 164822, 164823, 164824, 164825, 164826, 164827, 164828, 
+    164829, 164830, 164831, 164832, 164833, 164834, 164835, 164836, 164837, 
+    164838, 164839, 164840, 164841, 164842, 164843, 164844, 164845, 164846, 
+    164847, 164848, 164849, 164850, 164851, 164852, 164853, 164854, 164855, 
+    164856, 164857, 164858, 164859, 164860, 164861, 164862, 164863, 164864, 
+    164865, 164866, 164867, 164868, 164869, 164870, 164871, 164872, 164873, 
+    164874, 164875, 164876, 164877, 164878, 164879, 164880, 164881, 164882, 
+    164883, 164884, 164885, 164886, 164887, 164888, 164889, 164890, 164891, 
+    164892, 164893, 164894, 164895, 164896, 164897, 164898, 164899, 164900, 
+    164901, 164902, 164903, 164904, 164905, 164906, 164907, 164908, 164909, 
+    164910, 164911, 164912, 164913, 164914, 164915, 164916, 164917, 164918, 
+    164919, 164920, 164921, 164922, 164923, 164924, 164925, 164926, 164927, 
+    164928, 164929, 164930, 164931, 164932, 164933, 164934, 164935, 164936, 
+    164937, 164938, 164939, 164940, 164941, 164942, 164943, 164944, 164945, 
+    164946, 164947, 164948, 164949, 164950, 164951, 164952, 164953, 164954, 
+    164955, 164956, 164957, 164958, 164959, 164960, 164961, 164962, 164963, 
+    164964, 164965, 164966, 164967, 164968, 164969, 164970, 164971, 164972, 
+    164973, 164974, 164975, 164976, 164977, 164978, 164979, 164980, 164981, 
+    164982, 164983, 164984, 164985, 164986, 164987, 164988, 164989, 164990, 
+    164991, 164992, 164993, 164994, 164995, 164996, 164997, 164998, 164999, 
+    165000, 165001, 165002, 165003, 165004, 165005, 165006, 165007, 165008, 
+    165009, 165010, 165011, 165012, 165013, 165014, 165015, 165016, 165017, 
+    165018, 165019, 165020, 165021, 165022, 165023, 165024, 165025, 165026, 
+    165027, 165028, 165029, 165030, 165031, 165032, 165033, 165034, 165035, 
+    165036, 165037, 165038, 165039, 165040, 165041, 165042, 165043, 165044, 
+    165045, 165046, 165047, 165048, 165049, 165050, 165051, 165052, 165053, 
+    165054, 165055, 165056, 165057, 165058, 165059, 165060, 165061, 165062, 
+    165063, 165064, 165065, 165066, 165067, 165068, 165069, 165070, 165071, 
+    165072, 165073, 165074, 165075, 165076, 165077, 165078, 165079, 165080, 
+    165081, 165082, 165083, 165084, 165085, 165086, 165087, 165088, 165089, 
+    165090, 165091, 165092, 165093, 165094, 165095, 165096, 165097, 165098, 
+    165099, 165100, 165101, 165102, 165103, 165104, 165105, 165106, 165107, 
+    165108, 165109, 165110, 165111, 165112, 165113, 165114, 165115, 165116, 
+    165117, 165118, 165119, 165120, 165121, 165122, 165123, 165124, 165125, 
+    165126, 165127, 165128, 165129, 165130, 165131, 165132, 165133, 165134, 
+    165135, 165136, 165137, 165138, 165139, 165140, 165141, 165142, 165143, 
+    165144, 165145, 165146, 165147, 165148, 165149, 165150, 165151, 165152, 
+    165153, 165154, 165155, 165156, 165157, 165158, 165159, 165160, 165161, 
+    165162, 165163, 165164, 165165, 165166, 165167, 165168, 165169, 165170, 
+    165171, 165172, 165173, 165174, 165175, 165176, 165177, 165178, 165179, 
+    165180, 165181, 165182, 165183, 165184, 165185, 165186, 165187, 165188, 
+    165189, 165190, 165191, 165192, 165193, 165194, 165195, 165196, 165197, 
+    165198, 165199, 165200, 165201, 165202, 165203, 165204, 165205, 165206, 
+    165207, 165208, 165209, 165210, 165211, 165212, 165213, 165214, 165215, 
+    165216, 165217, 165218, 165219, 165220, 165221, 165222, 165223, 165224, 
+    165225, 165226, 165227, 165228, 165229, 165230, 165231, 165232, 165233, 
+    165234, 165235, 165236, 165237, 165238, 165239, 165240, 165241, 165242, 
+    165243, 165244, 165245, 165246, 165247, 165248, 165249, 165250, 165251, 
+    165252, 165253, 165254, 165255, 165256, 165257, 165258, 165259, 165260, 
+    165261, 165262, 165263, 165264, 165265, 165266, 165267, 165268, 165269, 
+    165270, 165271, 165272, 165273, 165274, 165275, 165276, 165277, 165278, 
+    165279, 165280, 165281, 165282, 165283, 165284, 165285, 165286, 165287, 
+    165288, 165289, 165290, 165291, 165292, 165293, 165294, 165295, 165296, 
+    165297, 165298, 165299, 165300, 165301, 165302, 165303, 165304, 165305, 
+    165306, 165307, 165308, 165309, 165310, 165311, 165312, 165313, 165314, 
+    165315, 165316, 165317, 165318, 165319, 165320, 165321, 165322, 165323, 
+    165324, 165325, 165326, 165327, 165328, 165329, 165330, 165331, 165332, 
+    165333, 165334, 165335, 165336, 165337, 165338, 165339, 165340, 165341, 
+    165342, 165343, 165344, 165345, 165346, 165347, 165348, 165349, 165350, 
+    165351, 165352, 165353, 165354, 165355, 165356, 165357, 165358, 165359, 
+    165360, 165361, 165362, 165363, 165364, 165365, 165366, 165367, 165368, 
+    165369, 165370, 165371, 165372, 165373, 165374, 165375, 165376, 165377, 
+    165378, 165379, 165380, 165381, 165382, 165383, 165384, 165385, 165386, 
+    165387, 165388, 165389, 165390, 165391, 165392, 165393, 165394, 165395, 
+    165396, 165397, 165398, 165399, 165400, 165401, 165402, 165403, 165404, 
+    165405, 165406, 165407, 165408, 165409, 165410, 165411, 165412, 165413, 
+    165414, 165415, 165416, 165417, 165418, 165419, 165420, 165421, 165422, 
+    165423, 165424, 165425, 165426, 165427, 165428, 165429, 165430, 165431, 
+    165432, 165433, 165434, 165435, 165436, 165437, 165438, 165439, 165440, 
+    165441, 165442, 165443, 165444, 165445, 165446, 165447, 165448, 165449, 
+    165450, 165451, 165452, 165453, 165454, 165455, 165456, 165457, 165458, 
+    165459, 165460, 165461, 165462, 165463, 165464, 165465, 165466, 165467, 
+    165468, 165469, 165470, 165471, 165472, 165473, 165474, 165475, 165476, 
+    165477, 165478, 165479, 165480, 165481, 165482, 165483, 165484, 165485, 
+    165486, 165487, 165488, 165489, 165490, 165491, 165492, 165493, 165494, 
+    165495, 165496, 165497, 165498, 165499, 165500, 165501, 165502, 165503, 
+    165504, 165505, 165506, 165507, 165508, 165509, 165510, 165511, 165512, 
+    165513, 165514, 165515, 165516, 165517, 165518, 165519, 165520, 165521, 
+    165522, 165523, 165524, 165525, 165526, 165527, 165528, 165529, 165530, 
+    165531, 165532, 165533, 165534, 165535, 165536, 165537, 165538, 165539, 
+    165540, 165541, 165542, 165543, 165544, 165545, 165546, 165547, 165548, 
+    165549, 165550, 165551, 165552, 165553, 165554, 165555, 165556, 165557, 
+    165558, 165559, 165560, 165561, 165562, 165563, 165564, 165565, 165566, 
+    165567, 165568, 165569, 165570, 165571, 165572, 165573, 165574, 165575, 
+    165576, 165577, 165578, 165579, 165580, 165581, 165582, 165583, 165584, 
+    165585, 165586, 165587, 165588, 165589, 165590, 165591, 165592, 165593, 
+    165594, 165595, 165596, 165597, 165598, 165599, 165600, 165601, 165602, 
+    165603, 165604, 165605, 165606, 165607, 165608, 165609, 165610, 165611, 
+    165612, 165613, 165614, 165615, 165616, 165617, 165618, 165619, 165620, 
+    165621, 165622, 165623, 165624, 165625, 165626, 165627, 165628, 165629, 
+    165630, 165631, 165632, 165633, 165634, 165635, 165636, 165637, 165638, 
+    165639, 165640, 165641, 165642, 165643, 165644, 165645, 165646, 165647, 
+    165648, 165649, 165650, 165651, 165652, 165653, 165654, 165655, 165656, 
+    165657, 165658, 165659, 165660, 165661, 165662, 165663, 165664, 165665, 
+    165666, 165667, 165668, 165669, 165670, 165671, 165672, 165673, 165674, 
+    165675, 165676, 165677, 165678, 165679, 165680, 165681, 165682, 165683, 
+    165684, 165685, 165686, 165687, 165688, 165689, 165690, 165691, 165692, 
+    165693, 165694, 165695, 165696, 165697, 165698, 165699, 165700, 165701, 
+    165702, 165703, 165704, 165705, 165706, 165707, 165708, 165709, 165710, 
+    165711, 165712, 165713, 165714, 165715, 165716, 165717, 165718, 165719, 
+    165720, 165721, 165722, 165723, 165724, 165725, 165726, 165727, 165728, 
+    165729, 165730, 165731, 165732, 165733, 165734, 165735, 165736, 165737, 
+    165738, 165739, 165740, 165741, 165742, 165743, 165744, 165745, 165746, 
+    165747, 165748, 165749, 165750, 165751, 165752, 165753, 165754, 165755, 
+    165756, 165757, 165758, 165759, 165760, 165761, 165762, 165763, 165764, 
+    165765, 165766, 165767, 165768, 165769, 165770, 165771, 165772, 165773, 
+    165774, 165775, 165776, 165777, 165778, 165779, 165780, 165781, 165782, 
+    165783, 165784, 165785, 165786, 165787, 165788, 165789, 165790, 165791, 
+    165792, 165793, 165794, 165795, 165796, 165797, 165798, 165799, 165800, 
+    165801, 165802, 165803, 165804, 165805, 165806, 165807, 165808, 165809, 
+    165810, 165811, 165812, 165813, 165814, 165815, 165816, 165817, 165818, 
+    165819, 165820, 165821, 165822, 165823, 165824, 165825, 165826, 165827, 
+    165828, 165829, 165830, 165831, 165832, 165833, 165834, 165835, 165836, 
+    165837, 165838, 165839, 165840, 165841, 165842, 165843, 165844, 165845, 
+    165846, 165847, 165848, 165849, 165850, 165851, 165852, 165853, 165854, 
+    165855, 165856, 165857, 165858, 165859, 165860, 165861, 165862, 165863, 
+    165864, 165865, 165866, 165867, 165868, 165869, 165870, 165871, 165872, 
+    165873, 165874, 165875, 165876, 165877, 165878, 165879, 165880, 165881, 
+    165882, 165883, 165884, 165885, 165886, 165887, 165888, 165889, 165890, 
+    165891, 165892, 165893, 165894, 165895, 165896, 165897, 165898, 165899, 
+    165900, 165901, 165902, 165903, 165904, 165905, 165906, 165907, 165908, 
+    165909, 165910, 165911, 165912, 165913, 165914, 165915, 165916, 165917, 
+    165918, 165919, 165920, 165921, 165922, 165923, 165924, 165925, 165926, 
+    165927, 165928, 165929, 165930, 165931, 165932, 165933, 165934, 165935, 
+    165936, 165937, 165938, 165939, 165940, 165941, 165942, 165943, 165944, 
+    165945, 165946, 165947, 165948, 165949, 165950, 165951, 165952, 165953, 
+    165954, 165955, 165956, 165957, 165958, 165959, 165960, 165961, 165962, 
+    165963, 165964, 165965, 165966, 165967, 165968, 165969, 165970, 165971, 
+    165972, 165973, 165974, 165975, 165976, 165977, 165978, 165979, 165980, 
+    165981, 165982, 165983, 165984, 165985, 165986, 165987, 165988, 165989, 
+    165990, 165991, 165992, 165993, 165994, 165995, 165996, 165997, 165998, 
+    165999, 166000, 166001, 166002, 166003, 166004, 166005, 166006, 166007, 
+    166008, 166009, 166010, 166011, 166012, 166013, 166014, 166015, 166016, 
+    166017, 166018, 166019, 166020, 166021, 166022, 166023, 166024, 166025, 
+    166026, 166027, 166028, 166029, 166030, 166031, 166032, 166033, 166034, 
+    166035, 166036, 166037, 166038, 166039, 166040, 166041, 166042, 166043, 
+    166044, 166045, 166046, 166047, 166048, 166049, 166050, 166051, 166052, 
+    166053, 166054, 166055, 166056, 166057, 166058, 166059, 166060, 166061, 
+    166062, 166063, 166064, 166065, 166066, 166067, 166068, 166069, 166070, 
+    166071, 166072, 166073, 166074, 166075, 166076, 166077, 166078, 166079, 
+    166080, 166081, 166082, 166083, 166084, 166085, 166086, 166087, 166088, 
+    166089, 166090, 166091, 166092, 166093, 166094, 166095, 166096, 166097, 
+    166098, 166099, 166100, 166101, 166102, 166103, 166104, 166105, 166106, 
+    166107, 166108, 166109, 166110, 166111, 166112, 166113, 166114, 166115, 
+    166116, 166117, 166118, 166119, 166120, 166121, 166122, 166123, 166124, 
+    166125, 166126, 166127, 166128, 166129, 166130, 166131, 166132, 166133, 
+    166134, 166135, 166136, 166137, 166138, 166139, 166140, 166141, 166142, 
+    166143, 166144, 166145, 166146, 166147, 166148, 166149, 166150, 166151, 
+    166152, 166153, 166154, 166155, 166156, 166157, 166158, 166159, 166160, 
+    166161, 166162, 166163, 166164, 166165, 166166, 166167, 166168, 166169, 
+    166170, 166171, 166172, 166173, 166174, 166175, 166176, 166177, 166178, 
+    166179, 166180, 166181, 166182, 166183, 166184, 166185, 166186, 166187, 
+    166188, 166189, 166190, 166191, 166192, 166193, 166194, 166195, 166196, 
+    166197, 166198, 166199, 166200, 166201, 166202, 166203, 166204, 166205, 
+    166206, 166207, 166208, 166209, 166210, 166211, 166212, 166213, 166214, 
+    166215, 166216, 166217, 166218, 166219, 166220, 166221, 166222, 166223, 
+    166224, 166225, 166226, 166227, 166228, 166229, 166230, 166231, 166232, 
+    166233, 166234, 166235, 166236, 166237, 166238, 166239, 166240, 166241, 
+    166242, 166243, 166244, 166245, 166246, 166247, 166248, 166249, 166250, 
+    166251, 166252, 166253, 166254, 166255, 166256, 166257, 166258, 166259, 
+    166260, 166261, 166262, 166263, 166264, 166265, 166266, 166267, 166268, 
+    166269, 166270, 166271, 166272, 166273, 166274, 166275, 166276, 166277, 
+    166278, 166279, 166280, 166281, 166282, 166283, 166284, 166285, 166286, 
+    166287, 166288, 166289, 166290, 166291, 166292, 166293, 166294, 166295, 
+    166296, 166297, 166298, 166299, 166300, 166301, 166302, 166303, 166304, 
+    166305, 166306, 166307, 166308, 166309, 166310, 166311, 166312, 166313, 
+    166314, 166315, 166316, 166317, 166318, 166319, 166320, 166321, 166322, 
+    166323, 166324, 166325, 166326, 166327, 166328, 166329, 166330, 166331, 
+    166332, 166333, 166334, 166335, 166336, 166337, 166338, 166339, 166340, 
+    166341, 166342, 166343, 166344, 166345, 166346, 166347, 166348, 166349, 
+    166350, 166351, 166352, 166353, 166354, 166355, 166356, 166357, 166358, 
+    166359, 166360, 166361, 166362, 166363, 166364, 166365, 166366, 166367, 
+    166368, 166369, 166370, 166371, 166372, 166373, 166374, 166375, 166376, 
+    166377, 166378, 166379, 166380, 166381, 166382, 166383, 166384, 166385, 
+    166386, 166387, 166388, 166389, 166390, 166391, 166392, 166393, 166394, 
+    166395, 166396, 166397, 166398, 166399, 166400, 166401, 166402, 166403, 
+    166404, 166405, 166406, 166407, 166408, 166409, 166410, 166411, 166412, 
+    166413, 166414, 166415, 166416, 166417, 166418, 166419, 166420, 166421, 
+    166422, 166423, 166424, 166425, 166426, 166427, 166428, 166429, 166430, 
+    166431, 166432, 166433, 166434, 166435, 166436, 166437, 166438, 166439, 
+    166440, 166441, 166442, 166443, 166444, 166445, 166446, 166447, 166448, 
+    166449, 166450, 166451, 166452, 166453, 166454, 166455, 166456, 166457, 
+    166458, 166459, 166460, 166461, 166462, 166463, 166464, 166465, 166466, 
+    166467, 166468, 166469, 166470, 166471, 166472, 166473, 166474, 166475, 
+    166476, 166477, 166478, 166479, 166480, 166481, 166482, 166483, 166484, 
+    166485, 166486, 166487, 166488, 166489, 166490, 166491, 166492, 166493, 
+    166494, 166495, 166496, 166497, 166498, 166499, 166500, 166501, 166502, 
+    166503, 166504, 166505, 166506, 166507, 166508, 166509, 166510, 166511, 
+    166512, 166513, 166514, 166515, 166516, 166517, 166518, 166519, 166520, 
+    166521, 166522, 166523, 166524, 166525, 166526, 166527, 166528, 166529, 
+    166530, 166531, 166532, 166533, 166534, 166535, 166536, 166537, 166538, 
+    166539, 166540, 166541, 166542, 166543, 166544, 166545, 166546, 166547, 
+    166548, 166549, 166550, 166551, 166552, 166553, 166554, 166555, 166556, 
+    166557, 166558, 166559, 166560, 166561, 166562, 166563, 166564, 166565, 
+    166566, 166567, 166568, 166569, 166570, 166571, 166572, 166573, 166574, 
+    166575, 166576, 166577, 166578, 166579, 166580, 166581, 166582, 166583, 
+    166584, 166585, 166586, 166587, 166588, 166589, 166590, 166591, 166592, 
+    166593, 166594, 166595, 166596, 166597, 166598, 166599, 166600, 166601, 
+    166602, 166603, 166604, 166605, 166606, 166607, 166608, 166609, 166610, 
+    166611, 166612, 166613, 166614, 166615, 166616, 166617, 166618, 166619, 
+    166620, 166621, 166622, 166623, 166624, 166625, 166626, 166627, 166628, 
+    166629, 166630, 166631, 166632, 166633, 166634, 166635, 166636, 166637, 
+    166638, 166639, 166640, 166641, 166642, 166643, 166644, 166645, 166646, 
+    166647, 166648, 166649, 166650, 166651, 166652, 166653, 166654, 166655, 
+    166656, 166657, 166658, 166659, 166660, 166661, 166662, 166663, 166664, 
+    166665, 166666, 166667, 166668, 166669, 166670, 166671, 166672, 166673, 
+    166674, 166675, 166676, 166677, 166678, 166679, 166680, 166681, 166682, 
+    166683, 166684, 166685, 166686, 166687, 166688, 166689, 166690, 166691, 
+    166692, 166693, 166694, 166695, 166696, 166697, 166698, 166699, 166700, 
+    166701, 166702, 166703, 166704, 166705, 166706, 166707, 166708, 166709, 
+    166710, 166711, 166712, 166713, 166714, 166715, 166716, 166717, 166718, 
+    166719, 166720, 166721, 166722, 166723, 166724, 166725, 166726, 166727, 
+    166728, 166729, 166730, 166731, 166732, 166733, 166734, 166735, 166736, 
+    166737, 166738, 166739, 166740, 166741, 166742, 166743, 166744, 166745, 
+    166746, 166747, 166748, 166749, 166750, 166751, 166752, 166753, 166754, 
+    166755, 166756, 166757, 166758, 166759, 166760, 166761, 166762, 166763, 
+    166764, 166765, 166766, 166767, 166768, 166769, 166770, 166771, 166772, 
+    166773, 166774, 166775, 166776, 166777, 166778, 166779, 166780, 166781, 
+    166782, 166783, 166784, 166785, 166786, 166787, 166788, 166789, 166790, 
+    166791, 166792, 166793, 166794, 166795, 166796, 166797, 166798, 166799, 
+    166800, 166801, 166802, 166803, 166804, 166805, 166806, 166807, 166808, 
+    166809, 166810, 166811, 166812, 166813, 166814, 166815, 166816, 166817, 
+    166818, 166819, 166820, 166821, 166822, 166823, 166824, 166825, 166826, 
+    166827, 166828, 166829, 166830, 166831, 166832, 166833, 166834, 166835, 
+    166836, 166837, 166838, 166839, 166840, 166841, 166842, 166843, 166844, 
+    166845, 166846, 166847, 166848, 166849, 166850, 166851, 166852, 166853, 
+    166854, 166855, 166856, 166857, 166858, 166859, 166860, 166861, 166862, 
+    166863, 166864, 166865, 166866, 166867, 166868, 166869, 166870, 166871, 
+    166872, 166873, 166874, 166875, 166876, 166877, 166878, 166879, 166880, 
+    166881, 166882, 166883, 166884, 166885, 166886, 166887, 166888, 166889, 
+    166890, 166891, 166892, 166893, 166894, 166895, 166896, 166897, 166898, 
+    166899, 166900, 166901, 166902, 166903, 166904, 166905, 166906, 166907, 
+    166908, 166909, 166910, 166911, 166912, 166913, 166914, 166915, 166916, 
+    166917, 166918, 166919, 166920, 166921, 166922, 166923, 166924, 166925, 
+    166926, 166927, 166928, 166929, 166930, 166931, 166932, 166933, 166934, 
+    166935, 166936, 166937, 166938, 166939, 166940, 166941, 166942, 166943, 
+    166944, 166945, 166946, 166947, 166948, 166949, 166950, 166951, 166952, 
+    166953, 166954, 166955, 166956, 166957, 166958, 166959, 166960, 166961, 
+    166962, 166963, 166964, 166965, 166966, 166967, 166968, 166969, 166970, 
+    166971, 166972, 166973, 166974, 166975, 166976, 166977, 166978, 166979, 
+    166980, 166981, 166982, 166983, 166984, 166985, 166986, 166987, 166988, 
+    166989, 166990, 166991, 166992, 166993, 166994, 166995, 166996, 166997, 
+    166998, 166999, 167000, 167001, 167002, 167003, 167004, 167005, 167006, 
+    167007, 167008, 167009, 167010, 167011, 167012, 167013, 167014, 167015, 
+    167016, 167017, 167018, 167019, 167020, 167021, 167022, 167023, 167024, 
+    167025, 167026, 167027, 167028, 167029, 167030, 167031, 167032, 167033, 
+    167034, 167035, 167036, 167037, 167038, 167039, 167040, 167041, 167042, 
+    167043, 167044, 167045, 167046, 167047, 167048, 167049, 167050, 167051, 
+    167052, 167053, 167054, 167055, 167056, 167057, 167058, 167059, 167060, 
+    167061, 167062, 167063, 167064, 167065, 167066, 167067, 167068, 167069, 
+    167070, 167071, 167072, 167073, 167074, 167075, 167076, 167077, 167078, 
+    167079, 167080, 167081, 167082, 167083, 167084, 167085, 167086, 167087, 
+    167088, 167089, 167090, 167091, 167092, 167093, 167094, 167095, 167096, 
+    167097, 167098, 167099, 167100, 167101, 167102, 167103, 167104, 167105, 
+    167106, 167107, 167108, 167109, 167110, 167111, 167112, 167113, 167114, 
+    167115, 167116, 167117, 167118, 167119, 167120, 167121, 167122, 167123, 
+    167124, 167125, 167126, 167127, 167128, 167129, 167130, 167131, 167132, 
+    167133, 167134, 167135, 167136, 167137, 167138, 167139, 167140, 167141, 
+    167142, 167143, 167144, 167145, 167146, 167147, 167148, 167149, 167150, 
+    167151, 167152, 167153, 167154, 167155, 167156, 167157, 167158, 167159, 
+    167160, 167161, 167162, 167163, 167164, 167165, 167166, 167167, 167168, 
+    167169, 167170, 167171, 167172, 167173, 167174, 167175, 167176, 167177, 
+    167178, 167179, 167180, 167181, 167182, 167183, 167184, 167185, 167186, 
+    167187, 167188, 167189, 167190, 167191, 167192, 167193, 167194, 167195, 
+    167196, 167197, 167198, 167199, 167200, 167201, 167202, 167203, 167204, 
+    167205, 167206, 167207, 167208, 167209, 167210, 167211, 167212, 167213, 
+    167214, 167215, 167216, 167217, 167218, 167219, 167220, 167221, 167222, 
+    167223, 167224, 167225, 167226, 167227, 167228, 167229, 167230, 167231, 
+    167232, 167233, 167234, 167235, 167236, 167237, 167238, 167239, 167240, 
+    167241, 167242, 167243, 167244, 167245, 167246, 167247, 167248, 167249, 
+    167250, 167251, 167252, 167253, 167254, 167255, 167256, 167257, 167258, 
+    167259, 167260, 167261, 167262, 167263, 167264, 167265, 167266, 167267, 
+    167268, 167269, 167270, 167271, 167272, 167273, 167274, 167275, 167276, 
+    167277, 167278, 167279, 167280, 167281, 167282, 167283, 167284, 167285, 
+    167286, 167287, 167288, 167289, 167290, 167291, 167292, 167293, 167294, 
+    167295, 167296, 167297, 167298, 167299, 167300, 167301, 167302, 167303, 
+    167304, 167305, 167306, 167307, 167308, 167309, 167310, 167311, 167312, 
+    167313, 167314, 167315, 167316, 167317, 167318, 167319, 167320, 167321, 
+    167322, 167323, 167324, 167325, 167326, 167327, 167328, 167329, 167330, 
+    167331, 167332, 167333, 167334, 167335, 167336, 167337, 167338, 167339, 
+    167340, 167341, 167342, 167343, 167344, 167345, 167346, 167347, 167348, 
+    167349, 167350, 167351, 167352, 167353, 167354, 167355, 167356, 167357, 
+    167358, 167359, 167360, 167361, 167362, 167363, 167364, 167365, 167366, 
+    167367, 167368, 167369, 167370, 167371, 167372, 167373, 167374, 167375, 
+    167376, 167377, 167378, 167379, 167380, 167381, 167382, 167383, 167384, 
+    167385, 167386, 167387, 167388, 167389, 167390, 167391, 167392, 167393, 
+    167394, 167395, 167396, 167397, 167398, 167399, 167400, 167401, 167402, 
+    167403, 167404, 167405, 167406, 167407, 167408, 167409, 167410, 167411, 
+    167412, 167413, 167414, 167415, 167416, 167417, 167418, 167419, 167420, 
+    167421, 167422, 167423, 167424, 167425, 167426, 167427, 167428, 167429, 
+    167430, 167431, 167432, 167433, 167434, 167435, 167436, 167437, 167438, 
+    167439, 167440, 167441, 167442, 167443, 167444, 167445, 167446, 167447, 
+    167448, 167449, 167450, 167451, 167452, 167453, 167454, 167455, 167456, 
+    167457, 167458, 167459, 167460, 167461, 167462, 167463, 167464, 167465, 
+    167466, 167467, 167468, 167469, 167470, 167471, 167472, 167473, 167474, 
+    167475, 167476, 167477, 167478, 167479, 167480, 167481, 167482, 167483, 
+    167484, 167485, 167486, 167487, 167488, 167489, 167490, 167491, 167492, 
+    167493, 167494, 167495, 167496, 167497, 167498, 167499, 167500, 167501, 
+    167502, 167503, 167504, 167505, 167506, 167507, 167508, 167509, 167510, 
+    167511, 167512, 167513, 167514, 167515, 167516, 167517, 167518, 167519, 
+    167520, 167521, 167522, 167523, 167524, 167525, 167526, 167527, 167528, 
+    167529, 167530, 167531, 167532, 167533, 167534, 167535, 167536, 167537, 
+    167538, 167539, 167540, 167541, 167542, 167543, 167544, 167545, 167546, 
+    167547, 167548, 167549, 167550, 167551, 167552, 167553, 167554, 167555, 
+    167556, 167557, 167558, 167559, 167560, 167561, 167562, 167563, 167564, 
+    167565, 167566, 167567, 167568, 167569, 167570, 167571, 167572, 167573, 
+    167574, 167575, 167576, 167577, 167578, 167579, 167580, 167581, 167582, 
+    167583, 167584, 167585, 167586, 167587, 167588, 167589, 167590, 167591, 
+    167592, 167593, 167594, 167595, 167596, 167597, 167598, 167599, 167600, 
+    167601, 167602, 167603, 167604, 167605, 167606, 167607, 167608, 167609, 
+    167610, 167611, 167612, 167613, 167614, 167615, 167616, 167617, 167618, 
+    167619, 167620, 167621, 167622, 167623, 167624, 167625, 167626, 167627, 
+    167628, 167629, 167630, 167631, 167632, 167633, 167634, 167635, 167636, 
+    167637, 167638, 167639, 167640, 167641, 167642, 167643, 167644, 167645, 
+    167646, 167647, 167648, 167649, 167650, 167651, 167652, 167653, 167654, 
+    167655, 167656, 167657, 167658, 167659, 167660, 167661, 167662, 167663, 
+    167664, 167665, 167666, 167667, 167668, 167669, 167670, 167671, 167672, 
+    167673, 167674, 167675, 167676, 167677, 167678, 167679, 167680, 167681, 
+    167682, 167683, 167684, 167685, 167686, 167687, 167688, 167689, 167690, 
+    167691, 167692, 167693, 167694, 167695, 167696, 167697, 167698, 167699, 
+    167700, 167701, 167702, 167703, 167704, 167705, 167706, 167707, 167708, 
+    167709, 167710, 167711, 167712, 167713, 167714, 167715, 167716, 167717, 
+    167718, 167719, 167720, 167721, 167722, 167723, 167724, 167725, 167726, 
+    167727, 167728, 167729, 167730, 167731, 167732, 167733, 167734, 167735, 
+    167736, 167737, 167738, 167739, 167740, 167741, 167742, 167743, 167744, 
+    167745, 167746, 167747, 167748, 167749, 167750, 167751, 167752, 167753, 
+    167754, 167755, 167756, 167757, 167758, 167759, 167760, 167761, 167762, 
+    167763, 167764, 167765, 167766, 167767, 167768, 167769, 167770, 167771, 
+    167772, 167773, 167774, 167775, 167776, 167777, 167778, 167779, 167780, 
+    167781, 167782, 167783, 167784, 167785, 167786, 167787, 167788, 167789, 
+    167790, 167791, 167792, 167793, 167794, 167795, 167796, 167797, 167798, 
+    167799, 167800, 167801, 167802, 167803, 167804, 167805, 167806, 167807, 
+    167808, 167809, 167810, 167811, 167812, 167813, 167814, 167815, 167816, 
+    167817, 167818, 167819, 167820, 167821, 167822, 167823, 167824, 167825, 
+    167826, 167827, 167828, 167829, 167830, 167831, 167832, 167833, 167834, 
+    167835, 167836, 167837, 167838, 167839, 167840, 167841, 167842, 167843, 
+    167844, 167845, 167846, 167847, 167848, 167849, 167850, 167851, 167852, 
+    167853, 167854, 167855, 167856, 167857, 167858, 167859, 167860, 167861, 
+    167862, 167863, 167864, 167865, 167866, 167867, 167868, 167869, 167870, 
+    167871, 167872, 167873, 167874, 167875, 167876, 167877, 167878, 167879, 
+    167880, 167881, 167882, 167883, 167884, 167885, 167886, 167887, 167888, 
+    167889, 167890, 167891, 167892, 167893, 167894, 167895, 167896, 167897, 
+    167898, 167899, 167900, 167901, 167902, 167903, 167904, 167905, 167906, 
+    167907, 167908, 167909, 167910, 167911, 167912, 167913, 167914, 167915, 
+    167916, 167917, 167918, 167919, 167920, 167921, 167922, 167923, 167924, 
+    167925, 167926, 167927, 167928, 167929, 167930, 167931, 167932, 167933, 
+    167934, 167935, 167936, 167937, 167938, 167939, 167940, 167941, 167942, 
+    167943, 167944, 167945, 167946, 167947, 167948, 167949, 167950, 167951, 
+    167952, 167953, 167954, 167955, 167956, 167957, 167958, 167959, 167960, 
+    167961, 167962, 167963, 167964, 167965, 167966, 167967, 167968, 167969, 
+    167970, 167971, 167972, 167973, 167974, 167975, 167976, 167977, 167978, 
+    167979, 167980, 167981, 167982, 167983, 167984, 167985, 167986, 167987, 
+    167988, 167989, 167990, 167991, 167992, 167993, 167994, 167995, 167996, 
+    167997, 167998, 167999, 168000, 168001, 168002, 168003, 168004, 168005, 
+    168006, 168007, 168008, 168009, 168010, 168011, 168012, 168013, 168014, 
+    168015, 168016, 168017, 168018, 168019, 168020, 168021, 168022, 168023, 
+    168024, 168025, 168026, 168027, 168028, 168029, 168030, 168031, 168032, 
+    168033, 168034, 168035, 168036, 168037, 168038, 168039, 168040, 168041, 
+    168042, 168043, 168044, 168045, 168046, 168047, 168048, 168049, 168050, 
+    168051, 168052, 168053, 168054, 168055, 168056, 168057, 168058, 168059, 
+    168060, 168061, 168062, 168063, 168064, 168065, 168066, 168067, 168068, 
+    168069, 168070, 168071, 168072, 168073, 168074, 168075, 168076, 168077, 
+    168078, 168079, 168080, 168081, 168082, 168083, 168084, 168085, 168086, 
+    168087, 168088, 168089, 168090, 168091, 168092, 168093, 168094, 168095, 
+    168096, 168097, 168098, 168099, 168100, 168101, 168102, 168103, 168104, 
+    168105, 168106, 168107, 168108, 168109, 168110, 168111, 168112, 168113, 
+    168114, 168115, 168116, 168117, 168118, 168119, 168120, 168121, 168122, 
+    168123, 168124, 168125, 168126, 168127, 168128, 168129, 168130, 168131, 
+    168132, 168133, 168134, 168135, 168136, 168137, 168138, 168139, 168140, 
+    168141, 168142, 168143, 168144, 168145, 168146, 168147, 168148, 168149, 
+    168150, 168151, 168152, 168153, 168154, 168155, 168156, 168157, 168158, 
+    168159, 168160, 168161, 168162, 168163, 168164, 168165, 168166, 168167, 
+    168168, 168169, 168170, 168171, 168172, 168173, 168174, 168175, 168176, 
+    168177, 168178, 168179, 168180, 168181, 168182, 168183, 168184, 168185, 
+    168186, 168187, 168188, 168189, 168190, 168191, 168192, 168193, 168194, 
+    168195, 168196, 168197, 168198, 168199, 168200, 168201, 168202, 168203, 
+    168204, 168205, 168206, 168207, 168208, 168209, 168210, 168211, 168212, 
+    168213, 168214, 168215, 168216, 168217, 168218, 168219, 168220, 168221, 
+    168222, 168223, 168224, 168225, 168226, 168227, 168228, 168229, 168230, 
+    168231, 168232, 168233, 168234, 168235, 168236, 168237, 168238, 168239, 
+    168240, 168241, 168242, 168243, 168244, 168245, 168246, 168247, 168248, 
+    168249, 168250, 168251, 168252, 168253, 168254, 168255, 168256, 168257, 
+    168258, 168259, 168260, 168261, 168262, 168263, 168264, 168265, 168266, 
+    168267, 168268, 168269, 168270, 168271, 168272, 168273, 168274, 168275, 
+    168276, 168277, 168278, 168279, 168280, 168281, 168282, 168283, 168284, 
+    168285, 168286, 168287, 168288, 168289, 168290, 168291, 168292, 168293, 
+    168294, 168295, 168296, 168297, 168298, 168299, 168300, 168301, 168302, 
+    168303, 168304, 168305, 168306, 168307, 168308, 168309, 168310, 168311, 
+    168312, 168313, 168314, 168315, 168316, 168317, 168318, 168319, 168320, 
+    168321, 168322, 168323, 168324, 168325, 168326, 168327, 168328, 168329, 
+    168330, 168331, 168332, 168333, 168334, 168335, 168336, 168337, 168338, 
+    168339, 168340, 168341, 168342, 168343, 168344, 168345, 168346, 168347, 
+    168348, 168349, 168350, 168351, 168352, 168353, 168354, 168355, 168356, 
+    168357, 168358, 168359, 168360, 168361, 168362, 168363, 168364, 168365, 
+    168366, 168367, 168368, 168369, 168370, 168371, 168372, 168373, 168374, 
+    168375, 168376, 168377, 168378, 168379, 168380, 168381, 168382, 168383, 
+    168384, 168385, 168386, 168387, 168388, 168389, 168390, 168391, 168392, 
+    168393, 168394, 168395, 168396, 168397, 168398, 168399, 168400, 168401, 
+    168402, 168403, 168404, 168405, 168406, 168407, 168408, 168409, 168410, 
+    168411, 168412, 168413, 168414, 168415, 168416, 168417, 168418, 168419, 
+    168420, 168421, 168422, 168423, 168424, 168425, 168426, 168427, 168428, 
+    168429, 168430, 168431, 168432, 168433, 168434, 168435, 168436, 168437, 
+    168438, 168439, 168440, 168441, 168442, 168443, 168444, 168445, 168446, 
+    168447, 168448, 168449, 168450, 168451, 168452, 168453, 168454, 168455, 
+    168456, 168457, 168458, 168459, 168460, 168461, 168462, 168463, 168464, 
+    168465, 168466, 168467, 168468, 168469, 168470, 168471, 168472, 168473, 
+    168474, 168475, 168476, 168477, 168478, 168479, 168480, 168481, 168482, 
+    168483, 168484, 168485, 168486, 168487, 168488, 168489, 168490, 168491, 
+    168492, 168493, 168494, 168495, 168496, 168497, 168498, 168499, 168500, 
+    168501, 168502, 168503, 168504, 168505, 168506, 168507, 168508, 168509, 
+    168510, 168511, 168512, 168513, 168514, 168515, 168516, 168517, 168518, 
+    168519, 168520, 168521, 168522, 168523, 168524, 168525, 168526, 168527, 
+    168528, 168529, 168530, 168531, 168532, 168533, 168534, 168535, 168536, 
+    168537, 168538, 168539, 168540, 168541, 168542, 168543, 168544, 168545, 
+    168546, 168547, 168548, 168549, 168550, 168551, 168552, 168553, 168554, 
+    168555, 168556, 168557, 168558, 168559, 168560, 168561, 168562, 168563, 
+    168564, 168565, 168566, 168567, 168568, 168569, 168570, 168571, 168572, 
+    168573, 168574, 168575, 168576, 168577, 168578, 168579, 168580, 168581, 
+    168582, 168583, 168584, 168585, 168586, 168587, 168588, 168589, 168590, 
+    168591, 168592, 168593, 168594, 168595, 168596, 168597, 168598, 168599, 
+    168600, 168601, 168602, 168603, 168604, 168605, 168606, 168607, 168608, 
+    168609, 168610, 168611, 168612, 168613, 168614, 168615, 168616, 168617, 
+    168618, 168619, 168620, 168621, 168622, 168623, 168624, 168625, 168626, 
+    168627, 168628, 168629, 168630, 168631, 168632, 168633, 168634, 168635, 
+    168636, 168637, 168638, 168639, 168640, 168641, 168642, 168643, 168644, 
+    168645, 168646, 168647, 168648, 168649, 168650, 168651, 168652, 168653, 
+    168654, 168655, 168656, 168657, 168658, 168659, 168660, 168661, 168662, 
+    168663, 168664, 168665, 168666, 168667, 168668, 168669, 168670, 168671, 
+    168672, 168673, 168674, 168675, 168676, 168677, 168678, 168679, 168680, 
+    168681, 168682, 168683, 168684, 168685, 168686, 168687, 168688, 168689, 
+    168690, 168691, 168692, 168693, 168694, 168695, 168696, 168697, 168698, 
+    168699, 168700, 168701, 168702, 168703, 168704, 168705, 168706, 168707, 
+    168708, 168709, 168710, 168711, 168712, 168713, 168714, 168715, 168716, 
+    168717, 168718, 168719, 168720, 168721, 168722, 168723, 168724, 168725, 
+    168726, 168727, 168728, 168729, 168730, 168731, 168732, 168733, 168734, 
+    168735, 168736, 168737, 168738, 168739, 168740, 168741, 168742, 168743, 
+    168744, 168745, 168746, 168747, 168748, 168749, 168750, 168751, 168752, 
+    168753, 168754, 168755, 168756, 168757, 168758, 168759, 168760, 168761, 
+    168762, 168763, 168764, 168765, 168766, 168767, 168768, 168769, 168770, 
+    168771, 168772, 168773, 168774, 168775, 168776, 168777, 168778, 168779, 
+    168780, 168781, 168782, 168783, 168784, 168785, 168786, 168787, 168788, 
+    168789, 168790, 168791, 168792, 168793, 168794, 168795, 168796, 168797, 
+    168798, 168799, 168800, 168801, 168802, 168803, 168804, 168805, 168806, 
+    168807, 168808, 168809, 168810, 168811, 168812, 168813, 168814, 168815, 
+    168816, 168817, 168818, 168819, 168820, 168821, 168822, 168823, 168824, 
+    168825, 168826, 168827, 168828, 168829, 168830, 168831, 168832, 168833, 
+    168834, 168835, 168836, 168837, 168838, 168839, 168840, 168841, 168842, 
+    168843, 168844, 168845, 168846, 168847, 168848, 168849, 168850, 168851, 
+    168852, 168853, 168854, 168855, 168856, 168857, 168858, 168859, 168860, 
+    168861, 168862, 168863, 168864, 168865, 168866, 168867, 168868, 168869, 
+    168870, 168871, 168872, 168873, 168874, 168875, 168876, 168877, 168878, 
+    168879, 168880, 168881, 168882, 168883, 168884, 168885, 168886, 168887, 
+    168888, 168889, 168890, 168891, 168892, 168893, 168894, 168895, 168896, 
+    168897, 168898, 168899, 168900, 168901, 168902, 168903, 168904, 168905, 
+    168906, 168907, 168908, 168909, 168910, 168911, 168912, 168913, 168914, 
+    168915, 168916, 168917, 168918, 168919, 168920, 168921, 168922, 168923, 
+    168924, 168925, 168926, 168927, 168928, 168929, 168930, 168931, 168932, 
+    168933, 168934, 168935, 168936, 168937, 168938, 168939, 168940, 168941, 
+    168942, 168943, 168944, 168945, 168946, 168947, 168948, 168949, 168950, 
+    168951, 168952, 168953, 168954, 168955, 168956, 168957, 168958, 168959, 
+    168960, 168961, 168962, 168963, 168964, 168965, 168966, 168967, 168968, 
+    168969, 168970, 168971, 168972, 168973, 168974, 168975, 168976, 168977, 
+    168978, 168979, 168980, 168981, 168982, 168983, 168984, 168985, 168986, 
+    168987, 168988, 168989, 168990, 168991, 168992, 168993, 168994, 168995, 
+    168996, 168997, 168998, 168999, 169000, 169001, 169002, 169003, 169004, 
+    169005, 169006, 169007, 169008, 169009, 169010, 169011, 169012, 169013, 
+    169014, 169015, 169016, 169017, 169018, 169019, 169020, 169021, 169022, 
+    169023, 169024, 169025, 169026, 169027, 169028, 169029, 169030, 169031, 
+    169032, 169033, 169034, 169035, 169036, 169037, 169038, 169039, 169040, 
+    169041, 169042, 169043, 169044, 169045, 169046, 169047, 169048, 169049, 
+    169050, 169051, 169052, 169053, 169054, 169055, 169056, 169057, 169058, 
+    169059, 169060, 169061, 169062, 169063, 169064, 169065, 169066, 169067, 
+    169068, 169069, 169070, 169071, 169072, 169073, 169074, 169075, 169076, 
+    169077, 169078, 169079, 169080, 169081, 169082, 169083, 169084, 169085, 
+    169086, 169087, 169088, 169089, 169090, 169091, 169092, 169093, 169094, 
+    169095, 169096, 169097, 169098, 169099, 169100, 169101, 169102, 169103, 
+    169104, 169105, 169106, 169107, 169108, 169109, 169110, 169111, 169112, 
+    169113, 169114, 169115, 169116, 169117, 169118, 169119, 169120, 169121, 
+    169122, 169123, 169124, 169125, 169126, 169127, 169128, 169129, 169130, 
+    169131, 169132, 169133, 169134, 169135, 169136, 169137, 169138, 169139, 
+    169140, 169141, 169142, 169143, 169144, 169145, 169146, 169147, 169148, 
+    169149, 169150, 169151, 169152, 169153, 169154, 169155, 169156, 169157, 
+    169158, 169159, 169160, 169161, 169162, 169163, 169164, 169165, 169166, 
+    169167, 169168, 169169, 169170, 169171, 169172, 169173, 169174, 169175, 
+    169176, 169177, 169178, 169179, 169180, 169181, 169182, 169183, 169184, 
+    169185, 169186, 169187, 169188, 169189, 169190, 169191, 169192, 169193, 
+    169194, 169195, 169196, 169197, 169198, 169199, 169200, 169201, 169202, 
+    169203, 169204, 169205, 169206, 169207, 169208, 169209, 169210, 169211, 
+    169212, 169213, 169214, 169215, 169216, 169217, 169218, 169219, 169220, 
+    169221, 169222, 169223, 169224, 169225, 169226, 169227, 169228, 169229, 
+    169230, 169231, 169232, 169233, 169234, 169235, 169236, 169237, 169238, 
+    169239, 169240, 169241, 169242, 169243, 169244, 169245, 169246, 169247, 
+    169248, 169249, 169250, 169251, 169252, 169253, 169254, 169255, 169256, 
+    169257, 169258, 169259, 169260, 169261, 169262, 169263, 169264, 169265, 
+    169266, 169267, 169268, 169269, 169270, 169271, 169272, 169273, 169274, 
+    169275, 169276, 169277, 169278, 169279, 169280, 169281, 169282, 169283, 
+    169284, 169285, 169286, 169287, 169288, 169289, 169290, 169291, 169292, 
+    169293, 169294, 169295, 169296, 169297, 169298, 169299, 169300, 169301, 
+    169302, 169303, 169304, 169305, 169306, 169307, 169308, 169309, 169310, 
+    169311, 169312, 169313, 169314, 169315, 169316, 169317, 169318, 169319, 
+    169320, 169321, 169322, 169323, 169324, 169325, 169326, 169327, 169328, 
+    169329, 169330, 169331, 169332, 169333, 169334, 169335, 169336, 169337, 
+    169338, 169339, 169340, 169341, 169342, 169343, 169344, 169345, 169346, 
+    169347, 169348, 169349, 169350, 169351, 169352, 169353, 169354, 169355, 
+    169356, 169357, 169358, 169359, 169360, 169361, 169362, 169363, 169364, 
+    169365, 169366, 169367, 169368, 169369, 169370, 169371, 169372, 169373, 
+    169374, 169375, 169376, 169377, 169378, 169379, 169380, 169381, 169382, 
+    169383, 169384, 169385, 169386, 169387, 169388, 169389, 169390, 169391, 
+    169392, 169393, 169394, 169395, 169396, 169397, 169398, 169399, 169400, 
+    169401, 169402, 169403, 169404, 169405, 169406, 169407, 169408, 169409, 
+    169410, 169411, 169412, 169413, 169414, 169415, 169416, 169417, 169418, 
+    169419, 169420, 169421, 169422, 169423, 169424, 169425, 169426, 169427, 
+    169428, 169429, 169430, 169431, 169432, 169433, 169434, 169435, 169436, 
+    169437, 169438, 169439, 169440, 169441, 169442, 169443, 169444, 169445, 
+    169446, 169447, 169448, 169449, 169450, 169451, 169452, 169453, 169454, 
+    169455, 169456, 169457, 169458, 169459, 169460, 169461, 169462, 169463, 
+    169464, 169465, 169466, 169467, 169468, 169469, 169470, 169471, 169472, 
+    169473, 169474, 169475, 169476, 169477, 169478, 169479, 169480, 169481, 
+    169482, 169483, 169484, 169485, 169486, 169487, 169488, 169489, 169490, 
+    169491, 169492, 169493, 169494, 169495, 169496, 169497, 169498, 169499, 
+    169500, 169501, 169502, 169503, 169504, 169505, 169506, 169507, 169508, 
+    169509, 169510, 169511, 169512, 169513, 169514, 169515, 169516, 169517, 
+    169518, 169519, 169520, 169521, 169522, 169523, 169524, 169525, 169526, 
+    169527, 169528, 169529, 169530, 169531, 169532, 169533, 169534, 169535, 
+    169536, 169537, 169538, 169539, 169540, 169541, 169542, 169543, 169544, 
+    169545, 169546, 169547, 169548, 169549, 169550, 169551, 169552, 169553, 
+    169554, 169555, 169556, 169557, 169558, 169559, 169560, 169561, 169562, 
+    169563, 169564, 169565, 169566, 169567, 169568, 169569, 169570, 169571, 
+    169572, 169573, 169574, 169575, 169576, 169577, 169578, 169579, 169580, 
+    169581, 169582, 169583, 169584, 169585, 169586, 169587, 169588, 169589, 
+    169590, 169591, 169592, 169593, 169594, 169595, 169596, 169597, 169598, 
+    169599, 169600, 169601, 169602, 169603, 169604, 169605, 169606, 169607, 
+    169608, 169609, 169610, 169611, 169612, 169613, 169614, 169615, 169616, 
+    169617, 169618, 169619, 169620, 169621, 169622, 169623, 169624, 169625, 
+    169626, 169627, 169628, 169629, 169630, 169631, 169632, 169633, 169634, 
+    169635, 169636, 169637, 169638, 169639, 169640, 169641, 169642, 169643, 
+    169644, 169645, 169646, 169647, 169648, 169649, 169650, 169651, 169652, 
+    169653, 169654, 169655, 169656, 169657, 169658, 169659, 169660, 169661, 
+    169662, 169663, 169664, 169665, 169666, 169667, 169668, 169669, 169670, 
+    169671, 169672, 169673, 169674, 169675, 169676, 169677, 169678, 169679, 
+    169680, 169681, 169682, 169683, 169684, 169685, 169686, 169687, 169688, 
+    169689, 169690, 169691, 169692, 169693, 169694, 169695, 169696, 169697, 
+    169698, 169699, 169700, 169701, 169702, 169703, 169704, 169705, 169706, 
+    169707, 169708, 169709, 169710, 169711, 169712, 169713, 169714, 169715, 
+    169716, 169717, 169718, 169719, 169720, 169721, 169722, 169723, 169724, 
+    169725, 169726, 169727, 169728, 169729, 169730, 169731, 169732, 169733, 
+    169734, 169735, 169736, 169737, 169738, 169739, 169740, 169741, 169742, 
+    169743, 169744, 169745, 169746, 169747, 169748, 169749, 169750, 169751, 
+    169752, 169753, 169754, 169755, 169756, 169757, 169758, 169759, 169760, 
+    169761, 169762, 169763, 169764, 169765, 169766, 169767, 169768, 169769, 
+    169770, 169771, 169772, 169773, 169774, 169775, 169776, 169777, 169778, 
+    169779, 169780, 169781, 169782, 169783, 169784, 169785, 169786, 169787, 
+    169788, 169789, 169790, 169791, 169792, 169793, 169794, 169795, 169796, 
+    169797, 169798, 169799, 169800, 169801, 169802, 169803, 169804, 169805, 
+    169806, 169807, 169808, 169809, 169810, 169811, 169812, 169813, 169814, 
+    169815, 169816, 169817, 169818, 169819, 169820, 169821, 169822, 169823, 
+    169824, 169825, 169826, 169827, 169828, 169829, 169830, 169831, 169832, 
+    169833, 169834, 169835, 169836, 169837, 169838, 169839, 169840, 169841, 
+    169842, 169843, 169844, 169845, 169846, 169847, 169848, 169849, 169850, 
+    169851, 169852, 169853, 169854, 169855, 169856, 169857, 169858, 169859, 
+    169860, 169861, 169862, 169863, 169864, 169865, 169866, 169867, 169868, 
+    169869, 169870, 169871, 169872, 169873, 169874, 169875, 169876, 169877, 
+    169878, 169879, 169880, 169881, 169882, 169883, 169884, 169885, 169886, 
+    169887, 169888, 169889, 169890, 169891, 169892, 169893, 169894, 169895, 
+    169896, 169897, 169898, 169899, 169900, 169901, 169902, 169903, 169904, 
+    169905, 169906, 169907, 169908, 169909, 169910, 169911, 169912, 169913, 
+    169914, 169915, 169916, 169917, 169918, 169919, 169920, 169921, 169922, 
+    169923, 169924, 169925, 169926, 169927, 169928, 169929, 169930, 169931, 
+    169932, 169933, 169934, 169935, 169936, 169937, 169938, 169939, 169940, 
+    169941, 169942, 169943, 169944, 169945, 169946, 169947, 169948, 169949, 
+    169950, 169951, 169952, 169953, 169954, 169955, 169956, 169957, 169958, 
+    169959, 169960, 169961, 169962, 169963, 169964, 169965, 169966, 169967, 
+    169968, 169969, 169970, 169971, 169972, 169973, 169974, 169975, 169976, 
+    169977, 169978, 169979, 169980, 169981, 169982, 169983, 169984, 169985, 
+    169986, 169987, 169988, 169989, 169990, 169991, 169992, 169993, 169994, 
+    169995, 169996, 169997, 169998, 169999, 170000, 170001, 170002, 170003, 
+    170004, 170005, 170006, 170007, 170008, 170009, 170010, 170011, 170012, 
+    170013, 170014, 170015, 170016, 170017, 170018, 170019, 170020, 170021, 
+    170022, 170023, 170024, 170025, 170026, 170027, 170028, 170029, 170030, 
+    170031, 170032, 170033, 170034, 170035, 170036, 170037, 170038, 170039, 
+    170040, 170041, 170042, 170043, 170044, 170045, 170046, 170047, 170048, 
+    170049, 170050, 170051, 170052, 170053, 170054, 170055, 170056, 170057, 
+    170058, 170059, 170060, 170061, 170062, 170063, 170064, 170065, 170066, 
+    170067, 170068, 170069, 170070, 170071, 170072, 170073, 170074, 170075, 
+    170076, 170077, 170078, 170079, 170080, 170081, 170082, 170083, 170084, 
+    170085, 170086, 170087, 170088, 170089, 170090, 170091, 170092, 170093, 
+    170094, 170095, 170096, 170097, 170098, 170099, 170100, 170101, 170102, 
+    170103, 170104, 170105, 170106, 170107, 170108, 170109, 170110, 170111, 
+    170112, 170113, 170114, 170115, 170116, 170117, 170118, 170119, 170120, 
+    170121, 170122, 170123, 170124, 170125, 170126, 170127, 170128, 170129, 
+    170130, 170131, 170132, 170133, 170134, 170135, 170136, 170137, 170138, 
+    170139, 170140, 170141, 170142, 170143, 170144, 170145, 170146, 170147, 
+    170148, 170149, 170150, 170151, 170152, 170153, 170154, 170155, 170156, 
+    170157, 170158, 170159, 170160, 170161, 170162, 170163, 170164, 170165, 
+    170166, 170167, 170168, 170169, 170170, 170171, 170172, 170173, 170174, 
+    170175, 170176, 170177, 170178, 170179, 170180, 170181, 170182, 170183, 
+    170184, 170185, 170186, 170187, 170188, 170189, 170190, 170191, 170192, 
+    170193, 170194, 170195, 170196, 170197, 170198, 170199, 170200, 170201, 
+    170202, 170203, 170204, 170205, 170206, 170207, 170208, 170209, 170210, 
+    170211, 170212, 170213, 170214, 170215, 170216, 170217, 170218, 170219, 
+    170220, 170221, 170222, 170223, 170224, 170225, 170226, 170227, 170228, 
+    170229, 170230, 170231, 170232, 170233, 170234, 170235, 170236, 170237, 
+    170238, 170239, 170240, 170241, 170242, 170243, 170244, 170245, 170246, 
+    170247, 170248, 170249, 170250, 170251, 170252, 170253, 170254, 170255, 
+    170256, 170257, 170258, 170259, 170260, 170261, 170262, 170263, 170264, 
+    170265, 170266, 170267, 170268, 170269, 170270, 170271, 170272, 170273, 
+    170274, 170275, 170276, 170277, 170278, 170279, 170280, 170281, 170282, 
+    170283, 170284, 170285, 170286, 170287, 170288, 170289, 170290, 170291, 
+    170292, 170293, 170294, 170295, 170296, 170297, 170298, 170299, 170300, 
+    170301, 170302, 170303, 170304, 170305, 170306, 170307, 170308, 170309, 
+    170310, 170311, 170312, 170313, 170314, 170315, 170316, 170317, 170318, 
+    170319, 170320, 170321, 170322, 170323, 170324, 170325, 170326, 170327, 
+    170328, 170329, 170330, 170331, 170332, 170333, 170334, 170335, 170336, 
+    170337, 170338, 170339, 170340, 170341, 170342, 170343, 170344, 170345, 
+    170346, 170347, 170348, 170349, 170350, 170351, 170352, 170353, 170354, 
+    170355, 170356, 170357, 170358, 170359, 170360, 170361, 170362, 170363, 
+    170364, 170365, 170366, 170367, 170368, 170369, 170370, 170371, 170372, 
+    170373, 170374, 170375, 170376, 170377, 170378, 170379, 170380, 170381, 
+    170382, 170383, 170384, 170385, 170386, 170387, 170388, 170389, 170390, 
+    170391, 170392, 170393, 170394, 170395, 170396, 170397, 170398, 170399, 
+    170400, 170401, 170402, 170403, 170404, 170405, 170406, 170407, 170408, 
+    170409, 170410, 170411, 170412, 170413, 170414, 170415, 170416, 170417, 
+    170418, 170419, 170420, 170421, 170422, 170423, 170424, 170425, 170426, 
+    170427, 170428, 170429, 170430, 170431, 170432, 170433, 170434, 170435, 
+    170436, 170437, 170438, 170439, 170440, 170441, 170442, 170443, 170444, 
+    170445, 170446, 170447, 170448, 170449, 170450, 170451, 170452, 170453, 
+    170454, 170455, 170456, 170457, 170458, 170459, 170460, 170461, 170462, 
+    170463, 170464, 170465, 170466, 170467, 170468, 170469, 170470, 170471, 
+    170472, 170473, 170474, 170475, 170476, 170477, 170478, 170479, 170480, 
+    170481, 170482, 170483, 170484, 170485, 170486, 170487, 170488, 170489, 
+    170490, 170491, 170492, 170493, 170494, 170495, 170496, 170497, 170498, 
+    170499, 170500, 170501, 170502, 170503, 170504, 170505, 170506, 170507, 
+    170508, 170509, 170510, 170511, 170512, 170513, 170514, 170515, 170516, 
+    170517, 170518, 170519, 170520, 170521, 170522, 170523, 170524, 170525, 
+    170526, 170527, 170528, 170529, 170530, 170531, 170532, 170533, 170534, 
+    170535, 170536, 170537, 170538, 170539, 170540, 170541, 170542, 170543, 
+    170544, 170545, 170546, 170547, 170548, 170549, 170550, 170551, 170552, 
+    170553, 170554, 170555, 170556, 170557, 170558, 170559, 170560, 170561, 
+    170562, 170563, 170564, 170565, 170566, 170567, 170568, 170569, 170570, 
+    170571, 170572, 170573, 170574, 170575, 170576, 170577, 170578, 170579, 
+    170580, 170581, 170582, 170583, 170584, 170585, 170586, 170587, 170588, 
+    170589, 170590, 170591, 170592, 170593, 170594, 170595, 170596, 170597, 
+    170598, 170599, 170600, 170601, 170602, 170603, 170604, 170605, 170606, 
+    170607, 170608, 170609, 170610, 170611, 170612, 170613, 170614, 170615, 
+    170616, 170617, 170618, 170619, 170620, 170621, 170622, 170623, 170624, 
+    170625, 170626, 170627, 170628, 170629, 170630, 170631, 170632, 170633, 
+    170634, 170635, 170636, 170637, 170638, 170639, 170640, 170641, 170642, 
+    170643, 170644, 170645, 170646, 170647, 170648, 170649, 170650, 170651, 
+    170652, 170653, 170654, 170655, 170656, 170657, 170658, 170659, 170660, 
+    170661, 170662, 170663, 170664, 170665, 170666, 170667, 170668, 170669, 
+    170670, 170671, 170672, 170673, 170674, 170675, 170676, 170677, 170678, 
+    170679, 170680, 170681, 170682, 170683, 170684, 170685, 170686, 170687, 
+    170688, 170689, 170690, 170691, 170692, 170693, 170694, 170695, 170696, 
+    170697, 170698, 170699, 170700, 170701, 170702, 170703, 170704, 170705, 
+    170706, 170707, 170708, 170709, 170710, 170711, 170712, 170713, 170714, 
+    170715, 170716, 170717, 170718, 170719, 170720, 170721, 170722, 170723, 
+    170724, 170725, 170726, 170727, 170728, 170729, 170730, 170731, 170732, 
+    170733, 170734, 170735, 170736, 170737, 170738, 170739, 170740, 170741, 
+    170742, 170743, 170744, 170745, 170746, 170747, 170748, 170749, 170750, 
+    170751, 170752, 170753, 170754, 170755, 170756, 170757, 170758, 170759, 
+    170760, 170761, 170762, 170763, 170764, 170765, 170766, 170767, 170768, 
+    170769, 170770, 170771, 170772, 170773, 170774, 170775, 170776, 170777, 
+    170778, 170779, 170780, 170781, 170782, 170783, 170784, 170785, 170786, 
+    170787, 170788, 170789, 170790, 170791, 170792, 170793, 170794, 170795, 
+    170796, 170797, 170798, 170799, 170800, 170801, 170802, 170803, 170804, 
+    170805, 170806, 170807, 170808, 170809, 170810, 170811, 170812, 170813, 
+    170814, 170815, 170816, 170817, 170818, 170819, 170820, 170821, 170822, 
+    170823, 170824, 170825, 170826, 170827, 170828, 170829, 170830, 170831, 
+    170832, 170833, 170834, 170835, 170836, 170837, 170838, 170839, 170840, 
+    170841, 170842, 170843, 170844, 170845, 170846, 170847, 170848, 170849, 
+    170850, 170851, 170852, 170853, 170854, 170855, 170856, 170857, 170858, 
+    170859, 170860, 170861, 170862, 170863, 170864, 170865, 170866, 170867, 
+    170868, 170869, 170870, 170871, 170872, 170873, 170874, 170875, 170876, 
+    170877, 170878, 170879, 170880, 170881, 170882, 170883, 170884, 170885, 
+    170886, 170887, 170888, 170889, 170890, 170891, 170892, 170893, 170894, 
+    170895, 170896, 170897, 170898, 170899, 170900, 170901, 170902, 170903, 
+    170904, 170905, 170906, 170907, 170908, 170909, 170910, 170911, 170912, 
+    170913, 170914, 170915, 170916, 170917, 170918, 170919, 170920, 170921, 
+    170922, 170923, 170924, 170925, 170926, 170927, 170928, 170929, 170930, 
+    170931, 170932, 170933, 170934, 170935, 170936, 170937, 170938, 170939, 
+    170940, 170941, 170942, 170943, 170944, 170945, 170946, 170947, 170948, 
+    170949, 170950, 170951, 170952, 170953, 170954, 170955, 170956, 170957, 
+    170958, 170959, 170960, 170961, 170962, 170963, 170964, 170965, 170966, 
+    170967, 170968, 170969, 170970, 170971, 170972, 170973, 170974, 170975, 
+    170976, 170977, 170978, 170979, 170980, 170981, 170982, 170983, 170984, 
+    170985, 170986, 170987, 170988, 170989, 170990, 170991, 170992, 170993, 
+    170994, 170995, 170996, 170997, 170998, 170999, 171000, 171001, 171002, 
+    171003, 171004, 171005, 171006, 171007, 171008, 171009, 171010, 171011, 
+    171012, 171013, 171014, 171015, 171016, 171017, 171018, 171019, 171020, 
+    171021, 171022, 171023, 171024, 171025, 171026, 171027, 171028, 171029, 
+    171030, 171031, 171032, 171033, 171034, 171035, 171036, 171037, 171038, 
+    171039, 171040, 171041, 171042, 171043, 171044, 171045, 171046, 171047, 
+    171048, 171049, 171050, 171051, 171052, 171053, 171054, 171055, 171056, 
+    171057, 171058, 171059, 171060, 171061, 171062, 171063, 171064, 171065, 
+    171066, 171067, 171068, 171069, 171070, 171071, 171072, 171073, 171074, 
+    171075, 171076, 171077, 171078, 171079, 171080, 171081, 171082, 171083, 
+    171084, 171085, 171086, 171087, 171088, 171089, 171090, 171091, 171092, 
+    171093, 171094, 171095, 171096, 171097, 171098, 171099, 171100, 171101, 
+    171102, 171103, 171104, 171105, 171106, 171107, 171108, 171109, 171110, 
+    171111, 171112, 171113, 171114, 171115, 171116, 171117, 171118, 171119, 
+    171120, 171121, 171122, 171123, 171124, 171125, 171126, 171127, 171128, 
+    171129, 171130, 171131, 171132, 171133, 171134, 171135, 171136, 171137, 
+    171138, 171139, 171140, 171141, 171142, 171143, 171144, 171145, 171146, 
+    171147, 171148, 171149, 171150, 171151, 171152, 171153, 171154, 171155, 
+    171156, 171157, 171158, 171159, 171160, 171161, 171162, 171163, 171164, 
+    171165, 171166, 171167, 171168, 171169, 171170, 171171, 171172, 171173, 
+    171174, 171175, 171176, 171177, 171178, 171179, 171180, 171181, 171182, 
+    171183, 171184, 171185, 171186, 171187, 171188, 171189, 171190, 171191, 
+    171192, 171193, 171194, 171195, 171196, 171197, 171198, 171199, 171200, 
+    171201, 171202, 171203, 171204, 171205, 171206, 171207, 171208, 171209, 
+    171210, 171211, 171212, 171213, 171214, 171215, 171216, 171217, 171218, 
+    171219, 171220, 171221, 171222, 171223, 171224, 171225, 171226, 171227, 
+    171228, 171229, 171230, 171231, 171232, 171233, 171234, 171235, 171236, 
+    171237, 171238, 171239, 171240, 171241, 171242, 171243, 171244, 171245, 
+    171246, 171247, 171248, 171249, 171250, 171251, 171252, 171253, 171254, 
+    171255, 171256, 171257, 171258, 171259, 171260, 171261, 171262, 171263, 
+    171264, 171265, 171266, 171267, 171268, 171269, 171270, 171271, 171272, 
+    171273, 171274, 171275, 171276, 171277, 171278, 171279, 171280, 171281, 
+    171282, 171283, 171284, 171285, 171286, 171287, 171288, 171289, 171290, 
+    171291, 171292, 171293, 171294, 171295, 171296, 171297, 171298, 171299, 
+    171300, 171301, 171302, 171303, 171304, 171305, 171306, 171307, 171308, 
+    171309, 171310, 171311, 171312, 171313, 171314, 171315, 171316, 171317, 
+    171318, 171319, 171320, 171321, 171322, 171323, 171324, 171325, 171326, 
+    171327, 171328, 171329, 171330, 171331, 171332, 171333, 171334, 171335, 
+    171336, 171337, 171338, 171339, 171340, 171341, 171342, 171343, 171344, 
+    171345, 171346, 171347, 171348, 171349, 171350, 171351, 171352, 171353, 
+    171354, 171355, 171356, 171357, 171358, 171359, 171360, 171361, 171362, 
+    171363, 171364, 171365, 171366, 171367, 171368, 171369, 171370, 171371, 
+    171372, 171373, 171374, 171375, 171376, 171377, 171378, 171379, 171380, 
+    171381, 171382, 171383, 171384, 171385, 171386, 171387, 171388, 171389, 
+    171390, 171391, 171392, 171393, 171394, 171395, 171396, 171397, 171398, 
+    171399, 171400, 171401, 171402, 171403, 171404, 171405, 171406, 171407, 
+    171408, 171409, 171410, 171411, 171412, 171413, 171414, 171415, 171416, 
+    171417, 171418, 171419, 171420, 171421, 171422, 171423, 171424, 171425, 
+    171426, 171427, 171428, 171429, 171430, 171431, 171432, 171433, 171434, 
+    171435, 171436, 171437, 171438, 171439, 171440, 171441, 171442, 171443, 
+    171444, 171445, 171446, 171447, 171448, 171449, 171450, 171451, 171452, 
+    171453, 171454, 171455, 171456, 171457, 171458, 171459, 171460, 171461, 
+    171462, 171463, 171464, 171465, 171466, 171467, 171468, 171469, 171470, 
+    171471, 171472, 171473, 171474, 171475, 171476, 171477, 171478, 171479, 
+    171480, 171481, 171482, 171483, 171484, 171485, 171486, 171487, 171488, 
+    171489, 171490, 171491, 171492, 171493, 171494, 171495, 171496, 171497, 
+    171498, 171499, 171500, 171501, 171502, 171503, 171504, 171505, 171506, 
+    171507, 171508, 171509, 171510, 171511, 171512, 171513, 171514, 171515, 
+    171516, 171517, 171518, 171519, 171520, 171521, 171522, 171523, 171524, 
+    171525, 171526, 171527, 171528, 171529, 171530, 171531, 171532, 171533, 
+    171534, 171535, 171536, 171537, 171538, 171539, 171540, 171541, 171542, 
+    171543, 171544, 171545, 171546, 171547, 171548, 171549, 171550, 171551, 
+    171552, 171553, 171554, 171555, 171556, 171557, 171558, 171559, 171560, 
+    171561, 171562, 171563, 171564, 171565, 171566, 171567, 171568, 171569, 
+    171570, 171571, 171572, 171573, 171574, 171575, 171576, 171577, 171578, 
+    171579, 171580, 171581, 171582, 171583, 171584, 171585, 171586, 171587, 
+    171588, 171589, 171590, 171591, 171592, 171593, 171594, 171595, 171596, 
+    171597, 171598, 171599, 171600, 171601, 171602, 171603, 171604, 171605, 
+    171606, 171607, 171608, 171609, 171610, 171611, 171612, 171613, 171614, 
+    171615, 171616, 171617, 171618, 171619, 171620, 171621, 171622, 171623, 
+    171624, 171625, 171626, 171627, 171628, 171629, 171630, 171631, 171632, 
+    171633, 171634, 171635, 171636, 171637, 171638, 171639, 171640, 171641, 
+    171642, 171643, 171644, 171645, 171646, 171647, 171648, 171649, 171650, 
+    171651, 171652, 171653, 171654, 171655, 171656, 171657, 171658, 171659, 
+    171660, 171661, 171662, 171663, 171664, 171665, 171666, 171667, 171668, 
+    171669, 171670, 171671, 171672, 171673, 171674, 171675, 171676, 171677, 
+    171678, 171679, 171680, 171681, 171682, 171683, 171684, 171685, 171686, 
+    171687, 171688, 171689, 171690, 171691, 171692, 171693, 171694, 171695, 
+    171696, 171697, 171698, 171699, 171700, 171701, 171702, 171703, 171704, 
+    171705, 171706, 171707, 171708, 171709, 171710, 171711, 171712, 171713, 
+    171714, 171715, 171716, 171717, 171718, 171719, 171720, 171721, 171722, 
+    171723, 171724, 171725, 171726, 171727, 171728, 171729, 171730, 171731, 
+    171732, 171733, 171734, 171735, 171736, 171737, 171738, 171739, 171740, 
+    171741, 171742, 171743, 171744, 171745, 171746, 171747, 171748, 171749, 
+    171750, 171751, 171752, 171753, 171754, 171755, 171756, 171757, 171758, 
+    171759, 171760, 171761, 171762, 171763, 171764, 171765, 171766, 171767, 
+    171768, 171769, 171770, 171771, 171772, 171773, 171774, 171775, 171776, 
+    171777, 171778, 171779, 171780, 171781, 171782, 171783, 171784, 171785, 
+    171786, 171787, 171788, 171789, 171790, 171791, 171792, 171793, 171794, 
+    171795, 171796, 171797, 171798, 171799, 171800, 171801, 171802, 171803, 
+    171804, 171805, 171806, 171807, 171808, 171809, 171810, 171811, 171812, 
+    171813, 171814, 171815, 171816, 171817, 171818, 171819, 171820, 171821, 
+    171822, 171823, 171824, 171825, 171826, 171827, 171828, 171829, 171830, 
+    171831, 171832, 171833, 171834, 171835, 171836, 171837, 171838, 171839, 
+    171840, 171841, 171842, 171843, 171844, 171845, 171846, 171847, 171848, 
+    171849, 171850, 171851, 171852, 171853, 171854, 171855, 171856, 171857, 
+    171858, 171859, 171860, 171861, 171862, 171863, 171864, 171865, 171866, 
+    171867, 171868, 171869, 171870, 171871, 171872, 171873, 171874, 171875, 
+    171876, 171877, 171878, 171879, 171880, 171881, 171882, 171883, 171884, 
+    171885, 171886, 171887, 171888, 171889, 171890, 171891, 171892, 171893, 
+    171894, 171895, 171896, 171897, 171898, 171899, 171900, 171901, 171902, 
+    171903, 171904, 171905, 171906, 171907, 171908, 171909, 171910, 171911, 
+    171912, 171913, 171914, 171915, 171916, 171917, 171918, 171919, 171920, 
+    171921, 171922, 171923, 171924, 171925, 171926, 171927, 171928, 171929, 
+    171930, 171931, 171932, 171933, 171934, 171935, 171936, 171937, 171938, 
+    171939, 171940, 171941, 171942, 171943, 171944, 171945, 171946, 171947, 
+    171948, 171949, 171950, 171951, 171952, 171953, 171954, 171955, 171956, 
+    171957, 171958, 171959, 171960, 171961, 171962, 171963, 171964, 171965, 
+    171966, 171967, 171968, 171969, 171970, 171971, 171972, 171973, 171974, 
+    171975, 171976, 171977, 171978, 171979, 171980, 171981, 171982, 171983, 
+    171984, 171985, 171986, 171987, 171988, 171989, 171990, 171991, 171992, 
+    171993, 171994, 171995, 171996, 171997, 171998, 171999, 172000, 172001, 
+    172002, 172003, 172004, 172005, 172006, 172007, 172008, 172009, 172010, 
+    172011, 172012, 172013, 172014, 172015, 172016, 172017, 172018, 172019, 
+    172020, 172021, 172022, 172023, 172024, 172025, 172026, 172027, 172028, 
+    172029, 172030, 172031, 172032, 172033, 172034, 172035, 172036, 172037, 
+    172038, 172039, 172040, 172041, 172042, 172043, 172044, 172045, 172046, 
+    172047, 172048, 172049, 172050, 172051, 172052, 172053, 172054, 172055, 
+    172056, 172057, 172058, 172059, 172060, 172061, 172062, 172063, 172064, 
+    172065, 172066, 172067, 172068, 172069, 172070, 172071, 172072, 172073, 
+    172074, 172075, 172076, 172077, 172078, 172079, 172080, 172081, 172082, 
+    172083, 172084, 172085, 172086, 172087, 172088, 172089, 172090, 172091, 
+    172092, 172093, 172094, 172095, 172096, 172097, 172098, 172099, 172100, 
+    172101, 172102, 172103, 172104, 172105, 172106, 172107, 172108, 172109, 
+    172110, 172111, 172112, 172113, 172114, 172115, 172116, 172117, 172118, 
+    172119, 172120, 172121, 172122, 172123, 172124, 172125, 172126, 172127, 
+    172128, 172129, 172130, 172131, 172132, 172133, 172134, 172135, 172136, 
+    172137, 172138, 172139, 172140, 172141, 172142, 172143, 172144, 172145, 
+    172146, 172147, 172148, 172149, 172150, 172151, 172152, 172153, 172154, 
+    172155, 172156, 172157, 172158, 172159, 172160, 172161, 172162, 172163, 
+    172164, 172165, 172166, 172167, 172168, 172169, 172170, 172171, 172172, 
+    172173, 172174, 172175, 172176, 172177, 172178, 172179, 172180, 172181, 
+    172182, 172183, 172184, 172185, 172186, 172187, 172188, 172189, 172190, 
+    172191, 172192, 172193, 172194, 172195, 172196, 172197, 172198, 172199, 
+    172200, 172201, 172202, 172203, 172204, 172205, 172206, 172207, 172208, 
+    172209, 172210, 172211, 172212, 172213, 172214, 172215, 172216, 172217, 
+    172218, 172219, 172220, 172221, 172222, 172223, 172224, 172225, 172226, 
+    172227, 172228, 172229, 172230, 172231, 172232, 172233, 172234, 172235, 
+    172236, 172237, 172238, 172239, 172240, 172241, 172242, 172243, 172244, 
+    172245, 172246, 172247, 172248, 172249, 172250, 172251, 172252, 172253, 
+    172254, 172255, 172256, 172257, 172258, 172259, 172260, 172261, 172262, 
+    172263, 172264, 172265, 172266, 172267, 172268, 172269, 172270, 172271, 
+    172272, 172273, 172274, 172275, 172276, 172277, 172278, 172279, 172280, 
+    172281, 172282, 172283, 172284, 172285, 172286, 172287, 172288, 172289, 
+    172290, 172291, 172292, 172293, 172294, 172295, 172296, 172297, 172298, 
+    172299, 172300, 172301, 172302, 172303, 172304, 172305, 172306, 172307, 
+    172308, 172309, 172310, 172311, 172312, 172313, 172314, 172315, 172316, 
+    172317, 172318, 172319, 172320, 172321, 172322, 172323, 172324, 172325, 
+    172326, 172327, 172328, 172329, 172330, 172331, 172332, 172333, 172334, 
+    172335, 172336, 172337, 172338, 172339, 172340, 172341, 172342, 172343, 
+    172344, 172345, 172346, 172347, 172348, 172349, 172350, 172351, 172352, 
+    172353, 172354, 172355, 172356, 172357, 172358, 172359, 172360, 172361, 
+    172362, 172363, 172364, 172365, 172366, 172367, 172368, 172369, 172370, 
+    172371, 172372, 172373, 172374, 172375, 172376, 172377, 172378, 172379, 
+    172380, 172381, 172382, 172383, 172384, 172385, 172386, 172387, 172388, 
+    172389, 172390, 172391, 172392, 172393, 172394, 172395, 172396, 172397, 
+    172398, 172399, 172400, 172401, 172402, 172403, 172404, 172405, 172406, 
+    172407, 172408, 172409, 172410, 172411, 172412, 172413, 172414, 172415, 
+    172416, 172417, 172418, 172419, 172420, 172421, 172422, 172423, 172424, 
+    172425, 172426, 172427, 172428, 172429, 172430, 172431, 172432, 172433, 
+    172434, 172435, 172436, 172437, 172438, 172439, 172440, 172441, 172442, 
+    172443, 172444, 172445, 172446, 172447, 172448, 172449, 172450, 172451, 
+    172452, 172453, 172454, 172455, 172456, 172457, 172458, 172459, 172460, 
+    172461, 172462, 172463, 172464, 172465, 172466, 172467, 172468, 172469, 
+    172470, 172471, 172472, 172473, 172474, 172475, 172476, 172477, 172478, 
+    172479, 172480, 172481, 172482, 172483, 172484, 172485, 172486, 172487, 
+    172488, 172489, 172490, 172491, 172492, 172493, 172494, 172495, 172496, 
+    172497, 172498, 172499, 172500, 172501, 172502, 172503, 172504, 172505, 
+    172506, 172507, 172508, 172509, 172510, 172511, 172512, 172513, 172514, 
+    172515, 172516, 172517, 172518, 172519, 172520, 172521, 172522, 172523, 
+    172524, 172525, 172526, 172527, 172528, 172529, 172530, 172531, 172532, 
+    172533, 172534, 172535, 172536, 172537, 172538, 172539, 172540, 172541, 
+    172542, 172543, 172544, 172545, 172546, 172547, 172548, 172549, 172550, 
+    172551, 172552, 172553, 172554, 172555, 172556, 172557, 172558, 172559, 
+    172560, 172561, 172562, 172563, 172564, 172565, 172566, 172567, 172568, 
+    172569, 172570, 172571, 172572, 172573, 172574, 172575, 172576, 172577, 
+    172578, 172579, 172580, 172581, 172582, 172583, 172584, 172585, 172586, 
+    172587, 172588, 172589, 172590, 172591, 172592, 172593, 172594, 172595, 
+    172596, 172597, 172598, 172599, 172600, 172601, 172602, 172603, 172604, 
+    172605, 172606, 172607, 172608, 172609, 172610, 172611, 172612, 172613, 
+    172614, 172615, 172616, 172617, 172618, 172619, 172620, 172621, 172622, 
+    172623, 172624, 172625, 172626, 172627, 172628, 172629, 172630, 172631, 
+    172632, 172633, 172634, 172635, 172636, 172637, 172638, 172639, 172640, 
+    172641, 172642, 172643, 172644, 172645, 172646, 172647, 172648, 172649, 
+    172650, 172651, 172652, 172653, 172654, 172655, 172656, 172657, 172658, 
+    172659, 172660, 172661, 172662, 172663, 172664, 172665, 172666, 172667, 
+    172668, 172669, 172670, 172671, 172672, 172673, 172674, 172675, 172676, 
+    172677, 172678, 172679, 172680, 172681, 172682, 172683, 172684, 172685, 
+    172686, 172687, 172688, 172689, 172690, 172691, 172692, 172693, 172694, 
+    172695, 172696, 172697, 172698, 172699, 172700, 172701, 172702, 172703, 
+    172704, 172705, 172706, 172707, 172708, 172709, 172710, 172711, 172712, 
+    172713, 172714, 172715, 172716, 172717, 172718, 172719, 172720, 172721, 
+    172722, 172723, 172724, 172725, 172726, 172727, 172728, 172729, 172730, 
+    172731, 172732, 172733, 172734, 172735, 172736, 172737, 172738, 172739, 
+    172740, 172741, 172742, 172743, 172744, 172745, 172746, 172747, 172748, 
+    172749, 172750, 172751, 172752, 172753, 172754, 172755, 172756, 172757, 
+    172758, 172759, 172760, 172761, 172762, 172763, 172764, 172765, 172766, 
+    172767, 172768, 172769, 172770, 172771, 172772, 172773, 172774, 172775, 
+    172776, 172777, 172778, 172779, 172780, 172781, 172782, 172783, 172784, 
+    172785, 172786, 172787, 172788, 172789, 172790, 172791, 172792, 172793, 
+    172794, 172795, 172796, 172797, 172798, 172799, 172800, 172801, 172802, 
+    172803, 172804, 172805, 172806, 172807, 172808, 172809, 172810, 172811, 
+    172812, 172813, 172814, 172815, 172816, 172817, 172818, 172819, 172820, 
+    172821, 172822, 172823, 172824, 172825, 172826, 172827, 172828, 172829, 
+    172830, 172831, 172832, 172833, 172834, 172835, 172836, 172837, 172838, 
+    172839, 172840, 172841, 172842, 172843, 172844, 172845, 172846, 172847, 
+    172848, 172849, 172850, 172851, 172852, 172853, 172854, 172855, 172856, 
+    172857, 172858, 172859, 172860, 172861, 172862, 172863, 172864, 172865, 
+    172866, 172867, 172868, 172869, 172870, 172871, 172872, 172873, 172874, 
+    172875, 172876, 172877, 172878, 172879, 172880, 172881, 172882, 172883, 
+    172884, 172885, 172886, 172887, 172888, 172889, 172890, 172891, 172892, 
+    172893, 172894, 172895, 172896, 172897, 172898, 172899, 172900, 172901, 
+    172902, 172903, 172904, 172905, 172906, 172907, 172908, 172909, 172910, 
+    172911, 172912, 172913, 172914, 172915, 172916, 172917, 172918, 172919, 
+    172920, 172921, 172922, 172923, 172924, 172925, 172926, 172927, 172928, 
+    172929, 172930, 172931, 172932, 172933, 172934, 172935, 172936, 172937, 
+    172938, 172939, 172940, 172941, 172942, 172943, 172944, 172945, 172946, 
+    172947, 172948, 172949, 172950, 172951, 172952, 172953, 172954, 172955, 
+    172956, 172957, 172958, 172959, 172960, 172961, 172962, 172963, 172964, 
+    172965, 172966, 172967, 172968, 172969, 172970, 172971, 172972, 172973, 
+    172974, 172975, 172976, 172977, 172978, 172979, 172980, 172981, 172982, 
+    172983, 172984, 172985, 172986, 172987, 172988, 172989, 172990, 172991, 
+    172992, 172993, 172994, 172995, 172996, 172997, 172998, 172999, 173000, 
+    173001, 173002, 173003, 173004, 173005, 173006, 173007, 173008, 173009, 
+    173010, 173011, 173012, 173013, 173014, 173015, 173016, 173017, 173018, 
+    173019, 173020, 173021, 173022, 173023, 173024, 173025, 173026, 173027, 
+    173028, 173029, 173030, 173031, 173032, 173033, 173034, 173035, 173036, 
+    173037, 173038, 173039, 173040, 173041, 173042, 173043, 173044, 173045, 
+    173046, 173047, 173048, 173049, 173050, 173051, 173052, 173053, 173054, 
+    173055, 173056, 173057, 173058, 173059, 173060, 173061, 173062, 173063, 
+    173064, 173065, 173066, 173067, 173068, 173069, 173070, 173071, 173072, 
+    173073, 173074, 173075, 173076, 173077, 173078, 173079, 173080, 173081, 
+    173082, 173083, 173084, 173085, 173086, 173087, 173088, 173089, 173090, 
+    173091, 173092, 173093, 173094, 173095, 173096, 173097, 173098, 173099, 
+    173100, 173101, 173102, 173103, 173104, 173105, 173106, 173107, 173108, 
+    173109, 173110, 173111, 173112, 173113, 173114, 173115, 173116, 173117, 
+    173118, 173119, 173120, 173121, 173122, 173123, 173124, 173125, 173126, 
+    173127, 173128, 173129, 173130, 173131, 173132, 173133, 173134, 173135, 
+    173136, 173137, 173138, 173139, 173140, 173141, 173142, 173143, 173144, 
+    173145, 173146, 173147, 173148, 173149, 173150, 173151, 173152, 173153, 
+    173154, 173155, 173156, 173157, 173158, 173159, 173160, 173161, 173162, 
+    173163, 173164, 173165, 173166, 173167, 173168, 173169, 173170, 173171, 
+    173172, 173173, 173174, 173175, 173176, 173177, 173178, 173179, 173180, 
+    173181, 173182, 173183, 173184, 173185, 173186, 173187, 173188, 173189, 
+    173190, 173191, 173192, 173193, 173194, 173195, 173196, 173197, 173198, 
+    173199, 173200, 173201, 173202, 173203, 173204, 173205, 173206, 173207, 
+    173208, 173209, 173210, 173211, 173212, 173213, 173214, 173215, 173216, 
+    173217, 173218, 173219, 173220, 173221, 173222, 173223, 173224, 173225, 
+    173226, 173227, 173228, 173229, 173230, 173231, 173232, 173233, 173234, 
+    173235, 173236, 173237, 173238, 173239, 173240, 173241, 173242, 173243, 
+    173244, 173245, 173246, 173247, 173248, 173249, 173250, 173251, 173252, 
+    173253, 173254, 173255, 173256, 173257, 173258, 173259, 173260, 173261, 
+    173262, 173263, 173264, 173265, 173266, 173267, 173268, 173269, 173270, 
+    173271, 173272, 173273, 173274, 173275, 173276, 173277, 173278, 173279, 
+    173280, 173281, 173282, 173283, 173284, 173285, 173286, 173287, 173288, 
+    173289, 173290, 173291, 173292, 173293, 173294, 173295, 173296, 173297, 
+    173298, 173299, 173300, 173301, 173302, 173303, 173304, 173305, 173306, 
+    173307, 173308, 173309, 173310, 173311, 173312, 173313, 173314, 173315, 
+    173316, 173317, 173318, 173319, 173320, 173321, 173322, 173323, 173324, 
+    173325, 173326, 173327, 173328, 173329, 173330, 173331, 173332, 173333, 
+    173334, 173335, 173336, 173337, 173338, 173339, 173340, 173341, 173342, 
+    173343, 173344, 173345, 173346, 173347, 173348, 173349, 173350, 173351, 
+    173352, 173353, 173354, 173355, 173356, 173357, 173358, 173359, 173360, 
+    173361, 173362, 173363, 173364, 173365, 173366, 173367, 173368, 173369, 
+    173370, 173371, 173372, 173373, 173374, 173375, 173376, 173377, 173378, 
+    173379, 173380, 173381, 173382, 173383, 173384, 173385, 173386, 173387, 
+    173388, 173389, 173390, 173391, 173392, 173393, 173394, 173395, 173396, 
+    173397, 173398, 173399, 173400, 173401, 173402, 173403, 173404, 173405, 
+    173406, 173407, 173408, 173409, 173410, 173411, 173412, 173413, 173414, 
+    173415, 173416, 173417, 173418, 173419, 173420, 173421, 173422, 173423, 
+    173424, 173425, 173426, 173427, 173428, 173429, 173430, 173431, 173432, 
+    173433, 173434, 173435, 173436, 173437, 173438, 173439, 173440, 173441, 
+    173442, 173443, 173444, 173445, 173446, 173447, 173448, 173449, 173450, 
+    173451, 173452, 173453, 173454, 173455, 173456, 173457, 173458, 173459, 
+    173460, 173461, 173462, 173463, 173464, 173465, 173466, 173467, 173468, 
+    173469, 173470, 173471, 173472, 173473, 173474, 173475, 173476, 173477, 
+    173478, 173479, 173480, 173481, 173482, 173483, 173484, 173485, 173486, 
+    173487, 173488, 173489, 173490, 173491, 173492, 173493, 173494, 173495, 
+    173496, 173497, 173498, 173499, 173500, 173501, 173502, 173503, 173504, 
+    173505, 173506, 173507, 173508, 173509, 173510, 173511, 173512, 173513, 
+    173514, 173515, 173516, 173517, 173518, 173519, 173520, 173521, 173522, 
+    173523, 173524, 173525, 173526, 173527, 173528, 173529, 173530, 173531, 
+    173532, 173533, 173534, 173535, 173536, 173537, 173538, 173539, 173540, 
+    173541, 173542, 173543, 173544, 173545, 173546, 173547, 173548, 173549, 
+    173550, 173551, 173552, 173553, 173554, 173555, 173556, 173557, 173558, 
+    173559, 173560, 173561, 173562, 173563, 173564, 173565, 173566, 173567, 
+    173568, 173569, 173570, 173571, 173572, 173573, 173574, 173575, 173576, 
+    173577, 173578, 173579, 173580, 173581, 173582, 173583, 173584, 173585, 
+    173586, 173587, 173588, 173589, 173590, 173591, 173592, 173593, 173594, 
+    173595, 173596, 173597, 173598, 173599, 173600, 173601, 173602, 173603, 
+    173604, 173605, 173606, 173607, 173608, 173609, 173610, 173611, 173612, 
+    173613, 173614, 173615, 173616, 173617, 173618, 173619, 173620, 173621, 
+    173622, 173623, 173624, 173625, 173626, 173627, 173628, 173629, 173630, 
+    173631, 173632, 173633, 173634, 173635, 173636, 173637, 173638, 173639, 
+    173640, 173641, 173642, 173643, 173644, 173645, 173646, 173647, 173648, 
+    173649, 173650, 173651, 173652, 173653, 173654, 173655, 173656, 173657, 
+    173658, 173659, 173660, 173661, 173662, 173663, 173664, 173665, 173666, 
+    173667, 173668, 173669, 173670, 173671, 173672, 173673, 173674, 173675, 
+    173676, 173677, 173678, 173679, 173680, 173681, 173682, 173683, 173684, 
+    173685, 173686, 173687, 173688, 173689, 173690, 173691, 173692, 173693, 
+    173694, 173695, 173696, 173697, 173698, 173699, 173700, 173701, 173702, 
+    173703, 173704, 173705, 173706, 173707, 173708, 173709, 173710, 173711, 
+    173712, 173713, 173714, 173715, 173716, 173717, 173718, 173719, 173720, 
+    173721, 173722, 173723, 173724, 173725, 173726, 173727, 173728, 173729, 
+    173730, 173731, 173732, 173733, 173734, 173735, 173736, 173737, 173738, 
+    173739, 173740, 173741, 173742, 173743, 173744, 173745, 173746, 173747, 
+    173748, 173749, 173750, 173751, 173752, 173753, 173754, 173755, 173756, 
+    173757, 173758, 173759, 173760, 173761, 173762, 173763, 173764, 173765, 
+    173766, 173767, 173768, 173769, 173770, 173771, 173772, 173773, 173774, 
+    173775, 173776, 173777, 173778, 173779, 173780, 173781, 173782, 173783, 
+    173784, 173785, 173786, 173787, 173788, 173789, 173790, 173791, 173792, 
+    173793, 173794, 173795, 173796, 173797, 173798, 173799, 173800, 173801, 
+    173802, 173803, 173804, 173805, 173806, 173807, 173808, 173809, 173810, 
+    173811, 173812, 173813, 173814, 173815, 173816, 173817, 173818, 173819, 
+    173820, 173821, 173822, 173823, 173824, 173825, 173826, 173827, 173828, 
+    173829, 173830, 173831, 173832, 173833, 173834, 173835, 173836, 173837, 
+    173838, 173839, 173840, 173841, 173842, 173843, 173844, 173845, 173846, 
+    173847, 173848, 173849, 173850, 173851, 173852, 173853, 173854, 173855, 
+    173856, 173857, 173858, 173859, 173860, 173861, 173862, 173863, 173864, 
+    173865, 173866, 173867, 173868, 173869, 173870, 173871, 173872, 173873, 
+    173874, 173875, 173876, 173877, 173878, 173879, 173880, 173881, 173882, 
+    173883, 173884, 173885, 173886, 173887, 173888, 173889, 173890, 173891, 
+    173892, 173893, 173894, 173895, 173896, 173897, 173898, 173899, 173900, 
+    173901, 173902, 173903, 173904, 173905, 173906, 173907, 173908, 173909, 
+    173910, 173911, 173912, 173913, 173914, 173915, 173916, 173917, 173918, 
+    173919, 173920, 173921, 173922, 173923, 173924, 173925, 173926, 173927, 
+    173928, 173929, 173930, 173931, 173932, 173933, 173934, 173935, 173936, 
+    173937, 173938, 173939, 173940, 173941, 173942, 173943, 173944, 173945, 
+    173946, 173947, 173948, 173949, 173950, 173951, 173952, 173953, 173954, 
+    173955, 173956, 173957, 173958, 173959, 173960, 173961, 173962, 173963, 
+    173964, 173965, 173966, 173967, 173968, 173969, 173970, 173971, 173972, 
+    173973, 173974, 173975, 173976, 173977, 173978, 173979, 173980, 173981, 
+    173982, 173983, 173984, 173985, 173986, 173987, 173988, 173989, 173990, 
+    173991, 173992, 173993, 173994, 173995, 173996, 173997, 173998, 173999, 
+    174000, 174001, 174002, 174003, 174004, 174005, 174006, 174007, 174008, 
+    174009, 174010, 174011, 174012, 174013, 174014, 174015, 174016, 174017, 
+    174018, 174019, 174020, 174021, 174022, 174023, 174024, 174025, 174026, 
+    174027, 174028, 174029, 174030, 174031, 174032, 174033, 174034, 174035, 
+    174036, 174037, 174038, 174039, 174040, 174041, 174042, 174043, 174044, 
+    174045, 174046, 174047, 174048, 174049, 174050, 174051, 174052, 174053, 
+    174054, 174055, 174056, 174057, 174058, 174059, 174060, 174061, 174062, 
+    174063, 174064, 174065, 174066, 174067, 174068, 174069, 174070, 174071, 
+    174072, 174073, 174074, 174075, 174076, 174077, 174078, 174079, 174080, 
+    174081, 174082, 174083, 174084, 174085, 174086, 174087, 174088, 174089, 
+    174090, 174091, 174092, 174093, 174094, 174095, 174096, 174097, 174098, 
+    174099, 174100, 174101, 174102, 174103, 174104, 174105, 174106, 174107, 
+    174108, 174109, 174110, 174111, 174112, 174113, 174114, 174115, 174116, 
+    174117, 174118, 174119, 174120, 174121, 174122, 174123, 174124, 174125, 
+    174126, 174127, 174128, 174129, 174130, 174131, 174132, 174133, 174134, 
+    174135, 174136, 174137, 174138, 174139, 174140, 174141, 174142, 174143, 
+    174144, 174145, 174146, 174147, 174148, 174149, 174150, 174151, 174152, 
+    174153, 174154, 174155, 174156, 174157, 174158, 174159, 174160, 174161, 
+    174162, 174163, 174164, 174165, 174166, 174167, 174168, 174169, 174170, 
+    174171, 174172, 174173, 174174, 174175, 174176, 174177, 174178, 174179, 
+    174180, 174181, 174182, 174183, 174184, 174185, 174186, 174187, 174188, 
+    174189, 174190, 174191, 174192, 174193, 174194, 174195, 174196, 174197, 
+    174198, 174199, 174200, 174201, 174202, 174203, 174204, 174205, 174206, 
+    174207, 174208, 174209, 174210, 174211, 174212, 174213, 174214, 174215, 
+    174216, 174217, 174218, 174219, 174220, 174221, 174222, 174223, 174224, 
+    174225, 174226, 174227, 174228, 174229, 174230, 174231, 174232, 174233, 
+    174234, 174235, 174236, 174237, 174238, 174239, 174240, 174241, 174242, 
+    174243, 174244, 174245, 174246, 174247, 174248, 174249, 174250, 174251, 
+    174252, 174253, 174254, 174255, 174256, 174257, 174258, 174259, 174260, 
+    174261, 174262, 174263, 174264, 174265, 174266, 174267, 174268, 174269, 
+    174270, 174271, 174272, 174273, 174274, 174275, 174276, 174277, 174278, 
+    174279, 174280, 174281, 174282, 174283, 174284, 174285, 174286, 174287, 
+    174288, 174289, 174290, 174291, 174292, 174293, 174294, 174295, 174296, 
+    174297, 174298, 174299, 174300, 174301, 174302, 174303, 174304, 174305, 
+    174306, 174307, 174308, 174309, 174310, 174311, 174312, 174313, 174314, 
+    174315, 174316, 174317, 174318, 174319, 174320, 174321, 174322, 174323, 
+    174324, 174325, 174326, 174327, 174328, 174329, 174330, 174331, 174332, 
+    174333, 174334, 174335, 174336, 174337, 174338, 174339, 174340, 174341, 
+    174342, 174343, 174344, 174345, 174346, 174347, 174348, 174349, 174350, 
+    174351, 174352, 174353, 174354, 174355, 174356, 174357, 174358, 174359, 
+    174360, 174361, 174362, 174363, 174364, 174365, 174366, 174367, 174368, 
+    174369, 174370, 174371, 174372, 174373, 174374, 174375, 174376, 174377, 
+    174378, 174379, 174380, 174381, 174382, 174383, 174384, 174385, 174386, 
+    174387, 174388, 174389, 174390, 174391, 174392, 174393, 174394, 174395, 
+    174396, 174397, 174398, 174399, 174400, 174401, 174402, 174403, 174404, 
+    174405, 174406, 174407, 174408, 174409, 174410, 174411, 174412, 174413, 
+    174414, 174415, 174416, 174417, 174418, 174419, 174420, 174421, 174422, 
+    174423, 174424, 174425, 174426, 174427, 174428, 174429, 174430, 174431, 
+    174432, 174433, 174434, 174435, 174436, 174437, 174438, 174439, 174440, 
+    174441, 174442, 174443, 174444, 174445, 174446, 174447, 174448, 174449, 
+    174450, 174451, 174452, 174453, 174454, 174455, 174456, 174457, 174458, 
+    174459, 174460, 174461, 174462, 174463, 174464, 174465, 174466, 174467, 
+    174468, 174469, 174470, 174471, 174472, 174473, 174474, 174475, 174476, 
+    174477, 174478, 174479, 174480, 174481, 174482, 174483, 174484, 174485, 
+    174486, 174487, 174488, 174489, 174490, 174491, 174492, 174493, 174494, 
+    174495, 174496, 174497, 174498, 174499, 174500, 174501, 174502, 174503, 
+    174504, 174505, 174506, 174507, 174508, 174509, 174510, 174511, 174512, 
+    174513, 174514, 174515, 174516, 174517, 174518, 174519, 174520, 174521, 
+    174522, 174523, 174524, 174525, 174526, 174527, 174528, 174529, 174530, 
+    174531, 174532, 174533, 174534, 174535, 174536, 174537, 174538, 174539, 
+    174540, 174541, 174542, 174543, 174544, 174545, 174546, 174547, 174548, 
+    174549, 174550, 174551, 174552, 174553, 174554, 174555, 174556, 174557, 
+    174558, 174559, 174560, 174561, 174562, 174563, 174564, 174565, 174566, 
+    174567, 174568, 174569, 174570, 174571, 174572, 174573, 174574, 174575, 
+    174576, 174577, 174578, 174579, 174580, 174581, 174582, 174583, 174584, 
+    174585, 174586, 174587, 174588, 174589, 174590, 174591, 174592, 174593, 
+    174594, 174595, 174596, 174597, 174598, 174599, 174600, 174601, 174602, 
+    174603, 174604, 174605, 174606, 174607, 174608, 174609, 174610, 174611, 
+    174612, 174613, 174614, 174615, 174616, 174617, 174618, 174619, 174620, 
+    174621, 174622, 174623, 174624, 174625, 174626, 174627, 174628, 174629, 
+    174630, 174631, 174632, 174633, 174634, 174635, 174636, 174637, 174638, 
+    174639, 174640, 174641, 174642, 174643, 174644, 174645, 174646, 174647, 
+    174648, 174649, 174650, 174651, 174652, 174653, 174654, 174655, 174656, 
+    174657, 174658, 174659, 174660, 174661, 174662, 174663, 174664, 174665, 
+    174666, 174667, 174668, 174669, 174670, 174671, 174672, 174673, 174674, 
+    174675, 174676, 174677, 174678, 174679, 174680, 174681, 174682, 174683, 
+    174684, 174685, 174686, 174687, 174688, 174689, 174690, 174691, 174692, 
+    174693, 174694, 174695, 174696, 174697, 174698, 174699, 174700, 174701, 
+    174702, 174703, 174704, 174705, 174706, 174707, 174708, 174709, 174710, 
+    174711, 174712, 174713, 174714, 174715, 174716, 174717, 174718, 174719, 
+    174720, 174721, 174722, 174723, 174724, 174725, 174726, 174727, 174728, 
+    174729, 174730, 174731, 174732, 174733, 174734, 174735, 174736, 174737, 
+    174738, 174739, 174740, 174741, 174742, 174743, 174744, 174745, 174746, 
+    174747, 174748, 174749, 174750, 174751, 174752, 174753, 174754, 174755, 
+    174756, 174757, 174758, 174759, 174760, 174761, 174762, 174763, 174764, 
+    174765, 174766, 174767, 174768, 174769, 174770, 174771, 174772, 174773, 
+    174774, 174775, 174776, 174777, 174778, 174779, 174780, 174781, 174782, 
+    174783, 174784, 174785, 174786, 174787, 174788, 174789, 174790, 174791, 
+    174792, 174793, 174794, 174795, 174796, 174797, 174798, 174799, 174800, 
+    174801, 174802, 174803, 174804, 174805, 174806, 174807, 174808, 174809, 
+    174810, 174811, 174812, 174813, 174814, 174815, 174816, 174817, 174818, 
+    174819, 174820, 174821, 174822, 174823, 174824, 174825, 174826, 174827, 
+    174828, 174829, 174830, 174831, 174832, 174833, 174834, 174835, 174836, 
+    174837, 174838, 174839, 174840, 174841, 174842, 174843, 174844, 174845, 
+    174846, 174847, 174848, 174849, 174850, 174851, 174852, 174853, 174854, 
+    174855, 174856, 174857, 174858, 174859, 174860, 174861, 174862, 174863, 
+    174864, 174865, 174866, 174867, 174868, 174869, 174870, 174871, 174872, 
+    174873, 174874, 174875, 174876, 174877, 174878, 174879, 174880, 174881, 
+    174882, 174883, 174884, 174885, 174886, 174887, 174888, 174889, 174890, 
+    174891, 174892, 174893, 174894, 174895, 174896, 174897, 174898, 174899, 
+    174900, 174901, 174902, 174903, 174904, 174905, 174906, 174907, 174908, 
+    174909, 174910, 174911, 174912, 174913, 174914, 174915, 174916, 174917, 
+    174918, 174919, 174920, 174921, 174922, 174923, 174924, 174925, 174926, 
+    174927, 174928, 174929, 174930, 174931, 174932, 174933, 174934, 174935, 
+    174936, 174937, 174938, 174939, 174940, 174941, 174942, 174943, 174944, 
+    174945, 174946, 174947, 174948, 174949, 174950, 174951, 174952, 174953, 
+    174954, 174955, 174956, 174957, 174958, 174959, 174960, 174961, 174962, 
+    174963, 174964, 174965, 174966, 174967, 174968, 174969, 174970, 174971, 
+    174972, 174973, 174974, 174975, 174976, 174977, 174978, 174979, 174980, 
+    174981, 174982, 174983, 174984, 174985, 174986, 174987, 174988, 174989, 
+    174990, 174991, 174992, 174993, 174994, 174995, 174996, 174997, 174998, 
+    174999, 175000, 175001, 175002, 175003, 175004, 175005, 175006, 175007, 
+    175008, 175009, 175010, 175011, 175012, 175013, 175014, 175015, 175016, 
+    175017, 175018, 175019, 175020, 175021, 175022, 175023, 175024, 175025, 
+    175026, 175027, 175028, 175029, 175030, 175031, 175032, 175033, 175034, 
+    175035, 175036, 175037, 175038, 175039, 175040, 175041, 175042, 175043, 
+    175044, 175045, 175046, 175047, 175048, 175049, 175050, 175051, 175052, 
+    175053, 175054, 175055, 175056, 175057, 175058, 175059, 175060, 175061, 
+    175062, 175063, 175064, 175065, 175066, 175067, 175068, 175069, 175070, 
+    175071, 175072, 175073, 175074, 175075, 175076, 175077, 175078, 175079, 
+    175080, 175081, 175082, 175083, 175084, 175085, 175086, 175087, 175088, 
+    175089, 175090, 175091, 175092, 175093, 175094, 175095, 175096, 175097, 
+    175098, 175099, 175100, 175101, 175102, 175103, 175104, 175105, 175106, 
+    175107, 175108, 175109, 175110, 175111, 175112, 175113, 175114, 175115, 
+    175116, 175117, 175118, 175119, 175120, 175121, 175122, 175123, 175124, 
+    175125, 175126, 175127, 175128, 175129, 175130, 175131, 175132, 175133, 
+    175134, 175135, 175136, 175137, 175138, 175139, 175140, 175141, 175142, 
+    175143, 175144, 175145, 175146, 175147, 175148, 175149, 175150, 175151, 
+    175152, 175153, 175154, 175155, 175156, 175157, 175158, 175159, 175160, 
+    175161, 175162, 175163, 175164, 175165, 175166, 175167, 175168, 175169, 
+    175170, 175171, 175172, 175173, 175174, 175175, 175176, 175177, 175178, 
+    175179, 175180, 175181, 175182, 175183, 175184, 175185, 175186, 175187, 
+    175188, 175189, 175190, 175191, 175192, 175193, 175194, 175195, 175196, 
+    175197, 175198, 175199, 175200, 175201, 175202, 175203, 175204, 175205, 
+    175206, 175207, 175208, 175209, 175210, 175211, 175212, 175213, 175214, 
+    175215, 175216, 175217, 175218, 175219, 175220, 175221, 175222, 175223, 
+    175224, 175225, 175226, 175227, 175228, 175229, 175230, 175231, 175232, 
+    175233, 175234, 175235, 175236, 175237, 175238, 175239, 175240, 175241, 
+    175242, 175243, 175244, 175245, 175246, 175247, 175248, 175249, 175250, 
+    175251, 175252, 175253, 175254, 175255, 175256, 175257, 175258, 175259, 
+    175260, 175261, 175262, 175263, 175264, 175265, 175266, 175267, 175268, 
+    175269, 175270, 175271, 175272, 175273, 175274, 175275, 175276, 175277, 
+    175278, 175279, 175280, 175281, 175282, 175283, 175284, 175285, 175286, 
+    175287, 175288, 175289, 175290, 175291, 175292, 175293, 175294, 175295, 
+    175296, 175297, 175298, 175299, 175300, 175301, 175302, 175303, 175304, 
+    175305, 175306, 175307, 175308, 175309, 175310, 175311, 175312, 175313, 
+    175314, 175315, 175316, 175317, 175318, 175319, 175320, 175321, 175322, 
+    175323, 175324, 175325, 175326, 175327, 175328, 175329, 175330, 175331, 
+    175332, 175333, 175334, 175335, 175336, 175337, 175338, 175339, 175340, 
+    175341, 175342, 175343, 175344, 175345, 175346, 175347, 175348, 175349, 
+    175350, 175351, 175352, 175353, 175354, 175355, 175356, 175357, 175358, 
+    175359, 175360, 175361, 175362, 175363, 175364, 175365, 175366, 175367, 
+    175368, 175369, 175370, 175371, 175372, 175373, 175374, 175375, 175376, 
+    175377, 175378, 175379, 175380, 175381, 175382, 175383, 175384, 175385, 
+    175386, 175387, 175388, 175389, 175390, 175391, 175392, 175393, 175394, 
+    175395, 175396, 175397, 175398, 175399, 175400, 175401, 175402, 175403, 
+    175404, 175405, 175406, 175407, 175408, 175409, 175410, 175411, 175412, 
+    175413, 175414, 175415, 175416, 175417, 175418, 175419, 175420, 175421, 
+    175422, 175423, 175424, 175425, 175426, 175427, 175428, 175429, 175430, 
+    175431, 175432, 175433, 175434, 175435, 175436, 175437, 175438, 175439, 
+    175440, 175441, 175442, 175443, 175444, 175445, 175446, 175447, 175448, 
+    175449, 175450, 175451, 175452, 175453, 175454, 175455, 175456, 175457, 
+    175458, 175459, 175460, 175461, 175462, 175463, 175464, 175465, 175466, 
+    175467, 175468, 175469, 175470, 175471, 175472, 175473, 175474, 175475, 
+    175476, 175477, 175478, 175479, 175480, 175481, 175482, 175483, 175484, 
+    175485, 175486, 175487, 175488, 175489, 175490, 175491, 175492, 175493, 
+    175494, 175495, 175496, 175497, 175498, 175499, 175500, 175501, 175502, 
+    175503, 175504, 175505, 175506, 175507, 175508, 175509, 175510, 175511, 
+    175512, 175513, 175514, 175515, 175516, 175517, 175518, 175519, 175520, 
+    175521, 175522, 175523, 175524, 175525, 175526, 175527, 175528, 175529, 
+    175530, 175531, 175532, 175533, 175534, 175535, 175536, 175537, 175538, 
+    175539, 175540, 175541, 175542, 175543, 175544, 175545, 175546, 175547, 
+    175548, 175549, 175550, 175551, 175552, 175553, 175554, 175555, 175556, 
+    175557, 175558, 175559, 175560, 175561, 175562, 175563, 175564, 175565, 
+    175566, 175567, 175568, 175569, 175570, 175571, 175572, 175573, 175574, 
+    175575, 175576, 175577, 175578, 175579, 175580, 175581, 175582, 175583, 
+    175584, 175585, 175586, 175587, 175588, 175589, 175590, 175591, 175592, 
+    175593, 175594, 175595, 175596, 175597, 175598, 175599, 175600, 175601, 
+    175602, 175603, 175604, 175605, 175606, 175607, 175608, 175609, 175610, 
+    175611, 175612, 175613, 175614, 175615, 175616, 175617, 175618, 175619, 
+    175620, 175621, 175622, 175623, 175624, 175625, 175626, 175627, 175628, 
+    175629, 175630, 175631, 175632, 175633, 175634, 175635, 175636, 175637, 
+    175638, 175639, 175640, 175641, 175642, 175643, 175644, 175645, 175646, 
+    175647, 175648, 175649, 175650, 175651, 175652, 175653, 175654, 175655, 
+    175656, 175657, 175658, 175659, 175660, 175661, 175662, 175663, 175664, 
+    175665, 175666, 175667, 175668, 175669, 175670, 175671, 175672, 175673, 
+    175674, 175675, 175676, 175677, 175678, 175679, 175680, 175681, 175682, 
+    175683, 175684, 175685, 175686, 175687, 175688, 175689, 175690, 175691, 
+    175692, 175693, 175694, 175695, 175696, 175697, 175698, 175699, 175700, 
+    175701, 175702, 175703, 175704, 175705, 175706, 175707, 175708, 175709, 
+    175710, 175711, 175712, 175713, 175714, 175715, 175716, 175717, 175718, 
+    175719, 175720, 175721, 175722, 175723, 175724, 175725, 175726, 175727, 
+    175728, 175729, 175730, 175731, 175732, 175733, 175734, 175735, 175736, 
+    175737, 175738, 175739, 175740, 175741, 175742, 175743, 175744, 175745, 
+    175746, 175747, 175748, 175749, 175750, 175751, 175752, 175753, 175754, 
+    175755, 175756, 175757, 175758, 175759, 175760, 175761, 175762, 175763, 
+    175764, 175765, 175766, 175767, 175768, 175769, 175770, 175771, 175772, 
+    175773, 175774, 175775, 175776, 175777, 175778, 175779, 175780, 175781, 
+    175782, 175783, 175784, 175785, 175786, 175787, 175788, 175789, 175790, 
+    175791, 175792, 175793, 175794, 175795, 175796, 175797, 175798, 175799, 
+    175800, 175801, 175802, 175803, 175804, 175805, 175806, 175807, 175808, 
+    175809, 175810, 175811, 175812, 175813, 175814, 175815, 175816, 175817, 
+    175818, 175819, 175820, 175821, 175822, 175823, 175824, 175825, 175826, 
+    175827, 175828, 175829, 175830, 175831, 175832, 175833, 175834, 175835, 
+    175836, 175837, 175838, 175839, 175840, 175841, 175842, 175843, 175844, 
+    175845, 175846, 175847, 175848, 175849, 175850, 175851, 175852, 175853, 
+    175854, 175855, 175856, 175857, 175858, 175859, 175860, 175861, 175862, 
+    175863, 175864, 175865, 175866, 175867, 175868, 175869, 175870, 175871, 
+    175872, 175873, 175874, 175875, 175876, 175877, 175878, 175879, 175880, 
+    175881, 175882, 175883, 175884, 175885, 175886, 175887, 175888, 175889, 
+    175890, 175891, 175892, 175893, 175894, 175895, 175896, 175897, 175898, 
+    175899, 175900, 175901, 175902, 175903, 175904, 175905, 175906, 175907, 
+    175908, 175909, 175910, 175911, 175912, 175913, 175914, 175915, 175916, 
+    175917, 175918, 175919, 175920, 175921, 175922, 175923, 175924, 175925, 
+    175926, 175927, 175928, 175929, 175930, 175931, 175932, 175933, 175934, 
+    175935, 175936, 175937, 175938, 175939, 175940, 175941, 175942, 175943, 
+    175944, 175945, 175946, 175947, 175948, 175949, 175950, 175951, 175952, 
+    175953, 175954, 175955, 175956, 175957, 175958, 175959, 175960, 175961, 
+    175962, 175963, 175964, 175965, 175966, 175967, 175968, 175969, 175970, 
+    175971, 175972, 175973, 175974, 175975, 175976, 175977, 175978, 175979, 
+    175980, 175981, 175982, 175983, 175984, 175985, 175986, 175987, 175988, 
+    175989, 175990, 175991, 175992, 175993, 175994, 175995, 175996, 175997, 
+    175998, 175999, 176000, 176001, 176002, 176003, 176004, 176005, 176006, 
+    176007, 176008, 176009, 176010, 176011, 176012, 176013, 176014, 176015, 
+    176016, 176017, 176018, 176019, 176020, 176021, 176022, 176023, 176024, 
+    176025, 176026, 176027, 176028, 176029, 176030, 176031, 176032, 176033, 
+    176034, 176035, 176036, 176037, 176038, 176039, 176040, 176041, 176042, 
+    176043, 176044, 176045, 176046, 176047, 176048, 176049, 176050, 176051, 
+    176052, 176053, 176054, 176055, 176056, 176057, 176058, 176059, 176060, 
+    176061, 176062, 176063, 176064, 176065, 176066, 176067, 176068, 176069, 
+    176070, 176071, 176072, 176073, 176074, 176075, 176076, 176077, 176078, 
+    176079, 176080, 176081, 176082, 176083, 176084, 176085, 176086, 176087, 
+    176088, 176089, 176090, 176091, 176092, 176093, 176094, 176095, 176096, 
+    176097, 176098, 176099, 176100, 176101, 176102, 176103, 176104, 176105, 
+    176106, 176107, 176108, 176109, 176110, 176111, 176112, 176113, 176114, 
+    176115, 176116, 176117, 176118, 176119, 176120, 176121, 176122, 176123, 
+    176124, 176125, 176126, 176127, 176128, 176129, 176130, 176131, 176132, 
+    176133, 176134, 176135, 176136, 176137, 176138, 176139, 176140, 176141, 
+    176142, 176143, 176144, 176145, 176146, 176147, 176148, 176149, 176150, 
+    176151, 176152, 176153, 176154, 176155, 176156, 176157, 176158, 176159, 
+    176160, 176161, 176162, 176163, 176164, 176165, 176166, 176167, 176168, 
+    176169, 176170, 176171, 176172, 176173, 176174, 176175, 176176, 176177, 
+    176178, 176179, 176180, 176181, 176182, 176183, 176184, 176185, 176186, 
+    176187, 176188, 176189, 176190, 176191, 176192, 176193, 176194, 176195, 
+    176196, 176197, 176198, 176199, 176200, 176201, 176202, 176203, 176204, 
+    176205, 176206, 176207, 176208, 176209, 176210, 176211, 176212, 176213, 
+    176214, 176215, 176216, 176217, 176218, 176219, 176220, 176221, 176222, 
+    176223, 176224, 176225, 176226, 176227, 176228, 176229, 176230, 176231, 
+    176232, 176233, 176234, 176235, 176236, 176237, 176238, 176239, 176240, 
+    176241, 176242, 176243, 176244, 176245, 176246, 176247, 176248, 176249, 
+    176250, 176251, 176252, 176253, 176254, 176255, 176256, 176257, 176258, 
+    176259, 176260, 176261, 176262, 176263, 176264, 176265, 176266, 176267, 
+    176268, 176269, 176270, 176271, 176272, 176273, 176274, 176275, 176276, 
+    176277, 176278, 176279, 176280, 176281, 176282, 176283, 176284, 176285, 
+    176286, 176287, 176288, 176289, 176290, 176291, 176292, 176293, 176294, 
+    176295, 176296, 176297, 176298, 176299, 176300, 176301, 176302, 176303, 
+    176304, 176305, 176306, 176307, 176308, 176309, 176310, 176311, 176312, 
+    176313, 176314, 176315, 176316, 176317, 176318, 176319, 176320, 176321, 
+    176322, 176323, 176324, 176325, 176326, 176327, 176328, 176329, 176330, 
+    176331, 176332, 176333, 176334, 176335, 176336, 176337, 176338, 176339, 
+    176340, 176341, 176342, 176343, 176344, 176345, 176346, 176347, 176348, 
+    176349, 176350, 176351, 176352, 176353, 176354, 176355, 176356, 176357, 
+    176358, 176359, 176360, 176361, 176362, 176363, 176364, 176365, 176366, 
+    176367, 176368, 176369, 176370, 176371, 176372, 176373, 176374, 176375, 
+    176376, 176377, 176378, 176379, 176380, 176381, 176382, 176383, 176384, 
+    176385, 176386, 176387, 176388, 176389, 176390, 176391, 176392, 176393, 
+    176394, 176395, 176396, 176397, 176398, 176399, 176400, 176401, 176402, 
+    176403, 176404, 176405, 176406, 176407, 176408, 176409, 176410, 176411, 
+    176412, 176413, 176414, 176415, 176416, 176417, 176418, 176419, 176420, 
+    176421, 176422, 176423, 176424, 176425, 176426, 176427, 176428, 176429, 
+    176430, 176431, 176432, 176433, 176434, 176435, 176436, 176437, 176438, 
+    176439, 176440, 176441, 176442, 176443, 176444, 176445, 176446, 176447, 
+    176448, 176449, 176450, 176451, 176452, 176453, 176454, 176455, 176456, 
+    176457, 176458, 176459, 176460, 176461, 176462, 176463, 176464, 176465, 
+    176466, 176467, 176468, 176469, 176470, 176471, 176472, 176473, 176474, 
+    176475, 176476, 176477, 176478, 176479, 176480, 176481, 176482, 176483, 
+    176484, 176485, 176486, 176487, 176488, 176489, 176490, 176491, 176492, 
+    176493, 176494, 176495, 176496, 176497, 176498, 176499, 176500, 176501, 
+    176502, 176503, 176504, 176505, 176506, 176507, 176508, 176509, 176510, 
+    176511, 176512, 176513, 176514, 176515, 176516, 176517, 176518, 176519, 
+    176520, 176521, 176522, 176523, 176524, 176525, 176526, 176527, 176528, 
+    176529, 176530, 176531, 176532, 176533, 176534, 176535, 176536, 176537, 
+    176538, 176539, 176540, 176541, 176542, 176543, 176544, 176545, 176546, 
+    176547, 176548, 176549, 176550, 176551, 176552, 176553, 176554, 176555, 
+    176556, 176557, 176558, 176559, 176560, 176561, 176562, 176563, 176564, 
+    176565, 176566, 176567, 176568, 176569, 176570, 176571, 176572, 176573, 
+    176574, 176575, 176576, 176577, 176578, 176579, 176580, 176581, 176582, 
+    176583, 176584, 176585, 176586, 176587, 176588, 176589, 176590, 176591, 
+    176592, 176593, 176594, 176595, 176596, 176597, 176598, 176599, 176600, 
+    176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608, 176609, 
+    176610, 176611, 176612, 176613, 176614, 176615, 176616, 176617, 176618, 
+    176619, 176620, 176621, 176622, 176623, 176624, 176625, 176626, 176627, 
+    176628, 176629, 176630, 176631, 176632, 176633, 176634, 176635, 176636, 
+    176637, 176638, 176639, 176640, 176641, 176642, 176643, 176644, 176645, 
+    176646, 176647, 176648, 176649, 176650, 176651, 176652, 176653, 176654, 
+    176655, 176656, 176657, 176658, 176659, 176660, 176661, 176662, 176663, 
+    176664, 176665, 176666, 176667, 176668, 176669, 176670, 176671, 176672, 
+    176673, 176674, 176675, 176676, 176677, 176678, 176679, 176680, 176681, 
+    176682, 176683, 176684, 176685, 176686, 176687, 176688, 176689, 176690, 
+    176691, 176692, 176693, 176694, 176695, 176696, 176697, 176698, 176699, 
+    176700, 176701, 176702, 176703, 176704, 176705, 176706, 176707, 176708, 
+    176709, 176710, 176711, 176712, 176713, 176714, 176715, 176716, 176717, 
+    176718, 176719, 176720, 176721, 176722, 176723, 176724, 176725, 176726, 
+    176727, 176728, 176729, 176730, 176731, 176732, 176733, 176734, 176735, 
+    176736, 176737, 176738, 176739, 176740, 176741, 176742, 176743, 176744, 
+    176745, 176746, 176747, 176748, 176749, 176750, 176751, 176752, 176753, 
+    176754, 176755, 176756, 176757, 176758, 176759, 176760, 176761, 176762, 
+    176763, 176764, 176765, 176766, 176767, 176768, 176769, 176770, 176771, 
+    176772, 176773, 176774, 176775, 176776, 176777, 176778, 176779, 176780, 
+    176781, 176782, 176783, 176784, 176785, 176786, 176787, 176788, 176789, 
+    176790, 176791, 176792, 176793, 176794, 176795, 176796, 176797, 176798, 
+    176799, 176800, 176801, 176802, 176803, 176804, 176805, 176806, 176807, 
+    176808, 176809, 176810, 176811, 176812, 176813, 176814, 176815, 176816, 
+    176817, 176818, 176819, 176820, 176821, 176822, 176823, 176824, 176825, 
+    176826, 176827, 176828, 176829, 176830, 176831, 176832, 176833, 176834, 
+    176835, 176836, 176837, 176838, 176839, 176840, 176841, 176842, 176843, 
+    176844, 176845, 176846, 176847, 176848, 176849, 176850, 176851, 176852, 
+    176853, 176854, 176855, 176856, 176857, 176858, 176859, 176860, 176861, 
+    176862, 176863, 176864, 176865, 176866, 176867, 176868, 176869, 176870, 
+    176871, 176872, 176873, 176874, 176875, 176876, 176877, 176878, 176879, 
+    176880, 176881, 176882, 176883, 176884, 176885, 176886, 176887, 176888, 
+    176889, 176890, 176891, 176892, 176893, 176894, 176895, 176896, 176897, 
+    176898, 176899, 176900, 176901, 176902, 176903, 176904, 176905, 176906, 
+    176907, 176908, 176909, 176910, 176911, 176912, 176913, 176914, 176915, 
+    176916, 176917, 176918, 176919, 176920, 176921, 176922, 176923, 176924, 
+    176925, 176926, 176927, 176928, 176929, 176930, 176931, 176932, 176933, 
+    176934, 176935, 176936, 176937, 176938, 176939, 176940, 176941, 176942, 
+    176943, 176944, 176945, 176946, 176947, 176948, 176949, 176950, 176951, 
+    176952, 176953, 176954, 176955, 176956, 176957, 176958, 176959, 176960, 
+    176961, 176962, 176963, 176964, 176965, 176966, 176967, 176968, 176969, 
+    176970, 176971, 176972, 176973, 176974, 176975, 176976, 176977, 176978, 
+    176979, 176980, 176981, 176982, 176983, 176984, 176985, 176986, 176987, 
+    176988, 176989, 176990, 176991, 176992, 176993, 176994, 176995, 176996, 
+    176997, 176998, 176999, 177000, 177001, 177002, 177003, 177004, 177005, 
+    177006, 177007, 177008, 177009, 177010, 177011, 177012, 177013, 177014, 
+    177015, 177016, 177017, 177018, 177019, 177020, 177021, 177022, 177023, 
+    177024, 177025, 177026, 177027, 177028, 177029, 177030, 177031, 177032, 
+    177033, 177034, 177035, 177036, 177037, 177038, 177039, 177040, 177041, 
+    177042, 177043, 177044, 177045, 177046, 177047, 177048, 177049, 177050, 
+    177051, 177052, 177053, 177054, 177055, 177056, 177057, 177058, 177059, 
+    177060, 177061, 177062, 177063, 177064, 177065, 177066, 177067, 177068, 
+    177069, 177070, 177071, 177072, 177073, 177074, 177075, 177076, 177077, 
+    177078, 177079, 177080, 177081, 177082, 177083, 177084, 177085, 177086, 
+    177087, 177088, 177089, 177090, 177091, 177092, 177093, 177094, 177095, 
+    177096, 177097, 177098, 177099, 177100, 177101, 177102, 177103, 177104, 
+    177105, 177106, 177107, 177108, 177109, 177110, 177111, 177112, 177113, 
+    177114, 177115, 177116, 177117, 177118, 177119, 177120, 177121, 177122, 
+    177123, 177124, 177125, 177126, 177127, 177128, 177129, 177130, 177131, 
+    177132, 177133, 177134, 177135, 177136, 177137, 177138, 177139, 177140, 
+    177141, 177142, 177143, 177144, 177145, 177146, 177147, 177148, 177149, 
+    177150, 177151, 177152, 177153, 177154, 177155, 177156, 177157, 177158, 
+    177159, 177160, 177161, 177162, 177163, 177164, 177165, 177166, 177167, 
+    177168, 177169, 177170, 177171, 177172, 177173, 177174, 177175, 177176, 
+    177177, 177178, 177179, 177180, 177181, 177182, 177183, 177184, 177185, 
+    177186, 177187, 177188, 177189, 177190, 177191, 177192, 177193, 177194, 
+    177195, 177196, 177197, 177198, 177199, 177200, 177201, 177202, 177203, 
+    177204, 177205, 177206, 177207, 177208, 177209, 177210, 177211, 177212, 
+    177213, 177214, 177215, 177216, 177217, 177218, 177219, 177220, 177221, 
+    177222, 177223, 177224, 177225, 177226, 177227, 177228, 177229, 177230, 
+    177231, 177232, 177233, 177234, 177235, 177236, 177237, 177238, 177239, 
+    177240, 177241, 177242, 177243, 177244, 177245, 177246, 177247, 177248, 
+    177249, 177250, 177251, 177252, 177253, 177254, 177255, 177256, 177257, 
+    177258, 177259, 177260, 177261, 177262, 177263, 177264, 177265, 177266, 
+    177267, 177268, 177269, 177270, 177271, 177272, 177273, 177274, 177275, 
+    177276, 177277, 177278, 177279, 177280, 177281, 177282, 177283, 177284, 
+    177285, 177286, 177287, 177288, 177289, 177290, 177291, 177292, 177293, 
+    177294, 177295, 177296, 177297, 177298, 177299, 177300, 177301, 177302, 
+    177303, 177304, 177305, 177306, 177307, 177308, 177309, 177310, 177311, 
+    177312, 177313, 177314, 177315, 177316, 177317, 177318, 177319, 177320, 
+    177321, 177322, 177323, 177324, 177325, 177326, 177327, 177328, 177329, 
+    177330, 177331, 177332, 177333, 177334, 177335, 177336, 177337, 177338, 
+    177339, 177340, 177341, 177342, 177343, 177344, 177345, 177346, 177347, 
+    177348, 177349, 177350, 177351, 177352, 177353, 177354, 177355, 177356, 
+    177357, 177358, 177359, 177360, 177361, 177362, 177363, 177364, 177365, 
+    177366, 177367, 177368, 177369, 177370, 177371, 177372, 177373, 177374, 
+    177375, 177376, 177377, 177378, 177379, 177380, 177381, 177382, 177383, 
+    177384, 177385, 177386, 177387, 177388, 177389, 177390, 177391, 177392, 
+    177393, 177394, 177395, 177396, 177397, 177398, 177399, 177400, 177401, 
+    177402, 177403, 177404, 177405, 177406, 177407, 177408, 177409, 177410, 
+    177411, 177412, 177413, 177414, 177415, 177416, 177417, 177418, 177419, 
+    177420, 177421, 177422, 177423, 177424, 177425, 177426, 177427, 177428, 
+    177429, 177430, 177431, 177432, 177433, 177434, 177435, 177436, 177437, 
+    177438, 177439, 177440, 177441, 177442, 177443, 177444, 177445, 177446, 
+    177447, 177448, 177449, 177450, 177451, 177452, 177453, 177454, 177455, 
+    177456, 177457, 177458, 177459, 177460, 177461, 177462, 177463, 177464, 
+    177465, 177466, 177467, 177468, 177469, 177470, 177471, 177472, 177473, 
+    177474, 177475, 177476, 177477, 177478, 177479, 177480, 177481, 177482, 
+    177483, 177484, 177485, 177486, 177487, 177488, 177489, 177490, 177491, 
+    177492, 177493, 177494, 177495, 177496, 177497, 177498, 177499, 177500, 
+    177501, 177502, 177503, 177504, 177505, 177506, 177507, 177508, 177509, 
+    177510, 177511, 177512, 177513, 177514, 177515, 177516, 177517, 177518, 
+    177519, 177520, 177521, 177522, 177523, 177524, 177525, 177526, 177527, 
+    177528, 177529, 177530, 177531, 177532, 177533, 177534, 177535, 177536, 
+    177537, 177538, 177539, 177540, 177541, 177542, 177543, 177544, 177545, 
+    177546, 177547, 177548, 177549, 177550, 177551, 177552, 177553, 177554, 
+    177555, 177556, 177557, 177558, 177559, 177560, 177561, 177562, 177563, 
+    177564, 177565, 177566, 177567, 177568, 177569, 177570, 177571, 177572, 
+    177573, 177574, 177575, 177576, 177577, 177578, 177579, 177580, 177581, 
+    177582, 177583, 177584, 177585, 177586, 177587, 177588, 177589, 177590, 
+    177591, 177592, 177593, 177594, 177595, 177596, 177597, 177598, 177599, 
+    177600, 177601, 177602, 177603, 177604, 177605, 177606, 177607, 177608, 
+    177609, 177610, 177611, 177612, 177613, 177614, 177615, 177616, 177617, 
+    177618, 177619, 177620, 177621, 177622, 177623, 177624, 177625, 177626, 
+    177627, 177628, 177629, 177630, 177631, 177632, 177633, 177634, 177635, 
+    177636, 177637, 177638, 177639, 177640, 177641, 177642, 177643, 177644, 
+    177645, 177646, 177647, 177648, 177649, 177650, 177651, 177652, 177653, 
+    177654, 177655, 177656, 177657, 177658, 177659, 177660, 177661, 177662, 
+    177663, 177664, 177665, 177666, 177667, 177668, 177669, 177670, 177671, 
+    177672, 177673, 177674, 177675, 177676, 177677, 177678, 177679, 177680, 
+    177681, 177682, 177683, 177684, 177685, 177686, 177687, 177688, 177689, 
+    177690, 177691, 177692, 177693, 177694, 177695, 177696, 177697, 177698, 
+    177699, 177700, 177701, 177702, 177703, 177704, 177705, 177706, 177707, 
+    177708, 177709, 177710, 177711, 177712, 177713, 177714, 177715, 177716, 
+    177717, 177718, 177719, 177720, 177721, 177722, 177723, 177724, 177725, 
+    177726, 177727, 177728, 177729, 177730, 177731, 177732, 177733, 177734, 
+    177735, 177736, 177737, 177738, 177739, 177740, 177741, 177742, 177743, 
+    177744, 177745, 177746, 177747, 177748, 177749, 177750, 177751, 177752, 
+    177753, 177754, 177755, 177756, 177757, 177758, 177759, 177760, 177761, 
+    177762, 177763, 177764, 177765, 177766, 177767, 177768, 177769, 177770, 
+    177771, 177772, 177773, 177774, 177775, 177776, 177777, 177778, 177779, 
+    177780, 177781, 177782, 177783, 177784, 177785, 177786, 177787, 177788, 
+    177789, 177790, 177791, 177792, 177793, 177794, 177795, 177796, 177797, 
+    177798, 177799, 177800, 177801, 177802, 177803, 177804, 177805, 177806, 
+    177807, 177808, 177809, 177810, 177811, 177812, 177813, 177814, 177815, 
+    177816, 177817, 177818, 177819, 177820, 177821, 177822, 177823, 177824, 
+    177825, 177826, 177827, 177828, 177829, 177830, 177831, 177832, 177833, 
+    177834, 177835, 177836, 177837, 177838, 177839, 177840, 177841, 177842, 
+    177843, 177844, 177845, 177846, 177847, 177848, 177849, 177850, 177851, 
+    177852, 177853, 177854, 177855, 177856, 177857, 177858, 177859, 177860, 
+    177861, 177862, 177863, 177864, 177865, 177866, 177867, 177868, 177869, 
+    177870, 177871, 177872, 177873, 177874, 177875, 177876, 177877, 177878, 
+    177879, 177880, 177881, 177882, 177883, 177884, 177885, 177886, 177887, 
+    177888, 177889, 177890, 177891, 177892, 177893, 177894, 177895, 177896, 
+    177897, 177898, 177899, 177900, 177901, 177902, 177903, 177904, 177905, 
+    177906, 177907, 177908, 177909, 177910, 177911, 177912, 177913, 177914, 
+    177915, 177916, 177917, 177918, 177919, 177920, 177921, 177922, 177923, 
+    177924, 177925, 177926, 177927, 177928, 177929, 177930, 177931, 177932, 
+    177933, 177934, 177935, 177936, 177937, 177938, 177939, 177940, 177941, 
+    177942, 177943, 177944, 177945, 177946, 177947, 177948, 177949, 177950, 
+    177951, 177952, 177953, 177954, 177955, 177956, 177957, 177958, 177959, 
+    177960, 177961, 177962, 177963, 177964, 177965, 177966, 177967, 177968, 
+    177969, 177970, 177971, 177972, 177973, 177974, 177975, 177976, 177977, 
+    177978, 177979, 177980, 177981, 177982, 177983, 177984, 177985, 177986, 
+    177987, 177988, 177989, 177990, 177991, 177992, 177993, 177994, 177995, 
+    177996, 177997, 177998, 177999, 178000, 178001, 178002, 178003, 178004, 
+    178005, 178006, 178007, 178008, 178009, 178010, 178011, 178012, 178013, 
+    178014, 178015, 178016, 178017, 178018, 178019, 178020, 178021, 178022, 
+    178023, 178024, 178025, 178026, 178027, 178028, 178029, 178030, 178031, 
+    178032, 178033, 178034, 178035, 178036, 178037, 178038, 178039, 178040, 
+    178041, 178042, 178043, 178044, 178045, 178046, 178047, 178048, 178049, 
+    178050, 178051, 178052, 178053, 178054, 178055, 178056, 178057, 178058, 
+    178059, 178060, 178061, 178062, 178063, 178064, 178065, 178066, 178067, 
+    178068, 178069, 178070, 178071, 178072, 178073, 178074, 178075, 178076, 
+    178077, 178078, 178079, 178080, 178081, 178082, 178083, 178084, 178085, 
+    178086, 178087, 178088, 178089, 178090, 178091, 178092, 178093, 178094, 
+    178095, 178096, 178097, 178098, 178099, 178100, 178101, 178102, 178103, 
+    178104, 178105, 178106, 178107, 178108, 178109, 178110, 178111, 178112, 
+    178113, 178114, 178115, 178116, 178117, 178118, 178119, 178120, 178121, 
+    178122, 178123, 178124, 178125, 178126, 178127, 178128, 178129, 178130, 
+    178131, 178132, 178133, 178134, 178135, 178136, 178137, 178138, 178139, 
+    178140, 178141, 178142, 178143, 178144, 178145, 178146, 178147, 178148, 
+    178149, 178150, 178151, 178152, 178153, 178154, 178155, 178156, 178157, 
+    178158, 178159, 178160, 178161, 178162, 178163, 178164, 178165, 178166, 
+    178167, 178168, 178169, 178170, 178171, 178172, 178173, 178174, 178175, 
+    178176, 178177, 178178, 178179, 178180, 178181, 178182, 178183, 178184, 
+    178185, 178186, 178187, 178188, 178189, 178190, 178191, 178192, 178193, 
+    178194, 178195, 178196, 178197, 178198, 178199, 178200, 178201, 178202, 
+    178203, 178204, 178205, 178206, 178207, 178208, 178209, 178210, 178211, 
+    178212, 178213, 178214, 178215, 178216, 178217, 178218, 178219, 178220, 
+    178221, 178222, 178223, 178224, 178225, 178226, 178227, 178228, 178229, 
+    178230, 178231, 178232, 178233, 178234, 178235, 178236, 178237, 178238, 
+    178239, 178240, 178241, 178242, 178243, 178244, 178245, 178246, 178247, 
+    178248, 178249, 178250, 178251, 178252, 178253, 178254, 178255, 178256, 
+    178257, 178258, 178259, 178260, 178261, 178262, 178263, 178264, 178265, 
+    178266, 178267, 178268, 178269, 178270, 178271, 178272, 178273, 178274, 
+    178275, 178276, 178277, 178278, 178279, 178280, 178281, 178282, 178283, 
+    178284, 178285, 178286, 178287, 178288, 178289, 178290, 178291, 178292, 
+    178293, 178294, 178295, 178296, 178297, 178298, 178299, 178300, 178301, 
+    178302, 178303, 178304, 178305, 178306, 178307, 178308, 178309, 178310, 
+    178311, 178312, 178313, 178314, 178315, 178316, 178317, 178318, 178319, 
+    178320, 178321, 178322, 178323, 178324, 178325, 178326, 178327, 178328, 
+    178329, 178330, 178331, 178332, 178333, 178334, 178335, 178336, 178337, 
+    178338, 178339, 178340, 178341, 178342, 178343, 178344, 178345, 178346, 
+    178347, 178348, 178349, 178350, 178351, 178352, 178353, 178354, 178355, 
+    178356, 178357, 178358, 178359, 178360, 178361, 178362, 178363, 178364, 
+    178365, 178366, 178367, 178368, 178369, 178370, 178371, 178372, 178373, 
+    178374, 178375, 178376, 178377, 178378, 178379, 178380, 178381, 178382, 
+    178383, 178384, 178385, 178386, 178387, 178388, 178389, 178390, 178391, 
+    178392, 178393, 178394, 178395, 178396, 178397, 178398, 178399, 178400, 
+    178401, 178402, 178403, 178404, 178405, 178406, 178407, 178408, 178409, 
+    178410, 178411, 178412, 178413, 178414, 178415, 178416, 178417, 178418, 
+    178419, 178420, 178421, 178422, 178423, 178424, 178425, 178426, 178427, 
+    178428, 178429, 178430, 178431, 178432, 178433, 178434, 178435, 178436, 
+    178437, 178438, 178439, 178440, 178441, 178442, 178443, 178444, 178445, 
+    178446, 178447, 178448, 178449, 178450, 178451, 178452, 178453, 178454, 
+    178455, 178456, 178457, 178458, 178459, 178460, 178461, 178462, 178463, 
+    178464, 178465, 178466, 178467, 178468, 178469, 178470, 178471, 178472, 
+    178473, 178474, 178475, 178476, 178477, 178478, 178479, 178480, 178481, 
+    178482, 178483, 178484, 178485, 178486, 178487, 178488, 178489, 178490, 
+    178491, 178492, 178493, 178494, 178495, 178496, 178497, 178498, 178499, 
+    178500, 178501, 178502, 178503, 178504, 178505, 178506, 178507, 178508, 
+    178509, 178510, 178511, 178512, 178513, 178514, 178515, 178516, 178517, 
+    178518, 178519, 178520, 178521, 178522, 178523, 178524, 178525, 178526, 
+    178527, 178528, 178529, 178530, 178531, 178532, 178533, 178534, 178535, 
+    178536, 178537, 178538, 178539, 178540, 178541, 178542, 178543, 178544, 
+    178545, 178546, 178547, 178548, 178549, 178550, 178551, 178552, 178553, 
+    178554, 178555, 178556, 178557, 178558, 178559, 178560, 178561, 178562, 
+    178563, 178564, 178565, 178566, 178567, 178568, 178569, 178570, 178571, 
+    178572, 178573, 178574, 178575, 178576, 178577, 178578, 178579, 178580, 
+    178581, 178582, 178583, 178584, 178585, 178586, 178587, 178588, 178589, 
+    178590, 178591, 178592, 178593, 178594, 178595, 178596, 178597, 178598, 
+    178599, 178600, 178601, 178602, 178603, 178604, 178605, 178606, 178607, 
+    178608, 178609, 178610, 178611, 178612, 178613, 178614, 178615, 178616, 
+    178617, 178618, 178619, 178620, 178621, 178622, 178623, 178624, 178625, 
+    178626, 178627, 178628, 178629, 178630, 178631, 178632, 178633, 178634, 
+    178635, 178636, 178637, 178638, 178639, 178640, 178641, 178642, 178643, 
+    178644, 178645, 178646, 178647, 178648, 178649, 178650, 178651, 178652, 
+    178653, 178654, 178655, 178656, 178657, 178658, 178659, 178660, 178661, 
+    178662, 178663, 178664, 178665, 178666, 178667, 178668, 178669, 178670, 
+    178671, 178672, 178673, 178674, 178675, 178676, 178677, 178678, 178679, 
+    178680, 178681, 178682, 178683, 178684, 178685, 178686, 178687, 178688, 
+    178689, 178690, 178691, 178692, 178693, 178694, 178695, 178696, 178697, 
+    178698, 178699, 178700, 178701, 178702, 178703, 178704, 178705, 178706, 
+    178707, 178708, 178709, 178710, 178711, 178712, 178713, 178714, 178715, 
+    178716, 178717, 178718, 178719, 178720, 178721, 178722, 178723, 178724, 
+    178725, 178726, 178727, 178728, 178729, 178730, 178731, 178732, 178733, 
+    178734, 178735, 178736, 178737, 178738, 178739, 178740, 178741, 178742, 
+    178743, 178744, 178745, 178746, 178747, 178748, 178749, 178750, 178751, 
+    178752, 178753, 178754, 178755, 178756, 178757, 178758, 178759, 178760, 
+    178761, 178762, 178763, 178764, 178765, 178766, 178767, 178768, 178769, 
+    178770, 178771, 178772, 178773, 178774, 178775, 178776, 178777, 178778, 
+    178779, 178780, 178781, 178782, 178783, 178784, 178785, 178786, 178787, 
+    178788, 178789, 178790, 178791, 178792, 178793, 178794, 178795, 178796, 
+    178797, 178798, 178799, 178800, 178801, 178802, 178803, 178804, 178805, 
+    178806, 178807, 178808, 178809, 178810, 178811, 178812, 178813, 178814, 
+    178815, 178816, 178817, 178818, 178819, 178820, 178821, 178822, 178823, 
+    178824, 178825, 178826, 178827, 178828, 178829, 178830, 178831, 178832, 
+    178833, 178834, 178835, 178836, 178837, 178838, 178839, 178840, 178841, 
+    178842, 178843, 178844, 178845, 178846, 178847, 178848, 178849, 178850, 
+    178851, 178852, 178853, 178854, 178855, 178856, 178857, 178858, 178859, 
+    178860, 178861, 178862, 178863, 178864, 178865, 178866, 178867, 178868, 
+    178869, 178870, 178871, 178872, 178873, 178874, 178875, 178876, 178877, 
+    178878, 178879, 178880, 178881, 178882, 178883, 178884, 178885, 178886, 
+    178887, 178888, 178889, 178890, 178891, 178892, 178893, 178894, 178895, 
+    178896, 178897, 178898, 178899, 178900, 178901, 178902, 178903, 178904, 
+    178905, 178906, 178907, 178908, 178909, 178910, 178911, 178912, 178913, 
+    178914, 178915, 178916, 178917, 178918, 178919, 178920, 178921, 178922, 
+    178923, 178924, 178925, 178926, 178927, 178928, 178929, 178930, 178931, 
+    178932, 178933, 178934, 178935, 178936, 178937, 178938, 178939, 178940, 
+    178941, 178942, 178943, 178944, 178945, 178946, 178947, 178948, 178949, 
+    178950, 178951, 178952, 178953, 178954, 178955, 178956, 178957, 178958, 
+    178959, 178960, 178961, 178962, 178963, 178964, 178965, 178966, 178967, 
+    178968, 178969, 178970, 178971, 178972, 178973, 178974, 178975, 178976, 
+    178977, 178978, 178979, 178980, 178981, 178982, 178983, 178984, 178985, 
+    178986, 178987, 178988, 178989, 178990, 178991, 178992, 178993, 178994, 
+    178995, 178996, 178997, 178998, 178999, 179000, 179001, 179002, 179003, 
+    179004, 179005, 179006, 179007, 179008, 179009, 179010, 179011, 179012, 
+    179013, 179014, 179015, 179016, 179017, 179018, 179019, 179020, 179021, 
+    179022, 179023, 179024, 179025, 179026, 179027, 179028, 179029, 179030, 
+    179031, 179032, 179033, 179034, 179035, 179036, 179037, 179038, 179039, 
+    179040, 179041, 179042, 179043, 179044, 179045, 179046, 179047, 179048, 
+    179049, 179050, 179051, 179052, 179053, 179054, 179055, 179056, 179057, 
+    179058, 179059, 179060, 179061, 179062, 179063, 179064, 179065, 179066, 
+    179067, 179068, 179069, 179070, 179071, 179072, 179073, 179074, 179075, 
+    179076, 179077, 179078, 179079, 179080, 179081, 179082, 179083, 179084, 
+    179085, 179086, 179087, 179088, 179089, 179090, 179091, 179092, 179093, 
+    179094, 179095, 179096, 179097, 179098, 179099, 179100, 179101, 179102, 
+    179103, 179104, 179105, 179106, 179107, 179108, 179109, 179110, 179111, 
+    179112, 179113, 179114, 179115, 179116, 179117, 179118, 179119, 179120, 
+    179121, 179122, 179123, 179124, 179125, 179126, 179127, 179128, 179129, 
+    179130, 179131, 179132, 179133, 179134, 179135, 179136, 179137, 179138, 
+    179139, 179140, 179141, 179142, 179143, 179144, 179145, 179146, 179147, 
+    179148, 179149, 179150, 179151, 179152, 179153, 179154, 179155, 179156, 
+    179157, 179158, 179159, 179160, 179161, 179162, 179163, 179164, 179165, 
+    179166, 179167, 179168, 179169, 179170, 179171, 179172, 179173, 179174, 
+    179175, 179176, 179177, 179178, 179179, 179180, 179181, 179182, 179183, 
+    179184, 179185, 179186, 179187, 179188, 179189, 179190, 179191, 179192, 
+    179193, 179194, 179195, 179196, 179197, 179198, 179199, 179200, 179201, 
+    179202, 179203, 179204, 179205, 179206, 179207, 179208, 179209, 179210, 
+    179211, 179212, 179213, 179214, 179215, 179216, 179217, 179218, 179219, 
+    179220, 179221, 179222, 179223, 179224, 179225, 179226, 179227, 179228, 
+    179229, 179230, 179231, 179232, 179233, 179234, 179235, 179236, 179237, 
+    179238, 179239, 179240, 179241, 179242, 179243, 179244, 179245, 179246, 
+    179247, 179248, 179249, 179250, 179251, 179252, 179253, 179254, 179255, 
+    179256, 179257, 179258, 179259, 179260, 179261, 179262, 179263, 179264, 
+    179265, 179266, 179267, 179268, 179269, 179270, 179271, 179272, 179273, 
+    179274, 179275, 179276, 179277, 179278, 179279, 179280, 179281, 179282, 
+    179283, 179284, 179285, 179286, 179287, 179288, 179289, 179290, 179291, 
+    179292, 179293, 179294, 179295, 179296, 179297, 179298, 179299, 179300, 
+    179301, 179302, 179303, 179304, 179305, 179306, 179307, 179308, 179309, 
+    179310, 179311, 179312, 179313, 179314, 179315, 179316, 179317, 179318, 
+    179319, 179320, 179321, 179322, 179323, 179324, 179325, 179326, 179327, 
+    179328, 179329, 179330, 179331, 179332, 179333, 179334, 179335, 179336, 
+    179337, 179338, 179339, 179340, 179341, 179342, 179343, 179344, 179345, 
+    179346, 179347, 179348, 179349, 179350, 179351, 179352, 179353, 179354, 
+    179355, 179356, 179357, 179358, 179359, 179360, 179361, 179362, 179363, 
+    179364, 179365, 179366, 179367, 179368, 179369, 179370, 179371, 179372, 
+    179373, 179374, 179375, 179376, 179377, 179378, 179379, 179380, 179381, 
+    179382, 179383, 179384, 179385, 179386, 179387, 179388, 179389, 179390, 
+    179391, 179392, 179393, 179394, 179395, 179396, 179397, 179398, 179399, 
+    179400, 179401, 179402, 179403, 179404, 179405, 179406, 179407, 179408, 
+    179409, 179410, 179411, 179412, 179413, 179414, 179415, 179416, 179417, 
+    179418, 179419, 179420, 179421, 179422, 179423, 179424, 179425, 179426, 
+    179427, 179428, 179429, 179430, 179431, 179432, 179433, 179434, 179435, 
+    179436, 179437, 179438, 179439, 179440, 179441, 179442, 179443, 179444, 
+    179445, 179446, 179447, 179448, 179449, 179450, 179451, 179452, 179453, 
+    179454, 179455, 179456, 179457, 179458, 179459, 179460, 179461, 179462, 
+    179463, 179464, 179465, 179466, 179467, 179468, 179469, 179470, 179471, 
+    179472, 179473, 179474, 179475, 179476, 179477, 179478, 179479, 179480, 
+    179481, 179482, 179483, 179484, 179485, 179486, 179487, 179488, 179489, 
+    179490, 179491, 179492, 179493, 179494, 179495, 179496, 179497, 179498, 
+    179499, 179500, 179501, 179502, 179503, 179504, 179505, 179506, 179507, 
+    179508, 179509, 179510, 179511, 179512, 179513, 179514, 179515, 179516, 
+    179517, 179518, 179519, 179520, 179521, 179522, 179523, 179524, 179525, 
+    179526, 179527, 179528, 179529, 179530, 179531, 179532, 179533, 179534, 
+    179535, 179536, 179537, 179538, 179539, 179540, 179541, 179542, 179543, 
+    179544, 179545, 179546, 179547, 179548, 179549, 179550, 179551, 179552, 
+    179553, 179554, 179555, 179556, 179557, 179558, 179559, 179560, 179561, 
+    179562, 179563, 179564, 179565, 179566, 179567, 179568, 179569, 179570, 
+    179571, 179572, 179573, 179574, 179575, 179576, 179577, 179578, 179579, 
+    179580, 179581, 179582, 179583, 179584, 179585, 179586, 179587, 179588, 
+    179589, 179590, 179591, 179592, 179593, 179594, 179595, 179596, 179597, 
+    179598, 179599, 179600, 179601, 179602, 179603, 179604, 179605, 179606, 
+    179607, 179608, 179609, 179610, 179611, 179612, 179613, 179614, 179615, 
+    179616, 179617, 179618, 179619, 179620, 179621, 179622, 179623, 179624, 
+    179625, 179626, 179627, 179628, 179629, 179630, 179631, 179632, 179633, 
+    179634, 179635, 179636, 179637, 179638, 179639, 179640, 179641, 179642, 
+    179643, 179644, 179645, 179646, 179647, 179648, 179649, 179650, 179651, 
+    179652, 179653, 179654, 179655, 179656, 179657, 179658, 179659, 179660, 
+    179661, 179662, 179663, 179664, 179665, 179666, 179667, 179668, 179669, 
+    179670, 179671, 179672, 179673, 179674, 179675, 179676, 179677, 179678, 
+    179679, 179680, 179681, 179682, 179683, 179684, 179685, 179686, 179687, 
+    179688, 179689, 179690, 179691, 179692, 179693, 179694, 179695, 179696, 
+    179697, 179698, 179699, 179700, 179701, 179702, 179703, 179704, 179705, 
+    179706, 179707, 179708, 179709, 179710, 179711, 179712, 179713, 179714, 
+    179715, 179716, 179717, 179718, 179719, 179720, 179721, 179722, 179723, 
+    179724, 179725, 179726, 179727, 179728, 179729, 179730, 179731, 179732, 
+    179733, 179734, 179735, 179736, 179737, 179738, 179739, 179740, 179741, 
+    179742, 179743, 179744, 179745, 179746, 179747, 179748, 179749, 179750, 
+    179751, 179752, 179753, 179754, 179755, 179756, 179757, 179758, 179759, 
+    179760, 179761, 179762, 179763, 179764, 179765, 179766, 179767, 179768, 
+    179769, 179770, 179771, 179772, 179773, 179774, 179775, 179776, 179777, 
+    179778, 179779, 179780, 179781, 179782, 179783, 179784, 179785, 179786, 
+    179787, 179788, 179789, 179790, 179791, 179792, 179793, 179794, 179795, 
+    179796, 179797, 179798, 179799, 179800, 179801, 179802, 179803, 179804, 
+    179805, 179806, 179807, 179808, 179809, 179810, 179811, 179812, 179813, 
+    179814, 179815, 179816, 179817, 179818, 179819, 179820, 179821, 179822, 
+    179823, 179824, 179825, 179826, 179827, 179828, 179829, 179830, 179831, 
+    179832, 179833, 179834, 179835, 179836, 179837, 179838, 179839, 179840, 
+    179841, 179842, 179843, 179844, 179845, 179846, 179847, 179848, 179849, 
+    179850, 179851, 179852, 179853, 179854, 179855, 179856, 179857, 179858, 
+    179859, 179860, 179861, 179862, 179863, 179864, 179865, 179866, 179867, 
+    179868, 179869, 179870, 179871, 179872, 179873, 179874, 179875, 179876, 
+    179877, 179878, 179879, 179880, 179881, 179882, 179883, 179884, 179885, 
+    179886, 179887, 179888, 179889, 179890, 179891, 179892, 179893, 179894, 
+    179895, 179896, 179897, 179898, 179899, 179900, 179901, 179902, 179903, 
+    179904, 179905, 179906, 179907, 179908, 179909, 179910, 179911, 179912, 
+    179913, 179914, 179915, 179916, 179917, 179918, 179919, 179920, 179921, 
+    179922, 179923, 179924, 179925, 179926, 179927, 179928, 179929, 179930, 
+    179931, 179932, 179933, 179934, 179935, 179936, 179937, 179938, 179939, 
+    179940, 179941, 179942, 179943, 179944, 179945, 179946, 179947, 179948, 
+    179949, 179950, 179951, 179952, 179953, 179954, 179955, 179956, 179957, 
+    179958, 179959, 179960, 179961, 179962, 179963, 179964, 179965, 179966, 
+    179967, 179968, 179969, 179970, 179971, 179972, 179973, 179974, 179975, 
+    179976, 179977, 179978, 179979, 179980, 179981, 179982, 179983, 179984, 
+    179985, 179986, 179987, 179988, 179989, 179990, 179991, 179992, 179993, 
+    179994, 179995, 179996, 179997, 179998, 179999, 180000, 180001, 180002, 
+    180003, 180004, 180005, 180006, 180007, 180008, 180009, 180010, 180011, 
+    180012, 180013, 180014, 180015, 180016, 180017, 180018, 180019, 180020, 
+    180021, 180022, 180023, 180024, 180025, 180026, 180027, 180028, 180029, 
+    180030, 180031, 180032, 180033, 180034, 180035, 180036, 180037, 180038, 
+    180039, 180040, 180041, 180042, 180043, 180044, 180045, 180046, 180047, 
+    180048, 180049, 180050, 180051, 180052, 180053, 180054, 180055, 180056, 
+    180057, 180058, 180059, 180060, 180061, 180062, 180063, 180064, 180065, 
+    180066, 180067, 180068, 180069, 180070, 180071, 180072, 180073, 180074, 
+    180075, 180076, 180077, 180078, 180079, 180080, 180081, 180082, 180083, 
+    180084, 180085, 180086, 180087, 180088, 180089, 180090, 180091, 180092, 
+    180093, 180094, 180095, 180096, 180097, 180098, 180099, 180100, 180101, 
+    180102, 180103, 180104, 180105, 180106, 180107, 180108, 180109, 180110, 
+    180111, 180112, 180113, 180114, 180115, 180116, 180117, 180118, 180119, 
+    180120, 180121, 180122, 180123, 180124, 180125, 180126, 180127, 180128, 
+    180129, 180130, 180131, 180132, 180133, 180134, 180135, 180136, 180137, 
+    180138, 180139, 180140, 180141, 180142, 180143, 180144, 180145, 180146, 
+    180147, 180148, 180149, 180150, 180151, 180152, 180153, 180154, 180155, 
+    180156, 180157, 180158, 180159, 180160, 180161, 180162, 180163, 180164, 
+    180165, 180166, 180167, 180168, 180169, 180170, 180171, 180172, 180173, 
+    180174, 180175, 180176, 180177, 180178, 180179, 180180, 180181, 180182, 
+    180183, 180184, 180185, 180186, 180187, 180188, 180189, 180190, 180191, 
+    180192, 180193, 180194, 180195, 180196, 180197, 180198, 180199, 180200, 
+    180201, 180202, 180203, 180204, 180205, 180206, 180207, 180208, 180209, 
+    180210, 180211, 180212, 180213, 180214, 180215, 180216, 180217, 180218, 
+    180219, 180220, 180221, 180222, 180223, 180224, 180225, 180226, 180227, 
+    180228, 180229, 180230, 180231, 180232, 180233, 180234, 180235, 180236, 
+    180237, 180238, 180239, 180240, 180241, 180242, 180243, 180244, 180245, 
+    180246, 180247, 180248, 180249, 180250, 180251, 180252, 180253, 180254, 
+    180255, 180256, 180257, 180258, 180259, 180260, 180261, 180262, 180263, 
+    180264, 180265, 180266, 180267, 180268, 180269, 180270, 180271, 180272, 
+    180273, 180274, 180275, 180276, 180277, 180278, 180279, 180280, 180281, 
+    180282, 180283, 180284, 180285, 180286, 180287, 180288, 180289, 180290, 
+    180291, 180292, 180293, 180294, 180295, 180296, 180297, 180298, 180299, 
+    180300, 180301, 180302, 180303, 180304, 180305, 180306, 180307, 180308, 
+    180309, 180310, 180311, 180312, 180313, 180314, 180315, 180316, 180317, 
+    180318, 180319, 180320, 180321, 180322, 180323, 180324, 180325, 180326, 
+    180327, 180328, 180329, 180330, 180331, 180332, 180333, 180334, 180335, 
+    180336, 180337, 180338, 180339, 180340, 180341, 180342, 180343, 180344, 
+    180345, 180346, 180347, 180348, 180349, 180350, 180351, 180352, 180353, 
+    180354, 180355, 180356, 180357, 180358, 180359, 180360, 180361, 180362, 
+    180363, 180364, 180365, 180366, 180367, 180368, 180369, 180370, 180371, 
+    180372, 180373, 180374, 180375, 180376, 180377, 180378, 180379, 180380, 
+    180381, 180382, 180383, 180384, 180385, 180386, 180387, 180388, 180389, 
+    180390, 180391, 180392, 180393, 180394, 180395, 180396, 180397, 180398, 
+    180399, 180400, 180401, 180402, 180403, 180404, 180405, 180406, 180407, 
+    180408, 180409, 180410, 180411, 180412, 180413, 180414, 180415, 180416, 
+    180417, 180418, 180419, 180420, 180421, 180422, 180423, 180424, 180425, 
+    180426, 180427, 180428, 180429, 180430, 180431, 180432, 180433, 180434, 
+    180435, 180436, 180437, 180438, 180439, 180440, 180441, 180442, 180443, 
+    180444, 180445, 180446, 180447, 180448, 180449, 180450, 180451, 180452, 
+    180453, 180454, 180455, 180456, 180457, 180458, 180459, 180460, 180461, 
+    180462, 180463, 180464, 180465, 180466, 180467, 180468, 180469, 180470, 
+    180471, 180472, 180473, 180474, 180475, 180476, 180477, 180478, 180479, 
+    180480, 180481, 180482, 180483, 180484, 180485, 180486, 180487, 180488, 
+    180489, 180490, 180491, 180492, 180493, 180494, 180495, 180496, 180497, 
+    180498, 180499, 180500, 180501, 180502, 180503, 180504, 180505, 180506, 
+    180507, 180508, 180509, 180510, 180511, 180512, 180513, 180514, 180515, 
+    180516, 180517, 180518, 180519, 180520, 180521, 180522, 180523, 180524, 
+    180525, 180526, 180527, 180528, 180529, 180530, 180531, 180532, 180533, 
+    180534, 180535, 180536, 180537, 180538, 180539, 180540, 180541, 180542, 
+    180543, 180544, 180545, 180546, 180547, 180548, 180549, 180550, 180551, 
+    180552, 180553, 180554, 180555, 180556, 180557, 180558, 180559, 180560, 
+    180561, 180562, 180563, 180564, 180565, 180566, 180567, 180568, 180569, 
+    180570, 180571, 180572, 180573, 180574, 180575, 180576, 180577, 180578, 
+    180579, 180580, 180581, 180582, 180583, 180584, 180585, 180586, 180587, 
+    180588, 180589, 180590, 180591, 180592, 180593, 180594, 180595, 180596, 
+    180597, 180598, 180599, 180600, 180601, 180602, 180603, 180604, 180605, 
+    180606, 180607, 180608, 180609, 180610, 180611, 180612, 180613, 180614, 
+    180615, 180616, 180617, 180618, 180619, 180620, 180621, 180622, 180623, 
+    180624, 180625, 180626, 180627, 180628, 180629, 180630, 180631, 180632, 
+    180633, 180634, 180635, 180636, 180637, 180638, 180639, 180640, 180641, 
+    180642, 180643, 180644, 180645, 180646, 180647, 180648, 180649, 180650, 
+    180651, 180652, 180653, 180654, 180655, 180656, 180657, 180658, 180659, 
+    180660, 180661, 180662, 180663, 180664, 180665, 180666, 180667, 180668, 
+    180669, 180670, 180671, 180672, 180673, 180674, 180675, 180676, 180677, 
+    180678, 180679, 180680, 180681, 180682, 180683, 180684, 180685, 180686, 
+    180687, 180688, 180689, 180690, 180691, 180692, 180693, 180694, 180695, 
+    180696, 180697, 180698, 180699, 180700, 180701, 180702, 180703, 180704, 
+    180705, 180706, 180707, 180708, 180709, 180710, 180711, 180712, 180713, 
+    180714, 180715, 180716, 180717, 180718, 180719, 180720, 180721, 180722, 
+    180723, 180724, 180725, 180726, 180727, 180728, 180729, 180730, 180731, 
+    180732, 180733, 180734, 180735, 180736, 180737, 180738, 180739, 180740, 
+    180741, 180742, 180743, 180744, 180745, 180746, 180747, 180748, 180749, 
+    180750, 180751, 180752, 180753, 180754, 180755, 180756, 180757, 180758, 
+    180759, 180760, 180761, 180762, 180763, 180764, 180765, 180766, 180767, 
+    180768, 180769, 180770, 180771, 180772, 180773, 180774, 180775, 180776, 
+    180777, 180778, 180779, 180780, 180781, 180782, 180783, 180784, 180785, 
+    180786, 180787, 180788, 180789, 180790, 180791, 180792, 180793, 180794, 
+    180795, 180796, 180797, 180798, 180799, 180800, 180801, 180802, 180803, 
+    180804, 180805, 180806, 180807, 180808, 180809, 180810, 180811, 180812, 
+    180813, 180814, 180815, 180816, 180817, 180818, 180819, 180820, 180821, 
+    180822, 180823, 180824, 180825, 180826, 180827, 180828, 180829, 180830, 
+    180831, 180832, 180833, 180834, 180835, 180836, 180837, 180838, 180839, 
+    180840, 180841, 180842, 180843, 180844, 180845, 180846, 180847, 180848, 
+    180849, 180850, 180851, 180852, 180853, 180854, 180855, 180856, 180857, 
+    180858, 180859, 180860, 180861, 180862, 180863, 180864, 180865, 180866, 
+    180867, 180868, 180869, 180870, 180871, 180872, 180873, 180874, 180875, 
+    180876, 180877, 180878, 180879, 180880, 180881, 180882, 180883, 180884, 
+    180885, 180886, 180887, 180888, 180889, 180890, 180891, 180892, 180893, 
+    180894, 180895, 180896, 180897, 180898, 180899, 180900, 180901, 180902, 
+    180903, 180904, 180905, 180906, 180907, 180908, 180909, 180910, 180911, 
+    180912, 180913, 180914, 180915, 180916, 180917, 180918, 180919, 180920, 
+    180921, 180922, 180923, 180924, 180925, 180926, 180927, 180928, 180929, 
+    180930, 180931, 180932, 180933, 180934, 180935, 180936, 180937, 180938, 
+    180939, 180940, 180941, 180942, 180943, 180944, 180945, 180946, 180947, 
+    180948, 180949, 180950, 180951, 180952, 180953, 180954, 180955, 180956, 
+    180957, 180958, 180959, 180960, 180961, 180962, 180963, 180964, 180965, 
+    180966, 180967, 180968, 180969, 180970, 180971, 180972, 180973, 180974, 
+    180975, 180976, 180977, 180978, 180979, 180980, 180981, 180982, 180983, 
+    180984, 180985, 180986, 180987, 180988, 180989, 180990, 180991, 180992, 
+    180993, 180994, 180995, 180996, 180997, 180998, 180999, 181000, 181001, 
+    181002, 181003, 181004, 181005, 181006, 181007, 181008, 181009, 181010, 
+    181011, 181012, 181013, 181014, 181015, 181016, 181017, 181018, 181019, 
+    181020, 181021, 181022, 181023, 181024, 181025, 181026, 181027, 181028, 
+    181029, 181030, 181031, 181032, 181033, 181034, 181035, 181036, 181037, 
+    181038, 181039, 181040, 181041, 181042, 181043, 181044, 181045, 181046, 
+    181047, 181048, 181049, 181050, 181051, 181052, 181053, 181054, 181055, 
+    181056, 181057, 181058, 181059, 181060, 181061, 181062, 181063, 181064, 
+    181065, 181066, 181067, 181068, 181069, 181070, 181071, 181072, 181073, 
+    181074, 181075, 181076, 181077, 181078, 181079, 181080, 181081, 181082, 
+    181083, 181084, 181085, 181086, 181087, 181088, 181089, 181090, 181091, 
+    181092, 181093, 181094, 181095, 181096, 181097, 181098, 181099, 181100, 
+    181101, 181102, 181103, 181104, 181105, 181106, 181107, 181108, 181109, 
+    181110, 181111, 181112, 181113, 181114, 181115, 181116, 181117, 181118, 
+    181119, 181120, 181121, 181122, 181123, 181124, 181125, 181126, 181127, 
+    181128, 181129, 181130, 181131, 181132, 181133, 181134, 181135, 181136, 
+    181137, 181138, 181139, 181140, 181141, 181142, 181143, 181144, 181145, 
+    181146, 181147, 181148, 181149, 181150, 181151, 181152, 181153, 181154, 
+    181155, 181156, 181157, 181158, 181159, 181160, 181161, 181162, 181163, 
+    181164, 181165, 181166, 181167, 181168, 181169, 181170, 181171, 181172, 
+    181173, 181174, 181175, 181176, 181177, 181178, 181179, 181180, 181181, 
+    181182, 181183, 181184, 181185, 181186, 181187, 181188, 181189, 181190, 
+    181191, 181192, 181193, 181194, 181195, 181196, 181197, 181198, 181199, 
+    181200, 181201, 181202, 181203, 181204, 181205, 181206, 181207, 181208, 
+    181209, 181210, 181211, 181212, 181213, 181214, 181215, 181216, 181217, 
+    181218, 181219, 181220, 181221, 181222, 181223, 181224, 181225, 181226, 
+    181227, 181228, 181229, 181230, 181231, 181232, 181233, 181234, 181235, 
+    181236, 181237, 181238, 181239, 181240, 181241, 181242, 181243, 181244, 
+    181245, 181246, 181247, 181248, 181249, 181250, 181251, 181252, 181253, 
+    181254, 181255, 181256, 181257, 181258, 181259, 181260, 181261, 181262, 
+    181263, 181264, 181265, 181266, 181267, 181268, 181269, 181270, 181271, 
+    181272, 181273, 181274, 181275, 181276, 181277, 181278, 181279, 181280, 
+    181281, 181282, 181283, 181284, 181285, 181286, 181287, 181288, 181289, 
+    181290, 181291, 181292, 181293, 181294, 181295, 181296, 181297, 181298, 
+    181299, 181300, 181301, 181302, 181303, 181304, 181305, 181306, 181307, 
+    181308, 181309, 181310, 181311, 181312, 181313, 181314, 181315, 181316, 
+    181317, 181318, 181319, 181320, 181321, 181322, 181323, 181324, 181325, 
+    181326, 181327, 181328, 181329, 181330, 181331, 181332, 181333, 181334, 
+    181335, 181336, 181337, 181338, 181339, 181340, 181341, 181342, 181343, 
+    181344, 181345, 181346, 181347, 181348, 181349, 181350, 181351, 181352, 
+    181353, 181354, 181355, 181356, 181357, 181358, 181359, 181360, 181361, 
+    181362, 181363, 181364, 181365, 181366, 181367, 181368, 181369, 181370, 
+    181371, 181372, 181373, 181374, 181375, 181376, 181377, 181378, 181379, 
+    181380, 181381, 181382, 181383, 181384, 181385, 181386, 181387, 181388, 
+    181389, 181390, 181391, 181392, 181393, 181394, 181395, 181396, 181397, 
+    181398, 181399, 181400, 181401, 181402, 181403, 181404, 181405, 181406, 
+    181407, 181408, 181409, 181410, 181411, 181412, 181413, 181414, 181415, 
+    181416, 181417, 181418, 181419, 181420, 181421, 181422, 181423, 181424, 
+    181425, 181426, 181427, 181428, 181429, 181430, 181431, 181432, 181433, 
+    181434, 181435, 181436, 181437, 181438, 181439, 181440, 181441, 181442, 
+    181443, 181444, 181445, 181446, 181447, 181448, 181449, 181450, 181451, 
+    181452, 181453, 181454, 181455, 181456, 181457, 181458, 181459, 181460, 
+    181461, 181462, 181463, 181464, 181465, 181466, 181467, 181468, 181469, 
+    181470, 181471, 181472, 181473, 181474, 181475, 181476, 181477, 181478, 
+    181479, 181480, 181481, 181482, 181483, 181484, 181485, 181486, 181487, 
+    181488, 181489, 181490, 181491, 181492, 181493, 181494, 181495, 181496, 
+    181497, 181498, 181499, 181500, 181501, 181502, 181503, 181504, 181505, 
+    181506, 181507, 181508, 181509, 181510, 181511, 181512, 181513, 181514, 
+    181515, 181516, 181517, 181518, 181519, 181520, 181521, 181522, 181523, 
+    181524, 181525, 181526, 181527, 181528, 181529, 181530, 181531, 181532, 
+    181533, 181534, 181535, 181536, 181537, 181538, 181539, 181540, 181541, 
+    181542, 181543, 181544, 181545, 181546, 181547, 181548, 181549, 181550, 
+    181551, 181552, 181553, 181554, 181555, 181556, 181557, 181558, 181559, 
+    181560, 181561, 181562, 181563, 181564, 181565, 181566, 181567, 181568, 
+    181569, 181570, 181571, 181572, 181573, 181574, 181575, 181576, 181577, 
+    181578, 181579, 181580, 181581, 181582, 181583, 181584, 181585, 181586, 
+    181587, 181588, 181589, 181590, 181591, 181592, 181593, 181594, 181595, 
+    181596, 181597, 181598, 181599, 181600, 181601, 181602, 181603, 181604, 
+    181605, 181606, 181607, 181608, 181609, 181610, 181611, 181612, 181613, 
+    181614, 181615, 181616, 181617, 181618, 181619, 181620, 181621, 181622, 
+    181623, 181624, 181625, 181626, 181627, 181628, 181629, 181630, 181631, 
+    181632, 181633, 181634, 181635, 181636, 181637, 181638, 181639, 181640, 
+    181641, 181642, 181643, 181644, 181645, 181646, 181647, 181648, 181649, 
+    181650, 181651, 181652, 181653, 181654, 181655, 181656, 181657, 181658, 
+    181659, 181660, 181661, 181662, 181663, 181664, 181665, 181666, 181667, 
+    181668, 181669, 181670, 181671, 181672, 181673, 181674, 181675, 181676, 
+    181677, 181678, 181679, 181680, 181681, 181682, 181683, 181684, 181685, 
+    181686, 181687, 181688, 181689, 181690, 181691, 181692, 181693, 181694, 
+    181695, 181696, 181697, 181698, 181699, 181700, 181701, 181702, 181703, 
+    181704, 181705, 181706, 181707, 181708, 181709, 181710, 181711, 181712, 
+    181713, 181714, 181715, 181716, 181717, 181718, 181719, 181720, 181721, 
+    181722, 181723, 181724, 181725, 181726, 181727, 181728, 181729, 181730, 
+    181731, 181732, 181733, 181734, 181735, 181736, 181737, 181738, 181739, 
+    181740, 181741, 181742, 181743, 181744, 181745, 181746, 181747, 181748, 
+    181749, 181750, 181751, 181752, 181753, 181754, 181755, 181756, 181757, 
+    181758, 181759, 181760, 181761, 181762, 181763, 181764, 181765, 181766, 
+    181767, 181768, 181769, 181770, 181771, 181772, 181773, 181774, 181775, 
+    181776, 181777, 181778, 181779, 181780, 181781, 181782, 181783, 181784, 
+    181785, 181786, 181787, 181788, 181789, 181790, 181791, 181792, 181793, 
+    181794, 181795, 181796, 181797, 181798, 181799, 181800, 181801, 181802, 
+    181803, 181804, 181805, 181806, 181807, 181808, 181809, 181810, 181811, 
+    181812, 181813, 181814, 181815, 181816, 181817, 181818, 181819, 181820, 
+    181821, 181822, 181823, 181824, 181825, 181826, 181827, 181828, 181829, 
+    181830, 181831, 181832, 181833, 181834, 181835, 181836, 181837, 181838, 
+    181839, 181840, 181841, 181842, 181843, 181844, 181845, 181846, 181847, 
+    181848, 181849, 181850, 181851, 181852, 181853, 181854, 181855, 181856, 
+    181857, 181858, 181859, 181860, 181861, 181862, 181863, 181864, 181865, 
+    181866, 181867, 181868, 181869, 181870, 181871, 181872, 181873, 181874, 
+    181875, 181876, 181877, 181878, 181879, 181880, 181881, 181882, 181883, 
+    181884, 181885, 181886, 181887, 181888, 181889, 181890, 181891, 181892, 
+    181893, 181894, 181895, 181896, 181897, 181898, 181899, 181900, 181901, 
+    181902, 181903, 181904, 181905, 181906, 181907, 181908, 181909, 181910, 
+    181911, 181912, 181913, 181914, 181915, 181916, 181917, 181918, 181919, 
+    181920, 181921, 181922, 181923, 181924, 181925, 181926, 181927, 181928, 
+    181929, 181930, 181931, 181932, 181933, 181934, 181935, 181936, 181937, 
+    181938, 181939, 181940, 181941, 181942, 181943, 181944, 181945, 181946, 
+    181947, 181948, 181949, 181950, 181951, 181952, 181953, 181954, 181955, 
+    181956, 181957, 181958, 181959, 181960, 181961, 181962, 181963, 181964, 
+    181965, 181966, 181967, 181968, 181969, 181970, 181971, 181972, 181973, 
+    181974, 181975, 181976, 181977, 181978, 181979, 181980, 181981, 181982, 
+    181983, 181984, 181985, 181986, 181987, 181988, 181989, 181990, 181991, 
+    181992, 181993, 181994, 181995, 181996, 181997, 181998, 181999, 182000, 
+    182001, 182002, 182003, 182004, 182005, 182006, 182007, 182008, 182009, 
+    182010, 182011, 182012, 182013, 182014, 182015, 182016, 182017, 182018, 
+    182019, 182020, 182021, 182022, 182023, 182024, 182025, 182026, 182027, 
+    182028, 182029, 182030, 182031, 182032, 182033, 182034, 182035, 182036, 
+    182037, 182038, 182039, 182040, 182041, 182042, 182043, 182044, 182045, 
+    182046, 182047, 182048, 182049, 182050, 182051, 182052, 182053, 182054, 
+    182055, 182056, 182057, 182058, 182059, 182060, 182061, 182062, 182063, 
+    182064, 182065, 182066, 182067, 182068, 182069, 182070, 182071, 182072, 
+    182073, 182074, 182075, 182076, 182077, 182078, 182079, 182080, 182081, 
+    182082, 182083, 182084, 182085, 182086, 182087, 182088, 182089, 182090, 
+    182091, 182092, 182093, 182094, 182095, 182096, 182097, 182098, 182099, 
+    182100, 182101, 182102, 182103, 182104, 182105, 182106, 182107, 182108, 
+    182109, 182110, 182111, 182112, 182113, 182114, 182115, 182116, 182117, 
+    182118, 182119, 182120, 182121, 182122, 182123, 182124, 182125, 182126, 
+    182127, 182128, 182129, 182130, 182131, 182132, 182133, 182134, 182135, 
+    182136, 182137, 182138, 182139, 182140, 182141, 182142, 182143, 182144, 
+    182145, 182146, 182147, 182148, 182149, 182150, 182151, 182152, 182153, 
+    182154, 182155, 182156, 182157, 182158, 182159, 182160, 182161, 182162, 
+    182163, 182164, 182165, 182166, 182167, 182168, 182169, 182170, 182171, 
+    182172, 182173, 182174, 182175, 182176, 182177, 182178, 182179, 182180, 
+    182181, 182182, 182183, 182184, 182185, 182186, 182187, 182188, 182189, 
+    182190, 182191, 182192, 182193, 182194, 182195, 182196, 182197, 182198, 
+    182199, 182200, 182201, 182202, 182203, 182204, 182205, 182206, 182207, 
+    182208, 182209, 182210, 182211, 182212, 182213, 182214, 182215, 182216, 
+    182217, 182218, 182219, 182220, 182221, 182222, 182223, 182224, 182225, 
+    182226, 182227, 182228, 182229, 182230, 182231, 182232, 182233, 182234, 
+    182235, 182236, 182237, 182238, 182239, 182240, 182241, 182242, 182243, 
+    182244, 182245, 182246, 182247, 182248, 182249, 182250, 182251, 182252, 
+    182253, 182254, 182255, 182256, 182257, 182258, 182259, 182260, 182261, 
+    182262, 182263, 182264, 182265, 182266, 182267, 182268, 182269, 182270, 
+    182271, 182272, 182273, 182274, 182275, 182276, 182277, 182278, 182279, 
+    182280, 182281, 182282, 182283, 182284, 182285, 182286, 182287, 182288, 
+    182289, 182290, 182291, 182292, 182293, 182294, 182295, 182296, 182297, 
+    182298, 182299, 182300, 182301, 182302, 182303, 182304, 182305, 182306, 
+    182307, 182308, 182309, 182310, 182311, 182312, 182313, 182314, 182315, 
+    182316, 182317, 182318, 182319, 182320, 182321, 182322, 182323, 182324, 
+    182325, 182326, 182327, 182328, 182329, 182330, 182331, 182332, 182333, 
+    182334, 182335, 182336, 182337, 182338, 182339, 182340, 182341, 182342, 
+    182343, 182344, 182345, 182346, 182347, 182348, 182349, 182350, 182351, 
+    182352, 182353, 182354, 182355, 182356, 182357, 182358, 182359, 182360, 
+    182361, 182362, 182363, 182364, 182365, 182366, 182367, 182368, 182369, 
+    182370, 182371, 182372, 182373, 182374, 182375, 182376, 182377, 182378, 
+    182379, 182380, 182381, 182382, 182383, 182384, 182385, 182386, 182387, 
+    182388, 182389, 182390, 182391, 182392, 182393, 182394, 182395, 182396, 
+    182397, 182398, 182399, 182400, 182401, 182402, 182403, 182404, 182405, 
+    182406, 182407, 182408, 182409, 182410, 182411, 182412, 182413, 182414, 
+    182415, 182416, 182417, 182418, 182419, 182420, 182421, 182422, 182423, 
+    182424, 182425, 182426, 182427, 182428, 182429, 182430, 182431, 182432, 
+    182433, 182434, 182435, 182436, 182437, 182438, 182439, 182440, 182441, 
+    182442, 182443, 182444, 182445, 182446, 182447, 182448, 182449, 182450, 
+    182451, 182452, 182453, 182454, 182455, 182456, 182457, 182458, 182459, 
+    182460, 182461, 182462, 182463, 182464, 182465, 182466, 182467, 182468, 
+    182469, 182470, 182471, 182472, 182473, 182474, 182475, 182476, 182477, 
+    182478, 182479, 182480, 182481, 182482, 182483, 182484, 182485, 182486, 
+    182487, 182488, 182489, 182490, 182491, 182492, 182493, 182494, 182495, 
+    182496, 182497, 182498, 182499, 182500, 182501, 182502, 182503, 182504, 
+    182505, 182506, 182507, 182508, 182509, 182510, 182511, 182512, 182513, 
+    182514, 182515, 182516, 182517, 182518, 182519, 182520, 182521, 182522, 
+    182523, 182524, 182525, 182526, 182527, 182528, 182529, 182530, 182531, 
+    182532, 182533, 182534, 182535, 182536, 182537, 182538, 182539, 182540, 
+    182541, 182542, 182543, 182544, 182545, 182546, 182547, 182548, 182549, 
+    182550, 182551, 182552, 182553, 182554, 182555, 182556, 182557, 182558, 
+    182559, 182560, 182561, 182562, 182563, 182564, 182565, 182566, 182567, 
+    182568, 182569, 182570, 182571, 182572, 182573, 182574, 182575, 182576, 
+    182577, 182578, 182579, 182580, 182581, 182582, 182583, 182584, 182585, 
+    182586, 182587, 182588, 182589, 182590, 182591, 182592, 182593, 182594, 
+    182595, 182596, 182597, 182598, 182599, 182600, 182601, 182602, 182603, 
+    182604, 182605, 182606, 182607, 182608, 182609, 182610, 182611, 182612, 
+    182613, 182614, 182615, 182616, 182617, 182618, 182619, 182620, 182621, 
+    182622, 182623, 182624, 182625, 182626, 182627, 182628, 182629, 182630, 
+    182631, 182632, 182633, 182634, 182635, 182636, 182637, 182638, 182639, 
+    182640, 182641, 182642, 182643, 182644, 182645, 182646, 182647, 182648, 
+    182649, 182650, 182651, 182652, 182653, 182654, 182655, 182656, 182657, 
+    182658, 182659, 182660, 182661, 182662, 182663, 182664, 182665, 182666, 
+    182667, 182668, 182669, 182670, 182671, 182672, 182673, 182674, 182675, 
+    182676, 182677, 182678, 182679, 182680, 182681, 182682, 182683, 182684, 
+    182685, 182686, 182687, 182688, 182689, 182690, 182691, 182692, 182693, 
+    182694, 182695, 182696, 182697, 182698, 182699, 182700, 182701, 182702, 
+    182703, 182704, 182705, 182706, 182707, 182708, 182709, 182710, 182711, 
+    182712, 182713, 182714, 182715, 182716, 182717, 182718, 182719, 182720, 
+    182721, 182722, 182723, 182724, 182725, 182726, 182727, 182728, 182729, 
+    182730, 182731, 182732, 182733, 182734, 182735, 182736, 182737, 182738, 
+    182739, 182740, 182741, 182742, 182743, 182744, 182745, 182746, 182747, 
+    182748, 182749, 182750, 182751, 182752, 182753, 182754, 182755, 182756, 
+    182757, 182758, 182759, 182760, 182761, 182762, 182763, 182764, 182765, 
+    182766, 182767, 182768, 182769, 182770, 182771, 182772, 182773, 182774, 
+    182775, 182776, 182777, 182778, 182779, 182780, 182781, 182782, 182783, 
+    182784, 182785, 182786, 182787, 182788, 182789, 182790, 182791, 182792, 
+    182793, 182794, 182795, 182796, 182797, 182798, 182799, 182800, 182801, 
+    182802, 182803, 182804, 182805, 182806, 182807, 182808, 182809, 182810, 
+    182811, 182812, 182813, 182814, 182815, 182816, 182817, 182818, 182819, 
+    182820, 182821, 182822, 182823, 182824, 182825, 182826, 182827, 182828, 
+    182829, 182830, 182831, 182832, 182833, 182834, 182835, 182836, 182837, 
+    182838, 182839, 182840, 182841, 182842, 182843, 182844, 182845, 182846, 
+    182847, 182848, 182849, 182850, 182851, 182852, 182853, 182854, 182855, 
+    182856, 182857, 182858, 182859, 182860, 182861, 182862, 182863, 182864, 
+    182865, 182866, 182867, 182868, 182869, 182870, 182871, 182872, 182873, 
+    182874, 182875, 182876, 182877, 182878, 182879, 182880, 182881, 182882, 
+    182883, 182884, 182885, 182886, 182887, 182888, 182889, 182890, 182891, 
+    182892, 182893, 182894, 182895, 182896, 182897, 182898, 182899, 182900, 
+    182901, 182902, 182903, 182904, 182905, 182906, 182907, 182908, 182909, 
+    182910, 182911, 182912, 182913, 182914, 182915, 182916, 182917, 182918, 
+    182919, 182920, 182921, 182922, 182923, 182924, 182925, 182926, 182927, 
+    182928, 182929, 182930, 182931, 182932, 182933, 182934, 182935, 182936, 
+    182937, 182938, 182939, 182940, 182941, 182942, 182943, 182944, 182945, 
+    182946, 182947, 182948, 182949, 182950, 182951, 182952, 182953, 182954, 
+    182955, 182956, 182957, 182958, 182959, 182960, 182961, 182962, 182963, 
+    182964, 182965, 182966, 182967, 182968, 182969, 182970, 182971, 182972, 
+    182973, 182974, 182975, 182976, 182977, 182978, 182979, 182980, 182981, 
+    182982, 182983, 182984, 182985, 182986, 182987, 182988, 182989, 182990, 
+    182991, 182992, 182993, 182994, 182995, 182996, 182997, 182998, 182999, 
+    183000, 183001, 183002, 183003, 183004, 183005, 183006, 183007, 183008, 
+    183009, 183010, 183011, 183012, 183013, 183014, 183015, 183016, 183017, 
+    183018, 183019, 183020, 183021, 183022, 183023, 183024, 183025, 183026, 
+    183027, 183028, 183029, 183030, 183031, 183032, 183033, 183034, 183035, 
+    183036, 183037, 183038, 183039, 183040, 183041, 183042, 183043, 183044, 
+    183045, 183046, 183047, 183048, 183049, 183050, 183051, 183052, 183053, 
+    183054, 183055, 183056, 183057, 183058, 183059, 183060, 183061, 183062, 
+    183063, 183064, 183065, 183066, 183067, 183068, 183069, 183070, 183071, 
+    183072, 183073, 183074, 183075, 183076, 183077, 183078, 183079, 183080, 
+    183081, 183082, 183083, 183084, 183085, 183086, 183087, 183088, 183089, 
+    183090, 183091, 183092, 183093, 183094, 183095, 183096, 183097, 183098, 
+    183099, 183100, 183101, 183102, 183103, 183104, 183105, 183106, 183107, 
+    183108, 183109, 183110, 183111, 183112, 183113, 183114, 183115, 183116, 
+    183117, 183118, 183119, 183120, 183121, 183122, 183123, 183124, 183125, 
+    183126, 183127, 183128, 183129, 183130, 183131, 183132, 183133, 183134, 
+    183135, 183136, 183137, 183138, 183139, 183140, 183141, 183142, 183143, 
+    183144, 183145, 183146, 183147, 183148, 183149, 183150, 183151, 183152, 
+    183153, 183154, 183155, 183156, 183157, 183158, 183159, 183160, 183161, 
+    183162, 183163, 183164, 183165, 183166, 183167, 183168, 183169, 183170, 
+    183171, 183172, 183173, 183174, 183175, 183176, 183177, 183178, 183179, 
+    183180, 183181, 183182, 183183, 183184, 183185, 183186, 183187, 183188, 
+    183189, 183190, 183191, 183192, 183193, 183194, 183195, 183196, 183197, 
+    183198, 183199, 183200, 183201, 183202, 183203, 183204, 183205, 183206, 
+    183207, 183208, 183209, 183210, 183211, 183212, 183213, 183214, 183215, 
+    183216, 183217, 183218, 183219, 183220, 183221, 183222, 183223, 183224, 
+    183225, 183226, 183227, 183228, 183229, 183230, 183231, 183232, 183233, 
+    183234, 183235, 183236, 183237, 183238, 183239, 183240, 183241, 183242, 
+    183243, 183244, 183245, 183246, 183247, 183248, 183249, 183250, 183251, 
+    183252, 183253, 183254, 183255, 183256, 183257, 183258, 183259, 183260, 
+    183261, 183262, 183263, 183264, 183265, 183266, 183267, 183268, 183269, 
+    183270, 183271, 183272, 183273, 183274, 183275, 183276, 183277, 183278, 
+    183279, 183280, 183281, 183282, 183283, 183284, 183285, 183286, 183287, 
+    183288, 183289, 183290, 183291, 183292, 183293, 183294, 183295, 183296, 
+    183297, 183298, 183299, 183300, 183301, 183302, 183303, 183304, 183305, 
+    183306, 183307, 183308, 183309, 183310, 183311, 183312, 183313, 183314, 
+    183315, 183316, 183317, 183318, 183319, 183320, 183321, 183322, 183323, 
+    183324, 183325, 183326, 183327, 183328, 183329, 183330, 183331, 183332, 
+    183333, 183334, 183335, 183336, 183337, 183338, 183339, 183340, 183341, 
+    183342, 183343, 183344, 183345, 183346, 183347, 183348, 183349, 183350, 
+    183351, 183352, 183353, 183354, 183355, 183356, 183357, 183358, 183359, 
+    183360, 183361, 183362, 183363, 183364, 183365, 183366, 183367, 183368, 
+    183369, 183370, 183371, 183372, 183373, 183374, 183375, 183376, 183377, 
+    183378, 183379, 183380, 183381, 183382, 183383, 183384, 183385, 183386, 
+    183387, 183388, 183389, 183390, 183391, 183392, 183393, 183394, 183395, 
+    183396, 183397, 183398, 183399, 183400, 183401, 183402, 183403, 183404, 
+    183405, 183406, 183407, 183408, 183409, 183410, 183411, 183412, 183413, 
+    183414, 183415, 183416, 183417, 183418, 183419, 183420, 183421, 183422, 
+    183423, 183424, 183425, 183426, 183427, 183428, 183429, 183430, 183431, 
+    183432, 183433, 183434, 183435, 183436, 183437, 183438, 183439, 183440, 
+    183441, 183442, 183443, 183444, 183445, 183446, 183447, 183448, 183449, 
+    183450, 183451, 183452, 183453, 183454, 183455, 183456, 183457, 183458, 
+    183459, 183460, 183461, 183462, 183463, 183464, 183465, 183466, 183467, 
+    183468, 183469, 183470, 183471, 183472, 183473, 183474, 183475, 183476, 
+    183477, 183478, 183479, 183480, 183481, 183482, 183483, 183484, 183485, 
+    183486, 183487, 183488, 183489, 183490, 183491, 183492, 183493, 183494, 
+    183495, 183496, 183497, 183498, 183499, 183500, 183501, 183502, 183503, 
+    183504, 183505, 183506, 183507, 183508, 183509, 183510, 183511, 183512, 
+    183513, 183514, 183515, 183516, 183517, 183518, 183519, 183520, 183521, 
+    183522, 183523, 183524, 183525, 183526, 183527, 183528, 183529, 183530, 
+    183531, 183532, 183533, 183534, 183535, 183536, 183537, 183538, 183539, 
+    183540, 183541, 183542, 183543, 183544, 183545, 183546, 183547, 183548, 
+    183549, 183550, 183551, 183552, 183553, 183554, 183555, 183556, 183557, 
+    183558, 183559, 183560, 183561, 183562, 183563, 183564, 183565, 183566, 
+    183567, 183568, 183569, 183570, 183571, 183572, 183573, 183574, 183575, 
+    183576, 183577, 183578, 183579, 183580, 183581, 183582, 183583, 183584, 
+    183585, 183586, 183587, 183588, 183589, 183590, 183591, 183592, 183593, 
+    183594, 183595, 183596, 183597, 183598, 183599, 183600, 183601, 183602, 
+    183603, 183604, 183605, 183606, 183607, 183608, 183609, 183610, 183611, 
+    183612, 183613, 183614, 183615, 183616, 183617, 183618, 183619, 183620, 
+    183621, 183622, 183623, 183624, 183625, 183626, 183627, 183628, 183629, 
+    183630, 183631, 183632, 183633, 183634, 183635, 183636, 183637, 183638, 
+    183639, 183640, 183641, 183642, 183643, 183644, 183645, 183646, 183647, 
+    183648, 183649, 183650, 183651, 183652, 183653, 183654, 183655, 183656, 
+    183657, 183658, 183659, 183660, 183661, 183662, 183663, 183664, 183665, 
+    183666, 183667, 183668, 183669, 183670, 183671, 183672, 183673, 183674, 
+    183675, 183676, 183677, 183678, 183679, 183680, 183681, 183682, 183683, 
+    183684, 183685, 183686, 183687, 183688, 183689, 183690, 183691, 183692, 
+    183693, 183694, 183695, 183696, 183697, 183698, 183699, 183700, 183701, 
+    183702, 183703, 183704, 183705, 183706, 183707, 183708, 183709, 183710, 
+    183711, 183712, 183713, 183714, 183715, 183716, 183717, 183718, 183719, 
+    183720, 183721, 183722, 183723, 183724, 183725, 183726, 183727, 183728, 
+    183729, 183730, 183731, 183732, 183733, 183734, 183735, 183736, 183737, 
+    183738, 183739, 183740, 183741, 183742, 183743, 183744, 183745, 183746, 
+    183747, 183748, 183749, 183750, 183751, 183752, 183753, 183754, 183755, 
+    183756, 183757, 183758, 183759, 183760, 183761, 183762, 183763, 183764, 
+    183765, 183766, 183767, 183768, 183769, 183770, 183771, 183772, 183773, 
+    183774, 183775, 183776, 183777, 183778, 183779, 183780, 183781, 183782, 
+    183783, 183784, 183785, 183786, 183787, 183788, 183789, 183790, 183791, 
+    183792, 183793, 183794, 183795, 183796, 183797, 183798, 183799, 183800, 
+    183801, 183802, 183803, 183804, 183805, 183806, 183807, 183808, 183809, 
+    183810, 183811, 183812, 183813, 183814, 183815, 183816, 183817, 183818, 
+    183819, 183820, 183821, 183822, 183823, 183824, 183825, 183826, 183827, 
+    183828, 183829, 183830, 183831, 183832, 183833, 183834, 183835, 183836, 
+    183837, 183838, 183839, 183840, 183841, 183842, 183843, 183844, 183845, 
+    183846, 183847, 183848, 183849, 183850, 183851, 183852, 183853, 183854, 
+    183855, 183856, 183857, 183858, 183859, 183860, 183861, 183862, 183863, 
+    183864, 183865, 183866, 183867, 183868, 183869, 183870, 183871, 183872, 
+    183873, 183874, 183875, 183876, 183877, 183878, 183879, 183880, 183881, 
+    183882, 183883, 183884, 183885, 183886, 183887, 183888, 183889, 183890, 
+    183891, 183892, 183893, 183894, 183895, 183896, 183897, 183898, 183899, 
+    183900, 183901, 183902, 183903, 183904, 183905, 183906, 183907, 183908, 
+    183909, 183910, 183911, 183912, 183913, 183914, 183915, 183916, 183917, 
+    183918, 183919, 183920, 183921, 183922, 183923, 183924, 183925, 183926, 
+    183927, 183928, 183929, 183930, 183931, 183932, 183933, 183934, 183935, 
+    183936, 183937, 183938, 183939, 183940, 183941, 183942, 183943, 183944, 
+    183945, 183946, 183947, 183948, 183949, 183950, 183951, 183952, 183953, 
+    183954, 183955, 183956, 183957, 183958, 183959, 183960, 183961, 183962, 
+    183963, 183964, 183965, 183966, 183967, 183968, 183969, 183970, 183971, 
+    183972, 183973, 183974, 183975, 183976, 183977, 183978, 183979, 183980, 
+    183981, 183982, 183983, 183984, 183985, 183986, 183987, 183988, 183989, 
+    183990, 183991, 183992, 183993, 183994, 183995, 183996, 183997, 183998, 
+    183999, 184000, 184001, 184002, 184003, 184004, 184005, 184006, 184007, 
+    184008, 184009, 184010, 184011, 184012, 184013, 184014, 184015, 184016, 
+    184017, 184018, 184019, 184020, 184021, 184022, 184023, 184024, 184025, 
+    184026, 184027, 184028, 184029, 184030, 184031, 184032, 184033, 184034, 
+    184035, 184036, 184037, 184038, 184039, 184040, 184041, 184042, 184043, 
+    184044, 184045, 184046, 184047, 184048, 184049, 184050, 184051, 184052, 
+    184053, 184054, 184055, 184056, 184057, 184058, 184059, 184060, 184061, 
+    184062, 184063, 184064, 184065, 184066, 184067, 184068, 184069, 184070, 
+    184071, 184072, 184073, 184074, 184075, 184076, 184077, 184078, 184079, 
+    184080, 184081, 184082, 184083, 184084, 184085, 184086, 184087, 184088, 
+    184089, 184090, 184091, 184092, 184093, 184094, 184095, 184096, 184097, 
+    184098, 184099, 184100, 184101, 184102, 184103, 184104, 184105, 184106, 
+    184107, 184108, 184109, 184110, 184111, 184112, 184113, 184114, 184115, 
+    184116, 184117, 184118, 184119, 184120, 184121, 184122, 184123, 184124, 
+    184125, 184126, 184127, 184128, 184129, 184130, 184131, 184132, 184133, 
+    184134, 184135, 184136, 184137, 184138, 184139, 184140, 184141, 184142, 
+    184143, 184144, 184145, 184146, 184147, 184148, 184149, 184150, 184151, 
+    184152, 184153, 184154, 184155, 184156, 184157, 184158, 184159, 184160, 
+    184161, 184162, 184163, 184164, 184165, 184166, 184167, 184168, 184169, 
+    184170, 184171, 184172, 184173, 184174, 184175, 184176, 184177, 184178, 
+    184179, 184180, 184181, 184182, 184183, 184184, 184185, 184186, 184187, 
+    184188, 184189, 184190, 184191, 184192, 184193, 184194, 184195, 184196, 
+    184197, 184198, 184199, 184200, 184201, 184202, 184203, 184204, 184205, 
+    184206, 184207, 184208, 184209, 184210, 184211, 184212, 184213, 184214, 
+    184215, 184216, 184217, 184218, 184219, 184220, 184221, 184222, 184223, 
+    184224, 184225, 184226, 184227, 184228, 184229, 184230, 184231, 184232, 
+    184233, 184234, 184235, 184236, 184237, 184238, 184239, 184240, 184241, 
+    184242, 184243, 184244, 184245, 184246, 184247, 184248, 184249, 184250, 
+    184251, 184252, 184253, 184254, 184255, 184256, 184257, 184258, 184259, 
+    184260, 184261, 184262, 184263, 184264, 184265, 184266, 184267, 184268, 
+    184269, 184270, 184271, 184272, 184273, 184274, 184275, 184276, 184277, 
+    184278, 184279, 184280, 184281, 184282, 184283, 184284, 184285, 184286, 
+    184287, 184288, 184289, 184290, 184291, 184292, 184293, 184294, 184295, 
+    184296, 184297, 184298, 184299, 184300, 184301, 184302, 184303, 184304, 
+    184305, 184306, 184307, 184308, 184309, 184310, 184311, 184312, 184313, 
+    184314, 184315, 184316, 184317, 184318, 184319, 184320, 184321, 184322, 
+    184323, 184324, 184325, 184326, 184327, 184328, 184329, 184330, 184331, 
+    184332, 184333, 184334, 184335, 184336, 184337, 184338, 184339, 184340, 
+    184341, 184342, 184343, 184344, 184345, 184346, 184347, 184348, 184349, 
+    184350, 184351, 184352, 184353, 184354, 184355, 184356, 184357, 184358, 
+    184359, 184360, 184361, 184362, 184363, 184364, 184365, 184366, 184367, 
+    184368, 184369, 184370, 184371, 184372, 184373, 184374, 184375, 184376, 
+    184377, 184378, 184379, 184380, 184381, 184382, 184383, 184384, 184385, 
+    184386, 184387, 184388, 184389, 184390, 184391, 184392, 184393, 184394, 
+    184395, 184396, 184397, 184398, 184399, 184400, 184401, 184402, 184403, 
+    184404, 184405, 184406, 184407, 184408, 184409, 184410, 184411, 184412, 
+    184413, 184414, 184415, 184416, 184417, 184418, 184419, 184420, 184421, 
+    184422, 184423, 184424, 184425, 184426, 184427, 184428, 184429, 184430, 
+    184431, 184432, 184433, 184434, 184435, 184436, 184437, 184438, 184439, 
+    184440, 184441, 184442, 184443, 184444, 184445, 184446, 184447, 184448, 
+    184449, 184450, 184451, 184452, 184453, 184454, 184455, 184456, 184457, 
+    184458, 184459, 184460, 184461, 184462, 184463, 184464, 184465, 184466, 
+    184467, 184468, 184469, 184470, 184471, 184472, 184473, 184474, 184475, 
+    184476, 184477, 184478, 184479, 184480, 184481, 184482, 184483, 184484, 
+    184485, 184486, 184487, 184488, 184489, 184490, 184491, 184492, 184493, 
+    184494, 184495, 184496, 184497, 184498, 184499, 184500, 184501, 184502, 
+    184503, 184504, 184505, 184506, 184507, 184508, 184509, 184510, 184511, 
+    184512, 184513, 184514, 184515, 184516, 184517, 184518, 184519, 184520, 
+    184521, 184522, 184523, 184524, 184525, 184526, 184527, 184528, 184529, 
+    184530, 184531, 184532, 184533, 184534, 184535, 184536, 184537, 184538, 
+    184539, 184540, 184541, 184542, 184543, 184544, 184545, 184546, 184547, 
+    184548, 184549, 184550, 184551, 184552, 184553, 184554, 184555, 184556, 
+    184557, 184558, 184559, 184560, 184561, 184562, 184563, 184564, 184565, 
+    184566, 184567, 184568, 184569, 184570, 184571, 184572, 184573, 184574, 
+    184575, 184576, 184577, 184578, 184579, 184580, 184581, 184582, 184583, 
+    184584, 184585, 184586, 184587, 184588, 184589, 184590, 184591, 184592, 
+    184593, 184594, 184595, 184596, 184597, 184598, 184599, 184600, 184601, 
+    184602, 184603, 184604, 184605, 184606, 184607, 184608, 184609, 184610, 
+    184611, 184612, 184613, 184614, 184615, 184616, 184617, 184618, 184619, 
+    184620, 184621, 184622, 184623, 184624, 184625, 184626, 184627, 184628, 
+    184629, 184630, 184631, 184632, 184633, 184634, 184635, 184636, 184637, 
+    184638, 184639, 184640, 184641, 184642, 184643, 184644, 184645, 184646, 
+    184647, 184648, 184649, 184650, 184651, 184652, 184653, 184654, 184655, 
+    184656, 184657, 184658, 184659, 184660, 184661, 184662, 184663, 184664, 
+    184665, 184666, 184667, 184668, 184669, 184670, 184671, 184672, 184673, 
+    184674, 184675, 184676, 184677, 184678, 184679, 184680, 184681, 184682, 
+    184683, 184684, 184685, 184686, 184687, 184688, 184689, 184690, 184691, 
+    184692, 184693, 184694, 184695, 184696, 184697, 184698, 184699, 184700, 
+    184701, 184702, 184703, 184704, 184705, 184706, 184707, 184708, 184709, 
+    184710, 184711, 184712, 184713, 184714, 184715, 184716, 184717, 184718, 
+    184719, 184720, 184721, 184722, 184723, 184724, 184725, 184726, 184727, 
+    184728, 184729, 184730, 184731, 184732, 184733, 184734, 184735, 184736, 
+    184737, 184738, 184739, 184740, 184741, 184742, 184743, 184744, 184745, 
+    184746, 184747, 184748, 184749, 184750, 184751, 184752, 184753, 184754, 
+    184755, 184756, 184757, 184758, 184759, 184760, 184761, 184762, 184763, 
+    184764, 184765, 184766, 184767, 184768, 184769, 184770, 184771, 184772, 
+    184773, 184774, 184775, 184776, 184777, 184778, 184779, 184780, 184781, 
+    184782, 184783, 184784, 184785, 184786, 184787, 184788, 184789, 184790, 
+    184791, 184792, 184793, 184794, 184795, 184796, 184797, 184798, 184799, 
+    184800, 184801, 184802, 184803, 184804, 184805, 184806, 184807, 184808, 
+    184809, 184810, 184811, 184812, 184813, 184814, 184815, 184816, 184817, 
+    184818, 184819, 184820, 184821, 184822, 184823, 184824, 184825, 184826, 
+    184827, 184828, 184829, 184830, 184831, 184832, 184833, 184834, 184835, 
+    184836, 184837, 184838, 184839, 184840, 184841, 184842, 184843, 184844, 
+    184845, 184846, 184847, 184848, 184849, 184850, 184851, 184852, 184853, 
+    184854, 184855, 184856, 184857, 184858, 184859, 184860, 184861, 184862, 
+    184863, 184864, 184865, 184866, 184867, 184868, 184869, 184870, 184871, 
+    184872, 184873, 184874, 184875, 184876, 184877, 184878, 184879, 184880, 
+    184881, 184882, 184883, 184884, 184885, 184886, 184887, 184888, 184889, 
+    184890, 184891, 184892, 184893, 184894, 184895, 184896, 184897, 184898, 
+    184899, 184900, 184901, 184902, 184903, 184904, 184905, 184906, 184907, 
+    184908, 184909, 184910, 184911, 184912, 184913, 184914, 184915, 184916, 
+    184917, 184918, 184919, 184920, 184921, 184922, 184923, 184924, 184925, 
+    184926, 184927, 184928, 184929, 184930, 184931, 184932, 184933, 184934, 
+    184935, 184936, 184937, 184938, 184939, 184940, 184941, 184942, 184943, 
+    184944, 184945, 184946, 184947, 184948, 184949, 184950, 184951, 184952, 
+    184953, 184954, 184955, 184956, 184957, 184958, 184959, 184960, 184961, 
+    184962, 184963, 184964, 184965, 184966, 184967, 184968, 184969, 184970, 
+    184971, 184972, 184973, 184974, 184975, 184976, 184977, 184978, 184979, 
+    184980, 184981, 184982, 184983, 184984, 184985, 184986, 184987, 184988, 
+    184989, 184990, 184991, 184992, 184993, 184994, 184995, 184996, 184997, 
+    184998, 184999, 185000, 185001, 185002, 185003, 185004, 185005, 185006, 
+    185007, 185008, 185009, 185010, 185011, 185012, 185013, 185014, 185015, 
+    185016, 185017, 185018, 185019, 185020, 185021, 185022, 185023, 185024, 
+    185025, 185026, 185027, 185028, 185029, 185030, 185031, 185032, 185033, 
+    185034, 185035, 185036, 185037, 185038, 185039, 185040, 185041, 185042, 
+    185043, 185044, 185045, 185046, 185047, 185048, 185049, 185050, 185051, 
+    185052, 185053, 185054, 185055, 185056, 185057, 185058, 185059, 185060, 
+    185061, 185062, 185063, 185064, 185065, 185066, 185067, 185068, 185069, 
+    185070, 185071, 185072, 185073, 185074, 185075, 185076, 185077, 185078, 
+    185079, 185080, 185081, 185082, 185083, 185084, 185085, 185086, 185087, 
+    185088, 185089, 185090, 185091, 185092, 185093, 185094, 185095, 185096, 
+    185097, 185098, 185099, 185100, 185101, 185102, 185103, 185104, 185105, 
+    185106, 185107, 185108, 185109, 185110, 185111, 185112, 185113, 185114, 
+    185115, 185116, 185117, 185118, 185119, 185120, 185121, 185122, 185123, 
+    185124, 185125, 185126, 185127, 185128, 185129, 185130, 185131, 185132, 
+    185133, 185134, 185135, 185136, 185137, 185138, 185139, 185140, 185141, 
+    185142, 185143, 185144, 185145, 185146, 185147, 185148, 185149, 185150, 
+    185151, 185152, 185153, 185154, 185155, 185156, 185157, 185158, 185159, 
+    185160, 185161, 185162, 185163, 185164, 185165, 185166, 185167, 185168, 
+    185169, 185170, 185171, 185172, 185173, 185174, 185175, 185176, 185177, 
+    185178, 185179, 185180, 185181, 185182, 185183, 185184, 185185, 185186, 
+    185187, 185188, 185189, 185190, 185191, 185192, 185193, 185194, 185195, 
+    185196, 185197, 185198, 185199, 185200, 185201, 185202, 185203, 185204, 
+    185205, 185206, 185207, 185208, 185209, 185210, 185211, 185212, 185213, 
+    185214, 185215, 185216, 185217, 185218, 185219, 185220, 185221, 185222, 
+    185223, 185224, 185225, 185226, 185227, 185228, 185229, 185230, 185231, 
+    185232, 185233, 185234, 185235, 185236, 185237, 185238, 185239, 185240, 
+    185241, 185242, 185243, 185244, 185245, 185246, 185247, 185248, 185249, 
+    185250, 185251, 185252, 185253, 185254, 185255, 185256, 185257, 185258, 
+    185259, 185260, 185261, 185262, 185263, 185264, 185265, 185266, 185267, 
+    185268, 185269, 185270, 185271, 185272, 185273, 185274, 185275, 185276, 
+    185277, 185278, 185279, 185280, 185281, 185282, 185283, 185284, 185285, 
+    185286, 185287, 185288, 185289, 185290, 185291, 185292, 185293, 185294, 
+    185295, 185296, 185297, 185298, 185299, 185300, 185301, 185302, 185303, 
+    185304, 185305, 185306, 185307, 185308, 185309, 185310, 185311, 185312, 
+    185313, 185314, 185315, 185316, 185317, 185318, 185319, 185320, 185321, 
+    185322, 185323, 185324, 185325, 185326, 185327, 185328, 185329, 185330, 
+    185331, 185332, 185333, 185334, 185335, 185336, 185337, 185338, 185339, 
+    185340, 185341, 185342, 185343, 185344, 185345, 185346, 185347, 185348, 
+    185349, 185350, 185351, 185352, 185353, 185354, 185355, 185356, 185357, 
+    185358, 185359, 185360, 185361, 185362, 185363, 185364, 185365, 185366, 
+    185367, 185368, 185369, 185370, 185371, 185372, 185373, 185374, 185375, 
+    185376, 185377, 185378, 185379, 185380, 185381, 185382, 185383, 185384, 
+    185385, 185386, 185387, 185388, 185389, 185390, 185391, 185392, 185393, 
+    185394, 185395, 185396, 185397, 185398, 185399, 185400, 185401, 185402, 
+    185403, 185404, 185405, 185406, 185407, 185408, 185409, 185410, 185411, 
+    185412, 185413, 185414, 185415, 185416, 185417, 185418, 185419, 185420, 
+    185421, 185422, 185423, 185424, 185425, 185426, 185427, 185428, 185429, 
+    185430, 185431, 185432, 185433, 185434, 185435, 185436, 185437, 185438, 
+    185439, 185440, 185441, 185442, 185443, 185444, 185445, 185446, 185447, 
+    185448, 185449, 185450, 185451, 185452, 185453, 185454, 185455, 185456, 
+    185457, 185458, 185459, 185460, 185461, 185462, 185463, 185464, 185465, 
+    185466, 185467, 185468, 185469, 185470, 185471, 185472, 185473, 185474, 
+    185475, 185476, 185477, 185478, 185479, 185480, 185481, 185482, 185483, 
+    185484, 185485, 185486, 185487, 185488, 185489, 185490, 185491, 185492, 
+    185493, 185494, 185495, 185496, 185497, 185498, 185499, 185500, 185501, 
+    185502, 185503, 185504, 185505, 185506, 185507, 185508, 185509, 185510, 
+    185511, 185512, 185513, 185514, 185515, 185516, 185517, 185518, 185519, 
+    185520, 185521, 185522, 185523, 185524, 185525, 185526, 185527, 185528, 
+    185529, 185530, 185531, 185532, 185533, 185534, 185535, 185536, 185537, 
+    185538, 185539, 185540, 185541, 185542, 185543, 185544, 185545, 185546, 
+    185547, 185548, 185549, 185550, 185551, 185552, 185553, 185554, 185555, 
+    185556, 185557, 185558, 185559, 185560, 185561, 185562, 185563, 185564, 
+    185565, 185566, 185567, 185568, 185569, 185570, 185571, 185572, 185573, 
+    185574, 185575, 185576, 185577, 185578, 185579, 185580, 185581, 185582, 
+    185583, 185584, 185585, 185586, 185587, 185588, 185589, 185590, 185591, 
+    185592, 185593, 185594, 185595, 185596, 185597, 185598, 185599, 185600, 
+    185601, 185602, 185603, 185604, 185605, 185606, 185607, 185608, 185609, 
+    185610, 185611, 185612, 185613, 185614, 185615, 185616, 185617, 185618, 
+    185619, 185620, 185621, 185622, 185623, 185624, 185625, 185626, 185627, 
+    185628, 185629, 185630, 185631, 185632, 185633, 185634, 185635, 185636, 
+    185637, 185638, 185639, 185640, 185641, 185642, 185643, 185644, 185645, 
+    185646, 185647, 185648, 185649, 185650, 185651, 185652, 185653, 185654, 
+    185655, 185656, 185657, 185658, 185659, 185660, 185661, 185662, 185663, 
+    185664, 185665, 185666, 185667, 185668, 185669, 185670, 185671, 185672, 
+    185673, 185674, 185675, 185676, 185677, 185678, 185679, 185680, 185681, 
+    185682, 185683, 185684, 185685, 185686, 185687, 185688, 185689, 185690, 
+    185691, 185692, 185693, 185694, 185695, 185696, 185697, 185698, 185699, 
+    185700, 185701, 185702, 185703, 185704, 185705, 185706, 185707, 185708, 
+    185709, 185710, 185711, 185712, 185713, 185714, 185715, 185716, 185717, 
+    185718, 185719, 185720, 185721, 185722, 185723, 185724, 185725, 185726, 
+    185727, 185728, 185729, 185730, 185731, 185732, 185733, 185734, 185735, 
+    185736, 185737, 185738, 185739, 185740, 185741, 185742, 185743, 185744, 
+    185745, 185746, 185747, 185748, 185749, 185750, 185751, 185752, 185753, 
+    185754, 185755, 185756, 185757, 185758, 185759, 185760, 185761, 185762, 
+    185763, 185764, 185765, 185766, 185767, 185768, 185769, 185770, 185771, 
+    185772, 185773, 185774, 185775, 185776, 185777, 185778, 185779, 185780, 
+    185781, 185782, 185783, 185784, 185785, 185786, 185787, 185788, 185789, 
+    185790, 185791, 185792, 185793, 185794, 185795, 185796, 185797, 185798, 
+    185799, 185800, 185801, 185802, 185803, 185804, 185805, 185806, 185807, 
+    185808, 185809, 185810, 185811, 185812, 185813, 185814, 185815, 185816, 
+    185817, 185818, 185819, 185820, 185821, 185822, 185823, 185824, 185825, 
+    185826, 185827, 185828, 185829, 185830, 185831, 185832, 185833, 185834, 
+    185835, 185836, 185837, 185838, 185839, 185840, 185841, 185842, 185843, 
+    185844, 185845, 185846, 185847, 185848, 185849, 185850, 185851, 185852, 
+    185853, 185854, 185855, 185856, 185857, 185858, 185859, 185860, 185861, 
+    185862, 185863, 185864, 185865, 185866, 185867, 185868, 185869, 185870, 
+    185871, 185872, 185873, 185874, 185875, 185876, 185877, 185878, 185879, 
+    185880, 185881, 185882, 185883, 185884, 185885, 185886, 185887, 185888, 
+    185889, 185890, 185891, 185892, 185893, 185894, 185895, 185896, 185897, 
+    185898, 185899, 185900, 185901, 185902, 185903, 185904, 185905, 185906, 
+    185907, 185908, 185909, 185910, 185911, 185912, 185913, 185914, 185915, 
+    185916, 185917, 185918, 185919, 185920, 185921, 185922, 185923, 185924, 
+    185925, 185926, 185927, 185928, 185929, 185930, 185931, 185932, 185933, 
+    185934, 185935, 185936, 185937, 185938, 185939, 185940, 185941, 185942, 
+    185943, 185944, 185945, 185946, 185947, 185948, 185949, 185950, 185951, 
+    185952, 185953, 185954, 185955, 185956, 185957, 185958, 185959, 185960, 
+    185961, 185962, 185963, 185964, 185965, 185966, 185967, 185968, 185969, 
+    185970, 185971, 185972, 185973, 185974, 185975, 185976, 185977, 185978, 
+    185979, 185980, 185981, 185982, 185983, 185984, 185985, 185986, 185987, 
+    185988, 185989, 185990, 185991, 185992, 185993, 185994, 185995, 185996, 
+    185997, 185998, 185999, 186000, 186001, 186002, 186003, 186004, 186005, 
+    186006, 186007, 186008, 186009, 186010, 186011, 186012, 186013, 186014, 
+    186015, 186016, 186017, 186018, 186019, 186020, 186021, 186022, 186023, 
+    186024, 186025, 186026, 186027, 186028, 186029, 186030, 186031, 186032, 
+    186033, 186034, 186035, 186036, 186037, 186038, 186039, 186040, 186041, 
+    186042, 186043, 186044, 186045, 186046, 186047, 186048, 186049, 186050, 
+    186051, 186052, 186053, 186054, 186055, 186056, 186057, 186058, 186059, 
+    186060, 186061, 186062, 186063, 186064, 186065, 186066, 186067, 186068, 
+    186069, 186070, 186071, 186072, 186073, 186074, 186075, 186076, 186077, 
+    186078, 186079, 186080, 186081, 186082, 186083, 186084, 186085, 186086, 
+    186087, 186088, 186089, 186090, 186091, 186092, 186093, 186094, 186095, 
+    186096, 186097, 186098, 186099, 186100, 186101, 186102, 186103, 186104, 
+    186105, 186106, 186107, 186108, 186109, 186110, 186111, 186112, 186113, 
+    186114, 186115, 186116, 186117, 186118, 186119, 186120, 186121, 186122, 
+    186123, 186124, 186125, 186126, 186127, 186128, 186129, 186130, 186131, 
+    186132, 186133, 186134, 186135, 186136, 186137, 186138, 186139, 186140, 
+    186141, 186142, 186143, 186144, 186145, 186146, 186147, 186148, 186149, 
+    186150, 186151, 186152, 186153, 186154, 186155, 186156, 186157, 186158, 
+    186159, 186160, 186161, 186162, 186163, 186164, 186165, 186166, 186167, 
+    186168, 186169, 186170, 186171, 186172, 186173, 186174, 186175, 186176, 
+    186177, 186178, 186179, 186180, 186181, 186182, 186183, 186184, 186185, 
+    186186, 186187, 186188, 186189, 186190, 186191, 186192, 186193, 186194, 
+    186195, 186196, 186197, 186198, 186199, 186200, 186201, 186202, 186203, 
+    186204, 186205, 186206, 186207, 186208, 186209, 186210, 186211, 186212, 
+    186213, 186214, 186215, 186216, 186217, 186218, 186219, 186220, 186221, 
+    186222, 186223, 186224, 186225, 186226, 186227, 186228, 186229, 186230, 
+    186231, 186232, 186233, 186234, 186235, 186236, 186237, 186238, 186239, 
+    186240, 186241, 186242, 186243, 186244, 186245, 186246, 186247, 186248, 
+    186249, 186250, 186251, 186252, 186253, 186254, 186255, 186256, 186257, 
+    186258, 186259, 186260, 186261, 186262, 186263, 186264, 186265, 186266, 
+    186267, 186268, 186269, 186270, 186271, 186272, 186273, 186274, 186275, 
+    186276, 186277, 186278, 186279, 186280, 186281, 186282, 186283, 186284, 
+    186285, 186286, 186287, 186288, 186289, 186290, 186291, 186292, 186293, 
+    186294, 186295, 186296, 186297, 186298, 186299, 186300, 186301, 186302, 
+    186303, 186304, 186305, 186306, 186307, 186308, 186309, 186310, 186311, 
+    186312, 186313, 186314, 186315, 186316, 186317, 186318, 186319, 186320, 
+    186321, 186322, 186323, 186324, 186325, 186326, 186327, 186328, 186329, 
+    186330, 186331, 186332, 186333, 186334, 186335, 186336, 186337, 186338, 
+    186339, 186340, 186341, 186342, 186343, 186344, 186345, 186346, 186347, 
+    186348, 186349, 186350, 186351, 186352, 186353, 186354, 186355, 186356, 
+    186357, 186358, 186359, 186360, 186361, 186362, 186363, 186364, 186365, 
+    186366, 186367, 186368, 186369, 186370, 186371, 186372, 186373, 186374, 
+    186375, 186376, 186377, 186378, 186379, 186380, 186381, 186382, 186383, 
+    186384, 186385, 186386, 186387, 186388, 186389, 186390, 186391, 186392, 
+    186393, 186394, 186395, 186396, 186397, 186398, 186399, 186400, 186401, 
+    186402, 186403, 186404, 186405, 186406, 186407, 186408, 186409, 186410, 
+    186411, 186412, 186413, 186414, 186415, 186416, 186417, 186418, 186419, 
+    186420, 186421, 186422, 186423, 186424, 186425, 186426, 186427, 186428, 
+    186429, 186430, 186431, 186432, 186433, 186434, 186435, 186436, 186437, 
+    186438, 186439, 186440, 186441, 186442, 186443, 186444, 186445, 186446, 
+    186447, 186448, 186449, 186450, 186451, 186452, 186453, 186454, 186455, 
+    186456, 186457, 186458, 186459, 186460, 186461, 186462, 186463, 186464, 
+    186465, 186466, 186467, 186468, 186469, 186470, 186471, 186472, 186473, 
+    186474, 186475, 186476, 186477, 186478, 186479, 186480, 186481, 186482, 
+    186483, 186484, 186485, 186486, 186487, 186488, 186489, 186490, 186491, 
+    186492, 186493, 186494, 186495, 186496, 186497, 186498, 186499, 186500, 
+    186501, 186502, 186503, 186504, 186505, 186506, 186507, 186508, 186509, 
+    186510, 186511, 186512, 186513, 186514, 186515, 186516, 186517, 186518, 
+    186519, 186520, 186521, 186522, 186523, 186524, 186525, 186526, 186527, 
+    186528, 186529, 186530, 186531, 186532, 186533, 186534, 186535, 186536, 
+    186537, 186538, 186539, 186540, 186541, 186542, 186543, 186544, 186545, 
+    186546, 186547, 186548, 186549, 186550, 186551, 186552, 186553, 186554, 
+    186555, 186556, 186557, 186558, 186559, 186560, 186561, 186562, 186563, 
+    186564, 186565, 186566, 186567, 186568, 186569, 186570, 186571, 186572, 
+    186573, 186574, 186575, 186576, 186577, 186578, 186579, 186580, 186581, 
+    186582, 186583, 186584, 186585, 186586, 186587, 186588, 186589, 186590, 
+    186591, 186592, 186593, 186594, 186595, 186596, 186597, 186598, 186599, 
+    186600, 186601, 186602, 186603, 186604, 186605, 186606, 186607, 186608, 
+    186609, 186610, 186611, 186612, 186613, 186614, 186615, 186616, 186617, 
+    186618, 186619, 186620, 186621, 186622, 186623, 186624, 186625, 186626, 
+    186627, 186628, 186629, 186630, 186631, 186632, 186633, 186634, 186635, 
+    186636, 186637, 186638, 186639, 186640, 186641, 186642, 186643, 186644, 
+    186645, 186646, 186647, 186648, 186649, 186650, 186651, 186652, 186653, 
+    186654, 186655, 186656, 186657, 186658, 186659, 186660, 186661, 186662, 
+    186663, 186664, 186665, 186666, 186667, 186668, 186669, 186670, 186671, 
+    186672, 186673, 186674, 186675, 186676, 186677, 186678, 186679, 186680, 
+    186681, 186682, 186683, 186684, 186685, 186686, 186687, 186688, 186689, 
+    186690, 186691, 186692, 186693, 186694, 186695, 186696, 186697, 186698, 
+    186699, 186700, 186701, 186702, 186703, 186704, 186705, 186706, 186707, 
+    186708, 186709, 186710, 186711, 186712, 186713, 186714, 186715, 186716, 
+    186717, 186718, 186719, 186720, 186721, 186722, 186723, 186724, 186725, 
+    186726, 186727, 186728, 186729, 186730, 186731, 186732, 186733, 186734, 
+    186735, 186736, 186737, 186738, 186739, 186740, 186741, 186742, 186743, 
+    186744, 186745, 186746, 186747, 186748, 186749, 186750, 186751, 186752, 
+    186753, 186754, 186755, 186756, 186757, 186758, 186759, 186760, 186761, 
+    186762, 186763, 186764, 186765, 186766, 186767, 186768, 186769, 186770, 
+    186771, 186772, 186773, 186774, 186775, 186776, 186777, 186778, 186779, 
+    186780, 186781, 186782, 186783, 186784, 186785, 186786, 186787, 186788, 
+    186789, 186790, 186791, 186792, 186793, 186794, 186795, 186796, 186797, 
+    186798, 186799, 186800, 186801, 186802, 186803, 186804, 186805, 186806, 
+    186807, 186808, 186809, 186810, 186811, 186812, 186813, 186814, 186815, 
+    186816, 186817, 186818, 186819, 186820, 186821, 186822, 186823, 186824, 
+    186825, 186826, 186827, 186828, 186829, 186830, 186831, 186832, 186833, 
+    186834, 186835, 186836, 186837, 186838, 186839, 186840, 186841, 186842, 
+    186843, 186844, 186845, 186846, 186847, 186848, 186849, 186850, 186851, 
+    186852, 186853, 186854, 186855, 186856, 186857, 186858, 186859, 186860, 
+    186861, 186862, 186863, 186864, 186865, 186866, 186867, 186868, 186869, 
+    186870, 186871, 186872, 186873, 186874, 186875, 186876, 186877, 186878, 
+    186879, 186880, 186881, 186882, 186883, 186884, 186885, 186886, 186887, 
+    186888, 186889, 186890, 186891, 186892, 186893, 186894, 186895, 186896, 
+    186897, 186898, 186899, 186900, 186901, 186902, 186903, 186904, 186905, 
+    186906, 186907, 186908, 186909, 186910, 186911, 186912, 186913, 186914, 
+    186915, 186916, 186917, 186918, 186919, 186920, 186921, 186922, 186923, 
+    186924, 186925, 186926, 186927, 186928, 186929, 186930, 186931, 186932, 
+    186933, 186934, 186935, 186936, 186937, 186938, 186939, 186940, 186941, 
+    186942, 186943, 186944, 186945, 186946, 186947, 186948, 186949, 186950, 
+    186951, 186952, 186953, 186954, 186955, 186956, 186957, 186958, 186959, 
+    186960, 186961, 186962, 186963, 186964, 186965, 186966, 186967, 186968, 
+    186969, 186970, 186971, 186972, 186973, 186974, 186975, 186976, 186977, 
+    186978, 186979, 186980, 186981, 186982, 186983, 186984, 186985, 186986, 
+    186987, 186988, 186989, 186990, 186991, 186992, 186993, 186994, 186995, 
+    186996, 186997, 186998, 186999, 187000, 187001, 187002, 187003, 187004, 
+    187005, 187006, 187007, 187008, 187009, 187010, 187011, 187012, 187013, 
+    187014, 187015, 187016, 187017, 187018, 187019, 187020, 187021, 187022, 
+    187023, 187024, 187025, 187026, 187027, 187028, 187029, 187030, 187031, 
+    187032, 187033, 187034, 187035, 187036, 187037, 187038, 187039, 187040, 
+    187041, 187042, 187043, 187044, 187045, 187046, 187047, 187048, 187049, 
+    187050, 187051, 187052, 187053, 187054, 187055, 187056, 187057, 187058, 
+    187059, 187060, 187061, 187062, 187063, 187064, 187065, 187066, 187067, 
+    187068, 187069, 187070, 187071, 187072, 187073, 187074, 187075, 187076, 
+    187077, 187078, 187079, 187080, 187081, 187082, 187083, 187084, 187085, 
+    187086, 187087, 187088, 187089, 187090, 187091, 187092, 187093, 187094, 
+    187095, 187096, 187097, 187098, 187099, 187100, 187101, 187102, 187103, 
+    187104, 187105, 187106, 187107, 187108, 187109, 187110, 187111, 187112, 
+    187113, 187114, 187115, 187116, 187117, 187118, 187119, 187120, 187121, 
+    187122, 187123, 187124, 187125, 187126, 187127, 187128, 187129, 187130, 
+    187131, 187132, 187133, 187134, 187135, 187136, 187137, 187138, 187139, 
+    187140, 187141, 187142, 187143, 187144, 187145, 187146, 187147, 187148, 
+    187149, 187150, 187151, 187152, 187153, 187154, 187155, 187156, 187157, 
+    187158, 187159, 187160, 187161, 187162, 187163, 187164, 187165, 187166, 
+    187167, 187168, 187169, 187170, 187171, 187172, 187173, 187174, 187175, 
+    187176, 187177, 187178, 187179, 187180, 187181, 187182, 187183, 187184, 
+    187185, 187186, 187187, 187188, 187189, 187190, 187191, 187192, 187193, 
+    187194, 187195, 187196, 187197, 187198, 187199, 187200, 187201, 187202, 
+    187203, 187204, 187205, 187206, 187207, 187208, 187209, 187210, 187211, 
+    187212, 187213, 187214, 187215, 187216, 187217, 187218, 187219, 187220, 
+    187221, 187222, 187223, 187224, 187225, 187226, 187227, 187228, 187229, 
+    187230, 187231, 187232, 187233, 187234, 187235, 187236, 187237, 187238, 
+    187239, 187240, 187241, 187242, 187243, 187244, 187245, 187246, 187247, 
+    187248, 187249, 187250, 187251, 187252, 187253, 187254, 187255, 187256, 
+    187257, 187258, 187259, 187260, 187261, 187262, 187263, 187264, 187265, 
+    187266, 187267, 187268, 187269, 187270, 187271, 187272, 187273, 187274, 
+    187275, 187276, 187277, 187278, 187279, 187280, 187281, 187282, 187283, 
+    187284, 187285, 187286, 187287, 187288, 187289, 187290, 187291, 187292, 
+    187293, 187294, 187295, 187296, 187297, 187298, 187299, 187300, 187301, 
+    187302, 187303, 187304, 187305, 187306, 187307, 187308, 187309, 187310, 
+    187311, 187312, 187313, 187314, 187315, 187316, 187317, 187318, 187319, 
+    187320, 187321, 187322, 187323, 187324, 187325, 187326, 187327, 187328, 
+    187329, 187330, 187331, 187332, 187333, 187334, 187335, 187336, 187337, 
+    187338, 187339, 187340, 187341, 187342, 187343, 187344, 187345, 187346, 
+    187347, 187348, 187349, 187350, 187351, 187352, 187353, 187354, 187355, 
+    187356, 187357, 187358, 187359, 187360, 187361, 187362, 187363, 187364, 
+    187365, 187366, 187367, 187368, 187369, 187370, 187371, 187372, 187373, 
+    187374, 187375, 187376, 187377, 187378, 187379, 187380, 187381, 187382, 
+    187383, 187384, 187385, 187386, 187387, 187388, 187389, 187390, 187391, 
+    187392, 187393, 187394, 187395, 187396, 187397, 187398, 187399, 187400, 
+    187401, 187402, 187403, 187404, 187405, 187406, 187407, 187408, 187409, 
+    187410, 187411, 187412, 187413, 187414, 187415, 187416, 187417, 187418, 
+    187419, 187420, 187421, 187422, 187423, 187424, 187425, 187426, 187427, 
+    187428, 187429, 187430, 187431, 187432, 187433, 187434, 187435, 187436, 
+    187437, 187438, 187439, 187440, 187441, 187442, 187443, 187444, 187445, 
+    187446, 187447, 187448, 187449, 187450, 187451, 187452, 187453, 187454, 
+    187455, 187456, 187457, 187458, 187459, 187460, 187461, 187462, 187463, 
+    187464, 187465, 187466, 187467, 187468, 187469, 187470, 187471, 187472, 
+    187473, 187474, 187475, 187476, 187477, 187478, 187479, 187480, 187481, 
+    187482, 187483, 187484, 187485, 187486, 187487, 187488, 187489, 187490, 
+    187491, 187492, 187493, 187494, 187495, 187496, 187497, 187498, 187499, 
+    187500, 187501, 187502, 187503, 187504, 187505, 187506, 187507, 187508, 
+    187509, 187510, 187511, 187512, 187513, 187514, 187515, 187516, 187517, 
+    187518, 187519, 187520, 187521, 187522, 187523, 187524, 187525, 187526, 
+    187527, 187528, 187529, 187530, 187531, 187532, 187533, 187534, 187535, 
+    187536, 187537, 187538, 187539, 187540, 187541, 187542, 187543, 187544, 
+    187545, 187546, 187547, 187548, 187549, 187550, 187551, 187552, 187553, 
+    187554, 187555, 187556, 187557, 187558, 187559, 187560, 187561, 187562, 
+    187563, 187564, 187565, 187566, 187567, 187568, 187569, 187570, 187571, 
+    187572, 187573, 187574, 187575, 187576, 187577, 187578, 187579, 187580, 
+    187581, 187582, 187583, 187584, 187585, 187586, 187587, 187588, 187589, 
+    187590, 187591, 187592, 187593, 187594, 187595, 187596, 187597, 187598, 
+    187599, 187600, 187601, 187602, 187603, 187604, 187605, 187606, 187607, 
+    187608, 187609, 187610, 187611, 187612, 187613, 187614, 187615, 187616, 
+    187617, 187618, 187619, 187620, 187621, 187622, 187623, 187624, 187625, 
+    187626, 187627, 187628, 187629, 187630, 187631, 187632, 187633, 187634, 
+    187635, 187636, 187637, 187638, 187639, 187640, 187641, 187642, 187643, 
+    187644, 187645, 187646, 187647, 187648, 187649, 187650, 187651, 187652, 
+    187653, 187654, 187655, 187656, 187657, 187658, 187659, 187660, 187661, 
+    187662, 187663, 187664, 187665, 187666, 187667, 187668, 187669, 187670, 
+    187671, 187672, 187673, 187674, 187675, 187676, 187677, 187678, 187679, 
+    187680, 187681, 187682, 187683, 187684, 187685, 187686, 187687, 187688, 
+    187689, 187690, 187691, 187692, 187693, 187694, 187695, 187696, 187697, 
+    187698, 187699, 187700, 187701, 187702, 187703, 187704, 187705, 187706, 
+    187707, 187708, 187709, 187710, 187711, 187712, 187713, 187714, 187715, 
+    187716, 187717, 187718, 187719, 187720, 187721, 187722, 187723, 187724, 
+    187725, 187726, 187727, 187728, 187729, 187730, 187731, 187732, 187733, 
+    187734, 187735, 187736, 187737, 187738, 187739, 187740, 187741, 187742, 
+    187743, 187744, 187745, 187746, 187747, 187748, 187749, 187750, 187751, 
+    187752, 187753, 187754, 187755, 187756, 187757, 187758, 187759, 187760, 
+    187761, 187762, 187763, 187764, 187765, 187766, 187767, 187768, 187769, 
+    187770, 187771, 187772, 187773, 187774, 187775, 187776, 187777, 187778, 
+    187779, 187780, 187781, 187782, 187783, 187784, 187785, 187786, 187787, 
+    187788, 187789, 187790, 187791, 187792, 187793, 187794, 187795, 187796, 
+    187797, 187798, 187799, 187800, 187801, 187802, 187803, 187804, 187805, 
+    187806, 187807, 187808, 187809, 187810, 187811, 187812, 187813, 187814, 
+    187815, 187816, 187817, 187818, 187819, 187820, 187821, 187822, 187823, 
+    187824, 187825, 187826, 187827, 187828, 187829, 187830, 187831, 187832, 
+    187833, 187834, 187835, 187836, 187837, 187838, 187839, 187840, 187841, 
+    187842, 187843, 187844, 187845, 187846, 187847, 187848, 187849, 187850, 
+    187851, 187852, 187853, 187854, 187855, 187856, 187857, 187858, 187859, 
+    187860, 187861, 187862, 187863, 187864, 187865, 187866, 187867, 187868, 
+    187869, 187870, 187871, 187872, 187873, 187874, 187875, 187876, 187877, 
+    187878, 187879, 187880, 187881, 187882, 187883, 187884, 187885, 187886, 
+    187887, 187888, 187889, 187890, 187891, 187892, 187893, 187894, 187895, 
+    187896, 187897, 187898, 187899, 187900, 187901, 187902, 187903, 187904, 
+    187905, 187906, 187907, 187908, 187909, 187910, 187911, 187912, 187913, 
+    187914, 187915, 187916, 187917, 187918, 187919, 187920, 187921, 187922, 
+    187923, 187924, 187925, 187926, 187927, 187928, 187929, 187930, 187931, 
+    187932, 187933, 187934, 187935, 187936, 187937, 187938, 187939, 187940, 
+    187941, 187942, 187943, 187944, 187945, 187946, 187947, 187948, 187949, 
+    187950, 187951, 187952, 187953, 187954, 187955, 187956, 187957, 187958, 
+    187959, 187960, 187961, 187962, 187963, 187964, 187965, 187966, 187967, 
+    187968, 187969, 187970, 187971, 187972, 187973, 187974, 187975, 187976, 
+    187977, 187978, 187979, 187980, 187981, 187982, 187983, 187984, 187985, 
+    187986, 187987, 187988, 187989, 187990, 187991, 187992, 187993, 187994, 
+    187995, 187996, 187997, 187998, 187999, 188000, 188001, 188002, 188003, 
+    188004, 188005, 188006, 188007, 188008, 188009, 188010, 188011, 188012, 
+    188013, 188014, 188015, 188016, 188017, 188018, 188019, 188020, 188021, 
+    188022, 188023, 188024, 188025, 188026, 188027, 188028, 188029, 188030, 
+    188031, 188032, 188033, 188034, 188035, 188036, 188037, 188038, 188039, 
+    188040, 188041, 188042, 188043, 188044, 188045, 188046, 188047, 188048, 
+    188049, 188050, 188051, 188052, 188053, 188054, 188055, 188056, 188057, 
+    188058, 188059, 188060, 188061, 188062, 188063, 188064, 188065, 188066, 
+    188067, 188068, 188069, 188070, 188071, 188072, 188073, 188074, 188075, 
+    188076, 188077, 188078, 188079, 188080, 188081, 188082, 188083, 188084, 
+    188085, 188086, 188087, 188088, 188089, 188090, 188091, 188092, 188093, 
+    188094, 188095, 188096, 188097, 188098, 188099, 188100, 188101, 188102, 
+    188103, 188104, 188105, 188106, 188107, 188108, 188109, 188110, 188111, 
+    188112, 188113, 188114, 188115, 188116, 188117, 188118, 188119, 188120, 
+    188121, 188122, 188123, 188124, 188125, 188126, 188127, 188128, 188129, 
+    188130, 188131, 188132, 188133, 188134, 188135, 188136, 188137, 188138, 
+    188139, 188140, 188141, 188142, 188143, 188144, 188145, 188146, 188147, 
+    188148, 188149, 188150, 188151, 188152, 188153, 188154, 188155, 188156, 
+    188157, 188158, 188159, 188160, 188161, 188162, 188163, 188164, 188165, 
+    188166, 188167, 188168, 188169, 188170, 188171, 188172, 188173, 188174, 
+    188175, 188176, 188177, 188178, 188179, 188180, 188181, 188182, 188183, 
+    188184, 188185, 188186, 188187, 188188, 188189, 188190, 188191, 188192, 
+    188193, 188194, 188195, 188196, 188197, 188198, 188199, 188200, 188201, 
+    188202, 188203, 188204, 188205, 188206, 188207, 188208, 188209, 188210, 
+    188211, 188212, 188213, 188214, 188215, 188216, 188217, 188218, 188219, 
+    188220, 188221, 188222, 188223, 188224, 188225, 188226, 188227, 188228, 
+    188229, 188230, 188231, 188232, 188233, 188234, 188235, 188236, 188237, 
+    188238, 188239, 188240, 188241, 188242, 188243, 188244, 188245, 188246, 
+    188247, 188248, 188249, 188250, 188251, 188252, 188253, 188254, 188255, 
+    188256, 188257, 188258, 188259, 188260, 188261, 188262, 188263, 188264, 
+    188265, 188266, 188267, 188268, 188269, 188270, 188271, 188272, 188273, 
+    188274, 188275, 188276, 188277, 188278, 188279, 188280, 188281, 188282, 
+    188283, 188284, 188285, 188286, 188287, 188288, 188289, 188290, 188291, 
+    188292, 188293, 188294, 188295, 188296, 188297, 188298, 188299, 188300, 
+    188301, 188302, 188303, 188304, 188305, 188306, 188307, 188308, 188309, 
+    188310, 188311, 188312, 188313, 188314, 188315, 188316, 188317, 188318, 
+    188319, 188320, 188321, 188322, 188323, 188324, 188325, 188326, 188327, 
+    188328, 188329, 188330, 188331, 188332, 188333, 188334, 188335, 188336, 
+    188337, 188338, 188339, 188340, 188341, 188342, 188343, 188344, 188345, 
+    188346, 188347, 188348, 188349, 188350, 188351, 188352, 188353, 188354, 
+    188355, 188356, 188357, 188358, 188359, 188360, 188361, 188362, 188363, 
+    188364, 188365, 188366, 188367, 188368, 188369, 188370, 188371, 188372, 
+    188373, 188374, 188375, 188376, 188377, 188378, 188379, 188380, 188381, 
+    188382, 188383, 188384, 188385, 188386, 188387, 188388, 188389, 188390, 
+    188391, 188392, 188393, 188394, 188395, 188396, 188397, 188398, 188399, 
+    188400, 188401, 188402, 188403, 188404, 188405, 188406, 188407, 188408, 
+    188409, 188410, 188411, 188412, 188413, 188414, 188415, 188416, 188417, 
+    188418, 188419, 188420, 188421, 188422, 188423, 188424, 188425, 188426, 
+    188427, 188428, 188429, 188430, 188431, 188432, 188433, 188434, 188435, 
+    188436, 188437, 188438, 188439, 188440, 188441, 188442, 188443, 188444, 
+    188445, 188446, 188447, 188448, 188449, 188450, 188451, 188452, 188453, 
+    188454, 188455, 188456, 188457, 188458, 188459, 188460, 188461, 188462, 
+    188463, 188464, 188465, 188466, 188467, 188468, 188469, 188470, 188471, 
+    188472, 188473, 188474, 188475, 188476, 188477, 188478, 188479, 188480, 
+    188481, 188482, 188483, 188484, 188485, 188486, 188487, 188488, 188489, 
+    188490, 188491, 188492, 188493, 188494, 188495, 188496, 188497, 188498, 
+    188499, 188500, 188501, 188502, 188503, 188504, 188505, 188506, 188507, 
+    188508, 188509, 188510, 188511, 188512, 188513, 188514, 188515, 188516, 
+    188517, 188518, 188519, 188520, 188521, 188522, 188523, 188524, 188525, 
+    188526, 188527, 188528, 188529, 188530, 188531, 188532, 188533, 188534, 
+    188535, 188536, 188537, 188538, 188539, 188540, 188541, 188542, 188543, 
+    188544, 188545, 188546, 188547, 188548, 188549, 188550, 188551, 188552, 
+    188553, 188554, 188555, 188556, 188557, 188558, 188559, 188560, 188561, 
+    188562, 188563, 188564, 188565, 188566, 188567, 188568, 188569, 188570, 
+    188571, 188572, 188573, 188574, 188575, 188576, 188577, 188578, 188579, 
+    188580, 188581, 188582, 188583, 188584, 188585, 188586, 188587, 188588, 
+    188589, 188590, 188591, 188592, 188593, 188594, 188595, 188596, 188597, 
+    188598, 188599, 188600, 188601, 188602, 188603, 188604, 188605, 188606, 
+    188607, 188608, 188609, 188610, 188611, 188612, 188613, 188614, 188615, 
+    188616, 188617, 188618, 188619, 188620, 188621, 188622, 188623, 188624, 
+    188625, 188626, 188627, 188628, 188629, 188630, 188631, 188632, 188633, 
+    188634, 188635, 188636, 188637, 188638, 188639, 188640, 188641, 188642, 
+    188643, 188644, 188645, 188646, 188647, 188648, 188649, 188650, 188651, 
+    188652, 188653, 188654, 188655, 188656, 188657, 188658, 188659, 188660, 
+    188661, 188662, 188663, 188664, 188665, 188666, 188667, 188668, 188669, 
+    188670, 188671, 188672, 188673, 188674, 188675, 188676, 188677, 188678, 
+    188679, 188680, 188681, 188682, 188683, 188684, 188685, 188686, 188687, 
+    188688, 188689, 188690, 188691, 188692, 188693, 188694, 188695, 188696, 
+    188697, 188698, 188699, 188700, 188701, 188702, 188703, 188704, 188705, 
+    188706, 188707, 188708, 188709, 188710, 188711, 188712, 188713, 188714, 
+    188715, 188716, 188717, 188718, 188719, 188720, 188721, 188722, 188723, 
+    188724, 188725, 188726, 188727, 188728, 188729, 188730, 188731, 188732, 
+    188733, 188734, 188735, 188736, 188737, 188738, 188739, 188740, 188741, 
+    188742, 188743, 188744, 188745, 188746, 188747, 188748, 188749, 188750, 
+    188751, 188752, 188753, 188754, 188755, 188756, 188757, 188758, 188759, 
+    188760, 188761, 188762, 188763, 188764, 188765, 188766, 188767, 188768, 
+    188769, 188770, 188771, 188772, 188773, 188774, 188775, 188776, 188777, 
+    188778, 188779, 188780, 188781, 188782, 188783, 188784, 188785, 188786, 
+    188787, 188788, 188789, 188790, 188791, 188792, 188793, 188794, 188795, 
+    188796, 188797, 188798, 188799, 188800, 188801, 188802, 188803, 188804, 
+    188805, 188806, 188807, 188808, 188809, 188810, 188811, 188812, 188813, 
+    188814, 188815, 188816, 188817, 188818, 188819, 188820, 188821, 188822, 
+    188823, 188824, 188825, 188826, 188827, 188828, 188829, 188830, 188831, 
+    188832, 188833, 188834, 188835, 188836, 188837, 188838, 188839, 188840, 
+    188841, 188842, 188843, 188844, 188845, 188846, 188847, 188848, 188849, 
+    188850, 188851, 188852, 188853, 188854, 188855, 188856, 188857, 188858, 
+    188859, 188860, 188861, 188862, 188863, 188864, 188865, 188866, 188867, 
+    188868, 188869, 188870, 188871, 188872, 188873, 188874, 188875, 188876, 
+    188877, 188878, 188879, 188880, 188881, 188882, 188883, 188884, 188885, 
+    188886, 188887, 188888, 188889, 188890, 188891, 188892, 188893, 188894, 
+    188895, 188896, 188897, 188898, 188899, 188900, 188901, 188902, 188903, 
+    188904, 188905, 188906, 188907, 188908, 188909, 188910, 188911, 188912, 
+    188913, 188914, 188915, 188916, 188917, 188918, 188919, 188920, 188921, 
+    188922, 188923, 188924, 188925, 188926, 188927, 188928, 188929, 188930, 
+    188931, 188932, 188933, 188934, 188935, 188936, 188937, 188938, 188939, 
+    188940, 188941, 188942, 188943, 188944, 188945, 188946, 188947, 188948, 
+    188949, 188950, 188951, 188952, 188953, 188954, 188955, 188956, 188957, 
+    188958, 188959, 188960, 188961, 188962, 188963, 188964, 188965, 188966, 
+    188967, 188968, 188969, 188970, 188971, 188972, 188973, 188974, 188975, 
+    188976, 188977, 188978, 188979, 188980, 188981, 188982, 188983, 188984, 
+    188985, 188986, 188987, 188988, 188989, 188990, 188991, 188992, 188993, 
+    188994, 188995, 188996, 188997, 188998, 188999, 189000, 189001, 189002, 
+    189003, 189004, 189005, 189006, 189007, 189008, 189009, 189010, 189011, 
+    189012, 189013, 189014, 189015, 189016, 189017, 189018, 189019, 189020, 
+    189021, 189022, 189023, 189024, 189025, 189026, 189027, 189028, 189029, 
+    189030, 189031, 189032, 189033, 189034, 189035, 189036, 189037, 189038, 
+    189039, 189040, 189041, 189042, 189043, 189044, 189045, 189046, 189047, 
+    189048, 189049, 189050, 189051, 189052, 189053, 189054, 189055, 189056, 
+    189057, 189058, 189059, 189060, 189061, 189062, 189063, 189064, 189065, 
+    189066, 189067, 189068, 189069, 189070, 189071, 189072, 189073, 189074, 
+    189075, 189076, 189077, 189078, 189079, 189080, 189081, 189082, 189083, 
+    189084, 189085, 189086, 189087, 189088, 189089, 189090, 189091, 189092, 
+    189093, 189094, 189095, 189096, 189097, 189098, 189099, 189100, 189101, 
+    189102, 189103, 189104, 189105, 189106, 189107, 189108, 189109, 189110, 
+    189111, 189112, 189113, 189114, 189115, 189116, 189117, 189118, 189119, 
+    189120, 189121, 189122, 189123, 189124, 189125, 189126, 189127, 189128, 
+    189129, 189130, 189131, 189132, 189133, 189134, 189135, 189136, 189137, 
+    189138, 189139, 189140, 189141, 189142, 189143, 189144, 189145, 189146, 
+    189147, 189148, 189149, 189150, 189151, 189152, 189153, 189154, 189155, 
+    189156, 189157, 189158, 189159, 189160, 189161, 189162, 189163, 189164, 
+    189165, 189166, 189167, 189168, 189169, 189170, 189171, 189172, 189173, 
+    189174, 189175, 189176, 189177, 189178, 189179, 189180, 189181, 189182, 
+    189183, 189184, 189185, 189186, 189187, 189188, 189189, 189190, 189191, 
+    189192, 189193, 189194, 189195, 189196, 189197, 189198, 189199, 189200, 
+    189201, 189202, 189203, 189204, 189205, 189206, 189207, 189208, 189209, 
+    189210, 189211, 189212, 189213, 189214, 189215, 189216, 189217, 189218, 
+    189219, 189220, 189221, 189222, 189223, 189224, 189225, 189226, 189227, 
+    189228, 189229, 189230, 189231, 189232, 189233, 189234, 189235, 189236, 
+    189237, 189238, 189239, 189240, 189241, 189242, 189243, 189244, 189245, 
+    189246, 189247, 189248, 189249, 189250, 189251, 189252, 189253, 189254, 
+    189255, 189256, 189257, 189258, 189259, 189260, 189261, 189262, 189263, 
+    189264, 189265, 189266, 189267, 189268, 189269, 189270, 189271, 189272, 
+    189273, 189274, 189275, 189276, 189277, 189278, 189279, 189280, 189281, 
+    189282, 189283, 189284, 189285, 189286, 189287, 189288, 189289, 189290, 
+    189291, 189292, 189293, 189294, 189295, 189296, 189297, 189298, 189299, 
+    189300, 189301, 189302, 189303, 189304, 189305, 189306, 189307, 189308, 
+    189309, 189310, 189311, 189312, 189313, 189314, 189315, 189316, 189317, 
+    189318, 189319, 189320, 189321, 189322, 189323, 189324, 189325, 189326, 
+    189327, 189328, 189329, 189330, 189331, 189332, 189333, 189334, 189335, 
+    189336, 189337, 189338, 189339, 189340, 189341, 189342, 189343, 189344, 
+    189345, 189346, 189347, 189348, 189349, 189350, 189351, 189352, 189353, 
+    189354, 189355, 189356, 189357, 189358, 189359, 189360, 189361, 189362, 
+    189363, 189364, 189365, 189366, 189367, 189368, 189369, 189370, 189371, 
+    189372, 189373, 189374, 189375, 189376, 189377, 189378, 189379, 189380, 
+    189381, 189382, 189383, 189384, 189385, 189386, 189387, 189388, 189389, 
+    189390, 189391, 189392, 189393, 189394, 189395, 189396, 189397, 189398, 
+    189399, 189400, 189401, 189402, 189403, 189404, 189405, 189406, 189407, 
+    189408, 189409, 189410, 189411, 189412, 189413, 189414, 189415, 189416, 
+    189417, 189418, 189419, 189420, 189421, 189422, 189423, 189424, 189425, 
+    189426, 189427, 189428, 189429, 189430, 189431, 189432, 189433, 189434, 
+    189435, 189436, 189437, 189438, 189439, 189440, 189441, 189442, 189443, 
+    189444, 189445, 189446, 189447, 189448, 189449, 189450, 189451, 189452, 
+    189453, 189454, 189455, 189456, 189457, 189458, 189459, 189460, 189461, 
+    189462, 189463, 189464, 189465, 189466, 189467, 189468, 189469, 189470, 
+    189471, 189472, 189473, 189474, 189475, 189476, 189477, 189478, 189479, 
+    189480, 189481, 189482, 189483, 189484, 189485, 189486, 189487, 189488, 
+    189489, 189490, 189491, 189492, 189493, 189494, 189495, 189496, 189497, 
+    189498, 189499, 189500, 189501, 189502, 189503, 189504, 189505, 189506, 
+    189507, 189508, 189509, 189510, 189511, 189512, 189513, 189514, 189515, 
+    189516, 189517, 189518, 189519, 189520, 189521, 189522, 189523, 189524, 
+    189525, 189526, 189527, 189528, 189529, 189530, 189531, 189532, 189533, 
+    189534, 189535, 189536, 189537, 189538, 189539, 189540, 189541, 189542, 
+    189543, 189544, 189545, 189546, 189547, 189548, 189549, 189550, 189551, 
+    189552, 189553, 189554, 189555, 189556, 189557, 189558, 189559, 189560, 
+    189561, 189562, 189563, 189564, 189565, 189566, 189567, 189568, 189569, 
+    189570, 189571, 189572, 189573, 189574, 189575, 189576, 189577, 189578, 
+    189579, 189580, 189581, 189582, 189583, 189584, 189585, 189586, 189587, 
+    189588, 189589, 189590, 189591, 189592, 189593, 189594, 189595, 189596, 
+    189597, 189598, 189599, 189600, 189601, 189602, 189603, 189604, 189605, 
+    189606, 189607, 189608, 189609, 189610, 189611, 189612, 189613, 189614, 
+    189615, 189616, 189617, 189618, 189619, 189620, 189621, 189622, 189623, 
+    189624, 189625, 189626, 189627, 189628, 189629, 189630, 189631, 189632, 
+    189633, 189634, 189635, 189636, 189637, 189638, 189639, 189640, 189641, 
+    189642, 189643, 189644, 189645, 189646, 189647, 189648, 189649, 189650, 
+    189651, 189652, 189653, 189654, 189655, 189656, 189657, 189658, 189659, 
+    189660, 189661, 189662, 189663, 189664, 189665, 189666, 189667, 189668, 
+    189669, 189670, 189671, 189672, 189673, 189674, 189675, 189676, 189677, 
+    189678, 189679, 189680, 189681, 189682, 189683, 189684, 189685, 189686, 
+    189687, 189688, 189689, 189690, 189691, 189692, 189693, 189694, 189695, 
+    189696, 189697, 189698, 189699, 189700, 189701, 189702, 189703, 189704, 
+    189705, 189706, 189707, 189708, 189709, 189710, 189711, 189712, 189713, 
+    189714, 189715, 189716, 189717, 189718, 189719, 189720, 189721, 189722, 
+    189723, 189724, 189725, 189726, 189727, 189728, 189729, 189730, 189731, 
+    189732, 189733, 189734, 189735, 189736, 189737, 189738, 189739, 189740, 
+    189741, 189742, 189743, 189744, 189745, 189746, 189747, 189748, 189749, 
+    189750, 189751, 189752, 189753, 189754, 189755, 189756, 189757, 189758, 
+    189759, 189760, 189761, 189762, 189763, 189764, 189765, 189766, 189767, 
+    189768, 189769, 189770, 189771, 189772, 189773, 189774, 189775, 189776, 
+    189777, 189778, 189779, 189780, 189781, 189782, 189783, 189784, 189785, 
+    189786, 189787, 189788, 189789, 189790, 189791, 189792, 189793, 189794, 
+    189795, 189796, 189797, 189798, 189799, 189800, 189801, 189802, 189803, 
+    189804, 189805, 189806, 189807, 189808, 189809, 189810, 189811, 189812, 
+    189813, 189814, 189815, 189816, 189817, 189818, 189819, 189820, 189821, 
+    189822, 189823, 189824, 189825, 189826, 189827, 189828, 189829, 189830, 
+    189831, 189832, 189833, 189834, 189835, 189836, 189837, 189838, 189839, 
+    189840, 189841, 189842, 189843, 189844, 189845, 189846, 189847, 189848, 
+    189849, 189850, 189851, 189852, 189853, 189854, 189855, 189856, 189857, 
+    189858, 189859, 189860, 189861, 189862, 189863, 189864, 189865, 189866, 
+    189867, 189868, 189869, 189870, 189871, 189872, 189873, 189874, 189875, 
+    189876, 189877, 189878, 189879, 189880, 189881, 189882, 189883, 189884, 
+    189885, 189886, 189887, 189888, 189889, 189890, 189891, 189892, 189893, 
+    189894, 189895, 189896, 189897, 189898, 189899, 189900, 189901, 189902, 
+    189903, 189904, 189905, 189906, 189907, 189908, 189909, 189910, 189911, 
+    189912, 189913, 189914, 189915, 189916, 189917, 189918, 189919, 189920, 
+    189921, 189922, 189923, 189924, 189925, 189926, 189927, 189928, 189929, 
+    189930, 189931, 189932, 189933, 189934, 189935, 189936, 189937, 189938, 
+    189939, 189940, 189941, 189942, 189943, 189944, 189945, 189946, 189947, 
+    189948, 189949, 189950, 189951, 189952, 189953, 189954, 189955, 189956, 
+    189957, 189958, 189959, 189960, 189961, 189962, 189963, 189964, 189965, 
+    189966, 189967, 189968, 189969, 189970, 189971, 189972, 189973, 189974, 
+    189975, 189976, 189977, 189978, 189979, 189980, 189981, 189982, 189983, 
+    189984, 189985, 189986, 189987, 189988, 189989, 189990, 189991, 189992, 
+    189993, 189994, 189995, 189996, 189997, 189998, 189999, 190000, 190001, 
+    190002, 190003, 190004, 190005, 190006, 190007, 190008, 190009, 190010, 
+    190011, 190012, 190013, 190014, 190015, 190016, 190017, 190018, 190019, 
+    190020, 190021, 190022, 190023, 190024, 190025, 190026, 190027, 190028, 
+    190029, 190030, 190031, 190032, 190033, 190034, 190035, 190036, 190037, 
+    190038, 190039, 190040, 190041, 190042, 190043, 190044, 190045, 190046, 
+    190047, 190048, 190049, 190050, 190051, 190052, 190053, 190054, 190055, 
+    190056, 190057, 190058, 190059, 190060, 190061, 190062, 190063, 190064, 
+    190065, 190066, 190067, 190068, 190069, 190070, 190071, 190072, 190073, 
+    190074, 190075, 190076, 190077, 190078, 190079, 190080, 190081, 190082, 
+    190083, 190084, 190085, 190086, 190087, 190088, 190089, 190090, 190091, 
+    190092, 190093, 190094, 190095, 190096, 190097, 190098, 190099, 190100, 
+    190101, 190102, 190103, 190104, 190105, 190106, 190107, 190108, 190109, 
+    190110, 190111, 190112, 190113, 190114, 190115, 190116, 190117, 190118, 
+    190119, 190120, 190121, 190122, 190123, 190124, 190125, 190126, 190127, 
+    190128, 190129, 190130, 190131, 190132, 190133, 190134, 190135, 190136, 
+    190137, 190138, 190139, 190140, 190141, 190142, 190143, 190144, 190145, 
+    190146, 190147, 190148, 190149, 190150, 190151, 190152, 190153, 190154, 
+    190155, 190156, 190157, 190158, 190159, 190160, 190161, 190162, 190163, 
+    190164, 190165, 190166, 190167, 190168, 190169, 190170, 190171, 190172, 
+    190173, 190174, 190175, 190176, 190177, 190178, 190179, 190180, 190181, 
+    190182, 190183, 190184, 190185, 190186, 190187, 190188, 190189, 190190, 
+    190191, 190192, 190193, 190194, 190195, 190196, 190197, 190198, 190199, 
+    190200, 190201, 190202, 190203, 190204, 190205, 190206, 190207, 190208, 
+    190209, 190210, 190211, 190212, 190213, 190214, 190215, 190216, 190217, 
+    190218, 190219, 190220, 190221, 190222, 190223, 190224, 190225, 190226, 
+    190227, 190228, 190229, 190230, 190231, 190232, 190233, 190234, 190235, 
+    190236, 190237, 190238, 190239, 190240, 190241, 190242, 190243, 190244, 
+    190245, 190246, 190247, 190248, 190249, 190250, 190251, 190252, 190253, 
+    190254, 190255, 190256, 190257, 190258, 190259, 190260, 190261, 190262, 
+    190263, 190264, 190265, 190266, 190267, 190268, 190269, 190270, 190271, 
+    190272, 190273, 190274, 190275, 190276, 190277, 190278, 190279, 190280, 
+    190281, 190282, 190283, 190284, 190285, 190286, 190287, 190288, 190289, 
+    190290, 190291, 190292, 190293, 190294, 190295, 190296, 190297, 190298, 
+    190299, 190300, 190301, 190302, 190303, 190304, 190305, 190306, 190307, 
+    190308, 190309, 190310, 190311, 190312, 190313, 190314, 190315, 190316, 
+    190317, 190318, 190319, 190320, 190321, 190322, 190323, 190324, 190325, 
+    190326, 190327, 190328, 190329, 190330, 190331, 190332, 190333, 190334, 
+    190335, 190336, 190337, 190338, 190339, 190340, 190341, 190342, 190343, 
+    190344, 190345, 190346, 190347, 190348, 190349, 190350, 190351, 190352, 
+    190353, 190354, 190355, 190356, 190357, 190358, 190359, 190360, 190361, 
+    190362, 190363, 190364, 190365, 190366, 190367, 190368, 190369, 190370, 
+    190371, 190372, 190373, 190374, 190375, 190376, 190377, 190378, 190379, 
+    190380, 190381, 190382, 190383, 190384, 190385, 190386, 190387, 190388, 
+    190389, 190390, 190391, 190392, 190393, 190394, 190395, 190396, 190397, 
+    190398, 190399, 190400, 190401, 190402, 190403, 190404, 190405, 190406, 
+    190407, 190408, 190409, 190410, 190411, 190412, 190413, 190414, 190415, 
+    190416, 190417, 190418, 190419, 190420, 190421, 190422, 190423, 190424, 
+    190425, 190426, 190427, 190428, 190429, 190430, 190431, 190432, 190433, 
+    190434, 190435, 190436, 190437, 190438, 190439, 190440, 190441, 190442, 
+    190443, 190444, 190445, 190446, 190447, 190448, 190449, 190450, 190451, 
+    190452, 190453, 190454, 190455, 190456, 190457, 190458, 190459, 190460, 
+    190461, 190462, 190463, 190464, 190465, 190466, 190467, 190468, 190469, 
+    190470, 190471, 190472, 190473, 190474, 190475, 190476, 190477, 190478, 
+    190479, 190480, 190481, 190482, 190483, 190484, 190485, 190486, 190487, 
+    190488, 190489, 190490, 190491, 190492, 190493, 190494, 190495, 190496, 
+    190497, 190498, 190499, 190500, 190501, 190502, 190503, 190504, 190505, 
+    190506, 190507, 190508, 190509, 190510, 190511, 190512, 190513, 190514, 
+    190515, 190516, 190517, 190518, 190519, 190520, 190521, 190522, 190523, 
+    190524, 190525, 190526, 190527, 190528, 190529, 190530, 190531, 190532, 
+    190533, 190534, 190535, 190536, 190537, 190538, 190539, 190540, 190541, 
+    190542, 190543, 190544, 190545, 190546, 190547, 190548, 190549, 190550, 
+    190551, 190552, 190553, 190554, 190555, 190556, 190557, 190558, 190559, 
+    190560, 190561, 190562, 190563, 190564, 190565, 190566, 190567, 190568, 
+    190569, 190570, 190571, 190572, 190573, 190574, 190575, 190576, 190577, 
+    190578, 190579, 190580, 190581, 190582, 190583, 190584, 190585, 190586, 
+    190587, 190588, 190589, 190590, 190591, 190592, 190593, 190594, 190595, 
+    190596, 190597, 190598, 190599, 190600, 190601, 190602, 190603, 190604, 
+    190605, 190606, 190607, 190608, 190609, 190610, 190611, 190612, 190613, 
+    190614, 190615, 190616, 190617, 190618, 190619, 190620, 190621, 190622, 
+    190623, 190624, 190625, 190626, 190627, 190628, 190629, 190630, 190631, 
+    190632, 190633, 190634, 190635, 190636, 190637, 190638, 190639, 190640, 
+    190641, 190642, 190643, 190644, 190645, 190646, 190647, 190648, 190649, 
+    190650, 190651, 190652, 190653, 190654, 190655, 190656, 190657, 190658, 
+    190659, 190660, 190661, 190662, 190663, 190664, 190665, 190666, 190667, 
+    190668, 190669, 190670, 190671, 190672, 190673, 190674, 190675, 190676, 
+    190677, 190678, 190679, 190680, 190681, 190682, 190683, 190684, 190685, 
+    190686, 190687, 190688, 190689, 190690, 190691, 190692, 190693, 190694, 
+    190695, 190696, 190697, 190698, 190699, 190700, 190701, 190702, 190703, 
+    190704, 190705, 190706, 190707, 190708, 190709, 190710, 190711, 190712, 
+    190713, 190714, 190715, 190716, 190717, 190718, 190719, 190720, 190721, 
+    190722, 190723, 190724, 190725, 190726, 190727, 190728, 190729, 190730, 
+    190731, 190732, 190733, 190734, 190735, 190736, 190737, 190738, 190739, 
+    190740, 190741, 190742, 190743, 190744, 190745, 190746, 190747, 190748, 
+    190749, 190750, 190751, 190752, 190753, 190754, 190755, 190756, 190757, 
+    190758, 190759, 190760, 190761, 190762, 190763, 190764, 190765, 190766, 
+    190767, 190768, 190769, 190770, 190771, 190772, 190773, 190774, 190775, 
+    190776, 190777, 190778, 190779, 190780, 190781, 190782, 190783, 190784, 
+    190785, 190786, 190787, 190788, 190789, 190790, 190791, 190792, 190793, 
+    190794, 190795, 190796, 190797, 190798, 190799, 190800, 190801, 190802, 
+    190803, 190804, 190805, 190806, 190807, 190808, 190809, 190810, 190811, 
+    190812, 190813, 190814, 190815, 190816, 190817, 190818, 190819, 190820, 
+    190821, 190822, 190823, 190824, 190825, 190826, 190827, 190828, 190829, 
+    190830, 190831, 190832, 190833, 190834, 190835, 190836, 190837, 190838, 
+    190839, 190840, 190841, 190842, 190843, 190844, 190845, 190846, 190847, 
+    190848, 190849, 190850, 190851, 190852, 190853, 190854, 190855, 190856, 
+    190857, 190858, 190859, 190860, 190861, 190862, 190863, 190864, 190865, 
+    190866, 190867, 190868, 190869, 190870, 190871, 190872, 190873, 190874, 
+    190875, 190876, 190877, 190878, 190879, 190880, 190881, 190882, 190883, 
+    190884, 190885, 190886, 190887, 190888, 190889, 190890, 190891, 190892, 
+    190893, 190894, 190895, 190896, 190897, 190898, 190899, 190900, 190901, 
+    190902, 190903, 190904, 190905, 190906, 190907, 190908, 190909, 190910, 
+    190911, 190912, 190913, 190914, 190915, 190916, 190917, 190918, 190919, 
+    190920, 190921, 190922, 190923, 190924, 190925, 190926, 190927, 190928, 
+    190929, 190930, 190931, 190932, 190933, 190934, 190935, 190936, 190937, 
+    190938, 190939, 190940, 190941, 190942, 190943, 190944, 190945, 190946, 
+    190947, 190948, 190949, 190950, 190951, 190952, 190953, 190954, 190955, 
+    190956, 190957, 190958, 190959, 190960, 190961, 190962, 190963, 190964, 
+    190965, 190966, 190967, 190968, 190969, 190970, 190971, 190972, 190973, 
+    190974, 190975, 190976, 190977, 190978, 190979, 190980, 190981, 190982, 
+    190983, 190984, 190985, 190986, 190987, 190988, 190989, 190990, 190991, 
+    190992, 190993, 190994, 190995, 190996, 190997, 190998, 190999, 191000, 
+    191001, 191002, 191003, 191004, 191005, 191006, 191007, 191008, 191009, 
+    191010, 191011, 191012, 191013, 191014, 191015, 191016, 191017, 191018, 
+    191019, 191020, 191021, 191022, 191023, 191024, 191025, 191026, 191027, 
+    191028, 191029, 191030, 191031, 191032, 191033, 191034, 191035, 191036, 
+    191037, 191038, 191039, 191040, 191041, 191042, 191043, 191044, 191045, 
+    191046, 191047, 191048, 191049, 191050, 191051, 191052, 191053, 191054, 
+    191055, 191056, 191057, 191058, 191059, 191060, 191061, 191062, 191063, 
+    191064, 191065, 191066, 191067, 191068, 191069, 191070, 191071, 191072, 
+    191073, 191074, 191075, 191076, 191077, 191078, 191079, 191080, 191081, 
+    191082, 191083, 191084, 191085, 191086, 191087, 191088, 191089, 191090, 
+    191091, 191092, 191093, 191094, 191095, 191096, 191097, 191098, 191099, 
+    191100, 191101, 191102, 191103, 191104, 191105, 191106, 191107, 191108, 
+    191109, 191110, 191111, 191112, 191113, 191114, 191115, 191116, 191117, 
+    191118, 191119, 191120, 191121, 191122, 191123, 191124, 191125, 191126, 
+    191127, 191128, 191129, 191130, 191131, 191132, 191133, 191134, 191135, 
+    191136, 191137, 191138, 191139, 191140, 191141, 191142, 191143, 191144, 
+    191145, 191146, 191147, 191148, 191149, 191150, 191151, 191152, 191153, 
+    191154, 191155, 191156, 191157, 191158, 191159, 191160, 191161, 191162, 
+    191163, 191164, 191165, 191166, 191167, 191168, 191169, 191170, 191171, 
+    191172, 191173, 191174, 191175, 191176, 191177, 191178, 191179, 191180, 
+    191181, 191182, 191183, 191184, 191185, 191186, 191187, 191188, 191189, 
+    191190, 191191, 191192, 191193, 191194, 191195, 191196, 191197, 191198, 
+    191199, 191200, 191201, 191202, 191203, 191204, 191205, 191206, 191207, 
+    191208, 191209, 191210, 191211, 191212, 191213, 191214, 191215, 191216, 
+    191217, 191218, 191219, 191220, 191221, 191222, 191223, 191224, 191225, 
+    191226, 191227, 191228, 191229, 191230, 191231, 191232, 191233, 191234, 
+    191235, 191236, 191237, 191238, 191239, 191240, 191241, 191242, 191243, 
+    191244, 191245, 191246, 191247, 191248, 191249, 191250, 191251, 191252, 
+    191253, 191254, 191255, 191256, 191257, 191258, 191259, 191260, 191261, 
+    191262, 191263, 191264, 191265, 191266, 191267, 191268, 191269, 191270, 
+    191271, 191272, 191273, 191274, 191275, 191276, 191277, 191278, 191279, 
+    191280, 191281, 191282, 191283, 191284, 191285, 191286, 191287, 191288, 
+    191289, 191290, 191291, 191292, 191293, 191294, 191295, 191296, 191297, 
+    191298, 191299, 191300, 191301, 191302, 191303, 191304, 191305, 191306, 
+    191307, 191308, 191309, 191310, 191311, 191312, 191313, 191314, 191315, 
+    191316, 191317, 191318, 191319, 191320, 191321, 191322, 191323, 191324, 
+    191325, 191326, 191327, 191328, 191329, 191330, 191331, 191332, 191333, 
+    191334, 191335, 191336, 191337, 191338, 191339, 191340, 191341, 191342, 
+    191343, 191344, 191345, 191346, 191347, 191348, 191349, 191350, 191351, 
+    191352, 191353, 191354, 191355, 191356, 191357, 191358, 191359, 191360, 
+    191361, 191362, 191363, 191364, 191365, 191366, 191367, 191368, 191369, 
+    191370, 191371, 191372, 191373, 191374, 191375, 191376, 191377, 191378, 
+    191379, 191380, 191381, 191382, 191383, 191384, 191385, 191386, 191387, 
+    191388, 191389, 191390, 191391, 191392, 191393, 191394, 191395, 191396, 
+    191397, 191398, 191399, 191400, 191401, 191402, 191403, 191404, 191405, 
+    191406, 191407, 191408, 191409, 191410, 191411, 191412, 191413, 191414, 
+    191415, 191416, 191417, 191418, 191419, 191420, 191421, 191422, 191423, 
+    191424, 191425, 191426, 191427, 191428, 191429, 191430, 191431, 191432, 
+    191433, 191434, 191435, 191436, 191437, 191438, 191439, 191440, 191441, 
+    191442, 191443, 191444, 191445, 191446, 191447, 191448, 191449, 191450, 
+    191451, 191452, 191453, 191454, 191455, 191456, 191457, 191458, 191459, 
+    191460, 191461, 191462, 191463, 191464, 191465, 191466, 191467, 191468, 
+    191469, 191470, 191471, 191472, 191473, 191474, 191475, 191476, 191477, 
+    191478, 191479, 191480, 191481, 191482, 191483, 191484, 191485, 191486, 
+    191487, 191488, 191489, 191490, 191491, 191492, 191493, 191494, 191495, 
+    191496, 191497, 191498, 191499, 191500, 191501, 191502, 191503, 191504, 
+    191505, 191506, 191507, 191508, 191509, 191510, 191511, 191512, 191513, 
+    191514, 191515, 191516, 191517, 191518, 191519, 191520, 191521, 191522, 
+    191523, 191524, 191525, 191526, 191527, 191528, 191529, 191530, 191531, 
+    191532, 191533, 191534, 191535, 191536, 191537, 191538, 191539, 191540, 
+    191541, 191542, 191543, 191544, 191545, 191546, 191547, 191548, 191549, 
+    191550, 191551, 191552, 191553, 191554, 191555, 191556, 191557, 191558, 
+    191559, 191560, 191561, 191562, 191563, 191564, 191565, 191566, 191567, 
+    191568, 191569, 191570, 191571, 191572, 191573, 191574, 191575, 191576, 
+    191577, 191578, 191579, 191580, 191581, 191582, 191583, 191584, 191585, 
+    191586, 191587, 191588, 191589, 191590, 191591, 191592, 191593, 191594, 
+    191595, 191596, 191597, 191598, 191599, 191600, 191601, 191602, 191603, 
+    191604, 191605, 191606, 191607, 191608, 191609, 191610, 191611, 191612, 
+    191613, 191614, 191615, 191616, 191617, 191618, 191619, 191620, 191621, 
+    191622, 191623, 191624, 191625, 191626, 191627, 191628, 191629, 191630, 
+    191631, 191632, 191633, 191634, 191635, 191636, 191637, 191638, 191639, 
+    191640, 191641, 191642, 191643, 191644, 191645, 191646, 191647, 191648, 
+    191649, 191650, 191651, 191652, 191653, 191654, 191655, 191656, 191657, 
+    191658, 191659, 191660, 191661, 191662, 191663, 191664, 191665, 191666, 
+    191667, 191668, 191669, 191670, 191671, 191672, 191673, 191674, 191675, 
+    191676, 191677, 191678, 191679, 191680, 191681, 191682, 191683, 191684, 
+    191685, 191686, 191687, 191688, 191689, 191690, 191691, 191692, 191693, 
+    191694, 191695, 191696, 191697, 191698, 191699, 191700, 191701, 191702, 
+    191703, 191704, 191705, 191706, 191707, 191708, 191709, 191710, 191711, 
+    191712, 191713, 191714, 191715, 191716, 191717, 191718, 191719, 191720, 
+    191721, 191722, 191723, 191724, 191725, 191726, 191727, 191728, 191729, 
+    191730, 191731, 191732, 191733, 191734, 191735, 191736, 191737, 191738, 
+    191739, 191740, 191741, 191742, 191743, 191744, 191745, 191746, 191747, 
+    191748, 191749, 191750, 191751, 191752, 191753, 191754, 191755, 191756, 
+    191757, 191758, 191759, 191760, 191761, 191762, 191763, 191764, 191765, 
+    191766, 191767, 191768, 191769, 191770, 191771, 191772, 191773, 191774, 
+    191775, 191776, 191777, 191778, 191779, 191780, 191781, 191782, 191783, 
+    191784, 191785, 191786, 191787, 191788, 191789, 191790, 191791, 191792, 
+    191793, 191794, 191795, 191796, 191797, 191798, 191799, 191800, 191801, 
+    191802, 191803, 191804, 191805, 191806, 191807, 191808, 191809, 191810, 
+    191811, 191812, 191813, 191814, 191815, 191816, 191817, 191818, 191819, 
+    191820, 191821, 191822, 191823, 191824, 191825, 191826, 191827, 191828, 
+    191829, 191830, 191831, 191832, 191833, 191834, 191835, 191836, 191837, 
+    191838, 191839, 191840, 191841, 191842, 191843, 191844, 191845, 191846, 
+    191847, 191848, 191849, 191850, 191851, 191852, 191853, 191854, 191855, 
+    191856, 191857, 191858, 191859, 191860, 191861, 191862, 191863, 191864, 
+    191865, 191866, 191867, 191868, 191869, 191870, 191871, 191872, 191873, 
+    191874, 191875, 191876, 191877, 191878, 191879, 191880, 191881, 191882, 
+    191883, 191884, 191885, 191886, 191887, 191888, 191889, 191890, 191891, 
+    191892, 191893, 191894, 191895, 191896, 191897, 191898, 191899, 191900, 
+    191901, 191902, 191903, 191904, 191905, 191906, 191907, 191908, 191909, 
+    191910, 191911, 191912, 191913, 191914, 191915, 191916, 191917, 191918, 
+    191919, 191920, 191921, 191922, 191923, 191924, 191925, 191926, 191927, 
+    191928, 191929, 191930, 191931, 191932, 191933, 191934, 191935, 191936, 
+    191937, 191938, 191939, 191940, 191941, 191942, 191943, 191944, 191945, 
+    191946, 191947, 191948, 191949, 191950, 191951, 191952, 191953, 191954, 
+    191955, 191956, 191957, 191958, 191959, 191960, 191961, 191962, 191963, 
+    191964, 191965, 191966, 191967, 191968, 191969, 191970, 191971, 191972, 
+    191973, 191974, 191975, 191976, 191977, 191978, 191979, 191980, 191981, 
+    191982, 191983, 191984, 191985, 191986, 191987, 191988, 191989, 191990, 
+    191991, 191992, 191993, 191994, 191995, 191996, 191997, 191998, 191999, 
+    192000, 192001, 192002, 192003, 192004, 192005, 192006, 192007, 192008, 
+    192009, 192010, 192011, 192012, 192013, 192014, 192015, 192016, 192017, 
+    192018, 192019, 192020, 192021, 192022, 192023, 192024, 192025, 192026, 
+    192027, 192028, 192029, 192030, 192031, 192032, 192033, 192034, 192035, 
+    192036, 192037, 192038, 192039, 192040, 192041, 192042, 192043, 192044, 
+    192045, 192046, 192047, 192048, 192049, 192050, 192051, 192052, 192053, 
+    192054, 192055, 192056, 192057, 192058, 192059, 192060, 192061, 192062, 
+    192063, 192064, 192065, 192066, 192067, 192068, 192069, 192070, 192071, 
+    192072, 192073, 192074, 192075, 192076, 192077, 192078, 192079, 192080, 
+    192081, 192082, 192083, 192084, 192085, 192086, 192087, 192088, 192089, 
+    192090, 192091, 192092, 192093, 192094, 192095, 192096, 192097, 192098, 
+    192099, 192100, 192101, 192102, 192103, 192104, 192105, 192106, 192107, 
+    192108, 192109, 192110, 192111, 192112, 192113, 192114, 192115, 192116, 
+    192117, 192118, 192119, 192120, 192121, 192122, 192123, 192124, 192125, 
+    192126, 192127, 192128, 192129, 192130, 192131, 192132, 192133, 192134, 
+    192135, 192136, 192137, 192138, 192139, 192140, 192141, 192142, 192143, 
+    192144, 192145, 192146, 192147, 192148, 192149, 192150, 192151, 192152, 
+    192153, 192154, 192155, 192156, 192157, 192158, 192159, 192160, 192161, 
+    192162, 192163, 192164, 192165, 192166, 192167, 192168, 192169, 192170, 
+    192171, 192172, 192173, 192174, 192175, 192176, 192177, 192178, 192179, 
+    192180, 192181, 192182, 192183, 192184, 192185, 192186, 192187, 192188, 
+    192189, 192190, 192191, 192192, 192193, 192194, 192195, 192196, 192197, 
+    192198, 192199, 192200, 192201, 192202, 192203, 192204, 192205, 192206, 
+    192207, 192208, 192209, 192210, 192211, 192212, 192213, 192214, 192215, 
+    192216, 192217, 192218, 192219, 192220, 192221, 192222, 192223, 192224, 
+    192225, 192226, 192227, 192228, 192229, 192230, 192231, 192232, 192233, 
+    192234, 192235, 192236, 192237, 192238, 192239, 192240, 192241, 192242, 
+    192243, 192244, 192245, 192246, 192247, 192248, 192249, 192250, 192251, 
+    192252, 192253, 192254, 192255, 192256, 192257, 192258, 192259, 192260, 
+    192261, 192262, 192263, 192264, 192265, 192266, 192267, 192268, 192269, 
+    192270, 192271, 192272, 192273, 192274, 192275, 192276, 192277, 192278, 
+    192279, 192280, 192281, 192282, 192283, 192284, 192285, 192286, 192287, 
+    192288, 192289, 192290, 192291, 192292, 192293, 192294, 192295, 192296, 
+    192297, 192298, 192299, 192300, 192301, 192302, 192303, 192304, 192305, 
+    192306, 192307, 192308, 192309, 192310, 192311, 192312, 192313, 192314, 
+    192315, 192316, 192317, 192318, 192319, 192320, 192321, 192322, 192323, 
+    192324, 192325, 192326, 192327, 192328, 192329, 192330, 192331, 192332, 
+    192333, 192334, 192335, 192336, 192337, 192338, 192339, 192340, 192341, 
+    192342, 192343, 192344, 192345, 192346, 192347, 192348, 192349, 192350, 
+    192351, 192352, 192353, 192354, 192355, 192356, 192357, 192358, 192359, 
+    192360, 192361, 192362, 192363, 192364, 192365, 192366, 192367, 192368, 
+    192369, 192370, 192371, 192372, 192373, 192374, 192375, 192376, 192377, 
+    192378, 192379, 192380, 192381, 192382, 192383, 192384, 192385, 192386, 
+    192387, 192388, 192389, 192390, 192391, 192392, 192393, 192394, 192395, 
+    192396, 192397, 192398, 192399, 192400, 192401, 192402, 192403, 192404, 
+    192405, 192406, 192407, 192408, 192409, 192410, 192411, 192412, 192413, 
+    192414, 192415, 192416, 192417, 192418, 192419, 192420, 192421, 192422, 
+    192423, 192424, 192425, 192426, 192427, 192428, 192429, 192430, 192431, 
+    192432, 192433, 192434, 192435, 192436, 192437, 192438, 192439, 192440, 
+    192441, 192442, 192443, 192444, 192445, 192446, 192447, 192448, 192449, 
+    192450, 192451, 192452, 192453, 192454, 192455, 192456, 192457, 192458, 
+    192459, 192460, 192461, 192462, 192463, 192464, 192465, 192466, 192467, 
+    192468, 192469, 192470, 192471, 192472, 192473, 192474, 192475, 192476, 
+    192477, 192478, 192479, 192480, 192481, 192482, 192483, 192484, 192485, 
+    192486, 192487, 192488, 192489, 192490, 192491, 192492, 192493, 192494, 
+    192495, 192496, 192497, 192498, 192499, 192500, 192501, 192502, 192503, 
+    192504, 192505, 192506, 192507, 192508, 192509, 192510, 192511, 192512, 
+    192513, 192514, 192515, 192516, 192517, 192518, 192519, 192520, 192521, 
+    192522, 192523, 192524, 192525, 192526, 192527, 192528, 192529, 192530, 
+    192531, 192532, 192533, 192534, 192535, 192536, 192537, 192538, 192539, 
+    192540, 192541, 192542, 192543, 192544, 192545, 192546, 192547, 192548, 
+    192549, 192550, 192551, 192552, 192553, 192554, 192555, 192556, 192557, 
+    192558, 192559, 192560, 192561, 192562, 192563, 192564, 192565, 192566, 
+    192567, 192568, 192569, 192570, 192571, 192572, 192573, 192574, 192575, 
+    192576, 192577, 192578, 192579, 192580, 192581, 192582, 192583, 192584, 
+    192585, 192586, 192587, 192588, 192589, 192590, 192591, 192592, 192593, 
+    192594, 192595, 192596, 192597, 192598, 192599, 192600, 192601, 192602, 
+    192603, 192604, 192605, 192606, 192607, 192608, 192609, 192610, 192611, 
+    192612, 192613, 192614, 192615, 192616, 192617, 192618, 192619, 192620, 
+    192621, 192622, 192623, 192624, 192625, 192626, 192627, 192628, 192629, 
+    192630, 192631, 192632, 192633, 192634, 192635, 192636, 192637, 192638, 
+    192639, 192640, 192641, 192642, 192643, 192644, 192645, 192646, 192647, 
+    192648, 192649, 192650, 192651, 192652, 192653, 192654, 192655, 192656, 
+    192657, 192658, 192659, 192660, 192661, 192662, 192663, 192664, 192665, 
+    192666, 192667, 192668, 192669, 192670, 192671, 192672, 192673, 192674, 
+    192675, 192676, 192677, 192678, 192679, 192680, 192681, 192682, 192683, 
+    192684, 192685, 192686, 192687, 192688, 192689, 192690, 192691, 192692, 
+    192693, 192694, 192695, 192696, 192697, 192698, 192699, 192700, 192701, 
+    192702, 192703, 192704, 192705, 192706, 192707, 192708, 192709, 192710, 
+    192711, 192712, 192713, 192714, 192715, 192716, 192717, 192718, 192719, 
+    192720, 192721, 192722, 192723, 192724, 192725, 192726, 192727, 192728, 
+    192729, 192730, 192731, 192732, 192733, 192734, 192735, 192736, 192737, 
+    192738, 192739, 192740, 192741, 192742, 192743, 192744, 192745, 192746, 
+    192747, 192748, 192749, 192750, 192751, 192752, 192753, 192754, 192755, 
+    192756, 192757, 192758, 192759, 192760, 192761, 192762, 192763, 192764, 
+    192765, 192766, 192767, 192768, 192769, 192770, 192771, 192772, 192773, 
+    192774, 192775, 192776, 192777, 192778, 192779, 192780, 192781, 192782, 
+    192783, 192784, 192785, 192786, 192787, 192788, 192789, 192790, 192791, 
+    192792, 192793, 192794, 192795, 192796, 192797, 192798, 192799, 192800, 
+    192801, 192802, 192803, 192804, 192805, 192806, 192807, 192808, 192809, 
+    192810, 192811, 192812, 192813, 192814, 192815, 192816, 192817, 192818, 
+    192819, 192820, 192821, 192822, 192823, 192824, 192825, 192826, 192827, 
+    192828, 192829, 192830, 192831, 192832, 192833, 192834, 192835, 192836, 
+    192837, 192838, 192839, 192840, 192841, 192842, 192843, 192844, 192845, 
+    192846, 192847, 192848, 192849, 192850, 192851, 192852, 192853, 192854, 
+    192855, 192856, 192857, 192858, 192859, 192860, 192861, 192862, 192863, 
+    192864, 192865, 192866, 192867, 192868, 192869, 192870, 192871, 192872, 
+    192873, 192874, 192875, 192876, 192877, 192878, 192879, 192880, 192881, 
+    192882, 192883, 192884, 192885, 192886, 192887, 192888, 192889, 192890, 
+    192891, 192892, 192893, 192894, 192895, 192896, 192897, 192898, 192899, 
+    192900, 192901, 192902, 192903, 192904, 192905, 192906, 192907, 192908, 
+    192909, 192910, 192911, 192912, 192913, 192914, 192915, 192916, 192917, 
+    192918, 192919, 192920, 192921, 192922, 192923, 192924, 192925, 192926, 
+    192927, 192928, 192929, 192930, 192931, 192932, 192933, 192934, 192935, 
+    192936, 192937, 192938, 192939, 192940, 192941, 192942, 192943, 192944, 
+    192945, 192946, 192947, 192948, 192949, 192950, 192951, 192952, 192953, 
+    192954, 192955, 192956, 192957, 192958, 192959, 192960, 192961, 192962, 
+    192963, 192964, 192965, 192966, 192967, 192968, 192969, 192970, 192971, 
+    192972, 192973, 192974, 192975, 192976, 192977, 192978, 192979, 192980, 
+    192981, 192982, 192983, 192984, 192985, 192986, 192987, 192988, 192989, 
+    192990, 192991, 192992, 192993, 192994, 192995, 192996, 192997, 192998, 
+    192999, 193000, 193001, 193002, 193003, 193004, 193005, 193006, 193007, 
+    193008, 193009, 193010, 193011, 193012, 193013, 193014, 193015, 193016, 
+    193017, 193018, 193019, 193020, 193021, 193022, 193023, 193024, 193025, 
+    193026, 193027, 193028, 193029, 193030, 193031, 193032, 193033, 193034, 
+    193035, 193036, 193037, 193038, 193039, 193040, 193041, 193042, 193043, 
+    193044, 193045, 193046, 193047, 193048, 193049, 193050, 193051, 193052, 
+    193053, 193054, 193055, 193056, 193057, 193058, 193059, 193060, 193061, 
+    193062, 193063, 193064, 193065, 193066, 193067, 193068, 193069, 193070, 
+    193071, 193072, 193073, 193074, 193075, 193076, 193077, 193078, 193079, 
+    193080, 193081, 193082, 193083, 193084, 193085, 193086, 193087, 193088, 
+    193089, 193090, 193091, 193092, 193093, 193094, 193095, 193096, 193097, 
+    193098, 193099, 193100, 193101, 193102, 193103, 193104, 193105, 193106, 
+    193107, 193108, 193109, 193110, 193111, 193112, 193113, 193114, 193115, 
+    193116, 193117, 193118, 193119, 193120, 193121, 193122, 193123, 193124, 
+    193125, 193126, 193127, 193128, 193129, 193130, 193131, 193132, 193133, 
+    193134, 193135, 193136, 193137, 193138, 193139, 193140, 193141, 193142, 
+    193143, 193144, 193145, 193146, 193147, 193148, 193149, 193150, 193151, 
+    193152, 193153, 193154, 193155, 193156, 193157, 193158, 193159, 193160, 
+    193161, 193162, 193163, 193164, 193165, 193166, 193167, 193168, 193169, 
+    193170, 193171, 193172, 193173, 193174, 193175, 193176, 193177, 193178, 
+    193179, 193180, 193181, 193182, 193183, 193184, 193185, 193186, 193187, 
+    193188, 193189, 193190, 193191, 193192, 193193, 193194, 193195, 193196, 
+    193197, 193198, 193199, 193200, 193201, 193202, 193203, 193204, 193205, 
+    193206, 193207, 193208, 193209, 193210, 193211, 193212, 193213, 193214, 
+    193215, 193216, 193217, 193218, 193219, 193220, 193221, 193222, 193223, 
+    193224, 193225, 193226, 193227, 193228, 193229, 193230, 193231, 193232, 
+    193233, 193234, 193235, 193236, 193237, 193238, 193239, 193240, 193241, 
+    193242, 193243, 193244, 193245, 193246, 193247, 193248, 193249, 193250, 
+    193251, 193252, 193253, 193254, 193255, 193256, 193257, 193258, 193259, 
+    193260, 193261, 193262, 193263, 193264, 193265, 193266, 193267, 193268, 
+    193269, 193270, 193271, 193272, 193273, 193274, 193275, 193276, 193277, 
+    193278, 193279, 193280, 193281, 193282, 193283, 193284, 193285, 193286, 
+    193287, 193288, 193289, 193290, 193291, 193292, 193293, 193294, 193295, 
+    193296, 193297, 193298, 193299, 193300, 193301, 193302, 193303, 193304, 
+    193305, 193306, 193307, 193308, 193309, 193310, 193311, 193312, 193313, 
+    193314, 193315, 193316, 193317, 193318, 193319, 193320, 193321, 193322, 
+    193323, 193324, 193325, 193326, 193327, 193328, 193329, 193330, 193331, 
+    193332, 193333, 193334, 193335, 193336, 193337, 193338, 193339, 193340, 
+    193341, 193342, 193343, 193344, 193345, 193346, 193347, 193348, 193349, 
+    193350, 193351, 193352, 193353, 193354, 193355, 193356, 193357, 193358, 
+    193359, 193360, 193361, 193362, 193363, 193364, 193365, 193366, 193367, 
+    193368, 193369, 193370, 193371, 193372, 193373, 193374, 193375, 193376, 
+    193377, 193378, 193379, 193380, 193381, 193382, 193383, 193384, 193385, 
+    193386, 193387, 193388, 193389, 193390, 193391, 193392, 193393, 193394, 
+    193395, 193396, 193397, 193398, 193399, 193400, 193401, 193402, 193403, 
+    193404, 193405, 193406, 193407, 193408, 193409, 193410, 193411, 193412, 
+    193413, 193414, 193415, 193416, 193417, 193418, 193419, 193420, 193421, 
+    193422, 193423, 193424, 193425, 193426, 193427, 193428, 193429, 193430, 
+    193431, 193432, 193433, 193434, 193435, 193436, 193437, 193438, 193439, 
+    193440, 193441, 193442, 193443, 193444, 193445, 193446, 193447, 193448, 
+    193449, 193450, 193451, 193452, 193453, 193454, 193455, 193456, 193457, 
+    193458, 193459, 193460, 193461, 193462, 193463, 193464, 193465, 193466, 
+    193467, 193468, 193469, 193470, 193471, 193472, 193473, 193474, 193475, 
+    193476, 193477, 193478, 193479, 193480, 193481, 193482, 193483, 193484, 
+    193485, 193486, 193487, 193488, 193489, 193490, 193491, 193492, 193493, 
+    193494, 193495, 193496, 193497, 193498, 193499, 193500, 193501, 193502, 
+    193503, 193504, 193505, 193506, 193507, 193508, 193509, 193510, 193511, 
+    193512, 193513, 193514, 193515, 193516, 193517, 193518, 193519, 193520, 
+    193521, 193522, 193523, 193524, 193525, 193526, 193527, 193528, 193529, 
+    193530, 193531, 193532, 193533, 193534, 193535, 193536, 193537, 193538, 
+    193539, 193540, 193541, 193542, 193543, 193544, 193545, 193546, 193547, 
+    193548, 193549, 193550, 193551, 193552, 193553, 193554, 193555, 193556, 
+    193557, 193558, 193559, 193560, 193561, 193562, 193563, 193564, 193565, 
+    193566, 193567, 193568, 193569, 193570, 193571, 193572, 193573, 193574, 
+    193575, 193576, 193577, 193578, 193579, 193580, 193581, 193582, 193583, 
+    193584, 193585, 193586, 193587, 193588, 193589, 193590, 193591, 193592, 
+    193593, 193594, 193595, 193596, 193597, 193598, 193599, 193600, 193601, 
+    193602, 193603, 193604, 193605, 193606, 193607, 193608, 193609, 193610, 
+    193611, 193612, 193613, 193614, 193615, 193616, 193617, 193618, 193619, 
+    193620, 193621, 193622, 193623, 193624, 193625, 193626, 193627, 193628, 
+    193629, 193630, 193631, 193632, 193633, 193634, 193635, 193636, 193637, 
+    193638, 193639, 193640, 193641, 193642, 193643, 193644, 193645, 193646, 
+    193647, 193648, 193649, 193650, 193651, 193652, 193653, 193654, 193655, 
+    193656, 193657, 193658, 193659, 193660, 193661, 193662, 193663, 193664, 
+    193665, 193666, 193667, 193668, 193669, 193670, 193671, 193672, 193673, 
+    193674, 193675, 193676, 193677, 193678, 193679, 193680, 193681, 193682, 
+    193683, 193684, 193685, 193686, 193687, 193688, 193689, 193690, 193691, 
+    193692, 193693, 193694, 193695, 193696, 193697, 193698, 193699, 193700, 
+    193701, 193702, 193703, 193704, 193705, 193706, 193707, 193708, 193709, 
+    193710, 193711, 193712, 193713, 193714, 193715, 193716, 193717, 193718, 
+    193719, 193720, 193721, 193722, 193723, 193724, 193725, 193726, 193727, 
+    193728, 193729, 193730, 193731, 193732, 193733, 193734, 193735, 193736, 
+    193737, 193738, 193739, 193740, 193741, 193742, 193743, 193744, 193745, 
+    193746, 193747, 193748, 193749, 193750, 193751, 193752, 193753, 193754, 
+    193755, 193756, 193757, 193758, 193759, 193760, 193761, 193762, 193763, 
+    193764, 193765, 193766, 193767, 193768, 193769, 193770, 193771, 193772, 
+    193773, 193774, 193775, 193776, 193777, 193778, 193779, 193780, 193781, 
+    193782, 193783, 193784, 193785, 193786, 193787, 193788, 193789, 193790, 
+    193791, 193792, 193793, 193794, 193795, 193796, 193797, 193798, 193799, 
+    193800, 193801, 193802, 193803, 193804, 193805, 193806, 193807, 193808, 
+    193809, 193810, 193811, 193812, 193813, 193814, 193815, 193816, 193817, 
+    193818, 193819, 193820, 193821, 193822, 193823, 193824, 193825, 193826, 
+    193827, 193828, 193829, 193830, 193831, 193832, 193833, 193834, 193835, 
+    193836, 193837, 193838, 193839, 193840, 193841, 193842, 193843, 193844, 
+    193845, 193846, 193847, 193848, 193849, 193850, 193851, 193852, 193853, 
+    193854, 193855, 193856, 193857, 193858, 193859, 193860, 193861, 193862, 
+    193863, 193864, 193865, 193866, 193867, 193868, 193869, 193870, 193871, 
+    193872, 193873, 193874, 193875, 193876, 193877, 193878, 193879, 193880, 
+    193881, 193882, 193883, 193884, 193885, 193886, 193887, 193888, 193889, 
+    193890, 193891, 193892, 193893, 193894, 193895, 193896, 193897, 193898, 
+    193899, 193900, 193901, 193902, 193903, 193904, 193905, 193906, 193907, 
+    193908, 193909, 193910, 193911, 193912, 193913, 193914, 193915, 193916, 
+    193917, 193918, 193919, 193920, 193921, 193922, 193923, 193924, 193925, 
+    193926, 193927, 193928, 193929, 193930, 193931, 193932, 193933, 193934, 
+    193935, 193936, 193937, 193938, 193939, 193940, 193941, 193942, 193943, 
+    193944, 193945, 193946, 193947, 193948, 193949, 193950, 193951, 193952, 
+    193953, 193954, 193955, 193956, 193957, 193958, 193959, 193960, 193961, 
+    193962, 193963, 193964, 193965, 193966, 193967, 193968, 193969, 193970, 
+    193971, 193972, 193973, 193974, 193975, 193976, 193977, 193978, 193979, 
+    193980, 193981, 193982, 193983, 193984, 193985, 193986, 193987, 193988, 
+    193989, 193990, 193991, 193992, 193993, 193994, 193995, 193996, 193997, 
+    193998, 193999, 194000, 194001, 194002, 194003, 194004, 194005, 194006, 
+    194007, 194008, 194009, 194010, 194011, 194012, 194013, 194014, 194015, 
+    194016, 194017, 194018, 194019, 194020, 194021, 194022, 194023, 194024, 
+    194025, 194026, 194027, 194028, 194029, 194030, 194031, 194032, 194033, 
+    194034, 194035, 194036, 194037, 194038, 194039, 194040, 194041, 194042, 
+    194043, 194044, 194045, 194046, 194047, 194048, 194049, 194050, 194051, 
+    194052, 194053, 194054, 194055, 194056, 194057, 194058, 194059, 194060, 
+    194061, 194062, 194063, 194064, 194065, 194066, 194067, 194068, 194069, 
+    194070, 194071, 194072, 194073, 194074, 194075, 194076, 194077, 194078, 
+    194079, 194080, 194081, 194082, 194083, 194084, 194085, 194086, 194087, 
+    194088, 194089, 194090, 194091, 194092, 194093, 194094, 194095, 194096, 
+    194097, 194098, 194099, 194100, 194101, 194102, 194103, 194104, 194105, 
+    194106, 194107, 194108, 194109, 194110, 194111, 194112, 194113, 194114, 
+    194115, 194116, 194117, 194118, 194119, 194120, 194121, 194122, 194123, 
+    194124, 194125, 194126, 194127, 194128, 194129, 194130, 194131, 194132, 
+    194133, 194134, 194135, 194136, 194137, 194138, 194139, 194140, 194141, 
+    194142, 194143, 194144, 194145, 194146, 194147, 194148, 194149, 194150, 
+    194151, 194152, 194153, 194154, 194155, 194156, 194157, 194158, 194159, 
+    194160, 194161, 194162, 194163, 194164, 194165, 194166, 194167, 194168, 
+    194169, 194170, 194171, 194172, 194173, 194174, 194175, 194176, 194177, 
+    194178, 194179, 194180, 194181, 194182, 194183, 194184, 194185, 194186, 
+    194187, 194188, 194189, 194190, 194191, 194192, 194193, 194194, 194195, 
+    194196, 194197, 194198, 194199, 194200, 194201, 194202, 194203, 194204, 
+    194205, 194206, 194207, 194208, 194209, 194210, 194211, 194212, 194213, 
+    194214, 194215, 194216, 194217, 194218, 194219, 194220, 194221, 194222, 
+    194223, 194224, 194225, 194226, 194227, 194228, 194229, 194230, 194231, 
+    194232, 194233, 194234, 194235, 194236, 194237, 194238, 194239, 194240, 
+    194241, 194242, 194243, 194244, 194245, 194246, 194247, 194248, 194249, 
+    194250, 194251, 194252, 194253, 194254, 194255, 194256, 194257, 194258, 
+    194259, 194260, 194261, 194262, 194263, 194264, 194265, 194266, 194267, 
+    194268, 194269, 194270, 194271, 194272, 194273, 194274, 194275, 194276, 
+    194277, 194278, 194279, 194280, 194281, 194282, 194283, 194284, 194285, 
+    194286, 194287, 194288, 194289, 194290, 194291, 194292, 194293, 194294, 
+    194295, 194296, 194297, 194298, 194299, 194300, 194301, 194302, 194303, 
+    194304, 194305, 194306, 194307, 194308, 194309, 194310, 194311, 194312, 
+    194313, 194314, 194315, 194316, 194317, 194318, 194319, 194320, 194321, 
+    194322, 194323, 194324, 194325, 194326, 194327, 194328, 194329, 194330, 
+    194331, 194332, 194333, 194334, 194335, 194336, 194337, 194338, 194339, 
+    194340, 194341, 194342, 194343, 194344, 194345, 194346, 194347, 194348, 
+    194349, 194350, 194351, 194352, 194353, 194354, 194355, 194356, 194357, 
+    194358, 194359, 194360, 194361, 194362, 194363, 194364, 194365, 194366, 
+    194367, 194368, 194369, 194370, 194371, 194372, 194373, 194374, 194375, 
+    194376, 194377, 194378, 194379, 194380, 194381, 194382, 194383, 194384, 
+    194385, 194386, 194387, 194388, 194389, 194390, 194391, 194392, 194393, 
+    194394, 194395, 194396, 194397, 194398, 194399, 194400, 194401, 194402, 
+    194403, 194404, 194405, 194406, 194407, 194408, 194409, 194410, 194411, 
+    194412, 194413, 194414, 194415, 194416, 194417, 194418, 194419, 194420, 
+    194421, 194422, 194423, 194424, 194425, 194426, 194427, 194428, 194429, 
+    194430, 194431, 194432, 194433, 194434, 194435, 194436, 194437, 194438, 
+    194439, 194440, 194441, 194442, 194443, 194444, 194445, 194446, 194447, 
+    194448, 194449, 194450, 194451, 194452, 194453, 194454, 194455, 194456, 
+    194457, 194458, 194459, 194460, 194461, 194462, 194463, 194464, 194465, 
+    194466, 194467, 194468, 194469, 194470, 194471, 194472, 194473, 194474, 
+    194475, 194476, 194477, 194478, 194479, 194480, 194481, 194482, 194483, 
+    194484, 194485, 194486, 194487, 194488, 194489, 194490, 194491, 194492, 
+    194493, 194494, 194495, 194496, 194497, 194498, 194499, 194500, 194501, 
+    194502, 194503, 194504, 194505, 194506, 194507, 194508, 194509, 194510, 
+    194511, 194512, 194513, 194514, 194515, 194516, 194517, 194518, 194519, 
+    194520, 194521, 194522, 194523, 194524, 194525, 194526, 194527, 194528, 
+    194529, 194530, 194531, 194532, 194533, 194534, 194535, 194536, 194537, 
+    194538, 194539, 194540, 194541, 194542, 194543, 194544, 194545, 194546, 
+    194547, 194548, 194549, 194550, 194551, 194552, 194553, 194554, 194555, 
+    194556, 194557, 194558, 194559, 194560, 194561, 194562, 194563, 194564, 
+    194565, 194566, 194567, 194568, 194569, 194570, 194571, 194572, 194573, 
+    194574, 194575, 194576, 194577, 194578, 194579, 194580, 194581, 194582, 
+    194583, 194584, 194585, 194586, 194587, 194588, 194589, 194590, 194591, 
+    194592, 194593, 194594, 194595, 194596, 194597, 194598, 194599, 194600, 
+    194601, 194602, 194603, 194604, 194605, 194606, 194607, 194608, 194609, 
+    194610, 194611, 194612, 194613, 194614, 194615, 194616, 194617, 194618, 
+    194619, 194620, 194621, 194622, 194623, 194624, 194625, 194626, 194627, 
+    194628, 194629, 194630, 194631, 194632, 194633, 194634, 194635, 194636, 
+    194637, 194638, 194639, 194640, 194641, 194642, 194643, 194644, 194645, 
+    194646, 194647, 194648, 194649, 194650, 194651, 194652, 194653, 194654, 
+    194655, 194656, 194657, 194658, 194659, 194660, 194661, 194662, 194663, 
+    194664, 194665, 194666, 194667, 194668, 194669, 194670, 194671, 194672, 
+    194673, 194674, 194675, 194676, 194677, 194678, 194679, 194680, 194681, 
+    194682, 194683, 194684, 194685, 194686, 194687, 194688, 194689, 194690, 
+    194691, 194692, 194693, 194694, 194695, 194696, 194697, 194698, 194699, 
+    194700, 194701, 194702, 194703, 194704, 194705, 194706, 194707, 194708, 
+    194709, 194710, 194711, 194712, 194713, 194714, 194715, 194716, 194717, 
+    194718, 194719, 194720, 194721, 194722, 194723, 194724, 194725, 194726, 
+    194727, 194728, 194729, 194730, 194731, 194732, 194733, 194734, 194735, 
+    194736, 194737, 194738, 194739, 194740, 194741, 194742, 194743, 194744, 
+    194745, 194746, 194747, 194748, 194749, 194750, 194751, 194752, 194753, 
+    194754, 194755, 194756, 194757, 194758, 194759, 194760, 194761, 194762, 
+    194763, 194764, 194765, 194766, 194767, 194768, 194769, 194770, 194771, 
+    194772, 194773, 194774, 194775, 194776, 194777, 194778, 194779, 194780, 
+    194781, 194782, 194783, 194784, 194785, 194786, 194787, 194788, 194789, 
+    194790, 194791, 194792, 194793, 194794, 194795, 194796, 194797, 194798, 
+    194799, 194800, 194801, 194802, 194803, 194804, 194805, 194806, 194807, 
+    194808, 194809, 194810, 194811, 194812, 194813, 194814, 194815, 194816, 
+    194817, 194818, 194819, 194820, 194821, 194822, 194823, 194824, 194825, 
+    194826, 194827, 194828, 194829, 194830, 194831, 194832, 194833, 194834, 
+    194835, 194836, 194837, 194838, 194839, 194840, 194841, 194842, 194843, 
+    194844, 194845, 194846, 194847, 194848, 194849, 194850, 194851, 194852, 
+    194853, 194854, 194855, 194856, 194857, 194858, 194859, 194860, 194861, 
+    194862, 194863, 194864, 194865, 194866, 194867, 194868, 194869, 194870, 
+    194871, 194872, 194873, 194874, 194875, 194876, 194877, 194878, 194879, 
+    194880, 194881, 194882, 194883, 194884, 194885, 194886, 194887, 194888, 
+    194889, 194890, 194891, 194892, 194893, 194894, 194895, 194896, 194897, 
+    194898, 194899, 194900, 194901, 194902, 194903, 194904, 194905, 194906, 
+    194907, 194908, 194909, 194910, 194911, 194912, 194913, 194914, 194915, 
+    194916, 194917, 194918, 194919, 194920, 194921, 194922, 194923, 194924, 
+    194925, 194926, 194927, 194928, 194929, 194930, 194931, 194932, 194933, 
+    194934, 194935, 194936, 194937, 194938, 194939, 194940, 194941, 194942, 
+    194943, 194944, 194945, 194946, 194947, 194948, 194949, 194950, 194951, 
+    194952, 194953, 194954, 194955, 194956, 194957, 194958, 194959, 194960, 
+    194961, 194962, 194963, 194964, 194965, 194966, 194967, 194968, 194969, 
+    194970, 194971, 194972, 194973, 194974, 194975, 194976, 194977, 194978, 
+    194979, 194980, 194981, 194982, 194983, 194984, 194985, 194986, 194987, 
+    194988, 194989, 194990, 194991, 194992, 194993, 194994, 194995, 194996, 
+    194997, 194998, 194999, 195000, 195001, 195002, 195003, 195004, 195005, 
+    195006, 195007, 195008, 195009, 195010, 195011, 195012, 195013, 195014, 
+    195015, 195016, 195017, 195018, 195019, 195020, 195021, 195022, 195023, 
+    195024, 195025, 195026, 195027, 195028, 195029, 195030, 195031, 195032, 
+    195033, 195034, 195035, 195036, 195037, 195038, 195039, 195040, 195041, 
+    195042, 195043, 195044, 195045, 195046, 195047, 195048, 195049, 195050, 
+    195051, 195052, 195053, 195054, 195055, 195056, 195057, 195058, 195059, 
+    195060, 195061, 195062, 195063, 195064, 195065, 195066, 195067, 195068, 
+    195069, 195070, 195071, 195072, 195073, 195074, 195075, 195076, 195077, 
+    195078, 195079, 195080, 195081, 195082, 195083, 195084, 195085, 195086, 
+    195087, 195088, 195089, 195090, 195091, 195092, 195093, 195094, 195095, 
+    195096, 195097, 195098, 195099, 195100, 195101, 195102, 195103, 195104, 
+    195105, 195106, 195107, 195108, 195109, 195110, 195111, 195112, 195113, 
+    195114, 195115, 195116, 195117, 195118, 195119, 195120, 195121, 195122, 
+    195123, 195124, 195125, 195126, 195127, 195128, 195129, 195130, 195131, 
+    195132, 195133, 195134, 195135, 195136, 195137, 195138, 195139, 195140, 
+    195141, 195142, 195143, 195144, 195145, 195146, 195147, 195148, 195149, 
+    195150, 195151, 195152, 195153, 195154, 195155, 195156, 195157, 195158, 
+    195159, 195160, 195161, 195162, 195163, 195164, 195165, 195166, 195167, 
+    195168, 195169, 195170, 195171, 195172, 195173, 195174, 195175, 195176, 
+    195177, 195178, 195179, 195180, 195181, 195182, 195183, 195184, 195185, 
+    195186, 195187, 195188, 195189, 195190, 195191, 195192, 195193, 195194, 
+    195195, 195196, 195197, 195198, 195199, 195200, 195201, 195202, 195203, 
+    195204, 195205, 195206, 195207, 195208, 195209, 195210, 195211, 195212, 
+    195213, 195214, 195215, 195216, 195217, 195218, 195219, 195220, 195221, 
+    195222, 195223, 195224, 195225, 195226, 195227, 195228, 195229, 195230, 
+    195231, 195232, 195233, 195234, 195235, 195236, 195237, 195238, 195239, 
+    195240, 195241, 195242, 195243, 195244, 195245, 195246, 195247, 195248, 
+    195249, 195250, 195251, 195252, 195253, 195254, 195255, 195256, 195257, 
+    195258, 195259, 195260, 195261, 195262, 195263, 195264, 195265, 195266, 
+    195267, 195268, 195269, 195270, 195271, 195272, 195273, 195274, 195275, 
+    195276, 195277, 195278, 195279, 195280, 195281, 195282, 195283, 195284, 
+    195285, 195286, 195287, 195288, 195289, 195290, 195291, 195292, 195293, 
+    195294, 195295, 195296, 195297, 195298, 195299, 195300, 195301, 195302, 
+    195303, 195304, 195305, 195306, 195307, 195308, 195309, 195310, 195311, 
+    195312, 195313, 195314, 195315, 195316, 195317, 195318, 195319, 195320, 
+    195321, 195322, 195323, 195324, 195325, 195326, 195327, 195328, 195329, 
+    195330, 195331, 195332, 195333, 195334, 195335, 195336, 195337, 195338, 
+    195339, 195340, 195341, 195342, 195343, 195344, 195345, 195346, 195347, 
+    195348, 195349, 195350, 195351, 195352, 195353, 195354, 195355, 195356, 
+    195357, 195358, 195359, 195360, 195361, 195362, 195363, 195364, 195365, 
+    195366, 195367, 195368, 195369, 195370, 195371, 195372, 195373, 195374, 
+    195375, 195376, 195377, 195378, 195379, 195380, 195381, 195382, 195383, 
+    195384, 195385, 195386, 195387, 195388, 195389, 195390, 195391, 195392, 
+    195393, 195394, 195395, 195396, 195397, 195398, 195399, 195400, 195401, 
+    195402, 195403, 195404, 195405, 195406, 195407, 195408, 195409, 195410, 
+    195411, 195412, 195413, 195414, 195415, 195416, 195417, 195418, 195419, 
+    195420, 195421, 195422, 195423, 195424, 195425, 195426, 195427, 195428, 
+    195429, 195430, 195431, 195432, 195433, 195434, 195435, 195436, 195437, 
+    195438, 195439, 195440, 195441, 195442, 195443, 195444, 195445, 195446, 
+    195447, 195448, 195449, 195450, 195451, 195452, 195453, 195454, 195455, 
+    195456, 195457, 195458, 195459, 195460, 195461, 195462, 195463, 195464, 
+    195465, 195466, 195467, 195468, 195469, 195470, 195471, 195472, 195473, 
+    195474, 195475, 195476, 195477, 195478, 195479, 195480, 195481, 195482, 
+    195483, 195484, 195485, 195486, 195487, 195488, 195489, 195490, 195491, 
+    195492, 195493, 195494, 195495, 195496, 195497, 195498, 195499, 195500, 
+    195501, 195502, 195503, 195504, 195505, 195506, 195507, 195508, 195509, 
+    195510, 195511, 195512, 195513, 195514, 195515, 195516, 195517, 195518, 
+    195519, 195520, 195521, 195522, 195523, 195524, 195525, 195526, 195527, 
+    195528, 195529, 195530, 195531, 195532, 195533, 195534, 195535, 195536, 
+    195537, 195538, 195539, 195540, 195541, 195542, 195543, 195544, 195545, 
+    195546, 195547, 195548, 195549, 195550, 195551, 195552, 195553, 195554, 
+    195555, 195556, 195557, 195558, 195559, 195560, 195561, 195562, 195563, 
+    195564, 195565, 195566, 195567, 195568, 195569, 195570, 195571, 195572, 
+    195573, 195574, 195575, 195576, 195577, 195578, 195579, 195580, 195581, 
+    195582, 195583, 195584, 195585, 195586, 195587, 195588, 195589, 195590, 
+    195591, 195592, 195593, 195594, 195595, 195596, 195597, 195598, 195599, 
+    195600, 195601, 195602, 195603, 195604, 195605, 195606, 195607, 195608, 
+    195609, 195610, 195611, 195612, 195613, 195614, 195615, 195616, 195617, 
+    195618, 195619, 195620, 195621, 195622, 195623, 195624, 195625, 195626, 
+    195627, 195628, 195629, 195630, 195631, 195632, 195633, 195634, 195635, 
+    195636, 195637, 195638, 195639, 195640, 195641, 195642, 195643, 195644, 
+    195645, 195646, 195647, 195648, 195649, 195650, 195651, 195652, 195653, 
+    195654, 195655, 195656, 195657, 195658, 195659, 195660, 195661, 195662, 
+    195663, 195664, 195665, 195666, 195667, 195668, 195669, 195670, 195671, 
+    195672, 195673, 195674, 195675, 195676, 195677, 195678, 195679, 195680, 
+    195681, 195682, 195683, 195684, 195685, 195686, 195687, 195688, 195689, 
+    195690, 195691, 195692, 195693, 195694, 195695, 195696, 195697, 195698, 
+    195699, 195700, 195701, 195702, 195703, 195704, 195705, 195706, 195707, 
+    195708, 195709, 195710, 195711, 195712, 195713, 195714, 195715, 195716, 
+    195717, 195718, 195719, 195720, 195721, 195722, 195723, 195724, 195725, 
+    195726, 195727, 195728, 195729, 195730, 195731, 195732, 195733, 195734, 
+    195735, 195736, 195737, 195738, 195739, 195740, 195741, 195742, 195743, 
+    195744, 195745, 195746, 195747, 195748, 195749, 195750, 195751, 195752, 
+    195753, 195754, 195755, 195756, 195757, 195758, 195759, 195760, 195761, 
+    195762, 195763, 195764, 195765, 195766, 195767, 195768, 195769, 195770, 
+    195771, 195772, 195773, 195774, 195775, 195776, 195777, 195778, 195779, 
+    195780, 195781, 195782, 195783, 195784, 195785, 195786, 195787, 195788, 
+    195789, 195790, 195791, 195792, 195793, 195794, 195795, 195796, 195797, 
+    195798, 195799, 195800, 195801, 195802, 195803, 195804, 195805, 195806, 
+    195807, 195808, 195809, 195810, 195811, 195812, 195813, 195814, 195815, 
+    195816, 195817, 195818, 195819, 195820, 195821, 195822, 195823, 195824, 
+    195825, 195826, 195827, 195828, 195829, 195830, 195831, 195832, 195833, 
+    195834, 195835, 195836, 195837, 195838, 195839, 195840, 195841, 195842, 
+    195843, 195844, 195845, 195846, 195847, 195848, 195849, 195850, 195851, 
+    195852, 195853, 195854, 195855, 195856, 195857, 195858, 195859, 195860, 
+    195861, 195862, 195863, 195864, 195865, 195866, 195867, 195868, 195869, 
+    195870, 195871, 195872, 195873, 195874, 195875, 195876, 195877, 195878, 
+    195879, 195880, 195881, 195882, 195883, 195884, 195885, 195886, 195887, 
+    195888, 195889, 195890, 195891, 195892, 195893, 195894, 195895, 195896, 
+    195897, 195898, 195899, 195900, 195901, 195902, 195903, 195904, 195905, 
+    195906, 195907, 195908, 195909, 195910, 195911, 195912, 195913, 195914, 
+    195915, 195916, 195917, 195918, 195919, 195920, 195921, 195922, 195923, 
+    195924, 195925, 195926, 195927, 195928, 195929, 195930, 195931, 195932, 
+    195933, 195934, 195935, 195936, 195937, 195938, 195939, 195940, 195941, 
+    195942, 195943, 195944, 195945, 195946, 195947, 195948, 195949, 195950, 
+    195951, 195952, 195953, 195954, 195955, 195956, 195957, 195958, 195959, 
+    195960, 195961, 195962, 195963, 195964, 195965, 195966, 195967, 195968, 
+    195969, 195970, 195971, 195972, 195973, 195974, 195975, 195976, 195977, 
+    195978, 195979, 195980, 195981, 195982, 195983, 195984, 195985, 195986, 
+    195987, 195988, 195989, 195990, 195991, 195992, 195993, 195994, 195995, 
+    195996, 195997, 195998, 195999, 196000, 196001, 196002, 196003, 196004, 
+    196005, 196006, 196007, 196008, 196009, 196010, 196011, 196012, 196013, 
+    196014, 196015, 196016, 196017, 196018, 196019, 196020, 196021, 196022, 
+    196023, 196024, 196025, 196026, 196027, 196028, 196029, 196030, 196031, 
+    196032, 196033, 196034, 196035, 196036, 196037, 196038, 196039, 196040, 
+    196041, 196042, 196043, 196044, 196045, 196046, 196047, 196048, 196049, 
+    196050, 196051, 196052, 196053, 196054, 196055, 196056, 196057, 196058, 
+    196059, 196060, 196061, 196062, 196063, 196064, 196065, 196066, 196067, 
+    196068, 196069, 196070, 196071, 196072, 196073, 196074, 196075, 196076, 
+    196077, 196078, 196079, 196080, 196081, 196082, 196083, 196084, 196085, 
+    196086, 196087, 196088, 196089, 196090, 196091, 196092, 196093, 196094, 
+    196095, 196096, 196097, 196098, 196099, 196100, 196101, 196102, 196103, 
+    196104, 196105, 196106, 196107, 196108, 196109, 196110, 196111, 196112, 
+    196113, 196114, 196115, 196116, 196117, 196118, 196119, 196120, 196121, 
+    196122, 196123, 196124, 196125, 196126, 196127, 196128, 196129, 196130, 
+    196131, 196132, 196133, 196134, 196135, 196136, 196137, 196138, 196139, 
+    196140, 196141, 196142, 196143, 196144, 196145, 196146, 196147, 196148, 
+    196149, 196150, 196151, 196152, 196153, 196154, 196155, 196156, 196157, 
+    196158, 196159, 196160, 196161, 196162, 196163, 196164, 196165, 196166, 
+    196167, 196168, 196169, 196170, 196171, 196172, 196173, 196174, 196175, 
+    196176, 196177, 196178, 196179, 196180, 196181, 196182, 196183, 196184, 
+    196185, 196186, 196187, 196188, 196189, 196190, 196191, 196192, 196193, 
+    196194, 196195, 196196, 196197, 196198, 196199, 196200, 196201, 196202, 
+    196203, 196204, 196205, 196206, 196207, 196208, 196209, 196210, 196211, 
+    196212, 196213, 196214, 196215, 196216, 196217, 196218, 196219, 196220, 
+    196221, 196222, 196223, 196224, 196225, 196226, 196227, 196228, 196229, 
+    196230, 196231, 196232, 196233, 196234, 196235, 196236, 196237, 196238, 
+    196239, 196240, 196241, 196242, 196243, 196244, 196245, 196246, 196247, 
+    196248, 196249, 196250, 196251, 196252, 196253, 196254, 196255, 196256, 
+    196257, 196258, 196259, 196260, 196261, 196262, 196263, 196264, 196265, 
+    196266, 196267, 196268, 196269, 196270, 196271, 196272, 196273, 196274, 
+    196275, 196276, 196277, 196278, 196279, 196280, 196281, 196282, 196283, 
+    196284, 196285, 196286, 196287, 196288, 196289, 196290, 196291, 196292, 
+    196293, 196294, 196295, 196296, 196297, 196298, 196299, 196300, 196301, 
+    196302, 196303, 196304, 196305, 196306, 196307, 196308, 196309, 196310, 
+    196311, 196312, 196313, 196314, 196315, 196316, 196317, 196318, 196319, 
+    196320, 196321, 196322, 196323, 196324, 196325, 196326, 196327, 196328, 
+    196329, 196330, 196331, 196332, 196333, 196334, 196335, 196336, 196337, 
+    196338, 196339, 196340, 196341, 196342, 196343, 196344, 196345, 196346, 
+    196347, 196348, 196349, 196350, 196351, 196352, 196353, 196354, 196355, 
+    196356, 196357, 196358, 196359, 196360, 196361, 196362, 196363, 196364, 
+    196365, 196366, 196367, 196368, 196369, 196370, 196371, 196372, 196373, 
+    196374, 196375, 196376, 196377, 196378, 196379, 196380, 196381, 196382, 
+    196383, 196384, 196385, 196386, 196387, 196388, 196389, 196390, 196391, 
+    196392, 196393, 196394, 196395, 196396, 196397, 196398, 196399, 196400, 
+    196401, 196402, 196403, 196404, 196405, 196406, 196407, 196408, 196409, 
+    196410, 196411, 196412, 196413, 196414, 196415, 196416, 196417, 196418, 
+    196419, 196420, 196421, 196422, 196423, 196424, 196425, 196426, 196427, 
+    196428, 196429, 196430, 196431, 196432, 196433, 196434, 196435, 196436, 
+    196437, 196438, 196439, 196440, 196441, 196442, 196443, 196444, 196445, 
+    196446, 196447, 196448, 196449, 196450, 196451, 196452, 196453, 196454, 
+    196455, 196456, 196457, 196458, 196459, 196460, 196461, 196462, 196463, 
+    196464, 196465, 196466, 196467, 196468, 196469, 196470, 196471, 196472, 
+    196473, 196474, 196475, 196476, 196477, 196478, 196479, 196480, 196481, 
+    196482, 196483, 196484, 196485, 196486, 196487, 196488, 196489, 196490, 
+    196491, 196492, 196493, 196494, 196495, 196496, 196497, 196498, 196499, 
+    196500, 196501, 196502, 196503, 196504, 196505, 196506, 196507, 196508, 
+    196509, 196510, 196511, 196512, 196513, 196514, 196515, 196516, 196517, 
+    196518, 196519, 196520, 196521, 196522, 196523, 196524, 196525, 196526, 
+    196527, 196528, 196529, 196530, 196531, 196532, 196533, 196534, 196535, 
+    196536, 196537, 196538, 196539, 196540, 196541, 196542, 196543, 196544, 
+    196545, 196546, 196547, 196548, 196549, 196550, 196551, 196552, 196553, 
+    196554, 196555, 196556, 196557, 196558, 196559, 196560, 196561, 196562, 
+    196563, 196564, 196565, 196566, 196567, 196568, 196569, 196570, 196571, 
+    196572, 196573, 196574, 196575, 196576, 196577, 196578, 196579, 196580, 
+    196581, 196582, 196583, 196584, 196585, 196586, 196587, 196588, 196589, 
+    196590, 196591, 196592, 196593, 196594, 196595, 196596, 196597, 196598, 
+    196599, 196600, 196601, 196602, 196603, 196604, 196605, 196606, 196607, 
+    196608, 196609, 196610, 196611, 196612, 196613, 196614, 196615, 196616, 
+    196617, 196618, 196619, 196620, 196621, 196622, 196623, 196624, 196625, 
+    196626, 196627, 196628, 196629, 196630, 196631, 196632, 196633, 196634, 
+    196635, 196636, 196637, 196638, 196639, 196640, 196641, 196642, 196643, 
+    196644, 196645, 196646, 196647, 196648, 196649, 196650, 196651, 196652, 
+    196653, 196654, 196655, 196656, 196657, 196658, 196659, 196660, 196661, 
+    196662, 196663, 196664, 196665, 196666, 196667, 196668, 196669, 196670, 
+    196671, 196672, 196673, 196674, 196675, 196676, 196677, 196678, 196679, 
+    196680, 196681, 196682, 196683, 196684, 196685, 196686, 196687, 196688, 
+    196689, 196690, 196691, 196692, 196693, 196694, 196695, 196696, 196697, 
+    196698, 196699, 196700, 196701, 196702, 196703, 196704, 196705, 196706, 
+    196707, 196708, 196709, 196710, 196711, 196712, 196713, 196714, 196715, 
+    196716, 196717, 196718, 196719, 196720, 196721, 196722, 196723, 196724, 
+    196725, 196726, 196727, 196728, 196729, 196730, 196731, 196732, 196733, 
+    196734, 196735, 196736, 196737, 196738, 196739, 196740, 196741, 196742, 
+    196743, 196744, 196745, 196746, 196747, 196748, 196749, 196750, 196751, 
+    196752, 196753, 196754, 196755, 196756, 196757, 196758, 196759, 196760, 
+    196761, 196762, 196763, 196764, 196765, 196766, 196767, 196768, 196769, 
+    196770, 196771, 196772, 196773, 196774, 196775, 196776, 196777, 196778, 
+    196779, 196780, 196781, 196782, 196783, 196784, 196785, 196786, 196787, 
+    196788, 196789, 196790, 196791, 196792, 196793, 196794, 196795, 196796, 
+    196797, 196798, 196799, 196800, 196801, 196802, 196803, 196804, 196805, 
+    196806, 196807, 196808, 196809, 196810, 196811, 196812, 196813, 196814, 
+    196815, 196816, 196817, 196818, 196819, 196820, 196821, 196822, 196823, 
+    196824, 196825, 196826, 196827, 196828, 196829, 196830, 196831, 196832, 
+    196833, 196834, 196835, 196836, 196837, 196838, 196839, 196840, 196841, 
+    196842, 196843, 196844, 196845, 196846, 196847, 196848, 196849, 196850, 
+    196851, 196852, 196853, 196854, 196855, 196856, 196857, 196858, 196859, 
+    196860, 196861, 196862, 196863, 196864, 196865, 196866, 196867, 196868, 
+    196869, 196870, 196871, 196872, 196873, 196874, 196875, 196876, 196877, 
+    196878, 196879, 196880, 196881, 196882, 196883, 196884, 196885, 196886, 
+    196887, 196888, 196889, 196890, 196891, 196892, 196893, 196894, 196895, 
+    196896, 196897, 196898, 196899, 196900, 196901, 196902, 196903, 196904, 
+    196905, 196906, 196907, 196908, 196909, 196910, 196911, 196912, 196913, 
+    196914, 196915, 196916, 196917, 196918, 196919, 196920, 196921, 196922, 
+    196923, 196924, 196925, 196926, 196927, 196928, 196929, 196930, 196931, 
+    196932, 196933, 196934, 196935, 196936, 196937, 196938, 196939, 196940, 
+    196941, 196942, 196943, 196944, 196945, 196946, 196947, 196948, 196949, 
+    196950, 196951, 196952, 196953, 196954, 196955, 196956, 196957, 196958, 
+    196959, 196960, 196961, 196962, 196963, 196964, 196965, 196966, 196967, 
+    196968, 196969, 196970, 196971, 196972, 196973, 196974, 196975, 196976, 
+    196977, 196978, 196979, 196980, 196981, 196982, 196983, 196984, 196985, 
+    196986, 196987, 196988, 196989, 196990, 196991, 196992, 196993, 196994, 
+    196995, 196996, 196997, 196998, 196999, 197000, 197001, 197002, 197003, 
+    197004, 197005, 197006, 197007, 197008, 197009, 197010, 197011, 197012, 
+    197013, 197014, 197015, 197016, 197017, 197018, 197019, 197020, 197021, 
+    197022, 197023, 197024, 197025, 197026, 197027, 197028, 197029, 197030, 
+    197031, 197032, 197033, 197034, 197035, 197036, 197037, 197038, 197039, 
+    197040, 197041, 197042, 197043, 197044, 197045, 197046, 197047, 197048, 
+    197049, 197050, 197051, 197052, 197053, 197054, 197055, 197056, 197057, 
+    197058, 197059, 197060, 197061, 197062, 197063, 197064, 197065, 197066, 
+    197067, 197068, 197069, 197070, 197071, 197072, 197073, 197074, 197075, 
+    197076, 197077, 197078, 197079, 197080, 197081, 197082, 197083, 197084, 
+    197085, 197086, 197087, 197088, 197089, 197090, 197091, 197092, 197093, 
+    197094, 197095, 197096, 197097, 197098, 197099, 197100, 197101, 197102, 
+    197103, 197104, 197105, 197106, 197107, 197108, 197109, 197110, 197111, 
+    197112, 197113, 197114, 197115, 197116, 197117, 197118, 197119, 197120, 
+    197121, 197122, 197123, 197124, 197125, 197126, 197127, 197128, 197129, 
+    197130, 197131, 197132, 197133, 197134, 197135, 197136, 197137, 197138, 
+    197139, 197140, 197141, 197142, 197143, 197144, 197145, 197146, 197147, 
+    197148, 197149, 197150, 197151, 197152, 197153, 197154, 197155, 197156, 
+    197157, 197158, 197159, 197160, 197161, 197162, 197163, 197164, 197165, 
+    197166, 197167, 197168, 197169, 197170, 197171, 197172, 197173, 197174, 
+    197175, 197176, 197177, 197178, 197179, 197180, 197181, 197182, 197183, 
+    197184, 197185, 197186, 197187, 197188, 197189, 197190, 197191, 197192, 
+    197193, 197194, 197195, 197196, 197197, 197198, 197199, 197200, 197201, 
+    197202, 197203, 197204, 197205, 197206, 197207, 197208, 197209, 197210, 
+    197211, 197212, 197213, 197214, 197215, 197216, 197217, 197218, 197219, 
+    197220, 197221, 197222, 197223, 197224, 197225, 197226, 197227, 197228, 
+    197229, 197230, 197231, 197232, 197233, 197234, 197235, 197236, 197237, 
+    197238, 197239, 197240, 197241, 197242, 197243, 197244, 197245, 197246, 
+    197247, 197248, 197249, 197250, 197251, 197252, 197253, 197254, 197255, 
+    197256, 197257, 197258, 197259, 197260, 197261, 197262, 197263, 197264, 
+    197265, 197266, 197267, 197268, 197269, 197270, 197271, 197272, 197273, 
+    197274, 197275, 197276, 197277, 197278, 197279, 197280, 197281, 197282, 
+    197283, 197284, 197285, 197286, 197287, 197288, 197289, 197290, 197291, 
+    197292, 197293, 197294, 197295, 197296, 197297, 197298, 197299, 197300, 
+    197301, 197302, 197303, 197304, 197305, 197306, 197307, 197308, 197309, 
+    197310, 197311, 197312, 197313, 197314, 197315, 197316, 197317, 197318, 
+    197319, 197320, 197321, 197322, 197323, 197324, 197325, 197326, 197327, 
+    197328, 197329, 197330, 197331, 197332, 197333, 197334, 197335, 197336, 
+    197337, 197338, 197339, 197340, 197341, 197342, 197343, 197344, 197345, 
+    197346, 197347, 197348, 197349, 197350, 197351, 197352, 197353, 197354, 
+    197355, 197356, 197357, 197358, 197359, 197360, 197361, 197362, 197363, 
+    197364, 197365, 197366, 197367, 197368, 197369, 197370, 197371, 197372, 
+    197373, 197374, 197375, 197376, 197377, 197378, 197379, 197380, 197381, 
+    197382, 197383, 197384, 197385, 197386, 197387, 197388, 197389, 197390, 
+    197391, 197392, 197393, 197394, 197395, 197396, 197397, 197398, 197399, 
+    197400, 197401, 197402, 197403, 197404, 197405, 197406, 197407, 197408, 
+    197409, 197410, 197411, 197412, 197413, 197414, 197415, 197416, 197417, 
+    197418, 197419, 197420, 197421, 197422, 197423, 197424, 197425, 197426, 
+    197427, 197428, 197429, 197430, 197431, 197432, 197433, 197434, 197435, 
+    197436, 197437, 197438, 197439, 197440, 197441, 197442, 197443, 197444, 
+    197445, 197446, 197447, 197448, 197449, 197450, 197451, 197452, 197453, 
+    197454, 197455, 197456, 197457, 197458, 197459, 197460, 197461, 197462, 
+    197463, 197464, 197465, 197466, 197467, 197468, 197469, 197470, 197471, 
+    197472, 197473, 197474, 197475, 197476, 197477, 197478, 197479, 197480, 
+    197481, 197482, 197483, 197484, 197485, 197486, 197487, 197488, 197489, 
+    197490, 197491, 197492, 197493, 197494, 197495, 197496, 197497, 197498, 
+    197499, 197500, 197501, 197502, 197503, 197504, 197505, 197506, 197507, 
+    197508, 197509, 197510, 197511, 197512, 197513, 197514, 197515, 197516, 
+    197517, 197518, 197519, 197520, 197521, 197522, 197523, 197524, 197525, 
+    197526, 197527, 197528, 197529, 197530, 197531, 197532, 197533, 197534, 
+    197535, 197536, 197537, 197538, 197539, 197540, 197541, 197542, 197543, 
+    197544, 197545, 197546, 197547, 197548, 197549, 197550, 197551, 197552, 
+    197553, 197554, 197555, 197556, 197557, 197558, 197559, 197560, 197561, 
+    197562, 197563, 197564, 197565, 197566, 197567, 197568, 197569, 197570, 
+    197571, 197572, 197573, 197574, 197575, 197576, 197577, 197578, 197579, 
+    197580, 197581, 197582, 197583, 197584, 197585, 197586, 197587, 197588, 
+    197589, 197590, 197591, 197592, 197593, 197594, 197595, 197596, 197597, 
+    197598, 197599, 197600, 197601, 197602, 197603, 197604, 197605, 197606, 
+    197607, 197608, 197609, 197610, 197611, 197612, 197613, 197614, 197615, 
+    197616, 197617, 197618, 197619, 197620, 197621, 197622, 197623, 197624, 
+    197625, 197626, 197627, 197628, 197629, 197630, 197631, 197632, 197633, 
+    197634, 197635, 197636, 197637, 197638, 197639, 197640, 197641, 197642, 
+    197643, 197644, 197645, 197646, 197647, 197648, 197649, 197650, 197651, 
+    197652, 197653, 197654, 197655, 197656, 197657, 197658, 197659, 197660, 
+    197661, 197662, 197663, 197664, 197665, 197666, 197667, 197668, 197669, 
+    197670, 197671, 197672, 197673, 197674, 197675, 197676, 197677, 197678, 
+    197679, 197680, 197681, 197682, 197683, 197684, 197685, 197686, 197687, 
+    197688, 197689, 197690, 197691, 197692, 197693, 197694, 197695, 197696, 
+    197697, 197698, 197699, 197700, 197701, 197702, 197703, 197704, 197705, 
+    197706, 197707, 197708, 197709, 197710, 197711, 197712, 197713, 197714, 
+    197715, 197716, 197717, 197718, 197719, 197720, 197721, 197722, 197723, 
+    197724, 197725, 197726, 197727, 197728, 197729, 197730, 197731, 197732, 
+    197733, 197734, 197735, 197736, 197737, 197738, 197739, 197740, 197741, 
+    197742, 197743, 197744, 197745, 197746, 197747, 197748, 197749, 197750, 
+    197751, 197752, 197753, 197754, 197755, 197756, 197757, 197758, 197759, 
+    197760, 197761, 197762, 197763, 197764, 197765, 197766, 197767, 197768, 
+    197769, 197770, 197771, 197772, 197773, 197774, 197775, 197776, 197777, 
+    197778, 197779, 197780, 197781, 197782, 197783, 197784, 197785, 197786, 
+    197787, 197788, 197789, 197790, 197791, 197792, 197793, 197794, 197795, 
+    197796, 197797, 197798, 197799, 197800, 197801, 197802, 197803, 197804, 
+    197805, 197806, 197807, 197808, 197809, 197810, 197811, 197812, 197813, 
+    197814, 197815, 197816, 197817, 197818, 197819, 197820, 197821, 197822, 
+    197823, 197824, 197825, 197826, 197827, 197828, 197829, 197830, 197831, 
+    197832, 197833, 197834, 197835, 197836, 197837, 197838, 197839, 197840, 
+    197841, 197842, 197843, 197844, 197845, 197846, 197847, 197848, 197849, 
+    197850, 197851, 197852, 197853, 197854, 197855, 197856, 197857, 197858, 
+    197859, 197860, 197861, 197862, 197863, 197864, 197865, 197866, 197867, 
+    197868, 197869, 197870, 197871, 197872, 197873, 197874, 197875, 197876, 
+    197877, 197878, 197879, 197880, 197881, 197882, 197883, 197884, 197885, 
+    197886, 197887, 197888, 197889, 197890, 197891, 197892, 197893, 197894, 
+    197895, 197896, 197897, 197898, 197899, 197900, 197901, 197902, 197903, 
+    197904, 197905, 197906, 197907, 197908, 197909, 197910, 197911, 197912, 
+    197913, 197914, 197915, 197916, 197917, 197918, 197919, 197920, 197921, 
+    197922, 197923, 197924, 197925, 197926, 197927, 197928, 197929, 197930, 
+    197931, 197932, 197933, 197934, 197935, 197936, 197937, 197938, 197939, 
+    197940, 197941, 197942, 197943, 197944, 197945, 197946, 197947, 197948, 
+    197949, 197950, 197951, 197952, 197953, 197954, 197955, 197956, 197957, 
+    197958, 197959, 197960, 197961, 197962, 197963, 197964, 197965, 197966, 
+    197967, 197968, 197969, 197970, 197971, 197972, 197973, 197974, 197975, 
+    197976, 197977, 197978, 197979, 197980, 197981, 197982, 197983, 197984, 
+    197985, 197986, 197987, 197988, 197989, 197990, 197991, 197992, 197993, 
+    197994, 197995, 197996, 197997, 197998, 197999, 198000, 198001, 198002, 
+    198003, 198004, 198005, 198006, 198007, 198008, 198009, 198010, 198011, 
+    198012, 198013, 198014, 198015, 198016, 198017, 198018, 198019, 198020, 
+    198021, 198022, 198023, 198024, 198025, 198026, 198027, 198028, 198029, 
+    198030, 198031, 198032, 198033, 198034, 198035, 198036, 198037, 198038, 
+    198039, 198040, 198041, 198042, 198043, 198044, 198045, 198046, 198047, 
+    198048, 198049, 198050, 198051, 198052, 198053, 198054, 198055, 198056, 
+    198057, 198058, 198059, 198060, 198061, 198062, 198063, 198064, 198065, 
+    198066, 198067, 198068, 198069, 198070, 198071, 198072, 198073, 198074, 
+    198075, 198076, 198077, 198078, 198079, 198080, 198081, 198082, 198083, 
+    198084, 198085, 198086, 198087, 198088, 198089, 198090, 198091, 198092, 
+    198093, 198094, 198095, 198096, 198097, 198098, 198099, 198100, 198101, 
+    198102, 198103, 198104, 198105, 198106, 198107, 198108, 198109, 198110, 
+    198111, 198112, 198113, 198114, 198115, 198116, 198117, 198118, 198119, 
+    198120, 198121, 198122, 198123, 198124, 198125, 198126, 198127, 198128, 
+    198129, 198130, 198131, 198132, 198133, 198134, 198135, 198136, 198137, 
+    198138, 198139, 198140, 198141, 198142, 198143, 198144, 198145, 198146, 
+    198147, 198148, 198149, 198150, 198151, 198152, 198153, 198154, 198155, 
+    198156, 198157, 198158, 198159, 198160, 198161, 198162, 198163, 198164, 
+    198165, 198166, 198167, 198168, 198169, 198170, 198171, 198172, 198173, 
+    198174, 198175, 198176, 198177, 198178, 198179, 198180, 198181, 198182, 
+    198183, 198184, 198185, 198186, 198187, 198188, 198189, 198190, 198191, 
+    198192, 198193, 198194, 198195, 198196, 198197, 198198, 198199, 198200, 
+    198201, 198202, 198203, 198204, 198205, 198206, 198207, 198208, 198209, 
+    198210, 198211, 198212, 198213, 198214, 198215, 198216, 198217, 198218, 
+    198219, 198220, 198221, 198222, 198223, 198224, 198225, 198226, 198227, 
+    198228, 198229, 198230, 198231, 198232, 198233, 198234, 198235, 198236, 
+    198237, 198238, 198239, 198240, 198241, 198242, 198243, 198244, 198245, 
+    198246, 198247, 198248, 198249, 198250, 198251, 198252, 198253, 198254, 
+    198255, 198256, 198257, 198258, 198259, 198260, 198261, 198262, 198263, 
+    198264, 198265, 198266, 198267, 198268, 198269, 198270, 198271, 198272, 
+    198273, 198274, 198275, 198276, 198277, 198278, 198279, 198280, 198281, 
+    198282, 198283, 198284, 198285, 198286, 198287, 198288, 198289, 198290, 
+    198291, 198292, 198293, 198294, 198295, 198296, 198297, 198298, 198299, 
+    198300, 198301, 198302, 198303, 198304, 198305, 198306, 198307, 198308, 
+    198309, 198310, 198311, 198312, 198313, 198314, 198315, 198316, 198317, 
+    198318, 198319, 198320, 198321, 198322, 198323, 198324, 198325, 198326, 
+    198327, 198328, 198329, 198330, 198331, 198332, 198333, 198334, 198335, 
+    198336, 198337, 198338, 198339, 198340, 198341, 198342, 198343, 198344, 
+    198345, 198346, 198347, 198348, 198349, 198350, 198351, 198352, 198353, 
+    198354, 198355, 198356, 198357, 198358, 198359, 198360, 198361, 198362, 
+    198363, 198364, 198365, 198366, 198367, 198368, 198369, 198370, 198371, 
+    198372, 198373, 198374, 198375, 198376, 198377, 198378, 198379, 198380, 
+    198381, 198382, 198383, 198384, 198385, 198386, 198387, 198388, 198389, 
+    198390, 198391, 198392, 198393, 198394, 198395, 198396, 198397, 198398, 
+    198399, 198400, 198401, 198402, 198403, 198404, 198405, 198406, 198407, 
+    198408, 198409, 198410, 198411, 198412, 198413, 198414, 198415, 198416, 
+    198417, 198418, 198419, 198420, 198421, 198422, 198423, 198424, 198425, 
+    198426, 198427, 198428, 198429, 198430, 198431, 198432, 198433, 198434, 
+    198435, 198436, 198437, 198438, 198439, 198440, 198441, 198442, 198443, 
+    198444, 198445, 198446, 198447, 198448, 198449, 198450, 198451, 198452, 
+    198453, 198454, 198455, 198456, 198457, 198458, 198459, 198460, 198461, 
+    198462, 198463, 198464, 198465, 198466, 198467, 198468, 198469, 198470, 
+    198471, 198472, 198473, 198474, 198475, 198476, 198477, 198478, 198479, 
+    198480, 198481, 198482, 198483, 198484, 198485, 198486, 198487, 198488, 
+    198489, 198490, 198491, 198492, 198493, 198494, 198495, 198496, 198497, 
+    198498, 198499, 198500, 198501, 198502, 198503, 198504, 198505, 198506, 
+    198507, 198508, 198509, 198510, 198511, 198512, 198513, 198514, 198515, 
+    198516, 198517, 198518, 198519, 198520, 198521, 198522, 198523, 198524, 
+    198525, 198526, 198527, 198528, 198529, 198530, 198531, 198532, 198533, 
+    198534, 198535, 198536, 198537, 198538, 198539, 198540, 198541, 198542, 
+    198543, 198544, 198545, 198546, 198547, 198548, 198549, 198550, 198551, 
+    198552, 198553, 198554, 198555, 198556, 198557, 198558, 198559, 198560, 
+    198561, 198562, 198563, 198564, 198565, 198566, 198567, 198568, 198569, 
+    198570, 198571, 198572, 198573, 198574, 198575, 198576, 198577, 198578, 
+    198579, 198580, 198581, 198582, 198583, 198584, 198585, 198586, 198587, 
+    198588, 198589, 198590, 198591, 198592, 198593, 198594, 198595, 198596, 
+    198597, 198598, 198599, 198600, 198601, 198602, 198603, 198604, 198605, 
+    198606, 198607, 198608, 198609, 198610, 198611, 198612, 198613, 198614, 
+    198615, 198616, 198617, 198618, 198619, 198620, 198621, 198622, 198623, 
+    198624, 198625, 198626, 198627, 198628, 198629, 198630, 198631, 198632, 
+    198633, 198634, 198635, 198636, 198637, 198638, 198639, 198640, 198641, 
+    198642, 198643, 198644, 198645, 198646, 198647, 198648, 198649, 198650, 
+    198651, 198652, 198653, 198654, 198655, 198656, 198657, 198658, 198659, 
+    198660, 198661, 198662, 198663, 198664, 198665, 198666, 198667, 198668, 
+    198669, 198670, 198671, 198672, 198673, 198674, 198675, 198676, 198677, 
+    198678, 198679, 198680, 198681, 198682, 198683, 198684, 198685, 198686, 
+    198687, 198688, 198689, 198690, 198691, 198692, 198693, 198694, 198695, 
+    198696, 198697, 198698, 198699, 198700, 198701, 198702, 198703, 198704, 
+    198705, 198706, 198707, 198708, 198709, 198710, 198711, 198712, 198713, 
+    198714, 198715, 198716, 198717, 198718, 198719, 198720, 198721, 198722, 
+    198723, 198724, 198725, 198726, 198727, 198728, 198729, 198730, 198731, 
+    198732, 198733, 198734, 198735, 198736, 198737, 198738, 198739, 198740, 
+    198741, 198742, 198743, 198744, 198745, 198746, 198747, 198748, 198749, 
+    198750, 198751, 198752, 198753, 198754, 198755, 198756, 198757, 198758, 
+    198759, 198760, 198761, 198762, 198763, 198764, 198765, 198766, 198767, 
+    198768, 198769, 198770, 198771, 198772, 198773, 198774, 198775, 198776, 
+    198777, 198778, 198779, 198780, 198781, 198782, 198783, 198784, 198785, 
+    198786, 198787, 198788, 198789, 198790, 198791, 198792, 198793, 198794, 
+    198795, 198796, 198797, 198798, 198799, 198800, 198801, 198802, 198803, 
+    198804, 198805, 198806, 198807, 198808, 198809, 198810, 198811, 198812, 
+    198813, 198814, 198815, 198816, 198817, 198818, 198819, 198820, 198821, 
+    198822, 198823, 198824, 198825, 198826, 198827, 198828, 198829, 198830, 
+    198831, 198832, 198833, 198834, 198835, 198836, 198837, 198838, 198839, 
+    198840, 198841, 198842, 198843, 198844, 198845, 198846, 198847, 198848, 
+    198849, 198850, 198851, 198852, 198853, 198854, 198855, 198856, 198857, 
+    198858, 198859, 198860, 198861, 198862, 198863, 198864, 198865, 198866, 
+    198867, 198868, 198869, 198870, 198871, 198872, 198873, 198874, 198875, 
+    198876, 198877, 198878, 198879, 198880, 198881, 198882, 198883, 198884, 
+    198885, 198886, 198887, 198888, 198889, 198890, 198891, 198892, 198893, 
+    198894, 198895, 198896, 198897, 198898, 198899, 198900, 198901, 198902, 
+    198903, 198904, 198905, 198906, 198907, 198908, 198909, 198910, 198911, 
+    198912, 198913, 198914, 198915, 198916, 198917, 198918, 198919, 198920, 
+    198921, 198922, 198923, 198924, 198925, 198926, 198927, 198928, 198929, 
+    198930, 198931, 198932, 198933, 198934, 198935, 198936, 198937, 198938, 
+    198939, 198940, 198941, 198942, 198943, 198944, 198945, 198946, 198947, 
+    198948, 198949, 198950, 198951, 198952, 198953, 198954, 198955, 198956, 
+    198957, 198958, 198959, 198960, 198961, 198962, 198963, 198964, 198965, 
+    198966, 198967, 198968, 198969, 198970, 198971, 198972, 198973, 198974, 
+    198975, 198976, 198977, 198978, 198979, 198980, 198981, 198982, 198983, 
+    198984, 198985, 198986, 198987, 198988, 198989, 198990, 198991, 198992, 
+    198993, 198994, 198995, 198996, 198997, 198998, 198999, 199000, 199001, 
+    199002, 199003, 199004, 199005, 199006, 199007, 199008, 199009, 199010, 
+    199011, 199012, 199013, 199014, 199015, 199016, 199017, 199018, 199019, 
+    199020, 199021, 199022, 199023, 199024, 199025, 199026, 199027, 199028, 
+    199029, 199030, 199031, 199032, 199033, 199034, 199035, 199036, 199037, 
+    199038, 199039, 199040, 199041, 199042, 199043, 199044, 199045, 199046, 
+    199047, 199048, 199049, 199050, 199051, 199052, 199053, 199054, 199055, 
+    199056, 199057, 199058, 199059, 199060, 199061, 199062, 199063, 199064, 
+    199065, 199066, 199067, 199068, 199069, 199070, 199071, 199072, 199073, 
+    199074, 199075, 199076, 199077, 199078, 199079, 199080, 199081, 199082, 
+    199083, 199084, 199085, 199086, 199087, 199088, 199089, 199090, 199091, 
+    199092, 199093, 199094, 199095, 199096, 199097, 199098, 199099, 199100, 
+    199101, 199102, 199103, 199104, 199105, 199106, 199107, 199108, 199109, 
+    199110, 199111, 199112, 199113, 199114, 199115, 199116, 199117, 199118, 
+    199119, 199120, 199121, 199122, 199123, 199124, 199125, 199126, 199127, 
+    199128, 199129, 199130, 199131, 199132, 199133, 199134, 199135, 199136, 
+    199137, 199138, 199139, 199140, 199141, 199142, 199143, 199144, 199145, 
+    199146, 199147, 199148, 199149, 199150, 199151, 199152, 199153, 199154, 
+    199155, 199156, 199157, 199158, 199159, 199160, 199161, 199162, 199163, 
+    199164, 199165, 199166, 199167, 199168, 199169, 199170, 199171, 199172, 
+    199173, 199174, 199175, 199176, 199177, 199178, 199179, 199180, 199181, 
+    199182, 199183, 199184, 199185, 199186, 199187, 199188, 199189, 199190, 
+    199191, 199192, 199193, 199194, 199195, 199196, 199197, 199198, 199199, 
+    199200, 199201, 199202, 199203, 199204, 199205, 199206, 199207, 199208, 
+    199209, 199210, 199211, 199212, 199213, 199214, 199215, 199216, 199217, 
+    199218, 199219, 199220, 199221, 199222, 199223, 199224, 199225, 199226, 
+    199227, 199228, 199229, 199230, 199231, 199232, 199233, 199234, 199235, 
+    199236, 199237, 199238, 199239, 199240, 199241, 199242, 199243, 199244, 
+    199245, 199246, 199247, 199248, 199249, 199250, 199251, 199252, 199253, 
+    199254, 199255, 199256, 199257, 199258, 199259, 199260, 199261, 199262, 
+    199263, 199264, 199265, 199266, 199267, 199268, 199269, 199270, 199271, 
+    199272, 199273, 199274, 199275, 199276, 199277, 199278, 199279, 199280, 
+    199281, 199282, 199283, 199284, 199285, 199286, 199287, 199288, 199289, 
+    199290, 199291, 199292, 199293, 199294, 199295, 199296, 199297, 199298, 
+    199299, 199300, 199301, 199302, 199303, 199304, 199305, 199306, 199307, 
+    199308, 199309, 199310, 199311, 199312, 199313, 199314, 199315, 199316, 
+    199317, 199318, 199319, 199320, 199321, 199322, 199323, 199324, 199325, 
+    199326, 199327, 199328, 199329, 199330, 199331, 199332, 199333, 199334, 
+    199335, 199336, 199337, 199338, 199339, 199340, 199341, 199342, 199343, 
+    199344, 199345, 199346, 199347, 199348, 199349, 199350, 199351, 199352, 
+    199353, 199354, 199355, 199356, 199357, 199358, 199359, 199360, 199361, 
+    199362, 199363, 199364, 199365, 199366, 199367, 199368, 199369, 199370, 
+    199371, 199372, 199373, 199374, 199375, 199376, 199377, 199378, 199379, 
+    199380, 199381, 199382, 199383, 199384, 199385, 199386, 199387, 199388, 
+    199389, 199390, 199391, 199392, 199393, 199394, 199395, 199396, 199397, 
+    199398, 199399, 199400, 199401, 199402, 199403, 199404, 199405, 199406, 
+    199407, 199408, 199409, 199410, 199411, 199412, 199413, 199414, 199415, 
+    199416, 199417, 199418, 199419, 199420, 199421, 199422, 199423, 199424, 
+    199425, 199426, 199427, 199428, 199429, 199430, 199431, 199432, 199433, 
+    199434, 199435, 199436, 199437, 199438, 199439, 199440, 199441, 199442, 
+    199443, 199444, 199445, 199446, 199447, 199448, 199449, 199450, 199451, 
+    199452, 199453, 199454, 199455, 199456, 199457, 199458, 199459, 199460, 
+    199461, 199462, 199463, 199464, 199465, 199466, 199467, 199468, 199469, 
+    199470, 199471, 199472, 199473, 199474, 199475, 199476, 199477, 199478, 
+    199479, 199480, 199481, 199482, 199483, 199484, 199485, 199486, 199487, 
+    199488, 199489, 199490, 199491, 199492, 199493, 199494, 199495, 199496, 
+    199497, 199498, 199499, 199500, 199501, 199502, 199503, 199504, 199505, 
+    199506, 199507, 199508, 199509, 199510, 199511, 199512, 199513, 199514, 
+    199515, 199516, 199517, 199518, 199519, 199520, 199521, 199522, 199523, 
+    199524, 199525, 199526, 199527, 199528, 199529, 199530, 199531, 199532, 
+    199533, 199534, 199535, 199536, 199537, 199538, 199539, 199540, 199541, 
+    199542, 199543, 199544, 199545, 199546, 199547, 199548, 199549, 199550, 
+    199551, 199552, 199553, 199554, 199555, 199556, 199557, 199558, 199559, 
+    199560, 199561, 199562, 199563, 199564, 199565, 199566, 199567, 199568, 
+    199569, 199570, 199571, 199572, 199573, 199574, 199575, 199576, 199577, 
+    199578, 199579, 199580, 199581, 199582, 199583, 199584, 199585, 199586, 
+    199587, 199588, 199589, 199590, 199591, 199592, 199593, 199594, 199595, 
+    199596, 199597, 199598, 199599, 199600, 199601, 199602, 199603, 199604, 
+    199605, 199606, 199607, 199608, 199609, 199610, 199611, 199612, 199613, 
+    199614, 199615, 199616, 199617, 199618, 199619, 199620, 199621, 199622, 
+    199623, 199624, 199625, 199626, 199627, 199628, 199629, 199630, 199631, 
+    199632, 199633, 199634, 199635, 199636, 199637, 199638, 199639, 199640, 
+    199641, 199642, 199643, 199644, 199645, 199646, 199647, 199648, 199649, 
+    199650, 199651, 199652, 199653, 199654, 199655, 199656, 199657, 199658, 
+    199659, 199660, 199661, 199662, 199663, 199664, 199665, 199666, 199667, 
+    199668, 199669, 199670, 199671, 199672, 199673, 199674, 199675, 199676, 
+    199677, 199678, 199679, 199680, 199681, 199682, 199683, 199684, 199685, 
+    199686, 199687, 199688, 199689, 199690, 199691, 199692, 199693, 199694, 
+    199695, 199696, 199697, 199698, 199699, 199700, 199701, 199702, 199703, 
+    199704, 199705, 199706, 199707, 199708, 199709, 199710, 199711, 199712, 
+    199713, 199714, 199715, 199716, 199717, 199718, 199719, 199720, 199721, 
+    199722, 199723, 199724, 199725, 199726, 199727, 199728, 199729, 199730, 
+    199731, 199732, 199733, 199734, 199735, 199736, 199737, 199738, 199739, 
+    199740, 199741, 199742, 199743, 199744, 199745, 199746, 199747, 199748, 
+    199749, 199750, 199751, 199752, 199753, 199754, 199755, 199756, 199757, 
+    199758, 199759, 199760, 199761, 199762, 199763, 199764, 199765, 199766, 
+    199767, 199768, 199769, 199770, 199771, 199772, 199773, 199774, 199775, 
+    199776, 199777, 199778, 199779, 199780, 199781, 199782, 199783, 199784, 
+    199785, 199786, 199787, 199788, 199789, 199790, 199791, 199792, 199793, 
+    199794, 199795, 199796, 199797, 199798, 199799, 199800, 199801, 199802, 
+    199803, 199804, 199805, 199806, 199807, 199808, 199809, 199810, 199811, 
+    199812, 199813, 199814, 199815, 199816, 199817, 199818, 199819, 199820, 
+    199821, 199822, 199823, 199824, 199825, 199826, 199827, 199828, 199829, 
+    199830, 199831, 199832, 199833, 199834, 199835, 199836, 199837, 199838, 
+    199839, 199840, 199841, 199842, 199843, 199844, 199845, 199846, 199847, 
+    199848, 199849, 199850, 199851, 199852, 199853, 199854, 199855, 199856, 
+    199857, 199858, 199859, 199860, 199861, 199862, 199863, 199864, 199865, 
+    199866, 199867, 199868, 199869, 199870, 199871, 199872, 199873, 199874, 
+    199875, 199876, 199877, 199878, 199879, 199880, 199881, 199882, 199883, 
+    199884, 199885, 199886, 199887, 199888, 199889, 199890, 199891, 199892, 
+    199893, 199894, 199895, 199896, 199897, 199898, 199899, 199900, 199901, 
+    199902, 199903, 199904, 199905, 199906, 199907, 199908, 199909, 199910, 
+    199911, 199912, 199913, 199914, 199915, 199916, 199917, 199918, 199919, 
+    199920, 199921, 199922, 199923, 199924, 199925, 199926, 199927, 199928, 
+    199929, 199930, 199931, 199932, 199933, 199934, 199935, 199936, 199937, 
+    199938, 199939, 199940, 199941, 199942, 199943, 199944, 199945, 199946, 
+    199947, 199948, 199949, 199950, 199951, 199952, 199953, 199954, 199955, 
+    199956, 199957, 199958, 199959, 199960, 199961, 199962, 199963, 199964, 
+    199965, 199966, 199967, 199968, 199969, 199970, 199971, 199972, 199973, 
+    199974, 199975, 199976, 199977, 199978, 199979, 199980, 199981, 199982, 
+    199983, 199984, 199985, 199986, 199987, 199988, 199989, 199990, 199991, 
+    199992, 199993, 199994, 199995, 199996, 199997, 199998, 199999, 200000 ;
+
+ TIME = 366 ;
+
+ UNORDERED_AXIS = 1, 3, 5, 2, 4 ;
+
+ GAPPY_AXIS = 1, 2, _, 4, 5 ;
+
+ BACKWARDS_AXIS = 5, 4, 3, 2, 1 ;
+
+ SCALAR_VAR = 99 ;
+
+ MASKED_SST =
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 16.42179, 
+    16.18037, 16.21042, 15.81654, 15.613, 15.24444, 15.02238, 15.29158, 
+    15.0825, 14.89095, 14.3072, 14.21458, 14.32813, 14.83364, 13.695, 
+    13.65417, 13.684, 13.86, 14.4, 13.7675, 13.562, 13.35, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 18.08947, 17.746, 
+    17.80875, 17.53861, 17.22055, 16.97342, 16.69868, 16.49278, 16.53512, 
+    16.55395, 16.4627, 16.34083, 16.3263, 16.54, 15.99304, 15.72, 15.58885, 
+    15.40333, 15.23286, 15.05824, 15.5375, 15.51, 14.78143, 15.09429, 
+    15.08667, 14.65, 14.7125, 15.288, 14.7, 14.975, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, 18.72467, 18.63848, 19.04605, 
+    19.06514, 18.75784, 18.63342, 18.51528, 18.39968, 18.14686, 17.94486, 
+    17.78655, 17.947, 17.82786, 17.48652, 17.32518, 17.235, 17.10882, 
+    17.18412, 17.17485, 16.8325, 16.95539, 16.91348, 16.61591, 16.5513, 
+    16.62167, 17.05667, 17.95625, 16.90454, 16.45091, 17.24, 16.42, 16.805, 
+    17.385, 16.96, 17.19333, 16.9625, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, 19.17385, 19.48064, 19.82903, 19.73219, 
+    20.32619, 19.96619, 20.04179, 19.957, 19.70971, 19.3127, 19.0935, 
+    18.99805, 18.8765, 18.70762, 18.4973, 18.15586, 18.282, 18.18885, 
+    18.2684, 17.89222, 18.11773, 17.9696, 17.98706, 18.13735, 18.16429, 
+    18.08441, 18.36069, 18.20909, 17.65261, 17.53615, 18.3952, 18.41538, 
+    18.39667, 18.05, 17.35333, 18.0475, 17.535, 18.7775, 18.1575, 17.675, 
+    17.95, 17.955, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, 20.93186, 20.60049, 20.2471, 19.79324, 19.51, 
+    20.53389, 20.94921, 20.77163, 20.8175, 20.5155, 20.31385, 20.31436, 
+    20.18229, 19.72359, 19.63921, 19.46027, 19.55216, 19.35684, 19.11049, 
+    19.47757, 19.23235, 19.25889, 19.32182, 19.41536, 19.10143, 19.1881, 
+    19.6, 19.30125, 19.3797, 19.49294, 19.64322, 19.50692, 19.84917, 19.668, 
+    19.9475, 20.62143, 20.30636, 19.87143, 19.89375, 20.56, 20.45, 20.36667, 
+    20.81, 20.05, 21.05556, 21.25429, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, 22.47425, 21.85952, 21.84143, 21.67242, 21.26081, 
+    20.7927, 20.92861, 21.7425, 21.75939, 21.64474, 21.43823, 21.58083, 
+    21.55763, 21.18027, 20.80526, 20.97324, 20.94243, 20.91075, 20.9759, 
+    20.48342, 20.53075, 20.58128, 20.37769, 20.471, 20.40588, 20.42111, 
+    20.44206, 20.7397, 20.69444, 21.3275, 21.19823, 21.20909, 21.16613, 
+    21.46906, 21.54882, 21.68958, 21.17778, 21.40125, 21.775, 21.64769, 
+    21.61667, 22.205, 22.46667, 22.13333, 21.83125, 21.863, 21.64429, 21.475, 
+    22.6, 22.47143, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, 24.43647, 23.85026, 23.27944, 22.97083, 22.615, 22.21424, 
+    22.085, 21.80182, 21.89467, 22.55305, 22.63636, 22.63889, 22.53231, 
+    22.70846, 22.44364, 22.20588, 21.85966, 22.06618, 22.30382, 22.27536, 
+    21.6375, 21.57389, 21.74108, 21.4322, 21.47875, 21.63286, 21.77829, 
+    21.86952, 21.91146, 21.90132, 21.84622, 22.20545, 22.75091, 22.4992, 
+    23.0575, 22.62286, 22.48594, 23.34182, 23.222, 22.98778, 22.74179, 
+    23.14913, 23.19667, 23.14533, 22.713, 23.06, 22.6, 22.00333, 21.63, 
+    23.35, 22.51, 22, 22.02625, 22, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, 25.52923, 24.68053, 24.36487, 24.04077, 23.83122, 23.62175, 
+    23.42026, 23.22051, 23.2075, 23.35, 23.4505, 23.59425, 23.52513, 
+    23.30143, 23.34514, 23.53314, 23.1706, 23.26083, 23.18059, 22.89567, 
+    22.99032, 22.96767, 22.78148, 22.8032, 22.6863, 23.03219, 22.76968, 
+    22.81486, 23.05842, 23.1027, 22.93289, 23.195, 23.35537, 23.38475, 
+    23.89722, 24.05029, 24.36345, 24.46091, 24.3215, 23.96719, 24.235, 
+    24.36355, 24.05308, 24.06417, 24.33125, 24.43, 23.99364, 23.46571, 
+    23.2375, 22.6925, 22.81, 23.14444, 23.09889, 23.05429, 22.91143, 23.2425, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, 25.87561, 25.655, 25.13051, 24.71972, 24.86025, 24.71049, 
+    24.44102, 24.53289, 24.31763, 24.37943, 24.7371, 24.79031, 24.50513, 
+    24.00636, 24.49678, 24.37241, 24.1352, 24.7813, 24.12967, 23.79086, 
+    24.22257, 24.25394, 24.22138, 24.0071, 24.23414, 24.516, 24.5537, 
+    24.32045, 24.20214, 24.0535, 24.1204, 24.06588, 24.37421, 24.51051, 
+    24.6055, 24.64122, 24.92951, 25.04525, 25.18062, 25.43, 25.08917, 
+    24.79909, 24.99, 25.09774, 24.64583, 24.6476, 24.80667, 24.69437, 
+    24.75769, 24.38778, 23.592, 23.465, 24.04, 23.8675, 23.305, 22.98, 
+    22.80714, 22.8525, 22.64667, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, 27.752, 26.44359, 26.39707, 26.02, 25.60963, 25.55282, 25.41055, 
+    25.44256, 25.13325, 25.28975, 25.27342, 25.2075, 25.26121, 25.40071, 
+    25.08368, 25.062, 25.16722, 24.86903, 25.19964, 25.43889, 25.31138, 
+    25.17969, 25.116, 25.31484, 24.77704, 25.0512, 24.84611, 24.86577, 
+    25.27759, 25.45516, 25.41387, 25.38852, 25.0065, 25.4775, 25.4163, 
+    25.30281, 25.52594, 25.67486, 25.55, 25.67488, 25.90325, 25.81, 25.72129, 
+    25.6896, 25.48448, 25.43, 25.18222, 25.20407, 24.90731, 25.10667, 
+    24.60714, 24.259, 24.8125, 24.134, 24.1, 23.65, 23.4, 22.55, 22.65667, 
+    23.27143, 21.894, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, 27.73333, 27.13538, 27.12897, 27.09111, 26.71359, 25.94, 26.025, 
+    26.15958, 26.10636, 26.19258, 26.194, 25.99594, 26.2703, 26.04757, 
+    26.33102, 26.06861, 26.025, 26.55103, 26.01875, 26.18903, 26.02375, 
+    26.26677, 26.21867, 26.37353, 26.24805, 26.23788, 26.18344, 26.00815, 
+    26.22667, 25.88647, 26.13917, 26.015, 26.28424, 26.51719, 26.68692, 
+    26.34708, 26.21619, 26.24231, 26.42846, 26.29414, 26.33367, 26.29412, 
+    26.0021, 26.1265, 26.08385, 26.15, 25.89542, 25.68813, 25.53767, 25.3996, 
+    24.7872, 24.55833, 24.93182, 24.19417, 24.77, 23.3575, 23.375, 23.075, 
+    23, 23.21333, 22.87375, 22.213, 21.56467, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, 27.86289, 27.69297, 27.88656, 27.485, 27.06225, 26.835, 26.30833, 
+    26.93931, 26.78667, 27.18417, 26.91931, 27.08937, 26.90543, 27.03097, 
+    27.22263, 26.9131, 26.99138, 27.13706, 26.85636, 27.05765, 26.99394, 
+    27.10357, 27.36667, 27.51088, 27.43303, 27.00677, 27.20029, 27.07868, 
+    26.79625, 27.19379, 26.89, 27.01389, 26.78214, 27.04423, 27.21618, 
+    27.13658, 27.27526, 27.16, 27.07895, 26.64652, 26.78571, 26.64296, 
+    26.52767, 26.23, 26.11128, 26.09975, 25.94205, 25.86846, 25.5969, 
+    25.34033, 25.15867, 24.63963, 24.56417, 24.73333, 24.03583, 23.96428, 
+    23.6, 23.54714, 23.115, 22.57929, 22.03727, 21.68412, 21.855, 21.33714, 
+    21.34389, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    27.15, 28.17316, 27.95263, 28.27833, 28.10303, 27.93555, 27.696, 28.013, 
+    27.75518, 27.54839, 28.04889, 27.77052, 27.90961, 27.966, 27.73621, 
+    27.7703, 27.86611, 27.77065, 27.7808, 27.82294, 27.81125, 27.94517, 
+    27.856, 27.88853, 28.04969, 27.77156, 27.85057, 27.88559, 27.90781, 
+    27.75529, 27.91263, 27.91917, 28.03912, 27.553, 27.454, 27.57542, 27.5, 
+    27.47333, 27.70724, 27.66865, 27.5554, 27.32367, 27.04864, 26.9444, 
+    26.7872, 26.61231, 26.37375, 26.26293, 26.0693, 25.777, 25.48538, 
+    25.44552, 25.18515, 24.6975, 24.46774, 24.12, 24.10125, 23.8, 23.62417, 
+    23.02778, 22.78067, 22.15417, 22.23692, 21.69667, 21.04667, 22.08067, 
+    21.98429, 21.76312, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    28.43838, 28.5382, 28.94077, 28.90708, 28.48706, 28.50457, 28.13655, 
+    28.40788, 28.2425, 28.11, 28.42696, 28.33381, 28.52917, 28.11571, 
+    28.21111, 28.38167, 28.43793, 28.03219, 28.39816, 28.45421, 28.16102, 
+    28.324, 28.16733, 28.08448, 28.20357, 28.09091, 28.37515, 28.41571, 
+    28.37103, 28.4275, 28.35368, 28.34528, 28.1921, 28.04026, 28.14514, 
+    28.03241, 27.92956, 27.8385, 27.96556, 27.79583, 27.47353, 27.43687, 
+    27.4859, 27.28714, 26.87826, 26.72042, 26.416, 26.20385, 26.13219, 
+    25.9755, 25.50463, 25.2835, 24.96737, 24.82914, 24.24788, 24.19032, 
+    23.70071, 23.8195, 23.3945, 22.71118, 22.856, 22.60555, 22.00833, 
+    21.7875, 22.39444, 22.32824, 22.40875, 22.835, 22.33222, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 30.805, 30.065, 
+    30.275, 28.7376, 28.77947, 28.90346, 28.80067, 29.00829, 28.83823, 
+    28.81457, 28.7469, 28.77258, 28.6954, 28.82111, 28.56286, 28.59192, 
+    28.66286, 28.6228, 28.8155, 28.9845, 28.26333, 28.96692, 28.87321, 
+    28.83265, 28.96412, 28.99031, 28.83581, 28.73943, 28.65219, 28.80111, 
+    28.70118, 28.55743, 28.54032, 28.67793, 28.32063, 28.47885, 28.58375, 
+    28.41487, 28.46343, 28.15647, 28.21645, 28.22581, 28.15, 27.90278, 
+    27.47357, 27.45313, 27.35, 27.27193, 27.18444, 26.74471, 26.4463, 
+    26.31928, 25.89786, 25.799, 25.57371, 25.16425, 24.83738, 24.483, 
+    24.47649, 24.10375, 23.63586, 23.36548, 23.27524, 23.41278, 22.45857, 
+    22.50667, 23.098, 22.95636, 22.98769, 23.08813, 22.94417, 23.5025, 
+    22.61333, 20.69927, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 29.9, 29.94, 
+    29.46714, 29.21316, 29.10447, 28.41111, 29.04059, 29.21515, 29.07853, 
+    29.09361, 29.11057, 28.91567, 28.90875, 29.17545, 29.37483, 29.00071, 
+    29.16273, 29.08783, 28.83, 28.75, 29.05, 28.77045, 28.53, 29.24812, 
+    29.225, 28.86944, 28.9948, 29.05067, 29.088, 29.42, 29.67526, 29.06333, 
+    29.05095, 29.13895, 28.65438, 28.37, 28.43963, 28.56367, 28.63057, 
+    28.39026, 28.39054, 28.18886, 27.92571, 27.985, 27.80061, 27.7069, 
+    27.50074, 27.35857, 27.3725, 27.32, 26.80556, 26.41543, 26.26118, 
+    26.09094, 25.77818, 25.3569, 24.91303, 24.96706, 24.69947, 24.28046, 
+    24.12205, 23.83512, 23.58306, 23.219, 23.38174, 23.25143, 22.91889, 
+    23.10333, 23.347, 23.73706, 23.92333, 24.038, 24.0875, 22.94389, 
+    19.95833, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 29.60333, 29.17359, 
+    29.23195, 29.00442, 29.07905, 29.05325, 29.28818, 29.0071, 28.95313, 
+    28.96871, 28.8997, 29.29286, 29.285, 29.35793, 29.34619, 29.61, 29.16917, 
+    29.11555, 29.35739, 29.094, 29.25222, 29.444, 29.13889, 29.26059, 28.924, 
+    29.15833, 29.34296, 28.8013, 29.1837, 29.07839, 29.07125, 28.652, 
+    29.11412, 29.032, 28.78437, 29.01722, 28.574, 28.6725, 28.881, 28.72381, 
+    28.13205, 28.13897, 28.20757, 27.83513, 27.56306, 27.41919, 27.35914, 
+    27.33117, 27.13778, 26.92273, 26.56074, 26.489, 26.17555, 26.17148, 
+    25.67222, 25.78083, 25.41944, 25.13472, 24.89972, 24.62303, 24.32818, 
+    24.09975, 23.91535, 23.94163, 23.7341, 23.41548, 23.6795, 23.25455, 
+    23.46067, 24.10929, 24.11565, 24.34074, 24.39778, 23.66862, 21.8019, 
+    19.59273, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 28.9315, 28.94829, 
+    28.90325, 29.0055, 29.215, 28.79143, 29.1225, 28.69345, 29.03708, 29.295, 
+    29.26706, 29.51344, 29.52714, 29.47839, 29.60913, 29.345, 29.56312, 
+    29.42185, 29.84714, 29.15631, 29.3185, 29.08125, 29.64, 29.098, 29.57, 
+    29.32, 29.50714, 29.53875, 29.22778, 28.9944, 29.235, 29.0144, 28.8724, 
+    29.208, 29.06667, 28.561, 28.7, 28.68714, 28.31278, 27.96937, 28.20214, 
+    28.31, 27.87344, 28.09, 27.79, 27.5556, 27.38, 27.08222, 26.86559, 
+    26.75513, 26.54351, 26.31743, 26.17441, 26.03971, 25.625, 25.69478, 
+    25.62067, 25.32194, 25.04343, 24.97605, 24.82294, 24.38886, 24.11581, 
+    24.18611, 24.11325, 24.14953, 24.00976, 24.03471, 24.27133, 24.56833, 
+    24.3612, 24.495, 24.71867, 24.5681, 22.83692, 21.11, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 28.47286, 28.8756, 28.90454, 
+    29.06655, 29.15852, 31, 29.55, 27.8, 27.75, 29.50593, 29.32059, 29.44032, 
+    29.66471, 29.55389, 29.50182, 29.585, 29.365, 29.76947, 29.38545, 
+    29.30353, 29.16529, 29.1375, 29.24357, 29.32857, 28.74, 29.14111, 28.924, 
+    28.93, 28.96308, 29.14087, 29.14956, 29.03733, 28.92914, 28.6036, 
+    28.32821, 28.6625, 28.51, 28.47556, 28.33529, 28.29118, 27.76583, 
+    27.31143, 27.6425, 27.43161, 27.0025, 27.79, 27.19444, 26.48928, 
+    26.53136, 26.4495, 26.29545, 25.95375, 25.87171, 25.64611, 25.59658, 
+    25.63513, 25.57579, 25.35303, 25.1069, 24.95581, 24.88273, 24.74829, 
+    24.60206, 24.48323, 24.32643, 24.21533, 24.15732, 24.24884, 24.54667, 
+    24.64055, 24.68655, 24.80631, 24.91533, 24.78273, 23.72333, 21.16286, 
+    19.69333, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, 28.85316, 28.97273, 29.02077, 
+    28.85355, 28.83516, 28.46667, _, _, _, 28.96961, 29.14853, 29.29158, 
+    29.54937, 29.60972, 29.48133, 29.37105, 29.01417, 29.6225, 29.68, 
+    29.42458, 29.13875, 29.17267, 28.98412, 29.16636, 29.23923, 29.47727, 
+    29.243, 28.65333, 28.84111, 28.7075, 28.95304, 28.69, 28.75261, 28.70273, 
+    28.03077, 28.1416, 27.82741, 28.13611, 28.077, 28.06444, 27.83611, 
+    27.15222, 26.4, 26.95625, 26.935, 26.69852, 27.20077, 26.95714, 25.948, 
+    26.165, 25.74182, 25.85842, 25.7604, 25.52652, 25.6764, 25.58353, 
+    25.31811, 25.02, 24.93684, 24.82538, 24.64222, 24.64182, 24.49645, 
+    24.41189, 24.57325, 24.418, 24.49286, 24.33655, 24.53281, 24.51905, 
+    24.6769, 24.83921, 25.22697, 25.17, 24.49321, 23.64387, 21.52786, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, 29.03185, 28.84784, 28.93071, 
+    28.93187, 28.93896, 28.48333, 28.55, 28.38, 28.27091, 28.89424, 28.93265, 
+    28.83043, 29.6108, 29.53387, 29.44278, 29.43586, 28.72077, 29.38294, 
+    29.46941, 29.51923, 29.43304, 29.11875, 29.34737, 29.11636, 28.66667, 
+    29.07933, 28.88952, 29.00588, 28.624, 28.49333, 28.59222, 28.68786, 
+    27.99042, 28.24636, 28.22794, 27.89545, 27.83682, 27.60179, 27.31846, 
+    27.88278, 27.07714, 27.28056, 26.7347, 26.61571, 26.1025, 26.71917, 
+    26.25194, 26.25917, 26.17615, 25.59375, 25.91091, 25.2, 25.71, 25.71118, 
+    25.35533, 25.60048, 25.465, 25.22476, 24.8752, 24.682, 24.69, 24.37833, 
+    24.35829, 24.15237, 24.25459, 24.18229, 24.15974, 24.165, 24.16077, 
+    24.32857, 24.41678, 24.2981, 24.60381, 24.69026, 24.90941, 24.58824, 
+    23.36889, 24.35714, 25.75, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, 29.65, 29.0125, 28.72303, 28.87067, 
+    28.9232, 28.96333, 28.8525, 28.79613, 28.86355, 29.04393, 28.66615, 
+    28.9604, 29.29043, 29.17621, 29.416, 29.43086, 29.33385, 29.19, 29.21875, 
+    29.12, 29.35714, 29.2247, 29.03708, 28.92158, 29.00455, 28.59077, 28.313, 
+    28.688, 28.20222, 28.86267, 27.97727, 27.80286, 28.29375, 27.9352, 
+    28.04611, 27.85129, 27.54812, 27.5588, 26.82091, 27.03724, 26.65786, 
+    26.55619, 27.35905, 26.5175, 26.29445, 26.008, 26.17, 26.017, 25.30154, 
+    26.32187, 25.40727, 25.506, 26.1425, 25.02083, 25.12667, 25.20056, 
+    24.73875, 23.88818, 24.31143, 24.47167, 24.58647, 24.47682, 24.35625, 
+    24.02406, 23.96162, 24.08541, 23.86317, 23.75947, 23.95194, 24.04806, 
+    24.28073, 24.21256, 24.38606, 24.45667, 24.70976, 24.92256, 24.82, 
+    24.59827, 25.43524, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 28.45135, 28.59138, 28.54667, 28.41515, 
+    28.51437, 28.48, 28.7284, 28.78231, 28.69633, 28.84333, 29.02926, 
+    28.91091, 29.04625, 28.976, 29.0332, 29.17533, 29.39257, 29.24879, 
+    29.51316, 29.32357, 29.23941, 28.78933, 28.85769, 29.122, 29.08875, 
+    29.24923, 28.64375, 27.89545, 28.48125, 28.59, 28.07933, 28.28389, 
+    28.41474, 27.91529, 27.61643, 27.58562, 27.68, 27.42692, 27.49548, 
+    27.2532, 26.94375, 26.61542, 26.45687, 26.49471, 26.58762, 26.07937, 
+    25.91067, 26.16706, 25.90187, 25.96833, 25.96697, 25.82778, 25.2975, 
+    25.66, 25.18056, 25.06, 25.08267, 24.94235, 24.59421, 24.81944, 24.78421, 
+    24.53938, 24.26714, 24.2075, 24.37227, 24.49454, 24.90105, 24.96038, 
+    24.96571, 24.80842, 24.71929, 24.9, 25.26732, 25.72927, 25.76781, 
+    26.07767, 25.97368, 25.81548, 25.84667, 25.88353, 26.14286, 26.29576, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, 27.41429, 28.28735, 28.11516, 28.1973, 
+    28.38605, 28.14139, 28.10229, 28.45818, 28.5464, 28.6325, 28.79034, 
+    28.95, 28.87444, 28.875, 28.87643, 29.073, 28.94533, 28.91294, 29.05281, 
+    28.892, 29.27692, 29.08824, 28.99667, 28.9425, 29.041, 28.88182, 
+    28.80727, 27.91909, 28.81, 28.47429, 28.36444, 28.01083, 27.97333, 
+    28.2525, 28.28312, 27.94364, 27.60714, 27.773, 27.59, 27.47097, 27.44733, 
+    27.53423, 27.29958, 26.87923, 26.89687, 26.56242, 26.18, 26.54231, 
+    26.86941, 26.80812, 26.23412, 26.2025, 26.66133, 26.47692, 26.47, 
+    25.81722, 25.74, 25.61053, 25.72667, 25.47846, 25.36428, 25.59412, 
+    25.88111, 26.04278, 25.51294, 26.12933, 25.81063, 25.33529, 25.92533, 
+    25.76571, 26.34316, 26.4413, 26.08346, 26.04703, 26.36341, 26.59732, 
+    26.6869, 27.04023, 27.08465, 26.82976, 26.89488, 26.45, 26.65171, 
+    26.94808, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, 27.27976, 27.23, 28.00343, 28.27522, 28.33057, 
+    28.00323, 28.05382, 28.12606, 28.30778, 28.30792, 28.49759, 28.33097, 
+    28.7136, 28.49958, 28.48148, 28.84586, 28.574, 28.68303, 28.76351, 
+    28.60966, 28.78125, 28.89238, 28.96545, 28.7465, 29.08857, 28.877, 
+    28.76429, 28.97, 28.81727, 28.56937, 28.42235, 28.34308, 28.33, 28.246, 
+    28.06312, 28.41238, 28.1219, 28.13789, 27.94929, 27.87794, 27.72647, 
+    27.70178, 27.5452, 27.51437, 27.48567, 27.41903, 27.12687, 27.09483, 
+    27.60095, 26.96895, 27.08053, 27.1305, 26.90379, 26.83571, 26.88414, 
+    27.01407, 26.75043, 26.7235, 26.72437, 26.78437, 26.61333, 26.9585, 
+    26.83526, 26.90375, 27.0075, 27.59667, 26.93375, 26.92833, 27.01167, 
+    26.918, 26.8985, 26.71071, 26.80313, 26.66565, 27.23087, 26.92762, 
+    26.85703, 26.91703, 27.20452, 27.52571, 27.62395, 27.48302, 26.77535, 
+    26.57974, 27.11515, _, _, _, _, _, _, _, _, _, 27.8, 28, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, 26.69406, 27.21442, 27.44488, 27.59205, 27.49564, 
+    28.25529, 28.04538, 27.90086, 28.05057, 27.92103, 28.04939, 28.22636, 
+    28.32323, 28.37034, 28.29812, 28.43636, 28.60034, 28.3397, 28.54346, 
+    28.52361, 28.66077, 28.80538, 28.70448, 28.77393, 28.73826, 28.57333, 
+    28.79261, 28.92, 28.686, 28.48625, 28.40071, 28.288, 28.06824, 27.8375, 
+    27.89824, 28.10538, 27.72812, 27.64556, 27.82208, 27.94091, 28.06414, 
+    27.71706, 27.72441, 27.4775, 27.46696, 27.53839, 27.46733, 27.32103, 
+    27.14167, 27.09829, 26.7824, 27.10417, 27.08071, 27.02312, 26.93303, 
+    26.89364, 26.92364, 27.04926, 26.5184, 26.5084, 26.90276, 26.86741, 
+    26.76321, 26.794, 26.7776, 26.92958, 26.93037, 27.03261, 26.9852, 26.981, 
+    26.975, 26.75258, 26.9925, 27.01677, 27.08406, 26.82187, 26.67838, 
+    26.575, 26.63861, 26.75706, 27.50974, 28.00488, 28.24659, 27.65864, 
+    26.77209, 27.96143, _, _, _, _, _, _, _, _, 26.88692, 27.15151, 26.83953, 
+    26.99204, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, 26.07442, 26.46842, 26.58125, 27.36976, 27.38524, 
+    27.40049, 27.4075, 27.42139, 27.68811, 27.86235, 28.02265, 28.11182, 28, 
+    28.19088, 28.33121, 27.88207, 28.07355, 28.05364, 28.09057, 28.29844, 
+    28.17486, 28.36348, 28.30238, 28.07692, 27.93478, 28.0045, 28.0569, 
+    28.05781, 27.95571, 27.95414, 27.76947, 27.99294, 27.90588, 28.20933, 
+    27.72688, 27.12909, 27.10727, 27.41, 27.31333, 27.49636, 27.23278, 
+    27.46222, 27.39743, 27.43457, 26.96187, 27.27353, 27.10677, 27.08031, 
+    26.87269, 26.78577, 26.91118, 26.62967, 26.73375, 26.61364, 26.85678, 
+    26.52133, 26.16071, 26.06714, 26.42, 26.51429, 26.62444, 26.60188, 
+    26.59231, 26.69214, 26.62533, 26.72684, 26.995, 26.7775, 26.89429, 
+    27.2065, 27.05318, 27.07954, 27.12261, 27.12731, 27.12821, 27.11562, 
+    26.85816, 26.65778, 26.49474, 25.98262, 25.71405, 26.8093, 28.00477, 
+    28.30773, 27.20615, 27.00395, 27.31652, 27.74429, 28, 27.77143, _, _, _, 
+    26.8, 27.12222, 27.03233, 26.93636, 26.91409, 26.885, 26.88432, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, 25.21721, 25.99814, 26.34286, 26.6045, 26.9975, 27.16341, 
+    27.00309, 26.96864, 27.25897, 27.50512, 27.78795, 27.868, 27.87812, 
+    28.00935, 27.87323, 27.87389, 27.89111, 28.00294, 27.86474, 27.86088, 
+    27.85108, 27.93865, 27.93528, 27.88778, 28.02625, 28.06406, 27.91258, 
+    28.02844, 27.73333, 27.54833, 27.64053, 27.61333, 27.48667, 27.42103, 
+    27.09864, 26.73476, 27.13143, 26.97462, 27.01769, 26.77667, 26.86059, 
+    26.62174, 26.483, 26.61806, 26.76459, 26.79531, 26.41632, 26.42391, 
+    26.65379, 26.2036, 26.1, 25.92148, 25.92057, 25.90161, 25.70583, 25.6972, 
+    25.49893, 25.57788, 25.48103, 25.85964, 26.1113, 25.79857, 25.64429, 
+    25.50389, 25.99591, 26.1428, 26.72048, 26.3715, 27.04545, 27.03385, 
+    27.30172, 27.21125, 27.41687, 27.455, 27.51555, 27.13514, 27.11732, 
+    26.91585, 27.09548, 26.9878, 26.87864, 26.23204, 26.25767, 27.35263, 
+    27.32025, 27.18167, 27.08659, 26.88326, 26.23045, 25.73925, 26.108, 
+    26.32951, 26.1307, 25.83442, 26.48432, 26.77841, 26.89273, 26.85068, 
+    26.87091, 26.74159, 26.56167, 26.55805, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, 24.5831, 25.65488, 25.97651, 26.3119, 26.89595, 27.02881, 
+    26.94442, 26.6861, 27.13318, 27.33372, 27.62814, 27.69571, 27.75907, 
+    27.83232, 27.85925, 27.86488, 27.80683, 27.79349, 27.75366, 27.77857, 
+    27.78829, 27.97842, 27.71378, 27.71, 27.61241, 27.28545, 27.29619, 
+    27.23593, 27.71428, 27.3296, 26.95958, 27.1369, 26.81871, 27.10033, 
+    27.02241, 27.10133, 26.78903, 26.54917, 26.54526, 26.35913, 26.49937, 
+    26.16136, 26.0264, 26.20571, 26.11583, 26.17784, 25.87538, 25.91733, 
+    25.82731, 25.63125, 25.76036, 25.45333, 25.32965, 25.24647, 25.11806, 
+    24.93033, 25.36897, 25.17097, 25.02483, 24.92345, 25.08621, 25.29167, 
+    25.49538, 25.33107, 25.78857, 26.09387, 26.26484, 26.53469, 26.65219, 
+    27.08059, 27.15628, 27.37886, 27.59027, 27.87976, 27.93268, 27.8078, 
+    27.45341, 26.9319, 26.18295, 27.21136, 27.55349, 27.07452, 26.82286, _, 
+    27.19294, 27.06146, 26.96364, 26.80186, 26.52, 25.84186, 26.07614, 
+    26.64767, 26.89, 26.81227, 26.82302, 26.7214, 26.65023, 26.66476, 
+    26.71309, 26.57049, 26.47595, 26.27405, 26.0778, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, 24.40048, 24.69691, 25.30488, 25.69691, 25.67024, 26.92, 
+    27.03432, 26.26607, 26.69951, 27.105, 27.08163, 27.3193, 27.42429, 
+    27.62952, 27.56167, 27.52643, 27.61929, 27.58432, 27.61386, 27.655, 
+    27.62341, 27.5075, 27.50714, 27.34314, 27.26974, 27.10083, 27.03118, 
+    27.01357, 27.326, 27.3337, 27.27231, 26.90357, 26.75541, 26.6437, 
+    26.41562, 26.37233, 26.54853, 26.56513, 26.52, 26.25193, 26.12115, 
+    26.31048, 25.7821, 25.6884, 25.81821, 25.55622, 25.50636, 25.66097, 
+    25.1424, 25.18367, 25.2471, 24.97067, 25.11686, 24.99419, 24.80686, 
+    24.65, 24.68469, 24.52394, 24.31343, 24.62788, 24.64228, 24.73714, 
+    24.64879, 24.76969, 25.18267, 25.65, 25.72486, 26.15757, 26.30294, 
+    26.46575, 26.63902, 27.00293, 27.47146, 27.84756, 28.084, 28.14429, 
+    28.02, 27.27455, 26.03295, 27.64093, 27.8968, 26.22857, 26.928, 26.81, 
+    26.92622, 27.01341, 27.04171, 26.88091, 26.69405, 26.68452, 26.76333, 
+    26.85159, 26.76727, 26.75682, 26.72326, 26.75333, 26.36651, 26.26163, 
+    26.16023, 26.20302, 26.13857, 25.83667, 25.7682, 25.45971, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, 23.62882, 23.85324, 23.89429, 24.26581, 24.421, 24.93256, 
+    25.50455, 26.28591, 26.43839, 26.13615, 26.30897, 26.33905, 26.59535, 
+    26.85791, 27.10558, 27.16628, 27.1507, 27.24182, 27.2493, 27.24857, 
+    27.26658, 27.38428, 27.30636, 27.42795, 27.30182, 27.16341, 27.14477, 
+    27.00909, 26.864, 26.79921, 26.59595, 26.6855, 26.46692, 26.27806, 
+    26.3627, 26.18029, 26.39235, 26.36217, 26.23036, 26.18606, 26.14273, 
+    25.95846, 25.92158, 25.96857, 25.63178, 25.5971, 25.48051, 25.39368, 
+    25.07805, 24.91464, 24.95, 24.78784, 24.63394, 24.38853, 24.34829, 
+    24.16936, 23.99886, 23.72324, 23.75176, 23.61229, 23.48353, 23.61857, 
+    23.76114, 23.82417, 23.90108, 24.08167, 24.01902, 24.42707, 24.79951, 
+    25.28415, 25.73171, 26.17439, 26.31882, 26.61314, 26.83905, 27.49818, 
+    27.90182, 28.02409, 27.24444, 25.63139, 27.47143, _, 26.45259, 27.0695, 
+    26.822, 26.8593, 26.87833, 26.93595, 26.98614, 26.91636, 27.05976, 
+    26.61209, 26.57182, 26.70325, 26.49, 26.51186, 26.29929, 26.19279, 
+    26.02116, 25.79024, 25.84302, 25.73805, 25.68902, 25.34488, 25.35553, 
+    25.11575, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, 22.63833, 22.37156, 23.43088, 23.17048, 23.09721, 23.33232, 
+    23.83628, 24.43643, 25.09227, 25.64341, 25.52524, 25.5414, 25.32905, 
+    25.68381, 25.90146, 26.12762, 26.31186, 26.39227, 26.52954, 26.75045, 
+    26.79795, 26.7378, 26.76725, 26.96683, 26.86732, 26.78317, 26.73786, 
+    26.5275, 26.68023, 26.70116, 26.50628, 26.34814, 26.25209, 26.10954, 
+    26.08204, 25.99605, 25.995, 25.91878, 25.86925, 25.91658, 25.785, 
+    25.6378, 25.6078, 25.45476, 25.5595, 25.49829, 25.29452, 25.0365, 
+    24.94714, 24.87049, 24.52425, 24.24108, 24.19944, 23.99054, 23.88371, 
+    23.68811, 23.53131, 23.47875, 23.2341, 23.099, 22.92564, 22.72854, 
+    22.53537, 22.53537, 22.57902, 22.6439, 22.94317, 23.03634, 23.1003, 
+    23.55714, 23.80735, 23.99029, 24.68108, 24.78111, 25.05273, 26.20273, 
+    27.12791, _, _, 23.78444, 23.79615, 24.49545, 24.40765, 26.38571, 
+    27.0339, 26.81683, 26.7719, 26.80119, 26.82952, 26.93114, 26.77386, 
+    26.82791, 26.40463, 26.38714, 26.32721, 26.19512, 26.04907, 25.93512, 
+    25.86119, 25.81116, 25.62674, 25.4286, 25.35884, 25.253, 25.0407, 
+    24.96721, 24.87561, 24.54833, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, 20.3295, 20.76583, 20.94714, 21.49953, 21.90977, 22.8569, 
+    23.74651, 24.41465, 24.19605, 24.12071, 24.49619, 24.43818, 24.54614, 
+    24.70721, 25.07714, 25.08415, 25.38953, 25.70024, 25.95786, 25.82571, 
+    26.00756, 26.2485, 26.20308, 26.33095, 26.32024, 26.17167, 25.97714, 
+    25.96884, 25.7807, 25.72195, 25.5181, 25.576, 25.50302, 25.64511, 
+    25.60364, 25.39955, 25.21523, 25.21045, 25.07302, 24.9714, 24.84465, 
+    24.72558, 24.78227, 24.68341, 24.56591, 24.52886, 24.57682, 24.595, 
+    24.27488, 24.0119, 23.89214, 23.73381, 23.52854, 23.24429, 23.13929, 
+    22.90786, 22.80048, 22.7014, 22.42667, 22.18048, 22.04512, 21.80368, 
+    21.564, 21.48167, 21.28944, 21.53125, 21.24441, 21.344, 21.50059, 
+    22.02703, 22.39389, 23.30024, 23.44296, 24.42295, 24.51259, _, _, _, 
+    22.77909, 24.05975, 23.9539, 24.1365, 24.55115, 26.48595, 26.42209, 
+    26.46186, 26.59093, 26.45512, 26.04442, 26.17204, 26.24256, 26.0993, 
+    25.95884, 25.92262, 25.68419, 25.50651, 25.43907, 25.3493, 25.35233, 
+    25.19488, 25.00233, 24.93, 24.72581, 24.66395, 24.465, 24.30256, 
+    24.20357, 24.10875, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, 17.96333, 18.57818, 18.30209, 19.84302, 23.60326, 
+    23.66024, 23.14524, 23.19667, 23.09829, 23.44227, 23.6807, 23.93875, 
+    23.96829, 24.20905, 24.3986, 24.76116, 24.70955, 25.05262, 25.09575, 
+    25.11125, 25.09732, 25.2275, 25.1269, 25.10238, 25.07833, 24.73219, 
+    24.96707, 24.90125, 24.66, 24.6181, 24.50341, 24.41476, 24.483, 24.41439, 
+    24.23452, 24.11317, 24.01209, 23.98116, 24.0186, 24.06535, 24.05907, 
+    24.07744, 23.94795, 23.86023, 23.82744, 23.68273, 23.51704, 23.26977, 
+    23.19857, 22.98725, 22.95425, 22.54838, 22.30341, 21.77257, 21.99143, 
+    21.73212, 21.45486, 20.99615, 20.76622, 20.42781, 20.31111, 20.23118, 
+    20.04382, 19.92857, 19.568, 19.80722, 20.27, 21.2335, 21.91409, 22.76273, 
+    22.85559, 23.8, _, _, _, 22.74927, 23.73927, 23.84024, 24.0139, 24.19405, 
+    25.51951, 25.97465, 25.61214, 25.49333, 25.63927, 25.59268, 25.41545, 
+    25.36395, 25.46, 25.30581, 25.27333, 25.15256, 25.00256, 24.87512, 
+    24.79302, 24.65651, 24.52721, 24.47884, 24.23977, 24.11571, 24.03136, 
+    23.9786, 23.87372, 23.73326, 23.63975, 23.41073, 23.09462, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, 20.90583, 16.84643, 17.77561, 22.55209, 
+    22.71791, 22.38167, 22.28767, 22.05349, 22.34952, 22.56619, 22.43308, 
+    22.7665, 23.07154, 23.26781, 23.38428, 23.74049, 23.76863, 23.91357, 
+    23.98977, 23.95425, 23.8261, 23.88372, 23.82476, 23.79048, 23.87428, 
+    23.63415, 23.58047, 23.6639, 23.48048, 23.3519, 23.19357, 23.2881, 
+    23.29073, 23.38619, 23.25372, 23.34333, 23.27791, 23.07857, 22.7461, 
+    22.78667, 22.9195, 22.9078, 22.89293, 22.71537, 22.92907, 22.91909, 
+    22.64432, 22.3275, 22.12721, 21.91024, 21.58415, 21.46795, 21.22086, 
+    20.975, 20.84553, 20.46667, 19.86795, 19.64167, 19.39912, 19.02083, 
+    19.03139, 18.84389, 18.62057, 18.71444, 18.8269, 19.94512, 20.89256, 
+    21.02781, 22.16, _, _, _, _, 22.15294, 22.90975, 23.10951, 23.23048, 
+    23.96186, 24.8593, 24.22023, 23.68523, 24.25523, 24.91488, 24.26628, 
+    24.56636, 24.35452, 24.29953, 24.50488, 24.4086, 24.23977, 24.21071, 
+    24.12442, 24.09186, 23.89884, 23.7914, 23.69419, 23.64477, 23.47295, 
+    23.32791, 23.31256, 23.19048, 23.09139, 22.96791, 22.83, 22.5405, 
+    22.31897, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 16.65, 16.81805, 19.30857, 20.53, 21.76558, 
+    21.68, 21.32419, 21.33256, 21.29357, 21.37488, 21.37425, 21.59102, 
+    22.00024, 22.37439, 22.1945, 22.32829, 22.23707, 22.40317, 22.42976, 
+    22.29683, 22.2681, 22.00256, 22.12093, 22.2386, 22.20325, 22.25227, 
+    22.14558, 22.14791, 22.09643, 21.9969, 22.01738, 21.97238, 21.85372, 
+    21.75683, 21.70714, 21.60857, 21.63762, 21.77756, 21.6255, 21.59139, 
+    21.63767, 21.66907, 21.77073, 21.82809, 21.8807, 21.95977, 21.83209, 
+    21.51932, 21.25568, 20.90318, 20.66047, 20.36098, 20.02275, 19.83103, 
+    19.57611, 19.30447, 18.87575, 18.63026, 18.47, 18.3325, 17.94382, 
+    17.50323, 17.25928, 17.83227, 19.04488, 19.19441, 22.325, _, _, _, _, _, 
+    19.76872, 21.73738, 22.17767, 22.29024, 23.07744, 23.75818, 23.1875, 
+    21.00073, 23.47932, 24.55279, 23.67738, 23.60704, 23.14116, 23.15721, 
+    23.22, 23.19837, 23.05767, 23.18674, 23.18605, 23.15326, 23.04744, 
+    22.95837, 22.81523, 22.76395, 22.70186, 22.53814, 22.40488, 22.33786, 
+    22.26738, 22.20186, 21.93548, 21.83884, 21.73268, 21.507, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, 15.36562, 15.47375, 17.24698, 20.08605, 
+    20.9293, 20.75786, 20.50186, 20.05767, 20.24071, 20.30744, 20.59512, 
+    20.43837, 20.51429, 20.55833, 20.5419, 20.56476, 20.55214, 20.51463, 
+    20.60286, 20.61905, 20.62907, 20.69, 20.4486, 20.34023, 20.50595, 
+    20.39714, 20.24209, 20.10614, 19.98488, 19.83349, 19.86209, 19.93558, 
+    19.9369, 19.98395, 20.12571, 20.10071, 20.10524, 20.16905, 20.19698, 
+    20.51442, 20.39927, 20.40024, 20.42929, 20.42619, 20.54262, 20.53442, 
+    20.66452, 20.48488, 20.10256, 19.81591, 19.53, 19.27419, 18.96744, 
+    18.56927, 18.30195, 18.02925, 17.87075, 17.4945, 17.26641, 16.65684, 
+    16.35543, 16.36068, 16.82744, 17.79545, 17.74444, _, _, _, _, _, _, 
+    17.91, 17.08, 19.05238, 19.83571, 20.84659, 20.61762, 20.89949, 21.63706, 
+    21.94691, 24.21864, 22.92139, 22.48523, 22.22767, 22.13045, 22.03512, 
+    21.92674, 21.88372, 21.86674, 21.91302, 22.07395, 22.04628, 21.9586, 
+    21.93114, 21.77628, 21.74139, 21.64953, 21.43954, 21.35256, 21.31674, 
+    21.26046, 21.17905, 20.97146, 20.92833, 20.67902, 20.57634, 20.33829, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 18.72143, 13.12857, 11.836, 14.43854, 
+    16.66744, 18.86023, 19.46372, 19.9407, 19.66786, 19.55976, 19.63628, 
+    19.50302, 19.47833, 19.30977, 19.19727, 19.20116, 19.31209, 19.23884, 
+    19.23558, 19.35326, 19.34452, 19.30744, 19.27163, 19.1207, 19.08651, 
+    19.05727, 18.93204, 18.81659, 18.63773, 18.53884, 18.47386, 18.41727, 
+    18.46091, 18.61628, 18.56628, 18.55227, 18.52, 18.5986, 18.59455, 
+    18.83047, 18.88302, 18.995, 19.04953, 19.17143, 19.20024, 19.32095, 
+    19.39721, 19.35628, 19.20116, 19.16476, 19.02023, 18.68636, 18.36512, 
+    18.24163, 17.97909, 17.50953, 16.98628, 16.48295, 16.003, 15.65262, 
+    15.25209, 15.23432, 15.68977, 17.85, 17.33333, _, _, _, _, _, _, _, _, _, 
+    _, 16.872, 14.92385, 17.41833, 17.02643, 23.1875, 19.68905, 23.84814, 
+    22.77139, 21.83932, 21.35372, 21.08024, 20.99302, 20.91814, 20.88116, 
+    20.95535, 20.87605, 20.84, 20.84364, 20.86907, 20.85395, 20.85186, 
+    20.78488, 20.74884, 20.66395, 20.46884, 20.41884, 20.40558, 20.33605, 
+    20.20767, 20.19952, 20.045, 19.81625, 19.75756, 19.56302, _, _, _, _, _, 
+    _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 15.03857, 9.195333, 9.523077, 13.14293, 
+    15.99786, 15.9807, 15.12886, 18.54907, 18.625, 18.17524, 18.38024, 
+    18.82256, 18.61419, 18.41881, 18.39884, 18.40907, 18.36605, 18.31232, 
+    18.14463, 17.91286, 18.08714, 18.02439, 18.04833, 17.78214, 17.68167, 
+    17.54732, 17.49, 17.30809, 17.28558, 17.26907, 17.05163, 17.02409, 
+    16.91095, 17.01238, 16.88442, 16.84186, 16.71442, 16.73159, 16.77364, 
+    16.94773, 17.14674, 17.32, 17.37581, 17.39977, 17.53395, 17.6314, 
+    17.69767, 17.79233, 17.81093, 17.77905, 17.74814, 17.65558, 17.52068, 
+    17.27068, 16.86614, 16.50233, 16.13558, 15.59295, 15.09605, 14.52791, 
+    14.12909, 14.75704, 14.84295, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, 14.56344, 20.27046, 22.12186, 22.11795, 21.00721, 20.43047, 
+    20.26093, 20.17535, 20.11279, 20.09093, 20.07909, 20.10409, 19.98791, 
+    19.99614, 19.96977, 19.94465, 19.93341, 19.87159, 19.78558, 19.6325, 
+    19.52864, 19.45791, 19.39, 19.42163, 19.42767, 19.2886, 19.20767, 
+    19.08698, 18.95581, 18.73442, 18.64093, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 10.382, 8.629032, 8.928205, 9.412927, 
+    11.79038, 14.88634, 14.0859, 13.38097, 12.62605, 16.08833, 16.04488, 
+    17.11619, 18.06928, 17.74191, 17.49976, 17.65659, 17.51073, 17.14762, 
+    16.95952, 16.76738, 16.77691, 16.73643, 16.72095, 16.995, 16.48714, 
+    16.52643, 16.33927, 16.2793, 16.13619, 16.13643, 15.93878, 15.73098, 
+    15.71244, 15.64929, 15.50619, 15.45381, 15.13674, 15.23814, 15.37333, 
+    15.39571, 15.50884, 15.60286, 15.78721, 15.86116, 16.01512, 16.10233, 
+    16.24605, 16.46837, 16.4707, 16.46886, 16.40773, 16.38136, 16.28409, 
+    16.12, 16.04318, 15.58886, 14.98818, 14.56114, 13.97605, 13.40159, 
+    13.34159, 14.05395, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, 17.42023, 20.52386, 20.87093, 20.22227, 19.93704, 19.89721, 
+    19.89791, 19.80595, 19.66318, 19.53977, 19.44977, 19.34341, 19.36909, 
+    19.21302, 19.07767, 18.96674, 18.85, 18.73512, 18.62349, 18.54114, 
+    18.46419, 18.37704, 18.28093, 18.18279, 18.05163, 17.98116, 18.02256, 
+    17.85279, 17.82159, 17.63167, 17.49682, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, 2.733333, 4.251071, 5.688919, 7.97027, 
+    5.90875, 12.35167, 12.58139, 12.36, 12.41758, 11.61964, 12.58833, 
+    13.44921, 14.84143, 15.27628, 14.63833, 14.89857, 15.61415, 15.26317, 
+    15.23732, 15.30415, 15.09659, 15.03244, 15.03732, 15.05146, 15.02195, 
+    14.85951, 14.96309, 14.89548, 14.87714, 14.57049, 14.5339, 14.65452, 
+    14.42357, 14.19512, 14.0419, 13.98, 14.04535, 13.96535, 13.99415, 
+    14.02929, 13.97786, 14.11372, 14.04238, 14.14762, 14.49535, 14.55163, 
+    14.72214, 14.71476, 14.7019, 15.00214, 15.13791, 15.18395, 15.14727, 
+    14.99864, 14.85186, 14.64116, 14.09955, 13.51409, 12.80227, 12.34773, 
+    12.555, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    6.451364, 10.35227, 17.23727, 19.28704, 20.07364, 19.85704, 19.78682, 
+    19.61488, 19.45605, 19.26159, 19.16636, 19.1393, 18.96977, 18.89535, 
+    18.62395, 18.55093, 18.35093, 18.09558, 17.86395, 17.7269, 17.60837, 
+    17.45535, 17.26907, 17.18744, 17.08674, 16.92163, 16.89814, 16.83116, 
+    16.79, 16.72571, 16.65409, 16.46682, 16.23295, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, 0.59, 2.1324, 3.849333, 5.6065, 7.779167, 
+    7.421428, 9.1425, 8.727667, 8.883667, 10.12, 9.796216, 10.41965, 
+    11.02743, 10.74047, 10.83293, 11.47167, 12.17214, 12.10698, 12.16791, 
+    12.40952, 12.80756, 12.9325, 12.80975, 12.79132, 12.87902, 13.18275, 
+    13.11929, 13.11357, 13.31786, 12.89659, 12.68585, 12.83415, 13.1461, 
+    13.10927, 12.56488, 12.55475, 12.54837, 12.56167, 12.57262, 12.63293, 
+    12.45738, 12.48219, 12.52714, 12.53163, 12.74405, 12.735, 12.72, 
+    12.91023, 13.13452, 13.38357, 13.40767, 13.50643, 13.60381, 13.775, 
+    13.79214, 13.79952, 13.49024, 13.15714, 12.64667, 11.82545, 11.72419, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 7.4236, 
+    7.50814, 9.973409, 13.18795, 14.31864, 15.69091, 16.99068, 18.03841, 
+    18.46182, 18.68704, 18.62318, 18.34545, 18.355, 18.35068, 18.08, 
+    17.77295, 17.64558, 17.63068, 17.33659, 17.10302, 16.93386, 16.78886, 
+    16.59116, 16.21186, 15.98116, 15.97279, 15.83884, 15.77093, 15.72651, 
+    15.60046, 15.52619, 15.53682, 15.375, 15.05636, 14.67295, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, 8.2, 6.946667, 4.91, 4.363461, 
+    4.7148, 4.462222, 8.517895, 8.751316, 7.10075, 6.499487, 5.72025, 
+    6.38575, 8.380952, 9.293571, 9.274419, 9.240714, 9.448536, 9.689756, 
+    9.467317, 9.550975, 10.44167, 10.79786, 11.0739, 10.95143, 10.83195, 
+    10.945, 11.10683, 11.03, 10.88293, 11.09902, 10.83651, 10.97512, 10.8425, 
+    10.90951, 10.80781, 10.98075, 11.05143, 11.01317, 11.03634, 11.22171, 
+    11.20683, 11.16244, 11.43195, 11.526, 11.61775, 11.92878, 11.98, 
+    12.08976, 12.18238, 12.61953, 12.66256, 12.26238, 11.76952, 11.42381, 
+    11.04386, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, 7.162963, 6.272045, 6.969318, 6.959091, 7.903409, 10.85864, 
+    13.16409, 14.38795, 15.54977, 15.82232, 15.20163, 14.94279, 14.98409, 
+    15.04114, 15.42659, 16.62841, 16.71523, 16.52591, 16.29409, 16.06591, 
+    15.89795, 15.71744, 15.43182, 15.23295, 15.06045, 14.98477, 14.93674, 
+    14.78814, 14.60837, 14.47419, 14.35698, 14.38273, 14.21091, 14.06318, _, 
+    _, _, _,
+  _, 12.94114, 13.15326, 13.52954, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, 3, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    2.415555, 2.4068, 2.797917, 3.644166, 6.0836, 5.5264, 3.912963, 3.675263, 
+    3.179459, 3.377692, 2.99125, 4.13725, 6.368049, 6.349762, 6.679302, 
+    6.925476, 6.878809, 6.712727, 6.482955, 6.546667, 7.424634, 7.8085, 
+    8.169487, 8.96225, 8.8035, 8.854146, 9.03625, 8.950975, 8.925, 8.964634, 
+    9.157499, 9.160487, 9.110731, 9.12, 9.1925, 9.402439, 9.299512, 9.243999, 
+    9.374634, 9.552683, 9.667561, 9.756829, 10.01805, 10.34857, 10.53073, 
+    10.76476, 10.97857, 11.15279, 11.45643, 11.18619, 10.74628, 10.45268, 
+    10.52432, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 3.127727, 
+    _, 2.201905, 2.184615, 3.211905, 2.99375, _, _, 4.702857, 5.684318, 
+    5.187273, 3.923864, 4.867727, 5.119318, 6.370909, 7.990909, 8.426136, 
+    7.105909, 5.028636, 5.793863, 11.46227, 14.445, 15.69318, 15.38318, 
+    15.25273, 15.11523, 14.96704, 14.9025, 14.72114, 14.45591, 14.39341, 
+    14.31636, 14.02605, 13.89209, 13.8314, 13.69116, 13.54744, 13.43465, 
+    13.46841, 13.34432, 13.01371, 12.74276, 13.05571, 12.65286,
+  _, _, _, _, 13.57049, 13.96667, 11.935, 13.46308, _, _, _, _, _, _, 
+    7.663529, 7.535357, 7.965238, 7.855263, 8.133809, 9.6775, _, _, _, 4, 
+    3.316667, 4.04, 4.0125, 4.115, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, 2.334444, 2.254348, 3.3175, 3.7076, 1.579583, 1.8208, 2.4272, 
+    2.324545, 2.16973, 2.155128, 2.377, 2.919512, 3.683171, 4.448, 5.088536, 
+    5.209767, 4.978182, 4.779768, 5.207442, 5.617073, 5.806905, 6.404146, 
+    6.416, 6.5755, 6.6955, 6.866154, 7.061463, 7.07439, 7.048048, 7.233171, 
+    7.391463, 7.551707, 7.539756, 7.774634, 7.925366, 8.09975, 8.114146, 
+    8.321428, 8.52561, 8.664146, 8.925476, 8.955609, 9.228292, 9.451707, 
+    9.851707, 9.889048, 10.15643, 10.02465, 10.0893, 9.779761, 9.963636, 
+    10.58889, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 11.8, 13.35, 5, 
+    3.4525, 2.082105, 3.11619, 1.934118, 0.2822222, 2.048333, 1.85, 1.38, _, 
+    5.170455, 4.85225, 3.036579, 2.547955, 2.318409, 2.231364, 2.604091, 
+    3.183409, 3.282045, 2.798636, 2.687727, 6.784318, 10.30318, 13.26227, 
+    14.56364, 14.16068, 13.97932, 13.94818, 13.80659, 13.78186, 13.70682, 
+    13.58523, 13.57205, 13.44045, 13.28659, 13.15432, 12.93442, 12.84628, 
+    12.76, 12.66682, 12.68114, 12.37659, 12.295, 12.22537, 10.33242,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 6.508333, 10.85, 11.85, 6.83, 
+    13.6, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, 4.835556, 1.715454, 2.412917, 1.365, 1.4824, 1.77625, 2.0448, 
+    1.9204, 1.901379, 1.919722, 2.183684, 2.241539, 2.960244, 3.312927, 
+    3.459268, 3.3975, 3.610682, 3.947209, 4.187442, 4.399091, 4.425814, 
+    4.831666, 5.042143, 5.23, 5.28, 5.394524, 5.59561, 5.776829, 5.85122, 
+    6.030513, 6.21425, 6.292381, 6.433571, 6.491951, 6.659, 6.879756, 
+    6.990732, 7.132926, 7.3065, 7.489762, 7.688095, 8.028095, 8.221951, 
+    8.47317, 8.618571, 8.729755, 9.137619, 9.085814, 9.116364, 8.985228, 
+    7.760968, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 2.466, 2.696923, 
+    2.749333, 3.179375, 2.41375, 1.863333, 3.4, _, _, _, 0.418, 0.5715, 
+    -0.52, 3, -0.1104546, 0.01965519, 0.4441935, 1.242632, 1.704773, 
+    1.373864, 0.92, 1.092273, 1.426136, 2.892273, 4.994545, 8.277727, 
+    12.02591, 13.11023, 12.99977, 12.65886, 12.67068, 12.68227, 12.81364, 
+    12.72091, 12.74139, 12.76568, 12.78364, 12.6525, 12.46523, 12.32721, 
+    12.26432, 12.12442, 11.99409, 11.83704, 11.43326, 11.33854, 11.01037,
+  7.727, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 2.7775, 
+    2.28, 1.947222, 1.238235, 1.742083, 1.8664, 1.845, 1.9356, 1.594615, 
+    1.745714, 1.942258, 2.541176, 2.61282, 2.90359, 3.240244, 3.512439, 
+    3.688049, 3.768095, 3.869767, 3.877442, 4.078837, 4.169762, 4.203809, 
+    4.433809, 4.536428, 4.606905, 4.885476, 4.982195, 5.021429, 5.087143, 
+    5.188571, 5.267381, 5.295952, 5.526667, 5.565238, 5.709286, 5.87561, 
+    6.074762, 6.243953, 6.625, 6.848605, 7.173721, 7.442093, 7.580952, 
+    7.900698, 8.176512, 8.237954, 8.383636, 8.221591, 7.11878, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, 0.9064706, 3.0125, 4, _, _, _, _, _, _, 
+    _, -0.5057692, -0.4980769, -0.367037, -0.01214286, 0.0825, 0.6527272, 
+    0.503, -0.012, 0.03642857, 0.3259091, 2.020227, 3.714318, 5.059772, 
+    8.478409, 11.10136, 11.30136, 11.52705, 11.39523, 11.4725, 11.61864, 
+    11.81386, 11.79523, 11.87932, 11.9625, 11.95932, 11.96818, 11.94773, 
+    11.77023, 11.66705, 11.46045, 11.19795, 11.05409, 10.83091, 10.29705, 
+    8.660526,
+  8.055909, 7.148604, 7.073571, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, 5.429231, 4.403636, 2.340833, 0.859, 0.747, 1.164545, 
+    0.8118182, 0.9786956, 0.9970833, 1.438148, 2.189286, 2.731936, 2.884193, 
+    3.114706, 3.471429, 3.634857, 3.665676, 3.847436, 3.941707, 3.894762, 
+    4.021163, 4.123659, 4.142195, 4.181707, 4.229048, 4.450256, 4.401464, 
+    4.47325, 4.475366, 4.664878, 4.609, 4.82175, 4.754, 4.9795, 5.21975, 
+    5.389, 5.7015, 5.925122, 6.227805, 6.588293, 6.68122, 6.974146, 7.335609, 
+    7.616, 7.785, 8.080277, 6.79963, 7.076956, 7.586667, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, -0.795, 
+    -0.6309091, 0.00769233, -0.6900001, -0.2904762, -0.6033333, -0.1384, 
+    0.1365714, 0.4353659, 2.823023, 5.306585, 8.216364, 8.812273, 9.190454, 
+    8.852045, 9.32, 9.4075, 9.898864, 10.27023, 10.52568, 10.68364, 10.83, 
+    11.12795, 11.26455, 11.39045, 11.30591, 11.18455, 11.15682, 10.82727, 
+    10.1625, 10.08795, 9.668863, 9.395681, 9.234091,
+  6.154091, 6.715, 5.878409, 4.515641, 3.893478, 2.981111, 4, 2.48, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, 5.366666, 4.28, 4.413333, 5.173, 2.170769, 
+    1.56875, 0.9419048, 0.7609524, 1.203, 0.3725, 0.2228571, 0.8733333, 
+    1.19963, 2.252963, 2.374444, 2.847857, 3.212258, 3.41258, 3.452188, 
+    3.301613, 3.400645, 3.477, 3.566562, 3.721765, 3.966, 4.218205, 4.288049, 
+    4.285853, 4.339268, 4.215526, 4.296341, 4.327073, 4.33825, 4.37878, 
+    4.37561, 4.598536, 4.802927, 4.999512, 5.15125, 5.54125, 5.799756, 
+    6.02875, 6.25, 6.598182, 6.852162, 7.396944, 7.529677, 6.065185, 
+    5.630666, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, 2.3, 1.233333, 1.38, 0.14125, 0.1051613, 
+    1.393, 3.8, 5.59, 5.93325, 6.601951, 6.653095, 6.229047, 6.556744, 
+    6.478409, 7.361591, 7.751395, 8.401395, 9.138604, 9.645581, 10.26744, 
+    10.35349, 10.55814, 10.88524, 10.77146, 10.58914, 10.40897, 10.59308, 
+    9.21641, 9.175227, 7.104667, 7.01875,
+  6.969545, 6.468636, 6.343409, 5.560682, 3.310909, 2.570526, 2.986, 
+    3.403414, 3.320811, 3.203529, 3.201333, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 6, 1.85, 
+    6.075, 2.275, 1.376, 0.7321429, 0.7193334, 0.58, 1.195882, 0.07157894, 
+    -0.2231579, _, 0.9516667, 0.6459091, 0.6896, 1.2, 2.125454, 1.752857, 
+    2.658182, 2.873333, 3.065652, 3.178519, 3.203214, 3.153846, 3.323448, 
+    3.453571, 3.503793, 3.693571, 3.8, 4.044737, 3.881282, 4.14, 4.295405, 
+    4.373243, 4.39973, 4.364412, 4.368649, 4.494706, 4.605, 4.944242, 
+    5.10147, 5.258333, 5.525135, 6.078286, 6.510285, 6.947895, 6.743125, 
+    6.434667, 6.842857, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, -0.4622222, 0.002222208, 
+    0.2171429, 1.241481, 2.806579, 3.767097, 3.57, 4.444849, 4.618948, 
+    4.979743, 5.666842, 6.454878, 6.834878, 7.037381, 7.455116, 7.933571, 
+    8.285455, 8.979535, 9.513023, 9.808139, 10.14318, 10.38114, 10.48977, 
+    10.36682, 10.12186, 9.545, 8.65159, 7.963863, 6.580625, 7.037045,
+  7.52186, 6.817273, 6.380465, 5.74907, 5.21425, 3.407273, 3.053529, 
+    3.506667, 3.1575, 3.275135, 3.0388, 2.097, 3.933334, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    6.5, _, 5.1, 0.6933333, 1.1425, 0.361, 0.5435714, 0.1988889, 0.2345, 
+    -0.031875, 1.035714, 0.9, 1.125, 0.3572727, 1.104545, 1.636667, 1.717333, 
+    1.674, 2.134286, 2.223077, 2.59, 2.523333, 2.623158, 2.780555, 2.97, 
+    2.786818, 2.875, 3.0004, 3.111364, 2.895789, 2.801429, 2.903, 3.851667, 
+    4.632963, 4.215357, 4.361333, 4.707812, 4.669117, 4.821428, 5.065143, 
+    5.291429, 5.650789, 6.122105, 6.808235, 6.678485, 6.490435, 7.733333, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, 2.7, 1.646667, 0.5307692, 0.3228572, 2.5625, 
+    2.950454, 2.991143, 3.398, 3.512917, 4.132727, 4.1648, 4.657895, 
+    5.180526, 5.970555, 6.649189, 7.136389, 7.531666, 8.05375, 8.354186, 
+    8.964523, 9.40093, 9.617441, 9.732326, 9.6575, 9.442326, 9.644634, 
+    9.818334, 9.626429, 8.48907, 7.474359, 6.454286, 7.228864,
+  7.324186, 7.093953, 6.151363, 5.488064, 4.293333, 3.356944, _, _, 2.320417, 
+    2.694, 2.9, 2.218667, 2.405714, 0.93, 1.975, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 0.2, 
+    0, 0.1928572, -0.16125, -0.566, -0.7130769, 0.506, 0.94, 1.213333, 1.15, 
+    0.6033334, 0.257647, 0.3758824, 0.2077778, 0.6841176, 1.42, 1.557143, 
+    1.651176, 1.895455, 1.856667, 2.028947, 2.419545, 1.647895, 1.632105, 
+    1.21875, 0.5975, 1.963636, 1.83, 3.126667, 4.5, 3.6, 4.179167, 4.717407, 
+    5.00875, 5.366177, 5.320882, 5.511795, 5.74579, 5.924857, 6.352647, 
+    6.28931, 5.049615, 6, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 0.75, 2.703333, 
+    2.93, 2.361, 2.658462, 2.894, 3.177037, 3.087941, 3.168182, 3.86871, 
+    4.39853, 4.504359, 5.071163, 5.650526, 6.653889, 7.39625, 7.804054, 
+    8.168571, 8.228286, 8.752059, 8.915854, 9.065349, 9.132092, 9.164186, 
+    9.272558, 9.439091, 9.379091, 8.732326, 8.323954, 7.630682, 7.710465,
+  7.97, 7.324419, 6.487955, 6.408333, _, _, _, _, 0.533, 1.606842, 1.226923, 
+    1.05, 1.878333, 0.9663157, 0.531, 3.933333, 3.55, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, 0.6333333, 0.98, 0.3875, 0.35, 2.2, 0.3555556, -0.08999999, 
+    -0.3533333, 0.4035294, 0.2052941, 0.6228571, 1.0875, 1.039444, 0.792, 
+    1.155714, 0.3826667, 0.176875, 0.1214286, -0.08333335, -0.3625, _, 
+    -0.4333333, -1, _, _, _, _, 4.7275, 4.59375, 5.355862, 5.28375, 6, 6.325, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, 1.8, _, 3.6, _, -0.0933333, 0.8000001, 
+    2.465, 1.96875, 2.133846, 0.8313333, 0.7063636, 0.7593939, 1.356667, 
+    2.922, 3.385652, 4.764138, 4.622105, 5.01119, 5.556154, 6.221316, 
+    6.952222, 7.469412, 7.787059, 8.26647, 8.224474, 8.377436, 8.532051, 
+    8.5955, 8.610714, 8.609268, 8.4305, 7.869756, 7.9485, 8.18, 7.853846,
+  7.518461, 7.272927, 6.912093, 6.753256, 6.301579, 5.913333, _, _, 0.44, 
+    0.7995454, 0.5110714, 0.3241667, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, 0.58, 0.2214286, 0.135, -0.461, 
+    0.1455556, -0.8, -1.36, -0.8466666, -1.466667, -1.143333, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    0.85, 0.7125, 0.8075, 0.4207692, 0.3848387, -0.2, _, _, 5.5, 4.148333, 
+    4.7005, 5.057778, 5.210909, 5.533823, 5.957879, 6.538684, 6.851666, 
+    7.072895, 6.710526, 6.86878, 7.306, 7.342195, 7.823, 7.84125, 7.329487, 
+    7.296154, 6.700263, 6.710526, 6.426389, 7.095,
+  6.41875, 6.71675, 7.339722, 7.287442, 6.933488, 5.910937, 4.65, _, _, _, 
+    0.07176471, 0.0738889, 0.03166666, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, 3.3, 3.3, 0.8766667, 0.6883333, 0.3470588, 0.23, 0.09444445, 1.9, 
+    _, _, _, _, 6.1, 4.896, 5.018421, 5.206666, 5.095185, 5.824138, 6.151428, 
+    5.177805, 4.421795, 3.542, 2.4, 5.2725, 4.586786, 5.361351, 4.096875, 
+    4.147097, 3.759032, 4.621176, 5.219394, 5.573714,
+  6.432973, 6.709024, 6.5348, 6.870625, 6.758372, 6.349302, 5.426585, 
+    4.759524, 4.825, _, _, _, _, _, _, 4.6, _, 1.5, _, 0, 1.184375, 2, -0.1, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, 1.8, _, 1.6, -0.2833333, -0.05083332, -0.25, _, _, _, _, 
+    _, _, _, _, 6.5, 3.0125, 4.312, 2.538889, 5.714849, 4.692369, 3.214, 
+    3.26375, 3.095, 2.69875, 2.421667, 2.513478, 2.023158, 3.372143, 
+    4.047857, 4.997777, 4.595238, 5.229615,
+  5.48125, 5.911, 6.212083, 6.001364, 6.113, 6.303809, 6.054762, 5.698605, 
+    5.515, 4.043, 5.45, 3.7, _, _, 4.266666, 2.722941, 2.7324, 2.719545, 
+    2.190909, 1.9996, 1.8675, 0.8941666, 1.3675, 0.9075, 0.45, 0.1933333, 
+    -0.5166667, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 5, 3, _, _, 
+    5.9, _, -0.3, 2.17, 2.034, 0.6275, 3.606, 1.6375, 2.271667, 3.061429, 
+    4.6275, 4.888462, 4.953333,
+  4.874166, 5.131428, 4.827272, 5.262308, 5.086667, 5.077222, 5.6775, 
+    5.727273, 5.599286, 5.289429, 5.093429, 4.861818, 4.70606, 4.412121, 
+    4.273333, 3.937187, 3.65, 3.36, 2.655926, 1.95375, 1.791818, 1.79875, 
+    1.385833, 0.662, 0.6185715, -0.6350001, -1.075, -1.8, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, 7.7, 1.335, 4.65, 3.8, 4.4, 6.4, 
+    4.35, 8.9125, 1.396667, 1.29, 3.410769, 4.12875, 4.387692,
+  4.2, 2.84, 3.238, 3.47125, 3.985, 3.92625, 4.511818, 4.618421, 4.755416, 
+    4.067391, 3.720454, 4.0096, 4.215555, 4.082222, 3.864643, 3.378636, 
+    3.169355, 2.593158, 1.7555, 0.647, 0.7888889, 1.552727, 1.687, 0.6842857, 
+    0.5871428, 0.585, -0.8, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, 13, 15.24, 15.4, _, 12.13333, _, -0.08, 5.1, 6, 
+    4.733334,
+  _, _, 2.02, 2.51, 3.1, 2.36, 3.352222, 3.429375, 3.114737, 1.587647, 1.555, 
+    1.560714, 2.042353, 1.96, 2.05375, 2.041111, 1.817222, 1.496667, 1.035, 
+    0.8199999, 1.425, 0.4, 0.8433333, 0.6875, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, 3.2,
+  _, 0.2, 0.8000001, 1.5, 2.545, 2.889, 2.937778, 0.55, 2.421667, 0.3, _, 
+    3.8, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    0.03333334, _, -0.5,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _,
+  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
+    _, _, _, _, _, _, _, _, _, _, _ ;
+
+ COADSX =
+  0.008461085, 0.007923217, 0.007375696, 0.006819189, 0.006254373, 
+    0.005681938, 0.005102585, 0.004517009, 0.003925932, 0.003330071, 
+    0.002730153, 0.002126912, 0.001521077, 0.0009133877, 0.0003045859, 
+    -0.000304587, -0.0009133888, -0.001521078, -0.002126909, -0.002730154, 
+    -0.003330072, -0.003925933, -0.004517011, -0.005102581, -0.005681939, 
+    -0.006254375, -0.00681919, -0.007375697, -0.007923214, -0.008461086, 
+    -0.008988641, -0.00950525, -0.01001028, -0.0105031, -0.01098314, 
+    -0.01144979, -0.0119025, -0.0123407, -0.01276387, -0.01317148, 
+    -0.01356305, -0.01393809, -0.01429615, -0.0146368, -0.01495961, 
+    -0.0152642, -0.01555019, -0.01581723, -0.016065, -0.0162932, -0.01650155, 
+    -0.0166898, -0.01685771, -0.01700508, -0.01713173, -0.01723752, 
+    -0.0173223, -0.01738597, -0.01742847, -0.01744973, -0.01744973, 
+    -0.01742847, -0.01738597, -0.0173223, -0.01723752, -0.01713173, 
+    -0.01700508, -0.01685771, -0.0166898, -0.01650155, -0.0162932, -0.016065, 
+    -0.01581723, -0.01555019, -0.0152642, -0.01495961, -0.0146368, 
+    -0.01429616, -0.01393809, -0.01356305, -0.01317148, -0.01276387, 
+    -0.0123407, -0.0119025, -0.01144979, -0.01098314, -0.01050311, 
+    -0.01001028, -0.00950525, -0.008988643, -0.008461083, -0.007923216, 
+    -0.007375694, -0.006819191, -0.006254376, -0.00568194, -0.005102583, 
+    -0.004517008, -0.003925931, -0.003330074, -0.002730155, -0.002126911, 
+    -0.001521075, -0.0009133862, -0.0003045844, 0.0003045844, 0.0009133862, 
+    0.001521075, 0.002126911, 0.002730155, 0.003330074, 0.003925931, 
+    0.004517008, 0.005102583, 0.00568194, 0.006254376, 0.006819187, 
+    0.007375698, 0.007923216, 0.00846108, 0.008988643, 0.009505247, 
+    0.01001028, 0.01050311, 0.01098314, 0.01144979, 0.01190249, 0.0123407, 
+    0.01276386, 0.01317148, 0.01356305, 0.01393809, 0.01429616, 0.0146368, 
+    0.01495961, 0.0152642, 0.01555019, 0.01581723, 0.016065, 0.0162932, 
+    0.01650155, 0.0166898, 0.01685771, 0.01700508, 0.01713173, 0.01723751, 
+    0.0173223, 0.01738597, 0.01742847, 0.01744973, 0.01744973, 0.01742847, 
+    0.01738597, 0.0173223, 0.01723752, 0.01713173, 0.01700508, 0.01685771, 
+    0.0166898, 0.01650155, 0.01629321, 0.016065, 0.01581723, 0.01555019, 
+    0.0152642, 0.01495961, 0.0146368, 0.01429616, 0.01393809, 0.01356305, 
+    0.01317148, 0.01276387, 0.0123407, 0.0119025, 0.0114498, 0.01098314, 
+    0.01050311, 0.01001028, 0.00950525, 0.008988645,
+  0.02537299, 0.02376004, 0.02211814, 0.02044929, 0.01875553, 0.01703892, 
+    0.01530156, 0.01354555, 0.01177303, 0.009986172, 0.008187145, 
+    0.006378157, 0.004561384, 0.002739055, 0.000913388, -0.0009133914, 
+    -0.002739058, -0.004561388, -0.006378147, -0.008187149, -0.009986175, 
+    -0.01177304, -0.01354555, -0.01530155, -0.01703892, -0.01875553, 
+    -0.0204493, -0.02211814, -0.02376003, -0.02537299, -0.02695502, 
+    -0.02850422, -0.03001868, -0.03149657, -0.0329361, -0.03433549, 
+    -0.03569305, -0.03700712, -0.03827611, -0.03949846, -0.04067269, 
+    -0.04179737, -0.04287112, -0.04389264, -0.04486069, -0.04577407, 
+    -0.0466317, -0.0474325, -0.04817552, -0.04885984, -0.04948464, 
+    -0.05004914, -0.05055267, -0.0509946, -0.05137441, -0.05169163, 
+    -0.05194587, -0.05213682, -0.05226425, -0.05232801, -0.05232801, 
+    -0.05226425, -0.05213682, -0.05194587, -0.05169163, -0.05137441, 
+    -0.0509946, -0.05055267, -0.05004914, -0.04948463, -0.04885984, 
+    -0.04817552, -0.0474325, -0.04663169, -0.04577407, -0.04486068, 
+    -0.04389264, -0.04287112, -0.04179737, -0.04067269, -0.03949846, 
+    -0.03827611, -0.03700712, -0.03569305, -0.03433549, -0.0329361, 
+    -0.03149657, -0.03001869, -0.02850422, -0.02695502, -0.02537298, 
+    -0.02376003, -0.02211813, -0.0204493, -0.01875554, -0.01703893, 
+    -0.01530156, -0.01354554, -0.01177303, -0.00998618, -0.008187153, 
+    -0.006378152, -0.00456138, -0.00273905, -0.0009133835, 0.0009133835, 
+    0.00273905, 0.00456138, 0.006378152, 0.008187153, 0.00998618, 0.01177303, 
+    0.01354554, 0.01530156, 0.01703893, 0.01875554, 0.02044929, 0.02211815, 
+    0.02376003, 0.02537297, 0.02695502, 0.02850421, 0.03001869, 0.03149657, 
+    0.0329361, 0.03433549, 0.03569304, 0.03700712, 0.03827611, 0.03949846, 
+    0.04067269, 0.04179736, 0.04287112, 0.04389264, 0.04486069, 0.04577407, 
+    0.0466317, 0.0474325, 0.04817551, 0.04885984, 0.04948463, 0.05004914, 
+    0.05055267, 0.0509946, 0.05137441, 0.05169163, 0.05194587, 0.05213682, 
+    0.05226425, 0.05232801, 0.05232801, 0.05226425, 0.05213682, 0.05194587, 
+    0.05169163, 0.05137442, 0.0509946, 0.05055267, 0.05004914, 0.04948464, 
+    0.04885985, 0.04817552, 0.0474325, 0.04663169, 0.04577408, 0.04486068, 
+    0.04389264, 0.04287113, 0.04179737, 0.04067269, 0.03949846, 0.03827611, 
+    0.03700713, 0.03569305, 0.03433549, 0.03293609, 0.03149658, 0.03001869, 
+    0.02850422, 0.02695503,
+  0.04225398, 0.03956791, 0.03683364, 0.03405448, 0.03123384, 0.02837515, 
+    0.0254819, 0.02255758, 0.01960579, 0.01663011, 0.01363416, 0.01062163, 
+    0.007596135, 0.004561385, 0.001521077, -0.001521083, -0.00456139, 
+    -0.007596141, -0.01062161, -0.01363417, -0.01663011, -0.01960579, 
+    -0.02255759, -0.02548188, -0.02837515, -0.03123384, -0.03405449, 
+    -0.03683364, -0.0395679, -0.04225398, -0.04488855, -0.04746845, 
+    -0.04999052, -0.05245166, -0.05484894, -0.05717935, -0.05944011, 
+    -0.06162846, -0.06374172, -0.06577732, -0.06773277, -0.06960573, 
+    -0.07139385, -0.07309501, -0.07470711, -0.07622817, -0.0776564, 
+    -0.07898998, -0.08022735, -0.08136696, -0.08240744, -0.08334751, 
+    -0.08418604, -0.08492201, -0.0855545, -0.08608277, -0.08650616, 
+    -0.08682415, -0.08703636, -0.08714253, -0.08714253, -0.08703636, 
+    -0.08682415, -0.08650616, -0.08608277, -0.0855545, -0.08492201, 
+    -0.08418604, -0.08334751, -0.08240743, -0.08136696, -0.08022735, 
+    -0.07898999, -0.07765639, -0.07622818, -0.0747071, -0.07309501, 
+    -0.07139385, -0.06960572, -0.06773278, -0.06577732, -0.06374173, 
+    -0.06162846, -0.05944012, -0.05717935, -0.05484892, -0.05245167, 
+    -0.04999052, -0.04746846, -0.04488856, -0.04225397, -0.0395679, 
+    -0.03683363, -0.03405449, -0.03123385, -0.02837516, -0.02548189, 
+    -0.02255758, -0.01960578, -0.01663012, -0.01363418, -0.01062162, 
+    -0.007596127, -0.004561377, -0.00152107, 0.00152107, 0.004561377, 
+    0.007596127, 0.01062162, 0.01363418, 0.01663012, 0.01960578, 0.02255758, 
+    0.02548189, 0.02837516, 0.03123385, 0.03405448, 0.03683364, 0.0395679, 
+    0.04225395, 0.04488856, 0.04746844, 0.04999052, 0.05245167, 0.05484894, 
+    0.05717935, 0.0594401, 0.06162846, 0.06374171, 0.06577732, 0.06773278, 
+    0.06960571, 0.07139385, 0.073095, 0.07470711, 0.07622818, 0.0776564, 
+    0.07898999, 0.08022734, 0.08136696, 0.08240743, 0.08334751, 0.08418604, 
+    0.084922, 0.0855545, 0.08608277, 0.08650616, 0.08682415, 0.08703636, 
+    0.08714253, 0.08714253, 0.08703636, 0.08682415, 0.08650616, 0.08608277, 
+    0.08555451, 0.08492201, 0.08418605, 0.08334751, 0.08240744, 0.08136696, 
+    0.08022735, 0.07898999, 0.07765639, 0.07622819, 0.0747071, 0.07309501, 
+    0.07139387, 0.06960572, 0.06773279, 0.06577731, 0.06374172, 0.06162848, 
+    0.05944011, 0.05717936, 0.05484891, 0.05245168, 0.04999053, 0.04746845, 
+    0.04488857,
+  0.05908343, 0.05532752, 0.0515042, 0.04761814, 0.04367405, 0.03967676, 
+    0.03563115, 0.03154211, 0.02741463, 0.02325376, 0.01906455, 0.01485215, 
+    0.01062162, 0.006378151, 0.002126912, -0.002126919, -0.006378159, 
+    -0.01062163, -0.01485213, -0.01906456, -0.02325376, -0.02741464, 
+    -0.03154211, -0.03563113, -0.03967677, -0.04367406, -0.04761814, 
+    -0.05150421, -0.0553275, -0.05908344, -0.06276733, -0.06637479, 
+    -0.06990138, -0.07334277, -0.07669487, -0.07995346, -0.08311468, 
+    -0.08617462, -0.08912958, -0.09197595, -0.09471025, -0.09732918, 
+    -0.0998295, -0.1022082, -0.1044624, -0.1065893, -0.1085864, -0.1104511, 
+    -0.1121813, -0.1137748, -0.1152297, -0.1165442, -0.1177167, -0.1187458, 
+    -0.1196302, -0.1203689, -0.1209609, -0.1214056, -0.1217023, -0.1218508, 
+    -0.1218508, -0.1217023, -0.1214056, -0.1209609, -0.1203689, -0.1196302, 
+    -0.1187458, -0.1177167, -0.1165442, -0.1152297, -0.1137748, -0.1121813, 
+    -0.1104511, -0.1085864, -0.1065893, -0.1044624, -0.1022082, -0.09982951, 
+    -0.09732918, -0.09471025, -0.09197594, -0.08912959, -0.08617463, 
+    -0.08311468, -0.07995347, -0.07669485, -0.07334279, -0.06990138, 
+    -0.0663748, -0.06276735, -0.05908342, -0.05532751, -0.05150419, 
+    -0.04761815, -0.04367407, -0.03967677, -0.03563114, -0.0315421, 
+    -0.02741462, -0.02325378, -0.01906457, -0.01485214, -0.01062161, 
+    -0.006378141, -0.002126901, 0.002126901, 0.006378141, 0.01062161, 
+    0.01485214, 0.01906457, 0.02325378, 0.02741462, 0.0315421, 0.03563114, 
+    0.03967677, 0.04367407, 0.04761812, 0.05150422, 0.05532751, 0.05908339, 
+    0.06276735, 0.06637477, 0.06990138, 0.07334279, 0.07669488, 0.07995347, 
+    0.08311466, 0.08617463, 0.08912957, 0.09197596, 0.09471025, 0.09732915, 
+    0.09982951, 0.1022082, 0.1044624, 0.1065893, 0.1085864, 0.1104511, 
+    0.1121813, 0.1137748, 0.1152297, 0.1165442, 0.1177167, 0.1187458, 
+    0.1196302, 0.1203689, 0.1209609, 0.1214056, 0.1217023, 0.1218508, 
+    0.1218508, 0.1217023, 0.1214056, 0.1209609, 0.1203689, 0.1196302, 
+    0.1187458, 0.1177167, 0.1165442, 0.1152297, 0.1137748, 0.1121813, 
+    0.1104511, 0.1085864, 0.1065893, 0.1044624, 0.1022082, 0.09982952, 
+    0.09732917, 0.09471026, 0.09197593, 0.08912958, 0.08617464, 0.08311468, 
+    0.07995348, 0.07669484, 0.0733428, 0.0699014, 0.06637479, 0.06276736,
+  0.07584096, 0.07101978, 0.06611207, 0.06112382, 0.05606109, 0.05093007, 
+    0.04573703, 0.04048823, 0.0351901, 0.0298491, 0.02447173, 0.01906459, 
+    0.01363418, 0.008187153, 0.002730157, -0.002730166, -0.008187163, 
+    -0.01363419, -0.01906456, -0.02447174, -0.02984911, -0.03519011, 
+    -0.04048824, -0.045737, -0.05093008, -0.0560611, -0.06112383, 
+    -0.06611209, -0.07101975, -0.07584096, -0.08056971, -0.08520033, 
+    -0.08972714, -0.09414461, -0.09844743, -0.1026303, -0.1066881, 
+    -0.1106159, -0.1144089, -0.1180626, -0.1215724, -0.1249342, -0.1281436, 
+    -0.131197, -0.1340905, -0.1368207, -0.1393842, -0.1417778, -0.1439987, 
+    -0.1460442, -0.1479117, -0.149599, -0.1511041, -0.1524251, -0.1535603, 
+    -0.1545085, -0.1552684, -0.1558392, -0.1562201, -0.1564107, -0.1564107, 
+    -0.1562201, -0.1558392, -0.1552684, -0.1545085, -0.1535603, -0.1524251, 
+    -0.1511041, -0.149599, -0.1479117, -0.1460442, -0.1439987, -0.1417778, 
+    -0.1393842, -0.1368207, -0.1340905, -0.131197, -0.1281436, -0.1249341, 
+    -0.1215724, -0.1180626, -0.114409, -0.1106159, -0.1066881, -0.1026303, 
+    -0.09844741, -0.09414462, -0.08972715, -0.08520034, -0.08056973, 
+    -0.07584094, -0.07101977, -0.06611206, -0.06112384, -0.05606112, 
+    -0.05093009, -0.04573702, -0.04048822, -0.03519009, -0.02984913, 
+    -0.02447175, -0.01906457, -0.01363416, -0.008187139, -0.002730143, 
+    0.002730143, 0.008187139, 0.01363416, 0.01906457, 0.02447175, 0.02984913, 
+    0.03519009, 0.04048822, 0.04573702, 0.05093009, 0.05606112, 0.06112381, 
+    0.06611209, 0.07101977, 0.07584091, 0.08056973, 0.0852003, 0.08972715, 
+    0.09414462, 0.09844744, 0.1026303, 0.106688, 0.1106159, 0.1144089, 
+    0.1180626, 0.1215724, 0.1249341, 0.1281436, 0.131197, 0.1340905, 
+    0.1368207, 0.1393842, 0.1417778, 0.1439987, 0.1460442, 0.1479117, 
+    0.1495991, 0.1511041, 0.1524251, 0.1535603, 0.1545085, 0.1552684, 
+    0.1558392, 0.1562201, 0.1564107, 0.1564107, 0.1562201, 0.1558392, 
+    0.1552684, 0.1545085, 0.1535604, 0.1524251, 0.1511041, 0.149599, 
+    0.1479117, 0.1460442, 0.1439987, 0.1417778, 0.1393842, 0.1368207, 
+    0.1340905, 0.131197, 0.1281437, 0.1249341, 0.1215724, 0.1180626, 
+    0.1144089, 0.1106159, 0.1066881, 0.1026303, 0.0984474, 0.09414464, 
+    0.08972717, 0.08520033, 0.08056974,
+  0.09250608, 0.08662551, 0.08063939, 0.07455503, 0.06837983, 0.06212133, 
+    0.05578718, 0.04938502, 0.0429227, 0.03640807, 0.0298491, 0.02325379, 
+    0.01663012, 0.00998618, 0.003330075, -0.003330087, -0.009986192, 
+    -0.01663013, -0.02325376, -0.02984911, -0.03640809, -0.04292271, 
+    -0.04938503, -0.05578715, -0.06212134, -0.06837984, -0.07455504, 
+    -0.08063941, -0.08662547, -0.09250609, -0.09827392, -0.1039221, 
+    -0.1094436, -0.1148317, -0.1200801, -0.125182, -0.1301315, -0.1349224, 
+    -0.1395489, -0.1440054, -0.1482865, -0.1523869, -0.1563016, -0.1600259, 
+    -0.1635553, -0.1668853, -0.1700121, -0.1729317, -0.1756407, -0.1781356, 
+    -0.1804135, -0.1824716, -0.1843074, -0.1859186, -0.1873033, -0.1884599, 
+    -0.1893868, -0.190083, -0.1905476, -0.19078, -0.19078, -0.1905476, 
+    -0.190083, -0.1893868, -0.1884599, -0.1873033, -0.1859186, -0.1843074, 
+    -0.1824716, -0.1804135, -0.1781356, -0.1756407, -0.1729317, -0.1700121, 
+    -0.1668853, -0.1635553, -0.160026, -0.1563016, -0.1523869, -0.1482865, 
+    -0.1440054, -0.1395489, -0.1349224, -0.1301315, -0.125182, -0.12008, 
+    -0.1148317, -0.1094436, -0.1039221, -0.09827394, -0.09250607, 
+    -0.08662549, -0.08063938, -0.07455505, -0.06837986, -0.06212135, 
+    -0.05578716, -0.04938501, -0.04292268, -0.0364081, -0.02984912, 
+    -0.02325378, -0.0166301, -0.009986163, -0.003330058, 0.003330058, 
+    0.009986163, 0.0166301, 0.02325378, 0.02984912, 0.0364081, 0.04292268, 
+    0.04938501, 0.05578716, 0.06212135, 0.06837986, 0.07455502, 0.08063941, 
+    0.08662549, 0.09250602, 0.09827394, 0.103922, 0.1094436, 0.1148317, 
+    0.1200801, 0.125182, 0.1301314, 0.1349224, 0.1395489, 0.1440054, 
+    0.1482865, 0.1523869, 0.1563016, 0.1600259, 0.1635553, 0.1668853, 
+    0.1700121, 0.1729317, 0.1756407, 0.1781356, 0.1804135, 0.1824716, 
+    0.1843074, 0.1859186, 0.1873033, 0.1884599, 0.1893868, 0.190083, 
+    0.1905476, 0.19078, 0.19078, 0.1905476, 0.190083, 0.1893868, 0.1884599, 
+    0.1873034, 0.1859186, 0.1843074, 0.1824716, 0.1804135, 0.1781356, 
+    0.1756407, 0.1729317, 0.1700121, 0.1668854, 0.1635553, 0.1600259, 
+    0.1563016, 0.1523869, 0.1482865, 0.1440054, 0.1395489, 0.1349224, 
+    0.1301315, 0.125182, 0.12008, 0.1148318, 0.1094436, 0.1039221, 0.09827396,
+  0.1090584, 0.1021256, 0.09506842, 0.08789537, 0.08061522, 0.07323688, 
+    0.06576934, 0.05822162, 0.05060297, 0.04292267, 0.03519008, 0.02741466, 
+    0.01960579, 0.01177303, 0.003925934, -0.003925948, -0.01177305, 
+    -0.01960581, -0.02741462, -0.03519009, -0.04292269, -0.05060299, 
+    -0.05822163, -0.0657693, -0.07323688, -0.08061524, -0.08789538, 
+    -0.09506843, -0.1021256, -0.1090585, -0.1158583, -0.1225171, -0.1290266, 
+    -0.1353789, -0.1415663, -0.1475811, -0.1534162, -0.1590644, -0.1645188, 
+    -0.1697727, -0.1748198, -0.1796539, -0.1842691, -0.1886598, -0.1928207, 
+    -0.1967466, -0.2004329, -0.2038749, -0.2070685, -0.2100099, -0.2126954, 
+    -0.2151217, -0.217286, -0.2191856, -0.2208181, -0.2221815, -0.2232743, 
+    -0.224095, -0.2246428, -0.2249168, -0.2249168, -0.2246428, -0.224095, 
+    -0.2232743, -0.2221815, -0.2208181, -0.2191856, -0.217286, -0.2151217, 
+    -0.2126954, -0.2100099, -0.2070685, -0.2038749, -0.2004329, -0.1967466, 
+    -0.1928207, -0.1886598, -0.1842691, -0.1796539, -0.1748198, -0.1697727, 
+    -0.1645188, -0.1590644, -0.1534162, -0.1475812, -0.1415663, -0.1353789, 
+    -0.1290266, -0.1225171, -0.1158584, -0.1090584, -0.1021256, -0.0950684, 
+    -0.08789539, -0.08061526, -0.0732369, -0.06576931, -0.0582216, 
+    -0.05060295, -0.04292271, -0.03519011, -0.02741464, -0.01960577, 
+    -0.01177302, -0.003925915, 0.003925915, 0.01177302, 0.01960577, 
+    0.02741464, 0.03519011, 0.04292271, 0.05060295, 0.0582216, 0.06576931, 
+    0.0732369, 0.08061526, 0.08789535, 0.09506845, 0.1021256, 0.1090584, 
+    0.1158584, 0.1225171, 0.1290266, 0.1353789, 0.1415663, 0.1475812, 
+    0.1534162, 0.1590644, 0.1645188, 0.1697727, 0.1748198, 0.1796539, 
+    0.1842691, 0.1886598, 0.1928207, 0.1967466, 0.2004329, 0.2038749, 
+    0.2070685, 0.2100099, 0.2126954, 0.2151218, 0.217286, 0.2191855, 
+    0.2208181, 0.2221815, 0.2232743, 0.224095, 0.2246428, 0.2249168, 
+    0.2249168, 0.2246428, 0.224095, 0.2232743, 0.2221815, 0.2208181, 
+    0.2191856, 0.217286, 0.2151217, 0.2126954, 0.2100099, 0.2070685, 
+    0.2038749, 0.2004328, 0.1967466, 0.1928207, 0.1886598, 0.1842691, 
+    0.1796539, 0.1748198, 0.1697727, 0.1645188, 0.1590644, 0.1534162, 
+    0.1475812, 0.1415662, 0.1353789, 0.1290267, 0.1225171, 0.1158584,
+  0.125478, 0.1175014, 0.1093817, 0.1011287, 0.09275243, 0.08426322, 
+    0.07567139, 0.06698731, 0.05822162, 0.049385, 0.0404882, 0.03154214, 
+    0.02255759, 0.01354555, 0.004517013, -0.004517029, -0.01354557, 
+    -0.0225576, -0.03154209, -0.04048822, -0.04938501, -0.05822164, 
+    -0.06698733, -0.07567134, -0.08426324, -0.09275246, -0.1011287, 
+    -0.1093817, -0.1175014, -0.125478, -0.1333017, -0.140963, -0.1484525, 
+    -0.1557612, -0.1628802, -0.1698006, -0.1765142, -0.1830127, -0.1892883, 
+    -0.1953332, -0.2011402, -0.2067021, -0.2120122, -0.2170639, -0.2218512, 
+    -0.2263682, -0.2306095, -0.2345697, -0.2382442, -0.2416284, -0.2447183, 
+    -0.2475099, -0.25, -0.2521856, -0.2540638, -0.2556326, -0.2568899, 
+    -0.2578342, -0.2584644, -0.2587796, -0.2587796, -0.2584644, -0.2578342, 
+    -0.2568899, -0.2556326, -0.2540638, -0.2521856, -0.25, -0.2475099, 
+    -0.2447182, -0.2416284, -0.2382442, -0.2345697, -0.2306095, -0.2263682, 
+    -0.2218512, -0.2170639, -0.2120122, -0.2067021, -0.2011402, -0.1953332, 
+    -0.1892883, -0.1830127, -0.1765142, -0.1698006, -0.1628801, -0.1557612, 
+    -0.1484525, -0.140963, -0.1333017, -0.125478, -0.1175014, -0.1093816, 
+    -0.1011287, -0.09275248, -0.08426325, -0.07567137, -0.06698729, 
+    -0.0582216, -0.04938503, -0.04048824, -0.03154211, -0.02255756, 
+    -0.01354553, -0.00451699, 0.00451699, 0.01354553, 0.02255756, 0.03154211, 
+    0.04048824, 0.04938503, 0.0582216, 0.06698729, 0.07567137, 0.08426325, 
+    0.09275248, 0.1011286, 0.1093817, 0.1175014, 0.1254779, 0.1333017, 
+    0.1409629, 0.1484525, 0.1557612, 0.1628802, 0.1698006, 0.1765141, 
+    0.1830127, 0.1892883, 0.1953333, 0.2011402, 0.2067021, 0.2120122, 
+    0.2170639, 0.2218513, 0.2263682, 0.2306095, 0.2345697, 0.2382442, 
+    0.2416284, 0.2447182, 0.2475099, 0.25, 0.2521856, 0.2540638, 0.2556326, 
+    0.2568899, 0.2578342, 0.2584644, 0.2587796, 0.2587796, 0.2584644, 
+    0.2578342, 0.2568899, 0.2556326, 0.2540638, 0.2521856, 0.25, 0.2475099, 
+    0.2447183, 0.2416284, 0.2382442, 0.2345698, 0.2306095, 0.2263683, 
+    0.2218512, 0.2170639, 0.2120122, 0.2067021, 0.2011402, 0.1953332, 
+    0.1892883, 0.1830128, 0.1765142, 0.1698006, 0.1628801, 0.1557612, 
+    0.1484526, 0.140963, 0.1333017,
+  0.1417447, 0.132734, 0.1235617, 0.1142387, 0.1047767, 0.09518691, 
+    0.08548126, 0.07567139, 0.06576934, 0.05578715, 0.04573699, 0.03563119, 
+    0.0254819, 0.01530156, 0.005102588, -0.005102606, -0.01530158, 
+    -0.02548192, -0.03563114, -0.04573702, -0.05578717, -0.06576936, 
+    -0.07567141, -0.0854812, -0.09518693, -0.1047767, -0.1142388, -0.1235617, 
+    -0.132734, -0.1417447, -0.1505826, -0.1592371, -0.1676976, -0.1759537, 
+    -0.1839956, -0.1918131, -0.1993971, -0.2067381, -0.2138272, -0.2206558, 
+    -0.2272155, -0.2334985, -0.2394969, -0.2452036, -0.2506115, -0.2557141, 
+    -0.2605052, -0.2649788, -0.2691296, -0.2729526, -0.2764429, -0.2795965, 
+    -0.2824095, -0.2848783, -0.2870001, -0.2887722, -0.2901925, -0.2912592, 
+    -0.2919711, -0.2923273, -0.2923273, -0.2919711, -0.2912592, -0.2901925, 
+    -0.2887722, -0.2870001, -0.2848783, -0.2824095, -0.2795965, -0.2764429, 
+    -0.2729526, -0.2691296, -0.2649788, -0.2605052, -0.2557141, -0.2506115, 
+    -0.2452036, -0.2394969, -0.2334985, -0.2272155, -0.2206558, -0.2138272, 
+    -0.2067381, -0.1993971, -0.1918131, -0.1839955, -0.1759537, -0.1676976, 
+    -0.1592371, -0.1505826, -0.1417446, -0.132734, -0.1235616, -0.1142388, 
+    -0.1047767, -0.09518695, -0.08548123, -0.07567137, -0.06576931, 
+    -0.0557872, -0.04573704, -0.03563116, -0.02548187, -0.01530154, 
+    -0.005102562, 0.005102562, 0.01530154, 0.02548187, 0.03563116, 
+    0.04573704, 0.0557872, 0.06576931, 0.07567137, 0.08548123, 0.09518695, 
+    0.1047767, 0.1142387, 0.1235617, 0.132734, 0.1417446, 0.1505826, 
+    0.159237, 0.1676976, 0.1759537, 0.1839956, 0.1918131, 0.199397, 
+    0.2067381, 0.2138272, 0.2206558, 0.2272155, 0.2334984, 0.2394969, 
+    0.2452036, 0.2506115, 0.2557141, 0.2605052, 0.2649788, 0.2691296, 
+    0.2729526, 0.2764429, 0.2795965, 0.2824095, 0.2848783, 0.2870001, 
+    0.2887722, 0.2901925, 0.2912592, 0.2919711, 0.2923273, 0.2923273, 
+    0.2919711, 0.2912592, 0.2901925, 0.2887722, 0.2870001, 0.2848783, 
+    0.2824095, 0.2795965, 0.2764429, 0.2729526, 0.2691296, 0.2649789, 
+    0.2605051, 0.2557141, 0.2506115, 0.2452036, 0.239497, 0.2334985, 
+    0.2272156, 0.2206558, 0.2138272, 0.2067381, 0.1993971, 0.1918132, 
+    0.1839955, 0.1759537, 0.1676976, 0.1592371, 0.1505827,
+  0.1578386, 0.1478049, 0.137591, 0.1272096, 0.1166732, 0.1059946, 
+    0.09518693, 0.08426324, 0.07323689, 0.06212132, 0.05093005, 0.03967681, 
+    0.02837516, 0.01703893, 0.005681944, -0.005681964, -0.01703895, 
+    -0.02837518, -0.03967676, -0.05093007, -0.06212134, -0.07323692, 
+    -0.08426327, -0.09518688, -0.1059946, -0.1166732, -0.1272096, -0.1375911, 
+    -0.1478048, -0.1578386, -0.16768, -0.1773171, -0.1867382, -0.1959317, 
+    -0.2048867, -0.2135919, -0.2220369, -0.2302114, -0.2381055, -0.2457094, 
+    -0.2530139, -0.2600103, -0.2666898, -0.2730444, -0.2790664, -0.2847483, 
+    -0.2900833, -0.2950649, -0.2996871, -0.3039441, -0.3078307, -0.3113424, 
+    -0.3144747, -0.3172238, -0.3195865, -0.3215599, -0.3231414, -0.3243293, 
+    -0.3251219, -0.3255185, -0.3255185, -0.3251219, -0.3243293, -0.3231414, 
+    -0.3215599, -0.3195865, -0.3172238, -0.3144747, -0.3113424, -0.3078307, 
+    -0.3039441, -0.2996871, -0.295065, -0.2900833, -0.2847483, -0.2790664, 
+    -0.2730444, -0.2666898, -0.2600103, -0.2530139, -0.2457094, -0.2381055, 
+    -0.2302115, -0.2220369, -0.2135919, -0.2048867, -0.1959318, -0.1867382, 
+    -0.1773171, -0.16768, -0.1578386, -0.1478048, -0.137591, -0.1272096, 
+    -0.1166732, -0.1059946, -0.0951869, -0.08426321, -0.07323687, 
+    -0.06212137, -0.0509301, -0.03967678, -0.02837513, -0.0170389, 
+    -0.005681915, 0.005681915, 0.0170389, 0.02837513, 0.03967678, 0.0509301, 
+    0.06212137, 0.07323687, 0.08426321, 0.0951869, 0.1059946, 0.1166732, 
+    0.1272096, 0.1375911, 0.1478048, 0.1578385, 0.16768, 0.1773171, 
+    0.1867382, 0.1959318, 0.2048867, 0.2135919, 0.2220369, 0.2302115, 
+    0.2381054, 0.2457094, 0.2530139, 0.2600102, 0.2666898, 0.2730444, 
+    0.2790664, 0.2847483, 0.2900834, 0.295065, 0.299687, 0.3039441, 
+    0.3078307, 0.3113424, 0.3144747, 0.3172238, 0.3195865, 0.3215598, 
+    0.3231414, 0.3243293, 0.3251219, 0.3255185, 0.3255185, 0.3251219, 
+    0.3243293, 0.3231414, 0.3215599, 0.3195865, 0.3172238, 0.3144747, 
+    0.3113424, 0.3078307, 0.3039441, 0.2996871, 0.295065, 0.2900833, 
+    0.2847483, 0.2790663, 0.2730444, 0.2666898, 0.2600103, 0.253014, 
+    0.2457094, 0.2381055, 0.2302115, 0.2220369, 0.2135919, 0.2048866, 
+    0.1959318, 0.1867383, 0.1773171, 0.16768,
+  0.1737403, 0.1626957, 0.1514529, 0.1400255, 0.1284276, 0.1166732, 
+    0.1047767, 0.09275247, 0.08061525, 0.06837982, 0.05606107, 0.04367411, 
+    0.03123385, 0.01875554, 0.006254379, -0.006254402, -0.01875556, 
+    -0.03123388, -0.04367405, -0.0560611, -0.06837984, -0.08061527, 
+    -0.09275249, -0.1047766, -0.1166732, -0.1284276, -0.1400255, -0.1514529, 
+    -0.1626956, -0.1737403, -0.1845731, -0.1951812, -0.2055514, -0.2156712, 
+    -0.2255283, -0.2351105, -0.2444064, -0.2534044, -0.2620938, -0.2704638, 
+    -0.2785042, -0.2862054, -0.2935579, -0.3005527, -0.3071813, -0.3134357, 
+    -0.3193082, -0.3247917, -0.3298795, -0.3345653, -0.3388436, -0.342709, 
+    -0.3461569, -0.349183, -0.3517838, -0.3539559, -0.3556968, -0.3570043, 
+    -0.3578768, -0.3583134, -0.3583134, -0.3578768, -0.3570043, -0.3556968, 
+    -0.3539559, -0.3517838, -0.349183, -0.3461569, -0.342709, -0.3388436, 
+    -0.3345653, -0.3298795, -0.3247917, -0.3193082, -0.3134357, -0.3071813, 
+    -0.3005527, -0.2935579, -0.2862054, -0.2785042, -0.2704637, -0.2620938, 
+    -0.2534044, -0.2444064, -0.2351106, -0.2255283, -0.2156712, -0.2055515, 
+    -0.1951812, -0.1845732, -0.1737402, -0.1626956, -0.1514528, -0.1400256, 
+    -0.1284276, -0.1166732, -0.1047767, -0.09275243, -0.08061522, 
+    -0.06837987, -0.05606112, -0.04367408, -0.03123382, -0.01875551, 
+    -0.006254348, 0.006254348, 0.01875551, 0.03123382, 0.04367408, 
+    0.05606112, 0.06837987, 0.08061522, 0.09275243, 0.1047767, 0.1166732, 
+    0.1284276, 0.1400255, 0.1514529, 0.1626956, 0.1737402, 0.1845732, 
+    0.1951811, 0.2055515, 0.2156712, 0.2255283, 0.2351106, 0.2444063, 
+    0.2534044, 0.2620937, 0.2704638, 0.2785042, 0.2862054, 0.2935579, 
+    0.3005526, 0.3071813, 0.3134357, 0.3193083, 0.3247917, 0.3298795, 
+    0.3345653, 0.3388436, 0.342709, 0.3461569, 0.349183, 0.3517838, 
+    0.3539559, 0.3556968, 0.3570043, 0.3578768, 0.3583134, 0.3583134, 
+    0.3578768, 0.3570043, 0.3556968, 0.3539559, 0.3517838, 0.349183, 
+    0.3461569, 0.342709, 0.3388436, 0.3345654, 0.3298795, 0.3247917, 
+    0.3193082, 0.3134357, 0.3071813, 0.3005527, 0.2935579, 0.2862054, 
+    0.2785043, 0.2704637, 0.2620938, 0.2534045, 0.2444064, 0.2351106, 
+    0.2255282, 0.2156713, 0.2055515, 0.1951812, 0.1845732,
+  0.1894303, 0.1773883, 0.1651301, 0.1526708, 0.1400255, 0.1272096, 
+    0.1142388, 0.1011287, 0.08789539, 0.07455501, 0.06112379, 0.0476182, 
+    0.0340545, 0.0204493, 0.006819195, -0.00681922, -0.02044933, -0.03405452, 
+    -0.04761813, -0.06112382, -0.07455503, -0.08789542, -0.1011287, 
+    -0.1142387, -0.1272096, -0.1400255, -0.1526708, -0.1651302, -0.1773882, 
+    -0.1894303, -0.2012414, -0.2128075, -0.2241142, -0.2351478, -0.2458951, 
+    -0.2563427, -0.266478, -0.2762887, -0.2857627, -0.2948886, -0.3036551, 
+    -0.3120518, -0.3200682, -0.3276947, -0.334922, -0.3417411, -0.3481441, 
+    -0.3541227, -0.35967, -0.364779, -0.3694436, -0.3736581, -0.3774173, 
+    -0.3807168, -0.3835523, -0.3859206, -0.3878187, -0.3892443, -0.3901957, 
+    -0.3906717, -0.3906717, -0.3901957, -0.3892443, -0.3878187, -0.3859206, 
+    -0.3835523, -0.3807168, -0.3774173, -0.3736581, -0.3694436, -0.364779, 
+    -0.35967, -0.3541227, -0.348144, -0.3417412, -0.334922, -0.3276948, 
+    -0.3200682, -0.3120518, -0.3036551, -0.2948886, -0.2857627, -0.2762887, 
+    -0.266478, -0.2563427, -0.2458951, -0.2351479, -0.2241142, -0.2128075, 
+    -0.2012415, -0.1894302, -0.1773882, -0.1651301, -0.1526709, -0.1400256, 
+    -0.1272096, -0.1142387, -0.1011286, -0.08789536, -0.07455507, 
+    -0.06112384, -0.04761816, -0.03405446, -0.02044927, -0.006819161, 
+    0.006819161, 0.02044927, 0.03405446, 0.04761816, 0.06112384, 0.07455507, 
+    0.08789536, 0.1011286, 0.1142387, 0.1272096, 0.1400256, 0.1526708, 
+    0.1651302, 0.1773882, 0.1894301, 0.2012415, 0.2128074, 0.2241142, 
+    0.2351479, 0.2458952, 0.2563427, 0.266478, 0.2762887, 0.2857627, 
+    0.2948886, 0.3036551, 0.3120517, 0.3200682, 0.3276947, 0.334922, 
+    0.3417412, 0.3481441, 0.3541227, 0.3596699, 0.364779, 0.3694436, 
+    0.3736581, 0.3774173, 0.3807167, 0.3835523, 0.3859206, 0.3878187, 
+    0.3892443, 0.3901957, 0.3906717, 0.3906717, 0.3901957, 0.3892443, 
+    0.3878187, 0.3859206, 0.3835524, 0.3807168, 0.3774174, 0.3736581, 
+    0.3694436, 0.364779, 0.35967, 0.3541228, 0.348144, 0.3417412, 0.334922, 
+    0.3276947, 0.3200683, 0.3120518, 0.3036552, 0.2948885, 0.2857627, 
+    0.2762887, 0.266478, 0.2563428, 0.2458951, 0.2351479, 0.2241143, 
+    0.2128075, 0.2012415,
+  0.2048894, 0.1918647, 0.1786062, 0.1651301, 0.1514528, 0.137591, 0.1235617, 
+    0.1093817, 0.09506842, 0.08063934, 0.06611202, 0.05150425, 0.03683364, 
+    0.02211814, 0.0073757, -0.007375727, -0.02211817, -0.03683366, 
+    -0.05150418, -0.06611205, -0.08063937, -0.09506845, -0.1093817, 
+    -0.1235616, -0.137591, -0.1514528, -0.1651301, -0.1786062, -0.1918646, 
+    -0.2048894, -0.2176645, -0.2301744, -0.2424039, -0.2543379, -0.2659623, 
+    -0.2772625, -0.2882249, -0.2988362, -0.3090834, -0.3189541, -0.328436, 
+    -0.337518, -0.3461886, -0.3544375, -0.3622545, -0.3696302, -0.3765557, 
+    -0.3830222, -0.3890221, -0.3945481, -0.3995934, -0.4041518, -0.4082179, 
+    -0.4117866, -0.4148535, -0.4174151, -0.4194681, -0.42101, -0.422039, 
+    -0.4225539, -0.4225539, -0.422039, -0.42101, -0.4194681, -0.4174151, 
+    -0.4148535, -0.4117866, -0.4082179, -0.4041518, -0.3995934, -0.3945481, 
+    -0.3890221, -0.3830222, -0.3765556, -0.3696302, -0.3622545, -0.3544375, 
+    -0.3461886, -0.3375179, -0.328436, -0.318954, -0.3090834, -0.2988362, 
+    -0.288225, -0.2772625, -0.2659623, -0.254338, -0.2424039, -0.2301744, 
+    -0.2176645, -0.2048894, -0.1918647, -0.1786062, -0.1651301, -0.1514529, 
+    -0.137591, -0.1235616, -0.1093816, -0.09506838, -0.08063941, -0.06611208, 
+    -0.05150422, -0.0368336, -0.02211811, -0.007375663, 0.007375663, 
+    0.02211811, 0.0368336, 0.05150422, 0.06611208, 0.08063941, 0.09506838, 
+    0.1093816, 0.1235616, 0.137591, 0.1514529, 0.16513, 0.1786062, 0.1918647, 
+    0.2048893, 0.2176645, 0.2301743, 0.2424039, 0.254338, 0.2659624, 
+    0.2772625, 0.2882249, 0.2988362, 0.3090834, 0.3189541, 0.328436, 
+    0.3375179, 0.3461886, 0.3544374, 0.3622546, 0.3696302, 0.3765557, 
+    0.3830222, 0.3890221, 0.3945481, 0.3995934, 0.4041519, 0.4082179, 
+    0.4117865, 0.4148535, 0.4174151, 0.4194681, 0.42101, 0.422039, 0.4225539, 
+    0.4225539, 0.422039, 0.42101, 0.4194681, 0.4174151, 0.4148536, 0.4117866, 
+    0.4082179, 0.4041518, 0.3995934, 0.3945481, 0.3890221, 0.3830222, 
+    0.3765556, 0.3696302, 0.3622545, 0.3544375, 0.3461887, 0.3375179, 
+    0.3284361, 0.318954, 0.3090834, 0.2988363, 0.2882249, 0.2772626, 
+    0.2659622, 0.254338, 0.2424039, 0.2301744, 0.2176646,
+  0.220099, 0.2061074, 0.1918647, 0.1773882, 0.1626956, 0.1478048, 0.132734, 
+    0.1175014, 0.1021256, 0.08662546, 0.07101972, 0.05532758, 0.03956791, 
+    0.02376004, 0.007923221, -0.00792325, -0.02376007, -0.03956794, 
+    -0.0553275, -0.07101975, -0.08662548, -0.1021257, -0.1175014, -0.1327339, 
+    -0.1478048, -0.1626956, -0.1773882, -0.1918647, -0.2061073, -0.220099, 
+    -0.2338224, -0.247261, -0.2603983, -0.2732182, -0.2857055, -0.2978446, 
+    -0.3096208, -0.3210198, -0.3320276, -0.342631, -0.3528168, -0.362573, 
+    -0.3718872, -0.3807485, -0.3891458, -0.397069, -0.4045085, -0.4114551, 
+    -0.4179005, -0.4238367, -0.4292565, -0.4341533, -0.4385211, -0.4423548, 
+    -0.4456494, -0.4484012, -0.4506065, -0.452263, -0.4533683, -0.4539214, 
+    -0.4539214, -0.4533683, -0.452263, -0.4506065, -0.4484012, -0.4456494, 
+    -0.4423548, -0.4385211, -0.4341533, -0.4292565, -0.4238367, -0.4179005, 
+    -0.4114552, -0.4045085, -0.397069, -0.3891458, -0.3807485, -0.3718873, 
+    -0.362573, -0.3528169, -0.342631, -0.3320277, -0.3210198, -0.3096208, 
+    -0.2978446, -0.2857055, -0.2732183, -0.2603983, -0.247261, -0.2338224, 
+    -0.220099, -0.2061074, -0.1918647, -0.1773883, -0.1626957, -0.1478049, 
+    -0.132734, -0.1175014, -0.1021256, -0.08662552, -0.07101979, -0.05532753, 
+    -0.03956787, -0.02376, -0.007923182, 0.007923182, 0.02376, 0.03956787, 
+    0.05532753, 0.07101979, 0.08662552, 0.1021256, 0.1175014, 0.132734, 
+    0.1478049, 0.1626957, 0.1773882, 0.1918647, 0.2061074, 0.2200989, 
+    0.2338224, 0.2472609, 0.2603983, 0.2732183, 0.2857056, 0.2978446, 
+    0.3096207, 0.3210198, 0.3320276, 0.342631, 0.3528169, 0.3625729, 
+    0.3718873, 0.3807485, 0.3891459, 0.397069, 0.4045086, 0.4114552, 
+    0.4179004, 0.4238367, 0.4292565, 0.4341533, 0.4385211, 0.4423547, 
+    0.4456494, 0.4484011, 0.4506065, 0.452263, 0.4533683, 0.4539214, 
+    0.4539214, 0.4533683, 0.452263, 0.4506065, 0.4484012, 0.4456494, 
+    0.4423548, 0.4385212, 0.4341533, 0.4292565, 0.4238367, 0.4179005, 
+    0.4114552, 0.4045085, 0.3970691, 0.3891458, 0.3807485, 0.3718873, 
+    0.3625729, 0.3528169, 0.342631, 0.3320276, 0.3210199, 0.3096208, 
+    0.2978446, 0.2857054, 0.2732184, 0.2603984, 0.247261, 0.2338225,
+  0.2350404, 0.220099, 0.2048894, 0.1894302, 0.1737402, 0.1578385, 0.1417446, 
+    0.125478, 0.1090584, 0.09250601, 0.07584088, 0.05908348, 0.04225397, 
+    0.02537299, 0.008461088, -0.008461119, -0.02537302, -0.042254, 
+    -0.05908339, -0.07584092, -0.09250604, -0.1090585, -0.125478, -0.1417446, 
+    -0.1578385, -0.1737402, -0.1894302, -0.2048894, -0.2200989, -0.2350404, 
+    -0.2496954, -0.2640462, -0.2780754, -0.2917656, -0.3051006, -0.3180637, 
+    -0.3306393, -0.3428121, -0.3545673, -0.3658904, -0.3767678, -0.3871862, 
+    -0.3971327, -0.4065955, -0.4155629, -0.424024, -0.4319685, -0.4393867, 
+    -0.4462696, -0.4526087, -0.4583965, -0.4636257, -0.4682901, -0.4723839, 
+    -0.4759023, -0.4788408, -0.4811959, -0.4829648, -0.4841452, -0.4847358, 
+    -0.4847358, -0.4841452, -0.4829648, -0.4811959, -0.4788408, -0.4759023, 
+    -0.4723839, -0.4682901, -0.4636257, -0.4583965, -0.4526087, -0.4462696, 
+    -0.4393867, -0.4319685, -0.424024, -0.4155629, -0.4065956, -0.3971328, 
+    -0.3871862, -0.3767678, -0.3658904, -0.3545673, -0.3428122, -0.3306393, 
+    -0.3180637, -0.3051006, -0.2917657, -0.2780754, -0.2640463, -0.2496954, 
+    -0.2350403, -0.2200989, -0.2048893, -0.1894302, -0.1737402, -0.1578386, 
+    -0.1417446, -0.1254779, -0.1090584, -0.09250608, -0.07584096, 
+    -0.05908344, -0.04225393, -0.02537294, -0.008461046, 0.008461046, 
+    0.02537294, 0.04225393, 0.05908344, 0.07584096, 0.09250608, 0.1090584, 
+    0.1254779, 0.1417446, 0.1578386, 0.1737402, 0.1894301, 0.2048894, 
+    0.2200989, 0.2350402, 0.2496954, 0.2640461, 0.2780754, 0.2917657, 
+    0.3051006, 0.3180637, 0.3306392, 0.3428122, 0.3545673, 0.3658905, 
+    0.3767678, 0.3871861, 0.3971328, 0.4065955, 0.415563, 0.424024, 
+    0.4319686, 0.4393867, 0.4462695, 0.4526087, 0.4583965, 0.4636257, 
+    0.4682901, 0.4723839, 0.4759023, 0.4788407, 0.4811959, 0.4829648, 
+    0.4841452, 0.4847358, 0.4847358, 0.4841452, 0.4829648, 0.4811959, 
+    0.4788408, 0.4759023, 0.4723839, 0.4682901, 0.4636257, 0.4583965, 
+    0.4526088, 0.4462696, 0.4393867, 0.4319685, 0.424024, 0.4155629, 
+    0.4065955, 0.3971328, 0.3871861, 0.3767678, 0.3658904, 0.3545673, 
+    0.3428122, 0.3306393, 0.3180638, 0.3051005, 0.2917657, 0.2780755, 
+    0.2640462, 0.2496955,
+  0.2496955, 0.2338224, 0.2176645, 0.2012414, 0.1845731, 0.1676799, 
+    0.1505826, 0.1333017, 0.1158584, 0.09827387, 0.08056965, 0.06276741, 
+    0.04488856, 0.02695503, 0.008988648, -0.00898868, -0.02695506, 
+    -0.0448886, -0.06276732, -0.0805697, -0.0982739, -0.1158584, -0.1333017, 
+    -0.1505825, -0.16768, -0.1845731, -0.2012414, -0.2176645, -0.2338223, 
+    -0.2496955, -0.2652642, -0.2805099, -0.2954137, -0.3099576, -0.324124, 
+    -0.3378953, -0.3512551, -0.3641869, -0.376675, -0.3887042, -0.4002597, 
+    -0.4113277, -0.4218945, -0.4319473, -0.4414738, -0.4504624, -0.4589023, 
+    -0.466783, -0.474095, -0.4808295, -0.4869781, -0.4925334, -0.4974886, 
+    -0.5018377, -0.5055754, -0.5086971, -0.5111991, -0.5130782, -0.5143322, 
+    -0.5149596, -0.5149596, -0.5143322, -0.5130782, -0.5111991, -0.5086971, 
+    -0.5055754, -0.5018377, -0.4974886, -0.4925334, -0.4869781, -0.4808295, 
+    -0.474095, -0.466783, -0.4589023, -0.4504624, -0.4414738, -0.4319473, 
+    -0.4218945, -0.4113277, -0.4002597, -0.3887042, -0.376675, -0.3641869, 
+    -0.3512551, -0.3378954, -0.3241239, -0.3099576, -0.2954137, -0.2805099, 
+    -0.2652642, -0.2496954, -0.2338224, -0.2176645, -0.2012414, -0.1845732, 
+    -0.16768, -0.1505826, -0.1333016, -0.1158583, -0.09827396, -0.08056974, 
+    -0.06276736, -0.04488852, -0.02695498, -0.008988603, 0.008988603, 
+    0.02695498, 0.04488852, 0.06276736, 0.08056974, 0.09827396, 0.1158583, 
+    0.1333016, 0.1505826, 0.16768, 0.1845732, 0.2012413, 0.2176646, 
+    0.2338224, 0.2496953, 0.2652642, 0.2805098, 0.2954137, 0.3099576, 
+    0.324124, 0.3378954, 0.351255, 0.3641869, 0.376675, 0.3887042, 0.4002597, 
+    0.4113276, 0.4218945, 0.4319472, 0.4414738, 0.4504624, 0.4589024, 
+    0.466783, 0.474095, 0.4808295, 0.4869781, 0.4925334, 0.4974886, 
+    0.5018377, 0.5055754, 0.5086971, 0.5111991, 0.5130782, 0.5143322, 
+    0.5149596, 0.5149596, 0.5143322, 0.5130782, 0.5111991, 0.5086971, 
+    0.5055754, 0.5018377, 0.4974886, 0.4925334, 0.4869781, 0.4808295, 
+    0.474095, 0.4667831, 0.4589023, 0.4504625, 0.4414737, 0.4319473, 
+    0.4218946, 0.4113277, 0.4002598, 0.3887041, 0.376675, 0.364187, 
+    0.3512551, 0.3378955, 0.3241239, 0.3099577, 0.2954138, 0.2805099, 
+    0.2652643,
+  0.2640463, 0.247261, 0.2301744, 0.2128074, 0.1951811, 0.1773171, 0.1592371, 
+    0.140963, 0.1225171, 0.103922, 0.08520027, 0.06637486, 0.04746846, 
+    0.02850422, 0.009505256, -0.009505291, -0.02850426, -0.04746849, 
+    -0.06637477, -0.08520031, -0.103922, -0.1225172, -0.140963, -0.159237, 
+    -0.1773171, -0.1951812, -0.2128074, -0.2301745, -0.2472609, -0.2640463, 
+    -0.2805098, -0.2966317, -0.3123921, -0.3277719, -0.3427525, -0.3573153, 
+    -0.3714429, -0.3851179, -0.3983238, -0.4110443, -0.423264, -0.4349681, 
+    -0.4461422, -0.4567727, -0.4668468, -0.476352, -0.485277, -0.4936106, 
+    -0.5013429, -0.5084644, -0.5149664, -0.5208409, -0.5260809, -0.53068, 
+    -0.5346325, -0.5379336, -0.5405794, -0.5425665, -0.5438926, -0.5445561, 
+    -0.5445561, -0.5438926, -0.5425665, -0.5405794, -0.5379336, -0.5346325, 
+    -0.53068, -0.5260809, -0.5208409, -0.5149663, -0.5084644, -0.5013429, 
+    -0.4936106, -0.4852769, -0.476352, -0.4668468, -0.4567728, -0.4461422, 
+    -0.4349681, -0.423264, -0.4110443, -0.3983238, -0.385118, -0.3714429, 
+    -0.3573154, -0.3427525, -0.3277719, -0.3123922, -0.2966317, -0.2805099, 
+    -0.2640463, -0.2472609, -0.2301744, -0.2128075, -0.1951812, -0.1773171, 
+    -0.159237, -0.1409629, -0.1225171, -0.1039221, -0.08520035, -0.06637482, 
+    -0.04746841, -0.02850417, -0.009505208, 0.009505208, 0.02850417, 
+    0.04746841, 0.06637482, 0.08520035, 0.1039221, 0.1225171, 0.1409629, 
+    0.159237, 0.1773171, 0.1951812, 0.2128074, 0.2301745, 0.2472609, 
+    0.2640461, 0.2805099, 0.2966316, 0.3123922, 0.3277719, 0.3427525, 
+    0.3573154, 0.3714429, 0.385118, 0.3983237, 0.4110444, 0.423264, 0.434968, 
+    0.4461422, 0.4567727, 0.4668468, 0.476352, 0.485277, 0.4936106, 
+    0.5013429, 0.5084644, 0.5149663, 0.5208409, 0.5260809, 0.5306799, 
+    0.5346325, 0.5379336, 0.5405794, 0.5425665, 0.5438926, 0.5445561, 
+    0.5445561, 0.5438926, 0.5425665, 0.5405794, 0.5379336, 0.5346325, 
+    0.53068, 0.526081, 0.5208409, 0.5149664, 0.5084644, 0.5013429, 0.4936107, 
+    0.4852769, 0.4763521, 0.4668467, 0.4567727, 0.4461423, 0.4349681, 
+    0.4232641, 0.4110443, 0.3983238, 0.3851181, 0.3714429, 0.3573154, 
+    0.3427524, 0.327772, 0.3123922, 0.2966317, 0.2805099,
+  0.2780754, 0.2603983, 0.2424039, 0.2241141, 0.2055514, 0.1867382, 
+    0.1676976, 0.1484525, 0.1290266, 0.1094435, 0.08972707, 0.06990145, 
+    0.04999052, 0.03001869, 0.01001028, -0.01001032, -0.03001872, 
+    -0.04999056, -0.06990135, -0.08972711, -0.1094436, -0.1290267, 
+    -0.1484526, -0.1676975, -0.1867382, -0.2055514, -0.2241142, -0.2424039, 
+    -0.2603982, -0.2780755, -0.2954137, -0.3123921, -0.32899, -0.3451868, 
+    -0.3609634, -0.3763, -0.3911782, -0.4055798, -0.4194873, -0.4328837, 
+    -0.4457526, -0.4580786, -0.4698463, -0.4810417, -0.491651, -0.5016612, 
+    -0.5110604, -0.5198368, -0.5279799, -0.5354798, -0.5423272, -0.5485139, 
+    -0.5540323, -0.5588757, -0.5630382, -0.5665148, -0.5693011, -0.5713938, 
+    -0.5727904, -0.5734891, -0.5734891, -0.5727904, -0.5713938, -0.5693011, 
+    -0.5665148, -0.5630382, -0.5588757, -0.5540323, -0.5485139, -0.5423272, 
+    -0.5354798, -0.5279799, -0.5198368, -0.5110604, -0.5016612, -0.4916509, 
+    -0.4810417, -0.4698463, -0.4580785, -0.4457526, -0.4328836, -0.4194873, 
+    -0.4055798, -0.3911782, -0.3763, -0.3609633, -0.3451869, -0.32899, 
+    -0.3123922, -0.2954137, -0.2780754, -0.2603982, -0.2424038, -0.2241142, 
+    -0.2055514, -0.1867382, -0.1676975, -0.1484525, -0.1290266, -0.1094436, 
+    -0.08972716, -0.0699014, -0.04999047, -0.03001864, -0.01001023, 
+    0.01001023, 0.03001864, 0.04999047, 0.0699014, 0.08972716, 0.1094436, 
+    0.1290266, 0.1484525, 0.1676975, 0.1867382, 0.2055514, 0.2241141, 
+    0.242404, 0.2603982, 0.2780752, 0.2954137, 0.312392, 0.32899, 0.3451869, 
+    0.3609635, 0.3763, 0.3911781, 0.4055798, 0.4194872, 0.4328837, 0.4457526, 
+    0.4580784, 0.4698463, 0.4810416, 0.491651, 0.5016612, 0.5110604, 
+    0.5198368, 0.5279799, 0.5354798, 0.5423272, 0.5485139, 0.5540323, 
+    0.5588757, 0.5630382, 0.5665147, 0.5693011, 0.5713938, 0.5727904, 
+    0.5734891, 0.5734891, 0.5727904, 0.5713938, 0.5693011, 0.5665148, 
+    0.5630383, 0.5588757, 0.5540323, 0.5485139, 0.5423272, 0.5354798, 
+    0.5279799, 0.5198368, 0.5110604, 0.5016613, 0.4916509, 0.4810417, 
+    0.4698464, 0.4580785, 0.4457527, 0.4328836, 0.4194873, 0.4055799, 
+    0.3911782, 0.3763001, 0.3609633, 0.345187, 0.32899, 0.3123921, 0.2954138,
+  0.2917658, 0.2732183, 0.254338, 0.2351478, 0.2156712, 0.1959317, 0.1759537, 
+    0.1557612, 0.1353789, 0.1148317, 0.09414456, 0.07334287, 0.05245168, 
+    0.03149658, 0.01050311, -0.01050315, -0.03149662, -0.05245172, 
+    -0.07334277, -0.09414461, -0.1148317, -0.135379, -0.1557612, -0.1759536, 
+    -0.1959318, -0.2156712, -0.2351479, -0.2543381, -0.2732182, -0.2917658, 
+    -0.3099576, -0.327772, -0.3451869, -0.3621812, -0.3787346, -0.3948261, 
+    -0.4104368, -0.4255475, -0.4401397, -0.4541956, -0.4676981, -0.4806309, 
+    -0.492978, -0.5047246, -0.5158562, -0.5263593, -0.5362211, -0.5454296, 
+    -0.5539737, -0.5618427, -0.5690273, -0.5755185, -0.5813087, -0.5863906, 
+    -0.590758, -0.5944057, -0.5973292, -0.599525, -0.6009902, -0.6017234, 
+    -0.6017234, -0.6009902, -0.599525, -0.5973292, -0.5944057, -0.590758, 
+    -0.5863906, -0.5813087, -0.5755185, -0.5690273, -0.5618427, -0.5539737, 
+    -0.5454297, -0.5362211, -0.5263593, -0.5158561, -0.5047246, -0.492978, 
+    -0.4806309, -0.4676981, -0.4541956, -0.4401397, -0.4255475, -0.4104369, 
+    -0.3948262, -0.3787345, -0.3621813, -0.345187, -0.327772, -0.3099577, 
+    -0.2917657, -0.2732183, -0.254338, -0.2351479, -0.2156713, -0.1959318, 
+    -0.1759537, -0.1557612, -0.1353789, -0.1148318, -0.09414465, -0.07334282, 
+    -0.05245163, -0.03149653, -0.01050306, 0.01050306, 0.03149653, 
+    0.05245163, 0.07334282, 0.09414465, 0.1148318, 0.1353789, 0.1557612, 
+    0.1759537, 0.1959318, 0.2156713, 0.2351478, 0.2543381, 0.2732183, 
+    0.2917656, 0.3099577, 0.3277719, 0.345187, 0.3621813, 0.3787346, 
+    0.3948262, 0.4104368, 0.4255475, 0.4401396, 0.4541956, 0.4676981, 
+    0.4806308, 0.492978, 0.5047245, 0.5158562, 0.5263593, 0.5362212, 
+    0.5454297, 0.5539736, 0.5618427, 0.5690273, 0.5755186, 0.5813087, 
+    0.5863906, 0.590758, 0.5944057, 0.5973292, 0.599525, 0.6009902, 
+    0.6017234, 0.6017234, 0.6009902, 0.599525, 0.5973292, 0.5944057, 
+    0.590758, 0.5863906, 0.5813087, 0.5755185, 0.5690273, 0.5618428, 
+    0.5539737, 0.5454297, 0.5362211, 0.5263593, 0.5158561, 0.5047246, 
+    0.4929781, 0.4806308, 0.4676982, 0.4541955, 0.4401397, 0.4255476, 
+    0.4104368, 0.3948263, 0.3787344, 0.3621814, 0.345187, 0.327772, 0.3099578,
+  0.3051006, 0.2857055, 0.2659623, 0.2458951, 0.2255282, 0.2048866, 
+    0.1839955, 0.1628801, 0.1415663, 0.12008, 0.09844735, 0.07669494, 
+    0.05484894, 0.0329361, 0.01098315, -0.01098319, -0.03293614, -0.05484898, 
+    -0.07669483, -0.0984474, -0.12008, -0.1415663, -0.1628802, -0.1839954, 
+    -0.2048867, -0.2255283, -0.2458951, -0.2659624, -0.2857054, -0.3051007, 
+    -0.3241239, -0.3427525, -0.3609634, -0.3787344, -0.3960443, -0.4128713, 
+    -0.4291955, -0.4449967, -0.4602558, -0.4749542, -0.4890738, -0.5025977, 
+    -0.5155091, -0.5277925, -0.5394329, -0.550416, -0.5607287, -0.570358, 
+    -0.5792925, -0.5875213, -0.5950342, -0.6018221, -0.6078768, -0.613191, 
+    -0.617758, -0.6215725, -0.6246296, -0.6269257, -0.628458, -0.6292246, 
+    -0.6292246, -0.628458, -0.6269257, -0.6246296, -0.6215725, -0.617758, 
+    -0.613191, -0.6078768, -0.6018221, -0.5950342, -0.5875213, -0.5792925, 
+    -0.570358, -0.5607286, -0.5504161, -0.5394329, -0.5277926, -0.5155091, 
+    -0.5025977, -0.4890738, -0.4749541, -0.4602559, -0.4449968, -0.4291955, 
+    -0.4128714, -0.3960442, -0.3787345, -0.3609634, -0.3427525, -0.324124, 
+    -0.3051006, -0.2857055, -0.2659623, -0.2458951, -0.2255283, -0.2048867, 
+    -0.1839955, -0.1628801, -0.1415662, -0.1200801, -0.09844744, -0.07669488, 
+    -0.05484888, -0.03293605, -0.01098309, 0.01098309, 0.03293605, 
+    0.05484888, 0.07669488, 0.09844744, 0.1200801, 0.1415662, 0.1628801, 
+    0.1839955, 0.2048867, 0.2255283, 0.245895, 0.2659624, 0.2857055, 
+    0.3051005, 0.324124, 0.3427524, 0.3609634, 0.3787345, 0.3960443, 
+    0.4128714, 0.4291954, 0.4449968, 0.4602558, 0.4749542, 0.4890738, 
+    0.5025976, 0.5155091, 0.5277925, 0.5394329, 0.5504161, 0.5607287, 
+    0.570358, 0.5792925, 0.5875213, 0.5950342, 0.6018221, 0.6078768, 
+    0.6131909, 0.617758, 0.6215724, 0.6246296, 0.6269257, 0.628458, 
+    0.6292246, 0.6292246, 0.628458, 0.6269257, 0.6246296, 0.6215725, 
+    0.6177581, 0.613191, 0.6078769, 0.6018221, 0.5950342, 0.5875213, 
+    0.5792925, 0.5703581, 0.5607286, 0.5504161, 0.5394328, 0.5277925, 
+    0.5155092, 0.5025976, 0.4890739, 0.4749541, 0.4602558, 0.4449969, 
+    0.4291955, 0.4128714, 0.3960441, 0.3787346, 0.3609635, 0.3427525, 
+    0.3241241,
+  0.3180638, 0.2978446, 0.2772625, 0.2563426, 0.2351105, 0.2135919, 
+    0.1918131, 0.1698006, 0.1475812, 0.1251819, 0.1026302, 0.07995355, 
+    0.05717936, 0.03433549, 0.0114498, -0.01144984, -0.03433554, -0.0571794, 
+    -0.07995344, -0.1026302, -0.125182, -0.1475812, -0.1698006, -0.191813, 
+    -0.2135919, -0.2351105, -0.2563427, -0.2772626, -0.2978445, -0.3180638, 
+    -0.3378953, -0.3573154, -0.3763, -0.3948261, -0.4128714, -0.4304134, 
+    -0.4474311, -0.4639038, -0.4798112, -0.4951341, -0.5098535, -0.5239521, 
+    -0.537412, -0.5502174, -0.5623524, -0.5738021, -0.5845529, -0.5945914, 
+    -0.6039055, -0.6124839, -0.620316, -0.6273924, -0.6337044, -0.6392443, 
+    -0.6440054, -0.6479819, -0.6511689, -0.6535625, -0.6551599, -0.6559591, 
+    -0.6559591, -0.6551599, -0.6535625, -0.6511689, -0.6479819, -0.6440054, 
+    -0.6392443, -0.6337044, -0.6273924, -0.620316, -0.6124839, -0.6039055, 
+    -0.5945914, -0.5845529, -0.5738021, -0.5623523, -0.5502174, -0.5374121, 
+    -0.5239521, -0.5098536, -0.495134, -0.4798112, -0.4639038, -0.4474312, 
+    -0.4304135, -0.4128713, -0.3948261, -0.3763, -0.3573154, -0.3378954, 
+    -0.3180637, -0.2978445, -0.2772625, -0.2563427, -0.2351106, -0.2135919, 
+    -0.1918131, -0.1698005, -0.1475811, -0.125182, -0.1026303, -0.0799535, 
+    -0.0571793, -0.03433544, -0.01144974, 0.01144974, 0.03433544, 0.0571793, 
+    0.0799535, 0.1026303, 0.125182, 0.1475811, 0.1698005, 0.1918131, 
+    0.2135919, 0.2351106, 0.2563426, 0.2772626, 0.2978445, 0.3180636, 
+    0.3378954, 0.3573152, 0.3763, 0.3948261, 0.4128715, 0.4304135, 0.4474311, 
+    0.4639038, 0.4798112, 0.4951341, 0.5098536, 0.5239519, 0.5374121, 
+    0.5502173, 0.5623524, 0.5738021, 0.5845529, 0.5945914, 0.6039055, 
+    0.6124839, 0.620316, 0.6273924, 0.6337044, 0.6392443, 0.6440054, 
+    0.6479818, 0.6511689, 0.6535625, 0.6551599, 0.6559591, 0.6559591, 
+    0.6551599, 0.6535625, 0.6511689, 0.6479819, 0.6440054, 0.6392443, 
+    0.6337044, 0.6273924, 0.620316, 0.6124839, 0.6039055, 0.5945914, 
+    0.5845528, 0.5738022, 0.5623522, 0.5502174, 0.5374122, 0.523952, 
+    0.5098537, 0.495134, 0.4798112, 0.4639039, 0.4474311, 0.4304135, 
+    0.4128712, 0.3948262, 0.3763001, 0.3573154, 0.3378955,
+  0.3306394, 0.3096208, 0.288225, 0.266478, 0.2444063, 0.2220369, 0.1993971, 
+    0.1765142, 0.1534162, 0.1301314, 0.106688, 0.08311477, 0.05944012, 
+    0.03569306, 0.0119025, -0.01190255, -0.0356931, -0.05944017, -0.08311465, 
+    -0.106688, -0.1301314, -0.1534163, -0.1765142, -0.199397, -0.2220369, 
+    -0.2444063, -0.266478, -0.288225, -0.3096207, -0.3306395, -0.3512551, 
+    -0.3714429, -0.3911782, -0.4104367, -0.4291956, -0.4474311, -0.4651217, 
+    -0.4822457, -0.498782, -0.5147107, -0.5300122, -0.5446682, -0.5586603, 
+    -0.571972, -0.5845867, -0.5964891, -0.6076651, -0.6181004, -0.6277828, 
+    -0.6367003, -0.6448421, -0.6521983, -0.6587598, -0.6645188, -0.6694681, 
+    -0.6736019, -0.6769149, -0.6794032, -0.6810637, -0.6818945, -0.6818945, 
+    -0.6810637, -0.6794032, -0.6769149, -0.6736019, -0.6694681, -0.6645188, 
+    -0.6587598, -0.6521983, -0.6448421, -0.6367003, -0.6277828, -0.6181005, 
+    -0.607665, -0.5964892, -0.5845867, -0.571972, -0.5586604, -0.5446681, 
+    -0.5300122, -0.5147107, -0.4987821, -0.4822457, -0.4651218, -0.4474312, 
+    -0.4291955, -0.4104368, -0.3911783, -0.371443, -0.3512552, -0.3306394, 
+    -0.3096208, -0.2882249, -0.2664781, -0.2444064, -0.222037, -0.199397, 
+    -0.1765141, -0.1534162, -0.1301315, -0.1066881, -0.08311471, -0.05944006, 
+    -0.035693, -0.01190244, 0.01190244, 0.035693, 0.05944006, 0.08311471, 
+    0.1066881, 0.1301315, 0.1534162, 0.1765141, 0.199397, 0.222037, 
+    0.2444064, 0.2664779, 0.2882251, 0.3096208, 0.3306392, 0.3512552, 
+    0.3714428, 0.3911783, 0.4104368, 0.4291956, 0.4474312, 0.4651217, 
+    0.4822457, 0.498782, 0.5147108, 0.5300122, 0.544668, 0.5586604, 
+    0.5719719, 0.5845867, 0.5964892, 0.6076651, 0.6181005, 0.6277828, 
+    0.6367003, 0.6448421, 0.6521983, 0.6587598, 0.6645188, 0.6694681, 
+    0.6736018, 0.6769149, 0.6794032, 0.6810637, 0.6818945, 0.6818945, 
+    0.6810637, 0.6794032, 0.6769149, 0.6736019, 0.6694682, 0.6645188, 
+    0.6587599, 0.6521983, 0.6448421, 0.6367004, 0.6277828, 0.6181005, 
+    0.6076649, 0.5964893, 0.5845866, 0.571972, 0.5586604, 0.5446681, 
+    0.5300123, 0.5147107, 0.498782, 0.4822458, 0.4651217, 0.4474313, 
+    0.4291954, 0.4104369, 0.3911783, 0.3714429, 0.3512552,
+  0.3428122, 0.3210198, 0.2988362, 0.2762886, 0.2534043, 0.2302114, 
+    0.2067381, 0.1830127, 0.1590644, 0.1349223, 0.1106158, 0.08617471, 
+    0.06162846, 0.03700713, 0.01234071, -0.01234075, -0.03700718, 
+    -0.06162851, -0.08617459, -0.1106159, -0.1349223, -0.1590645, -0.1830128, 
+    -0.2067379, -0.2302114, -0.2534044, -0.2762887, -0.2988363, -0.3210196, 
+    -0.3428123, -0.3641869, -0.3851179, -0.4055798, -0.4255474, -0.4449968, 
+    -0.4639037, -0.4822456, -0.5, -0.5171452, -0.5336603, -0.5495251, 
+    -0.5647206, -0.5792279, -0.5930296, -0.6061088, -0.6184494, -0.6300368, 
+    -0.6408563, -0.6508952, -0.6601411, -0.6685826, -0.6762096, -0.6830127, 
+    -0.6889837, -0.6941152, -0.6984012, -0.7018361, -0.704416, -0.7061377, 
+    -0.7069991, -0.7069991, -0.7061377, -0.704416, -0.7018361, -0.6984012, 
+    -0.6941152, -0.6889837, -0.6830127, -0.6762096, -0.6685826, -0.6601411, 
+    -0.6508952, -0.6408564, -0.6300368, -0.6184495, -0.6061088, -0.5930297, 
+    -0.579228, -0.5647206, -0.5495251, -0.5336602, -0.5171452, -0.5, 
+    -0.4822457, -0.4639038, -0.4449967, -0.4255475, -0.4055798, -0.385118, 
+    -0.3641869, -0.3428122, -0.3210197, -0.2988362, -0.2762887, -0.2534044, 
+    -0.2302115, -0.206738, -0.1830126, -0.1590644, -0.1349224, -0.1106159, 
+    -0.08617465, -0.0616284, -0.03700707, -0.01234064, 0.01234064, 
+    0.03700707, 0.0616284, 0.08617465, 0.1106159, 0.1349224, 0.1590644, 
+    0.1830126, 0.206738, 0.2302115, 0.2534044, 0.2762885, 0.2988363, 
+    0.3210197, 0.342812, 0.3641869, 0.3851178, 0.4055798, 0.4255475, 
+    0.4449968, 0.4639038, 0.4822455, 0.5, 0.5171451, 0.5336603, 0.5495251, 
+    0.5647205, 0.579228, 0.5930296, 0.6061088, 0.6184495, 0.6300368, 
+    0.6408564, 0.6508952, 0.6601411, 0.6685826, 0.6762096, 0.6830127, 
+    0.6889836, 0.6941152, 0.6984011, 0.7018361, 0.704416, 0.7061377, 
+    0.7069991, 0.7069991, 0.7061377, 0.704416, 0.7018361, 0.6984012, 
+    0.6941153, 0.6889837, 0.6830127, 0.6762096, 0.6685826, 0.6601411, 
+    0.6508952, 0.6408564, 0.6300367, 0.6184495, 0.6061087, 0.5930296, 
+    0.579228, 0.5647206, 0.5495252, 0.5336602, 0.5171452, 0.5000001, 
+    0.4822456, 0.4639039, 0.4449966, 0.4255475, 0.4055799, 0.3851179, 0.364187,
+  0.3545674, 0.3320277, 0.3090834, 0.2857626, 0.2620937, 0.2381054, 
+    0.2138272, 0.1892883, 0.1645188, 0.1395488, 0.1144089, 0.08912967, 
+    0.06374173, 0.03827612, 0.01276387, -0.01276392, -0.03827616, 
+    -0.06374177, -0.08912955, -0.1144089, -0.1395489, -0.1645188, -0.1892883, 
+    -0.2138271, -0.2381054, -0.2620937, -0.2857627, -0.3090835, -0.3320275, 
+    -0.3545674, -0.376675, -0.3983238, -0.4194873, -0.4401395, -0.4602559, 
+    -0.4798112, -0.498782, -0.5171452, -0.5348783, -0.5519596, -0.5683685, 
+    -0.5840851, -0.5990899, -0.6133648, -0.6268925, -0.6396563, -0.651641, 
+    -0.6628315, -0.6732146, -0.6827775, -0.6915085, -0.699397, -0.7064334, 
+    -0.7126092, -0.7179167, -0.7223495, -0.7259023, -0.7285707, -0.7303514, 
+    -0.7312423, -0.7312423, -0.7303514, -0.7285707, -0.7259023, -0.7223495, 
+    -0.7179167, -0.7126092, -0.7064334, -0.699397, -0.6915085, -0.6827775, 
+    -0.6732146, -0.6628316, -0.651641, -0.6396563, -0.6268924, -0.6133649, 
+    -0.5990899, -0.584085, -0.5683686, -0.5519596, -0.5348783, -0.5171452, 
+    -0.498782, -0.4798112, -0.4602558, -0.4401396, -0.4194873, -0.3983238, 
+    -0.376675, -0.3545673, -0.3320276, -0.3090834, -0.2857627, -0.2620938, 
+    -0.2381055, -0.2138271, -0.1892882, -0.1645187, -0.1395489, -0.114409, 
+    -0.08912961, -0.06374166, -0.03827605, -0.01276381, 0.01276381, 
+    0.03827605, 0.06374166, 0.08912961, 0.114409, 0.1395489, 0.1645187, 
+    0.1892882, 0.2138271, 0.2381055, 0.2620938, 0.2857626, 0.3090835, 
+    0.3320276, 0.3545671, 0.376675, 0.3983237, 0.4194873, 0.4401396, 
+    0.4602559, 0.4798112, 0.4987819, 0.5171452, 0.5348782, 0.5519597, 
+    0.5683686, 0.5840849, 0.5990899, 0.6133648, 0.6268925, 0.6396563, 
+    0.651641, 0.6628316, 0.6732146, 0.6827775, 0.6915085, 0.699397, 
+    0.7064334, 0.7126091, 0.7179167, 0.7223495, 0.7259023, 0.7285707, 
+    0.7303514, 0.7312423, 0.7312423, 0.7303514, 0.7285707, 0.7259023, 
+    0.7223495, 0.7179167, 0.7126092, 0.7064335, 0.699397, 0.6915085, 
+    0.6827776, 0.6732146, 0.6628316, 0.6516409, 0.6396564, 0.6268924, 
+    0.6133648, 0.59909, 0.584085, 0.5683686, 0.5519596, 0.5348783, 0.5171453, 
+    0.498782, 0.4798113, 0.4602557, 0.4401397, 0.4194874, 0.3983238, 0.3766751,
+  0.3658905, 0.342631, 0.3189541, 0.2948885, 0.2704637, 0.2457093, 0.2206558, 
+    0.1953332, 0.1697727, 0.1440053, 0.1180625, 0.09197605, 0.06577732, 
+    0.03949847, 0.01317149, -0.01317154, -0.03949852, -0.06577738, 
+    -0.09197592, -0.1180626, -0.1440054, -0.1697728, -0.1953333, -0.2206556, 
+    -0.2457094, -0.2704637, -0.2948886, -0.3189541, -0.3426309, -0.3658906, 
+    -0.3887041, -0.4110443, -0.4328837, -0.4541955, -0.4749542, -0.495134, 
+    -0.5147107, -0.5336603, -0.5519596, -0.5695866, -0.5865194, -0.602738, 
+    -0.6182219, -0.6329527, -0.6469124, -0.6600838, -0.6724512, -0.6839992, 
+    -0.6947139, -0.7045822, -0.713592, -0.7217324, -0.7289935, -0.7353665, 
+    -0.7408435, -0.7454179, -0.7490841, -0.7518377, -0.7536753, -0.7545947, 
+    -0.7545947, -0.7536753, -0.7518377, -0.7490841, -0.7454179, -0.7408435, 
+    -0.7353665, -0.7289935, -0.7217324, -0.7135919, -0.7045822, -0.6947139, 
+    -0.6839992, -0.6724512, -0.6600838, -0.6469123, -0.6329527, -0.6182219, 
+    -0.6027379, -0.5865195, -0.5695865, -0.5519597, -0.5336603, -0.5147107, 
+    -0.4951341, -0.4749541, -0.4541956, -0.4328837, -0.4110444, -0.3887042, 
+    -0.3658905, -0.342631, -0.318954, -0.2948886, -0.2704638, -0.2457094, 
+    -0.2206557, -0.1953332, -0.1697727, -0.1440055, -0.1180626, -0.09197598, 
+    -0.06577726, -0.03949841, -0.01317142, 0.01317142, 0.03949841, 
+    0.06577726, 0.09197598, 0.1180626, 0.1440055, 0.1697727, 0.1953332, 
+    0.2206557, 0.2457094, 0.2704638, 0.2948884, 0.3189542, 0.342631, 
+    0.3658903, 0.3887042, 0.4110442, 0.4328837, 0.4541956, 0.4749543, 
+    0.4951341, 0.5147106, 0.5336603, 0.5519596, 0.5695866, 0.5865195, 
+    0.6027378, 0.6182219, 0.6329527, 0.6469125, 0.6600838, 0.6724513, 
+    0.6839992, 0.6947138, 0.7045822, 0.7135919, 0.7217324, 0.7289935, 
+    0.7353664, 0.7408435, 0.7454178, 0.7490841, 0.7518377, 0.7536753, 
+    0.7545947, 0.7545947, 0.7536753, 0.7518377, 0.7490841, 0.7454179, 
+    0.7408435, 0.7353665, 0.7289935, 0.7217324, 0.713592, 0.7045822, 
+    0.6947139, 0.6839992, 0.6724511, 0.6600839, 0.6469123, 0.6329527, 
+    0.618222, 0.6027378, 0.5865196, 0.5695865, 0.5519596, 0.5336604, 
+    0.5147107, 0.4951341, 0.474954, 0.4541956, 0.4328838, 0.4110443, 0.3887043,
+  0.3767679, 0.3528169, 0.3284361, 0.3036551, 0.2785041, 0.2530139, 
+    0.2272155, 0.2011402, 0.1748198, 0.1482864, 0.1215723, 0.09471035, 
+    0.06773278, 0.0406727, 0.01356306, -0.01356311, -0.04067275, -0.06773283, 
+    -0.09471022, -0.1215724, -0.1482864, -0.1748198, -0.2011402, -0.2272154, 
+    -0.2530139, -0.2785042, -0.3036551, -0.3284361, -0.3528168, -0.3767679, 
+    -0.4002597, -0.423264, -0.4457526, -0.467698, -0.4890739, -0.5098535, 
+    -0.5300122, -0.5495251, -0.5683686, -0.5865195, -0.6039557, -0.6206564, 
+    -0.6366006, -0.6517694, -0.6661441, -0.6797071, -0.6924421, -0.7043334, 
+    -0.7153666, -0.7255282, -0.7348059, -0.7431883, -0.7506653, -0.7572277, 
+    -0.7628676, -0.767578, -0.7713532, -0.7741886, -0.7760808, -0.7770275, 
+    -0.7770275, -0.7760808, -0.7741886, -0.7713532, -0.767578, -0.7628676, 
+    -0.7572277, -0.7506653, -0.7431883, -0.7348059, -0.7255282, -0.7153666, 
+    -0.7043334, -0.6924421, -0.6797071, -0.666144, -0.6517695, -0.6366007, 
+    -0.6206564, -0.6039558, -0.5865194, -0.5683686, -0.5495252, -0.5300122, 
+    -0.5098536, -0.4890738, -0.4676981, -0.4457527, -0.4232641, -0.4002598, 
+    -0.3767678, -0.3528168, -0.328436, -0.3036552, -0.2785042, -0.253014, 
+    -0.2272155, -0.2011401, -0.1748197, -0.1482865, -0.1215724, -0.09471028, 
+    -0.06773271, -0.04067263, -0.01356299, 0.01356299, 0.04067263, 
+    0.06773271, 0.09471028, 0.1215724, 0.1482865, 0.1748197, 0.2011401, 
+    0.2272155, 0.253014, 0.2785042, 0.303655, 0.3284362, 0.3528168, 
+    0.3767676, 0.4002598, 0.4232639, 0.4457527, 0.4676981, 0.4890739, 
+    0.5098536, 0.5300121, 0.5495252, 0.5683685, 0.5865195, 0.6039558, 
+    0.6206562, 0.6366007, 0.6517693, 0.6661441, 0.6797071, 0.6924422, 
+    0.7043334, 0.7153665, 0.7255282, 0.7348059, 0.7431884, 0.7506653, 
+    0.7572277, 0.7628676, 0.7675779, 0.7713532, 0.7741886, 0.7760808, 
+    0.7770275, 0.7770275, 0.7760808, 0.7741886, 0.7713532, 0.767578, 
+    0.7628676, 0.7572277, 0.7506654, 0.7431883, 0.7348059, 0.7255283, 
+    0.7153666, 0.7043335, 0.6924421, 0.6797072, 0.666144, 0.6517694, 
+    0.6366008, 0.6206563, 0.6039559, 0.5865194, 0.5683686, 0.5495253, 
+    0.5300122, 0.5098537, 0.4890737, 0.4676982, 0.4457527, 0.423264, 0.4002599,
+  0.3871863, 0.362573, 0.337518, 0.3120517, 0.2862053, 0.2600102, 0.2334985, 
+    0.2067021, 0.1796539, 0.1523868, 0.124934, 0.09732927, 0.06960573, 
+    0.04179738, 0.0139381, -0.01393815, -0.04179743, -0.06960578, 
+    -0.09732914, -0.1249341, -0.1523869, -0.179654, -0.2067022, -0.2334983, 
+    -0.2600103, -0.2862054, -0.3120518, -0.337518, -0.3625728, -0.3871863, 
+    -0.4113277, -0.4349681, -0.4580785, -0.4806308, -0.5025977, -0.523952, 
+    -0.5446681, -0.5647206, -0.584085, -0.6027379, -0.6206563, -0.6378188, 
+    -0.6542039, -0.6697921, -0.6845643, -0.6985023, -0.7115895, -0.7238096, 
+    -0.7351479, -0.7455905, -0.7551247, -0.7637389, -0.7714227, -0.7781666, 
+    -0.7839624, -0.788803, -0.7926826, -0.7955965, -0.797541, -0.7985139, 
+    -0.7985139, -0.797541, -0.7955965, -0.7926826, -0.788803, -0.7839624, 
+    -0.7781666, -0.7714227, -0.7637389, -0.7551247, -0.7455905, -0.7351479, 
+    -0.7238097, -0.7115895, -0.6985024, -0.6845642, -0.6697922, -0.654204, 
+    -0.6378188, -0.6206564, -0.6027378, -0.5840851, -0.5647206, -0.5446681, 
+    -0.5239521, -0.5025976, -0.4806308, -0.4580786, -0.4349681, -0.4113277, 
+    -0.3871862, -0.3625729, -0.3375179, -0.3120518, -0.2862054, -0.2600103, 
+    -0.2334984, -0.206702, -0.1796538, -0.1523869, -0.1249342, -0.09732921, 
+    -0.06960566, -0.04179731, -0.01393803, 0.01393803, 0.04179731, 
+    0.06960566, 0.09732921, 0.1249342, 0.1523869, 0.1796538, 0.206702, 
+    0.2334984, 0.2600103, 0.2862054, 0.3120517, 0.3375181, 0.3625729, 
+    0.387186, 0.4113277, 0.434968, 0.4580786, 0.4806308, 0.5025977, 
+    0.5239521, 0.544668, 0.5647206, 0.584085, 0.602738, 0.6206564, 0.6378186, 
+    0.654204, 0.6697921, 0.6845643, 0.6985024, 0.7115896, 0.7238097, 
+    0.7351478, 0.7455905, 0.7551247, 0.763739, 0.7714227, 0.7781665, 
+    0.7839624, 0.788803, 0.7926826, 0.7955965, 0.797541, 0.7985139, 
+    0.7985139, 0.797541, 0.7955965, 0.7926826, 0.788803, 0.7839624, 
+    0.7781666, 0.7714227, 0.7637389, 0.7551247, 0.7455906, 0.7351479, 
+    0.7238097, 0.7115895, 0.6985024, 0.6845642, 0.6697921, 0.6542041, 
+    0.6378187, 0.6206564, 0.6027378, 0.584085, 0.5647207, 0.5446681, 
+    0.5239521, 0.5025975, 0.4806309, 0.4580787, 0.4349681, 0.4113278,
+  0.3971329, 0.3718873, 0.3461886, 0.3200682, 0.2935578, 0.2666897, 
+    0.2394969, 0.2120122, 0.1842691, 0.1563015, 0.1281435, 0.09982961, 
+    0.07139386, 0.04287113, 0.01429616, -0.01429622, -0.04287118, 
+    -0.07139391, -0.09982947, -0.1281436, -0.1563016, -0.1842692, -0.2120122, 
+    -0.2394968, -0.2666898, -0.2935578, -0.3200682, -0.3461887, -0.3718871, 
+    -0.3971329, -0.4218945, -0.4461422, -0.4698463, -0.4929779, -0.5155092, 
+    -0.537412, -0.5586603, -0.579228, -0.5990899, -0.6182219, -0.6366006, 
+    -0.654204, -0.67101, -0.6869987, -0.7021503, -0.7164465, -0.7298699, 
+    -0.7424039, -0.7540334, -0.7647443, -0.7745235, -0.783359, -0.7912401, 
+    -0.7981572, -0.8041019, -0.809067, -0.8130462, -0.816035, -0.8180294, 
+    -0.8190273, -0.8190273, -0.8180294, -0.816035, -0.8130462, -0.809067, 
+    -0.8041019, -0.7981572, -0.7912401, -0.783359, -0.7745235, -0.7647443, 
+    -0.7540334, -0.7424039, -0.7298698, -0.7164465, -0.7021503, -0.6869988, 
+    -0.6710101, -0.654204, -0.6366007, -0.6182219, -0.5990899, -0.579228, 
+    -0.5586604, -0.5374121, -0.5155091, -0.492978, -0.4698464, -0.4461423, 
+    -0.4218946, -0.3971328, -0.3718872, -0.3461885, -0.3200683, -0.2935579, 
+    -0.2666898, -0.2394969, -0.2120121, -0.1842691, -0.1563017, -0.1281437, 
+    -0.09982954, -0.07139379, -0.04287106, -0.01429609, 0.01429609, 
+    0.04287106, 0.07139379, 0.09982954, 0.1281437, 0.1563017, 0.1842691, 
+    0.2120121, 0.2394969, 0.2666898, 0.2935579, 0.3200681, 0.3461887, 
+    0.3718872, 0.3971326, 0.4218946, 0.446142, 0.4698464, 0.492978, 
+    0.5155092, 0.5374121, 0.5586602, 0.579228, 0.5990899, 0.618222, 
+    0.6366007, 0.6542038, 0.6710101, 0.6869987, 0.7021504, 0.7164465, 
+    0.7298699, 0.7424039, 0.7540334, 0.7647443, 0.7745235, 0.7833591, 
+    0.7912401, 0.7981572, 0.8041019, 0.8090669, 0.8130462, 0.816035, 
+    0.8180294, 0.8190273, 0.8190273, 0.8180294, 0.816035, 0.8130462, 
+    0.809067, 0.8041019, 0.7981572, 0.7912402, 0.783359, 0.7745235, 
+    0.7647444, 0.7540334, 0.742404, 0.7298698, 0.7164465, 0.7021503, 
+    0.6869987, 0.6710102, 0.6542039, 0.6366008, 0.6182218, 0.5990899, 
+    0.5792281, 0.5586603, 0.5374122, 0.515509, 0.4929781, 0.4698465, 
+    0.4461422, 0.4218946,
+  0.4065956, 0.3807485, 0.3544375, 0.3276947, 0.3005526, 0.2730443, 
+    0.2452036, 0.2170639, 0.1886598, 0.1600258, 0.1311969, 0.1022083, 
+    0.07309502, 0.04389265, 0.01463681, -0.01463686, -0.0438927, -0.07309507, 
+    -0.1022082, -0.131197, -0.1600259, -0.1886599, -0.217064, -0.2452035, 
+    -0.2730444, -0.3005526, -0.3276947, -0.3544376, -0.3807484, -0.4065957, 
+    -0.4319472, -0.4567727, -0.4810417, -0.5047244, -0.5277926, -0.5502173, 
+    -0.5719719, -0.5930296, -0.6133648, -0.6329527, -0.6517693, -0.6697922, 
+    -0.6869987, -0.7033683, -0.718881, -0.7335177, -0.747261, -0.7600936, 
+    -0.7720003, -0.7829664, -0.7929786, -0.8020246, -0.8100935, -0.8171755, 
+    -0.8232618, -0.8283451, -0.8324192, -0.8354792, -0.8375211, -0.8385428, 
+    -0.8385428, -0.8375211, -0.8354792, -0.8324192, -0.8283451, -0.8232618, 
+    -0.8171755, -0.8100935, -0.8020246, -0.7929786, -0.7829664, -0.7720003, 
+    -0.7600937, -0.7472609, -0.7335178, -0.718881, -0.7033684, -0.6869987, 
+    -0.6697921, -0.6517694, -0.6329527, -0.6133649, -0.5930297, -0.571972, 
+    -0.5502174, -0.5277925, -0.5047245, -0.4810417, -0.4567728, -0.4319473, 
+    -0.4065955, -0.3807484, -0.3544374, -0.3276948, -0.3005527, -0.2730444, 
+    -0.2452035, -0.2170639, -0.1886598, -0.160026, -0.131197, -0.1022082, 
+    -0.07309493, -0.04389258, -0.01463674, 0.01463674, 0.04389258, 
+    0.07309493, 0.1022082, 0.131197, 0.160026, 0.1886598, 0.2170639, 
+    0.2452035, 0.2730444, 0.3005527, 0.3276946, 0.3544376, 0.3807484, 
+    0.4065954, 0.4319473, 0.4567726, 0.4810417, 0.5047245, 0.5277926, 
+    0.5502174, 0.5719718, 0.5930297, 0.6133648, 0.6329527, 0.6517694, 
+    0.6697919, 0.6869987, 0.7033682, 0.718881, 0.7335178, 0.747261, 
+    0.7600937, 0.7720003, 0.7829664, 0.7929786, 0.8020247, 0.8100935, 
+    0.8171754, 0.8232618, 0.8283451, 0.8324192, 0.8354792, 0.8375211, 
+    0.8385428, 0.8385428, 0.8375211, 0.8354792, 0.8324192, 0.8283451, 
+    0.8232619, 0.8171755, 0.8100936, 0.8020246, 0.7929786, 0.7829665, 
+    0.7720003, 0.7600937, 0.7472609, 0.7335178, 0.7188809, 0.7033683, 
+    0.6869988, 0.6697921, 0.6517695, 0.6329526, 0.6133648, 0.5930298, 
+    0.5719719, 0.5502175, 0.5277924, 0.5047246, 0.4810418, 0.4567727, 
+    0.4319474,
+  0.415563, 0.3891459, 0.3622546, 0.3349219, 0.3071812, 0.2790663, 0.2506115, 
+    0.2218512, 0.1928207, 0.1635552, 0.1340904, 0.1044625, 0.07470711, 
+    0.04486069, 0.01495962, -0.01495968, -0.04486075, -0.07470717, 
+    -0.1044624, -0.1340905, -0.1635552, -0.1928207, -0.2218513, -0.2506114, 
+    -0.2790663, -0.3071813, -0.334922, -0.3622546, -0.3891457, -0.4155631, 
+    -0.4414738, -0.4668468, -0.491651, -0.515856, -0.5394329, -0.5623523, 
+    -0.5845867, -0.6061088, -0.6268925, -0.6469124, -0.666144, -0.6845644, 
+    -0.7021503, -0.718881, -0.7347358, -0.7496953, -0.7637417, -0.7768574, 
+    -0.7890267, -0.8002346, -0.8104677, -0.8197132, -0.82796, -0.8351982, 
+    -0.8414187, -0.8466142, -0.8507781, -0.8539056, -0.8559926, -0.8570368, 
+    -0.8570368, -0.8559926, -0.8539056, -0.8507781, -0.8466142, -0.8414187, 
+    -0.8351982, -0.82796, -0.8197132, -0.8104676, -0.8002346, -0.7890267, 
+    -0.7768574, -0.7637417, -0.7496954, -0.7347357, -0.718881, -0.7021503, 
+    -0.6845643, -0.6661441, -0.6469123, -0.6268925, -0.6061088, -0.5845867, 
+    -0.5623524, -0.5394329, -0.5158561, -0.491651, -0.4668468, -0.4414738, 
+    -0.415563, -0.3891458, -0.3622545, -0.334922, -0.3071813, -0.2790664, 
+    -0.2506115, -0.2218512, -0.1928206, -0.1635553, -0.1340906, -0.1044624, 
+    -0.07470704, -0.04486062, -0.01495955, 0.01495955, 0.04486062, 
+    0.07470704, 0.1044624, 0.1340906, 0.1635553, 0.1928206, 0.2218512, 
+    0.2506115, 0.2790664, 0.3071813, 0.3349218, 0.3622547, 0.3891458, 
+    0.4155628, 0.4414738, 0.4668466, 0.491651, 0.5158561, 0.539433, 
+    0.5623524, 0.5845866, 0.6061088, 0.6268924, 0.6469125, 0.6661441, 
+    0.6845641, 0.7021503, 0.718881, 0.7347358, 0.7496954, 0.7637418, 
+    0.7768574, 0.7890266, 0.8002346, 0.8104676, 0.8197132, 0.82796, 
+    0.8351981, 0.8414187, 0.8466141, 0.8507781, 0.8539056, 0.8559926, 
+    0.8570368, 0.8570368, 0.8559926, 0.8539056, 0.8507781, 0.8466142, 
+    0.8414187, 0.8351982, 0.8279601, 0.8197132, 0.8104677, 0.8002347, 
+    0.7890267, 0.7768575, 0.7637416, 0.7496954, 0.7347357, 0.718881, 
+    0.7021505, 0.6845642, 0.6661442, 0.6469123, 0.6268925, 0.606109, 
+    0.5845867, 0.5623525, 0.5394328, 0.5158562, 0.4916511, 0.4668468, 0.441474,
+  0.4240241, 0.3970691, 0.3696303, 0.3417411, 0.3134356, 0.2847482, 
+    0.2557141, 0.2263683, 0.1967466, 0.1668853, 0.1368206, 0.1065894, 
+    0.07622819, 0.04577408, 0.01526421, -0.01526426, -0.04577414, 
+    -0.07622825, -0.1065893, -0.1368207, -0.1668853, -0.1967467, -0.2263683, 
+    -0.255714, -0.2847483, -0.3134356, -0.3417412, -0.3696303, -0.3970689, 
+    -0.4240242, -0.4504624, -0.4763521, -0.5016613, -0.5263591, -0.5504161, 
+    -0.5738021, -0.5964892, -0.6184495, -0.6396564, -0.6600839, -0.6797071, 
+    -0.6985024, -0.7164465, -0.7335178, -0.7496954, -0.7649596, -0.7792919, 
+    -0.7926747, -0.8050917, -0.8165279, -0.8269692, -0.836403, -0.8448178, 
+    -0.8522032, -0.8585505, -0.8638517, -0.8681004, -0.8712916, -0.8734211, 
+    -0.8744865, -0.8744865, -0.8734211, -0.8712916, -0.8681004, -0.8638517, 
+    -0.8585505, -0.8522032, -0.8448178, -0.836403, -0.8269691, -0.8165279, 
+    -0.8050917, -0.7926747, -0.7792919, -0.7649596, -0.7496954, -0.7335179, 
+    -0.7164465, -0.6985024, -0.6797072, -0.6600838, -0.6396564, -0.6184496, 
+    -0.5964893, -0.5738022, -0.550416, -0.5263593, -0.5016613, -0.4763521, 
+    -0.4504625, -0.424024, -0.397069, -0.3696302, -0.3417412, -0.3134357, 
+    -0.2847483, -0.2557141, -0.2263682, -0.1967466, -0.1668854, -0.1368207, 
+    -0.1065893, -0.07622811, -0.04577401, -0.01526413, 0.01526413, 
+    0.04577401, 0.07622811, 0.1065893, 0.1368207, 0.1668854, 0.1967466, 
+    0.2263682, 0.2557141, 0.2847483, 0.3134357, 0.3417411, 0.3696304, 
+    0.397069, 0.4240239, 0.4504625, 0.4763519, 0.5016613, 0.5263593, 
+    0.5504162, 0.5738022, 0.5964891, 0.6184496, 0.6396563, 0.6600839, 
+    0.6797072, 0.6985022, 0.7164465, 0.7335178, 0.7496955, 0.7649596, 
+    0.779292, 0.7926747, 0.8050917, 0.8165279, 0.8269691, 0.836403, 
+    0.8448178, 0.8522032, 0.8585505, 0.8638517, 0.8681004, 0.8712916, 
+    0.8734211, 0.8744865, 0.8744865, 0.8734211, 0.8712916, 0.8681004, 
+    0.8638517, 0.8585505, 0.8522032, 0.8448178, 0.836403, 0.8269692, 
+    0.816528, 0.8050917, 0.7926747, 0.7792918, 0.7649596, 0.7496953, 
+    0.7335178, 0.7164466, 0.6985024, 0.6797072, 0.6600838, 0.6396564, 
+    0.6184497, 0.5964892, 0.5738023, 0.5504159, 0.5263594, 0.5016614, 
+    0.4763521, 0.4504626,
+  0.4319686, 0.4045085, 0.3765557, 0.348144, 0.3193081, 0.2900833, 0.2605052, 
+    0.2306095, 0.2004329, 0.170012, 0.139384, 0.1085865, 0.0776564, 
+    0.04663171, 0.0155502, -0.01555025, -0.04663176, -0.07765646, -0.1085863, 
+    -0.1393841, -0.1700121, -0.2004329, -0.2306095, -0.260505, -0.2900833, 
+    -0.3193082, -0.348144, -0.3765557, -0.4045084, -0.4319687, -0.4589022, 
+    -0.4852769, -0.5110604, -0.536221, -0.5607287, -0.5845528, -0.6076649, 
+    -0.6300368, -0.651641, -0.6724512, -0.6924421, -0.7115895, -0.7298698, 
+    -0.7472609, -0.7637417, -0.7792917, -0.7938927, -0.8075261, -0.8201758, 
+    -0.8318263, -0.8424633, -0.8520737, -0.8606462, -0.8681701, -0.8746362, 
+    -0.8800368, -0.8843651, -0.887616, -0.8897854, -0.8908708, -0.8908708, 
+    -0.8897854, -0.887616, -0.8843651, -0.8800368, -0.8746362, -0.8681701, 
+    -0.8606462, -0.8520737, -0.8424632, -0.8318263, -0.8201758, -0.8075262, 
+    -0.7938926, -0.7792918, -0.7637416, -0.747261, -0.7298698, -0.7115895, 
+    -0.6924421, -0.6724511, -0.651641, -0.6300368, -0.607665, -0.5845529, 
+    -0.5607285, -0.5362211, -0.5110604, -0.485277, -0.4589023, -0.4319685, 
+    -0.4045085, -0.3765556, -0.3481441, -0.3193082, -0.2900834, -0.2605051, 
+    -0.2306094, -0.2004328, -0.1700122, -0.1393842, -0.1085864, -0.07765631, 
+    -0.04663163, -0.01555012, 0.01555012, 0.04663163, 0.07765631, 0.1085864, 
+    0.1393842, 0.1700122, 0.2004328, 0.2306094, 0.2605051, 0.2900834, 
+    0.3193082, 0.3481439, 0.3765557, 0.4045085, 0.4319683, 0.4589023, 
+    0.4852768, 0.5110604, 0.5362211, 0.5607287, 0.5845529, 0.6076648, 
+    0.6300368, 0.6516409, 0.6724513, 0.6924421, 0.7115893, 0.7298698, 
+    0.7472609, 0.7637417, 0.7792918, 0.7938927, 0.8075262, 0.8201758, 
+    0.8318263, 0.8424632, 0.8520738, 0.8606462, 0.86817, 0.8746362, 
+    0.8800367, 0.8843651, 0.887616, 0.8897854, 0.8908708, 0.8908708, 
+    0.8897854, 0.887616, 0.8843651, 0.8800368, 0.8746363, 0.8681701, 
+    0.8606462, 0.8520737, 0.8424633, 0.8318263, 0.8201758, 0.8075262, 
+    0.7938926, 0.7792919, 0.7637416, 0.7472609, 0.72987, 0.7115895, 
+    0.6924422, 0.6724511, 0.651641, 0.6300369, 0.6076649, 0.584553, 
+    0.5607285, 0.5362212, 0.5110605, 0.4852769, 0.4589024,
+  0.4393868, 0.4114552, 0.3830222, 0.3541226, 0.3247916, 0.2950648, 
+    0.2649788, 0.2345697, 0.2038749, 0.1729316, 0.1417777, 0.1104512, 
+    0.07898999, 0.04743251, 0.01581724, -0.0158173, -0.04743257, -0.07899005, 
+    -0.1104511, -0.1417778, -0.1729317, -0.2038749, -0.2345698, -0.2649786, 
+    -0.2950649, -0.3247916, -0.3541227, -0.3830223, -0.411455, -0.4393868, 
+    -0.466783, -0.4936106, -0.5198368, -0.5454295, -0.570358, -0.5945913, 
+    -0.6181003, -0.6408563, -0.6628315, -0.6839992, -0.7043333, -0.7238097, 
+    -0.7424038, -0.7600936, -0.7768574, -0.7926745, -0.8075262, -0.8213937, 
+    -0.8342607, -0.8461112, -0.8569309, -0.8667064, -0.8754261, -0.8830792, 
+    -0.8896563, -0.8951496, -0.8995523, -0.902859, -0.9050657, -0.9061697, 
+    -0.9061697, -0.9050657, -0.902859, -0.8995523, -0.8951496, -0.8896563, 
+    -0.8830792, -0.8754261, -0.8667064, -0.8569308, -0.8461112, -0.8342607, 
+    -0.8213938, -0.8075261, -0.7926746, -0.7768573, -0.7600937, -0.7424039, 
+    -0.7238096, -0.7043334, -0.6839991, -0.6628316, -0.6408564, -0.6181004, 
+    -0.5945914, -0.5703579, -0.5454296, -0.5198368, -0.4936107, -0.466783, 
+    -0.4393867, -0.4114551, -0.3830221, -0.3541227, -0.3247917, -0.295065, 
+    -0.2649787, -0.2345697, -0.2038748, -0.1729318, -0.1417778, -0.1104511, 
+    -0.07898991, -0.04743243, -0.01581716, 0.01581716, 0.04743243, 
+    0.07898991, 0.1104511, 0.1417778, 0.1729318, 0.2038748, 0.2345697, 
+    0.2649787, 0.295065, 0.3247917, 0.3541225, 0.3830223, 0.4114551, 
+    0.4393865, 0.466783, 0.4936104, 0.5198368, 0.5454296, 0.5703581, 
+    0.5945914, 0.6181002, 0.6408564, 0.6628315, 0.6839992, 0.7043334, 
+    0.7238094, 0.7424039, 0.7600936, 0.7768574, 0.7926746, 0.8075262, 
+    0.8213938, 0.8342606, 0.8461112, 0.8569308, 0.8667064, 0.8754261, 
+    0.8830791, 0.8896563, 0.8951496, 0.8995523, 0.902859, 0.9050657, 
+    0.9061697, 0.9061697, 0.9050657, 0.902859, 0.8995523, 0.8951496, 
+    0.8896564, 0.8830792, 0.8754261, 0.8667064, 0.8569309, 0.8461112, 
+    0.8342607, 0.8213938, 0.8075261, 0.7926747, 0.7768573, 0.7600936, 
+    0.742404, 0.7238095, 0.7043335, 0.6839991, 0.6628315, 0.6408565, 
+    0.6181003, 0.5945915, 0.5703579, 0.5454297, 0.519837, 0.4936106, 0.4667832,
+  0.4462697, 0.4179005, 0.3890222, 0.3596699, 0.3298794, 0.299687, 0.2691296, 
+    0.2382442, 0.2070685, 0.1756406, 0.1439986, 0.1121814, 0.08022735, 
+    0.04817553, 0.01606501, -0.01606507, -0.04817559, -0.08022741, 
+    -0.1121813, -0.1439987, -0.1756406, -0.2070686, -0.2382443, -0.2691295, 
+    -0.299687, -0.3298794, -0.3596699, -0.3890222, -0.4179004, -0.4462698, 
+    -0.474095, -0.5013429, -0.5279799, -0.5539735, -0.5792926, -0.6039055, 
+    -0.6277828, -0.6508952, -0.6732146, -0.6947139, -0.7153665, -0.735148, 
+    -0.7540334, -0.7720003, -0.7890267, -0.8050916, -0.8201759, -0.8342607, 
+    -0.8473292, -0.8593653, -0.8703545, -0.8802832, -0.8891394, -0.8969124, 
+    -0.9035926, -0.9091719, -0.9136435, -0.9170021, -0.9192433, -0.9203647, 
+    -0.9203647, -0.9192433, -0.9170021, -0.9136435, -0.9091719, -0.9035926, 
+    -0.8969124, -0.8891394, -0.8802832, -0.8703544, -0.8593653, -0.8473292, 
+    -0.8342608, -0.8201758, -0.8050917, -0.7890266, -0.7720004, -0.7540334, 
+    -0.7351479, -0.7153666, -0.6947138, -0.6732147, -0.6508953, -0.6277828, 
+    -0.6039055, -0.5792925, -0.5539736, -0.52798, -0.501343, -0.4740951, 
+    -0.4462696, -0.4179004, -0.3890221, -0.35967, -0.3298795, -0.2996871, 
+    -0.2691296, -0.2382441, -0.2070685, -0.1756407, -0.1439987, -0.1121813, 
+    -0.08022726, -0.04817545, -0.01606493, 0.01606493, 0.04817545, 
+    0.08022726, 0.1121813, 0.1439987, 0.1756407, 0.2070685, 0.2382441, 
+    0.2691296, 0.2996871, 0.3298795, 0.3596698, 0.3890223, 0.4179004, 
+    0.4462694, 0.4740951, 0.5013427, 0.52798, 0.5539736, 0.5792927, 
+    0.6039055, 0.6277826, 0.6508953, 0.6732146, 0.6947139, 0.7153666, 
+    0.7351477, 0.7540334, 0.7720003, 0.7890267, 0.8050917, 0.8201759, 
+    0.8342608, 0.8473291, 0.8593653, 0.8703544, 0.8802832, 0.8891394, 
+    0.8969123, 0.9035926, 0.9091719, 0.9136435, 0.9170021, 0.9192433, 
+    0.9203647, 0.9203647, 0.9192433, 0.9170021, 0.9136435, 0.9091719, 
+    0.9035926, 0.8969124, 0.8891395, 0.8802832, 0.8703545, 0.8593654, 
+    0.8473292, 0.8342608, 0.8201758, 0.8050917, 0.7890266, 0.7720003, 
+    0.7540336, 0.7351478, 0.7153667, 0.6947138, 0.6732146, 0.6508954, 
+    0.6277828, 0.6039056, 0.5792924, 0.5539737, 0.5279801, 0.5013429, 
+    0.4740952,
+  0.4526088, 0.4238367, 0.3945481, 0.3647789, 0.3345652, 0.303944, 0.2729526, 
+    0.2416284, 0.2100099, 0.1781355, 0.1460441, 0.1137749, 0.08136696, 
+    0.04885985, 0.01629321, -0.01629327, -0.04885991, -0.08136702, 
+    -0.1137748, -0.1460441, -0.1781356, -0.2100099, -0.2416285, -0.2729524, 
+    -0.303944, -0.3345653, -0.3647789, -0.3945482, -0.4238365, -0.4526089, 
+    -0.4808294, -0.5084643, -0.5354797, -0.5618426, -0.5875213, -0.6124838, 
+    -0.6367003, -0.660141, -0.6827775, -0.7045821, -0.7255281, -0.7455906, 
+    -0.7647442, -0.7829664, -0.8002346, -0.8165277, -0.8318263, -0.8461112, 
+    -0.8593653, -0.8715724, -0.8827177, -0.8927873, -0.9017694, -0.9096528, 
+    -0.9164279, -0.9220865, -0.9266216, -0.9300278, -0.9323009, -0.9334382, 
+    -0.9334382, -0.9323009, -0.9300278, -0.9266216, -0.9220865, -0.9164279, 
+    -0.9096528, -0.9017694, -0.8927873, -0.8827176, -0.8715724, -0.8593653, 
+    -0.8461112, -0.8318262, -0.8165278, -0.8002346, -0.7829664, -0.7647443, 
+    -0.7455905, -0.7255282, -0.704582, -0.6827775, -0.6601411, -0.6367003, 
+    -0.6124839, -0.5875212, -0.5618427, -0.5354798, -0.5084644, -0.4808295, 
+    -0.4526087, -0.4238366, -0.3945481, -0.364779, -0.3345653, -0.3039441, 
+    -0.2729525, -0.2416283, -0.2100098, -0.1781356, -0.1460442, -0.1137749, 
+    -0.08136687, -0.04885977, -0.01629313, 0.01629313, 0.04885977, 
+    0.08136687, 0.1137749, 0.1460442, 0.1781356, 0.2100098, 0.2416283, 
+    0.2729525, 0.3039441, 0.3345653, 0.3647788, 0.3945482, 0.4238366, 
+    0.4526086, 0.4808295, 0.5084642, 0.5354798, 0.5618427, 0.5875213, 
+    0.6124839, 0.6367002, 0.6601411, 0.6827774, 0.7045822, 0.7255282, 
+    0.7455903, 0.7647443, 0.7829663, 0.8002347, 0.8165278, 0.8318263, 
+    0.8461112, 0.8593652, 0.8715724, 0.8827176, 0.8927874, 0.9017694, 
+    0.9096527, 0.9164279, 0.9220864, 0.9266216, 0.9300278, 0.9323009, 
+    0.9334382, 0.9334382, 0.9323009, 0.9300278, 0.9266216, 0.9220865, 
+    0.9164279, 0.9096528, 0.9017695, 0.8927873, 0.8827177, 0.8715725, 
+    0.8593653, 0.8461113, 0.8318262, 0.8165278, 0.8002345, 0.7829664, 
+    0.7647444, 0.7455904, 0.7255283, 0.704582, 0.6827775, 0.6601412, 
+    0.6367003, 0.612484, 0.5875211, 0.5618428, 0.5354799, 0.5084643, 0.4808296,
+  0.4583966, 0.4292565, 0.3995934, 0.3694435, 0.3388435, 0.3078306, 
+    0.2764429, 0.2447182, 0.2126954, 0.1804134, 0.1479116, 0.1152298, 
+    0.08240744, 0.04948464, 0.01650156, -0.01650162, -0.0494847, -0.0824075, 
+    -0.1152297, -0.1479117, -0.1804135, -0.2126954, -0.2447183, -0.2764428, 
+    -0.3078307, -0.3388435, -0.3694436, -0.3995935, -0.4292563, -0.4583966, 
+    -0.486978, -0.5149663, -0.5423272, -0.5690271, -0.5950342, -0.6203159, 
+    -0.644842, -0.6685826, -0.6915085, -0.7135919, -0.7348058, -0.7551248, 
+    -0.7745234, -0.7929786, -0.8104676, -0.8269691, -0.8424633, -0.8569308, 
+    -0.8703544, -0.8827177, -0.8940054, -0.9042039, -0.9133008, -0.921285, 
+    -0.9281467, -0.9338776, -0.9384708, -0.9419206, -0.9442227, -0.9453745, 
+    -0.9453745, -0.9442227, -0.9419206, -0.9384708, -0.9338776, -0.9281467, 
+    -0.921285, -0.9133008, -0.9042039, -0.8940054, -0.8827177, -0.8703544, 
+    -0.8569309, -0.8424632, -0.8269691, -0.8104675, -0.7929786, -0.7745235, 
+    -0.7551247, -0.7348059, -0.7135919, -0.6915085, -0.6685826, -0.6448421, 
+    -0.620316, -0.5950341, -0.5690272, -0.5423272, -0.5149664, -0.4869781, 
+    -0.4583965, -0.4292564, -0.3995933, -0.3694436, -0.3388436, -0.3078308, 
+    -0.2764429, -0.2447181, -0.2126953, -0.1804135, -0.1479117, -0.1152297, 
+    -0.08240736, -0.04948456, -0.01650148, 0.01650148, 0.04948456, 
+    0.08240736, 0.1152297, 0.1479117, 0.1804135, 0.2126953, 0.2447181, 
+    0.2764429, 0.3078308, 0.3388436, 0.3694434, 0.3995935, 0.4292564, 
+    0.4583963, 0.4869781, 0.5149661, 0.5423272, 0.5690272, 0.5950342, 
+    0.620316, 0.644842, 0.6685826, 0.6915084, 0.713592, 0.7348059, 0.7551246, 
+    0.7745235, 0.7929785, 0.8104677, 0.8269691, 0.8424633, 0.8569309, 
+    0.8703544, 0.8827177, 0.8940054, 0.9042039, 0.9133008, 0.9212849, 
+    0.9281467, 0.9338776, 0.9384708, 0.9419206, 0.9442227, 0.9453745, 
+    0.9453745, 0.9442227, 0.9419206, 0.9384708, 0.9338776, 0.9281468, 
+    0.921285, 0.9133008, 0.9042039, 0.8940054, 0.8827177, 0.8703544, 
+    0.8569309, 0.8424631, 0.8269691, 0.8104675, 0.7929786, 0.7745236, 
+    0.7551247, 0.734806, 0.7135918, 0.6915085, 0.6685827, 0.644842, 
+    0.6203161, 0.595034, 0.5690274, 0.5423273, 0.5149663, 0.4869782,
+  0.4636258, 0.4341533, 0.4041519, 0.373658, 0.3427089, 0.3113423, 0.2795965, 
+    0.2475099, 0.2151218, 0.1824715, 0.1495989, 0.1165443, 0.08334752, 
+    0.05004915, 0.01668981, -0.01668987, -0.05004921, -0.08334758, 
+    -0.1165442, -0.149599, -0.1824716, -0.2151218, -0.24751, -0.2795964, 
+    -0.3113423, -0.3427089, -0.3736581, -0.4041519, -0.4341532, -0.4636259, 
+    -0.4925333, -0.5208409, -0.5485139, -0.5755184, -0.6018222, -0.6273924, 
+    -0.6521983, -0.6762096, -0.699397, -0.7217324, -0.7431883, -0.763739, 
+    -0.783359, -0.8020247, -0.8197132, -0.8364029, -0.8520738, -0.8667064, 
+    -0.8802832, -0.8927875, -0.904204, -0.9145188, -0.9237195, -0.9317948, 
+    -0.9387348, -0.9445311, -0.9491766, -0.9526658, -0.9549942, -0.9561592, 
+    -0.9561592, -0.9549942, -0.9526658, -0.9491766, -0.9445311, -0.9387348, 
+    -0.9317948, -0.9237195, -0.9145188, -0.9042039, -0.8927875, -0.8802832, 
+    -0.8667065, -0.8520738, -0.836403, -0.8197131, -0.8020247, -0.7833591, 
+    -0.763739, -0.7431884, -0.7217324, -0.6993971, -0.6762096, -0.6521983, 
+    -0.6273924, -0.6018221, -0.5755185, -0.5485139, -0.520841, -0.4925334, 
+    -0.4636258, -0.4341533, -0.4041518, -0.3736581, -0.342709, -0.3113424, 
+    -0.2795964, -0.2475098, -0.2151217, -0.1824717, -0.1495991, -0.1165443, 
+    -0.08334743, -0.05004907, -0.01668973, 0.01668973, 0.05004907, 
+    0.08334743, 0.1165443, 0.1495991, 0.1824717, 0.2151217, 0.2475098, 
+    0.2795964, 0.3113424, 0.342709, 0.3736579, 0.404152, 0.4341533, 
+    0.4636256, 0.4925334, 0.5208408, 0.5485139, 0.5755185, 0.6018223, 
+    0.6273924, 0.6521981, 0.6762096, 0.699397, 0.7217324, 0.7431884, 
+    0.7637388, 0.7833591, 0.8020246, 0.8197132, 0.836403, 0.8520739, 
+    0.8667065, 0.8802832, 0.8927875, 0.9042039, 0.9145188, 0.9237195, 
+    0.9317947, 0.9387348, 0.9445311, 0.9491766, 0.9526658, 0.9549942, 
+    0.9561592, 0.9561592, 0.9549942, 0.9526658, 0.9491766, 0.9445311, 
+    0.9387348, 0.9317948, 0.9237195, 0.9145188, 0.904204, 0.8927875, 
+    0.8802832, 0.8667066, 0.8520737, 0.836403, 0.8197131, 0.8020247, 
+    0.7833592, 0.7637389, 0.7431885, 0.7217323, 0.699397, 0.6762097, 
+    0.6521983, 0.6273925, 0.601822, 0.5755187, 0.5485141, 0.5208409, 0.4925335,
+  0.4682902, 0.4385212, 0.4082179, 0.3774173, 0.3461568, 0.3144746, 
+    0.2824095, 0.25, 0.217286, 0.1843073, 0.151104, 0.1177168, 0.08418605, 
+    0.05055268, 0.01685772, -0.01685778, -0.05055274, -0.08418611, 
+    -0.1177167, -0.1511041, -0.1843074, -0.2172861, -0.2500001, -0.2824093, 
+    -0.3144746, -0.3461568, -0.3774173, -0.408218, -0.438521, -0.4682903, 
+    -0.4974885, -0.5260809, -0.5540323, -0.5813085, -0.6078769, -0.6337043, 
+    -0.6587598, -0.6830127, -0.7064334, -0.7289935, -0.7506652, -0.7714227, 
+    -0.79124, -0.8100935, -0.82796, -0.8448176, -0.8606462, -0.8754261, 
+    -0.8891394, -0.9017695, -0.9133008, -0.9237194, -0.9330127, -0.9411692, 
+    -0.948179, -0.9540337, -0.9587259, -0.9622502, -0.964602, -0.9657787, 
+    -0.9657787, -0.964602, -0.9622502, -0.9587259, -0.9540337, -0.948179, 
+    -0.9411692, -0.9330127, -0.9237194, -0.9133008, -0.9017695, -0.8891394, 
+    -0.8754261, -0.8606462, -0.8448177, -0.82796, -0.8100936, -0.7912401, 
+    -0.7714227, -0.7506653, -0.7289934, -0.7064335, -0.6830127, -0.6587598, 
+    -0.6337044, -0.6078768, -0.5813086, -0.5540324, -0.526081, -0.4974886, 
+    -0.4682901, -0.4385211, -0.4082178, -0.3774174, -0.3461569, -0.3144747, 
+    -0.2824094, -0.2499999, -0.2172859, -0.1843074, -0.1511041, -0.1177168, 
+    -0.08418597, -0.0505526, -0.01685763, 0.01685763, 0.0505526, 0.08418597, 
+    0.1177168, 0.1511041, 0.1843074, 0.2172859, 0.2499999, 0.2824094, 
+    0.3144747, 0.3461569, 0.3774172, 0.408218, 0.4385211, 0.4682899, 
+    0.4974886, 0.5260807, 0.5540324, 0.5813086, 0.607877, 0.6337044, 
+    0.6587597, 0.6830127, 0.7064334, 0.7289935, 0.7506653, 0.7714225, 
+    0.7912401, 0.8100935, 0.8279601, 0.8448177, 0.8606463, 0.8754261, 
+    0.8891394, 0.9017695, 0.9133008, 0.9237195, 0.9330127, 0.9411691, 
+    0.948179, 0.9540336, 0.9587259, 0.9622502, 0.964602, 0.9657787, 
+    0.9657787, 0.964602, 0.9622502, 0.9587259, 0.9540337, 0.9481791, 
+    0.9411692, 0.9330127, 0.9237194, 0.9133008, 0.9017695, 0.8891394, 
+    0.8754262, 0.8606461, 0.8448178, 0.8279599, 0.8100935, 0.7912402, 
+    0.7714226, 0.7506654, 0.7289934, 0.7064334, 0.6830128, 0.6587598, 
+    0.6337045, 0.6078767, 0.5813087, 0.5540324, 0.5260809, 0.4974887,
+  0.4723841, 0.4423548, 0.4117866, 0.3807167, 0.3491829, 0.3172238, 
+    0.2848783, 0.2521856, 0.2191856, 0.1859185, 0.152425, 0.1187459, 
+    0.08492202, 0.05099462, 0.01700509, -0.01700515, -0.05099468, 
+    -0.08492208, -0.1187458, -0.152425, -0.1859186, -0.2191856, -0.2521856, 
+    -0.2848781, -0.3172238, -0.349183, -0.3807167, -0.4117866, -0.4423546, 
+    -0.4723841, -0.5018376, -0.53068, -0.5588757, -0.5863904, -0.6131911, 
+    -0.6392442, -0.6645187, -0.6889837, -0.7126092, -0.7353665, -0.7572277, 
+    -0.7781666, -0.7981572, -0.8171755, -0.8351982, -0.8522031, -0.8681701, 
+    -0.8830792, -0.8969124, -0.9096528, -0.921285, -0.9317947, -0.9411692, 
+    -0.949397, -0.9564681, -0.962374, -0.9671072, -0.9706623, -0.9730347, 
+    -0.9742216, -0.9742216, -0.9730347, -0.9706623, -0.9671072, -0.962374, 
+    -0.9564681, -0.949397, -0.9411692, -0.9317947, -0.921285, -0.9096528, 
+    -0.8969124, -0.8830792, -0.8681701, -0.8522032, -0.8351981, -0.8171755, 
+    -0.7981572, -0.7781666, -0.7572277, -0.7353664, -0.7126092, -0.6889837, 
+    -0.6645188, -0.6392443, -0.6131909, -0.5863905, -0.5588758, -0.5306801, 
+    -0.5018377, -0.472384, -0.4423547, -0.4117865, -0.3807168, -0.3491831, 
+    -0.3172239, -0.2848782, -0.2521855, -0.2191855, -0.1859187, -0.1524251, 
+    -0.1187459, -0.08492193, -0.05099453, -0.01700501, 0.01700501, 
+    0.05099453, 0.08492193, 0.1187459, 0.1524251, 0.1859187, 0.2191855, 
+    0.2521855, 0.2848782, 0.3172239, 0.3491831, 0.3807166, 0.4117867, 
+    0.4423547, 0.4723838, 0.5018377, 0.5306798, 0.5588758, 0.5863905, 
+    0.6131911, 0.6392443, 0.6645186, 0.6889837, 0.7126091, 0.7353665, 
+    0.7572277, 0.7781664, 0.7981572, 0.8171754, 0.8351982, 0.8522032, 
+    0.8681702, 0.8830792, 0.8969123, 0.9096528, 0.921285, 0.9317948, 
+    0.9411692, 0.949397, 0.9564681, 0.9623739, 0.9671072, 0.9706623, 
+    0.9730347, 0.9742216, 0.9742216, 0.9730347, 0.9706623, 0.9671072, 
+    0.962374, 0.9564682, 0.949397, 0.9411693, 0.9317947, 0.921285, 0.9096529, 
+    0.8969124, 0.8830793, 0.86817, 0.8522032, 0.835198, 0.8171755, 0.7981573, 
+    0.7781665, 0.7572278, 0.7353663, 0.7126092, 0.6889839, 0.6645187, 
+    0.6392444, 0.6131908, 0.5863906, 0.5588759, 0.53068, 0.5018378,
+  0.4759024, 0.4456494, 0.4148536, 0.3835523, 0.3517836, 0.3195865, 
+    0.2870001, 0.2540638, 0.2208181, 0.1873032, 0.1535602, 0.1196304, 
+    0.08555451, 0.05137442, 0.01713174, -0.01713181, -0.05137449, 
+    -0.08555458, -0.1196302, -0.1535603, -0.1873033, -0.2208181, -0.2540639, 
+    -0.2869999, -0.3195865, -0.3517837, -0.3835523, -0.4148536, -0.4456493, 
+    -0.4759024, -0.5055753, -0.5346325, -0.5630382, -0.5907578, -0.6177581, 
+    -0.6440053, -0.669468, -0.6941152, -0.7179167, -0.7408435, -0.7628675, 
+    -0.7839624, -0.8041018, -0.8232618, -0.8414187, -0.8585504, -0.8746363, 
+    -0.8896563, -0.9035926, -0.9164279, -0.9281468, -0.9387347, -0.948179, 
+    -0.9564681, -0.9635919, -0.9695417, -0.9743103, -0.9778918, -0.9802818, 
+    -0.9814777, -0.9814777, -0.9802818, -0.9778918, -0.9743103, -0.9695417, 
+    -0.9635919, -0.9564681, -0.948179, -0.9387347, -0.9281467, -0.9164279, 
+    -0.9035926, -0.8896564, -0.8746362, -0.8585504, -0.8414186, -0.8232619, 
+    -0.8041019, -0.7839624, -0.7628676, -0.7408434, -0.7179167, -0.6941153, 
+    -0.6694681, -0.6440054, -0.617758, -0.590758, -0.5630383, -0.5346326, 
+    -0.5055754, -0.4759023, -0.4456494, -0.4148535, -0.3835524, -0.3517838, 
+    -0.3195865, -0.287, -0.2540638, -0.220818, -0.1873034, -0.1535604, 
+    -0.1196303, -0.08555442, -0.05137434, -0.01713166, 0.01713166, 
+    0.05137434, 0.08555442, 0.1196303, 0.1535604, 0.1873034, 0.220818, 
+    0.2540638, 0.287, 0.3195865, 0.3517838, 0.3835522, 0.4148537, 0.4456494, 
+    0.4759021, 0.5055754, 0.5346323, 0.5630383, 0.590758, 0.6177582, 
+    0.6440054, 0.6694679, 0.6941153, 0.7179166, 0.7408435, 0.7628676, 
+    0.7839622, 0.8041019, 0.8232617, 0.8414187, 0.8585504, 0.8746364, 
+    0.8896564, 0.9035925, 0.9164279, 0.9281467, 0.9387348, 0.948179, 
+    0.956468, 0.9635919, 0.9695417, 0.9743103, 0.9778918, 0.9802818, 
+    0.9814777, 0.9814777, 0.9802818, 0.9778918, 0.9743103, 0.9695417, 
+    0.9635919, 0.9564681, 0.9481791, 0.9387347, 0.9281468, 0.916428, 
+    0.9035926, 0.8896564, 0.8746362, 0.8585505, 0.8414186, 0.8232618, 
+    0.804102, 0.7839623, 0.7628677, 0.7408434, 0.7179167, 0.6941154, 
+    0.669468, 0.6440055, 0.6177579, 0.5907581, 0.5630384, 0.5346325, 0.5055755,
+  0.4788409, 0.4484012, 0.4174151, 0.3859206, 0.3539558, 0.3215598, 
+    0.2887722, 0.2556326, 0.2221815, 0.1884598, 0.1545084, 0.120369, 
+    0.08608278, 0.05169164, 0.01723753, -0.01723759, -0.05169171, 
+    -0.08608285, -0.1203689, -0.1545085, -0.1884598, -0.2221816, -0.2556326, 
+    -0.288772, -0.3215598, -0.3539558, -0.3859206, -0.4174152, -0.448401, 
+    -0.4788409, -0.508697, -0.5379336, -0.5665148, -0.5944055, -0.6215726, 
+    -0.6479818, -0.6736018, -0.6984012, -0.7223495, -0.7454179, -0.7675779, 
+    -0.7888031, -0.8090669, -0.8283451, -0.8466142, -0.8638516, -0.8800368, 
+    -0.8951496, -0.9091719, -0.9220865, -0.9338777, -0.944531, -0.9540337, 
+    -0.962374, -0.9695417, -0.9755283, -0.9803263, -0.9839299, -0.9863347, 
+    -0.9875379, -0.9875379, -0.9863347, -0.9839299, -0.9803263, -0.9755283, 
+    -0.9695417, -0.962374, -0.9540337, -0.944531, -0.9338776, -0.9220865, 
+    -0.9091719, -0.8951497, -0.8800368, -0.8638517, -0.8466141, -0.8283452, 
+    -0.809067, -0.788803, -0.767578, -0.7454178, -0.7223496, -0.6984012, 
+    -0.6736019, -0.6479819, -0.6215724, -0.5944057, -0.5665148, -0.5379337, 
+    -0.5086972, -0.4788408, -0.4484011, -0.4174151, -0.3859207, -0.3539559, 
+    -0.3215599, -0.2887721, -0.2556325, -0.2221815, -0.1884599, -0.1545086, 
+    -0.120369, -0.08608269, -0.05169156, -0.01723744, 0.01723744, 0.05169156, 
+    0.08608269, 0.120369, 0.1545086, 0.1884599, 0.2221815, 0.2556325, 
+    0.2887721, 0.3215599, 0.3539559, 0.3859205, 0.4174153, 0.4484011, 
+    0.4788406, 0.5086972, 0.5379335, 0.5665148, 0.5944057, 0.6215726, 
+    0.6479819, 0.6736017, 0.6984012, 0.7223495, 0.745418, 0.767578, 
+    0.7888029, 0.809067, 0.8283451, 0.8466142, 0.8638517, 0.8800369, 
+    0.8951497, 0.9091719, 0.9220865, 0.9338776, 0.9445311, 0.9540337, 
+    0.9623739, 0.9695417, 0.9755282, 0.9803263, 0.9839299, 0.9863347, 
+    0.9875379, 0.9875379, 0.9863347, 0.9839299, 0.9803263, 0.9755283, 
+    0.9695418, 0.962374, 0.9540337, 0.944531, 0.9338777, 0.9220866, 
+    0.9091719, 0.8951498, 0.8800367, 0.8638517, 0.8466141, 0.8283451, 
+    0.8090671, 0.788803, 0.7675781, 0.7454178, 0.7223495, 0.6984013, 
+    0.6736018, 0.647982, 0.6215723, 0.5944058, 0.566515, 0.5379336, 0.5086973,
+  0.481196, 0.4506066, 0.4194681, 0.3878186, 0.3556966, 0.3231413, 0.2901925, 
+    0.2568899, 0.2232743, 0.1893867, 0.1552683, 0.1209611, 0.08650617, 
+    0.05194588, 0.01732231, -0.01732237, -0.05194594, -0.08650623, 
+    -0.1209609, -0.1552684, -0.1893868, -0.2232744, -0.2568899, -0.2901923, 
+    -0.3231414, -0.3556967, -0.3878187, -0.4194682, -0.4506064, -0.481196, 
+    -0.511199, -0.5405794, -0.5693011, -0.597329, -0.6246296, -0.6511688, 
+    -0.6769148, -0.7018361, -0.7259023, -0.7490841, -0.7713531, -0.7926827, 
+    -0.8130462, -0.8324192, -0.8507781, -0.8681003, -0.8843651, -0.8995523, 
+    -0.9136435, -0.9266217, -0.9384708, -0.9491765, -0.9587259, -0.9671072, 
+    -0.9743103, -0.9803263, -0.9851478, -0.9887692, -0.9911858, -0.992395, 
+    -0.992395, -0.9911858, -0.9887692, -0.9851478, -0.9803263, -0.9743103, 
+    -0.9671072, -0.9587259, -0.9491765, -0.9384708, -0.9266217, -0.9136435, 
+    -0.8995523, -0.8843651, -0.8681003, -0.850778, -0.8324193, -0.8130462, 
+    -0.7926826, -0.7713532, -0.7490841, -0.7259024, -0.7018362, -0.6769149, 
+    -0.6511689, -0.6246295, -0.5973291, -0.5693011, -0.5405794, -0.5111991, 
+    -0.4811959, -0.4506065, -0.419468, -0.3878188, -0.3556968, -0.3231414, 
+    -0.2901924, -0.2568898, -0.2232742, -0.1893868, -0.1552685, -0.120961, 
+    -0.08650608, -0.05194579, -0.01732222, 0.01732222, 0.05194579, 
+    0.08650608, 0.120961, 0.1552685, 0.1893868, 0.2232742, 0.2568898, 
+    0.2901924, 0.3231414, 0.3556968, 0.3878185, 0.4194683, 0.4506065, 
+    0.4811957, 0.5111991, 0.5405792, 0.5693011, 0.5973291, 0.6246297, 
+    0.6511689, 0.6769147, 0.7018362, 0.7259023, 0.7490842, 0.7713532, 
+    0.7926825, 0.8130462, 0.8324192, 0.8507782, 0.8681003, 0.8843652, 
+    0.8995523, 0.9136435, 0.9266217, 0.9384708, 0.9491766, 0.9587259, 
+    0.9671072, 0.9743103, 0.9803262, 0.9851478, 0.9887692, 0.9911858, 
+    0.992395, 0.992395, 0.9911858, 0.9887692, 0.9851478, 0.9803263, 
+    0.9743103, 0.9671072, 0.958726, 0.9491765, 0.9384708, 0.9266217, 
+    0.9136435, 0.8995524, 0.884365, 0.8681004, 0.850778, 0.8324192, 
+    0.8130463, 0.7926826, 0.7713533, 0.749084, 0.7259023, 0.7018363, 
+    0.6769148, 0.651169, 0.6246294, 0.5973293, 0.5693012, 0.5405794, 0.5111992,
+  0.4829649, 0.452263, 0.4210101, 0.3892443, 0.3570042, 0.3243292, 0.2912592, 
+    0.2578342, 0.224095, 0.1900829, 0.1558391, 0.1214057, 0.08682416, 
+    0.05213683, 0.01738598, -0.01738605, -0.05213689, -0.08682422, 
+    -0.1214055, -0.1558392, -0.1900829, -0.2240951, -0.2578343, -0.2912591, 
+    -0.3243292, -0.3570042, -0.3892443, -0.4210101, -0.4522628, -0.4829649, 
+    -0.5130782, -0.5425665, -0.5713938, -0.5995248, -0.6269258, -0.6535625, 
+    -0.6794031, -0.704416, -0.7285707, -0.7518377, -0.7741886, -0.7955966, 
+    -0.8160349, -0.8354792, -0.8539056, -0.8712915, -0.887616, -0.902859, 
+    -0.9170021, -0.9300279, -0.9419206, -0.9526657, -0.9622502, -0.9706623, 
+    -0.9778918, -0.9839299, -0.9887692, -0.9924039, -0.9948294, -0.996043, 
+    -0.996043, -0.9948294, -0.9924039, -0.9887692, -0.9839299, -0.9778918, 
+    -0.9706623, -0.9622502, -0.9526657, -0.9419206, -0.9300279, -0.9170021, 
+    -0.902859, -0.887616, -0.8712915, -0.8539055, -0.8354793, -0.816035, 
+    -0.7955965, -0.7741886, -0.7518377, -0.7285708, -0.7044161, -0.6794032, 
+    -0.6535625, -0.6269256, -0.5995249, -0.5713939, -0.5425666, -0.5130783, 
+    -0.4829648, -0.4522629, -0.42101, -0.3892444, -0.3570043, -0.3243293, 
+    -0.2912591, -0.2578341, -0.224095, -0.190083, -0.1558392, -0.1214056, 
+    -0.08682407, -0.05213675, -0.0173859, 0.0173859, 0.05213675, 0.08682407, 
+    0.1214056, 0.1558392, 0.190083, 0.224095, 0.2578341, 0.2912591, 
+    0.3243293, 0.3570043, 0.3892442, 0.4210102, 0.4522629, 0.4829646, 
+    0.5130783, 0.5425664, 0.5713939, 0.5995249, 0.6269258, 0.6535625, 
+    0.679403, 0.7044161, 0.7285706, 0.7518378, 0.7741886, 0.7955964, 
+    0.816035, 0.8354791, 0.8539056, 0.8712915, 0.8876161, 0.902859, 0.917002, 
+    0.9300279, 0.9419206, 0.9526658, 0.9622502, 0.9706622, 0.9778918, 
+    0.9839299, 0.9887692, 0.9924039, 0.9948294, 0.996043, 0.996043, 
+    0.9948294, 0.9924039, 0.9887692, 0.9839299, 0.9778919, 0.9706623, 
+    0.9622502, 0.9526657, 0.9419206, 0.930028, 0.9170021, 0.9028591, 
+    0.8876159, 0.8712916, 0.8539054, 0.8354792, 0.8160351, 0.7955965, 
+    0.7741888, 0.7518376, 0.7285707, 0.7044162, 0.6794031, 0.6535627, 
+    0.6269255, 0.599525, 0.571394, 0.5425665, 0.5130784,
+  0.4841453, 0.4533684, 0.4220391, 0.3901956, 0.3578767, 0.3251218, 
+    0.2919711, 0.2584644, 0.2246428, 0.1905475, 0.15622, 0.1217024, 
+    0.08703636, 0.05226426, 0.01742848, -0.01742854, -0.05226432, 
+    -0.08703643, -0.1217023, -0.15622, -0.1905475, -0.2246428, -0.2584644, 
+    -0.2919709, -0.3251219, -0.3578768, -0.3901957, -0.4220391, -0.4533682, 
+    -0.4841453, -0.5143322, -0.5438926, -0.5727904, -0.6009901, -0.628458, 
+    -0.6551598, -0.6810637, -0.7061377, -0.7303514, -0.7536753, -0.7760808, 
+    -0.7975411, -0.8180293, -0.8375211, -0.8559926, -0.873421, -0.8897855, 
+    -0.9050657, -0.9192433, -0.932301, -0.9442228, -0.9549941, -0.964602, 
+    -0.9730347, -0.9802818, -0.9863347, -0.9911858, -0.9948294, -0.9972609, 
+    -0.9984775, -0.9984775, -0.9972609, -0.9948294, -0.9911858, -0.9863347, 
+    -0.9802818, -0.9730347, -0.964602, -0.9549941, -0.9442227, -0.932301, 
+    -0.9192433, -0.9050657, -0.8897854, -0.873421, -0.8559925, -0.8375212, 
+    -0.8180294, -0.797541, -0.7760808, -0.7536752, -0.7303514, -0.7061377, 
+    -0.6810637, -0.6551599, -0.6284579, -0.6009902, -0.5727904, -0.5438927, 
+    -0.5143323, -0.4841452, -0.4533683, -0.422039, -0.3901957, -0.3578769, 
+    -0.325122, -0.291971, -0.2584643, -0.2246427, -0.1905476, -0.1562201, 
+    -0.1217023, -0.08703627, -0.05226417, -0.01742839, 0.01742839, 
+    0.05226417, 0.08703627, 0.1217023, 0.1562201, 0.1905476, 0.2246427, 
+    0.2584643, 0.291971, 0.325122, 0.3578769, 0.3901955, 0.4220392, 
+    0.4533683, 0.484145, 0.5143323, 0.5438924, 0.5727904, 0.6009902, 
+    0.6284581, 0.6551599, 0.6810635, 0.7061377, 0.7303513, 0.7536753, 
+    0.7760808, 0.7975408, 0.8180294, 0.8375211, 0.8559926, 0.873421, 
+    0.8897855, 0.9050657, 0.9192433, 0.932301, 0.9442227, 0.9549942, 
+    0.964602, 0.9730346, 0.9802818, 0.9863347, 0.9911858, 0.9948294, 
+    0.9972609, 0.9984775, 0.9984775, 0.9972609, 0.9948294, 0.9911858, 
+    0.9863347, 0.9802819, 0.9730347, 0.9646021, 0.9549941, 0.9442228, 
+    0.932301, 0.9192433, 0.9050658, 0.8897853, 0.8734211, 0.8559924, 
+    0.8375211, 0.8180295, 0.797541, 0.776081, 0.7536752, 0.7303514, 
+    0.7061378, 0.6810637, 0.65516, 0.6284578, 0.6009903, 0.5727906, 
+    0.5438926, 0.5143324,
+  0.4847359, 0.4539214, 0.4225539, 0.3906716, 0.3583133, 0.3255185, 
+    0.2923273, 0.2587796, 0.2249168, 0.1907799, 0.1564105, 0.1218509, 
+    0.08714254, 0.05232802, 0.01744974, -0.0174498, -0.05232808, -0.08714261, 
+    -0.1218507, -0.1564106, -0.19078, -0.2249169, -0.2587797, -0.2923271, 
+    -0.3255185, -0.3583134, -0.3906716, -0.422554, -0.4539212, -0.4847359, 
+    -0.5149596, -0.5445561, -0.5734891, -0.6017232, -0.6292247, -0.6559591, 
+    -0.6818944, -0.7069991, -0.7312423, -0.7545947, -0.7770275, -0.7985139, 
+    -0.8190272, -0.8385428, -0.8570368, -0.8744864, -0.8908709, -0.9061697, 
+    -0.9203647, -0.9334383, -0.9453746, -0.9561591, -0.9657787, -0.9742216, 
+    -0.9814777, -0.9875379, -0.992395, -0.996043, -0.9984775, -0.9996954, 
+    -0.9996954, -0.9984775, -0.996043, -0.992395, -0.9875379, -0.9814777, 
+    -0.9742216, -0.9657787, -0.9561591, -0.9453745, -0.9334383, -0.9203647, 
+    -0.9061698, -0.8908708, -0.8744864, -0.8570367, -0.8385429, -0.8190273, 
+    -0.7985139, -0.7770275, -0.7545946, -0.7312424, -0.7069991, -0.6818945, 
+    -0.6559591, -0.6292245, -0.6017233, -0.5734892, -0.5445561, -0.5149597, 
+    -0.4847358, -0.4539213, -0.4225538, -0.3906717, -0.3583134, -0.3255186, 
+    -0.2923272, -0.2587796, -0.2249167, -0.19078, -0.1564107, -0.1218508, 
+    -0.08714245, -0.05232793, -0.01744965, 0.01744965, 0.05232793, 
+    0.08714245, 0.1218508, 0.1564107, 0.19078, 0.2249167, 0.2587796, 
+    0.2923272, 0.3255186, 0.3583134, 0.3906715, 0.422554, 0.4539213, 
+    0.4847356, 0.5149597, 0.5445559, 0.5734892, 0.6017233, 0.6292247, 
+    0.6559591, 0.6818943, 0.7069991, 0.7312422, 0.7545947, 0.7770275, 
+    0.7985137, 0.8190273, 0.8385428, 0.8570368, 0.8744864, 0.8908709, 
+    0.9061698, 0.9203646, 0.9334383, 0.9453745, 0.9561592, 0.9657787, 
+    0.9742216, 0.9814777, 0.9875379, 0.992395, 0.996043, 0.9984775, 
+    0.9996954, 0.9996954, 0.9984775, 0.996043, 0.992395, 0.9875379, 
+    0.9814777, 0.9742216, 0.9657788, 0.9561591, 0.9453746, 0.9334384, 
+    0.9203647, 0.9061698, 0.8908707, 0.8744865, 0.8570367, 0.8385428, 
+    0.8190274, 0.7985138, 0.7770277, 0.7545946, 0.7312423, 0.7069992, 
+    0.6818944, 0.6559592, 0.6292244, 0.6017234, 0.5734893, 0.5445561, 
+    0.5149598,
+  0.4847359, 0.4539214, 0.4225539, 0.3906716, 0.3583133, 0.3255185, 
+    0.2923273, 0.2587796, 0.2249168, 0.1907799, 0.1564105, 0.1218509, 
+    0.08714254, 0.05232802, 0.01744974, -0.0174498, -0.05232808, -0.08714261, 
+    -0.1218507, -0.1564106, -0.19078, -0.2249169, -0.2587797, -0.2923271, 
+    -0.3255185, -0.3583134, -0.3906716, -0.422554, -0.4539212, -0.4847359, 
+    -0.5149596, -0.5445561, -0.5734891, -0.6017232, -0.6292247, -0.6559591, 
+    -0.6818944, -0.7069991, -0.7312423, -0.7545947, -0.7770275, -0.7985139, 
+    -0.8190272, -0.8385428, -0.8570368, -0.8744864, -0.8908709, -0.9061697, 
+    -0.9203647, -0.9334383, -0.9453746, -0.9561591, -0.9657787, -0.9742216, 
+    -0.9814777, -0.9875379, -0.992395, -0.996043, -0.9984775, -0.9996954, 
+    -0.9996954, -0.9984775, -0.996043, -0.992395, -0.9875379, -0.9814777, 
+    -0.9742216, -0.9657787, -0.9561591, -0.9453745, -0.9334383, -0.9203647, 
+    -0.9061698, -0.8908708, -0.8744864, -0.8570367, -0.8385429, -0.8190273, 
+    -0.7985139, -0.7770275, -0.7545946, -0.7312424, -0.7069991, -0.6818945, 
+    -0.6559591, -0.6292245, -0.6017233, -0.5734892, -0.5445561, -0.5149597, 
+    -0.4847358, -0.4539213, -0.4225538, -0.3906717, -0.3583134, -0.3255186, 
+    -0.2923272, -0.2587796, -0.2249167, -0.19078, -0.1564107, -0.1218508, 
+    -0.08714245, -0.05232793, -0.01744965, 0.01744965, 0.05232793, 
+    0.08714245, 0.1218508, 0.1564107, 0.19078, 0.2249167, 0.2587796, 
+    0.2923272, 0.3255186, 0.3583134, 0.3906715, 0.422554, 0.4539213, 
+    0.4847356, 0.5149597, 0.5445559, 0.5734892, 0.6017233, 0.6292247, 
+    0.6559591, 0.6818943, 0.7069991, 0.7312422, 0.7545947, 0.7770275, 
+    0.7985137, 0.8190273, 0.8385428, 0.8570368, 0.8744864, 0.8908709, 
+    0.9061698, 0.9203646, 0.9334383, 0.9453745, 0.9561592, 0.9657787, 
+    0.9742216, 0.9814777, 0.9875379, 0.992395, 0.996043, 0.9984775, 
+    0.9996954, 0.9996954, 0.9984775, 0.996043, 0.992395, 0.9875379, 
+    0.9814777, 0.9742216, 0.9657788, 0.9561591, 0.9453746, 0.9334384, 
+    0.9203647, 0.9061698, 0.8908707, 0.8744865, 0.8570367, 0.8385428, 
+    0.8190274, 0.7985138, 0.7770277, 0.7545946, 0.7312423, 0.7069992, 
+    0.6818944, 0.6559592, 0.6292244, 0.6017234, 0.5734893, 0.5445561, 
+    0.5149598,
+  0.4841453, 0.4533684, 0.4220391, 0.3901956, 0.3578767, 0.3251218, 
+    0.2919711, 0.2584644, 0.2246428, 0.1905475, 0.15622, 0.1217024, 
+    0.08703636, 0.05226426, 0.01742848, -0.01742854, -0.05226432, 
+    -0.08703643, -0.1217023, -0.15622, -0.1905475, -0.2246428, -0.2584644, 
+    -0.2919709, -0.3251219, -0.3578768, -0.3901957, -0.4220391, -0.4533682, 
+    -0.4841453, -0.5143322, -0.5438926, -0.5727904, -0.6009901, -0.628458, 
+    -0.6551598, -0.6810637, -0.7061377, -0.7303514, -0.7536753, -0.7760808, 
+    -0.7975411, -0.8180293, -0.8375211, -0.8559926, -0.873421, -0.8897855, 
+    -0.9050657, -0.9192433, -0.932301, -0.9442228, -0.9549941, -0.964602, 
+    -0.9730347, -0.9802818, -0.9863347, -0.9911858, -0.9948294, -0.9972609, 
+    -0.9984775, -0.9984775, -0.9972609, -0.9948294, -0.9911858, -0.9863347, 
+    -0.9802818, -0.9730347, -0.964602, -0.9549941, -0.9442227, -0.932301, 
+    -0.9192433, -0.9050657, -0.8897854, -0.873421, -0.8559925, -0.8375212, 
+    -0.8180294, -0.797541, -0.7760808, -0.7536752, -0.7303514, -0.7061377, 
+    -0.6810637, -0.6551599, -0.6284579, -0.6009902, -0.5727904, -0.5438927, 
+    -0.5143323, -0.4841452, -0.4533683, -0.422039, -0.3901957, -0.3578769, 
+    -0.325122, -0.291971, -0.2584643, -0.2246427, -0.1905476, -0.1562201, 
+    -0.1217023, -0.08703627, -0.05226417, -0.01742839, 0.01742839, 
+    0.05226417, 0.08703627, 0.1217023, 0.1562201, 0.1905476, 0.2246427, 
+    0.2584643, 0.291971, 0.325122, 0.3578769, 0.3901955, 0.4220392, 
+    0.4533683, 0.484145, 0.5143323, 0.5438924, 0.5727904, 0.6009902, 
+    0.6284581, 0.6551599, 0.6810635, 0.7061377, 0.7303513, 0.7536753, 
+    0.7760808, 0.7975408, 0.8180294, 0.8375211, 0.8559926, 0.873421, 
+    0.8897855, 0.9050657, 0.9192433, 0.932301, 0.9442227, 0.9549942, 
+    0.964602, 0.9730346, 0.9802818, 0.9863347, 0.9911858, 0.9948294, 
+    0.9972609, 0.9984775, 0.9984775, 0.9972609, 0.9948294, 0.9911858, 
+    0.9863347, 0.9802819, 0.9730347, 0.9646021, 0.9549941, 0.9442228, 
+    0.932301, 0.9192433, 0.9050658, 0.8897853, 0.8734211, 0.8559924, 
+    0.8375211, 0.8180295, 0.797541, 0.776081, 0.7536752, 0.7303514, 
+    0.7061378, 0.6810637, 0.65516, 0.6284578, 0.6009903, 0.5727906, 
+    0.5438926, 0.5143324,
+  0.4829649, 0.452263, 0.4210101, 0.3892443, 0.3570042, 0.3243292, 0.2912592, 
+    0.2578342, 0.224095, 0.1900829, 0.1558391, 0.1214057, 0.08682416, 
+    0.05213683, 0.01738598, -0.01738605, -0.05213689, -0.08682422, 
+    -0.1214055, -0.1558392, -0.1900829, -0.2240951, -0.2578343, -0.2912591, 
+    -0.3243292, -0.3570042, -0.3892443, -0.4210101, -0.4522628, -0.4829649, 
+    -0.5130782, -0.5425665, -0.5713938, -0.5995248, -0.6269258, -0.6535625, 
+    -0.6794031, -0.704416, -0.7285707, -0.7518377, -0.7741886, -0.7955966, 
+    -0.8160349, -0.8354792, -0.8539056, -0.8712915, -0.887616, -0.902859, 
+    -0.9170021, -0.9300279, -0.9419206, -0.9526657, -0.9622502, -0.9706623, 
+    -0.9778918, -0.9839299, -0.9887692, -0.9924039, -0.9948294, -0.996043, 
+    -0.996043, -0.9948294, -0.9924039, -0.9887692, -0.9839299, -0.9778918, 
+    -0.9706623, -0.9622502, -0.9526657, -0.9419206, -0.9300279, -0.9170021, 
+    -0.902859, -0.887616, -0.8712915, -0.8539055, -0.8354793, -0.816035, 
+    -0.7955965, -0.7741886, -0.7518377, -0.7285708, -0.7044161, -0.6794032, 
+    -0.6535625, -0.6269256, -0.5995249, -0.5713939, -0.5425666, -0.5130783, 
+    -0.4829648, -0.4522629, -0.42101, -0.3892444, -0.3570043, -0.3243293, 
+    -0.2912591, -0.2578341, -0.224095, -0.190083, -0.1558392, -0.1214056, 
+    -0.08682407, -0.05213675, -0.0173859, 0.0173859, 0.05213675, 0.08682407, 
+    0.1214056, 0.1558392, 0.190083, 0.224095, 0.2578341, 0.2912591, 
+    0.3243293, 0.3570043, 0.3892442, 0.4210102, 0.4522629, 0.4829646, 
+    0.5130783, 0.5425664, 0.5713939, 0.5995249, 0.6269258, 0.6535625, 
+    0.679403, 0.7044161, 0.7285706, 0.7518378, 0.7741886, 0.7955964, 
+    0.816035, 0.8354791, 0.8539056, 0.8712915, 0.8876161, 0.902859, 0.917002, 
+    0.9300279, 0.9419206, 0.9526658, 0.9622502, 0.9706622, 0.9778918, 
+    0.9839299, 0.9887692, 0.9924039, 0.9948294, 0.996043, 0.996043, 
+    0.9948294, 0.9924039, 0.9887692, 0.9839299, 0.9778919, 0.9706623, 
+    0.9622502, 0.9526657, 0.9419206, 0.930028, 0.9170021, 0.9028591, 
+    0.8876159, 0.8712916, 0.8539054, 0.8354792, 0.8160351, 0.7955965, 
+    0.7741888, 0.7518376, 0.7285707, 0.7044162, 0.6794031, 0.6535627, 
+    0.6269255, 0.599525, 0.571394, 0.5425665, 0.5130784,
+  0.481196, 0.4506066, 0.4194681, 0.3878186, 0.3556966, 0.3231413, 0.2901925, 
+    0.2568899, 0.2232743, 0.1893867, 0.1552683, 0.1209611, 0.08650617, 
+    0.05194588, 0.01732231, -0.01732237, -0.05194594, -0.08650623, 
+    -0.1209609, -0.1552684, -0.1893868, -0.2232744, -0.2568899, -0.2901923, 
+    -0.3231414, -0.3556967, -0.3878187, -0.4194682, -0.4506064, -0.481196, 
+    -0.511199, -0.5405794, -0.5693011, -0.597329, -0.6246296, -0.6511688, 
+    -0.6769148, -0.7018361, -0.7259023, -0.7490841, -0.7713531, -0.7926827, 
+    -0.8130462, -0.8324192, -0.8507781, -0.8681003, -0.8843651, -0.8995523, 
+    -0.9136435, -0.9266217, -0.9384708, -0.9491765, -0.9587259, -0.9671072, 
+    -0.9743103, -0.9803263, -0.9851478, -0.9887692, -0.9911858, -0.992395, 
+    -0.992395, -0.9911858, -0.9887692, -0.9851478, -0.9803263, -0.9743103, 
+    -0.9671072, -0.9587259, -0.9491765, -0.9384708, -0.9266217, -0.9136435, 
+    -0.8995523, -0.8843651, -0.8681003, -0.850778, -0.8324193, -0.8130462, 
+    -0.7926826, -0.7713532, -0.7490841, -0.7259024, -0.7018362, -0.6769149, 
+    -0.6511689, -0.6246295, -0.5973291, -0.5693011, -0.5405794, -0.5111991, 
+    -0.4811959, -0.4506065, -0.419468, -0.3878188, -0.3556968, -0.3231414, 
+    -0.2901924, -0.2568898, -0.2232742, -0.1893868, -0.1552685, -0.120961, 
+    -0.08650608, -0.05194579, -0.01732222, 0.01732222, 0.05194579, 
+    0.08650608, 0.120961, 0.1552685, 0.1893868, 0.2232742, 0.2568898, 
+    0.2901924, 0.3231414, 0.3556968, 0.3878185, 0.4194683, 0.4506065, 
+    0.4811957, 0.5111991, 0.5405792, 0.5693011, 0.5973291, 0.6246297, 
+    0.6511689, 0.6769147, 0.7018362, 0.7259023, 0.7490842, 0.7713532, 
+    0.7926825, 0.8130462, 0.8324192, 0.8507782, 0.8681003, 0.8843652, 
+    0.8995523, 0.9136435, 0.9266217, 0.9384708, 0.9491766, 0.9587259, 
+    0.9671072, 0.9743103, 0.9803262, 0.9851478, 0.9887692, 0.9911858, 
+    0.992395, 0.992395, 0.9911858, 0.9887692, 0.9851478, 0.9803263, 
+    0.9743103, 0.9671072, 0.958726, 0.9491765, 0.9384708, 0.9266217, 
+    0.9136435, 0.8995524, 0.884365, 0.8681004, 0.850778, 0.8324192, 
+    0.8130463, 0.7926826, 0.7713533, 0.749084, 0.7259023, 0.7018363, 
+    0.6769148, 0.651169, 0.6246294, 0.5973293, 0.5693012, 0.5405794, 0.5111992,
+  0.4788409, 0.4484012, 0.4174151, 0.3859206, 0.3539558, 0.3215598, 
+    0.2887722, 0.2556326, 0.2221815, 0.1884598, 0.1545084, 0.120369, 
+    0.08608278, 0.05169164, 0.01723753, -0.01723759, -0.05169171, 
+    -0.08608285, -0.1203689, -0.1545085, -0.1884598, -0.2221816, -0.2556326, 
+    -0.288772, -0.3215598, -0.3539558, -0.3859206, -0.4174152, -0.448401, 
+    -0.4788409, -0.508697, -0.5379336, -0.5665148, -0.5944055, -0.6215726, 
+    -0.6479818, -0.6736018, -0.6984012, -0.7223495, -0.7454179, -0.7675779, 
+    -0.7888031, -0.8090669, -0.8283451, -0.8466142, -0.8638516, -0.8800368, 
+    -0.8951496, -0.9091719, -0.9220865, -0.9338777, -0.944531, -0.9540337, 
+    -0.962374, -0.9695417, -0.9755283, -0.9803263, -0.9839299, -0.9863347, 
+    -0.9875379, -0.9875379, -0.9863347, -0.9839299, -0.9803263, -0.9755283, 
+    -0.9695417, -0.962374, -0.9540337, -0.944531, -0.9338776, -0.9220865, 
+    -0.9091719, -0.8951497, -0.8800368, -0.8638517, -0.8466141, -0.8283452, 
+    -0.809067, -0.788803, -0.767578, -0.7454178, -0.7223496, -0.6984012, 
+    -0.6736019, -0.6479819, -0.6215724, -0.5944057, -0.5665148, -0.5379337, 
+    -0.5086972, -0.4788408, -0.4484011, -0.4174151, -0.3859207, -0.3539559, 
+    -0.3215599, -0.2887721, -0.2556325, -0.2221815, -0.1884599, -0.1545086, 
+    -0.120369, -0.08608269, -0.05169156, -0.01723744, 0.01723744, 0.05169156, 
+    0.08608269, 0.120369, 0.1545086, 0.1884599, 0.2221815, 0.2556325, 
+    0.2887721, 0.3215599, 0.3539559, 0.3859205, 0.4174153, 0.4484011, 
+    0.4788406, 0.5086972, 0.5379335, 0.5665148, 0.5944057, 0.6215726, 
+    0.6479819, 0.6736017, 0.6984012, 0.7223495, 0.745418, 0.767578, 
+    0.7888029, 0.809067, 0.8283451, 0.8466142, 0.8638517, 0.8800369, 
+    0.8951497, 0.9091719, 0.9220865, 0.9338776, 0.9445311, 0.9540337, 
+    0.9623739, 0.9695417, 0.9755282, 0.9803263, 0.9839299, 0.9863347, 
+    0.9875379, 0.9875379, 0.9863347, 0.9839299, 0.9803263, 0.9755283, 
+    0.9695418, 0.962374, 0.9540337, 0.944531, 0.9338777, 0.9220866, 
+    0.9091719, 0.8951498, 0.8800367, 0.8638517, 0.8466141, 0.8283451, 
+    0.8090671, 0.788803, 0.7675781, 0.7454178, 0.7223495, 0.6984013, 
+    0.6736018, 0.647982, 0.6215723, 0.5944058, 0.566515, 0.5379336, 0.5086973,
+  0.4759024, 0.4456494, 0.4148536, 0.3835523, 0.3517836, 0.3195865, 
+    0.2870001, 0.2540638, 0.2208181, 0.1873032, 0.1535602, 0.1196304, 
+    0.08555451, 0.05137442, 0.01713174, -0.01713181, -0.05137449, 
+    -0.08555458, -0.1196302, -0.1535603, -0.1873033, -0.2208181, -0.2540639, 
+    -0.2869999, -0.3195865, -0.3517837, -0.3835523, -0.4148536, -0.4456493, 
+    -0.4759024, -0.5055753, -0.5346325, -0.5630382, -0.5907578, -0.6177581, 
+    -0.6440053, -0.669468, -0.6941152, -0.7179167, -0.7408435, -0.7628675, 
+    -0.7839624, -0.8041018, -0.8232618, -0.8414187, -0.8585504, -0.8746363, 
+    -0.8896563, -0.9035926, -0.9164279, -0.9281468, -0.9387347, -0.948179, 
+    -0.9564681, -0.9635919, -0.9695417, -0.9743103, -0.9778918, -0.9802818, 
+    -0.9814777, -0.9814777, -0.9802818, -0.9778918, -0.9743103, -0.9695417, 
+    -0.9635919, -0.9564681, -0.948179, -0.9387347, -0.9281467, -0.9164279, 
+    -0.9035926, -0.8896564, -0.8746362, -0.8585504, -0.8414186, -0.8232619, 
+    -0.8041019, -0.7839624, -0.7628676, -0.7408434, -0.7179167, -0.6941153, 
+    -0.6694681, -0.6440054, -0.617758, -0.590758, -0.5630383, -0.5346326, 
+    -0.5055754, -0.4759023, -0.4456494, -0.4148535, -0.3835524, -0.3517838, 
+    -0.3195865, -0.287, -0.2540638, -0.220818, -0.1873034, -0.1535604, 
+    -0.1196303, -0.08555442, -0.05137434, -0.01713166, 0.01713166, 
+    0.05137434, 0.08555442, 0.1196303, 0.1535604, 0.1873034, 0.220818, 
+    0.2540638, 0.287, 0.3195865, 0.3517838, 0.3835522, 0.4148537, 0.4456494, 
+    0.4759021, 0.5055754, 0.5346323, 0.5630383, 0.590758, 0.6177582, 
+    0.6440054, 0.6694679, 0.6941153, 0.7179166, 0.7408435, 0.7628676, 
+    0.7839622, 0.8041019, 0.8232617, 0.8414187, 0.8585504, 0.8746364, 
+    0.8896564, 0.9035925, 0.9164279, 0.9281467, 0.9387348, 0.948179, 
+    0.956468, 0.9635919, 0.9695417, 0.9743103, 0.9778918, 0.9802818, 
+    0.9814777, 0.9814777, 0.9802818, 0.9778918, 0.9743103, 0.9695417, 
+    0.9635919, 0.9564681, 0.9481791, 0.9387347, 0.9281468, 0.916428, 
+    0.9035926, 0.8896564, 0.8746362, 0.8585505, 0.8414186, 0.8232618, 
+    0.804102, 0.7839623, 0.7628677, 0.7408434, 0.7179167, 0.6941154, 
+    0.669468, 0.6440055, 0.6177579, 0.5907581, 0.5630384, 0.5346325, 0.5055755,
+  0.4723841, 0.4423548, 0.4117866, 0.3807167, 0.3491829, 0.3172238, 
+    0.2848783, 0.2521856, 0.2191856, 0.1859185, 0.152425, 0.1187459, 
+    0.08492202, 0.05099462, 0.01700509, -0.01700515, -0.05099468, 
+    -0.08492208, -0.1187458, -0.152425, -0.1859186, -0.2191856, -0.2521856, 
+    -0.2848781, -0.3172238, -0.349183, -0.3807167, -0.4117866, -0.4423546, 
+    -0.4723841, -0.5018376, -0.53068, -0.5588757, -0.5863904, -0.6131911, 
+    -0.6392442, -0.6645187, -0.6889837, -0.7126092, -0.7353665, -0.7572277, 
+    -0.7781666, -0.7981572, -0.8171755, -0.8351982, -0.8522031, -0.8681701, 
+    -0.8830792, -0.8969124, -0.9096528, -0.921285, -0.9317947, -0.9411692, 
+    -0.949397, -0.9564681, -0.962374, -0.9671072, -0.9706623, -0.9730347, 
+    -0.9742216, -0.9742216, -0.9730347, -0.9706623, -0.9671072, -0.962374, 
+    -0.9564681, -0.949397, -0.9411692, -0.9317947, -0.921285, -0.9096528, 
+    -0.8969124, -0.8830792, -0.8681701, -0.8522032, -0.8351981, -0.8171755, 
+    -0.7981572, -0.7781666, -0.7572277, -0.7353664, -0.7126092, -0.6889837, 
+    -0.6645188, -0.6392443, -0.6131909, -0.5863905, -0.5588758, -0.5306801, 
+    -0.5018377, -0.472384, -0.4423547, -0.4117865, -0.3807168, -0.3491831, 
+    -0.3172239, -0.2848782, -0.2521855, -0.2191855, -0.1859187, -0.1524251, 
+    -0.1187459, -0.08492193, -0.05099453, -0.01700501, 0.01700501, 
+    0.05099453, 0.08492193, 0.1187459, 0.1524251, 0.1859187, 0.2191855, 
+    0.2521855, 0.2848782, 0.3172239, 0.3491831, 0.3807166, 0.4117867, 
+    0.4423547, 0.4723838, 0.5018377, 0.5306798, 0.5588758, 0.5863905, 
+    0.6131911, 0.6392443, 0.6645186, 0.6889837, 0.7126091, 0.7353665, 
+    0.7572277, 0.7781664, 0.7981572, 0.8171754, 0.8351982, 0.8522032, 
+    0.8681702, 0.8830792, 0.8969123, 0.9096528, 0.921285, 0.9317948, 
+    0.9411692, 0.949397, 0.9564681, 0.9623739, 0.9671072, 0.9706623, 
+    0.9730347, 0.9742216, 0.9742216, 0.9730347, 0.9706623, 0.9671072, 
+    0.962374, 0.9564682, 0.949397, 0.9411693, 0.9317947, 0.921285, 0.9096529, 
+    0.8969124, 0.8830793, 0.86817, 0.8522032, 0.835198, 0.8171755, 0.7981573, 
+    0.7781665, 0.7572278, 0.7353663, 0.7126092, 0.6889839, 0.6645187, 
+    0.6392444, 0.6131908, 0.5863906, 0.5588759, 0.53068, 0.5018378,
+  0.4682902, 0.4385212, 0.4082179, 0.3774173, 0.3461568, 0.3144746, 
+    0.2824095, 0.25, 0.217286, 0.1843073, 0.151104, 0.1177168, 0.08418605, 
+    0.05055268, 0.01685772, -0.01685778, -0.05055274, -0.08418611, 
+    -0.1177167, -0.1511041, -0.1843074, -0.2172861, -0.2500001, -0.2824093, 
+    -0.3144746, -0.3461568, -0.3774173, -0.408218, -0.438521, -0.4682903, 
+    -0.4974885, -0.5260809, -0.5540323, -0.5813085, -0.6078769, -0.6337043, 
+    -0.6587598, -0.6830127, -0.7064334, -0.7289935, -0.7506652, -0.7714227, 
+    -0.79124, -0.8100935, -0.82796, -0.8448176, -0.8606462, -0.8754261, 
+    -0.8891394, -0.9017695, -0.9133008, -0.9237194, -0.9330127, -0.9411692, 
+    -0.948179, -0.9540337, -0.9587259, -0.9622502, -0.964602, -0.9657787, 
+    -0.9657787, -0.964602, -0.9622502, -0.9587259, -0.9540337, -0.948179, 
+    -0.9411692, -0.9330127, -0.9237194, -0.9133008, -0.9017695, -0.8891394, 
+    -0.8754261, -0.8606462, -0.8448177, -0.82796, -0.8100936, -0.7912401, 
+    -0.7714227, -0.7506653, -0.7289934, -0.7064335, -0.6830127, -0.6587598, 
+    -0.6337044, -0.6078768, -0.5813086, -0.5540324, -0.526081, -0.4974886, 
+    -0.4682901, -0.4385211, -0.4082178, -0.3774174, -0.3461569, -0.3144747, 
+    -0.2824094, -0.2499999, -0.2172859, -0.1843074, -0.1511041, -0.1177168, 
+    -0.08418597, -0.0505526, -0.01685763, 0.01685763, 0.0505526, 0.08418597, 
+    0.1177168, 0.1511041, 0.1843074, 0.2172859, 0.2499999, 0.2824094, 
+    0.3144747, 0.3461569, 0.3774172, 0.408218, 0.4385211, 0.4682899, 
+    0.4974886, 0.5260807, 0.5540324, 0.5813086, 0.607877, 0.6337044, 
+    0.6587597, 0.6830127, 0.7064334, 0.7289935, 0.7506653, 0.7714225, 
+    0.7912401, 0.8100935, 0.8279601, 0.8448177, 0.8606463, 0.8754261, 
+    0.8891394, 0.9017695, 0.9133008, 0.9237195, 0.9330127, 0.9411691, 
+    0.948179, 0.9540336, 0.9587259, 0.9622502, 0.964602, 0.9657787, 
+    0.9657787, 0.964602, 0.9622502, 0.9587259, 0.9540337, 0.9481791, 
+    0.9411692, 0.9330127, 0.9237194, 0.9133008, 0.9017695, 0.8891394, 
+    0.8754262, 0.8606461, 0.8448178, 0.8279599, 0.8100935, 0.7912402, 
+    0.7714226, 0.7506654, 0.7289934, 0.7064334, 0.6830128, 0.6587598, 
+    0.6337045, 0.6078767, 0.5813087, 0.5540324, 0.5260809, 0.4974887,
+  0.4636258, 0.4341533, 0.4041519, 0.373658, 0.3427089, 0.3113423, 0.2795965, 
+    0.2475099, 0.2151218, 0.1824715, 0.1495989, 0.1165443, 0.08334752, 
+    0.05004915, 0.01668981, -0.01668987, -0.05004921, -0.08334758, 
+    -0.1165442, -0.149599, -0.1824716, -0.2151218, -0.24751, -0.2795964, 
+    -0.3113423, -0.3427089, -0.3736581, -0.4041519, -0.4341532, -0.4636259, 
+    -0.4925333, -0.5208409, -0.5485139, -0.5755184, -0.6018222, -0.6273924, 
+    -0.6521983, -0.6762096, -0.699397, -0.7217324, -0.7431883, -0.763739, 
+    -0.783359, -0.8020247, -0.8197132, -0.8364029, -0.8520738, -0.8667064, 
+    -0.8802832, -0.8927875, -0.904204, -0.9145188, -0.9237195, -0.9317948, 
+    -0.9387348, -0.9445311, -0.9491766, -0.9526658, -0.9549942, -0.9561592, 
+    -0.9561592, -0.9549942, -0.9526658, -0.9491766, -0.9445311, -0.9387348, 
+    -0.9317948, -0.9237195, -0.9145188, -0.9042039, -0.8927875, -0.8802832, 
+    -0.8667065, -0.8520738, -0.836403, -0.8197131, -0.8020247, -0.7833591, 
+    -0.763739, -0.7431884, -0.7217324, -0.6993971, -0.6762096, -0.6521983, 
+    -0.6273924, -0.6018221, -0.5755185, -0.5485139, -0.520841, -0.4925334, 
+    -0.4636258, -0.4341533, -0.4041518, -0.3736581, -0.342709, -0.3113424, 
+    -0.2795964, -0.2475098, -0.2151217, -0.1824717, -0.1495991, -0.1165443, 
+    -0.08334743, -0.05004907, -0.01668973, 0.01668973, 0.05004907, 
+    0.08334743, 0.1165443, 0.1495991, 0.1824717, 0.2151217, 0.2475098, 
+    0.2795964, 0.3113424, 0.342709, 0.3736579, 0.404152, 0.4341533, 
+    0.4636256, 0.4925334, 0.5208408, 0.5485139, 0.5755185, 0.6018223, 
+    0.6273924, 0.6521981, 0.6762096, 0.699397, 0.7217324, 0.7431884, 
+    0.7637388, 0.7833591, 0.8020246, 0.8197132, 0.836403, 0.8520739, 
+    0.8667065, 0.8802832, 0.8927875, 0.9042039, 0.9145188, 0.9237195, 
+    0.9317947, 0.9387348, 0.9445311, 0.9491766, 0.9526658, 0.9549942, 
+    0.9561592, 0.9561592, 0.9549942, 0.9526658, 0.9491766, 0.9445311, 
+    0.9387348, 0.9317948, 0.9237195, 0.9145188, 0.904204, 0.8927875, 
+    0.8802832, 0.8667066, 0.8520737, 0.836403, 0.8197131, 0.8020247, 
+    0.7833592, 0.7637389, 0.7431885, 0.7217323, 0.699397, 0.6762097, 
+    0.6521983, 0.6273925, 0.601822, 0.5755187, 0.5485141, 0.5208409, 0.4925335,
+  0.4583966, 0.4292565, 0.3995934, 0.3694435, 0.3388435, 0.3078306, 
+    0.2764429, 0.2447182, 0.2126954, 0.1804134, 0.1479116, 0.1152298, 
+    0.08240744, 0.04948464, 0.01650156, -0.01650162, -0.0494847, -0.0824075, 
+    -0.1152297, -0.1479117, -0.1804135, -0.2126954, -0.2447183, -0.2764428, 
+    -0.3078307, -0.3388435, -0.3694436, -0.3995935, -0.4292563, -0.4583966, 
+    -0.486978, -0.5149663, -0.5423272, -0.5690271, -0.5950342, -0.6203159, 
+    -0.644842, -0.6685826, -0.6915085, -0.7135919, -0.7348058, -0.7551248, 
+    -0.7745234, -0.7929786, -0.8104676, -0.8269691, -0.8424633, -0.8569308, 
+    -0.8703544, -0.8827177, -0.8940054, -0.9042039, -0.9133008, -0.921285, 
+    -0.9281467, -0.9338776, -0.9384708, -0.9419206, -0.9442227, -0.9453745, 
+    -0.9453745, -0.9442227, -0.9419206, -0.9384708, -0.9338776, -0.9281467, 
+    -0.921285, -0.9133008, -0.9042039, -0.8940054, -0.8827177, -0.8703544, 
+    -0.8569309, -0.8424632, -0.8269691, -0.8104675, -0.7929786, -0.7745235, 
+    -0.7551247, -0.7348059, -0.7135919, -0.6915085, -0.6685826, -0.6448421, 
+    -0.620316, -0.5950341, -0.5690272, -0.5423272, -0.5149664, -0.4869781, 
+    -0.4583965, -0.4292564, -0.3995933, -0.3694436, -0.3388436, -0.3078308, 
+    -0.2764429, -0.2447181, -0.2126953, -0.1804135, -0.1479117, -0.1152297, 
+    -0.08240736, -0.04948456, -0.01650148, 0.01650148, 0.04948456, 
+    0.08240736, 0.1152297, 0.1479117, 0.1804135, 0.2126953, 0.2447181, 
+    0.2764429, 0.3078308, 0.3388436, 0.3694434, 0.3995935, 0.4292564, 
+    0.4583963, 0.4869781, 0.5149661, 0.5423272, 0.5690272, 0.5950342, 
+    0.620316, 0.644842, 0.6685826, 0.6915084, 0.713592, 0.7348059, 0.7551246, 
+    0.7745235, 0.7929785, 0.8104677, 0.8269691, 0.8424633, 0.8569309, 
+    0.8703544, 0.8827177, 0.8940054, 0.9042039, 0.9133008, 0.9212849, 
+    0.9281467, 0.9338776, 0.9384708, 0.9419206, 0.9442227, 0.9453745, 
+    0.9453745, 0.9442227, 0.9419206, 0.9384708, 0.9338776, 0.9281468, 
+    0.921285, 0.9133008, 0.9042039, 0.8940054, 0.8827177, 0.8703544, 
+    0.8569309, 0.8424631, 0.8269691, 0.8104675, 0.7929786, 0.7745236, 
+    0.7551247, 0.734806, 0.7135918, 0.6915085, 0.6685827, 0.644842, 
+    0.6203161, 0.595034, 0.5690274, 0.5423273, 0.5149663, 0.4869782,
+  0.4526088, 0.4238367, 0.3945481, 0.3647789, 0.3345652, 0.303944, 0.2729526, 
+    0.2416284, 0.2100099, 0.1781355, 0.1460441, 0.1137749, 0.08136696, 
+    0.04885985, 0.01629321, -0.01629327, -0.04885991, -0.08136702, 
+    -0.1137748, -0.1460441, -0.1781356, -0.2100099, -0.2416285, -0.2729524, 
+    -0.303944, -0.3345653, -0.3647789, -0.3945482, -0.4238365, -0.4526089, 
+    -0.4808294, -0.5084643, -0.5354797, -0.5618426, -0.5875213, -0.6124838, 
+    -0.6367003, -0.660141, -0.6827775, -0.7045821, -0.7255281, -0.7455906, 
+    -0.7647442, -0.7829664, -0.8002346, -0.8165277, -0.8318263, -0.8461112, 
+    -0.8593653, -0.8715724, -0.8827177, -0.8927873, -0.9017694, -0.9096528, 
+    -0.9164279, -0.9220865, -0.9266216, -0.9300278, -0.9323009, -0.9334382, 
+    -0.9334382, -0.9323009, -0.9300278, -0.9266216, -0.9220865, -0.9164279, 
+    -0.9096528, -0.9017694, -0.8927873, -0.8827176, -0.8715724, -0.8593653, 
+    -0.8461112, -0.8318262, -0.8165278, -0.8002346, -0.7829664, -0.7647443, 
+    -0.7455905, -0.7255282, -0.704582, -0.6827775, -0.6601411, -0.6367003, 
+    -0.6124839, -0.5875212, -0.5618427, -0.5354798, -0.5084644, -0.4808295, 
+    -0.4526087, -0.4238366, -0.3945481, -0.364779, -0.3345653, -0.3039441, 
+    -0.2729525, -0.2416283, -0.2100098, -0.1781356, -0.1460442, -0.1137749, 
+    -0.08136687, -0.04885977, -0.01629313, 0.01629313, 0.04885977, 
+    0.08136687, 0.1137749, 0.1460442, 0.1781356, 0.2100098, 0.2416283, 
+    0.2729525, 0.3039441, 0.3345653, 0.3647788, 0.3945482, 0.4238366, 
+    0.4526086, 0.4808295, 0.5084642, 0.5354798, 0.5618427, 0.5875213, 
+    0.6124839, 0.6367002, 0.6601411, 0.6827774, 0.7045822, 0.7255282, 
+    0.7455903, 0.7647443, 0.7829663, 0.8002347, 0.8165278, 0.8318263, 
+    0.8461112, 0.8593652, 0.8715724, 0.8827176, 0.8927874, 0.9017694, 
+    0.9096527, 0.9164279, 0.9220864, 0.9266216, 0.9300278, 0.9323009, 
+    0.9334382, 0.9334382, 0.9323009, 0.9300278, 0.9266216, 0.9220865, 
+    0.9164279, 0.9096528, 0.9017695, 0.8927873, 0.8827177, 0.8715725, 
+    0.8593653, 0.8461113, 0.8318262, 0.8165278, 0.8002345, 0.7829664, 
+    0.7647444, 0.7455904, 0.7255283, 0.704582, 0.6827775, 0.6601412, 
+    0.6367003, 0.612484, 0.5875211, 0.5618428, 0.5354799, 0.5084643, 0.4808296,
+  0.4462697, 0.4179005, 0.3890222, 0.3596699, 0.3298794, 0.299687, 0.2691296, 
+    0.2382442, 0.2070685, 0.1756406, 0.1439986, 0.1121814, 0.08022735, 
+    0.04817553, 0.01606501, -0.01606507, -0.04817559, -0.08022741, 
+    -0.1121813, -0.1439987, -0.1756406, -0.2070686, -0.2382443, -0.2691295, 
+    -0.299687, -0.3298794, -0.3596699, -0.3890222, -0.4179004, -0.4462698, 
+    -0.474095, -0.5013429, -0.5279799, -0.5539735, -0.5792926, -0.6039055, 
+    -0.6277828, -0.6508952, -0.6732146, -0.6947139, -0.7153665, -0.735148, 
+    -0.7540334, -0.7720003, -0.7890267, -0.8050916, -0.8201759, -0.8342607, 
+    -0.8473292, -0.8593653, -0.8703545, -0.8802832, -0.8891394, -0.8969124, 
+    -0.9035926, -0.9091719, -0.9136435, -0.9170021, -0.9192433, -0.9203647, 
+    -0.9203647, -0.9192433, -0.9170021, -0.9136435, -0.9091719, -0.9035926, 
+    -0.8969124, -0.8891394, -0.8802832, -0.8703544, -0.8593653, -0.8473292, 
+    -0.8342608, -0.8201758, -0.8050917, -0.7890266, -0.7720004, -0.7540334, 
+    -0.7351479, -0.7153666, -0.6947138, -0.6732147, -0.6508953, -0.6277828, 
+    -0.6039055, -0.5792925, -0.5539736, -0.52798, -0.501343, -0.4740951, 
+    -0.4462696, -0.4179004, -0.3890221, -0.35967, -0.3298795, -0.2996871, 
+    -0.2691296, -0.2382441, -0.2070685, -0.1756407, -0.1439987, -0.1121813, 
+    -0.08022726, -0.04817545, -0.01606493, 0.01606493, 0.04817545, 
+    0.08022726, 0.1121813, 0.1439987, 0.1756407, 0.2070685, 0.2382441, 
+    0.2691296, 0.2996871, 0.3298795, 0.3596698, 0.3890223, 0.4179004, 
+    0.4462694, 0.4740951, 0.5013427, 0.52798, 0.5539736, 0.5792927, 
+    0.6039055, 0.6277826, 0.6508953, 0.6732146, 0.6947139, 0.7153666, 
+    0.7351477, 0.7540334, 0.7720003, 0.7890267, 0.8050917, 0.8201759, 
+    0.8342608, 0.8473291, 0.8593653, 0.8703544, 0.8802832, 0.8891394, 
+    0.8969123, 0.9035926, 0.9091719, 0.9136435, 0.9170021, 0.9192433, 
+    0.9203647, 0.9203647, 0.9192433, 0.9170021, 0.9136435, 0.9091719, 
+    0.9035926, 0.8969124, 0.8891395, 0.8802832, 0.8703545, 0.8593654, 
+    0.8473292, 0.8342608, 0.8201758, 0.8050917, 0.7890266, 0.7720003, 
+    0.7540336, 0.7351478, 0.7153667, 0.6947138, 0.6732146, 0.6508954, 
+    0.6277828, 0.6039056, 0.5792924, 0.5539737, 0.5279801, 0.5013429, 
+    0.4740952,
+  0.4393868, 0.4114552, 0.3830222, 0.3541226, 0.3247916, 0.2950648, 
+    0.2649788, 0.2345697, 0.2038749, 0.1729316, 0.1417777, 0.1104512, 
+    0.07898999, 0.04743251, 0.01581724, -0.0158173, -0.04743257, -0.07899005, 
+    -0.1104511, -0.1417778, -0.1729317, -0.2038749, -0.2345698, -0.2649786, 
+    -0.2950649, -0.3247916, -0.3541227, -0.3830223, -0.411455, -0.4393868, 
+    -0.466783, -0.4936106, -0.5198368, -0.5454295, -0.570358, -0.5945913, 
+    -0.6181003, -0.6408563, -0.6628315, -0.6839992, -0.7043333, -0.7238097, 
+    -0.7424038, -0.7600936, -0.7768574, -0.7926745, -0.8075262, -0.8213937, 
+    -0.8342607, -0.8461112, -0.8569309, -0.8667064, -0.8754261, -0.8830792, 
+    -0.8896563, -0.8951496, -0.8995523, -0.902859, -0.9050657, -0.9061697, 
+    -0.9061697, -0.9050657, -0.902859, -0.8995523, -0.8951496, -0.8896563, 
+    -0.8830792, -0.8754261, -0.8667064, -0.8569308, -0.8461112, -0.8342607, 
+    -0.8213938, -0.8075261, -0.7926746, -0.7768573, -0.7600937, -0.7424039, 
+    -0.7238096, -0.7043334, -0.6839991, -0.6628316, -0.6408564, -0.6181004, 
+    -0.5945914, -0.5703579, -0.5454296, -0.5198368, -0.4936107, -0.466783, 
+    -0.4393867, -0.4114551, -0.3830221, -0.3541227, -0.3247917, -0.295065, 
+    -0.2649787, -0.2345697, -0.2038748, -0.1729318, -0.1417778, -0.1104511, 
+    -0.07898991, -0.04743243, -0.01581716, 0.01581716, 0.04743243, 
+    0.07898991, 0.1104511, 0.1417778, 0.1729318, 0.2038748, 0.2345697, 
+    0.2649787, 0.295065, 0.3247917, 0.3541225, 0.3830223, 0.4114551, 
+    0.4393865, 0.466783, 0.4936104, 0.5198368, 0.5454296, 0.5703581, 
+    0.5945914, 0.6181002, 0.6408564, 0.6628315, 0.6839992, 0.7043334, 
+    0.7238094, 0.7424039, 0.7600936, 0.7768574, 0.7926746, 0.8075262, 
+    0.8213938, 0.8342606, 0.8461112, 0.8569308, 0.8667064, 0.8754261, 
+    0.8830791, 0.8896563, 0.8951496, 0.8995523, 0.902859, 0.9050657, 
+    0.9061697, 0.9061697, 0.9050657, 0.902859, 0.8995523, 0.8951496, 
+    0.8896564, 0.8830792, 0.8754261, 0.8667064, 0.8569309, 0.8461112, 
+    0.8342607, 0.8213938, 0.8075261, 0.7926747, 0.7768573, 0.7600936, 
+    0.742404, 0.7238095, 0.7043335, 0.6839991, 0.6628315, 0.6408565, 
+    0.6181003, 0.5945915, 0.5703579, 0.5454297, 0.519837, 0.4936106, 0.4667832,
+  0.4319686, 0.4045085, 0.3765557, 0.348144, 0.3193081, 0.2900833, 0.2605052, 
+    0.2306095, 0.2004329, 0.170012, 0.139384, 0.1085865, 0.0776564, 
+    0.04663171, 0.0155502, -0.01555025, -0.04663176, -0.07765646, -0.1085863, 
+    -0.1393841, -0.1700121, -0.2004329, -0.2306095, -0.260505, -0.2900833, 
+    -0.3193082, -0.348144, -0.3765557, -0.4045084, -0.4319687, -0.4589022, 
+    -0.4852769, -0.5110604, -0.536221, -0.5607287, -0.5845528, -0.6076649, 
+    -0.6300368, -0.651641, -0.6724512, -0.6924421, -0.7115895, -0.7298698, 
+    -0.7472609, -0.7637417, -0.7792917, -0.7938927, -0.8075261, -0.8201758, 
+    -0.8318263, -0.8424633, -0.8520737, -0.8606462, -0.8681701, -0.8746362, 
+    -0.8800368, -0.8843651, -0.887616, -0.8897854, -0.8908708, -0.8908708, 
+    -0.8897854, -0.887616, -0.8843651, -0.8800368, -0.8746362, -0.8681701, 
+    -0.8606462, -0.8520737, -0.8424632, -0.8318263, -0.8201758, -0.8075262, 
+    -0.7938926, -0.7792918, -0.7637416, -0.747261, -0.7298698, -0.7115895, 
+    -0.6924421, -0.6724511, -0.651641, -0.6300368, -0.607665, -0.5845529, 
+    -0.5607285, -0.5362211, -0.5110604, -0.485277, -0.4589023, -0.4319685, 
+    -0.4045085, -0.3765556, -0.3481441, -0.3193082, -0.2900834, -0.2605051, 
+    -0.2306094, -0.2004328, -0.1700122, -0.1393842, -0.1085864, -0.07765631, 
+    -0.04663163, -0.01555012, 0.01555012, 0.04663163, 0.07765631, 0.1085864, 
+    0.1393842, 0.1700122, 0.2004328, 0.2306094, 0.2605051, 0.2900834, 
+    0.3193082, 0.3481439, 0.3765557, 0.4045085, 0.4319683, 0.4589023, 
+    0.4852768, 0.5110604, 0.5362211, 0.5607287, 0.5845529, 0.6076648, 
+    0.6300368, 0.6516409, 0.6724513, 0.6924421, 0.7115893, 0.7298698, 
+    0.7472609, 0.7637417, 0.7792918, 0.7938927, 0.8075262, 0.8201758, 
+    0.8318263, 0.8424632, 0.8520738, 0.8606462, 0.86817, 0.8746362, 
+    0.8800367, 0.8843651, 0.887616, 0.8897854, 0.8908708, 0.8908708, 
+    0.8897854, 0.887616, 0.8843651, 0.8800368, 0.8746363, 0.8681701, 
+    0.8606462, 0.8520737, 0.8424633, 0.8318263, 0.8201758, 0.8075262, 
+    0.7938926, 0.7792919, 0.7637416, 0.7472609, 0.72987, 0.7115895, 
+    0.6924422, 0.6724511, 0.651641, 0.6300369, 0.6076649, 0.584553, 
+    0.5607285, 0.5362212, 0.5110605, 0.4852769, 0.4589024,
+  0.4240241, 0.3970691, 0.3696303, 0.3417411, 0.3134356, 0.2847482, 
+    0.2557141, 0.2263683, 0.1967466, 0.1668853, 0.1368206, 0.1065894, 
+    0.07622819, 0.04577408, 0.01526421, -0.01526426, -0.04577414, 
+    -0.07622825, -0.1065893, -0.1368207, -0.1668853, -0.1967467, -0.2263683, 
+    -0.255714, -0.2847483, -0.3134356, -0.3417412, -0.3696303, -0.3970689, 
+    -0.4240242, -0.4504624, -0.4763521, -0.5016613, -0.5263591, -0.5504161, 
+    -0.5738021, -0.5964892, -0.6184495, -0.6396564, -0.6600839, -0.6797071, 
+    -0.6985024, -0.7164465, -0.7335178, -0.7496954, -0.7649596, -0.7792919, 
+    -0.7926747, -0.8050917, -0.8165279, -0.8269692, -0.836403, -0.8448178, 
+    -0.8522032, -0.8585505, -0.8638517, -0.8681004, -0.8712916, -0.8734211, 
+    -0.8744865, -0.8744865, -0.8734211, -0.8712916, -0.8681004, -0.8638517, 
+    -0.8585505, -0.8522032, -0.8448178, -0.836403, -0.8269691, -0.8165279, 
+    -0.8050917, -0.7926747, -0.7792919, -0.7649596, -0.7496954, -0.7335179, 
+    -0.7164465, -0.6985024, -0.6797072, -0.6600838, -0.6396564, -0.6184496, 
+    -0.5964893, -0.5738022, -0.550416, -0.5263593, -0.5016613, -0.4763521, 
+    -0.4504625, -0.424024, -0.397069, -0.3696302, -0.3417412, -0.3134357, 
+    -0.2847483, -0.2557141, -0.2263682, -0.1967466, -0.1668854, -0.1368207, 
+    -0.1065893, -0.07622811, -0.04577401, -0.01526413, 0.01526413, 
+    0.04577401, 0.07622811, 0.1065893, 0.1368207, 0.1668854, 0.1967466, 
+    0.2263682, 0.2557141, 0.2847483, 0.3134357, 0.3417411, 0.3696304, 
+    0.397069, 0.4240239, 0.4504625, 0.4763519, 0.5016613, 0.5263593, 
+    0.5504162, 0.5738022, 0.5964891, 0.6184496, 0.6396563, 0.6600839, 
+    0.6797072, 0.6985022, 0.7164465, 0.7335178, 0.7496955, 0.7649596, 
+    0.779292, 0.7926747, 0.8050917, 0.8165279, 0.8269691, 0.836403, 
+    0.8448178, 0.8522032, 0.8585505, 0.8638517, 0.8681004, 0.8712916, 
+    0.8734211, 0.8744865, 0.8744865, 0.8734211, 0.8712916, 0.8681004, 
+    0.8638517, 0.8585505, 0.8522032, 0.8448178, 0.836403, 0.8269692, 
+    0.816528, 0.8050917, 0.7926747, 0.7792918, 0.7649596, 0.7496953, 
+    0.7335178, 0.7164466, 0.6985024, 0.6797072, 0.6600838, 0.6396564, 
+    0.6184497, 0.5964892, 0.5738023, 0.5504159, 0.5263594, 0.5016614, 
+    0.4763521, 0.4504626,
+  0.415563, 0.3891459, 0.3622546, 0.3349219, 0.3071812, 0.2790663, 0.2506115, 
+    0.2218512, 0.1928207, 0.1635552, 0.1340904, 0.1044625, 0.07470711, 
+    0.04486069, 0.01495962, -0.01495968, -0.04486075, -0.07470717, 
+    -0.1044624, -0.1340905, -0.1635552, -0.1928207, -0.2218513, -0.2506114, 
+    -0.2790663, -0.3071813, -0.334922, -0.3622546, -0.3891457, -0.4155631, 
+    -0.4414738, -0.4668468, -0.491651, -0.515856, -0.5394329, -0.5623523, 
+    -0.5845867, -0.6061088, -0.6268925, -0.6469124, -0.666144, -0.6845644, 
+    -0.7021503, -0.718881, -0.7347358, -0.7496953, -0.7637417, -0.7768574, 
+    -0.7890267, -0.8002346, -0.8104677, -0.8197132, -0.82796, -0.8351982, 
+    -0.8414187, -0.8466142, -0.8507781, -0.8539056, -0.8559926, -0.8570368, 
+    -0.8570368, -0.8559926, -0.8539056, -0.8507781, -0.8466142, -0.8414187, 
+    -0.8351982, -0.82796, -0.8197132, -0.8104676, -0.8002346, -0.7890267, 
+    -0.7768574, -0.7637417, -0.7496954, -0.7347357, -0.718881, -0.7021503, 
+    -0.6845643, -0.6661441, -0.6469123, -0.6268925, -0.6061088, -0.5845867, 
+    -0.5623524, -0.5394329, -0.5158561, -0.491651, -0.4668468, -0.4414738, 
+    -0.415563, -0.3891458, -0.3622545, -0.334922, -0.3071813, -0.2790664, 
+    -0.2506115, -0.2218512, -0.1928206, -0.1635553, -0.1340906, -0.1044624, 
+    -0.07470704, -0.04486062, -0.01495955, 0.01495955, 0.04486062, 
+    0.07470704, 0.1044624, 0.1340906, 0.1635553, 0.1928206, 0.2218512, 
+    0.2506115, 0.2790664, 0.3071813, 0.3349218, 0.3622547, 0.3891458, 
+    0.4155628, 0.4414738, 0.4668466, 0.491651, 0.5158561, 0.539433, 
+    0.5623524, 0.5845866, 0.6061088, 0.6268924, 0.6469125, 0.6661441, 
+    0.6845641, 0.7021503, 0.718881, 0.7347358, 0.7496954, 0.7637418, 
+    0.7768574, 0.7890266, 0.8002346, 0.8104676, 0.8197132, 0.82796, 
+    0.8351981, 0.8414187, 0.8466141, 0.8507781, 0.8539056, 0.8559926, 
+    0.8570368, 0.8570368, 0.8559926, 0.8539056, 0.8507781, 0.8466142, 
+    0.8414187, 0.8351982, 0.8279601, 0.8197132, 0.8104677, 0.8002347, 
+    0.7890267, 0.7768575, 0.7637416, 0.7496954, 0.7347357, 0.718881, 
+    0.7021505, 0.6845642, 0.6661442, 0.6469123, 0.6268925, 0.606109, 
+    0.5845867, 0.5623525, 0.5394328, 0.5158562, 0.4916511, 0.4668468, 0.441474,
+  0.4065956, 0.3807485, 0.3544375, 0.3276947, 0.3005526, 0.2730443, 
+    0.2452036, 0.2170639, 0.1886598, 0.1600258, 0.1311969, 0.1022083, 
+    0.07309502, 0.04389265, 0.01463681, -0.01463686, -0.0438927, -0.07309507, 
+    -0.1022082, -0.131197, -0.1600259, -0.1886599, -0.217064, -0.2452035, 
+    -0.2730444, -0.3005526, -0.3276947, -0.3544376, -0.3807484, -0.4065957, 
+    -0.4319472, -0.4567727, -0.4810417, -0.5047244, -0.5277926, -0.5502173, 
+    -0.5719719, -0.5930296, -0.6133648, -0.6329527, -0.6517693, -0.6697922, 
+    -0.6869987, -0.7033683, -0.718881, -0.7335177, -0.747261, -0.7600936, 
+    -0.7720003, -0.7829664, -0.7929786, -0.8020246, -0.8100935, -0.8171755, 
+    -0.8232618, -0.8283451, -0.8324192, -0.8354792, -0.8375211, -0.8385428, 
+    -0.8385428, -0.8375211, -0.8354792, -0.8324192, -0.8283451, -0.8232618, 
+    -0.8171755, -0.8100935, -0.8020246, -0.7929786, -0.7829664, -0.7720003, 
+    -0.7600937, -0.7472609, -0.7335178, -0.718881, -0.7033684, -0.6869987, 
+    -0.6697921, -0.6517694, -0.6329527, -0.6133649, -0.5930297, -0.571972, 
+    -0.5502174, -0.5277925, -0.5047245, -0.4810417, -0.4567728, -0.4319473, 
+    -0.4065955, -0.3807484, -0.3544374, -0.3276948, -0.3005527, -0.2730444, 
+    -0.2452035, -0.2170639, -0.1886598, -0.160026, -0.131197, -0.1022082, 
+    -0.07309493, -0.04389258, -0.01463674, 0.01463674, 0.04389258, 
+    0.07309493, 0.1022082, 0.131197, 0.160026, 0.1886598, 0.2170639, 
+    0.2452035, 0.2730444, 0.3005527, 0.3276946, 0.3544376, 0.3807484, 
+    0.4065954, 0.4319473, 0.4567726, 0.4810417, 0.5047245, 0.5277926, 
+    0.5502174, 0.5719718, 0.5930297, 0.6133648, 0.6329527, 0.6517694, 
+    0.6697919, 0.6869987, 0.7033682, 0.718881, 0.7335178, 0.747261, 
+    0.7600937, 0.7720003, 0.7829664, 0.7929786, 0.8020247, 0.8100935, 
+    0.8171754, 0.8232618, 0.8283451, 0.8324192, 0.8354792, 0.8375211, 
+    0.8385428, 0.8385428, 0.8375211, 0.8354792, 0.8324192, 0.8283451, 
+    0.8232619, 0.8171755, 0.8100936, 0.8020246, 0.7929786, 0.7829665, 
+    0.7720003, 0.7600937, 0.7472609, 0.7335178, 0.7188809, 0.7033683, 
+    0.6869988, 0.6697921, 0.6517695, 0.6329526, 0.6133648, 0.5930298, 
+    0.5719719, 0.5502175, 0.5277924, 0.5047246, 0.4810418, 0.4567727, 
+    0.4319474,
+  0.3971329, 0.3718873, 0.3461886, 0.3200682, 0.2935578, 0.2666897, 
+    0.2394969, 0.2120122, 0.1842691, 0.1563015, 0.1281435, 0.09982961, 
+    0.07139386, 0.04287113, 0.01429616, -0.01429622, -0.04287118, 
+    -0.07139391, -0.09982947, -0.1281436, -0.1563016, -0.1842692, -0.2120122, 
+    -0.2394968, -0.2666898, -0.2935578, -0.3200682, -0.3461887, -0.3718871, 
+    -0.3971329, -0.4218945, -0.4461422, -0.4698463, -0.4929779, -0.5155092, 
+    -0.537412, -0.5586603, -0.579228, -0.5990899, -0.6182219, -0.6366006, 
+    -0.654204, -0.67101, -0.6869987, -0.7021503, -0.7164465, -0.7298699, 
+    -0.7424039, -0.7540334, -0.7647443, -0.7745235, -0.783359, -0.7912401, 
+    -0.7981572, -0.8041019, -0.809067, -0.8130462, -0.816035, -0.8180294, 
+    -0.8190273, -0.8190273, -0.8180294, -0.816035, -0.8130462, -0.809067, 
+    -0.8041019, -0.7981572, -0.7912401, -0.783359, -0.7745235, -0.7647443, 
+    -0.7540334, -0.7424039, -0.7298698, -0.7164465, -0.7021503, -0.6869988, 
+    -0.6710101, -0.654204, -0.6366007, -0.6182219, -0.5990899, -0.579228, 
+    -0.5586604, -0.5374121, -0.5155091, -0.492978, -0.4698464, -0.4461423, 
+    -0.4218946, -0.3971328, -0.3718872, -0.3461885, -0.3200683, -0.2935579, 
+    -0.2666898, -0.2394969, -0.2120121, -0.1842691, -0.1563017, -0.1281437, 
+    -0.09982954, -0.07139379, -0.04287106, -0.01429609, 0.01429609, 
+    0.04287106, 0.07139379, 0.09982954, 0.1281437, 0.1563017, 0.1842691, 
+    0.2120121, 0.2394969, 0.2666898, 0.2935579, 0.3200681, 0.3461887, 
+    0.3718872, 0.3971326, 0.4218946, 0.446142, 0.4698464, 0.492978, 
+    0.5155092, 0.5374121, 0.5586602, 0.579228, 0.5990899, 0.618222, 
+    0.6366007, 0.6542038, 0.6710101, 0.6869987, 0.7021504, 0.7164465, 
+    0.7298699, 0.7424039, 0.7540334, 0.7647443, 0.7745235, 0.7833591, 
+    0.7912401, 0.7981572, 0.8041019, 0.8090669, 0.8130462, 0.816035, 
+    0.8180294, 0.8190273, 0.8190273, 0.8180294, 0.816035, 0.8130462, 
+    0.809067, 0.8041019, 0.7981572, 0.7912402, 0.783359, 0.7745235, 
+    0.7647444, 0.7540334, 0.742404, 0.7298698, 0.7164465, 0.7021503, 
+    0.6869987, 0.6710102, 0.6542039, 0.6366008, 0.6182218, 0.5990899, 
+    0.5792281, 0.5586603, 0.5374122, 0.515509, 0.4929781, 0.4698465, 
+    0.4461422, 0.4218946,
+  0.3871863, 0.362573, 0.337518, 0.3120517, 0.2862053, 0.2600102, 0.2334985, 
+    0.2067021, 0.1796539, 0.1523868, 0.124934, 0.09732927, 0.06960573, 
+    0.04179738, 0.0139381, -0.01393815, -0.04179743, -0.06960578, 
+    -0.09732914, -0.1249341, -0.1523869, -0.179654, -0.2067022, -0.2334983, 
+    -0.2600103, -0.2862054, -0.3120518, -0.337518, -0.3625728, -0.3871863, 
+    -0.4113277, -0.4349681, -0.4580785, -0.4806308, -0.5025977, -0.523952, 
+    -0.5446681, -0.5647206, -0.584085, -0.6027379, -0.6206563, -0.6378188, 
+    -0.6542039, -0.6697921, -0.6845643, -0.6985023, -0.7115895, -0.7238096, 
+    -0.7351479, -0.7455905, -0.7551247, -0.7637389, -0.7714227, -0.7781666, 
+    -0.7839624, -0.788803, -0.7926826, -0.7955965, -0.797541, -0.7985139, 
+    -0.7985139, -0.797541, -0.7955965, -0.7926826, -0.788803, -0.7839624, 
+    -0.7781666, -0.7714227, -0.7637389, -0.7551247, -0.7455905, -0.7351479, 
+    -0.7238097, -0.7115895, -0.6985024, -0.6845642, -0.6697922, -0.654204, 
+    -0.6378188, -0.6206564, -0.6027378, -0.5840851, -0.5647206, -0.5446681, 
+    -0.5239521, -0.5025976, -0.4806308, -0.4580786, -0.4349681, -0.4113277, 
+    -0.3871862, -0.3625729, -0.3375179, -0.3120518, -0.2862054, -0.2600103, 
+    -0.2334984, -0.206702, -0.1796538, -0.1523869, -0.1249342, -0.09732921, 
+    -0.06960566, -0.04179731, -0.01393803, 0.01393803, 0.04179731, 
+    0.06960566, 0.09732921, 0.1249342, 0.1523869, 0.1796538, 0.206702, 
+    0.2334984, 0.2600103, 0.2862054, 0.3120517, 0.3375181, 0.3625729, 
+    0.387186, 0.4113277, 0.434968, 0.4580786, 0.4806308, 0.5025977, 
+    0.5239521, 0.544668, 0.5647206, 0.584085, 0.602738, 0.6206564, 0.6378186, 
+    0.654204, 0.6697921, 0.6845643, 0.6985024, 0.7115896, 0.7238097, 
+    0.7351478, 0.7455905, 0.7551247, 0.763739, 0.7714227, 0.7781665, 
+    0.7839624, 0.788803, 0.7926826, 0.7955965, 0.797541, 0.7985139, 
+    0.7985139, 0.797541, 0.7955965, 0.7926826, 0.788803, 0.7839624, 
+    0.7781666, 0.7714227, 0.7637389, 0.7551247, 0.7455906, 0.7351479, 
+    0.7238097, 0.7115895, 0.6985024, 0.6845642, 0.6697921, 0.6542041, 
+    0.6378187, 0.6206564, 0.6027378, 0.584085, 0.5647207, 0.5446681, 
+    0.5239521, 0.5025975, 0.4806309, 0.4580787, 0.4349681, 0.4113278,
+  0.3767679, 0.3528169, 0.3284361, 0.3036551, 0.2785041, 0.2530139, 
+    0.2272155, 0.2011402, 0.1748198, 0.1482864, 0.1215723, 0.09471035, 
+    0.06773278, 0.0406727, 0.01356306, -0.01356311, -0.04067275, -0.06773283, 
+    -0.09471022, -0.1215724, -0.1482864, -0.1748198, -0.2011402, -0.2272154, 
+    -0.2530139, -0.2785042, -0.3036551, -0.3284361, -0.3528168, -0.3767679, 
+    -0.4002597, -0.423264, -0.4457526, -0.467698, -0.4890739, -0.5098535, 
+    -0.5300122, -0.5495251, -0.5683686, -0.5865195, -0.6039557, -0.6206564, 
+    -0.6366006, -0.6517694, -0.6661441, -0.6797071, -0.6924421, -0.7043334, 
+    -0.7153666, -0.7255282, -0.7348059, -0.7431883, -0.7506653, -0.7572277, 
+    -0.7628676, -0.767578, -0.7713532, -0.7741886, -0.7760808, -0.7770275, 
+    -0.7770275, -0.7760808, -0.7741886, -0.7713532, -0.767578, -0.7628676, 
+    -0.7572277, -0.7506653, -0.7431883, -0.7348059, -0.7255282, -0.7153666, 
+    -0.7043334, -0.6924421, -0.6797071, -0.666144, -0.6517695, -0.6366007, 
+    -0.6206564, -0.6039558, -0.5865194, -0.5683686, -0.5495252, -0.5300122, 
+    -0.5098536, -0.4890738, -0.4676981, -0.4457527, -0.4232641, -0.4002598, 
+    -0.3767678, -0.3528168, -0.328436, -0.3036552, -0.2785042, -0.253014, 
+    -0.2272155, -0.2011401, -0.1748197, -0.1482865, -0.1215724, -0.09471028, 
+    -0.06773271, -0.04067263, -0.01356299, 0.01356299, 0.04067263, 
+    0.06773271, 0.09471028, 0.1215724, 0.1482865, 0.1748197, 0.2011401, 
+    0.2272155, 0.253014, 0.2785042, 0.303655, 0.3284362, 0.3528168, 
+    0.3767676, 0.4002598, 0.4232639, 0.4457527, 0.4676981, 0.4890739, 
+    0.5098536, 0.5300121, 0.5495252, 0.5683685, 0.5865195, 0.6039558, 
+    0.6206562, 0.6366007, 0.6517693, 0.6661441, 0.6797071, 0.6924422, 
+    0.7043334, 0.7153665, 0.7255282, 0.7348059, 0.7431884, 0.7506653, 
+    0.7572277, 0.7628676, 0.7675779, 0.7713532, 0.7741886, 0.7760808, 
+    0.7770275, 0.7770275, 0.7760808, 0.7741886, 0.7713532, 0.767578, 
+    0.7628676, 0.7572277, 0.7506654, 0.7431883, 0.7348059, 0.7255283, 
+    0.7153666, 0.7043335, 0.6924421, 0.6797072, 0.666144, 0.6517694, 
+    0.6366008, 0.6206563, 0.6039559, 0.5865194, 0.5683686, 0.5495253, 
+    0.5300122, 0.5098537, 0.4890737, 0.4676982, 0.4457527, 0.423264, 0.4002599,
+  0.3658905, 0.342631, 0.3189541, 0.2948885, 0.2704637, 0.2457093, 0.2206558, 
+    0.1953332, 0.1697727, 0.1440053, 0.1180625, 0.09197605, 0.06577732, 
+    0.03949847, 0.01317149, -0.01317154, -0.03949852, -0.06577738, 
+    -0.09197592, -0.1180626, -0.1440054, -0.1697728, -0.1953333, -0.2206556, 
+    -0.2457094, -0.2704637, -0.2948886, -0.3189541, -0.3426309, -0.3658906, 
+    -0.3887041, -0.4110443, -0.4328837, -0.4541955, -0.4749542, -0.495134, 
+    -0.5147107, -0.5336603, -0.5519596, -0.5695866, -0.5865194, -0.602738, 
+    -0.6182219, -0.6329527, -0.6469124, -0.6600838, -0.6724512, -0.6839992, 
+    -0.6947139, -0.7045822, -0.713592, -0.7217324, -0.7289935, -0.7353665, 
+    -0.7408435, -0.7454179, -0.7490841, -0.7518377, -0.7536753, -0.7545947, 
+    -0.7545947, -0.7536753, -0.7518377, -0.7490841, -0.7454179, -0.7408435, 
+    -0.7353665, -0.7289935, -0.7217324, -0.7135919, -0.7045822, -0.6947139, 
+    -0.6839992, -0.6724512, -0.6600838, -0.6469123, -0.6329527, -0.6182219, 
+    -0.6027379, -0.5865195, -0.5695865, -0.5519597, -0.5336603, -0.5147107, 
+    -0.4951341, -0.4749541, -0.4541956, -0.4328837, -0.4110444, -0.3887042, 
+    -0.3658905, -0.342631, -0.318954, -0.2948886, -0.2704638, -0.2457094, 
+    -0.2206557, -0.1953332, -0.1697727, -0.1440055, -0.1180626, -0.09197598, 
+    -0.06577726, -0.03949841, -0.01317142, 0.01317142, 0.03949841, 
+    0.06577726, 0.09197598, 0.1180626, 0.1440055, 0.1697727, 0.1953332, 
+    0.2206557, 0.2457094, 0.2704638, 0.2948884, 0.3189542, 0.342631, 
+    0.3658903, 0.3887042, 0.4110442, 0.4328837, 0.4541956, 0.4749543, 
+    0.4951341, 0.5147106, 0.5336603, 0.5519596, 0.5695866, 0.5865195, 
+    0.6027378, 0.6182219, 0.6329527, 0.6469125, 0.6600838, 0.6724513, 
+    0.6839992, 0.6947138, 0.7045822, 0.7135919, 0.7217324, 0.7289935, 
+    0.7353664, 0.7408435, 0.7454178, 0.7490841, 0.7518377, 0.7536753, 
+    0.7545947, 0.7545947, 0.7536753, 0.7518377, 0.7490841, 0.7454179, 
+    0.7408435, 0.7353665, 0.7289935, 0.7217324, 0.713592, 0.7045822, 
+    0.6947139, 0.6839992, 0.6724511, 0.6600839, 0.6469123, 0.6329527, 
+    0.618222, 0.6027378, 0.5865196, 0.5695865, 0.5519596, 0.5336604, 
+    0.5147107, 0.4951341, 0.474954, 0.4541956, 0.4328838, 0.4110443, 0.3887043,
+  0.3545674, 0.3320277, 0.3090834, 0.2857626, 0.2620937, 0.2381054, 
+    0.2138272, 0.1892883, 0.1645188, 0.1395488, 0.1144089, 0.08912967, 
+    0.06374173, 0.03827612, 0.01276387, -0.01276392, -0.03827616, 
+    -0.06374177, -0.08912955, -0.1144089, -0.1395489, -0.1645188, -0.1892883, 
+    -0.2138271, -0.2381054, -0.2620937, -0.2857627, -0.3090835, -0.3320275, 
+    -0.3545674, -0.376675, -0.3983238, -0.4194873, -0.4401395, -0.4602559, 
+    -0.4798112, -0.498782, -0.5171452, -0.5348783, -0.5519596, -0.5683685, 
+    -0.5840851, -0.5990899, -0.6133648, -0.6268925, -0.6396563, -0.651641, 
+    -0.6628315, -0.6732146, -0.6827775, -0.6915085, -0.699397, -0.7064334, 
+    -0.7126092, -0.7179167, -0.7223495, -0.7259023, -0.7285707, -0.7303514, 
+    -0.7312423, -0.7312423, -0.7303514, -0.7285707, -0.7259023, -0.7223495, 
+    -0.7179167, -0.7126092, -0.7064334, -0.699397, -0.6915085, -0.6827775, 
+    -0.6732146, -0.6628316, -0.651641, -0.6396563, -0.6268924, -0.6133649, 
+    -0.5990899, -0.584085, -0.5683686, -0.5519596, -0.5348783, -0.5171452, 
+    -0.498782, -0.4798112, -0.4602558, -0.4401396, -0.4194873, -0.3983238, 
+    -0.376675, -0.3545673, -0.3320276, -0.3090834, -0.2857627, -0.2620938, 
+    -0.2381055, -0.2138271, -0.1892882, -0.1645187, -0.1395489, -0.114409, 
+    -0.08912961, -0.06374166, -0.03827605, -0.01276381, 0.01276381, 
+    0.03827605, 0.06374166, 0.08912961, 0.114409, 0.1395489, 0.1645187, 
+    0.1892882, 0.2138271, 0.2381055, 0.2620938, 0.2857626, 0.3090835, 
+    0.3320276, 0.3545671, 0.376675, 0.3983237, 0.4194873, 0.4401396, 
+    0.4602559, 0.4798112, 0.4987819, 0.5171452, 0.5348782, 0.5519597, 
+    0.5683686, 0.5840849, 0.5990899, 0.6133648, 0.6268925, 0.6396563, 
+    0.651641, 0.6628316, 0.6732146, 0.6827775, 0.6915085, 0.699397, 
+    0.7064334, 0.7126091, 0.7179167, 0.7223495, 0.7259023, 0.7285707, 
+    0.7303514, 0.7312423, 0.7312423, 0.7303514, 0.7285707, 0.7259023, 
+    0.7223495, 0.7179167, 0.7126092, 0.7064335, 0.699397, 0.6915085, 
+    0.6827776, 0.6732146, 0.6628316, 0.6516409, 0.6396564, 0.6268924, 
+    0.6133648, 0.59909, 0.584085, 0.5683686, 0.5519596, 0.5348783, 0.5171453, 
+    0.498782, 0.4798113, 0.4602557, 0.4401397, 0.4194874, 0.3983238, 0.3766751,
+  0.3428122, 0.3210198, 0.2988362, 0.2762886, 0.2534043, 0.2302114, 
+    0.2067381, 0.1830127, 0.1590644, 0.1349223, 0.1106158, 0.08617471, 
+    0.06162846, 0.03700713, 0.01234071, -0.01234075, -0.03700718, 
+    -0.06162851, -0.08617459, -0.1106159, -0.1349223, -0.1590645, -0.1830128, 
+    -0.2067379, -0.2302114, -0.2534044, -0.2762887, -0.2988363, -0.3210196, 
+    -0.3428123, -0.3641869, -0.3851179, -0.4055798, -0.4255474, -0.4449968, 
+    -0.4639037, -0.4822456, -0.5, -0.5171452, -0.5336603, -0.5495251, 
+    -0.5647206, -0.5792279, -0.5930296, -0.6061088, -0.6184494, -0.6300368, 
+    -0.6408563, -0.6508952, -0.6601411, -0.6685826, -0.6762096, -0.6830127, 
+    -0.6889837, -0.6941152, -0.6984012, -0.7018361, -0.704416, -0.7061377, 
+    -0.7069991, -0.7069991, -0.7061377, -0.704416, -0.7018361, -0.6984012, 
+    -0.6941152, -0.6889837, -0.6830127, -0.6762096, -0.6685826, -0.6601411, 
+    -0.6508952, -0.6408564, -0.6300368, -0.6184495, -0.6061088, -0.5930297, 
+    -0.579228, -0.5647206, -0.5495251, -0.5336602, -0.5171452, -0.5, 
+    -0.4822457, -0.4639038, -0.4449967, -0.4255475, -0.4055798, -0.385118, 
+    -0.3641869, -0.3428122, -0.3210197, -0.2988362, -0.2762887, -0.2534044, 
+    -0.2302115, -0.206738, -0.1830126, -0.1590644, -0.1349224, -0.1106159, 
+    -0.08617465, -0.0616284, -0.03700707, -0.01234064, 0.01234064, 
+    0.03700707, 0.0616284, 0.08617465, 0.1106159, 0.1349224, 0.1590644, 
+    0.1830126, 0.206738, 0.2302115, 0.2534044, 0.2762885, 0.2988363, 
+    0.3210197, 0.342812, 0.3641869, 0.3851178, 0.4055798, 0.4255475, 
+    0.4449968, 0.4639038, 0.4822455, 0.5, 0.5171451, 0.5336603, 0.5495251, 
+    0.5647205, 0.579228, 0.5930296, 0.6061088, 0.6184495, 0.6300368, 
+    0.6408564, 0.6508952, 0.6601411, 0.6685826, 0.6762096, 0.6830127, 
+    0.6889836, 0.6941152, 0.6984011, 0.7018361, 0.704416, 0.7061377, 
+    0.7069991, 0.7069991, 0.7061377, 0.704416, 0.7018361, 0.6984012, 
+    0.6941153, 0.6889837, 0.6830127, 0.6762096, 0.6685826, 0.6601411, 
+    0.6508952, 0.6408564, 0.6300367, 0.6184495, 0.6061087, 0.5930296, 
+    0.579228, 0.5647206, 0.5495252, 0.5336602, 0.5171452, 0.5000001, 
+    0.4822456, 0.4639039, 0.4449966, 0.4255475, 0.4055799, 0.3851179, 0.364187,
+  0.3306394, 0.3096208, 0.288225, 0.266478, 0.2444063, 0.2220369, 0.1993971, 
+    0.1765142, 0.1534162, 0.1301314, 0.106688, 0.08311477, 0.05944012, 
+    0.03569306, 0.0119025, -0.01190255, -0.0356931, -0.05944017, -0.08311465, 
+    -0.106688, -0.1301314, -0.1534163, -0.1765142, -0.199397, -0.2220369, 
+    -0.2444063, -0.266478, -0.288225, -0.3096207, -0.3306395, -0.3512551, 
+    -0.3714429, -0.3911782, -0.4104367, -0.4291956, -0.4474311, -0.4651217, 
+    -0.4822457, -0.498782, -0.5147107, -0.5300122, -0.5446682, -0.5586603, 
+    -0.571972, -0.5845867, -0.5964891, -0.6076651, -0.6181004, -0.6277828, 
+    -0.6367003, -0.6448421, -0.6521983, -0.6587598, -0.6645188, -0.6694681, 
+    -0.6736019, -0.6769149, -0.6794032, -0.6810637, -0.6818945, -0.6818945, 
+    -0.6810637, -0.6794032, -0.6769149, -0.6736019, -0.6694681, -0.6645188, 
+    -0.6587598, -0.6521983, -0.6448421, -0.6367003, -0.6277828, -0.6181005, 
+    -0.607665, -0.5964892, -0.5845867, -0.571972, -0.5586604, -0.5446681, 
+    -0.5300122, -0.5147107, -0.4987821, -0.4822457, -0.4651218, -0.4474312, 
+    -0.4291955, -0.4104368, -0.3911783, -0.371443, -0.3512552, -0.3306394, 
+    -0.3096208, -0.2882249, -0.2664781, -0.2444064, -0.222037, -0.199397, 
+    -0.1765141, -0.1534162, -0.1301315, -0.1066881, -0.08311471, -0.05944006, 
+    -0.035693, -0.01190244, 0.01190244, 0.035693, 0.05944006, 0.08311471, 
+    0.1066881, 0.1301315, 0.1534162, 0.1765141, 0.199397, 0.222037, 
+    0.2444064, 0.2664779, 0.2882251, 0.3096208, 0.3306392, 0.3512552, 
+    0.3714428, 0.3911783, 0.4104368, 0.4291956, 0.4474312, 0.4651217, 
+    0.4822457, 0.498782, 0.5147108, 0.5300122, 0.544668, 0.5586604, 
+    0.5719719, 0.5845867, 0.5964892, 0.6076651, 0.6181005, 0.6277828, 
+    0.6367003, 0.6448421, 0.6521983, 0.6587598, 0.6645188, 0.6694681, 
+    0.6736018, 0.6769149, 0.6794032, 0.6810637, 0.6818945, 0.6818945, 
+    0.6810637, 0.6794032, 0.6769149, 0.6736019, 0.6694682, 0.6645188, 
+    0.6587599, 0.6521983, 0.6448421, 0.6367004, 0.6277828, 0.6181005, 
+    0.6076649, 0.5964893, 0.5845866, 0.571972, 0.5586604, 0.5446681, 
+    0.5300123, 0.5147107, 0.498782, 0.4822458, 0.4651217, 0.4474313, 
+    0.4291954, 0.4104369, 0.3911783, 0.3714429, 0.3512552,
+  0.3180638, 0.2978446, 0.2772625, 0.2563426, 0.2351105, 0.2135919, 
+    0.1918131, 0.1698006, 0.1475812, 0.1251819, 0.1026302, 0.07995355, 
+    0.05717936, 0.03433549, 0.0114498, -0.01144984, -0.03433554, -0.0571794, 
+    -0.07995344, -0.1026302, -0.125182, -0.1475812, -0.1698006, -0.191813, 
+    -0.2135919, -0.2351105, -0.2563427, -0.2772626, -0.2978445, -0.3180638, 
+    -0.3378953, -0.3573154, -0.3763, -0.3948261, -0.4128714, -0.4304134, 
+    -0.4474311, -0.4639038, -0.4798112, -0.4951341, -0.5098535, -0.5239521, 
+    -0.537412, -0.5502174, -0.5623524, -0.5738021, -0.5845529, -0.5945914, 
+    -0.6039055, -0.6124839, -0.620316, -0.6273924, -0.6337044, -0.6392443, 
+    -0.6440054, -0.6479819, -0.6511689, -0.6535625, -0.6551599, -0.6559591, 
+    -0.6559591, -0.6551599, -0.6535625, -0.6511689, -0.6479819, -0.6440054, 
+    -0.6392443, -0.6337044, -0.6273924, -0.620316, -0.6124839, -0.6039055, 
+    -0.5945914, -0.5845529, -0.5738021, -0.5623523, -0.5502174, -0.5374121, 
+    -0.5239521, -0.5098536, -0.495134, -0.4798112, -0.4639038, -0.4474312, 
+    -0.4304135, -0.4128713, -0.3948261, -0.3763, -0.3573154, -0.3378954, 
+    -0.3180637, -0.2978445, -0.2772625, -0.2563427, -0.2351106, -0.2135919, 
+    -0.1918131, -0.1698005, -0.1475811, -0.125182, -0.1026303, -0.0799535, 
+    -0.0571793, -0.03433544, -0.01144974, 0.01144974, 0.03433544, 0.0571793, 
+    0.0799535, 0.1026303, 0.125182, 0.1475811, 0.1698005, 0.1918131, 
+    0.2135919, 0.2351106, 0.2563426, 0.2772626, 0.2978445, 0.3180636, 
+    0.3378954, 0.3573152, 0.3763, 0.3948261, 0.4128715, 0.4304135, 0.4474311, 
+    0.4639038, 0.4798112, 0.4951341, 0.5098536, 0.5239519, 0.5374121, 
+    0.5502173, 0.5623524, 0.5738021, 0.5845529, 0.5945914, 0.6039055, 
+    0.6124839, 0.620316, 0.6273924, 0.6337044, 0.6392443, 0.6440054, 
+    0.6479818, 0.6511689, 0.6535625, 0.6551599, 0.6559591, 0.6559591, 
+    0.6551599, 0.6535625, 0.6511689, 0.6479819, 0.6440054, 0.6392443, 
+    0.6337044, 0.6273924, 0.620316, 0.6124839, 0.6039055, 0.5945914, 
+    0.5845528, 0.5738022, 0.5623522, 0.5502174, 0.5374122, 0.523952, 
+    0.5098537, 0.495134, 0.4798112, 0.4639039, 0.4474311, 0.4304135, 
+    0.4128712, 0.3948262, 0.3763001, 0.3573154, 0.3378955,
+  0.3051006, 0.2857055, 0.2659623, 0.2458951, 0.2255282, 0.2048866, 
+    0.1839955, 0.1628801, 0.1415663, 0.12008, 0.09844735, 0.07669494, 
+    0.05484894, 0.0329361, 0.01098315, -0.01098319, -0.03293614, -0.05484898, 
+    -0.07669483, -0.0984474, -0.12008, -0.1415663, -0.1628802, -0.1839954, 
+    -0.2048867, -0.2255283, -0.2458951, -0.2659624, -0.2857054, -0.3051007, 
+    -0.3241239, -0.3427525, -0.3609634, -0.3787344, -0.3960443, -0.4128713, 
+    -0.4291955, -0.4449967, -0.4602558, -0.4749542, -0.4890738, -0.5025977, 
+    -0.5155091, -0.5277925, -0.5394329, -0.550416, -0.5607287, -0.570358, 
+    -0.5792925, -0.5875213, -0.5950342, -0.6018221, -0.6078768, -0.613191, 
+    -0.617758, -0.6215725, -0.6246296, -0.6269257, -0.628458, -0.6292246, 
+    -0.6292246, -0.628458, -0.6269257, -0.6246296, -0.6215725, -0.617758, 
+    -0.613191, -0.6078768, -0.6018221, -0.5950342, -0.5875213, -0.5792925, 
+    -0.570358, -0.5607286, -0.5504161, -0.5394329, -0.5277926, -0.5155091, 
+    -0.5025977, -0.4890738, -0.4749541, -0.4602559, -0.4449968, -0.4291955, 
+    -0.4128714, -0.3960442, -0.3787345, -0.3609634, -0.3427525, -0.324124, 
+    -0.3051006, -0.2857055, -0.2659623, -0.2458951, -0.2255283, -0.2048867, 
+    -0.1839955, -0.1628801, -0.1415662, -0.1200801, -0.09844744, -0.07669488, 
+    -0.05484888, -0.03293605, -0.01098309, 0.01098309, 0.03293605, 
+    0.05484888, 0.07669488, 0.09844744, 0.1200801, 0.1415662, 0.1628801, 
+    0.1839955, 0.2048867, 0.2255283, 0.245895, 0.2659624, 0.2857055, 
+    0.3051005, 0.324124, 0.3427524, 0.3609634, 0.3787345, 0.3960443, 
+    0.4128714, 0.4291954, 0.4449968, 0.4602558, 0.4749542, 0.4890738, 
+    0.5025976, 0.5155091, 0.5277925, 0.5394329, 0.5504161, 0.5607287, 
+    0.570358, 0.5792925, 0.5875213, 0.5950342, 0.6018221, 0.6078768, 
+    0.6131909, 0.617758, 0.6215724, 0.6246296, 0.6269257, 0.628458, 
+    0.6292246, 0.6292246, 0.628458, 0.6269257, 0.6246296, 0.6215725, 
+    0.6177581, 0.613191, 0.6078769, 0.6018221, 0.5950342, 0.5875213, 
+    0.5792925, 0.5703581, 0.5607286, 0.5504161, 0.5394328, 0.5277925, 
+    0.5155092, 0.5025976, 0.4890739, 0.4749541, 0.4602558, 0.4449969, 
+    0.4291955, 0.4128714, 0.3960441, 0.3787346, 0.3609635, 0.3427525, 
+    0.3241241,
+  0.2917658, 0.2732183, 0.254338, 0.2351478, 0.2156712, 0.1959317, 0.1759537, 
+    0.1557612, 0.1353789, 0.1148317, 0.09414456, 0.07334287, 0.05245168, 
+    0.03149658, 0.01050311, -0.01050315, -0.03149662, -0.05245172, 
+    -0.07334277, -0.09414461, -0.1148317, -0.135379, -0.1557612, -0.1759536, 
+    -0.1959318, -0.2156712, -0.2351479, -0.2543381, -0.2732182, -0.2917658, 
+    -0.3099576, -0.327772, -0.3451869, -0.3621812, -0.3787346, -0.3948261, 
+    -0.4104368, -0.4255475, -0.4401397, -0.4541956, -0.4676981, -0.4806309, 
+    -0.492978, -0.5047246, -0.5158562, -0.5263593, -0.5362211, -0.5454296, 
+    -0.5539737, -0.5618427, -0.5690273, -0.5755185, -0.5813087, -0.5863906, 
+    -0.590758, -0.5944057, -0.5973292, -0.599525, -0.6009902, -0.6017234, 
+    -0.6017234, -0.6009902, -0.599525, -0.5973292, -0.5944057, -0.590758, 
+    -0.5863906, -0.5813087, -0.5755185, -0.5690273, -0.5618427, -0.5539737, 
+    -0.5454297, -0.5362211, -0.5263593, -0.5158561, -0.5047246, -0.492978, 
+    -0.4806309, -0.4676981, -0.4541956, -0.4401397, -0.4255475, -0.4104369, 
+    -0.3948262, -0.3787345, -0.3621813, -0.345187, -0.327772, -0.3099577, 
+    -0.2917657, -0.2732183, -0.254338, -0.2351479, -0.2156713, -0.1959318, 
+    -0.1759537, -0.1557612, -0.1353789, -0.1148318, -0.09414465, -0.07334282, 
+    -0.05245163, -0.03149653, -0.01050306, 0.01050306, 0.03149653, 
+    0.05245163, 0.07334282, 0.09414465, 0.1148318, 0.1353789, 0.1557612, 
+    0.1759537, 0.1959318, 0.2156713, 0.2351478, 0.2543381, 0.2732183, 
+    0.2917656, 0.3099577, 0.3277719, 0.345187, 0.3621813, 0.3787346, 
+    0.3948262, 0.4104368, 0.4255475, 0.4401396, 0.4541956, 0.4676981, 
+    0.4806308, 0.492978, 0.5047245, 0.5158562, 0.5263593, 0.5362212, 
+    0.5454297, 0.5539736, 0.5618427, 0.5690273, 0.5755186, 0.5813087, 
+    0.5863906, 0.590758, 0.5944057, 0.5973292, 0.599525, 0.6009902, 
+    0.6017234, 0.6017234, 0.6009902, 0.599525, 0.5973292, 0.5944057, 
+    0.590758, 0.5863906, 0.5813087, 0.5755185, 0.5690273, 0.5618428, 
+    0.5539737, 0.5454297, 0.5362211, 0.5263593, 0.5158561, 0.5047246, 
+    0.4929781, 0.4806308, 0.4676982, 0.4541955, 0.4401397, 0.4255476, 
+    0.4104368, 0.3948263, 0.3787344, 0.3621814, 0.345187, 0.327772, 0.3099578,
+  0.2780754, 0.2603983, 0.2424039, 0.2241141, 0.2055514, 0.1867382, 
+    0.1676976, 0.1484525, 0.1290266, 0.1094435, 0.08972707, 0.06990145, 
+    0.04999052, 0.03001869, 0.01001028, -0.01001032, -0.03001872, 
+    -0.04999056, -0.06990135, -0.08972711, -0.1094436, -0.1290267, 
+    -0.1484526, -0.1676975, -0.1867382, -0.2055514, -0.2241142, -0.2424039, 
+    -0.2603982, -0.2780755, -0.2954137, -0.3123921, -0.32899, -0.3451868, 
+    -0.3609634, -0.3763, -0.3911782, -0.4055798, -0.4194873, -0.4328837, 
+    -0.4457526, -0.4580786, -0.4698463, -0.4810417, -0.491651, -0.5016612, 
+    -0.5110604, -0.5198368, -0.5279799, -0.5354798, -0.5423272, -0.5485139, 
+    -0.5540323, -0.5588757, -0.5630382, -0.5665148, -0.5693011, -0.5713938, 
+    -0.5727904, -0.5734891, -0.5734891, -0.5727904, -0.5713938, -0.5693011, 
+    -0.5665148, -0.5630382, -0.5588757, -0.5540323, -0.5485139, -0.5423272, 
+    -0.5354798, -0.5279799, -0.5198368, -0.5110604, -0.5016612, -0.4916509, 
+    -0.4810417, -0.4698463, -0.4580785, -0.4457526, -0.4328836, -0.4194873, 
+    -0.4055798, -0.3911782, -0.3763, -0.3609633, -0.3451869, -0.32899, 
+    -0.3123922, -0.2954137, -0.2780754, -0.2603982, -0.2424038, -0.2241142, 
+    -0.2055514, -0.1867382, -0.1676975, -0.1484525, -0.1290266, -0.1094436, 
+    -0.08972716, -0.0699014, -0.04999047, -0.03001864, -0.01001023, 
+    0.01001023, 0.03001864, 0.04999047, 0.0699014, 0.08972716, 0.1094436, 
+    0.1290266, 0.1484525, 0.1676975, 0.1867382, 0.2055514, 0.2241141, 
+    0.242404, 0.2603982, 0.2780752, 0.2954137, 0.312392, 0.32899, 0.3451869, 
+    0.3609635, 0.3763, 0.3911781, 0.4055798, 0.4194872, 0.4328837, 0.4457526, 
+    0.4580784, 0.4698463, 0.4810416, 0.491651, 0.5016612, 0.5110604, 
+    0.5198368, 0.5279799, 0.5354798, 0.5423272, 0.5485139, 0.5540323, 
+    0.5588757, 0.5630382, 0.5665147, 0.5693011, 0.5713938, 0.5727904, 
+    0.5734891, 0.5734891, 0.5727904, 0.5713938, 0.5693011, 0.5665148, 
+    0.5630383, 0.5588757, 0.5540323, 0.5485139, 0.5423272, 0.5354798, 
+    0.5279799, 0.5198368, 0.5110604, 0.5016613, 0.4916509, 0.4810417, 
+    0.4698464, 0.4580785, 0.4457527, 0.4328836, 0.4194873, 0.4055799, 
+    0.3911782, 0.3763001, 0.3609633, 0.345187, 0.32899, 0.3123921, 0.2954138,
+  0.2640463, 0.247261, 0.2301744, 0.2128074, 0.1951811, 0.1773171, 0.1592371, 
+    0.140963, 0.1225171, 0.103922, 0.08520027, 0.06637486, 0.04746846, 
+    0.02850422, 0.009505256, -0.009505291, -0.02850426, -0.04746849, 
+    -0.06637477, -0.08520031, -0.103922, -0.1225172, -0.140963, -0.159237, 
+    -0.1773171, -0.1951812, -0.2128074, -0.2301745, -0.2472609, -0.2640463, 
+    -0.2805098, -0.2966317, -0.3123921, -0.3277719, -0.3427525, -0.3573153, 
+    -0.3714429, -0.3851179, -0.3983238, -0.4110443, -0.423264, -0.4349681, 
+    -0.4461422, -0.4567727, -0.4668468, -0.476352, -0.485277, -0.4936106, 
+    -0.5013429, -0.5084644, -0.5149664, -0.5208409, -0.5260809, -0.53068, 
+    -0.5346325, -0.5379336, -0.5405794, -0.5425665, -0.5438926, -0.5445561, 
+    -0.5445561, -0.5438926, -0.5425665, -0.5405794, -0.5379336, -0.5346325, 
+    -0.53068, -0.5260809, -0.5208409, -0.5149663, -0.5084644, -0.5013429, 
+    -0.4936106, -0.4852769, -0.476352, -0.4668468, -0.4567728, -0.4461422, 
+    -0.4349681, -0.423264, -0.4110443, -0.3983238, -0.385118, -0.3714429, 
+    -0.3573154, -0.3427525, -0.3277719, -0.3123922, -0.2966317, -0.2805099, 
+    -0.2640463, -0.2472609, -0.2301744, -0.2128075, -0.1951812, -0.1773171, 
+    -0.159237, -0.1409629, -0.1225171, -0.1039221, -0.08520035, -0.06637482, 
+    -0.04746841, -0.02850417, -0.009505208, 0.009505208, 0.02850417, 
+    0.04746841, 0.06637482, 0.08520035, 0.1039221, 0.1225171, 0.1409629, 
+    0.159237, 0.1773171, 0.1951812, 0.2128074, 0.2301745, 0.2472609, 
+    0.2640461, 0.2805099, 0.2966316, 0.3123922, 0.3277719, 0.3427525, 
+    0.3573154, 0.3714429, 0.385118, 0.3983237, 0.4110444, 0.423264, 0.434968, 
+    0.4461422, 0.4567727, 0.4668468, 0.476352, 0.485277, 0.4936106, 
+    0.5013429, 0.5084644, 0.5149663, 0.5208409, 0.5260809, 0.5306799, 
+    0.5346325, 0.5379336, 0.5405794, 0.5425665, 0.5438926, 0.5445561, 
+    0.5445561, 0.5438926, 0.5425665, 0.5405794, 0.5379336, 0.5346325, 
+    0.53068, 0.526081, 0.5208409, 0.5149664, 0.5084644, 0.5013429, 0.4936107, 
+    0.4852769, 0.4763521, 0.4668467, 0.4567727, 0.4461423, 0.4349681, 
+    0.4232641, 0.4110443, 0.3983238, 0.3851181, 0.3714429, 0.3573154, 
+    0.3427524, 0.327772, 0.3123922, 0.2966317, 0.2805099,
+  0.2496955, 0.2338224, 0.2176645, 0.2012414, 0.1845731, 0.1676799, 
+    0.1505826, 0.1333017, 0.1158584, 0.09827387, 0.08056965, 0.06276741, 
+    0.04488856, 0.02695503, 0.008988648, -0.00898868, -0.02695506, 
+    -0.0448886, -0.06276732, -0.0805697, -0.0982739, -0.1158584, -0.1333017, 
+    -0.1505825, -0.16768, -0.1845731, -0.2012414, -0.2176645, -0.2338223, 
+    -0.2496955, -0.2652642, -0.2805099, -0.2954137, -0.3099576, -0.324124, 
+    -0.3378953, -0.3512551, -0.3641869, -0.376675, -0.3887042, -0.4002597, 
+    -0.4113277, -0.4218945, -0.4319473, -0.4414738, -0.4504624, -0.4589023, 
+    -0.466783, -0.474095, -0.4808295, -0.4869781, -0.4925334, -0.4974886, 
+    -0.5018377, -0.5055754, -0.5086971, -0.5111991, -0.5130782, -0.5143322, 
+    -0.5149596, -0.5149596, -0.5143322, -0.5130782, -0.5111991, -0.5086971, 
+    -0.5055754, -0.5018377, -0.4974886, -0.4925334, -0.4869781, -0.4808295, 
+    -0.474095, -0.466783, -0.4589023, -0.4504624, -0.4414738, -0.4319473, 
+    -0.4218945, -0.4113277, -0.4002597, -0.3887042, -0.376675, -0.3641869, 
+    -0.3512551, -0.3378954, -0.3241239, -0.3099576, -0.2954137, -0.2805099, 
+    -0.2652642, -0.2496954, -0.2338224, -0.2176645, -0.2012414, -0.1845732, 
+    -0.16768, -0.1505826, -0.1333016, -0.1158583, -0.09827396, -0.08056974, 
+    -0.06276736, -0.04488852, -0.02695498, -0.008988603, 0.008988603, 
+    0.02695498, 0.04488852, 0.06276736, 0.08056974, 0.09827396, 0.1158583, 
+    0.1333016, 0.1505826, 0.16768, 0.1845732, 0.2012413, 0.2176646, 
+    0.2338224, 0.2496953, 0.2652642, 0.2805098, 0.2954137, 0.3099576, 
+    0.324124, 0.3378954, 0.351255, 0.3641869, 0.376675, 0.3887042, 0.4002597, 
+    0.4113276, 0.4218945, 0.4319472, 0.4414738, 0.4504624, 0.4589024, 
+    0.466783, 0.474095, 0.4808295, 0.4869781, 0.4925334, 0.4974886, 
+    0.5018377, 0.5055754, 0.5086971, 0.5111991, 0.5130782, 0.5143322, 
+    0.5149596, 0.5149596, 0.5143322, 0.5130782, 0.5111991, 0.5086971, 
+    0.5055754, 0.5018377, 0.4974886, 0.4925334, 0.4869781, 0.4808295, 
+    0.474095, 0.4667831, 0.4589023, 0.4504625, 0.4414737, 0.4319473, 
+    0.4218946, 0.4113277, 0.4002598, 0.3887041, 0.376675, 0.364187, 
+    0.3512551, 0.3378955, 0.3241239, 0.3099577, 0.2954138, 0.2805099, 
+    0.2652643,
+  0.2350404, 0.220099, 0.2048894, 0.1894302, 0.1737402, 0.1578385, 0.1417446, 
+    0.125478, 0.1090584, 0.09250601, 0.07584088, 0.05908348, 0.04225397, 
+    0.02537299, 0.008461088, -0.008461119, -0.02537302, -0.042254, 
+    -0.05908339, -0.07584092, -0.09250604, -0.1090585, -0.125478, -0.1417446, 
+    -0.1578385, -0.1737402, -0.1894302, -0.2048894, -0.2200989, -0.2350404, 
+    -0.2496954, -0.2640462, -0.2780754, -0.2917656, -0.3051006, -0.3180637, 
+    -0.3306393, -0.3428121, -0.3545673, -0.3658904, -0.3767678, -0.3871862, 
+    -0.3971327, -0.4065955, -0.4155629, -0.424024, -0.4319685, -0.4393867, 
+    -0.4462696, -0.4526087, -0.4583965, -0.4636257, -0.4682901, -0.4723839, 
+    -0.4759023, -0.4788408, -0.4811959, -0.4829648, -0.4841452, -0.4847358, 
+    -0.4847358, -0.4841452, -0.4829648, -0.4811959, -0.4788408, -0.4759023, 
+    -0.4723839, -0.4682901, -0.4636257, -0.4583965, -0.4526087, -0.4462696, 
+    -0.4393867, -0.4319685, -0.424024, -0.4155629, -0.4065956, -0.3971328, 
+    -0.3871862, -0.3767678, -0.3658904, -0.3545673, -0.3428122, -0.3306393, 
+    -0.3180637, -0.3051006, -0.2917657, -0.2780754, -0.2640463, -0.2496954, 
+    -0.2350403, -0.2200989, -0.2048893, -0.1894302, -0.1737402, -0.1578386, 
+    -0.1417446, -0.1254779, -0.1090584, -0.09250608, -0.07584096, 
+    -0.05908344, -0.04225393, -0.02537294, -0.008461046, 0.008461046, 
+    0.02537294, 0.04225393, 0.05908344, 0.07584096, 0.09250608, 0.1090584, 
+    0.1254779, 0.1417446, 0.1578386, 0.1737402, 0.1894301, 0.2048894, 
+    0.2200989, 0.2350402, 0.2496954, 0.2640461, 0.2780754, 0.2917657, 
+    0.3051006, 0.3180637, 0.3306392, 0.3428122, 0.3545673, 0.3658905, 
+    0.3767678, 0.3871861, 0.3971328, 0.4065955, 0.415563, 0.424024, 
+    0.4319686, 0.4393867, 0.4462695, 0.4526087, 0.4583965, 0.4636257, 
+    0.4682901, 0.4723839, 0.4759023, 0.4788407, 0.4811959, 0.4829648, 
+    0.4841452, 0.4847358, 0.4847358, 0.4841452, 0.4829648, 0.4811959, 
+    0.4788408, 0.4759023, 0.4723839, 0.4682901, 0.4636257, 0.4583965, 
+    0.4526088, 0.4462696, 0.4393867, 0.4319685, 0.424024, 0.4155629, 
+    0.4065955, 0.3971328, 0.3871861, 0.3767678, 0.3658904, 0.3545673, 
+    0.3428122, 0.3306393, 0.3180638, 0.3051005, 0.2917657, 0.2780755, 
+    0.2640462, 0.2496955,
+  0.220099, 0.2061074, 0.1918647, 0.1773882, 0.1626956, 0.1478048, 0.132734, 
+    0.1175014, 0.1021256, 0.08662546, 0.07101972, 0.05532758, 0.03956791, 
+    0.02376004, 0.007923221, -0.00792325, -0.02376007, -0.03956794, 
+    -0.0553275, -0.07101975, -0.08662548, -0.1021257, -0.1175014, -0.1327339, 
+    -0.1478048, -0.1626956, -0.1773882, -0.1918647, -0.2061073, -0.220099, 
+    -0.2338224, -0.247261, -0.2603983, -0.2732182, -0.2857055, -0.2978446, 
+    -0.3096208, -0.3210198, -0.3320276, -0.342631, -0.3528168, -0.362573, 
+    -0.3718872, -0.3807485, -0.3891458, -0.397069, -0.4045085, -0.4114551, 
+    -0.4179005, -0.4238367, -0.4292565, -0.4341533, -0.4385211, -0.4423548, 
+    -0.4456494, -0.4484012, -0.4506065, -0.452263, -0.4533683, -0.4539214, 
+    -0.4539214, -0.4533683, -0.452263, -0.4506065, -0.4484012, -0.4456494, 
+    -0.4423548, -0.4385211, -0.4341533, -0.4292565, -0.4238367, -0.4179005, 
+    -0.4114552, -0.4045085, -0.397069, -0.3891458, -0.3807485, -0.3718873, 
+    -0.362573, -0.3528169, -0.342631, -0.3320277, -0.3210198, -0.3096208, 
+    -0.2978446, -0.2857055, -0.2732183, -0.2603983, -0.247261, -0.2338224, 
+    -0.220099, -0.2061074, -0.1918647, -0.1773883, -0.1626957, -0.1478049, 
+    -0.132734, -0.1175014, -0.1021256, -0.08662552, -0.07101979, -0.05532753, 
+    -0.03956787, -0.02376, -0.007923182, 0.007923182, 0.02376, 0.03956787, 
+    0.05532753, 0.07101979, 0.08662552, 0.1021256, 0.1175014, 0.132734, 
+    0.1478049, 0.1626957, 0.1773882, 0.1918647, 0.2061074, 0.2200989, 
+    0.2338224, 0.2472609, 0.2603983, 0.2732183, 0.2857056, 0.2978446, 
+    0.3096207, 0.3210198, 0.3320276, 0.342631, 0.3528169, 0.3625729, 
+    0.3718873, 0.3807485, 0.3891459, 0.397069, 0.4045086, 0.4114552, 
+    0.4179004, 0.4238367, 0.4292565, 0.4341533, 0.4385211, 0.4423547, 
+    0.4456494, 0.4484011, 0.4506065, 0.452263, 0.4533683, 0.4539214, 
+    0.4539214, 0.4533683, 0.452263, 0.4506065, 0.4484012, 0.4456494, 
+    0.4423548, 0.4385212, 0.4341533, 0.4292565, 0.4238367, 0.4179005, 
+    0.4114552, 0.4045085, 0.3970691, 0.3891458, 0.3807485, 0.3718873, 
+    0.3625729, 0.3528169, 0.342631, 0.3320276, 0.3210199, 0.3096208, 
+    0.2978446, 0.2857054, 0.2732184, 0.2603984, 0.247261, 0.2338225,
+  0.2048894, 0.1918647, 0.1786062, 0.1651301, 0.1514528, 0.137591, 0.1235617, 
+    0.1093817, 0.09506842, 0.08063934, 0.06611202, 0.05150425, 0.03683364, 
+    0.02211814, 0.0073757, -0.007375727, -0.02211817, -0.03683366, 
+    -0.05150418, -0.06611205, -0.08063937, -0.09506845, -0.1093817, 
+    -0.1235616, -0.137591, -0.1514528, -0.1651301, -0.1786062, -0.1918646, 
+    -0.2048894, -0.2176645, -0.2301744, -0.2424039, -0.2543379, -0.2659623, 
+    -0.2772625, -0.2882249, -0.2988362, -0.3090834, -0.3189541, -0.328436, 
+    -0.337518, -0.3461886, -0.3544375, -0.3622545, -0.3696302, -0.3765557, 
+    -0.3830222, -0.3890221, -0.3945481, -0.3995934, -0.4041518, -0.4082179, 
+    -0.4117866, -0.4148535, -0.4174151, -0.4194681, -0.42101, -0.422039, 
+    -0.4225539, -0.4225539, -0.422039, -0.42101, -0.4194681, -0.4174151, 
+    -0.4148535, -0.4117866, -0.4082179, -0.4041518, -0.3995934, -0.3945481, 
+    -0.3890221, -0.3830222, -0.3765556, -0.3696302, -0.3622545, -0.3544375, 
+    -0.3461886, -0.3375179, -0.328436, -0.318954, -0.3090834, -0.2988362, 
+    -0.288225, -0.2772625, -0.2659623, -0.254338, -0.2424039, -0.2301744, 
+    -0.2176645, -0.2048894, -0.1918647, -0.1786062, -0.1651301, -0.1514529, 
+    -0.137591, -0.1235616, -0.1093816, -0.09506838, -0.08063941, -0.06611208, 
+    -0.05150422, -0.0368336, -0.02211811, -0.007375663, 0.007375663, 
+    0.02211811, 0.0368336, 0.05150422, 0.06611208, 0.08063941, 0.09506838, 
+    0.1093816, 0.1235616, 0.137591, 0.1514529, 0.16513, 0.1786062, 0.1918647, 
+    0.2048893, 0.2176645, 0.2301743, 0.2424039, 0.254338, 0.2659624, 
+    0.2772625, 0.2882249, 0.2988362, 0.3090834, 0.3189541, 0.328436, 
+    0.3375179, 0.3461886, 0.3544374, 0.3622546, 0.3696302, 0.3765557, 
+    0.3830222, 0.3890221, 0.3945481, 0.3995934, 0.4041519, 0.4082179, 
+    0.4117865, 0.4148535, 0.4174151, 0.4194681, 0.42101, 0.422039, 0.4225539, 
+    0.4225539, 0.422039, 0.42101, 0.4194681, 0.4174151, 0.4148536, 0.4117866, 
+    0.4082179, 0.4041518, 0.3995934, 0.3945481, 0.3890221, 0.3830222, 
+    0.3765556, 0.3696302, 0.3622545, 0.3544375, 0.3461887, 0.3375179, 
+    0.3284361, 0.318954, 0.3090834, 0.2988363, 0.2882249, 0.2772626, 
+    0.2659622, 0.254338, 0.2424039, 0.2301744, 0.2176646,
+  0.1894303, 0.1773883, 0.1651301, 0.1526708, 0.1400255, 0.1272096, 
+    0.1142388, 0.1011287, 0.08789539, 0.07455501, 0.06112379, 0.0476182, 
+    0.0340545, 0.0204493, 0.006819195, -0.00681922, -0.02044933, -0.03405452, 
+    -0.04761813, -0.06112382, -0.07455503, -0.08789542, -0.1011287, 
+    -0.1142387, -0.1272096, -0.1400255, -0.1526708, -0.1651302, -0.1773882, 
+    -0.1894303, -0.2012414, -0.2128075, -0.2241142, -0.2351478, -0.2458951, 
+    -0.2563427, -0.266478, -0.2762887, -0.2857627, -0.2948886, -0.3036551, 
+    -0.3120518, -0.3200682, -0.3276947, -0.334922, -0.3417411, -0.3481441, 
+    -0.3541227, -0.35967, -0.364779, -0.3694436, -0.3736581, -0.3774173, 
+    -0.3807168, -0.3835523, -0.3859206, -0.3878187, -0.3892443, -0.3901957, 
+    -0.3906717, -0.3906717, -0.3901957, -0.3892443, -0.3878187, -0.3859206, 
+    -0.3835523, -0.3807168, -0.3774173, -0.3736581, -0.3694436, -0.364779, 
+    -0.35967, -0.3541227, -0.348144, -0.3417412, -0.334922, -0.3276948, 
+    -0.3200682, -0.3120518, -0.3036551, -0.2948886, -0.2857627, -0.2762887, 
+    -0.266478, -0.2563427, -0.2458951, -0.2351479, -0.2241142, -0.2128075, 
+    -0.2012415, -0.1894302, -0.1773882, -0.1651301, -0.1526709, -0.1400256, 
+    -0.1272096, -0.1142387, -0.1011286, -0.08789536, -0.07455507, 
+    -0.06112384, -0.04761816, -0.03405446, -0.02044927, -0.006819161, 
+    0.006819161, 0.02044927, 0.03405446, 0.04761816, 0.06112384, 0.07455507, 
+    0.08789536, 0.1011286, 0.1142387, 0.1272096, 0.1400256, 0.1526708, 
+    0.1651302, 0.1773882, 0.1894301, 0.2012415, 0.2128074, 0.2241142, 
+    0.2351479, 0.2458952, 0.2563427, 0.266478, 0.2762887, 0.2857627, 
+    0.2948886, 0.3036551, 0.3120517, 0.3200682, 0.3276947, 0.334922, 
+    0.3417412, 0.3481441, 0.3541227, 0.3596699, 0.364779, 0.3694436, 
+    0.3736581, 0.3774173, 0.3807167, 0.3835523, 0.3859206, 0.3878187, 
+    0.3892443, 0.3901957, 0.3906717, 0.3906717, 0.3901957, 0.3892443, 
+    0.3878187, 0.3859206, 0.3835524, 0.3807168, 0.3774174, 0.3736581, 
+    0.3694436, 0.364779, 0.35967, 0.3541228, 0.348144, 0.3417412, 0.334922, 
+    0.3276947, 0.3200683, 0.3120518, 0.3036552, 0.2948885, 0.2857627, 
+    0.2762887, 0.266478, 0.2563428, 0.2458951, 0.2351479, 0.2241143, 
+    0.2128075, 0.2012415,
+  0.1737403, 0.1626957, 0.1514529, 0.1400255, 0.1284276, 0.1166732, 
+    0.1047767, 0.09275247, 0.08061525, 0.06837982, 0.05606107, 0.04367411, 
+    0.03123385, 0.01875554, 0.006254379, -0.006254402, -0.01875556, 
+    -0.03123388, -0.04367405, -0.0560611, -0.06837984, -0.08061527, 
+    -0.09275249, -0.1047766, -0.1166732, -0.1284276, -0.1400255, -0.1514529, 
+    -0.1626956, -0.1737403, -0.1845731, -0.1951812, -0.2055514, -0.2156712, 
+    -0.2255283, -0.2351105, -0.2444064, -0.2534044, -0.2620938, -0.2704638, 
+    -0.2785042, -0.2862054, -0.2935579, -0.3005527, -0.3071813, -0.3134357, 
+    -0.3193082, -0.3247917, -0.3298795, -0.3345653, -0.3388436, -0.342709, 
+    -0.3461569, -0.349183, -0.3517838, -0.3539559, -0.3556968, -0.3570043, 
+    -0.3578768, -0.3583134, -0.3583134, -0.3578768, -0.3570043, -0.3556968, 
+    -0.3539559, -0.3517838, -0.349183, -0.3461569, -0.342709, -0.3388436, 
+    -0.3345653, -0.3298795, -0.3247917, -0.3193082, -0.3134357, -0.3071813, 
+    -0.3005527, -0.2935579, -0.2862054, -0.2785042, -0.2704637, -0.2620938, 
+    -0.2534044, -0.2444064, -0.2351106, -0.2255283, -0.2156712, -0.2055515, 
+    -0.1951812, -0.1845732, -0.1737402, -0.1626956, -0.1514528, -0.1400256, 
+    -0.1284276, -0.1166732, -0.1047767, -0.09275243, -0.08061522, 
+    -0.06837987, -0.05606112, -0.04367408, -0.03123382, -0.01875551, 
+    -0.006254348, 0.006254348, 0.01875551, 0.03123382, 0.04367408, 
+    0.05606112, 0.06837987, 0.08061522, 0.09275243, 0.1047767, 0.1166732, 
+    0.1284276, 0.1400255, 0.1514529, 0.1626956, 0.1737402, 0.1845732, 
+    0.1951811, 0.2055515, 0.2156712, 0.2255283, 0.2351106, 0.2444063, 
+    0.2534044, 0.2620937, 0.2704638, 0.2785042, 0.2862054, 0.2935579, 
+    0.3005526, 0.3071813, 0.3134357, 0.3193083, 0.3247917, 0.3298795, 
+    0.3345653, 0.3388436, 0.342709, 0.3461569, 0.349183, 0.3517838, 
+    0.3539559, 0.3556968, 0.3570043, 0.3578768, 0.3583134, 0.3583134, 
+    0.3578768, 0.3570043, 0.3556968, 0.3539559, 0.3517838, 0.349183, 
+    0.3461569, 0.342709, 0.3388436, 0.3345654, 0.3298795, 0.3247917, 
+    0.3193082, 0.3134357, 0.3071813, 0.3005527, 0.2935579, 0.2862054, 
+    0.2785043, 0.2704637, 0.2620938, 0.2534045, 0.2444064, 0.2351106, 
+    0.2255282, 0.2156713, 0.2055515, 0.1951812, 0.1845732,
+  0.1578386, 0.1478049, 0.137591, 0.1272096, 0.1166732, 0.1059946, 
+    0.09518693, 0.08426324, 0.07323689, 0.06212132, 0.05093005, 0.03967681, 
+    0.02837516, 0.01703893, 0.005681944, -0.005681964, -0.01703895, 
+    -0.02837518, -0.03967676, -0.05093007, -0.06212134, -0.07323692, 
+    -0.08426327, -0.09518688, -0.1059946, -0.1166732, -0.1272096, -0.1375911, 
+    -0.1478048, -0.1578386, -0.16768, -0.1773171, -0.1867382, -0.1959317, 
+    -0.2048867, -0.2135919, -0.2220369, -0.2302114, -0.2381055, -0.2457094, 
+    -0.2530139, -0.2600103, -0.2666898, -0.2730444, -0.2790664, -0.2847483, 
+    -0.2900833, -0.2950649, -0.2996871, -0.3039441, -0.3078307, -0.3113424, 
+    -0.3144747, -0.3172238, -0.3195865, -0.3215599, -0.3231414, -0.3243293, 
+    -0.3251219, -0.3255185, -0.3255185, -0.3251219, -0.3243293, -0.3231414, 
+    -0.3215599, -0.3195865, -0.3172238, -0.3144747, -0.3113424, -0.3078307, 
+    -0.3039441, -0.2996871, -0.295065, -0.2900833, -0.2847483, -0.2790664, 
+    -0.2730444, -0.2666898, -0.2600103, -0.2530139, -0.2457094, -0.2381055, 
+    -0.2302115, -0.2220369, -0.2135919, -0.2048867, -0.1959318, -0.1867382, 
+    -0.1773171, -0.16768, -0.1578386, -0.1478048, -0.137591, -0.1272096, 
+    -0.1166732, -0.1059946, -0.0951869, -0.08426321, -0.07323687, 
+    -0.06212137, -0.0509301, -0.03967678, -0.02837513, -0.0170389, 
+    -0.005681915, 0.005681915, 0.0170389, 0.02837513, 0.03967678, 0.0509301, 
+    0.06212137, 0.07323687, 0.08426321, 0.0951869, 0.1059946, 0.1166732, 
+    0.1272096, 0.1375911, 0.1478048, 0.1578385, 0.16768, 0.1773171, 
+    0.1867382, 0.1959318, 0.2048867, 0.2135919, 0.2220369, 0.2302115, 
+    0.2381054, 0.2457094, 0.2530139, 0.2600102, 0.2666898, 0.2730444, 
+    0.2790664, 0.2847483, 0.2900834, 0.295065, 0.299687, 0.3039441, 
+    0.3078307, 0.3113424, 0.3144747, 0.3172238, 0.3195865, 0.3215598, 
+    0.3231414, 0.3243293, 0.3251219, 0.3255185, 0.3255185, 0.3251219, 
+    0.3243293, 0.3231414, 0.3215599, 0.3195865, 0.3172238, 0.3144747, 
+    0.3113424, 0.3078307, 0.3039441, 0.2996871, 0.295065, 0.2900833, 
+    0.2847483, 0.2790663, 0.2730444, 0.2666898, 0.2600103, 0.253014, 
+    0.2457094, 0.2381055, 0.2302115, 0.2220369, 0.2135919, 0.2048866, 
+    0.1959318, 0.1867383, 0.1773171, 0.16768,
+  0.1417447, 0.132734, 0.1235617, 0.1142387, 0.1047767, 0.09518691, 
+    0.08548126, 0.07567139, 0.06576934, 0.05578715, 0.04573699, 0.03563119, 
+    0.0254819, 0.01530156, 0.005102588, -0.005102606, -0.01530158, 
+    -0.02548192, -0.03563114, -0.04573702, -0.05578717, -0.06576936, 
+    -0.07567141, -0.0854812, -0.09518693, -0.1047767, -0.1142388, -0.1235617, 
+    -0.132734, -0.1417447, -0.1505826, -0.1592371, -0.1676976, -0.1759537, 
+    -0.1839956, -0.1918131, -0.1993971, -0.2067381, -0.2138272, -0.2206558, 
+    -0.2272155, -0.2334985, -0.2394969, -0.2452036, -0.2506115, -0.2557141, 
+    -0.2605052, -0.2649788, -0.2691296, -0.2729526, -0.2764429, -0.2795965, 
+    -0.2824095, -0.2848783, -0.2870001, -0.2887722, -0.2901925, -0.2912592, 
+    -0.2919711, -0.2923273, -0.2923273, -0.2919711, -0.2912592, -0.2901925, 
+    -0.2887722, -0.2870001, -0.2848783, -0.2824095, -0.2795965, -0.2764429, 
+    -0.2729526, -0.2691296, -0.2649788, -0.2605052, -0.2557141, -0.2506115, 
+    -0.2452036, -0.2394969, -0.2334985, -0.2272155, -0.2206558, -0.2138272, 
+    -0.2067381, -0.1993971, -0.1918131, -0.1839955, -0.1759537, -0.1676976, 
+    -0.1592371, -0.1505826, -0.1417446, -0.132734, -0.1235616, -0.1142388, 
+    -0.1047767, -0.09518695, -0.08548123, -0.07567137, -0.06576931, 
+    -0.0557872, -0.04573704, -0.03563116, -0.02548187, -0.01530154, 
+    -0.005102562, 0.005102562, 0.01530154, 0.02548187, 0.03563116, 
+    0.04573704, 0.0557872, 0.06576931, 0.07567137, 0.08548123, 0.09518695, 
+    0.1047767, 0.1142387, 0.1235617, 0.132734, 0.1417446, 0.1505826, 
+    0.159237, 0.1676976, 0.1759537, 0.1839956, 0.1918131, 0.199397, 
+    0.2067381, 0.2138272, 0.2206558, 0.2272155, 0.2334984, 0.2394969, 
+    0.2452036, 0.2506115, 0.2557141, 0.2605052, 0.2649788, 0.2691296, 
+    0.2729526, 0.2764429, 0.2795965, 0.2824095, 0.2848783, 0.2870001, 
+    0.2887722, 0.2901925, 0.2912592, 0.2919711, 0.2923273, 0.2923273, 
+    0.2919711, 0.2912592, 0.2901925, 0.2887722, 0.2870001, 0.2848783, 
+    0.2824095, 0.2795965, 0.2764429, 0.2729526, 0.2691296, 0.2649789, 
+    0.2605051, 0.2557141, 0.2506115, 0.2452036, 0.239497, 0.2334985, 
+    0.2272156, 0.2206558, 0.2138272, 0.2067381, 0.1993971, 0.1918132, 
+    0.1839955, 0.1759537, 0.1676976, 0.1592371, 0.1505827,
+  0.125478, 0.1175014, 0.1093817, 0.1011287, 0.09275243, 0.08426322, 
+    0.07567139, 0.06698731, 0.05822162, 0.049385, 0.0404882, 0.03154214, 
+    0.02255759, 0.01354555, 0.004517013, -0.004517029, -0.01354557, 
+    -0.0225576, -0.03154209, -0.04048822, -0.04938501, -0.05822164, 
+    -0.06698733, -0.07567134, -0.08426324, -0.09275246, -0.1011287, 
+    -0.1093817, -0.1175014, -0.125478, -0.1333017, -0.140963, -0.1484525, 
+    -0.1557612, -0.1628802, -0.1698006, -0.1765142, -0.1830127, -0.1892883, 
+    -0.1953332, -0.2011402, -0.2067021, -0.2120122, -0.2170639, -0.2218512, 
+    -0.2263682, -0.2306095, -0.2345697, -0.2382442, -0.2416284, -0.2447183, 
+    -0.2475099, -0.25, -0.2521856, -0.2540638, -0.2556326, -0.2568899, 
+    -0.2578342, -0.2584644, -0.2587796, -0.2587796, -0.2584644, -0.2578342, 
+    -0.2568899, -0.2556326, -0.2540638, -0.2521856, -0.25, -0.2475099, 
+    -0.2447182, -0.2416284, -0.2382442, -0.2345697, -0.2306095, -0.2263682, 
+    -0.2218512, -0.2170639, -0.2120122, -0.2067021, -0.2011402, -0.1953332, 
+    -0.1892883, -0.1830127, -0.1765142, -0.1698006, -0.1628801, -0.1557612, 
+    -0.1484525, -0.140963, -0.1333017, -0.125478, -0.1175014, -0.1093816, 
+    -0.1011287, -0.09275248, -0.08426325, -0.07567137, -0.06698729, 
+    -0.0582216, -0.04938503, -0.04048824, -0.03154211, -0.02255756, 
+    -0.01354553, -0.00451699, 0.00451699, 0.01354553, 0.02255756, 0.03154211, 
+    0.04048824, 0.04938503, 0.0582216, 0.06698729, 0.07567137, 0.08426325, 
+    0.09275248, 0.1011286, 0.1093817, 0.1175014, 0.1254779, 0.1333017, 
+    0.1409629, 0.1484525, 0.1557612, 0.1628802, 0.1698006, 0.1765141, 
+    0.1830127, 0.1892883, 0.1953333, 0.2011402, 0.2067021, 0.2120122, 
+    0.2170639, 0.2218513, 0.2263682, 0.2306095, 0.2345697, 0.2382442, 
+    0.2416284, 0.2447182, 0.2475099, 0.25, 0.2521856, 0.2540638, 0.2556326, 
+    0.2568899, 0.2578342, 0.2584644, 0.2587796, 0.2587796, 0.2584644, 
+    0.2578342, 0.2568899, 0.2556326, 0.2540638, 0.2521856, 0.25, 0.2475099, 
+    0.2447183, 0.2416284, 0.2382442, 0.2345698, 0.2306095, 0.2263683, 
+    0.2218512, 0.2170639, 0.2120122, 0.2067021, 0.2011402, 0.1953332, 
+    0.1892883, 0.1830128, 0.1765142, 0.1698006, 0.1628801, 0.1557612, 
+    0.1484526, 0.140963, 0.1333017,
+  0.1090584, 0.1021256, 0.09506842, 0.08789537, 0.08061522, 0.07323688, 
+    0.06576934, 0.05822162, 0.05060297, 0.04292267, 0.03519008, 0.02741466, 
+    0.01960579, 0.01177303, 0.003925934, -0.003925948, -0.01177305, 
+    -0.01960581, -0.02741462, -0.03519009, -0.04292269, -0.05060299, 
+    -0.05822163, -0.0657693, -0.07323688, -0.08061524, -0.08789538, 
+    -0.09506843, -0.1021256, -0.1090585, -0.1158583, -0.1225171, -0.1290266, 
+    -0.1353789, -0.1415663, -0.1475811, -0.1534162, -0.1590644, -0.1645188, 
+    -0.1697727, -0.1748198, -0.1796539, -0.1842691, -0.1886598, -0.1928207, 
+    -0.1967466, -0.2004329, -0.2038749, -0.2070685, -0.2100099, -0.2126954, 
+    -0.2151217, -0.217286, -0.2191856, -0.2208181, -0.2221815, -0.2232743, 
+    -0.224095, -0.2246428, -0.2249168, -0.2249168, -0.2246428, -0.224095, 
+    -0.2232743, -0.2221815, -0.2208181, -0.2191856, -0.217286, -0.2151217, 
+    -0.2126954, -0.2100099, -0.2070685, -0.2038749, -0.2004329, -0.1967466, 
+    -0.1928207, -0.1886598, -0.1842691, -0.1796539, -0.1748198, -0.1697727, 
+    -0.1645188, -0.1590644, -0.1534162, -0.1475812, -0.1415663, -0.1353789, 
+    -0.1290266, -0.1225171, -0.1158584, -0.1090584, -0.1021256, -0.0950684, 
+    -0.08789539, -0.08061526, -0.0732369, -0.06576931, -0.0582216, 
+    -0.05060295, -0.04292271, -0.03519011, -0.02741464, -0.01960577, 
+    -0.01177302, -0.003925915, 0.003925915, 0.01177302, 0.01960577, 
+    0.02741464, 0.03519011, 0.04292271, 0.05060295, 0.0582216, 0.06576931, 
+    0.0732369, 0.08061526, 0.08789535, 0.09506845, 0.1021256, 0.1090584, 
+    0.1158584, 0.1225171, 0.1290266, 0.1353789, 0.1415663, 0.1475812, 
+    0.1534162, 0.1590644, 0.1645188, 0.1697727, 0.1748198, 0.1796539, 
+    0.1842691, 0.1886598, 0.1928207, 0.1967466, 0.2004329, 0.2038749, 
+    0.2070685, 0.2100099, 0.2126954, 0.2151218, 0.217286, 0.2191855, 
+    0.2208181, 0.2221815, 0.2232743, 0.224095, 0.2246428, 0.2249168, 
+    0.2249168, 0.2246428, 0.224095, 0.2232743, 0.2221815, 0.2208181, 
+    0.2191856, 0.217286, 0.2151217, 0.2126954, 0.2100099, 0.2070685, 
+    0.2038749, 0.2004328, 0.1967466, 0.1928207, 0.1886598, 0.1842691, 
+    0.1796539, 0.1748198, 0.1697727, 0.1645188, 0.1590644, 0.1534162, 
+    0.1475812, 0.1415662, 0.1353789, 0.1290267, 0.1225171, 0.1158584,
+  0.09250608, 0.08662551, 0.08063939, 0.07455503, 0.06837983, 0.06212133, 
+    0.05578718, 0.04938502, 0.0429227, 0.03640807, 0.0298491, 0.02325379, 
+    0.01663012, 0.00998618, 0.003330075, -0.003330087, -0.009986192, 
+    -0.01663013, -0.02325376, -0.02984911, -0.03640809, -0.04292271, 
+    -0.04938503, -0.05578715, -0.06212134, -0.06837984, -0.07455504, 
+    -0.08063941, -0.08662547, -0.09250609, -0.09827392, -0.1039221, 
+    -0.1094436, -0.1148317, -0.1200801, -0.125182, -0.1301315, -0.1349224, 
+    -0.1395489, -0.1440054, -0.1482865, -0.1523869, -0.1563016, -0.1600259, 
+    -0.1635553, -0.1668853, -0.1700121, -0.1729317, -0.1756407, -0.1781356, 
+    -0.1804135, -0.1824716, -0.1843074, -0.1859186, -0.1873033, -0.1884599, 
+    -0.1893868, -0.190083, -0.1905476, -0.19078, -0.19078, -0.1905476, 
+    -0.190083, -0.1893868, -0.1884599, -0.1873033, -0.1859186, -0.1843074, 
+    -0.1824716, -0.1804135, -0.1781356, -0.1756407, -0.1729317, -0.1700121, 
+    -0.1668853, -0.1635553, -0.160026, -0.1563016, -0.1523869, -0.1482865, 
+    -0.1440054, -0.1395489, -0.1349224, -0.1301315, -0.125182, -0.12008, 
+    -0.1148317, -0.1094436, -0.1039221, -0.09827394, -0.09250607, 
+    -0.08662549, -0.08063938, -0.07455505, -0.06837986, -0.06212135, 
+    -0.05578716, -0.04938501, -0.04292268, -0.0364081, -0.02984912, 
+    -0.02325378, -0.0166301, -0.009986163, -0.003330058, 0.003330058, 
+    0.009986163, 0.0166301, 0.02325378, 0.02984912, 0.0364081, 0.04292268, 
+    0.04938501, 0.05578716, 0.06212135, 0.06837986, 0.07455502, 0.08063941, 
+    0.08662549, 0.09250602, 0.09827394, 0.103922, 0.1094436, 0.1148317, 
+    0.1200801, 0.125182, 0.1301314, 0.1349224, 0.1395489, 0.1440054, 
+    0.1482865, 0.1523869, 0.1563016, 0.1600259, 0.1635553, 0.1668853, 
+    0.1700121, 0.1729317, 0.1756407, 0.1781356, 0.1804135, 0.1824716, 
+    0.1843074, 0.1859186, 0.1873033, 0.1884599, 0.1893868, 0.190083, 
+    0.1905476, 0.19078, 0.19078, 0.1905476, 0.190083, 0.1893868, 0.1884599, 
+    0.1873034, 0.1859186, 0.1843074, 0.1824716, 0.1804135, 0.1781356, 
+    0.1756407, 0.1729317, 0.1700121, 0.1668854, 0.1635553, 0.1600259, 
+    0.1563016, 0.1523869, 0.1482865, 0.1440054, 0.1395489, 0.1349224, 
+    0.1301315, 0.125182, 0.12008, 0.1148318, 0.1094436, 0.1039221, 0.09827396,
+  0.07584096, 0.07101978, 0.06611207, 0.06112382, 0.05606109, 0.05093007, 
+    0.04573703, 0.04048823, 0.0351901, 0.0298491, 0.02447173, 0.01906459, 
+    0.01363418, 0.008187153, 0.002730157, -0.002730166, -0.008187163, 
+    -0.01363419, -0.01906456, -0.02447174, -0.02984911, -0.03519011, 
+    -0.04048824, -0.045737, -0.05093008, -0.0560611, -0.06112383, 
+    -0.06611209, -0.07101975, -0.07584096, -0.08056971, -0.08520033, 
+    -0.08972714, -0.09414461, -0.09844743, -0.1026303, -0.1066881, 
+    -0.1106159, -0.1144089, -0.1180626, -0.1215724, -0.1249342, -0.1281436, 
+    -0.131197, -0.1340905, -0.1368207, -0.1393842, -0.1417778, -0.1439987, 
+    -0.1460442, -0.1479117, -0.149599, -0.1511041, -0.1524251, -0.1535603, 
+    -0.1545085, -0.1552684, -0.1558392, -0.1562201, -0.1564107, -0.1564107, 
+    -0.1562201, -0.1558392, -0.1552684, -0.1545085, -0.1535603, -0.1524251, 
+    -0.1511041, -0.149599, -0.1479117, -0.1460442, -0.1439987, -0.1417778, 
+    -0.1393842, -0.1368207, -0.1340905, -0.131197, -0.1281436, -0.1249341, 
+    -0.1215724, -0.1180626, -0.114409, -0.1106159, -0.1066881, -0.1026303, 
+    -0.09844741, -0.09414462, -0.08972715, -0.08520034, -0.08056973, 
+    -0.07584094, -0.07101977, -0.06611206, -0.06112384, -0.05606112, 
+    -0.05093009, -0.04573702, -0.04048822, -0.03519009, -0.02984913, 
+    -0.02447175, -0.01906457, -0.01363416, -0.008187139, -0.002730143, 
+    0.002730143, 0.008187139, 0.01363416, 0.01906457, 0.02447175, 0.02984913, 
+    0.03519009, 0.04048822, 0.04573702, 0.05093009, 0.05606112, 0.06112381, 
+    0.06611209, 0.07101977, 0.07584091, 0.08056973, 0.0852003, 0.08972715, 
+    0.09414462, 0.09844744, 0.1026303, 0.106688, 0.1106159, 0.1144089, 
+    0.1180626, 0.1215724, 0.1249341, 0.1281436, 0.131197, 0.1340905, 
+    0.1368207, 0.1393842, 0.1417778, 0.1439987, 0.1460442, 0.1479117, 
+    0.1495991, 0.1511041, 0.1524251, 0.1535603, 0.1545085, 0.1552684, 
+    0.1558392, 0.1562201, 0.1564107, 0.1564107, 0.1562201, 0.1558392, 
+    0.1552684, 0.1545085, 0.1535604, 0.1524251, 0.1511041, 0.149599, 
+    0.1479117, 0.1460442, 0.1439987, 0.1417778, 0.1393842, 0.1368207, 
+    0.1340905, 0.131197, 0.1281437, 0.1249341, 0.1215724, 0.1180626, 
+    0.1144089, 0.1106159, 0.1066881, 0.1026303, 0.0984474, 0.09414464, 
+    0.08972717, 0.08520033, 0.08056974,
+  0.05908343, 0.05532752, 0.0515042, 0.04761814, 0.04367405, 0.03967676, 
+    0.03563115, 0.03154211, 0.02741463, 0.02325376, 0.01906455, 0.01485215, 
+    0.01062162, 0.006378151, 0.002126912, -0.002126919, -0.006378159, 
+    -0.01062163, -0.01485213, -0.01906456, -0.02325376, -0.02741464, 
+    -0.03154211, -0.03563113, -0.03967677, -0.04367406, -0.04761814, 
+    -0.05150421, -0.0553275, -0.05908344, -0.06276733, -0.06637479, 
+    -0.06990138, -0.07334277, -0.07669487, -0.07995346, -0.08311468, 
+    -0.08617462, -0.08912958, -0.09197595, -0.09471025, -0.09732918, 
+    -0.0998295, -0.1022082, -0.1044624, -0.1065893, -0.1085864, -0.1104511, 
+    -0.1121813, -0.1137748, -0.1152297, -0.1165442, -0.1177167, -0.1187458, 
+    -0.1196302, -0.1203689, -0.1209609, -0.1214056, -0.1217023, -0.1218508, 
+    -0.1218508, -0.1217023, -0.1214056, -0.1209609, -0.1203689, -0.1196302, 
+    -0.1187458, -0.1177167, -0.1165442, -0.1152297, -0.1137748, -0.1121813, 
+    -0.1104511, -0.1085864, -0.1065893, -0.1044624, -0.1022082, -0.09982951, 
+    -0.09732918, -0.09471025, -0.09197594, -0.08912959, -0.08617463, 
+    -0.08311468, -0.07995347, -0.07669485, -0.07334279, -0.06990138, 
+    -0.0663748, -0.06276735, -0.05908342, -0.05532751, -0.05150419, 
+    -0.04761815, -0.04367407, -0.03967677, -0.03563114, -0.0315421, 
+    -0.02741462, -0.02325378, -0.01906457, -0.01485214, -0.01062161, 
+    -0.006378141, -0.002126901, 0.002126901, 0.006378141, 0.01062161, 
+    0.01485214, 0.01906457, 0.02325378, 0.02741462, 0.0315421, 0.03563114, 
+    0.03967677, 0.04367407, 0.04761812, 0.05150422, 0.05532751, 0.05908339, 
+    0.06276735, 0.06637477, 0.06990138, 0.07334279, 0.07669488, 0.07995347, 
+    0.08311466, 0.08617463, 0.08912957, 0.09197596, 0.09471025, 0.09732915, 
+    0.09982951, 0.1022082, 0.1044624, 0.1065893, 0.1085864, 0.1104511, 
+    0.1121813, 0.1137748, 0.1152297, 0.1165442, 0.1177167, 0.1187458, 
+    0.1196302, 0.1203689, 0.1209609, 0.1214056, 0.1217023, 0.1218508, 
+    0.1218508, 0.1217023, 0.1214056, 0.1209609, 0.1203689, 0.1196302, 
+    0.1187458, 0.1177167, 0.1165442, 0.1152297, 0.1137748, 0.1121813, 
+    0.1104511, 0.1085864, 0.1065893, 0.1044624, 0.1022082, 0.09982952, 
+    0.09732917, 0.09471026, 0.09197593, 0.08912958, 0.08617464, 0.08311468, 
+    0.07995348, 0.07669484, 0.0733428, 0.0699014, 0.06637479, 0.06276736,
+  0.04225398, 0.03956791, 0.03683364, 0.03405448, 0.03123384, 0.02837515, 
+    0.0254819, 0.02255758, 0.01960579, 0.01663011, 0.01363416, 0.01062163, 
+    0.007596135, 0.004561385, 0.001521077, -0.001521083, -0.00456139, 
+    -0.007596141, -0.01062161, -0.01363417, -0.01663011, -0.01960579, 
+    -0.02255759, -0.02548188, -0.02837515, -0.03123384, -0.03405449, 
+    -0.03683364, -0.0395679, -0.04225398, -0.04488855, -0.04746845, 
+    -0.04999052, -0.05245166, -0.05484894, -0.05717935, -0.05944011, 
+    -0.06162846, -0.06374172, -0.06577732, -0.06773277, -0.06960573, 
+    -0.07139385, -0.07309501, -0.07470711, -0.07622817, -0.0776564, 
+    -0.07898998, -0.08022735, -0.08136696, -0.08240744, -0.08334751, 
+    -0.08418604, -0.08492201, -0.0855545, -0.08608277, -0.08650616, 
+    -0.08682415, -0.08703636, -0.08714253, -0.08714253, -0.08703636, 
+    -0.08682415, -0.08650616, -0.08608277, -0.0855545, -0.08492201, 
+    -0.08418604, -0.08334751, -0.08240743, -0.08136696, -0.08022735, 
+    -0.07898999, -0.07765639, -0.07622818, -0.0747071, -0.07309501, 
+    -0.07139385, -0.06960572, -0.06773278, -0.06577732, -0.06374173, 
+    -0.06162846, -0.05944012, -0.05717935, -0.05484892, -0.05245167, 
+    -0.04999052, -0.04746846, -0.04488856, -0.04225397, -0.0395679, 
+    -0.03683363, -0.03405449, -0.03123385, -0.02837516, -0.02548189, 
+    -0.02255758, -0.01960578, -0.01663012, -0.01363418, -0.01062162, 
+    -0.007596127, -0.004561377, -0.00152107, 0.00152107, 0.004561377, 
+    0.007596127, 0.01062162, 0.01363418, 0.01663012, 0.01960578, 0.02255758, 
+    0.02548189, 0.02837516, 0.03123385, 0.03405448, 0.03683364, 0.0395679, 
+    0.04225395, 0.04488856, 0.04746844, 0.04999052, 0.05245167, 0.05484894, 
+    0.05717935, 0.0594401, 0.06162846, 0.06374171, 0.06577732, 0.06773278, 
+    0.06960571, 0.07139385, 0.073095, 0.07470711, 0.07622818, 0.0776564, 
+    0.07898999, 0.08022734, 0.08136696, 0.08240743, 0.08334751, 0.08418604, 
+    0.084922, 0.0855545, 0.08608277, 0.08650616, 0.08682415, 0.08703636, 
+    0.08714253, 0.08714253, 0.08703636, 0.08682415, 0.08650616, 0.08608277, 
+    0.08555451, 0.08492201, 0.08418605, 0.08334751, 0.08240744, 0.08136696, 
+    0.08022735, 0.07898999, 0.07765639, 0.07622819, 0.0747071, 0.07309501, 
+    0.07139387, 0.06960572, 0.06773279, 0.06577731, 0.06374172, 0.06162848, 
+    0.05944011, 0.05717936, 0.05484891, 0.05245168, 0.04999053, 0.04746845, 
+    0.04488857,
+  0.02537299, 0.02376004, 0.02211814, 0.02044929, 0.01875553, 0.01703892, 
+    0.01530156, 0.01354555, 0.01177303, 0.009986172, 0.008187145, 
+    0.006378157, 0.004561384, 0.002739055, 0.000913388, -0.0009133914, 
+    -0.002739058, -0.004561388, -0.006378147, -0.008187149, -0.009986175, 
+    -0.01177304, -0.01354555, -0.01530155, -0.01703892, -0.01875553, 
+    -0.0204493, -0.02211814, -0.02376003, -0.02537299, -0.02695502, 
+    -0.02850422, -0.03001868, -0.03149657, -0.0329361, -0.03433549, 
+    -0.03569305, -0.03700712, -0.03827611, -0.03949846, -0.04067269, 
+    -0.04179737, -0.04287112, -0.04389264, -0.04486069, -0.04577407, 
+    -0.0466317, -0.0474325, -0.04817552, -0.04885984, -0.04948464, 
+    -0.05004914, -0.05055267, -0.0509946, -0.05137441, -0.05169163, 
+    -0.05194587, -0.05213682, -0.05226425, -0.05232801, -0.05232801, 
+    -0.05226425, -0.05213682, -0.05194587, -0.05169163, -0.05137441, 
+    -0.0509946, -0.05055267, -0.05004914, -0.04948463, -0.04885984, 
+    -0.04817552, -0.0474325, -0.04663169, -0.04577407, -0.04486068, 
+    -0.04389264, -0.04287112, -0.04179737, -0.04067269, -0.03949846, 
+    -0.03827611, -0.03700712, -0.03569305, -0.03433549, -0.0329361, 
+    -0.03149657, -0.03001869, -0.02850422, -0.02695502, -0.02537298, 
+    -0.02376003, -0.02211813, -0.0204493, -0.01875554, -0.01703893, 
+    -0.01530156, -0.01354554, -0.01177303, -0.00998618, -0.008187153, 
+    -0.006378152, -0.00456138, -0.00273905, -0.0009133835, 0.0009133835, 
+    0.00273905, 0.00456138, 0.006378152, 0.008187153, 0.00998618, 0.01177303, 
+    0.01354554, 0.01530156, 0.01703893, 0.01875554, 0.02044929, 0.02211815, 
+    0.02376003, 0.02537297, 0.02695502, 0.02850421, 0.03001869, 0.03149657, 
+    0.0329361, 0.03433549, 0.03569304, 0.03700712, 0.03827611, 0.03949846, 
+    0.04067269, 0.04179736, 0.04287112, 0.04389264, 0.04486069, 0.04577407, 
+    0.0466317, 0.0474325, 0.04817551, 0.04885984, 0.04948463, 0.05004914, 
+    0.05055267, 0.0509946, 0.05137441, 0.05169163, 0.05194587, 0.05213682, 
+    0.05226425, 0.05232801, 0.05232801, 0.05226425, 0.05213682, 0.05194587, 
+    0.05169163, 0.05137442, 0.0509946, 0.05055267, 0.05004914, 0.04948464, 
+    0.04885985, 0.04817552, 0.0474325, 0.04663169, 0.04577408, 0.04486068, 
+    0.04389264, 0.04287113, 0.04179737, 0.04067269, 0.03949846, 0.03827611, 
+    0.03700713, 0.03569305, 0.03433549, 0.03293609, 0.03149658, 0.03001869, 
+    0.02850422, 0.02695503,
+  0.008461085, 0.007923217, 0.007375696, 0.006819189, 0.006254373, 
+    0.005681938, 0.005102585, 0.004517009, 0.003925932, 0.003330071, 
+    0.002730153, 0.002126912, 0.001521077, 0.0009133877, 0.0003045859, 
+    -0.000304587, -0.0009133888, -0.001521078, -0.002126909, -0.002730154, 
+    -0.003330072, -0.003925933, -0.004517011, -0.005102581, -0.005681939, 
+    -0.006254375, -0.00681919, -0.007375697, -0.007923214, -0.008461086, 
+    -0.008988641, -0.00950525, -0.01001028, -0.0105031, -0.01098314, 
+    -0.01144979, -0.0119025, -0.0123407, -0.01276387, -0.01317148, 
+    -0.01356305, -0.01393809, -0.01429615, -0.0146368, -0.01495961, 
+    -0.0152642, -0.01555019, -0.01581723, -0.016065, -0.0162932, -0.01650155, 
+    -0.0166898, -0.01685771, -0.01700508, -0.01713173, -0.01723752, 
+    -0.0173223, -0.01738597, -0.01742847, -0.01744973, -0.01744973, 
+    -0.01742847, -0.01738597, -0.0173223, -0.01723752, -0.01713173, 
+    -0.01700508, -0.01685771, -0.0166898, -0.01650155, -0.0162932, -0.016065, 
+    -0.01581723, -0.01555019, -0.0152642, -0.01495961, -0.0146368, 
+    -0.01429616, -0.01393809, -0.01356305, -0.01317148, -0.01276387, 
+    -0.0123407, -0.0119025, -0.01144979, -0.01098314, -0.01050311, 
+    -0.01001028, -0.00950525, -0.008988643, -0.008461083, -0.007923216, 
+    -0.007375694, -0.006819191, -0.006254376, -0.00568194, -0.005102583, 
+    -0.004517008, -0.003925931, -0.003330074, -0.002730155, -0.002126911, 
+    -0.001521075, -0.0009133862, -0.0003045844, 0.0003045844, 0.0009133862, 
+    0.001521075, 0.002126911, 0.002730155, 0.003330074, 0.003925931, 
+    0.004517008, 0.005102583, 0.00568194, 0.006254376, 0.006819187, 
+    0.007375698, 0.007923216, 0.00846108, 0.008988643, 0.009505247, 
+    0.01001028, 0.01050311, 0.01098314, 0.01144979, 0.01190249, 0.0123407, 
+    0.01276386, 0.01317148, 0.01356305, 0.01393809, 0.01429616, 0.0146368, 
+    0.01495961, 0.0152642, 0.01555019, 0.01581723, 0.016065, 0.0162932, 
+    0.01650155, 0.0166898, 0.01685771, 0.01700508, 0.01713173, 0.01723751, 
+    0.0173223, 0.01738597, 0.01742847, 0.01744973, 0.01744973, 0.01742847, 
+    0.01738597, 0.0173223, 0.01723752, 0.01713173, 0.01700508, 0.01685771, 
+    0.0166898, 0.01650155, 0.01629321, 0.016065, 0.01581723, 0.01555019, 
+    0.0152642, 0.01495961, 0.0146368, 0.01429616, 0.01393809, 0.01356305, 
+    0.01317148, 0.01276387, 0.0123407, 0.0119025, 0.0114498, 0.01098314, 
+    0.01050311, 0.01001028, 0.00950525, 0.008988645 ;
+
+ COADSY =
+  -0.6962056, -0.6960034, -0.6958146, -0.6956394, -0.695478, -0.6953307, 
+    -0.6951976, -0.6950788, -0.6949747, -0.6948851, -0.6948103, -0.6947504, 
+    -0.6947053, -0.6946753, -0.6946602, -0.6946602, -0.6946753, -0.6947053, 
+    -0.6947504, -0.6948103, -0.6948851, -0.6949747, -0.6950788, -0.6951976, 
+    -0.6953307, -0.695478, -0.6956394, -0.6958146, -0.6960034, -0.6962056, 
+    -0.696421, -0.6966493, -0.6968902, -0.6971433, -0.6974086, -0.6976854, 
+    -0.6979737, -0.6982729, -0.6985827, -0.6989028, -0.6992328, -0.6995723, 
+    -0.6999207, -0.7002779, -0.7006431, -0.7010162, -0.7013965, -0.7017837, 
+    -0.7021772, -0.7025766, -0.7029814, -0.703391, -0.703805, -0.704223, 
+    -0.7046443, -0.7050685, -0.7054951, -0.7059235, -0.7063532, -0.7067837, 
+    -0.7072144, -0.7076449, -0.7080746, -0.708503, -0.7089296, -0.7093538, 
+    -0.7097751, -0.7101931, -0.7106071, -0.7110168, -0.7114215, -0.711821, 
+    -0.7122145, -0.7126016, -0.7129819, -0.713355, -0.7137203, -0.7140774, 
+    -0.7144259, -0.7147653, -0.7150953, -0.7154154, -0.7157252, -0.7160245, 
+    -0.7163127, -0.7165896, -0.7168548, -0.717108, -0.7173488, -0.7175771, 
+    -0.7177925, -0.7179947, -0.7181835, -0.7183588, -0.7185201, -0.7186674, 
+    -0.7188005, -0.7189193, -0.7190235, -0.7191131, -0.7191879, -0.7192478, 
+    -0.7192928, -0.7193229, -0.7193379, -0.7193379, -0.7193229, -0.7192928, 
+    -0.7192478, -0.7191879, -0.7191131, -0.7190235, -0.7189193, -0.7188005, 
+    -0.7186674, -0.7185201, -0.7183588, -0.7181835, -0.7179947, -0.7177925, 
+    -0.7175771, -0.7173489, -0.717108, -0.7168548, -0.7165896, -0.7163127, 
+    -0.7160245, -0.7157252, -0.7154154, -0.7150953, -0.7147653, -0.7144259, 
+    -0.7140774, -0.7137203, -0.713355, -0.7129819, -0.7126016, -0.7122145, 
+    -0.711821, -0.7114215, -0.7110168, -0.7106071, -0.7101931, -0.7097751, 
+    -0.7093538, -0.7089296, -0.708503, -0.7080746, -0.7076449, -0.7072144, 
+    -0.7067837, -0.7063532, -0.7059235, -0.7054951, -0.7050685, -0.7046443, 
+    -0.704223, -0.703805, -0.703391, -0.7029814, -0.7025766, -0.7021772, 
+    -0.7017837, -0.7013965, -0.7010162, -0.7006431, -0.7002779, -0.6999207, 
+    -0.6995723, -0.6992328, -0.6989028, -0.6985827, -0.6982729, -0.6979737, 
+    -0.6976854, -0.6974086, -0.6971433, -0.6968902, -0.6966493, -0.696421,
+  -0.6737705, -0.6731641, -0.6725978, -0.6720724, -0.6715885, -0.6711468, 
+    -0.6707476, -0.6703915, -0.6700791, -0.6698105, -0.6695862, -0.6694064, 
+    -0.6692713, -0.6691812, -0.6691362, -0.6691362, -0.6691812, -0.6692713, 
+    -0.6694064, -0.6695862, -0.6698105, -0.6700791, -0.6703915, -0.6707476, 
+    -0.6711468, -0.6715885, -0.6720724, -0.6725978, -0.6731641, -0.6737705, 
+    -0.6744164, -0.6751009, -0.6758232, -0.6765825, -0.6773777, -0.6782081, 
+    -0.6790724, -0.6799697, -0.6808988, -0.6818588, -0.6828483, -0.6838662, 
+    -0.6849113, -0.6859821, -0.6870776, -0.6881962, -0.6893368, -0.6904978, 
+    -0.6916778, -0.6928755, -0.6940893, -0.6953178, -0.6965595, -0.6978129, 
+    -0.6990764, -0.7003485, -0.7016276, -0.7029123, -0.7042009, -0.7054918, 
+    -0.7067835, -0.7080745, -0.709363, -0.7106477, -0.7119268, -0.713199, 
+    -0.7144625, -0.7157158, -0.7169575, -0.718186, -0.7193998, -0.7205975, 
+    -0.7217776, -0.7229385, -0.7240791, -0.7251977, -0.7262932, -0.7273641, 
+    -0.7284091, -0.729427, -0.7304165, -0.7313765, -0.7323056, -0.7332029, 
+    -0.7340673, -0.7348976, -0.7356929, -0.7364521, -0.7371745, -0.737859, 
+    -0.7385048, -0.7391112, -0.7396775, -0.7402029, -0.7406868, -0.7411286, 
+    -0.7415277, -0.7418838, -0.7421963, -0.7424648, -0.7426891, -0.7428689, 
+    -0.743004, -0.7430941, -0.7431391, -0.7431391, -0.7430941, -0.743004, 
+    -0.7428689, -0.7426891, -0.7424648, -0.7421963, -0.7418838, -0.7415277, 
+    -0.7411286, -0.7406868, -0.7402029, -0.7396775, -0.7391112, -0.7385048, 
+    -0.737859, -0.7371745, -0.7364521, -0.7356929, -0.7348976, -0.7340673, 
+    -0.7332029, -0.7323056, -0.7313765, -0.7304165, -0.729427, -0.7284091, 
+    -0.7273641, -0.7262932, -0.7251977, -0.7240791, -0.7229385, -0.7217776, 
+    -0.7205975, -0.7193998, -0.718186, -0.7169575, -0.7157158, -0.7144625, 
+    -0.713199, -0.7119269, -0.7106477, -0.709363, -0.7080745, -0.7067835, 
+    -0.7054918, -0.7042009, -0.7029123, -0.7016276, -0.7003485, -0.6990764, 
+    -0.6978129, -0.6965595, -0.6953178, -0.6940893, -0.6928755, -0.6916778, 
+    -0.6904978, -0.6893368, -0.6881962, -0.6870776, -0.6859821, -0.6849113, 
+    -0.6838662, -0.6828483, -0.6818588, -0.6808988, -0.6799697, -0.6790724, 
+    -0.6782081, -0.6773777, -0.6765825, -0.6758232, -0.6751009, -0.6744164,
+  -0.6505146, -0.6495047, -0.6485617, -0.6476867, -0.6468809, -0.6461452, 
+    -0.6454805, -0.6448875, -0.6443671, -0.6439199, -0.6435463, -0.6432469, 
+    -0.6430221, -0.642872, -0.642797, -0.642797, -0.642872, -0.6430221, 
+    -0.6432469, -0.6435463, -0.6439199, -0.6443671, -0.6448875, -0.6454805, 
+    -0.6461452, -0.6468809, -0.6476867, -0.6485617, -0.6495047, -0.6505146, 
+    -0.6515901, -0.65273, -0.6539329, -0.6551974, -0.6565217, -0.6579044, 
+    -0.6593438, -0.6608381, -0.6623855, -0.6639841, -0.665632, -0.6673271, 
+    -0.6690674, -0.6708508, -0.672675, -0.674538, -0.6764373, -0.6783707, 
+    -0.6803359, -0.6823304, -0.6843518, -0.6863976, -0.6884654, -0.6905527, 
+    -0.6926568, -0.6947752, -0.6969054, -0.6990448, -0.7011907, -0.7033405, 
+    -0.7054916, -0.7076414, -0.7097873, -0.7119266, -0.7140568, -0.7161753, 
+    -0.7182794, -0.7203667, -0.7224345, -0.7244803, -0.7265017, -0.7284962, 
+    -0.7304614, -0.7323948, -0.7342941, -0.7361571, -0.7379813, -0.7397647, 
+    -0.741505, -0.7432001, -0.744848, -0.7464465, -0.7479939, -0.7494882, 
+    -0.7509276, -0.7523103, -0.7536347, -0.7548991, -0.756102, -0.757242, 
+    -0.7583175, -0.7593274, -0.7602704, -0.7611454, -0.7619511, -0.7626869, 
+    -0.7633516, -0.7639446, -0.764465, -0.7649122, -0.7652857, -0.7655851, 
+    -0.76581, -0.76596, -0.7660351, -0.7660351, -0.76596, -0.76581, 
+    -0.7655851, -0.7652857, -0.7649122, -0.764465, -0.7639446, -0.7633516, 
+    -0.7626869, -0.7619511, -0.7611454, -0.7602704, -0.7593274, -0.7583175, 
+    -0.757242, -0.756102, -0.7548991, -0.7536347, -0.7523103, -0.7509276, 
+    -0.7494882, -0.7479939, -0.7464465, -0.744848, -0.7432001, -0.741505, 
+    -0.7397647, -0.7379813, -0.7361571, -0.7342941, -0.7323948, -0.7304614, 
+    -0.7284962, -0.7265017, -0.7244803, -0.7224345, -0.7203667, -0.7182794, 
+    -0.7161753, -0.7140568, -0.7119266, -0.7097873, -0.7076414, -0.7054916, 
+    -0.7033405, -0.7011907, -0.6990448, -0.6969054, -0.6947752, -0.6926568, 
+    -0.6905527, -0.6884654, -0.6863976, -0.6843518, -0.6823304, -0.6803359, 
+    -0.6783707, -0.6764373, -0.674538, -0.672675, -0.6708508, -0.6690674, 
+    -0.6673271, -0.665632, -0.6639841, -0.6623855, -0.6608381, -0.6593438, 
+    -0.6579044, -0.6565217, -0.6551974, -0.653933, -0.65273, -0.6515902,
+  -0.6264661, -0.6250539, -0.6237354, -0.622512, -0.6213852, -0.6203564, 
+    -0.6194269, -0.6185978, -0.6178702, -0.6172448, -0.6167225, -0.6163038, 
+    -0.6159894, -0.6157796, -0.6156746, -0.6156746, -0.6157796, -0.6159894, 
+    -0.6163038, -0.6167225, -0.6172448, -0.6178702, -0.6185978, -0.6194269, 
+    -0.6203564, -0.6213852, -0.622512, -0.6237354, -0.6250539, -0.6264661, 
+    -0.62797, -0.629564, -0.631246, -0.633014, -0.6348659, -0.6367993, 
+    -0.6388119, -0.6409014, -0.6430652, -0.6453004, -0.6476046, -0.6499749, 
+    -0.6524084, -0.654902, -0.6574529, -0.6600578, -0.6627136, -0.6654171, 
+    -0.668165, -0.6709539, -0.6737804, -0.6766411, -0.6795325, -0.6824511, 
+    -0.6853932, -0.6883554, -0.6913341, -0.6943255, -0.6973261, -0.7003322, 
+    -0.7033401, -0.7063462, -0.7093467, -0.7123381, -0.7153168, -0.718279, 
+    -0.7212212, -0.7241398, -0.7270311, -0.7298918, -0.7327183, -0.7355072, 
+    -0.7382551, -0.7409586, -0.7436144, -0.7462193, -0.7487702, -0.7512639, 
+    -0.7536973, -0.7560676, -0.7583718, -0.7606071, -0.7627708, -0.7648602, 
+    -0.7668729, -0.7688063, -0.7706583, -0.7724262, -0.7741082, -0.7757022, 
+    -0.7772061, -0.7786183, -0.7799369, -0.7811602, -0.7822871, -0.7833158, 
+    -0.7842453, -0.7850744, -0.7858021, -0.7864274, -0.7869498, -0.7873684, 
+    -0.7876828, -0.7878926, -0.7879976, -0.7879976, -0.7878926, -0.7876828, 
+    -0.7873684, -0.7869498, -0.7864274, -0.7858021, -0.7850744, -0.7842453, 
+    -0.7833158, -0.7822871, -0.7811603, -0.7799369, -0.7786183, -0.7772061, 
+    -0.7757022, -0.7741082, -0.7724262, -0.7706583, -0.7688063, -0.7668729, 
+    -0.7648603, -0.7627708, -0.7606071, -0.7583717, -0.7560676, -0.7536973, 
+    -0.7512639, -0.7487702, -0.7462193, -0.7436144, -0.7409586, -0.7382551, 
+    -0.7355072, -0.7327183, -0.7298918, -0.7270311, -0.7241398, -0.7212212, 
+    -0.718279, -0.7153168, -0.7123381, -0.7093467, -0.7063462, -0.7033401, 
+    -0.7003322, -0.6973261, -0.6943255, -0.6913341, -0.6883554, -0.6853932, 
+    -0.682451, -0.6795325, -0.6766411, -0.6737804, -0.6709539, -0.668165, 
+    -0.6654171, -0.6627136, -0.6600578, -0.6574529, -0.654902, -0.6524084, 
+    -0.6499749, -0.6476046, -0.6453004, -0.6430652, -0.6409014, -0.6388119, 
+    -0.6367993, -0.6348658, -0.633014, -0.631246, -0.629564, -0.62797,
+  -0.6016543, -0.5998417, -0.5981491, -0.5965787, -0.5951324, -0.5938118, 
+    -0.5926186, -0.5915544, -0.5906203, -0.5898176, -0.5891472, -0.5886098, 
+    -0.5882062, -0.5879369, -0.5878021, -0.5878021, -0.5879369, -0.5882062, 
+    -0.5886098, -0.5891472, -0.5898176, -0.5906203, -0.5915544, -0.5926186, 
+    -0.5938118, -0.5951324, -0.5965787, -0.5981491, -0.5998417, -0.6016543, 
+    -0.6035848, -0.6056309, -0.6077899, -0.6100594, -0.6124365, -0.6149183, 
+    -0.6175018, -0.6201839, -0.6229613, -0.6258306, -0.6287883, -0.6318309, 
+    -0.6349545, -0.6381554, -0.6414298, -0.6447735, -0.6481826, -0.6516529, 
+    -0.6551801, -0.65876, -0.6623881, -0.6660602, -0.6697717, -0.673518, 
+    -0.6772947, -0.681097, -0.6849205, -0.6887603, -0.6926119, -0.6964706, 
+    -0.7003317, -0.7041903, -0.708042, -0.7118819, -0.7157053, -0.7195076, 
+    -0.7232843, -0.7270306, -0.7307421, -0.7344142, -0.7380424, -0.7416222, 
+    -0.7451494, -0.7486197, -0.7520288, -0.7553726, -0.7586469, -0.7618478, 
+    -0.7649714, -0.768014, -0.7709717, -0.773841, -0.7766184, -0.7793005, 
+    -0.781884, -0.7843658, -0.7867429, -0.7890124, -0.7911714, -0.7932175, 
+    -0.795148, -0.7969607, -0.7986532, -0.8002236, -0.80167, -0.8029906, 
+    -0.8041837, -0.8052479, -0.806182, -0.8069847, -0.8076552, -0.8081925, 
+    -0.8085961, -0.8088654, -0.8090002, -0.8090002, -0.8088654, -0.8085961, 
+    -0.8081925, -0.8076552, -0.8069847, -0.806182, -0.8052479, -0.8041837, 
+    -0.8029906, -0.80167, -0.8002236, -0.7986532, -0.7969607, -0.795148, 
+    -0.7932175, -0.7911714, -0.7890124, -0.7867429, -0.7843658, -0.781884, 
+    -0.7793005, -0.7766184, -0.773841, -0.7709717, -0.768014, -0.7649715, 
+    -0.7618478, -0.7586469, -0.7553725, -0.7520288, -0.7486197, -0.7451494, 
+    -0.7416223, -0.7380424, -0.7344142, -0.7307421, -0.7270306, -0.7232844, 
+    -0.7195076, -0.7157053, -0.7118818, -0.708042, -0.7041904, -0.7003317, 
+    -0.6964707, -0.6926119, -0.6887603, -0.6849204, -0.681097, -0.6772947, 
+    -0.673518, -0.6697717, -0.6660602, -0.6623881, -0.65876, -0.6551801, 
+    -0.6516529, -0.6481826, -0.6447735, -0.6414297, -0.6381554, -0.6349545, 
+    -0.6318308, -0.6287884, -0.6258306, -0.6229613, -0.6201839, -0.6175018, 
+    -0.6149183, -0.6124365, -0.6100594, -0.6077899, -0.6056309, -0.6035848,
+  -0.5761095, -0.5738985, -0.571834, -0.5699185, -0.5681543, -0.5665436, 
+    -0.5650883, -0.5637902, -0.5626509, -0.5616717, -0.560854, -0.5601985, 
+    -0.5597063, -0.5593778, -0.5592134, -0.5592134, -0.5593778, -0.5597063, 
+    -0.5601985, -0.560854, -0.5616717, -0.5626509, -0.5637902, -0.5650883, 
+    -0.5665436, -0.5681543, -0.5699185, -0.571834, -0.5738985, -0.5761095, 
+    -0.5784642, -0.5809598, -0.5835933, -0.5863614, -0.5892609, -0.592288, 
+    -0.5954393, -0.5987107, -0.6020984, -0.6055982, -0.6092058, -0.6129169, 
+    -0.6167269, -0.6206312, -0.6246251, -0.6287035, -0.6328617, -0.6370946, 
+    -0.6413968, -0.6457634, -0.6501888, -0.6546677, -0.6591948, -0.6637643, 
+    -0.6683708, -0.6730087, -0.6776723, -0.682356, -0.6870539, -0.6917605, 
+    -0.69647, -0.7011765, -0.7058745, -0.7105581, -0.7152217, -0.7198596, 
+    -0.7244661, -0.7290357, -0.7335627, -0.7380416, -0.742467, -0.7468336, 
+    -0.7511359, -0.7553687, -0.7595269, -0.7636054, -0.7675992, -0.7715035, 
+    -0.7753136, -0.7790246, -0.7826323, -0.786132, -0.7895197, -0.7927912, 
+    -0.7959424, -0.7989696, -0.801869, -0.8046371, -0.8072706, -0.8097663, 
+    -0.812121, -0.8143319, -0.8163964, -0.8183119, -0.8200761, -0.8216868, 
+    -0.8231421, -0.8244402, -0.8255795, -0.8265587, -0.8273765, -0.8280319, 
+    -0.8285242, -0.8288527, -0.829017, -0.829017, -0.8288527, -0.8285242, 
+    -0.8280319, -0.8273765, -0.8265587, -0.8255795, -0.8244402, -0.8231421, 
+    -0.8216868, -0.8200761, -0.8183119, -0.8163964, -0.8143319, -0.812121, 
+    -0.8097663, -0.8072706, -0.8046371, -0.801869, -0.7989696, -0.7959424, 
+    -0.7927912, -0.7895197, -0.7861321, -0.7826322, -0.7790246, -0.7753136, 
+    -0.7715035, -0.7675992, -0.7636054, -0.7595269, -0.7553686, -0.7511359, 
+    -0.7468336, -0.742467, -0.7380416, -0.7335627, -0.7290357, -0.7244662, 
+    -0.7198596, -0.7152218, -0.7105581, -0.7058745, -0.7011765, -0.69647, 
+    -0.6917605, -0.6870539, -0.682356, -0.6776723, -0.6730087, -0.6683708, 
+    -0.6637643, -0.6591948, -0.6546677, -0.6501888, -0.6457634, -0.6413968, 
+    -0.6370946, -0.6328617, -0.6287036, -0.624625, -0.6206312, -0.6167269, 
+    -0.6129169, -0.6092058, -0.6055982, -0.6020984, -0.5987107, -0.5954393, 
+    -0.592288, -0.5892608, -0.5863614, -0.5835933, -0.5809598, -0.5784642,
+  -0.5498628, -0.5472562, -0.5448223, -0.5425641, -0.5404842, -0.5385853, 
+    -0.5368696, -0.5353392, -0.5339961, -0.5328417, -0.5318776, -0.5311049, 
+    -0.5305246, -0.5301372, -0.5299435, -0.5299435, -0.5301372, -0.5305246, 
+    -0.5311049, -0.5318776, -0.5328417, -0.5339961, -0.5353392, -0.5368696, 
+    -0.5385853, -0.5404842, -0.5425641, -0.5448223, -0.5472562, -0.5498628, 
+    -0.5526389, -0.555581, -0.5586857, -0.5619492, -0.5653675, -0.5689362, 
+    -0.5726513, -0.5765082, -0.580502, -0.584628, -0.5888812, -0.5932564, 
+    -0.5977481, -0.602351, -0.6070595, -0.6118677, -0.61677, -0.6217601, 
+    -0.6268322, -0.6319801, -0.6371974, -0.6424778, -0.6478148, -0.653202, 
+    -0.6586328, -0.6641005, -0.6695986, -0.6751203, -0.6806589, -0.6862076, 
+    -0.6917597, -0.6973085, -0.7028471, -0.7083688, -0.7138668, -0.7193346, 
+    -0.7247654, -0.7301526, -0.7354896, -0.74077, -0.7459872, -0.7511351, 
+    -0.7562072, -0.7611974, -0.7660996, -0.7709079, -0.7756163, -0.7802193, 
+    -0.784711, -0.7890862, -0.7933393, -0.7974653, -0.8014592, -0.805316, 
+    -0.8090311, -0.8126, -0.8160182, -0.8192816, -0.8223863, -0.8253285, 
+    -0.8281046, -0.8307111, -0.833145, -0.8354032, -0.8374831, -0.8393821, 
+    -0.8410977, -0.8426281, -0.8439713, -0.8451256, -0.8460897, -0.8468624, 
+    -0.8474428, -0.8478301, -0.8480239, -0.8480239, -0.8478301, -0.8474428, 
+    -0.8468624, -0.8460897, -0.8451256, -0.8439713, -0.8426281, -0.8410977, 
+    -0.8393821, -0.8374831, -0.8354033, -0.833145, -0.8307111, -0.8281046, 
+    -0.8253285, -0.8223863, -0.8192816, -0.8160182, -0.8125999, -0.8090311, 
+    -0.805316, -0.8014592, -0.7974654, -0.7933393, -0.7890862, -0.7847111, 
+    -0.7802193, -0.7756164, -0.7709079, -0.7660996, -0.7611974, -0.7562072, 
+    -0.7511351, -0.7459872, -0.74077, -0.7354896, -0.7301526, -0.7247654, 
+    -0.7193346, -0.7138668, -0.7083687, -0.7028471, -0.6973085, -0.6917597, 
+    -0.6862077, -0.6806589, -0.6751203, -0.6695986, -0.6641005, -0.6586328, 
+    -0.6532019, -0.6478148, -0.6424778, -0.6371974, -0.6319801, -0.6268322, 
+    -0.6217602, -0.6167699, -0.6118677, -0.6070594, -0.602351, -0.5977481, 
+    -0.5932563, -0.5888812, -0.584628, -0.580502, -0.5765082, -0.5726513, 
+    -0.5689362, -0.5653674, -0.5619492, -0.5586858, -0.555581, -0.5526389,
+  -0.5229461, -0.5199471, -0.5171468, -0.5145485, -0.5121555, -0.5099707, 
+    -0.5079967, -0.506236, -0.5046905, -0.5033624, -0.5022531, -0.5013641, 
+    -0.5006964, -0.5002508, -0.5000278, -0.5000278, -0.5002508, -0.5006964, 
+    -0.5013641, -0.5022531, -0.5033624, -0.5046905, -0.506236, -0.5079967, 
+    -0.5099707, -0.5121555, -0.5145485, -0.5171468, -0.5199471, -0.5229461, 
+    -0.5261402, -0.5295253, -0.5330974, -0.5368522, -0.5407851, -0.5448912, 
+    -0.5491656, -0.5536031, -0.5581983, -0.5629455, -0.567839, -0.5728729, 
+    -0.5780409, -0.5833368, -0.5887542, -0.5942863, -0.5999267, -0.6056681, 
+    -0.6115039, -0.6174268, -0.6234295, -0.6295049, -0.6356455, -0.6418438, 
+    -0.6480922, -0.6543832, -0.660709, -0.667062, -0.6734345, -0.6798186, 
+    -0.6862067, -0.6925908, -0.6989633, -0.7053163, -0.7116421, -0.7179331, 
+    -0.7241816, -0.7303798, -0.7365204, -0.7425958, -0.7485986, -0.7545214, 
+    -0.7603572, -0.7660987, -0.771739, -0.7772712, -0.7826885, -0.7879844, 
+    -0.7931525, -0.7981863, -0.8030798, -0.807827, -0.8124222, -0.8168597, 
+    -0.8211341, -0.8252403, -0.8291731, -0.8329279, -0.8365, -0.8398852, 
+    -0.8430792, -0.8460782, -0.8488785, -0.8514768, -0.8538697, -0.8560546, 
+    -0.8580286, -0.8597894, -0.8613348, -0.8626629, -0.8637722, -0.8646612, 
+    -0.865329, -0.8657746, -0.8659976, -0.8659976, -0.8657746, -0.865329, 
+    -0.8646612, -0.8637722, -0.8626629, -0.8613348, -0.8597894, -0.8580286, 
+    -0.8560546, -0.8538697, -0.8514768, -0.8488785, -0.8460782, -0.8430792, 
+    -0.8398852, -0.8365, -0.8329279, -0.8291731, -0.8252403, -0.8211341, 
+    -0.8168597, -0.8124222, -0.8078271, -0.8030798, -0.7981863, -0.7931525, 
+    -0.7879844, -0.7826886, -0.7772712, -0.771739, -0.7660987, -0.7603572, 
+    -0.7545215, -0.7485986, -0.7425958, -0.7365203, -0.7303798, -0.7241816, 
+    -0.7179331, -0.7116422, -0.7053163, -0.6989633, -0.6925908, -0.6862067, 
+    -0.6798187, -0.6734345, -0.667062, -0.660709, -0.6543832, -0.6480922, 
+    -0.6418437, -0.6356455, -0.6295049, -0.6234295, -0.6174268, -0.6115039, 
+    -0.6056682, -0.5999266, -0.5942863, -0.5887541, -0.5833368, -0.5780409, 
+    -0.5728728, -0.567839, -0.5629455, -0.5581983, -0.5536032, -0.5491656, 
+    -0.5448912, -0.5407851, -0.5368522, -0.5330974, -0.5295253, -0.5261402,
+  -0.4953924, -0.4920046, -0.4888412, -0.4859062, -0.4832029, -0.4807349, 
+    -0.478505, -0.4765159, -0.4747702, -0.4732699, -0.4720168, -0.4710125, 
+    -0.4702582, -0.4697548, -0.469503, -0.469503, -0.4697548, -0.4702582, 
+    -0.4710125, -0.4720168, -0.4732699, -0.4747702, -0.4765159, -0.478505, 
+    -0.4807349, -0.4832029, -0.4859062, -0.4888412, -0.4920046, -0.4953924, 
+    -0.4990005, -0.5028244, -0.5068597, -0.5111012, -0.5155439, -0.5201824, 
+    -0.5250109, -0.5300237, -0.5352145, -0.5405772, -0.546105, -0.5517915, 
+    -0.5576295, -0.5636119, -0.5697316, -0.575981, -0.5823525, -0.5888383, 
+    -0.5954306, -0.6021213, -0.6089022, -0.6157652, -0.6227018, -0.6297036, 
+    -0.6367621, -0.6438686, -0.6510146, -0.6581912, -0.6653897, -0.6726015, 
+    -0.6798176, -0.6870294, -0.694228, -0.7014046, -0.7085505, -0.7156571, 
+    -0.7227155, -0.7297173, -0.7366539, -0.7435169, -0.7502978, -0.7569885, 
+    -0.7635809, -0.7700667, -0.7764382, -0.7826875, -0.7888072, -0.7947897, 
+    -0.8006276, -0.8063141, -0.811842, -0.8172046, -0.8223954, -0.8274082, 
+    -0.8322368, -0.8368752, -0.841318, -0.8455595, -0.8495947, -0.8534187, 
+    -0.8570268, -0.8604145, -0.8635779, -0.866513, -0.8692162, -0.8716843, 
+    -0.8739142, -0.8759032, -0.8776489, -0.8791493, -0.8804023, -0.8814067, 
+    -0.882161, -0.8826643, -0.8829162, -0.8829162, -0.8826643, -0.882161, 
+    -0.8814067, -0.8804023, -0.8791493, -0.8776489, -0.8759032, -0.8739142, 
+    -0.8716843, -0.8692162, -0.866513, -0.8635778, -0.8604145, -0.8570268, 
+    -0.8534187, -0.8495947, -0.8455595, -0.841318, -0.8368752, -0.8322368, 
+    -0.8274083, -0.8223954, -0.8172046, -0.8118419, -0.8063141, -0.8006277, 
+    -0.7947897, -0.7888072, -0.7826875, -0.7764382, -0.7700666, -0.7635809, 
+    -0.7569886, -0.7502978, -0.7435169, -0.7366539, -0.7297173, -0.7227156, 
+    -0.7156571, -0.7085506, -0.7014046, -0.694228, -0.6870295, -0.6798176, 
+    -0.6726015, -0.6653897, -0.6581912, -0.6510145, -0.6438686, -0.6367621, 
+    -0.6297036, -0.6227018, -0.6157652, -0.6089022, -0.6021214, -0.5954306, 
+    -0.5888383, -0.5823524, -0.575981, -0.5697315, -0.5636119, -0.5576295, 
+    -0.5517915, -0.5461051, -0.5405772, -0.5352145, -0.5300237, -0.5250109, 
+    -0.5201824, -0.5155439, -0.5111012, -0.5068597, -0.5028244, -0.4990005,
+  -0.4672351, -0.4634627, -0.4599401, -0.4566718, -0.4536617, -0.4509134, 
+    -0.4484303, -0.4462154, -0.4442714, -0.4426008, -0.4412054, -0.4400871, 
+    -0.4392471, -0.4386866, -0.4384062, -0.4384062, -0.4386866, -0.4392472, 
+    -0.4400871, -0.4412054, -0.4426008, -0.4442714, -0.4462154, -0.4484302, 
+    -0.4509134, -0.4536617, -0.4566718, -0.4599401, -0.4634627, -0.4672351, 
+    -0.4712529, -0.475511, -0.4800044, -0.4847275, -0.4896747, -0.4948398, 
+    -0.5002165, -0.5057985, -0.5115787, -0.5175503, -0.5237058, -0.5300379, 
+    -0.5365387, -0.5432004, -0.5500149, -0.5569738, -0.5640688, -0.571291, 
+    -0.5786318, -0.5860822, -0.5936331, -0.6012752, -0.6089994, -0.6167963, 
+    -0.6246561, -0.6325696, -0.6405268, -0.6485183, -0.6565342, -0.6645648, 
+    -0.6726003, -0.6806309, -0.6886468, -0.6966383, -0.7045956, -0.712509, 
+    -0.7203689, -0.7281657, -0.7358899, -0.7435321, -0.751083, -0.7585333, 
+    -0.7658741, -0.7730964, -0.7801913, -0.7871503, -0.7939647, -0.8006264, 
+    -0.8071272, -0.8134593, -0.8196149, -0.8255864, -0.8313666, -0.8369485, 
+    -0.8423253, -0.8474904, -0.8524376, -0.8571607, -0.8616541, -0.8659123, 
+    -0.86993, -0.8737025, -0.877225, -0.8804933, -0.8835034, -0.8862517, 
+    -0.8887349, -0.8909497, -0.8928937, -0.8945644, -0.8959597, -0.897078, 
+    -0.897918, -0.8984785, -0.8987589, -0.8987589, -0.8984785, -0.897918, 
+    -0.897078, -0.8959597, -0.8945644, -0.8928937, -0.8909497, -0.8887349, 
+    -0.8862517, -0.8835034, -0.8804933, -0.8772249, -0.8737025, -0.86993, 
+    -0.8659123, -0.8616542, -0.8571607, -0.8524376, -0.8474904, -0.8423253, 
+    -0.8369486, -0.8313666, -0.8255864, -0.8196148, -0.8134593, -0.8071273, 
+    -0.8006264, -0.7939647, -0.7871502, -0.7801913, -0.7730963, -0.7658741, 
+    -0.7585334, -0.751083, -0.7435321, -0.7358899, -0.7281657, -0.7203689, 
+    -0.712509, -0.7045956, -0.6966382, -0.6886468, -0.680631, -0.6726003, 
+    -0.6645648, -0.6565342, -0.6485183, -0.6405268, -0.6325696, -0.6246562, 
+    -0.6167963, -0.6089995, -0.6012752, -0.5936331, -0.5860822, -0.5786318, 
+    -0.571291, -0.5640687, -0.5569739, -0.5500149, -0.5432004, -0.5365387, 
+    -0.5300378, -0.5237058, -0.5175502, -0.5115787, -0.5057985, -0.5002165, 
+    -0.4948398, -0.4896747, -0.4847275, -0.4800044, -0.475511, -0.4712529,
+  -0.4385085, -0.434356, -0.4304786, -0.426881, -0.4235676, -0.4205424, 
+    -0.4178091, -0.4153711, -0.4132313, -0.4113923, -0.4098564, -0.4086254, 
+    -0.4077008, -0.4070838, -0.4067751, -0.4067751, -0.4070838, -0.4077008, 
+    -0.4086254, -0.4098564, -0.4113923, -0.4132313, -0.4153711, -0.4178091, 
+    -0.4205424, -0.4235676, -0.426881, -0.4304786, -0.434356, -0.4385085, 
+    -0.442931, -0.4476182, -0.4525642, -0.4577632, -0.4632088, -0.4688942, 
+    -0.4748127, -0.480957, -0.4873196, -0.4938927, -0.5006684, -0.5076385, 
+    -0.5147942, -0.522127, -0.529628, -0.5372881, -0.5450978, -0.5530477, 
+    -0.561128, -0.569329, -0.5776406, -0.5860527, -0.5945551, -0.6031374, 
+    -0.6117891, -0.6204998, -0.6292588, -0.6380554, -0.6468788, -0.6557184, 
+    -0.6645635, -0.6734031, -0.6822267, -0.6910232, -0.6997821, -0.7084928, 
+    -0.7171446, -0.7257269, -0.7342293, -0.7426414, -0.750953, -0.759154, 
+    -0.7672343, -0.7751842, -0.7829939, -0.7906539, -0.798155, -0.8054878, 
+    -0.8126436, -0.8196136, -0.8263893, -0.8329624, -0.839325, -0.8454692, 
+    -0.8513877, -0.8570732, -0.8625188, -0.8677177, -0.8726639, -0.877351, 
+    -0.8817735, -0.885926, -0.8898034, -0.893401, -0.8967144, -0.8997396, 
+    -0.9024729, -0.9049109, -0.9070507, -0.9088897, -0.9104256, -0.9116566, 
+    -0.9125811, -0.9131981, -0.9135069, -0.9135069, -0.9131981, -0.9125811, 
+    -0.9116566, -0.9104256, -0.9088897, -0.9070507, -0.9049109, -0.9024729, 
+    -0.8997396, -0.8967144, -0.893401, -0.8898034, -0.885926, -0.8817735, 
+    -0.877351, -0.8726639, -0.8677177, -0.8625188, -0.8570732, -0.8513877, 
+    -0.8454693, -0.839325, -0.8329624, -0.8263892, -0.8196136, -0.8126436, 
+    -0.8054878, -0.798155, -0.7906539, -0.7829939, -0.7751842, -0.7672343, 
+    -0.759154, -0.750953, -0.7426414, -0.7342292, -0.7257269, -0.7171447, 
+    -0.7084928, -0.6997822, -0.6910232, -0.6822267, -0.6734032, -0.6645635, 
+    -0.6557185, -0.6468788, -0.6380554, -0.6292587, -0.6204998, -0.6117892, 
+    -0.6031374, -0.5945551, -0.5860527, -0.5776406, -0.569329, -0.561128, 
+    -0.5530477, -0.5450978, -0.5372881, -0.529628, -0.522127, -0.5147942, 
+    -0.5076384, -0.5006684, -0.4938927, -0.4873196, -0.480957, -0.4748127, 
+    -0.4688942, -0.4632087, -0.4577632, -0.4525643, -0.4476182, -0.442931,
+  -0.4092477, -0.4047202, -0.4004926, -0.3965701, -0.3929575, -0.3896591, 
+    -0.386679, -0.3840208, -0.3816878, -0.3796827, -0.3780081, -0.3766659, 
+    -0.3756579, -0.3749852, -0.3746486, -0.3746486, -0.3749852, -0.3756579, 
+    -0.3766659, -0.3780081, -0.3796827, -0.3816878, -0.3840208, -0.386679, 
+    -0.3896591, -0.3929575, -0.3965701, -0.4004926, -0.4047202, -0.4092477, 
+    -0.4140696, -0.41918, -0.4245728, -0.4302412, -0.4361786, -0.4423774, 
+    -0.4488304, -0.4555296, -0.4624668, -0.4696335, -0.4770211, -0.4846205, 
+    -0.4924225, -0.5004176, -0.508596, -0.5169477, -0.5254627, -0.5341305, 
+    -0.5429406, -0.5518821, -0.5609444, -0.5701162, -0.5793864, -0.5887437, 
+    -0.5981768, -0.6076741, -0.6172241, -0.6268151, -0.6364353, -0.6460733, 
+    -0.6557171, -0.665355, -0.6749753, -0.6845663, -0.6941162, -0.7036135, 
+    -0.7130466, -0.7224039, -0.7316742, -0.740846, -0.7499081, -0.7588497, 
+    -0.7676598, -0.7763276, -0.7848426, -0.7931944, -0.8013728, -0.8093678, 
+    -0.8171698, -0.8247693, -0.8321569, -0.8393236, -0.8462607, -0.8529599, 
+    -0.8594129, -0.8656118, -0.8715491, -0.8772176, -0.8826103, -0.8877208, 
+    -0.8925427, -0.8970702, -0.9012977, -0.9052202, -0.9088328, -0.9121312, 
+    -0.9151113, -0.9177696, -0.9201026, -0.9221076, -0.9237822, -0.9251244, 
+    -0.9261324, -0.9268052, -0.9271418, -0.9271418, -0.9268052, -0.9261324, 
+    -0.9251244, -0.9237822, -0.9221076, -0.9201026, -0.9177696, -0.9151113, 
+    -0.9121312, -0.9088328, -0.9052203, -0.9012977, -0.8970702, -0.8925427, 
+    -0.8877208, -0.8826104, -0.8772176, -0.8715491, -0.8656118, -0.8594129, 
+    -0.8529599, -0.8462607, -0.8393236, -0.8321568, -0.8247693, -0.8171699, 
+    -0.8093678, -0.8013728, -0.7931943, -0.7848426, -0.7763276, -0.7676598, 
+    -0.7588498, -0.7499081, -0.740846, -0.7316741, -0.7224039, -0.7130467, 
+    -0.7036135, -0.6941163, -0.6845663, -0.6749753, -0.6653551, -0.6557171, 
+    -0.6460733, -0.6364353, -0.6268151, -0.617224, -0.6076741, -0.5981769, 
+    -0.5887437, -0.5793865, -0.5701162, -0.5609444, -0.5518823, -0.5429406, 
+    -0.5341306, -0.5254627, -0.5169478, -0.5085959, -0.5004176, -0.4924226, 
+    -0.4846205, -0.4770211, -0.4696335, -0.4624668, -0.4555296, -0.4488304, 
+    -0.4423775, -0.4361785, -0.4302413, -0.4245728, -0.41918, -0.4140696,
+  -0.3794883, -0.3745914, -0.3700188, -0.3657762, -0.3618687, -0.3583012, 
+    -0.3550779, -0.3522027, -0.3496793, -0.3475106, -0.3456993, -0.3442476, 
+    -0.3431573, -0.3424297, -0.3420657, -0.3420657, -0.3424297, -0.3431573, 
+    -0.3442476, -0.3456993, -0.3475106, -0.3496793, -0.3522027, -0.3550779, 
+    -0.3583012, -0.3618687, -0.3657762, -0.3700188, -0.3745913, -0.3794883, 
+    -0.3847037, -0.3902313, -0.3960641, -0.4021951, -0.408617, -0.4153218, 
+    -0.4223014, -0.4295473, -0.4370506, -0.4448022, -0.4527926, -0.4610123, 
+    -0.469451, -0.4780985, -0.4869444, -0.4959777, -0.5051876, -0.5145627, 
+    -0.5240918, -0.5337631, -0.5435649, -0.5534851, -0.5635118, -0.5736329, 
+    -0.5838357, -0.5941081, -0.6044374, -0.6148111, -0.6252165, -0.635641, 
+    -0.6460718, -0.6564963, -0.6669017, -0.6772754, -0.6876047, -0.697877, 
+    -0.7080799, -0.7182009, -0.7282277, -0.738148, -0.7479497, -0.757621, 
+    -0.76715, -0.7765252, -0.7857351, -0.7947685, -0.8036143, -0.8122618, 
+    -0.8207005, -0.8289201, -0.8369106, -0.8446622, -0.8521655, -0.8594114, 
+    -0.8663909, -0.8730958, -0.8795176, -0.8856487, -0.8914815, -0.897009, 
+    -0.9022244, -0.9071214, -0.911694, -0.9159366, -0.919844, -0.9234116, 
+    -0.9266349, -0.92951, -0.9320334, -0.9342021, -0.9360135, -0.9374651, 
+    -0.9385555, -0.9392831, -0.9396471, -0.9396471, -0.9392831, -0.9385555, 
+    -0.9374651, -0.9360135, -0.9342021, -0.9320334, -0.92951, -0.9266349, 
+    -0.9234116, -0.919844, -0.9159366, -0.9116939, -0.9071214, -0.9022245, 
+    -0.897009, -0.8914816, -0.8856487, -0.8795176, -0.8730958, -0.8663909, 
+    -0.8594114, -0.8521655, -0.8446622, -0.8369105, -0.8289201, -0.8207006, 
+    -0.8122618, -0.8036143, -0.7947684, -0.7857351, -0.7765251, -0.76715, 
+    -0.757621, -0.7479497, -0.738148, -0.7282276, -0.7182009, -0.70808, 
+    -0.697877, -0.6876047, -0.6772753, -0.6669017, -0.6564963, -0.6460718, 
+    -0.635641, -0.6252165, -0.6148111, -0.6044374, -0.5941081, -0.5838358, 
+    -0.5736328, -0.5635119, -0.5534851, -0.5435649, -0.5337631, -0.5240918, 
+    -0.5145628, -0.5051875, -0.4959777, -0.4869443, -0.4780985, -0.469451, 
+    -0.4610122, -0.4527927, -0.4448021, -0.4370506, -0.4295473, -0.4223014, 
+    -0.4153218, -0.408617, -0.4021952, -0.3960641, -0.3902313, -0.3847038,
+  -0.3492666, -0.3440061, -0.339094, -0.3345365, -0.330339, -0.3265066, 
+    -0.3230441, -0.3199555, -0.3172447, -0.314915, -0.3129693, -0.3114098, 
+    -0.3102386, -0.3094569, -0.3090659, -0.3090659, -0.3094569, -0.3102386, 
+    -0.3114098, -0.3129693, -0.314915, -0.3172447, -0.3199555, -0.323044, 
+    -0.3265066, -0.330339, -0.3345365, -0.3390941, -0.344006, -0.3492666, 
+    -0.3548691, -0.3608069, -0.3670728, -0.373659, -0.3805576, -0.38776, 
+    -0.3952578, -0.4030415, -0.4111018, -0.4194289, -0.4280124, -0.4368423, 
+    -0.4459074, -0.4551969, -0.4646994, -0.4744033, -0.4842969, -0.4943679, 
+    -0.5046043, -0.5149935, -0.5255229, -0.5361797, -0.5469508, -0.5578231, 
+    -0.5687833, -0.5798182, -0.5909143, -0.6020581, -0.6132358, -0.6244342, 
+    -0.6356393, -0.6468377, -0.6580155, -0.6691593, -0.6802553, -0.6912902, 
+    -0.7022505, -0.7131228, -0.7238939, -0.7345506, -0.7450799, -0.7554692, 
+    -0.7657056, -0.7757767, -0.7856703, -0.7953742, -0.8048767, -0.8141661, 
+    -0.8232313, -0.8320611, -0.8406447, -0.8489717, -0.857032, -0.8648158, 
+    -0.8723135, -0.879516, -0.8864145, -0.8930007, -0.8992666, -0.9052044, 
+    -0.910807, -0.9160675, -0.9209795, -0.925537, -0.9297345, -0.9335669, 
+    -0.9370295, -0.9401181, -0.9428288, -0.9451585, -0.9471042, -0.9486637, 
+    -0.9498349, -0.9506166, -0.9510077, -0.9510077, -0.9506166, -0.9498349, 
+    -0.9486637, -0.9471042, -0.9451585, -0.9428288, -0.9401181, -0.9370295, 
+    -0.9335669, -0.9297345, -0.925537, -0.9209795, -0.9160675, -0.910807, 
+    -0.9052044, -0.8992666, -0.8930007, -0.8864145, -0.8795159, -0.8723135, 
+    -0.8648158, -0.857032, -0.8489717, -0.8406447, -0.8320611, -0.8232313, 
+    -0.8141661, -0.8048767, -0.7953742, -0.7856703, -0.7757766, -0.7657056, 
+    -0.7554693, -0.7450799, -0.7345506, -0.7238938, -0.7131228, -0.7022506, 
+    -0.6912902, -0.6802554, -0.6691592, -0.6580155, -0.6468377, -0.6356393, 
+    -0.6244342, -0.6132358, -0.6020581, -0.5909142, -0.5798182, -0.5687834, 
+    -0.557823, -0.5469508, -0.5361797, -0.5255229, -0.5149937, -0.5046043, 
+    -0.494368, -0.4842968, -0.4744033, -0.4646993, -0.4551969, -0.4459074, 
+    -0.4368422, -0.4280125, -0.4194288, -0.4111018, -0.4030416, -0.3952578, 
+    -0.3877601, -0.3805575, -0.373659, -0.3670728, -0.3608069, -0.3548692,
+  -0.3186193, -0.3130017, -0.3077562, -0.3028893, -0.2984068, -0.2943143, 
+    -0.2906167, -0.2873184, -0.2844236, -0.2819358, -0.279858, -0.2781927, 
+    -0.2769419, -0.2761072, -0.2756896, -0.2756896, -0.2761072, -0.2769419, 
+    -0.2781927, -0.279858, -0.2819358, -0.2844236, -0.2873184, -0.2906166, 
+    -0.2943143, -0.2984068, -0.3028893, -0.3077562, -0.3130017, -0.3186193, 
+    -0.3246022, -0.3309431, -0.3376343, -0.3446676, -0.3520345, -0.3597259, 
+    -0.3677326, -0.3760448, -0.3846522, -0.3935446, -0.4027108, -0.4121401, 
+    -0.4218206, -0.4317406, -0.4418882, -0.4522508, -0.4628161, -0.4735708, 
+    -0.4845021, -0.4955966, -0.5068408, -0.5182209, -0.5297232, -0.5413336, 
+    -0.5530379, -0.5648219, -0.5766712, -0.5885715, -0.6005081, -0.6124666, 
+    -0.6244324, -0.6363909, -0.6483276, -0.6602278, -0.6720771, -0.6838611, 
+    -0.6955655, -0.7071759, -0.7186781, -0.7300583, -0.7413024, -0.7523968, 
+    -0.7633282, -0.774083, -0.7846481, -0.7950109, -0.8051584, -0.8150784, 
+    -0.824759, -0.8341882, -0.8433545, -0.8522468, -0.8608543, -0.8691664, 
+    -0.8771731, -0.8848646, -0.8922315, -0.8992648, -0.9059559, -0.9122969, 
+    -0.9182798, -0.9238974, -0.9291428, -0.9340097, -0.9384922, -0.9425848, 
+    -0.9462824, -0.9495806, -0.9524754, -0.9549632, -0.957041, -0.9587064, 
+    -0.9599571, -0.9607918, -0.9612094, -0.9612094, -0.9607918, -0.9599571, 
+    -0.9587064, -0.957041, -0.9549632, -0.9524754, -0.9495806, -0.9462824, 
+    -0.9425848, -0.9384922, -0.9340098, -0.9291428, -0.9238974, -0.9182798, 
+    -0.9122969, -0.905956, -0.8992648, -0.8922315, -0.8848646, -0.8771731, 
+    -0.8691665, -0.8608543, -0.8522468, -0.8433545, -0.8341882, -0.8247591, 
+    -0.8150784, -0.8051584, -0.7950107, -0.7846481, -0.7740829, -0.7633282, 
+    -0.7523969, -0.7413024, -0.7300583, -0.718678, -0.7071759, -0.6955655, 
+    -0.6838611, -0.6720772, -0.6602278, -0.6483276, -0.636391, -0.6244324, 
+    -0.6124667, -0.6005081, -0.5885715, -0.5766712, -0.5648219, -0.5530379, 
+    -0.5413336, -0.5297232, -0.5182209, -0.5068408, -0.4955967, -0.4845021, 
+    -0.4735709, -0.462816, -0.4522509, -0.4418882, -0.4317406, -0.4218206, 
+    -0.41214, -0.4027109, -0.3935445, -0.3846522, -0.3760448, -0.3677326, 
+    -0.359726, -0.3520344, -0.3446676, -0.3376343, -0.3309431, -0.3246022,
+  -0.2875837, -0.2816159, -0.2760433, -0.270873, -0.266111, -0.2617633, 
+    -0.2578351, -0.2543312, -0.251256, -0.248613, -0.2464056, -0.2446365, 
+    -0.2433077, -0.242421, -0.2419773, -0.2419773, -0.242421, -0.2433077, 
+    -0.2446365, -0.2464056, -0.248613, -0.251256, -0.2543312, -0.2578351, 
+    -0.2617633, -0.266111, -0.270873, -0.2760434, -0.2816159, -0.2875837, 
+    -0.2939397, -0.300676, -0.3077843, -0.3152561, -0.3230824, -0.3312534, 
+    -0.3397593, -0.3485897, -0.3577339, -0.3671807, -0.3769185, -0.3869357, 
+    -0.3972197, -0.4077584, -0.4185387, -0.4295474, -0.4407714, -0.4521967, 
+    -0.4638096, -0.4755959, -0.4875411, -0.4996308, -0.5118503, -0.5241846, 
+    -0.5366186, -0.5491374, -0.5617256, -0.5743678, -0.5870486, -0.5997528, 
+    -0.6124647, -0.6251689, -0.6378498, -0.6504921, -0.6630802, -0.6755989, 
+    -0.688033, -0.7003673, -0.7125868, -0.7246765, -0.7366217, -0.748408, 
+    -0.7600209, -0.7714462, -0.7826701, -0.7936789, -0.8044592, -0.8149978, 
+    -0.825282, -0.8352991, -0.8450369, -0.8544836, -0.8636278, -0.8724582, 
+    -0.8809642, -0.8891352, -0.8969614, -0.9044333, -0.9115416, -0.9182779, 
+    -0.9246339, -0.9306017, -0.9361743, -0.9413446, -0.9461066, -0.9504542, 
+    -0.9543825, -0.9578863, -0.9609616, -0.9636046, -0.965812, -0.9675811, 
+    -0.9689099, -0.9697966, -0.9702402, -0.9702402, -0.9697966, -0.9689099, 
+    -0.9675811, -0.965812, -0.9636046, -0.9609616, -0.9578863, -0.9543825, 
+    -0.9504542, -0.9461066, -0.9413446, -0.9361742, -0.9306017, -0.9246339, 
+    -0.9182779, -0.9115417, -0.9044333, -0.8969614, -0.8891351, -0.8809642, 
+    -0.8724583, -0.8636278, -0.8544837, -0.8450369, -0.8352991, -0.825282, 
+    -0.8149978, -0.8044592, -0.7936789, -0.7826701, -0.7714461, -0.7600209, 
+    -0.748408, -0.7366217, -0.7246765, -0.7125866, -0.7003673, -0.6880331, 
+    -0.6755989, -0.6630802, -0.650492, -0.6378498, -0.6251689, -0.6124647, 
+    -0.5997529, -0.5870486, -0.5743678, -0.5617255, -0.5491374, -0.5366187, 
+    -0.5241845, -0.5118503, -0.4996308, -0.4875411, -0.475596, -0.4638096, 
+    -0.4521968, -0.4407713, -0.4295475, -0.4185386, -0.4077584, -0.3972198, 
+    -0.3869356, -0.3769186, -0.3671806, -0.3577339, -0.3485898, -0.3397593, 
+    -0.3312535, -0.3230824, -0.3152562, -0.3077844, -0.300676, -0.2939397,
+  -0.2561979, -0.249887, -0.2439942, -0.2385267, -0.233491, -0.2288934, 
+    -0.2247395, -0.2210343, -0.2177822, -0.2149874, -0.2126531, -0.2107823, 
+    -0.2093771, -0.2084395, -0.2079703, -0.2079703, -0.2084395, -0.2093772, 
+    -0.2107823, -0.2126531, -0.2149874, -0.2177822, -0.2210343, -0.2247395, 
+    -0.2288934, -0.233491, -0.2385267, -0.2439942, -0.249887, -0.2561979, 
+    -0.2629191, -0.2700425, -0.2775595, -0.2854607, -0.2937368, -0.3023774, 
+    -0.3113722, -0.3207101, -0.3303798, -0.3403695, -0.350667, -0.3612599, 
+    -0.372135, -0.3832793, -0.3946792, -0.4063207, -0.4181898, -0.4302717, 
+    -0.442552, -0.4550157, -0.4676475, -0.480432, -0.4933538, -0.5063969, 
+    -0.5195456, -0.5327839, -0.5460956, -0.5594644, -0.5728741, -0.5863084, 
+    -0.5997508, -0.6131852, -0.6265949, -0.6399637, -0.6532753, -0.6665136, 
+    -0.6796623, -0.6927055, -0.7056273, -0.7184118, -0.7310435, -0.7435071, 
+    -0.7557875, -0.7678695, -0.7797385, -0.79138, -0.8027799, -0.8139242, 
+    -0.8247994, -0.8353922, -0.8456898, -0.8556794, -0.8653491, -0.8746871, 
+    -0.8836818, -0.8923225, -0.9005985, -0.9084997, -0.9160167, -0.9231402, 
+    -0.9298614, -0.9361722, -0.942065, -0.9475325, -0.9525682, -0.9571658, 
+    -0.9613197, -0.9650249, -0.968277, -0.9710718, -0.9734061, -0.9752769, 
+    -0.9766821, -0.9776198, -0.9780889, -0.9780889, -0.9776198, -0.9766821, 
+    -0.9752769, -0.9734061, -0.9710718, -0.968277, -0.9650249, -0.9613197, 
+    -0.9571658, -0.9525682, -0.9475326, -0.942065, -0.9361722, -0.9298614, 
+    -0.9231402, -0.9160168, -0.9084997, -0.9005985, -0.8923224, -0.8836818, 
+    -0.8746871, -0.8653491, -0.8556795, -0.8456897, -0.8353922, -0.8247995, 
+    -0.8139242, -0.8027799, -0.79138, -0.7797385, -0.7678694, -0.7557875, 
+    -0.7435073, -0.7310435, -0.7184118, -0.7056271, -0.6927055, -0.6796624, 
+    -0.6665136, -0.6532754, -0.6399636, -0.6265949, -0.6131852, -0.5997508, 
+    -0.5863085, -0.5728741, -0.5594644, -0.5460955, -0.5327839, -0.5195457, 
+    -0.5063969, -0.4933538, -0.480432, -0.4676475, -0.4550158, -0.442552, 
+    -0.4302718, -0.4181897, -0.4063208, -0.3946791, -0.3832793, -0.3721351, 
+    -0.3612598, -0.3506671, -0.3403695, -0.3303798, -0.3207102, -0.3113722, 
+    -0.3023775, -0.2937367, -0.2854608, -0.2775595, -0.2700425, -0.2629192,
+  -0.2244999, -0.2178537, -0.2116478, -0.2058898, -0.2005866, -0.1957447, 
+    -0.1913701, -0.187468, -0.1840432, -0.1810998, -0.1786415, -0.1766713, 
+    -0.1751915, -0.174204, -0.17371, -0.17371, -0.174204, -0.1751916, 
+    -0.1766713, -0.1786415, -0.1810998, -0.1840432, -0.187468, -0.1913701, 
+    -0.1957447, -0.2005866, -0.2058898, -0.2116479, -0.2178537, -0.2244999, 
+    -0.2315782, -0.2390801, -0.2469965, -0.2553175, -0.2640333, -0.273133, 
+    -0.2826057, -0.2924398, -0.3026232, -0.3131437, -0.3239883, -0.335144, 
+    -0.346597, -0.3583334, -0.370339, -0.3825989, -0.3950986, -0.4078225, 
+    -0.4207553, -0.4338812, -0.4471841, -0.4606479, -0.4742562, -0.4879924, 
+    -0.5018397, -0.5157813, -0.5298002, -0.5438794, -0.5580015, -0.5721496, 
+    -0.5863063, -0.6004544, -0.6145766, -0.6286558, -0.6426746, -0.6566162, 
+    -0.6704636, -0.6841998, -0.6978081, -0.7112719, -0.7245747, -0.7377006, 
+    -0.7506334, -0.7633574, -0.775857, -0.7881171, -0.8001226, -0.811859, 
+    -0.823312, -0.8344676, -0.8453123, -0.8558327, -0.8660161, -0.8758503, 
+    -0.8853229, -0.8944227, -0.9031384, -0.9114595, -0.9193758, -0.9268777, 
+    -0.9339561, -0.9406022, -0.9468081, -0.9525661, -0.9578694, -0.9627112, 
+    -0.9670859, -0.970988, -0.9744128, -0.9773561, -0.9798144, -0.9817846, 
+    -0.9832644, -0.984252, -0.984746, -0.984746, -0.984252, -0.9832644, 
+    -0.9817846, -0.9798144, -0.9773561, -0.9744128, -0.970988, -0.9670859, 
+    -0.9627112, -0.9578694, -0.9525662, -0.9468081, -0.9406022, -0.9339561, 
+    -0.9268777, -0.9193759, -0.9114595, -0.9031384, -0.8944227, -0.8853229, 
+    -0.8758503, -0.8660161, -0.8558328, -0.8453122, -0.8344676, -0.8233121, 
+    -0.811859, -0.8001226, -0.788117, -0.775857, -0.7633573, -0.7506334, 
+    -0.7377007, -0.7245747, -0.7112719, -0.697808, -0.6841998, -0.6704637, 
+    -0.6566162, -0.6426747, -0.6286557, -0.6145766, -0.6004545, -0.5863063, 
+    -0.5721497, -0.5580015, -0.5438794, -0.5298002, -0.5157813, -0.5018398, 
+    -0.4879923, -0.4742562, -0.4606479, -0.4471841, -0.4338813, -0.4207553, 
+    -0.4078226, -0.3950986, -0.382599, -0.3703389, -0.3583334, -0.346597, 
+    -0.3351439, -0.3239884, -0.3131436, -0.3026232, -0.2924398, -0.2826057, 
+    -0.2731331, -0.2640333, -0.2553176, -0.2469965, -0.2390801, -0.2315783,
+  -0.1925284, -0.185555, -0.1790436, -0.173002, -0.1674378, -0.1623575, 
+    -0.1577675, -0.1536733, -0.1500798, -0.1469916, -0.1444123, -0.1423451, 
+    -0.1407924, -0.1397563, -0.1392379, -0.1392379, -0.1397563, -0.1407924, 
+    -0.1423451, -0.1444123, -0.1469916, -0.1500798, -0.1536733, -0.1577675, 
+    -0.1623575, -0.1674378, -0.173002, -0.1790436, -0.185555, -0.1925284, 
+    -0.1999552, -0.2078264, -0.2161325, -0.2248632, -0.2340081, -0.2435558, 
+    -0.2534948, -0.2638131, -0.2744979, -0.2855363, -0.2969148, -0.3086197, 
+    -0.3206366, -0.3329508, -0.3455474, -0.358411, -0.3715261, -0.3848764, 
+    -0.3984459, -0.412218, -0.4261759, -0.4403025, -0.4545808, -0.4689932, 
+    -0.4835223, -0.4981503, -0.5128594, -0.5276317, -0.5424491, -0.5572937, 
+    -0.5721474, -0.586992, -0.6018095, -0.6165818, -0.6312908, -0.6459188, 
+    -0.6604479, -0.6748604, -0.6891387, -0.7032653, -0.7172231, -0.7309952, 
+    -0.7445647, -0.7579151, -0.7710301, -0.7838938, -0.7964903, -0.8088046, 
+    -0.8208214, -0.8325263, -0.8439049, -0.8549432, -0.8656281, -0.8759463, 
+    -0.8858854, -0.8954331, -0.9045779, -0.9133086, -0.9216147, -0.9294859, 
+    -0.9369128, -0.9438862, -0.9503976, -0.9564391, -0.9620034, -0.9670836, 
+    -0.9716737, -0.9757679, -0.9793613, -0.9824495, -0.9850289, -0.9870961, 
+    -0.9886487, -0.9896848, -0.9902033, -0.9902033, -0.9896848, -0.9886487, 
+    -0.9870961, -0.9850289, -0.9824495, -0.9793613, -0.9757679, -0.9716737, 
+    -0.9670836, -0.9620034, -0.9564391, -0.9503975, -0.9438862, -0.9369128, 
+    -0.9294859, -0.9216148, -0.9133086, -0.9045779, -0.8954331, -0.8858854, 
+    -0.8759463, -0.8656281, -0.8549433, -0.8439048, -0.8325263, -0.8208215, 
+    -0.8088046, -0.7964904, -0.7838937, -0.7710301, -0.757915, -0.7445647, 
+    -0.7309953, -0.7172231, -0.7032653, -0.6891385, -0.6748604, -0.660448, 
+    -0.6459188, -0.6312909, -0.6165817, -0.6018095, -0.5869921, -0.5721474, 
+    -0.5572938, -0.5424491, -0.5276317, -0.5128593, -0.4981503, -0.4835224, 
+    -0.4689932, -0.4545808, -0.4403025, -0.4261759, -0.4122181, -0.3984459, 
+    -0.3848765, -0.371526, -0.3584111, -0.3455473, -0.3329508, -0.3206366, 
+    -0.3086197, -0.2969149, -0.2855363, -0.2744979, -0.2638131, -0.2534948, 
+    -0.2435558, -0.234008, -0.2248633, -0.2161326, -0.2078264, -0.1999552,
+  -0.1603222, -0.1530301, -0.1462211, -0.1399035, -0.1340849, -0.1287724, 
+    -0.1239727, -0.1196913, -0.1159336, -0.1127042, -0.110007, -0.1078453, 
+    -0.1062217, -0.1051383, -0.1045962, -0.1045962, -0.1051383, -0.1062218, 
+    -0.1078453, -0.110007, -0.1127042, -0.1159336, -0.1196913, -0.1239726, 
+    -0.1287724, -0.1340849, -0.1399035, -0.1462211, -0.1530301, -0.1603222, 
+    -0.1680885, -0.1763195, -0.1850051, -0.1941349, -0.2036978, -0.2136818, 
+    -0.2240751, -0.2348649, -0.2460381, -0.257581, -0.2694796, -0.2817194, 
+    -0.2942855, -0.3071625, -0.3203349, -0.3337864, -0.3475009, -0.3614613, 
+    -0.3756511, -0.3900526, -0.4046484, -0.4194207, -0.4343515, -0.4494227, 
+    -0.4646158, -0.4799123, -0.4952937, -0.5107412, -0.5262358, -0.5417588, 
+    -0.5572914, -0.5728145, -0.5883092, -0.6037567, -0.6191379, -0.6344345, 
+    -0.6496276, -0.6646988, -0.6796296, -0.694402, -0.7089977, -0.7233992, 
+    -0.7375889, -0.7515494, -0.7652639, -0.7787155, -0.7918877, -0.8047647, 
+    -0.8173308, -0.8295707, -0.8414693, -0.8530121, -0.8641853, -0.8749751, 
+    -0.8853685, -0.8953526, -0.9049153, -0.9140451, -0.9227308, -0.9309618, 
+    -0.9387281, -0.9460201, -0.9528292, -0.9591468, -0.9649653, -0.9702778, 
+    -0.9750776, -0.979359, -0.9831166, -0.986346, -0.9890432, -0.991205, 
+    -0.9928285, -0.993912, -0.9944541, -0.9944541, -0.993912, -0.9928285, 
+    -0.991205, -0.9890432, -0.986346, -0.9831166, -0.979359, -0.9750776, 
+    -0.9702778, -0.9649653, -0.9591469, -0.9528291, -0.9460201, -0.9387281, 
+    -0.9309618, -0.9227309, -0.9140451, -0.9049153, -0.8953525, -0.8853685, 
+    -0.8749752, -0.8641853, -0.8530122, -0.8414692, -0.8295707, -0.817331, 
+    -0.8047647, -0.7918878, -0.7787154, -0.7652639, -0.7515494, -0.7375889, 
+    -0.7233993, -0.7089977, -0.694402, -0.6796295, -0.6646988, -0.6496277, 
+    -0.6344345, -0.619138, -0.6037565, -0.5883092, -0.5728146, -0.5572914, 
+    -0.541759, -0.5262358, -0.5107412, -0.4952936, -0.4799123, -0.4646159, 
+    -0.4494226, -0.4343516, -0.4194206, -0.4046484, -0.3900527, -0.3756511, 
+    -0.3614615, -0.3475008, -0.3337865, -0.3203348, -0.3071625, -0.2942856, 
+    -0.2817194, -0.2694796, -0.257581, -0.2460381, -0.234865, -0.2240751, 
+    -0.2136819, -0.2036977, -0.194135, -0.1850052, -0.1763195, -0.1680885,
+  -0.1279209, -0.1203189, -0.1132206, -0.1066345, -0.1005687, -0.09503058, 
+    -0.09002686, -0.0855636, -0.08164626, -0.07827967, -0.07546785, 
+    -0.07321432, -0.07152173, -0.07039222, -0.06982711, -0.06982711, 
+    -0.07039222, -0.07152176, -0.07321432, -0.07546785, -0.07827967, 
+    -0.08164626, -0.0855636, -0.09002683, -0.09503058, -0.1005687, 
+    -0.1066345, -0.1132206, -0.1203189, -0.1279209, -0.1360171, -0.1445978, 
+    -0.1536525, -0.1631702, -0.1731393, -0.1835476, -0.1943825, -0.2056307, 
+    -0.2172786, -0.229312, -0.2417161, -0.254476, -0.2675759, -0.2810001, 
+    -0.2947322, -0.3087552, -0.3230523, -0.337606, -0.3523986, -0.367412, 
+    -0.382628, -0.3980279, -0.4135931, -0.4293046, -0.4451432, -0.4610897, 
+    -0.4771246, -0.4932284, -0.5093814, -0.525564, -0.5417565, -0.5579391, 
+    -0.5740921, -0.590196, -0.6062307, -0.6221772, -0.6380159, -0.6537274, 
+    -0.6692926, -0.6846926, -0.6999084, -0.7149218, -0.7297145, -0.7442682, 
+    -0.7585653, -0.7725884, -0.7863203, -0.7997445, -0.8128445, -0.8256044, 
+    -0.8380085, -0.8500418, -0.8616897, -0.872938, -0.8837729, -0.8941812, 
+    -0.9041502, -0.9136679, -0.9227227, -0.9313034, -0.9393996, -0.9470016, 
+    -0.9540999, -0.9606859, -0.9667517, -0.9722899, -0.9772936, -0.9817569, 
+    -0.9856742, -0.9890408, -0.9918526, -0.9941062, -0.9957987, -0.9969282, 
+    -0.9974934, -0.9974934, -0.9969282, -0.9957987, -0.9941062, -0.9918526, 
+    -0.9890408, -0.9856742, -0.9817569, -0.9772936, -0.9722899, -0.9667517, 
+    -0.960686, -0.9540998, -0.9470016, -0.9393997, -0.9313034, -0.9227227, 
+    -0.9136679, -0.9041502, -0.8941811, -0.8837729, -0.872938, -0.8616897, 
+    -0.8500419, -0.8380084, -0.8256044, -0.8128446, -0.7997445, -0.7863204, 
+    -0.7725883, -0.7585653, -0.7442681, -0.7297145, -0.714922, -0.6999084, 
+    -0.6846926, -0.6692925, -0.6537274, -0.638016, -0.6221772, -0.6062309, 
+    -0.5901958, -0.5740921, -0.5579392, -0.5417565, -0.5255641, -0.5093814, 
+    -0.4932284, -0.4771245, -0.4610897, -0.4451433, -0.4293045, -0.4135932, 
+    -0.3980278, -0.382628, -0.3674121, -0.3523986, -0.3376061, -0.3230523, 
+    -0.3087552, -0.294732, -0.2810001, -0.267576, -0.2544759, -0.2417161, 
+    -0.2293119, -0.2172786, -0.2056308, -0.1943825, -0.1835476, -0.1731392, 
+    -0.1631702, -0.1536526, -0.1445978, -0.1360171,
+  -0.09536362, -0.08746114, -0.08008215, -0.07323569, -0.06693003, 
+    -0.0611729, -0.05597135, -0.05133164, -0.04725942, -0.04375973, 
+    -0.04083675, -0.03849408, -0.03673458, -0.03556043, -0.03497294, 
+    -0.03497294, -0.03556043, -0.03673461, -0.03849408, -0.04083675, 
+    -0.04375973, -0.04725942, -0.05133164, -0.05597132, -0.0611729, 
+    -0.06693003, -0.07323569, -0.08008218, -0.08746111, -0.09536362, 
+    -0.1037799, -0.1126999, -0.1221126, -0.1320066, -0.14237, -0.1531897, 
+    -0.164453, -0.176146, -0.1882544, -0.2007636, -0.2136581, -0.2269225, 
+    -0.2405404, -0.2544954, -0.2687703, -0.2833478, -0.2982103, -0.3133393, 
+    -0.3287168, -0.3443238, -0.3601413, -0.3761501, -0.3923308, -0.4086635, 
+    -0.4251283, -0.4417053, -0.4583742, -0.4751147, -0.4919063, -0.5087288, 
+    -0.5255615, -0.542384, -0.5591757, -0.5759162, -0.592585, -0.6091619, 
+    -0.6256268, -0.6419595, -0.6581402, -0.674149, -0.6899665, -0.7055735, 
+    -0.720951, -0.7360801, -0.7509425, -0.7655201, -0.7797949, -0.7937499, 
+    -0.8073679, -0.8206322, -0.8335268, -0.8460358, -0.8581443, -0.8698373, 
+    -0.8811006, -0.8919204, -0.9022837, -0.9121777, -0.9215904, -0.9305104, 
+    -0.9389267, -0.9468292, -0.9542081, -0.9610546, -0.9673603, -0.9731174, 
+    -0.978319, -0.9829587, -0.9870309, -0.9905306, -0.9934536, -0.9957962, 
+    -0.9975557, -0.9987299, -0.9993174, -0.9993174, -0.9987299, -0.9975557, 
+    -0.9957962, -0.9934536, -0.9905306, -0.9870309, -0.9829587, -0.978319, 
+    -0.9731174, -0.9673603, -0.9610547, -0.9542081, -0.9468292, -0.9389268, 
+    -0.9305104, -0.9215904, -0.9121777, -0.9022837, -0.8919203, -0.8811006, 
+    -0.8698373, -0.8581443, -0.846036, -0.8335267, -0.8206322, -0.8073679, 
+    -0.7937499, -0.7797951, -0.76552, -0.7509425, -0.73608, -0.720951, 
+    -0.7055736, -0.6899665, -0.674149, -0.6581401, -0.6419595, -0.6256269, 
+    -0.6091619, -0.5925851, -0.5759161, -0.5591757, -0.5423841, -0.5255615, 
+    -0.5087289, -0.4919063, -0.4751147, -0.4583741, -0.4417053, -0.4251285, 
+    -0.4086635, -0.3923309, -0.3761501, -0.3601413, -0.3443239, -0.3287168, 
+    -0.3133394, -0.2982101, -0.2833478, -0.2687702, -0.2544954, -0.2405405, 
+    -0.2269225, -0.2136582, -0.2007635, -0.1882544, -0.1761461, -0.164453, 
+    -0.1531898, -0.1423699, -0.1320067, -0.1221127, -0.1126999, -0.10378,
+  -0.06269017, -0.05449674, -0.04684609, -0.03974757, -0.03320977, 
+    -0.02724069, -0.02184764, -0.01703709, -0.01281497, -0.009186417, 
+    -0.006155819, -0.003726929, -0.00190264, -0.0006852448, -7.614493e-05, 
+    -7.614493e-05, -0.0006852448, -0.00190267, -0.003726929, -0.006155819, 
+    -0.009186417, -0.01281497, -0.01703709, -0.02184761, -0.02724069, 
+    -0.03320977, -0.03974757, -0.04684612, -0.05449671, -0.06269017, 
+    -0.07141635, -0.08066472, -0.09042397, -0.1006822, -0.1114271, 
+    -0.1226452, -0.1343231, -0.1464466, -0.1590008, -0.1719705, -0.1853397, 
+    -0.1990925, -0.2132118, -0.2276805, -0.242481, -0.2575951, -0.2730048, 
+    -0.2886908, -0.3046344, -0.320816, -0.3372159, -0.3538141, -0.3705904, 
+    -0.3875245, -0.4045955, -0.4217828, -0.4390653, -0.4564222, -0.473832, 
+    -0.4912737, -0.5087262, -0.5261679, -0.5435778, -0.5609347, -0.5782171, 
+    -0.5954044, -0.6124755, -0.6294095, -0.6461859, -0.6627841, -0.6791839, 
+    -0.6953655, -0.7113091, -0.7269952, -0.7424048, -0.757519, -0.7723194, 
+    -0.7867881, -0.8009075, -0.8146602, -0.8280295, -0.8409991, -0.8535533, 
+    -0.8656768, -0.8773547, -0.8885729, -0.8993177, -0.9095759, -0.9193352, 
+    -0.9285836, -0.9373098, -0.9455032, -0.9531538, -0.9602523, -0.9667901, 
+    -0.9727592, -0.9781523, -0.9829628, -0.987185, -0.9908135, -0.9938441, 
+    -0.996273, -0.9980973, -0.9993147, -0.9999238, -0.9999238, -0.9993147, 
+    -0.9980973, -0.996273, -0.9938441, -0.9908135, -0.987185, -0.9829628, 
+    -0.9781523, -0.9727592, -0.9667901, -0.9602524, -0.9531538, -0.9455032, 
+    -0.9373099, -0.9285836, -0.9193352, -0.9095759, -0.8993177, -0.8885729, 
+    -0.8773547, -0.8656769, -0.8535533, -0.8409991, -0.8280294, -0.8146602, 
+    -0.8009076, -0.7867881, -0.7723196, -0.7575189, -0.7424048, -0.7269951, 
+    -0.7113091, -0.6953656, -0.6791839, -0.6627841, -0.6461858, -0.6294095, 
+    -0.6124756, -0.5954044, -0.5782173, -0.5609345, -0.5435778, -0.526168, 
+    -0.5087262, -0.4912739, -0.473832, -0.4564222, -0.4390652, -0.4217828, 
+    -0.4045956, -0.3875244, -0.3705905, -0.3538141, -0.3372159, -0.3208161, 
+    -0.3046344, -0.2886909, -0.2730047, -0.2575952, -0.2424809, -0.2276805, 
+    -0.2132119, -0.1990924, -0.1853398, -0.1719704, -0.1590008, -0.1464467, 
+    -0.1343231, -0.1226453, -0.111427, -0.1006823, -0.09042406, -0.08066472, 
+    -0.07141641,
+  -0.02994034, -0.02146596, -0.01355296, -0.006211013, 0.0005509555, 
+    0.006724715, 0.0123027, 0.01727819, 0.0216451, 0.02539811, 0.02853259, 
+    0.03104475, 0.0329316, 0.03419074, 0.03482077, 0.03482077, 0.03419074, 
+    0.0329316, 0.03104475, 0.02853259, 0.02539811, 0.0216451, 0.01727819, 
+    0.01230273, 0.006724715, 0.0005509555, -0.006211013, -0.01355299, 
+    -0.0214659, -0.02994034, -0.03896573, -0.04853123, -0.05862513, 
+    -0.06923512, -0.08034843, -0.09195122, -0.1040296, -0.1165688, 
+    -0.1295535, -0.1429679, -0.1567956, -0.17102, -0.1856234, -0.2005882, 
+    -0.2158962, -0.2315286, -0.2474667, -0.2636907, -0.2801809, -0.2969174, 
+    -0.3138797, -0.331047, -0.3483986, -0.3659133, -0.3835697, -0.4013463, 
+    -0.4192216, -0.4371735, -0.4551803, -0.4732202, -0.4912711, -0.509311, 
+    -0.5273179, -0.5452698, -0.5631449, -0.5809216, -0.598578, -0.6160927, 
+    -0.6334443, -0.6506117, -0.6675739, -0.6843103, -0.7008007, -0.7170247, 
+    -0.7329626, -0.7485951, -0.7639031, -0.7788679, -0.7934714, -0.8076957, 
+    -0.8215234, -0.8349378, -0.8479224, -0.8604617, -0.8725401, -0.8841429, 
+    -0.8952562, -0.9058661, -0.9159601, -0.9255255, -0.934551, -0.9430254, 
+    -0.9509383, -0.9582803, -0.9650422, -0.971216, -0.976794, -0.9817695, 
+    -0.9861364, -0.9898894, -0.9930239, -0.9955361, -0.9974229, -0.998682, 
+    -0.999312, -0.999312, -0.998682, -0.9974229, -0.9955361, -0.9930239, 
+    -0.9898894, -0.9861364, -0.9817695, -0.976794, -0.971216, -0.9650422, 
+    -0.9582803, -0.9509383, -0.9430254, -0.9345511, -0.9255255, -0.9159601, 
+    -0.9058661, -0.8952562, -0.8841429, -0.8725401, -0.8604617, -0.8479224, 
+    -0.8349378, -0.8215233, -0.8076957, -0.7934715, -0.7788679, -0.7639031, 
+    -0.748595, -0.7329626, -0.7170246, -0.7008007, -0.6843104, -0.6675739, 
+    -0.6506117, -0.6334442, -0.6160927, -0.5985781, -0.5809216, -0.563145, 
+    -0.5452697, -0.5273179, -0.5093111, -0.4912711, -0.4732203, -0.4551803, 
+    -0.4371735, -0.4192214, -0.4013463, -0.3835698, -0.3659133, -0.3483987, 
+    -0.331047, -0.3138797, -0.2969175, -0.2801809, -0.2636907, -0.2474666, 
+    -0.2315288, -0.2158961, -0.2005882, -0.1856235, -0.1710199, -0.1567957, 
+    -0.1429678, -0.1295535, -0.1165689, -0.1040296, -0.09195131, -0.08034834, 
+    -0.06923518, -0.05862522, -0.04853123, -0.03896579,
+  0.002846003, 0.01159102, 0.0197567, 0.02733311, 0.03431103, 0.04068196, 
+    0.0464381, 0.05157244, 0.05607885, 0.05995166, 0.06318629, 0.06577867, 
+    0.06772578, 0.06902516, 0.06967521, 0.06967521, 0.06902516, 0.06772578, 
+    0.06577867, 0.06318629, 0.05995166, 0.05607885, 0.05157244, 0.0464381, 
+    0.04068196, 0.03431103, 0.02733311, 0.01975667, 0.01159105, 0.002846003, 
+    -0.00646764, -0.01633862, -0.02675486, -0.03770366, -0.04917189, 
+    -0.06114522, -0.07360932, -0.08654898, -0.09994838, -0.1137912, 
+    -0.1280604, -0.1427391, -0.1578088, -0.1732515, -0.1890484, -0.2051801, 
+    -0.2216271, -0.2383692, -0.2553861, -0.272657, -0.290161, -0.3078766, 
+    -0.3257824, -0.3438564, -0.3620766, -0.3804209, -0.398867, -0.4173923, 
+    -0.4359741, -0.4545901, -0.4732174, -0.4918334, -0.5104154, -0.5289407, 
+    -0.5473866, -0.5657309, -0.5839512, -0.6020253, -0.619931, -0.6376466, 
+    -0.6551505, -0.6724215, -0.6894383, -0.7061805, -0.7226275, -0.7387592, 
+    -0.754556, -0.7699987, -0.7850686, -0.7997471, -0.8140165, -0.8278592, 
+    -0.8412585, -0.8541982, -0.8666623, -0.8786358, -0.8901039, -0.9010527, 
+    -0.911469, -0.9213399, -0.9306536, -0.9393986, -0.9475642, -0.9551407, 
+    -0.9621186, -0.9684895, -0.9742457, -0.97938, -0.9838864, -0.9877592, 
+    -0.9909938, -0.9935862, -0.9955333, -0.9968327, -0.9974828, -0.9974828, 
+    -0.9968327, -0.9955333, -0.9935862, -0.9909938, -0.9877592, -0.9838864, 
+    -0.97938, -0.9742457, -0.9684895, -0.9621186, -0.9551407, -0.9475642, 
+    -0.9393986, -0.9306537, -0.9213399, -0.911469, -0.9010527, -0.8901039, 
+    -0.8786356, -0.8666623, -0.8541983, -0.8412585, -0.8278593, -0.8140163, 
+    -0.7997471, -0.7850686, -0.7699987, -0.7545561, -0.7387591, -0.7226275, 
+    -0.7061804, -0.6894383, -0.6724216, -0.6551505, -0.6376466, -0.6199309, 
+    -0.6020253, -0.5839514, -0.5657309, -0.5473867, -0.5289406, -0.5104154, 
+    -0.4918335, -0.4732174, -0.4545902, -0.4359741, -0.4173923, -0.3988669, 
+    -0.3804209, -0.3620767, -0.3438563, -0.3257824, -0.3078765, -0.290161, 
+    -0.2726572, -0.2553861, -0.2383693, -0.221627, -0.2051802, -0.1890483, 
+    -0.1732515, -0.1578089, -0.142739, -0.1280605, -0.1137911, -0.09994838, 
+    -0.08654907, -0.07360932, -0.06114531, -0.04917181, -0.03770375, 
+    -0.02675495, -0.01633862, -0.0064677,
+  0.03562877, 0.04463378, 0.0530422, 0.06084383, 0.06802922, 0.07458955, 
+    0.08051676, 0.08580381, 0.09044415, 0.09443212, 0.09776288, 0.1004323, 
+    0.1024373, 0.1037753, 0.1044447, 0.1044447, 0.1037753, 0.1024373, 
+    0.1004323, 0.09776288, 0.09443212, 0.09044415, 0.08580381, 0.08051682, 
+    0.07458955, 0.06802922, 0.06084383, 0.05304217, 0.04463381, 0.03562877, 
+    0.02603826, 0.01587385, 0.005147934, -0.006126374, -0.01793551, 
+    -0.03026479, -0.04309943, -0.05642375, -0.07022148, -0.08447582, 
+    -0.09916928, -0.1142843, -0.129802, -0.1457039, -0.1619704, -0.1785816, 
+    -0.1955176, -0.2127573, -0.2302801, -0.2480645, -0.2660888, -0.2843311, 
+    -0.3027691, -0.3213805, -0.3401424, -0.359032, -0.3780265, -0.3971025, 
+    -0.4162367, -0.4354061, -0.4545873, -0.4737566, -0.492891, -0.5119671, 
+    -0.5309613, -0.549851, -0.568613, -0.5872243, -0.6056623, -0.6239046, 
+    -0.6419289, -0.6597133, -0.6772361, -0.6944759, -0.7114118, -0.7280232, 
+    -0.7442895, -0.7601913, -0.7757092, -0.7908241, -0.8055177, -0.8197719, 
+    -0.8335696, -0.846894, -0.8597286, -0.872058, -0.883867, -0.8951414, 
+    -0.9058673, -0.9160317, -0.9256222, -0.9346272, -0.9430356, -0.9508373, 
+    -0.9580226, -0.9645829, -0.9705102, -0.9757972, -0.9804376, -0.9844255, 
+    -0.9877563, -0.9904258, -0.9924307, -0.9937688, -0.9944382, -0.9944382, 
+    -0.9937688, -0.9924307, -0.9904258, -0.9877563, -0.9844255, -0.9804376, 
+    -0.9757972, -0.9705102, -0.9645829, -0.9580226, -0.9508373, -0.9430356, 
+    -0.9346272, -0.9256223, -0.9160317, -0.9058673, -0.8951414, -0.883867, 
+    -0.8720579, -0.8597286, -0.846894, -0.8335696, -0.819772, -0.8055176, 
+    -0.7908241, -0.7757093, -0.7601913, -0.7442896, -0.7280231, -0.7114118, 
+    -0.6944758, -0.6772361, -0.6597134, -0.6419289, -0.6239046, -0.6056622, 
+    -0.5872243, -0.5686131, -0.549851, -0.5309615, -0.5119669, -0.492891, 
+    -0.4737568, -0.4545873, -0.4354063, -0.4162367, -0.3971025, -0.3780263, 
+    -0.359032, -0.3401425, -0.3213804, -0.3027692, -0.284331, -0.2660888, 
+    -0.2480647, -0.2302801, -0.2127574, -0.1955175, -0.1785817, -0.1619703, 
+    -0.1457039, -0.1298021, -0.1142842, -0.09916937, -0.08447573, 
+    -0.07022148, -0.05642387, -0.04309943, -0.03026488, -0.01793543, 
+    -0.006126434, 0.005147845, 0.01587385, 0.0260382,
+  0.06836826, 0.07762226, 0.08626321, 0.09428057, 0.1016646, 0.1084063, 
+    0.1144975, 0.1199307, 0.1246994, 0.1287976, 0.1322205, 0.1349638, 
+    0.1370242, 0.1383992, 0.1390871, 0.1390871, 0.1383992, 0.1370242, 
+    0.1349638, 0.1322205, 0.1287976, 0.1246994, 0.1199307, 0.1144975, 
+    0.1084063, 0.1016646, 0.09428057, 0.08626321, 0.07762232, 0.06836826, 
+    0.05851257, 0.04806706, 0.03704455, 0.02545851, 0.0133228, 0.0006526113, 
+    -0.01253694, -0.02622971, -0.04040897, -0.05505747, -0.07015723, 
+    -0.08569017, -0.101637, -0.1179786, -0.1346949, -0.1517654, -0.1691697, 
+    -0.1868862, -0.2048935, -0.2231697, -0.2416924, -0.2604391, -0.279387, 
+    -0.298513, -0.3177937, -0.3372057, -0.3567254, -0.3763289, -0.3959922, 
+    -0.4156917, -0.4354032, -0.4551027, -0.4747661, -0.4943696, -0.5138891, 
+    -0.5333012, -0.5525819, -0.5717079, -0.5906558, -0.6094025, -0.6279252, 
+    -0.6462013, -0.6642087, -0.6819252, -0.6993294, -0.7164001, -0.7331163, 
+    -0.7494578, -0.7654048, -0.7809377, -0.7960376, -0.8106859, -0.8248652, 
+    -0.838558, -0.8517475, -0.8644178, -0.8765534, -0.8881394, -0.8991619, 
+    -0.9096075, -0.9194632, -0.9287171, -0.9373581, -0.9453754, -0.9527595, 
+    -0.9595013, -0.9655924, -0.9710256, -0.9757943, -0.9798925, -0.9833153, 
+    -0.9860587, -0.9881191, -0.9894941, -0.990182, -0.990182, -0.9894941, 
+    -0.9881191, -0.9860587, -0.9833153, -0.9798925, -0.9757943, -0.9710256, 
+    -0.9655924, -0.9595013, -0.9527595, -0.9453756, -0.937358, -0.9287171, 
+    -0.9194633, -0.9096075, -0.8991621, -0.8881394, -0.8765534, -0.8644177, 
+    -0.8517475, -0.838558, -0.8248652, -0.810686, -0.7960374, -0.7809377, 
+    -0.7654049, -0.7494578, -0.7331164, -0.7164, -0.6993294, -0.6819251, 
+    -0.6642087, -0.6462015, -0.6279252, -0.6094025, -0.5906557, -0.5717079, 
+    -0.552582, -0.5333012, -0.5138893, -0.4943695, -0.4747661, -0.4551028, 
+    -0.4354032, -0.4156918, -0.3959922, -0.3763289, -0.3567252, -0.3372057, 
+    -0.3177938, -0.2985129, -0.2793871, -0.260439, -0.2416924, -0.2231698, 
+    -0.2048935, -0.1868863, -0.1691696, -0.1517655, -0.1346948, -0.1179786, 
+    -0.1016371, -0.08569008, -0.07015732, -0.05505735, -0.04040897, 
+    -0.0262298, -0.01253694, 0.0006525218, 0.01332292, 0.02545843, 
+    0.03704447, 0.04806706, 0.05851248,
+  0.1010244, 0.1105161, 0.119379, 0.1276024, 0.1351761, 0.142091, 0.1483387, 
+    0.1539115, 0.1588026, 0.1630061, 0.166517, 0.1693307, 0.1714441, 
+    0.1728544, 0.17356, 0.17356, 0.1728544, 0.171444, 0.1693307, 0.166517, 
+    0.1630061, 0.1588026, 0.1539115, 0.1483387, 0.142091, 0.1351761, 
+    0.1276024, 0.119379, 0.1105161, 0.1010244, 0.09091547, 0.08020166, 
+    0.068896, 0.05701229, 0.04456481, 0.03156915, 0.01804075, 0.003996223, 
+    -0.01054731, -0.02557209, -0.04105976, -0.05699176, -0.07334828, 
+    -0.09010962, -0.1072554, -0.1247644, -0.1426159, -0.1607874, -0.1792574, 
+    -0.1980031, -0.2170016, -0.2362299, -0.2556646, -0.2752819, -0.2950579, 
+    -0.3149686, -0.3349897, -0.3550968, -0.3752653, -0.3954709, -0.4156887, 
+    -0.4358943, -0.4560629, -0.47617, -0.496191, -0.5161017, -0.5358778, 
+    -0.555495, -0.5749297, -0.5941581, -0.6131565, -0.6319022, -0.6503721, 
+    -0.6685438, -0.6863952, -0.7039043, -0.72105, -0.7378113, -0.7541679, 
+    -0.7700998, -0.7855875, -0.8006123, -0.8151558, -0.8292003, -0.8427287, 
+    -0.8557245, -0.8681719, -0.8800555, -0.8913612, -0.9020751, -0.912184, 
+    -0.9216757, -0.9305387, -0.9387619, -0.9463357, -0.9532506, -0.9594983, 
+    -0.9650711, -0.9699622, -0.9741657, -0.9776765, -0.9804903, -0.9826037, 
+    -0.984014, -0.9847196, -0.9847196, -0.984014, -0.9826037, -0.9804903, 
+    -0.9776765, -0.9741657, -0.9699622, -0.9650711, -0.9594983, -0.9532506, 
+    -0.9463357, -0.938762, -0.9305386, -0.9216757, -0.9121841, -0.9020751, 
+    -0.8913614, -0.8800555, -0.8681719, -0.8557245, -0.8427287, -0.8292004, 
+    -0.8151558, -0.8006124, -0.7855875, -0.7700998, -0.754168, -0.7378113, 
+    -0.72105, -0.7039042, -0.6863952, -0.6685437, -0.6503721, -0.6319023, 
+    -0.6131565, -0.5941581, -0.5749296, -0.555495, -0.5358779, -0.5161017, 
+    -0.4961911, -0.4761699, -0.4560629, -0.4358944, -0.4156887, -0.395471, 
+    -0.3752653, -0.3550968, -0.3349895, -0.3149686, -0.295058, -0.2752818, 
+    -0.2556646, -0.2362299, -0.2170016, -0.1980032, -0.1792574, -0.1607876, 
+    -0.1426157, -0.1247646, -0.1072553, -0.09010962, -0.07334837, 
+    -0.05699167, -0.04105985, -0.025572, -0.01054731, 0.003996134, 
+    0.01804075, 0.03156903, 0.04456493, 0.0570122, 0.06889588, 0.08020166, 
+    0.09091541,
+  0.1335574, 0.1432753, 0.1523494, 0.1607687, 0.1685229, 0.1756026, 
+    0.1819991, 0.1877047, 0.1927124, 0.1970161, 0.2006105, 0.2034913, 
+    0.205655, 0.2070989, 0.2078214, 0.2078214, 0.2070989, 0.205655, 
+    0.2034913, 0.2006105, 0.1970161, 0.1927124, 0.1877047, 0.1819991, 
+    0.1756026, 0.1685229, 0.1607687, 0.1523494, 0.1432753, 0.1335574, 
+    0.1232076, 0.1122385, 0.1006635, 0.08849663, 0.07575256, 0.06244722, 
+    0.0485965, 0.0342173, 0.01932725, 0.003944457, -0.01191226, -0.02822387, 
+    -0.04497012, -0.06213087, -0.07968515, -0.0976114, -0.1158882, 
+    -0.1344928, -0.1534028, -0.1725951, -0.1920464, -0.2117328, -0.2316306, 
+    -0.2517154, -0.2719626, -0.2923477, -0.3128459, -0.3334321, -0.3540811, 
+    -0.3747681, -0.3954677, -0.4161547, -0.4368039, -0.4573901, -0.4778882, 
+    -0.4982733, -0.5185206, -0.5386053, -0.5585031, -0.5781896, -0.5976407, 
+    -0.616833, -0.6357431, -0.6543478, -0.6726245, -0.6905509, -0.708105, 
+    -0.7252657, -0.7420121, -0.7583236, -0.7741804, -0.7895631, -0.8044531, 
+    -0.8188324, -0.8326831, -0.8459885, -0.8587325, -0.8708993, -0.8824744, 
+    -0.8934435, -0.9037933, -0.9135112, -0.9225853, -0.9310046, -0.9387588, 
+    -0.9458385, -0.952235, -0.9579406, -0.9629483, -0.967252, -0.9708464, 
+    -0.9737272, -0.9758909, -0.9773348, -0.9780573, -0.9780573, -0.9773348, 
+    -0.9758909, -0.9737272, -0.9708464, -0.967252, -0.9629483, -0.9579406, 
+    -0.952235, -0.9458385, -0.9387588, -0.9310046, -0.9225852, -0.9135112, 
+    -0.9037934, -0.8934435, -0.8824745, -0.8708993, -0.8587325, -0.8459885, 
+    -0.8326831, -0.8188324, -0.8044531, -0.7895632, -0.7741803, -0.7583236, 
+    -0.7420122, -0.7252657, -0.7081051, -0.6905507, -0.6726245, -0.6543477, 
+    -0.6357431, -0.6168332, -0.5976407, -0.5781896, -0.5585029, -0.5386053, 
+    -0.5185207, -0.4982733, -0.4778883, -0.45739, -0.4368039, -0.4161549, 
+    -0.3954677, -0.3747683, -0.3540811, -0.3334321, -0.3128457, -0.2923477, 
+    -0.2719627, -0.2517153, -0.2316307, -0.2117328, -0.1920464, -0.1725953, 
+    -0.1534028, -0.1344929, -0.1158881, -0.09761152, -0.079685, -0.06213087, 
+    -0.04497024, -0.02822375, -0.01191235, 0.003944546, 0.01932725, 
+    0.03421721, 0.0485965, 0.06244713, 0.07575268, 0.08849654, 0.1006634, 
+    0.1122385, 0.1232076,
+  0.1659277, 0.17586, 0.1851342, 0.1937391, 0.2016644, 0.2089002, 0.2154378, 
+    0.2212692, 0.2263874, 0.2307859, 0.2344597, 0.237404, 0.2396155, 
+    0.2410912, 0.2418295, 0.2418295, 0.2410912, 0.2396154, 0.237404, 
+    0.2344597, 0.2307859, 0.2263874, 0.2212692, 0.2154378, 0.2089002, 
+    0.2016644, 0.1937391, 0.1851342, 0.17586, 0.1659277, 0.1553497, 
+    0.1441387, 0.1323083, 0.1198731, 0.106848, 0.09324923, 0.07909304, 
+    0.06439671, 0.04917824, 0.03345618, 0.01724976, 0.0005784035, 
+    -0.01653719, -0.03407639, -0.05201784, -0.07033947, -0.08901936, 
+    -0.1080342, -0.1273613, -0.1469769, -0.1668572, -0.1869778, -0.2073144, 
+    -0.2278421, -0.2485359, -0.2693706, -0.2903209, -0.3113611, -0.3324656, 
+    -0.3536088, -0.3747649, -0.3959082, -0.4170128, -0.4380531, -0.4590032, 
+    -0.4798379, -0.5005317, -0.5210594, -0.541396, -0.5615167, -0.5813968, 
+    -0.6010125, -0.6203395, -0.6393546, -0.6580343, -0.6763561, -0.6942974, 
+    -0.7118366, -0.7289523, -0.7456236, -0.7618301, -0.777552, -0.7927705, 
+    -0.8074668, -0.821623, -0.8352219, -0.8482469, -0.8606821, -0.8725125, 
+    -0.8837235, -0.8943017, -0.9042338, -0.9135081, -0.9221129, -0.9300382, 
+    -0.937274, -0.9438117, -0.949643, -0.9547611, -0.9591597, -0.9628335, 
+    -0.9657779, -0.9679893, -0.969465, -0.9702034, -0.9702034, -0.969465, 
+    -0.9679893, -0.9657779, -0.9628335, -0.9591597, -0.9547611, -0.949643, 
+    -0.9438117, -0.937274, -0.9300382, -0.9221131, -0.9135079, -0.9042338, 
+    -0.8943017, -0.8837235, -0.8725126, -0.8606821, -0.8482469, -0.8352219, 
+    -0.821623, -0.8074669, -0.7927705, -0.7775521, -0.76183, -0.7456236, 
+    -0.7289524, -0.7118366, -0.6942975, -0.676356, -0.6580343, -0.6393545, 
+    -0.6203395, -0.6010126, -0.5813968, -0.5615167, -0.5413959, -0.5210594, 
+    -0.5005319, -0.4798379, -0.4590033, -0.4380529, -0.4170128, -0.3959084, 
+    -0.3747649, -0.353609, -0.3324656, -0.3113611, -0.2903207, -0.2693706, 
+    -0.248536, -0.2278421, -0.2073145, -0.1869778, -0.1668572, -0.1469771, 
+    -0.1273613, -0.1080343, -0.08901921, -0.07033959, -0.05201772, 
+    -0.03407639, -0.01653731, 0.0005785227, 0.01724967, 0.0334563, 
+    0.04917824, 0.06439659, 0.07909304, 0.09324914, 0.1068481, 0.1198731, 
+    0.1323082, 0.1441387, 0.1553496,
+  0.1980959, 0.2082304, 0.2176935, 0.2264737, 0.2345602, 0.2419434, 0.248614, 
+    0.2545642, 0.2597865, 0.2642747, 0.2680232, 0.2710275, 0.273284, 
+    0.2747898, 0.2755432, 0.2755432, 0.2747898, 0.2732839, 0.2710275, 
+    0.2680232, 0.2642747, 0.2597865, 0.2545642, 0.2486141, 0.2419434, 
+    0.2345602, 0.2264737, 0.2176934, 0.2082305, 0.1980959, 0.1873026, 
+    0.1758632, 0.163792, 0.1511036, 0.1378133, 0.1239377, 0.1094932, 
+    0.09449768, 0.07896936, 0.06292719, 0.0463908, 0.02937999, 0.01191592, 
+    -0.005980402, -0.02428713, -0.0429818, -0.062042, -0.08144405, 
+    -0.1011647, -0.1211797, -0.1414647, -0.161995, -0.1827456, -0.2036913, 
+    -0.2248064, -0.2460653, -0.2674422, -0.2889108, -0.310445, -0.3320187, 
+    -0.3536056, -0.3751793, -0.3967136, -0.4181823, -0.4395589, -0.4608178, 
+    -0.481933, -0.5028787, -0.5236293, -0.5441597, -0.5644445, -0.5844596, 
+    -0.6041802, -0.6235824, -0.6426424, -0.6613373, -0.6796439, -0.6975402, 
+    -0.7150044, -0.7320151, -0.7485516, -0.7645936, -0.7801219, -0.7951175, 
+    -0.809562, -0.8234377, -0.8367279, -0.8494163, -0.8614875, -0.8729268, 
+    -0.8837203, -0.8938547, -0.9033178, -0.9120979, -0.9201845, -0.9275676, 
+    -0.9342384, -0.9401885, -0.9454108, -0.949899, -0.9536475, -0.9566518, 
+    -0.9589083, -0.9604141, -0.9611675, -0.9611675, -0.9604141, -0.9589083, 
+    -0.9566518, -0.9536475, -0.949899, -0.9454108, -0.9401885, -0.9342384, 
+    -0.9275676, -0.9201845, -0.9120979, -0.9033177, -0.8938547, -0.8837204, 
+    -0.8729268, -0.8614876, -0.8494163, -0.8367279, -0.8234376, -0.809562, 
+    -0.7951176, -0.7801219, -0.7645937, -0.7485515, -0.7320151, -0.7150044, 
+    -0.6975402, -0.679644, -0.6613371, -0.6426424, -0.6235822, -0.6041802, 
+    -0.5844597, -0.5644445, -0.5441597, -0.5236292, -0.5028787, -0.4819331, 
+    -0.4608178, -0.439559, -0.4181821, -0.3967136, -0.3751795, -0.3536056, 
+    -0.3320188, -0.310445, -0.2889108, -0.267442, -0.2460653, -0.2248065, 
+    -0.2036912, -0.1827457, -0.1619949, -0.1414647, -0.1211798, -0.1011647, 
+    -0.08144417, -0.06204188, -0.04298192, -0.02428699, -0.005980402, 
+    0.0119158, 0.02938011, 0.04639068, 0.06292731, 0.07896936, 0.09449756, 
+    0.1094932, 0.1239375, 0.1378134, 0.1511036, 0.1637919, 0.1758632, 
+    0.1873025,
+  0.2300228, 0.2403471, 0.2499875, 0.2589322, 0.2671703, 0.2746917, 
+    0.2814874, 0.287549, 0.2928692, 0.2974415, 0.3012603, 0.3043208, 
+    0.3066196, 0.3081536, 0.3089211, 0.3089211, 0.3081536, 0.3066196, 
+    0.3043208, 0.3012603, 0.2974415, 0.2928692, 0.287549, 0.2814874, 
+    0.2746917, 0.2671703, 0.2589322, 0.2499875, 0.2403472, 0.2300228, 
+    0.2190272, 0.2073735, 0.1950762, 0.18215, 0.1686107, 0.1544751, 0.13976, 
+    0.1244835, 0.1086643, 0.09232154, 0.07547531, 0.05814579, 0.04035452, 
+    0.02212289, 0.003473163, -0.01557177, -0.03498909, -0.05475464, 
+    -0.07484475, -0.09523475, -0.1158999, -0.1368148, -0.1579542, -0.1792923, 
+    -0.200803, -0.2224603, -0.2442376, -0.2661085, -0.2880461, -0.3100241, 
+    -0.3320154, -0.3539933, -0.3759311, -0.397802, -0.4195791, -0.4412364, 
+    -0.4627472, -0.4840853, -0.5052247, -0.5261397, -0.5468047, -0.5671947, 
+    -0.5872848, -0.6070504, -0.6264676, -0.6455127, -0.6641623, -0.682394, 
+    -0.7001854, -0.7175148, -0.7343611, -0.7507037, -0.766523, -0.7817994, 
+    -0.7965145, -0.8106503, -0.8241895, -0.8371156, -0.849413, -0.8610667, 
+    -0.8720623, -0.8823866, -0.892027, -0.9009717, -0.9092097, -0.9167312, 
+    -0.9235269, -0.9295886, -0.9349087, -0.9394809, -0.9432997, -0.9463603, 
+    -0.9486591, -0.950193, -0.9509605, -0.9509605, -0.950193, -0.9486591, 
+    -0.9463603, -0.9432997, -0.9394809, -0.9349087, -0.9295886, -0.9235269, 
+    -0.9167312, -0.9092097, -0.9009717, -0.8920269, -0.8823866, -0.8720624, 
+    -0.8610667, -0.8494132, -0.8371156, -0.8241895, -0.8106502, -0.7965145, 
+    -0.7817996, -0.766523, -0.7507038, -0.7343609, -0.7175148, -0.7001854, 
+    -0.682394, -0.6641625, -0.6455126, -0.6264676, -0.6070503, -0.5872848, 
+    -0.5671948, -0.5468047, -0.5261397, -0.5052246, -0.4840853, -0.4627473, 
+    -0.4412364, -0.4195793, -0.3978018, -0.3759311, -0.3539935, -0.3320154, 
+    -0.3100242, -0.2880461, -0.2661085, -0.2442375, -0.2224603, -0.2008032, 
+    -0.1792923, -0.1579543, -0.1368147, -0.1158999, -0.0952349, -0.07484475, 
+    -0.05475479, -0.03498897, -0.01557189, 0.003473312, 0.02212289, 
+    0.0403544, 0.05814591, 0.07547522, 0.09232163, 0.1086643, 0.1244834, 
+    0.13976, 0.154475, 0.1686108, 0.18215, 0.1950761, 0.2073735, 0.2190271,
+  0.2616693, 0.272171, 0.2819769, 0.2910751, 0.2994547, 0.3071054, 0.3140177, 
+    0.3201835, 0.325595, 0.3302457, 0.3341301, 0.3372433, 0.3395814, 
+    0.3411418, 0.3419225, 0.3419225, 0.3411418, 0.3395814, 0.3372433, 
+    0.3341301, 0.3302457, 0.325595, 0.3201835, 0.3140177, 0.3071054, 
+    0.2994547, 0.2910751, 0.2819768, 0.272171, 0.2616693, 0.2504849, 
+    0.2386311, 0.2261226, 0.2129744, 0.1992026, 0.1848242, 0.1698565, 
+    0.1543176, 0.1382267, 0.1216033, 0.1044678, 0.08684066, 0.06874385, 
+    0.05019915, 0.03122914, 0.01185718, -0.007893622, -0.0279986, 
+    -0.04843369, -0.06917386, -0.09019385, -0.1114679, -0.1329704, -0.154675, 
+    -0.1765551, -0.1985842, -0.2207355, -0.242982, -0.2652963, -0.2876517, 
+    -0.3100207, -0.3323761, -0.3546906, -0.376937, -0.3990882, -0.4211173, 
+    -0.4429975, -0.4647021, -0.4862045, -0.5074787, -0.5284985, -0.5492387, 
+    -0.5696738, -0.5897789, -0.6095296, -0.6289017, -0.6478716, -0.6664163, 
+    -0.6845132, -0.7021402, -0.7192758, -0.7358991, -0.7519901, -0.7675289, 
+    -0.7824967, -0.7968751, -0.8106469, -0.823795, -0.8363035, -0.8481573, 
+    -0.8593418, -0.8698434, -0.8796493, -0.8887476, -0.8971272, -0.9047778, 
+    -0.9116902, -0.9178559, -0.9232674, -0.9279182, -0.9318025, -0.9349157, 
+    -0.9372539, -0.9388143, -0.939595, -0.939595, -0.9388143, -0.9372539, 
+    -0.9349157, -0.9318025, -0.9279182, -0.9232674, -0.9178559, -0.9116902, 
+    -0.9047778, -0.8971272, -0.8887476, -0.8796493, -0.8698434, -0.8593419, 
+    -0.8481573, -0.8363037, -0.823795, -0.8106469, -0.7968751, -0.7824967, 
+    -0.767529, -0.7519901, -0.7358992, -0.7192757, -0.7021402, -0.6845133, 
+    -0.6664163, -0.6478717, -0.6289016, -0.6095296, -0.5897788, -0.5696738, 
+    -0.5492389, -0.5284985, -0.5074787, -0.4862044, -0.4647021, -0.4429977, 
+    -0.4211173, -0.3990883, -0.3769369, -0.3546906, -0.3323762, -0.3100207, 
+    -0.2876519, -0.2652963, -0.242982, -0.2207354, -0.1985842, -0.1765552, 
+    -0.1546749, -0.1329705, -0.1114679, -0.09019385, -0.06917402, 
+    -0.04843369, -0.02799875, -0.007893473, 0.01185703, 0.03122929, 
+    0.05019915, 0.06874377, 0.08684078, 0.1044677, 0.1216034, 0.1382267, 
+    0.1543175, 0.1698565, 0.1848241, 0.1992027, 0.2129744, 0.2261224, 
+    0.2386311, 0.2504848,
+  0.2929971, 0.3036633, 0.3136228, 0.3228636, 0.3313745, 0.3391449, 
+    0.3461655, 0.3524279, 0.3579242, 0.3626478, 0.366593, 0.3697549, 
+    0.3721298, 0.3737146, 0.3745075, 0.3745075, 0.3737146, 0.3721297, 
+    0.3697549, 0.366593, 0.3626478, 0.3579242, 0.3524279, 0.3461656, 
+    0.3391449, 0.3313745, 0.3228636, 0.3136228, 0.3036633, 0.2929971, 
+    0.2816375, 0.2695981, 0.2568935, 0.2435395, 0.2295519, 0.2149483, 
+    0.199746, 0.1839638, 0.1676208, 0.150737, 0.1333331, 0.1154298, 
+    0.09704956, 0.07821435, 0.05894718, 0.03927174, 0.01921156, -0.001208365, 
+    -0.02196357, -0.04302864, -0.06437789, -0.08598524, -0.1078245, 
+    -0.1298691, -0.152092, -0.1744662, -0.1969645, -0.2195594, -0.2422233, 
+    -0.2649289, -0.2876483, -0.3103539, -0.3330179, -0.3556129, -0.378111, 
+    -0.4004852, -0.4227082, -0.4447528, -0.466592, -0.4881995, -0.5095485, 
+    -0.5306137, -0.5513688, -0.5717889, -0.591849, -0.6115245, -0.6307915, 
+    -0.6496267, -0.6680071, -0.6859103, -0.7033144, -0.720198, -0.736541, 
+    -0.7523233, -0.7675256, -0.7821292, -0.7961167, -0.8094708, -0.8221753, 
+    -0.8342147, -0.8455744, -0.8562405, -0.8662001, -0.8754408, -0.8839517, 
+    -0.8917221, -0.8987429, -0.9050052, -0.9105015, -0.9152251, -0.9191703, 
+    -0.9223322, -0.9247071, -0.9262918, -0.9270847, -0.9270847, -0.9262918, 
+    -0.9247071, -0.9223322, -0.9191703, -0.9152251, -0.9105015, -0.9050052, 
+    -0.8987429, -0.8917221, -0.8839517, -0.8754409, -0.8662, -0.8562405, 
+    -0.8455745, -0.8342147, -0.8221754, -0.8094708, -0.7961167, -0.7821292, 
+    -0.7675256, -0.7523234, -0.736541, -0.7201982, -0.7033142, -0.6859103, 
+    -0.6680073, -0.6496267, -0.6307917, -0.6115243, -0.591849, -0.5717888, 
+    -0.5513688, -0.5306138, -0.5095485, -0.4881995, -0.4665919, -0.4447528, 
+    -0.4227083, -0.4004852, -0.3781112, -0.3556127, -0.3330179, -0.310354, 
+    -0.2876483, -0.2649291, -0.2422233, -0.2195594, -0.1969643, -0.1744662, 
+    -0.1520921, -0.129869, -0.1078246, -0.08598518, -0.06437789, -0.04302879, 
+    -0.02196357, -0.001208514, 0.01921171, 0.03927159, 0.05894732, 
+    0.07821435, 0.09704944, 0.11543, 0.133333, 0.1507371, 0.1676208, 
+    0.1839637, 0.199746, 0.2149482, 0.229552, 0.2435394, 0.2568935, 
+    0.2695981, 0.2816374,
+  0.3239679, 0.3347856, 0.3448865, 0.3542586, 0.3628903, 0.3707712, 
+    0.3778916, 0.3842428, 0.3898172, 0.3946079, 0.3986092, 0.401816, 
+    0.4042245, 0.4058318, 0.406636, 0.406636, 0.4058318, 0.4042245, 0.401816, 
+    0.3986092, 0.3946079, 0.3898172, 0.3842428, 0.3778916, 0.3707712, 
+    0.3628903, 0.3542586, 0.3448865, 0.3347856, 0.3239679, 0.3124469, 
+    0.3002364, 0.2873515, 0.2738077, 0.2596214, 0.2448104, 0.2293922, 
+    0.2133858, 0.1968106, 0.179687, 0.1620359, 0.1438783, 0.1252369, 
+    0.1061341, 0.0865933, 0.06663838, 0.04629326, 0.02558327, 0.004533231, 
+    -0.01683104, -0.03848356, -0.06039783, -0.08254735, -0.104905, 
+    -0.1274436, -0.1501356, -0.1729535, -0.1958694, -0.2188552, -0.2418833, 
+    -0.2649255, -0.2879535, -0.3109395, -0.3338554, -0.3566732, -0.3793652, 
+    -0.4019038, -0.4242615, -0.446411, -0.4683254, -0.4899777, -0.511342, 
+    -0.532392, -0.5531021, -0.5734471, -0.5934023, -0.6129429, -0.6320457, 
+    -0.6506872, -0.6688446, -0.6864959, -0.7036194, -0.7201945, -0.7362009, 
+    -0.7516192, -0.7664304, -0.7806165, -0.7941602, -0.8070452, -0.8192557, 
+    -0.8307767, -0.8415943, -0.8516953, -0.8610674, -0.8696991, -0.8775799, 
+    -0.8847004, -0.8910517, -0.896626, -0.9014168, -0.9054179, -0.9086248, 
+    -0.9110334, -0.9126407, -0.9134449, -0.9134449, -0.9126407, -0.9110334, 
+    -0.9086248, -0.9054179, -0.9014168, -0.896626, -0.8910517, -0.8847004, 
+    -0.8775799, -0.8696991, -0.8610674, -0.8516953, -0.8415943, -0.8307768, 
+    -0.8192557, -0.8070453, -0.7941602, -0.7806165, -0.7664303, -0.7516192, 
+    -0.736201, -0.7201945, -0.7036195, -0.6864958, -0.6688446, -0.6506873, 
+    -0.6320457, -0.6129431, -0.5934021, -0.5734471, -0.553102, -0.532392, 
+    -0.5113422, -0.4899777, -0.4683254, -0.4464108, -0.4242615, -0.401904, 
+    -0.3793652, -0.3566733, -0.3338553, -0.3109395, -0.2879537, -0.2649255, 
+    -0.2418835, -0.2188552, -0.1958694, -0.1729533, -0.1501356, -0.1274437, 
+    -0.1049049, -0.08254743, -0.06039777, -0.03848356, -0.01683119, 
+    0.004533231, 0.02558315, 0.04629341, 0.06663826, 0.08659345, 0.1061341, 
+    0.1252368, 0.1438784, 0.1620357, 0.1796871, 0.1968106, 0.2133856, 
+    0.2293922, 0.2448103, 0.2596215, 0.2738076, 0.2873513, 0.3002364, 
+    0.3124468,
+  0.354544, 0.3655, 0.3757302, 0.3852221, 0.3939642, 0.4019458, 0.4091572, 
+    0.4155897, 0.4212354, 0.4260874, 0.4301398, 0.4333876, 0.435827, 
+    0.4374548, 0.4382693, 0.4382693, 0.4374548, 0.435827, 0.4333876, 
+    0.4301398, 0.4260874, 0.4212354, 0.4155897, 0.4091573, 0.4019458, 
+    0.3939642, 0.3852221, 0.3757301, 0.3655, 0.354544, 0.3428757, 0.3305091, 
+    0.3174593, 0.3037424, 0.2893747, 0.2743743, 0.2587589, 0.2425478, 
+    0.2257607, 0.2084182, 0.1905413, 0.1721515, 0.1532718, 0.1339247, 
+    0.114134, 0.0939239, 0.07331863, 0.05234382, 0.03102461, 0.009387121, 
+    -0.01254228, -0.03473678, -0.05716954, -0.07981312, -0.1026399, 
+    -0.1256221, -0.1487318, -0.1719407, -0.1952205, -0.218543, -0.2418798, 
+    -0.2652023, -0.2884823, -0.3116912, -0.3348007, -0.357783, -0.3806098, 
+    -0.4032534, -0.4256861, -0.4478807, -0.4698099, -0.4914474, -0.5127666, 
+    -0.5337416, -0.5543467, -0.5745569, -0.5943476, -0.6136946, -0.6325744, 
+    -0.6509641, -0.6688411, -0.6861836, -0.7029706, -0.7191818, -0.7347971, 
+    -0.7497977, -0.7641652, -0.7778822, -0.7909319, -0.8032985, -0.8149669, 
+    -0.8259228, -0.836153, -0.8456449, -0.854387, -0.8623686, -0.8695801, 
+    -0.8760126, -0.8816583, -0.8865103, -0.8905626, -0.8938105, -0.8962498, 
+    -0.8978777, -0.8986922, -0.8986922, -0.8978777, -0.8962498, -0.8938105, 
+    -0.8905626, -0.8865103, -0.8816583, -0.8760126, -0.8695801, -0.8623686, 
+    -0.854387, -0.845645, -0.836153, -0.8259228, -0.814967, -0.8032985, 
+    -0.790932, -0.7778822, -0.7641652, -0.7497976, -0.7347971, -0.7191818, 
+    -0.7029706, -0.6861837, -0.668841, -0.6509641, -0.6325746, -0.6136946, 
+    -0.5943477, -0.5745568, -0.5543467, -0.5337415, -0.5127666, -0.4914476, 
+    -0.4698099, -0.4478807, -0.4256859, -0.4032534, -0.3806099, -0.357783, 
+    -0.3348009, -0.311691, -0.2884823, -0.2652025, -0.2418798, -0.2185432, 
+    -0.1952205, -0.1719407, -0.1487316, -0.1256221, -0.10264, -0.07981305, 
+    -0.05716962, -0.03473672, -0.01254228, 0.009386972, 0.03102461, 
+    0.05234367, 0.07331878, 0.09392378, 0.1141342, 0.1339247, 0.1532716, 
+    0.1721517, 0.1905411, 0.2084183, 0.2257607, 0.2425477, 0.2587589, 
+    0.2743742, 0.2893748, 0.3037423, 0.3174592, 0.3305091, 0.3428756,
+  0.3846882, 0.3957691, 0.406116, 0.4157162, 0.424558, 0.4326307, 0.4399244, 
+    0.4464303, 0.4521404, 0.4570477, 0.4611464, 0.4644312, 0.4668984, 
+    0.4685448, 0.4693686, 0.4693686, 0.4685448, 0.4668984, 0.4644312, 
+    0.4611464, 0.4570477, 0.4521404, 0.4464303, 0.4399245, 0.4326307, 
+    0.424558, 0.4157162, 0.406116, 0.3957692, 0.3846882, 0.3728867, 0.360379, 
+    0.3471805, 0.333307, 0.3187755, 0.3036039, 0.2878104, 0.2714144, 
+    0.2544358, 0.2368954, 0.2188146, 0.200215, 0.1811199, 0.1615521, 
+    0.1415356, 0.121095, 0.1002547, 0.07904056, 0.05747816, 0.03559384, 
+    0.01341428, -0.009033427, -0.03172208, -0.05462398, -0.07771111, 
+    -0.1009555, -0.1243288, -0.1478025, -0.1713479, -0.1949365, -0.2185395, 
+    -0.2421281, -0.2656736, -0.2891473, -0.3125204, -0.3357648, -0.358852, 
+    -0.3817539, -0.4044426, -0.4268904, -0.4490698, -0.4709541, -0.4925165, 
+    -0.5137308, -0.5345709, -0.5550117, -0.5750281, -0.5945958, -0.6136911, 
+    -0.6322905, -0.6503714, -0.6679118, -0.6848903, -0.7012864, -0.7170799, 
+    -0.7322515, -0.746783, -0.7606564, -0.773855, -0.7863627, -0.7981642, 
+    -0.8092451, -0.819592, -0.8291922, -0.838034, -0.8461067, -0.8534005, 
+    -0.8599063, -0.8656164, -0.8705237, -0.8746223, -0.8779072, -0.8803744, 
+    -0.8820208, -0.8828446, -0.8828446, -0.8820208, -0.8803744, -0.8779072, 
+    -0.8746223, -0.8705237, -0.8656164, -0.8599063, -0.8534005, -0.8461067, 
+    -0.838034, -0.8291922, -0.8195919, -0.8092451, -0.7981643, -0.7863627, 
+    -0.7738551, -0.7606564, -0.746783, -0.7322515, -0.7170799, -0.7012864, 
+    -0.6848903, -0.6679119, -0.6503713, -0.6322905, -0.6136912, -0.5945958, 
+    -0.5750282, -0.5550116, -0.5345709, -0.5137306, -0.4925165, -0.4709542, 
+    -0.4490698, -0.4268904, -0.4044424, -0.3817539, -0.3588522, -0.3357648, 
+    -0.3125206, -0.2891471, -0.2656736, -0.2421282, -0.2185395, -0.1949366, 
+    -0.1713479, -0.1478025, -0.1243287, -0.1009555, -0.07771127, -0.0546239, 
+    -0.03172216, -0.009033367, 0.01341428, 0.03559367, 0.05747816, 
+    0.07904041, 0.1002548, 0.1210949, 0.1415358, 0.1615521, 0.1811198, 
+    0.2002151, 0.2188144, 0.2368955, 0.2544358, 0.2714143, 0.2878104, 
+    0.3036038, 0.3187756, 0.333307, 0.3471804, 0.360379, 0.3728867,
+  0.4143636, 0.425556, 0.436007, 0.4457038, 0.4546346, 0.4627885, 0.4701556, 
+    0.4767269, 0.4824944, 0.4874511, 0.4915909, 0.4949089, 0.4974009, 
+    0.4990639, 0.499896, 0.499896, 0.4990639, 0.4974009, 0.4949089, 
+    0.4915909, 0.4874511, 0.4824944, 0.4767269, 0.4701556, 0.4627885, 
+    0.4546346, 0.4457038, 0.436007, 0.4255561, 0.4143636, 0.4024434, 
+    0.3898099, 0.3764785, 0.3624655, 0.3477878, 0.3324635, 0.3165112, 
+    0.2999502, 0.2828008, 0.2650839, 0.2468212, 0.2280345, 0.2087473, 
+    0.1889827, 0.1687648, 0.1481185, 0.1270685, 0.105641, 0.08386162, 
+    0.06175715, 0.03935444, 0.01668091, -0.006236017, -0.02936831, 
+    -0.05268772, -0.07616599, -0.09977443, -0.1234843, -0.1472665, 
+    -0.1710924, -0.1949329, -0.2187588, -0.2425412, -0.2662511, -0.2898594, 
+    -0.3133376, -0.3366571, -0.3597894, -0.3827063, -0.40538, -0.4277825, 
+    -0.4498869, -0.4716663, -0.493094, -0.5141438, -0.5347903, -0.5550081, 
+    -0.5747726, -0.59406, -0.6128465, -0.6311094, -0.6488261, -0.6659756, 
+    -0.6825365, -0.698489, -0.7138132, -0.7284908, -0.7425039, -0.7558353, 
+    -0.7684689, -0.7803891, -0.7915814, -0.8020324, -0.8117292, -0.8206599, 
+    -0.8288138, -0.8361809, -0.8427522, -0.8485198, -0.8534765, -0.8576163, 
+    -0.8609343, -0.8634263, -0.8650893, -0.8659214, -0.8659214, -0.8650893, 
+    -0.8634263, -0.8609343, -0.8576163, -0.8534765, -0.8485198, -0.8427522, 
+    -0.8361809, -0.8288138, -0.8206599, -0.8117292, -0.8020324, -0.7915814, 
+    -0.7803891, -0.7684689, -0.7558354, -0.7425039, -0.7284908, -0.7138132, 
+    -0.698489, -0.6825366, -0.6659756, -0.6488262, -0.6311092, -0.6128465, 
+    -0.5940601, -0.5747726, -0.5550082, -0.5347902, -0.5141438, -0.4930938, 
+    -0.4716663, -0.4498871, -0.4277825, -0.40538, -0.3827062, -0.3597894, 
+    -0.3366573, -0.3133376, -0.2898595, -0.2662509, -0.2425412, -0.218759, 
+    -0.1949329, -0.1710926, -0.1472665, -0.1234843, -0.09977426, -0.07616599, 
+    -0.05268787, -0.02936824, -0.006236091, 0.01668097, 0.03935444, 0.061757, 
+    0.08386162, 0.1056408, 0.1270686, 0.1481184, 0.1687649, 0.1889827, 
+    0.2087471, 0.2280346, 0.246821, 0.265084, 0.2828008, 0.2999501, 
+    0.3165112, 0.3324634, 0.3477879, 0.3624655, 0.3764784, 0.3898099, 
+    0.4024433,
+  0.4435343, 0.4548246, 0.4653669, 0.4751484, 0.4841573, 0.4923825, 
+    0.4998139, 0.5064427, 0.5122607, 0.5172607, 0.5214368, 0.5247837, 
+    0.5272975, 0.528975, 0.5298144, 0.5298144, 0.528975, 0.5272974, 
+    0.5247837, 0.5214368, 0.5172607, 0.5122607, 0.5064427, 0.499814, 
+    0.4923825, 0.4841573, 0.4751484, 0.4653668, 0.4548246, 0.4435343, 
+    0.4315099, 0.4187659, 0.405318, 0.3911825, 0.3763764, 0.3609182, 
+    0.3448264, 0.3281206, 0.3108213, 0.2929495, 0.2745271, 0.2555763, 
+    0.2361204, 0.216183, 0.1957884, 0.1749616, 0.1537276, 0.1321127, 
+    0.110143, 0.08784525, 0.0652467, 0.04237495, 0.01925768, -0.004076838, 
+    -0.02760011, -0.05128364, -0.07509846, -0.09901559, -0.1230057, 
+    -0.1470399, -0.1710888, -0.195123, -0.2191133, -0.2430305, -0.2668451, 
+    -0.2905287, -0.314052, -0.3373865, -0.3605038, -0.3833756, -0.405974, 
+    -0.4282717, -0.4502415, -0.4718565, -0.4930904, -0.5139173, -0.5343118, 
+    -0.5542492, -0.5737052, -0.5926559, -0.6110784, -0.6289501, -0.6462494, 
+    -0.6629552, -0.679047, -0.6945053, -0.7093112, -0.7234468, -0.7368947, 
+    -0.7496387, -0.7616631, -0.7729534, -0.7834957, -0.7932772, -0.8022861, 
+    -0.8105113, -0.8179428, -0.8245715, -0.8303895, -0.8353895, -0.8395655, 
+    -0.8429125, -0.8454263, -0.8471038, -0.8479432, -0.8479432, -0.8471038, 
+    -0.8454263, -0.8429125, -0.8395655, -0.8353895, -0.8303895, -0.8245715, 
+    -0.8179428, -0.8105113, -0.8022861, -0.7932773, -0.7834956, -0.7729534, 
+    -0.7616632, -0.7496387, -0.7368948, -0.7234468, -0.7093112, -0.6945052, 
+    -0.679047, -0.6629553, -0.6462494, -0.6289502, -0.6110783, -0.5926559, 
+    -0.5737053, -0.5542492, -0.5343119, -0.5139171, -0.4930904, -0.4718563, 
+    -0.4502415, -0.4282719, -0.405974, -0.3833756, -0.3605036, -0.3373865, 
+    -0.3140522, -0.2905287, -0.2668453, -0.2430303, -0.2191133, -0.1951232, 
+    -0.1710888, -0.1470401, -0.1230057, -0.09901559, -0.0750983, -0.05128364, 
+    -0.02760027, -0.004076764, 0.01925761, 0.04237501, 0.0652467, 0.08784509, 
+    0.110143, 0.1321126, 0.1537277, 0.1749614, 0.1957885, 0.216183, 
+    0.2361203, 0.2555764, 0.274527, 0.2929496, 0.3108213, 0.3281205, 
+    0.3448264, 0.3609181, 0.3763765, 0.3911824, 0.4053178, 0.4187659, 
+    0.4315098,
+  0.4721645, 0.4835389, 0.4941597, 0.5040141, 0.5130901, 0.5213766, 
+    0.5288634, 0.5355415, 0.5414028, 0.54644, 0.5506472, 0.554019, 0.5565516, 
+    0.5582416, 0.5590872, 0.5590872, 0.5582416, 0.5565516, 0.554019, 
+    0.5506472, 0.54644, 0.5414028, 0.5355415, 0.5288634, 0.5213766, 
+    0.5130901, 0.5040141, 0.4941597, 0.4835389, 0.4721645, 0.4600505, 
+    0.4472117, 0.4336636, 0.4194228, 0.4045064, 0.3889331, 0.3727214, 
+    0.3558912, 0.3384631, 0.3204582, 0.3018986, 0.2828066, 0.2632058, 
+    0.2431199, 0.2225734, 0.2015915, 0.1801993, 0.1584235, 0.1362901, 
+    0.1138263, 0.09105945, 0.06801735, 0.04472789, 0.02121957, -0.002478898, 
+    -0.02633881, -0.05033101, -0.07442628, -0.09859508, -0.1228083, 
+    -0.1470363, -0.1712495, -0.1954185, -0.2195138, -0.2435058, -0.2673657, 
+    -0.2910643, -0.3145726, -0.337862, -0.3609042, -0.3836709, -0.4061347, 
+    -0.4282681, -0.4500441, -0.4714361, -0.4924182, -0.5129645, -0.5330504, 
+    -0.5526513, -0.5717432, -0.5903029, -0.6083077, -0.6257359, -0.6425661, 
+    -0.6587778, -0.6743512, -0.6892674, -0.7035082, -0.7170563, -0.7298952, 
+    -0.7420092, -0.7533835, -0.7640043, -0.7738587, -0.7829347, -0.7912211, 
+    -0.798708, -0.8053861, -0.8112474, -0.8162847, -0.8204918, -0.8238637, 
+    -0.8263962, -0.8280863, -0.8289319, -0.8289319, -0.8280863, -0.8263962, 
+    -0.8238637, -0.8204918, -0.8162847, -0.8112474, -0.8053861, -0.798708, 
+    -0.7912211, -0.7829347, -0.7738588, -0.7640043, -0.7533835, -0.7420093, 
+    -0.7298952, -0.7170564, -0.7035082, -0.6892674, -0.6743511, -0.6587778, 
+    -0.6425661, -0.6257359, -0.6083078, -0.5903028, -0.5717432, -0.5526515, 
+    -0.5330504, -0.5129647, -0.4924181, -0.4714361, -0.4500439, -0.4282681, 
+    -0.4061349, -0.3836709, -0.3609042, -0.3378619, -0.3145726, -0.2910644, 
+    -0.2673657, -0.243506, -0.2195136, -0.1954185, -0.1712497, -0.1470363, 
+    -0.1228085, -0.09859508, -0.07442628, -0.05033085, -0.02633881, 
+    -0.002479061, 0.02121966, 0.04472782, 0.06801741, 0.09105945, 0.1138261, 
+    0.1362901, 0.1584233, 0.1801995, 0.2015914, 0.2225736, 0.2431199, 
+    0.2632057, 0.2828067, 0.3018985, 0.3204583, 0.3384631, 0.3558911, 
+    0.3727214, 0.388933, 0.4045066, 0.4194227, 0.4336635, 0.4472117, 0.4600505,
+  0.5002195, 0.5116642, 0.5223505, 0.5322658, 0.5413978, 0.5497354, 
+    0.5572685, 0.5639879, 0.5698853, 0.5749537, 0.5791868, 0.5825795, 
+    0.5851277, 0.5868281, 0.5876789, 0.5876789, 0.5868281, 0.5851276, 
+    0.5825795, 0.5791868, 0.5749537, 0.5698853, 0.5639879, 0.5572685, 
+    0.5497354, 0.5413978, 0.5322658, 0.5223505, 0.5116642, 0.5002195, 
+    0.4880308, 0.4751126, 0.4614809, 0.4471522, 0.4321437, 0.4164742, 
+    0.4001624, 0.3832283, 0.3656925, 0.3475765, 0.3289023, 0.3096924, 
+    0.2899706, 0.2697607, 0.2490873, 0.2279758, 0.2064515, 0.1845413, 
+    0.1622712, 0.1396687, 0.1167613, 0.09357689, 0.07014364, 0.04649016, 
+    0.02264537, -0.001361884, -0.02550223, -0.04974627, -0.07406431, 
+    -0.09842706, -0.1228046, -0.1471674, -0.1714856, -0.1957296, -0.2198698, 
+    -0.2438771, -0.267722, -0.2913754, -0.3148087, -0.3379931, -0.3609004, 
+    -0.3835029, -0.405773, -0.4276834, -0.4492075, -0.4703192, -0.4909924, 
+    -0.5112023, -0.5309242, -0.550134, -0.5688083, -0.5869243, -0.60446, 
+    -0.6213942, -0.6377059, -0.6533755, -0.6683838, -0.6827126, -0.6963444, 
+    -0.7092625, -0.7214513, -0.7328959, -0.7435822, -0.7534975, -0.7626295, 
+    -0.7709671, -0.7785002, -0.7852196, -0.7911171, -0.7961854, -0.8004185, 
+    -0.8038112, -0.8063594, -0.8080599, -0.8089107, -0.8089107, -0.8080599, 
+    -0.8063594, -0.8038112, -0.8004185, -0.7961854, -0.7911171, -0.7852196, 
+    -0.7785002, -0.7709671, -0.7626295, -0.7534976, -0.7435822, -0.7328959, 
+    -0.7214514, -0.7092625, -0.6963445, -0.6827126, -0.6683838, -0.6533754, 
+    -0.6377059, -0.6213943, -0.60446, -0.5869244, -0.5688082, -0.550134, 
+    -0.5309243, -0.5112023, -0.4909925, -0.470319, -0.4492075, -0.4276832, 
+    -0.405773, -0.3835031, -0.3609004, -0.3379931, -0.3148085, -0.2913754, 
+    -0.2677221, -0.2438771, -0.21987, -0.1957295, -0.1714856, -0.1471675, 
+    -0.1228046, -0.09842722, -0.07406431, -0.04974627, -0.02550206, 
+    -0.001361884, 0.02264521, 0.04649024, 0.07014355, 0.09357695, 0.1167613, 
+    0.1396686, 0.1622712, 0.1845411, 0.2064517, 0.2279757, 0.2490874, 
+    0.2697607, 0.2899705, 0.3096925, 0.3289022, 0.3475766, 0.3656925, 
+    0.3832282, 0.4001624, 0.4164741, 0.4321438, 0.447152, 0.4614808, 
+    0.4751126, 0.4880306,
+  0.527665, 0.5391659, 0.5499049, 0.5598689, 0.5690458, 0.5774245, 0.5849945, 
+    0.5917469, 0.5976734, 0.6027668, 0.6070207, 0.6104301, 0.6129907, 
+    0.6146996, 0.6155546, 0.6155546, 0.6146996, 0.6129907, 0.6104301, 
+    0.6070207, 0.6027668, 0.5976734, 0.5917469, 0.5849946, 0.5774245, 
+    0.5690458, 0.5598689, 0.5499048, 0.5391659, 0.527665, 0.5154163, 
+    0.5024346, 0.4887359, 0.4743367, 0.4592544, 0.4435079, 0.4271158, 
+    0.4100984, 0.3924764, 0.3742712, 0.3555052, 0.3362008, 0.316382, 
+    0.2960727, 0.2752976, 0.2540824, 0.2324522, 0.2104342, 0.1880546, 
+    0.1653409, 0.1423208, 0.1190224, 0.09547391, 0.07170408, 0.04774202, 
+    0.0236167, -0.0006423742, -0.02500566, -0.04944331, -0.07392587, 
+    -0.09842335, -0.1229059, -0.1473437, -0.171707, -0.1959659, -0.2200913, 
+    -0.2440534, -0.2678232, -0.2913717, -0.3146702, -0.3376901, -0.3604038, 
+    -0.3827834, -0.4048016, -0.4264316, -0.447647, -0.4684219, -0.4887313, 
+    -0.5085502, -0.5278544, -0.5466206, -0.5648257, -0.5824476, -0.5994651, 
+    -0.6158571, -0.6316038, -0.646686, -0.6610851, -0.6747839, -0.6877657, 
+    -0.7000144, -0.7115152, -0.7222542, -0.7322182, -0.7413951, -0.7497737, 
+    -0.7573439, -0.7640963, -0.7700227, -0.7751161, -0.77937, -0.7827794, 
+    -0.7853401, -0.7870489, -0.7879039, -0.7879039, -0.7870489, -0.7853401, 
+    -0.7827794, -0.77937, -0.7751161, -0.7700227, -0.7640963, -0.7573439, 
+    -0.7497737, -0.7413951, -0.7322183, -0.7222542, -0.7115152, -0.7000145, 
+    -0.6877657, -0.674784, -0.6610851, -0.646686, -0.6316037, -0.6158571, 
+    -0.5994652, -0.5824476, -0.5648258, -0.5466205, -0.5278544, -0.5085503, 
+    -0.4887313, -0.4684221, -0.4476469, -0.4264316, -0.4048014, -0.3827834, 
+    -0.360404, -0.3376901, -0.3146702, -0.2913716, -0.2678232, -0.2440536, 
+    -0.2200913, -0.1959661, -0.1717069, -0.1473437, -0.1229061, -0.09842335, 
+    -0.07392604, -0.04944331, -0.02500566, -0.0006422102, 0.0236167, 
+    0.04774185, 0.07170417, 0.09547382, 0.1190225, 0.1423208, 0.1653408, 
+    0.1880546, 0.210434, 0.2324524, 0.2540822, 0.2752978, 0.2960727, 
+    0.3163819, 0.3362009, 0.3555051, 0.3742714, 0.3924764, 0.4100983, 
+    0.4271158, 0.4435077, 0.4592545, 0.4743366, 0.4887357, 0.5024346, 
+    0.5154162,
+  0.5544677, 0.5660109, 0.5767894, 0.58679, 0.5960007, 0.6044101, 0.612008, 
+    0.6187852, 0.6247335, 0.6298455, 0.6341151, 0.637537, 0.6401072, 
+    0.6418222, 0.6426803, 0.6426803, 0.6418222, 0.6401071, 0.637537, 
+    0.6341151, 0.6298455, 0.6247335, 0.6187852, 0.612008, 0.6044101, 
+    0.5960007, 0.58679, 0.5767893, 0.566011, 0.5544677, 0.542174, 0.5291446, 
+    0.5153955, 0.5009433, 0.4858056, 0.4700012, 0.4535489, 0.436469, 
+    0.4187821, 0.40051, 0.3816751, 0.3622997, 0.3424081, 0.3220241, 
+    0.3011726, 0.2798794, 0.2581697, 0.2360707, 0.2136089, 0.1908117, 
+    0.167707, 0.1443229, 0.1206879, 0.09683068, 0.07278052, 0.04856652, 
+    0.02421826, -0.0002345778, -0.02476205, -0.04933461, -0.07392215, 
+    -0.09849471, -0.1230224, -0.1474752, -0.1718233, -0.1960373, -0.2200875, 
+    -0.2439447, -0.2675798, -0.2909639, -0.3140685, -0.3368656, -0.3593275, 
+    -0.3814266, -0.4031361, -0.4244296, -0.4452808, -0.4656648, -0.4855566, 
+    -0.5049318, -0.5237669, -0.5420389, -0.5597257, -0.5768057, -0.593258, 
+    -0.6090625, -0.6242001, -0.6386522, -0.6524014, -0.6654308, -0.6777245, 
+    -0.6892677, -0.7000462, -0.7100468, -0.7192574, -0.7276669, -0.7352648, 
+    -0.742042, -0.7479903, -0.7531023, -0.7573719, -0.7607938, -0.763364, 
+    -0.765079, -0.7659371, -0.7659371, -0.765079, -0.763364, -0.7607938, 
+    -0.7573719, -0.7531023, -0.7479903, -0.742042, -0.7352648, -0.7276669, 
+    -0.7192574, -0.7100468, -0.7000461, -0.6892677, -0.6777247, -0.6654308, 
+    -0.6524014, -0.6386522, -0.6242001, -0.6090624, -0.593258, -0.5768058, 
+    -0.5597257, -0.542039, -0.5237668, -0.5049318, -0.4855567, -0.4656648, 
+    -0.445281, -0.4244294, -0.4031361, -0.3814265, -0.3593275, -0.3368658, 
+    -0.3140685, -0.2909639, -0.2675796, -0.2439447, -0.2200877, -0.1960373, 
+    -0.1718235, -0.147475, -0.1230224, -0.09849488, -0.07392215, -0.04933478, 
+    -0.02476205, -0.0002345778, 0.02421844, 0.04856652, 0.07278036, 
+    0.09683076, 0.1206878, 0.144323, 0.167707, 0.1908116, 0.2136089, 
+    0.2360706, 0.2581699, 0.2798792, 0.3011728, 0.3220241, 0.3424079, 
+    0.3622998, 0.3816749, 0.4005102, 0.4187821, 0.4364688, 0.4535489, 
+    0.470001, 0.4858057, 0.5009432, 0.5153953, 0.5291446, 0.5421739,
+  0.5805948, 0.5921662, 0.602971, 0.612996, 0.6222292, 0.6306592, 0.6382757, 
+    0.6450695, 0.6510323, 0.6561568, 0.6604369, 0.6638671, 0.6664435, 
+    0.6681628, 0.669023, 0.669023, 0.6681628, 0.6664435, 0.6638671, 
+    0.6604369, 0.6561568, 0.6510323, 0.6450695, 0.6382757, 0.6306592, 
+    0.6222292, 0.612996, 0.602971, 0.5921662, 0.5805948, 0.568271, 0.5552098, 
+    0.541427, 0.5269396, 0.5117649, 0.4959218, 0.4794293, 0.4623076, 
+    0.4445776, 0.4262608, 0.4073798, 0.3879571, 0.3680168, 0.347583, 
+    0.3266806, 0.3053353, 0.2835726, 0.2614196, 0.2389029, 0.21605, 
+    0.1928888, 0.1694476, 0.1457548, 0.1218393, 0.09773032, 0.07345714, 
+    0.04904938, 0.02453677, -5.064905e-05, -0.02468327, -0.0493309, 
+    -0.07396352, -0.09855111, -0.1230637, -0.1474713, -0.1717445, -0.1958535, 
+    -0.219769, -0.2434618, -0.2669031, -0.2900642, -0.3129171, -0.3354338, 
+    -0.3575869, -0.3793495, -0.400695, -0.4215972, -0.442031, -0.4619714, 
+    -0.481394, -0.5002751, -0.5185918, -0.5363218, -0.5534435, -0.569936, 
+    -0.5857791, -0.6009537, -0.6154411, -0.6292239, -0.6422852, -0.654609, 
+    -0.6661804, -0.6769851, -0.6870102, -0.6962433, -0.7046733, -0.7122899, 
+    -0.7190837, -0.7250465, -0.730171, -0.734451, -0.7378813, -0.7404577, 
+    -0.742177, -0.7430372, -0.7430372, -0.742177, -0.7404577, -0.7378813, 
+    -0.734451, -0.730171, -0.7250465, -0.7190837, -0.7122899, -0.7046733, 
+    -0.6962433, -0.6870103, -0.6769851, -0.6661804, -0.6546091, -0.6422852, 
+    -0.6292241, -0.6154411, -0.6009537, -0.5857791, -0.569936, -0.5534436, 
+    -0.5363218, -0.5185919, -0.500275, -0.481394, -0.4619715, -0.442031, 
+    -0.4215974, -0.4006948, -0.3793495, -0.3575868, -0.3354338, -0.3129172, 
+    -0.2900642, -0.2669031, -0.2434617, -0.219769, -0.1958537, -0.1717445, 
+    -0.1474715, -0.1230635, -0.09855111, -0.07396369, -0.0493309, 
+    -0.02468343, -5.064905e-05, 0.02453677, 0.04904955, 0.07345714, 
+    0.09773016, 0.1218393, 0.1457547, 0.1694477, 0.1928888, 0.2160498, 
+    0.2389029, 0.2614194, 0.2835727, 0.3053352, 0.3266808, 0.347583, 
+    0.3680167, 0.3879572, 0.4073797, 0.4262609, 0.4445776, 0.4623075, 
+    0.4794293, 0.4959216, 0.511765, 0.5269395, 0.5414269, 0.5552098, 0.5682709,
+  0.6060145, 0.6176001, 0.628418, 0.6384553, 0.6476998, 0.65614, 0.6637658, 
+    0.6705679, 0.676538, 0.6816688, 0.685954, 0.6893885, 0.691968, 0.6936894, 
+    0.6945507, 0.6945507, 0.6936894, 0.691968, 0.6893885, 0.685954, 
+    0.6816688, 0.676538, 0.6705679, 0.6637658, 0.65614, 0.6476998, 0.6384553, 
+    0.628418, 0.6176001, 0.6060145, 0.5936757, 0.5805986, 0.566799, 
+    0.5522939, 0.5371007, 0.5212383, 0.5047257, 0.4875831, 0.4698314, 
+    0.4514923, 0.4325883, 0.4131419, 0.3931773, 0.3727186, 0.3517907, 
+    0.3304193, 0.30863, 0.28645, 0.2639058, 0.2410251, 0.2178356, 0.1943658, 
+    0.1706441, 0.1466994, 0.1225611, 0.09825829, 0.07382075, 0.04927825, 
+    0.02466083, -1.833774e-06, -0.02467953, -0.0493422, -0.07395979, 
+    -0.0985023, -0.1229397, -0.1472425, -0.1713809, -0.1953256, -0.2190473, 
+    -0.2425172, -0.2657065, -0.2885872, -0.3111314, -0.3333116, -0.3551007, 
+    -0.3764722, -0.3974, -0.4178587, -0.4378234, -0.4572697, -0.4761739, 
+    -0.4945129, -0.5122645, -0.5294071, -0.5459197, -0.5617822, -0.5769753, 
+    -0.5914804, -0.60528, -0.6183572, -0.6306961, -0.6422815, -0.6530995, 
+    -0.6631368, -0.6723812, -0.6808215, -0.6884473, -0.6952494, -0.7012194, 
+    -0.7063502, -0.7106354, -0.7140699, -0.7166495, -0.7183709, -0.7192321, 
+    -0.7192321, -0.7183709, -0.7166495, -0.7140699, -0.7106354, -0.7063502, 
+    -0.7012194, -0.6952494, -0.6884473, -0.6808215, -0.6723812, -0.6631368, 
+    -0.6530994, -0.6422815, -0.6306961, -0.6183572, -0.6052801, -0.5914804, 
+    -0.5769753, -0.5617821, -0.5459197, -0.5294072, -0.5122645, -0.494513, 
+    -0.4761738, -0.4572697, -0.4378235, -0.4178587, -0.3974001, -0.3764721, 
+    -0.3551007, -0.3333114, -0.3111314, -0.2885874, -0.2657065, -0.2425172, 
+    -0.2190471, -0.1953256, -0.171381, -0.1472425, -0.1229398, -0.09850213, 
+    -0.07395979, -0.04934237, -0.02467953, -2.002344e-06, 0.02466083, 
+    0.04927825, 0.07382093, 0.09825829, 0.1225609, 0.1466995, 0.170644, 
+    0.1943659, 0.2178356, 0.2410249, 0.2639058, 0.2864499, 0.3086302, 
+    0.3304192, 0.3517908, 0.3727186, 0.3931772, 0.413142, 0.4325882, 
+    0.4514925, 0.4698314, 0.487583, 0.5047257, 0.5212381, 0.5371008, 
+    0.5522938, 0.5667989, 0.5805986, 0.5936757,
+  0.630696, 0.6422815, 0.6530995, 0.6631368, 0.6723812, 0.6808215, 0.6884473, 
+    0.6952494, 0.7012194, 0.7063502, 0.7106355, 0.7140699, 0.7166495, 
+    0.7183709, 0.7192321, 0.7192321, 0.7183709, 0.7166494, 0.7140699, 
+    0.7106355, 0.7063502, 0.7012194, 0.6952494, 0.6884473, 0.6808215, 
+    0.6723812, 0.6631368, 0.6530995, 0.6422815, 0.630696, 0.6183572, 0.60528, 
+    0.5914804, 0.5769753, 0.5617821, 0.5459198, 0.5294071, 0.5122645, 
+    0.4945129, 0.4761738, 0.4572697, 0.4378233, 0.4178587, 0.3974, 0.3764721, 
+    0.3551008, 0.3333115, 0.3111315, 0.2885873, 0.2657065, 0.2425171, 
+    0.2190473, 0.1953255, 0.1713809, 0.1472425, 0.1229397, 0.09850219, 
+    0.07395968, 0.04934226, 0.02467959, 1.895241e-06, -0.02466077, 
+    -0.04927836, -0.07382087, -0.09825823, -0.122561, -0.1466995, -0.1706441, 
+    -0.1943659, -0.2178357, -0.241025, -0.2639058, -0.28645, -0.3086301, 
+    -0.3304192, -0.3517908, -0.3727185, -0.3931772, -0.4131419, -0.4325882, 
+    -0.4514924, -0.4698314, -0.4875831, -0.5047256, -0.5212383, -0.5371007, 
+    -0.5522938, -0.566799, -0.5805986, -0.5936757, -0.6060146, -0.6176001, 
+    -0.628418, -0.6384553, -0.6476997, -0.65614, -0.6637658, -0.6705679, 
+    -0.676538, -0.6816688, -0.685954, -0.6893885, -0.691968, -0.6936894, 
+    -0.6945507, -0.6945507, -0.6936894, -0.691968, -0.6893885, -0.685954, 
+    -0.6816688, -0.676538, -0.6705679, -0.6637658, -0.65614, -0.6476997, 
+    -0.6384554, -0.628418, -0.6176001, -0.6060147, -0.5936757, -0.5805987, 
+    -0.566799, -0.5522938, -0.5371007, -0.5212383, -0.5047258, -0.4875831, 
+    -0.4698315, -0.4514923, -0.4325882, -0.4131421, -0.3931772, -0.3727187, 
+    -0.3517906, -0.3304192, -0.30863, -0.28645, -0.2639059, -0.241025, 
+    -0.2178357, -0.1943657, -0.1706441, -0.1466996, -0.122561, -0.0982584, 
+    -0.0738207, -0.04927836, -0.02466094, 1.895241e-06, 0.02467943, 
+    0.04934226, 0.07395968, 0.09850236, 0.1229397, 0.1472423, 0.1713809, 
+    0.1953254, 0.2190473, 0.2425171, 0.2657064, 0.2885873, 0.3111313, 
+    0.3333116, 0.3551006, 0.3764723, 0.3974, 0.4178586, 0.4378234, 0.4572696, 
+    0.4761739, 0.4945129, 0.5122644, 0.5294071, 0.5459196, 0.5617822, 
+    0.5769753, 0.5914803, 0.60528, 0.6183571,
+  0.654609, 0.6661804, 0.6769851, 0.6870102, 0.6962434, 0.7046734, 0.7122899, 
+    0.7190837, 0.7250465, 0.730171, 0.7344511, 0.7378813, 0.7404577, 
+    0.742177, 0.7430372, 0.7430372, 0.742177, 0.7404577, 0.7378813, 
+    0.7344511, 0.730171, 0.7250465, 0.7190837, 0.7122899, 0.7046734, 
+    0.6962434, 0.6870102, 0.6769851, 0.6661804, 0.654609, 0.6422852, 
+    0.6292239, 0.6154412, 0.6009538, 0.5857791, 0.569936, 0.5534436, 
+    0.5363218, 0.5185918, 0.5002751, 0.481394, 0.4619713, 0.4420311, 
+    0.4215973, 0.4006948, 0.3793496, 0.3575868, 0.3354338, 0.3129171, 
+    0.2900642, 0.266903, 0.2434618, 0.219769, 0.1958535, 0.1717445, 
+    0.1474714, 0.1230636, 0.098551, 0.07396358, 0.04933096, 0.02468333, 
+    5.070865e-05, -0.02453688, -0.04904949, -0.07345709, -0.09773026, 
+    -0.1218393, -0.1457548, -0.1694476, -0.1928889, -0.2160499, -0.2389028, 
+    -0.2614195, -0.2835727, -0.3053353, -0.3266807, -0.347583, -0.3680168, 
+    -0.3879572, -0.4073797, -0.4262609, -0.4445775, -0.4623075, -0.4794293, 
+    -0.4959218, -0.5117649, -0.5269395, -0.541427, -0.5552098, -0.568271, 
+    -0.5805948, -0.5921662, -0.602971, -0.612996, -0.6222292, -0.6306592, 
+    -0.6382757, -0.6450695, -0.6510323, -0.6561568, -0.6604368, -0.6638671, 
+    -0.6664435, -0.6681628, -0.669023, -0.669023, -0.6681628, -0.6664435, 
+    -0.6638671, -0.6604368, -0.6561568, -0.6510323, -0.6450695, -0.6382757, 
+    -0.6306592, -0.6222292, -0.6129961, -0.6029709, -0.5921662, -0.5805949, 
+    -0.568271, -0.5552099, -0.541427, -0.5269395, -0.5117649, -0.4959218, 
+    -0.4794293, -0.4623075, -0.4445777, -0.4262608, -0.4073797, -0.3879573, 
+    -0.3680168, -0.3475831, -0.3266806, -0.3053353, -0.2835725, -0.2614195, 
+    -0.238903, -0.2160499, -0.1928889, -0.1694475, -0.1457548, -0.1218394, 
+    -0.09773026, -0.07345724, -0.04904932, -0.02453688, 5.054101e-05, 
+    0.02468333, 0.04933079, 0.07396358, 0.098551, 0.1230638, 0.1474714, 
+    0.1717444, 0.1958536, 0.2197689, 0.2434619, 0.266903, 0.2900641, 
+    0.3129171, 0.3354337, 0.357587, 0.3793494, 0.400695, 0.4215973, 
+    0.4420309, 0.4619714, 0.4813939, 0.5002752, 0.5185918, 0.5363217, 
+    0.5534436, 0.5699359, 0.5857792, 0.6009537, 0.6154411, 0.6292239, 
+    0.6422851,
+  0.6777245, 0.6892677, 0.7000462, 0.7100468, 0.7192575, 0.7276669, 
+    0.7352648, 0.742042, 0.7479903, 0.7531023, 0.7573719, 0.7607938, 
+    0.763364, 0.765079, 0.7659371, 0.7659371, 0.765079, 0.7633639, 0.7607938, 
+    0.7573719, 0.7531023, 0.7479903, 0.742042, 0.7352648, 0.7276669, 
+    0.7192575, 0.7100468, 0.7000461, 0.6892678, 0.6777245, 0.6654308, 
+    0.6524014, 0.6386523, 0.6242001, 0.6090624, 0.593258, 0.5768057, 
+    0.5597258, 0.542039, 0.5237669, 0.5049319, 0.4855565, 0.4656649, 
+    0.4452809, 0.4244294, 0.4031362, 0.3814265, 0.3593275, 0.3368657, 
+    0.3140685, 0.2909638, 0.2675798, 0.2439447, 0.2200875, 0.1960374, 
+    0.1718234, 0.1474751, 0.1230222, 0.09849477, 0.07392222, 0.04933468, 
+    0.02476211, 0.000234466, -0.02421838, -0.04856646, -0.07278046, 
+    -0.09683071, -0.1206879, -0.1443229, -0.1677071, -0.1908116, -0.2136088, 
+    -0.2360706, -0.2581698, -0.2798793, -0.3011728, -0.322024, -0.342408, 
+    -0.3622998, -0.381675, -0.4005101, -0.4187821, -0.4364689, -0.4535488, 
+    -0.4700012, -0.4858057, -0.5009433, -0.5153954, -0.5291446, -0.542174, 
+    -0.5544677, -0.5660109, -0.5767894, -0.58679, -0.5960006, -0.6044101, 
+    -0.612008, -0.6187852, -0.6247335, -0.6298455, -0.6341151, -0.637537, 
+    -0.6401072, -0.6418222, -0.6426803, -0.6426803, -0.6418222, -0.6401072, 
+    -0.637537, -0.6341151, -0.6298455, -0.6247335, -0.6187852, -0.612008, 
+    -0.6044101, -0.5960006, -0.58679, -0.5767893, -0.5660109, -0.5544679, 
+    -0.542174, -0.5291446, -0.5153954, -0.5009433, -0.4858056, -0.4700012, 
+    -0.453549, -0.4364689, -0.4187822, -0.40051, -0.381675, -0.3622999, 
+    -0.342408, -0.3220242, -0.3011726, -0.2798793, -0.2581697, -0.2360706, 
+    -0.213609, -0.1908116, -0.1677071, -0.1443228, -0.1206879, -0.09683086, 
+    -0.07278046, -0.04856663, -0.02421821, 0.000234466, 0.02476195, 
+    0.04933468, 0.07392205, 0.09849477, 0.1230222, 0.1474753, 0.1718234, 
+    0.1960372, 0.2200876, 0.2439446, 0.2675798, 0.2909638, 0.3140684, 
+    0.3368657, 0.3593274, 0.3814267, 0.403136, 0.4244296, 0.4452809, 
+    0.4656647, 0.4855566, 0.5049317, 0.523767, 0.542039, 0.5597256, 
+    0.5768057, 0.5932578, 0.6090626, 0.6242, 0.6386521, 0.6524014, 0.6654307,
+  0.7000144, 0.7115152, 0.7222542, 0.7322182, 0.7413951, 0.7497738, 
+    0.7573438, 0.7640963, 0.7700227, 0.7751161, 0.77937, 0.7827794, 
+    0.7853401, 0.7870489, 0.7879039, 0.7879039, 0.7870489, 0.7853401, 
+    0.7827794, 0.77937, 0.7751161, 0.7700227, 0.7640963, 0.7573439, 
+    0.7497738, 0.7413951, 0.7322182, 0.7222542, 0.7115152, 0.7000144, 
+    0.6877657, 0.6747839, 0.6610852, 0.646686, 0.6316037, 0.6158572, 
+    0.5994651, 0.5824477, 0.5648257, 0.5466205, 0.5278545, 0.5085501, 
+    0.4887313, 0.468422, 0.4476469, 0.4264316, 0.4048015, 0.3827834, 
+    0.3604039, 0.3376902, 0.3146701, 0.2913717, 0.2678232, 0.2440534, 
+    0.2200913, 0.195966, 0.1717069, 0.1473436, 0.122906, 0.09842342, 
+    0.07392593, 0.04944337, 0.02500555, 0.0006422698, -0.02361665, 
+    -0.04774196, -0.07170413, -0.09547392, -0.1190224, -0.1423209, 
+    -0.1653409, -0.1880545, -0.2104341, -0.2324523, -0.2540823, -0.2752978, 
+    -0.2960727, -0.316382, -0.3362009, -0.3555052, -0.3742713, -0.3924764, 
+    -0.4100984, -0.4271158, -0.4435078, -0.4592545, -0.4743367, -0.4887358, 
+    -0.5024346, -0.5154163, -0.527665, -0.5391659, -0.5499049, -0.5598689, 
+    -0.5690458, -0.5774244, -0.5849946, -0.5917469, -0.5976734, -0.6027668, 
+    -0.6070207, -0.6104301, -0.6129907, -0.6146996, -0.6155546, -0.6155546, 
+    -0.6146996, -0.6129907, -0.6104301, -0.6070207, -0.6027668, -0.5976734, 
+    -0.5917469, -0.5849946, -0.5774244, -0.5690458, -0.5598689, -0.5499048, 
+    -0.5391659, -0.5276651, -0.5154163, -0.5024347, -0.4887358, -0.4743367, 
+    -0.4592544, -0.4435078, -0.4271159, -0.4100984, -0.3924765, -0.3742712, 
+    -0.3555052, -0.336201, -0.316382, -0.2960728, -0.2752976, -0.2540823, 
+    -0.2324522, -0.2104341, -0.1880547, -0.1653409, -0.1423209, -0.1190223, 
+    -0.09547392, -0.07170428, -0.04774196, -0.02361681, 0.0006424338, 
+    0.02500555, 0.0494432, 0.07392593, 0.09842325, 0.122906, 0.1473436, 
+    0.1717071, 0.195966, 0.2200911, 0.2440535, 0.2678231, 0.2913718, 
+    0.3146701, 0.33769, 0.3604039, 0.3827833, 0.4048016, 0.4264315, 
+    0.4476471, 0.468422, 0.4887312, 0.5085502, 0.5278544, 0.5466207, 
+    0.5648257, 0.5824476, 0.5994651, 0.615857, 0.6316038, 0.6466859, 
+    0.661085, 0.6747839, 0.6877655,
+  0.7214513, 0.7328959, 0.7435822, 0.7534975, 0.7626295, 0.7709671, 
+    0.7785002, 0.7852196, 0.7911171, 0.7961854, 0.8004186, 0.8038112, 
+    0.8063594, 0.8080599, 0.8089107, 0.8089107, 0.8080599, 0.8063594, 
+    0.8038112, 0.8004186, 0.7961854, 0.7911171, 0.7852196, 0.7785002, 
+    0.7709671, 0.7626295, 0.7534975, 0.7435822, 0.7328959, 0.7214513, 
+    0.7092625, 0.6963444, 0.6827127, 0.668384, 0.6533754, 0.6377059, 
+    0.6213942, 0.6044601, 0.5869243, 0.5688082, 0.5501341, 0.5309241, 
+    0.5112023, 0.4909924, 0.470319, 0.4492076, 0.4276833, 0.405773, 0.383503, 
+    0.3609005, 0.337993, 0.3148087, 0.2913754, 0.2677219, 0.2438771, 
+    0.2198699, 0.1957295, 0.1714855, 0.1471674, 0.1228047, 0.09842712, 
+    0.07406437, 0.04974617, 0.02550212, 0.001361936, -0.02264531, 
+    -0.04649019, -0.07014365, -0.09357691, -0.1167614, -0.1396686, 
+    -0.1622711, -0.1845412, -0.2064516, -0.2279758, -0.2490874, -0.2697606, 
+    -0.2899705, -0.3096924, -0.3289022, -0.3475765, -0.3656925, -0.3832283, 
+    -0.4001624, -0.4164742, -0.4321438, -0.4471521, -0.4614808, -0.4751126, 
+    -0.4880308, -0.5002196, -0.5116642, -0.5223505, -0.5322658, -0.5413977, 
+    -0.5497354, -0.5572685, -0.5639879, -0.5698853, -0.5749537, -0.5791868, 
+    -0.5825795, -0.5851277, -0.5868281, -0.5876789, -0.5876789, -0.5868281, 
+    -0.5851277, -0.5825795, -0.5791868, -0.5749537, -0.5698853, -0.5639879, 
+    -0.5572685, -0.5497354, -0.5413977, -0.5322658, -0.5223504, -0.5116642, 
+    -0.5002196, -0.4880308, -0.4751127, -0.4614808, -0.4471521, -0.4321437, 
+    -0.4164742, -0.4001625, -0.3832283, -0.3656926, -0.3475764, -0.3289022, 
+    -0.3096926, -0.2899705, -0.2697608, -0.2490872, -0.2279758, -0.2064515, 
+    -0.1845412, -0.1622713, -0.1396686, -0.1167614, -0.09357674, -0.07014365, 
+    -0.04649034, -0.02264531, 0.00136178, 0.02550229, 0.04974617, 0.07406421, 
+    0.09842712, 0.1228045, 0.1471674, 0.1714855, 0.1957297, 0.2198699, 
+    0.243877, 0.267722, 0.2913753, 0.3148087, 0.337993, 0.3609003, 0.383503, 
+    0.4057729, 0.4276834, 0.4492074, 0.4703192, 0.4909924, 0.5112022, 
+    0.5309242, 0.5501339, 0.5688083, 0.5869243, 0.6044599, 0.6213942, 
+    0.6377058, 0.6533756, 0.6683838, 0.6827126, 0.6963444, 0.7092624,
+  0.7420092, 0.7533835, 0.7640043, 0.7738588, 0.7829347, 0.7912212, 0.798708, 
+    0.8053861, 0.8112474, 0.8162847, 0.8204919, 0.8238637, 0.8263962, 
+    0.8280863, 0.8289319, 0.8289319, 0.8280863, 0.8263962, 0.8238637, 
+    0.8204919, 0.8162847, 0.8112474, 0.8053861, 0.798708, 0.7912212, 
+    0.7829347, 0.7738588, 0.7640043, 0.7533836, 0.7420092, 0.7298952, 
+    0.7170563, 0.7035083, 0.6892675, 0.6743511, 0.6587778, 0.6425661, 
+    0.6257359, 0.6083078, 0.5903029, 0.5717433, 0.5526512, 0.5330505, 
+    0.5129646, 0.4924181, 0.4714361, 0.450044, 0.4282681, 0.4061348, 
+    0.383671, 0.3609041, 0.337862, 0.3145726, 0.2910643, 0.2673658, 
+    0.2435059, 0.2195137, 0.1954184, 0.1712496, 0.1470364, 0.1228084, 
+    0.09859514, 0.07442617, 0.05033091, 0.02633886, 0.002478957, -0.0212196, 
+    -0.04472792, -0.06801736, -0.09105955, -0.1138262, -0.13629, -0.1584234, 
+    -0.1801994, -0.2015914, -0.2225735, -0.2431199, -0.2632058, -0.2828066, 
+    -0.3018985, -0.3204582, -0.338463, -0.3558912, -0.3727214, -0.3889331, 
+    -0.4045065, -0.4194227, -0.4336635, -0.4472117, -0.4600505, -0.4721645, 
+    -0.4835389, -0.4941597, -0.5040141, -0.51309, -0.5213765, -0.5288634, 
+    -0.5355415, -0.5414028, -0.54644, -0.5506471, -0.554019, -0.5565516, 
+    -0.5582416, -0.5590872, -0.5590872, -0.5582416, -0.5565516, -0.554019, 
+    -0.5506471, -0.54644, -0.5414028, -0.5355415, -0.5288634, -0.5213765, 
+    -0.51309, -0.5040141, -0.4941596, -0.4835389, -0.4721646, -0.4600505, 
+    -0.4472117, -0.4336635, -0.4194227, -0.4045064, -0.3889331, -0.3727215, 
+    -0.3558912, -0.3384631, -0.3204581, -0.3018985, -0.2828068, -0.2632058, 
+    -0.24312, -0.2225734, -0.2015914, -0.1801993, -0.1584234, -0.1362902, 
+    -0.1138262, -0.09105955, -0.0680172, -0.04472792, -0.02121976, 
+    0.002478957, 0.0263387, 0.05033107, 0.07442617, 0.09859498, 0.1228084, 
+    0.1470362, 0.1712496, 0.1954184, 0.2195138, 0.2435059, 0.2673656, 
+    0.2910643, 0.3145725, 0.3378621, 0.3609041, 0.3836708, 0.4061348, 
+    0.428268, 0.4500442, 0.471436, 0.4924182, 0.5129646, 0.5330504, 
+    0.5526513, 0.5717431, 0.590303, 0.6083078, 0.6257358, 0.6425661, 
+    0.6587777, 0.6743512, 0.6892674, 0.7035081, 0.7170563, 0.7298951,
+  0.7616631, 0.7729534, 0.7834957, 0.7932773, 0.8022861, 0.8105113, 
+    0.8179427, 0.8245715, 0.8303895, 0.8353895, 0.8395656, 0.8429125, 
+    0.8454263, 0.8471038, 0.8479432, 0.8479432, 0.8471038, 0.8454263, 
+    0.8429125, 0.8395656, 0.8353895, 0.8303895, 0.8245715, 0.8179428, 
+    0.8105113, 0.8022861, 0.7932773, 0.7834957, 0.7729534, 0.7616631, 
+    0.7496387, 0.7368947, 0.7234468, 0.7093113, 0.6945052, 0.679047, 
+    0.6629552, 0.6462494, 0.6289501, 0.6110783, 0.592656, 0.5737051, 
+    0.5542492, 0.5343118, 0.5139172, 0.4930904, 0.4718564, 0.4502415, 
+    0.4282718, 0.4059741, 0.3833755, 0.3605038, 0.3373865, 0.314052, 
+    0.2905287, 0.2668452, 0.2430304, 0.2191132, 0.1951231, 0.1710889, 
+    0.14704, 0.1230058, 0.09901549, 0.07509835, 0.05128368, 0.02760017, 
+    0.004076809, -0.01925771, -0.04237497, -0.06524681, -0.08784519, 
+    -0.1101429, -0.1321127, -0.1537277, -0.1749615, -0.1957885, -0.216183, 
+    -0.2361204, -0.2555763, -0.2745271, -0.2929496, -0.3108213, -0.3281206, 
+    -0.3448263, -0.3609182, -0.3763765, -0.3911824, -0.405318, -0.4187659, 
+    -0.4315099, -0.4435343, -0.4548246, -0.4653669, -0.4751484, -0.4841573, 
+    -0.4923825, -0.499814, -0.5064427, -0.5122607, -0.5172607, -0.5214367, 
+    -0.5247837, -0.5272975, -0.528975, -0.5298144, -0.5298144, -0.528975, 
+    -0.5272975, -0.5247837, -0.5214367, -0.5172607, -0.5122607, -0.5064427, 
+    -0.499814, -0.4923825, -0.4841573, -0.4751484, -0.4653668, -0.4548246, 
+    -0.4435344, -0.4315099, -0.418766, -0.405318, -0.3911824, -0.3763764, 
+    -0.3609182, -0.3448265, -0.3281206, -0.3108214, -0.2929495, -0.2745271, 
+    -0.2555765, -0.2361204, -0.2161831, -0.1957883, -0.1749615, -0.1537275, 
+    -0.1321127, -0.1101431, -0.08784519, -0.06524681, -0.0423748, 
+    -0.01925771, 0.00407666, 0.02760017, 0.05128353, 0.07509851, 0.09901549, 
+    0.1230056, 0.14704, 0.1710887, 0.1951231, 0.2191132, 0.2430305, 
+    0.2668452, 0.2905285, 0.314052, 0.3373864, 0.3605039, 0.3833755, 
+    0.4059739, 0.4282718, 0.4502414, 0.4718565, 0.4930903, 0.5139173, 
+    0.5343118, 0.5542491, 0.5737052, 0.5926558, 0.6110784, 0.6289501, 
+    0.6462493, 0.6629552, 0.6790469, 0.6945053, 0.7093112, 0.7234467, 
+    0.7368947, 0.7496386,
+  0.780389, 0.7915814, 0.8020324, 0.8117292, 0.82066, 0.8288139, 0.8361809, 
+    0.8427522, 0.8485198, 0.8534765, 0.8576163, 0.8609343, 0.8634263, 
+    0.8650893, 0.8659214, 0.8659214, 0.8650893, 0.8634262, 0.8609343, 
+    0.8576163, 0.8534765, 0.8485198, 0.8427522, 0.8361809, 0.8288139, 
+    0.82066, 0.8117292, 0.8020324, 0.7915815, 0.780389, 0.7684689, 0.7558353, 
+    0.7425039, 0.7284909, 0.7138132, 0.698489, 0.6825366, 0.6659756, 
+    0.6488262, 0.6311092, 0.6128466, 0.5940599, 0.5747727, 0.5550081, 
+    0.5347902, 0.5141439, 0.4930939, 0.4716664, 0.449887, 0.4277825, 
+    0.4053798, 0.3827063, 0.3597894, 0.3366571, 0.3133377, 0.2898594, 
+    0.266251, 0.2425411, 0.2187589, 0.194933, 0.1710925, 0.1472666, 
+    0.1234842, 0.09977432, 0.07616603, 0.05268778, 0.02936828, 0.006235987, 
+    -0.01668094, -0.03935455, -0.06175709, -0.08386156, -0.1056409, 
+    -0.1270686, -0.1481184, -0.1687649, -0.1889826, -0.2087472, -0.2280346, 
+    -0.2468211, -0.265084, -0.2828008, -0.2999502, -0.3165112, -0.3324635, 
+    -0.3477878, -0.3624655, -0.3764785, -0.3898099, -0.4024434, -0.4143637, 
+    -0.425556, -0.436007, -0.4457038, -0.4546345, -0.4627884, -0.4701556, 
+    -0.4767269, -0.4824944, -0.4874511, -0.4915909, -0.4949089, -0.4974009, 
+    -0.4990639, -0.499896, -0.499896, -0.4990639, -0.4974009, -0.4949089, 
+    -0.4915909, -0.4874511, -0.4824944, -0.4767269, -0.4701556, -0.4627884, 
+    -0.4546345, -0.4457038, -0.4360069, -0.425556, -0.4143637, -0.4024434, 
+    -0.38981, -0.3764785, -0.3624655, -0.3477878, -0.3324635, -0.3165112, 
+    -0.2999502, -0.2828009, -0.2650838, -0.2468211, -0.2280347, -0.2087472, 
+    -0.1889828, -0.1687647, -0.1481184, -0.1270684, -0.1056409, -0.08386174, 
+    -0.06175709, -0.03935455, -0.01668078, 0.006235987, 0.02936813, 
+    0.05268778, 0.07616588, 0.09977448, 0.1234842, 0.1472664, 0.1710925, 
+    0.1949328, 0.2187589, 0.2425411, 0.2662511, 0.2898594, 0.3133375, 
+    0.3366572, 0.3597893, 0.3827063, 0.4053798, 0.4277824, 0.449887, 
+    0.4716662, 0.493094, 0.5141438, 0.5347903, 0.5550081, 0.5747725, 
+    0.5940601, 0.6128464, 0.6311094, 0.6488262, 0.6659755, 0.6825366, 
+    0.6984888, 0.7138133, 0.7284908, 0.7425038, 0.7558353, 0.7684687,
+  0.7981642, 0.8092451, 0.819592, 0.8291922, 0.838034, 0.8461067, 0.8534004, 
+    0.8599063, 0.8656164, 0.8705237, 0.8746223, 0.8779072, 0.8803744, 
+    0.8820208, 0.8828446, 0.8828446, 0.8820208, 0.8803744, 0.8779072, 
+    0.8746223, 0.8705237, 0.8656164, 0.8599063, 0.8534005, 0.8461067, 
+    0.838034, 0.8291922, 0.819592, 0.8092452, 0.7981642, 0.7863627, 0.773855, 
+    0.7606565, 0.746783, 0.7322515, 0.7170799, 0.7012864, 0.6848904, 
+    0.6679118, 0.6503713, 0.6322905, 0.613691, 0.5945959, 0.5750281, 
+    0.5550116, 0.534571, 0.5137306, 0.4925165, 0.4709541, 0.4490698, 
+    0.4268903, 0.4044425, 0.3817539, 0.358852, 0.3357649, 0.3125205, 
+    0.2891472, 0.2656735, 0.2421281, 0.2185395, 0.1949365, 0.1713479, 
+    0.1478024, 0.1243287, 0.1009556, 0.07771116, 0.05462395, 0.03172205, 
+    0.009033397, -0.01341438, -0.03559378, -0.0574781, -0.0790405, 
+    -0.1002547, -0.1210949, -0.1415358, -0.1615521, -0.1811199, -0.2002151, 
+    -0.2188145, -0.2368954, -0.2544357, -0.2714143, -0.2878104, -0.3036039, 
+    -0.3187755, -0.333307, -0.3471804, -0.360379, -0.3728867, -0.3846883, 
+    -0.3957691, -0.406116, -0.4157162, -0.424558, -0.4326307, -0.4399245, 
+    -0.4464303, -0.4521404, -0.4570477, -0.4611463, -0.4644312, -0.4668984, 
+    -0.4685448, -0.4693686, -0.4693686, -0.4685448, -0.4668984, -0.4644312, 
+    -0.4611463, -0.4570477, -0.4521404, -0.4464303, -0.4399245, -0.4326307, 
+    -0.424558, -0.4157162, -0.4061159, -0.3957691, -0.3846883, -0.3728867, 
+    -0.3603792, -0.3471804, -0.333307, -0.3187755, -0.3036039, -0.2878104, 
+    -0.2714143, -0.2544359, -0.2368953, -0.2188145, -0.2002152, -0.1811199, 
+    -0.1615522, -0.1415356, -0.1210949, -0.1002546, -0.0790405, -0.05747825, 
+    -0.03559378, -0.01341438, 0.009033561, 0.03172205, 0.0546238, 0.07771116, 
+    0.1009554, 0.1243289, 0.1478024, 0.1713478, 0.1949365, 0.2185394, 
+    0.2421281, 0.2656735, 0.2891473, 0.3125205, 0.3357647, 0.3588521, 
+    0.3817538, 0.4044426, 0.4268903, 0.4490697, 0.4709541, 0.4925164, 
+    0.5137308, 0.5345708, 0.5550117, 0.5750281, 0.5945958, 0.6136911, 
+    0.6322904, 0.6503714, 0.6679118, 0.6848903, 0.7012864, 0.7170798, 
+    0.7322516, 0.746783, 0.7606564, 0.773855, 0.7863626,
+  0.8149669, 0.8259228, 0.836153, 0.845645, 0.854387, 0.8623687, 0.8695801, 
+    0.8760126, 0.8816583, 0.8865103, 0.8905627, 0.8938105, 0.8962498, 
+    0.8978777, 0.8986922, 0.8986922, 0.8978777, 0.8962498, 0.8938105, 
+    0.8905627, 0.8865103, 0.8816583, 0.8760126, 0.8695801, 0.8623687, 
+    0.854387, 0.845645, 0.836153, 0.8259229, 0.8149669, 0.8032985, 0.7909319, 
+    0.7778822, 0.7641653, 0.7497976, 0.7347972, 0.7191818, 0.7029707, 
+    0.6861836, 0.668841, 0.6509641, 0.6325744, 0.6136947, 0.5943476, 
+    0.5745568, 0.5543468, 0.5337415, 0.5127667, 0.4914475, 0.46981, 
+    0.4478806, 0.4256861, 0.4032533, 0.3806098, 0.357783, 0.3348008, 
+    0.3116911, 0.2884822, 0.2652024, 0.2418799, 0.2185431, 0.1952205, 
+    0.1719406, 0.1487316, 0.1256222, 0.1026399, 0.07981309, 0.05716951, 
+    0.03473677, 0.01254217, -0.009387061, -0.03102455, -0.05234376, 
+    -0.07331872, -0.09392384, -0.1141341, -0.1339247, -0.1532717, -0.1721516, 
+    -0.1905412, -0.2084182, -0.2257607, -0.2425478, -0.2587589, -0.2743742, 
+    -0.2893748, -0.3037423, -0.3174593, -0.3305091, -0.3428757, -0.354544, 
+    -0.3655, -0.3757302, -0.385222, -0.3939641, -0.4019458, -0.4091573, 
+    -0.4155897, -0.4212354, -0.4260874, -0.4301397, -0.4333876, -0.435827, 
+    -0.4374548, -0.4382693, -0.4382693, -0.4374548, -0.435827, -0.4333876, 
+    -0.4301397, -0.4260874, -0.4212354, -0.4155897, -0.4091573, -0.4019458, 
+    -0.3939641, -0.3852221, -0.3757301, -0.3655, -0.3545442, -0.3428757, 
+    -0.3305091, -0.3174593, -0.3037423, -0.2893747, -0.2743742, -0.258759, 
+    -0.2425478, -0.2257608, -0.2084181, -0.1905412, -0.1721517, -0.1532717, 
+    -0.1339248, -0.114134, -0.09392384, -0.07331857, -0.05234376, 
+    -0.03102469, -0.009387061, 0.01254217, 0.03473692, 0.05716951, 
+    0.07981294, 0.1026399, 0.125622, 0.1487318, 0.1719406, 0.1952204, 
+    0.2185431, 0.2418797, 0.2652024, 0.2884822, 0.3116913, 0.3348008, 
+    0.3577829, 0.3806098, 0.4032533, 0.4256862, 0.4478806, 0.4698098, 
+    0.4914475, 0.5127665, 0.5337417, 0.5543467, 0.5745571, 0.5943476, 
+    0.6136945, 0.6325746, 0.650964, 0.6688411, 0.6861836, 0.7029706, 
+    0.7191818, 0.7347971, 0.7497977, 0.7641652, 0.7778821, 0.7909319, 
+    0.8032985,
+  0.8307767, 0.8415943, 0.8516953, 0.8610674, 0.8696991, 0.87758, 0.8847004, 
+    0.8910517, 0.896626, 0.9014168, 0.905418, 0.9086248, 0.9110334, 
+    0.9126407, 0.9134449, 0.9134449, 0.9126407, 0.9110334, 0.9086248, 
+    0.905418, 0.9014168, 0.896626, 0.8910517, 0.8847004, 0.87758, 0.8696991, 
+    0.8610674, 0.8516953, 0.8415943, 0.8307767, 0.8192557, 0.8070452, 
+    0.7941602, 0.7806165, 0.7664303, 0.7516192, 0.736201, 0.7201946, 
+    0.7036195, 0.6864958, 0.6688447, 0.6506871, 0.6320457, 0.6129429, 
+    0.5934021, 0.5734472, 0.5531021, 0.5323921, 0.511342, 0.4899778, 
+    0.4683253, 0.446411, 0.4242615, 0.4019038, 0.3793653, 0.3566732, 
+    0.3338553, 0.3109394, 0.2879536, 0.2649255, 0.2418834, 0.2188553, 
+    0.1958693, 0.1729534, 0.1501357, 0.1274436, 0.104905, 0.08254732, 
+    0.06039782, 0.03848346, 0.0168311, -0.004533172, -0.02558321, 
+    -0.04629335, -0.06663832, -0.08659342, -0.1061341, -0.1252369, 
+    -0.1438784, -0.1620358, -0.1796871, -0.1968106, -0.2133857, -0.2293921, 
+    -0.2448103, -0.2596215, -0.2738077, -0.2873514, -0.3002364, -0.3124469, 
+    -0.3239679, -0.3347856, -0.3448865, -0.3542586, -0.3628903, -0.3707711, 
+    -0.3778916, -0.3842428, -0.3898172, -0.3946079, -0.3986091, -0.401816, 
+    -0.4042245, -0.4058318, -0.406636, -0.406636, -0.4058318, -0.4042245, 
+    -0.401816, -0.3986091, -0.3946079, -0.3898172, -0.3842428, -0.3778916, 
+    -0.3707711, -0.3628903, -0.3542586, -0.3448865, -0.3347856, -0.323968, 
+    -0.3124469, -0.3002365, -0.2873514, -0.2738077, -0.2596214, -0.2448103, 
+    -0.2293922, -0.2133857, -0.1968107, -0.179687, -0.1620358, -0.1438785, 
+    -0.1252369, -0.1061342, -0.08659327, -0.06663832, -0.0462932, 
+    -0.02558321, -0.00453335, 0.0168311, 0.03848346, 0.06039797, 0.08254732, 
+    0.1049049, 0.1274436, 0.1501355, 0.1729535, 0.1958693, 0.2188551, 
+    0.2418834, 0.2649253, 0.2879536, 0.3109394, 0.3338555, 0.3566732, 
+    0.3793651, 0.4019039, 0.4242614, 0.446411, 0.4683253, 0.4899776, 
+    0.511342, 0.532392, 0.5531023, 0.5734471, 0.5934023, 0.6129429, 
+    0.6320456, 0.6506872, 0.6688446, 0.6864959, 0.7036195, 0.7201945, 
+    0.736201, 0.7516191, 0.7664304, 0.7806164, 0.7941601, 0.8070452, 0.8192556,
+  0.8455744, 0.8562405, 0.8662001, 0.8754408, 0.8839517, 0.8917222, 
+    0.8987428, 0.9050052, 0.9105015, 0.9152251, 0.9191703, 0.9223322, 
+    0.9247071, 0.9262918, 0.9270847, 0.9270847, 0.9262918, 0.924707, 
+    0.9223322, 0.9191703, 0.9152251, 0.9105015, 0.9050052, 0.8987429, 
+    0.8917222, 0.8839517, 0.8754408, 0.8662, 0.8562406, 0.8455744, 0.8342147, 
+    0.8221753, 0.8094708, 0.7961167, 0.7821292, 0.7675256, 0.7523233, 
+    0.736541, 0.7201981, 0.7033143, 0.6859103, 0.6680071, 0.6496269, 
+    0.6307916, 0.6115245, 0.591849, 0.5717888, 0.5513689, 0.5306137, 
+    0.5095486, 0.4881994, 0.466592, 0.4447527, 0.4227082, 0.4004853, 
+    0.3781111, 0.3556128, 0.3330178, 0.3103539, 0.2876484, 0.264929, 
+    0.2422234, 0.2195593, 0.1969644, 0.1744662, 0.152092, 0.1298691, 
+    0.1078245, 0.08598523, 0.0643778, 0.0430287, 0.02196363, 0.001208425, 
+    -0.01921165, -0.03927168, -0.05894727, -0.07821429, -0.0970495, 
+    -0.1154299, -0.1333331, -0.1507371, -0.1676208, -0.1839638, -0.199746, 
+    -0.2149483, -0.229552, -0.2435395, -0.2568935, -0.2695981, -0.2816375, 
+    -0.2929972, -0.3036633, -0.3136228, -0.3228636, -0.3313744, -0.3391449, 
+    -0.3461656, -0.3524279, -0.3579242, -0.3626478, -0.366593, -0.3697549, 
+    -0.3721298, -0.3737146, -0.3745075, -0.3745075, -0.3737146, -0.3721298, 
+    -0.3697549, -0.366593, -0.3626478, -0.3579242, -0.3524279, -0.3461656, 
+    -0.3391449, -0.3313744, -0.3228636, -0.3136227, -0.3036633, -0.2929972, 
+    -0.2816375, -0.2695981, -0.2568935, -0.2435395, -0.2295519, -0.2149483, 
+    -0.1997461, -0.1839638, -0.1676209, -0.150737, -0.1333331, -0.11543, 
+    -0.0970495, -0.07821441, -0.05894712, -0.03927168, -0.0192115, 
+    0.001208425, 0.02196348, 0.0430287, 0.0643778, 0.08598538, 0.1078245, 
+    0.1298689, 0.152092, 0.1744661, 0.1969645, 0.2195593, 0.2422232, 
+    0.264929, 0.2876482, 0.3103539, 0.3330178, 0.3556129, 0.3781111, 
+    0.4004852, 0.4227082, 0.4447526, 0.4665921, 0.4881994, 0.5095485, 
+    0.5306137, 0.5513687, 0.571789, 0.5918489, 0.6115246, 0.6307916, 
+    0.6496267, 0.6680073, 0.6859102, 0.7033144, 0.7201981, 0.7365409, 
+    0.7523233, 0.7675254, 0.7821293, 0.7961167, 0.8094707, 0.8221753, 
+    0.8342147,
+  0.8593418, 0.8698434, 0.8796493, 0.8887476, 0.8971272, 0.9047778, 
+    0.9116902, 0.9178559, 0.9232674, 0.9279182, 0.9318026, 0.9349157, 
+    0.9372539, 0.9388143, 0.939595, 0.939595, 0.9388143, 0.9372539, 
+    0.9349157, 0.9318026, 0.9279182, 0.9232674, 0.9178559, 0.9116902, 
+    0.9047778, 0.8971272, 0.8887476, 0.8796493, 0.8698434, 0.8593418, 
+    0.8481573, 0.8363035, 0.823795, 0.8106469, 0.7968751, 0.7824967, 
+    0.7675289, 0.7519901, 0.7358992, 0.7192758, 0.7021402, 0.6845131, 
+    0.6664163, 0.6478716, 0.6289016, 0.6095296, 0.5897788, 0.5696739, 
+    0.5492388, 0.5284986, 0.5074786, 0.4862045, 0.4647021, 0.4429975, 
+    0.4211174, 0.3990882, 0.3769369, 0.3546905, 0.3323761, 0.3100207, 
+    0.2876517, 0.2652964, 0.2429819, 0.2207354, 0.1985843, 0.1765551, 
+    0.1546749, 0.1329704, 0.1114679, 0.09019375, 0.06917392, 0.04843375, 
+    0.02799866, 0.007893533, -0.01185712, -0.03122926, -0.05019912, 
+    -0.06874382, -0.08684075, -0.1044677, -0.1216034, -0.1382267, -0.1543176, 
+    -0.1698564, -0.1848242, -0.1992027, -0.2129744, -0.2261225, -0.2386311, 
+    -0.2504849, -0.2616693, -0.272171, -0.2819769, -0.2910751, -0.2994547, 
+    -0.3071053, -0.3140177, -0.3201835, -0.325595, -0.3302457, -0.33413, 
+    -0.3372433, -0.3395814, -0.3411418, -0.3419225, -0.3419225, -0.3411418, 
+    -0.3395814, -0.3372433, -0.33413, -0.3302457, -0.325595, -0.3201835, 
+    -0.3140177, -0.3071053, -0.2994547, -0.2910752, -0.2819768, -0.272171, 
+    -0.2616694, -0.2504849, -0.2386312, -0.2261225, -0.2129744, -0.1992026, 
+    -0.1848242, -0.1698565, -0.1543176, -0.1382268, -0.1216033, -0.1044677, 
+    -0.08684087, -0.06874382, -0.05019924, -0.03122911, -0.01185712, 
+    0.007893682, 0.02799866, 0.0484336, 0.06917392, 0.09019375, 0.1114681, 
+    0.1329704, 0.1546748, 0.1765551, 0.1985841, 0.2207356, 0.2429819, 
+    0.2652963, 0.2876517, 0.3100206, 0.3323761, 0.3546905, 0.3769371, 
+    0.3990882, 0.4211172, 0.4429976, 0.464702, 0.4862046, 0.5074786, 
+    0.5284984, 0.5492388, 0.5696737, 0.589779, 0.6095295, 0.6289017, 
+    0.6478716, 0.6664162, 0.6845132, 0.7021402, 0.7192759, 0.7358992, 
+    0.75199, 0.7675289, 0.7824966, 0.7968752, 0.8106468, 0.8237949, 
+    0.8363035, 0.8481572,
+  0.8720623, 0.8823866, 0.892027, 0.9009717, 0.9092097, 0.9167312, 0.9235269, 
+    0.9295886, 0.9349087, 0.9394809, 0.9432998, 0.9463603, 0.9486591, 
+    0.950193, 0.9509605, 0.9509605, 0.950193, 0.9486591, 0.9463603, 
+    0.9432998, 0.9394809, 0.9349087, 0.9295886, 0.9235269, 0.9167312, 
+    0.9092097, 0.9009717, 0.8920269, 0.8823867, 0.8720623, 0.8610667, 
+    0.849413, 0.8371156, 0.8241895, 0.8106502, 0.7965146, 0.7817995, 
+    0.766523, 0.7507038, 0.7343611, 0.7175148, 0.7001853, 0.682394, 
+    0.6641624, 0.6455126, 0.6264677, 0.6070504, 0.5872848, 0.5671947, 
+    0.5468047, 0.5261396, 0.5052247, 0.4840853, 0.4627472, 0.4412364, 
+    0.4195792, 0.3978019, 0.375931, 0.3539934, 0.3320154, 0.3100241, 
+    0.2880462, 0.2661084, 0.2442375, 0.2224603, 0.2008031, 0.1792923, 
+    0.1579542, 0.1368148, 0.1158998, 0.09523481, 0.07484479, 0.0547547, 
+    0.03498903, 0.01557183, -0.003473252, -0.02212286, -0.04035449, 
+    -0.05814588, -0.07547528, -0.0923216, -0.1086642, -0.1244835, -0.13976, 
+    -0.1544751, -0.1686108, -0.18215, -0.1950761, -0.2073735, -0.2190272, 
+    -0.2300228, -0.2403471, -0.2499875, -0.2589321, -0.2671702, -0.2746917, 
+    -0.2814874, -0.287549, -0.2928692, -0.2974415, -0.3012602, -0.3043208, 
+    -0.3066196, -0.3081536, -0.3089211, -0.3089211, -0.3081536, -0.3066196, 
+    -0.3043208, -0.3012602, -0.2974415, -0.2928692, -0.287549, -0.2814874, 
+    -0.2746917, -0.2671702, -0.2589322, -0.2499875, -0.2403471, -0.2300229, 
+    -0.2190272, -0.2073736, -0.1950761, -0.18215, -0.1686107, -0.1544751, 
+    -0.13976, -0.1244835, -0.1086644, -0.09232149, -0.07547528, -0.05814597, 
+    -0.04035449, -0.02212298, -0.003473103, 0.01557183, 0.03498915, 
+    0.0547547, 0.07484464, 0.09523481, 0.1158998, 0.1368149, 0.1579542, 
+    0.1792922, 0.2008031, 0.2224602, 0.2442377, 0.2661084, 0.288046, 
+    0.3100241, 0.3320153, 0.3539934, 0.375931, 0.397802, 0.4195792, 
+    0.4412363, 0.4627472, 0.4840852, 0.5052248, 0.5261396, 0.5468045, 
+    0.5671947, 0.5872847, 0.6070505, 0.6264676, 0.6455128, 0.6641624, 
+    0.6823939, 0.7001854, 0.7175147, 0.7343611, 0.7507038, 0.7665229, 
+    0.7817995, 0.7965145, 0.8106503, 0.8241894, 0.8371155, 0.849413, 0.8610666,
+  0.8837203, 0.8938547, 0.9033178, 0.9120979, 0.9201845, 0.9275677, 
+    0.9342383, 0.9401885, 0.9454108, 0.949899, 0.9536475, 0.9566518, 
+    0.9589083, 0.9604141, 0.9611675, 0.9611675, 0.9604141, 0.9589082, 
+    0.9566518, 0.9536475, 0.949899, 0.9454108, 0.9401885, 0.9342384, 
+    0.9275677, 0.9201845, 0.9120979, 0.9033177, 0.8938547, 0.8837203, 
+    0.8729268, 0.8614875, 0.8494164, 0.836728, 0.8234376, 0.809562, 
+    0.7951175, 0.780122, 0.7645937, 0.7485515, 0.7320151, 0.7150043, 
+    0.6975402, 0.6796439, 0.6613371, 0.6426425, 0.6235823, 0.6041802, 
+    0.5844597, 0.5644447, 0.5441596, 0.5236293, 0.5028787, 0.481933, 
+    0.4608179, 0.439559, 0.4181821, 0.3967135, 0.3751794, 0.3536056, 
+    0.3320187, 0.310445, 0.2889107, 0.267442, 0.2460654, 0.2248065, 
+    0.2036913, 0.1827456, 0.161995, 0.1414646, 0.1211797, 0.1011647, 
+    0.08144411, 0.06204194, 0.04298186, 0.02428705, 0.005980432, -0.01191589, 
+    -0.02938008, -0.04639077, -0.06292728, -0.07896933, -0.09449765, 
+    -0.1094932, -0.1239376, -0.1378134, -0.1511036, -0.163792, -0.1758632, 
+    -0.1873026, -0.198096, -0.2082304, -0.2176935, -0.2264736, -0.2345602, 
+    -0.2419433, -0.2486141, -0.2545642, -0.2597865, -0.2642747, -0.2680232, 
+    -0.2710275, -0.273284, -0.2747898, -0.2755432, -0.2755432, -0.2747898, 
+    -0.273284, -0.2710275, -0.2680232, -0.2642747, -0.2597865, -0.2545642, 
+    -0.2486141, -0.2419433, -0.2345602, -0.2264737, -0.2176934, -0.2082304, 
+    -0.1980961, -0.1873026, -0.1758633, -0.163792, -0.1511036, -0.1378133, 
+    -0.1239376, -0.1094933, -0.09449765, -0.07896945, -0.06292716, 
+    -0.04639077, -0.02938017, -0.01191589, 0.005980313, 0.02428719, 
+    0.04298186, 0.06204206, 0.08144411, 0.1011646, 0.1211797, 0.1414646, 
+    0.1619951, 0.1827456, 0.2036912, 0.2248065, 0.2460653, 0.2674422, 
+    0.2889107, 0.3104448, 0.3320187, 0.3536055, 0.3751794, 0.3967135, 
+    0.4181823, 0.439559, 0.4608178, 0.4819331, 0.5028786, 0.5236294, 
+    0.5441596, 0.5644445, 0.5844597, 0.6041801, 0.6235824, 0.6426424, 
+    0.6613373, 0.6796439, 0.6975401, 0.7150044, 0.732015, 0.7485516, 
+    0.7645937, 0.7801219, 0.7951175, 0.8095618, 0.8234378, 0.8367279, 
+    0.8494163, 0.8614875, 0.8729268,
+  0.8943015, 0.9042338, 0.9135081, 0.9221129, 0.9300382, 0.9372741, 
+    0.9438117, 0.949643, 0.9547611, 0.9591597, 0.9628335, 0.9657779, 
+    0.9679893, 0.969465, 0.9702034, 0.9702034, 0.969465, 0.9679892, 
+    0.9657779, 0.9628335, 0.9591597, 0.9547611, 0.949643, 0.9438117, 
+    0.9372741, 0.9300382, 0.9221129, 0.9135081, 0.9042338, 0.8943015, 
+    0.8837235, 0.8725125, 0.8606821, 0.8482469, 0.8352219, 0.8216231, 
+    0.8074669, 0.7927705, 0.7775521, 0.76183, 0.7456236, 0.7289522, 
+    0.7118366, 0.6942974, 0.676356, 0.6580343, 0.6393545, 0.6203396, 
+    0.6010125, 0.5813969, 0.5615166, 0.541396, 0.5210594, 0.5005317, 
+    0.479838, 0.4590032, 0.438053, 0.4170127, 0.3959083, 0.374765, 0.3536089, 
+    0.3324656, 0.311361, 0.2903208, 0.2693707, 0.2485359, 0.2278421, 
+    0.2073144, 0.1869778, 0.1668571, 0.146977, 0.1273614, 0.1080343, 
+    0.08901927, 0.0703395, 0.05201775, 0.03407642, 0.01653722, -0.0005784631, 
+    -0.01724973, -0.03345627, -0.04917821, -0.06439668, -0.07909298, 
+    -0.0932492, -0.1068481, -0.1198731, -0.1323083, -0.1441387, -0.1553497, 
+    -0.1659278, -0.17586, -0.1851342, -0.1937391, -0.2016644, -0.2089002, 
+    -0.2154378, -0.2212692, -0.2263874, -0.2307859, -0.2344597, -0.237404, 
+    -0.2396155, -0.2410912, -0.2418295, -0.2418295, -0.2410912, -0.2396155, 
+    -0.237404, -0.2344597, -0.2307859, -0.2263874, -0.2212692, -0.2154378, 
+    -0.2089002, -0.2016644, -0.1937392, -0.1851341, -0.17586, -0.1659279, 
+    -0.1553497, -0.1441387, -0.1323083, -0.1198731, -0.106848, -0.0932492, 
+    -0.07909307, -0.06439668, -0.04917833, -0.03345615, -0.01724973, 
+    -0.0005785823, 0.01653722, 0.03407633, 0.0520179, 0.0703395, 0.08901939, 
+    0.1080343, 0.1273612, 0.146977, 0.1668571, 0.186978, 0.2073144, 0.227842, 
+    0.2485359, 0.2693705, 0.2903209, 0.311361, 0.3324655, 0.3536089, 
+    0.3747649, 0.3959083, 0.4170127, 0.4380531, 0.4590032, 0.4798378, 
+    0.5005318, 0.5210593, 0.541396, 0.5615166, 0.5813967, 0.6010125, 
+    0.6203395, 0.6393546, 0.6580342, 0.6763561, 0.6942974, 0.7118365, 
+    0.7289523, 0.7456235, 0.7618301, 0.7775521, 0.7927704, 0.8074669, 
+    0.821623, 0.8352219, 0.8482469, 0.8606821, 0.8725125, 0.8837235,
+  0.9037933, 0.9135112, 0.9225853, 0.9310046, 0.9387588, 0.9458385, 0.952235, 
+    0.9579406, 0.9629483, 0.967252, 0.9708464, 0.9737272, 0.9758909, 
+    0.9773348, 0.9780573, 0.9780573, 0.9773348, 0.9758909, 0.9737272, 
+    0.9708464, 0.967252, 0.9629483, 0.9579406, 0.952235, 0.9458385, 
+    0.9387588, 0.9310046, 0.9225853, 0.9135112, 0.9037933, 0.8934435, 
+    0.8824744, 0.8708994, 0.8587325, 0.8459885, 0.8326831, 0.8188324, 
+    0.8044532, 0.7895632, 0.7741804, 0.7583237, 0.742012, 0.7252657, 
+    0.708105, 0.6905507, 0.6726245, 0.6543477, 0.6357431, 0.6168331, 
+    0.5976408, 0.5781895, 0.558503, 0.5386053, 0.5185205, 0.4982733, 
+    0.4778882, 0.45739, 0.4368038, 0.4161548, 0.3954678, 0.3747682, 
+    0.3540812, 0.333432, 0.3128458, 0.2923477, 0.2719626, 0.2517153, 
+    0.2316306, 0.2117328, 0.1920463, 0.1725952, 0.1534029, 0.1344928, 
+    0.1158881, 0.09761146, 0.07968503, 0.0621309, 0.04497015, 0.02822381, 
+    0.01191229, -0.003944516, -0.01932722, -0.03421727, -0.04859647, 
+    -0.06244719, -0.07575265, -0.0884966, -0.1006635, -0.1122385, -0.1232076, 
+    -0.1335574, -0.1432753, -0.1523494, -0.1607687, -0.1685229, -0.1756026, 
+    -0.1819991, -0.1877047, -0.1927124, -0.1970161, -0.2006105, -0.2034913, 
+    -0.205655, -0.2070989, -0.2078214, -0.2078214, -0.2070989, -0.205655, 
+    -0.2034913, -0.2006105, -0.1970161, -0.1927124, -0.1877047, -0.1819991, 
+    -0.1756026, -0.1685229, -0.1607687, -0.1523494, -0.1432753, -0.1335575, 
+    -0.1232076, -0.1122386, -0.1006635, -0.0884966, -0.07575256, -0.06244719, 
+    -0.04859653, -0.03421727, -0.01932731, -0.003944427, 0.01191229, 
+    0.02822369, 0.04497015, 0.06213078, 0.07968518, 0.09761146, 0.1158882, 
+    0.1344928, 0.1534027, 0.1725952, 0.1920463, 0.211733, 0.2316306, 
+    0.2517152, 0.2719626, 0.2923476, 0.3128459, 0.333432, 0.354081, 
+    0.3747682, 0.3954676, 0.4161548, 0.4368038, 0.4573902, 0.4778882, 
+    0.4982732, 0.5185206, 0.5386052, 0.5585031, 0.5781895, 0.5976406, 
+    0.6168331, 0.635743, 0.6543478, 0.6726243, 0.6905509, 0.708105, 
+    0.7252656, 0.7420121, 0.7583236, 0.7741804, 0.7895632, 0.8044531, 
+    0.8188324, 0.832683, 0.8459886, 0.8587325, 0.8708993, 0.8824744, 0.8934435,
+  0.912184, 0.9216757, 0.9305387, 0.938762, 0.9463357, 0.9532506, 0.9594983, 
+    0.9650711, 0.9699622, 0.9741657, 0.9776766, 0.9804903, 0.9826037, 
+    0.984014, 0.9847196, 0.9847196, 0.984014, 0.9826036, 0.9804903, 
+    0.9776766, 0.9741657, 0.9699622, 0.9650711, 0.9594983, 0.9532506, 
+    0.9463357, 0.938762, 0.9305386, 0.9216757, 0.912184, 0.9020751, 
+    0.8913612, 0.8800556, 0.8681719, 0.8557245, 0.8427287, 0.8292004, 
+    0.8151559, 0.8006123, 0.7855875, 0.7700999, 0.7541679, 0.7378113, 
+    0.72105, 0.7039043, 0.6863952, 0.6685438, 0.6503721, 0.6319022, 
+    0.6131566, 0.5941579, 0.5749297, 0.555495, 0.5358777, 0.5161017, 
+    0.496191, 0.4761699, 0.4560628, 0.4358943, 0.4156888, 0.3954709, 
+    0.3752654, 0.3550967, 0.3349896, 0.3149686, 0.2950579, 0.2752818, 
+    0.2556646, 0.2362299, 0.2170016, 0.1980031, 0.1792574, 0.1607875, 
+    0.1426158, 0.1247645, 0.1072553, 0.09010965, 0.07334831, 0.0569917, 
+    0.04105979, 0.02557203, 0.01054734, -0.003996193, -0.01804072, 
+    -0.03156912, -0.0445649, -0.05701226, -0.06889597, -0.08020166, 
+    -0.09091547, -0.1010244, -0.1105161, -0.119379, -0.1276023, -0.1351761, 
+    -0.142091, -0.1483387, -0.1539115, -0.1588026, -0.1630061, -0.1665169, 
+    -0.1693307, -0.1714441, -0.1728544, -0.17356, -0.17356, -0.1728544, 
+    -0.1714441, -0.1693307, -0.1665169, -0.1630061, -0.1588026, -0.1539115, 
+    -0.1483387, -0.142091, -0.1351761, -0.1276024, -0.119379, -0.1105161, 
+    -0.1010245, -0.09091547, -0.08020172, -0.06889597, -0.05701226, 
+    -0.04456481, -0.03156912, -0.01804081, -0.003996193, 0.01054722, 
+    0.02557212, 0.04105979, 0.05699158, 0.07334831, 0.09010956, 0.1072554, 
+    0.1247645, 0.1426159, 0.1607875, 0.1792573, 0.1980031, 0.2170016, 
+    0.23623, 0.2556646, 0.2752817, 0.2950579, 0.3149685, 0.3349898, 
+    0.3550967, 0.3752652, 0.3954709, 0.4156886, 0.4358943, 0.4560628, 
+    0.4761701, 0.496191, 0.5161016, 0.5358778, 0.555495, 0.5749298, 
+    0.5941579, 0.6131564, 0.6319022, 0.650372, 0.6685439, 0.686395, 
+    0.7039044, 0.72105, 0.7378112, 0.7541679, 0.7700998, 0.7855876, 
+    0.8006123, 0.8151557, 0.8292004, 0.8427286, 0.8557246, 0.8681718, 
+    0.8800555, 0.8913612, 0.9020751,
+  0.9194632, 0.9287171, 0.9373581, 0.9453754, 0.9527595, 0.9595013, 
+    0.9655924, 0.9710256, 0.9757943, 0.9798925, 0.9833153, 0.9860587, 
+    0.9881191, 0.9894941, 0.990182, 0.990182, 0.9894941, 0.9881191, 
+    0.9860587, 0.9833153, 0.9798925, 0.9757943, 0.9710256, 0.9655924, 
+    0.9595013, 0.9527595, 0.9453754, 0.9373581, 0.9287173, 0.9194632, 
+    0.9096075, 0.8991619, 0.8881395, 0.8765534, 0.8644177, 0.8517475, 
+    0.838558, 0.8248652, 0.8106859, 0.7960374, 0.7809377, 0.7654047, 
+    0.7494578, 0.7331163, 0.7164, 0.6993295, 0.6819252, 0.6642087, 0.6462014, 
+    0.6279252, 0.6094025, 0.5906558, 0.5717079, 0.5525819, 0.5333012, 
+    0.5138892, 0.4943695, 0.474766, 0.4551027, 0.4354032, 0.4156917, 
+    0.3959922, 0.3763288, 0.3567253, 0.3372057, 0.3177937, 0.298513, 
+    0.279387, 0.2604391, 0.2416924, 0.2231697, 0.2048936, 0.1868862, 
+    0.1691697, 0.1517655, 0.1346948, 0.1179786, 0.1016371, 0.08569011, 
+    0.07015726, 0.05505738, 0.040409, 0.02622974, 0.01253697, -0.0006525815, 
+    -0.01332286, -0.02545846, -0.03704453, -0.04806706, -0.05851257, 
+    -0.06836829, -0.07762226, -0.08626321, -0.09428057, -0.1016646, 
+    -0.1084063, -0.1144975, -0.1199307, -0.1246994, -0.1287976, -0.1322205, 
+    -0.1349638, -0.1370242, -0.1383992, -0.1390871, -0.1390871, -0.1383992, 
+    -0.1370242, -0.1349638, -0.1322205, -0.1287976, -0.1246994, -0.1199307, 
+    -0.1144975, -0.1084063, -0.1016646, -0.09428063, -0.08626315, 
+    -0.07762226, -0.06836838, -0.05851257, -0.04806712, -0.03704453, 
+    -0.02545846, -0.0133228, -0.0006525815, 0.01253691, 0.02622974, 
+    0.04040891, 0.0550575, 0.07015726, 0.08569002, 0.1016371, 0.1179785, 
+    0.1346949, 0.1517655, 0.1691698, 0.1868862, 0.2048934, 0.2231697, 
+    0.2416924, 0.2604392, 0.279387, 0.2985128, 0.3177937, 0.3372056, 
+    0.3567254, 0.3763288, 0.3959921, 0.4156917, 0.4354031, 0.4551027, 
+    0.474766, 0.4943697, 0.5138892, 0.5333011, 0.552582, 0.5717078, 
+    0.5906559, 0.6094025, 0.627925, 0.6462014, 0.6642086, 0.6819253, 
+    0.6993294, 0.7164001, 0.7331163, 0.7494578, 0.7654048, 0.7809376, 
+    0.7960376, 0.8106859, 0.8248651, 0.838558, 0.8517474, 0.8644178, 
+    0.8765533, 0.8881394, 0.8991619, 0.9096074,
+  0.9256222, 0.9346272, 0.9430356, 0.9508373, 0.9580227, 0.964583, 0.9705102, 
+    0.9757972, 0.9804376, 0.9844255, 0.9877563, 0.9904258, 0.9924307, 
+    0.9937688, 0.9944382, 0.9944382, 0.9937688, 0.9924307, 0.9904258, 
+    0.9877563, 0.9844255, 0.9804376, 0.9757972, 0.9705102, 0.964583, 
+    0.9580227, 0.9508373, 0.9430356, 0.9346272, 0.9256222, 0.9160317, 
+    0.9058673, 0.8951414, 0.883867, 0.8720579, 0.8597286, 0.846894, 
+    0.8335696, 0.8197719, 0.8055176, 0.7908242, 0.7757092, 0.7601914, 
+    0.7442896, 0.7280231, 0.7114118, 0.6944759, 0.6772361, 0.6597133, 
+    0.6419289, 0.6239046, 0.6056623, 0.5872243, 0.5686129, 0.5498511, 
+    0.5309614, 0.5119669, 0.4928909, 0.4737567, 0.4545873, 0.4354062, 
+    0.4162368, 0.3971024, 0.3780264, 0.3590321, 0.3401424, 0.3213805, 
+    0.3027691, 0.2843311, 0.2660888, 0.2480646, 0.2302802, 0.2127574, 
+    0.1955175, 0.1785816, 0.1619703, 0.1457039, 0.1298021, 0.1142842, 
+    0.09916931, 0.08447576, 0.07022151, 0.05642381, 0.04309946, 0.03026482, 
+    0.01793545, 0.006126404, -0.005147904, -0.01587385, -0.02603826, 
+    -0.03562883, -0.04463378, -0.0530422, -0.06084383, -0.06802917, 
+    -0.07458949, -0.08051682, -0.08580381, -0.09044415, -0.09443212, 
+    -0.09776282, -0.1004323, -0.1024373, -0.1037753, -0.1044447, -0.1044447, 
+    -0.1037753, -0.1024373, -0.1004323, -0.09776282, -0.09443212, 
+    -0.09044415, -0.08580381, -0.08051682, -0.07458949, -0.06802917, 
+    -0.06084388, -0.05304214, -0.04463378, -0.03562889, -0.02603826, 
+    -0.01587391, -0.005147904, 0.006126404, 0.01793551, 0.03026482, 
+    0.0430994, 0.05642381, 0.07022142, 0.08447585, 0.09916931, 0.1142841, 
+    0.1298021, 0.1457038, 0.1619704, 0.1785816, 0.1955176, 0.2127574, 
+    0.23028, 0.2480646, 0.2660888, 0.2843312, 0.3027691, 0.3213803, 
+    0.3401424, 0.359032, 0.3780265, 0.3971024, 0.4162366, 0.4354062, 
+    0.4545872, 0.4737567, 0.4928909, 0.5119671, 0.5309614, 0.5498509, 
+    0.568613, 0.5872242, 0.6056624, 0.6239046, 0.6419288, 0.6597133, 
+    0.677236, 0.6944759, 0.7114117, 0.7280232, 0.7442896, 0.7601913, 
+    0.7757093, 0.7908241, 0.8055177, 0.8197719, 0.8335695, 0.846894, 
+    0.8597286, 0.872058, 0.883867, 0.8951412, 0.9058673, 0.9160316,
+  0.9306536, 0.9393986, 0.9475642, 0.9551407, 0.9621186, 0.9684895, 
+    0.9742457, 0.97938, 0.9838864, 0.9877592, 0.9909939, 0.9935862, 
+    0.9955333, 0.9968327, 0.9974828, 0.9974828, 0.9968327, 0.9955333, 
+    0.9935862, 0.9909939, 0.9877592, 0.9838864, 0.97938, 0.9742457, 
+    0.9684895, 0.9621186, 0.9551407, 0.9475642, 0.9393986, 0.9306536, 
+    0.9213399, 0.911469, 0.9010527, 0.8901039, 0.8786356, 0.8666624, 
+    0.8541982, 0.8412586, 0.8278592, 0.8140164, 0.7997471, 0.7850685, 
+    0.7699988, 0.7545561, 0.7387592, 0.7226275, 0.7061805, 0.6894384, 
+    0.6724215, 0.6551505, 0.6376466, 0.619931, 0.6020252, 0.5839512, 
+    0.565731, 0.5473866, 0.5289406, 0.5104153, 0.4918334, 0.4732175, 
+    0.4545901, 0.4359742, 0.4173922, 0.3988669, 0.380421, 0.3620766, 
+    0.3438563, 0.3257823, 0.3078766, 0.290161, 0.2726571, 0.2553861, 
+    0.2383692, 0.2216271, 0.2051801, 0.1890483, 0.1732516, 0.1578088, 
+    0.142739, 0.1280605, 0.1137911, 0.09994841, 0.08654901, 0.07360935, 
+    0.06114525, 0.04917184, 0.03770369, 0.02675489, 0.01633862, 0.00646764, 
+    -0.002846032, -0.01159102, -0.0197567, -0.02733308, -0.034311, 
+    -0.0406819, -0.0464381, -0.05157244, -0.05607885, -0.05995166, 
+    -0.06318623, -0.06577867, -0.06772578, -0.06902516, -0.06967521, 
+    -0.06967521, -0.06902516, -0.06772578, -0.06577867, -0.06318623, 
+    -0.05995166, -0.05607885, -0.05157244, -0.0464381, -0.0406819, -0.034311, 
+    -0.02733314, -0.01975664, -0.01159102, -0.002846092, 0.00646764, 
+    0.01633856, 0.02675489, 0.03770369, 0.04917189, 0.06114525, 0.07360929, 
+    0.08654901, 0.09994832, 0.1137912, 0.1280605, 0.1427389, 0.1578088, 
+    0.1732515, 0.1890485, 0.2051801, 0.2216272, 0.2383692, 0.255386, 
+    0.2726571, 0.290161, 0.3078767, 0.3257823, 0.3438562, 0.3620766, 
+    0.3804209, 0.398867, 0.4173922, 0.435974, 0.4545901, 0.4732173, 
+    0.4918334, 0.5104153, 0.5289407, 0.5473866, 0.5657309, 0.5839512, 
+    0.6020252, 0.619931, 0.6376466, 0.6551504, 0.6724215, 0.6894383, 
+    0.7061806, 0.7226274, 0.7387593, 0.7545561, 0.7699987, 0.7850686, 
+    0.799747, 0.8140165, 0.8278592, 0.8412585, 0.8541982, 0.8666623, 
+    0.8786358, 0.8901038, 0.9010526, 0.911469, 0.9213399,
+  0.934551, 0.9430254, 0.9509383, 0.9582803, 0.9650422, 0.971216, 0.976794, 
+    0.9817695, 0.9861364, 0.9898894, 0.9930239, 0.9955361, 0.9974229, 
+    0.998682, 0.999312, 0.999312, 0.998682, 0.9974229, 0.9955361, 0.9930239, 
+    0.9898894, 0.9861364, 0.9817695, 0.976794, 0.971216, 0.9650422, 
+    0.9582803, 0.9509383, 0.9430254, 0.934551, 0.9255255, 0.9159601, 
+    0.9058661, 0.8952562, 0.8841429, 0.8725401, 0.8604617, 0.8479225, 
+    0.8349378, 0.8215234, 0.8076957, 0.7934713, 0.778868, 0.7639031, 
+    0.7485951, 0.7329627, 0.7170246, 0.7008007, 0.6843104, 0.6675739, 
+    0.6506116, 0.6334443, 0.6160927, 0.598578, 0.5809216, 0.563145, 
+    0.5452698, 0.5273178, 0.509311, 0.4912711, 0.4732202, 0.4551803, 
+    0.4371735, 0.4192215, 0.4013464, 0.3835697, 0.3659133, 0.3483986, 
+    0.331047, 0.3138796, 0.2969174, 0.280181, 0.2636907, 0.2474667, 
+    0.2315287, 0.2158962, 0.2005882, 0.1856234, 0.1710199, 0.1567956, 
+    0.1429679, 0.1295536, 0.1165688, 0.1040296, 0.09195125, 0.08034837, 
+    0.06923515, 0.05862516, 0.04853123, 0.03896573, 0.02994031, 0.02146596, 
+    0.01355296, 0.006211042, -0.0005509257, -0.006724685, -0.01230273, 
+    -0.01727819, -0.0216451, -0.02539811, -0.02853259, -0.03104475, 
+    -0.0329316, -0.03419074, -0.03482077, -0.03482077, -0.03419074, 
+    -0.0329316, -0.03104475, -0.02853259, -0.02539811, -0.0216451, 
+    -0.01727819, -0.01230273, -0.006724685, -0.0005509257, 0.006210983, 
+    0.01355302, 0.02146596, 0.02994025, 0.03896573, 0.04853117, 0.05862516, 
+    0.06923515, 0.08034843, 0.09195125, 0.1040296, 0.1165688, 0.1295535, 
+    0.142968, 0.1567956, 0.1710198, 0.1856234, 0.2005881, 0.2158963, 
+    0.2315287, 0.2474668, 0.2636907, 0.2801809, 0.2969174, 0.3138796, 
+    0.3310471, 0.3483986, 0.3659132, 0.3835697, 0.4013463, 0.4192216, 
+    0.4371735, 0.4551802, 0.4732202, 0.491271, 0.509311, 0.5273178, 
+    0.5452699, 0.563145, 0.5809215, 0.598578, 0.6160926, 0.6334443, 
+    0.6506116, 0.6675738, 0.6843104, 0.7008005, 0.7170247, 0.7329625, 
+    0.7485952, 0.7639031, 0.7788678, 0.7934715, 0.8076956, 0.8215234, 
+    0.8349378, 0.8479224, 0.8604617, 0.87254, 0.884143, 0.8952562, 0.9058661, 
+    0.9159601, 0.9255255,
+  0.9373097, 0.9455032, 0.9531538, 0.9602524, 0.9667902, 0.9727592, 
+    0.9781523, 0.9829628, 0.987185, 0.9908135, 0.9938442, 0.996273, 
+    0.9980973, 0.9993147, 0.9999238, 0.9999238, 0.9993147, 0.9980973, 
+    0.996273, 0.9938442, 0.9908135, 0.987185, 0.9829628, 0.9781523, 
+    0.9727592, 0.9667902, 0.9602524, 0.9531538, 0.9455032, 0.9373097, 
+    0.9285836, 0.9193352, 0.9095759, 0.8993177, 0.8885729, 0.8773547, 
+    0.8656768, 0.8535533, 0.8409991, 0.8280294, 0.8146602, 0.8009074, 
+    0.7867882, 0.7723194, 0.7575189, 0.7424048, 0.7269952, 0.7113091, 
+    0.6953655, 0.679184, 0.662784, 0.6461858, 0.6294095, 0.6124755, 
+    0.5954045, 0.5782172, 0.5609346, 0.5435778, 0.526168, 0.5087262, 
+    0.4912738, 0.473832, 0.4564221, 0.4390652, 0.4217828, 0.4045955, 
+    0.3875245, 0.3705904, 0.3538141, 0.3372158, 0.320816, 0.3046345, 
+    0.2886909, 0.2730047, 0.2575952, 0.2424809, 0.2276805, 0.2132118, 
+    0.1990925, 0.1853398, 0.1719705, 0.1590009, 0.1464466, 0.1343231, 
+    0.1226452, 0.111427, 0.1006822, 0.090424, 0.08066472, 0.07141635, 
+    0.06269014, 0.05449674, 0.04684609, 0.0397476, 0.0332098, 0.02724072, 
+    0.02184761, 0.01703709, 0.01281497, 0.009186417, 0.006155849, 
+    0.003726929, 0.00190264, 0.0006852448, 7.614493e-05, 7.614493e-05, 
+    0.0006852448, 0.00190264, 0.003726929, 0.006155849, 0.009186417, 
+    0.01281497, 0.01703709, 0.02184761, 0.02724072, 0.0332098, 0.03974754, 
+    0.04684615, 0.05449674, 0.06269008, 0.07141635, 0.08066466, 0.090424, 
+    0.1006822, 0.1114271, 0.1226452, 0.1343231, 0.1464466, 0.1590008, 
+    0.1719705, 0.1853398, 0.1990924, 0.2132118, 0.2276804, 0.242481, 
+    0.2575952, 0.2730048, 0.2886909, 0.3046343, 0.320816, 0.3372158, 
+    0.3538142, 0.3705904, 0.3875243, 0.4045955, 0.4217827, 0.4390654, 
+    0.4564221, 0.4738319, 0.4912738, 0.5087261, 0.526168, 0.5435778, 
+    0.5609347, 0.5782172, 0.5954044, 0.6124755, 0.6294094, 0.6461859, 
+    0.662784, 0.6791838, 0.6953655, 0.711309, 0.7269952, 0.7424047, 
+    0.7575191, 0.7723194, 0.7867881, 0.8009075, 0.8146601, 0.8280295, 
+    0.8409991, 0.8535532, 0.8656768, 0.8773547, 0.8885729, 0.8993177, 
+    0.9095759, 0.9193352, 0.9285835,
+  0.9389267, 0.9468292, 0.9542081, 0.9610546, 0.9673603, 0.9731174, 
+    0.9783189, 0.9829587, 0.9870309, 0.9905306, 0.9934536, 0.9957962, 
+    0.9975557, 0.9987299, 0.9993174, 0.9993174, 0.9987299, 0.9975557, 
+    0.9957962, 0.9934536, 0.9905306, 0.9870309, 0.9829587, 0.978319, 
+    0.9731174, 0.9673603, 0.9610546, 0.9542081, 0.9468292, 0.9389267, 
+    0.9305104, 0.9215904, 0.9121777, 0.9022837, 0.8919203, 0.8811007, 
+    0.8698373, 0.8581443, 0.8460358, 0.8335267, 0.8206322, 0.8073678, 
+    0.7937499, 0.7797949, 0.76552, 0.7509426, 0.7360801, 0.720951, 0.7055736, 
+    0.6899666, 0.674149, 0.6581402, 0.6419595, 0.6256268, 0.609162, 0.592585, 
+    0.5759161, 0.5591756, 0.542384, 0.5255615, 0.5087288, 0.4919064, 
+    0.4751146, 0.4583741, 0.4417053, 0.4251284, 0.4086635, 0.3923308, 
+    0.3761501, 0.3601413, 0.3443238, 0.3287168, 0.3133394, 0.2982102, 
+    0.2833478, 0.2687702, 0.2544954, 0.2405404, 0.2269225, 0.2136581, 
+    0.2007635, 0.1882545, 0.176146, 0.164453, 0.1531897, 0.1423699, 
+    0.1320066, 0.1221127, 0.1126999, 0.1037799, 0.09536359, 0.08746114, 
+    0.08008215, 0.07323572, 0.06693006, 0.06117293, 0.05597132, 0.05133164, 
+    0.04725942, 0.04375973, 0.04083675, 0.03849408, 0.03673458, 0.03556043, 
+    0.03497294, 0.03497294, 0.03556043, 0.03673458, 0.03849408, 0.04083675, 
+    0.04375973, 0.04725942, 0.05133164, 0.05597132, 0.06117293, 0.06693006, 
+    0.07323566, 0.08008221, 0.08746114, 0.09536353, 0.1037799, 0.1126999, 
+    0.1221127, 0.1320066, 0.14237, 0.1531897, 0.164453, 0.176146, 0.1882544, 
+    0.2007636, 0.2136581, 0.2269224, 0.2405404, 0.2544953, 0.2687703, 
+    0.2833478, 0.2982103, 0.3133394, 0.3287167, 0.3443238, 0.3601413, 
+    0.3761503, 0.3923308, 0.4086634, 0.4251284, 0.4417053, 0.4583743, 
+    0.4751146, 0.4919063, 0.5087288, 0.5255614, 0.542384, 0.5591756, 
+    0.5759162, 0.592585, 0.6091619, 0.6256269, 0.6419594, 0.6581402, 
+    0.674149, 0.6899664, 0.7055736, 0.7209509, 0.7360802, 0.7509425, 
+    0.7655201, 0.7797949, 0.7937498, 0.8073679, 0.8206322, 0.8335268, 
+    0.8460358, 0.8581442, 0.8698373, 0.8811005, 0.8919204, 0.9022837, 
+    0.9121776, 0.9215904, 0.9305103,
+  0.9393996, 0.9470016, 0.9540999, 0.960686, 0.9667518, 0.9722899, 0.9772936, 
+    0.9817569, 0.9856742, 0.9890408, 0.9918526, 0.9941062, 0.9957987, 
+    0.9969282, 0.9974934, 0.9974934, 0.9969282, 0.9957987, 0.9941062, 
+    0.9918526, 0.9890408, 0.9856742, 0.9817569, 0.9772936, 0.9722899, 
+    0.9667518, 0.960686, 0.9540998, 0.9470016, 0.9393996, 0.9313034, 
+    0.9227227, 0.913668, 0.9041503, 0.8941811, 0.8837729, 0.872938, 
+    0.8616897, 0.8500419, 0.8380085, 0.8256044, 0.8128445, 0.7997445, 
+    0.7863203, 0.7725883, 0.7585653, 0.7442681, 0.7297145, 0.7149219, 
+    0.6999085, 0.6846925, 0.6692926, 0.6537274, 0.6380159, 0.6221772, 
+    0.6062307, 0.5901958, 0.5740921, 0.5579391, 0.5417565, 0.525564, 
+    0.5093814, 0.4932283, 0.4771245, 0.4610897, 0.4451433, 0.4293046, 
+    0.4135931, 0.3980278, 0.3826279, 0.367412, 0.3523986, 0.337606, 
+    0.3230523, 0.3087552, 0.2947321, 0.2810001, 0.267576, 0.254476, 
+    0.2417161, 0.2293119, 0.2172787, 0.2056307, 0.1943825, 0.1835476, 
+    0.1731393, 0.1631702, 0.1536525, 0.1445978, 0.1360171, 0.1279208, 
+    0.1203189, 0.1132206, 0.1066346, 0.1005687, 0.09503061, 0.09002683, 
+    0.0855636, 0.08164626, 0.07827967, 0.07546788, 0.07321432, 0.07152173, 
+    0.07039222, 0.06982711, 0.06982711, 0.07039222, 0.07152173, 0.07321432, 
+    0.07546788, 0.07827967, 0.08164626, 0.0855636, 0.09002683, 0.09503061, 
+    0.1005687, 0.1066345, 0.1132207, 0.1203189, 0.1279208, 0.1360171, 
+    0.1445977, 0.1536525, 0.1631702, 0.1731393, 0.1835476, 0.1943824, 
+    0.2056307, 0.2172786, 0.229312, 0.2417161, 0.2544759, 0.267576, 0.281, 
+    0.2947322, 0.3087552, 0.3230524, 0.337606, 0.3523985, 0.367412, 
+    0.3826279, 0.398028, 0.4135931, 0.4293045, 0.4451433, 0.4610896, 
+    0.4771246, 0.4932283, 0.5093813, 0.525564, 0.5417564, 0.5579391, 
+    0.5740921, 0.590196, 0.6062307, 0.6221771, 0.6380159, 0.6537273, 
+    0.6692926, 0.6846925, 0.6999084, 0.7149219, 0.7297144, 0.7442682, 
+    0.7585652, 0.7725884, 0.7863203, 0.7997444, 0.8128445, 0.8256043, 
+    0.8380085, 0.8500419, 0.8616897, 0.872938, 0.8837729, 0.8941813, 
+    0.9041502, 0.9136679, 0.9227227, 0.9313033,
+  0.938728, 0.9460201, 0.9528292, 0.9591468, 0.9649654, 0.9702778, 0.9750776, 
+    0.979359, 0.9831166, 0.986346, 0.9890432, 0.991205, 0.9928285, 0.993912, 
+    0.9944541, 0.9944541, 0.993912, 0.9928285, 0.991205, 0.9890432, 0.986346, 
+    0.9831166, 0.979359, 0.9750776, 0.9702778, 0.9649654, 0.9591468, 
+    0.9528291, 0.9460202, 0.938728, 0.9309618, 0.9227308, 0.9140452, 
+    0.9049154, 0.8953525, 0.8853685, 0.8749752, 0.8641853, 0.8530122, 
+    0.8414693, 0.8295707, 0.8173308, 0.8047648, 0.7918878, 0.7787154, 
+    0.7652639, 0.7515494, 0.7375889, 0.7233992, 0.7089977, 0.6944019, 
+    0.6796296, 0.6646988, 0.6496276, 0.6344345, 0.6191379, 0.6037565, 
+    0.5883091, 0.5728145, 0.5572914, 0.5417589, 0.5262358, 0.5107411, 
+    0.4952936, 0.4799123, 0.4646158, 0.4494227, 0.4343515, 0.4194207, 
+    0.4046483, 0.3900526, 0.3756511, 0.3614614, 0.3475009, 0.3337864, 
+    0.3203348, 0.3071626, 0.2942855, 0.2817194, 0.2694796, 0.257581, 
+    0.2460381, 0.234865, 0.2240751, 0.2136818, 0.2036977, 0.1941349, 
+    0.1850052, 0.1763195, 0.1680885, 0.1603222, 0.1530301, 0.1462211, 
+    0.1399035, 0.1340849, 0.1287725, 0.1239726, 0.1196913, 0.1159336, 
+    0.1127042, 0.110007, 0.1078453, 0.1062217, 0.1051383, 0.1045962, 
+    0.1045962, 0.1051383, 0.1062217, 0.1078453, 0.110007, 0.1127042, 
+    0.1159336, 0.1196913, 0.1239726, 0.1287725, 0.1340849, 0.1399035, 
+    0.1462212, 0.1530301, 0.1603222, 0.1680885, 0.1763194, 0.1850052, 
+    0.1941349, 0.2036978, 0.2136818, 0.2240751, 0.234865, 0.246038, 
+    0.2575811, 0.2694796, 0.2817193, 0.2942855, 0.3071625, 0.3203349, 
+    0.3337864, 0.3475009, 0.3614614, 0.375651, 0.3900526, 0.4046483, 
+    0.4194208, 0.4343515, 0.4494226, 0.4646158, 0.4799123, 0.4952937, 
+    0.5107411, 0.5262357, 0.5417589, 0.5572913, 0.5728145, 0.5883091, 
+    0.6037567, 0.6191379, 0.6344345, 0.6496277, 0.6646987, 0.6796297, 
+    0.6944019, 0.7089976, 0.7233992, 0.7375888, 0.7515495, 0.7652638, 
+    0.7787155, 0.7918878, 0.8047647, 0.8173309, 0.8295707, 0.8414693, 
+    0.8530122, 0.8641853, 0.8749752, 0.8853684, 0.8953526, 0.9049153, 
+    0.9140451, 0.9227308, 0.9309617,
+  0.9369128, 0.9438862, 0.9503976, 0.9564391, 0.9620034, 0.9670836, 
+    0.9716736, 0.9757679, 0.9793613, 0.9824495, 0.9850289, 0.9870961, 
+    0.9886487, 0.9896848, 0.9902033, 0.9902033, 0.9896848, 0.9886487, 
+    0.9870961, 0.9850289, 0.9824495, 0.9793613, 0.9757679, 0.9716737, 
+    0.9670836, 0.9620034, 0.9564391, 0.9503976, 0.9438862, 0.9369128, 
+    0.9294859, 0.9216147, 0.9133087, 0.904578, 0.8954331, 0.8858854, 
+    0.8759463, 0.8656281, 0.8549433, 0.8439049, 0.8325263, 0.8208214, 
+    0.8088046, 0.7964903, 0.7838937, 0.7710301, 0.757915, 0.7445648, 
+    0.7309952, 0.7172232, 0.7032652, 0.6891387, 0.6748604, 0.6604479, 
+    0.6459188, 0.6312909, 0.6165817, 0.6018094, 0.586992, 0.5721474, 
+    0.5572938, 0.5424491, 0.5276316, 0.5128593, 0.4981503, 0.4835223, 
+    0.4689932, 0.4545808, 0.4403025, 0.4261758, 0.412218, 0.398446, 
+    0.3848764, 0.3715261, 0.358411, 0.3455474, 0.3329508, 0.3206366, 
+    0.3086197, 0.2969148, 0.2855363, 0.2744979, 0.2638131, 0.2534949, 
+    0.2435558, 0.234008, 0.2248632, 0.2161325, 0.2078264, 0.1999552, 
+    0.1925283, 0.185555, 0.1790436, 0.1730021, 0.1674378, 0.1623575, 
+    0.1577675, 0.1536733, 0.1500798, 0.1469916, 0.1444123, 0.1423451, 
+    0.1407924, 0.1397563, 0.1392379, 0.1392379, 0.1397563, 0.1407924, 
+    0.1423451, 0.1444123, 0.1469916, 0.1500798, 0.1536733, 0.1577675, 
+    0.1623575, 0.1674378, 0.173002, 0.1790436, 0.185555, 0.1925283, 
+    0.1999552, 0.2078264, 0.2161325, 0.2248632, 0.2340081, 0.2435558, 
+    0.2534948, 0.2638131, 0.2744979, 0.2855363, 0.2969148, 0.3086196, 
+    0.3206366, 0.3329507, 0.3455475, 0.358411, 0.3715261, 0.3848764, 
+    0.3984458, 0.412218, 0.4261758, 0.4403026, 0.4545808, 0.4689931, 
+    0.4835223, 0.4981502, 0.5128595, 0.5276316, 0.542449, 0.5572938, 
+    0.5721473, 0.586992, 0.6018094, 0.6165819, 0.6312909, 0.6459188, 
+    0.660448, 0.6748603, 0.6891387, 0.7032652, 0.717223, 0.7309952, 
+    0.7445647, 0.7579151, 0.7710301, 0.7838938, 0.7964903, 0.8088045, 
+    0.8208215, 0.8325262, 0.8439049, 0.8549433, 0.865628, 0.8759463, 
+    0.8858853, 0.8954331, 0.9045779, 0.9133086, 0.9216147, 0.9294859,
+  0.933956, 0.9406022, 0.9468081, 0.9525661, 0.9578694, 0.9627112, 0.9670858, 
+    0.970988, 0.9744128, 0.9773561, 0.9798144, 0.9817846, 0.9832644, 
+    0.984252, 0.984746, 0.984746, 0.984252, 0.9832644, 0.9817846, 0.9798144, 
+    0.9773561, 0.9744128, 0.970988, 0.9670859, 0.9627112, 0.9578694, 
+    0.9525661, 0.9468081, 0.9406023, 0.933956, 0.9268777, 0.9193758, 
+    0.9114595, 0.9031385, 0.8944227, 0.885323, 0.8758503, 0.8660162, 
+    0.8558327, 0.8453122, 0.8344676, 0.823312, 0.811859, 0.8001226, 0.788117, 
+    0.775857, 0.7633573, 0.7506335, 0.7377006, 0.7245748, 0.7112718, 
+    0.6978081, 0.6841998, 0.6704636, 0.6566163, 0.6426746, 0.6286557, 
+    0.6145766, 0.6004544, 0.5863063, 0.5721496, 0.5580016, 0.5438793, 
+    0.5298002, 0.5157813, 0.5018398, 0.4879924, 0.4742562, 0.4606479, 
+    0.4471841, 0.4338812, 0.4207554, 0.4078225, 0.3950986, 0.382599, 
+    0.3703389, 0.3583334, 0.346597, 0.335144, 0.3239883, 0.3131437, 
+    0.3026233, 0.2924398, 0.2826057, 0.273133, 0.2640333, 0.2553175, 
+    0.2469965, 0.2390801, 0.2315782, 0.2244999, 0.2178537, 0.2116478, 
+    0.2058898, 0.2005866, 0.1957448, 0.1913701, 0.187468, 0.1840432, 
+    0.1810998, 0.1786416, 0.1766713, 0.1751915, 0.174204, 0.17371, 0.17371, 
+    0.174204, 0.1751915, 0.1766713, 0.1786416, 0.1810998, 0.1840432, 
+    0.187468, 0.1913701, 0.1957448, 0.2005866, 0.2058898, 0.2116479, 
+    0.2178537, 0.2244999, 0.2315782, 0.2390801, 0.2469965, 0.2553175, 
+    0.2640333, 0.273133, 0.2826056, 0.2924398, 0.3026232, 0.3131437, 
+    0.3239883, 0.3351439, 0.346597, 0.3583333, 0.370339, 0.382599, 0.3950987, 
+    0.4078225, 0.4207553, 0.4338812, 0.4471841, 0.460648, 0.4742562, 
+    0.4879923, 0.5018398, 0.5157813, 0.5298003, 0.5438793, 0.5580015, 
+    0.5721496, 0.5863063, 0.6004544, 0.6145766, 0.6286558, 0.6426746, 
+    0.6566162, 0.6704636, 0.6841997, 0.6978081, 0.7112718, 0.7245747, 
+    0.7377006, 0.7506334, 0.7633574, 0.775857, 0.7881171, 0.8001226, 
+    0.811859, 0.823312, 0.8344676, 0.8453124, 0.8558327, 0.8660161, 
+    0.8758503, 0.8853229, 0.8944227, 0.9031384, 0.9114594, 0.9193758, 
+    0.9268777,
+  0.9298613, 0.9361722, 0.942065, 0.9475325, 0.9525682, 0.9571658, 0.9613197, 
+    0.9650249, 0.968277, 0.9710718, 0.9734061, 0.9752769, 0.9766821, 
+    0.9776198, 0.9780889, 0.9780889, 0.9776198, 0.9766821, 0.9752769, 
+    0.9734061, 0.9710718, 0.968277, 0.9650249, 0.9613197, 0.9571658, 
+    0.9525682, 0.9475325, 0.942065, 0.9361722, 0.9298613, 0.9231402, 
+    0.9160167, 0.9084998, 0.9005985, 0.8923224, 0.8836819, 0.8746871, 
+    0.8653491, 0.8556794, 0.8456897, 0.8353922, 0.8247994, 0.8139242, 
+    0.8027799, 0.79138, 0.7797385, 0.7678695, 0.7557875, 0.7435072, 
+    0.7310436, 0.7184117, 0.7056272, 0.6927055, 0.6796623, 0.6665136, 
+    0.6532753, 0.6399637, 0.6265948, 0.6131852, 0.5997509, 0.5863084, 
+    0.5728741, 0.5594643, 0.5460955, 0.5327839, 0.5195457, 0.5063969, 
+    0.4933538, 0.480432, 0.4676474, 0.4550157, 0.4425521, 0.4302717, 
+    0.4181897, 0.4063207, 0.3946792, 0.3832794, 0.372135, 0.3612598, 
+    0.350667, 0.3403695, 0.3303798, 0.3207101, 0.3113722, 0.3023774, 
+    0.2937368, 0.2854607, 0.2775595, 0.2700425, 0.2629191, 0.2561979, 
+    0.249887, 0.2439942, 0.2385267, 0.2334911, 0.2288935, 0.2247395, 
+    0.2210343, 0.2177822, 0.2149874, 0.2126531, 0.2107823, 0.2093771, 
+    0.2084395, 0.2079703, 0.2079703, 0.2084395, 0.2093771, 0.2107823, 
+    0.2126531, 0.2149874, 0.2177822, 0.2210343, 0.2247395, 0.2288935, 
+    0.2334911, 0.2385266, 0.2439943, 0.249887, 0.2561978, 0.2629191, 
+    0.2700425, 0.2775595, 0.2854607, 0.2937368, 0.3023774, 0.3113721, 
+    0.3207101, 0.3303798, 0.3403696, 0.350667, 0.3612598, 0.372135, 
+    0.3832793, 0.3946792, 0.4063207, 0.4181898, 0.4302717, 0.442552, 
+    0.4550157, 0.4676474, 0.4804321, 0.4933538, 0.5063968, 0.5195457, 
+    0.5327839, 0.5460956, 0.5594643, 0.572874, 0.5863084, 0.5997508, 
+    0.6131852, 0.6265948, 0.6399637, 0.6532753, 0.6665135, 0.6796623, 
+    0.6927055, 0.7056273, 0.7184117, 0.7310435, 0.7435072, 0.7557874, 
+    0.7678695, 0.7797385, 0.7913801, 0.8027799, 0.8139241, 0.8247994, 
+    0.8353922, 0.8456898, 0.8556794, 0.8653491, 0.8746871, 0.8836818, 
+    0.8923225, 0.9005985, 0.9084997, 0.9160167, 0.92314,
+  0.9246339, 0.9306017, 0.9361743, 0.9413446, 0.9461066, 0.9504543, 
+    0.9543824, 0.9578863, 0.9609616, 0.9636046, 0.965812, 0.9675811, 
+    0.9689099, 0.9697966, 0.9702402, 0.9702402, 0.9697966, 0.9689099, 
+    0.9675811, 0.965812, 0.9636046, 0.9609616, 0.9578863, 0.9543825, 
+    0.9504543, 0.9461066, 0.9413446, 0.9361742, 0.9306017, 0.9246339, 
+    0.9182779, 0.9115416, 0.9044333, 0.8969615, 0.8891351, 0.8809642, 
+    0.8724582, 0.8636278, 0.8544837, 0.8450369, 0.8352991, 0.8252819, 
+    0.8149978, 0.8044592, 0.7936789, 0.7826701, 0.7714462, 0.7600209, 
+    0.748408, 0.7366217, 0.7246764, 0.7125868, 0.7003673, 0.688033, 
+    0.6755989, 0.6630802, 0.650492, 0.6378497, 0.6251689, 0.6124647, 
+    0.5997528, 0.5870487, 0.5743678, 0.5617255, 0.5491374, 0.5366186, 
+    0.5241846, 0.5118502, 0.4996308, 0.4875411, 0.4755959, 0.4638096, 
+    0.4521967, 0.4407714, 0.4295474, 0.4185386, 0.4077584, 0.3972198, 
+    0.3869356, 0.3769185, 0.3671806, 0.357734, 0.3485898, 0.3397593, 
+    0.3312534, 0.3230824, 0.3152562, 0.3077843, 0.300676, 0.2939397, 
+    0.2875837, 0.2816159, 0.2760433, 0.270873, 0.266111, 0.2617633, 
+    0.2578351, 0.2543312, 0.251256, 0.248613, 0.2464056, 0.2446365, 
+    0.2433077, 0.242421, 0.2419773, 0.2419773, 0.242421, 0.2433077, 
+    0.2446365, 0.2464056, 0.248613, 0.251256, 0.2543312, 0.2578351, 
+    0.2617633, 0.266111, 0.270873, 0.2760434, 0.2816159, 0.2875837, 
+    0.2939397, 0.3006759, 0.3077843, 0.3152562, 0.3230824, 0.3312534, 
+    0.3397593, 0.3485898, 0.3577339, 0.3671807, 0.3769185, 0.3869356, 
+    0.3972198, 0.4077583, 0.4185387, 0.4295474, 0.4407715, 0.4521967, 
+    0.4638095, 0.4755959, 0.4875411, 0.4996309, 0.5118502, 0.5241845, 
+    0.5366186, 0.5491374, 0.5617256, 0.5743678, 0.5870486, 0.5997528, 
+    0.6124647, 0.6251689, 0.6378497, 0.6504921, 0.6630802, 0.6755989, 
+    0.688033, 0.7003673, 0.7125868, 0.7246764, 0.7366216, 0.748408, 
+    0.7600208, 0.7714462, 0.7826701, 0.793679, 0.8044592, 0.8149978, 
+    0.825282, 0.835299, 0.8450369, 0.8544837, 0.8636278, 0.8724582, 
+    0.8809641, 0.8891352, 0.8969613, 0.9044332, 0.9115416, 0.9182779,
+  0.9182798, 0.9238974, 0.9291428, 0.9340097, 0.9384922, 0.9425848, 
+    0.9462824, 0.9495806, 0.9524754, 0.9549632, 0.957041, 0.9587064, 
+    0.9599571, 0.9607918, 0.9612094, 0.9612094, 0.9607918, 0.9599571, 
+    0.9587064, 0.957041, 0.9549632, 0.9524754, 0.9495806, 0.9462824, 
+    0.9425848, 0.9384922, 0.9340097, 0.9291428, 0.9238974, 0.9182798, 
+    0.9122969, 0.9059559, 0.8992648, 0.8922315, 0.8848646, 0.8771731, 
+    0.8691664, 0.8608543, 0.8522468, 0.8433545, 0.8341882, 0.8247589, 
+    0.8150785, 0.8051584, 0.7950108, 0.7846482, 0.7740829, 0.7633282, 
+    0.7523969, 0.7413024, 0.7300582, 0.7186781, 0.7071758, 0.6955655, 
+    0.6838611, 0.6720771, 0.6602278, 0.6483275, 0.6363909, 0.6244324, 
+    0.6124666, 0.6005081, 0.5885714, 0.5766712, 0.5648219, 0.5530379, 
+    0.5413336, 0.5297232, 0.5182209, 0.5068408, 0.4955966, 0.4845022, 
+    0.4735709, 0.4628161, 0.4522509, 0.4418882, 0.4317406, 0.4218206, 
+    0.41214, 0.4027109, 0.3935445, 0.3846523, 0.3760448, 0.3677326, 
+    0.3597259, 0.3520344, 0.3446676, 0.3376343, 0.3309431, 0.3246022, 
+    0.3186193, 0.3130017, 0.3077562, 0.3028893, 0.2984068, 0.2943143, 
+    0.2906166, 0.2873184, 0.2844236, 0.2819358, 0.279858, 0.2781927, 
+    0.2769419, 0.2761072, 0.2756896, 0.2756896, 0.2761072, 0.2769419, 
+    0.2781927, 0.279858, 0.2819358, 0.2844236, 0.2873184, 0.2906166, 
+    0.2943143, 0.2984068, 0.3028893, 0.3077562, 0.3130017, 0.3186192, 
+    0.3246022, 0.330943, 0.3376343, 0.3446676, 0.3520345, 0.3597259, 
+    0.3677326, 0.3760448, 0.3846522, 0.3935446, 0.4027109, 0.41214, 
+    0.4218206, 0.4317406, 0.4418883, 0.4522509, 0.4628161, 0.4735709, 
+    0.4845021, 0.4955966, 0.5068408, 0.518221, 0.5297232, 0.5413335, 
+    0.5530379, 0.5648218, 0.5766712, 0.5885714, 0.600508, 0.6124666, 
+    0.6244323, 0.6363909, 0.6483275, 0.6602278, 0.6720771, 0.6838611, 
+    0.6955655, 0.7071758, 0.7186781, 0.7300582, 0.7413023, 0.7523969, 
+    0.7633281, 0.774083, 0.7846481, 0.7950109, 0.8051584, 0.8150784, 
+    0.824759, 0.8341882, 0.8433545, 0.8522468, 0.8608542, 0.8691664, 
+    0.8771731, 0.8848646, 0.8922315, 0.8992647, 0.9059559, 0.9122968,
+  0.910807, 0.9160675, 0.9209795, 0.925537, 0.9297346, 0.9335669, 0.9370295, 
+    0.9401181, 0.9428288, 0.9451585, 0.9471043, 0.9486637, 0.9498349, 
+    0.9506166, 0.9510077, 0.9510077, 0.9506166, 0.9498349, 0.9486637, 
+    0.9471043, 0.9451585, 0.9428288, 0.9401181, 0.9370295, 0.9335669, 
+    0.9297346, 0.925537, 0.9209795, 0.9160675, 0.910807, 0.9052044, 
+    0.8992666, 0.8930008, 0.8864146, 0.8795159, 0.8723135, 0.8648158, 
+    0.857032, 0.8489717, 0.8406447, 0.8320611, 0.8232313, 0.8141661, 
+    0.8048767, 0.7953742, 0.7856703, 0.7757767, 0.7657056, 0.7554692, 
+    0.74508, 0.7345506, 0.7238939, 0.7131228, 0.7022505, 0.6912903, 
+    0.6802553, 0.6691592, 0.6580154, 0.6468377, 0.6356394, 0.6244342, 
+    0.6132359, 0.6020581, 0.5909142, 0.5798182, 0.5687833, 0.5578231, 
+    0.5469508, 0.5361797, 0.5255229, 0.5149936, 0.5046043, 0.494368, 
+    0.4842969, 0.4744033, 0.4646993, 0.4551969, 0.4459074, 0.4368423, 
+    0.4280125, 0.4194288, 0.4111018, 0.4030415, 0.3952578, 0.3877601, 
+    0.3805575, 0.373659, 0.3670728, 0.3608069, 0.3548691, 0.3492666, 
+    0.3440061, 0.339094, 0.3345365, 0.330339, 0.3265066, 0.323044, 0.3199555, 
+    0.3172447, 0.314915, 0.3129693, 0.3114098, 0.3102386, 0.3094569, 
+    0.3090659, 0.3090659, 0.3094569, 0.3102386, 0.3114098, 0.3129693, 
+    0.314915, 0.3172447, 0.3199555, 0.323044, 0.3265066, 0.330339, 0.3345365, 
+    0.3390941, 0.3440061, 0.3492665, 0.3548691, 0.3608069, 0.3670728, 
+    0.373659, 0.3805576, 0.3877601, 0.3952577, 0.4030415, 0.4111018, 
+    0.4194289, 0.4280125, 0.4368422, 0.4459074, 0.4551968, 0.4646994, 
+    0.4744033, 0.4842969, 0.494368, 0.5046043, 0.5149936, 0.5255229, 
+    0.5361797, 0.5469508, 0.5578229, 0.5687833, 0.5798182, 0.5909144, 
+    0.6020581, 0.6132358, 0.6244342, 0.6356393, 0.6468377, 0.6580154, 
+    0.6691593, 0.6802553, 0.6912901, 0.7022505, 0.7131228, 0.7238939, 
+    0.7345506, 0.7450799, 0.7554692, 0.7657055, 0.7757767, 0.7856702, 
+    0.7953742, 0.8048767, 0.8141661, 0.8232313, 0.8320611, 0.8406447, 
+    0.8489717, 0.8570319, 0.8648158, 0.8723134, 0.879516, 0.8864145, 
+    0.8930007, 0.8992666, 0.9052044,
+  0.9022244, 0.9071214, 0.911694, 0.9159366, 0.919844, 0.9234116, 0.9266349, 
+    0.92951, 0.9320334, 0.9342021, 0.9360135, 0.9374651, 0.9385555, 
+    0.9392831, 0.9396471, 0.9396471, 0.9392831, 0.9385555, 0.9374651, 
+    0.9360135, 0.9342021, 0.9320334, 0.92951, 0.9266349, 0.9234116, 0.919844, 
+    0.9159366, 0.911694, 0.9071214, 0.9022244, 0.897009, 0.8914815, 
+    0.8856487, 0.8795177, 0.8730958, 0.8663909, 0.8594114, 0.8521655, 
+    0.8446622, 0.8369106, 0.8289201, 0.8207005, 0.8122618, 0.8036143, 
+    0.7947684, 0.7857351, 0.7765251, 0.76715, 0.757621, 0.7479497, 0.7381479, 
+    0.7282277, 0.7182009, 0.7080799, 0.697877, 0.6876047, 0.6772754, 
+    0.6669016, 0.6564963, 0.6460718, 0.635641, 0.6252165, 0.6148111, 
+    0.6044374, 0.5941081, 0.5838358, 0.5736328, 0.5635118, 0.5534851, 
+    0.5435648, 0.5337631, 0.5240918, 0.5145627, 0.5051876, 0.4959777, 
+    0.4869443, 0.4780985, 0.469451, 0.4610122, 0.4527926, 0.4448022, 
+    0.4370506, 0.4295473, 0.4223014, 0.4153218, 0.408617, 0.4021952, 
+    0.3960641, 0.3902313, 0.3847037, 0.3794883, 0.3745914, 0.3700188, 
+    0.3657762, 0.3618687, 0.3583012, 0.3550779, 0.3522027, 0.3496793, 
+    0.3475106, 0.3456993, 0.3442476, 0.3431573, 0.3424297, 0.3420657, 
+    0.3420657, 0.3424297, 0.3431573, 0.3442476, 0.3456993, 0.3475106, 
+    0.3496793, 0.3522027, 0.3550779, 0.3583012, 0.3618687, 0.3657762, 
+    0.3700188, 0.3745914, 0.3794883, 0.3847037, 0.3902312, 0.3960641, 
+    0.4021952, 0.408617, 0.4153218, 0.4223014, 0.4295473, 0.4370506, 
+    0.4448022, 0.4527926, 0.4610122, 0.469451, 0.4780985, 0.4869444, 
+    0.4959777, 0.5051876, 0.5145627, 0.5240917, 0.5337631, 0.5435648, 
+    0.5534852, 0.5635118, 0.5736328, 0.5838358, 0.594108, 0.6044375, 
+    0.6148111, 0.6252164, 0.635641, 0.6460717, 0.6564963, 0.6669016, 
+    0.6772754, 0.6876047, 0.697877, 0.7080799, 0.7182009, 0.7282277, 
+    0.7381479, 0.7479497, 0.757621, 0.76715, 0.7765253, 0.785735, 0.7947685, 
+    0.8036143, 0.8122618, 0.8207005, 0.8289201, 0.8369106, 0.8446622, 
+    0.8521655, 0.8594114, 0.8663909, 0.8730958, 0.8795176, 0.8856486, 
+    0.8914815, 0.897009,
+  0.8925427, 0.8970702, 0.9012977, 0.9052203, 0.9088329, 0.9121312, 
+    0.9151113, 0.9177696, 0.9201026, 0.9221076, 0.9237822, 0.9251244, 
+    0.9261324, 0.9268052, 0.9271418, 0.9271418, 0.9268052, 0.9261324, 
+    0.9251244, 0.9237822, 0.9221076, 0.9201026, 0.9177696, 0.9151113, 
+    0.9121312, 0.9088329, 0.9052203, 0.9012977, 0.8970702, 0.8925427, 
+    0.8877208, 0.8826103, 0.8772176, 0.8715491, 0.8656118, 0.8594129, 
+    0.8529599, 0.8462608, 0.8393236, 0.8321568, 0.8247693, 0.8171698, 
+    0.8093678, 0.8013728, 0.7931944, 0.7848426, 0.7763276, 0.7676598, 
+    0.7588497, 0.7499082, 0.740846, 0.7316742, 0.7224039, 0.7130466, 
+    0.7036135, 0.6941162, 0.6845663, 0.6749753, 0.665355, 0.6557171, 
+    0.6460733, 0.6364353, 0.626815, 0.617224, 0.6076741, 0.5981768, 
+    0.5887437, 0.5793864, 0.5701162, 0.5609444, 0.5518822, 0.5429406, 
+    0.5341306, 0.5254627, 0.5169477, 0.5085959, 0.5004176, 0.4924225, 
+    0.4846205, 0.4770211, 0.4696335, 0.4624668, 0.4555296, 0.4488304, 
+    0.4423775, 0.4361786, 0.4302412, 0.4245728, 0.41918, 0.4140696, 
+    0.4092477, 0.4047202, 0.4004926, 0.3965701, 0.3929575, 0.3896591, 
+    0.386679, 0.3840208, 0.3816878, 0.3796827, 0.3780081, 0.3766659, 
+    0.3756579, 0.3749852, 0.3746486, 0.3746486, 0.3749852, 0.3756579, 
+    0.3766659, 0.3780081, 0.3796827, 0.3816878, 0.3840208, 0.386679, 
+    0.3896591, 0.3929575, 0.3965701, 0.4004926, 0.4047202, 0.4092476, 
+    0.4140696, 0.41918, 0.4245728, 0.4302412, 0.4361786, 0.4423775, 
+    0.4488304, 0.4555296, 0.4624667, 0.4696335, 0.4770211, 0.4846205, 
+    0.4924225, 0.5004175, 0.5085961, 0.5169477, 0.5254628, 0.5341306, 
+    0.5429406, 0.5518822, 0.5609444, 0.5701162, 0.5793864, 0.5887437, 
+    0.5981768, 0.6076741, 0.6172241, 0.626815, 0.6364353, 0.6460733, 
+    0.655717, 0.665355, 0.6749753, 0.6845663, 0.6941162, 0.7036135, 
+    0.7130466, 0.7224039, 0.7316742, 0.740846, 0.7499081, 0.7588497, 
+    0.7676598, 0.7763276, 0.7848426, 0.7931944, 0.8013728, 0.8093678, 
+    0.8171698, 0.8247693, 0.8321569, 0.8393236, 0.8462607, 0.8529599, 
+    0.8594128, 0.8656118, 0.8715491, 0.8772175, 0.8826103, 0.8877208,
+  0.8817735, 0.885926, 0.8898034, 0.893401, 0.8967144, 0.8997396, 0.9024729, 
+    0.9049109, 0.9070507, 0.9088897, 0.9104256, 0.9116566, 0.9125811, 
+    0.9131981, 0.9135069, 0.9135069, 0.9131981, 0.9125811, 0.9116566, 
+    0.9104256, 0.9088897, 0.9070507, 0.9049109, 0.9024729, 0.8997396, 
+    0.8967144, 0.893401, 0.8898034, 0.885926, 0.8817735, 0.877351, 0.8726639, 
+    0.8677177, 0.8625188, 0.8570732, 0.8513877, 0.8454693, 0.839325, 
+    0.8329624, 0.8263893, 0.8196136, 0.8126435, 0.8054878, 0.798155, 
+    0.7906539, 0.7829939, 0.7751842, 0.7672343, 0.759154, 0.750953, 
+    0.7426414, 0.7342293, 0.7257269, 0.7171445, 0.7084929, 0.6997822, 
+    0.6910232, 0.6822266, 0.6734032, 0.6645635, 0.6557185, 0.6468788, 
+    0.6380553, 0.6292588, 0.6204998, 0.6117892, 0.6031374, 0.5945551, 
+    0.5860527, 0.5776405, 0.569329, 0.561128, 0.5530477, 0.5450978, 
+    0.5372881, 0.529628, 0.522127, 0.5147942, 0.5076384, 0.5006684, 
+    0.4938927, 0.4873196, 0.480957, 0.4748127, 0.4688942, 0.4632087, 
+    0.4577632, 0.4525642, 0.4476182, 0.442931, 0.4385085, 0.434356, 
+    0.4304786, 0.426881, 0.4235676, 0.4205424, 0.4178091, 0.4153711, 
+    0.4132313, 0.4113923, 0.4098564, 0.4086254, 0.4077008, 0.4070838, 
+    0.4067751, 0.4067751, 0.4070838, 0.4077008, 0.4086254, 0.4098564, 
+    0.4113923, 0.4132313, 0.4153711, 0.4178091, 0.4205424, 0.4235676, 
+    0.426881, 0.4304786, 0.434356, 0.4385085, 0.442931, 0.4476181, 0.4525642, 
+    0.4577632, 0.4632088, 0.4688942, 0.4748127, 0.480957, 0.4873196, 
+    0.4938928, 0.5006684, 0.5076383, 0.5147942, 0.522127, 0.5296281, 
+    0.5372881, 0.5450978, 0.5530477, 0.561128, 0.569329, 0.5776405, 
+    0.5860528, 0.5945551, 0.6031373, 0.6117892, 0.6204998, 0.6292588, 
+    0.6380553, 0.6468788, 0.6557185, 0.6645635, 0.6734032, 0.6822266, 
+    0.6910233, 0.6997822, 0.7084928, 0.7171446, 0.7257268, 0.7342293, 
+    0.7426414, 0.750953, 0.759154, 0.7672343, 0.7751842, 0.7829939, 
+    0.7906539, 0.798155, 0.8054878, 0.8126436, 0.8196136, 0.8263893, 
+    0.8329624, 0.839325, 0.8454693, 0.8513877, 0.8570732, 0.8625188, 
+    0.8677177, 0.8726639, 0.8773509,
+  0.86993, 0.8737025, 0.877225, 0.8804933, 0.8835034, 0.8862517, 0.8887348, 
+    0.8909497, 0.8928937, 0.8945644, 0.8959597, 0.897078, 0.897918, 
+    0.8984785, 0.8987589, 0.8987589, 0.8984785, 0.897918, 0.897078, 
+    0.8959597, 0.8945644, 0.8928937, 0.8909497, 0.8887349, 0.8862517, 
+    0.8835034, 0.8804933, 0.877225, 0.8737025, 0.86993, 0.8659123, 0.8616541, 
+    0.8571607, 0.8524376, 0.8474904, 0.8423253, 0.8369486, 0.8313667, 
+    0.8255864, 0.8196148, 0.8134593, 0.8071272, 0.8006264, 0.7939647, 
+    0.7871502, 0.7801913, 0.7730963, 0.7658741, 0.7585334, 0.751083, 
+    0.7435321, 0.7358899, 0.7281657, 0.7203689, 0.712509, 0.7045956, 
+    0.6966383, 0.6886468, 0.6806309, 0.6726003, 0.6645648, 0.6565342, 
+    0.6485183, 0.6405268, 0.6325696, 0.6246561, 0.6167963, 0.6089994, 
+    0.6012752, 0.593633, 0.5860822, 0.5786318, 0.571291, 0.5640687, 
+    0.5569738, 0.5500149, 0.5432004, 0.5365387, 0.5300379, 0.5237058, 
+    0.5175502, 0.5115787, 0.5057985, 0.5002166, 0.4948398, 0.4896747, 
+    0.4847275, 0.4800044, 0.475511, 0.4712529, 0.4672351, 0.4634627, 
+    0.4599401, 0.4566718, 0.4536617, 0.4509134, 0.4484302, 0.4462154, 
+    0.4442714, 0.4426008, 0.4412054, 0.4400871, 0.4392471, 0.4386866, 
+    0.4384062, 0.4384062, 0.4386866, 0.4392471, 0.4400871, 0.4412054, 
+    0.4426008, 0.4442714, 0.4462154, 0.4484302, 0.4509134, 0.4536617, 
+    0.4566718, 0.4599402, 0.4634627, 0.4672351, 0.4712529, 0.475511, 
+    0.4800044, 0.4847275, 0.4896747, 0.4948398, 0.5002165, 0.5057985, 
+    0.5115787, 0.5175503, 0.5237058, 0.5300378, 0.5365387, 0.5432004, 
+    0.5500149, 0.5569738, 0.5640688, 0.571291, 0.5786318, 0.5860822, 
+    0.593633, 0.6012753, 0.6089994, 0.6167962, 0.6246561, 0.6325696, 
+    0.6405269, 0.6485183, 0.6565341, 0.6645648, 0.6726003, 0.6806309, 
+    0.6886468, 0.6966383, 0.7045956, 0.7125089, 0.7203689, 0.7281656, 
+    0.7358899, 0.7435321, 0.7510829, 0.7585334, 0.7658741, 0.7730964, 
+    0.7801912, 0.7871503, 0.7939647, 0.8006264, 0.8071273, 0.8134593, 
+    0.8196149, 0.8255864, 0.8313666, 0.8369486, 0.8423253, 0.8474904, 
+    0.8524376, 0.8571607, 0.8616541, 0.8659123,
+  0.8570268, 0.8604145, 0.8635779, 0.866513, 0.8692162, 0.8716843, 0.8739142, 
+    0.8759032, 0.8776489, 0.8791493, 0.8804023, 0.8814067, 0.882161, 
+    0.8826643, 0.8829162, 0.8829162, 0.8826643, 0.8821609, 0.8814067, 
+    0.8804023, 0.8791493, 0.8776489, 0.8759032, 0.8739142, 0.8716843, 
+    0.8692162, 0.866513, 0.8635779, 0.8604146, 0.8570268, 0.8534187, 
+    0.8495947, 0.8455595, 0.841318, 0.8368752, 0.8322368, 0.8274083, 
+    0.8223954, 0.8172046, 0.811842, 0.8063141, 0.8006276, 0.7947897, 
+    0.7888072, 0.7826875, 0.7764382, 0.7700667, 0.7635809, 0.7569886, 
+    0.7502978, 0.7435169, 0.7366539, 0.7297173, 0.7227155, 0.7156571, 
+    0.7085505, 0.7014046, 0.6942279, 0.6870294, 0.6798177, 0.6726015, 
+    0.6653897, 0.6581911, 0.6510145, 0.6438686, 0.6367621, 0.6297036, 
+    0.6227018, 0.6157652, 0.6089022, 0.6021213, 0.5954306, 0.5888383, 
+    0.5823525, 0.575981, 0.5697316, 0.563612, 0.5576295, 0.5517915, 
+    0.5461051, 0.5405772, 0.5352145, 0.5300237, 0.5250109, 0.5201824, 
+    0.5155439, 0.5111012, 0.5068597, 0.5028244, 0.4990005, 0.4953924, 
+    0.4920046, 0.4888412, 0.4859062, 0.483203, 0.4807349, 0.478505, 
+    0.4765159, 0.4747702, 0.4732699, 0.4720168, 0.4710125, 0.4702582, 
+    0.4697548, 0.469503, 0.469503, 0.4697548, 0.4702582, 0.4710125, 
+    0.4720168, 0.4732699, 0.4747702, 0.4765159, 0.478505, 0.4807349, 
+    0.483203, 0.4859062, 0.4888413, 0.4920046, 0.4953924, 0.4990005, 
+    0.5028244, 0.5068597, 0.5111012, 0.5155439, 0.5201824, 0.5250109, 
+    0.5300237, 0.5352145, 0.5405772, 0.5461051, 0.5517914, 0.5576295, 
+    0.5636119, 0.5697316, 0.575981, 0.5823525, 0.5888383, 0.5954306, 
+    0.6021213, 0.6089022, 0.6157652, 0.6227018, 0.6297036, 0.6367621, 
+    0.6438686, 0.6510146, 0.6581911, 0.6653897, 0.6726015, 0.6798176, 
+    0.6870294, 0.6942279, 0.7014046, 0.7085505, 0.715657, 0.7227156, 
+    0.7297173, 0.736654, 0.7435169, 0.7502978, 0.7569886, 0.7635808, 
+    0.7700667, 0.7764382, 0.7826876, 0.7888072, 0.7947896, 0.8006276, 
+    0.8063141, 0.811842, 0.8172046, 0.8223954, 0.8274083, 0.8322368, 
+    0.8368753, 0.8413179, 0.8455595, 0.8495947, 0.8534186,
+  0.8430792, 0.8460782, 0.8488785, 0.8514768, 0.8538698, 0.8560546, 
+    0.8580286, 0.8597894, 0.8613348, 0.8626629, 0.8637722, 0.8646612, 
+    0.865329, 0.8657746, 0.8659976, 0.8659976, 0.8657746, 0.865329, 
+    0.8646612, 0.8637722, 0.8626629, 0.8613348, 0.8597894, 0.8580286, 
+    0.8560546, 0.8538698, 0.8514768, 0.8488785, 0.8460782, 0.8430792, 
+    0.8398852, 0.8365, 0.8329279, 0.8291731, 0.8252403, 0.8211342, 0.8168597, 
+    0.8124222, 0.8078271, 0.8030798, 0.7981863, 0.7931525, 0.7879844, 
+    0.7826886, 0.7772712, 0.771739, 0.7660987, 0.7603572, 0.7545214, 
+    0.7485986, 0.7425958, 0.7365204, 0.7303798, 0.7241815, 0.7179331, 
+    0.7116421, 0.7053163, 0.6989633, 0.6925908, 0.6862067, 0.6798186, 
+    0.6734345, 0.667062, 0.660709, 0.6543832, 0.6480922, 0.6418437, 
+    0.6356455, 0.6295049, 0.6234295, 0.6174268, 0.6115039, 0.6056681, 
+    0.5999266, 0.5942863, 0.5887541, 0.5833368, 0.5780409, 0.5728729, 
+    0.567839, 0.5629455, 0.5581983, 0.5536032, 0.5491656, 0.5448912, 
+    0.5407851, 0.5368522, 0.5330974, 0.5295253, 0.5261402, 0.5229461, 
+    0.5199471, 0.5171468, 0.5145485, 0.5121556, 0.5099707, 0.5079967, 
+    0.506236, 0.5046905, 0.5033624, 0.5022532, 0.5013641, 0.5006964, 
+    0.5002508, 0.5000278, 0.5000278, 0.5002508, 0.5006964, 0.5013641, 
+    0.5022532, 0.5033624, 0.5046905, 0.506236, 0.5079967, 0.5099707, 
+    0.5121556, 0.5145485, 0.5171468, 0.5199471, 0.5229461, 0.5261402, 
+    0.5295253, 0.5330974, 0.5368522, 0.5407851, 0.5448912, 0.5491656, 
+    0.5536032, 0.5581983, 0.5629455, 0.567839, 0.5728728, 0.5780409, 
+    0.5833368, 0.5887542, 0.5942863, 0.5999267, 0.6056681, 0.6115038, 
+    0.6174268, 0.6234295, 0.629505, 0.6356455, 0.6418437, 0.6480922, 
+    0.6543831, 0.660709, 0.667062, 0.6734345, 0.6798186, 0.6862066, 
+    0.6925908, 0.6989633, 0.7053164, 0.7116421, 0.7179331, 0.7241816, 
+    0.7303798, 0.7365204, 0.7425958, 0.7485985, 0.7545214, 0.7603571, 
+    0.7660987, 0.771739, 0.7772712, 0.7826886, 0.7879844, 0.7931525, 
+    0.7981863, 0.8030798, 0.8078271, 0.8124222, 0.8168597, 0.8211341, 
+    0.8252403, 0.8291731, 0.8329279, 0.8365, 0.8398852,
+  0.8281046, 0.8307111, 0.833145, 0.8354033, 0.8374831, 0.8393821, 0.8410977, 
+    0.8426281, 0.8439713, 0.8451256, 0.8460897, 0.8468624, 0.8474428, 
+    0.8478301, 0.8480239, 0.8480239, 0.8478301, 0.8474428, 0.8468624, 
+    0.8460897, 0.8451256, 0.8439713, 0.8426281, 0.8410977, 0.8393821, 
+    0.8374831, 0.8354033, 0.833145, 0.8307111, 0.8281046, 0.8253285, 
+    0.8223863, 0.8192816, 0.8160182, 0.8125999, 0.8090311, 0.805316, 
+    0.8014592, 0.7974653, 0.7933393, 0.7890862, 0.784711, 0.7802193, 
+    0.7756163, 0.7709079, 0.7660996, 0.7611974, 0.7562072, 0.7511351, 
+    0.7459873, 0.74077, 0.7354896, 0.7301526, 0.7247654, 0.7193346, 
+    0.7138668, 0.7083687, 0.7028471, 0.6973085, 0.6917598, 0.6862077, 
+    0.6806589, 0.6751203, 0.6695986, 0.6641005, 0.6586328, 0.653202, 
+    0.6478148, 0.6424778, 0.6371974, 0.6319801, 0.6268322, 0.6217601, 
+    0.61677, 0.6118677, 0.6070594, 0.602351, 0.5977481, 0.5932564, 0.5888812, 
+    0.584628, 0.580502, 0.5765082, 0.5726513, 0.5689362, 0.5653674, 
+    0.5619492, 0.5586858, 0.555581, 0.5526389, 0.5498628, 0.5472562, 
+    0.5448223, 0.5425642, 0.5404842, 0.5385853, 0.5368696, 0.5353392, 
+    0.5339961, 0.5328417, 0.5318776, 0.5311049, 0.5305246, 0.5301372, 
+    0.5299435, 0.5299435, 0.5301372, 0.5305246, 0.5311049, 0.5318776, 
+    0.5328417, 0.5339961, 0.5353392, 0.5368696, 0.5385853, 0.5404842, 
+    0.5425641, 0.5448224, 0.5472562, 0.5498628, 0.5526389, 0.555581, 
+    0.5586858, 0.5619492, 0.5653675, 0.5689362, 0.5726513, 0.5765082, 
+    0.580502, 0.584628, 0.5888812, 0.5932563, 0.5977481, 0.602351, 0.6070595, 
+    0.6118677, 0.61677, 0.6217601, 0.6268322, 0.6319801, 0.6371974, 
+    0.6424778, 0.6478148, 0.6532019, 0.6586328, 0.6641005, 0.6695986, 
+    0.6751203, 0.6806589, 0.6862077, 0.6917597, 0.6973085, 0.7028471, 
+    0.7083688, 0.7138668, 0.7193345, 0.7247654, 0.7301525, 0.7354896, 
+    0.74077, 0.7459872, 0.7511351, 0.7562072, 0.7611974, 0.7660996, 
+    0.7709079, 0.7756163, 0.7802193, 0.7847111, 0.7890862, 0.7933394, 
+    0.7974653, 0.8014592, 0.805316, 0.8090311, 0.8126, 0.8160182, 0.8192816, 
+    0.8223863, 0.8253285,
+  0.812121, 0.8143319, 0.8163964, 0.8183119, 0.8200761, 0.8216869, 0.8231421, 
+    0.8244402, 0.8255795, 0.8265587, 0.8273765, 0.8280319, 0.8285242, 
+    0.8288527, 0.829017, 0.829017, 0.8288527, 0.8285242, 0.8280319, 
+    0.8273765, 0.8265587, 0.8255795, 0.8244402, 0.8231421, 0.8216869, 
+    0.8200761, 0.8183119, 0.8163964, 0.8143319, 0.812121, 0.8097663, 
+    0.8072706, 0.8046371, 0.801869, 0.7989696, 0.7959424, 0.7927912, 
+    0.7895197, 0.786132, 0.7826322, 0.7790247, 0.7753135, 0.7715035, 
+    0.7675992, 0.7636054, 0.7595269, 0.7553687, 0.7511359, 0.7468336, 
+    0.742467, 0.7380416, 0.7335627, 0.7290357, 0.7244661, 0.7198596, 
+    0.7152217, 0.7105581, 0.7058744, 0.7011765, 0.69647, 0.6917605, 
+    0.6870539, 0.6823559, 0.6776723, 0.6730087, 0.6683708, 0.6637643, 
+    0.6591947, 0.6546677, 0.6501888, 0.6457634, 0.6413969, 0.6370946, 
+    0.6328617, 0.6287035, 0.624625, 0.6206312, 0.6167269, 0.6129169, 
+    0.6092058, 0.6055982, 0.6020984, 0.5987107, 0.5954393, 0.592288, 
+    0.5892608, 0.5863614, 0.5835933, 0.5809598, 0.5784642, 0.5761095, 
+    0.5738985, 0.571834, 0.5699185, 0.5681543, 0.5665436, 0.5650883, 
+    0.5637902, 0.5626509, 0.5616717, 0.560854, 0.5601985, 0.5597063, 
+    0.5593778, 0.5592134, 0.5592134, 0.5593778, 0.5597063, 0.5601985, 
+    0.560854, 0.5616717, 0.5626509, 0.5637902, 0.5650883, 0.5665436, 
+    0.5681543, 0.5699185, 0.571834, 0.5738985, 0.5761094, 0.5784642, 
+    0.5809598, 0.5835933, 0.5863614, 0.5892609, 0.592288, 0.5954393, 
+    0.5987107, 0.6020983, 0.6055982, 0.6092058, 0.6129169, 0.6167269, 
+    0.6206312, 0.6246251, 0.6287035, 0.6328618, 0.6370946, 0.6413968, 
+    0.6457634, 0.6501888, 0.6546677, 0.6591947, 0.6637642, 0.6683708, 
+    0.6730087, 0.6776723, 0.6823559, 0.6870539, 0.6917605, 0.6964699, 
+    0.7011765, 0.7058744, 0.7105582, 0.7152217, 0.7198596, 0.7244661, 
+    0.7290357, 0.7335627, 0.7380416, 0.742467, 0.7468336, 0.7511359, 
+    0.7553687, 0.7595268, 0.7636054, 0.7675992, 0.7715035, 0.7753136, 
+    0.7790246, 0.7826323, 0.786132, 0.7895197, 0.7927912, 0.7959424, 
+    0.7989696, 0.801869, 0.8046371, 0.8072706, 0.8097662,
+  0.795148, 0.7969607, 0.7986532, 0.8002236, 0.80167, 0.8029906, 0.8041837, 
+    0.8052479, 0.806182, 0.8069847, 0.8076552, 0.8081925, 0.8085961, 
+    0.8088654, 0.8090002, 0.8090002, 0.8088654, 0.8085961, 0.8081925, 
+    0.8076552, 0.8069847, 0.806182, 0.8052479, 0.8041837, 0.8029906, 0.80167, 
+    0.8002236, 0.7986532, 0.7969607, 0.795148, 0.7932175, 0.7911714, 
+    0.7890124, 0.7867429, 0.7843658, 0.781884, 0.7793005, 0.7766184, 
+    0.773841, 0.7709717, 0.768014, 0.7649714, 0.7618479, 0.7586469, 
+    0.7553725, 0.7520288, 0.7486197, 0.7451494, 0.7416222, 0.7380424, 
+    0.7344142, 0.7307421, 0.7270306, 0.7232843, 0.7195076, 0.7157053, 
+    0.7118818, 0.708042, 0.7041904, 0.7003317, 0.6964706, 0.692612, 
+    0.6887603, 0.6849204, 0.681097, 0.6772947, 0.673518, 0.6697717, 
+    0.6660602, 0.6623881, 0.65876, 0.6551801, 0.6516529, 0.6481826, 
+    0.6447735, 0.6414297, 0.6381554, 0.6349545, 0.6318309, 0.6287883, 
+    0.6258306, 0.6229613, 0.6201839, 0.6175018, 0.6149183, 0.6124365, 
+    0.6100594, 0.6077899, 0.6056309, 0.6035848, 0.6016543, 0.5998417, 
+    0.5981491, 0.5965787, 0.5951324, 0.5938118, 0.5926186, 0.5915544, 
+    0.5906203, 0.5898176, 0.5891472, 0.5886098, 0.5882062, 0.5879369, 
+    0.5878021, 0.5878021, 0.5879369, 0.5882062, 0.5886098, 0.5891472, 
+    0.5898176, 0.5906203, 0.5915544, 0.5926186, 0.5938118, 0.5951324, 
+    0.5965787, 0.5981491, 0.5998417, 0.6016543, 0.6035848, 0.6056309, 
+    0.6077899, 0.6100594, 0.6124365, 0.6149183, 0.6175018, 0.6201839, 
+    0.6229613, 0.6258306, 0.6287883, 0.6318308, 0.6349545, 0.6381554, 
+    0.6414298, 0.6447735, 0.6481826, 0.6516529, 0.65518, 0.65876, 0.6623881, 
+    0.6660602, 0.6697717, 0.6735179, 0.6772947, 0.681097, 0.6849205, 
+    0.6887603, 0.6926119, 0.6964706, 0.7003316, 0.7041904, 0.708042, 
+    0.7118819, 0.7157053, 0.7195076, 0.7232843, 0.7270306, 0.7307421, 
+    0.7344142, 0.7380423, 0.7416222, 0.7451494, 0.7486197, 0.7520288, 
+    0.7553726, 0.7586469, 0.7618478, 0.7649715, 0.768014, 0.7709717, 
+    0.773841, 0.7766184, 0.7793005, 0.781884, 0.7843658, 0.7867429, 
+    0.7890124, 0.7911714, 0.7932175,
+  0.7772061, 0.7786183, 0.7799369, 0.7811602, 0.7822871, 0.7833158, 
+    0.7842453, 0.7850744, 0.7858021, 0.7864274, 0.7869498, 0.7873684, 
+    0.7876828, 0.7878926, 0.7879976, 0.7879976, 0.7878926, 0.7876828, 
+    0.7873684, 0.7869498, 0.7864274, 0.7858021, 0.7850744, 0.7842453, 
+    0.7833158, 0.7822871, 0.7811602, 0.7799369, 0.7786183, 0.7772061, 
+    0.7757022, 0.7741082, 0.7724262, 0.7706583, 0.7688063, 0.7668729, 
+    0.7648603, 0.7627708, 0.7606071, 0.7583718, 0.7560676, 0.7536973, 
+    0.7512639, 0.7487702, 0.7462193, 0.7436144, 0.7409586, 0.7382551, 
+    0.7355072, 0.7327183, 0.7298918, 0.7270311, 0.7241398, 0.7212211, 
+    0.718279, 0.7153168, 0.7123381, 0.7093467, 0.7063462, 0.7033401, 
+    0.7003322, 0.6973261, 0.6943255, 0.6913341, 0.6883554, 0.6853932, 
+    0.682451, 0.6795325, 0.6766411, 0.6737804, 0.6709539, 0.668165, 
+    0.6654171, 0.6627136, 0.6600578, 0.6574529, 0.654902, 0.6524084, 
+    0.6499749, 0.6476046, 0.6453004, 0.6430652, 0.6409014, 0.638812, 
+    0.6367993, 0.6348659, 0.633014, 0.631246, 0.629564, 0.62797, 0.6264661, 
+    0.6250539, 0.6237354, 0.622512, 0.6213852, 0.6203564, 0.6194269, 
+    0.6185978, 0.6178702, 0.6172448, 0.6167225, 0.6163038, 0.6159894, 
+    0.6157796, 0.6156746, 0.6156746, 0.6157796, 0.6159894, 0.6163038, 
+    0.6167225, 0.6172448, 0.6178702, 0.6185978, 0.6194269, 0.6203564, 
+    0.6213852, 0.6225119, 0.6237354, 0.6250539, 0.6264661, 0.62797, 0.629564, 
+    0.631246, 0.633014, 0.6348659, 0.6367993, 0.6388119, 0.6409014, 
+    0.6430652, 0.6453005, 0.6476046, 0.6499749, 0.6524084, 0.654902, 
+    0.6574529, 0.6600578, 0.6627136, 0.6654171, 0.668165, 0.6709539, 
+    0.6737804, 0.6766411, 0.6795325, 0.682451, 0.6853932, 0.6883554, 
+    0.6913341, 0.6943255, 0.6973261, 0.7003322, 0.7033401, 0.7063462, 
+    0.7093467, 0.7123381, 0.7153168, 0.718279, 0.7212212, 0.7241398, 
+    0.7270311, 0.7298918, 0.7327183, 0.7355072, 0.7382551, 0.7409586, 
+    0.7436144, 0.7462193, 0.7487702, 0.7512639, 0.7536973, 0.7560676, 
+    0.7583718, 0.7606071, 0.7627708, 0.7648603, 0.7668729, 0.7688064, 
+    0.7706582, 0.7724262, 0.7741082, 0.7757022,
+  0.7583175, 0.7593274, 0.7602704, 0.7611454, 0.7619511, 0.7626869, 
+    0.7633516, 0.7639446, 0.764465, 0.7649122, 0.7652857, 0.7655851, 0.76581, 
+    0.76596, 0.7660351, 0.7660351, 0.76596, 0.76581, 0.7655851, 0.7652857, 
+    0.7649122, 0.764465, 0.7639446, 0.7633516, 0.7626869, 0.7619511, 
+    0.7611454, 0.7602704, 0.7593274, 0.7583175, 0.757242, 0.756102, 
+    0.7548991, 0.7536347, 0.7523103, 0.7509276, 0.7494882, 0.7479939, 
+    0.7464465, 0.744848, 0.7432001, 0.741505, 0.7397647, 0.7379813, 
+    0.7361571, 0.7342941, 0.7323948, 0.7304614, 0.7284962, 0.7265017, 
+    0.7244803, 0.7224345, 0.7203667, 0.7182794, 0.7161753, 0.7140568, 
+    0.7119266, 0.7097873, 0.7076414, 0.7054916, 0.7033405, 0.7011907, 
+    0.6990448, 0.6969054, 0.6947752, 0.6926568, 0.6905527, 0.6884654, 
+    0.6863976, 0.6843517, 0.6823304, 0.6803359, 0.6783707, 0.6764373, 
+    0.674538, 0.672675, 0.6708508, 0.6690674, 0.6673271, 0.665632, 0.6639841, 
+    0.6623855, 0.6608381, 0.6593438, 0.6579044, 0.6565217, 0.6551974, 
+    0.653933, 0.65273, 0.6515901, 0.6505146, 0.6495047, 0.6485617, 0.6476867, 
+    0.6468809, 0.6461452, 0.6454805, 0.6448875, 0.6443671, 0.6439199, 
+    0.6435463, 0.6432469, 0.6430221, 0.642872, 0.642797, 0.642797, 0.642872, 
+    0.6430221, 0.6432469, 0.6435463, 0.6439199, 0.6443671, 0.6448875, 
+    0.6454805, 0.6461452, 0.6468809, 0.6476867, 0.6485617, 0.6495047, 
+    0.6505145, 0.6515901, 0.65273, 0.653933, 0.6551974, 0.6565217, 0.6579044, 
+    0.6593438, 0.6608381, 0.6623855, 0.6639841, 0.665632, 0.6673271, 
+    0.6690674, 0.6708508, 0.672675, 0.674538, 0.6764373, 0.6783707, 
+    0.6803359, 0.6823304, 0.6843517, 0.6863976, 0.6884654, 0.6905527, 
+    0.6926568, 0.6947752, 0.6969054, 0.6990448, 0.7011907, 0.7033405, 
+    0.7054916, 0.7076414, 0.7097873, 0.7119266, 0.7140568, 0.7161753, 
+    0.7182794, 0.7203667, 0.7224345, 0.7244803, 0.7265017, 0.7284962, 
+    0.7304614, 0.7323948, 0.7342941, 0.7361571, 0.7379813, 0.7397646, 
+    0.741505, 0.7432001, 0.744848, 0.7464465, 0.7479939, 0.7494882, 
+    0.7509276, 0.7523103, 0.7536347, 0.7548991, 0.756102, 0.7572419,
+  0.7385048, 0.7391112, 0.7396775, 0.7402029, 0.7406868, 0.7411286, 
+    0.7415277, 0.7418838, 0.7421963, 0.7424648, 0.7426891, 0.7428689, 
+    0.743004, 0.7430941, 0.7431391, 0.7431391, 0.7430941, 0.743004, 
+    0.7428689, 0.7426891, 0.7424648, 0.7421963, 0.7418838, 0.7415277, 
+    0.7411286, 0.7406868, 0.7402029, 0.7396775, 0.7391112, 0.7385048, 
+    0.737859, 0.7371745, 0.7364521, 0.7356929, 0.7348976, 0.7340673, 
+    0.7332029, 0.7323056, 0.7313765, 0.7304165, 0.729427, 0.7284091, 
+    0.7273641, 0.7262932, 0.7251977, 0.7240791, 0.7229385, 0.7217776, 
+    0.7205975, 0.7193998, 0.718186, 0.7169575, 0.7157158, 0.7144625, 
+    0.713199, 0.7119268, 0.7106477, 0.709363, 0.7080745, 0.7067835, 
+    0.7054918, 0.7042009, 0.7029123, 0.7016276, 0.7003485, 0.6990764, 
+    0.6978129, 0.6965595, 0.6953178, 0.6940893, 0.6928755, 0.6916778, 
+    0.6904978, 0.6893368, 0.6881962, 0.6870776, 0.6859821, 0.6849113, 
+    0.6838662, 0.6828483, 0.6818588, 0.6808988, 0.6799697, 0.6790724, 
+    0.6782081, 0.6773777, 0.6765825, 0.6758232, 0.6751009, 0.6744164, 
+    0.6737705, 0.6731641, 0.6725978, 0.6720724, 0.6715885, 0.6711468, 
+    0.6707476, 0.6703915, 0.6700791, 0.6698105, 0.6695862, 0.6694064, 
+    0.6692713, 0.6691812, 0.6691362, 0.6691362, 0.6691812, 0.6692713, 
+    0.6694064, 0.6695862, 0.6698105, 0.6700791, 0.6703915, 0.6707476, 
+    0.6711468, 0.6715885, 0.6720724, 0.6725978, 0.6731641, 0.6737705, 
+    0.6744164, 0.6751009, 0.6758232, 0.6765825, 0.6773777, 0.6782081, 
+    0.6790724, 0.6799697, 0.6808988, 0.6818588, 0.6828483, 0.6838662, 
+    0.6849113, 0.6859821, 0.6870776, 0.6881962, 0.6893368, 0.6904978, 
+    0.6916778, 0.6928755, 0.6940893, 0.6953178, 0.6965595, 0.6978129, 
+    0.6990764, 0.7003484, 0.7016276, 0.7029123, 0.7042009, 0.7054918, 
+    0.7067835, 0.7080745, 0.709363, 0.7106477, 0.7119268, 0.713199, 
+    0.7144625, 0.7157158, 0.7169575, 0.718186, 0.7193998, 0.7205975, 
+    0.7217776, 0.7229385, 0.7240791, 0.7251977, 0.7262932, 0.7273641, 
+    0.7284091, 0.729427, 0.7304165, 0.7313765, 0.7323056, 0.7332029, 
+    0.7340673, 0.7348976, 0.7356929, 0.7364521, 0.7371745, 0.737859,
+  0.7177925, 0.7179947, 0.7181835, 0.7183588, 0.7185201, 0.7186674, 
+    0.7188005, 0.7189193, 0.7190235, 0.7191131, 0.7191879, 0.7192478, 
+    0.7192928, 0.7193229, 0.7193379, 0.7193379, 0.7193229, 0.7192928, 
+    0.7192478, 0.7191879, 0.7191131, 0.7190235, 0.7189193, 0.7188005, 
+    0.7186674, 0.7185201, 0.7183588, 0.7181835, 0.7179947, 0.7177925, 
+    0.7175771, 0.7173488, 0.717108, 0.7168548, 0.7165896, 0.7163127, 
+    0.7160245, 0.7157252, 0.7154154, 0.7150953, 0.7147653, 0.7144259, 
+    0.7140774, 0.7137203, 0.713355, 0.7129819, 0.7126016, 0.7122145, 
+    0.711821, 0.7114215, 0.7110168, 0.7106071, 0.7101931, 0.7097751, 
+    0.7093538, 0.7089296, 0.708503, 0.7080746, 0.7076449, 0.7072144, 
+    0.7067837, 0.7063532, 0.7059235, 0.7054951, 0.7050685, 0.7046443, 
+    0.704223, 0.703805, 0.703391, 0.7029814, 0.7025766, 0.7021772, 0.7017837, 
+    0.7013965, 0.7010162, 0.7006431, 0.7002779, 0.6999207, 0.6995723, 
+    0.6992328, 0.6989028, 0.6985827, 0.6982729, 0.6979737, 0.6976854, 
+    0.6974086, 0.6971433, 0.6968902, 0.6966493, 0.696421, 0.6962056, 
+    0.6960034, 0.6958146, 0.6956394, 0.695478, 0.6953307, 0.6951976, 
+    0.6950788, 0.6949747, 0.6948851, 0.6948103, 0.6947504, 0.6947053, 
+    0.6946753, 0.6946602, 0.6946602, 0.6946753, 0.6947053, 0.6947504, 
+    0.6948103, 0.6948851, 0.6949747, 0.6950788, 0.6951976, 0.6953307, 
+    0.695478, 0.6956394, 0.6958146, 0.6960034, 0.6962056, 0.696421, 
+    0.6966493, 0.6968902, 0.6971433, 0.6974086, 0.6976854, 0.6979737, 
+    0.6982729, 0.6985827, 0.6989028, 0.6992328, 0.6995723, 0.6999207, 
+    0.7002779, 0.7006431, 0.7010162, 0.7013965, 0.7017837, 0.7021772, 
+    0.7025766, 0.7029814, 0.703391, 0.703805, 0.704223, 0.7046443, 0.7050685, 
+    0.7054951, 0.7059235, 0.7063532, 0.7067837, 0.7072144, 0.7076449, 
+    0.7080746, 0.708503, 0.7089296, 0.7093538, 0.7097751, 0.7101931, 
+    0.7106071, 0.7110168, 0.7114215, 0.711821, 0.7122145, 0.7126016, 
+    0.7129819, 0.713355, 0.7137203, 0.7140774, 0.7144259, 0.7147653, 
+    0.7150953, 0.7154154, 0.7157252, 0.7160245, 0.7163127, 0.7165896, 
+    0.7168548, 0.717108, 0.7173488, 0.7175771 ;
+
+ HAS_NO_AXIS = _, _, _, _, _ ;
+
+ HAS_UNORDERED_AXIS = _, _, _, _, _ ;
+
+ HAS_GAPPY_AXIS = -127, -127, -127, -127, -127 ;
+
+ HAS_BACKWARDS_AXIS = 10, 20, 30, 40, 50 ;
+
+ USES_BIG_IRREG = -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 
+    -127, -127, -127, -127, -127, -127, -127, -127, -127, -127 ;
+}
diff --git a/bench/non_std_refmap.jnl b/bench/non_std_refmap.jnl
new file mode 100644
index 0000000..0678078
--- /dev/null
+++ b/bench/non_std_refmap.jnl
@@ -0,0 +1,216 @@
+
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0 
+! (zprofile), with a vertically oriented reference map, are optimized.
+
+! The symbol pt_orient is set in std_gif_t.jnl.
+
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+
+
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1 
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+
+! Description: draw a reference map with region indicated
+
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+
+! this script assumes that the viewport has already been set
+
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+DEFINE SYMBOL refmap_xcompress $7%0%
+DEFINE SYMBOL refmap_ycompress $8%0%
+
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+!  *jd* 2.3.97 define region/default/dx=-130:130/y=90s:90n band
+  define region/default/dx=`max(-($ref_dx),-60)`:`min(($ref_dx),60)`/dy=-30:30 band
+
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+  define region/default/dx=$6"`max(-($ref_dx),-40)`:`min(($ref_dx),40)`|1>`max(-($ref_dx),-60)`:`min(($ref_dx),60)`|2>`max(-($ref_dx),-40)`:`min(($ref_dx),40)`|*>`max(-($ref_dx),-30)`:`min(($ref_dx),30)`"/dy=$6"0:0|1>0:0|2>0:0|*>-20:20" band
+
+ELSE				 ! "point"
+! original statement: define region/dy=-45:45/dx=-60:60 band
+
+!  Addition for tseries and zprofile (only other case)
+   IF ($pt_orient"0|tseries>1|*>0") THEN    ! ELSE IF "tseries"
+      DEFINE SYMBOL yspan = 20	! plot 20 deg. above/below point
+
+      DEFINE SYMBOL xspan = `1.0 * (($PPL$XLEN)/($PPL$YLEN)) * ($yspan)`
+      define region/default/dy=-($yspan):($yspan)/dx=-($xspan):($xspan) band
+   ELSE		! if "zprofile"
+      DEFINE SYMBOL yspan = 60	! plot 60 deg. each side of point
+
+      DEFINE SYMBOL xspan = `2 * (($PPL$XLEN)/($PPL$YLEN)) * ($yspan)`
+      define region/default/dy=-($yspan):($yspan)/dx=-($xspan):($xspan) band
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+  ppl tics 0,0,0,0
+  ppl xlab; ppl ylab
+  ppl axlabp 0,0
+  ppl shade
+  ppl tics .125,.25,.125,.25
+  ppl axlabp -1,-1
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELSE ! "point"
+  ppl tics .4
+  ppl shade
+ENDIF
+
+! some clean up now to assist with repeated testing
+cancel region band
+
+set data coads_climatology
+set region/L=1
+
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xmin+(i-i),refmap_yrng
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xmax+(i-i),refmap_yrng
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng,refmap_ymin+(i-i)
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng,refmap_ymax+(i-i)
+
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+
+  IF ($refmap_ycompress) THEN
+    let refmap_scale_ratio = ((($PPL$YMAX))-(($PPL$YMIN)))/((($PPL$XMAX))-(($PPL$XMIN)))
+    let refmap_arrow_out  = ((($PPL$YMAX))-(($PPL$YMIN))) *.075
+    let refmap_arrow_up = refmap_arrow_out * refmap_scale_ratio * 0.125
+    let refmap_arrow_y = IF i EQ 1 THEN refmap_ymid-refmap_arrow_out ELSE refmap_ymid+refmap_arrow_out
+    let refmap_arrow_x1 = IF i EQ 1 THEN refmap_xmid-refmap_arrow_up ELSE refmap_xmid+refmap_arrow_up
+    let refmap_arrow_x2 = IF i EQ 1 THEN refmap_xmid+refmap_arrow_up ELSE refmap_xmid-refmap_arrow_up
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmid+(i-i),refmap_yrng
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x1,refmap_arrow_y
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x2,refmap_arrow_y
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x1,refmap_ymax+(i-i)
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x1,refmap_ymin+(i-i)
+  ENDIF
+
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+
+  IF ($refmap_xcompress) THEN
+    let refmap_scale_ratio = ((($PPL$YMAX))-(($PPL$YMIN)))/((($PPL$XMAX))-(($PPL$XMIN)))
+    let refmap_arrow_out  = ((($PPL$XMAX))-(($PPL$XMIN))) *.05
+    let refmap_arrow_up = refmap_arrow_out * refmap_scale_ratio * 0.25
+    let refmap_arrow_x = IF i EQ 1 THEN refmap_xmid-refmap_arrow_out ELSE refmap_xmid+refmap_arrow_out
+    let refmap_arrow_y1 = IF i EQ 1 THEN refmap_ymid-refmap_arrow_up ELSE refmap_ymid+refmap_arrow_up
+    let refmap_arrow_y2 = IF i EQ 1 THEN refmap_ymid+refmap_arrow_up ELSE refmap_ymid-refmap_arrow_up
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xrng,refmap_ymid+(i-i)
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x,refmap_arrow_y1
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x,refmap_arrow_y2
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmax+(i-i),refmap_arrow_y1
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmin+(i-i),refmap_arrow_y1
+  ENDIF
+
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xmid+(i-i),refmap_yrng
+
+ELSE				 ! "point"
+  IF `($refmap_xcompress) and ($refmap_ycompress)` THEN
+    let refmap_scale_ratio = ((($PPL$YMAX))-(($PPL$YMIN)))/((($PPL$XMAX))-(($PPL$XMIN)))
+    let refmap_arrow_out  = ((($PPL$XMAX))-(($PPL$XMIN))) *.025
+    let refmap_arrow_up = refmap_arrow_out * refmap_scale_ratio * 0.5
+    let refmap_arrow_x = IF i EQ 1 THEN refmap_xmid-refmap_arrow_out ELSE refmap_xmid+refmap_arrow_out
+    let refmap_arrow_y1 = IF i EQ 1 THEN refmap_ymid-refmap_arrow_up ELSE refmap_ymid+refmap_arrow_up
+    let refmap_arrow_y2 = IF i EQ 1 THEN refmap_ymid+refmap_arrow_up ELSE refmap_ymid-refmap_arrow_up
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xrng,refmap_ymid+(i-i)
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmax+(i-i),refmap_arrow_y1
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmin+(i-i),refmap_arrow_y1
+
+    let refmap_arrow_up = refmap_arrow_out * refmap_scale_ratio * 0.5
+    let refmap_arrow_y = IF i EQ 1 THEN refmap_ymid-refmap_arrow_out ELSE refmap_ymid+refmap_arrow_out
+    let refmap_arrow_x1 = IF i EQ 1 THEN refmap_xmid-refmap_arrow_up ELSE refmap_xmid+refmap_arrow_up
+    let refmap_arrow_x2 = IF i EQ 1 THEN refmap_xmid+refmap_arrow_up ELSE refmap_xmid-refmap_arrow_up
+    plot/over/vs/nolab/line=8/i=1:2 refmap_xmid+(i-i),refmap_yrng
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x1,refmap_ymax+(i-i)
+    plot/over/vs/nolab/line=8/i=1:2 refmap_arrow_x1,refmap_ymin+(i-i)
+  ENDIF
+
+  define axis/x=0:720:.01 x01
+  define axis/y=-90:90:.01 y01
+  define grid/x=x01/y=y01 g01
+  set grid g01
+  ppl markh 1,.2
+  plot/sym=2/line=8/over/vs/nolab refmap_xmid, refmap_ymid   ! lat and lon position marked
+  set grid abstract     ! needless cleanup
+
+ENDIF
+
+
+palette rainbow
diff --git a/bench/numstring.nc b/bench/numstring.nc
new file mode 100644
index 0000000..9ef7b15
Binary files /dev/null and b/bench/numstring.nc differ
diff --git a/bench/objective.jnl b/bench/objective.jnl
new file mode 100644
index 0000000..e0acf0c
--- /dev/null
+++ b/bench/objective.jnl
@@ -0,0 +1,51 @@
+\cancel mode verify
+! objective.jnl  11/93 *sh*
+! Description: 2D objective analysis of scattered data
+! usage:
+!  GO objective xpts ypts zpts "xlo:xhi:xdel" "ylo:yhi:ydel" [cay] [nrng]
+!							[filename] [append]
+! where
+!1-3	xpts ypts zpts 	- 3 arrays representing (X,Y,value) triples
+!4	xlo:xhi:xdel 	- output axis specification for first coordinate
+!5	ylo:yhi:ydel 	- output axis specification for second coordinate
+!6 optional	cay	- interpolation scheme (see PLOT+ CONSET command)
+! 			  0.0->Laplacian; large cay->Spline [default=5.0]
+!7 optional	nrng	- include points within nrng output grid cells in the
+!			  interpolation (see PLOT+ CONSET command) [dflt=5]
+!8 optional	filename- file name to receive output [dflt=fer_objective.unf]
+!9 optional	append	- "append" to old or create "new" file [default="new"]
+
+! example: Put scattered (long, lat, sst) triples (in variables lons,lats,ssts)
+!	   onto a grid that is 1x1 degree on 160E:160W and 20S:20N with
+!	   interpolations based on points within 8 grid points (degrees) and
+!	   output into file sst_grid.unf
+!
+!   yes? GO objective lons lats ssts "160:200:1" "-20:20:1" " " 8 sst_grid.unf
+ 
+! check that 5 mandatory arguments are provided and that arg 9 is valid
+query/ignore $5%<Use: GO objective xp yp zp "xlo:hi:dx" "ylo:hi:dy" [cay] [nrng] [ofile] ["append"]%
+query/ignore $9%new|new|append|delete|<specify "new" or "append" for argument 9%
+
+! remove (spawn rm) old file unless "append" is specified
+$9"sp rm -f|new>sp rm -f|append>sp touch|delete>sp rm -f" $8"fer_objective.unf"
+
+! if this output file is already in use via SET DATA then cancel it
+CANCEL DATA/NOERROR $8"fer_objective.unf"
+
+! define a grid as per the desired output
+define axis/x=$4 obj_xax
+define axis/y=$5 obj_yax
+define grid/x=obj_xax/y=obj_yax obj_grid
+
+! a message to the user ...
+say Your result will be variable "gridded" in data set $8"fer_objective.unf".
+
+! perform the objective alanysis
+USER/COMMAND=OBJECTIVE/opt1=$4,$5,$6"5.0",$7"5"/file=$8"fer_objective.unf" $1,$2,$3
+
+! prepare to use the new variable "gridded"
+file/grid=obj_grid/format=unf/variable=gridded $8"fer_objective.unf"
+set variable/bad=1E35 gridded
+say "gridded" is ready to use - set your region and issue >>SHADE gridded<<
+
+set mode/last verify
diff --git a/bench/ocean_atlas_temp.cdf b/bench/ocean_atlas_temp.cdf
new file mode 100644
index 0000000..41c30e3
Binary files /dev/null and b/bench/ocean_atlas_temp.cdf differ
diff --git a/bench/outside_the_lines.jnl b/bench/outside_the_lines.jnl
new file mode 100644
index 0000000..df69623
--- /dev/null
+++ b/bench/outside_the_lines.jnl
@@ -0,0 +1,10 @@
+ ! NOAA/PMEL TMAP
+ ! FERRET v6.08  
+ ! Linux(g77) 2.4.21-32 - 11/26/07
+ ! 26-Nov-07 13:08     
+
+go fland 20 gray basemap " " x=148.687:262.053 y=-29.833:45.347
+go land
+use geo_borders
+plot/vs/nolab/line/i=11595:11597/overlay/color=red CONTINENT_LON, CONTINENT_LAT
+q
diff --git a/bench/proleptic_gregorian.nc b/bench/proleptic_gregorian.nc
new file mode 100644
index 0000000..83b4a11
Binary files /dev/null and b/bench/proleptic_gregorian.nc differ
diff --git a/bench/repeat_t_coord.nc b/bench/repeat_t_coord.nc
new file mode 100644
index 0000000..3afbd19
Binary files /dev/null and b/bench/repeat_t_coord.nc differ
diff --git a/bench/reverse_axes.cdf b/bench/reverse_axes.cdf
new file mode 100644
index 0000000..8136aa2
Binary files /dev/null and b/bench/reverse_axes.cdf differ
diff --git a/bench/reverse_z_bnds.nc b/bench/reverse_z_bnds.nc
new file mode 100644
index 0000000..f2b5610
Binary files /dev/null and b/bench/reverse_z_bnds.nc differ
diff --git a/bench/run_all b/bench/run_all
new file mode 100755
index 0000000..e110de5
--- /dev/null
+++ b/bench/run_all
@@ -0,0 +1,350 @@
+#! /bin/csh -f
+# run the full benchmark suite
+# *sh* 1/93 - writes errors to separate file
+# *sh* 10/93 - added alpha support
+# *sh* 9/94 - eliminated "-n" from echo lines
+# *sh* 1/95 - version bn320
+# *sh* 3/95 - version bn400
+# *sh* 6/95 - version bn401 - with symbols
+# *sh* 9/95 - version bn420 - with LET/D
+# *sh* 1/96 - 		    - and bn420_stream
+# *sh* 5/96 - version bn430 - added bn430_IF
+# *kob* 8/96- hp uses ftn41 instead of fort.41, so added a check for that
+# *kob* 11/96 - add check for batch functionality.  After original ferret
+#		exits, unset DISPLAY env variable and run ferret with simple,
+#		non-graphical commands. 
+# this procedure will destroy all temporary files (cdf, ez, and metafiles)
+# produced by the previous runs.  It will not destroy the log file, however.
+# *sh* 1/97 - write benchmark version into output log
+# *sh* 7/97 - query and write user comment into log
+# *sh* 1/98 - run bn490_all by default
+# *kob* 2/98 - run bn491_all by default
+# *kob* 4/98 - add status check after running bnxxx_all to prevent continuation
+#              of bench run
+# *sh* 2/99 - run bn500_all by default
+# *sh* request the EF directory. Benchmark versions no longer exist -- use CVS
+# *sh* log the header information to a single benchmark history file
+# acm   4/05 added more .plt files for metafile checking, but fewer bnplot.plt files 
+#            (bn_curv now saves only one).
+# acm   9/06 Change so that all ncdump output is directed to a file all_ncdump.out. 
+#            append this to the log file 
+# acm*  1/14 Change the order of the questions asked: test efs? If so what directory are they in?
+#            Also list the contents of the external fucntions directory
+#
+# usage % run_all
+
+# unable to redirect input on Solaris
+# to run benchmark on solaris:
+# 1	cd into bench directory
+# 2	umask 002
+# 3	rm snoopy.dat test.dat test.gt test.unf WV.J34K56L7 F*.cdf test*.cdf newjournal.jnl fort.41 ppllist.out newjournal.jnl bench.mgm
+# 4	(/home/corona/tmap/ferret_link/fer/ferretxgks >all_29jan91att1204.xsol_log) >& all_29jan91att1204.xsol_err
+# V420: ln -s $machine_stream stream_data_link.unf
+# 5	GO bn301_all
+# 6	when done sed 's/@ASFERRET .*Ver.*$/@ASFERRET ... whatever version number .../' <fort.41 >all_29jan91att1204.sol_plt
+# NOTE!!!: The netCDF benchmark will fail if run over an nfs mounted disk.
+#	(incompatibility between OSF and Solaris)
+# node corona has been set up to run the NetCDF benchmark in ~/local_bench
+# as follows:
+#	rm *.cdf
+#	( ../ferret_link/fer/ferretxgks > bn230_cdf_29jul94.log ) > & bn230_cdf_29jul94.err
+#	GO bn230_cdf; quit
+# compare with bn230_cdf_ALPHA_reference.*
+#
+# for now you must also manually check the benchmark bn311_ez_order
+
+
+umask 002     #  make all files group deletable  3/16
+
+set rhlev = "0"
+
+# Solaris may have HOSTTYPE=sun, or HOSTTYPE=solaris
+if ( $HOSTTYPE =~ *sun* ) then
+   if ( `uname -r` =~ *5*  ) then
+      set machine = "sol"
+   else
+      set machine = "sun"
+   endif
+else if ( $HOSTTYPE =~ *solaris* ) then
+   set machine = "sol" 
+else if ( $HOSTTYPE =~ *alpha* ) then
+   set machine = "alp" 
+else if ( $HOSTTYPE =~ *aix* ) then
+   set machine = "aix" 
+else if ( $HOSTTYPE =~ *iris* ) then
+   set machine = "sgi"
+else if ( $HOSTTYPE =~ *hp* ) then
+   set machine = "hp"
+else if ( $HOSTTYPE =~ *ia64*) then
+    set machine = "ia64-linux"
+else if ( $HOSTTYPE =~ *x86_64-linux*) then
+    set machine = "x86_64-linux"
+    if ( `uname -r` =~ *el6* ) then
+       set rhlev = "six"
+    endif
+else if ( $HOSTTYPE =~ *linux*) then
+    set machine = "linux"
+else
+   set machine = "unknown_host"
+endif
+
+if ($rhlev == six) then 
+  echo six
+endif
+
+echo "Enter the path (including filename) to the FERRET version of choice"
+set fver = $<
+
+# XGKS version ?  (use "xg" as the indicator)
+echo $fver | grep -s "xg"
+if ( $status == 0 ) then
+	set machine = "x$machine"
+endif
+
+# *acm* 4/5/05 optionally do externally-linked external function tests 
+# 
+echo "Run tests of externally-linked external functions? Enter y or n"
+set do_shared_obj = $<
+
+
+# which external function libraries to use
+set efdir = n
+if ( $do_shared_obj == "y" ) then
+  echo "Enter the directory containing the external function libraries"
+  set efdir = $<
+  echo "Contents of "$efdir" :"
+  echo " "
+  ls -1 $efdir
+  echo " "
+endif
+
+
+# background info to go in the benchmark file
+echo "Enter your name"
+set bmarker = $<
+echo "Enter comment about this benchmark or this version of Ferret"
+# *kob* 4.01 linux needs quotes around the input or spaces throw it off
+set bcomment = "$<"
+
+
+set date_stamp = `date +'%d%h%yAT%H%M'|tr '[A-Z]' '[a-z]'`
+set log_file = "all_${date_stamp}.${machine}_log"
+set err_file = "all_${date_stamp}.${machine}_err"
+set plt_file = "all_${date_stamp}.${machine}_plt"
+set ncdump_log = "all_${date_stamp}.${machine}_ncdump"
+set ncdump_file = "all_ncdump.out"
+rm -f ncdump_file $ncdump_file
+echo " " > $ncdump_file
+
+#set up external functions search path
+setenv FER_EXTERNAL_FUNCTIONS $efdir
+
+# set up the binary unformatted stream test file as a machine-specific link
+set machine_stream = "stream10by5_{$machine}.unf"
+if ( ! -e  $machine_stream ) then
+   echo File $machine_stream does not exist.
+   echo Benchmark bn420_stream will fail.
+   echo To create $machine_stream compile and run make_stream_file.F
+   echo Then rename stream10by5.unf to $machine_stream
+   echo -n 'Continue anyway? (answer "y" for yes)'
+   set answer = $<
+   if ($answer != "y") exit 0
+endif
+rm -f stream_data_link.unf
+ln -s $machine_stream stream_data_link.unf
+
+# set up descriptors for mc data files.  this necessary because linux/F90 
+# requires a different format of input for the namelist reads.  *kob* 4/99
+# if ($machine == "linux") then
+#     foreach file (coads*.des_template)
+#	./linuxize_descriptors $file >! $file:r.des
+#    end
+# else
+#    foreach file (coads*.des_template)
+#	cp -f $file $file:r.des
+#    end
+# endif
+
+#set up proper stream testing jnl file - depends on endianness
+rm -f bn_test_stream.jnl
+if ($machine == "linux" || $machine == "alp" || $machine == "x86_64-linux" || $machine == "ia64-linux") then
+    ln -s bn_test_stream_little.jnl bn_test_stream.jnl
+else
+    ln -s bn_test_stream_big.jnl bn_test_stream.jnl
+endif
+
+#Set up for metafile/gif testing
+set check_met = check_metafiles
+
+if ($machine == "linux" || $machine == "ia64-linux") then
+   set check_met = check_metafiles_linux
+endif
+
+if ($rhlev == "six") then
+   set check_met = check_metafiles_rh6
+endif
+
+echo "Log output in $log_file  Errors in $err_file" 
+echo "Procedure run_all to run all FERRET benchmarks" >&$log_file
+
+echo "Running FERRET version $fver" >>&$log_file
+ls -l $fver >>&$log_file
+echo "Using external functions from $efdir" >>&$log_file
+echo "Running the tests of external functions $do_shared_obj" >>&$log_file
+echo "Benchmark run by $bmarker" >>&$log_file
+echo "Note: $bcomment" >>&$log_file
+echo "ncdump output will be in $ncdump_file, and appended to this log file " >>&$log_file
+
+#set up a generic data environment
+echo "***** Restricting Ferret paths to bench directory *****" >>&$log_file
+source bench_environment >>&$log_file
+Fenv >>&$log_file
+
+# put a record of this benchmark run into the benchmark log file
+set bench_hist = "benchmark_history.log"
+echo " " >>& $bench_hist
+echo " " >>& $bench_hist
+echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " >>& $bench_hist
+echo "Log output in $log_file  Errors in $err_file" >>& $bench_hist
+ls -l $fver >>&$bench_hist
+echo "Using external functions from $efdir" >>&$bench_hist
+echo "Benchmark run by $bmarker" >>&$bench_hist
+echo "Note: $bcomment" >>&$bench_hist
+
+touch F.cdf snoopy.dat
+set temp_files = "test.dat test.gt test.unf WV.J34K56L7 F*.cdf test*.cdf newjournal.jnl fort.41 bench.mgm"
+foreach file ($temp_files)
+      /bin/rm -f $file
+end
+
+# 10/97 *kob* mv last created bnplot files to the last_plot directory
+#  4/11 *acm* mv last created bat.plt* files to the last_plot directory
+mv bn*.plt* last_plot
+mv bat*.plt* last_plot
+mv p*.plt* last_plot
+mv bn*.gif* last_plot
+mv bn*.ps* last_plot
+
+set now = `date`
+echo "Beginning at $now" >>&$log_file
+cp $log_file $err_file
+echo "Beginning at $now"
+
+# $fver <bn230_all.jnl >>&$log_file        ! problem with missing lines in log
+# $fver <bn230_all_shell.jnl >>&$log_file  ! mixes error lines erratically
+#($fver <bn230_all_shell.jnl >>$log_file) >>&$err_file
+#($fver <bn300_all_shell.jnl >>$log_file) >>&$err_file
+#($fver <bn301_all_shell.jnl >>$log_file) >>&$err_file
+#($fver <bn311_all_shell.jnl >>$log_file) >>&$err_file
+#($fver <{$bver}_all_shell.jnl >>$log_file) >>&$err_file
+(($fver -script bn_all_shell.jnl) >>$log_file) >>&$err_file
+
+# check status before continuing *kob* 4/98
+if ($status) then
+    echo "FERRET ERRROR*********************************" >>$log_file
+    exit 1
+endif
+
+# 5/05 *acm* run tests of externally-linked external functions
+if ( $do_shared_obj == "y" ) then
+  ($fver <bn_all_ef_shell.jnl >>$log_file) >>&$err_file
+endif
+
+# Append the ncdump output file to the log file
+echo  " " >>&$log_file
+echo  "-----" >>&$log_file
+echo  "Appending ncdump output" >>&$log_file
+cat  $ncdump_file >>& $log_file
+echo  "-----" >>&$log_file
+echo  "end of ncdump output" >>&$log_file
+echo  " " >>&$log_file
+mv $ncdump_file $ncdump_log
+
+# Now, lets restart ferret and run the bug fix journal file
+# 3.4.98 - moved this to bn491_all *kob*
+#($fver <{$bver}_bug_fixes.jnl >>$log_file) >>&$err_file
+
+# *kob* 11/96 - test out batch ability of ferret
+#set hold_display = $DISPLAY
+#setenv DISPLAY ralf
+#echo "Display now set to "$DISPLAY >>&$log_file
+#($fver < bn430_batch.jnl >> $log_file) >>&$err_file
+#setenv DISPLAY $hold_display
+#echo "Display now set to "$DISPLAY >>&$log_file
+
+echo "about to run test of .ferret script"
+if (-e $HOME/.ferret) then 
+  rm -f ./keep.ferret
+  cp $HOME/.ferret ./keep.ferret
+  rm -f $HOME/.ferret
+endif
+
+cp -f ferret_startup $HOME/.ferret
+($fver  <bn_startupfile_shell.jnl >> $log_file) >>& $err_file
+rm -f $HOME/.ferret
+
+if (-e keep.ferret) then 
+  mv keep.ferret $HOME/.ferret
+endif
+
+set hold_display = $DISPLAY
+unsetenv DISPLAY
+echo "Display no longer set, about to run batch gif test"
+($fver -gif <bn_gif_shell.jnl >> $log_file) >>& $err_file
+echo "Display still not set, about to run batch ps test"
+($fver -batch bnplot.ps <bn_ps_shell.jnl >> $log_file) >>& $err_file
+echo "Display still not set, about to run batch metafile test"
+($fver -batch bat.plt <bn_batch_metafile_shell.jnl >> $log_file) >>& $err_file
+setenv DISPLAY $hold_display
+#echo "Display now set to "$DISPLAY >>&$log_file
+
+set now = `date`
+echo  "Ended at $now" >>&$err_file
+echo  "Ended at $now" >>&$log_file
+echo  "Ended at $now"
+
+# *kob* 8/96
+if ( $HOSTTYPE =~ *hp* ) then
+  sed 's/@ASFERRET .*Ver.*$/@ASFERRET ... whatever version number .../' <ftn41 >$plt_file
+else
+  sed 's/@ASFERRET .*Ver.*$/@ASFERRET ... whatever version number .../' <fort.41 >$plt_file
+endif
+
+#clean_bench_log $log_file
+#echo "Remember to remove metafiles, if any"
+
+#rename plt and gif files - necessary for saving them under cvs
+set count = 1
+while ($count < 5)
+    mv bnplot.plt.~$count~ bnplot-$count.plt
+    @ count++
+end
+
+mv bnplot.gif.~1~ bnplot-1.gif
+mv bnplot.gif.~2~ bnplot-2.gif
+
+mv new.plt bat.plt_9
+mv bat.plt bat.plt_8
+set count = 1
+while ($count < 8)
+    mv bat.plt.~$count~ bat.plt_$count
+    @ count++
+end
+
+# AIX systems don't put leading zeros on numbers like 0.5
+if ( $HOSTTYPE =~ *aix* ) then
+  mv $plt_file temp.tmp
+  sed -e 's/ \.\([0-9]\)/0.\1/g' -e 's/ -\.\([0-9]\)/-0.\1/g' temp.tmp > $plt_file
+  rm temp.tmp
+  mv $log_file temp.tmp
+  sed -e 's/ \.\([0-9]\)/0.\1/g' -e 's/ -\.\([0-9]\)/-0.\1/g' temp.tmp > $log_file
+endif
+
+#let's check the plt and gif and ps files to make sure they look okay
+echo "Checking PLT, GIF and PS files......."
+./$check_met
+
+#Note about checking transparency
+echo "open test_trans.html in a browser to test transparency option in gif mode. The continents should be gray"
+# save size of log file as part of the history record
+ls -l $log_file >>&  $bench_hist
diff --git a/bench/scat2grid.nc b/bench/scat2grid.nc
new file mode 100644
index 0000000..1bcffae
Binary files /dev/null and b/bench/scat2grid.nc differ
diff --git a/bench/short.dat b/bench/short.dat
new file mode 100644
index 0000000..0b8c373
Binary files /dev/null and b/bench/short.dat differ
diff --git a/bench/shortSwapped.dat b/bench/shortSwapped.dat
new file mode 100644
index 0000000..4c5d3e8
Binary files /dev/null and b/bench/shortSwapped.dat differ
diff --git a/bench/skip.dat b/bench/skip.dat
new file mode 100644
index 0000000..08c81ba
Binary files /dev/null and b/bench/skip.dat differ
diff --git a/bench/ss_small.nc b/bench/ss_small.nc
new file mode 100644
index 0000000..58ec94a
Binary files /dev/null and b/bench/ss_small.nc differ
diff --git a/bench/sstnok_short.nc b/bench/sstnok_short.nc
new file mode 100644
index 0000000..677407a
Binary files /dev/null and b/bench/sstnok_short.nc differ
diff --git a/bench/sstok_short.nc b/bench/sstok_short.nc
new file mode 100644
index 0000000..45c736d
Binary files /dev/null and b/bench/sstok_short.nc differ
diff --git a/bench/strdimfile.nc b/bench/strdimfile.nc
new file mode 100644
index 0000000..54ed82f
Binary files /dev/null and b/bench/strdimfile.nc differ
diff --git a/bench/stream10by5.unf b/bench/stream10by5.unf
new file mode 100644
index 0000000..37de5b8
Binary files /dev/null and b/bench/stream10by5.unf differ
diff --git a/bench/stream10by5_aix.unf b/bench/stream10by5_aix.unf
new file mode 100644
index 0000000..35de337
Binary files /dev/null and b/bench/stream10by5_aix.unf differ
diff --git a/bench/stream10by5_alp.unf b/bench/stream10by5_alp.unf
new file mode 100644
index 0000000..0629c37
Binary files /dev/null and b/bench/stream10by5_alp.unf differ
diff --git a/bench/stream10by5_dec.unf b/bench/stream10by5_dec.unf
new file mode 100644
index 0000000..0629c37
Binary files /dev/null and b/bench/stream10by5_dec.unf differ
diff --git a/bench/stream10by5_i386-apple-darwin.unf b/bench/stream10by5_i386-apple-darwin.unf
new file mode 100644
index 0000000..37de5b8
Binary files /dev/null and b/bench/stream10by5_i386-apple-darwin.unf differ
diff --git a/bench/stream10by5_ia64-linux.unf b/bench/stream10by5_ia64-linux.unf
new file mode 100644
index 0000000..0629c37
Binary files /dev/null and b/bench/stream10by5_ia64-linux.unf differ
diff --git a/bench/stream10by5_ia64-sles9.unf b/bench/stream10by5_ia64-sles9.unf
new file mode 100644
index 0000000..0629c37
Binary files /dev/null and b/bench/stream10by5_ia64-sles9.unf differ
diff --git a/bench/stream10by5_linux.unf b/bench/stream10by5_linux.unf
new file mode 100644
index 0000000..5a7e208
Binary files /dev/null and b/bench/stream10by5_linux.unf differ
diff --git a/bench/stream10by5_sgi.unf b/bench/stream10by5_sgi.unf
new file mode 100644
index 0000000..35de337
Binary files /dev/null and b/bench/stream10by5_sgi.unf differ
diff --git a/bench/stream10by5_sol.unf b/bench/stream10by5_sol.unf
new file mode 100644
index 0000000..35de337
Binary files /dev/null and b/bench/stream10by5_sol.unf differ
diff --git a/bench/stream10by5_sun.unf b/bench/stream10by5_sun.unf
new file mode 100644
index 0000000..35de337
Binary files /dev/null and b/bench/stream10by5_sun.unf differ
diff --git a/bench/stream10by5_x86_64-linux.unf b/bench/stream10by5_x86_64-linux.unf
new file mode 100644
index 0000000..5a7e208
Binary files /dev/null and b/bench/stream10by5_x86_64-linux.unf differ
diff --git a/bench/string5d.nc b/bench/string5d.nc
new file mode 100644
index 0000000..0a6ae98
Binary files /dev/null and b/bench/string5d.nc differ
diff --git a/bench/test b/bench/test
new file mode 100644
index 0000000..f8893fc
--- /dev/null
+++ b/bench/test
@@ -0,0 +1,73 @@
+! bn200_budgets
+! benchmark to compute balance errors in heat and momentum equations
+! 3/12/90
+SET DATA clim_airt_lev
+USE gt160w001    
+
+set reg/l=2/i=71/k=1:27
+
+! HEAT BUDGET
+! this budget includes Newtonian Damping errors (not computed) and convective adjustment errors
+list/j=1:100 qad+qdf-dtdt
+stat/j=1:100 qad+qdf-dtdt
+
+! now knock out the Newtonian damping region
+list/j=10:90 qad+qdf-dtdt
+stat/j=10:90 qad+qdf-dtdt
+
+! now knock out the obvious convective adjustment
+list/j=10:90 (qad+qdf-dtdt) * cmsk[l=@sbx]
+stat/j=10:90 (qad+qdf-dtdt) * cmsk[l=@sbx]
+
+! convective adjustment has to consider a level above and a level below because it propagates through derivatives ???
+list/j=10:90 (qad+qdf-dtdt) * cmsk[l=@sbx]*cmsk[l=1,k=@sbx]
+stat/j=10:90 (qad+qdf-dtdt) * cmsk[l=@sbx]*cmsk[l=1,k=@sbx]
+
+! percentage errors (increase with depth is because qmax gets smaller)
+let qmax = MAX( MAX(ABS(qad),ABS(qdf)), ABS(dtdt) )
+list/j=10:90 ((qad+qdf-dtdt) * cmsk[l=@sbx]*cmsk[l=1,k=@sbx])/qmax
+stat/j=10:90 ((qad+qdf-dtdt) * cmsk[l=@sbx]*cmsk[l=1,k=@sbx])/qmax
+
+
+! MOMENTUM BUDGET
+! note: as of 3/90 errors still remain in the momentum balance near the
+! surface.  The steps below are an INCOMPLETE attempt to explain the errors
+! The role of convective adjustment must be examined further: how do convective
+! adjustment errors propagate to surrounding grid points in space and time
+
+set reg/l=2/X=160W/j=1:100/k=1:27
+LET A = UDF + UAD + UCOE + UBPI - DUDT
+list/j=1:100 a
+list/j=61:65 a
+
+! now the error terms, only - using K=25 as the reference level
+list/j=10:90 a-a[k=25]
+list/j=61:65 a-a[k=25]
+stat/j=10:90 a-a[k=25]
+
+! errors normalized by the magnitutes of the component terms
+let b1 = max( abs(udf),abs(uad))
+let b2 = max( b1, abs(ucoe))
+let b3 = max (b2,abs(ubpi))
+let b4 = max( b3,abs(dudt))
+let knorm = b4 / b4[k=25]
+!let scale = b4[j=@ave]
+list/j=10:90 (a-a[k=25]) / knorm
+list/j=61:65 (a-a[k=25]) / knorm
+stat/j=10:90 (a-a[k=25]) / knorm
+!plot/j=10:90 (a-a[k=25]) / knorm
+
+! convective adjustment (temp and salt, only) can effect momentum balance:
+! 1) UBPI: wrong densities (small errors since total mass is conserved)
+! 2) UDFZ: Richardson number-dependent mixing coefficient depends on vertical
+! 	density gradient.  Conv. adj. distorts this (often to zero) !!
+! ... further: since the convective adjustment errors are on the TEMP grid
+! they are spread over a region of 3 points in I in J and and in K by
+! conversion to the PCDZ grid.  Diffusion is based on the state at
+! L-1 and pressure adjustments are at L.
+let cmsk_pcd   = cmsk[g=pcdz]
+let cmsk_df   = cmsk_pcd[g=u,l=1]
+let cmsk_bp  = cmsk[g=u,l=2]
+list/j=10:90 ( (a-a[k=25]) / knorm ) * cmsk_df * cmsk_bp
+list/j=61:65 ( (a-a[k=25]) / knorm ) * cmsk_df * cmsk_bp
+stat/j=10:90 ( (a-a[k=25]) / knorm ) * cmsk_df * cmsk_bp
diff --git a/bench/test0.nc b/bench/test0.nc
new file mode 100644
index 0000000..013cd05
Binary files /dev/null and b/bench/test0.nc differ
diff --git a/bench/test_axes.nc b/bench/test_axes.nc
new file mode 100644
index 0000000..79e8313
Binary files /dev/null and b/bench/test_axes.nc differ
diff --git a/bench/test_nan.nc b/bench/test_nan.nc
new file mode 100644
index 0000000..1a5d8fb
Binary files /dev/null and b/bench/test_nan.nc differ
diff --git a/bench/test_results/axticlabel.pdf b/bench/test_results/axticlabel.pdf
new file mode 100644
index 0000000..c8fa9d8
Binary files /dev/null and b/bench/test_results/axticlabel.pdf differ
diff --git a/bench/test_results/bnplot.pdf b/bench/test_results/bnplot.pdf
new file mode 100644
index 0000000..fe421b4
Binary files /dev/null and b/bench/test_results/bnplot.pdf differ
diff --git a/bench/test_results/closed_lev.pdf b/bench/test_results/closed_lev.pdf
new file mode 100644
index 0000000..b4db592
Binary files /dev/null and b/bench/test_results/closed_lev.pdf differ
diff --git a/bench/test_results/dashbug.pdf b/bench/test_results/dashbug.pdf
new file mode 100644
index 0000000..39964d8
Binary files /dev/null and b/bench/test_results/dashbug.pdf differ
diff --git a/bench/test_results/degC_axlab.pdf b/bench/test_results/degC_axlab.pdf
new file mode 100644
index 0000000..876fbae
Binary files /dev/null and b/bench/test_results/degC_axlab.pdf differ
diff --git a/bench/test_results/dots.pdf b/bench/test_results/dots.pdf
new file mode 100644
index 0000000..5c49080
Binary files /dev/null and b/bench/test_results/dots.pdf differ
diff --git a/bench/test_results/ferret_run_tests_err b/bench/test_results/ferret_run_tests_err
new file mode 100644
index 0000000..af78c6a
--- /dev/null
+++ b/bench/test_results/ferret_run_tests_err
@@ -0,0 +1,3474 @@
+Using FERRET /home/users/ksmith/Ferret/bin/ferret
+lrwxrwxrwx 1 ksmith tmap 11 Mar 31 15:35 /home/users/ksmith/Ferret/bin/ferret -> ferret_v6.9
+Using external functions from /home/users/ksmith/Ferret/ext_func/libs
+Benchmark run by ksmith
+Note: RUN_TESTS.sh test results for debug build of Ferret on RHEL5-64
+Benchmark scripts that will be run:
+   bn_syntax.jnl
+   bn_dollar.jnl
+   bn_grave.jnl
+   bn_letd.jnl
+   bn_if.jnl
+   bn_expressions.jnl
+   bn_geometry.jnl
+   bn_output.jnl
+   bn_in_plane.jnl
+   bn_compress.jnl
+   bn_interpolate.jnl
+   bn_regrid.jnl
+   bn_ez.jnl
+   bn_plot.jnl
+   bn_curv.jnl
+   bn_symbols.jnl
+   bn_comma_delimited.jnl
+   bn_dynamic_grids.jnl
+   bn_cdf.jnl
+   bn_regrid_transforms.jnl
+   bn_axis_limits.jnl
+   bn_movie.jnl
+   bn_ez_order.jnl
+   bn_user.jnl
+   bn_stream.jnl
+   bn_mc.jnl
+   bn_negative_t.jnl
+   bn_xact_regrid.jnl
+   bn_gc_functions.jnl
+   bn491_bug_fixes.jnl
+   bn_odd_variable_name.jnl
+   bn_test_stream.jnl
+   bn_define_axes.jnl
+   bn_polygon.jnl
+   bn500_bug_fixes.jnl
+   bn_sample.jnl
+   bn_strides_revs_perms.jnl
+   bn_non_COARDS_netCDF.jnl
+   bn_cache_hits.jnl
+   bn_regrid_to_user.jnl
+   bn_calendar.jnl
+   bn_dash_dot.jnl
+   bn_flowlines.jnl
+   bn_logaxes.jnl
+   bn_internal_external_functions.jnl
+   bn_modulo_strides.jnl
+   bn_axis_viewports.jnl
+   bn_strings.jnl
+   bn_axcontrol.jnl
+   bn_vec_curv.jnl
+   bn_delimited_read.jnl
+   bn541_bug_fixes.jnl
+   bn_cancel_axes.jnl
+   bn542_bug_fixes.jnl
+   bn_subspan_modulo.jnl
+   bn_dots.jnl
+   bn_lev_symbols.jnl
+   bn_mode_logo_lab.jnl
+   bn_modulo_attribute.jnl
+   bn550_bug_fixes.jnl
+   bn551_bug_fixes.jnl
+   bn_multi_line_labels.jnl
+   bn552_bug_fixes.jnl
+   bn_set_var_scale_off.jnl
+   bn_longvarnames.jnl
+   bn_shakey.jnl
+   bn_eof_4d.jnl
+   bn_abstract_axis_names.jnl
+   bn_many_polygons.jnl
+   bn_fill_irregular.jnl
+   bn_xml_output.jnl
+   bn_test_nan.jnl
+   bn553_bug_fixes.jnl
+   bn_graticules.jnl
+   bn_repeat_range.jnl
+   bn554_bug_fixes.jnl
+   bn_bounds.jnl
+   bn_all_leap.jnl
+   bn570_bug_fixes.jnl
+   bn_modstats.jnl
+   bn_mc_vary_scale.jnl
+   bn_plot_nokey.jnl
+   bn580_bug_fixes.jnl
+   bn_inf_levels.jnl
+   bn_regulart.jnl
+   bn_labwid.jnl
+   bn_redefine_taxis_mc.jnl
+   bn_illegal_axisname.jnl
+   bn_exit_script.jnl
+   bn_exit_cycle.jnl
+   bn_curv_mod.jnl
+   bn_shade_keycont.jnl
+   bn581_bug_fixes.jnl
+   bn_tab_comma_multivar.jnl
+   bn_element_functions.jnl
+   bn_long_revision_num.jnl
+   bn_window_title.jnl
+   bn_last_error.jnl
+   bn_deg_min.jnl
+   bn_dp_readscale.jnl
+   bn_bounds_defineax.jnl
+   bn_attributes.jnl
+   bn_transforms.jnl
+   bn_variance.jnl
+   bn_linecolors.jnl
+   bn_cdf_errmsg.jnl
+   bn600_bug_fixes.jnl
+   bn601_bug_fixes.jnl
+   bn_set_strides.jnl
+   bn_lsl_lowpass.jnl
+   bn_return_xmod_tmod.jnl
+   bn602_bug_fixes.jnl
+   bn_modnbd.jnl
+   bn_fifty_files.jnl
+   bn603_bug_fixes.jnl
+   bn_set_var_name.jnl
+   bn_memory_symbol.jnl
+   bn605_bug_fixes.jnl
+   bn608_bug_fixes.jnl
+   bn_shade_trim.jnl
+   bn_mode_nlevels.jnl
+   bn61_bug_fixes.jnl
+   bn_test_opendap.jnl
+   bn611_bug_fixes.jnl
+   bn_no_valid_on_plot.jnl
+   bn_median.jnl
+   bn614_bug_fixes.jnl
+   bn_mode_nodata_lab.jnl
+   bn_proleptic_gregorian_calendar.jnl
+   bn_string_ngd_nbd.jnl
+   bn_cat_string.jnl
+   bn_sort_strings.jnl
+   bn_samplexyt.jnl
+   bn_last_go_file.jnl
+   bn_cancel_upcase_uservar.jnl
+   bn_cdf_keepax.jnl
+   bn_keep_axisnames.jnl
+   bn_key_label_minmax.jnl
+   bn62_bug_fixes.jnl
+   bn_convolve.jnl
+   bn_tax_tstep.jnl
+   bn_grads_z.jnl
+   bn_clock_syms.jnl
+   bn63_bug_fixes.jnl
+   bn_axis_reversed_syms.jnl
+   bn_isdepth.jnl
+   bn_var_hist_levels.jnl
+   bn64_bug_fixes.jnl
+   bn_long_grid_names.jnl
+   bn_xml_repl.jnl
+   bn65_bug_fixes.jnl
+   bn_txtype_dmy.jnl
+   bn_n_open_dsets_sym.jnl
+   bn_multi_decade.jnl
+   bn_show_xml_file.jnl
+   bn66_bug_fixes.jnl
+   bn_netcdf4.jnl
+   bn_scat2grid_bin.jnl
+   bn_axis_dir_symbols.jnl
+   bn663_bug_fixes.jnl
+   bn_set_axis_regular.jnl
+   bn_set_cancel_redirect.jnl
+   bn_min_max_smoothers.jnl
+   bn_vector_symbols.jnl
+   bn_variance_large.jnl
+   bn_labnum_calendar.jnl
+   bn665_bug_fixes.jnl
+   bn_floatstr.jnl
+   bn67_bug_fixes.jnl
+   bn_NaN_note.jnl
+   bn671_bug_fixes.jnl
+   bn68_bug_fixes.jnl
+   bn_ifv.jnl
+   bn_randu2_randn2.jnl
+   bn_axis_cf.jnl
+   bn_repeated_coords.jnl
+   bn_xml_header.jnl
+   bn_eof_simple.jnl
+   bn_eof_simple2.jnl
+   bn_interpolate_6d.jnl
+   bn_regrid_6d.jnl
+   bn_syntax_6d.jnl
+   bn_expressions_6d.jnl
+   bn_direction_fcns_6d.jnl
+   bn_regrid_transforms_6d.jnl
+   bn_aggregate_e.jnl
+   bn_6d_lab_mode.jnl
+   bn682_bug_fixes.jnl
+   bn683_bug_fixes.jnl
+   bn_outtype.jnl
+   bn_ribbon_plot.jnl
+   bn_descr_4digit.jnl
+   bn_axis_outtype.jnl
+   bn_axis_nonmonotonic.jnl
+   bn_vec_mod.jnl
+   bn685_bug_fixes.jnl
+   bn_dsg_e_x.jnl
+   bn_nco_append.jnl
+   bn_nobounds.jnl
+   bn_write_integer_att.jnl
+   bn_descriptor_mc.jnl
+   bn_plot_color_only.jnl
+   bn_vtree.jnl
+   bn686_bug_fixes.jnl
+   bn_long_symnames.jnl
+   bn_strdim.jnl
+   bn_single_colorlev.jnl
+   bn69_bug_fixes.jnl
+   bn_bad_axis_bounds.jnl
+   bn_enter_exit_GO.jnl
+   bn_stddev.jnl
+   bn_set_axis_name.jnl
+   bn_all_ef.jnl
+   bn_startupfile.jnl
+****** Restricting Ferret paths to bench directory ******
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/ksmith/Datasets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ksmith/Ferret/ext_func/libs
+FER_FONTS=/home/users/ksmith/Ferret/ppl/fonts
+FER_GO=. /home/users/ksmith/Ferret/go /home/users/ksmith/Ferret/examples /home/users/ksmith/Ferret/contrib
+FER_GRIDS=.
+FER_LIBS=/home/users/ksmith/Ferret/lib
+FER_PALETTE=. /home/users/ksmith/Ferret/ppl
+FER_WEB_BROWSER=firefox
+Beginning at Mon Mar 31 15:37:06 PDT 2014
+*** Running test: bn_syntax.jnl
+ Cached data cleared from memory
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+*** Running test: bn_dollar.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO bn_dollar.jnl hello
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO bn_dollar.jnl hello
+say ($10)0
+*** Running test: bn_grave.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+*** Running test: bn_letd.jnl
+ Cached data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+*** Running test: bn_if.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+*** Running test: bn_expressions.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+*** Running test: bn_geometry.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+*** Running test: bn_output.jnl
+ Cached data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+*** Running test: bn_in_plane.jnl
+ Cached data cleared from memory
+*** Running test: bn_compress.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_interpolate.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+*** Running test: bn_ez.jnl
+ Cached data cleared from memory
+ LISTing to file test.unf
+*** Running test: bn_plot.jnl
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          Legal range is 1 to 3
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black,Red,Green,Blue,LightBlue,Purple, and White
+cont/over/i=1:10/color=noexist i
+ **ERROR: unknown command qualifier: thick=4
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+*** Running test: bn_curv.jnl
+ Cached data cleared from memory
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+*** Running test: bn_symbols.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols.jnl
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+*** Running test: bn_comma_delimited.jnl
+ Cached data cleared from memory
+*** Running test: bn_dynamic_grids.jnl
+ Cached data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: multiple specifications on X axis
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: multiple specifications on X axis
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G005) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G005) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+*** Running test: bn_cdf.jnl
+ Cached data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn_regrid_transforms.jnl
+ Cached data cleared from memory
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+*** Running test: bn_axis_limits.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+*** Running test: bn_movie.jnl
+ Cached data cleared from memory
+*** Running test: bn_ez_order.jnl
+ Cached data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+*** Running test: bn_user.jnl
+ Cached data cleared from memory
+*** Running test: bn_stream.jnl
+ Cached data cleared from memory
+*** Running test: bn_mc.jnl
+ Cached data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+*** Running test: bn_negative_t.jnl
+ Cached data cleared from memory
+ **ERROR: regridding: only @ASN regridding between calendar and
+          non-calendar axes: A
+LIST a[gt=tcal]
+*** Running test: bn_xact_regrid.jnl
+ Cached data cleared from memory
+*** Running test: bn_gc_functions.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+*** Running test: bn491_bug_fixes.jnl
+ Cached data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_odd_variable_name.jnl
+ Cached data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+*** Running test: bn_test_stream.jnl
+ Cached data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+*** Running test: bn_define_axes.jnl
+ Cached data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+*** Running test: bn_polygon.jnl
+ Cached data cleared from memory
+*** Running test: bn500_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_sample.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_strides_revs_perms.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_non_COARDS_netCDF.jnl
+ Cached data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+*** Running test: bn_cache_hits.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_to_user.jnl
+ Cached data cleared from memory
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+*** Running test: bn_calendar.jnl
+ Cached data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+*** Running test: bn_dash_dot.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+*** Running test: bn_flowlines.jnl
+ Cached data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_logaxes.jnl
+ Cached data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+*** Running test: bn_internal_external_functions.jnl
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modulo_strides.jnl
+ Cached data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_axis_viewports.jnl
+ Cached data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+*** Running test: bn_strings.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+*** Running test: bn_axcontrol.jnl
+ Cached data cleared from memory
+*** Running test: bn_vec_curv.jnl
+ Cached data cleared from memory
+*** Running test: bn_delimited_read.jnl
+ Cached data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+*** Running test: bn541_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+sh: ncrename: command not found
+sh: ncrename: command not found
+sh: ncrename: command not found
+*** Running test: bn_cancel_axes.jnl
+ Cached data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+*** Running test: bn542_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G001)
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G001)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_subspan_modulo.jnl
+ Cached data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_dots.jnl
+ Cached data cleared from memory
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+*** Running test: bn_lev_symbols.jnl
+ Cached data cleared from memory
+*** Running test: bn_mode_logo_lab.jnl
+ Cached data cleared from memory
+*** Running test: bn_modulo_attribute.jnl
+ Cached data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+*** Running test: bn550_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn551_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_multi_line_labels.jnl
+ Cached data cleared from memory
+*** Running test: bn552_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+rm: cannot remove `input.txt': No such file or directory
+ls: input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=01-JAN-1990 00:00
+          Axis extremes are T=31-DEC-1997 12:00:30-JAN-1998 12:00
+list/t=1-jan-1990 dummy
+*** Running test: bn_set_var_scale_off.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+*** Running test: bn_longvarnames.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_shakey.jnl
+ Cached data cleared from memory
+*** Running test: bn_eof_4d.jnl
+ Cached data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+*** Running test: bn_abstract_axis_names.jnl
+ Cached data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+*** Running test: bn_many_polygons.jnl
+ Cached data cleared from memory
+Replacing definition of axis YQ
+*** Running test: bn_fill_irregular.jnl
+ Cached data cleared from memory
+*** Running test: bn_xml_output.jnl
+ Cached data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+*** Running test: bn_test_nan.jnl
+ Cached data cleared from memory
+*** Running test: bn553_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_graticules.jnl
+ Cached data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+*** Running test: bn_repeat_range.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+*** Running test: bn554_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=01-AUG-1980 00:00:01-JAN-1982 00:00
+          Axis extremes are T=14-AUG-1982 11:00:13-JAN-1983 13:00
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+*** Running test: bn_bounds.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+*** Running test: bn_all_leap.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+*** Running test: bn570_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modstats.jnl
+ Cached data cleared from memory
+*** Running test: bn_mc_vary_scale.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_plot_nokey.jnl
+ Cached data cleared from memory
+*** Running test: bn580_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_inf_levels.jnl
+ Cached data cleared from memory
+*** Running test: bn_regulart.jnl
+ Cached data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+*** Running test: bn_labwid.jnl
+ Cached data cleared from memory
+*** Running test: bn_redefine_taxis_mc.jnl
+ Cached data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_illegal_axisname.jnl
+ Cached data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_exit_script.jnl
+ Cached data cleared from memory
+*** Running test: bn_exit_cycle.jnl
+ Cached data cleared from memory
+*** Running test: bn_curv_mod.jnl
+ Cached data cleared from memory
+*** Running test: bn_shade_keycont.jnl
+ Cached data cleared from memory
+*** Running test: bn581_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_tab_comma_multivar.jnl
+ Cached data cleared from memory
+*** Running test: bn_element_functions.jnl
+ Cached data cleared from memory
+*** Running test: bn_long_revision_num.jnl
+ Cached data cleared from memory
+ LISTing to file revision.nc
+*** Running test: bn_window_title.jnl
+ Cached data cleared from memory
+*** Running test: bn_last_error.jnl
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ Cached data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+*** Running test: bn_deg_min.jnl
+ Cached data cleared from memory
+*** Running test: bn_dp_readscale.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_bounds_defineax.jnl
+ Cached data cleared from memory
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+*** Running test: bn_attributes.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME1).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT).units
+ *** NOTE: Changing the value of attribute (PSYT).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME).units
+ *** NOTE: Changing the value of attribute (TIME).units
+ *** NOTE: Changing the value of attribute (TIME).time_origin
+ *** NOTE: Changing the value of attribute (TIME).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_transforms.jnl
+ Cached data cleared from memory
+*** Running test: bn_variance.jnl
+ Cached data cleared from memory
+*** Running test: bn_linecolors.jnl
+ Cached data cleared from memory
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+*** Running test: bn_cdf_errmsg.jnl
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ Cached data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+*** Running test: bn600_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ LISTing to file a.nc
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+*** Running test: bn601_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME4
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_strides.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX005)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+*** Running test: bn_lsl_lowpass.jnl
+ Cached data cleared from memory
+*** Running test: bn_return_xmod_tmod.jnl
+ Cached data cleared from memory
+*** Running test: bn602_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modnbd.jnl
+ Cached data cleared from memory
+*** Running test: bn_fifty_files.jnl
+ Cached data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn603_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_var_name.jnl
+ Cached data cleared from memory
+*** Running test: bn_memory_symbol.jnl
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+*** Running test: bn605_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn608_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+*** Running test: bn_shade_trim.jnl
+ Cached data cleared from memory
+*** Running test: bn_mode_nlevels.jnl
+ Cached data cleared from memory
+*** Running test: bn61_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_test_opendap.jnl
+curl error details: 
+ Cached data cleared from memory
+*** Running test: bn611_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+*** Running test: bn_no_valid_on_plot.jnl
+ Cached data cleared from memory
+ Using every   5th vector in the X direction
+*** Running test: bn_median.jnl
+ Cached data cleared from memory
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+*** Running test: bn614_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+*** Running test: bn_mode_nodata_lab.jnl
+ Cached data cleared from memory
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+ Cached data cleared from memory
+*** Running test: bn_string_ngd_nbd.jnl
+ Cached data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+*** Running test: bn_cat_string.jnl
+ Cached data cleared from memory
+*** Running test: bn_sort_strings.jnl
+ Cached data cleared from memory
+*** Running test: bn_samplexyt.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+*** Running test: bn_last_go_file.jnl
+ Cached data cleared from memory
+*** Running test: bn_cancel_upcase_uservar.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_cdf_keepax.jnl
+ Cached data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn_keep_axisnames.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_key_label_minmax.jnl
+ Cached data cleared from memory
+*** Running test: bn62_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_convolve.jnl
+ Cached data cleared from memory
+*** Running test: bn_tax_tstep.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+*** Running test: bn_grads_z.jnl
+ Cached data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_clock_syms.jnl
+ Cached data cleared from memory
+*** Running test: bn63_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_reversed_syms.jnl
+ Cached data cleared from memory
+*** Running test: bn_isdepth.jnl
+ Cached data cleared from memory
+*** Running test: bn_var_hist_levels.jnl
+ Cached data cleared from memory
+*** Running test: bn64_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_long_grid_names.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_xml_repl.jnl
+ Cached data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+*** Running test: bn65_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: TIME: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+*** Running test: bn_txtype_dmy.jnl
+ Cached data cleared from memory
+*** Running test: bn_n_open_dsets_sym.jnl
+ Cached data cleared from memory
+ LISTing to file list_of_numbers.dat
+*** Running test: bn_multi_decade.jnl
+ Cached data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+*** Running test: bn_show_xml_file.jnl
+ Cached data cleared from memory
+ LISTing to file dummy.dat
+*** Running test: bn66_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_netcdf4.jnl
+ Cached data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+*** Running test: bn_scat2grid_bin.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_dir_symbols.jnl
+ Cached data cleared from memory
+*** Running test: bn663_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_axis_regular.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+*** Running test: bn_set_cancel_redirect.jnl
+ Cached data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+*** Running test: bn_min_max_smoothers.jnl
+ Cached data cleared from memory
+*** Running test: bn_vector_symbols.jnl
+ Cached data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+*** Running test: bn_variance_large.jnl
+ Cached data cleared from memory
+*** Running test: bn_labnum_calendar.jnl
+ Cached data cleared from memory
+*** Running test: bn665_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_floatstr.jnl
+ Cached data cleared from memory
+*** Running test: bn67_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_NaN_note.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+*** Running test: bn671_bug_fixes.jnl
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn68_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: ./err672_vert_axislabel.jnl
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.089, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+*** Running test: bn_ifv.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+*** Running test: bn_randu2_randn2.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_cf.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_repeated_coords.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+*** Running test: bn_xml_header.jnl
+ Cached data cleared from memory
+*** Running test: bn_eof_simple.jnl
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ Cached data cleared from memory
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+*** Running test: bn_eof_simple2.jnl
+ Cached data cleared from memory
+*** Running test: bn_interpolate_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_6d.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+*** Running test: bn_syntax_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_expressions_6d.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+*** Running test: bn_direction_fcns_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_transforms_6d.jnl
+ Cached data cleared from memory
+Replacing definition of axis FAX4DAY
+*** Running test: bn_aggregate_e.jnl
+ Cached data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+*** Running test: bn_6d_lab_mode.jnl
+ Cached data cleared from memory
+*** Running test: bn682_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn683_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: /home/users/ksmith/Ferret/go/magnify.jnl
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_outtype.jnl
+ Cached data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+*** Running test: bn_ribbon_plot.jnl
+ Cached data cleared from memory
+*** Running test: bn_descr_4digit.jnl
+ Cached data cleared from memory
+*** Running test: bn_axis_outtype.jnl
+ Cached data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+*** Running test: bn_axis_nonmonotonic.jnl
+ Cached data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+*** Running test: bn_vec_mod.jnl
+ Cached data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+*** Running test: bn685_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_dsg_e_x.jnl
+ Cached data cleared from memory
+*** Running test: bn_nco_append.jnl
+sh: ncks: command not found
+ Cached data cleared from memory
+ LISTing to file append_to_this.nc
+*** Running test: bn_nobounds.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_write_integer_att.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+*** Running test: bn_descriptor_mc.jnl
+ Cached data cleared from memory
+*** Running test: bn_plot_color_only.jnl
+ Cached data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+*** Running test: bn_vtree.jnl
+ Cached data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+*** Running test: bn686_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute a.ival
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             nosuchfile.nc
+SET DAT/FORM=CDF nosuchfile.nc
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for nosuchfile(.nc ,.cdf,.des)
+SET DAT/FORM=CDF nosuchfile
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for snoopy(.nc ,.cdf,.des)
+SET DAT/FORM=CDF snoopy
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./snoopy.dat
+SET DAT/FORM=CDF snoopy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_long_symnames.jnl
+ Cached data cleared from memory
+*** Running test: bn_strdim.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_single_colorlev.jnl
+ Cached data cleared from memory
+*** Running test: bn69_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis XAXIS_TEST
+ LISTing to file b.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file nc
+ **TMAP ERR: error in line definition
+             file coords dont match variable coords on axis XAXIS_TEST
+LIST/FORMAT=CDF/clobber/keep/file=nc b,a[d=1]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: must be a 2D region
+          shade b
+shade b
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute v1.long_name
+ *** NOTE: Changing the value of attribute v1.units
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: attribute undefined or invalid attribute name: temp.noexist[d=levitus_climatology]
+          attribute noexist not found for variable TEMP
+show att temp.noexist[d=levitus_climatology]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: illegal new name.  Variable b already defined
+set var/name=b a
+ **ERROR: invalid command: illegal new name.  Variable temp exists in dataset
+set var/name=temp salt
+ **ERROR: invalid command: illegal new name.  Variable psi exists in dataset
+set var/name=psi myvar
+*** Running test: bn_bad_axis_bounds.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis definition error on axis: MONTH_IRREG. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "MONTH_IRREG_bnds" or bounds do not enclose point on axis MONTH_IRREG
+ *** NOTE: Substituting coordinate midpoints
+*** Running test: bn_enter_exit_GO.jnl
+ Cached data cleared from memory
+*** Running test: bn_stddev.jnl
+ Cached data cleared from memory
+*** Running test: bn_set_axis_name.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file c.nc
+ **ERROR: invalid command: illegal new name. Axis days2000 is already defined
+set axis/name=days2000 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis
+set axis/name x_in_meters
+ **ERROR: invalid command: illegal new name given for axis 45
+set axis/name=45 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis .fr
+set axis/name=.fr x_in_meters
+*** Running test: bn_all_ef.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unknown region name: @w
+set region/@w
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+          unknown function "writev5d"
+DEFINE VARIABLE/QUIET vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+ **ERROR: variable unknown or not in data set: VFLAG
+LOAD/TEMPORARY vflag
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_startupfile.jnl
+ Cached data cleared from memory
+Ended at Mon Mar 31 15:38:52 PDT 2014
diff --git a/bench/test_results/ferret_run_tests_log b/bench/test_results/ferret_run_tests_log
new file mode 100644
index 0000000..29c00ba
--- /dev/null
+++ b/bench/test_results/ferret_run_tests_log
@@ -0,0 +1,75717 @@
+Using FERRET /home/users/ksmith/Ferret/bin/ferret
+lrwxrwxrwx 1 ksmith tmap 11 Mar 31 15:35 /home/users/ksmith/Ferret/bin/ferret -> ferret_v6.9
+Using external functions from /home/users/ksmith/Ferret/ext_func/libs
+Benchmark run by ksmith
+Note: RUN_TESTS.sh test results for debug build of Ferret on RHEL5-64
+Benchmark scripts that will be run:
+   bn_syntax.jnl
+   bn_dollar.jnl
+   bn_grave.jnl
+   bn_letd.jnl
+   bn_if.jnl
+   bn_expressions.jnl
+   bn_geometry.jnl
+   bn_output.jnl
+   bn_in_plane.jnl
+   bn_compress.jnl
+   bn_interpolate.jnl
+   bn_regrid.jnl
+   bn_ez.jnl
+   bn_plot.jnl
+   bn_curv.jnl
+   bn_symbols.jnl
+   bn_comma_delimited.jnl
+   bn_dynamic_grids.jnl
+   bn_cdf.jnl
+   bn_regrid_transforms.jnl
+   bn_axis_limits.jnl
+   bn_movie.jnl
+   bn_ez_order.jnl
+   bn_user.jnl
+   bn_stream.jnl
+   bn_mc.jnl
+   bn_negative_t.jnl
+   bn_xact_regrid.jnl
+   bn_gc_functions.jnl
+   bn491_bug_fixes.jnl
+   bn_odd_variable_name.jnl
+   bn_test_stream.jnl
+   bn_define_axes.jnl
+   bn_polygon.jnl
+   bn500_bug_fixes.jnl
+   bn_sample.jnl
+   bn_strides_revs_perms.jnl
+   bn_non_COARDS_netCDF.jnl
+   bn_cache_hits.jnl
+   bn_regrid_to_user.jnl
+   bn_calendar.jnl
+   bn_dash_dot.jnl
+   bn_flowlines.jnl
+   bn_logaxes.jnl
+   bn_internal_external_functions.jnl
+   bn_modulo_strides.jnl
+   bn_axis_viewports.jnl
+   bn_strings.jnl
+   bn_axcontrol.jnl
+   bn_vec_curv.jnl
+   bn_delimited_read.jnl
+   bn541_bug_fixes.jnl
+   bn_cancel_axes.jnl
+   bn542_bug_fixes.jnl
+   bn_subspan_modulo.jnl
+   bn_dots.jnl
+   bn_lev_symbols.jnl
+   bn_mode_logo_lab.jnl
+   bn_modulo_attribute.jnl
+   bn550_bug_fixes.jnl
+   bn551_bug_fixes.jnl
+   bn_multi_line_labels.jnl
+   bn552_bug_fixes.jnl
+   bn_set_var_scale_off.jnl
+   bn_longvarnames.jnl
+   bn_shakey.jnl
+   bn_eof_4d.jnl
+   bn_abstract_axis_names.jnl
+   bn_many_polygons.jnl
+   bn_fill_irregular.jnl
+   bn_xml_output.jnl
+   bn_test_nan.jnl
+   bn553_bug_fixes.jnl
+   bn_graticules.jnl
+   bn_repeat_range.jnl
+   bn554_bug_fixes.jnl
+   bn_bounds.jnl
+   bn_all_leap.jnl
+   bn570_bug_fixes.jnl
+   bn_modstats.jnl
+   bn_mc_vary_scale.jnl
+   bn_plot_nokey.jnl
+   bn580_bug_fixes.jnl
+   bn_inf_levels.jnl
+   bn_regulart.jnl
+   bn_labwid.jnl
+   bn_redefine_taxis_mc.jnl
+   bn_illegal_axisname.jnl
+   bn_exit_script.jnl
+   bn_exit_cycle.jnl
+   bn_curv_mod.jnl
+   bn_shade_keycont.jnl
+   bn581_bug_fixes.jnl
+   bn_tab_comma_multivar.jnl
+   bn_element_functions.jnl
+   bn_long_revision_num.jnl
+   bn_window_title.jnl
+   bn_last_error.jnl
+   bn_deg_min.jnl
+   bn_dp_readscale.jnl
+   bn_bounds_defineax.jnl
+   bn_attributes.jnl
+   bn_transforms.jnl
+   bn_variance.jnl
+   bn_linecolors.jnl
+   bn_cdf_errmsg.jnl
+   bn600_bug_fixes.jnl
+   bn601_bug_fixes.jnl
+   bn_set_strides.jnl
+   bn_lsl_lowpass.jnl
+   bn_return_xmod_tmod.jnl
+   bn602_bug_fixes.jnl
+   bn_modnbd.jnl
+   bn_fifty_files.jnl
+   bn603_bug_fixes.jnl
+   bn_set_var_name.jnl
+   bn_memory_symbol.jnl
+   bn605_bug_fixes.jnl
+   bn608_bug_fixes.jnl
+   bn_shade_trim.jnl
+   bn_mode_nlevels.jnl
+   bn61_bug_fixes.jnl
+   bn_test_opendap.jnl
+   bn611_bug_fixes.jnl
+   bn_no_valid_on_plot.jnl
+   bn_median.jnl
+   bn614_bug_fixes.jnl
+   bn_mode_nodata_lab.jnl
+   bn_proleptic_gregorian_calendar.jnl
+   bn_string_ngd_nbd.jnl
+   bn_cat_string.jnl
+   bn_sort_strings.jnl
+   bn_samplexyt.jnl
+   bn_last_go_file.jnl
+   bn_cancel_upcase_uservar.jnl
+   bn_cdf_keepax.jnl
+   bn_keep_axisnames.jnl
+   bn_key_label_minmax.jnl
+   bn62_bug_fixes.jnl
+   bn_convolve.jnl
+   bn_tax_tstep.jnl
+   bn_grads_z.jnl
+   bn_clock_syms.jnl
+   bn63_bug_fixes.jnl
+   bn_axis_reversed_syms.jnl
+   bn_isdepth.jnl
+   bn_var_hist_levels.jnl
+   bn64_bug_fixes.jnl
+   bn_long_grid_names.jnl
+   bn_xml_repl.jnl
+   bn65_bug_fixes.jnl
+   bn_txtype_dmy.jnl
+   bn_n_open_dsets_sym.jnl
+   bn_multi_decade.jnl
+   bn_show_xml_file.jnl
+   bn66_bug_fixes.jnl
+   bn_netcdf4.jnl
+   bn_scat2grid_bin.jnl
+   bn_axis_dir_symbols.jnl
+   bn663_bug_fixes.jnl
+   bn_set_axis_regular.jnl
+   bn_set_cancel_redirect.jnl
+   bn_min_max_smoothers.jnl
+   bn_vector_symbols.jnl
+   bn_variance_large.jnl
+   bn_labnum_calendar.jnl
+   bn665_bug_fixes.jnl
+   bn_floatstr.jnl
+   bn67_bug_fixes.jnl
+   bn_NaN_note.jnl
+   bn671_bug_fixes.jnl
+   bn68_bug_fixes.jnl
+   bn_ifv.jnl
+   bn_randu2_randn2.jnl
+   bn_axis_cf.jnl
+   bn_repeated_coords.jnl
+   bn_xml_header.jnl
+   bn_eof_simple.jnl
+   bn_eof_simple2.jnl
+   bn_interpolate_6d.jnl
+   bn_regrid_6d.jnl
+   bn_syntax_6d.jnl
+   bn_expressions_6d.jnl
+   bn_direction_fcns_6d.jnl
+   bn_regrid_transforms_6d.jnl
+   bn_aggregate_e.jnl
+   bn_6d_lab_mode.jnl
+   bn682_bug_fixes.jnl
+   bn683_bug_fixes.jnl
+   bn_outtype.jnl
+   bn_ribbon_plot.jnl
+   bn_descr_4digit.jnl
+   bn_axis_outtype.jnl
+   bn_axis_nonmonotonic.jnl
+   bn_vec_mod.jnl
+   bn685_bug_fixes.jnl
+   bn_dsg_e_x.jnl
+   bn_nco_append.jnl
+   bn_nobounds.jnl
+   bn_write_integer_att.jnl
+   bn_descriptor_mc.jnl
+   bn_plot_color_only.jnl
+   bn_vtree.jnl
+   bn686_bug_fixes.jnl
+   bn_long_symnames.jnl
+   bn_strdim.jnl
+   bn_single_colorlev.jnl
+   bn69_bug_fixes.jnl
+   bn_bad_axis_bounds.jnl
+   bn_enter_exit_GO.jnl
+   bn_stddev.jnl
+   bn_set_axis_name.jnl
+   bn_all_ef.jnl
+   bn_startupfile.jnl
+****** Restricting Ferret paths to bench directory ******
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/ksmith/Datasets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ksmith/Ferret/ext_func/libs
+FER_FONTS=/home/users/ksmith/Ferret/ppl/fonts
+FER_GO=. /home/users/ksmith/Ferret/go /home/users/ksmith/Ferret/examples /home/users/ksmith/Ferret/contrib
+FER_GRIDS=.
+FER_LIBS=/home/users/ksmith/Ferret/lib
+FER_PALETTE=. /home/users/ksmith/Ferret/ppl
+FER_WEB_BROWSER=firefox
+Beginning at Mon Mar 31 15:37:06 PDT 2014
+*** Running test: bn_syntax.jnl
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region T
+        X=130:290
+        Y=-23.5:23.5
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region N
+        X=130:290
+        Y=-9.8:9.8
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      metafile.plt
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN ACTIVE
+   1    *
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+*** Running test: bn_dollar.jnl
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+*** Running test: bn_grave.jnl
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  4 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  4 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+*** Running test: bn_letd.jnl
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+*** Running test: bn_if.jnl
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+*** Running test: bn_expressions.jnl
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+*** Running test: bn_geometry.jnl
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+*** Running test: bn_output.jnl
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+*** Running test: bn_in_plane.jnl
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+*** Running test: bn_compress.jnl
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+*** Running test: bn_interpolate.jnl
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+*** Running test: bn_regrid.jnl
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             4      6      8    
+             2      3      4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- K:3 Z:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- K:4 Z:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- K:3 Z:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- K:4 Z:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- K:3 Z:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- K:4 Z:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             5      7      9    
+             3      4      5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- K:4 Z:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- K:5 Z:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- K:4 Z:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- K:5 Z:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- K:4 Z:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- K:5 Z:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+             25.5   35.5   45.5   55.5   65.5   75.5  
+              3      4      5      6      7      8
+ 25.5 / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+ 35.5 / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 45.5 / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 55.5 / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 65.5 / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 75.5 / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      101.0  101.0
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+              25.5E  35.5E  45.5E  55.5E  65.5E  75.5E 
+               3      4      5      6      7      8
+ 75.5N / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+ 65.5N / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 55.5N / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 45.5N / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 35.5N / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 25.5N / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      94.71  94.53
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.
+ 02-JAN-1980 00 / 2:  87672.
+ 03-JAN-1980 00 / 3:  87696.
+ 04-JAN-1980 00 / 4:  87720.
+ 05-JAN-1980 00 / 5:  87744.
+ 06-JAN-1980 00 / 6:  87768.
+ 07-JAN-1980 00 / 7:  87792.
+ 08-JAN-1980 00 / 8:  87816.
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.
+ 03-JAN-1980 00 / 2:  87696.
+ 05-JAN-1980 00 / 3:  87744.
+ 07-JAN-1980 00 / 4:  87792.
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+*** Running test: bn_ez.jnl
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.0060
+ 2   / 2:  0.3550
+ 3   / 3:  0.4100
+ 4   / 4:  0.4350
+ 5   / 5:  0.4780
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+             X1     X2
+1   / 1:  0.0060  0.8865
+2   / 2:  0.3550  0.6643
+3   / 3:  0.4100  0.6071
+4   / 4:  0.4350  0.5535
+5   / 5:  0.4780  0.5337
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.0060
+ 2    /  2:  0.1760
+ 3    /  3:  0.2820
+ 4    /  4:  0.3550
+ 5    /  5:  0.3790
+ 6    /  6:  0.3930
+ 7    /  7:  0.4100
+ 8    /  8:  0.4170
+ 9    /  9:  0.4670
+ 10   / 10:  0.4350
+ 11   / 11:  0.4440
+ 12   / 12:  0.4700
+ 13   / 13:  0.4780
+ 14   / 14:  0.5150
+ 15   / 15:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.4170
+ 3   / 3:  0.4670
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+ 7   / 7:  0.4780
+ 8   / 8:  0.5150
+ 9   / 9:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.5935
+ 3   / 3:  0.4350
+ 4   / 4:  0.5458
+ 5   / 5:  0.4780
+ 6   / 6:  0.5147
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.4170
+ 3   / 3:  0.4670
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+ 7   / 7:  0.4780
+ 8   / 8:  0.5150
+ 9   / 9:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.3550
+ 2   / 2:  0.3790
+ 3   / 3:  0.3930
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ 3   / 3:  0.4100  0.4170  0.4670
+ 4   / 4:  0.4350  0.4440  0.4700
+ 5   / 5:  0.4780  0.5150  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             1       2       3     
+              1       2       3
+ ---- L:1 T:   1
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ ---- L:2 T:   2
+ 1   / 1:  0.4100  0.4170  0.4670
+ 2   / 2:  0.4350  0.4440  0.4700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.0060
+ 2   / 2:  0.1760
+ 3   / 3:  0.2820
+ 4   / 4:  0.3550
+ 5   / 5:  0.3790
+ 6   / 6:  0.3930
+ 7   / 7:  0.4100
+ 8   / 8:  0.4170
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+*** Running test: bn_plot.jnl
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.20  HEIGHT=    8.80  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= metafile.plt                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+*** Running test: bn_curv.jnl
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5335,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+ 
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+*** Running test: bn_symbols.jnl
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "0"
+PPL$YPIXEL = "0"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+DELTA_CPU = "0.011997"
+CLOCK_SECS = "0.007"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:37:13"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "0"
+PPL$YPIXEL = "0"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+DELTA_CPU = "0.002"
+CLOCK_SECS = "0.008"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:37:13"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "4"
+Q23456789012345678901234567890AAAAA = "5"
+Q23456789012345678901234567XXXAAAAA = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LABX = "X"
+LAB1 = "Y : 10"
+LABNUM_Y = "1"
+LAB2 = "Z : 5"
+LABNUM_Z = "2"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "1"
+LABNUM_Z = "2"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "1"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "691"
+PPL$YPIXEL = "518"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:37"
+SESSION_PID = "26205"
+DELTA_CPU = "0.032995"
+CLOCK_SECS = "0.137"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:37:13"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+ 
+*** Running test: bn_comma_delimited.jnl
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W,134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.78,27.62
+1.2S,27.68,27.52
+ ---- K:3 Z:   25
+1.5S,27.65,27.49
+1.2S,27.51,27.35
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.78,27.62
+1.2S,27.68,27.52
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.65,27.49
+1.2S,27.51,27.35
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W,134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+25,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.78,27.62
+25,27.65,27.49
+ ---- J:42 Y:   1.2S
+15,27.68,27.52
+25,27.51,27.35
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+25,27.25,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.78,27.62
+25,27.65,27.49
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+25,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.68,27.52
+25,27.51,27.35
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+16-SEP-1982 22,27.78,27.62
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+16-SEP-1982 22,27.68,27.52
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.25,27.12
+16-SEP-1982 22,27.65,27.49
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.13,27.01
+16-SEP-1982 22,27.51,27.35
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+16-SEP-1982 22,27.78,27.62
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.12
+16-SEP-1982 22,27.65,27.49
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+16-SEP-1982 22,27.68,27.52
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.13,27.01
+16-SEP-1982 22,27.51,27.35
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S,1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.78,27.68
+134.5W,27.62,27.52
+ ---- K:3 Z:   25
+135.5W,27.65,27.51
+134.5W,27.49,27.35
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.78,27.68
+134.5W,27.62,27.52
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.65,27.51
+134.5W,27.49,27.35
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S,1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+25,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.78,27.68
+25,27.65,27.51
+ ---- I:96 X:   134.5W
+15,27.62,27.52
+25,27.49,27.35
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+25,27.25,27.13
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.78,27.68
+25,27.65,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+25,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.62,27.52
+25,27.49,27.35
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+16-SEP-1982 22,27.78,27.68
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.52
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.25,27.13
+16-SEP-1982 22,27.65,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.49,27.35
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+16-SEP-1982 22,27.78,27.68
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.13
+16-SEP-1982 22,27.65,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.52
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.49,27.35
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.78,27.65
+134.5W,27.62,27.49
+ ---- J:42 Y:   1.2S
+135.5W,27.68,27.51
+134.5W,27.52,27.35
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.78,27.65
+134.5W,27.62,27.49
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.68,27.51
+134.5W,27.52,27.35
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.78,27.65
+1.2S,27.68,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.62,27.49
+1.2S,27.52,27.35
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.78,27.65
+1.2S,27.68,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.62,27.49
+1.2S,27.52,27.35
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.25
+16-SEP-1982 22,27.78,27.65
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.49
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24,27.13
+16-SEP-1982 22,27.68,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.52,27.35
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.25
+16-SEP-1982 22,27.78,27.65
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.13
+16-SEP-1982 22,27.68,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.49
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.52,27.35
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.78
+134.5W,27.22,27.62
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.68
+134.5W,27.12,27.52
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.25,27.65
+134.5W,27.12,27.49
+ ---- J:42 Y:   1.2S
+135.5W,27.13,27.51
+134.5W,27.01,27.35
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33,27.78
+134.5W,27.22,27.62
+ ---- K:3 Z:   25
+135.5W,27.25,27.65
+134.5W,27.12,27.49
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24,27.68
+134.5W,27.12,27.52
+ ---- K:3 Z:   25
+135.5W,27.13,27.51
+134.5W,27.01,27.35
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.78
+1.2S,27.24,27.68
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.62
+1.2S,27.12,27.52
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.25,27.65
+1.2S,27.13,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.12,27.49
+1.2S,27.01,27.35
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33,27.78
+1.2S,27.24,27.68
+ ---- K:3 Z:   25
+1.5S,27.25,27.65
+1.2S,27.13,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22,27.62
+1.2S,27.12,27.52
+ ---- K:3 Z:   25
+1.5S,27.12,27.49
+1.2S,27.01,27.35
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33,27.78
+25,27.25,27.65
+ ---- I:96 X:   134.5W
+15,27.22,27.62
+25,27.12,27.49
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24,27.68
+25,27.13,27.51
+ ---- I:96 X:   134.5W
+15,27.12,27.52
+25,27.01,27.35
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.78
+25,27.25,27.65
+ ---- J:42 Y:   1.2S
+15,27.24,27.68
+25,27.13,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22,27.62
+25,27.12,27.49
+ ---- J:42 Y:   1.2S
+15,27.12,27.52
+25,27.01,27.35
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- K:2 Z:   15
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+25,27.13,27.01
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+25,27.13,27.01
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.25,27.12
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.13,27.01
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.12
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.13,27.01
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- K:2 Z:   15
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+25,27.12,27.01
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+25,27.12,27.01
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.25,27.13
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.13
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.25
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24,27.13
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.25
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.13
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22,27.12
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.25
+134.5W,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.13
+134.5W,27.01
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33
+134.5W,27.22
+ ---- K:3 Z:   25
+135.5W,27.25
+134.5W,27.12
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24
+134.5W,27.12
+ ---- K:3 Z:   25
+135.5W,27.13
+134.5W,27.01
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.25
+1.2S,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.12
+1.2S,27.01
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33
+1.2S,27.24
+ ---- K:3 Z:   25
+1.5S,27.25
+1.2S,27.13
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22
+1.2S,27.12
+ ---- K:3 Z:   25
+1.5S,27.12
+1.2S,27.01
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33
+25,27.25
+ ---- I:96 X:   134.5W
+15,27.22
+25,27.12
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24
+25,27.13
+ ---- I:96 X:   134.5W
+15,27.12
+25,27.01
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33
+25,27.25
+ ---- J:42 Y:   1.2S
+15,27.24
+25,27.13
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22
+25,27.12
+ ---- J:42 Y:   1.2S
+15,27.12
+25,27.01
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W,134.5W
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S,1.2S
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33
+ ---- I:96 X:   134.5W
+15,27.22
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24
+ ---- I:96 X:   134.5W
+15,27.12
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33
+ ---- J:42 Y:   1.2S
+15,27.24
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22
+ ---- J:42 Y:   1.2S
+15,27.12
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W,134.5W
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.2S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S,1.2S
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.2S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W
+1.5S,27.335
+1.2S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W	134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.33	27.22
+1.2S	27.24	27.12
+ ---- K:3 Z:   25
+1.5S	27.25	27.12
+1.2S	27.13	27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.78	27.62
+1.2S	27.68	27.52
+ ---- K:3 Z:   25
+1.5S	27.65	27.49
+1.2S	27.51	27.35
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,2.E+08,2.E+08
+1.2S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,1.6675084E+08,2.0208841E+08
+1.2S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,0.000002,0.000002
+1.2S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,0.00000166750845,0.00000202088412
+1.2S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.8S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.3S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1  ,2  ,3  ,4  ,5  
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+*** Running test: bn_dynamic_grids.jnl
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.67N / 50:  24.66  24.43  24.31  24.32  24.52
+ 1.33N / 49:  24.44  24.24  24.14  24.14  24.31
+ 1N    / 48:  24.25  24.08  23.97  23.95  24.09
+ 0.67N / 47:  24.09  23.95  23.84  23.79  23.87
+ 0.33N / 46:  23.99  23.87  23.77  23.70  23.71
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: TEMP
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  24.54  24.34  24.23  24.23  24.42
+ 1.17N / 49:  24.34  24.15  24.05  24.04  24.20
+ 0.83N / 48:  24.16  24.00  23.89  23.86  23.98
+ 0.5N  / 47:  24.02  23.89  23.79  23.73  23.77
+ 0.17N / 46:  23.96  23.85  23.74  23.66  23.64
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G005)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+               179.5W  178.5W  177.5W  176.5W  175.5W 
+                51      52      53      54      55
+ 1.83N / 51: -0.6280 -0.6522 -0.6598 -0.6632 -0.6626
+ 1.5N  / 50: -0.6316 -0.6539 -0.6537 -0.6505 -0.6444
+ 1.17N / 49: -0.6352 -0.6556 -0.6477 -0.6379 -0.6262
+ 0.83N / 48: -0.6270 -0.6471 -0.6371 -0.6267 -0.6161
+ 0.5N  / 47: -0.6072 -0.6285 -0.6218 -0.6170 -0.6141
+ 0.17N / 46: -0.5873 -0.6098 -0.6066 -0.6074 -0.6121
+ 0.17S / 45: -0.5674 -0.5912 -0.5914 -0.5977 -0.6101
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 2N    / 51:  27.58  27.54  27.50  27.45  27.37  27.27
+ 1.67N / 50:  27.61  27.56  27.52  27.47  27.39  27.29
+ 1.33N / 49:  27.66  27.60  27.55  27.49  27.41  27.32
+ 1N    / 48:  27.70  27.64  27.58  27.52  27.44  27.34
+ 0.67N / 47:  27.75  27.68  27.61  27.55  27.46  27.36
+ 0.33N / 46:  27.80  27.72  27.65  27.58  27.49  27.39
+ 0     / 45:  27.85  27.76  27.70  27.62  27.53  27.43
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 2N    / 51:  27.58  27.54  27.50  27.45  27.37  27.27
+ 1.67N / 50:  27.61  27.56  27.52  27.47  27.39  27.29
+ 1.33N / 49:  27.66  27.60  27.55  27.49  27.41  27.32
+ 1N    / 48:  27.70  27.64  27.58  27.52  27.44  27.34
+ 0.67N / 47:  27.75  27.68  27.61  27.55  27.46  27.36
+ 0.33N / 46:  27.80  27.72  27.65  27.58  27.49  27.39
+ 0     / 45:  27.85  27.76  27.70  27.62  27.53  27.43
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 1.83N / 51:  27.59  27.55  27.50  27.46  27.38  27.28
+ 1.5N  / 50:  27.64  27.58  27.53  27.48  27.40  27.30
+ 1.17N / 49:  27.68  27.62  27.57  27.51  27.43  27.33
+ 0.83N / 48:  27.73  27.66  27.60  27.53  27.45  27.35
+ 0.5N  / 47:  27.78  27.70  27.63  27.56  27.48  27.38
+ 0.17N / 46:  27.82  27.74  27.67  27.60  27.51  27.40
+ 0.17S / 45:  27.87  27.79  27.72  27.65  27.56  27.45
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                A     A
+130.5E / 1:  130.5  130.5
+131.5E / 2:  131.5  131.5
+132.5E / 3:  132.5  132.5
+133.5E / 4:  133.5  133.5
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 6   / 6:  6.000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.5
+ 133.5E / 4:  133.5
+ 134.5E / 5:  134.5
+ 135.5E / 6:  135.5
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 6   / 6:  6.000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.5
+ 133.5E / 4:  133.5
+ 134.5E / 5:  134.5
+ 135.5E / 6:  135.5
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX002)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.100
+ 0.2  /  2:  0.200
+ 0.3  /  3:  0.300
+ 0.4  /  4:  0.400
+ 0.5  /  5:  0.500
+ 0.6  /  6:  0.600
+ 0.7  /  7:  0.700
+ 0.8  /  8:  0.800
+ 0.9  /  9:  0.900
+ 1    / 10:  1.000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX001)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.0
+ 132.5E / 2:  132.5
+ 135E   / 3:  135.0
+ 137.5E / 4:  137.5
+ 140E   / 5:  140.0
+ 142.5E / 6:  142.5
+ 145E   / 7:  145.0
+ 147.5E / 8:  147.5
+ 150E   / 9:  150.0
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+                1      2      3      4      5      6      7
+ 101   /  1:  101.1  102.6  104.1  105.6  107.1  108.6  110.1
+ 102   /  2:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 103   /  3:  103.1  104.6  106.1  107.6  109.1  110.6  112.1
+ 104   /  4:  104.1  105.6  107.1  108.6  110.1  111.6  113.1
+ 105   /  5:  105.1  106.6  108.1  109.6  111.1  112.6  114.1
+ 106   /  6:  106.1  107.6  109.1  110.6  112.1  113.6  115.1
+ 107   /  7:  107.1  108.6  110.1  111.6  113.1  114.6  116.1
+ 108   /  8:  108.1  109.6  111.1  112.6  114.1  115.6  117.1
+ 109   /  9:  109.1  110.6  112.1  113.6  115.1  116.6  118.1
+ 110   / 10:  110.1  111.6  113.1  114.6  116.1  117.6  119.1
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                0.1    4.6    9.1  
+                1      2      3
+ 101   /  1:  101.1  105.6  110.1
+ 102   /  2:  102.1  106.6  111.1
+ 103   /  3:  103.1  107.6  112.1
+ 104   /  4:  104.1  108.6  113.1
+ 105   /  5:  105.1  109.6  114.1
+ 106   /  6:  106.1  110.6  115.1
+ 107   /  7:  107.1  111.6  116.1
+ 108   /  8:  108.1  112.6  117.1
+ 109   /  9:  109.1  113.6  118.1
+ 110   / 10:  110.1  114.6  119.1
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                0.1    7.6  
+                1      2
+ 101   /  1:  101.1  108.6
+ 102   /  2:  102.1  109.6
+ 103   /  3:  103.1  110.6
+ 104   /  4:  104.1  111.6
+ 105   /  5:  105.1  112.6
+ 106   /  6:  106.1  113.6
+ 107   /  7:  107.1  114.6
+ 108   /  8:  108.1  115.6
+ 109   /  9:  109.1  116.6
+ 110   / 10:  110.1  117.6
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+                1      2      3      4      5      6      7
+ 102    / 1:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 102.5  / 2:  102.6  104.1  105.6  107.1  108.6  110.1  111.6
+ 103    / 3:  103.1  104.6  106.1  107.6  109.1  110.6  112.1
+ 103.5  / 4:  103.6  105.1  106.6  108.1  109.6  111.1  112.6
+ 104    / 5:  104.1  105.6  107.1  108.6  110.1  111.6  113.1
+ 104.5  / 6:  104.6  106.1  107.6  109.1  110.6  112.1  113.6
+ 105    / 7:  105.1  106.6  108.1  109.6  111.1  112.6  114.1
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+               0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+               1      2      3      4      5      6      7
+ 95    / 1:   ....   ....   ....   ....   ....   ....   ....
+ 102   / 2:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 109   / 3:  109.1  110.6  112.1  113.6  115.1  116.6  118.1
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    7 r   0.1                  9.1
+ (AX001)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    7 r   0.1                  9.1
+ (AX002)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   2
+    AXIS (AX002)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+            0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+            1      2      3      4      5      6      7
+           1.20   4.20   7.20  10.20  13.20  16.20  19.20
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+            0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+            1      2      3      4      5      6      7
+           1.20   4.20   7.20  10.20  13.20  16.20  19.20
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ (AX001)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.
+ 121    /  2:   220.
+ 441    /  3:   420.
+ 961    /  4:   620.
+ 1681   /  5:   820.
+ 2601   /  6:  1020.
+ 3721   /  7:  1220.
+ 5041   /  8:  1420.
+ 6561   /  9:  1620.
+ 8281   / 10:  1720.
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.5
+ 131.5E /  2:  131.5
+ 132.5E /  3:  132.5
+ 133.5E /  4:  133.5
+ 134.5E /  5:  134.5
+ 135.5E /  6:  135.5
+ 136.5E /  7:  136.5
+ 137.5E /  8:  137.5
+ 138.5E /  9:  138.5
+ 139.5E / 10:  139.5
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.0
+ 147.5W / 2:  212.5
+ 145W   / 3:  215.0
+ 142.5W / 4:  217.5
+ 140W   / 5:  220.0
+ 137.5W / 6:  222.5
+ 135W   / 7:  225.0
+ 132.5W / 8:  227.5
+ 130W   / 9:  230.0
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX002)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.0
+ 147.5W / 2:  212.5
+ 145W   / 3:  215.0
+ 142.5W / 4:  217.5
+ 140W   / 5:  220.0
+ 137.5W / 6:  222.5
+ 135W   / 7:  225.0
+ 132.5W / 8:  227.5
+ 130W   / 9:  230.0
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  255.0  255.8  256.7  257.7  258.9
+ 1.17N / 49:  254.8  255.7  256.5  257.5  258.7
+ 0.83N / 48:  254.7  255.5  256.4  257.4  258.5
+ 0.5N  / 47:  254.5  255.4  256.3  257.2  258.3
+ 0.17N / 46:  254.5  255.3  256.2  257.2  258.1
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 125.5W 121.5W 117.5W 113.5W 
+                1      2      3      4      5
+ 1.5N  / 50:  125.5  129.4  134.5  137.1  141.6
+ 1.17N / 49:  125.3  129.2  134.2  136.9  141.3
+ 0.83N / 48:  125.2  129.0  133.7  136.7  141.0
+ 0.5N  / 47:  125.0  128.8  133.3  136.5  140.6
+ 0.17N / 46:  125.0  128.6  133.0  136.4  140.4
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 125.5W 121.5W 117.5W 113.5W 
+                1      2      3      4      5
+ 1.5N  / 50:  255.0  258.9  264.0  266.6  271.1
+ 1.17N / 49:  254.8  258.7  263.7  266.4  270.8
+ 0.83N / 48:  254.7  258.5  263.2  266.2  270.5
+ 0.5N  / 47:  254.5  258.3  262.8  266.0  270.1
+ 0.17N / 46:  254.5  258.1  262.5  265.9  269.9
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX001)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              168.5E 170.5E 172.5E 174.5E 176.5E 178.5E 
+                1      2      3      4      5      6
+ 1.5N  / 50:  29.22  29.18  28.93  28.67  28.12  27.73
+ 1.17N / 49:  29.25  29.18  28.97  28.71  28.22  27.80
+ 0.83N / 48:  29.27  29.18  28.98  28.72  28.30  27.88
+ 0.5N  / 47:  29.30  29.19  28.98  28.73  28.36  27.95
+ 0.17N / 46:  29.34  29.22  28.99  28.75  28.40  28.01
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              108.5W 106.5W 104.5W 102.5W 100.5W 98.5W  
+                1      2      3      4      5      6
+ 1.5N  / 50:  25.42  25.24  25.05  25.23  25.49  25.81
+ 1.17N / 49:  25.02  24.88  24.74  24.91  25.20  25.55
+ 0.83N / 48:  24.65  24.54  24.42  24.56  24.88  25.25
+ 0.5N  / 47:  24.28  24.20  24.10  24.22  24.52  24.90
+ 0.17N / 46:  23.97  23.90  23.82  23.92  24.19  24.56
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.86  24.34  24.23  24.82  25.60  25.22
+ 1.17N / 49:  24.60  24.15  24.04  24.53  25.22  24.82
+ 0.83N / 48:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.5N  / 47:  24.19  23.89  23.73  23.97  24.36  24.07
+ 0.17N / 46:  24.09  23.85  23.66  23.74  24.03  23.83
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4N   / 4:  26.07  25.76  25.43  25.17  25.18
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 0.5S / 1:  24.07  23.99  23.89  23.79  23.70
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX001)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.86  24.34  24.23  24.82  25.60  25.22
+ 1.17N / 49:  24.60  24.15  24.04  24.53  25.22  24.82
+ 0.83N / 48:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.5N  / 47:  24.19  23.89  23.73  23.97  24.36  24.07
+ 0.17N / 46:  24.09  23.85  23.66  23.74  24.03  23.83
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4N   / 4:  26.07  25.76  25.43  25.17  25.18
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 0.5S / 1:  24.07  23.99  23.89  23.79  23.70
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.0
+ 170E   / 2:  170.0
+ 150W   / 3:  210.0
+ 110W   / 4:  250.0
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.00
+ 2S    / 2:  -2.00
+ 10S   / 1: -10.00
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.00
+ 30   / 2:  30.00
+ 60   / 3:  60.00
+ 90   / 4:  90.00
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.00
+ 30   / 2:  30.00
+ 60   / 3:  60.00
+ 90   / 4:  90.00
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+              1      2      3      4      5      6
+ 2.8N / 4:  25.88  25.10  24.76  25.36  25.95  26.11
+ 1.8N / 3:  25.15  24.52  24.40  25.06  25.84  25.57
+ 0.8N / 2:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.2S / 1:  24.08  23.88  23.69  23.63  23.81  23.67
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+              1      2      3      4      5      6
+ 4N   / 4:  26.31  25.76  25.17  25.42  26.09  26.43
+ 2.5N / 3:  25.69  24.90  24.66  25.33  25.96  26.00
+ 1N   / 2:  24.48  24.08  23.95  24.39  25.00  24.61
+ 0.5S / 1:  24.15  23.99  23.79  23.65  23.71  23.60
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130W   127W   124W   121W   
+              1      2      3      4
+ 2.8N / 4:  25.69  24.79  25.55  26.09
+ 1.8N / 3:  24.96  24.40  25.31  25.68
+ 0.8N / 2:  24.26  23.87  24.41  24.55
+ 0.2S / 1:  24.03  23.73  23.67  23.72
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130W   127W   124W   121W   
+              1      2      3      4
+ 4N   / 4:  26.19  25.30  25.58  26.39
+ 2.5N / 3:  25.48  24.68  25.55  26.02
+ 1N   / 2:  24.36  23.96  24.57  24.77
+ 0.5S / 1:  24.11  23.84  23.66  23.64
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX002)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 138.5W 136.5W 134.5W 132.5W 130.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.93  24.49  25.47  25.95  25.62  24.86
+ 1.17N / 49:  24.82  24.37  25.17  25.83  25.37  24.60
+ 0.83N / 48:  24.69  24.25  24.80  25.67  25.14  24.37
+ 0.5N  / 47:  24.57  24.17  24.47  25.48  24.92  24.19
+ 0.17N / 46:  24.47  24.12  24.28  25.17  24.70  24.09
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 136.5W 132.5W 
+                1      2      3
+ 1.5N  / 50:  24.93  25.47  25.62
+ 1.17N / 49:  24.82  25.17  25.37
+ 0.83N / 48:  24.69  24.80  25.14
+ 0.5N  / 47:  24.57  24.47  24.92
+ 0.17N / 46:  24.47  24.28  24.70
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 136.5W 132.5W 128.5W 
+                1      2      3      4
+ 1.5N  / 50:  24.93  25.47  25.62  24.34
+ 1.17N / 49:  24.82  25.17  25.37  24.15
+ 0.83N / 48:  24.69  24.80  25.14  24.00
+ 0.5N  / 47:  24.57  24.47  24.92  23.89
+ 0.17N / 46:  24.47  24.28  24.70  23.85
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              134.5W 132.5W 130.5W 128.5W 126.5W 124.5W 
+                4      5      6      7      8      9
+ 1.5N  / 50:  25.95  25.62  24.86  24.34  24.23  24.82
+ 1.17N / 49:  25.83  25.37  24.60  24.15  24.04  24.53
+ 0.83N / 48:  25.67  25.14  24.37  24.00  23.86  24.25
+ 0.5N  / 47:  25.48  24.92  24.19  23.89  23.73  23.97
+ 0.17N / 46:  25.17  24.70  24.09  23.85  23.66  23.74
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              135W   132W   129W   126W   
+                1      2      3      4
+ 1.5N  / 50:  25.83  25.43  24.47  24.38
+ 1.17N / 49:  25.67  25.18  24.26  24.17
+ 0.83N / 48:  25.45  24.95  24.09  23.96
+ 0.5N  / 47:  25.23  24.74  23.97  23.79
+ 0.17N / 46:  24.94  24.55  23.91  23.68
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   124W   
+                1      2
+ 1.5N  / 50:  24.70  25.06
+ 1.17N / 49:  24.47  24.74
+ 0.83N / 48:  24.26  24.41
+ 0.5N  / 47:  24.11  24.09
+ 0.17N / 46:  24.02  23.83
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   124W   
+                1      2
+ 1.5N  / 50:  24.70  25.06
+ 1.17N / 49:  24.47  24.74
+ 0.83N / 48:  24.26  24.41
+ 0.5N  / 47:  24.11  24.09
+ 0.17N / 46:  24.02  23.83
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   127W   125W   123W   121W   
+                1      2      3      4      5
+ 1.5N  / 50:  24.54  24.23  24.78  25.17  25.38
+ 1.17N / 49:  24.33  24.04  24.51  24.82  24.99
+ 0.83N / 48:  24.13  23.87  24.23  24.46  24.55
+ 0.5N  / 47:  23.99  23.76  23.98  24.12  24.18
+ 0.17N / 46:  23.92  23.70  23.79  23.86  23.91
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              138W   133W   128W   123W   118W   113W   
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....  24.39  25.17   ....   ....
+ 1.17N / 49:   ....   ....  24.18  24.82   ....   ....
+ 0.83N / 48:   ....   ....  24.00  24.46   ....   ....
+ 0.5N  / 47:   ....   ....  23.87  24.12   ....   ....
+ 0.17N / 46:   ....   ....  23.81  23.86   ....   ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4.8N / 6:  26.37  26.19  26.03  25.93  25.99
+ 3.8N / 5:  26.00  25.68  25.32  25.06  25.09
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 3.8N / 3:  26.00  25.68  25.32  25.06  25.09
+ 1.8N / 2:  24.77  24.52  24.40  24.40  24.62
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 5.8N / 4:  26.63  26.57  26.54  26.56  26.66
+ 3.8N / 3:  26.00  25.68  25.32  25.06  25.09
+ 1.8N / 2:  24.77  24.52  24.40  24.40  24.62
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 7N   / 5:   ....   ....   ....   ....   ....
+ 5N   / 4:  26.41  26.25  26.11  26.03  26.10
+ 3N   / 3:  25.59  25.20  24.91  24.81  24.96
+ 1N   / 2:  24.26  24.09  23.97  23.95  24.08
+ 1S   / 1:   ....   ....   ....   ....   ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 0.5S / 2:  24.07  23.99  23.89  23.79  23.70
+ 3.5S / 1:  25.19  25.15  25.09  25.04  25.03
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 0.5S / 2:  24.07  23.99  23.89  23.79  23.70
+ 3.5S / 1:  25.19  25.15  25.09  25.04  25.03
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 7N   / 5:   ....   ....   ....   ....   ....
+ 5N   / 4:   ....   ....   ....   ....   ....
+ 3N   / 3:  25.54  25.19  24.94  24.83  24.98
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 1S   / 1:  24.28  24.22  24.14  24.07  23.98
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W  63.5W  61.5W 
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40  29.41  29.51
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42  29.45  29.53
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47  29.49  29.55
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53  29.54  29.59
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60  29.59  29.62
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W    66W    62W   
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....  29.35  29.49
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....  29.39  29.51
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....  29.46  29.54
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....  29.55  29.57
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....  29.63  29.61
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX003)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  71.5W  67.5W 
+                1      2      3
+ 1.5N  / 50:   ....   ....  29.50
+ 1.17N / 49:   ....   ....  29.54
+ 0.83N / 48:   ....   ....  29.60
+ 0.5N  / 47:   ....   ....  29.68
+ 0.17N / 46:   ....   ....  29.79
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  71.5W  67.5W  63.5W 
+                1      2      3      4
+ 1.5N  / 50:   ....   ....  29.50  29.41
+ 1.17N / 49:   ....   ....  29.54  29.45
+ 0.83N / 48:   ....   ....  29.60  29.49
+ 0.5N  / 47:   ....   ....  29.68  29.54
+ 0.17N / 46:   ....   ....  29.79  29.59
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               85W    80W    75W    70W    65W    60W    55W    50W    45W   
+                1      2      3      4      5      6      7      8      9
+ 1.5N  / 50:   ....   ....   ....   ....  29.40   ....   ....   ....   ....
+ 1.17N / 49:   ....   ....   ....   ....  29.43   ....   ....   ....   ....
+ 0.83N / 48:   ....   ....   ....   ....  29.47   ....   ....   ....   ....
+ 0.5N  / 47:   ....   ....   ....   ....  29.53   ....   ....   ....   ....
+ 0.17N / 46:   ....   ....   ....   ....  29.59   ....   ....   ....   ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W    66W    62W   
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....  29.35  29.49
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....  29.39  29.51
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....  29.46  29.54
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....  29.55  29.57
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....  29.63  29.61
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W   
+                1      2      3      4      5      6
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    82W    74W   
+                1      2      3
+ 1.5N  / 50:  27.22  27.95   ....
+ 1.17N / 49:  27.11  27.89   ....
+ 0.83N / 48:  26.96  27.76   ....
+ 0.5N  / 47:  26.78  27.56   ....
+ 0.17N / 46:  26.54  27.28   ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    82W    74W    66W   
+                1      2      3      4
+ 1.5N  / 50:  27.22  27.95   ....  29.35
+ 1.17N / 49:  27.11  27.89   ....  29.39
+ 0.83N / 48:  26.96  27.76   ....  29.46
+ 0.5N  / 47:  26.78  27.56   ....  29.55
+ 0.17N / 46:  26.54  27.28   ....  29.63
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               92W    89W    86W    83W    80W    77W   
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....  27.30  27.56  27.85   ....   ....
+ 1.17N / 49:   ....  27.19  27.41  27.77   ....   ....
+ 0.83N / 48:   ....  27.04  27.25  27.64   ....   ....
+ 0.5N  / 47:   ....  26.85  27.09  27.44   ....   ....
+ 0.17N / 46:   ....  26.63  26.90  27.18   ....   ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              101W    95W    89W    83W    77W    71W    65W    59W    53W   
+                1      2      3      4      5      6      7      8      9
+ 1.5N  / 50:   ....   ....  27.30  27.85   ....   ....  29.39   ....   ....
+ 1.17N / 49:   ....   ....  27.19  27.77   ....   ....  29.42   ....   ....
+ 0.83N / 48:   ....   ....  27.04  27.64   ....   ....  29.48   ....   ....
+ 0.5N  / 47:   ....   ....  26.85  27.44   ....   ....  29.55   ....   ....
+ 0.17N / 46:   ....   ....  26.63  27.18   ....   ....  29.62   ....   ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             DEPTH (m): 5
+                      179.5E 
+                       50
+ 15-JAN-1982 00 / 1:  27.85
+ 21-JAN-1982 00 / 2:  27.85
+ 27-JAN-1982 00 / 3:  27.77
+ 02-FEB-1982 00 / 4:  27.90
+ 08-FEB-1982 00 / 5:  27.80
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.85
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX001)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+*** Running test: bn_cdf.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 500
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G002_NXT with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+       FCN_NOR  FCN_REV
+J /  1:  0.6332 -0.6332
+J /  2:  0.6455 -0.6455
+J /  3:  0.4997 -0.4997
+J /  4:  0.2316 -0.2316
+J /  5: -0.0932  0.0932
+J /  6: -0.3952  0.3952
+J /  7: -0.6004  0.6004
+J /  8: -0.6587  0.6587
+J /  9: -0.5556  0.5556
+J / 10: -0.3166  0.3166
+J / 11:  0.0000  0.0000
+J / 12:  0.3166 -0.3166
+J / 13:  0.5556 -0.5556
+J / 14:  0.6587 -0.6587
+J / 15:  0.6004 -0.6004
+J / 16:  0.3952 -0.3952
+J / 17:  0.0932 -0.0932
+J / 18: -0.2316  0.2316
+J / 19: -0.4997  0.4997
+J / 20: -0.6455  0.6455
+J / 21: -0.6332  0.6332
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+              180E   
+               51
+ 8N   / 19:  0.4997
+ 7N   / 18:  0.2316
+ 6N   / 17: -0.0932
+ 5N   / 16: -0.3952
+ 4N   / 15: -0.6004
+ 3N   / 14: -0.6587
+ 2N   / 13: -0.5556
+ 1N   / 12: -0.3166
+ 0    / 11:  0.0000
+ 1S   / 10:  0.3166
+*** Running test: bn_regrid_transforms.jnl
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=@ave]   ! no target grid specified
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,g=w]   ! more than 1 target grid
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  6 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  5 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.17  24.19  24.33  24.69  25.14
+ 1N    / 48:  24.06  24.02  24.01  24.10  24.39  24.79
+ 0.67N / 47:  23.97  23.93  23.90  23.91  24.09  24.43
+ 0.33N / 46:  23.95  23.89  23.84  23.79  23.86  24.10
+ 0     / 45:  24.03  23.95  23.86  23.77  23.74  23.87
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.94  23.91  23.92  24.07  24.44  24.94
+ 1N    / 48:  23.74  23.69  23.69  23.79  24.10  24.54
+ 0.67N / 47:  23.59  23.54  23.52  23.55  23.75  24.13
+ 0.33N / 46:  23.52  23.47  23.42  23.37  23.46  23.73
+ 0     / 45:  23.61  23.53  23.43  23.34  23.30  23.45
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.26  24.41  24.75  25.21  25.50
+ 1N    / 48:  24.06  24.08  24.18  24.45  24.86  25.13
+ 0.67N / 47:  23.98  23.96  24.00  24.16  24.48  24.75
+ 0.33N / 46:  23.96  23.90  23.88  23.93  24.14  24.38
+ 0     / 45:  24.04  23.94  23.85  23.82  23.91  24.09
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.93  23.99  24.14  24.49  25.01  25.36
+ 1N    / 48:  23.73  23.76  23.87  24.15  24.61  24.94
+ 0.67N / 47:  23.60  23.59  23.63  23.81  24.17  24.49
+ 0.33N / 46:  23.54  23.48  23.46  23.52  23.76  24.05
+ 0     / 45:  23.62  23.51  23.42  23.38  23.48  23.69
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.29  24.26  24.28  24.45  24.83  25.29
+ 1N    / 48:  24.13  24.10  24.10  24.22  24.54  24.96
+ 0.67N / 47:  24.01  23.97  23.95  24.01  24.24  24.61
+ 0.33N / 46:  23.96  23.91  23.87  23.85  23.98  24.26
+ 0     / 45:  23.99  23.92  23.85  23.78  23.80  23.98
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.05  24.01  24.03  24.20  24.59  25.10
+ 1N    / 48:  23.84  23.80  23.81  23.93  24.27  24.74
+ 0.67N / 47:  23.66  23.62  23.61  23.67  23.92  24.33
+ 0.33N / 46:  23.55  23.50  23.47  23.46  23.60  23.93
+ 0     / 45:  23.57  23.50  23.43  23.36  23.38  23.59
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.29  24.35  24.52  24.89  25.37  25.65
+ 1N    / 48:  24.13  24.17  24.30  24.60  25.04  25.32
+ 0.67N / 47:  24.02  24.02  24.09  24.30  24.67  24.94
+ 0.33N / 46:  23.97  23.93  23.94  24.05  24.31  24.56
+ 0     / 45:  24.00  23.92  23.87  23.88  24.02  24.23
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.04  24.10  24.26  24.65  25.17  25.52
+ 1N    / 48:  23.83  23.88  24.01  24.32  24.81  25.15
+ 0.67N / 47:  23.66  23.68  23.75  23.98  24.39  24.72
+ 0.33N / 46:  23.57  23.54  23.55  23.66  23.97  24.27
+ 0     / 45:  23.58  23.50  23.44  23.45  23.62  23.87
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  6 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.19  24.18  24.26  24.51  24.91  25.28
+ 1N    / 48:  24.04  24.02  24.06  24.24  24.59  24.92
+ 0.67N / 47:  23.95  23.91  23.90  24.00  24.26  24.54
+ 0.33N / 46:  23.92  23.86  23.81  23.83  23.98  24.21
+ 0     / 45:  23.99  23.91  23.82  23.76  23.80  23.96
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.92  23.91  24.00  24.25  24.69  25.11
+ 1N    / 48:  23.71  23.69  23.74  23.95  24.32  24.70
+ 0.67N / 47:  23.56  23.53  23.53  23.65  23.94  24.27
+ 0.33N / 46:  23.50  23.44  23.40  23.41  23.59  23.87
+ 0     / 45:  23.57  23.48  23.39  23.32  23.37  23.56
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.23  24.33  24.58  24.98  25.36  25.50
+ 1N    / 48:  24.07  24.13  24.32  24.65  25.00  25.12
+ 0.67N / 47:  23.97  23.98  24.08  24.32  24.62  24.74
+ 0.33N / 46:  23.93  23.89  23.91  24.04  24.26  24.40
+ 0     / 45:  23.99  23.90  23.84  23.86  24.00  24.12
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.96  24.06  24.32  24.75  25.18  25.37
+ 1N    / 48:  23.75  23.82  24.01  24.38  24.77  24.95
+ 0.67N / 47:  23.59  23.61  23.72  23.99  24.33  24.51
+ 0.33N / 46:  23.51  23.47  23.49  23.64  23.90  24.09
+ 0     / 45:  23.57  23.47  23.40  23.43  23.58  23.74
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.46  24.80  25.20
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.52  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.01  24.23  24.53
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.21
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.21  24.57  25.01
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.26  24.66
+ 0.67N / 47:  23.67  23.61  23.59  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.44  23.45  23.61  23.88
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.57
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.50  24.78  25.17  25.50  25.60
+ 1N    / 48:  24.18  24.29  24.52  24.86  25.17  25.26
+ 0.67N / 47:  24.04  24.10  24.26  24.53  24.80  24.88
+ 0.33N / 46:  23.96  23.96  24.04  24.22  24.44  24.53
+ 0     / 45:  23.96  23.90  23.90  23.98  24.14  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  24.24  24.54  24.96  25.34  25.48
+ 1N    / 48:  23.89  24.00  24.24  24.62  24.97  25.11
+ 0.67N / 47:  23.69  23.76  23.93  24.24  24.55  24.68
+ 0.33N / 46:  23.56  23.57  23.66  23.87  24.13  24.26
+ 0     / 45:  23.54  23.48  23.48  23.57  23.76  23.89
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.46  24.80  25.20
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.52  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.01  24.23  24.53
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.21
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.21  24.57  25.01
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.26  24.66
+ 0.67N / 47:  23.67  23.61  23.59  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.44  23.45  23.61  23.88
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.57
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.50  24.78  25.17  25.50  25.60
+ 1N    / 48:  24.18  24.29  24.52  24.86  25.17  25.26
+ 0.67N / 47:  24.04  24.10  24.26  24.53  24.80  24.88
+ 0.33N / 46:  23.96  23.96  24.04  24.22  24.44  24.53
+ 0     / 45:  23.96  23.90  23.90  23.98  24.14  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  24.24  24.54  24.96  25.34  25.48
+ 1N    / 48:  23.89  24.00  24.24  24.62  24.97  25.11
+ 0.67N / 47:  23.69  23.76  23.93  24.24  24.55  24.68
+ 0.33N / 46:  23.56  23.57  23.66  23.87  24.13  24.26
+ 0     / 45:  23.54  23.48  23.48  23.57  23.76  23.89
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.33  24.20  24.11  24.11  24.27  24.62
+ 1N    / 48:  24.15  24.05  23.96  23.93  24.03  24.33
+ 0.67N / 47:  24.03  23.94  23.87  23.81  23.83  24.04
+ 0.33N / 46:  23.98  23.90  23.83  23.75  23.71  23.81
+ 0     / 45:  24.03  23.95  23.87  23.77  23.68  23.69
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  23.94  23.85  23.85  24.01  24.37
+ 1N    / 48:  23.86  23.73  23.64  23.61  23.73  24.05
+ 0.67N / 47:  23.66  23.56  23.49  23.43  23.47  23.71
+ 0.33N / 46:  23.56  23.47  23.40  23.32  23.28  23.41
+ 0     / 45:  23.61  23.52  23.44  23.34  23.24  23.24
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.17  24.19  24.33  24.69  25.14
+ 1N    / 48:  24.06  24.02  24.01  24.10  24.39  24.79
+ 0.67N / 47:  23.97  23.93  23.90  23.91  24.09  24.43
+ 0.33N / 46:  23.95  23.89  23.84  23.79  23.86  24.10
+ 0     / 45:  24.03  23.95  23.86  23.77  23.74  23.87
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.94  23.91  23.92  24.07  24.44  24.94
+ 1N    / 48:  23.74  23.69  23.69  23.79  24.10  24.54
+ 0.67N / 47:  23.59  23.54  23.52  23.55  23.75  24.13
+ 0.33N / 46:  23.52  23.47  23.42  23.37  23.46  23.73
+ 0     / 45:  23.61  23.53  23.43  23.34  23.30  23.45
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.37  24.28  24.24  24.31  24.58  25.00
+ 1N    / 48:  24.19  24.11  24.07  24.11  24.33  24.70
+ 0.67N / 47:  24.06  23.98  23.93  23.93  24.07  24.38
+ 0.33N / 46:  23.98  23.92  23.86  23.81  23.86  24.08
+ 0     / 45:  24.00  23.93  23.85  23.77  23.74  23.85
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.15  24.03  23.99  24.07  24.34  24.78
+ 1N    / 48:  23.92  23.82  23.77  23.82  24.05  24.45
+ 0.67N / 47:  23.71  23.63  23.58  23.59  23.75  24.08
+ 0.33N / 46:  23.59  23.51  23.45  23.41  23.48  23.73
+ 0     / 45:  23.58  23.50  23.42  23.34  23.31  23.45
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.30  24.37  24.56  24.94  25.40  25.66
+ 1N    / 48:  24.14  24.19  24.33  24.65  25.07  25.32
+ 0.67N / 47:  24.02  24.04  24.12  24.34  24.70  24.94
+ 0.33N / 46:  23.97  23.94  23.96  24.08  24.34  24.57
+ 0     / 45:  24.00  23.92  23.87  23.90  24.05  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.05  24.12  24.30  24.70  25.21  25.53
+ 1N    / 48:  23.84  23.89  24.04  24.37  24.85  25.16
+ 0.67N / 47:  23.67  23.69  23.78  24.02  24.43  24.72
+ 0.33N / 46:  23.57  23.54  23.57  23.70  24.00  24.28
+ 0     / 45:  23.58  23.50  23.45  23.47  23.64  23.88
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 19 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.23  24.17  24.18  24.33  24.66  25.04
+ 1N    / 48:  24.07  24.01  24.00  24.10  24.37  24.69
+ 0.67N / 47:  23.97  23.91  23.87  23.90  24.08  24.35
+ 0.33N / 46:  23.93  23.86  23.80  23.77  23.86  24.05
+ 0     / 45:  23.99  23.91  23.82  23.74  23.74  23.85
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.98  23.90  23.92  24.08  24.42  24.84
+ 1N    / 48:  23.76  23.69  23.68  23.79  24.08  24.46
+ 0.67N / 47:  23.59  23.53  23.49  23.54  23.75  24.06
+ 0.33N / 46:  23.51  23.44  23.38  23.35  23.46  23.69
+ 0     / 45:  23.57  23.48  23.39  23.30  23.30  23.43
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.24  24.36  24.62  25.02  25.38  25.49
+ 1N    / 48:  24.08  24.16  24.35  24.69  25.01  25.11
+ 0.67N / 47:  23.98  24.00  24.11  24.36  24.63  24.74
+ 0.33N / 46:  23.93  23.90  23.93  24.06  24.28  24.40
+ 0     / 45:  23.98  23.90  23.84  23.88  24.01  24.13
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.98  24.09  24.36  24.80  25.21  25.37
+ 1N    / 48:  23.76  23.84  24.05  24.42  24.80  24.94
+ 0.67N / 47:  23.60  23.63  23.75  24.03  24.35  24.50
+ 0.33N / 46:  23.51  23.48  23.51  23.67  23.93  24.09
+ 0     / 45:  23.56  23.47  23.41  23.45  23.60  23.75
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 20 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.25  24.20  24.29  24.57  24.98
+ 1N    / 48:  24.18  24.08  24.03  24.09  24.31  24.67
+ 0.67N / 47:  24.04  23.96  23.89  23.90  24.06  24.35
+ 0.33N / 46:  23.96  23.89  23.81  23.77  23.85  24.06
+ 0     / 45:  23.97  23.89  23.80  23.73  23.72  23.84
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.14  24.01  23.96  24.05  24.33  24.77
+ 1N    / 48:  23.91  23.79  23.74  23.80  24.04  24.43
+ 0.67N / 47:  23.70  23.60  23.54  23.56  23.74  24.07
+ 0.33N / 46:  23.56  23.48  23.41  23.38  23.47  23.71
+ 0     / 45:  23.54  23.46  23.38  23.30  23.29  23.44
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.97  24.15  24.37  24.63
+ 25-JAN-1982 00 / 3:  23.89  23.98  24.17  24.40  24.65
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.98  24.15  24.38  24.63
+ 25-JAN-1982 00 / 3:  23.88  23.97  24.15  24.39  24.64
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.85  24.02  24.21
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.85  24.02  24.21
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 24 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 25 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.87  24.03  24.23
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 25 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  29.59  29.58  29.58  29.57  29.56
+ 25-JAN-1982 00 / 3:  29.58  29.57  29.57  29.55  29.54
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 26 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  29.57  29.57  29.55  29.53  29.53
+ 25-JAN-1982 00 / 3:  29.56  29.55  29.54  29.51  29.51
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 30 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.78  23.72  23.78  23.91  24.10
+ 25-JAN-1982 00 / 3:  23.77  23.72  23.79  23.92  24.11
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.96  23.95  24.02  24.15  24.32
+ 25-JAN-1982 00 / 3:  23.96  23.96  24.03  24.16  24.34
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 31 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.76  23.87  24.04  24.25
+ 25-JAN-1982 00 / 3:  23.74  23.73  23.82  23.97  24.15
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 32 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 32 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 33 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 35 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 39 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 41 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 40 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 40 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 43 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 45 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 47 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 48 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 49 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 50 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 54 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 62 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 65 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 66 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M: 68 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 4    complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 65 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 75 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M: 81 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 8    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 88 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 88 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 9    complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 41 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 10   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 94 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 95 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 94 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 94 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 95 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 11   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 98 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 99 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 98 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 98 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 99 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:100 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 99 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 12   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 13   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 14   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 15   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:110 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:111 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:112 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:111 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 16   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:113 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:114 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:115 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:114 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:114 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:115 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 17   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 18   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:113 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:118 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:118 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 19   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:121 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:122 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:121 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:121 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:122 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 20   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 21   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:126 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:126 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 22   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M: 43 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 23   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:128 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:129 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:128 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:128 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:129 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 24   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:130 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:130 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:130 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:131 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:130 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 25   complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 26   complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:136 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M:137 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 27   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:140 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:141 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:143 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:144 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 28   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:146 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:148 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:149 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:148 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 29   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:150 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:152 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:153 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:152 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:153 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 30   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:151 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:155 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:150 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:157 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 31   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:151 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:159 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:160 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:159 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 32   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:161 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:163 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:164 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:163 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:163 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:164 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 33   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:166 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:167 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:166 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:161 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:168 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:169 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:168 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 34   complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:170 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 35   complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ found   TEMP     M:142 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 36   complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:175 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:176 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:175 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 37   complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:177 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:177 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:177 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:178 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 38   complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:180 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:181 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:180 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 39   complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  5.000
+ 5.1 / 5:  5.000
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:182 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @SUM
+ found   A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  0.500
+ 5.1 / 5:  4.500
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a1[gx=xoffset at var] ! should be all missing
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @VAR
+ found   A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:184 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  5.000
+ 5.1 / 5:  5.100
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:184 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @SUM
+ found   A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  0.500
+ 5.1 / 5:  5.100
+ 6.1 / 6:  5.400
+ 7.1 / 7:   ....
+list a2[gx=xoffset at var]
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @VAR
+ found   A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  0.09000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:182 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:182 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  10.00  10.00   ....   ....
+ 5.1 / 5:   ....   ....   ....  10.00  10.00   ....   ....
+ 6.1 / 6:   ....   ....   ....   ....   ....   ....   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ found   A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:182 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  0.100  0.900   ....   ....
+ 5.1 / 5:   ....   ....   ....  0.900  8.100   ....   ....
+ 6.1 / 6:   ....   ....   ....   ....   ....   ....   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ found   A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G013)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:183 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:183 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G013)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  10.00  10.10  11.00   ....
+ 5.1 / 5:   ....   ....   ....  10.10  10.20  11.10   ....
+ 6.1 / 6:   ....   ....   ....  11.00  11.10  12.00   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ found   A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:183 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....   0.10   1.01   0.99   ....
+ 5.1 / 5:   ....   ....   ....   1.01  10.20   9.99   ....
+ 6.1 / 6:   ....   ....   ....   0.99   9.99   9.72   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ found   A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1     2.1     3.1     4.1     5.1     6.1     7.1   
+              1       2       3       4       5       6       7
+ 1.1 / 1:    ....    ....    ....    ....    ....    ....    ....
+ 2.1 / 2:    ....    ....    ....    ....    ....    ....    ....
+ 3.1 / 3:    ....    ....    ....    ....    ....    ....    ....
+ 4.1 / 4:    ....    ....    ....    ....    ....    ....    ....
+ 5.1 / 5:    ....    ....    ....    ....  0.0000    ....    ....
+ 6.1 / 6:    ....    ....    ....    ....    ....    ....    ....
+ 7.1 / 7:    ....    ....    ....    ....    ....    ....    ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:185 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:183 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:185 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:183 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:182 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:183 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:182 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.500
+ 6.1 / 6:  6.500
+ 7.1 / 7:   ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:182 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @MIN
+ found   A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @SUM
+ found   A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:   8.85
+ 6.1 / 6:  12.20
+ 7.1 / 7:   1.95
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G013)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:186 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:187 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.500
+ 2   / 2:  1.500
+ 3   / 3:  2.500
+ 4   / 4:  3.500
+ 5   / 5:  5.500
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:187 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:182 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:186 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:184 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:183 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  2.500
+ 4   / 4:   ....
+ 5   / 5:   ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:184 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ found   A5       M:185 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A5       M:183 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.500
+list a5[gx=x5 at max,i=4]
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ found   A5       M:185 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G010)
+    GRID (G010)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G011)           @MAX
+ found   ATIME    M:184 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ regrid  ATIME    M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+*** Running test: bn_axis_limits.jnl
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+*** Running test: bn_movie.jnl
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+*** Running test: bn_ez_order.jnl
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   4.00
+ 2   / 2:   2.00   5.00
+ 3   / 3:   3.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  10.00
+ 2   / 2:   8.00  11.00
+ 3   / 3:   9.00  12.00
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   2.00   8.00
+ 3   / 3:   3.00   9.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  10.00
+ 2   / 2:   5.00  11.00
+ 3   / 3:   6.00  12.00
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   3.00   9.00
+ 3   / 3:   5.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   8.00
+ 2   / 2:   4.00  10.00
+ 3   / 3:   6.00  12.00
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   5.00   6.00
+ 2   / 2:  13.00  14.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:  11.00  12.00
+ 3   / 3:  19.00  20.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   2.00  14.00
+ 3   / 3:   3.00  15.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.00  16.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  10.00  22.00
+ 2   / 2:  11.00  23.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   4.00
+ 2   / 2:   2.00   5.00
+ 3   / 3:   3.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  10.00
+ 2   / 2:   8.00  11.00
+ 3   / 3:   9.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   2.00   8.00
+ 3   / 3:   3.00   9.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  10.00
+ 2   / 2:   5.00  11.00
+ 3   / 3:   6.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   3.00   9.00
+ 3   / 3:   5.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   8.00
+ 2   / 2:   4.00  10.00
+ 3   / 3:   6.00  12.00
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   5.00   6.00
+ 2   / 2:  13.00  14.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:  11.00  12.00
+ 3   / 3:  19.00  20.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   2.00  14.00
+ 3   / 3:   3.00  15.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.00  16.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  10.00  22.00
+ 2   / 2:  11.00  23.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+             1      2    
+             1      2
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....   ....
+ 3   / 3:   ....   ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:   ....   ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.100  0.200
+ 2   / 2:  0.300  0.400
+ ---- K:2 Z:   2
+ 1   / 1:  0.500  0.600
+ 2   / 2:  0.700  0.800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.900  1.000
+ 2   / 2:  1.100  1.200
+ ---- K:2 Z:   2
+ 1   / 1:  1.300  1.400
+ 2   / 2:  1.500  1.600
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.100  0.500
+ 2   / 2:  0.200  0.600
+ ---- K:2 Z:   2
+ 1   / 1:  0.300  0.700
+ 2   / 2:  0.400  0.800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.900  1.300
+ 2   / 2:  1.000  1.400
+ ---- K:2 Z:   2
+ 1   / 1:  1.100  1.500
+ 2   / 2:  1.200  1.600
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.0100  0.0200
+ 2   / 2:  0.0300  0.0400
+ ---- K:2 Z:   2
+ 1   / 1:  0.0500  0.0600
+ 2   / 2:  0.0700  0.0800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.0900  0.1000
+ 2   / 2:  0.1100  0.1200
+ ---- K:2 Z:   2
+ 1   / 1:  0.1300  0.1400
+ 2   / 2:  0.1500  0.1600
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.0100  0.0500
+ 2   / 2:  0.0200  0.0600
+ ---- K:2 Z:   2
+ 1   / 1:  0.0300  0.0700
+ 2   / 2:  0.0400  0.0800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.0900  0.1300
+ 2   / 2:  0.1000  0.1400
+ ---- K:2 Z:   2
+ 1   / 1:  0.1100  0.1500
+ 2   / 2:  0.1200  0.1600
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  2357.
+ 2   / 2:  1457.  2457.
+ ---- K:2 Z:   2
+ 1   / 1:  1367.  2367.
+ 2   / 2:  1467.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  2358.
+ 2   / 2:  1458.  2458.
+ ---- K:2 Z:   2
+ 1   / 1:  1368.  2368.
+ 2   / 2:  1468.  2468.
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- K:2 Z:   2
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- K:2 Z:   2
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  2357.
+ 2   / 2:  1457.  2457.
+ ---- K:2 Z:   2
+ 1   / 1:  1367.  2367.
+ 2   / 2:  1467.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  2358.
+ 2   / 2:  1458.  2458.
+ ---- K:2 Z:   2
+ 1   / 1:  1368.  2368.
+ 2   / 2:  1468.  2468.
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+*** Running test: bn_user.jnl
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+*** Running test: bn_stream.jnl
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:   1.00   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:  11.00  12.00  13.00  14.00  15.00  16.00  17.00  18.00  19.00  20.00
+ 3   / 3:  21.00  22.00  23.00  24.00  25.00  26.00  27.00  28.00  29.00  30.00
+ 4   / 4:  31.00  32.00  33.00  34.00  35.00  36.00  37.00  38.00  39.00  40.00
+ 5   / 5:  41.00  42.00  43.00  44.00  45.00  46.00  47.00  48.00  49.00  50.00
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+            MYV1   MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.00  31.00
+2    /  2:  12.00  32.00
+3    /  3:  13.00  33.00
+4    /  4:  14.00  34.00
+5    /  5:  15.00  35.00
+6    /  6:  16.00  36.00
+7    /  7:  17.00  37.00
+8    /  8:  18.00  38.00
+9    /  9:  19.00  39.00
+10   / 10:  20.00  40.00
+ ---- J:2 Y:   2
+1    /  1:  21.00  41.00
+2    /  2:  22.00  42.00
+3    /  3:  23.00  43.00
+4    /  4:  24.00  44.00
+5    /  5:  25.00  45.00
+6    /  6:  26.00  46.00
+7    /  7:  27.00  47.00
+8    /  8:  28.00  48.00
+9    /  9:  29.00  49.00
+10   / 10:  30.00  50.00
+cancel data stream_data_link.unf
+ 
+*** Running test: bn_mc.jnl
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-JUN-1900 10:25
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  16-JAN-1900 06:00:00  730.485    01-JAN-1900 00:45:27    366
+       2>  15-FEB-1900 16:29:06  730.485    31-JAN-1900 11:14:33    1096.485
+       3>  18-MAR-1900 02:58:12  730.485    02-MAR-1900 21:43:39    1826.97
+       4>  17-APR-1900 13:27:18  730.485    02-APR-1900 08:12:45    2557.455
+       5>  17-MAY-1900 23:56:24  730.485    02-MAY-1900 18:41:51    3287.94
+       6>  17-JUN-1900 10:25:30  730.485    02-JUN-1900 05:10:57    4018.425
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 141W
+                    7S     5S     3S     1S     1N     3N     5N     7N    
+                    42     43     44     45     46     47     48     49
+ 16-JAN-1900 / 1:  27.79  27.20  26.26  25.30  25.97  26.20  26.90  27.02
+ 15-FEB-1900 / 2:  27.63  27.60  26.54  26.15  26.39  26.82  27.16  27.12
+ 18-MAR-1900 / 3:  28.47  27.94  26.96  26.51  26.64  27.12  27.03  27.09
+ 17-APR-1900 / 4:  28.42  28.41  27.53  27.05  27.07  27.50  27.37  27.39
+ 17-MAY-1900 / 5:  28.28  28.38  26.88  26.75  27.07  27.74  27.59  27.46
+ 17-JUN-1900 / 6:  28.22  28.10  27.62  26.85  26.72  27.72  28.12  27.88
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-TIME)
+             LATITUDE : 1S
+      ... listing every   2th point
+                   179W   175W   171W   167W   163W   159W   155W   151W   147W   143W   
+                    81     83     85     87     89     91     93     95     97     99
+ 16-JAN-1900 / 1:  28.86  27.80  27.94  27.85  27.56  27.04  26.56  26.52  26.01  26.02
+ 15-FEB-1900 / 2:  28.29  28.19  27.73  27.45  27.13  26.59  26.74  26.61  26.04  26.48
+ 18-MAR-1900 / 3:  27.83  28.22  27.84  27.64  27.14  27.09  27.43  27.05  27.03  26.67
+ 17-APR-1900 / 4:  28.09  27.69  28.08  28.06  27.74  27.74  27.69  27.17  27.71  27.17
+ 17-MAY-1900 / 5:  28.36  27.89  28.60  28.32  28.01  27.69  27.70  27.53  26.77  27.35
+ 17-JUN-1900 / 6:  28.06  28.44  28.56  28.33  27.99  27.67  27.50  27.57  26.96  27.16
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 01-JAN-1900 00:45 to 02-JUL-1900 15:40
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-JUN-1900 10:25
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  16-JAN-1900 06:00:00  730.485    01-JAN-1900 00:45:27    366
+       2>  15-FEB-1900 16:29:06  1460.97    31-JAN-1900 11:14:33    1096.485
+       3>  17-MAY-1900 23:56:24  2191.455   02-APR-1900 08:12:45    3287.94
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 141W
+                    7S     5S     3S     1S     1N     3N     5N     7N    
+                    42     43     44     45     46     47     48     49
+ 16-JAN-1900 / 1:  27.79  27.20  26.26  25.30  25.97  26.20  26.90  27.02
+ 15-FEB-1900 / 2:  27.63  27.60  26.54  26.15  26.39  26.82  27.16  27.12
+ 17-MAY-1900 / 3:  28.28  28.38  26.88  26.75  27.07  27.74  27.59  27.46
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 1S
+      ... listing every   2th point
+                   179W   175W   171W   167W   163W   159W   155W   151W   147W   143W   
+                    81     83     85     87     89     91     93     95     97     99
+ 16-JAN-1900 / 1:  28.86  27.80  27.94  27.85  27.56  27.04  26.56  26.52  26.01  26.02
+ 15-FEB-1900 / 2:  28.29  28.19  27.73  27.45  27.13  26.59  26.74  26.61  26.04  26.48
+ 17-MAY-1900 / 3:  28.36  27.89  28.60  28.32  28.01  27.69  27.70  27.53  26.77  27.35
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 01-JAN-1900 00:45 to 02-JUL-1900 15:40
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-TIME)
+      ... listing every  11th point
+               21E    43E    65E    87E   109E   131E   153E   175E   163W   141W   119W    97W    75W    53W    31W    9W    13E    
+                1     12     23     34     45     56     67     78     89    100    111    122    133    144    155    166    177
+ ---- L:1 T:   16-JAN-1900 06:00
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77N   / 84:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.94
+ 75N   / 83:   1.55   0.40   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.35
+ 73N   / 82:   3.72   1.55   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   4.51
+ 71N   / 81:   5.09   1.80   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.40   5.68
+ 69N   / 80:   5.45   0.89   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.00   2.27   6.05
+ 67N   / 79:   ....   2.00   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.25   4.31   3.37   5.43
+ 65N   / 78:   0.07   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.23   5.10   4.15   4.65
+ 63N   / 77:   0.51   ....   ....   ....   ....   ....   ....   0.58   ....   ....   ....   ....   ....   0.42   5.96   7.30   ....
+ 61N   / 76:   1.23   ....   ....   ....   ....   ....   ....   0.62  -0.43   6.33   ....   ....   ....   2.13   6.22   8.43   ....
+ 59N   / 75:   2.90   ....   ....   ....   ....   ....  -0.71   1.56   1.83   5.92   ....   ....   ....   2.66   7.40   9.38   ....
+ 57N   / 74:   3.04   ....   ....   ....   ....   ....   0.23   2.22   2.80   5.65   ....   ....   ....   2.95   7.53   9.63   3.05
+ 55N   / 73:   3.20   ....   ....   ....   ....   ....   0.07   3.07   4.14   5.53   ....   ....   ....   1.24   7.46   9.55   2.99
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   1.20   3.30   4.30   6.03   ....   ....   ....   0.11   7.75  10.59   4.00
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   0.81   3.85   4.48   6.59   ....   ....   ....   0.14  10.27  10.16   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   1.94   3.87   5.09   6.85   ....   ....   ....   0.04  11.62  11.20   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   1.90   4.40   6.21   8.03   ....   ....   ....   0.92  12.68  11.99   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   2.16   5.81   7.55   9.23   ....   ....   1.85   3.28  13.78  12.68  11.93
+ 43N   / 67:   ....   ....   ....   ....   ....   2.42   4.14   8.17   9.12  10.53   ....   ....   ....   7.11  14.72  13.34  13.33
+ 41N   / 66:   ....   ....   ....   ....   ....   4.91   9.29  10.83  10.98  11.98   ....   ....   7.16  14.94  15.43  14.06  14.65
+ 39N   / 65:  15.44   ....   ....   ....   ....   8.73  12.17  12.90  12.46  13.51   ....   ....   7.51  18.35  16.21  14.67  14.79
+ 37N   / 64:  16.03   ....   ....   ....   ....  12.58  15.26  14.88  14.03  15.14   ....   ....  10.35  18.97  17.19  15.62  15.35
+ 35N   / 63:  16.25   ....   ....   ....   ....  14.09  17.15  16.14  15.40  16.41  14.05   ....  20.52  19.37  18.18  16.90  15.84
+ 33N   / 62:  16.78   ....   ....   ....   ....  15.13  18.31  17.29  16.95  17.75  14.76   ....  22.12  19.97  19.29  17.05  16.40
+ 31N   / 61:  17.98   ....   ....   ....   ....  19.46  19.24  18.64  18.83  19.02  15.23   ....  21.84  20.85  20.05  16.48   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  20.76  20.55  20.11  20.20  19.82  16.36  17.91  22.49  21.93  20.68  15.08   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  21.32  22.40  22.10  21.59  20.66  17.50  19.77  23.61  22.82  21.51   ....   ....
+ 25N   / 58:   ....   ....  23.69   ....   ....  22.05  23.99  23.35  22.92  21.47  18.62  22.15  24.57  23.69  22.33   ....   ....
+ 23N   / 57:   ....   ....  24.01   ....   ....  23.44  25.10  24.41  23.95  21.77  19.57  22.75  25.42  24.48  22.79   ....   ....
+ 21N   / 56:   ....   ....  24.62  24.90  20.77  24.55  26.33  25.60  24.53  22.80  21.34  22.78  26.17  25.00  22.94   ....   ....
+ 19N   / 55:   ....   ....  24.92  25.43  23.43  25.68  26.87  26.00  25.29  23.48  23.10  23.78  26.77  25.43  23.43   ....   ....
+ 17N   / 54:   ....  25.92  25.39  25.91  23.85  26.60  27.43  26.36  25.60  24.00  24.43  27.24  26.92  25.84  23.83   ....   ....
+ 15N   / 53:   ....  25.71  25.74  26.33  24.40  27.32  27.51  26.64  25.82  24.65  25.72  27.27  26.69  26.20  24.23   ....   ....
+ 13N   / 52:   ....  25.60  26.61  26.85  24.58  27.70  27.71  27.10  26.12  24.93  26.26  26.93  26.52  26.57  24.81   ....   ....
+ 11N   / 51:   ....  25.94  27.23  27.47  25.22  27.87  27.94  27.42  26.76  25.70  26.72  26.92  26.23  26.74  25.39   ....   ....
+ 9N    / 50:   ....   ....  27.37  27.58  25.82  28.02  28.36  27.91  27.43  26.86  26.73  26.86  27.74  26.89  25.90   ....   ....
+ 7N    / 49:   ....   ....  28.06  27.97  25.94  27.92  28.66  28.29  27.72  27.02  26.78  26.82   ....  26.99  26.59   ....   ....
+ 5N    / 48:   ....   ....  27.89  27.96  26.24  28.31  28.61  28.42  27.70  26.90  26.90  27.23   ....  27.23  26.99  28.18   ....
+ 3N    / 47:   ....   ....  28.08  28.15  27.09  28.46  29.05  28.47  27.45  26.20  25.88  26.05   ....   ....  27.05  28.01   ....
+ 1N    / 46:   ....  26.69  28.02  28.23  27.36  28.73  29.25  28.48  27.25  25.97  24.54  25.27   ....   ....  27.05  27.40   ....
+ 1S    / 45:   ....  26.50  28.00  28.31  27.87  28.92  29.43  28.31  27.56  25.30  24.47  24.28   ....  27.35  27.10  26.70   ....
+ 3S    / 44:   ....  27.04  28.07  28.31  28.18  28.93  29.44  29.08  27.84  26.26  24.88  24.33   ....   ....  27.16  26.37   ....
+ 5S    / 43:   ....  27.95  27.90  28.18  28.21  29.02  29.61  29.24  28.14  27.20  25.02  24.53   ....   ....  27.15  26.13  26.84
+ 7S    / 42:   ....  28.51  27.65  28.10  28.31  28.88  29.66  29.33  28.33  27.79  25.58  24.25   ....   ....  27.31  25.63  26.46
+ 9S    / 41:   ....  28.58  28.04  28.43  28.89  28.93  29.51  29.64  29.21  27.79  25.69  24.01   ....   ....  27.23  24.96  26.45
+ 11S   / 40:   ....  28.60  28.00  27.77  28.42  29.60  28.90  29.44  29.11  27.84  25.67  23.42   ....   ....  27.22  24.61  25.88
+ 13S   / 39:   ....  28.57  28.23  27.62  28.18  29.75  29.09  29.05  29.06  27.93  26.09  23.38   ....   ....  27.35  24.05  24.87
+ 15S   / 38:   ....  28.48  27.53  27.33  27.71   ....  28.84  28.98  28.70  28.23  25.90  23.41  19.39   ....  27.01  23.35  23.91
+ 17S   / 37:   ....  28.59  27.32  26.85  26.95   ....  28.49  28.38  28.38  27.84  26.13  22.71  21.99   ....  26.74  23.17   ....
+ 19S   / 36:   ....  28.40  26.80  26.23  26.37   ....  28.10  27.77  27.85  27.47  26.07  23.03  22.74   ....  26.61  23.34  18.44
+ 21S   / 35:   ....  28.57  26.75  25.34  25.47   ....  27.89  27.03  27.43  27.14  25.94  23.55  21.85   ....  26.43  23.76  18.73
+ 23S   / 34:   ....  28.19  26.36  24.88  24.26   ....  27.13  26.05  26.25  26.35  25.90  23.07  20.94   ....  26.55  23.83  18.16
+ 25S   / 33:   ....  27.16  25.70  24.42  23.40   ....  26.44  25.26  25.31  25.42  25.43  23.40  20.04   ....  25.43  23.71  17.48
+ 27S   / 32:   ....  26.11  25.25  23.88  22.40   ....  25.88  24.79  24.22  24.51  24.65  22.98  19.43   ....  24.86  23.99  19.90
+ 29S   / 31:   ....  25.46  24.30  22.60  21.53   ....  25.21  23.45  22.97  23.36  24.06  22.91  19.40   ....  23.41  23.31  20.16
+ 31S   / 30:   ....  24.10  23.48  22.27  20.80   ....  24.35  22.55  21.64  22.21  23.20  22.00  18.67  22.38  22.59  22.86  20.29
+ 33S   / 29:   ....  22.34  21.57  20.47  19.72  19.72  23.23  21.74  20.98  21.33  21.62  21.48  17.87  22.47  20.57  21.02  20.19
+ 35S   / 28:  21.08  21.20  20.15  19.19  18.41  18.12  22.56  20.53  19.55  19.30  19.89  20.78  16.71  22.10  19.94  20.03  19.66
+ 37S   / 27:  21.29  19.84  18.18  17.72  16.53  17.07  20.59  19.73  18.50  18.08  17.53   ....  16.00  20.88  18.64  17.95  18.46
+ 39S   / 26:  20.75  18.19  16.73  15.60  15.24  16.28  19.14  18.72  17.95  16.62  16.96   ....  15.95  19.17  16.74  15.68  17.75
+ 41S   / 25:  16.45  15.86  15.91  14.50  13.63  14.28  17.01  16.25  16.54  15.06  15.15  16.62  15.59  18.18  14.79  13.98  14.15
+ 43S   / 24:  14.37  11.09  13.70  12.70  12.57  12.66  15.82  15.95  15.61  13.65   ....  14.60  14.50  16.34  12.51  11.74  11.67
+ 45S   / 23:   8.49   8.29   9.34  10.39  11.05  11.84  13.89  13.96  14.01  13.24   ....   ....  13.81  14.65  10.51   8.58   8.23
+ 47S   / 22:   6.06   6.47   6.63   8.80   8.71  10.63  12.88  12.94  13.27  11.77   ....   ....  13.27  13.25   8.62   6.47   6.45
+ 49S   / 21:   4.42   4.75   5.05   7.73   7.14   9.54  10.88  10.63  12.28   ....   ....   ....  12.01   9.86   5.30   4.41   4.38
+ 51S   / 20:   1.84   3.26   3.57   5.52   5.39   8.11   9.30   9.77  11.23   ....   ....   8.72  10.74   7.96   3.63   2.21   1.85
+ 53S   / 19:   1.09   2.59   3.32   3.41   3.51   6.69   7.08   8.78   8.40   ....   ....   8.47   9.49   6.99   2.19   1.25   1.27
+ 55S   / 18:   0.65   1.42   2.61   2.72   3.28   5.49   6.32   8.06   6.83   7.20   ....   6.80   8.07   5.89   1.39   1.24   0.92
+ 57S   / 17:   0.41   1.20   2.42   2.73   2.58   4.13   3.83   7.20   4.81   3.67   ....   6.95   7.21   4.44   0.78   0.41   0.53
+ 59S   / 16:   0.62   1.37   1.61   1.79   2.03   2.67   3.39   6.06   3.88   2.15   4.70   5.80   6.27   2.30   0.07   0.19   0.56
+ 61S   / 15:   0.84   1.27   1.31   1.52   1.39   1.62   2.17   4.16   2.25   0.94   3.50   ....   4.23   1.02   0.08   0.07   0.18
+ 63S   / 14:   0.88   0.90   0.57   0.99   0.78   1.06   1.41   2.03   0.50   0.48   1.03   ....   2.28   0.75  -0.33   0.00   0.76
+ 65S   / 13:   0.37  -0.05   0.31   0.34  -0.34   0.27   0.28   0.74   0.16   0.11   0.20   1.89   1.58  -0.17  -0.55  -0.65   0.25
+ 67S   / 12:  -0.67  -0.78   0.19   ....   ....  -0.73   0.05   0.02  -0.05  -1.10   0.39   0.28   0.91   ....  -0.25  -0.52   0.08
+ 69S   / 11:   0.04   ....   ....   ....   ....   ....   ....  -0.47  -0.01   ....  -0.47   0.37   ....   ....   0.50  -0.72   0.43
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....  -0.40  -0.46  -0.23   ....   ....   ....   ....  -1.02  -1.14   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....  -0.11   ....   ....   ....   ....   ....   ....  -1.20   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....   0.28  -0.48   ....   ....   ....   ....   ....  -0.42   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....  -0.04  -0.43   ....   ....   ....   ....   ....  -0.87   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ ---- L:2 T:   15-FEB-1900 16:29
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77N   / 84:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.55
+ 75N   / 83:   2.53   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -1.01   3.64
+ 73N   / 82:   4.10   0.68   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   5.80   4.46
+ 71N   / 81:   4.67   1.60   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.63   5.35
+ 69N   / 80:   4.20   0.07   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.54   5.61
+ 67N   / 79:   ....   0.00   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.58   3.76   1.44   4.70
+ 65N   / 78:  -0.06   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.13   4.46   3.71   4.23
+ 63N   / 77:   0.07   ....   ....   ....   ....   ....   ....   1.80   ....   ....   ....   ....   ....   0.18   5.86   7.46   ....
+ 61N   / 76:   0.48   ....   ....   ....   ....   ....   ....   0.46   1.60   ....   ....   ....   ....   2.43   6.45   8.14   ....
+ 59N   / 75:   1.64   ....   ....   ....   ....   ....  -0.56   0.56   1.64   5.50   ....   ....   ....   3.19   7.08   9.06   ....
+ 57N   / 74:   2.04   ....   ....   ....   ....   ....  -0.10   1.45   1.80   5.04   ....   ....   ....   2.77   7.29   9.20   2.45
+ 55N   / 73:   2.06   ....   ....   ....   ....   ....   0.25   2.58   3.67   5.05   ....   ....   ....   0.68   7.14   9.03   2.18
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   0.40   2.97   3.69   5.80   ....   ....   ....  -0.54   7.59   9.12   2.66
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   1.25   3.29   3.92   6.07   ....   ....   ....  -0.24  10.03   9.66   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   1.30   3.31   4.62   6.48   ....   ....   ....  -0.58  11.39  10.77   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   1.31   3.87   5.82   7.72   ....   ....   ....   0.08  12.22  11.59   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   1.64   5.33   7.19   8.88   ....   ....   2.79   1.94  13.40  12.23  10.75
+ 43N   / 67:   ....   ....   ....   ....   ....   1.56   3.32   7.31   8.72  10.04   ....   ....   ....   6.23  14.22  12.95  12.83
+ 41N   / 66:   ....   ....   ....   ....   ....   4.14   8.12   9.90  10.40  11.47   ....   ....   4.31  14.21  15.00  13.69  14.18
+ 39N   / 65:  15.03   ....   ....   ....   ....   7.72  10.99  12.00  11.82  13.06   ....   ....   6.32  17.51  15.71  14.26  14.35
+ 37N   / 64:  15.32   ....   ....   ....   ....  10.93  13.97  14.02  13.13  14.39   ....   ....   9.22  18.20  16.56  15.23  14.69
+ 35N   / 63:  15.54   ....   ....   ....   ....  12.62  15.99  15.43  14.63  15.87  13.93   ....  20.07  18.58  17.46  16.40  15.09
+ 33N   / 62:  16.01   ....   ....   ....   ....  14.74  17.14  16.36  16.17  16.98  14.72   ....  21.44  19.24  18.55  16.62  15.90
+ 31N   / 61:  15.50   ....   ....   ....   ....  18.77  18.03  17.55  18.01  18.42  15.02   ....  21.21  20.15  19.32  15.77   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  20.05  19.18  19.02  19.57  19.13  16.05  17.31  21.97  21.19  20.04  17.33   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  20.82  21.30  21.41  21.05  20.17  17.29  19.69  23.10  22.32  20.86   ....   ....
+ 25N   / 58:   ....   ....  23.37   ....   ....  21.95  23.08  22.46  22.44  21.17  18.17  21.39  24.11  23.29  21.69   ....   ....
+ 23N   / 57:   ....   ....  23.76   ....   ....  22.77  24.49  24.04  23.57  21.92  19.09  22.31  25.07  23.98  22.17   ....   ....
+ 21N   / 56:   ....   ....  24.43  25.75  19.45  24.07  25.66  24.94  24.16  22.52  21.25  22.64  25.85  24.52  22.62   ....   ....
+ 19N   / 55:   ....   ....  24.81  25.98  22.73  25.39  26.41  25.48  24.88  23.21  22.97  23.66  26.62  24.96  22.76   ....   ....
+ 17N   / 54:   ....  25.77  25.47  26.44  23.56  26.23  26.90  26.12  25.11  23.95  24.19  27.76  26.61  25.31  22.99   ....   ....
+ 15N   / 53:   ....  25.54  26.20  26.79  24.38  27.09  27.10  26.39  25.66  24.45  25.70  27.55  26.32  25.87  23.66   ....   ....
+ 13N   / 52:   ....  25.62  26.40  26.95  24.65  27.47  27.43  26.96  26.33  25.18  26.39  27.20  26.10  26.30  24.16   ....   ....
+ 11N   / 51:   ....  25.85  27.24  27.46  25.41  27.61  27.90  27.24  26.54  25.86  26.16  27.39  26.01  26.49  24.74   ....   ....
+ 9N    / 50:   ....   ....  27.29  27.82  26.12  27.87  28.40  27.97  27.27  26.61  26.77  27.21  26.67  26.73  25.59   ....   ....
+ 7N    / 49:   ....   ....  27.98  28.19  26.26  27.63  28.89  28.31  27.93  27.12  26.51  27.17   ....  27.05  26.62   ....   ....
+ 5N    / 48:   ....   ....  27.92  28.15  26.59  27.78  28.71  28.56  27.42  27.16  26.90  27.57   ....  27.19  26.89  27.82   ....
+ 3N    / 47:   ....   ....  28.32  28.45  27.02  28.09  29.00  28.16  27.30  26.82  26.48  27.02   ....   ....  27.12  28.40   ....
+ 1N    / 46:   ....  26.89  28.19  28.51  27.18  28.28  29.17  28.70  27.15  26.39  26.05  26.63   ....   ....  27.25  27.95   ....
+ 1S    / 45:   ....  26.66  28.39  28.75  27.77  28.45  29.40  29.52  27.13  26.15  25.38  25.66   ....  27.43  27.42  27.48   ....
+ 3S    / 44:   ....  26.93  28.32  28.62  27.85  28.80  29.40  29.04  27.42  26.54  25.63  25.85   ....   ....  27.66  27.23   ....
+ 5S    / 43:   ....  27.72  28.15  28.38  28.05  28.74  29.51  29.48  28.27  27.60  25.88  25.91   ....   ....  27.63  27.00  27.81
+ 7S    / 42:   ....  28.66  28.47  28.45  28.13  28.71  29.63  28.80  28.44  27.63  26.16  25.85   ....   ....  27.74  26.27  27.66
+ 9S    / 41:   ....  28.84  28.14  28.58  28.40  28.74  29.44  28.98  29.00  28.11  26.18  25.20   ....   ....  27.66  26.42  27.63
+ 11S   / 40:   ....  28.78  28.12  28.05  28.39  29.34  29.01  29.20  28.82  27.84  26.23  24.59   ....   ....  27.54  25.65  26.90
+ 13S   / 39:   ....  28.84  28.27  28.01  28.08  29.76  28.97  28.84  28.88  28.33  26.32  24.17   ....   ....  27.33  25.16  26.03
+ 15S   / 38:   ....  28.80  27.97  27.48  27.83   ....  28.85  29.11  28.81  28.16  26.18  24.09  19.26   ....  27.44  24.56  24.02
+ 17S   / 37:   ....  28.65  27.86  26.99  27.58   ....  28.40  28.63  28.75  27.82  26.41  23.86  22.94   ....  27.51  24.62   ....
+ 19S   / 36:   ....  28.60  27.17  26.73  27.12   ....  27.98  28.41  28.14  27.86  26.36  23.99  23.99   ....  27.47  24.44  19.40
+ 21S   / 35:   ....  28.58  26.76  26.08  26.40   ....  27.84  27.29  27.70  27.50  26.32  23.67  22.88   ....  27.04  24.72  19.34
+ 23S   / 34:   ....  28.20  26.74  25.28  25.36   ....  27.18  26.48  27.06  26.64  25.94  24.55  21.74   ....  27.27  24.46  18.59
+ 25S   / 33:   ....  27.40  26.21  24.45  24.08   ....  26.85  25.76  25.77  26.21  25.99  24.70  20.97   ....  26.43  24.28  18.14
+ 27S   / 32:   ....  26.63  25.28  23.90  23.28   ....  26.19  24.74  24.66  25.25  25.33  24.71  20.59   ....  26.09  24.51  20.34
+ 29S   / 31:   ....  25.76  24.80  23.09  22.25   ....  25.61  24.09  23.82  24.13  24.93  23.40  19.74   ....  25.13  24.06  20.71
+ 31S   / 30:   ....  24.68  23.32  22.08  21.23   ....  24.84  22.96  22.38  23.15  23.38  23.17  18.70  22.72  23.63  23.37  20.79
+ 33S   / 29:   ....  23.51  22.22  20.96  20.32  20.89  23.89  22.18  21.60  21.08  22.57  21.93  18.00  23.08  22.62  21.87  20.46
+ 35S   / 28:  20.97  21.71  20.56  20.14  19.00  18.84  23.35  21.09  20.21  20.23  20.75  20.57  18.06  22.52  20.87  20.61  19.90
+ 37S   / 27:  21.72  20.72  18.87  17.47  17.40  17.75  21.59  20.96  19.64  18.50  19.62  20.35  15.97  21.01  19.53  18.35  19.24
+ 39S   / 26:  22.04  19.15  17.06  16.08  15.45  16.92  20.09  19.57  18.36  17.78  18.10  17.13  15.89  20.22  18.21  16.29  16.84
+ 41S   / 25:  17.85  16.22  16.09  14.75  14.16  15.13  18.04  16.76  17.16  16.13   ....   ....  15.35  18.12  16.49  14.76  14.40
+ 43S   / 24:  13.49  11.11  14.98  12.53  12.12  13.91  16.18  16.23  15.86  14.61   ....   ....  14.43  17.59  14.18  12.05  11.00
+ 45S   / 23:   8.38   8.86  10.08  10.48  11.53  12.13  14.32  14.53  14.51  13.91  14.42   ....  13.92  15.47  10.97  10.97   8.87
+ 47S   / 22:   6.72   6.81   7.42  10.57   8.81  10.99  12.94  13.07  13.77  12.05   ....  10.95  13.29  14.48   8.58   6.84   6.47
+ 49S   / 21:   4.89   5.10   4.94   7.05   7.28  10.12  11.23  11.09  12.24   ....   ....   ....  11.62   9.42   7.44   5.11   4.99
+ 51S   / 20:   2.32   3.94   4.26   4.47   5.41   8.32   9.39   9.64  10.91   9.88   ....   ....  10.94   7.71   5.20   3.20   2.24
+ 53S   / 19:   1.67   3.02   4.17   3.51   4.64   6.95   7.65   8.51   9.70   9.24   ....   8.19  10.25   7.31   3.81   1.86   1.46
+ 55S   / 18:   1.33   2.57   3.64   2.67   3.82   5.58   5.95   7.96   8.88   7.36   ....   8.18   8.69   6.56   1.84   1.25   1.05
+ 57S   / 17:   0.98   1.63   3.34   2.49   3.08   4.83   4.86   7.36   5.90   4.51   ....   ....   7.19   4.30   1.71   0.81   1.00
+ 59S   / 16:   1.16   1.61   1.97   1.96   3.52   3.47   2.90   5.87   4.63   2.35   ....   ....   6.40   2.56   1.26   0.87   1.13
+ 61S   / 15:   0.99   1.22   1.48   1.75   1.82   3.70   2.08   4.52   2.76   1.36   ....   5.02   4.46   1.05   0.09   0.28   0.80
+ 63S   / 14:   1.06   1.20   0.88   1.19   1.21   1.49   1.31   3.01   1.19   1.29   2.50   2.70   3.14  -0.02   0.31   0.36   1.16
+ 65S   / 13:   0.67   0.97   0.14   0.48  -0.29   0.51   0.45   1.58   0.22   0.31   0.00   2.30   1.67  -1.01   0.00  -0.22   0.45
+ 67S   / 12:   0.46  -0.56  -0.27  -0.18   ....   ....  -0.71   0.56  -0.16  -0.14  -0.02  -0.25   0.79  -0.75   0.21  -0.29  -0.16
+ 69S   / 11:  -0.34  -1.18   ....   ....   ....   ....   ....   0.15  -0.36   ....  -0.30   0.24   0.15   ....  -0.70  -0.40  -0.59
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....  -0.48  -0.73   ....   ....  -1.56   ....  -1.68  -1.56  -1.23   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....  -0.45  -0.85   ....   ....   ....   ....   ....  -1.48   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....  -0.28  -1.30   ....   ....   ....   ....  -1.30  -1.22   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....  -0.12  -0.61   ....   ....   ....   ....   ....  -1.37   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ ---- L:3 T:   17-MAY-1900 23:56
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   2.50   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.24
+ 77N   / 84:   3.44   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.62
+ 75N   / 83:   2.60  -0.19   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.53   3.73
+ 73N   / 82:   4.44   0.93   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -1.25   4.91
+ 71N   / 81:   5.44   1.28   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.02   ....   0.65   5.77
+ 69N   / 80:   5.98   1.91   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.89   7.03   2.05   6.47
+ 67N   / 79:   ....   3.65   ....   ....   ....   ....   ....   ....   0.00   ....   ....   ....   ....   0.64   6.28   3.36   6.32
+ 65N   / 78:   1.46   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.06   5.57   5.36   6.41
+ 63N   / 77:   3.42   ....   ....   ....   ....   ....   ....   1.17   ....   ....   ....   ....   ....   1.16   6.62   8.23   ....
+ 61N   / 76:   3.42   ....   ....   ....   ....   ....   ....   1.40   ....   6.95   ....   ....   ....   1.92   7.05   8.90   ....
+ 59N   / 75:   5.64   ....   ....   ....   ....   ....   1.24   2.01   3.17   7.27   ....   ....   ....   3.54   7.46  10.04   ....
+ 57N   / 74:   5.98   ....   ....   ....   ....   ....   1.49   3.19   2.81   7.18   ....   ....   ....   3.62   8.23  10.53   9.20
+ 55N   / 73:   8.03   ....   ....   ....   ....   ....   1.62   3.47   4.59   6.91   ....   ....   ....   1.57   8.40  10.75   7.90
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   1.81   3.96   5.09   7.04   ....   ....   ....   1.57   9.22  11.85   6.67
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   2.66   4.24   5.13   7.18   ....   ....   ....   1.42  11.30  11.58   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   2.71   4.28   5.65   7.55   ....   ....   ....   2.48  12.34  12.14   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   2.33   4.82   6.46   8.57   ....   ....   ....   2.61  13.63  13.04   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   3.22   6.02   7.83   9.78   ....   ....   9.42   4.30  14.63  13.75  16.73
+ 43N   / 67:   ....   ....   ....   ....   ....   7.81   5.90   8.16   9.25  10.89   ....   ....   ....   8.71  15.59  14.35  16.30
+ 41N   / 66:   ....   ....   ....   ....   ....  10.50  10.95  11.22  11.32  12.46   ....   ....  12.27  16.30  16.52  15.34  17.74
+ 39N   / 65:  18.31   ....   ....   ....   ....  13.43  13.82  13.51  13.17  13.99   ....   ....  12.90  19.04  17.14  15.93  17.96
+ 37N   / 64:  18.51   ....   ....   ....   ....  15.67  16.44  15.55  14.85  15.36   ....   ....  15.54  19.48  18.09  16.91  17.66
+ 35N   / 63:  18.74   ....   ....   ....   ....  17.00  18.35  17.10  16.64  16.54  14.51   ....  23.23  20.01  19.01  18.12  18.13
+ 33N   / 62:  18.95   ....   ....   ....   ....  18.51  19.07  18.50  18.28  17.75  15.68   ....  24.14  20.84  20.01  18.57  18.76
+ 31N   / 61:  18.70   ....   ....   ....   ....  22.40  20.43  20.12  20.33  19.09  15.68   ....  23.76  21.95  20.61  17.01   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  23.49  22.45  21.81  21.63  19.86  16.89  24.73  24.37  23.02  21.28  16.93   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  23.87  24.26  23.53  23.06  20.86  17.60  24.89  25.10  23.84  21.76   ....   ....
+ 25N   / 58:   ....   ....  28.39   ....   ....  25.27  25.56  24.55  23.81  21.60  18.80  25.35  25.89  24.48  22.46   ....   ....
+ 23N   / 57:   ....   ....  28.65   ....   ....  26.58  26.62  25.52  24.50  22.36  19.71  26.36  26.54  25.14  22.94   ....   ....
+ 21N   / 56:   ....   ....  28.83  29.39  26.76  27.80  27.41  26.06  25.19  22.91  21.44  26.76  27.19  25.58  23.07   ....   ....
+ 19N   / 55:   ....   ....  29.22  29.61  28.15  28.34  27.79  26.54  25.74  23.48  22.90  27.54  27.86  26.09  23.33   ....   ....
+ 17N   / 54:   ....  29.80  29.44  29.73  28.49  28.82  27.95  26.93  26.13  24.08  24.49  29.27  27.68  26.33  23.57   ....   ....
+ 15N   / 53:   ....  29.77  29.65  30.04  28.55  29.03  27.99  27.73  26.09  24.89  26.29  29.49  27.47  26.79  24.06   ....   ....
+ 13N   / 52:   ....  29.69  29.95  29.75  28.71  29.06  28.20  27.78  26.73  25.85  27.20  29.81  27.47  27.12  24.95   ....   ....
+ 11N   / 51:   ....  29.97  29.94  29.60  29.36  29.07  28.38  27.83  27.29  26.67  27.89  29.74  27.62  27.34  25.48   ....   ....
+ 9N    / 50:   ....   ....  29.80  29.56  29.57  29.03  28.63  28.70  27.79  27.19  28.08  29.47  28.21  27.52  26.29   ....   ....
+ 7N    / 49:   ....   ....  29.44  29.27  29.58  29.01  29.16  29.01  27.97  27.46  27.72  28.86   ....  27.65  26.97   ....   ....
+ 5N    / 48:   ....   ....  29.49  29.20  29.56  29.28  29.51  28.54  28.14  27.59  28.06  28.48   ....  27.69  27.47  28.77   ....
+ 3N    / 47:   ....   ....  29.48  29.01  29.60  29.26  29.46  29.15  28.53  27.74  27.54  27.32   ....   ....  27.70  28.57   ....
+ 1N    / 46:   ....  27.75  29.40  29.09  29.47  29.09  29.61  28.21  27.94  27.07  25.99  25.85   ....   ....  27.72  27.75   ....
+ 1S    / 45:   ....  27.98  29.01  29.06  29.68  29.05  29.66  28.52  28.01  26.75  25.74  24.72   ....  27.33  27.79  27.02   ....
+ 3S    / 44:   ....  28.12  29.14  29.10  29.67  28.95  29.61  29.55  28.63  26.88  26.73  25.35   ....   ....  27.96  27.00   ....
+ 5S    / 43:   ....  27.85  28.86  29.07  29.51  28.74  29.52  29.61  28.79  28.38  26.97  26.19   ....   ....  28.09  27.32  26.54
+ 7S    / 42:   ....  27.71  28.45  28.72  29.48  28.72  29.36  29.57  29.12  28.28  27.08  26.18   ....   ....  28.07  26.98  25.82
+ 9S    / 41:   ....  27.87  27.97  27.63  28.73  28.11  28.90  29.18  29.53  28.49  26.99  25.79   ....   ....  27.94  26.30  25.50
+ 11S   / 40:   ....  27.81  28.00  27.38  28.10  28.64  28.05  28.61  29.10  28.43  26.56  25.18   ....   ....  27.57  25.43  25.79
+ 13S   / 39:   ....  27.94  27.18  27.10  27.99  29.05  27.72  28.74  28.96  28.24  26.42  24.34   ....   ....  27.29  24.94  24.81
+ 15S   / 38:   ....  27.83  26.93  26.57  27.38  29.50  27.25  28.28  28.59  28.07  25.96  23.67  17.46   ....  26.88  24.39  22.75
+ 17S   / 37:   ....  27.70  26.71  26.08  26.80   ....  26.71  27.20  28.11  27.66  25.79  23.51  19.35   ....  26.92  23.76   ....
+ 19S   / 36:   ....  27.10  26.01  25.10  26.20   ....  26.20  26.76  27.14  27.37  25.61  23.84  20.54   ....  26.42  23.48  16.80
+ 21S   / 35:   ....  26.34  25.18  24.21  25.65   ....  25.71  25.85  26.28  26.54  25.41  23.07  20.10   ....  26.03  23.58  17.00
+ 23S   / 34:   ....  26.11  24.69  23.62  24.25   ....  24.52  24.66  25.19  25.81  24.83  22.67  19.13   ....  25.05  22.98  16.31
+ 25S   / 33:   ....  24.51  23.80  22.77  23.07   ....  24.19  23.80  23.65  24.54  24.17  22.24  18.81   ....  24.04  22.19  16.07
+ 27S   / 32:   ....  24.08  22.89  21.77  22.23   ....  23.61  23.15  22.86  23.18  23.18  21.65  18.00   ....  23.42  21.29  18.31
+ 29S   / 31:   ....  23.34  21.84  20.41  21.11   ....  23.00  21.48  21.45  21.88  22.51  21.69  18.38   ....  22.25  21.16  18.31
+ 31S   / 30:   ....  21.88  20.68  19.52  19.84   ....  22.47  20.40  20.17  20.49  20.85  20.78  17.35  20.00  21.39  20.66  18.61
+ 33S   / 29:   ....  20.52  19.61  18.03  18.67  17.90  21.21  19.64  19.09  19.00  18.90  18.69  16.23  18.00  19.52  19.04  18.16
+ 35S   / 28:  17.48  19.53  17.57  16.40  17.31  16.86  20.57  18.48  17.67  17.62  18.43  18.43  15.71  17.33  18.21  17.94  17.95
+ 37S   / 27:  19.04  18.81  16.36  14.90  15.83  15.70  18.56  17.52  16.85  16.55  15.83   ....  14.03  17.84  17.41  16.41  17.42
+ 39S   / 26:  19.37  17.10  15.80  13.67  13.97  14.76  17.36  16.24  15.54  15.33  16.30   ....  13.37  16.31  15.92  14.31  15.65
+ 41S   / 25:  17.51  14.46  14.94  13.06  11.90  13.05  16.39  14.31  14.78  13.95  12.76  13.27  12.85  14.97  14.11  13.89  16.27
+ 43S   / 24:  14.87   9.72  14.18  11.37  10.23  11.71  14.48  12.98  13.28  12.56   ....  12.33  12.19  14.04  13.23  13.28   ....
+ 45S   / 23:  14.83   7.24   9.90   ....   7.20  10.50  13.02  10.87  12.17  11.52  11.29  11.52  11.44  12.13   ....  13.60  12.03
+ 47S   / 22:   ....   6.16   6.25   ....   ....   ....  11.26  10.65  11.59  10.45   9.33   ....  10.58  11.17   7.66   ....   ....
+ 49S   / 21:   ....   5.08   4.65   ....   ....   ....   ....   9.53   9.98   9.33   ....   8.10   9.63   7.22   6.68   ....   ....
+ 51S   / 20:   ....   ....   4.39   ....   ....   ....   ....   7.80   ....   9.10   8.30   7.20   8.50   5.53   3.73   ....   ....
+ 53S   / 19:   ....   2.46   ....   ....   ....   ....   ....   7.15   ....   ....   7.20   7.07   9.05   5.30   1.12   ....   ....
+ 55S   / 18:   ....   ....   ....   ....   ....   ....   ....   7.08   ....   ....   ....   6.07   6.83   4.35   1.47   ....   ....
+ 57S   / 17:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   5.40   5.84   4.09   1.00   ....   ....
+ 59S   / 16:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   4.34   0.40  -0.80   ....   ....
+ 61S   / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.62   ....   0.90   ....   ....   ....
+ 63S   / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 65S   / 13:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 67S   / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 69S   / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 
+ 
+*** Running test: bn_negative_t.jnl
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.0000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.00
+ -2   / 5: -12.00
+ 0    / 6: -12.00
+ 2    / 7:  -8.00
+ 4    / 8:   0.00
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -20.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.00
+ -6   / 3: -28.00
+ -4   / 4: -36.00
+ -2   / 5: -40.00
+ 0    / 6: -40.00
+ 2    / 7: -36.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.00
+ -6   / 3: -28.00
+ -4   / 4: -36.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.00
+ -8    /  2: -36.00
+ -6    /  3: -48.00
+ -4    /  4: -56.00
+ -2    /  5: -60.00
+ 0     /  6: -60.00
+ 2     /  7: -56.00
+ 4     /  8: -48.00
+ 6     /  9: -36.00
+ 8     / 10: -20.00
+ 10    / 11:   0.00
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.0000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -6.000
+ 0    / 6: -6.000
+ 2    / 7: -4.000
+ 4    / 8:  0.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+ -4   / 4: -18.00
+ -2   / 5: -20.00
+ 0    / 6: -20.00
+ 2    / 7: -18.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+ -4   / 4: -18.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.00
+ -8    /  2: -18.00
+ -6    /  3: -24.00
+ -4    /  4: -28.00
+ -2    /  5: -30.00
+ 0     /  6: -30.00
+ 2     /  7: -28.00
+ 4     /  8: -24.00
+ 6     /  9: -18.00
+ 8     / 10: -10.00
+ 10    / 11:   0.00
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.000
+ -2   / 5:  0.000
+ 0    / 6:  2.000
+ 2    / 7:  4.000
+ 4    / 8:  6.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+ -4   / 4: -2.000
+ -2   / 5:  0.000
+ 0    / 6:  2.000
+ 2    / 7:  4.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+ -4   / 4: -2.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.00
+ -8    /  2:  -6.00
+ -6    /  3:  -4.00
+ -4    /  4:  -2.00
+ -2    /  5:   0.00
+ 0     /  6:   2.00
+ 2     /  7:   4.00
+ 4     /  8:   6.00
+ 6     /  9:   8.00
+ 8     / 10:  10.00
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.00
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+ 4    / 8:  1.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.000
+ -8    /  2:  1.000
+ -6    /  3:  1.000
+ -4    /  4:  1.000
+ -2    /  5:  1.000
+ 0     /  6:  1.000
+ 2     /  7:  1.000
+ 4     /  8:  1.000
+ 6     /  9:  1.000
+ 8     / 10:  1.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+ 4    / 8:  1.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2:  1.000
+ -6    /  3:  1.000
+ -4    /  4:  1.000
+ -2    /  5:  1.000
+ 0     /  6:  1.000
+ 2     /  7:  1.000
+ 4     /  8:  1.000
+ 6     /  9:  1.000
+ 8     / 10:  1.000
+ 10    / 11:  1.000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.200
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.200
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.200
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.1000
+ -2   / 5:  0.9000
+ 0    / 6:    ....
+ 2    / 7:    ....
+ 4    / 8:    ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:    ....
+ -6   / 3:    ....
+ -4   / 4:  0.1000
+ -2   / 5:  0.9000
+ 0    / 6:    ....
+ 2    / 7:    ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:    ....
+ -8    /  2:    ....
+ -6    /  3:    ....
+ -4    /  4:  0.1000
+ -2    /  5:  0.9000
+ 0     /  6:    ....
+ 2     /  7:    ....
+ 4     /  8:    ....
+ 6     /  9:    ....
+ 8     / 10:    ....
+ 10    / 11:    ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3:   ....
+ -4    /  4: -4.000
+ -2    /  5:   ....
+ 0     /  6:  0.000
+ 2     /  7:   ....
+ 4     /  8:  4.000
+ 6     /  9:   ....
+ 8     / 10:  8.000
+ 10    / 11:   ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.000
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:  8.000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.200
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.000
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:  9.000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.000
+ -2   / 5: -5.000
+ 0    / 6: -4.000
+ 2    / 7: -3.000
+ 4    / 8: -2.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+ -4   / 4: -6.000
+ -2   / 5: -5.000
+ 0    / 6: -4.000
+ 2    / 7: -3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+ -4   / 4: -6.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.000
+ -8    /  2: -8.000
+ -6    /  3: -7.000
+ -4    /  4: -6.000
+ -2    /  5: -5.000
+ 0     /  6: -4.000
+ 2     /  7: -3.000
+ 4     /  8: -2.000
+ 6     /  9: -1.000
+ 8     / 10:  0.000
+ 10    / 11:  1.000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (TIME)
+ 01-JAN-1980 00 /  1: -9.000
+ 02-JAN-1980 00 /  2: -8.000
+ 03-JAN-1980 00 /  3: -7.000
+ 04-JAN-1980 00 /  4: -6.000
+ 05-JAN-1980 00 /  5: -5.000
+ 06-JAN-1980 00 /  6: -4.000
+ 07-JAN-1980 00 /  7: -3.000
+ 08-JAN-1980 00 /  8: -2.000
+ 09-JAN-1980 00 /  9: -1.000
+ 10-JAN-1980 00 / 10:  0.000
+ 11-JAN-1980 00 / 11:  1.000
+ 12-JAN-1980 00 / 12:  2.000
+ 13-JAN-1980 00 / 13:  3.000
+ 14-JAN-1980 00 / 14:  4.000
+ 15-JAN-1980 00 / 15:  5.000
+ 16-JAN-1980 00 / 16:  6.000
+ 17-JAN-1980 00 / 17:  7.000
+ 18-JAN-1980 00 / 18:  8.000
+ 19-JAN-1980 00 / 19:  9.000
+ 20-JAN-1980 00 / 20:   ....
+ 21-JAN-1980 00 / 21:   ....
+ 22-JAN-1980 00 / 22:   ....
+ 23-JAN-1980 00 / 23:   ....
+ 24-JAN-1980 00 / 24:   ....
+ 25-JAN-1980 00 / 25:   ....
+ 26-JAN-1980 00 / 26:   ....
+ 27-JAN-1980 00 / 27:   ....
+ 28-JAN-1980 00 / 28:   ....
+ 29-JAN-1980 00 / 29:   ....
+ 30-JAN-1980 00 / 30:   ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (TIME)
+ 01-JAN-1980 00 /  1: -9.000
+ 02-JAN-1980 00 /  2: -8.000
+ 03-JAN-1980 00 /  3: -7.000
+ 04-JAN-1980 00 /  4: -6.000
+ 05-JAN-1980 00 /  5: -5.000
+ 06-JAN-1980 00 /  6: -4.000
+ 07-JAN-1980 00 /  7: -3.000
+ 08-JAN-1980 00 /  8: -2.000
+ 09-JAN-1980 00 /  9: -1.000
+ 10-JAN-1980 00 / 10:  0.000
+ 11-JAN-1980 00 / 11:  1.000
+ 12-JAN-1980 00 / 12:  2.000
+ 13-JAN-1980 00 / 13:  3.000
+ 14-JAN-1980 00 / 14:  4.000
+ 15-JAN-1980 00 / 15:  5.000
+ 16-JAN-1980 00 / 16:  6.000
+ 17-JAN-1980 00 / 17:  7.000
+ 18-JAN-1980 00 / 18:  8.000
+ 19-JAN-1980 00 / 19:  9.000
+ 20-JAN-1980 00 / 20:   ....
+ 21-JAN-1980 00 / 21:   ....
+ 22-JAN-1980 00 / 22:   ....
+ 23-JAN-1980 00 / 23:   ....
+ 24-JAN-1980 00 / 24:   ....
+ 25-JAN-1980 00 / 25:   ....
+ 26-JAN-1980 00 / 26:   ....
+ 27-JAN-1980 00 / 27:   ....
+ 28-JAN-1980 00 / 28:   ....
+ 29-JAN-1980 00 / 29:   ....
+ 30-JAN-1980 00 / 30:   ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+CANCEL MODE ignore_error
+ 
+*** Running test: bn_xact_regrid.jnl
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+*** Running test: bn_gc_functions.jnl
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+              1      2      3      4    
+              1      2      3      4
+ 0.1  / 1:  1.100  2.100  3.100  4.100
+ 0.2  / 2:  1.200  2.200  3.200  4.200
+ 0.3  / 3:  1.300  2.300  3.300  4.300
+ 0.4  / 4:  1.400  2.400  3.400  4.400
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+              1       2       3       4     
+               1       2       3       4
+ 0.1  / 1:  0.8912  0.8632  0.0416 -0.8183
+ 0.2  / 2:  0.9320  0.8085 -0.0584 -0.8716
+ 0.3  / 3:  0.9636  0.7457 -0.1577 -0.9162
+ 0.4  / 4:  0.9854  0.6755 -0.2555 -0.9516
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.100
+ 2    /  2:  2.100
+ 3    /  3:  3.100
+ 4    /  4:  4.100
+ 5    /  5:  1.200
+ 6    /  6:  2.200
+ 7    /  7:  3.200
+ 8    /  8:  4.200
+ 9    /  9:  1.300
+ 10   / 10:  2.300
+ 11   / 11:  3.300
+ 12   / 12:  4.300
+ 13   / 13:  1.400
+ 14   / 14:  2.400
+ 15   / 15:  3.400
+ 16   / 16:  4.400
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.100
+ 4   / 4:  4.100
+ 5   / 5:  1.200
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+              2      3    
+              2      3
+ 0.2  / 2:  2.200  3.200
+ 0.3  / 3:  2.300  3.300
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.200
+ 2   / 2:  3.200
+ 3   / 3:  2.300
+ 4   / 4:  3.300
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.200
+ 3   / 3:  2.300
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+               1      2      3      4    
+               1      2      3      4
+ 0.01  / 1:  2.210  3.210  2.310  3.310
+ 0.02  / 2:  2.220  3.220  2.320  3.320
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+              1      2      3    
+              1      2      3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.111  2.111  3.111
+ 0.2  / 2:  1.211  2.211  3.211
+ 0.3  / 3:  1.311  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.121  2.121  3.121
+ 0.2  / 2:  1.221  2.221  3.221
+ 0.3  / 3:  1.321  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.131  2.131  3.131
+ 0.2  / 2:  1.231  2.231  3.231
+ 0.3  / 3:  1.331  2.331  3.331
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.112  2.112  3.112
+ 0.2  / 2:  1.212  2.212  3.212
+ 0.3  / 3:  1.312  2.312  3.312
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.122  2.122  3.122
+ 0.2  / 2:  1.222  2.222  3.222
+ 0.3  / 3:  1.322  2.322  3.322
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.132  2.132  3.132
+ 0.2  / 2:  1.232  2.232  3.232
+ 0.3  / 3:  1.332  2.332  3.332
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.113  2.113  3.113
+ 0.2  / 2:  1.213  2.213  3.213
+ 0.3  / 3:  1.313  2.313  3.313
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.123  2.123  3.123
+ 0.2  / 2:  1.223  2.223  3.223
+ 0.3  / 3:  1.323  2.323  3.323
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.133  2.133  3.133
+ 0.2  / 2:  1.233  2.233  3.233
+ 0.3  / 3:  1.333  2.333  3.333
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+              1      2      3    
+              1      2      3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.110  2.110  3.110
+ 0.2  / 2:  1.210  2.210  3.210
+ 0.3  / 3:  1.310  2.310  3.310
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.120  2.120  3.120
+ 0.2  / 2:  1.220  2.220  3.220
+ 0.3  / 3:  1.320  2.320  3.320
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.130  2.130  3.130
+ 0.2  / 2:  1.230  2.230  3.230
+ 0.3  / 3:  1.330  2.330  3.330
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.140  2.140  3.140
+ 0.2  / 2:  1.240  2.240  3.240
+ 0.3  / 3:  1.340  2.340  3.340
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.150  2.150  3.150
+ 0.2  / 2:  1.250  2.250  3.250
+ 0.3  / 3:  1.350  2.350  3.350
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.160  2.160  3.160
+ 0.2  / 2:  1.260  2.260  3.260
+ 0.3  / 3:  1.360  2.360  3.360
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.170  2.170  3.170
+ 0.2  / 2:  1.270  2.270  3.270
+ 0.3  / 3:  1.370  2.370  3.370
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.180  2.180  3.180
+ 0.2  / 2:  1.280  2.280  3.280
+ 0.3  / 3:  1.380  2.380  3.380
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.190  2.190  3.190
+ 0.2  / 2:  1.290  2.290  3.290
+ 0.3  / 3:  1.390  2.390  3.390
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+              1      2      3    
+              1      2      3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.111  2.111  3.111
+ 0.2  / 2:  1.211  2.211  3.211
+ 0.3  / 3:  1.311  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.121  2.121  3.121
+ 0.2  / 2:  1.221  2.221  3.221
+ 0.3  / 3:  1.321  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.131  2.131  3.131
+ 0.2  / 2:  1.231  2.231  3.231
+ 0.3  / 3:  1.331  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.112  2.112  3.112
+ 0.2  / 2:  1.212  2.212  3.212
+ 0.3  / 3:  1.312  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.122  2.122  3.122
+ 0.2  / 2:  1.222  2.222  3.222
+ 0.3  / 3:  1.322  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.132  2.132  3.132
+ 0.2  / 2:  1.232  2.232  3.232
+ 0.3  / 3:  1.332  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.113  2.113  3.113
+ 0.2  / 2:  1.213  2.213  3.213
+ 0.3  / 3:  1.313  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.123  2.123  3.123
+ 0.2  / 2:  1.223  2.223  3.223
+ 0.3  / 3:  1.323  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.133  2.133  3.133
+ 0.2  / 2:  1.233  2.233  3.233
+ 0.3  / 3:  1.333  2.333  3.333
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.232  3.232
+ 0.3  / 3:  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.213  3.213
+ 0.3  / 3:  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.223  3.223
+ 0.3  / 3:  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.233  3.233
+ 0.3  / 3:  2.333  3.333
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.232  3.232
+ 0.3  / 3:  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.213  3.213
+ 0.3  / 3:  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.223  3.223
+ 0.3  / 3:  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.233  3.233
+ 0.3  / 3:  2.333  3.333
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+             -30    -20    -10     0     10     20     30    
+              1      2      3      4      5      6      7
+ 1    / 1:  220.8  252.0  293.5  315.0  293.5  252.0  220.8
+ 3    / 2:  210.7  240.5  280.1  300.6  280.1  240.5  210.7
+ 5    / 3:  199.4  227.6  265.1  284.5  265.1  227.6  199.4
+ 7    / 4:  186.6  213.0  248.0  266.2  248.0  213.0  186.6
+ 9    / 5:  171.8  196.1  228.4  245.1  228.4  196.1  171.8
+ 11   / 6:  154.3  176.1  205.2  220.2  205.2  176.1  154.3
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+             -30    -20    -10     0     10     20     30    
+              1      2      3      4      5      6      7
+ 1    / 1:   15.5   13.5   11.6   10.8   11.6   13.5   15.5
+ 3    / 2:   46.5   40.8   35.0   32.6   35.0   40.8   46.5
+ 5    / 3:   77.9   68.3   58.6   54.6   58.6   68.3   77.9
+ 7    / 4:  109.6   96.0   82.5   76.8   82.5   96.0  109.6
+ 9    / 5:  141.6  124.1  106.5   99.3  106.5  124.1  141.6
+ 11   / 6:  174.0  152.4  130.9  121.9  130.9  152.4  174.0
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+               -30    -20    -10     0     10     20     30    
+                1      2      3      4      5      6      7
+ 0      / 1:   ....   ....   ....   ....   ....   ....   ....
+ 50     / 2:  209.4  236.1  270.5  287.9  270.5  236.1  209.4
+ 100    / 3:  190.5  210.6  233.7  244.3  233.7  210.6  190.5
+ 150    / 4:  167.3  177.9   ....   ....   ....  177.9  167.3
+ 200    / 5:   ....   ....   ....   ....   ....   ....   ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30    -20    -10     0     10     20     30    
+                 1      2      3      4      5      6      7
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....
+ 20     /  2:  219.3  249.3  288.7  308.9  288.7  249.3  219.3
+ 40     /  3:  212.8  240.8  276.9  295.2  276.9  240.8  212.8
+ 60     /  4:  205.8  231.5  264.1  280.0  264.1  231.5  205.8
+ 80     /  5:  198.5  221.4  249.8  263.2  249.8  221.4  198.5
+ 100    /  6:  190.5  210.6  233.7  244.3  233.7  210.6  190.5
+ 120    /  7:  181.8  198.6  215.5  222.3  215.5  198.6  181.8
+ 140    /  8:  172.6  184.9   ....   ....   ....  184.9  172.6
+ 160    /  9:  161.9   ....   ....   ....   ....   ....  161.9
+ 180    / 10:   ....   ....   ....   ....   ....   ....   ....
+ 200    / 11:   ....   ....   ....   ....   ....   ....   ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30    -20    -10     0     10     20     30    
+                 1      2      3      4      5      6      7
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....
+ 20     /  2:  1.146  1.237  1.358  1.421  1.358  1.237  1.146
+ 40     /  3:  1.790  1.972  2.212  2.336  2.212  1.972  1.790
+ 60     /  4:  2.429  2.699  3.058  3.242  3.058  2.699  2.429
+ 80     /  5:  3.066  3.422  3.897  4.141  3.897  3.422  3.066
+ 100    /  6:  3.696  4.141  4.728  5.032  4.728  4.141  3.696
+ 120    /  7:  4.324  4.854  5.553  5.914  5.553  4.854  4.324
+ 140    /  8:  4.949  5.561   ....   ....   ....  5.561  4.949
+ 160    /  9:  5.568   ....   ....   ....   ....   ....  5.568
+ 180    / 10:   ....   ....   ....   ....   ....   ....   ....
+ 200    / 11:   ....   ....   ....   ....   ....   ....   ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  5.568
+ -20   / 2:  5.561
+ -10   / 3:  5.553
+ 0     / 4:  5.914
+ 10    / 5:  5.553
+ 20    / 6:  5.561
+ 30    / 7:  5.568
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  171.8
+ -20   / 2:  196.1
+ -10   / 3:  228.4
+ 0     / 4:  245.1
+ 10    / 5:  228.4
+ 20    / 6:  196.1
+ 30    / 7:  171.8
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:   9.92
+ -20   / 2:  11.20
+ -10   / 3:  12.85
+ 0     / 4:  22.80
+ 10    / 5:  12.85
+ 20    / 6:  11.20
+ 30    / 7:   9.92
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  16.41
+ -20   / 2:  19.65
+ -10   / 3:  22.41
+ 0     / 4:  22.80
+ 10    / 5:  22.41
+ 20    / 6:  19.65
+ 30    / 7:  16.41
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+*** Running test: bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+********File successfully written******
+****Variable defined successfully******
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.2914
+ 14   / 14:  0.6870
+ 15   / 15:  0.4510
+ 16   / 16: -0.1997
+ 17   / 17: -0.6668
+ 18   / 18: -0.5208
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.420
+ 14   / 14:  1.411
+ 15   / 15:  2.061
+ 16   / 16:  1.773
+ 17   / 17:  0.812
+ 18   / 18:  0.061
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.6935
+ 12   / 12: -0.3721
+ 13   / 13:  0.2914
+ 14   / 14:  0.6870
+ 15   / 15:  0.4510
+ 16   / 16: -0.1997
+ 17   / 17: -0.6668
+ 18   / 18: -0.5208
+ 19   / 19:  0.1039
+ 20   / 20:  0.6332
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -1.000
+ 12   / 12: -1.537
+ 13   / 13: -1.116
+ 14   / 14: -0.126
+ 15   / 15:  0.524
+ 16   / 16:  0.237
+ 17   / 17: -0.725
+ 18   / 18: -1.476
+ 19   / 19: -1.326
+ 20   / 20: -0.413
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3:   ....
+ -4    /  4: -4.000
+ -2    /  5:   ....
+ 0     /  6:  0.000
+ 2     /  7:   ....
+ 4     /  8:  4.000
+ 6     /  9:   ....
+ 8     / 10:  8.000
+ 10    / 11:   ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.00
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.5W 135.5W 135.4W 135.4W 135.3W 135.3W 135.3W 135.2W 135.2W 135.1W 135.1W 135.1W 
+                    1      4      7     10     13     16     19     22     25     28     31     34
+ 59.4667N / 127:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4599N / 126:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.453N  / 125:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4462N / 124:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.976   ....
+ 59.4394N / 123:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4325N / 122:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4257N / 121:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4189N / 120:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.412N  / 119:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.4052N / 118:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3983N / 117:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3915N / 116:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3846N / 115:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.976   ....   ....
+ 59.3778N / 114:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3709N / 113:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3641N / 112:   ....   ....   ....   ....   ....   ....   ....   ....  2.986   ....   ....   ....
+ 59.3572N / 111:   ....   ....   ....   ....   ....   ....   ....   ....  2.988   ....   ....   ....
+ 59.3504N / 110:   ....   ....   ....   ....   ....   ....   ....   ....  2.988   ....   ....   ....
+ 59.3435N / 109:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3366N / 108:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3298N / 107:   ....   ....   ....   ....   ....   ....   ....  2.986   ....   ....   ....   ....
+ 59.3229N / 106:   ....   ....   ....   ....  2.990   ....   ....  2.987   ....   ....   ....   ....
+ 59.3161N / 105:   ....   ....   ....   ....  2.989   ....   ....  2.986   ....   ....   ....   ....
+ 59.3092N / 104:   ....   ....   ....   ....  2.988   ....  2.984  2.985   ....   ....   ....   ....
+ 59.3023N / 103:   ....   ....   ....   ....   ....  2.984  2.983  2.984   ....   ....   ....   ....
+ 59.2955N / 102:   ....   ....   ....   ....   ....  2.983   ....  2.983   ....   ....   ....   ....
+ 59.2886N / 101:   ....  2.999   ....   ....   ....  2.983  2.981  2.981   ....   ....   ....   ....
+ 59.2817N / 100:   ....   ....  2.990   ....   ....   ....  2.981   ....   ....   ....   ....   ....
+ 59.2748N /  99:   ....   ....  2.991   ....   ....  2.985  2.980   ....   ....   ....   ....   ....
+ 59.268N  /  98:   ....   ....  2.993   ....   ....  2.985  2.980   ....   ....   ....   ....   ....
+ 59.2611N /  97:   ....   ....  2.996   ....   ....   ....  2.980   ....   ....   ....   ....   ....
+ 59.2542N /  96:   ....   ....  2.996  3.001   ....   ....  2.981   ....   ....   ....   ....   ....
+ 59.2473N /  95:   ....   ....  2.996  2.999   ....  2.984  2.987   ....   ....   ....   ....   ....
+ 59.2405N /  94:   ....   ....   ....  2.998   ....  2.986  2.993   ....   ....   ....   ....   ....
+ 59.2336N /  93:   ....   ....   ....  2.996  2.996  2.986  2.993   ....   ....   ....   ....   ....
+ 59.2267N /  92:   ....   ....   ....  2.994  2.995   ....  2.996  2.996   ....   ....   ....   ....
+ 59.2198N /  91:   ....   ....   ....  2.992  2.993   ....  2.996  2.997   ....   ....   ....   ....
+ 59.2129N /  90:   ....   ....   ....  2.990  2.992   ....  2.996  2.998   ....   ....   ....   ....
+ 59.2061N /  89:   ....   ....   ....  2.990  2.992   ....  2.994  2.997   ....   ....   ....   ....
+ 59.1992N /  88:   ....   ....   ....  2.990  2.992   ....   ....  2.994   ....   ....   ....   ....
+ 59.1923N /  87:   ....   ....   ....   ....  2.992   ....   ....  2.990   ....   ....   ....   ....
+ 59.1854N /  86:   ....   ....   ....   ....  2.995   ....   ....  2.990   ....   ....   ....   ....
+ 59.1785N /  85:   ....   ....   ....  2.993  2.997  2.999   ....  2.990   ....   ....   ....   ....
+ 59.1716N /  84:   ....   ....   ....  2.994  2.998   ....   ....  2.991   ....   ....   ....   ....
+ 59.1647N /  83:   ....   ....   ....  2.996  2.998  3.005   ....  2.991   ....   ....   ....   ....
+ 59.1578N /  82:   ....   ....   ....  2.996  2.998   ....   ....  2.993   ....   ....   ....   ....
+ 59.1509N /  81:   ....   ....   ....  2.996  2.999   ....  2.995  2.994   ....   ....   ....   ....
+ 59.144N  /  80:   ....   ....   ....   ....  3.000   ....  2.996  2.994   ....   ....   ....   ....
+ 59.1371N /  79:   ....   ....   ....   ....  3.000   ....  2.996  2.994   ....   ....   ....   ....
+ 59.1302N /  78:   ....   ....   ....   ....  3.001   ....  2.998  2.995   ....   ....   ....   ....
+ 59.1233N /  77:   ....   ....   ....   ....  3.002   ....  3.000  2.996   ....   ....   ....   ....
+ 59.1164N /  76:   ....   ....   ....   ....  3.004   ....  3.001  2.997   ....   ....   ....   ....
+ 59.1095N /  75:   ....   ....   ....   ....   ....  3.003  3.003  2.998   ....   ....   ....   ....
+ 59.1026N /  74:   ....   ....   ....   ....   ....  3.002   ....  2.998   ....   ....   ....   ....
+ 59.0957N /  73:   ....   ....   ....   ....  2.996  3.000   ....  3.000   ....   ....   ....   ....
+ 59.0888N /  72:   ....   ....   ....   ....  2.996  3.000   ....  3.001   ....   ....   ....   ....
+ 59.0819N /  71:   ....   ....   ....   ....  2.997  3.001  3.004  3.001   ....   ....   ....   ....
+ 59.075N  /  70:   ....   ....   ....   ....  2.998  3.001  3.003  3.001   ....   ....   ....   ....
+ 59.0681N /  69:   ....   ....   ....   ....  2.999  3.001  3.001  3.001   ....   ....   ....   ....
+ 59.0612N /  68:   ....   ....   ....   ....  2.999  3.000   ....  2.998   ....   ....   ....   ....
+ 59.0542N /  67:   ....   ....   ....   ....  2.998  2.998   ....  2.995   ....   ....   ....   ....
+ 59.0473N /  66:   ....   ....   ....   ....  2.998  2.996   ....  2.993   ....   ....   ....   ....
+ 59.0404N /  65:   ....   ....   ....   ....  2.998  2.996  2.994  2.991   ....   ....   ....   ....
+ 59.0335N /  64:   ....   ....   ....  2.998  2.998  2.995  2.993  2.988   ....   ....   ....   ....
+ 59.0266N /  63:   ....   ....   ....  2.998   ....  2.994  2.990  2.986   ....   ....   ....   ....
+ 59.0196N /  62:   ....   ....   ....  2.997   ....  2.993   ....  2.983   ....   ....   ....   ....
+ 59.0127N /  61:   ....   ....   ....  2.996   ....  2.992  2.986  2.980   ....   ....   ....   ....
+ 59.0058N /  60:   ....   ....   ....  2.994   ....  2.991  2.986  2.977   ....   ....   ....   ....
+ 58.9989N /  59:   ....   ....   ....  2.995   ....  2.991  2.986  2.977   ....   ....   ....   ....
+ 58.9919N /  58:   ....   ....   ....  2.998   ....  2.991  2.985  2.977   ....   ....   ....   ....
+ 58.985N  /  57:   ....   ....   ....  3.000   ....  2.990  2.984  2.977   ....   ....   ....   ....
+ 58.9781N /  56:   ....   ....   ....  3.001   ....  2.989  2.982  2.977   ....   ....   ....   ....
+ 58.9711N /  55:   ....   ....   ....  3.000   ....  2.988  2.977  2.976   ....   ....   ....   ....
+ 58.9642N /  54:   ....   ....   ....  2.999   ....  2.987  2.978  2.972   ....   ....   ....   ....
+ 58.9573N /  53:   ....   ....   ....  2.997   ....  2.987  2.978  2.965   ....   ....   ....   ....
+ 58.9503N /  52:   ....   ....   ....  2.996  2.992  2.987  2.978  2.967   ....   ....   ....   ....
+ 58.9434N /  51:   ....   ....   ....  2.996  2.992  2.987  2.977  2.968   ....   ....   ....   ....
+ 58.9365N /  50:   ....   ....   ....  2.998  2.993  2.986  2.977   ....   ....   ....   ....   ....
+ 58.9295N /  49:   ....   ....   ....   ....  2.992  2.986  2.976   ....   ....   ....   ....   ....
+ 58.9226N /  48:   ....   ....   ....   ....  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.9156N /  47:   ....   ....   ....  2.995  2.994  2.985  2.975   ....   ....   ....   ....   ....
+ 58.9087N /  46:   ....   ....   ....  2.995  2.994  2.985  2.975   ....   ....   ....   ....   ....
+ 58.9017N /  45:   ....   ....   ....  2.995  2.993  2.985  2.975   ....   ....   ....   ....   ....
+ 58.8948N /  44:   ....   ....   ....  2.995  2.992  2.985  2.975   ....   ....   ....   ....   ....
+ 58.8878N /  43:   ....   ....   ....  2.996  2.992  2.985  2.976   ....   ....   ....   ....   ....
+ 58.8809N /  42:   ....   ....   ....  2.997  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.8739N /  41:   ....   ....   ....  2.997  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.867N  /  40:   ....   ....   ....  2.997  2.993  2.985  2.974   ....   ....   ....   ....   ....
+ 58.86N   /  39:   ....   ....   ....  2.998  2.994  2.985  2.972   ....   ....   ....   ....   ....
+ 58.8531N /  38:   ....   ....   ....  2.998  2.994  2.986  2.968   ....   ....   ....   ....   ....
+ 58.8461N /  37:   ....   ....   ....  2.999  2.994  2.986  2.966   ....   ....   ....   ....   ....
+ 58.8392N /  36:   ....   ....   ....  2.999  2.994  2.985  2.968   ....   ....   ....   ....   ....
+ 58.8322N /  35:   ....   ....   ....   ....  2.993  2.984  2.971   ....   ....   ....   ....   ....
+ 58.8252N /  34:   ....   ....   ....   ....  2.993  2.982  2.969   ....   ....   ....   ....   ....
+ 58.8183N /  33:   ....   ....   ....   ....  2.991  2.982  2.968   ....   ....   ....   ....   ....
+ 58.8113N /  32:   ....   ....   ....   ....  2.991  2.982  2.969   ....   ....   ....  2.934  2.923
+ 58.8043N /  31:   ....   ....   ....   ....  2.993  2.983  2.968   ....   ....   ....  2.935   ....
+ 58.7974N /  30:   ....   ....   ....  3.002  2.993  2.982  2.966  2.948   ....   ....  2.935   ....
+ 58.7904N /  29:   ....   ....   ....   ....  2.991  2.981  2.966  2.948   ....   ....   ....   ....
+ 58.7834N /  28:   ....   ....   ....   ....  2.991  2.980  2.965  2.946   ....   ....  2.964   ....
+ 58.7765N /  27:   ....   ....   ....   ....  2.990  2.977  2.963  2.949   ....   ....  2.959   ....
+ 58.7695N /  26:   ....   ....   ....   ....  2.989  2.979  2.965  2.954   ....  2.948  2.957   ....
+ 58.7625N /  25:   ....   ....   ....   ....  2.988  2.982  2.969  2.960   ....  2.952  2.955   ....
+ 58.7555N /  24:   ....   ....   ....   ....  2.988  2.982  2.969  2.963   ....  2.954  2.953   ....
+ 58.7486N /  23:   ....   ....   ....  2.987  2.986  2.979  2.968  2.961   ....  2.954  2.951   ....
+ 58.7416N /  22:   ....   ....   ....  2.985  2.985  2.977  2.967  2.959   ....  2.953  2.946   ....
+ 58.7346N /  21:   ....   ....   ....  2.984  2.983  2.975  2.965  2.958  2.952  2.949  2.945   ....
+ 58.7276N /  20:   ....   ....   ....   ....  2.982  2.972  2.963  2.956  2.951  2.946  2.942   ....
+ 58.7206N /  19:   ....   ....   ....   ....  2.980  2.969  2.962  2.956  2.951  2.945   ....   ....
+ 58.7137N /  18:   ....   ....   ....   ....  2.979  2.971  2.963  2.954  2.949  2.944   ....   ....
+ 58.7067N /  17:   ....   ....   ....   ....  2.978  2.974  2.964  2.953  2.947  2.946   ....   ....
+ 58.6997N /  16:   ....   ....   ....   ....  2.977  2.974  2.965  2.952  2.945  2.946   ....   ....
+ 58.6927N /  15:   ....   ....   ....   ....  2.978  2.974  2.965  2.951  2.944  2.947   ....   ....
+ 58.6857N /  14:   ....   ....   ....   ....  2.980  2.974  2.966  2.948  2.944  2.947   ....   ....
+ 58.6787N /  13:   ....   ....   ....   ....  2.980  2.975  2.969  2.952  2.945  2.949   ....   ....
+ 58.6717N /  12:   ....   ....   ....   ....  2.982  2.976  2.968  2.956  2.944  2.952   ....   ....
+ 58.6647N /  11:   ....   ....   ....   ....  2.983  2.978  2.965  2.949   ....  2.952   ....   ....
+ 58.6577N /  10:   ....   ....   ....   ....  2.982  2.979  2.966  2.945   ....   ....   ....   ....
+ 58.6507N /   9:   ....   ....   ....  2.982  2.980  2.975  2.971  2.953   ....   ....   ....   ....
+ 58.6437N /   8:   ....   ....   ....   ....  2.980  2.971  2.972  2.959   ....   ....   ....   ....
+ 58.6367N /   7:   ....   ....   ....   ....  2.982  2.975  2.968  2.960   ....   ....   ....   ....
+ 58.6297N /   6:   ....   ....   ....   ....  2.981  2.977  2.969  2.963  2.949   ....   ....   ....
+ 58.6227N /   5:   ....   ....   ....   ....  2.982  2.977  2.971  2.962  2.952   ....   ....   ....
+ 58.6157N /   4:   ....   ....   ....   ....  2.970  2.968  2.965  2.957  2.951   ....   ....   ....
+ 58.6087N /   3:   ....   ....   ....   ....  2.953  2.951  2.944  2.961  2.946   ....   ....   ....
+ 58.6017N /   2:   ....   ....   ....   ....  2.940  2.940  2.940  2.940  2.940   ....   ....   ....
+ 58.5947N /   1:   ....   ....   ....   ....  2.940  2.940  2.940  2.940  2.940   ....   ....   ....
+ 
+*** Running test: bn_odd_variable_name.jnl
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.0416
+ 2    /  2: -0.0584
+ 3    /  3: -0.1577
+ 4    /  4: -0.2555
+ 5    /  5: -0.3508
+ 6    /  6: -0.4425
+ 7    /  7: -0.5298
+ 8    /  8: -0.6119
+ 9    /  9: -0.6878
+ 10   / 10: -0.7568
+ 11   / 11: -0.8183
+ 12   / 12: -0.8716
+ 13   / 13: -0.9162
+ 14   / 14: -0.9516
+ 15   / 15: -0.9775
+ 16   / 16: -0.9937
+ 17   / 17: -0.9999
+ 18   / 18: -0.9962
+ 19   / 19: -0.9825
+ 20   / 20: -0.9589
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8912
+ 2    /  2:  0.9320
+ 3    /  3:  0.9636
+ 4    /  4:  0.9854
+ 5    /  5:  0.9975
+ 6    /  6:  0.9996
+ 7    /  7:  0.9917
+ 8    /  8:  0.9738
+ 9    /  9:  0.9463
+ 10   / 10:  0.9093
+ 11   / 11:  0.8632
+ 12   / 12:  0.8085
+ 13   / 13:  0.7457
+ 14   / 14:  0.6755
+ 15   / 15:  0.5985
+ 16   / 16:  0.5155
+ 17   / 17:  0.4274
+ 18   / 18:  0.3350
+ 19   / 19:  0.2392
+ 20   / 20:  0.1411
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8632
+ 2    /  2:  0.8085
+ 3    /  3:  0.7457
+ 4    /  4:  0.6755
+ 5    /  5:  0.5985
+ 6    /  6:  0.5155
+ 7    /  7:  0.4274
+ 8    /  8:  0.3350
+ 9    /  9:  0.2392
+ 10   / 10:  0.1411
+ 11   / 11:  0.0416
+ 12   / 12: -0.0584
+ 13   / 13: -0.1577
+ 14   / 14: -0.2555
+ 15   / 15: -0.3508
+ 16   / 16: -0.4425
+ 17   / 17: -0.5298
+ 18   / 18: -0.6119
+ 19   / 19: -0.6878
+ 20   / 20: -0.7568
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.9258
+ 2    /  2: -0.8835
+ 3    /  3: -0.8323
+ 4    /  4: -0.7728
+ 5    /  5: -0.7055
+ 6    /  6: -0.6313
+ 7    /  7: -0.5507
+ 8    /  8: -0.4646
+ 9    /  9: -0.3739
+ 10   / 10: -0.2794
+ 11   / 11: -0.1822
+ 12   / 12: -0.0831
+ 13   / 13:  0.0168
+ 14   / 14:  0.1165
+ 15   / 15:  0.2151
+ 16   / 16:  0.3115
+ 17   / 17:  0.4048
+ 18   / 18:  0.4941
+ 19   / 19:  0.5784
+ 20   / 20:  0.6570
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.8183
+ 2    /  2: -0.8716
+ 3    /  3: -0.9162
+ 4    /  4: -0.9516
+ 5    /  5: -0.9775
+ 6    /  6: -0.9937
+ 7    /  7: -0.9999
+ 8    /  8: -0.9962
+ 9    /  9: -0.9825
+ 10   / 10: -0.9589
+ 11   / 11: -0.9258
+ 12   / 12: -0.8835
+ 13   / 13: -0.8323
+ 14   / 14: -0.7728
+ 15   / 15: -0.7055
+ 16   / 16: -0.6313
+ 17   / 17: -0.5507
+ 18   / 18: -0.4646
+ 19   / 19: -0.3739
+ 20   / 20: -0.2794
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.850
+ 2    /  2: -0.990
+ 3    /  3: -1.121
+ 4    /  4: -1.241
+ 5    /  5: -1.348
+ 6    /  6: -1.442
+ 7    /  7: -1.522
+ 8    /  8: -1.586
+ 9    /  9: -1.634
+ 10   / 10: -1.666
+ 11   / 11: -1.681
+ 12   / 12: -1.680
+ 13   / 13: -1.662
+ 14   / 14: -1.627
+ 15   / 15: -1.576
+ 16   / 16: -1.509
+ 17   / 17: -1.427
+ 18   / 18: -1.331
+ 19   / 19: -1.222
+ 20   / 20: -1.100
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.7303
+ 7    /  7: -0.7363
+ 8    /  8: -0.7327
+ 9    /  9: -0.7196
+ 10   / 10: -0.6970
+ 11   / 11: -0.6653
+ 12   / 12: -0.6247
+ 13   / 13: -0.5757
+ 14   / 14: -0.5187
+ 15   / 15: -0.4543
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.4410
+ 7    /  7: -0.5281
+ 8    /  8: -0.6098
+ 9    /  9: -0.6855
+ 10   / 10: -0.7543
+ 11   / 11: -0.8156
+ 12   / 12: -0.8687
+ 13   / 13: -0.9131
+ 14   / 14: -0.9484
+ 15   / 15: -0.9743
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.9962
+ 7    /  7:  0.9884
+ 8    /  8:  0.9706
+ 9    /  9:  0.9431
+ 10   / 10:  0.9063
+ 11   / 11:  0.8603
+ 12   / 12:  0.8058
+ 13   / 13:  0.7432
+ 14   / 14:  0.6732
+ 15   / 15:  0.5965
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.254
+ 2    /  2:  0.221
+ 3    /  3:  0.200
+ 4    /  4:  0.192
+ 5    /  5:  0.201
+ 6    /  6:  0.231
+ 7    /  7:  0.289
+ 8    /  8:  0.391
+ 9    /  9:  0.580
+ 10   / 10:  1.021
+ 11   / 11:  3.455
+ 12   / 12: -2.307
+ 13   / 13: -0.726
+ 14   / 14: -0.317
+ 15   / 15: -0.092
+ 16   / 16:  0.073
+ 17   / 17:  0.213
+ 18   / 18:  0.343
+ 19   / 19:  0.467
+ 20   / 20:  0.589
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.04158
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.9996
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.07998
+ 6    /  6: -0.08555
+ 7    /  7: -0.09026
+ 8    /  8: -0.09407
+ 9    /  9: -0.09693
+ 10   / 10: -0.09883
+ 11   / 11: -0.09975
+ 12   / 12: -0.09966
+ 13   / 13: -0.09858
+ 14   / 14: -0.09652
+ 15   / 15: -0.09349
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+*** Running test: bn_test_stream.jnl
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- L:2 T:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:3 T:   3
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:4 T:   4
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  26.00
+ 2   / 2:  27.00  28.00
+ 3   / 3:  29.00  30.00
+ ---- L:2 T:   2
+ 1   / 1:  31.00  32.00
+ 2   / 2:  33.00  34.00
+ 3   / 3:  35.00  36.00
+ ---- L:3 T:   3
+ 1   / 1:  37.00  38.00
+ 2   / 2:  39.00  40.00
+ 3   / 3:  41.00  42.00
+ ---- L:4 T:   4
+ 1   / 1:  43.00  44.00
+ 2   / 2:  45.00  46.00
+ 3   / 3:  47.00  48.00
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- L:2 T:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:3 T:   3
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:4 T:   4
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  26.00
+ 2   / 2:  27.00  28.00
+ 3   / 3:  29.00  30.00
+ ---- L:2 T:   2
+ 1   / 1:  31.00  32.00
+ 2   / 2:  33.00  34.00
+ 3   / 3:  35.00  36.00
+ ---- L:3 T:   3
+ 1   / 1:  37.00  38.00
+ 2   / 2:  39.00  40.00
+ 3   / 3:  41.00  42.00
+ ---- L:4 T:   4
+ 1   / 1:  43.00  44.00
+ 2   / 2:  45.00  46.00
+ 3   / 3:  47.00  48.00
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- L:3 T:   3
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:4 T:   4
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  37.00
+ 2   / 2:  29.00  41.00
+ 3   / 3:  33.00  45.00
+ ---- L:2 T:   2
+ 1   / 1:  26.00  38.00
+ 2   / 2:  30.00  42.00
+ 3   / 3:  34.00  46.00
+ ---- L:3 T:   3
+ 1   / 1:  27.00  39.00
+ 2   / 2:  31.00  43.00
+ 3   / 3:  35.00  47.00
+ ---- L:4 T:   4
+ 1   / 1:  28.00  40.00
+ 2   / 2:  32.00  44.00
+ 3   / 3:  36.00  48.00
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- L:2 T:   2
+ 1   / 1:  13.00  15.00
+ 2   / 2:  17.00  19.00
+ 3   / 3:  21.00  23.00
+ ---- L:3 T:   3
+ 1   / 1:  25.00  27.00
+ 2   / 2:  29.00  31.00
+ 3   / 3:  33.00  35.00
+ ---- L:4 T:   4
+ 1   / 1:  37.00  39.00
+ 2   / 2:  41.00  43.00
+ 3   / 3:  45.00  47.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+ ---- L:2 T:   2
+ 1   / 1:  14.00  16.00
+ 2   / 2:  18.00  20.00
+ 3   / 3:  22.00  24.00
+ ---- L:3 T:   3
+ 1   / 1:  26.00  28.00
+ 2   / 2:  30.00  32.00
+ 3   / 3:  34.00  36.00
+ ---- L:4 T:   4
+ 1   / 1:  38.00  40.00
+ 2   / 2:  42.00  44.00
+ 3   / 3:  46.00  48.00
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+*** Running test: bn_define_axes.jnl
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+*** Running test: bn_polygon.jnl
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+*** Running test: bn500_bug_fixes.jnl
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.00
+ 2   / 2:  20.00
+ 3   / 3:  30.00
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.00
+ 2   / 2:  20.00
+ 3   / 3:  30.00
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G001)
+ Last successful data access was on grid (G001)
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Mon Mar 31 15:37:20 PDT 2014
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+*** Running test: bn_sample.jnl
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 16-JAN 06:00
+              79E    99E   119E   
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  28.58  28.59  28.15
+ 1S   / 45:  28.33  28.71  28.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  29.14  28.92  28.33
+ 1S   / 45:  28.90  28.82  28.54
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 13 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  8 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  5 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 14 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : 16-JAN 06:00
+               2    
+               2
+ 1N   / 46:  28.20
+ 1S   / 45:  28.56
+ -DELETE (C01,V02 M: 16 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M:  7 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 12 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 15 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M:  8 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  5 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 12 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 15 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M:  8 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 16 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20   ....
+ 1S   / 45:  28.15  28.56   ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M:  9 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M:  9 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 14 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20   ....
+ 1S   / 45:  28.15  28.56   ....
+cancel memory/all
+ -DELETE A        M:  8 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 16 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  8 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 16 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : 16-JAN 06:00
+               1    
+               1
+ 1N   / 46:  28.22
+ 1S   / 45:  28.15
+cancel memory/all
+ -DELETE SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 15 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : 16-JAN 06:00
+               1    
+               1
+ 1N   / 46:  28.22
+ 1S   / 45:  28.15
+cancel memory/all
+ -DELETE A        M:  9 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=20E:20E(380)@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[X=20E:20E(380)@IIN,D=1]
+ -DELETE          M: 14 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  5 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+                 1          2          3      
+                 1          2          3
+ 1N   / 46:  1.829E+08  2.458E+08  3.068E+08
+ 1S   / 45:  1.837E+08  2.469E+08  3.095E+08
+cancel memory/all
+ -DELETE FSST     M:  4 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  7 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 13 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE EX#1     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  7 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE EX#1     M:  7 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M:  9 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M:  7 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M:  9 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  29.22  29.20  29.45
+ 1S   / 45:  29.15  29.56  29.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  29.58  29.59  29.15
+ 1S   / 45:  29.33  29.71  29.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  30.14  29.92  29.33
+ 1S   / 45:  29.90  29.82  29.54
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  29.22  29.20  29.45
+ 1S   / 45:  29.15  29.56  29.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  29.58  29.59  29.15
+ 1S   / 45:  29.33  29.71  29.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  30.14  29.92  29.33
+ 1S   / 45:  29.90  29.82  29.54
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N    / 5:  28.22  28.20  28.45
+ 0.5N  / 4:  28.20  28.29  28.55
+ 0     / 3:  28.19  28.38  28.64
+ 0.5S  / 2:  28.17  28.47  28.74
+ 1S    / 1:  28.15  28.56  28.83
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX004)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G002)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX004)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N    / 5:  28.22  28.20  28.45
+ 0.5N  / 4:  28.20  28.29  28.55
+ 0     / 3:  28.19  28.38  28.64
+ 0.5S  / 2:  28.17  28.47  28.74
+ 1S    / 1:  28.15  28.56  28.83
+show grid/dyn
+Dynamic grids:
+    GRID (G002)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.000
+ 2   / 2:  4.000
+ 3   / 3:  7.000
+ 4   / 4:   ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.0
+ 2   / 2:  114.0
+ 3   / 3:  117.0
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  5.000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  5.000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.000
+ 2   / 2:   ....
+ 3   / 3:   ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3      4    
+               1      2      3      4
+ 1N   / 46:  28.22  28.20   ....  28.45
+ 1S   / 45:  28.15  28.56   ....  28.83
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3      4    
+               1      2      3      4
+ 1N   / 46:  28.20   ....  28.45  28.22
+ 1S   / 45:  28.56   ....  28.83  28.15
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:   ....
+ 3   / 3:   ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:   ....
+ 3   / 3:  170.0
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G003)          NORMAL    (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 13 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 14 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ found   (C09,V02 M:  8 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V02 M:  3 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V02 M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 10 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M:  3 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ found   (C09,V01 M:  8 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V01 M: 15 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V01 M: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 16 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  2 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M:  3 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1990
+            largest free region: 1990
+            number of free regions: 1
+            free memory table slots: 490
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 0   / 1:  22.64
+ 5   / 2:  27.64
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : 16-JAN 06:00
+             1      2      3      4    
+             1      2      3      4
+ 0   / 1:  22.64  23.53  26.91  29.26
+ 5   / 2:  27.64  28.53  31.91  34.26
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  22.64
+ 2   / 2:  29.26
+ 3   / 3:  27.73
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : 16-JAN 06:00
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  23.56  22.61  21.94  22.55  22.59  22.44  21.96  22.28  21.66
+ 2   / 2:  29.35  29.17  29.23  29.44  29.09  29.34  29.13  28.65  28.91
+ 3   / 3:  27.97  28.06  27.86  27.91  27.43  27.41  27.36  27.40  27.12
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+          173.2
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  173.2
+ 2   / 2:  178.2
+ 3   / 3:  198.2
+ 4   / 4:  223.2
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  173.2
+ 2   / 2:  223.2
+ 3   / 3:  273.2
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  174.2  174.2  174.0  173.3  173.5  172.8  173.0  172.5  171.9
+ 2   / 2:  224.2  224.2  224.0  223.3  223.5  222.8  223.0  222.5  221.9
+ 3   / 3:  274.2  274.2  274.0  273.3  273.5  272.8  273.0  272.5  271.9
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+           179E   
+            80
+ 0   / 1:  28.20
+ 5   / 2:  33.20
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             0      5    
+             1      2
+ 1   / 1:  28.36  33.36
+ 2   / 2:  28.35  33.35
+ 3   / 3:  28.20  33.20
+ 4   / 4:  28.36  33.36
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.20
+ 3   / 3:  28.36
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  29.17  29.22  28.96  28.31  28.53  27.80  27.99  27.55  26.93
+ 2   / 2:  29.17  29.22  28.96  28.31  28.53  27.80  27.99  27.55  26.93
+ 3   / 3:  29.05  29.19  28.72  29.52  28.33  28.19  27.48  27.47  26.79
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+*** Running test: bn_strides_revs_perms.jnl
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.  1124.  1125.  1126.
+ 3   / 3:  1133.  1134.  1135.  1136.
+ 4   / 4:  1143.  1144.  1145.  1146.
+ ---- K:2 Z:   2
+ 2   / 2:  1223.  1224.  1225.  1226.
+ 3   / 3:  1233.  1234.  1235.  1236.
+ 4   / 4:  1243.  1244.  1245.  1246.
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.  1142.  1152.  1162.
+ 3   / 3:  1133.  1143.  1153.  1163.
+ 4   / 4:  1134.  1144.  1154.  1164.
+ ---- K:2 Z:   2
+ 2   / 2:  1232.  1242.  1252.  1262.
+ 3   / 3:  1233.  1243.  1253.  1263.
+ 4   / 4:  1234.  1244.  1254.  1264.
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.  1421.  1521.  1621.
+ 3   / 3:  1331.  1431.  1531.  1631.
+ 4   / 4:  1341.  1441.  1541.  1641.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1422.  1522.  1622.
+ 3   / 3:  1332.  1432.  1532.  1632.
+ 4   / 4:  1342.  1442.  1542.  1642.
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.  1412.  1512.  1612.
+ 3   / 3:  1313.  1413.  1513.  1613.
+ 4   / 4:  1314.  1414.  1514.  1614.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1422.  1522.  1622.
+ 3   / 3:  1323.  1423.  1523.  1623.
+ 4   / 4:  1324.  1424.  1524.  1624.
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   142E   143E   144E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 3N   / 3:  1031.  1032.  1033.  1034.
+ 2N   / 2:  1021.  1022.  1023.  1024.
+ 1N   / 1:  1011.  1012.  1013.  1014.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 3N   / 3:  2031.  2032.  2033.  2034.
+ 2N   / 2:  2021.  2022.  2023.  2024.
+ 1N   / 1:  2011.  2012.  2013.  2014.
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      2      3      4    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 141   / 1:  1011.  1021.  1031.  1041.
+ 142   / 2:  1012.  1022.  1032.  1042.
+ 143   / 3:  1013.  1023.  1033.  1043.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 141   / 1:  2011.  2021.  2031.  2041.
+ 142   / 2:  2012.  2022.  2032.  2042.
+ 143   / 3:  2013.  2023.  2033.  2043.
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34320  34321  34322  
+              1      2      3      4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.  2031.  3031.  4031.
+ 2N   / 2:  1021.  2021.  3021.  4021.
+ 1N   / 1:  1011.  2011.  3011.  4011.
+ ---- L:2 T:   142
+ 3N   / 3:  1032.  2032.  3032.  4032.
+ 2N   / 2:  1022.  2022.  3022.  4022.
+ 1N   / 1:  1012.  2012.  3012.  4012.
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- K:2 Z:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ found   VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  1 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  2 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M:  1 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:  2 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+CANC MEM/ALL
+ -DELETE VAR      M:  2 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:  2 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 1    / 1:  1111.
+ 4    / 2:  1114.
+ 7    / 3:  1113.
+ 10   / 4:  1112.
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:  2 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  3 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @AVE
+ reading VAR      M:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  2 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  3 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 11   / 3:  1121.
+ 16   / 4:  1126.
+ 21   / 5:  1131.
+ -DELETE A        M:  1 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G007)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  1 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:  6 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+            11     16     21    
+             3      4      5
+ 1   / 1:  1121.  1126.  1131.
+ 3   / 2:  1141.  1146.  1151.
+ 5   / 3:  1161.  1166.  1171.
+ 7   / 4:  1181.  1186.  1191.
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M:  6 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0      0.3    0.48   0.6   
+            1      2      3      4
+          1111.  1112.  1113.  1114.
+cancel mem/all
+ -DELETE A        M:  1 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  2 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ found   UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G006)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  6 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE A        M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G006)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+             0     
+              1
+ 0.3  / 1:  1112.
+ 0.6  / 2:  1114.
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+             0     
+              1
+ 0.3  / 1:  1112.
+ 0.6  / 2:  1114.
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M:  6 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M:  3 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0      0.9    1.87   2.65   3.3   
+            1      2      3      4      5
+          1111.  1118.  1115.  1112.  1119.
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+             0.3    0.6   
+              1      2
+ 0    / 1:  1112.  1114.
+ 0.95 / 2:  1132.  1134.
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  6 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+             0.3    0.6    0.78  
+              1      2      3
+ 0    / 1:  1112.  1114.  1116.
+ 0.95 / 2:  1132.  1134.  1136.
+ 1.4  / 3:  1152.  1154.  1156.
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @AVE
+ reading UNE-NVAR M:  6 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  3 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @AVE
+ reading UNE-NVAR M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M:  4 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.  1125.  1127.  1129.
+ 3   / 3:  1133.  1135.  1137.  1139.
+ 4   / 4:  1143.  1145.  1147.  1149.
+ ---- K:2 Z:   2
+ 2   / 2:  1223.  1225.  1227.  1229.
+ 3   / 3:  1233.  1235.  1237.  1239.
+ 4   / 4:  1243.  1245.  1247.  1249.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  4 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1124.  1125.  1126.
+ 4   / 2:  1143.  1144.  1145.  1146.
+ 6   / 3:  1163.  1164.  1165.  1166.
+ ---- K:2 Z:   2
+ 2   / 1:  1223.  1224.  1225.  1226.
+ 4   / 2:  1243.  1244.  1245.  1246.
+ 6   / 3:  1263.  1264.  1265.  1266.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1125.  1127.  1129.
+ 4   / 2:  1143.  1145.  1147.  1149.
+ 6   / 3:  1163.  1165.  1167.  1169.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1325.  1327.  1329.
+ 4   / 2:  1343.  1345.  1347.  1349.
+ 6   / 3:  1363.  1365.  1367.  1369.
+canc data/all
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.  1521.  1721.  1921.
+ 3   / 3:  1331.  1531.  1731.  1931.
+ 4   / 4:  1341.  1541.  1741.  1941.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1522.  1722.  1922.
+ 3   / 3:  1332.  1532.  1732.  1932.
+ 4   / 4:  1342.  1542.  1742.  1942.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1421.  1521.  1621.
+ 4   / 2:  1341.  1441.  1541.  1641.
+ 6   / 3:  1361.  1461.  1561.  1661.
+ ---- K:2 Z:   2
+ 2   / 1:  1322.  1422.  1522.  1622.
+ 4   / 2:  1342.  1442.  1542.  1642.
+ 6   / 3:  1362.  1462.  1562.  1662.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1521.  1721.  1921.
+ 4   / 2:  1341.  1541.  1741.  1941.
+ 6   / 3:  1361.  1561.  1761.  1961.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1523.  1723.  1923.
+ 4   / 2:  1343.  1543.  1743.  1943.
+ 6   / 3:  1363.  1563.  1763.  1963.
+canc data/all
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.  1512.  1712.  1912.
+ 3   / 3:  1313.  1513.  1713.  1913.
+ 4   / 4:  1314.  1514.  1714.  1914.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1522.  1722.  1922.
+ 3   / 3:  1323.  1523.  1723.  1923.
+ 4   / 4:  1324.  1524.  1724.  1924.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  6 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.  1412.  1512.  1612.
+ 4   / 2:  1314.  1414.  1514.  1614.
+ 6   / 3:  1316.  1416.  1516.  1616.
+ ---- K:2 Z:   2
+ 2   / 1:  1322.  1422.  1522.  1622.
+ 4   / 2:  1324.  1424.  1524.  1624.
+ 6   / 3:  1326.  1426.  1526.  1626.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.  1512.  1712.  1912.
+ 4   / 2:  1314.  1514.  1714.  1914.
+ 6   / 3:  1316.  1516.  1716.  1916.
+ ---- K:2 Z:   3
+ 2   / 1:  1332.  1532.  1732.  1932.
+ 4   / 2:  1334.  1534.  1734.  1934.
+ 6   / 3:  1336.  1536.  1736.  1936.
+canc data/all
+ -DELETE BIGVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 3N   / 3:  1031.  1033.  1035.  1037.
+ 2N   / 2:  1021.  1023.  1025.  1027.
+ 1N   / 1:  1011.  1013.  1015.  1017.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 3N   / 3:  2031.  2033.  2035.  2037.
+ 2N   / 2:  2021.  2023.  2025.  2027.
+ 1N   / 1:  2011.  2013.  2015.  2017.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   142E   143E   144E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 6N   / 3:  1061.  1062.  1063.  1064.
+ 4N   / 2:  1041.  1042.  1043.  1044.
+ 2N   / 1:  1021.  1022.  1023.  1024.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 6N   / 3:  2061.  2062.  2063.  2064.
+ 4N   / 2:  2041.  2042.  2043.  2044.
+ 2N   / 1:  2021.  2022.  2023.  2024.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      3      5      7    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 141   / 1:  1011.  1031.  1051.  1071.
+ 142   / 2:  1012.  1032.  1052.  1072.
+ 143   / 3:  1013.  1033.  1053.  1073.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 141   / 1:  2011.  2031.  2051.  2071.
+ 142   / 2:  2012.  2032.  2052.  2072.
+ 143   / 3:  2013.  2033.  2053.  2073.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      2      3      4    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 142   / 1:  1012.  1022.  1032.  1042.
+ 144   / 2:  1014.  1024.  1034.  1044.
+ 146   / 3:  1016.  1026.  1036.  1046.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 142   / 1:  2012.  2022.  2032.  2042.
+ 144   / 2:  2014.  2024.  2034.  2044.
+ 146   / 3:  2016.  2026.  2036.  2046.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      3      5      7    
+               1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 142   / 1:  3012.  3032.  3052.  3072.
+ 144   / 2:  3014.  3034.  3054.  3074.
+ 146   / 3:  3016.  3036.  3056.  3076.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 142   / 1:  5012.  5032.  5052.  5072.
+ 144   / 2:  5014.  5034.  5054.  5074.
+ 146   / 3:  5016.  5036.  5056.  5076.
+canc data/all
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34321  34323  34325  
+              1      2      3      4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.  3031.  5031.  7031.
+ 2N   / 2:  1021.  3021.  5021.  7021.
+ 1N   / 1:  1011.  3011.  5011.  7011.
+ ---- L:2 T:   142
+ 3N   / 3:  1032.  3032.  5032.  7032.
+ 2N   / 2:  1022.  3022.  5022.  7022.
+ 1N   / 1:  1012.  3012.  5012.  7012.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34320  34321  34322  
+              1      2      3      4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.  2061.  3061.  4061.
+ 4N   / 2:  1041.  2041.  3041.  4041.
+ 2N   / 1:  1021.  2021.  3021.  4021.
+ ---- L:2 T:   142
+ 6N   / 3:  1062.  2062.  3062.  4062.
+ 4N   / 2:  1042.  2042.  3042.  4042.
+ 2N   / 1:  1022.  2022.  3022.  4022.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34321  34323  34325  
+              1      2      3      4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.  3063.  5063.  7063.
+ 4N   / 2:  1043.  3043.  5043.  7043.
+ 2N   / 1:  1023.  3023.  5023.  7023.
+ ---- L:2 T:   145
+ 6N   / 3:  1065.  3065.  5065.  7065.
+ 4N   / 2:  1045.  3045.  5045.  7045.
+ 2N   / 1:  1025.  3025.  5025.  7025.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  3011.  5011.  7011.
+ 142   / 2:  1012.  3012.  5012.  7012.
+ 143   / 3:  1013.  3013.  5013.  7013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  3021.  5021.  7021.
+ 142   / 2:  1022.  3022.  5022.  7022.
+ 143   / 3:  1023.  3023.  5023.  7023.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 142   / 1:  1012.  2012.  3012.  4012.
+ 144   / 2:  1014.  2014.  3014.  4014.
+ 146   / 3:  1016.  2016.  3016.  4016.
+ ---- L:2 T:   2
+ 142   / 1:  1022.  2022.  3022.  4022.
+ 144   / 2:  1024.  2024.  3024.  4024.
+ 146   / 3:  1026.  2026.  3026.  4026.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- L:1 T:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- L:2 T:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.  3011.  5011.  7011.
+ 142   / 2:  1012.  3012.  5012.  7012.
+ 143   / 3:  1013.  3013.  5013.  7013.
+ ---- K:2 Z:   2
+ 141   / 1:  1021.  3021.  5021.  7021.
+ 142   / 2:  1022.  3022.  5022.  7022.
+ 143   / 3:  1023.  3023.  5023.  7023.
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.  2012.  3012.  4012.
+ 144   / 2:  1014.  2014.  3014.  4014.
+ 146   / 3:  1016.  2016.  3016.  4016.
+ ---- K:2 Z:   2
+ 142   / 1:  1022.  2022.  3022.  4022.
+ 144   / 2:  1024.  2024.  3024.  4024.
+ 146   / 3:  1026.  2026.  3026.  4026.
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- K:2 Z:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.  1352.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1512.  1552.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.  1358.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1518.  1558.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.  1342.
+ 5   / 2:  1385.  1345.
+ ---- K:2 Z:   5
+ 2   / 1:  1582.  1542.
+ 5   / 2:  1585.  1545.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.  5123.
+ 5   / 2:  1153.  5153.
+ ---- K:2 Z:   5
+ 2   / 1:  1125.  5125.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.  2773.
+ 5   / 2:  6743.  2743.
+ ---- K:2 Z:   5
+ 2   / 1:  6775.  2775.
+ 5   / 2:  6745.  2745.
+canc data/all
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.  5132.
+ 5   / 2:  1135.  5135.
+ ---- K:2 Z:   5
+ 2   / 1:  1152.  5152.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.  2738.
+ 5   / 2:  6735.  2735.
+ ---- K:2 Z:   5
+ 2   / 1:  6758.  2758.
+ 5   / 2:  6755.  2755.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+*** Running test: bn_non_COARDS_netCDF.jnl
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME      TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  3.000
+ 3   / 3:  5.000
+ 4   / 4:  2.000
+ 5   / 5:  4.000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:   ....
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.00
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.00
+ 2   / 2:  40.00
+ 3   / 3:  30.00
+ 4   / 4:  20.00
+ 5   / 5:  10.00
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+*** Running test: bn_cache_hits.jnl
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTX     M:  3 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G003)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G003)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXYT   M:  5 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXYT   M:  5 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M:  3 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXYT   M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  4 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  4 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXAVE  M:  5 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  8 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M:  8 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTSBX   M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5X    M: 11 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XYT  M: 13 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XYT  M: 13 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5X    M: 11 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTSBX   M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXAVE  M:  5 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXYT   M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  3 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  3 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XYT  M:  8 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XAVE M:  9 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 15 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 15 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5SBX  M: 14 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 15 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 16 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 15 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 14 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XAVE M:  9 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XYT  M:  8 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M:  5 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 11 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 13 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 13 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C11,V11 M: 12 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 12 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 11 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M:  5 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 11 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ found   (C09,V11 M: 12 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.000
+ 2   / 2:  5.000
+ 3   / 3:  3.000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 12 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M:  5 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M:  3 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 10 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C09,V11 M:  5 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C31,V11 M: 12 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.00
+ 2   / 2:  12.00
+ 3   / 3:  13.00
+ 4   / 4:  21.00
+ 5   / 5:  22.00
+ 6   / 6:  23.00
+ 7   / 7:  31.00
+ 8   / 8:  32.00
+ 9   / 9:  33.00
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+*** Running test: bn_regrid_to_user.jnl
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX008)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G004)
+    GRID (G004)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G004)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX010)                         use count:   1
+    AXIS (AX009)                         use count:   1
+    AXIS (AX008)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00   5.00   6.00   7.00   8.00
+ 2   / 2:   4.00   5.00   6.00   7.00   8.00   9.00
+ 3   / 3:   5.00   6.00   7.00   8.00   9.00  10.00
+ 4   / 4:   6.00   7.00   8.00   9.00  10.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   6.00   7.00   8.00   9.00  10.00  11.00
+ 4   / 4:   7.00   8.00   9.00  10.00  11.00  12.00
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:   6.00   7.00   8.00   9.00  10.00  11.00
+ 3   / 3:   7.00   8.00   9.00  10.00  11.00  12.00
+ 4   / 4:   8.00   9.00  10.00  11.00  12.00  13.00
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 2   / 2:   4.00   6.00   8.00   ....
+ 3   / 3:   5.00   7.00   9.00   ....
+ 4   / 4:   6.00   8.00  10.00   ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   6.00   8.00   ....
+ 2   / 2:   5.00   7.00   9.00   ....
+ 3   / 3:   6.00   8.00  10.00   ....
+ 4   / 4:   7.00   9.00  11.00   ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 2   / 2:   6.00   8.00  10.00   ....
+ 3   / 3:   7.00   9.00  11.00   ....
+ 4   / 4:   8.00  10.00  12.00   ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   6.00   8.00   ....
+ 3   / 2:   6.00   8.00  10.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 2   / 2:   4.00   6.00   8.00   ....
+ 3   / 3:   5.00   7.00   9.00   ....
+ 4   / 4:   6.00   8.00  10.00   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 2   / 2:   6.00   8.00  10.00   ....
+ 3   / 3:   7.00   9.00  11.00   ....
+ 4   / 4:   8.00  10.00  12.00   ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G006)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX010)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G006)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G007)
+ Last successful data access was on grid (G007)
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX007)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.000
+ 9.4S   / 4:  4.000
+ 9.6S   / 3:  3.000
+ 9.8S   / 2:  2.000
+ 10S    / 1:  1.000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G004)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G007)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX007)                         use count:   3
+    AXIS (AX008)                         use count:   1
+ 
+*** Running test: bn_calendar.jnl
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.4362
+ 28-FEB-1988 00 / 58:  0.9929
+ 29-FEB-1988 00 / 59:  0.6367
+ 30-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 01-MAR-1988 00 / 60: -0.3048
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 26-NOV-1982 00 / 15:  32.90
+ 03-DEC-1982 00 / 16:  32.92
+ 10-DEC-1982 00 / 17:  32.96
+ 17-DEC-1982 00 / 18:  32.97
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 28-NOV-1982 00 / 15:  32.95
+ 05-DEC-1982 00 / 16:  32.90
+ 12-DEC-1982 00 / 17:  32.89
+ 19-DEC-1982 00 / 18:  32.91
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 26-NOV-1982 00 / 15:  32.91
+ 03-DEC-1982 00 / 16:  32.93
+ 10-DEC-1982 00 / 17:  32.97
+ 17-DEC-1982 00 / 18:  32.97
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT91_100 LONGITUDE          10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.2S
+             DEPTH (m): 5
+             TIME: 16-AUG-1982 12:00 to 10-JAN-1983 12:00 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                   132.5W 
+                    98
+ 18-SEP-1982 / 2:  27.27
+ 18-OCT-1982 / 3:  31.32
+ 18-NOV-1982 / 4:  32.90
+ 18-DEC-1982 / 5:  32.97
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                        132.5W 
+                         98
+ 05-DEC-1982 00 / 108:  32.93
+ 06-DEC-1982 00 / 109:  32.93
+ 07-DEC-1982 00 / 110:  32.94
+ 08-DEC-1982 00 / 111:  32.95
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN      / 1:  28.20
+ 15-FEB      / 2:  28.36
+ 17-MAR      / 3:  28.35
+ 16-AUG      / 4:   ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: 01-JAN 00:00 to 16-APR 12:45 JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                  JSST   NSST
+01-JAN      / 1:   ....  28.20
+31-JAN      / 2:  28.28  28.20
+01-MAR      / 3:  28.36  28.36
+01-APR      / 4:   ....  28.35
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+*** Running test: bn_dash_dot.jnl
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+*** Running test: bn_flowlines.jnl
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+*** Running test: bn_logaxes.jnl
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+*** Running test: bn_internal_external_functions.jnl
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.0137
+ 0.00355 / 31:  0.0212
+ 0.00366 / 32:  0.0482
+ 0.00378 / 33:  0.4990
+ 0.00389 / 34:  0.0524
+ 0.00401 / 35:  0.0325
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.0728
+ 0.00584 / 51:  0.1041
+ 0.00595 / 52:  0.1854
+ 0.00607 / 53:  0.8945
+ 0.00618 / 54:  0.3111
+ 0.0063  / 55:  0.1317
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.1
+ 0       /  2: -176.1
+ 0       /  3: -174.2
+ 0       /  4: -172.2
+ 0       /  5: -170.2
+ 0       /  6: -168.3
+ 0       /  7: -166.2
+ 0       /  8: -164.2
+ 0.00103 /  9: -162.2
+ 0.00114 / 10: -160.1
+ 0.00126 / 11: -158.0
+ 0.00137 / 12: -155.8
+ 0.00149 / 13: -153.6
+ 0.0016  / 14: -151.3
+ 0.00172 / 15: -149.0
+ 0.00183 / 16: -146.5
+ 0.00195 / 17: -144.0
+ 0.00206 / 18: -141.3
+ 0.00217 / 19: -138.4
+ 0.00229 / 20: -135.3
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                 161W   
+                  90
+ 0        /  1:  1.996
+ 0        /  2:  2.168
+ 0        /  3:  0.174
+ 0        /  4:  2.015
+ 0        /  5:  0.354
+ 0        /  6:  1.725
+ 0        /  7:  1.253
+ 0        /  8:  0.304
+ 0        /  9:  1.651
+ 0        / 10:  0.814
+ 0        / 11:  0.154
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                1      
+                 21
+ 4     /  81:  0.2500
+ 4.05  /  82:  0.2453
+ 4.1   /  83:  0.2405
+ 4.15  /  84:  0.2356
+ 4.2   /  85:  0.2306
+ 4.25  /  86:  0.2255
+ 4.3   /  87:  0.2203
+ 4.35  /  88:  0.2150
+ 4.4   /  89:  0.2096
+ 4.45  /  90:  0.2041
+ 4.5   /  91:  0.1985
+ 4.55  /  92:  0.1929
+ 4.6   /  93:  0.1871
+ 4.65  /  94:  0.1813
+ 4.7   /  95:  0.1753
+ 4.75  /  96:  0.1693
+ 4.8   /  97:  0.1632
+ 4.85  /  98:  0.1571
+ 4.9   /  99:  0.1509
+ 4.95  / 100:  0.1446
+ 5     / 101:  0.1382
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.3090  0.3620  0.1091 -0.0050 -0.1367 -0.4084 -0.2255  0.1517  0.2250  0.0731
+ 1.5   /  2:  0.3156  0.3712  0.0938 -0.0374 -0.2018 -0.4524 -0.1500  0.2782  0.3309  0.0699
+ 2     /  3:  0.3788  0.3156  0.0371 -0.0887 -0.2538 -0.4922 -0.0737  0.3748  0.4510  0.0813
+ 2.5   /  4:  0.4200  0.2522 -0.0636 -0.1441 -0.2527 -0.4666  0.0194  0.4396  0.4914  0.0893
+ 3     /  5:  0.4064  0.1984 -0.1400 -0.1971 -0.2790 -0.4255  0.1190  0.4330  0.5453  0.0855
+ 3.5   /  6:  0.3510  0.1698 -0.2016 -0.2575 -0.2838 -0.3580  0.1859  0.5859  0.5308  0.0588
+ 4     /  7:  0.2771  0.0967 -0.2465 -0.2890 -0.2590 -0.3293  0.3125  0.6416  0.5187  0.0212
+ 4.5   /  8:  0.1890  0.0447 -0.3126 -0.3192 -0.2135 -0.2225  0.3021  0.6266  0.4121 -0.0085
+ 5     /  9:  0.1399 -0.0371 -0.3239 -0.3338 -0.1998 -0.1342  0.2656  0.5778  0.3121 -0.0567
+ 5.5   / 10:  0.0786 -0.0964 -0.3389 -0.3129 -0.1727 -0.0850  0.2067  0.4824  0.2358 -0.0798
+ 6     / 11:  0.0074 -0.1353 -0.3777 -0.2741 -0.1217 -0.0193  0.1738  0.3540  0.1488 -0.1226
+ 6.5   / 12: -0.0711 -0.2091 -0.3704 -0.2493 -0.0410  0.0695  0.1485  0.2368  0.0456 -0.1732
+ 7     / 13: -0.1375 -0.2543 -0.3786 -0.2281  0.0630  0.1830  0.1355  0.1322 -0.0510 -0.2153
+ 7.5   / 14: -0.2028 -0.2669 -0.3464 -0.2105  0.1684  0.2796  0.1785  0.0640 -0.1152 -0.2282
+ 8     / 15: -0.2752 -0.2592 -0.3002 -0.1554  0.2333  0.3520  0.2197  0.0339 -0.1357 -0.2189
+ 8.5   / 16: -0.3268 -0.2733 -0.2452 -0.1138  0.2649  0.4025  0.2533  0.0294 -0.1385 -0.2005
+ 9     / 17: -0.3516 -0.2668 -0.1649 -0.0321  0.2764  0.4370  0.2817  0.0364 -0.1342 -0.1911
+ 9.5   / 18: -0.3642 -0.2402 -0.0934  0.0381  0.2761  0.4426  0.2947  0.0497 -0.1409 -0.2174
+ 10    / 19: -0.3692 -0.2104 -0.0403  0.1031  0.2803  0.4052  0.2986  0.0668 -0.1386 -0.2526
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2910  0.4242  0.0970  0.0031 -0.1367 -0.4123 -0.2078    ....  0.2411    ....
+ 1.5   /  2:  0.3149  0.3736  0.1241 -0.0015 -0.2018 -0.4412 -0.1891  0.3310  0.3335  0.0056
+ 2     /  3:  0.3376  0.3121  0.0461 -0.0118 -0.2672 -0.4864 -0.0737    ....  0.4616    ....
+ 2.5   /  4:  0.3597  0.2424 -0.0661    .... -0.2439 -0.4573 -0.0311  0.4179  0.4740  0.2009
+ 3     /  5:    ....  0.1987 -0.1313 -0.2037 -0.2772 -0.3885  0.0658  0.4342  0.5394    ....
+ 3.5   /  6:  0.3103  0.1700 -0.2163 -0.2494 -0.2825 -0.3365  0.1567  0.5374  0.5054  0.1424
+ 4     /  7:  0.2748  0.0919 -0.2743 -0.2395 -0.2622 -0.3340  0.3125  0.5804  0.5206  0.0936
+ 4.5   /  8:  0.1840  0.0417 -0.3050    .... -0.2106 -0.1960  0.3262  0.5764  0.3663  0.0591
+ 5     /  9:  0.1468 -0.0445 -0.3533 -0.3755 -0.1909 -0.1066  0.2847  0.5219  0.2784 -0.0351
+ 5.5   / 10:  0.0416 -0.1097 -0.3354 -0.3255    .... -0.0886  0.2220  0.4386  0.2358  0.0412
+ 6     / 11: -0.0123 -0.1744 -0.3711 -0.2634    ....    ....  0.1726  0.3463  0.2191    ....
+ 6.5   / 12: -0.0648 -0.1272 -0.3661 -0.2453    ....  0.1044  0.1657  0.2429  0.0951    ....
+ 7     / 13: -0.1386    .... -0.3798 -0.2300    ....  0.1819  0.1359  0.1643 -0.0260 -0.2047
+ 7.5   / 14: -0.2039 -0.2891 -0.3460 -0.2099  0.1695  0.2722  0.1846  0.1033 -0.1142    ....
+ 8     / 15: -0.2859 -0.2587 -0.3005 -0.1705  0.2410  0.3522  0.2294  0.0662 -0.1360    ....
+ 8.5   / 16: -0.3294 -0.2792 -0.2367 -0.1257  0.2924  0.3890  0.2566    .... -0.1397 -0.1839
+ 9     / 17: -0.3416 -0.2686 -0.1775 -0.0643  0.2774  0.4317  0.2882  0.0231 -0.1392 -0.1953
+ 9.5   / 18: -0.3439 -0.2257 -0.0936  0.0132  0.2534  0.4424  0.2947  0.0341 -0.1376 -0.2118
+ 10    / 19:    .... -0.2042 -0.0215    ....    ....  0.4211  0.2880    .... -0.1447 -0.2037
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2749  0.3520  0.1259  0.0005 -0.1307 -0.4094 -0.1965  0.1130  0.2918  0.1284
+ 1.5   /  2:  0.2992  0.3405  0.1245 -0.0611 -0.2638 -0.4351 -0.1767  0.3484  0.3724  0.1284
+ 2     /  3:  0.2816  0.3205  0.0263 -0.1104 -0.2957 -0.4349 -0.1907  0.4605  0.4452  0.1919
+ 2.5   /  4:  0.2905  0.2746 -0.0640 -0.1666 -0.2648 -0.4176 -0.1162  0.5380  0.4422  0.2649
+ 3     /  5:  0.2915  0.2482 -0.1256 -0.2238 -0.2563 -0.3716  0.2477  0.4975  0.4523  0.2763
+ 3.5   /  6:  0.2670  0.1771 -0.1706 -0.2310 -0.2748 -0.2812  0.2546  0.5101  0.4228  0.2483
+ 4     /  7:  0.2254  0.1144 -0.1767 -0.2279 -0.2724 -0.2447  0.2802  0.5449  0.3972  0.2122
+ 4.5   /  8:  0.1893  0.0812 -0.3329 -0.3434 -0.2308 -0.2443  0.3398  0.5310  0.3351  0.0613
+ 5     /  9:  0.1270  0.0390 -0.3562 -0.3691 -0.1779 -0.1532  0.2536  0.4990  0.3035  0.0256
+ 5.5   / 10:  0.0486 -0.1269 -0.3314 -0.2898 -0.1626 -0.0824  0.1922  0.4011  0.3037  0.0556
+ 6     / 11: -0.0377 -0.1366 -0.3367 -0.2688 -0.1971  0.0163  0.2094  0.2954  0.2639 -0.1357
+ 6.5   / 12: -0.0649 -0.1349 -0.3594 -0.2202 -0.0116  0.1108  0.1647  0.2593  0.0785 -0.1377
+ 7     / 13: -0.1040 -0.1406 -0.3630 -0.1669  0.0665  0.1932  0.1495  0.1418 -0.1130 -0.1434
+ 7.5   / 14: -0.1997 -0.2796 -0.3390 -0.1918  0.1852  0.2622  0.1522  0.0394 -0.1158 -0.1513
+ 8     / 15: -0.2353 -0.2782 -0.2830 -0.1572  0.2503  0.3331  0.2045  0.0179 -0.1159 -0.1716
+ 8.5   / 16: -0.3060 -0.2785 -0.2405 -0.1007  0.2517  0.3638  0.2512  0.0804 -0.1305 -0.1878
+ 9     / 17: -0.3356 -0.2663 -0.2136  0.0135  0.2884  0.4053  0.2726  0.1412 -0.1426 -0.1936
+ 9.5   / 18: -0.3495 -0.2130 -0.1083  0.0977  0.2055  0.4225  0.2947  0.1163 -0.1434 -0.1956
+ 10    / 19: -0.3530 -0.1816 -0.0861  0.0788  0.1087  0.4204  0.3216  0.0362 -0.1513 -0.1915
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2816  0.3122  0.1936 -0.0306 -0.2070 -0.3174 -0.2002  0.0358  0.2516  0.2179
+ 1.5   /  2:  0.2753  0.2962  0.1555 -0.0851 -0.2670 -0.3505 -0.2023  0.1687  0.3415  0.2747
+ 2     /  3:  0.2672  0.2609  0.0854 -0.1397 -0.2966 -0.3569 -0.1592  0.3022  0.3939  0.3190
+ 2.5   /  4:  0.2569  0.2037  0.0007 -0.1763 -0.3003 -0.3322 -0.0375  0.3936  0.4164  0.3363
+ 3     /  5:  0.2423  0.1529 -0.0574 -0.1979 -0.2890 -0.2657  0.1031  0.4302  0.4128  0.3273
+ 3.5   /  6:  0.2226  0.1218 -0.0907 -0.2163 -0.2714 -0.1845  0.1877  0.4360  0.3916  0.3016
+ 4     /  7:  0.1994  0.0942 -0.1270 -0.2400 -0.2530 -0.1379  0.2232  0.4316  0.3607  0.2621
+ 4.5   /  8:  0.1651  0.0529 -0.1834 -0.2671 -0.2320 -0.1172  0.2368  0.4168  0.3254  0.2139
+ 5     /  9:  0.1032 -0.0135 -0.2340 -0.2830 -0.2080 -0.0934  0.2348  0.3796  0.2999  0.1820
+ 5.5   / 10:  0.0196 -0.0822 -0.2536 -0.2804 -0.1800 -0.0461  0.2194  0.3280  0.2768  0.1655
+ 6     / 11: -0.0431 -0.1244 -0.2627 -0.2574 -0.1157  0.0360  0.2005  0.2738  0.2199  0.0887
+ 6.5   / 12: -0.0802 -0.1596 -0.2824 -0.2163  0.0112  0.1264  0.1816  0.2080  0.1091 -0.0365
+ 7     / 13: -0.1251 -0.2159 -0.2939 -0.1806  0.0990  0.1915  0.1712  0.1301 -0.0056 -0.1050
+ 7.5   / 14: -0.1868 -0.2628 -0.2836 -0.1492  0.1507  0.2424  0.1813  0.0735 -0.0662 -0.1291
+ 8     / 15: -0.2381 -0.2732 -0.2626 -0.1166  0.1919  0.2842  0.2109  0.0592 -0.0902 -0.1440
+ 8.5   / 16: -0.2747 -0.2696 -0.2391 -0.0872  0.2235  0.3159  0.2427  0.0717 -0.1071 -0.1594
+ 9     / 17: -0.3000 -0.2595 -0.2118 -0.0599  0.2465  0.3403  0.2670  0.0816 -0.1240 -0.1690
+ 9.5   / 18: -0.3141 -0.2417 -0.1779 -0.0316  0.2609  0.3583  0.2843  0.0735 -0.1356 -0.1721
+ 10    / 19: -0.3187 -0.2210 -0.1466 -0.0098  0.2665  0.3698  0.2969  0.0537 -0.1425 -0.1724
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G005)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                50E    52.1E  54.2E  56.3E  58.4E  60.5E  62.6E  64.7E  66.8E  68.9E 
+                 1      3      5      7      9     11     13     15     17     19
+ 20N    / 20:   ....   ....   ....   ....  144.0  241.1   ....   ....   ....   ....
+ 19.47N / 19:   ....   ....   ....   ....  117.8  207.4  172.9   ....   ....   ....
+ 18.95N / 18:   ....   ....   ....  137.8  107.3   98.0   ....   ....   ....   ....
+ 18.42N / 17:   ....   ....   ....  161.1  156.1    7.1   16.2   ....   ....   ....
+ 17.9N  / 16:   ....   ....   ....  179.9  189.1   81.7   ....   ....   ....   ....
+ 17.37N / 15:   ....   ....   ....  165.1  200.7  145.4   ....   ....   ....   ....
+ 16.84N / 14:   ....   ....   ....  128.3  183.0  168.0  182.6   ....   ....   ....
+ 16.32N / 13:   ....   ....   76.3   92.4  158.5  190.5  197.4   ....   ....   ....
+ 15.79N / 12:   ....   ....   ....   80.3   ....  189.8  195.8   ....   ....   ....
+ 15.26N / 11:   ....   ....   ....   72.2   ....  187.5  191.5   ....   ....   ....
+ 14.74N / 10:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 14.21N /  9:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 13.68N /  8:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 13.16N /  7:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 12.63N /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 12.11N /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 11.58N /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 11.05N /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10.53N /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10N    /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.0
+ 172E   /  2:  172.0
+ 174E   /  3:  174.0
+ 176E   /  4:  176.0
+ 178E   /  5:  178.0
+ 180E   /  6:  180.0
+ 178W   /  7:  182.0
+ 176W   /  8:  184.0
+ 174W   /  9:  186.0
+ 172W   / 10:  188.0
+ 170W   / 11:  190.0
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+          SMXY_XS  SMXY_YS   SMXY
+1    /  1:   173.0   13.00  0.2437
+2    /  2:   174.0   13.00  0.2264
+3    /  3:   175.0   13.00  0.2090
+4    /  4:   176.0   13.00  0.1916
+5    /  5:   177.0   13.00  0.1742
+6    /  6:   178.0   13.00  0.1568
+7    /  7:   179.0   13.00  0.1393
+8    /  8:   180.0   13.00  0.1219
+9    /  9:  -179.0   13.00  0.1044
+10   / 10:  -178.0   13.00  0.0870
+11   / 11:  -177.0   13.00  0.0695
+12   / 12:  -176.0   13.00  0.0521
+13   / 13:  -175.0   13.00  0.0347
+14   / 14:  -174.0   13.00  0.0173
+15   / 15:  -173.0   13.00  0.0000
+16   / 16:   173.0   14.00  0.2264
+17   / 17:   174.0   14.00  0.2091
+18   / 18:   175.0   14.00  0.1917
+19   / 19:   176.0   14.00  0.1743
+20   / 20:   177.0   14.00  0.1569
+21   / 21:   178.0   14.00  0.1394
+22   / 22:   179.0   14.00  0.1220
+23   / 23:   180.0   14.00  0.1045
+24   / 24:  -179.0   14.00  0.0871
+25   / 25:  -178.0   14.00  0.0696
+26   / 26:  -177.0   14.00  0.0522
+27   / 27:  -176.0   14.00  0.0348
+28   / 28:  -175.0   14.00  0.0174
+29   / 29:  -174.0   14.00  0.0000
+30   / 30:  -173.0   14.00 -0.0173
+31   / 31:   173.0   15.00  0.2090
+32   / 32:   174.0   15.00  0.1917
+33   / 33:   175.0   15.00  0.1743
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E    172E    174E    176E    178E    180E    178W    176W    174W    172W    170W   
+                 1       2       3       4       5       6       7       8       9      10      11
+ 30N   / 11:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+ 28N   / 10:    ....  0.0000 -0.0173 -0.0521 -0.0870 -0.1219 -0.1568 -0.1916 -0.2264 -0.2437    ....
+ 26N   /  9:    ....  0.0173  0.0000 -0.0348 -0.0696 -0.1045 -0.1394 -0.1743 -0.2090 -0.2264    ....
+ 24N   /  8:    ....  0.0521  0.0348  0.0000 -0.0349 -0.0698 -0.1046 -0.1395 -0.1743 -0.1916    ....
+ 22N   /  7:    ....  0.0870  0.0696  0.0349  0.0000 -0.0349 -0.0698 -0.1046 -0.1394 -0.1568    ....
+ 20N   /  6:    ....  0.1219  0.1045  0.0698  0.0349  0.0000 -0.0349 -0.0698 -0.1045 -0.1219    ....
+ 18N   /  5:    ....  0.1568  0.1394  0.1046  0.0698  0.0349  0.0000 -0.0349 -0.0696 -0.0870    ....
+ 16N   /  4:    ....  0.1916  0.1743  0.1395  0.1046  0.0698  0.0349  0.0000 -0.0348 -0.0521    ....
+ 14N   /  3:    ....  0.2264  0.2090  0.1743  0.1394  0.1045  0.0696  0.0348  0.0000 -0.0173    ....
+ 12N   /  2:    ....  0.2437  0.2264  0.1916  0.1568  0.1219  0.0870  0.0521  0.0173  0.0000    ....
+ 10N   /  1:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E    172E    174E    176E    178E    180E    178W    176W    174W    172W    170W   
+                 1       2       3       4       5       6       7       8       9      10      11
+ 30N   / 11:    ....    .... -0.0575 -0.0870 -0.1192 -0.1533 -0.1879 -0.2214 -0.2521 -0.2791    ....
+ 28N   / 10:    ....  0.0015 -0.0317 -0.0663 -0.1006 -0.1355 -0.1703 -0.2049 -0.2386 -0.2688 -0.2791
+ 26N   /  9:    ....  0.0301  0.0013 -0.0346 -0.0692 -0.1041 -0.1390 -0.1738 -0.2082 -0.2386 -0.2521
+ 24N   /  8:    ....  0.0622  0.0363 -0.0003 -0.0348 -0.0697 -0.1046 -0.1394 -0.1738 -0.2049 -0.2214
+ 22N   /  7:    ....  0.0967  0.0713  0.0344  0.0000 -0.0349 -0.0698 -0.1046 -0.1390 -0.1703 -0.1879
+ 20N   /  6:    ....  0.1318  0.1062  0.0693  0.0349  0.0000 -0.0349 -0.0697 -0.1041 -0.1355 -0.1533
+ 18N   /  5:    ....  0.1668  0.1410  0.1042  0.0698  0.0349  0.0000 -0.0348 -0.0692 -0.1006 -0.1192
+ 16N   /  4:    ....  0.2007  0.1753  0.1384  0.1042  0.0693  0.0344 -0.0003 -0.0346 -0.0663 -0.0870
+ 14N   /  3:    ....  0.2331  0.2153  0.1753  0.1410  0.1062  0.0713  0.0363  0.0013 -0.0317 -0.0575
+ 12N   /  2:    ....    ....  0.2331  0.2007  0.1668  0.1318  0.0967  0.0622  0.0301  0.0015    ....
+ 10N   /  1:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+          SMXZ_XS  SMXZ_ZS  SMXZ
+1    /  1:   173.0   15.00  1.520
+2    /  2:   174.0   15.00  1.502
+3    /  3:   175.0   15.00  1.485
+4    /  4:   176.0   15.00  1.468
+5    /  5:   177.0   15.00  1.450
+6    /  6:   178.0   15.00  1.433
+7    /  7:   179.0   15.00  1.415
+8    /  8:   180.0   15.00  1.398
+9    /  9:  -179.0   15.00  1.380
+10   / 10:  -178.0   15.00  1.363
+11   / 11:  -177.0   15.00  1.346
+12   / 12:  -176.0   15.00  1.328
+13   / 13:  -175.0   15.00  1.311
+14   / 14:  -174.0   15.00  1.293
+15   / 15:  -173.0   15.00  1.276
+16   / 16:   173.0   20.00  1.599
+17   / 17:   174.0   20.00  1.582
+18   / 18:   175.0   20.00  1.564
+19   / 19:   176.0   20.00  1.547
+20   / 20:   177.0   20.00  1.529
+21   / 21:   178.0   20.00  1.512
+22   / 22:   179.0   20.00  1.495
+23   / 23:   180.0   20.00  1.477
+24   / 24:  -179.0   20.00  1.460
+25   / 25:  -178.0   20.00  1.442
+26   / 26:  -177.0   20.00  1.425
+27   / 27:  -176.0   20.00  1.407
+28   / 28:  -175.0   20.00  1.390
+29   / 29:  -174.0   20.00  1.373
+30   / 30:  -173.0   20.00  1.355
+31   / 31:   173.0   25.00  1.666
+32   / 32:   174.0   25.00  1.649
+33   / 33:   175.0   25.00  1.631
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+               170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....  1.520  1.502  1.468  1.433  1.398  1.363  1.328  1.293  1.276   ....
+ 20     /  3:   ....  1.596  1.579  1.544  1.509  1.475  1.440  1.405  1.370  1.353   ....
+ 30     /  4:   ....  1.722  1.705  1.670  1.636  1.601  1.566  1.531  1.496  1.479   ....
+ 40     /  5:   ....  1.820  1.803  1.768  1.733  1.698  1.663  1.628  1.594  1.576   ....
+ 50     /  6:   ....  1.899  1.882  1.847  1.812  1.778  1.743  1.708  1.673  1.656   ....
+ 60     /  7:   ....  1.966  1.949  1.914  1.880  1.845  1.810  1.775  1.740  1.723   ....
+ 70     /  8:   ....  2.025  2.007  1.972  1.938  1.903  1.868  1.833  1.798  1.781   ....
+ 80     /  9:   ....  2.076  2.058  2.024  1.989  1.954  1.919  1.884  1.849  1.832   ....
+ 90     / 10:   ....  2.100  2.082  2.047  2.013  1.978  1.943  1.908  1.873  1.856   ....
+ 100    / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+               170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....   ....  1.460  1.433  1.401  1.367  1.333  1.299  1.269  1.245   ....
+ 20     /  3:   ....  1.626  1.566  1.536  1.499  1.464  1.429  1.394  1.359  1.334  1.352
+ 30     /  4:   ....  1.730  1.714  1.675  1.641  1.606  1.571  1.536  1.502  1.469  1.449
+ 40     /  5:   ....  1.825  1.807  1.768  1.734  1.699  1.664  1.629  1.595  1.562  1.539
+ 50     /  6:   ....  1.907  1.885  1.847  1.813  1.778  1.743  1.708  1.674  1.642  1.619
+ 60     /  7:   ....  1.975  1.952  1.914  1.880  1.845  1.810  1.775  1.741  1.709  1.688
+ 70     /  8:   ....  2.033  2.010  1.972  1.938  1.903  1.868  1.833  1.799  1.767  1.745
+ 80     /  9:   ....  2.080  2.061  2.023  1.989  1.954  1.919  1.884  1.850  1.817  1.792
+ 90     / 10:   ....  2.119  2.102  2.065  2.031  1.996  1.961  1.927  1.893  1.861  1.832
+ 100    / 11:   ....   ....  2.118  2.087  2.054  2.020  1.986  1.953  1.922  1.895   ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+          SMXT_XS  SMXT_TS  SMXT
+1    /  1:   173.0    274.  2.632
+2    /  2:   174.0    274.  2.615
+3    /  3:   175.0    274.  2.597
+4    /  4:   176.0    274.  2.580
+5    /  5:   177.0    274.  2.563
+6    /  6:   178.0    274.  2.545
+7    /  7:   179.0    274.  2.528
+8    /  8:   180.0    274.  2.510
+9    /  9:  -179.0    274.  2.493
+10   / 10:  -178.0    274.  2.475
+11   / 11:  -177.0    274.  2.458
+12   / 12:  -176.0    274.  2.440
+13   / 13:  -175.0    274.  2.423
+14   / 14:  -174.0    274.  2.406
+15   / 15:  -173.0    274.  2.388
+16   / 16:   173.0    821.  3.062
+17   / 17:   174.0    821.  3.045
+18   / 18:   175.0    821.  3.027
+19   / 19:   176.0    821.  3.010
+20   / 20:   177.0    821.  2.992
+21   / 21:   178.0    821.  2.975
+22   / 22:   179.0    821.  2.958
+23   / 23:   180.0    821.  2.940
+24   / 24:  -179.0    821.  2.923
+25   / 25:  -178.0    821.  2.905
+26   / 26:  -177.0    821.  2.888
+27   / 27:  -176.0    821.  2.870
+28   / 28:  -175.0    821.  2.853
+29   / 29:  -174.0    821.  2.836
+30   / 30:  -173.0    821.  2.818
+31   / 31:   173.0   1369.  3.274
+32   / 32:   174.0   1369.  3.256
+33   / 33:   175.0   1369.  3.239
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                    170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.632  2.615  2.580  2.545  2.510  2.475  2.440  2.406  2.388   ....
+ 15-FEB-1995 /  2:   ....  3.168  3.151  3.116  3.081  3.046  3.011  2.976  2.942  2.924   ....
+ 18-MAR-1995 /  3:   ....  3.416  3.398  3.363  3.329  3.294  3.259  3.224  3.189  3.172   ....
+ 17-APR-1995 /  4:   ....  3.522  3.505  3.470  3.435  3.400  3.365  3.331  3.296  3.278   ....
+ 17-MAY-1995 /  5:   ....  3.643  3.626  3.591  3.557  3.522  3.487  3.452  3.417  3.400   ....
+ 17-JUN-1995 /  6:   ....  3.741  3.723  3.688  3.654  3.619  3.584  3.549  3.514  3.497   ....
+ 17-JUL-1995 /  7:   ....  3.794  3.777  3.742  3.707  3.672  3.638  3.603  3.568  3.551   ....
+ 17-AUG-1995 /  8:   ....  3.864  3.846  3.812  3.777  3.742  3.707  3.672  3.637  3.620   ....
+ 16-SEP-1995 /  9:   ....  3.924  3.907  3.872  3.837  3.803  3.768  3.733  3.698  3.681   ....
+ 16-OCT-1995 / 10:   ....  3.960  3.943  3.908  3.873  3.838  3.804  3.769  3.734  3.717   ....
+ 16-NOV-1995 / 11:   ....  4.009  3.992  3.957  3.922  3.887  3.852  3.817  3.783  3.765   ....
+ 16-DEC-1995 / 12:   ....  4.053  4.036  4.001  3.966  3.931  3.896  3.862  3.827  3.809   ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                    170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.800  2.655  2.647  2.612  2.577  2.542  2.507  2.473  2.463  2.525
+ 15-FEB-1995 /  2:   ....  3.120  3.185  3.136  3.101  3.066  3.031  2.997  2.962  2.925  2.845
+ 18-MAR-1995 /  3:   ....  3.369  3.391  3.342  3.308  3.273  3.238  3.203  3.169  3.131  3.094
+ 17-APR-1995 /  4:   ....  3.534  3.522  3.484  3.449  3.414  3.380  3.345  3.310  3.280  3.260
+ 17-MAY-1995 /  5:   ....  3.654  3.631  3.593  3.558  3.523  3.488  3.454  3.419  3.389  3.379
+ 17-JUN-1995 /  6:   ....  3.744  3.718  3.679  3.645  3.610  3.575  3.540  3.506  3.475  3.470
+ 17-JUL-1995 /  7:   ....  3.814  3.786  3.750  3.715  3.680  3.645  3.610  3.576  3.547  3.540
+ 17-AUG-1995 /  8:   ....  3.876  3.849  3.812  3.777  3.742  3.708  3.673  3.638  3.609  3.602
+ 16-SEP-1995 /  9:   ....  3.931  3.905  3.866  3.832  3.797  3.762  3.727  3.693  3.662  3.656
+ 16-OCT-1995 / 10:   ....  3.977  3.950  3.913  3.879  3.844  3.809  3.774  3.740  3.710  3.702
+ 16-NOV-1995 / 11:   ....  4.019  3.995  3.957  3.922  3.887  3.852  3.818  3.783  3.753  3.744
+ 16-DEC-1995 / 12:   ....  4.058  4.034  3.996  3.961  3.926  3.891  3.856  3.822  3.791  3.782
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+          SMYZ_YS  SMYZ_ZS  SMYZ
+1    /  1:   13.00   15.00  1.520
+2    /  2:   14.00   15.00  1.502
+3    /  3:   15.00   15.00  1.485
+4    /  4:   16.00   15.00  1.468
+5    /  5:   17.00   15.00  1.450
+6    /  6:   18.00   15.00  1.433
+7    /  7:   19.00   15.00  1.415
+8    /  8:   20.00   15.00  1.398
+9    /  9:   21.00   15.00  1.380
+10   / 10:   22.00   15.00  1.363
+11   / 11:   23.00   15.00  1.346
+12   / 12:   24.00   15.00  1.328
+13   / 13:   25.00   15.00  1.311
+14   / 14:   26.00   15.00  1.293
+15   / 15:   27.00   15.00  1.276
+16   / 16:   13.00   20.00  1.599
+17   / 17:   14.00   20.00  1.582
+18   / 18:   15.00   20.00  1.564
+19   / 19:   16.00   20.00  1.547
+20   / 20:   17.00   20.00  1.529
+21   / 21:   18.00   20.00  1.512
+22   / 22:   19.00   20.00  1.495
+23   / 23:   20.00   20.00  1.477
+24   / 24:   21.00   20.00  1.460
+25   / 25:   22.00   20.00  1.442
+26   / 26:   23.00   20.00  1.425
+27   / 27:   24.00   20.00  1.407
+28   / 28:   25.00   20.00  1.390
+29   / 29:   26.00   20.00  1.373
+30   / 30:   27.00   20.00  1.355
+31   / 31:   13.00   25.00  1.666
+32   / 32:   14.00   25.00  1.649
+33   / 33:   15.00   25.00  1.631
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....  1.520  1.502  1.468  1.433  1.398  1.363  1.328  1.293  1.276   ....
+ 20     /  3:   ....  1.596  1.579  1.544  1.509  1.475  1.440  1.405  1.370  1.353   ....
+ 30     /  4:   ....  1.722  1.705  1.670  1.636  1.601  1.566  1.531  1.496  1.479   ....
+ 40     /  5:   ....  1.820  1.803  1.768  1.733  1.698  1.663  1.628  1.594  1.576   ....
+ 50     /  6:   ....  1.899  1.882  1.847  1.812  1.778  1.743  1.708  1.673  1.656   ....
+ 60     /  7:   ....  1.966  1.949  1.914  1.880  1.845  1.810  1.775  1.740  1.723   ....
+ 70     /  8:   ....  2.025  2.007  1.972  1.938  1.903  1.868  1.833  1.798  1.781   ....
+ 80     /  9:   ....  2.076  2.058  2.024  1.989  1.954  1.919  1.884  1.849  1.832   ....
+ 90     / 10:   ....  2.100  2.082  2.047  2.013  1.978  1.943  1.908  1.873  1.856   ....
+ 100    / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....   ....  1.460  1.433  1.401  1.367  1.333  1.299  1.269  1.245   ....
+ 20     /  3:   ....  1.626  1.566  1.536  1.499  1.464  1.429  1.394  1.359  1.334  1.352
+ 30     /  4:   ....  1.730  1.714  1.675  1.641  1.606  1.571  1.536  1.502  1.469  1.449
+ 40     /  5:   ....  1.825  1.807  1.768  1.734  1.699  1.664  1.629  1.595  1.562  1.539
+ 50     /  6:   ....  1.907  1.885  1.847  1.813  1.778  1.743  1.708  1.674  1.642  1.619
+ 60     /  7:   ....  1.975  1.952  1.914  1.880  1.845  1.810  1.775  1.741  1.709  1.688
+ 70     /  8:   ....  2.033  2.010  1.972  1.938  1.903  1.868  1.833  1.799  1.767  1.745
+ 80     /  9:   ....  2.080  2.061  2.023  1.989  1.954  1.919  1.884  1.850  1.817  1.792
+ 90     / 10:   ....  2.119  2.102  2.065  2.031  1.996  1.961  1.927  1.893  1.861  1.832
+ 100    / 11:   ....   ....  2.118  2.087  2.054  2.020  1.986  1.953  1.922  1.895   ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+          SMYT_YS  SMYT_TS  SMYT
+1    /  1:   13.00    274.  2.632
+2    /  2:   14.00    274.  2.615
+3    /  3:   15.00    274.  2.597
+4    /  4:   16.00    274.  2.580
+5    /  5:   17.00    274.  2.563
+6    /  6:   18.00    274.  2.545
+7    /  7:   19.00    274.  2.528
+8    /  8:   20.00    274.  2.510
+9    /  9:   21.00    274.  2.493
+10   / 10:   22.00    274.  2.475
+11   / 11:   23.00    274.  2.458
+12   / 12:   24.00    274.  2.440
+13   / 13:   25.00    274.  2.423
+14   / 14:   26.00    274.  2.406
+15   / 15:   27.00    274.  2.388
+16   / 16:   13.00    821.  3.062
+17   / 17:   14.00    821.  3.045
+18   / 18:   15.00    821.  3.027
+19   / 19:   16.00    821.  3.010
+20   / 20:   17.00    821.  2.992
+21   / 21:   18.00    821.  2.975
+22   / 22:   19.00    821.  2.958
+23   / 23:   20.00    821.  2.940
+24   / 24:   21.00    821.  2.923
+25   / 25:   22.00    821.  2.905
+26   / 26:   23.00    821.  2.888
+27   / 27:   24.00    821.  2.870
+28   / 28:   25.00    821.  2.853
+29   / 29:   26.00    821.  2.836
+30   / 30:   27.00    821.  2.818
+31   / 31:   13.00   1369.  3.274
+32   / 32:   14.00   1369.  3.256
+33   / 33:   15.00   1369.  3.239
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                     10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.632  2.615  2.580  2.545  2.510  2.475  2.440  2.406  2.388   ....
+ 15-FEB-1995 /  2:   ....  3.168  3.151  3.116  3.081  3.046  3.011  2.976  2.942  2.924   ....
+ 18-MAR-1995 /  3:   ....  3.416  3.398  3.363  3.329  3.294  3.259  3.224  3.189  3.172   ....
+ 17-APR-1995 /  4:   ....  3.522  3.505  3.470  3.435  3.400  3.365  3.331  3.296  3.278   ....
+ 17-MAY-1995 /  5:   ....  3.643  3.626  3.591  3.557  3.522  3.487  3.452  3.417  3.400   ....
+ 17-JUN-1995 /  6:   ....  3.741  3.723  3.688  3.654  3.619  3.584  3.549  3.514  3.497   ....
+ 17-JUL-1995 /  7:   ....  3.794  3.777  3.742  3.707  3.672  3.638  3.603  3.568  3.551   ....
+ 17-AUG-1995 /  8:   ....  3.864  3.846  3.812  3.777  3.742  3.707  3.672  3.637  3.620   ....
+ 16-SEP-1995 /  9:   ....  3.924  3.907  3.872  3.837  3.803  3.768  3.733  3.698  3.681   ....
+ 16-OCT-1995 / 10:   ....  3.960  3.943  3.908  3.873  3.838  3.804  3.769  3.734  3.717   ....
+ 16-NOV-1995 / 11:   ....  4.009  3.992  3.957  3.922  3.887  3.852  3.817  3.783  3.765   ....
+ 16-DEC-1995 / 12:   ....  4.053  4.036  4.001  3.966  3.931  3.896  3.862  3.827  3.809   ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                     10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.800  2.655  2.647  2.612  2.577  2.542  2.507  2.473  2.463  2.525
+ 15-FEB-1995 /  2:   ....  3.120  3.185  3.136  3.101  3.066  3.031  2.997  2.962  2.925  2.845
+ 18-MAR-1995 /  3:   ....  3.369  3.391  3.342  3.308  3.273  3.238  3.203  3.169  3.131  3.094
+ 17-APR-1995 /  4:   ....  3.534  3.522  3.484  3.449  3.414  3.380  3.345  3.310  3.280  3.260
+ 17-MAY-1995 /  5:   ....  3.654  3.631  3.593  3.558  3.523  3.488  3.454  3.419  3.389  3.379
+ 17-JUN-1995 /  6:   ....  3.744  3.718  3.679  3.645  3.610  3.575  3.540  3.506  3.475  3.470
+ 17-JUL-1995 /  7:   ....  3.814  3.786  3.750  3.715  3.680  3.645  3.610  3.576  3.547  3.540
+ 17-AUG-1995 /  8:   ....  3.876  3.849  3.812  3.777  3.742  3.708  3.673  3.638  3.609  3.602
+ 16-SEP-1995 /  9:   ....  3.931  3.905  3.866  3.832  3.797  3.762  3.727  3.693  3.662  3.656
+ 16-OCT-1995 / 10:   ....  3.977  3.950  3.913  3.879  3.844  3.809  3.774  3.740  3.710  3.702
+ 16-NOV-1995 / 11:   ....  4.019  3.995  3.957  3.922  3.887  3.852  3.818  3.783  3.753  3.744
+ 16-DEC-1995 / 12:   ....  4.058  4.034  3.996  3.961  3.926  3.891  3.856  3.822  3.791  3.782
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+          SMZT_ZS  SMZT_TS  SMZT
+1    /  1:   15.00    274.  3.908
+2    /  2:   20.00    274.  3.987
+3    /  3:   25.00    274.  4.054
+4    /  4:   30.00    274.  4.112
+5    /  5:   35.00    274.  4.163
+6    /  6:   40.00    274.  4.209
+7    /  7:   45.00    274.  4.251
+8    /  8:   50.00    274.  4.288
+9    /  9:   55.00    274.  4.323
+10   / 10:   60.00    274.  4.355
+11   / 11:   65.00    274.  4.385
+12   / 12:   70.00    274.  4.413
+13   / 13:   75.00    274.  4.440
+14   / 14:   80.00    274.  4.464
+15   / 15:   85.00    274.  4.488
+16   / 16:   15.00    821.  4.338
+17   / 17:   20.00    821.  4.417
+18   / 18:   25.00    821.  4.484
+19   / 19:   30.00    821.  4.542
+20   / 20:   35.00    821.  4.593
+21   / 21:   40.00    821.  4.639
+22   / 22:   45.00    821.  4.681
+23   / 23:   50.00    821.  4.718
+24   / 24:   55.00    821.  4.753
+25   / 25:   60.00    821.  4.785
+26   / 26:   65.00    821.  4.815
+27   / 27:   70.00    821.  4.843
+28   / 28:   75.00    821.  4.870
+29   / 29:   80.00    821.  4.894
+30   / 30:   85.00    821.  4.918
+31   / 31:   15.00   1369.  4.550
+32   / 32:   20.00   1369.  4.629
+33   / 33:   25.00   1369.  4.696
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                     0      10     20     30     40     50     60     70     80     90    100    
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  3.908  3.985  4.111  4.208  4.288  4.355  4.413  4.464  4.488   ....
+ 15-FEB-1995 /  2:   ....  4.444  4.521  4.647  4.744  4.824  4.891  4.949  5.000  5.024   ....
+ 18-MAR-1995 /  3:   ....  4.692  4.768  4.894  4.992  5.071  5.138  5.196  5.248  5.271   ....
+ 17-APR-1995 /  4:   ....  4.798  4.875  5.001  5.098  5.178  5.245  5.303  5.354  5.378   ....
+ 17-MAY-1995 /  5:   ....  4.920  4.996  5.122  5.220  5.299  5.366  5.424  5.476  5.499   ....
+ 17-JUN-1995 /  6:   ....  5.017  5.093  5.219  5.317  5.396  5.463  5.521  5.573  5.596   ....
+ 17-JUL-1995 /  7:   ....  5.070  5.147  5.273  5.370  5.450  5.517  5.575  5.626  5.650   ....
+ 17-AUG-1995 /  8:   ....  5.140  5.216  5.342  5.440  5.519  5.586  5.645  5.696  5.720   ....
+ 16-SEP-1995 /  9:   ....  5.200  5.277  5.403  5.501  5.580  5.647  5.705  5.756  5.780   ....
+ 16-OCT-1995 / 10:   ....  5.236  5.313  5.439  5.537  5.616  5.683  5.741  5.792  5.816   ....
+ 16-NOV-1995 / 11:   ....  5.285  5.362  5.488  5.585  5.665  5.732  5.790  5.841  5.865   ....
+ 16-DEC-1995 / 12:   ....  5.329  5.406  5.532  5.629  5.709  5.776  5.834  5.885  5.909   ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                     0      10     20     30     40     50     60     70     80     90    100    
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  4.013  4.011  4.182  4.278  4.356  4.423  4.481  4.531  4.591  4.665
+ 15-FEB-1995 /  2:   ....  4.333  4.541  4.671  4.767  4.845  4.912  4.970  5.020  5.053  4.985
+ 18-MAR-1995 /  3:   ....  4.582  4.746  4.878  4.973  5.052  5.118  5.176  5.227  5.259  5.234
+ 17-APR-1995 /  4:   ....  4.748  4.877  5.019  5.115  5.194  5.260  5.318  5.368  5.408  5.399
+ 17-MAY-1995 /  5:   ....  4.868  4.986  5.128  5.224  5.303  5.369  5.427  5.477  5.517  5.519
+ 17-JUN-1995 /  6:   ....  4.959  5.074  5.215  5.310  5.389  5.455  5.513  5.564  5.602  5.609
+ 17-JUL-1995 /  7:   ....  5.028  5.141  5.285  5.381  5.459  5.526  5.584  5.634  5.675  5.679
+ 17-AUG-1995 /  8:   ....  5.090  5.205  5.347  5.443  5.522  5.588  5.646  5.696  5.736  5.742
+ 16-SEP-1995 /  9:   ....  5.144  5.261  5.402  5.497  5.576  5.643  5.700  5.751  5.790  5.796
+ 16-OCT-1995 / 10:   ....  5.189  5.306  5.449  5.544  5.623  5.689  5.747  5.798  5.838  5.842
+ 16-NOV-1995 / 11:   ....  5.230  5.351  5.492  5.588  5.667  5.733  5.791  5.841  5.881  5.885
+ 16-DEC-1995 / 12:   ....  5.268  5.391  5.531  5.626  5.705  5.772  5.829  5.880  5.919  5.923
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G009)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                68.25N 68.75N 69.25N 69.75N 70.25N 70.75N 71.25N 71.75N 
+                 43     44     45     46     47     48     49     50
+ 15.5E / -105:   ....   ....   ....   ....   ....   ....   ....   ....
+ 16.5E / -104:   ....   ....   ....   ....   ....   ....   ....   ....
+ 17.5E / -103:   ....   ....   ....   ....   ....   ....   ....   ....
+ 18.5E / -102:   ....   ....   ....  0.451  0.259   ....   ....   ....
+ 19.5E / -101:   ....   ....  0.670  0.523  0.173  0.040   ....   ....
+ 20.5E / -100:   ....   ....   ....  0.451  0.259   ....   ....   ....
+ 21.5E /  -99:   ....   ....   ....   ....   ....   ....   ....   ....
+ 22.5E /  -98:   ....   ....   ....   ....   ....   ....   ....   ....
+ 23.5E /  -97:   ....   ....   ....   ....   ....   ....   ....   ....
+ 24.5E /  -96:   ....   ....   ....   ....   ....   ....   ....   ....
+ 25.5E /  -95:   ....   ....   ....   ....   ....   ....   ....   ....
+ 26.5E /  -94:   ....   ....   ....   ....   ....   ....   ....   ....
+ 27.5E /  -93:   ....   ....   ....   ....   ....   ....   ....   ....
+ 28.5E /  -92:   ....   ....   ....   ....  1.170   ....   ....   ....
+ 29.5E /  -91:   ....   ....   ....  1.170  1.170  1.170   ....   ....
+ 30.5E /  -90:   ....   ....   ....   ....  1.170   ....   ....   ....
+ 31.5E /  -89:   ....   ....   ....   ....   ....   ....   ....   ....
+ 32.5E /  -88:   ....   ....   ....   ....   ....   ....   ....   ....
+ 33.5E /  -87:   ....   ....   ....   ....   ....   ....   ....   ....
+ 34.5E /  -86:   ....   ....   ....   ....   ....   ....   ....   ....
+ 35.5E /  -85:   ....   ....  1.340   ....   ....   ....   ....   ....
+ 36.5E /  -84:   ....  1.340  1.340  1.340   ....   ....   ....   ....
+ 37.5E /  -83:   ....   ....  1.340   ....   ....   ....   ....   ....
+ 38.5E /  -82:   ....   ....   ....   ....   ....   ....   ....   ....
+ 39.5E /  -81:   ....   ....   ....   ....   ....   ....   ....   ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.0
+ 172E   /  2:  172.0
+ 174E   /  3:  174.0
+ 176E   /  4:  176.0
+ 178E   /  5:  178.0
+ 180E   /  6:  180.0
+ 178W   /  7:  182.0
+ 176W   /  8:  184.0
+ 174W   /  9:  186.0
+ 172W   / 10:  188.0
+ 170W   / 11:  190.0
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+          SMXY_XS  SMXY_YS   SMXY
+1    /  1:   173.0   13.00  0.2437
+2    /  2:   174.0   13.00  0.2264
+3    /  3:   175.0   13.00  0.2090
+4    /  4:   176.0   13.00  0.1916
+5    /  5:   177.0   13.00  0.1742
+6    /  6:   178.0   13.00  0.1568
+7    /  7:   179.0   13.00  0.1393
+8    /  8:   180.0   13.00  0.1219
+9    /  9:  -179.0   13.00  0.1044
+10   / 10:  -178.0   13.00  0.0870
+11   / 11:  -177.0   13.00  0.0695
+12   / 12:  -176.0   13.00  0.0521
+13   / 13:  -175.0   13.00  0.0347
+14   / 14:  -174.0   13.00  0.0173
+15   / 15:  -173.0   13.00  0.0000
+16   / 16:   173.0   14.00  0.2264
+17   / 17:   174.0   14.00  0.2091
+18   / 18:   175.0   14.00  0.1917
+19   / 19:   176.0   14.00  0.1743
+20   / 20:   177.0   14.00  0.1569
+21   / 21:   178.0   14.00  0.1394
+22   / 22:   179.0   14.00  0.1220
+23   / 23:   180.0   14.00  0.1045
+24   / 24:  -179.0   14.00  0.0871
+25   / 25:  -178.0   14.00  0.0696
+26   / 26:  -177.0   14.00  0.0522
+27   / 27:  -176.0   14.00  0.0348
+28   / 28:  -175.0   14.00  0.0174
+29   / 29:  -174.0   14.00  0.0000
+30   / 30:  -173.0   14.00 -0.0173
+31   / 31:   173.0   15.00  0.2090
+32   / 32:   174.0   15.00  0.1917
+33   / 33:   175.0   15.00  0.1743
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+              170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                1      2      3      4      5      6      7      8      9     10     11
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+         SMXYT_XS  SMXYT_Y SMXYT_T  SMXYT
+1    /  1:   173.0   13.00   273.8  2.754
+2    /  2:   174.0   13.00   273.8  2.737
+3    /  3:   175.0   13.00   273.8  2.719
+4    /  4:   176.0   13.00   273.8  2.702
+5    /  5:   177.0   13.00   273.8  2.684
+6    /  6:   178.0   13.00   273.8  2.667
+7    /  7:   179.0   13.00   273.8  2.650
+8    /  8:   180.0   13.00   273.8  2.632
+9    /  9:  -179.0   13.00   273.8  2.615
+10   / 10:  -178.0   13.00   273.8  2.597
+11   / 11:  -177.0   13.00   273.8  2.580
+12   / 12:  -176.0   13.00   273.8  2.562
+13   / 13:  -175.0   13.00   273.8  2.545
+14   / 14:  -174.0   13.00   273.8  2.528
+15   / 15:  -173.0   13.00   273.8  2.510
+16   / 16:   173.0   14.00   273.8  2.737
+17   / 17:   174.0   14.00   273.8  2.719
+18   / 18:   175.0   14.00   273.8  2.702
+19   / 19:   176.0   14.00   273.8  2.684
+20   / 20:   177.0   14.00   273.8  2.667
+21   / 21:   178.0   14.00   273.8  2.650
+22   / 22:   179.0   14.00   273.8  2.632
+23   / 23:   180.0   14.00   273.8  2.615
+24   / 24:  -179.0   14.00   273.8  2.597
+25   / 25:  -178.0   14.00   273.8  2.580
+26   / 26:  -177.0   14.00   273.8  2.562
+27   / 27:  -176.0   14.00   273.8  2.545
+28   / 28:  -175.0   14.00   273.8  2.528
+29   / 29:  -174.0   14.00   273.8  2.510
+30   / 30:  -173.0   14.00   273.8  2.493
+31   / 31:   173.0   15.00   273.8  2.719
+32   / 32:   174.0   15.00   273.8  2.702
+33   / 33:   175.0   15.00   273.8  2.685
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+              170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                1      2      3      4      5      6      7      8      9     10     11
+ ---- L:1 T:   16-JAN-1995 05:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:2 T:   15-FEB-1995 15:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:3 T:   18-MAR-1995 01:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:4 T:   17-APR-1995 11:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:5 T:   17-MAY-1995 21:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:6 T:   17-JUN-1995 07:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:7 T:   17-JUL-1995 17:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:8 T:   17-AUG-1995 03:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:9 T:   16-SEP-1995 13:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:10 T:   16-OCT-1995 23:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:11 T:   16-NOV-1995 09:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:12 T:   16-DEC-1995 19:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: 01-JAN-1995 00:00 to 01-JAN-1996 00:00
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                  LTP50_TAX  LOGTP50
+06-JAN-1995 16 /  1:    137.   2.272
+18-JAN-1995 02 /  2:    411.   2.663
+29-JAN-1995 12 /  3:    684.   2.866
+09-FEB-1995 22 /  4:    958.   3.004
+21-FEB-1995 07 /  5:   1232.   3.108
+04-MAR-1995 17 /  6:   1506.   3.192
+16-MAR-1995 03 /  7:   1779.   3.262
+27-MAR-1995 13 /  8:   2053.   3.323
+07-APR-1995 22 /  9:   2327.   3.376
+19-APR-1995 08 / 10:   2601.   3.423
+30-APR-1995 18 / 11:   2874.   3.466
+12-MAY-1995 04 / 12:   3148.   3.505
+23-MAY-1995 13 / 13:   3422.   3.541
+03-JUN-1995 23 / 14:   3696.   3.574
+15-JUN-1995 09 / 15:   3969.   3.604
+26-JUN-1995 19 / 16:   4243.   3.633
+08-JUL-1995 04 / 17:   4517.   3.660
+19-JUL-1995 14 / 18:   4791.   3.685
+31-JUL-1995 00 / 19:   5064.   3.709
+11-AUG-1995 10 / 20:   5338.   3.731
+22-AUG-1995 19 / 21:   5612.   3.753
+03-SEP-1995 05 / 22:   5886.   3.773
+14-SEP-1995 15 / 23:   6159.   3.793
+26-SEP-1995 01 / 24:   6433.   3.812
+07-OCT-1995 10 / 25:   6707.   3.830
+18-OCT-1995 20 / 26:   6981.   3.847
+30-OCT-1995 06 / 27:   7254.   3.864
+10-NOV-1995 16 / 28:   7528.   3.880
+22-NOV-1995 01 / 29:   7802.   3.895
+03-DEC-1995 11 / 30:   8076.   3.910
+14-DEC-1995 21 / 31:   8349.   3.924
+26-DEC-1995 07 / 32:   8623.   3.938
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: 01-JAN-1995 00:00 to 01-JAN-1996 00:00
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                 NEW_TAX   AVE_T  T_CNT
+16-JAN-1995 /  1:    365.  2.600  3.000
+15-FEB-1995 /  2:   1095.  3.056  2.000
+18-MAR-1995 /  3:   1825.  3.259  3.000
+17-APR-1995 /  4:   2555.  3.422  3.000
+17-MAY-1995 /  5:   3285.  3.523  2.000
+17-JUN-1995 /  6:   4015.  3.603  3.000
+17-JUL-1995 /  7:   4745.  3.684  3.000
+17-AUG-1995 /  8:   5475.  3.742  2.000
+16-SEP-1995 /  9:   6205.  3.793  3.000
+16-OCT-1995 / 10:   6935.  3.847  3.000
+16-NOV-1995 / 11:   7665.  3.887  2.000
+16-DEC-1995 / 12:   8395.  3.924  3.000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.0    1.0    2.0    3.0    4.0
+ 1   / 2:    5.0    6.0    7.0    8.0    9.0
+ 2   / 3:   10.0   11.0   12.0   13.0   14.0
+ 3   / 4:   15.0   16.0   17.0   18.0   19.0
+ ---- K:2 Z:   1
+ 0   / 1:   20.0   21.0   22.0   23.0   24.0
+ 1   / 2:   25.0   26.0   27.0   28.0   29.0
+ 2   / 3:   30.0   31.0   32.0   33.0   34.0
+ 3   / 4:   35.0   36.0   37.0   38.0   39.0
+ ---- K:3 Z:   2
+ 0   / 1:   40.0   41.0   42.0   43.0   44.0
+ 1   / 2:   45.0   46.0   47.0   48.0   49.0
+ 2   / 3:   50.0   51.0   52.0   53.0   54.0
+ 3   / 4:   55.0   56.0   57.0   58.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.0   61.0   62.0   63.0   64.0
+ 1   / 2:   65.0   66.0   67.0   68.0   69.0
+ 2   / 3:   70.0   71.0   72.0   73.0   74.0
+ 3   / 4:   75.0   76.0   77.0   78.0   79.0
+ ---- K:2 Z:   1
+ 0   / 1:   80.0   81.0   82.0   83.0   84.0
+ 1   / 2:   85.0   86.0   87.0   88.0   89.0
+ 2   / 3:   90.0   91.0   92.0   93.0   94.0
+ 3   / 4:   95.0   96.0   97.0   98.0   99.0
+ ---- K:3 Z:   2
+ 0   / 1:  100.0  101.0  102.0  103.0  104.0
+ 1   / 2:  105.0  106.0  107.0  108.0  109.0
+ 2   / 3:  110.0  111.0  112.0  113.0  114.0
+ 3   / 4:  115.0  116.0  117.0  118.0  119.0
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+             1      2      3      4    
+             1      2      3      4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.0    5.0   10.0   15.0
+ 2   / 2:    1.0    6.0   11.0   16.0
+ 3   / 3:    2.0    7.0   12.0   17.0
+ 4   / 4:    3.0    8.0   13.0   18.0
+ 5   / 5:    4.0    9.0   14.0   19.0
+ ---- K:2 Z:   1
+ 1   / 1:   20.0   25.0   30.0   35.0
+ 2   / 2:   21.0   26.0   31.0   36.0
+ 3   / 3:   22.0   27.0   32.0   37.0
+ 4   / 4:   23.0   28.0   33.0   38.0
+ 5   / 5:   24.0   29.0   34.0   39.0
+ ---- K:3 Z:   2
+ 1   / 1:   40.0   45.0   50.0   55.0
+ 2   / 2:   41.0   46.0   51.0   56.0
+ 3   / 3:   42.0   47.0   52.0   57.0
+ 4   / 4:   43.0   48.0   53.0   58.0
+ 5   / 5:   44.0   49.0   54.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.0   65.0   70.0   75.0
+ 2   / 2:   61.0   66.0   71.0   76.0
+ 3   / 3:   62.0   67.0   72.0   77.0
+ 4   / 4:   63.0   68.0   73.0   78.0
+ 5   / 5:   64.0   69.0   74.0   79.0
+ ---- K:2 Z:   1
+ 1   / 1:   80.0   85.0   90.0   95.0
+ 2   / 2:   81.0   86.0   91.0   96.0
+ 3   / 3:   82.0   87.0   92.0   97.0
+ 4   / 4:   83.0   88.0   93.0   98.0
+ 5   / 5:   84.0   89.0   94.0   99.0
+ ---- K:3 Z:   2
+ 1   / 1:  100.0  105.0  110.0  115.0
+ 2   / 2:  101.0  106.0  111.0  116.0
+ 3   / 3:  102.0  107.0  112.0  117.0
+ 4   / 4:  103.0  108.0  113.0  118.0
+ 5   / 5:  104.0  109.0  114.0  119.0
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.0   20.0   40.0
+ 1   / 2:    5.0   25.0   45.0
+ 2   / 3:   10.0   30.0   50.0
+ 3   / 4:   15.0   35.0   55.0
+ ---- K:2 Z:   2
+ 0   / 1:    1.0   21.0   41.0
+ 1   / 2:    6.0   26.0   46.0
+ 2   / 3:   11.0   31.0   51.0
+ 3   / 4:   16.0   36.0   56.0
+ ---- K:3 Z:   3
+ 0   / 1:    2.0   22.0   42.0
+ 1   / 2:    7.0   27.0   47.0
+ 2   / 3:   12.0   32.0   52.0
+ 3   / 4:   17.0   37.0   57.0
+ ---- K:4 Z:   4
+ 0   / 1:    3.0   23.0   43.0
+ 1   / 2:    8.0   28.0   48.0
+ 2   / 3:   13.0   33.0   53.0
+ 3   / 4:   18.0   38.0   58.0
+ ---- K:5 Z:   5
+ 0   / 1:    4.0   24.0   44.0
+ 1   / 2:    9.0   29.0   49.0
+ 2   / 3:   14.0   34.0   54.0
+ 3   / 4:   19.0   39.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.0   80.0  100.0
+ 1   / 2:   65.0   85.0  105.0
+ 2   / 3:   70.0   90.0  110.0
+ 3   / 4:   75.0   95.0  115.0
+ ---- K:2 Z:   2
+ 0   / 1:   61.0   81.0  101.0
+ 1   / 2:   66.0   86.0  106.0
+ 2   / 3:   71.0   91.0  111.0
+ 3   / 4:   76.0   96.0  116.0
+ ---- K:3 Z:   3
+ 0   / 1:   62.0   82.0  102.0
+ 1   / 2:   67.0   87.0  107.0
+ 2   / 3:   72.0   92.0  112.0
+ 3   / 4:   77.0   97.0  117.0
+ ---- K:4 Z:   4
+ 0   / 1:   63.0   83.0  103.0
+ 1   / 2:   68.0   88.0  108.0
+ 2   / 3:   73.0   93.0  113.0
+ 3   / 4:   78.0   98.0  118.0
+ ---- K:5 Z:   5
+ 0   / 1:   64.0   84.0  104.0
+ 1   / 2:   69.0   89.0  109.0
+ 2   / 3:   74.0   94.0  114.0
+ 3   / 4:   79.0   99.0  119.0
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.0   60.0
+ 1   / 2:    5.0   65.0
+ 2   / 3:   10.0   70.0
+ 3   / 4:   15.0   75.0
+ ---- K:2 Z:   1
+ 0   / 1:   20.0   80.0
+ 1   / 2:   25.0   85.0
+ 2   / 3:   30.0   90.0
+ 3   / 4:   35.0   95.0
+ ---- K:3 Z:   2
+ 0   / 1:   40.0  100.0
+ 1   / 2:   45.0  105.0
+ 2   / 3:   50.0  110.0
+ 3   / 4:   55.0  115.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.0   61.0
+ 1   / 2:    6.0   66.0
+ 2   / 3:   11.0   71.0
+ 3   / 4:   16.0   76.0
+ ---- K:2 Z:   1
+ 0   / 1:   21.0   81.0
+ 1   / 2:   26.0   86.0
+ 2   / 3:   31.0   91.0
+ 3   / 4:   36.0   96.0
+ ---- K:3 Z:   2
+ 0   / 1:   41.0  101.0
+ 1   / 2:   46.0  106.0
+ 2   / 3:   51.0  111.0
+ 3   / 4:   56.0  116.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.0   62.0
+ 1   / 2:    7.0   67.0
+ 2   / 3:   12.0   72.0
+ 3   / 4:   17.0   77.0
+ ---- K:2 Z:   1
+ 0   / 1:   22.0   82.0
+ 1   / 2:   27.0   87.0
+ 2   / 3:   32.0   92.0
+ 3   / 4:   37.0   97.0
+ ---- K:3 Z:   2
+ 0   / 1:   42.0  102.0
+ 1   / 2:   47.0  107.0
+ 2   / 3:   52.0  112.0
+ 3   / 4:   57.0  117.0
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.0   63.0
+ 1   / 2:    8.0   68.0
+ 2   / 3:   13.0   73.0
+ 3   / 4:   18.0   78.0
+ ---- K:2 Z:   1
+ 0   / 1:   23.0   83.0
+ 1   / 2:   28.0   88.0
+ 2   / 3:   33.0   93.0
+ 3   / 4:   38.0   98.0
+ ---- K:3 Z:   2
+ 0   / 1:   43.0  103.0
+ 1   / 2:   48.0  108.0
+ 2   / 3:   53.0  113.0
+ 3   / 4:   58.0  118.0
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.0   64.0
+ 1   / 2:    9.0   69.0
+ 2   / 3:   14.0   74.0
+ 3   / 4:   19.0   79.0
+ ---- K:2 Z:   1
+ 0   / 1:   24.0   84.0
+ 1   / 2:   29.0   89.0
+ 2   / 3:   34.0   94.0
+ 3   / 4:   39.0   99.0
+ ---- K:3 Z:   2
+ 0   / 1:   44.0  104.0
+ 1   / 2:   49.0  109.0
+ 2   / 3:   54.0  114.0
+ 3   / 4:   59.0  119.0
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.0    1.0    2.0    3.0    4.0
+ 2   / 2:   20.0   21.0   22.0   23.0   24.0
+ 3   / 3:   40.0   41.0   42.0   43.0   44.0
+ ---- K:2 Z:   2
+ 1   / 1:    5.0    6.0    7.0    8.0    9.0
+ 2   / 2:   25.0   26.0   27.0   28.0   29.0
+ 3   / 3:   45.0   46.0   47.0   48.0   49.0
+ ---- K:3 Z:   3
+ 1   / 1:   10.0   11.0   12.0   13.0   14.0
+ 2   / 2:   30.0   31.0   32.0   33.0   34.0
+ 3   / 3:   50.0   51.0   52.0   53.0   54.0
+ ---- K:4 Z:   4
+ 1   / 1:   15.0   16.0   17.0   18.0   19.0
+ 2   / 2:   35.0   36.0   37.0   38.0   39.0
+ 3   / 3:   55.0   56.0   57.0   58.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.0   61.0   62.0   63.0   64.0
+ 2   / 2:   80.0   81.0   82.0   83.0   84.0
+ 3   / 3:  100.0  101.0  102.0  103.0  104.0
+ ---- K:2 Z:   2
+ 1   / 1:   65.0   66.0   67.0   68.0   69.0
+ 2   / 2:   85.0   86.0   87.0   88.0   89.0
+ 3   / 3:  105.0  106.0  107.0  108.0  109.0
+ ---- K:3 Z:   3
+ 1   / 1:   70.0   71.0   72.0   73.0   74.0
+ 2   / 2:   90.0   91.0   92.0   93.0   94.0
+ 3   / 3:  110.0  111.0  112.0  113.0  114.0
+ ---- K:4 Z:   4
+ 1   / 1:   75.0   76.0   77.0   78.0   79.0
+ 2   / 2:   95.0   96.0   97.0   98.0   99.0
+ 3   / 3:  115.0  116.0  117.0  118.0  119.0
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.0    1.0    2.0    3.0    4.0
+ 2   / 2:   60.0   61.0   62.0   63.0   64.0
+ ---- K:2 Z:   1
+ 1   / 1:   20.0   21.0   22.0   23.0   24.0
+ 2   / 2:   80.0   81.0   82.0   83.0   84.0
+ ---- K:3 Z:   2
+ 1   / 1:   40.0   41.0   42.0   43.0   44.0
+ 2   / 2:  100.0  101.0  102.0  103.0  104.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.0    6.0    7.0    8.0    9.0
+ 2   / 2:   65.0   66.0   67.0   68.0   69.0
+ ---- K:2 Z:   1
+ 1   / 1:   25.0   26.0   27.0   28.0   29.0
+ 2   / 2:   85.0   86.0   87.0   88.0   89.0
+ ---- K:3 Z:   2
+ 1   / 1:   45.0   46.0   47.0   48.0   49.0
+ 2   / 2:  105.0  106.0  107.0  108.0  109.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.0   11.0   12.0   13.0   14.0
+ 2   / 2:   70.0   71.0   72.0   73.0   74.0
+ ---- K:2 Z:   1
+ 1   / 1:   30.0   31.0   32.0   33.0   34.0
+ 2   / 2:   90.0   91.0   92.0   93.0   94.0
+ ---- K:3 Z:   2
+ 1   / 1:   50.0   51.0   52.0   53.0   54.0
+ 2   / 2:  110.0  111.0  112.0  113.0  114.0
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.0   16.0   17.0   18.0   19.0
+ 2   / 2:   75.0   76.0   77.0   78.0   79.0
+ ---- K:2 Z:   1
+ 1   / 1:   35.0   36.0   37.0   38.0   39.0
+ 2   / 2:   95.0   96.0   97.0   98.0   99.0
+ ---- K:3 Z:   2
+ 1   / 1:   55.0   56.0   57.0   58.0   59.0
+ 2   / 2:  115.0  116.0  117.0  118.0  119.0
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.0    1.0    2.0    3.0    4.0
+ 1   / 2:    5.0    6.0    7.0    8.0    9.0
+ 2   / 3:   10.0   11.0   12.0   13.0   14.0
+ 3   / 4:   15.0   16.0   17.0   18.0   19.0
+ ---- K:2 Z:   2
+ 0   / 1:   60.0   61.0   62.0   63.0   64.0
+ 1   / 2:   65.0   66.0   67.0   68.0   69.0
+ 2   / 3:   70.0   71.0   72.0   73.0   74.0
+ 3   / 4:   75.0   76.0   77.0   78.0   79.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.0   21.0   22.0   23.0   24.0
+ 1   / 2:   25.0   26.0   27.0   28.0   29.0
+ 2   / 3:   30.0   31.0   32.0   33.0   34.0
+ 3   / 4:   35.0   36.0   37.0   38.0   39.0
+ ---- K:2 Z:   2
+ 0   / 1:   80.0   81.0   82.0   83.0   84.0
+ 1   / 2:   85.0   86.0   87.0   88.0   89.0
+ 2   / 3:   90.0   91.0   92.0   93.0   94.0
+ 3   / 4:   95.0   96.0   97.0   98.0   99.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.0   41.0   42.0   43.0   44.0
+ 1   / 2:   45.0   46.0   47.0   48.0   49.0
+ 2   / 3:   50.0   51.0   52.0   53.0   54.0
+ 3   / 4:   55.0   56.0   57.0   58.0   59.0
+ ---- K:2 Z:   2
+ 0   / 1:  100.0  101.0  102.0  103.0  104.0
+ 1   / 2:  105.0  106.0  107.0  108.0  109.0
+ 2   / 3:  110.0  111.0  112.0  113.0  114.0
+ 3   / 4:  115.0  116.0  117.0  118.0  119.0
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+            EX#1                      ALIST
+1    /  1:  1.000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.000 ""                                           
+6    /  6:  5.000 ""                                           
+7    /  7:  4.000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+          EX#1                      BLIST
+1   / 1:  3.000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.000 ""                                           
+3   / 3:  6.000 "Something new has been added"               
+4   / 4:  4.000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 15-FEB 16:29
+                39N   
+                65
+ 141E   / 61:   8.86
+ 143E   / 62:   8.52
+ 145E   / 63:   9.29
+ 147E   / 64:  10.25
+ 149E   / 65:  10.98
+ 151E   / 66:  10.88
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: 15-FEB 16:29
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+       TSORTED_  TSORTED_SST
+1   / 1:   62.00    8.52
+2   / 2:   61.00    8.86
+3   / 3:   63.00    9.29
+4   / 4:   64.00   10.25
+5   / 5:   66.00   10.88
+6   / 6:   65.00   10.98
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : 15-JAN 11:49
+              1S    
+              45
+ 1    /  1:  23.76
+ 2    /  2:  23.86
+ 3    /  3:  23.89
+ 4    /  4:  23.95
+ 5    /  5:  23.96
+ 6    /  6:  24.02
+ 7    /  7:  24.05
+ 8    /  8:  24.09
+ 9    /  9:  24.21
+ 10   / 10:  24.28
+ 11   / 11:  24.31
+ 12   / 12:  24.36
+ 13   / 13:  24.39
+ 14   / 14:  24.46
+ 15   / 15:  24.47
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : 15-JAN 11:49
+          147.0
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : 15-FEB 16:29
+              141E   
+               61
+ 49N   / 70:  1.883
+ 47N   / 69:  2.014
+ 45N   / 68:  3.445
+ 43N   / 67:  4.559
+ 41N   / 66:  6.473
+ 39N   / 65:  8.857
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: 15-FEB 16:29
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+       TSORTED_  TSORTED_SST
+1   / 1:   70.00   1.883
+2   / 2:   69.00   2.014
+3   / 3:   68.00   3.445
+4   / 4:   67.00   4.559
+5   / 5:   66.00   6.473
+6   / 6:   65.00   8.857
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : 15-JAN 11:49
+              19E   
+               0
+ 1    /  1: -0.125
+ 2    /  2:  0.054
+ 3    /  3:  0.186
+ 4    /  4:  0.300
+ 5    /  5:  0.439
+ 6    /  6:  0.625
+ 7    /  7:  0.660
+ 8    /  8:  0.727
+ 9    /  9:  0.800
+ 10   / 10:  1.297
+ 11   / 11:  1.588
+ 12   / 12:  1.607
+ 13   / 13:  1.917
+ 14   / 14:  2.059
+ 15   / 15:  2.694
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : 15-JAN 11:49
+          32.00
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.8S
+             TIME     : 17-AUG-1982 12:00
+             131.5W 
+              99
+ 1    /  1:  24.66
+ 2    /  2:  25.26
+ 3    /  3:  25.70
+ 4    /  4:  26.06
+ 5    /  5:  26.13
+ 6    /  6:  26.13
+ 7    /  7:  26.14
+ 8    /  8:  26.16
+ 9    /  9:  26.22
+ 10   / 10:  26.31
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+          28.86
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+          28.86
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                   141E   
+                    61
+ 16-JAN      / 1:  11.03
+ 15-FEB      / 2:   8.86
+ 17-MAR      / 3:   8.39
+ 16-AUG      / 4:   ....
+ 15-JAN      / 5:  11.03
+ 14-FEB      / 6:   8.86
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+           141E   
+            61
+ 1   / 1:  11.03
+ 2   / 2:   8.39
+ 3   / 3:  11.03
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+       TSORTED_  TSORTED_SST
+1   / 1:   3.000    8.39
+2   / 2:   2.000    8.86
+3   / 3:   1.000   11.03
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                        90
+ 16-JAN-1946 12 /  1:   ....
+ 15-FEB-1946 00 /  2:   ....
+ 16-MAR-1946 12 /  3:   ....
+ 16-APR-1946 00 /  4:   ....
+ 16-MAY-1946 12 /  5:   ....
+ 16-JUN-1946 00 /  6:   ....
+ 16-JUL-1946 12 /  7:   ....
+ 16-AUG-1946 12 /  8:   ....
+ 16-SEP-1946 00 /  9:   ....
+ 16-OCT-1946 12 / 10:   ....
+ 16-NOV-1946 00 / 11:   ....
+ 16-DEC-1946 12 / 12:  12.35
+ 16-JAN-1947 12 / 13:   ....
+ 15-FEB-1947 00 / 14:   ....
+ 16-MAR-1947 12 / 15:   ....
+ 16-APR-1947 00 / 16:   0.00
+ 16-MAY-1947 12 / 17:   ....
+ 16-JUN-1947 00 / 18:   ....
+ 16-JUL-1947 12 / 19:   ....
+ 16-AUG-1947 12 / 20:   ....
+ 16-SEP-1947 00 / 21:   6.60
+ 16-OCT-1947 12 / 22:   ....
+ 16-NOV-1947 00 / 23:   ....
+ 16-DEC-1947 12 / 24:   ....
+ 16-JAN-1948 12 / 25:   4.50
+ 15-FEB-1948 12 / 26:   ....
+ 16-MAR-1948 12 / 27:   ....
+ 16-APR-1948 00 / 28:   ....
+ 16-MAY-1948 12 / 29:   ....
+ 16-JUN-1948 00 / 30:   4.70
+ 16-JUL-1948 12 / 31:   ....
+ 16-AUG-1948 12 / 32:   ....
+ 16-SEP-1948 00 / 33:  -5.80
+ 16-OCT-1948 12 / 34:   0.45
+ 16-NOV-1948 00 / 35:   ....
+ 16-DEC-1948 12 / 36:   ....
+ 16-JAN-1949 12 / 37:   4.23
+ 15-FEB-1949 00 / 38:  -1.08
+ 16-MAR-1949 12 / 39:   2.07
+ 16-APR-1949 00 / 40:   0.83
+ 16-MAY-1949 12 / 41:   0.00
+ 16-JUN-1949 00 / 42:   5.37
+ 16-JUL-1949 12 / 43:  -1.30
+ 16-AUG-1949 12 / 44:   1.38
+ 16-SEP-1949 00 / 45:   5.92
+ 16-OCT-1949 12 / 46:   0.71
+ 16-NOV-1949 00 / 47:  -0.94
+ 16-DEC-1949 12 / 48:  -0.52
+ 16-JAN-1950 12 / 49:   1.58
+ 15-FEB-1950 00 / 50:   4.93
+ 16-MAR-1950 12 / 51:   3.51
+ 16-APR-1950 00 / 52:   4.54
+ 16-MAY-1950 12 / 53:   1.60
+ 16-JUN-1950 00 / 54:   1.33
+ 16-JUL-1950 12 / 55:   0.90
+ 16-AUG-1950 12 / 56:  -0.45
+ 16-SEP-1950 00 / 57:   3.57
+ 16-OCT-1950 12 / 58:  -8.75
+ 16-NOV-1950 00 / 59:  -5.24
+ 16-DEC-1950 12 / 60:  -6.47
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 60.5
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+       TSORTED_IN  TSORTED_WND
+1    /  1:   58.00   -8.75
+2    /  2:   60.00   -6.47
+3    /  3:   33.00   -5.80
+4    /  4:   59.00   -5.24
+5    /  5:   43.00   -1.30
+6    /  6:   38.00   -1.08
+7    /  7:   47.00   -0.94
+8    /  8:   48.00   -0.52
+9    /  9:   56.00   -0.45
+10   / 10:   41.00    0.00
+11   / 11:   16.00    0.00
+12   / 12:   34.00    0.45
+13   / 13:   46.00    0.71
+14   / 14:   40.00    0.83
+15   / 15:   55.00    0.90
+16   / 16:   54.00    1.33
+17   / 17:   44.00    1.38
+18   / 18:   49.00    1.58
+19   / 19:   53.00    1.60
+20   / 20:   39.00    2.07
+21   / 21:   51.00    3.51
+22   / 22:   57.00    3.57
+23   / 23:   37.00    4.23
+24   / 24:   25.00    4.50
+25   / 25:   52.00    4.54
+26   / 26:   30.00    4.70
+27   / 27:   50.00    4.93
+28   / 28:   42.00    5.37
+29   / 29:   45.00    5.92
+30   / 30:   21.00    6.60
+31   / 31:   12.00   12.35
+32   / 32:    ....    ....
+33   / 33:    ....    ....
+34   / 34:    ....    ....
+35   / 35:    ....    ....
+36   / 36:    ....    ....
+37   / 37:    ....    ....
+38   / 38:    ....    ....
+39   / 39:    ....    ....
+40   / 40:    ....    ....
+41   / 41:    ....    ....
+42   / 42:    ....    ....
+43   / 43:    ....    ....
+44   / 44:    ....    ....
+45   / 45:    ....    ....
+46   / 46:    ....    ....
+47   / 47:    ....    ....
+48   / 48:    ....    ....
+49   / 49:    ....    ....
+50   / 50:    ....    ....
+51   / 51:    ....    ....
+52   / 52:    ....    ....
+53   / 53:    ....    ....
+54   / 54:    ....    ....
+55   / 55:    ....    ....
+56   / 56:    ....    ....
+57   / 57:    ....    ....
+58   / 58:    ....    ....
+59   / 59:    ....    ....
+60   / 60:    ....    ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 60.5
+          31.00
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 60.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  27.90  26.71
+ 15-FEB      / 2:  28.55  28.25  26.37
+ 17-MAR      / 3:  28.88  28.48  26.32
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  28.27  26.71
+ 15-FEB      / 2:  28.55  28.49  26.37
+ 17-MAR      / 3:  28.88  28.61  26.32
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.227
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+           161W   
+            90
+ 1   / 1:  1.600
+ 2   / 2: -0.406
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+              27W     25W     23W    
+              157     158     159
+ ---- L:1 T:   1
+ 3N   / 47: -0.1753 -0.1784 -0.3092
+ 1N   / 46: -0.3086 -0.2809 -0.2910
+ 1S   / 45: -0.2715 -0.4976 -0.5956
+ ---- L:2 T:   2
+ 3N   / 47: -0.0525 -0.0028 -0.1241
+ 1N   / 46:  0.0646  0.0572 -0.0695
+ 1S   / 45:  0.1213  0.0397 -0.0342
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   9.00   9.00   9.00
+ 2   / 2:  95.80   4.20   0.00
+ 3   / 3:   1.09   0.05   0.00
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  1.178 -0.782
+ 15-FEB      / 2:  0.088  1.411
+ 17-MAR      / 3: -1.266 -0.630
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+               1      2      3      4      5    
+               1      2      3      4      5
+ ---- L:101 T:   101
+ 10   / 10:  10.00  30.00  50.00   ....   ....
+ 11   / 11:  10.00  30.00  50.00   ....   ....
+ ---- L:102 T:   102
+ 10   / 10:  10.00  30.00  50.00   ....   ....
+ 11   / 11:  10.00  30.00  50.00   ....   ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                 1      2      3      4      5    
+                 1      2      3      4      5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : 15-JAN 11:49
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : 15-JAN 11:49
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : 15-JAN 11:49
+               91W   
+              125
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   2.70
+ 45N   / 68:  13.35
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : 15-JAN 11:49
+              91W   
+             125
+ 1    /  1:  13.35
+ 2    /  2:   2.70
+ 3    /  3:   ....
+ 4    /  4:   ....
+ 5    /  5:   ....
+ 6    /  6:   ....
+ 7    /  7:   ....
+ 8    /  8:   ....
+ 9    /  9:   ....
+ 10   / 10:   ....
+ 11   / 11:   ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : 17-AUG-1982 12:00
+              139.5W 
+               91
+ 5     /  1:   ....
+ 15    /  2:   ....
+ 25    /  3:   ....
+ 35    /  4:   ....
+ 45    /  5:   ....
+ 55    /  6:   ....
+ 65    /  7:  26.40
+ 75    /  8:  26.02
+ 85    /  9:  25.67
+ 95    / 10:  25.32
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : 17-AUG-1982 12:00
+             139.5W 
+              91
+ 1    /  1:  26.40
+ 2    /  2:  26.02
+ 3    /  3:  25.67
+ 4    /  4:  25.32
+ 5    /  5:   ....
+ 6    /  6:   ....
+ 7    /  7:   ....
+ 8    /  8:   ....
+ 9    /  9:   ....
+ 10   / 10:   ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.00
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.0000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.00
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.00
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.7850
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : 16-JAN 06:00
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:  335.0  359.0  269.0   57.0  195.0   73.0  101.0  209.0   87.0  167.0
+ 2   / 2:  -69.0  -63.0  -25.0  -13.0  -13.0  -11.0  -11.0  -11.0   -9.0   -9.0
+ 3   / 3:    0.3    0.9   23.3   28.4   29.7   28.5   28.3   28.9   28.4   29.8
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : 16-JAN 06:00
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:  331.0  365.0  147.0   79.0  119.0   65.0   83.0  125.0  157.0  237.0
+ 2   / 2:  -65.0  -61.0  -59.0  -53.0   -9.0   -7.0   -7.0   -7.0   -3.0   -1.0
+ 3   / 3:   -0.8   -0.1    0.4    1.6   28.3   27.6   27.8   28.4   28.7   23.9
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16200.5 (number of valid)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  13.00
+ 2   / 2:  13.00
+ 3   / 3:  13.00
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16200.5 (number of valid)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  113.0
+ 2   / 2:  113.0
+ 3   / 3:  113.0
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ 1   / 1:   ....  1999.  2001.  2001.  2003.   999.
+ 2   / 2:   ....     7.     7.     7.     7.     8.
+ 3   / 3:   ....    28.    29.    30.    31.     1.
+ 4   / 4:   ....     0.     0.     0.     0.     0.
+ 5   / 5:   ....     0.     0.     0.     0.     0.
+ 6   / 6:   ....     0.     0.     0.     0.     0.
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  2001.  2001.  2003.   999.
+ 2   / 2:   ....     7.     7.     7.     8.
+ 3   / 3:   ....    28.    30.    31.     1.
+ 4   / 4:   ....     0.     0.     0.     0.
+ 5   / 5:   ....     0.     0.     0.     0.
+ 6   / 6:   ....     0.     0.     0.     0.
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+          DDAT_A  DDAT_B DDAT_C
+345   / 1:   ....   ....   ....
+346   / 2:   ....  1126.  1126.
+347   / 3:  1136.  1136.  1136.
+348   / 4:  1141.  1141.   ....
+349   / 5:  1146.  1146.  1146.
+350   / 6:  1156.  1156.  1156.
+351   / 7:  1166.  1166.  1166.
+352   / 8:   ....   ....   ....
+353   / 9:   ....   ....   ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                (C001,V001)   EX#2
+10-NOV-1982 16 / 15:  0.6667  16.00
+16-NOV-1982 18 / 16:  0.7500  18.00
+22-NOV-1982 20 / 17:  0.8333  20.00
+28-NOV-1982 22 / 18:  0.9167  22.00
+05-DEC-1982 00 / 19:  0.0000   0.00
+11-DEC-1982 02 / 20:  0.0833   2.00
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:   10.00   314.0
+16-NOV-1982 18 / 16:   16.00   320.0
+22-NOV-1982 20 / 17:   22.00   326.0
+28-NOV-1982 22 / 18:   28.00   332.0
+05-DEC-1982 00 / 19:    5.00   339.0
+11-DEC-1982 02 / 20:   11.00   345.0
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:   11.00  0.8603
+16-NOV-1982 18 / 16:   11.00  0.8767
+22-NOV-1982 20 / 17:   11.00  0.8932
+28-NOV-1982 22 / 18:   11.00  0.9096
+05-DEC-1982 00 / 19:   12.00  0.9288
+11-DEC-1982 02 / 20:   12.00  0.9452
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.
+ 16-NOV-1982 18 / 16:  1982.
+ 22-NOV-1982 20 / 17:  1982.
+ 28-NOV-1982 22 / 18:  1982.
+ 05-DEC-1982 00 / 19:  1982.
+ 11-DEC-1982 02 / 20:  1982.
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+*** Running test: bn_modulo_strides.jnl
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G002)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:  1 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:  3 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.00
+ 4    / 2:   4.00
+ 7    / 3:   7.00
+ 10   / 4:  10.00
+ 13   / 5:  13.00
+ 16   / 6:  16.00
+ 19   / 7:  19.00
+ 22   / 8:   2.00
+ 25   / 9:   5.00
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   B        M:  2 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.00
+ 21   / 2:   1.00
+ 23   / 3:   3.00
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.00
+ 22   / 2:   2.00
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+ 24   / 4:   4.00
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.00
+ 21   / 2:   1.00
+ 23   / 3:   3.00
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.00
+ 22   / 2:   2.00
+ 24   / 3:   4.00
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+ 24   / 3:   4.00
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+ 24   / 3:   4.00
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+ 25   / 3:   5.00
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.00
+ 6    / 2:   6.00
+ 11   / 3:  11.00
+ 16   / 4:  16.00
+ 21   / 5:   1.00
+ 26   / 6:   6.00
+ 31   / 7:  11.00
+ 36   / 8:  16.00
+ 41   / 9:   1.00
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.00
+ 7    / 2:   7.00
+ 12   / 3:  12.00
+ 17   / 4:  17.00
+ 22   / 5:   2.00
+ 27   / 6:   7.00
+ 32   / 7:  12.00
+ 37   / 8:  17.00
+ 42   / 9:   2.00
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.00
+ 8    / 2:   8.00
+ 13   / 3:  13.00
+ 18   / 4:  18.00
+ 23   / 5:   3.00
+ 28   / 6:   8.00
+ 33   / 7:  13.00
+ 38   / 8:  18.00
+ 43   / 9:   3.00
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.00
+ 9    / 2:   9.00
+ 14   / 3:  14.00
+ 19   / 4:  19.00
+ 24   / 5:   4.00
+ 29   / 6:   9.00
+ 34   / 7:  14.00
+ 39   / 8:  19.00
+ 44   / 9:   4.00
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.00
+ 10   / 2:  10.00
+ 15   / 3:  15.00
+ 20   / 4:  20.00
+ 25   / 5:   5.00
+ 30   / 6:  10.00
+ 35   / 7:  15.00
+ 40   / 8:  20.00
+ 45   / 9:   5.00
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.00
+ 11   / 2:  11.00
+ 16   / 3:  16.00
+ 21   / 4:   1.00
+ 26   / 5:   6.00
+ 31   / 6:  11.00
+ 36   / 7:  16.00
+ 41   / 8:   1.00
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.00
+ 106   / 2:   6.00
+ 111   / 3:  11.00
+ 116   / 4:  16.00
+ 121   / 5:   1.00
+ 126   / 6:   6.00
+ 131   / 7:  11.00
+ 136   / 8:  16.00
+ 141   / 9:   1.00
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.00
+ 107   / 2:   7.00
+ 112   / 3:  12.00
+ 117   / 4:  17.00
+ 122   / 5:   2.00
+ 127   / 6:   7.00
+ 132   / 7:  12.00
+ 137   / 8:  17.00
+ 142   / 9:   2.00
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.00
+ 108   / 2:   8.00
+ 113   / 3:  13.00
+ 118   / 4:  18.00
+ 123   / 5:   3.00
+ 128   / 6:   8.00
+ 133   / 7:  13.00
+ 138   / 8:  18.00
+ 143   / 9:   3.00
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.00
+ 109   / 2:   9.00
+ 114   / 3:  14.00
+ 119   / 4:  19.00
+ 124   / 5:   4.00
+ 129   / 6:   9.00
+ 134   / 7:  14.00
+ 139   / 8:  19.00
+ 144   / 9:   4.00
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.00
+ 110   / 2:  10.00
+ 115   / 3:  15.00
+ 120   / 4:  20.00
+ 125   / 5:   5.00
+ 130   / 6:  10.00
+ 135   / 7:  15.00
+ 140   / 8:  20.00
+ 145   / 9:   5.00
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.00
+ 111   / 2:  11.00
+ 116   / 3:  16.00
+ 121   / 4:   1.00
+ 126   / 5:   6.00
+ 131   / 6:  11.00
+ 136   / 7:  16.00
+ 141   / 8:   1.00
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G003)          (AX001)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G002)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:  4 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:  4 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:  6 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G003)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:  6 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:  8 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+*** Running test: bn_axis_viewports.jnl
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/nolab {0,4.737}, {0,4.737}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.57E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.737
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.737
+ppl axlen `1.2 + ($xaxl) + 1.0`,`1.4 + ($yaxl) + 1.4`
+ !-> ppl axlen 6.937,7.537
+plot/vs/hlim=-1.2:`($xaxl)+1.0`:0.2/vlim=-1.4:`($yaxl)+1.4`:0.2/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.2:5.737:0.2/vlim=-1.4:6.137:0.2/nolab/line {0,4.737}, {0,4.737}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.72   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.74E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.60   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.60   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.13E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.08E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 7.27E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.67E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.40E+00  AUTO LABELLING
+*** Running test: bn_strings.jnl
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string   cnst
+1   / 1: "string"            5.000
+2   / 2: "s2"                5.000
+3   / 3: "very long string"  5.000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1.000  0.000  0.000
+ 2   / 2:  0.000  1.000  0.000
+ 3   / 3:  0.000  0.000  1.000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:  0.000  1.000  1.000
+ 2   / 2:  1.000  0.000  1.000
+ 3   / 3:  1.000  1.000  0.000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  1.000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  0.000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+*** Running test: bn_axcontrol.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+*** Running test: bn_vec_curv.jnl
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+*** Running test: bn_delimited_read.jnl
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6    V7      V8     V9    V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "    .... " "      " "    ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.0 "word 1" " "    ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"   .... "word 2" " "    ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.0 " wd 3 " " "    ....
+5   / 5: " "          " "    " "    " "    " "    " "    .... " "      " "    ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.0 "word 4" "aa"  77.00
+7   / 7: "extra line" " "    " "    " "    " "    " "    .... " "      " "    ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6    A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "    ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.0
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"   ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.0
+5   / 5: " "          " "    " "    " "    " "    " "    ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.0
+7   / 7: "extra line" " "    " "    " "    " "    " "    ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2   V3     V4     V5    V6    V7      V8     V9    V10
+1   / 1: "one"       ...  1.100 -24.00  130.0 " "    10.0 "word 1" " "    ....
+2   / 2: "two"       ...  2.200  24.00 -130.0 "2S"   .... "word 2" " "    ....
+3   / 3: "three"     ...  3.300  24.00  130.0 "3N"    0.0 " wd 3 " " "    ....
+4   / 4: " "         ...   ....   ....   .... " "    .... " "      " "    ....
+5   / 5: "five"      ...  4.400 -24.00 -130.0 "91" -400.0 "word 4" "aa"  77.00
+6   / 6: "extra line"...   ....   ....   .... " "    .... " "      " "    ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2   V3     V4     V5     V6     V7   V8 V9   V10
+1   / 1:......  1.100   ....   ....   ....   10.0......   ....
+2   / 2:......  2.200   ....   ....   ....   ..........   ....
+3   / 3:......  3.300  24.00  130.0   ....    0.0......   ....
+4   / 4:......   ....   ....   ....   ....   ..........   ....
+5   / 5:......  4.400 -24.00 -130.0  91.00 -400.0......  77.00
+6   / 6:......   ....   ....   ....   ....   ..........   ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2   V3     V4     V5     V6     V7   V8 V9   V10
+1   / 1:......  1.100 -24.00   ....   ....   10.0......   ....
+2   / 2:......  2.200  24.00   ....  -2.00   ..........   ....
+3   / 3:......  3.300  24.00  130.0   3.00    0.0......   ....
+4   / 4:......   ....   ....   ....   ....   ..........   ....
+5   / 5:......  4.400 -24.00 -130.0  91.00 -400.0......  77.00
+6   / 6:......   ....   ....   ....   ....   ..........   ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+             V1    V2
+1   / 1:  37965.  12.58
+2   / 2:    ....   ....
+3   / 3:  39051.  13.75
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5      V6     V7     V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.  36218.  12.00  13.76
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.  36219.   1.00  14.76
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.  36220.   2.00  15.75
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.  36221.   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+             V1     V2   V3 V4    V5      V6   V7 V8
+1   / 1:  36493.  36218.......  36493.  36218.......
+2   / 2:  36494.  36219.......  36494.  36219.......
+3   / 3:    ....    ..........  36495.  36220.......
+4   / 4:  36496.  36221.......  36496.  36221.......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2   V3     V4   V5 V6   V7     V8
+1   / 1:......  12.00  13.76......  12.00  13.76
+2   / 2:......   1.00  14.76......   1.00  14.76
+3   / 3:......   ....   ..........   2.00  15.75
+4   / 4:......   3.00  16.76......   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+             V1     V2     V3     V4      V5      V6     V7     V8
+1   / 1:  36493.  36218.  12.00  13.76  36493.  36218.  12.00  13.76
+2   / 2:  36494.  36219.   1.00  14.76  36494.  36219.   1.00  14.76
+3   / 3:    ....    ....   ....   ....  36495.  36220.   2.00  15.75
+4   / 4:  36496.  36221.   3.00  16.76  36496.  36221.   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+             V1    V3      V5     V7
+1   / 1:  36493.  12.00  36493.  12.00
+2   / 2:  36494.   1.00  36494.   1.00
+3   / 3:    ....   ....  36495.   2.00
+4   / 4:  36496.   3.00  36496.   3.00
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+            V1    V2                       V3                      V4
+1   / 1:  12.00  1.000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.000
+2   / 2:  12.00  2.000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.000
+3   / 3:  12.00  3.000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.000
+4   / 4:  12.00  4.000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+            V1    V2     V3        V4           V5           V6        V7     V8
+1   / 1:  12.00  1.000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.00  1.000
+2   / 2:  12.00  2.000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.00  2.000
+3   / 3:  12.00  3.000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.00  3.000
+4   / 4:  12.00  4.000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.00  4.000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+            V1    V2     V3    V4     V5     V6       V7           V8        V9     V10
+1   / 1:  12.00  1.000 "99"   1999.  3.000 "01"  "12:00"      "13:45:36.5"  12.00  1.000
+2   / 2:  12.00  2.000 "99"   1999.  3.000 "02"  "01:00:13.5" "14:45:36.5"  12.00  2.000
+3   / 3:  12.00  3.000 "99x"  1999.  3.000 "03x" "2:00x"      "15:45x"      12.00  3.000
+4   / 4:  12.00  4.000 "99"   1999.  3.000 "04"  "03:00"      "16:45:36.5"  12.00  4.000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+            V1    V2     V3    V4     V5     V6    V7     V8    V9    V10
+1   / 1:  12.00  1.000 "99"   1999.  3.000 "01"   12.00 "00"   13.00 "45" 
+2   / 2:  12.00  2.000 "99"   1999.  3.000 "02"    1.00 "00"   13.50 "14" 
+3   / 3:  12.00  3.000 "99x"  1999.  3.000 "03x"   2.00 "00x"  15.00 "45x"
+4   / 4:  12.00  4.000 "99"   1999.  3.000 "04"    3.00 "00"   16.00 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1    V2    V3    V4     V5     V6     V7     V8     V9     V10    V11    V12    V13     V14    V15    V16    V17     V18    V19    V20     V21    V22    V23    V24    V25    V26
+1    /  1: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    10.  21.10  35.94  0.000  36.00  0.0000  1.000    10.  224.6  0.0000   0.12  0.000  0.0000  0.000   1.02  0.000  0.116  0.000  2.229
+2    /  2: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    54.  19.89  35.94  0.000  35.00  0.0000  1.000    55.  233.2  0.0000   0.15  0.000  0.0000  0.000   1.04  0.000  0.138  0.000  2.431
+3    /  3: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    79.  19.01  35.92  0.000  34.00  0.0000  1.000    80.  237.0  0.0000   0.17  0.000  0.0000  0.000   1.04  0.000  0.131  0.000  2.516
+4    /  4: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   104.  18.00  35.86  0.000  33.00  0.0000  1.000   105.  233.8  0.0000   0.19  0.000  0.0000  0.000   1.06  0.000  0.166  0.000  2.650
+5    /  5: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   154.  16.36  35.71  0.000  32.00  0.0000  1.000   155.  230.2  0.0000   0.91  0.000  0.1465  0.000   0.90  0.000  0.266  0.000  2.846
+6    /  6: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   204.  14.85  35.55  0.000  31.00  0.0000  1.000   206.  222.3  0.0000   3.79  0.000  0.0098  0.000   1.44  0.000  0.445  0.000  2.954
+7    /  7: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   253.  13.72  35.38  0.000  29.00  0.0000  1.000   255.  227.6  0.0000   5.53  0.000  0.0098  0.000   1.63  0.000  0.559  0.000  3.006
+8    /  8: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   254.  13.71  35.38  0.000  30.00  0.0000  1.000   256.  227.3  0.0000   5.51  0.000  0.0098  0.000   1.79  0.000  0.555  0.000  2.996
+9    /  9: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   305.  12.62  35.21  0.000  28.00  0.0000  1.000   307.  230.9  0.0000   7.65  0.000  0.0098  0.000   2.16  0.000  0.686  0.000  3.134
+10   / 10: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   353.  12.01  35.12  0.000  27.00  0.0000  1.000   356.  235.4  0.0000   8.72  0.000  0.0098  0.000   2.52  0.000  0.753  0.000  3.190
+11   / 11: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   404.  11.46   ....  9.000  26.00  0.0000  1.000   407.   ....  0.0000   ....  9.000    ....  9.000   ....  9.000   ....  9.000  3.255
+12   / 12: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   452.  11.04  34.96  0.000  25.00  0.0000  1.000   456.  239.9  0.0000  10.95  0.000  0.0000  0.000   3.05  0.000  0.884  0.000  3.245
+13   / 13: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   502.  10.58  34.88  0.000  24.00  0.0000  1.000   506.  241.1  0.0000  12.14  0.000  0.0000  0.000   3.40  0.000  0.959  0.000  3.195
+14   / 14: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   601.   9.80  34.76  0.000  23.00  0.0000  1.000   606.  238.5  0.0000  14.44  0.000  0.0000  0.000   4.27  0.000  1.114  0.000   ....
+15   / 15: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   701.   9.02  34.65  0.000  22.00  0.0000  1.000   707.  229.2  0.0000  17.54  0.000  0.0000  0.000   6.18  0.000  1.312  0.000  2.454
+16   / 16: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   800.   7.69  34.53  0.000  21.00  0.0000  1.000   807.  206.7  0.0000  22.74  0.000  0.0000  0.000  13.22  0.000  1.633  0.000  1.320
+17   / 17: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   899.   6.21  34.44  0.000  20.00  0.0000  1.000   907.  194.6  0.0000  27.29  0.000  0.0000  0.000  23.86  0.000  1.927  0.000  0.732
+18   / 18: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   999.   4.96  34.41  0.000  19.00  0.0000  1.000  1008.  186.9  0.0000  30.28  0.000  0.0000  0.000  36.39  0.000  2.153  0.000  0.429
+19   / 19: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.  1098.   4.31  34.44  0.000  18.00  0.0000  1.000  1109.  171.8  0.0000  32.20  0.000  0.0000  0.000  50.45  0.000  2.297  0.000  0.198
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+             V11    V19    V21    V23    V25
+8    /  8:  0.000  0.000  0.000  0.000  0.000
+9    /  9:  0.000  0.000  0.000  0.000  0.000
+10   / 10:  0.000  0.000  0.000  0.000  0.000
+11   / 11:  9.000  9.000  9.000  9.000  9.000
+12   / 12:  0.000  0.000  0.000  0.000  0.000
+13   / 13:  0.000  0.000  0.000  0.000  0.000
+14   / 14:  0.000  0.000  0.000  0.000  0.000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+              V11    V19     V21     V23     V25
+8    /  8:  0.0000  0.0000  0.0000  0.0000  0.0000
+9    /  9:  0.0000  0.0000  0.0000  0.0000  0.0000
+10   / 10:  0.0000  0.0000  0.0000  0.0000  0.0000
+11   / 11:    ....    ....    ....    ....    ....
+12   / 12:  0.0000  0.0000  0.0000  0.0000  0.0000
+13   / 13:  0.0000  0.0000  0.0000  0.0000  0.0000
+14   / 14:  0.0000  0.0000  0.0000  0.0000  0.0000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+*** Running test: bn541_bug_fixes.jnl
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  27.90   ....
+ 15-FEB      / 2:  28.55  28.25   ....
+ 17-MAR      / 3:  28.88  28.48   ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00   ....  26.96
+ 15-FEB      / 2:  28.55   ....  26.79
+ 17-MAR      / 3:  28.88   ....  27.11
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX003)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 26   complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.000
+ 
+ 
+*** Running test: bn_cancel_axes.jnl
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+*** Running test: bn542_bug_fixes.jnl
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+*** Running test: bn_subspan_modulo.jnl
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  2 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+           41     42     43     44     45     46    
+            1      2      3      4      5      6
+          11.00  12.00  13.00  14.00  15.00  16.00
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M:  1 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  5 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  3 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.00  16.00   ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .   ....  12.00  14.00  16.00  11.00  13.00  15.00   ....  12.00  14.00  16.00
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.00   ....  11.00  12.00  13.00  14.00  15.00
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+           ....  11.00  12.00  13.00  14.00  15.00
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.00  12.00  13.00  14.00  15.00
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.00  14.00  15.00  16.00
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.00  14.00  15.00  16.00   ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.00  14.00  15.00  16.00   ....  11.00
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5  541    542    543    544    545    546    593.5 
+           35     36     37     38     39     40     41     42
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.06   ....   ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.04  15.06   ....   ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....  10.95  12.06  12.94  14.24  14.94  15.99   ....  10.95  12.06
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....   ....  11.98  13.08  14.04  15.06   ....   ....   ....  11.98
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+           ....   ....   ....  13.04  14.04   ....   ....   ....   ....   ....  13.04  14.04   ....   ....   ....   ....   ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5  541    542    543    544    545    546    593.5 
+           35     36     37     38     39     40     41     42
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....  11.00  12.00  12.00   ....  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+           ....  11.00  12.00  11.50  14.00  16.00  16.00   ....  11.00  12.00  11.50  14.00  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+           ....  11.00  12.00  13.00  13.00  13.00  16.00   ....  11.00  12.00  13.00  13.00  13.00  16.00   ....  11.00  12.00
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....  11.00  12.00  12.00  14.00  16.00  16.00   ....  11.00  12.00
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0
+ 15-FEB      / 2:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      / 3:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      / 4:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      / 5:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.0   12.0   13.0   14.0   15.0   16.0
+ 15-FEB      /  2:   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      /  3:   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      /  4:  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      /  5:  131.0  132.0  133.0  134.0  135.0  136.0
+ 14-SEP      /  6:   ....   ....   ....   ....   ....   ....
+ 15-JAN      /  7:   11.0   12.0   13.0   14.0   15.0   16.0
+ 14-FEB      /  8:   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      /  9:   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      / 10:  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      / 11:  131.0  132.0  133.0  134.0  135.0  136.0
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0
+ 15-FEB      /  2:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0
+ 16-MAR      /  3:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0
+ 15-APR      /  4:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0
+ 15-MAY      /  5:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0
+ 14-SEP      /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN      /  7:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0
+ 14-FEB      /  8:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0
+ 16-MAR      /  9:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0
+ 15-APR      / 10:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0
+ 15-MAY      / 11:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0
+ 14-FEB-0002 / 14:   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0
+ 16-MAR-0002 / 15:   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0
+ 15-APR-0002 / 16:  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0
+ 15-MAY-0002 / 17:  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0
+ 14-FEB-0003 / 20:   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0
+ 16-MAR-0003 / 21:   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   ....   ....   ....   16.0   ....   11.0   12.0   ....   ....   ....
+ 14-FEB-0002 / 14:   42.0   ....   ....   ....   46.0   ....   41.0   42.0   ....   ....   ....
+ 16-MAR-0002 / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-APR-0002 / 16:  102.0   ....   ....   ....  106.0   ....  101.0  102.0   ....   ....   ....
+ 15-MAY-0002 / 17:  132.0   ....   ....   ....  136.0   ....  131.0  132.0   ....   ....   ....
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   ....   ....   ....   16.0   ....   11.0   12.0   ....   ....   ....
+ 14-FEB-0003 / 20:   42.0   ....   ....   ....   46.0   ....   41.0   42.0   ....   ....   ....
+ 16-MAR-0003 / 21:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   12.0   14.0   16.0   16.0   ....   11.0   12.0   12.0   14.0   16.0
+ 14-FEB-0002 / 14:   42.0   42.0   44.0   46.0   46.0   ....   41.0   42.0   42.0   44.0   46.0
+ 16-MAR-0002 / 15:   72.0   72.0   74.0   76.0   76.0   ....   71.0   72.0   72.0   74.0   76.0
+ 15-APR-0002 / 16:  102.0  102.0  104.0  106.0  106.0   ....  101.0  102.0  102.0  104.0  106.0
+ 15-MAY-0002 / 17:  132.0  132.0  134.0  136.0  136.0   ....  131.0  132.0  132.0  134.0  136.0
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   12.0   14.0   16.0   16.0   ....   11.0   12.0   12.0   14.0   16.0
+ 14-FEB-0003 / 20:   42.0   42.0   44.0   46.0   46.0   ....   41.0   42.0   42.0   44.0   46.0
+ 16-MAR-0003 / 21:   72.0   72.0   74.0   76.0   76.0   ....   71.0   72.0   72.0   74.0   76.0
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0   ....
+ 15-JAN-0002 / 13:  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0   ....
+ 14-FEB-0002 / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0002 / 15:   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0   ....
+ 15-APR-0002 / 16:   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0   46.0   ....
+ 15-MAY-0002 / 17:   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0   76.0   ....
+ 15-SEP-0002 / 18:  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0   ....
+ 15-JAN-0003 / 19:  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0   ....
+ 14-FEB-0003 / 20:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0003 / 21:   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0   ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G004)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+           ....  12.00  14.00  16.00  11.00  13.00  15.00   ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G004)          (AX001)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ dealloc  dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G004)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.0
+ 16-MAR-0000 / 2:   71.0
+ 15-MAY-0000 / 3:  131.0
+ 15-JAN-0001 / 4:   11.0
+ 16-MAR-0001 / 5:   71.0
+ 15-MAY-0001 / 6:  131.0
+ 15-JAN-0002 / 7:   11.0
+ 16-MAR-0002 / 8:   71.0
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.0
+ 15-APR-0000 / 2:  101.0
+ 15-JAN-0001 / 3:   11.0
+ 15-APR-0001 / 4:  101.0
+ 15-JAN-0002 / 5:   11.0
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.0
+ 15-MAY-0000 / 2:  131.0
+ 16-MAR-0001 / 3:   71.0
+ 15-JAN-0002 / 4:   11.0
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 15-APR-0000 / 2:   ....  102.0  104.0  106.0  101.0  103.0  105.0   ....
+ 15-JAN-0001 / 3:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 15-APR-0001 / 4:   ....  102.0  104.0  106.0  101.0  103.0  105.0   ....
+ 15-JAN-0002 / 5:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.000
+ 15-FEB      / 2:  2.000
+ 16-MAR      / 3:  3.000
+ 15-APR      / 4:  4.000
+ 15-MAY      / 5:  5.000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.00
+ 15-FEB      / 2:  10.00
+ 16-MAR      / 3:  10.00
+ 15-APR      / 4:  10.00
+ 15-MAY      / 5:  10.00
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.000
+ 15-SEP-0166 / 1002:   ....
+ 16-JAN-0167 / 1003:  1.000
+ 15-FEB-0167 / 1004:  2.000
+ 17-MAR-0167 / 1005:  3.000
+ 16-APR-0167 / 1006:  4.000
+ 16-MAY-0167 / 1007:  5.000
+ 16-SEP-0167 / 1008:   ....
+ 16-JAN-0168 / 1009:  1.000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+           41     42     42.1   44     45     46    
+            1      2      3      4      5      6
+          11.00  12.00  12.10  14.00  15.00  16.00
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.00  16.00   ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .   ....  12.00  14.00  16.00  11.00  12.10  15.00   ....  12.00  14.00  16.00
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.00   ....  11.00  12.00  12.10  14.00  15.00
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+           ....  11.00  12.00  12.10  14.00  15.00
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.00  12.00  12.10  14.00  15.00
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.10  14.00  15.00  16.00
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.10  14.00  15.00  16.00   ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.10  14.00  15.00  16.00   ....  11.00
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+          493.5  541    542    542.1  544    545    546    593.5  
+           35     36     37     38     39     40     41     42
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.06   ....   ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.74  15.06   ....   ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....  10.95  12.06  12.04  14.24  14.94  15.99   ....  10.95  12.06
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....   ....  11.68  12.78  13.74  15.06   ....   ....   ....  11.68
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+           ....   ....   ....  12.80  13.84   ....   ....   ....   ....   ....  12.80  13.84   ....   ....   ....   ....   ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+          493.5  541    542    542.1  544    545    546    593.5  
+           35     36     37     38     39     40     41     42
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+           ....  11.00  12.00  12.10  13.37  14.05  16.00   ....  11.00  12.00  12.10  13.37  14.05  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+           ....  11.00  12.00  12.10  12.78  12.78  16.00   ....  11.00  12.00  12.10  12.78  12.78  16.00   ....  11.00  12.00
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0
+ 15-FEB 02      / 2:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 17      / 3:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 05      / 4:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 05      / 5:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.0   12.0   12.1   14.0   15.0   16.0
+ 15-FEB 02      /  2:   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 17      /  3:   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 05      /  4:  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 05      /  5:  131.2  132.2  132.3  134.2  135.2  136.2
+ 14-SEP 17      /  6:   ....   ....   ....   ....   ....   ....
+ 15-JAN 17      /  7:   11.0   12.0   12.1   14.0   15.0   16.0
+ 14-FEB 08      /  8:   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 23      /  9:   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 11      / 10:  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 11      / 11:  131.2  132.2  132.3  134.2  135.2  136.2
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0
+ 15-FEB 02      /  2:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0
+ 15-MAR 17      /  3:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2
+ 15-APR 05      /  4:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2
+ 15-MAY 05      /  5:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2
+ 14-SEP 17      /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN 17      /  7:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0
+ 14-FEB 08      /  8:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0
+ 15-MAR 23      /  9:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2
+ 15-APR 11      / 10:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2
+ 15-MAY 11      / 11:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0
+ 14-FEB-0002 14 / 14:   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0
+ 16-MAR-0002 05 / 15:   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2
+ 15-APR-0002 17 / 16:  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2
+ 15-MAY-0002 17 / 17:  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0
+ 14-FEB-0003 20 / 20:   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0
+ 16-MAR-0003 11 / 21:   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   ....   ....   16.0   ....   11.0   12.0   12.1   ....   ....
+ 14-FEB-0002 14 / 14:   43.0   43.1   ....   ....   47.0   ....   42.0   43.0   43.1   ....   ....
+ 16-MAR-0002 05 / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-APR-0002 17 / 16:  102.2  102.3   ....   ....  106.2   ....  101.2  102.2  102.3   ....   ....
+ 15-MAY-0002 17 / 17:  132.2  132.3   ....   ....  136.2   ....  131.2  132.2  132.3   ....   ....
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   ....   ....   16.0   ....   11.0   12.0   12.1   ....   ....
+ 14-FEB-0003 20 / 20:   43.0   43.1   ....   ....   47.0   ....   42.0   43.0   43.1   ....   ....
+ 16-MAR-0003 11 / 21:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   12.1   16.0   16.0   ....   11.0   12.0   12.1   12.1   16.0
+ 14-FEB-0002 14 / 14:   43.0   43.1   43.1   47.0   47.0   ....   42.0   43.0   43.1   43.1   47.0
+ 16-MAR-0002 05 / 15:   72.6   72.7   72.7   76.6   76.6   ....   71.6   72.6   72.7   72.7   76.6
+ 15-APR-0002 17 / 16:  102.2  102.3  102.3  106.2  106.2   ....  101.2  102.2  102.3  102.3  106.2
+ 15-MAY-0002 17 / 17:  132.2  132.3  132.3  136.2  136.2   ....  131.2  132.2  132.3  132.3  136.2
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   12.1   16.0   16.0   ....   11.0   12.0   12.1   12.1   16.0
+ 14-FEB-0003 20 / 20:   43.0   43.1   43.1   47.0   47.0   ....   42.0   43.0   43.1   43.1   47.0
+ 16-MAR-0003 11 / 21:   72.6   72.7   72.7   76.6   76.6   ....   71.6   72.6   72.7   72.7   76.6
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2   ....
+ 15-JAN-0002 23 / 13:  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2   ....
+ 14-FEB-0002 14 / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0002 05 / 15:   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0   ....
+ 15-APR-0002 17 / 16:   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0   47.0   ....
+ 15-MAY-0002 17 / 17:   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2   75.2   ....
+ 15-SEP-0002 05 / 18:  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2   ....
+ 16-JAN-0003 05 / 19:  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2   ....
+ 14-FEB-0003 20 / 20:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0003 11 / 21:   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0   ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G006)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+           ....  12.00  14.00  16.00  11.00  12.10  15.00   ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G006)          (AX005)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G006)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.0
+ 15-MAR-0000 / 2:   70.2
+ 15-MAY-0000 / 3:  131.2
+ 15-JAN-0001 / 4:   11.0
+ 15-MAR-0001 / 5:   70.2
+ 15-MAY-0001 / 6:  131.2
+ 15-JAN-0002 / 7:   11.0
+ 16-MAR-0002 / 8:   70.2
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.0
+ 15-APR-0000 / 2:  101.2
+ 15-JAN-0001 / 3:   11.0
+ 15-APR-0001 / 4:  101.2
+ 15-JAN-0002 / 5:   11.0
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.0
+ 15-MAY-0000 / 2:  131.2
+ 15-MAR-0001 / 3:   70.2
+ 15-JAN-0002 / 4:   11.0
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 15-APR-0000 / 2:   ....  102.2  104.2  106.2  101.2  102.3  105.2   ....
+ 15-JAN-0001 / 3:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 15-APR-0001 / 4:   ....  102.2  104.2  106.2  101.2  102.3  105.2   ....
+ 15-JAN-0002 / 5:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.000
+ 15-FEB 02      / 2:  2.000
+ 15-MAR 17      / 3:  3.000
+ 15-APR 05      / 4:  4.000
+ 15-MAY 05      / 5:  5.000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.00
+ 15-FEB 02      / 2:  10.00
+ 15-MAR 17      / 3:  10.00
+ 15-APR 05      / 4:  10.00
+ 15-MAY 05      / 5:  10.00
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.000
+ 15-SEP-0166 23 / 1002:   ....
+ 16-JAN-0167 23 / 1003:  1.000
+ 15-FEB-0167 14 / 1004:  2.000
+ 17-MAR-0167 05 / 1005:  3.000
+ 16-APR-0167 17 / 1006:  4.000
+ 16-MAY-0167 17 / 1007:  5.000
+ 16-SEP-0167 05 / 1008:   ....
+ 17-JAN-0168 05 / 1009:  1.000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+*** Running test: bn_dots.jnl
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+*** Running test: bn_lev_symbols.jnl
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+*** Running test: bn_mode_logo_lab.jnl
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      metafile.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+plot/vs/over/line/color=white {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+*** Running test: bn_modulo_attribute.jnl
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ 
+*** Running test: bn550_bug_fixes.jnl
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+*** Running test: bn551_bug_fixes.jnl
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+
+ PPL warning: You're attempting to use more colors than are available.
+             Using PPL SHASET RESET to re-use protected colors may help.
+
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.000
+ 10-JUN-1996 04:03:37 / 2:  1.000
+ 10-JUN-1996 04:03:38 / 3:  2.000
+ 10-JUN-1996 04:03:39 / 4:  3.000
+ 10-JUN-1996 04:03:40 / 5:  4.000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+*** Running test: bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 7
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+*** Running test: bn552_bug_fixes.jnl
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+ 4   / 4: -1.000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+ 4   / 4: -1.000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : 16-JAN 06:00
+               20N   
+                6
+ 110W   / 1:  24.04
+ 105W   / 2:  25.46
+ 100W   / 3:  24.57
+ 95W    / 4:  23.82
+ 90W    / 5:  25.00
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00   5.00   6.00   7.00   8.00
+ 2   / 2:   4.00   5.00   6.00   7.00   8.00   9.00
+ 3   / 3:   5.00   6.00   7.00   8.00   9.00  10.00
+ 4   / 4:   6.00   7.00   8.00   9.00  10.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   6.00   7.00   8.00   9.00  10.00  11.00
+ 4   / 4:   7.00   8.00   9.00  10.00  11.00  12.00
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:   6.00   7.00   8.00   9.00  10.00  11.00
+ 3   / 3:   7.00   8.00   9.00  10.00  11.00  12.00
+ 4   / 4:   8.00   9.00  10.00  11.00  12.00  13.00
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.2S
+                    100.5W 
+                    130
+ 16-JUL-1966 /  1: -1.422
+ 15-AUG-1966 /  2: -2.972
+ 14-SEP-1966 /  3: -4.503
+ 15-OCT-1966 /  4: -3.882
+ 14-NOV-1966 /  5: -2.580
+ 15-DEC-1966 /  6: -1.080
+ 14-JAN-1967 /  7:  1.424
+ 14-FEB-1967 /  8:  2.962
+ 16-MAR-1967 /  9:  4.503
+ 15-APR-1967 / 10:  3.838
+ 16-MAY-1967 / 11:  2.609
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                        90
+ 16-NOV-1947 00 / 23: -3.076
+ 16-DEC-1947 12 / 24:  1.674
+ 16-JAN-1948 12 / 25:  3.429
+ 15-FEB-1948 12 / 26:  1.954
+ 16-MAR-1948 12 / 27:  2.761
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                         1
+ 16-NOV-1947 00 / 23: -3.076
+ 16-DEC-1947 12 / 24:  1.674
+ 16-JAN-1948 12 / 25:  3.429
+ 15-FEB-1948 12 / 26:  1.954
+ 16-MAR-1948 12 / 27:  2.761
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.00
+ 2   / 2:  14.00
+ 3   / 3:  20.00
+ 4   / 4:  28.00
+ 5   / 5:  22.00
+ 6   / 6:  10.00
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+       A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:   12.00   14.00
+2   / 2:   14.00   20.00
+3   / 3:   20.00   28.00
+4   / 4:   28.00   22.00
+5   / 5:   22.00   10.00
+6   / 6:   10.00    ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.00
+ 2   / 2:  14.00
+ 3   / 3:  20.00
+ 4   / 4:  28.00
+ 5   / 5:  22.00
+ 6   / 6:  10.00
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+             1      2      3    
+             1      2      3
+ 1   / 1:  3.000  5.000  7.000
+ 2   / 2:  4.000  6.000  8.000
+ 3   / 3:  5.000  7.000  9.000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   5.00   7.00   9.00  11.00  13.00
+ 2   / 2:   7.00  11.00  15.00  19.00  23.00
+ 3   / 3:   9.00  15.00  21.00  27.00  33.00
+ 4   / 4:  11.00  19.00  27.00  35.00  43.00
+*** Running test: bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.2
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.8
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.2,,1.8
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.20     9.49     1.80     7.80
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.2
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 7
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.2,,7
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         8.91     9.20     1.00     7.00
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.3
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 7.5
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.9
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,7.5,7.9
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     9.30     7.50     7.90
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.2
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.2
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.4
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,8.2,1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.20     8.20     1.40     1.49
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.2  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.2  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.7,1.1
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.4
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.4
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.20     9.20    -1.40    -1.31
+*** Running test: bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  2.254  2.347  2.424  2.475  2.501
+ 2.17S / 4:  2.270  2.361  2.431  2.477  2.503
+ 2.5S  / 3:  2.266  2.351  2.413  2.455  2.481
+ 2.83S / 2:  2.234  2.307  2.359  2.396  2.424
+ 3.17S / 1:  2.168  2.227  2.269  2.300  2.330
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  2.282  2.377  2.454  2.507  2.535
+ 2.17S / 4:  2.296  2.390  2.461  2.509  2.536
+ 2.5S  / 3:  2.291  2.377  2.441  2.485  2.512
+ 2.83S / 2:  2.257  2.333  2.386  2.424  2.452
+ 3.17S / 1:  2.191  2.251  2.294  2.325  2.356
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  1.723  1.840  1.941  2.005  2.047
+ 2.17S / 4:  1.639  1.744  1.831  1.882  1.920
+ 2.5S  / 3:  1.515  1.605  1.676  1.714  1.746
+ 2.83S / 2:  1.358  1.428  1.481  1.503  1.528
+ 3.17S / 1:  1.175  1.222  1.256  1.263  1.282
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  1.216  1.301  1.374  1.422  1.452
+ 2.17S / 4:  1.086  1.164  1.229  1.270  1.298
+ 2.5S  / 3:  0.937  1.006  1.059  1.091  1.116
+ 2.83S / 2:  0.772  0.830  0.869  0.891  0.911
+ 3.17S / 1:  0.599  0.641  0.666  0.681  0.700
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -1.812
+ 23-AUG-1982 14 / 2: -1.758
+ 29-AUG-1982 16 / 3: -1.678
+ 04-SEP-1982 18 / 4: -1.571
+ 10-SEP-1982 20 / 5: -1.427
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -2.218
+ 23-AUG-1982 14 / 2: -2.049
+ 29-AUG-1982 16 / 3: -1.774
+ 04-SEP-1982 18 / 4: -1.412
+ 10-SEP-1982 20 / 5: -1.053
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -1.776
+ 23-AUG-1982 14 / 2: -1.455
+ 29-AUG-1982 16 / 3: -1.242
+ 04-SEP-1982 18 / 4: -1.051
+ 10-SEP-1982 20 / 5: -0.847
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                        1     
+                         1
+ 17-AUG-1982 12 / 1:  0.0037
+ 23-AUG-1982 14 / 2: -0.1892
+ 29-AUG-1982 16 / 3: -0.2982
+ 04-SEP-1982 18 / 4: -0.4057
+ 10-SEP-1982 20 / 5: -0.5178
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.00
+ 15    /  2:  25.00
+ 25    /  3:  25.00
+ 35    /  4:  25.00
+ 45    /  5:  25.00
+ 55    /  6:  25.00
+ 65    /  7:  25.00
+ 75    /  8:  25.00
+ 85    /  9:  25.00
+ 95    / 10:  25.00
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.27   0.68   0.03   0.02   0.00
+ 45    / 2:  98.65   1.15   0.15   0.03   0.02
+ 85    / 3:  95.12   4.57   0.22   0.07   0.01
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.6
+ 2   / 2:    1.0
+ 3   / 3:    0.0
+ 4   / 4:    0.0
+ 5   / 5:    0.0
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.86
+ 2   / 2:   0.13
+ 3   / 3:   0.02
+ 4   / 4:   0.00
+ 5   / 5:   0.00
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.236
+ 2   / 2:  0.107
+ 3   / 3:  0.005
+ 4   / 4:  0.002
+ 5   / 5:  0.000
+ 
+ 
+exit/script
+*** Running test: bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+*** Running test: bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+*** Running test: bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+*** Running test: bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME
+<axes>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME1">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+*** Running test: bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+*** Running test: bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                    161W   
+                      1
+ 16-JAN      /  1:  3.437
+ 15-FEB      /  2:  1.925
+ 17-MAR      /  3:  2.790
+ 16-APR      /  4:  1.790
+ 16-MAY      /  5:  0.800
+ 16-JUN      /  6:  3.800
+ 16-JUL      /  7: -0.200
+ 16-AUG      /  8:  0.465
+ 15-SEP      /  9:  2.572
+ 16-OCT      / 10: -2.530
+ 15-NOV      / 11: -3.090
+ 16-DEC      / 12:  1.787
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+*** Running test: bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+SHADE/grat=(color=white) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=whi)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+*** Running test: bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.000
+!-> REPEAT: S:4
+          4.000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.8415
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.9093
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.1411
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.8415
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.9093
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.1411
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.00  6.000  480.0
+I / *:     80.00  8.000  640.0
+I / *:     80.00  10.00  800.0
+I / *:     60.00  6.000  360.0
+I / *:     60.00  8.000  480.0
+I / *:     60.00  10.00  600.0
+I / *:     40.00  6.000  240.0
+I / *:     40.00  8.000  320.0
+I / *:     40.00  10.00  400.0
+I / *:     20.00  6.000  120.0
+I / *:     20.00  8.000  160.0
+I / *:     20.00  10.00  200.0
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.0
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.0
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.0
+ 177W    / -98: -177.0
+ 175W    / -97: -175.0
+ 173W    / -96: -173.0
+ 171W    / -95: -171.0
+ 169W    / -94: -169.0
+ 167W    / -93: -167.0
+ 165W    / -92: -165.0
+ 163W    / -91: -163.0
+ 161W    / -90: -161.0
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.0
+ 177W    / -98: -354.0
+ 175W    / -97: -350.0
+ 173W    / -96: -346.0
+ 171W    / -95: -342.0
+ 169W    / -94: -338.0
+ 167W    / -93: -334.0
+ 165W    / -92: -330.0
+ 163W    / -91: -326.0
+ 161W    / -90: -322.0
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.0
+ 177W    / -98: -531.0
+ 175W    / -97: -525.0
+ 173W    / -96: -519.0
+ 171W    / -95: -513.0
+ 169W    / -94: -507.0
+ 167W    / -93: -501.0
+ 165W    / -92: -495.0
+ 163W    / -91: -489.0
+ 161W    / -90: -483.0
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.0
+ 177W    / -98: -708.0
+ 175W    / -97: -700.0
+ 173W    / -96: -692.0
+ 171W    / -95: -684.0
+ 169W    / -94: -676.0
+ 167W    / -93: -668.0
+ 165W    / -92: -660.0
+ 163W    / -91: -652.0
+ 161W    / -90: -644.0
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.0
+ 177W    / -98: -885.0
+ 175W    / -97: -875.0
+ 173W    / -96: -865.0
+ 171W    / -95: -855.0
+ 169W    / -94: -845.0
+ 167W    / -93: -835.0
+ 165W    / -92: -825.0
+ 163W    / -91: -815.0
+ 161W    / -90: -805.0
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.000 "factorial"  1.000
+I / *:     2.000 "factorial"  2.000
+I / *:     3.000 "factorial"  6.000
+I / *:     4.000 "factorial"  24.00
+I / *:     5.000 "factorial"  120.0
+I / *:     6.000 "factorial"  720.0
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+               1N    
+               46
+ 1E     / 1:  27.83
+ 81E    / 2:  28.11
+ 161E   / 3:  28.79
+ 119W   / 4:  24.54
+ 39W    / 5:  27.48
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+               1N    
+               46
+ 1E     / 1:  27.83
+ 121E   / 2:  28.59
+ 119W   / 3:  24.54
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.98
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 15-JAN 11:49
+          20.98
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 15-JAN-0002 17:38
+          20.98
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:  7 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.79
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:  5 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          21.25
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M: 13 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.94
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+          28.28
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+*** Running test: bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.87
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.87
+ 16-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.79
+ 17-NOV-0099 / 1187:  99.88
+ 17-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.79
+ 17-NOV-0099 / 1187:  99.88
+ 17-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.79
+ 15-NOV-0099 23 / 1187:  99.87
+ 15-DEC-0099 23 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.79
+ 15-NOV-0099 23 / 1187:  99.87
+ 15-DEC-0099 23 / 1188:  99.96
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.29
+ 15-MAY-0098 23 / 1169:  98.37
+ 15-JUN-0098 23 / 1170:  98.46
+ 15-JUL-0098 23 / 1171:  98.54
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.29
+ 15-MAY-0098 23 / 1169:  98.37
+ 15-JUN-0098 23 / 1170:  98.46
+ 15-JUL-0098 23 / 1171:  98.54
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G005)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M: 11 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+can mem/all
+ -DELETE TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME      NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G005)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M: 11 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 11 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  7 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  7 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+CANC MEM/ALL
+ -DELETE VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 11 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:  7 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 1    / 1:  1111.
+ 4    / 2:  1114.
+ 7    / 3:  1113.
+ 10   / 4:  1112.
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:  7 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  8 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 11 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 11   / 3:  1121.
+ 16   / 4:  1126.
+ 21   / 5:  1131.
+ -DELETE A        M:  7 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G007)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  3 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  7 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 15 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+            11     16     21    
+             3      4      5
+ 1   / 1:  1121.  1126.  1131.
+ 3   / 2:  1141.  1146.  1151.
+ 5   / 3:  1161.  1166.  1171.
+ 7   / 4:  1181.  1186.  1191.
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M:  3 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  7 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  8 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 11 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 15 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 11 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 11 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1125.  1127.  1129.
+ 4   / 2:  1143.  1145.  1147.  1149.
+ 6   / 3:  1163.  1165.  1167.  1169.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1325.  1327.  1329.
+ 4   / 2:  1343.  1345.  1347.  1349.
+ 6   / 3:  1363.  1365.  1367.  1369.
+canc data/all
+ -DELETE BIGVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 15 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1521.  1721.  1921.
+ 4   / 2:  1341.  1541.  1741.  1941.
+ 6   / 3:  1361.  1561.  1761.  1961.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1523.  1723.  1923.
+ 4   / 2:  1343.  1543.  1743.  1943.
+ 6   / 3:  1363.  1563.  1763.  1963.
+canc data/all
+ -DELETE BIGVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+canc data/all
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- K:2 Z:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.  1352.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1512.  1552.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.  1358.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1518.  1558.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.  5123.
+ 5   / 2:  1153.  5153.
+ ---- K:2 Z:   5
+ 2   / 1:  1125.  5125.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.  2773.
+ 5   / 2:  6743.  2743.
+ ---- K:2 Z:   5
+ 2   / 1:  6775.  2775.
+ 5   / 2:  6745.  2745.
+canc data/all
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.  5132.
+ 5   / 2:  1135.  5135.
+ ---- K:2 Z:   5
+ 2   / 1:  1152.  5152.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.  2738.
+ 5   / 2:  6735.  2735.
+ ---- K:2 Z:   5
+ 2   / 1:  6758.  2758.
+ 5   / 2:  6755.  2755.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+               X  XBOXLO XBOXHI
+211   / 1:  211.0  209.5  212.5
+214   / 2:  214.0  212.5  215.5
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+               X  XBOXLO XBOXHI
+211   / 1:  211.0  209.7  212.3
+213.6 / 2:  213.6  212.3  214.9
+216.2 / 3:  216.2  214.9  217.5
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.69     1.40     7.40
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+             A   B
+1   / 1:  1.000 "a"
+2   / 2:  2.000 "b"
+3   / 3:  3.000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C      V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.000
+2   / 2: "b" "spat"  1.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.000
+2   / 2: "b" "that"  1.000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.000
+2   / 2: "b" "spat"  2.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.000
+2   / 2: "b" "that"  2.000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.000
+2   / 2: "b" "spat"  3.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.000
+2   / 2: "b" "that"  3.000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.000
+2   / 2: "b" "spat"  4.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.000
+2   / 2: "b" "that"  4.000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.000
+2   / 2: "b" "spat"  5.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.000
+2   / 2: "b" "that"  5.000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       Z                    5 r-  1                    5
+   Axis span (to cell edges) = 5
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.9763
+ 106.8W  /  2:  0.8243
+ 100.2W  /  3:  0.5526
+ 93.5W   /  4:  0.2007
+ 86.8W   /  5: -0.1804
+ 80.2W   /  6: -0.5353
+ 73.5W   /  7: -0.8125
+ 66.8W   /  8: -0.9716
+ 60.2W   /  9: -0.9896
+ 53.5W   / 10: -0.8638
+ 46.8W   / 11: -0.6126
+ 40.2W   / 12: -0.2723
+ 33.5W   / 13:  0.1075
+ 26.8W   / 14:  0.4716
+ 20.2W   / 15:  0.7673
+ 13.5W   / 16:  0.9515
+ 6.8W    / 17:  0.9975
+ 0.2W    / 18:  0.8986
+ 6.5E    / 19:  0.6691
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.9763
+ 96.8W   / 2: -0.3837
+ 80.2W   / 3: -0.5353
+ 63.5W   / 4:  0.9989
+ 46.8W   / 5: -0.6126
+ 30.2W   / 6: -0.2949
+ 13.5W   / 7:  0.9515
+ 3.2E    / 8: -0.7985
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.9763
+ 96.2W   / 2: -0.3837
+ 79.5W   / 3: -0.5353
+ 62.8W   / 4:  0.9989
+ 46.2W   / 5: -0.6126
+ 29.5W   / 6: -0.2949
+ 12.8W   / 7:  0.9515
+ 3.8E    / 8: -0.7985
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.8E(42.8)
+         -0.9123
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.9961
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  35th point
+             1     36     71     106    141    176    211    246    281    316    351    386    421    456    491    526    561    596    631    666    701    736    771    806    841    876    911    946    981   1016   1051   1086   1121   1156   1191   1226   1261   1296   1331   1366   1401   1436   1471   1506   1541   1576   1611   1646   1681   1716   1751   1786   1821   1856   1891   1926   1961   1996   2031   2066   2101   2136   2171   2206   2241   2276   2311   2346   2381  [...]
+             1     36     71    106    141    176    211    246    281    316    351    386    421    456    491    526    561    596    631    666    701    736    771    806    841    876    911    946    981   1016   1051   1086   1121   1156   1191   1226   1261   1296   1331   1366   1401   1436   1471   1506   1541   1576   1611   1646   1681   1716   1751   1786   1821   1856   1891   1926   1961   1996   2031   2066   2101   2136   2171   2206   2241   2276   2311   2346   2381   [...]
+ 1   / 1:  1.841  0.008  1.951  0.273  1.363  1.071  0.509  1.817  0.015  1.964  0.243  1.404  1.027  0.548  1.790  0.023  1.975  0.215  1.444  0.982  0.588  1.763  0.034  1.984  0.188  1.483  0.938  0.629  1.733  0.046  1.991  0.163  1.521  0.894  0.670  1.702  0.060  1.996  0.140  1.559  0.850  0.712  1.670  0.076  1.999  0.118  1.595  0.807  0.755  1.637  0.094  2.000  0.098  1.630  0.763  0.798  1.602  0.114  1.999  0.080  1.663  0.721  0.841  1.566  0.135  1.996  0.064  1.696  0.679 [...]
+ 2   / 2:  2.841  1.008  2.951  1.273  2.363  2.071  1.509  2.817  1.015  2.964  1.243  2.404  2.027  1.548  2.790  1.023  2.975  1.215  2.444  1.982  1.588  2.763  1.034  2.984  1.188  2.483  1.938  1.629  2.733  1.046  2.991  1.163  2.521  1.894  1.670  2.702  1.060  2.996  1.140  2.559  1.850  1.712  2.670  1.076  2.999  1.118  2.595  1.807  1.755  2.637  1.094  3.000  1.098  2.630  1.763  1.798  2.602  1.114  2.999  1.080  2.663  1.721  1.841  2.566  1.135  2.996  1.064  2.696  1.679 [...]
+ 
+can mode ignore
+*** Running test: bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                      179W   177W   175W   
+                        1      2      3
+ 16-JAN 12      / 1:  27.98  28.25  28.28
+ 15-FEB 02      / 2:  28.36  28.41  28.00
+ 15-MAR 17      / 3:  27.94  28.00  27.72
+ 15-APR 05      / 4:  28.00  28.00  28.00
+ 15-MAY 17      / 5:  28.00  28.00  28.00
+ 30-JUN 17      / 6:   ....   ....   ....
+ 15-AUG 17      / 7:  28.00  28.00  28.00
+ 15-SEP 05      / 8:  28.00  28.00  28.00
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                       1N     3N     5N     7N    
+                        1      2      3      4
+ 16-JAN 12      / 1:  28.41  28.25  28.06  28.10
+ 15-FEB 02      / 2:  28.40  28.41  28.16  27.75
+ 15-MAR 17      / 3:  27.59  28.00  27.87  27.82
+ 15-APR 05      / 4:  28.00  28.00  28.00  28.00
+ 15-MAY 17      / 5:  28.00  28.00  28.00  28.00
+ 30-JUN 17      / 6:   ....   ....   ....   ....
+ 15-AUG 17      / 7:  28.00  28.00  28.00  28.00
+ 15-SEP 05      / 8:  28.00  28.00  28.00  28.00
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1   / 1:  1.000  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3   / 3:  3.000  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8   / 6:  8.000  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1   / 1:  1.000  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3   / 3:  3.000  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8   / 6:  8.000  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: 01-JAN 00:45 to 01-APR 08:12
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME)
+ Column  3: TBOXLO is TBOXLO (axis TIME)
+ Column  4: TBOXHI is TBOXHI (axis TIME)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+               V     Z   ZBOXLO ZBOXHI
+0     / 1:    7.0    0.0   0.00   10.0
+20    / 2:   27.0   20.0  10.00   30.0
+50    / 3:   57.0   50.0  30.00   60.0
+75    / 4:   82.0   75.0  60.00   90.0
+120   / 5:  127.0  120.0  90.00  150.0
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: 01-JAN 00:45 to 31-OCT 09:36
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: 01-JAN 00:45 to 31-OCT 09:36
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: 01-JAN-1990 12:00 to 10-JAN-1990 12:00
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+*** Running test: bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.1148
+ 28-FEB-1989 00 / 425: -0.7739
+ 29-FEB-1989 00 / 426: -0.9510
+ 01-MAR-1989 00 / 427: -0.2538
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.1148
+ 28-FEB-1989 00 / 425: -0.7739
+ 29-FEB-1989 00 / 426: -0.9510
+ 01-MAR-1989 00 / 427: -0.2538
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+*** Running test: bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 15-FEB-1900 16:29
+          28.36
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 15-FEB-1900 16:29
+          28.36
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.000
+ 114W   / 427:  1.000
+ 113W   / 428:  1.000
+ 112W   / 429:  1.000
+ 111W   / 430:  1.000
+ 110W   / 431:  1.000
+ 109W   / 432:  1.000
+ 108W   / 433:  1.000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+*** Running test: bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.56
+ 15-FEB      /  2:  29.53
+ 17-MAR      /  3:  29.66
+ 16-APR      /  4:  29.88
+ 16-MAY      /  5:  29.89
+ 16-JUN      /  6:  29.96
+ 16-JUL      /  7:  29.69
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.67
+ 16-OCT      / 10:  29.75
+ 15-NOV      / 11:  29.91
+ 16-DEC      / 12:  29.77
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  0.00207
+ 15-FEB      /  2:  0.00050
+ 17-MAR      /  3:  0.00795
+ 16-APR      /  4:  0.00150
+ 16-MAY      /  5:  0.00351
+ 16-JUN      /  6:  0.00970
+ 16-JUL      /  7:  0.01888
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  0.00558
+ 16-OCT      / 10:  0.00681
+ 15-NOV      / 11:  0.00191
+ 16-DEC      / 12:  0.00483
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.50
+ 15-FEB      /  2:  29.52
+ 17-MAR      /  3:  29.52
+ 16-APR      /  4:  29.78
+ 16-MAY      /  5:  29.79
+ 16-JUN      /  6:  29.80
+ 16-JUL      /  7:  29.50
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.53
+ 16-OCT      / 10:  29.64
+ 15-NOV      / 11:  29.86
+ 16-DEC      / 12:  29.66
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.64
+ 15-FEB      /  2:  29.55
+ 17-MAR      /  3:  29.82
+ 16-APR      /  4:  29.93
+ 16-MAY      /  5:  29.96
+ 16-JUN      /  6:  30.08
+ 16-JUL      /  7:  29.82
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.75
+ 16-OCT      / 10:  29.90
+ 15-NOV      / 11:  29.97
+ 16-DEC      / 12:  29.86
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  295.6
+ 15-FEB      /  2:   59.1
+ 17-MAR      /  3:  533.9
+ 16-APR      /  4:  597.7
+ 16-MAY      /  5:  597.8
+ 16-JUN      /  6:  359.6
+ 16-JUL      /  7:  207.8
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  237.3
+ 16-OCT      / 10:  297.5
+ 15-NOV      / 11:  299.1
+ 16-DEC      / 12:  297.7
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  10.00
+ 15-FEB      /  2:   2.00
+ 17-MAR      /  3:  18.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:   7.00
+ 16-AUG      /  8:   0.00
+ 15-SEP      /  9:   8.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+*** Running test: bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.50
+ 02-JAN-1990 00 /  2:  -1.50
+ 03-JAN-1990 00 /  3:  -2.50
+ 04-JAN-1990 00 /  4:  -3.50
+ 05-JAN-1990 00 /  5:  -4.50
+ 06-JAN-1990 00 /  6:  -5.50
+ 07-JAN-1990 00 /  7:  -6.50
+ 08-JAN-1990 00 /  8:  -7.50
+ 09-JAN-1990 00 /  9:  -8.50
+ 10-JAN-1990 00 / 10:  -9.50
+ 11-JAN-1990 00 / 11:   1.98
+ 12-JAN-1990 00 / 12:   3.98
+ 13-JAN-1990 00 / 13:   5.98
+ 14-JAN-1990 00 / 14:   7.98
+ 15-JAN-1990 00 / 15:   9.98
+ 16-JAN-1990 00 / 16:  11.98
+ 17-JAN-1990 00 / 17:  13.98
+ 18-JAN-1990 00 / 18:  15.98
+ 19-JAN-1990 00 / 19:  17.98
+ 20-JAN-1990 00 / 20:  19.98
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.000 -0.02000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.500
+ 03-JAN-1990 00 / 3: -2.500
+ 04-JAN-1990 00 / 4: -3.500
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.000  0.5000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.980
+ 13-JAN-1990 00 / 13:  5.980
+ 14-JAN-1990 00 / 14:  7.980
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.000 -0.02000
+ 
+*** Running test: bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+*** Running test: bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  8.97,  9.27, 1.4, 4.333
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,6.2,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  3.000  2.000  1.000  1.000  3.000
+ 2   / 2:  1.000  3.000  2.000  2.000  3.000
+ 3   / 3:  2.000  3.000  3.000  2.000  3.000
+ 4   / 4:  3.000  2.000  1.000  1.000  2.000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  111.0  112.0  113.0  114.0  115.0
+ 2   / 2:  121.0  122.0  123.0  124.0  125.0
+ 3   / 3:  131.0  132.0  133.0  134.0  135.0
+ 4   / 4:  141.0  142.0  143.0  144.0  145.0
+ ---- K:2 Z:   2
+ 1   / 1:  211.0  212.0  213.0  214.0  215.0
+ 2   / 2:  221.0  222.0  223.0  224.0  225.0
+ 3   / 3:  231.0  232.0  233.0  234.0  235.0
+ 4   / 4:  241.0  242.0  243.0  244.0  245.0
+ ---- K:3 Z:   3
+ 1   / 1:  311.0  312.0  313.0  314.0  315.0
+ 2   / 2:  321.0  322.0  323.0  324.0  325.0
+ 3   / 3:  331.0  332.0  333.0  334.0  335.0
+ 4   / 4:  341.0  342.0  343.0  344.0  345.0
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  311.0  212.0  113.0  114.0  315.0
+ 2   / 2:  121.0  322.0  223.0  224.0  325.0
+ 3   / 3:  231.0  332.0  333.0  234.0  335.0
+ 4   / 4:  341.0  242.0  143.0  144.0  245.0
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E   	100.05E	100.1E 	100.15E	100.2E 	100.25E
+0.11N	1.001	1.002	1.002	1.003	1.003	1.004
+0.13N	1.001	1.002	1.002	1.003	1.003	1.004
+0.15N	1.001	1.002	1.002	1.003	1.003	1.004
+0.16N	1.002	1.002	1.003	1.003	1.004	1.004
+0.18N	1.002	1.002	1.003	1.003	1.004	1.004
+0.2N	1.002	1.002	1.003	1.004	1.004	1.004
+0.22N	1.002	1.003	1.003	1.004	1.004	1.005
+0.24N	1.002	1.003	1.003	1.004	1.004	1.005
+0.25N	1.003	1.003	1.004	1.004	1.005	1.005
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E   ,100.03E,100.07E,100.1E 
+0.11N,1.001,1.001,1.002,1.002
+0.13N,1.001,1.002,1.002,1.002
+0.15N,1.001,1.002,1.002,1.002
+0.16N,1.002,1.002,1.002,1.003
+0.18N,1.002,1.002,1.002,1.003
+0.2N,1.002,1.002,1.003,1.003
+0.22N,1.002,1.003,1.003,1.003
+0.24N,1.002,1.003,1.003,1.003
+0.25N,1.003,1.003,1.003,1.004
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.0
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.0
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.0
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1008W	155.1002W	155.0998W	155.0992W	155.0987W
+19.7002N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7007N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7012N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7017N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7022N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7027N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1008W,155.1002W,155.0998W,155.0992W,155.0987W
+19.7002N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7007N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7012N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7017N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7022N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7027N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: 15-FEB-1980 12:00
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.540E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5  8.000E+00  6.750E+00 0.073    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+*** Running test: bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.5
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,3.1
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.5
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+*** Running test: bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: 01-JAN-1946 00:00 to 01-JUL-1946 00:00
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: 01-JAN-1946 06:46 to 02-JUL-1946 21:31
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+*** Running test: bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+*** Running test: bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+*** Running test: bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+*** Running test: bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+*** Running test: bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+*** Running test: bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.3
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.923
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.323
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.3,,4.923,5.323
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.30     6.31     4.92     5.32
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.2
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.212
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.4
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.2,5.212,1.4
+ppl fill
+*** Running test: bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME1     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME1     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+! can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+*** Running test: bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+*** Running test: bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 17-MAR 02:58
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 17-MAR 02:58
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+*** Running test: bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.9"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET  version6.9:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE/SIGMA
+      /CURVILIN
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE/NAME
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE/QUIET
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET/SIGMA/CURVILIN
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO
+ 
+ Use SHOW ALIAS to see alternative command names
+*** Running test: bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "31-Mar-14:15:38"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="31-Mar-14:15:38"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 31-Mar-14
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 15:38
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="31-Mar-14:15:38"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "31-Mar-14:15:38"
+*** Running test: bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+*** Running test: bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+*** Running test: bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT)
+ Column  2: Z is Z (axis PSZT)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+*** Running test: bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME1).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME1" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.6N
+             T (day): 1.7837
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT).units = degrees 
+ (PSXT).point_spacing = even 
+ (PSXT).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT).units = meters 
+ (PSYT).point_spacing = uneven 
+ (PSYT).edges = PSYTedges 
+ (PSYT).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = hour since 0000-01-01 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = days since 1-JAN-0000 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 1-JAN-0000 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 1-mar-1955 
+ (TIME).time_origin = 1-mar-1955 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 15-jan-2002 
+ (TIME).time_origin = 15-jan-2002 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 15-jan-2002 
+ (TIME).time_origin = 15-jan-2002 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = MONTHS since 1-JAN-0001 
+ (TIME).time_origin = 1-JAN-0001 
+ (TIME).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = MONTHS since 15-JAN-0000 
+ (TIME).time_origin = 15-JAN-0000 
+ (TIME).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = days since 15-JAN-0000 
+ (TIME).time_origin = 15-JAN-0000 
+ (TIME).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME1[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME1).units = hour since 0000-01-01 00:00:00 
+ (TIME1).time_origin = 01-JAN-0000 00:00:00 
+ (TIME1).modulo =   
+ (TIME1).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+*** Running test: bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : 16-JAN 06:00
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : 16-JAN 06:00
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+*** Running test: bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : 16-JAN 06:00
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : 16-JAN 06:00
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : 17-AUG-1982 12:00
+          11.33
+*** Running test: bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+*** Running test: bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+*** Running test: bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 8.00E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.20E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME1
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+*** Running test: bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.2S
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6320.5)
+             LATITUDE : 5.2S
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.2N to 59.2N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME4
+ 
+show att/all ($timeax)
+ !-> show att/all TIME4
+show axis ($timeax)
+ !-> show axis TIME4
+ name       axis              # pts   start                end
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME4
+show att/all ($timeax)
+ !-> show att/all TIME4
+show axis ($timeax)
+ !-> show axis TIME4
+ name       axis              # pts   start                end
+ TIME4     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT
+show att/all ($zax)
+ !-> show att/all PSZT
+show axis ($zax)
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME5)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME111)              DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.2N to 59.2N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+*** Running test: bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME
+ name       axis              # pts   start                end
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX005)
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX004)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX001)
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX001)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX007)
+ name       axis              # pts   start                end
+ (AX007)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX004)
+ name       axis              # pts   start                end
+ (AX004)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX001)
+ name       axis              # pts   start                end
+ (AX001)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME
+ name       axis              # pts   start                end
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+*** Running test: bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 10-FEB-1982 10:30 to 15-MAR-1982 21:30
+             LONGITUDE: 179.5E
+             LATITUDE: 0.2S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+*** Running test: bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME      TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX      T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = axis span)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+*** Running test: bn602_bug_fixes.jnl
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME      TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+*** Running test: bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 01-JAN 00:45 to 31-DEC 06:34
+             LONGITUDE: 139.5E
+             LATITUDE: 0.8N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+*** Running test: bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+*** Running test: bn603_bug_fixes.jnl
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+*** Running test: bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 17-MAR 02:58
+                39N   
+                65
+ 179E   / 80:  11.90
+ 179W   / 81:  12.12
+ 177W   / 82:  12.08
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 17-MAR 02:58
+                39N   
+                65
+ 179E   / 80:  35.69
+ 179W   / 81:  36.36
+ 177W   / 82:  36.24
+ 
+*** Running test: bn_memory_symbol.jnl
+Unable to allocate 500000.0 Mwords of memory.
+Restoring previous memory of 0.2 Mwords.
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+*** Running test: bn605_bug_fixes.jnl
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: 01-JAN 00:00 to 31-DEC 05:49
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                         T   TBOX
+16-JAN 12      /  1:   15.5  31.00
+15-FEB 02      /  2:   45.1  28.24
+15-MAR 17      /  3:   74.7  31.00
+15-APR 05      /  4:  105.2  30.00
+15-MAY 17      /  5:  135.7  31.00
+15-JUN 05      /  6:  166.2  30.00
+15-JUL 17      /  7:  196.7  31.00
+15-AUG 17      /  8:  227.7  31.00
+15-SEP 05      /  9:  258.2  30.00
+15-OCT 17      / 10:  288.7  31.00
+15-NOV 05      / 11:  319.2  30.00
+15-DEC 17      / 12:  349.7  31.00
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+ADD_9(A,B,C,D,E,F,G,H,I)
+APPENDE(ENS,VAR)
+AVET(A)
+DATES(Offsets)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+FACTORIAL(A)
+FFT_AMP(A)
+FFTA_SAMPLE(A)
+FFT_PHAS(A)
+PASS_THRU(A)
+PERCENT_GOOD_T(A)
+STORAGE(A)
+STRING_ARG(Flags,NString)
+STUDENT_T_CUTOFF(P,nf)
+SUBTRACT(A,B)
+ 
+*** Running test: bn608_bug_fixes.jnl
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G006)">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_MIN = "8.0000010E-04"
+YAXIS_MAX = "2.1000002E-03"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_MIN = "8.0000012E-07"
+YAXIS_MAX = "2.1000003E-06"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXIS_MAX = "5.0050505E-06"
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+*** Running test: bn_shade_trim.jnl
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+*** Running test: bn_mode_nlevels.jnl
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+*** Running test: bn61_bug_fixes.jnl
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+*** Running test: bn_test_opendap.jnl
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00
+ 
+ 
+CANCEL MODE IGNORE
+*** Running test: bn611_bug_fixes.jnl
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+shade/over/i=1:2/j=0:2/patt i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+fill/over/i=1:2/j=0:2/patt i+j
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME"           
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G006)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00
+ 30-FEB-1909 00 / 2:  59.00
+ 02-MAR-1909 00 / 3:  61.00
+ 04-MAR-1909 00 / 4:  63.00
+ 06-MAR-1909 00 / 5:  65.00
+ 08-MAR-1909 00 / 6:  67.00
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 3   / 3:  3.000
+save/clob/file=b.nc b
+ 
+*** Running test: bn_no_valid_on_plot.jnl
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.800E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.600E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  8.000E+00  6.630E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  4.000E+00  6.330E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.530E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.780E+00 -7.900E-01 0.119    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.530E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+*** Running test: bn_median.jnl
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 29-NOV-1982 10:30 to 01-JAN-1983 21:30
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                        VAR    VAR    VAR    VAR
+30-NOV-1982 23 / 106: -10.07 -10.07 -10.07 -11.98
+04-DEC-1982 00 / 107: -13.42 -13.42 -13.42 -10.07
+07-DEC-1982 01 / 108: -15.07 -13.42 -13.42 -10.07
+10-DEC-1982 02 / 109: -11.98 -11.98 -11.98 -10.07
+13-DEC-1982 03 / 110:  -4.63  -4.63  -4.63  -4.63
+16-DEC-1982 04 / 111:   0.77   0.77   0.77   0.77
+19-DEC-1982 05 / 112:   1.06   1.06   1.06   1.06
+22-DEC-1982 06 / 113:   2.75   2.75   2.75   2.75
+25-DEC-1982 07 / 114:   9.07   9.07   9.07   4.21
+28-DEC-1982 08 / 115:  10.80   9.07   9.07   4.21
+31-DEC-1982 09 / 116:   4.21  10.80  10.80   9.07
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: 15-FEB-0002 04:07
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+               VAR    VAR    VAR
+79W   / 131:   ....  25.99  25.93
+77W   / 132:   ....   ....  25.99
+75W   / 133:   ....   ....  25.99
+73W   / 134:   ....   ....   ....
+71W   / 135:   ....   ....   ....
+69W   / 136:   ....   ....   ....
+67W   / 137:   ....   ....   ....
+65W   / 138:   ....   ....   ....
+63W   / 139:   ....   ....  27.80
+61W   / 140:   ....   ....  27.80
+59W   / 141:   ....  27.80  27.65
+57W   / 142:  27.80  27.80  27.70
+55W   / 143:  27.65  27.65  27.65
+53W   / 144:  27.43  27.65  27.65
+51W   / 145:  27.70  27.43  27.65
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: 15-FEB-0002 04:07
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+              VAR    VAR    VAR
+19S   / 36:  28.32  28.32  28.32
+17S   / 37:  28.57  28.57  28.57
+15S   / 38:  29.06  29.06  29.06
+13S   / 39:  29.43  29.24  29.23
+11S   / 40:  29.24  29.33  29.23
+9S    / 41:  29.33  29.24  29.23
+7S    / 42:  29.23  29.23  29.23
+5S    / 43:  28.97  28.97  28.97
+3S    / 44:  28.40  28.40  28.44
+1S    / 45:  28.36  28.40  28.40
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+             VAR    VAR    VAR
+0     / 1:  1.900  1.900  0.3281
+20    / 2:  1.322  1.322  0.3281
+40    / 3:  0.328  0.328  0.2405
+60    / 4: -0.254 -0.157  0.3281
+80    / 5: -0.157 -0.254  0.3281
+100   / 6: -0.785 -0.157  0.3281
+120   / 7:  0.241  0.241  0.3281
+140   / 8:  0.390  0.390  0.3904
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+*** Running test: bn614_bug_fixes.jnl
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00
+ 30-FEB-1909 00 / 2:  59.00
+ 02-MAR-1909 00 / 3:  61.00
+ 04-MAR-1909 00 / 4:  63.00
+ 06-MAR-1909 00 / 5:  65.00
+ 08-MAR-1909 00 / 6:  67.00
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 3   / 3:  3.000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME1     TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.53
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.53
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.50
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.50
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 01-JAN-0001 00:00:00
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 364 (modulo length = 365)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1S
+                        141.3W  
+                          1
+ 16-JAN 12      /  1:  0.05848
+ 15-FEB 00      /  2:  0.05188
+ 16-MAR 12      /  3:  0.04783
+ 16-APR 00      /  4:  0.03808
+ 16-MAY 12      /  5:  0.05938
+ 16-JUN 00      /  6:  0.06572
+ 16-JUL 12      /  7:  0.06153
+ 16-AUG 12      /  8:  0.07461
+ 16-SEP 00      /  9:  0.05815
+ 16-OCT 12      / 10:  0.06169
+ 16-NOV 00      / 11:  0.05655
+ 16-DEC 12      / 12:  0.05769
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "20"
+LEV_DEL = "0.05"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "20"
+LEV_DEL = "0.05"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX       TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+*** Running test: bn_mode_nodata_lab.jnl
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME                32 r   01-JAN-1988 00:00    01-FEB-1988 00:00
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 32
+*** Running test: bn_string_ngd_nbd.jnl
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  0.000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  0.000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+ ---- L:2 T:   2
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+ ---- L:2 T:   2
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000  2.000
+ 2   / 2:  0.000  2.000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000  2.000
+ 2   / 2:  0.000  0.000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000  2.000
+ 2   / 2:  2.000  2.000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000  2.000
+ 2   / 2:  0.000  2.000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000  2.000
+ 2   / 2:  0.000  0.000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000  2.000
+ 2   / 2:  2.000  2.000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000
+ 2   / 2:  4.000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000
+ 2   / 2:  4.000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00
+*** Running test: bn_cat_string.jnl
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+*** Running test: bn_sort_strings.jnl
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+        INDX_AI                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+        INDX_BI   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+        INDX_AI                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+        INDX_BI   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+        INDX_AJ                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+        INDX_BJ   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+        INDX_AK                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+        INDX_BK   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+        INDX_AL                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+        INDX_BL   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+*** Running test: bn_samplexyt.jnl
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+            YPTS   TPTS  SAMPL_PTS
+1    /  1:  20.54    20.    ....
+2    /  2: -29.07    60.    ....
+3    /  3:  26.64   100.    ....
+4    /  4: -28.97   140.    ....
+5    /  5: -17.10   180.    ....
+6    /  6:  -8.79   220.    ....
+7    /  7: -26.49   260.    ....
+8    /  8:  -9.00   300.    ....
+9    /  9: -19.19   340.    ....
+10   / 10: -19.84   380.   360.7
+11   / 11: -44.11   420.   376.4
+12   / 12:  34.07   460.   494.6
+13   / 13:  34.63   500.   535.1
+14   / 14:  -6.60   540.   533.9
+15   / 15: -39.01   580.   541.5
+16   / 16: -25.63   620.   594.9
+17   / 17: -22.97   660.   637.5
+18   / 18: -30.91   700.   669.6
+19   / 19: -22.52   740.    ....
+20   / 20: -20.65   780.    ....
+21   / 21: -41.66   820.    ....
+22   / 22:  39.14   860.    ....
+23   / 23:  22.88   900.    ....
+24   / 24: -41.03   940.    ....
+25   / 25:  33.35   980.    ....
+26   / 26:  22.54  1020.    ....
+27   / 27:  13.98  1060.    ....
+28   / 28:  21.99  1100.    ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+*** Running test: bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+*** Running test: bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+*** Running test: bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 500
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G002_NXT with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+       FCN_NOR  FCN_REV
+J /  1:  0.6332 -0.6332
+J /  2:  0.6455 -0.6455
+J /  3:  0.4997 -0.4997
+J /  4:  0.2316 -0.2316
+J /  5: -0.0932  0.0932
+J /  6: -0.3952  0.3952
+J /  7: -0.6004  0.6004
+J /  8: -0.6587  0.6587
+J /  9: -0.5556  0.5556
+J / 10: -0.3166  0.3166
+J / 11:  0.0000  0.0000
+J / 12:  0.3166 -0.3166
+J / 13:  0.5556 -0.5556
+J / 14:  0.6587 -0.6587
+J / 15:  0.6004 -0.6004
+J / 16:  0.3952 -0.3952
+J / 17:  0.0932 -0.0932
+J / 18: -0.2316  0.2316
+J / 19: -0.4997  0.4997
+J / 20: -0.6455  0.6455
+J / 21: -0.6332  0.6332
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+              180E   
+               51
+ 8N   / 19:  0.4997
+ 7N   / 18:  0.2316
+ 6N   / 17: -0.0932
+ 5N   / 16: -0.3952
+ 4N   / 15: -0.6004
+ 3N   / 14: -0.6587
+ 2N   / 13: -0.5556
+ 1N   / 12: -0.3166
+ 0    / 11:  0.0000
+ 1S   / 10:  0.3166
+*** Running test: bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+*** Running test: bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+*** Running test: bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00
+ 27-FEB-1999 12:00 / 178:  58.00
+ 28-FEB-1999 00:00 / 179:  59.00
+ 28-FEB-1999 12:00 / 180:  59.00
+ 01-MAR-1999 00:00 / 181:  60.00
+ 01-MAR-1999 12:00 / 182:  60.00
+ 02-MAR-1999 00:00 / 183:  61.00
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0
+ 31-DEC-1999 12:00 / 792:  365.0
+ 01-JAN-2000 00:00 / 793:    1.0
+ 01-JAN-2000 12:00 / 794:    1.0
+ 02-JAN-2000 00:00 / 795:    2.0
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00
+ 27-FEB-1999 12:00 / 178:  58.00
+ 28-FEB-1999 00:00 / 179:  59.00
+ 28-FEB-1999 12:00 / 180:  59.00
+ 01-MAR-1999 00:00 / 181:  60.00
+ 01-MAR-1999 12:00 / 182:  60.00
+ 02-MAR-1999 00:00 / 183:  61.00
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+*** Running test: bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+               A     A      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+               B     B      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+               C     C      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 12.5
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+               D     D      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+               A     A    EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000   ....   ....
+2    /  2:  2.000  1.750  1.750
+3    /  3:  2.000  1.750  1.750
+4    /  4:  1.000  1.500  1.500
+5    /  5:  2.000  1.500  1.500
+6    /  6:  1.000  1.250  1.250
+7    /  7:  1.000  1.000  1.000
+8    /  8:  1.000   ....   ....
+9    /  9:   ....   ....   ....
+10   / 10:  1.000   ....   ....
+11   / 11:  1.000  1.000  1.000
+12   / 12:  1.000   ....   ....
+ ---- J:2 Y:   2
+1    /  1:  2.000   ....   ....
+2    /  2:  3.000  2.750  2.750
+3    /  3:  3.000  2.750  2.750
+4    /  4:  2.000  2.500  2.500
+5    /  5:  3.000  2.500  2.500
+6    /  6:  2.000  2.250  2.250
+7    /  7:  2.000  2.000  2.000
+8    /  8:  2.000   ....   ....
+9    /  9:   ....   ....   ....
+10   / 10:  2.000   ....   ....
+11   / 11:  2.000  2.000  2.000
+12   / 12:  2.000   ....   ....
+ 
+ 
+*** Running test: bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3.123E+09
+ 01-JAN-2000 00:14:41 / 441:  3.123E+09
+ 01-JAN-2000 00:14:43 / 442:  3.123E+09
+ 01-JAN-2000 00:14:45 / 443:  3.123E+09
+ 01-JAN-2000 00:14:47 / 444:  3.123E+09
+ 01-JAN-2000 00:14:49 / 445:  3.123E+09
+ 01-JAN-2000 00:14:51 / 446:  3.123E+09
+ 01-JAN-2000 00:14:53 / 447:  3.123E+09
+ 01-JAN-2000 00:14:55 / 448:  3.123E+09
+ 01-JAN-2000 00:14:57 / 449:  3.123E+09
+ 01-JAN-2000 00:14:59 / 450:  3.123E+09
+ 01-JAN-2000 00:15:01 / 451:  3.123E+09
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+*** Running test: bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_clock_syms.jnl
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "0.010997"
+CLOCK_SECS = "0.006"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:38:20"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.072989"
+CLOCK_SECS = "0.126"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.292956
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0"
+CLOCK_SECS = "0.493"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "0.495"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.029995
+ !-> DEFINE VARIABLE sumcpu =0.029995
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.033995
+ !-> DEFINE VARIABLE sumcpu =0.06399
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.030995
+ !-> DEFINE VARIABLE sumcpu =0.094985
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.037994
+ !-> DEFINE VARIABLE sumcpu =0.132979
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.030995
+ !-> DEFINE VARIABLE sumcpu =0.163974
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.032996
+ !-> DEFINE VARIABLE sumcpu =0.19697
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.032995
+ !-> DEFINE VARIABLE sumcpu =0.229965
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.030994
+ !-> DEFINE VARIABLE sumcpu =0.260959
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.030996
+ !-> DEFINE VARIABLE sumcpu =0.291955
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.034994
+ !-> DEFINE VARIABLE sumcpu =0.326949
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.326949
+0.326949
+sh sym CLOCK_SECS
+CLOCK_SECS = "0.978"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:38"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:38:21"
+*** Running test: bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+Set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                  Z  ZBOXLO ZBOXHI
+-5000   /  1: -5000. -5000. -4500.
+-4000   /  2: -4000. -4500. -3500.
+-3000   /  3: -3000. -3500. -2500.
+-2000   /  4: -2000. -2500. -1800.
+-1500   /  5: -1500. -1800. -1300.
+-1200   /  6: -1200. -1300. -1100.
+-1000   /  7: -1000. -1100.  -900.
+-800    /  8:  -800.  -900.  -700.
+-600    /  9:  -600.  -700.  -500.
+-400    / 10:  -400.  -500.  -350.
+-300    / 11:  -300.  -350.  -250.
+-200    / 12:  -200.  -250.  -180.
+-150    / 13:  -150.  -180.  -120.
+-100    / 14:  -100.  -120.   -90.
+-75     / 15:   -75.   -90.   -60.
+-50     / 16:   -50.   -60.   -32.
+-30     / 17:   -30.   -32.   -24.
+-20     / 18:   -20.   -24.   -12.
+-10     / 19:   -10.   -12.    -5.
+0       / 20:     0.    -5.     0.
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  27.46
+ 2   / 2:  27.45
+ 3   / 3:  27.54
+ 4   / 4:  27.55
+ 5   / 5:  27.56
+ 6   / 6:  27.66
+ 7   / 7:  27.75
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+              Z  ZBOXLO ZBOXHI
+I / *:     5.000  4.890  5.110
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+              Z  ZBOXLO ZBOXHI
+I / *:     5.000  4.890  5.110
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+           YBOXLO  YBOXHI
+76.5S /  1: -90.00 -70.81
+66.4S /  2: -70.81 -62.73
+59.4S /  3: -62.73 -56.44
+53.7S /  4: -56.44 -51.06
+48.6S /  5: -51.06 -46.24
+44S   /  6: -46.24 -41.81
+39.7S /  7: -41.81 -37.67
+35.7S /  8: -37.67 -33.75
+31.9S /  9: -33.75 -30.00
+28.2S / 10: -30.00 -26.39
+24.6S / 11: -26.39 -22.89
+21.2S / 12: -22.89 -19.47
+17.8S / 13: -19.47 -16.13
+14.5S / 14: -16.13 -12.84
+11.2S / 15: -12.84  -9.59
+8S    / 16:  -9.59  -6.38
+4.8S  / 17:  -6.38  -3.18
+1.6S  / 18:  -3.18   0.00
+1.6N  / 19:   0.00   3.18
+4.8N  / 20:   3.18   6.38
+8N    / 21:   6.38   9.59
+11.2N / 22:   9.59  12.84
+14.5N / 23:  12.84  16.13
+17.8N / 24:  16.13  19.47
+21.2N / 25:  19.47  22.89
+24.6N / 26:  22.89  26.39
+28.2N / 27:  26.39  30.00
+31.9N / 28:  30.00  33.75
+35.7N / 29:  33.75  37.67
+39.7N / 30:  37.67  41.81
+44N   / 31:  41.81  46.24
+48.6N / 32:  46.24  51.06
+53.7N / 33:  51.06  56.44
+59.4N / 34:  56.44  62.73
+66.4N / 35:  62.73  70.81
+76.5N / 36:  70.81  90.00
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+               EX#1    EX#2
+76.5S /  1:  0.03826  0.02778
+66.4S /  2:  0.02750  0.02778
+59.4S /  3:  0.02725  0.02778
+53.7S /  4:  0.02718  0.02778
+48.6S /  5:  0.02716  0.02778
+44S   /  6:  0.02714  0.02778
+39.7S /  7:  0.02714  0.02778
+35.7S /  8:  0.02713  0.02778
+31.9S /  9:  0.02713  0.02778
+28.2S / 10:  0.02713  0.02778
+24.6S / 11:  0.02712  0.02778
+21.2S / 12:  0.02712  0.02778
+17.8S / 13:  0.02712  0.02778
+14.5S / 14:  0.02712  0.02778
+11.2S / 15:  0.02712  0.02778
+8S    / 16:  0.02712  0.02778
+4.8S  / 17:  0.02712  0.02778
+1.6S  / 18:  0.02712  0.02778
+1.6N  / 19:  0.02712  0.02778
+4.8N  / 20:  0.02712  0.02778
+8N    / 21:  0.02712  0.02778
+11.2N / 22:  0.02712  0.02778
+14.5N / 23:  0.02712  0.02778
+17.8N / 24:  0.02712  0.02778
+21.2N / 25:  0.02712  0.02778
+24.6N / 26:  0.02712  0.02778
+28.2N / 27:  0.02713  0.02778
+31.9N / 28:  0.02713  0.02778
+35.7N / 29:  0.02713  0.02778
+39.7N / 30:  0.02714  0.02778
+44N   / 31:  0.02714  0.02778
+48.6N / 32:  0.02716  0.02778
+53.7N / 33:  0.02718  0.02778
+59.4N / 34:  0.02725  0.02778
+66.4N / 35:  0.02750  0.02778
+76.5N / 36:  0.03826  0.02778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8459
+ 16-JAN-1951 /  2: -0.4792
+ 16-JAN-1952 /  3: -0.0086
+ 16-JAN-1953 /  4:  0.5030
+ 16-JAN-1954 /  5: -0.8601
+ 16-JAN-1955 /  6:  0.9996
+ 16-JAN-1956 /  7: -0.8863
+ 16-JAN-1957 /  8:  0.5404
+ 16-JAN-1958 /  9: -0.0625
+ 16-JAN-1959 / 10: -0.4313
+ 16-JAN-1960 / 11:  0.8159
+ 16-JAN-1961 / 12: -0.9952
+ 16-JAN-1962 / 13:  0.9170
+ 16-JAN-1963 / 14: -0.6068
+ 16-JAN-1964 / 15:  0.1432
+ 16-JAN-1965 / 16:  0.3660
+ 16-JAN-1966 / 17: -0.7727
+ 16-JAN-1967 / 18:  0.9840
+ 16-JAN-1968 / 19: -0.9463
+ 16-JAN-1969 / 20:  0.6618
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX010)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241
+ DEC-1951 /  2:  0.2968
+ DEC-1952 /  3:  0.2154
+ DEC-1953 /  4: -0.6635
+ DEC-1954 /  5:  0.9438
+ DEC-1955 /  6: -0.9853
+ DEC-1956 /  7:  0.7713
+ DEC-1957 /  8: -0.3640
+ DEC-1958 /  9: -0.1355
+ DEC-1959 / 10:  0.6006
+ DEC-1960 / 11: -0.9179
+ DEC-1961 / 12:  0.9950
+ DEC-1962 / 13: -0.8204
+ DEC-1963 / 14:  0.4383
+ DEC-1964 / 15:  0.0647
+ DEC-1965 / 16: -0.5423
+ DEC-1966 / 17:  0.8827
+ DEC-1967 / 18: -0.9998
+ DEC-1968 / 19:  0.8589
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX005)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000
+ 
+*** Running test: bn_axis_reversed_syms.jnl
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+*** Running test: bn_isdepth.jnl
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+*** Running test: bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+*** Running test: bn64_bug_fixes.jnl
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                 2      3    
+                 2      3
+ 21241   / 1:   2.00  27.00
+ 21242   / 2:   2.00  28.00
+ 21243   / 3:   2.00  29.00
+ 21244   / 4:   3.00   1.00
+ 21245   / 5:   3.00   2.00
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+*** Running test: bn_long_grid_names.jnl
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ 3   / 3:  0.4100  0.4170  0.4670
+ 4   / 4:  0.4350  0.4440  0.4700
+ 5   / 5:  0.4780  0.5150  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             4      6      8    
+             2      3      4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- K:3 Z:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- K:4 Z:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- K:3 Z:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- K:4 Z:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- K:3 Z:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- K:4 Z:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             5      7      9    
+             3      4      5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- K:4 Z:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- K:5 Z:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- K:4 Z:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- K:5 Z:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- K:4 Z:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- K:5 Z:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.97  24.15  24.37  24.63
+ 25-JAN-1982 00 / 3:  23.89  23.98  24.17  24.40  24.65
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AVE, on Y at LIN*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.98  24.15  24.38  24.63
+ 25-JAN-1982 00 / 3:  23.88  23.97  24.15  24.39  24.64
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  5 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at LIN, on Y at LIN*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.76  23.87  24.04  24.25
+ 25-JAN-1982 00 / 3:  23.74  23.73  23.82  23.97  24.15
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:  5 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 10 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 10 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 4    complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  8 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 14 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 15 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 14 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 8    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 18 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 9    complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ found   TEMP     M:  7 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+setting up plot
+PPL plot 10   complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 22 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 11   complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 12   complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 13   complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX010)                         use count:   1
+    AXIS (AX009)                         use count:   1
+    AXIS (AX007)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_xml_repl.jnl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+*** Running test: bn65_bug_fixes.jnl
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+                   0.03S 
+                    1
+ 179.972W  /  1:  27.50
+ 179.922W  /  2:  27.48
+ 179.872W  /  3:  27.47
+ 179.822W  /  4:  27.47
+ 179.772W  /  5:  27.45
+ 179.722W  /  6:  27.43
+ 179.672W  /  7:  27.43
+ 179.622W  /  8:  27.43
+ 179.572W  /  9:  27.45
+ 179.522W  / 10:  27.46
+ 179.472W  / 11:  27.47
+ 179.422W  / 12:  27.46
+ 179.372W  / 13:  27.47
+ 179.322W  / 14:  27.48
+ 179.272W  / 15:  27.49
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+                   0.03S 
+                    1
+ 179.972W  /  1:  27.50
+ 179.922W  /  2:  27.48
+ 179.872W  /  3:  27.47
+ 179.822W  /  4:  27.47
+ 179.772W  /  5:  27.45
+ 179.722W  /  6:  27.43
+ 179.672W  /  7:  27.43
+ 179.622W  /  8:  27.43
+ 179.572W  /  9:  27.45
+ 179.522W  / 10:  27.46
+ 179.472W  / 11:  27.47
+ 179.422W  / 12:  27.46
+ 179.372W  / 13:  27.47
+ 179.322W  / 14:  27.48
+ 179.272W  / 15:  27.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : 15-FEB-1150 00:00 NOLEAP
+          419430.
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.
+ 16-OCT-1149 12 /  2:  419309.
+ 16-NOV-1149 00 /  3:  419339.
+ 16-DEC-1149 12 /  4:  419370.
+ 16-JAN-1150 12 /  5:  419401.
+ 15-FEB-1150 00 /  6:  419430.
+ 16-MAR-1150 12 /  7:  419460.
+ 16-APR-1150 00 /  8:  419490.
+ 16-MAY-1150 12 /  9:  419521.
+ 16-JUN-1150 00 / 10:  419551.
+ 16-JUL-1150 12 / 11:  419582.
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : 15-FEB-1150 00:00 NOLEAP
+          419430.
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+*** Running test: bn_txtype_dmy.jnl
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+*** Running test: bn_n_open_dsets_sym.jnl
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+*** Running test: bn_multi_decade.jnl
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+*** Running test: bn_show_xml_file.jnl
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+ 
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+*** Running test: bn66_bug_fixes.jnl
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (XZT ave)
+ 3.5N  / 56:  27.59
+ 3.17N / 55:  27.76
+ 2.83N / 54:  27.90
+ 2.5N  / 53:  28.00
+ 2.17N / 52:  28.08
+ 1.83N / 51:  28.14
+ 1.5N  / 50:  28.16
+ 1.17N / 49:  28.16
+ 0.83N / 48:  28.15
+ 0.5N  / 47:  28.14
+ 0.17N / 46:  28.14
+ 0.17S / 45:  28.15
+ 0.5S  / 44:  28.18
+ 0.83S / 43:  28.21
+ 1.17S / 42:  28.23
+ 1.5S  / 41:  28.23
+ 1.83S / 40:  28.22
+ 2.17S / 39:  28.17
+ 2.5S  / 38:  28.08
+ 2.83S / 37:  27.96
+ 3.17S / 36:  27.80
+ 3.5S  / 35:  27.61
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+*** Running test: bn_netcdf4.jnl
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+*** Running test: bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G004)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.8 to 10.3
+             Y: 0.8 to 10.3
+             Z:  N/A
+             TIME: 27-DEC-2009 00:00 to 06-APR-2010 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.8 to 10.3
+             Y: 0.8 to 10.3
+             Z:  N/A
+             TIME: 27-DEC-2009 00:00 to 06-APR-2010 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : 21-JAN-2010 00:00
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : 21-JAN-2010 00:00
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+*** Running test: bn_axis_dir_symbols.jnl
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+*** Running test: bn663_bug_fixes.jnl
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+*** Running test: bn_set_axis_regular.jnl
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.3 to 10.7
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+*** Running test: bn_set_cancel_redirect.jnl
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.9 (beta)"                                                      
+ 3    /  3:" ! Linux 2.6.18-371.4.1.el5 64-bit - 03/31/14"                              
+ 4    /  4:" ! 31-Mar-14 15:38     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+*** Running test: bn_min_max_smoothers.jnl
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed             @STD        standard deviation
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+ 
+auxiliary varible regridding transforms e.g.TEMP[GZ(depth)=zax at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @PLAVE      pc-wise linear ave
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.7S to 3.7N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+*** Running test: bn_vector_symbols.jnl
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+*** Running test: bn_variance_large.jnl
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+*** Running test: bn_labnum_calendar.jnl
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME1
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+*** Running test: bn665_bug_fixes.jnl
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME
+<axes>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+*** Running test: bn_floatstr.jnl
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+*** Running test: bn67_bug_fixes.jnl
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME)                 DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+*** Running test: bn_NaN_note.jnl
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+*** Running test: bn671_bug_fixes.jnl
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3662   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+*** Running test: bn68_bug_fixes.jnl
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G008)
+ name       axis              # pts   start                end
+ (AX001)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G008)
+ name       axis              # pts   start                end
+ (AX005)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+*** Running test: bn_ifv.jnl
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+*** Running test: bn_randu2_randn2.jnl
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+ 
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+ 
+can mode ver
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.366
+randu2_randn2       0.453
+randu2_randn2       0.168
+randu2_randn2       0.168
+randu2_randn2       0.625
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.289
+randu2_randn2       0.817
+randu2_randn2       0.329
+randu2_randn2       0.467
+randu2_randn2       0.632
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.221
+randu2_randn2       0.871
+randu2_randn2       0.518
+randu2_randn2       0.869
+randu2_randn2       0.823
+randu2_randn2       0.076
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.133
+randu2_randn2       0.307
+randu2_randn2       0.968
+randu2_randn2       0.061
+randu2_randn2       0.360
+randu2_randn2       0.176
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.503
+randu2_randn2      -0.100
+randu2_randn2      -0.195
+randu2_randn2      -0.083
+randu2_randn2       0.759
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2      -1.014
+randu2_randn2       0.051
+randu2_randn2       0.428
+randu2_randn2       2.756
+randu2_randn2      -0.107
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -1.086
+randu2_randn2       0.503
+randu2_randn2       0.481
+randu2_randn2      -2.318
+randu2_randn2       0.989
+randu2_randn2       0.355
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.942
+randu2_randn2       0.175
+randu2_randn2      -0.470
+randu2_randn2      -1.165
+randu2_randn2       0.158
+randu2_randn2      -0.485
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+randu2_randn2       1.054       1.700       1.034
+randu2_randn2       1.700       1.054       1.034
+randu2_randn2       1.034       1.034       0.471
+randu2_randn2       0.471       0.471       0.471
+randu2_randn2      -0.082      -0.082       0.471
+randu2_randn2      -0.226      -0.082       0.471
+randu2_randn2       0.015       0.015       0.471
+randu2_randn2       0.429       0.429       0.471
+*** Running test: bn_axis_cf.jnl
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+*** Running test: bn_repeated_coords.jnl
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+*** Running test: bn_xml_header.jnl
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+! Here's one where the dataset has a string variable
+ 
+can dat/all
+ 
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_numstring.jnl"
+use numstring
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out_string.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out_string.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out_string.xml" </data>
+ 
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
+<dimension>STRING1_7</dimension>
+<xaxis>XAX1_10</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+--
+<dimensions>
+<dimension name="STRING1_7">
+<attribute name="length" type="short">
+   <value>7</value>
+</attribute>
+</dimension>
+</dimensions>
+</data>
+*** Running test: bn_eof_simple.jnl
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1:  0.0000 -0.7071
+ 2   / 2: -0.7071  0.0000
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.000 -1.414
+ 0.25  /   2: -0.185 -1.402
+ 0.5   /   3: -0.366 -1.366
+ 0.75  /   4: -0.541 -1.307
+ 1     /   5: -0.707 -1.225
+ 1.25  /   6: -0.861 -1.122
+ 1.5   /   7: -1.000 -1.000
+ 1.75  /   8: -1.122 -0.861
+ 2     /   9: -1.225 -0.707
+ 2.25  /  10: -1.307 -0.541
+ 2.5   /  11: -1.366 -0.366
+ 2.75  /  12: -1.402 -0.185
+ 3     /  13: -1.414  0.000
+ 3.25  /  14: -1.402  0.185
+ 3.5   /  15: -1.366  0.366
+ 3.75  /  16: -1.307  0.541
+ 4     /  17: -1.225  0.707
+ 4.25  /  18: -1.122  0.861
+ 4.5   /  19: -1.000  1.000
+ 4.75  /  20: -0.861  1.122
+ 5     /  21: -0.707  1.225
+ 5.25  /  22: -0.541  1.307
+ 5.5   /  23: -0.366  1.366
+ 5.75  /  24: -0.185  1.402
+ 6     /  25:  0.000  1.414
+ 6.25  /  26:  0.185  1.402
+ 6.5   /  27:  0.366  1.366
+ 6.75  /  28:  0.541  1.307
+ 7     /  29:  0.707  1.225
+ 7.25  /  30:  0.861  1.122
+ 7.5   /  31:  1.000  1.000
+ 7.75  /  32:  1.122  0.861
+ 8     /  33:  1.225  0.707
+ 8.25  /  34:  1.307  0.541
+ 8.5   /  35:  1.366  0.366
+ 8.75  /  36:  1.402  0.185
+ 9     /  37:  1.414  0.000
+ 9.25  /  38:  1.402 -0.185
+ 9.5   /  39:  1.366 -0.366
+ 9.75  /  40:  1.307 -0.541
+ 10    /  41:  1.225 -0.707
+ 10.25 /  42:  1.122 -0.861
+ 10.5  /  43:  1.000 -1.000
+ 10.75 /  44:  0.861 -1.122
+ 11    /  45:  0.707 -1.225
+ 11.25 /  46:  0.541 -1.307
+ 11.5  /  47:  0.366 -1.366
+ 11.75 /  48:  0.185 -1.402
+ 12    /  49:  0.000 -1.414
+ 12.25 /  50: -0.185 -1.402
+ 12.5  /  51: -0.366 -1.366
+ 12.75 /  52: -0.541 -1.307
+ 13    /  53: -0.707 -1.225
+ 13.25 /  54: -0.861 -1.122
+ 13.5  /  55: -1.000 -1.000
+ 13.75 /  56: -1.122 -0.861
+ 14    /  57: -1.225 -0.707
+ 14.25 /  58: -1.307 -0.541
+ 14.5  /  59: -1.366 -0.366
+ 14.75 /  60: -1.402 -0.185
+ 15    /  61: -1.414  0.000
+ 15.25 /  62: -1.402  0.185
+ 15.5  /  63: -1.366  0.366
+ 15.75 /  64: -1.307  0.541
+ 16    /  65: -1.225  0.707
+ 16.25 /  66: -1.122  0.861
+ 16.5  /  67: -1.000  1.000
+ 16.75 /  68: -0.861  1.122
+ 17    /  69: -0.707  1.225
+ 17.25 /  70: -0.541  1.307
+ 17.5  /  71: -0.366  1.366
+ 17.75 /  72: -0.185  1.402
+ 18    /  73:  0.000  1.414
+ 18.25 /  74:  0.185  1.402
+ 18.5  /  75:  0.366  1.366
+ 18.75 /  76:  0.541  1.307
+ 19    /  77:  0.707  1.225
+ 19.25 /  78:  0.861  1.122
+ 19.5  /  79:  1.000  1.000
+ 19.75 /  80:  1.122  0.861
+ 20    /  81:  1.225  0.707
+ 20.25 /  82:  1.307  0.541
+ 20.5  /  83:  1.366  0.366
+ 20.75 /  84:  1.402  0.185
+ 21    /  85:  1.414  0.000
+ 21.25 /  86:  1.402 -0.185
+ 21.5  /  87:  1.366 -0.366
+ 21.75 /  88:  1.307 -0.541
+ 22    /  89:  1.225 -0.707
+ 22.25 /  90:  1.122 -0.861
+ 22.5  /  91:  1.000 -1.000
+ 22.75 /  92:  0.861 -1.122
+ 23    /  93:  0.707 -1.225
+ 23.25 /  94:  0.541 -1.307
+ 23.5  /  95:  0.366 -1.366
+ 23.75 /  96:  0.185 -1.402
+ 24    /  97:  0.000 -1.414
+ 24.25 /  98: -0.185 -1.402
+ 24.5  /  99: -0.366 -1.366
+ 24.75 / 100: -0.541 -1.307
+ 25    / 101: -0.707 -1.225
+ 25.25 / 102: -0.861 -1.122
+ 25.5  / 103: -1.000 -1.000
+ 25.75 / 104: -1.122 -0.861
+ 26    / 105: -1.225 -0.707
+ 26.25 / 106: -1.307 -0.541
+ 26.5  / 107: -1.366 -0.366
+ 26.75 / 108: -1.402 -0.185
+ 27    / 109: -1.414  0.000
+ 27.25 / 110: -1.402  0.185
+ 27.5  / 111: -1.366  0.366
+ 27.75 / 112: -1.307  0.541
+ 28    / 113: -1.225  0.707
+ 28.25 / 114: -1.122  0.861
+ 28.5  / 115: -1.000  1.000
+ 28.75 / 116: -0.861  1.122
+ 29    / 117: -0.707  1.225
+ 29.25 / 118: -0.541  1.307
+ 29.5  / 119: -0.366  1.366
+ 29.75 / 120: -0.185  1.402
+ 30    / 121:  0.000  1.414
+ 30.25 / 122:  0.185  1.402
+ 30.5  / 123:  0.366  1.366
+ 30.75 / 124:  0.541  1.307
+ 31    / 125:  0.707  1.225
+ 31.25 / 126:  0.861  1.122
+ 31.5  / 127:  1.000  1.000
+ 31.75 / 128:  1.122  0.861
+ 32    / 129:  1.225  0.707
+ 32.25 / 130:  1.307  0.541
+ 32.5  / 131:  1.366  0.366
+ 32.75 / 132:  1.402  0.185
+ 33    / 133:  1.414  0.000
+ 33.25 / 134:  1.402 -0.185
+ 33.5  / 135:  1.366 -0.366
+ 33.75 / 136:  1.307 -0.541
+ 34    / 137:  1.225 -0.707
+ 34.25 / 138:  1.122 -0.861
+ 34.5  / 139:  1.000 -1.000
+ 34.75 / 140:  0.861 -1.122
+ 35    / 141:  0.707 -1.225
+ 35.25 / 142:  0.541 -1.307
+ 35.5  / 143:  0.366 -1.366
+ 35.75 / 144:  0.185 -1.402
+ 36    / 145:  0.000 -1.414
+ 36.25 / 146: -0.185 -1.402
+ 36.5  / 147: -0.366 -1.366
+ 36.75 / 148: -0.541 -1.307
+ 37    / 149: -0.707 -1.225
+ 37.25 / 150: -0.861 -1.122
+ 37.5  / 151: -1.000 -1.000
+ 37.75 / 152: -1.122 -0.861
+ 38    / 153: -1.225 -0.707
+ 38.25 / 154: -1.307 -0.541
+ 38.5  / 155: -1.366 -0.366
+ 38.75 / 156: -1.402 -0.185
+ 39    / 157: -1.414  0.000
+ 39.25 / 158: -1.402  0.185
+ 39.5  / 159: -1.366  0.366
+ 39.75 / 160: -1.307  0.541
+ 40    / 161: -1.225  0.707
+ 40.25 / 162: -1.122  0.861
+ 40.5  / 163: -1.000  1.000
+ 40.75 / 164: -0.861  1.122
+ 41    / 165: -0.707  1.225
+ 41.25 / 166: -0.541  1.307
+ 41.5  / 167: -0.366  1.366
+ 41.75 / 168: -0.185  1.402
+ 42    / 169:  0.000  1.414
+ 42.25 / 170:  0.185  1.402
+ 42.5  / 171:  0.366  1.366
+ 42.75 / 172:  0.541  1.307
+ 43    / 173:  0.707  1.225
+ 43.25 / 174:  0.861  1.122
+ 43.5  / 175:  1.000  1.000
+ 43.75 / 176:  1.122  0.861
+ 44    / 177:  1.225  0.707
+ 44.25 / 178:  1.307  0.541
+ 44.5  / 179:  1.366  0.366
+ 44.75 / 180:  1.402  0.185
+ 45    / 181:  1.414  0.000
+ 45.25 / 182:  1.402 -0.185
+ 45.5  / 183:  1.366 -0.366
+ 45.75 / 184:  1.307 -0.541
+ 46    / 185:  1.225 -0.707
+ 46.25 / 186:  1.122 -0.861
+ 46.5  / 187:  1.000 -1.000
+ 46.75 / 188:  0.861 -1.122
+ 47    / 189:  0.707 -1.225
+ 47.25 / 190:  0.541 -1.307
+ 47.5  / 191:  0.366 -1.366
+ 47.75 / 192:  0.185 -1.402
+ 48    / 193:  0.000 -1.414
+ 48.25 / 194: -0.185 -1.402
+ 48.5  / 195: -0.366 -1.366
+ 48.75 / 196: -0.541 -1.307
+ 49    / 197: -0.707 -1.225
+ 49.25 / 198: -0.861 -1.122
+ 49.5  / 199: -1.000 -1.000
+ 49.75 / 200: -1.122 -0.861
+ 50    / 201: -1.225 -0.707
+ 50.25 / 202: -1.307 -0.541
+ 50.5  / 203: -1.366 -0.366
+ 50.75 / 204: -1.402 -0.185
+ 51    / 205: -1.414  0.000
+ 51.25 / 206: -1.402  0.185
+ 51.5  / 207: -1.366  0.366
+ 51.75 / 208: -1.307  0.541
+ 52    / 209: -1.225  0.707
+ 52.25 / 210: -1.122  0.861
+ 52.5  / 211: -1.000  1.000
+ 52.75 / 212: -0.861  1.122
+ 53    / 213: -0.707  1.225
+ 53.25 / 214: -0.541  1.307
+ 53.5  / 215: -0.366  1.366
+ 53.75 / 216: -0.185  1.402
+ 54    / 217:  0.000  1.414
+ 54.25 / 218:  0.185  1.402
+ 54.5  / 219:  0.366  1.366
+ 54.75 / 220:  0.541  1.307
+ 55    / 221:  0.707  1.225
+ 55.25 / 222:  0.861  1.122
+ 55.5  / 223:  1.000  1.000
+ 55.75 / 224:  1.122  0.861
+ 56    / 225:  1.225  0.707
+ 56.25 / 226:  1.307  0.541
+ 56.5  / 227:  1.366  0.366
+ 56.75 / 228:  1.402  0.185
+ 57    / 229:  1.414  0.000
+ 57.25 / 230:  1.402 -0.185
+ 57.5  / 231:  1.366 -0.366
+ 57.75 / 232:  1.307 -0.541
+ 58    / 233:  1.225 -0.707
+ 58.25 / 234:  1.122 -0.861
+ 58.5  / 235:  1.000 -1.000
+ 58.75 / 236:  0.861 -1.122
+ 59    / 237:  0.707 -1.225
+ 59.25 / 238:  0.541 -1.307
+ 59.5  / 239:  0.366 -1.366
+ 59.75 / 240:  0.185 -1.402
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0000 -0.7071    ....
+ 2   / 2: -0.7071  0.0000    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1:  0.000 -1.414   ....
+ 0.25  /   2: -0.185 -1.402   ....
+ 0.5   /   3: -0.366 -1.366   ....
+ 0.75  /   4: -0.541 -1.307   ....
+ 1     /   5: -0.707 -1.225   ....
+ 1.25  /   6: -0.861 -1.122   ....
+ 1.5   /   7: -1.000 -1.000   ....
+ 1.75  /   8: -1.122 -0.861   ....
+ 2     /   9: -1.225 -0.707   ....
+ 2.25  /  10: -1.307 -0.541   ....
+ 2.5   /  11: -1.366 -0.366   ....
+ 2.75  /  12: -1.402 -0.185   ....
+ 3     /  13: -1.414  0.000   ....
+ 3.25  /  14: -1.402  0.185   ....
+ 3.5   /  15: -1.366  0.366   ....
+ 3.75  /  16: -1.307  0.541   ....
+ 4     /  17: -1.225  0.707   ....
+ 4.25  /  18: -1.122  0.861   ....
+ 4.5   /  19: -1.000  1.000   ....
+ 4.75  /  20: -0.861  1.122   ....
+ 5     /  21: -0.707  1.225   ....
+ 5.25  /  22: -0.541  1.307   ....
+ 5.5   /  23: -0.366  1.366   ....
+ 5.75  /  24: -0.185  1.402   ....
+ 6     /  25:  0.000  1.414   ....
+ 6.25  /  26:  0.185  1.402   ....
+ 6.5   /  27:  0.366  1.366   ....
+ 6.75  /  28:  0.541  1.307   ....
+ 7     /  29:  0.707  1.225   ....
+ 7.25  /  30:  0.861  1.122   ....
+ 7.5   /  31:  1.000  1.000   ....
+ 7.75  /  32:  1.122  0.861   ....
+ 8     /  33:  1.225  0.707   ....
+ 8.25  /  34:  1.307  0.541   ....
+ 8.5   /  35:  1.366  0.366   ....
+ 8.75  /  36:  1.402  0.185   ....
+ 9     /  37:  1.414  0.000   ....
+ 9.25  /  38:  1.402 -0.185   ....
+ 9.5   /  39:  1.366 -0.366   ....
+ 9.75  /  40:  1.307 -0.541   ....
+ 10    /  41:  1.225 -0.707   ....
+ 10.25 /  42:  1.122 -0.861   ....
+ 10.5  /  43:  1.000 -1.000   ....
+ 10.75 /  44:  0.861 -1.122   ....
+ 11    /  45:  0.707 -1.225   ....
+ 11.25 /  46:  0.541 -1.307   ....
+ 11.5  /  47:  0.366 -1.366   ....
+ 11.75 /  48:  0.185 -1.402   ....
+ 12    /  49:  0.000 -1.414   ....
+ 12.25 /  50: -0.185 -1.402   ....
+ 12.5  /  51: -0.366 -1.366   ....
+ 12.75 /  52: -0.541 -1.307   ....
+ 13    /  53: -0.707 -1.225   ....
+ 13.25 /  54: -0.861 -1.122   ....
+ 13.5  /  55: -1.000 -1.000   ....
+ 13.75 /  56: -1.122 -0.861   ....
+ 14    /  57: -1.225 -0.707   ....
+ 14.25 /  58: -1.307 -0.541   ....
+ 14.5  /  59: -1.366 -0.366   ....
+ 14.75 /  60: -1.402 -0.185   ....
+ 15    /  61: -1.414  0.000   ....
+ 15.25 /  62: -1.402  0.185   ....
+ 15.5  /  63: -1.366  0.366   ....
+ 15.75 /  64: -1.307  0.541   ....
+ 16    /  65: -1.225  0.707   ....
+ 16.25 /  66: -1.122  0.861   ....
+ 16.5  /  67: -1.000  1.000   ....
+ 16.75 /  68: -0.861  1.122   ....
+ 17    /  69: -0.707  1.225   ....
+ 17.25 /  70: -0.541  1.307   ....
+ 17.5  /  71: -0.366  1.366   ....
+ 17.75 /  72: -0.185  1.402   ....
+ 18    /  73:  0.000  1.414   ....
+ 18.25 /  74:  0.185  1.402   ....
+ 18.5  /  75:  0.366  1.366   ....
+ 18.75 /  76:  0.541  1.307   ....
+ 19    /  77:  0.707  1.225   ....
+ 19.25 /  78:  0.861  1.122   ....
+ 19.5  /  79:  1.000  1.000   ....
+ 19.75 /  80:  1.122  0.861   ....
+ 20    /  81:  1.225  0.707   ....
+ 20.25 /  82:  1.307  0.541   ....
+ 20.5  /  83:  1.366  0.366   ....
+ 20.75 /  84:  1.402  0.185   ....
+ 21    /  85:  1.414  0.000   ....
+ 21.25 /  86:  1.402 -0.185   ....
+ 21.5  /  87:  1.366 -0.366   ....
+ 21.75 /  88:  1.307 -0.541   ....
+ 22    /  89:  1.225 -0.707   ....
+ 22.25 /  90:  1.122 -0.861   ....
+ 22.5  /  91:  1.000 -1.000   ....
+ 22.75 /  92:  0.861 -1.122   ....
+ 23    /  93:  0.707 -1.225   ....
+ 23.25 /  94:  0.541 -1.307   ....
+ 23.5  /  95:  0.366 -1.366   ....
+ 23.75 /  96:  0.185 -1.402   ....
+ 24    /  97:  0.000 -1.414   ....
+ 24.25 /  98: -0.185 -1.402   ....
+ 24.5  /  99: -0.366 -1.366   ....
+ 24.75 / 100: -0.541 -1.307   ....
+ 25    / 101: -0.707 -1.225   ....
+ 25.25 / 102: -0.861 -1.122   ....
+ 25.5  / 103: -1.000 -1.000   ....
+ 25.75 / 104: -1.122 -0.861   ....
+ 26    / 105: -1.225 -0.707   ....
+ 26.25 / 106: -1.307 -0.541   ....
+ 26.5  / 107: -1.366 -0.366   ....
+ 26.75 / 108: -1.402 -0.185   ....
+ 27    / 109: -1.414  0.000   ....
+ 27.25 / 110: -1.402  0.185   ....
+ 27.5  / 111: -1.366  0.366   ....
+ 27.75 / 112: -1.307  0.541   ....
+ 28    / 113: -1.225  0.707   ....
+ 28.25 / 114: -1.122  0.861   ....
+ 28.5  / 115: -1.000  1.000   ....
+ 28.75 / 116: -0.861  1.122   ....
+ 29    / 117: -0.707  1.225   ....
+ 29.25 / 118: -0.541  1.307   ....
+ 29.5  / 119: -0.366  1.366   ....
+ 29.75 / 120: -0.185  1.402   ....
+ 30    / 121:  0.000  1.414   ....
+ 30.25 / 122:  0.185  1.402   ....
+ 30.5  / 123:  0.366  1.366   ....
+ 30.75 / 124:  0.541  1.307   ....
+ 31    / 125:  0.707  1.225   ....
+ 31.25 / 126:  0.861  1.122   ....
+ 31.5  / 127:  1.000  1.000   ....
+ 31.75 / 128:  1.122  0.861   ....
+ 32    / 129:  1.225  0.707   ....
+ 32.25 / 130:  1.307  0.541   ....
+ 32.5  / 131:  1.366  0.366   ....
+ 32.75 / 132:  1.402  0.185   ....
+ 33    / 133:  1.414  0.000   ....
+ 33.25 / 134:  1.402 -0.185   ....
+ 33.5  / 135:  1.366 -0.366   ....
+ 33.75 / 136:  1.307 -0.541   ....
+ 34    / 137:  1.225 -0.707   ....
+ 34.25 / 138:  1.122 -0.861   ....
+ 34.5  / 139:  1.000 -1.000   ....
+ 34.75 / 140:  0.861 -1.122   ....
+ 35    / 141:  0.707 -1.225   ....
+ 35.25 / 142:  0.541 -1.307   ....
+ 35.5  / 143:  0.366 -1.366   ....
+ 35.75 / 144:  0.185 -1.402   ....
+ 36    / 145:  0.000 -1.414   ....
+ 36.25 / 146: -0.185 -1.402   ....
+ 36.5  / 147: -0.366 -1.366   ....
+ 36.75 / 148: -0.541 -1.307   ....
+ 37    / 149: -0.707 -1.225   ....
+ 37.25 / 150: -0.861 -1.122   ....
+ 37.5  / 151: -1.000 -1.000   ....
+ 37.75 / 152: -1.122 -0.861   ....
+ 38    / 153: -1.225 -0.707   ....
+ 38.25 / 154: -1.307 -0.541   ....
+ 38.5  / 155: -1.366 -0.366   ....
+ 38.75 / 156: -1.402 -0.185   ....
+ 39    / 157: -1.414  0.000   ....
+ 39.25 / 158: -1.402  0.185   ....
+ 39.5  / 159: -1.366  0.366   ....
+ 39.75 / 160: -1.307  0.541   ....
+ 40    / 161: -1.225  0.707   ....
+ 40.25 / 162: -1.122  0.861   ....
+ 40.5  / 163: -1.000  1.000   ....
+ 40.75 / 164: -0.861  1.122   ....
+ 41    / 165: -0.707  1.225   ....
+ 41.25 / 166: -0.541  1.307   ....
+ 41.5  / 167: -0.366  1.366   ....
+ 41.75 / 168: -0.185  1.402   ....
+ 42    / 169:  0.000  1.414   ....
+ 42.25 / 170:  0.185  1.402   ....
+ 42.5  / 171:  0.366  1.366   ....
+ 42.75 / 172:  0.541  1.307   ....
+ 43    / 173:  0.707  1.225   ....
+ 43.25 / 174:  0.861  1.122   ....
+ 43.5  / 175:  1.000  1.000   ....
+ 43.75 / 176:  1.122  0.861   ....
+ 44    / 177:  1.225  0.707   ....
+ 44.25 / 178:  1.307  0.541   ....
+ 44.5  / 179:  1.366  0.366   ....
+ 44.75 / 180:  1.402  0.185   ....
+ 45    / 181:  1.414  0.000   ....
+ 45.25 / 182:  1.402 -0.185   ....
+ 45.5  / 183:  1.366 -0.366   ....
+ 45.75 / 184:  1.307 -0.541   ....
+ 46    / 185:  1.225 -0.707   ....
+ 46.25 / 186:  1.122 -0.861   ....
+ 46.5  / 187:  1.000 -1.000   ....
+ 46.75 / 188:  0.861 -1.122   ....
+ 47    / 189:  0.707 -1.225   ....
+ 47.25 / 190:  0.541 -1.307   ....
+ 47.5  / 191:  0.366 -1.366   ....
+ 47.75 / 192:  0.185 -1.402   ....
+ 48    / 193:  0.000 -1.414   ....
+ 48.25 / 194: -0.185 -1.402   ....
+ 48.5  / 195: -0.366 -1.366   ....
+ 48.75 / 196: -0.541 -1.307   ....
+ 49    / 197: -0.707 -1.225   ....
+ 49.25 / 198: -0.861 -1.122   ....
+ 49.5  / 199: -1.000 -1.000   ....
+ 49.75 / 200: -1.122 -0.861   ....
+ 50    / 201: -1.225 -0.707   ....
+ 50.25 / 202: -1.307 -0.541   ....
+ 50.5  / 203: -1.366 -0.366   ....
+ 50.75 / 204: -1.402 -0.185   ....
+ 51    / 205: -1.414  0.000   ....
+ 51.25 / 206: -1.402  0.185   ....
+ 51.5  / 207: -1.366  0.366   ....
+ 51.75 / 208: -1.307  0.541   ....
+ 52    / 209: -1.225  0.707   ....
+ 52.25 / 210: -1.122  0.861   ....
+ 52.5  / 211: -1.000  1.000   ....
+ 52.75 / 212: -0.861  1.122   ....
+ 53    / 213: -0.707  1.225   ....
+ 53.25 / 214: -0.541  1.307   ....
+ 53.5  / 215: -0.366  1.366   ....
+ 53.75 / 216: -0.185  1.402   ....
+ 54    / 217:  0.000  1.414   ....
+ 54.25 / 218:  0.185  1.402   ....
+ 54.5  / 219:  0.366  1.366   ....
+ 54.75 / 220:  0.541  1.307   ....
+ 55    / 221:  0.707  1.225   ....
+ 55.25 / 222:  0.861  1.122   ....
+ 55.5  / 223:  1.000  1.000   ....
+ 55.75 / 224:  1.122  0.861   ....
+ 56    / 225:  1.225  0.707   ....
+ 56.25 / 226:  1.307  0.541   ....
+ 56.5  / 227:  1.366  0.366   ....
+ 56.75 / 228:  1.402  0.185   ....
+ 57    / 229:  1.414  0.000   ....
+ 57.25 / 230:  1.402 -0.185   ....
+ 57.5  / 231:  1.366 -0.366   ....
+ 57.75 / 232:  1.307 -0.541   ....
+ 58    / 233:  1.225 -0.707   ....
+ 58.25 / 234:  1.122 -0.861   ....
+ 58.5  / 235:  1.000 -1.000   ....
+ 58.75 / 236:  0.861 -1.122   ....
+ 59    / 237:  0.707 -1.225   ....
+ 59.25 / 238:  0.541 -1.307   ....
+ 59.5  / 239:  0.366 -1.366   ....
+ 59.75 / 240:  0.185 -1.402   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+*** Running test: bn_eof_simple2.jnl
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1:  0.0635 -0.3478
+ 2   / 2: -0.3478 -0.0635
+ ---- L:2 T:   2
+ 1   / 1:  0.3478  0.0635
+ 2   / 2:  0.0635 -0.3478
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.254  1.391
+ 0.1   /   2:  0.107  1.410
+ 0.2   /   3: -0.041  1.414
+ 0.3   /   4: -0.188  1.402
+ 0.4   /   5: -0.334  1.374
+ 0.5   /   6: -0.476  1.332
+ 0.6   /   7: -0.612  1.275
+ 0.7   /   8: -0.742  1.204
+ 0.8   /   9: -0.864  1.120
+ 0.9   /  10: -0.976  1.023
+ 1     /  11: -1.078  0.916
+ 1.1   /  12: -1.168  0.798
+ 1.2   /  13: -1.245  0.672
+ 1.3   /  14: -1.308  0.538
+ 1.4   /  15: -1.357  0.398
+ 1.5   /  16: -1.391  0.254
+ 1.6   /  17: -1.410  0.107
+ 1.7   /  18: -1.414 -0.041
+ 1.8   /  19: -1.402 -0.188
+ 1.9   /  20: -1.374 -0.334
+ 2     /  21: -1.332 -0.476
+ 2.1   /  22: -1.275 -0.612
+ 2.2   /  23: -1.204 -0.742
+ 2.3   /  24: -1.120 -0.864
+ 2.4   /  25: -1.023 -0.976
+ 2.5   /  26: -0.916 -1.078
+ 2.6   /  27: -0.798 -1.168
+ 2.7   /  28: -0.672 -1.245
+ 2.8   /  29: -0.538 -1.308
+ 2.9   /  30: -0.398 -1.357
+ 3     /  31: -0.254 -1.391
+ 3.1   /  32: -0.107 -1.410
+ 3.2   /  33:  0.041 -1.414
+ 3.3   /  34:  0.188 -1.402
+ 3.4   /  35:  0.334 -1.374
+ 3.5   /  36:  0.476 -1.332
+ 3.6   /  37:  0.612 -1.275
+ 3.7   /  38:  0.742 -1.204
+ 3.8   /  39:  0.864 -1.120
+ 3.9   /  40:  0.976 -1.023
+ 4     /  41:  1.078 -0.916
+ 4.1   /  42:  1.168 -0.798
+ 4.2   /  43:  1.245 -0.672
+ 4.3   /  44:  1.308 -0.538
+ 4.4   /  45:  1.357 -0.398
+ 4.5   /  46:  1.391 -0.254
+ 4.6   /  47:  1.410 -0.107
+ 4.7   /  48:  1.414  0.041
+ 4.8   /  49:  1.402  0.188
+ 4.9   /  50:  1.374  0.334
+ 5     /  51:  1.332  0.476
+ 5.1   /  52:  1.275  0.612
+ 5.2   /  53:  1.204  0.742
+ 5.3   /  54:  1.120  0.864
+ 5.4   /  55:  1.023  0.976
+ 5.5   /  56:  0.916  1.078
+ 5.6   /  57:  0.798  1.168
+ 5.7   /  58:  0.672  1.245
+ 5.8   /  59:  0.538  1.308
+ 5.9   /  60:  0.398  1.357
+ 6     /  61:  0.254  1.391
+ 6.1   /  62:  0.107  1.410
+ 6.2   /  63: -0.041  1.414
+ 6.3   /  64: -0.188  1.402
+ 6.4   /  65: -0.334  1.374
+ 6.5   /  66: -0.476  1.332
+ 6.6   /  67: -0.612  1.275
+ 6.7   /  68: -0.742  1.204
+ 6.8   /  69: -0.864  1.120
+ 6.9   /  70: -0.976  1.023
+ 7     /  71: -1.078  0.916
+ 7.1   /  72: -1.168  0.798
+ 7.2   /  73: -1.245  0.672
+ 7.3   /  74: -1.308  0.538
+ 7.4   /  75: -1.357  0.398
+ 7.5   /  76: -1.391  0.254
+ 7.6   /  77: -1.410  0.107
+ 7.7   /  78: -1.414 -0.041
+ 7.8   /  79: -1.402 -0.188
+ 7.9   /  80: -1.374 -0.334
+ 8     /  81: -1.332 -0.476
+ 8.1   /  82: -1.275 -0.612
+ 8.2   /  83: -1.204 -0.742
+ 8.3   /  84: -1.120 -0.864
+ 8.4   /  85: -1.023 -0.976
+ 8.5   /  86: -0.916 -1.078
+ 8.6   /  87: -0.798 -1.168
+ 8.7   /  88: -0.672 -1.245
+ 8.8   /  89: -0.538 -1.308
+ 8.9   /  90: -0.398 -1.357
+ 9     /  91: -0.254 -1.391
+ 9.1   /  92: -0.107 -1.410
+ 9.2   /  93:  0.041 -1.414
+ 9.3   /  94:  0.188 -1.402
+ 9.4   /  95:  0.334 -1.374
+ 9.5   /  96:  0.476 -1.332
+ 9.6   /  97:  0.612 -1.275
+ 9.7   /  98:  0.742 -1.204
+ 9.8   /  99:  0.864 -1.120
+ 9.9   / 100:  0.976 -1.023
+ 10    / 101:  1.078 -0.916
+ 10.1  / 102:  1.168 -0.798
+ 10.2  / 103:  1.245 -0.672
+ 10.3  / 104:  1.308 -0.538
+ 10.4  / 105:  1.357 -0.398
+ 10.5  / 106:  1.391 -0.254
+ 10.6  / 107:  1.410 -0.107
+ 10.7  / 108:  1.414  0.041
+ 10.8  / 109:  1.402  0.188
+ 10.9  / 110:  1.374  0.334
+ 11    / 111:  1.332  0.476
+ 11.1  / 112:  1.275  0.612
+ 11.2  / 113:  1.204  0.742
+ 11.3  / 114:  1.120  0.864
+ 11.4  / 115:  1.023  0.976
+ 11.5  / 116:  0.916  1.078
+ 11.6  / 117:  0.798  1.168
+ 11.7  / 118:  0.672  1.245
+ 11.8  / 119:  0.538  1.308
+ 11.9  / 120:  0.398  1.357
+ 12    / 121:  0.254  1.391
+ 12.1  / 122:  0.107  1.410
+ 12.2  / 123: -0.041  1.414
+ 12.3  / 124: -0.188  1.402
+ 12.4  / 125: -0.334  1.374
+ 12.5  / 126: -0.476  1.332
+ 12.6  / 127: -0.612  1.275
+ 12.7  / 128: -0.742  1.204
+ 12.8  / 129: -0.864  1.120
+ 12.9  / 130: -0.976  1.023
+ 13    / 131: -1.078  0.916
+ 13.1  / 132: -1.168  0.798
+ 13.2  / 133: -1.245  0.672
+ 13.3  / 134: -1.308  0.538
+ 13.4  / 135: -1.357  0.398
+ 13.5  / 136: -1.391  0.254
+ 13.6  / 137: -1.410  0.107
+ 13.7  / 138: -1.414 -0.041
+ 13.8  / 139: -1.402 -0.188
+ 13.9  / 140: -1.374 -0.334
+ 14    / 141: -1.332 -0.476
+ 14.1  / 142: -1.275 -0.612
+ 14.2  / 143: -1.204 -0.742
+ 14.3  / 144: -1.120 -0.864
+ 14.4  / 145: -1.023 -0.976
+ 14.5  / 146: -0.916 -1.078
+ 14.6  / 147: -0.798 -1.168
+ 14.7  / 148: -0.672 -1.245
+ 14.8  / 149: -0.538 -1.308
+ 14.9  / 150: -0.398 -1.357
+ 15    / 151: -0.254 -1.391
+ 15.1  / 152: -0.107 -1.410
+ 15.2  / 153:  0.041 -1.414
+ 15.3  / 154:  0.188 -1.402
+ 15.4  / 155:  0.334 -1.374
+ 15.5  / 156:  0.476 -1.332
+ 15.6  / 157:  0.612 -1.275
+ 15.7  / 158:  0.742 -1.204
+ 15.8  / 159:  0.864 -1.120
+ 15.9  / 160:  0.976 -1.023
+ 16    / 161:  1.078 -0.916
+ 16.1  / 162:  1.168 -0.798
+ 16.2  / 163:  1.245 -0.672
+ 16.3  / 164:  1.308 -0.538
+ 16.4  / 165:  1.357 -0.398
+ 16.5  / 166:  1.391 -0.254
+ 16.6  / 167:  1.410 -0.107
+ 16.7  / 168:  1.414  0.041
+ 16.8  / 169:  1.402  0.188
+ 16.9  / 170:  1.374  0.334
+ 17    / 171:  1.332  0.476
+ 17.1  / 172:  1.275  0.612
+ 17.2  / 173:  1.204  0.742
+ 17.3  / 174:  1.120  0.864
+ 17.4  / 175:  1.023  0.976
+ 17.5  / 176:  0.916  1.078
+ 17.6  / 177:  0.798  1.168
+ 17.7  / 178:  0.672  1.245
+ 17.8  / 179:  0.538  1.308
+ 17.9  / 180:  0.398  1.357
+ 18    / 181:  0.254  1.391
+ 18.1  / 182:  0.107  1.410
+ 18.2  / 183: -0.041  1.414
+ 18.3  / 184: -0.188  1.402
+ 18.4  / 185: -0.334  1.374
+ 18.5  / 186: -0.476  1.332
+ 18.6  / 187: -0.612  1.275
+ 18.7  / 188: -0.742  1.204
+ 18.8  / 189: -0.864  1.120
+ 18.9  / 190: -0.976  1.023
+ 19    / 191: -1.078  0.916
+ 19.1  / 192: -1.168  0.798
+ 19.2  / 193: -1.245  0.672
+ 19.3  / 194: -1.308  0.538
+ 19.4  / 195: -1.357  0.398
+ 19.5  / 196: -1.391  0.254
+ 19.6  / 197: -1.410  0.107
+ 19.7  / 198: -1.414 -0.041
+ 19.8  / 199: -1.402 -0.188
+ 19.9  / 200: -1.374 -0.334
+ 20    / 201: -1.332 -0.476
+ 20.1  / 202: -1.275 -0.612
+ 20.2  / 203: -1.204 -0.742
+ 20.3  / 204: -1.120 -0.864
+ 20.4  / 205: -1.023 -0.976
+ 20.5  / 206: -0.916 -1.078
+ 20.6  / 207: -0.798 -1.168
+ 20.7  / 208: -0.672 -1.245
+ 20.8  / 209: -0.538 -1.308
+ 20.9  / 210: -0.398 -1.357
+ 21    / 211: -0.254 -1.391
+ 21.1  / 212: -0.107 -1.410
+ 21.2  / 213:  0.041 -1.414
+ 21.3  / 214:  0.188 -1.402
+ 21.4  / 215:  0.334 -1.374
+ 21.5  / 216:  0.476 -1.332
+ 21.6  / 217:  0.612 -1.275
+ 21.7  / 218:  0.742 -1.204
+ 21.8  / 219:  0.864 -1.120
+ 21.9  / 220:  0.976 -1.023
+ 22    / 221:  1.078 -0.916
+ 22.1  / 222:  1.168 -0.798
+ 22.2  / 223:  1.245 -0.672
+ 22.3  / 224:  1.308 -0.538
+ 22.4  / 225:  1.357 -0.398
+ 22.5  / 226:  1.391 -0.254
+ 22.6  / 227:  1.410 -0.107
+ 22.7  / 228:  1.414  0.041
+ 22.8  / 229:  1.402  0.188
+ 22.9  / 230:  1.374  0.334
+ 23    / 231:  1.332  0.476
+ 23.1  / 232:  1.275  0.612
+ 23.2  / 233:  1.204  0.742
+ 23.3  / 234:  1.120  0.864
+ 23.4  / 235:  1.023  0.976
+ 23.5  / 236:  0.916  1.078
+ 23.6  / 237:  0.798  1.168
+ 23.7  / 238:  0.672  1.245
+ 23.8  / 239:  0.538  1.308
+ 23.9  / 240:  0.398  1.357
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+*** Running test: bn_interpolate_6d.jnl
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+*** Running test: bn_regrid_6d.jnl
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+             4      6      8    
+             2      3      4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- M:3 E:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- M:4 E:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- M:3 E:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- M:4 E:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- M:3 E:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- M:4 E:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+             5      7      9    
+             3      4      5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- M:4 E:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- M:5 E:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- M:4 E:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- M:5 E:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- M:4 E:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- M:5 E:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+             25.5   35.5   45.5   55.5   65.5   75.5  
+              3      4      5      6      7      8
+ 25.5 / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+ 35.5 / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 45.5 / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 55.5 / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 65.5 / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 75.5 / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      101.0  101.0
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+              25.5E  35.5E  45.5E  55.5E  65.5E  75.5E 
+               3      4      5      6      7      8
+ 75.5N / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+ 65.5N / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 55.5N / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 45.5N / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 35.5N / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 25.5N / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      94.71  94.53
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.
+ 02-JAN-1980 00 / 2:  87672.
+ 03-JAN-1980 00 / 3:  87696.
+ 04-JAN-1980 00 / 4:  87720.
+ 05-JAN-1980 00 / 5:  87744.
+ 06-JAN-1980 00 / 6:  87768.
+ 07-JAN-1980 00 / 7:  87792.
+ 08-JAN-1980 00 / 8:  87816.
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.
+ 03-JAN-1980 00 / 2:  87696.
+ 05-JAN-1980 00 / 3:  87744.
+ 07-JAN-1980 00 / 4:  87792.
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+*** Running test: bn_syntax_6d.jnl
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.2N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+               6.17N 
+               50
+ 160.5W / 1:  3.700
+ 159.5W / 2:  3.700
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.8N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.000
+*** Running test: bn_expressions_6d.jnl
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+            1       2       3       4       5     
+             1       2       3       4       5
+ ---- N:1 F:   1
+ N:1 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:2 F:   2
+ N:2 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:3 F:   3
+ N:3 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:4 F:   4
+ N:4 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:5 F:   5
+ N:5 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+        EBOXLO  EBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+        FBOXLO  FBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+*** Running test: bn_direction_fcns_6d.jnl
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+             C  M_INDEX  EX#3
+1   / 1:  5.000   3.000  3.000
+2   / 2:  4.000   2.000  4.000
+3   / 3:  3.000   1.000  5.000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1  M_INDEX EX#3
+1   / 1: "q"   2.000 "0"
+2   / 2: "0"   3.000 "c"
+3   / 3: "c"   1.000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+             C  N_INDEX  EX#3
+1   / 1:  5.000   3.000  3.000
+2   / 2:  4.000   2.000  4.000
+3   / 3:  3.000   1.000  5.000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1  N_INDEX EX#3
+1   / 1: "q"   2.000 "0"
+2   / 2: "0"   3.000 "c"
+3   / 3: "c"   1.000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+        TEMP   EX#2
+M / 1:  30.75  34.75
+M / 2:  31.75  33.75
+M / 3:  32.75  32.75
+M / 4:  33.75  31.75
+M / 5:  34.75  30.75
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+        TEMP   EX#2
+N / 1:  30.75  31.35
+N / 2:  30.95  31.15
+N / 3:  31.15  30.95
+N / 4:  31.35  30.75
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+               A     A      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+               B     B      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000   ....  1.000  0.000   ....  0.000
+ 2   / 2:   ....   ....   ....   ....   ....   ....   ....   ....
+ 3   / 3:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000  1.000  0.000  0.000   ....   ....
+ 2   / 2:   ....   ....   ....   ....   ....   ....   ....   ....
+ 3   / 3:  1.000  2.000  2.000  2.000  1.000  1.000   ....   ....
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:  1.000  2.000  2.000  2.000  1.000  1.000   ....   ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000   ....  1.000  0.000   ....  0.000
+ 2   / 2:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 3   / 3:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:   ....   ....   ....   ....   ....   ....   ....   ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+            101    102   
+           101    102
+ 1   / 1:  1.000  1.000
+ 2   / 2:   ....   ....
+ 3   / 3:  1.000  1.000
+ 4   / 4:   ....   ....
+ 5   / 5:  1.000  1.000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+            101    102   
+           101    102
+ 1   / 1:  10.00  10.00
+ 2   / 2:  30.00  30.00
+ 3   / 3:  50.00  50.00
+ 4   / 4:   ....   ....
+ 5   / 5:   ....   ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+            101    102   
+           101    102
+ 1   / 1:  1.000  1.000
+ 2   / 2:   ....   ....
+ 3   / 3:  1.000  1.000
+ 4   / 4:   ....   ....
+ 5   / 5:  1.000  1.000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+            101    102   
+           101    102
+ 1   / 1:  10.00  10.00
+ 2   / 2:  30.00  30.00
+ 3   / 3:  50.00  50.00
+ 4   / 4:   ....   ....
+ 5   / 5:   ....   ....
+*** Running test: bn_regrid_transforms_6d.jnl
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  2 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 16:00
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  2 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 16:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.35  32.37  32.56  32.97  33.45
+ 1.17N / 45:  32.17  32.19  32.33  32.69  33.14
+ 0.83N / 44:  32.02  32.01  32.10  32.39  32.79
+ 0.5N  / 43:  31.93  31.90  31.91  32.09  32.43
+ 0.17N / 42:  31.89  31.84  31.79  31.86  32.10
+ 0.17S / 41:  31.95  31.86  31.77  31.74  31.87
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.35  38.37  38.56  38.97  39.45
+ 1.17N / 45:  38.17  38.19  38.33  38.69  39.14
+ 0.83N / 44:  38.02  38.01  38.10  38.39  38.79
+ 0.5N  / 43:  37.93  37.90  37.91  38.09  38.43
+ 0.17N / 42:  37.89  37.84  37.79  37.86  38.10
+ 0.17S / 41:  37.95  37.86  37.77  37.74  37.87
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.75  37.77  37.96  38.37  38.85
+ 1.17N / 45:  37.57  37.59  37.73  38.09  38.54
+ 0.83N / 44:  37.42  37.41  37.50  37.79  38.19
+ 0.5N  / 43:  37.33  37.30  37.31  37.49  37.83
+ 0.17N / 42:  37.29  37.24  37.19  37.26  37.50
+ 0.17S / 41:  37.35  37.26  37.17  37.14  37.27
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.75  43.77  43.96  44.37  44.85
+ 1.17N / 45:  43.57  43.59  43.73  44.09  44.54
+ 0.83N / 44:  43.42  43.41  43.50  43.79  44.19
+ 0.5N  / 43:  43.33  43.30  43.31  43.49  43.83
+ 0.17N / 42:  43.29  43.24  43.19  43.26  43.50
+ 0.17S / 41:  43.35  43.26  43.17  43.14  43.27
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 16:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.35  34.37  34.56  34.97  35.45
+ 1.17N / 45:  34.17  34.19  34.33  34.69  35.14
+ 0.83N / 44:  34.02  34.01  34.10  34.39  34.79
+ 0.5N  / 43:  33.93  33.90  33.91  34.09  34.43
+ 0.17N / 42:  33.89  33.84  33.79  33.86  34.10
+ 0.17S / 41:  33.95  33.86  33.77  33.74  33.87
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.35  40.37  40.56  40.97  41.45
+ 1.17N / 45:  40.17  40.19  40.33  40.69  41.14
+ 0.83N / 44:  40.02  40.01  40.10  40.39  40.79
+ 0.5N  / 43:  39.93  39.90  39.91  40.09  40.43
+ 0.17N / 42:  39.89  39.84  39.79  39.86  40.10
+ 0.17S / 41:  39.95  39.86  39.77  39.74  39.87
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.01  36.04  36.23  36.64  37.12
+ 1.17N / 45:  35.84  35.85  36.00  36.36  36.80
+ 0.83N / 44:  35.69  35.68  35.77  36.06  36.45
+ 0.5N  / 43:  35.59  35.56  35.58  35.76  36.09
+ 0.17N / 42:  35.56  35.50  35.46  35.53  35.76
+ 0.17S / 41:  35.62  35.53  35.44  35.41  35.53
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.01  42.04  42.23  42.64  43.12
+ 1.17N / 45:  41.84  41.85  42.00  42.36  42.80
+ 0.83N / 44:  41.69  41.68  41.77  42.06  42.45
+ 0.5N  / 43:  41.59  41.56  41.58  41.76  42.09
+ 0.17N / 42:  41.56  41.50  41.46  41.53  41.76
+ 0.17S / 41:  41.62  41.53  41.44  41.41  41.53
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ reading TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 4    complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 11 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 8    complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1     2.1   
+                          1       2
+ 15-JAN-1982 00 /  1:    ....    ....
+ 19-JAN-1982 00 /  2:    ....  29594.
+ 23-JAN-1982 00 /  3:    ....  29594.
+ 27-JAN-1982 00 /  4:    ....    ....
+ 31-JAN-1982 00 /  5:    ....    ....
+ 04-FEB-1982 00 /  6:    ....    ....
+ 08-FEB-1982 00 /  7:    ....    ....
+ 12-FEB-1982 00 /  8:    ....    ....
+ 16-FEB-1982 00 /  9:    ....    ....
+ 20-FEB-1982 00 / 10:    ....    ....
+ 24-FEB-1982 00 / 11:    ....    ....
+ 28-FEB-1982 00 / 12:    ....    ....
+ 04-MAR-1982 00 / 13:    ....    ....
+ 08-MAR-1982 00 / 14:    ....    ....
+ 12-MAR-1982 00 / 15:    ....    ....
+ 16-MAR-1982 00 / 16:    ....    ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ found   A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1    2.1  
+                         1      2
+ 15-JAN-1982 00 /  1:   ....   ....
+ 19-JAN-1982 00 /  2:   ....  8878.
+ 23-JAN-1982 00 /  3:   ....  8878.
+ 27-JAN-1982 00 /  4:   ....   ....
+ 31-JAN-1982 00 /  5:   ....   ....
+ 04-FEB-1982 00 /  6:   ....   ....
+ 08-FEB-1982 00 /  7:   ....   ....
+ 12-FEB-1982 00 /  8:   ....   ....
+ 16-FEB-1982 00 /  9:   ....   ....
+ 20-FEB-1982 00 / 10:   ....   ....
+ 24-FEB-1982 00 / 11:   ....   ....
+ 28-FEB-1982 00 / 12:   ....   ....
+ 04-MAR-1982 00 / 13:   ....   ....
+ 08-MAR-1982 00 / 14:   ....   ....
+ 12-MAR-1982 00 / 15:   ....   ....
+ 16-MAR-1982 00 / 16:   ....   ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ found   A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ found   A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:  2.131E+05  3.551E+05
+ 23-JAN-1982 00 /  3:  2.003E+07  3.338E+07
+ 27-JAN-1982 00 /  4:  2.131E+05  3.551E+05
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ found   A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1     2.1   
+                          1       2
+ 15-JAN-1982 00 /  1:    ....    ....
+ 19-JAN-1982 00 /  2:    ....    ....
+ 23-JAN-1982 00 /  3:    ....  0.0000
+ 27-JAN-1982 00 /  4:    ....    ....
+ 31-JAN-1982 00 /  5:    ....    ....
+ 04-FEB-1982 00 /  6:    ....    ....
+ 08-FEB-1982 00 /  7:    ....    ....
+ 12-FEB-1982 00 /  8:    ....    ....
+ 16-FEB-1982 00 /  9:    ....    ....
+ 20-FEB-1982 00 / 10:    ....    ....
+ 24-FEB-1982 00 / 11:    ....    ....
+ 28-FEB-1982 00 / 12:    ....    ....
+ 04-MAR-1982 00 / 13:    ....    ....
+ 08-MAR-1982 00 / 14:    ....    ....
+ 12-MAR-1982 00 / 15:    ....    ....
+ 16-MAR-1982 00 / 16:    ....    ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G003)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:   ....
+ 2.1 / 2:  2.500
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G004)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.500
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.500
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @MIN
+ found   A4       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @SUM
+ found   A4       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.050
+ 2.1 / 2:  4.200
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G006)           @MAX
+ found   AFCST    M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ regrid  AFCST    M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+*** Running test: bn_aggregate_e.jnl
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M:  1 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M:  3 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M:  4 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M:  5 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+            13N    15N    17N    19N    21N    23N    25N    27N    29N   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:   28.5   28.4   27.9   27.5   26.7   25.6   ....   ....   ....
+ 2   / 2:   85.5   85.3   83.7   82.4   80.2   76.7   ....   ....   ....
+ 3   / 3:   57.0   56.9   55.8   54.9   53.5   51.1   ....   ....   ....
+ 4   / 4:  114.1  113.8  111.6  109.8  106.9  102.2   ....   ....   ....
+cancel data fourfiles
+ -DELETE SST      M:  2 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M:  6 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G006)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ getgrid AIRT     C:  5 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M:  6 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:  7 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:  8 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 10 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+            13N    15N    17N    19N    21N    23N    25N    27N    29N   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:   27.7   27.6   27.1   26.7   25.8   25.2   ....   ....   ....
+ 2   / 2:   86.5   86.3   84.7   83.4   81.2   77.7   ....   ....   ....
+ 3   / 3:   58.0   57.9   56.8   55.9   54.5   52.1   ....   ....   ....
+ 4   / 4:  115.1  114.8  112.6  110.8  107.9  103.2   ....   ....   ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 29N
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+               UWND    UWND   UWND    VWND    UWND
+59W    / -30:  1.643  0.2317  1.643  0.2317  0.9371
+57W    / -29:  1.404  0.1102  1.404  0.1102  0.7573
+55W    / -28:  1.353 -0.0184  1.353 -0.0184  0.6674
+53W    / -27:  1.210 -0.1624  1.210 -0.1624  0.5237
+51W    / -26:  1.086 -0.3088  1.086 -0.3088  0.3887
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 29N
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+               UWND    UWND    VWND   UWND    VWND
+59W    / -30:  1.643  0.2317  0.2317  1.643  0.9371
+57W    / -29:  1.404  0.1102  0.1102  1.404  0.7573
+55W    / -28:  1.353 -0.0184 -0.0184  1.353  0.6674
+53W    / -27:  1.210 -0.1624 -0.1624  1.210  0.5237
+51W    / -26:  1.086 -0.3088 -0.3088  1.086  0.3887
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+*** Running test: bn_6d_lab_mode.jnl
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.7S to 3.7N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.7S to 3.7N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=28.8S:51.4N at AV4,D=1]
+ reading TAUX     M:  2 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.2742
+ 23-AUG-1982 14 / 2: -0.2363
+ 29-AUG-1982 16 / 3: -0.1984
+ 04-SEP-1982 18 / 4: -0.1605
+ 10-SEP-1982 20 / 5: -0.1227
+ 16-SEP-1982 22 / 6: -0.1041
+ 23-SEP-1982 00 / 7: -0.1047
+ 29-SEP-1982 02 / 8: -0.1054
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=28.8S:51.4N at SM4,D=1]
+ found   TAUX     M:  2 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.6
+ 23-AUG-1982 14 / 2:  -89.3
+ 29-AUG-1982 16 / 3:  -75.0
+ 04-SEP-1982 18 / 4:  -60.7
+ 10-SEP-1982 20 / 5:  -46.4
+ 16-SEP-1982 22 / 6:  -39.3
+ 23-SEP-1982 00 / 7:  -39.6
+ 29-SEP-1982 02 / 8:  -39.8
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+*** Running test: bn682_bug_fixes.jnl
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+*** Running test: bn683_bug_fixes.jnl
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.6251
+ 02-NOV-2011 07:55:36 /  2:  0.2209
+ 02-NOV-2011 07:56:36 /  3:  0.6074
+ 02-NOV-2011 07:57:36 /  4:  0.3226
+ 02-NOV-2011 07:58:36 /  5:  0.1075
+ 02-NOV-2011 07:59:36 /  6:  0.2257
+ 02-NOV-2011 08:00:36 /  7:  0.0811
+ 02-NOV-2011 08:01:36 /  8:  0.8980
+ 02-NOV-2011 08:02:36 /  9:  0.7163
+ 02-NOV-2011 08:03:36 / 10:  0.6649
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:    ....
+ 02-NOV-2011 07:54:31 / 114872:    ....
+ 02-NOV-2011 07:54:32 / 114873:    ....
+ 02-NOV-2011 07:54:33 / 114874:    ....
+ 02-NOV-2011 07:54:34 / 114875:    ....
+ 02-NOV-2011 07:54:35 / 114876:    ....
+ 02-NOV-2011 07:54:36 / 114877:  0.6251
+ 02-NOV-2011 07:54:37 / 114878:    ....
+ 02-NOV-2011 07:54:38 / 114879:    ....
+ 02-NOV-2011 07:54:39 / 114880:    ....
+ 02-NOV-2011 07:54:40 / 114881:    ....
+ 02-NOV-2011 07:54:41 / 114882:    ....
+ 02-NOV-2011 07:54:42 / 114883:    ....
+ 02-NOV-2011 07:54:43 / 114884:    ....
+ 02-NOV-2011 07:54:44 / 114885:    ....
+ 02-NOV-2011 07:54:45 / 114886:    ....
+ 02-NOV-2011 07:54:46 / 114887:    ....
+ 02-NOV-2011 07:54:47 / 114888:    ....
+ 02-NOV-2011 07:54:48 / 114889:    ....
+ 02-NOV-2011 07:54:49 / 114890:    ....
+ 02-NOV-2011 07:54:50 / 114891:    ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.632
+ 15-FEB-1960 12 / 122:  1.901
+ 16-MAR-1960 12 / 123:  2.000
+ 16-APR-1960 00 / 124:  1.917
+ 16-MAY-1960 12 / 125:  1.658
+ 16-JUN-1960 00 / 126:  1.246
+ 16-JUL-1960 12 / 127:  0.718
+ 16-AUG-1960 12 / 128:  0.114
+ 16-SEP-1960 00 / 129: -0.490
+ 16-OCT-1960 12 / 130: -1.050
+ 16-NOV-1960 00 / 131: -1.513
+ 16-DEC-1960 12 / 132: -1.836
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.632
+ 15-FEB-1960 12 / 122:  1.901
+ 16-MAR-1960 12 / 123:  2.000
+ 16-APR-1960 00 / 124:  1.917
+ 16-MAY-1960 12 / 125:  1.658
+ 16-JUN-1960 00 / 126:  1.246
+ 16-JUL-1960 12 / 127:  0.718
+ 16-AUG-1960 12 / 128:  0.114
+ 16-SEP-1960 00 / 129: -0.490
+ 16-OCT-1960 12 / 130: -1.050
+ 16-NOV-1960 00 / 131: -1.513
+ 16-DEC-1960 12 / 132: -1.836
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E
+                        1
+ 01-JAN-1994 12 / 1:  28.69
+ 02-JAN-1994 12 / 2:  28.63
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E
+                        1
+ 01-JAN-1994 12 / 1:  28.69
+ 02-JAN-1994 12 / 2:  28.63
+ 
+set mode/last upcase_output
+*** Running test: bn_outtype.jnl
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+*** Running test: bn_ribbon_plot.jnl
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+*** Running test: bn_descr_4digit.jnl
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                     2
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+*** Running test: bn_axis_outtype.jnl
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        FLOAT     units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          FLOAT       1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME1)                FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        FLOAT     units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          FLOAT       1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME1)                FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+*** Running test: bn_axis_nonmonotonic.jnl
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+*** Running test: bn_vec_mod.jnl
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+*** Running test: bn685_bug_fixes.jnl
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double E410(TIME) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float E410(TIME) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[longitude]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[longitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[lon]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+*** Running test: bn_dsg_e_x.jnl
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_nco_append.jnl
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_nobounds.jnl
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:units = "meters" ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:units = "meters" ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+*** Running test: bn_write_integer_att.jnl
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+*** Running test: bn_descriptor_mc.jnl
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-0000 / 1:  28.20
+ 15-FEB-0000 / 2:  28.36
+ 17-MAR-0000 / 3:  28.35
+ 16-APR-0000 / 4:  28.22
+ 16-MAY-0000 / 5:  28.49
+ 16-JUN-0000 / 6:  28.32
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 61W
+             LATITUDE : 9N
+                    61W   
+                   140
+ 17-MAR-0000 / 1:  26.58
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.22
+ 16-JUN-0000 / 4:  27.66
+*** Running test: bn_plot_color_only.jnl
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+*** Running test: bn_vtree.jnl
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+*** Running test: bn686_bug_fixes.jnl
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ribbon_by_val
+! err685_ribbon_by_val.jnl
+! 11/21/2013
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+ 
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ppl_palette
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+ 
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+ 
+pal  bluescale.spk
+use levitus_climatology; shade/k=1 temp
+ 
+pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+ 
+pal   default
+pattern   solid
+ 
+fill sst[l=@ave]
+pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+ 
+! restore defaults
+palette default
+pattern solid
+ 
+GO bn_reset
+cancel mode verify
+GO err685_show_grid_e
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+ 
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+sh grid /e gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       M     E                   EBOX      EBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+      11>  11                    1          10.5
+      12>  12                    1          11.5
+sh grid /f gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       N     F                   FBOX      FBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_lowercaseAxis
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+ 
+use lowercaseTime.nc
+sh dat
+     currently SET data sets:
+    1> ./lowercaseTime.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AA                                        ...       ...       ...       1:15      ...       ...
+ BB                                        ...       ...       ...       1:8       ...       ...
+ 
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+ 
+! All this was correct
+show axis uppercasetime
+ name       axis              # pts   start                end
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 8
+show grid bb
+    GRID GHC2
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+ normal    E
+ normal    F
+ 
+! This variable has axis time, lowercase in the file
+sh grid aa
+    GRID GHC1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                   15 r   1                    15
+ normal    E
+ normal    F
+set axis/t0=1-jan-2001/units=days time
+ 
+! showed no output
+show axis time
+ name       axis              # pts   start                end
+ TIME      TIME                15 r   02-JAN-2001 00:00    16-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 15
+ 
+! The axis did get changed but is inconsistently listed in the
+! internal arrays that store axis info.
+ 
+list/L=1:5 aa
+             VARIABLE : AA
+             FILENAME : lowercaseTime.nc
+             SUBSET   : 5 points (TIME)
+ 02-JAN-2001 00 / 1:  1.000
+ 03-JAN-2001 00 / 2:  2.000
+ 04-JAN-2001 00 / 3:  3.000
+ 05-JAN-2001 00 / 4:  4.000
+ 06-JAN-2001 00 / 5:  5.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_redefine_uvar_att
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on,
+!   returned a runtime error.
+ 
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
+ 
+GO bn_reset
+cancel mode verify
+GO err685_use_no_extension
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+ 
+! The directory contains files with all three extensions
+sp ls duplicate.*
+duplicate.cdf
+duplicate.des
+duplicate.nc
+ 
+! The one that's used is .nc
+use duplicate
+sh dat
+     currently SET data sets:
+    1> ./duplicate.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:1       1:10      ...       1:3       ...       ...
+ 
+ 
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+ 
+! Specify a nonexistent file, no extension
+use nosuchfile
+ 
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+ 
+use snoopy.dat
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err685_samplexy
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error
+! sending sub-range of variable into samplexy
+ 
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+             VARIABLE : SAMPLEXY(SST[X=290:310,Y=0:20], LON, LAT)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  26.84  26.77  26.66
+ 15-FEB      / 2:  26.60  26.52  26.35
+ 17-MAR      / 3:  26.68  26.61  26.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_shade_set
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+ 
+can dat/all
+ 
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the
+! epression being SHADED, inside a SHADE/SET
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !GAVE A BLANK PLOT
+ 
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+ 
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+ !-> shade/title="DAYS" tseries*z[gz=1:5:1]
+ 
+can var/all; can mem
+can axis timax
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err686_individual_levels
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+ 
+use coads_climatology
+ 
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+ 
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+LEV_TEXT = "(10)(20)(30)(40)"
+LEV_MIN = "10"
+LEV_MAX = "40"
+LEV_NUM = "3"
+LEV_DEL = "10"
+ 
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
+LEV_TEXT = "(10)(15)(20)(25)(30)"
+LEV_MIN = "10"
+LEV_MAX = "30"
+LEV_NUM = "4"
+LEV_DEL = "5"
+ 
+*** Running test: bn_long_symnames.jnl
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+ 
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+! SHOW
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+FERRET_TEMPERATURE_EQUILIBRATOR_MAX = "35"
+ 
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+ 
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+can sym *max
+ 
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "0"
+ 
+ 
+! bn_symbols had a line to
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567XXX = "6"
+*** Running test: bn_strdim.jnl
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+ 
+use strdimfile.nc
+ 
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+ 
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	ENSEMBLE = 3 ;
+	maxStrlen64 = 64 ;
+variables:
+	double ENSEMBLE(ENSEMBLE) ;
+		ENSEMBLE:long_name = "Ensemble of Realizations" ;
+		ENSEMBLE:axis = "E" ;
+		ENSEMBLE:point_spacing = "even" ;
+	char LABELS(ENSEMBLE, maxStrlen64) ;
+		LABELS:long_name = "Realizations" ;
+		LABELS:history = "From http://dunkel.pmel.noaa.gov:8930/thredds/dodsC/data/atmos3.ncml" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+ 
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_5 = 5 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char STRVAR(XAX1_3, STRING1_5) ;
+		STRVAR:long_name = "mystrings" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+*** Running test: bn_single_colorlev.jnl
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when
+! single level is specified with a range of values
+ 
+use coads_climatology
+ 
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+ 
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+ 
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+ 
+*** Running test: bn69_bug_fixes.jnl
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err686_long_list_varnames
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+ 
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+ 
+! The list was cut off after woa_land_marker.
+! Try to load a variable later than that in the list.
+ 
+list etopo2_depth
+             VARIABLE : ETOPO2_DEPTH
+             FILENAME : longvarnames.tsv
+             SUBSET   : 10 points (X)
+ 1    /  1: -97.00
+ 2    /  2: -97.00
+ 3    /  3: -97.00
+ 4    /  4: -97.00
+ 5    /  5: -97.00
+ 6    /  6: -97.00
+ 7    /  7: -97.00
+ 8    /  8: -99.00
+ 9    /  9: -99.00
+ 10   / 10: -99.00
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_faxis_label
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis
+! shouldn't automatically get it.
+ 
+! Define a variable with a Julian calendar axis, and an abstract F axis
+ 
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+ 
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! This label should be just F : 3
+sh sym lab($labnum_f)
+ !-> sh sym lab2
+LAB2 = "F : 3"
+ 
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
+ !-> sh sym lab2
+LAB2 = "FORECAST : 03-JAN-2000 00:00:00 JULIAN"
+ 
+GO bn_reset
+cancel mode verify
+GO err686_dup_axnames
+! err686_dup_axnames
+! Ticket 1750
+!
+! Make some datasets. Same axis length and name,
+! different coordinates.
+ 
+def ax/x=1:4:1 xaxis_test
+let a = x[gx=xaxis_test]
+save/clob/file=a.nc a
+def ax/x=11:14:1 xaxis_test
+let b = x[gx=xaxis_test]
+save/clob/file=b.nc b
+can var/all; can dat/all
+ 
+! Check axis coords.
+use a; use b
+sh dat
+     currently SET data sets:
+    1> ./a.nc
+ name     title                             I         J         K         L         M         N
+ A        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+    2> ./b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+sh grid a[d=1]
+    GRID GSI1
+ name       axis              # pts   start                end
+ XAXIS_TEST1 X                  4 r   1                    4
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+sh grid b[d=2]
+    GRID GRR1
+ name       axis              # pts   start                end
+ XAXIS_TEST X                   4 r   11                   14
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! Write b with its Ferret internal axis name XAXIS_TEST1
+save/clob/file=c.nc a[d=1],b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST1 = 4 ;
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Yet more combinations
+save/clob/file=c.nc b, a[d=1]
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+	XAXIS_TEST1 = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! We can use /KEEP_AXISNAMES, changes XAXIS_TEST1 to XAXIS_TEST
+save/clobber/file=c.nc b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Subsets also use XAXIS_TEST1
+save/clobber/file=c.nc/i=2:4 b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST2_4 = 3 ;
+variables:
+	double XAXIS_TEST2_4(XAXIS_TEST2_4) ;
+		XAXIS_TEST2_4:point_spacing = "even" ;
+		XAXIS_TEST2_4:axis = "X" ;
+	double B(XAXIS_TEST2_4) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Unless we use /KEEP_AXISNAMES - which removes renaming
+! due to subsetting and also due to internal names
+save/clobber/file=c.nc/i=2:4/keep b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 3 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! If we try /KEEP_AXISNAMES but there is a conflict, it's an err
+set mode ignore
+save/clobber/keep/file=nc b,a[d=1]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_cancel_invalid_var
+! err686_cancel_invalid_var
+! ticket 2159
+ 
+! The cancel variable ran into an incorrect setting
+! for variable-in-memory
+ 
+set mode ignore
+let b = 1
+shade b
+ 
+set mode/last ignore
+cancel var b
+ 
+! Shade plot of a less-than-one cell region. Its where the bug came from.
+use coads_climatology
+shade/x=161.1:161.3/y=0.2:0.4/L=1 sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_redef_ascii_att
+! err686_redef_ascii_att.jnl
+! Bug 2161
+! DEFINE ATT to redefine title or units for variable
+! in ascii dataset caused crash
+ 
+columns/delim=" " EZ.DAT
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ 
+! A new attribuge causes no problems
+define att/output v1.comment = "First var from EZ.DAT"
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ 
+! Initial definition of units is ok.
+! Re-defining the title or units causes crash
+define att/output v1.long_name = "vee one"
+ 
+! Initial definition of units is ok.
+! Re-defining units causes crash
+define att/output v1.units="km"
+define att/output v1.units="meters"
+ 
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = vee one 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ V1.units = meters 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_sho_nonexist_att
+! err686_sho_nonexist_att.jnl
+! See ticket 2133
+ 
+!  Too many error messages were issued on this error
+set mode ignore
+ 
+use levitus_climatology
+show att temp.noexist[d=levitus_climatology]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_set_var_name
+! err686_set_var_name.jnl
+! ticket 2152
+! rename user var or file var. Err message was
+! wrong if the name already exists.
+ 
+SET MODE IGNORE
+ 
+let a = 1
+let b = 2
+! Intentional error, new name is already a defined variable
+set var/name=b a
+! This rename is ok
+set var/name=c a
+sh var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     B = 2
+     C = 1
+ 
+use gt4d011.cdf
+! Intentional error, new name already in file
+set var/name=temp salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+! This rename is ok
+set var/name=salinity salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+ 
+! Test LET/D variables:
+let/d=1 myvar = taux - tauy
+! This is an error, new name already in file
+set var/name=psi myvar
+! This is ok, new let/d name associated with the file
+set var/name=diff myvar
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ ------------------------------
+ DIFF[D=gt4d011] = TAUX - TAUY
+ 
+ 
+ 
+ 
+SET MODE/LAST ignore
+*** Running test: bn_bad_axis_bounds.jnl
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+ 
+use badbounds.nc
+show data
+     currently SET data sets:
+    1> ./badbounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MONTH_IRREG_BNDS
+                                           1:2       ...       ...       1:12      ...       ...
+       (invalid axis bounds)
+ TEMP2    TEMP[GT=MONTH_IRREG at ASN]         1:1       1:1       1:1       1:12      ...       ...
+ 
+*** Running test: bn_enter_exit_GO.jnl
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+ 
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+ 
+set redirect/tee/journal
+go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ 
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+ !-> if 1 THEN GO bn_shortgo2
+! Enter_GO bn_shortgo2
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
+! Enter_GO bn_short.sub tvar ave
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+ 
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+ !-> LIST/nohead/norow tvar[t=-5:9 at ave]	! neg/pos t endpoints
+   2.000
+ 
+! Exit_GO
+! Exit_GO
+ 
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+ !-> repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+!-> REPEAT: L=1
+ !-> if 0 then go bn_shortgo
+ !-> def sym ok = 1
+!-> REPEAT: L=2
+ !-> if 1 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 2
+!-> REPEAT: L=3
+ !-> if 2 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 3
+ 
+cancel redirect
+*** Running test: bn_stddev.jnl
+! bn_std.jnl
+! New StdDev transform
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (standard deviation)
+          0.6651
+list/x=100/L=1 sst[y=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (standard deviation)
+             TIME     : 16-JAN 06:00
+          10.12
+list/y=10/L=1 sst[x=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (standard deviation)
+             LATITUDE : 9N
+             TIME     : 16-JAN 06:00
+          0.7078
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@STD]
+             VARIABLE : ZONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          3.366
+list/y=3/l=1 temp[x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 2.8N
+             TIME     : 17-AUG-1982 12:00
+ 5     /  1:  0.2463
+ 15    /  2:  0.2536
+ 25    /  3:  0.2661
+ 35    /  4:  0.2647
+ 45    /  5:  0.2006
+ 55    /  6:  0.0981
+ 65    /  7:  0.2053
+ 75    /  8:  0.3932
+ 85    /  9:  0.5569
+ 95    / 10:  0.7732
+list/y=3/l=1 temp[z=@std,x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 2.8N
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          0.1895
+*** Running test: bn_set_axis_name.jnl
+! bn_set_axis_name.jnl
+! ticket 2160 Implementing new qualifier SET AXIS/NAME
+! 3/2014
+!
+!
+! Prepare a dataset with a time axis
+ 
+define axis/t=1-may-2010:5-may-2010:1/units=days daysaxis
+let a = t[gt=daysaxis]
+save/clobber/file=a.nc a
+ 
+cancel variable a
+cancel axis daysaxis
+ 
+!  We define some axis, then open a dataset with an axis of that name.
+ 
+define axis/t=1-jan-2000:31-jan-2000:1/units=days daysaxis
+ 
+use a.nc
+ 
+! The axis in the dataset has been renamed.
+say `a,return=taxis`
+ !-> MESSAGE/CONTINUE DAYSAXIS1
+DAYSAXIS1
+ 
+! So, rename our user-defined axis
+set axis/name=days2000 daysaxis
+ 
+! and now rename the one from the dataset back to its original name
+set axis/name=daysaxis `a,return=taxis`
+ !-> set axis/name=daysaxis DAYSAXIS1
+sh grid a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ daysaxis  TIME                 5 r   01-MAY-2010 00:00    05-MAY-2010 00:00
+ normal    E
+ normal    F
+ 
+cancel data/all
+ 
+! If an axis is used in several datsets, renaming it of course
+! changes the name for all grids.
+! The attribute structure gets updated as well.
+ 
+! Make several datasets with the same x axis.
+define axis/x=1:13:1/units=meters x13axis
+let a = x[gx=x13axis]
+let b = 3*x[gx=x13axis]
+let c = 5*x[gx=x13axis]
+save/clobber/file=a.nc a
+save/clobber/file=b.nc b
+save/clobber/file=c.nc c
+ 
+can var/all
+can axis x13axis
+ 
+! Open them in Ferret; all grids are the same.
+use a.nc, b.nc, c.nc
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+ 
+! Rename the axis
+set axis/name=x_in_meters x13axis
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+ 
+! For SHOW DAT/ATT we get info from the attribute structure.
+! It has the udated name.
+sh dat/att
+     currently SET data sets:
+    1> ./a.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ A                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        13   T       X[GX=X13AXIS]
+  
+    2> ./b.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ B                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       3*X[GX=X13AXIS]
+  
+    3> ./c.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        22   T       FERRET V6.9  31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ C                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       5*X[GX=X13AXIS]
+  
+ 
+! Intentional errors
+set mode ignore
+ 
+! Name already in use
+set axis/name=days2000 x_in_meters
+ 
+! Missing or illegal name
+set axis/name x_in_meters
+set axis/name=45 x_in_meters
+set axis/name=.fr x_in_meters
+ 
+set mode/last ignore
+*** Running test: bn_all_ef.jnl
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+ADD_9(A,B,C,D,E,F,G,H,I)
+    (demonstration function) adds 9 arguments
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+AVET(A)
+    (demonstration function) returns the time average
+    A: data to be averaged over the time axis
+show func pass_thru
+PASS_THRU(A)
+    (demonstration function) sets result equal to input
+    A: this arg is passed through
+show func sto*
+STORAGE(A)
+    sets result equal to input/10
+    A: input
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+list a
+             VARIABLE : ADD_9(A1,A2,A3,A1,A2,A3,A1,A2,A3)
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  263.6
+ 153E   / 67:  264.5
+ 155E   / 68:  264.2
+ 157E   / 69:  261.3
+ 159E   / 70:  260.9
+ 161E   / 71:  262.4
+ 163E   / 72:  264.0
+ 165E   / 73:  261.1
+ 167E   / 74:  260.9
+ 169E   / 75:  261.0
+ 171E   / 76:  259.3
+ 173E   / 77:  257.9
+ 175E   / 78:  257.0
+ 177E   / 79:  259.1
+ 179E   / 80:  254.8
+list  a - 3 * sst[d=1,l=1:3 at sum]
+             VARIABLE : A - 3 * SST[D=coads_climatology,L=1:3 at SUM]
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+set mode/last ignore_errors
+go bench_avet
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a = avet(sst)
+list a
+             VARIABLE : AVET(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+                1S    
+                45
+ 151E   / 66:  29.28
+ 153E   / 67:  29.39
+ 155E   / 68:  29.35
+ 157E   / 69:  29.03
+ 159E   / 70:  28.99
+ 161E   / 71:  29.15
+ 163E   / 72:  29.33
+ 165E   / 73:  29.01
+ 167E   / 74:  28.99
+ 169E   / 75:  29.00
+ 171E   / 76:  28.81
+ 173E   / 77:  28.66
+ 175E   / 78:  28.56
+ 177E   / 79:  28.79
+ 179E   / 80:  28.31
+list a - sst[l=@ave]
+             VARIABLE : A - SST[L=@AVE]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                  1S      
+                  45
+ 151E   / 66:  0.000E+00
+ 153E   / 67: -3.553E-15
+ 155E   / 68:  0.000E+00
+ 157E   / 69:  0.000E+00
+ 159E   / 70:  3.553E-15
+ 161E   / 71:  7.105E-15
+ 163E   / 72:  3.553E-15
+ 165E   / 73:  0.000E+00
+ 167E   / 74:  0.000E+00
+ 169E   / 75:  3.553E-15
+ 171E   / 76:  0.000E+00
+ 173E   / 77:  3.553E-15
+ 175E   / 78:  0.000E+00
+ 177E   / 79:  3.553E-15
+ 179E   / 80:  3.553E-15
+ 
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+             X: 0.5 to 9.5
+ Column  1: B is X[I=1:9,K=1:5]
+ Column  2: C is AVET(A)
+             B     C
+1   / 1:  1.000   4.00
+2   / 2:  2.000   5.00
+3   / 3:  3.000   6.00
+4   / 4:  4.000   7.00
+5   / 5:  5.000   8.00
+6   / 6:  6.000   9.00
+7   / 7:  7.000  10.00
+8   / 8:  8.000  11.00
+9   / 9:  9.000  12.00
+ 
+set mode/last ignore_errors
+go bench_pass_thru
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+             VARIABLE : PASS_THRU(X)
+             SUBSET   : 20 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 11   / 11:  11.00
+ 12   / 12:  12.00
+ 13   / 13:  13.00
+ 14   / 14:  14.00
+ 15   / 15:  15.00
+ 16   / 16:  16.00
+ 17   / 17:  17.00
+ 18   / 18:  18.00
+ 19   / 19:  19.00
+ 20   / 20:  20.00
+set region/i=1:20
+list sin(a)
+             VARIABLE : SIN(A)
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8415
+ 2    /  2:  0.9093
+ 3    /  3:  0.1411
+ 4    /  4: -0.7568
+ 5    /  5: -0.9589
+ 6    /  6: -0.2794
+ 7    /  7:  0.6570
+ 8    /  8:  0.9894
+ 9    /  9:  0.4121
+ 10   / 10: -0.5440
+ 11   / 11: -1.0000
+ 12   / 12: -0.5366
+ 13   / 13:  0.4202
+ 14   / 14:  0.9906
+ 15   / 15:  0.6503
+ 16   / 16: -0.2879
+ 17   / 17: -0.9614
+ 18   / 18: -0.7510
+ 19   / 19:  0.1499
+ 20   / 20:  0.9129
+can var/all
+can region
+ 
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+             VARIABLE : PASS_THRU(SST[L=@AVE,Y=@SBX:11])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+             VARIABLE : PASS_THRU(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 16-JAN 06:00
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   0.59
+ 71N   / 81:   0.62
+ 69N   / 80:   0.45
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   3.32
+ 43N   / 67:   4.72
+ 41N   / 66:   4.84
+ 39N   / 65:   8.63
+ 37N   / 64:   8.07
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:  18.91
+ 27N   / 59:  20.83
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:  25.41
+ 13N   / 52:  25.37
+ 11N   / 51:  25.82
+ 9N    / 50:  27.20
+ 7N    / 49:  26.11
+ 5N    / 48:  26.10
+ 3N    / 47:  26.25
+ 1N    / 46:  26.44
+ 1S    / 45:  27.01
+ 3S    / 44:  27.61
+ 5S    / 43:  28.24
+ 7S    / 42:  28.71
+ 9S    / 41:  28.46
+ 11S   / 40:  28.07
+ 13S   / 39:  28.15
+ 15S   / 38:  28.08
+ 17S   / 37:  28.29
+ 19S   / 36:  27.61
+ 21S   / 35:  27.59
+ 23S   / 34:  27.06
+ 25S   / 33:  26.70
+ 27S   / 32:  25.89
+ 29S   / 31:  24.65
+ 31S   / 30:  23.86
+ 33S   / 29:  22.16
+ 35S   / 28:  20.58
+ 37S   / 27:  19.20
+ 39S   / 26:  17.51
+ 41S   / 25:  14.44
+ 43S   / 24:   8.55
+ 45S   / 23:   7.51
+ 47S   / 22:   5.77
+ 49S   / 21:   4.21
+ 51S   / 20:   3.64
+ 53S   / 19:   2.87
+ 55S   / 18:   2.67
+ 57S   / 17:   2.05
+ 59S   / 16:   1.37
+ 61S   / 15:   1.33
+ 63S   / 14:   0.77
+ 65S   / 13:  -0.04
+ 67S   / 12:  -0.93
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+list/x=50 a[l=@ave,y=@sbx:11]
+             VARIABLE : PASS_THRU(SST)
+                        box smoothed by 11 pts on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (averaged)
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+ 
+set mode/last ignore_errors
+go bench_storage
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+              130.5E 131.5E 
+                1      2
+ 1.5N  / 50:   ....  2.955
+ 1.17N / 49:   ....  2.962
+ 0.83N / 48:   ....  2.966
+ 0.5N  / 47:   ....  2.973
+ 0.17N / 46:   ....  2.985
+ 0.17S / 45:   ....  2.990
+ 0.5S  / 44:   ....   ....
+ 
+can region
+set region/x=140w/y=10n/k=1
+list a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 140.5W
+             LATITUDE : 9.8N
+             DEPTH (m): 5
+                      140.5W 
+                       90
+ 15-JAN-1982 14 / 1:  2.656
+ 18-JAN-1982 15 / 2:  2.654
+ 21-JAN-1982 16 / 3:  2.652
+ 24-JAN-1982 17 / 4:  2.649
+ 27-JAN-1982 18 / 5:  2.646
+ 
+can region
+ 
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+             VARIABLE : STORAGE(B)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 0.7S to 1.7N (averaged)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+ 140.5E / 11:  2.953
+ 141.5E / 12:  2.956
+ 142.5E / 13:  2.961
+ 143.5E / 14:  2.966
+ 144.5E / 15:  2.968
+ 145.5E / 16:  2.968
+ 146.5E / 17:  2.967
+ 147.5E / 18:  2.970
+ 148.5E / 19:  2.974
+ 149.5E / 20:  2.979
+ 
+set mode/last ignore_errors
+ 
+go bench_subtract
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+ 
+set mode ignore_errors
+ 
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+             VARIABLE : SUBTRACT(OATEMP,SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+             VARIABLE : A - B
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+ 
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             DEPTH (m): 0
+                    179E   
+                     80
+ 16-JAN      / 1:  0.1934
+ 15-FEB      / 2:  0.1304
+ 17-MAR      / 3:    ....
+ 
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+             VARIABLE : SUBTRACT(A,B)
+             SUBSET   : 30 points (X)
+             Y        : 15
+              15    
+              15
+ 1    /  1: -14.00
+ 2    /  2: -13.00
+ 3    /  3: -12.00
+ 4    /  4: -11.00
+ 5    /  5: -10.00
+ 6    /  6:  -9.00
+ 7    /  7:  -8.00
+ 8    /  8:  -7.00
+ 9    /  9:  -6.00
+ 10   / 10:  -5.00
+ 11   / 11:  -4.00
+ 12   / 12:  -3.00
+ 13   / 13:  -2.00
+ 14   / 14:  -1.00
+ 15   / 15:   0.00
+ 16   / 16:   1.00
+ 17   / 17:   2.00
+ 18   / 18:   3.00
+ 19   / 19:   4.00
+ 20   / 20:   5.00
+ 21   / 21:   6.00
+ 22   / 22:   7.00
+ 23   / 23:   8.00
+ 24   / 24:   9.00
+ 25   / 25:  10.00
+ 26   / 26:  11.00
+ 27   / 27:  12.00
+ 28   / 28:  13.00
+ 29   / 29:  14.00
+ 30   / 30:  15.00
+ 
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+list/x=150:160/y=0 subtract(a,26)
+             VARIABLE : SUBTRACT(A,26)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+ 
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                1S    
+                45
+ 151E   / 66:  1.109
+ 153E   / 67:  1.124
+ 155E   / 68:  1.027
+ 157E   / 69:  0.883
+ 159E   / 70:  0.912
+ 
+set mode/last ignore_errors
+ 
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
+ 
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+!
+! 4/2006 all efs distributed with Ferret except writev5d and the
+!        examples tested in bench_examples.jnl are now internally linked.
+ 
+GO bn_reset
+cancel mode verify
+go bench_v5d
+! benchmark for Vis5D external function
+! 5/99 ACM
+ 
+ 
+!  Write data to a Vis5D file.  The first argument to the
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+ 
+can region
+ set mode ignore_error
+ 
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+To view the file with Vis5D say:   GO vis5d_start vis5d_out.v5d
+ 
+set mode/last ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_v5d_strings.jnl
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+ 
+go bn_reset
+cancel mode verify
+go bn_fcn_calls.jnl
+! Simple tests of external functions
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and
+!             fill_xy to bn_internal_external_functions.jnl
+ 
+exit
+ 
+exit/command
+*** Running test: bn_startupfile.jnl
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "691"
+PPL$YPIXEL = "518"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5 64-bit"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "15:38"
+SESSION_PID = "27420"
+DELTA_CPU = "0.026995"
+CLOCK_SECS = "0.096"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "15:38:52"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "Ferret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "startup_tests.plt"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "8.000"
+PPL$YLEN = "6.000"
+PPL$XORG = "1.200"
+PPL$YORG = "1.400"
+PPL$WIDTH = "10.20"
+PPL$HEIGHT = "8.800"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+WIN_TITLE = "31-Mar-14:15:38"
+VP_WIDTH = "10.2"
+VP_HEIGHT = "8.8"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1"
+VP_TOP_MARGIN = "1.4"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE         SET         startup_tests.plt
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+Ended at Mon Mar 31 15:38:52 PDT 2014
diff --git a/bench/test_results/ferret_run_tests_ncdump b/bench/test_results/ferret_run_tests_ncdump
new file mode 100644
index 0000000..a44de1d
--- /dev/null
+++ b/bench/test_results/ferret_run_tests_ncdump
@@ -0,0 +1,2926 @@
+*** Running test: bn_syntax.jnl
+*** Running test: bn_dollar.jnl
+*** Running test: bn_grave.jnl
+*** Running test: bn_letd.jnl
+*** Running test: bn_if.jnl
+*** Running test: bn_expressions.jnl
+*** Running test: bn_geometry.jnl
+*** Running test: bn_output.jnl
+*** Running test: bn_in_plane.jnl
+*** Running test: bn_compress.jnl
+*** Running test: bn_interpolate.jnl
+*** Running test: bn_regrid.jnl
+*** Running test: bn_ez.jnl
+*** Running test: bn_plot.jnl
+*** Running test: bn_curv.jnl
+*** Running test: bn_symbols.jnl
+*** Running test: bn_comma_delimited.jnl
+*** Running test: bn_dynamic_grids.jnl
+*** Running test: bn_cdf.jnl
+*** Running test: bn_regrid_transforms.jnl
+*** Running test: bn_axis_limits.jnl
+*** Running test: bn_movie.jnl
+*** Running test: bn_ez_order.jnl
+*** Running test: bn_user.jnl
+*** Running test: bn_stream.jnl
+*** Running test: bn_mc.jnl
+*** Running test: bn_negative_t.jnl
+*** Running test: bn_xact_regrid.jnl
+*** Running test: bn_gc_functions.jnl
+*** Running test: bn491_bug_fixes.jnl
+*** Running test: bn_odd_variable_name.jnl
+*** Running test: bn_test_stream.jnl
+*** Running test: bn_define_axes.jnl
+*** Running test: bn_polygon.jnl
+*** Running test: bn500_bug_fixes.jnl
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+*** Running test: bn_sample.jnl
+*** Running test: bn_strides_revs_perms.jnl
+*** Running test: bn_non_COARDS_netCDF.jnl
+*** Running test: bn_cache_hits.jnl
+*** Running test: bn_regrid_to_user.jnl
+*** Running test: bn_calendar.jnl
+*** Running test: bn_dash_dot.jnl
+*** Running test: bn_flowlines.jnl
+*** Running test: bn_logaxes.jnl
+*** Running test: bn_internal_external_functions.jnl
+*** Running test: bn_modulo_strides.jnl
+*** Running test: bn_axis_viewports.jnl
+*** Running test: bn_strings.jnl
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_17 = 17 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_17) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+*** Running test: bn_axcontrol.jnl
+*** Running test: bn_vec_curv.jnl
+*** Running test: bn_delimited_read.jnl
+*** Running test: bn541_bug_fixes.jnl
+*** Running test: bn_cancel_axes.jnl
+*** Running test: bn542_bug_fixes.jnl
+*** Running test: bn_subspan_modulo.jnl
+*** Running test: bn_dots.jnl
+*** Running test: bn_lev_symbols.jnl
+*** Running test: bn_mode_logo_lab.jnl
+*** Running test: bn_modulo_attribute.jnl
+*** Running test: bn550_bug_fixes.jnl
+*** Running test: bn551_bug_fixes.jnl
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+*** Running test: bn_multi_line_labels.jnl
+*** Running test: bn552_bug_fixes.jnl
+*** Running test: bn_set_var_scale_off.jnl
+*** Running test: bn_longvarnames.jnl
+*** Running test: bn_shakey.jnl
+*** Running test: bn_eof_4d.jnl
+*** Running test: bn_abstract_axis_names.jnl
+*** Running test: bn_many_polygons.jnl
+*** Running test: bn_fill_irregular.jnl
+*** Running test: bn_xml_output.jnl
+*** Running test: bn_test_nan.jnl
+*** Running test: bn553_bug_fixes.jnl
+*** Running test: bn_graticules.jnl
+*** Running test: bn_repeat_range.jnl
+*** Running test: bn554_bug_fixes.jnl
+*** Running test: bn_bounds.jnl
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348804, 27.9324667419545,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIME_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME = UNLIMITED ; // (3 currently)
+	TIMEedges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:edges = "TIMEedges" ;
+	double TIMEedges(TIMEedges) ;
+		TIMEedges:edges = " " ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIMEedges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:bounds = "ZAX_bnds" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+*** Running test: bn_all_leap.jnl
+*** Running test: bn570_bug_fixes.jnl
+*** Running test: bn_modstats.jnl
+*** Running test: bn_mc_vary_scale.jnl
+*** Running test: bn_plot_nokey.jnl
+*** Running test: bn580_bug_fixes.jnl
+*** Running test: bn_inf_levels.jnl
+*** Running test: bn_regulart.jnl
+*** Running test: bn_labwid.jnl
+*** Running test: bn_redefine_taxis_mc.jnl
+*** Running test: bn_illegal_axisname.jnl
+*** Running test: bn_exit_script.jnl
+*** Running test: bn_exit_cycle.jnl
+*** Running test: bn_curv_mod.jnl
+*** Running test: bn_shade_keycont.jnl
+*** Running test: bn581_bug_fixes.jnl
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_tab_comma_multivar.jnl
+*** Running test: bn_element_functions.jnl
+*** Running test: bn_long_revision_num.jnl
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.9  31-Mar-14" ;
+*** Running test: bn_window_title.jnl
+*** Running test: bn_last_error.jnl
+*** Running test: bn_deg_min.jnl
+*** Running test: bn_dp_readscale.jnl
+*** Running test: bn_bounds_defineax.jnl
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:bounds = "ZAX_bnds" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+*** Running test: bn_attributes.jnl
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME1 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 0000-01-01 00:00:00" ;
+		TIME1:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME1:modulo = " " ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float SST(TIME1, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME1 = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME2 = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME2(TIME2) ;
+		TIME2:units = "hour since 0000-01-01 00:00:00" ;
+		TIME2:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME2:modulo = " " ;
+		TIME2:axis = "T" ;
+		TIME2:standard_name = "time" ;
+	float SST(TIME2, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME2 = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT100_100 = 1 ;
+	PSYT35_56 = 22 ;
+	PSZT11_1 = 1 ;
+	TIME1 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT100_100(PSXT100_100) ;
+		PSXT100_100:units = "degrees_east" ;
+		PSXT100_100:point_spacing = "even" ;
+		PSXT100_100:modulo = 360. ;
+		PSXT100_100:axis = "X" ;
+		PSXT100_100:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_1(PSZT11_1) ;
+		PSZT11_1:units = "meters" ;
+		PSZT11_1:positive = "down" ;
+		PSZT11_1:point_spacing = "uneven" ;
+		PSZT11_1:axis = "Z" ;
+		PSZT11_1:standard_name = "depth" ;
+		PSZT11_1:bounds = "PSZT11_1_bnds" ;
+	double PSZT11_1_bnds(PSZT11_1, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:point_spacing = "even" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float TEMP(TIME1, PSZT11_1, PSYT35_56, PSXT100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME1, PSZT11_1, PSYT48_48, PSXT91_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME1, PSZT11_1, PSYT48_48, PSXT91_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:new_att = "something" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "meters" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:new_att = "something" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "meters" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double FAREN(TIME1, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	int FAREN(TIME1, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_transforms.jnl
+*** Running test: bn_variance.jnl
+*** Running test: bn_linecolors.jnl
+*** Running test: bn_cdf_errmsg.jnl
+*** Running test: bn600_bug_fixes.jnl
+*** Running test: bn601_bug_fixes.jnl
+*** Running test: bn_set_strides.jnl
+*** Running test: bn_lsl_lowpass.jnl
+*** Running test: bn_return_xmod_tmod.jnl
+*** Running test: bn602_bug_fixes.jnl
+*** Running test: bn_modnbd.jnl
+*** Running test: bn_fifty_files.jnl
+*** Running test: bn603_bug_fixes.jnl
+*** Running test: bn_set_var_name.jnl
+*** Running test: bn_memory_symbol.jnl
+*** Running test: bn605_bug_fixes.jnl
+*** Running test: bn608_bug_fixes.jnl
+*** Running test: bn_shade_trim.jnl
+*** Running test: bn_mode_nlevels.jnl
+*** Running test: bn61_bug_fixes.jnl
+*** Running test: bn_test_opendap.jnl
+*** Running test: bn611_bug_fixes.jnl
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_no_valid_on_plot.jnl
+*** Running test: bn_median.jnl
+*** Running test: bn614_bug_fixes.jnl
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+*** Running test: bn_mode_nodata_lab.jnl
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+*** Running test: bn_string_ngd_nbd.jnl
+*** Running test: bn_cat_string.jnl
+*** Running test: bn_sort_strings.jnl
+*** Running test: bn_samplexyt.jnl
+*** Running test: bn_last_go_file.jnl
+*** Running test: bn_cancel_upcase_uservar.jnl
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	TDAY = UNLIMITED ; // (31 currently)
+	LON1_5 = 5 ;
+	LAT1_5 = 5 ;
+	bnds = 2 ;
+	ZT = 10 ;
+	TIME1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double TDAY(TDAY) ;
+		TDAY:units = "days since 1998-12-31 00:00:00" ;
+		TDAY:axis = "T" ;
+		TDAY:calendar = "GREGORIAN" ;
+		TDAY:time_origin = "31-DEC-1998" ;
+		TDAY:standard_name = "time" ;
+	double MyUpperLowerCaseVar(TDAY, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double LON1_5(LON1_5) ;
+		LON1_5:point_spacing = "even" ;
+		LON1_5:axis = "X" ;
+		LON1_5:standard_name = "longitude" ;
+	double LAT1_5(LAT1_5) ;
+		LAT1_5:point_spacing = "uneven" ;
+		LAT1_5:axis = "Y" ;
+		LAT1_5:standard_name = "latitude" ;
+		LAT1_5:bounds = "LAT1_5_bnds" ;
+	double LAT1_5_bnds(LAT1_5, bnds) ;
+	float ZT(ZT) ;
+		ZT:units = "meters" ;
+		ZT:positive = "down" ;
+		ZT:point_spacing = "uneven" ;
+		ZT:axis = "Z" ;
+		ZT:standard_name = "depth" ;
+		ZT:bounds = "ZT_bnds" ;
+	float ZT_bnds(ZT, bnds) ;
+	double TIME1478(TIME1478) ;
+		TIME1478:calendar = "NOLEAP" ;
+		TIME1478:point_spacing = "even" ;
+		TIME1478:axis = "T" ;
+		TIME1478:standard_name = "time" ;
+	double newvar(TIME1478, ZT, LAT1_5, LON1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_cdf_keepax.jnl
+*** Running test: bn_keep_axisnames.jnl
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_key_label_minmax.jnl
+*** Running test: bn62_bug_fixes.jnl
+*** Running test: bn_convolve.jnl
+*** Running test: bn_tax_tstep.jnl
+*** Running test: bn_grads_z.jnl
+*** Running test: bn_clock_syms.jnl
+*** Running test: bn63_bug_fixes.jnl
+*** Running test: bn_axis_reversed_syms.jnl
+*** Running test: bn_isdepth.jnl
+*** Running test: bn_var_hist_levels.jnl
+*** Running test: bn64_bug_fixes.jnl
+*** Running test: bn_long_grid_names.jnl
+*** Running test: bn_xml_repl.jnl
+*** Running test: bn65_bug_fixes.jnl
+*** Running test: bn_txtype_dmy.jnl
+*** Running test: bn_n_open_dsets_sym.jnl
+*** Running test: bn_multi_decade.jnl
+*** Running test: bn_show_xml_file.jnl
+*** Running test: bn66_bug_fixes.jnl
+*** Running test: bn_netcdf4.jnl
+*** Running test: bn_scat2grid_bin.jnl
+*** Running test: bn_axis_dir_symbols.jnl
+*** Running test: bn663_bug_fixes.jnl
+*** Running test: bn_set_axis_regular.jnl
+*** Running test: bn_set_cancel_redirect.jnl
+*** Running test: bn_min_max_smoothers.jnl
+*** Running test: bn_vector_symbols.jnl
+*** Running test: bn_variance_large.jnl
+*** Running test: bn_labnum_calendar.jnl
+*** Running test: bn665_bug_fixes.jnl
+*** Running test: bn_floatstr.jnl
+*** Running test: bn67_bug_fixes.jnl
+*** Running test: bn_NaN_note.jnl
+*** Running test: bn671_bug_fixes.jnl
+*** Running test: bn68_bug_fixes.jnl
+*** Running test: bn_ifv.jnl
+*** Running test: bn_randu2_randn2.jnl
+*** Running test: bn_axis_cf.jnl
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:units = "degrees_east" ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:units = "degrees_north" ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:calendar = "GREGORIAN" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.9  31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_repeated_coords.jnl
+*** Running test: bn_xml_header.jnl
+*** Running test: bn_eof_simple.jnl
+*** Running test: bn_eof_simple2.jnl
+*** Running test: bn_interpolate_6d.jnl
+*** Running test: bn_regrid_6d.jnl
+*** Running test: bn_syntax_6d.jnl
+*** Running test: bn_expressions_6d.jnl
+*** Running test: bn_direction_fcns_6d.jnl
+*** Running test: bn_regrid_transforms_6d.jnl
+*** Running test: bn_aggregate_e.jnl
+*** Running test: bn_6d_lab_mode.jnl
+*** Running test: bn682_bug_fixes.jnl
+*** Running test: bn683_bug_fixes.jnl
+*** Running test: bn_outtype.jnl
+*** Running test: bn_ribbon_plot.jnl
+*** Running test: bn_descr_4digit.jnl
+*** Running test: bn_axis_outtype.jnl
+*** Running test: bn_axis_nonmonotonic.jnl
+*** Running test: bn_vec_mod.jnl
+*** Running test: bn685_bug_fixes.jnl
+*** Running test: bn_dsg_e_x.jnl
+*** Running test: bn_nco_append.jnl
+*** Running test: bn_nobounds.jnl
+*** Running test: bn_write_integer_att.jnl
+*** Running test: bn_descriptor_mc.jnl
+*** Running test: bn_plot_color_only.jnl
+*** Running test: bn_vtree.jnl
+*** Running test: bn686_bug_fixes.jnl
+*** Running test: bn_long_symnames.jnl
+*** Running test: bn_strdim.jnl
+*** Running test: bn_single_colorlev.jnl
+*** Running test: bn69_bug_fixes.jnl
+*** Running test: bn_bad_axis_bounds.jnl
+*** Running test: bn_enter_exit_GO.jnl
+*** Running test: bn_stddev.jnl
+*** Running test: bn_set_axis_name.jnl
+*** Running test: bn_all_ef.jnl
+*** Running test: bn_startupfile.jnl
diff --git a/bench/test_results/flowlines.pdf b/bench/test_results/flowlines.pdf
new file mode 100644
index 0000000..51cce2d
Binary files /dev/null and b/bench/test_results/flowlines.pdf differ
diff --git a/bench/test_results/graticules.pdf b/bench/test_results/graticules.pdf
new file mode 100644
index 0000000..e17ef73
Binary files /dev/null and b/bench/test_results/graticules.pdf differ
diff --git a/bench/test_results/linecolors.pdf b/bench/test_results/linecolors.pdf
new file mode 100644
index 0000000..244a239
Binary files /dev/null and b/bench/test_results/linecolors.pdf differ
diff --git a/bench/test_results/multi_line_labels.pdf b/bench/test_results/multi_line_labels.pdf
new file mode 100644
index 0000000..e61391a
Binary files /dev/null and b/bench/test_results/multi_line_labels.pdf differ
diff --git a/bench/test_results/polygon_plot.pdf b/bench/test_results/polygon_plot.pdf
new file mode 100644
index 0000000..cd2547a
Binary files /dev/null and b/bench/test_results/polygon_plot.pdf differ
diff --git a/bench/test_results/pyferret_run_tests_err b/bench/test_results/pyferret_run_tests_err
new file mode 100644
index 0000000..417c5e3
--- /dev/null
+++ b/bench/test_results/pyferret_run_tests_err
@@ -0,0 +1,3546 @@
+Using FERRET /home/users/ksmith/PyFerret/bin/pyferret
+lrwxrwxrwx 1 ksmith tmap 11 Mar 31 17:25 /home/users/ksmith/PyFerret/bin/pyferret -> pyferret.sh
+Using external functions from /home/users/ksmith/PyFerret/ext_func/libs
+Benchmark run by ksmith
+Note: RUN_TESTS.sh test results for debug build of PyFerret on RHEL5-64
+Benchmark scripts that will be run:
+   bn_syntax.jnl
+   bn_dollar.jnl
+   bn_grave.jnl
+   bn_letd.jnl
+   bn_if.jnl
+   bn_expressions.jnl
+   bn_geometry.jnl
+   bn_output.jnl
+   bn_in_plane.jnl
+   bn_compress.jnl
+   bn_interpolate.jnl
+   bn_regrid.jnl
+   bn_ez.jnl
+   bn_plot.jnl
+   bn_curv.jnl
+   bn_symbols.jnl
+   bn_comma_delimited.jnl
+   bn_dynamic_grids.jnl
+   bn_cdf.jnl
+   bn_regrid_transforms.jnl
+   bn_axis_limits.jnl
+   bn_movie.jnl
+   bn_ez_order.jnl
+   bn_user.jnl
+   bn_stream.jnl
+   bn_mc.jnl
+   bn_negative_t.jnl
+   bn_xact_regrid.jnl
+   bn_gc_functions.jnl
+   bn491_bug_fixes.jnl
+   bn_odd_variable_name.jnl
+   bn_test_stream.jnl
+   bn_define_axes.jnl
+   bn_polygon.jnl
+   bn500_bug_fixes.jnl
+   bn_sample.jnl
+   bn_strides_revs_perms.jnl
+   bn_non_COARDS_netCDF.jnl
+   bn_cache_hits.jnl
+   bn_regrid_to_user.jnl
+   bn_calendar.jnl
+   bn_dash_dot.jnl
+   bn_flowlines.jnl
+   bn_logaxes.jnl
+   bn_internal_external_functions.jnl
+   bn_modulo_strides.jnl
+   bn_axis_viewports.jnl
+   bn_strings.jnl
+   bn_axcontrol.jnl
+   bn_vec_curv.jnl
+   bn_delimited_read.jnl
+   bn541_bug_fixes.jnl
+   bn_cancel_axes.jnl
+   bn542_bug_fixes.jnl
+   bn_subspan_modulo.jnl
+   bn_dots.jnl
+   bn_lev_symbols.jnl
+   bn_mode_logo_lab.jnl
+   bn_modulo_attribute.jnl
+   bn550_bug_fixes.jnl
+   bn551_bug_fixes.jnl
+   bn_multi_line_labels.jnl
+   bn552_bug_fixes.jnl
+   bn_set_var_scale_off.jnl
+   bn_longvarnames.jnl
+   bn_shakey.jnl
+   bn_eof_4d.jnl
+   bn_abstract_axis_names.jnl
+   bn_many_polygons.jnl
+   bn_fill_irregular.jnl
+   bn_xml_output.jnl
+   bn_test_nan.jnl
+   bn553_bug_fixes.jnl
+   bn_graticules.jnl
+   bn_repeat_range.jnl
+   bn554_bug_fixes.jnl
+   bn_bounds.jnl
+   bn_all_leap.jnl
+   bn570_bug_fixes.jnl
+   bn_modstats.jnl
+   bn_mc_vary_scale.jnl
+   bn_plot_nokey.jnl
+   bn580_bug_fixes.jnl
+   bn_inf_levels.jnl
+   bn_regulart.jnl
+   bn_labwid.jnl
+   bn_redefine_taxis_mc.jnl
+   bn_illegal_axisname.jnl
+   bn_exit_script.jnl
+   bn_exit_cycle.jnl
+   bn_curv_mod.jnl
+   bn_shade_keycont.jnl
+   bn581_bug_fixes.jnl
+   bn_tab_comma_multivar.jnl
+   bn_element_functions.jnl
+   bn_long_revision_num.jnl
+   bn_window_title.jnl
+   bn_last_error.jnl
+   bn_deg_min.jnl
+   bn_dp_readscale.jnl
+   bn_bounds_defineax.jnl
+   bn_attributes.jnl
+   bn_transforms.jnl
+   bn_variance.jnl
+   bn_linecolors.jnl
+   bn_cdf_errmsg.jnl
+   bn600_bug_fixes.jnl
+   bn601_bug_fixes.jnl
+   bn_set_strides.jnl
+   bn_lsl_lowpass.jnl
+   bn_return_xmod_tmod.jnl
+   bn602_bug_fixes.jnl
+   bn_modnbd.jnl
+   bn_fifty_files.jnl
+   bn603_bug_fixes.jnl
+   bn_set_var_name.jnl
+   bn_memory_symbol.jnl
+   bn605_bug_fixes.jnl
+   bn608_bug_fixes.jnl
+   bn_shade_trim.jnl
+   bn_mode_nlevels.jnl
+   bn61_bug_fixes.jnl
+   bn_test_opendap.jnl
+   bn611_bug_fixes.jnl
+   bn_no_valid_on_plot.jnl
+   bn_median.jnl
+   bn614_bug_fixes.jnl
+   bn_mode_nodata_lab.jnl
+   bn_proleptic_gregorian_calendar.jnl
+   bn_string_ngd_nbd.jnl
+   bn_cat_string.jnl
+   bn_sort_strings.jnl
+   bn_samplexyt.jnl
+   bn_last_go_file.jnl
+   bn_cancel_upcase_uservar.jnl
+   bn_cdf_keepax.jnl
+   bn_keep_axisnames.jnl
+   bn_key_label_minmax.jnl
+   bn62_bug_fixes.jnl
+   bn_convolve.jnl
+   bn_tax_tstep.jnl
+   bn_grads_z.jnl
+   bn_clock_syms.jnl
+   bn63_bug_fixes.jnl
+   bn_axis_reversed_syms.jnl
+   bn_isdepth.jnl
+   bn_var_hist_levels.jnl
+   bn64_bug_fixes.jnl
+   bn_long_grid_names.jnl
+   bn_xml_repl.jnl
+   bn65_bug_fixes.jnl
+   bn_txtype_dmy.jnl
+   bn_n_open_dsets_sym.jnl
+   bn_multi_decade.jnl
+   bn_show_xml_file.jnl
+   bn66_bug_fixes.jnl
+   bn_netcdf4.jnl
+   bn_scat2grid_bin.jnl
+   bn_axis_dir_symbols.jnl
+   bn663_bug_fixes.jnl
+   bn_set_axis_regular.jnl
+   bn_set_cancel_redirect.jnl
+   bn_min_max_smoothers.jnl
+   bn_vector_symbols.jnl
+   bn_variance_large.jnl
+   bn_labnum_calendar.jnl
+   bn665_bug_fixes.jnl
+   bn_floatstr.jnl
+   bn67_bug_fixes.jnl
+   bn_NaN_note.jnl
+   bn671_bug_fixes.jnl
+   bn68_bug_fixes.jnl
+   bn_ifv.jnl
+   bn_randu2_randn2.jnl
+   bn_axis_cf.jnl
+   bn_repeated_coords.jnl
+   bn_xml_header.jnl
+   bn_eof_simple.jnl
+   bn_eof_simple2.jnl
+   bn_interpolate_6d.jnl
+   bn_regrid_6d.jnl
+   bn_syntax_6d.jnl
+   bn_expressions_6d.jnl
+   bn_direction_fcns_6d.jnl
+   bn_regrid_transforms_6d.jnl
+   bn_aggregate_e.jnl
+   bn_6d_lab_mode.jnl
+   bn682_bug_fixes.jnl
+   bn683_bug_fixes.jnl
+   bn_outtype.jnl
+   bn_ribbon_plot.jnl
+   bn_descr_4digit.jnl
+   bn_axis_outtype.jnl
+   bn_axis_nonmonotonic.jnl
+   bn_vec_mod.jnl
+   bn685_bug_fixes.jnl
+   bn_dsg_e_x.jnl
+   bn_nco_append.jnl
+   bn_nobounds.jnl
+   bn_write_integer_att.jnl
+   bn_descriptor_mc.jnl
+   bn_plot_color_only.jnl
+   bn_vtree.jnl
+   bn686_bug_fixes.jnl
+   bn_long_symnames.jnl
+   bn_strdim.jnl
+   bn_single_colorlev.jnl
+   bn69_bug_fixes.jnl
+   bn_bad_axis_bounds.jnl
+   bn_enter_exit_GO.jnl
+   bn_stddev.jnl
+   bn_set_axis_name.jnl
+   bn_all_ef.jnl
+   bn_startupfile.jnl
+****** Restricting Ferret paths to bench directory ******
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/ksmith/Datasets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ksmith/PyFerret/ext_func/libs
+FER_FONTS=/home/users/ksmith/PyFerret/ppl/fonts
+FER_GO=. /home/users/ksmith/PyFerret/go /home/users/ksmith/PyFerret/examples /home/users/ksmith/PyFerret/contrib
+FER_GRIDS=.
+FER_LIBS=/home/users/ksmith/PyFerret/lib
+FER_PALETTE=. /home/users/ksmith/PyFerret/ppl
+FER_WEB_BROWSER=firefox
+Beginning at Mon Mar 31 17:26:16 PDT 2014
+*** Running test: bn_syntax.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+        SET EXPRESSION has not been given or implied
+        SET EXPRESSION has not been given or implied
+ **ERROR: unknown command qualifier: help
+MESSAGE/CONTINUE /help
+ **ERROR: unknown command: that
+that
+ **ERROR: command syntax: \!
+\! ignore (err cuz bang gets escaped)
+*** Running test: bn_dollar.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: Value needed for argument 3 in command
+          GO "bn_dollar.jnl" "hello"
+message/cont $3
+ **ERROR: my error message
+message/cont $3"<my error message"
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/cont $3">greetings|hello|goodbye<my error message"
+ **ERROR: my error message
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ **ERROR: command syntax: empty argument replacement string: $3""
+message/cont $3""
+ **ERROR: command syntax: empty text string provided with ">": <
+message/cont $3"<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"||"
+ *** NOTE: Valid argument $3 choices are: |
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>|"
+ *** NOTE: Valid argument $3 choices are: >|
+ **ERROR: command syntax: empty text string provided with ">": >|
+message/cont $3">|"
+ **ERROR: command syntax: empty text string provided with ">": |<
+message/cont $3"|<"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3"|>"
+ *** NOTE: Valid argument $3 choices are: >
+ **ERROR: command syntax: arg number not in 1-99 range: $100
+say $100
+ **ERROR: command syntax: arg number not in 1-99 range: $100)
+say ($100)
+ **ERROR: invalid command: Value needed for argument 10 in command
+          GO "bn_dollar.jnl" "hello"
+say ($10)0
+*** Running test: bn_grave.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: unpaired grave accents: message/continue "2+2=`2+2"
+message/continue "2+2=`2+2"
+ **ERROR: variable unknown or not in data set: GARBAGE
+message/continue "2+2=`garbage`"
+ **ERROR: invalid command: grave accent doesnt evaluate to scalar
+          I[i=3:5]
+message/continue "3 numbers: `I[i=3:5]`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3BAD=-999`"
+ **ERROR: command syntax: options: "P=prec","B=bad","W=width","ZW=zero-width" or "R=return-item"
+          message/continue "1/3=`1/3,qBAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE `2+2\`
+ **ERROR: command syntax: 2+2\
+          illegal character: \
+MESSAGE/CONTINUE `2+2\`+1`
+ **ERROR: command syntax: unpaired quotation marks, grave accent or brackets
+MESSAGE/CONTINUE \`2+2`+1\`
+ **ERROR: command syntax: 1*/3
+          * before / is illegal
+MESSAGE/CONTINUE `1*/3`
+ **ERROR: command syntax: sst*/3
+          * before / is illegal
+MESSAGE/CONTINUE `sst*/3,return=lunits`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=Xsize
+MESSAGE/CONTINUE `sst,return=Xsize`
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          sst,return=trash
+MESSAGE/CONTINUE `sst,return=trash`
+*** Running test: bn_letd.jnl
+ Cached data cleared from memory
+ **ERROR: unknown data set: NOEXIST
+DEFINE VARIABLE/d=noexist a = b
+ **ERROR: variable unknown or not in data set: AIRT[D=GT4D011]
+list/l=1/x=180/y=0 airt[d=gt4d011]
+ **ERROR: invalid command: CANCEL what?
+can var
+ LISTing to file v12file.nc
+ LISTing to file v1file.nc
+*** Running test: bn_if.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: ELSE can only be used between IF and ENDIF
+else
+ **ERROR: invalid command: ENDIF can only be used in an IF clause
+endif
+ **ERROR: invalid command: ELIF can only be used between IF and ENDIF
+elif
+*** Running test: bn_expressions.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+*** Running test: bn_geometry.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[I=1:5] - X[I=6:9]
+ **ERROR: inconsistent sizes of data regions: X axis
+          X[I=6:9] has 4 points (I=6:9)
+          expression has 5 points (I=1:5)
+LIST X[I=1:5] - X[I=6:9]
+*** Running test: bn_output.jnl
+ Cached data cleared from memory
+ LISTing to file WV.J34K56L7
+ LISTing to file test.dat
+ LISTing to file test.dat
+ LISTing to file test.unf
+ **ERROR: invalid subcommand: File type no longer supported TMA
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+*** Running test: bn_in_plane.jnl
+ Cached data cleared from memory
+*** Running test: bn_compress.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_interpolate.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+*** Running test: bn_ez.jnl
+ Cached data cleared from memory
+ LISTing to file test.unf
+*** Running test: bn_plot.jnl
+ Cached data cleared from memory
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j"
+plot/i=1:10/j=1:20/nolabel i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i,i+j"
+plot/i=1:10/j=1:20/nolabel i,i+j
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=1:10/j=1:20/nolabel i+j,i"
+plot/i=1:10/j=1:20/nolabel i+j,i
+ **ERROR: dimensions improperly specified: differing axes:
+          first line is on Y axis
+          line 2 is on X axis
+plot/i=1:10/j=1:20/nolabel j,i
+ **ERROR: dimensions improperly specified: unequal line lengths:
+          First expression has 20 points.
+          Expression 2 has 10 points:
+          "plot/i=1:10/j=1:20/vs/line/nolabel j,i"
+plot/i=1:10/j=1:20/vs/line/nolabel j,i
+ **ERROR: dimensions improperly specified: must be a 2D region
+          contour/i=1:10/j=1:20/nolabel i
+contour/i=1:10/j=1:20/nolabel i
+ **ERROR: invalid command: can only CONTOUR  single fields
+          Use /OVERLAY for multiple variables
+contour/i=1:10/j=1:20/nolabel i/j,j/i
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j
+ **ERROR: invalid command: VECTOR requires paired components
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j
+Re-defining viewport LM6
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport LM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+Re-defining viewport UM6
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: invalid command: color=noexist
+          Colors are Black, Red, Green, Blue, LightBlue, Purple, and White
+plot/over/i=1:10/color=noexist i
+ **ERROR: value out of legal range: thick=4
+          When color is not specified, only 1, 2, or 3 is acceptable
+plot/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: size=-1
+          Symbol size must be positive
+plot/over/i=1:10/size=-1 i
+ Using every   2th vector in the Y direction
+ **ERROR: invalid command: color=noexist
+          Colors are Black, Red, Green, Blue, LightBlue, Purple, and White
+cont/over/i=1:10/color=noexist i
+ *** NOTE: /THICKNESS ignored unless /COLOR (or /PEN) given
+ **ERROR: dimensions improperly specified: overlay not valid in plane of plot
+          cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/thick=4 i
+ **ERROR: value out of legal range: sigdig=-1
+          Value must be positive
+cont/over/i=1:10/sigdig=-1 i
+*** Running test: bn_curv.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+Replacing definition of axis LON_FIELD_I_AXIS
+Replacing definition of axis LON_FIELD_J_AXIS
+Replacing definition of axis LAT_FIELD_I_AXIS
+Replacing definition of axis LAT_FIELD_J_AXIS
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+Unable to delete drawing segments when writing directly to an image file
+ **ERROR: inconsistent sizes of data regions: Y coord field lies
+          in different plane from data to be plotted
+shade/nolabel sst, x_page, y_page
+ **ERROR: all data have same value: X coordinate field
+shade/nolabel sst, 0*x_page, y_page
+ **ERROR: all data have same value: Y coordinate field
+shade/nolabel sst, x_page, 0*y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ **ERROR: inconsistent sizes of data regions: Y axis of X position array
+shade/nolabel sst, x_page[j=1:12], y_page
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+*** Running test: bn_symbols.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: illegal name: TEST*
+define symbol test* = hello
+ **ERROR: invalid command: Value needed for argument 5 in command
+          GO bn_symbols.jnl
+define symbol t$5 = hi
+ **ERROR: error message
+message/continue ($test2"<error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: error message
+message/continue ($test2"|hello|bye|<error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+*** Running test: bn_comma_delimited.jnl
+ Cached data cleared from memory
+*** Running test: bn_dynamic_grids.jnl
+ Cached data cleared from memory
+ **ERROR: unknown defining grid: GX=NOEXIST
+list temp[gx=noexist]
+ **ERROR: command syntax: P=NOEXIST
+list temp[gx=u,p=noexist]
+ **ERROR: command syntax: multiple specifications on X axis
+          X=160E:160W
+list temp[gx=130e:80w:10,x=160e:160w]
+ **ERROR: command syntax: multiple specifications on X axis
+          I=2:5
+list temp[gx=130e:80w:10,i=2:5]
+ **ERROR: command syntax: used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)
+          GX=130E:80W:10
+list temp[i=2:5,gx=130e:80w:10]
+ **ERROR: command syntax: GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)
+          GX=130E:80W
+list temp[gx=130e:80w]
+ **ERROR: variable unknown or not in data set: NOEXIST
+list temp[gx=u]	+ noexist
+ **ERROR: illegal limits: TEMP on grid (G005) does not exist at K=30
+          Axis extremes are K=1:27
+list temp[gx=u,k=30]
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list temp[gx=u,k=20]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list temp[gx=psyu]
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYT
+list/i=3:6 X[gx=PSYT]
+ **ERROR: unknown defining grid: GX=NOEXIST
+list tu
+ **ERROR: command syntax: P=NOEXIST
+list tu
+ **ERROR: variable unknown or not in data set: NOEXIST
+list tu
+ **ERROR: illegal limits: TEMP on grid (G005) does not exist at K=30
+          Axis extremes are K=1:27
+list tu
+ **ERROR: illegal limits: TEMP does not contain K=20
+          Data are available in K =    1:2
+list tu
+ **ERROR: regridding: Axis orientation not matching request:GX=PSYU
+list tu
+ Cached data cleared from memory
+ **ERROR: request exceeds memory setting: 25 Mwords were requested.
+list temp[gz=z999999,z=5:15]
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+ Cached data cleared from memory
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+ *** NOTE: Ambiguous coordinates on X axis: TEMP[I=101:120:4]+X[I=101:120:4]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:-1]
+list x[i=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[I=1:5:0]
+list x[i=1:5:0]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:-1]
+list x[x=1:5:-1]
+ **ERROR: invalid command: non-positive delta value: X[X=1:5:0]
+list x[x=1:5:0]
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:11
+list a
+ **ERROR: illegal limits: A is not in the range J=46:50
+          Axis extremes are J=1:7
+list a
+ **ERROR: illegal limits: A is not in the range I=101:105
+          Axis extremes are I=1:8
+list a
+*** Running test: bn_cdf.jnl
+ Cached data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn_regrid_transforms.jnl
+ Cached data cleared from memory
+ **ERROR: regridding: G=W - more than 1 target grid
+load temp[g=u,g=w]
+ **ERROR: unknown defining grid: G=X --> g=user-or-pseudo-var not allowed
+load temp[g=x]
+*** Running test: bn_axis_limits.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+ **ERROR: command syntax: xlimits
+plot/xlimits i
+ **ERROR: command syntax: xlimits= i
+plot/xlimits= i
+ **ERROR: command syntax: xlimits=text
+plot/xlimits=text i
+ **ERROR: command syntax: xlimits=1
+plot/xlimits=1 i
+ **ERROR: command syntax: i
+plot/xlimits=1: i
+ **ERROR: command syntax: xlimits=1:: i
+plot/xlimits=1:: i
+ **ERROR: command syntax: i
+plot/xlimits=1:2: i
+ **ERROR: invalid command: Must give a range: xlimits=5:5
+plot/xlimits=5:5 i
+*** Running test: bn_movie.jnl
+ Cached data cleared from memory
+*** Running test: bn_ez_order.jnl
+ Cached data cleared from memory
+ LISTing to file test_perm10.dat
+ LISTing to file test_perm24.dat
+ LISTing to file test_perm48.dat
+ LISTing to file test_perm48_10.dat
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+ LISTing to file test_stream.unf
+*** Running test: bn_user.jnl
+ Cached data cleared from memory
+*** Running test: bn_stream.jnl
+ Cached data cleared from memory
+*** Running test: bn_mc.jnl
+ Cached data cleared from memory
+ **TMAP ERR: Attempt to access unsupported feature
+             Descriptor requests delta of 0, please use 1
+             Data set: ./coads_clim_bad_delta.des
+set data coads_clim_bad_delta.des
+ **TMAP ERR: error in line definition
+             A gap or overlap exists in time axis
+set data coads_clim_step_order.des
+ **TMAP ERR: non-existent or not on line
+             coads_clim.001b
+list sst
+*** Running test: bn_negative_t.jnl
+ Cached data cleared from memory
+ **ERROR: regridding: only @ASN regridding between calendar and
+          non-calendar axes: A
+LIST a[gt=tcal]
+*** Running test: bn_xact_regrid.jnl
+ Cached data cleared from memory
+*** Running test: bn_gc_functions.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+*** Running test: bn491_bug_fixes.jnl
+ Cached data cleared from memory
+ LISTing to file test.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_odd_variable_name.jnl
+ Cached data cleared from memory
+ Cached data cleared from memory
+ **ERROR: command syntax: v2-and-minus
+          - before and is illegal
+list v2-and-minus
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list x
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: dimensions improperly specified: 99999999 words were requested.
+list i
+ *** NOTE: Check for unspecified limits on an ABSTRACT axis
+ *** NOTE: Use the SHOW GRID command to see the axes
+ **ERROR: variable unknown or not in data set: 'i'
+list 'i'
+ **ERROR: command syntax: v2-and-minus[i=5:15 at ddc]
+          - before and is illegal
+list v2-and-minus[i=5:15 at ddc]
+ Cached data cleared from memory
+*** Running test: bn_test_stream.jnl
+ Cached data cleared from memory
+ LISTing to file permutedBinaryTest.dat
+ LISTing to file junk.dat
+ **ERROR: request exceeds memory setting: A negative number of words were requested.
+load num
+ *** NOTE: The current grid is most likely too large
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **ERROR: request exceeds memory setting: 1000 Mwords were requested.
+load num
+ *** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
+ *** NOTE: The "Memory use" section of the FERRET Users Guide has further tips.
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ **TMAP ERR: non-existent or not on line
+             NoSuchFile.dat
+SET DATA/EZ/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ **ERROR: Size of file ./junk.dat doesn't match size specified by variables/grid
+load num
+ *** NOTE: Binary file reading: Insufficient memory reading variable    2
+ **ERROR: invalid command: variable permutations only allowed for STREAM format
+SET DATA/EZ/var=num/order=vxyzt/grid=mygrid junk.dat
+ **ERROR: invalid command: invalid argument for /TYPE
+SET DATA/EZ/var=num/type=i3/grid=mygrid/form=stream junk.dat
+*** Running test: bn_define_axes.jnl
+ Cached data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/x=1:5/npoints=1 xax
+Replacing definition of axis XAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/x=5/npoints=1/edges xax
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: NPOINTS=1 incompatible with limits given
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: error in start,end,delta
+define axis/t=15-jan-1980/npoints=1/unit=days/edges tax
+Replacing definition of axis TAX
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ **ERROR: improper grid or axis definition: unrepairable repeated axis coords
+define axis/from/x/name=xax/edges {6,6,6}
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+Replacing definition of axis XAX
+Replacing definition of axis XAX2
+ *** NOTE: (fyi) units are not subject to auto-conversion: BLAHS
+Replacing definition of axis XAX2
+*** Running test: bn_polygon.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+*** Running test: bn500_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.cdf
+ LISTing to file out.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: noname(i)
+          unknown function "noname"
+stat i, noname(i)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_sample.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_strides_revs_perms.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ **ERROR: invalid command: delta values may only modify variable names
+LIST/i=2:4:2 VAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_non_COARDS_netCDF.jnl
+ Cached data cleared from memory
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+*** Running test: bn_cache_hits.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_to_user.jnl
+ Cached data cleared from memory
+Replacing definition of grid GG2
+ **ERROR: unknown defining grid: G=NO_EXIST
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]
+ **ERROR: unknown defining grid: GX=A[D=1]
+load/x=160e/y=5s v2
+*** Running test: bn_calendar.jnl
+ Cached data cleared from memory
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+Replacing definition of axis TWEEKS
+ LISTing to file calsst.cdf
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+Replacing definition of grid TGRID
+Replacing definition of axis TDAYS
+Replacing definition of grid TGRID
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+*** Running test: bn_dash_dot.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: dash=(1., 2.)
+          DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+ **ERROR: value out of legal range: dash=(-1., 2., 3., 4.)
+          DASH arguments must be positive
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+*** Running test: bn_flowlines.jnl
+ Cached data cleared from memory
+ Using every   2th vector in the Y direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ Using every   2th vector in the X direction
+ Using every   2th vector in the Y direction
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_logaxes.jnl
+ Cached data cleared from memory
+Replacing definition of axis DLOG
+Replacing definition of axis DLOG
+ **ERROR: value out of legal range: Limits for log axis negative or too small: -9.00 : 0.00
+plot/hlog fcn
+*** Running test: bn_internal_external_functions.jnl
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+
+Bailing out of external function "eof_space":
+	 Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE
+
+Bailing out of external function "eof_stat":
+	 Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT
+
+Bailing out of external function "eof_tfunc":
+	 Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis DAYT
+ **ERROR: error in external function
+LIST vw_fft
+Replacing definition of grid TGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: VWND does not contain L=102:150
+          Data are available in L =    1:60
+list tsorted_indices, tsorted_wnd
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/l=1:2 eofxyfcn
+ **ERROR: error in external function
+list/i=1:3/j=1:3 eofstat
+ **ERROR: error in external function
+list/i=1:2 eoftime
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: strindex("Ferret is fun for the whole family - real family fun")
+          The strindex function has an incorrect number of arguments
+list strindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: strrindex("Ferret is fun for the whole family - real family fun")
+          The strrindex function has an incorrect number of arguments
+list strrindex("Ferret is fun for the whole family - real family fun")
+ **ERROR: command syntax: substring("Have you fed your ferret today", 19)
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today", 19)
+ **ERROR: command syntax: substring("Have you fed your ferret today")
+          The substring function has an incorrect number of arguments
+list substring("Have you fed your ferret today")
+ **ERROR: command syntax: strcat ("All work and no play")
+          The strcat function has an incorrect number of arguments
+list strcat ("All work and no play")
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modulo_strides.jnl
+ Cached data cleared from memory
+ LISTing to file test_modulo.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_axis_viewports.jnl
+ Cached data cleared from memory
+Re-defining viewport MID
+Re-defining viewport MID2
+Re-defining viewport LLAX
+Re-defining viewport LRAX
+Re-defining viewport ULAX
+Re-defining viewport URAX
+*** Running test: bn_strings.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: "string2"}
+list e
+ **ERROR: command syntax: 5, "string2"}
+list e
+ **ERROR: illegal data type (float,string,...) for operation: D
+plot d
+ **ERROR: illegal data type (float,string,...) for operation: D
+define axis/x xax = d
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string.cdf
+ LISTing to file test_string2.cdf
+ **ERROR: invalid command: cant use this regrid transform on strings: @LIN
+list a[gx=xnrst]
+ **ERROR: invalid command: cant use this regrid transform on strings: @AVE
+list a[gx=xnrst at ave]
+ **ERROR: invalid command: cant use this regrid transform on strings: @VAR
+list a[gx=xnrst at var]
+ **ERROR: invalid command: cant use this regrid transform on strings: @NGD
+list a[gx=xnrst at ngd]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MAX
+list a[gx=xnrst at max]
+ **ERROR: invalid command: cant use this regrid transform on strings: @SUM
+list a[gx=xnrst at sum]
+ **ERROR: invalid command: cant use this regrid transform on strings: @MOD
+list a[gx=xnrst at mod]
+ LISTing to file foo.cdf
+*** Running test: bn_axcontrol.jnl
+ Cached data cleared from memory
+*** Running test: bn_vec_curv.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+*** Running test: bn_delimited_read.jnl
+ Cached data cleared from memory
+Replacing definition of axis TAX
+Replacing definition of grid G1
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: D
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="d, da2,date2"  bn_delimited_read_date_time.dat
+ **TMAP ERR: syntax error in string
+             Unrecognized field type: DATE2
+             Data set: ./bn_delimited_read_date_time.dat
+ *** NOTE: Valid types are: -,NUMERIC,TEXT,LATITUDE,LONGITUDE,DATE,EURODATE,TIME
+SET DATA/FORM=delimited/type="da,da, date2"  bn_delimited_read_date_time.dat
+ **ERROR: command syntax: ,,:
+SET DATA/EZ/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+*** Running test: bn541_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_good_order.cdf
+ LISTing to file test_bad_order.cdf
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis T2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file profiles.nc
+ LISTing to file profiles.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file test_100x100.nc
+ Cached data cleared from memory
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+sh: ncrename: command not found
+sh: ncrename: command not found
+sh: ncrename: command not found
+*** Running test: bn_cancel_axes.jnl
+ Cached data cleared from memory
+ LISTing to file longax.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+*** Running test: bn542_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.25 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./test_axes.nc ...
+ *** NOTE: Climatological axes test_irreg, test_seas defined
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G001)
+ *** NOTE: Not deleted: TEST_IRREG
+ *** NOTE: Axis is in use by grid (G001)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_subspan_modulo.jnl
+ Cached data cleared from memory
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ **ERROR: improper grid or axis definition: Axis length exceeds modulo length
+define axis/x=130e:500:10/modulo=360 xsub
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_mod.cdf
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ LISTing to file test_subspan_modulo.nc
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+*** Running test: bn_dots.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: /THICKNESS ignored  on /SYMBOL=DOT
+ *** NOTE: /SIZE= ignored  on /SYMBOL=DOT
+*** Running test: bn_lev_symbols.jnl
+ Cached data cleared from memory
+*** Running test: bn_mode_logo_lab.jnl
+ Cached data cleared from memory
+*** Running test: bn_modulo_attribute.jnl
+ Cached data cleared from memory
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+*** Running test: bn550_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn551_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport MID1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_multi_line_labels.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+*** Running test: bn552_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of contour levels > 500  (3283)
+CONTOUR/FILL/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of shade levels > 500  (3283)
+SHADE/L=1/LEV=0.01d sst
+ **ERROR: value out of legal range: # of levels > 500  (4094)
+POLYGON/KEY/LEV=0.01d/coord_ax=Z  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+rm: cannot remove `input.txt': No such file or directory
+ls: input.txt: No such file or directory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command:  use RETURN= shape,size,grid,title,bad,t0,units,dset,
+            dsetnum,dsetpath,dsettitle,*size,*start,*end,
+            *units,*axis,nc_scale,nc_offset,user_scale,user_offset,
+            calendar,dtype,xmod,tmod,status,isDepth,isReady
+          axy, return=xx
+MESSAGE/CONTINUE `axy, return=xx`
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+ LISTing to file a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file clim.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ **ERROR: illegal limits: "DUMMY" does not exist at T=01-JAN-1990 00:00
+          Axis extremes are T=31-DEC-1997 12:00:30-JAN-1998 12:00
+list/t=1-jan-1990 dummy
+*** Running test: bn_set_var_scale_off.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: Can SET VARIABLE/OFFSET= only with NetCDF datasets
+SET VAR/OFFSET=1 x1
+ **ERROR: invalid command: Can SET VARIABLE/SCALEFAC= only with NetCDF datasets
+SET VAR/SCALE=10 x2
+*** Running test: bn_longvarnames.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longvname.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_shakey.jnl
+ Cached data cleared from memory
+*** Running test: bn_eof_4d.jnl
+ Cached data cleared from memory
+ LISTing to file eofsp.cdf
+ LISTing to file eofti.cdf
+ LISTing to file eofst.cdf
+*** Running test: bn_abstract_axis_names.jnl
+ Cached data cleared from memory
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+ LISTing to file confuse_xz.nc
+ LISTing to file confuse_yz.nc
+ LISTing to file confuse_yt.nc
+ LISTing to file confuse_yzt.nc
+*** Running test: bn_many_polygons.jnl
+ Cached data cleared from memory
+Replacing definition of axis YQ
+*** Running test: bn_fill_irregular.jnl
+ Cached data cleared from memory
+*** Running test: bn_xml_output.jnl
+ Cached data cleared from memory
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHO VAR/XML
+SHOW VAR/XML
+SHOW VAR/XML
+*** Running test: bn_test_nan.jnl
+ Cached data cleared from memory
+*** Running test: bn553_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_graticules.jnl
+ Cached data cleared from memory
+ Using every   5th vector in the X direction
+ Using every   3th vector in the Y direction
+ Using every   2th vector in the X direction
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+Replacing definition of axis TAX
+*** Running test: bn_repeat_range.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+rep/name=a say `a`
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: command syntax: I is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/I=
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: j is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/j=
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: k is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/k=
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: X is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/X=
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: y is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/y=
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: z is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/z=
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+ **ERROR: command syntax: tbox is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+ **ERROR: command syntax: xboxlo is a pseudo-variable; cannot use with REPEAT/RANGE/NAME=
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+ **ERROR: command syntax: nested REPEAT loops with the same counter name a
+repeat/range=3:1:-1/name=a list a
+*** Running test: bn554_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: "TEMP" does not exist at T=01-AUG-1980 00:00:01-JAN-1982 00:00
+          Axis extremes are T=14-AUG-1982 11:00:13-JAN-1983 13:00
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+Replacing definition of axis TAX1
+Replacing definition of axis TAX2
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid AGRID
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Not using NetCDF strides for multi-cycle modulo
+ *** NOTE: Stride value not a factor of axis length
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X_AX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+*** Running test: bn_bounds.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+Replacing definition of axis TAX
+ *** NOTE: Axis definition error on axis: TAX
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+Replacing definition of axis TAX
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+ **ERROR: improper grid or axis definition: dimension of bounds (15) must be 2*N or N+1, N=number of axis coordinates (7)
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ **ERROR: improper grid or axis definition: BOUNDS specified do not correctly enclose coordinate points
+def axis/t/bounds tax= {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} , {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /RIGID Ignoring /RIGID
+ LISTing to file a.nc
+ *** NOTE: Cannot have both /BOUNDS and /EDGES Ignoring /EDGES
+ LISTing to file a.nc
+ LISTing to file irrxzt.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: MONTH_REG
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: Axis definition error on axis: TAX. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+*** Running test: bn_all_leap.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: Invalid calendar name. Names are, GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+*** Running test: bn570_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xlong.nc
+ LISTing to file xlongshift.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modstats.jnl
+ Cached data cleared from memory
+*** Running test: bn_mc_vary_scale.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_plot_nokey.jnl
+ Cached data cleared from memory
+*** Running test: bn580_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Re-defining viewport VP_1
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file fine.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal limits: One-point independent axis: Requires a /HLIMIT or /VLIMIT specification
+plot/sym/siz=0.3 0*t[gt=vwnd]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ LISTing to file aa.nc
+ LISTing to file cc.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: First argument is a letter of the alphabet
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+ **ERROR: invalid command: Valid value needed for argument $2
+query/ignore $2%|a|b|c|d|%
+ *** NOTE: Valid argument $2 choices are: a|b|c|d|
+ **ERROR: my error message
+message/cont $1"|xxxxx|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $1
+message/cont $1"greetings|xxxxx|goodbye"
+ *** NOTE: Valid argument $1 choices are: xxxxx|goodbye
+ **ERROR: my error message
+message/cont $3"|hello|goodbye<my error message"
+ **ERROR: invalid command: Valid value needed for argument $3
+message/cont $3">greetings|hello|goodbye"
+ *** NOTE: Valid argument $3 choices are: hello|goodbye
+ **ERROR: my error message
+message/continue ($test2"<my error message")
+ **ERROR: invalid command: Valid value needed for symbol test2
+message/continue ($test2"|hello|bye|")
+ *** NOTE: Valid symbol test2 choices are: hello|bye|
+ **ERROR: my error message
+message/continue ($test2"|hello|bye|<my error message")
+ **ERROR: invalid command: Valid value needed for symbol t2
+message/continue ($t2"|solong>really hello|bye|")
+ *** NOTE: Valid symbol t2 choices are: solong>really hello|bye|
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: delta non-positive on X axis of EX#1
+list/l=1/j=40/i=0:300:0 sst
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 10a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_inf_levels.jnl
+ Cached data cleared from memory
+*** Running test: bn_regulart.jnl
+ Cached data cleared from memory
+ *** NOTE: Evenly spaced axis has edges definition: TCOADS - ignored
+*** Running test: bn_labwid.jnl
+ Cached data cleared from memory
+*** Running test: bn_redefine_taxis_mc.jnl
+ Cached data cleared from memory
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis TIME1
+ *** NOTE: grid  used by data set coads_clim
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_illegal_axisname.jnl
+ Cached data cleared from memory
+Replacing definition of axis COADSX.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+Replacing definition of axis COADSY.ILLEGAL
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: grid  used by data set illeg_axname
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_exit_script.jnl
+ Cached data cleared from memory
+*** Running test: bn_exit_cycle.jnl
+ Cached data cleared from memory
+*** Running test: bn_curv_mod.jnl
+ Cached data cleared from memory
+*** Running test: bn_shade_keycont.jnl
+ Cached data cleared from memory
+*** Running test: bn581_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file longtitle.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 365.00 days
+ **ERROR: improper grid or axis definition: error in start,end,delta
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t0_cdc.nc
+ LISTing to file my_cdc_timeaxis.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_tab_comma_multivar.jnl
+ Cached data cleared from memory
+*** Running test: bn_element_functions.jnl
+ Cached data cleared from memory
+*** Running test: bn_long_revision_num.jnl
+ Cached data cleared from memory
+ LISTing to file revision.nc
+*** Running test: bn_window_title.jnl
+ Cached data cleared from memory
+*** Running test: bn_last_error.jnl
+
+Bailing out of external function "ffta":
+	 Time axis must be a regular axis
+ Cached data cleared from memory
+ **ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF I LT 5 THEN I ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3
+ **TMAP ERR: non-existent or not on line
+             nofile.nc
+set data nofile.nc
+ **ERROR: invalid command: REPEAT/NAME requires /RANGE
+repeat/name=a (say `a`)
+ **ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L=
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ **ERROR: error in external function
+LOAD vw_fft
+*** Running test: bn_deg_min.jnl
+ Cached data cleared from memory
+*** Running test: bn_dp_readscale.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_bounds_defineax.jnl
+ Cached data cleared from memory
+Replacing definition of axis TAX
+ LISTing to file irrxzt.nc
+Replacing definition of axis ZAX
+Replacing definition of axis ZAX2
+*** Running test: bn_attributes.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: SHOW ATTRIBUTE given with no argument
+sho att/all
+ **ERROR: unknown data set: d=2
+show att/all temp[d=2]
+ **ERROR: attribute undefined or invalid attribute name: salt.nonsense
+          attribute nonsense not found for variable SALT
+sho att salt.nonsense
+ **ERROR: invalid command: dataset not found for varname.attname .
+sho att/all .
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the value of attribute temp.missing_value
+ *** NOTE: Changing the value of attribute temp.missing_value
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSZT).positive
+ *** NOTE: Changing the type of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (coadsx).modulo
+ *** NOTE: Changing the value of attribute (TIME1).time_origin
+ **ERROR: command syntax: enclose coordinate variable name in parentheses
+list coadsx.units
+ **ERROR: variable unknown or not in data set: COADSX.UNITS
+list coadsx.units
+ **ERROR: invalid command: Cannot change attribute for direction of axis.
+set att (COADSX81_81).axis = "Z"
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the length  of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ *** NOTE: Changing the type of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.some_text
+ *** NOTE: Changing the value of attribute temp.long_name
+ *** NOTE: Changing the value of attribute temp.units
+ *** NOTE: Changing the type of attribute temp.pp
+ *** NOTE: Changing the value of attribute temp.pp
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (COADSX).point_spacing
+ *** NOTE: Changing the value of attribute (COADSY).point_spacing
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+LIST/FORMAT=CDF/file=a.nc/clobber/x=132w/k=1 temp
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=char broiled
+ **ERROR: unknown or invalid argument: Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE
+set var/outtype=garbage broiled
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (PSXT).units
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Changing the value of attribute (PSXT).units
+ *** NOTE: Changing the value of attribute (PSYT).units
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis X2AX
+ *** NOTE: Changing the value of attribute (z4ax).positive
+ LISTing to file string4d.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute (TIME).units
+ *** NOTE: Changing the value of attribute (TIME).units
+ *** NOTE: Changing the value of attribute (TIME).time_origin
+ *** NOTE: Changing the value of attribute (TIME).time_origin
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_transforms.jnl
+ Cached data cleared from memory
+*** Running test: bn_variance.jnl
+ Cached data cleared from memory
+*** Running test: bn_linecolors.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ Using every   3th vector in the X direction
+ Using every   4th vector in the Y direction
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+*** Running test: bn_cdf_errmsg.jnl
+syntax error, unexpected WORD_STRING, expecting WORD_WORD
+context: Error { code = 404; message = "data/PMEL/COADS/coads_nothing.cdf"^;};
+curl error details: 
+ Cached data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             this_is_not_a_file.nc
+SET DAT/FORM=CDF this_is_not_a_file.nc
+ **Internet Data error
+             NetCDF: Malformed or inaccessible DAP DDS (OPeNDAP/netCDF Error code -72)
+             Data set: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf
+SET DAT/FORM=CDF "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ **Internet Data error
+             NetCDF: I/O failure (OPeNDAP/netCDF Error code -68)
+             Data set: http://noserver/a/nofile.cdf
+SET DAT/FORM=CDF  "http://noserver/a/nofile.cdf"
+ LISTing to file asc.dat
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./asc.nc
+SET DAT/FORM=CDF asc.nc
+*** Running test: bn600_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file err581_subspanx_fill_bug.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xyir.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[x=@var,k=@var]
+ **ERROR: illegal use of transformation:  not all dimensions present on grid
+shade sst[t=@AVE,Z=@ave]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS  ... using 1/12 of 360.00 days
+ LISTing to file t3file.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 0000_a.nc
+ LISTing to file subdir/a.nc
+ LISTing to file subdir/0000_a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ LISTing to file a.nc
+ *** NOTE: cannot parse "units since date", date= "event"; leaving units string
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Invalid I axis limits ignored: TEMP
+ **ERROR: dimensions improperly specified: specified data is not a line
+           - its a 2D region: "plot/i=100/k=1 temp[x=122.5W]"
+plot/i=100/k=1 temp[x=122.5W]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XAX
+Replacing definition of axis XAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+*** Running test: bn601_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+Replacing definition of axis TIME4
+ *** NOTE: grid  used by data set coads_climatology
+ *** NOTE: Redefinition may alter apparent contents of data set
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file t2.nc
+ LISTing to file t12.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file out.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_strides.jnl
+ Cached data cleared from memory
+ **ERROR: invalid command: it is a child axis already
+set axis/stride=2/offset=1 (AX005)
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ **ERROR: invalid command: offset must be less than stride value
+set axis/stride=2/offset=4 COADSX
+ **ERROR: invalid command: not a strided axis: COADSX
+cancel axis/stride COADSX
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ LISTing to file d2.nc
+ *** NOTE: Stride value not an integer factor of axis length: Axis loses modulo property
+ **ERROR: invalid command: unknown axis: NORMAL
+set axis/stride=2 NORMAL
+*** Running test: bn_lsl_lowpass.jnl
+ Cached data cleared from memory
+*** Running test: bn_return_xmod_tmod.jnl
+ Cached data cleared from memory
+*** Running test: bn602_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file noleap.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file tripolar_missing_lon.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_modnbd.jnl
+ Cached data cleared from memory
+*** Running test: bn_fifty_files.jnl
+ Cached data cleared from memory
+ *** NOTE: Ignored modulo length exceeding axis length: LONGITUDE
+ *** NOTE: Axis has repeated values -- micro-adjusting TIME
+ *** NOTE: Error in bounds "TAX_bnds" or bounds do not enclose point on axis TAX
+ *** NOTE: Substituting coordinate midpoints
+ *** NOTE: calendar attribute on axis "TIME" is not recognized: BADNAME
+ *** NOTE: Valid calendars are GREGORIAN NOLEAP    JULIAN    360_DAY   ALL_LEAP
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable lon_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Undecipherable value of netCDF attribute modulo on variable time_moderr
+ *** NOTE: modulo = "j"
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ *** NOTE: Units on axis "ALTITUDE" are not recognized: Pa
+ *** NOTE: They will not be convertible:
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ *** NOTE: Coordinates out of order or missing on axis UNORDERED_AXIS at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Coordinates out of order or missing on axis GAPPY_AXIS at subscript 3
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis BACKWARDS_AXIS
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn603_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_var_name.jnl
+ Cached data cleared from memory
+*** Running test: bn_memory_symbol.jnl
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+ Cached data cleared from memory
+*** Running test: bn605_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn608_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: "300": Number of contour levels must be between 1 and 250
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+*** Running test: bn_shade_trim.jnl
+ Cached data cleared from memory
+*** Running test: bn_mode_nlevels.jnl
+ Cached data cleared from memory
+*** Running test: bn61_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_test_opendap.jnl
+curl error details: 
+ Cached data cleared from memory
+*** Running test: bn611_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file z1.nc
+ LISTing to file z2.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+*** Running test: bn_no_valid_on_plot.jnl
+ Cached data cleared from memory
+ Using every   5th vector in the X direction
+*** Running test: bn_median.jnl
+ Cached data cleared from memory
+ **ERROR: value out of legal range: Median smoother length must be odd
+plot/trans var, var[z=@med:4]
+*** Running test: bn614_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TIME
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file b.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file 1a.dat
+ LISTing to file 3a.dat
+ LISTing to file 5a.dat
+ LISTing to file 7a.dat
+ LISTing to file 9a.dat
+ LISTing to file 11a.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: variable unknown or not in data set: A_REGRID[D=1,GT=B[D=2]@MOD]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file dat.dat
+ LISTing to file a.nc
+ LISTing to file unf.dat
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file lonlat.dat
+ LISTing to file lonlat.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file b.nc
+*** Running test: bn_mode_nodata_lab.jnl
+ Cached data cleared from memory
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+ Cached data cleared from memory
+*** Running test: bn_string_ngd_nbd.jnl
+ Cached data cleared from memory
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+Replacing definition of axis XAX
+Replacing definition of axis YAX
+Replacing definition of axis ZAX
+Replacing definition of axis TAX
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+ *** NOTE: @NBD of string variable, counting null strings as missing
+ *** NOTE: @NGD of string variable, counting null strings as missing
+*** Running test: bn_cat_string.jnl
+ Cached data cleared from memory
+*** Running test: bn_sort_strings.jnl
+ Cached data cleared from memory
+*** Running test: bn_samplexyt.jnl
+ Cached data cleared from memory
+ *** NOTE: /XLIMITS and /YLIMITS are deprecated.
+ *** NOTE: Use /HLIMITS and /VLIMITS instead.
+*** Running test: bn_last_go_file.jnl
+ Cached data cleared from memory
+*** Running test: bn_cancel_upcase_uservar.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_cdf_keepax.jnl
+ Cached data cleared from memory
+ LISTing to file test0a.cdf
+ LISTing to file test0b.cdf
+ LISTing to file test0c.cdf
+ LISTing to file test0d.cdf
+ LISTing to file test0e.cdf
+ LISTing to file test0f.cdf
+ LISTing to file test0g.cdf
+ LISTing to file test0h.cdf
+ LISTing to file test0i.cdf
+ LISTing to file test0j.cdf
+ LISTing to file test0k.cdf
+ LISTing to file test0l.cdf
+ LISTing to file test0m.cdf
+ LISTing to file test0n.cdf
+ LISTing to file test0o.cdf
+ LISTing to file test0p.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ *** NOTE: Appending to NetCDF record axis which has no bounds attribute.
+ *** NOTE: This will result in incorrect box sizes on record axis: TCENTURY
+ *** NOTE: Write the data initially with the /BOUNDS qualifier
+ LISTing to file test2.cdf
+ LISTing to file FL.cdf
+ LISTing to file FTLON.cdf
+ **ERROR: invalid command: /CLOBBER not specified and file exists: test_abs.cdf
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l
+ LISTing to file test_abs.cdf
+ **TMAP ERR: Requested data range is outside of data set limits
+             inconsistent I axis length for IL
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il
+ LISTing to file test_abs.cdf
+ LISTing to file test_abs.cdf
+ **TMAP ERR: attempt to redefine line
+             # of dims in variable IJL2 is inconsist. w/ CDF file
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2
+ **ERROR: variable unknown or not in data set: IJKL[K=@AVE]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]
+ LISTing to file test_abs.cdf
+ **TMAP ERR: error in line definition
+             disordered output coordinate value:         363  Axis: TCENTURY
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1
+ LISTing to file FI.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ *** NOTE: /KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.
+ LISTing to file test_fil0.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSYT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSZT doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+ LISTing to file test_fil.cdf
+ *** NOTE: Writing a subset of data with original axis names
+ *** NOTE:   Axis was already written with a different set of coordinates
+ **TMAP ERR: attempt to redefine line
+             axis PSXU doesnt match CDF file
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ **ERROR: variable unknown or not in data set: IJKL
+show grid ijkl
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Y1010_REV
+*** Running test: bn_keep_axisnames.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_key_label_minmax.jnl
+ Cached data cleared from memory
+*** Running test: bn62_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_convolve.jnl
+ Cached data cleared from memory
+*** Running test: bn_tax_tstep.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis TSEC
+*** Running test: bn_grads_z.jnl
+ Cached data cleared from memory
+Replacing definition of axis CAXIS
+ *** NOTE: grid  used by data set grads_bug_file
+ *** NOTE: Redefinition may alter apparent contents of data set
+*** Running test: bn_clock_syms.jnl
+ Cached data cleared from memory
+*** Running test: bn63_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis ZAXLEVITR
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file xz.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file t_bug.nc
+Replacing definition of axis T_AXIS
+ LISTing to file t_bug.nc
+NetCDF: Variable not found (OPeNDAP/netCDF Error code -49)
+ T_AXIS_bnds not found. Attempt to append irregular coordinates to NetCDF axis which has no bounds attribute. Write data originally with the /BOUNDS qualifier.
+LIST/FORMAT=CDF/FILE=t_bug.nc/APPEND var
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: offset must be greater than or equal to zero
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ **ERROR: invalid command: stride must be greater than zero
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_reversed_syms.jnl
+ Cached data cleared from memory
+*** Running test: bn_isdepth.jnl
+ Cached data cleared from memory
+*** Running test: bn_var_hist_levels.jnl
+ Cached data cleared from memory
+*** Running test: bn64_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_long_grid_names.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of grid GG123456789012345678902
+ **ERROR: unknown defining grid: G=NO_EXIST12345678901234567890
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_xml_repl.jnl
+ Cached data cleared from memory
+ *** NOTE: Changing the value of attribute sst.history
+*** Running test: bn65_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ LISTing to file mypack.nc
+ *** NOTE: LON1_15: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: LAT1800_1800: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: ENS: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: TIME: Writing scaled coordinates not implemented. Suggest using nco operators on output file to pack coord values
+ *** NOTE: Units on axis "ENS" are not recognized: count
+ *** NOTE: They will not be convertible:
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAX
+*** Running test: bn_txtype_dmy.jnl
+ Cached data cleared from memory
+*** Running test: bn_n_open_dsets_sym.jnl
+ Cached data cleared from memory
+ LISTing to file list_of_numbers.dat
+*** Running test: bn_multi_decade.jnl
+ Cached data cleared from memory
+Re-defining viewport V1
+Re-defining viewport V2
+Re-defining viewport V3
+Re-defining viewport V4
+Re-defining viewport V5
+Re-defining viewport V6
+Re-defining viewport V7
+Re-defining viewport V8
+*** Running test: bn_show_xml_file.jnl
+ Cached data cleared from memory
+ LISTing to file dummy.dat
+*** Running test: bn66_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_netcdf4.jnl
+ Cached data cleared from memory
+ Restoring default chunk cache settings
+ Restoring default chunk cache settings
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4.nc
+ *** NOTE: NetCDF Classic style cannot set compression, ignoring /DEFLATE
+ *** NOTE: NetCDF Classic style cannot set chunking, ignoring /*CHUNK
+ LISTing to file nc4_nodeflate3.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_deflate4bigchunk.nc
+ LISTing to file nc4_nodeflate3.nc
+ LISTing to file nc4_deflate4_xyt.nc
+ LISTing to file nc4_deflate4_defaultchunk.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file nc4_inttemp_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_shuffle_set_list_deflate_chunk.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_inttemp_set_classic.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_INT
+ LISTing to file nc4_deflate4_t1.nc
+ **TMAP ERR: syntax error in string
+             If ChunkSize is set for any dimension of var, must set for all its dimensions
+LIST/FORMAT=CDF/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ LISTing to file nc4_deflate4bigchunk.nc
+ **TMAP ERR: error specifying chunk sizes
+             TChunkSize 0 is larger than dimension length 3
+LIST/FORMAT=CDF/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+*** Running test: bn_scat2grid_bin.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_dir_symbols.jnl
+ Cached data cleared from memory
+*** Running test: bn663_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_set_axis_regular.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX
+ *** NOTE: Axis is already regular: MYX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis reset to be regular (evenly-spaced): MYX1
+*** Running test: bn_set_cancel_redirect.jnl
+ Cached data cleared from memory
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: No active redirects to cancel
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: Axis is already regular: MYAXIS
+ **ERROR: variable unknown or not in data set: GARBAGE
+show grid garbage
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ *** NOTE: stderr is not redirected
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+ Use the GO command to name a file of FERRET commands to be executed.
+     e.g.   yes? GO filename
+ 
+ Use "GO/HELP filename" to read documentation in  the file to be executed.
+*** Running test: bn_min_max_smoothers.jnl
+ Cached data cleared from memory
+*** Running test: bn_vector_symbols.jnl
+ Cached data cleared from memory
+ Using every   8th vector in the X direction
+ Using every   7th vector in the Y direction
+*** Running test: bn_variance_large.jnl
+ Cached data cleared from memory
+*** Running test: bn_labnum_calendar.jnl
+ Cached data cleared from memory
+*** Running test: bn665_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_floatstr.jnl
+ Cached data cleared from memory
+*** Running test: bn67_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis YAX
+Replacing definition of axis YAX
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb [...]
+ *** NOTE: exceeds expected length. Maximum characters: 2048
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1.E+10
+ **ERROR: value out of legal range: illegal mode argument. Negative or > 1.e+9,
+set mode desperate 1234567890123456789
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file g.nc
+Replacing definition of axis YAX_DUP_AXNAMES
+ LISTing to file h.nc
+ LISTing to file gh.nc
+ LISTing to file justh.nc
+ LISTing to file justg.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_NaN_note.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: No missing_value or _FillValue attribute. Using NaN for variable: broiled
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis l
+*** Running test: bn671_bug_fixes.jnl
+
+Bailing out of external function "tax_year":
+	 Function not valid for modulo time axis
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: error in external function
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file cc.nc
+ LISTing to file c1.nc
+ TEMPORARY data cleared from memory
+ LISTing to file c2.nc
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis lev
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn68_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis TAXIS
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.030, to avoid running off page.
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis RLATU79_961_9
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: illegal name, matches an operator: AND
+DEFINE VARIABLE AND = 5
+ **ERROR: command syntax: illegal name, matches an operator: OR
+DEFINE VARIABLE OR = 5
+ **ERROR: command syntax: illegal name, matches an operator: GT
+DEFINE VARIABLE GT = 5
+ **ERROR: command syntax: illegal name, matches an operator: GE
+DEFINE VARIABLE GE = 5
+ **ERROR: command syntax: illegal name, matches an operator: LT
+DEFINE VARIABLE LT = 5
+ **ERROR: command syntax: illegal name, matches an operator: LE
+DEFINE VARIABLE LE = 5
+ **ERROR: command syntax: illegal name, matches an operator: EQ
+DEFINE VARIABLE EQ = 5
+ **ERROR: command syntax: illegal name, matches an operator: NE
+DEFINE VARIABLE NE = 5
+ **ERROR: command syntax: illegal name, matches an operator: IF
+DEFINE VARIABLE IF  = 5
+ **ERROR: command syntax: illegal name, matches an operator: ELSE
+DEFINE VARIABLE ELSE = 5
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a1.nc
+ LISTing to file a2.nc
+*** Running test: bn_ifv.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333
+ **ERROR: command syntax: ifv I LT 5 THEN I ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = ifv I LT 5 THEN I ELSE -9
+*** Running test: bn_randu2_randn2.jnl
+ Cached data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_axis_cf.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_repeated_coords.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis has repeated values -- micro-adjusting TMIN
+ *** NOTE: Coordinates out of order or missing on axis TMIN at subscript 4
+ *** NOTE: A dummy axis of subscripts will be used
+ *** NOTE: Axis has repeated values -- micro-adjusting ...
+*** Running test: bn_xml_header.jnl
+ Cached data cleared from memory
+*** Running test: bn_eof_simple.jnl
+
+Bailing out of external function "eofsvd_stat":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_space":
+	There are no spatial locations having complete time series.
+
+Bailing out of external function "eofsvd_tfunc":
+	There are no spatial locations having complete time series.
+ Cached data cleared from memory
+Replacing definition of axis XAXIS
+ **ERROR: error in external function
+list eofsvd_stat(spacegap)
+ **ERROR: error in external function
+list eofsvd_space(spacegap)
+ **ERROR: error in external function
+list eofsvd_tfunc(spacegap)
+*** Running test: bn_eof_simple2.jnl
+ Cached data cleared from memory
+*** Running test: bn_interpolate_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_6d.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis XFINE
+Replacing definition of axis XCOARSE
+Replacing definition of axis YFINE
+Replacing definition of axis YCOARSE
+Replacing definition of grid G24
+*** Running test: bn_syntax_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_expressions_6d.jnl
+ Cached data cleared from memory
+ **ERROR: command syntax: IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+          Cannot use multiple IFs in an expression
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333
+ **ERROR: command syntax: IF _m LT 5 THEN _m ELSE -9
+          ELSE before - is illegal
+          negative constants need to be enclosed in parentheses
+DEFINE VARIABLE A = IF _m LT 5 THEN _m ELSE -9
+ **ERROR: variable unknown or not in data set: A1
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+*** Running test: bn_direction_fcns_6d.jnl
+ Cached data cleared from memory
+*** Running test: bn_regrid_transforms_6d.jnl
+ Cached data cleared from memory
+Replacing definition of axis FAX4DAY
+*** Running test: bn_aggregate_e.jnl
+ Cached data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ **ERROR: unknown data set: dset 3 unknown or is already an aggregate dataset
+define data/agg windy = 1,2,3
+ **ERROR: error defining aggregate dataset: Aggregate dataset not defined
+define data/agg windy = 1,2,3
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: UWND
+ *** NOTE: Exclude variable from aggregate. Grid differs in member datasets: VWND
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables.
+define data/agg windy = 1,2
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: SPEH
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: UIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: VIN
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: AIRT
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets:
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 5
+ *** NOTE: Cancel aggregate dataset. Un-hiding hidden member datasets
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 6
+ *** NOTE: Dataset 2 was a member of an ensemble. Canceling ensemble, dataset 7
+*** Running test: bn_6d_lab_mode.jnl
+ Cached data cleared from memory
+*** Running test: bn682_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn683_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Adjusting Y-axis label size from 0.100 to 0.001, to avoid running off page.
+ *** NOTE: /home/users/ksmith/PyFerret/go/magnify.jnl
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./.
+SET DAT/FORM=CDF ./z1.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_outtype.jnl
+ Cached data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+*** Running test: bn_ribbon_plot.jnl
+ Cached data cleared from memory
+*** Running test: bn_descr_4digit.jnl
+ Cached data cleared from memory
+*** Running test: bn_axis_outtype.jnl
+ Cached data cleared from memory
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ *** NOTE: Converting data type of missing_value NC_FLOAT to match output type of variable NC_DOUBLE
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/L=32875000:32875201/clobber/file=mytype.nc tt
+ LISTing to file mytype.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ failure writing to CDF output file
+LIST/FORMAT=CDF/clobber/file=mytype.nc my_data
+ LISTing to file mytype.nc
+*** Running test: bn_axis_nonmonotonic.jnl
+ Cached data cleared from memory
+ **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index 12
+define axis/t/units=days tax = tvar
+*** Running test: bn_vec_mod.jnl
+ Cached data cleared from memory
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+ Using every   9th vector in the X direction
+*** Running test: bn685_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file aa.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+ LISTing to file aa.nc
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute missing_value not representable in output type NC_INT
+NetCDF: Numeric conversion not representable (OPeNDAP/netCDF Error code -60)
+ data in attribute _FillValue not representable in output type NC_INT
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: .HELLO
+list .hello
+ **ERROR: variable unknown or not in data set: A.UNITS
+ 
+list a.units
+ **ERROR: variable unknown or not in data set: A.UNITS
+list a.units
+ **ERROR: attribute undefined or invalid attribute name: ..HISTORY
+          attribute HISTORY not found for dataset
+list ..history
+ **ERROR: variable unknown or not in data set: ..HISTORY
+list ..history
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+Replacing definition of axis AXI
+Replacing definition of axis AXI_COARSE
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: unrepairable repeated axis coords on axis trdim at subscript 2
+ *** NOTE: A dummy axis of subscripts will be used
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file sst_new.nc
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_dsg_e_x.jnl
+ Cached data cleared from memory
+*** Running test: bn_nco_append.jnl
+sh: ncks: command not found
+ Cached data cleared from memory
+ LISTing to file append_to_this.nc
+*** Running test: bn_nobounds.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ *** NOTE: Axis definition error on axis: TGAP
+ *** NOTE: Bounds given describe non-contiguous axis cells
+ *** NOTE: Using the LOWER bound specified for each axis cell
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_write_integer_att.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+*** Running test: bn_descriptor_mc.jnl
+ Cached data cleared from memory
+*** Running test: bn_plot_color_only.jnl
+ Cached data cleared from memory
+ *** NOTE: New # of line colors will take effect on next new window: SET WIN/NEW then define pen colors
+ *** NOTE: New number of line colors will take effect on next new window: SET WIN/NEW or SET WIN/CLEAR
+ **ERROR: command syntax: COLOR
+          /COLOR must have an argument for PLOT/OVERLAY
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ **ERROR: command syntax: COLOR
+          /COLOR not valid for PLOT/LEVELS ribbon plot
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+*** Running test: bn_vtree.jnl
+ Cached data cleared from memory
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVX
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ *** NOTE: Exclude variable from aggregate. Does not appear in all member datasets: FVZ
+ **ERROR: illegal limits: X axis limits don't match variable def'n: A
+          Are you giving explicit limits when SET REGION would suffice ?
+list f
+*** Running test: bn686_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute a.ival
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **TMAP ERR: non-existent or not on line
+             nosuchfile.nc
+SET DAT/FORM=CDF nosuchfile.nc
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for nosuchfile(.nc ,.cdf,.des)
+SET DAT/FORM=CDF nosuchfile
+ **TMAP ERR: non-existent or not on line
+             Searched $FER_DESCR and $FER_DATA for snoopy(.nc ,.cdf,.des)
+SET DAT/FORM=CDF snoopy
+ **netCDF error
+             NetCDF: Unknown file format (OPeNDAP/netCDF Error code -51)
+             Data set: ./snoopy.dat
+SET DAT/FORM=CDF snoopy.dat
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: regarding ./climatological_axes.cdf ...
+ *** NOTE: Climatological axes SEASONAL_REG, MONTH_REG, and MONTH_IRREG defined
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_long_symnames.jnl
+ Cached data cleared from memory
+*** Running test: bn_strdim.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+*** Running test: bn_single_colorlev.jnl
+ Cached data cleared from memory
+*** Running test: bn69_bug_fixes.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ LISTing to file a.nc
+Replacing definition of axis XAXIS_TEST
+ LISTing to file b.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file c.nc
+ LISTing to file nc
+ **TMAP ERR: error in line definition
+             file coords dont match variable coords on axis XAXIS_TEST
+LIST/FORMAT=CDF/clobber/keep/file=nc b,a[d=1]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: dimensions improperly specified: must be a 2D region
+          shade b
+shade b
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ *** NOTE: Changing the value of attribute v1.long_name
+ *** NOTE: Changing the value of attribute v1.units
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: attribute undefined or invalid attribute name: temp.noexist[d=levitus_climatology]
+          attribute noexist not found for variable TEMP
+show att temp.noexist[d=levitus_climatology]
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: invalid command: illegal new name.  Variable b already defined
+set var/name=b a
+ **ERROR: invalid command: illegal new name.  Variable temp exists in dataset
+set var/name=temp salt
+ **ERROR: invalid command: illegal new name.  Variable psi exists in dataset
+set var/name=psi myvar
+*** Running test: bn_bad_axis_bounds.jnl
+ Cached data cleared from memory
+ *** NOTE: Axis definition error on axis: MONTH_IRREG. Bounds describe cells that overlap one another
+ *** NOTE: Error in bounds "MONTH_IRREG_bnds" or bounds do not enclose point on axis MONTH_IRREG
+ *** NOTE: Substituting coordinate midpoints
+*** Running test: bn_enter_exit_GO.jnl
+ Cached data cleared from memory
+*** Running test: bn_stddev.jnl
+ Cached data cleared from memory
+*** Running test: bn_set_axis_name.jnl
+ Cached data cleared from memory
+ LISTing to file a.nc
+ LISTing to file a.nc
+ LISTing to file b.nc
+ LISTing to file c.nc
+ **ERROR: invalid command: illegal new name. Axis days2000 is already defined
+set axis/name=days2000 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis
+set axis/name x_in_meters
+ **ERROR: invalid command: illegal new name given for axis 45
+set axis/name=45 x_in_meters
+ **ERROR: invalid command: illegal new name given for axis .fr
+set axis/name=.fr x_in_meters
+*** Running test: bn_all_ef.jnl
+ Cached data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: unknown region name: @w
+set region/@w
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ **ERROR: command syntax: writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+          unknown function "writev5d"
+DEFINE VARIABLE/QUIET vflag = writev5d(tr, 0, 0, 0, 0, 0, 0, 0, "vis5d_out.v5d")
+ **ERROR: variable unknown or not in data set: VFLAG
+LOAD/TEMPORARY vflag
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+ PERMANENT data cleared from memory
+ TEMPORARY data cleared from memory
+*** Running test: bn_startupfile.jnl
+ Cached data cleared from memory
+ *** NOTE: the use of "SET MODE METAFILE" is deprecated;
+ *** NOTE: instead use "FRAME /FILE=... /FORMAT=..."
+Ended at Mon Mar 31 17:30:10 PDT 2014
diff --git a/bench/test_results/pyferret_run_tests_log b/bench/test_results/pyferret_run_tests_log
new file mode 100644
index 0000000..3cb29ca
--- /dev/null
+++ b/bench/test_results/pyferret_run_tests_log
@@ -0,0 +1,75902 @@
+Using FERRET /home/users/ksmith/PyFerret/bin/pyferret
+lrwxrwxrwx 1 ksmith tmap 11 Mar 31 17:25 /home/users/ksmith/PyFerret/bin/pyferret -> pyferret.sh
+Using external functions from /home/users/ksmith/PyFerret/ext_func/libs
+Benchmark run by ksmith
+Note: RUN_TESTS.sh test results for debug build of PyFerret on RHEL5-64
+Benchmark scripts that will be run:
+   bn_syntax.jnl
+   bn_dollar.jnl
+   bn_grave.jnl
+   bn_letd.jnl
+   bn_if.jnl
+   bn_expressions.jnl
+   bn_geometry.jnl
+   bn_output.jnl
+   bn_in_plane.jnl
+   bn_compress.jnl
+   bn_interpolate.jnl
+   bn_regrid.jnl
+   bn_ez.jnl
+   bn_plot.jnl
+   bn_curv.jnl
+   bn_symbols.jnl
+   bn_comma_delimited.jnl
+   bn_dynamic_grids.jnl
+   bn_cdf.jnl
+   bn_regrid_transforms.jnl
+   bn_axis_limits.jnl
+   bn_movie.jnl
+   bn_ez_order.jnl
+   bn_user.jnl
+   bn_stream.jnl
+   bn_mc.jnl
+   bn_negative_t.jnl
+   bn_xact_regrid.jnl
+   bn_gc_functions.jnl
+   bn491_bug_fixes.jnl
+   bn_odd_variable_name.jnl
+   bn_test_stream.jnl
+   bn_define_axes.jnl
+   bn_polygon.jnl
+   bn500_bug_fixes.jnl
+   bn_sample.jnl
+   bn_strides_revs_perms.jnl
+   bn_non_COARDS_netCDF.jnl
+   bn_cache_hits.jnl
+   bn_regrid_to_user.jnl
+   bn_calendar.jnl
+   bn_dash_dot.jnl
+   bn_flowlines.jnl
+   bn_logaxes.jnl
+   bn_internal_external_functions.jnl
+   bn_modulo_strides.jnl
+   bn_axis_viewports.jnl
+   bn_strings.jnl
+   bn_axcontrol.jnl
+   bn_vec_curv.jnl
+   bn_delimited_read.jnl
+   bn541_bug_fixes.jnl
+   bn_cancel_axes.jnl
+   bn542_bug_fixes.jnl
+   bn_subspan_modulo.jnl
+   bn_dots.jnl
+   bn_lev_symbols.jnl
+   bn_mode_logo_lab.jnl
+   bn_modulo_attribute.jnl
+   bn550_bug_fixes.jnl
+   bn551_bug_fixes.jnl
+   bn_multi_line_labels.jnl
+   bn552_bug_fixes.jnl
+   bn_set_var_scale_off.jnl
+   bn_longvarnames.jnl
+   bn_shakey.jnl
+   bn_eof_4d.jnl
+   bn_abstract_axis_names.jnl
+   bn_many_polygons.jnl
+   bn_fill_irregular.jnl
+   bn_xml_output.jnl
+   bn_test_nan.jnl
+   bn553_bug_fixes.jnl
+   bn_graticules.jnl
+   bn_repeat_range.jnl
+   bn554_bug_fixes.jnl
+   bn_bounds.jnl
+   bn_all_leap.jnl
+   bn570_bug_fixes.jnl
+   bn_modstats.jnl
+   bn_mc_vary_scale.jnl
+   bn_plot_nokey.jnl
+   bn580_bug_fixes.jnl
+   bn_inf_levels.jnl
+   bn_regulart.jnl
+   bn_labwid.jnl
+   bn_redefine_taxis_mc.jnl
+   bn_illegal_axisname.jnl
+   bn_exit_script.jnl
+   bn_exit_cycle.jnl
+   bn_curv_mod.jnl
+   bn_shade_keycont.jnl
+   bn581_bug_fixes.jnl
+   bn_tab_comma_multivar.jnl
+   bn_element_functions.jnl
+   bn_long_revision_num.jnl
+   bn_window_title.jnl
+   bn_last_error.jnl
+   bn_deg_min.jnl
+   bn_dp_readscale.jnl
+   bn_bounds_defineax.jnl
+   bn_attributes.jnl
+   bn_transforms.jnl
+   bn_variance.jnl
+   bn_linecolors.jnl
+   bn_cdf_errmsg.jnl
+   bn600_bug_fixes.jnl
+   bn601_bug_fixes.jnl
+   bn_set_strides.jnl
+   bn_lsl_lowpass.jnl
+   bn_return_xmod_tmod.jnl
+   bn602_bug_fixes.jnl
+   bn_modnbd.jnl
+   bn_fifty_files.jnl
+   bn603_bug_fixes.jnl
+   bn_set_var_name.jnl
+   bn_memory_symbol.jnl
+   bn605_bug_fixes.jnl
+   bn608_bug_fixes.jnl
+   bn_shade_trim.jnl
+   bn_mode_nlevels.jnl
+   bn61_bug_fixes.jnl
+   bn_test_opendap.jnl
+   bn611_bug_fixes.jnl
+   bn_no_valid_on_plot.jnl
+   bn_median.jnl
+   bn614_bug_fixes.jnl
+   bn_mode_nodata_lab.jnl
+   bn_proleptic_gregorian_calendar.jnl
+   bn_string_ngd_nbd.jnl
+   bn_cat_string.jnl
+   bn_sort_strings.jnl
+   bn_samplexyt.jnl
+   bn_last_go_file.jnl
+   bn_cancel_upcase_uservar.jnl
+   bn_cdf_keepax.jnl
+   bn_keep_axisnames.jnl
+   bn_key_label_minmax.jnl
+   bn62_bug_fixes.jnl
+   bn_convolve.jnl
+   bn_tax_tstep.jnl
+   bn_grads_z.jnl
+   bn_clock_syms.jnl
+   bn63_bug_fixes.jnl
+   bn_axis_reversed_syms.jnl
+   bn_isdepth.jnl
+   bn_var_hist_levels.jnl
+   bn64_bug_fixes.jnl
+   bn_long_grid_names.jnl
+   bn_xml_repl.jnl
+   bn65_bug_fixes.jnl
+   bn_txtype_dmy.jnl
+   bn_n_open_dsets_sym.jnl
+   bn_multi_decade.jnl
+   bn_show_xml_file.jnl
+   bn66_bug_fixes.jnl
+   bn_netcdf4.jnl
+   bn_scat2grid_bin.jnl
+   bn_axis_dir_symbols.jnl
+   bn663_bug_fixes.jnl
+   bn_set_axis_regular.jnl
+   bn_set_cancel_redirect.jnl
+   bn_min_max_smoothers.jnl
+   bn_vector_symbols.jnl
+   bn_variance_large.jnl
+   bn_labnum_calendar.jnl
+   bn665_bug_fixes.jnl
+   bn_floatstr.jnl
+   bn67_bug_fixes.jnl
+   bn_NaN_note.jnl
+   bn671_bug_fixes.jnl
+   bn68_bug_fixes.jnl
+   bn_ifv.jnl
+   bn_randu2_randn2.jnl
+   bn_axis_cf.jnl
+   bn_repeated_coords.jnl
+   bn_xml_header.jnl
+   bn_eof_simple.jnl
+   bn_eof_simple2.jnl
+   bn_interpolate_6d.jnl
+   bn_regrid_6d.jnl
+   bn_syntax_6d.jnl
+   bn_expressions_6d.jnl
+   bn_direction_fcns_6d.jnl
+   bn_regrid_transforms_6d.jnl
+   bn_aggregate_e.jnl
+   bn_6d_lab_mode.jnl
+   bn682_bug_fixes.jnl
+   bn683_bug_fixes.jnl
+   bn_outtype.jnl
+   bn_ribbon_plot.jnl
+   bn_descr_4digit.jnl
+   bn_axis_outtype.jnl
+   bn_axis_nonmonotonic.jnl
+   bn_vec_mod.jnl
+   bn685_bug_fixes.jnl
+   bn_dsg_e_x.jnl
+   bn_nco_append.jnl
+   bn_nobounds.jnl
+   bn_write_integer_att.jnl
+   bn_descriptor_mc.jnl
+   bn_plot_color_only.jnl
+   bn_vtree.jnl
+   bn686_bug_fixes.jnl
+   bn_long_symnames.jnl
+   bn_strdim.jnl
+   bn_single_colorlev.jnl
+   bn69_bug_fixes.jnl
+   bn_bad_axis_bounds.jnl
+   bn_enter_exit_GO.jnl
+   bn_stddev.jnl
+   bn_set_axis_name.jnl
+   bn_all_ef.jnl
+   bn_startupfile.jnl
+****** Restricting Ferret paths to bench directory ******
+FER_DAT=.
+FER_DATA=.
+FER_DATA_THREDDS= http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml /home/users/ksmith/Datasets
+FER_DESCR=.
+FER_DIR=.
+FER_DSETS=.
+FER_EXTERNAL_FUNCTIONS=/home/users/ksmith/PyFerret/ext_func/libs
+FER_FONTS=/home/users/ksmith/PyFerret/ppl/fonts
+FER_GO=. /home/users/ksmith/PyFerret/go /home/users/ksmith/PyFerret/examples /home/users/ksmith/PyFerret/contrib
+FER_GRIDS=.
+FER_LIBS=/home/users/ksmith/PyFerret/lib
+FER_PALETTE=. /home/users/ksmith/PyFerret/ppl
+FER_WEB_BROWSER=firefox
+Beginning at Mon Mar 31 17:26:16 PDT 2014
+*** Running test: bn_syntax.jnl
+! bn401_syntax.JNL
+! - test syntax interpretation of Program FERRET
+! - major changes for FERRET ver 2.00 5/90
+! - changed mode REMOTE to mode STUPID - REMOTE removed in V2.30
+! - added semicolon-separated command group processing in V3.00 2/93
+! - added mode journal and mode ppllist tests
+! - extended mode journal, ppllist, and metafile tests to include paths
+! for V4.01 added var1[G=var2[d=dset]] (nested brackets) syntax
+! for V4.20 added blanks surrounding colons
+!	and tests of "escapes" using back slashes
+! for V531 test continuation lines and long input lines
+ 
+! SET - SHOW - CANCEL DATA
+USE gtbc011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+SHOW DATA
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/VARIABLES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+SHOW DATA/FILES
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+CANCEL DATA 1
+SHOW DATA
+     currently SET data sets:
+USE gtbc011
+USE gt4d011
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SHOW DATA/BRIEF gtbc011
+     currently SET data sets:
+    1> ./gtbc011.cdf
+! ... save and restore data set
+SET DATA 1
+SET DATA/SAVE
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+    2> ./gt4d011.cdf
+SET DATA 2
+SHOW DATA/BRIEF
+     currently SET data sets:
+    1> ./gtbc011.cdf
+    2> ./gt4d011.cdf  (default)
+SET DATA/RESTORE
+CANCEL DATA/ALL
+! ... EZ data sets
+FILE snoopy.dat
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+FILE/TITLE="quick and dirty" snoopy.dat
+SHOW DATA
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+SET MODE IGNORE_ERROR
+SET DATA/EZ/VAR="P,Q" 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET MODE/LAST IGNORE_ERROR
+CANCEL DATA 1
+FILE/TITLE="quick and dirty"/VAR="P,Q"/COL=4/GRID=ABSTRACT/FORM=UNF/SKIP=2 snoopy.dat
+SET VARIABLE/TITLE="my P variable" P
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./snoopy.dat  (default)
+     quick and dirty
+ name     title                             I         J         K         L         M         N
+ P        my P variable                   1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ Q        Q                               1:99999999  1:99999999  1:99999999  1:99999999  1:99999999  1:99999999
+               on grid ABSTRACT with -1.E+34 for missing data
+             X=0.5:1.E+08  Y=0.5:1.E+08  Z=0.5:1.E+08  E=0.5:1.E+08  F=0.5:1
+ 
+ /FORMAT = UNF
+ /SKIP = 2
+ /COLUMNS = 4
+ 
+! SET - SHOW - CANCEL - DEFINE REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SET REGION/I=101:105/J=46:48/Z=0/L=1
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION SAVE
+CANCEL REGION
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/X=130E:70W/Y=28.9S:48.6N W	! re-define to default
+SET REGION/@W
+SHOW REGION
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION SAVE
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SHOW REGION/ALL
+default region:
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region W
+        X=130:290
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region T
+        X=130:290
+        Y=-23.5:23.5
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region N
+        X=130:290
+        Y=-9.8:9.8
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region SAVE
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+SET REGION SAVE
+SHOW REGION
+default region:
+        I=101:105
+        J=46:48
+        Z=0
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+! delta regions
+CANCEL REGION
+SET REGION/L=1
+SET REGION/DL=1:3
+SHOW REGION
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2:4
+        E/M is unspecified
+        F/N is unspecified
+DEFINE REGION/dX=5 W
+SHOW REGION W
+region W
+        X=135:295
+        Y=-28.9:48.6
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! SET - SHOW - CANCEL  MODE
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      ferret.png
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SET MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR     SET
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      ferret.png
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+CANCEL MODE IGNORE_ERROR
+SHOW MODES
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      ferret.png
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS           SET
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+SET MODE STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID           SET
+SET MODE/LAST STUPID
+SHOW MODE STUPID
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+ 
+! new modes 5/93
+set mode journal newjournal.jnl
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL          SET         newjournal.jnl
+set mode journal ferret.jnl
+ppl list plot
+         WIDTH=   10.50  HEIGHT=    8.50  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= ferret.png                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+set mode ppllist:ppllist.out
+show mode ppllist
+      MODE            STATE        ARGUMENT
+      PPLLIST          SET         ppllist.out
+ppl list plot
+ppl listsym
+cancel mode ppllist
+ppl list plot
+         WIDTH=   10.50  HEIGHT=    8.50  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= ferret.png                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+cancel mode journal
+show mode journal
+      MODE            STATE        ARGUMENT
+      JOURNAL       CANCELLED      ferret.jnl
+ 
+! new 1/94  (syntax check also applies to modes journal and ppllist)
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE      CANCELLED      ferret.png
+set mode metafile newmetafile1.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile1.plt
+set mode metafile:newmetafile2.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile2.plt
+set mode metafile: newmetafile3.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile3.plt
+set mode metafile: "newmetafile4.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile4.plt
+set mode metafile: "./newmetafile5.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile5.plt
+set mode metafile: ./newmetafile6.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile6.plt
+set mode metafile newmetafile7.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile7.plt
+set mode metafile "newmetafile8.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         newmetafile8.plt
+set mode metafile "./newmetafile9.plt"
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile9.plt
+set mode metafile ./newmetafile10.plt
+show mode metafile
+      MODE            STATE        ARGUMENT
+      METAFILE         SET         ./newmetafile10.plt
+set mode metafile metafile.plt
+can mode metafile
+ 
+! SET - SHOW - CANCEL EXPRESSION
+SHOW EXPRESSION
+CANCEL EXPRESSION
+SHOW EXPRESSION
+SET EXPRESSION i+5,i-j
+SHOW EXPRESSION
+        current output expression(s):
+        I+5
+        I-J
+LIST/i=1:3/j=6:8
+             X: 0.5 to 3.5
+             Y: 5.5 to 8.5
+ Column  1: EX#1 is I+5
+ Column  2: EX#2 is I-J
+          EX#1   EX#2
+ ---- J:6 Y:   6
+1   / 1:  6.000 -5.000
+2   / 2:  7.000 -4.000
+3   / 3:  8.000 -3.000
+ ---- J:7 Y:   7
+1   / 1:  6.000 -6.000
+2   / 2:  7.000 -5.000
+3   / 3:  8.000 -4.000
+ ---- J:8 Y:   8
+1   / 1:  6.000 -7.000
+2   / 2:  7.000 -6.000
+3   / 3:  8.000 -5.000
+ 
+! SET,SHOW GRID
+USE gt4d011
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+LIST/I=101:105/J=50/K=1/L=5 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1.5N
+             DEPTH (m): 5
+             TIME     : 10-SEP-1982 20:00
+                   1.5N    
+                   50
+ 129.5W / 101:  1.123E-04
+ 128.5W / 102:  1.092E-04
+ 127.5W / 103:  1.064E-04
+ 126.5W / 104:  1.042E-04
+ 125.5W / 105:  1.015E-04
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid PS3DT2
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+SHOW GRID/X=180:165W SALT
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+      50>  179.5E                1          179E
+      51>  179.5W                1          180E
+      52>  178.5W                1          179W
+      53>  177.5W                1          178W
+      54>  176.5W                1          177W
+      55>  175.5W                1          176W
+      56>  174.5W                1          175W
+      57>  173.5W                1          174W
+      58>  172.5W                1          173W
+      59>  171.5W                1          172W
+      60>  170.5W                1          171W
+      61>  169.5W                1          170W
+      62>  168.5W                1          169W
+      63>  167.5W                1          168W
+      64>  166.5W                1          167W
+      65>  165.5W                1          166W
+      66>  164.5W                1          165W
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+! SHOW VARIABLES
+SHOW VARIABLES/DIAGNOSTIC	! alphabetical list
+Diagnostic variables:
+name         title
+AIR       AIR TEMPERATURE
+CAIR      CLIMATOLOGICAL AIR TEMPERATURE
+CMSK      CONVECTIVE ADJUSTMENT MASK
+DENS      (DENSITY-1)*1000
+DPDX      d/dX( BAROCLINIC PRESSURE )
+DPDY      d/dY( BAROCLINIC PRESSURE )
+DTDT      d/dt(TEMPERATURE)
+DUDT      d/dt(U)
+DVDT      d/dt(V)
+DWDT      d/dt(W)
+FUW       ZONAL ADVECTIVE COEFFICIENT, FUW
+FVN       MERIDIONAL ADVECTIVE COEFFICIENT, FVN
+PCDZ      VERTICAL MOMENTUM DIFFUSION COEFFICIENT
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+RHO       NORMALIZED DENSITY
+RHO0      DENSITY REFERENCED TO SURFACE
+SALI      SALINITY
+TAU       MAGNITUDE OF WIND STRESS
+UAD       TOTAL ADVECTION OF U
+UADX      ZONAL ADVECTION OF U
+UADY      MERIDIONAL ADVECTION OF U
+UADZ      VERTICAL ADVECTION OF U
+UAVZ      VERTICALLY AVERAGED ZONAL VELOCITY
+UBP       U DUE TO TOTAL PRESSURE
+UBPI      U DUE TO BAROCLINIC PRESSURE EFFECTS
+UBPS      U DUE TO SURFACE PRESSURE EFFECTS
+UBWI      U DUE TO WIND STRESS EFFECTS
+UCOE      U DUE TO EXPLICIT CORIOLIS CALCULATION
+UCOI      U DUE TO IMPLICIT CORIOLIS CORRECTION
+UDF       TOTAL DIFFUSION OF U
+UDFH      HORIZONTAL DIFFUSION OF U
+UDFZ      VERTICAL DIFFUSION OF U
+VAD       TOTAL ADVECTION OF V
+VADX      ZONAL ADVECTION OF V
+VADY      MERIDIONAL ADVECTION OF V
+VADZ      VERTICAL ADVECTION OF V
+VAVZ      VERTICALLY AVERAGED MERIDIONAL VELOCITY
+VBP       V DUE TO TOTAL PRESSURE
+VBPI      V DUE TO BAROCLINIC PRESSURE EFFECTS
+VBPS      V DUE TO SURFACE PRESSURE EFFECTS
+VBWI      V DUE TO WIND STRESS EFFECTS
+VCOE      V DUE TO EXPLICIT CORIOLIS CALCULATION
+VCOI      V DUE TO IMPLICIT CORIOLIS CORRECTION
+VDF       TOTAL DIFFUSION OF V
+VDFH      HORIZONTAL DIFFUSION OF V
+VDFZ      VERTICAL DIFFUSION OF V
+W_T       VERTICAL VELOCITY COMPUTED ON TS GRID
+W_U       VERTICAL VELOCITY COMPUTED ON UV GRID
+SHOW VARIABLES/DIAGNOSTIC  Q
+Diagnostic variables:
+name         title
+QAD       TOTAL HEAT ADVECTION
+QADX      ZONAL HEAT ADVECTION
+QADY      MERIDIONAL HEAT ADVECTION
+QADZ      VERTICAL HEAT ADVECTION
+QCDZ      VERTICAL HEAT DIFFUSION COEFFICIENT
+QDF       TOTAL HEAT DIFFUSION
+QDFH      HORIZONTAL HEAT DIFFUSION
+QDFZ      VERTICAL HEAT DIFFUSION
+QEVA      EVAPORATIVE HEAT
+QFLX      SURFACE HEAT FLUX
+QRAD      RADIATIVE HEAT
+QSEN      SENSIBLE HEAT
+LET A=i
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = I
+CANC VARIABLES/ALL
+SHOW VARIABLES
+ Created by DEFINE VARIABLE:
+ 
+! SHOW MEMORY , LOAD
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/TEMPORARY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded without /PERMANENT:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+SHOW MEMORY/PERMANENT
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+data loaded with /PERMANENT:
+SHOW MEMORY/ALL
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+all data in memory:
+ SALT[D=gt4d011]                   X     mr:3  blk1:1  nblk:1
+  101  /130W          50  /1.3N           1  /0              5  /07-SEP-1982  ...  / ...         ...  / ...
+  105  /125W          50  /1.7N           1  /10             5  /13-SEP-1982  ...  / ...         ...  / ...
+ 
+ 
+LET A=i
+LOAD/PERM/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1997
+            largest free region: 1997
+            number of free regions: 1
+            free memory table slots: 497
+            number of UN-CACHED variables: 0
+            number of /PERMANENT variables: 1
+            number of blocks used /PERM: 1
+LOAD/TEMPORARY/I=1:5 A
+SHOW MEMORY
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+SHOW MEMORY/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1998
+            largest free region: 1997
+            number of free regions: 2
+            free memory table slots: 498
+            number of UN-CACHED variables: 0
+ 
+! REPEAT
+REPEAT/L=1:3 LIST/I=1:6/ORDER=X 1/(I+L)
+!-> REPEAT: L=1
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 1
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.5000  0.3333  0.2500  0.2000  0.1667  0.1429
+!-> REPEAT: L=2
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 2
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.3333  0.2500  0.2000  0.1667  0.1429  0.1250
+!-> REPEAT: L=3
+             VARIABLE : 1/(I+L)
+             SUBSET   : 6 points (X)
+             T        : 3
+            1       2       3       4       5       6     
+             1       2       3       4       5       6
+          0.2500  0.2000  0.1667  0.1429  0.1250  0.1111
+ 
+! semicolon-separated command groups
+cancel region
+cancel data/all
+(show data)
+     currently SET data sets:
+show data;show data
+     currently SET data sets:
+     currently SET data sets:
+set region/l=99;show region;repeat/l=1:3 (show data;sh reg);can reg;show reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=99
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=2
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=3
+     currently SET data sets:
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=3
+        E/M is unspecified
+        F/N is unspecified
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+((show wind;show reg);repeat/l=1:2 (show reg;list/i=1:3/ord=x (i+5)))
+ OPEN  ACTIVE  ANTIALIAS  QUALITY  DISPLAY  THICKEN  TEXTPROM
+   1      *       YES       HIGH      NO      1.00     1.00
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+!-> REPEAT: L=1
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=1
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+!-> REPEAT: L=2
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        L=2
+        E/M is unspecified
+        F/N is unspecified
+             VARIABLE : (I+5)
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          6.000  7.000  8.000
+ 
+ 
+! nested brackets (7/95 - version 4.01)
+use gtbc011,gt4d011
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 160.5W
+             LATITUDE: 1.8S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.082
+ Maximum value: 30.082
+ Mean    value: 30.082 (unweighted average)
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 30.252
+ Maximum value: 30.252
+ Mean    value: 30.252 (unweighted average)
+! ... note that since the data set times do not overlap the regrid request
+!	produces only a single missing value flag
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=1,g=u[d=2]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+stat/k=1/l=1/j=40/i=70/d=2 temp[d=gtbc011,g=u[d=gt4d011]]
+ 
+             TEMPERATURE
+             regrid: U[D=gt4d011]
+             LONGITUDE: 160W
+             LATITUDE: 1.7S
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtbc011.cdf
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 1
+ 
+! test blanks surrounding colons (bn420 - 10/95)
+list/nohead/i=1 : 3 i
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+! (moved to bn420_grave)
+ 
+say \/help	! "/" should pass through
+/help
+set mode ignore
+say /help
+canc mode ignore
+ 
+say this\;that	! ";" should pass through
+this;that
+set mode ignore
+say this;that
+this
+canc mode ignore
+ 
+say yes\! "\!" passes through
+yes! "!" passes through
+say yes! "!" passes through
+yes
+ 
+! ********* V5.31 **********
+! test continuation line capabilities
+define axis \ ! comment on the command
+/x=1:10:1 \   ! comment on the qualifier
+xax\          ! comment on the argument
+              ! this line is significant -- completes the command
+show axis xax; cancel axis xax  ! clean up
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+ 
+! long quotations can span multiple lines
+say "start of quote \ ! quotations left open
+followed by the end of the quote\
+"  ! and the closing quote all by itself
+start of quote followed by the end of the quote
+ 
+! leading blanks are significant on continuation lines
+say "demonstrate that these leading blanks:\
+       really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! continuation prompts are ignored, too
+yes? say "demonstrate that these leading blanks:\
+...?        really are preserved"
+demonstrate that these leading blanks:       really are preserved
+ 
+! weird little blank line inputs
+ 
+ 
+cancel region  ! to make next output predictable
+show region\
+! comment
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+! a common example: continuation for REPEAT loops
+repeat/i=1:3 (cancel data/all;\
+show data;\
+let a = i;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: I=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: I=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: I=3
+     currently SET data sets:
+          3.000
+ 
+! deliberate error -- backslash escapes the bang
+set mode ignore; \! ignore (err cuz bang gets escaped); can mode ignore
+ 
+! test long input lines with continuation (V5.31)
+! *kob* 6/01 - note shorten this test for long lines to 1024 characters. This
+!              because that is the maximum record length for NAG f95.  Any
+! 	       longer and the program is aborted
+ 
+say *** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E11111111122222222223333333333444444444455555555556666666666777777777788888888889999 [...]
+F111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000G111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000H111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000I111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
+J111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
+*** A111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000B111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000C111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000D111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000E111111111222222222233333333334444444444555555555566666666667777777777888888888899999999 [...]
+ 
+*** Running test: bn_dollar.jnl
+! test this with GO journal hello
+ 
+! V510: 3/00 *sh* added tests of backslash escapes and surrounding quotations
+! V532: 5/01 *sh* added tests of 2-digit arguments; made mode ignore stricter
+ 
+set mode ignore
+message/continue $1
+ !-> message/continue hello
+hello
+ 
+message/continue here is: $1"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/cont here is a big $1 and $3&some text&      ! default provided
+ !-> message/cont here is a big hello and some text      ! default provided
+here is a big hello and some text
+ 
+message/cont $3			! error - no default
+ 
+message/cont $3"<my error message"	! error - with message
+ 
+message/cont $*
+ !-> message/cont hello
+hello
+ 
+message/continue here is: $*"some text" and some more stuff
+ !-> message/continue here is: hello and some more stuff
+here is: hello and some more stuff
+ 
+message/continue $no_digit_text   ! no substitution
+$no_digit_text
+ 
+!!!!!!!!!!!!!!!!!!
+ 
+message/cont $1"|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1"greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello|goodbye<my error message"
+ !-> message/cont hello
+hello
+ 
+message/cont $1">greetings|hello>replacement text|goodbye<my error message"
+ !-> message/cont replacement text
+replacement text
+ 
+! doesn't match on "hello"
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+ 
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+message/cont $1">greetings|xxxxx|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $1">greetings|xxxxx>replacement text|goodbye<my error message"
+ !-> message/cont greetings
+greetings
+ 
+! no argument supplied
+ 
+message/cont $3"|hello|goodbye<my error message"
+ 
+message/cont $3"greetings|hello|goodbye"
+ !-> message/cont greetings
+greetings
+ 
+message/cont $3">greetings|hello|goodbye"
+ 
+message/cont $3">greetings|hello|goodbye<my error message"
+ 
+message/cont $3">greetings|hello>replacement text|goodbye<my error message"
+ 
+! pathological examples
+!*********
+! works ok with 500 character input buffer
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont here is a very long text $1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy [...]
+ !-> message/cont here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyy [...]
+here is a very long text hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx the end 1234567890 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 1234567890
+message/cont $3""
+message/cont $3"<"
+message/cont $3"||"
+message/cont $3">"
+ !-> message/cont >
+>
+message/cont $3"|>|"
+message/cont $3">|"
+message/cont $3"|<"
+message/cont $3"|>"
+ 
+set mode/last ignore
+ 
+! bn420 10/95 - added tests that arguments don't get incorrectly broken up
+! ==> EACH OF THESE SHOULD PASS AS A SINGLE ARGUMENT!!!
+go bn_dollar.sub VAR[x=1,y=1]	! should be interpreted as a single arg
+VAR[x=1,y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub VAR[x=1,g=var2[d=d1],y=1]	!  a single arg
+VAR[x=1,g=var2[d=d1],y=1]  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y)/(x-5))	! ignore slash, get single arg
+((x+y)/(x-5))  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub ((x+y),(x-5))	! ignore comma, get single arg
+((x+y),(x-5))  2-n/a  3-n/a  4-n/a
+ 
+! V510 3/00
+set mode ignore
+  message/continue "$1"                ! final quote used to get mis-applied
+ !-> message/continue "hello"                ! final quote used to get mis-applied
+hello
+set mode/last ignore
+go bn_dollar.sub \"hello\"                 ! quotations as part of argument
+"hello"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub "\"hello with blanks\""   ! quotations as part of argument
+"hello with blanks"  2-n/a  3-n/a  4-n/a
+go bn_dollar.sub \"((x+y),(x-5))\"         ! quotations as part of argument
+"((x+y),(x-5))"  2-n/a  3-n/a  4-n/a
+ 
+! V5.3 additions 5/01 -- 2-digit arguments in parentheses
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+11-n/a   12-n/a  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+41-n/a  42-n/a  43-n/a
+ 
+go bn_dollar.sub VAR[x=1,y=1] "arg 2" " " "arg 4" "arg 5" \
+"arg 6" "arg 7" "arg 8" "arg 9" "arg 10" \
+"arg 11" "arg 12" " "      "arg 14" "arg 15" \
+"arg 16" "arg 17" "arg 18" "arg 19" "arg 20" \
+"arg 21" "arg 22" "arg 23" "arg 24" "arg 25" \
+"arg 26" "arg 27" "arg 28" "arg 29" "arg 30" \
+"arg 31" "arg 32" "arg 33" "arg 34" "arg 35" \
+"arg 36" "arg 37" "arg 38" "arg 39" "arg 40" \
+"arg 41" "arg 42" " "      "arg 44" "arg 45"
+VAR[x=1,y=1]  arg 2  3-n/a  arg 4
+VAR[x=1,y=1]999  arg 2  3-parens
+arg 11   arg 12  13-n/a
+star 41  subst 42  43-n/a
+ 
+! deliberate errors
+set mode ignore
+  say $100        ! argument number too large
+  say ($100)        ! argument number too large
+  say ($10)0      ! argument 10 not defined
+set mode/last ignore
+*** Running test: bn_grave.jnl
+! bn420_grave
+! benchmark to test evaluation of grave accent-enclosed expressions
+! requires FERRET version 4.00 or later
+ 
+! added one new command since bn400_grave to test for unwanted leading blanks
+!  (a problem noticed on HP)
+! and make sure that grave accents protect "/" and other chars from the parser
+ 
+! 2/96 - added tests of PRECISION=n abd BAD=string
+ 
+message/continue "2+2=`2+2`"
+ !-> message/continue "2+2=4"
+2+2=4
+ 
+message/continue "2 squared + 2 squared =`2^2` + `2+2`"
+ !-> message/continue "2 squared + 2 squared =4 + 4"
+2 squared + 2 squared =4 + 4
+ 
+message/continue "50/0 =`50/0`"	! invalid result
+ !-> message/continue "50/0 =bad"	! invalid result
+50/0 =bad
+ 
+repeat/i=1:3 message/continue "I=`I`"
+!-> REPEAT: I=1
+ !-> message/continue "I=1"
+I=1
+!-> REPEAT: I=2
+ !-> message/continue "I=2"
+I=2
+!-> REPEAT: I=3
+ !-> message/continue "I=3"
+I=3
+ 
+LET start = 5; repeat/i=`start`:`start+2` message/continue "I=`I`"
+ !-> repeat/i=5:7 message/continue "I=`I`"
+!-> REPEAT: I=5
+ !-> message/continue "I=5"
+I=5
+!-> REPEAT: I=6
+ !-> message/continue "I=6"
+I=6
+!-> REPEAT: I=7
+ !-> message/continue "I=7"
+I=7
+!cancel region/X ! removed - temporary experiment 3/00 *sh*
+ 
+message/continue "2+2=``2+2``"	! double grave accents get condensed
+ !-> message/continue "2+2=`2+2`"	! double grave accents get condensed
+2+2=`2+2`
+ 
+message/continue A default substitution: $9"default string|2+2=`2+2`"
+ !-> message/continue A default substitution: default string
+A default substitution: default string
+ 
+message/continue A grave   substitution: $9"2+2=`2+2`|replacement string"
+ !-> message/continue A grave   substitution: 2+2=4
+A grave   substitution: 2+2=4
+ 
+canc var/all;LET XX = 5+4; mess/cont "xx is `xx`"
+ !-> mess/cont "xx is 9"
+xx is 9
+ 
+! 2/96
+message/continue "1/300=`1/300,p=5`"
+ !-> message/continue "1/300=0.0033333"
+1/300=0.0033333
+message/continue "1/300=`1/300,p=-5`"	! decimal places
+ !-> message/continue "1/300=0.00333"	! decimal places
+1/300=0.00333
+message/continue "1/300=`1/300 , precision=10`"
+ !-> message/continue "1/300=0.003333333333"
+1/300=0.003333333333
+message/continue "1/0=`1/0,  b=-999`"
+ !-> message/continue "1/0=-999"
+1/0=-999
+message/continue "1/0=`1/0  ,BAD=missing`"
+ !-> message/continue "1/0=missing"
+1/0=missing
+message/continue "1/3=`1/3, precision=10,  BAD=-999`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+message/continue "1/3=`1/3,	BAD=-999 ,precision=10`"
+ !-> message/continue "1/3=0.3333333333"
+1/3=0.3333333333
+ 
+! deliberate error
+set mode ignore_errors
+message/continue "2+2=`2+2"    		! unclosed grave accent
+message/continue "2+2=`garbage`"	! invalid expression
+message/continue "3 numbers: `I[i=3:5]`"! not a scalar
+ 
+! 2/96 deliberate errors
+message/continue "1/3=`1/3,BAD=-999,precision=11`"
+ !-> message/continue "1/3=0.33333333333"
+1/3=0.33333333333
+message/continue "1/3=`1/3BAD=-999`"
+message/continue "1/3=`1/3,qBAD=-999`"
+canc mode ignore_errors
+ 
+! bn420_grave:
+! CHECK THIS TO MAKE SURE THERE ARE NO LEADING BLANKS  (ESP. HP!!!)
+let x1 = 0.012954
+let x2 = 7.5E-09
+let x3 = .1
+say >>`x1`<< ---  >>`x2`<< --- >>`x3`<<
+ !-> MESSAGE/CONTINUE >>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+>>0.012954<< ---  >>7.5E-09           << --- >>0.1<<
+ 
+! must recognize "/" inside immediate mode exprn
+list/I=`6/2` i
+ !-> list/I=3 i
+             VARIABLE : I
+                        axis ABSTRACT
+             X        : 3
+          3.000
+ 
+! test escapes using back slashes (bn420 - 11/95)
+say `2+2`	! normal evaluation
+ !-> MESSAGE/CONTINUE 4
+4
+say \`2+2\`	! these grave accents should pass through
+`2+2`
+say \`2+2\`
+`2+2`
+say \`2+`1+1`\` ! should translate 1+1=>2
+ !-> MESSAGE/CONTINUE `2+2`
+`2+2`
+set mode ignore
+say \`2+2`	! syntax error
+say `2+2\`	! syntax error
+say `2+2\`+1`	! syntax error
+say \`2+2`+1\`	! syntax error
+canc mode ignore
+ 
+! test nested brackets mixed with grave accents
+let long = x
+say temp[x=`long[i=1]`:`long[i=160]`:5]
+ !-> MESSAGE/CONTINUE temp[x=1:160:5]
+temp[x=1:160:5]
+ 
+! V5.10 - test new features
+use coads_climatology
+set mode diagnostic
+let sst2 = sst[l=5:8]
+say `sst, return=size`    ! should only do a GETGRID
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst2,return=lend`    ! should inherit L=5:8
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST2     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ !-> MESSAGE/CONTINUE 8
+8
+set mode/last diagnostic
+ 
+say `sst,return=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `sst,return=T0`
+ !-> MESSAGE/CONTINUE 01-JAN-0000 00:00:00
+01-JAN-0000 00:00:00
+say `sst,return=TITLE`
+ !-> MESSAGE/CONTINUE SEA SURFACE TEMPERATURE
+SEA SURFACE TEMPERATURE
+say `sst,return=units`
+ !-> MESSAGE/CONTINUE Deg C
+Deg C
+say `sst,return=GRID`
+ !-> MESSAGE/CONTINUE GSQ1
+GSQ1
+ 
+say `sst,ret=isize`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,ret=jsize`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,ret=ksize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,ret=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,r=istart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=jstart`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst,r=kstart`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,r=lstart`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `sst,R=iend`
+ !-> MESSAGE/CONTINUE 180
+180
+say `sst,R=jend`
+ !-> MESSAGE/CONTINUE 90
+90
+say `sst,R=kend`
+ !-> MESSAGE/CONTINUE 0
+0
+say `sst,R=LEND`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+say `sst,return=xstart`
+ !-> MESSAGE/CONTINUE 21E
+21E
+say `sst,return=ystart`
+ !-> MESSAGE/CONTINUE 89S
+89S
+say `sst,return=zstart`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tstart`
+ !-> MESSAGE/CONTINUE 16-JAN 06:00:00
+16-JAN 06:00:00
+ 
+say `sst,return=xend`
+ !-> MESSAGE/CONTINUE 19E(379)
+19E(379)
+say `sst,return=yend`
+ !-> MESSAGE/CONTINUE 89N
+89N
+say `sst,return=zend`
+ !-> MESSAGE/CONTINUE *
+*
+say `sst,return=tend`
+ !-> MESSAGE/CONTINUE 17-MAR 02:58:12
+17-MAR 02:58:12
+ 
+say `sst,return=xunit`
+ !-> MESSAGE/CONTINUE degrees_east
+degrees_east
+say `sst,return=junits`
+ !-> MESSAGE/CONTINUE degrees_north
+degrees_north
+say `sst,return=kunit`
+ !-> MESSAGE/CONTINUE
+
+say `sst,return=tunits`
+ !-> MESSAGE/CONTINUE hour
+hour
+ 
+say `sst^2,return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst[L=1]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+say `sst[L=1:3 at ave],return=lsize`
+ !-> MESSAGE/CONTINUE 1
+1
+say `sst[L=1:3 at ave]+sst,return=lsize`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! test case of grid-changing variables returning an imposed (ABSTRACT) axes
+let a = XSEQUENCE(J[j=1:5])
+set mode diagnostic
+say `a,return=isize`          ! full evaluation occurs
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V08 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V08 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ -DELETE X        M:  4 dset:   0 I:  160  160  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V08 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V08 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  4 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+say `a[i=2:3],return=isize`   ! full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 2
+2
+say `a[i=100:200],return=isize`    ! WRONG! because full evaluation is bypassed
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 101
+101
+set mode/last diagnostic
+ 
+! deliberate errors
+set mode ignore_errors
+say `1*/3`     ! deliberate syntax error
+say `sst*/3,return=lunits`
+say `sst,rr=size`            ! could be an error ...
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst,return=Xsize`
+say `sst,return=trash`
+set mode/last ignore_errors
+ 
+*** Running test: bn_letd.jnl
+! bn420_letd.jnl
+! 9/1/95
+ 
+! test LET definitions with the /D qualifier:  LET, SHOW, SET VAR, CANCEL
+! .. not a particularly inspired benchmark, but, what the heck
+ 
+! 9/2005 acm
+! test for the behavior of bug 1336 by listing contents of variables;
+! tests with SHOW VAR did not detect the bug.
+ 
+sp touch snoopy.dat
+ 
+! set and show 3 types of variables
+let a = global_pre-empt
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+show var/d
+let/d a = global_default
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d
+     A (/D default) = GLOBAL_DEFAULT
+USE clim_airt_lev
+let/d=clim_airt_lev a = clim_airt_lev-specific
+set mode ignore; let/d=noexist a = b; set mode/last ignore
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show data clim_airt_lev
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+ 
+use gt4d011
+let/d=2 a = specific-to-gt4d
+show var
+ Created by DEFINE VARIABLE:
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+     A[D=gt4d011] = SPECIFIC-TO-GT4D
+ >>> Definitions that replace any file variable of same name:
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     A (/D default) = GLOBAL_DEFAULT
+show var/d=clim_airt_lev
+     A[D=clim_airt_lev] = CLIM_AIRT_LEV-SPECIFIC
+show var airt
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : CLIMATOLOGICAL AIR TEMPERATURE (deg. C)
+             FILENAME : clim_airt_lev.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             TIME     : 12-JAN-1982 12:00
+          27.14
+ 
+! data set-specific definition
+let/d=clim_airt_lev airt = 1
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+set mode ignore; list/l=1/x=180/y=0 airt[d=gt4d011]; set mode/last ignore
+ 
+! default definition where no data set variable exists
+let/d airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+             FILENAME : gt4d011.cdf
+          2.000
+ 
+! global def'n replacing all file variables (but not data-set specific uvars)
+let airt = 2
+list/l=1/x=180/y=0 airt[d=clim_airt_lev]
+             VARIABLE : 1
+             FILENAME : clim_airt_lev.cdf
+          1.000
+list/l=1/x=180/y=0 airt[d=gt4d011]
+             VARIABLE : 2
+          2.000
+canc data/all
+list/l=1/x=180/y=0 airt
+             VARIABLE : 2
+          2.000
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! SET VARIABLE testing
+USE clim_airt_lev
+let t1 = 1
+let/d t2 = 2
+let/d=clim_airt_lev t3 = 3
+file/var=t4,t3 snoopy.dat
+set var/titl=test1 t1
+set var/titl=test2 t2
+set var/titl=test3 t3[d=clim_airt_lev]
+set var/titl=test4 t4[d=snoopy.dat]
+set var/titl=test3 t3[d=snoopy.dat]
+show data
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+ 
+    2> ./snoopy.dat  (default)
+ name     title                             I         J         K         L         M         N
+ T4       test4                            1:20480   ...       ...       ...       ...       ...
+ T3       test3                            1:20480   ...       ...       ...       ...       ...
+ 
+show data/full 1
+     currently SET data sets:
+    1> ./clim_airt_lev.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ AIRT     CLIMATOLOGICAL AIR TEMPERATURE   1:160     1:100     ...       1:12      ...       ...
+             deg. C on grid GGT1 with -1.E+34 for missing data
+             X=130E:70W  Y=30S:50N  
+ 
+  time range: 12-JAN-1982 12:00 to 13-DEC-1982 02:00
+ ------------------------------
+ T3[D=clim_airt_lev] = 3
+         "test3"
+ 
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+ >>> Definitions used if no file variable of this name exists:
+     T2 (/D default) = 2
+         "test2"
+     AIRT (/D default) = 2
+     A (/D default) = GLOBAL_DEFAULT
+ 
+! selective cancelling
+canc var/d/all
+show var	! LET/D, only, deleted
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+         "test3"
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+can var t3[d=clim_airt_lev]
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     T1 = 1
+         "test1"
+     AIRT = 2
+     A = GLOBAL_PRE-EMPT
+set mode ignore; can var; set mode/last ignore
+can var/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! cancelling various categiries in various ways
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+     T1[D=clim_airt_lev] = 1
+can var/d=clim_airt_lev t1
+show var
+ Created by DEFINE VARIABLE:
+     T3[D=clim_airt_lev] = 3
+     T2[D=clim_airt_lev] = 2
+can var/all/d=clim_airt_lev
+show var
+ Created by DEFINE VARIABLE:
+let/d=clim_airt_lev t1 = 1
+let/d=clim_airt_lev t2 = 2
+let/d=clim_airt_lev t3 = 3
+can var/d=clim_airt_lev	! implied "/all"
+show var
+ Created by DEFINE VARIABLE:
+let/d t1 = 1
+let/d t2 = 2
+let/d t3 = 3
+can var/d	! implied/d/all
+show var
+ Created by DEFINE VARIABLE:
+ 
+! test for the behavior of bug 1336 by listing contents of variables;
+ 
+let v1 = x[x=1:8]
+let v2 = x[x=1:8] + y[y=1:3]
+save/clobber/file=v12file.nc v1, v2
+save/clobber/file=v1file.nc/i=3:8 v1
+can var v1
+can var v2
+ 
+use v12file
+use v1file
+ 
+list v1  ! from vfile
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+let/d v1 = 0
+let/d v2 = 2
+ 
+list v1  ! v1 exists in default data set so use dataset variable
+             VARIABLE : X[X=1:8]
+             FILENAME : v1file.nc
+             SUBSET   : 6 points (X)
+ 3   / 1:  3.000
+ 4   / 2:  4.000
+ 5   / 3:  5.000
+ 6   / 4:  6.000
+ 7   / 5:  7.000
+ 8   / 6:  8.000
+ 
+list v2  ! v2 does not exist in default dset so use let/d definition
+             VARIABLE : 2
+             FILENAME : v1file.nc
+          2.000
+ 
+let/d q = v2
+list q
+             VARIABLE : V2
+             FILENAME : v1file.nc
+          2.000
+list q[d=v12file]
+             VARIABLE : V2
+             FILENAME : v12file.nc
+             SUBSET   : 8 by 3 points (X-Y)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   4.00   5.00   6.00   7.00   8.00   9.00  10.00  11.00
+ 
+*** Running test: bn_if.jnl
+! bn430_if
+! 5/6/96
+! 5/22/96 - added nested multi-line IF with nesting in REJECTED clause
+ 
+! 8/97 bn430_if -> bn450_if: added test of symbol substitution with IF
+ 
+CANC MODE VERIFY
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking TRUE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking FALSE
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->CORRECT
+---->all is well after checking single line IFs
+---->CORRECT
+---->CORRECT, again
+100
+1
+2
+---->all is well after command group and loop tests
+CORRECT:sym sub
+---->CORRECT
+---->CORRECT again
+---->all is well
+---->CORRECT
+---->all is well
+---->CORRECT: took ELSE
+---->CORRECT again
+---->all is well
+---->CORRECT: took ELIF
+---->all is well
+---->CORRECT
+---->all is well following multi-line IF tests
+---->all is well following weird multi-line IF
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+-->CORRECT: nested single line IFs
+---->CORRECT: took ELIF -- starting nested IF
+---->CORRECT: took ELSE inside nested IF
+----> CORRECT: took non-nested IF clause
+---->all is well following nested multi-line IF
+---->CORRECT: took ELIF -- starting single line nested IF
+---->all is well following embedded single line IF
+---->CORRECT
+---->nested: all is well after single line IF
+---->CORRECT
+---->CORRECT, again
+---->nested: all is well after command group and loop tests
+---->CORRECT
+---->CORRECT again
+---->nested: all is well after multi-line IF
+>>> --> DELIBERATE WARNING: UNCLOSED IF in NESTED GO FILE<<<
+---->... now inside of nested IF clause
+---->CORRECT
+---->all is well following unclosed nested IF
+>>> DELIBERATE ERRORS <<<
+SAY ">>> --> DELIBERATE WARNING: UNCLOSED IF <<<"
+>>> --> DELIBERATE WARNING: UNCLOSED IF <<<
+IF yes THEN
+  say ---->... now inside of IF clause
+---->... now inside of IF clause
+ 
+ 
+ 
+ 
+*** Running test: bn_expressions.jnl
+! bn450_expressions.JNL
+! test all manner of expressions
+! V450 - commented out MODE POLISH test -- mode was eliminated
+! V530 - new pseudo-variables XBOXLO, YBOXHI, etc.
+ 
+! test infix expressions
+! 1/96 - commented out: CANCEL MODE POLISH
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let i1 = i
+let k1 = k
+ 
+! . . . constants
+list 4
+             VARIABLE : constant
+          4.000
+list 2 + 2
+             VARIABLE : 2 + 2
+          4.000
+list c1 + 2
+             VARIABLE : C1 + 2
+          4.000
+list 2 + c1
+             VARIABLE : 2 + C1
+          4.000
+list c1 + c1
+             VARIABLE : C1 + C1
+          4.000
+ 
+! ... constant plus variable or pseudovariable
+set reg/i=1:3
+list/order=x i + 2
+             VARIABLE : I + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i
+             VARIABLE : 2 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + 2
+             VARIABLE : I1 + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1
+             VARIABLE : 2 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + c1
+             VARIABLE : I + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i
+             VARIABLE : C1 + I
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1 + c1
+             VARIABLE : I1 + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1
+             VARIABLE : C1 + I1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/i=11:13
+list/order=x i[i=1:3] + 2
+             VARIABLE : I[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i[i=1:3]
+             VARIABLE : 2 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + 2
+             VARIABLE : I1[I=1:3] + 2
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x 2 + i1[i=1:3]
+             VARIABLE : 2 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i[i=1:3] + c1
+             VARIABLE : I[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i[i=1:3]
+             VARIABLE : C1 + I[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i1[i=1:3] + c1
+             VARIABLE : I1[I=1:3] + C1
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x c1 + i1[i=1:3]
+             VARIABLE : C1 + I1[I=1:3]
+             SUBSET   : 3 points (X)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/i=1:3/k=2
+list/order=x i + k
+             VARIABLE : I + K
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1
+             VARIABLE : I + K1
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x k1 + i
+             VARIABLE : K1 + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/i=1:3/k=1
+list/order=x i + k[k=2]
+             VARIABLE : I + K[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=x i + k1[k=2]
+             VARIABLE : I + K1[K=2]
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+! ... crash here ...
+list/order=x k1[k=2] + i
+             VARIABLE : K1[K=2] + I
+             SUBSET   : 3 points (X)
+             Z        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/ORDER=X  I
+             VARIABLE : I
+                        axis ABSTRACT
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  I*3
+             VARIABLE : I*3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/ORDER=X  I/3
+             VARIABLE : I/3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  I+3
+             VARIABLE : I+3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/ORDER=X  I-3
+             VARIABLE : I-3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/ORDER=X  I^3
+             VARIABLE : I^3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/ORDER=X  I EQ 3
+             VARIABLE : I EQ 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  I NE 3
+             VARIABLE : I NE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  I GT 3
+             VARIABLE : I GT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/ORDER=X  I GE 3
+             VARIABLE : I GE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  I LT 3
+             VARIABLE : I LT 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/ORDER=X  I LE 3
+             VARIABLE : I LE 3
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/ORDER=X  (I LT 3) OR (I GT 3)
+             VARIABLE : (I LT 3) OR (I GT 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/ORDER=X  (I LE 3) AND (I GE 3)
+             VARIABLE : (I LE 3) AND (I GE 3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/ORDER=X  (I+3)*3 - 9 - (I+I+I)
+             VARIABLE : (I+3)*3 - 9 - (I+I+I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/ORDER=X  J * ( (I+3)*3 - 9 - (I+I+I) )
+             VARIABLE : J * ( (I+3)*3 - 9 - (I+I+I) )
+             SUBSET   : 5 by 5 points (X-Y)
+             1       2       3       4       5     
+              1       2       3       4       5
+ 1   / 1:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 2   / 2:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 3   / 3:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 4   / 4:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 5   / 5:  0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IF I GT 3 THEN I
+             VARIABLE : IF I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IF I GT 3 THEN I ELSE 0
+             VARIABLE : IF I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = IF I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IF I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/ORDER=X  MAX(I,3)
+             VARIABLE : MAX(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/ORDER=X  MIN(I,3)
+             VARIABLE : MIN(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/ORDER=X  INT(I/3)
+             VARIABLE : INT(I/3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/ORDER=X  ABS(I-3)
+             VARIABLE : ABS(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/ORDER=X  EXP(I)
+             VARIABLE : EXP(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/ORDER=X  LN(I)
+             VARIABLE : LN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/ORDER=X  LN(EXP(I))
+             VARIABLE : LN(EXP(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  EXP(LN(I))
+             VARIABLE : EXP(LN(I))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  LOG(I)
+             VARIABLE : LOG(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/ORDER=X  LOG(10^I)
+             VARIABLE : LOG(10^I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  10^LOG(I)
+             VARIABLE : 10^LOG(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/ORDER=X  SIN(I)
+             VARIABLE : SIN(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/ORDER=X  ASIN(SIN(I/3))
+             VARIABLE : ASIN(SIN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/ORDER=X  COS(I)
+             VARIABLE : COS(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/ORDER=X  ACOS(COS(I/3))
+             VARIABLE : ACOS(COS(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/ORDER=X  TAN(I)
+             VARIABLE : TAN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/ORDER=X  ATAN(TAN(I/3))
+             VARIABLE : ATAN(TAN(I/3))
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/J=1:3    ATAN2(J-1,I-1)
+             VARIABLE : ATAN2(J-1,I-1)
+             SUBSET   : 5 by 3 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/ORDER=X  MOD(I,3)
+             VARIABLE : MOD(I,3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/ORDER=X  IGNORE0(I-3)
+             VARIABLE : IGNORE0(I-3)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/ORDER=X  MISSING( IGNORE0(I-3),-9 )
+             VARIABLE : MISSING( IGNORE0(I-3),-9 )
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/ORDER=X  RANDU(I)
+             VARIABLE : RANDU(I)
+             SUBSET   : 5 points (X)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/ORDER=X  RANDN(I)
+             VARIABLE : RANDN(I)
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! commented out 1/96
+!! test a little postfix, too
+!SET MODE POLISH
+!SET REGION/I=1:5/J=1:5
+!LIST/ORDER=X  I 3 LE I 3 GE AND
+!LIST/ORDER=X  I 3 + 3 * 9 - I I I + + -
+!LIST/J=1:3    J 1 - I 1 - ATAN2
+!! ... bug - negative constants not processed properly ...
+!SET MODE IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 -9 MISSING
+!SET MODE/LAST IGNORE_ERRORS
+!LIST/ORDER=X  I 3 - IGNORE0 0 9 - MISSING
+!CANCEL MODE POLISH
+ 
+! test formatted output where the output field is too small
+LIST/I=1:3/FORMAT=(F6.2) 1/(i-2)		! single column test
+             VARIABLE : 1/(I-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (X)
+             X        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/I=1:3/FORMAT=(2F6.2) 1/(i-2),2/(i-2)	! multi-column test
+             X: 0.5 to 3.5
+ Column  1: EX#1 is 1/(I-2)
+ Column  2: EX#2 is 2/(I-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test new grid box limit pseudo-variables
+LIST/I=5:7 XBOXLO, XBOXHI
+             X: 4.5 to 7.5
+ Column  1: XBOXLO is XBOXLO (axis ABSTRACT)
+ Column  2: XBOXHI is XBOXHI (axis ABSTRACT)
+        XBOXLO  XBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/J=5:7 YBOXLO, YBOXHI
+             Y: 4.5 to 7.5
+ Column  1: YBOXLO is YBOXLO (axis ABSTRACT)
+ Column  2: YBOXHI is YBOXHI (axis ABSTRACT)
+        YBOXLO  YBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/K=5:7 ZBOXLO, ZBOXHI
+             Z: 4.5 to 7.5
+ Column  1: ZBOXLO is ZBOXLO (axis ABSTRACT)
+ Column  2: ZBOXHI is ZBOXHI (axis ABSTRACT)
+        ZBOXLO  ZBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/L=5:7 TBOXLO, TBOXHI
+             T: 4.5 to 7.5
+ Column  1: TBOXLO is TBOXLO (axis ABSTRACT)
+ Column  2: TBOXHI is TBOXHI (axis ABSTRACT)
+        TBOXLO  TBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+*** Running test: bn_geometry.jnl
+! bn200_geometry.JNL
+! benchmark various geometries for accessing FERRET data
+! similar tests are performed on:
+!	abstract variable
+!	(user variable) transformed file variable
+!	memory-resident file variable
+!	disk-resident file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v_abst = i + 10*j + 100*k + 1000*l
+DEFINE REGION/I=1 IPT
+DEFINE REGION/J=1 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=1:5/J=1:5/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION v_abst
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1112.  1113.  1114.  1115.
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1121.  1131.  1141.  1151.
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  1211.  1311.  1411.  1511.
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+            1      2      3      4      5    
+            1      2      3      4      5
+          1111.  2111.  3111.  4111.  5111.
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Y)
+             Z        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-Z)
+             Y        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+LIST/@JPT/@KPT	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (X-T)
+             Y        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  2111.  2112.  2113.  2114.  2115.
+ 3   / 3:  3111.  3112.  3113.  3114.  3115.
+ 4   / 4:  4111.  4112.  4113.  4114.  4115.
+ 5   / 5:  5111.  5112.  5113.  5114.  5115.
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-Z)
+             X        : 1
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+LIST/@IPT/@KPT	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Y-T)
+             X        : 1
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  2111.  2121.  2131.  2141.  2151.
+ 3   / 3:  3111.  3121.  3131.  3141.  3151.
+ 4   / 4:  4111.  4121.  4131.  4141.  4151.
+ 5   / 5:  5111.  5121.  5131.  5141.  5151.
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 points (Z-T)
+             X        : 1
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  1111.  1211.  1311.  1411.  1511.
+ 2   / 2:  2111.  2211.  2311.  2411.  2511.
+ 3   / 3:  3111.  3211.  3311.  3411.  3511.
+ 4   / 4:  4111.  4211.  4311.  4411.  4511.
+ 5   / 5:  5111.  5211.  5311.  5411.  5511.
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-Z)
+             T        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.  1214.  1215.
+ 2   / 2:  1221.  1222.  1223.  1224.  1225.
+ 3   / 3:  1231.  1232.  1233.  1234.  1235.
+ 4   / 4:  1241.  1242.  1243.  1244.  1245.
+ 5   / 5:  1251.  1252.  1253.  1254.  1255.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.  1314.  1315.
+ 2   / 2:  1321.  1322.  1323.  1324.  1325.
+ 3   / 3:  1331.  1332.  1333.  1334.  1335.
+ 4   / 4:  1341.  1342.  1343.  1344.  1345.
+ 5   / 5:  1351.  1352.  1353.  1354.  1355.
+ ---- K:4 Z:   4
+ 1   / 1:  1411.  1412.  1413.  1414.  1415.
+ 2   / 2:  1421.  1422.  1423.  1424.  1425.
+ 3   / 3:  1431.  1432.  1433.  1434.  1435.
+ 4   / 4:  1441.  1442.  1443.  1444.  1445.
+ 5   / 5:  1451.  1452.  1453.  1454.  1455.
+ ---- K:5 Z:   5
+ 1   / 1:  1511.  1512.  1513.  1514.  1515.
+ 2   / 2:  1521.  1522.  1523.  1524.  1525.
+ 3   / 3:  1531.  1532.  1533.  1534.  1535.
+ 4   / 4:  1541.  1542.  1543.  1544.  1545.
+ 5   / 5:  1551.  1552.  1553.  1554.  1555.
+LIST/@KPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Y-T)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1121.  1122.  1123.  1124.  1125.
+ 3   / 3:  1131.  1132.  1133.  1134.  1135.
+ 4   / 4:  1141.  1142.  1143.  1144.  1145.
+ 5   / 5:  1151.  1152.  1153.  1154.  1155.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2121.  2122.  2123.  2124.  2125.
+ 3   / 3:  2131.  2132.  2133.  2134.  2135.
+ 4   / 4:  2141.  2142.  2143.  2144.  2145.
+ 5   / 5:  2151.  2152.  2153.  2154.  2155.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3121.  3122.  3123.  3124.  3125.
+ 3   / 3:  3131.  3132.  3133.  3134.  3135.
+ 4   / 4:  3141.  3142.  3143.  3144.  3145.
+ 5   / 5:  3151.  3152.  3153.  3154.  3155.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4121.  4122.  4123.  4124.  4125.
+ 3   / 3:  4131.  4132.  4133.  4134.  4135.
+ 4   / 4:  4141.  4142.  4143.  4144.  4145.
+ 5   / 5:  4151.  4152.  4153.  4154.  4155.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5121.  5122.  5123.  5124.  5125.
+ 3   / 3:  5131.  5132.  5133.  5134.  5135.
+ 4   / 4:  5141.  5142.  5143.  5144.  5145.
+ 5   / 5:  5151.  5152.  5153.  5154.  5155.
+LIST/@JPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (X-Z-T)
+             Y        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1112.  1113.  1114.  1115.
+ 2   / 2:  1211.  1212.  1213.  1214.  1215.
+ 3   / 3:  1311.  1312.  1313.  1314.  1315.
+ 4   / 4:  1411.  1412.  1413.  1414.  1415.
+ 5   / 5:  1511.  1512.  1513.  1514.  1515.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2112.  2113.  2114.  2115.
+ 2   / 2:  2211.  2212.  2213.  2214.  2215.
+ 3   / 3:  2311.  2312.  2313.  2314.  2315.
+ 4   / 4:  2411.  2412.  2413.  2414.  2415.
+ 5   / 5:  2511.  2512.  2513.  2514.  2515.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3112.  3113.  3114.  3115.
+ 2   / 2:  3211.  3212.  3213.  3214.  3215.
+ 3   / 3:  3311.  3312.  3313.  3314.  3315.
+ 4   / 4:  3411.  3412.  3413.  3414.  3415.
+ 5   / 5:  3511.  3512.  3513.  3514.  3515.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4112.  4113.  4114.  4115.
+ 2   / 2:  4211.  4212.  4213.  4214.  4215.
+ 3   / 3:  4311.  4312.  4313.  4314.  4315.
+ 4   / 4:  4411.  4412.  4413.  4414.  4415.
+ 5   / 5:  4511.  4512.  4513.  4514.  4515.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5112.  5113.  5114.  5115.
+ 2   / 2:  5211.  5212.  5213.  5214.  5215.
+ 3   / 3:  5311.  5312.  5313.  5314.  5315.
+ 4   / 4:  5411.  5412.  5413.  5414.  5415.
+ 5   / 5:  5511.  5512.  5513.  5514.  5515.
+LIST/@IPT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 5 by 5 by 5 points (Y-Z-T)
+             X        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ 1   / 1:  1111.  1121.  1131.  1141.  1151.
+ 2   / 2:  1211.  1221.  1231.  1241.  1251.
+ 3   / 3:  1311.  1321.  1331.  1341.  1351.
+ 4   / 4:  1411.  1421.  1431.  1441.  1451.
+ 5   / 5:  1511.  1521.  1531.  1541.  1551.
+ ---- L:2 T:   2
+ 1   / 1:  2111.  2121.  2131.  2141.  2151.
+ 2   / 2:  2211.  2221.  2231.  2241.  2251.
+ 3   / 3:  2311.  2321.  2331.  2341.  2351.
+ 4   / 4:  2411.  2421.  2431.  2441.  2451.
+ 5   / 5:  2511.  2521.  2531.  2541.  2551.
+ ---- L:3 T:   3
+ 1   / 1:  3111.  3121.  3131.  3141.  3151.
+ 2   / 2:  3211.  3221.  3231.  3241.  3251.
+ 3   / 3:  3311.  3321.  3331.  3341.  3351.
+ 4   / 4:  3411.  3421.  3431.  3441.  3451.
+ 5   / 5:  3511.  3521.  3531.  3541.  3551.
+ ---- L:4 T:   4
+ 1   / 1:  4111.  4121.  4131.  4141.  4151.
+ 2   / 2:  4211.  4221.  4231.  4241.  4251.
+ 3   / 3:  4311.  4321.  4331.  4341.  4351.
+ 4   / 4:  4411.  4421.  4431.  4441.  4451.
+ 5   / 5:  4511.  4521.  4531.  4541.  4551.
+ ---- L:5 T:   5
+ 1   / 1:  5111.  5121.  5131.  5141.  5151.
+ 2   / 2:  5211.  5221.  5231.  5241.  5251.
+ 3   / 3:  5311.  5321.  5331.  5341.  5351.
+ 4   / 4:  5411.  5421.  5431.  5441.  5451.
+ 5   / 5:  5511.  5521.  5531.  5541.  5551.
+ 
+! 4D region
+LOAD
+ 
+! ******** transformed file variable ************
+USE gt4d011
+LET temp_sq = temp^2
+DEFINE REGION/I=101 IPT
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp_sq
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          664.8  665.8  666.6  665.4  662.8
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          664.8  670.7  678.3  687.3  698.1
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          664.8  658.8  650.5  642.6  633.2
+LIST/@IPT/@JPT/@KPT/ORDER=T
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          664.8  674.8  685.3  696.6  708.4
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+LIST/@JPT/@LPT	!XZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+LIST/@JPT/@KPT	!XT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  664.8  665.8  666.6  665.4  662.8
+ 23-AUG-1982 14 / 2:  674.8  674.4  672.8  670.1  667.2
+ 29-AUG-1982 16 / 3:  685.3  682.5  679.4  676.5  674.4
+ 04-SEP-1982 18 / 4:  696.6  692.3  688.4  685.6  684.0
+ 10-SEP-1982 20 / 5:  708.4  704.7  700.4  697.1  695.1
+LIST/@IPT/@LPT	!YZ
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+LIST/@IPT/@KPT	!YT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  664.8  670.7  678.3  687.3  698.1
+ 23-AUG-1982 14 / 2:  674.8  681.5  689.5  699.0  710.0
+ 29-AUG-1982 16 / 3:  685.3  691.9  700.1  710.3  721.6
+ 04-SEP-1982 18 / 4:  696.6  702.9  711.1  721.2  731.5
+ 10-SEP-1982 20 / 5:  708.4  714.1  721.8  730.4  738.2
+LIST/@IPT/@JPT	!ZT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  664.8  658.8  650.5  642.6  633.2
+ 23-AUG-1982 14 / 2:  674.8  669.2  660.6  652.7  643.1
+ 29-AUG-1982 16 / 3:  685.3  680.3  672.3  665.2  655.3
+ 04-SEP-1982 18 / 4:  696.6  692.0  684.3  677.9  667.3
+ 10-SEP-1982 20 / 5:  708.4  704.0  695.0  688.9  678.3
+ 
+! cubes of data
+LIST/@LPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- K:2 Z:   15
+ 1.5N  / 50:  694.9  696.6  698.7  699.4  698.2
+ 1.17N / 49:  683.5  686.1  688.3  688.2  686.2
+ 0.83N / 48:  673.8  676.5  678.3  677.6  675.0
+ 0.5N  / 47:  665.4  667.6  669.0  668.0  665.2
+ 0.17N / 46:  658.8  659.8  660.6  659.5  657.0
+ ---- K:3 Z:   25
+ 1.5N  / 50:  694.3  695.9  698.0  698.9  697.7
+ 1.17N / 49:  682.2  684.7  687.1  687.4  685.4
+ 0.83N / 48:  670.7  673.5  675.7  675.5  673.0
+ 0.5N  / 47:  659.6  661.9  663.6  663.2  660.6
+ 0.17N / 46:  650.5  651.6  652.5  651.8  649.5
+ ---- K:4 Z:   35
+ 1.5N  / 50:  694.4  696.0  698.1  699.0  697.8
+ 1.17N / 49:  681.9  684.4  686.8  687.2  685.2
+ 0.83N / 48:  668.7  671.3  673.3  673.5  671.0
+ 0.5N  / 47:  654.3  656.2  657.3  656.9  654.3
+ 0.17N / 46:  642.6  643.2  643.2  642.2  639.8
+ ---- K:5 Z:   45
+ 1.5N  / 50:  694.5  696.1  698.2  699.0  697.9
+ 1.17N / 49:  681.4  683.8  685.9  686.5  684.5
+ 0.83N / 48:  664.2  665.9  666.5  666.0  663.3
+ 0.5N  / 47:  645.7  646.5  645.8  644.0  641.0
+ 0.17N / 46:  633.2  632.6  631.0  628.7  625.8
+LIST/@KPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  698.1  699.9  702.0  702.5  701.2
+ 1.17N / 49:  687.3  690.0  691.9  691.7  689.5
+ 0.83N / 48:  678.3  681.0  682.6  681.7  678.9
+ 0.5N  / 47:  670.7  672.9  674.1  672.9  670.1
+ 0.17N / 46:  664.8  665.8  666.6  665.4  662.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  710.0  709.0  707.8  706.0  703.5
+ 1.17N / 49:  699.0  698.2  697.0  694.4  691.4
+ 0.83N / 48:  689.5  689.0  687.5  684.5  681.3
+ 0.5N  / 47:  681.5  681.1  679.5  676.5  673.4
+ 0.17N / 46:  674.8  674.4  672.8  670.1  667.2
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  721.6  717.3  712.8  709.6  707.5
+ 1.17N / 49:  710.3  705.9  701.5  698.1  695.9
+ 0.83N / 48:  700.1  696.1  692.1  688.7  686.5
+ 0.5N  / 47:  691.9  688.4  684.9  681.7  679.5
+ 0.17N / 46:  685.3  682.5  679.4  676.5  674.4
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  731.5  725.7  718.0  713.9  713.0
+ 1.17N / 49:  721.2  714.2  707.1  703.4  702.5
+ 0.83N / 48:  711.1  704.5  698.6  695.2  694.3
+ 0.5N  / 47:  702.9  697.4  692.6  689.5  688.3
+ 0.17N / 46:  696.6  692.3  688.4  685.6  684.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  738.2  735.8  726.4  720.5  720.1
+ 1.17N / 49:  730.4  725.1  716.1  711.0  710.5
+ 0.83N / 48:  721.8  715.7  708.5  704.2  703.4
+ 0.5N  / 47:  714.1  708.9  703.4  699.8  698.4
+ 0.17N / 46:  708.4  704.7  700.4  697.1  695.1
+LIST/@JPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  665.8  666.6  665.4  662.8
+ 15    / 2:  658.8  659.8  660.6  659.5  657.0
+ 25    / 3:  650.5  651.6  652.5  651.8  649.5
+ 35    / 4:  642.6  643.2  643.2  642.2  639.8
+ 45    / 5:  633.2  632.6  631.0  628.7  625.8
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  674.4  672.8  670.1  667.2
+ 15    / 2:  669.2  668.9  667.3  664.6  661.6
+ 25    / 3:  660.6  660.8  659.4  656.7  653.6
+ 35    / 4:  652.7  652.9  651.0  648.1  644.9
+ 45    / 5:  643.1  642.3  639.7  636.2  633.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  682.5  679.4  676.5  674.4
+ 15    / 2:  680.3  677.5  674.3  671.3  669.0
+ 25    / 3:  672.3  670.2  666.5  662.8  660.1
+ 35    / 4:  665.2  663.6  659.6  655.6  652.4
+ 45    / 5:  655.3  653.6  649.7  645.7  642.6
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  692.3  688.4  685.6  684.0
+ 15    / 2:  692.0  687.7  683.5  680.5  678.8
+ 25    / 3:  684.3  680.5  675.0  670.7  668.3
+ 35    / 4:  677.9  674.9  669.3  664.5  661.4
+ 45    / 5:  667.3  665.0  660.5  656.2  653.0
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  704.7  700.4  697.1  695.1
+ 15    / 2:  704.0  700.2  695.7  692.1  690.1
+ 25    / 3:  695.0  692.2  685.8  680.4  677.6
+ 35    / 4:  688.9  687.1  680.9  675.2  671.8
+ 45    / 5:  678.3  676.6  672.2  667.7  664.3
+LIST/@IPT
+             VARIABLE : TEMP^2
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  664.8  670.7  678.3  687.3  698.1
+ 15    / 2:  658.8  665.4  673.8  683.5  694.9
+ 25    / 3:  650.5  659.6  670.7  682.2  694.3
+ 35    / 4:  642.6  654.3  668.7  681.9  694.4
+ 45    / 5:  633.2  645.7  664.2  681.4  694.5
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  674.8  681.5  689.5  699.0  710.0
+ 15    / 2:  669.2  676.7  685.5  695.7  707.2
+ 25    / 3:  660.6  671.4  683.3  694.9  706.9
+ 35    / 4:  652.7  666.4  681.9  694.9  707.0
+ 45    / 5:  643.1  657.3  677.1  694.8  707.0
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  685.3  691.9  700.1  710.3  721.6
+ 15    / 2:  680.3  687.7  696.8  707.5  719.1
+ 25    / 3:  672.3  683.9  695.6  707.2  718.8
+ 35    / 4:  665.2  680.2  695.2  707.3  718.9
+ 45    / 5:  655.3  670.9  691.1  707.3  718.9
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  696.6  702.9  711.1  721.2  731.5
+ 15    / 2:  692.0  699.1  708.1  718.5  728.9
+ 25    / 3:  684.3  696.0  707.3  718.3  728.5
+ 35    / 4:  677.9  693.1  707.2  718.3  728.7
+ 45    / 5:  667.3  683.1  703.1  718.3  728.7
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  708.4  714.1  721.8  730.4  738.2
+ 15    / 2:  704.0  710.4  718.6  727.4  735.1
+ 25    / 3:  695.0  706.8  717.4  726.4  733.8
+ 35    / 4:  688.9  703.8  717.2  726.4  733.8
+ 45    / 5:  678.3  692.9  712.0  726.2  733.9
+ 
+! 4D region
+LOAD
+ 
+! ******** memory-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+LOAD		! load full 4-D region
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:  101  101  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:  101  101  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:   46   46  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:  101  101  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ -DELETE TEMP     M: 29 dset:   1 I:    1    5  J:    1    5  K:  101  101  L:   46   46  M: -999 -999  N: -999 -999
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+ -DELETE TEMP     M: 29 dset:   1 I:  101  105  J:    1    5  K:    1    5  L:   46   46  M: -999 -999  N: -999 -999
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ -DELETE TEMP     M: 29 dset:   1 I:   46   50  J:    1    5  K:    1    5  L:  101  101  M: -999 -999  N: -999 -999
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ found   TEMP     M: 31 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** disk-resident file variable ************
+USE gt4d011
+CANCEL MEMORY/ALL
+SET MODE DIAGNOSTIC
+DEFINE REGION/I=101 IPT
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+DEFINE REGION/J=46 JPT
+DEFINE REGION/K=1 KPT
+DEFINE REGION/L=1 LPT
+DEFINE REGION/I=101:105/J=46:50/K=1:5/L=1:5 R4D
+SET REG R4D
+SET EXPRESSION temp
+GO bn_geometry.sub
+! BN200_GEOMETRY.SUB
+! list the variable vtest on variuos geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! lines of data
+LIST/@JPT/@KPT/@LPT/ORDER=X
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 31 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+          129.5W 128.5W 127.5W 126.5W 125.5W 
+          101    102    103    104    105
+          25.78  25.80  25.82  25.80  25.74
+LIST/@IPT/@KPT/@LPT/ORDER=Y
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 29 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (LATITUDE)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+           0.17N  0.5N   0.83N  1.17N  1.5N  
+           46     47     48     49     50
+          25.78  25.90  26.04  26.22  26.42
+LIST/@IPT/@JPT/@LPT/ORDER=Z
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 28 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (DEPTH (m))
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+           5      15     25     35     45    
+            1      2      3      4      5
+          25.78  25.67  25.51  25.35  25.16
+LIST/@IPT/@JPT/@KPT/ORDER=T
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 27 dset:   1 I:  101  101  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+           1982   1982   1982   1982   1982  
+            1      2      3      4      5
+          25.78  25.98  26.18  26.39  26.62
+ 
+! planes of data
+LIST/@KPT/@LPT	!XY
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 26 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+LIST/@JPT/@LPT	!XZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 25 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N
+             TIME     : 17-AUG-1982 12:00
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+LIST/@JPT/@KPT	!XT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 24 dset:   1 I:  101  105  J:   46   46  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N
+             DEPTH (m): 5
+                      129.5W 128.5W 127.5W 126.5W 125.5W 
+                      101    102    103    104    105
+ 17-AUG-1982 12 / 1:  25.78  25.80  25.82  25.80  25.74
+ 23-AUG-1982 14 / 2:  25.98  25.97  25.94  25.89  25.83
+ 29-AUG-1982 16 / 3:  26.18  26.13  26.07  26.01  25.97
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.24  26.18  26.15
+ 10-SEP-1982 20 / 5:  26.62  26.55  26.47  26.40  26.36
+LIST/@IPT/@LPT	!YZ
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 23 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W
+             TIME     : 17-AUG-1982 12:00
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+LIST/@IPT/@KPT	!YT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 22 dset:   1 I:  101  101  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W
+             DEPTH (m): 5
+                       0.17N  0.5N   0.83N  1.17N  1.5N  
+                       46     47     48     49     50
+ 17-AUG-1982 12 / 1:  25.78  25.90  26.04  26.22  26.42
+ 23-AUG-1982 14 / 2:  25.98  26.10  26.26  26.44  26.65
+ 29-AUG-1982 16 / 3:  26.18  26.30  26.46  26.65  26.86
+ 04-SEP-1982 18 / 4:  26.39  26.51  26.67  26.85  27.05
+ 10-SEP-1982 20 / 5:  26.62  26.72  26.87  27.03  27.17
+LIST/@IPT/@JPT	!ZT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 21 dset:   1 I:  101  101  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+             LATITUDE : 0.2N
+                       5      15     25     35     45    
+                        1      2      3      4      5
+ 17-AUG-1982 12 / 1:  25.78  25.67  25.51  25.35  25.16
+ 23-AUG-1982 14 / 2:  25.98  25.87  25.70  25.55  25.36
+ 29-AUG-1982 16 / 3:  26.18  26.08  25.93  25.79  25.60
+ 04-SEP-1982 18 / 4:  26.39  26.31  26.16  26.04  25.83
+ 10-SEP-1982 20 / 5:  26.62  26.53  26.36  26.25  26.04
+ 
+! cubes of data
+LIST/@LPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+ reading TEMP     M: 20 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 17-AUG-1982 12:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- K:1 Z:   5
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- K:2 Z:   15
+ 1.5N  / 50:  26.36  26.39  26.43  26.45  26.42
+ 1.17N / 49:  26.14  26.19  26.23  26.23  26.19
+ 0.83N / 48:  25.96  26.01  26.04  26.03  25.98
+ 0.5N  / 47:  25.80  25.84  25.87  25.85  25.79
+ 0.17N / 46:  25.67  25.69  25.70  25.68  25.63
+ ---- K:3 Z:   25
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.41
+ 1.17N / 49:  26.12  26.17  26.21  26.22  26.18
+ 0.83N / 48:  25.90  25.95  25.99  25.99  25.94
+ 0.5N  / 47:  25.68  25.73  25.76  25.75  25.70
+ 0.17N / 46:  25.51  25.53  25.54  25.53  25.48
+ ---- K:4 Z:   35
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.11  26.16  26.21  26.22  26.18
+ 0.83N / 48:  25.86  25.91  25.95  25.95  25.90
+ 0.5N  / 47:  25.58  25.62  25.64  25.63  25.58
+ 0.17N / 46:  25.35  25.36  25.36  25.34  25.29
+ ---- K:5 Z:   45
+ 1.5N  / 50:  26.35  26.38  26.42  26.44  26.42
+ 1.17N / 49:  26.10  26.15  26.19  26.20  26.16
+ 0.83N / 48:  25.77  25.81  25.82  25.81  25.76
+ 0.5N  / 47:  25.41  25.43  25.41  25.38  25.32
+ 0.17N / 46:  25.16  25.15  25.12  25.07  25.02
+LIST/@KPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 19 dset:   1 I:  101  105  J:   46   50  K:    1    1  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 5
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1.5N  / 50:  26.42  26.46  26.50  26.51  26.48
+ 1.17N / 49:  26.22  26.27  26.30  26.30  26.26
+ 0.83N / 48:  26.04  26.10  26.13  26.11  26.06
+ 0.5N  / 47:  25.90  25.94  25.96  25.94  25.89
+ 0.17N / 46:  25.78  25.80  25.82  25.80  25.74
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1.5N  / 50:  26.65  26.63  26.60  26.57  26.52
+ 1.17N / 49:  26.44  26.42  26.40  26.35  26.29
+ 0.83N / 48:  26.26  26.25  26.22  26.16  26.10
+ 0.5N  / 47:  26.10  26.10  26.07  26.01  25.95
+ 0.17N / 46:  25.98  25.97  25.94  25.89  25.83
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1.5N  / 50:  26.86  26.78  26.70  26.64  26.60
+ 1.17N / 49:  26.65  26.57  26.49  26.42  26.38
+ 0.83N / 48:  26.46  26.38  26.31  26.24  26.20
+ 0.5N  / 47:  26.30  26.24  26.17  26.11  26.07
+ 0.17N / 46:  26.18  26.13  26.07  26.01  25.97
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1.5N  / 50:  27.05  26.94  26.80  26.72  26.70
+ 1.17N / 49:  26.85  26.72  26.59  26.52  26.51
+ 0.83N / 48:  26.67  26.54  26.43  26.37  26.35
+ 0.5N  / 47:  26.51  26.41  26.32  26.26  26.23
+ 0.17N / 46:  26.39  26.31  26.24  26.18  26.15
+ ---- L:5 T:   10-SEP-1982 20:00
+ 1.5N  / 50:  27.17  27.13  26.95  26.84  26.83
+ 1.17N / 49:  27.03  26.93  26.76  26.66  26.65
+ 0.83N / 48:  26.87  26.75  26.62  26.54  26.52
+ 0.5N  / 47:  26.72  26.63  26.52  26.45  26.43
+ 0.17N / 46:  26.62  26.55  26.47  26.40  26.36
+LIST/@JPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 18 dset:   1 I:  101  105  J:   46   46  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N
+             129.5W 128.5W 127.5W 126.5W 125.5W 
+             101    102    103    104    105
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.80  25.82  25.80  25.74
+ 15    / 2:  25.67  25.69  25.70  25.68  25.63
+ 25    / 3:  25.51  25.53  25.54  25.53  25.48
+ 35    / 4:  25.35  25.36  25.36  25.34  25.29
+ 45    / 5:  25.16  25.15  25.12  25.07  25.02
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  25.97  25.94  25.89  25.83
+ 15    / 2:  25.87  25.86  25.83  25.78  25.72
+ 25    / 3:  25.70  25.71  25.68  25.63  25.57
+ 35    / 4:  25.55  25.55  25.52  25.46  25.40
+ 45    / 5:  25.36  25.34  25.29  25.22  25.16
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.13  26.07  26.01  25.97
+ 15    / 2:  26.08  26.03  25.97  25.91  25.87
+ 25    / 3:  25.93  25.89  25.82  25.75  25.69
+ 35    / 4:  25.79  25.76  25.68  25.60  25.54
+ 45    / 5:  25.60  25.56  25.49  25.41  25.35
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.31  26.24  26.18  26.15
+ 15    / 2:  26.31  26.22  26.14  26.09  26.05
+ 25    / 3:  26.16  26.09  25.98  25.90  25.85
+ 35    / 4:  26.04  25.98  25.87  25.78  25.72
+ 45    / 5:  25.83  25.79  25.70  25.62  25.55
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.55  26.47  26.40  26.36
+ 15    / 2:  26.53  26.46  26.38  26.31  26.27
+ 25    / 3:  26.36  26.31  26.19  26.08  26.03
+ 35    / 4:  26.25  26.21  26.09  25.98  25.92
+ 45    / 5:  26.04  26.01  25.93  25.84  25.77
+LIST/@IPT
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 17 dset:   1 I:  101  101  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 5 by 5 by 5 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W
+              0.17N  0.5N   0.83N  1.17N  1.5N  
+              46     47     48     49     50
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:  25.78  25.90  26.04  26.22  26.42
+ 15    / 2:  25.67  25.80  25.96  26.14  26.36
+ 25    / 3:  25.51  25.68  25.90  26.12  26.35
+ 35    / 4:  25.35  25.58  25.86  26.11  26.35
+ 45    / 5:  25.16  25.41  25.77  26.10  26.35
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:  25.98  26.10  26.26  26.44  26.65
+ 15    / 2:  25.87  26.01  26.18  26.38  26.59
+ 25    / 3:  25.70  25.91  26.14  26.36  26.59
+ 35    / 4:  25.55  25.82  26.11  26.36  26.59
+ 45    / 5:  25.36  25.64  26.02  26.36  26.59
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:  26.18  26.30  26.46  26.65  26.86
+ 15    / 2:  26.08  26.22  26.40  26.60  26.82
+ 25    / 3:  25.93  26.15  26.38  26.59  26.81
+ 35    / 4:  25.79  26.08  26.37  26.59  26.81
+ 45    / 5:  25.60  25.90  26.29  26.59  26.81
+ ---- L:4 T:   04-SEP-1982 18:00
+ 5     / 1:  26.39  26.51  26.67  26.85  27.05
+ 15    / 2:  26.31  26.44  26.61  26.81  27.00
+ 25    / 3:  26.16  26.38  26.60  26.80  26.99
+ 35    / 4:  26.04  26.33  26.59  26.80  26.99
+ 45    / 5:  25.83  26.14  26.52  26.80  26.99
+ ---- L:5 T:   10-SEP-1982 20:00
+ 5     / 1:  26.62  26.72  26.87  27.03  27.17
+ 15    / 2:  26.53  26.65  26.81  26.97  27.11
+ 25    / 3:  26.36  26.59  26.78  26.95  27.09
+ 35    / 4:  26.25  26.53  26.78  26.95  27.09
+ 45    / 5:  26.04  26.32  26.68  26.95  27.09
+ 
+! 4D region
+LOAD
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+ reading TEMP     M: 16 dset:   1 I:  101  105  J:   46   50  K:    1    5  L:    1    5  M: -999 -999  N: -999 -999
+SET MODE/LAST DIAGNOSTIC
+ 
+! ******** diagnostic variable ************
+! *3/99* *kob* comment out look at qady variable - no longer important
+!USE gt160w011
+!DEFINE REGION/I=70 IPT
+!DEFINE REGION/J=50 JPT
+!DEFINE REGION/K=1 KPT
+!DEFINE REGION/L=1 LPT
+!DEFINE REGION/I=70:72/J=46:50/K=1:5/L=1:3 R4D
+!SET REG R4D
+!SET EXPRESSION qady
+!GO bn_geometry.sub
+ 
+! generate error through non-comformable limits
+SET MODE IGNORE_ERRORS
+LIST X[I=1:5] - X[I=6:9]
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+*** Running test: bn_output.jnl
+! bn200_output.JNL
+! - test various output methods in FERRET
+! rev 0.0  4/27/90 *sh*
+ 
+LET v = 1000*i + 100*j + 10*k + l
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+SET EXPRESSION v
+LOAD
+ 
+! ------------------------------------------
+! single variable list
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XYTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-T-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  1368.  2368.
+ 4   / 4:  1468.  2468.
+LIST/ORDER=XZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-Y-T)
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Z-T-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  1458.  2458.
+ 6   / 6:  1468.  2468.
+LIST/ORDER=XTYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Y-Z)
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=XTZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (X-T-Z-Y)
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  1467.  2467.
+ 8   / 8:  1468.  2468.
+LIST/ORDER=YXZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-Z-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YXTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-X-T-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1368.  1468.
+ 2   / 2:  2368.  2468.
+LIST/ORDER=YZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-X-T)
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-Z-T-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+ ---- L:8 T:   8
+ 5   / 5:  2358.  2458.
+ 6   / 6:  2368.  2468.
+LIST/ORDER=YTXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-X-Z)
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=YTZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Y-T-Z-X)
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+ ---- K:6 Z:   6
+ 7   / 7:  2367.  2467.
+ 8   / 8:  2368.  2468.
+LIST/ORDER=ZXYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-Y-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZXTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-X-T-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:8 T:   8
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+LIST/ORDER=ZYXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-X-T)
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZYTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-Y-T-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ ---- L:8 T:   8
+ 3   / 3:  2358.  2368.
+ 4   / 4:  2458.  2468.
+LIST/ORDER=ZTXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-X-Y)
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=ZTYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (Z-T-Y-X)
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+ ---- J:4 Y:   4
+ 7   / 7:  2457.  2467.
+ 8   / 8:  2458.  2468.
+LIST/ORDER=TXYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Y-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TXZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-X-Z-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+ ---- K:6 Z:   6
+ 1   / 1:  1467.  1468.
+ 2   / 2:  2467.  2468.
+LIST/ORDER=TYXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-X-Z)
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TYZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Y-Z-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ ---- K:6 Z:   6
+ 3   / 3:  2367.  2368.
+ 4   / 4:  2467.  2468.
+LIST/ORDER=TZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-X-Y)
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+LIST/ORDER=TZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 by 2 points (T-Z-Y-X)
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ ---- J:4 Y:   4
+ 5   / 5:  2457.  2458.
+ 6   / 6:  2467.  2468.
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  1458.
+ 6   / 6:  1368.  1468.
+LIST/ORDER=YTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-Z)
+             X        : 1
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  1467.
+ 8   / 8:  1368.  1468.
+LIST/ORDER=ZYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-T)
+             X        : 1
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  1368.
+ 4   / 4:  1458.  1468.
+LIST/ORDER=ZTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-Y)
+             X        : 1
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  1467.
+ 8   / 8:  1458.  1468.
+LIST/ORDER=TYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-Z)
+             X        : 1
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  1368.
+ 4   / 4:  1467.  1468.
+LIST/ORDER=TZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-Y)
+             X        : 1
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  1458.
+ 6   / 6:  1467.  1468.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-T)
+             Y        : 3
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- L:8 T:   8
+ 5   / 5:  1358.  2358.
+ 6   / 6:  1368.  2368.
+LIST/ORDER=XTZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Z)
+             Y        : 3
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- K:6 Z:   6
+ 7   / 7:  1367.  2367.
+ 8   / 8:  1368.  2368.
+LIST/ORDER=ZXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-T)
+             Y        : 3
+             5      6    
+             5      6
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+LIST/ORDER=ZTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-T-X)
+             Y        : 3
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2367.
+ 8   / 8:  2358.  2368.
+LIST/ORDER=TXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Z)
+             Y        : 3
+             7      8    
+             7      8
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1368.
+ 2   / 2:  2367.  2368.
+LIST/ORDER=TZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Z-X)
+             Y        : 3
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2358.
+ 6   / 6:  2367.  2368.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 5
+             1      2    
+             1      2
+ ---- L:7 T:   7
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- L:8 T:   8
+ 3   / 3:  1358.  2358.
+ 4   / 4:  1458.  2458.
+LIST/ORDER=XTY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-T-Y)
+             Z        : 5
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+ ---- J:4 Y:   4
+ 7   / 7:  1457.  2457.
+ 8   / 8:  1458.  2458.
+LIST/ORDER=YXT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-T)
+             Z        : 5
+             3      4    
+             3      4
+ ---- L:7 T:   7
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- L:8 T:   8
+ 1   / 1:  1358.  1458.
+ 2   / 2:  2358.  2458.
+LIST/ORDER=YTX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-T-X)
+             Z        : 5
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+ ---- I:2 X:   2
+ 7   / 7:  2357.  2457.
+ 8   / 8:  2358.  2458.
+LIST/ORDER=TXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-X-Y)
+             Z        : 5
+             7      8    
+             7      8
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1458.
+ 2   / 2:  2457.  2458.
+LIST/ORDER=TYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (T-Y-X)
+             Z        : 5
+             7      8    
+             7      8
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2358.
+ 4   / 4:  2457.  2458.
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 7
+             1      2    
+             1      2
+ ---- K:5 Z:   5
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+ ---- K:6 Z:   6
+ 3   / 3:  1367.  2367.
+ 4   / 4:  1467.  2467.
+LIST/ORDER=XZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (X-Z-Y)
+             T        : 7
+             1      2    
+             1      2
+ ---- J:3 Y:   3
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+ ---- J:4 Y:   4
+ 5   / 5:  1457.  2457.
+ 6   / 6:  1467.  2467.
+LIST/ORDER=YXZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-X-Z)
+             T        : 7
+             3      4    
+             3      4
+ ---- K:5 Z:   5
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ ---- K:6 Z:   6
+ 1   / 1:  1367.  1467.
+ 2   / 2:  2367.  2467.
+LIST/ORDER=YZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Y-Z-X)
+             T        : 7
+             3      4    
+             3      4
+ ---- I:1 X:   1
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+ ---- I:2 X:   2
+ 5   / 5:  2357.  2457.
+ 6   / 6:  2367.  2467.
+LIST/ORDER=ZXY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-X-Y)
+             T        : 7
+             5      6    
+             5      6
+ ---- J:3 Y:   3
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- J:4 Y:   4
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+LIST/ORDER=ZYX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 by 2 points (Z-Y-X)
+             T        : 7
+             5      6    
+             5      6
+ ---- I:1 X:   1
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ ---- I:2 X:   2
+ 3   / 3:  2357.  2367.
+ 4   / 4:  2457.  2467.
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-T)
+             X        : 1
+             Y        : 3
+             5      6    
+             5      6
+ 7   / 7:  1357.  1367.
+ 8   / 8:  1358.  1368.
+LIST/ORDER=TZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Z)
+             X        : 1
+             Y        : 3
+             7      8    
+             7      8
+ 5   / 5:  1357.  1358.
+ 6   / 6:  1367.  1368.
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-T)
+             X        : 1
+             Z        : 5
+             3      4    
+             3      4
+ 7   / 7:  1357.  1457.
+ 8   / 8:  1358.  1458.
+LIST/ORDER=TY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-Y)
+             X        : 1
+             Z        : 5
+             7      8    
+             7      8
+ 3   / 3:  1357.  1358.
+ 4   / 4:  1457.  1458.
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-Z)
+             X        : 1
+             T        : 7
+             3      4    
+             3      4
+ 5   / 5:  1357.  1457.
+ 6   / 6:  1367.  1467.
+LIST/ORDER=ZY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-Y)
+             X        : 1
+             T        : 7
+             5      6    
+             5      6
+ 3   / 3:  1357.  1367.
+ 4   / 4:  1457.  1467.
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-T)
+             Y        : 3
+             Z        : 5
+             1      2    
+             1      2
+ 7   / 7:  1357.  2357.
+ 8   / 8:  1358.  2358.
+LIST/ORDER=TX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (T-X)
+             Y        : 3
+             Z        : 5
+             7      8    
+             7      8
+ 1   / 1:  1357.  1358.
+ 2   / 2:  2357.  2358.
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Z)
+             Y        : 3
+             T        : 7
+             1      2    
+             1      2
+ 5   / 5:  1357.  2357.
+ 6   / 6:  1367.  2367.
+LIST/ORDER=ZX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Z-X)
+             Y        : 3
+             T        : 7
+             5      6    
+             5      6
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 5
+             T        : 7
+             1      2    
+             1      2
+ 3   / 3:  1357.  2357.
+ 4   / 4:  1457.  2457.
+LIST/ORDER=YX
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 by 2 points (Y-X)
+             Z        : 5
+             T        : 7
+             3      4    
+             3      4
+ 1   / 1:  1357.  1457.
+ 2   / 2:  2357.  2457.
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (X)
+             Y        : 3
+             Z        : 5
+             T        : 7
+             3    
+             3
+ 1   / 1:  1357.
+ 2   / 2:  2357.
+LIST/I=1/J=3:4/K=5/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Y)
+             X        : 1
+             Z        : 5
+             T        : 7
+             1    
+             1
+ 3   / 3:  1357.
+ 4   / 4:  1457.
+LIST/I=1/J=3/K=5:6/L=7
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (Z)
+             X        : 1
+             Y        : 3
+             T        : 7
+             1    
+             1
+ 5   / 5:  1357.
+ 6   / 6:  1367.
+LIST/I=1/J=3/K=5/L=7:8
+             VARIABLE : 1000*I + 100*J + 10*K + L
+             SUBSET   : 2 points (T)
+             X        : 1
+             Y        : 3
+             Z        : 5
+             1    
+             1
+ 7   / 7:  1357.
+ 8   / 8:  1358.
+ 
+! multiple variable list
+SET EXPRESSION v,i,j,k,l
+GO bn_output.sub
+! BN200_OUTPUT.SUB
+! - test various output order permutations FERRET
+! rev 0.0  9/18/90 *sh*
+ 
+! test permutations on output
+! ------ 4D region
+SET REGION/I=1:2/J=3:4/K=5:6/L=7:8
+LIST/ORDER=XYZT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XYTZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZYT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XZTY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTYZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=XTZY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1468.  1.000  4.000  6.000  8.000
+2   / 2:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXZT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YXTZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZXT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YZTX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTXZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=YTZX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2368.  2.000  3.000  6.000  8.000
+4   / 4:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXYT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZXTY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYXT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZYTX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTXY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=ZTYX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2458.  2.000  4.000  5.000  8.000
+6   / 6:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXYZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TXZY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYXZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TYZX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZXY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+LIST/ORDER=TZYX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2467.  2.000  4.000  6.000  7.000
+8   / 8:  2468.  2.000  4.000  6.000  8.000
+ 
+! ------ 3D regions
+SET REGION/I=1/J=3:4/K=5:6/L=7:8
+LIST/ORDER=YZT
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=YTZ
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1368.  1.000  3.000  6.000  8.000
+4   / 4:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZYT
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=ZTY
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1458.  1.000  4.000  5.000  8.000
+6   / 6:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TYZ
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+LIST/ORDER=TZY
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1467.  1.000  4.000  6.000  7.000
+8   / 8:  1468.  1.000  4.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7:8
+LIST/ORDER=XZT
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- K:5 Z:   5
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=XTZ
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- L:7 T:   7
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1368.  1.000  3.000  6.000  8.000
+2   / 2:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZXT
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=ZTX
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  2358.  2.000  3.000  5.000  8.000
+6   / 6:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TXZ
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+LIST/ORDER=TZX
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  2367.  2.000  3.000  6.000  7.000
+8   / 8:  2368.  2.000  3.000  6.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7:8
+LIST/ORDER=XYT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- J:3 Y:   3
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=XTY
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- L:7 T:   7
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1458.  1.000  4.000  5.000  8.000
+2   / 2:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YXT
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+ ---- I:1 X:   1
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=YTX
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- L:7 T:   7
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  2358.  2.000  3.000  5.000  8.000
+4   / 4:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TXY
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+LIST/ORDER=TYX
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  2457.  2.000  4.000  5.000  7.000
+8   / 8:  2458.  2.000  4.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/ORDER=XYZ
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=XZY
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- K:5 Z:   5
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YXZ
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- I:1 X:   1
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=YZX
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- K:5 Z:   5
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  2367.  2.000  3.000  6.000  7.000
+4   / 4:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZXY
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+ ---- I:1 X:   1
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+LIST/ORDER=ZYX
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ ---- I:2 X:   2
+ ---- J:3 Y:   3
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  2457.  2.000  4.000  5.000  7.000
+6   / 6:  2467.  2.000  4.000  6.000  7.000
+ 
+! ------ 2D regions
+SET REGION/I=1/J=3/K=5:6/L=7:8
+LIST/ORDER=ZT
+             Z: 4.5 to 6.5
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- L:8 T:   8
+5   / 5:  1358.  1.000  3.000  5.000  8.000
+6   / 6:  1368.  1.000  3.000  6.000  8.000
+LIST/ORDER=TZ
+             T: 6.5 to 8.5
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- K:6 Z:   6
+7   / 7:  1367.  1.000  3.000  6.000  7.000
+8   / 8:  1368.  1.000  3.000  6.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5/L=7:8
+LIST/ORDER=YT
+             Y: 2.5 to 4.5
+             T: 6.5 to 8.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- L:8 T:   8
+3   / 3:  1358.  1.000  3.000  5.000  8.000
+4   / 4:  1458.  1.000  4.000  5.000  8.000
+LIST/ORDER=TY
+             T: 6.5 to 8.5
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- J:4 Y:   4
+7   / 7:  1457.  1.000  4.000  5.000  7.000
+8   / 8:  1458.  1.000  4.000  5.000  8.000
+ 
+SET REGION/I=1/J=3:4/K=5:6/L=7
+LIST/ORDER=YZ
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+3   / 3:  1367.  1.000  3.000  6.000  7.000
+4   / 4:  1467.  1.000  4.000  6.000  7.000
+LIST/ORDER=ZY
+             Z: 4.5 to 6.5
+             Y: 2.5 to 4.5
+             X: 1
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+5   / 5:  1457.  1.000  4.000  5.000  7.000
+6   / 6:  1467.  1.000  4.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3/K=5/L=7:8
+LIST/ORDER=XT
+             X: 0.5 to 2.5
+             T: 6.5 to 8.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- L:7 T:   7
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- L:8 T:   8
+1   / 1:  1358.  1.000  3.000  5.000  8.000
+2   / 2:  2358.  2.000  3.000  5.000  8.000
+LIST/ORDER=TX
+             T: 6.5 to 8.5
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ ---- I:2 X:   2
+7   / 7:  2357.  2.000  3.000  5.000  7.000
+8   / 8:  2358.  2.000  3.000  5.000  8.000
+ 
+SET REGION/I=1:2/J=3/K=5:6/L=7
+LIST/ORDER=XZ
+             X: 0.5 to 2.5
+             Z: 4.5 to 6.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- K:6 Z:   6
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+LIST/ORDER=ZX
+             Z: 4.5 to 6.5
+             X: 0.5 to 2.5
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+ ---- I:2 X:   2
+5   / 5:  2357.  2.000  3.000  5.000  7.000
+6   / 6:  2367.  2.000  3.000  6.000  7.000
+ 
+SET REGION/I=1:2/J=3:4/K=5/L=7
+LIST/ORDER=XY
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+LIST/ORDER=YX
+             Y: 2.5 to 4.5
+             X: 0.5 to 2.5
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- I:1 X:   1
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+ ---- I:2 X:   2
+3   / 3:  2357.  2.000  3.000  5.000  7.000
+4   / 4:  2457.  2.000  4.000  5.000  7.000
+ 
+! ------ 1D regions
+LIST/I=1:2/J=3/K=5/L=7
+             X: 0.5 to 2.5
+             Y: 3
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+LIST/I=1/J=3:4/K=5/L=7
+             Y: 2.5 to 4.5
+             X: 1
+             Z: 5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+3   / 3:  1357.  1.000  3.000  5.000  7.000
+4   / 4:  1457.  1.000  4.000  5.000  7.000
+LIST/I=1/J=3/K=5:6/L=7
+             Z: 4.5 to 6.5
+             X: 1
+             Y: 3
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+5   / 5:  1357.  1.000  3.000  5.000  7.000
+6   / 6:  1367.  1.000  3.000  6.000  7.000
+LIST/I=1/J=3/K=5/L=7:8
+             T: 6.5 to 8.5
+             X: 1
+             Y: 3
+             Z: 5
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+7   / 7:  1357.  1.000  3.000  5.000  7.000
+8   / 8:  1358.  1.000  3.000  5.000  8.000
+ 
+! ------------------------------------------
+! test other output mechanisms
+SET REGION/I=1:2/J=3:4/K=5:6/L=7
+LIST/NOHEAD
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/PRECISION=6
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+               V      I        J        K        L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.00  1.00000  3.00000  5.00000  7.00000
+2   / 2:  2357.00  2.00000  3.00000  5.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1457.00  1.00000  4.00000  5.00000  7.00000
+2   / 2:  2457.00  2.00000  4.00000  5.00000  7.00000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.00  1.00000  3.00000  6.00000  7.00000
+2   / 2:  2367.00  2.00000  3.00000  6.00000  7.00000
+ ---- J:4 Y:   4
+1   / 1:  1467.00  1.00000  4.00000  6.00000  7.00000
+2   / 2:  2467.00  2.00000  4.00000  6.00000  7.00000
+SHOW LIST
+        SET LIST/PRECISION =   6
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+CANCEL LIST/PRECISION
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+SET LIST/FORMAT=(1X,5F14.7)
+LIST/FORMAT
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+   1357.0000000     1.0000000     3.0000000     5.0000000     7.0000000
+   2357.0000000     2.0000000     3.0000000     5.0000000     7.0000000
+   1457.0000000     1.0000000     4.0000000     5.0000000     7.0000000
+   2457.0000000     2.0000000     4.0000000     5.0000000     7.0000000
+   1367.0000000     1.0000000     3.0000000     6.0000000     7.0000000
+   2367.0000000     2.0000000     3.0000000     6.0000000     7.0000000
+   1467.0000000     1.0000000     4.0000000     6.0000000     7.0000000
+   2467.0000000     2.0000000     4.0000000     6.0000000     7.0000000
+LIST/FORMAT=(1X,10F6.1)
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+ 1357.0   1.0   3.0   5.0   7.0
+ 2357.0   2.0   3.0   5.0   7.0
+ 1457.0   1.0   4.0   5.0   7.0
+ 2457.0   2.0   4.0   5.0   7.0
+ 1367.0   1.0   3.0   6.0   7.0
+ 2367.0   2.0   3.0   6.0   7.0
+ 1467.0   1.0   4.0   6.0   7.0
+ 2467.0   2.0   4.0   6.0   7.0
+CANCEL LIST/FORMAT
+LIST
+             X: 0.5 to 2.5
+             Y: 2.5 to 4.5
+             Z: 4.5 to 6.5
+             T: 7
+ Column  1: V is 1000*I + 100*J + 10*K + L
+ Column  2: I is I (axis ABSTRACT)
+ Column  3: J is J (axis ABSTRACT)
+ Column  4: K is K (axis ABSTRACT)
+ Column  5: L is L (axis ABSTRACT)
+             V     I      J      K      L
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/HEAD
+LIST
+ ---- K:5 Z:   5
+ ---- J:3 Y:   3
+1   / 1:  1357.  1.000  3.000  5.000  7.000
+2   / 2:  2357.  2.000  3.000  5.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1457.  1.000  4.000  5.000  7.000
+2   / 2:  2457.  2.000  4.000  5.000  7.000
+ ---- K:6 Z:   6
+ ---- J:3 Y:   3
+1   / 1:  1367.  1.000  3.000  6.000  7.000
+2   / 2:  2367.  2.000  3.000  6.000  7.000
+ ---- J:4 Y:   4
+1   / 1:  1467.  1.000  4.000  6.000  7.000
+2   / 2:  2467.  2.000  4.000  6.000  7.000
+CANCEL LIST/ALL
+SET LIST/FILE=AUTO-X
+LIST/FILE
+LIST/FILE=test.dat
+LIST/FILE=test.dat/APPEND
+LIST/FILE=test.unf/FORMAT=UNFORMATTED
+! V6.8 we no longer write this file type
+SET MODE IGNORE
+LIST/FILE=test.gt/FORMAT=TMAP/L=1:3 v,v^0.5
+SET MODE/LAST IGNORE
+CANCEL LIST
+*** Running test: bn_in_plane.jnl
+! bn200_in_plane.JNL
+! benchmark various geometries with in-plane transformation applied (@SBX)
+! this benchmark is layered on the compress benchmark to obtain the geometries
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+ 
+! ******** abstract variable ************
+! (this case can be checked against the bn200_in_plane.sub in the same region)
+! (results should be identical since v is linear along all axes)
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=2:4/J=2:4/K=2:4/L=2:4
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ ---- K:2 Z:   2
+ 2   / 2:  2222.  2223.  2224.
+ 3   / 3:  2232.  2233.  2234.
+ 4   / 4:  2242.  2243.  2244.
+ ---- K:3 Z:   3
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- K:4 Z:   4
+ 2   / 2:  2422.  2423.  2424.
+ 3   / 3:  2432.  2433.  2434.
+ 4   / 4:  2442.  2443.  2444.
+ ---- L:3 T:   3
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+ ---- L:4 T:   4
+ ---- K:2 Z:   2
+ 2   / 2:  4222.  4223.  4224.
+ 3   / 3:  4232.  4233.  4234.
+ 4   / 4:  4242.  4243.  4244.
+ ---- K:3 Z:   3
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+ ---- K:4 Z:   4
+ 2   / 2:  4422.  4423.  4424.
+ 3   / 3:  4432.  4433.  4434.
+ 4   / 4:  4442.  4443.  4444.
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- K:2 Z:   2
+ 2   / 2:  3222.  3223.  3224.
+ 3   / 3:  3232.  3233.  3234.
+ 4   / 4:  3242.  3243.  3244.
+ ---- K:3 Z:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- K:4 Z:   4
+ 2   / 2:  3422.  3423.  3424.
+ 3   / 3:  3432.  3433.  3434.
+ 4   / 4:  3442.  3443.  3444.
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2322.  2323.  2324.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2342.  2343.  2344.
+ ---- L:3 T:   3
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+ ---- L:4 T:   4
+ 2   / 2:  4322.  4323.  4324.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4342.  4343.  4344.
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2232.  2233.  2234.
+ 3   / 3:  2332.  2333.  2334.
+ 4   / 4:  2432.  2433.  2434.
+ ---- L:3 T:   3
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+ ---- L:4 T:   4
+ 2   / 2:  4232.  4233.  4234.
+ 3   / 3:  4332.  4333.  4334.
+ 4   / 4:  4432.  4433.  4434.
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 to 4.5 (averaged)
+             2      3      4    
+             2      3      4
+ ---- L:2 T:   2
+ 2   / 2:  2223.  2233.  2243.
+ 3   / 3:  2323.  2333.  2343.
+ 4   / 4:  2423.  2433.  2443.
+ ---- L:3 T:   3
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+ ---- L:4 T:   4
+ 2   / 2:  4223.  4233.  4243.
+ 3   / 3:  4323.  4333.  4343.
+ 4   / 4:  4423.  4433.  4443.
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.5 to 4.5 (ZT ave)
+             T        : 1.5 to 4.5 (ZT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3322.  3323.  3324.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3342.  3343.  3344.
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.5 to 4.5 (YT ave)
+             T        : 1.5 to 4.5 (YT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3232.  3233.  3234.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  3432.  3433.  3434.
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.5 to 4.5 (YZ ave)
+             Z        : 1.5 to 4.5 (YZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2332.  2333.  2334.
+ 3   / 3:  3332.  3333.  3334.
+ 4   / 4:  4332.  4333.  4334.
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 to 4.5 (XT ave)
+             T        : 1.5 to 4.5 (XT ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  3223.  3233.  3243.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  3423.  3433.  3443.
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 to 4.5 (XZ ave)
+             Z        : 1.5 to 4.5 (XZ ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2323.  2333.  2343.
+ 3   / 3:  3323.  3333.  3343.
+ 4   / 4:  4323.  4333.  4343.
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 to 4.5 (XY ave)
+             Y        : 1.5 to 4.5 (XY ave)
+             2      3      4    
+             2      3      4
+ 2   / 2:  2233.  2333.  2433.
+ 3   / 3:  3233.  3333.  3433.
+ 4   / 4:  4233.  4333.  4433.
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on X
+             SUBSET   : 3 points (X)
+             Y        : 1.5 to 4.5 (YZT ave)
+             Z        : 1.5 to 4.5 (YZT ave)
+             T        : 1.5 to 4.5 (YZT ave)
+            2      3      4    
+            2      3      4
+          3332.  3333.  3334.
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Y
+             SUBSET   : 3 points (Y)
+             X        : 1.5 to 4.5 (XZT ave)
+             Z        : 1.5 to 4.5 (XZT ave)
+             T        : 1.5 to 4.5 (XZT ave)
+            2      3      4    
+            2      3      4
+          3323.  3333.  3343.
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on Z
+             SUBSET   : 3 points (Z)
+             X        : 1.5 to 4.5 (XYT ave)
+             Y        : 1.5 to 4.5 (XYT ave)
+             T        : 1.5 to 4.5 (XYT ave)
+            2      3      4    
+            2      3      4
+          3233.  3333.  3433.
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+             X        : 1.5 to 4.5 (XYZ ave)
+             Y        : 1.5 to 4.5 (XYZ ave)
+             Z        : 1.5 to 4.5 (XYZ ave)
+            2      3      4    
+            2      3      4
+          2333.  3333.  4333.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+SET REGION/I=101:103/J=46:48/K=2:4/L=2:4
+SET EXPRESSION v
+GO bn_in_plane.sub
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v[x=@sbx,y=@sbx,z=@sbx,t=@sbx]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.849  4.058  5.125
+ 0.67N / 47:  1.415  2.665  3.817
+ 0.33N / 46: -0.848  0.534  1.821
+ ---- K:3 Z:   25
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- K:4 Z:   35
+ 1N    / 48: -6.759 -5.268 -4.029
+ 0.67N / 47: -7.824 -6.405 -5.032
+ 0.33N / 46: -8.195 -6.626 -5.019
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+ ---- L:4 T:   04-SEP-1982 18:00
+ ---- K:2 Z:   15
+ 1N    / 48:  3.252  5.404  6.662
+ 0.67N / 47:  2.651  5.141  6.269
+ 0.33N / 46:  1.418  4.032  4.953
+ ---- K:3 Z:   25
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+ ---- K:4 Z:   35
+ 1N    / 48: -6.758 -3.638 -2.600
+ 0.67N / 47: -7.392 -4.438 -3.362
+ 0.33N / 46: -7.280 -4.436 -3.244
+ 
+! cubes of data
+LIST v[x=@sbx,y=@sbx,z=@sbx,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:2 Z:   15
+ 1N    / 48:  2.921  4.900  6.164
+ 0.67N / 47:  1.949  4.139  5.405
+ 0.33N / 46:  0.232  2.556  3.808
+ ---- K:3 Z:   25
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- K:4 Z:   35
+ 1N    / 48: -6.685 -4.117 -2.890
+ 0.67N / 47: -7.574 -5.111 -3.733
+ 0.33N / 46: -7.680 -5.189 -3.608
+LIST v[x=@sbx,y=@sbx,t=@sbx,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 10 to 40 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48: -2.896 -1.523 -0.356
+ 0.67N / 47: -4.228 -2.855 -1.590
+ 0.33N / 46: -5.712 -4.222 -2.782
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+ ---- L:4 T:   04-SEP-1982 18:00
+ 1N    / 48: -2.821 -0.259  0.807
+ 0.67N / 47: -3.539 -0.836  0.184
+ 0.33N / 46: -4.302 -1.591 -0.594
+LIST v[x=@sbx,z=@sbx,t=@sbx,j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  1.415  2.665  3.817
+ 25    / 3: -4.228 -2.855 -1.590
+ 35    / 4: -7.824 -6.405 -5.032
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  2.651  5.141  6.269
+ 25    / 3: -3.539 -0.836  0.184
+ 35    / 4: -7.392 -4.438 -3.362
+LIST v[y=@sbx,z=@sbx,t=@sbx,i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:2 T:   23-AUG-1982 14:00
+ 15    / 2:  0.534  2.665  4.058
+ 25    / 3: -4.222 -2.855 -1.523
+ 35    / 4: -6.626 -6.405 -5.268
+ ---- L:3 T:   29-AUG-1982 16:00
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+ ---- L:4 T:   04-SEP-1982 18:00
+ 15    / 2:  4.032  5.141  5.404
+ 25    / 3: -1.591 -0.836 -0.259
+ 35    / 4: -4.436 -4.438 -3.638
+ 
+! planes of data
+LIST v[x=@sbx,y=@sbx,k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 10 to 40 (ZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48: -2.893 -0.649  0.564
+ 0.67N / 47: -3.906 -1.567 -0.284
+ 0.33N / 46: -5.003 -2.591 -1.204
+LIST v[x=@sbx,z=@sbx,j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 15    / 2:  1.949  4.139  5.405
+ 25    / 3: -3.906 -1.567 -0.284
+ 35    / 4: -7.574 -5.111 -3.733
+LIST v[x=@sbx,t=@sbx,j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 10 to 40 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 23-AUG-1982 14 / 2: -4.228 -2.855 -1.590
+ 29-AUG-1982 16 / 3: -3.906 -1.567 -0.284
+ 04-SEP-1982 18 / 4: -3.539 -0.836  0.184
+LIST v[y=@sbx,z=@sbx,i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 15    / 2:  2.556  4.139  4.900
+ 25    / 3: -2.591 -1.567 -0.649
+ 35    / 4: -5.189 -5.111 -4.117
+LIST v[y=@sbx,t=@sbx,i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 10 to 40 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 23-AUG-1982 14 / 2: -4.222 -2.855 -1.523
+ 29-AUG-1982 16 / 3: -2.591 -1.567 -0.649
+ 04-SEP-1982 18 / 4: -1.591 -0.836 -0.259
+LIST v[z=@sbx,t=@sbx,i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z - box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       15     25     35    
+                        2      3      4
+ 23-AUG-1982 14 / 2:  2.665 -2.855 -6.405
+ 29-AUG-1982 16 / 3:  4.139 -1.567 -5.111
+ 04-SEP-1982 18 / 4:  5.141 -0.836 -4.438
+ 
+! lines of data
+LIST/ORDER=X v[x=@sbx,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on X
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 10 to 40 (YZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+         -3.906 -1.567 -0.284
+LIST/ORDER=Y v[y=@sbx,i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Y
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 10 to 40 (XZT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+         -2.591 -1.567 -0.649
+LIST/ORDER=Z v[z=@sbx,i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on Z
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 20-AUG-1982 13:00 to 07-SEP-1982 19:00 (XYT ave)
+           15     25     35    
+            2      3      4
+          4.139 -1.567 -5.111
+LIST/ORDER=T v[t=@sbx,i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+                        box smoothed by 3 pts on T
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 10 to 40 (XYZ ave)
+           1982   1982   1982  
+            2      3      4
+         -2.855 -1.567 -0.836
+*** Running test: bn_compress.jnl
+! bn200_compress.JNL
+! benchmark various geometries obtained by compressing FERRET data with @AVE
+! similar tests are performed on:
+!	abstract variable
+!	file variable
+!	diagnostic variable
+ 
+! ******** abstract variable ************
+LET v = i + 10*j + 100*k + 1000*l
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1111.  1112.  1113.
+ 2   / 2:  1121.  1122.  1123.
+ 3   / 3:  1131.  1132.  1133.
+ ---- K:2 Z:   2
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- K:3 Z:   3
+ 1   / 1:  1311.  1312.  1313.
+ 2   / 2:  1321.  1322.  1323.
+ 3   / 3:  1331.  1332.  1333.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 1   / 1:  3111.  3112.  3113.
+ 2   / 2:  3121.  3122.  3123.
+ 3   / 3:  3131.  3132.  3133.
+ ---- K:2 Z:   2
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+ ---- K:3 Z:   3
+ 1   / 1:  3311.  3312.  3313.
+ 2   / 2:  3321.  3322.  3323.
+ 3   / 3:  3331.  3332.  3333.
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- K:1 Z:   1
+ 1   / 1:  2111.  2112.  2113.
+ 2   / 2:  2121.  2122.  2123.
+ 3   / 3:  2131.  2132.  2133.
+ ---- K:2 Z:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- K:3 Z:   3
+ 1   / 1:  2311.  2312.  2313.
+ 2   / 2:  2321.  2322.  2323.
+ 3   / 3:  2331.  2332.  2333.
+LIST v[k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1211.  1212.  1213.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1231.  1232.  1233.
+ ---- L:2 T:   2
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+ ---- L:3 T:   3
+ 1   / 1:  3211.  3212.  3213.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3231.  3232.  3233.
+LIST v[j=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1121.  1122.  1123.
+ 2   / 2:  1221.  1222.  1223.
+ 3   / 3:  1321.  1322.  1323.
+ ---- L:2 T:   2
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+ ---- L:3 T:   3
+ 1   / 1:  3121.  3122.  3123.
+ 2   / 2:  3221.  3222.  3223.
+ 3   / 3:  3321.  3322.  3323.
+LIST v[i=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 0.5 to 3.5 (averaged)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   1
+ 1   / 1:  1112.  1122.  1132.
+ 2   / 2:  1212.  1222.  1232.
+ 3   / 3:  1312.  1322.  1332.
+ ---- L:2 T:   2
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+ ---- L:3 T:   3
+ 1   / 1:  3112.  3122.  3132.
+ 2   / 2:  3212.  3222.  3232.
+ 3   / 3:  3312.  3322.  3332.
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 0.5 to 3.5 (ZT ave)
+             T        : 0.5 to 3.5 (ZT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2211.  2212.  2213.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2231.  2232.  2233.
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 0.5 to 3.5 (YT ave)
+             T        : 0.5 to 3.5 (YT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2121.  2122.  2123.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  2321.  2322.  2323.
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 0.5 to 3.5 (YZ ave)
+             Z        : 0.5 to 3.5 (YZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1221.  1222.  1223.
+ 2   / 2:  2221.  2222.  2223.
+ 3   / 3:  3221.  3222.  3223.
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 0.5 to 3.5 (XT ave)
+             T        : 0.5 to 3.5 (XT ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  2112.  2122.  2132.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  2312.  2322.  2332.
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 0.5 to 3.5 (XZ ave)
+             Z        : 0.5 to 3.5 (XZ ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1212.  1222.  1232.
+ 2   / 2:  2212.  2222.  2232.
+ 3   / 3:  3212.  3222.  3232.
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 0.5 to 3.5 (XY ave)
+             Y        : 0.5 to 3.5 (XY ave)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1122.  1222.  1322.
+ 2   / 2:  2122.  2222.  2322.
+ 3   / 3:  3122.  3222.  3322.
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 3.5 (YZT ave)
+             Z        : 0.5 to 3.5 (YZT ave)
+             T        : 0.5 to 3.5 (YZT ave)
+            1      2      3    
+            1      2      3
+          2221.  2222.  2223.
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 3.5 (XZT ave)
+             Z        : 0.5 to 3.5 (XZT ave)
+             T        : 0.5 to 3.5 (XZT ave)
+            1      2      3    
+            1      2      3
+          2212.  2222.  2232.
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (Z)
+             X        : 0.5 to 3.5 (XYT ave)
+             Y        : 0.5 to 3.5 (XYT ave)
+             T        : 0.5 to 3.5 (XYT ave)
+            1      2      3    
+            1      2      3
+          2122.  2222.  2322.
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             SUBSET   : 3 points (T)
+             X        : 0.5 to 3.5 (XYZ ave)
+             Y        : 0.5 to 3.5 (XYZ ave)
+             Z        : 0.5 to 3.5 (XYZ ave)
+            1      2      3    
+            1      2      3
+          1222.  2222.  3222.
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : I + 10*J + 100*K + 1000*L
+             X        : 0.5 to 3.5 (XYZT ave)
+             Y        : 0.5 to 3.5 (XYZT ave)
+             Z        : 0.5 to 3.5 (XYZT ave)
+             T        : 0.5 to 3.5 (XYZT ave)
+          2222.
+ 
+! ******** file variable ************
+CANCEL VARIABLE V
+USE gt4d011
+CANCEL MEMORY/ALL
+SET REGION/I=101:103/J=46:48/K=1:3/L=1:3
+SET EXPRESSION v
+GO bn_compress.sub_v
+! BN200_COMPRESS.SUB_V
+! list the variable v averaged on various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! full data region
+LIST v
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.50  11.05  11.24
+ 0.67N / 47:   7.89   7.84   8.33
+ 0.33N / 46:   4.10   4.06   4.78
+ ---- K:2 Z:   15
+ 1N    / 48:   2.85   3.45   3.89
+ 0.67N / 47:   0.69   0.73   1.38
+ 0.33N / 46:  -2.43  -2.33  -1.49
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.15  -2.57  -1.79
+ 0.67N / 47:  -5.26  -5.17  -4.37
+ 0.33N / 46:  -7.30  -7.07  -6.17
+ ---- L:2 T:   23-AUG-1982 14:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.27  12.27  13.17
+ 0.67N / 47:   8.14   9.98  11.31
+ 0.33N / 46:   4.79   6.72   8.32
+ ---- K:2 Z:   15
+ 1N    / 48:   2.19   4.29   5.39
+ 0.67N / 47:   0.46   2.40   3.88
+ 0.33N / 46:  -2.18  -0.16   1.57
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.70  -1.52  -0.17
+ 0.67N / 47:  -5.96  -3.85  -2.20
+ 0.33N / 46:  -7.70  -5.56  -3.69
+ ---- L:3 T:   29-AUG-1982 16:00
+ ---- K:1 Z:   5
+ 1N    / 48:  10.11  13.41  14.78
+ 0.67N / 47:   9.46  12.65  13.99
+ 0.33N / 46:   6.97  10.15  11.50
+ ---- K:2 Z:   15
+ 1N    / 48:   1.84   5.11   6.48
+ 0.67N / 47:   1.43   4.64   6.01
+ 0.33N / 46:  -0.46   2.80   4.22
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.16  -0.23   0.86
+ 0.67N / 47:  -4.97  -1.70  -0.50
+ 0.33N / 46:  -6.73  -3.24  -1.70
+ 
+! cubes of data
+LIST v[l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- K:1 Z:   5
+ 1N    / 48:  10.29  12.24  13.06
+ 0.67N / 47:   8.50  10.16  11.21
+ 0.33N / 46:   5.29   6.98   8.20
+ ---- K:2 Z:   15
+ 1N    / 48:   2.29   4.28   5.25
+ 0.67N / 47:   0.86   2.59   3.76
+ 0.33N / 46:  -1.69   0.10   1.43
+ ---- K:3 Z:   25
+ 1N    / 48:  -3.34  -1.44  -0.37
+ 0.67N / 47:  -5.40  -3.57  -2.36
+ 0.33N / 46:  -7.25  -5.29  -3.85
+LIST v[k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-LATITUDE-TIME)
+             DEPTH (m): 0 to 30 (averaged)
+              129W   128W   127W   
+              101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 1N    / 48:  3.398  3.976  4.445
+ 0.67N / 47:  1.107  1.133  1.784
+ 0.33N / 46: -1.881 -1.779 -0.959
+ ---- L:2 T:   23-AUG-1982 14:00
+ 1N    / 48:  2.920  5.015  6.129
+ 0.67N / 47:  0.881  2.845  4.328
+ 0.33N / 46: -1.696  0.334  2.067
+ ---- L:3 T:   29-AUG-1982 16:00
+ 1N    / 48:  2.933  6.096  7.372
+ 0.67N / 47:  1.975  5.195  6.502
+ 0.33N / 46: -0.073  3.238  4.671
+LIST v[j=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LONGITUDE-DEPTH (m)-TIME)
+             LATITUDE : 0.2N to 1.2N (averaged)
+             129W   128W   127W   
+             101    102    103
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   7.50   7.65   8.12
+ 15    / 2:   0.37   0.62   1.26
+ 25    / 3:  -5.24  -4.94  -4.11
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   7.73   9.66  10.93
+ 15    / 2:   0.16   2.18   3.61
+ 25    / 3:  -5.79  -3.64  -2.02
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   8.85  12.07  13.42
+ 15    / 2:   0.94   4.18   5.57
+ 25    / 3:  -4.95  -1.72  -0.45
+LIST v[i=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 by 3 points (LATITUDE-DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (averaged)
+              0.33N  0.67N  1N    
+              46     47     48
+ ---- L:1 T:   17-AUG-1982 12:00
+ 5     / 1:   4.31   8.02  10.93
+ 15    / 2:  -2.08   0.93   3.39
+ 25    / 3:  -6.85  -4.93  -2.51
+ ---- L:2 T:   23-AUG-1982 14:00
+ 5     / 1:   6.61   9.81  11.90
+ 15    / 2:  -0.25   2.25   3.96
+ 25    / 3:  -5.65  -4.00  -1.80
+ ---- L:3 T:   29-AUG-1982 16:00
+ 5     / 1:   9.54  12.04  12.77
+ 15    / 2:   2.19   4.03   4.48
+ 25    / 3:  -3.89  -2.39  -0.84
+ 
+! planes of data
+LIST v[k=@ave,l=@ave]	!XY
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0 to 30 (ZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (ZT ave)
+              129W   128W   127W   
+              101    102    103
+ 1N    / 48:  3.084  5.029  5.982
+ 0.67N / 47:  1.321  3.057  4.204
+ 0.33N / 46: -1.217  0.598  1.927
+LIST v[j=@ave,l=@ave]	!XZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 0.2N to 1.2N (YT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YT ave)
+             129W   128W   127W   
+             101    102    103
+ 5     / 1:   8.03   9.79  10.82
+ 15    / 2:   0.49   2.33   3.48
+ 25    / 3:  -5.33  -3.43  -2.19
+LIST v[j=@ave,k=@ave]	!XT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 0.2N to 1.2N (YZ ave)
+             DEPTH (m): 0 to 30 (YZ ave)
+                      129W   128W   127W   
+                      101    102    103
+ 17-AUG-1982 12 / 1:  0.875  1.110  1.757
+ 23-AUG-1982 14 / 2:  0.701  2.731  4.175
+ 29-AUG-1982 16 / 3:  1.612  4.843  6.182
+LIST v[i=@ave,l=@ave]	!YZ
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XT ave)
+              0.33N  0.67N  1N    
+              46     47     48
+ 5     / 1:   6.82   9.96  11.87
+ 15    / 2:  -0.05   2.40   3.94
+ 25    / 3:  -5.46  -3.78  -1.72
+LIST v[i=@ave,k=@ave]	!YT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 129.5W to 126.5W (XZ ave)
+             DEPTH (m): 0 to 30 (XZ ave)
+                       0.33N  0.67N  1N    
+                       46     47     48
+ 17-AUG-1982 12 / 1: -1.540  1.341  3.940
+ 23-AUG-1982 14 / 2:  0.235  2.684  4.688
+ 29-AUG-1982 16 / 3:  2.612  4.557  5.467
+LIST v[i=@ave,j=@ave]	!ZT
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 3 points (DEPTH (m)-TIME)
+             LONGITUDE: 129.5W to 126.5W (XY ave)
+             LATITUDE : 0.2N to 1.2N (XY ave)
+                       5      15     25    
+                        1      2      3
+ 17-AUG-1982 12 / 1:   7.75   0.75  -4.76
+ 23-AUG-1982 14 / 2:   9.44   1.98  -3.82
+ 29-AUG-1982 16 / 3:  11.45   3.56  -2.37
+ 
+! lines of data
+LIST/ORDER=X v[j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.2N to 1.2N (YZT ave)
+             DEPTH (m): 0 to 30 (YZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (YZT ave)
+          129W   128W   127W   
+          101    102    103
+          1.063  2.895  4.038
+LIST/ORDER=Y v[i=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (LATITUDE)
+             LONGITUDE: 129.5W to 126.5W (XZT ave)
+             DEPTH (m): 0 to 30 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XZT ave)
+           0.33N  0.67N  1N    
+           46     47     48
+          0.436  2.861  4.698
+LIST/ORDER=Z v[i=@ave,j=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (DEPTH (m))
+             LONGITUDE: 129.5W to 126.5W (XYT ave)
+             LATITUDE : 0.2N to 1.2N (XYT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYT ave)
+           5      15     25    
+            1      2      3
+          9.547  2.099 -3.651
+LIST/ORDER=T v[i=@ave,j=@ave,k=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 129.5W to 126.5W (XYZ ave)
+             LATITUDE : 0.2N to 1.2N (XYZ ave)
+             DEPTH (m): 0 to 30 (XYZ ave)
+           1982   1982   1982  
+            1      2      3
+          1.247  2.536  4.212
+ 
+! point of data
+LIST/ORDER=X v[i=@ave,j=@ave,k=@ave,l=@ave]
+             VARIABLE : MERIDIONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 129.5W to 126.5W (XYZT ave)
+             LATITUDE : 0.2N to 1.2N (XYZT ave)
+             DEPTH (m): 0 to 30 (XYZT ave)
+             TIME     : 14-AUG-1982 11:00 to 01-SEP-1982 17:00 (XYZT ave)
+          2.665
+ 
+! ****
+! remove call to bn200_compress.sub_qady for portable benchmarks *kob* 5/99
+! ****
+*** Running test: bn_interpolate.jnl
+! bn200_interpolate.JNL
+! benchmark interpolation along various axes
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*z + 1000*t
+SET REGION/I=1:3/J=1:3/K=1:3/L=1:3
+DEF REG/x=1.5 xpt
+DEF REG/y=1.05 ypt
+DEF REG/z=1.005 zpt
+DEF REG/t=1.0005 tpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- L:2 T:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- L:3 T:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- K:2 Z:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- K:3 Z:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1
+             T        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1
+             Z        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1
+             Y        : 1
+             Z        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1
+             Y        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1
+             Y        : 1
+             Z        : 1
+             T        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate.sub
+! BN200_INTERPOLATE.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (Y-Z-T)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Z-T)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@zpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-T)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- L:1 T:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- L:2 T:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- L:3 T:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 by 3 points (X-Y-Z)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- K:1 Z:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- K:2 Z:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- K:3 Z:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@zpt, at tpt]	!XY
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at tpt]	!XZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-Z)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at zpt]	!XT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (X-T)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at tpt]	!YZ
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-Z)
+             X        : 1.5 (interpolated)
+             T        : 1.0005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at zpt]	!YT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Y-T)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!ZT
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=T v[@xpt, at ypt, at zpt]	! T
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (T)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=Z v[@xpt, at ypt, at tpt]	! Z
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Z)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at zpt, at tpt]	! Y
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at zpt, at tpt]	! X
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at zpt, at tpt]
+             VARIABLE : X + 10*Y + 100*Z + 1000*T
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             Z        : 1.005 (interpolated)
+             T        : 1.0005 (interpolated)
+          1113.00
+*** Running test: bn_regrid.jnl
+! bn200_regrid.JNL
+! test regridding
+! first test consists of regridding and re-regridding back and comparing
+! when the variable, v is linear along all axes results should be exact
+ 
+! second test checks area-averaging regridding
+! both with and without COS(latitude) factors computed
+ 
+! third test consists of time axis regridding with differing time steps
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+! default grid
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/z=zeven/t=teven g1
+define grid/x=xeven/y=yodd/z=zeven/t=teven g2
+define grid/x=xeven/y=yeven/z=zodd/t=teven g3
+define grid/x=xeven/y=yeven/z=zeven/t=todd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/z=zeven/t=teven g12
+define grid/x=xodd/y=yeven/z=zodd/t=teven g13
+define grid/x=xodd/y=yeven/z=zeven/t=todd g14
+define grid/x=xeven/y=yodd/z=zodd/t=teven g23
+define grid/x=xeven/y=yodd/z=zeven/t=todd g24
+define grid/x=xeven/y=yeven/z=zodd/t=todd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/z=zodd/t=todd g234
+define grid/x=xodd/y=yeven/z=zodd/t=todd g134
+define grid/x=xodd/y=yodd/z=zeven/t=todd g124
+define grid/x=xodd/y=yodd/z=zodd/t=teven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/z=zodd/t=todd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             4      6      8    
+             2      3      4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- K:3 Z:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- K:4 Z:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- K:3 Z:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- K:4 Z:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- K:3 Z:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- K:4 Z:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             5      7      9    
+             3      4      5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- K:4 Z:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- K:5 Z:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- K:4 Z:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- K:5 Z:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- K:4 Z:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- K:5 Z:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+             25.5   35.5   45.5   55.5   65.5   75.5  
+              3      4      5      6      7      8
+ 25.5 / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+ 35.5 / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 45.5 / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 55.5 / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 65.5 / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 75.5 / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      101.0  101.0
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+              25.5E  35.5E  45.5E  55.5E  65.5E  75.5E 
+               3      4      5      6      7      8
+ 75.5N / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+ 65.5N / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 55.5N / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 45.5N / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 35.5N / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 25.5N / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      94.71  94.53
+ 
+!****************** time axis regridding *******************
+define axis/t="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" tax24
+define axis/t="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" tax48
+define grid/t=tax24 g24
+define grid/t=tax48 g48
+!show grid/l=1:4 g24,g48    ! requires blank separators: 11/1/91 *sh*
+show grid/l=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX24     TIME               732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX48     TIME               367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/t="1-jan-1980":"8-jan-1980"
+let a24 = t[g=g24]
+let a48 = t[g=g48]
+list a24
+             VARIABLE : T[G=G24]
+             SUBSET   : 8 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.
+ 02-JAN-1980 00 / 2:  87672.
+ 03-JAN-1980 00 / 3:  87696.
+ 04-JAN-1980 00 / 4:  87720.
+ 05-JAN-1980 00 / 5:  87744.
+ 06-JAN-1980 00 / 6:  87768.
+ 07-JAN-1980 00 / 7:  87792.
+ 08-JAN-1980 00 / 8:  87816.
+list a48
+             VARIABLE : T[G=G48]
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+list a24[g=g48]
+             VARIABLE : T[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1:  87648.
+ 03-JAN-1980 00 / 2:  87696.
+ 05-JAN-1980 00 / 3:  87744.
+ 07-JAN-1980 00 / 4:  87792.
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (TIME)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+*** Running test: bn_ez.jnl
+! bn401_ez.JNL
+! test all manner of accessing non-TMAP data files
+! V401 modified from bn200_ez.jnl by the addition of a test of UNF reading
+ 
+ 
+! quick and dirty
+FILE EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 1
+LIST V1
+             VARIABLE : V1
+             FILENAME : EZ.DAT
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.0060
+ 2   / 2:  0.3550
+ 3   / 3:  0.4100
+ 4   / 4:  0.4350
+ 5   / 5:  0.4780
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! first 2 values from each line
+FILE/VAR="X1,X2" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 2
+LIST X1,X2
+             DATA SET: ./EZ.DAT
+             X: 0.5 to 5.5
+ Column  1: X1
+ Column  2: X2
+             X1     X2
+1   / 1:  0.0060  0.8865
+2   / 2:  0.3550  0.6643
+3   / 3:  0.4100  0.6071
+4   / 4:  0.4350  0.5535
+5   / 5:  0.4780  0.5337
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:5       ...       ...       ...       ...       ...
+ X2       X2                               1:5       ...       ...       ...       ...       ...
+ 
+ 
+! all 6 values on each line
+FILE/VAR="X1,X2"/COLUMNS=6 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 15 points (X)
+ 1    /  1:  0.0060
+ 2    /  2:  0.1760
+ 3    /  3:  0.2820
+ 4    /  4:  0.3550
+ 5    /  5:  0.3790
+ 6    /  6:  0.3930
+ 7    /  7:  0.4100
+ 8    /  8:  0.4170
+ 9    /  9:  0.4670
+ 10   / 10:  0.4350
+ 11   / 11:  0.4440
+ 12   / 12:  0.4700
+ 13   / 13:  0.4780
+ 14   / 14:  0.5150
+ 15   / 15:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:15      ...       ...       ...       ...       ...
+ X2       X2                               1:15      ...       ...       ...       ...       ...
+ 
+ 
+! all 6 but skip first 2 lines
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.4170
+ 3   / 3:  0.4670
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+ 7   / 7:  0.4780
+ 8   / 8:  0.5150
+ 9   / 9:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! take 1st and 4th values on each line as X1
+FILE/VAR="X1,-,X2"/COLUMNS=6/SKIP=2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.5935
+ 3   / 3:  0.4350
+ 4   / 4:  0.5458
+ 5   / 5:  0.4780
+ 6   / 6:  0.5147
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format explicitly
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=2/FORMAT=(3(F14.0,F7.0)) EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = (3(F14.0,F7.0))
+ /SKIP = 2
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 9 points (X)
+ 1   / 1:  0.4100
+ 2   / 2:  0.4170
+ 3   / 3:  0.4670
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+ 7   / 7:  0.4780
+ 8   / 8:  0.5150
+ 9   / 9:  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:9       ...       ...       ...       ...       ...
+ X2       X2                               1:9       ...       ...       ...       ...       ...
+ 
+ 
+! specify the format to skip every second line
+FILE/VAR="X1,X2"/COLUMNS=6/SKIP=1/FORMAT="(3(F14.0,F7.0)/)" EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ X2       X2                               1:20480   ...       ...       ...       ...       ...
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /FORMAT = (3(F14.0,F7.0)/)
+ /SKIP = 1
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 6 points (X)
+ 1   / 1:  0.3550
+ 2   / 2:  0.3790
+ 3   / 3:  0.3930
+ 4   / 4:  0.4350
+ 5   / 5:  0.4440
+ 6   / 6:  0.4700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! modify variable title
+SET VARIABLE/TITLE="first variable" X1
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       first variable                   1:6       ...       ...       ...       ...       ...
+ X2       X2                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ GEZ1
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ1 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid GEZ1 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ 3   / 3:  0.4100  0.4170  0.4670
+ 4   / 4:  0.4350  0.4440  0.4700
+ 5   / 5:  0.4780  0.5150  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+ 
+! read onto a 4D grid
+DEFINE AXIS/X=1:1:1 xez2
+DEFINE AXIS/Y=1:3:1 yez
+DEFINE AXIS/Z=1:2:1 zez
+DEFINE GRID/X=XEZ2/Y=YEZ/Z=ZEZ/T=EZ GEZ2
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ2 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ X2       X2                               1:1       1:3       1:2       1:20480   ...       ...
+               on grid GEZ2 with -1.E+34 for missing data
+             X=0.5:1.5  Y=0.5:3.5  Z=0.5:2.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 2 by 2 points (Y-Z-T)
+             X        : 1
+             1       2       3     
+              1       2       3
+ ---- L:1 T:   1
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ ---- L:2 T:   2
+ 1   / 1:  0.4100  0.4170  0.4670
+ 2   / 2:  0.4350  0.4440  0.4700
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:1       1:3       1:2       1:2       ...       ...
+ X2       X2                               1:1       1:3       1:2       1:2       ...       ...
+ 
+ 
+! truncate reading by grid size limit
+DEFINE AXIS/X=1:8:1 xez3
+DEFINE GRID/X=XEZ3 GEZ3
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=GEZ3 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+               on grid GEZ3 with -1.E+34 for missing data
+             X=0.5:8.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 8 points (X)
+ 1   / 1:  0.0060
+ 2   / 2:  0.1760
+ 3   / 3:  0.2820
+ 4   / 4:  0.3550
+ 5   / 5:  0.3790
+ 6   / 6:  0.3930
+ 7   / 7:  0.4100
+ 8   / 8:  0.4170
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:8       ...       ...       ...       ...       ...
+ X2       X2                               1:8       ...       ...       ...       ...       ...
+ 
+ 
+! 8/10/95 -- added tests of unformatted writing and reading
+SP rm -f test.unf
+LIST/FILE=test.unf/format=unf/i=1:10 i
+file/form=unf/var=my_var test.unf
+list my_var
+             VARIABLE : MY_VAR
+             FILENAME : test.unf
+             SUBSET   : 10 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+*** Running test: bn_plot.jnl
+! bn450_plot.JNL - updated 9/97 from bn320_plot.jnl
+! upgraded from bn320 to provide method for testing batch mode.  Also remove
+! all labels to create "master" gif and ps files to compare against
+! *kob*
+! V530 - added tests of PLOT/STEP[=connected] to existing plots
+! v581 - for the last set, cancel mode logo, so that .plt files are comparable.
+ 
+! define a 6 viewport window (modified definitions 11/92)
+def view/text=.4/xlim=0,.333/ylim=0,.5    ll6
+def view/text=.2/xlim=0,.333/ylim=.5,1    ul6
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6
+def view/text=1.5/xlim=.666,1/ylim=0,.5   lr6
+def view/xlim=.666,1/ylim=.5,1            ur6     ! auto /TEXT
+show view
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ UPPER            1.00   0.00,1.00   0.50,1.00   edges
+ LOWER            1.00   0.00,1.00   0.00,0.50   edges
+ RIGHT            1.00   0.50,1.00   0.00,1.00   edges
+ LEFT             1.00   0.00,0.50   0.00,1.00   edges
+ LL               0.50   0.00,0.50   0.00,0.50   edges
+ LR               0.50   0.50,1.00   0.00,0.50   edges
+ UL               0.50   0.00,0.50   0.50,1.00   edges
+ UR               0.50   0.50,1.00   0.50,1.00   edges
+ FULL             1.00   0.00,1.00   0.00,1.00   edges
+ LL6              0.40   0.00,0.33   0.00,0.50   edges
+ UL6              0.20   0.00,0.33   0.50,1.00   edges
+ LM6              0.10   0.33,0.67   0.00,0.50   edges
+ UM6              0.60   0.33,0.67   0.50,1.00   edges
+ LR6              1.50   0.67,1.00   0.00,0.50   edges
+ UR6              0.41   0.67,1.00   0.50,1.00   edges
+   current viewport is NONE
+ 
+! some variables for plotting
+let a = 0.8*sin(l/10)
+let b = 0.6*cos(l/10)
+let c = sin(100/(l+k))
+let d = l/50
+let e = k-(l/25)
+let f = -.5+(l/125)
+let g = (l-25)/(k*35)
+let h = 0.1
+let m = 0.2
+ 
+! illegal plot commands
+set mode ignore
+plot/i=1:10/j=1:20/nolabel i+j			! not a line
+plot/i=1:10/j=1:20/nolabel i,i+j		! not a line
+plot/i=1:10/j=1:20/nolabel i+j,i		! not a line
+plot/i=1:10/j=1:20/nolabel j,i			! differing axes
+plot/i=1:10/j=1:20/vs/line/nolabel j,i		! unequal lengths
+contour/i=1:10/j=1:20/nolabel i			! only 1 D
+contour/i=1:10/j=1:20/nolabel i/j,j/i		! multiple fields
+vector/i=1:10/j=1:20/nolabel i/j		! only 1 field
+vector/i=1:10/j=1:20/nolabel i/j,j/i,i+j	! 3 fields
+set mode/last ignore
+ 
+! notice the default window size is 10.2,width x 8.8,height
+ppl list plot
+         WIDTH=   10.50  HEIGHT=    8.50  TKTYPE= 4010  BAUD=  110
+         WINDOW= ON   BOX= OFF  CROSS= 0  PLTYPE=  3
+         PLOT MODE=   A
+         PLOT FILE= ferret.png                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [...]
+ 
+! enlarge it to accomodate an additional 50% width
+ppl size 15.3,8.8
+ 
+! turn on metafile (enabled 10/29/91)
+! commented out 9/97 - instead set in bn450_all.jnl
+! set mode metafile
+ 
+! draw a plot into a viewport - to be deleted (check hard copy)
+set view ll6
+contour/i=1:50/j=1:50/nolabel i/(j+20)
+ 
+! 4 frames testing PLOT output
+set view ul6
+plot/l=1:50/k=1/trans/nolabel a,b,c
+plot/l=1:50/k=1/trans/over/line=6/nolabel d
+plot/l=1:50/k=1/trans/over/symbol=88/nolabel e
+plot/l=1:50/k=1/trans/over/symbol=47/line/nolabel f
+def view/text=.1/xlim=.333,1/ylim=0,.5 lm6   ! redefine longer in x (11/92)
+set view lm6
+!ppl axlen 16
+set region/k=1
+plot/l=1:50/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+def view/text=.6/xlim=.333,1/ylim=.5,1 um6    ! redefine it longer in x (11/92)
+set view um6
+!ppl axlen 17,5
+plot/l=1:50/nolabel sin(100/(l+5))
+plot/l=1:50/over/nolabel a,b,c,d,e,f,g[k=1],g[k=2],a+h,b+h,c+h,d+h,e+h,f+h,g[k=1]+h,g[k=2]+h,a+m,b+m,c+m
+set view ll6
+!ppl axlen 8,6
+plot/l=1:99000/nolabel sin(200000/(l+10000))
+ 
+! reset to normal axis lengths and prepare for a new piccie
+!ppl axlen 8
+set wind/clear
+ 
+! draw six frames
+set view ll6
+contour/i=1:50/j=1:50/levels=(0,2.5,.25)/nolabel i/(j+20)
+plot/over/nolab/vs/line/i=1:50/j=1:50/nolabel 6*i/j,5*j/i
+set view ul6
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+def view/text=.1/xlim=.333,.666/ylim=0,.5 lm6  ! redefine it (11/92)
+set view lm6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+set view lr6
+ppl lev () (0,2.5,.1)
+shade/i=1:50/j=1:50/line/level/nolabel i/(j+20)
+set view ur6
+let icomp = (sin(i/20)*10+j-20)
+let jcomp = (-1*cos(j/10)*10+i-20)
+contour/i=1:50/j=1:50/nolabel icomp^2+jcomp^2
+contour/i=1:50/j=1:50/over/level/nolabel icomp^2+(-1*cos(i/10)*80)^2
+! note: "i-i" and "j-j" are needed to create 2D structures
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+vector/i=1:50/j=1:50/overlay/length/nolabel i-20+(j-j),40-j+(i-i)
+def view/text=.6/xlim=.333,.666/ylim=.5,1 um6    ! redefine it (11/92)
+set view um6
+shade/i=1:50/j=1:50/nolabel i/(j+20)
+contour/i=1:50/j=1:50/over/nolabel (sin(i/20)+j-20)^2+(-1*cos(j/10)+i-20)^2
+vector/i=1:50/j=1:50/overlay/nolabel j-20+(i-i),i-20+(j-j)
+ 
+! additions for version 3.01 "/TITLE=" controls
+cancel viewports
+set view ul6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/5)
+set view um6
+plot/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ur6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view ll6
+plot/vs/line/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/line/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+set view lm6
+contour/i=1:20/j=1:20/title="My Contour Title"/nolabel sin(i/3)*cos(j/4)
+contour/over/i=5:30/j=5:30/title="My Contour Overlay"/nolabel sin(i/2)*cos(j/3)
+set view lr6
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+! addition for 3.20 showing changed default behavior of plot/vs
+! return to window and redraw with symbols
+set view ll6
+plot/vs/title="My Custom Title"/i=1:100/nolabel sin(i/6),sin(i/9),sin(i/12)
+plot/vs/title="My Custom Key"/i=1:100/over/nolabel sin(i/7),sin(i/10)
+ 
+! test of qualifiers added for V510
+cancel viewport
+set wind/asp=.75/clear
+set view ul
+plot/i=1:10/ylimits=1:40/nolabel i      ! note that /nolabel supresses XLAB
+plot/i=1:10/over/sym=2 i^1.1
+plot/i=1:10/over/sym=2/size=.12 i^1.2
+plot/i=1:10/over/sym=2/color=red i^1.3
+plot/i=1:10/over/thick/step i^1.4
+plot/i=1:10/over/thick/color=blue/step=connected i^1.5
+plot/i=1:10/over/thick=3/color=purple/size=.14 i^1.6
+ 
+! deliberate error
+set mode ignore
+plot/over/i=1:10/color=noexist i
+plot/over/i=1:10/thick=4 i
+plot/over/i=1:10/size=-1 i
+set mode/last ignore
+ 
+can mode logo
+set view ur
+let eps = .1; plot/vs RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .2; plot/vs/over/sym=2  RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .3; plot/vs/over/line/size=.12 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .4; plot/vs/over/line/sym=2/color=red RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .5; plot/vs/over/thick RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .6; plot/vs/over/thick/color=blue RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+let eps = .7; plot/vs/over/thick=3/color=purple/size=.14 RANDU(I[i=1:10]+eps), RANDU(I[i=1:10]+10+eps)
+ 
+set view ll
+contour/color=lightBlue/sig=1/size=.12 x[x=0:1:.1]*SIN(Y[y=0:6.3:.2])
+vector/over/thick=3/color=green x[x=0:1:.1]*SIN(Y[y=0:6.3:.2]),x[x=0:1:.1]*COS(Y[y=0:6.3:.2])
+ 
+! deliberate error
+set mode ignore
+cont/over/i=1:10/color=noexist i
+cont/over/i=1:10/thick=4 i
+cont/over/i=1:10/sigdig=-1 i
+set mode/last ignore
+ 
+set view lr
+polygon/thick/color=red/palette=blue {1,2,1}, {2,1,0.5}
+ 
+set mode/last logo
+*** Running test: bn_curv.jnl
+cancel mode ignore
+!
+! Your basic map projection
+!
+! v 4.91 - *kob* 2/98 - just clean up window a bit before plotting and remove
+!		        all the ferret labels in order to be able to automate
+!			metafile checking.
+can view all
+! 2/98 *kob* just clean up the window a bit
+! 4/05 *acm* save only one of the plots as a metafile for checking; had four of them.
+ 
+can mode meta
+set view full
+set wind/clear/asp=1
+ 
+use coads_climatology
+set region/l=3
+go mp_sinusoidal
+set grid sst
+shade/nolabel sst, x_page, y_page
+ 
+!
+! A more complex projection
+!
+set mode meta bnplot.plt
+go mp_orthographic 210 45
+set grid sst
+let masked_sst = sst * mp_mask
+fill/nolabel/title="Orthographic View" masked_sst, x_page, y_page
+ 
+!
+! Some of the utility functions
+!
+!go mp_fland
+go mp_land
+go mp_label 237.7 47.6 -1 0 .1 @IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @IIHawaii
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+ 
+! move the cancel mode meta to avoid changes in the plot output
+can mode meta
+ 
+!  Some map projections use 1-D x_page and y_page
+!  (mp_mercator, mp_plate_caree, mp_lambert_cyl). Test the
+!  whole zoo of map projection scripts.
+ 
+go bn_mp_zoo.jnl
+! bn_mp_zoo.jnl
+! taken from mp_demo.jnl
+! acm 9/2005
+!
+ 
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+use coads_climatology
+set region/l=1/y=0:90
+ 
+set view tl
+go margins .2, .6, .2, .2
+go mp_hammer
+set grid sst
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Hammer
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Hammer
+ 
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Sinusoidal
+ 
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Lambert Equal Area
+ 
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Bonne
+ 
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 McBryde Flat Polar
+ 
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Polyconic
+ 
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 OrthoGraphic
+ 
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Stereographic Equatorial
+ 
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+ !-> PPL %LABEL/nouser 2.5255,-0.4,0,0,.20 Stereographic North
+ 
+can region
+cancel viewport
+exit
+ 
+!
+! What can go wrong
+!
+ 
+! Do we catch incorrect region specifications?
+can region
+go mp_sinusoidal
+set grid sst
+set region/x=145
+set mode ignore
+shade/nolabel sst, x_page, y_page ! DELIBERATE ERROR
+can region
+ 
+! Crazy stuff with the transformation fields:
+set region/l=1
+let phi = y * deg2rad
+shade/nolabel sst, 0*x_page, y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, 0*y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, sin(y_page)
+shade/nolabel sst, randn(x_page), randn(y_page)
+!2/98 *kob* - can mode meta before this plot
+can mode meta
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+shade/nolabel sst, x_page, asin(y_page) ! DELIBERATE ERROR
+shade/nolabel sst, x_page, y_page ! DELIBERATE gsetviewport() ERROR
+ 
+ 
+can win 1
+set win 1
+ 
+!2/98 *kob* - set mode meta again
+!sset mode meta bnplot.plt
+let phi = l * deg2rad
+shade/nolabel sst, x_page, y_page
+shade/nolabel sst, x_page[j=1:12], y_page ! DELIBERATE ERROR
+can mode ignore
+ 
+set mode meta bnplot.plt
+*** Running test: bn_symbols.jnl
+! bn420_symbols
+! benchmark to test machinery of symbol definition and use
+! requires FERRET version 4.00 or later
+ 
+! note on max number of symbols:
+! As of 6/95 (version 4.01) an attempt to define more that 1000 symbols
+! will encounter a PLOT+   "STOP 'exceeded symbol storage'"
+ 
+! bn420 - 10/95 -- make sure that symbols at start and end aren't
+!		confused with enclosing parens
+!	  4/96 -- test symbol editing in the style of dollar args
+!	       -- use template notation for SHOW SYMBOL and CANCEL SYMBOL
+ 
+! V510: added tests of backslash escaping
+! V533: *sh* 7/01 - Ferret allows single quoted strings -- syntax change
+ 
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "0"
+PPL$YPIXEL = "0"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+DELTA_CPU = "0.527919"
+CLOCK_SECS = "0.309"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:26:35"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "PyFerret"
+ 
+! define some symbols ... syntax variations
+define symbol s1 = hello
+define symbol s2 = "hello"
+define symbol s3  "hello and goodbye"
+define symbol num = 3
+define symbol t$dollar = hi
+define symbol t_($s1) = hi	! define "t_hello" as a symbol
+ !-> define symbol t_hello = hi
+ 
+! exercise SHOW SYMBOL
+show symbol/all
+PPL$XPIXEL = "0"
+PPL$YPIXEL = "0"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+DELTA_CPU = "0.001999"
+CLOCK_SECS = "0.311"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:26:35"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "PyFerret"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+NUM = "3"
+T$DOLLAR = "hi"
+T_HELLO = "hi"
+show symbol s*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+S1 = "hello"
+S2 = ""hello""
+S3 = "hello and goodbye"
+show symbol s2
+S2 = ""hello""
+ 
+! exercise CANCEL SYMBOL
+cancel symbol s2
+show symbol s*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+S1 = "hello"
+S3 = "hello and goodbye"
+show symbol S*
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+S1 = "hello"
+S3 = "hello and goodbye"
+cancel symbol s2	! already deleted
+ 
+! exercise symbol translation
+message/continue ($s1)
+ !-> message/continue hello
+hello
+message/continue ($s1) and ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+message/continue ($s1) and ($s`3`)	! no good - grave accent evaluated AFTER
+ !-> message/continue hello and
+hello and
+message/continue ($s1) and ($s($num))	! nested symbol translation gets ($S3)
+ !-> message/continue hello and hello and goodbye
+hello and hello and goodbye
+ 
+! demonstrate the 30 character cap on symbol length
+! In Ferret v6.85+ this becomse a 120-character length.
+define symbol q23456789012345678901234567890 = 4
+show symbol q*
+Q23456789012345678901234567890 = "4"
+define symbol q23456789012345678901234567890aaaaa = 5
+define symbol q23456789012345678901234567xxxaaaaa = 6
+show symbol q*
+Q23456789012345678901234567890 = "4"
+Q23456789012345678901234567890AAAAA = "5"
+Q23456789012345678901234567XXXAAAAA = "6"
+ 
+! show the upper left coordinate limits labels as symbols
+plot/i=1:100/y=10/z=5/set_up SIN(I/6)+Y+Z
+show symbol lab*
+LABX = "X"
+LAB1 = "Y : 10"
+LABNUM_Y = "1"
+LAB2 = "Z : 5"
+LABNUM_Z = "2"
+LABY = ""
+LABTIT = "SIN(I/6)+Y+Z"
+message/continue Z value saved as  ($LAB($LABNUM_Z))
+ !-> message/continue Z value saved as  Z : 5
+Z value saved as  Z : 5
+message/continue Y value saved as "($LAB($LABNUM_Y))"
+ !-> message/continue Y value saved as "Y : 10"
+Y value saved as "Y : 10"
+message/continue No T value saved: "($LAB($LABNUM_T))"
+ !-> message/continue No T value saved: " "
+No T value saved: " "
+ 
+! template tests (4/23/96)
+cancel symbol lab?
+show symbol lab*
+LABNUM_Y = "1"
+LABNUM_Z = "2"
+LABTIT = "SIN(I/6)+Y+Z"
+show symbol lab*y
+LABNUM_Y = "1"
+ 
+! deliberate errors
+set mode ignore_errors
+define symbol test* = hello
+define symbol t$5 = hi
+set mode/last ignore_errors
+ 
+! bn420 - check enclosing parens
+define symbol cmnd "show symbol"; define symbol arg "cmnd"
+($cmnd) ($arg)
+ !-> show symbol cmnd
+CMND = "show symbol"
+ 
+! bn420 - check symbol editing
+define symbol test "\"I'm here\""   ! added surrounding quotes V533
+define symbol t2 hello
+cancel symbol test2
+message/continue ($test)
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test"default")
+ !-> message/continue "I'm here"
+I'm here
+message/continue ($test2"default")
+ !-> message/continue default
+default
+ 
+message/continue ($t2"|hello|bye|")
+ !-> message/continue hello
+hello
+message/continue ($t2"|hello>really hello|bye|")
+ !-> message/continue really hello
+really hello
+message/continue ($t2"|hello>you said: *|bye|")
+ !-> message/continue you said: hello
+you said: hello
+message/continue ($test"|*>you said: *|bye|")
+ !-> message/continue you said: "I'm here"
+you said: "I'm here"
+ 
+! deliberate errors
+set mode ignore_errors
+message/continue ($test2"<error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<error message")	! silent error
+message/continue ($t2"|solong>really hello|bye|")
+set mode/last ignore_errors
+ 
+! V510 - added processing of backslash escapes
+define symbol ss \"hello\"
+show symbol ss
+SS = ""hello""
+define symbol ss "\"hello\""
+show symbol ss
+SS = ""hello""
+define symbol delayed_eval \`1+1\`
+show symbol delayed_eval
+DELAYED_EVAL = "`1+1`"
+say ($delayed_eval)         ! translate symbol and then evaluate
+ !-> MESSAGE/CONTINUE 2
+2
+ 
+ 
+! cleanup
+cancel symbols/all
+show symbols/all
+PPL$XPIXEL = "1008"
+PPL$YPIXEL = "816"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "25.6"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:26"
+SESSION_PID = "24491"
+DELTA_CPU = "0.022997"
+CLOCK_SECS = "0.333"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:26:35"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "PyFerret"
+ 
+*** Running test: bn_comma_delimited.jnl
+! bn420_comma_delimited
+ 
+! 10/2/95 - test comma and tab-delimited outputs
+ 
+use gt4d011
+ 
+! all possible 1, 2, and 3 dimensional lists
+!XYZT
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+   135.5W,134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.78,27.62
+1.2S,27.68,27.52
+ ---- K:3 Z:   25
+1.5S,27.65,27.49
+1.2S,27.51,27.35
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-TIME-DEPTH (m))
+   135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.78,27.62
+1.2S,27.68,27.52
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.65,27.49
+1.2S,27.51,27.35
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE-TIME)
+   135.5W,134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+25,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+15,27.78,27.62
+25,27.65,27.49
+ ---- J:42 Y:   1.2S
+15,27.68,27.52
+25,27.51,27.35
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-TIME-LATITUDE)
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+25,27.25,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.78,27.62
+25,27.65,27.49
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+25,27.13,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.68,27.52
+25,27.51,27.35
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-LATITUDE-DEPTH (m))
+          135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+16-SEP-1982 22,27.78,27.62
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+16-SEP-1982 22,27.68,27.52
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.25,27.12
+16-SEP-1982 22,27.65,27.49
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.13,27.01
+16-SEP-1982 22,27.51,27.35
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-TIME-DEPTH (m)-LATITUDE)
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+16-SEP-1982 22,27.78,27.62
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.12
+16-SEP-1982 22,27.65,27.49
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+16-SEP-1982 22,27.68,27.52
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.13,27.01
+16-SEP-1982 22,27.51,27.35
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m)-TIME)
+   1.5S,1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+135.5W,27.78,27.68
+134.5W,27.62,27.52
+ ---- K:3 Z:   25
+135.5W,27.65,27.51
+134.5W,27.49,27.35
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-LONGITUDE-TIME-DEPTH (m))
+   1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.78,27.68
+134.5W,27.62,27.52
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.65,27.51
+134.5W,27.49,27.35
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE-TIME)
+   1.5S,1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+25,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+15,27.78,27.68
+25,27.65,27.51
+ ---- I:96 X:   134.5W
+15,27.62,27.52
+25,27.49,27.35
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-DEPTH (m)-TIME-LONGITUDE)
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+25,27.25,27.13
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.78,27.68
+25,27.65,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+25,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+15,27.62,27.52
+25,27.49,27.35
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-LONGITUDE-DEPTH (m))
+          1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+16-SEP-1982 22,27.78,27.68
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.52
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.25,27.13
+16-SEP-1982 22,27.65,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.49,27.35
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LATITUDE-TIME-DEPTH (m)-LONGITUDE)
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+16-SEP-1982 22,27.78,27.68
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.13
+16-SEP-1982 22,27.65,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.52
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.49,27.35
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+135.5W,27.78,27.65
+134.5W,27.62,27.49
+ ---- J:42 Y:   1.2S
+135.5W,27.68,27.51
+134.5W,27.52,27.35
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-TIME-LATITUDE)
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.78,27.65
+134.5W,27.62,27.49
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+135.5W,27.68,27.51
+134.5W,27.52,27.35
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE-TIME)
+   15      ,25      
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+1.5S,27.78,27.65
+1.2S,27.68,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.62,27.49
+1.2S,27.52,27.35
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-LATITUDE-TIME-LONGITUDE)
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.78,27.65
+1.2S,27.68,27.51
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+1.5S,27.62,27.49
+1.2S,27.52,27.35
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LONGITUDE-LATITUDE)
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.25
+16-SEP-1982 22,27.78,27.65
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.49
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24,27.13
+16-SEP-1982 22,27.68,27.51
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.52,27.35
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (DEPTH (m)-TIME-LATITUDE-LONGITUDE)
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.25
+16-SEP-1982 22,27.78,27.65
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.13
+16-SEP-1982 22,27.68,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22,27.12
+16-SEP-1982 22,27.62,27.49
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12,27.01
+16-SEP-1982 22,27.52,27.35
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-LATITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.78
+134.5W,27.22,27.62
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.68
+134.5W,27.12,27.52
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.25,27.65
+134.5W,27.12,27.49
+ ---- J:42 Y:   1.2S
+135.5W,27.13,27.51
+134.5W,27.01,27.35
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LONGITUDE-DEPTH (m)-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33,27.78
+134.5W,27.22,27.62
+ ---- K:3 Z:   25
+135.5W,27.25,27.65
+134.5W,27.12,27.49
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24,27.68
+134.5W,27.12,27.52
+ ---- K:3 Z:   25
+135.5W,27.13,27.51
+134.5W,27.01,27.35
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-LONGITUDE-DEPTH (m))
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.78
+1.2S,27.24,27.68
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.62
+1.2S,27.12,27.52
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.25,27.65
+1.2S,27.13,27.51
+ ---- I:96 X:   134.5W
+1.5S,27.12,27.49
+1.2S,27.01,27.35
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-LATITUDE-DEPTH (m)-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33,27.78
+1.2S,27.24,27.68
+ ---- K:3 Z:   25
+1.5S,27.25,27.65
+1.2S,27.13,27.51
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22,27.62
+1.2S,27.12,27.52
+ ---- K:3 Z:   25
+1.5S,27.12,27.49
+1.2S,27.01,27.35
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LONGITUDE-LATITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33,27.78
+25,27.25,27.65
+ ---- I:96 X:   134.5W
+15,27.22,27.62
+25,27.12,27.49
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24,27.68
+25,27.13,27.51
+ ---- I:96 X:   134.5W
+15,27.12,27.52
+25,27.01,27.35
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (TIME-DEPTH (m)-LATITUDE-LONGITUDE)
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.78
+25,27.25,27.65
+ ---- J:42 Y:   1.2S
+15,27.24,27.68
+25,27.13,27.51
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22,27.62
+25,27.12,27.49
+ ---- J:42 Y:   1.2S
+15,27.12,27.52
+25,27.01,27.35
+ 
+!XYZ
+set region/i=95:96/j=41:42/k=2:3/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- K:2 Z:   15
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.25,27.12
+1.2S,27.13,27.01
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+25,27.13,27.01
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+25,27.25,27.12
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+25,27.13,27.01
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          135.5W,134.5W
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.25,27.12
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.13,27.01
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.12
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.13,27.01
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- K:2 Z:   15
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+ ---- K:3 Z:   25
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.25,27.13
+134.5W,27.12,27.01
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+25,27.12,27.01
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+25,27.25,27.13
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+25,27.12,27.01
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+          1.5S,1.2S
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.25,27.13
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.25,27.13
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+ ---- K:3 Z:   25
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33,27.25
+134.5W,27.22,27.12
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24,27.13
+134.5W,27.12,27.01
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33,27.25
+1.2S,27.24,27.13
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22,27.12
+1.2S,27.12,27.01
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.25
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24,27.13
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+          15      ,25      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.25
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.13
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22,27.12
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12,27.01
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+ ---- K:3 Z:   25
+ ---- J:41 Y:   1.5S
+135.5W,27.25
+134.5W,27.12
+ ---- J:42 Y:   1.2S
+135.5W,27.13
+134.5W,27.01
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LONGITUDE-DEPTH (m)-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33
+134.5W,27.22
+ ---- K:3 Z:   25
+135.5W,27.25
+134.5W,27.12
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24
+134.5W,27.12
+ ---- K:3 Z:   25
+135.5W,27.13
+134.5W,27.01
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-LONGITUDE-DEPTH (m))
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+ ---- K:3 Z:   25
+ ---- I:95 X:   135.5W
+1.5S,27.25
+1.2S,27.13
+ ---- I:96 X:   134.5W
+1.5S,27.12
+1.2S,27.01
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (LATITUDE-DEPTH (m)-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33
+1.2S,27.24
+ ---- K:3 Z:   25
+1.5S,27.25
+1.2S,27.13
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22
+1.2S,27.12
+ ---- K:3 Z:   25
+1.5S,27.12
+1.2S,27.01
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33
+25,27.25
+ ---- I:96 X:   134.5W
+15,27.22
+25,27.12
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24
+25,27.13
+ ---- I:96 X:   134.5W
+15,27.12
+25,27.01
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 points (DEPTH (m)-LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33
+25,27.25
+ ---- J:42 Y:   1.2S
+15,27.24
+25,27.13
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22
+25,27.12
+ ---- J:42 Y:   1.2S
+15,27.12
+25,27.01
+ 
+!!XYT
+!set region/i=95:96/j=41:42/k=2/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!XZT
+!set region/i=95:96/j=41/k=2:3/l=5:6
+!go bn_comma_delimited.sub comma temp
+!!YZT
+!set region/i=95/j=41:42/k=2:3/l=5:6
+!!go bn_comma_delimited.sub comma temp
+!XY
+set region/i=95:96/j=41:42/k=2/l=5
+go bn_comma_delimited.sub comma temp
+! bn420_comma_delimited.sub
+! 10/95 benchmark various permutations for FERRET listed output
+ 
+! similar to bn200_permute except that a "format" argument can be passed
+! and the region and expression information are external
+ 
+! usage:
+!	SET REGION/xxxx
+!	GO bn420_permute tab_delimited  TEMP
+ 
+LOAD $2
+ !-> LOAD temp
+ 
+LIST/ORDER=XYZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+LIST/ORDER=XYTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XYTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   135.5W,134.5W
+1.5S,27.33,27.22
+1.2S,27.24,27.12
+LIST/ORDER=XZYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+15,27.33,27.22
+ ---- J:42 Y:   1.2S
+15,27.24,27.12
+LIST/ORDER=XZTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XZTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.22
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.24,27.12
+LIST/ORDER=XTYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24,27.12
+LIST/ORDER=XTZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=XTZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          135.5W,134.5W
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.22
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.24,27.12
+LIST/ORDER=YXZT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXZT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+LIST/ORDER=YXTZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YXTZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   1.5S,1.2S
+135.5W,27.33,27.24
+134.5W,27.22,27.12
+LIST/ORDER=YZXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+15,27.33,27.24
+ ---- I:96 X:   134.5W
+15,27.22,27.12
+LIST/ORDER=YZTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YZTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.33,27.24
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+15,27.22,27.12
+LIST/ORDER=YTXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22,27.12
+LIST/ORDER=YTZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=YTZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+          1.5S,1.2S
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.33,27.24
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+10-SEP-1982 20,27.22,27.12
+LIST/ORDER=ZXYT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXYT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=ZXTY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZXTY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- J:41 Y:   1.5S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+ ---- L:5 T:   10-SEP-1982 20:00
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=ZYXT $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYXT /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=ZYTX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZYTX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   15      
+ ---- I:95 X:   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=ZTXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.33
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.22
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+10-SEP-1982 20,27.24
+ ---- I:96 X:   134.5W
+10-SEP-1982 20,27.12
+LIST/ORDER=ZTYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=ZTYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+          15      
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.33
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.24
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+10-SEP-1982 20,27.22
+ ---- J:42 Y:   1.2S
+10-SEP-1982 20,27.12
+LIST/ORDER=TXYZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXYZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=TXZY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TXZY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- K:2 Z:   15
+135.5W,27.33
+134.5W,27.22
+ ---- J:42 Y:   1.2S
+ ---- K:2 Z:   15
+135.5W,27.24
+134.5W,27.12
+LIST/ORDER=TYXZ $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYXZ /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=TYZX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TYZX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- K:2 Z:   15
+1.5S,27.33
+1.2S,27.24
+ ---- I:96 X:   134.5W
+ ---- K:2 Z:   15
+1.5S,27.22
+1.2S,27.12
+LIST/ORDER=TZXY $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZXY /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- J:41 Y:   1.5S
+ ---- I:95 X:   135.5W
+15,27.33
+ ---- I:96 X:   134.5W
+15,27.22
+ ---- J:42 Y:   1.2S
+ ---- I:95 X:   135.5W
+15,27.24
+ ---- I:96 X:   134.5W
+15,27.12
+LIST/ORDER=TZYX $1" |*>/FORMAT=*" $2
+ !-> LIST/ORDER=TZYX /FORMAT=comma temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-LONGITUDE)
+             TIME     : 10-SEP-1982 20:00
+             DEPTH (m): 15
+   10-SEP-1982 20:00
+ ---- I:95 X:   135.5W
+ ---- J:41 Y:   1.5S
+15,27.33
+ ---- J:42 Y:   1.2S
+15,27.24
+ ---- I:96 X:   134.5W
+ ---- J:41 Y:   1.5S
+15,27.22
+ ---- J:42 Y:   1.2S
+15,27.12
+ 
+!XZ
+set region/i=95:96/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=xz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-DEPTH (m))
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+15,27.335,27.222
+25,27.248,27.125
+LIST/FORMAT=comma/precision=5/order=zx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LONGITUDE)
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+135.5W,27.335,27.248
+134.5W,27.222,27.125
+!XT
+set region/i=95:96/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=xt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-TIME)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+          135.5W,134.5W
+10-SEP-1982 20,27.335,27.222
+16-SEP-1982 22,27.775,27.622
+LIST/FORMAT=comma/precision=5/order=tx temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+135.5W,27.335,27.775
+134.5W,27.222,27.622
+!YZ
+set region/i=95/j=41:42/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=yz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-DEPTH (m))
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+15,27.335,27.238
+25,27.248,27.129
+LIST/FORMAT=comma/precision=5/order=zy temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-LATITUDE)
+             LONGITUDE: 135.5W
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+1.5S,27.335,27.248
+1.2S,27.238,27.129
+!YT
+set region/i=95/j=41:42/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=yt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+          1.5S,1.2S
+10-SEP-1982 20,27.335,27.238
+16-SEP-1982 22,27.775,27.678
+LIST/FORMAT=comma/precision=5/order=ty temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+1.5S,27.335,27.775
+1.2S,27.238,27.678
+!ZT
+set region/i=95/j=41/k=2:3/l=5:6
+LIST/FORMAT=comma/precision=5/order=zt temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (DEPTH (m)-TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+          15      ,25      
+10-SEP-1982 20,27.335,27.248
+16-SEP-1982 22,27.775,27.652
+LIST/FORMAT=comma/precision=5/order=tz temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (TIME-DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+15,27.335,27.775
+25,27.248,27.652
+!X
+set region/i=95:96/j=41/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+row 1,27.335,27.222
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S
+135.5W,27.335
+134.5W,27.222
+!Y
+set region/i=95/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5/order=y temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   1.5S,1.2S
+row 1,27.335,27.238
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (LATITUDE)
+             LONGITUDE: 135.5W
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W
+1.5S,27.335
+1.2S,27.238
+!Z
+set region/i=95/j=41/k=2:3/l=5
+LIST/FORMAT=comma/precision=5/order=z temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   15      ,25      
+row 1,27.335,27.248
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (DEPTH (m))
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             TIME     : 10-SEP-1982 20:00
+   135.5W
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- K:3 Z:   25
+1.5S,27.248
+!T
+set region/i=95/j=41/k=2/l=5:6
+LIST/FORMAT=comma/precision=5/order=t temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   10-SEP-1982 20:00,16-SEP-1982 22:00
+row 1,27.335,27.775
+LIST/FORMAT=comma/precision=5/order=x temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 135.5W
+             LATITUDE : 1.5S
+             DEPTH (m): 15
+   135.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S,27.335
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S,27.775
+ 
+! tab-delimited test
+set region/i=95:96/j=41:42/k=2:3/l=5:6
+LIST/FORMAT=tab temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+  	135.5W	134.5W
+ ---- L:5 T:   10-SEP-1982 20:00
+ ---- K:2 Z:   15
+1.5S	27.33	27.22
+1.2S	27.24	27.12
+ ---- K:3 Z:   25
+1.5S	27.25	27.12
+1.2S	27.13	27.01
+ ---- L:6 T:   16-SEP-1982 22:00
+ ---- K:2 Z:   15
+1.5S	27.78	27.62
+1.2S	27.68	27.52
+ ---- K:3 Z:   25
+1.5S	27.65	27.49
+1.2S	27.51	27.35
+ 
+! big number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,2.E+08,2.E+08
+1.2S,2.E+08,2.E+08
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e7
+             VARIABLE : RANDU(I)*TEMP*1E7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,1.6675084E+08,2.0208841E+08
+1.2S,1.6616283E+08,2.0136658E+08
+ 
+! small number formatting test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=1 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,0.000002,0.000002
+1.2S,0.000002,0.000002
+LIST/FORMAT=comma/precision=9 randu(i)*temp*1e-7
+             VARIABLE : RANDU(I)*TEMP*1E-7
+             FILENAME : gt4d011.cdf
+             BAD FLAG : -1.E+34       
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             TIME     : 10-SEP-1982 20:00
+   135.5W,134.5W
+1.5S,0.00000166750845,0.00000202088412
+1.2S,0.00000166162833,0.00000201366579
+ 
+! multiple variable test
+set region/i=95:96/j=41:42/k=2/l=5
+LIST/FORMAT=comma/precision=5 u,v
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 135.5W to 133.5W
+             LATITUDE: 1.5S to 0.8S
+             DEPTH (m): 15
+             TIME: 10-SEP-1982 20:00
+ Column  1: U is ZONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+ Column  2: V is MERIDIONAL VELOCITY (cm/sec)   BAD FLAG : -1.E+34
+           U,V
+ ---- J:41 Y:   1.3S
+135W   / 95:41.597,-1.5366  
+134W   / 96:39.163,-1.7415  
+ ---- J:42 Y:   1S
+135W   / 95:42.39,1.4695  
+134W   / 96:40.019,1.5182  
+ 
+! abstract expression test
+set region/i=1:5/j=1:3
+LIST/FORMAT=comma/precision=5 10*j+i
+             VARIABLE : 10*J+I
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 3 points (X-Y)
+   1  ,2  ,3  ,4  ,5  
+1,11,12,13,14,15
+2,21,22,23,24,25
+3,31,32,33,34,35
+*** Running test: bn_dynamic_grids.jnl
+! bn420_dynamic_grids
+! 9/95-9/11/95 - test the creation, destruction, and use of dynamic grids
+! 2/96 - added GX=lo:hi:delta notation
+! 4/98 *sh* changes once again to confine_axis -- earlier trapped error is once
+!		again an error
+! V500beta1.1 5/26/99 *kob* - As of v500beta1.1, there is a modification to
+!			      tm_world_recur.c which fixes a previous problem
+!		 	      w/ implicit strides on an underlying irregular grid.
+!			      This caused numerical differences in the output benchmark
+!			      log files when compared to pre beta5001.1 logs.  The
+!			      numericals results found here are verified to be correct
+! V550 11/02 *sh* - documentation change only reflecting new modulo behavior
+! V603  5/07 *acm*  documentation changew - some of the context errors have gone away.
+ 
+! deliberate dynamic grid errors
+ 
+can mode diag
+ 
+use gtsa056_1
+ 
+set region/l=1/k=1/i=101:105/j=46:50
+ 
+! what the implicit grids look like
+load temp[gx=u]
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+set mode ignore_errors
+ 
+list temp[gx=noexist]		! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,p=noexist]	! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! new error checks 2/96
+list temp[gx=130e:80w:10,x=160e:160w]	! err during get_context_mods
+list temp[gx=130e:80w:10,i=2:5]		! err during get_context_mods
+list temp[i=2:5,gx=130e:80w:10]		! err during get_context_mods
+list temp[gx=130e:80w]			! err during get_context_mods
+ 
+list temp[gx=u]	+ noexist 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=30]		! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=u,k=20]		! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=psyu]		! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+list/i=3:6 X[gx=PSYT]		! same err but on pseudo-variable
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+! now similar error tests but nested one level down on stack
+ 
+let a = u
+list temp[gx=a]			! uvar for grid name
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,p=noexist]
+list tu				! err during get_context_mods
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u] + noexist
+list tu			 	! err during is_algebra
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=30]
+list tu				! err during get_var_context
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=u,k=20]
+list tu				! err during read
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let  tu = temp[gx=psyu]
+list tu				! err during get_context_grid - axis mismatch
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+define axis/z=5:15/npoints=999999/unit=meters/depth z999999
+ 
+!    SET MEM smaller to make sure to get the intended error,
+!    else we list huge amount of adata
+ 
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem/siz = 10
+ 
+list temp[gz=z999999,z=5:15]	! err during regrid
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ Z999999   DEPTH (m)       999999 r-  5                    15
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+set mem/siz=`save_mem`
+ !-> set mem/siz=25.6
+ 
+shade 1/0 * temp[gx=u]		! err during plot
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+set mode/last ignore
+ 
+! =================================
+ 
+! basic implicit grid accesses
+list temp[gx=psxu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gy=psyu]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.67N / 50:  24.66  24.43  24.31  24.32  24.52
+ 1.33N / 49:  24.44  24.24  24.14  24.14  24.31
+ 1N    / 48:  24.25  24.08  23.97  23.95  24.09
+ 0.67N / 47:  24.09  23.95  23.84  23.79  23.87
+ 0.33N / 46:  23.99  23.87  23.77  23.70  23.71
+ 
+list temp[gx=u]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list temp[gx=w]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: TEMP
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  24.54  24.34  24.23  24.23  24.42
+ 1.17N / 49:  24.34  24.15  24.05  24.04  24.20
+ 0.83N / 48:  24.16  24.00  23.89  23.86  23.98
+ 0.5N  / 47:  24.02  23.89  23.79  23.73  23.77
+ 0.17N / 46:  23.96  23.85  23.74  23.66  23.64
+ 
+list  temp[gx=psxu] + 5
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+list  5 + temp[gx=psxu]
+             VARIABLE : 5 + TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+let tu = temp[gx=psxu]
+list tu
+             VARIABLE : TEMP[GX=PSXU]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  24.44  24.28  24.23  24.33  24.62
+ 1.17N / 49:  24.24  24.10  24.04  24.12  24.37
+ 0.83N / 48:  24.08  23.94  23.87  23.92  24.11
+ 0.5N  / 47:  23.96  23.84  23.76  23.75  23.87
+ 0.17N / 46:  23.90  23.79  23.70  23.65  23.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+show grid tu
+    GRID (G005)
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+ 
+let tu = temp[gx=psxu] + 5
+list tu
+             VARIABLE : TEMP[GX=PSXU] + 5
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   128W   127W   126W   125W   
+              101    102    103    104    105
+ 1.5N  / 50:  29.44  29.28  29.23  29.33  29.62
+ 1.17N / 49:  29.24  29.10  29.04  29.12  29.37
+ 0.83N / 48:  29.08  28.94  28.87  28.92  29.11
+ 0.5N  / 47:  28.96  28.84  28.76  28.75  28.87
+ 0.17N / 46:  28.90  28.79  28.70  28.65  28.69
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+ 
+! implicit grid conformability
+set reg/x=180:175w/y=0:2n/z=0/l=1
+list taux[g=temp]		! grid to temp w/out Z axis
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 7 points (LONGITUDE-LATITUDE)
+             TIME     : 15-JAN-1982 14:00
+               179.5W  178.5W  177.5W  176.5W  175.5W 
+                51      52      53      54      55
+ 1.83N / 51: -0.6280 -0.6522 -0.6598 -0.6632 -0.6626
+ 1.5N  / 50: -0.6316 -0.6539 -0.6537 -0.6505 -0.6444
+ 1.17N / 49: -0.6352 -0.6556 -0.6477 -0.6379 -0.6262
+ 0.83N / 48: -0.6270 -0.6471 -0.6371 -0.6267 -0.6161
+ 0.5N  / 47: -0.6072 -0.6285 -0.6218 -0.6170 -0.6141
+ 0.17N / 46: -0.5873 -0.6098 -0.6066 -0.6074 -0.6121
+ 0.17S / 45: -0.5674 -0.5912 -0.5914 -0.5977 -0.6101
+list temp[g=taux]		! grid to taux w/ Z axis (same grid as "U")
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X, on Y, 73 hour on T
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 2N    / 51:  27.58  27.54  27.50  27.45  27.37  27.27
+ 1.67N / 50:  27.61  27.56  27.52  27.47  27.39  27.29
+ 1.33N / 49:  27.66  27.60  27.55  27.49  27.41  27.32
+ 1N    / 48:  27.70  27.64  27.58  27.52  27.44  27.34
+ 0.67N / 47:  27.75  27.68  27.61  27.55  27.46  27.36
+ 0.33N / 46:  27.80  27.72  27.65  27.58  27.49  27.39
+ 0     / 45:  27.85  27.76  27.70  27.62  27.53  27.43
+list temp[gx=taux,gy=taux]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 2N    / 51:  27.58  27.54  27.50  27.45  27.37  27.27
+ 1.67N / 50:  27.61  27.56  27.52  27.47  27.39  27.29
+ 1.33N / 49:  27.66  27.60  27.55  27.49  27.41  27.32
+ 1N    / 48:  27.70  27.64  27.58  27.52  27.44  27.34
+ 0.67N / 47:  27.75  27.68  27.61  27.55  27.46  27.36
+ 0.33N / 46:  27.80  27.72  27.65  27.58  27.49  27.39
+ 0     / 45:  27.85  27.76  27.70  27.62  27.53  27.43
+list temp[gx=taux]		! X only
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               180E  179W   178W   177W   176W   175W   
+               50     51     52     53     54     55
+ 1.83N / 51:  27.59  27.55  27.50  27.46  27.38  27.28
+ 1.5N  / 50:  27.64  27.58  27.53  27.48  27.40  27.30
+ 1.17N / 49:  27.68  27.62  27.57  27.51  27.43  27.33
+ 0.83N / 48:  27.73  27.66  27.60  27.53  27.45  27.35
+ 0.5N  / 47:  27.78  27.70  27.63  27.56  27.48  27.38
+ 0.17N / 46:  27.82  27.74  27.67  27.60  27.51  27.40
+ 0.17S / 45:  27.87  27.79  27.72  27.65  27.56  27.45
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    no implicit axes
+ 
+! regridding between grids with mutually exclusive axes
+cancel region
+define grid/y=ps3dt gy
+define grid/x=ps3dt gx
+LET/QUIET a = x[g=gx]
+list/i=1:4 a,a[g=gy]   ! nothing to regrid - both are same
+             LONGITUDE: 130E to 134E
+ Column  1: A is X[G=GX]
+ Column  2: A is X[G=GX]
+                A     A
+130.5E / 1:  130.5  130.5
+131.5E / 2:  131.5  131.5
+132.5E / 3:  132.5  132.5
+133.5E / 4:  133.5  133.5
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! pseudo-variables
+set data gtsa056_1
+ 
+list/i=3:6 X		! abstract
+             VARIABLE : X
+                        axis ABSTRACT
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 6   / 6:  6.000
+list/i=3:6 X[g=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+list/i=3:6 X[gx=u]	! PS3DU
+             VARIABLE : X
+                        axis PSXU
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+list/i=3:6 X[gx=PSXT]	! PS3DT
+             VARIABLE : X
+                        axis PSXT
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.5
+ 133.5E / 4:  133.5
+ 134.5E / 5:  134.5
+ 135.5E / 6:  135.5
+ 
+let ax = x
+list/i=3:6 ax		! abstract
+             VARIABLE : X
+             SUBSET   : 4 points (X)
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 6   / 6:  6.000
+let ax = X[g=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[G=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+let ax = X[gx=u]
+list/i=3:6 ax		! PS3DU
+             VARIABLE : X[GX=U]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 points (LONGITUDE)
+ 133E   / 3:  133.0
+ 134E   / 4:  134.0
+ 135E   / 5:  135.0
+ 136E   / 6:  136.0
+let ax = X[gx=PSXT]
+list/i=3:6 ax		! PS3DT
+             VARIABLE : X[GX=PSXT]
+             SUBSET   : 4 points (LONGITUDE)
+ 132.5E / 3:  132.5
+ 133.5E / 4:  133.5
+ 134.5E / 5:  134.5
+ 135.5E / 6:  135.5
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+ 
+!!!!!!!!!!!!!!!!!!!!!!!!
+! dynamic axes
+! * * * dynamic generation of pseudo-variables * * *
+list x[x=.1:1:.1]			! dynamic abstract
+             VARIABLE : X
+                        axis (AX002)
+             SUBSET   : 10 points (X)
+ 0.1  /  1:  0.100
+ 0.2  /  2:  0.200
+ 0.3  /  3:  0.300
+ 0.4  /  4:  0.400
+ 0.5  /  5:  0.500
+ 0.6  /  6:  0.600
+ 0.7  /  7:  0.700
+ 0.8  /  8:  0.800
+ 0.9  /  9:  0.900
+ 1    / 10:  1.000
+list x[gx=psxu,x=130:150:2.5]		! dynamic based on named axis
+             VARIABLE : X
+                        axis (AX001)
+             SUBSET   : 9 points (LONGITUDE)
+ 130E   / 1:  130.0
+ 132.5E / 2:  132.5
+ 135E   / 3:  135.0
+ 137.5E / 4:  137.5
+ 140E   / 5:  140.0
+ 142.5E / 6:  142.5
+ 145E   / 7:  145.0
+ 147.5E / 8:  147.5
+ 150E   / 9:  150.0
+! abstract variables
+cancel region
+LET/QUIET a = x[x=0.1:10:1.5] + y[y=101:110:1]
+list a
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+             SUBSET   : 7 by 10 points (X-Y)
+                0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+                1      2      3      4      5      6      7
+ 101   /  1:  101.1  102.6  104.1  105.6  107.1  108.6  110.1
+ 102   /  2:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 103   /  3:  103.1  104.6  106.1  107.6  109.1  110.6  112.1
+ 104   /  4:  104.1  105.6  107.1  108.6  110.1  111.6  113.1
+ 105   /  5:  105.1  106.6  108.1  109.6  111.1  112.6  114.1
+ 106   /  6:  106.1  107.6  109.1  110.6  112.1  113.6  115.1
+ 107   /  7:  107.1  108.6  110.1  111.6  113.1  114.6  116.1
+ 108   /  8:  108.1  109.6  111.1  112.6  114.1  115.6  117.1
+ 109   /  9:  109.1  110.6  112.1  113.6  115.1  116.6  118.1
+ 110   / 10:  110.1  111.6  113.1  114.6  116.1  117.6  119.1
+list a[i=1:10:3]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 4.5 delta on X
+             SUBSET   : 3 by 10 points (X-Y)
+                0.1    4.6    9.1  
+                1      2      3
+ 101   /  1:  101.1  105.6  110.1
+ 102   /  2:  102.1  106.6  111.1
+ 103   /  3:  103.1  107.6  112.1
+ 104   /  4:  104.1  108.6  113.1
+ 105   /  5:  105.1  109.6  114.1
+ 106   /  6:  106.1  110.6  115.1
+ 107   /  7:  107.1  111.6  116.1
+ 108   /  8:  108.1  112.6  117.1
+ 109   /  9:  109.1  113.6  118.1
+ 110   / 10:  110.1  114.6  119.1
+list a[i=-1:20:5]		! clips to allowed limits
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7.5 delta on X
+             SUBSET   : 2 by 10 points (X-Y)
+                0.1    7.6  
+                1      2
+ 101   /  1:  101.1  108.6
+ 102   /  2:  102.1  109.6
+ 103   /  3:  103.1  110.6
+ 104   /  4:  104.1  111.6
+ 105   /  5:  105.1  112.6
+ 106   /  6:  106.1  113.6
+ 107   /  7:  107.1  114.6
+ 108   /  8:  108.1  115.6
+ 109   /  9:  109.1  116.6
+ 110   / 10:  110.1  117.6
+list a[y=102:105:.5]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 0.5 delta on Y
+             SUBSET   : 7 by 7 points (X-Y)
+                0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+                1      2      3      4      5      6      7
+ 102    / 1:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 102.5  / 2:  102.6  104.1  105.6  107.1  108.6  110.1  111.6
+ 103    / 3:  103.1  104.6  106.1  107.6  109.1  110.6  112.1
+ 103.5  / 4:  103.6  105.1  106.6  108.1  109.6  111.1  112.6
+ 104    / 5:  104.1  105.6  107.1  108.6  110.1  111.6  113.1
+ 104.5  / 6:  104.6  106.1  107.6  109.1  110.6  112.1  113.6
+ 105    / 7:  105.1  106.6  108.1  109.6  111.1  112.6  114.1
+list a[y=95:115:7]
+             VARIABLE : X[X=0.1:10:1.5] + Y[Y=101:110:1]
+                        regrid: 7 delta on Y
+             SUBSET   : 7 by 3 points (X-Y)
+               0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+               1      2      3      4      5      6      7
+ 95    / 1:   ....   ....   ....   ....   ....   ....   ....
+ 102   / 2:  102.1  103.6  105.1  106.6  108.1  109.6  111.1
+ 109   / 3:  109.1  110.6  112.1  113.6  115.1  116.6  118.1
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    7 r   0.1                  9.1
+ (AX001)   Y                    3 r   95                   109
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    7 r   0.1                  9.1
+ (AX002)   Y                   10 r   101                  110
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   2
+    AXIS (AX002)                         use count:   1
+ 
+! ambiguous coordinate tests
+list/order=x  x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+            0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+            1      2      3      4      5      6      7
+           1.20   4.20   7.20  10.20  13.20  16.20  19.20
+LET/QUIET a = x[x=0.1:10:1.5] +  x[x=1.1:11:1.5]
+list/order=x a
+             VARIABLE : X[X=0.1:10:1.5] +  X[X=1.1:11:1.5]
+             SUBSET   : 7 points (X)
+            0.1    1.6    3.1    4.6    6.1    7.6    9.1  
+            1      2      3      4      5      6      7
+           1.20   4.20   7.20  10.20  13.20  16.20  19.20
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   2
+ name       axis              # pts   start                end
+ (AX001)   X                    7 r   0.1                  9.1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+ 
+! box size on dynamic axes
+cancel region
+define axis/from/x/name=xirreg x[x=1:100:10]^2
+define grid/x=xirreg girreg
+let/quiet a = xbox[gx=xirreg]
+list a    ! "normal" irregular axis
+             VARIABLE : XBOX[GX=XIRREG]
+             SUBSET   : 10 points (X)
+ 1      /  1:   120.
+ 121    /  2:   220.
+ 441    /  3:   420.
+ 961    /  4:   620.
+ 1681   /  5:   820.
+ 2601   /  6:  1020.
+ 3721   /  7:  1220.
+ 5041   /  8:  1420.
+ 6561   /  9:  1620.
+ 8281   / 10:  1720.
+let/quiet b = a[i=1:10:2]
+load b     ! "child" irregular axis
+show grid/x
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     280        -59
+       2>  441                   840        221
+       3>  1681                  1640       1061
+       4>  3721                  2440       2701
+       5>  6561                  4000       5141
+ 
+use gtsa056_1
+list/i=1:10 x[gx=temp]			! from named variable
+             VARIABLE : X
+                        axis PSXT
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 130.5E /  1:  130.5
+ 131.5E /  2:  131.5
+ 132.5E /  3:  132.5
+ 133.5E /  4:  133.5
+ 134.5E /  5:  134.5
+ 135.5E /  6:  135.5
+ 136.5E /  7:  136.5
+ 137.5E /  8:  137.5
+ 138.5E /  9:  138.5
+ 139.5E / 10:  139.5
+list x[g=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX005)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.0
+ 147.5W / 2:  212.5
+ 145W   / 3:  215.0
+ 142.5W / 4:  217.5
+ 140W   / 5:  220.0
+ 137.5W / 6:  222.5
+ 135W   / 7:  225.0
+ 132.5W / 8:  227.5
+ 130W   / 9:  230.0
+list x[gx=temp,x=150w:130w:2.5]		! dynamic based on named variable
+             VARIABLE : X
+                        axis (AX002)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 points (LONGITUDE)
+ 150W   / 1:  210.0
+ 147.5W / 2:  212.5
+ 145W   / 3:  215.0
+ 142.5W / 4:  217.5
+ 140W   / 5:  220.0
+ 137.5W / 6:  222.5
+ 135W   / 7:  225.0
+ 132.5W / 8:  227.5
+ 130W   / 9:  230.0
+ 
+list/i=101:105/j=46:50/l=1/k=1 temp+x	! grid inherited from expression
+             VARIABLE : TEMP+X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ 1.5N  / 50:  255.0  255.8  256.7  257.7  258.9
+ 1.17N / 49:  254.8  255.7  256.5  257.5  258.7
+ 0.83N / 48:  254.7  255.5  256.4  257.4  258.5
+ 0.5N  / 47:  254.5  255.4  256.3  257.2  258.3
+ 0.17N / 46:  254.5  255.3  256.2  257.2  258.1
+show grid/dyn
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+ 
+! this expression does NOT inherit the X axis -- the result is
+!	i) ambiguous X axis coordinates
+!	ii) 2 dynamic axes are created in the course of processing
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[i=101:120:4]	! NOT !!!
+             VARIABLE : TEMP[I=101:120:4]+X[I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 125.5W 121.5W 117.5W 113.5W 
+                1      2      3      4      5
+ 1.5N  / 50:  125.5  129.4  134.5  137.1  141.6
+ 1.17N / 49:  125.3  129.2  134.2  136.9  141.3
+ 0.83N / 48:  125.2  129.0  133.7  136.7  141.0
+ 0.5N  / 47:  125.0  128.8  133.3  136.5  140.6
+ 0.17N / 46:  125.0  128.6  133.0  136.4  140.4
+show grid/dynamic
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE            5 r   129.5W               113.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+list/j=46:50/l=1/k=1 temp[i=101:120:4]+x[g=temp,i=101:120:4]
+             VARIABLE : TEMP[I=101:120:4]+X[G=TEMP,I=101:120:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129.5W 125.5W 121.5W 117.5W 113.5W 
+                1      2      3      4      5
+ 1.5N  / 50:  255.0  258.9  264.0  266.6  271.1
+ 1.17N / 49:  254.8  258.7  263.7  266.4  270.8
+ 0.83N / 48:  254.7  258.5  263.2  266.2  270.5
+ 0.5N  / 47:  254.5  258.3  262.8  266.0  270.1
+ 0.17N / 46:  254.5  258.1  262.5  265.9  269.9
+ 
+ 
+! * * * dynamic axis generation used to regrid variables * * *
+SET REGION/I=101:105/J=46:50/l=1/k=1
+ 
+! deliberate errors:  ****
+list x[i=5:1:1]		! not an error: inverted order
+             VARIABLE : X
+                        axis (AX001)
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+set mode ignore
+list x[i=1:5:-1]	! error: negative delta
+list x[i=1:5:0]		! error: delta=0
+list x[x=1:5:-1]	! error: negative delta
+list x[x=1:5:0]		! error: delta=0
+list temp[i=200:210:2]	! was: "completely out of range"  now: ok - subspan modulo 11/02
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              168.5E 170.5E 172.5E 174.5E 176.5E 178.5E 
+                1      2      3      4      5      6
+ 1.5N  / 50:  29.22  29.18  28.93  28.67  28.12  27.73
+ 1.17N / 49:  29.25  29.18  28.97  28.71  28.22  27.80
+ 0.83N / 48:  29.27  29.18  28.98  28.72  28.30  27.88
+ 0.5N  / 47:  29.30  29.19  28.98  28.73  28.36  27.95
+ 0.17N / 46:  29.34  29.22  28.99  28.75  28.40  28.01
+list temp[i=-200:-190:2]! was: "completely out of range"  now: ok - subspan modulo 11/0
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              108.5W 106.5W 104.5W 102.5W 100.5W 98.5W  
+                1      2      3      4      5      6
+ 1.5N  / 50:  25.42  25.24  25.05  25.23  25.49  25.81
+ 1.17N / 49:  25.02  24.88  24.74  24.91  25.20  25.55
+ 0.83N / 48:  24.65  24.54  24.42  24.56  24.88  25.25
+ 0.5N  / 47:  24.28  24.20  24.10  24.22  24.52  24.90
+ 0.17N / 46:  23.97  23.90  23.82  23.92  24.19  24.56
+canc mode ignore
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE            6 i   108.5W(-468.5)       98.5W(-458.5)
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! regular dynamic axis
+! ... by subscript
+list temp[i=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.86  24.34  24.23  24.82  25.60  25.22
+ 1.17N / 49:  24.60  24.15  24.04  24.53  25.22  24.82
+ 0.83N / 48:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.5N  / 47:  24.19  23.89  23.73  23.97  24.36  24.07
+ 0.17N / 46:  24.09  23.85  23.66  23.74  24.03  23.83
+! ... by world coord
+list temp[x=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+! ... by world coord
+list temp[y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4N   / 4:  26.07  25.76  25.43  25.17  25.18
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 0.5S / 1:  24.07  23.99  23.89  23.79  23.70
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX001)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! ========
+! 2/96: repeat the very same commands using GX=lo:hi:delta notation
+! regular dynamic axis
+! ... by subscript
+list temp[gi=100:110:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.86  24.34  24.23  24.82  25.60  25.22
+ 1.17N / 49:  24.60  24.15  24.04  24.53  25.22  24.82
+ 0.83N / 48:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.5N  / 47:  24.19  23.89  23.73  23.97  24.36  24.07
+ 0.17N / 46:  24.09  23.85  23.66  23.74  24.03  23.83
+! ... by world coord
+list temp[gx=130w:120W:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+ 
+! irregular dynamic axis (Y axis of model grid)
+! ... by subscript
+list temp[gj=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+! ... by world coord
+list temp[gy=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4N   / 4:  26.07  25.76  25.43  25.17  25.18
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 0.5S / 1:  24.07  23.99  23.89  23.79  23.70
+ 
+! and a few more for pseudo-variables
+list/nohead X[GX=130e:80w:40]
+ 130E   / 1:  130.0
+ 170E   / 2:  170.0
+ 150W   / 3:  210.0
+ 110W   / 4:  250.0
+list/nohead Y[GY=10s:10n:8]
+ 6N    / 3:   6.00
+ 2S    / 2:  -2.00
+ 10S   / 1: -10.00
+list/nohead Z[GZ=0:100:30]
+ 0    / 1:   0.00
+ 30   / 2:  30.00
+ 60   / 3:  60.00
+ 90   / 4:  90.00
+list/nohead T[GT=0:100:30]
+ 0    / 1:   0.00
+ 30   / 2:  30.00
+ 60   / 3:  60.00
+ 90   / 4:  90.00
+list/nohead i[gi=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead j[gj=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead k[gk=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+list/nohead l[gl=1:11:5]
+ 1    / 1:  1.000
+ 6    / 2:  2.000
+ 11   / 3:  3.000
+ 
+! ========
+ 
+! multiple axes, simultaneously
+list temp[i=100:110:2,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+              1      2      3      4      5      6
+ 2.8N / 4:  25.88  25.10  24.76  25.36  25.95  26.11
+ 1.8N / 3:  25.15  24.52  24.40  25.06  25.84  25.57
+ 0.8N / 2:  24.37  24.00  23.86  24.25  24.77  24.40
+ 0.2S / 1:  24.08  23.88  23.69  23.63  23.81  23.67
+list temp[i=100:110:2,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130.5W 128.5W 126.5W 124.5W 122.5W 120.5W 
+              1      2      3      4      5      6
+ 4N   / 4:  26.31  25.76  25.17  25.42  26.09  26.43
+ 2.5N / 3:  25.69  24.90  24.66  25.33  25.96  26.00
+ 1N   / 2:  24.48  24.08  23.95  24.39  25.00  24.61
+ 0.5S / 1:  24.15  23.99  23.79  23.65  23.71  23.60
+list temp[x=130w:120W:3,j=45:55:3]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130W   127W   124W   121W   
+              1      2      3      4
+ 2.8N / 4:  25.69  24.79  25.55  26.09
+ 1.8N / 3:  24.96  24.40  25.31  25.68
+ 0.8N / 2:  24.26  23.87  24.41  24.55
+ 0.2S / 1:  24.03  23.73  23.67  23.72
+list temp[x=130w:120W:3,y=0.5s:5n:1.5]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 3 deg on X, 1.5 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            130W   127W   124W   121W   
+              1      2      3      4
+ 4N   / 4:  26.19  25.30  25.58  26.39
+ 2.5N / 3:  25.48  24.68  25.55  26.02
+ 1N   / 2:  24.36  23.96  24.57  24.77
+ 0.5S / 1:  24.11  23.84  23.66  23.64
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ (AX002)   LATITUDE             4 r   0.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   X                    5 i   1                    6561
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX005)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! the same tests but now on a nested definition
+! regular dynamic axis
+! ... by subscript
+LET/QUIET a temp[i=90:110:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 138.5W 136.5W 134.5W 132.5W 130.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:  24.93  24.49  25.47  25.95  25.62  24.86
+ 1.17N / 49:  24.82  24.37  25.17  25.83  25.37  24.60
+ 0.83N / 48:  24.69  24.25  24.80  25.67  25.14  24.37
+ 0.5N  / 47:  24.57  24.17  24.47  25.48  24.92  24.19
+ 0.17N / 46:  24.47  24.12  24.28  25.17  24.70  24.09
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 136.5W 132.5W 
+                1      2      3
+ 1.5N  / 50:  24.93  25.47  25.62
+ 1.17N / 49:  24.82  25.17  25.37
+ 0.83N / 48:  24.69  24.80  25.14
+ 0.5N  / 47:  24.57  24.47  24.92
+ 0.17N / 46:  24.47  24.28  24.70
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              140.5W 136.5W 132.5W 128.5W 
+                1      2      3      4
+ 1.5N  / 50:  24.93  25.47  25.62  24.34
+ 1.17N / 49:  24.82  25.17  25.37  24.15
+ 0.83N / 48:  24.69  24.80  25.14  24.00
+ 0.5N  / 47:  24.57  24.47  24.92  23.89
+ 0.17N / 46:  24.47  24.28  24.70  23.85
+list a[x=135w:125w]
+             VARIABLE : TEMP[I=90:110:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              134.5W 132.5W 130.5W 128.5W 126.5W 124.5W 
+                4      5      6      7      8      9
+ 1.5N  / 50:  25.95  25.62  24.86  24.34  24.23  24.82
+ 1.17N / 49:  25.83  25.37  24.60  24.15  24.04  24.53
+ 0.83N / 48:  25.67  25.14  24.37  24.00  23.86  24.25
+ 0.5N  / 47:  25.48  24.92  24.19  23.89  23.73  23.97
+ 0.17N / 46:  25.17  24.70  24.09  23.85  23.66  23.74
+list a[x=135w:125w:3]
+             VARIABLE : TEMP[I=90:110:2]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              135W   132W   129W   126W   
+                1      2      3      4
+ 1.5N  / 50:  25.83  25.43  24.47  24.38
+ 1.17N / 49:  25.67  25.18  24.26  24.17
+ 0.83N / 48:  25.45  24.95  24.09  23.96
+ 0.5N  / 47:  25.23  24.74  23.97  23.79
+ 0.17N / 46:  24.94  24.55  23.91  23.68
+! ... by world coord
+LET/QUIET a = temp[x=130w:120W:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+list a[i=1:4]
+             VARIABLE : TEMP[X=130W:120W:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   127W   124W   121W   
+                1      2      3      4
+ 1.5N  / 50:  24.70  24.23  25.06  25.38
+ 1.17N / 49:  24.47  24.04  24.74  24.99
+ 0.83N / 48:  24.26  23.87  24.41  24.55
+ 0.5N  / 47:  24.11  23.76  24.09  24.18
+ 0.17N / 46:  24.02  23.70  23.83  23.91
+list a[i=1:4:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   124W   
+                1      2
+ 1.5N  / 50:  24.70  25.06
+ 1.17N / 49:  24.47  24.74
+ 0.83N / 48:  24.26  24.41
+ 0.5N  / 47:  24.11  24.09
+ 0.17N / 46:  24.02  23.83
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              130W   124W   
+                1      2
+ 1.5N  / 50:  24.70  25.06
+ 1.17N / 49:  24.47  24.74
+ 0.83N / 48:  24.26  24.41
+ 0.5N  / 47:  24.11  24.09
+ 0.17N / 46:  24.02  23.83
+list a[x=129w:120w:2]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W   127W   125W   123W   121W   
+                1      2      3      4      5
+ 1.5N  / 50:  24.54  24.23  24.78  25.17  25.38
+ 1.17N / 49:  24.33  24.04  24.51  24.82  24.99
+ 0.83N / 48:  24.13  23.87  24.23  24.46  24.55
+ 0.5N  / 47:  23.99  23.76  23.98  24.12  24.18
+ 0.17N / 46:  23.92  23.70  23.79  23.86  23.91
+list a[x=138w:110w:5]
+             VARIABLE : TEMP[X=130W:120W:3]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              138W   133W   128W   123W   118W   113W   
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....  24.39  25.17   ....   ....
+ 1.17N / 49:   ....   ....  24.18  24.82   ....   ....
+ 0.83N / 48:   ....   ....  24.00  24.46   ....   ....
+ 0.5N  / 47:   ....   ....  23.87  24.12   ....   ....
+ 0.17N / 46:   ....   ....  23.81  23.86   ....   ....
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            6 r   138W                 113W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            4 r   130W                 121W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX002)                         use count:   1
+    AXIS (AX005)                         use count:   1
+ 
+! irregular dynamic axis
+! ... by subscript
+LET/QUIET a = temp[j=45:65:3]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[j=1:6]
+             VARIABLE : TEMP[J=45:65:3]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 4.8N / 6:  26.37  26.19  26.03  25.93  25.99
+ 3.8N / 5:  26.00  25.68  25.32  25.06  25.09
+ 2.8N / 4:  25.51  25.10  24.82  24.76  24.94
+ 1.8N / 3:  24.77  24.52  24.40  24.40  24.62
+ 0.8N / 2:  24.16  24.00  23.89  23.86  23.98
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[j=1:6:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 3.8N / 3:  26.00  25.68  25.32  25.06  25.09
+ 1.8N / 2:  24.77  24.52  24.40  24.40  24.62
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[j=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 4 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 5.8N / 4:  26.63  26.57  26.54  26.56  26.66
+ 3.8N / 3:  26.00  25.68  25.32  25.06  25.09
+ 1.8N / 2:  24.77  24.52  24.40  24.40  24.62
+ 0.2S / 1:  23.98  23.88  23.78  23.69  23.62
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[J=45:65:3]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 7N   / 5:   ....   ....   ....   ....   ....
+ 5N   / 4:  26.41  26.25  26.11  26.03  26.10
+ 3N   / 3:  25.59  25.20  24.91  24.81  24.96
+ 1N   / 2:  24.26  24.09  23.97  23.95  24.08
+ 1S   / 1:   ....   ....   ....   ....   ....
+! ... by world coord
+LET/QUIET a = temp[y=3.5s:5n:1.5]
+list a[j=1:6:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 0.5S / 2:  24.07  23.99  23.89  23.79  23.70
+ 3.5S / 1:  25.19  25.15  25.09  25.04  25.03
+list a[j=-2:8:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 3 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 3 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 2.5N / 3:  25.27  24.90  24.69  24.66  24.88
+ 0.5S / 2:  24.07  23.99  23.89  23.79  23.70
+ 3.5S / 1:  25.19  25.15  25.09  25.04  25.03
+list a[y=1S:8N:2]
+             VARIABLE : TEMP[Y=3.5S:5N:1.5]
+                        regrid: 2 deg on Y
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+            129.5W 128.5W 127.5W 126.5W 125.5W 
+            101    102    103    104    105
+ 7N   / 5:   ....   ....   ....   ....   ....
+ 5N   / 4:   ....   ....   ....   ....   ....
+ 3N   / 3:  25.54  25.19  24.94  24.83  24.98
+ 1N   / 2:  24.25  24.08  23.97  23.95  24.09
+ 1S   / 1:  24.28  24.22  24.14  24.07  23.98
+ 
+! modulo (regular) dynamic axis
+set axis/modulo psxt
+! ... by subscript
+list temp[i=155:170:2]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W  63.5W  61.5W 
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40  29.41  29.51
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42  29.45  29.53
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47  29.49  29.55
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53  29.54  29.59
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60  29.59  29.62
+! ... by world coord
+list temp[x=90w:60W:4]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W    66W    62W   
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....  29.35  29.49
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....  29.39  29.51
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....  29.46  29.54
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....  29.55  29.57
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....  29.63  29.61
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ (AX003)   LATITUDE             6 r   3.5S                 4N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   1
+    AXIS (AX003)                         use count:   1
+ 
+! nested modulo (the dynamic axis is **NOT** modulo)
+! ... by subscript
+LET/QUIET a temp[i=155:170:2]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+list a[i=1:6]
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60
+list a[i=1:6:2]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  71.5W  67.5W 
+                1      2      3
+ 1.5N  / 50:   ....   ....  29.50
+ 1.17N / 49:   ....   ....  29.54
+ 0.83N / 48:   ....   ....  29.60
+ 0.5N  / 47:   ....   ....  29.68
+ 0.17N / 46:   ....   ....  29.79
+list a[i=-2:8:2]		! clips to allowed limits
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 4 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  71.5W  67.5W  63.5W 
+                1      2      3      4
+ 1.5N  / 50:   ....   ....  29.50  29.41
+ 1.17N / 49:   ....   ....  29.54  29.45
+ 0.83N / 48:   ....   ....  29.60  29.49
+ 0.5N  / 47:   ....   ....  29.68  29.54
+ 0.17N / 46:   ....   ....  29.79  29.59
+list a[x=75w:65w]		! limits ignored --> behavior could be improved
+             VARIABLE : TEMP[I=155:170:2]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               75.5W  73.5W  71.5W  69.5W  67.5W  65.5W 
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....   ....   ....   ....  29.50  29.40
+ 1.17N / 49:   ....   ....   ....   ....  29.54  29.42
+ 0.83N / 48:   ....   ....   ....   ....  29.60  29.47
+ 0.5N  / 47:   ....   ....   ....   ....  29.68  29.53
+ 0.17N / 46:   ....   ....   ....   ....  29.79  29.60
+list a[x=85w:45w:5]
+             VARIABLE : TEMP[I=155:170:2]
+                        regrid: 5 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               85W    80W    75W    70W    65W    60W    55W    50W    45W   
+                1      2      3      4      5      6      7      8      9
+ 1.5N  / 50:   ....   ....   ....   ....  29.40   ....   ....   ....   ....
+ 1.17N / 49:   ....   ....   ....   ....  29.43   ....   ....   ....   ....
+ 0.83N / 48:   ....   ....   ....   ....  29.47   ....   ....   ....   ....
+ 0.5N  / 47:   ....   ....   ....   ....  29.53   ....   ....   ....   ....
+ 0.17N / 46:   ....   ....   ....   ....  29.59   ....   ....   ....   ....
+! ... by world coord
+LET/QUIET a = temp[x=90w:60W:4]
+! changes on 11/29 in CONFINE_AXIS this no longer an error ... a bit mysterious
+! changes on 4/98 in CONFINE_AXIS this is once again an error
+! Changes 5/2007 in GET_VAR_CONTEXT this is no longer an error (acm) !
+set mode ignore; list a; cancel mode ignore	! SET REGION mis-applied
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 8 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W    66W    62W   
+                1      2      3      4      5      6      7      8
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....  29.35  29.49
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....  29.39  29.51
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....  29.46  29.54
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....  29.55  29.57
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....  29.63  29.61
+list a[i=1:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    86W    82W    78W    74W    70W   
+                1      2      3      4      5      6
+ 1.5N  / 50:  27.22  27.56  27.95   ....   ....   ....
+ 1.17N / 49:  27.11  27.41  27.89   ....   ....   ....
+ 0.83N / 48:  26.96  27.25  27.76   ....   ....   ....
+ 0.5N  / 47:  26.78  27.09  27.56   ....   ....   ....
+ 0.17N / 46:  26.54  26.90  27.28   ....   ....   ....
+list a[i=1:6:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 3 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    82W    74W   
+                1      2      3
+ 1.5N  / 50:  27.22  27.95   ....
+ 1.17N / 49:  27.11  27.89   ....
+ 0.83N / 48:  26.96  27.76   ....
+ 0.5N  / 47:  26.78  27.56   ....
+ 0.17N / 46:  26.54  27.28   ....
+list a[i=-2:8:2]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 8 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 4 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               90W    82W    74W    66W   
+                1      2      3      4
+ 1.5N  / 50:  27.22  27.95   ....  29.35
+ 1.17N / 49:  27.11  27.89   ....  29.39
+ 0.83N / 48:  26.96  27.76   ....  29.46
+ 0.5N  / 47:  26.78  27.56   ....  29.55
+ 0.17N / 46:  26.54  27.28   ....  29.63
+list a[x=129w:120w:2]		! no overlap
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 2 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              129W127W125W123W121W
+               1   2   3   4   5
+ 1.5N  / 50:....................
+ 1.17N / 49:....................
+ 0.83N / 48:....................
+ 0.5N  / 47:....................
+ 0.17N / 46:....................
+list a[x=92w:75w:3]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 3 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+               92W    89W    86W    83W    80W    77W   
+                1      2      3      4      5      6
+ 1.5N  / 50:   ....  27.30  27.56  27.85   ....   ....
+ 1.17N / 49:   ....  27.19  27.41  27.77   ....   ....
+ 0.83N / 48:   ....  27.04  27.25  27.64   ....   ....
+ 0.5N  / 47:   ....  26.85  27.09  27.44   ....   ....
+ 0.17N / 46:   ....  26.63  26.90  27.18   ....   ....
+list a[x=101w:50w:6]
+             VARIABLE : TEMP[X=90W:60W:4]
+                        regrid: 6 deg on X
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 9 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 14:00
+              101W    95W    89W    83W    77W    71W    65W    59W    53W   
+                1      2      3      4      5      6      7      8      9
+ 1.5N  / 50:   ....   ....  27.30  27.85   ....   ....  29.39   ....   ....
+ 1.17N / 49:   ....   ....  27.19  27.77   ....   ....  29.42   ....   ....
+ 0.83N / 48:   ....   ....  27.04  27.64   ....   ....  29.48   ....   ....
+ 0.5N  / 47:   ....   ....  26.85  27.44   ....   ....  29.55   ....   ....
+ 0.17N / 46:   ....   ....  26.63  27.18   ....   ....  29.62   ....   ....
+cancel axis/modulo psxt
+show grid/dyn
+Dynamic grids:
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX003)   LONGITUDE            9 r   101W                 53W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ (AX002)   LONGITUDE            8 r   90W                  62W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME2     TIME                 5mr   15-JAN-1982 14:00    27-JAN-1982 18:00
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX003)                         use count:   1
+    AXIS (AX002)                         use count:   1
+ 
+! calendar axes
+list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]   ! 6-day ave
+ !-> list/k=1/y=0/x=180 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]   ! 6-day ave
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             DEPTH (m): 5
+                      179.5E 
+                       50
+ 15-JAN-1982 00 / 1:  27.85
+ 21-JAN-1982 00 / 2:  27.85
+ 27-JAN-1982 00 / 3:  27.77
+ 02-FEB-1982 00 / 4:  27.90
+ 08-FEB-1982 00 / 5:  27.80
+! ... note that the "explicit limits" changes to Ferret V4.20 mean that
+! ... an explicit L=1 qualifying the command **WILL** apply
+list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:`24*6`@ave]
+ !-> list/k=1/y=0/x=180/l=1 temp[t=15-JAN-1982:11-FEB-1982:144 at ave]
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: 144 hour on T at AVE
+             FILENAME : gtsa056_1.cdf
+             LONGITUDE: 179.5E
+             LATITUDE : 0.2S
+             DEPTH (m): 5
+             TIME     : 15-JAN-1982 00:00
+          27.85
+list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:`24*2`]			! pseudo-var
+ !-> list/l=1:3 T[t=15-JAN-1982:11-FEB-1982:48]			! pseudo-var
+             VARIABLE : T
+                        axis (AX001)
+             SUBSET   : 3 points (TIME)
+ 15-JAN-1982 00 / 1:  723925.
+ 17-JAN-1982 00 / 2:  723927.
+ 19-JAN-1982 00 / 3:  723929.
+ 
+cancel var/all
+show grid/dyn
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    no implicit axes
+set axis/modulo psxt
+ 
+set mode/last diag
+*** Running test: bn_cdf.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! requires version 3.20 or later
+! updated from version 2.3 1/26/95
+!      added reverse-axis tests 3/2/95
+! V5 *sh* 7/99 -- added /clobber
+ 
+! test many simultaneous netCDF files
+GO bn_cdf.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/append/l=1:500/file=test0a.cdf l
+list/format=cdf/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 500
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/append/file=test_abs.cdf ijk
+list/format=cdf/append/file=test_abs.cdf ikl
+list/format=cdf/append/file=test_abs.cdf ijl
+list/format=cdf/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/append/file=test_abs.cdf iavejkl
+list/format=cdf/append/file=test_abs.cdf ijavekl
+list/format=cdf/append/file=test_abs.cdf ijkavel
+list/format=cdf/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+ 
+cancel data/all
+! deliberate errors
+set mode ignore
+list/format=cdf/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX1_10   X                   10 r   1                    10
+ YAX1_20   Y                   20 r   1                    20
+ ZAX1_100  Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G002_NXT with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/append/file=test_fil.cdf j1
+list/format=cdf/append/file=test_fil.cdf k1
+list/format=cdf/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/append/file=test_fil.cdf ij
+list/format=cdf/append/file=test_fil.cdf ik
+list/format=cdf/append/file=test_fil.cdf il
+list/format=cdf/append/file=test_fil.cdf jk
+ 
+!3D
+list/format=cdf/append/file=test_fil.cdf ijk
+list/format=cdf/append/file=test_fil.cdf ikl
+list/format=cdf/append/file=test_fil.cdf ijl
+list/format=cdf/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/append/file=test_fil.cdf iavejkl
+list/format=cdf/append/file=test_fil.cdf ijavekl
+list/format=cdf/append/file=test_fil.cdf ijkavel
+list/format=cdf/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                     1:3       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ10 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                     1:3       ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid GLZ11 with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                     1:3       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ12 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GLZ13 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                                1:4       1:100     1:27      1:3       ...       ...
+               on grid GLZ14 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GLZ15 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                     1:4       ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid GLZ16 with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                     1:4       1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid GLZ17 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                     1:4       1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ18 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GLZ14
+ name       axis              # pts   start                end
+ PSXU69_72 LONGITUDE            4mr   161W                 158W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil
+GO bn_cdf_reversed.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+       FCN_NOR  FCN_REV
+J /  1:  0.6332 -0.6332
+J /  2:  0.6455 -0.6455
+J /  3:  0.4997 -0.4997
+J /  4:  0.2316 -0.2316
+J /  5: -0.0932  0.0932
+J /  6: -0.3952  0.3952
+J /  7: -0.6004  0.6004
+J /  8: -0.6587  0.6587
+J /  9: -0.5556  0.5556
+J / 10: -0.3166  0.3166
+J / 11:  0.0000  0.0000
+J / 12:  0.3166 -0.3166
+J / 13:  0.5556 -0.5556
+J / 14:  0.6587 -0.6587
+J / 15:  0.6004 -0.6004
+J / 16:  0.3952 -0.3952
+J / 17:  0.0932 -0.0932
+J / 18: -0.2316  0.2316
+J / 19: -0.4997  0.4997
+J / 20: -0.6455  0.6455
+J / 21: -0.6332  0.6332
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+              180E   
+               51
+ 8N   / 19:  0.4997
+ 7N   / 18:  0.2316
+ 6N   / 17: -0.0932
+ 5N   / 16: -0.3952
+ 4N   / 15: -0.6004
+ 3N   / 14: -0.6587
+ 2N   / 13: -0.5556
+ 1N   / 12: -0.3166
+ 0    / 11:  0.0000
+ 1S   / 10:  0.3166
+*** Running test: bn_regrid_transforms.jnl
+! bn500_regrid_transforms
+! benchmark to test regridding transformations and syntax
+! requires version 2.30 or later
+! 8/92
+ 
+! 9/95 - modified reflecting the new interpretation of var[GX=u]
+!	 previously this meant to fully regrid to U
+! 	 Now it means to regrid only the X axis to U (other axes as in "var")
+!	 ==> this is an implicit grid creation
+! 2/99 *sh* - The behavior of regridding in cases where the region is
+!	unspecified has been changed in V.5 of Ferret. The behavior is now to
+!	attempt to obtain the full destination axis span. This means that
+!	an unspecified region regrid request applied to a sliced TMAP data
+!	set will error: Requested data range is outside of data set limits
+!	A "SET MODE IGNORE" has been added in this benchmark script fo rthese
+!	cases. (The proper fix to this is in tm_read ... to trim the region
+!	when a sliced data set is being read.
+! 1/00 *sh* @MIN and @MAX bugs corrected. @AVE, @SUM, @VAR to handle partial
+!       grid boxes
+ 
+!set data gtsa056
+!use gtsa056
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5day
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+! deliberate errors
+set mode ignore
+load temp[g=@lin]    ! no target grid specified
+ dealloc  dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ reading TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=@ave]   ! no target grid specified
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,g=w]   ! more than 1 target grid
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+load temp[g=x]       ! g=user-or-pseudo-var not allowed
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+set mode/last ignore
+ 
+! valid syntax tests
+load temp
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ reading TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u at lin,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  6 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[g=u,gx=@ave,gy=@asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  5 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+load temp[gx=u]  		! changed V4.20 --> implicit regrid
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> (G009)           @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+stat temp[g=u] - temp[g=u at ave,gx=u at lin,gy=u at lin,gz=u at lin,gt=u at lin]  ! == 0
+ dealloc  dynamic grid (G009)          PSXU      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ -DELETE TEMP     M:  4 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+             TEMP[G=U] - TEMP[G=U at AVE,GX=U at LIN,GY=U at LIN,GZ=U at LIN,GT=U at LIN]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+stat temp[g=u,gx=@ave] - temp[gx=@ave,g=u]    ! == 0
+ -DELETE EX#1     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  4 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ 
+             TEMP[G=U,GX=@AVE] - TEMP[GX=@AVE,G=U]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 0 to 15
+             TIME: 21-JAN-1982 00:00 to 24-JAN-1982 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gtsa056_1.cdf
+ 
+ Total # of data points: 120 (6*5*2*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+! basic regrid tests
+LIST temp[g=u at ave]
+ -DELETE EX#1     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AAV, on Y at AAV
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gx=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  7 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at AVE, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gy=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  9 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gz=u at ave]	! V4.20 mod
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gt=u at ave]	! V4.20 mod, etc --> many more similar syntax chgs
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+ 
+LIST temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.17  24.19  24.33  24.69  25.14
+ 1N    / 48:  24.06  24.02  24.01  24.10  24.39  24.79
+ 0.67N / 47:  23.97  23.93  23.90  23.91  24.09  24.43
+ 0.33N / 46:  23.95  23.89  23.84  23.79  23.86  24.10
+ 0     / 45:  24.03  23.95  23.86  23.77  23.74  23.87
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.94  23.91  23.92  24.07  24.44  24.94
+ 1N    / 48:  23.74  23.69  23.69  23.79  24.10  24.54
+ 0.67N / 47:  23.59  23.54  23.52  23.55  23.75  24.13
+ 0.33N / 46:  23.52  23.47  23.42  23.37  23.46  23.73
+ 0     / 45:  23.61  23.53  23.43  23.34  23.30  23.45
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.26  24.41  24.75  25.21  25.50
+ 1N    / 48:  24.06  24.08  24.18  24.45  24.86  25.13
+ 0.67N / 47:  23.98  23.96  24.00  24.16  24.48  24.75
+ 0.33N / 46:  23.96  23.90  23.88  23.93  24.14  24.38
+ 0     / 45:  24.04  23.94  23.85  23.82  23.91  24.09
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.93  23.99  24.14  24.49  25.01  25.36
+ 1N    / 48:  23.73  23.76  23.87  24.15  24.61  24.94
+ 0.67N / 47:  23.60  23.59  23.63  23.81  24.17  24.49
+ 0.33N / 46:  23.54  23.48  23.46  23.52  23.76  24.05
+ 0     / 45:  23.62  23.51  23.42  23.38  23.48  23.69
+LIST temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  2 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 11 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at ASN, on Y at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.29  24.26  24.28  24.45  24.83  25.29
+ 1N    / 48:  24.13  24.10  24.10  24.22  24.54  24.96
+ 0.67N / 47:  24.01  23.97  23.95  24.01  24.24  24.61
+ 0.33N / 46:  23.96  23.91  23.87  23.85  23.98  24.26
+ 0     / 45:  23.99  23.92  23.85  23.78  23.80  23.98
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.05  24.01  24.03  24.20  24.59  25.10
+ 1N    / 48:  23.84  23.80  23.81  23.93  24.27  24.74
+ 0.67N / 47:  23.66  23.62  23.61  23.67  23.92  24.33
+ 0.33N / 46:  23.55  23.50  23.47  23.46  23.60  23.93
+ 0     / 45:  23.57  23.50  23.43  23.36  23.38  23.59
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.29  24.35  24.52  24.89  25.37  25.65
+ 1N    / 48:  24.13  24.17  24.30  24.60  25.04  25.32
+ 0.67N / 47:  24.02  24.02  24.09  24.30  24.67  24.94
+ 0.33N / 46:  23.97  23.93  23.94  24.05  24.31  24.56
+ 0     / 45:  24.00  23.92  23.87  23.88  24.02  24.23
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.04  24.10  24.26  24.65  25.17  25.52
+ 1N    / 48:  23.83  23.88  24.01  24.32  24.81  25.15
+ 0.67N / 47:  23.66  23.68  23.75  23.98  24.39  24.72
+ 0.33N / 46:  23.57  23.54  23.55  23.66  23.97  24.27
+ 0     / 45:  23.58  23.50  23.44  23.45  23.62  23.87
+LIST temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  6 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U on X at LIN, on Y at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.19  24.18  24.26  24.51  24.91  25.28
+ 1N    / 48:  24.04  24.02  24.06  24.24  24.59  24.92
+ 0.67N / 47:  23.95  23.91  23.90  24.00  24.26  24.54
+ 0.33N / 46:  23.92  23.86  23.81  23.83  23.98  24.21
+ 0     / 45:  23.99  23.91  23.82  23.76  23.80  23.96
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.92  23.91  24.00  24.25  24.69  25.11
+ 1N    / 48:  23.71  23.69  23.74  23.95  24.32  24.70
+ 0.67N / 47:  23.56  23.53  23.53  23.65  23.94  24.27
+ 0.33N / 46:  23.50  23.44  23.40  23.41  23.59  23.87
+ 0     / 45:  23.57  23.48  23.39  23.32  23.37  23.56
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.23  24.33  24.58  24.98  25.36  25.50
+ 1N    / 48:  24.07  24.13  24.32  24.65  25.00  25.12
+ 0.67N / 47:  23.97  23.98  24.08  24.32  24.62  24.74
+ 0.33N / 46:  23.93  23.89  23.91  24.04  24.26  24.40
+ 0     / 45:  23.99  23.90  23.84  23.86  24.00  24.12
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.96  24.06  24.32  24.75  25.18  25.37
+ 1N    / 48:  23.75  23.82  24.01  24.38  24.77  24.95
+ 0.67N / 47:  23.59  23.61  23.72  23.99  24.33  24.51
+ 0.33N / 46:  23.51  23.47  23.49  23.64  23.90  24.09
+ 0     / 45:  23.57  23.47  23.40  23.43  23.58  23.74
+LIST temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+LIST temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M:  3 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    3    4  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: U
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:3 T:   21-JAN-1982 16:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ ---- L:4 T:   24-JAN-1982 17:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.43  24.70  25.13  25.51  25.65
+ 1N    / 48:  24.15  24.23  24.45  24.82  25.18  25.31
+ 0.67N / 47:  24.02  24.06  24.20  24.49  24.81  24.93
+ 0.33N / 46:  23.95  23.94  23.99  24.18  24.44  24.57
+ 0     / 45:  23.96  23.89  23.87  23.95  24.13  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.07  24.18  24.45  24.91  25.35  25.53
+ 1N    / 48:  23.85  23.94  24.16  24.56  24.98  25.16
+ 0.67N / 47:  23.67  23.71  23.86  24.18  24.55  24.73
+ 0.33N / 46:  23.55  23.54  23.61  23.81  24.12  24.30
+ 0     / 45:  23.54  23.47  23.45  23.53  23.74  23.92
+ 
+! Z and T axes different
+LIST temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ reading TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AAV, on Y at AAV, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.46  24.80  25.20
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.52  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.01  24.23  24.53
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.21
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.21  24.57  25.01
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.26  24.66
+ 0.67N / 47:  23.67  23.61  23.59  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.44  23.45  23.61  23.88
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.57
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.50  24.78  25.17  25.50  25.60
+ 1N    / 48:  24.18  24.29  24.52  24.86  25.17  25.26
+ 0.67N / 47:  24.04  24.10  24.26  24.53  24.80  24.88
+ 0.33N / 46:  23.96  23.96  24.04  24.22  24.44  24.53
+ 0     / 45:  23.96  23.90  23.90  23.98  24.14  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  24.24  24.54  24.96  25.34  25.48
+ 1N    / 48:  23.89  24.00  24.24  24.62  24.97  25.11
+ 0.67N / 47:  23.69  23.76  23.93  24.24  24.55  24.68
+ 0.33N / 46:  23.56  23.57  23.66  23.87  24.13  24.26
+ 0     / 45:  23.54  23.48  23.48  23.57  23.76  23.89
+LIST temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at AVE, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 12 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 12 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gz=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 16 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.46  24.80  25.20
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.52  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.01  24.23  24.53
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.21
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.21  24.57  25.01
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.26  24.66
+ 0.67N / 47:  23.67  23.61  23.59  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.44  23.45  23.61  23.88
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.57
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.50  24.78  25.17  25.50  25.60
+ 1N    / 48:  24.18  24.29  24.52  24.86  25.17  25.26
+ 0.67N / 47:  24.04  24.10  24.26  24.53  24.80  24.88
+ 0.33N / 46:  23.96  23.96  24.04  24.22  24.44  24.53
+ 0     / 45:  23.96  23.90  23.90  23.98  24.14  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  24.24  24.54  24.96  25.34  25.48
+ 1N    / 48:  23.89  24.00  24.24  24.62  24.97  25.11
+ 0.67N / 47:  23.69  23.76  23.93  24.24  24.55  24.68
+ 0.33N / 46:  23.56  23.57  23.66  23.87  24.13  24.26
+ 0     / 45:  23.54  23.48  23.48  23.57  23.76  23.89
+ 
+LIST temp[g=g5day]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 14 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.33  24.20  24.11  24.11  24.27  24.62
+ 1N    / 48:  24.15  24.05  23.96  23.93  24.03  24.33
+ 0.67N / 47:  24.03  23.94  23.87  23.81  23.83  24.04
+ 0.33N / 46:  23.98  23.90  23.83  23.75  23.71  23.81
+ 0     / 45:  24.03  23.95  23.87  23.77  23.68  23.69
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.10  23.94  23.85  23.85  24.01  24.37
+ 1N    / 48:  23.86  23.73  23.64  23.61  23.73  24.05
+ 0.67N / 47:  23.66  23.56  23.49  23.43  23.47  23.71
+ 0.33N / 46:  23.56  23.47  23.40  23.32  23.28  23.41
+ 0     / 45:  23.61  23.52  23.44  23.34  23.24  23.24
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.20  24.17  24.19  24.33  24.69  25.14
+ 1N    / 48:  24.06  24.02  24.01  24.10  24.39  24.79
+ 0.67N / 47:  23.97  23.93  23.90  23.91  24.09  24.43
+ 0.33N / 46:  23.95  23.89  23.84  23.79  23.86  24.10
+ 0     / 45:  24.03  23.95  23.86  23.77  23.74  23.87
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.94  23.91  23.92  24.07  24.44  24.94
+ 1N    / 48:  23.74  23.69  23.69  23.79  24.10  24.54
+ 0.67N / 47:  23.59  23.54  23.52  23.55  23.75  24.13
+ 0.33N / 46:  23.52  23.47  23.42  23.37  23.46  23.73
+ 0     / 45:  23.61  23.53  23.43  23.34  23.30  23.45
+LIST temp[g=g5day,gx=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 17 dset:   1 I:  100  105  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at ASN, on Y at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.37  24.28  24.24  24.31  24.58  25.00
+ 1N    / 48:  24.19  24.11  24.07  24.11  24.33  24.70
+ 0.67N / 47:  24.06  23.98  23.93  23.93  24.07  24.38
+ 0.33N / 46:  23.98  23.92  23.86  23.81  23.86  24.08
+ 0     / 45:  24.00  23.93  23.85  23.77  23.74  23.85
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.15  24.03  23.99  24.07  24.34  24.78
+ 1N    / 48:  23.92  23.82  23.77  23.82  24.05  24.45
+ 0.67N / 47:  23.71  23.63  23.58  23.59  23.75  24.08
+ 0.33N / 46:  23.59  23.51  23.45  23.41  23.48  23.73
+ 0     / 45:  23.58  23.50  23.42  23.34  23.31  23.45
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.30  24.37  24.56  24.94  25.40  25.66
+ 1N    / 48:  24.14  24.19  24.33  24.65  25.07  25.32
+ 0.67N / 47:  24.02  24.04  24.12  24.34  24.70  24.94
+ 0.33N / 46:  23.97  23.94  23.96  24.08  24.34  24.57
+ 0     / 45:  24.00  23.92  23.87  23.90  24.05  24.24
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.05  24.12  24.30  24.70  25.21  25.53
+ 1N    / 48:  23.84  23.89  24.04  24.37  24.85  25.16
+ 0.67N / 47:  23.67  23.69  23.78  24.02  24.43  24.72
+ 0.33N / 46:  23.57  23.54  23.57  23.70  24.00  24.28
+ 0     / 45:  23.58  23.50  23.45  23.47  23.64  23.88
+LIST temp[g=g5day,gy=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 19 dset:   1 I:  100  106  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.23  24.17  24.18  24.33  24.66  25.04
+ 1N    / 48:  24.07  24.01  24.00  24.10  24.37  24.69
+ 0.67N / 47:  23.97  23.91  23.87  23.90  24.08  24.35
+ 0.33N / 46:  23.93  23.86  23.80  23.77  23.86  24.05
+ 0     / 45:  23.99  23.91  23.82  23.74  23.74  23.85
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.98  23.90  23.92  24.08  24.42  24.84
+ 1N    / 48:  23.76  23.69  23.68  23.79  24.08  24.46
+ 0.67N / 47:  23.59  23.53  23.49  23.54  23.75  24.06
+ 0.33N / 46:  23.51  23.44  23.38  23.35  23.46  23.69
+ 0     / 45:  23.57  23.48  23.39  23.30  23.30  23.43
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.24  24.36  24.62  25.02  25.38  25.49
+ 1N    / 48:  24.08  24.16  24.35  24.69  25.01  25.11
+ 0.67N / 47:  23.98  24.00  24.11  24.36  24.63  24.74
+ 0.33N / 46:  23.93  23.90  23.93  24.06  24.28  24.40
+ 0     / 45:  23.98  23.90  23.84  23.88  24.01  24.13
+ ---- K:2 Z:   15
+ 1.33N / 49:  23.98  24.09  24.36  24.80  25.21  25.37
+ 1N    / 48:  23.76  23.84  24.05  24.42  24.80  24.94
+ 0.67N / 47:  23.60  23.63  23.75  24.03  24.35  24.50
+ 0.33N / 46:  23.51  23.48  23.51  23.67  23.93  24.09
+ 0     / 45:  23.56  23.47  23.41  23.45  23.60  23.75
+LIST temp[g=g5day,gz=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 15 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.32  24.26  24.28  24.45  24.79  25.19
+ 1N    / 48:  24.15  24.09  24.09  24.22  24.51  24.87
+ 0.67N / 47:  24.02  23.96  23.93  24.00  24.22  24.52
+ 0.33N / 46:  23.95  23.89  23.83  23.84  23.97  24.20
+ 0     / 45:  23.96  23.89  23.81  23.76  23.80  23.95
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.09  24.01  24.03  24.20  24.56  25.00
+ 1N    / 48:  23.87  23.80  23.80  23.94  24.25  24.65
+ 0.67N / 47:  23.67  23.61  23.58  23.67  23.92  24.26
+ 0.33N / 46:  23.55  23.48  23.43  23.45  23.60  23.87
+ 0     / 45:  23.54  23.46  23.38  23.33  23.38  23.56
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.34  24.47  24.75  25.17  25.53  25.64
+ 1N    / 48:  24.16  24.26  24.49  24.86  25.19  25.30
+ 0.67N / 47:  24.03  24.08  24.23  24.52  24.82  24.92
+ 0.33N / 46:  23.96  23.95  24.02  24.21  24.46  24.57
+ 0     / 45:  23.96  23.90  23.88  23.97  24.14  24.26
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.08  24.21  24.50  24.96  25.37  25.53
+ 1N    / 48:  23.87  23.97  24.21  24.61  25.00  25.15
+ 0.67N / 47:  23.68  23.73  23.90  24.22  24.57  24.72
+ 0.33N / 46:  23.56  23.55  23.63  23.85  24.14  24.29
+ 0     / 45:  23.54  23.47  23.46  23.56  23.76  23.92
+LIST temp[g=g5day,gt=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:  8 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 20 dset:   1 I:  100  105  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 19 dset:   1 I:  100  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on X at LIN, on Y at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 6 by 5 by 2 by 2 points (LONGITUDE-LATITUDE-DEPTH (m)-TIME)
+              130W   129W   128W   127W   126W   125W   
+              100    101    102    103    104    105
+ ---- L:2 T:   20-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.36  24.25  24.20  24.29  24.57  24.98
+ 1N    / 48:  24.18  24.08  24.03  24.09  24.31  24.67
+ 0.67N / 47:  24.04  23.96  23.89  23.90  24.06  24.35
+ 0.33N / 46:  23.96  23.89  23.81  23.77  23.85  24.06
+ 0     / 45:  23.97  23.89  23.80  23.73  23.72  23.84
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.14  24.01  23.96  24.05  24.33  24.77
+ 1N    / 48:  23.91  23.79  23.74  23.80  24.04  24.43
+ 0.67N / 47:  23.70  23.60  23.54  23.56  23.74  24.07
+ 0.33N / 46:  23.56  23.48  23.41  23.38  23.47  23.71
+ 0     / 45:  23.54  23.46  23.38  23.30  23.29  23.44
+ ---- L:3 T:   25-JAN-1982 00:00
+ ---- K:1 Z:   5
+ 1.33N / 49:  24.28  24.27  24.36  24.64  25.06  25.44
+ 1N    / 48:  24.11  24.10  24.16  24.38  24.75  25.10
+ 0.67N / 47:  23.99  23.96  23.98  24.12  24.42  24.73
+ 0.33N / 46:  23.93  23.89  23.86  23.91  24.12  24.37
+ 0     / 45:  23.96  23.89  23.82  23.79  23.89  24.08
+ ---- K:2 Z:   15
+ 1.33N / 49:  24.03  24.02  24.11  24.39  24.85  25.28
+ 1N    / 48:  23.82  23.80  23.87  24.10  24.50  24.91
+ 0.67N / 47:  23.64  23.61  23.64  23.80  24.13  24.49
+ 0.33N / 46:  23.53  23.49  23.46  23.53  23.77  24.07
+ 0     / 45:  23.53  23.46  23.39  23.37  23.48  23.71
+ 
+! all 4 axes different
+LIST temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AAV, on Y at AAV, on Z at AVE, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.97  24.15  24.37  24.63
+ 25-JAN-1982 00 / 3:  23.89  23.98  24.17  24.40  24.65
+LIST temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 22 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 22 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at AVE, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.98  24.15  24.38  24.63
+ 25-JAN-1982 00 / 3:  23.88  23.97  24.15  24.39  24.64
+LIST temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at AVE, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.85  24.02  24.21
+LIST temp[g=g5_10,gz=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 21 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at AVE, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.85  24.02  24.21
+LIST temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 25 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 24 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 24 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 25 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at AVE
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.75  23.85  24.01  24.21
+ 25-JAN-1982 00 / 3:  23.75  23.76  23.87  24.03  24.23
+ 
+LIST temp[g=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 25 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 27 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 26 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at ASN, on Z at ASN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  29.59  29.58  29.58  29.57  29.56
+ 25-JAN-1982 00 / 3:  29.58  29.57  29.57  29.55  29.54
+LIST temp[g=g5_10,gx=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 26 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:   12   12  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 29 dset:   1 I:   12   12  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 29 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at ASN, on Y at LIN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  29.57  29.57  29.55  29.53  29.53
+ 25-JAN-1982 00 / 3:  29.56  29.55  29.54  29.51  29.51
+LIST temp[g=g5_10,gy=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 30 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 30 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at ASN, on Z at LIN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.78  23.72  23.78  23.91  24.10
+ 25-JAN-1982 00 / 3:  23.77  23.72  23.79  23.92  24.11
+LIST temp[g=g5_10,gz=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 28 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 28 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 28 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at ASN, on T at LIN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.96  23.95  24.02  24.15  24.32
+ 25-JAN-1982 00 / 3:  23.96  23.96  24.03  24.16  24.34
+LIST temp[g=g5_10,gt=g5_10 at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 19 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 32 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 31 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 31 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 32 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10 on X at LIN, on Y at LIN, on Z at LIN, on T at ASN
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.76  23.87  24.04  24.25
+ 25-JAN-1982 00 / 3:  23.74  23.73  23.82  23.97  24.15
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/l=1:3  ! x,y,z unspecified
+load temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ reading TEMP     M: 32 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 32 dset:   1 I:    1  160  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 34 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u at lin]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 33 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @AAV
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ found   TEMP     M: 35 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid XY
+ regrid  TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @AVE
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 39 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 41 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 40 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 40 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 43 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+load temp[g=u,gx=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 45 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+load temp[g=u,gy=u at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  160  J:    1  100  K:    1   27  L:    1    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU2           @LIN
+ strip modulo-void-filling TEMP on X axis:     1   161 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 42 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing modulo-void-filling TEMP on X axis:     1   160 dset:   1
+ regrid  TEMP     M: 47 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 46 dset:   1 I:    1  161  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ 
+canc reg
+use gtsa056_2		!kob 4/99
+set reg/i=101:105/j=41:42  ! z,t unspecified
+load temp[g=u]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 48 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ 
+load temp[g=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 49 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 50 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 51 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ 
+load temp[g=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 53 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+load temp[g=u,gz=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 52 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+load temp[g=u,gt=u at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:  101  105  J:   41   42  K:    1   27  L:    1  168  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M: 46 dset:   2 I:  101  106  J:   41   43  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 54 dset:   2 I:  101  105  J:   41   42  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! X axis
+use gtsa056_1 		!kob 4/99
+set region/x=130E:90W/y=0/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    1  140  J:   45   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M: 60 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 61 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 62 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 61 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip moduloing TEMP on X axis:     0   141 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M: 65 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 66 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 67 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   141 dset:   1
+ regrid XY
+ regrid  TEMP     M: 68 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 66 dset:   1 I:    0  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 4    complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 65 dset:   1 I:    1  141  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 74 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 75 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 74 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 79 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 80 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid XY
+ regrid  TEMP     M: 81 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 79 dset:   1 I:    0  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 8    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 88 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 87 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 88 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 9    complete
+plot/over temp[g=u,gx=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ found   TEMP     M: 41 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 10   complete
+plot/over temp[g=g5day,gx=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    0  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on X axis:     0   140 dset:   1
+ strip regrid on X: TEMP --> G5DAY            @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 94 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 95 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 94 dset:   1 I:    1  141  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 94 dset:   1 I:    1  140  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 95 dset:   1 I:    1  141  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   140 dset:   1
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 11   complete
+plot/over temp[g=g5_10,gx=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AVE
+ strip moduloing TEMP on X axis:     0   146 dset:   1
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 98 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 99 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 98 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 98 dset:   1 I:    1  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 99 dset:   1 I:    1  146  J:   44   46  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on X axis:     1   146 dset:   1
+ regrid  TEMP     M:100 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 99 dset:   1 I:    0  146  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 12   complete
+plot/over temp[g=g5_10 at asn]   ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 78 dset:   1 I:    1  146  J:   44   46  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:104 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:103 dset:   1 I:    2   16  J:   44   45  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 13   complete
+ 
+! Y axis
+set region/x=180/y=20s:20n/z=5/t=21-JAN-1982
+plot temp
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 14   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 36 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 15   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ reading TEMP     M:110 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:111 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:112 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:111 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 16   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ reading TEMP     M:113 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:114 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:115 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:114 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:114 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:115 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 17   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 38 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 18   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:113 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:118 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:119 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:118 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 19   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:121 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:122 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:121 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:121 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:122 dset:   1 I:   45   56  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 20   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ found   TEMP     M: 44 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 21   complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on T: TEMP --> YNTERMED         @ASN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:126 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:125 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:126 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 22   complete
+plot/over temp[g=u,gy=u at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ found   TEMP     M: 43 dset:   1 I:    1  160  J:    1  100  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 23   complete
+plot/over temp[g=g5day,gy=g5day at ave]
+ dealloc  dynamic grid PS3DU2          PSXU      PSYU      PSZT      TIME2     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ eval    EX#1     C:  5 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> YNTERMED         @LIN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:128 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:129 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:128 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:128 dset:   1 I:   50   50  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:129 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 24   complete
+plot/over temp[g=g5_10,gy=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Y: TEMP --> XNTERMED         @AVE
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:120 dset:   1 I:   45   56  J:    5   89  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:130 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:130 dset:   1 I:   50   51  J:    5   89  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:130 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:131 dset:   1 I:   50   51  J:    5   89  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:131 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:130 dset:   1 I:   50   51  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 25   complete
+plot/over temp[g=g5_10 at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Z=5 at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M: 37 dset:   1 I:    1  161  J:    5   89  K:    1    2  L:    1    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:134 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:133 dset:   1 I:    7    7  J:    5   88  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ doing --> TEMP[Z=5 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 26   complete
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:136 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ strip --> EX#1[X=180E at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M:137 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ doing --> TEMP[X=180E at ITP,D=2]
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 27   complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:140 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:141 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ reading TEMP     M:143 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:144 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 28   complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:146 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:148 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:149 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:148 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 29   complete
+plot/over temp[g=g5_10]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:150 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:152 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:153 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:152 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:152 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:153 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 30   complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:151 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:155 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:150 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:157 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 31   complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:151 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:159 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:160 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:159 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 32   complete
+plot/over temp[g=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M:161 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M:163 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:164 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:163 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:163 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:164 dset:   2 I:   45   56  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 33   complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:166 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:167 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:166 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:161 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:168 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:169 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:168 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 34   complete
+plot/over temp[g=g5_10 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M:170 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:172 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:171 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 35   complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ found   TEMP     M:142 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 36   complete
+plot/over temp[g=g5day,gt=g5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:175 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:176 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:175 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 37   complete
+plot/over temp[g=g5_10,gt=g5_10 at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Z=5 at ITP,D=2]
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  6 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10            @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:177 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:178 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:177 dset:   2 I:   50   51  J:   44   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:177 dset:   2 I:    7    7  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:178 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+ doing --> TEMP[Z=5 at ITP,D=2]
+setting up plot
+PPL plot 38   complete
+plot/over temp[g=g5day,gt=g5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10           XAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[Y=0 at ITP,D=2]
+ eval    EX#1     C:  5 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAY            @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M:162 dset:   2 I:   45   56  J:   44   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:180 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:181 dset:   2 I:   50   50  J:   44   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:180 dset:   2 I:   50   51  J:   44   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ doing --> TEMP[Y=0 at ITP,D=2]
+setting up plot
+PPL plot 39   complete
+ 
+set mode/last interp
+cancel region
+ 
+! 1/00 additions to check details of @AVE bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+ 
+! test 1D regrid
+let a1 = x[gx=x1pt]	! single point
+let a2 = x[gx=x2pt]
+ 
+list a1[gx=xoffset at ave]
+ dealloc  dynamic grid G5DAY           PSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @AVE
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  5.000
+ 5.1 / 5:  5.000
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a1[gx=xoffset at sum] ! should sum to 5
+ -DELETE X        M:182 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @SUM
+ found   A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  0.500
+ 5.1 / 5:  4.500
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a1[gx=xoffset at var] ! should be all missing
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @VAR
+ found   A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:....
+ 2.1 / 2:....
+ 3.1 / 3:....
+ 4.1 / 4:....
+ 5.1 / 5:....
+ 6.1 / 6:....
+ 7.1 / 7:....
+ 
+list a2[gx=xoffset at ave]
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @AVE
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:184 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at AVE
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  5.000
+ 5.1 / 5:  5.100
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a2[gx=xoffset at sum] ! should sum to 5+6=11
+ -DELETE X        M:184 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @SUM
+ found   A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:  0.500
+ 5.1 / 5:  5.100
+ 6.1 / 6:  5.400
+ 7.1 / 7:   ....
+list a2[gx=xoffset at var]
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @VAR
+ found   A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]
+                        regrid: 1 delta on X at VAR
+             SUBSET   : 7 points (X)
+ 1.1 / 1:     ....
+ 2.1 / 2:     ....
+ 3.1 / 3:     ....
+ 4.1 / 4:     ....
+ 5.1 / 5:  0.09000
+ 6.1 / 6:     ....
+ 7.1 / 7:     ....
+ 
+! test 2D regrid
+define axis/y=1.1:7.1:1 yoffset
+define axis/y=5/npoints=1 y1pt
+define axis/y=5:6:1 y2pt
+ 
+let a1 = x[gx=x1pt]+y[gy=y1pt]
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]+y[gy=y2pt]
+ 
+list a1[gx=xoffset at ave, gy=yoffset at ave]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @AVE
+ strip regrid on Y: A1 --> XNTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:182 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:182 dset:   0 I: -999 -999  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          NORMAL    Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:183 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  10.00  10.00   ....   ....
+ 5.1 / 5:   ....   ....   ....  10.00  10.00   ....   ....
+ 6.1 / 6:   ....   ....   ....   ....   ....   ....   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a1[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @SUM
+ strip regrid on Y: A1 --> XNTERMED         @SUM
+ found   A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:182 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  0.100  0.900   ....   ....
+ 5.1 / 5:   ....   ....   ....  0.900  8.100   ....   ....
+ 6.1 / 6:   ....   ....   ....   ....   ....   ....   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a1[gx=xoffset at var, gy=yoffset at var] ! should be all missing
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @VAR
+ strip regrid on Y: A1 --> XNTERMED         @VAR
+ found   A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A1       M:183 dset:   0 I:    1    1  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X1PT]+Y[GY=Y1PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+           1.1 2.1 3.1 4.1 5.1 6.1 7.1 
+            1   2   3   4   5   6   7
+ 1.1 / 1:............................
+ 2.1 / 2:............................
+ 3.1 / 3:............................
+ 4.1 / 4:............................
+ 5.1 / 5:............................
+ 6.1 / 6:............................
+ 7.1 / 7:............................
+ 
+list a2[gx=xoffset at ave, gy=yoffset at ave]
+ dealloc  dynamic grid (G010)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @AVE
+ strip regrid on Y: A2 --> XNTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G013)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  Y        M:183 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE Y        M:183 dset:   0 I: -999 -999  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G013)          NORMAL    Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:182 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at AVE, 1 delta on Y at AVE
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....  10.00  10.10  11.00   ....
+ 5.1 / 5:   ....   ....   ....  10.10  10.20  11.10   ....
+ 6.1 / 6:   ....   ....   ....  11.00  11.10  12.00   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+list a2[gx=xoffset at sum, gy=yoffset at sum] ! should sum to 10+11+11+12=44
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @SUM
+ strip regrid on Y: A2 --> XNTERMED         @SUM
+ found   A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:183 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at SUM, 1 delta on Y at SUM
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1    2.1    3.1    4.1    5.1    6.1    7.1  
+             1      2      3      4      5      6      7
+ 1.1 / 1:   ....   ....   ....   ....   ....   ....   ....
+ 2.1 / 2:   ....   ....   ....   ....   ....   ....   ....
+ 3.1 / 3:   ....   ....   ....   ....   ....   ....   ....
+ 4.1 / 4:   ....   ....   ....   0.10   1.01   0.99   ....
+ 5.1 / 5:   ....   ....   ....   1.01  10.20   9.99   ....
+ 6.1 / 6:   ....   ....   ....   0.99   9.99   9.72   ....
+ 7.1 / 7:   ....   ....   ....   ....   ....   ....   ....
+ ! NOTE: as of V5.1 NO xy_var trans exists.  Need it to be complete ...!
+list a2[gx=xoffset at var, gy=yoffset at var]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:182 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @VAR
+ strip regrid on Y: A2 --> XNTERMED         @VAR
+ found   A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:182 dset:   0 I:    1    2  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : Variance of X[GX=X2PT]+Y[GY=Y2PT]
+                        regrid: 1 delta on X at VAR, 1 delta on Y at VAR
+             SUBSET   : 7 by 7 points (X-Y)
+             1.1     2.1     3.1     4.1     5.1     6.1     7.1   
+              1       2       3       4       5       6       7
+ 1.1 / 1:    ....    ....    ....    ....    ....    ....    ....
+ 2.1 / 2:    ....    ....    ....    ....    ....    ....    ....
+ 3.1 / 3:    ....    ....    ....    ....    ....    ....    ....
+ 4.1 / 4:    ....    ....    ....    ....    ....    ....    ....
+ 5.1 / 5:    ....    ....    ....    ....  0.0000    ....    ....
+ 6.1 / 6:    ....    ....    ....    ....    ....    ....    ....
+ 7.1 / 7:    ....    ....    ....    ....    ....    ....    ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+define axis/x=1.1:7.1:1 xoffset
+define axis/x=5/npoints=1 x1pt
+define axis/x=5:6:1 x2pt
+define axis/x=5:6.5:.5 x4pt
+ 
+let a1 = x[gx=x1pt]
+ dealloc  dynamic grid (G011)          XOFFSET   YOFFSET   NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:183 dset:   0 I:    1    7  J:    1    7  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A2       M:184 dset:   0 I:    1    2  J:    1    2  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      Y2PT      NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:185 dset:   0 I:    1    1  J:    1    1  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      Y1PT      NORMAL    NORMAL    NORMAL    NORMAL
+let a2 = x[gx=x2pt]
+let a4 = x[gx=x4pt]
+ 
+list a1[gx=xoffset at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A1 --> (G010)           @MAX
+ eval    A1       C:  7 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:185 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A1       M:183 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X1PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:   ....
+ 7.1 / 7:   ....
+list a2[gx=xoffset at max]
+ -DELETE X        M:185 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:183 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A2 --> (G011)           @MAX
+ eval    A2       C:  7 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:183 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A2       M:182 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X2PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a4[gx=xoffset at max]
+ -DELETE X        M:183 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:182 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @MAX
+ eval    A4       C:  7 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:182 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.500
+ 6.1 / 6:  6.500
+ 7.1 / 7:   ....
+list a4[gx=xoffset at min]
+ -DELETE X        M:182 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @MIN
+ found   A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at MIN
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:  5.000
+ 6.1 / 6:  6.000
+ 7.1 / 7:   ....
+list a4[gx=xoffset at sum] ! 5+5.5+6+6.5=23
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A4 --> (G012)           @SUM
+ found   A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X4PT]
+                        regrid: 1 delta on X at SUM
+             SUBSET   : 7 points (X)
+ 1.1 / 1:   ....
+ 2.1 / 2:   ....
+ 3.1 / 3:   ....
+ 4.1 / 4:   ....
+ 5.1 / 5:   8.85
+ 6.1 / 6:  12.20
+ 7.1 / 7:   1.95
+ 
+! round-off issues when source points lie on destination cell boundaries
+define axis/x=1:5:1 x5
+define axis/x=0.5:5.5:1 x5_edges
+let a5 = x[gx=x5_edges]
+list a5[gx=x5 at max]   ! note: top dest axis point, only, looks at point above
+ dealloc  dynamic grid (G012)          XOFFSET   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A4       M:186 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G013)           @MAX
+ eval    A5       C:  7 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:186 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:187 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:  0.500
+ 2   / 2:  1.500
+ 3   / 3:  2.500
+ 4   / 4:  3.500
+ 5   / 5:  5.500
+let a5 = x[gx=x5_edges, i=3]
+ dealloc  dynamic grid (G013)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:187 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A5       M:182 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G012)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE X        M:186 dset:   0 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A4       M:183 dset:   0 I:    1    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          X4PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A2       M:185 dset:   0 I:    1    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X2PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A1       M:184 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X1PT      NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+list a5[gx=x5 at max]
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A5       C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ eval    A5       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ pseudo  X        M:184 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G009)          X5_EDGES  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ regrid  A5       M:183 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             SUBSET   : 5 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  2.500
+ 4   / 4:   ....
+ 5   / 5:   ....
+list a5[gx=x5 at max,i=3]
+ -DELETE X        M:184 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ found   A5       M:185 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid  A5       M:183 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 3
+          2.500
+list a5[gx=x5 at max,i=4]
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A5 --> (G010)           @MAX
+ found   A5       M:185 dset:   0 I:    3    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : X[GX=X5_EDGES, I=3]
+                        regrid: 1 delta on X at MAX
+             X        : 4
+        ....
+ 
+! time axes with different encodings
+define axis/t=1-jan-1990:5-jan-1990:1/units=days tday
+define axis/t=1-jan-1990:5-jan-1990:24/units=hours thour
+let atime = T[gt=tday]
+list atime
+ dealloc  dynamic grid (G010)          X5        NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A5       M:183 dset:   0 I:    4    4  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid ATIME    C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ eval    ATIME    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ pseudo  T        M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G010)
+    GRID (G010)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TDAY      TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+list atime[gt=thour at max]
+ -DELETE T        M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G010)          NORMAL    NORMAL    NORMAL    TDAY      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+ strip regrid on T: ATIME --> (G011)           @MAX
+ found   ATIME    M:184 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ regrid  ATIME    M:183 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G011)          NORMAL    NORMAL    NORMAL    THOUR     NORMAL    NORMAL
+             VARIABLE : T[GT=TDAY]
+                        regrid: 24 hour on T at MAX
+             SUBSET   : 5 points (TIME)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G011)
+    GRID (G011)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ THOUR     TIME                 5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ normal    E
+ normal    F
+ 
+set mode/last diag
+ 
+ 
+ 
+ 
+ 
+*** Running test: bn_axis_limits.jnl
+!bn301_axis_limits.jnl
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+set wind/asp=1:ax/size=1 1
+ 
+define view/x=0.00,0.25/y=0.00,0.25 v11
+define view/x=0.25,0.50/y=0.00,0.25 v12
+define view/x=0.50,0.75/y=0.00,0.25 v13
+define view/x=0.75,1.00/y=0.00,0.25 v14
+define view/x=0.00,0.25/y=0.25,0.50 v21
+define view/x=0.25,0.50/y=0.25,0.50 v22
+define view/x=0.50,0.75/y=0.25,0.50 v23
+define view/x=0.75,1.00/y=0.25,0.50 v24
+define view/x=0.00,0.25/y=0.50,0.75 v31
+define view/x=0.25,0.50/y=0.50,0.75 v32
+define view/x=0.50,0.75/y=0.50,0.75 v33
+define view/x=0.75,1.00/y=0.50,0.75 v34
+define view/x=0.00,0.25/y=0.75,1.00 v41
+define view/x=0.25,0.50/y=0.75,1.00 v42
+define view/x=0.50,0.75/y=0.75,1.00 v43
+define view/x=0.75,1.00/y=0.75,1.00 v44
+ 
+* error checks
+set grid abstract
+set region/i=1:5
+set mode ignore_errors
+plot/xlimits i
+plot/xlimits= i
+plot/xlimits=text i
+plot/xlimits=1 i
+plot/xlimits=1: i
+plot/xlimits=1:: i
+plot/xlimits=1:2: i
+plot/xlimits=5:5 i
+set mode/last ignore_errors
+ 
+GO bn_axis_limits.sub1   ! lines
+!bn301_axis_limits.sub1
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise the PLOT command
+ 
+set window/clear
+ 
+* abstract X line plots
+set grid abstract
+set view v11
+plot/x=1:100 sin(x/6)
+set view v12
+plot/x=1:100/xlimits=-100:200 sin(x/6)
+set view v13
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2 sin(x/6)
+set view v14
+plot/x=1:100/xlimits=-100:200:-30/ylimits=-2:2:-0.2/trans sin(x/6)
+ 
+* formatted Y line plots
+set grid gformat
+set view v21
+plot/y=30s:30n/xlimits=50s:40n:-8 sin(y/10)
+set view v22
+plot/y=30s:30n/xlimits=50s:40n:-8/ylimits=0:2:-0.2 sin(y/10)
+ 
+* plot/vs
+set view v23
+set grid abstract
+plot/vs/x=1:100/y=101:200/xlim=1:-1:.1/ylim=-3:0:.5 sin(x/5),cos(y/9)
+set view v24
+set grid gformat
+plot/vs/t=1-jan-1980:1-jan-1990/xlim=1:-1:-.1/ylim=-3:3:-.5 sin(t/100),cos(t/300)
+ 
+* formatted T line plots
+set grid gformat
+set mode calendar
+set view v31
+plot/t=1-jan-1980:1-jan-1990 sin(t/500)
+set view v32
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v33
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5 sin(t/500)
+set view v34
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994:-5/ylimits=-2:0:-0.2 sin(t/500)
+ 
+* unformatted T line plots
+set grid gformat
+cancel mode calendar
+set view v41
+plot/t=1-jan-1980:1-jan-1990/xlimits=1-mar-1977:15-jun-1994 sin(t/500)
+set view v42
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800/ylimits=-2:0:-0.2 sin(t/500)
+set view v43
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2 sin(t/500)
+set view v44
+plot/t=1-jan-1980:1-jan-1990/xlimits=29400:31800:-200/ylimits=-2:0:-0.2/trans sin(t/500)
+GO bn_axis_limits.sub2   ! 2D graphics
+! bn301_axis_limits.sub2
+! exercise the new-V301 /XLIMITS and /YLIMITS qualifiers
+! this file to exercise 2D graphics
+ 
+set window/clear
+ 
+* abstract XY contours
+set grid abstract
+set view v11
+contour/x=1:100/y=101:200/lev=(-1,1,.5) sin(x/6)*cos(y/9)
+set view v12
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200 sin(x/6)*cos(y/9)
+set view v13
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150 sin(x/6)*cos(y/9)
+set view v14
+contour/x=1:100/y=101:200/lev=(-1,1,.5)/xlimits=-100:200:-30/ylimits=250:150/trans sin(x/6)*cos(y/9)
+ 
+* formatted XY contours
+set grid gformat
+set view v21
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5) sin(x/3)*ABS(Y)^1.5
+set view v22
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110W:10 sin(x/3)*ABS(Y)^1.5
+set view v23
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N sin(x/3)*ABS(Y)^1.5
+set view v24
+contour/x=160E:160W/y=15s:25n/lev=(-1,1,.5)/xlimits=140e:110w:-9/ylimits=0:30N/trans sin(x/3)*ABS(Y)^1.5
+ 
+* calendar axis contours involving T
+set grid gformat
+set mode calendar
+set view v31
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v32
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v33
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115:-200 sin(x/3)*sin(t/100)   ! delta ignored
+set view v34
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984/trans sin(x/3)*sin(t/100)
+ 
+* non-calendar axis contours involving T
+set grid gformat
+cancel mode calendar
+set view v41
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1978:1-jan-1984 sin(x/3)*sin(t/100)
+set view v42
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28110:29115 sin(x/3)*sin(t/100)
+set view v43  ! intentionally blank
+contour/x=160E:160W/t=28000:29000/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=1-jan-1975:1-jan-1978 sin(x/3)*sin(t/100)
+set view v44
+contour/x=160E:160W/t=1-jan-1980:1-jan-1982/lev=(-1,1,.25)/xlimits=140e:110w:-9/ylimits=28000:29000:-400/trans sin(x/3)*sin(t/100)
+ 
+*** Running test: bn_movie.jnl
+! bn301_movie.JNL
+! - test on-HDF movie creation by Program FERRET
+! - FERRET ver 3.10 10/93
+ 
+! ===> NOTE:  This may fail with an X error if the movie window is iconified
+ 
+! Dont run this script - fails with hdf5 libraries
+exit/script
+*** Running test: bn_ez_order.jnl
+! bn420_ez_order
+! updated from bn311_ez_order 9/95 - improved testing of /FORMAT=STREAM
+ 
+! create test files
+sp rm -f test_perm*.dat
+list/i=1:10/nohead/form=(f4.0)/file=test_perm10.dat i
+list/i=1:24/nohead/form=(f4.0)/file=test_perm24.dat i
+list/i=1:48/nohead/form=(f4.0)/file=test_perm48.dat i
+list/i=1:48/nohead/form=(10f8.0)/file=test_perm48_10.dat i*1000,i*500,i*200,i*100,i*50,i*20,i*10,i*5,i*2,i
+ 
+! create test axes
+define axis/x=1:2:1 x2
+define axis/x=1:3:1 x3
+define axis/x=1:4:1 x4
+define grid/x=x2/y=x3 g6
+define grid/y=x2/t=x3 g6yt
+define grid/x=x2/y=x3/z=x2 g12
+define grid/x=x2/y=x3/z=x2/t=x2 g24
+ 
+! basic permutations, single variable
+! *** 2D
+file/grid=g6 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/grid=g6/order=yx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/grid=g6yt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/grid=g6yt/order=ty test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/grid=g6yt/order=xtyz test_perm48.dat
+list v1  ! should be just the same as the last
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+ 
+! *** 3D
+file/grid=g12 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+file/grid=g12/order=xzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+file/grid=g12/order=yxz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   4.00
+ 2   / 2:   2.00   5.00
+ 3   / 3:   3.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  10.00
+ 2   / 2:   8.00  11.00
+ 3   / 3:   9.00  12.00
+file/grid=g12/order=yzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   2.00   8.00
+ 3   / 3:   3.00   9.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  10.00
+ 2   / 2:   5.00  11.00
+ 3   / 3:   6.00  12.00
+file/grid=g12/order=zxy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+file/grid=g12/order=zyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   3.00   9.00
+ 3   / 3:   5.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   8.00
+ 2   / 2:   4.00  10.00
+ 3   / 3:   6.00  12.00
+ 
+ 
+! *** 4D  (incomplete - 24 in all)
+file/grid=g24 test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xytz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xzyt test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xtyz test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=xtzy test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   5.00   6.00
+ 2   / 2:  13.00  14.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:  11.00  12.00
+ 3   / 3:  19.00  20.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  23.00  24.00
+file/grid=g24/order=ytzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   2.00  14.00
+ 3   / 3:   3.00  15.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.00  16.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  10.00  22.00
+ 2   / 2:  11.00  23.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=zytx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=tyzx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/grid=g24/order=tzyx test_perm48.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm48.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+ 
+ 
+! basic permutations, 10 variables
+! *** 2D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6/order=yx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=ty test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g6yt/order=xtyz test_perm48_10.dat
+list v10 ! should be just the same as the last
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 points (Y-T)
+             1      2    
+             1      2
+ 1   / 1:  1.000  4.000
+ 2   / 2:  2.000  5.000
+ 3   / 3:  3.000  6.000
+ 
+! *** 3D
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=xzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yxz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   4.00
+ 2   / 2:   2.00   5.00
+ 3   / 3:   3.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  10.00
+ 2   / 2:   8.00  11.00
+ 3   / 3:   9.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=yzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   2.00   8.00
+ 3   / 3:   3.00   9.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  10.00
+ 2   / 2:   5.00  11.00
+ 3   / 3:   6.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zxy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g12/order=zyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   7.00
+ 2   / 2:   3.00   9.00
+ 3   / 3:   5.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00   8.00
+ 2   / 2:   4.00  10.00
+ 3   / 3:   6.00  12.00
+! *** 4D  (incomplete - 24 in all)
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24 test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xytz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xzyt test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtyz test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:  13.00  14.00
+ 2   / 2:  17.00  18.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:  11.00  12.00
+ ---- K:2 Z:   2
+ 1   / 1:  15.00  16.00
+ 2   / 2:  19.00  20.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=xtzy test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  17.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   5.00   6.00
+ 2   / 2:  13.00  14.00
+ 3   / 3:  21.00  22.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00
+ 2   / 2:  11.00  12.00
+ 3   / 3:  19.00  20.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  23.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=ytzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   2.00  14.00
+ 3   / 3:   3.00  15.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   4.00  16.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:  10.00  22.00
+ 2   / 2:  11.00  23.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=zytx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tyzx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   3.00  15.00
+ 3   / 3:   5.00  17.00
+ ---- K:2 Z:   2
+ 1   / 1:   7.00  19.00
+ 2   / 2:   9.00  21.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   4.00  16.00
+ 3   / 3:   6.00  18.00
+ ---- K:2 Z:   2
+ 1   / 1:   8.00  20.00
+ 2   / 2:  10.00  22.00
+ 3   / 3:  12.00  24.00
+file/var="v1,v2,v3,v4,v5,v6,v7,v8,v9,v10"/grid=g24/order=tzyx test_perm48_10.dat
+list v10
+             VARIABLE : V10
+             FILENAME : test_perm48_10.dat
+             SUBSET   : 2 by 3 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+ 
+ 
+! test grids that have more points than the data
+cancel data/all
+file/grid=g12/order=xzy test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 points (X-Y)
+             Z        : 1
+             1      2    
+             1      2
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:1       ...       ...       ...
+ 
+ 
+file/grid=g24/order=xytz test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1.000  2.000
+ 2   / 2:  3.000  4.000
+ 3   / 3:  5.000  6.000
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....   ....
+ 3   / 3:   ....   ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+file/grid=g24/order=xzyt test_perm10.dat
+list v1
+             VARIABLE : V1
+             FILENAME : test_perm10.dat
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   5.00   6.00
+ 3   / 3:   9.00  10.00
+ ---- K:2 Z:   2
+ 1   / 1:   3.00   4.00
+ 2   / 2:   7.00   8.00
+ 3   / 3:   ....   ....
+show data
+     currently SET data sets:
+    1> ./test_perm10.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:2       1:3       1:2       1:1       ...       ...
+ 
+ 
+ 
+ 
+! limited testing of /FORMAT=STREAM
+! note that as of 5/16/94 this is a fragile capability that will blow up
+! NO ==> 1) on attempt to read more data than the file has
+!	("BACKSPACE error" not trapped by ERR= branch)
+! (This behavior was fixed 9/7/95 in ez_read.F)
+! 2) on many attempts to process record length information (contained
+!	at the start and end of each variable length record) as data
+!	(?? illegal floating point value - formats as zero but computes as
+!	something else)
+ 
+! simple test - write a single record of 16 floating point values (encased
+!	in record length information) and read it back as a 2x2x2x2 grid
+ 
+define grid/x=x2/y=x2/z=x2/t=x2 g2222
+ 
+! Unformatted files have a count value before and after which may be four or
+! eight bytes depending on the system (gfortran version), so only verify a
+! list/format=unf can then be read using file/format=unf
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=unf/order=x/i=1:16 i/10
+file/grid=g2222/form=unf/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.100  0.200
+ 2   / 2:  0.300  0.400
+ ---- K:2 Z:   2
+ 1   / 1:  0.500  0.600
+ 2   / 2:  0.700  0.800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.900  1.000
+ 2   / 2:  1.100  1.200
+ ---- K:2 Z:   2
+ 1   / 1:  1.300  1.400
+ 2   / 2:  1.500  1.600
+! /ORDER= applies here, too
+file/grid=g2222/form=unf/order=yzxt/col=16 test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.100  0.500
+ 2   / 2:  0.200  0.600
+ ---- K:2 Z:   2
+ 1   / 1:  0.300  0.700
+ 2   / 2:  0.400  0.800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.900  1.300
+ 2   / 2:  1.000  1.400
+ ---- K:2 Z:   2
+ 1   / 1:  1.100  1.500
+ 2   / 2:  1.200  1.600
+ 
+! 9/95 - also test the **WRITING** of STREAM-formatted files (added 12/28/94)
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=x/i=1:16 i/100
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.0100  0.0200
+ 2   / 2:  0.0300  0.0400
+ ---- K:2 Z:   2
+ 1   / 1:  0.0500  0.0600
+ 2   / 2:  0.0700  0.0800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.0900  0.1000
+ 2   / 2:  0.1100  0.1200
+ ---- K:2 Z:   2
+ 1   / 1:  0.1300  0.1400
+ 2   / 2:  0.1500  0.1600
+! /ORDER= applies here, too
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  0.0100  0.0500
+ 2   / 2:  0.0200  0.0600
+ ---- K:2 Z:   2
+ 1   / 1:  0.0300  0.0700
+ 2   / 2:  0.0400  0.0800
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  0.0900  0.1300
+ 2   / 2:  0.1000  0.1400
+ ---- K:2 Z:   2
+ 1   / 1:  0.1100  0.1500
+ 2   / 2:  0.1200  0.1600
+ 
+! and test /ORDER on the STREAM output listing
+! ... first the default order
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  2357.
+ 2   / 2:  1457.  2457.
+ ---- K:2 Z:   2
+ 1   / 1:  1367.  2367.
+ 2   / 2:  1467.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  2358.
+ 2   / 2:  1458.  2458.
+ ---- K:2 Z:   2
+ 1   / 1:  1368.  2368.
+ 2   / 2:  1468.  2468.
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  1367.
+ 2   / 2:  2357.  2367.
+ ---- K:2 Z:   2
+ 1   / 1:  1457.  1467.
+ 2   / 2:  2457.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  1368.
+ 2   / 2:  2358.  2368.
+ ---- K:2 Z:   2
+ 1   / 1:  1458.  1468.
+ 2   / 2:  2458.  2468.
+! ... then re-order on write and reverse the re-ordering on read
+sp rm -f test_stream.unf
+list/file=test_stream.unf/format=stream/order=yzxt/i=1:2/j=3:4/k=5:6/l=7:8 (((((i*10)+j)*10)+k)*10)+l
+file/grid=g2222/form=stream/order=yzxt test_stream.unf
+list v1
+             VARIABLE : V1
+             FILENAME : test_stream.unf
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:  1357.  2357.
+ 2   / 2:  1457.  2457.
+ ---- K:2 Z:   2
+ 1   / 1:  1367.  2367.
+ 2   / 2:  1467.  2467.
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  1358.  2358.
+ 2   / 2:  1458.  2458.
+ ---- K:2 Z:   2
+ 1   / 1:  1368.  2368.
+ 2   / 2:  1468.  2468.
+ 
+! clean up
+set grid abstract
+CANCEL DATA/ALL
+cancel grid g2222
+cancel grid g24
+cancel grid g12
+cancel grid g6yt
+cancel grid g6
+cancel axis x4
+cancel axis x3
+cancel axis x2
+sp rm -f test_stream.unf
+sp rm -f test_perm10.dat
+sp rm -f test_perm24.dat
+sp rm -f test_perm48.dat
+sp rm -f test_perm48_10.dat
+ 
+*** Running test: bn_user.jnl
+! bn312_user.jnl
+ 
+! test the USER command options
+ 
+! test the SAMPLE command using the polar plotting scripts
+ 
+! Skip for 6D: USER command not implemented
+ 
+! These are the windows that have always been set after bn_user.jn
+set window/size=.5/aspect=.75:ax 1
+set window/size=.5/aspect=.75 2
+ 
+exit/script
+*** Running test: bn_stream.jnl
+! bn420_stream.jnl
+ 
+! jan 96
+! note that although this benchmark was added only in 1/96 the STREAM
+! reading capabilities have been available much longer
+ 
+! read the file stream_data_link.unf as a single 10 by 5 variable
+define axis/x=1:10:1 x10
+define axis/y=1:5:1 y5
+define grid/x=x10/y=y5 g10x5
+file/var=myvar/grid=g10x5/format=stream stream_data_link.unf
+list myvar
+             VARIABLE : MYVAR
+             FILENAME : stream_data_link.unf
+             SUBSET   : 10 by 5 points (X-Y)
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:   1.00   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:  11.00  12.00  13.00  14.00  15.00  16.00  17.00  18.00  19.00  20.00
+ 3   / 3:  21.00  22.00  23.00  24.00  25.00  26.00  27.00  28.00  29.00  30.00
+ 4   / 4:  31.00  32.00  33.00  34.00  35.00  36.00  37.00  38.00  39.00  40.00
+ 5   / 5:  41.00  42.00  43.00  44.00  45.00  46.00  47.00  48.00  49.00  50.00
+cancel data stream_data_link.unf
+ 
+! read the same file as two 10 by 2 variables skipping the first line
+define axis/x=1:10:1 x10
+define axis/y=1:2:1 y2
+define grid/x=x10/y=y2 g10x2
+file/skip=10/columns=20/grid=g10x2/var=myv1,myv2/format=stream stream_data_link.unf
+list myv1,myv2
+             DATA SET: ./stream_data_link.unf
+             X: 0.5 to 10.5
+             Y: 0.5 to 2.5
+ Column  1: MYV1
+ Column  2: MYV2
+            MYV1   MYV2
+ ---- J:1 Y:   1
+1    /  1:  11.00  31.00
+2    /  2:  12.00  32.00
+3    /  3:  13.00  33.00
+4    /  4:  14.00  34.00
+5    /  5:  15.00  35.00
+6    /  6:  16.00  36.00
+7    /  7:  17.00  37.00
+8    /  8:  18.00  38.00
+9    /  9:  19.00  39.00
+10   / 10:  20.00  40.00
+ ---- J:2 Y:   2
+1    /  1:  21.00  41.00
+2    /  2:  22.00  42.00
+3    /  3:  23.00  43.00
+4    /  4:  24.00  44.00
+5    /  5:  25.00  45.00
+6    /  6:  26.00  46.00
+7    /  7:  27.00  47.00
+8    /  8:  28.00  48.00
+9    /  9:  29.00  49.00
+10   / 10:  30.00  50.00
+cancel data stream_data_link.unf
+ 
+*** Running test: bn_mc.jnl
+!bn430_mc.jnl
+! kob - 9/5/96
+!     - simple test of mc data access for both irregular and regular time
+!       axis
+!     - 9/6/96 - add tests for bad delta, out of order stepfiles, missing first step file
+!		 and missing step file other than the first
+!     - 11/06/97 - added a set mode/last verify
+CAN MODE VERIFY
+     currently SET data sets:
+    1> ./coads_clim.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-JUN-1900 10:25
+ 
+    GRID GHB1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME1     TIME                 6 r   16-JAN-1900 06:00    17-JUN-1900 10:25
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  16-JAN-1900 06:00:00  730.485    01-JAN-1900 00:45:27    366
+       2>  15-FEB-1900 16:29:06  730.485    31-JAN-1900 11:14:33    1096.485
+       3>  18-MAR-1900 02:58:12  730.485    02-MAR-1900 21:43:39    1826.97
+       4>  17-APR-1900 13:27:18  730.485    02-APR-1900 08:12:45    2557.455
+       5>  17-MAY-1900 23:56:24  730.485    02-MAY-1900 18:41:51    3287.94
+       6>  17-JUN-1900 10:25:30  730.485    02-JUN-1900 05:10:57    4018.425
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 8 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 141W
+                    7S     5S     3S     1S     1N     3N     5N     7N    
+                    42     43     44     45     46     47     48     49
+ 16-JAN-1900 / 1:  27.79  27.20  26.26  25.30  25.97  26.20  26.90  27.02
+ 15-FEB-1900 / 2:  27.63  27.60  26.54  26.15  26.39  26.82  27.16  27.12
+ 18-MAR-1900 / 3:  28.47  27.94  26.96  26.51  26.64  27.12  27.03  27.09
+ 17-APR-1900 / 4:  28.42  28.41  27.53  27.05  27.07  27.50  27.37  27.39
+ 17-MAY-1900 / 5:  28.28  28.38  26.88  26.75  27.07  27.74  27.59  27.46
+ 17-JUN-1900 / 6:  28.22  28.10  27.62  26.85  26.72  27.72  28.12  27.88
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 20 by 6 points (LONGITUDE-TIME)
+             LATITUDE : 1S
+      ... listing every   2th point
+                   179W   175W   171W   167W   163W   159W   155W   151W   147W   143W   
+                    81     83     85     87     89     91     93     95     97     99
+ 16-JAN-1900 / 1:  28.86  27.80  27.94  27.85  27.56  27.04  26.56  26.52  26.01  26.02
+ 15-FEB-1900 / 2:  28.29  28.19  27.73  27.45  27.13  26.59  26.74  26.61  26.04  26.48
+ 18-MAR-1900 / 3:  27.83  28.22  27.84  27.64  27.14  27.09  27.43  27.05  27.03  26.67
+ 17-APR-1900 / 4:  28.09  27.69  28.08  28.06  27.74  27.74  27.69  27.17  27.71  27.17
+ 17-MAY-1900 / 5:  28.36  27.89  28.60  28.32  28.01  27.69  27.70  27.53  26.77  27.35
+ 17-JUN-1900 / 6:  28.06  28.44  28.56  28.33  27.99  27.67  27.50  27.57  26.96  27.16
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 01-JAN-1900 00:45 to 02-JUL-1900 15:40
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim.des
+ 
+ Total # of data points: 97200 (180*90*1*6*1*1)
+ # flagged as bad  data: 44263
+ Minimum value: -2.3
+ Maximum value: 32
+ Mean    value: 17.806 (unweighted average)
+ Standard deviation: 9.6933
+     currently SET data sets:
+    1> ./coads_clim.des
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:6       ...       ...
+             Deg C on grid GHB1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-JUN-1900 10:25
+ 
+    2> ./coads_clim_irreg.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GJR1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+    GRID GJR1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME2     TIME                 3 i   16-JAN-1900 06:00    17-MAY-1900 23:56
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  16-JAN-1900 06:00:00  730.485    01-JAN-1900 00:45:27    366
+       2>  15-FEB-1900 16:29:06  1460.97    31-JAN-1900 11:14:33    1096.485
+       3>  17-MAY-1900 23:56:24  2191.455   02-APR-1900 08:12:45    3287.94
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 8 by 3 points (LATITUDE-TIME)
+             LONGITUDE: 141W
+                    7S     5S     3S     1S     1N     3N     5N     7N    
+                    42     43     44     45     46     47     48     49
+ 16-JAN-1900 / 1:  27.79  27.20  26.26  25.30  25.97  26.20  26.90  27.02
+ 15-FEB-1900 / 2:  27.63  27.60  26.54  26.15  26.39  26.82  27.16  27.12
+ 17-MAY-1900 / 3:  28.28  28.38  26.88  26.75  27.07  27.74  27.59  27.46
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             SUBSET   : 20 by 3 points (LONGITUDE-TIME)
+             LATITUDE : 1S
+      ... listing every   2th point
+                   179W   175W   171W   167W   163W   159W   155W   151W   147W   143W   
+                    81     83     85     87     89     91     93     95     97     99
+ 16-JAN-1900 / 1:  28.86  27.80  27.94  27.85  27.56  27.04  26.56  26.52  26.01  26.02
+ 15-FEB-1900 / 2:  28.29  28.19  27.73  27.45  27.13  26.59  26.74  26.61  26.04  26.48
+ 17-MAY-1900 / 3:  28.36  27.89  28.60  28.32  28.01  27.69  27.70  27.53  26.77  27.35
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 01-JAN-1900 00:45 to 02-JUL-1900 15:40
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_clim_irreg.des
+ 
+ Total # of data points: 48600 (180*90*1*3*1*1)
+ # flagged as bad  data: 21459
+ Minimum value: -2.2
+ Maximum value: 31
+ Mean    value: 17.359 (unweighted average)
+ Standard deviation: 9.8799
+     currently SET data sets:
+    1> ./coads_clim_missing_step1.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GQO1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+     currently SET data sets:
+    1> ./coads_clim_missing_stepN.des  (default)
+     COAD
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+             Deg C on grid GCQ1 with -1.E+34 for missing data
+             X=20E:20E(380)  Y=90S:90N  
+ 
+  time range: 16-JAN-1900 06:00 to 17-MAY-1900 23:56
+ 
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_missing_stepN.des
+             SUBSET   : 180 by 90 by 3 points (LONGITUDE-LATITUDE-TIME)
+      ... listing every  11th point
+               21E    43E    65E    87E   109E   131E   153E   175E   163W   141W   119W    97W    75W    53W    31W    9W    13E    
+                1     12     23     34     45     56     67     78     89    100    111    122    133    144    155    166    177
+ ---- L:1 T:   16-JAN-1900 06:00
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77N   / 84:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.94
+ 75N   / 83:   1.55   0.40   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.35
+ 73N   / 82:   3.72   1.55   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   4.51
+ 71N   / 81:   5.09   1.80   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.40   5.68
+ 69N   / 80:   5.45   0.89   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.00   2.27   6.05
+ 67N   / 79:   ....   2.00   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.25   4.31   3.37   5.43
+ 65N   / 78:   0.07   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.23   5.10   4.15   4.65
+ 63N   / 77:   0.51   ....   ....   ....   ....   ....   ....   0.58   ....   ....   ....   ....   ....   0.42   5.96   7.30   ....
+ 61N   / 76:   1.23   ....   ....   ....   ....   ....   ....   0.62  -0.43   6.33   ....   ....   ....   2.13   6.22   8.43   ....
+ 59N   / 75:   2.90   ....   ....   ....   ....   ....  -0.71   1.56   1.83   5.92   ....   ....   ....   2.66   7.40   9.38   ....
+ 57N   / 74:   3.04   ....   ....   ....   ....   ....   0.23   2.22   2.80   5.65   ....   ....   ....   2.95   7.53   9.63   3.05
+ 55N   / 73:   3.20   ....   ....   ....   ....   ....   0.07   3.07   4.14   5.53   ....   ....   ....   1.24   7.46   9.55   2.99
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   1.20   3.30   4.30   6.03   ....   ....   ....   0.11   7.75  10.59   4.00
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   0.81   3.85   4.48   6.59   ....   ....   ....   0.14  10.27  10.16   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   1.94   3.87   5.09   6.85   ....   ....   ....   0.04  11.62  11.20   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   1.90   4.40   6.21   8.03   ....   ....   ....   0.92  12.68  11.99   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   2.16   5.81   7.55   9.23   ....   ....   1.85   3.28  13.78  12.68  11.93
+ 43N   / 67:   ....   ....   ....   ....   ....   2.42   4.14   8.17   9.12  10.53   ....   ....   ....   7.11  14.72  13.34  13.33
+ 41N   / 66:   ....   ....   ....   ....   ....   4.91   9.29  10.83  10.98  11.98   ....   ....   7.16  14.94  15.43  14.06  14.65
+ 39N   / 65:  15.44   ....   ....   ....   ....   8.73  12.17  12.90  12.46  13.51   ....   ....   7.51  18.35  16.21  14.67  14.79
+ 37N   / 64:  16.03   ....   ....   ....   ....  12.58  15.26  14.88  14.03  15.14   ....   ....  10.35  18.97  17.19  15.62  15.35
+ 35N   / 63:  16.25   ....   ....   ....   ....  14.09  17.15  16.14  15.40  16.41  14.05   ....  20.52  19.37  18.18  16.90  15.84
+ 33N   / 62:  16.78   ....   ....   ....   ....  15.13  18.31  17.29  16.95  17.75  14.76   ....  22.12  19.97  19.29  17.05  16.40
+ 31N   / 61:  17.98   ....   ....   ....   ....  19.46  19.24  18.64  18.83  19.02  15.23   ....  21.84  20.85  20.05  16.48   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  20.76  20.55  20.11  20.20  19.82  16.36  17.91  22.49  21.93  20.68  15.08   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  21.32  22.40  22.10  21.59  20.66  17.50  19.77  23.61  22.82  21.51   ....   ....
+ 25N   / 58:   ....   ....  23.69   ....   ....  22.05  23.99  23.35  22.92  21.47  18.62  22.15  24.57  23.69  22.33   ....   ....
+ 23N   / 57:   ....   ....  24.01   ....   ....  23.44  25.10  24.41  23.95  21.77  19.57  22.75  25.42  24.48  22.79   ....   ....
+ 21N   / 56:   ....   ....  24.62  24.90  20.77  24.55  26.33  25.60  24.53  22.80  21.34  22.78  26.17  25.00  22.94   ....   ....
+ 19N   / 55:   ....   ....  24.92  25.43  23.43  25.68  26.87  26.00  25.29  23.48  23.10  23.78  26.77  25.43  23.43   ....   ....
+ 17N   / 54:   ....  25.92  25.39  25.91  23.85  26.60  27.43  26.36  25.60  24.00  24.43  27.24  26.92  25.84  23.83   ....   ....
+ 15N   / 53:   ....  25.71  25.74  26.33  24.40  27.32  27.51  26.64  25.82  24.65  25.72  27.27  26.69  26.20  24.23   ....   ....
+ 13N   / 52:   ....  25.60  26.61  26.85  24.58  27.70  27.71  27.10  26.12  24.93  26.26  26.93  26.52  26.57  24.81   ....   ....
+ 11N   / 51:   ....  25.94  27.23  27.47  25.22  27.87  27.94  27.42  26.76  25.70  26.72  26.92  26.23  26.74  25.39   ....   ....
+ 9N    / 50:   ....   ....  27.37  27.58  25.82  28.02  28.36  27.91  27.43  26.86  26.73  26.86  27.74  26.89  25.90   ....   ....
+ 7N    / 49:   ....   ....  28.06  27.97  25.94  27.92  28.66  28.29  27.72  27.02  26.78  26.82   ....  26.99  26.59   ....   ....
+ 5N    / 48:   ....   ....  27.89  27.96  26.24  28.31  28.61  28.42  27.70  26.90  26.90  27.23   ....  27.23  26.99  28.18   ....
+ 3N    / 47:   ....   ....  28.08  28.15  27.09  28.46  29.05  28.47  27.45  26.20  25.88  26.05   ....   ....  27.05  28.01   ....
+ 1N    / 46:   ....  26.69  28.02  28.23  27.36  28.73  29.25  28.48  27.25  25.97  24.54  25.27   ....   ....  27.05  27.40   ....
+ 1S    / 45:   ....  26.50  28.00  28.31  27.87  28.92  29.43  28.31  27.56  25.30  24.47  24.28   ....  27.35  27.10  26.70   ....
+ 3S    / 44:   ....  27.04  28.07  28.31  28.18  28.93  29.44  29.08  27.84  26.26  24.88  24.33   ....   ....  27.16  26.37   ....
+ 5S    / 43:   ....  27.95  27.90  28.18  28.21  29.02  29.61  29.24  28.14  27.20  25.02  24.53   ....   ....  27.15  26.13  26.84
+ 7S    / 42:   ....  28.51  27.65  28.10  28.31  28.88  29.66  29.33  28.33  27.79  25.58  24.25   ....   ....  27.31  25.63  26.46
+ 9S    / 41:   ....  28.58  28.04  28.43  28.89  28.93  29.51  29.64  29.21  27.79  25.69  24.01   ....   ....  27.23  24.96  26.45
+ 11S   / 40:   ....  28.60  28.00  27.77  28.42  29.60  28.90  29.44  29.11  27.84  25.67  23.42   ....   ....  27.22  24.61  25.88
+ 13S   / 39:   ....  28.57  28.23  27.62  28.18  29.75  29.09  29.05  29.06  27.93  26.09  23.38   ....   ....  27.35  24.05  24.87
+ 15S   / 38:   ....  28.48  27.53  27.33  27.71   ....  28.84  28.98  28.70  28.23  25.90  23.41  19.39   ....  27.01  23.35  23.91
+ 17S   / 37:   ....  28.59  27.32  26.85  26.95   ....  28.49  28.38  28.38  27.84  26.13  22.71  21.99   ....  26.74  23.17   ....
+ 19S   / 36:   ....  28.40  26.80  26.23  26.37   ....  28.10  27.77  27.85  27.47  26.07  23.03  22.74   ....  26.61  23.34  18.44
+ 21S   / 35:   ....  28.57  26.75  25.34  25.47   ....  27.89  27.03  27.43  27.14  25.94  23.55  21.85   ....  26.43  23.76  18.73
+ 23S   / 34:   ....  28.19  26.36  24.88  24.26   ....  27.13  26.05  26.25  26.35  25.90  23.07  20.94   ....  26.55  23.83  18.16
+ 25S   / 33:   ....  27.16  25.70  24.42  23.40   ....  26.44  25.26  25.31  25.42  25.43  23.40  20.04   ....  25.43  23.71  17.48
+ 27S   / 32:   ....  26.11  25.25  23.88  22.40   ....  25.88  24.79  24.22  24.51  24.65  22.98  19.43   ....  24.86  23.99  19.90
+ 29S   / 31:   ....  25.46  24.30  22.60  21.53   ....  25.21  23.45  22.97  23.36  24.06  22.91  19.40   ....  23.41  23.31  20.16
+ 31S   / 30:   ....  24.10  23.48  22.27  20.80   ....  24.35  22.55  21.64  22.21  23.20  22.00  18.67  22.38  22.59  22.86  20.29
+ 33S   / 29:   ....  22.34  21.57  20.47  19.72  19.72  23.23  21.74  20.98  21.33  21.62  21.48  17.87  22.47  20.57  21.02  20.19
+ 35S   / 28:  21.08  21.20  20.15  19.19  18.41  18.12  22.56  20.53  19.55  19.30  19.89  20.78  16.71  22.10  19.94  20.03  19.66
+ 37S   / 27:  21.29  19.84  18.18  17.72  16.53  17.07  20.59  19.73  18.50  18.08  17.53   ....  16.00  20.88  18.64  17.95  18.46
+ 39S   / 26:  20.75  18.19  16.73  15.60  15.24  16.28  19.14  18.72  17.95  16.62  16.96   ....  15.95  19.17  16.74  15.68  17.75
+ 41S   / 25:  16.45  15.86  15.91  14.50  13.63  14.28  17.01  16.25  16.54  15.06  15.15  16.62  15.59  18.18  14.79  13.98  14.15
+ 43S   / 24:  14.37  11.09  13.70  12.70  12.57  12.66  15.82  15.95  15.61  13.65   ....  14.60  14.50  16.34  12.51  11.74  11.67
+ 45S   / 23:   8.49   8.29   9.34  10.39  11.05  11.84  13.89  13.96  14.01  13.24   ....   ....  13.81  14.65  10.51   8.58   8.23
+ 47S   / 22:   6.06   6.47   6.63   8.80   8.71  10.63  12.88  12.94  13.27  11.77   ....   ....  13.27  13.25   8.62   6.47   6.45
+ 49S   / 21:   4.42   4.75   5.05   7.73   7.14   9.54  10.88  10.63  12.28   ....   ....   ....  12.01   9.86   5.30   4.41   4.38
+ 51S   / 20:   1.84   3.26   3.57   5.52   5.39   8.11   9.30   9.77  11.23   ....   ....   8.72  10.74   7.96   3.63   2.21   1.85
+ 53S   / 19:   1.09   2.59   3.32   3.41   3.51   6.69   7.08   8.78   8.40   ....   ....   8.47   9.49   6.99   2.19   1.25   1.27
+ 55S   / 18:   0.65   1.42   2.61   2.72   3.28   5.49   6.32   8.06   6.83   7.20   ....   6.80   8.07   5.89   1.39   1.24   0.92
+ 57S   / 17:   0.41   1.20   2.42   2.73   2.58   4.13   3.83   7.20   4.81   3.67   ....   6.95   7.21   4.44   0.78   0.41   0.53
+ 59S   / 16:   0.62   1.37   1.61   1.79   2.03   2.67   3.39   6.06   3.88   2.15   4.70   5.80   6.27   2.30   0.07   0.19   0.56
+ 61S   / 15:   0.84   1.27   1.31   1.52   1.39   1.62   2.17   4.16   2.25   0.94   3.50   ....   4.23   1.02   0.08   0.07   0.18
+ 63S   / 14:   0.88   0.90   0.57   0.99   0.78   1.06   1.41   2.03   0.50   0.48   1.03   ....   2.28   0.75  -0.33   0.00   0.76
+ 65S   / 13:   0.37  -0.05   0.31   0.34  -0.34   0.27   0.28   0.74   0.16   0.11   0.20   1.89   1.58  -0.17  -0.55  -0.65   0.25
+ 67S   / 12:  -0.67  -0.78   0.19   ....   ....  -0.73   0.05   0.02  -0.05  -1.10   0.39   0.28   0.91   ....  -0.25  -0.52   0.08
+ 69S   / 11:   0.04   ....   ....   ....   ....   ....   ....  -0.47  -0.01   ....  -0.47   0.37   ....   ....   0.50  -0.72   0.43
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....  -0.40  -0.46  -0.23   ....   ....   ....   ....  -1.02  -1.14   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....  -0.11   ....   ....   ....   ....   ....   ....  -1.20   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....   0.28  -0.48   ....   ....   ....   ....   ....  -0.42   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....  -0.04  -0.43   ....   ....   ....   ....   ....  -0.87   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ ---- L:2 T:   15-FEB-1900 16:29
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77N   / 84:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.55
+ 75N   / 83:   2.53   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -1.01   3.64
+ 73N   / 82:   4.10   0.68   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   5.80   4.46
+ 71N   / 81:   4.67   1.60   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.63   5.35
+ 69N   / 80:   4.20   0.07   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.54   5.61
+ 67N   / 79:   ....   0.00   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.58   3.76   1.44   4.70
+ 65N   / 78:  -0.06   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.13   4.46   3.71   4.23
+ 63N   / 77:   0.07   ....   ....   ....   ....   ....   ....   1.80   ....   ....   ....   ....   ....   0.18   5.86   7.46   ....
+ 61N   / 76:   0.48   ....   ....   ....   ....   ....   ....   0.46   1.60   ....   ....   ....   ....   2.43   6.45   8.14   ....
+ 59N   / 75:   1.64   ....   ....   ....   ....   ....  -0.56   0.56   1.64   5.50   ....   ....   ....   3.19   7.08   9.06   ....
+ 57N   / 74:   2.04   ....   ....   ....   ....   ....  -0.10   1.45   1.80   5.04   ....   ....   ....   2.77   7.29   9.20   2.45
+ 55N   / 73:   2.06   ....   ....   ....   ....   ....   0.25   2.58   3.67   5.05   ....   ....   ....   0.68   7.14   9.03   2.18
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   0.40   2.97   3.69   5.80   ....   ....   ....  -0.54   7.59   9.12   2.66
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   1.25   3.29   3.92   6.07   ....   ....   ....  -0.24  10.03   9.66   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   1.30   3.31   4.62   6.48   ....   ....   ....  -0.58  11.39  10.77   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   1.31   3.87   5.82   7.72   ....   ....   ....   0.08  12.22  11.59   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   1.64   5.33   7.19   8.88   ....   ....   2.79   1.94  13.40  12.23  10.75
+ 43N   / 67:   ....   ....   ....   ....   ....   1.56   3.32   7.31   8.72  10.04   ....   ....   ....   6.23  14.22  12.95  12.83
+ 41N   / 66:   ....   ....   ....   ....   ....   4.14   8.12   9.90  10.40  11.47   ....   ....   4.31  14.21  15.00  13.69  14.18
+ 39N   / 65:  15.03   ....   ....   ....   ....   7.72  10.99  12.00  11.82  13.06   ....   ....   6.32  17.51  15.71  14.26  14.35
+ 37N   / 64:  15.32   ....   ....   ....   ....  10.93  13.97  14.02  13.13  14.39   ....   ....   9.22  18.20  16.56  15.23  14.69
+ 35N   / 63:  15.54   ....   ....   ....   ....  12.62  15.99  15.43  14.63  15.87  13.93   ....  20.07  18.58  17.46  16.40  15.09
+ 33N   / 62:  16.01   ....   ....   ....   ....  14.74  17.14  16.36  16.17  16.98  14.72   ....  21.44  19.24  18.55  16.62  15.90
+ 31N   / 61:  15.50   ....   ....   ....   ....  18.77  18.03  17.55  18.01  18.42  15.02   ....  21.21  20.15  19.32  15.77   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  20.05  19.18  19.02  19.57  19.13  16.05  17.31  21.97  21.19  20.04  17.33   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  20.82  21.30  21.41  21.05  20.17  17.29  19.69  23.10  22.32  20.86   ....   ....
+ 25N   / 58:   ....   ....  23.37   ....   ....  21.95  23.08  22.46  22.44  21.17  18.17  21.39  24.11  23.29  21.69   ....   ....
+ 23N   / 57:   ....   ....  23.76   ....   ....  22.77  24.49  24.04  23.57  21.92  19.09  22.31  25.07  23.98  22.17   ....   ....
+ 21N   / 56:   ....   ....  24.43  25.75  19.45  24.07  25.66  24.94  24.16  22.52  21.25  22.64  25.85  24.52  22.62   ....   ....
+ 19N   / 55:   ....   ....  24.81  25.98  22.73  25.39  26.41  25.48  24.88  23.21  22.97  23.66  26.62  24.96  22.76   ....   ....
+ 17N   / 54:   ....  25.77  25.47  26.44  23.56  26.23  26.90  26.12  25.11  23.95  24.19  27.76  26.61  25.31  22.99   ....   ....
+ 15N   / 53:   ....  25.54  26.20  26.79  24.38  27.09  27.10  26.39  25.66  24.45  25.70  27.55  26.32  25.87  23.66   ....   ....
+ 13N   / 52:   ....  25.62  26.40  26.95  24.65  27.47  27.43  26.96  26.33  25.18  26.39  27.20  26.10  26.30  24.16   ....   ....
+ 11N   / 51:   ....  25.85  27.24  27.46  25.41  27.61  27.90  27.24  26.54  25.86  26.16  27.39  26.01  26.49  24.74   ....   ....
+ 9N    / 50:   ....   ....  27.29  27.82  26.12  27.87  28.40  27.97  27.27  26.61  26.77  27.21  26.67  26.73  25.59   ....   ....
+ 7N    / 49:   ....   ....  27.98  28.19  26.26  27.63  28.89  28.31  27.93  27.12  26.51  27.17   ....  27.05  26.62   ....   ....
+ 5N    / 48:   ....   ....  27.92  28.15  26.59  27.78  28.71  28.56  27.42  27.16  26.90  27.57   ....  27.19  26.89  27.82   ....
+ 3N    / 47:   ....   ....  28.32  28.45  27.02  28.09  29.00  28.16  27.30  26.82  26.48  27.02   ....   ....  27.12  28.40   ....
+ 1N    / 46:   ....  26.89  28.19  28.51  27.18  28.28  29.17  28.70  27.15  26.39  26.05  26.63   ....   ....  27.25  27.95   ....
+ 1S    / 45:   ....  26.66  28.39  28.75  27.77  28.45  29.40  29.52  27.13  26.15  25.38  25.66   ....  27.43  27.42  27.48   ....
+ 3S    / 44:   ....  26.93  28.32  28.62  27.85  28.80  29.40  29.04  27.42  26.54  25.63  25.85   ....   ....  27.66  27.23   ....
+ 5S    / 43:   ....  27.72  28.15  28.38  28.05  28.74  29.51  29.48  28.27  27.60  25.88  25.91   ....   ....  27.63  27.00  27.81
+ 7S    / 42:   ....  28.66  28.47  28.45  28.13  28.71  29.63  28.80  28.44  27.63  26.16  25.85   ....   ....  27.74  26.27  27.66
+ 9S    / 41:   ....  28.84  28.14  28.58  28.40  28.74  29.44  28.98  29.00  28.11  26.18  25.20   ....   ....  27.66  26.42  27.63
+ 11S   / 40:   ....  28.78  28.12  28.05  28.39  29.34  29.01  29.20  28.82  27.84  26.23  24.59   ....   ....  27.54  25.65  26.90
+ 13S   / 39:   ....  28.84  28.27  28.01  28.08  29.76  28.97  28.84  28.88  28.33  26.32  24.17   ....   ....  27.33  25.16  26.03
+ 15S   / 38:   ....  28.80  27.97  27.48  27.83   ....  28.85  29.11  28.81  28.16  26.18  24.09  19.26   ....  27.44  24.56  24.02
+ 17S   / 37:   ....  28.65  27.86  26.99  27.58   ....  28.40  28.63  28.75  27.82  26.41  23.86  22.94   ....  27.51  24.62   ....
+ 19S   / 36:   ....  28.60  27.17  26.73  27.12   ....  27.98  28.41  28.14  27.86  26.36  23.99  23.99   ....  27.47  24.44  19.40
+ 21S   / 35:   ....  28.58  26.76  26.08  26.40   ....  27.84  27.29  27.70  27.50  26.32  23.67  22.88   ....  27.04  24.72  19.34
+ 23S   / 34:   ....  28.20  26.74  25.28  25.36   ....  27.18  26.48  27.06  26.64  25.94  24.55  21.74   ....  27.27  24.46  18.59
+ 25S   / 33:   ....  27.40  26.21  24.45  24.08   ....  26.85  25.76  25.77  26.21  25.99  24.70  20.97   ....  26.43  24.28  18.14
+ 27S   / 32:   ....  26.63  25.28  23.90  23.28   ....  26.19  24.74  24.66  25.25  25.33  24.71  20.59   ....  26.09  24.51  20.34
+ 29S   / 31:   ....  25.76  24.80  23.09  22.25   ....  25.61  24.09  23.82  24.13  24.93  23.40  19.74   ....  25.13  24.06  20.71
+ 31S   / 30:   ....  24.68  23.32  22.08  21.23   ....  24.84  22.96  22.38  23.15  23.38  23.17  18.70  22.72  23.63  23.37  20.79
+ 33S   / 29:   ....  23.51  22.22  20.96  20.32  20.89  23.89  22.18  21.60  21.08  22.57  21.93  18.00  23.08  22.62  21.87  20.46
+ 35S   / 28:  20.97  21.71  20.56  20.14  19.00  18.84  23.35  21.09  20.21  20.23  20.75  20.57  18.06  22.52  20.87  20.61  19.90
+ 37S   / 27:  21.72  20.72  18.87  17.47  17.40  17.75  21.59  20.96  19.64  18.50  19.62  20.35  15.97  21.01  19.53  18.35  19.24
+ 39S   / 26:  22.04  19.15  17.06  16.08  15.45  16.92  20.09  19.57  18.36  17.78  18.10  17.13  15.89  20.22  18.21  16.29  16.84
+ 41S   / 25:  17.85  16.22  16.09  14.75  14.16  15.13  18.04  16.76  17.16  16.13   ....   ....  15.35  18.12  16.49  14.76  14.40
+ 43S   / 24:  13.49  11.11  14.98  12.53  12.12  13.91  16.18  16.23  15.86  14.61   ....   ....  14.43  17.59  14.18  12.05  11.00
+ 45S   / 23:   8.38   8.86  10.08  10.48  11.53  12.13  14.32  14.53  14.51  13.91  14.42   ....  13.92  15.47  10.97  10.97   8.87
+ 47S   / 22:   6.72   6.81   7.42  10.57   8.81  10.99  12.94  13.07  13.77  12.05   ....  10.95  13.29  14.48   8.58   6.84   6.47
+ 49S   / 21:   4.89   5.10   4.94   7.05   7.28  10.12  11.23  11.09  12.24   ....   ....   ....  11.62   9.42   7.44   5.11   4.99
+ 51S   / 20:   2.32   3.94   4.26   4.47   5.41   8.32   9.39   9.64  10.91   9.88   ....   ....  10.94   7.71   5.20   3.20   2.24
+ 53S   / 19:   1.67   3.02   4.17   3.51   4.64   6.95   7.65   8.51   9.70   9.24   ....   8.19  10.25   7.31   3.81   1.86   1.46
+ 55S   / 18:   1.33   2.57   3.64   2.67   3.82   5.58   5.95   7.96   8.88   7.36   ....   8.18   8.69   6.56   1.84   1.25   1.05
+ 57S   / 17:   0.98   1.63   3.34   2.49   3.08   4.83   4.86   7.36   5.90   4.51   ....   ....   7.19   4.30   1.71   0.81   1.00
+ 59S   / 16:   1.16   1.61   1.97   1.96   3.52   3.47   2.90   5.87   4.63   2.35   ....   ....   6.40   2.56   1.26   0.87   1.13
+ 61S   / 15:   0.99   1.22   1.48   1.75   1.82   3.70   2.08   4.52   2.76   1.36   ....   5.02   4.46   1.05   0.09   0.28   0.80
+ 63S   / 14:   1.06   1.20   0.88   1.19   1.21   1.49   1.31   3.01   1.19   1.29   2.50   2.70   3.14  -0.02   0.31   0.36   1.16
+ 65S   / 13:   0.67   0.97   0.14   0.48  -0.29   0.51   0.45   1.58   0.22   0.31   0.00   2.30   1.67  -1.01   0.00  -0.22   0.45
+ 67S   / 12:   0.46  -0.56  -0.27  -0.18   ....   ....  -0.71   0.56  -0.16  -0.14  -0.02  -0.25   0.79  -0.75   0.21  -0.29  -0.16
+ 69S   / 11:  -0.34  -1.18   ....   ....   ....   ....   ....   0.15  -0.36   ....  -0.30   0.24   0.15   ....  -0.70  -0.40  -0.59
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....  -0.48  -0.73   ....   ....  -1.56   ....  -1.68  -1.56  -1.23   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....  -0.45  -0.85   ....   ....   ....   ....   ....  -1.48   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....  -0.28  -1.30   ....   ....   ....   ....  -1.30  -1.22   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....  -0.12  -0.61   ....   ....   ....   ....   ....  -1.37   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ ---- L:3 T:   17-MAY-1900 23:56
+ 89N   / 90:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87N   / 89:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85N   / 88:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83N   / 87:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81N   / 86:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79N   / 85:   2.50   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.24
+ 77N   / 84:   3.44   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   2.62
+ 75N   / 83:   2.60  -0.19   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -0.53   3.73
+ 73N   / 82:   4.44   0.93   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  -1.25   4.91
+ 71N   / 81:   5.44   1.28   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.02   ....   0.65   5.77
+ 69N   / 80:   5.98   1.91   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   0.89   7.03   2.05   6.47
+ 67N   / 79:   ....   3.65   ....   ....   ....   ....   ....   ....   0.00   ....   ....   ....   ....   0.64   6.28   3.36   6.32
+ 65N   / 78:   1.46   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   1.06   5.57   5.36   6.41
+ 63N   / 77:   3.42   ....   ....   ....   ....   ....   ....   1.17   ....   ....   ....   ....   ....   1.16   6.62   8.23   ....
+ 61N   / 76:   3.42   ....   ....   ....   ....   ....   ....   1.40   ....   6.95   ....   ....   ....   1.92   7.05   8.90   ....
+ 59N   / 75:   5.64   ....   ....   ....   ....   ....   1.24   2.01   3.17   7.27   ....   ....   ....   3.54   7.46  10.04   ....
+ 57N   / 74:   5.98   ....   ....   ....   ....   ....   1.49   3.19   2.81   7.18   ....   ....   ....   3.62   8.23  10.53   9.20
+ 55N   / 73:   8.03   ....   ....   ....   ....   ....   1.62   3.47   4.59   6.91   ....   ....   ....   1.57   8.40  10.75   7.90
+ 53N   / 72:   ....   ....   ....   ....   ....   ....   1.81   3.96   5.09   7.04   ....   ....   ....   1.57   9.22  11.85   6.67
+ 51N   / 71:   ....   ....   ....   ....   ....   ....   2.66   4.24   5.13   7.18   ....   ....   ....   1.42  11.30  11.58   ....
+ 49N   / 70:   ....   ....   ....   ....   ....   ....   2.71   4.28   5.65   7.55   ....   ....   ....   2.48  12.34  12.14   ....
+ 47N   / 69:   ....   ....   ....   ....   ....   ....   2.33   4.82   6.46   8.57   ....   ....   ....   2.61  13.63  13.04   ....
+ 45N   / 68:   ....   ....   ....   ....   ....   ....   3.22   6.02   7.83   9.78   ....   ....   9.42   4.30  14.63  13.75  16.73
+ 43N   / 67:   ....   ....   ....   ....   ....   7.81   5.90   8.16   9.25  10.89   ....   ....   ....   8.71  15.59  14.35  16.30
+ 41N   / 66:   ....   ....   ....   ....   ....  10.50  10.95  11.22  11.32  12.46   ....   ....  12.27  16.30  16.52  15.34  17.74
+ 39N   / 65:  18.31   ....   ....   ....   ....  13.43  13.82  13.51  13.17  13.99   ....   ....  12.90  19.04  17.14  15.93  17.96
+ 37N   / 64:  18.51   ....   ....   ....   ....  15.67  16.44  15.55  14.85  15.36   ....   ....  15.54  19.48  18.09  16.91  17.66
+ 35N   / 63:  18.74   ....   ....   ....   ....  17.00  18.35  17.10  16.64  16.54  14.51   ....  23.23  20.01  19.01  18.12  18.13
+ 33N   / 62:  18.95   ....   ....   ....   ....  18.51  19.07  18.50  18.28  17.75  15.68   ....  24.14  20.84  20.01  18.57  18.76
+ 31N   / 61:  18.70   ....   ....   ....   ....  22.40  20.43  20.12  20.33  19.09  15.68   ....  23.76  21.95  20.61  17.01   ....
+ 29N   / 60:   ....   ....   ....   ....   ....  23.49  22.45  21.81  21.63  19.86  16.89  24.73  24.37  23.02  21.28  16.93   ....
+ 27N   / 59:   ....   ....   ....   ....   ....  23.87  24.26  23.53  23.06  20.86  17.60  24.89  25.10  23.84  21.76   ....   ....
+ 25N   / 58:   ....   ....  28.39   ....   ....  25.27  25.56  24.55  23.81  21.60  18.80  25.35  25.89  24.48  22.46   ....   ....
+ 23N   / 57:   ....   ....  28.65   ....   ....  26.58  26.62  25.52  24.50  22.36  19.71  26.36  26.54  25.14  22.94   ....   ....
+ 21N   / 56:   ....   ....  28.83  29.39  26.76  27.80  27.41  26.06  25.19  22.91  21.44  26.76  27.19  25.58  23.07   ....   ....
+ 19N   / 55:   ....   ....  29.22  29.61  28.15  28.34  27.79  26.54  25.74  23.48  22.90  27.54  27.86  26.09  23.33   ....   ....
+ 17N   / 54:   ....  29.80  29.44  29.73  28.49  28.82  27.95  26.93  26.13  24.08  24.49  29.27  27.68  26.33  23.57   ....   ....
+ 15N   / 53:   ....  29.77  29.65  30.04  28.55  29.03  27.99  27.73  26.09  24.89  26.29  29.49  27.47  26.79  24.06   ....   ....
+ 13N   / 52:   ....  29.69  29.95  29.75  28.71  29.06  28.20  27.78  26.73  25.85  27.20  29.81  27.47  27.12  24.95   ....   ....
+ 11N   / 51:   ....  29.97  29.94  29.60  29.36  29.07  28.38  27.83  27.29  26.67  27.89  29.74  27.62  27.34  25.48   ....   ....
+ 9N    / 50:   ....   ....  29.80  29.56  29.57  29.03  28.63  28.70  27.79  27.19  28.08  29.47  28.21  27.52  26.29   ....   ....
+ 7N    / 49:   ....   ....  29.44  29.27  29.58  29.01  29.16  29.01  27.97  27.46  27.72  28.86   ....  27.65  26.97   ....   ....
+ 5N    / 48:   ....   ....  29.49  29.20  29.56  29.28  29.51  28.54  28.14  27.59  28.06  28.48   ....  27.69  27.47  28.77   ....
+ 3N    / 47:   ....   ....  29.48  29.01  29.60  29.26  29.46  29.15  28.53  27.74  27.54  27.32   ....   ....  27.70  28.57   ....
+ 1N    / 46:   ....  27.75  29.40  29.09  29.47  29.09  29.61  28.21  27.94  27.07  25.99  25.85   ....   ....  27.72  27.75   ....
+ 1S    / 45:   ....  27.98  29.01  29.06  29.68  29.05  29.66  28.52  28.01  26.75  25.74  24.72   ....  27.33  27.79  27.02   ....
+ 3S    / 44:   ....  28.12  29.14  29.10  29.67  28.95  29.61  29.55  28.63  26.88  26.73  25.35   ....   ....  27.96  27.00   ....
+ 5S    / 43:   ....  27.85  28.86  29.07  29.51  28.74  29.52  29.61  28.79  28.38  26.97  26.19   ....   ....  28.09  27.32  26.54
+ 7S    / 42:   ....  27.71  28.45  28.72  29.48  28.72  29.36  29.57  29.12  28.28  27.08  26.18   ....   ....  28.07  26.98  25.82
+ 9S    / 41:   ....  27.87  27.97  27.63  28.73  28.11  28.90  29.18  29.53  28.49  26.99  25.79   ....   ....  27.94  26.30  25.50
+ 11S   / 40:   ....  27.81  28.00  27.38  28.10  28.64  28.05  28.61  29.10  28.43  26.56  25.18   ....   ....  27.57  25.43  25.79
+ 13S   / 39:   ....  27.94  27.18  27.10  27.99  29.05  27.72  28.74  28.96  28.24  26.42  24.34   ....   ....  27.29  24.94  24.81
+ 15S   / 38:   ....  27.83  26.93  26.57  27.38  29.50  27.25  28.28  28.59  28.07  25.96  23.67  17.46   ....  26.88  24.39  22.75
+ 17S   / 37:   ....  27.70  26.71  26.08  26.80   ....  26.71  27.20  28.11  27.66  25.79  23.51  19.35   ....  26.92  23.76   ....
+ 19S   / 36:   ....  27.10  26.01  25.10  26.20   ....  26.20  26.76  27.14  27.37  25.61  23.84  20.54   ....  26.42  23.48  16.80
+ 21S   / 35:   ....  26.34  25.18  24.21  25.65   ....  25.71  25.85  26.28  26.54  25.41  23.07  20.10   ....  26.03  23.58  17.00
+ 23S   / 34:   ....  26.11  24.69  23.62  24.25   ....  24.52  24.66  25.19  25.81  24.83  22.67  19.13   ....  25.05  22.98  16.31
+ 25S   / 33:   ....  24.51  23.80  22.77  23.07   ....  24.19  23.80  23.65  24.54  24.17  22.24  18.81   ....  24.04  22.19  16.07
+ 27S   / 32:   ....  24.08  22.89  21.77  22.23   ....  23.61  23.15  22.86  23.18  23.18  21.65  18.00   ....  23.42  21.29  18.31
+ 29S   / 31:   ....  23.34  21.84  20.41  21.11   ....  23.00  21.48  21.45  21.88  22.51  21.69  18.38   ....  22.25  21.16  18.31
+ 31S   / 30:   ....  21.88  20.68  19.52  19.84   ....  22.47  20.40  20.17  20.49  20.85  20.78  17.35  20.00  21.39  20.66  18.61
+ 33S   / 29:   ....  20.52  19.61  18.03  18.67  17.90  21.21  19.64  19.09  19.00  18.90  18.69  16.23  18.00  19.52  19.04  18.16
+ 35S   / 28:  17.48  19.53  17.57  16.40  17.31  16.86  20.57  18.48  17.67  17.62  18.43  18.43  15.71  17.33  18.21  17.94  17.95
+ 37S   / 27:  19.04  18.81  16.36  14.90  15.83  15.70  18.56  17.52  16.85  16.55  15.83   ....  14.03  17.84  17.41  16.41  17.42
+ 39S   / 26:  19.37  17.10  15.80  13.67  13.97  14.76  17.36  16.24  15.54  15.33  16.30   ....  13.37  16.31  15.92  14.31  15.65
+ 41S   / 25:  17.51  14.46  14.94  13.06  11.90  13.05  16.39  14.31  14.78  13.95  12.76  13.27  12.85  14.97  14.11  13.89  16.27
+ 43S   / 24:  14.87   9.72  14.18  11.37  10.23  11.71  14.48  12.98  13.28  12.56   ....  12.33  12.19  14.04  13.23  13.28   ....
+ 45S   / 23:  14.83   7.24   9.90   ....   7.20  10.50  13.02  10.87  12.17  11.52  11.29  11.52  11.44  12.13   ....  13.60  12.03
+ 47S   / 22:   ....   6.16   6.25   ....   ....   ....  11.26  10.65  11.59  10.45   9.33   ....  10.58  11.17   7.66   ....   ....
+ 49S   / 21:   ....   5.08   4.65   ....   ....   ....   ....   9.53   9.98   9.33   ....   8.10   9.63   7.22   6.68   ....   ....
+ 51S   / 20:   ....   ....   4.39   ....   ....   ....   ....   7.80   ....   9.10   8.30   7.20   8.50   5.53   3.73   ....   ....
+ 53S   / 19:   ....   2.46   ....   ....   ....   ....   ....   7.15   ....   ....   7.20   7.07   9.05   5.30   1.12   ....   ....
+ 55S   / 18:   ....   ....   ....   ....   ....   ....   ....   7.08   ....   ....   ....   6.07   6.83   4.35   1.47   ....   ....
+ 57S   / 17:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   5.40   5.84   4.09   1.00   ....   ....
+ 59S   / 16:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   4.34   0.40  -0.80   ....   ....
+ 61S   / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   3.62   ....   0.90   ....   ....   ....
+ 63S   / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 65S   / 13:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 67S   / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 69S   / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 71S   / 10:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 73S   /  9:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 75S   /  8:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 77S   /  7:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 79S   /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 81S   /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 83S   /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 85S   /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 87S   /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 89S   /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 
+ 
+*** Running test: bn_negative_t.jnl
+! bn450_negative_t - 10/97
+ 
+! test behavior of negative time step values (unsupported except as absolute
+! dates prior to Ferret version 4.5)
+ 
+ 
+! define an axis of negative and positive time steps and test all
+! transformation on it over various ranges
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+ 
+! ****** test transformations ********
+ 
+GO bn_negative_t.sub tvar ave  ! like var and din
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ave]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (averaged)
+          0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ave]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (averaged)
+         -6.667
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ave]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (averaged)
+         -3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ave]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (averaged)
+         -6.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ave]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (averaged)
+          0.0000
+ 
+GO bn_negative_t.sub tvar iin
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at iin]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  -8.00
+ -2   / 5: -12.00
+ 0    / 6: -12.00
+ 2    / 7:  -8.00
+ 4    / 8:   0.00
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at iin]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -20.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at iin]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -16.00
+ -6   / 3: -28.00
+ -4   / 4: -36.00
+ -2   / 5: -40.00
+ 0    / 6: -40.00
+ 2    / 7: -36.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at iin]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -16.00
+ -6   / 3: -28.00
+ -4   / 4: -36.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@iin]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        indef. integ. on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -20.00
+ -8    /  2: -36.00
+ -6    /  3: -48.00
+ -4    /  4: -56.00
+ -2    /  5: -60.00
+ 0     /  6: -60.00
+ 2     /  7: -56.00
+ 4     /  8: -48.00
+ 6     /  9: -36.00
+ 8     / 10: -20.00
+ 10    / 11:   0.00
+ 
+GO bn_negative_t.sub tvar sum
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sum]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (summed)
+          0.0000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sum]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (summed)
+         -14.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sum]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (summed)
+         -18.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sum]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (summed)
+         -18.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sum]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (summed)
+          0.0000
+ 
+GO bn_negative_t.sub tvar rsu
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at rsu]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -6.000
+ 0    / 6: -6.000
+ 2    / 7: -4.000
+ 4    / 8:  0.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at rsu]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at rsu]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+ -4   / 4: -18.00
+ -2   / 5: -20.00
+ 0    / 6: -20.00
+ 2    / 7: -18.00
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at rsu]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  -8.00
+ -6   / 3: -14.00
+ -4   / 4: -18.00
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@rsu]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        running sum on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -10.00
+ -8    /  2: -18.00
+ -6    /  3: -24.00
+ -4    /  4: -28.00
+ -2    /  5: -30.00
+ 0     /  6: -30.00
+ 2     /  7: -28.00
+ 4     /  8: -24.00
+ 6     /  9: -18.00
+ 8     / 10: -10.00
+ 10    / 11:   0.00
+ 
+GO bn_negative_t.sub tvar shf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at shf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -2.000
+ -2   / 5:  0.000
+ 0    / 6:  2.000
+ 2    / 7:  4.000
+ 4    / 8:  6.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at shf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at shf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+ -4   / 4: -2.000
+ -2   / 5:  0.000
+ 0    / 6:  2.000
+ 2    / 7:  4.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at shf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -6.000
+ -6   / 3: -4.000
+ -4   / 4: -2.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@shf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        shifted by 1 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  -8.00
+ -8    /  2:  -6.00
+ -6    /  3:  -4.00
+ -4    /  4:  -2.00
+ -2    /  5:   0.00
+ 0     /  6:   2.00
+ 2     /  7:   4.00
+ 4     /  8:   6.00
+ 6     /  9:   8.00
+ 8     / 10:  10.00
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar min   ! like @max
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at min]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -5 to 5 (minimum)
+         -4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at min]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -8 to -5 (minimum)
+         -8.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at min]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to 3 (minimum)
+         -8.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at min]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+             T        : -9 to -3 (minimum)
+         -8.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@min]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+             T        : -11 to 11 (minimum)
+         -10.00
+ 
+GO bn_negative_t.sub tvar ddf
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddf]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+ 4    / 8:  1.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddf]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddf]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddf]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddf]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        forward derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:  1.000
+ -8    /  2:  1.000
+ -6    /  3:  1.000
+ -4    /  4:  1.000
+ -2    /  5:  1.000
+ 0     /  6:  1.000
+ 2     /  7:  1.000
+ 4     /  8:  1.000
+ 6     /  9:  1.000
+ 8     / 10:  1.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar ddb   ! @ddc like ddf and ddb
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at ddb]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+ 4    / 8:  1.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at ddb]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 2 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at ddb]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 6 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+ -2   / 5:  1.000
+ 0    / 6:  1.000
+ 2    / 7:  1.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at ddb]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 3 points (T)
+ -8   / 2:  1.000
+ -6   / 3:  1.000
+ -4   / 4:  1.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@ddb]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        backwards derivative on T
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2:  1.000
+ -6    /  3:  1.000
+ -4    /  4:  1.000
+ -2    /  5:  1.000
+ 0     /  6:  1.000
+ 2     /  7:  1.000
+ 4     /  8:  1.000
+ 6     /  9:  1.000
+ 8     / 10:  1.000
+ 10    / 11:  1.000
+ 
+GO bn_negative_t.sub tvar sbx  ! like sbn, swl, shn, spz
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at sbx]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at sbx]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at sbx]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at sbx]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@sbx]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        box smoothed by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub tvar loc:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at loc:-2.2]	! neg/pos t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -5 to 5 (location of -2.2)
+         -2.200
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at loc:-2.2]	! neg/neq t endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -8 to -5 (location of -2.2)
+        ....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at loc:-2.2]	! neg/pos l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to 3 (location of -2.2)
+         -2.200
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at loc:-2.2]	! neg/neg l endpoints
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -9 to -3 (location of -2.2)
+        ....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@loc:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T of -2.2 in T[GT=TAX]
+             T        : -11 to 11 (location of -2.2)
+         -2.200
+ 
+GO bn_negative_t.sub tvar weq:-2.2
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tvar[t=-5:5 at weq:-2.2]	! neg/pos t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 5 points (T)
+ -4   / 4:  0.1000
+ -2   / 5:  0.9000
+ 0    / 6:    ....
+ 2    / 7:    ....
+ 4    / 8:    ....
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tvar[t=-5:-8 at weq:-2.2]	! neg/neq t endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 2 points (T)
+ -8   / 2:....
+ -6   / 3:....
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tvar[l=2:7 at weq:-2.2]	! neg/pos l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 6 points (T)
+ -8   / 2:    ....
+ -6   / 3:    ....
+ -4   / 4:  0.1000
+ -2   / 5:  0.9000
+ 0    / 6:    ....
+ 2    / 7:    ....
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tvar[l=2:4 at weq:-2.2]	! neg/neg l endpoints
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 3 points (T)
+ -8   / 2:....
+ -6   / 3:....
+ -4   / 4:....
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tvar[l=@weq:-2.2]	! unspecified limits (neg/pos)
+             VARIABLE : T[GT=TAX]
+                        weighted equal of -2.2 on T
+             SUBSET   : 11 points (T)
+ -10   /  1:    ....
+ -8    /  2:    ....
+ -6    /  3:    ....
+ -4    /  4:  0.1000
+ -2    /  5:  0.9000
+ 0     /  6:    ....
+ 2     /  7:    ....
+ 4     /  8:    ....
+ 6     /  9:    ....
+ 8     / 10:    ....
+ 10    / 11:    ....
+ 
+ 
+! transformations requiring gappy data to test
+LIST tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3:   ....
+ -4    /  4: -4.000
+ -2    /  5:   ....
+ 0     /  6:  0.000
+ 2     /  7:   ....
+ 4     /  8:  4.000
+ 6     /  9:   ....
+ 8     / 10:  8.000
+ 10    / 11:   ....
+GO bn_negative_t.sub tgap ngd   ! like @nbd
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at ngd]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -5 to 5 (number of valid)
+          3.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at ngd]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -8 to -5 (number of valid)
+          1.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at ngd]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to 3 (number of valid)
+          3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at ngd]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -9 to -3 (number of valid)
+          2.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@ngd]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR (# of points)
+             T        : -11 to 11 (number of valid)
+          5.000
+ 
+GO bn_negative_t.sub tgap fav  ! like fln (fnr not implemented)
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST tgap[t=-5:5 at fav]	! neg/pos t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST tgap[t=-5:-8 at fav]	! neg/neq t endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST tgap[l=2:7 at fav]	! neg/pos l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST tgap[l=2:4 at fav]	! neg/neg l endpoints
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST tgap[l=@fav]	! unspecified limits (neg/pos)
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 11 points (T)
+ -10   /  1: -8.000
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:  8.000
+ 
+ 
+LIST tvar[t=-2.2 at itp]	! test "@itp"
+             VARIABLE : T[GT=TAX]
+             T        : -2.2 (interpolated)
+         -2.200
+ 
+ 
+! ****** test regridding ********
+ 
+! source axis
+DEFINE AXIS/t=-9:9:1 tsrc
+LET a  = t[gt=tsrc]
+ 
+! destination axis
+DEFINE AXIS/t=-10:10:2 tdst
+ 
+! regrid by various means
+LET blin = a[gt=tdst at lin]
+LET bave = a[gt=tdst at ave]
+LET basn = a[gt=tdst at asn]
+ 
+! test each of these over various ranges
+GO bn_negative_t.sub blin nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST blin[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST blin[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST blin[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST blin[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST blin[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at LIN]
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:   ....
+ 
+GO bn_negative_t.sub bave nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST bave[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 5 points (T)
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+ 4    / 8:  4.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST bave[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST bave[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST bave[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST bave[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at AVE]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.000
+ -8    /  2: -8.000
+ -6    /  3: -6.000
+ -4    /  4: -4.000
+ -2    /  5: -2.000
+ 0     /  6:  0.000
+ 2     /  7:  2.000
+ 4     /  8:  4.000
+ 6     /  9:  6.000
+ 8     / 10:  8.000
+ 10    / 11:  9.000
+ 
+GO bn_negative_t.sub basn nul
+! bn450_neg_t_trans.sub
+ 
+! support routine for bn450_negative_t.jnl
+ 
+! call as
+!   GO bn450_neg_t_sub  varname  transform
+ 
+! tvar axis runs from -10 to 10 by 1's
+ 
+LIST $1[t=-5:5@$2]	! neg/pos t endpoints
+ !-> LIST basn[t=-5:5 at nul]	! neg/pos t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 5 points (T)
+ -4   / 4: -6.000
+ -2   / 5: -5.000
+ 0    / 6: -4.000
+ 2    / 7: -3.000
+ 4    / 8: -2.000
+LIST $1[t=-5:-8@$2]	! neg/neq t endpoints
+ !-> LIST basn[t=-5:-8 at nul]	! neg/neq t endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+LIST $1[l=2:7@$2]	! neg/pos l endpoints
+ !-> LIST basn[l=2:7 at nul]	! neg/pos l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+ -4   / 4: -6.000
+ -2   / 5: -5.000
+ 0    / 6: -4.000
+ 2    / 7: -3.000
+LIST $1[l=2:4@$2]	! neg/neg l endpoints
+ !-> LIST basn[l=2:4 at nul]	! neg/neg l endpoints
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 3 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -7.000
+ -4   / 4: -6.000
+LIST $1[l=@$2]	! unspecified limits (neg/pos)
+ !-> LIST basn[l=@nul]	! unspecified limits (neg/pos)
+             VARIABLE : A[GT=TDST at ASN]
+             SUBSET   : 11 points (T)
+ -10   /  1: -9.000
+ -8    /  2: -8.000
+ -6    /  3: -7.000
+ -4    /  4: -6.000
+ -2    /  5: -5.000
+ 0     /  6: -4.000
+ 2     /  7: -3.000
+ 4     /  8: -2.000
+ 6     /  9: -1.000
+ 8     / 10:  0.000
+ 10    / 11:  1.000
+ 
+ 
+! true calendar axis
+DEFINE AXIS/t=1-jan-1980:30-jan-1980:24/UNITS=hours tcal
+! we can regrid by association
+LIST a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (TIME)
+ 01-JAN-1980 00 /  1: -9.000
+ 02-JAN-1980 00 /  2: -8.000
+ 03-JAN-1980 00 /  3: -7.000
+ 04-JAN-1980 00 /  4: -6.000
+ 05-JAN-1980 00 /  5: -5.000
+ 06-JAN-1980 00 /  6: -4.000
+ 07-JAN-1980 00 /  7: -3.000
+ 08-JAN-1980 00 /  8: -2.000
+ 09-JAN-1980 00 /  9: -1.000
+ 10-JAN-1980 00 / 10:  0.000
+ 11-JAN-1980 00 / 11:  1.000
+ 12-JAN-1980 00 / 12:  2.000
+ 13-JAN-1980 00 / 13:  3.000
+ 14-JAN-1980 00 / 14:  4.000
+ 15-JAN-1980 00 / 15:  5.000
+ 16-JAN-1980 00 / 16:  6.000
+ 17-JAN-1980 00 / 17:  7.000
+ 18-JAN-1980 00 / 18:  8.000
+ 19-JAN-1980 00 / 19:  9.000
+ 20-JAN-1980 00 / 20:   ....
+ 21-JAN-1980 00 / 21:   ....
+ 22-JAN-1980 00 / 22:   ....
+ 23-JAN-1980 00 / 23:   ....
+ 24-JAN-1980 00 / 24:   ....
+ 25-JAN-1980 00 / 25:   ....
+ 26-JAN-1980 00 / 26:   ....
+ 27-JAN-1980 00 / 27:   ....
+ 28-JAN-1980 00 / 28:   ....
+ 29-JAN-1980 00 / 29:   ....
+ 30-JAN-1980 00 / 30:   ....
+LIST/t=1-jan-1980:30-jan-1980 a[gt=tcal at asn]
+             VARIABLE : T[GT=TSRC]
+                        regrid: 24 hour on T at ASN
+             SUBSET   : 30 points (TIME)
+ 01-JAN-1980 00 /  1: -9.000
+ 02-JAN-1980 00 /  2: -8.000
+ 03-JAN-1980 00 /  3: -7.000
+ 04-JAN-1980 00 /  4: -6.000
+ 05-JAN-1980 00 /  5: -5.000
+ 06-JAN-1980 00 /  6: -4.000
+ 07-JAN-1980 00 /  7: -3.000
+ 08-JAN-1980 00 /  8: -2.000
+ 09-JAN-1980 00 /  9: -1.000
+ 10-JAN-1980 00 / 10:  0.000
+ 11-JAN-1980 00 / 11:  1.000
+ 12-JAN-1980 00 / 12:  2.000
+ 13-JAN-1980 00 / 13:  3.000
+ 14-JAN-1980 00 / 14:  4.000
+ 15-JAN-1980 00 / 15:  5.000
+ 16-JAN-1980 00 / 16:  6.000
+ 17-JAN-1980 00 / 17:  7.000
+ 18-JAN-1980 00 / 18:  8.000
+ 19-JAN-1980 00 / 19:  9.000
+ 20-JAN-1980 00 / 20:   ....
+ 21-JAN-1980 00 / 21:   ....
+ 22-JAN-1980 00 / 22:   ....
+ 23-JAN-1980 00 / 23:   ....
+ 24-JAN-1980 00 / 24:   ....
+ 25-JAN-1980 00 / 25:   ....
+ 26-JAN-1980 00 / 26:   ....
+ 27-JAN-1980 00 / 27:   ....
+ 28-JAN-1980 00 / 28:   ....
+ 29-JAN-1980 00 / 29:   ....
+ 30-JAN-1980 00 / 30:   ....
+! but any other regridding operation is nonsense
+SET MODE ignore_error
+LIST a[gt=tcal]		! deliberate error
+CANCEL MODE ignore_error
+ 
+*** Running test: bn_xact_regrid.jnl
+! BN450_xact_regrid.jnl
+ 
+! 10/97 - test "exact match" regridding
+! wherein destination points are filled only if they exactly match
+! the coordinate of the cooesponding point on the source grid
+ 
+! X axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=2:4
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=1:5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/X=1.5:4.5
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 7 points (X)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 3 points (X)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/X=0:6
+GO bn_xact_regrid.sub X
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GX=XDcoarse at XACT]! same src and dst axis
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GX=XDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : X[GX=XSCOARSE]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GX=XDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : X[GX=XSFINE]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GX=XDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETBIG]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GX=XDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : X[GX=XSOFFSETSMALL]
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 9 points (X)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GX=XDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : X[GX=XSFINEOFFSET]
+                        regrid: 1 delta on X at XACT
+             SUBSET   : 5 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Y axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=2:4
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=1:5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Y=1.5:4.5
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 7 points (Y)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 3 points (Y)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Y=0:6
+GO bn_xact_regrid.sub Y
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GY=YDcoarse at XACT]! same src and dst axis
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GY=YDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Y[GY=YSCOARSE]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GY=YDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Y[GY=YSFINE]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GY=YDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETBIG]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GY=YDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Y[GY=YSOFFSETSMALL]
+                        regrid: 0.5 delta on Y at XACT
+             SUBSET   : 9 points (Y)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GY=YDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Y[GY=YSFINEOFFSET]
+                        regrid: 1 delta on Y at XACT
+             SUBSET   : 5 points (Y)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! Z axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=2:4
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=1:5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/Z=1.5:4.5
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 7 points (Z)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 3 points (Z)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/Z=0:6
+GO bn_xact_regrid.sub Z
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GZ=ZDcoarse at XACT]! same src and dst axis
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GZ=ZDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : Z[GZ=ZSCOARSE]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GZ=ZDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : Z[GZ=ZSFINE]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GZ=ZDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETBIG]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GZ=ZDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : Z[GZ=ZSOFFSETSMALL]
+                        regrid: 0.5 delta on Z at XACT
+             SUBSET   : 9 points (Z)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GZ=ZDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : Z[GZ=ZSFINEOFFSET]
+                        regrid: 1 delta on Z at XACT
+             SUBSET   : 5 points (Z)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+! T axis tests
+CANCEL REGION
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=2:4
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=1:5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+SET REGION/T=1.5:4.5
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 7 points (T)
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 3 points (T)
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+SET REGION/T=0:6
+GO bn_xact_regrid.sub T
+! PERFORM REGRIDDINGS
+LIST Scoarse[G$1=$1Dcoarse at XACT]! same src and dst axis
+ !-> LIST Scoarse[GT=TDcoarse at XACT]! same src and dst axis
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Scoarse[G$1=$1Dfine at XACT]	! coarse data onto fine grid
+ !-> LIST Scoarse[GT=TDfine at XACT]	! coarse data onto fine grid
+             VARIABLE : T[GT=TSCOARSE]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:  1.000
+ 1.5  / 2:   ....
+ 2    / 3:  2.000
+ 2.5  / 4:   ....
+ 3    / 5:  3.000
+ 3.5  / 6:   ....
+ 4    / 7:  4.000
+ 4.5  / 8:   ....
+ 5    / 9:  5.000
+LIST Sfine[G$1=$1Dcoarse at XACT]	! fine data onto coarse grid
+ !-> LIST Sfine[GT=TDcoarse at XACT]	! fine data onto coarse grid
+             VARIABLE : T[GT=TSFINE]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+LIST Soffsetbig[G$1=$1Dfine at XACT]   ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetbig[GT=TDfine at XACT]   ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETBIG]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Soffsetsmall[G$1=$1Dfine at XACT] ! non-aligning grid points coarse to fine
+ !-> LIST Soffsetsmall[GT=TDfine at XACT] ! non-aligning grid points coarse to fine
+             VARIABLE : T[GT=TSOFFSETSMALL]
+                        regrid: 0.5 delta on T at XACT
+             SUBSET   : 9 points (T)
+ 1    / 1:   ....
+ 1.5  / 2:  1.500
+ 2    / 3:   ....
+ 2.5  / 4:  2.500
+ 3    / 5:   ....
+ 3.5  / 6:  3.500
+ 4    / 7:   ....
+ 4.5  / 8:  4.500
+ 5    / 9:   ....
+LIST Sfineoffset[G$1=$1Dcoarse at XACT]! non-aligning grid points fine to coarse
+ !-> LIST Sfineoffset[GT=TDcoarse at XACT]! non-aligning grid points fine to coarse
+             VARIABLE : T[GT=TSFINEOFFSET]
+                        regrid: 1 delta on T at XACT
+             SUBSET   : 5 points (T)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 
+ 
+*** Running test: bn_gc_functions.jnl
+! bn500_gc_functions.jnl
+ 
+! 10/97 - first version - test GC functions released in V4.9
+! 3/98 - added single test of a dynamic axis passed to GC fcn
+! Note: OFFSET VALUES NOT YET TESTED
+ 
+! 2/99 "UNRAVEL" renamed to XSEQUENCE
+! 1/00 changes to RESHAPE tests ==> "K=1" removed
+ 
+CANCEL REGION
+CANCEL VIEWPORTS
+ 
+! XSEQUENCE function
+LET v = X[x=1:4:1] + Y[Y=.1:.4:.1]
+LIST v
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 4 by 4 points (X-Y)
+              1      2      3      4    
+              1      2      3      4
+ 0.1  / 1:  1.100  2.100  3.100  4.100
+ 0.2  / 2:  1.200  2.200  3.200  4.200
+ 0.3  / 3:  1.300  2.300  3.300  4.300
+ 0.4  / 4:  1.400  2.400  3.400  4.400
+LIST SIN(v)	! preserves source grid
+             VARIABLE : SIN(V)
+             SUBSET   : 4 by 4 points (X-Y)
+              1       2       3       4     
+               1       2       3       4
+ 0.1  / 1:  0.8912  0.8632  0.0416 -0.8183
+ 0.2  / 2:  0.9320  0.8085 -0.0584 -0.8716
+ 0.3  / 3:  0.9636  0.7457 -0.1577 -0.9162
+ 0.4  / 4:  0.9854  0.6755 -0.2555 -0.9516
+LIST XSEQUENCE(v)	! replaces source grid
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 16 points (X)
+ 1    /  1:  1.100
+ 2    /  2:  2.100
+ 3    /  3:  3.100
+ 4    /  4:  4.100
+ 5    /  5:  1.200
+ 6    /  6:  2.200
+ 7    /  7:  3.200
+ 8    /  8:  4.200
+ 9    /  9:  1.300
+ 10   / 10:  2.300
+ 11   / 11:  3.300
+ 12   / 12:  4.300
+ 13   / 13:  1.400
+ 14   / 14:  2.400
+ 15   / 15:  3.400
+ 16   / 16:  4.400
+STAT v, XSEQUENCE(v)
+ 
+             X[X=1:4:1] + Y[Y=.1:.4:.1]
+             X: 0.5 to 4.5
+             Y: 0.05 to 0.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (4*4*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+             XSEQUENCE(V)
+             X: 0.5 to 16.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 16 (16*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1.1
+ Maximum value: 4.4
+ Mean    value: 2.75 (unweighted average)
+ Standard deviation: 1.1605
+ 
+! check regions specified on source and on destination
+LIST/I=3:5 XSEQUENCE(v)	! destination region
+             VARIABLE : XSEQUENCE(V)
+             SUBSET   : 3 points (X)
+ 3   / 3:  3.100
+ 4   / 4:  4.100
+ 5   / 5:  1.200
+ 
+LIST v[I=2:3,J=2:3]
+             VARIABLE : X[X=1:4:1] + Y[Y=.1:.4:.1]
+             SUBSET   : 2 by 2 points (X-Y)
+              2      3    
+              2      3
+ 0.2  / 2:  2.200  3.200
+ 0.3  / 3:  2.300  3.300
+LIST XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 4 points (X)
+ 1   / 1:  2.200
+ 2   / 2:  3.200
+ 3   / 3:  2.300
+ 4   / 4:  3.300
+LIST/I=2:3 XSEQUENCE( v[I=2:3,J=2:3] )
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] )
+             SUBSET   : 2 points (X)
+ 2   / 2:  3.200
+ 3   / 3:  2.300
+ 
+! check grid interactions where XSEQUENCE is inside of expression
+LET a = XSEQUENCE( v[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+LIST a
+             VARIABLE : XSEQUENCE( V[I=2:3,J=2:3] ) + Z[Z=.01:.02:.01]
+             SUBSET   : 4 by 2 points (X-Z)
+               1      2      3      4    
+               1      2      3      4
+ 0.01  / 1:  2.210  3.210  2.310  3.310
+ 0.02  / 2:  2.220  3.220  2.320  3.320
+ 
+! RESHAPE function
+DEFINE AXIS/X=1:4:1 x4
+DEFINE AXIS/Y=.1:.4:.1 y4
+DEFINE AXIS/Z=.01:.04:.01 z4
+DEFINE AXIS/T=.001:.004:.001 T4
+DEFINE GRID/X=x4/Y=y4/Z=z4/T=t4 g4d
+LET v4d = X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+LIST v4d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.03:.01] + T[T=.001:.003:.001]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-T)
+              1      2      3    
+              1      2      3
+ ---- L:1 T:   0.001
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.111  2.111  3.111
+ 0.2  / 2:  1.211  2.211  3.211
+ 0.3  / 3:  1.311  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.121  2.121  3.121
+ 0.2  / 2:  1.221  2.221  3.221
+ 0.3  / 3:  1.321  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.131  2.131  3.131
+ 0.2  / 2:  1.231  2.231  3.231
+ 0.3  / 3:  1.331  2.331  3.331
+ ---- L:2 T:   0.002
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.112  2.112  3.112
+ 0.2  / 2:  1.212  2.212  3.212
+ 0.3  / 3:  1.312  2.312  3.312
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.122  2.122  3.122
+ 0.2  / 2:  1.222  2.222  3.222
+ 0.3  / 3:  1.322  2.322  3.322
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.132  2.132  3.132
+ 0.2  / 2:  1.232  2.232  3.232
+ 0.3  / 3:  1.332  2.332  3.332
+ ---- L:3 T:   0.003
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.113  2.113  3.113
+ 0.2  / 2:  1.213  2.213  3.213
+ 0.3  / 3:  1.313  2.313  3.313
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.123  2.123  3.123
+ 0.2  / 2:  1.223  2.223  3.223
+ 0.3  / 3:  1.323  2.323  3.323
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.133  2.133  3.133
+ 0.2  / 2:  1.233  2.233  3.233
+ 0.3  / 3:  1.333  2.333  3.333
+LET V3d =  X[x=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]	! same size
+LIST v3d
+             VARIABLE : X[X=1:3:1] + Y[Y=.1:.3:.1] + Z[Z=.01:.09:.01]
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+              1      2      3    
+              1      2      3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.110  2.110  3.110
+ 0.2  / 2:  1.210  2.210  3.210
+ 0.3  / 3:  1.310  2.310  3.310
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.120  2.120  3.120
+ 0.2  / 2:  1.220  2.220  3.220
+ 0.3  / 3:  1.320  2.320  3.320
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.130  2.130  3.130
+ 0.2  / 2:  1.230  2.230  3.230
+ 0.3  / 3:  1.330  2.330  3.330
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.140  2.140  3.140
+ 0.2  / 2:  1.240  2.240  3.240
+ 0.3  / 3:  1.340  2.340  3.340
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.150  2.150  3.150
+ 0.2  / 2:  1.250  2.250  3.250
+ 0.3  / 3:  1.350  2.350  3.350
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.160  2.160  3.160
+ 0.2  / 2:  1.260  2.260  3.260
+ 0.3  / 3:  1.360  2.360  3.360
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.170  2.170  3.170
+ 0.2  / 2:  1.270  2.270  3.270
+ 0.3  / 3:  1.370  2.370  3.370
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.180  2.180  3.180
+ 0.2  / 2:  1.280  2.280  3.280
+ 0.3  / 3:  1.380  2.380  3.380
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.190  2.190  3.190
+ 0.2  / 2:  1.290  2.290  3.290
+ 0.3  / 3:  1.390  2.390  3.390
+LIST RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 3 by 3 by 9 points (X-Y-Z)
+              1      2      3    
+              1      2      3
+ ---- K:1 Z:   0.01
+ 0.1  / 1:  1.111  2.111  3.111
+ 0.2  / 2:  1.211  2.211  3.211
+ 0.3  / 3:  1.311  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.1  / 1:  1.121  2.121  3.121
+ 0.2  / 2:  1.221  2.221  3.221
+ 0.3  / 3:  1.321  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.1  / 1:  1.131  2.131  3.131
+ 0.2  / 2:  1.231  2.231  3.231
+ 0.3  / 3:  1.331  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.1  / 1:  1.112  2.112  3.112
+ 0.2  / 2:  1.212  2.212  3.212
+ 0.3  / 3:  1.312  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.1  / 1:  1.122  2.122  3.122
+ 0.2  / 2:  1.222  2.222  3.222
+ 0.3  / 3:  1.322  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.1  / 1:  1.132  2.132  3.132
+ 0.2  / 2:  1.232  2.232  3.232
+ 0.3  / 3:  1.332  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.1  / 1:  1.113  2.113  3.113
+ 0.2  / 2:  1.213  2.213  3.213
+ 0.3  / 3:  1.313  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.1  / 1:  1.123  2.123  3.123
+ 0.2  / 2:  1.223  2.223  3.223
+ 0.3  / 3:  1.323  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.1  / 1:  1.133  2.133  3.133
+ 0.2  / 2:  1.233  2.233  3.233
+ 0.3  / 3:  1.333  2.333  3.333
+! if source and dest grid share an axis then the region is passed to the arg
+LIST RESHAPE(v4d[i=2:3,j=2:3], v3d)		! I,J preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3], V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.232  3.232
+ 0.3  / 3:  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.213  3.213
+ 0.3  / 3:  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.223  3.223
+ 0.3  / 3:  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.233  3.233
+ 0.3  / 3:  2.333  3.333
+LIST/k=2:3 RESHAPE(v4d[i=2:3,j=2:3,k=2:3], v3d)	! K,L not preserved
+             VARIABLE : RESHAPE(V4D[I=2:3,J=2:3,K=2:3], V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+LIST/I=2:3/J=2:3  RESHAPE(v4d, v3d)
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 9 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:1 Z:   0.01
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.222  3.222
+ 0.3  / 3:  2.322  3.322
+ ---- K:6 Z:   0.06
+ 0.2  / 2:  2.232  3.232
+ 0.3  / 3:  2.332  3.332
+ ---- K:7 Z:   0.07
+ 0.2  / 2:  2.213  3.213
+ 0.3  / 3:  2.313  3.313
+ ---- K:8 Z:   0.08
+ 0.2  / 2:  2.223  3.223
+ 0.3  / 3:  2.323  3.323
+ ---- K:9 Z:   0.09
+ 0.2  / 2:  2.233  3.233
+ 0.3  / 3:  2.333  3.333
+LIST/I=2:3/J=2:3/K=2:3  RESHAPE(v4d, v3d)	! K refers to result, only
+             VARIABLE : RESHAPE(V4D, V3D)
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+LIST/I=2:3/J=2:3  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! output to a subregion in K
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 4 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:2 Z:   0.02
+ 0.2  / 2:  2.211  3.211
+ 0.3  / 3:  2.311  3.311
+ ---- K:3 Z:   0.03
+ 0.2  / 2:  2.221  3.221
+ 0.3  / 3:  2.321  3.321
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+LIST/I=2:3/J=2:3/K=4:5  RESHAPE(v4d[k=1:3], v3d[k=2:5])	! "conflicting" K specs
+             VARIABLE : RESHAPE(V4D[K=1:3], V3D[K=2:5])
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+              2      3    
+              2      3
+ ---- K:4 Z:   0.04
+ 0.2  / 2:  2.231  3.231
+ 0.3  / 3:  2.331  3.331
+ ---- K:5 Z:   0.05
+ 0.2  / 2:  2.212  3.212
+ 0.3  / 3:  2.312  3.312
+ 
+! ZAXREPLACE function
+! definitions taken from sigma_coordinate_demo.jnl 9/96 *sh*
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+define axis/x=-50:50:10/unit=km xchannel
+define axis/y=-30:30:10/unit=km yrise
+define axis/z=1:10:2/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gsigma
+ 
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gsigma]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gsigma]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+ 
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gsigma]/100
+let h0 = EXP(time_evolve*K[g=gsigma])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+ 
+! fictitious flow field:
+let flow_profile = LOG((11-K[g=gsigma]))
+let time_ramp = 1 + L[g=gsigma]/20 + 0.2*SIN((L[g=gsigma]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+ 
+! ----------------------
+! "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+ 
+! Desired result axes - depth in meters
+define axis/depth/z=0:200:50/units=meters z50m
+define axis/depth/z=0:200:20/units=meters z20m
+define axis/depth/z=0:200:2/units=meters z2m
+ 
+LIST/x=0/l=1 flow
+             VARIABLE : non-physical flow field
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+             -30    -20    -10     0     10     20     30    
+              1      2      3      4      5      6      7
+ 1    / 1:  220.8  252.0  293.5  315.0  293.5  252.0  220.8
+ 3    / 2:  210.7  240.5  280.1  300.6  280.1  240.5  210.7
+ 5    / 3:  199.4  227.6  265.1  284.5  265.1  227.6  199.4
+ 7    / 4:  186.6  213.0  248.0  266.2  248.0  213.0  186.6
+ 9    / 5:  171.8  196.1  228.4  245.1  228.4  196.1  171.8
+ 11   / 6:  154.3  176.1  205.2  220.2  205.2  176.1  154.3
+LIST/x=0/l=1 depth
+             VARIABLE : DEPTH function (meters)
+             SUBSET   : 7 by 6 points (Y (KM)-Z (LAYER))
+             X (KM)   : 0
+             T (HOURS): 1
+             -30    -20    -10     0     10     20     30    
+              1      2      3      4      5      6      7
+ 1    / 1:   15.5   13.5   11.6   10.8   11.6   13.5   15.5
+ 3    / 2:   46.5   40.8   35.0   32.6   35.0   40.8   46.5
+ 5    / 3:   77.9   68.3   58.6   54.6   58.6   68.3   77.9
+ 7    / 4:  109.6   96.0   82.5   76.8   82.5   96.0  109.6
+ 9    / 5:  141.6  124.1  106.5   99.3  106.5  124.1  141.6
+ 11   / 6:  174.0  152.4  130.9  121.9  130.9  152.4  174.0
+set view ul
+shade/x=0/l=1/lev=30 flow
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z50m])
+!LIST/x=0/l=1 ZAXREPLACE(flow,depth,z[gz=z20m])
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z50m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z50M])
+             SUBSET   : 7 by 5 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+               -30    -20    -10     0     10     20     30    
+                1      2      3      4      5      6      7
+ 0      / 1:   ....   ....   ....   ....   ....   ....   ....
+ 50     / 2:  209.4  236.1  270.5  287.9  270.5  236.1  209.4
+ 100    / 3:  190.5  210.6  233.7  244.3  233.7  210.6  190.5
+ 150    / 4:  167.3  177.9   ....   ....   ....  177.9  167.3
+ 200    / 5:   ....   ....   ....   ....   ....   ....   ....
+LIST/x=0/l=1 ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+             VARIABLE : ZAXREPLACE(FLOW[Z=0:200],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30    -20    -10     0     10     20     30    
+                 1      2      3      4      5      6      7
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....
+ 20     /  2:  219.3  249.3  288.7  308.9  288.7  249.3  219.3
+ 40     /  3:  212.8  240.8  276.9  295.2  276.9  240.8  212.8
+ 60     /  4:  205.8  231.5  264.1  280.0  264.1  231.5  205.8
+ 80     /  5:  198.5  221.4  249.8  263.2  249.8  221.4  198.5
+ 100    /  6:  190.5  210.6  233.7  244.3  233.7  210.6  190.5
+ 120    /  7:  181.8  198.6  215.5  222.3  215.5  198.6  181.8
+ 140    /  8:  172.6  184.9   ....   ....   ....  184.9  172.6
+ 160    /  9:  161.9   ....   ....   ....   ....   ....  161.9
+ 180    / 10:   ....   ....   ....   ....   ....   ....   ....
+ 200    / 11:   ....   ....   ....   ....   ....   ....   ....
+ 
+set view ur
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+ 
+! how do the layers get distributed?
+!LET Kflow  = ZAXREPLACE(flow,depth,z[gz=z20m])
+!LET Kdepth = ZAXREPLACE(k[g=gsigma],depth,z[gz=z20m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z20m])
+LET Kdepth = ZAXREPLACE(k[z=0:200,g=gsigma],depth[z=0:200],z[gz=z20m])
+LIST/x=0/l=1 Kdepth
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 by 11 points (Y (KM)-DEPTH (m))
+             X (KM)   : 0
+             T (HOURS): 1
+                -30    -20    -10     0     10     20     30    
+                 1      2      3      4      5      6      7
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....
+ 20     /  2:  1.146  1.237  1.358  1.421  1.358  1.237  1.146
+ 40     /  3:  1.790  1.972  2.212  2.336  2.212  1.972  1.790
+ 60     /  4:  2.429  2.699  3.058  3.242  3.058  2.699  2.429
+ 80     /  5:  3.066  3.422  3.897  4.141  3.897  3.422  3.066
+ 100    /  6:  3.696  4.141  4.728  5.032  4.728  4.141  3.696
+ 120    /  7:  4.324  4.854  5.553  5.914  5.553  4.854  4.324
+ 140    /  8:  4.949  5.561   ....   ....   ....  5.561  4.949
+ 160    /  9:  5.568   ....   ....   ....   ....   ....  5.568
+ 180    / 10:   ....   ....   ....   ....   ....   ....   ....
+ 200    / 11:   ....   ....   ....   ....   ....   ....   ....
+LIST/x=0/l=1 Kdepth[k=@max]
+             VARIABLE : ZAXREPLACE(K[Z=0:200,G=GSIGMA],DEPTH[Z=0:200],Z[GZ=Z20M])
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             DEPTH (m): -10 to 210 (maximum)
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  5.568
+ -20   / 2:  5.561
+ -10   / 3:  5.553
+ 0     / 4:  5.914
+ 10    / 5:  5.553
+ 20    / 6:  5.561
+ 30    / 7:  5.568
+ 
+! mark deepest layer with a zero
+LET K0 = Kdepth - Kdepth[K=@max]
+LET Kkernel = K0[K=@WEQ] * Kflow
+ 
+! compare flow at bottom
+LET Z10_flow = flow[Z=10]
+LIST/x=0/l=1 Z10_flow		! bottom layer in layered version
+             VARIABLE : FLOW[Z=10]
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  171.8
+ -20   / 2:  196.1
+ -10   / 3:  228.4
+ 0     / 4:  245.1
+ 10    / 5:  228.4
+ 20    / 6:  196.1
+ 30    / 7:  171.8
+ 
+LET bottom_flow = Kkernel[z=0:200 at sum]
+!message LIST/x=0/l=1 Kkernel[z=0:200]	! crash!!!
+!message LIST/x=0/l=1 bottom_flow	! deepest flow in depth version
+!message
+ 
+! error using 20 meter depth resolution
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:   9.92
+ -20   / 2:  11.20
+ -10   / 3:  12.85
+ 0     / 4:  22.80
+ 10    / 5:  12.85
+ 20    / 6:  11.20
+ 30    / 7:   9.92
+ 
+! reduced error using 2 meter depth resolution
+set view ll
+shade/x=0/l=1/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kflow  = ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[gz=z2m])
+LET Kdepth = ZAXREPLACE(k[g=gsigma,z=0:200],depth[z=0:200],z[gz=z2m])
+LIST/x=0/l=1 Z10_flow - bottom_flow
+             VARIABLE : Z10_FLOW - BOTTOM_FLOW
+             SUBSET   : 7 points (Y (KM))
+             X (KM)   : 0
+             Z (LAYER): 9
+             T (HOURS): 1
+               0    
+               6
+ -30   / 1:  16.41
+ -20   / 2:  19.65
+ -10   / 3:  22.41
+ 0     / 4:  22.80
+ 10    / 5:  22.41
+ 20    / 6:  19.65
+ 30    / 7:  16.41
+ 
+! dynamic axis passes to GC function -- 1 meter resolution (3/98)
+set view lr
+shade/x=0/l=1/ylim=0:200:-20/lev ZAXREPLACE(flow[z=0:200],depth[z=0:200],z[z=0:200:.5])
+*** Running test: bn491_bug_fixes.jnl
+! bn491_bug_fixes.jnl
+! test various fixes that went into version 4.91
+! 2/98 *kob*
+!
+! 3/98 - replaced err490_repeat w/ err490_repeat_first_echo - simpler test
+! 3/98 - *kob* removed err490_tilde because it was a silly test.  some systems
+!         allowed use of go "~/xx" and others didnt.
+! 4/98 - added err491_asn.jnl - regrid by association problem
+! 4/98 - added err491_attrib_dp.jnl - problem w/ double precision attributes
+ 
+set mode/last verify
+********File successfully written******
+****Variable defined successfully******
+ 
+             T
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 15
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 15
+ Maximum value: 15
+ Mean    value: 15 (unweighted average)
+define axis/t=1-jan-1980:1-jan-1981:1/units=days tax
+repeat/t=1-jan-1980:2-jan-1980:24 stat t[gt=tax]
+!-> REPEAT: T=-6.2483E+10
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 01-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28840
+ Maximum value: 28840
+ Mean    value: 28840 (unweighted average)
+!-> REPEAT: T=02-JAN-1980 00:00:00
+ 
+             T
+             axis TAX
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             TIME: 02-JAN-1980 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 28841
+ Maximum value: 28841
+ Mean    value: 28841 (unweighted average)
+ 
+message/cont Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+Note: THE ECHO-ONE REPEAT BUG HAS NOT BEEN FIXED
+ 
+! fixed variable size
+!GO bn_reset
+GO err490_fixed_var_size
+! 1/2/98 *sh*
+ 
+! Situation: the component (variable) size is fixed in the definition.
+! The requested result size is separately specified
+! by a command qualifier. Leads to a crash.
+ 
+! The "doo" transformations (convolve.F, do_run_sum_sub.F, etc. ) are guided
+! by the size of the component rather than the size of the result.
+! (Under other circumstances this is to allow "bad edges" to be filled in
+! when the component is too small for the result.)
+ 
+! In IS_TRANS we need to catch this problem and avoid it ...
+! but it is fraught with pitfalls as it involves changing the apparent
+! component (cx) size passed into IS_TRANS (normally considered read-only)
+! Further, Ferret regards the result as self-describing on this axis
+! (uvar_gvn<uvlim_gvn_xact) so exact limits are not checked when looking in
+! cache. Since we are violating the assumption of self-describing we need to
+! un-cache the result.
+!  ==> THE FIX IS IS A KLUDGE: The "right" solution is that the full limits
+!	of the variable should be computed and the requested limits used to
+!	clip the result. But this would be costly in memory xxxxx
+!	should never get applied to cx ... but this is too difficult to
+!	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+ 
+ 
+!set mode diag - removed *sh* 10/99
+ 
+let vx = SIN(X[X=1:60:1])
+stat vx
+ 
+             SIN(X[X=1:60:1])
+             X: 0.5 to 60.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 60 (60*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -0.99999
+ Maximum value: 0.99991
+ Mean    value: 0.027242 (unweighted average)
+ Standard deviation: 0.71199
+list/i=13:18 vx[x=@sbx:3]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.2914
+ 14   / 14:  0.6870
+ 15   / 15:  0.4510
+ 16   / 16: -0.1997
+ 17   / 17: -0.6668
+ 18   / 18: -0.5208
+list/i=13:18 vx[x=@rsum]	! CRASH in V4.90
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 6 points (X)
+ 13   / 13:  0.420
+ 14   / 14:  1.411
+ 15   / 15:  2.061
+ 16   / 16:  1.773
+ 17   / 17:  0.812
+ 18   / 18:  0.061
+ 
+list/i=11:20 vx[x=@sbx:3]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        box smoothed by 3 pts on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -0.6935
+ 12   / 12: -0.3721
+ 13   / 13:  0.2914
+ 14   / 14:  0.6870
+ 15   / 15:  0.4510
+ 16   / 16: -0.1997
+ 17   / 17: -0.6668
+ 18   / 18: -0.5208
+ 19   / 19:  0.1039
+ 20   / 20:  0.6332
+list/i=11:20 vx[x=@rsum]	! wrong result if pulled from cache
+             VARIABLE : SIN(X[X=1:60:1])
+                        running sum on X
+             SUBSET   : 10 points (X)
+ 11   / 11: -1.000
+ 12   / 12: -1.537
+ 13   / 13: -1.116
+ 14   / 14: -0.126
+ 15   / 15:  0.524
+ 16   / 16:  0.237
+ 17   / 17: -0.725
+ 18   / 18: -1.476
+ 19   / 19: -1.326
+ 20   / 20: -0.413
+ 
+! now test a special problem that can occur with filling transforms --
+! special because in IS_TRANS they require OFFSETS but do not require filling
+! "bad edges" in the result
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+LET tgap = IF MOD(T,4) eq 0 then  tvar
+list tgap
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+             SUBSET   : 11 points (T)
+ -10   /  1:   ....
+ -8    /  2: -8.000
+ -6    /  3:   ....
+ -4    /  4: -4.000
+ -2    /  5:   ....
+ 0     /  6:  0.000
+ 2     /  7:   ....
+ 4     /  8:  4.000
+ 6     /  9:   ....
+ 8     / 10:  8.000
+ 10    / 11:   ....
+list tgap[l=2:7 at fav]    ! value at L=7 should be 2
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 6 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ -4   / 4: -4.000
+ -2   / 5: -2.000
+ 0    / 6:  0.000
+ 2    / 7:  2.000
+list tgap[t=-5:-8 at fav]  ! value at T=-6 should be -6
+             VARIABLE : IF MOD(T,4) EQ 0 THEN  TVAR
+                        ave-filled by 3 pts on T
+             SUBSET   : 2 points (T)
+ -8   / 2: -8.000
+ -6   / 3: -6.000
+ 
+! l=@ave compression failure
+GO bn_reset
+cancel mode verify
+GO err490_l_ave.jnl
+! err490_lave.jnl 12/1/97 - *sh* (reported by Weimin Wang)
+! L=@AVE is failing to compress to a point
+ 
+! 2/28/97:
+! bug from this script re-emerged 2/98 after change to MERGE_GRID
+! (see err491_explicit_limits.jnl)
+! This time it was fixed in MERGE_GRID by correcting inconsistent use of
+! the variable expl_com_lim
+ 
+! 12/97: ---------------------
+! ==> fixed  in IS_GRID_MODE with more thorough initialization
+!  probably was introduced with changes to is-uvar_grid and merge_grid
+! when GCF functions were introduced
+ 
+! the bug was introduced between ferret_c_pre_10jan (created Dec. 19 '96)
+! and ferret_c_passed_bench (created Jan 22  1997). This is when the GCF
+! changes were made
+ 
+! tracing the problem (axis T):
+!  in IS_TRANS the bad case enters with cx_hi_ww(cx=6)=91369
+!	       the successful case with it set BAD
+!			==> result is that T axis doesn't get fleshed out
+ 
+! IS_TRANS gets the cx=6 value from IS_ALGEBRA's call to GET_VAR_CONTEXT
+ 
+! In turn this gets it from cx=4 which is set early in INTERP_STACK (dflt_cx)
+ 
+! INTERP_STACK works correctly when uvar_given(4,ex#1)=-1 ("uvlim_irrelevant")
+! ==> for some reason uvar_given(4,ex#1) is 7 (uvlim_needed) in the bad case
+ 
+! ... need to look in is_uvar_grid and esp. merge_grid
+! ---------------------------
+! *kob* 3/98 - modifed to use coads_vwnd.cdf data set.  this is a local data
+!              set (ie, it resides in the bench area).  this was important for
+!	        benchmarking the sgi version (on cyborg and vikenty) because
+!		not all tmap disks were available.
+ 
+cancel memory/all
+!set mode diag ! removed *sh* 10/99
+ 
+! *kob* set data coads
+set data coads_vwnd
+ 
+set region/x=160w/y=40n
+set region/l=1:50
+ 
+! 12/97: this works OK -- a single point ... with value of zero!
+! 2/98: now it gets a list of values, where the first one, only is correct
+let tseries =  vwnd[l=1:50]
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+! this gets a list of values!
+cancel memory/all
+load tseries
+list tseries[l=@ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+! and finally a crash ...
+list/l=1 tseries[l=1:50 at ave]
+             VARIABLE : VWND[L=1:50]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             TIME     : 01-JAN-1946 00:00 to 01-MAR-1950 00:00 (averaged)
+          2.193
+ 
+quit
+ 
+! neg time axis grid failure
+GO bn_reset
+cancel mode verify
+GO err490_neg_time_show_grid.jnl
+! err490_neg_time_show_grid
+ 
+! V4.9 fails to show the invividual grid points, so the below request would
+! only show column headings, but no data.  make sure data is there
+ 
+set data gtsa056_2
+show grid/t=15-JAN-1982:15-JAN-1983 temp
+    GRID PS3DT1
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME               168mr   15-JAN-1982 14:00    07-JUN-1983 13:00
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (hour)
+       1>  15-JAN-1982 14:00:00  73         14-JAN-1982 01:30:00    52632
+       2>  18-JAN-1982 15:00:00  73         17-JAN-1982 02:30:00    52705
+       3>  21-JAN-1982 16:00:00  73         20-JAN-1982 03:30:00    52778
+       4>  24-JAN-1982 17:00:00  73         23-JAN-1982 04:30:00    52851
+       5>  27-JAN-1982 18:00:00  73         26-JAN-1982 05:30:00    52924
+       6>  30-JAN-1982 19:00:00  73         29-JAN-1982 06:30:00    52997
+       7>  02-FEB-1982 20:00:00  73         01-FEB-1982 07:30:00    53070
+       8>  05-FEB-1982 21:00:00  73         04-FEB-1982 08:30:00    53143
+       9>  08-FEB-1982 22:00:00  73         07-FEB-1982 09:30:00    53216
+      10>  11-FEB-1982 23:00:00  73         10-FEB-1982 10:30:00    53289
+      11>  15-FEB-1982 00:00:00  73         13-FEB-1982 11:30:00    53362
+      12>  18-FEB-1982 01:00:00  73         16-FEB-1982 12:30:00    53435
+      13>  21-FEB-1982 02:00:00  73         19-FEB-1982 13:30:00    53508
+      14>  24-FEB-1982 03:00:00  73         22-FEB-1982 14:30:00    53581
+      15>  27-FEB-1982 04:00:00  73         25-FEB-1982 15:30:00    53654
+      16>  02-MAR-1982 05:00:00  73         28-FEB-1982 16:30:00    53727
+      17>  05-MAR-1982 06:00:00  73         03-MAR-1982 17:30:00    53800
+      18>  08-MAR-1982 07:00:00  73         06-MAR-1982 18:30:00    53873
+      19>  11-MAR-1982 08:00:00  73         09-MAR-1982 19:30:00    53946
+      20>  14-MAR-1982 09:00:00  73         12-MAR-1982 20:30:00    54019
+      21>  17-MAR-1982 10:00:00  73         15-MAR-1982 21:30:00    54092
+      22>  20-MAR-1982 11:00:00  73         18-MAR-1982 22:30:00    54165
+      23>  23-MAR-1982 12:00:00  73         21-MAR-1982 23:30:00    54238
+      24>  26-MAR-1982 13:00:00  73         25-MAR-1982 00:30:00    54311
+      25>  29-MAR-1982 14:00:00  73         28-MAR-1982 01:30:00    54384
+      26>  01-APR-1982 15:00:00  73         31-MAR-1982 02:30:00    54457
+      27>  04-APR-1982 16:00:00  73         03-APR-1982 03:30:00    54530
+      28>  07-APR-1982 17:00:00  73         06-APR-1982 04:30:00    54603
+      29>  10-APR-1982 18:00:00  73         09-APR-1982 05:30:00    54676
+      30>  13-APR-1982 19:00:00  73         12-APR-1982 06:30:00    54749
+      31>  16-APR-1982 20:00:00  73         15-APR-1982 07:30:00    54822
+      32>  19-APR-1982 21:00:00  73         18-APR-1982 08:30:00    54895
+      33>  22-APR-1982 22:00:00  73         21-APR-1982 09:30:00    54968
+      34>  25-APR-1982 23:00:00  73         24-APR-1982 10:30:00    55041
+      35>  29-APR-1982 00:00:00  73         27-APR-1982 11:30:00    55114
+      36>  02-MAY-1982 01:00:00  73         30-APR-1982 12:30:00    55187
+      37>  05-MAY-1982 02:00:00  73         03-MAY-1982 13:30:00    55260
+      38>  08-MAY-1982 03:00:00  73         06-MAY-1982 14:30:00    55333
+      39>  11-MAY-1982 04:00:00  73         09-MAY-1982 15:30:00    55406
+      40>  14-MAY-1982 05:00:00  73         12-MAY-1982 16:30:00    55479
+      41>  17-MAY-1982 06:00:00  73         15-MAY-1982 17:30:00    55552
+      42>  20-MAY-1982 07:00:00  73         18-MAY-1982 18:30:00    55625
+      43>  23-MAY-1982 08:00:00  73         21-MAY-1982 19:30:00    55698
+      44>  26-MAY-1982 09:00:00  73         24-MAY-1982 20:30:00    55771
+      45>  29-MAY-1982 10:00:00  73         27-MAY-1982 21:30:00    55844
+      46>  01-JUN-1982 11:00:00  73         30-MAY-1982 22:30:00    55917
+      47>  04-JUN-1982 12:00:00  73         02-JUN-1982 23:30:00    55990
+      48>  07-JUN-1982 13:00:00  73         06-JUN-1982 00:30:00    56063
+      49>  10-JUN-1982 14:00:00  73         09-JUN-1982 01:30:00    56136
+      50>  13-JUN-1982 15:00:00  73         12-JUN-1982 02:30:00    56209
+      51>  16-JUN-1982 16:00:00  73         15-JUN-1982 03:30:00    56282
+      52>  19-JUN-1982 17:00:00  73         18-JUN-1982 04:30:00    56355
+      53>  22-JUN-1982 18:00:00  73         21-JUN-1982 05:30:00    56428
+      54>  25-JUN-1982 19:00:00  73         24-JUN-1982 06:30:00    56501
+      55>  28-JUN-1982 20:00:00  73         27-JUN-1982 07:30:00    56574
+      56>  01-JUL-1982 21:00:00  73         30-JUN-1982 08:30:00    56647
+      57>  04-JUL-1982 22:00:00  73         03-JUL-1982 09:30:00    56720
+      58>  07-JUL-1982 23:00:00  73         06-JUL-1982 10:30:00    56793
+      59>  11-JUL-1982 00:00:00  73         09-JUL-1982 11:30:00    56866
+      60>  14-JUL-1982 01:00:00  73         12-JUL-1982 12:30:00    56939
+      61>  17-JUL-1982 02:00:00  73         15-JUL-1982 13:30:00    57012
+      62>  20-JUL-1982 03:00:00  73         18-JUL-1982 14:30:00    57085
+      63>  23-JUL-1982 04:00:00  73         21-JUL-1982 15:30:00    57158
+      64>  26-JUL-1982 05:00:00  73         24-JUL-1982 16:30:00    57231
+      65>  29-JUL-1982 06:00:00  73         27-JUL-1982 17:30:00    57304
+      66>  01-AUG-1982 07:00:00  73         30-JUL-1982 18:30:00    57377
+      67>  04-AUG-1982 08:00:00  73         02-AUG-1982 19:30:00    57450
+      68>  07-AUG-1982 09:00:00  73         05-AUG-1982 20:30:00    57523
+      69>  10-AUG-1982 10:00:00  73         08-AUG-1982 21:30:00    57596
+      70>  13-AUG-1982 11:00:00  73         11-AUG-1982 22:30:00    57669
+      71>  16-AUG-1982 12:00:00  73         14-AUG-1982 23:30:00    57742
+      72>  19-AUG-1982 13:00:00  73         18-AUG-1982 00:30:00    57815
+      73>  22-AUG-1982 14:00:00  73         21-AUG-1982 01:30:00    57888
+      74>  25-AUG-1982 15:00:00  73         24-AUG-1982 02:30:00    57961
+      75>  28-AUG-1982 16:00:00  73         27-AUG-1982 03:30:00    58034
+      76>  31-AUG-1982 17:00:00  73         30-AUG-1982 04:30:00    58107
+      77>  03-SEP-1982 18:00:00  73         02-SEP-1982 05:30:00    58180
+      78>  06-SEP-1982 19:00:00  73         05-SEP-1982 06:30:00    58253
+      79>  09-SEP-1982 20:00:00  73         08-SEP-1982 07:30:00    58326
+      80>  12-SEP-1982 21:00:00  73         11-SEP-1982 08:30:00    58399
+      81>  15-SEP-1982 22:00:00  73         14-SEP-1982 09:30:00    58472
+      82>  18-SEP-1982 23:00:00  73         17-SEP-1982 10:30:00    58545
+      83>  22-SEP-1982 00:00:00  73         20-SEP-1982 11:30:00    58618
+      84>  25-SEP-1982 01:00:00  73         23-SEP-1982 12:30:00    58691
+      85>  28-SEP-1982 02:00:00  73         26-SEP-1982 13:30:00    58764
+      86>  01-OCT-1982 03:00:00  73         29-SEP-1982 14:30:00    58837
+      87>  04-OCT-1982 04:00:00  73         02-OCT-1982 15:30:00    58910
+      88>  07-OCT-1982 05:00:00  73         05-OCT-1982 16:30:00    58983
+      89>  10-OCT-1982 06:00:00  73         08-OCT-1982 17:30:00    59056
+      90>  13-OCT-1982 07:00:00  73         11-OCT-1982 18:30:00    59129
+      91>  16-OCT-1982 08:00:00  73         14-OCT-1982 19:30:00    59202
+      92>  19-OCT-1982 09:00:00  73         17-OCT-1982 20:30:00    59275
+      93>  22-OCT-1982 10:00:00  73         20-OCT-1982 21:30:00    59348
+      94>  25-OCT-1982 11:00:00  73         23-OCT-1982 22:30:00    59421
+      95>  28-OCT-1982 12:00:00  73         26-OCT-1982 23:30:00    59494
+      96>  31-OCT-1982 13:00:00  73         30-OCT-1982 00:30:00    59567
+      97>  03-NOV-1982 14:00:00  73         02-NOV-1982 01:30:00    59640
+      98>  06-NOV-1982 15:00:00  73         05-NOV-1982 02:30:00    59713
+      99>  09-NOV-1982 16:00:00  73         08-NOV-1982 03:30:00    59786
+     100>  12-NOV-1982 17:00:00  73         11-NOV-1982 04:30:00    59859
+     101>  15-NOV-1982 18:00:00  73         14-NOV-1982 05:30:00    59932
+     102>  18-NOV-1982 19:00:00  73         17-NOV-1982 06:30:00    60005
+     103>  21-NOV-1982 20:00:00  73         20-NOV-1982 07:30:00    60078
+     104>  24-NOV-1982 21:00:00  73         23-NOV-1982 08:30:00    60151
+     105>  27-NOV-1982 22:00:00  73         26-NOV-1982 09:30:00    60224
+     106>  30-NOV-1982 23:00:00  73         29-NOV-1982 10:30:00    60297
+     107>  04-DEC-1982 00:00:00  73         02-DEC-1982 11:30:00    60370
+     108>  07-DEC-1982 01:00:00  73         05-DEC-1982 12:30:00    60443
+     109>  10-DEC-1982 02:00:00  73         08-DEC-1982 13:30:00    60516
+     110>  13-DEC-1982 03:00:00  73         11-DEC-1982 14:30:00    60589
+     111>  16-DEC-1982 04:00:00  73         14-DEC-1982 15:30:00    60662
+     112>  19-DEC-1982 05:00:00  73         17-DEC-1982 16:30:00    60735
+     113>  22-DEC-1982 06:00:00  73         20-DEC-1982 17:30:00    60808
+     114>  25-DEC-1982 07:00:00  73         23-DEC-1982 18:30:00    60881
+     115>  28-DEC-1982 08:00:00  73         26-DEC-1982 19:30:00    60954
+     116>  31-DEC-1982 09:00:00  73         29-DEC-1982 20:30:00    61027
+     117>  03-JAN-1983 10:00:00  73         01-JAN-1983 21:30:00    61100
+     118>  06-JAN-1983 11:00:00  73         04-JAN-1983 22:30:00    61173
+     119>  09-JAN-1983 12:00:00  73         07-JAN-1983 23:30:00    61246
+     120>  12-JAN-1983 13:00:00  73         11-JAN-1983 00:30:00    61319
+     121>  15-JAN-1983 14:00:00  73         14-JAN-1983 01:30:00    61392
+ 
+ 
+!explicit limit problem
+GO bn_reset
+cancel mode verify
+GO err491_explicit_limits.jnl
+! err491_explicit_limits
+! 2/98 *sh*
+! bugs reported by Mark Wetzler and Mike Knezevitch
+ 
+! ferret was assigning uvar_given = uvlim_irrelevant to axes of uvars where
+! the limits were given in square brackets.
+ 
+! fixed by change in MERGE_GRID (2/23/98)
+ 
+! Note that the repair caused a bug in err490_l_ave to re-emerge. That bug
+! was fixed through a further repair to MERGE_GRID (2/28/98)
+ 
+!SET MODE DIAGNOSTIC - removed *sh* 10/99
+ 
+! Wetzler bug
+! @AVE is ignored -- size of result on X is 5 points instead of 1
+let p = i[i=1:5]
+let q = i[i=1:5]
+let pq = p*q
+stat pq[i=@ave]
+ 
+             P*Q
+             X: 0.5 to 5.5 (averaged)
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 11
+ Maximum value: 11
+ Mean    value: 11 (unweighted average)
+ 
+! Knezevitch bug
+! causes crash in nest_region_class.F
+let timestamp = DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+list timestamp[i=1:1]
+             VARIABLE : DAYS1900(1998,02,23) - DAYS1900(1998,02,1)
+          22.00
+ 
+ 
+ 
+ 
+!regridding by association problem  *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_asn.jnl
+! err491_asn.jnl 4/98 *sh* (extracted from bug reported by Jennifer Adams)
+! Ferret crashes on regridding by association where destination
+! axis does not overlap the input subscript range at all
+ 
+! fixed with repair to RECVD_REGRID
+ 
+!set mode diag - removed *sh* 10/99
+set mode ignore	! added for benchmark suite...
+ 
+let test = y[y=101:200:1]
+let test2 = test[y=151:200]	! defined on 151:200
+ 
+define axis/y=1:50:1 y50
+list test2[gy=y50 at asn]		! request association onto 1:50
+             VARIABLE : TEST[Y=151:200]
+                        regrid: 1 delta on Y at ASN
+             SUBSET   : 50 points (Y)
+ 1    /  1:....
+ 2    /  2:....
+ 3    /  3:....
+ 4    /  4:....
+ 5    /  5:....
+ 6    /  6:....
+ 7    /  7:....
+ 8    /  8:....
+ 9    /  9:....
+ 10   / 10:....
+ 11   / 11:....
+ 12   / 12:....
+ 13   / 13:....
+ 14   / 14:....
+ 15   / 15:....
+ 16   / 16:....
+ 17   / 17:....
+ 18   / 18:....
+ 19   / 19:....
+ 20   / 20:....
+ 21   / 21:....
+ 22   / 22:....
+ 23   / 23:....
+ 24   / 24:....
+ 25   / 25:....
+ 26   / 26:....
+ 27   / 27:....
+ 28   / 28:....
+ 29   / 29:....
+ 30   / 30:....
+ 31   / 31:....
+ 32   / 32:....
+ 33   / 33:....
+ 34   / 34:....
+ 35   / 35:....
+ 36   / 36:....
+ 37   / 37:....
+ 38   / 38:....
+ 39   / 39:....
+ 40   / 40:....
+ 41   / 41:....
+ 42   / 42:....
+ 43   / 43:....
+ 44   / 44:....
+ 45   / 45:....
+ 46   / 46:....
+ 47   / 47:....
+ 48   / 48:....
+ 49   / 49:....
+ 50   / 50:....
+ 
+!list/y=1:50 test2[gy=y50 at asn]		! same misbehavior and crash
+ 
+cancel mode ignore	! added for benchmark suite...
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+exit/script
+ 
+!double precision attribute problem *kob* 4/98
+GO bn_reset
+cancel mode verify
+GO err491_attrib_dp.jnl
+! err491_attrib_dp.jnl
+! kob  4/23/98
+ 
+! bug reported by  Donald S. Dunbar 4/21/98
+!
+! there was a difference in behavior between v445 and v491.  the problem was
+! that between the versions, a bug was introduced into cd_get_attval.F
+! which caused invalid values to be used if an attribute contained double
+! precision values.  the lines below read in a small sample of DD's cdf file
+! and list the variable elev. values should be around 2-3.
+!
+! routine modifed:  fmt/src/cd_get_attval.F
+ 
+ 
+use err491_attval.cdf
+list elev
+             VARIABLE : Surface elevation (meter)
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 35 by 127 points (LONGITUDE-LATITUDE)
+             T (day)  : 1.7837
+      ... listing every   3th point
+                  135.5W 135.5W 135.4W 135.4W 135.3W 135.3W 135.3W 135.2W 135.2W 135.1W 135.1W 135.1W 
+                    1      4      7     10     13     16     19     22     25     28     31     34
+ 59.4667N / 127:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4599N / 126:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.453N  / 125:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4462N / 124:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.976   ....
+ 59.4394N / 123:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4325N / 122:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4257N / 121:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.4189N / 120:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.412N  / 119:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.4052N / 118:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3983N / 117:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3915N / 116:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.975   ....   ....
+ 59.3846N / 115:   ....   ....   ....   ....   ....   ....   ....   ....   ....  2.976   ....   ....
+ 59.3778N / 114:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3709N / 113:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3641N / 112:   ....   ....   ....   ....   ....   ....   ....   ....  2.986   ....   ....   ....
+ 59.3572N / 111:   ....   ....   ....   ....   ....   ....   ....   ....  2.988   ....   ....   ....
+ 59.3504N / 110:   ....   ....   ....   ....   ....   ....   ....   ....  2.988   ....   ....   ....
+ 59.3435N / 109:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3366N / 108:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 59.3298N / 107:   ....   ....   ....   ....   ....   ....   ....  2.986   ....   ....   ....   ....
+ 59.3229N / 106:   ....   ....   ....   ....  2.990   ....   ....  2.987   ....   ....   ....   ....
+ 59.3161N / 105:   ....   ....   ....   ....  2.989   ....   ....  2.986   ....   ....   ....   ....
+ 59.3092N / 104:   ....   ....   ....   ....  2.988   ....  2.984  2.985   ....   ....   ....   ....
+ 59.3023N / 103:   ....   ....   ....   ....   ....  2.984  2.983  2.984   ....   ....   ....   ....
+ 59.2955N / 102:   ....   ....   ....   ....   ....  2.983   ....  2.983   ....   ....   ....   ....
+ 59.2886N / 101:   ....  2.999   ....   ....   ....  2.983  2.981  2.981   ....   ....   ....   ....
+ 59.2817N / 100:   ....   ....  2.990   ....   ....   ....  2.981   ....   ....   ....   ....   ....
+ 59.2748N /  99:   ....   ....  2.991   ....   ....  2.985  2.980   ....   ....   ....   ....   ....
+ 59.268N  /  98:   ....   ....  2.993   ....   ....  2.985  2.980   ....   ....   ....   ....   ....
+ 59.2611N /  97:   ....   ....  2.996   ....   ....   ....  2.980   ....   ....   ....   ....   ....
+ 59.2542N /  96:   ....   ....  2.996  3.001   ....   ....  2.981   ....   ....   ....   ....   ....
+ 59.2473N /  95:   ....   ....  2.996  2.999   ....  2.984  2.987   ....   ....   ....   ....   ....
+ 59.2405N /  94:   ....   ....   ....  2.998   ....  2.986  2.993   ....   ....   ....   ....   ....
+ 59.2336N /  93:   ....   ....   ....  2.996  2.996  2.986  2.993   ....   ....   ....   ....   ....
+ 59.2267N /  92:   ....   ....   ....  2.994  2.995   ....  2.996  2.996   ....   ....   ....   ....
+ 59.2198N /  91:   ....   ....   ....  2.992  2.993   ....  2.996  2.997   ....   ....   ....   ....
+ 59.2129N /  90:   ....   ....   ....  2.990  2.992   ....  2.996  2.998   ....   ....   ....   ....
+ 59.2061N /  89:   ....   ....   ....  2.990  2.992   ....  2.994  2.997   ....   ....   ....   ....
+ 59.1992N /  88:   ....   ....   ....  2.990  2.992   ....   ....  2.994   ....   ....   ....   ....
+ 59.1923N /  87:   ....   ....   ....   ....  2.992   ....   ....  2.990   ....   ....   ....   ....
+ 59.1854N /  86:   ....   ....   ....   ....  2.995   ....   ....  2.990   ....   ....   ....   ....
+ 59.1785N /  85:   ....   ....   ....  2.993  2.997  2.999   ....  2.990   ....   ....   ....   ....
+ 59.1716N /  84:   ....   ....   ....  2.994  2.998   ....   ....  2.991   ....   ....   ....   ....
+ 59.1647N /  83:   ....   ....   ....  2.996  2.998  3.005   ....  2.991   ....   ....   ....   ....
+ 59.1578N /  82:   ....   ....   ....  2.996  2.998   ....   ....  2.993   ....   ....   ....   ....
+ 59.1509N /  81:   ....   ....   ....  2.996  2.999   ....  2.995  2.994   ....   ....   ....   ....
+ 59.144N  /  80:   ....   ....   ....   ....  3.000   ....  2.996  2.994   ....   ....   ....   ....
+ 59.1371N /  79:   ....   ....   ....   ....  3.000   ....  2.996  2.994   ....   ....   ....   ....
+ 59.1302N /  78:   ....   ....   ....   ....  3.001   ....  2.998  2.995   ....   ....   ....   ....
+ 59.1233N /  77:   ....   ....   ....   ....  3.002   ....  3.000  2.996   ....   ....   ....   ....
+ 59.1164N /  76:   ....   ....   ....   ....  3.004   ....  3.001  2.997   ....   ....   ....   ....
+ 59.1095N /  75:   ....   ....   ....   ....   ....  3.003  3.003  2.998   ....   ....   ....   ....
+ 59.1026N /  74:   ....   ....   ....   ....   ....  3.002   ....  2.998   ....   ....   ....   ....
+ 59.0957N /  73:   ....   ....   ....   ....  2.996  3.000   ....  3.000   ....   ....   ....   ....
+ 59.0888N /  72:   ....   ....   ....   ....  2.996  3.000   ....  3.001   ....   ....   ....   ....
+ 59.0819N /  71:   ....   ....   ....   ....  2.997  3.001  3.004  3.001   ....   ....   ....   ....
+ 59.075N  /  70:   ....   ....   ....   ....  2.998  3.001  3.003  3.001   ....   ....   ....   ....
+ 59.0681N /  69:   ....   ....   ....   ....  2.999  3.001  3.001  3.001   ....   ....   ....   ....
+ 59.0612N /  68:   ....   ....   ....   ....  2.999  3.000   ....  2.998   ....   ....   ....   ....
+ 59.0542N /  67:   ....   ....   ....   ....  2.998  2.998   ....  2.995   ....   ....   ....   ....
+ 59.0473N /  66:   ....   ....   ....   ....  2.998  2.996   ....  2.993   ....   ....   ....   ....
+ 59.0404N /  65:   ....   ....   ....   ....  2.998  2.996  2.994  2.991   ....   ....   ....   ....
+ 59.0335N /  64:   ....   ....   ....  2.998  2.998  2.995  2.993  2.988   ....   ....   ....   ....
+ 59.0266N /  63:   ....   ....   ....  2.998   ....  2.994  2.990  2.986   ....   ....   ....   ....
+ 59.0196N /  62:   ....   ....   ....  2.997   ....  2.993   ....  2.983   ....   ....   ....   ....
+ 59.0127N /  61:   ....   ....   ....  2.996   ....  2.992  2.986  2.980   ....   ....   ....   ....
+ 59.0058N /  60:   ....   ....   ....  2.994   ....  2.991  2.986  2.977   ....   ....   ....   ....
+ 58.9989N /  59:   ....   ....   ....  2.995   ....  2.991  2.986  2.977   ....   ....   ....   ....
+ 58.9919N /  58:   ....   ....   ....  2.998   ....  2.991  2.985  2.977   ....   ....   ....   ....
+ 58.985N  /  57:   ....   ....   ....  3.000   ....  2.990  2.984  2.977   ....   ....   ....   ....
+ 58.9781N /  56:   ....   ....   ....  3.001   ....  2.989  2.982  2.977   ....   ....   ....   ....
+ 58.9711N /  55:   ....   ....   ....  3.000   ....  2.988  2.977  2.976   ....   ....   ....   ....
+ 58.9642N /  54:   ....   ....   ....  2.999   ....  2.987  2.978  2.972   ....   ....   ....   ....
+ 58.9573N /  53:   ....   ....   ....  2.997   ....  2.987  2.978  2.965   ....   ....   ....   ....
+ 58.9503N /  52:   ....   ....   ....  2.996  2.992  2.987  2.978  2.967   ....   ....   ....   ....
+ 58.9434N /  51:   ....   ....   ....  2.996  2.992  2.987  2.977  2.968   ....   ....   ....   ....
+ 58.9365N /  50:   ....   ....   ....  2.998  2.993  2.986  2.977   ....   ....   ....   ....   ....
+ 58.9295N /  49:   ....   ....   ....   ....  2.992  2.986  2.976   ....   ....   ....   ....   ....
+ 58.9226N /  48:   ....   ....   ....   ....  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.9156N /  47:   ....   ....   ....  2.995  2.994  2.985  2.975   ....   ....   ....   ....   ....
+ 58.9087N /  46:   ....   ....   ....  2.995  2.994  2.985  2.975   ....   ....   ....   ....   ....
+ 58.9017N /  45:   ....   ....   ....  2.995  2.993  2.985  2.975   ....   ....   ....   ....   ....
+ 58.8948N /  44:   ....   ....   ....  2.995  2.992  2.985  2.975   ....   ....   ....   ....   ....
+ 58.8878N /  43:   ....   ....   ....  2.996  2.992  2.985  2.976   ....   ....   ....   ....   ....
+ 58.8809N /  42:   ....   ....   ....  2.997  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.8739N /  41:   ....   ....   ....  2.997  2.993  2.985  2.976   ....   ....   ....   ....   ....
+ 58.867N  /  40:   ....   ....   ....  2.997  2.993  2.985  2.974   ....   ....   ....   ....   ....
+ 58.86N   /  39:   ....   ....   ....  2.998  2.994  2.985  2.972   ....   ....   ....   ....   ....
+ 58.8531N /  38:   ....   ....   ....  2.998  2.994  2.986  2.968   ....   ....   ....   ....   ....
+ 58.8461N /  37:   ....   ....   ....  2.999  2.994  2.986  2.966   ....   ....   ....   ....   ....
+ 58.8392N /  36:   ....   ....   ....  2.999  2.994  2.985  2.968   ....   ....   ....   ....   ....
+ 58.8322N /  35:   ....   ....   ....   ....  2.993  2.984  2.971   ....   ....   ....   ....   ....
+ 58.8252N /  34:   ....   ....   ....   ....  2.993  2.982  2.969   ....   ....   ....   ....   ....
+ 58.8183N /  33:   ....   ....   ....   ....  2.991  2.982  2.968   ....   ....   ....   ....   ....
+ 58.8113N /  32:   ....   ....   ....   ....  2.991  2.982  2.969   ....   ....   ....  2.934  2.923
+ 58.8043N /  31:   ....   ....   ....   ....  2.993  2.983  2.968   ....   ....   ....  2.935   ....
+ 58.7974N /  30:   ....   ....   ....  3.002  2.993  2.982  2.966  2.948   ....   ....  2.935   ....
+ 58.7904N /  29:   ....   ....   ....   ....  2.991  2.981  2.966  2.948   ....   ....   ....   ....
+ 58.7834N /  28:   ....   ....   ....   ....  2.991  2.980  2.965  2.946   ....   ....  2.964   ....
+ 58.7765N /  27:   ....   ....   ....   ....  2.990  2.977  2.963  2.949   ....   ....  2.959   ....
+ 58.7695N /  26:   ....   ....   ....   ....  2.989  2.979  2.965  2.954   ....  2.948  2.957   ....
+ 58.7625N /  25:   ....   ....   ....   ....  2.988  2.982  2.969  2.960   ....  2.952  2.955   ....
+ 58.7555N /  24:   ....   ....   ....   ....  2.988  2.982  2.969  2.963   ....  2.954  2.953   ....
+ 58.7486N /  23:   ....   ....   ....  2.987  2.986  2.979  2.968  2.961   ....  2.954  2.951   ....
+ 58.7416N /  22:   ....   ....   ....  2.985  2.985  2.977  2.967  2.959   ....  2.953  2.946   ....
+ 58.7346N /  21:   ....   ....   ....  2.984  2.983  2.975  2.965  2.958  2.952  2.949  2.945   ....
+ 58.7276N /  20:   ....   ....   ....   ....  2.982  2.972  2.963  2.956  2.951  2.946  2.942   ....
+ 58.7206N /  19:   ....   ....   ....   ....  2.980  2.969  2.962  2.956  2.951  2.945   ....   ....
+ 58.7137N /  18:   ....   ....   ....   ....  2.979  2.971  2.963  2.954  2.949  2.944   ....   ....
+ 58.7067N /  17:   ....   ....   ....   ....  2.978  2.974  2.964  2.953  2.947  2.946   ....   ....
+ 58.6997N /  16:   ....   ....   ....   ....  2.977  2.974  2.965  2.952  2.945  2.946   ....   ....
+ 58.6927N /  15:   ....   ....   ....   ....  2.978  2.974  2.965  2.951  2.944  2.947   ....   ....
+ 58.6857N /  14:   ....   ....   ....   ....  2.980  2.974  2.966  2.948  2.944  2.947   ....   ....
+ 58.6787N /  13:   ....   ....   ....   ....  2.980  2.975  2.969  2.952  2.945  2.949   ....   ....
+ 58.6717N /  12:   ....   ....   ....   ....  2.982  2.976  2.968  2.956  2.944  2.952   ....   ....
+ 58.6647N /  11:   ....   ....   ....   ....  2.983  2.978  2.965  2.949   ....  2.952   ....   ....
+ 58.6577N /  10:   ....   ....   ....   ....  2.982  2.979  2.966  2.945   ....   ....   ....   ....
+ 58.6507N /   9:   ....   ....   ....  2.982  2.980  2.975  2.971  2.953   ....   ....   ....   ....
+ 58.6437N /   8:   ....   ....   ....   ....  2.980  2.971  2.972  2.959   ....   ....   ....   ....
+ 58.6367N /   7:   ....   ....   ....   ....  2.982  2.975  2.968  2.960   ....   ....   ....   ....
+ 58.6297N /   6:   ....   ....   ....   ....  2.981  2.977  2.969  2.963  2.949   ....   ....   ....
+ 58.6227N /   5:   ....   ....   ....   ....  2.982  2.977  2.971  2.962  2.952   ....   ....   ....
+ 58.6157N /   4:   ....   ....   ....   ....  2.970  2.968  2.965  2.957  2.951   ....   ....   ....
+ 58.6087N /   3:   ....   ....   ....   ....  2.953  2.951  2.944  2.961  2.946   ....   ....   ....
+ 58.6017N /   2:   ....   ....   ....   ....  2.940  2.940  2.940  2.940  2.940   ....   ....   ....
+ 58.5947N /   1:   ....   ....   ....   ....  2.940  2.940  2.940  2.940  2.940   ....   ....   ....
+ 
+*** Running test: bn_odd_variable_name.jnl
+! make sure memory is limited; otherwise the abstract axis will list
+let save_mem = ($ferret_memory)
+ !-> DEFINE VARIABLE save_mem = 25.6
+set mem /size=10
+use weird_name1.cdf
+sh data
+     currently SET data sets:
+    1> ./weird_name1.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ v1       lower case v1                    1:20      ...       ...       ...       ...       ...
+ v2-and-minus
+          SIN(2+I/10)                      1:20      ...       ...       ...       ...       ...
+ V1       Upper case V1                    1:20      ...       ...       ...       ...       ...
+ I        SIN(4+I/10)                      1:20      ...       ...       ...       ...       ...
+ X        SIN(5+I/10)                      1:20      ...       ...       ...       ...       ...
+ 
+set mode ignore
+list v1
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.0416
+ 2    /  2: -0.0584
+ 3    /  3: -0.1577
+ 4    /  4: -0.2555
+ 5    /  5: -0.3508
+ 6    /  6: -0.4425
+ 7    /  7: -0.5298
+ 8    /  8: -0.6119
+ 9    /  9: -0.6878
+ 10   / 10: -0.7568
+ 11   / 11: -0.8183
+ 12   / 12: -0.8716
+ 13   / 13: -0.9162
+ 14   / 14: -0.9516
+ 15   / 15: -0.9775
+ 16   / 16: -0.9937
+ 17   / 17: -0.9999
+ 18   / 18: -0.9962
+ 19   / 19: -0.9825
+ 20   / 20: -0.9589
+list 'v1'
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8912
+ 2    /  2:  0.9320
+ 3    /  3:  0.9636
+ 4    /  4:  0.9854
+ 5    /  5:  0.9975
+ 6    /  6:  0.9996
+ 7    /  7:  0.9917
+ 8    /  8:  0.9738
+ 9    /  9:  0.9463
+ 10   / 10:  0.9093
+ 11   / 11:  0.8632
+ 12   / 12:  0.8085
+ 13   / 13:  0.7457
+ 14   / 14:  0.6755
+ 15   / 15:  0.5985
+ 16   / 16:  0.5155
+ 17   / 17:  0.4274
+ 18   / 18:  0.3350
+ 19   / 19:  0.2392
+ 20   / 20:  0.1411
+list v2-and-minus    		! Deliberate error
+list 'v2-and-minus'  		! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8632
+ 2    /  2:  0.8085
+ 3    /  3:  0.7457
+ 4    /  4:  0.6755
+ 5    /  5:  0.5985
+ 6    /  6:  0.5155
+ 7    /  7:  0.4274
+ 8    /  8:  0.3350
+ 9    /  9:  0.2392
+ 10   / 10:  0.1411
+ 11   / 11:  0.0416
+ 12   / 12: -0.0584
+ 13   / 13: -0.1577
+ 14   / 14: -0.2555
+ 15   / 15: -0.3508
+ 16   / 16: -0.4425
+ 17   / 17: -0.5298
+ 18   / 18: -0.6119
+ 19   / 19: -0.6878
+ 20   / 20: -0.7568
+list x 				! Deliberate error
+list 'X'			! Now the proper syntax
+             VARIABLE : SIN(5+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.9258
+ 2    /  2: -0.8835
+ 3    /  3: -0.8323
+ 4    /  4: -0.7728
+ 5    /  5: -0.7055
+ 6    /  6: -0.6313
+ 7    /  7: -0.5507
+ 8    /  8: -0.4646
+ 9    /  9: -0.3739
+ 10   / 10: -0.2794
+ 11   / 11: -0.1822
+ 12   / 12: -0.0831
+ 13   / 13:  0.0168
+ 14   / 14:  0.1165
+ 15   / 15:  0.2151
+ 16   / 16:  0.3115
+ 17   / 17:  0.4048
+ 18   / 18:  0.4941
+ 19   / 19:  0.5784
+ 20   / 20:  0.6570
+list i  			! Deliberate error
+list 'i'  			! Deliberate error
+list 'I'			! Now the proper syntax
+             VARIABLE : SIN(4+I/10)
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.8183
+ 2    /  2: -0.8716
+ 3    /  3: -0.9162
+ 4    /  4: -0.9516
+ 5    /  5: -0.9775
+ 6    /  6: -0.9937
+ 7    /  7: -0.9999
+ 8    /  8: -0.9962
+ 9    /  9: -0.9825
+ 10   / 10: -0.9589
+ 11   / 11: -0.9258
+ 12   / 12: -0.8835
+ 13   / 13: -0.8323
+ 14   / 14: -0.7728
+ 15   / 15: -0.7055
+ 16   / 16: -0.6313
+ 17   / 17: -0.5507
+ 18   / 18: -0.4646
+ 19   / 19: -0.3739
+ 20   / 20: -0.2794
+list 'V1' - 'v1'
+             VARIABLE : 'V1' - 'v1'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1: -0.850
+ 2    /  2: -0.990
+ 3    /  3: -1.121
+ 4    /  4: -1.241
+ 5    /  5: -1.348
+ 6    /  6: -1.442
+ 7    /  7: -1.522
+ 8    /  8: -1.586
+ 9    /  9: -1.634
+ 10   / 10: -1.666
+ 11   / 11: -1.681
+ 12   / 12: -1.680
+ 13   / 13: -1.662
+ 14   / 14: -1.627
+ 15   / 15: -1.576
+ 16   / 16: -1.509
+ 17   / 17: -1.427
+ 18   / 18: -1.331
+ 19   / 19: -1.222
+ 20   / 20: -1.100
+list 'I'[i=6:15 at sbx:10] - 'X'[i=6:15 at ave]
+             VARIABLE : 'I'[I=6:15 at SBX:10] - 'X'[I=6:15 at AVE]
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.7303
+ 7    /  7: -0.7363
+ 8    /  8: -0.7327
+ 9    /  9: -0.7196
+ 10   / 10: -0.6970
+ 11   / 11: -0.6653
+ 12   / 12: -0.6247
+ 13   / 13: -0.5757
+ 14   / 14: -0.5187
+ 15   / 15: -0.4543
+list v1[i=6:15 at sbx:3]
+             VARIABLE : Upper case V1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6: -0.4410
+ 7    /  7: -0.5281
+ 8    /  8: -0.6098
+ 9    /  9: -0.6855
+ 10   / 10: -0.7543
+ 11   / 11: -0.8156
+ 12   / 12: -0.8687
+ 13   / 13: -0.9131
+ 14   / 14: -0.9484
+ 15   / 15: -0.9743
+list 'v1'[i=6:15 at sbx:3]
+             VARIABLE : lower case v1
+                        box smoothed by 3 pts on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 10 points (X)
+ 6    /  6:  0.9962
+ 7    /  7:  0.9884
+ 8    /  8:  0.9706
+ 9    /  9:  0.9431
+ 10   / 10:  0.9063
+ 11   / 11:  0.8603
+ 12   / 12:  0.8058
+ 13   / 13:  0.7432
+ 14   / 14:  0.6732
+ 15   / 15:  0.5965
+list 'I'-'X'/'v2-and-minus'
+             VARIABLE : 'I'-'X'/'v2-and-minus'
+             FILENAME : weird_name1.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.254
+ 2    /  2:  0.221
+ 3    /  3:  0.200
+ 4    /  4:  0.192
+ 5    /  5:  0.201
+ 6    /  6:  0.231
+ 7    /  7:  0.289
+ 8    /  8:  0.391
+ 9    /  9:  0.580
+ 10   / 10:  1.021
+ 11   / 11:  3.455
+ 12   / 12: -2.307
+ 13   / 13: -0.726
+ 14   / 14: -0.317
+ 15   / 15: -0.092
+ 16   / 16:  0.073
+ 17   / 17:  0.213
+ 18   / 18:  0.343
+ 19   / 19:  0.467
+ 20   / 20:  0.589
+list v1[i=@max]
+             VARIABLE : Upper case V1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.04158
+list 'v1'[i=@max]
+             VARIABLE : lower case v1
+             FILENAME : weird_name1.cdf
+             X        : 0.5 to 20.5 (maximum)
+          0.9996
+list v2-and-minus[i=5:15 at ddc] 	! Deliberate error
+list 'v2-and-minus'[i=5:15 at ddc] ! Now the proper syntax
+             VARIABLE : SIN(2+I/10)
+                        centered derivative on X
+             FILENAME : weird_name1.cdf
+             SUBSET   : 11 points (X)
+ 5    /  5: -0.07998
+ 6    /  6: -0.08555
+ 7    /  7: -0.09026
+ 8    /  8: -0.09407
+ 9    /  9: -0.09693
+ 10   / 10: -0.09883
+ 11   / 11: -0.09975
+ 12   / 12: -0.09966
+ 13   / 13: -0.09858
+ 14   / 14: -0.09652
+ 15   / 15: -0.09349
+! restore orginal memory size
+set mem /size=`save_mem`
+ !-> set mem /size=25.6
+*** Running test: bn_test_stream.jnl
+ 
+canc data/all
+ 
+sp rm -f permutedBinaryTest.dat
+list/i=1:48/form=stream/file=permutedBinaryTest.dat i
+sp rm -f junk.dat
+list/i=1:5/form=stream/file=junk.dat i
+ 
+ 
+ 
+!
+! Following are intentional errors...
+!
+set mode ignore
+ 
+!
+! Ultra large grid
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+!
+! Semilarge grid
+!
+ 
+canc data/all
+ 
+def axis/x=1:1000000000:1 xax
+def axis/y=1:1:1 yax
+def axis/z=1:1:1 zax
+def axis/t=1:1:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+canc data/all
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+ 
+ 
+ 
+! Non-existent file
+file/format=stream/var=num/grid=mygrid NoSuchFile.dat
+ 
+! File that doesn't match specified size
+file/format=stream/var=num/grid=mygrid junk.dat
+load num
+ 
+! Try listing with V permutation (disable: hangs Ferret)
+!list/clobber/file=foobar.dat/form=str/order=badsyntax/i=1:100 i
+ 
+! Try reading in with V permutation for non-stream data
+file/var=num/order=vxyzt/grid=mygrid junk.dat
+ 
+! Try /type flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try /swap flag with non-stream data
+file/type=i2/grid=mygrid junk.dat
+ 
+! Try bad type flag
+file/var=num/type=i3/grid=mygrid/form=stream junk.dat
+ 
+! Try list of types that is smaller than list of variables
+file/var=num,num1,num2/type=i2,i1/form=stream junk.dat
+ 
+canc dat/all
+canc mode ignore
+ 
+!!OK, load file in 'normal order'
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- L:2 T:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:3 T:   3
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:4 T:   4
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  26.00
+ 2   / 2:  27.00  28.00
+ 3   / 3:  29.00  30.00
+ ---- L:2 T:   2
+ 1   / 1:  31.00  32.00
+ 2   / 2:  33.00  34.00
+ 3   / 3:  35.00  36.00
+ ---- L:3 T:   3
+ 1   / 1:  37.00  38.00
+ 2   / 2:  39.00  40.00
+ 3   / 3:  41.00  42.00
+ ---- L:4 T:   4
+ 1   / 1:  43.00  44.00
+ 2   / 2:  45.00  46.00
+ 3   / 3:  47.00  48.00
+ 
+!! Load file w/o order qualifier (should be same as above)
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   2.00
+ 2   / 2:   3.00   4.00
+ 3   / 3:   5.00   6.00
+ ---- L:2 T:   2
+ 1   / 1:   7.00   8.00
+ 2   / 2:   9.00  10.00
+ 3   / 3:  11.00  12.00
+ ---- L:3 T:   3
+ 1   / 1:  13.00  14.00
+ 2   / 2:  15.00  16.00
+ 3   / 3:  17.00  18.00
+ ---- L:4 T:   4
+ 1   / 1:  19.00  20.00
+ 2   / 2:  21.00  22.00
+ 3   / 3:  23.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  26.00
+ 2   / 2:  27.00  28.00
+ 3   / 3:  29.00  30.00
+ ---- L:2 T:   2
+ 1   / 1:  31.00  32.00
+ 2   / 2:  33.00  34.00
+ 3   / 3:  35.00  36.00
+ ---- L:3 T:   3
+ 1   / 1:  37.00  38.00
+ 2   / 2:  39.00  40.00
+ 3   / 3:  41.00  42.00
+ ---- L:4 T:   4
+ 1   / 1:  43.00  44.00
+ 2   / 2:  45.00  46.00
+ 3   / 3:  47.00  48.00
+ 
+ 
+!! Permute tzyxv
+file/format=str/var=num,num1/grid=mygrid/order=tzyxv permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00  13.00
+ 2   / 2:   5.00  17.00
+ 3   / 3:   9.00  21.00
+ ---- L:2 T:   2
+ 1   / 1:   2.00  14.00
+ 2   / 2:   6.00  18.00
+ 3   / 3:  10.00  22.00
+ ---- L:3 T:   3
+ 1   / 1:   3.00  15.00
+ 2   / 2:   7.00  19.00
+ 3   / 3:  11.00  23.00
+ ---- L:4 T:   4
+ 1   / 1:   4.00  16.00
+ 2   / 2:   8.00  20.00
+ 3   / 3:  12.00  24.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  25.00  37.00
+ 2   / 2:  29.00  41.00
+ 3   / 3:  33.00  45.00
+ ---- L:2 T:   2
+ 1   / 1:  26.00  38.00
+ 2   / 2:  30.00  42.00
+ 3   / 3:  34.00  46.00
+ ---- L:3 T:   3
+ 1   / 1:  27.00  39.00
+ 2   / 2:  31.00  43.00
+ 3   / 3:  35.00  47.00
+ ---- L:4 T:   4
+ 1   / 1:  28.00  40.00
+ 2   / 2:  32.00  44.00
+ 3   / 3:  36.00  48.00
+ 
+!!Try permuted v
+file/format=str/var=num,num1/grid=mygrid/order=vxyzt permutedBinaryTest.dat
+list num
+             VARIABLE : NUM
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   1.00   3.00
+ 2   / 2:   5.00   7.00
+ 3   / 3:   9.00  11.00
+ ---- L:2 T:   2
+ 1   / 1:  13.00  15.00
+ 2   / 2:  17.00  19.00
+ 3   / 3:  21.00  23.00
+ ---- L:3 T:   3
+ 1   / 1:  25.00  27.00
+ 2   / 2:  29.00  31.00
+ 3   / 3:  33.00  35.00
+ ---- L:4 T:   4
+ 1   / 1:  37.00  39.00
+ 2   / 2:  41.00  43.00
+ 3   / 3:  45.00  47.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : permutedBinaryTest.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   2.00   4.00
+ 2   / 2:   6.00   8.00
+ 3   / 3:  10.00  12.00
+ ---- L:2 T:   2
+ 1   / 1:  14.00  16.00
+ 2   / 2:  18.00  20.00
+ 3   / 3:  22.00  24.00
+ ---- L:3 T:   3
+ 1   / 1:  26.00  28.00
+ 2   / 2:  30.00  32.00
+ 3   / 3:  34.00  36.00
+ ---- L:4 T:   4
+ 1   / 1:  38.00  40.00
+ 2   / 2:  42.00  44.00
+ 3   / 3:  46.00  48.00
+ 
+!! Test stuff for different data types (files previously generated by matlab
+!! for big endian architecture)
+file/format=str/var=num,num1/grid=mygrid/type=i1 byte.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byte.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2/swap short.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : short.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4/swap int.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : int.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4/swap float.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : float.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8/swap double.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : double.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+ 
+!! Test swapped
+file/format=str/var=num,num1/grid=mygrid/type=i1 byteSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : byteSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i2 shortSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : shortSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=i4 intSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : intSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r4 floatSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : floatSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+file/format=str/var=num,num1/grid=mygrid/type=r8 doubleSwapped.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : doubleSwapped.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+! Test skip
+!file/format=str/var=num,num1/grid=mygrid/type=r8/skip=4/swap skip.dat
+! For double-precision Ferret, /skip=4 stops with error,
+! get correct result with /skip=2 (??)
+file/format=str/var=num,num1/grid=mygrid/type=r8/skip=2/swap skip.dat
+list num1
+             VARIABLE : NUM1
+             FILENAME : skip.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+ 
+! Try list of types
+file/format=str/var=num,num1/grid=mygrid/type=r8,i1/swap twoType.dat
+list num
+             VARIABLE : NUM
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : twoType.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  24.00  25.00
+ 2   / 2:  26.00  27.00
+ 3   / 3:  28.00  29.00
+ ---- L:2 T:   2
+ 1   / 1:  30.00  31.00
+ 2   / 2:  32.00  33.00
+ 3   / 3:  34.00  35.00
+ ---- L:3 T:   3
+ 1   / 1:  36.00  37.00
+ 2   / 2:  38.00  39.00
+ 3   / 3:  40.00  41.00
+ ---- L:4 T:   4
+ 1   / 1:  42.00  43.00
+ 2   / 2:  44.00  45.00
+ 3   / 3:  46.00  47.00
+ 
+! Grand finale of xyvzt permutation with r4,i2 types
+file/format=str/var=num,num1/grid=mygrid/type=r4,i2/order=xyvzt/swap finale.dat
+list num
+             VARIABLE : NUM
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+list num1
+             VARIABLE : NUM1
+             FILENAME : finale.dat
+             SUBSET   : 2 by 3 by 4 points (Y-Z-T)
+             X        : 1
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:   0.00   1.00
+ 2   / 2:   2.00   3.00
+ 3   / 3:   4.00   5.00
+ ---- L:2 T:   2
+ 1   / 1:   6.00   7.00
+ 2   / 2:   8.00   9.00
+ 3   / 3:  10.00  11.00
+ ---- L:3 T:   3
+ 1   / 1:  12.00  13.00
+ 2   / 2:  14.00  15.00
+ 3   / 3:  16.00  17.00
+ ---- L:4 T:   4
+ 1   / 1:  18.00  19.00
+ 2   / 2:  20.00  21.00
+ 3   / 3:  22.00  23.00
+*** Running test: bn_define_axes.jnl
+! bn_define_axes.jnl
+! *sh* 5/99
+! *sh* 12/99 - with streamlined syntax
+ 
+! exercise the DEFINE AXIS command
+ 
+ 
+! ====================== REGULAR ==================
+! lo:hi:delta
+define axis/x=1:5:1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5:1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS>1
+define axis/x=1:5/npoints=5 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 r   1                    5
+   Axis span (to cell edges) = 5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+define axis/x=1:5/npoints=4/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 r   1.5                  4.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  2.5                   1          2
+       3>  3.5                   1          3
+       4>  4.5                   1          4
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/x=1:5/npoints=1 xax; cancel mode ignore
+define axis/x=5/npoints=1 xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   5                    5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+set mode ignore; define axis/x=5/npoints=1/edges xax; cancel mode ignore
+define axis/x=1:5/npoints=1/edges xax
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    1 r   3                    3
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  3                     4          1
+ 
+!======= calendar
+! lo:hi:delta
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980:1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+! lo:hi /NPOINTS>1
+define axis/t=15-jan-1980:25-jan-1980/npoints=11/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                11 r   15-JAN-1980 00:00    25-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+       2>  16-JAN-1980 00:00:00  1          15-JAN-1980 12:00:00    28855
+       3>  17-JAN-1980 00:00:00  1          16-JAN-1980 12:00:00    28856
+       4>  18-JAN-1980 00:00:00  1          17-JAN-1980 12:00:00    28857
+       5>  19-JAN-1980 00:00:00  1          18-JAN-1980 12:00:00    28858
+       6>  20-JAN-1980 00:00:00  1          19-JAN-1980 12:00:00    28859
+       7>  21-JAN-1980 00:00:00  1          20-JAN-1980 12:00:00    28860
+       8>  22-JAN-1980 00:00:00  1          21-JAN-1980 12:00:00    28861
+       9>  23-JAN-1980 00:00:00  1          22-JAN-1980 12:00:00    28862
+      10>  24-JAN-1980 00:00:00  1          23-JAN-1980 12:00:00    28863
+      11>  25-JAN-1980 00:00:00  1          24-JAN-1980 12:00:00    28864
+define axis/t=15-jan-1980:25-jan-1980/npoints=10/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                10 r   15-JAN-1980 12:00    24-JAN-1980 12:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 12:00:00  1          15-JAN-1980 00:00:00    28854.5
+       2>  16-JAN-1980 12:00:00  1          16-JAN-1980 00:00:00    28855.5
+       3>  17-JAN-1980 12:00:00  1          17-JAN-1980 00:00:00    28856.5
+       4>  18-JAN-1980 12:00:00  1          18-JAN-1980 00:00:00    28857.5
+       5>  19-JAN-1980 12:00:00  1          19-JAN-1980 00:00:00    28858.5
+       6>  20-JAN-1980 12:00:00  1          20-JAN-1980 00:00:00    28859.5
+       7>  21-JAN-1980 12:00:00  1          21-JAN-1980 00:00:00    28860.5
+       8>  22-JAN-1980 12:00:00  1          22-JAN-1980 00:00:00    28861.5
+       9>  23-JAN-1980 12:00:00  1          23-JAN-1980 00:00:00    28862.5
+      10>  24-JAN-1980 12:00:00  1          24-JAN-1980 00:00:00    28863.5
+ 
+ 
+! lo:hi /NPOINTS=1
+set mode ignore; define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days tax; cancel mode ignore
+define axis/t=15-jan-1980/npoints=1/unit=days tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   15-JAN-1980 00:00    15-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  15-JAN-1980 00:00:00  1          14-JAN-1980 12:00:00    28854
+set mode ignore; define axis/t=15-jan-1980/npoints=1/unit=days/edges tax; cancel mode ignore
+define axis/t=15-jan-1980:25-jan-1980/npoints=1/unit=days/edges tax
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 1 r   20-JAN-1980 00:00    20-JAN-1980 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 10
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-JAN-1980 00:00:00  10         15-JAN-1980 00:00:00    28859
+ 
+! =============== IRREGULAR ===================
+define axis/x/from_data/name=xax {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/x/from_data/name=xax/edges {1,2,5}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   1.5                  3.5
+   Axis span (to cell edges) = 4
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1.5                   1          1
+       2>  3.5                   3          2
+ 
+!======= calendar
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990 {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/t/from_data/name=tax/unit=days/t0=1-jan-1990/edges {1,2,5}
+show axis/t tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2 i   02-JAN-1990 12:00    04-JAN-1990 12:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 4
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 12:00:00  1          02-JAN-1990 00:00:00    1.5
+       2>  04-JAN-1990 12:00:00  3          03-JAN-1990 00:00:00    3.5
+ 
+! real monthly calendar
+let month = MOD(l-1,12)+1
+let add_year = INT((l-1)/12)
+let tstep = DAYS1900(1980+add_year,month,1)
+define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:`20*12+1`]
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-1900/edges tstep[l=1:241]
+show axis/l=1:20 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+       2>  15-FEB-1980 12:00:00  29         01-FEB-1980 00:00:00    29264.5
+       3>  16-MAR-1980 12:00:00  31         01-MAR-1980 00:00:00    29294.5
+       4>  16-APR-1980 00:00:00  30         01-APR-1980 00:00:00    29325
+       5>  16-MAY-1980 12:00:00  31         01-MAY-1980 00:00:00    29355.5
+       6>  16-JUN-1980 00:00:00  30         01-JUN-1980 00:00:00    29386
+       7>  16-JUL-1980 12:00:00  31         01-JUL-1980 00:00:00    29416.5
+       8>  16-AUG-1980 12:00:00  31         01-AUG-1980 00:00:00    29447.5
+       9>  16-SEP-1980 00:00:00  30         01-SEP-1980 00:00:00    29478
+      10>  16-OCT-1980 12:00:00  31         01-OCT-1980 00:00:00    29508.5
+      11>  16-NOV-1980 00:00:00  30         01-NOV-1980 00:00:00    29539
+      12>  16-DEC-1980 12:00:00  31         01-DEC-1980 00:00:00    29569.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      14>  15-FEB-1981 00:00:00  28         01-FEB-1981 00:00:00    29630
+      15>  16-MAR-1981 12:00:00  31         01-MAR-1981 00:00:00    29659.5
+      16>  16-APR-1981 00:00:00  30         01-APR-1981 00:00:00    29690
+      17>  16-MAY-1981 12:00:00  31         01-MAY-1981 00:00:00    29720.5
+      18>  16-JUN-1981 00:00:00  30         01-JUN-1981 00:00:00    29751
+      19>  16-JUL-1981 12:00:00  31         01-JUL-1981 00:00:00    29781.5
+      20>  16-AUG-1981 12:00:00  31         01-AUG-1981 00:00:00    29812.5
+show axis/l=1:240:12 tax
+ name       axis              # pts   start                end
+ TAX       TIME               240 i   16-JAN-1980 12:00    16-DEC-1999 12:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 7305
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN-1980 12:00:00  31         01-JAN-1980 00:00:00    29234.5
+      13>  16-JAN-1981 12:00:00  31         01-JAN-1981 00:00:00    29600.5
+      25>  16-JAN-1982 12:00:00  31         01-JAN-1982 00:00:00    29965.5
+      37>  16-JAN-1983 12:00:00  31         01-JAN-1983 00:00:00    30330.5
+      49>  16-JAN-1984 12:00:00  31         01-JAN-1984 00:00:00    30695.5
+      61>  16-JAN-1985 12:00:00  31         01-JAN-1985 00:00:00    31061.5
+      73>  16-JAN-1986 12:00:00  31         01-JAN-1986 00:00:00    31426.5
+      85>  16-JAN-1987 12:00:00  31         01-JAN-1987 00:00:00    31791.5
+      97>  16-JAN-1988 12:00:00  31         01-JAN-1988 00:00:00    32156.5
+     109>  16-JAN-1989 12:00:00  31         01-JAN-1989 00:00:00    32522.5
+     121>  16-JAN-1990 12:00:00  31         01-JAN-1990 00:00:00    32887.5
+     133>  16-JAN-1991 12:00:00  31         01-JAN-1991 00:00:00    33252.5
+     145>  16-JAN-1992 12:00:00  31         01-JAN-1992 00:00:00    33617.5
+     157>  16-JAN-1993 12:00:00  31         01-JAN-1993 00:00:00    33983.5
+     169>  16-JAN-1994 12:00:00  31         01-JAN-1994 00:00:00    34348.5
+     181>  16-JAN-1995 12:00:00  31         01-JAN-1995 00:00:00    34713.5
+     193>  16-JAN-1996 12:00:00  31         01-JAN-1996 00:00:00    35078.5
+     205>  16-JAN-1997 12:00:00  31         01-JAN-1997 00:00:00    35444.5
+     217>  16-JAN-1998 12:00:00  31         01-JAN-1998 00:00:00    35809.5
+     229>  16-JAN-1999 12:00:00  31         01-JAN-1999 00:00:00    36174.5
+ 
+! modulo axis for arbitrary time interval
+define axis/t=1-jan-0001:1-jan-0002:1/unit=days/t0=1-jan-0000 tencoding
+let tstep = t[gt=tencoding]
+let start_date = tstep[t=15-mar-0001]
+let end_date = tstep[t=27-may-0001]
+define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {`start_date,p=7`,`end_date,p=7`,`start_date+365.2425,p=7`}
+ !-> define axis/from_data/T/units=days/name=tax/t0=1-jan-0000/edges/modulo {439,512,804.2425}
+show axis/l=1:6 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+       2>  20-OCT 02:54:35       292.2425   27-MAY 00:00:00         658.1212
+       3>  20-APR-0002 17:49:12  73         15-MAR-0002 05:49:12    840.7425
+       4>  20-OCT-0002 08:43:47  292.2425   27-MAY-0002 05:49:12    1023.364
+       5>  20-APR-0003 23:38:23  73         15-MAR-0003 11:38:23    1205.985
+       6>  20-OCT-0003 14:32:59  292.2425   27-MAY-0003 11:38:23    1388.606
+show axis/l=1:6000:1200 tax
+ name       axis              # pts   start                end
+ TAX       TIME                 2mi   20-APR 12:00         20-OCT 02:54
+T0 = 1-JAN-0000
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  20-APR 12:00:00       73         15-MAR 00:00:00         475.5
+    1201>  20-APR-0601 23:59:59  73         15-MAR-0601 11:59:59    219621
+    2401>  20-APR-1201 11:59:59  73         14-MAR-1201 23:59:59    438766.5
+    3601>  20-APR-1801 23:59:59  73         15-MAR-1801 11:59:59    657912
+    4801>  20-APR-2401 11:59:59  73         14-MAR-2401 23:59:59    877057.5
+ 
+! ================ REPEATED VALUES ====================
+! points
+define axis/from/x/name=xax {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    7
+   Axis span (to cell edges) = 2.999999
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              0.5        6.000001
+       4>  7                     0.999998   6.500001
+define axis/from/x/name=xax {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    5 i   5                    7
+   Axis span (to cell edges) = 2.999998
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.500001   5.5
+       3>  6.000002              2.E-06     6.000001
+       4>  6.000004              0.499999   6.000003
+       5>  7                     0.999996   6.500002
+define axis/from/x/name=xax {5,6,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5                    6
+   Axis span (to cell edges) = 1.500003
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5                     1          4.5
+       2>  6                     0.5000005  5.5
+       3>  6.000001              1.E-06     6.000001
+       4>  6.000002              1.E-06     6.000001
+define axis/from/x/name=xax {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   6                    7
+   Axis span (to cell edges) = 1.5
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6                     1.E-06     5.999999
+       2>  6.000001              0.5        6.000001
+       3>  7                     0.999999   6.500001
+! edges
+define axis/from/x/name=xax/edges {5,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    3 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.500001              0.999998   6.000002
+define axis/from/x/name=xax/edges {5,6,6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    4 i   5.5                  6.5
+   Axis span (to cell edges) = 2
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              2.E-06     6
+       3>  6.000003              2.E-06     6.000002
+       4>  6.500002              0.999996   6.000004
+define axis/from/x/name=xax/edges {5,6,6}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   5.5                  6
+   Axis span (to cell edges) = 1.000001
+ 
+       I     X                   XBOX      XBOXLO
+       1>  5.5                   1          5
+       2>  6.000001              1.E-06     6
+define axis/from/x/name=xax/edges {6,6,7}
+show axis/x xax
+ name       axis              # pts   start                end
+ XAX       X                    2 i   6                    6.5
+   Axis span (to cell edges) = 1
+ 
+       I     X                   XBOX      XBOXLO
+       1>  6.000001              1.E-06     6
+       2>  6.500001              0.999999   6.000001
+ 
+! unresolvable repeated points
+set mode ignore
+define axis/from/x/name=xax {6,6}
+define axis/from/x/name=xax/edges {6,6}
+define axis/from/x/name=xax/edges {6,6,6}
+define axis/from/x/name=xax {6,6,6.000001,7}
+define axis/from/x/name=xax/edges {6,6,6.000001,7}
+ 
+! ================= STREAMLINED SYNTAX ================
+! name=expression syntax
+define axis/x XAX2 = {1,2,5}
+show axis/x xax2
+ name       axis              # pts   start                end
+ XAX2      X                    3 i   1                    5
+   Axis span (to cell edges) = 6
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+define axis/unit=days/t0=1-jan-1990 TAX2 = {1,2,5}	! inferred /T
+show axis/t tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                 3 i   02-JAN-1990 00:00    06-JAN-1990 00:00
+T0 = 1-JAN-1990
+   Axis span (to cell edges) = 6
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  02-JAN-1990 00:00:00  1          01-JAN-1990 12:00:00    1
+       2>  03-JAN-1990 00:00:00  2          02-JAN-1990 12:00:00    2
+       3>  06-JAN-1990 00:00:00  3          04-JAN-1990 12:00:00    5
+define axis/depth ZAX2 = {1,2,5}			! inferred /Z
+show axis/z zax2
+ name       axis              # pts   start                end
+ ZAX2      Z                    3 i-  1                    5
+   Axis span (to cell edges) = 6
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  1                     1          0.5
+       2>  2                     2          1.5
+       3>  5                     3          3.5
+ 
+! units inferred from formatting
+define axis/X=130e:180:5 xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      LONGITUDE           11mr   130E                 180E
+   Axis span (to cell edges) = 55 (modulo length = 360)
+define axis/Y=0:80n:5 yax2
+show axis yax2
+ name       axis              # pts   start                end
+ YAX2      LATITUDE            17 r   0                    80N
+   Axis span (to cell edges) = 85
+define axis/X=130e:80w:5/units=blahs xax2
+show axis xax2
+ name       axis              # pts   start                end
+ XAX2      X (BLAHS)           31 r   130                  280
+   Axis span (to cell edges) = 155
+ 
+! cleanup
+set mode/last ignore
+*** Running test: bn_polygon.jnl
+! Demo of new POLYGON command
+! *jd * 3.99
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+set win/asp=.4
+ 
+set mode meta polygon_plot.plt
+polygon/trans/i=1:100/nolable xpts+xsqr, ypts+ysqr, x*x/10
+ 
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! polygon/trans/line=6/fill/over/lev/i=1:100/pattern=ball_bearings/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+polygon/trans/line=6/fill/over/lev/i=1:100/opac=25/nolabel xpts+xsqr, ypts+ysqr+.5, x*x/10
+ 
+polygon/trans/line=4/over/i=1:100/nolabel xpts+xsqr-.25, ypts+ysqr, x*x/10
+ 
+can mode meta
+*** Running test: bn500_bug_fixes.jnl
+! bn500_bug_fixes.jnl
+! test various fixes that went into version 5.00
+! 5/99 *kob*
+ 
+GO bn_reset
+cancel mode verify
+GO err491_RESHAPE_ctx.jnl
+! err491_RESHAPE_ctx
+ 
+! modified 3/2000 to reflect new significance of context limits
+! on arg 2
+ 
+! 3/99 *sh* (bug reported by Jennifer Adams)
+! Ferret fails to recognize that source and dest T axes are different
+! so it erroneously passes T context to src argument
+ 
+! fixed 3/99 with change to GCF_IMPOSE_ARG_LIM_DFLT
+!  (and consequent bug fixes to PARSE_NAM_DSET_GRD and GRID_FROM_NAME)
+ 
+! source data in X,TCAL
+define axis/x=1:5:1 x5
+define axis/y=1:1:1 y1
+define axis/t=15-jan-1951:15-dec-1952/npoints=24 tcal
+define grid/x=x5/y=y1/t=tcal gsrc
+LET src = x[g=gsrc] + t[g=gsrc]
+ 
+list src
+             VARIABLE : X[G=GSRC] + T[G=GSRC]
+             SUBSET   : 5 by 24 points (X-TIME)
+                       1        2        3        4        5     
+                       1        2        3        4        5
+ 15-JAN-1951 /  1:  438289.  438290.  438291.  438292.  438293.
+ 14-FEB-1951 /  2:  439019.  439020.  439021.  439022.  439023.
+ 16-MAR-1951 /  3:  439750.  439751.  439752.  439753.  439754.
+ 16-APR-1951 /  4:  440480.  440481.  440482.  440483.  440484.
+ 16-MAY-1951 /  5:  441211.  441212.  441213.  441214.  441215.
+ 16-JUN-1951 /  6:  441941.  441942.  441943.  441944.  441945.
+ 16-JUL-1951 /  7:  442672.  442673.  442674.  442675.  442676.
+ 16-AUG-1951 /  8:  443402.  443403.  443404.  443405.  443406.
+ 15-SEP-1951 /  9:  444132.  444133.  444134.  444135.  444136.
+ 15-OCT-1951 / 10:  444863.  444864.  444865.  444866.  444867.
+ 15-NOV-1951 / 11:  445593.  445594.  445595.  445596.  445597.
+ 15-DEC-1951 / 12:  446324.  446325.  446326.  446327.  446328.
+ 15-JAN-1952 / 13:  447054.  447055.  447056.  447057.  447058.
+ 14-FEB-1952 / 14:  447785.  447786.  447787.  447788.  447789.
+ 16-MAR-1952 / 15:  448515.  448516.  448517.  448518.  448519.
+ 15-APR-1952 / 16:  449246.  449247.  449248.  449249.  449250.
+ 15-MAY-1952 / 17:  449976.  449977.  449978.  449979.  449980.
+ 15-JUN-1952 / 18:  450706.  450707.  450708.  450709.  450710.
+ 15-JUL-1952 / 19:  451437.  451438.  451439.  451440.  451441.
+ 15-AUG-1952 / 20:  452167.  452168.  452169.  452170.  452171.
+ 14-SEP-1952 / 21:  452898.  452899.  452900.  452901.  452902.
+ 15-OCT-1952 / 22:  453628.  453629.  453630.  453631.  453632.
+ 14-NOV-1952 / 23:  454359.  454360.  454361.  454362.  454363.
+ 15-DEC-1952 / 24:  455089.  455090.  455091.  455092.  455093.
+ 
+! reshaping grid - TCAL ==> 12 month by years
+def axis/t=1951:1952:1 tyear
+def axis/z=1:12:1 zmonth
+!let out_grid = x[g=gsrc,i=1] + y[g=gsrc,j=1] + z[gz=zmonth,k=1] + t[gt=tyear,l=1]  ! pre 3/00
+let out_grid = x[g=gsrc] + y[g=gsrc] + z[gz=zmonth] + t[gt=tyear]
+ 
+! reshape the source data -- OK
+let out = reshape(src,out_grid)
+list out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 by 2 points (X-Z-T)
+             Y        : 0.5 to 1.5
+                1        2        3        4        5     
+                1        2        3        4        5
+ ---- L:1 T:   1951
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ ---- L:2 T:   1952
+ 1    /  1:  447054.  447055.  447056.  447057.  447058.
+ 2    /  2:  447785.  447786.  447787.  447788.  447789.
+ 3    /  3:  448515.  448516.  448517.  448518.  448519.
+ 4    /  4:  449246.  449247.  449248.  449249.  449250.
+ 5    /  5:  449976.  449977.  449978.  449979.  449980.
+ 6    /  6:  450706.  450707.  450708.  450709.  450710.
+ 7    /  7:  451437.  451438.  451439.  451440.  451441.
+ 8    /  8:  452167.  452168.  452169.  452170.  452171.
+ 9    /  9:  452898.  452899.  452900.  452901.  452902.
+ 10   / 10:  453628.  453629.  453630.  453631.  453632.
+ 11   / 11:  454359.  454360.  454361.  454362.  454363.
+ 12   / 12:  455089.  455090.  455091.  455092.  455093.
+ 
+! NOW THE ERROR: L LIMITS PASSED INCORRECTLY(ERRONEOUSLY) TO SRC
+list/l=1 out
+             VARIABLE : RESHAPE(SRC,OUT_GRID)
+             SUBSET   : 5 by 12 points (X-Z)
+             Y        : 0.5 to 1.5
+             T        : 1951
+                1        2        3        4        5     
+                1        2        3        4        5
+ 1    /  1:  438289.  438290.  438291.  438292.  438293.
+ 2    /  2:  439019.  439020.  439021.  439022.  439023.
+ 3    /  3:  439750.  439751.  439752.  439753.  439754.
+ 4    /  4:  440480.  440481.  440482.  440483.  440484.
+ 5    /  5:  441211.  441212.  441213.  441214.  441215.
+ 6    /  6:  441941.  441942.  441943.  441944.  441945.
+ 7    /  7:  442672.  442673.  442674.  442675.  442676.
+ 8    /  8:  443402.  443403.  443404.  443405.  443406.
+ 9    /  9:  444132.  444133.  444134.  444135.  444136.
+ 10   / 10:  444863.  444864.  444865.  444866.  444867.
+ 11   / 11:  445593.  445594.  445595.  445596.  445597.
+ 12   / 12:  446324.  446325.  446326.  446327.  446328.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_delete_child_var.jnl
+! err491_delete_child_var.jnl
+! *sh* 4/99
+ 
+! when a grid-changing variable definition was redefined (replaced)
+! Its child variables were not removed, leading to wrong results
+ 
+! fixed with mod to XEQ_DEFINE
+ 
+! why does ypolymark depend on xpolyshape ??
+let xpolyshape = X[X=1:3:1]
+let ypolyshape = X[X=10:30:10]
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark  ! correct values: 1,2,3
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.00
+ 2   / 2:  20.00
+ 3   / 3:  30.00
+ 
+! THE ACT OF DEFINING XPOLYMARK CHANGES THE OUTCOME ...
+LET xpolymark = XSEQUENCE(xpolyshape) * 1
+LET ypolymark = XSEQUENCE(ypolyshape) * 1
+ 
+list  ypolymark	! incorrect values: 10, 20, 30
+             VARIABLE : XSEQUENCE(YPOLYSHAPE) * 1
+             SUBSET   : 3 points (X)
+ 1   / 1:  10.00
+ 2   / 2:  20.00
+ 3   / 3:  30.00
+ 
+GO bn_reset
+cancel mode verify
+GO err491_dp_time_write.jnl
+! err491_dp_time_write.jnl
+! *sh* 10/98
+ 
+ 
+! when appending ("synchronizing") a new output time to an existing
+! netCDF file, Ferret fails to do a valid double precision comparison
+ 
+ 
+define axis/t="18-jul-1997:14:09":"20-jul-1997:00:09":5/units=min t5
+LET my_var = t[gt=t5]
+ 
+save/clobber/file=out.cdf my_var[l=1]
+sp echo "err491_dp_time_write.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+save/append/file=out.cdf my_var[l=2]
+sp echo "err491_dp_time_write.jnl --- 2 after append" >> all_ncdump.out
+sp ncdump out.cdf >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err491_gmax.jnl
+! err491_gmax.jnl
+! 9 Dec. 1998 *sh*
+ 
+! .. crash when attempting a time regridding with g=@MAX
+ 
+let ts = RANDU(T[T=1-jan-1990:15-jan-1990:1])
+plot ts
+define axis/t="1-jan-1990:12:00":"15-jan-1990:12:00":24/unit=hours t24
+plot/over ts[gt=t24 at ave]
+ 
+! crash when attempting an @MAX regridding
+load ts[gt=t24 at max]
+ 
+GO bn_reset
+cancel mode verify
+GO err491_grid_from_name.jnl
+! err491_grid_from_name.jnl
+! *sh* 3/99
+ 
+! implicit grid, such as "Z[gz=zax]", are allowed in places they shouldn't be
+ 
+! fixed with change to GRID_FROM_NAME (and PARSE_NAM_DSET_GRD)
+ 
+set mode ignore
+define axis/z=1:10:1 z10
+set grid z[gz=z10]
+show grid
+ Default grid for DEFINE VARIABLE is (G001)
+ Last successful data access was on grid (G001)
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ Z10       Z                   10 r   1                    10
+ normal    T
+ normal    E
+ normal    F
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err491_let_d.jnl
+! err491_let_d.jnl
+! *sh* 10/98
+ 
+! using /d in the definition of a data-set independent variable causes a crash
+ 
+let/d a = x+y
+stat/i=1:3/j=1:3 a
+ 
+             X+Y
+             X: 0.5 to 3.5
+             Y: 0.5 to 3.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 9 (3*3*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2
+ Maximum value: 6
+ Mean    value: 4 (unweighted average)
+ Standard deviation: 1.2247
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+! GO err491_long_gif_name.jnl ! moved to bn_gif.jnl
+ 
+GO bn_reset
+cancel mode verify
+GO err491_sh_var_templates.jnl
+! SHOW VARIABLE templates are not robust
+ 
+let mld5dec = 1
+ 
+sho var m*dec		! no response ??
+sho var ml*dec		! no response ??
+sho var mld*dec		! works
+ MLD5DEC = 1
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err491_single_char_replace.jnl
+! err491_single_char_replace.jnl
+ 
+! 4/99 *sh*
+ 
+! erroneous error trap for single character symbol replacement
+!  **ERROR: command syntax: empty argument replacement string: ($undefined|"h")
+SAY ($undefined|"h")
+ !-> MESSAGE/CONTINUE h
+h
+ 
+! but OK in this case
+SAY ($undefined|"hh")
+ !-> MESSAGE/CONTINUE hh
+hh
+ 
+GO bn_reset
+cancel mode verify
+GO err491_spawn_quotes.jnl
+! err491_spawn_quotes.jnl
+ 
+! fixed in xeq_spawn 1/99 *sh*
+ 
+! this should be a valid command
+SPAWN "date"
+Mon Mar 31 17:26:52 PDT 2014
+ 
+GO bn_reset
+cancel mode verify
+GO err491_time_regridding.jnl
+! err491_time_regridding.jnl
+! from Jon 10/16/98
+ 
+! this core dumps ... it is unable to reconcile the
+! l=13:48 in the current region with the t=15-jan-1995:15-jan-1998
+! (which corresponds to L=1:37) in the definition of "bad"
+ 
+!set mode diag
+set wind/siz=.3
+ 
+set data TAO_SST_clim.cdf
+ 
+define axis/t=15-jan-1995:15-dec-1999:1/unit=mon my_t_axis
+ 
+let good = sst_clim[gt=my_t_axis]
+let bad  = sst_clim[gt=my_t_axis,t=15-jan-1995:15-jan-1998]
+ 
+set region/x=125w/y=0n/l=13:48
+ 
+plot     good[x=@sbx:3]
+plot/over     good[y=@sbx:3]
+plot/over     good[z=@sbx:3]
+plot/over     good[t=@sbx:3]
+ 
+ 
+cancel memory/all
+plot/over bad[x=@sbx:3]
+plot/over bad[y=@sbx:3]
+plot/over bad[z=@sbx:3]
+plot/over bad[t=@sbx:3]
+ 
+! 3/01 *kob* uncomment the below - seems to run on all systems
+GO bn_reset
+cancel mode verify
+GO err491_unknown_function.jnl
+! err491_unknown_function
+! 3/99 *sh*
+ 
+! when unknown function occurs in the 2nd (or higher) expression in a line
+! a crash occurs
+ 
+! crash occurs processing error message in subroutine RPN.
+! Cause is incorrect string limits passed from INIT_UVAR_SUB.
+ 
+set mode ignore
+stat i, noname(i)
+can mode ignore
+ 
+! *kob* added 6/11/1999
+GO bn_reset
+cancel mode verify
+GO err500_IF_THEN_ELSE_quote.jnl
+! err500_IF_THEN_ELSE_quote.jnl
+ 
+! 6/9/99 - final quotation mark is lost by parser resulting in error.
+ 
+! solved 6/11/99 in xeq_if.F
+ 
+ 
+IF 1 THEN SAY "I is too big" ENDIF
+I is too big
+*** Running test: bn_sample.jnl
+! bn_sample.jnl
+! 10/99 *sh*
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+ 
+! test the internally optimized version of the SAMPLE* commands
+ 
+! basic file variable access
+use coads_climatology
+let/quiet a = sst
+list sst[I=30:50:10,l=1,y=-2:2]		! reference listing
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 16-JAN 06:00
+              79E    99E   119E   
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+list SAMPLEI(sst[l=1,y=0],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+list SAMPLEI(sst[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  28.58  28.59  28.15
+ 1S   / 45:  28.33  28.71  28.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  29.14  28.92  28.33
+ 1S   / 45:  28.90  28.82  28.54
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1987
+            largest free region: 1984
+            number of free regions: 4
+            free memory table slots: 487
+            number of UN-CACHED variables: 0
+ 
+! these should break sampling up into separate reads
+cancel memory/all
+set mode diagnostic
+list/i=2 SAMPLEI(sst[l=1,y=-2:2],{30,40,50})	! only I=2 from result
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I:   30   30  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 13 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  8 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 11 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  5 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 14 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 2
+             TIME     : 16-JAN 06:00
+               2    
+               2
+ 1N   / 46:  28.20
+ 1S   / 45:  28.56
+ -DELETE (C01,V02 M: 16 dset:   1 I:    2    2  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+cancel memory/all
+ -DELETE (C09,V02 M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M:  7 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C09,V02 M: 12 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 15 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ reading SST      M:  8 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  5 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 12 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 15 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a  ,{30,40,50})
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  5 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A  ,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20  28.45
+ 1S   / 45:  28.15  28.56  28.83
+ 
+! these should NOT break up the access into chunks
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M:  8 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:   50   50  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:   30   30  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 16 dset:   1 I:   40   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(sst[i=30:40],{30,40,50})
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    (C09,V02 C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[I=30:40],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20   ....
+ 1S   / 45:  28.15  28.56   ....
+let/quiet a = sst[i=30:40]
+ -DELETE (C09,V02 M:  9 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+cancel memory/all
+ -DELETE SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M:  9 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 14 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N   / 46:  28.22  28.20   ....
+ 1S   / 45:  28.15  28.56   ....
+cancel memory/all
+ -DELETE A        M:  8 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,{30})		! sample at just 1 point
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30}     M: 16 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C:  9 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  8 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30}     M: 16 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : 16-JAN 06:00
+               1    
+               1
+ 1N   / 46:  28.22
+ 1S   / 45:  28.15
+cancel memory/all
+ -DELETE SST      M: 12 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 14 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=-2:2  SAMPLEI(a,30)			! sample at just 1 point
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V02 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  7 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C11,V02 C:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     1 dset:   1
+ eval    A        C: 11 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 15 dset:   0 I:    1    1  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (LATITUDE)
+             X        : 1
+             TIME     : 16-JAN 06:00
+               1    
+               1
+ 1N   / 46:  28.22
+ 1S   / 45:  28.15
+cancel memory/all
+ -DELETE A        M:  9 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C11,V02 M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 15 dset:   1 I:    1    1  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 16 dset:   1 I:   30   40  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+let/quiet fsst = sst[x=@fln] 		! fill holes to allow @iin to work
+let/quiet a = fsst[i=@iin]		! @iin forces all-at-once
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+list/l=1/y=-2:2  SAMPLEI(a,{30,40,50})
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid FSST     C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ eval    A        C:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> FSST[X=20E:20E(380)@IIN,D=1]
+ eval    FSST     C: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[I=1:180 at FLN:1,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ reading SST      M:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[I=1:180 at FLN:1,D=1]
+ doing --> FSST[X=20E:20E(380)@IIN,D=1]
+ -DELETE          M: 14 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE          M: 15 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  5 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 16 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+                 1          2          3      
+                 1          2          3
+ 1N   / 46:  1.829E+08  2.458E+08  3.068E+08
+ 1S   / 45:  1.837E+08  2.469E+08  3.095E+08
+cancel memory/all
+ -DELETE FSST     M:  4 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  7 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  8 dset:   1 I:    0  181  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE FSST     M: 13 dset:   1 I:    1  180  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 15 dset:   1 I:    1    3  J:   45   46  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! now test optimization that uses large memory chunks if available
+cancel memory/all
+load/l=1/y=0 sst[I=30:50]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 12 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE EX#1     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:39]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  7 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  9 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 12 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:   40   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   39  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:40]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  9 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  7 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+ -DELETE EX#1     M:  7 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M:  9 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 15 dset:   1 I:   30   40  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+load/l=1/y=0 sst[I=30:41]
+ dealloc  dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 15 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+list/l=1/y=0  SAMPLEI(sst,{30,40,50})
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I: -999 -999  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ const_v {30-,50} M:  9 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   1
+ found   SST      M: 15 dset:   1 I:   30   41  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   50   50  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M: 13 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE EX#1     M:  7 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   1 I:    1    3  J:   45   45  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {30-,50} M:  9 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+set mode/last diagnostic
+ 
+! sampling a user var
+let/quiet a = sst + 1
+list SAMPLEI(a[l=1:3,y=-2:2],{30,40,50})
+             VARIABLE : SAMPLEI(A[L=1:3,Y=-2:2],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  29.22  29.20  29.45
+ 1S   / 45:  29.15  29.56  29.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  29.58  29.59  29.15
+ 1S   / 45:  29.33  29.71  29.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  30.14  29.92  29.33
+ 1S   / 45:  29.90  29.82  29.54
+let/quiet a = sst[l=1:3,y=-2:2] + 1		! same result, different syntax
+list SAMPLEI(a, {30,40,50})
+             VARIABLE : SAMPLEI(A, {30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 2 by 3 points (X-LATITUDE-TIME)
+               1      2      3    
+               1      2      3
+ ---- L:1 T:   16-JAN 06:00
+ 1N   / 46:  29.22  29.20  29.45
+ 1S   / 45:  29.15  29.56  29.83
+ ---- L:2 T:   15-FEB 16:29
+ 1N   / 46:  29.58  29.59  29.15
+ 1S   / 45:  29.33  29.71  29.47
+ ---- L:3 T:   17-MAR 02:58
+ 1N   / 46:  30.14  29.92  29.33
+ 1S   / 45:  29.90  29.82  29.54
+ 
+! combined with a dynamic axis
+list SAMPLEI(sst[l=1,y=1s:1n:.5],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=1S:1N:.5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N    / 5:  28.22  28.20  28.45
+ 0.5N  / 4:  28.20  28.29  28.55
+ 0     / 3:  28.19  28.38  28.64
+ 0.5S  / 2:  28.17  28.47  28.74
+ 1S    / 1:  28.15  28.56  28.83
+show grid/dyn
+Dynamic grids:
+    GRID (G003)                          use count:   2
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX004)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G002)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX004)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX004)                         use count:   2
+cancel memory/all
+let/quiet a = sst[l=1,y=1s:1n:.5]
+list SAMPLEI(a,{30,40,50})
+             VARIABLE : SAMPLEI(A,{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 5 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3    
+               1      2      3
+ 1N    / 5:  28.22  28.20  28.45
+ 0.5N  / 4:  28.20  28.29  28.55
+ 0     / 3:  28.19  28.38  28.64
+ 0.5S  / 2:  28.17  28.47  28.74
+ 1S    / 1:  28.15  28.56  28.83
+show grid/dyn
+Dynamic grids:
+    GRID (G002)                          use count:   1
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX005)   LATITUDE             5 r   1S                   1N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX005)                         use count:   2
+ 
+! sampling a pseudo-variable
+list SAMPLEI(X[x=1:12],{3,4,7,15})
+             VARIABLE : SAMPLEI(X[X=1:12],{3,4,7,15})
+             SUBSET   : 4 points (X)
+ 1   / 1:  3.000
+ 2   / 2:  4.000
+ 3   / 3:  7.000
+ 4   / 4:   ....
+list SAMPLEI(X[x=111:120],{3,4,7})	! indices out of range
+             VARIABLE : SAMPLEI(X[X=111:120],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=111:120:1],{3,4,7})	! now OK
+             VARIABLE : SAMPLEI(X[X=111:120:1],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  113.0
+ 2   / 2:  114.0
+ 3   / 3:  117.0
+list SAMPLEI(X[x=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+cancel memory/all
+let/quiet a = X[x=110:200:10]
+list SAMPLEI(a,{3,4,7})
+             VARIABLE : SAMPLEI(A,{3,4,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+ 
+! sampling a constant !!??!
+list SAMPLEI(5,{3,,1})
+             VARIABLE : SAMPLEI(5,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  5.000
+let/quiet a = 5
+list SAMPLEI(a,{3,,1})
+             VARIABLE : SAMPLEI(A,{3,,1})
+             SUBSET   : 3 points (X)
+ 1   / 1:   ....
+ 2   / 2:   ....
+ 3   / 3:  5.000
+ 
+! sampling a constant list
+list SAMPLEI({1,2,3,4,5},{3,,7})
+             VARIABLE : SAMPLEI({1,2,3,4,5},{3,,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  3.000
+ 2   / 2:   ....
+ 3   / 3:   ....
+ 
+! over-defined X axis limits
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:  28.56
+ 3   / 3:  28.83
+cancel memory/all
+list SAMPLEI(sst[l=1,y=0,i=35:38],{30,40,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=35:38],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! sampling with disordered and missing values in the index list
+list SAMPLEI(sst[l=1,y=-2:2],{30,40,,50})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{30,40,,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3      4    
+               1      2      3      4
+ 1N   / 46:  28.22  28.20   ....  28.45
+ 1S   / 45:  28.15  28.56   ....  28.83
+list SAMPLEI(sst[l=1,y=-2:2],{40,,50,30})
+             VARIABLE : SAMPLEI(SST[L=1,Y=-2:2],{40,,50,30})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (X-LATITUDE)
+             TIME     : 16-JAN 06:00
+               1      2      3      4    
+               1      2      3      4
+ 1N   / 46:  28.20   ....  28.45  28.22
+ 1S   / 45:  28.56   ....  28.83  28.15
+ 
+! out of bounds indices
+list SAMPLEI(sst[l=1,y=0,i=30:50],{30 ,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{30 ,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+            1S    
+            45
+ 1   / 1:  28.15
+ 2   / 2:   ....
+ 3   / 3:   ....
+list SAMPLEI(sst[l=1,y=0,i=30:50],{-300,400,500})
+             VARIABLE : SAMPLEI(SST[L=1,Y=0,I=30:50],{-300,400,500})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           1S  
+           45
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list SAMPLEI(X[x=110:200:10],{3,40,7})
+             VARIABLE : SAMPLEI(X[X=110:200:10],{3,40,7})
+             SUBSET   : 3 points (X)
+ 1   / 1:  130.0
+ 2   / 2:   ....
+ 3   / 3:  170.0
+ 
+! sampling along a normal axis
+list SAMPLEI(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEI(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 by 10 points (X-Y)
+              1   2   3   
+               1   2   3
+ 110   /  1:............
+ 120   /  2:............
+ 130   /  3:............
+ 140   /  4:............
+ 150   /  5:............
+ 160   /  6:............
+ 170   /  7:............
+ 180   /  8:............
+ 190   /  9:............
+ 200   / 10:............
+ 
+! test sampling optimization
+cancel memory/all
+set mode diagnostic
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+ dealloc  dynamic grid (G003)          NORMAL    (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          ABSTRACT  (AX004)   NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V02 C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V02 C: 10 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          ABSTRACT  COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ eval    (C09,V02 C: 10 dset:   1 I:   31   35  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading SST      M: 11 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  4 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    (C09,V02 C: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M: 13 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE SST      M: 14 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+ 
+! test cache hits
+list SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48}) !   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V02 C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ found   (C09,V02 M:  8 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V02 M:  3 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V02 M: 16 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE (C01,V02 M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  7 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 10 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M: 15 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+set mode/last diagnostic
+let a = SAMPLEI(sst[l=1,y=5N],{31,33,35,37,44,46,48})
+load a
+set mode diagnostic
+list a 			!   <-- CACHE HIT FAILS!!!
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V01 C:  8 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {31-,48} M:  3 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     7 dset:   1
+ found   (C09,V01 M:  8 dset:   1 I:   31   35  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V01 M: 15 dset:   1 I:   37   37  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   (C09,V01 M: 10 dset:   1 I:   44   48  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE          M: 12 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L:    7    7  M: -999 -999  N: -999 -999
+ -DELETE          M: 16 dset:   1 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  2 dset:   1 I:    1    7  J:   48   48  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE {31-,48} M:  3 dset:   0 I:    1    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : SAMPLEI(SST[L=1,Y=5N],{31,33,35,37,44,46,48})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 5N
+             TIME     : 16-JAN 06:00
+            5N    
+            48
+ 1   / 1:  27.52
+ 2   / 2:  27.85
+ 3   / 3:  27.99
+ 4   / 4:  28.03
+ 5   / 5:  26.23
+ 6   / 6:  27.06
+ 7   / 7:  27.28
+set mode/last diagnostic
+ 
+SHOW MEM/FREE
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 12800
+ 
+            number of free memory blocks: 1990
+            largest free region: 1990
+            number of free regions: 1
+            free memory table slots: 490
+            number of UN-CACHED variables: 0
+ 
+! test SAMPLEJ
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEJ(a[l=1,k=1:2,x=180],30)
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],30)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             Y        : 1
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 0   / 1:  22.64
+ 5   / 2:  27.64
+list SAMPLEJ(a[l=1,k=1:2,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEJ(A[L=1,K=1:2,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 by 2 points (Y-Z)
+             LONGITUDE: 179E
+             TIME     : 16-JAN 06:00
+             1      2      3      4    
+             1      2      3      4
+ 0   / 1:  22.64  23.53  26.91  29.26
+ 5   / 2:  27.64  28.53  31.91  34.26
+list SAMPLEJ(a[l=1,k=1,x=180],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             LONGITUDE: 179E
+             Z        : 0
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  22.64
+ 2   / 2:  29.26
+ 3   / 3:  27.73
+list SAMPLEJ(a[l=1,k=1,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEJ(A[L=1,K=1,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Y)
+             Z        : 0
+             TIME     : 16-JAN 06:00
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  23.56  22.61  21.94  22.55  22.59  22.44  21.96  22.28  21.66
+ 2   / 2:  29.35  29.17  29.23  29.44  29.09  29.34  29.13  28.65  28.91
+ 3   / 3:  27.97  28.06  27.86  27.91  27.43  27.41  27.36  27.40  27.12
+list SAMPLEJ(Y[y=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEJ(Y[Y=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Y)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEJ(YSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Y)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEJ(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEJ(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Y)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEK
+let/quiet a = sst + Z[z=0:500:5]
+list SAMPLEK(a[l=1,y=0,x=180],30)
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],30)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+          173.2
+list SAMPLEK(a[l=1,y=0,x=180],{30,31,35, 40})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,31,35, 40})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  173.2
+ 2   / 2:  178.2
+ 3   / 3:  198.2
+ 4   / 4:  223.2
+list SAMPLEK(a[l=1,y=0,x=180],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=180],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           179E   
+            80
+ 1   / 1:  173.2
+ 2   / 2:  223.2
+ 3   / 3:  273.2
+list SAMPLEK(a[l=1,y=0,x=160e:160w:5],{30,40,50})
+             VARIABLE : SAMPLEK(A[L=1,Y=0,X=160E:160W:5],{30,40,50})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-Z)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  174.2  174.2  174.0  173.3  173.5  172.8  173.0  172.5  171.9
+ 2   / 2:  224.2  224.2  224.0  223.3  223.5  222.8  223.0  222.5  221.9
+ 3   / 3:  274.2  274.2  274.0  273.3  273.5  272.8  273.0  272.5  271.9
+list SAMPLEK(Z[z=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEK(Z[Z=110:200:10],{3,4,7})
+             SUBSET   : 3 points (Z)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEK(ZSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (Z)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEK(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEK(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-Z)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+! test SAMPLEL
+let/quiet a = sst + Z[z=0:500:5]
+! Note: (V550) In the SAMPLEL examples which follow the L index values
+! which exceed L=3 lie outside of the time axis range.  As of V550 this
+! triggers a subspan modulo operation (3 months from the full year of 12)
+list SAMPLEL(a[y=0,k=1:2,x=180],5)
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],5)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 points (Z)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             T        : 1
+           179E   
+            80
+ 0   / 1:  28.20
+ 5   / 2:  33.20
+list SAMPLEL(a[y=0,k=1:2,x=180],{2,3,5, 10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1:2,X=180],{2,3,5, 10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 4 points (Z-T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             0      5    
+             1      2
+ 1   / 1:  28.36  33.36
+ 2   / 2:  28.35  33.35
+ 3   / 3:  28.20  33.20
+ 4   / 4:  28.36  33.36
+list SAMPLEL(a[y=0,k=1,x=180],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=180],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             Z        : 0
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.20
+ 3   / 3:  28.36
+list SAMPLEL(a[y=0,k=1,x=160e:160w:5],{1,5,10})
+             VARIABLE : SAMPLEL(A[Y=0,K=1,X=160E:160W:5],{1,5,10})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 9 by 3 points (LONGITUDE-T)
+             LATITUDE : 1S
+             Z        : 0
+           160E   165E   170E   175E    180E  175W   170W   165W   160W   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:  29.17  29.22  28.96  28.31  28.53  27.80  27.99  27.55  26.93
+ 2   / 2:  29.17  29.22  28.96  28.31  28.53  27.80  27.99  27.55  26.93
+ 3   / 3:  29.05  29.19  28.72  29.52  28.33  28.19  27.48  27.47  26.79
+list SAMPLEL(T[t=110:200:10],{3,4,7})
+             VARIABLE : SAMPLEL(T[T=110:200:10],{3,4,7})
+             SUBSET   : 3 points (T)
+ 1   / 1:  130.0
+ 2   / 2:  140.0
+ 3   / 3:  170.0
+list SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             VARIABLE : SAMPLEL(TSEQUENCE({1,2,3,4,5}),{5,2,3,,7,2})
+             SUBSET   : 6 points (T)
+ 1   / 1:  5.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:   ....
+ 5   / 5:   ....
+ 6   / 6:  2.000
+list SAMPLEL(X[x=110:200:10],{3,4,7})	! normal axis
+             VARIABLE : SAMPLEL(X[X=110:200:10],{3,4,7})
+             SUBSET   : 10 by 3 points (X-T)
+           110 120 130 140 150 160 170 180 190 200 
+            1   2   3   4   5   6   7   8   9  10
+ 1   / 1:........................................
+ 2   / 2:........................................
+ 3   / 3:........................................
+ 
+*** Running test: bn_strides_revs_perms.jnl
+! bn_strides_revs_perms.jnl
+! *sh* 6/99
+ 
+! exercise special netCDF performance and robustness enhancements to allow
+! reading with strides and permuting and reversing axes
+ 
+! * * * * * PERMUTATIONS * * * * *
+! How to evaluate the correct ordering:
+! The data in bn_strides.cdf is ordered with the 1's digit
+! moving fastert, then the 10's, then 100's, etc.
+ 
+! If (say) /ORDER=ZXY is given we should see the 100's digit
+! moving fastest (left to right on each line), the 1's next
+! (vertically within each block of output), and the 10's next
+! advancing from block to block
+ 
+canc data/all
+cancel mode diagnostic
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1123.  1124.  1125.  1126.
+ 3   / 3:  1133.  1134.  1135.  1136.
+ 4   / 4:  1143.  1144.  1145.  1146.
+ ---- K:2 Z:   2
+ 2   / 2:  1223.  1224.  1225.  1226.
+ 3   / 3:  1233.  1234.  1235.  1236.
+ 4   / 4:  1243.  1244.  1245.  1246.
+canc data/all
+ 
+use/order=yx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1132.  1142.  1152.  1162.
+ 3   / 3:  1133.  1143.  1153.  1163.
+ 4   / 4:  1134.  1144.  1154.  1164.
+ ---- K:2 Z:   2
+ 2   / 2:  1232.  1242.  1252.  1262.
+ 3   / 3:  1233.  1243.  1253.  1263.
+ 4   / 4:  1234.  1244.  1254.  1264.
+canc data/all
+ 
+use/order=zyx bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1321.  1421.  1521.  1621.
+ 3   / 3:  1331.  1431.  1531.  1631.
+ 4   / 4:  1341.  1441.  1541.  1641.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1422.  1522.  1622.
+ 3   / 3:  1332.  1432.  1532.  1632.
+ 4   / 4:  1342.  1442.  1542.  1642.
+canc data/all
+ 
+use/order=zxy bn_strides
+list bigvar
+             VARIABLE : VAR
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 2:  1312.  1412.  1512.  1612.
+ 3   / 3:  1313.  1413.  1513.  1613.
+ 4   / 4:  1314.  1414.  1514.  1614.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1422.  1522.  1622.
+ 3   / 3:  1323.  1423.  1523.  1623.
+ 4   / 4:  1324.  1424.  1524.  1624.
+canc data/all
+ 
+! now with an XYT variable
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   142E   143E   144E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 3N   / 3:  1031.  1032.  1033.  1034.
+ 2N   / 2:  1021.  1022.  1023.  1024.
+ 1N   / 1:  1011.  1012.  1013.  1014.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 3N   / 3:  2031.  2032.  2033.  2034.
+ 2N   / 2:  2021.  2022.  2023.  2024.
+ 1N   / 1:  2011.  2012.  2013.  2014.
+canc data/all
+ 
+use/order=yx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      2      3      4    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 141   / 1:  1011.  1021.  1031.  1041.
+ 142   / 2:  1012.  1022.  1032.  1042.
+ 143   / 3:  1013.  1023.  1033.  1043.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 141   / 1:  2011.  2021.  2031.  2041.
+ 142   / 2:  2012.  2022.  2032.  2042.
+ 143   / 3:  2013.  2023.  2033.  2043.
+canc data/all
+ 
+use/order=tyx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34320  34321  34322  
+              1      2      3      4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.  2031.  3031.  4031.
+ 2N   / 2:  1021.  2021.  3021.  4021.
+ 1N   / 1:  1011.  2011.  3011.  4011.
+ ---- L:2 T:   142
+ 3N   / 3:  1032.  2032.  3032.  4032.
+ 2N   / 2:  1022.  2022.  3022.  4022.
+ 1N   / 1:  1012.  2012.  3012.  4012.
+canc data/all
+ 
+use/order=txy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- K:2 Z:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! ambiguous mapping
+use/order=tx bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar
+             VARIABLE : L*1000 + J*10 + I
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  2011.  3011.  4011.
+ 142   / 2:  1012.  2012.  3012.  4012.
+ 143   / 3:  1013.  2013.  3013.  4013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  2021.  3021.  4021.
+ 142   / 2:  1022.  2022.  3022.  4022.
+ 143   / 3:  1023.  2023.  3023.  4023.
+canc data/all
+ 
+! final "z" goes beyond the 3D -- no effect
+use/order=txyz bn_strides
+show grid xytvar
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+show grid var
+    GRID GPC1
+ name       axis              # pts   start                end
+ TAX1_1    X                    1 r   1                    1
+ XAX1_4    Y                    4 r   1                    4
+ YAX1_3    Z                    3 r   1                    3
+ ZAX1_2    T                    2 r   1                    2
+ normal    E
+ normal    F
+canc data/all
+ 
+! * * * * * STRIDES * * * * *
+use bn_strides
+set mode diag
+cancel memory/all
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bn_strides.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      L*1000 + K*100 + J*10 + I        1:4       1:3       1:2       1:1       ...       ...
+ MIDVAR   VAR                              1:9       1:8       1:7       1:6       ...       ...
+ BIGVAR   VAR                              1:40      1:30      1:20      1:10      ...       ...
+ UNEVENVAR
+          L*1000 + K*100 + J[GY=YUNEVEN]*  1:10      1:8       1:6       1:4       ...       ...
+ XYTVAR   L*1000 + J*10 + I                1:40      1:30      ...       1:20      ...       ...
+ 
+ 
+! basic strides
+LIST VAR[i=2:4:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST VAR[i=2:4:2]
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ found   VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit through non-file variable
+let a = VAR[i=2:4:2]
+list a
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  9 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  1 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  2 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+list a		! from cache ...
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : VAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE VAR      M:  1 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+load var
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M:  2 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  1 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+CANC MEM/ALL
+ -DELETE VAR      M:  2 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:  2 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 1    / 1:  1111.
+ 4    / 2:  1114.
+ 7    / 3:  1113.
+ 10   / 4:  1112.
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:  2 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G007)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  3 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G007)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  3 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+ 
+! deliberate error
+set mode ignore; LIST/i=2:4:2 VAR; cancel mode ignore
+ dealloc  dynamic grid (G007)          (AX020)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ 
+! averaging causes bypass of strides
+LIST VAR[i=2:4:2 at ave]
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @AVE
+ reading VAR      M:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  2 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  3 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 11   / 3:  1121.
+ 16   / 4:  1126.
+ 21   / 5:  1131.
+ -DELETE A        M:  1 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G007)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  1 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M:  6 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+            11     16     21    
+             3      4      5
+ 1   / 1:  1121.  1126.  1131.
+ 3   / 2:  1141.  1146.  1151.
+ 5   / 3:  1161.  1166.  1171.
+ 7   / 4:  1181.  1186.  1191.
+ 
+! ****** unequally spaced points on parent axis
+! reference data
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G007)          (AX021)   (AX022)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE A        M:  6 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0      0.3    0.48   0.6   
+            1      2      3      4
+          1111.  1112.  1113.  1114.
+cancel mem/all
+ -DELETE A        M:  1 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  2 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit after changes to COMPLETE_MISSING_LIMS and FLESH_OUT_AXIS
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ found   UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit through non-file variable
+let a = UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G007)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+list/order=x/j=1/k=1/l=1 a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G006)           @XACT
+ rdstride UNE-NVAR C: 10 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  6 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+list/order=x/j=1/k=1/l=1 a		! from cache ...
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+             VARIABLE : UNEVENVAR[I=2:4:2]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+ -DELETE A        M:  5 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+load/k=1/l=1 UNEVENVAR
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ reading UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G006)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+             0     
+              1
+ 0.3  / 1:  1112.
+ 0.6  / 2:  1114.
+LIST/j=1/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:5:2]
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    2    4  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ doing limits reconciliation on Y axis: UNEVENVAR
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+             0     
+              1
+ 0.3  / 1:  1112.
+ 0.6  / 2:  1114.
+ -DELETE UNE-NVAR M:  5 dset:   1 I:    1    1  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+CANC MEM/ALL
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    2  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XUNEVEN
+LIST/order=x UNEVENVAR[I=1:30:7,j=1,k=1,l=1]    ! 1, 8, 15(5), 22(2)
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ strip moduloing UNEVENVAR on X axis:     1    29 dset:   1
+ reading UNE-NVAR M:  6 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing UNEVENVAR on X axis:     1    10 dset:   1
+ regrid  UNE-NVAR M:  3 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0      0.9    1.87   2.65   3.3   
+            1      2      3      4      5
+          1111.  1118.  1115.  1112.  1119.
+cancel axis/modulo XUNEVEN
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1   29  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST/k=1/l=1 UNEVENVAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    2    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 points (X-Y)
+             Z        : 1
+             T        : 1
+             0.3    0.6   
+              1      2
+ 0    / 1:  1112.  1114.
+ 0.95 / 2:  1132.  1134.
+LIST/k=1/l=1 UNEVENVAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G007)          (AX020)   (AX022)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    2  J:    1    2  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  6 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    2    6  J:    1    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X, on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             Z        : 1
+             T        : 1
+             0.3    0.6    0.78  
+              1      2      3
+ 0    / 1:  1112.  1114.  1116.
+ 0.95 / 2:  1132.  1134.  1136.
+ 1.4  / 3:  1152.  1154.  1156.
+ 
+! averaging causes bypass of strides
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2 at ave]
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    3  J:    1    3  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @AVE
+ reading UNE-NVAR M:  6 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1111.60376
+ 0.6  / 2:  1113.79689
+ 0.78 / 3:  1115.87072
+ 0.9  / 4:  1117.90449
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=2:8:2]		! for comparison
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M:  3 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    2    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0.3  / 1:  1112.00000
+ 0.6  / 2:  1114.00000
+ 0.78 / 3:  1116.00000
+ 0.9  / 4:  1118.00000
+ 
+! test special logic in tm_world_recur for endpoints of strides on irreg axis
+LIST/j=1/k=1/l=1/precision=9 UNEVENVAR[i=1:10:2 at ave]
+ dealloc  dynamic grid (G007)          (AX023)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @AVE
+ reading UNE-NVAR M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  UNE-NVAR M:  4 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X at AVE
+             FILENAME : bn_strides.cdf
+             SUBSET   : 5 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+                0       
+                 1
+ 0    / 1:  1111.22629
+ 0.48 / 2:  1112.70797
+ 0.7  / 3:  1114.84240
+ 0.85 / 4:  1116.89020
+ 0.95 / 5:  1119.13604
+ 
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2]
+ dealloc  dynamic grid (G007)          (AX021)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M:  4 dset:   1 I:    1    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1123.  1125.  1127.  1129.
+ 3   / 3:  1133.  1135.  1137.  1139.
+ 4   / 4:  1143.  1145.  1147.  1149.
+ ---- K:2 Z:   2
+ 2   / 2:  1223.  1225.  1227.  1229.
+ 3   / 3:  1233.  1235.  1237.  1239.
+ 4   / 4:  1243.  1245.  1247.  1249.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G007)          (AX023)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  4 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1124.  1125.  1126.
+ 4   / 2:  1143.  1144.  1145.  1146.
+ 6   / 3:  1163.  1164.  1165.  1166.
+ ---- K:2 Z:   2
+ 2   / 1:  1223.  1224.  1225.  1226.
+ 4   / 2:  1243.  1244.  1245.  1246.
+ 6   / 3:  1263.  1264.  1265.  1266.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G007)          XAX1_40   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  4 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1125.  1127.  1129.
+ 4   / 2:  1143.  1145.  1147.  1149.
+ 6   / 3:  1163.  1165.  1167.  1169.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1325.  1327.  1329.
+ 4   / 2:  1343.  1345.  1347.  1349.
+ 6   / 3:  1363.  1365.  1367.  1369.
+canc data/all
+ -DELETE UNE-NVAR M:  3 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M:  6 dset:   1 I:    1    9  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX023)   (AX022)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX020)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1321.  1521.  1721.  1921.
+ 3   / 3:  1331.  1531.  1731.  1931.
+ 4   / 4:  1341.  1541.  1741.  1941.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1522.  1722.  1922.
+ 3   / 3:  1332.  1532.  1732.  1932.
+ 4   / 4:  1342.  1542.  1742.  1942.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YAX1_30   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1421.  1521.  1621.
+ 4   / 2:  1341.  1441.  1541.  1641.
+ 6   / 3:  1361.  1461.  1561.  1661.
+ ---- K:2 Z:   2
+ 2   / 1:  1322.  1422.  1522.  1622.
+ 4   / 2:  1342.  1442.  1542.  1642.
+ 6   / 3:  1362.  1462.  1562.  1662.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX020)   XAX1_40   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1521.  1721.  1921.
+ 4   / 2:  1341.  1541.  1741.  1941.
+ 6   / 3:  1361.  1561.  1761.  1961.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1523.  1723.  1923.
+ 4   / 2:  1343.  1543.  1743.  1943.
+ 6   / 3:  1363.  1563.  1763.  1963.
+canc data/all
+ -DELETE BIGVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zxy bn_strides
+list bigvar[i=3:9:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    9  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 2:  1312.  1512.  1712.  1912.
+ 3   / 3:  1313.  1513.  1713.  1913.
+ 4   / 4:  1314.  1514.  1714.  1914.
+ ---- K:2 Z:   2
+ 2   / 2:  1322.  1522.  1722.  1922.
+ 3   / 3:  1323.  1523.  1723.  1923.
+ 4   / 4:  1324.  1524.  1724.  1924.
+list bigvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XAX1_40   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  6 dset:   1 I:    1    4  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  5 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  6 dset:   1 I:    3    6  J:    2    6  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      4      5      6    
+             3      4      5      6
+ ---- K:1 Z:   1
+ 2   / 1:  1312.  1412.  1512.  1612.
+ 4   / 2:  1314.  1414.  1514.  1614.
+ 6   / 3:  1316.  1416.  1516.  1616.
+ ---- K:2 Z:   2
+ 2   / 1:  1322.  1422.  1522.  1622.
+ 4   / 2:  1324.  1424.  1524.  1624.
+ 6   / 3:  1326.  1426.  1526.  1626.
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G006)          ZAX1_20   (AX023)   YAX1_30   TAX1_10   NORMAL    NORMAL
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    6  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  5 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1312.  1512.  1712.  1912.
+ 4   / 2:  1314.  1514.  1714.  1914.
+ 6   / 3:  1316.  1516.  1716.  1916.
+ ---- K:2 Z:   3
+ 2   / 1:  1332.  1532.  1732.  1932.
+ 4   / 2:  1334.  1534.  1734.  1934.
+ 6   / 3:  1336.  1536.  1736.  1936.
+canc data/all
+ -DELETE BIGVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+show grid xytvar
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 3N   / 3:  1031.  1033.  1035.  1037.
+ 2N   / 2:  1021.  1023.  1025.  1027.
+ 1N   / 1:  1011.  1013.  1015.  1017.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 3N   / 3:  2031.  2033.  2035.  2037.
+ 2N   / 2:  2021.  2023.  2025.  2027.
+ 1N   / 1:  2011.  2013.  2015.  2017.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   142E   143E   144E   
+              1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 6N   / 3:  1061.  1062.  1063.  1064.
+ 4N   / 2:  1041.  1042.  1043.  1044.
+ 2N   / 1:  1021.  1022.  1023.  1024.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 6N   / 3:  2061.  2062.  2063.  2064.
+ 4N   / 2:  2041.  2042.  2043.  2044.
+ 2N   / 1:  2021.  2022.  2023.  2024.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          XLON      (AX020)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=yx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ YLAT      X (degrees_north)   30 r   1                    30
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            YLAT      XLON      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      3      5      7    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 141   / 1:  1011.  1031.  1051.  1071.
+ 142   / 2:  1012.  1032.  1052.  1072.
+ 143   / 3:  1013.  1033.  1053.  1073.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 141   / 1:  2011.  2031.  2051.  2071.
+ 142   / 2:  2012.  2032.  2052.  2072.
+ 143   / 3:  2013.  2033.  2053.  2073.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      2      3      4    
+               1      2      3      4
+ ---- L:1 T:   01-JAN-1995 00:00
+ 142   / 1:  1012.  1022.  1032.  1042.
+ 144   / 2:  1014.  1024.  1034.  1044.
+ 146   / 3:  1016.  1026.  1036.  1046.
+ ---- L:2 T:   02-JAN-1995 00:00
+ 142   / 1:  2012.  2022.  2032.  2042.
+ 144   / 2:  2014.  2024.  2034.  2044.
+ 146   / 3:  2016.  2026.  2036.  2046.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          YLAT      (AX023)   NORMAL    TTIME     NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (degrees_north)-Y (degrees_east)-TIME)
+               1      3      5      7    
+               1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 142   / 1:  3012.  3032.  3052.  3072.
+ 144   / 2:  3014.  3034.  3054.  3074.
+ 146   / 3:  3016.  3036.  3056.  3076.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 142   / 1:  5012.  5032.  5052.  5072.
+ 144   / 2:  5014.  5034.  5054.  5074.
+ 146   / 3:  5016.  5036.  5056.  5076.
+canc data/all
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ XLON      T (degrees_east)    40mr   141                  180
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     YLAT      NORMAL    XLON      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34321  34323  34325  
+              1      2      3      4
+ ---- L:1 T:   141
+ 3N   / 3:  1031.  3031.  5031.  7031.
+ 2N   / 2:  1021.  3021.  5021.  7021.
+ 1N   / 1:  1011.  3011.  5011.  7011.
+ ---- L:2 T:   142
+ 3N   / 3:  1032.  3032.  5032.  7032.
+ 2N   / 2:  1022.  3022.  5022.  7022.
+ 1N   / 1:  1012.  3012.  5012.  7012.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   YLAT      NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34320  34321  34322  
+              1      2      3      4
+ ---- L:1 T:   141
+ 6N   / 3:  1061.  2061.  3061.  4061.
+ 4N   / 2:  1041.  2041.  3041.  4041.
+ 2N   / 1:  1021.  2021.  3021.  4021.
+ ---- L:2 T:   142
+ 6N   / 3:  1062.  2062.  3062.  4062.
+ 4N   / 2:  1042.  2042.  3042.  4042.
+ 2N   / 1:  1022.  2022.  3022.  4022.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   NORMAL    XLON      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-LATITUDE-T (degrees_east))
+            34319  34321  34323  34325  
+              1      2      3      4
+ ---- L:1 T:   143
+ 6N   / 3:  1063.  3063.  5063.  7063.
+ 4N   / 2:  1043.  3043.  5043.  7043.
+ 2N   / 1:  1023.  3023.  5023.  7023.
+ ---- L:2 T:   145
+ 6N   / 3:  1065.  3065.  5065.  7065.
+ 4N   / 2:  1045.  3045.  5045.  7045.
+ 2N   / 1:  1025.  3025.  5025.  7025.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   NORMAL    (AX023)   NORMAL    NORMAL
+ 
+use/order=txy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ normal    Z
+ YLAT      T (degrees_north)   30 r   1                    30
+ normal    E
+ normal    F
+list xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      NORMAL    YLAT      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- L:1 T:   1
+ 141   / 1:  1011.  3011.  5011.  7011.
+ 142   / 2:  1012.  3012.  5012.  7012.
+ 143   / 3:  1013.  3013.  5013.  7013.
+ ---- L:2 T:   2
+ 141   / 1:  1021.  3021.  5021.  7021.
+ 142   / 2:  1022.  3022.  5022.  7022.
+ 143   / 3:  1023.  3023.  5023.  7023.
+list xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX022)   XLON      NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    2    6  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- L:1 T:   1
+ 142   / 1:  1012.  2012.  3012.  4012.
+ 144   / 2:  1014.  2014.  3014.  4014.
+ 146   / 3:  1016.  2016.  3016.  4016.
+ ---- L:2 T:   2
+ 142   / 1:  1022.  2022.  3022.  4022.
+ 144   / 2:  1024.  2024.  3024.  4024.
+ 146   / 3:  1026.  2026.  3026.  4026.
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX023)   NORMAL    YLAT      NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-T (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- L:1 T:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- L:2 T:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   NORMAL    (AX020)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+list/k=1:2 xytvar[i=1:7:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 141   / 1:  1011.  3011.  5011.  7011.
+ 142   / 2:  1012.  3012.  5012.  7012.
+ 143   / 3:  1013.  3013.  5013.  7013.
+ ---- K:2 Z:   2
+ 141   / 1:  1021.  3021.  5021.  7021.
+ 142   / 2:  1022.  3022.  5022.  7022.
+ 143   / 3:  1023.  3023.  5023.  7023.
+list/k=1:2 xytvar[j=2:6:2]
+ dealloc  dynamic grid (G006)          (AX024)   XLON      YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ strip regrid on Y: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  8 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    2    6  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34320  34321  34322  
+               1      2      3      4
+ ---- K:1 Z:   1
+ 142   / 1:  1012.  2012.  3012.  4012.
+ 144   / 2:  1014.  2014.  3014.  4014.
+ 146   / 3:  1016.  2016.  3016.  4016.
+ ---- K:2 Z:   2
+ 142   / 1:  1022.  2022.  3022.  4022.
+ 144   / 2:  1024.  2024.  3024.  4024.
+ 146   / 3:  1026.  2026.  3026.  4026.
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid (G006)          TTIME     (AX020)   YLAT      NORMAL    NORMAL    NORMAL
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M:  6 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- K:2 Z:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M:  5 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   NORMAL    NORMAL    NORMAL
+ 
+ 
+! * * * * * MIXED STRIDES, PERMUTATIONS and REVERSALS * * * * *
+! to evaluate the output remember
+!  1) the axis lengths on disk are 9,8,7,6 for X,Y,Z,T, respectively
+!  2) the negatives apply to the axis in memory (after permutation)
+! Thus, with /ORDER=y-x we expect the 2nd disk axis (the 10's place) to
+! be reversed and the values 1:5:4 to be replaced by 9-(1:5:4) => 8:4:4
+ 
+! Note that the logic of the /ORDER syntax when BOTH permutations and
+! reversals are aplied would be more natural if the reversal were applied
+! BEFORE the permutation. This should occur in routine TM_AXIS_ORDER.
+! However, the logic changes needed were messay compared to the rare
+! usage of complex combinations of reversals and permutations, so it was
+! left as-is.
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.  1352.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1512.  1552.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.  1358.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1518.  1558.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    4    8  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1382.  1342.
+ 5   / 2:  1385.  1345.
+ ---- K:2 Z:   5
+ 2   / 1:  1582.  1542.
+ 5   / 2:  1585.  1545.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.  5123.
+ 5   / 2:  1153.  5153.
+ ---- K:2 Z:   5
+ 2   / 1:  1125.  5125.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.  2773.
+ 5   / 2:  6743.  2743.
+ ---- K:2 Z:   5
+ 2   / 1:  6775.  2775.
+ 5   / 2:  6745.  2745.
+canc data/all
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.  5132.
+ 5   / 2:  1135.  5135.
+ ---- K:2 Z:   5
+ 2   / 1:  1152.  5152.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX022)   (AX023)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M:  5 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.  2738.
+ 5   / 2:  6735.  2735.
+ ---- K:2 Z:   5
+ 2   / 1:  6758.  2758.
+ 5   / 2:  6755.  2755.
+canc data/all
+ -DELETE MIDVAR   M:  6 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX024)   (AX020)   ZAX1_7    NORMAL    NORMAL
+*** Running test: bn_non_COARDS_netCDF.jnl
+! bn_non_COARDS_netCDF.jnl
+! *sh* 3/99
+! *sh* 6/00 -- added true scalar variable, TRUE_SCALAR
+ 
+! test robust treatment of non-standard netCDF files
+ 
+use non_COARDS
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+show grid/x HAS_NO_AXIS
+    GRID GAB7
+ name       axis              # pts   start                end
+ NO_AXIS   X                    5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_UNORDERED_AXIS
+    GRID GAB1
+ name       axis              # pts   start                end
+ UNORDERED_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_GAPPY_AXIS
+    GRID GAB2
+ name       axis              # pts   start                end
+ GAPPY_AXIS X                   5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x HAS_BACKWARDS_AXIS
+    GRID GAB8
+ name       axis              # pts   start                end
+ BACKWARDS_AXIS X               5 r   1                    5
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+show grid/x SCALAR_VAR
+    GRID GAB3
+ name       axis              # pts   start                end
+ SCALAR    X                    1 r   1                    1
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+ 
+show grid/i=1:5 USES_BIG_IRREG
+    GRID GAB9
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ BIG_IRREG T (hours)       200000 i   1                    200000
+ normal    E
+ normal    F
+ 
+show grid MASKED_SST
+    GRID GAB5
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ TIME      TIME                 1mr   16-JAN 06:00         16-JAN 06:00
+ normal    E
+ normal    F
+show grid COADSX
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+show grid COADSY
+    GRID GAB6
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180 r   1E                   180E
+ COADSY    LATITUDE            90 r   1N                   90N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+show data
+     currently SET data sets:
+    1> ./non_COARDS.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ UNORDERED_AXIS
+          disordered axis                  1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ GAPPY_AXIS
+          gappy axis                       1:5       ...       ...       ...       ...       ...
+       (invalid coordinate axis)
+ SCALAR_VAR
+          a good way to encode model parm  1:1       ...       ...       ...       ...       ...
+ TRUE_SCALAR
+          with no dims at all              ...       ...       ...       ...       ...       ...
+ MASKED_SST
+          SST * MP_MASK                    1:180     1:90      ...       1:1       ...       ...
+ COADSX   Longitude page positions         1:180     1:90      ...       ...       ...       ...
+ COADSY   Latitude page positions          1:180     1:90      ...       ...       ...       ...
+ HAS_NO_AXIS
+          variable with no axis            1:5       ...       ...       ...       ...       ...
+ HAS_UNORDERED_AXIS
+          variable with disordered axis    1:5       ...       ...       ...       ...       ...
+ HAS_GAPPY_AXIS
+          variable with gappy axis         1:5       ...       ...       ...       ...       ...
+ HAS_BACKWARDS_AXIS
+          variable with backwards axis     1:5       ...       ...       ...       ...       ...
+ USES_BIG_IRREG
+          variable defined on too-long ir  ...       ...       ...       1:200000  ...       ...
+ 
+list UNORDERED_AXIS
+             VARIABLE : disordered axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  3.000
+ 3   / 3:  5.000
+ 4   / 4:  2.000
+ 5   / 5:  4.000
+list GAPPY_AXIS
+             VARIABLE : gappy axis
+                        invalid coordinate axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:   ....
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+list SCALAR_VAR
+             VARIABLE : a good way to encode model parms
+             FILENAME : non_COARDS.cdf
+             X        : 1
+          99.00
+list TRUE_SCALAR
+             VARIABLE : with no dims at all
+             FILENAME : non_COARDS.cdf
+        ....
+list HAS_BACKWARDS_AXIS
+             VARIABLE : variable with backwards axis
+             FILENAME : non_COARDS.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:  50.00
+ 2   / 2:  40.00
+ 3   / 3:  30.00
+ 4   / 4:  20.00
+ 5   / 5:  10.00
+ 
+! With 250000 irregular coordinate storage locations, the variable BIG_IRREG
+! is not created; if irreg axis too long for coord storage, a variable
+! is generated with its values.
+ 
+! list/i=1:5 BIG_IRREG
+*** Running test: bn_cache_hits.jnl
+! bn_cache_hits.jnl
+ 
+! 3/99 *sh*
+! Test the success of Ferret in recalling past results
+ 
+! 7/01 -- added bn_cache_hits_gcfcn.sub
+ 
+define alias CONFUSE load/i=1:5 i
+ 
+set mode diag
+use coads_climatology
+set region/l=1
+ 
+GO bn_cache_hits.sub sst
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ reading SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst
+ -DELETE I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8
+ Maximum value: 31
+ Mean    value: 16.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst[gx=xtrop]
+ -DELETE I        M:  2 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sstx = sst[gx=xtrop]
+stat $1x
+ !-> stat sstx
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTX     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTX     C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G002)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sstx
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTX     M:  3 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst[g=gx]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: -1.7
+ Maximum value: 31
+ Mean    value: 17.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G003)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst[gx=xtrop,gy=ytrop]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST --> (G003)           @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: 1 deg on X, 1 deg on Y
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid (G003)          XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst[g=gxyt]
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+stat $1xyt
+ !-> stat sstxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXYT   M:  5 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sstxyt = sst[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXYT   M:  5 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SSTX     M:  3 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST      M:  2 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXYT   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXYT   C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST --> GXYT             @LIN
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST      M:  2 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sstxyt
+ -DELETE I        M:  4 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXYT   M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 20.428
+ Maximum value: 31
+ Mean    value: 26.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@AVE,D=1]
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[X=20E:20E(380)@AVE,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst[x=@ave]
+ -DELETE I        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  4 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sstxave = sst[x=@ave]
+stat $1xave
+ !-> stat sstxave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTXAVE  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTXAVE  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  4 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sstxave
+ -DELETE I        M:  6 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTXAVE  M:  5 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: -0.69743
+ Maximum value: 27.612
+ Mean    value: 14.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST on X axis:     0   181 dset:   1
+ found   SST      M:  1 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST on X axis:     1   180 dset:   1
+ doing --> SST[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  8 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst[x=@sbx]
+ -DELETE I        M:  8 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SEA SURFACE TEMPERATURE
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sstsbx = sst[x=@sbx]
+stat $1sbx
+ !-> stat sstsbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SSTSBX   C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SSTSBX   C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sstsbx
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SSTSBX   M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: -1.3854
+ Maximum value: 30.382
+ Mean    value: 16.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+LET sst5 = sst+5
+GO bn_cache_hits.sub sst5
+! bn_cache_hits.sub
+! *sh* 3/99
+! usage:	GO bn_cache_hits.sub variable
+ 
+stat $1
+ !-> stat sst5
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5     C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  9 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1
+ !-> stat sst5
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 3.2
+ Maximum value: 36
+ Mean    value: 21.52 (unweighted average)
+ Standard deviation: 10.139
+ 
+define axis/x=130e:80w:1 xtrop
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop]
+ !-> stat sst5[gx=xtrop]
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+let $1x = $1[gx=xtrop]
+ !-> DEFINE VARIABLE sst5x = sst5[gx=xtrop]
+stat $1x
+ !-> stat sst5x
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5X    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5X    C:  6 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ strip regrid on X: SST5 --> (G002)           @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1x
+ !-> stat sst5x
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5X    M: 11 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[GX=XTROP]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define grid/x=xtrop gx
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+CONFUSE
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gx]
+ !-> stat sst5[g=gx]
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ found   SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ 
+             SST+5
+             regrid: 1 deg on X
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 13590 (151*90*1*1*1*1)
+ # flagged as bad  data: 4962
+ Minimum value: 3.3
+ Maximum value: 36
+ Mean    value: 22.605 (unweighted average)
+ Standard deviation: 9.8848
+ 
+define axis/y=20s:20n:1 ytrop
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[gx=xtrop,gy=ytrop]
+ !-> stat sst5[gx=xtrop,gy=ytrop]
+ -DELETE I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+define grid/like=$1/x=xtrop/y=ytrop gxyt
+ !-> define grid/like=sst5/x=xtrop/y=ytrop gxyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[g=gxyt]
+ !-> stat sst5[g=gxyt]
+ -DELETE I        M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             regrid: GXYT
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+stat $1xyt
+ !-> stat sst5xyt
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XYT  M: 13 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+let $1xyt = $1[g=gxyt]
+ !-> DEFINE VARIABLE sst5xyt = sst5[g=gxyt]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XYT  M: 13 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5X    M: 11 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          XTROP     COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  9 dset:   1 I:    1  151  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 12 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTSBX   M:  8 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXAVE  M:  5 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SSTXYT   M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+stat $1xyt
+ !-> stat sst5xyt
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XYT  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XYT  C:  6 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip regrid on X: SST5 --> GXYT             @LIN
+ eval    SST5     C:  9 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  3 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  3 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  SST5     M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+CONFUSE
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xyt
+ !-> stat sst5xyt
+ -DELETE I        M: 12 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XYT  M:  8 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[G=GXYT]
+             LONGITUDE: 129.5E to 79.5W
+             LATITUDE: 20.5S to 20.5N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 6191 (151*41*1*1*1*1)
+ # flagged as bad  data: 151
+ Minimum value: 25.428
+ Maximum value: 36
+ Mean    value: 31.908 (unweighted average)
+ Standard deviation: 1.778
+ 
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@AVE,D=1]
+ eval    SST5     C:  7 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST      M:  6 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing --> SST5[X=20E:20E(380)@AVE,D=1]
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE	
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@ave]
+ !-> stat sst5[x=@ave]
+ -DELETE I        M:  9 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             LONGITUDE: 20E to 20E(380) (averaged)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+let $1xave = $1[x=@ave]
+ !-> DEFINE VARIABLE sst5xave = sst5[x=@ave]
+stat $1xave
+ !-> stat sst5xave
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5XAVE C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5XAVE C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1xave
+ !-> stat sst5xave
+ -DELETE I        M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5XAVE M:  9 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@AVE]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 90 (1*90*1*1*1*1)
+ # flagged as bad  data: 12
+ Minimum value: 4.3026
+ Maximum value: 32.612
+ Mean    value: 19.429 (unweighted average)
+ Standard deviation: 10.445
+ 
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ strip moduloing SST5 on X axis:     0   181 dset:   1
+ found   SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing SST5 on X axis:     1   180 dset:   1
+ doing --> SST5[X=20E:20E(380)@SBX:3,D=1]
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1[x=@sbx]
+ !-> stat sst5[x=@sbx]
+ -DELETE I        M: 14 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST+5
+             box smoothed by 3 pts on X
+             LONGITUDE: 20E to 20E(380) (box smoothed by 3 pts)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+let $1sbx = $1[x=@sbx]
+ !-> DEFINE VARIABLE sst5sbx = sst5[x=@sbx]
+stat $1sbx
+ !-> stat sst5sbx
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid SST5SBX  C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    SST5SBX  C:  6 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+CONFUSE
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1    5  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ pseudo  I        M: 15 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+stat $1sbx
+ !-> stat sst5sbx
+ -DELETE I        M: 15 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   SST5SBX  M: 14 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ 
+             SST5[X=@SBX]
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 7173
+ Minimum value: 3.6146
+ Maximum value: 35.382
+ Mean    value: 21.633 (unweighted average)
+ Standard deviation: 10.112
+ 
+ 
+ 
+GO bn_cache_hits_gcfcn.sub
+! bn_cache_hits_gcfcn.sub
+! 7/01 *sh*
+ 
+! test cache hits on grid-changing functions
+ 
+! caching that happens because gcf_impose_axes sets uvlim_hidden
+set mode diag
+ 
+let a = i[i=1:10]
+say `a,return=isize`     ! no evaluation of a required -- just context
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ !-> MESSAGE/CONTINUE 10
+10
+list/nohead a            ! evaluate it now
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 15 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 
+let a = XSEQUENCE(j[j=1:5])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 16 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE I        M: 15 dset:   0 I:    1   10  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE SST5SBX  M: 14 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XAVE M:  9 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5XYT  M:  8 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GXYT            XTROP     YTROP     NORMAL    TIME      NORMAL    NORMAL
+ -DELETE SST5     M:  3 dset:   1 I:    1  151  J:    1   41  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M:  5 dset:   1 I:   55  131  J:   35   56  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 10 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 11 dset:   1 I:    0  181  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 12 dset:   1 I: -999 -999  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE SST5     M: 13 dset:   1 I:    1  180  J:    1   90  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C11,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C11,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M: 13 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 5
+5
+list/nohead a            ! cache hit
+ -DELETE J        M: 13 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C11,V11 M: 12 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+ 
+let a = SAMPLEI(I[i=1:100], {8,5,3})
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C11,V11 M: 12 dset:   0 I: -999 -999  J:    1    5  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid YABSTRACT       NORMAL    ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M: 11 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  5 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 10 dset:   0 I:    1    5  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ eval    (C09,V11 C: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 11 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE A        M:  5 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ -DELETE I        M: 11 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ const_v {8,5,3}  M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing sampling tpry on I axis:     1     3 dset:   0
+ found   (C09,V11 M: 12 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M: 13 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L:    3    3  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M:  8 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE {8,5,3}  M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  8.000
+ 2   / 2:  5.000
+ 3   / 3:  3.000
+ 
+spawn rm -f foo.bar*
+spawn touch foo.bar1 foo.bar2 foo.bar3
+let a = SPAWN("ls foo.bar*")
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C09,V11 M: 12 dset:   0 I:    1  100  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE (C01,V11 M:  3 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE (C01,V11 M:  5 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`     ! evaluate it now
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ string str      M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 3
+3
+list/nohead a            ! cache hit
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ found   A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:"foo.bar1"
+ 2   / 2:"foo.bar2"
+ 3   / 3:"foo.bar3"
+ 
+! RESHAPE, alone, is set to require matched limits in order to make a cache hit
+let a = RESHAPE(I[I=1:3]+10*j[j=1:3], I[i=1:9])
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+say `a,return=isize`
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C01,V11 C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C31,V11 C: 11 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ pass #2 (C09,V11 C: 12 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          ABSTRACT  ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C09,V11 C: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ constan cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  J        M:  3 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE J        M:  3 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE tpry     M: 12 dset:   0 I: -999 -999  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE I        M: 10 dset:   0 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C31,V11 C: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ pseudo  I        M: 10 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> MESSAGE/CONTINUE 9
+9
+list/nohead a            ! no cache hit
+ -DELETE I        M: 10 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid XABSTRACT       ABSTRACT  NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    (C01,V11 C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C09,V11 M:  5 dset:   0 I:    1    3  J:    1    3  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   (C31,V11 M: 12 dset:   0 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 1   / 1:  11.00
+ 2   / 2:  12.00
+ 3   / 3:  13.00
+ 4   / 4:  21.00
+ 5   / 5:  22.00
+ 6   / 6:  23.00
+ 7   / 7:  31.00
+ 8   / 8:  32.00
+ 9   / 9:  33.00
+ 
+set mode/last diag
+ 
+! v5.4 *kob* 10/01 - need to add exit/script - new exit command qualifiers
+EXIT/SCRIPT
+*** Running test: bn_regrid_to_user.jnl
+! bn_regrid_to_user
+! 8/99 *sh*
+! 5/01 *sh* - changes to accomodate truncated levitus_climatology.cdf
+!           - additions to test use of expressions in SET/SHOW/DEFINE grid
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg1
+show grid gg1
+    GRID GG1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg2
+cancel variable f
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX008)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg2 gg3
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg2
+show grid gg2
+    GRID GG2
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX008)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G004)
+    GRID (G004)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G004)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G003)                          use count:   1
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX010)                         use count:   1
+    AXIS (AX009)                         use count:   1
+    AXIS (AX008)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist]	! non-existent target variable
+let v2 = temp[d=2,k=1,gx=a[d=1],gy=yax]
+load/x=160e/y=5s v2
+cancel variable a
+load/x=160e/y=5s v2		! non-existent target grid
+set mode/last ignore
+ 
+! 12/99
+! bug fix: g=abstract now works
+! new multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00   5.00   6.00   7.00   8.00
+ 2   / 2:   4.00   5.00   6.00   7.00   8.00   9.00
+ 3   / 3:   5.00   6.00   7.00   8.00   9.00  10.00
+ 4   / 4:   6.00   7.00   8.00   9.00  10.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   6.00   7.00   8.00   9.00  10.00  11.00
+ 4   / 4:   7.00   8.00   9.00  10.00  11.00  12.00
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:   6.00   7.00   8.00   9.00  10.00  11.00
+ 3   / 3:   7.00   8.00   9.00  10.00  11.00  12.00
+ 4   / 4:   8.00   9.00  10.00  11.00  12.00  13.00
+list a1[gx=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X
+             SUBSET   : 4 by 4 by 3 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 2   / 2:   4.00   6.00   8.00   ....
+ 3   / 3:   5.00   7.00   9.00   ....
+ 4   / 4:   6.00   8.00  10.00   ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   6.00   8.00   ....
+ 2   / 2:   5.00   7.00   9.00   ....
+ 3   / 3:   6.00   8.00  10.00   ....
+ 4   / 4:   7.00   9.00  11.00   ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 2   / 2:   6.00   8.00  10.00   ....
+ 3   / 3:   7.00   9.00  11.00   ....
+ 4   / 4:   8.00  10.00  12.00   ....
+list a1[gxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y
+             SUBSET   : 4 by 3 by 3 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   6.00   8.00   ....
+ 3   / 2:   6.00   8.00  10.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+list a1[gxz=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Z
+             SUBSET   : 4 by 4 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 2   / 2:   4.00   6.00   8.00   ....
+ 3   / 3:   5.00   7.00   9.00   ....
+ 4   / 4:   6.00   8.00  10.00   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 2   / 2:   6.00   8.00  10.00   ....
+ 3   / 3:   7.00   9.00  11.00   ....
+ 4   / 4:   8.00  10.00  12.00   ....
+ 
+! 6/01
+! test use of expressions in dynamic grid commands
+SHOW GRID temp[d=2,gx=sst[d=1],y=10s:2s:.2]             ! implicit Y axis
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5"
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) ! imposed T axis
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+SHOW GRID SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])      ! abstract X axis
+    GRID (G006)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID "temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5",FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]),SORTI(temp[d=2,gx=sst[d=1],y=10s:2s:.2])
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX011)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX010)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+    GRID (G006)
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+load/x=160e/y=5s temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G003)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SET GRID  FFTA(sst[d=1,gx=temp[d=2],y=10s:2s:.2,l=1:5]) + 5
+SHOW GRID
+ Default grid for DEFINE VARIABLE is (G007)
+ Last successful data access was on grid (G007)
+    GRID (G007)
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+list/j=1:5 j
+             VARIABLE : J
+                        axis (AX007)
+             SUBSET   : 5 points (LATITUDE)
+ 9.2S   / 5:  5.000
+ 9.4S   / 4:  4.000
+ 9.6S   / 3:  3.000
+ 9.8S   / 2:  2.000
+ 10S    / 1:  1.000
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid
+SHOW GRID MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+SHOW GRID/DYNAMIC
+Dynamic grids:
+    GRID (G004)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX007)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+    GRID (G007)                          use count:   1
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE            41 r   10S                  2S
+ normal    Z
+ (AX011)   T (CYC/hour)         2 r   0.00034224           0.00068448
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX011)                         use count:   1
+    AXIS (AX007)                         use count:   3
+    AXIS (AX008)                         use count:   1
+ 
+*** Running test: bn_calendar.jnl
+! bn_calendar.jnl
+! Version 5.3
+! Add definitions of calendar axes as a NetCDF attribute of the time axis
+! DEFINE AXIS/CALENDAR
+! regridding between different calendar axes
+! write and read NetCDF files with the new attribute.
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=360DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 5 points (TIME)
+             CALENDAR : 360DAY
+ 27-FEB-1988 00 / 57:  0.4362
+ 28-FEB-1988 00 / 58:  0.9929
+ 29-FEB-1988 00 / 59:  0.6367
+ 30-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 01-MAR-1988 00 / 60: -0.3048
+ 
+ 
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=julian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=gregorian tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+ 
+ 
+ 
+! Regrid between different calendar axes using @lin(default) @asn and @nrst
+use gt4d011
+ 
+set region/x=132w/y=2n/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 26-NOV-1982 00 / 15:  32.90
+ 03-DEC-1982 00 / 16:  32.92
+ 10-DEC-1982 00 / 17:  32.96
+ 17-DEC-1982 00 / 18:  32.97
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=360day tweeks
+let ndata = temp[gt=tgrid at asn]
+list/l=15:18 ndata
+             VARIABLE : TEMP[GT=TGRID at ASN]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 28-NOV-1982 00 / 15:  32.95
+ 05-DEC-1982 00 / 16:  32.90
+ 12-DEC-1982 00 / 17:  32.89
+ 19-DEC-1982 00 / 18:  32.91
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=julian tweeks
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-nov-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : JULIAN
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                       132.5W 
+                        98
+ 26-NOV-1982 00 / 15:  32.91
+ 03-DEC-1982 00 / 16:  32.93
+ 10-DEC-1982 00 / 17:  32.97
+ 17-DEC-1982 00 / 18:  32.97
+ 
+ 
+ 
+ 
+! Regrid to a new calendar, write to NetCDF file and read back in.
+can data/all
+can region
+can var/all
+ 
+use gt4d011
+ 
+set region/k=1
+define axis/t="20-aug-1982":"1-jan-1983":7/units=days/calendar=noleap tweeks
+define grid/t=tweeks tgrid
+let ndata = temp[gt=tgrid]
+ 
+save/clobber/file=calsst.cdf/x=140w:130w/y=2s:2n ndata
+ 
+can data/all
+can var/all
+can region
+ 
+use calsst
+sh data
+     currently SET data sets:
+    1> ./calsst.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ NDATA    TEMP[GT=TGRID]                   1:10      1:13      1:1       1:21      ...       ...
+ 
+sh grid ndata
+    GRID GSH1
+ name       axis              # pts   start                end
+ PSXT91_100 LONGITUDE          10mr   139.5W               130.5W
+ PSYT39_51 LATITUDE            13 i   2.167S               1.833N
+ PSZT1_1   DEPTH (m)            1 r-  5                    5
+ TWEEKS1   TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+ normal    E
+ normal    F
+sh axis tweeks
+ name       axis              # pts   start                end
+ TWEEKS    TIME                21 r   20-AUG-1982 00:00    07-JAN-1983 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 147
+ 
+stat/x=135w/y=0 ndata
+ 
+             TEMP[GT=TGRID]
+             LONGITUDE: 135.5W
+             LATITUDE: 0.2S
+             DEPTH (m): 5
+             TIME: 16-AUG-1982 12:00 to 10-JAN-1983 12:00 NOLEAP
+             E:  N/A
+             F:  N/A
+             DATA SET: ./calsst.cdf
+ 
+ Total # of data points: 21 (1*1*1*21*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 26.228
+ Maximum value: 32.608
+ Mean    value: 30.454 (unweighted average)
+ Standard deviation: 2.4414
+ 
+sp rm -f calsst.cdf
+ 
+ 
+can data/all
+can var/all
+can region
+ 
+! regrid between weekly, daily, monthly axes.
+use gt4d011
+set region/x=132w/y=2n/k=1
+ 
+define axis/t="18-aug-1982":"1-jan-1983":1/units=months/calendar=360day tmonths
+define grid/t=tmonths tgrid
+let ndata = temp[gt=tgrid at nrst]
+list/t="25-sep-1982":"18-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID at NRST]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360DAY
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                   132.5W 
+                    98
+ 18-SEP-1982 / 2:  27.27
+ 18-OCT-1982 / 3:  31.32
+ 18-NOV-1982 / 4:  32.90
+ 18-DEC-1982 / 5:  32.97
+ 
+ 
+define axis/t="20-aug-1982":"1-jan-1983":1/units=days/calendar=noleap tdays
+define grid/t=tdays tgrid
+let ndata = temp[gt=tgrid]
+list/t="5-dec-1982":"8-dec-1982" ndata
+             VARIABLE : TEMP[GT=TGRID]
+             FILENAME : gt4d011.cdf
+             SUBSET   : 4 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 132.5W
+             LATITUDE : 1.8N
+             DEPTH (m): 5
+                        132.5W 
+                         98
+ 05-DEC-1982 00 / 108:  32.93
+ 06-DEC-1982 00 / 109:  32.93
+ 07-DEC-1982 00 / 110:  32.94
+ 08-DEC-1982 00 / 111:  32.95
+ 
+ 
+ 
+! Regrid to a modulo calendar axis.
+ 
+can data/all
+can var/all
+can region
+ 
+use coads_climatology
+set region/x=180/y=0
+ 
+define axis/t="1-jan-0000":"1-dec-0000":1/units=months/calendar=julian/modulo jmonths
+define grid/t=jmonths jgrid
+let jsst = sst[gt=jgrid]
+let nsst = sst[gt=jgrid at nrst]
+ 
+list/l=1:4 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN      / 1:  28.20
+ 15-FEB      / 2:  28.36
+ 17-MAR      / 3:  28.35
+ 16-AUG      / 4:   ....
+list/l=1:4 jsst, nsst
+             DATA SET: ./coads_climatology.cdf
+             TIME: 01-JAN 00:00 to 16-APR 12:45 JULIAN
+             LONGITUDE: 179E
+             LATITUDE: 1S
+ Column  1: JSST is SST[GT=JGRID]
+ Column  2: NSST is SST[GT=JGRID at NRST]
+                  JSST   NSST
+01-JAN      / 1:   ....  28.20
+31-JAN      / 2:  28.28  28.20
+01-MAR      / 3:  28.36  28.36
+01-APR      / 4:   ....  28.35
+ 
+! test negative time step formatting -- added 7/01 *sh*
+! this is not specifically a calendar test, but it is a change in V5.3x
+define axis/units=days/t/t0=1-jan-1980 tax_neg = {-3,-2,-1}
+show axis/l tax_neg
+ name       axis              # pts   start                end
+ TAX_NEG   TIME                 3 r   29-DEC-1979 00:00    31-DEC-1979 00:00
+T0 = 1-JAN-1980
+   Axis span (to cell edges) = 3
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  29-DEC-1979 00:00:00  1          28-DEC-1979 12:00:00    -3
+       2>  30-DEC-1979 00:00:00  1          29-DEC-1979 12:00:00    -2
+       3>  31-DEC-1979 00:00:00  1          30-DEC-1979 12:00:00    -1
+ 
+! also see bn_all_leap.jnl, 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+*** Running test: bn_dash_dot.jnl
+! new PLOT/DASH and PLOT/SYMBOL=DOT  qualifiers
+! *acm* 5/01
+! *acm* 8/02 Remove calls to SYMBOL=DOT until postscript issues are resolved.
+ 
+plot/dash/i=1:1000 sin(62.8*i)
+plot/over/dash=(0.4,0.1,0.4,0.1)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/over/dash=(0.1,0.1,0.04,0.05)/color=blue/thick=1/i=1:1000 sin(62.8*(i+20) )
+ 
+!plot/symbol=dot/i=1:1000 sin(62.8*i)
+!plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+ 
+! test warnings
+!plot/symbol=dot/thick/over/i=1:1000 sin(62.8*(i+10) )
+!plot/symbol=dot/size=0.5/over/i=1:1000 sin(62.8*(i+10) )
+ 
+! intentional errors
+set mode ignore
+plot/dash=(1., 2.)/color=red/thick/i=1:1000 sin(62.8*(i+10) )
+plot/dash=(-1., 2., 3., 4.)/i=1:1000 sin(62.8*(i+20) )
+*** Running test: bn_flowlines.jnl
+! bn_flowlines.jnl
+! VECTOR/FLOW
+! 6/2001
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+! ACM 4/2006 new qualifier /LENGTH sets the length of the arrow heads
+ 
+set window/asp=1/siz=0.5
+use gtbc011
+set reg/k=1/l=1/y=0:20
+vector/aspect u,v
+vector/flow/over  u,v
+ 
+! /LEN= for setting size of arrow heads
+vector/aspect u,v
+vector/flow/over/len=10  u,v
+ 
+GO bn_reset
+cancel mode verify
+set mode meta flowlines.plt
+can mode logo
+ 
+can region
+vector/i=1:50/j=1:50/length=50/aspect/nolabel sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=blue/thick/den=1 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+flow/i=1:50/j=1:50/over/color=green/den=4/len=20 sin(i/20)*10+j-20,-1*cos(j/10)*10+i-20
+ 
+can mode meta
+! curvilinear flowline plots
+go bn_reset
+cancel mode verify
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+ 
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/flow/noax/xskip=16/yskip=8/len=5/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+ 
+set mode logo
+*** Running test: bn_logaxes.jnl
+!  Test the qualifiers /HLOG and /VLOG for setting
+!  log axes.  On a depth axis, inverse log plot.
+ 
+! use /VLOG
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+set view lower
+plot/vlog/vlimits=1:100000 fcn
+! The same plot, calling axtype using old syntax
+set view upper
+plot/vlimits=0:5/set fcn
+ppl axtype,1,3
+ppl plot
+ 
+! use /HLOG, and then /VLOG/HLOG both
+def axis/x dlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=dlog])^2
+set view upper
+plot/vlog fcn
+set view lower
+plot/vlog/hlog fcn
+can view
+ 
+! transpose axes for /HLOG on depth axis
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/trans/hlog fcnd
+ 
+! add test for /VLOG on depth axis
+! (prev to v6.3+ the right-hand axis had incorrect tic marks)
+def axis/z/depth dlog=exp(k[k=1:10])
+let fcnd = k[gz=dlog]
+plot/vlog fcnd
+ 
+! intentional error
+! This wont work - no log of negative values on axis
+ 
+set mode ignore
+def axis/x dlog = -1*(10-i[i=1:10])
+let fcn = (i[gx=dlog])^2
+plot/hlog fcn
+*** Running test: bn_internal_external_functions.jnl
+! test internal external functions.  These moved from bn_external_functions
+!  6/01 because on systems w/out external functions support, the internal
+!  functions were not being tested - most notably win32   *kob*
+ 
+!  8/02/01 *acm* add bench_eof; now internally-linked.
+! 10/22/01 *acm* add bench_compress_by (compressi_by, compressj_by, ...)
+! 06/02 *kob* add bench_internal_string_functions (strlen, strcat, strindex, etc)
+! 05/05 *acm* move bench_compress here; internally linked.
+! 05/07 *acm* move tax_* functions and fill_xy here; internally linked.
+!  3/12 *acm* new script bn_scat2grid tests scat2grid functions in all directions
+!  4/12 *kms* new scripts bn_scat2grid_gl, bn_scat2gridlaplace_tarasoff,
+!             bn_scat2grid_nobs, bn_scat2grid_t, bn_transpose, bn_unique_str2int
+ 
+GO bn_reset
+cancel mode verify
+go bench_fft
+! Benchmark Ferret script for FFT.  Uses analytic function of time.
+ 
+! 5/99  ACM
+!   FFTA function computes the FFT amplitude spectrum.
+!   FFTP function computes the FFT phase
+!
+!  The script bench_fft_visual.jnl plots the results
+ 
+SET MODE IGNORE_ERRORS
+SAY The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+The message *** NOTE: unknown axis units: FREQ  is informational.  fcn still works.
+ 
+! Note, previously the time axis was defined as follows. When the
+! function is defined in terms of the time coordinate data, tpts,
+! tpts is  single-precision and so its use has precision problems.
+! (Saw this when changing to double-precision Ferret)
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24 dayt
+ 
+ 
+ 
+DEFINE AXIS/t=1-Jan-1990:31-Dec-1990:24/t0=1-jan-1980 dayt
+ 
+ 
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+    GRID TGRID
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ DAYT      TIME               365 r   01-JAN-1990 00:00    31-DEC-1990 00:00
+ normal    E
+ normal    F
+SET GRID tgrid
+ 
+LET fcn1 = sin(kt*tpts - phase) /2.
+LET fcn2 = cos(pt*tpts)
+LET phase = 6.
+LET kt = 0.5
+LET pt = 0.3
+ 
+!  Use an analytic function.
+ 
+LET sample_function = fcn1 - fcn2
+LET tpts = t
+LET days_fft = ffta(sample_function[l=1:365])
+ 
+LIST/L=30:35 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00343 / 30:  0.0137
+ 0.00355 / 31:  0.0212
+ 0.00366 / 32:  0.0482
+ 0.00378 / 33:  0.4990
+ 0.00389 / 34:  0.0524
+ 0.00401 / 35:  0.0325
+LIST/L=50:55 days_fft
+             VARIABLE : FFTA(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 6 points (T (CYC/HOURS))
+ 0.00572 / 50:  0.0728
+ 0.00584 / 51:  0.1041
+ 0.00595 / 52:  0.1854
+ 0.00607 / 53:  0.8945
+ 0.00618 / 54:  0.3111
+ 0.0063  / 55:  0.1317
+ 
+!  Compute the phase spectrum
+ 
+LET days_fftp = fftp(sample_function[l=1:365])
+ 
+LIST/l=1:20 days_fftp
+             VARIABLE : FFTP(SAMPLE_FUNCTION[L=1:365])
+             SUBSET   : 20 points (T (CYC/HOURS))
+ 0       /  1: -178.1
+ 0       /  2: -176.1
+ 0       /  3: -174.2
+ 0       /  4: -172.2
+ 0       /  5: -170.2
+ 0       /  6: -168.3
+ 0       /  7: -166.2
+ 0       /  8: -164.2
+ 0.00103 /  9: -162.2
+ 0.00114 / 10: -160.1
+ 0.00126 / 11: -158.0
+ 0.00137 / 12: -155.8
+ 0.00149 / 13: -153.6
+ 0.0016  / 14: -151.3
+ 0.00172 / 15: -149.0
+ 0.00183 / 16: -146.5
+ 0.00195 / 17: -144.0
+ 0.00206 / 18: -141.3
+ 0.00217 / 19: -138.4
+ 0.00229 / 20: -135.3
+ 
+ 
+!PAUSE
+ 
+ 
+USE coads_vwnd.cdf
+SET REGION/I=90/J=65
+ 
+SAY This should bail out with error msg about Time axis must be regular
+This should bail out with error msg about Time axis must be regular
+ 
+LET vw_fft = ffta(vwnd[l=37:60])
+LIST vw_fft
+ 
+DEFINE AXIS/T=16-Jan-1949:16-Dec-1950:730.5 at ave montht
+DEFINE GRID/T=montht  tgrid
+LET vw_tim = vwnd[gt=tgrid]
+LET vw_fft = ffta(vw_tim[l=2:23])
+ 
+SAY This one is ok
+This one is ok
+LIST vw_fft
+             VARIABLE : FFTA(VW_TIM[L=2:23])
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 11 points (T (CYC/HOURS))
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                 161W   
+                  90
+ 0        /  1:  1.996
+ 0        /  2:  2.168
+ 0        /  3:  0.174
+ 0        /  4:  2.015
+ 0        /  5:  0.354
+ 0        /  6:  1.725
+ 0        /  7:  1.253
+ 0        /  8:  0.304
+ 0        /  9:  1.651
+ 0        / 10:  0.814
+ 0        / 11:  0.154
+ 
+CANCEL MODE IGNORE_ERRORS
+ 
+GO bn_reset
+cancel mode verify
+go bench_gridding
+! bench_gridding.jnl
+! *acm* 8/99
+ 
+! Call scat2gridlaplace_xy  and scat2gridgauss_xy
+! to put scattered data onto a regularly spaced grid.
+ 
+! function definition from objective_analysis_demo.jnl
+ 
+! 2/2005 changed number of arguments to the Gaussing gridding functions
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+ 
+LET sample_function = fcn1 + wave
+ 
+let xpts = x; let ypts = y
+ 
+list/x=4:5/y=1 sample_function
+             VARIABLE : FCN1 + WAVE
+             SUBSET   : 21 points (X)
+             Y        : 1
+                1      
+                 21
+ 4     /  81:  0.2500
+ 4.05  /  82:  0.2453
+ 4.1   /  83:  0.2405
+ 4.15  /  84:  0.2356
+ 4.2   /  85:  0.2306
+ 4.25  /  86:  0.2255
+ 4.3   /  87:  0.2203
+ 4.35  /  88:  0.2150
+ 4.4   /  89:  0.2096
+ 4.45  /  90:  0.2041
+ 4.5   /  91:  0.1985
+ 4.55  /  92:  0.1929
+ 4.6   /  93:  0.1871
+ 4.65  /  94:  0.1813
+ 4.7   /  95:  0.1753
+ 4.75  /  96:  0.1693
+ 4.8   /  97:  0.1632
+ 4.85  /  98:  0.1571
+ 4.9   /  99:  0.1509
+ 4.95  / 100:  0.1446
+ 5     / 101:  0.1382
+ 
+can mem /all
+ 
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+ 
+set region/i=1:200
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 5., 5)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.3090  0.3620  0.1091 -0.0050 -0.1367 -0.4084 -0.2255  0.1517  0.2250  0.0731
+ 1.5   /  2:  0.3156  0.3712  0.0938 -0.0374 -0.2018 -0.4524 -0.1500  0.2782  0.3309  0.0699
+ 2     /  3:  0.3788  0.3156  0.0371 -0.0887 -0.2538 -0.4922 -0.0737  0.3748  0.4510  0.0813
+ 2.5   /  4:  0.4200  0.2522 -0.0636 -0.1441 -0.2527 -0.4666  0.0194  0.4396  0.4914  0.0893
+ 3     /  5:  0.4064  0.1984 -0.1400 -0.1971 -0.2790 -0.4255  0.1190  0.4330  0.5453  0.0855
+ 3.5   /  6:  0.3510  0.1698 -0.2016 -0.2575 -0.2838 -0.3580  0.1859  0.5859  0.5308  0.0588
+ 4     /  7:  0.2771  0.0967 -0.2465 -0.2890 -0.2590 -0.3293  0.3125  0.6416  0.5187  0.0212
+ 4.5   /  8:  0.1890  0.0447 -0.3126 -0.3192 -0.2135 -0.2225  0.3021  0.6266  0.4121 -0.0085
+ 5     /  9:  0.1399 -0.0371 -0.3239 -0.3338 -0.1998 -0.1342  0.2656  0.5778  0.3121 -0.0567
+ 5.5   / 10:  0.0786 -0.0964 -0.3389 -0.3129 -0.1727 -0.0850  0.2067  0.4824  0.2358 -0.0798
+ 6     / 11:  0.0074 -0.1353 -0.3777 -0.2741 -0.1217 -0.0193  0.1738  0.3540  0.1488 -0.1226
+ 6.5   / 12: -0.0711 -0.2091 -0.3704 -0.2493 -0.0410  0.0695  0.1485  0.2368  0.0456 -0.1732
+ 7     / 13: -0.1375 -0.2543 -0.3786 -0.2281  0.0630  0.1830  0.1355  0.1322 -0.0510 -0.2153
+ 7.5   / 14: -0.2028 -0.2669 -0.3464 -0.2105  0.1684  0.2796  0.1785  0.0640 -0.1152 -0.2282
+ 8     / 15: -0.2752 -0.2592 -0.3002 -0.1554  0.2333  0.3520  0.2197  0.0339 -0.1357 -0.2189
+ 8.5   / 16: -0.3268 -0.2733 -0.2452 -0.1138  0.2649  0.4025  0.2533  0.0294 -0.1385 -0.2005
+ 9     / 17: -0.3516 -0.2668 -0.1649 -0.0321  0.2764  0.4370  0.2817  0.0364 -0.1342 -0.1911
+ 9.5   / 18: -0.3642 -0.2402 -0.0934  0.0381  0.2761  0.4426  0.2947  0.0497 -0.1409 -0.2174
+ 10    / 19: -0.3692 -0.2104 -0.0403  0.1031  0.2803  0.4052  0.2986  0.0668 -0.1386 -0.2526
+ 
+let sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1.,1)
+! the following in now needed since the result grid axes are no longer extended
+! load sgrid
+! otherwise the following would use a 3-element X axis and 1-element Y axis
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDLAPLACE_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1.,1)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2910  0.4242  0.0970  0.0031 -0.1367 -0.4123 -0.2078    ....  0.2411    ....
+ 1.5   /  2:  0.3149  0.3736  0.1241 -0.0015 -0.2018 -0.4412 -0.1891  0.3310  0.3335  0.0056
+ 2     /  3:  0.3376  0.3121  0.0461 -0.0118 -0.2672 -0.4864 -0.0737    ....  0.4616    ....
+ 2.5   /  4:  0.3597  0.2424 -0.0661    .... -0.2439 -0.4573 -0.0311  0.4179  0.4740  0.2009
+ 3     /  5:    ....  0.1987 -0.1313 -0.2037 -0.2772 -0.3885  0.0658  0.4342  0.5394    ....
+ 3.5   /  6:  0.3103  0.1700 -0.2163 -0.2494 -0.2825 -0.3365  0.1567  0.5374  0.5054  0.1424
+ 4     /  7:  0.2748  0.0919 -0.2743 -0.2395 -0.2622 -0.3340  0.3125  0.5804  0.5206  0.0936
+ 4.5   /  8:  0.1840  0.0417 -0.3050    .... -0.2106 -0.1960  0.3262  0.5764  0.3663  0.0591
+ 5     /  9:  0.1468 -0.0445 -0.3533 -0.3755 -0.1909 -0.1066  0.2847  0.5219  0.2784 -0.0351
+ 5.5   / 10:  0.0416 -0.1097 -0.3354 -0.3255    .... -0.0886  0.2220  0.4386  0.2358  0.0412
+ 6     / 11: -0.0123 -0.1744 -0.3711 -0.2634    ....    ....  0.1726  0.3463  0.2191    ....
+ 6.5   / 12: -0.0648 -0.1272 -0.3661 -0.2453    ....  0.1044  0.1657  0.2429  0.0951    ....
+ 7     / 13: -0.1386    .... -0.3798 -0.2300    ....  0.1819  0.1359  0.1643 -0.0260 -0.2047
+ 7.5   / 14: -0.2039 -0.2891 -0.3460 -0.2099  0.1695  0.2722  0.1846  0.1033 -0.1142    ....
+ 8     / 15: -0.2859 -0.2587 -0.3005 -0.1705  0.2410  0.3522  0.2294  0.0662 -0.1360    ....
+ 8.5   / 16: -0.3294 -0.2792 -0.2367 -0.1257  0.2924  0.3890  0.2566    .... -0.1397 -0.1839
+ 9     / 17: -0.3416 -0.2686 -0.1775 -0.0643  0.2774  0.4317  0.2882  0.0231 -0.1392 -0.1953
+ 9.5   / 18: -0.3439 -0.2257 -0.0936  0.0132  0.2534  0.4424  0.2947  0.0341 -0.1376 -0.2118
+ 10    / 19:    .... -0.2042 -0.0215    ....    ....  0.4211  0.2880    .... -0.1447 -0.2037
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 0.5, 0.5, 2, 2)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 0.5, 0.5, 2, 2)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2749  0.3520  0.1259  0.0005 -0.1307 -0.4094 -0.1965  0.1130  0.2918  0.1284
+ 1.5   /  2:  0.2992  0.3405  0.1245 -0.0611 -0.2638 -0.4351 -0.1767  0.3484  0.3724  0.1284
+ 2     /  3:  0.2816  0.3205  0.0263 -0.1104 -0.2957 -0.4349 -0.1907  0.4605  0.4452  0.1919
+ 2.5   /  4:  0.2905  0.2746 -0.0640 -0.1666 -0.2648 -0.4176 -0.1162  0.5380  0.4422  0.2649
+ 3     /  5:  0.2915  0.2482 -0.1256 -0.2238 -0.2563 -0.3716  0.2477  0.4975  0.4523  0.2763
+ 3.5   /  6:  0.2670  0.1771 -0.1706 -0.2310 -0.2748 -0.2812  0.2546  0.5101  0.4228  0.2483
+ 4     /  7:  0.2254  0.1144 -0.1767 -0.2279 -0.2724 -0.2447  0.2802  0.5449  0.3972  0.2122
+ 4.5   /  8:  0.1893  0.0812 -0.3329 -0.3434 -0.2308 -0.2443  0.3398  0.5310  0.3351  0.0613
+ 5     /  9:  0.1270  0.0390 -0.3562 -0.3691 -0.1779 -0.1532  0.2536  0.4990  0.3035  0.0256
+ 5.5   / 10:  0.0486 -0.1269 -0.3314 -0.2898 -0.1626 -0.0824  0.1922  0.4011  0.3037  0.0556
+ 6     / 11: -0.0377 -0.1366 -0.3367 -0.2688 -0.1971  0.0163  0.2094  0.2954  0.2639 -0.1357
+ 6.5   / 12: -0.0649 -0.1349 -0.3594 -0.2202 -0.0116  0.1108  0.1647  0.2593  0.0785 -0.1377
+ 7     / 13: -0.1040 -0.1406 -0.3630 -0.1669  0.0665  0.1932  0.1495  0.1418 -0.1130 -0.1434
+ 7.5   / 14: -0.1997 -0.2796 -0.3390 -0.1918  0.1852  0.2622  0.1522  0.0394 -0.1158 -0.1513
+ 8     / 15: -0.2353 -0.2782 -0.2830 -0.1572  0.2503  0.3331  0.2045  0.0179 -0.1159 -0.1716
+ 8.5   / 16: -0.3060 -0.2785 -0.2405 -0.1007  0.2517  0.3638  0.2512  0.0804 -0.1305 -0.1878
+ 9     / 17: -0.3356 -0.2663 -0.2136  0.0135  0.2884  0.4053  0.2726  0.1412 -0.1426 -0.1936
+ 9.5   / 18: -0.3495 -0.2130 -0.1083  0.0977  0.2055  0.4225  0.2947  0.1163 -0.1434 -0.1956
+ 10    / 19: -0.3530 -0.1816 -0.0861  0.0788  0.1087  0.4204  0.3216  0.0362 -0.1513 -0.1915
+ 
+let sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 1., 1., 6, 6)
+! list/x=4:5/y=1 sgrid
+list /order=yx sgrid
+             VARIABLE : SCAT2GRIDGAUSS_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], 1., 1., 6, 6)
+             SUBSET   : 19 by 19 points (Y-X)
+      ... listing every   2th point
+                1       2       3       4       5       6       7       8       9      10     
+                 1       3       5       7       9      11      13      15      17      19
+ 1     /  1:  0.2816  0.3122  0.1936 -0.0306 -0.2070 -0.3174 -0.2002  0.0358  0.2516  0.2179
+ 1.5   /  2:  0.2753  0.2962  0.1555 -0.0851 -0.2670 -0.3505 -0.2023  0.1687  0.3415  0.2747
+ 2     /  3:  0.2672  0.2609  0.0854 -0.1397 -0.2966 -0.3569 -0.1592  0.3022  0.3939  0.3190
+ 2.5   /  4:  0.2569  0.2037  0.0007 -0.1763 -0.3003 -0.3322 -0.0375  0.3936  0.4164  0.3363
+ 3     /  5:  0.2423  0.1529 -0.0574 -0.1979 -0.2890 -0.2657  0.1031  0.4302  0.4128  0.3273
+ 3.5   /  6:  0.2226  0.1218 -0.0907 -0.2163 -0.2714 -0.1845  0.1877  0.4360  0.3916  0.3016
+ 4     /  7:  0.1994  0.0942 -0.1270 -0.2400 -0.2530 -0.1379  0.2232  0.4316  0.3607  0.2621
+ 4.5   /  8:  0.1651  0.0529 -0.1834 -0.2671 -0.2320 -0.1172  0.2368  0.4168  0.3254  0.2139
+ 5     /  9:  0.1032 -0.0135 -0.2340 -0.2830 -0.2080 -0.0934  0.2348  0.3796  0.2999  0.1820
+ 5.5   / 10:  0.0196 -0.0822 -0.2536 -0.2804 -0.1800 -0.0461  0.2194  0.3280  0.2768  0.1655
+ 6     / 11: -0.0431 -0.1244 -0.2627 -0.2574 -0.1157  0.0360  0.2005  0.2738  0.2199  0.0887
+ 6.5   / 12: -0.0802 -0.1596 -0.2824 -0.2163  0.0112  0.1264  0.1816  0.2080  0.1091 -0.0365
+ 7     / 13: -0.1251 -0.2159 -0.2939 -0.1806  0.0990  0.1915  0.1712  0.1301 -0.0056 -0.1050
+ 7.5   / 14: -0.1868 -0.2628 -0.2836 -0.1492  0.1507  0.2424  0.1813  0.0735 -0.0662 -0.1291
+ 8     / 15: -0.2381 -0.2732 -0.2626 -0.1166  0.1919  0.2842  0.2109  0.0592 -0.0902 -0.1440
+ 8.5   / 16: -0.2747 -0.2696 -0.2391 -0.0872  0.2235  0.3159  0.2427  0.0717 -0.1071 -0.1594
+ 9     / 17: -0.3000 -0.2595 -0.2118 -0.0599  0.2465  0.3403  0.2670  0.0816 -0.1240 -0.1690
+ 9.5   / 18: -0.3141 -0.2417 -0.1779 -0.0316  0.2609  0.3583  0.2843  0.0735 -0.1356 -0.1721
+ 10    / 19: -0.3187 -0.2210 -0.1466 -0.0098  0.2665  0.3698  0.2969  0.0537 -0.1425 -0.1724
+ 
+can mem /all
+can var /all
+can axis yax5
+can axis xax5
+set grid abstract
+can grid g10x10
+can axis y10
+can axis x10
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_test
+! bn_scat2grid_test.jnl
+! From JonCallahan's insitu_gaussian_*.jnl
+ 
+! Description: Test functions for XY XZ XT YZ YT ZT gridding of insitu data
+ 
+set data scat2grid.nc
+ 
+define axis/x=50:70/npoints=20/units=degrees_east x_20
+define axis/y=10:20/npoints=20/units=degrees_north y_20
+define axis/z=0:100/npoints=20/depth/units=meters z_20
+define axis/t=0:8736/unit=hours/t0="01-JAN-1995 00:00:00"/npoints=20 t_20
+ 
+!*********
+! SCAT2GRIDGAUSS functions
+! XY
+ 
+let xy_gauss_gridded = scat2gridgauss_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],1.5,1.0,5.0,3.0)
+fill/lev=30v xy_gauss_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_gauss_gridded = scat2gridgauss_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],1.5,10,2,20)
+fill/lev=30v xz_gauss_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_gauss_gridded = scat2gridgauss_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],1.5,720.0,5.0,2160.0)
+fill/lev=30v xt_gauss_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_gauss_gridded = scat2gridgauss_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],1.0,10,3,50)
+fill/lev=30v yz_gauss_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_gauss_gridded = scat2gridgauss_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],1.0,720,3,2160)
+fill/lev=30v yt_gauss_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_gauss_gridded = scat2gridgauss_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],10,720,50,2160)
+fill/lev=30v zt_gauss_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem/all
+ 
+! SCAT2GRIDLAPLACE functions
+ 
+! XY
+ 
+let xy_laplace_gridded = scat2gridlaplace_xy(xax,yax,O2_umol_kg,x[gx=x_20],y[gy=y_20],2,2)
+show grid xy_laplace_gridded
+    GRID (G005)
+ name       axis              # pts   start                end
+ X_20      LONGITUDE           20mr   50E                  70E
+ Y_20      LATITUDE            20 r   10N                  20N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+! when the result grid axes were extended, the axis coordinates in the following were messed up
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XAX,YAX,O2_UMOL_KG,X[GX=X_20],Y[GY=Y_20],2,2)
+             FILENAME : scat2grid.nc
+             SUBSET   : 20 by 20 points (LONGITUDE-LATITUDE)
+      ... listing every   2th point
+                50E    52.1E  54.2E  56.3E  58.4E  60.5E  62.6E  64.7E  66.8E  68.9E 
+                 1      3      5      7      9     11     13     15     17     19
+ 20N    / 20:   ....   ....   ....   ....  144.0  241.1   ....   ....   ....   ....
+ 19.47N / 19:   ....   ....   ....   ....  117.8  207.4  172.9   ....   ....   ....
+ 18.95N / 18:   ....   ....   ....  137.8  107.3   98.0   ....   ....   ....   ....
+ 18.42N / 17:   ....   ....   ....  161.1  156.1    7.1   16.2   ....   ....   ....
+ 17.9N  / 16:   ....   ....   ....  179.9  189.1   81.7   ....   ....   ....   ....
+ 17.37N / 15:   ....   ....   ....  165.1  200.7  145.4   ....   ....   ....   ....
+ 16.84N / 14:   ....   ....   ....  128.3  183.0  168.0  182.6   ....   ....   ....
+ 16.32N / 13:   ....   ....   76.3   92.4  158.5  190.5  197.4   ....   ....   ....
+ 15.79N / 12:   ....   ....   ....   80.3   ....  189.8  195.8   ....   ....   ....
+ 15.26N / 11:   ....   ....   ....   72.2   ....  187.5  191.5   ....   ....   ....
+ 14.74N / 10:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 14.21N /  9:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 13.68N /  8:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 13.16N /  7:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 12.63N /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 12.11N /  5:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 11.58N /  4:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 11.05N /  3:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10.53N /  2:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10N    /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+fill/lev=30v xy_laplace_gridded
+plot/vs/over/nolab xax,yax
+ppl shaset reset
+ 
+! XZ
+ 
+let xz_laplace_gridded = scat2gridlaplace_xz(xax,zax,O2_umol_kg,x[gx=x_20],z[gz=z_20],2,2)
+fill/lev=30v xz_laplace_gridded
+plot/vs/over/nolab xax,zax
+ppl shaset reset
+ 
+! XT
+ 
+let xt_laplace_gridded = scat2gridlaplace_xt(xax,tax,O2_umol_kg,x[gx=x_20],t[gt=t_20],2,2)
+fill/lev=30v xt_laplace_gridded
+plot/vs/over/nolab xax,tax
+ppl shaset reset
+ 
+! YZ
+ 
+let yz_laplace_gridded = scat2gridlaplace_yz(yax,zax,ysequence(O2_umol_kg),y[gy=y_20],z[gz=z_20],2,2)
+fill/lev=30v yz_laplace_gridded
+plot/vs/over/nolab yax,zax
+ppl shaset reset
+ 
+! YT
+ 
+let yt_laplace_gridded = scat2gridlaplace_yt(yax,tax,ysequence(O2_umol_kg),y[gy=y_20],t[gt=t_20],2,2)
+fill/lev=30v yt_laplace_gridded
+plot/vs/over/nolab tax,yax
+ppl shaset reset
+ 
+! ZT
+ 
+let zt_laplace_gridded = scat2gridlaplace_zt(zax,tax,zsequence(O2_umol_kg),z[gz=z_20],t[gt=t_20],2,2)
+fill/lev=30v zt_laplace_gridded
+plot/vs/over/nolab tax, zax
+ 
+can mem /all
+can var /all
+can data /all
+can axis t_20
+can axis z_20
+can axis y_20
+can axis x_20
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_gl
+! bn_scat2grid_gl.jnl
+! test the scat2gridgauss and scat2gridlaplace functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/z=15:85/units=meters/depth/npoints=15 z_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logzp10 = log(Z[gz=z_15] + 10.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxz = xsequence(sinx + logzp10)
+let smxz_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Z[gz=z_15])
+let smxz_xs = if ( smxz_xs_pos gt 180 ) then (smxz_xs_pos - 360) else smxz_xs_pos
+let smxz_zs = xsequence(0.0 * X[gx=x_15] + 1.0 * Z[gz=z_15])
+ 
+let smxt = xsequence(sinx + logtp50)
+let smxt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * T[gt=t_16])
+let smxt_xs = if ( smxt_xs_pos gt 180 ) then (smxt_xs_pos - 360) else smxt_xs_pos
+let smxt_ts = xsequence(0.0 * X[gx=x_15] + 1.0 * T[gt=t_16])
+ 
+let smyz = ysequence(cosyp70 + logzp10)
+let smyz_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * Z[gz=z_15])
+let smyz_zs = ysequence(0.0 * Y[gy=y_15] + 1.0 * Z[gz=z_15])
+ 
+let smyt = ysequence(cosyp70 + logtp50)
+let smyt_ys = ysequence(1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smyt_ts = ysequence(0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+let smzt = zsequence(logzp10 + logtp50)
+let smzt_zs = zsequence(1.0 * Z[gz=z_15] + 0.0 * T[gt=t_16])
+let smzt_ts = zsequence(0.0 * Z[gz=z_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/z=0:100/depth/units=meters/npoints=11 z_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.0
+ 172E   /  2:  172.0
+ 174E   /  3:  174.0
+ 176E   /  4:  176.0
+ 178E   /  5:  178.0
+ 180E   /  6:  180.0
+ 178W   /  7:  182.0
+ 176W   /  8:  184.0
+ 174W   /  9:  186.0
+ 172W   / 10:  188.0
+ 170W   / 11:  190.0
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+          SMXY_XS  SMXY_YS   SMXY
+1    /  1:   173.0   13.00  0.2437
+2    /  2:   174.0   13.00  0.2264
+3    /  3:   175.0   13.00  0.2090
+4    /  4:   176.0   13.00  0.1916
+5    /  5:   177.0   13.00  0.1742
+6    /  6:   178.0   13.00  0.1568
+7    /  7:   179.0   13.00  0.1393
+8    /  8:   180.0   13.00  0.1219
+9    /  9:  -179.0   13.00  0.1044
+10   / 10:  -178.0   13.00  0.0870
+11   / 11:  -177.0   13.00  0.0695
+12   / 12:  -176.0   13.00  0.0521
+13   / 13:  -175.0   13.00  0.0347
+14   / 14:  -174.0   13.00  0.0173
+15   / 15:  -173.0   13.00  0.0000
+16   / 16:   173.0   14.00  0.2264
+17   / 17:   174.0   14.00  0.2091
+18   / 18:   175.0   14.00  0.1917
+19   / 19:   176.0   14.00  0.1743
+20   / 20:   177.0   14.00  0.1569
+21   / 21:   178.0   14.00  0.1394
+22   / 22:   179.0   14.00  0.1220
+23   / 23:   180.0   14.00  0.1045
+24   / 24:  -179.0   14.00  0.0871
+25   / 25:  -178.0   14.00  0.0696
+26   / 26:  -177.0   14.00  0.0522
+27   / 27:  -176.0   14.00  0.0348
+28   / 28:  -175.0   14.00  0.0174
+29   / 29:  -174.0   14.00  0.0000
+30   / 30:  -173.0   14.00 -0.0173
+31   / 31:   173.0   15.00  0.2090
+32   / 32:   174.0   15.00  0.1917
+33   / 33:   175.0   15.00  0.1743
+let xy_gauss_gridded = scat2gridgauss_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],1.0,1.0,1.0,0.0)
+list xy_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],1.0,1.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E    172E    174E    176E    178E    180E    178W    176W    174W    172W    170W   
+                 1       2       3       4       5       6       7       8       9      10      11
+ 30N   / 11:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+ 28N   / 10:    ....  0.0000 -0.0173 -0.0521 -0.0870 -0.1219 -0.1568 -0.1916 -0.2264 -0.2437    ....
+ 26N   /  9:    ....  0.0173  0.0000 -0.0348 -0.0696 -0.1045 -0.1394 -0.1743 -0.2090 -0.2264    ....
+ 24N   /  8:    ....  0.0521  0.0348  0.0000 -0.0349 -0.0698 -0.1046 -0.1395 -0.1743 -0.1916    ....
+ 22N   /  7:    ....  0.0870  0.0696  0.0349  0.0000 -0.0349 -0.0698 -0.1046 -0.1394 -0.1568    ....
+ 20N   /  6:    ....  0.1219  0.1045  0.0698  0.0349  0.0000 -0.0349 -0.0698 -0.1045 -0.1219    ....
+ 18N   /  5:    ....  0.1568  0.1394  0.1046  0.0698  0.0349  0.0000 -0.0349 -0.0696 -0.0870    ....
+ 16N   /  4:    ....  0.1916  0.1743  0.1395  0.1046  0.0698  0.0349  0.0000 -0.0348 -0.0521    ....
+ 14N   /  3:    ....  0.2264  0.2090  0.1743  0.1394  0.1045  0.0696  0.0348  0.0000 -0.0173    ....
+ 12N   /  2:    ....  0.2437  0.2264  0.1916  0.1568  0.1219  0.0870  0.0521  0.0173  0.0000    ....
+ 10N   /  1:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+let xy_laplace_gridded = scat2gridlaplace_xy(smxy_xs,smxy_ys,smxy,X[gx=x_11],Y[gy=y_11],2.0,1)
+list xy_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XY(SMXY_XS,SMXY_YS,SMXY,X[GX=X_11],Y[GY=Y_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+               170E    172E    174E    176E    178E    180E    178W    176W    174W    172W    170W   
+                 1       2       3       4       5       6       7       8       9      10      11
+ 30N   / 11:    ....    .... -0.0575 -0.0870 -0.1192 -0.1533 -0.1879 -0.2214 -0.2521 -0.2791    ....
+ 28N   / 10:    ....  0.0015 -0.0317 -0.0663 -0.1006 -0.1355 -0.1703 -0.2049 -0.2386 -0.2688 -0.2791
+ 26N   /  9:    ....  0.0301  0.0013 -0.0346 -0.0692 -0.1041 -0.1390 -0.1738 -0.2082 -0.2386 -0.2521
+ 24N   /  8:    ....  0.0622  0.0363 -0.0003 -0.0348 -0.0697 -0.1046 -0.1394 -0.1738 -0.2049 -0.2214
+ 22N   /  7:    ....  0.0967  0.0713  0.0344  0.0000 -0.0349 -0.0698 -0.1046 -0.1390 -0.1703 -0.1879
+ 20N   /  6:    ....  0.1318  0.1062  0.0693  0.0349  0.0000 -0.0349 -0.0697 -0.1041 -0.1355 -0.1533
+ 18N   /  5:    ....  0.1668  0.1410  0.1042  0.0698  0.0349  0.0000 -0.0348 -0.0692 -0.1006 -0.1192
+ 16N   /  4:    ....  0.2007  0.1753  0.1384  0.1042  0.0693  0.0344 -0.0003 -0.0346 -0.0663 -0.0870
+ 14N   /  3:    ....  0.2331  0.2153  0.1753  0.1410  0.1062  0.0713  0.0363  0.0013 -0.0317 -0.0575
+ 12N   /  2:    ....    ....  0.2331  0.2007  0.1668  0.1318  0.0967  0.0622  0.0301  0.0015    ....
+ 10N   /  1:    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....    ....
+ 
+list /i=1:33 smxz_xs, smxz_zs, smxz
+             X: 0.5 to 33.5
+ Column  1: SMXZ_XS is IF ( SMXZ_XS_POS GT 180 ) THEN (SMXZ_XS_POS - 360) ELSE SMXZ_XS_POS
+ Column  2: SMXZ_ZS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMXZ is XSEQUENCE(SINX + LOGZP10)
+          SMXZ_XS  SMXZ_ZS  SMXZ
+1    /  1:   173.0   15.00  1.520
+2    /  2:   174.0   15.00  1.502
+3    /  3:   175.0   15.00  1.485
+4    /  4:   176.0   15.00  1.468
+5    /  5:   177.0   15.00  1.450
+6    /  6:   178.0   15.00  1.433
+7    /  7:   179.0   15.00  1.415
+8    /  8:   180.0   15.00  1.398
+9    /  9:  -179.0   15.00  1.380
+10   / 10:  -178.0   15.00  1.363
+11   / 11:  -177.0   15.00  1.346
+12   / 12:  -176.0   15.00  1.328
+13   / 13:  -175.0   15.00  1.311
+14   / 14:  -174.0   15.00  1.293
+15   / 15:  -173.0   15.00  1.276
+16   / 16:   173.0   20.00  1.599
+17   / 17:   174.0   20.00  1.582
+18   / 18:   175.0   20.00  1.564
+19   / 19:   176.0   20.00  1.547
+20   / 20:   177.0   20.00  1.529
+21   / 21:   178.0   20.00  1.512
+22   / 22:   179.0   20.00  1.495
+23   / 23:   180.0   20.00  1.477
+24   / 24:  -179.0   20.00  1.460
+25   / 25:  -178.0   20.00  1.442
+26   / 26:  -177.0   20.00  1.425
+27   / 27:  -176.0   20.00  1.407
+28   / 28:  -175.0   20.00  1.390
+29   / 29:  -174.0   20.00  1.373
+30   / 30:  -173.0   20.00  1.355
+31   / 31:   173.0   25.00  1.666
+32   / 32:   174.0   25.00  1.649
+33   / 33:   175.0   25.00  1.631
+let xz_gauss_gridded = scat2gridgauss_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list xz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+               170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....  1.520  1.502  1.468  1.433  1.398  1.363  1.328  1.293  1.276   ....
+ 20     /  3:   ....  1.596  1.579  1.544  1.509  1.475  1.440  1.405  1.370  1.353   ....
+ 30     /  4:   ....  1.722  1.705  1.670  1.636  1.601  1.566  1.531  1.496  1.479   ....
+ 40     /  5:   ....  1.820  1.803  1.768  1.733  1.698  1.663  1.628  1.594  1.576   ....
+ 50     /  6:   ....  1.899  1.882  1.847  1.812  1.778  1.743  1.708  1.673  1.656   ....
+ 60     /  7:   ....  1.966  1.949  1.914  1.880  1.845  1.810  1.775  1.740  1.723   ....
+ 70     /  8:   ....  2.025  2.007  1.972  1.938  1.903  1.868  1.833  1.798  1.781   ....
+ 80     /  9:   ....  2.076  2.058  2.024  1.989  1.954  1.919  1.884  1.849  1.832   ....
+ 90     / 10:   ....  2.100  2.082  2.047  2.013  1.978  1.943  1.908  1.873  1.856   ....
+ 100    / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+let xz_laplace_gridded = scat2gridlaplace_xz(smxz_xs,smxz_zs,smxz,X[gx=x_11],Z[gz=z_11],2.0,1)
+list xz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XZ(SMXZ_XS,SMXZ_ZS,SMXZ,X[GX=X_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LONGITUDE-DEPTH (m))
+               170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....   ....  1.460  1.433  1.401  1.367  1.333  1.299  1.269  1.245   ....
+ 20     /  3:   ....  1.626  1.566  1.536  1.499  1.464  1.429  1.394  1.359  1.334  1.352
+ 30     /  4:   ....  1.730  1.714  1.675  1.641  1.606  1.571  1.536  1.502  1.469  1.449
+ 40     /  5:   ....  1.825  1.807  1.768  1.734  1.699  1.664  1.629  1.595  1.562  1.539
+ 50     /  6:   ....  1.907  1.885  1.847  1.813  1.778  1.743  1.708  1.674  1.642  1.619
+ 60     /  7:   ....  1.975  1.952  1.914  1.880  1.845  1.810  1.775  1.741  1.709  1.688
+ 70     /  8:   ....  2.033  2.010  1.972  1.938  1.903  1.868  1.833  1.799  1.767  1.745
+ 80     /  9:   ....  2.080  2.061  2.023  1.989  1.954  1.919  1.884  1.850  1.817  1.792
+ 90     / 10:   ....  2.119  2.102  2.065  2.031  1.996  1.961  1.927  1.893  1.861  1.832
+ 100    / 11:   ....   ....  2.118  2.087  2.054  2.020  1.986  1.953  1.922  1.895   ....
+ 
+list /i=1:33 smxt_xs, smxt_ts, smxt
+             X: 0.5 to 33.5
+ Column  1: SMXT_XS is IF ( SMXT_XS_POS GT 180 ) THEN (SMXT_XS_POS - 360) ELSE SMXT_XS_POS
+ Column  2: SMXT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * T[GT=T_16])
+ Column  3: SMXT is XSEQUENCE(SINX + LOGTP50)
+          SMXT_XS  SMXT_TS  SMXT
+1    /  1:   173.0    274.  2.632
+2    /  2:   174.0    274.  2.615
+3    /  3:   175.0    274.  2.597
+4    /  4:   176.0    274.  2.580
+5    /  5:   177.0    274.  2.563
+6    /  6:   178.0    274.  2.545
+7    /  7:   179.0    274.  2.528
+8    /  8:   180.0    274.  2.510
+9    /  9:  -179.0    274.  2.493
+10   / 10:  -178.0    274.  2.475
+11   / 11:  -177.0    274.  2.458
+12   / 12:  -176.0    274.  2.440
+13   / 13:  -175.0    274.  2.423
+14   / 14:  -174.0    274.  2.406
+15   / 15:  -173.0    274.  2.388
+16   / 16:   173.0    821.  3.062
+17   / 17:   174.0    821.  3.045
+18   / 18:   175.0    821.  3.027
+19   / 19:   176.0    821.  3.010
+20   / 20:   177.0    821.  2.992
+21   / 21:   178.0    821.  2.975
+22   / 22:   179.0    821.  2.958
+23   / 23:   180.0    821.  2.940
+24   / 24:  -179.0    821.  2.923
+25   / 25:  -178.0    821.  2.905
+26   / 26:  -177.0    821.  2.888
+27   / 27:  -176.0    821.  2.870
+28   / 28:  -175.0    821.  2.853
+29   / 29:  -174.0    821.  2.836
+30   / 30:  -173.0    821.  2.818
+31   / 31:   173.0   1369.  3.274
+32   / 32:   174.0   1369.  3.256
+33   / 33:   175.0   1369.  3.239
+let xt_gauss_gridded = scat2gridgauss_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list xt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                    170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.632  2.615  2.580  2.545  2.510  2.475  2.440  2.406  2.388   ....
+ 15-FEB-1995 /  2:   ....  3.168  3.151  3.116  3.081  3.046  3.011  2.976  2.942  2.924   ....
+ 18-MAR-1995 /  3:   ....  3.416  3.398  3.363  3.329  3.294  3.259  3.224  3.189  3.172   ....
+ 17-APR-1995 /  4:   ....  3.522  3.505  3.470  3.435  3.400  3.365  3.331  3.296  3.278   ....
+ 17-MAY-1995 /  5:   ....  3.643  3.626  3.591  3.557  3.522  3.487  3.452  3.417  3.400   ....
+ 17-JUN-1995 /  6:   ....  3.741  3.723  3.688  3.654  3.619  3.584  3.549  3.514  3.497   ....
+ 17-JUL-1995 /  7:   ....  3.794  3.777  3.742  3.707  3.672  3.638  3.603  3.568  3.551   ....
+ 17-AUG-1995 /  8:   ....  3.864  3.846  3.812  3.777  3.742  3.707  3.672  3.637  3.620   ....
+ 16-SEP-1995 /  9:   ....  3.924  3.907  3.872  3.837  3.803  3.768  3.733  3.698  3.681   ....
+ 16-OCT-1995 / 10:   ....  3.960  3.943  3.908  3.873  3.838  3.804  3.769  3.734  3.717   ....
+ 16-NOV-1995 / 11:   ....  4.009  3.992  3.957  3.922  3.887  3.852  3.817  3.783  3.765   ....
+ 16-DEC-1995 / 12:   ....  4.053  4.036  4.001  3.966  3.931  3.896  3.862  3.827  3.809   ....
+let xt_laplace_gridded = scat2gridlaplace_xt(smxt_xs,smxt_ts,smxt,X[gx=x_11],T[gt=t_12],2.0,1)
+list xt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_XT(SMXT_XS,SMXT_TS,SMXT,X[GX=X_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LONGITUDE-TIME)
+                    170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.800  2.655  2.647  2.612  2.577  2.542  2.507  2.473  2.463  2.525
+ 15-FEB-1995 /  2:   ....  3.120  3.185  3.136  3.101  3.066  3.031  2.997  2.962  2.925  2.845
+ 18-MAR-1995 /  3:   ....  3.369  3.391  3.342  3.308  3.273  3.238  3.203  3.169  3.131  3.094
+ 17-APR-1995 /  4:   ....  3.534  3.522  3.484  3.449  3.414  3.380  3.345  3.310  3.280  3.260
+ 17-MAY-1995 /  5:   ....  3.654  3.631  3.593  3.558  3.523  3.488  3.454  3.419  3.389  3.379
+ 17-JUN-1995 /  6:   ....  3.744  3.718  3.679  3.645  3.610  3.575  3.540  3.506  3.475  3.470
+ 17-JUL-1995 /  7:   ....  3.814  3.786  3.750  3.715  3.680  3.645  3.610  3.576  3.547  3.540
+ 17-AUG-1995 /  8:   ....  3.876  3.849  3.812  3.777  3.742  3.708  3.673  3.638  3.609  3.602
+ 16-SEP-1995 /  9:   ....  3.931  3.905  3.866  3.832  3.797  3.762  3.727  3.693  3.662  3.656
+ 16-OCT-1995 / 10:   ....  3.977  3.950  3.913  3.879  3.844  3.809  3.774  3.740  3.710  3.702
+ 16-NOV-1995 / 11:   ....  4.019  3.995  3.957  3.922  3.887  3.852  3.818  3.783  3.753  3.744
+ 16-DEC-1995 / 12:   ....  4.058  4.034  3.996  3.961  3.926  3.891  3.856  3.822  3.791  3.782
+ 
+list /j=1:33 smyz_ys, smyz_zs, smyz
+             Y: 0.5 to 33.5
+ Column  1: SMYZ_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * Z[GZ=Z_15])
+ Column  2: SMYZ_ZS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * Z[GZ=Z_15])
+ Column  3: SMYZ is YSEQUENCE(COSYP70 + LOGZP10)
+          SMYZ_YS  SMYZ_ZS  SMYZ
+1    /  1:   13.00   15.00  1.520
+2    /  2:   14.00   15.00  1.502
+3    /  3:   15.00   15.00  1.485
+4    /  4:   16.00   15.00  1.468
+5    /  5:   17.00   15.00  1.450
+6    /  6:   18.00   15.00  1.433
+7    /  7:   19.00   15.00  1.415
+8    /  8:   20.00   15.00  1.398
+9    /  9:   21.00   15.00  1.380
+10   / 10:   22.00   15.00  1.363
+11   / 11:   23.00   15.00  1.346
+12   / 12:   24.00   15.00  1.328
+13   / 13:   25.00   15.00  1.311
+14   / 14:   26.00   15.00  1.293
+15   / 15:   27.00   15.00  1.276
+16   / 16:   13.00   20.00  1.599
+17   / 17:   14.00   20.00  1.582
+18   / 18:   15.00   20.00  1.564
+19   / 19:   16.00   20.00  1.547
+20   / 20:   17.00   20.00  1.529
+21   / 21:   18.00   20.00  1.512
+22   / 22:   19.00   20.00  1.495
+23   / 23:   20.00   20.00  1.477
+24   / 24:   21.00   20.00  1.460
+25   / 25:   22.00   20.00  1.442
+26   / 26:   23.00   20.00  1.425
+27   / 27:   24.00   20.00  1.407
+28   / 28:   25.00   20.00  1.390
+29   / 29:   26.00   20.00  1.373
+30   / 30:   27.00   20.00  1.355
+31   / 31:   13.00   25.00  1.666
+32   / 32:   14.00   25.00  1.649
+33   / 33:   15.00   25.00  1.631
+let yz_gauss_gridded = scat2gridgauss_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],1.0,5.0,1.0,0.0)
+list yz_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],1.0,5.0,1.0,0.0)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....  1.520  1.502  1.468  1.433  1.398  1.363  1.328  1.293  1.276   ....
+ 20     /  3:   ....  1.596  1.579  1.544  1.509  1.475  1.440  1.405  1.370  1.353   ....
+ 30     /  4:   ....  1.722  1.705  1.670  1.636  1.601  1.566  1.531  1.496  1.479   ....
+ 40     /  5:   ....  1.820  1.803  1.768  1.733  1.698  1.663  1.628  1.594  1.576   ....
+ 50     /  6:   ....  1.899  1.882  1.847  1.812  1.778  1.743  1.708  1.673  1.656   ....
+ 60     /  7:   ....  1.966  1.949  1.914  1.880  1.845  1.810  1.775  1.740  1.723   ....
+ 70     /  8:   ....  2.025  2.007  1.972  1.938  1.903  1.868  1.833  1.798  1.781   ....
+ 80     /  9:   ....  2.076  2.058  2.024  1.989  1.954  1.919  1.884  1.849  1.832   ....
+ 90     / 10:   ....  2.100  2.082  2.047  2.013  1.978  1.943  1.908  1.873  1.856   ....
+ 100    / 11:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+let yz_laplace_gridded = scat2gridlaplace_yz(smyz_ys,smyz_zs,smyz,Y[gy=y_11],Z[gz=z_11],2.0,1)
+list yz_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YZ(SMYZ_YS,SMYZ_ZS,SMYZ,Y[GY=Y_11],Z[GZ=Z_11],2.0,1)
+             SUBSET   : 11 by 11 points (LATITUDE-DEPTH (m))
+                10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                 1      2      3      4      5      6      7      8      9     10     11
+ 0      /  1:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 10     /  2:   ....   ....  1.460  1.433  1.401  1.367  1.333  1.299  1.269  1.245   ....
+ 20     /  3:   ....  1.626  1.566  1.536  1.499  1.464  1.429  1.394  1.359  1.334  1.352
+ 30     /  4:   ....  1.730  1.714  1.675  1.641  1.606  1.571  1.536  1.502  1.469  1.449
+ 40     /  5:   ....  1.825  1.807  1.768  1.734  1.699  1.664  1.629  1.595  1.562  1.539
+ 50     /  6:   ....  1.907  1.885  1.847  1.813  1.778  1.743  1.708  1.674  1.642  1.619
+ 60     /  7:   ....  1.975  1.952  1.914  1.880  1.845  1.810  1.775  1.741  1.709  1.688
+ 70     /  8:   ....  2.033  2.010  1.972  1.938  1.903  1.868  1.833  1.799  1.767  1.745
+ 80     /  9:   ....  2.080  2.061  2.023  1.989  1.954  1.919  1.884  1.850  1.817  1.792
+ 90     / 10:   ....  2.119  2.102  2.065  2.031  1.996  1.961  1.927  1.893  1.861  1.832
+ 100    / 11:   ....   ....  2.118  2.087  2.054  2.020  1.986  1.953  1.922  1.895   ....
+ 
+list /j=1:33 smyt_ys, smyt_ts, smyt
+             Y: 0.5 to 33.5
+ Column  1: SMYT_YS is YSEQUENCE(1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  2: SMYT_TS is YSEQUENCE(0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  3: SMYT is YSEQUENCE(COSYP70 + LOGTP50)
+          SMYT_YS  SMYT_TS  SMYT
+1    /  1:   13.00    274.  2.632
+2    /  2:   14.00    274.  2.615
+3    /  3:   15.00    274.  2.597
+4    /  4:   16.00    274.  2.580
+5    /  5:   17.00    274.  2.563
+6    /  6:   18.00    274.  2.545
+7    /  7:   19.00    274.  2.528
+8    /  8:   20.00    274.  2.510
+9    /  9:   21.00    274.  2.493
+10   / 10:   22.00    274.  2.475
+11   / 11:   23.00    274.  2.458
+12   / 12:   24.00    274.  2.440
+13   / 13:   25.00    274.  2.423
+14   / 14:   26.00    274.  2.406
+15   / 15:   27.00    274.  2.388
+16   / 16:   13.00    821.  3.062
+17   / 17:   14.00    821.  3.045
+18   / 18:   15.00    821.  3.027
+19   / 19:   16.00    821.  3.010
+20   / 20:   17.00    821.  2.992
+21   / 21:   18.00    821.  2.975
+22   / 22:   19.00    821.  2.958
+23   / 23:   20.00    821.  2.940
+24   / 24:   21.00    821.  2.923
+25   / 25:   22.00    821.  2.905
+26   / 26:   23.00    821.  2.888
+27   / 27:   24.00    821.  2.870
+28   / 28:   25.00    821.  2.853
+29   / 29:   26.00    821.  2.836
+30   / 30:   27.00    821.  2.818
+31   / 31:   13.00   1369.  3.274
+32   / 32:   14.00   1369.  3.256
+33   / 33:   15.00   1369.  3.239
+let yt_gauss_gridded = scat2gridgauss_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],1.0,436.8,1.0,0.0)
+list yt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],1.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                     10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.632  2.615  2.580  2.545  2.510  2.475  2.440  2.406  2.388   ....
+ 15-FEB-1995 /  2:   ....  3.168  3.151  3.116  3.081  3.046  3.011  2.976  2.942  2.924   ....
+ 18-MAR-1995 /  3:   ....  3.416  3.398  3.363  3.329  3.294  3.259  3.224  3.189  3.172   ....
+ 17-APR-1995 /  4:   ....  3.522  3.505  3.470  3.435  3.400  3.365  3.331  3.296  3.278   ....
+ 17-MAY-1995 /  5:   ....  3.643  3.626  3.591  3.557  3.522  3.487  3.452  3.417  3.400   ....
+ 17-JUN-1995 /  6:   ....  3.741  3.723  3.688  3.654  3.619  3.584  3.549  3.514  3.497   ....
+ 17-JUL-1995 /  7:   ....  3.794  3.777  3.742  3.707  3.672  3.638  3.603  3.568  3.551   ....
+ 17-AUG-1995 /  8:   ....  3.864  3.846  3.812  3.777  3.742  3.707  3.672  3.637  3.620   ....
+ 16-SEP-1995 /  9:   ....  3.924  3.907  3.872  3.837  3.803  3.768  3.733  3.698  3.681   ....
+ 16-OCT-1995 / 10:   ....  3.960  3.943  3.908  3.873  3.838  3.804  3.769  3.734  3.717   ....
+ 16-NOV-1995 / 11:   ....  4.009  3.992  3.957  3.922  3.887  3.852  3.817  3.783  3.765   ....
+ 16-DEC-1995 / 12:   ....  4.053  4.036  4.001  3.966  3.931  3.896  3.862  3.827  3.809   ....
+let yt_laplace_gridded = scat2gridlaplace_yt(smyt_ys,smyt_ts,smyt,Y[gy=y_11],T[gt=t_12],2.0,1)
+list yt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_YT(SMYT_YS,SMYT_TS,SMYT,Y[GY=Y_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (LATITUDE-TIME)
+                     10N    12N    14N    16N    18N    20N    22N    24N    26N    28N    30N   
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  2.800  2.655  2.647  2.612  2.577  2.542  2.507  2.473  2.463  2.525
+ 15-FEB-1995 /  2:   ....  3.120  3.185  3.136  3.101  3.066  3.031  2.997  2.962  2.925  2.845
+ 18-MAR-1995 /  3:   ....  3.369  3.391  3.342  3.308  3.273  3.238  3.203  3.169  3.131  3.094
+ 17-APR-1995 /  4:   ....  3.534  3.522  3.484  3.449  3.414  3.380  3.345  3.310  3.280  3.260
+ 17-MAY-1995 /  5:   ....  3.654  3.631  3.593  3.558  3.523  3.488  3.454  3.419  3.389  3.379
+ 17-JUN-1995 /  6:   ....  3.744  3.718  3.679  3.645  3.610  3.575  3.540  3.506  3.475  3.470
+ 17-JUL-1995 /  7:   ....  3.814  3.786  3.750  3.715  3.680  3.645  3.610  3.576  3.547  3.540
+ 17-AUG-1995 /  8:   ....  3.876  3.849  3.812  3.777  3.742  3.708  3.673  3.638  3.609  3.602
+ 16-SEP-1995 /  9:   ....  3.931  3.905  3.866  3.832  3.797  3.762  3.727  3.693  3.662  3.656
+ 16-OCT-1995 / 10:   ....  3.977  3.950  3.913  3.879  3.844  3.809  3.774  3.740  3.710  3.702
+ 16-NOV-1995 / 11:   ....  4.019  3.995  3.957  3.922  3.887  3.852  3.818  3.783  3.753  3.744
+ 16-DEC-1995 / 12:   ....  4.058  4.034  3.996  3.961  3.926  3.891  3.856  3.822  3.791  3.782
+ 
+list /k=1:33 smzt_zs, smzt_ts, smzt
+             Z: 0.5 to 33.5
+ Column  1: SMZT_ZS is ZSEQUENCE(1.0 * Z[GZ=Z_15] + 0.0 * T[GT=T_16])
+ Column  2: SMZT_TS is ZSEQUENCE(0.0 * Z[GZ=Z_15] + 1.0 * T[GT=T_16])
+ Column  3: SMZT is ZSEQUENCE(LOGZP10 + LOGTP50)
+          SMZT_ZS  SMZT_TS  SMZT
+1    /  1:   15.00    274.  3.908
+2    /  2:   20.00    274.  3.987
+3    /  3:   25.00    274.  4.054
+4    /  4:   30.00    274.  4.112
+5    /  5:   35.00    274.  4.163
+6    /  6:   40.00    274.  4.209
+7    /  7:   45.00    274.  4.251
+8    /  8:   50.00    274.  4.288
+9    /  9:   55.00    274.  4.323
+10   / 10:   60.00    274.  4.355
+11   / 11:   65.00    274.  4.385
+12   / 12:   70.00    274.  4.413
+13   / 13:   75.00    274.  4.440
+14   / 14:   80.00    274.  4.464
+15   / 15:   85.00    274.  4.488
+16   / 16:   15.00    821.  4.338
+17   / 17:   20.00    821.  4.417
+18   / 18:   25.00    821.  4.484
+19   / 19:   30.00    821.  4.542
+20   / 20:   35.00    821.  4.593
+21   / 21:   40.00    821.  4.639
+22   / 22:   45.00    821.  4.681
+23   / 23:   50.00    821.  4.718
+24   / 24:   55.00    821.  4.753
+25   / 25:   60.00    821.  4.785
+26   / 26:   65.00    821.  4.815
+27   / 27:   70.00    821.  4.843
+28   / 28:   75.00    821.  4.870
+29   / 29:   80.00    821.  4.894
+30   / 30:   85.00    821.  4.918
+31   / 31:   15.00   1369.  4.550
+32   / 32:   20.00   1369.  4.629
+33   / 33:   25.00   1369.  4.696
+let zt_gauss_gridded = scat2gridgauss_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],5.0,436.8,1.0,0.0)
+list zt_gauss_gridded
+             VARIABLE : SCAT2GRIDGAUSS_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],5.0,436.8,1.0,0.0)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                     0      10     20     30     40     50     60     70     80     90    100    
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  3.908  3.985  4.111  4.208  4.288  4.355  4.413  4.464  4.488   ....
+ 15-FEB-1995 /  2:   ....  4.444  4.521  4.647  4.744  4.824  4.891  4.949  5.000  5.024   ....
+ 18-MAR-1995 /  3:   ....  4.692  4.768  4.894  4.992  5.071  5.138  5.196  5.248  5.271   ....
+ 17-APR-1995 /  4:   ....  4.798  4.875  5.001  5.098  5.178  5.245  5.303  5.354  5.378   ....
+ 17-MAY-1995 /  5:   ....  4.920  4.996  5.122  5.220  5.299  5.366  5.424  5.476  5.499   ....
+ 17-JUN-1995 /  6:   ....  5.017  5.093  5.219  5.317  5.396  5.463  5.521  5.573  5.596   ....
+ 17-JUL-1995 /  7:   ....  5.070  5.147  5.273  5.370  5.450  5.517  5.575  5.626  5.650   ....
+ 17-AUG-1995 /  8:   ....  5.140  5.216  5.342  5.440  5.519  5.586  5.645  5.696  5.720   ....
+ 16-SEP-1995 /  9:   ....  5.200  5.277  5.403  5.501  5.580  5.647  5.705  5.756  5.780   ....
+ 16-OCT-1995 / 10:   ....  5.236  5.313  5.439  5.537  5.616  5.683  5.741  5.792  5.816   ....
+ 16-NOV-1995 / 11:   ....  5.285  5.362  5.488  5.585  5.665  5.732  5.790  5.841  5.865   ....
+ 16-DEC-1995 / 12:   ....  5.329  5.406  5.532  5.629  5.709  5.776  5.834  5.885  5.909   ....
+let zt_laplace_gridded = scat2gridlaplace_zt(smzt_zs,smzt_ts,smzt,Z[gz=z_11],T[gt=t_12],2.0,1)
+list zt_laplace_gridded
+             VARIABLE : SCAT2GRIDLAPLACE_ZT(SMZT_ZS,SMZT_TS,SMZT,Z[GZ=Z_11],T[GT=T_12],2.0,1)
+             SUBSET   : 11 by 12 points (DEPTH (m)-TIME)
+                     0      10     20     30     40     50     60     70     80     90    100    
+                      1      2      3      4      5      6      7      8      9     10     11
+ 16-JAN-1995 /  1:   ....  4.013  4.011  4.182  4.278  4.356  4.423  4.481  4.531  4.591  4.665
+ 15-FEB-1995 /  2:   ....  4.333  4.541  4.671  4.767  4.845  4.912  4.970  5.020  5.053  4.985
+ 18-MAR-1995 /  3:   ....  4.582  4.746  4.878  4.973  5.052  5.118  5.176  5.227  5.259  5.234
+ 17-APR-1995 /  4:   ....  4.748  4.877  5.019  5.115  5.194  5.260  5.318  5.368  5.408  5.399
+ 17-MAY-1995 /  5:   ....  4.868  4.986  5.128  5.224  5.303  5.369  5.427  5.477  5.517  5.519
+ 17-JUN-1995 /  6:   ....  4.959  5.074  5.215  5.310  5.389  5.455  5.513  5.564  5.602  5.609
+ 17-JUL-1995 /  7:   ....  5.028  5.141  5.285  5.381  5.459  5.526  5.584  5.634  5.675  5.679
+ 17-AUG-1995 /  8:   ....  5.090  5.205  5.347  5.443  5.522  5.588  5.646  5.696  5.736  5.742
+ 16-SEP-1995 /  9:   ....  5.144  5.261  5.402  5.497  5.576  5.643  5.700  5.751  5.790  5.796
+ 16-OCT-1995 / 10:   ....  5.189  5.306  5.449  5.544  5.623  5.689  5.747  5.798  5.838  5.842
+ 16-NOV-1995 / 11:   ....  5.230  5.351  5.492  5.588  5.667  5.733  5.791  5.841  5.881  5.885
+ 16-DEC-1995 / 12:   ....  5.268  5.391  5.531  5.626  5.705  5.772  5.829  5.880  5.919  5.923
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis z_11
+can axis y_11
+can axis x_11
+can axis t_16
+can axis z_15
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2gridlaplace_tarasoff
+! bn_scat2gridlaplace_tarasoff
+! check for error reported by Lev Tarasoff 5/10/2006
+! trac ticket #1412
+! tests modulo of the X axis in the scat2gridlaplace_xy function
+ 
+let xlnb = { -4.06, -5.07, -3.77, -3.02,  0.83,  0.31,  1.02,  0.33, -1.35, -2.54, \
+             -3.75, -5.48, -5.25,  2.98,  3.50, 36.15, 29.40, 19.45, 19.00}
+let ylt = {  52.47, 51.66, 51.58, 51.35, 51.70, 51.46, 51.07, 50.84, 50.80, 50.62, \
+             50.39, 50.13, 56.07, 55.02, 52.50, 69.10, 70.09, 70.15, 69.80}
+let wgt = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}
+ 
+def axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef
+def axis/y=47.25N:83.25n/npoints=73/units=deg ylatef
+ 
+let xln = if xlnb lt 0. then xlnb+360. else xlnb
+let wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef], y[gy=ylatef], 2., 1)
+ 
+show grid wgtl
+    GRID (G009)
+ name       axis              # pts   start                end
+ XLONEF    LONGITUDE          133mr   12.5W                119.5E(479.5)
+ YLATEF    LATITUDE            73 r   47.25N               83.25N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+load wgtl
+! shade wgtl ! Result is shifted in X:
+! data shows up at 70e that should be at 35e
+ 
+! the folowing are listed /order=yx so no data will be skipped
+ 
+! the following should show three regions of data
+list /order=yx wgtl[X=15E:40E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+                68.25N 68.75N 69.25N 69.75N 70.25N 70.75N 71.25N 71.75N 
+                 43     44     45     46     47     48     49     50
+ 15.5E / -105:   ....   ....   ....   ....   ....   ....   ....   ....
+ 16.5E / -104:   ....   ....   ....   ....   ....   ....   ....   ....
+ 17.5E / -103:   ....   ....   ....   ....   ....   ....   ....   ....
+ 18.5E / -102:   ....   ....   ....  0.451  0.259   ....   ....   ....
+ 19.5E / -101:   ....   ....  0.670  0.523  0.173  0.040   ....   ....
+ 20.5E / -100:   ....   ....   ....  0.451  0.259   ....   ....   ....
+ 21.5E /  -99:   ....   ....   ....   ....   ....   ....   ....   ....
+ 22.5E /  -98:   ....   ....   ....   ....   ....   ....   ....   ....
+ 23.5E /  -97:   ....   ....   ....   ....   ....   ....   ....   ....
+ 24.5E /  -96:   ....   ....   ....   ....   ....   ....   ....   ....
+ 25.5E /  -95:   ....   ....   ....   ....   ....   ....   ....   ....
+ 26.5E /  -94:   ....   ....   ....   ....   ....   ....   ....   ....
+ 27.5E /  -93:   ....   ....   ....   ....   ....   ....   ....   ....
+ 28.5E /  -92:   ....   ....   ....   ....  1.170   ....   ....   ....
+ 29.5E /  -91:   ....   ....   ....  1.170  1.170  1.170   ....   ....
+ 30.5E /  -90:   ....   ....   ....   ....  1.170   ....   ....   ....
+ 31.5E /  -89:   ....   ....   ....   ....   ....   ....   ....   ....
+ 32.5E /  -88:   ....   ....   ....   ....   ....   ....   ....   ....
+ 33.5E /  -87:   ....   ....   ....   ....   ....   ....   ....   ....
+ 34.5E /  -86:   ....   ....   ....   ....   ....   ....   ....   ....
+ 35.5E /  -85:   ....   ....  1.340   ....   ....   ....   ....   ....
+ 36.5E /  -84:   ....  1.340  1.340  1.340   ....   ....   ....   ....
+ 37.5E /  -83:   ....   ....  1.340   ....   ....   ....   ....   ....
+ 38.5E /  -82:   ....   ....   ....   ....   ....   ....   ....   ....
+ 39.5E /  -81:   ....   ....   ....   ....   ....   ....   ....   ....
+! the following should completely undefined
+list /order=yx wgtl[X=55E:80E,Y=68N:72N]
+             VARIABLE : SCAT2GRIDLAPLACE_XY(XLN,YLT, WGT, X[GX=XLONEF], Y[GY=YLATEF], 2., 1)
+             SUBSET   : 8 by 25 points (LATITUDE-LONGITUDE)
+               68N 69N 69N 70N 70N 71N 71N 72N 
+               43  44  45  46  47  48  49  50
+ 55.5E / -65:................................
+ 56.5E / -64:................................
+ 57.5E / -63:................................
+ 58.5E / -62:................................
+ 59.5E / -61:................................
+ 60.5E / -60:................................
+ 61.5E / -59:................................
+ 62.5E / -58:................................
+ 63.5E / -57:................................
+ 64.5E / -56:................................
+ 65.5E / -55:................................
+ 66.5E / -54:................................
+ 67.5E / -53:................................
+ 68.5E / -52:................................
+ 69.5E / -51:................................
+ 70.5E / -50:................................
+ 71.5E / -49:................................
+ 72.5E / -48:................................
+ 73.5E / -47:................................
+ 74.5E / -46:................................
+ 75.5E / -45:................................
+ 76.5E / -44:................................
+ 77.5E / -43:................................
+ 78.5E / -42:................................
+ 79.5E / -41:................................
+ 
+cancel data /all
+cancel var /all
+cancel axis xlonef
+cancel axis ylatef
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_nobs
+! bn_scat2grid_nobs.jnl
+! test of scat2grid_nobs functions,
+! listing the results which can be checked against input
+ 
+define axis/x=173:187/unit=degrees_east/npoints=15 x_15
+define axis/y=13:27/unit=degrees_north/npoints=15 y_15
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=16 t_16
+ 
+let sinx = sin(X[gx=x_15] * 3.14159265 / 180.0)
+let cosyp70 = cos((Y[gy=y_15] + 70.0) * 3.14159265 / 180.0)
+let logtp50 = log(T[gt=t_16] + 50.0)
+ 
+let smxy = xsequence(sinx + cosyp70)
+let smxy_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15])
+let smxy_xs = if ( smxy_xs_pos gt 180 ) then (smxy_xs_pos - 360) else smxy_xs_pos
+let smxy_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15])
+ 
+let smxyt = xsequence(sinx + cosyp70 + logtp50)
+let smxyt_xs_pos = xsequence(1.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_xs = if ( smxyt_xs_pos gt 180 ) then (smxyt_xs_pos - 360) else smxyt_xs_pos
+let smxyt_ys = xsequence(0.0 * X[gx=x_15] + 1.0 * Y[gy=y_15] + 0.0 * T[gt=t_16])
+let smxyt_ts = xsequence(0.0 * X[gx=x_15] + 0.0 * Y[gy=y_15] + 1.0 * T[gt=t_16])
+ 
+define axis/x=170:190/unit=degrees_east/npoints=11 x_11
+define axis/y=10:30/units=degrees_north/npoints=11 y_11
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+ 
+list X[gx=x_11]
+             VARIABLE : X
+                        axis X_11
+             SUBSET   : 11 points (LONGITUDE)
+ 170E   /  1:  170.0
+ 172E   /  2:  172.0
+ 174E   /  3:  174.0
+ 176E   /  4:  176.0
+ 178E   /  5:  178.0
+ 180E   /  6:  180.0
+ 178W   /  7:  182.0
+ 176W   /  8:  184.0
+ 174W   /  9:  186.0
+ 172W   / 10:  188.0
+ 170W   / 11:  190.0
+ 
+list /i=1:33 smxy_xs, smxy_ys, smxy
+             X: 0.5 to 33.5
+ Column  1: SMXY_XS is IF ( SMXY_XS_POS GT 180 ) THEN (SMXY_XS_POS - 360) ELSE SMXY_XS_POS
+ Column  2: SMXY_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15])
+ Column  3: SMXY is XSEQUENCE(SINX + COSYP70)
+          SMXY_XS  SMXY_YS   SMXY
+1    /  1:   173.0   13.00  0.2437
+2    /  2:   174.0   13.00  0.2264
+3    /  3:   175.0   13.00  0.2090
+4    /  4:   176.0   13.00  0.1916
+5    /  5:   177.0   13.00  0.1742
+6    /  6:   178.0   13.00  0.1568
+7    /  7:   179.0   13.00  0.1393
+8    /  8:   180.0   13.00  0.1219
+9    /  9:  -179.0   13.00  0.1044
+10   / 10:  -178.0   13.00  0.0870
+11   / 11:  -177.0   13.00  0.0695
+12   / 12:  -176.0   13.00  0.0521
+13   / 13:  -175.0   13.00  0.0347
+14   / 14:  -174.0   13.00  0.0173
+15   / 15:  -173.0   13.00  0.0000
+16   / 16:   173.0   14.00  0.2264
+17   / 17:   174.0   14.00  0.2091
+18   / 18:   175.0   14.00  0.1917
+19   / 19:   176.0   14.00  0.1743
+20   / 20:   177.0   14.00  0.1569
+21   / 21:   178.0   14.00  0.1394
+22   / 22:   179.0   14.00  0.1220
+23   / 23:   180.0   14.00  0.1045
+24   / 24:  -179.0   14.00  0.0871
+25   / 25:  -178.0   14.00  0.0696
+26   / 26:  -177.0   14.00  0.0522
+27   / 27:  -176.0   14.00  0.0348
+28   / 28:  -175.0   14.00  0.0174
+29   / 29:  -174.0   14.00  0.0000
+30   / 30:  -173.0   14.00 -0.0173
+31   / 31:   173.0   15.00  0.2090
+32   / 32:   174.0   15.00  0.1917
+33   / 33:   175.0   15.00  0.1743
+let xy_nobs = scat2grid_nobs_xy(smxy_xs, smxy_ys, X[gx=x_11], Y[gy=y_11])
+list xy_nobs
+             VARIABLE : SCAT2GRID_NOBS_XY(SMXY_XS, SMXY_YS, X[GX=X_11], Y[GY=Y_11])
+             SUBSET   : 11 by 11 points (LONGITUDE-LATITUDE)
+              170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                1      2      3      4      5      6      7      8      9     10     11
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+list /i=1:33 smxyt_xs, smxyt_ys, smxyt_ts, smxyt
+             X: 0.5 to 33.5
+ Column  1: SMXYT_XS is IF ( SMXYT_XS_POS GT 180 ) THEN (SMXYT_XS_POS - 360) ELSE SMXYT_XS_POS
+ Column  2: SMXYT_YS is XSEQUENCE(0.0 * X[GX=X_15] + 1.0 * Y[GY=Y_15] + 0.0 * T[GT=T_16])
+ Column  3: SMXYT_TS is XSEQUENCE(0.0 * X[GX=X_15] + 0.0 * Y[GY=Y_15] + 1.0 * T[GT=T_16])
+ Column  4: SMXYT is XSEQUENCE(SINX + COSYP70 + LOGTP50)
+         SMXYT_XS  SMXYT_Y SMXYT_T  SMXYT
+1    /  1:   173.0   13.00   273.8  2.754
+2    /  2:   174.0   13.00   273.8  2.737
+3    /  3:   175.0   13.00   273.8  2.719
+4    /  4:   176.0   13.00   273.8  2.702
+5    /  5:   177.0   13.00   273.8  2.684
+6    /  6:   178.0   13.00   273.8  2.667
+7    /  7:   179.0   13.00   273.8  2.650
+8    /  8:   180.0   13.00   273.8  2.632
+9    /  9:  -179.0   13.00   273.8  2.615
+10   / 10:  -178.0   13.00   273.8  2.597
+11   / 11:  -177.0   13.00   273.8  2.580
+12   / 12:  -176.0   13.00   273.8  2.562
+13   / 13:  -175.0   13.00   273.8  2.545
+14   / 14:  -174.0   13.00   273.8  2.528
+15   / 15:  -173.0   13.00   273.8  2.510
+16   / 16:   173.0   14.00   273.8  2.737
+17   / 17:   174.0   14.00   273.8  2.719
+18   / 18:   175.0   14.00   273.8  2.702
+19   / 19:   176.0   14.00   273.8  2.684
+20   / 20:   177.0   14.00   273.8  2.667
+21   / 21:   178.0   14.00   273.8  2.650
+22   / 22:   179.0   14.00   273.8  2.632
+23   / 23:   180.0   14.00   273.8  2.615
+24   / 24:  -179.0   14.00   273.8  2.597
+25   / 25:  -178.0   14.00   273.8  2.580
+26   / 26:  -177.0   14.00   273.8  2.562
+27   / 27:  -176.0   14.00   273.8  2.545
+28   / 28:  -175.0   14.00   273.8  2.528
+29   / 29:  -174.0   14.00   273.8  2.510
+30   / 30:  -173.0   14.00   273.8  2.493
+31   / 31:   173.0   15.00   273.8  2.719
+32   / 32:   174.0   15.00   273.8  2.702
+33   / 33:   175.0   15.00   273.8  2.685
+let xyt_nobs = scat2grid_nobs_xyt(smxyt_xs, smxyt_ys, smxyt_ts, X[gx=x_11], Y[gy=y_11], T[gt=t_12])
+list xyt_nobs
+             VARIABLE : SCAT2GRID_NOBS_XYT(SMXYT_XS, SMXYT_YS, SMXYT_TS, X[GX=X_11], Y[GY=Y_11], T[GT=T_12])
+             SUBSET   : 11 by 11 by 12 points (LONGITUDE-LATITUDE-TIME)
+              170E   172E   174E   176E   178E    180E  178W   176W   174W   172W   170W   
+                1      2      3      4      5      6      7      8      9     10     11
+ ---- L:1 T:   16-JAN-1995 05:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:2 T:   15-FEB-1995 15:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:3 T:   18-MAR-1995 01:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:4 T:   17-APR-1995 11:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:5 T:   17-MAY-1995 21:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:6 T:   17-JUN-1995 07:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:7 T:   17-JUL-1995 17:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:8 T:   17-AUG-1995 03:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:9 T:   16-SEP-1995 13:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:10 T:   16-OCT-1995 23:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:11 T:   16-NOV-1995 09:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 26N   /  9:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 24N   /  8:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 22N   /  7:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 20N   /  6:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 18N   /  5:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 16N   /  4:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 14N   /  3:  0.000  0.000  8.000  8.000  8.000  8.000  8.000  8.000  8.000  4.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ ---- L:12 T:   16-DEC-1995 19:00
+ 30N   / 11:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 28N   / 10:  0.000  0.000  2.000  2.000  2.000  2.000  2.000  2.000  2.000  1.000  0.000
+ 26N   /  9:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 24N   /  8:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 22N   /  7:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 20N   /  6:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 18N   /  5:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 16N   /  4:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 14N   /  3:  0.000  0.000  4.000  4.000  4.000  4.000  4.000  4.000  4.000  2.000  0.000
+ 12N   /  2:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 10N   /  1:  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+can var /all
+can axis t_12
+can axis y_11
+can axis x_11
+can axis t_16
+can axis y_15
+can axis x_15
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_scat2grid_t
+! bn_scat2grid_t.jnl
+! test the ave_scat2grid_t and scat2grid_t functions,
+! listing the results which can be checked against input
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=32 t_32
+ 
+let logtp50 = log(T[gt=t_32] + 50.0)
+let ltp50_tax = T[gt=t_32]
+list ltp50_tax, logtp50
+             TIME: 01-JAN-1995 00:00 to 01-JAN-1996 00:00
+ Column  1: LTP50_TAX is T[GT=T_32]
+ Column  2: LOGTP50 is LOG(T[GT=T_32] + 50.0)
+                  LTP50_TAX  LOGTP50
+06-JAN-1995 16 /  1:    137.   2.272
+18-JAN-1995 02 /  2:    411.   2.663
+29-JAN-1995 12 /  3:    684.   2.866
+09-FEB-1995 22 /  4:    958.   3.004
+21-FEB-1995 07 /  5:   1232.   3.108
+04-MAR-1995 17 /  6:   1506.   3.192
+16-MAR-1995 03 /  7:   1779.   3.262
+27-MAR-1995 13 /  8:   2053.   3.323
+07-APR-1995 22 /  9:   2327.   3.376
+19-APR-1995 08 / 10:   2601.   3.423
+30-APR-1995 18 / 11:   2874.   3.466
+12-MAY-1995 04 / 12:   3148.   3.505
+23-MAY-1995 13 / 13:   3422.   3.541
+03-JUN-1995 23 / 14:   3696.   3.574
+15-JUN-1995 09 / 15:   3969.   3.604
+26-JUN-1995 19 / 16:   4243.   3.633
+08-JUL-1995 04 / 17:   4517.   3.660
+19-JUL-1995 14 / 18:   4791.   3.685
+31-JUL-1995 00 / 19:   5064.   3.709
+11-AUG-1995 10 / 20:   5338.   3.731
+22-AUG-1995 19 / 21:   5612.   3.753
+03-SEP-1995 05 / 22:   5886.   3.773
+14-SEP-1995 15 / 23:   6159.   3.793
+26-SEP-1995 01 / 24:   6433.   3.812
+07-OCT-1995 10 / 25:   6707.   3.830
+18-OCT-1995 20 / 26:   6981.   3.847
+30-OCT-1995 06 / 27:   7254.   3.864
+10-NOV-1995 16 / 28:   7528.   3.880
+22-NOV-1995 01 / 29:   7802.   3.895
+03-DEC-1995 11 / 30:   8076.   3.910
+14-DEC-1995 21 / 31:   8349.   3.924
+26-DEC-1995 07 / 32:   8623.   3.938
+ 
+define axis/t=0:8760/unit=hours/t0="01-JAN-1995 00:00:00"/edges/npoints=12 t_12
+let new_tax = T[gt=t_12]
+ 
+let ave_t = ave_scat2grid_t(ltp50_tax, logtp50, new_tax)
+let t_cnt = scat2grid_t(ltp50_tax, new_tax)
+list new_tax, ave_t, t_cnt
+             TIME: 01-JAN-1995 00:00 to 01-JAN-1996 00:00
+ Column  1: NEW_TAX is T[GT=T_12]
+ Column  2: AVE_T is AVE_SCAT2GRID_T(LTP50_TAX, LOGTP50, NEW_TAX)
+ Column  3: T_CNT is SCAT2GRID_T(LTP50_TAX, NEW_TAX)
+                 NEW_TAX   AVE_T  T_CNT
+16-JAN-1995 /  1:    365.  2.600  3.000
+15-FEB-1995 /  2:   1095.  3.056  2.000
+18-MAR-1995 /  3:   1825.  3.259  3.000
+17-APR-1995 /  4:   2555.  3.422  3.000
+17-MAY-1995 /  5:   3285.  3.523  2.000
+17-JUN-1995 /  6:   4015.  3.603  3.000
+17-JUL-1995 /  7:   4745.  3.684  3.000
+17-AUG-1995 /  8:   5475.  3.742  2.000
+16-SEP-1995 /  9:   6205.  3.793  3.000
+16-OCT-1995 / 10:   6935.  3.847  3.000
+16-NOV-1995 / 11:   7665.  3.887  2.000
+16-DEC-1995 / 12:   8395.  3.924  3.000
+ 
+can mem /all
+can var /all
+can axis t_12
+can axis t_32
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_transpose
+! bn_tranpose.jnl
+! test the transpose functions,
+! listing the results which can be checked against input
+ 
+def axis /X=0.0:4.0:1.0 xaxs
+def axis /Y=0.0:3.0:1.0 yaxs
+def axis /Z=0.0:2.0:1.0 zaxs
+def axis /T=0.0:1.0:1.0 taxs
+ 
+def grid /X=xaxs /Y=yaxs /Z=zaxs /T=taxs mygrd
+set grid mygrd
+ 
+let myvar = X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+ 
+list myvar
+             VARIABLE : X + 5.0 * (Y + 4.0 * (Z + 3.0 * T))
+             SUBSET   : 5 by 4 by 3 by 2 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 0   / 1:    0.0    1.0    2.0    3.0    4.0
+ 1   / 2:    5.0    6.0    7.0    8.0    9.0
+ 2   / 3:   10.0   11.0   12.0   13.0   14.0
+ 3   / 4:   15.0   16.0   17.0   18.0   19.0
+ ---- K:2 Z:   1
+ 0   / 1:   20.0   21.0   22.0   23.0   24.0
+ 1   / 2:   25.0   26.0   27.0   28.0   29.0
+ 2   / 3:   30.0   31.0   32.0   33.0   34.0
+ 3   / 4:   35.0   36.0   37.0   38.0   39.0
+ ---- K:3 Z:   2
+ 0   / 1:   40.0   41.0   42.0   43.0   44.0
+ 1   / 2:   45.0   46.0   47.0   48.0   49.0
+ 2   / 3:   50.0   51.0   52.0   53.0   54.0
+ 3   / 4:   55.0   56.0   57.0   58.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:   60.0   61.0   62.0   63.0   64.0
+ 1   / 2:   65.0   66.0   67.0   68.0   69.0
+ 2   / 3:   70.0   71.0   72.0   73.0   74.0
+ 3   / 4:   75.0   76.0   77.0   78.0   79.0
+ ---- K:2 Z:   1
+ 0   / 1:   80.0   81.0   82.0   83.0   84.0
+ 1   / 2:   85.0   86.0   87.0   88.0   89.0
+ 2   / 3:   90.0   91.0   92.0   93.0   94.0
+ 3   / 4:   95.0   96.0   97.0   98.0   99.0
+ ---- K:3 Z:   2
+ 0   / 1:  100.0  101.0  102.0  103.0  104.0
+ 1   / 2:  105.0  106.0  107.0  108.0  109.0
+ 2   / 3:  110.0  111.0  112.0  113.0  114.0
+ 3   / 4:  115.0  116.0  117.0  118.0  119.0
+list transpose_xy(myvar)
+             VARIABLE : TRANSPOSE_XY(MYVAR)
+             SUBSET   : 4 by 5 by 3 by 2 points (X-Y-Z-T)
+             1      2      3      4    
+             1      2      3      4
+ ---- L:1 T:   0
+ ---- K:1 Z:   0
+ 1   / 1:    0.0    5.0   10.0   15.0
+ 2   / 2:    1.0    6.0   11.0   16.0
+ 3   / 3:    2.0    7.0   12.0   17.0
+ 4   / 4:    3.0    8.0   13.0   18.0
+ 5   / 5:    4.0    9.0   14.0   19.0
+ ---- K:2 Z:   1
+ 1   / 1:   20.0   25.0   30.0   35.0
+ 2   / 2:   21.0   26.0   31.0   36.0
+ 3   / 3:   22.0   27.0   32.0   37.0
+ 4   / 4:   23.0   28.0   33.0   38.0
+ 5   / 5:   24.0   29.0   34.0   39.0
+ ---- K:3 Z:   2
+ 1   / 1:   40.0   45.0   50.0   55.0
+ 2   / 2:   41.0   46.0   51.0   56.0
+ 3   / 3:   42.0   47.0   52.0   57.0
+ 4   / 4:   43.0   48.0   53.0   58.0
+ 5   / 5:   44.0   49.0   54.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:   60.0   65.0   70.0   75.0
+ 2   / 2:   61.0   66.0   71.0   76.0
+ 3   / 3:   62.0   67.0   72.0   77.0
+ 4   / 4:   63.0   68.0   73.0   78.0
+ 5   / 5:   64.0   69.0   74.0   79.0
+ ---- K:2 Z:   1
+ 1   / 1:   80.0   85.0   90.0   95.0
+ 2   / 2:   81.0   86.0   91.0   96.0
+ 3   / 3:   82.0   87.0   92.0   97.0
+ 4   / 4:   83.0   88.0   93.0   98.0
+ 5   / 5:   84.0   89.0   94.0   99.0
+ ---- K:3 Z:   2
+ 1   / 1:  100.0  105.0  110.0  115.0
+ 2   / 2:  101.0  106.0  111.0  116.0
+ 3   / 3:  102.0  107.0  112.0  117.0
+ 4   / 4:  103.0  108.0  113.0  118.0
+ 5   / 5:  104.0  109.0  114.0  119.0
+list transpose_xz(myvar)
+             VARIABLE : TRANSPOSE_XZ(MYVAR)
+             SUBSET   : 3 by 4 by 5 by 2 points (X-Y-Z-T)
+             1      2      3    
+             1      2      3
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 0   / 1:    0.0   20.0   40.0
+ 1   / 2:    5.0   25.0   45.0
+ 2   / 3:   10.0   30.0   50.0
+ 3   / 4:   15.0   35.0   55.0
+ ---- K:2 Z:   2
+ 0   / 1:    1.0   21.0   41.0
+ 1   / 2:    6.0   26.0   46.0
+ 2   / 3:   11.0   31.0   51.0
+ 3   / 4:   16.0   36.0   56.0
+ ---- K:3 Z:   3
+ 0   / 1:    2.0   22.0   42.0
+ 1   / 2:    7.0   27.0   47.0
+ 2   / 3:   12.0   32.0   52.0
+ 3   / 4:   17.0   37.0   57.0
+ ---- K:4 Z:   4
+ 0   / 1:    3.0   23.0   43.0
+ 1   / 2:    8.0   28.0   48.0
+ 2   / 3:   13.0   33.0   53.0
+ 3   / 4:   18.0   38.0   58.0
+ ---- K:5 Z:   5
+ 0   / 1:    4.0   24.0   44.0
+ 1   / 2:    9.0   29.0   49.0
+ 2   / 3:   14.0   34.0   54.0
+ 3   / 4:   19.0   39.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:   60.0   80.0  100.0
+ 1   / 2:   65.0   85.0  105.0
+ 2   / 3:   70.0   90.0  110.0
+ 3   / 4:   75.0   95.0  115.0
+ ---- K:2 Z:   2
+ 0   / 1:   61.0   81.0  101.0
+ 1   / 2:   66.0   86.0  106.0
+ 2   / 3:   71.0   91.0  111.0
+ 3   / 4:   76.0   96.0  116.0
+ ---- K:3 Z:   3
+ 0   / 1:   62.0   82.0  102.0
+ 1   / 2:   67.0   87.0  107.0
+ 2   / 3:   72.0   92.0  112.0
+ 3   / 4:   77.0   97.0  117.0
+ ---- K:4 Z:   4
+ 0   / 1:   63.0   83.0  103.0
+ 1   / 2:   68.0   88.0  108.0
+ 2   / 3:   73.0   93.0  113.0
+ 3   / 4:   78.0   98.0  118.0
+ ---- K:5 Z:   5
+ 0   / 1:   64.0   84.0  104.0
+ 1   / 2:   69.0   89.0  109.0
+ 2   / 3:   74.0   94.0  114.0
+ 3   / 4:   79.0   99.0  119.0
+list transpose_xt(myvar)
+             VARIABLE : TRANSPOSE_XT(MYVAR)
+             SUBSET   : 2 by 4 by 3 by 5 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 0   / 1:    0.0   60.0
+ 1   / 2:    5.0   65.0
+ 2   / 3:   10.0   70.0
+ 3   / 4:   15.0   75.0
+ ---- K:2 Z:   1
+ 0   / 1:   20.0   80.0
+ 1   / 2:   25.0   85.0
+ 2   / 3:   30.0   90.0
+ 3   / 4:   35.0   95.0
+ ---- K:3 Z:   2
+ 0   / 1:   40.0  100.0
+ 1   / 2:   45.0  105.0
+ 2   / 3:   50.0  110.0
+ 3   / 4:   55.0  115.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 0   / 1:    1.0   61.0
+ 1   / 2:    6.0   66.0
+ 2   / 3:   11.0   71.0
+ 3   / 4:   16.0   76.0
+ ---- K:2 Z:   1
+ 0   / 1:   21.0   81.0
+ 1   / 2:   26.0   86.0
+ 2   / 3:   31.0   91.0
+ 3   / 4:   36.0   96.0
+ ---- K:3 Z:   2
+ 0   / 1:   41.0  101.0
+ 1   / 2:   46.0  106.0
+ 2   / 3:   51.0  111.0
+ 3   / 4:   56.0  116.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 0   / 1:    2.0   62.0
+ 1   / 2:    7.0   67.0
+ 2   / 3:   12.0   72.0
+ 3   / 4:   17.0   77.0
+ ---- K:2 Z:   1
+ 0   / 1:   22.0   82.0
+ 1   / 2:   27.0   87.0
+ 2   / 3:   32.0   92.0
+ 3   / 4:   37.0   97.0
+ ---- K:3 Z:   2
+ 0   / 1:   42.0  102.0
+ 1   / 2:   47.0  107.0
+ 2   / 3:   52.0  112.0
+ 3   / 4:   57.0  117.0
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 0   / 1:    3.0   63.0
+ 1   / 2:    8.0   68.0
+ 2   / 3:   13.0   73.0
+ 3   / 4:   18.0   78.0
+ ---- K:2 Z:   1
+ 0   / 1:   23.0   83.0
+ 1   / 2:   28.0   88.0
+ 2   / 3:   33.0   93.0
+ 3   / 4:   38.0   98.0
+ ---- K:3 Z:   2
+ 0   / 1:   43.0  103.0
+ 1   / 2:   48.0  108.0
+ 2   / 3:   53.0  113.0
+ 3   / 4:   58.0  118.0
+ ---- L:5 T:   5
+ ---- K:1 Z:   0
+ 0   / 1:    4.0   64.0
+ 1   / 2:    9.0   69.0
+ 2   / 3:   14.0   74.0
+ 3   / 4:   19.0   79.0
+ ---- K:2 Z:   1
+ 0   / 1:   24.0   84.0
+ 1   / 2:   29.0   89.0
+ 2   / 3:   34.0   94.0
+ 3   / 4:   39.0   99.0
+ ---- K:3 Z:   2
+ 0   / 1:   44.0  104.0
+ 1   / 2:   49.0  109.0
+ 2   / 3:   54.0  114.0
+ 3   / 4:   59.0  119.0
+list transpose_yz(myvar)
+             VARIABLE : TRANSPOSE_YZ(MYVAR)
+             SUBSET   : 5 by 3 by 4 by 2 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   0
+ ---- K:1 Z:   1
+ 1   / 1:    0.0    1.0    2.0    3.0    4.0
+ 2   / 2:   20.0   21.0   22.0   23.0   24.0
+ 3   / 3:   40.0   41.0   42.0   43.0   44.0
+ ---- K:2 Z:   2
+ 1   / 1:    5.0    6.0    7.0    8.0    9.0
+ 2   / 2:   25.0   26.0   27.0   28.0   29.0
+ 3   / 3:   45.0   46.0   47.0   48.0   49.0
+ ---- K:3 Z:   3
+ 1   / 1:   10.0   11.0   12.0   13.0   14.0
+ 2   / 2:   30.0   31.0   32.0   33.0   34.0
+ 3   / 3:   50.0   51.0   52.0   53.0   54.0
+ ---- K:4 Z:   4
+ 1   / 1:   15.0   16.0   17.0   18.0   19.0
+ 2   / 2:   35.0   36.0   37.0   38.0   39.0
+ 3   / 3:   55.0   56.0   57.0   58.0   59.0
+ ---- L:2 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   60.0   61.0   62.0   63.0   64.0
+ 2   / 2:   80.0   81.0   82.0   83.0   84.0
+ 3   / 3:  100.0  101.0  102.0  103.0  104.0
+ ---- K:2 Z:   2
+ 1   / 1:   65.0   66.0   67.0   68.0   69.0
+ 2   / 2:   85.0   86.0   87.0   88.0   89.0
+ 3   / 3:  105.0  106.0  107.0  108.0  109.0
+ ---- K:3 Z:   3
+ 1   / 1:   70.0   71.0   72.0   73.0   74.0
+ 2   / 2:   90.0   91.0   92.0   93.0   94.0
+ 3   / 3:  110.0  111.0  112.0  113.0  114.0
+ ---- K:4 Z:   4
+ 1   / 1:   75.0   76.0   77.0   78.0   79.0
+ 2   / 2:   95.0   96.0   97.0   98.0   99.0
+ 3   / 3:  115.0  116.0  117.0  118.0  119.0
+list transpose_yt(myvar)
+             VARIABLE : TRANSPOSE_YT(MYVAR)
+             SUBSET   : 5 by 2 by 3 by 4 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ ---- K:1 Z:   0
+ 1   / 1:    0.0    1.0    2.0    3.0    4.0
+ 2   / 2:   60.0   61.0   62.0   63.0   64.0
+ ---- K:2 Z:   1
+ 1   / 1:   20.0   21.0   22.0   23.0   24.0
+ 2   / 2:   80.0   81.0   82.0   83.0   84.0
+ ---- K:3 Z:   2
+ 1   / 1:   40.0   41.0   42.0   43.0   44.0
+ 2   / 2:  100.0  101.0  102.0  103.0  104.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   0
+ 1   / 1:    5.0    6.0    7.0    8.0    9.0
+ 2   / 2:   65.0   66.0   67.0   68.0   69.0
+ ---- K:2 Z:   1
+ 1   / 1:   25.0   26.0   27.0   28.0   29.0
+ 2   / 2:   85.0   86.0   87.0   88.0   89.0
+ ---- K:3 Z:   2
+ 1   / 1:   45.0   46.0   47.0   48.0   49.0
+ 2   / 2:  105.0  106.0  107.0  108.0  109.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   0
+ 1   / 1:   10.0   11.0   12.0   13.0   14.0
+ 2   / 2:   70.0   71.0   72.0   73.0   74.0
+ ---- K:2 Z:   1
+ 1   / 1:   30.0   31.0   32.0   33.0   34.0
+ 2   / 2:   90.0   91.0   92.0   93.0   94.0
+ ---- K:3 Z:   2
+ 1   / 1:   50.0   51.0   52.0   53.0   54.0
+ 2   / 2:  110.0  111.0  112.0  113.0  114.0
+ ---- L:4 T:   4
+ ---- K:1 Z:   0
+ 1   / 1:   15.0   16.0   17.0   18.0   19.0
+ 2   / 2:   75.0   76.0   77.0   78.0   79.0
+ ---- K:2 Z:   1
+ 1   / 1:   35.0   36.0   37.0   38.0   39.0
+ 2   / 2:   95.0   96.0   97.0   98.0   99.0
+ ---- K:3 Z:   2
+ 1   / 1:   55.0   56.0   57.0   58.0   59.0
+ 2   / 2:  115.0  116.0  117.0  118.0  119.0
+list transpose_zt(myvar)
+             VARIABLE : TRANSPOSE_ZT(MYVAR)
+             SUBSET   : 5 by 4 by 2 by 3 points (X-Y-Z-T)
+             0      1      2      3      4    
+             1      2      3      4      5
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 0   / 1:    0.0    1.0    2.0    3.0    4.0
+ 1   / 2:    5.0    6.0    7.0    8.0    9.0
+ 2   / 3:   10.0   11.0   12.0   13.0   14.0
+ 3   / 4:   15.0   16.0   17.0   18.0   19.0
+ ---- K:2 Z:   2
+ 0   / 1:   60.0   61.0   62.0   63.0   64.0
+ 1   / 2:   65.0   66.0   67.0   68.0   69.0
+ 2   / 3:   70.0   71.0   72.0   73.0   74.0
+ 3   / 4:   75.0   76.0   77.0   78.0   79.0
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 0   / 1:   20.0   21.0   22.0   23.0   24.0
+ 1   / 2:   25.0   26.0   27.0   28.0   29.0
+ 2   / 3:   30.0   31.0   32.0   33.0   34.0
+ 3   / 4:   35.0   36.0   37.0   38.0   39.0
+ ---- K:2 Z:   2
+ 0   / 1:   80.0   81.0   82.0   83.0   84.0
+ 1   / 2:   85.0   86.0   87.0   88.0   89.0
+ 2   / 3:   90.0   91.0   92.0   93.0   94.0
+ 3   / 4:   95.0   96.0   97.0   98.0   99.0
+ ---- L:3 T:   3
+ ---- K:1 Z:   1
+ 0   / 1:   40.0   41.0   42.0   43.0   44.0
+ 1   / 2:   45.0   46.0   47.0   48.0   49.0
+ 2   / 3:   50.0   51.0   52.0   53.0   54.0
+ 3   / 4:   55.0   56.0   57.0   58.0   59.0
+ ---- K:2 Z:   2
+ 0   / 1:  100.0  101.0  102.0  103.0  104.0
+ 1   / 2:  105.0  106.0  107.0  108.0  109.0
+ 2   / 3:  110.0  111.0  112.0  113.0  114.0
+ 3   / 4:  115.0  116.0  117.0  118.0  119.0
+ 
+can var /all
+set grid abstract
+can grid mygrd
+can axis taxs
+can axis zaxs
+can axis yaxs
+can axis xaxs
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bn_unique_str2int
+! bn_unique_str2int.jnl
+ 
+SHOW FUNC/DETAIL unique_str2int
+UNIQUE_STR2INT(A)
+    Returns an ID number for each unique stringin the input array of strings (case sensitive)
+        Axes of result:
+          X: inherited from argument(s)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    A: Array of Strings (STRING)
+        Influence on output axes:
+          X: passed to result grid
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+ 
+let alist = { \
+   "a rat in the house will eat the zucchini", \
+   "a rat in the house will eat the ice cream", \
+   "ze rats in the house will eat the ice cream",\
+   "A rat in the house will eat the ICE CREAM", \
+   "", \
+   "", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "ze rats in the house will eat the ice cream",\
+   "ze rats in the house will eat the ice cream",\
+   "" \
+}
+ 
+let blist = { \
+   "ze rats in the house will eat the ice cream",\
+   "", \
+   "Something new has been added", \
+   "A rat in the house will eat the ICE CREAM", \
+   "A rat in the house will eat the ICE CREAM", \
+   "" \
+}
+ 
+! check that it works when first called
+list unique_str2int(alist), alist
+             X: 0.5 to 11.5
+ Column  1: EX#1 is UNIQUE_STR2INT(ALIST)
+ Column  2: ALIST is {    "a rat in the house will eat the zucchini",    "a rat in the house will eat the ice cream",    "ze rats in the house will eat the ice cream",   "A rat in the house will eat th
+            EX#1                      ALIST
+1    /  1:  1.000 "a rat in the house will eat the zucchini"   
+2    /  2:  2.000 "a rat in the house will eat the ice cream"  
+3    /  3:  3.000 "ze rats in the house will eat the ice cream"
+4    /  4:  4.000 "A rat in the house will eat the ICE CREAM"  
+5    /  5:  5.000 ""                                           
+6    /  6:  5.000 ""                                           
+7    /  7:  4.000 "A rat in the house will eat the ICE CREAM"  
+8    /  8:  4.000 "A rat in the house will eat the ICE CREAM"  
+9    /  9:  3.000 "ze rats in the house will eat the ice cream"
+10   / 10:  3.000 "ze rats in the house will eat the ice cream"
+11   / 11:  5.000 ""                                           
+ 
+! check if the same values are returned for a second call matching strings
+list unique_str2int(blist), blist
+             X: 0.5 to 6.5
+ Column  1: EX#1 is UNIQUE_STR2INT(BLIST)
+ Column  2: BLIST is {    "ze rats in the house will eat the ice cream",   "",    "Something new has been added",    "A rat in the house will eat the ICE CREAM",    "A rat in the house will eat the ICE
+          EX#1                      BLIST
+1   / 1:  3.000 "ze rats in the house will eat the ice cream"
+2   / 2:  5.000 ""                                           
+3   / 3:  6.000 "Something new has been added"               
+4   / 4:  4.000 "A rat in the house will eat the ICE CREAM"  
+5   / 5:  4.000 "A rat in the house will eat the ICE CREAM"  
+6   / 6:  5.000 ""                                           
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_sort
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! ACM 8/99 sorti,sortj,sortl have "visual" versions
+ 
+sh func/ext sort*
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+    DAT: variable to sort in I
+SORTI_STR(STR)
+    Returns indices of string data, sorted on the I axis in increasing order, null strings at the end
+    STR: String variable to sort in I (STRING)
+SORTJ(DAT)
+    Returns indices of data, sorted on the J axis in increasing order
+    DAT: variable to sort in J
+SORTJ_STR(STR)
+    Returns indices of string data, sorted on the J axis in increasing order, null strings at the end
+    STR: String variable to sort in J (STRING)
+SORTK(DAT)
+    Returns indices of data, sorted on the K axis in increasing order
+    DAT: variable to sort in K
+SORTK_STR(STR)
+    Returns indices of string data, sorted on the K axis in increasing order, null strings at the end
+    STR: String variable to sort in K (STRING)
+SORTL(DAT)
+    Returns indices of data, sorted on the L axis in increasing order
+    DAT: variable to sort in L
+SORTL_STR(STR)
+    Returns indices of string data, sorted on the L axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTM(DAT)
+    Returns indices of data, sorted on the M axis in increasing order
+    DAT: variable to sort in M
+SORTM_STR(STR)
+    Returns indices of string data, sorted on the M axis in increasing order, null strings at the end
+    STR: String variable to sort in L (STRING)
+SORTN(DAT)
+    Returns indices of data, sorted on the N axis in increasing order
+    DAT: variable to sort in N
+SORTN_STR(STR)
+    Returns indices of string data, sorted on the N axis in increasing order, null strings at the end
+    STR: String variable to sort in N (STRING)
+sh func/ext sample*
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+    sample a field at a list of X indices
+    TO_BE_SAMPLED: data to sample at list of X indices supplied
+    X_INDICES: list of X indices at which to sample
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+    sample a field at a list of Y indices
+    TO_BE_SAMPLED: data to sample at list of Y indices supplied
+    Y_INDICES: list of Y indices at which to sample
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+    sample a field at a list of Z indices
+    TO_BE_SAMPLED: data to sample at list of Z indices supplied
+    Z_INDICES: list of Z indices at which to sample
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+    sample a field at a list of T indices
+    TO_BE_SAMPLED: data to sample at list of T indices supplied
+    T_INDICES: list of T indices at which to sample
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+    sample a field at a list of E indices
+    TO_BE_SAMPLED: data to sample at list of E indices supplied
+    E_INDICES: list of E indices at which to sample
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+    sample a field at a list of F indices
+    TO_BE_SAMPLED: data to sample at list of F indices supplied
+    F_INDICES: list of F indices at which to sample
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a subset of its grid points, defined by (XPTS, YPTS)
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X indices of grid points
+    YPTS: Y indices of grid points
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to I indices which may vary in JKL
+    I_INDICES: indices upon which to sample
+    DAT_TO_SAMPLE: data to sample using I indices
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to J indices which may vary in IKL
+    J_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using J indices
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to K indices which may vary in IJL
+    K_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using K indices
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+    Returns data sampled according to L indices which may vary in IJK
+    L_INDICES: ordered indices
+    DAT_TO_SAMPLE: data to sample using L indices
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+    Returns data sampled by interpolating to a set of times
+    DAT_TO_SAMPLE: data to sample at set of times
+    YR: Year(s) yyyy
+    MO: Month(s), integer mm
+    DAY: Day(s) of month dd
+    HR: Hour(s) hh
+    MIN: Minute(s) mm
+    SEC: Second(s) ss
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data sampled at a set of (X,Y) points, using unweighted averaging
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+    Returns data at a set of (X,Y) points, from nearest loc on XY curvilinear grid
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    DAT_LON: longitudes of input variable
+    DAT_LAT: latitudes of input variable
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+    Returns data sampled at a set of (X,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    ZPTS: Z values of sample points
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+    Returns data sampled at a set of (Y,Z) points, using linear interpolation
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    YPTS: Y values of sample points
+    ZPTS: Z values of sample points
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+    Returns data sampled at a set of (X,Y,T) points, using nearest grid intersection
+    DAT_TO_SAMPLE: variable (x,y,z,t,e,f) to sample
+    XPTS: X values of sample points
+    YPTS: Y values of sample points
+    TPTS: T values of sample points
+ 
+go bench_sorti.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEI
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141:151/y=39/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 15-FEB 16:29
+                39N   
+                65
+ 141E   / 61:   8.86
+ 143E   / 62:   8.52
+ 145E   / 63:   9.29
+ 147E   / 64:  10.25
+ 149E   / 65:  10.98
+ 151E   / 66:  10.88
+ 
+let tsorted_indices = sorti( sst[i=61:66,y=39,z=0,l=2])
+let tsorted_sst = samplei(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             X: 0.5 to 6.5
+             TIME: 15-FEB 16:29
+ Column  1: TSORTED_INDICES[Y=39N] is SORTI( SST[I=61:66,Y=39,Z=0,L=2])
+ Column  2: TSORTED_SST[Y=39N] is SAMPLEI(SST, TSORTED_INDICES)
+       TSORTED_  TSORTED_SST
+1   / 1:   62.00    8.52
+2   / 2:   61.00    8.86
+3   / 3:   63.00    9.29
+4   / 4:   64.00   10.25
+5   / 5:   66.00   10.88
+6   / 6:   65.00   10.98
+ 
+ 
+! test on 2-d data
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let xsorted_indices = sorti(sst)
+let xsorted_sst = samplei(sst, xsorted_indices[y=0,l=5])
+! shade xsorted_sst
+list/y=0/i=1:15 xsorted_sst
+             VARIABLE : SAMPLEI(SST, XSORTED_INDICES[Y=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (X)
+             LATITUDE : 1S
+             TIME     : 15-JAN 11:49
+              1S    
+              45
+ 1    /  1:  23.76
+ 2    /  2:  23.86
+ 3    /  3:  23.89
+ 4    /  4:  23.95
+ 5    /  5:  23.96
+ 6    /  6:  24.02
+ 7    /  7:  24.05
+ 8    /  8:  24.09
+ 9    /  9:  24.21
+ 10   / 10:  24.28
+ 11   / 11:  24.31
+ 12   / 12:  24.36
+ 13   / 13:  24.39
+ 14   / 14:  24.46
+ 15   / 15:  24.47
+ 
+set region/l=5/y=1
+let len = xsorted_sst[i=@ngd]
+list len
+             VARIABLE : XSORTED_SST[I=@NGD]
+             FILENAME : coads_climatology.cdf
+             X        : 0.5 to 180.5
+             LATITUDE : 1N
+             TIME     : 15-JAN 11:49
+          147.0
+ 
+go bench_sortj.jnl
+ 
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEJ
+!                see notes in Bugzilla under bug 1187.
+ 
+can region
+use coads_climatology
+set region/x=141/y=39:49/z=0/l=2
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 141E
+             TIME     : 15-FEB 16:29
+              141E   
+               61
+ 49N   / 70:  1.883
+ 47N   / 69:  2.014
+ 45N   / 68:  3.445
+ 43N   / 67:  4.559
+ 41N   / 66:  6.473
+ 39N   / 65:  8.857
+ 
+let tsorted_indices = sortj( sst[j=65:70,x=141,z=0,l=2])
+let tsorted_sst = samplej(sst, tsorted_indices)
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             Y: 0.5 to 6.5
+             TIME: 15-FEB 16:29
+ Column  1: TSORTED_INDICES[X=141E] is SORTJ( SST[J=65:70,X=141,Z=0,L=2])
+ Column  2: TSORTED_SST[X=141E] is SAMPLEJ(SST, TSORTED_INDICES)
+       TSORTED_  TSORTED_SST
+1   / 1:   70.00   1.883
+2   / 2:   69.00   2.014
+3   / 3:   68.00   3.445
+4   / 4:   67.00   4.559
+5   / 5:   66.00   6.473
+6   / 6:   65.00   8.857
+ 
+! test on 2-D data.
+ 
+can region
+!set data coads_climatology
+set region/l=5
+ 
+let ysorted_indices = sortj(sst)
+let ysorted_sst = samplej(sst, ysorted_indices[i=0,l=5])
+!shade ysorted_sst
+list/i=0/j=1:15 ysorted_sst
+             VARIABLE : SAMPLEJ(SST, YSORTED_INDICES[I=0,L=5])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (Y)
+             LONGITUDE: 19E
+             TIME     : 15-JAN 11:49
+              19E   
+               0
+ 1    /  1: -0.125
+ 2    /  2:  0.054
+ 3    /  3:  0.186
+ 4    /  4:  0.300
+ 5    /  5:  0.439
+ 6    /  6:  0.625
+ 7    /  7:  0.660
+ 8    /  8:  0.727
+ 9    /  9:  0.800
+ 10   / 10:  1.297
+ 11   / 11:  1.588
+ 12   / 12:  1.607
+ 13   / 13:  1.917
+ 14   / 14:  2.059
+ 15   / 15:  2.694
+ 
+set region/l=5/x=181
+let len = ysorted_sst[j=@ngd]
+list len
+             VARIABLE : YSORTED_SST[J=@NGD]
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             Y        : 0.5 to 90.5
+             TIME     : 15-JAN 11:49
+          32.00
+ 
+ 
+go bench_sortk.jnl
+! Benchmark for sort and sample external Functions
+! ACM 7/99
+! Changes with v5.81 and after, specifying context for arg 2 of SAMPLEK
+!   see notes in Bugzilla under bug 1187.
+ 
+! test sortk, samplek
+ 
+can region
+use gt4d011
+set region/i=99/j=40/l=1
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=99,j=40,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=99,J=40,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 131.5W
+             LATITUDE : 1.8S
+             TIME     : 17-AUG-1982 12:00
+             131.5W 
+              99
+ 1    /  1:  24.66
+ 2    /  2:  25.26
+ 3    /  3:  25.70
+ 4    /  4:  26.06
+ 5    /  5:  26.13
+ 6    /  6:  26.13
+ 7    /  7:  26.14
+ 8    /  8:  26.16
+ 9    /  9:  26.22
+ 10   / 10:  26.31
+ 
+ 
+can region
+use ocean_atlas_temp
+ 
+set region/i=70/j=90/l=1
+list temp
+             VARIABLE : Temperature (Deg C)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+          28.86
+ 
+let zsorted_indices = sortk(temp)
+let zsorted_temp = samplek(temp, zsorted_indices[i=70,j=90,l=1])
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES[I=70,J=90,L=1])
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+          28.86
+ 
+! this should bail out with indices out of range:
+ 
+let zsorted_indices = sortk(temp[i=70,j=90,l=1]) - 100
+let zsorted_temp = samplek(temp, zsorted_indices)
+list zsorted_temp
+             VARIABLE : SAMPLEK(TEMP, ZSORTED_INDICES)
+             FILENAME : ocean_atlas_temp.cdf
+             LONGITUDE: 89.5E
+             LATITUDE : 0.5S
+             Z        : 1
+             TIME     : 16-JAN 06:00
+        ....
+ 
+ 
+go bench_sortl.jnl
+ 
+ 
+! Benchmark for sort and sample external Functions
+! ACM 5/99
+! *sh* 3/00 - indicate that test of illegal indices should produce an error
+ 
+! V550 *sh* 11/02 - documentation change only, reflecting subspan modulo
+! The use of L=5 on a 3 point time axis triggers a valid subspan modulo calculation
+! V581 *ACM 3/05 Changes in specifying context for arg 2 of SAMPLEL
+!                see notes in Bugzilla under bug 1187.
+ 
+use coads_climatology
+set region/x=141/y=39/z=0/l=1:6
+ 
+list sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+                   141E   
+                    61
+ 16-JAN      / 1:  11.03
+ 15-FEB      / 2:   8.86
+ 17-MAR      / 3:   8.39
+ 16-AUG      / 4:   ....
+ 15-JAN      / 5:  11.03
+ 14-FEB      / 6:   8.86
+list samplel(sst, {1,3,5})
+             VARIABLE : SAMPLEL(SST, {1,3,5})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 141E
+             LATITUDE : 39N
+           141E   
+            61
+ 1   / 1:  11.03
+ 2   / 2:   8.39
+ 3   / 3:  11.03
+ 
+let tsorted_indices = sortl(sst)
+let tsorted_sst = samplel(sst, tsorted_indices[x=141,y=39,z=0])
+ 
+list tsorted_indices, tsorted_sst
+             DATA SET: ./coads_climatology.cdf
+             T: 0.5 to 3.5
+             LONGITUDE: 141E
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(SST)
+ Column  2: TSORTED_SST is SAMPLEL(SST, TSORTED_INDICES[X=141,Y=39,Z=0])
+       TSORTED_  TSORTED_SST
+1   / 1:   3.000    8.39
+2   / 2:   2.000    8.86
+3   / 3:   1.000   11.03
+ 
+! test sortt with data containing bad/missing data.
+ 
+can region
+ 
+use  coads_vwnd.cdf
+set region/i=90/j=65
+list vwnd
+             VARIABLE : MERIDIONAL WIND (M/S)
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 60 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                        90
+ 16-JAN-1946 12 /  1:   ....
+ 15-FEB-1946 00 /  2:   ....
+ 16-MAR-1946 12 /  3:   ....
+ 16-APR-1946 00 /  4:   ....
+ 16-MAY-1946 12 /  5:   ....
+ 16-JUN-1946 00 /  6:   ....
+ 16-JUL-1946 12 /  7:   ....
+ 16-AUG-1946 12 /  8:   ....
+ 16-SEP-1946 00 /  9:   ....
+ 16-OCT-1946 12 / 10:   ....
+ 16-NOV-1946 00 / 11:   ....
+ 16-DEC-1946 12 / 12:  12.35
+ 16-JAN-1947 12 / 13:   ....
+ 15-FEB-1947 00 / 14:   ....
+ 16-MAR-1947 12 / 15:   ....
+ 16-APR-1947 00 / 16:   0.00
+ 16-MAY-1947 12 / 17:   ....
+ 16-JUN-1947 00 / 18:   ....
+ 16-JUL-1947 12 / 19:   ....
+ 16-AUG-1947 12 / 20:   ....
+ 16-SEP-1947 00 / 21:   6.60
+ 16-OCT-1947 12 / 22:   ....
+ 16-NOV-1947 00 / 23:   ....
+ 16-DEC-1947 12 / 24:   ....
+ 16-JAN-1948 12 / 25:   4.50
+ 15-FEB-1948 12 / 26:   ....
+ 16-MAR-1948 12 / 27:   ....
+ 16-APR-1948 00 / 28:   ....
+ 16-MAY-1948 12 / 29:   ....
+ 16-JUN-1948 00 / 30:   4.70
+ 16-JUL-1948 12 / 31:   ....
+ 16-AUG-1948 12 / 32:   ....
+ 16-SEP-1948 00 / 33:  -5.80
+ 16-OCT-1948 12 / 34:   0.45
+ 16-NOV-1948 00 / 35:   ....
+ 16-DEC-1948 12 / 36:   ....
+ 16-JAN-1949 12 / 37:   4.23
+ 15-FEB-1949 00 / 38:  -1.08
+ 16-MAR-1949 12 / 39:   2.07
+ 16-APR-1949 00 / 40:   0.83
+ 16-MAY-1949 12 / 41:   0.00
+ 16-JUN-1949 00 / 42:   5.37
+ 16-JUL-1949 12 / 43:  -1.30
+ 16-AUG-1949 12 / 44:   1.38
+ 16-SEP-1949 00 / 45:   5.92
+ 16-OCT-1949 12 / 46:   0.71
+ 16-NOV-1949 00 / 47:  -0.94
+ 16-DEC-1949 12 / 48:  -0.52
+ 16-JAN-1950 12 / 49:   1.58
+ 15-FEB-1950 00 / 50:   4.93
+ 16-MAR-1950 12 / 51:   3.51
+ 16-APR-1950 00 / 52:   4.54
+ 16-MAY-1950 12 / 53:   1.60
+ 16-JUN-1950 00 / 54:   1.33
+ 16-JUL-1950 12 / 55:   0.90
+ 16-AUG-1950 12 / 56:  -0.45
+ 16-SEP-1950 00 / 57:   3.57
+ 16-OCT-1950 12 / 58:  -8.75
+ 16-NOV-1950 00 / 59:  -5.24
+ 16-DEC-1950 12 / 60:  -6.47
+ 
+let tsorted_indices = sortl(vwnd)
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+             DATA SET: ./coads_vwnd.cdf
+             T: 0.5 to 60.5
+             LONGITUDE: 161W
+             LATITUDE: 39N
+ Column  1: TSORTED_INDICES is SORTL(VWND)
+ Column  2: TSORTED_WND is SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+       TSORTED_IN  TSORTED_WND
+1    /  1:   58.00   -8.75
+2    /  2:   60.00   -6.47
+3    /  3:   33.00   -5.80
+4    /  4:   59.00   -5.24
+5    /  5:   43.00   -1.30
+6    /  6:   38.00   -1.08
+7    /  7:   47.00   -0.94
+8    /  8:   48.00   -0.52
+9    /  9:   56.00   -0.45
+10   / 10:   41.00    0.00
+11   / 11:   16.00    0.00
+12   / 12:   34.00    0.45
+13   / 13:   46.00    0.71
+14   / 14:   40.00    0.83
+15   / 15:   55.00    0.90
+16   / 16:   54.00    1.33
+17   / 17:   44.00    1.38
+18   / 18:   49.00    1.58
+19   / 19:   53.00    1.60
+20   / 20:   39.00    2.07
+21   / 21:   51.00    3.51
+22   / 22:   57.00    3.57
+23   / 23:   37.00    4.23
+24   / 24:   25.00    4.50
+25   / 25:   52.00    4.54
+26   / 26:   30.00    4.70
+27   / 27:   50.00    4.93
+28   / 28:   42.00    5.37
+29   / 29:   45.00    5.92
+30   / 30:   21.00    6.60
+31   / 31:   12.00   12.35
+32   / 32:    ....    ....
+33   / 33:    ....    ....
+34   / 34:    ....    ....
+35   / 35:    ....    ....
+36   / 36:    ....    ....
+37   / 37:    ....    ....
+38   / 38:    ....    ....
+39   / 39:    ....    ....
+40   / 40:    ....    ....
+41   / 41:    ....    ....
+42   / 42:    ....    ....
+43   / 43:    ....    ....
+44   / 44:    ....    ....
+45   / 45:    ....    ....
+46   / 46:    ....    ....
+47   / 47:    ....    ....
+48   / 48:    ....    ....
+49   / 49:    ....    ....
+50   / 50:    ....    ....
+51   / 51:    ....    ....
+52   / 52:    ....    ....
+53   / 53:    ....    ....
+54   / 54:    ....    ....
+55   / 55:    ....    ....
+56   / 56:    ....    ....
+57   / 57:    ....    ....
+58   / 58:    ....    ....
+59   / 59:    ....    ....
+60   / 60:    ....    ....
+ 
+let len = tsorted_wnd[l=@ngd]
+list len
+             VARIABLE : TSORTED_WND[L=@NGD]
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 0.5 to 60.5
+          31.00
+ 
+! deliberately sample at invalid points
+! Note: in MOST circumstances this would simply result in a result of
+! missing values, however, the underlying data set has an "enhanced heading"
+! so that these indices appear to be valid
+SET MODE ignore_error
+let tsorted_indices = sortl(vwnd) + 90
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+list tsorted_indices, tsorted_wnd
+SET MODE/LAST ignore_error
+ 
+! deliberately sample at invalid points that are outside of the axis range
+let tsorted_indices = sortl(vwnd) + 999
+let tsorted_wnd = samplel(vwnd, tsorted_indices[i=90,j=65])
+stat tsorted_wnd
+ 
+             SAMPLEL(VWND, TSORTED_INDICES[I=90,J=65])
+             LONGITUDE: 161W
+             LATITUDE: 39N
+             Z:  N/A
+             T: 0.5 to 60.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_vwnd.cdf
+ 
+ Total # of data points: 60 (1*1*1*60*1*1)
+ # flagged as bad  data: 60
+ 
+ 
+go bench_samplexy.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (debug)
+ ! Version 5.00 - 04/12/99
+ ! 13-Apr-99 14:36
+ 
+use coads_climatology
+ 
+let asst = samplexy(sst, {171,173,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  27.90  26.71
+ 15-FEB      / 2:  28.55  28.25  26.37
+ 17-MAR      / 3:  28.88  28.48  26.32
+ 
+let asst = samplexy(sst, {171,172,305}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,172,305}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  28.27  26.71
+ 15-FEB      / 2:  28.55  28.49  26.37
+ 17-MAR      / 3:  28.88  28.61  26.32
+ 
+go bench_samplet_date.jnl
+!
+!  Data coads_vwnd in ~kobrien/FERRET/benc
+!
+use coads_vwnd
+set region/x=161w/y=39n
+ 
+let my_vwnd = samplet_date(vwnd,1950,2,0,0,0,0)
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,1950,2,0,0,0,0)
+             FILENAME : coads_vwnd.cdf
+             LONGITUDE: 161W
+             LATITUDE : 39N
+             T        : 1
+          3.227
+ 
+ 
+let my_vwnd = samplet_date(vwnd,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+list my_vwnd
+             VARIABLE : SAMPLET_DATE(VWND,{1950,1950},{5,8},{16,15},{12,12},{0,0},{0,0})
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 2 points (T)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+           161W   
+            90
+ 1   / 1:  1.600
+ 2   / 2: -0.406
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_eof
+! Benchmark for EOF functions
+! Statically linked as of ferret V5.34
+! Ansley Manke  8/2/2001
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Test the bail-out from eof_space, eof_stat, eof_tfunc
+set mode ignore
+ 
+USE coads_climatology
+LET eofxyfcn = eof_space(sst[X=27w:23w,Y=1S:3N], 1.)
+list/l=1:2 eofxyfcn
+ 
+LET eofstat = eof_stat(sst[X=27w:23w,Y=1S:3N], 1.)
+list/i=1:3/j=1:3 eofstat
+ 
+LET eoftime = eof_tfunc(SST[X=27W:23W,Y=1S:3N], 1.)
+list/i=1:2 eoftime
+ 
+set mode/last ignore
+ 
+! Test functions eofsvd*
+ 
+USE coads_climatology
+LET eofxyfcn = eofsvd_space(sst[X=27w:23w,Y=1S:3N])
+list/l=1:2 eofxyfcn
+             VARIABLE : EOFSVD_SPACE(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 by 2 points (LONGITUDE-LATITUDE-T)
+              27W     25W     23W    
+              157     158     159
+ ---- L:1 T:   1
+ 3N   / 47: -0.1753 -0.1784 -0.3092
+ 1N   / 46: -0.3086 -0.2809 -0.2910
+ 1S   / 45: -0.2715 -0.4976 -0.5956
+ ---- L:2 T:   2
+ 3N   / 47: -0.0525 -0.0028 -0.1241
+ 1N   / 46:  0.0646  0.0572 -0.0695
+ 1S   / 45:  0.1213  0.0397 -0.0342
+ 
+LET eofstat = eofsvd_stat(sst[X=27w:23w,Y=1S:3N])
+list/i=1:3/j=1:3 eofstat
+             VARIABLE : EOFSVD_STAT(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   9.00   9.00   9.00
+ 2   / 2:  95.80   4.20   0.00
+ 3   / 3:   1.09   0.05   0.00
+ 
+LET eoftime = eofsvd_tfunc(SST[X=27W:23W,Y=1S:3N])
+list/i=1:2 eoftime
+             VARIABLE : EOFSVD_TFUNC(SST[X=27W:23W,Y=1S:3N])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  1.178 -0.782
+ 15-FEB      / 2:  0.088  1.411
+ 17-MAR      / 3: -1.266 -0.630
+ 
+ 
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress_by
+let mask = {1,,1,,1} + 0*L[l=101:102] + 0*K[k=10:11]
+list compressi_by({10,20,30,40,50},mask)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK)
+             SUBSET   : 5 by 2 by 2 points (X-Z-T)
+               1      2      3      4      5    
+               1      2      3      4      5
+ ---- L:101 T:   101
+ 10   / 10:  10.00  30.00  50.00   ....   ....
+ 11   / 11:  10.00  30.00  50.00   ....   ....
+ ---- L:102 T:   102
+ 10   / 10:  10.00  30.00  50.00   ....   ....
+ 11   / 11:  10.00  30.00  50.00   ....   ....
+let mask2 = IF J[j=201:202] eq 201 then mask else 1/(MISSING(mask,4)-1)
+list compressi_by({10,20,30,40,50},mask2)
+             VARIABLE : COMPRESSI_BY({10,20,30,40,50},MASK2)
+             SUBSET   : 5 by 2 by 2 by 2 points (X-Y-Z-T)
+                 1      2      3      4      5    
+                 1      2      3      4      5
+ ---- L:101 T:   101
+ ---- K:10 Z:   10
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- L:102 T:   102
+ ---- K:10 Z:   10
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ ---- K:11 Z:   11
+ 201   / 201:  10.00  30.00  50.00   ....   ....
+ 202   / 202:  20.00  40.00   ....   ....   ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+go bench_compress
+ ! NOAA/PMEL TMAP
+ ! Program FERRET
+ ! Version 5.21 - 06/15/00
+ ! 10-Jul-00 10:39
+ 
+! V550 *sh* 11/02 - documentation change only reflecting subspan modulo
+ 
+use coads_climatology
+! Note that L=5 lies outside the time axis range of 3 points
+! As of V550 this triggers a subspan modulo calculation (correctly)
+list sst[l=5,j=66,i=125:131]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (LONGITUDE)
+             LATITUDE : 41N
+             TIME     : 15-JAN 11:49
+               41N 
+               66
+ 91W   / 125:....
+ 89W   / 126:....
+ 87W   / 127:....
+ 85W   / 128:....
+ 83W   / 129:....
+ 81W   / 130:....
+ 79W   / 131:....
+list compressi(sst[l=5,j=66,i=125:131])
+             VARIABLE : COMPRESSI(SST[L=5,J=66,I=125:131])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 7 points (X)
+             LATITUDE : 41N
+             TIME     : 15-JAN 11:49
+           41N 
+           66
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 4   / 4:....
+ 5   / 5:....
+ 6   / 6:....
+ 7   / 7:....
+ 
+list sst[l=5,j=63:73,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (LATITUDE)
+             LONGITUDE: 91W
+             TIME     : 15-JAN 11:49
+               91W   
+              125
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   2.70
+ 45N   / 68:  13.35
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+list compressj(sst[l=5,j=63:73,i=125])
+             VARIABLE : COMPRESSJ(SST[L=5,J=63:73,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 11 points (Y)
+             LONGITUDE: 91W
+             TIME     : 15-JAN 11:49
+              91W   
+             125
+ 1    /  1:  13.35
+ 2    /  2:   2.70
+ 3    /  3:   ....
+ 4    /  4:   ....
+ 5    /  5:   ....
+ 6    /  6:   ....
+ 7    /  7:   ....
+ 8    /  8:   ....
+ 9    /  9:   ....
+ 10   / 10:   ....
+ 11   / 11:   ....
+ 
+list sst[j=67,i=125]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+                   91W 
+                  125
+ 16-JAN      / 1:....
+ 15-FEB      / 2:....
+ 17-MAR      / 3:....
+list compressl(sst[j=67,i=125])
+             VARIABLE : COMPRESSL(SST[J=67,I=125])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (T)
+             LONGITUDE: 91W
+             LATITUDE : 43N
+           91W 
+          125
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+ 
+use gt4d011	! as in bench_sortk
+let a = if temp le 27 then temp
+list a[i=91,j=35,l=1]
+             VARIABLE : IF TEMP LE 27 THEN TEMP
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : 17-AUG-1982 12:00
+              139.5W 
+               91
+ 5     /  1:   ....
+ 15    /  2:   ....
+ 25    /  3:   ....
+ 35    /  4:   ....
+ 45    /  5:   ....
+ 55    /  6:   ....
+ 65    /  7:  26.40
+ 75    /  8:  26.02
+ 85    /  9:  25.67
+ 95    / 10:  25.32
+list compressk(a[i=91,j=35,l=1])
+             VARIABLE : COMPRESSK(A[I=91,J=35,L=1])
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (Z)
+             LONGITUDE: 139.5W
+             LATITUDE : 3.5S
+             TIME     : 17-AUG-1982 12:00
+             139.5W 
+              91
+ 1    /  1:  26.40
+ 2    /  2:  26.02
+ 3    /  3:  25.67
+ 4    /  4:  25.32
+ 5    /  5:   ....
+ 6    /  6:   ....
+ 7    /  7:   ....
+ 8    /  8:   ....
+ 9    /  9:   ....
+ 10   / 10:   ....
+ 
+GO bn_reset
+cancel mode verify
+GO bench_internal_string_functions
+! test internal string functions:
+!       strlen
+!	upcase
+!	dncase
+!	strindex
+!	strrindex
+!	substring
+!	strcat
+!	float  - return float value from string
+!
+!	*kob*  6/02   Ferret v5.41
+ 
+ 
+! STRLEN
+! Result should be 35
+list strlen("This string should be 35 characters")
+             VARIABLE : STRLEN("This string should be 35 characters")
+          35.00
+! Result should be 0
+list strlen("")
+             VARIABLE : STRLEN("")
+          0.0000
+ 
+ 
+! UPCASE
+! Result should be in all caps
+list upcase ("this String sHould be iN aLl Caps")
+             VARIABLE : UPCASE ("this String sHould be iN aLl Caps")
+        "THIS STRING SHOULD BE IN ALL CAPS"
+ 
+! DNCASE
+! Result should be all lower case
+list dncase ("this String sHould be iN loWer caSE")
+             VARIABLE : DNCASE ("this String sHould be iN loWer caSE")
+        "this string should be in lower case"
+ 
+! STRINDEX
+! Find first occurence string "fun" in longer string
+! Result should be 11
+list strindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          11.00
+ 
+! STRRINDEX
+! Find last occurence string "fun" in longer string
+! Result should be 55
+list strrindex("Ferret is fun for the whole family - real fun, family fun", "fun");
+             VARIABLE : STRRINDEX("Ferret is fun for the whole family - real fun, family fun", "fun")
+          55.00
+ 
+! SUBSTRING
+! Clip a substring from a string - result should be "ferret"
+list substring("Have you fed your ferret today", 19, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 6)
+        "ferret"
+! Ask for offset greater than string lenght - result should be ""
+list substring("Have you fed your ferret today", 50, 6)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 50, 6)
+        ""
+! Ask for more chars than in string - result should be "ferret today"
+list substring("Have you fed your ferret today", 19, 60)
+             VARIABLE : SUBSTRING("Have you fed your ferret today", 19, 60)
+        "ferret today"
+ 
+ 
+! STRCAT
+! concatenate two strings
+list strcat ("All work and no play", " makes Ferret a dull boy")
+             VARIABLE : STRCAT ("All work and no play", " makes Ferret a dull boy")
+        "All work and no play makes Ferret a dull boy"
+ 
+ 
+! FLOAT
+! return float value - result should be 7.85
+! list (strfloat("3.14")*10)/4  ! crashes on linux rh5 gfortran...
+list .25*strfloat("3.14")
+             VARIABLE : .25*STRFLOAT("3.14")
+          0.7850
+ 
+ 
+! the below are deliberate errors for incorrect argument detection
+set mode ignore
+list strindex("Ferret is fun for the whole family - real family fun");
+list strrindex("Ferret is fun for the whole family - real family fun");
+list substring("Have you fed your ferret today", 19)
+list substring("Have you fed your ferret today")
+list strcat ("All work and no play")
+ 
+set mode/last ignore
+ 
+! 4/2006 these functions now are also internally linked
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_bench_extrema.jnl
+! bench_extrema.jnl
+!  benchmark tests for findhi and findlo
+!  external functions; installed as .so files
+!  Ferret version 5.4
+ 
+! ACM 28-Jan-02
+ 
+use coads_climatology
+set region/l=1/x=100:360/y=-20:60
+ 
+list/x=1:10 findhi(sst,4,4)
+             VARIABLE : FINDHI(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : 16-JAN 06:00
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:  335.0  359.0  269.0   57.0  195.0   73.0  101.0  209.0   87.0  167.0
+ 2   / 2:  -69.0  -63.0  -25.0  -13.0  -13.0  -11.0  -11.0  -11.0   -9.0   -9.0
+ 3   / 3:    0.3    0.9   23.3   28.4   29.7   28.5   28.3   28.9   28.4   29.8
+list/x=1:10 findlo(sst,4,4)
+             VARIABLE : FINDLO(SST,4,4)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 by 3 points (X-Y)
+             TIME     : 16-JAN 06:00
+             1      2      3      4      5      6      7      8      9     10    
+             1      2      3      4      5      6      7      8      9     10
+ 1   / 1:  331.0  365.0  147.0   79.0  119.0   65.0   83.0  125.0  157.0  237.0
+ 2   / 2:  -65.0  -61.0  -59.0  -53.0   -9.0   -7.0   -7.0   -7.0   -3.0   -1.0
+ 3   / 3:   -0.8   -0.1    0.4    1.6   28.3   27.6   27.8   28.4   28.7   23.9
+ 
+let a = findlo(sst,4,4)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,4,4) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16200.5 (number of valid)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  13.00
+ 2   / 2:  13.00
+ 3   / 3:  13.00
+ 
+let a = findlo(sst,2,2)
+list a[i=@ngd]
+             VARIABLE : FINDLO(SST,2,2) (# of points)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (Y)
+             X        : 0.5 to 16200.5 (number of valid)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  113.0
+ 2   / 2:  113.0
+ 3   / 3:  113.0
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_err541_date_delim.jnl
+! err541_date_delim.jnl
+! Fix errors occurring with delimted reads - four digit years were
+!   being accuratly calculated.
+!
+! *kob* 11/02
+ 
+set data/var="date1"/type="date,date"/form=delim dates_bug.dat
+! first date is 12-27-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : dates_bug.dat
+             SUBSET   : 6 by 6 points (X-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ 1   / 1:   ....  1999.  2001.  2001.  2003.   999.
+ 2   / 2:   ....     7.     7.     7.     7.     8.
+ 3   / 3:   ....    28.    29.    30.    31.     1.
+ 4   / 4:   ....     0.     0.     0.     0.     0.
+ 5   / 5:   ....     0.     0.     0.     0.     0.
+ 6   / 6:   ....     0.     0.     0.     0.     0.
+ 
+ 
+! now test accuracy of dates
+DEFINE AXIS/T0=1-jan-1900/T=1-jan-1900:1-jan-2005:1/units=days ttt
+ 
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-1999"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="29-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=5] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+ 
+! now test eurodate format
+can data/all
+set data/var="date1"/type="eurodate,eurodate"/form=delim euro_dates_bug.dat
+! first date is 27-07-1999 which is unacceptable so should be missing values
+list days1900toymdhms(date1)
+             VARIABLE : DAYS1900TOYMDHMS(DATE1)
+             FILENAME : euro_dates_bug.dat
+             SUBSET   : 5 by 6 points (X-Z)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  2001.  2001.  2003.   999.
+ 2   / 2:   ....     7.     7.     7.     8.
+ 3   / 3:   ....    28.    30.    31.     1.
+ 4   / 4:   ....     0.     0.     0.     0.
+ 5   / 5:   ....     0.     0.     0.     0.
+ 6   / 6:   ....     0.     0.     0.     0.
+ 
+!test accuracy of eurodates
+let date_check = date1[i=2] - T[gt=ttt,t="28-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=3] - T[gt=ttt,t="30-jul-2001"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+let date_check = date1[i=4] - T[gt=ttt,t="31-jul-2003"]
+if `date_check` then say **** DELIMTED READ DATE CHECK FAILED
+ !-> if 0 then say **** DELIMTED READ DATE CHECK FAILED
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_zaxr_fcns.jnl
+! bn_ef_zaxr_functions.jnl
+! 04-apr-05 *acm* move to tests of shared-obj efs.
+!
+! bn_zaxr_functions.jnl
+! Compare the various zaxreplace functions
+ 
+ 
+! Define some original source data:
+ 
+let ddat = zsequence({1126,1136,1146,1156,1166})
+let cycle = zsequence({346, 347, 349, 350, 351})
+ 
+! Put that data on the following original source grid:
+ 
+Define axis/z=10:50:10 zaxis_orig
+ 
+let cycle_orig = cycle[gz=zaxis_orig at asn]
+let ddat_orig = ddat[gz=zaxis_orig at asn]
+ 
+! Define a destination axis
+ 
+define axis/z=345:353:1 zaxis_des
+let dummy = z[GZ=zaxis_des]
+ 
+let ddat_a = zaxreplace(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_b = zaxreplace_avg(ddat_orig, cycle_orig, dummy)
+ 
+let ddat_c = zaxreplace_bin(ddat_orig, cycle_orig, dummy)
+ 
+! Compare result of zaxreplace, zaxreplace_avg, zaxreplace_bin
+list ddat_a, ddat_b, ddat_c
+             Z: 344.5 to 353.5
+ Column  1: DDAT_A is ZAXREPLACE(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  2: DDAT_B is ZAXREPLACE_AVG(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+ Column  3: DDAT_C is ZAXREPLACE_BIN(DDAT_ORIG, CYCLE_ORIG, DUMMY)
+          DDAT_A  DDAT_B DDAT_C
+345   / 1:   ....   ....   ....
+346   / 2:   ....  1126.  1126.
+347   / 3:  1136.  1136.  1136.
+348   / 4:  1141.  1141.   ....
+349   / 5:  1146.  1146.  1146.
+350   / 6:  1156.  1156.  1156.
+351   / 7:  1166.  1166.  1166.
+352   / 8:   ....   ....   ....
+353   / 9:   ....   ....   ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_curv_to_rect.jnl
+! bn_ef_curv_to_rect.jnl
+! Test of curvilinear to rectilinear regridding
+! Uses shared-object external functions
+! ACM 5/4/05
+ 
+show func curv*
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+    find i,j bounds for subset of a variable in curvilinear coordinates
+    LONGITUDES: 2-D longitudes of curvilinear grid
+    LATITUDES: 2-D latitudes of curvilinear grid
+    xrange_lo: Minimum of longitude range
+    xrange_hi: Maximum of longitude range
+    yrange_lo: Minimum of latitude range
+    yrange_hi: Maximum of latitude range
+    modulo flag for X coordinates: 1= X modulo; 0= X not modulo
+CURV_TO_RECT(V,mapping)
+    Apply mapping to regrid from curvilinear to rectangular grid
+    V: Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)
+    mapping: mapping computed by curv_to_rect_MAP
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+    Compute mapping for regridding: curvilinear to rectangular grid.
+    lon_in: Source grid longitudes (2-D) (degrees)
+    lat_in: Source grid latitudes (2-D) (degrees)
+    grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees)
+    radius: Source points falling within radius are included in mapping to destination point (degrees)
+CURV2RECT(CurvData,CurvCenterLons,CurvCenterLats,CurvCornerLons,CurvCornerLats,TemplateRectVar,Method)
+    Regrids data from curvilinear lon,lat center and/or corner grid to rectilinear using ESMP/ESMF
+    CurvData: Curvilinear X,Y data positioned at centers
+    CurvCenterLons: Curvilinear center longitudes on an X,Y grid
+    CurvCenterLats: Curvilinear center latitudes on an X,Y grid
+    CurvCornerLons: Curvilinear corner longitudes on an X,Y (maybe Z) grid
+    CurvCornerLats: Curvilinear corner latitudes on an X,Y (maybe Z) grid
+    TemplateRectVar: Template variable on the desired rectilinear grid
+    Method: Regrid method: BILINEAR, PATCH, CONSERVE (STRING)
+CURV3SRECT(CurvData,CurvLons,CurvLats,CurvBaths,CurvZetas,TemplateRectVar,Method)
+    Regrids data from curvilinear lon, lat, sigma, bathymetry, zeta (centers) grid to rectilinear lon, lat, depth using ESMP/ESMF
+    CurvData: Curvilinear X,Y,Z,[T,E,F] data where Z is sigma values
+    CurvLons: Longitudes of curvilinear data on an X,Y grid
+    CurvLats: Latitudes of curvilinear data on an X,Y grid
+    CurvBaths: Bathymetry (as depths) of curvilinear data on an X,Y grid
+    CurvZetas: Water surface elevations of curvilinear data on an X,Y,[T] grid (optional)
+    TemplateRectVar: Template variable on the desired rectilinear X,Y,Z,[T,E,F] grid where Z is depths
+    Method: Regrid method: BILINEAR, PATCH (STRING)
+ 
+use tripolar_subset.nc
+shade ht, geolon_vert_t, geolat_vert_t
+ 
+! Define output grid
+ 
+def axis/x=-300:100:10 xout
+def axis/y=60:90:3 yout
+let a = x[gx=xout] + y[gy=yout]
+ 
+! Define mapping
+let my_map = curv_to_rect_map (geolon_vert_t, geolat_vert_t, a, 10)
+ 
+! apply mapping
+let mapped = curv_to_rect (ht, my_map)
+shade mapped
+stat mapped
+ 
+             CURV_TO_RECT (HT, MY_MAP)
+             X: -305 to 105
+             Y: 58.5 to 91.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_subset.nc
+ 
+ Total # of data points: 451 (41*11*1*1*1*1)
+ # flagged as bad  data: 79
+ Minimum value: 0
+ Maximum value: 4298.8
+ Mean    value: 963.12 (unweighted average)
+ Standard deviation: 1380.9
+ 
+ 
+! tax_ functions
+use gt4d011
+ 
+list/L=15:20 tax_datestring(t[gt=temp],temp,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"hour")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982 16"
+ 16-NOV-1982 18 / 16:"16-NOV-1982 18"
+ 22-NOV-1982 20 / 17:"22-NOV-1982 20"
+ 28-NOV-1982 22 / 18:"28-NOV-1982 22"
+ 05-DEC-1982 00 / 19:"05-DEC-1982 00"
+ 11-DEC-1982 02 / 20:"11-DEC-1982 02"
+list/L=15:20 tax_datestring(t[gt=temp],temp,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TEMP],TEMP,"day")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:"10-NOV-1982"
+ 16-NOV-1982 18 / 16:"16-NOV-1982"
+ 22-NOV-1982 20 / 17:"22-NOV-1982"
+ 28-NOV-1982 22 / 18:"28-NOV-1982"
+ 05-DEC-1982 00 / 19:"05-DEC-1982"
+ 11-DEC-1982 02 / 20:"11-DEC-1982"
+list/L=15:20 tax_dayfrac(t[gt=temp],temp), tax_dayfrac(t[gt=temp],temp)*24.
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_DAYFRAC(T[GT=TEMP],TEMP)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TEMP],TEMP)*24.
+                (C001,V001)   EX#2
+10-NOV-1982 16 / 15:  0.6667  16.00
+16-NOV-1982 18 / 16:  0.7500  18.00
+22-NOV-1982 20 / 17:  0.8333  20.00
+28-NOV-1982 22 / 18:  0.9167  22.00
+05-DEC-1982 00 / 19:  0.0000   0.00
+11-DEC-1982 02 / 20:  0.0833   2.00
+list/L=15:20 tax_day(t[gt=temp],temp), tax_jday(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_DAY(T[GT=TEMP],TEMP)
+ Column  2: TAX_JDAY(T[GT=TEMP],TEMP)
+                (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:   10.00   314.0
+16-NOV-1982 18 / 16:   16.00   320.0
+22-NOV-1982 20 / 17:   22.00   326.0
+28-NOV-1982 22 / 18:   28.00   332.0
+05-DEC-1982 00 / 19:    5.00   339.0
+11-DEC-1982 02 / 20:   11.00   345.0
+list/L=15:20 tax_month(t[gt=temp],temp), tax_yearfrac(t[gt=temp],temp)
+             DATA SET: ./gt4d011.cdf
+             TIME: 07-NOV-1982 15:00 to 14-DEC-1982 03:00
+ Column  1: TAX_MONTH(T[GT=TEMP],TEMP)
+ Column  2: TAX_YEARFRAC(T[GT=TEMP],TEMP)
+                (C001,V001)  (C001,V009)
+10-NOV-1982 16 / 15:   11.00  0.8603
+16-NOV-1982 18 / 16:   11.00  0.8767
+22-NOV-1982 20 / 17:   11.00  0.8932
+28-NOV-1982 22 / 18:   11.00  0.9096
+05-DEC-1982 00 / 19:   12.00  0.9288
+11-DEC-1982 02 / 20:   12.00  0.9452
+list/L=15:20 tax_year(t[gt=temp],temp)
+             VARIABLE : TAX_YEAR(T[GT=TEMP],TEMP)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 6 points (TIME)
+ 10-NOV-1982 16 / 15:  1982.
+ 16-NOV-1982 18 / 16:  1982.
+ 22-NOV-1982 20 / 17:  1982.
+ 28-NOV-1982 22 / 18:  1982.
+ 05-DEC-1982 00 / 19:  1982.
+ 11-DEC-1982 02 / 20:  1982.
+list tax_units(temp)
+             VARIABLE : TAX_UNITS(TEMP)
+             FILENAME : gt4d011.cdf
+          3600.
+ 
+! fill_xy
+can data/all
+use coads_climatology
+let mask = 0*x[gx=sst] + y[gy=sst]  + 1
+shade fill_xy(sst[l=1], mask[l=1], 1)
+shade fill_xy(sst[l=1], mask[l=1], 4)
+ 
+*** Running test: bn_modulo_strides.jnl
+! bn_modulo_strides.jnl
+! 6/01 *sh*
+! exercise the combination of modulo and netCDF strides IO
+ 
+define axis/modulo/x=1:20:1 x20
+LET a = X[gx=x20]
+LET str_raw = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"}
+!list b_raw
+let str = str_raw[gx=x20 at asn]
+save/clobber/file=test_modulo.cdf a, str
+cancel variable a, str
+use test_modulo
+ 
+! verify that both single IO and double IO cases are doing rdstride
+cancel memory/all
+set mode diag
+let b =  a[i=18:23:2]
+list/nohead b            ! using rdstride
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid B        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ eval    B        C:  6 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G002)           @XACT
+ strip moduloing A on X axis:    18    22 dset:   1
+ rdstride A        C: 11 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:    18    20 dset:   1
+ -DELETE A        M:  1 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride A        C: 11 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     2     2 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+list/nohead a[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip moduloing A on X axis:     1    25 dset:   1
+ reading A        M:  3 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing A on X axis:     1    20 dset:   1
+ regrid  A        M:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:   1.00
+ 4    / 2:   4.00
+ 7    / 3:   7.00
+ 10   / 4:  10.00
+ 13   / 5:  13.00
+ 16   / 6:  16.00
+ 19   / 7:  19.00
+ 22   / 8:   2.00
+ 25   / 9:   5.00
+list/nohead b            ! reuse of cached result
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ found   B        M:  2 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead a[i=18:23:2]
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+list/nohead a[i=19:23:2]
+ 19   / 1:  19.00
+ 21   / 2:   1.00
+ 23   / 3:   3.00
+list/nohead a[i=20:23:2]
+ 20   / 1:  20.00
+ 22   / 2:   2.00
+list/nohead a[i=18:24:2]
+ 18   / 1:  18.00
+ 20   / 2:  20.00
+ 22   / 3:   2.00
+ 24   / 4:   4.00
+list/nohead a[i=19:24:2]
+ 19   / 1:  19.00
+ 21   / 2:   1.00
+ 23   / 3:   3.00
+list/nohead a[i=20:24:2]
+ 20   / 1:  20.00
+ 22   / 2:   2.00
+ 24   / 3:   4.00
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead a[i=17:23:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:23:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+list/nohead a[i=19:23:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+list/nohead a[i=20:23:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+list/nohead a[i=17:24:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:24:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+ 24   / 3:   4.00
+list/nohead a[i=19:24:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+list/nohead a[i=20:24:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+list/nohead a[i=17:25:3]
+ 17   / 1:  17.00
+ 20   / 2:  20.00
+ 23   / 3:   3.00
+list/nohead a[i=18:25:3]
+ 18   / 1:  18.00
+ 21   / 2:   1.00
+ 24   / 3:   4.00
+list/nohead a[i=19:25:3]
+ 19   / 1:  19.00
+ 22   / 2:   2.00
+ 25   / 3:   5.00
+list/nohead a[i=20:25:3]
+ 20   / 1:  20.00
+ 23   / 2:   3.00
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead a[i=1:45:5]
+ 1    / 1:   1.00
+ 6    / 2:   6.00
+ 11   / 3:  11.00
+ 16   / 4:  16.00
+ 21   / 5:   1.00
+ 26   / 6:   6.00
+ 31   / 7:  11.00
+ 36   / 8:  16.00
+ 41   / 9:   1.00
+list/nohead a[i=2:45:5]
+ 2    / 1:   2.00
+ 7    / 2:   7.00
+ 12   / 3:  12.00
+ 17   / 4:  17.00
+ 22   / 5:   2.00
+ 27   / 6:   7.00
+ 32   / 7:  12.00
+ 37   / 8:  17.00
+ 42   / 9:   2.00
+list/nohead a[i=3:45:5]
+ 3    / 1:   3.00
+ 8    / 2:   8.00
+ 13   / 3:  13.00
+ 18   / 4:  18.00
+ 23   / 5:   3.00
+ 28   / 6:   8.00
+ 33   / 7:  13.00
+ 38   / 8:  18.00
+ 43   / 9:   3.00
+list/nohead a[i=4:45:5]
+ 4    / 1:   4.00
+ 9    / 2:   9.00
+ 14   / 3:  14.00
+ 19   / 4:  19.00
+ 24   / 5:   4.00
+ 29   / 6:   9.00
+ 34   / 7:  14.00
+ 39   / 8:  19.00
+ 44   / 9:   4.00
+list/nohead a[i=5:45:5]
+ 5    / 1:   5.00
+ 10   / 2:  10.00
+ 15   / 3:  15.00
+ 20   / 4:  20.00
+ 25   / 5:   5.00
+ 30   / 6:  10.00
+ 35   / 7:  15.00
+ 40   / 8:  20.00
+ 45   / 9:   5.00
+list/nohead a[i=6:45:5]
+ 6    / 1:   6.00
+ 11   / 2:  11.00
+ 16   / 3:  16.00
+ 21   / 4:   1.00
+ 26   / 5:   6.00
+ 31   / 6:  11.00
+ 36   / 7:  16.00
+ 41   / 8:   1.00
+list/nohead a[i=101:145:5]
+ 101   / 1:   1.00
+ 106   / 2:   6.00
+ 111   / 3:  11.00
+ 116   / 4:  16.00
+ 121   / 5:   1.00
+ 126   / 6:   6.00
+ 131   / 7:  11.00
+ 136   / 8:  16.00
+ 141   / 9:   1.00
+list/nohead a[i=102:145:5]
+ 102   / 1:   2.00
+ 107   / 2:   7.00
+ 112   / 3:  12.00
+ 117   / 4:  17.00
+ 122   / 5:   2.00
+ 127   / 6:   7.00
+ 132   / 7:  12.00
+ 137   / 8:  17.00
+ 142   / 9:   2.00
+list/nohead a[i=103:145:5]
+ 103   / 1:   3.00
+ 108   / 2:   8.00
+ 113   / 3:  13.00
+ 118   / 4:  18.00
+ 123   / 5:   3.00
+ 128   / 6:   8.00
+ 133   / 7:  13.00
+ 138   / 8:  18.00
+ 143   / 9:   3.00
+list/nohead a[i=104:145:5]
+ 104   / 1:   4.00
+ 109   / 2:   9.00
+ 114   / 3:  14.00
+ 119   / 4:  19.00
+ 124   / 5:   4.00
+ 129   / 6:   9.00
+ 134   / 7:  14.00
+ 139   / 8:  19.00
+ 144   / 9:   4.00
+list/nohead a[i=105:145:5]
+ 105   / 1:   5.00
+ 110   / 2:  10.00
+ 115   / 3:  15.00
+ 120   / 4:  20.00
+ 125   / 5:   5.00
+ 130   / 6:  10.00
+ 135   / 7:  15.00
+ 140   / 8:  20.00
+ 145   / 9:   5.00
+list/nohead a[i=106:145:5]
+ 106   / 1:   6.00
+ 111   / 2:  11.00
+ 116   / 3:  16.00
+ 121   / 4:   1.00
+ 126   / 5:   6.00
+ 131   / 6:  11.00
+ 136   / 7:  16.00
+ 141   / 8:   1.00
+ 
+ 
+!  ***** STRING TESTS *****
+set mode diag
+list/nohead str[i=18:23:2] ! using rdstride
+ dealloc  dynamic grid (G003)          (AX001)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ -DELETE A        M:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G002)           @XACT
+ strip moduloing STR on X axis:    18    22 dset:   1
+ rdstride STR      C:  9 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:    18    20 dset:   1
+ -DELETE STR      M:  4 dset:   1 I:   18   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ rdstride STR      C:  9 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     2     2 dset:   1
+ -DELETE STR      M:  4 dset:   1 I:    2    2  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  STR      M:  4 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE STR      M:  6 dset:   1 I:   18   22  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=1:25:3]  ! no strides --> reads full region without strides
+ dealloc  dynamic grid (G002)          (AX002)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: STR --> (G003)           @XACT
+ strip moduloing STR on X axis:     1    25 dset:   1
+ reading STR      M:  6 dset:   1 I:    1   20  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing STR on X axis:     1    20 dset:   1
+ regrid  STR      M:  8 dset:   1 I:    1    9  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   NORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ 1    / 1:"a"
+ 4    / 2:"d"
+ 7    / 3:"g"
+ 10   / 4:"j"
+ 13   / 5:"m"
+ 16   / 6:"p"
+ 19   / 7:"s"
+ 22   / 8:"b"
+ 25   / 9:"e"
+set mode/last diag
+ 
+! less than one modulo cycle -- grab in 2 pieces
+! ... delta(2) a factor of npts(20)
+list/nohead str[i=18:23:2]
+ 18   / 1:"r"
+ 20   / 2:"t"
+ 22   / 3:"b"
+list/nohead str[i=20:23:2]
+ 20   / 1:"t"
+ 22   / 2:"b"
+ 
+! ... delta(3) not a factor of npts(20)
+list/nohead str[i=17:23:3]
+ 17   / 1:"q"
+ 20   / 2:"t"
+ 23   / 3:"c"
+list/nohead str[i=18:23:3]
+ 18   / 1:"r"
+ 21   / 2:"a"
+ 
+! more than one modulo cycle -- grab in one piece
+list/nohead str[i=1:45:5]
+ 1    / 1:"a"
+ 6    / 2:"f"
+ 11   / 3:"k"
+ 16   / 4:"p"
+ 21   / 5:"a"
+ 26   / 6:"f"
+ 31   / 7:"k"
+ 36   / 8:"p"
+ 41   / 9:"a"
+list/nohead str[i=5:45:5]
+ 5    / 1:"e"
+ 10   / 2:"j"
+ 15   / 3:"o"
+ 20   / 4:"t"
+ 25   / 5:"e"
+ 30   / 6:"j"
+ 35   / 7:"o"
+ 40   / 8:"t"
+ 45   / 9:"e"
+list/nohead str[i=101:145:5]
+ 101   / 1:"a"
+ 106   / 2:"f"
+ 111   / 3:"k"
+ 116   / 4:"p"
+ 121   / 5:"a"
+ 126   / 6:"f"
+ 131   / 7:"k"
+ 136   / 8:"p"
+ 141   / 9:"a"
+list/nohead str[i=105:145:5]
+ 105   / 1:"e"
+ 110   / 2:"j"
+ 115   / 3:"o"
+ 120   / 4:"t"
+ 125   / 5:"e"
+ 130   / 6:"j"
+ 135   / 7:"o"
+ 140   / 8:"t"
+ 145   / 9:"e"
+*** Running test: bn_axis_viewports.jnl
+! bn_axis_viewports
+! *sh* 9/01
+ 
+! demonstrate vieport layout using the /AXES qualifier
+set wind/clear/aspect=1
+def view/axes allax
+ 
+! make guide lines
+show view allax   ! text = 1
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ALLAX            1.00   0.00,1.00   0.00,1.00   axes
+   current viewport is NONE
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200 cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              1.00   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.7235
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.7235
+ppl axlen `1.375 + ($xaxl) + 1.375`,`1.375 + ($yaxl) + 1.375`
+ !-> ppl axlen 7.4735,7.4735
+plot/vs/hlim=-1.375:`($xaxl)+1.375`:0.25/vlim=-1.375:`($yaxl)+1.375`:0.25/nolab/nolab {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.375:6.0985:0.25/vlim=-1.375:6.0985:0.25/nolab/nolab {0,4.7235}, {0,4.7235}
+ 
+! again with scale determined automatically
+! make guide lines
+set window/clear
+set view allax
+plot/vs/line/hlim=0:1/vlim=0:1/nolab {0.5,0.5,,0,1},{0,1,,0.5,0.5}
+plot/vs/line/over/nolab {0.25,0.25,,0,1},{0,1,,0.25,0.25}
+plot/vs/line/over/nolab {0.75,0.75,,0,1},{0,1,,0.75,0.75}
+label 0.26,0.95,-1,0,.2 @P2 at AC<-At 0.25
+label 0.76,0.95,-1,0,.2 @P3 at AC<-At 0.75
+ 
+! a plot from 0.25 to 0.75
+def view /xlim=0.25:0.75/ylim=0.25:0.75/axes mid
+set view mid
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.75   0.25,0.75   0.25,0.75   axes
+   current viewport is MID
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.45E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-1.00E+00 HI= 1.00E+00 TIC= 2.00E-01 LEN= 5.45E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+! guidelines showing origin, axlen, white space
+def view /xlim=0.25:0.75/ylim=0.25:0.75/text=1/axes mid2
+set view mid2
+ppl origin 0,0
+define symbol xaxl `($PPL$WIDTH)/2`
+ !-> define symbol xaxl 4.7235
+define symbol yaxl `($PPL$HEIGHT)/2`
+ !-> define symbol yaxl 4.7235
+ppl axlen `1.375 + ($xaxl) + 1.375`,`1.375 + ($yaxl) + 1.375`
+ !-> ppl axlen 7.4735,7.4735
+plot/vs/hlim=-1.375:`($xaxl)+1.375`:0.25/vlim=-1.375:`($yaxl)+1.375`:0.25/nolab/line {0,($xaxl)}, {0,($yaxl)}
+ !-> plot/vs/hlim=-1.375:6.0985:0.25/vlim=-1.375:6.0985:0.25/nolab/line {0,4.7235}, {0,4.7235}
+ 
+set wind/clear
+ 
+! a full window plot
+set view allax
+plot/vs/hlim=-1:1/vlim=-1:1/line/i=1:200/noyadj cos(i/15),sin(i/15)
+show view mid
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ MID              0.75   0.25,0.75   0.25,0.75   axes
+   current viewport is ALLAX
+ 
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5/text=1 llax
+set view llax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1/text=1 lrax
+set view lrax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5/text=1 ulax
+set view ulax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1/text=1 urax
+set view urax
+PLOT/VS/LINE/I=1:314/noyadj i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 4.72E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+! again with viewport scaling determined automatically
+set wind/clear
+ 
+def view/axes/xlim=0:0.5/ylim=0:0.5 llax
+show view llax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LLAX             0.61   0.00,0.50   0.00,0.50   axes
+   current viewport is URAX
+set view llax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0:0.5/ylim=0.5:1 lrax
+show view lrax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ LRAX             0.61   0.00,0.50   0.50,1.00   axes
+   current viewport is LLAX
+set view lrax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 0.00E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0:0.5 ulax
+show view ulax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ ULAX             0.61   0.50,1.00   0.00,0.50   axes
+   current viewport is LRAX
+set view ulax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 0.00E+00  AUTO LABELLING
+ 
+def view/axes/xlim=0.5:1/ylim=0.5:1 urax
+show view urax
+ 
+ name             text    xlimits     ylimits    mode
+ 
+ URAX             0.61   0.50,1.00   0.50,1.00   axes
+   current viewport is ULAX
+set view urax
+PLOT/VS/LINE/I=1:314/nolab i*cos(i/20),i*sin(i/20)
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.03E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+ 
+cancel view
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO=-3.14E+02 HI= 2.52E+02 TIC= 5.00E+01 LEN= 6.70E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  AUTO LABELLING
+ppl list yaxis
+
+
+         YAXIS QUALITIES
+         LO=-2.50E+02 HI= 3.00E+02 TIC= 5.00E+01 LEN= 6.70E+00 CSIZE= 1.00E-01
+          LEFT AXIS= ON  RIGHT AXIS= ON 
+         AUTO    NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         YORG= 1.38E+00  AUTO LABELLING
+*** Running test: bn_strings.jnl
+! bn_strings.jnl
+ 
+! 7/01 - test string syntax and behaviors
+ 
+! 5/4/05 acm remove calls to writev5d, shared obj external function
+!            (put in separate file bn_ef_v5d_strings)
+ 
+sh mode stupid
+      MODE            STATE        ARGUMENT
+      STUPID        CANCELLED
+cancel mode stupid  ! for testing in double precision
+ 
+ 
+! some test files
+sp rm -f *.str_test *.string_tst
+sp touch dummy1.str_test dummy2.str_test dummy3.str_test dummy4.str_test dummy5.str_test dummy6.str_test dummy7.str_test dummy8.str_test dummy9.str_test
+sp touch dummy1.string_tst dummy2.string_tst dummy3.string_tst dummy4.string_tst dummy5.string_tst dummy6.string_tst dummy7.string_tst dummy8.string_tst
+ 
+cancel data/all
+ 
+let a = "testa.v5d"
+list a
+             VARIABLE : "testa.v5d"
+        "testa.v5d"
+ 
+let b = "goodbye"
+list a,b
+ Column  1: A is "testa.v5d"
+ Column  2: B is "goodbye"
+                   A      B
+I / *:    "testa.v5d" "goodbye"
+ 
+let a = {"hello","goodbye", "wave to me"}
+list a
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/order=x a[i=2:3]
+             VARIABLE : {"hello","goodbye", "wave to me"}
+             SUBSET   : 2 points (X)
+              2           3       
+               2           3
+        "goodbye"   "wave to me"
+ 
+let e = {,"string1",, "string2"}
+list e
+             VARIABLE : {,"string1",, "string2"}
+             SUBSET   : 4 points (X)
+ 1   / 1:""       
+ 2   / 2:"string1"
+ 3   / 3:""       
+ 4   / 4:"string2"
+ 
+list {"string","s2","very long string"},5
+             X: 0.5 to 3.5
+ Column  1: {"string","s2","very long string"}
+ Column  2: cnst is constant
+                  {"string   cnst
+1   / 1: "string"            5.000
+2   / 2: "s2"                5.000
+3   / 3: "very long string"  5.000
+ 
+set mode ignore
+  let e = {"string1" "string2"}
+  list e
+  let e = {,"string1",5, "string2"}
+  list e
+set mode/last ignore
+ 
+* mixed single and double quotes
+list/nohead {",a",',b'}
+ 1   / 1:",a"
+ 2   / 2:",b"
+list/nohead {'"'}, {"'"}
+I / *:    """ "'"
+ 
+let d = {"INITIALIZE", spawn:"ls *.str_test", "INSERT", spawn:"ls *.string_tst"}
+list d
+             VARIABLE : {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             SUBSET   : 19 points (X)
+ 1    /  1:"INITIALIZE"       
+ 2    /  2:"dummy1.str_test"  
+ 3    /  3:"dummy2.str_test"  
+ 4    /  4:"dummy3.str_test"  
+ 5    /  5:"dummy4.str_test"  
+ 6    /  6:"dummy5.str_test"  
+ 7    /  7:"dummy6.str_test"  
+ 8    /  8:"dummy7.str_test"  
+ 9    /  9:"dummy8.str_test"  
+ 10   / 10:"dummy9.str_test"  
+ 11   / 11:"INSERT"           
+ 12   / 12:"dummy1.string_tst"
+ 13   / 13:"dummy2.string_tst"
+ 14   / 14:"dummy3.string_tst"
+ 15   / 15:"dummy4.string_tst"
+ 16   / 16:"dummy5.string_tst"
+ 17   / 17:"dummy6.string_tst"
+ 18   / 18:"dummy7.string_tst"
+ 19   / 19:"dummy8.string_tst"
+stat d
+ 
+             {"INITIALIZE", SPAWN:"ls *.str_test", "INSERT", SPAWN:"ls *.string_tst"}
+             X: 0.5 to 19.5
+             Y:  N/A
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 19 (19*1*1*1*1*1)
+ Maximum string length: 17
+load d
+ 
+set mode ignore
+  plot d
+  define axis/x xax = d
+set mode/last ignore
+ 
+! netCDF file IO
+let a = {"hello"}            ! note - a is an array of length 1
+save/clobber/file=test_string.cdf a
+canc var a
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello"}                        1:1       ...       ...       ...       ...       ...
+ 
+list a
+             VARIABLE : {"hello"}
+             FILENAME : test_string.cdf
+             X        : 1
+        "hello"
+canc data test_string
+ 
+let b = "one line of text"   !  note - b is scalar
+save/clobber/file=test_string.cdf b
+canc var b
+use test_string
+sh dat test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ 
+list b
+             VARIABLE : "one line of text"
+             FILENAME : test_string.cdf
+        "one line of text"
+canc data test_string
+ 
+let a = {"hello","goodbye", "wave to me"}
+let b = "one line of text"
+save/clobber/file=test_string.cdf a,b
+sp echo "bn_strings.jnl --- 1 original file" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+save/append/file=test_string.cdf d
+let b2 = "two line of text"   ! the same string length as b
+sp echo "bn_strings.jnl --- 2 append to file" >> all_ncdump.out
+save/append/file=test_string.cdf b2
+canc var/all
+use test_string.cdf
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ A        {"hello","goodbye", "wave to me  1:3       ...       ...       ...       ...       ...
+ B        "one line of text"               ...       ...       ...       ...       ...       ...
+ D        {"INITIALIZE", SPAWN:"ls *.str_  1:19      ...       ...       ...       ...       ...
+ B2       "two line of text"               ...       ...       ...       ...       ...       ...
+ 
+list/nohead a
+ 1   / 1:"hello"     
+ 2   / 2:"goodbye"   
+ 3   / 3:"wave to me"
+list/nohead b
+        "one line of text"
+ 
+set var/title="partial filename list" d
+save/clobber/file=test_string2.cdf/heading=enhanced d[i=2:5]
+sp mv test_string2.cdf test_string.cdf
+sp echo "bn_strings.jnl --- 3 enhanced heading" >> all_ncdump.out
+sp ncdump test_string.cdf >> all_ncdump.out
+canc data/all
+use test_string
+show data test_string
+     currently SET data sets:
+    1> ./test_string.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ D        partial filename list            2:5       ...       ...       ...       ...       ...
+ 
+list d
+             VARIABLE : partial filename list
+             FILENAME : test_string.cdf
+             SUBSET   : 4 points (X)
+ 2   / 2:"dummy1.str_test"
+ 3   / 3:"dummy2.str_test"
+ 4   / 4:"dummy3.str_test"
+ 5   / 5:"dummy4.str_test"
+ 
+! regridding tests
+let a = {spawn:"ls *.str_test"}
+list a
+             VARIABLE : {SPAWN:"ls *.str_test"}
+             SUBSET   : 9 points (X)
+ 1   / 1:"dummy1.str_test"
+ 2   / 2:"dummy2.str_test"
+ 3   / 3:"dummy3.str_test"
+ 4   / 4:"dummy4.str_test"
+ 5   / 5:"dummy5.str_test"
+ 6   / 6:"dummy6.str_test"
+ 7   / 7:"dummy7.str_test"
+ 8   / 8:"dummy8.str_test"
+ 9   / 9:"dummy9.str_test"
+define axis/x=0.1:0.7:.1 xasn
+list a[gx=xasn at asn]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.1 delta on X at ASN
+             SUBSET   : 7 points (X)
+ 0.1  / 1:"dummy1.str_test"
+ 0.2  / 2:"dummy2.str_test"
+ 0.3  / 3:"dummy3.str_test"
+ 0.4  / 4:"dummy4.str_test"
+ 0.5  / 5:"dummy5.str_test"
+ 0.6  / 6:"dummy6.str_test"
+ 0.7  / 7:"dummy7.str_test"
+define axis/x=1:6:.5 xxact
+list a[gx=xxact at xact]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.5 delta on X at XACT
+             SUBSET   : 11 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.5  /  2:""               
+ 2    /  3:"dummy2.str_test"
+ 2.5  /  4:""               
+ 3    /  5:"dummy3.str_test"
+ 3.5  /  6:""               
+ 4    /  7:"dummy4.str_test"
+ 4.5  /  8:""               
+ 5    /  9:"dummy5.str_test"
+ 5.5  / 10:""               
+ 6    / 11:"dummy6.str_test"
+define axis/x=1:6:.4 xnrst
+list a[gx=xnrst at nrst]
+             VARIABLE : {SPAWN:"ls *.str_test"}
+                        regrid: 0.4 delta on X at NRST
+             SUBSET   : 14 points (X)
+ 1    /  1:"dummy1.str_test"
+ 1.4  /  2:"dummy1.str_test"
+ 1.8  /  3:"dummy2.str_test"
+ 2.2  /  4:"dummy2.str_test"
+ 2.6  /  5:"dummy3.str_test"
+ 3    /  6:"dummy3.str_test"
+ 3.4  /  7:"dummy3.str_test"
+ 3.8  /  8:"dummy4.str_test"
+ 4.2  /  9:"dummy4.str_test"
+ 4.6  / 10:"dummy5.str_test"
+ 5    / 11:"dummy5.str_test"
+ 5.4  / 12:"dummy5.str_test"
+ 5.8  / 13:"dummy6.str_test"
+ 6.2  / 14:"dummy6.str_test"
+set mode ignore
+  list a[gx=xnrst]
+  list a[gx=xnrst at ave]
+  list a[gx=xnrst at var]
+  list a[gx=xnrst at ngd]
+  list a[gx=xnrst at max]
+  list a[gx=xnrst at sum]
+  set axis/modulo xnrst
+  list a[gx=xnrst at mod]
+set mode/last ignore
+ 
+! functions returning strings
+list/nohead xsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  ysequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid YABSTRACT
+    GRID YABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ ABSTRACT  Y             99999999 r   1                    1.E+08
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+list/nohead  zsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid ZABSTRACT
+    GRID ZABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ABSTRACT  Z             99999999 r   1                    1.E+08
+ normal    T
+ normal    E
+ normal    F
+list/nohead  tsequence({"a","b","c","d","e"})
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 4   / 4:"d"
+ 5   / 5:"e"
+sh grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid TABSTRACT
+    GRID TABSTRACT
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ ABSTRACT  T             99999999 r   1                    1.E+08
+ normal    E
+ normal    F
+let a = TSEQUENCE({"a","b","c","d","e"})
+list/l=2:3 a
+             VARIABLE : TSEQUENCE({"a","b","c","d","e"})
+             SUBSET   : 2 points (T)
+ 2   / 2:"b"
+ 3   / 3:"c"
+ 
+list/nohead  {"a",,"b"}
+ 1   / 1:"a"
+ 2   / 2:"" 
+ 3   / 3:"b"
+list/nohead  samplei({"a","b",,"d","e","f"},{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplej(YSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplek(ZSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+list/nohead  samplel(TSEQUENCE({"a","b",,"d","e","f"}),{3,2,,1})
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 4   / 4:"a"
+ 
+let a = {"a",," ",""}
+let b = samplej(YSEQUENCE({"a","b",,"d","e","f"}),{2,,1})
+save/clobber/file=foo.cdf a,b
+sp echo "bn_strings.jnl --- 4 sample and ysequence functions on string var" >> all_ncdump.out
+sp ncdump foo.cdf >> all_ncdump.out
+ 
+let a =  RESHAPE({"a","b",,"d","e","f"},I[i=1:3]+j[j=1:2])
+list  a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list/i=2:3 a
+             VARIABLE : RESHAPE({"a","b",,"d","e","f"},I[I=1:3]+J[J=1:2])
+             SUBSET   : 2 by 2 points (X-Y)
+           2  3  
+           2  3
+ 1   / 1:"b""" 
+ 2   / 2:"e""f"
+list  reshape(a,I[I=1:2]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:2]+J[J=1:3])
+             SUBSET   : 2 by 3 points (X-Y)
+           1  2  
+           1  2
+ 1   / 1:"a""b"
+ 2   / 2:"" "d"
+ 3   / 3:"e""f"
+list  reshape(a,I[I=1:3]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:3]+J[J=1:3])
+             SUBSET   : 3 by 2 points (X-Y)
+           1  2  3  
+           1  2  3
+ 1   / 1:"a""b""" 
+ 2   / 2:"d""e""f"
+list reshape(a,I[I=1:1]+J[J=1:3])
+             VARIABLE : RESHAPE(A,I[I=1:1]+J[J=1:3])
+             SUBSET   : 3 points (Y)
+             X        : 1
+           1  
+           1
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+! logical operators applied to strings
+list {"a","b","c"} EQ YSEQUENCE({"A","B","C"})  ! case insensitive
+             VARIABLE : {"a","b","c"} EQ YSEQUENCE({"A","B","C"})
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:  1.000  0.000  0.000
+ 2   / 2:  0.000  1.000  0.000
+ 3   / 3:  0.000  0.000  1.000
+list {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             VARIABLE : {"a","b","c"} NE YSEQUENCE({"a","B","c"})
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:  0.000  1.000  1.000
+ 2   / 2:  1.000  0.000  1.000
+ 3   / 3:  1.000  1.000  0.000
+list/nohead "b" LT {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+list/nohead "b" LE {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  1.000
+list/nohead "b" EQ {"a","b","c"}
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+list/nohead "b" GE {"a","b","c"}
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+list/nohead "b" GT {"a","b","c"}
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  0.000
+ 
+! special hacks allow "+" to be a concatenation operator
+list/nohead "hello" + ", friend"
+        "hello, friend"
+list/nohead {"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"
+ 1   / 1:"hello, old friend"  "goodbye, old friend"
+ 2   / 2:"hello, new friend"  "goodbye, new friend"
+list/nohead SAMPLEI(XSEQUENCE({"hello","goodbye"}+", "+YSEQUENCE({"old","new"})+" "+"friend"), {2,3})
+ 1   / 1:"goodbye, old friend"
+ 2   / 2:"hello, new friend"  
+ 
+! special hacks allow IF-THEN-ELSE to apply to strings
+list/nohead if {0,1} THEN "hello"
+ 1   / 1:""     
+ 2   / 2:"hello"
+list/nohead if {0,1} THEN "hello" ELSE "goodbye"
+ 1   / 1:"goodbye"
+ 2   / 2:"hello"  
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", ") + "friend"
+ 1   / 1:"now, friend"        "now, hello, friend" 
+ 2   / 2:"then, friend"       "then, hello, friend"
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:"now, goodbye, my friend" "now, hello, friend"      
+ 2   / 2:"then, goodbye, my friend""then, hello, friend"     
+list/nohead ysequence({98, 99})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+99 ELSE "goodbye"+", my ") + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+99) + "friend"
+ 1   / 1:........
+ 2   / 2:........
+list/nohead ysequence({"now","then"})+", " + (if {0,1} THEN "hello"+", " ELSE "goodbye"+", my ") + 99
+ 1   / 1:........
+ 2   / 2:........
+ 
+! numerical operators applied to strings
+list/nohead "b" - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" * {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" / {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead "b" ^ {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead {"a","b"} + 1
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 + {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead 1 - {"a","b"}
+ 1   / 1:....
+ 2   / 2:....
+list/nohead SIN({"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX("a",{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+list/nohead MAX(1,{"a","b","c"})
+ 1   / 1:....
+ 2   / 2:....
+ 3   / 3:....
+ 
+! transformations applied to strings
+let a = {"a","b","c","d"}
+list a[i=@shf]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by 1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"b"
+ 2   / 2:"c"
+ 3   / 3:"d"
+ 4   / 4:"" 
+list a[i=@shf:-1]
+             VARIABLE : {"a","b","c","d"}
+                        shifted by -1 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:"" 
+ 2   / 2:"a"
+ 3   / 3:"b"
+ 4   / 4:"c"
+list a[i=@ave]
+             VARIABLE : {"a","b","c","d"}
+             X        : 0.5 to 4.5 (averaged)
+        ""
+list a[i=@sbx]
+             VARIABLE : {"a","b","c","d"}
+                        box smoothed by 3 pts on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+list a[i=@rsum]
+             VARIABLE : {"a","b","c","d"}
+                        running sum on X
+             SUBSET   : 4 points (X)
+ 1   / 1:""
+ 2   / 2:""
+ 3   / 3:""
+ 4   / 4:""
+ 
+set mode/last stupid
+*** Running test: bn_axcontrol.jnl
+ ! NOAA/PMEL TMAP
+ ! Program FERRET (alpha)
+ ! Version 5.33 - 07/12/01
+ ! 12-Jul-01 14:47
+ 
+define axis/t=1-jan-0001:20-jan-0001:1 begtime
+let tpts = t[gt=begtime]
+set view ul
+plot/axes=1,0,0,1 sin(tpts/15)
+ 
+set view ur
+plot/axes=1,0,0,1/trans sin(tpts/15)
+ 
+set view ll
+plot/axes/trans  sin(tpts/15)
+ 
+set view lr
+plot/noaxes  sin(tpts/15)
+ 
+! contour shade and fill, with /TRANS
+ 
+use coads_climatology
+set view ul
+contour/l=1/axes=0,1,1,0 sst
+ 
+set view ur
+shade/l=1/axes=1,0,1,0/trans sst
+ 
+set view ll
+contour/l=1/axes=0,0,0,0/trans sst
+ 
+set view lr
+fill/l=1/axes sst
+ 
+! polygon
+ 
+can view
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+*** Running test: bn_vec_curv.jnl
+! bn_vec_curv.jnl
+!
+! vector plots with curvilinear coordinates
+!
+! ACM  10/23/01
+!       9/12/02  vary the lengths of the vectors in 1st two plots.
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta vec_curv.plt
+can mode logo
+use coads_climatology
+set reg/l=1
+go mp_orthographic 230 60
+set grid sst
+go mp_aspect
+ 
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+vec/noax/xskip=6/yskip=6/len=20/title="View From Space"  sst*0,(sst*0+yy)*mp_mask, x_page,y_page
+vec/over/xskip=6/yskip=6/len=20 (sst*0+yy)*mp_mask,sst*0, x_page,y_page
+vec/over/xskip=6/yskip=6/color=blue/len=20  (sst*0+yy)*mp_mask,(sst*0+yy)*mp_mask, x_page,y_page
+ 
+can mode meta
+ 
+! Sinusoidal projection; put data at the poles
+ 
+use coads_climatology
+go mp_sinusoidal
+set grid sst
+go mp_aspect
+ 
+let fsst = missing(sst,5)
+let yy =  if abs(y[gt=sst]) le 20 then 10 else  (100-abs(y[gt=sst]+1))/ 10.
+ 
+set reg/l=1
+vec/noax/xskip=16/yskip=8/len=15/title="Sinusoidal Projection" fsst*0,fsst*0+yy*mp_mask, x_page,y_page
+vec/over/xskip=16/yskip=8/len=15 fsst*0+yy*mp_mask,fsst*0, x_page,y_page
+ 
+! Irregular axes, and manual axis scaling
+set win/asp=1
+set mode meta vec_curv2.plt
+ 
+def axis/from_data/x/name=xirr {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+set view ul
+vec a,b
+ 
+! project it to a regular grid
+let mx = i[i=1:13]
+let my = j[j=1:13]
+let mxpage = mx + 0*my
+let mypage = my+0*mx
+set view ll
+vec/title="Regular grid" a,b,mxpage,mypage
+ 
+! Now stretch the grid
+ 
+set view lr
+let mx = exp(x[x=2:4.4:0.2])
+let my = exp(y[y=1:3.4:0.2])
+ 
+let mxpage = mx + 0*my
+let mypage = my + 0*mx
+vec/title="Stretched grid" a,b,mxpage,mypage
+ 
+can mode meta
+set mode logo
+*** Running test: bn_delimited_read.jnl
+! bn_delimited_read.jnl
+! 10/01 *sh*
+ 
+! test delimiited (spreadsheet) reads in Ferret
+ 
+! look at the file
+spawn cat bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+one,,1.1,24S,130E,,1e1,"word 1"
+    two,,2.2,24N,130W,2S,,"word 2"
+three,,3.3,24,130,3N,3e-2," wd 3 "
+
+five,,4.4,-24,-130,91, -4e2  ,  "word 4"  ,  aa  , 77
+extra line
+ 
+! try the file as-is:  record 1 contains 5 column headings (text)
+! so V1 through V5 analyze to be text
+file/format=delim bn_delimited_read_1.dat
+show data/var
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /DELIMITERS="\t,\,"
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1    V2     V3     V4     V5    V6    V7      V8     V9    V10
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "    .... " "      " "    ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.0 "word 1" " "    ....
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"   .... "word 2" " "    ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.0 " wd 3 " " "    ....
+5   / 5: " "          " "    " "    " "    " "    " "    .... " "      " "    ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.0 "word 4" "aa"  77.00
+7   / 7: "extra line" " "    " "    " "    " "    " "    .... " "      " "    ....
+ 
+! manually name the variables while still automatically analyzing data types
+file/format=delim/var=a1,a2,a3,a4,a5,a6,a7 bn_delimited_read_1.dat
+list a1,a2,a3,a4,a5,a6,a7
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 7.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+ Column  6: A6
+ Column  7: A7
+                  A1    A2     A3     A4     A5    A6    A7
+1   / 1: "col1"       "col2" "col3" "col4" "col5" " "    ....
+2   / 2: "one"        " "    "1.1"  "24S"  "130E" " "    10.0
+3   / 3: "two"        " "    "2.2"  "24N"  "130W" "2S"   ....
+4   / 4: "three"      " "    "3.3"  "24"   "130"  "3N"    0.0
+5   / 5: " "          " "    " "    " "    " "    " "    ....
+6   / 6: "five"       " "    "4.4"  "-24"  "-130" "91" -400.0
+7   / 7: "extra line" " "    " "    " "    " "    " "    ....
+ 
+! skip the first record to do a better "analysis" of the file fields
+! note that v3 is correctly analyzed as numeric
+file/format=delim/skip=1 bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2 is V2 (all values missing)
+ Column  3: V3
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_east)(Longitude)
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1  V2   V3     V4     V5    V6    V7      V8     V9    V10
+1   / 1: "one"       ...  1.100 -24.00  130.0 " "    10.0 "word 1" " "    ....
+2   / 2: "two"       ...  2.200  24.00 -130.0 "2S"   .... "word 2" " "    ....
+3   / 3: "three"     ...  3.300  24.00  130.0 "3N"    0.0 " wd 3 " " "    ....
+4   / 4: " "         ...   ....   ....   .... " "    .... " "      " "    ....
+5   / 5: "five"      ...  4.400 -24.00 -130.0 "91" -400.0 "word 4" "aa"  77.00
+6   / 6: "extra line"...   ....   ....   .... " "    .... " "      " "    ....
+ 
+! insist that all columns be treated as string
+file/format=delim/skip=1/type=text bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+                  V1   V2   V3    V4    V5    V6    V7      V8     V9   V10
+1   / 1: "one"        " " "1.1" "24S" "130E" " "  "1e1"  "word 1" " "  " " 
+2   / 2: "two"        " " "2.2" "24N" "130W" "2S" " "    "word 2" " "  " " 
+3   / 3: "three"      " " "3.3" "24"  "130"  "3N" "3e-2" " wd 3 " " "  " " 
+4   / 4: " "          " " " "   " "   " "    " "  " "    " "      " "  " " 
+5   / 5: "five"       " " "4.4" "-24" "-130" "91" "-4e2" "word 4" "aa" "77"
+6   / 6: "extra line" " " " "   " "   " "    " "  " "    " "      " "  " " 
+ 
+! insist that all columns be treated as string and name the columns
+file/format=delim/skip=1/type=text/var=a1,a2,a3,a4,a5 bn_delimited_read_1.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_1.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:20480   ...       ...       ...       ...       ...
+ A2       A2                               1:20480   ...       ...       ...       ...       ...
+ A3       A3                               1:20480   ...       ...       ...       ...       ...
+ A4       A4                               1:20480   ...       ...       ...       ...       ...
+ A5       A5                               1:20480   ...       ...       ...       ...       ...
+ 
+list a1,a2,a3,a4,a5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: A1
+ Column  2: A2
+ Column  3: A3
+ Column  4: A4
+ Column  5: A5
+                  A1   A2   A3    A4    A5
+1   / 1: "one"        " " "1.1" "24S" "130E"
+2   / 2: "two"        " " "2.2" "24N" "130W"
+3   / 3: "three"      " " "3.3" "24"  "130" 
+4   / 4: " "          " " " "   " "   " "   
+5   / 5: "five"       " " "4.4" "-24" "-130"
+6   / 6: "extra line" " " " "   " "   " "   
+ 
+! insist that all columns be treated as numeric
+file/format=delim/skip=1/type=numeric bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+        V1  V2   V3     V4     V5     V6     V7   V8 V9   V10
+1   / 1:......  1.100   ....   ....   ....   10.0......   ....
+2   / 2:......  2.200   ....   ....   ....   ..........   ....
+3   / 3:......  3.300  24.00  130.0   ....    0.0......   ....
+4   / 4:......   ....   ....   ....   ....   ..........   ....
+5   / 5:......  4.400 -24.00 -130.0  91.00 -400.0......  77.00
+6   / 6:......   ....   ....   ....   ....   ..........   ....
+ 
+! insist that all columns be treated as latitude
+file/format=delim/skip=1/type=latitude bn_delimited_read_1.dat
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 0.5 to 6.5
+ Column  1: V1 is V1 (degrees_north)(Latitude)
+ Column  2: V2 is V2 (degrees_north)(Latitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (degrees_north)(Latitude)
+ Column  5: V5 is V5 (degrees_north)(Latitude)
+ Column  6: V6 is V6 (degrees_north)(Latitude)
+ Column  7: V7 is V7 (degrees_north)(Latitude)
+ Column  8: V8 is V8 (degrees_north)(Latitude)
+ Column  9: V9 is V9 (degrees_north)(Latitude)
+ Column 10: V10 is V10 (degrees_north)(Latitude)
+        V1  V2   V3     V4     V5     V6     V7   V8 V9   V10
+1   / 1:......  1.100 -24.00   ....   ....   10.0......   ....
+2   / 2:......  2.200  24.00   ....  -2.00   ..........   ....
+3   / 3:......  3.300  24.00  130.0   3.00    0.0......   ....
+4   / 4:......   ....   ....   ....   ....   ..........   ....
+5   / 5:......  4.400 -24.00 -130.0  91.00 -400.0......  77.00
+6   / 6:......   ....   ....   ....   ....   ..........   ....
+ 
+! read only the first line of the file
+spawn head -1 bn_delimited_read_1.dat
+col1,col2,col3,col4,col5
+define axis/x=1:1:1 x1
+define grid/x=x1 g1
+columns/grid=g1 bn_delimited_read_1.dat
+ ! note 10 columns because auto-analysis of file doesnt stop at 1st record
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+             V1    V2     V3     V4     V5    V6 V7  V8  V9 V10
+I / *:    "col1" "col2" "col3" "col4" "col5" " "... " " " "....
+columns/grid=g1/var=c1,c2,c3,c4,c5 bn_delimited_read_1.dat
+list c1,c2,c3,c4,c5
+             DATA SET: ./bn_delimited_read_1.dat
+             X: 1
+ Column  1: C1
+ Column  2: C2
+ Column  3: C3
+ Column  4: C4
+ Column  5: C5
+             C1    C2     C3     C4     C5
+I / *:    "col1" "col2" "col3" "col4" "col5"
+ 
+! ==========
+cancel data/all
+! file using blank as a delimiter
+! Note record 1 has blanks at end of record
+! Note record of many blanks sandwiched in as record 2
+file/form=delimited bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+ 
+file/form=delimited/delimiter=" " bn_delimited_read_2.dat
+show data
+     currently SET data sets:
+    1> ./bn_delimited_read_2.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+       (all values missing)
+ 
+list v1,v2
+             DATA SET: ./bn_delimited_read_2.dat
+             X: 0.5 to 3.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (hours)(Time of day)
+             V1    V2
+1   / 1:  37965.  12.58
+2   / 2:    ....   ....
+3   / 3:  39051.  13.75
+ 
+! ==========
+! look at the date/time file
+spawn cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+ 
+! try the file as-is
+! Note that record 3 has syntax errors in the first 4 fields
+columns bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+                V1        V2           V3           V4         V5      V6     V7     V8
+1   / 1: "12/1/99"  "1999-03-01"  "12:00"      "13:45:36.5"  36493.  36218.  12.00  13.76
+2   / 2: "12/2/99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  36494.  36219.   1.00  14.76
+3   / 3: "12/3/99x" "1999-03-03x" "2:00x"      "15:45x"      36495.  36220.   2.00  15.75
+4   / 4: "12/4/99"  "1999-03-04"  "03:00"      "16:45:36.5"  36496.  36221.   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! sanity check date encodings
+define axis/t/units=days/T0=1-jan-1900  tax = v5
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-DEC-1999 00:00    04-DEC-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+define axis/t/units=days/T0=1-jan-1900  tax = v6
+show axis tax
+ name       axis              # pts   start                end
+ TAX       TIME                 4 r   01-MAR-1999 00:00    04-MAR-1999 00:00
+T0 = 1-JAN-1900
+   Axis span (to cell edges) = 4
+ 
+columns/type=date bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (days)(Julian days since 1-Jan-1900)
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (days)(Julian days since 1-Jan-1900)
+ Column  8: V8 is V8 (days)(Julian days since 1-Jan-1900)
+             V1     V2   V3 V4    V5      V6   V7 V8
+1   / 1:  36493.  36218.......  36493.  36218.......
+2   / 2:  36494.  36219.......  36494.  36219.......
+3   / 3:    ....    ..........  36495.  36220.......
+4   / 4:  36496.  36221.......  36496.  36221.......
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ 
+ 
+columns/type=time bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (hours)(Time of day)
+ Column  2: V2 is V2 (hours)(Time of day)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (hours)(Time of day)
+ Column  6: V6 is V6 (hours)(Time of day)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+        V1  V2   V3     V4   V5 V6   V7     V8
+1   / 1:......  12.00  13.76......  12.00  13.76
+2   / 2:......   1.00  14.76......   1.00  14.76
+3   / 3:......   ....   ..........   2.00  15.75
+4   / 4:......   3.00  16.76......   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,dat,ti,tim,date, date, time, time"  bn_delimited_read_date_time.dat
+list v1,v2,v3,v4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V2 is V2 (days)(Julian days since 1-Jan-1900)
+ Column  3: V3 is V3 (hours)(Time of day)
+ Column  4: V4 is V4 (hours)(Time of day)
+ Column  5: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  6: V6 is V6 (days)(Julian days since 1-Jan-1900)
+ Column  7: V7 is V7 (hours)(Time of day)
+ Column  8: V8 is V8 (hours)(Time of day)
+             V1     V2     V3     V4      V5      V6     V7     V8
+1   / 1:  36493.  36218.  12.00  13.76  36493.  36218.  12.00  13.76
+2   / 2:  36494.  36219.   1.00  14.76  36494.  36219.   1.00  14.76
+3   / 3:    ....    ....   ....   ....  36495.  36220.   2.00  15.75
+4   / 4:  36496.  36221.   3.00  16.76  36496.  36221.   3.00  16.76
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V2       V2                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V4       V4                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V6       V6                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V8       V8                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+columns/type="da,-,ti,-,date,-,time,-"  bn_delimited_read_date_time.dat
+list v1,v3,v5,v7
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
+ Column  2: V3 is V3 (hours)(Time of day)
+ Column  3: V5 is V5 (days)(Julian days since 1-Jan-1900)
+ Column  4: V7 is V7 (hours)(Time of day)
+             V1    V3      V5     V7
+1   / 1:  36493.  12.00  36493.  12.00
+2   / 2:  36494.   1.00  36494.   1.00
+3   / 3:    ....   ....  36495.   2.00
+4   / 4:  36496.   3.00  36496.   3.00
+show data 2
+     currently SET data sets:
+    2> ./bn_delimited_read_date_time.dat  (default)
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V3       V3                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ V5       V5                               1:4       ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+ V7       V7                               1:4       ...       ...       ...       ...       ...
+       (Time of day)
+ 
+ 
+! delimiters can be used to break up individual fields
+file/form=delim/delim="/" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+            V1    V2                       V3                      V4
+1   / 1:  12.00  1.000 "99,1999-03-01,12:00, 13:45:36.5,12"       1.000
+2   / 2:  12.00  2.000 "99,1999-03-02,01:00:13.5, 14:45:36.5,12"  2.000
+3   / 3:  12.00  3.000 "99x,1999-03-03x,2:00x, 15:45x,12"         3.000
+4   / 4:  12.00  4.000 "99,1999-03-04,03:00, 16:45:36.5, 12"      4.000
+! ---
+sp cat bn_delimited_read_date_time.dat
+12/1/99,1999-03-01,12:00, 13:45:36.5,12/1/99,1999-03-01,12:00, 13:45:36.5
+12/2/99,1999-03-02,01:00:13.5, 14:45:36.5,12/2/99,1999-03-02,01:00:13.5, 14:45:36.5
+12/3/99x,1999-03-03x,2:00x, 15:45x,12/3/99,1999-03-03,2:00, 15:45
+12/4/99,1999-03-04,03:00, 16:45:36.5, 12/4/99,1999-03-04,03:00, 16:45:36.5
+! ---
+file/form=delim/delim="/,\," bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+            V1    V2     V3        V4           V5           V6        V7     V8
+1   / 1:  12.00  1.000 "99"  "1999-03-01"  "12:00"      "13:45:36.5"  12.00  1.000
+2   / 2:  12.00  2.000 "99"  "1999-03-02"  "01:00:13.5" "14:45:36.5"  12.00  2.000
+3   / 3:  12.00  3.000 "99x" "1999-03-03x" "2:00x"      "15:45x"      12.00  3.000
+4   / 4:  12.00  4.000 "99"  "1999-03-04"  "03:00"      "16:45:36.5"  12.00  4.000
+ file/form=delim/delim="/,\,,-" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+            V1    V2     V3    V4     V5     V6       V7           V8        V9     V10
+1   / 1:  12.00  1.000 "99"   1999.  3.000 "01"  "12:00"      "13:45:36.5"  12.00  1.000
+2   / 2:  12.00  2.000 "99"   1999.  3.000 "02"  "01:00:13.5" "14:45:36.5"  12.00  2.000
+3   / 3:  12.00  3.000 "99x"  1999.  3.000 "03x" "2:00x"      "15:45x"      12.00  3.000
+4   / 4:  12.00  4.000 "99"   1999.  3.000 "04"  "03:00"      "16:45:36.5"  12.00  4.000
+ file/form=delim/delim="/,\,,-,:" bn_delimited_read_date_time.dat
+list V1,V2,V3,V4,v5,v6,v7,v8,v9,v10
+             DATA SET: ./bn_delimited_read_date_time.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+            V1    V2     V3    V4     V5     V6    V7     V8    V9    V10
+1   / 1:  12.00  1.000 "99"   1999.  3.000 "01"   12.00 "00"   13.00 "45" 
+2   / 2:  12.00  2.000 "99"   1999.  3.000 "02"    1.00 "00"   13.50 "14" 
+3   / 3:  12.00  3.000 "99x"  1999.  3.000 "03x"   2.00 "00x"  15.00 "45x"
+4   / 4:  12.00  4.000 "99"   1999.  3.000 "04"    3.00 "00"   16.00 "45" 
+ 
+! read (beginning of) CO2 data file provided by Chris Sabine (like ODV files)
+cancel data/all
+columns/skip=1 bn_delimited_read_CO2.dat
+show data/full
+     currently SET data sets:
+    1> ./bn_delimited_read_CO2.dat  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ V1       V1                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V2       V2                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V3       V3                               1:20480   ...       ...       ...       ...       ...
+            Data type = TEXT
+            Conversion /TYPE=TEXT
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V4       V4                               1:20480   ...       ...       ...       ...       ...
+       (Julian days since 1-Jan-1900)
+            Data type = NUMERIC
+            Conversion /TYPE=DATE
+             days on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V5       V5                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V6       V6                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V7       V7                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V8       V8                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V9       V9                               1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V10      V10                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V11      V11                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V12      V12                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V13      V13                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V14      V14                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V15      V15                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V16      V16                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V17      V17                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V18      V18                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V19      V19                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V20      V20                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V21      V21                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V22      V22                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V23      V23                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V24      V24                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V25      V25                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V26      V26                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V27      V27                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V28      V28                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V29      V29                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V30      V30                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V31      V31                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V32      V32                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V33      V33                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V34      V34                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V35      V35                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V36      V36                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V37      V37                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V38      V38                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V39      V39                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V40      V40                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V41      V41                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V42      V42                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V43      V43                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V44      V44                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V45      V45                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V46      V46                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V47      V47                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V48      V48                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V49      V49                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V50      V50                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V51      V51                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V52      V52                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V53      V53                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V54      V54                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V55      V55                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V56      V56                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V57      V57                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V58      V58                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V59      V59                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V60      V60                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V61      V61                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V62      V62                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V63      V63                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V64      V64                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V65      V65                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V66      V66                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V67      V67                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V68      V68                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V69      V69                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V70      V70                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V71      V71                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ V72      V72                              1:20480   ...       ...       ...       ...       ...
+            Data type = NUMERIC
+            Conversion /TYPE=NUMERIC
+               on grid EZ with -1.E+34 for missing data
+             X=0.5:20480.5  
+ 
+ /DELIMITERS="\t,\,"
+ /FORMAT = DELIMITED
+ /SKIP = 1
+ /COLUMNS = 72
+list v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 0.5 to 19.5
+ Column  1: V1
+ Column  2: V2
+ Column  3: V3
+ Column  4: V4 is V4 (days)(Julian days since 1-Jan-1900)
+ Column  5: V5
+ Column  6: V6
+ Column  7: V7
+ Column  8: V8
+ Column  9: V9
+ Column 10: V10
+ Column 11: V11
+ Column 12: V12
+ Column 13: V13
+ Column 14: V14
+ Column 15: V15
+ Column 16: V16
+ Column 17: V17
+ Column 18: V18
+ Column 19: V19
+ Column 20: V20
+ Column 21: V21
+ Column 22: V22
+ Column 23: V23
+ Column 24: V24
+ Column 25: V25
+ Column 26: V26
+                V1    V2    V3    V4     V5     V6     V7     V8     V9     V10    V11    V12    V13     V14    V15    V16    V17     V18    V19    V20     V21    V22    V23    V24    V25    V26
+1    /  1: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    10.  21.10  35.94  0.000  36.00  0.0000  1.000    10.  224.6  0.0000   0.12  0.000  0.0000  0.000   1.02  0.000  0.116  0.000  2.229
+2    /  2: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    54.  19.89  35.94  0.000  35.00  0.0000  1.000    55.  233.2  0.0000   0.15  0.000  0.0000  0.000   1.04  0.000  0.138  0.000  2.431
+3    /  3: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.    79.  19.01  35.92  0.000  34.00  0.0000  1.000    80.  237.0  0.0000   0.17  0.000  0.0000  0.000   1.04  0.000  0.131  0.000  2.516
+4    /  4: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   104.  18.00  35.86  0.000  33.00  0.0000  1.000   105.  233.8  0.0000   0.19  0.000  0.0000  0.000   1.06  0.000  0.166  0.000  2.650
+5    /  5: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   154.  16.36  35.71  0.000  32.00  0.0000  1.000   155.  230.2  0.0000   0.91  0.000  0.1465  0.000   0.90  0.000  0.266  0.000  2.846
+6    /  6: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   204.  14.85  35.55  0.000  31.00  0.0000  1.000   206.  222.3  0.0000   3.79  0.000  0.0098  0.000   1.44  0.000  0.445  0.000  2.954
+7    /  7: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   253.  13.72  35.38  0.000  29.00  0.0000  1.000   255.  227.6  0.0000   5.53  0.000  0.0098  0.000   1.63  0.000  0.559  0.000  3.006
+8    /  8: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   254.  13.71  35.38  0.000  30.00  0.0000  1.000   256.  227.3  0.0000   5.51  0.000  0.0098  0.000   1.79  0.000  0.555  0.000  2.996
+9    /  9: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   305.  12.62  35.21  0.000  28.00  0.0000  1.000   307.  230.9  0.0000   7.65  0.000  0.0098  0.000   2.16  0.000  0.686  0.000  3.134
+10   / 10: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   353.  12.01  35.12  0.000  27.00  0.0000  1.000   356.  235.4  0.0000   8.72  0.000  0.0098  0.000   2.52  0.000  0.753  0.000  3.190
+11   / 11: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   404.  11.46   ....  9.000  26.00  0.0000  1.000   407.   ....  0.0000   ....  9.000    ....  9.000   ....  9.000   ....  9.000  3.255
+12   / 12: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   452.  11.04  34.96  0.000  25.00  0.0000  1.000   456.  239.9  0.0000  10.95  0.000  0.0000  0.000   3.05  0.000  0.884  0.000  3.245
+13   / 13: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   502.  10.58  34.88  0.000  24.00  0.0000  1.000   506.  241.1  0.0000  12.14  0.000  0.0000  0.000   3.40  0.000  0.959  0.000  3.195
+14   / 14: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   601.   9.80  34.76  0.000  23.00  0.0000  1.000   606.  238.5  0.0000  14.44  0.000  0.0000  0.000   4.27  0.000  1.114  0.000   ....
+15   / 15: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   701.   9.02  34.65  0.000  22.00  0.0000  1.000   707.  229.2  0.0000  17.54  0.000  0.0000  0.000   6.18  0.000  1.312  0.000  2.454
+16   / 16: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   800.   7.69  34.53  0.000  21.00  0.0000  1.000   807.  206.7  0.0000  22.74  0.000  0.0000  0.000  13.22  0.000  1.633  0.000  1.320
+17   / 17: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   899.   6.21  34.44  0.000  20.00  0.0000  1.000   907.  194.6  0.0000  27.29  0.000  0.0000  0.000  23.86  0.000  1.927  0.000  0.732
+18   / 18: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.   999.   4.96  34.41  0.000  19.00  0.0000  1.000  1008.  186.9  0.0000  30.28  0.000  0.0000  0.000  36.39  0.000  2.153  0.000  0.429
+19   / 19: "I8SI9S"  4.000 "B"  34671.  94.99 -30.30  1945.  1098.   4.31  34.44  0.000  18.00  0.0000  1.000  1109.  171.8  0.0000  32.20  0.000  0.0000  0.000  50.45  0.000  2.297  0.000  0.198
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+             V11    V19    V21    V23    V25
+8    /  8:  0.000  0.000  0.000  0.000  0.000
+9    /  9:  0.000  0.000  0.000  0.000  0.000
+10   / 10:  0.000  0.000  0.000  0.000  0.000
+11   / 11:  9.000  9.000  9.000  9.000  9.000
+12   / 12:  0.000  0.000  0.000  0.000  0.000
+13   / 13:  0.000  0.000  0.000  0.000  0.000
+14   / 14:  0.000  0.000  0.000  0.000  0.000
+(set variable/bad=9 v11; set variable/bad=9 v19;set variable/bad=9 v21;set variable/bad=9 v23;set variable/bad=9 v25)
+list/i=8:14 v11,v19,v21,v23,v25
+             DATA SET: ./bn_delimited_read_CO2.dat
+             X: 7.5 to 14.5
+ Column  1: V11
+ Column  2: V19
+ Column  3: V21
+ Column  4: V23
+ Column  5: V25
+              V11    V19     V21     V23     V25
+8    /  8:  0.0000  0.0000  0.0000  0.0000  0.0000
+9    /  9:  0.0000  0.0000  0.0000  0.0000  0.0000
+10   / 10:  0.0000  0.0000  0.0000  0.0000  0.0000
+11   / 11:    ....    ....    ....    ....    ....
+12   / 12:  0.0000  0.0000  0.0000  0.0000  0.0000
+13   / 13:  0.0000  0.0000  0.0000  0.0000  0.0000
+14   / 14:  0.0000  0.0000  0.0000  0.0000  0.0000
+! ... read column headings, only -- 1 record
+define axis/z=1:1:1 z1
+define grid/z=z1 g1
+columns/grid=g1 bn_delimited_read_CO2.dat
+list/nohead v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26
+I / *:    "Cruise" "Station" "Type" "mm/dd/yy" "Lon[E]" "Lat[N]" "BotDep[m]" "Depth[m]" "Temperature[C]" "Salinity" "QF" "Bottle" "QF" "Cast" "Pressure[dbar]" "Oxygen[umol/kg]" "QF" "Nitrate[umol/kg]" "QF" "Nitrite[umol/kg]" "QF" "Silicate[umol/kg]" "QF" "Phosphate[umol/kg]" "QF" "CFC-11[pmol/kg]"
+ 
+! deliberate syntax errors
+set mode ignore
+columns/type="d, da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da2,date2"  bn_delimited_read_date_time.dat
+columns/type="da,da, date2"  bn_delimited_read_date_time.dat
+columns/var="aa.b"  bn_delimited_read_date_time.dat
+file/form=delim/delim="/,,,:" bn_delimited_read_date_time.dat
+cancel mode ignore
+ 
+*** Running test: bn541_bug_fixes.jnl
+! bn541_bug_fixes.jnl
+! test various fixes that went into version 5.41
+! 3/02 *acm*
+!
+go bn_reset
+cancel mode verify
+ 
+! tics on horiz log axes were wrong; (plot only)
+! GO bn_reset
+! tested in bn_logaxes (the plots will be different in 5.40 and 5.41)
+ 
+ 
+!missing vertices in polygon call
+GO bn_reset
+cancel mode verify
+GO err540_polymissing
+! err540_polymissing.jnl
+! 3/02 *acm*
+! A previous fix to polygon cut off loading of poly's if a vertex was
+! missing.  restore old behavior.  (polygon_set_up.F)
+ 
+ 
+use coads_climatology
+let xpts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+x[g=sst,x=110:150,y=20:40,l=1]
+let ypts0=x[g=sst,x=110:150,y=20:40,l=1]*y[g=sst,x=110:150,y=20:40,l=1]*0+y[g=sst,x=110:150,y=20:40,l=1]
+let values0=sst[x=110:150,y=20:40,l=1]
+LET xpts=ysequence(xpts0)
+LET ypts=ysequence(ypts0)
+LET values=ysequence(values0)
+ 
+LET xtriangle = {0,1,2}
+LET ytriangle = {0,2,0}
+LET xvertex = xpts+xtriangle
+LET yvertex = ypts+ytriangle
+polygon xvertex,yvertex,values
+ 
+let xvertex1= IF values NE -1E+34 THEN xvertex
+polygon  xvertex1,yvertex,values
+ 
+! dynamic memory setup for POLYGON
+! GO bn_reset
+! see ~ansley/ans_ferret/users/brockmann/err540/err540_polygon2.jnl
+ 
+! formatting axis label numbers
+GO bn_reset
+cancel mode verify
+GO err540_ill_format.jnl
+! err540_ill_format.jnl
+! 3/02 *acm*
+ 
+!  formatting of small-magnitude negative numbers on axes is wrong
+!  e.g. -0.002 becomes ******
+!  fix in frmt.F
+ 
+plot/i=1:100  0.001 - 0.002/ i
+ 
+plot/trans/i=1:100  0.001 - 0.002/ i
+ 
+ 
+ 
+ 
+! variable permutation in netCDF writes
+GO bn_reset
+cancel mode verify
+GO err540_write_order
+! err540_write_order.jnl
+! *sh* 3/02
+ 
+! the permutation of gridsvariables during writing is inferred *incorrectly*
+! from the context of the first variable only in xeq_list.F
+ 
+! I think (??) that we need to replace this
+!   * ... if no axis order was specified determine the permutation
+!           IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+! with this
+!   * ... if no axis order was specified determine the permutation
+!           DO 200 ilist = 1, num_uvars_in_cmnd
+!              IF (.NOT.permute) CALL GET_CX_DIMS(is_cx(ilist),ndim, perm )
+!              CALL CREATE_PERMUTATION(  memory,
+ 
+ 
+define axis/x=1:2:1 x12
+define axis/y=3:4:1 y34
+define axis/z=5:6:1 z56
+ 
+let yz =              10*y[gy=y34] + 100*z[gz=z56]
+let xyz = x[gx=x12] + 10*y[gy=y34] + 100*z[gz=z56]
+ 
+! before
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+ 
+save/clobber/file=test_good_order.cdf xyz, yz
+save/clobber/file=test_bad_order.cdf yz, xyz
+cancel var/all
+ 
+! after
+use test_good_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_good_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+use test_bad_order
+list xyz
+             VARIABLE : X[GX=X12] + 10*Y[GY=Y34] + 100*Z[GZ=Z56]
+             FILENAME : test_bad_order.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             1      2    
+             1      2
+ ---- K:1 Z:   5
+ 3   / 1:  531.0  532.0
+ 4   / 2:  541.0  542.0
+ ---- K:2 Z:   6
+ 3   / 1:  631.0  632.0
+ 4   / 2:  641.0  642.0
+ 
+sp rm -f test_good_order.cdf
+sp rm -f test_bad_order.cdf
+ 
+!@AVE error when plotting unlike grids together
+GO bn_reset
+cancel mode verify
+GO err540_ax_ave
+!err540_ax_ave.jnl
+! 3/02 *acm
+! @AVE getting wrong set of indices for forming the average, having
+! loaded range of indices on the first plot.  ave_regrid_1_axis.F
+ 
+use coads_climatology
+def axis/edges/t=1:7306:1461/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+def axis/edges/t=1:1600:731/t0="01-jan-0000"/unit=hour t2
+plot/x=140w/y=0/sym/line sst,sst[gt=t2 at ave]
+ 
+!Make PPL AXSET settings persist, but not settings made w/ qualifiers /AXES= or /NOAXES
+GO bn_reset
+cancel mode verify
+GO err540_axset
+!err540_axset.jnl
+! 3/02 *acm
+! backwards compatibility: PPL AXSET settings persist, and
+! PLOT/AXES  or PLOT/NOAXES override these, but only for one plot.
+ 
+! define a 6 viewport window
+def view/xlim=   0,.333/ylim=0,.5 ll6
+def view/xlim=   0,.333/ylim=.5,1 ul6
+def view/xlim=.333,.666/ylim=0,.5 lm6
+def view/xlim=.333,.666/ylim=.5,1 um6
+def view/xlim=.666,   1/ylim=0,.5 lr6
+def view/xlim=.666,   1/ylim=.5,1 ur6
+ 
+SET VIEW ul6;PLOT/NOAXES/I=1:10/TITLE="PLOT/NOAXES" 1./I
+SET VIEW um6;SHADE/I=1:10/J=1:7/TITLE="No qualifiers" I+J
+ 
+PPL AXSET 0,1,1,0
+SET VIEW ur6;FILL/I=1:10/J=1:7/TITLE="with PPL AXSET 0,1,1,0" I+J
+ 
+SET VIEW ll6;CONTOUR/AXES=1,0,0,1/I=1:10/J=1:7/TITLE="CONTOUR/AXES=" I+J
+ 
+SET VIEW lm6;VECTOR/I=1:10/J=1:7/TITLE="Prev. PPL AXSET setting" I+J, I-0.5*J
+ 
+SET VIEW lr6;PLOT/i=1:10/SET/TITLE="plot/SET, new setting" 1./I
+PPL AXSET 0,1,0,0
+PPL PLOT
+ 
+PPL axset 1,1,1,1
+ 
+ 
+!Previously couldn't do PLOT/VS/DASH, but no reason not to allow it.
+GO bn_reset
+cancel mode verify
+GO err540_vs_dash
+! PLOT/VS/DASH  previously was not allowed.
+ 
+define axis/x=20e:10w:10/unit=degree xax
+define axis/y=60s:60n/unit=degree/npoints=41 yax
+define axis/z=0:1000:40/unit=meter/depth zax
+define axis/t=1-jan-1960:15-dec-1999:5/unit=days tax
+define grid/x=xax/y=yax/z=zax/t=tax gformat
+ 
+*  XZ shade with VS/DASH/OVER
+set grid gformat
+shade/y=-60:60/z=0:1000 sin(y/3)*ABS(z)^1.5
+ 
+let ypts = {-60,-50,-40,-30,-20,-10,  0,  8, 15, 30, 35, 40, 60}
+let zpts = {700,667,669,801,732,755,765,789,808,788,822,699,700}
+ 
+plot/vs/over/thick/line/dash ypts,zpts
+plot/vs/over/thick=3/line/dash=0.05,0.05,0.15,0.15 ypts,zpts+100
+ 
+*  XY shade with VS/DASH/OVER
+set grid abstract
+shade/pal=grayscale/x=1:100/y=101:200 sin(x/6)*cos(y/9)
+ 
+let xpts = {  0,  8, 12, 15, 23, 28, 30, 35, 40, 44, 54, 60, 75}
+let ypts = {142,147,149,141,142,155,145,149,148,148,152,146,143}
+ 
+plot/vs/over/thick/color=red/dash xpts,ypts
+plot/vs/over/thick=3/color=red/dash=0.05,0.05,0.15,0.15 xpts+10,ypts+30
+ 
+!  Here, test that settings made with PPL LINE command persist,
+! whereas PLOT/DASH settings do not.
+ 
+let ypts=y[gy=1:80:1]
+ppl line, 2, 0, 4, 0, 0, 0.04, 0.04, 0.15,0.15
+ppl line, 3, 0, 4, 0, 0, 0.2, 0.2, 0.2,0.2
+plot/thick/dash/vlimits=0:1000 50*sin(ypts/3)+100, 30*cos(ypts/3)+200
+plot/over/color=red/thick/dash=0.04,0.04,0.04,0.04 50*sin(ypts/3)+400, 30*cos(ypts/3)+500
+plot/over/thick/dash/color=blue 50*sin(ypts/3)+700, 30*cos(ypts/3)+800, 20*cos(ypts/5)+900, 20*sin(ypts)+950
+ 
+ 
+!overlay on polygon plots
+GO bn_reset
+cancel mode verify
+GO err540_poly_overlay
+!overlay on polygon plots
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! shade/over/i=1:2/j=0:2/patt i+j
+shade/over/i=1:2/j=0:2/opac=25 i+j
+ 
+!polytube failed on plot/over; go polytube, because YAXIS_MIN, _MAX not defined.
+GO bn_reset
+cancel mode verify
+GO err540_axis_symbols
+! err540_axis_symbols.jnl
+! 3/02 *acm*
+! Define YAXIS_MIN and YAXIS_MAX after PPLUS auto-scaling is done.
+! e.g. polytube failed overlaying on PLOT/VS plots, because symbols
+! YAXIS_MIN and YAXIS_MAX or the XAXIS symbols aren't set.
+! Note: when running in the benchmark suite, the go polytube command
+!       causes the job to hang.
+ 
+can var/all
+ 
+let xpts = i[i=1:100]
+set view left
+plot/line/vs xpts, sin(xpts/10)
+sh sym YAXIS_MAX
+YAXIS_MAX = "1.000000"
+!go polytube polygon/over  xpts, sin(xpts/10), sin(xpts/10)
+ 
+set view right
+ 
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = {1,2,3,4,5,1, 2, 3, 4, 5, 1, 2, 3, 4, 5}
+ 
+plot/vs/trans/line xpts,ypts
+sh sym XAXIS_MAX
+XAXIS_MAX = "10.00000"
+!go polytube polygon/trans/over xpts,ypts,zpts
+ 
+!nested repeat loops and parsing parentheses
+GO bn_reset
+cancel mode verify
+GO err540_parse_repeat
+! err540_parse_repeat.jnl
+! 3/03 *acm
+ 
+!yes? rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1              <-----------lots of these
+!-> REPEAT: J=1
+!...
+! **ERROR: stack overflow
+!rep/j=1:1 (rep/j=1:1 (say hello))
+!Command file, command group, or REPEAT execution aborted
+ 
+ 
+!Cause is parsing parentheses in REPEAT section of parse_command.F
+ 
+rep/k=1:2 (rep/j=1:1 (say hello))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+rep/k=1:2 (rep/j=1:1 say hello; say why not)
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+rep/k=1:2 (rep/j=1:1 (say hello; (say why not)))
+!-> REPEAT: K=1
+!-> REPEAT: J=1
+hello
+why not
+!-> REPEAT: K=2
+!-> REPEAT: J=1
+hello
+why not
+ 
+! appending a scalar to NetCDF file
+GO bn_reset
+cancel mode verify
+GO err540_cd_use_recdim
+! err540_cd_use_recdim
+! 3/02 *sh*
+ 
+! crash appending scalar variable into file
+ 
+define axis/x=1:50:1 xprofile
+define axis/y=0:360/npoints=10/edges ylon
+define axis/z=-90:90/npoints=10/edges zlat
+define axis/t=1-jan-1900:31-dec-1995/T0=1-jan-1900/npoints=10/edges tdate
+ 
+let maxprof = 5
+let temp = X[gx=xprofile] + Y[gy=ylon] + Z[gz=zlat] + T[gt=tdate]
+ 
+save/clobber/file=profiles.nc  temp   ! 4D variable
+save/append/file=profiles.nc maxprof  ! append a scalar variable
+ 
+use profiles.nc
+sh data
+     currently SET data sets:
+    1> ./profiles.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     X[GX=XPROFILE] + Y[GY=YLON] + Z  1:50      1:10      1:10      1:10      ...       ...
+ MAXPROF  5                                ...       ...       ...       ...       ...       ...
+ 
+sp rm -f profiles.nc
+ 
+! ================================= quit
+!save/append/file=profiles.nc maxprof
+!
+! LISTing to file profiles.nc
+!Subscript out of range on file cd_use_recdim.F, line 97,
+!procedure cd_use_recdim.
+!Subscript number 1 has value 0 in array vdims.
+!Abort
+ 
+ 
+ 
+ 
+!missing data in xpts,ypts sample points wasnt checked
+go bn_reset
+cancel mode verify
+GO err540_samplexy_missing
+! err540_samplexy_missing.jnl
+! 3/03 *acm
+ 
+! previously missing data in the sample points caused Ferret to hang
+ 
+use coads_climatology
+let asst = samplexy(sst, {171,173,-1.e34}, {-1,1,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,-1.E34}, {-1,1,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00  27.90   ....
+ 15-FEB      / 2:  28.55  28.25   ....
+ 17-MAR      / 3:  28.88  28.48   ....
+ 
+let asst = samplexy(sst, {171,173,169}, {-1,,13})
+list asst
+             VARIABLE : SAMPLEXY(SST, {171,173,169}, {-1,,13})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.00   ....  26.96
+ 15-FEB      / 2:  28.55   ....  26.79
+ 17-MAR      / 3:  28.88   ....  27.11
+ 
+! test the fixed delta stride bug
+go bn_reset
+cancel mode verify
+GO err540_strides_rev.jnl
+! err540_strides_rev.jnl
+ 
+! reported Feb '02
+! fixed April 17, '02
+ 
+! Symptom: plots appear to be "tiled" -- repreating content
+ 
+! file test_100x100 has a diagonal line of 1s in a field of 0s
+sp rm -f test_100x100.nc
+set region/i=1:100/j=1:100
+let a0 = 0
+let a = if i eq j then 1 else a0
+!shade a
+save/file=test_100x100.nc a
+cancel data/all
+cancel var/all
+ 
+! works fine in V5.33
+! try these lines for reference
+!    yes? use test_100x100.nc
+!    yes? shade a
+!    yes? shade a[i=1:100:10]
+ 
+! explanation of bug:
+! Following the implicit regrid in IS_REGRID the resultant cx did not
+! have the delta value(s) removed, so the mr thinks
+! that it is 1:10:10 instead of simply 1:10
+ 
+! this causes an inadequate amount of memory to be allocated and
+! subsequent variables try to occupy the same memory already in use
+! COPY_GRID is where the tiling effect happens, though it is not the
+! cause of the problem
+ 
+set mode stupid
+set mode diag
+set mem/size=0.05
+show mem/free
+ Current size of FERRET memory cache: 0.2 MegaWords  (1 word = 4 bytes)
+            total memory table slots: 500
+            total memory blocks: 2000
+            memory block size: 100
+ 
+            number of free memory blocks: 2000
+            largest free region: 2000
+            number of free regions: 1
+            free memory table slots: 500
+            number of UN-CACHED variables: 0
+ 
+use/ord=x-y test_100x100.nc
+list/prec=1 a[i=1:100:10] !  this looks just right!!
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  1 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  1 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+             VARIABLE : IF I EQ J THEN 1 ELSE A0
+                        regrid: 10 delta on X
+             FILENAME : test_100x100.nc
+             SUBSET   : 10 by 100 points (X-Y)
+               1   11  21  31  41  51  61  71  81  91  
+                1   2   3   4   5   6   7   8   9  10
+ 1     /   1:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 2     /   2:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 3     /   3:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 4     /   4:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 5     /   5:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 6     /   6:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 7     /   7:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 8     /   8:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 9     /   9:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 10    /  10:  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
+ 11    /  11:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 12    /  12:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 13    /  13:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 14    /  14:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 15    /  15:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 16    /  16:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 17    /  17:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 18    /  18:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 19    /  19:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 20    /  20:  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
+ 21    /  21:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 22    /  22:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 23    /  23:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 24    /  24:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 25    /  25:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 26    /  26:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 27    /  27:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 28    /  28:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 29    /  29:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 30    /  30:  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.
+ 31    /  31:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 32    /  32:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 33    /  33:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 34    /  34:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 35    /  35:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 36    /  36:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 37    /  37:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 38    /  38:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 39    /  39:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 40    /  40:  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.
+ 41    /  41:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 42    /  42:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 43    /  43:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 44    /  44:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 45    /  45:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 46    /  46:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 47    /  47:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 48    /  48:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 49    /  49:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 50    /  50:  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
+ 51    /  51:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 52    /  52:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 53    /  53:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 54    /  54:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 55    /  55:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 56    /  56:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 57    /  57:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 58    /  58:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 59    /  59:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 60    /  60:  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
+ 61    /  61:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 62    /  62:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 63    /  63:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 64    /  64:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 65    /  65:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 66    /  66:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 67    /  67:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 68    /  68:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 69    /  69:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 70    /  70:  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.
+ 71    /  71:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 72    /  72:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 73    /  73:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 74    /  74:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 75    /  75:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 76    /  76:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 77    /  77:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 78    /  78:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 79    /  79:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 80    /  80:  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.
+ 81    /  81:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 82    /  82:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 83    /  83:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 84    /  84:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 85    /  85:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 86    /  86:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 87    /  87:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 88    /  88:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 89    /  89:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 90    /  90:  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
+ 91    /  91:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 92    /  92:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 93    /  93:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 94    /  94:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 95    /  95:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 96    /  96:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 97    /  97:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 98    /  98:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 99    /  99:  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+ 100   / 100:  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ (AX003)   X                   10 r   1                    91
+ YAX1_100  Y                  100 r   1                    100
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! should be a diagonal path of steps all the way across the plot
+shade a[i=1:100:10]
+ eval    EX#1     C:  4 dset:   1 I:    1  100  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+ strip regrid on X: A --> (G003)           @XACT
+ strip reversing A on Y axis:     1   100 dset:   1
+ rdstride A        C:  8 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing reversing A on Y axis:     1   100 dset:   1
+ -DELETE A        M:  2 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  A        M:  2 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE A        M:  3 dset:   1 I:    1   91  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G003)          (AX003)   YAX1_100  NORMAL    NORMAL    NORMAL    NORMAL
+setting up 2D plot
+ -DELETE A        M:  3 dset:   1 I:    1   10  J:    1  100  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+PPL plot 26   complete
+ppl list stats
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+ppl list data  ! make screen wide -- shows the 1's matching the plot
+
+
+         DATA OF TYPE CONTOUR                       
+                   MIN            MAX
+         X     1.0000E+00     9.1000E+01
+         Y     1.0000E+00     1.0000E+02
+         Z     0.0000E+00     1.0000E+00
+         NX=  10 NY= 100
+                  1         2         3         4         5         6         7
+           1  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          30  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+         100  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
+
+
+                  8         9        10
+           1  0.00E+00  0.00E+00  0.00E+00
+           2  0.00E+00  0.00E+00  0.00E+00
+           3  0.00E+00  0.00E+00  0.00E+00
+           4  0.00E+00  0.00E+00  0.00E+00
+           5  0.00E+00  0.00E+00  0.00E+00
+           6  0.00E+00  0.00E+00  0.00E+00
+           7  0.00E+00  0.00E+00  0.00E+00
+           8  0.00E+00  0.00E+00  0.00E+00
+           9  0.00E+00  0.00E+00  0.00E+00
+          10  0.00E+00  0.00E+00  1.00E+00
+          11  0.00E+00  0.00E+00  0.00E+00
+          12  0.00E+00  0.00E+00  0.00E+00
+          13  0.00E+00  0.00E+00  0.00E+00
+          14  0.00E+00  0.00E+00  0.00E+00
+          15  0.00E+00  0.00E+00  0.00E+00
+          16  0.00E+00  0.00E+00  0.00E+00
+          17  0.00E+00  0.00E+00  0.00E+00
+          18  0.00E+00  0.00E+00  0.00E+00
+          19  0.00E+00  0.00E+00  0.00E+00
+          20  0.00E+00  1.00E+00  0.00E+00
+          21  0.00E+00  0.00E+00  0.00E+00
+          22  0.00E+00  0.00E+00  0.00E+00
+          23  0.00E+00  0.00E+00  0.00E+00
+          24  0.00E+00  0.00E+00  0.00E+00
+          25  0.00E+00  0.00E+00  0.00E+00
+          26  0.00E+00  0.00E+00  0.00E+00
+          27  0.00E+00  0.00E+00  0.00E+00
+          28  0.00E+00  0.00E+00  0.00E+00
+          29  0.00E+00  0.00E+00  0.00E+00
+          30  1.00E+00  0.00E+00  0.00E+00
+          31  0.00E+00  0.00E+00  0.00E+00
+          32  0.00E+00  0.00E+00  0.00E+00
+          33  0.00E+00  0.00E+00  0.00E+00
+          34  0.00E+00  0.00E+00  0.00E+00
+          35  0.00E+00  0.00E+00  0.00E+00
+          36  0.00E+00  0.00E+00  0.00E+00
+          37  0.00E+00  0.00E+00  0.00E+00
+          38  0.00E+00  0.00E+00  0.00E+00
+          39  0.00E+00  0.00E+00  0.00E+00
+          40  0.00E+00  0.00E+00  0.00E+00
+          41  0.00E+00  0.00E+00  0.00E+00
+          42  0.00E+00  0.00E+00  0.00E+00
+          43  0.00E+00  0.00E+00  0.00E+00
+          44  0.00E+00  0.00E+00  0.00E+00
+          45  0.00E+00  0.00E+00  0.00E+00
+          46  0.00E+00  0.00E+00  0.00E+00
+          47  0.00E+00  0.00E+00  0.00E+00
+          48  0.00E+00  0.00E+00  0.00E+00
+          49  0.00E+00  0.00E+00  0.00E+00
+          50  0.00E+00  0.00E+00  0.00E+00
+          51  0.00E+00  0.00E+00  0.00E+00
+          52  0.00E+00  0.00E+00  0.00E+00
+          53  0.00E+00  0.00E+00  0.00E+00
+          54  0.00E+00  0.00E+00  0.00E+00
+          55  0.00E+00  0.00E+00  0.00E+00
+          56  0.00E+00  0.00E+00  0.00E+00
+          57  0.00E+00  0.00E+00  0.00E+00
+          58  0.00E+00  0.00E+00  0.00E+00
+          59  0.00E+00  0.00E+00  0.00E+00
+          60  0.00E+00  0.00E+00  0.00E+00
+          61  0.00E+00  0.00E+00  0.00E+00
+          62  0.00E+00  0.00E+00  0.00E+00
+          63  0.00E+00  0.00E+00  0.00E+00
+          64  0.00E+00  0.00E+00  0.00E+00
+          65  0.00E+00  0.00E+00  0.00E+00
+          66  0.00E+00  0.00E+00  0.00E+00
+          67  0.00E+00  0.00E+00  0.00E+00
+          68  0.00E+00  0.00E+00  0.00E+00
+          69  0.00E+00  0.00E+00  0.00E+00
+          70  0.00E+00  0.00E+00  0.00E+00
+          71  0.00E+00  0.00E+00  0.00E+00
+          72  0.00E+00  0.00E+00  0.00E+00
+          73  0.00E+00  0.00E+00  0.00E+00
+          74  0.00E+00  0.00E+00  0.00E+00
+          75  0.00E+00  0.00E+00  0.00E+00
+          76  0.00E+00  0.00E+00  0.00E+00
+          77  0.00E+00  0.00E+00  0.00E+00
+          78  0.00E+00  0.00E+00  0.00E+00
+          79  0.00E+00  0.00E+00  0.00E+00
+          80  0.00E+00  0.00E+00  0.00E+00
+          81  0.00E+00  0.00E+00  0.00E+00
+          82  0.00E+00  0.00E+00  0.00E+00
+          83  0.00E+00  0.00E+00  0.00E+00
+          84  0.00E+00  0.00E+00  0.00E+00
+          85  0.00E+00  0.00E+00  0.00E+00
+          86  0.00E+00  0.00E+00  0.00E+00
+          87  0.00E+00  0.00E+00  0.00E+00
+          88  0.00E+00  0.00E+00  0.00E+00
+          89  0.00E+00  0.00E+00  0.00E+00
+          90  0.00E+00  0.00E+00  0.00E+00
+          91  0.00E+00  0.00E+00  0.00E+00
+          92  0.00E+00  0.00E+00  0.00E+00
+          93  0.00E+00  0.00E+00  0.00E+00
+          94  0.00E+00  0.00E+00  0.00E+00
+          95  0.00E+00  0.00E+00  0.00E+00
+          96  0.00E+00  0.00E+00  0.00E+00
+          97  0.00E+00  0.00E+00  0.00E+00
+          98  0.00E+00  0.00E+00  0.00E+00
+          99  0.00E+00  0.00E+00  0.00E+00
+         100  0.00E+00  0.00E+00  0.00E+00
+
+
+ 
+can mode stupid
+can mode diag
+set mem/size=25.6
+ 
+! unknown data type for clauses with constants only
+go bn_reset
+cancel mode verify
+GO err540_data_type.jnl
+! err540_data_type
+! 2/19/02 *sh*
+ 
+! Ferret fails to identifies the data type and gets
+! "**ERROR: illegal data type (float,string,...) for operation: A"
+ 
+! in disp_data_set_up XEQ_PLOT is insisting on ptype_float.
+! The type that is coming back from "a" is "0" (ptype_unknown)
+ 
+! The problem is that uvar_data_type(uvar=1="A", dset=0) is ptype_unknown=0
+! this is happening because its correct value is lost in IS_UVAR_GRID
+ 
+! solved 4/02:
+! The constant ("1") was being ignored -- needed to get its data type
+! change to IS_UVAR_GRID.F
+ 
+! Note - initial soln lead to further problems to resolve for
+!        IF cond THEN pseudo + const
+ 
+!set mode diag
+ 
+! bad
+plot IF {1,3,5} GE 3 THEN 1  ! data type unknown
+ 
+! ok  -- no error if constant is buried within a user variable
+!let V = 1
+!plot IF {1,3,5} GE 3 THEN v
+ 
+ 
+! gridding scattered points to modulo axis had bug
+go bn_reset
+cancel mode verify
+GO err540_modscat.jnl
+! test gridding scattered points to modulo axis.
+! Show Southern hemisphere.
+ 
+use coads_climatology
+ 
+let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
+let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])
+ 
+def axis/x=180w:180e:1/modulo xax
+def axis/y=-89:0:1 yax
+def grid/x=xax/y=yax mygrid
+ 
+let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)
+ 
+let b = if sst[l=1,gx=mygrid,gy=mygrid] then a
+ 
+shade b
+plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
+ 
+! make sure the USE bug reported 5/01 by A Wittenberg is fixed
+GO bn_reset
+cancel mode verify
+GO err540_use.jnl
+! err540_use.jnl
+!
+! very subtle bug fix in the "USE" command.  What would happen is if dataset A and
+! dataset B were "used", then dset A was cancelled, if the next dataset (dataset C)
+! "used" had a similarly named variable as dataset B, then Ferret would mistakingly
+! set the similarly named variable in dataset C to lower case, making it inaccessible.
+! This was because the logic in cd_scan_vars.F didn't take into account that variables from
+! different datasets may be overlapped in the ds_var_code array.
+ 
+! Create three simple files containing variables with lowercase names.
+let a = 1
+let b = 2
+save/q/clob/file=f.nc a
+save/q/clob/file=f2.nc a,b
+save/q/clob/file=g.nc b
+can var a b
+ 
+sp ncrename -h -v A,a f.nc
+sp ncrename -h -v A,a -v B,b f2.nc
+sp ncrename -h -v B,b g.nc
+use f.nc
+use f2.nc
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./f2.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    3> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can data/all
+ 
+! Use two of the files and cancel the first one.
+use f.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+use g.nc
+sh data
+     currently SET data sets:
+    1> ./f.nc
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+can dat 1
+ 
+! Now open the f2 file which as both a and b variables
+use f2.nc
+ 
+! All variables from BOTH datasets should be capitals.
+show dat
+     currently SET data sets:
+    1> ./f2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        1                                ...       ...       ...       ...       ...       ...
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+    2> ./g.nc
+ name     title                             I         J         K         L         M         N
+ B        2                                ...       ...       ...       ...       ...       ...
+ 
+ 
+! This should work
+list b[d=1]
+             VARIABLE : 2
+             FILENAME : f2.nc
+          2.000
+ 
+ 
+*** Running test: bn_cancel_axes.jnl
+! bn_cancel_axes.jnl
+ 
+let ind1 = 1*i
+let tim1 = 20500*randu(ind1[i=1:20500])
+let ind2 = sorti(tim1)
+let tim2 = samplei(tim1, ind2)
+list/format=comma/file=longax.dat/clobber tim2
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+ 
+go bn_reset
+cancel mode verify
+! longax cancel axis axname
+repeat/k=1:10 go bn_cancel_axes_1.sub
+!-> REPEAT: K=1
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=2
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=3
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=4
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=5
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=6
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=7
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=8
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=9
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+!-> REPEAT: K=10
+! cancel axis axname
+! Defining lots of irregular axes, used up coordinate storage.
+! Now coordinage storage is recovered; also have the option to cancel axis/all
+ 
+set data/skip=4/ez/col=2/var="cnt,tim" longax.dat
+def axis/from_data/t/units=days tim_ax=tim
+def grid/t=tim_ax tim_grd
+can grid tim_grd
+can axis tim_ax
+can data longax.dat
+ 
+ 
+ go bn_reset
+cancel mode verify
+! longax cancel axis/all
+ 
+! Note: cancel axes/all tested in err541_cancel_axes.jnl
+!     Here, it causes huge output because previous benchmarks
+!     leave lots of grids defined.
+! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)
+ 
+! test remaining axes are intact when we cancel one.
+go bn_reset
+cancel mode verify
+define axis/x ax1={2,4,5,6,9}
+define axis/x ax2={30,60,90,100}
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+can axis ax1
+sh axis/x ax2
+ name       axis              # pts   start                end
+ AX2       X                    4 i   30                   100
+   Axis span (to cell edges) = 90
+ 
+       I     X                   XBOX      XBOXLO
+       1>  30                    30         15
+       2>  60                    30         45
+       3>  90                    20         75
+       4>  100                   10         95
+ 
+! Test interaction with irreg axes from datasets
+ 
+use test_axes
+cancel data test_axes
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+can axis ax1
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+       1>  16-JAN 12:00:00       31         01-JAN 00:00:00         15.5
+       2>  15-FEB 02:54:36       28.2425    01-FEB 00:00:00         45.12125
+       3>  15-MAR 17:49:12       31         29-FEB 05:49:12         74.7425
+       4>  15-APR 05:49:12       30         31-MAR 05:49:12         105.2425
+       5>  15-MAY 17:49:12       31         30-APR 05:49:12         135.7425
+       6>  15-JUN 05:49:12       30         31-MAY 05:49:12         166.2425
+       7>  15-JUL 17:49:12       31         30-JUN 05:49:12         196.7425
+       8>  15-AUG 17:49:12       31         31-JUL 05:49:12         227.7425
+       9>  15-SEP 05:49:12       30         31-AUG 05:49:12         258.2425
+      10>  15-OCT 17:49:12       31         30-SEP 05:49:12         288.7425
+      11>  15-NOV 05:49:12       30         31-OCT 05:49:12         319.2425
+      12>  15-DEC 17:49:12       31         30-NOV 05:49:12         349.7425
+ 
+cancel axis test_irreg
+ 
+def axis/x ax1 = {1, 3, 4, 5, 9}
+sh axis/x ax1
+ name       axis              # pts   start                end
+ AX1       X                    5 i   1                    9
+   Axis span (to cell edges) = 11
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     2          0
+       2>  3                     1.5        2
+       3>  4                     1          3.5
+       4>  5                     2.5        4.5
+       5>  9                     4          7
+can axis ax1
+ 
+sh axis/t test_irreg
+ name       axis              # pts   start                end
+sh axis/t test_seas
+ name       axis              # pts   start                end
+ TEST_SEAS TIME                 4mr   15-FEB 15:43         15-NOV 14:05
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 8765.82 (modulo length = axis span)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (HOURS)
+       1>  15-FEB 15:43:39       2191.455   01-JAN 00:00:00        1095.727
+       2>  16-MAY 23:10:57       2191.455   01-APR 07:27:18        3287.182
+       3>  16-AUG 06:38:15       2191.455   01-JUL 14:54:36        5478.637
+       4>  15-NOV 14:05:33       2191.455   30-SEP 22:21:54        7670.092
+ 
+*** Running test: bn542_bug_fixes.jnl
+! bn542_bug_fixes.jnl
+! test various fixes that went into version 5.42
+! 10/02 *acm*
+!
+ 
+! Interior tics disappear on FILL plots
+GO bn_reset
+cancel mode verify
+GO err541_fill_tics
+! pplus tics bug - pre 5.42, fill plots overlaid interior tics.
+ 
+use coads_climatology
+ppl tics 0.,.35,0.,.35,0,0
+ 
+set view upper
+shade/l=1/x=150e:110w/y=40s:40n sst
+ 
+set view lower
+fill/l=1/x=150e:110w/y=40s:40n sst
+ 
+ppl tics,,.25,,.25,-1,-1
+ 
+! non-Gregorian axes not properly defined when time steps
+! are used rather than date specifications
+GO bn_reset
+cancel mode verify
+GO err541_non_gregorian
+!From Andrew Wittenberg, non-Gregorian time axis bug 01 Oct 2002
+! pre-542, second axis has just one point.
+ 
+def ax/cal=Gregorian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax1
+show ax tax2
+ name       axis              # pts   start                end
+ 
+def ax/cal=Julian/t=.5:11.5:1/unit=month/t0=1-jan-1980 tax2
+show ax tax2
+ name       axis              # pts   start                end
+ TAX2      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+! For comparison, use the dates that start and end tax2
+def ax/cal=Julian/t="16-jan-1980:05:15":"16-dec-1980:00:45":1/unit=month/t0=1-jan-1980 tax3
+show ax tax3
+ name       axis              # pts   start                end
+ TAX3      TIME                12 r   16-JAN-1980 05:15    16-DEC-1980 00:45
+T0 = 1-JAN-1980
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 12
+ 
+ 
+! Could not write or read a NetCDF file with a 4-D string variable.
+GO bn_reset
+cancel mode verify
+GO err541_string4d
+ ! Write a 4-D NetCDF file with a string variable.
+ 
+sp rm -f string4d.nc
+ 
+def axis/x=1:2:1 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1 z4ax
+def axis/t=1:2:1 t2ax
+ 
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+ 
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+stat rvar
+ 
+             X[GX=X2AX] + Y[GY=Y3AX] + Z[GZ=Z4AX] + T[GT=T2AX]
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 48 (2*3*4*2*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 4
+ Maximum value: 11
+ Mean    value: 7.5 (unweighted average)
+ Standard deviation: 1.571
+ 
+let axy = reshape (a,rvar)
+!list axy
+stat axy
+ 
+             RESHAPE (A,RVAR)
+             X: 0.5 to 2.5
+             Y: 0.5 to 3.5
+             Z: 0.5 to 4.5
+             T: 0.5 to 2.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ Total # of strings: 48 (2*3*4*2*1*1)
+ Maximum string length: 5
+save/clobber/file=string4d.nc axy
+ 
+can var/all
+can data/all
+use string4d.nc
+sh data
+     currently SET data sets:
+    1> ./string4d.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AXY      RESHAPE (A,RVAR)                 1:2       1:3       1:4       1:2       ...       ...
+ 
+list axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 3 by 4 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ 3   / 3:"a5"   "a6"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ 3   / 3:"bravo""b2"   
+ ---- K:3 Z:   3
+ 1   / 1:"b3"   "b4"   
+ 2   / 2:"b5"   "b6"   
+ 3   / 3:"b7"   "b8"   
+ ---- K:4 Z:   4
+ 1   / 1:"b9"   "b10"  
+ 2   / 2:"c1"   "c2"   
+ 3   / 3:"c3"   "c4"   
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ 3   / 3:"c9"   "c10"  
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+ 3   / 3:"d5"   "d6"   
+ ---- K:3 Z:   3
+ 1   / 1:"d7"   "d8"   
+ 2   / 2:"d9"   "d10"  
+ 3   / 3:"echo" "e2"   
+ ---- K:4 Z:   4
+ 1   / 1:"e3"   "e4"   
+ 2   / 2:"e5"   "e6"   
+ 3   / 3:"e7"   "e8"   
+ 
+ 
+! Cancel axis/all did not check whether axes were in use
+GO bn_reset
+cancel mode verify
+GO err541_cancel_axes
+! Check that an axis in use cannot be cancelled.
+! 4/2013 changes for Ferret with climatological axes
+!        defined internally. Use a different datset for this test
+ 
+use test_axes
+cancel data test_axes
+ 
+let tt = t[gt=test_irreg] + 50*x[i=1:10]
+load tt
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+cancel axis test_irreg
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+! Pre V5.42, this causes a crash: axes were cancelled, but not fully.
+cancel axis/all
+show axis test_i*
+ name       axis              # pts   start                end
+ TEST_IRREG TIME               12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+ 
+cancel var tt
+cancel axis/all
+ 
+show axis test_i*
+ name       axis              # pts   start                end
+ 
+ 
+ 
+! Make sure delimited reads are processing dates correctly
+! *kob*
+! 5/4/05 *acm* Move to bn_ef_err541_date_delim; pulling all jnls that call shared-obj efs out
+GO bn_reset
+cancel mode verify
+! GO err541_date_delim
+ 
+*** Running test: bn_subspan_modulo.jnl
+! bn_subspan_modulo.jnl
+! *sh* 11/02
+ 
+! a subspan modulo axis is one which is modulo, but the wrapping length
+! exceeds the span of the axis.  Ferret generates a phantom "void point"
+! in order to bring the axis length equal to the modulo length.  The void
+! point is automatically filled with a missing value (psuedo-vars excluded)
+ 
+! test defining of subspan modulo axes
+! any longitude axis less than 360 degrees
+define axis/x=130e:80w:10 xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE           16mr   130E                 80W
+   Axis span (to cell edges) = 160 (modulo length = 360)
+define axis/x=-180:179:1/units=longitude/edges xsub ! yes
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          359mr   179.5W(-179.5)       178.5E
+   Axis span (to cell edges) = 359 (modulo length = 360)
+define axis/x=-180:181:1/units=longitude/edges xsub ! no
+GO bn_subspan_modulo.sub1 X
+Axis as created:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ XSUB      LONGITUDE          361 r   179.5W(-179.5)       179.5W
+   Axis span (to cell edges) = 361
+ 
+! not allowed for axis length to exceed modulo length
+set mode ignore
+  define axis/x=130e:500:10/modulo=360 xsub
+canc mode ignore
+ 
+! automatic detection of climatologies
+def ax/t=1-jan-0000:1-apr-0000/np=3 tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-APR 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 3276 (modulo length = 8765.82)
+def ax/t=1-jan-0000:1-apr-0000/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   16-JAN 04:00         16-MAR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 91 (modulo length = 365.2425)
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 20:00         01-JUN 04:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   30-SEP 19:59         01-JUN 04:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365 (modulo length = 365.2425)
+def ax/t=31-dec-0000:1-may-0001/np=3/units=days tsub ! yes
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   31-DEC 00:00         01-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 181.5 (modulo length = 365.2425)
+! the following start in year 0001
+def ax/t=31-dec-0000:1-may-0001/np=3/edges/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   20-JAN-0001 04:00    10-APR-0001 20:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 121
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   20-JAN 04:00         10-APR 19:59
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 121 (modulo length = 365.2425)
+def ax/t=1-jan-0001:1-sep-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   01-JAN-0001 00:00    01-SEP-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 364.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3mr   01-JAN 00:00         01-SEP 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 364.5 (modulo length = 365.2425)
+! the following is too long to be a climatological axis
+def ax/t=29-dec-0000:31-dec-0001/np=3/units=days tsub ! no
+GO bn_subspan_modulo.sub1 T
+Axis as created:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 550.5
+Axis as inferred from netCDF file:
+ name       axis              # pts   start                end
+ TSUB      TIME                 3 r   29-DEC-0000 00:00    31-DEC-0001 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 550.5
+ 
+ 
+! now test Ferret handling of the axes
+! make a test file with a subspan modulo variable
+! (need to postpone setting /modulo=100 cuz pseudo-vars have value on void pt)
+sp rm -f test_subspan_modulo.nc
+define axis/x=41:46:1/modulo=100 xax_subspan
+ 
+! almost identical irregular axis
+define axis/x/modulo=100 Xirreg_subspan = {41,42,42.1,44,45,46}
+set axis/modulo=100 Xirreg_subspan
+ 
+let vreg = X[gx=xax_subspan] -40 + 10
+let virr = X[gx=Xirreg_subspan] -40 + 10
+save/file=test_subspan_modulo.nc vreg, virr
+ 
+! noisy field to test smoothing
+let noise = 0.2 * RANDN(0*vreg+1)
+let vreg_ragged = vreg + noise
+let virr_ragged = virr + noise[g=virr at asn]
+save/file=test_subspan_modulo.nc/append vreg_ragged, virr_ragged
+ 
+! gappy field to test hole-filling
+let vreg_void = if x[g=vreg] LT 43 OR x[g=vreg] GT 45 THEN vreg
+let virr_void = if x[g=virr] LT 43 OR x[g=virr] GT 45 THEN virr
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+save/file=test_subspan_modulo.nc/append vreg_void, virr_void
+ 
+! now define two-dimensional variables -- modulo in time as well
+define axis/t=0:150:30/edges/units=days/modulo=365.2485/t0=1-jan-0000 tax_subspan
+define axis/T0=1-jan-0000/units=days/modulo=365.2485/edges Tirreg_subspan = {0,31,59.2485,90.2485,120.2485,150.2485}
+let treg = TBOXLO[gt=tax_subspan]
+let tirr = TBOXLO[gt=tirreg_subspan]
+let v2d_reg = vreg + treg
+let v2d_irr = virr + tirr
+save/file=test_subspan_modulo.nc/append v2d_reg, v2d_irr
+ 
+! 2d with voids
+let treg_void =  if L[g=v2d_reg] NE 3 THEN treg
+let tirr_void =  if L[g=v2d_irr] NE 3 THEN tirr
+let v2d_reg_void = vreg_void + treg_void
+let v2d_irr_void = virr_void + tirr_void
+save/file=test_subspan_modulo.nc/append v2d_reg_void, v2d_irr_void
+ 
+! string variable on subspan modulo axis
+let my_strings = {"a1","a2","a3","a4","a5","a6"}
+let vreg_strings = my_strings[gx=xax_subspan at asn]
+let virr_strings = my_strings[gx=Xirreg_subspan at asn]
+save/file=test_subspan_modulo.nc/append vreg_strings, virr_strings
+ 
+canc var/all
+use test_subspan_modulo.nc
+ 
+go bn_subspan_modulo.sub2 vreg v2d_reg
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XAX_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   1          -58.5
+      -4>  -57                   1          -57.5
+      -3>  -56                   1          -56.5
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    1          41.5
+       3>  43                    1          42.5
+       4>  44                    1          43.5
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   1          -58.5
+      -3>  -56                   1          -56.5
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  43                    1          42.5
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XAX_SUBSPAN
+ name       axis              # pts   start                end
+ XAX_SUBSPAN X                  6mr   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TAX_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       4>  15-APR 00:00:00       30         31-MAR 00:00:00         105
+       5>  15-MAY 00:00:00       30         30-APR 00:00:00         135
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       7>  15-JAN 05:57:50       30         31-DEC 05:57:50         380.2485
+       8>  14-FEB 05:57:50       30         30-JAN 05:57:50         410.2485
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+      10>  15-APR 05:57:50       30         31-MAR 05:57:50         470.2485
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       6>  14-SEP 14:58:55       215.2485   30-MAY 00:00:00         257.6242
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TAX_SUBSPAN1
+ name       axis              # pts   start                end
+ TAX_SUBSPAN1 TIME              5mr   16-JAN 00:00         15-MAY 00:00
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  16-MAR 00:00:00       30         01-MAR 00:00:00         75
+       9>  16-MAR 05:57:50       30         01-MAR 05:57:50         440.2485
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x vreg
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ1            XAX_SUBSPANORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VREG     M:  2 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XAX_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+           41     42     43     44     45     46    
+            1      2      3      4      5      6
+          11.00  12.00  13.00  14.00  15.00  16.00
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     7     7 dset:   1
+ reading VREG     M:  1 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     0 dset:   1
+ reading VREG     M:  5 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VREG on X axis:     5     7 dset:   1
+ reading VREG     M:  3 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VREG on X axis:     5     6 dset:   1
+          15.00  16.00   ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 vreg
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VREG on X axis:     0     7 dset:   1
+ reading VREG     M:  8 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VREG on X axis:     1     6 dset:   1
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 vreg
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 vreg
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 vreg
+      ... listing every   2th point
+       .   ....  12.00  14.00  16.00  11.00  13.00  15.00   ....  12.00  14.00  16.00
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 vreg
+          16.00   ....  11.00  12.00  13.00  14.00  15.00
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 vreg
+           ....  11.00  12.00  13.00  14.00  15.00
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 vreg
+          11.00  12.00  13.00  14.00  15.00
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 vreg
+          13.00  14.00  15.00  16.00
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 vreg
+          13.00  14.00  15.00  16.00   ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 vreg
+          13.00  14.00  15.00  16.00   ....  11.00
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 vreg_ragged
+             VARIABLE : VREG + NOISE
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5  541    542    543    544    545    546    593.5 
+           35     36     37     38     39     40     41     42
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 vreg_ragged[x=@sbx]
+          15.06   ....   ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 vreg_ragged
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  vreg_ragged[x=@sbx]
+           ....   ....  11.98  13.08  14.04  15.06
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     vreg_ragged[x=@sbx]
+          14.04  15.06   ....   ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged
+           ....  10.95  12.06  12.94  14.24  14.94  15.99   ....  10.95  12.06  12.94  14.24  14.94  15.99   ....  10.95  12.06
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@sbx:3]
+           ....   ....  11.98  13.08  14.04  15.06   ....   ....   ....  11.98  13.08  14.04  15.06   ....   ....   ....  11.98
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:5]
+           ....   ....   ....  13.04  14.04   ....   ....   ....   ....   ....  13.04  14.04   ....   ....   ....   ....   ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 vreg_void
+             VARIABLE : IF X[G=VREG] LT 43 OR X[G=VREG] GT 45 THEN VREG
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+           493.5  541    542    543    544    545    546    593.5 
+           35     36     37     38     39     40     41     42
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fav]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fav]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:3]
+           ....  11.00  12.00  12.00   ....  16.00  16.00   ....  11.00  12.00  12.00   ....  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:5]
+           ....  11.00  12.00  11.50  14.00  16.00  16.00   ....  11.00  12.00  11.50  14.00  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fav:35]
+           ....  11.00  12.00  13.00  13.00  13.00  16.00   ....  11.00  12.00  13.00  13.00  13.00  16.00   ....  11.00  12.00
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fln]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fln]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fln:35]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 vreg_void[x=@fnr]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    vreg_void[x=@fnr]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void
+           ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00   ....   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 vreg_void[x=@fnr:35]
+           ....  11.00  12.00  12.00  14.00  16.00  16.00   ....  11.00  12.00  12.00  14.00  16.00  16.00   ....  11.00  12.00
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_reg
+ 16-JAN      / 1:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0
+ 15-FEB      / 2:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      / 3:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      / 4:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      / 5:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_reg
+ 16-JAN      /  1:   11.0   12.0   13.0   14.0   15.0   16.0
+ 15-FEB      /  2:   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      /  3:   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      /  4:  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      /  5:  131.0  132.0  133.0  134.0  135.0  136.0
+ 14-SEP      /  6:   ....   ....   ....   ....   ....   ....
+ 15-JAN      /  7:   11.0   12.0   13.0   14.0   15.0   16.0
+ 14-FEB      /  8:   41.0   42.0   43.0   44.0   45.0   46.0
+ 16-MAR      /  9:   71.0   72.0   73.0   74.0   75.0   76.0
+ 15-APR      / 10:  101.0  102.0  103.0  104.0  105.0  106.0
+ 15-MAY      / 11:  131.0  132.0  133.0  134.0  135.0  136.0
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_reg
+ 16-JAN      /  1:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0
+ 15-FEB      /  2:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0
+ 16-MAR      /  3:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0
+ 15-APR      /  4:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0
+ 15-MAY      /  5:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0
+ 14-SEP      /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN      /  7:   11.0   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0
+ 14-FEB      /  8:   41.0   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0
+ 16-MAR      /  9:   71.0   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0
+ 15-APR      / 10:  101.0  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0
+ 15-MAY      / 11:  131.0  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0
+ 14-FEB-0002 / 14:   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0
+ 16-MAR-0002 / 15:   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0
+ 15-APR-0002 / 16:  102.0  103.0  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0
+ 15-MAY-0002 / 17:  132.0  133.0  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   13.0   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0
+ 14-FEB-0003 / 20:   42.0   43.0   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0
+ 16-MAR-0003 / 21:   72.0   73.0   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   ....   ....   ....   16.0   ....   11.0   12.0   ....   ....   ....
+ 14-FEB-0002 / 14:   42.0   ....   ....   ....   46.0   ....   41.0   42.0   ....   ....   ....
+ 16-MAR-0002 / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-APR-0002 / 16:  102.0   ....   ....   ....  106.0   ....  101.0  102.0   ....   ....   ....
+ 15-MAY-0002 / 17:  132.0   ....   ....   ....  136.0   ....  131.0  132.0   ....   ....   ....
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   ....   ....   ....   16.0   ....   11.0   12.0   ....   ....   ....
+ 14-FEB-0003 / 20:   42.0   ....   ....   ....   46.0   ....   41.0   42.0   ....   ....   ....
+ 16-MAR-0003 / 21:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg_void[x=@fnr,t=@fnr]
+ 14-SEP      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 / 13:   12.0   12.0   14.0   16.0   16.0   ....   11.0   12.0   12.0   14.0   16.0
+ 14-FEB-0002 / 14:   42.0   42.0   44.0   46.0   46.0   ....   41.0   42.0   42.0   44.0   46.0
+ 16-MAR-0002 / 15:   72.0   72.0   74.0   76.0   76.0   ....   71.0   72.0   72.0   74.0   76.0
+ 15-APR-0002 / 16:  102.0  102.0  104.0  106.0  106.0   ....  101.0  102.0  102.0  104.0  106.0
+ 15-MAY-0002 / 17:  132.0  132.0  134.0  136.0  136.0   ....  131.0  132.0  132.0  134.0  136.0
+ 15-SEP-0002 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0003 / 19:   12.0   12.0   14.0   16.0   16.0   ....   11.0   12.0   12.0   14.0   16.0
+ 14-FEB-0003 / 20:   42.0   42.0   44.0   46.0   46.0   ....   41.0   42.0   42.0   44.0   46.0
+ 16-MAR-0003 / 21:   72.0   72.0   74.0   76.0   76.0   ....   71.0   72.0   72.0   74.0   76.0
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_reg[x=@shf:2,t=@shf:-2]
+ 14-SEP      / 12:  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0   ....
+ 15-JAN-0002 / 13:  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0   ....
+ 14-FEB-0002 / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0002 / 15:   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0   ....
+ 15-APR-0002 / 16:   44.0   45.0   46.0   ....   41.0   42.0   43.0   44.0   45.0   46.0   ....
+ 15-MAY-0002 / 17:   74.0   75.0   76.0   ....   71.0   72.0   73.0   74.0   75.0   76.0   ....
+ 15-SEP-0002 / 18:  104.0  105.0  106.0   ....  101.0  102.0  103.0  104.0  105.0  106.0   ....
+ 15-JAN-0003 / 19:  134.0  135.0  136.0   ....  131.0  132.0  133.0  134.0  135.0  136.0   ....
+ 14-FEB-0003 / 20:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0003 / 21:   14.0   15.0   16.0   ....   11.0   12.0   13.0   14.0   15.0   16.0   ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14]
+           ....  11.00  12.00  13.00  14.00  15.00  16.00   ....  11.00  12.00  13.00  14.00  15.00  16.00   ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ3            XAX_SUBSPANORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ dealloc  dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ strip regrid on X: V2D_REG --> (G004)           @XACT
+ found   V2D_REG  M: 69 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_REG  M: 70 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G004)          (AX002)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+           ....  12.00  14.00  16.00  11.00  13.00  15.00   ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_reg[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:2]
+ dealloc  dynamic grid (G004)          (AX001)   NORMAL    NORMAL    TAX_SUBSPANORMAL    NORMAL
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ dealloc  dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ strip regrid on T: V2D_REG --> (G004)           @XACT
+ strip moduloing V2D_REG on T axis:     1    15 dset:   1
+ rdstride V2D_REG  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_REG on T axis:     1     5 dset:   1
+ -DELETE V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_REG  M: 71 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_REG  M: 72 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G004)          XAX_SUBSPANORMAL    NORMAL    (AX002)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.0
+ 16-MAR-0000 / 2:   71.0
+ 15-MAY-0000 / 3:  131.0
+ 15-JAN-0001 / 4:   11.0
+ 16-MAR-0001 / 5:   71.0
+ 15-MAY-0001 / 6:  131.0
+ 15-JAN-0002 / 7:   11.0
+ 16-MAR-0002 / 8:   71.0
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.0
+ 15-APR-0000 / 2:  101.0
+ 15-JAN-0001 / 3:   11.0
+ 15-APR-0001 / 4:  101.0
+ 15-JAN-0002 / 5:   11.0
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_reg[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.0
+ 15-MAY-0000 / 2:  131.0
+ 16-MAR-0001 / 3:   71.0
+ 15-JAN-0002 / 4:   11.0
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_reg[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 15-APR-0000 / 2:   ....  102.0  104.0  106.0  101.0  103.0  105.0   ....
+ 15-JAN-0001 / 3:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 15-APR-0001 / 4:   ....  102.0  104.0  106.0  101.0  103.0  105.0   ....
+ 15-JAN-0002 / 5:   ....   12.0   14.0   16.0   11.0   13.0   15.0   ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TAX_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: 30 day on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  1.000
+ 15-FEB      / 2:  2.000
+ 16-MAR      / 3:  3.000
+ 15-APR      / 4:  4.000
+ 15-MAY      / 5:  5.000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TAX_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: 30 day on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN      / 1:  10.00
+ 15-FEB      / 2:  10.00
+ 16-MAR      / 3:  10.00
+ 15-APR      / 4:  10.00
+ 15-MAY      / 5:  10.00
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TAX_SUBSPAN1 at mod]
+ 16-MAY-0166 / 1001:  5.000
+ 15-SEP-0166 / 1002:   ....
+ 16-JAN-0167 / 1003:  1.000
+ 15-FEB-0167 / 1004:  2.000
+ 17-MAR-0167 / 1005:  3.000
+ 16-APR-0167 / 1006:  4.000
+ 16-MAY-0167 / 1007:  5.000
+ 16-SEP-0167 / 1008:   ....
+ 16-JAN-0168 / 1009:  1.000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list vreg_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list vreg_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XAX_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445   / 1013:"a5"
+ 14446   / 1014:"a6"
+ 14493.5 / 1015:""  
+ 14541   / 1016:"a1"
+ 14542   / 1017:"a2"
+ 14543   / 1018:"a3"
+ 14544   / 1019:"a4"
+ 14545   / 1020:"a5"
+ 14546   / 1021:"a6"
+ 14593.5 / 1022:""  
+ 14641   / 1023:"a1"
+ 14642   / 1024:"a2"
+SAY **********   END OF REGULAR   AXIS TEST **************
+**********   END OF REGULAR   AXIS TEST **************
+SAY ********** START OF IRREGULAR AXIS TEST **************
+********** START OF IRREGULAR AXIS TEST **************
+go bn_subspan_modulo.sub2 virr v2d_irr
+! bn_subspan_modulo.sub
+! *sh* 11/02
+ 
+! subroutine for benchmark test bn_subspan_modulo.jnl
+! call with
+!	yes? GO bn_subspan_modulo.sub vreg   ! test regular axis
+!	yes? GO bn_subspan_modulo.sub virr   ! test irregular axis
+ 
+define alias lsx list/order=x
+define alias lsxn list/order=x/nohead
+ 
+! check the modulo behavior of the X and T axes
+define symbox xaxname `$1,return=xaxis`
+ !-> define symbox xaxname XIRREG_SUBSPAN
+show axis/x=-60:141 ($XAXNAME)
+ !-> show axis/x=-60:141 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -6>  -59                   1          -59.5
+      -5>  -58                   0.55       -58.5
+      -4>  -57.9                 1          -57.95
+      -3>  -56                   1.45       -56.95
+      -2>  -55                   1          -55.5
+      -1>  -54                   1          -54.5
+       0>  -6.5                  94         -53.5
+       1>  41                    1          40.5
+       2>  42                    0.55       41.5
+       3>  42.1                  1          42.05
+       4>  44                    1.45       43.05
+       5>  45                    1          44.5
+       6>  46                    1          45.5
+       7>  93.5                  94         46.5
+       8>  141                   1          140.5
+show axis/x=-60:141:2 ($XAXNAME)
+ !-> show axis/x=-60:141:2 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+      -5>  -58                   0.55       -58.5
+      -3>  -56                   1.45       -56.95
+      -1>  -54                   1          -54.5
+       1>  41                    1          40.5
+       3>  42.1                  1          42.05
+       5>  45                    1          44.5
+       7>  93.5                  94         46.5
+show axis/x=-60:141:7 ($XAXNAME)
+ !-> show axis/x=-60:141:7 XIRREG_SUBSPAN
+ name       axis              # pts   start                end
+ XIRREG_SUBSPAN X               6mi   41                   46
+   Axis span (to cell edges) = 6 (modulo length = 100)
+ 
+       I     X                   XBOX      XBOXLO
+      -7>  -106.5                94         -153.5
+       0>  -6.5                  94         -53.5
+       7>  93.5                  94         46.5
+ 
+define symbox taxname `$2,return=taxis`
+ !-> define symbox taxname TIRREG_SUBSPAN1
+show axis/l=3:10 ($TAXNAME)
+ !-> show axis/l=3:10 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       4>  15-APR 05:57:50       30         31-MAR 05:57:50         105.2485
+       5>  15-MAY 05:57:50       30         30-APR 05:57:50         135.2485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       7>  15-JAN 17:57:50       31         31-DEC 05:57:50         380.7485
+       8>  14-FEB 08:56:45       28.2485    31-JAN 05:57:50         410.3727
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+      10>  15-APR 11:55:40       30         31-MAR 11:55:40         470.497
+show axis/l=3:10:3 ($TAXNAME)
+ !-> show axis/l=3:10:3 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       6>  14-SEP 17:57:50       215        30-MAY 05:57:50         257.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+show axis/l=3:10:6 ($TAXNAME)
+ !-> show axis/l=3:10:6 TIRREG_SUBSPAN1
+ name       axis              # pts   start                end
+ TIRREG_SUBSPAN1 TIME           5mi   16-JAN 12:00         15-MAY 05:57
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 150.2485 (modulo length = 365.2485)
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (days)
+       3>  15-MAR 17:57:50       31         29-FEB 05:57:50         74.7485
+       9>  15-MAR 23:55:40       31         28-FEB 11:55:40         439.997
+ 
+set mode diag
+set mode stupid  ! always re-read and recompute
+lsx $1  ! default avoids void points
+ !-> list/order=x virr
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GFJ2            XIRREG_SUBNORMAL    NORMAL    NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ reading VIRR     M: 78 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+             VARIABLE : X[GX=XIRREG_SUBSPAN] -40 + 10
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 6 points (X)
+           41     42     42.1   44     45     46    
+            1      2      3      4      5      6
+          11.00  12.00  12.10  14.00  15.00  16.00
+lsxn/x=100 $1  ! void point above, alone (via "modulo-void-filling")
+ !-> list/order=x/nohead/x=100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    7    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     7     7 dset:   1
+ reading VIRR     M: 79 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=0 $1 ! void point below, alone (via modulo)
+ !-> list/order=x/nohead/x=0 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    0  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     0 dset:   1
+ reading VIRR     M: 81 dset:   1 I:    6    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     6     6 dset:   1
+        ....
+lsxn/x=45:100 $1  ! void above (via subspan-fill)
+ !-> list/order=x/nohead/x=45:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    5    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip modulo-void-filling VIRR on X axis:     5     7 dset:   1
+ reading VIRR     M: 83 dset:   1 I:    5    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing modulo-void-filling VIRR on X axis:     5     6 dset:   1
+          15.00  16.00   ....
+lsxn/x=0:100 $1  ! voids above & below (via modulo)
+ !-> list/order=x/nohead/x=0:100 virr
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    0    7  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing VIRR on X axis:     0     7 dset:   1
+ reading VIRR     M: 85 dset:   1 I:    1    6  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing moduloing VIRR on X axis:     1     6 dset:   1
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+set mode/last diag
+lsxn/x=50:160 $1  ! modulo above
+ !-> list/order=x/nohead/x=50:160 virr
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+lsxn/x=-100:40 $1 ! modulo below
+ !-> list/order=x/nohead/x=-100:40 virr
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+lsxn/x=-100:160 $1  ! modulo above & below
+ !-> list/order=x/nohead/x=-100:160 virr
+      ... listing every   2th point
+       .   ....  12.00  14.00  16.00  11.00  12.10  15.00   ....  12.00  14.00  16.00
+ 
+! end point testing
+lsxn/i=-8:-2 $1
+ !-> list/order=x/nohead/i=-8:-2 virr
+          16.00   ....  11.00  12.00  12.10  14.00  15.00
+lsxn/i=-7:-2 $1
+ !-> list/order=x/nohead/i=-7:-2 virr
+           ....  11.00  12.00  12.10  14.00  15.00
+lsxn/i=-6:-2 $1
+ !-> list/order=x/nohead/i=-6:-2 virr
+          11.00  12.00  12.10  14.00  15.00
+lsxn/i=17:20 $1
+ !-> list/order=x/nohead/i=17:20 virr
+          12.10  14.00  15.00  16.00
+lsxn/i=17:21 $1
+ !-> list/order=x/nohead/i=17:21 virr
+          12.10  14.00  15.00  16.00   ....
+lsxn/i=17:22 $1
+ !-> list/order=x/nohead/i=17:22 virr
+          12.10  14.00  15.00  16.00   ....  11.00
+set mode/last stupid
+ 
+! test smoothers - pos and neg modulo and combined mod and context edges
+lsx/x=500:600 $1_ragged
+ !-> list/order=x/x=500:600 virr_ragged
+             VARIABLE : VIRR + NOISE[G=VIRR at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+          493.5  541    542    542.1  544    545    546    593.5  
+           35     36     37     38     39     40     41     42
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....
+lsxn/x=500:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:600 virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....
+lsxn/x=500:545 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=500:545 virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06
+lsxn/x=545:600 $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=545:600 virr_ragged[x=@sbx]
+          15.06   ....   ....
+ 
+lsxn/x=-100:0 $1_ragged
+ !-> list/order=x/nohead/x=-100:0 virr_ragged
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....
+lsxn/x=-100:0    $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:0    virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....
+lsxn/x=-100:-55  $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-100:-55  virr_ragged[x=@sbx]
+           ....   ....  11.68  12.78  13.74  15.06
+lsxn/x=-56:0     $1_ragged[x=@sbx]
+ !-> list/order=x/nohead/x=-56:0     virr_ragged[x=@sbx]
+          13.74  15.06   ....   ....
+ 
+lsxn/x=-100:142/wid=200 $1_ragged
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged
+           ....  10.95  12.06  12.04  14.24  14.94  15.99   ....  10.95  12.06  12.04  14.24  14.94  15.99   ....  10.95  12.06
+lsxn/x=-100:142/wid=200 $1_ragged[x=@sbx:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@sbx:3]
+           ....   ....  11.68  12.78  13.74  15.06   ....   ....   ....  11.68  12.78  13.74  15.06   ....   ....   ....  11.68
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:5]
+           ....   ....   ....  12.80  13.84   ....   ....   ....   ....   ....  12.80  13.84   ....   ....   ....   ....   ....
+lsxn/x=-100:142/wid=200 $1_ragged[x=@swl:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_ragged[x=@swl:35]
+        ....................................................................
+ 
+! test fillers - pos and neg modulo and combined mod and context edges
+! @FAV
+lsx/x=500:600 $1_void
+ !-> list/order=x/x=500:600 virr_void
+             VARIABLE : IF X[G=VIRR] LT 43 OR X[G=VIRR] GT 45 THEN VIRR
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 8 points (X)
+          493.5  541    542    542.1  544    545    546    593.5  
+           35     36     37     38     39     40     41     42
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fav]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fav]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fav]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fav]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:3]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:3]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:5]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:5]
+           ....  11.00  12.00  12.10  13.37  14.05  16.00   ....  11.00  12.00  12.10  13.37  14.05  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fav:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fav:35]
+           ....  11.00  12.00  12.10  12.78  12.78  16.00   ....  11.00  12.00  12.10  12.78  12.78  16.00   ....  11.00  12.00
+ 
+! @FLN
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fln]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fln]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fln]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fln]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fln:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fln:35]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00
+ 
+! @FNR
+lsxn/x=500:600 $1_void
+ !-> list/order=x/nohead/x=500:600 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=500:600 $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=500:600 virr_void[x=@fnr]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:0    $1_void
+ !-> list/order=x/nohead/x=-100:0    virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....
+lsxn/x=-100:0    $1_void[x=@fnr]
+ !-> list/order=x/nohead/x=-100:0    virr_void[x=@fnr]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....
+ 
+lsxn/x=-100:142/wid=200 $1_void
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void
+           ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00  12.10   ....   ....  16.00   ....  11.00  12.00
+lsxn/x=-100:142/wid=200 $1_void[x=@fnr:35]
+ !-> list/order=x/nohead/x=-100:142/wid=200 virr_void[x=@fnr:35]
+           ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00  12.10  12.10  16.00  16.00   ....  11.00  12.00
+ 
+! Test 2-axis modulo (longitude and time)
+define alias l200 list/width=200
+define alias l200n list/width=200/nohead
+l200/i=1:13 $2
+ !-> list/width=200/nohead/i=1:13 v2d_irr
+ 16-JAN 12      / 1:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0
+ 15-FEB 02      / 2:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 17      / 3:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 05      / 4:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 05      / 5:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2
+l200n/l=1:12 $2
+ !-> list/width=200/nohead/l=1:12 v2d_irr
+ 16-JAN 12      /  1:   11.0   12.0   12.1   14.0   15.0   16.0
+ 15-FEB 02      /  2:   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 17      /  3:   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 05      /  4:  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 05      /  5:  131.2  132.2  132.3  134.2  135.2  136.2
+ 14-SEP 17      /  6:   ....   ....   ....   ....   ....   ....
+ 15-JAN 17      /  7:   11.0   12.0   12.1   14.0   15.0   16.0
+ 14-FEB 08      /  8:   42.0   43.0   43.1   45.0   46.0   47.0
+ 15-MAR 23      /  9:   70.2   71.2   71.3   73.2   74.2   75.2
+ 15-APR 11      / 10:  101.2  102.2  102.3  104.2  105.2  106.2
+ 15-MAY 11      / 11:  131.2  132.2  132.3  134.2  135.2  136.2
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....
+l200n/l=1:12/i=1:11 $2
+ !-> list/width=200/nohead/l=1:12/i=1:11 v2d_irr
+ 16-JAN 12      /  1:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0
+ 15-FEB 02      /  2:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0
+ 15-MAR 17      /  3:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2
+ 15-APR 05      /  4:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2
+ 15-MAY 05      /  5:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2
+ 14-SEP 17      /  6:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN 17      /  7:   11.0   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0
+ 14-FEB 08      /  8:   42.0   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0
+ 15-MAR 23      /  9:   70.2   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2
+ 15-APR 11      / 10:  101.2  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2
+ 15-MAY 11      / 11:  131.2  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0
+ 14-FEB-0002 14 / 14:   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0
+ 16-MAR-0002 05 / 15:   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2
+ 15-APR-0002 17 / 16:  102.2  102.3  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2
+ 15-MAY-0002 17 / 17:  132.2  132.3  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0
+ 14-FEB-0003 20 / 20:   43.0   43.1   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0
+ 16-MAR-0003 11 / 21:   71.2   71.3   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2
+l200n/l=12:21/i=-19:-9 $2_void
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   ....   ....   16.0   ....   11.0   12.0   12.1   ....   ....
+ 14-FEB-0002 14 / 14:   43.0   43.1   ....   ....   47.0   ....   42.0   43.0   43.1   ....   ....
+ 16-MAR-0002 05 / 15:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-APR-0002 17 / 16:  102.2  102.3   ....   ....  106.2   ....  101.2  102.2  102.3   ....   ....
+ 15-MAY-0002 17 / 17:  132.2  132.3   ....   ....  136.2   ....  131.2  132.2  132.3   ....   ....
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   ....   ....   16.0   ....   11.0   12.0   12.1   ....   ....
+ 14-FEB-0003 20 / 20:   43.0   43.1   ....   ....   47.0   ....   42.0   43.0   43.1   ....   ....
+ 16-MAR-0003 11 / 21:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+l200n/l=12:21/i=-19:-9 $2_void[x=@fnr,t=@fnr]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr_void[x=@fnr,t=@fnr]
+ 14-SEP 23      / 12:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 15-JAN-0002 23 / 13:   12.0   12.1   12.1   16.0   16.0   ....   11.0   12.0   12.1   12.1   16.0
+ 14-FEB-0002 14 / 14:   43.0   43.1   43.1   47.0   47.0   ....   42.0   43.0   43.1   43.1   47.0
+ 16-MAR-0002 05 / 15:   72.6   72.7   72.7   76.6   76.6   ....   71.6   72.6   72.7   72.7   76.6
+ 15-APR-0002 17 / 16:  102.2  102.3  102.3  106.2  106.2   ....  101.2  102.2  102.3  102.3  106.2
+ 15-MAY-0002 17 / 17:  132.2  132.3  132.3  136.2  136.2   ....  131.2  132.2  132.3  132.3  136.2
+ 15-SEP-0002 05 / 18:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-JAN-0003 05 / 19:   12.0   12.1   12.1   16.0   16.0   ....   11.0   12.0   12.1   12.1   16.0
+ 14-FEB-0003 20 / 20:   43.0   43.1   43.1   47.0   47.0   ....   42.0   43.0   43.1   43.1   47.0
+ 16-MAR-0003 11 / 21:   72.6   72.7   72.7   76.6   76.6   ....   71.6   72.6   72.7   72.7   76.6
+ 
+! test shift
+l200n/l=12:21/i=-19:-9 $2[x=@shf:2,t=@shf:-2]
+ !-> list/width=200/nohead/l=12:21/i=-19:-9 v2d_irr[x=@shf:2,t=@shf:-2]
+ 14-SEP 23      / 12:  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2   ....
+ 15-JAN-0002 23 / 13:  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2   ....
+ 14-FEB-0002 14 / 14:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0002 05 / 15:   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0   ....
+ 15-APR-0002 17 / 16:   45.0   46.0   47.0   ....   42.0   43.0   43.1   45.0   46.0   47.0   ....
+ 15-MAY-0002 17 / 17:   73.2   74.2   75.2   ....   70.2   71.2   71.3   73.2   74.2   75.2   ....
+ 15-SEP-0002 05 / 18:  104.2  105.2  106.2   ....  101.2  102.2  102.3  104.2  105.2  106.2   ....
+ 16-JAN-0003 05 / 19:  134.2  135.2  136.2   ....  131.2  132.2  132.3  134.2  135.2  136.2   ....
+ 14-FEB-0003 20 / 20:   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....
+ 16-MAR-0003 11 / 21:   14.0   15.0   16.0   ....   11.0   12.0   12.1   14.0   15.0   16.0   ....
+ 
+! test strides
+l200n/order=x $2[l=1,i=0:14]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14]
+           ....  11.00  12.00  12.10  14.00  15.00  16.00   ....  11.00  12.00  12.10  14.00  15.00  16.00   ....
+set mode diag; l200n/order=x $2[l=1,i=0:14:2]; set mode/last diag
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:2]
+ dealloc  dynamic grid GFJ4            XIRREG_SUBNORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ strip regrid on X: V2D_IRR --> (G006)           @XACT
+ found   V2D_IRR  M:146 dset:   1 I:    0   14  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ regrid  V2D_IRR  M:147 dset:   1 I:    1    8  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX001)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+           ....  12.00  14.00  16.00  11.00  12.10  15.00   ....
+l200n/order=x $2[l=1,i=0:14:7]
+ !-> list/width=200/nohead/order=x v2d_irr[l=1,i=0:14:7]
+        ............
+set mode diag; l200n $2[i=1,l=1:15:2]; set mode/last diag
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:2]
+ dealloc  dynamic grid (G006)          (AX005)   NORMAL    NORMAL    TIRREG_SUBNORMAL    NORMAL
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    3  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ strip regrid on T: V2D_IRR --> (G006)           @XACT
+ strip moduloing V2D_IRR on T axis:     1    15 dset:   1
+ rdstride V2D_IRR  C:  9 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ doing moduloing V2D_IRR on T axis:     1     5 dset:   1
+ -DELETE V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    5  M: -999 -999  N: -999 -999
+ nulrgd  V2D_IRR  M:148 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ -DELETE V2D_IRR  M:149 dset:   1 I:    1    1  J: -999 -999  K: -999 -999  L:    1   15  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          XIRREG_SUBNORMAL    NORMAL    (AX001)   NORMAL    NORMAL
+ 16-JAN-0000 / 1:   11.0
+ 15-MAR-0000 / 2:   70.2
+ 15-MAY-0000 / 3:  131.2
+ 15-JAN-0001 / 4:   11.0
+ 15-MAR-0001 / 5:   70.2
+ 15-MAY-0001 / 6:  131.2
+ 15-JAN-0002 / 7:   11.0
+ 16-MAR-0002 / 8:   70.2
+l200n $2[i=1,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:3]
+ 16-JAN-0000 / 1:   11.0
+ 15-APR-0000 / 2:  101.2
+ 15-JAN-0001 / 3:   11.0
+ 15-APR-0001 / 4:  101.2
+ 15-JAN-0002 / 5:   11.0
+l200n $2[i=1,l=1:15:4]
+ !-> list/width=200/nohead v2d_irr[i=1,l=1:15:4]
+ 16-JAN-0000 / 1:   11.0
+ 15-MAY-0000 / 2:  131.2
+ 15-MAR-0001 / 3:   70.2
+ 15-JAN-0002 / 4:   11.0
+l200n $2[i=0:14:2,l=1:15:3]
+ !-> list/width=200/nohead v2d_irr[i=0:14:2,l=1:15:3]
+ 16-JAN-0000 / 1:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 15-APR-0000 / 2:   ....  102.2  104.2  106.2  101.2  102.3  105.2   ....
+ 15-JAN-0001 / 3:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 15-APR-0001 / 4:   ....  102.2  104.2  106.2  101.2  102.3  105.2   ....
+ 15-JAN-0002 / 5:   ....   12.0   14.0   16.0   11.0   12.1   15.0   ....
+ 
+! test modulo regridding
+define axis/t=15-jan-1981:15-dec-1990/npoints=120 t1980s
+LET/quiet time_series = MOD(L[gt=t1980s]-1,12)+1
+list time_series[gt=($TAXNAME)@mod]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at mod]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1
+                        regrid: on T at MOD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  1.000
+ 15-FEB 02      / 2:  2.000
+ 15-MAR 17      / 3:  3.000
+ 15-APR 05      / 4:  4.000
+ 15-MAY 05      / 5:  5.000
+list time_series[gt=($TAXNAME)@modngd]
+ !-> list time_series[gt=TIRREG_SUBSPAN1 at modngd]
+             VARIABLE : MOD(L[GT=T1980S]-1,12)+1 (# of points)
+                        regrid: on T at MODNGD
+             SUBSET   : 5 points (TIME)
+ 16-JAN 12      / 1:  10.00
+ 15-FEB 02      / 2:  10.00
+ 15-MAR 17      / 3:  10.00
+ 15-APR 05      / 4:  10.00
+ 15-MAY 05      / 5:  10.00
+list/nohead/l=1001:1009 time_series[gt=($TAXNAME)@mod]
+ !-> list/nohead/l=1001:1009 time_series[gt=TIRREG_SUBSPAN1 at mod]
+ 16-MAY-0166 11 / 1001:  5.000
+ 15-SEP-0166 23 / 1002:   ....
+ 16-JAN-0167 23 / 1003:  1.000
+ 15-FEB-0167 14 / 1004:  2.000
+ 17-MAR-0167 05 / 1005:  3.000
+ 16-APR-0167 17 / 1006:  4.000
+ 16-MAY-0167 17 / 1007:  5.000
+ 16-SEP-0167 05 / 1008:   ....
+ 17-JAN-0168 05 / 1009:  1.000
+ 
+! test modulo string arrays
+list $1_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+ !-> list virr_strings[i=5:7]  	! via IS_SUBSPAN_FILL
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 3 points (X)
+ 45   / 5:"a5"
+ 46   / 6:"a6"
+ 93.5 / 7:""  
+list $1_strings[i=1013:1024] 	! via IS_MODULO
+ !-> list virr_strings[i=1013:1024] 	! via IS_MODULO
+             VARIABLE : MY_STRINGS[GX=XIRREG_SUBSPAN at ASN]
+             FILENAME : test_subspan_modulo.nc
+             SUBSET   : 12 points (X)
+ 14445    / 1013:"a5"
+ 14446    / 1014:"a6"
+ 14493.5  / 1015:""  
+ 14541    / 1016:"a1"
+ 14542    / 1017:"a2"
+ 14542.1  / 1018:"a3"
+ 14544    / 1019:"a4"
+ 14545    / 1020:"a5"
+ 14546    / 1021:"a6"
+ 14593.5  / 1022:""  
+ 14641    / 1023:"a1"
+ 14642    / 1024:"a2"
+ 
+ 
+*** Running test: bn_dots.jnl
+! PLOT/SYMBOL=DOT  qualifiers
+! *acm* 12/02
+! ACM 4/2005 set mode meta to save this plot for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+set mode meta dots.plt
+can mode logo
+plot/symbol=dot/i=1:1000 sin(62.8*i)
+plot/symbol=dot/color=red/over/i=1:1000 sin(62.8*(i+20))
+can mode meta
+ 
+! test warnings
+plot/symbol=dot/thick/i=1:1000 sin(62.8*(i+10) )
+plot/symbol=dot/size=0.5/over/i=1:1000 -0.5*sin(62.8*(i+10) )
+ 
+! Vector plots with null-size vectors
+ 
+vector/i=1:5/j=1:5 0.*(i+j),0*(i+j)
+set mode logo
+*** Running test: bn_lev_symbols.jnl
+! Test symbols which capture the latest LEVELS settings
+! LEV_TEXT  The argument, if any, to the LEV qualifier
+! LEV_MIN  Minimum level
+! LEV_MAX  Maximum level
+! LEV_NUM  Number of levels
+! LEV_DEL  Delta level (irregular)
+ 
+can sym lev*
+define symbol lev_text = ""
+ 
+shade/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+contour/over/i=1:15/j=1:5 i*j
+sho sym lev*
+LEV_TEXT = """"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "8"
+LEV_DEL = "10"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,50,3) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,3)"
+LEV_MIN = "0"
+LEV_MAX = "51"
+LEV_NUM = "17"
+LEV_DEL = "3"
+ 
+fill/i=1:15/j=1:5/lev=(0,50,5) i*j
+sho sym lev*
+LEV_TEXT = "(0,50,5)"
+LEV_MIN = "0"
+LEV_MAX = "50"
+LEV_NUM = "10"
+LEV_DEL = "5"
+ 
+contour/over/i=1:15/j=1:5/lev=(0,80,3),(56),DARK(56) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,3),(56),DARK(56)"
+LEV_MIN = "0"
+LEV_MAX = "81"
+LEV_NUM = "28"
+LEV_DEL = "3"
+ 
+contour/over/i=1:15/j=1:5/lev=50 i*j
+sho sym lev*
+LEV_TEXT = "50"
+LEV_MIN = "0"
+LEV_MAX = "76"
+LEV_NUM = "38"
+LEV_DEL = "2"
+ 
+ 
+shade/i=1:15/j=1:5/lev=(0,80,1) i*j
+sho sym lev*
+LEV_TEXT = "(0,80,1)"
+LEV_MIN = "0"
+LEV_MAX = "80"
+LEV_NUM = "80"
+LEV_DEL = "1"
+ 
+contour/over/i=1:15/j=1:5/lev=(33) i*j
+sh sym lev*
+LEV_TEXT = "(33)"
+LEV_MIN = "33"
+LEV_MAX = "33"
+LEV_NUM = "1"
+LEV_DEL = "none"
+*** Running test: bn_mode_logo_lab.jnl
+ 
+! bn_mode_logo_lab.jnl
+! cancel both logo and labels
+! NOTE this script redefined the pre-defined viewports ul, ur, ll, lr...
+ 
+ 
+def view /xlim=0.:0.33/ylim=0.5:1 ul3
+def view /xlim=0.33:0.66/ylim=0.5:1 um3
+def view /xlim=0.66:1./ylim=0.5:1 ur3
+ 
+def view /xlim=0.:0.33/ylim=0.:0.5 ll3
+def view /xlim=0.33:0.66/ylim=0.:0.5 lm3
+def view /xlim=0.66:1./ylim=0.:0.5 lr3
+ 
+ 
+! can mode labels would not plot the logo anyway
+set view ul3
+can mode labels
+can mode logo
+show modes
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY           SET         DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         ferret.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL      SET               1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      2560000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      ferret.png
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO          CANCELLED
+      LABELS        CANCELLED
+      GRATICULE     CANCELLED
+      LINECOLORS       SET               6
+      UPCASE_OUTPU     SET
+      NLEVELS          SET              30
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+contour/i=1:10/j=1:10 i/j
+ 
+! restore the labels, logo still gone
+set view um3
+set mode labels
+wire/view=0,0,2/i=1:20/j=1:20/title="My Egg Carton"/nolabel sin(i/3)*cos(j/4)
+ 
+ 
+! put only labels, not logo
+set view ur3
+set mode labels
+can mode logo
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+! Labels restored, not logo.
+! logo is not restored on an /overlay plot
+set view ll3
+set mode labels
+shade/i=1:10/j=1:10 i*j
+set mode logo
+! KMS - white changed to green for PyFerret - white causing problems
+plot/vs/over/line/color=green {1,4}, {1,9}
+ 
+! but the logo is restored on the next plot command.
+set view lm3
+fill/i=1:10/j=1:10 i/j
+ 
+! Verify for polygon command too
+set view lr3
+can mode logo
+can mode labels
+polygon/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! restore state of modes
+cancel view
+set mode logo
+set mode labels
+*** Running test: bn_modulo_attribute.jnl
+! Ferret V5.50 m
+ 
+! Modulo attribute can take numerical values to indicate
+! the modulo length of axis (subspan modulo changes)
+! This script tests various string values of the attribute
+ 
+use modulo_lon_time
+ 
+sh ax lon*
+ name       axis              # pts   start                end
+ LON_TRUE  LONGITUDE            5mr   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+ LON_MODERR X (meters)          5 r   0                    15
+   Axis span (to cell edges) = 18.75
+ LON_FALSE LONGITUDE            5 r   1.875W(-1.875)       13.125E
+   Axis span (to cell edges) = 18.75
+ LON_MOD_NOUNITS X              5mr   0                    15
+   Axis span (to cell edges) = 18.75 (modulo length = axis span)
+ LON_USUAL LONGITUDE            5mr   0E                   15E
+   Axis span (to cell edges) = 18.75 (modulo length = 360)
+sh ax tim*
+ name       axis              # pts   start                end
+ TIME_TRUE T (days)             4mi   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165 (modulo length = axis span)
+ TIME_MODERR T (meters)         4 i   30                   150
+T0 = %%
+   Axis span (to cell edges) = 165
+ TIME_FALSE T (days)            4 r   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40
+ TIME_MOD_NOUNITS T             4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ TIME_USUAL T (days)            4mr   120                  150
+T0 = %%
+   Axis span (to cell edges) = 40 (modulo length = axis span)
+ 
+*** Running test: bn550_bug_fixes.jnl
+! bn550_bug_fixes.jnl
+! test various fixes that went into version 5.5
+! 10/02 *acm*
+!
+ 
+! Polygon/overlay calendar axis bug
+GO bn_reset
+cancel mode verify
+GO err542_poly_over_calendar
+! POLY/OVER when data has a non-standard calendar caused
+! calendar mismatch error, even on a plot with no time axis.
+ 
+use err542_poly_over_calendar.nc
+shade pc
+poly/over/color=red/line=2/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+*** Running test: bn551_bug_fixes.jnl
+! bn551_bug_fixes.jnl
+! test various fixes that went into version 5.51
+! 2/03 *acm*
+!
+ 
+! FILL plots in viewports defined with /AXES, fix clipping bug,
+! and allow color keys to plot beyond viewport limits.
+ 
+go bn_reset
+cancel mode verify
+GO err550_view_axes_fill.jnl
+! err550_view_axes_fill.jnl
+! acm 2/5/03
+! Test FILL plots in viewports defined with /AXES;
+! also let the color keys be plotted in these viewports, unless
+! removed with /nokey
+ 
+can mode logo
+set win/asp=.5/siz=0.5
+ 
+define axis/x=-10:10:1 xtest
+define axis/y=-10:10:1 ytest
+ 
+let test=x[gx=xtest]^2+y[gy=ytest]^2
+ 
+def vi/x=.1:.9/y=.1:.3/axes bot
+def vi/x=.1:.9/y=.4:.6/axes mid
+def vi/x=.1:.9/y=.6:1 top
+def vi/x=0:.1/y=.1:.3/axes bot1
+def vi/x=0:.1/y=.4:.6/axes mid1
+def vi/x=0:.1/y=.6:1 top1
+ 
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+contour/over test
+ 
+ 
+can view
+set win/asp=2/siz=0.3
+set vi bot1
+fill/nokey test
+contour/over test
+ 
+set vi bot
+fill test
+contour/over test
+ 
+set vi mid1
+shade/nokey test
+contour/over test
+ 
+set vi mid
+shade test
+contour/over test
+ 
+set vi top1
+fill/nokey test
+contour/over test
+ 
+set vi top
+fill test
+contour/over test
+ 
+set win/clear
+set win/aspect=0.75
+ 
+ 
+! position on page was incorrect, of first viewport plotted when
+! defined as a VIEW/AXES viewport.
+go bn_reset
+cancel mode verify
+GO err550_view_axes_position.jnl
+! err550_view_axes_position.jnl
+! acm 2/5/03
+ 
+! position on page was incorrect, of first viewport plotted when defined
+! as a VIEW/AXES viewport.
+ 
+def view/x=.1:.5/y=.4:.6/axes mid1
+def view/x=.5:.9/y=.4:.6/axes mid2
+ 
+set view mid1
+shade/x=1:10/y=1:10 x+y
+set view mid2
+shade/x=1:10/y=1:10 x-y
+ 
+! SHADE bug: hlimits, vlimits without effect
+go bn_reset
+cancel mode verify
+GO err550_shade_limits.jnl
+! err550_shade_limits.jnl
+! acm 2/5/03
+ 
+! SHADE bug: hlimits, vlimits without effect
+ 
+use coads_climatology
+set view upper; shade sst[l=1]
+ 
+set view lower; shade/hlimits=212:324/vlimits=-34:23 sst[l=1]
+ 
+! Redefining an axis with a new calendar definition
+go bn_reset
+cancel mode verify
+GO err550_redefine_calendar_axis.jnl
+! err550_redefine_calendar_axis.jnl
+! different calendar axis not recognized as a different specifier,
+! requiring the axis to be redefined.
+ 
+def axis/cal=gregorian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 367
+def axis/cal=julian/t=1-jan-2000:1-jan-2001:1/unit=days tax
+sh axis tax
+ name       axis              # pts   start                end
+ TAX       TIME               367 r   01-JAN-2000 00:00    01-JAN-2001 00:00
+T0 = 15-JAN-1901
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 367
+ 
+ 
+! Bug in defining axis from an expression.
+go bn_reset
+cancel mode verify
+GO err550_define_axis_expression.jnl
+! err550_define_axis_expression.jnl
+! reported by A. Wittenberg.
+!  Axes defined from an expression only took the first part of the
+!  expression The first two axis defines get it wrong (fix in xeq_define.F)
+ 
+let a = {1,2,3}
+let b = {2,3,4}
+ 
+def ax/x xax = a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+def ax/x xax = (a/2) + (b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+def ax/x xax = (a/2 + b/2)
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+ 
+!  Note (acm)  The older syntax defines the axis correctly
+ 
+def axis/from_data/x/name=xax a/2 + b/2
+list x[gx=xax]
+             VARIABLE : X
+                        axis XAX
+             SUBSET   : 3 points (X)
+ 1.5 / 1:  1.500
+ 2.5 / 2:  2.500
+ 3.5 / 3:  3.500
+ 
+! Bug in reading seconds from time origin in nc file.
+go bn_reset
+cancel mode verify
+GO err550_nc_seconds.jnl
+! err550_nc_seconds.jnl
+! 2/12/03 ACM
+ 
+! When the time origin is specified in a NetCDF file as
+! "10-JUN-1996 04:03:36", the seconds are read incorrectly.
+! If it's written as "1996-06-10 04:03:36" it is read OK
+ 
+use time_axis_seconds.nc
+ 
+sp echo "err550_nc_seconds.jnl --- seconds of time axis" >> all_ncdump.out
+sp ncdump time_axis_seconds.nc | grep origin >> all_ncdump.out
+list t[gt=height]    ! Seconds should be 36, 37, 38...
+             VARIABLE : T
+                        axis TIME
+             FILENAME : time_axis_seconds.nc
+             SUBSET   : 5 points (TIME)
+ 10-JUN-1996 04:03:36 / 1:  0.000
+ 10-JUN-1996 04:03:37 / 2:  1.000
+ 10-JUN-1996 04:03:38 / 3:  2.000
+ 10-JUN-1996 04:03:39 / 4:  3.000
+ 10-JUN-1996 04:03:40 / 5:  4.000
+ 
+! Bug in plotting polymarker dots with pen numbers gt 6
+go bn_reset
+cancel mode verify
+GO err550_dots_thickpens.jnl
+! err550_dots_thickpens.jnl
+! For pen code higher than 6, get *  rather than dot.
+! also for vector plots having short vectors that are plotted with dots.
+ 
+plot/sym=dot/color=8/i=1:10 i
+*** Running test: bn_multi_line_labels.jnl
+     ! bn_multi_line_labels.jnl
+! March 31, 2003
+!
+! ACM 4/2005 ! set mode meta to save this plot for the metafile checks.
+!            and ! cancel mode logo, so that .plt files are comparable.
+! ACM 1/2007 Change from a bunch of plot items in a viewport, to separate
+!            plots; for better checking of batch mode
+ 
+ 
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are sized according to the\
+<nl>longest line <nl>and centered individually" i*cos(i/8)
+ppl plot
+plot/over/i=1:100 i*sin(i/8)
+ 
+set mode meta multi_line_labels.plt
+cancel mode logo
+plot/i=1:100/title="@p2two-line<NL>RED title"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+ 
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+ 
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+ 
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+set mode/last meta
+set mode/last logo
+ 
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+ 
+ 
+ 
+plot/i=1:100 i*cos(i/8)
+ 
+ 
+! label 30,95,0,0,0.1,\
+! label 70,95,1,0,0.1,\
+label 3,95,-1,0,0.12,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+ 
+ 
+set win/clear
+plot/sym/i=1:5/nolab/noaxes i
+ppl ylab "@CRlong y label<NL>@p2line 2 in red, longer than the other lines."
+ppl xlab "@p4Tests using the %xaxis and %yaxis commands<NL>@p5 at CItwo lines<NL>center a at P1 long third line too"
+ppl %yaxis/nouser,0,50,4,1, , , ,-1
+ppl %xaxis/nouser,0,50,4,1, , , ,-1
+ 
+ppl %yaxis/nouser,0,50,4,2, , , ,0
+ppl %xaxis/nouser,0,50,4,2.5, , , ,0
+ 
+ppl %yaxis/nouser,0,50,4,6, , , ,1
+ppl %xaxis/nouser,0,50,4,4, , , ,1
+ 
+ 
+can view; set view upper
+plot/i=1:100/axes=1,0,0,1/set/title="labels on top and right<nl>space for two lines on the y axis at the right" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line 2<NL>here is line three<NL>here is line four"
+ppl labset, , , 0.08
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>"
+ppl plot
+ 
+set view lower
+ppl axlen `($ppl$xlen)-1`
+ !-> ppl axlen 6.75
+ 
+plot/i=1:100/axes=1,0,0,1/set/title="shortened the x axis to make space" i*cos(i/8)
+ppl xlab "a multi line x label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl ylab "a multi line y label<NL>here is line two<NL>here is line three<NL>here is line four"
+ppl plot
+ 
+! reset
+can view
+ppl axlen,8
+ 
+! size and rotate moveable labels.
+ 
+plot/i=1:100/set i*cos(i/8)
+ppl labs,4,20,-60,-1,"A @CIppl labs at SR label,<NL>change size and <NL>rotation"
+ppl rlabs,4,45
+ppl hlabs,4,.4
+ppl title "@P2 at ACRED title in AC font<NL>put P2 first then AC otherwise \
+the at sign in front of P2 not recognized"
+ppl plot
+ 
+ppl rlabs,4,0
+*** Running test: bn552_bug_fixes.jnl
+! bn552_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 3/03 *acm*
+!
+! 4/03 *kob*  Add fixes for string bugs
+ 
+! Default behavior (all axes on) was not reset after a plot/set/AXES=
+GO bn_reset
+cancel mode verify
+GO err551_axes_set.jnl
+! Default behavior (all axes on) was not reset after a PLOT/SET/AXES=
+ 
+!   Choose just some axes to plot with /AXES qualifier
+SET VIEW upper
+PLOT/SET/AXES=0,1,1,0/i=1:12 1./i
+PPL TITLE "PLOT/SET/AXES  only two axes"
+PPL PLOT
+ 
+! This plot should have the default behavior; all axes plotted.
+! But, pre-v552, keeps settings from previous PLOT/SET/AXES=
+ 
+SET VIEW lower
+plot/i=1:100/title="PLOT (no quals); all axes plotted" i*cos(i/12)
+ 
+! Test whether too many levels specified. Previous to v552, no
+! test on SHADE and POLYGON plots, and these crashed Ferret.
+GO bn_reset
+cancel mode verify
+GO err551_num_levels.jnl
+! Test whether too many levels specified. Previous to v552, no
+! test was made on SHADE and POLYGON plots, and these crashed Ferret.
+! The results should all be error messages: too many levels.
+ 
+SET MODE IGNORE_ERROR
+USE coads_climatology
+CONTOUR/L=1/LEV=0.01d sst
+FILL/L=1/LEV=0.01d sst
+ 
+SHADE/L=1/LEV=0.01d sst
+can data/all
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/LEV=0.01d xpts,ypts,sst,star
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+SET WIN/CLEAR
+ 
+! Check for invalid value of calendar attribute on reading NetCDF files.
+GO bn_reset
+cancel mode verify
+GO err551_invalid_calendar.jnl
+! check on input for invalid calendar name
+! If file gives calendar attribute with unrecognized name,
+! give an error message and use an abstract axis.
+ 
+set data err_calendar.nc
+sh data
+     currently SET data sets:
+    1> ./err_calendar.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TIME     observation time                 ...       ...       ...       1:12      ...       ...
+       (invalid coordinate axis)
+ 
+ 
+! String bug fixes *kob*
+GO bn_reset
+cancel mode verify
+GO err551_strings.jnl
+ 
+ 
+! first make sure file is non-existent
+sp rm input.txt
+ 
+! first bug - first list always worked fine, and second list would crash.
+!	      fix turned out to be that you still had to (m)alloc space even
+!             for a null pointer in get_sys_cmnd.c
+! 	
+! define string variable
+let a = {"first", spawn:"ls input.txt", "last"}
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+list a
+             VARIABLE : {"first", SPAWN:"ls input.txt", "last"}
+             SUBSET   : 3 points (X)
+ 1   / 1:"first"
+ 2   / 2:""     
+ 3   / 3:"last" 
+ 
+ 
+! second bug fix - this used to crash during the list command.
+!		   fix turned out to be that needed make sure to (m)alloc enough
+! 		   space for string plus "\n" character - in get_sys_cmnd.c
+ 
+sp echo "GANGES_BRAHMAPUTRA" > input.txt
+sp echo "X=86e:93e/Y=20n:25n  " >> input.txt
+sp echo "X=118e:123e/Y=29n:34n  " >> input.txt
+sp echo "X=65w:57w/Y=7n:12n  " >> input.txt
+let a = {spawn:"cat input.txt"}
+load a
+list a
+             VARIABLE : {SPAWN:"cat input.txt"}
+             SUBSET   : 4 points (X)
+ 1   / 1:"GANGES_BRAHMAPUTRA"     
+ 2   / 2:"X=86e:93e/Y=20n:25n  "  
+ 3   / 3:"X=118e:123e/Y=29n:34n  "
+ 4   / 4:"X=65w:57w/Y=7n:12n  "   
+ 
+! last one - make sure bug gabe found is fixed as well
+!            used to have incorrect results on second list command
+!   	     fix turned out to be that strcmp function was declared "float"
+!            when it should have been void.
+ 
+let mystring = {"a","b","a","c"}
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+ 4   / 4: -1.000
+list strcmp("b", mystring)
+             VARIABLE : STRCMP("b", MYSTRING)
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  0.000
+ 3   / 3:  1.000
+ 4   / 4: -1.000
+ 
+ 
+! 2-D @AVE bug fix
+GO bn_reset
+cancel mode verify
+GO err551_2dave.jnl
+! Bug in 2-D averaging, if source data thats loaded has a
+! larger range than the dest data, code didnt check whether
+! source grid cells actually overlapped destination cells
+ 
+use coads_climatology
+load/l=1 sst
+ 
+def axis/x=110w:90w:5 xax
+def axis/y=10n:20n:2 yax
+ 
+list/l=1/y=20 sst[gx=xax at ave,gy=yax at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 5 deg on X at AAV, 2 deg on Y at AAV
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 20N
+             TIME     : 16-JAN 06:00
+               20N   
+                6
+ 110W   / 1:  24.04
+ 105W   / 2:  25.46
+ 100W   / 3:  24.57
+ 95W    / 4:  23.82
+ 90W    / 5:  25.00
+ 
+! RETURN error message, and new var,RETURN=dsettitle  argument
+GO bn_reset
+cancel mode verify
+GO err551_return_message.jnl
+ ! err551_return_message.jnl
+ ! 4/15/03 ACM
+ 
+SET MODE IGNORE_ERROR
+ 
+use dstitle
+ 
+! This is not a valid argument for RETURN.  The error message
+! has been improved to include all valid arguments.
+ 
+say `axy, return=xx`
+ 
+! This is a new argument: title from the global attributes secion.
+say `axy,return=dsettitle`
+ !-> MESSAGE/CONTINUE dataset title for 4D string data
+dataset title for 4D string data
+ 
+SET MODE/LAST IGNORE_ERROR
+ 
+!  file/form=stream didnt see file in another directory
+GO bn_reset
+cancel mode verify
+GO err551_streamread_directory.jnl
+! Bug: file/form=stream doesnt see file in another directory
+ 
+sp rm -f subdir/a.dat
+ 
+def ax/x=1:1/np=1 xax
+def grid/x=xax g
+list/clobber/form=stream/file="a.dat" 1
+file/form=stream/grid=g/var=a "a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             X        : 1
+          1.000
+ 
+can dat/all
+sp mkdir -p subdir
+sp mv a.dat subdir
+file/form=stream/grid=g/var=a "subdir/a.dat"
+list a
+             VARIABLE : A
+             FILENAME : a.dat
+             FILEPATH : subdir/
+             X        : 1
+          1.000
+ 
+! GXY=var  regridding syntax, when the variable hasnt been loaded
+GO bn_reset
+cancel mode verify
+GO err551_regrid_undef_grid.jnl
+! err551_regrid_undef_grid.jnl
+! 5/03 *acm* based on bn_regrid_to_user; more testing of multi-axis GXY=var
+!            syntax, when the destination grid is not yet defined
+ 
+! test various regridding combos that involve user-defined variables
+! for the target grids
+ 
+ 
+set mode ignore_errors
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,gxy=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G003)
+    GRID (G003)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+can data/all
+can var/all
+can grid
+ 
+! multiple axis syntax: GXY=gg
+define axis/x=1:6:1 x1
+define axis/y=1:4:1 y1
+define axis/z=1:3:1 z1
+define axis/x=1:6:2 x2
+define axis/y=1:4:2 y2
+define axis/z=1:3:2 z2
+let a1 = x[gx=x1]+y[gy=y1]+z[gz=z1]
+let a2 = x[gx=x2]+y[gy=y2]+z[gz=z2]
+list a1
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+             SUBSET   : 6 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5      6    
+             1      2      3      4      5      6
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   4.00   5.00   6.00   7.00   8.00
+ 2   / 2:   4.00   5.00   6.00   7.00   8.00   9.00
+ 3   / 3:   5.00   6.00   7.00   8.00   9.00  10.00
+ 4   / 4:   6.00   7.00   8.00   9.00  10.00  11.00
+ ---- K:2 Z:   2
+ 1   / 1:   4.00   5.00   6.00   7.00   8.00   9.00
+ 2   / 2:   5.00   6.00   7.00   8.00   9.00  10.00
+ 3   / 3:   6.00   7.00   8.00   9.00  10.00  11.00
+ 4   / 4:   7.00   8.00   9.00  10.00  11.00  12.00
+ ---- K:3 Z:   3
+ 1   / 1:   5.00   6.00   7.00   8.00   9.00  10.00
+ 2   / 2:   6.00   7.00   8.00   9.00  10.00  11.00
+ 3   / 3:   7.00   8.00   9.00  10.00  11.00  12.00
+ 4   / 4:   8.00   9.00  10.00  11.00  12.00  13.00
+list a1[gzxy=a2]
+             VARIABLE : X[GX=X1]+Y[GY=Y1]+Z[GZ=Z1]
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             1      3      5      7    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 1   / 1:   3.00   5.00   7.00   ....
+ 3   / 2:   5.00   7.00   9.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ ---- K:2 Z:   3
+ 1   / 1:   5.00   7.00   9.00   ....
+ 3   / 2:   7.00   9.00  11.00   ....
+ 5   / 3:   ....   ....   ....   ....
+ 
+can data/all
+can var/all
+ 
+! Convoluted definitions, LIST needs data on a grid not yet loaded.
+use clim_airt_lev.cdf
+def axis/t=16-JUL-1966:16-MAY-1967:1/unit=month hope_month
+! use climatological_axes
+! can dat climatological_axes
+ 
+let dzdt_month = airt[gt=hope_month]
+let dzdt_clim = airt[gt=month_reg at mod]
+let dzdt_anom = dzdt_month - dzdt_clim[gt=dzdt_month at asn]
+set region/x=100w/y=0
+list dzdt_anom
+             VARIABLE : DZDT_MONTH - DZDT_CLIM[GT=DZDT_MONTH at ASN]
+             FILENAME : clim_airt_lev.cdf
+             SUBSET   : 11 points (TIME)
+             LONGITUDE: 100.5W
+             LATITUDE : 0.2S
+                    100.5W 
+                    130
+ 16-JUL-1966 /  1: -1.422
+ 15-AUG-1966 /  2: -2.972
+ 14-SEP-1966 /  3: -4.503
+ 15-OCT-1966 /  4: -3.882
+ 14-NOV-1966 /  5: -2.580
+ 15-DEC-1966 /  6: -1.080
+ 14-JAN-1967 /  7:  1.424
+ 14-FEB-1967 /  8:  2.962
+ 16-MAR-1967 /  9:  4.503
+ 15-APR-1967 / 10:  3.838
+ 16-MAY-1967 / 11:  2.609
+ 
+ 
+! Symbol substituted on each repetition of REPEAT
+GO bn_reset
+cancel mode verify
+GO err551_repeat_sym.jnl
+ 
+! This had worked, but stopped working in v541
+! symbol substituted on each repetition of REPEAT
+ 
+! (The cause was the fix intended to repair what it
+!  tested in err540_parse_repeat.jnl )
+ 
+def sym a 0; rep/i=1:3:1 (def sym a `i`; say ($a))
+ !-> rep/i=1:3:1 (def sym a `i`; say ($a))
+!-> REPEAT: I=1
+ !-> def sym a 1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: I=2
+ !-> def sym a 2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: I=3
+ !-> def sym a 3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! data from nc file with time axis modulo=value, when regridded to
+! another time axis, some times have missing data
+GO bn_reset
+cancel mode verify
+GO err551_modulo_nc_regrid.jnl
+! data from nc file with time axis having modulo=value, when regridded
+! to another time axis, some times have missing data
+ 
+! First write a file with a monthly climatology:
+ 
+use coads_vwnd
+set region/x=161w/y=39n
+!use climatological_axes
+!can data climatological_axes
+ 
+let vwnd_clim = vwnd[gt=month_reg at mod]
+ 
+save/clobber/file=clim.nc vwnd_clim
+ 
+! File clim.nc is a climatology with the attribute
+!		MONTH_REG:modulo = 8765.82 ;
+ 
+! The data is ok if we now regrid to the monthly_navy_winds time axis
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: VWND
+             FILENAME : coads_vwnd.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                        90
+ 16-NOV-1947 00 / 23: -3.076
+ 16-DEC-1947 12 / 24:  1.674
+ 16-JAN-1948 12 / 25:  3.429
+ 15-FEB-1948 12 / 26:  1.954
+ 16-MAR-1948 12 / 27:  2.761
+ 
+! now use the climatology data file; note that when regridded to the
+! time axis of vwnd, some times have missing data
+ 
+can data/all
+can var/all
+ 
+use coads_vwnd
+use clim
+list/l=23:27 vwnd_clim[gt=vwnd[d=1]]
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+                        regrid: on T
+             FILENAME : clim.nc
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                       161W   
+                         1
+ 16-NOV-1947 00 / 23: -3.076
+ 16-DEC-1947 12 / 24:  1.674
+ 16-JAN-1948 12 / 25:  3.429
+ 15-FEB-1948 12 / 26:  1.954
+ 16-MAR-1948 12 / 27:  2.761
+ 
+ 
+! FFT frequency axis not computed accurately enough.
+GO bn_reset
+cancel mode verify
+GO err551_fft_freqaxis.jnl
+ 
+DEFINE AXIS/t=1:4998:1 dayt
+let tpts = t[gt=dayt]
+ 
+LET sample_function = sin(0.5*tpts - 6.)/2. - cos(0.3*tpts)
+ 
+LET days_fft = ffta(sample_function)
+LOAD days_fft
+LET FFT_nf = `days_fft,return=lend`
+ !-> DEFINE VARIABLE FFT_nf = 2499
+ 
+list FFT_nf
+             VARIABLE : 2499
+          2499.
+list 2*FFT_nf
+             VARIABLE : 2*FFT_NF
+          4998.
+list `tpts,return=lend`
+ !-> list 4998
+             VARIABLE : constant
+          4998.
+ 
+ 
+! No error message on request for time on bad time axis
+GO bn_reset
+cancel mode verify
+GO err551_no_taxis_errmsg.jnl
+! The time axis is bad, having repeated values, so an abstract axis is
+! used by Ferret and the list/t=time should result in an error.
+ 
+SET MODE IGNORE_ERROR
+ 
+use bad_taxis.nc
+list/t=1-jan-1990 dummy
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_set_var_scale_off.jnl
+! Qualifiers /SCALEFACTOR=  and /OFFSET  for SET VARIABLE.
+! Only for NetCDF datasets
+! Applied after NetCDF Scale_factor and add_offset attributes
+! New RETURN= arguments NC_SCALE, NC_OFF for values of NetCDF attributes
+!             and USER_SCALE, USER_OFF for those set with SET VAR
+ 
+! This dataset has scale_factor and add_offset attributes.
+ 
+USE err491_attval
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          2.97979
+SET VAR/OFFSET=1 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          3.97979
+SET VAR/SCALE=10 elev
+LIST/NOHEAD/PREC=6 elev[x=@ave,y=@ave]
+          30.7979
+ 
+! Output the values of the scales and offsets
+ 
+SAY `elev,RETURN=nc_scale`
+ !-> MESSAGE/CONTINUE 0.0002746749679546
+0.0002746749679546
+SAY `elev,RETURN=nc_off`
+ !-> MESSAGE/CONTINUE 0
+0
+SAY `elev,RETURN=user_scale`
+ !-> MESSAGE/CONTINUE 10
+10
+SAY `elev,RETURN=user_off`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+! These SET VAR will produce error msgs: qualifiers are set up only for
+! variables in NetCDF files
+ 
+SET MODE IGNORE_ERROR
+ 
+FILE/VAR=x1,x2 EZ.DAT
+ 
+SET VAR/OFFSET=1 x1
+SET VAR/SCALE=10 x2
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_longvarnames.jnl
+! variable names up to 128 characters long
+! 3/2006 make them 127 to be able to add the null terminator for C strings
+!        else not used correctly in linked-list attribute structure.
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.00
+ 2   / 2:  14.00
+ 3   / 3:  20.00
+ 4   / 4:  28.00
+ 5   / 5:  22.00
+ 6   / 6:  10.00
+ 
+! With a transformation, which makes the whole specification longer
+ 
+list a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567,\
+  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567[i=@SHF:1]
+             X: 0.5 to 6.5
+ Column  1: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567 is {12,14,20,28,22,10}
+ Column  2: A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567* is {12,14,20,28,22,10} (shifted by 1 pts on X)
+       A2345678  A234567890B234567890C234567890D234567890E234567890F234567890G234567890H234567890I234567890D234567890J234567890K234567890L234567
+1   / 1:   12.00   14.00
+2   / 2:   14.00   20.00
+3   / 3:   20.00   28.00
+4   / 4:   28.00   22.00
+5   / 5:   22.00   10.00
+6   / 6:   10.00    ....
+ 
+! SET GRID using long variable name
+SET GRID a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+SHOW GRID
+ Default grid for DEFINE VARIABLE is XABSTRACT
+ Last successful data access was on grid XABSTRACT
+    GRID XABSTRACT
+ name       axis              # pts   start                end
+ ABSTRACT  X             99999999 r   1                    1.E+08
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+ 
+ 
+! save to a file a variable that is 128 long
+GO bn_reset
+cancel mode verify
+ 
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = {12,14,20,28,22,10}
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+! read from the file
+GO bn_reset
+cancel mode verify
+USE longvname
+LIST a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : {12,14,20,28,22,10}
+             FILENAME : longvname.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:  12.00
+ 2   / 2:  14.00
+ 3   / 3:  20.00
+ 4   / 4:  28.00
+ 5   / 5:  22.00
+ 6   / 6:  10.00
+ 
+! save a 4-D variable
+GO bn_reset
+cancel mode verify
+LET a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567 = I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+SAVE/CLOBBER/FILE=longvname.nc a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+ 
+GO bn_reset
+cancel mode verify
+USE longvname.nc
+lIST/I=1/J=2 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 3 by 3 points (Z-T)
+             X        : 1
+             Y        : 2
+             1      2      3    
+             1      2      3
+ 1   / 1:  3.000  5.000  7.000
+ 2   / 2:  4.000  6.000  8.000
+ 3   / 3:  5.000  7.000  9.000
+LIST/K=2/L=3 a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890d234567890j234567890k234567890L234567
+             VARIABLE : I[I=1:5] * J[J=1:4] * K[K=1:3] + L[L=1:3]
+             FILENAME : longvname.nc
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 2
+             T        : 3
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   5.00   7.00   9.00  11.00  13.00
+ 2   / 2:   7.00  11.00  15.00  19.00  23.00
+ 3   / 3:   9.00  15.00  21.00  27.00  33.00
+ 4   / 4:  11.00  19.00  27.00  35.00  43.00
+*** Running test: bn_shakey.jnl
+! Changes to shade key:
+! - Default size is a little bigger
+! - To put key labels on the left or bottom of the key, multiply the size by -1
+! - Previously ALL OF kx_lo, kx_hi,ky_lo, ky_hi had to be set, or none of them
+!   were applied. With changes as of 3/3/03 can set any of these independently.
+!   If, say only x1 and y1 are set, the other corners are set, keeping the default
+!   width and/or height.
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+shade/title="shift shakey left and up"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x1 = 9.125
+let y1 = `($ppl$yorg)+.4`
+ !-> DEFINE VARIABLE y1 = 1.775
+ 
+ppl shakey ,,.12,,,,`x1`,,`y1`
+ !-> ppl shakey ,,.12,,,,9.125,,1.775
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         9.13     9.52     1.77     7.53
+ 
+shade/title="set only x2,y2"/set temp[l=1]
+ 
+let x2 = `($ppl$xorg)+($ppl$xlen)`
+ !-> DEFINE VARIABLE x2 = 9.125
+let y2 = `($ppl$yorg)+($ppl$ylen) - .4`
+ !-> DEFINE VARIABLE y2 = 6.725
+ 
+ppl shakey ,,.12,,,,,`x2`,,`y2`
+ !-> ppl shakey ,,.12,,,,,9.125,,6.725
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.12        0        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         8.73     9.13     0.98     6.72
+ 
+ 
+! resetting location of horizontal shade keys
+ 
+shade/title="shakey labels above it"/set temp[l=1]
+ 
+let x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE x1 = 1.475
+let y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE y1 = 7.225
+let y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE y2 = 7.625
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.475,,7.225,7.625
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.48     9.23     7.22     7.63
+ 
+ 
+let x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE x1 = 2.375
+let x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE x2 = 8.125
+let y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = 1.375
+shade/title="shorter, at bottom"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.375,8.125,1.375
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        3        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         2.38     8.13     1.38     1.46
+ 
+shade/title="on left, labelled on left"/set temp[l=1]
+ppl axlabp, 1,1
+ 
+let x1 = `($ppl$xorg)`  - .5
+ !-> DEFINE VARIABLE x1 = 1.375  - .5
+let x2 = `($ppl$xorg)`  - 0.1
+ !-> DEFINE VARIABLE x2 = 1.375  - 0.1
+ppl shakey ,1,-.1,2,,,`x1`,`x2`
+ !-> ppl shakey ,1,-.1,2,,,0.875,1.275
+ppl shade
+ 
+ppl axlabp, -1, -1
+ 
+set view upper
+ppl window off
+let y1 = -1* `($ppl$yorg)`
+ !-> DEFINE VARIABLE y1 = -1* 1.375
+shade/title="In viewport, shakey located anywhere on page"/set temp[l=1]
+ppl shakey ,0,-.1,2,,,,,`y1`
+ !-> ppl shakey ,0,-.1,2,,,,,-1.375
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.10        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.38     9.13    -1.38    -1.29
+*** Running test: bn_eof_4d.jnl
+! bn_eof_4d.jnl
+! test EOFs on XYZT grids
+ 
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! dataset with 4 dimensions; compute EOF at each vertical level.
+ 
+use gt4d011.cdf
+ 
+let eofsp = eofsvd_space (temp[i=91:95,j=36:40,k=1:4])
+save/file=eofsp.cdf/clobber eofsp
+ 
+can data/all
+can var/all
+use eofsp
+ 
+set view ul
+shade eofsp[k=1,l=1]
+list eofsp[k=1,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  2.254  2.347  2.424  2.475  2.501
+ 2.17S / 4:  2.270  2.361  2.431  2.477  2.503
+ 2.5S  / 3:  2.266  2.351  2.413  2.455  2.481
+ 2.83S / 2:  2.234  2.307  2.359  2.396  2.424
+ 3.17S / 1:  2.168  2.227  2.269  2.300  2.330
+set view ur
+shade eofsp[k=2,l=1]
+list eofsp[k=2,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 15
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  2.282  2.377  2.454  2.507  2.535
+ 2.17S / 4:  2.296  2.390  2.461  2.509  2.536
+ 2.5S  / 3:  2.291  2.377  2.441  2.485  2.512
+ 2.83S / 2:  2.257  2.333  2.386  2.424  2.452
+ 3.17S / 1:  2.191  2.251  2.294  2.325  2.356
+ 
+set view ll
+shade eofsp[k=3,l=1]
+list eofsp[k=3,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 25
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  1.723  1.840  1.941  2.005  2.047
+ 2.17S / 4:  1.639  1.744  1.831  1.882  1.920
+ 2.5S  / 3:  1.515  1.605  1.676  1.714  1.746
+ 2.83S / 2:  1.358  1.428  1.481  1.503  1.528
+ 3.17S / 1:  1.175  1.222  1.256  1.263  1.282
+set view lr
+shade eofsp[k=4,l=1]
+list eofsp[k=4,l=1]
+             VARIABLE : EOFSVD_SPACE (TEMP[I=91:95,J=36:40,K=1:4])
+             FILENAME : eofsp.cdf
+             SUBSET   : 5 by 5 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 35
+             T        : 1
+             139.5W 138.5W 137.5W 136.5W 135.5W 
+               1      2      3      4      5
+ 1.83S / 5:  1.216  1.301  1.374  1.422  1.452
+ 2.17S / 4:  1.086  1.164  1.229  1.270  1.298
+ 2.5S  / 3:  0.937  1.006  1.059  1.091  1.116
+ 2.83S / 2:  0.772  0.830  0.869  0.891  0.911
+ 3.17S / 1:  0.599  0.641  0.666  0.681  0.700
+ 
+can data/all
+ 
+ 
+use gt4d011.cdf
+ 
+let eofti = eofsvd_tfunc (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofti.cdf/clobber eofti
+ 
+can data/all
+can var/all
+can view
+use eofti
+ 
+set view ul
+plot eofti[i=1,k=1], eofti[i=2,k=1], eofti[i=3,k=1]
+list eofti[l=1:5,i=1,k=1]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 5
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -1.812
+ 23-AUG-1982 14 / 2: -1.758
+ 29-AUG-1982 16 / 3: -1.678
+ 04-SEP-1982 18 / 4: -1.571
+ 10-SEP-1982 20 / 5: -1.427
+set view ur
+plot eofti[i=1,k=5], eofti[i=2,k=5], eofti[i=3,k=5]
+list eofti[l=1:5,i=1,k=5]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 45
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -2.218
+ 23-AUG-1982 14 / 2: -2.049
+ 29-AUG-1982 16 / 3: -1.774
+ 04-SEP-1982 18 / 4: -1.412
+ 10-SEP-1982 20 / 5: -1.053
+ 
+set view ll
+plot eofti[i=1,k=8], eofti[i=2,k=8], eofti[i=3,k=8]
+list eofti[l=1:5,i=1,k=8]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 75
+                        1    
+                        1
+ 17-AUG-1982 12 / 1: -1.776
+ 23-AUG-1982 14 / 2: -1.455
+ 29-AUG-1982 16 / 3: -1.242
+ 04-SEP-1982 18 / 4: -1.051
+ 10-SEP-1982 20 / 5: -0.847
+set view lr
+plot eofti[i=1,k=4], eofti[i=2,k=10], eofti[i=3,k=10]
+list eofti[l=1:5,i=1,k=10]
+             VARIABLE : EOFSVD_TFUNC (TEMP[I=91:95,J=36:40,K=1:10])
+                        T=14-AUG-1982 11:00:13-JAN-1983 13:00
+             FILENAME : eofti.cdf
+             SUBSET   : 5 points (TIME)
+             X        : 1
+             DEPTH (m): 95
+                        1     
+                         1
+ 17-AUG-1982 12 / 1:  0.0037
+ 23-AUG-1982 14 / 2: -0.1892
+ 29-AUG-1982 16 / 3: -0.2982
+ 04-SEP-1982 18 / 4: -0.4057
+ 10-SEP-1982 20 / 5: -0.5178
+ 
+can data/all
+ 
+ 
+ 
+use gt4d011.cdf
+ 
+let eofst = eofsvd_stat (temp[i=91:95,j=36:40,k=1:10])
+save/file=eofst.cdf/clobber eofst
+ 
+can data/all
+can var/all
+use eofst
+ 
+list/nohead/i=1/j=1/k=1:10 eofst   ! # eigenfcns, same at all depths
+ 5     /  1:  25.00
+ 15    /  2:  25.00
+ 25    /  3:  25.00
+ 35    /  4:  25.00
+ 45    /  5:  25.00
+ 55    /  6:  25.00
+ 65    /  7:  25.00
+ 75    /  8:  25.00
+ 85    /  9:  25.00
+ 95    / 10:  25.00
+ 
+list/nohead/i=1:5/j=2 eofst[k=1:10:4]  ! pct variance explained
+ 5     / 1:  99.27   0.68   0.03   0.02   0.00
+ 45    / 2:  98.65   1.15   0.15   0.03   0.02
+ 85    / 3:  95.12   4.57   0.22   0.07   0.01
+ 
+list/nohead/i=1:5/j=3/k=1 eofst  ! eigenvalues
+ 1   / 1:  139.6
+ 2   / 2:    1.0
+ 3   / 3:    0.0
+ 4   / 4:    0.0
+ 5   / 5:    0.0
+list/nohead/i=1:5/j=3/k=5 eofst
+ 1   / 1:  10.86
+ 2   / 2:   0.13
+ 3   / 3:   0.02
+ 4   / 4:   0.00
+ 5   / 5:   0.00
+list/nohead/i=1:5/j=3/k=9 eofst
+ 1   / 1:  2.236
+ 2   / 2:  0.107
+ 3   / 3:  0.005
+ 4   / 4:  0.002
+ 5   / 5:  0.000
+ 
+ 
+exit/script
+*** Running test: bn_abstract_axis_names.jnl
+! bn_abstract_axis_names.jnl
+! acm 6/12/03
+!
+! Write and read datafiles with no clues about axis orientation from
+! the units or axis name.  Getting the axis direction depends on the AXIS
+! attribute in .nc files, and on use of the new line_direction(iaxis) = 'XX'
+! or 'YY' in cd_get_1_axis, xeq_define, tm_axis_direction, show_line.F
+ 
+! Define axes with confusing axis names (z in an X axis, X in a Z axis, etc)
+ 
+def axis/x=1:10:1 horiz
+def axis/y=10:80:10 the
+def axis/z=-4:1:1 xxx
+def axis/t=1:13:2 long
+ 
+show axis horiz
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis the
+ name       axis              # pts   start                end
+ THE       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis xxx
+ name       axis              # pts   start                end
+ XXX       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis long
+ name       axis              # pts   start                end
+ LONG      T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=horiz]  + z[gz=xxx]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=the] + z[gz=xxx]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=the] + t[gt=long]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=xxx] + t[gt=long]+ y[gy=the]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis horiz
+cancel axis the
+cancel axis xxx
+cancel axis long
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ HORIZ     X                   10 r   1                    10
+ normal    Y
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ normal    Z
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ THE       Y                    8 r   10                   80
+ XXX       Z                    6 r   -4                   1
+ LONG      T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+ 
+! Define axes with meaningless axis names.
+ 
+def axis/x=1:10:1 aaa
+def axis/y=10:80:10 bbb
+def axis/z=-4:1:1 ccc
+def axis/t=1:13:2 ddd
+ 
+show axis aaa
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+   Axis span (to cell edges) = 10
+show axis bbb
+ name       axis              # pts   start                end
+ BBB       Y                    8 r   10                   80
+   Axis span (to cell edges) = 80
+show axis ccc
+ name       axis              # pts   start                end
+ CCC       Z                    6 r   -4                   1
+   Axis span (to cell edges) = 6
+show axis ddd
+ name       axis              # pts   start                end
+ DDD       T                    7 r   1                    13
+   Axis span (to cell edges) = 14
+ 
+! Write files with different combinations of axes.
+ 
+let r =  x[gx=aaa]  + z[gz=ccc]
+save/clobber/file=confuse_xz.nc r
+ 
+let s =  y[gy=bbb] + z[gz=ccc]
+save/clobber/file=confuse_yz.nc s
+ 
+let u =  y[gy=bbb] + t[gt=ddd]
+save/clobber/file=confuse_yt.nc u
+ 
+let v =  z[gz=ccc] + t[gt=ddd]+ y[gy=bbb]
+save/clobber/file=confuse_yzt.nc v
+ 
+ 
+! Now read the files and see that the vars have the right shape
+cancel data/all
+cancel var/all
+cancel axis aaa
+cancel axis bbb
+cancel axis ccc
+cancel axis ddd
+ 
+use confuse_xz.nc
+sh grid r
+    GRID GAP1
+ name       axis              # pts   start                end
+ AAA       X                   10 r   1                    10
+ normal    Y
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yz.nc
+sh grid s
+    GRID GBA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ normal    T
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yt.nc
+sh grid u
+    GRID GGY1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ normal    Z
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+ 
+use confuse_yzt.nc
+sh grid v
+    GRID GFA1
+ name       axis              # pts   start                end
+ normal    X
+ BBB       Y                    8 r   10                   80
+ CCC       Z                    6 r   -4                   1
+ DDD       T                    7 r   1                    13
+ normal    E
+ normal    F
+can data 1
+*** Running test: bn_many_polygons.jnl
+! testing large number of polygons in a plot.  Map plot has
+! 130501 polygons; previously we had an upper limit of 100K polygons
+ 
+use coads_climatology
+def axis/x=0:360:0.5 xq
+def axis/y=-90:90:0.5 yq
+def axis/y=-90:90:1 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+shade/title="loading polygon at each grid point" sst[l=1]   ! Set up plot params for polymark.jnl
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+go polymark poly/key/pal=dark_land_sea/title="130501 polygons", lon, lat, xsequence(fsst), square, 0.3
+ 
+ 
+! Test that everythings properly reset afterwards.
+! single polygon.
+ 
+polygon/thick/color=red/palette=blue/axes=1,0,1,0 {1,2,1}, {2,1,0.5}
+ 
+! Now test that is still also works with the 2-D mode of polygons.
+ 
+let xtriangle = ysequence({-1,0,1})
+let ytriangle = ysequence({-1,1,-1})
+let xpts = 180 + 30*randu(i[i=1:10])
+let ypts = 30*randu(1+i[i=1:10])
+polygon xtriangle+xpts, ytriangle+ypts, i[i=1:10]
+*** Running test: bn_fill_irregular.jnl
+! FILL on vars with irregular axes
+ 
+use gtbc011
+fill/i=70/l=1 temp
+can data/all
+ 
+def ax/t tax = {1,5,6,7}
+let v = t[gt=tax]+z[gz=1:3:1]
+fill v
+ 
+def ax/x xax = {1,5,6,7}
+let v = x[gx=xax]-z[gz=1:3:1]
+fill v
+ 
+use test_subspan_modulo.nc
+fill v2d_irr[x=-100:100]
+fill v2d_irr[t=1-jan-1990:1-jan-1995]
+ 
+use coads_clim_irreg.des
+fill/x=180 sst
+*** Running test: bn_xml_output.jnl
+!bn_xml_output.jnl
+! new-V553 output in XML-style format
+! Illustrate the SHOW commands with /XML xml-style output
+! V5.80 11/04 new tests for SHOW VAR/XML; global variables.
+ 
+! 22-Feb-2005 use SHO AXIS/XML `temp,return=taxis` instead
+! of naming the axes; other axes of the same name (e.g. TIME)
+! may have been defined in other benchmark scrips.
+ 
+USE gtsa056_2.cdf
+ 
+SHO DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+</dataset>
+</datasets>
+ 
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+SHO GRID/XML ps3du1
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+ 
+SHO AXIS/XML `temp,return=xaxis`
+ !-> SHO AXIS/XML PSXT
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=yaxis`
+ !-> SHO AXIS/XML PSYT
+<axes>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=zaxis`
+ !-> SHO AXIS/XML PSZT
+<axes>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+</axes>
+SHO AXIS/XML `temp,return=taxis`
+ !-> SHO AXIS/XML TIME
+<axes>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! Define a dataset variable
+! SHOW/XML commands list it w/ its dataset (even if dataset is not default)
+LET/D=gtsa056_2 temp_180 = temp[X=160E:160W at AVE]
+ 
+USE coads_climatology
+ 
+SHOW DATA/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP" />
+<var name="U" />
+<var name="W" />
+<var name="TAUX" />
+<var name="TEMP_180" />
+</dataset>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST" />
+</dataset>
+</datasets>
+SHO DATA/VAR/XML
+<datasets>
+<dataset name="./gtsa056_2.cdf" default="false">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[deg. C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="U">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="W">
+<attribute name="units" type="char">
+   <value><![CDATA[cm/sec]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[VERTICAL VELOCITY]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS3DW1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZW</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="TAUX">
+<attribute name="units" type="char">
+   <value><![CDATA[dynes/cm**2]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZONAL WIND STRESS]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="PS2DU1">
+<axes>
+<xaxis>PSXU</xaxis>
+<yaxis>PSYU</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="temp_180">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[TEMP[X=160E:160W at AVE]]]></value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<yaxis>PSYT</yaxis>
+<zaxis>PSZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="PSXT">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>130.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>289.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXT]]></value>
+</attribute>
+</axis>
+<axis name="PSXU">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LONGITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>160</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>131</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>290</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSXU]]></value>
+</attribute>
+</axis>
+<axis name="PSYT">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-28.83607</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>48.56797</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYT]]></value>
+</attribute>
+</axis>
+<axis name="PSYU">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[LATITUDE]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>100</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-27.67214</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50.00005</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSYU_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSYU]]></value>
+</attribute>
+</axis>
+<axis name="PSZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>3824</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZT_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZT]]></value>
+</attribute>
+</axis>
+<axis name="PSZW">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>27</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>4149</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value><![CDATA[PSZW_bnds]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[PSZW]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>168</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1982-01-15 14:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1983-06-07 13:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1976-01-14 14:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME1">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+! tests of SHOW VAR/XML for global variables.
+CAN DATA/ALL
+CAN VAR/ALL
+ 
+USE coads_climatology
+USE gtsa056_2
+ 
+! Define a dataset variable
+LET/D=gtsa056_2 temp_20 temp[Z=0:20 at SUM]
+ 
+! Define a global variable
+LET t30 = temp[Z=0:30 at SUM]
+ 
+! Another variable, setting title, units, bad flag.
+LET/UNITS="Deg C"/BAD=100/TITLE="Indefinite integral of SALT" salty = salt[Z=@IIN]
+ 
+! Define a constant
+LET pi = 3.14
+ 
+! Another variable, irrelevant in the current context
+LET my_sst = sst*12
+ 
+! This lists all the variables except my_sst
+ 
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+<var name="T30">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:30 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Now change datasets, so my_sst has a context, but t30
+! does not temp_20 is listed because it is defined on a dataset
+ 
+SET DATA coads_climatology
+SHO VAR/XML
+<global>
+<var name="TEMP_20[D=./gtsa056_2.cdf]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=0:20 at SUM]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT1">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! Change default dataset. Now we should just see pi and my_sst
+ 
+CAN DATA gtsa056_2
+SHOW VAR/XML
+<global>
+<var name="MY_SST">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST*12]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+<var name="PI">
+<attribute name="definition" type="char">
+   <value><![CDATA[3.14]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="ABSTRACT">
+<axes>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! 8/7/2007
+! new form for output of a var whose definition contains quotes
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+ 
+USE coads_climatology
+LET t3 = sst[x=180,y=1,t="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]
+SHOW VAR/XML
+<global>
+<var name="T3">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[X=180,Y=1,T="15-jan-0000:00:00":"15-feb-0000:00:00"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+*** Running test: bn_test_nan.jnl
+!bn_test_nan.jnl
+! test to make sure that NaN is able to be set by user
+!  as bad value.  If this fails, Ferret will crash
+!  Test on a file which is nothing but NaN's, and use
+!  various spellings of NaN
+!
+! 9/03 *kob*
+!
+ 
+ 
+ 
+! test "nan"
+use test_nan.nc
+set var/bad=nan p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NaN"
+use test_nan.nc
+set var/bad=NaN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+! test "NAN"
+use test_nan.nc
+set var/bad=NAN p1
+list p1
+             VARIABLE : Pressure (dbar)
+             FILENAME : test_nan.nc
+             SUBSET   : 10 points (TIME)
+ 13-OCT-2001 07:21:50 /  1:....
+ 13-OCT-2001 07:21:51 /  2:....
+ 13-OCT-2001 07:21:52 /  3:....
+ 13-OCT-2001 07:21:53 /  4:....
+ 13-OCT-2001 07:21:54 /  5:....
+ 13-OCT-2001 07:21:55 /  6:....
+ 13-OCT-2001 07:21:56 /  7:....
+ 13-OCT-2001 07:21:57 /  8:....
+ 13-OCT-2001 07:21:58 /  9:....
+ 13-OCT-2001 07:21:59 / 10:....
+can data/all
+can var/all
+ 
+ 
+ 
+ 
+ 
+*** Running test: bn553_bug_fixes.jnl
+! bn553_bug_fixes.jnl
+! test various fixes that went into version 5.52
+! 9/03 *kob*
+!
+ 
+! Make sure numeric filenames works
+GO bn_reset
+cancel mode verify
+GO err553_numeric_filename.jnl
+! err553_numeric_filename.jnl
+! 9/03 kob
+ 
+ 
+! Use of a filename begining w/ a numberic was a problem
+! w/ g77 - just make sure it works where
+use 123456789000101_100101_test_numeric.nc
+ 
+list vwnd_clim
+             VARIABLE : VWND[GT=MONTH_REG at MOD]
+             FILENAME : 123456789000101_100101_test_numeric.nc
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 161W
+             LATITUDE : 39N
+                    161W   
+                      1
+ 16-JAN      /  1:  3.437
+ 15-FEB      /  2:  1.925
+ 17-MAR      /  3:  2.790
+ 16-APR      /  4:  1.790
+ 16-MAY      /  5:  0.800
+ 16-JUN      /  6:  3.800
+ 16-JUL      /  7: -0.200
+ 16-AUG      /  8:  0.465
+ 15-SEP      /  9:  2.572
+ 16-OCT      / 10: -2.530
+ 15-NOV      / 11: -3.090
+ 16-DEC      / 12:  1.787
+ 
+ 
+ 
+! Make sure long string variables work
+GO bn_reset
+cancel mode verify
+GO err553_long_string_var_name.jnl
+! err553_long_string_var_name.jnl
+! 9/03 kob
+ 
+ 
+ 
+! test long string variables - the were being truncated
+! at 100 characters
+ 
+ 
+let a = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+list a
+             VARIABLE : "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+        "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ 
+ 
+ 
+ 
+ 
+! Fixes for colorbar key labelling
+GO bn_reset
+cancel mode verify
+GO err551_colorkey.jnl
+ 
+! colorkey label bugs
+ 
+ 
+let zero = 0*x[i=1:10]+0*y[j=1:10]
+set view ul; shade zero            !This one is labeled correctly.
+set view ur; shade 1+zero          !So is this.
+set view ll; shade/lev=c zero      !But here colorkey is 1:1 instead of 0:0.
+ 
+! Here the zero level is labelled as -.3e-08 rather than 0. (linux)
+can view
+use coads_climatology
+shade/l=1/lev=30/set (sst-10)/10
+ppl axlen 6
+ppl shakey 1,1,.12
+ppl shade
+ 
+*** Running test: bn_graticules.jnl
+! /GRAT, /HGRAT and /VGRAT to set graticule lines
+! ACM March 12, 2004
+! ACM 4/2005 set mode meta to save one of the plots for the metafile checks.
+!            and cancel mode logo, so that .plt files are comparable.
+ 
+ppl axnmtc,2,2
+ 
+ ! GRAT on plot commands
+PLOT/grat/i=1:100 sin(i/5)
+let a = sin(i/5) * cos(j/8)
+CONTOUR/color=ligh/grat=(color=red)/i=1:100/j=1:80 a
+use coads_climatology
+! KMS - white changed to green for PyFerret - white causing problems
+SHADE/grat=(color=green) sst[L=1]
+FILL/grat=dash sst[l=1]
+VECTOR/color=red/grat=(blue,dash) sst[l=1], sst[l=2]
+let b = {1,2,1}
+let c = {2,1,0.5}
+POLYGON/thick/color=red/pal=blue/grat b,c
+ 
+! More complex GRAT arguments
+plot/grat="large(dash),small(dash,color=blue)"/i=1:100 sin(i/5)
+contour/color=ligh/grat="large(color=purple,thick=3,line),small(dash,color=blue)"/i=1:100/j=1:80 a
+shade/grat="small(color=lightblue),large(thick,color=lightblue)" sst[l=1]
+fill/i=1:50/j=1:30/grat="large(line),small(dash,color=lightblue)" i+j
+! KMS - white changed to green for PyFerret - white causing problems
+poly/thi/col=red/pal=blue/grat="lar(col=pur,thi=3,lin),sma(dash,col=green)" b,c
+vector/i=1:50/j=1:30/grat="small(color=black),large(thick,color=blue)"  sst[l=1], sst[l=2]
+ 
+! /HGRAT and /VGRAT
+plot/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash),large(color=blue,line,thick)/i=1:100 sin(i/5)
+plot/hg=small(color=red,dash,thick=1),large(color=blue,line,thick=3)/vg=large(line,color=red),small(dash,color=blue)/i=1:100 sin(i/5)
+ 
+! Log axes: VLOG and HLOG with large and small tics
+ 
+set mode meta graticules.plt
+can mode logo
+ 
+set view left
+def axis/z zlog=exp(k[k=1:10])
+let fcn = k[gz=zlog]
+plot/vlog/vlimits=1:100000/grat="large(color=black),small(color=lightblue)" fcn
+ 
+set view right
+def axis/z/depth dlog=exp(k[k=1:20])
+let fcn = k[gz=dlog]
+plot/vlog/vlimits=1:100000/hg="large(color=red),small(color=lightblue)" fcn
+ 
+can mode meta
+set mode logo
+ 
+can view
+ 
+! HLOG and VLOG
+ 
+def axis/x ddlog = exp(-1*(10-i[i=1:10]))
+let fcn = (i[gx=ddlog])^2
+plot/thick/hlog/vlog/grat="large(color=red),small=(color=lightblue)" fcn
+ 
+! Time axes
+let a = sin(t[gt=tax]/5)
+let b = sin(t[gt=tax]/100)
+ 
+def axis/t=1-jan-1990:1-jan-1998:1/units=months tax
+ 
+plot/t=1-jan-1990:31-dec-1992/trans/hg="large(dash,color=blue),small(line,color=lightblue)"/vg="(line,color=blue)" a
+ 
+def axis/t=1-jan-1990:1-mar-1990:1/units=days tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1950:1-jan-1990:1/units=years tax
+plot/hg="(line,color=blue)"/vg="large(line,color=blue),small(line,color=lightblue)" a
+plot/trans/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" a
+ 
+def axis/t=1-jan-1800:1-jan-1990:1/units=years tax
+plot/thick/trans/grat="(line,color=blue)" a
+ 
+def axis/t="1-jan-1990:01":"2-jan-1990:12:00":1/units=minutes tax
+plot/thick/grat="large(line,color=blue),small(line,color=lightblue)" b
+plot/trans/thick/vg="(line,color=blue)"/hg="large(line,color=blue),small(line,color=lightblue)" b
+ 
+! Tests for MODE GRATICULE  added in Ferret v5.7
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE     CANCELLED
+set mode graticule
+show mode graticule
+      MODE            STATE        ARGUMENT
+      GRATICULE        SET
+ 
+PLOT/i=1:100 sin(i/5)
+can mode graticule
+ 
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:color=red
+PLOT/i=1:100 cos(i/5)
+set mode graticule:(thick,color=red)
+PLOT/i=1:100 cos(i/5)
+ 
+set mode graticule:(dash,color=blue)
+PLOT/i=1:100 cos(i/5)
+can mode graticule
+ 
+pplus/reset   ! restore tics etc
+ 
+*** Running test: bn_repeat_range.jnl
+! REPEAT/RANGE=[/NAME=]  for looping without depending
+! on the grid\
+! ACM March 12, 2004
+ 
+! simplest syntax
+ 
+repeat/range=5:1:-1 say what
+!-> REPEAT: REPCOUNT:5
+what
+!-> REPEAT: REPCOUNT:4
+what
+!-> REPEAT: REPCOUNT:3
+what
+!-> REPEAT: REPCOUNT:2
+what
+!-> REPEAT: REPCOUNT:1
+what
+repeat/range=1:5:3/name=s (list/nohead s)
+!-> REPEAT: S:1
+          1.000
+!-> REPEAT: S:4
+          4.000
+sh var s  ! counter variable goes away after a repeat
+ 
+! Nested loops, and calling a function
+repeat/range=1:5:3/name=s (repeat/range=1:3/name=tt list sin(tt))
+!-> REPEAT: S:1
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.8415
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.9093
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.1411
+!-> REPEAT: S:4
+!-> REPEAT: TT:1
+             VARIABLE : SIN(TT)
+          0.8415
+!-> REPEAT: TT:2
+             VARIABLE : SIN(TT)
+          0.9093
+!-> REPEAT: TT:3
+             VARIABLE : SIN(TT)
+          0.1411
+ 
+! Nested, use counter variables in computation
+can mode ver
+I / *:     80.00  6.000  480.0
+I / *:     80.00  8.000  640.0
+I / *:     80.00  10.00  800.0
+I / *:     60.00  6.000  360.0
+I / *:     60.00  8.000  480.0
+I / *:     60.00  10.00  600.0
+I / *:     40.00  6.000  240.0
+I / *:     40.00  8.000  320.0
+I / *:     40.00  10.00  400.0
+I / *:     20.00  6.000  120.0
+I / *:     20.00  8.000  160.0
+I / *:     20.00  10.00  200.0
+ 
+! Nested with a standard repeat loop over Z
+repeat/range=100:200:50/name=m (repeat/z=8:10 list m*z)
+!-> REPEAT: M:100
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          800.0
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          900.0
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1000.
+!-> REPEAT: M:150
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1200.
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1350.
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          1500.
+!-> REPEAT: M:200
+!-> REPEAT: Z=8
+             VARIABLE : M*Z
+             Z        : 8
+          1600.
+!-> REPEAT: Z=9
+             VARIABLE : M*Z
+             Z        : 9
+          1800.
+!-> REPEAT: Z=10
+             VARIABLE : M*Z
+             Z        : 10
+          2000.
+repeat/z=1:3 (repeat/range=1000:2000:1000/name=m list m*z)
+!-> REPEAT: Z=1
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 1
+          1000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 1
+          2000.
+!-> REPEAT: Z=2
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 2
+          2000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 2
+          4000.
+!-> REPEAT: Z=3
+!-> REPEAT: M:1000
+             VARIABLE : M*Z
+             Z        : 3
+          3000.
+!-> REPEAT: M:2000
+             VARIABLE : M*Z
+             Z        : 3
+          6000.
+ 
+! With regions defined
+set reg/x=-9:9
+repeat/range=1:4/name=m (repeat/range=44:45/name=p list p)
+!-> REPEAT: M:1
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:2
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:3
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+!-> REPEAT: M:4
+!-> REPEAT: P:44
+             VARIABLE : constant
+          44.00
+!-> REPEAT: P:45
+             VARIABLE : constant
+          45.00
+ 
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5 (let a = 6; list a)
+!-> REPEAT: REPCOUNT:1
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:2
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:3
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:4
+             VARIABLE : 6
+          6.000
+!-> REPEAT: REPCOUNT:5
+             VARIABLE : 6
+          6.000
+repeat/range=1:5/name=p (let a = 6; list p)
+!-> REPEAT: P:1
+             VARIABLE : constant
+          1.000
+!-> REPEAT: P:2
+             VARIABLE : constant
+          2.000
+!-> REPEAT: P:3
+             VARIABLE : constant
+          3.000
+!-> REPEAT: P:4
+             VARIABLE : constant
+          4.000
+!-> REPEAT: P:5
+             VARIABLE : constant
+          5.000
+ 
+! Region applies to data, not to loop index.
+use coads_climatology
+let xx = x[gx=sst]
+set reg/x=-180:-160/y=1:15/z=-10000:-1000/t="1-jan-1990"
+repeat/range=1:5/name=p (list p*xx)
+!-> REPEAT: P:1
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -179.0
+ 177W    / -98: -177.0
+ 175W    / -97: -175.0
+ 173W    / -96: -173.0
+ 171W    / -95: -171.0
+ 169W    / -94: -169.0
+ 167W    / -93: -167.0
+ 165W    / -92: -165.0
+ 163W    / -91: -163.0
+ 161W    / -90: -161.0
+!-> REPEAT: P:2
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -358.0
+ 177W    / -98: -354.0
+ 175W    / -97: -350.0
+ 173W    / -96: -346.0
+ 171W    / -95: -342.0
+ 169W    / -94: -338.0
+ 167W    / -93: -334.0
+ 165W    / -92: -330.0
+ 163W    / -91: -326.0
+ 161W    / -90: -322.0
+!-> REPEAT: P:3
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -537.0
+ 177W    / -98: -531.0
+ 175W    / -97: -525.0
+ 173W    / -96: -519.0
+ 171W    / -95: -513.0
+ 169W    / -94: -507.0
+ 167W    / -93: -501.0
+ 165W    / -92: -495.0
+ 163W    / -91: -489.0
+ 161W    / -90: -483.0
+!-> REPEAT: P:4
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -716.0
+ 177W    / -98: -708.0
+ 175W    / -97: -700.0
+ 173W    / -96: -692.0
+ 171W    / -95: -684.0
+ 169W    / -94: -676.0
+ 167W    / -93: -668.0
+ 165W    / -92: -660.0
+ 163W    / -91: -652.0
+ 161W    / -90: -644.0
+!-> REPEAT: P:5
+             VARIABLE : P*XX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+ 179W    / -99: -895.0
+ 177W    / -98: -885.0
+ 175W    / -97: -875.0
+ 173W    / -96: -865.0
+ 171W    / -95: -855.0
+ 169W    / -94: -845.0
+ 167W    / -93: -835.0
+ 165W    / -92: -825.0
+ 163W    / -91: -815.0
+ 161W    / -90: -805.0
+ 
+can region
+ 
+! factorial
+can mode ver
+I / *:     1.000 "factorial"  1.000
+I / *:     2.000 "factorial"  2.000
+I / *:     3.000 "factorial"  6.000
+I / *:     4.000 "factorial"  24.00
+I / *:     5.000 "factorial"  120.0
+I / *:     6.000 "factorial"  720.0
+ 
+! with some data
+use coads_climatology
+repeat/range=80:120:40/name=p (list/L=1/y=1 sst[x=1:360:`p`])
+!-> REPEAT: P:80
+ !-> list/L=1/y=1 sst[x=1:360:80]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 80 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+               1N    
+               46
+ 1E     / 1:  27.83
+ 81E    / 2:  28.11
+ 161E   / 3:  28.79
+ 119W   / 4:  24.54
+ 39W    / 5:  27.48
+!-> REPEAT: P:120
+ !-> list/L=1/y=1 sst[x=1:360:120]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 120 deg on X
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+               1N    
+               46
+ 1E     / 1:  27.83
+ 121E   / 2:  28.59
+ 119W   / 3:  24.54
+ 
+set reg/x=300:360/y=0:50
+repeat/range=1:12:4/name=m (list sst[l=`m`,x=@ave,y=@ave])
+!-> REPEAT: M:1
+ !-> list sst[l=1,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.98
+!-> REPEAT: M:5
+ !-> list sst[l=5,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 15-JAN 11:49
+          20.98
+!-> REPEAT: M:9
+ !-> list sst[l=9,x=@ave,y=@ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 60W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 15-JAN-0002 17:38
+          20.98
+ 
+! Look for "reading SST" lines; each has a different X range
+can data/all
+can mem
+can region
+use coads_climatology
+ 
+set mode diag
+set reg/y=0:50/L=1
+repeat/range=300:360:30/name=m (list sst[x=280:`m`@ave,y=@ave])
+!-> REPEAT: M:300
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:300 at ave,y=@ave]
+ -DELETE cnst     M:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:  7 dset:   1 I:  131  140  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 60W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.79
+!-> REPEAT: M:330
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  4 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:330 at ave,y=@ave]
+ -DELETE cnst     M:  5 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M:  5 dset:   1 I:  131  155  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 30W (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          21.25
+!-> REPEAT: M:360
+ dealloc  dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ constan cnst     M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ !-> list sst[x=280:360 at ave,y=@ave]
+ -DELETE cnst     M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid ABSTRACT        ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT  ABSTRACT
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GSQ1            COADSX    COADSY    NORMAL    TIME      NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ strip --> SST[Y=0:50N at AV4,D=1]
+ reading SST      M: 13 dset:   1 I:  131  170  J:   46   70  K: -999 -999  L:    1    1  M: -999 -999  N: -999 -999
+ doing --> SST[Y=0:50N at AV4,D=1]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 80W to 0E(360) (XY ave)
+             LATITUDE : 0 to 50N (XY ave)
+             TIME     : 16-JAN 06:00
+          20.94
+cancel mode diag
+ 
+! order of qualifiers doesnt matter
+repeat/name=a/range=1:3 say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+! Test using a file variable name
+use coads_climatology
+repeat/name=sst/range=1:5 (list sst)
+!-> REPEAT: SST:1
+             VARIABLE : constant
+          1.000
+!-> REPEAT: SST:2
+             VARIABLE : constant
+          2.000
+!-> REPEAT: SST:3
+             VARIABLE : constant
+          3.000
+!-> REPEAT: SST:4
+             VARIABLE : constant
+          4.000
+!-> REPEAT: SST:5
+             VARIABLE : constant
+          5.000
+list/l=1/x=181/y=1 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 179W
+             LATITUDE : 1N
+             TIME     : 16-JAN 06:00
+          28.28
+can data/all
+ 
+! Intentional errors
+set mode ignore
+ 
+! /NAME without /RANGE
+rep/name=a say `a`
+ 
+! Cannot use pseudo-variables.
+ 
+set mode ignore
+rep/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+ 
+! Check that the state is reset after error
+rep/range=1:3/name=a say `a`
+!-> REPEAT: A:1
+ !-> MESSAGE/CONTINUE 1
+1
+!-> REPEAT: A:2
+ !-> MESSAGE/CONTINUE 2
+2
+!-> REPEAT: A:3
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+rep/range=1:3/name=I (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=j (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=k (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=X (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=y (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=z (use coads_climatology; list/nohead [sst])
+rep/range=1:3/name=tbox (use coads_climatology; list/nohead[sst,x=181,y=0,t=`tbox`])
+rep/range=1:3/name=xboxlo (list/nohead xboxlo)
+ 
+ 
+! Nested REPEAT with the same counter variable name
+repeat/range=1:4/name=a (repeat/range=3:1:-1/name=a list a)
+!-> REPEAT: A:1
+!-> REPEAT: A:2
+!-> REPEAT: A:3
+!-> REPEAT: A:4
+cancel mode ignore
+*** Running test: bn554_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.54
+! 11/03 *acm*
+!
+ 
+! Test use of longer strings in region names
+GO bn_reset
+cancel mode verify
+GO err553_regionname_lengths.jnl
+! In v5.50, we upped the region name storage to
+! allow 24-characters.  Wasnt fully implemented.
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+def region/x=100e:150e/y=0:40 southeast_asia
+show region southeast_asia
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+set region southeast_asia
+show region
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+def region/x=150:210/y=-60:0 southwest_pacific
+show region/all
+default region:
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southeast_asia
+        X=100:150
+        Y=0:40
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+region southwest_pacific
+        X=150:210
+        Y=-60:0
+        Z/K is unspecified
+        T/L is unspecified
+        E/M is unspecified
+        F/N is unspecified
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+ 
+! Reqests for data at times outside range of data
+GO bn_reset
+cancel mode verify
+GO err553_timeregion.jnl
+! try to apply a region whose limits are both below,
+! or both above, the data bounds. In v5.53 the error
+! handling for this got broken for time axes (an error
+! in the fix for err551_no_taxis_errmsg)
+! acm 11/03
+ 
+SET MODE IGNORE_ERRORS
+ 
+	use gt4d011.cdf
+list/t=1-aug-1980:1-jan-1982/i=92/j=35 temp
+ 
+ 
+SET MODE/LAST IGNORE_ERRORS
+ 
+! Contour plot on fine grid has precision problems
+GO bn_reset
+cancel mode verify
+GO err553_contour_fine_grid.jnl
+! err553_contour_find_grid.jnl
+! 11/21/03 ACM
+ 
+! For fine grids, precision isnt sufficient to
+! compute the values to map coordinates to the
+! page.  The bug occurs with smith_sandwell_topo
+! and has to do with large index values in the
+! calculations. This small set ss_small.nc is saved
+! from smith_sandwell_topo.  Then we need to put it on
+! a large grid to see the error.  The first contour
+! command either shows nothing, or a set of contours
+! that are shifted relative to the (correct) second
+! contour plot.
+ 
+! The fix is to increase precision for some of the
+! calculations in plotz.F, pltit.F and setax.F
+ 
+use ss_small.nc
+def axis/x=0.16e:0.67w/npoints=10800 xax
+def axis/y=72s:72n/npoints=6336 yax
+def grid/x=xax/y=yax fullgrid
+let rrose = rose[g=fullgrid]
+set grid fullgrid
+set reg/x=137.25w:135.75w/y=58.2n:59.15n
+go mp_mercator
+go mp_aspect
+contour rrose,x_page, y_page
+contour/over/color=red rrose, x_page, y_page
+ 
+PPLUS/RESET   ! reset aspect ratio
+ 
+! PLOT/SYM/SIZE= did not change the size
+GO bn_reset
+cancel mode verify
+GO err553_symsize.jnl
+! PLOT/SYM/SIZE= does not change the size from the default.
+! acm 11/03
+!
+plot/i=1:10/sym=20/siz=.4 i
+plot/over/i=1:10/sym=20/siz=0.2 i
+ 
+! test labels on shade keys; consistent number of digits set by 5th shakey arg
+GO bn_reset
+cancel mode verify
+GO err553_shakey_labels.jnl
+! The 5th argument to shakey is supposed to define
+! number of digits in the label.
+! acm 12/03
+ 
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -2
+ppl shade
+shade/set/i=1:10/j=1:10 (i+j)/10
+ppl shakey 1, , , , -1
+ppl shade
+ 
+ 
+! couldnt set the number of small tics with arg to %xaxis, %yaxis commands
+GO bn_reset
+cancel mode verify
+GO err553_xaxis_nsmtc.jnl
+! Bug: 5th argument failed to set the number of small
+! tics for the axis.
+ 
+! ACM 12/12/03
+ 
+ppl %xaxis/nouser 1,100,10,1,4
+ppl %xaxis/nouser 1,100,10,2,6
+ppl %yaxis/nouser 1,100,10,1,4
+ppl %yaxis/nouser 1,100,10,2,6
+ 
+ 
+! The defined year length was different if we used DEFINE AXIS/UNIT=year
+! vs DEFINE AXIS/UNIT=yr
+GO bn_reset
+cancel mode verify
+GO err553_year_yr.jnl
+! err553_year_yr.jnl
+! 2/2004 ACM
+! DEFINE AXIS/UNITS=year and UNITS=yr should be the same;
+! and year length should match the length of a year in
+! the specified calendar
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=noleap/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=noleap/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 04:59    16-DEC-0099 18:59
+T0 = 01-JAN-0000
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.87
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : NOLEAP
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.87
+ 16-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=julian/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=julian/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    17-DEC-0099 12:44
+T0 = 01-JAN-0000
+CALENDAR = JULIAN
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.79
+ 17-NOV-0099 / 1187:  99.88
+ 17-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : JULIAN
+ 17-OCT-0099 / 1186:  99.79
+ 17-NOV-0099 / 1187:  99.88
+ 17-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=standard/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=standard/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   16-JAN-0001 05:14    16-DEC-0099 18:56
+T0 = 01-JAN-0000
+   Axis span (to cell edges) = 99
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+ 16-OCT-0099 / 1186:  99.79
+ 16-NOV-0099 / 1187:  99.88
+ 16-DEC-0099 / 1188:  99.96
+ 
+! v553 and before also had a bug in where D360 not properly defined in
+! calendar_blkdat.F so length of year not correct.
+ 
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=year tax1
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=year tax1
+def ax/t=1-jan-0001:1-jan-0100:`1/12,p=9`/edge/cal=d360/unit=yr tax2
+ !-> def ax/t=1-jan-0001:1-jan-0100:0.0833333333/edge/cal=d360/unit=yr tax2
+show axis tax1
+ name       axis              # pts   start                end
+ TAX1      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+show axis tax2
+ name       axis              # pts   start                end
+ TAX2      TIME              1188 r   15-JAN-0001 23:59    15-DEC-0099 23:59
+T0 = 01-JAN-0000
+CALENDAR = 360_DAY
+   Axis span (to cell edges) = 99
+set mode ignore
+list/l=1186:1189 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.79
+ 15-NOV-0099 23 / 1187:  99.87
+ 15-DEC-0099 23 / 1188:  99.96
+list/l=1186:1189 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 3 points (TIME)
+             CALENDAR : 360_DAY
+ 15-OCT-0099 23 / 1186:  99.79
+ 15-NOV-0099 23 / 1187:  99.87
+ 15-DEC-0099 23 / 1188:  99.96
+list/l=1168:1171 t[gt=tax1]
+             VARIABLE : T
+                        axis TAX1
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.29
+ 15-MAY-0098 23 / 1169:  98.37
+ 15-JUN-0098 23 / 1170:  98.46
+ 15-JUL-0098 23 / 1171:  98.54
+list/l=1168:1171 t[gt=tax2]
+             VARIABLE : T
+                        axis TAX2
+             SUBSET   : 4 points (TIME)
+             CALENDAR : 360_DAY
+ 15-APR-0098 23 / 1168:  98.29
+ 15-MAY-0098 23 / 1169:  98.37
+ 15-JUN-0098 23 / 1170:  98.46
+ 15-JUL-0098 23 / 1171:  98.54
+can mode ignore
+ 
+! When we do a DEFINE GRID/LIKE=var and then try to read the var with
+! strides, Ferret did a regridding instead.  Test the fix for this
+GO bn_reset
+cancel mode verify
+GO err553_stride_def_grid.jnl
+ 
+use gtsa056_2.cdf
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G005)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M: 11 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+can mem/all
+ -DELETE TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ 
+def grid/like=taux agrid
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME      NORMAL    NORMAL
+set mode diag
+let a = taux[i=50:55:2,j=44:50:3,l=1:168:8]
+ dealloc  dynamic grid PS2DU1          PSXU      PSYU      NORMAL    TIME      NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX004)   (AX002)   NORMAL    (AX005)   NORMAL    NORMAL
+load a
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ eval    A        C:  6 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ strip regrid on X: TAUX --> (G005)           @XACT
+ rdstride TAUX     C:  9 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ nulrgd  TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE TAUX     M: 11 dset:   1 I:   50   54  J:   44   50  K: -999 -999  L:    1  161  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ 
+can mem/all
+ -DELETE TAUX     M:  8 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    3  J:    1    3  K: -999 -999  L:    1   21  M: -999 -999  N: -999 -999
+can data/all
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ dealloc  dynamic grid (G005)          (AX002)   (AX004)   NORMAL    (AX001)   NORMAL    NORMAL
+ 
+! Some tests taken from  bn_strides_revs_perms.jnl but with
+! DEFINE GRID/LIKE= testing permuting and reversing axes
+ 
+! first with an XYZT variable
+set region/i=3:6/j=2:4/k=1:2/l=1
+use bn_strides
+define grid/like=var agrid
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid GPC1            XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+define grid/like=midvar bgrid
+ getgrid EX#1     C:  6 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+define grid/like=bigvar cgrid
+ dealloc  dynamic grid GPC2            XAX1_9    YAX1_8    ZAX1_7    TAX1_6    NORMAL    NORMAL
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+define grid/like=unevenvar dgrid
+ dealloc  dynamic grid GPC3            XAX1_40   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+define grid/like=xytvar egrid
+ dealloc  dynamic grid GPC4            XUNEVEN   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+canc data/all
+ dealloc  dynamic grid GPC5            XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ 
+ 
+! cache hit from full region cache -- bypass use of strides
+cancel memory/all
+use bn_strides
+load var
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ reading VAR      M: 11 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+LIST VAR[i=2:4:2]
+ dealloc  dynamic grid AGRID           XAX1_4    YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  7 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    2    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 2   / 2:  1122.  1124.
+ 3   / 3:  1132.  1134.
+ ---- K:2 Z:   2
+ 2   / 2:  1222.  1224.
+ 3   / 3:  1232.  1234.
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX021)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  7 dset:   1 I:    1    2  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+CANC MEM/ALL
+ -DELETE VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    3    4  J:    2    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! modulo requests cannot use strides (as this example shows)
+set axis/modulo XAX1_4
+LIST VAR[I=1:10:3,j=1,k=1,l=1]    ! 1, 4, 7(3), 10(2)
+ dealloc  dynamic grid (G006)          (AX003)   (AX022)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ strip moduloing VAR on X axis:     1    10 dset:   1
+ reading VAR      M: 11 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ doing moduloing VAR on X axis:     1     4 dset:   1
+ regrid  VAR      M:  7 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 3 delta on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 1    / 1:  1111.
+ 4    / 2:  1114.
+ 7    / 3:  1113.
+ 10   / 4:  1112.
+cancel axis/modulo XAX1_4
+ -DELETE VAR      M:  7 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    1   10  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    1    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! strides applied to more than one axis need special attention in IS_REGRID
+LIST VAR[i=2:4:2,j=1:3:2]
+ dealloc  dynamic grid (G006)          (AX003)   YAX1_3    ZAX1_2    TAX1_1    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M: 11 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+LIST VAR[i=2:6:2,j=1:5:2]
+ dealloc  dynamic grid (G006)          (AX022)   (AX021)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M:  8 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ strip regrid on X: VAR --> (G006)           @XACT
+ rdstride VAR      C:  7 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  VAR      M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE VAR      M:  8 dset:   1 I:    2    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J*10 + I
+                        regrid: 2 delta on X, 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             2      4    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  1112.  1114.
+ 3   / 2:  1132.  1134.
+ ---- K:2 Z:   2
+ 1   / 1:  1212.  1214.
+ 3   / 2:  1232.  1234.
+ 
+! test sub-region selection on strides axis
+let a = bigvar[i=1:40:5]
+ dealloc  dynamic grid (G006)          (AX022)   (AX003)   ZAX1_2    TAX1_1    NORMAL    NORMAL
+ -DELETE VAR      M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+list/j=1/k=1/l=1 a[i=3:5]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A        C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ eval    A        C:  7 dset:   1 I:    3    5  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 10 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  8 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 11 dset:   1 I:    1   36  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 points (X)
+             Y        : 1
+             Z        : 1
+             T        : 1
+              1    
+              1
+ 11   / 3:  1121.
+ 16   / 4:  1126.
+ 21   / 5:  1131.
+ -DELETE A        M:  7 dset:   1 I:    1    1  J:    3    5  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+list/k=1/l=1 a[i=3:5,j=1:8:2]
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    2    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on Y: A --> (G007)           @XACT
+ eval    A        C:  8 dset:   1 I:    3    5  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C: 11 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M:  3 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  7 dset:   1 I:    1   36  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ regrid  A        M: 15 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+             VARIABLE : BIGVAR[I=1:40:5]
+                        regrid: 2 delta on Y
+             FILENAME : bn_strides.cdf
+             SUBSET   : 3 by 4 points (X-Y)
+             Z        : 1
+             T        : 1
+            11     16     21    
+             3      4      5
+ 1   / 1:  1121.  1126.  1131.
+ 3   / 2:  1141.  1146.  1151.
+ 5   / 3:  1161.  1166.  1171.
+ 7   / 4:  1181.  1186.  1191.
+ 
+! ****** unequally spaced points on parent axis
+ 
+cancel mem/all
+ -DELETE BIGVAR   M:  3 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M:  7 dset:   1 I:    1    8  J:    1    7  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M:  8 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 11 dset:   1 I:    1    8  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE A        M: 15 dset:   1 I:    3    5  J:    1    4  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ 
+! basic strides
+LIST/order=x/j=1/k=1/l=1 UNEVENVAR[i=2:4:2]
+ dealloc  dynamic grid (G007)          (AX022)   (AX021)   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    3    6  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ strip regrid on X: UNEVENVAR --> (G007)           @XACT
+ rdstride UNE-NVAR C:  8 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  UNE-NVAR M: 11 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE UNE-NVAR M: 15 dset:   1 I:    2    4  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+             VARIABLE : L*1000 + K*100 + J[GY=YUNEVEN]*10 + I[GX=XUNEVEN]
+                        regrid: on X
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 points (X)
+             Y        : 0
+             Z        : 1
+             T        : 1
+           0.3    0.6   
+            1      2
+          1112.  1114.
+ 
+! * * * * * MIXED STRIDES and PERMUTATIONS * * * * *
+ 
+set region/i=3:6/j=2:4/k=1:2/l=1
+ 
+use/order=yx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ dealloc  dynamic grid (G007)          (AX003)   YUNEVEN   ZAX1_6    TAX1_4    NORMAL    NORMAL
+ -DELETE UNE-NVAR M: 11 dset:   1 I:    1    2  J:    1    1  K:    1    1  L:    1    1  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G007)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 11 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1123.  1125.  1127.  1129.
+ 4   / 2:  1143.  1145.  1147.  1149.
+ 6   / 3:  1163.  1165.  1167.  1169.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1325.  1327.  1329.
+ 4   / 2:  1343.  1345.  1347.  1349.
+ 6   / 3:  1363.  1365.  1367.  1369.
+canc data/all
+ -DELETE BIGVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G007)          (AX021)   (AX023)   (AX024)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX022)   YAX1_30   ZAX1_20   TAX1_10   NORMAL    NORMAL
+ 
+use/order=zyx bn_strides
+list bigvar[i=3:9:2, j=2:6:2, k=1:3:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    3    6  J:    2    4  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ strip regrid on X: BIGVAR --> (G006)           @XACT
+ rdstride BIGVAR   C:  7 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  BIGVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE BIGVAR   M: 15 dset:   1 I:    3    9  J:    2    6  K:    1    3  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 2 delta on X, 2 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X-Y-Z)
+             T        : 1
+             3      5      7      9    
+             1      2      3      4
+ ---- K:1 Z:   1
+ 2   / 1:  1321.  1521.  1721.  1921.
+ 4   / 2:  1341.  1541.  1741.  1941.
+ 6   / 3:  1361.  1561.  1761.  1961.
+ ---- K:2 Z:   3
+ 2   / 1:  1323.  1523.  1723.  1923.
+ 4   / 2:  1343.  1543.  1743.  1943.
+ 6   / 3:  1363.  1563.  1763.  1963.
+canc data/all
+ -DELETE BIGVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_10   NORMAL    NORMAL
+ 
+! now with xytvar
+cancel region
+set region/i=1:4/j=1:3/l=1:2
+use bn_strides
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+ 
+use/order=tyx bn_strides
+show grid xytvar
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   NORMAL    (AX022)   NORMAL    NORMAL
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+    GRID EGRID
+ name       axis              # pts   start                end
+ XLON      LONGITUDE           40mr   141E                 180E
+ YLAT      LATITUDE            30 r   1N                   30N
+ normal    Z
+ TTIME     TIME                20 r   01-JAN-1995 00:00    20-JAN-1995 00:00
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,l=3:5:2]
+ dealloc  dynamic grid EGRID           XLON      YLAT      NORMAL    TTIME     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    7  J:    2    6  K: -999 -999  L:    3    5  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 deg on X, 2 deg on Y, 2 day on T
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (LONGITUDE-LATITUDE-TIME)
+            141E   143E   145E   147E   
+              1      2      3      4
+ ---- L:1 T:   03-JAN-1995 00:00
+ 6N   / 3:  3061.  3063.  3065.  3067.
+ 4N   / 2:  3041.  3043.  3045.  3047.
+ 2N   / 1:  3021.  3023.  3025.  3027.
+ ---- L:2 T:   05-JAN-1995 00:00
+ 6N   / 3:  5061.  5063.  5065.  5067.
+ 4N   / 2:  5041.  5043.  5045.  5047.
+ 2N   / 1:  5021.  5023.  5025.  5027.
+canc data/all
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    4  J:    1    3  K: -999 -999  L:    1    2  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   NORMAL    (AX021)   NORMAL    NORMAL
+ 
+! map into Z instead of T
+use/order=zxy bn_strides
+show grid xytvar
+ getgrid EX#1     C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+    GRID GPC5
+ name       axis              # pts   start                end
+ TTIME     X (DAYS)            20 r   34319                34338
+ XLON      Y (degrees_east)    40mr   141                  180
+ YLAT      Z (degrees_north)   30 r   1                    30
+ normal    T
+ normal    E
+ normal    F
+ 
+list xytvar[i=1:7:2,j=2:6:2,k=3:5:2]
+ dealloc  dynamic grid GPC5            TTIME     XLON      YLAT      NORMAL    NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    4  J:    1    3  K:    1    2  L:    1    2  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ strip regrid on X: XYTVAR --> (G006)           @XACT
+ rdstride XYTVAR   C:  7 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ nulrgd  XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE XYTVAR   M: 11 dset:   1 I:    1    7  J:    2    6  K:    3    5  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+             VARIABLE : L*1000 + J*10 + I
+                        regrid: 2 day on X, 2 deg on Y, 2 deg on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 4 by 3 by 2 points (X (DAYS)-Y (degrees_east)-Z (degrees_north))
+             34319  34321  34323  34325  
+               1      2      3      4
+ ---- K:1 Z:   3
+ 142   / 1:  1032.  3032.  5032.  7032.
+ 144   / 2:  1034.  3034.  5034.  7034.
+ 146   / 3:  1036.  3036.  5036.  7036.
+ ---- K:2 Z:   5
+ 142   / 1:  1052.  3052.  5052.  7052.
+ 144   / 2:  1054.  3054.  5054.  7054.
+ 146   / 3:  1056.  3056.  5056.  7056.
+canc data/all
+ -DELETE XYTVAR   M: 15 dset:   1 I:    1    4  J:    1    3  K:    1    2  L: -999 -999  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   NORMAL    NORMAL    NORMAL
+ 
+ 
+cancel region; set region/l=1
+ 
+! reference output
+use/order=yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1312.  1352.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1512.  1552.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   TAX1_6    NORMAL    NORMAL
+ 
+use/order=-yx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    1    5  J:    5    8  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1318.  1358.
+ 5   / 2:  1315.  1355.
+ ---- K:2 Z:   5
+ 2   / 1:  1518.  1558.
+ 5   / 2:  1515.  1555.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   TAX1_6    NORMAL    NORMAL
+ 
+! reference output
+use/order=tyx bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1123.  5123.
+ 5   / 2:  1153.  5153.
+ ---- K:2 Z:   5
+ 2   / 1:  1125.  5125.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ 
+! note the reversal on axes 1,2 and 3 (X,Y,Z in memory -- NOT T)
+use/order=-t-y-x bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on X axis:     1     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    4    7  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on X axis:     1     5 dset:   1
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6773.  2773.
+ 5   / 2:  6743.  2743.
+ ---- K:2 Z:   5
+ 2   / 1:  6775.  2775.
+ 5   / 2:  6745.  2745.
+canc data/all
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ 
+! reference output
+use/order=txy bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ rdstride MIDVAR   C:  7 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  1132.  5132.
+ 5   / 2:  1135.  5135.
+ ---- K:2 Z:   5
+ 2   / 1:  1152.  5152.
+ 5   / 2:  1155.  5155.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX024)   (AX023)   (AX021)   ZAX1_7    NORMAL    NORMAL
+ 
+use/order=-t-x-y bn_strides
+list midvar[i=1:5:4, j=2:5:3, k=3:5:2]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ allocate dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ strip regrid on X: MIDVAR --> (G006)           @XACT
+ strip reversing MIDVAR on Y axis:     2     5 dset:   1
+ rdstride MIDVAR   C:  8 dset:   1 I:    2    6  J:    5    8  K:    3    5  L:    7    7  M: -999 -999  N: -999 -999
+ doing reversing MIDVAR on Y axis:     2     5 dset:   1
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ nulrgd  MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ -DELETE MIDVAR   M: 15 dset:   1 I:    1    5  J:    2    5  K:    3    5  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+             VARIABLE : VAR
+                        regrid: 4 delta on X, 3 delta on Y, 2 delta on Z
+             FILENAME : bn_strides.cdf
+             SUBSET   : 2 by 2 by 2 points (X-Y-Z)
+             T        : 1
+             1      5    
+             1      2
+ ---- K:1 Z:   3
+ 2   / 1:  6738.  2738.
+ 5   / 2:  6735.  2735.
+ ---- K:2 Z:   5
+ 2   / 1:  6758.  2758.
+ 5   / 2:  6755.  2755.
+canc data/all
+ -DELETE MIDVAR   M: 11 dset:   1 I:    1    2  J:    1    2  K:    1    2  L:    1    1  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid (G006)          (AX023)   (AX024)   (AX022)   ZAX1_7    NORMAL    NORMAL
+ 
+! DEFINE AXIS can get the axis too long (bug 673)
+GO bn_reset
+cancel mode verify
+GO err553_axis_too_long.jnl
+! From Ned Cokelet
+! First definition of axis had last grid cell completely
+! beyond requested end.
+ 
+DEF AXIS/X=211:215:3 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.5 to 215.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+               X  XBOXLO XBOXHI
+211   / 1:  211.0  209.5  212.5
+214   / 2:  214.0  212.5  215.5
+ 
+DEF AXIS/X=211:215:2.6 x_ax
+LIST X[GX=x_ax], XBOXLO[GX=x_ax], XBOXHI[GX=x_ax]
+             X: 209.7 to 217.5
+ Column  1: X is X (axis X_AX)
+ Column  2: XBOXLO is XBOXLO (axis X_AX)
+ Column  3: XBOXHI is XBOXHI (axis X_AX)
+               X  XBOXLO XBOXHI
+211   / 1:  211.0  209.7  212.3
+213.6 / 2:  213.6  212.3  214.9
+216.2 / 3:  216.2  214.9  217.5
+ 
+! Under linux, some shade and fill plots with /LEVELS=c had a
+! non-centered shade key
+GO bn_reset
+cancel mode verify
+GO err553_lev_c.jnl
+ ! under linux only, this has a non-centered shade key
+ 
+shade/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.80     1.38     7.13
+ 
+fill/lev=c {-1.1,1.1}*ysequence({1,1})
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       1      0.00        0        3        9
+
+
+         DEFAULT KEY POSITIONING
+         X LO     X HI     Y LO     Y HI
+         9.40     9.80     1.38     7.13
+ 
+ 
+! At lon = 0, we used to have an E; remove this.
+GO bn_reset
+cancel mode verify
+GO err553_lon_ax_0_label.jnl
+! Label longitude axes with the degree sign only
+! at x=0 (previously had an E).
+ 
+! ACM 1/6/04
+ 
+use coads_climatology
+shade/x=-20:20/y=-40:40/L=1 sst
+ 
+ 
+! Errors listing string and numeric data together
+GO bn_reset
+cancel mode verify
+GO err553_list_string_numeric.jnl
+! err553_list_string_numeric.jnl
+! 2/2004 ACM
+! LISTing string and numeric variables together.
+ 
+def axis/t=1:3:1 tax
+let a = reshape ({1,2,3}, t[gt=tax])
+let b = reshape ({"a", "b", "c"}, t[gt=tax])
+list a, b
+             T: 0.5 to 3.5
+ Column  1: A is RESHAPE ({1,2,3}, T[GT=TAX])
+ Column  2: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+             A   B
+1   / 1:  1.000 "a"
+2   / 2:  2.000 "b"
+3   / 3:  3.000 "c"
+ 
+! Now in 2D
+let c = {"cat", "rat", "spat", "that", "pat"}
+list/i=2:4/l=1:3 b, c
+             T: 0.5 to 3.5
+             X: 1.5 to 4.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+          B     C
+ ---- I:2 X:   2
+1   / 1: "a" "rat" 
+2   / 2: "b" "rat" 
+3   / 3: "c" "rat" 
+ ---- I:3 X:   3
+1   / 1: "a" "spat"
+2   / 2: "b" "spat"
+3   / 3: "c" "spat"
+ ---- I:4 X:   4
+1   / 1: "a" "that"
+2   / 2: "b" "that"
+3   / 3: "c" "that"
+ 
+let v = y[y=1:5]
+list v
+             VARIABLE : Y[Y=1:5]
+             SUBSET   : 5 points (Y)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 5   / 5:  5.000
+list/i=3:4/l=1:2 b, c, v
+             T: 0.5 to 2.5
+             X: 2.5 to 4.5
+             Y: 0.5 to 5.5
+ Column  1: B is RESHAPE ({"a", "b", "c"}, T[GT=TAX])
+ Column  2: C is {"cat", "rat", "spat", "that", "pat"}
+ Column  3: V is Y[Y=1:5]
+          B     C      V
+ ---- J:1 Y:   1
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  1.000
+2   / 2: "b" "spat"  1.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  1.000
+2   / 2: "b" "that"  1.000
+ ---- J:2 Y:   2
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  2.000
+2   / 2: "b" "spat"  2.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  2.000
+2   / 2: "b" "that"  2.000
+ ---- J:3 Y:   3
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  3.000
+2   / 2: "b" "spat"  3.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  3.000
+2   / 2: "b" "that"  3.000
+ ---- J:4 Y:   4
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  4.000
+2   / 2: "b" "spat"  4.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  4.000
+2   / 2: "b" "that"  4.000
+ ---- J:5 Y:   5
+ ---- I:3 X:   3
+1   / 1: "a" "spat"  5.000
+2   / 2: "b" "spat"  5.000
+ ---- I:4 X:   4
+1   / 1: "a" "that"  5.000
+2   / 2: "b" "that"  5.000
+ 
+ 
+! Bug in setting axis to depth when reading from nc file
+GO bn_reset
+cancel mode verify
+GO err553_set_axis_depth.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.53
+ ! Solaris 5.6 - 12/16/03
+ ! 16-Dec-03 10:58
+ 
+use xz_nozattrib.nc
+set axis/depth zax
+say "axis should be reversed"
+axis should be reversed
+show axis zax
+ name       axis              # pts   start                end
+ ZAX       Z                    5 r-  1                    5
+   Axis span (to cell edges) = 5
+q
+ 
+! Set symbols showing levels settings when poly command is called
+GO bn_reset
+cancel mode verify
+GO err553_symbol_lev.jnl
+! err553_symbol_lev.jnl
+! 2/2004 ACM
+! In 5.51 and in 5.53 version, symbols LEV* are not created
+! for polygon plots
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 180+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+POLYGON XTRIANGLE+XPTS, YTRIANGLE+YPTS, I[I=1:10]
+ 
+!*************************************
+! List symbols LEV_MIN, LEV_MAX, LEV_DEL
+ 
+show symb lev*
+LEV_TEXT = "C"
+LEV_MIN = "1"
+LEV_MAX = "10.2"
+LEV_NUM = "46"
+LEV_DEL = "0.2"
+ 
+can sym lev*
+! Now with /LEV=(min,max,del)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+polygon/trans/i=1:100/nolable/lev=(0,1100,40) xpts+xsqr, ypts+ysqr, x*x/10
+sh sym lev*
+LEV_TEXT = "(0,1100,40)"
+LEV_MIN = "0"
+LEV_MAX = "1120"
+LEV_NUM = "28"
+LEV_DEL = "40"
+ 
+can sym lev*
+! Now with /LEV=nl
+ 
+LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+LET sst = 25 - ypts + RANDN(ypts)
+plot/vs xpts,ypts
+GO polymark POLYGON/KEY/lev=20 xpts,ypts,sst,star
+ 
+sh sym lev*
+LEV_TEXT = "20"
+LEV_MIN = "-12"
+LEV_MAX = "32"
+LEV_NUM = "22"
+LEV_DEL = "2"
+can sym lev*
+ 
+! Fixes for modulo striding bugs
+GO bn_reset
+cancel mode verify
+GO err553_stride_modulo.jnl
+! err553_stride_modulo_neg.jnl
+! *acm* 3/31/2004
+!  Modulo axis with strides that have negative indices
+! did not work prior to v5.6 of Ferret.
+ 
+! mylon.nc created as follows:
+! use etopo20
+! let var = sin(x[gx=var])
+! save/file=mylon.nc var
+ 
+use mylon
+list var[i=-400:-40:20]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 6.7 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 19 points (LONGITUDE)
+ 113.5W  /  1:  0.9763
+ 106.8W  /  2:  0.8243
+ 100.2W  /  3:  0.5526
+ 93.5W   /  4:  0.2007
+ 86.8W   /  5: -0.1804
+ 80.2W   /  6: -0.5353
+ 73.5W   /  7: -0.8125
+ 66.8W   /  8: -0.9716
+ 60.2W   /  9: -0.9896
+ 53.5W   / 10: -0.8638
+ 46.8W   / 11: -0.6126
+ 40.2W   / 12: -0.2723
+ 33.5W   / 13:  0.1075
+ 26.8W   / 14:  0.4716
+ 20.2W   / 15:  0.7673
+ 13.5W   / 16:  0.9515
+ 6.8W    / 17:  0.9975
+ 0.2W    / 18:  0.8986
+ 6.5E    / 19:  0.6691
+list var[i=-400:-40:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 113.5W  / 1:  0.9763
+ 96.8W   / 2: -0.3837
+ 80.2W   / 3: -0.5353
+ 63.5W   / 4:  0.9989
+ 46.8W   / 5: -0.6126
+ 30.2W   / 6: -0.2949
+ 13.5W   / 7:  0.9515
+ 3.2E    / 8: -0.7985
+ 
+! This list, using modulo-ing to go out to a second replication
+! of the data, would have worked under previous versions but
+! with the last point missing, bug 841
+ 
+list var[i=`2*1081-400`:`2*1082-40`:50]
+ !-> list var[i=1762:2124:50]
+             VARIABLE : SIN(X[GX=ROSE])
+                        regrid: 17 deg on X
+             FILENAME : mylon.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 112.8W  / 1:  0.9763
+ 96.2W   / 2: -0.3837
+ 79.5W   / 3: -0.5353
+ 62.8W   / 4:  0.9989
+ 46.2W   / 5: -0.6126
+ 29.5W   / 6: -0.2949
+ 12.8W   / 7:  0.9515
+ 3.8E    / 8: -0.7985
+ 
+! Previously also, the moduloing could return results
+! that are one index off, also bug 841
+ 
+list/nohead/y=0/prec=6 var[i=1100:1400:50]
+ 26.5E   / 1:  0.859313
+ 43.2E   / 2: -0.912341
+ 59.8E   / 3:  0.189118
+ 76.5E   / 4:  0.695015
+ 93.2E   / 5: -0.987803
+ 109.8E  / 6:  0.440136
+ 126.5E  / 7:  0.482013
+can mem; list/nohead/y=0/prec=6 var[i=19:319:50,y=0]
+ 26.2E  / 1:  0.859313
+ 42.8E  / 2: -0.912341
+ 59.5E  / 3:  0.189118
+ 76.2E  / 4:  0.695015
+ 92.8E  / 5: -0.987803
+ 109.5E / 6:  0.440136
+ 126.2E / 7:  0.482013
+can mem; list/y=0 var[i=69]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.8E(42.8)
+         -0.9123
+can mem; list/y=0 var[i=68]
+             VARIABLE : SIN(X[GX=ROSE])
+             FILENAME : mylon.nc
+             LONGITUDE: 42.5E(42.5)
+         -0.9961
+ 
+! Fixes bug creating format for listing a very long line
+GO bn_reset
+cancel mode verify
+GO err553_list_width.jnl
+! err553_list_width.jnl
+! *acm* 4/1/2004
+! Fix for bug 837; creating a format for very wide ascii listing
+! (this caused an outright crash)
+ 
+! Note had /wid=9999, but this crashes Ferret under irix,
+! listing to std output and also to an ascii file.
+! Fortran limit for sequential files?  1024 works, 2047 did not.
+! The bug, seen under solaris and linux for pre-v5.6, appears
+! with /WIDTH=9999 but not with /WIDTH=1024.
+ 
+set mode ignore
+def axis/x=1:5000:1 xax
+def axis/y=1:2:1 yax
+list/wid=1024/y=1:2 sin(x[gx=xax]) + y[gy=yax]
+             VARIABLE : SIN(X[GX=XAX]) + Y[GY=YAX]
+             SUBSET   : 5000 by 2 points (X-Y)
+      ... listing every  35th point
+             1     36     71     106    141    176    211    246    281    316    351    386    421    456    491    526    561    596    631    666    701    736    771    806    841    876    911    946    981   1016   1051   1086   1121   1156   1191   1226   1261   1296   1331   1366   1401   1436   1471   1506   1541   1576   1611   1646   1681   1716   1751   1786   1821   1856   1891   1926   1961   1996   2031   2066   2101   2136   2171   2206   2241   2276   2311   2346   2381  [...]
+             1     36     71    106    141    176    211    246    281    316    351    386    421    456    491    526    561    596    631    666    701    736    771    806    841    876    911    946    981   1016   1051   1086   1121   1156   1191   1226   1261   1296   1331   1366   1401   1436   1471   1506   1541   1576   1611   1646   1681   1716   1751   1786   1821   1856   1891   1926   1961   1996   2031   2066   2101   2136   2171   2206   2241   2276   2311   2346   2381   [...]
+ 1   / 1:  1.841  0.008  1.951  0.273  1.363  1.071  0.509  1.817  0.015  1.964  0.243  1.404  1.027  0.548  1.790  0.023  1.975  0.215  1.444  0.982  0.588  1.763  0.034  1.984  0.188  1.483  0.938  0.629  1.733  0.046  1.991  0.163  1.521  0.894  0.670  1.702  0.060  1.996  0.140  1.559  0.850  0.712  1.670  0.076  1.999  0.118  1.595  0.807  0.755  1.637  0.094  2.000  0.098  1.630  0.763  0.798  1.602  0.114  1.999  0.080  1.663  0.721  0.841  1.566  0.135  1.996  0.064  1.696  0.679 [...]
+ 2   / 2:  2.841  1.008  2.951  1.273  2.363  2.071  1.509  2.817  1.015  2.964  1.243  2.404  2.027  1.548  2.790  1.023  2.975  1.215  2.444  1.982  1.588  2.763  1.034  2.984  1.188  2.483  1.938  1.629  2.733  1.046  2.991  1.163  2.521  1.894  1.670  2.702  1.060  2.996  1.140  2.559  1.850  1.712  2.670  1.076  2.999  1.118  2.595  1.807  1.755  2.637  1.094  3.000  1.098  2.630  1.763  1.798  2.602  1.114  2.999  1.080  2.663  1.721  1.841  2.566  1.135  2.996  1.064  2.696  1.679 [...]
+ 
+can mode ignore
+*** Running test: bn_bounds.jnl
+ 
+! bn_bounds.jnl
+! testing CDF read and write of file with irregular axes and bounds
+! and DEFINE AXIS/BOUNDS
+! 5/2005 made changes so the bounds coordinates {1,2} are written to the
+!        file. If axis is Z, write attribute potitive="up". (bug 1196)
+! 2/10   new examples of bounds which overlap each other.
+! 4/13   with climatological axes defined internally the LIST outputs
+!        differ by a digit. This is just roundoff in the listing, the
+!        number 730.485 shown as 730.48 vs 730.49. Just increase precision
+!        for those list commands.
+ 
+ 
+! Output data on irregular record axis. No need for:
+! save/clobber/RIGID/HEADING=ENHANCED/LLIMITS=1:3/file=a.nc v
+ 
+!use climatological_axes
+let v = t[gt=month_irreg]
+save/clobber/file=a.nc v
+ 
+sp echo "bn_bounds.jnl --- 1 output of bounds on irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var v
+ 
+! Now use coads with long irregular time axis.
+ 
+can data/all
+use coads_vwnd
+let v = missing(vwnd,28.5)
+save/clobber/file=a.nc/x=199/y=41/l=40:44 v
+sp echo "bn_bounds.jnl --- 2 long irreg axes." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Append later time steps: we add a void point between non-contiguous bounds
+ 
+save/append/file=a.nc/x=199/y=41/l=50:53 v
+sp echo "bn_bounds.jnl --- 3 Append later time steps, adding a void point" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! Depth axis; bounds {1,2} positive up
+ 
+define axis/z/depth/units=meters zirr = {0,10,40,70}
+let t2 = z[gz=zirr]
+save/clobber/file=a.nc t2
+sp echo "bn_bounds.jnl --- 4 depth axis, bounds positive up" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can data/all
+can var/all
+ 
+! SAVE on irregular time axis, multi-dimensional save.
+! Void point is one time, all X and Y
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_irreg], 28)
+save/clobber/x=181:185/y=1:7/L=1:5/file=a.nc v
+save/append/x=181:185/y=1:7/L=8:9/file=a.nc v
+sp echo "bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+can var v
+ 
+use a.nc
+list/y=3 v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 3 by 8 points (LONGITUDE-TIME)
+             LATITUDE : 3N
+                      179W   177W   175W   
+                        1      2      3
+ 16-JAN 12      / 1:  27.98  28.25  28.28
+ 15-FEB 02      / 2:  28.36  28.41  28.00
+ 15-MAR 17      / 3:  27.94  28.00  27.72
+ 15-APR 05      / 4:  28.00  28.00  28.00
+ 15-MAY 17      / 5:  28.00  28.00  28.00
+ 30-JUN 17      / 6:   ....   ....   ....
+ 15-AUG 17      / 7:  28.00  28.00  28.00
+ 15-SEP 05      / 8:  28.00  28.00  28.00
+list/x=177w v
+             VARIABLE : MISSING(SST[GT=MONTH_IRREG], 28)
+             FILENAME : a.nc
+             SUBSET   : 4 by 8 points (LATITUDE-TIME)
+             LONGITUDE: 177W
+                       1N     3N     5N     7N    
+                        1      2      3      4
+ 16-JAN 12      / 1:  28.41  28.25  28.06  28.10
+ 15-FEB 02      / 2:  28.40  28.41  28.16  27.75
+ 15-MAR 17      / 3:  27.59  28.00  27.87  27.82
+ 15-APR 05      / 4:  28.00  28.00  28.00  28.00
+ 15-MAY 17      / 5:  28.00  28.00  28.00  28.00
+ 30-JUN 17      / 6:   ....   ....   ....   ....
+ 15-AUG 17      / 7:  28.00  28.00  28.00  28.00
+ 15-SEP 05      / 8:  28.00  28.00  28.00  28.00
+can data/all
+can var/all
+ 
+! Define an axis using edges
+def axis/t/edges tax={0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1   / 1:  1.000  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3   / 3:  3.000  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8   / 6:  8.000  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! Define an axis using bounds, with discontinuity between bounds,
+! detected and changed to contiguous bounds, using lower bound for all cells.
+def axis/t/bounds tax={1,2,3,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,4.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1   / 1:  1.000  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3   / 3:  3.000  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8   / 6:  8.000  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! intentional errors
+! coordinate point not inside bounds
+set mode ignore
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! First coordinate lower than first lower bound
+def axis/t/bounds tax={0.1,2,3.2,5,7,8,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Last coordinate higher than last upper bound
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5}
+ 
+! Too few or too many bounds values
+def axis/t/bounds tax={0,2,3.2,5,7,8,9.9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+def axis/t/bounds tax={1.2,2,3.2,5,7,8.4,9}, {0.5,1.5,1.5,2.5,2.5,3.5,3.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,10.5}
+ 
+ 
+! This set of bounds has overlapping bounds. Use midpoints instead.
+def axis/t/bounds tax=\
+ {12, 12.2, 36, 36.2, 60, 60.2, 84, 84.2, 108} ,\
+ {0,24, 0,24, 24,48, 24,48, 48,72, 48,72, 72,96, 72,96, 96,120}
+ 
+cancel axis tax
+can mode ignore
+ 
+! SAVE on regular time axis with bounds and edges attributes
+ 
+use coads_climatology
+list/x=181/y=1/form=(f6.2, 3f10.4) sst, t[gt=sst], tboxlo[gt=sst], tboxhi[gt=sst]
+             DATA SET: ./coads_climatology.cdf
+             TIME: 01-JAN 00:45 to 01-APR 08:12
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: T is T (axis TIME)
+ Column  3: TBOXLO is TBOXLO (axis TIME)
+ Column  4: TBOXHI is TBOXHI (axis TIME)
+ 28.28  366.0000    0.7575  731.2425
+ 28.42 1096.4850  731.2425 1461.7275
+ 28.05 1826.9700 1461.7275 2192.2125
+ 
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+save/clobber/edges/file=a.nc/x=181/y=1 sst
+sp echo "bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! Intentional errors; combinations of qualifiers on SAVE
+set mode ignore
+ 
+use coads_climatology
+save/clobber/rigid/heading=enhanced/llimits=1:3/bounds/file=a.nc/x=181/y=1 sst
+save/clobber/edges/bounds/file=a.nc/x=181/y=1 sst
+can mode ignore
+ 
+can data/all
+ 
+! outputting bounds on all irregular axes
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0, 10, 10, 30, 30, 60, 60, 90, 90, 150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis" >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+use irrxzt
+list/x=5/t=5 v, z[gz=v] , zboxlo[gz=v], zboxhi[gz=v]
+             DATA SET: ./irrxzt.nc
+             Z: 0 to 150
+             X: 5
+             T: 2
+ Column  1: V is X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  4: ZBOXHI is ZBOXHI (axis ZAX)
+               V     Z   ZBOXLO ZBOXHI
+0     / 1:    7.0    0.0   0.00   10.0
+20    / 2:   27.0   20.0  10.00   30.0
+50    / 3:   57.0   50.0  30.00   60.0
+75    / 4:   82.0   75.0  60.00   90.0
+120   / 5:  127.0  120.0  90.00  150.0
+can data/all
+ 
+! RIGID/HEAD=ENHANCED works the same; issues a note
+ 
+!use climatological_axes
+use coads_climatology
+let v = sst[gt=month_irreg]
+save/clobber/rigid/head=enh/llimits=1:3/x=181:191/y=1:7/l=1:3/file=a.nc v
+ 
+! Saving data with regular axes
+! First save without the bounds attribute, result is a file with
+! irregular time axis, possibly unintended large boxes.
+ 
+! 4/13 Increase precision for those list commands, see comment above
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+ 
+save/clobber/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: 01-JAN 00:45 to 31-OCT 09:36
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455  1826.213
+16-AUG      / 5:  28.00000  5479.395  1826.213
+15-SEP      / 6:  28.00000  6209.880   730.485
+16-OCT      / 7:  28.00000  6940.365   730.485
+can data a
+ 
+! Now save with /bounds
+ 
+!use climatological_axes
+use coads_climatology
+let v = missing(sst[gt=month_reg], 28)
+save/clobber/BOUNDS/file=a.nc/x=181/y=1/L=1:4 v
+save/append/file=a.nc/x=181/y=1/L=8:10 v
+can data/all
+can var v
+use a.nc
+ 
+list/prec=7 v, t[gt=v], tbox[gt=v]
+             DATA SET: ./a.nc
+             TIME: 01-JAN 00:45 to 31-OCT 09:36
+             LONGITUDE: 179W
+             LATITUDE: 1N
+ Column  1: V is MISSING(SST[GT=MONTH_REG], 28)
+ Column  2: T is T (axis MONTH_REG1)
+ Column  3: TBOX is TBOX (axis MONTH_REG1)
+                        V      T        TBOX
+16-JAN      / 1:  28.28389   366.000   730.485
+15-FEB      / 2:  28.41851  1096.485   730.485
+17-MAR      / 3:  28.04680  1826.970   730.485
+16-APR      / 4:  28.00000  2557.455   730.485
+16-JUN      / 5:      ....  4018.425  2191.455
+16-AUG      / 6:  28.00000  5479.395   730.485
+15-SEP      / 7:  28.00000  6209.880   730.485
+16-OCT      / 8:  28.00000  6940.365   730.485
+can data/all
+ 
+! gappy_bounds.nc has discontiguous bounds
+! We use the LOWER bound of all axis cells.
+ 
+use gappy_bounds.nc
+list/prec=7 a, t[gt=a], tboxlo[gt=a], tboxhi[gt=a]
+             DATA SET: ./gappy_bounds.nc
+             TIME: 01-JAN-1990 12:00 to 10-JAN-1990 12:00
+ Column  1: A is SST[X=150:180 at AVE,Y=-10:0 at AVE]
+ Column  2: T is T (axis TGAP)
+ Column  3: TBOXLO is TBOXLO (axis TGAP)
+ Column  4: TBOXHI is TBOXHI (axis TGAP)
+                           A      T       TBOXLO    TBOXHI
+02-JAN-1990 00 / 1:  29.69704  1.000000  0.500000  1.500000
+03-JAN-1990 00 / 2:  29.37104  2.000000  1.500000  2.500000
+04-JAN-1990 00 / 3:  29.11568  3.000000  2.500000  3.500000
+08-JAN-1990 00 / 4:  29.29205  7.000000  3.500000  7.500000
+09-JAN-1990 00 / 5:  28.89826  8.000000  7.500000  8.500000
+10-JAN-1990 00 / 6:  28.93826  9.000000  8.500000  9.500000
+ 
+cancel dat/all
+ 
+! bounds_noenclose has bounds that dont enclose the axis coordinate
+! points.  Use axis midpoints instead.
+ 
+use bounds_noenclose
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+ 
+! bounds_overlapping has bounds overlap.  Use axis midpoints instead.
+ 
+use bounds_overlapping
+sh axis/t tax
+ name       axis              # pts   start                end
+ TAX       T                    5 i   1                    11
+   Axis span (to cell edges) = 11
+ 
+       L     T                   TBOX      TBOXLO
+       1>  1                     1          0.5
+       2>  2                     4          1.5
+       3>  9                     4          5.5
+       4>  10                    1          9.5
+       5>  11                    1          10.5
+*** Running test: bn_all_leap.jnl
+! bn_all_leap.jnl
+! ACM 6/2004
+! Added ALL_LEAP, or 366_DAY calendar (which is in the CF conventions).
+! leap year every year
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=366_DAY tdays
+define grid/t=tdays tgrid
+let my_data = sin(l[g=tgrid])
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.1148
+ 28-FEB-1989 00 / 425: -0.7739
+ 29-FEB-1989 00 / 426: -0.9510
+ 01-MAR-1989 00 / 427: -0.2538
+ 
+define axis/t="1-jan-1988":"1-jan-1990":1/units=days/calendar=all_leap tdays
+ 
+list my_data[t="27-feb-1988":"1-mar-1988"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1988 00 / 58:  0.9929
+ 28-FEB-1988 00 / 59:  0.6367
+ 29-FEB-1988 00 / 60: -0.3048
+ 01-MAR-1988 00 / 61: -0.9661
+list my_data[t="27-feb-1989":"1-mar-1989"]
+             VARIABLE : SIN(L[G=TGRID])
+             SUBSET   : 4 points (TIME)
+             CALENDAR : ALL_LEAP
+ 27-FEB-1989 00 / 424:  0.1148
+ 28-FEB-1989 00 / 425: -0.7739
+ 29-FEB-1989 00 / 426: -0.9510
+ 01-MAR-1989 00 / 427: -0.2538
+ 
+! Check the error message
+set mode ignore_error
+def axis/t/cal=nogood/t=1-jan-2000:1-jan-2010:1/units=months tax
+ 
+can mode ignore
+*** Running test: bn570_bug_fixes.jnl
+! bn554_bug_fixes.jnl
+! test various fixes that went into version 5.70
+! 11/03 *acm*
+!
+ 
+! Test use of automatic levels in SHADE
+GO bn_reset
+cancel mode verify
+GO err560_shade_levels.jnl
+! err560_shade_levels.jnl  *acm* 4/28/04
+! Missing levels on SHADE auto-level
+ 
+! Fix for bug 801 went too far: shade levels need adjusting
+! (and were wrong always for negative levels)
+ 
+! Here is a simpler example (acm)
+set view upper; shade/i=1:10/j=1:10 i*j*0.0034   !levels only go up to 0.003
+set view lower; shade/i=1:10/j=1:10 -1*i*j*0.0034
+ 
+! Test use of reading irregular-time mc datasets
+GO bn_reset
+cancel mode verify
+GO err560_mc_irreg_t.jnl
+! err560_mc_irreg_t.jnl
+! 4/2004  ACM
+ 
+! Under Solaris, crashes Ferret;
+! Under linux get a NC error.
+! Its  a precision bug in mc_read.F, determining what
+! stepfile to read from, when the point requested is
+! just at or between the range of the stepfiles.
+ 
+set data coads_clim_irreg.des
+list/x=180/y=0/t=1-apr-1900 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 15-FEB-1900 16:29
+          28.36
+ 
+can mem/all
+can data/all
+set data coads_clim_irreg.des
+list/x=180/y=0/t=2000 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_irreg.des
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             TIME     : 15-FEB-1900 16:29
+          28.36
+ 
+ 
+! Crashed on SHADE of variable with NOLEAP axis, and subregion.
+GO bn_reset
+cancel mode verify
+GO err560_shade_noleap.jnl
+! err560_shade_noleap.jnl
+! 4/30/04 ACM
+ 
+! Crashes on SHADE of variable with NOLEAP axis, and subregion.
+ 
+def axis/t/t0=1-jan-2000/units=months/calendar=noleap tax = {1,3,4,5,6,8,9,12}
+def axis/depth/z=0:1000:15 zax
+let a = z[gz=zax] + t[gt=tax]
+ 
+shade/t=4-jan-2000:10-nov-2000 a
+ 
+! err560_regriding_gaps.jnl
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+GO bn_reset
+cancel mode verify
+GO err560_regridding_gaps.jnl
+! err560_regrid
+!
+! If the index has a negative range including the value
+! -111, was treated as missing rather than a valid index.
+ 
+def axis/modulo/x=1:360:1/units=lon xax
+def axis/modulo/x=-180:179:1/units=lon xaxshift
+ 
+let a = x[gx=xax]
+let b = x[gx=xaxshift]
+save/clobber/file=xlong.nc a
+save/clobber/file=xlongshift.nc b
+ 
+can data/all
+can var/all
+use xlongshift
+use xlong
+ 
+list/x=115w:108w a[gx=b[d=1]]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift]
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ave]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at AVE
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@sum]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at SUM
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@ngd]
+             VARIABLE : X[GX=XAX] (# of points)
+                        regrid: B[D=xlongshift] on X at NGD
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  1.000
+ 114W   / 427:  1.000
+ 113W   / 428:  1.000
+ 112W   / 429:  1.000
+ 111W   / 430:  1.000
+ 110W   / 431:  1.000
+ 109W   / 432:  1.000
+ 108W   / 433:  1.000
+ 
+list/x=115w:108w a[gx=b[d=1]@nrst]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at NRST
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+list/x=115w:108w a[gx=b[d=1]@xact]
+             VARIABLE : X[GX=XAX]
+                        regrid: B[D=xlongshift] on X at XACT
+             FILENAME : xlong.nc
+             SUBSET   : 8 points (LONGITUDE)
+ 115W   / 426:  245.0
+ 114W   / 427:  246.0
+ 113W   / 428:  247.0
+ 112W   / 429:  248.0
+ 111W   / 430:  249.0
+ 110W   / 431:  250.0
+ 109W   / 432:  251.0
+ 108W   / 433:  252.0
+ 
+sp rm xlong.nc
+sp rm xlongshift.nc
+ 
+! err560_leap_years.jnl
+! inconsistency in computing whether year is a leap year;
+! bug in drawing the time axis.
+GO bn_reset
+cancel mode verify
+GO err560_leap_years.jnl
+! err560_leap_years.jnl
+! Fixes for bug 882, inconsistency in computing whether
+! year is a leap year.
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot v[gt=tax at asn]
+ 
+! err560_dyn_grids.jnl
+!  plot missing in upper plot; error counting dynamic grids
+! GO bn_reset
+! GO err560_dyn_grids.jnl
+ 
+! err560_century.jnl
+! Century portion of years were not properly tested in numdm1.F
+GO bn_reset
+cancel mode verify
+GO err560_century
+! err560_century.jnl.jnl  *acm* 4/28/04
+! Century portion of years were not properly tested in numdm1.F
+ 
+! Crashes Ferret with STOP: ,2
+ 
+def axis/t="07-FEB-1899:12:00":"07-FEB-1900:12:00":365.2425/units=days/t0="1-jan-1800" tax
+let v = tsequence({55,65})
+plot/step=connected  v[gt=tax at asn]
+plot/over v[gt=tax at asn]
+ 
+plot v[gt=tax at asn]
+ 
+ 
+! Also need to test this, years 599 - 600
+ 
+def axis/t=07-feb-0599:07-feb-0600:1/units=years tt
+plot t[gt=tt]
+*** Running test: bn_modstats.jnl
+! bn_modstats.jnl
+! acm 8/25/04
+! There was never a benchmark test of modulo statistics.
+! (and a bug had crept into @MODVAR when there was missing data)
+ 
+use  gtsa056_2.cdf
+set region/x=140/y=1/k=1
+let var = if temp gt 29.5 then temp
+ 
+!use climatological_axes
+!can data climatological_axes
+ 
+list var[gt=month_reg at mod]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MOD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.56
+ 15-FEB      /  2:  29.53
+ 17-MAR      /  3:  29.66
+ 16-APR      /  4:  29.88
+ 16-MAY      /  5:  29.89
+ 16-JUN      /  6:  29.96
+ 16-JUL      /  7:  29.69
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.67
+ 16-OCT      / 10:  29.75
+ 15-NOV      / 11:  29.91
+ 16-DEC      / 12:  29.77
+ 
+! bug had values of Inf surrounding missing data
+list var[gt=month_reg at modvar]
+             VARIABLE : Variance of IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODVAR
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                     139.5E  
+                      10
+ 16-JAN      /  1:  0.00207
+ 15-FEB      /  2:  0.00050
+ 17-MAR      /  3:  0.00795
+ 16-APR      /  4:  0.00150
+ 16-MAY      /  5:  0.00351
+ 16-JUN      /  6:  0.00970
+ 16-JUL      /  7:  0.01888
+ 16-AUG      /  8:     ....
+ 15-SEP      /  9:  0.00558
+ 16-OCT      / 10:  0.00681
+ 15-NOV      / 11:  0.00191
+ 16-DEC      / 12:  0.00483
+list var[gt=month_reg at modmin]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMIN
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.50
+ 15-FEB      /  2:  29.52
+ 17-MAR      /  3:  29.52
+ 16-APR      /  4:  29.78
+ 16-MAY      /  5:  29.79
+ 16-JUN      /  6:  29.80
+ 16-JUL      /  7:  29.50
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.53
+ 16-OCT      / 10:  29.64
+ 15-NOV      / 11:  29.86
+ 16-DEC      / 12:  29.66
+list var[gt=month_reg at modmax]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODMAX
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  29.64
+ 15-FEB      /  2:  29.55
+ 17-MAR      /  3:  29.82
+ 16-APR      /  4:  29.93
+ 16-MAY      /  5:  29.96
+ 16-JUN      /  6:  30.08
+ 16-JUL      /  7:  29.82
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  29.75
+ 16-OCT      / 10:  29.90
+ 15-NOV      / 11:  29.97
+ 16-DEC      / 12:  29.86
+list var[gt=month_reg at modsum]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP
+                        regrid: 730 hour on T at MODSUM
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  295.6
+ 15-FEB      /  2:   59.1
+ 17-MAR      /  3:  533.9
+ 16-APR      /  4:  597.7
+ 16-MAY      /  5:  597.8
+ 16-JUN      /  6:  359.6
+ 16-JUL      /  7:  207.8
+ 16-AUG      /  8:   ....
+ 15-SEP      /  9:  237.3
+ 16-OCT      / 10:  297.5
+ 15-NOV      / 11:  299.1
+ 16-DEC      / 12:  297.7
+list var[gt=month_reg at modngd]
+             VARIABLE : IF TEMP GT 29.5 THEN TEMP (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  10.00
+ 15-FEB      /  2:   2.00
+ 17-MAR      /  3:  18.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:   7.00
+ 16-AUG      /  8:   0.00
+ 15-SEP      /  9:   8.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+*** Running test: bn_mc_vary_scale.jnl
+! bn_mc_vary_scale.jnl
+!   Allow stepfiles to have different internal scale and offset.
+!   read and apply when opening each stepfile. Previously, the
+!   scale and offset from the first stepfile were applied.
+!   `var,return=nc_offset` and `var,return=nc_scale1` contain the
+!   latest scaling applied
+ 
+ 
+set data vary_scale.des
+! With two different scalings applied for the two stepfiles, there
+! is a change in slope and offset in the middle of this data
+ 
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 20 points (TIME)
+ 01-JAN-1990 00 /  1:  -0.50
+ 02-JAN-1990 00 /  2:  -1.50
+ 03-JAN-1990 00 /  3:  -2.50
+ 04-JAN-1990 00 /  4:  -3.50
+ 05-JAN-1990 00 /  5:  -4.50
+ 06-JAN-1990 00 /  6:  -5.50
+ 07-JAN-1990 00 /  7:  -6.50
+ 08-JAN-1990 00 /  8:  -7.50
+ 09-JAN-1990 00 /  9:  -8.50
+ 10-JAN-1990 00 / 10:  -9.50
+ 11-JAN-1990 00 / 11:   1.98
+ 12-JAN-1990 00 / 12:   3.98
+ 13-JAN-1990 00 / 13:   5.98
+ 14-JAN-1990 00 / 14:   7.98
+ 15-JAN-1990 00 / 15:   9.98
+ 16-JAN-1990 00 / 16:  11.98
+ 17-JAN-1990 00 / 17:  13.98
+ 18-JAN-1990 00 / 18:  15.98
+ 19-JAN-1990 00 / 19:  17.98
+ 20-JAN-1990 00 / 20:  19.98
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.000 -0.02000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the first stepfile
+list/L=2:4 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 02-JAN-1990 00 / 2: -1.500
+ 03-JAN-1990 00 / 3: -2.500
+ 04-JAN-1990 00 / 4: -3.500
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead -1, 0.5
+I / *:    -1.000  0.5000
+ 
+ 
+can data/all
+can mem
+set data vary_scale.des
+ 
+! The scale and offset from the second stepfile
+list/L=12:14 tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             DATA SET : Model Output, Daily Averages
+             FILENAME : vary_scale.des
+             SUBSET   : 3 points (TIME)
+ 12-JAN-1990 00 / 12:  3.980
+ 13-JAN-1990 00 / 13:  5.980
+ 14-JAN-1990 00 / 14:  7.980
+list/quiet/nohead `tt,return=nc_scale`, `tt,return=nc_offset`
+ !-> list/quiet/nohead 2, -0.02
+I / *:     2.000 -0.02000
+ 
+*** Running test: bn_plot_nokey.jnl
+! bn_plot_nokey.jnl (bug 1089)
+! 22-nov-2004
+ 
+! Test new PLOT/NOKEY qualifier
+! Plot several lines together, then plot/over
+ 
+PLOT/NOKEY/I=1:100 cos(i/20), sin(i/30), cos(i/30)*sin(i/20)
+PLOT/OVER/NOKEY/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! plot/vs
+PLOT/VS/LINE/NOKEY/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/NOKEY/I=1:314 i*cos(i/30), i*sin(i/30)
+ 
+! time series
+USE gtsa056_2
+PLOT/X=180/Y=0/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=-1/K=1 temp
+PLOT/OVER/NOKEY/X=180/Y=1/K=1 temp
+*** Running test: bn580_bug_fixes.jnl
+! bn580_bug_fixes.jnl
+! test various fixes that went into version 5.80
+! 7/04 *acm*
+!
+ 
+! POLYGON (or SHADE) plots with a single level had no fill color
+GO bn_reset
+cancel mode verify
+GO err570_singlecolor.jnl
+! err570_singlecolor.jnl
+! 7/6/2004
+ 
+! See bug 901. When a single fill color is sent to
+! the POLYGON, SHADE, or FILL, the code sends the command
+! PPL LEV (val).  But, the value was formatted so that the
+! value got rounded off, so the precise value wasnt specified
+! and the graphics call then didn't find the value.
+ 
+! This polygon was filled
+let a = 111
+poly/fill/line {0,1,2},{1,2,1},a
+ 
+! This polygon was not filled
+let a = 111.55
+poly/fill/over/line {0,1,2},{2,1,2},a
+ 
+! This shade plot did not fill in.
+define axis/x=1:10:1 xax
+define axis/y=1:12:1 yax
+let b = x[gx=xax] + y[gy=yax]
+shade/y=0:90 a + 0*b
+ 
+! FILL doesnt make the graphics call to do the fil plot
+! when there is just one level ...
+ 
+! ... and this is bug 957; similar symptoms but a different
+! cause. SHADE and POLY need level defined when there is just
+! one level.
+ 
+let v = 15
+shade/lev=1/x=1:10/y=1:10 v + 0*x + 0*y
+ 
+ 
+def axis/x=1:1:1 xaxj
+def grid/x=xaxj gaxj
+let a = 111241*x[gx=gaxj at asn]
+poly/lev=2 {0,1,2},{1,2,1},a ! OR lev=1
+ 
+! colorbar labels too close to the bar, when user sets bar location
+GO bn_reset
+cancel mode verify
+GO err570_shakeylab.jnl
+ 
+! err570_shakeylab.jnl
+! 7/6/2004
+ 
+!  When user defines the location of the color key, the key
+!  labels are too close to the edge of the key.
+ 
+! Test with both SHADE and FILL, as some of the scaling is
+! different internally.
+ 
+ 
+use coads_climatology
+ppl dfltfnt cr
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+fill/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl fill
+ 
+fill/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl fill
+ 
+fill/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl fill
+ 
+!
+ 
+define viewport/axes/text=1/xlim=0.1:0.85/ylim=`1/3`:`2/3` vp_1
+ !-> define viewport/axes/text=1/xlim=0.1:0.85/ylim=0.3333333333333333:0.6666666666666666 vp_1
+set viewport vp_1
+ 
+shade/set/L=2 sst
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl shade
+ 
+shade/set/L=2 sst* 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl shade
+ 
+shade/set/L=2 sst/ 10000
+ppl shakey 1, 1, 0.1, 0, -2, 8,  `($ppl$xorg)+($ppl$xlen)+0.3`,  `($ppl$xorg)+($ppl$xlen)+0.6`, `($ppl$yorg)`, `($ppl$yorg)+($ppl$ylen)`
+ !-> ppl shakey 1, 1, 0.1, 0, -2, 8,  9.225,  9.525, 1.375, 4.208
+ppl shade
+ 
+ 
+ppl dfltfnt sr
+ 
+! Null input gives wierd error message
+GO bn_reset
+cancel mode verify
+GO err570_null_symbol.jnl
+! err570_null_symbol.jnl
+! null input -- > wierd error message see bug 919
+!
+!    **ERROR: invalid command: DEFINE what name?
+!    DEFINE VARIABLE
+ 
+set mode ignore
+ 
+def sym a " "
+($a)
+ 
+can mode ignore
+ 
+! Replace text expression with its value: string variable was too short
+GO bn_reset
+cancel mode verify
+GO err570_parse_labelcommand.jnl
+! err570_parse_labelcommand.jnl
+! fix for bug 956.
+!
+! When a command is issued with an argument being a variable containing
+! a long string, the string is cut off when the command is parsed to
+! substitude the value of the variable.
+! (bug fix is lengthening the length of variable repl in repl_exprns.F)
+ 
+can view
+pplus/reset
+PLOT/i=1:10  1/i
+ 
+let line1 = "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890"
+let line2 = "<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let tsulab = strcat(line1, line2)
+list tsulab
+             VARIABLE : STRCAT(LINE1, LINE2)
+        "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ 
+! Previously when the value of tsulab is replaced in the command and
+! echoed back to the terminal, the string was truncated, with bad appended
+! to the end of the shortened second line.
+ 
+label/nouser 3.6,`($ppl$ylen)+0.2`,0,0,0.08, `tsulab`
+ !-> PPL %LABEL/nouser 3.6,5.95,0,0,0.08, 1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890<nl>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ 
+! result of COMPRESSK_BY function does not vary in X
+GO bn_reset
+cancel mode verify
+GO err570_compressk_by.jnl
+! err570_compress_by.jnl
+! fix for bug 925
+ 
+!--------------------------------------------------------------
+! create a file with 3-d data and 2-d array of sampling levels
+! define xy and xyz grids
+ 
+def axis/x=1:5:1 xax ; def axis/y=1:4:1 yax ; def axis/z=1:3:1 zax
+def grid/x=xax/y=yax gxy ; def grid/x=xax/y=yax/z=zax gxyz
+ 
+let/title="Sampling Levels" ind=int(3*randu(x[g=gxy]+y[g=gxy])+1)
+let/title="3-D Data" temp=x[g=gxyz]+10*(y[g=gxyz]+10*z[g=gxyz])
+ 
+list ind
+             VARIABLE : Sampling Levels
+             SUBSET   : 5 by 4 points (X-Y)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  3.000  2.000  1.000  1.000  3.000
+ 2   / 2:  1.000  3.000  2.000  2.000  3.000
+ 3   / 3:  2.000  3.000  3.000  2.000  3.000
+ 4   / 4:  3.000  2.000  1.000  1.000  2.000
+!             1      2      3      4      5
+! 1   / 1:  3.000  2.000  1.000  1.000  3.000
+! 2   / 2:  1.000  3.000  2.000  2.000  3.000
+! 3   / 3:  2.000  3.000  3.000  2.000  3.000
+! 4   / 4:  3.000  2.000  1.000  1.000  2.000
+ 
+list temp
+             VARIABLE : 3-D Data
+             SUBSET   : 5 by 4 by 3 points (X-Y-Z)
+             1      2      3      4      5    
+             1      2      3      4      5
+ ---- K:1 Z:   1
+ 1   / 1:  111.0  112.0  113.0  114.0  115.0
+ 2   / 2:  121.0  122.0  123.0  124.0  125.0
+ 3   / 3:  131.0  132.0  133.0  134.0  135.0
+ 4   / 4:  141.0  142.0  143.0  144.0  145.0
+ ---- K:2 Z:   2
+ 1   / 1:  211.0  212.0  213.0  214.0  215.0
+ 2   / 2:  221.0  222.0  223.0  224.0  225.0
+ 3   / 3:  231.0  232.0  233.0  234.0  235.0
+ 4   / 4:  241.0  242.0  243.0  244.0  245.0
+ ---- K:3 Z:   3
+ 1   / 1:  311.0  312.0  313.0  314.0  315.0
+ 2   / 2:  321.0  322.0  323.0  324.0  325.0
+ 3   / 3:  331.0  332.0  333.0  334.0  335.0
+ 4   / 4:  341.0  342.0  343.0  344.0  345.0
+!             1      2      3      4      5
+! ---- K:1 Z:   1
+! 1   / 1:  111.0  112.0  113.0  114.0  115.0
+! 2   / 2:  121.0  122.0  123.0  124.0  125.0
+! 3   / 3:  131.0  132.0  133.0  134.0  135.0
+! 4   / 4:  141.0  142.0  143.0  144.0  145.0
+! ---- K:2 Z:   2
+! 1   / 1:  211.0  212.0  213.0  214.0  215.0
+! 2   / 2:  221.0  222.0  223.0  224.0  225.0
+! 3   / 3:  231.0  232.0  233.0  234.0  235.0
+! 4   / 4:  241.0  242.0  243.0  244.0  245.0
+! ---- K:3 Z:   3
+! 1   / 1:  311.0  312.0  313.0  314.0  315.0
+! 2   / 2:  321.0  322.0  323.0  324.0  325.0
+! 3   / 3:  331.0  332.0  333.0  334.0  335.0
+! 4   / 4:  341.0  342.0  343.0  344.0  345.0
+ 
+let mask=if(ind+0*z[g=gxyz] eq k[g=gxyz])then 1
+let tlev=compressk_by(temp,mask)
+ 
+!**** here is the bug behavior ... column 1 is as expected but not the others
+! list tlev[k=1]
+!             1      2      3      4      5
+! 1   / 1:  311.0  311.0  311.0  311.0  311.0
+! 2   / 2:  121.0  121.0  121.0  121.0  121.0
+! 3   / 3:  231.0  231.0  231.0  231.0  231.0
+! 4   / 4:  341.0  341.0  341.0  341.0  341.0
+ 
+list tlev[k=1]
+             VARIABLE : COMPRESSK_BY(TEMP,MASK)
+             SUBSET   : 5 by 4 points (X-Y)
+             Z        : 1
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:  311.0  212.0  113.0  114.0  315.0
+ 2   / 2:  121.0  322.0  223.0  224.0  325.0
+ 3   / 3:  231.0  332.0  333.0  234.0  335.0
+ 4   / 4:  341.0  242.0  143.0  144.0  245.0
+ 
+ 
+ 
+! Command parsing on PPL side had string lengths too short
+GO bn_reset
+cancel mode verify
+GO err570_long_label.jnl
+! err570_long_label.jnl
+! Fix for bug 956
+ 
+! Very long multi-line label truncated on %LABEL command
+! (string lengths hardwired to 255 deep in PPLUS command parsing)
+ 
+PLOT/i=1:10  1/i
+ 
+set mod verify
+! from Jean Newman's facts_ttl_src_lst.jnl
+ 
+define symbol clrmod = 2
+let source_list = "Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+let tit_x = 3.6035
+let sl_y = 6.5
+ 
+  define symbol lenline = `strlen(source_list)+8`
+ !-> define symbol lenline = 275
+      let tsuchr = 0.09
+      let ntsulns = if `($VP_WIDTH)/((($lenline)/2.)*.9) lt 0.09` then 3 else 2
+ !-> DEFINE VARIABLE ntsulns = if 1 then 3 else 2
+      let nctsulns = `int(($lenline)/ntsulns)`
+ !-> DEFINE VARIABLE nctsulns = 91
+      let lstr1 = `strrindex(substring(source_list,0,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr1 = 88
+        let lstr2 = `strrindex(substring(source_list,lstr1+1,nctsulns),"+")`
+ !-> DEFINE VARIABLE lstr2 = 90
+        let str3a = substring(source_list,0,lstr1)
+        let str3 = strcat(str3a,"<nl>")
+        let str4a = substring(source_list,lstr1+1,lstr2)
+        let str4 = strcat(str4a,"<nl>")
+        let str1 = strcat(str3,str4)
+        let lstr3 = `lstr1+lstr2`
+ !-> DEFINE VARIABLE lstr3 = 178
+        let str2 = substring(source_list,lstr3+1,($lenline)-lstr3)
+ !-> DEFINE VARIABLE str2 = substring(source_list,lstr3+1,275-lstr3)
+        let tsustr = strcat(str1,str2)
+      let tsulab = strcat("@P($clrmod)Source: ",tsustr)
+ !-> DEFINE VARIABLE tsulab = strcat("@P2Source: ",tsustr)
+      list/noheader tsulab
+        "@P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24"
+    label/nouser `tit_x`,`sl_y`,0,0,`tsuchr` `tsulab`
+ !-> PPL %LABEL/nouser 3.6035,6.5,0,0,0.09 @P2Source: Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+<nl>14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+<nl>14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23+14.76*a24+14.76*b24
+ 
+set mode/last verify
+ 
+! Allow PPL POLYGON after a POLY/SET (previously was PPL FILLPOL)
+GO bn_reset
+cancel mode verify
+GO err570_ppl_poly.jnl
+! err570_ppl_poly.jnl
+ 
+! bug 959
+! When we use polygon/set; ppl shakey; ppl polygon
+! to control the vector key, the numerical labels on
+! the key disappear.  (allow PPL POLYGON as well as
+! PPL FILLPOL after a POLY/SET)
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+ 
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/set xpts+xsqr, ypts+ysqr, x*x/10
+ppl shakey 1, 1, .1
+ppl polygon
+ 
+! Fix formatting of coordinates on LIST/FORMAT=tab or /FORMAT=comma
+GO bn_reset
+cancel mode verify
+GO err570_list_tab_coords.jnl
+! err570_list_tab_coords.jnl
+! acm 9/7/04
+! LIST/FORMAT=tab or /FORMAT=comma listed
+! coordinates in a fixed format not sufficient
+! to distinguish finely spaced coordinates
+ 
+def axis/x=100:100.25:0.05/units=deg xax
+def axis/y=0.11:0.25:0.018/units=deg yax
+let aa = (x[gx=xax] + y[gy=yax])/100
+list/form=tab aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 by 9 points (LONGITUDE-LATITUDE)
+  	100E   	100.05E	100.1E 	100.15E	100.2E 	100.25E
+0.11N	1.001	1.002	1.002	1.003	1.003	1.004
+0.13N	1.001	1.002	1.002	1.003	1.003	1.004
+0.15N	1.001	1.002	1.002	1.003	1.003	1.004
+0.16N	1.002	1.002	1.003	1.003	1.004	1.004
+0.18N	1.002	1.002	1.003	1.003	1.004	1.004
+0.2N	1.002	1.002	1.003	1.004	1.004	1.004
+0.22N	1.002	1.003	1.003	1.004	1.004	1.005
+0.24N	1.002	1.003	1.003	1.004	1.004	1.005
+0.25N	1.003	1.003	1.004	1.004	1.005	1.005
+def axis/x=100:100.11:0.033/units=deg xax
+list/form=comma aa
+             VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100
+             BAD FLAG : -1.E+34       
+             SUBSET   : 4 by 9 points (LONGITUDE-LATITUDE)
+   100E   ,100.03E,100.07E,100.1E 
+0.11N,1.001,1.001,1.002,1.002
+0.13N,1.001,1.002,1.002,1.002
+0.15N,1.001,1.002,1.002,1.002
+0.16N,1.002,1.002,1.002,1.003
+0.18N,1.002,1.002,1.002,1.003
+0.2N,1.002,1.002,1.003,1.003
+0.22N,1.002,1.003,1.003,1.003
+0.24N,1.002,1.003,1.003,1.003
+0.25N,1.003,1.003,1.003,1.004
+ 
+! Fix bug in HASH_CX for large numbers of varibles
+GO bn_reset
+cancel mode verify
+GO err570_many_variables.jnl
+! err570_many_variables.jnl
+! 27-sep-2004  ACM
+! See bug 993
+ 
+! Script derived from Jean Newman script where she
+! opens up many files and defines a bunch of variables.
+ 
+! Jean Newman's script opens 25 data files, defines over 200 variables, and uses
+! very long strings.  It uses string functions to break up a long string
+! describing the data into reasonable length lines for labels, inserting <NL>
+! linebreak character.  Crashes with seg fault or with messages like this:
+!
+! yes? load str4a
+! Subscript out of range on file re_assign_variable.F, line 78, procedure
+! re_assign_variable.
+! Subscript number 1 has value -111 in array mv_flink.
+!
+!  (different errors if we define a slightly different number of variables or list
+! some of them, causing them to be evaluated in a different order.)  Generally
+! crashes on execution of a string function.
+!
+! See ~ansley/ans_ferret/users/jnewman/facts/x_r.jnl
+!     ~ansley/ans_ferret/users/jnewman/facts/example_crash.jnl
+!
+!set mode diag
+ 
+DEFINE SYMBOL SOURCE_LIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23
+ 
+ 
+! set data "facts/s_1936_533.nc"
+LET TOTAL_TIMESTEPS = 420
+LET HA12 = 14.76 * HA[D=s_1936_533.nc]
+LET AA12 = SLAT[D=s_1936_533.nc]
+LET OA12 = SLON[D=s_1936_533.nc]
+LET SA12 = 245
+LET DA12 = 15
+LET HB12 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET AB12 = SLAT[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET OB12 = SLON[D=s_1936_533.nc]   !! [D=S_1939_529.NC]
+LET SB12 = 245
+LET DB12 = 15
+LET HA13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET AA13 = SLAT[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET OA13 = SLON[D=s_1936_533.nc]   !! [D=S_1950_537.NC]
+LET SA13 = 245
+LET DA13 = 15
+LET HB13 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET AB13 = SLAT[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET OB13 = SLON[D=s_1936_533.nc]   !! [D=S_1953_533.NC]
+LET SB13 = 245
+LET DB13 = 15
+LET HA14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET AA14 = SLAT[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET OA14 = SLON[D=s_1936_533.nc]   !! [D=S_1964_541.NC]
+LET SA14 = 250
+LET DA14 = 15
+LET HB14 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET AB14 = SLAT[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET OB14 = SLON[D=s_1936_533.nc]   !! [D=S_1967_537.NC]
+LET SB14 = 250
+LET DB14 = 15
+LET HA15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET AA15 = SLAT[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET OA15 = SLON[D=s_1936_533.nc]   !! [D=S_1979_544.NC]
+LET SA15 = 253
+LET DA15 = 15
+LET HB15 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET AB15 = SLAT[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET OB15 = SLON[D=s_1936_533.nc]   !! [D=S_1981_539.NC]
+LET SB15 = 253
+LET DB15 = 15
+LET HA16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET AA16 = SLAT[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET OA16 = SLON[D=s_1936_533.nc]   !! [D=S_1994_546.NC]
+LET SA16 = 256
+LET DA16 = 15
+LET HB16 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET AB16 = SLAT[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET OB16 = SLON[D=s_1936_533.nc]   !! [D=S_1996_542.NC]
+LET SB16 = 256
+LET DB16 = 15
+LET HA17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET AA17 = SLAT[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET OA17 = SLON[D=s_1936_533.nc]   !! [D=S_2009_548.NC]
+LET SA17 = 253
+LET DA17 = 15
+LET HB17 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET AB17 = SLAT[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET OB17 = SLON[D=s_1936_533.nc]   !! [D=S_2011_544.NC]
+LET SB17 = 253
+LET DB17 = 15
+LET HA18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET AA18 = SLAT[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET OA18 = SLON[D=s_1936_533.nc]   !! [D=S_2023_551.NC]
+LET SA18 = 247
+LET DA18 = 15
+LET HB18 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET AB18 = SLAT[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET OB18 = SLON[D=s_1936_533.nc]   !! [D=S_2026_547.NC]
+LET SB18 = 247
+LET DB18 = 15
+LET HA19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET AA19 = SLAT[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET OA19 = SLON[D=s_1936_533.nc]   !! [D=S_2036_555.NC]
+LET SA19 = 240
+LET DA19 = 15
+LET HB19 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET AB19 = SLAT[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET OB19 = SLON[D=s_1936_533.nc]   !! [D=S_2040_551.NC]
+LET SB19 = 240
+LET DB19 = 15
+LET HA20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET AA20 = SLAT[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET OA20 = SLON[D=s_1936_533.nc]   !! [D=S_2049_560.NC]
+LET SA20 = 236
+LET DA20 = 15
+LET HB20 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET AB20 = SLAT[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET OB20 = SLON[D=s_1936_533.nc]   !! [D=S_2053_556.NC]
+LET SB20 = 236
+LET DB20 = 15
+LET HA21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET AA21 = SLAT[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET OA21 = SLON[D=s_1936_533.nc]   !! [D=S_2062_565.NC]
+LET SA21 = 236
+LET DA21 = 15
+LET HB21 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET AB21 = SLAT[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET OB21 = SLON[D=s_1936_533.nc]   !! [D=S_2067_561.NC]
+LET SB21 = 236
+LET DB21 = 15
+LET HA22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET AA22 = SLAT[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET OA22 = SLON[D=s_1936_533.nc]   !! [D=S_2075_570.NC]
+LET SA22 = 236
+LET DA22 = 15
+LET HB22 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET AB22 = SLAT[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET OB22 = SLON[D=s_1936_533.nc]   !! [D=S_2080_566.NC]
+LET SB22 = 236
+LET DB22 = 15
+LET HA23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET AA23 = SLAT[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET OA23 = SLON[D=s_1936_533.nc]   !! [D=S_2089_575.NC]
+LET SA23 = 236
+LET DA23 = 15
+LET HB23 = 14.76 * HA[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET AB23 = SLAT[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET OB23 = SLON[D=s_1936_533.nc]   !! [D=S_2094_571.NC]
+LET SB23 = 236
+LET DB23 = 15
+LET HA_LC = HA12+HB12+HA13+HB13+HA14+HB14+HA15+HB15+HA16+HB16+HA17+HB17+HA18+HB18+HA19+HB19+HA20+HB20+HA21+HB21+HA22+HB22+HA23+HB23
+LET HA_LC_TPLV = 64
+LET HA_LC_T1DLV = 16
+LET HA_LC_BTLV = -64
+LET HA_LC_B1DLV = -16
+LET HA_LC_SCL = 10
+LET UA_LC = UA12+UB12+UA13+UB13+UA14+UB14+UA15+UB15+UA16+UB16+UA17+UB17+UA18+UB18+UA19+UB19+UA20+UB20+UA21+UB21+UA22+UB22+UA23+UB23
+LET UA_LC_TPLV = 8
+LET UA_LC_T1DLV = 0.64
+LET UA_LC_BTLV = -8
+LET UA_LC_B1DLV = -0.64
+LET UA_LC_SCL = 1000
+LET VA_LC = VA12+VB12+VA13+VB13+VA14+VB14+VA15+VB15+VA16+VB16+VA17+VB17+VA18+VB18+VA19+VB19+VA20+VB20+VA21+VB21+VA22+VB22+VA23+VB23
+LET VA_LC_TPLV = 8
+LET VA_LC_T1DLV = 0.64
+LET VA_LC_BTLV = -8
+LET VA_LC_B1DLV = -0.64
+LET VA_LC_SCL = 1000
+LET SPEED = (UA_LC^2 + VA_LC^2) ^ 0.5
+LET SPEED_TPLV = 40
+LET SPEED_1DLV = 16
+LET SPEED_SCL = 100
+LET MAX_SPEED = SPEED[L=1:420 at MAX]
+LET MAX_SPEED_TPLV = 40
+LET MAX_SPEED_1DLV = 16
+LET MAX_SPEED_SCL = 10
+LET MAX_ALL = HA_LC[L=1:420 at MAX]
+LET MIN_MASK = IF MAX_ALL GT .001 THEN 1
+LET MAX_WAVE = MAX_ALL*MIN_MASK
+LET MAX_WAVE_TPLV = 500
+LET MAX_WAVE_1DLV = 400
+LET MAX_WAVE_SCL = 10
+LET SIG_WAVE = HA_LC[L=1:420] - MAX_WAVE
+LET MAX_TTIME = SIG_WAVE[L=1:420 at LOC:0]
+LET THRESHOLD_PRCNT = .30
+LET NOISE_MASK = IF HA_LC[L=1:420] LE MAX_ALL*THRESHOLD_PRCNT THEN 0 ELSE 1
+LET ON_MASK = IF NOISE_MASK[L=1:420 at RSUM] GE 1 THEN 0.5
+LET OFF_EVENTS = IF NOISE_MASK - NOISE_MASK[L=1:420 at SHF:-1] LT 0 THEN 1 ELSE 0
+LET OFF_MASK = IF OFF_EVENTS[L=1:420 at RSUM] LT 1 THEN 0.5
+LET WAVE1 = (ON_MASK+OFF_MASK)*HA_LC[L=1:420]
+LET FIRST_WAVE = WAVE1[L=1:420 at MAX]*MIN_MASK
+LET FIRST_WAVE_TPLV = 500
+LET FIRST_WAVE_1DLV = 400
+LET FIRST_WAVE_SCL = 10
+LET SIG_WAVE1 = WAVE1[L=1:420] - FIRST_WAVE
+LET FIRST_TTIME = SIG_WAVE1[L=1:420 at LOC:0]
+LET DTOR = 0.017453
+LET FAULT_LENGTH = 50
+LET FAULT_WIDTH = 50
+LET BO1 = SRCO-FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA1 = SRCA-FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO4 = SRCO+FAULT_LENGTH*COS((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA4 = SRCA+FAULT_LENGTH*SIN((270-STRK)*DTOR)/111.32
+LET BO2 = BO1+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA2 = BA1-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET BO3 = BO4+FAULT_WIDTH*COS(DIP*DTOR)*SIN((270-STRK)*DTOR)/111.32/COS(SRCA*DTOR)
+LET BA3 = BA4-FAULT_WIDTH*COS(DIP*DTOR)*COS((270-STRK)*DTOR)/111.32
+LET SRC_LAT = {53.307,52.9,53.687,53.28,54.076,53.654,54.36,53.93,54.596,54.16,54.83,54.4,55.133,54.72,55.509,55.12,55.97,55.598,56.473,56.1,56.975,56.603,57.512,57.14}
+LET SRC_LON = {193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}
+LET NSRCS = 24
+LET MX_MX = 474.27
+LET MXTOP = IF MX_MX GT HA_LC_T1DLV THEN MX_MX ELSE HA_LC_TPLV
+LET MN_MN = -284.33
+LET MXBOT = IF MN_MN LT HA_LC_B1DLV THEN MN_MN ELSE HA_LC_BTLV
+LET SL_X = 0.
+LET SL_X2 = 7.207
+LET SL_Y = 5.518+.26
+LET TIT_X = 7.207/2
+LET TIT_Y = 5.518+.85
+LET TSUCHR = 0.09
+LET NTSULNS = IF 1 THEN 3 ELSE 2
+LET NCTSULNS = 85
+ 
+let str1a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str1a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+let lstr1 = STRLEN("+")
+ 
+let str2a = STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+list str2a
+             VARIABLE : STRLEN("{193.63,193.94,194.97,195.29,196.43,196.69,197.9,198.12,199.43,199.62,200.88,201.11,202.26,202.57,203.6,204,204.9,205.34,206.21,206.66,207.54,207.99,208.94,209.4}")
+          162.0
+ 
+def sym aLIST = Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7
+ 
+let lstr2 = STRLEN("($alist)")
+ !-> DEFINE VARIABLE lstr2 = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.7")
+ 
+let str3a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str3a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+list str3a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.0
+ 
+!let a = 12; list a
+ 
+LET STR3 = STRLEN("abcd")
+list str3
+             VARIABLE : STRLEN("abcd")
+          4.000
+ 
+let str4a = STRLEN("($source_list)")
+ !-> DEFINE VARIABLE str4a = STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.76*a20+14.76*b20+14.76*a21+14.76*b21+14.76*a22+14.76*b22+14.76*a23+14.76*b23")
+ 
+list str4a
+             VARIABLE : STRLEN("Mw 9.2, 14.76*a12+14.76*b12+14.76*a13+14.76*b13+14.76*a14+14.76*b14+14.76*a15+14.76*b15+14.76*a16+14.76*b16+14.76*a17+14.76*b17+14.76*a18+14.76*b18+14.76*a19+14.76*b19+14.7
+          247.0
+ 
+ 
+! Fix bug in @CNNN within multi-line labels
+GO bn_reset
+cancel mode verify
+GO err570_cnnn_multiline.jnl
+! Changing pen with @Cnnn did not work in
+! multi-line labels
+ 
+plot/hl=0:1/vl=0:1/vs 0,0
+label 0.2, 0.7, 0, 0, 0.2, "@p2This<NL>@P3works<NL>@p4fine."
+label 0.5, 0.7, 0, 0, 0.2, "@C002this<NL>@c003does<NL>@C004not."
+label 0.8, 0.7, 0, 0, 0.2, "@C002this<NL>does<NL>not @C004either."
+ 
+label 0.1, 0.3, 0, 0, 0.2, "greek<NL>@SGt at SR_y<NL>works"
+ 
+! For a very fine grid, coordinates not listed with enough precision.
+GO bn_reset
+cancel mode verify
+GO err570_fine_grid_list.jnl
+! err570_fine_grid_list.jnl
+! ACM 10/2004
+! ACM  6/2007 CANCEL LIST/PREC at the end to restore the default state.
+ 
+! For a very fine grid in longitude and latitude, the coordinates
+! are not listed with enough precision to resolve them.
+ 
+ 
+let hlon= {204.89923, 204.89975, 204.90025, 204.90076, 204.90126}
+let hlat = { 19.70020, 19.70071, 19.70122, 19.70173, 19.70223, 19.70274}
+ 
+def axis/x/units=lon xfine = hlon
+def axis/y/units=lat yfine = hlat
+ 
+let myvar = x[gx=xfine] + y[gy=yfine]
+ 
+set list/prec=8
+list/form=tab myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+  	155.1008W	155.1002W	155.0998W	155.0992W	155.0987W
+19.7002N	224.59943	224.59995	224.60045	224.60096	224.60146
+19.7007N	224.59994	224.60046	224.60096	224.60147	224.60197
+19.7012N	224.60045	224.60097	224.60147	224.60198	224.60248
+19.7017N	224.60096	224.60148	224.60198	224.60249	224.60299
+19.7022N	224.60146	224.60198	224.60248	224.60299	224.60349
+19.7027N	224.60197	224.60249	224.60299	224.6035	224.604
+ 
+set list/prec=8
+list/form=comma myvar
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 by 6 points (LONGITUDE-LATITUDE)
+   155.1008W,155.1002W,155.0998W,155.0992W,155.0987W
+19.7002N,224.59943,224.59995,224.60045,224.60096,224.60146
+19.7007N,224.59994,224.60046,224.60096,224.60147,224.60197
+19.7012N,224.60045,224.60097,224.60147,224.60198,224.60248
+19.7017N,224.60096,224.60148,224.60198,224.60249,224.60299
+19.7022N,224.60146,224.60198,224.60248,224.60299,224.60349
+19.7027N,224.60197,224.60249,224.60299,224.6035,224.604
+ 
+list/clobber/head=enh/form=(f9.5)/file=fine.dat myvar
+sp cat fine.dat
+             VARIABLE : X[GX=XFINE] + Y[GY=YFINE]
+             LONGITUDE: 155.1W(204.9) to 155.1W(204.9)
+             LATITUDE : 19.7N to 19.7N
+             GEOMETRY: XY 
+             SIZE:  5  6  
+             FORTRAN FORMAT: (f9.5)
+             MISSING VALUES FLAG: -1.0000000E+34
+X COORDINATES: degrees_east
+204.89923
+204.89975
+204.90025
+204.90076
+204.90126
+Y COORDINATES: degrees_north
+ 19.70020
+ 19.70071
+ 19.70122
+ 19.70173
+ 19.70223
+ 19.70274
+DATA:
+224.59943
+224.59995
+224.60045
+224.60096
+224.60146
+224.59994
+224.60046
+224.60096
+224.60147
+224.60197
+224.60045
+224.60097
+224.60147
+224.60198
+224.60248
+224.60096
+224.60148
+224.60198
+224.60249
+224.60299
+224.60146
+224.60198
+224.60248
+224.60299
+224.60349
+224.60197
+224.60249
+224.60299
+224.60350
+224.60400
+sp rm -f fine.dat
+ 
+cancel list/precision
+ 
+! Range includes just one coordinate point on the axis
+! Plot using /HLIM
+GO bn_reset
+cancel mode verify
+GO err570_hlimit_onepoint
+!err570_hlimit_onepoint.jnl
+! 15-Oct-2004  ACM
+ 
+! range includes just one coordinate point on the axis
+! Fix so we can plot this with /HLIMIT (previously gave
+! misleading error)
+! If no /HLIMIT, should issue an error
+ 
+set mode ignore_error
+ 
+use coads_vwnd
+set reg/x=180:200/y=35:45/t=1-jan-1985:1-feb-1985
+plot/sym/siz=0.3/hlim="1-jan-1985 18": "1-feb-1985 20" 0*t[gt=vwnd]
+ 
+plot/sym/siz=0.3 0*t[gt=vwnd]
+set mode/last ignore_error
+ 
+! Regridding between Gregorian and Julian time axes with @NRST
+! caused a segfault.
+GO bn_reset
+cancel mode verify
+GO err570_index111.jnl
+! err570_index111.jnl
+! 3-nov-04 ACM
+! Fixes for bug 1049.
+!
+! See ~ansley/ans_ferret/users/wittenberg/bug1049.jnl
+! This was due to a bug in the fix for bug 562. In
+! that fix we allowed subscripts of -111 when there
+! was a range of subscripts including that value.
+! The fix didnt correctly distinguish between that
+! case and -111 used as the missing-integer flag.
+ 
+ 
+DEF AXIS/T/UNITs=days/T0="01-JAN-1979 00:00:00"/CAL=gregorian \
+  tgreg = {6590.5,6620.0,6649.5,6680.0,6710.5,6741.0,6771.5,\
+  6802.5,6833.0,6863.5,6894.0,6924.5,6955.5,6985.0,7014.5,\
+  7045.0,7075.5,7106.00}
+DEF AXIS/T/UNITS=hours/t0="01-JAN-1900 00:00:00"/CAL=julian \
+  tjul = { 850692,851400,852108,852840,853572,854304,855036,\
+  855780,856512,857244,857976,858708}
+ 
+LET s1 = T[GT=tgreg]
+LET s2 = T[GT=tjul]
+ 
+LIST/T=1-jan-1997:1-jan-1998 s2[GT=s1 at NRST]
+             VARIABLE : T[GT=TJUL]
+                        regrid: on T at NRST
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1997 12 /  1:  850692.
+ 15-FEB-1997 00 /  2:  851400.
+ 16-MAR-1997 12 /  3:  852108.
+ 16-APR-1997 00 /  4:  852840.
+ 16-MAY-1997 12 /  5:  853572.
+ 16-JUN-1997 00 /  6:  854304.
+ 16-JUL-1997 12 /  7:  855036.
+ 16-AUG-1997 12 /  8:  855780.
+ 16-SEP-1997 00 /  9:  856512.
+ 16-OCT-1997 12 / 10:  857244.
+ 16-NOV-1997 00 / 11:  857976.
+ 16-DEC-1997 12 / 12:  858708.
+ 
+ 
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+GO bn_reset
+cancel mode verify
+GO err570_sh_dat_nan.jnl
+! err570_sh_dat_nan.jnl
+! 4-Nov-2004 acm
+ 
+! See bug 1070.
+! Data has missing value flag of NaN. Under linux, SHOW DATA/FULL
+! crashed on trying to format value for the output buffer.
+ 
+use nan_missing.nc
+show data/full
+     currently SET data sets:
+    1> ./nan_missing.nc  (default)
+     NCEP Ocean Analysis
+ name     title                             I         J         K         L         M         N
+ TEMP     temperature                      1:1       1:1       1:19      1:1       ...       ...
+             degree_Celsius on grid GGH1 with 1.E-34 & NaN for missing data
+             X=139.8E:140.8E  Y=0.5S:0.5N  Z=0:375  
+ 
+  time range: 15-FEB-1980 12:00
+ 
+ 
+ 
+! Time reqest out of range on NOLEAP axes.
+GO bn_reset
+cancel mode verify
+GO err570_time_range.jnl
+! err570_time_range.jnl  bug1080
+! time request out of range with calendar axis and RETURN=
+ 
+def axis/t="16-Jan-1861 12:00:00":"16-mar-1881 12:00:00":1/units=months/calendar=noleap tax
+let a = t[gt=tax]
+save/clob/file=aa.nc a
+save/clob/file=cc.nc a
+use aa
+use cc
+ 
+define grid/like=a[d=1] var1_grid_
+let var1_ = a[d=1,t="16-Jan-1861 12:00:00"]
+let var2_ = a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"]
+set var/units="`a[d=1,t="16-Jan-1861 12:00:00"],return=units`" var1_
+ !-> set var/units=" " var1_
+set var/units="`a[gx=var1_grid_,gy=var1_grid_,d=2,t="16-Jan-1861 12:00:00"],return=units`" var2_
+ !-> set var/units=" " var2_
+!  error message on this last command; noleap calendar not treated correctly.
+ 
+! Fix for bug 1066; error doing 2-D polygon overlaying
+! a non-standard calendar axis
+GO bn_reset
+cancel mode verify
+GO err570_poly_over_julian.jnl
+! err570_poly_over_julian.jnl
+! ACM 11/12/04
+ 
+! Bug 1066
+! Overlaying data on a Julian time axis got an error:
+!          Differing calendar axes:
+!          first variable is on JULIAN axis
+!          overlaid variable is on GREGORIAN axis
+ 
+use coads_climatology
+set axis/CAL=JULIAN time
+plot/x=140w/y=0 sst
+plot/ov/vs/line=3 {400,900,900,400}, {25.5,25.5,26.5,25.5}
+poly/ov/pal=green {400,900,900,400}, {25.5,25.5,26.5,25.5}
+ 
+ 
+! Fix for bug 1077; return ERROR rather than NOTE when
+! exiting from a script where query/ignore or other coached
+! string substitution returns the user-given error message
+GO bn_reset
+cancel mode verify
+GO err570_coaching hello
+! err570_coaching.jnl
+! ACM 11/12/04  Bug 1077
+ 
+! test this with GO err570_coaching hello
+ 
+! We are changing NOTE to ERROR in coached_str_sub
+! when the script gives the user-defined error text.
+! We still may have an ERROR and then NOTE to explain
+! the list of valid arguments.
+ 
+set mode ignore_errors
+ 
+! incorrect argument with query/ignore
+query/ignore $1%q|a|b|c|d|<First argument is a letter of the alphabet%
+query/ignore $2%|a|b|c|d|%
+ 
+! These example message commands taken from bn_dollar
+ 
+! doesn't match on "hello"; the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $1"|xxxxx|goodbye<my error message"
+message/cont $1"greetings|xxxxx|goodbye"
+ 
+! no argument supplied;  the first line below now
+! uses ERROR instead of NOTE when writing my error message
+ 
+message/cont $3"|hello|goodbye<my error message"
+message/cont $3">greetings|hello|goodbye"
+ 
+! Here are some lines from bn_symbols; the first and third now use ERROR instead of NOTE
+ 
+message/continue ($test2"<my error message")
+message/continue ($test2"|hello|bye|")
+message/continue ($test2"|hello|bye|<my error message")    ! silent error
+message/continue ($t2"|solong>really hello|bye|")
+ 
+set mode/last ignore_errors
+ 
+! Fix for bug 485: say ($0) in a script should return the
+! name of the script
+GO bn_reset
+cancel mode verify
+GO err570_dollar_zero.jnl
+! err570_dollar_zero.jnl
+! (bug 485) Got a command syntax error;
+! $0 in script should return the script name
+ 
+SET MODE ignore_error
+SAY ($0)
+ !-> MESSAGE/CONTINUE err570_dollar_zero.jnl
+err570_dollar_zero.jnl
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 596; list/i=0:300:0 var crashed Ferret
+GO bn_reset
+cancel mode verify
+GO err570_illegal_stride.jnl
+! err570_illegal_stride.jnl
+! (bug 596) list/i=0:300:0 var crashed Ferret
+ 
+SET MODE ignore_error
+use coads_climatology
+list/l=1/j=40/i=0:300:0 sst
+ 
+SET MODE/LAST ignore_error
+ 
+! Fix for bug 1085; /THICK without color specifier caused all lines to revert to black
+GO bn_reset
+cancel mode verify
+GO err570_thick_colors.jnl
+! err570_thick_colors.jnl  bug1085
+! /THICK without color specifier causes all lines to revert to black
+ 
+PLOT/THICK/I=1:100 cos(i/20), sin(i/30)
+PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20)
+PLOT/OVER/THICK=1/I=1:100 cos(i/10), sin(i/50), cos(i/40)*sin(i/10)
+ 
+! time series
+USE gtsa056_2
+PLOT/THICK/X=180/Y=0/K=1 temp
+PLOT/OVER/THICK/X=180/Y=-1/K=1 temp
+PLOT/OVER/THICK/X=180/Y=1/K=1 temp
+ 
+! plot/vs
+PLOT/VS/LINE/THICK/I=1:314 i*cos(i/20), i*sin(i/20)
+PLOT/OVER/VS/LINE/THICK/I=1:314 i*cos(i/18), i*sin(i/18)
+PLOT/OVER/VS/LINE/THICK=3/I=1:314 i*cos(i/16), i*sin(i/16)
+PLOT/OVER/VS/LINE/THICK=1/I=1:314 i*cos(i/14), i*sin(i/14)
+ 
+ 
+! Fix for bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+GO bn_reset
+cancel mode verify
+GO err570_digit_filename.jnl
+! err570_digit_filename.jnl
+! Bug 1102: under linux, var[d=filename] fails if filename
+! starts with a digit.
+ 
+let a = x[i=1:10]
+save/clobber/file=10a.nc a
+can var/all
+use 10a
+list a[x=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+ 
+use coads_climatology
+list a[x=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=1]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+list a[i=1:4,d=10a]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+list a[i=1:4,d=10a.nc]
+             VARIABLE : X[I=1:10]
+             FILENAME : 10a.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 4   / 4:  4.000
+ 
+! Fix for bug 1098: DODS URL label was cut off
+GO bn_reset
+cancel mode verify
+GO err570_dods_url_label.jnl
+! err570_dods_url_label.jnl
+!
+! Bug 1098. Look for the label with the URL: it should include
+! everything up to the last slash.
+! acm 11/04
+ 
+ 
+!! Change to another dataset, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/bn_strides.cdf"
+!!sh data
+!!plot/i=1/j=1 temp
+!!ppl list labels
+ 
+!!set data "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/COADS_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 airt
+!!ppl list labels
+ 
+!!set data "http://apdrc.soest.hawaii.edu/thredds/dodsC/woa/1994/annual"
+!!sh data
+!!plot/x=180/y=0 otemp
+!!ppl list labels
+ 
+! Change to the OPeNDAP test server.
+!!use "http://test.opendap.org/opendap/data/nc/coads_climatology.nc"
+!!sh data
+!!plot/x=180/y=0 sst
+!!ppl list labels
+ 
+!! Change to another server, this one not working 3/2012
+!! use "http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods"
+!!sh data
+!!plot/x=180/y=0/k=1 temp
+!!ppl list labels
+ 
+ 
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc"
+sh data
+     currently SET data sets:
+    1> http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/coads_climatology.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12      ...       ...
+ WSPD     WIND SPEED                       1:180     1:90      ...       1:12      ...       ...
+ UWND     ZONAL WIND                       1:180     1:90      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12      ...       ...
+ SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12      ...       ...
+ 
+plot/x=180/y=0 sst
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+                                                                                
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.550E+00 0.120    0  SYSTEM  @ASLONGITUDE : 179E
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.350E+00 0.120    0  SYSTEM  @ASLATITUDE : 1S
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  7.750E+00  6.290E+00 0.090    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  3.880E+00  6.080E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5  7.750E+00  6.500E+00 0.071    0  SYSTEM  @ASOPeNDAP URL: http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ 
+ 
+! Fix for bug 906: auto-formatting of labels on color keys loses precision
+GO bn_reset
+cancel mode verify
+GO err570_keylabels.jnl
+! err570_keylabels.jnl
+! 11/2004
+ 
+! (bug 906)
+! auto-formatting of labels on color keys loses precision
+! key labels are 370, 371, 371, 372, 372, ...
+ 
+let a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1]
+shade/lev=(370,382,0.5) a
+ 
+! Fix for bug 1130: error and crash on some systems polygon command
+! where polygon arguments have latitude or longitude units
+GO bn_reset
+cancel mode verify
+GO err570_poly_lonlat_axis.jnl
+! err570_poly_lonlat_axis.jnl
+! 12/14/04
+!
+! The polygon command gave error messages and under version 5.7
+!    Symbol not found
+!    XFOR (I7,'LONE')
+! and similarly for the y axis.
+!
+! RedHat 7 binary, under Debian 3.0 Linux the poly command crashes Ferret.
+ 
+LET XTRIANGLE = YSEQUENCE({-1,0,1})
+LET YTRIANGLE = YSEQUENCE({-1,1,-1})
+LET XPTS = 120+30*RANDU(I[i=1:10])
+LET YPTS = 30*RANDU(1+I[i=1:10])
+LET/title="longitude"/units="degrees_east" XT = XTRIANGLE+XPTS
+LET/title="latitude"/units="degrees_north" YT = YTRIANGLE+YPTS
+POLYGON XT, YT, I[I=1:10]
+ 
+! Add the same fix to plot_set_up.F for PLOT/VS commands
+ 
+PLOT/VS XT, YT
+*** Running test: bn_inf_levels.jnl
+! Run FERRET/fer/ferretdods_gui
+! test open upper and lower levels (-INF) (INF)
+ 
+can mode logo
+set win/siz=0.4
+ 
+use coads_climatology
+ 
+shade/set/lev=(-inf),(4,28,2)(inf) sst[l=1]
+ppl shakey,1,0,-0.1,,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,,,,,,7.225
+ppl shade
+ 
+can view
+ 
+! many levels: triangles forced to be 5% of total key length
+! (add SHOW SYM LEV* to catch behavior of bug 1519 which
+!  did not plot color in the entire area for FILL plots.)
+ 
+set view left
+fill/x=20e:150e/lev=(-inf),(4,28,0.5)(inf) sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+set view right
+shade/lev=(-inf),(4,28,0.5)(inf)/key=cont sst[l=1]
+sh sym lev*
+LEV_TEXT = "(-INF),(4,28,0.5)(INF)"
+LEV_MIN = "-2.8"
+LEV_MAX = "32"
+LEV_NUM = "50"
+LEV_DEL = "6.8"
+ 
+ 
+can view
+ 
+! horizontal.
+ 
+set view upper
+fill/x=20e:150e/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90 sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,2.975
+ppl fill
+ 
+set view lower
+shade/set/lev=(-inf),(4,28,0.5)(inf)/y=0:90/key=cont sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,2.975
+ppl shade
+ 
+! Some one-sided examples
+can view
+ 
+fill/lev=(-2,28,1)(inf) sst[l=1]
+ 
+shade/set/lev=(-inf),(4,30,0.5)/key=cont/pal=rainbow sst[l=1]
+ppl shakey,1,0,-0.1,10,,,,,`($ppl$ylen)+($ppl$yorg)+0.1`
+ !-> ppl shakey,1,0,-0.1,10,,,,,7.225
+ppl shade
+ 
+let filler = missing(sst[l=1],-999)
+shade/over/pal=black/nolab/lev=(-999,-999,-999) filler
+ 
+can view
+ 
+! polygon command
+ 
+let xsqr = YSEQUENCE({0,.1,.1,0})
+let ysqr = YSEQUENCE({0,0,.1,.1})
+let ypts = x/10
+let xpts = cos(x/10)
+ 
+polygon/trans/i=1:100/nolable/lev=(-inf)(200,900,50)(inf) xpts+xsqr, ypts+ysqr, x*x/10
+ 
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+*** Running test: bn_regulart.jnl
+! bn_regulart.jnl
+! 5/12/2005 ACM
+ 
+! Test of the USE/REGULART qualifier
+! The axis is irregular in the first instance, and regular in the second
+ 
+use coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 i   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19723
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: 01-JAN-1946 00:00 to 01-JUL-1946 00:00
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                         T   TBOX
+16-JAN-1946 12 / 1:  89865.  31.00
+15-FEB-1946 00 / 2:  89894.  28.00
+16-MAR-1946 12 / 3:  89924.  31.00
+16-APR-1946 00 / 4:  89954.  30.00
+16-MAY-1946 12 / 5:  89985.  31.00
+16-JUN-1946 00 / 6:  90015.  30.00
+can data/all
+ 
+use/regulart coads_vwnd
+show axis tcoads
+ name       axis              # pts   start                end
+ TCOADS    TIME               648 r   16-JAN-1946 12:00    16-DEC-1999 12:00
+T0 = 01-JAN-1700 00:00:00
+   Axis span (to cell edges) = 19722.44
+list/l=1:6 t[gt=tcoads], tbox[gt=tcoads]
+             TIME: 01-JAN-1946 06:46 to 02-JUL-1946 21:31
+ Column  1: T is T (axis TCOADS)
+ Column  2: TBOX is TBOX (axis TCOADS)
+                      T   TBOX
+16-JAN-1946 / 1:  89865.  30.44
+15-FEB-1946 / 2:  89895.  30.44
+18-MAR-1946 / 3:  89925.  30.44
+17-APR-1946 / 4:  89956.  30.44
+18-MAY-1946 / 5:  89986.  30.44
+17-JUN-1946 / 6:  90017.  30.44
+ 
+*** Running test: bn_labwid.jnl
+! LABWID returns the length in Denbo inches of the
+! string.  For multi-line strings, returns length of
+! the longest line.
+ 
+LIST LABWID("aaaaabbbbb", .15)
+             VARIABLE : LABWID("aaaaabbbbb", .15)
+             X        : 1
+          1.357
+LIST LABWID("aaaaabbbbb", .10)
+             VARIABLE : LABWID("aaaaabbbbb", .10)
+             X        : 1
+          0.9048
+LIST LABWID("aaaaabbbbb<NL>ee", .15)
+             VARIABLE : LABWID("aaaaabbbbb<NL>ee", .15)
+             X        : 1
+          1.357
+LIST LABWID("ee<NL>aaaaabbbbb", .15)
+             VARIABLE : LABWID("ee<NL>aaaaabbbbb", .15)
+             X        : 1
+          1.357
+ 
+ 
+LIST LABWID("@IISTRING", .15)
+             VARIABLE : LABWID("@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@SSSTRING", .15)
+             VARIABLE : LABWID("@SSSTRING", .15)
+             X        : 1
+          0.9143
+LIST LABWID("@SSSTRING<NL>@IISTRING", .15)
+             VARIABLE : LABWID("@SSSTRING<NL>@IISTRING", .15)
+             X        : 1
+          0.9808
+LIST LABWID("@IISTRING<NL>@SSSTRING", .15)
+             VARIABLE : LABWID("@IISTRING<NL>@SSSTRING", .15)
+             X        : 1
+          0.9808
+ 
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+label/nouser 0,3,-1,0,.15,"@P2 at IILine1<NL>@IIA LONGER LINE"
+let wid = labwid("@P2 at IILine1<NL>@IIA LONGER LINE",.15)
+label/nouser `wid`, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+ !-> PPL %LABEL/nouser 2.019230842590332, 3, -1, 0, .15,  "@P4 at IIMulti-line<NL>Length is longest of ALL lines<NL>Line three"
+*** Running test: bn_redefine_taxis_mc.jnl
+! bn_redefine_taxis_mc.jnl
+! ACM 15-Apr-2005
+ 
+! Redefine the time axis of a multi-file data set.
+! Lets us fix a time axis, which may in fact be irregular, but
+! the multi-file reading always makes into a regularly-spaced axis.
+ 
+set data coads_clim.des
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+ 
+def sym taxisname  `sst,return=taxis`
+ !-> def sym taxisname  TIME1
+ 
+def axis/t=1-mar-1990:6-mar-1990:1/units=days ($taxisname)
+ !-> def axis/t=1-mar-1990:6-mar-1990:1/units=days TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                      179E   
+                       80
+ 01-MAR-1990 00 / 1:  28.20
+ 02-MAR-1990 00 / 2:  28.36
+ 03-MAR-1990 00 / 3:  28.35
+ 04-MAR-1990 00 / 4:  28.22
+ 05-MAR-1990 00 / 5:  28.49
+ 06-MAR-1990 00 / 6:  28.32
+ 
+def axis/t=1:6:1 ($taxisname)
+ !-> def axis/t=1:6:1 TIME1
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim.des
+             SUBSET   : 6 points (T)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+           179E   
+            80
+ 1   / 1:  28.20
+ 2   / 2:  28.36
+ 3   / 3:  28.35
+ 4   / 4:  28.22
+ 5   / 5:  28.49
+ 6   / 6:  28.32
+*** Running test: bn_illegal_axisname.jnl
+! Some OPenDAP HDF files have illegal axis names, e.g. with a dot in the name.
+! This is a test of using such names, in a redefinition of the axes of the data.
+! The file has a variable with axis names COADSX.ILLEGAL, COADSY.ILLEGAL. The axes contain
+! just indices.  The file also has variables NEW.LONGITUDES and NEW.LATITUDES which contain
+! geographic coordinates that we want to substitute for the axes.
+ 
+use illeg_axname.nc
+sh data
+     currently SET data sets:
+    1> ./illeg_axname.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:21      1:16      ...       ...       ...       ...
+ NEW.LONGITUDES
+          X[GX=SST]                        1:21      ...       ...       ...       ...       ...
+ NEW.LATITUDES
+          Y[GY=SST]                        ...       1:16      ...       ...       ...       ...
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis COADSX.ILLEGAL
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (X)
+ 60   / 1:  60.00
+ 61   / 2:  61.00
+ 62   / 3:  62.00
+ 63   / 4:  63.00
+ 64   / 5:  64.00
+set view upper; shade sst
+ 
+define axis/x/modulo/units=degrees_east 'coadsx.illegal' = XSEQUENCE('NEW.LONGITUDES')
+define axis/y/units=degrees_north 'coadsy.illegal' = XSEQUENCE('NEW.LATITUDES')
+ 
+list/i=1:5 x[gx=sst]
+             VARIABLE : X
+                        axis 'COADSX.ILLEGAL'
+             FILENAME : illeg_axname.nc
+             SUBSET   : 5 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 29E   / 5:  29.00
+set view lower; shade sst
+sh grid sst
+    GRID GEX1
+ name       axis              # pts   start                end
+ 'COADSX.ILLEGAL' LONGITUDE    21mr   21E                  61E
+ 'COADSY.ILLEGAL' LATITUDE     16 r   35N                  65N
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_exit_script.jnl
+! bn_exit_script.jnl
+! 5/2005 ACM
+! tests of EXIT/SCRIPT command, in combination with IF and REPEAT
+! 3/2007 add a check for exit/script within a loop (fixes for bug 1304)
+ 
+! Simple EXIT/SCRIPT command in a script
+go exit_script_1
+! test exit/script
+ 
+exit/script
+ 
+! EXIT/SCRIPT from an IF clause
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT inside REPEAT loop
+go exit_script_loop
+! test exit/script inside REPEAT loop
+ 
+repeat/i=3:5 (list/nohead i; exit/script)
+!-> REPEAT: I=3
+          3.000
+ 
+! EXIT/SCRIPT with IF clause and REPEAT loop
+go exit_script_if_loop
+! test exit/script with IF clause and REPEAT loop
+ 
+repeat/i=3:10:2 (list/nohead i; if `i ge 6` then exit/script)
+!-> REPEAT: I=3
+          3.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=5
+          5.000
+ !-> if 0 then exit/script
+!-> REPEAT: I=7
+          7.000
+ !-> if 1 then exit/script
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT two levels down
+go exit_script_twolev
+! test exit/script called another level down
+ 
+go exit_script_if
+! test exit/script from an IF clause
+ 
+let a = 1
+if `a lt 10` then exit/script
+ !-> if 1 then exit/script
+ 
+say "returned from exit_script_if"
+returned from exit_script_if
+say "here is the next line"
+here is the next line
+ 
+! EXIT/SCRIPT from a script within a loop.
+! Should see output from 3 repeats of the loop but not
+! the SAY SCRIPT at each iteration of the repeat loop
+ 
+cancel mode verify
+1
+loop
+2
+loop
+3
+loop
+*** Running test: bn_exit_cycle.jnl
+! bn_exit_cycle.jnl
+! 5/2005 ACM
+! EXIT/CYCLE skips remaining commands in this repetition of a loop
+ 
+can mode ver
+32
+64
+128
+256
+512
+1024
+ 
+ test exit/loop combined with exit/cycle
+32
+64
+128
+256
+say 512 if bigger than 500
+512
+say 1024 if bigger than 500
+1024
+say 2048 if bigger than 500
+say 4096 if bigger than 500
+say 8192 if bigger than 500
+say 16384 if bigger than 500
+ 
+loop finished 16384 gt 10000
+*** Running test: bn_curv_mod.jnl
+! bn_curv_mod
+! Test of fill/mod and contour/mod
+! 5/24/2005 Ferret v5.81
+ 
+! The dataset is a portion of example tripolar grid.
+ 
+! use "/home/ja3/hankin/user/gfdl/tri_polar/mom4_grid_example.nc"
+! save/clobber/file=tripolar_subset.nc geolon_vert_t[j=150:174], geolat_vert_t[j=150:174], ht[j=150:173]
+ 
+! Note that this coord data is actually cell edges and so
+! isnt really what one would use for FILL and CONTOUR commands --
+ 
+use tripolar_subset.nc     ! Longitude range is -280 to 80
+ 
+fill/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+contour/over/mod/hlim=-180:180 ht, geolon_vert_t[i=1:180,j=1:24], geolat_vert_t[i=1:180,j=1:24]
+ 
+*** Running test: bn_shade_keycont.jnl
+! Continuous shade key
+! test setting it and whether default is restored on next command.
+! also whether behavior consistent when we call shakey
+ 
+use ocean_atlas_temp
+set region/x=130:290/y=-45:45
+ 
+set view ul
+shade/title="default shade key" temp[l=1]
+ 
+set view ur
+shade/key=cont/title="shade/key=cont" temp[l=1]
+ 
+set view ll
+shade/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.475
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.735
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.135
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.475,,4.735,5.135
+go unlabel 4
+go unlabel 5
+ppl shade
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.48     6.15     4.74     5.14
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.375
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.05
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.375
+shade/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.375,5.05,1.375
+ppl shade
+ 
+can view
+ 
+set view ul
+fill/title="default fill key" temp[l=1]
+ 
+set view ur
+fill/key=cont/title="fill/key=cont" temp[l=1]
+ 
+set view ll
+fill/key=cont/title="cont key with shakey call"/set temp[l=1]
+ 
+let/quiet x1 = `($ppl$xorg)+0.1`
+ !-> DEFINE VARIABLE/quiet x1 = 1.475
+let/quiet y1 = `($ppl$yorg)+($ppl$ylen)+0.1`
+ !-> DEFINE VARIABLE/quiet y1 = 4.735
+let/quiet y2 = `($ppl$yorg)+($ppl$ylen)+0.5`
+ !-> DEFINE VARIABLE/quiet y2 = 5.135
+ 
+ppl shakey ,0,-.12,2,,,`x1`,,`y1`,`y2`
+ !-> ppl shakey ,0,-.12,2,,,1.475,,4.735,5.135
+go unlabel 4
+go unlabel 5
+ppl fill
+ppl list shakey
+
+         DO KEY  ORIENT  LAB SIZE  LAB INC  LAB DIG  LAB LEN
+              1       0     -0.12        2        3        9
+
+
+         X LO     X HI     Y LO     Y HI
+         1.48     6.15     4.74     5.14
+ 
+set view lr
+let/quiet x1 = `($ppl$xorg)+1`
+ !-> DEFINE VARIABLE/quiet x1 = 2.375
+let/quiet x2 = `($ppl$xorg)+($ppl$xlen)-1`
+ !-> DEFINE VARIABLE/quiet x2 = 5.05
+let/quiet y1 = `($ppl$yorg)`
+ !-> DEFINE VARIABLE/quiet y1 = 1.375
+fill/title="with shakey, restore default key style"/set temp[l=1]
+ppl shakey ,0,-.12,3,,,`x1`,`x2`,`y1`
+ !-> ppl shakey ,0,-.12,3,,,2.375,5.05,1.375
+ppl fill
+*** Running test: bn581_bug_fixes.jnl
+! bn581_bug_fixes.jnl
+! test various fixes that went into version 5.81
+! 2/05 *acm*
+!
+ 
+! Bug 1160 short axis with irreg bounds seen as regular.
+GO bn_reset
+cancel mode verify
+GO err580_irreg_bounds.jnl
+! err580_irreg_bounds.jnl
+! Define a short irregular time axis with some time_bounds,
+! and then read it into Ferret.  When the file is read in,
+! the bounds seem to be ignored; axis is seen as regular.
+! Bug 1160 reported by Andrew.
+ 
+yes? def ax/t/edge time = {0,1,3}
+yes? let a = t[gt=time]
+yes? show grid/t a
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+yes? save/clob/file=a.nc a
+sp echo "err580_irreg_bounds.jnl --- " >> all_ncdump.out
+yes? sp ncdump a.nc >> all_ncdump.out
+ 
+can data/all
+can var/all
+can mem
+ 
+!  T axis was marked as regular
+yes? use a.nc
+yes? show grid/t a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME1     T                    2 i   0.5                  2
+ normal    E
+ normal    F
+ 
+       L     T                   TBOX      TBOXLO
+       1>  0.5                   1          0
+       2>  2                     2          1
+ 
+! Bug 1179 Cartesian_axis and positive="down" resulted in depth axis not being recognized
+GO bn_reset
+cancel mode verify
+GO err580_cartesian_depth.jnl
+ ! err580_cartesian_depth.jnl
+! cartesian_axis attribute
+! combined with positive="down"
+! caused the axis not to be recognized as a depth axis
+! should be i- on the axis ZT
+ 
+use a_cartesian_bug1179.nc
+sh grid temp
+    GRID GHU1
+ name       axis              # pts   start                end
+ GRID_X_T  LONGITUDE            1 r   79E                  79E
+ GRID_Y_T  LATITUDE             1 r   0.25S                0.25S
+ ZT        DEPTH (m)           10 i-  22.5                 158
+ TIME1     TIME                 1mr   15-FEB-1900 03:00    15-FEB-1900 03:00
+ normal    E
+ normal    F
+ 
+! Bug 1181 Titles were truncated at 80 characters
+GO bn_reset
+cancel mode verify
+GO err580_long_title.jnl
+ 
+ ! err580_long_title.jnl
+ ! Titles were truncated at 80 characters
+ 
+save/clobber/title="a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789"/file=longtitle.nc x[x=1:10]
+ 
+sp echo "err580_long_title.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+ 
+! Bug 1180 Allow "use filename.des"
+GO bn_reset
+cancel mode verify
+GO err580_use_des.jnl
+! err580_use_des.jnl
+! Allow "use filename.des"   (previously gave an "is this a CDF file?" error)
+ 
+use vary_scale.des
+sh data
+     currently SET data sets:
+    1> ./vary_scale.des  (default)
+ name     title                             I         J         K         L         M         N
+ TT       1 + 0*T[GT=DAYT]                 ...       ...       ...       1:20      ...       ...
+ 
+ 
+! fix for bug 1181: dataset title was limited to 80 characters.
+GO bn_reset
+cancel mode verify
+GO err580_long_dsettitle.jnl
+! err580_long_dsettitle
+! fix for bug 1181
+! previously dataset title was limited to 80 characters.
+ 
+! File has a dataset title 1000 characters long.
+use longtitle1000.nc
+say `a,return=dsettitle`
+ !-> MESSAGE/CONTINUE 
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+! Set a dataset title over 80 characters.
+save/title="a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short.  "/clobber/file=longtitle.nc a
+ 
+sp echo "err580_long_dsettitle.jnl --- " >> all_ncdump.out
+sp ncdump longtitle.nc >> all_ncdump.out
+ 
+! fix for bug 1200:crash due to the long veckey format spec.
+GO bn_reset
+cancel mode verify
+GO err580_long_veckey.jnl
+! err580_long_veckey.jnl
+! Bug 1200 The following caused a crash due to the long veckey format spec.
+ 
+vector/i=1:50/j=1:50/set  j-20+(i-i),i-20+(j-j)
+ 
+ppl veckey,1,-3,,"(f4.0," x10^-^2 N m^-^2")"
+ppl vector
+ 
+! restore the default setting
+ppl veckey,0,0,,"(1PG10.3)"
+ 
+! fix for bug 1201: mistranslation of time region.
+GO bn_reset
+cancel mode verify
+GO err580_cal360_region.jnl
+! err580_cal360_region.jnl
+! Wrong output region: the set region mistakenly tranlated
+ 
+def axis/t=15-apr-1990:15-apr-2000:15/units=days/t0=15-apr-1990/calendar=d360 tax
+let a = t[gt=tax]
+load a
+set reg/t=15-apr-1990:15-apr-1991
+sho reg
+default region:
+        X/I is unspecified
+        Y/J is unspecified
+        Z/K is unspecified
+        T=15-APR-1990 00:00:00:15-APR-1991 00:00:0
+        E/M is unspecified
+        F/N is unspecified
+ 
+ 
+! fix for bug 1203: crash if time range left off.
+GO bn_reset
+cancel mode verify
+GO err580_def_tax_norange.jnl
+! err580_def_t_norange.jnl
+! bug 1203. without the T range, these statements cause a STOP.
+ 
+SET MODE ignore
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/t myt
+ 
+DEFINE AXIS/T0="1-JAN-1861"/UNITS=months/T/CALENDAR=noleap myt
+ 
+! fix for bug 1207: closest distance and closest index transformations.
+GO bn_reset
+cancel mode verify
+GO err580_cdb.jnl
+! err580_cdb.jnl
+! bug 1207
+ 
+! Bug in closest distance and closest index transformations
+! Code needs range below for CDB, CIB and above for CDA, CIA.
+! Instead it asked for a range above AND below the specified index.
+! So result is missing when it should not be.
+ 
+def axis/x=1:20:1 aax
+let var = if mod(i,5) eq 1 then x[gx=aax]
+ 
+list var[i=15 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 5 pts)
+          4.000
+list var[i=14 at cdb:5]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 14 (closest dist below by 5 pts)
+          3.000
+ 
+! These returned MISSING data with the bug, should not be missing.
+ 
+list var[i=15 at cdb:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest dist below by 10 pts)
+          4.000
+list var[i=15 at cib:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 15 (closest index below by 10 pts)
+          4.000
+list var[i=5 at cda:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest dist above by 10 pts)
+          1.000
+list var[i=5 at cia:10]
+             VARIABLE : IF MOD(I,5) EQ 1 THEN X[GX=AAX]
+             X        : 5 (closest index above by 10 pts)
+          1.000
+ 
+! fix for bug 1214: crash on repeating a SET VIEW when viewport defined with /AXES
+GO bn_reset
+cancel mode verify
+GO err580_def_view_axes.jnl
+! err580_def_view_axes.jnl
+! BUG 1214
+! crashed with seg fault on the second SET VIEW v1
+ 
+! Does not crash if we define viewports without the /AXES
+! Does not crash if we CAN MODE META and SET MODE META
+! between the two SET VIEW v1
+! Does not crash if we skip the SET WINDOW/CLEAR
+ 
+! Does not crash with Ferret v5.50
+ 
+define view/x=0.2:0.4/y=.2:.4/text=0.75/axes v1
+ 
+set window/clear
+set mode metafile viewaxes.plt
+ 
+set view v1
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+ 
+set window/clear
+ 
+can mode meta
+set mode meta
+ 
+set view v1
+shade/i=1:12/j=1:12 i+j
+ 
+can mode metafile
+sp rm -f viewaxes.plt*
+ 
+ 
+! fix for bug 1205: symbol LEV_DEL wrong when single level specified
+GO bn_reset
+cancel mode verify
+GO err580_lev_del.jnl
+! err580_lev_del.jnl
+! demonstrates bug 1205; precision of LEV_DEL when single level specified.
+ 
+shade/lev=.4d/x=1:10/y=1:10 cos(i/10)*9*sin(j/5)
+sh sym lev_del
+LEV_DEL = "0.4"
+show sym lev*
+LEV_TEXT = ".4D"
+LEV_MIN = "0.8"
+LEV_MAX = "9.2"
+LEV_NUM = "21"
+LEV_DEL = "0.4"
+ 
+use coads_climatology
+shade/l=1/lev=1.2d sst; sho sym lev_del
+LEV_DEL = "1.2"
+ 
+show sym lev*
+LEV_TEXT = "1.2D"
+LEV_MIN = "-2.4"
+LEV_MAX = "31.2"
+LEV_NUM = "28"
+LEV_DEL = "1.2"
+ 
+! Fix for bug 1174: strfloat_c("nonsense") gave result of 0 rather than missing.
+GO bn_reset
+cancel mode verify
+GO err580_strfloat_errors.jnl
+! err580_strfloat_errors.jnl
+! Previously a nonsense input gave a result of 0.
+! See bug 1174.
+ 
+let b = {"3.34", "0", "nonsense", "0.0", "153q51", "9..32", "7.e03", "3.2e-2"}
+list/prec=6 strfloat(b)
+             VARIABLE : STRFLOAT(B)
+             SUBSET   : 8 points (X)
+ 1   / 1:     3.34
+ 2   / 2:     0.00
+ 3   / 3:     ....
+ 4   / 4:     0.00
+ 5   / 5:   153.00
+ 6   / 6:     9.00
+ 7   / 7:  7000.00
+ 8   / 8:     0.03
+ 
+! Fixes for bugs 1249, 1250: uppercase not recognized for qualifier argument
+GO bn_reset
+cancel mode verify
+GO err580_arg_case.jnl
+! err580_arg_case.jnl
+! 5/2005
+! bugs 1249, 1250
+!
+! key=CONTINUOUS and step=CONNECTED
+! were not recognized if the value was in uppercase
+ 
+shade/key=cont/i=1:10/j=1:4 i-j
+shade/key=CONT/i=1:10/j=1:4 i-j
+ 
+plot/step=conn/i=1:10 sin(i)
+plot/step=CONN/i=1:10 sin(i)
+ 
+ 
+ 
+! Fixes for bugs 1019: kludge for CDC time axes made time origin incorrect on outputs
+GO bn_reset
+cancel mode verify
+GO err580_cdc_timeaxis.jnl
+! err580_cdc_timeaxis.jnl
+! 6/3/05
+! See comments under bug 1019.
+!
+! CDC time axes have the convention that if the start date is 1-jan-0001:00:00 then
+! a shift of 2 days is made in year 1590.  Ferret corrects for this by resetting the
+! time origin back by 2 days.  This is ok for internal time coordinate computations,
+! but the time origin written to the user and in cdf files is incorrect: 30-dec-0000
+!
+! fix this in the RETURN=t0, SHOW AXIS, SHOW/XML AXIS and SAVE commands
+!
+! CDC file, save a  portion of it.  Check that time origin is 0001-01-01 00:00:00
+! (it will not be unless the bug-fix version of Ferret writes the file.)
+ 
+ 
+! set data "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.pac.ocean/taux.mnmean.nc"
+! save/clobber/file=cdc_timeaxis.nc/i=15/j=45 taux
+! can data/all
+ 
+ 
+def axis/t=1-jan-1990:1-feb-1990:1/units=days/t0="01-JAN-0001 00:00:00" tcdc
+let a = sin(t[gt=tcdc]/10000)
+ 
+save/clobber/file=t0_cdc.nc a
+can var/all
+can axis tcdc
+use t0_cdc
+ 
+sh axis tcdc
+ name       axis              # pts   start                end
+ TCDC      TIME                32 r   30-DEC-1989 00:00    30-JAN-1990 00:00
+T0 = 01-JAN-0001 00:00:00
+   Axis span (to cell edges) = 32
+save/clobber/file=my_cdc_timeaxis.nc/L=1:15 a
+sp echo "err580_cdc_timeaxis.jnl --- " >> all_ncdump.out
+sp ncdump -h my_cdc_timeaxis.nc >> all_ncdump.out
+say `a,return=t0`
+ !-> MESSAGE/CONTINUE 01-JAN-0001 00:00:00
+01-JAN-0001 00:00:00
+ 
+sp rm -f t0_cdc.nc
+sp rm -f my_cdc_timeaxis.nc
+ 
+ 
+ 
+! Fix for bug 1272: show axis/t= with NOLEAP calendar
+GO bn_reset
+cancel mode verify
+GO err580_show_axis_t.jnl
+! err580_show_axis_t
+! bug 1272: wrong range shown when nonstd calendar
+! 5/22/06 acm
+ 
+ ! SHOW AXIS/T= gives wrong date when calendar not gregorian
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=noleap tnoleap
+sh axis/t=25-jan-2001:1-feb-2001 tnoleap
+ name       axis              # pts   start                end
+ TNOLEAP   TIME              1826 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 1826
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     390>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36510
+     391>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36511
+     392>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36512
+     393>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36513
+     394>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36514
+     395>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36515
+     396>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36516
+     397>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36517
+ 
+ 
+def axis/t=1-jan-2000:1-jan-2005:1/units=days/caleandar=gregorian tgreg
+sh axis/t=25-jan-2001:1-feb-2001 tgreg
+ name       axis              # pts   start                end
+ TGREG     TIME              1828 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+T0 = 15-JAN-1901
+   Axis span (to cell edges) = 1828
+ 
+       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
+     391>  25-JAN-2001 00:00:00  1          24-JAN-2001 12:00:00    36535
+     392>  26-JAN-2001 00:00:00  1          25-JAN-2001 12:00:00    36536
+     393>  27-JAN-2001 00:00:00  1          26-JAN-2001 12:00:00    36537
+     394>  28-JAN-2001 00:00:00  1          27-JAN-2001 12:00:00    36538
+     395>  29-JAN-2001 00:00:00  1          28-JAN-2001 12:00:00    36539
+     396>  30-JAN-2001 00:00:00  1          29-JAN-2001 12:00:00    36540
+     397>  31-JAN-2001 00:00:00  1          30-JAN-2001 12:00:00    36541
+     398>  01-FEB-2001 00:00:00  1          31-JAN-2001 12:00:00    36542
+ 
+! Fix for bug 1279 which was only in the first iteration of v5.81 release
+GO bn_reset
+cancel mode verify
+GO err581_nlev.jnl
+! err580_nlev.jnl
+! bug 1279
+ 
+!FILL/lev=n var
+! gave us exactly n levels, not approximately n levels.
+ 
+use coads_climatology
+fill/lev=30 sst[l=2]
+ 
+! Fix for bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+GO bn_reset
+cancel mode verify
+GO err581_vs_poly_axis.jnl
+! err581_vs_poly_axis.jnl
+! Test fix of bug 1349: formatted axis labels on PLOT/VS and POLYGON plot
+! acm 8/29/2005
+ 
+LET xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+LET ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+SET VAR/UNITS=degrees_east/TITLE="LONGITUDES" xpts
+SET VAR/UNITS=degrees_north/TITLE="LATITUDES" ypts
+PLOT/VS xpts, ypts
+ 
+LET ysqr = YSEQUENCE({0,0,.1,.1}*0.01)
+LET xsqr = YSEQUENCE({0,.1,.1,0}*0.01)
+DEF VAR/UNITS=degrees_east/TITLE="LONGITUDES" xp =  xpts+xsqr
+DEF VAR/UNITS=degrees_north/TITLE="LATITUDES" yp =  ypts+ysqr
+ 
+SET VAR/TITLE="COLORED BY LATITUDE" ypts
+POLYGON/LINE/fill xp, yp, ypts
+ 
+! Fix for bug 1270: regridding leakage between cells: monthly-> seasonal regridding
+! needs file short_bug1270.nc
+! ( this fix not checked in for v5.81 release.)
+! GO bn_reset
+! GO err580_regrid_prec.jnl
+ 
+*** Running test: bn_tab_comma_multivar.jnl
+! bn_tab_comma_multivar.jnl
+!
+! Fixes for bug 1273
+! v5.90 8/9/2005
+! LIST/FORM=tab and /FORM=comma with more than one variable
+! no longer behave as if /SINGLY was specified. New qualifier
+! LIST/NOROWLAB removes coordinate labels from the rows listing data
+ 
+let country =  {"JP", "JP", "US"}
+let id = {1,2,3}
+let aa = 4000* id
+let bb = 1000000* id + 500
+let newcountry = {"w", "c", "e"}
+let the_data_var = {4,5,4}
+ 
+ 
+list/format=comma country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+     COUNTRY,ID,AA,BB,NEWCOUNTRY,THE_DATA_VAR
+1   / 1:"JP",1,4000,1000500,"w",4  
+2   / 2:"JP",2,8000,2000500,"c",5  
+3   / 3:"US",3,12000,3000500,"e",4  
+ 
+list/format=tab/norow country, id, aa, bb, newcountry, the_data_var
+             X: 0.5 to 3.5
+ Column  1: COUNTRY is {"JP", "JP", "US"}    BAD FLAG : -1.E+34
+ Column  2: ID is {1,2,3}    BAD FLAG : -1.E+34
+ Column  3: AA is 4000* ID    BAD FLAG : -1.E+34
+ Column  4: BB is 1000000* ID + 500    BAD FLAG : -1.E+34
+ Column  5: NEWCOUNTRY is {"w", "c", "e"}    BAD FLAG : -1.E+34
+ Column  6: THE_DATA_VAR is {4,5,4}    BAD FLAG : -1.E+34
+COUNTRY	ID	AA	BB	NEWCOUNTRY	THE_DATA_VAR
+"JP"	1	4000	1000500	"w"	4  
+"JP"	2	8000	2000500	"c"	5  
+"US"	3	12000	3000500	"e"	4  
+*** Running test: bn_element_functions.jnl
+ ! NOAA/PMEL TMAP
+ ! FERRET v5.81
+ ! Solaris 5.6 - 08/08/05
+ !  9-Aug-05 14:36
+ 
+use coads_climatology
+let a = x[gx=sst]*y[gy=sst]*l[gt=sst]
+list/i=1:2/j=1:2/l=3 a
+             VARIABLE : X[GX=SST]*Y[GY=SST]*L[GT=SST]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 17-MAR 02:58
+              21E    23E   
+               1      2
+ 87S   / 2: -5481. -6003.
+ 89S   / 1: -5607. -6141.
+list is_element_of (a, -6003)
+             VARIABLE : IS_ELEMENT_OF (A, -6003)
+             FILENAME : coads_climatology.cdf
+             X        : 1
+          1.000
+ list/i=1:2/j=1:2/l=3 element_index (a, {-6003})
+             VARIABLE : ELEMENT_INDEX (A, {-6003})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 2 points (LONGITUDE-LATITUDE)
+             TIME     : 17-MAR 02:58
+              21E    23E   
+               1      2
+ 87S   / 2:   ....  1.000
+ 89S   / 1:   ....   ....
+use string4d.nc
+list/j=1:2/k=1:2 axy
+             VARIABLE : RESHAPE (A,RVAR)
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:"alpha""a2"   
+ 2   / 2:"a3"   "a4"   
+ ---- K:2 Z:   2
+ 1   / 1:"a7"   "a8"   
+ 2   / 2:"a9"   "a10"  
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:"c5"   "c6"   
+ 2   / 2:"c7"   "c8"   
+ ---- K:2 Z:   2
+ 1   / 1:"d1"   "d2"   
+ 2   / 2:"d3"   "d4"   
+list is_element_of_str (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          0.0000
+list is_element_of_str (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+list is_element_of_str_n (axy[k=1:2,j=1:2], "a10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "a10")
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], "A10")
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], "A10")
+             FILENAME : string4d.nc
+             X        : 1
+          2.000
+list is_element_of_str_n (axy[k=1:2,j=1:2], {"B0", "QQ", "d4", "m5"})
+             VARIABLE : IS_ELEMENT_OF_STR_N (AXY[K=1:2,J=1:2], {"B0", "QQ", "d4", "m5"})
+             FILENAME : string4d.nc
+             X        : 1
+          1.000
+list element_index_str_n (axy[k=1:2,j=1:2], {"a10", "a2", "d4", "c5"})
+             VARIABLE : ELEMENT_INDEX_STR_N (AXY[K=1:2,J=1:2], {"a10", "a2", "d4", "c5"})
+             FILENAME : string4d.nc
+             SUBSET   : 2 by 2 by 2 by 2 points (X-Y-Z-T)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ ---- K:1 Z:   1
+ 1   / 1:   ....  2.000
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  1.000
+ ---- L:2 T:   2
+ ---- K:1 Z:   1
+ 1   / 1:  4.000   ....
+ 2   / 2:   ....   ....
+ ---- K:2 Z:   2
+ 1   / 1:   ....   ....
+ 2   / 2:   ....  3.000
+ 
+*** Running test: bn_long_revision_num.jnl
+! bn_long_revision_num.jnl
+! ACM 8/30/05
+! revision numbers were previously limited to 2 decimal places: v5.81
+! Now they can be longer, for minor revisions between releases: v5.8101
+ 
+! ferret version
+sh sym FERRET_VERSION
+FERRET_VERSION = "6.9"
+ 
+! history attribute
+let a = 12
+sp echo "bn_long_revision_num.jnl --- history attribute" >> all_ncdump.out
+save/clobber/file=revision.nc a; sp ncdump revision.nc | grep history >> all_ncdump.out
+ 
+! label in upper right
+go ptest; sh sym lab1
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+LAB1 = "X : 0.5 to 314.5"
+ 
+! show commands without an argument, lists version number at the top
+sho command
+ Commands in Program FERRET (PyFerret 1.0.2) version6.9:
+ SET
+ SET WINDOW/SIZE/NEW/LOCATION/ASPECT/CLEAR/TITLE/QUALITY/ANTIALIA/NOANTIAL
+      /ENGINE/COLOR/OPACITY/THICKEN/XPIXELS/YPIXELS/XINCHES/YINCHES/TEXTPROM
+ SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+ SET VIEWPORT
+ SET EXPRSION
+ SET LIST/PRECISIO/FILE/FORMAT/APPEND/HEADING/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+      /XCHUNK/YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/OUTTYPE
+ SET DATA/EZ/VARIABLE/TITLE/FORMAT/GRID/SKIP/COLUMNS/SAVE/RESTORE/ORDER
+      /TYPE/SWAP/REGULART/DELIMITE/BROWSE/STRICT
+ SET MODE/LAST
+ SET MOVI/FILE/COMPRESS/LASER/START
+ SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE/SIGMA
+      /CURVILIN
+ SET GRID/SAVE/RESTORE
+ SET AXIS/MODULO/DEPTH/CALENDAR/T0/UNITS/STRIDE/OFFSET/REGULAR/OUTTYPE/NAME
+ SET MEMORY/SIZE
+ SET ATTRIBUT/TYPE/DATASET/OUTPUT/LIKE/QUIET
+ SET NCCACHE/SIZE/NELEMS/PREEMPT
+ SET REDIRECT/TEE/JOURNAL/FILE/APPEND/CLOBBER
+ SET GIFFILE
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ CANCEL
+ CANCEL WIND/ALL
+ CANCEL REGION/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+ CANCEL MEMORY/ALL/TEMPORY/PERMANT
+ CANCEL EXPRSION/ALL
+ CANCEL LIST/ALL/PRECISIO/FILE/FORMAT/HEADING/APPEND/OUTTYPE
+ CANCEL DATA/ALL/NOERROR
+ CANCEL MODE
+ CANCEL MOVIE/ALL
+ CANCEL VIEWPORT
+ CANCEL VARIABLE/ALL/DATASET/SIGMA/CURVILIN
+ CANCEL AXIS/MODULO/ALL/DEPTH/STRIDE
+ CANCEL GRID
+ CANCEL ATTRIBUT/OUTPUT/DATA
+ CANCEL REDIRECT
+ CANCEL ALIAS/ALL
+ CANCEL SYMBOL/ALL
+ CANCEL NCCACHE
+ CANCEL PYVAR/ALL/DATASET
+ CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/FILL/LINE
+          /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/COLOR
+          /NOAXES/PATTERN/SIZE/SPACING/SIGDIG/PEN/HLIMITS/VLIMITS/AXES/HGRATICU
+          /VGRATICU/GRATICUL/MODULO/THICKNES/OPACITY
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+ PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/VS/SYMBOL
+       /NOLABEL/LINE/COLOR/THICKNES/XLIMITS/YLIMITS/TITLE/SIZE/NOAXES/STEP
+       /DASH/AXES/HGRATICU/VGRATICU/HLIMITS/VLIMITS/HLOG/VLOG/GRATICUL/NOKEY
+       /NOYADJUS/KEY/RIBBON/LEVELS/PALETTE/FAST/MISSING/OPACITY
+ GO/HELP
+ HELP
+ LOAD/TEMPORY/PERMANT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/NAME
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+ EXIT/COMMAND/LOOP/SCRIPT/PROMPT/PROGRAM/CYCLE/TOPYTHON
+ MESSAGE/CONTINUE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+ VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/ASPECT/NOLABEL
+         /LENGTH/XSKIP/YSKIP/THICK/XLIMITS/YLIMITS/TITLE/COLOR/NOAXES/NOKEY
+         /FLOWLINE/DENSITY/AXES/PEN/HLIMITS/VLIMITS/HGRATICU/VGRATICU/GRATICUL
+         /KEY/MODULO/OPACITY
+ PPLUS/RESET
+ FRAME/FORMAT/FILE/TRANSPAR/XINCHES/YINCHES/XPIXELS/YPIXELS/ANNOTATE
+ REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP/RANGE/NAME
+ STAT/BRIEF/I/J/K/L/M/N/X/Y/Z/T/E/F/D
+ SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/TRIM/LINE
+        /NOLABEL/LEVELS/KEY/NOKEY/PALETTE/XLIMITS/YLIMITS/TITLE/AXES/NOAXES
+        /PATTERN/HGRATICU/VGRATICU/GRATICUL/MODULO/HLIMITS/VLIMITS/OPACITY
+ SPAWN
+ USER/OPT1/OPT2/COMMAND/I/J/K/L/X/Y/Z/T/D/FILE/FORMAT
+ WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/VIEWPOIN/ZLIMITS/TRANPOSE
+       /NOLABEL/ZSCALE/TITLE
+ QUERY/ALL/FILE/IGNORE
+ IF
+ ELSE
+ ELIF
+ ENDIF
+ POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/OVERLAY/SET_UP/FRAME/D/TRANPOSE/COORD_AX
+          /NOLABEL/LEVELS/LINE/COLOR/PALETTE/XLIMITS/YLIMITS/TITLE/THICKNES
+          /NOAXES/PATTERN/FILL/KEY/NOKEY/AXES/HLIMITS/VLIMITS/HLOG/VLOG
+          /HGRATICU/VGRATICU/GRATICUL/MODULO/OPACITY
+ 
+ Use SHOW ALIAS to see alternative command names
+*** Running test: bn_window_title.jnl
+! bn_window_title.jnl
+! Define a title for windows rather than just FERRET_1, FERRET_2, ...
+! If no title is set, use SESSION_DATE:SESSION_TIME
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+sh sym win_title
+WIN_TITLE = "31-Mar-14_17:28"
+ 
+set win/title="set the title"
+sho sym win_title
+WIN_TITLE = "set_the_title"
+ 
+go ptest
+! Description: create a simple test line plot
+ 
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+ 
+set win/new
+set win/title=""/new
+sho sym win_title
+WIN_TITLE = "_"
+ 
+set win/title="($session_date):($session_time)"
+ !-> set win/title="31-Mar-14:17:28"
+ 
+! If the date or time starts with a blank then we get an extra
+! underscore in the window title. Evaluating the symbols into
+! new ones gets rid of this blank at the start.
+! the symbols session_date and session_time may have been canceled.
+! If so substitute another string.
+ 
+DEFINE SYMBOL the_date = ($session_date"SESSION_DATE")
+ !-> DEFINE SYMBOL the_date = 31-Mar-14
+DEFINE SYMBOL the_time = ($session_time"SESSION_TIME")
+ !-> DEFINE SYMBOL the_time = 17:28
+SET WIN/TITLE="($the_date):($the_time)"
+ !-> SET WIN/TITLE="31-Mar-14:17:28"
+ 
+can win/all
+set win/new
+sh sym win_title
+WIN_TITLE = "31-Mar-14:17:28"
+*** Running test: bn_last_error.jnl
+! bn_last_error.jnl
+! acm Nov 2005
+!
+! - test the symbol FER_LAST_ERROR (Commands from various bn scripts)
+ 
+ 
+ 
+SET MODE IGNORE_ERRORS
+ 
+LIST/ORDER=X  IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I GT 3 THEN ( IF I LT 5 THEN I ELSE -9 ) ELSE .333 \Cannot use multiple IFs in an expression "
+ 
+ 
+LET A = IF I LT 5 THEN I ELSE -9
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: IF I LT 5 THEN I ELSE -9 \ELSE before - is illegal\negative constants need to be enclosed in parentheses "
+ 
+ 
+load a1,a2,a3
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: variable unknown or not in data set: A1 "
+ 
+set data nofile.nc
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**TMAP ERR: non-existent or not on line nofile.nc "
+ 
+ 
+! Repeat/range errors
+repeat/name=a (say `a`)
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: invalid command: REPEAT/NAME requires /RANGE "
+ 
+ 
+! Cannot use pseudo-variables.
+repeat/range=1:3/name=L (use coads_climatology; list/nohead [sst=I=1,j=1])
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: command syntax: L is a pseudo-variable; cannot use with REPEAT/RANGE/NAME. Instead use REPEAT/L= "
+ 
+ 
+! external function errors via ef_bail_out
+ 
+! This  bails out w/Time axis error
+USE  "coads_vwnd.cdf"
+SET REGION/I=90/J=65
+LET vw_fft = ffta(vwnd[l=37:60])
+LOAD vw_fft
+SHOW SYM FER_LAST_ERROR
+FER_LAST_ERROR = "**ERROR: error in external function. Bailing out of external function FFTA\ Time axis must be a regular axis"
+ 
+ 
+SET MODE/LAST IGNORE_ERROR
+*** Running test: bn_deg_min.jnl
+! bn_deg_min.jnl
+! label axes with degrees and minutes rather than degrees and decimal degrees.
+! 19-May-06 add seconds as well...
+ 
+use ss_small.nc
+ 
+shade/set/x=222.9:223.1/y=58.22:59.1 rose
+ppl xfor (dm)
+ppl yfor (dm)
+ppl shade
+ 
+! plot/vs plots
+ 
+let xpts= {144.616,144.621,144.651,144.658,144.660,144.664,144.670,144.670,144.672,144.674,144.676,144.677,144.678,144.679,144.683,144.685,144.686,144.687,144.688,144.690,144.691,144.692,144.693,144.693,144.694,144.694,144.695,144.696,144.697,144.698}
+let ypts= {32.3793,32.3279,32.308,32.3972,32.3938,32.3958,32.3112,32.3924,32.309,32.3095,32.3828,32.3135,32.3861,32.385,32.3265,32.3264,32.3821,32.3772,32.355,32.3657,32.3691,32.3371,32.3495,32.3672,32.3458,32.3625,32.3604,32.3518,32.3643,32.3531}
+ 
+set var/units=degrees_east/title="longitudes" xpts
+set var/units=degrees_north/title="latitudes" ypts
+ 
+plot/vs/set xpts, ypts
+ppl xfor (dm)
+ppl yfor (dm)
+ppl plot
+ 
+! DMS degrees-minutes-seconds
+plot/vs/set xpts, ypts
+ppl xfor (dms)
+ppl yfor (dms)
+ppl axlint,3,1
+ppl plot
+ 
+! Restore the default settings
+ppl axlint,2,2
+*** Running test: bn_dp_readscale.jnl
+! bn_dp_readscale.jnl
+! 9-Feb-2006 ACM
+ 
+! When there is a double precision variable,
+! and when the user specifies an offset, read the
+! variable in double precision, apply the offset and
+! then convert to single precision.  When plotting
+! the user specifies the offset to add back to the
+! axis labels.
+ 
+set list/prec=8
+ 
+use adouble.nc
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  140.00000
+ 2    /  2:  140.00000
+ 3    /  3:  140.00000
+ 4    /  4:  140.00000
+ 5    /  5:  140.00000
+ 6    /  6:  140.00001
+ 7    /  7:  140.00010
+ 8    /  8:  140.00100
+ 9    /  9:  140.01000
+ 10   / 10:  140.10000
+let xlon = 140
+ 
+! Now read xax with an offset
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+can mem
+ 
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:  0.000000000
+ 2    /  2:  0.000000001
+ 3    /  3:  0.000000010
+ 4    /  4:  0.000000100
+ 5    /  5:  0.000001000
+ 6    /  6:  0.000010000
+ 7    /  7:  0.000100000
+ 8    /  8:  0.001000000
+ 9    /  9:  0.010000000
+ 10   / 10:  0.100000000
+ 
+! define an axis from xax
+define axis/x/units=lon xir = xax
+let pvar = yvar[gx=xir at asn]
+ 
+! Plot, adding back the offset on axis labels.
+plot/set/color=red/line/sym=22 pvar
+ppl xvaloff `xlon`
+ !-> ppl xvaloff 140
+ppl plot
+ 
+! Test a 2-D double precision variable
+can data/all
+use adouble_2D.nc
+set var/offset=`-1*xlon` xax
+ !-> set var/offset=-140 xax
+list xax
+             VARIABLE : test double prec. data
+             FILENAME : adouble_2D.nc
+             SUBSET   : 5 by 2 points (X-Y)
+                1            2            3            4            5       
+                1            2            3            4            5
+ 1   / 1:  0.000000000  0.000000001  0.000000010  0.000000100  0.000001000
+ 2   / 2:  0.000010000  0.000100000  0.001000000  0.010000000  0.100000000
+ 
+cancel list/precision
+*** Running test: bn_bounds_defineax.jnl
+! bn_bounds_defineax.jnl
+! 3/22/2006
+! Previously only allowed 2*N definition of bounds in DEFINE AXIS/BOUNDS
+! Now allow N+1 definition of bounds, or three equal-lenght lists of
+! coords, lo_bounds, hi_bounds
+!
+! Define an axis using bounds.  Note the coordinates need not be
+! centered in the axis cells.
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5, 1.5,2.5, 2.5,3.5, 3.5,6.5, 6.5,7.5, 7.5,8.5, 8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+def axis/t/bounds tax={1.2, 2, 3.2, 5, 7, 8.4, 9}, {0.5,1.5,2.5,3.5,6.5,7.5,8.5,9.5}
+list t[gt=tax], tboxlo[gt=tax], tboxhi[gt=tax], tbox[gt=tax]
+             T: 0.5 to 9.5
+ Column  1: T is T (axis TAX)
+ Column  2: TBOXLO is TBOXLO (axis TAX)
+ Column  3: TBOXHI is TBOXHI (axis TAX)
+ Column  4: TBOX is TBOX (axis TAX)
+             T  TBOXLO TBOXHI  TBOX
+1.2 / 1:  1.200  0.500  1.500  1.000
+2   / 2:  2.000  1.500  2.500  1.000
+3.2 / 3:  3.200  2.500  3.500  1.000
+5   / 4:  5.000  3.500  6.500  3.000
+7   / 5:  7.000  6.500  7.500  1.000
+8.4 / 6:  8.400  7.500  8.500  1.000
+9   / 7:  9.000  8.500  9.500  1.000
+ 
+! test of DEPTH axis
+ 
+def axis/x xax = {1,2,5,6,7,8}
+def axis/z/depth/bounds zax = {0,20,50,75,120}, {0,10,30,60,90,150}
+def axis/t tax = {1,2,9,10,11}
+let v = x[gx=xax] +z[gz=zax] + t[gt=tax]
+save/clobber/file=irrxzt.nc v
+sp echo "bn_bounds_defineax.jnl --- N+1 def of bounds." >> all_ncdump.out
+sp ncdump irrxzt.nc >> all_ncdump.out
+ 
+! 3-argument bounds definitions
+def axis/z/bounds zax={1,2,4,8,16,32,64,128}, {0.5,1.5,2.5,4.5,8.5,16.5,32.5,64.5}, {1.5,2.5,4.5,8.5,16.5,32.5,64.5,200}
+list zboxlo[gz=zax], z[gz=zax], zboxhi[gz=zax]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX)
+ Column  2: Z is Z (axis ZAX)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX)
+          ZBOXLO     Z   ZBOXHI
+1     / 1:   0.50    1.0    1.5
+2     / 2:   1.50    2.0    2.5
+4     / 3:   2.50    4.0    4.5
+8     / 4:   4.50    8.0    8.5
+16    / 5:   8.50   16.0   16.5
+32    / 6:  16.50   32.0   32.5
+64    / 7:  32.50   64.0   64.5
+128   / 8:  64.50  128.0  200.0
+ 
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=zax],return=ksize`
+ !-> DEFINE VARIABLE n = 8
+ 
+! Note this syntax --let zl2 = zboxlo[gz=zax,k=1:`1+n-2`:2]--
+! creates a new axis [gz=zax,k=1:`1+n-2`:2]
+! and computes its zboxlo. Instead make varibles containing
+! the bounds and sample those variables.
+ 
+let boxlo = zboxlo[gz=zax]
+let boxhi = zboxhi[gz=zax]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:7:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:8:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+ Column  1: ZL2 is BOXLO[K=1:7:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2 is BOXHI[K=2:8:2]
+         ZL2   EX#2    ZH2
+K / 1:   0.50    1.5    2.5
+K / 2:   2.50    5.5    8.5
+K / 3:   8.50   20.5   32.5
+K / 4:  32.50  116.3  200.0
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0.5 to 200
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+          ZBOXLO     Z   ZBOXHI
+1.5   / 1:   0.50    1.5    2.5
+5.5   / 2:   2.50    5.5    8.5
+20.5  / 3:   8.50   20.5   32.5
+116.3 / 4:  32.50  116.3  200.0
+ 
+use gt4d011
+ 
+! define some new bounds by subsampling:
+ 
+let n = `z[gz=temp],return=ksize`
+ !-> DEFINE VARIABLE n = 27
+ 
+let boxlo = zboxlo[gz=temp]
+let boxhi = zboxhi[gz=temp]
+let zl2 = boxlo[k=1:`1+n-2`:2]
+ !-> DEFINE VARIABLE zl2 = boxlo[k=1:26:2]
+let zh2 = boxhi[k=2:`n`:2]
+ !-> DEFINE VARIABLE zh2 = boxhi[k=2:27:2]
+ 
+list  zl2,(zl2+zh2)/2,zh2
+ WARNING: Listed variables have ambiguous coordinates on axes: Z
+             DATA SET: ./gt4d011.cdf
+ Column  1: ZL2[Z=0:3174] is BOXLO[K=1:26:2]
+ Column  2: EX#2 is (ZL2+ZH2)/2
+ Column  3: ZH2[Z=0:4149] is BOXHI[K=2:27:2]
+          ZL2   EX#2    ZH2
+K /  1:     0.    10.    20.
+K /  2:    20.    30.    40.
+K /  3:    40.    50.    60.
+K /  4:    60.    70.    80.
+K /  5:    80.    90.   100.
+K /  6:   100.   114.   128.
+K /  7:   128.   146.   165.
+K /  8:   165.   193.   220.
+K /  9:   220.   269.   317.
+K / 10:   317.   438.   559.
+K / 11:   559.   859.  1158.
+K / 12:  1158.  1679.  2199.
+K / 13:  2199.  2849.  3499.
+def axis/z/bounds zax2 = (zl2+zh2)/2, zl2, zh2
+ 
+! original axis
+list zboxlo[gz=temp], z[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 4149
+ Column  1: ZBOXLO is ZBOXLO (axis PSZT)
+ Column  2: Z is Z (axis PSZT)
+ Column  3: ZBOXHI is ZBOXHI (axis PSZT)
+             ZBOXLO     Z   ZBOXHI
+5       /  1:     0.     5.    10.
+15      /  2:    10.    15.    20.
+25      /  3:    20.    25.    30.
+35      /  4:    30.    35.    40.
+45      /  5:    40.    45.    50.
+55      /  6:    50.    55.    60.
+65      /  7:    60.    65.    70.
+75      /  8:    70.    75.    80.
+85      /  9:    80.    85.    90.
+95      / 10:    90.    95.   100.
+106.3   / 11:   100.   106.   113.
+120     / 12:   113.   120.   128.
+136.3   / 13:   128.   136.   145.
+155     / 14:   145.   155.   165.
+177.5   / 15:   165.   178.   190.
+205     / 16:   190.   205.   220.
+240     / 17:   220.   240.   260.
+288.5   / 18:   260.   289.   317.
+362.5   / 19:   317.   363.   408.
+483.5   / 20:   408.   484.   559.
+680     / 21:   559.   680.   801.
+979.5   / 22:   801.   980.  1158.
+1395.5  / 23:  1158.  1396.  1633.
+1916    / 24:  1633.  1916.  2199.
+2524    / 25:  2199.  2524.  2849.
+3174    / 26:  2849.  3174.  3499.
+3824    / 27:  3499.  3824.  4149.
+ 
+! sampled axis
+list zboxlo[gz=zax2], z[gz=zax2], zboxhi[gz=zax2]
+             Z: 0 to 3499
+ Column  1: ZBOXLO is ZBOXLO (axis ZAX2)
+ Column  2: Z is Z (axis ZAX2)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAX2)
+            ZBOXLO     Z   ZBOXHI
+10     /  1:     0.    10.    20.
+30     /  2:    20.    30.    40.
+50     /  3:    40.    50.    60.
+70     /  4:    60.    70.    80.
+90     /  5:    80.    90.   100.
+113.8  /  6:   100.   114.   128.
+146.3  /  7:   128.   146.   165.
+192.5  /  8:   165.   193.   220.
+268.5  /  9:   220.   269.   317.
+438    / 10:   317.   438.   559.
+858.5  / 11:   559.   859.  1158.
+1678.5 / 12:  1158.  1679.  2199.
+2849   / 13:  2199.  2849.  3499.
+*** Running test: bn_attributes.jnl
+! bn_attributes
+! test attribute handling on netcdf intput/output and
+! programatic access to attribute information
+! needs new cdf files modfalse.nc, test0.nc
+ 
+! 31Aug2006 ACM Remove OPeNDAP references; not essential to the
+! benchmark tests.
+ 
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+sho att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ 
+show attribute temp.units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+show attribute temp.missing_value
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ 
+!  specifying data set
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh att/all temp[d=2]
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+sh att temp.units[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+!  global attributes
+use err491_attval
+ 
+show att ..remark
+     attributes for dataset: ./err491_attval.cdf
+  .remark = Generated by oar3d                                                                                                                                               
+show att/all .
+     attributes for dataset: ./err491_attval.cdf
+ ..simulation = K-Bay OAR3d model (200m) 
+ ..start_date = 980105000000 
+ ..history = a
+ 
+ ..option = 1
+ ..run_mode = 3
+ ..srfc_bndry = 3
+ ..rad_penet = 2
+ ..dt_external = 1
+ ..dt_internal = 15
+ ..horiz_diff = 0.2
+ ..inv_prandtl = 0.2
+ ..min_slope = 0.2
+ ..title = K-Bay OAR3d model (200m)                                                         
+ ..command =                                                                                                                                                                                                                                                                                                                                  
+ ..remark = Generated by oar3d                                                                                                                                               
+ ..x_units = degrees                                                                          
+ ..y_units = degrees                                                                          
+ ..z_units =                                                                                  
+ ..nx = 35
+ ..ny = 127
+ ..x_min = 0
+ ..x_max = 0
+ ..y_min = 0
+ ..y_max = 0
+ ..z_min = 0
+ ..z_max = 0
+ ..x_inc = 0
+ ..y_inc = 0
+ ..z_scale_factor = 0
+ ..z_add_offset = 0
+ ..node_offset = 0
+ 
+sho att/all .[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ ..history = FERRET V4.90 (GUI) 04-Feb-98 
+ 
+!  Now SHOW DATA/ATT
+ 
+can data/all
+use ocean_atlas_temp
+sho data/att
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+ 
+use gt4d011
+use levitus_climatology
+ 
+sh data/att gt4d011
+     currently SET data sets:
+    2> ./gt4d011.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.45 (GUI) 21-Apr-97
+  
+ PS3DT2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZT TIME1
+  
+(PSXT)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXT
+  
+(PSYT)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYTedges
+                                 orig_file_axnameCHAR        4    F       PSYT
+  
+(PSYTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYTedges
+  
+(PSZT)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZTedges
+                                 orig_file_axnameCHAR        4    F       PSZT
+  
+(PSZTedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZTedges
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 orig_file_axnameCHAR        5    F       TIME1
+  
+(PSXT91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+(PSZT1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZT1_10
+  
+ TEMP                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+(PSYT35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT35_55
+  
+ SALT                  FLOAT     parent_grid     CHAR        6    F       PS3DT2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       0.01
+                                 _FillValue      FLOAT       1    T       0.01
+                                 long_name       CHAR        26   T       (SALINITY(ppt) - 35) /1000
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        22   T       frac. by wt. less .035
+  
+ PS3DU2                CHAR      axes            CHAR        20   F       PSXU PSYU PSZT TIME1
+  
+(PSXU)                 DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        4    F       PSXU
+  
+(PSYU)                 DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSYUedges
+                                 orig_file_axnameCHAR        4    F       PSYU
+  
+(PSYUedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSYUedges
+  
+(PSXU91_108)           DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        10   F       PSXU91_108
+  
+(PSYU35_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_55
+  
+ U                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        14   T       ZONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ V                     FLOAT     parent_grid     CHAR        6    F       PS3DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        19   T       MERIDIONAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS3DW2                CHAR      axes            CHAR        20   F       PSXT PSYT PSZW TIME1
+  
+(PSZW)                 DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 edges           CHAR        9    F       PSZWedges
+                                 orig_file_axnameCHAR        4    F       PSZW
+  
+(PSZWedges)            DOUBLE    edges           CHAR        1    F
+                                 orig_file_axnameCHAR        9    F       PSZWedges
+  
+(PSYT36_55)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYT36_55
+  
+(PSZW1_10)             DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        8    F       PSZW1_10
+  
+ W                     FLOAT     parent_grid     CHAR        6    F       PS3DW2
+                                 slab_min_index  INT         4    F       91 36 1 0
+                                 slab_max_index  INT         4    F       108 55 10 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       VERTICAL VELOCITY
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       cm/sec
+  
+ PS2DU2                CHAR      axes            CHAR        22   F       PSXU PSYU NORMAL TIME1
+  
+ TAUX                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        17   T       ZONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+ TAUY                  FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 55 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        22   T       MERIDIONAL WIND STRESS
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        11   T       dynes/cm**2
+  
+(PSYU35_56)            DOUBLE    child_axis      CHAR        1    F
+                                 units           CHAR        13   T       degrees_north
+                                 orig_file_axnameCHAR        9    F       PSYU35_56
+  
+ PSI                   FLOAT     parent_grid     CHAR        6    F       PS2DU2
+                                 slab_min_index  INT         4    F       91 35 1 0
+                                 slab_max_index  INT         4    F       108 56 1 0
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        15   T       STREAM FUNCTION
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        9    T       cm**3/sec
+  
+ 
+!  error messages
+ 
+set mode ignore
+ 
+! no argument
+sho att/all
+ 
+! dataset not open
+can data 2
+show att/all temp[d=2]
+ 
+! variable not in default dataset
+use ocean_atlas_temp
+show att/all salt
+ 
+! nonexistent attribute
+use gt4d011
+sho att salt.nonsense
+ 
+can data/all
+ 
+! No datasets open
+sho att/all .
+ 
+can mode ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! attributes of string variables
+let/title="my strings" var_b = {"Seattle", "Skykomish", "Snoqualmie"}
+sho att/all var_b
+     attributes for user-defined variables
+ var_b.long_name = my strings 
+ var_b.missing_value = -1.E+34
+ 
+save/clobber/file=a.nc var_b
+sp echo "bn_attributes.jnl --- 1 attributes of string variables" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Demonstrate `var,return=` output for attributes
+ 
+use gt4d011
+ 
+! RETURN=size gives length of attribute:
+! # values for numeric attributes
+! string length for string attributes
+ 
+show att/all temp
+     attributes for dataset: ./gt4d011.cdf
+ TEMP.parent_grid = PS3DT2 
+ TEMP.slab_min_index = 91, 35, 1, 0
+ TEMP.slab_max_index = 108, 56, 10, 0
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From gt4d011 
+ TEMP.units = deg. C 
+ 
+say `temp.2,return=size`
+ !-> MESSAGE/CONTINUE 4
+4
+say `temp.6,return=size`
+ !-> MESSAGE/CONTINUE 11
+11
+ 
+say `..history,return=size`
+ !-> MESSAGE/CONTINUE 28
+28
+ 
+! test0 is from the netcdf distribution;
+! vars and attrs of all types
+use test0
+say `broiled.acd,return=size`
+ !-> MESSAGE/CONTINUE 2
+2
+say `broiled.acf,return=size`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! define variables to contain attribute value(s)
+ 
+use ocean_atlas_temp
+let a = temp.missing_value
+list a
+             VARIABLE : TEMP.MISSING_VALUE
+             FILENAME : ocean_atlas_temp.cdf
+         -1.000E+34
+ 
+use ocean_atlas_temp
+let s = temp.units
+list s
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+can data/all
+ 
+! global attribute
+use err491_attval
+let s = ..remark
+list s
+             VARIABLE : ..REMARK
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+        "Generated by oar3d                                                                                                                                              "
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Variables containing number of variables, attributes, dimensions,
+! lists of variable names, attribute names, coordinate variables,
+! global attribute names
+ 
+! Given a variable, return the attribute names
+use coads_climatology
+let nat = sst.nattrs
+ 
+let anames = sst.attnames
+list nat
+             VARIABLE : SST.NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+list anames
+             VARIABLE : SST.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+! Given a variable, return the coordinate number and names
+let nd = sst.ndims
+let cnames = sst.dimnames
+list nd
+             VARIABLE : SST.NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+ 
+! ..varnames
+can data/all
+use gt4d011
+use coads_climatology
+ 
+let nv = ..nvars
+let nd = ..ndims
+let vnames = ..varnames
+list/d=1 nv, nd
+             DATA SET: ./gt4d011.cdf
+ Column  1: NV is ..NVARS
+ Column  2: ND is ..NDIMS
+             NV    ND
+I / *:     12.00  21.00
+list/d=1 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+let vnames = ..varnames
+list/d=coads_climatology vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+list/d=gt4d011 vnames
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+can data/all
+can var/all
+ 
+! global ..dimnames
+ 
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=coads_climatology]
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+can var/all
+can data/all
+ 
+! Global attributes ..attnames
+use err491_attval
+ 
+let v = ..ndims
+list v
+             VARIABLE : ..NDIMS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          3.000
+ 
+let na = ..nattrs
+list na
+             VARIABLE : ..NATTRS
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+          31.00
+ 
+let gnames = ..attnames
+list gnames
+             VARIABLE : ..ATTNAMES
+             DATA SET : K-Bay OAR3d model (200m)
+             FILENAME : err491_attval.cdf
+             SUBSET   : 31 points (X)
+ 1    /  1:"simulation"    
+ 2    /  2:"start_date"    
+ 3    /  3:"history"       
+ 4    /  4:"option"        
+ 5    /  5:"run_mode"      
+ 6    /  6:"srfc_bndry"    
+ 7    /  7:"rad_penet"     
+ 8    /  8:"dt_external"   
+ 9    /  9:"dt_internal"   
+ 10   / 10:"horiz_diff"    
+ 11   / 11:"inv_prandtl"   
+ 12   / 12:"min_slope"     
+ 13   / 13:"title"         
+ 14   / 14:"command"       
+ 15   / 15:"remark"        
+ 16   / 16:"x_units"       
+ 17   / 17:"y_units"       
+ 18   / 18:"z_units"       
+ 19   / 19:"nx"            
+ 20   / 20:"ny"            
+ 21   / 21:"x_min"         
+ 22   / 22:"x_max"         
+ 23   / 23:"y_min"         
+ 24   / 24:"y_max"         
+ 25   / 25:"z_min"         
+ 26   / 26:"z_max"         
+ 27   / 27:"x_inc"         
+ 28   / 28:"y_inc"         
+ 29   / 29:"z_scale_factor"
+ 30   / 30:"z_add_offset"  
+ 31   / 31:"node_offset"   
+ 
+! attributes of variable number 2
+ 
+use ocean_atlas_temp
+use gt4d011
+let names = ..varnames
+let anames = `names[i=2]`.attnames
+ !-> DEFINE VARIABLE anames = TEMP.attnames
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`).nattrs
+ !-> list (XAX_LEV9421_380).nattrs
+             VARIABLE : (XAX_LEV9421_380).NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp.nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+say `(yax_lev94).nattrs[d=1]`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+ 
+list temp.units[d=3]
+             VARIABLE : TEMP.UNITS[D=ocean_atlas_temp]
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use test0.nc
+sh data/att
+     currently SET data sets:
+    1> ./test0.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               glob            CHAR        16   F       Global attribute
+  
+ broiled               CHAR      act             CHAR        16   F       text string
+	123
+                                 acb             BYTE        1    F       10
+                                 acs             SHORT       1    F       -200
+                                 acl             INT         1    F       17000
+                                 acf             FLOAT       3    F       -2 1 0
+                                 acd             DOUBLE      2    F       -1 2.718282
+  
+ the_bullet            BYTE
+  
+ order                 SHORT
+  
+ rigue                 INT
+  
+ a_loan                FLOAT
+  
+ entendre              DOUBLE
+  
+ cscalar               CHAR
+  
+ dscalar               DOUBLE
+  
+ cnodata               CHAR
+  
+ bnodata               BYTE
+  
+ snodata               SHORT
+  
+ inodata               INT
+  
+ fnodata               FLOAT
+  
+ dnodata               DOUBLE
+  
+(i)                    INT       orig_file_axnameCHAR        1    F       i
+  
+(j)                    FLOAT     orig_file_axnameCHAR        1    F       j
+  
+(l)                    BYTE      orig_file_axnameCHAR        1    F       l
+  
+ 
+let a= broiled.acl
+list a
+             VARIABLE : BROILED.ACL
+             FILENAME : test0.nc
+          17000.
+ 
+let a= broiled.acf
+list a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 3 points (X)
+ 1   / 1: -2.000
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+list/i=2 a
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             X        : 2
+          1.000
+ 
+list a[i=2:3]
+             VARIABLE : BROILED.ACF
+             FILENAME : test0.nc
+             SUBSET   : 2 points (X)
+ 2   / 2:  1.000
+ 3   / 3:  0.000
+ 
+use coads_climatology
+list sst.dimnames[i=2]
+             VARIABLE : SST.DIMNAMES[I=2]
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+list/i=3 sst.dimnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 3
+        "TIME"
+let a= sst.dimnames
+ 
+list a
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list a[i=1]
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 1
+        "COADSX"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! keyword . to refer to global properties and attributes
+ 
+use gt4d011
+list ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+ 
+use coads_climatology
+ 
+list/d=1 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : gt4d011.cdf
+          12.00
+list/d=2 ..nvars
+             VARIABLE : ..NVARS
+             FILENAME : coads_climatology.cdf
+          1.000
+ 
+sh data
+     currently SET data sets:
+    1> ./gt4d011.cdf
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+    2> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+list/d=2 ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+list/d=2 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME"  
+list/d=1 ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+list/d=1 ..nattrs
+             VARIABLE : ..NATTRS
+             FILENAME : gt4d011.cdf
+          1.000
+list/d=1 ..attnames
+             VARIABLE : ..ATTNAMES
+             FILENAME : gt4d011.cdf
+        "history"
+ 
+list/d=1 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : gt4d011.cdf
+          21.00
+list/d=2 ..ndims
+             VARIABLE : ..NDIMS
+             FILENAME : coads_climatology.cdf
+          3.000
+ 
+list ..nvars[d=1]
+             VARIABLE : ..NVARS[D=gt4d011]
+             FILENAME : gt4d011.cdf
+          12.00
+sh var
+ Created by DEFINE VARIABLE:
+ 
+let pp = ..varnames
+list pp[d=1]
+             VARIABLE : ..VARNAMES
+             FILENAME : gt4d011.cdf
+             SUBSET   : 12 points (X)
+ 1    /  1:"PS3DT2"
+ 2    /  2:"TEMP"  
+ 3    /  3:"SALT"  
+ 4    /  4:"PS3DU2"
+ 5    /  5:"U"     
+ 6    /  6:"V"     
+ 7    /  7:"PS3DW2"
+ 8    /  8:"W"     
+ 9    /  9:"PS2DU2"
+ 10   / 10:"TAUX"  
+ 11   / 11:"TAUY"  
+ 12   / 12:"PSI"   
+ 
+set data 1
+list/d=2 pp
+             VARIABLE : ..VARNAMES
+             FILENAME : coads_climatology.cdf
+        "SST"
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Editing attributes: add new attributes to a variable.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Now change some existing attributes (this redefines
+! the attribute, behaving like DEFINE AXIS...)
+ 
+def att temp.pp = {1.5, 1.9, 3.45, 7}
+def att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! add an attribute to a variable not in the default dataset
+ 
+use gt4d011
+def att/D=1 temp.morenew = 2
+sh att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+ TEMP.some_text = some different text 
+ TEMP.morenew = 2
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit existing attributes on variables
+ 
+use ocean_atlas_temp
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+set att temp.long_name = "set title via SET ATT temp.longname"
+set att temp.units = "Centigrade"
+plot/y=0/l=1 temp
+ 
+! two settings of the missing value change both the missing and bad flags
+set att temp.missing_value = 12
+set att temp.missing_value = 12
+shade/L=2 temp
+ 
+!-----
+! access and edit attributes of coordinate variables.
+! Specify names of coord variables inside parentheses
+ 
+use ocean_atlas_temp
+use coads_climatology
+ 
+! Get attributes of a coordinate variable
+ 
+list (coadsx).units
+             VARIABLE : (COADSX).UNITS
+             FILENAME : coads_climatology.cdf
+        "degrees_east"
+list (coadsx).modulo
+             VARIABLE : (COADSX).MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+sho att/all (coadsx)
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).units = degrees_east 
+ (COADSX).modulo =   
+ (COADSX).point_spacing = even 
+ (COADSX).orig_file_axname = COADSX 
+ 
+! Set the attribute output flag
+ 
+set att/output (coadsx).modulo
+ 
+! Define a new attribute on a coordinate axis
+ 
+define att (`sst,return=xaxis`).newatt = 3
+ !-> define att (COADSX).newatt = 3
+set att/output (`sst,return=xaxis`).newatt
+ !-> set att/output (COADSX).newatt
+save/clobber/file=a.nc/x=130w/y=0 sst
+ 
+sp echo "bn_attributes.jnl --- 2 access and edit attributes of coordinate variables." >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! modfalse.nc is a file with modulo attribute on x axis
+! explicitly set to FALSE
+ 
+use modfalse.nc
+set att/output (`sst,return=xaxis`).modulo
+ !-> set att/output (COADSX81_81).modulo
+save/clobber/file=a.nc sst
+sp echo "bn_attributes.jnl --- 3 modulo set to false" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Reset attributes as in SET AXIS
+ 
+use gt4d011
+set view left; shade/y=0/L=1 temp
+set att (`temp,return=zaxis`).positive="up"
+ !-> set att (PSZT).positive="up"
+set view right; shade/y=0/L=1 temp
+can data gt4d011
+ 
+set data coads_climatology
+sho att (coadsx).modulo
+     attributes for dataset: ./coads_climatology.cdf
+ (COADSX).modulo =   
+set att (coadsx).modulo=360
+ 
+! Note here that Ferret is using the name TIME1 instead of TIME.
+! axis still found and edited.
+ 
+set att (`sst,return=taxis`).time_origin="1-jan-1980"
+ !-> set att (TIME1).time_origin="1-jan-1980"
+list/x=130w/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 131W
+             LATITUDE : 1S
+                   131W   
+                   105
+ 16-JAN-1980 / 1:  25.02
+ 15-FEB-1980 / 2:  26.35
+ 17-MAR-1980 / 3:  26.98
+ 
+!(coordvar).attname[d=1]
+! Can have the parentheses included in a symbol
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAX_LEV9421_380)"
+list `($xaxnam).nattrs[d=1]`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+ 
+! Or parentheses added when symbol is evaluated
+def sym yaxnam  "`temp[d=1],return=yaxis`"
+ !-> def sym yaxnam  "YAX_LEV94"
+list `(($yaxnam)).nattrs[d=1]`
+ !-> list 3
+             VARIABLE : constant
+          3.000
+ 
+! just the name of the axis
+list (`sst,return=xaxis`).nattrs[d=2]
+ !-> list (COADSX).nattrs[d=2]
+             VARIABLE : (COADSX).NATTRS[D=coads_climatology]
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! using dimension names from the linked list structure
+ 
+let cnames = sst.dimnames
+list cnames
+             VARIABLE : SST.DIMNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"COADSX"
+ 2   / 2:"COADSY"
+ 3   / 3:"TIME1" 
+show axis (`cnames[i=1]`)
+ !-> show axis (COADSX)
+ name       axis              # pts   start                end
+list (`cnames[i=1]`).nattrs
+ !-> list (COADSX).nattrs
+             VARIABLE : (COADSX).NATTRS
+             FILENAME : coads_climatology.cdf
+          5.000
+ 
+! Intentional errors.
+ 
+SET MODE IGNORE
+ 
+! Need parentheses around axis name.
+list coadsx.units
+sh att/all coadsy
+ 
+! Cannot change the direction of an axis
+use modfalse.nc
+set att (`sst,return=xaxis`).axis = "Z"
+ !-> set att (COADSX81_81).axis = "Z"
+ 
+can view
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes: inherit all attrs from another variable
+ 
+use gt4d011
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 55, 10, 0
+ SALT.missing_value = 0.01
+ SALT._FillValue = 0.01
+ SALT.long_name = (SALINITY(ppt) - 35) /1000 
+ SALT.history = From gt4d011 
+ SALT.units = frac. by wt. less .035 
+ 
+set att/like=temp salt
+sh att/all salt
+     attributes for dataset: ./gt4d011.cdf
+ SALT.parent_grid = PS3DT2 
+ SALT.slab_min_index = 91, 35, 1, 0
+ SALT.slab_max_index = 108, 56, 10, 0
+ SALT.missing_value = -1.E+34
+ SALT._FillValue = -1.E+34
+ SALT.long_name = TEMPERATURE 
+ SALT.history = From gt4d011 
+ SALT.units = deg. C 
+ 
+! If a user variable is defined based on another variable,
+! it gets only default attributes. All attributes must be
+! specified with qualifiers (/UNITS=) or with DEF ATT
+ 
+! Define a new attribute on a file variable, then a new var as fcn of that
+ 
+define attribute temp.description = "description of TEMP in gt4d011"
+let temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ 
+! Can inherit attributes explicitly, either all at once or individually.
+def att temp2.units = "`temp,return=units`"
+ !-> def att temp2.units = "deg. C"
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = TEMP*2 
+ temp2.missing_value = -1.E+34
+ temp2.units = deg. C 
+ 
+let temp3 = temp*3
+set att/like=temp temp3
+sh att/all temp3
+     attributes for user-defined variables
+ temp3.parent_grid = PS3DT2 
+ temp3.slab_min_index = 91, 35, 1, 0
+ temp3.slab_max_index = 108, 56, 10, 0
+ temp3.missing_value = -1.E+34
+ temp3._FillValue = -1.E+34
+ temp3.long_name = TEMPERATURE 
+ temp3.history = From gt4d011 
+ temp3.units = deg. C 
+ temp3.description = description of TEMP in gt4d011 
+ 
+can var temp2
+let/units="degrees C"/title="my new TEMP"/bad=`temp,return=bad` temp2 = temp*2
+ !-> DEFINE VARIABLE/units="degrees C"/title="my new TEMP"/bad=-9.9999998E+33 temp2 = temp*2
+sh att/all temp2
+     attributes for user-defined variables
+ temp2.long_name = my new TEMP 
+ temp2.units = degrees C 
+ temp2.missing_value = -1.E+34
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Edit attributes, changing type
+! change values, type, and length of attributes.
+ 
+use ocean_atlas_temp
+def att/type=string temp.strval = 2
+def att/type=float temp.floatval = 22
+def att temp.pp = {1.5, 1.9}
+def att temp.some_text = "some text about the TEMP variable"
+sh att/all temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = 1.5, 1.9
+ TEMP.some_text = some text about the TEMP variable 
+ 
+! Change attribute values
+ 
+set att temp.pp = {1.5, 1.9, 3.45, 7}
+set att temp.some_text = "some different text"
+sh att temp.pp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.pp = 1.5, 1.9, 3.45, 7
+let var = temp.some_text
+list/nohead var
+        "some different text"
+ 
+! Now change attribute types
+ 
+set att temp.pp = "PP now has some text."
+set att temp.some_text = 745.
+ 
+! Does changing the type of an attribute cause any trouble for a variable
+! defined based on that variable?
+ 
+list/nohead var
+          745.0
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+        "PP now has some text."
+ 
+! set an attribute when the variable is not in the default dataset.
+ 
+use gt4d011
+def att/d=1 temp.morenew = 33
+sho att/all temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+ TEMP.strval = 2 
+ TEMP.floatval = 22
+ TEMP.pp = PP now has some text. 
+ TEMP.some_text = 745
+ TEMP.morenew = 33
+ 
+! Edit the text in some of the attributes, make a plot where we see
+! the resulting change in title and units.
+ 
+set data ocean_atlas_temp
+set att temp.long_name = "Ocean Atlas Temperature"
+set att temp.units = "Centigrade"
+shade/L=2 temp
+ 
+! Define an attr that already exists: redefines
+ 
+def att temp.pp = {1.5, 1.9, 3}
+let pq = temp.pp
+list pq
+             VARIABLE : TEMP.PP
+             FILENAME : ocean_atlas_temp.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.500
+ 2   / 2:  1.900
+ 3   / 3:  3.000
+ 
+go bn_reset
+cancel mode verify
+ 
+! When we CANCEL MODE upcase_output, writing a netcdf file preserves
+! case of variable and axis names. This file has lower case and some
+! mixed-case names.
+ 
+use err491_attval.cdf
+sp echo "bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:" >> all_ncdump.out
+sp ncdump -h err491_attval.cdf >> all_ncdump.out
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 5 before CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+cancel mode upcase_output
+save/clobber/file=a.nc elev[i=3,j=2:4]
+sp echo "bn_attributes.jnl --- 6 after CANCEL MODE upcase_output" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+set mode/last upcase_output
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! outtput flags to control attribute output to netcdf files
+ 
+! SET ATT/OUTPUT varname.attname sets individual attr to be written
+! SET ATT/OUTPUT=all varname     output all attributes defined when var written
+! SET ATT/OUTPUT=default varname output default Ferret attributes
+! SET ATT/OUTPUT=none varname    output no attrbutes
+ 
+let aa = 12
+let bb = {3,4.5,6,7,4}
+ 
+def att bb.my_title = "This is my new variable bb"
+def att bb.another_attr = 6
+ 
+! Output just one of these new attributes
+ 
+set att/output bb.my_title
+ 
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 7 outtput flags to control attribute output" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output all attributes
+ 
+set att/output=all bb
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 8 outtput all flags" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Just output the default attributes
+ 
+set att/output=default bb
+save/clobber/file=a.nc bb
+sp echo "bn_attributes.jnl --- 9 Just output the default attributes" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+! Output none of the attributes for aa
+ 
+set att/output=none aa
+save/clobber/file=a.nc aa,bb
+sp echo "bn_attributes.jnl --- 10 Output none of the attributes for aa" >> all_ncdump.out
+sp ncdump -c a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! CANCEL ATTRIBUTE/OUTPUT= to surpress output of attributes
+ 
+use ocean_atlas_temp
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+! Surpress output of existing attribute
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+ 
+! Surpress output of an attribute that Ferret would otherwise add.
+ 
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! subregions create child axes with new names
+! Check that settings hold for such an output file.
+ 
+set reg/x=300:360/y=30:45
+sh att/all  (`temp,return=xaxis`)
+ !-> sh att/all  (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ (XAX_LEV9421_380).axis = 1
+can att/out (`temp,return=xaxis`).point_spacing
+ !-> can att/out (XAX_LEV9421_380).point_spacing
+can att/out (`temp,return=xaxis`).axis
+ !-> can att/out (XAX_LEV9421_380).axis
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 12 Check that settings hold for child axis." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! cancel output of attributes of the variable itself
+can region
+sh att/all  temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+can att/out temp.history
+can att/out temp.long_name
+save/file=a.nc/clobber temp
+sp echo "bn_attributes.jnl --- 13 cancel output of attributes of the variable." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Read EZ ascii, delimited, and stream data files,
+! add attributes to their variables.
+ 
+! read file as an ez file
+ 
+file/var="a1,a2,a3" EZ.DAT
+def att a1.three={1,2,3}
+sh att/all a1
+     attributes for dataset: ./EZ.DAT
+ A1.long_name = A1 
+ A1.missing_value = -1.E+34
+ A1.three = 1, 2, 3
+sh dat/att
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        6    F       EZ.DAT
+  
+ A1                    FLOAT     long_name       CHAR        2    T       A1
+                                 missing_value   FLOAT       1    T       -1.E+34
+                                 three           FLOAT       3    T       1 2 3
+  
+ A2                    FLOAT     long_name       CHAR        2    T       A2
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+ A3                    FLOAT     long_name       CHAR        2    T       A3
+                                 missing_value   FLOAT       1    T       -1.E+34
+  
+save/file=a.nc/clobber a1,a2,a3
+sp echo "bn_attributes.jnl --- 14 attributes of data from ez data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! now read it as a delimited file
+ 
+can data/all
+ 
+columns/delim=" " EZ.DAT
+def att/type=string v1.strval = 2
+set att/output v1.strval
+sh att/all v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.strval = 2 
+save/clobber/file=a.nc v1,v4
+sp echo "bn_attributes.jnl --- 15 attributes of data from delimited data." >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! and a stream dataset
+ 
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+file/format=str/var=num,num1/grid=mygrid/order=xyztv permutedBinaryTest.dat
+ 
+define att/type=string num.new = "a string attribute"
+sh att/all num
+     attributes for dataset: ./permutedBinaryTest.dat
+ NUM.long_name = NUM 
+ NUM.missing_value = -1.E+34
+ NUM.new = a string attribute 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! manipulate attributes of user-defined variables
+ 
+let a = {12,14,15}
+def att a.three={1,2,3}
+set att/output a.three
+def att a.four = {"theory"}
+set att/output a.four
+sh att/all a
+     attributes for user-defined variables
+ a.long_name = {12,14,15} 
+ a.missing_value = -1.E+34
+ a.three = 1, 2, 3
+ a.four = theory 
+sh dat/att
+     currently SET data sets:
+save/file=a.nc/clobber a
+sp echo "bn_attributes.jnl --- 16 attributes of user vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! write global attributes (Note this implementation needs work;
+! what is the right syntax?? Perhaps an undocumented feature for
+! the first release)
+ 
+use err491_attval
+set att/out=all .   ! from the default data set
+ 
+save/file=a.nc/clobber elev
+sp echo "bn_attributes.jnl --- 17 global attrs." >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Choose a single global attribute to write, from dataset 1
+can data/all
+use err491_attval
+use gt4d011
+set att/output/d=1 ..dt_internal
+save/clobber/file=a.nc elev[d=1], temp[d=2,x=130w,k=1,y=-20:20]
+ 
+sp echo "bn_attributes.jnl --- 18 choose global attr to write" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! Note: this syntax does not work
+! use err491_attval
+! use ocean_atlas_temp
+! set att/out  ..min_slope[d=1]
+! save/file=a.nc/clobber elev[d=1]
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+ 
+! File with scale_factor and add_offset
+! If we request to write the variable with its scale factor
+! and offset attributes, then the data and its missing and fill
+! flags are rescaled.  Lets us re-pack data on output, or specify
+! new packing.
+ 
+use err491_attval
+set att/output elev.scale_factor
+set att/output elev.add_offset
+set var/outtype=input elev
+ 
+save/clobber/file=a.nc/j=1 elev
+sp echo "bn_attributes.jnl --- 19 scale and offset attr." >> all_ncdump.out
+ 
+! Both of these should be scaled the same by Ferret
+use a.nc
+list/j=1 elev[d=1], elev[d=2]
+             LONGITUDE: 135.5W(-135.5) to 135W(-135)
+             LATITUDE: 58.6N
+             T (day): 1.7837
+ Column  1: ELEV[D=err491_attval] is Surface elevation (meter)
+ Column  2: ELEV[D=a] is Surface elevation (meter)
+                 ELEV   ELEV
+135.51W   /  1:   ....   ....
+135.496W  /  2:   ....   ....
+135.483W  /  3:   ....   ....
+135.469W  /  4:   ....   ....
+135.456W  /  5:   ....   ....
+135.442W  /  6:   ....   ....
+135.429W  /  7:   ....   ....
+135.415W  /  8:   ....   ....
+135.402W  /  9:   ....   ....
+135.389W  / 10:   ....   ....
+135.375W  / 11:   ....   ....
+135.362W  / 12:  2.940  2.940
+135.348W  / 13:  2.940  2.940
+135.335W  / 14:  2.940  2.940
+135.321W  / 15:  2.940  2.940
+135.308W  / 16:  2.940  2.940
+135.294W  / 17:  2.940  2.940
+135.281W  / 18:  2.940  2.940
+135.267W  / 19:  2.940  2.940
+135.254W  / 20:  2.940  2.940
+135.241W  / 21:  2.940  2.940
+135.227W  / 22:  2.940  2.940
+135.214W  / 23:  2.940  2.940
+135.2W    / 24:  2.940  2.940
+135.187W  / 25:  2.940  2.940
+135.173W  / 26:   ....   ....
+135.16W   / 27:   ....   ....
+135.146W  / 28:   ....   ....
+135.133W  / 29:   ....   ....
+135.12W   / 30:   ....   ....
+135.106W  / 31:   ....   ....
+135.093W  / 32:   ....   ....
+135.079W  / 33:   ....   ....
+135.066W  / 34:   ....   ....
+135.052W  / 35:   ....   ....
+sp ncdump a.nc  >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! Set type of data on output, uses netcdf call to output
+! the requseted type.
+ 
+use gt4d011
+set var/bad=-1000 temp
+set var/outtype=int4 temp
+save/file=a.nc/clobber/y=1/k=1/L=1 temp
+sp echo "bn_attributes.jnl --- 20 set data type on output int4" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i temp >> all_ncdump.out
+ 
+can data/all
+use gt4d011
+ 
+set var/outtype=double salt
+save/clobber/file=a.nc/y=1/k=1/L=1 salt
+sp echo "bn_attributes.jnl --- 21 set data type on output double" >> all_ncdump.out
+sp ncdump a.nc | grep -A2 -i salt >> all_ncdump.out
+ 
+can data gt4d011
+ 
+! Force output type to equal input type (should we have a MODE setting for this??)
+ 
+use test0
+let nam = ..varnames
+ 
+repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va; \
+  set var/outtype=input `($va)`;\
+  if `q eq 1` THEN save/clobber/file=a.nc `($va)` \
+  ELSE save/append/file=a.nc `($va)`)
+ !-> repeat/range=1:4/name=q (def sym va = nam[i=`q`]; sh sym va;   set var/outtype=input `($va)`;  if `q eq 1` THEN save/clobber/file=a.nc `($va)`   ELSE save/append/file=a.nc `($va)`)
+!-> REPEAT: Q:1
+ !-> def sym va = nam[i=1]
+VA = "nam[i=1]"
+ !-> set var/outtype=input broiled
+ !-> if 1 THEN save/clobber/file=a.nc `nam[i=1]`   ELSE save/append/file=a.nc `nam[i=1]`
+ !-> LIST/FORMAT=CDF/clobber/file=a.nc broiled
+!-> REPEAT: Q:2
+ !-> def sym va = nam[i=2]
+VA = "nam[i=2]"
+ !-> set var/outtype=input the_bullet
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=2]`   ELSE save/append/file=a.nc `nam[i=2]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc the_bullet
+!-> REPEAT: Q:3
+ !-> def sym va = nam[i=3]
+VA = "nam[i=3]"
+ !-> set var/outtype=input order
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=3]`   ELSE save/append/file=a.nc `nam[i=3]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc order
+!-> REPEAT: Q:4
+ !-> def sym va = nam[i=4]
+VA = "nam[i=4]"
+ !-> set var/outtype=input rigue
+ !-> if 0 THEN save/clobber/file=a.nc `nam[i=4]`   ELSE save/append/file=a.nc `nam[i=4]`
+ !-> LIST/FORMAT=CDF/append/file=a.nc rigue
+ 
+sp echo "bn_attributes.jnl --- 22 outtype=input" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+set var/outtype=double a_loan
+save/file=a.nc/clobber a_loan
+ 
+can data test0
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! More tests of user-defined variables. Bug 1427, now fixed, problem with varid of user vars
+ 
+let v = {1,2,3,4}
+let a = is_element_of(1,v)
+let/title="hello" b = 1
+save/clobber/file=a.nc b
+sp echo "bn_attributes.jnl --- 23 more user-defined vars" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Bug 1492, now fixed, output user-defined or redefined attributes
+ 
+! A new setting for the point_spacing attribute using either SET or DEFINE
+ 
+use coads_vwnd
+set att (`vwnd,return=xaxis`).point_spacing = "uneven"
+ !-> set att (COADSX).point_spacing = "uneven"
+define att (`vwnd,return=yaxis`).point_spacing = "uneven"
+ !-> define att (COADSY).point_spacing = "uneven"
+save/file=a.nc/clobber/L=1 vwnd
+ 
+sp echo "bn_attributes.jnl --- 24 output redefined attr" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+! new attribute written to file
+ 
+let t2 = 2*vwnd
+DEFINE ATT/OUTPUT  (`t2,return=yaxis`).new_att = "somthing"
+ !-> DEFINE ATT/OUTPUT  (COADSY).new_att = "somthing"
+ 
+! shows up on the output of
+ 
+SHOW ATT/ALL (`t2,return=yaxis`)
+ !-> SHOW ATT/ALL (COADSY)
+     attributes for dataset: ./coads_vwnd.cdf
+ (COADSY).units = degrees_north 
+ (COADSY).point_spacing = uneven 
+ (COADSY).orig_file_axname = COADSY 
+ (COADSY).new_att = somthing 
+ 
+! Check the new attribute is saved to a file. (if we
+! save uwnd to a file, it is output)
+ 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 25 output new attr on user-defined var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+! intentional errors
+ 
+set mode ignore_error
+ 
+! missing value and fill value too large for INT output.
+ 
+use gt4d011
+set var/outtype=int4 temp
+save/file=a.nc/clobber/x=132w/k=1 temp
+can data gt4d011
+ 
+sp rm a.nc
+ 
+! specify incorrect output types
+ 
+use test0
+set var/outtype=char broiled
+ 
+set var/outtype=garbage broiled
+ 
+can mode ignore
+go bn_reset
+cancel mode verify
+ 
+ 
+!---!!!---
+! Manipulate attributes of axes from datasets
+! A user-defined variable is used to refer to the axes.
+ 
+use gt4d011.cdf
+ 
+let t2 = t*temp
+set att (`t2,return=xaxis`).units = "degrees"
+ !-> set att (PSXT).units = "degrees"
+sh att/all (`t2,return=xaxis`)
+ !-> sh att/all (PSXT)
+     attributes for dataset: ./gt4d011.cdf
+ (PSXT).units = degrees 
+ (PSXT).point_spacing = even 
+ (PSXT).orig_file_axname = PSXT 
+set att/output (`t2,return=xaxis`).point_spacing
+ !-> set att/output (PSXT).point_spacing
+save/file=a.nc/clobber/L=1 t2
+ 
+sp echo "bn_attributes.jnl --- 26 attributes of axes" >> all_ncdump.out
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+define att/out (`t2,return=xaxis`).new_att = "something"
+ !-> define att/out (PSXT).new_att = "something"
+save/file=a.nc/clobber/L=1 t2
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! A file variable is used to refer to the axes
+ 
+set att (`temp,return=xaxis`).units="meters"
+ !-> set att (PSXT).units="meters"
+set att (`temp,return=yaxis`).units="meters"
+ !-> set att (PSYT).units="meters"
+sho att/all (`temp,return=yaxis`)
+ !-> sho att/all (PSYT)
+     attributes for dataset: ./gt4d011.cdf
+ (PSYT).units = meters 
+ (PSYT).point_spacing = uneven 
+ (PSYT).edges = PSYTedges 
+ (PSYT).orig_file_axname = PSYT 
+save/file=a.nc/clobber/L=1 t2
+ 
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! User-defined axes and variables
+ 
+def axis/x=1:200:1  x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+! SET AXIS command changes attributes
+set axis/modulo x2ax
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ 
+! DEFINE ATTRIBUTE command changes attributes
+define attribute (x2ax).units = "degrees_east"
+sh att/all (x2ax)
+     attributes for coordinate axis
+ (X2AX).point_spacing = even 
+ (X2AX).axis = X 
+ (X2AX).modulo =   
+ (X2AX).units = degrees_east 
+ 
+! Define new attribute on an axis.
+! Save file var, and a user var defined from the file var
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+define att/out (`temp,return=xaxis`).new_att = "something"
+ !-> define att/out (XAXLEVITR1_160).new_att = "something"
+sh dat/att
+     currently SET data sets:
+    1> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+                                 new_att         CHAR        9    T       something
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+save/file=a.nc/clobber/y=0:5 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+let two = 2*temp[y=0:15,x=180:200]
+save/file=a.nc/clobber/y=0:5 two
+sp ncdump -h a.nc >> all_ncdump.out
+go bn_reset
+cancel mode verify
+ 
+! defining more axes with attributes
+ 
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                  200mr   1                    200
+   Axis span (to cell edges) = 200 (modulo length = axis span)
+def axis/x=1:2:1/modulo=360 x2ax
+def axis/y=1:3:1 y3ax
+def axis/z=1:4:1/depth z4ax
+def axis/t=1:2:1 t2ax
+let a = {"alpha","a2","a3","a4","a5","a6","a7","a8","a9","a10",\
+"bravo","b2","b3","b4","b5","b6","b7","b8","b9","b10",\
+"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10",\
+"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10",\
+"echo","e2","e3","e4","e5","e6","e7","e8"}
+let rvar = x[gx=x2ax] + y[gy=y3ax] + z[gz=z4ax] + t[gt=t2ax]
+ 
+let axy = reshape (a,rvar)
+ 
+show att/all (z4ax)
+     attributes for coordinate axis
+ (Z4AX).point_spacing = even 
+ (Z4AX).axis = Z 
+ (Z4AX).positive = down 
+set att (z4ax).positive = "up"
+ 
+sp echo "bn_attributes.jnl --- 27 attributes of  user-defined axes" >> all_ncdump.out
+save/clobber/file=string4d.nc axy
+sp ncdump -h string4d.nc >> all_ncdump.out
+ 
+go bn_reset
+cancel mode verify
+! For SET ATT timeaxis.units or SET ATT timeaxis.time_origin
+! include the correct time origin as part of the units attribute.
+ 
+! Note original attributes
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = hour since 0000-01-01 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! change units to days since time origin
+set att (`sst,return=taxis`).units="days"
+ !-> set att (TIME).units="days"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = days since 1-JAN-0000 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).units = "months"
+ !-> define attribute (TIME).units = "months"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 1-JAN-0000 00:00:00 
+ (TIME).time_origin = 1-JAN-0000 00:00:00 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! change time origin and also units to include time origin
+set att (`sst,return=taxis`).time_origin = "1-mar-1955"
+ !-> set att (TIME).time_origin = "1-mar-1955"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 1-mar-1955 
+ (TIME).time_origin = 1-mar-1955 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+define attribute (`sst,return=taxis`).time_origin = "15-jan-2002"
+ !-> define attribute (TIME).time_origin = "15-jan-2002"
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 15-jan-2002 
+ (TIME).time_origin = 15-jan-2002 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+ 
+! Likewise on DEFINE AXIS or SET AXIS, change units to
+! include the correct since time_origin.
+ 
+use coads_climatology
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = months since 15-jan-2002 
+ (TIME).time_origin = 15-jan-2002 
+ (TIME).modulo =   
+ (TIME).orig_file_axname = TIME 
+def axis/t=1:12:1/unit=months/t0="1-jan-0001" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = MONTHS since 1-JAN-0001 
+ (TIME).time_origin = 1-JAN-0001 
+ (TIME).orig_file_axname = TIME 
+ 
+set axis/t0="15-jan-0000" time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = MONTHS since 15-JAN-0000 
+ (TIME).time_origin = 15-JAN-0000 
+ (TIME).orig_file_axname = TIME 
+ 
+set axis/units=days time
+show att/all (`sst,return=taxis`)
+ !-> show att/all (TIME)
+     attributes for dataset: ./coads_climatology.cdf
+ (TIME).units = days since 15-JAN-0000 
+ (TIME).time_origin = 15-JAN-0000 
+ (TIME).orig_file_axname = TIME 
+ 
+! Fix bug 1518: previously var.attnames for a user-defined variable resulted in an error
+use coads_climatology
+let sst2 = 2*sst
+set att/like=sst sst2
+list sst2.attnames
+             VARIABLE : SST2.ATTNAMES
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (X)
+ 1   / 1:"missing_value"
+ 2   / 2:"_FillValue"   
+ 3   / 3:"long_name"    
+ 4   / 4:"history"      
+ 5   / 5:"units"        
+ 
+ 
+! Add a global attribute
+use test0
+ 
+DEFINE ATT/OUTPUT ..FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset"
+SET ATT/OUTPUT=all .
+ 
+SET ATT/OUTPUT=all broiled
+SAVE/CLOBBER/FILE=a.nc broiled
+ 
+sp echo "bn_attributes.jnl --- 28 Define a new global attribute" >> all_ncdump.out
+sp echo "bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var" >> all_ncdump.out
+sp ncdump a.nc >> all_ncdump.out
+ 
+ 
+!-----
+! Set type of data on output for a user var
+! the requseted type.
+ 
+sp echo "bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+use gt4d011
+let/units="Deg F" faren = temp*9/5 + 32
+set var/outtype=double faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+let/units="Deg F"/bad=-999 faren = temp*9/5 + 32
+set var/outtype=int faren
+save/file=a.nc/clobber faren
+ 
+sp ncdump -h a.nc  >> all_ncdump.out
+ 
+! Tests for simplified syntax for SHOW ATTRIBUTE:
+ 
+! SHOW ATT varname   is like SHOW ATT/ALL varname
+! SHOW ATT dset      same output as SHOW DATA/ATT dset
+ 
+can data/all
+use ocean_atlas_temp
+sho att temp
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att ocean_atlas_temp
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att (`temp,return=xaxis`)
+ !-> sho att (XAX_LEV9421_380)
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (XAX_LEV9421_380).units = degrees_east 
+ (XAX_LEV9421_380).modulo =   
+ (XAX_LEV9421_380).point_spacing = even 
+ (XAX_LEV9421_380).orig_file_axname = XAX_LEV9421_380 
+ 
+use levitus_climatology
+sho att 1
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.90 (GUI) 04-Feb-98
+  
+(XAX_LEV9421_380)      DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        15   F       XAX_LEV9421_380
+  
+(YAX_LEV94)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        9    F       YAX_LEV94
+  
+(ZAXLEVIT191_1)        DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        13   F       ZAXLEVIT191_1
+  
+(TIME1)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       Temperature
+                                 history         CHAR        24   T       From ocean_atlas_monthly
+                                 units           CHAR        5    T       Deg C
+  
+sho att 2
+     currently SET data sets:
+    2> ./levitus_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.22    5-Apr-01
+  
+(XAXLEVITR1_160)       DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        14   F       XAXLEVITR1_160
+  
+(YAXLEVITR1_90)        DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        13   F       YAXLEVITR1_90
+  
+(ZAXLEVITR1_1)         DOUBLE    units           CHAR        6    T       METERS
+                                 positive        CHAR        4    T       down
+                                 orig_file_axnameCHAR        12   F       ZAXLEVITR1_1
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+10
+                                 _FillValue      FLOAT       1    T       -1.E+10
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        24   T       From levitus_climatology
+                                 units           CHAR        5    T       DEG C
+  
+ 
+sho att temp[d=1]
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.long_name = Temperature 
+ TEMP.history = From ocean_atlas_monthly 
+ TEMP.units = Deg C 
+sho att temp[d=2]
+     attributes for dataset: ./levitus_climatology.cdf
+ TEMP.missing_value = -1.E+10
+ TEMP._FillValue = -1.E+10
+ TEMP.long_name = TEMPERATURE 
+ TEMP.history = From levitus_climatology 
+ TEMP.units = DEG C 
+ 
+sho att (`temp[d=1],return=taxis`[d=1])
+ !-> sho att (TIME1[d=1])
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ (TIME1).units = hour since 0000-01-01 00:00:00 
+ (TIME1).time_origin = 01-JAN-0000 00:00:00 
+ (TIME1).modulo =   
+ (TIME1).orig_file_axname = TIME 
+ 
+sho att .
+     attributes for dataset: ./levitus_climatology.cdf
+ ..history = FERRET V5.22    5-Apr-01 
+*** Running test: bn_transforms.jnl
+! Test the transforms
+ 
+use coads_climatology
+ 
+list/L=1/prec=7 sst[x=100:120 at ave,y=10:30 at ave]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY ave)
+             LATITUDE : 10N to 30N (XY ave)
+             TIME     : 16-JAN 06:00
+          24.02076
+ 
+list/L=1/prec=7 sst[x=100:120 at din,y=10:30 at din]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 100E to 120E (XY integ.)
+             LATITUDE : 10N to 30N (XY integ.)
+             TIME     : 16-JAN 06:00
+          6.008341E+13
+ 
+list/L=1/y=0/x=83w:49w sst,sst[x=@cda], sst[x=@cdb], sst[x=@cia], sst[x=@cib]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 83W to 49W
+             LATITUDE: 1S
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[X=@CDA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist above on X)
+ Column  3: SST[X=@CDB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest dist below on X)
+ Column  4: SST[X=@CIA:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index above on X)
+ Column  5: SST[X=@CIB:1] is SEA SURFACE TEMPERATURE (Deg C)(closest index below on X)
+               SST    SST    SST    SST    SST
+83W   / 129:  24.60   0.00   0.00   0.00   0.00
+81W   / 130:  25.44   0.00   0.00   0.00   0.00
+79W   / 131:   ....  26.00   2.00  13.00   1.00
+77W   / 132:   ....  24.00   4.00  12.00   2.00
+75W   / 133:   ....  22.00   6.00  11.00   3.00
+73W   / 134:   ....  20.00   8.00  10.00   4.00
+71W   / 135:   ....  18.00  10.00   9.00   5.00
+69W   / 136:   ....  16.00  12.00   8.00   6.00
+67W   / 137:   ....  14.00  14.00   7.00   7.00
+65W   / 138:   ....  12.00  16.00   6.00   8.00
+63W   / 139:   ....  10.00  18.00   5.00   9.00
+61W   / 140:   ....   8.00  20.00   4.00  10.00
+59W   / 141:   ....   6.00  22.00   3.00  11.00
+57W   / 142:   ....   4.00  24.00   2.00  12.00
+55W   / 143:   ....   2.00  26.00   1.00  13.00
+53W   / 144:  27.35   0.00   0.00   0.00   0.00
+51W   / 145:  27.13   0.00   0.00   0.00   0.00
+49W   / 146:  27.38   0.00   0.00   0.00   0.00
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@ddb], sst[y=@ddc], sst[y=@ddf]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@DDB] is SEA SURFACE TEMPERATURE (Deg C)(backwards derivative on Y)
+ Column  3: SST[Y=@DDC] is SEA SURFACE TEMPERATURE (Deg C)(centered derivative on Y)
+ Column  4: SST[Y=@DDF] is SEA SURFACE TEMPERATURE (Deg C)(forward derivative on Y)
+              SST      SST        SST        SST
+11N   / 51:  26.99  2.217E-06  1.611E-06  1.005E-06
+13N   / 52:  27.21  1.005E-06  1.468E-06  1.932E-06
+15N   / 53:  27.64  1.932E-06  5.847E-07 -7.622E-07
+17N   / 54:  27.47 -7.622E-07 -7.072E-06 -1.338E-05
+19N   / 55:  24.50 -1.338E-05 -7.908E-06 -2.435E-06
+21N   / 56:  23.95 -2.435E-06 -1.473E-06 -5.111E-07
+23N   / 57:  23.84 -5.111E-07 -1.898E-06 -3.286E-06
+25N   / 58:  23.11 -3.286E-06 -3.738E-06 -4.190E-06
+27N   / 59:  22.18 -4.190E-06 -9.122E-06 -1.405E-05
+29N   / 60:  19.05 -1.405E-05       ....       ....
+31N   / 61:   ....       ....       ....       ....
+33N   / 62:   ....       ....       ....       ....
+ 
+list/L=1/y=10:33/x=93w sst, sst[y=@evnt:23.84]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 10N to 33N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@EVN: 23.84] is SEA SURFACE TEMPERATURE (Deg C)(event mask at 23.84 on Y)
+              SST    SST
+11N   / 51:  26.99  0.000
+13N   / 52:  27.21  0.000
+15N   / 53:  27.64  0.000
+17N   / 54:  27.47  0.000
+19N   / 55:  24.50  0.000
+21N   / 56:  23.95  0.000
+23N   / 57:  23.84  0.000
+25N   / 58:  23.11  1.000
+27N   / 59:  22.18  1.000
+29N   / 60:  19.05  1.000
+31N   / 61:   ....  1.000
+33N   / 62:   ....  1.000
+ 
+list/L=1/y=23:51/x=93w sst, sst[y=@fav], sst[y=@fln], sst[y=@fnr]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 23N to 51N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@FAV:3] is SEA SURFACE TEMPERATURE (Deg C)(ave-filled by 3 pts on Y)
+ Column  3: SST[Y=@FLN:1] is SEA SURFACE TEMPERATURE (Deg C)(linear-filled by 1 pts on Y)
+ Column  4: SST[Y=@FNR:1] is SEA SURFACE TEMPERATURE (Deg C)(nearest-filled by 1 pts on Y)
+              SST    SST    SST    SST
+23N   / 57:  23.84  23.84  23.84  23.84
+25N   / 58:  23.11  23.11  23.11  23.11
+27N   / 59:  22.18  22.18  22.18  22.18
+29N   / 60:  19.05  19.05  19.05  19.05
+31N   / 61:   ....  19.05  18.15  19.05
+33N   / 62:   ....   ....  17.24  19.05
+35N   / 63:   ....   ....  16.33  19.05
+37N   / 64:   ....   ....  15.43  15.43
+39N   / 65:   ....   ....  14.52  11.80
+41N   / 66:   ....   ....  13.61  11.80
+43N   / 67:   ....  11.80  12.71  11.80
+45N   / 68:  11.80  11.80  11.80  11.80
+47N   / 69:   2.47   2.47   2.47   2.47
+49N   / 70:   ....   2.47   ....   2.47
+51N   / 71:   ....   ....   ....   2.47
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at min], sst[y=23:51 at max]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=@MIN] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@MAX] is SEA SURFACE TEMPERATURE (Deg C)
+            SST    SST
+I / *:     2.466  23.84
+ 
+list/L=1/y=23:51/x=93w sst[y=23:51 at nbd], sst[y=23:51 at ngd]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             LATITUDE: 23N to 51N
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=@NBD] is SEA SURFACE TEMPERATURE (# of points)
+ Column  2: SST[Y=@NGD] is SEA SURFACE TEMPERATURE (# of points)
+            SST    SST
+I / *:     9.000  6.000
+ 
+list/L=1/y=1:11/x=93w sst, sst[y=@iin]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 1N to 11N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@IIN] is SEA SURFACE TEMPERATURE (Deg C)(indef. integ. on Y)
+              SST      SST
+1N    / 46:  25.77  2.865E+06
+3N    / 47:  26.60  8.780E+06
+5N    / 48:  26.86  1.475E+07
+7N    / 49:  26.57  2.066E+07
+9N    / 50:  26.49  2.656E+07
+11N   / 51:  26.99  2.956E+07
+ 
+list/L=1/y=23:25/x=93w sst, sst[y=24 at itp]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST[Y=23N:25N] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=24N at ITP] is SEA SURFACE TEMPERATURE (Deg C)
+              SST    SST
+23N   / 57:  23.84  23.47
+25N   / 58:  23.11  23.47
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@rsum], sst[y=@sbn], sst[y=@sbx], sst[y=@shf:-1]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@RSU] is SEA SURFACE TEMPERATURE (Deg C)(running sum on Y)
+ Column  3: SST[Y=@SBN:3] is SEA SURFACE TEMPERATURE (Deg C)(binomial smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SBX:3] is SEA SURFACE TEMPERATURE (Deg C)(box smoothed by 3 pts on Y)
+ Column  5: SST[Y=@SHF:-1] is SEA SURFACE TEMPERATURE (Deg C)(shifted by -1 pts on Y)
+              SST    SST    SST    SST    SST
+11N   / 51:  26.99   27.0  26.92  26.90  26.49
+13N   / 52:  27.21   54.2  27.26  27.28  26.99
+15N   / 53:  27.64   81.8  27.49  27.44  27.21
+17N   / 54:  27.47  109.3  26.77  26.54  27.64
+19N   / 55:  24.50  133.8  25.10  25.31  27.47
+21N   / 56:  23.95  157.8  24.06  24.10  24.50
+23N   / 57:  23.84  181.6  23.69  23.63  23.95
+ 
+list/L=1/y=11:23/x=93w sst, sst[y=@shn] , sst[y=@spz], sst[y=@sum], sst[y=@swl], sst[y=@weq:26]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 11N to 23N
+             LONGITUDE: 93W
+             TIME: 16-JAN 06:00
+ Column  1: SST is SEA SURFACE TEMPERATURE (Deg C)
+ Column  2: SST[Y=@SHN:3] is SEA SURFACE TEMPERATURE (Deg C)(Hanning smoothed by 3 pts on Y)
+ Column  3: SST[Y=@SPZ:3] is SEA SURFACE TEMPERATURE (Deg C)(Parzen smoothed by 3 pts on Y)
+ Column  4: SST[Y=@SUM] is SEA SURFACE TEMPERATURE (Deg C)
+ Column  5: SST[Y=@SWL:3] is SEA SURFACE TEMPERATURE (Deg C)(Welch smoothed by 3 pts on Y)
+ Column  6: SST[Y=@WEQ:26] is SEA SURFACE TEMPERATURE (Deg C)(weighted equal of 26 on Y)
+              SST    SST    SST    SST    SST    SST
+11N   / 51:  26.99  26.92  26.92  181.6  26.91    ....
+13N   / 52:  27.21  27.26  27.26  181.6  27.27    ....
+15N   / 53:  27.64  27.49  27.49  181.6  27.46    ....
+17N   / 54:  27.47  26.77  26.77  181.6  26.63  0.5056
+19N   / 55:  24.50  25.10  25.10  181.6  25.23  0.4944
+21N   / 56:  23.95  24.06  24.06  181.6  24.08    ....
+23N   / 57:  23.84  23.69  23.69  181.6  23.66    ....
+*** Running test: bn_variance.jnl
+ ! bn_variance.jnl
+ ! the @VAR transform is not tested in bn_transforms.jnl script.
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (variance)
+          0.4424
+list/x=100/L=1 sst[y=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (variance)
+             TIME     : 16-JAN 06:00
+          102.3
+list/y=10/L=1 sst[x=@var]
+             VARIABLE : Variance of SEA SURFACE TEMPERATURE ((Deg C)^2)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (variance)
+             LATITUDE : 9N
+             TIME     : 16-JAN 06:00
+          0.5010
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@var]
+             VARIABLE : Variance of ZONAL VELOCITY ((cm/sec)^2)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (variance)
+             TIME     : 17-AUG-1982 12:00
+          11.33
+*** Running test: bn_linecolors.jnl
+! bn_linecolors.jnl
+! 5/2006 ACM
+! test setting more line colors
+ 
+set mode meta linecolors.plt
+ 
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set mode/last meta
+ 
+! Test choosing individual colors and thickness combinations
+! All commands except for contour have /THICK
+ 
+plot/color=7/thick=3/i=1:100 cos(i/10)
+plot/over/color=8/thick=2/i=1:100 cos(i/12)
+plot/over/color=12/thick=1/i=1:100 cos(i/8)
+ 
+vector/color=11/thick=2/i=1:100/j=1:100 cos(i/10)+sin(j/14), cos(i/20)-sin(j/30)
+ 
+polygon/thick=3/color=12/palette=purple {1,2,1}, {2,1,0.5}
+ 
+contour/color=7/i=1:100/j=1:100 cos(i/10)+sin(j/14)
+contour/over/color=20/i=1:100/j=1:100 cos(i/15)+sin(j/20)
+ 
+can mode linecolors
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET               6
+ 
+! resetting line colors with cancel mode does not
+! take effect until we do a SET WIN/NEW
+ 
+plot/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+set win/new
+plot/line/i=1:100\
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+can win/all
+set win/new
+ 
+*** Running test: bn_cdf_errmsg.jnl
+! bn_cdf_errmsg.jnl
+! ACM 7/13/2006
+! test reporting of cdf error messages from OPeNDAP library v3.6.2
+ 
+set mode ignore
+ 
+! bad file names; file missing or misspelled
+use this_is_not_a_file.nc
+ 
+ 
+!! Change to another server, our server down...
+!!use  "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/nofile.cdf"
+!! Not working either as of 7/5/2007
+!! use "http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/nofile.cdf"
+ 
+!! Change to another server, this one not working 3/2012
+!! This is a valid address
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauy/dods"
+ 
+!! change the variable name to something nonexistent
+!!use "http://iridl.ldeo.columbia.edu/SOURCES/.FSU/.FULL/.tauyyyyy/dods"
+ 
+! This is a valid address
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_air.cdf"
+ 
+! change the variable name to something nonexistent
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_nothing.cdf"
+ 
+! bad server
+use  "http://noserver/a/nofile.cdf"
+ 
+! Not a netCDF file: Create an ascii file with extension .nc
+ 
+list/nohead/file=asc.dat {1,2,3}
+ 
+sp rm -f asc.nc
+sp mv asc.dat asc.nc
+use asc.nc
+ 
+set mode/last ignore
+ 
+*** Running test: bn600_bug_fixes.jnl
+! bn600_bug_fixes.jnl
+! test various fixes that went into version 6.00
+! 8/05 *acm*
+!
+ 
+! Bug 1129 axis formatting when /HLIM sets axis length < 0.15 deg
+GO bn_reset
+cancel mode verify
+GO err581_hlim_axislab.jnl
+! err581_hlim_axislab.jn
+! bug 1129
+! When longitude range is small (<0.15 deg) using /HLIMITS
+! axis labels do not have longitude labelling
+ 
+def axis/x=-180:360:180/units=degrees xfull
+def axis/y=90s:90n:90/units=degrees yfull
+fill/hlim=312.23:312.380/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ 
+!  Previously, list xaxis showed LABEL FORMAT is auto, not LONE
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 7.75E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  LABEL FORMAT=  (F8.3,'LONE')       
+ 
+! But /HLIM=312.23:312.3801/... works.
+fill/hlim=312.23:312.3801/vlim=37.03:40.91 0*x[gx=xfull] * y[gy=yfull]
+ppl list xaxis
+
+
+         XAXIS QUALITIES
+         LO= 3.12E+02 HI= 3.12E+02 TIC= 2.00E-02 LEN= 7.75E+00 CSIZE= 1.00E-01
+          TOP AXIS= ON  BOTTOM AXIS= ON 
+         MANUAL  NORMAL NMTC=  0 LINT=  2 LABEL= -1 NSIG=  2 NTIC= 10
+         XORG= 1.38E+00  LABEL FORMAT=  (F8.2,'LONE')       
+ 
+! Bug 1275 stray characters appear in data lines listing string data
+GO bn_reset
+cancel mode verify
+GO err581_list_stray_chars.jnl
+! err581_list_stray_chars.jnl
+! 8/2005 (acm) bug 1275  stray characters in data listing
+!   (they are leftovers from the buffer containing the header line, was not reinitialized)
+!   Also fix the header line so characters are chopped off less.
+ 
+let id = {1, 2, 3, 4}
+let country = {"US", "US", "XX", "CN"}
+let type = {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ 
+list/i=1:5 id, type, country
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+ Column  3: COUNTRY is {"US", "US", "XX", "CN"}
+            ID       TYPE     COUNTRY
+1   / 1:  1.000 "MOORED BUOY" "US"
+2   / 2:  2.000 "MOORED BUOY" "US"
+3   / 3:  3.000 "MOORED BUOY" "XX"
+4   / 4:  4.000 "MOORED BUOY" "CN"
+ 
+list/i=1:5 id, country, type
+             X: 0.5 to 4.5
+ Column  1: ID is {1, 2, 3, 4}
+ Column  2: COUNTRY is {"US", "US", "XX", "CN"}
+ Column  3: TYPE is {"MOORED BUOY", "MOORED BUOY", "MOORED BUOY", "MOORED BUOY"}
+            ID  COUN      TYPE
+1   / 1:  1.000 "US" "MOORED BUOY"
+2   / 2:  2.000 "US" "MOORED BUOY"
+3   / 3:  3.000 "XX" "MOORED BUOY"
+4   / 4:  4.000 "CN" "MOORED BUOY"
+ 
+ 
+ 
+! pattern matching for SHO FUNC failed to match all EF's
+GO bn_reset
+cancel mode verify
+GO err581_sho_func_pattern_match.jnl
+! err581_sho_func_pattern_match.jnl
+! bug 1186
+! 8/2006
+! Pattern matching for SHOW FUNCTION did not match *str  or *str*
+! on external functions.
+ 
+! Should list SIN and ASIN
+sh func *sin
+SIN(theta)
+    theta: angle (radians)
+ASIN(X)
+    arcsin(X) in radians
+    X: ABS(X) must be less than or equal to 1
+! SHOULD list ELEMENT_INDEX, ELEMENT_INDEX_STRING, IS_ELEMENT_OF, IS_ELEMENT_OF_STR
+sh func *element*
+ELEMENT_INDEX(VAR,VALUES)
+    Return index value in ARG2 for each point in ARG1
+    VAR: Variable
+    VALUES: list of indices
+ELEMENT_INDEX_STR(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case insensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+    Return index value in ARG2 for each string in ARG1 (case sensitive matching)
+    VAR: string data to mask (STRING)
+    STRINGS: list of strings to match (STRING)
+IS_ELEMENT_OF(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in argument 2, else 0
+    VAR: data to test
+    VALUES: values to search for
+IS_ELEMENT_OF_STR(VAR,VALUES)
+    Returns 1 if first argument contains any of the values in 2nd argument (case sensitive), else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+    Returns 1 if 1st arg contains any of the values in 2nd arg, 2 if case-insensitve match, else 0
+    VAR: string (STRING)
+    VALUES: strings to search (STRING)
+ 
+! FILL on data with subspan modulo axis, got wrong data
+GO bn_reset
+cancel mode verify
+GO err581_subspanx_fill_bug.jnl
+! err581_subspanx_fill_bug.jnl
+! bug 900: subspan longitude axis and hlimits gets wrong data
+ 
+use coads_climatology
+save/clobber/y=0/x=130e:80w/file=err581_subspanx_fill_bug.nc sst
+can data/all; use err581_subspanx_fill_bug.nc
+ 
+set view left; shade/x=120e:80w sst  ! works correctly
+ 
+set view right; fill/x=120e:80w sst
+ 
+sh sym ppl$xmin, ppl$xmax    ! should be 131, 279
+PPL$XMIN = "131.0"
+PPL$XMAX = "281.0"
+sh sym ppl$xlow, ppl$xhigh   ! should be 165, 259
+PPL$XHIGH = "165.0"
+PPL$XLOW = "259.0"
+ 
+sp rm -f err581_subspanx_fill_bug.nc
+ 
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+GO bn_reset
+cancel mode verify
+GO err581_use_bounds.jnl
+! err581_use_bounds.jnl
+! bug 1318 Spurious error message on USE file where file has axes with bounds.
+! 8/17/05 ACM
+ 
+def axis/x xir = {1,4,6}
+def axis/y yir = {12,42,50}
+let aa = x[gx=xir]+ y[gy=yir]
+ 
+save/clobber/file=xyir.nc aa
+use xyir
+ 
+! Bug 1332 variable not scaled unless it is first variable in stepfile.
+GO bn_reset
+cancel mode verify
+GO err581_des_scale.jnl
+! err581_des_scale.jnl  bug 1332. When using a descriptor file and
+! a varriable has scale_factor and/or add_offset attributes, the
+! variable is not scaled unless it is first variable in stepfile.
+! acm 8/29/2005
+ 
+! tok_short.des behaves correctly; the stepfile in it, sstok_short.nc lists
+! variable sst first.
+ 
+! tnok_short.des, containing sstnok_short.nc results in sst NOT being scaled
+! because it is the second variable in the file.
+ 
+! Data in SST should be rescaled in both des files to values 0.1699, 0.1799, ...
+ 
+EXIT/SCRIPT   ! error in namelist record...
+ 
+! Bug 1335 Zero-contour should be dark line.
+GO bn_reset
+cancel mode verify
+GO err581_contour_zero_lev.jnl
+! err581_contour_zero_lev.jnl
+! acm 9/7/2005
+! See bug report 1335
+! Zero-contour should be dark line.
+ 
+use coads_climatology
+contour/lev=(-20,20,2) sst[L=1] - 20
+ 
+! Bug 1339, code hangs with this combination of (-INF)(INF) levels and shakey
+GO bn_reset
+cancel mode verify
+GO err581_shakey_inf.jnl
+! err581_shakey_inf.jnl
+! acm 9/7/2005
+ 
+! see bug report 1339; code hangs with this combination of (-INF)(INF) levels
+! and SHAKEY with klab_dig=0 (argument 5)
+ 
+use coads_climatology
+fill/l=1/lev=(-inf)(0,30,2)(inf)/key/set sst
+ppl shakey 1,0,.12,0,0,4,2,8,7.1,7.4
+ppl fill
+ 
+ppl/reset  ! undo the SHAKEY setting.
+ 
+ 
+! Bug 918, immediate mode parsing in IF blocks
+GO bn_reset
+cancel mode verify
+GO err581_if_conditional.jnl
+! err581_if_conditional.jnl  bug 918.
+! acm 10/2005
+! Immediate mode parsing: when in an IF block, and when
+! the IF is false and therefore not being executed.
+! Previously ferret attempted to parse the IF `a` THEN
+! but could not because LET a=1 has not been executed/
+!
+! This should skip to the end, not trying to execute anything inside the IF 0 THEN
+ 
+if 0 then
+     endif
+  endif
+endif
+ 
+say "finished the if block"
+finished the if block
+ 
+! Further tests, after this fix, we get an error
+! **ERROR: variable unknown or not in data set: DXYMIN
+! The code that skips statements inside the IF false THEN
+! was bumping a stack on the internal IF statement...
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+ 
+ 
+! try yet another test with a nested block if, not executed.
+ 
+define symbol xend -180
+let key_flag = 0
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+  ENDIF
+ENDIF
+let dxymin = 0.20
+if `dxymin lt 0.12` then
+ !-> if 0 then
+elif `dxymin lt 0.25` then
+ !-> elif 1 then
+  SAY "point G"
+point G
+endif
+ 
+! an entire IF ELSE ENDIF inside an IF clause which is not to be executed
+ 
+IF `($xend) GT 360` THEN
+ !-> IF 0 THEN
+   ENDIF
+ELSE
+  say "this is the ELSE that should execute"
+this is the ELSE that should execute
+ENDIF
+ 
+! ELIF examples
+ 
+go non_std_refmap 122.0 228.5 5 5 xline 0
+ 
+! std_refmap.jnl -- requires Ferret V4.3 or later
+! 5/96
+ 
+! Mods 6.98 *jd/sh* to improve the aspect ratio of the refmap for t and z
+! profiles.  Separate consideration given for each case:
+ 
+! The case of "pt_orient == tseries" which has a horizontally oriented
+! reference map, and the case of the default value for pt_orient == 0
+! (zprofile), with a vertically oriented reference map, are optimized.
+ 
+! The symbol pt_orient is set in std_gif_t.jnl.
+ 
+! 7.2004 *jmclean* add symbol and min,max functions to keep longitude region with 360 degrees
+ 
+ 
+! For example:
+!	yes? go refmap 180 230 0 20 box 1
+! and
+!	yes? go refmap 80 80 0 20 yline 2
+! and
+!	yes? go refmap 70 90 0 20 yline 2 1
+! and
+!	yes? go refmap 30 180 30 30 xline 2
+! and
+!	yes? go refmap 30 180 20 60 xline 2 0 1
+! and
+!	yes? go refmap 180 180 -40 -40 point 2
+! and
+!	yes? go refmap 20 180 -40 60 point 2 1 1
+ 
+! Description: draw a reference map with region indicated
+ 
+! arguments:	     1    2    3    4    5     6        7         8
+! Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress
+ 
+! mins and maxs should be numerical values for lat/long
+! type - may be "box", "xline", "yline", or "point" (default: "box")
+! xcompress - may be 1 (indicating that X compression is applied or 0
+!		(default: "0")
+ 
+! e.g. to indicate a Y line in which X compression has been applied send
+! type="yline" and xcompress="1"
+ 
+! this script assumes that the viewport has already been set
+ 
+! NOTE:  MAGNIFY FACTOR
+! The argument magnify determines what resolution of land mask is used.
+ 
+!       magnify = 1 - INT(LOG(fraction)/LOG(2))
+!               then clip magnify to the interval [1 to 5]
+ 
+! check the region arguments
+let refmap_xmin = $1%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmin = 122.0
+let refmap_xmax = $2%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_xmax = 228.5
+let refmap_ymin = $3%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymin = 5
+let refmap_ymax = $4%<Usage: GO refmap xmin xmax ymin ymax type magnify xcompress ycompress%
+ !-> DEFINE VARIABLE refmap_ymax = 5
+ 
+! set default args
+DEFINE SYMBOL refmap_type $5%box|xline|yline|box|point|%
+ !-> DEFINE SYMBOL refmap_type xline
+DEFINE SYMBOL refmap_xcompress $7%0%
+ !-> DEFINE SYMBOL refmap_xcompress 0
+DEFINE SYMBOL refmap_ycompress $8%0%
+ !-> DEFINE SYMBOL refmap_ycompress 0
+ 
+! set the layout in the viewport
+! (for performance the code from margins can be inserted in here and optimized)
+! GO margins blah blah
+ 
+! determine the lat/long limits to plot
+set region/x=$1:$2/Y=$3:$4
+ !-> set region/x=122.0:228.5/Y=5:5
+ 
+! Keep longitude region within 360 degrees. Supposes that xhi-xlo <= 360
+def sym ref_dx = `(360-ABS($2-$1))/2`
+ !-> def sym ref_dx = 126.75
+ 
+IF ($refmap_type%|box>1|*>0%) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0%) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  define region/default/dy=$6"-30:30|1>-30:30|*>-20:20"/dx=$6"0:0|1>0:0|2>0:0|*>`max(-($ref_dx),-50)`:`min(($ref_dx),50)`" band
+ !-> define region/default/dy=-20:20/dx=-50:50 band
+ 
+ELIF ($refmap_type%|yline>1|*>0%) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+   ENDIF
+ENDIF
+! init the land mask data set
+set data coads_climatology
+set region/L=1
+! draw gray shaded continents
+! known potential bug: if X region begins at, say, 0E then magnification 3
+!	or greater results in negative modulo subscripts
+ 
+shade/lev=(0,10000,10000)/nokey/nolab/palette=grey/@band/set sst
+! ==> may want various IF tests to stylize plots: tics, numbering, etc.
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+  ppl axlint 3
+  ppl shade
+  ppl axlint 2
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+ENDIF
+ 
+! some clean up now to assist with repeated testing
+cancel region band
+ 
+set data coads_climatology
+set region/L=1
+ 
+! draw a thick red region marker on the reference map
+let refmap_xrng = IF i EQ 1 THEN refmap_xmin ELSE refmap_xmax
+let refmap_yrng = IF i EQ 1 THEN refmap_ymin ELSE refmap_ymax
+let refmap_xmid = ((refmap_xmin)+(refmap_xmax))/2
+let refmap_ymid = ((refmap_ymin)+(refmap_ymax))/2
+ 
+IF ($refmap_type%|box>1|*>0) THEN    ! IF "box"
+ !-> IF 0 THEN
+ELIF ($refmap_type%|xline>1|*>0) THEN    ! ELSE IF "xline"
+ !-> ELIF 1 THEN
+ 
+  IF ($refmap_ycompress) THEN
+ !-> IF 0 THEN
+  ENDIF
+ 
+  plot/over/vs/nolab/line=8/i=1:2 refmap_xrng, refmap_ymid+(i-i)
+ 
+ELIF ($refmap_type%|yline>1|*>0) THEN    ! ELSE IF "yline"
+ !-> ELIF 0 THEN
+  ENDIF
+  ENDIF
+ENDIF
+ 
+ 
+palette rainbow
+ 
+! Bug 899
+! Ungraceful STOP if we asl for multi-var transformations on axis where there is no data
+GO bn_reset
+cancel mode verify
+GO err581_illegal_trans.jnl
+! err581_illegal_trans.jnl
+! Ungraceful STOP if we do @VAR on an axis where there is no data
+ 
+set mode ignore_error
+use coads_climatology
+shade sst[x=@var,k=@var]
+ 
+shade sst[t=@AVE,Z=@ave]
+can mode ignore_error
+ 
+ 
+! Bug 491
+! missing flag gets scaled by scale and offset factors!
+GO bn_reset
+cancel mode verify
+GO err581_missing_scale_off.jnl
+! err581_missing_scale_off.jnl
+! ACM 11/8/05
+! Bug 491 was not correctly fixed... missing flag was scaled with scale, offset
+! attribute values.
+ 
+! data contains missing value flag of -999 and scale of 0.1
+! Previously this resulted in data values of -99 where should be missing.
+ 
+use missing_scale_off.nc
+say `tt,return=bad`
+ !-> MESSAGE/CONTINUE -999
+-999
+list tt
+             VARIABLE : 1 + 0*T[GT=DAYT]
+             FILENAME : missing_scale_off.nc
+             SUBSET   : 10 points (TIME)
+ 01-JAN-1990 00 /  1:  0.100
+ 02-JAN-1990 00 /  2:  0.200
+ 03-JAN-1990 00 /  3:  0.300
+ 04-JAN-1990 00 /  4:   ....
+ 05-JAN-1990 00 /  5:  0.500
+ 06-JAN-1990 00 /  6:  0.600
+ 07-JAN-1990 00 /  7:  0.700
+ 08-JAN-1990 00 /  8:   ....
+ 09-JAN-1990 00 /  9:  0.900
+ 10-JAN-1990 00 / 10:  1.000
+ 
+ 
+! bug 1363
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+GO bn_reset
+cancel mode verify
+GO err581_cal_dates_output.jnl
+! err581_cal_dates_output.jnl
+! bug 1363:
+! SHOW GRID and other output have wrong dates, non-std calendar axesv
+ 
+! create a time axis with 360-day calendar
+def axis/t=1-jan-2000:1-jan-2005:1/units=months/cal=d360/t0=1-jan-1960 t360
+let t3 = t[gt=t360]
+save/clobber/file=t3file.nc t3
+can var/all
+can axis t360
+ 
+! Bug showed date range of 30-JUL-2000 to  26-AUG-2005
+set data t3file
+sho grid t3
+    GRID GCG1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ T360      TIME                61 r   01-JAN-2000 00:00    01-JAN-2005 00:00
+ normal    E
+ normal    F
+ 
+! bug 1365
+! STOP on shade command when modulo-regridding a time-limited nonstd calendar
+GO bn_reset
+cancel mode verify
+GO err581_noleap_mod.jnl
+! err581_noleap_mod.jnl
+! This is bug 1365: STOP on shade command
+! when modulo-regridding a time-limited NOLEAP calendar
+ 
+use gt4d011.cdf
+set axis/cal=noleap `u,return=taxis`
+ !-> set axis/cal=noleap TIME1
+let a = u[t=1-sep-1982:1-jan-1983]
+def axis/t/edge/mod/cal=noleap/unit=days/t0=1-jan-0001 mon_irreg_nlp = {0,31,59,90,120,151,181,212,243,273,304,334,365}
+ 
+let a_clim = a[gt=mon_irreg_nlp at mod]
+shade/y=0/k=1 a_clim
+ 
+ 
+! bug 1392
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_cancel_data.jnl
+! err581_cancel_data.jnl
+ 
+!  test fixes for bug 1392:
+!  cancel data 0000_a.nc
+!  cancel data with a pathname, not just the dataset name
+ 
+let a = {1,5,6}
+save/clobber/file=0000_a.nc a
+set data 0000_a.nc
+can data 0000_a
+ 
+sp rm -f subdir/a.dat
+sp mkdir -p subdir
+ 
+save/clobber/file="subdir/a.nc" a
+use "subdir/a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can data "subdir/a.nc"
+sh data
+     currently SET data sets:
+save/clobber/file="subdir/0000_a.nc" a
+set data "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+    1> subdir/0000_a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        {1,5,6}                          1:3       ...       ...       ...       ...       ...
+ 
+can dat 0000_a
+set data "subdir/0000_a.nc"
+can dat 0000_a.nc
+sh data
+     currently SET data sets:
+set data "subdir/0000_a.nc"
+can dat "subdir/0000_a.nc"
+sh data
+     currently SET data sets:
+ 
+sp rm -f subdir/a.nc
+sp rm -f subdir/0000_a.nc
+ 
+! bug 1394
+! parsing time units of "months_since_event"
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_since_units.jnl
+! err581_since_units.jnl
+! bug 1394: units of months_since_event
+! the "since" causes Ferret to try to parse "event" as a
+! date for time origin.  Change so that if its not a date,
+! we just keep the whole units string.
+! also increase length of strings in line_units array.
+ 
+def axis/t=1:3:1/unit="months_since_event" tax
+let a = t[gt=tax]
+save/clobber/file=a.nc a
+ 
+can var a
+can ax tax
+use a
+say `a,ret=tunits`
+ !-> MESSAGE/CONTINUE months_since_event
+months_since_event
+list a
+             VARIABLE : T[GT=TAX]
+             FILENAME : a.nc
+             SUBSET   : 3 points (T (months_since_event))
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+ 
+ 
+! bug 1395
+! parsing exponent expressions: 1.0e-5+0*7 misinterpreted
+! CANCEL DATA errors
+GO bn_reset
+cancel mode verify
+GO err581_exp_spaces.jnl
+! err581_exp_spaces.jnl
+! bug 1395
+! Expressions with an exponent immediately followed by an operator
+! are parsed incorrectly, including the operator in the exponent:
+!
+! 1.0e-5+0*7  was parsed as (1.0e-5 + 0)* 7
+! 1.0e-5 + 0*7  was parsed correctly
+ 
+set mode ignore
+ 
+list 1.0e-5+ 0*7
+             VARIABLE : 1.0E-5+ 0*7
+          1.000E-05
+list 1.0e-5 + 0*7
+             VARIABLE : 1.0E-5 + 0*7
+          1.000E-05
+list 1.0e-5+0*7
+             VARIABLE : 1.0E-5+0*7
+          1.000E-05
+list 1000.6+ 0*7
+             VARIABLE : 1000.6+ 0*7
+          1001.
+ 
+let xx= x[x=1:5]
+ 
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5 + 0*xx
+             VARIABLE : 1.0E-5 + 0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+list 1.0e-5+0*xx
+             VARIABLE : 1.0E-5+0*XX
+             SUBSET   : 5 points (X)
+ 1   / 1:  1.000E-05
+ 2   / 2:  1.000E-05
+ 3   / 3:  1.000E-05
+ 4   / 4:  1.000E-05
+ 5   / 5:  1.000E-05
+ 
+can mode ignore
+ 
+! bugs 439,1390: applying command context
+GO bn_reset.jnl
+cancel mode verify
+GO err581_command_cx.jnl
+! err590_command_cx.jnl
+! bugs 439 and 1390: the command context should apply to immed. mode evaluation
+! only for action commands, not for commands like define
+ 
+use gt4d011
+def ax/np=`temp,r=lsize`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+let n = `temp,r=lsize`
+ !-> DEFINE VARIABLE n = 25
+def ax/np=`n`/t=0:100 tax
+ !-> def ax/np=25/t=0:100 tax
+ 
+ 
+! but for an action command, the /I= should apply to the grave-accent
+! expression, correctly giving an error
+ 
+set mode ignore
+plot/i=100/k=1 temp[x=`temp,r=xend`]
+ !-> plot/i=100/k=1 temp[x=122.5W]
+ 
+can mode ignore
+ 
+! bug 1401: define 1-point axis with bounds; gets bounds wrong
+GO bn_reset.jnl
+cancel mode verify
+GO err581_define_1pt_bounds.jnl
+! err581_define_1pt_bounds.jnl
+! see bug 1401:
+ 
+! Define a multipoint axis and it works fine.  Then define a 1-point axis and
+! the result is wrong.  Then we repeat the first multipoint axis definition
+! again, and even that result is now very wrong!! Same results in both v5.81
+! for Linux and v5.70 for Irix.
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+yes? def ax/x/bounds xax = {0},{-2,2}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: 0
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+         XBOXLO  XBOXHI    X
+I / *:    -2.000  2.000  0.0000
+ 
+yes? def ax/x/bounds xax = {0,3,5},{-2,2,2,4,4,6}
+yes? list xboxlo[gx=xax],xboxhi[gx=xax],x[gx=xax]
+             X: -2 to 6
+ Column  1: XBOXLO is XBOXLO (axis XAX)
+ Column  2: XBOXHI is XBOXHI (axis XAX)
+ Column  3: X is X (axis XAX)
+        XBOXLO  XBOXHI    X
+0   / 1: -2.000  2.000  0.000
+3   / 2:  2.000  4.000  3.000
+5   / 3:  4.000  6.000  5.000
+ 
+! Bug in strrindex when 1st argument is a list of strings
+GO bn_reset.jnl
+cancel mode verify
+GO err581_strrindex.jnl
+! err581_strrindex.jnl
+! 5/2/2006
+! Bug in strrindex when 1st argument is a list of strings
+! This resulted in a crash
+ 
+let var = {"strings", "a.b", "cs.ds", "mmm", "amss.ffst"}
+list strrindex(var,"s")
+             VARIABLE : STRRINDEX(VAR,"s")
+             SUBSET   : 5 points (X)
+ 1   / 1:  7.000
+ 2   / 2:  0.000
+ 3   / 3:  5.000
+ 4   / 4:  0.000
+ 5   / 5:  8.000
+ 
+! POLYGON/LINE over a depth axis.
+GO bn_reset.jnl
+cancel mode verify
+GO err581_poly_rev.jnl
+! err581_poly_rev.jnl
+! POLYGON/LINE mis-locates the line when there is a depth or
+! other reversed axis. Bugs 842, 843, 844
+! ACM 8/10/2006
+ 
+! From Patrick, polygon/line on a depth axis
+ 
+set mem /size=200
+ 
+use gt4d011
+ 
+shade temp[i=@ave,l=1]
+ 
+let v1={-3,2,0.5,2}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+! Overlay sample data over a variable with a depth axis
+! /line=1 did not work
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! XZ plot
+shade temp[j=@ave,l=1]
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! ZT plot
+shade temp[i=@ave,j=@ave]
+let v1={22800,23500,24800,26000}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+ 
+go polymark poly/lev=(-5,30,1)/pal=white/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+! And, from Andrew with other reversed axes.
+ 
+yes? ppl cross 1
+yes? plot/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+yes? poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+ppl cross 0
+ 
+set mem /size=25.6
+ 
+ 
+*** Running test: bn601_bug_fixes.jnl
+! bn601_bug_fixes.jnl
+! test various fixes that went into version 6.01
+! 20-Sep-2006 ACM
+!
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+GO bn_reset
+cancel mode verify
+GO err600_long_bounds_name
+! err600_long_bounds_name.jnl
+! Long name for bounds attribute was not read by Ferret
+! Bug 1443
+! 20-Sep-2006 ACM
+ 
+ 
+def axis/x/bounds layer_between_two_pressure_difference_from_ground = {0,3,5},{-6,2,2,4.5,4.5,9}
+let var = x[gx=layer_between_two_pressure_difference_from_ground] + 1
+ 
+save/clobber/file=a.nc var
+can var/all
+ 
+! previously the following generated an error
+use a
+list  x[gx=var], xbox[gx=var], xboxlo[gx=var], xboxhi[gx=var]
+             DATA SET: ./a.nc
+             X: -6 to 9
+ Column  1: X is X (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  2: XBOX is XBOX (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  3: XBOXLO is XBOXLO (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+ Column  4: XBOXHI is XBOXHI (axis LAYER_BETWEEN_TWO_PRESSURE_DIFFERENCE_FROM_GROUND)
+             X   XBOX  XBOXLO XBOXHI
+0   / 1:  0.000  8.000 -6.000  2.000
+3   / 2:  3.000  2.500  2.000  4.500
+5   / 3:  5.000  4.500  4.500  9.000
+ 
+ 
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+GO bn_reset
+cancel mode verify
+GO err600_check_bounds_regular.jnl
+! err600_check_bounds_regular.jnl
+! Previously TM_CHECK_BNDS had not been used to check bounds on regular axes.
+! bug1434
+ 
+! 19-Sep-2006 ACM
+ 
+use coads_climatology
+save/clobber/l=1/j=45/file=b.nc/bounds sst
+can data/all
+use b
+ 
+! previously had errors:
+! bounds COADSX_bnds do not enclose point on axis COADSX
+! Substituting coordinate midpoints
+ 
+! Long values for symbols: previously symbol strings were cut off at 255 characters.
+! Bug 1439
+GO bn_reset
+cancel mode verify
+GO err600_long_symbol_string.jnl
+! err600_longsym_symbol_string.jnl
+! Long values for symbols: previously strings were cut off at 255 characters.
+! Bug 1439
+! 20-Sep-2006 ACM
+ 
+! Define a long symbol and use it in a function call
+ 
+DEFINE SYMBOL longsym_a = "........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310"
+DEFINE SYMBOL longsym_b = "300.......310"
+SHOW SYMBOL longsym_a, longsym_b
+LONGSYM_A = ""........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310""
+LONGSYM_B = ""300.......310""
+ 
+LIST STRINDEX(($longsym_a),($longsym_b))
+ !-> LIST STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310","300.......310")
+             VARIABLE : STRINDEX("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170
+          298.0
+ 
+! Now define a symbol from a file variable
+use "longtitle1000.nc"
+DEFINE SYMBOL longsym_1000 = "`a,return=dsettitle`"
+ !-> DEFINE SYMBOL longsym_1000 = "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+SHOW SYMBOL longsym_1000
+LONGSYM_1000 = ""
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+DEFINE SYMBOL longsym_very_long = strcat (($longsym_a), ($longsym_1000))
+ !-> DEFINE SYMBOL longsym_very_long = strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+SHOW SYMBOL longsym_very_long
+LONGSYM_VERY_LONG = "strcat ("........10........20........30........40........50........60........70........80........90.......100.......110.......120.......130.......140.......150.......160.......170.......180.......190.......200.......210.......220.......230.......240.......250.......260.......270.......280.......290.......300.......310", "
+123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 [...]
+ 
+CANCEL SYMBOL longsym*
+ 
+! Global missing-value flag for dataset was not initialized and so was
+! set to 0 when there was no global attribute in the file
+! bug 1445
+GO bn_reset
+cancel mode verify
+GO err600_missing_flag.jnl
+! noglobalhistory.nc has no global history attribute, and
+! also the variable B has no missing or fill value flag
+! Bug 1445: the missing-value flag got set to 0: (data values are 0,1,2,3)
+ 
+use noglobalhistory.nc
+list b
+             VARIABLE : {0,1,2,3}
+             FILENAME : noglobalhistory.nc
+             SUBSET   : 4 points (X)
+ 1   / 1:  0.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  3.000
+ 
+! should be 0,1,2,3; bug had first value missing.
+ 
+ 
+! err600_returnsize.jnl
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+GO bn_reset
+cancel mode verify
+GO err600_returnsize.jnl
+! err600_returnsize.jnl
+! ACM 10-4-2006
+! bug 1447, where say `var[d=fname.cdf],return=size` failed
+! ( a parsing error, confusing the dot in the filename with dot in `var.att,return=size` )
+ 
+ 
+use coads_climatology.cdf
+ 
+say `sst[d=coads_climatology.cdf],return=size`
+ !-> MESSAGE/CONTINUE 48600
+48600
+say `sst.units,return=size`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+define symbol the_x_axis = `sst,return=xaxis`
+ !-> define symbol the_x_axis = COADSX
+say `(($the_x_axis)).units,return=size`
+ !-> MESSAGE/CONTINUE 12
+12
+ 
+! err600_if_comments_tab.jnl
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+GO bn_reset
+cancel mode verify
+GO err600_if_comments_tab.jnl
+! err600_if_comments_tab.jnl
+! ACM 10-4-2006
+! bug 1446  When there is a tab before a comment, the parsing gets
+! thrown off and we got an error about an invalid ENDIF
+ 
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! Here there is a tab before the ! which throws off the parsing...
+IF 0 THEN
+   ENDIF
+ENDIF
+ 
+! err600_set_var_title.jnl
+! Bug 1454 Settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+GO bn_reset
+cancel mode verify
+GO err600_set_var_title.jnl
+! err600_set_var_title.jnl
+! Bug 1454
+! The settings made by SET VAR/TITLE=/UNITS= were not saved in output file
+! ACM 10/11/06
+ 
+! check the variable name and title in the list command output
+use gtbc011
+list/y=1/k=1/l=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+set var/title="Temp"/units="DegC" temp
+list/y=1/k=1/l=1 temp  ! new title and units
+             VARIABLE : Temp (DegC)
+             FILENAME : gtbc011.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+                0.83N 
+                48
+ 160.5W / 70:  31.20
+ 159.5W / 71:  31.34
+ 158.5W / 72:  31.45
+ 
+save/file=a.nc/clobber temp
+can data/all
+use a.nc
+! This listing should have the NEW var title and units
+ list/y=1/k=1/l=1 temp
+             VARIABLE : Temp (DegC)
+             FILENAME : a.nc
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+               0.83N 
+               48
+ 160.5W / 1:  31.20
+ 159.5W / 2:  31.34
+ 158.5W / 3:  31.45
+ 
+! err600_var_label.jnl
+! bug1442 If there is no long_name attribute, the plot should
+! be labelled with the var name but it only has units label
+GO bn_reset
+cancel mode verify
+GO err600_var_label.jnl
+! err600_var_label.jnl
+! bug1442
+! If there is no long_name attribute, the plot or listing
+! should be labeled with the var name but it has only the units
+ 
+use gtbc011
+ 
+! line VARIABLE has longname (units)  which is TEMPERATURE (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gtbc011.cdf
+             LONGITUDE: 160.5W
+             LATITUDE : 5.2S
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+          29.54
+ 
+! Write, without the long_name attribute.
+can att/output temp.long_name
+save/file=a.nc/clobber temp
+ 
+can data/all
+use a.nc
+sh att/all temp
+     attributes for dataset: ./a.nc
+ TEMP.missing_value = -1.E+34
+ TEMP._FillValue = -1.E+34
+ TEMP.history = From gt160w011 
+ TEMP.units = deg. C 
+ 
+! Label should be variablename (units) which is TEMP (deg. C)
+list/i=70/l=1/j=30/k=1 temp
+             VARIABLE : TEMP (deg. C)
+             FILENAME : a.nc
+             LONGITUDE: 159.5W(6320.5)
+             LATITUDE : 5.2S
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 10:00
+          29.72
+ 
+! err600_upcase.jnl
+! Bug 1461 upcasing of axis name on creating bounds variable for output
+GO bn_reset
+cancel mode verify
+GO err600_upcase.jnl
+ ! err600_upcase.jnl
+ ! 10/23/2006
+ ! acm
+ ! bug 1461: bounds variable is created for netcdf output with upcased axis name,
+ !           but cd_write_var looked for it with original lowercase axis name.
+ 
+SET MODE ignore_error
+ 
+USE err600_upcase.nc
+SAVE/CLOBBER/FILE=b.nc v
+ 
+! this was the workaround for v6.0. After the fix this works the same as the above
+CANCEL MODE upcase
+SAVE/CLOBBER/FILE=b.nc v
+ 
+SET MODE/LAST upcase_output
+SET MODE/LAST ignore_error
+ 
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension names from the attribute
+! structure fail, and the list of variable names was incorrect.
+GO bn_reset
+cancel mode verify
+GO err600_let_d.jnl
+! err600_let_d.jnl
+! Making a LET/D= assignment caused the return of dimension
+! names from the attribute structure fail, and the list of
+! variable names was incorrect.
+! 28-Nov-2006
+ 
+use levitus_climatology
+let/d=levitus_climatology temp_20 = temp[d=levitus_climatology,z=0:20 at sum]
+list ..dimnames
+             VARIABLE : ..DIMNAMES
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:"XAXLEVITR1_160"
+ 2   / 2:"YAXLEVITR1_90" 
+ 3   / 3:"ZAXLEVITR1_1"  
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : levitus_climatology.cdf
+        "TEMP"
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.2N to 59.2N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+ 
+! Bug 1470; redefine or reset attributes of an axis
+! should change the axis definition and its attributes
+! in the attribute structure.
+GO bn_reset
+cancel mode verify
+GO err600_reset_redefine_axis.jnl
+! err600_reset_redefine_axis.jnl
+! Bug 1470; redefine or reset attributes of an axis
+!   should change the axis definition and its attributes
+!   in the attribute structure.
+ 
+use coads_climatology
+def sym timeax = `sst,return=taxis`
+ !-> def sym timeax = TIME4
+ 
+show att/all ($timeax)
+ !-> show att/all TIME4
+show axis ($timeax)
+ !-> show axis TIME4
+ name       axis              # pts   start                end
+ TIME4     TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+define axis/t0=1-jan-0001/t=1:3:1/unit=months ($timeax)
+ !-> define axis/t0=1-jan-0001/t=1:3:1/unit=months TIME4
+show att/all ($timeax)
+ !-> show att/all TIME4
+show axis ($timeax)
+ !-> show axis TIME4
+ name       axis              # pts   start                end
+ TIME4     TIME                 3 r   31-JAN-0001 10:29    02-APR-0001 07:27
+T0 = 1-JAN-0001
+   Axis span (to cell edges) = 3
+ 
+! Changing axis with the SET AXIS command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+ 
+set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days ($timeax)
+ !-> set ax/modulo/calendar=noleap/t0=1-jan-1900/units=days TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25mr   14-MAR-1962 00:00    19-OCT-1971 00:00
+T0 = 1-JAN-1900
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 3650 (modulo length = axis span)
+ 
+ 
+! Changing axis with the CANCEL AXIS/ command
+ 
+can data/all
+use gt4d011
+def sym timeax = `temp,return=taxis`
+ !-> def sym timeax = TIME11
+def sym zax = `temp,return=zaxis`
+ !-> def sym zax = PSZT
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($zax)
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      DEPTH (m)           27 i-  5                    3824
+   Axis span (to cell edges) = 4149
+ 
+cancel axis/modulo ($timeax)
+ !-> cancel axis/modulo TIME11
+show att/all ($timeax)
+ !-> show att/all TIME11
+show axis ($timeax)
+ !-> show axis TIME11
+ name       axis              # pts   start                end
+ TIME11    TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+T0 = 14-JAN-1980 14:00:00
+   Axis span (to cell edges) = 3650
+cancel axis/depth ($zax)
+ !-> cancel axis/depth PSZT
+show att/all ($zax)
+ !-> show att/all PSZT
+show axis ($zax)
+ !-> show axis PSZT
+ name       axis              # pts   start                end
+ PSZT      Z (METERS)          27 i   5                    3824
+   Axis span (to cell edges) = 4149
+ 
+ 
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and an attribute
+! orig_file_axname keeps the input name.
+GO bn_reset
+cancel mode verify
+GO err600_ferret_axis_names.jnl
+! err600_ferret_axis_names.jnl
+! If Ferret needed to rename an axis on file initialization for uniqueness,
+! we now keep that new name in the attr structure, and add an attribute
+! orig_file_axname with the input name. That orig name is used only on output.
+ 
+def axis/t=1:5:1 time
+use coads_climatology
+ 
+! Note TIME1 with attribute orig_file_axname
+sh dat/att
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V4.91 (GUI)  1-Mar-99
+  
+(COADSX)               DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSX
+  
+(COADSY)               DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 orig_file_axnameCHAR        6    F       COADSY
+  
+(TIME5)                DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        19   T       1-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+save/clobber/bounds/file=a.nc/x=181/y=1 sst
+ 
+can data/all
+use gt4d011
+save/clobber/file=t2.nc temp[L=2:6]
+save/clobber/file=t12.nc temp[L=12:16]
+can data/all
+ 
+use t2.nc; use t12.nc
+ 
+sho dat/att
+     currently SET data sets:
+    1> ./t2.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME11)               DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+    2> ./t12.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(PSXT91_108)           DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        10   F       PSXT91_108
+  
+(PSYT35_56)            DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 bounds          CHAR        14   T       PSYT35_56_bnds
+                                 orig_file_axnameCHAR        9    F       PSYT35_56
+  
+ PSYT35_56_bnds        DOUBLE
+  
+(PSZT11_10)            DOUBLE    units           CHAR        6    T       meters
+                                 positive        CHAR        4    T       down
+                                 point_spacing   CHAR        6    T       uneven
+                                 axis            CHAR        1    T       Z
+                                 standard_name   CHAR        5    F       depth
+                                 bounds          CHAR        14   T       PSZT11_10_bnds
+                                 orig_file_axnameCHAR        9    F       PSZT11_10
+  
+ PSZT11_10_bnds        DOUBLE
+  
+(TIME111)              DOUBLE    units           CHAR        30   T       hour since 1980-01-14 14:00:00
+                                 time_origin     CHAR        20   T       14-JAN-1980 14:00:00
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        6    F       TIME11
+  
+ TEMP                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        11   T       TEMPERATURE
+                                 history         CHAR        12   T       From gt4d011
+                                 units           CHAR        6    T       deg. C
+  
+ 
+! err600_tab_comma_missingdat.jnl
+! when data contains missing values list/format=comma or list/format=tab
+! should output a comma or tab as placeholder for the missing value
+GO bn_reset
+cancel mode verify
+GO err600_tab_comma_missingdat.jnl
+! err600_tab_comma_missingdat.jnl
+! 11/21/2006 acm
+ 
+! when data contains missing values: extra comma as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=comma a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A,B
+1   / 1:1,4  
+2   / 2:1,4  
+3   / 3:2,4  
+4   / 4:1,4  
+5   / 5:1,4  
+6   / 6:2,4  
+7   / 7:1,4  
+8   / 8:1,4  
+list/form=comma a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A,B,A
+1   / 1:1,4,1  
+2   / 2:1,4,1  
+3   / 3:2,4,2  
+4   / 4:1,4,1  
+5   / 5:1,4,1  
+6   / 6:2,4,2  
+7   / 7:1,4,1  
+8   / 8:1,4,1  
+ 
+! when data contains missing values: extra tab as placeholder
+let a = {1,1,2,1,1,2,1,1}
+let b = {4,4,4,4,4,4,4,4}
+set var/bad=2 a
+list/form=tab a,b
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+       A	B
+1   / 1:1	4  
+2   / 2:1	4  
+3   / 3:2	4  
+4   / 4:1	4  
+5   / 5:1	4  
+6   / 6:2	4  
+7   / 7:1	4  
+8   / 8:1	4  
+list/form=tab a,b,a
+             X: 0.5 to 8.5
+ Column  1: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+ Column  2: B is {4,4,4,4,4,4,4,4}    BAD FLAG : -1.E+34
+ Column  3: A is {1,1,2,1,1,2,1,1}    BAD FLAG : 2
+       A	B	A
+1   / 1:1	4	1  
+2   / 2:1	4	1  
+3   / 3:2	4	2  
+4   / 4:1	4	1  
+5   / 5:1	4	1  
+6   / 6:2	4	2  
+7   / 7:1	4	1  
+8   / 8:1	4	1  
+ 
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+GO bn_reset
+cancel mode verify
+GO err600_vec_aspect.jnl
+! err600_vec_aspect.jnl
+! VECTOR/ASPECT plots are wrong (incorrect fix for bug 1348)
+! 12/04/2006
+ 
+use gt4d011.cdf
+vec/k=1/l=1 u,v
+vec/over/asp/k=1/l=1 u,v
+ 
+! Irregular axes
+ 
+def axis/from_data/x/name=xirr/units=deg/modulo  {0,1,2,4,6,7,8,10,14,16,20,23,24}
+def axis/from_data/y/name=yirr/units=deg  {0,2,4,5,6,7,8,9,12,13,14,15,18}
+let a = 0.1*x[gx=xirr] + 4*y[gy=yirr]
+let b = 3*x[gx=xirr] + y[gy=yirr]
+vec a,b
+vec/asp/over a,b
+ 
+! err600_save_two.jnl
+! Bug 1478: save two variables with the same time axis to a file, error
+! when checking whether 2nd variable has same grid.
+GO bn_reset
+cancel mode verify
+GO err600_save_two.jnl
+! err600_save_two.jnl
+! 12/11/2006
+! Bug 1478: save two variables with the same time axis to a file.
+! got error attempt to redefine line; axis TIME doesnt match CDF file
+! This was due to upcasing of output axis TIME, which needed to be upcased
+! before checking whether record axis of the second variable matched the
+! one just written to the output file.
+ 
+use "a1478.nc"
+use "b1478.nc"
+save/clobber/file="out.nc" olr[d=1], swdn_toa[d=2]
+ 
+! err600_nc_des_order.jnl
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+GO bn_reset
+cancel mode verify
+GO err600_nc_des_order.jnl
+! err600_nc_des_order.jnl
+! 11/07/2006 ACM
+!
+! Bug 1459 order of multiple descriptor file opening causes netCDF error
+! The bug results in:
+!  ** netCDF error: NCSYSERR
+! Due to incorrect resetting of sf_lunit in cd_init_dset.F
+ 
+set data tok_short.des
+set data ss_small.nc
+set data mc_test.des
+set data sstok_short.nc
+ 
+stat rose[d=2]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.2N to 59.2N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 2576 (46*56*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -592
+ Maximum value: 3005
+ Mean    value: 436.64 (unweighted average)
+ Standard deviation: 563.43
+ 
+can data/all
+ 
+set data/form=cdf "ss_small.nc"
+set data/form=cdf "sstok_short.nc"
+SET DAT/FORM=CDF "mc_test.des"
+ 
+stat rose[j=12,d=1]
+ 
+             Surface relief
+             LONGITUDE: 137.3W(222.7) to 135.7W(224.3)
+             LATITUDE: 58.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./ss_small.nc
+ 
+ Total # of data points: 46 (46*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -168
+ Maximum value: 509
+ Mean    value: 62.717 (unweighted average)
+ Standard deviation: 156.25
+*** Running test: bn_set_strides.jnl
+! bn_set_strides.jnl
+! Jing Li, 11/2006
+! tests for SET AXIS/STRIDES
+ 
+! 1/2007 ACM change show axis/all to show commands for individual axes;
+!            When run among other benchmark tests, there are a bunch of
+!            unrelated axes already defined, which get in the way of
+!            seeing the desired output.
+ 
+set mode ignore_error
+ 
+!..............1. ignore STRIDE = 1
+use coads_climatology
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME
+ name       axis              # pts   start                end
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+set axis/stride=1/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=1/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............2. illegal to stride an already strided axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+!can't stride it again
+set axis/stride=2/offset=1 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=1 (AX005)
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           90mr   23E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel data/all
+ 
+!..............3. only set STRIDE
+use coads_climatology
+ 
+! --- before striding
+ 
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+ 
+! --- after set striding
+ 
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+list sst[i=11:15,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 11:  26.86
+ 65E   / 12:  27.29
+ 69E   / 13:  27.93
+ 73E   / 14:  28.23
+ 77E   / 15:  28.23
+ 
+ 
+! --- after cancel striding
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX004)
+list sst[i=21:30,j=50,k=1,l=50]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 9N
+             TIME     : 15-FEB-0012 14:19
+               9N    
+               50
+ 61E   / 21:  26.86
+ 63E   / 22:  27.00
+ 65E   / 23:  27.29
+ 67E   / 24:  27.69
+ 69E   / 25:  27.93
+ 71E   / 26:  28.08
+ 73E   / 27:  28.23
+ 75E   / 28:  28.32
+ 77E   / 29:  28.23
+ 79E   / 30:  27.82
+cancel data/all
+ 
+!.............4. only set OFFSET
+! ingored if you only set OFFSET
+ 
+use coads_climatology
+set axis/offset=1 `sst, return=xaxis`
+ !-> set axis/offset=1 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+ 
+!.............5. OFFSET .LE. STRIDE
+use coads_climatology
+set axis/stride=2/offset=4 `sst, return=xaxis`
+ !-> set axis/stride=2/offset=4 COADSX
+cancel data/all
+ 
+!.............6. SHOW GRID/DYNAMIC
+use coads_climatology
+set axis/stride=4/offset=2 `sst, return=xaxis`
+ !-> set axis/stride=4/offset=2 COADSX
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX001)                         use count:   1
+cancel data/all
+ 
+!.............7. cancel stride on a non-strided axis
+use coads_climatology
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride COADSX
+cancel data/all
+ 
+!.............8. striding on a modulo axis
+ 
+! --- 8.1 stride value is an integer factor of the axis length
+! the strided axis will inherit the modulo property of its parent
+ 
+use coads_climatology
+set axis/stride=6/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=6/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           30mr   31E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+ 
+!--- 8.2 stride value is not an integer factor of the axis length
+! warning: it may lose modulo property
+set axis/stride=7/offset=5 `sst,return=xaxis`
+ !-> set axis/stride=7/offset=5 COADSX
+show axis `sst,return=xaxis`
+ !-> show axis (AX001)
+ name       axis              # pts   start                end
+ (AX001)   LONGITUDE           25 r   31E                  7E(367)
+   Axis span (to cell edges) = 350
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX001)
+cancel data/all
+ 
+! --- 8.3 testing strided modulo axis
+use coads_climatology
+set axis/stride=2/offset=1 `sst,return=xaxis`
+ !-> set axis/stride=2/offset=1 COADSX
+shade/x=-180:180/y=-30:70/L=2 sst
+cancel axis/stride `sst,return=xaxis`
+ !-> cancel axis/stride (AX005)
+cancel data/all
+ 
+!.............9. two datasets share the same grid
+ 
+! --- 9.1 test: use A - use B - stride
+! use A; use B; set axis/stride=2 `var[d=A], return=axis`
+! -- will affect variables in B
+use coads_climatology
+save/clobber/file=d2.nc sst[L=1]
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+ 
+cancel data/all
+ 
+! --- 9.2 test: use A -stride -useB
+! use A; set axis/stride=2 `var[d=A], return=xaxis`; use B
+! -- will not affect variables in B
+use coads_climatology
+set axis/stride=2 `sst[d=coads_climatology], return=xaxis`
+ !-> set axis/stride=2 COADSX
+list/x=180:195/j=30/L=1 sst[d=coads_climatology]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 4 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 41:  22.53
+ 175W   / 42:  22.44
+ 171W   / 43:  21.86
+ 167W   / 44:  22.30
+use d2
+list/x=180:195/j=30/L=1 sst[d=d2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : d2.nc
+             SUBSET   : 8 points (LONGITUDE)
+             LATITUDE : 31S
+             TIME     : 16-JAN 06:00
+                31S   
+                30
+ 179W   / 81:  22.53
+ 177W   / 82:  22.71
+ 175W   / 83:  22.44
+ 173W   / 84:  22.21
+ 171W   / 85:  21.86
+ 169W   / 86:  22.07
+ 167W   / 87:  22.30
+ 165W   / 88:  22.28
+ 
+can data/all
+ 
+!.............10. strides on permuted and reversed axes
+ 
+! --- 10.1 stride on a permuted axis
+use/order=yzt coads_climatology
+show data/all
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          ...       1:180     1:90      1:3       ...       ...
+ 
+set axis/stride=5 `sst,return=yaxis`
+ !-> set axis/stride=5 COADSX
+show axis `sst,return=yaxis`
+ !-> show axis (AX005)
+ name       axis              # pts   start                end
+ (AX005)   LONGITUDE           36mr   21E                  11E(371)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+ 
+can data/all
+ 
+! --- 10.2 stride on a reversed axis -- YAXIS
+use/order=x-yt coads_climatology
+list/x=180/l=5 sst[j=1:30]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 30 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+              179E   
+               80
+ 31S   / 30:  18.47
+ 33S   / 29:  17.05
+ 35S   / 28:  15.94
+ 37S   / 27:  14.53
+ 39S   / 26:  12.83
+ 41S   / 25:  11.11
+ 43S   / 24:   8.80
+ 45S   / 23:   6.42
+ 47S   / 22:   4.83
+ 49S   / 21:   4.08
+ 51S   / 20:   3.89
+ 53S   / 19:   3.48
+ 55S   / 18:   3.20
+ 57S   / 17:   2.52
+ 59S   / 16:   1.90
+ 61S   / 15:   1.04
+ 63S   / 14:   0.14
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+set axis/stride=5/offset=3 `sst,return=yaxis`
+ !-> set axis/stride=5/offset=3 COADSY
+list/x=180/l=5  sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 18 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+              179E   
+               80
+ 87N   / 18:   ....
+ 77N   / 17:  -0.20
+ 67N   / 16:   0.06
+ 57N   / 15:   7.30
+ 47N   / 14:  13.13
+ 37N   / 13:  19.97
+ 27N   / 12:  24.01
+ 17N   / 11:  28.03
+ 7N    / 10:  29.14
+ 3S    /  9:  28.01
+ 13S   /  8:  27.10
+ 23S   /  7:  24.41
+ 33S   /  6:  17.05
+ 43S   /  5:   8.80
+ 53S   /  4:   3.48
+ 63S   /  3:   0.14
+ 73S   /  2:   ....
+ 83S   /  1:   ....
+list/x=180/l=5 sst[j=3:14:2]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+                        regrid: 20 deg on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LATITUDE)
+             LONGITUDE: 179E
+             TIME     : 15-JAN 11:49
+             179E   
+              80
+ 37N   / 6:  19.97
+ 17N   / 5:  28.03
+ 3S    / 4:  28.01
+ 23S   / 3:  24.41
+ 43S   / 2:   8.80
+ 63S   / 1:   0.14
+ 
+cancel data/all
+ 
+!.............11. stride on all axes
+use coads_climatology
+set axis/stride=2 `sst, return=xaxis`
+ !-> set axis/stride=2 COADSX
+set axis/stride=2 `sst, return=yaxis`
+ !-> set axis/stride=2 COADSY
+set axis/stride=2 `sst, return=taxis`
+ !-> set axis/stride=2 TIME
+ 
+show axis `sst,return=xaxis`
+ !-> show axis (AX007)
+ name       axis              # pts   start                end
+ (AX007)   LONGITUDE           90mr   21E                  17E(377)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis (AX004)
+ name       axis              # pts   start                end
+ (AX004)   LATITUDE            45 r   89S                  87N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis (AX001)
+ name       axis              # pts   start                end
+ (AX001)   TIME                 2 r   16-JAN-0000 06:00    17-MAR-0000 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2921.94
+ 
+can data/all
+ 
+!.............12. stride on a NORMAL axis
+set mode ignore_error
+use coads_climatology
+set axis/stride=2 `sst,return=zaxis`
+ !-> set axis/stride=2 NORMAL
+set mode/last ignore_error
+ 
+show axis `sst,return=xaxis`
+ !-> show axis COADSX
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+show axis `sst,return=yaxis`
+ !-> show axis COADSY
+ name       axis              # pts   start                end
+ COADSY    LATITUDE            90 r   89S                  89N
+   Axis span (to cell edges) = 180
+show axis `sst,return=taxis`
+ !-> show axis TIME
+ name       axis              # pts   start                end
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 2191.455 (modulo length = 8765.82)
+*** Running test: bn_lsl_lowpass.jnl
+! bn_lsl_lowpass.jnl
+! Test lsl_lowpass, now included as a statically-linked external function
+ 
+use gtsa056_2
+let my_temp = temp[x=180,y=0,k=1]
+let f_filtered = lsl_lowpass(my_temp, 40,10)
+! plot my_temp
+! plot/over f_filtered
+ 
+! List the output so its not just a graphical test;
+! Compute based on the whole T region, but just list a portion.
+LIST/L=10:20 MY_TEMP[L=1:110], F_FILTERED[L=1:110]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 10-FEB-1982 10:30 to 15-MAR-1982 21:30
+             LONGITUDE: 179.5E
+             LATITUDE: 0.2S
+             DEPTH (m): 5
+ Column  1: MY_TEMP is TEMP[X=180,Y=0,K=1]
+ Column  2: F_FILTERED is LSL_LOWPASS(MY_TEMP, 40,10)
+                    MY_TEMP  F_FILTERED
+11-FEB-1982 23 / 10:   27.50   27.51
+15-FEB-1982 00 / 11:   27.47   27.48
+18-FEB-1982 01 / 12:   27.45   27.44
+21-FEB-1982 02 / 13:   27.41   27.42
+24-FEB-1982 03 / 14:   27.37   27.40
+27-FEB-1982 04 / 15:   27.35   27.39
+02-MAR-1982 05 / 16:   27.39   27.39
+05-MAR-1982 06 / 17:   27.43   27.40
+08-MAR-1982 07 / 18:   27.41   27.41
+11-MAR-1982 08 / 19:   27.41   27.42
+14-MAR-1982 09 / 20:   27.42   27.43
+ 
+*** Running test: bn_return_xmod_tmod.jnl
+! New `var,return=xmod` `var,return=tmod`
+! Return modulo lengths, or blank if not modulo
+ 
+use ocean_atlas_temp
+sh grid temp
+    GRID GBS1
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+ YAX_LEV94 LATITUDE           180 r   89.5S                89.5N
+ ZAXLEVIT191_1 DEPTH (m)        1 r-  0                    0
+ TIME      TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+ normal    E
+ normal    F
+sh axis XAX_LEV9421_380
+ name       axis              # pts   start                end
+ XAX_LEV9421_380 LONGITUDE    360mr   20.5E                19.5E(379.5)
+   Axis span (to cell edges) = 360 (modulo length = axis span)
+sh axis time
+ name       axis              # pts   start                end
+ TIME      TIME                 2mr   16-JAN 06:00         15-FEB 16:29
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 1460.97 (modulo length = 8765.82)
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE 8765.81982421875
+8765.81982421875
+ 
+! X is modulo but not T
+use levitus_climatology.cdf
+say `temp,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+say `temp,return=tmod`
+ !-> MESSAGE/CONTINUE
+
+ 
+! Define some subspan modulo axes and check the results
+! Modulo because start year in 0000
+def ax/t=1-aug-0000:1-aug-0001/np=3/edge/units=days tsub
+let a = t[gt=tsub]
+say `a,return=tmod`
+ !-> MESSAGE/CONTINUE 365.2424926757813
+365.2424926757813
+ 
+! Modulo because defined on longitude coordinates
+define axis/x=130e:80w:10 xsub
+let a = x[gx=xsub]
+say `a,return=xmod`
+ !-> MESSAGE/CONTINUE 360
+360
+ 
+! This file has an x axis with modulo = " " so its modulo, but it
+! does not have units of degrees. Thus axis length = modulo length
+use string4d
+sh grid axy
+    GRID GMS2
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+ Y3AX      Y                    3 r   1                    3
+ Z4AX      Z                    4 r   1                    4
+ T2AX      T                    2 r   1                    2
+ normal    E
+ normal    F
+show axis x2ax
+ name       axis              # pts   start                end
+ X2AX      X                    2mr   1                    2
+   Axis span (to cell edges) = 2 (modulo length = axis span)
+say `axy,return=xmod`
+ !-> MESSAGE/CONTINUE 2
+2
+*** Running test: bn602_bug_fixes.jnl
+! bn602_bug_fixes.jnl
+! test various fixes that went into version 6.02
+! 09-Nov-2006 ACM
+ 
+! err601_sho_ax_xml_calendar.jnl
+! bug 1468: SHOW AXIS/ALL/XML listed the wrong info for the calendar
+GO bn_reset
+cancel mode verify
+GO err601_sho_ax_xml_calendar.jnl
+! err601_sho_ax_xml_calendar.jnl
+! 11/8/2006 ACM
+! bug 1468: SHOW AXIS/XML listed the wrong info for the calendar
+! when a time axis has a non-standard calendar.
+ 
+def axis/cal=noleap/t=1-jan-2000:1-jan-2002:1/units=days timenoleap
+let v = sin(t[gt=timenoleap]/100)
+save/clobber/file=noleap.nc v
+use noleap.nc
+sh axis/xml timenoleap
+<axes>
+<axis name="TIMENOLEAP">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[DAYS since 1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>731</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>2000-01-01 00:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>2002-01-01 00:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1901-01-15 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[NOLEAP]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[T]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+! err601_index_111.jnl
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4.
+GO bn_reset
+cancel mode verify
+GO err601_index_111.jnl
+ 
+! err601_index_111.jnl
+! 11/09/2006 ACM
+! bug 1463 region that points to index -111 on modulo axis confused
+! with unspecified_int4. Fixed by changing to -999.
+ 
+! x=-203 corresponds to I=-111.
+use coads_climatology
+list x[gx=sst,x=-193:-203]
+             VARIABLE : X
+                        axis COADSX
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 6 points (LONGITUDE)
+ 157E    / -111: -203.0
+ 159E    / -110: -201.0
+ 161E    / -109: -199.0
+ 163E    / -108: -197.0
+ 165E    / -107: -195.0
+ 167E    / -106: -193.0
+ 
+ 
+! err601_irregular_axis.jnl
+! Check for irregular axis actually being irregular failed; bug 1483
+GO bn_reset
+cancel mode verify
+GO err601_irregular_axis.jnl
+! err601_irregular_axis.jnl
+! V6.0 had a new scheme to check for irregular axes; for an axis
+! whose delta-coordinates vary widely this failed.  See bug 1483
+! The axis should be 6.792e-10, 1.368e-09, ..., 800, 1100, 1400
+ 
+USE z_wide_variation.nc
+SHOW GRID/Z atmos
+    GRID GOR1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ ALTITUDE  Z (Pa)              50 i   6.791595619E-10      1400
+ TIME      TIME                 1mr   01-JAN 04:00         01-JAN 04:00
+ normal    E
+ normal    F
+ 
+       K     Z                   ZBOX      ZBOXLO
+       1>  6.7915956192266E-10   6.885E-10  3.3490923923019E-10
+       2>  0.00000000136766      1.037E-09  0.00000000102341
+       3>  0.000000002754131     2.089E-09  0.000000002060896
+       4>  0.000000005546143     4.207E-09  0.000000004150137
+       5>  0.00000001116856      8.472E-09  0.000000008357353
+       6>  0.00000002249072      1.706E-08  0.00000001682964
+       7>  0.00000004529075      3.436E-08  0.00000003389074
+       8>  0.00000009120437      6.919E-08  0.00000006824756
+       9>  0.000000183663        1.393E-07  0.0000001374337
+      10>  0.000000369852        2.806E-07  0.0000002767575
+      11>  0.0000007447904       5.65E-07   0.0000005573212
+      12>  0.000001499824        1.138E-06  0.000001122307
+      13>  0.000003020274        2.291E-06  0.000002260049
+      14>  0.000006082086        4.614E-06  0.00000455118
+      15>  0.00001224782         9.291E-06  0.000009164951
+      16>  0.00002466407         1.871E-05  0.00001845594
+      17>  0.00004966735         3.768E-05  0.00003716571
+      18>  0.0001000177          7.587E-05  0.00007484254
+      19>  0.000201411           0.0001528  0.0001507144
+      20>  0.0004055919          0.0003077  0.0003035015
+      21>  0.0008167619          0.0006196  0.0006111769
+      22>  0.001644756           0.0012477  0.001230759
+      23>  0.003312133           0.0025125  0.002478445
+      24>  0.006669816           0.0050596  0.004990974
+      25>  0.01343142            0.0101889  0.01005062
+      26>  0.02704768            0.020518   0.02023955
+      27>  0.05446739            0.0413181  0.04075754
+      28>  0.1096839             0.0832044  0.08207565
+      29>  0.2208762             0.1675531  0.1652801
+      30>  0.44479               0.3374103  0.3328331
+      31>  0.8956969             0.679461   0.6702434
+      32>  1.803712              1.368287   1.349704
+      33>  3.63227               2.098144   2.717991
+      34>  6                     2.683865   4.816135
+      35>  9                     3.5        7.5
+      36>  13                    4.5        11
+      37>  18                    6          15.5
+      38>  25                    8.5        21.5
+      39>  35                    12.5       30
+      40>  50                    17.5       42.5
+      41>  70                    25         60
+      42>  100                   35         85
+      43>  140                   50         120
+      44>  200                   70         170
+      45>  280                   100        240
+      46>  400                   142.5      340
+      47>  565                   200        482.5
+      48>  800                   267.5      682.5
+      49>  1100                  300        950
+      50>  1400                  300        1250
+ 
+ 
+! err601_check_missing_3arg.jnl
+! see bug 1485, check on missing coordinates for 3-argument graphics
+GO bn_reset
+cancel mode verify
+GO err601_check_missing_3arg.jnl
+! err601_check_missing_3arg.jnl
+! see bug 1485: if missing coordinates in a curvilinear dataset, we should be
+! able to still plot other portions of the data. Check was too broad.
+ 
+! Create a dataset in curvilinear coordinates with a few missing coordinates.
+use tripolar_subset
+let lon = IF geolon_vert_t gt -276 then geolon_vert_t
+let lat = geolat_vert_t
+save/clobber/file=tripolar_missing_lon.nc lon, lat, ht
+can data/all
+can var/all
+ 
+! Use this data. If we just look at /I=50:100 the plot works ok
+use tripolar_missing_lon
+stat/i=50:100 lon
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 177E(-183) to 81W(-81)
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 1275 (51*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: -181.5
+ Maximum value: -83.015
+ Mean    value: -121.95 (unweighted average)
+ Standard deviation: 24.836
+shade/i=50:100 HT,lon,lat
+ 
+! The STAT command loads all the coordinates, then when
+! we plot, the check of coordinates looked at all of them
+! rather than just those needed. (error  was
+! X coordinates missing value where val is needed
+ 
+can mem/all
+stat LON, LAT
+ 
+             IF GEOLON_VERT_T GT -276 THEN GEOLON_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 186
+ Minimum value: -275.98
+ Maximum value: 80
+ Mean    value: -92.341 (unweighted average)
+ Standard deviation: 106.62
+ 
+             GEOLAT_VERT_T
+             LONGITUDE: 79E(-281) to 81E
+             LATITUDE: 71.5N to 90.4N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: ./tripolar_missing_lon.nc
+ 
+ Total # of data points: 4525 (181*25*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 64.383
+ Maximum value: 90
+ Mean    value: 74.619 (unweighted average)
+ Standard deviation: 5.9864
+shade/i=50:100 HT,lon,lat
+ 
+sp rm -f tripolar_missing_lon.nc
+ 
+ 
+! err601_missing_string_element.jnl
+! Bug 1488; Seg fault when try to list a string variable
+!  when the last element is missing.
+GO bn_reset
+cancel mode verify
+GO err601_missing_string_element.jnl
+! err601_missing_string_element.jnl
+!  Bug 1488. Seg fault when try to list a string variable
+!  when the last element is missing.
+ 
+let a = {"a", "b",  }
+list a
+             VARIABLE : {"a", "b",  }
+             SUBSET   : 3 points (X)
+ 1   / 1:"a"
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+*** Running test: bn_modnbd.jnl
+! Test MODNBD regridding statistic.
+ 
+use gtsa056_2.cdf
+!use climatological_axes
+!cancel data climatological_axes
+ 
+set region/x=140/y=1/k=1
+ 
+! What is the total number of possible data going into each month avg?
+let nomiss = missing(temp,30)
+list nomiss[gt=month_reg at MODNGD]
+             VARIABLE : MISSING(TEMP,30) (# of points)
+                        regrid: 730 hour on T at MODNGD
+             FILENAME : gtsa056_2.cdf
+             SUBSET   : 12 points (TIME)
+             LONGITUDE: 139.5E
+             LATITUDE : 0.8N
+             DEPTH (m): 5
+                    139.5E 
+                     10
+ 16-JAN      /  1:  16.00
+ 15-FEB      /  2:  20.00
+ 17-MAR      /  3:  20.00
+ 16-APR      /  4:  20.00
+ 16-MAY      /  5:  20.00
+ 16-JUN      /  6:  12.00
+ 16-JUL      /  7:  10.00
+ 16-AUG      /  8:  10.00
+ 15-SEP      /  9:  10.00
+ 16-OCT      / 10:  10.00
+ 15-NOV      / 11:  10.00
+ 16-DEC      / 12:  10.00
+ 
+! Define a new var with some missing data. See what MODNGD and MODNBD
+! are, and check that the sum is the same as the number of pts in each
+! month in the no-missing-data variable
+ 
+let var = if temp gt 29.5 then temp
+list var[gt=month_reg at MODNGD], var[gt=month_reg at MODNBD], var[gt=month_reg at MODNGD]+var[gt=month_reg at MODNBD], nomiss[gt=month_reg at MODNGD]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 01-JAN 00:45 to 31-DEC 06:34
+             LONGITUDE: 139.5E
+             LATITUDE: 0.8N
+             DEPTH (m): 5
+ Column  1: VAR[G=730 hour on T at MODNGD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNGD)
+ Column  2: VAR[G=730 hour on T at MODNBD] is IF TEMP GT 29.5 THEN TEMP (# of points)(regrid: 730 hour on T at MODNBD)
+ Column  3: EX#3 is VAR[GT=MONTH_REG at MODNGD]+VAR[GT=MONTH_REG at MODNBD]
+ Column  4: NOMISS[G=730 hour on T at MODNGD] is MISSING(TEMP,30) (# of points)(regrid: 730 hour on T at MODNGD)
+                    VAR    VAR   EX#3  NOMISS
+16-JAN      /  1:  10.00   6.00  16.00  16.00
+15-FEB      /  2:   2.00  18.00  20.00  20.00
+17-MAR      /  3:  18.00   2.00  20.00  20.00
+16-APR      /  4:  20.00   0.00  20.00  20.00
+16-MAY      /  5:  20.00   0.00  20.00  20.00
+16-JUN      /  6:  12.00   0.00  12.00  12.00
+16-JUL      /  7:   7.00   3.00  10.00  10.00
+16-AUG      /  8:   0.00  10.00  10.00  10.00
+15-SEP      /  9:   8.00   2.00  10.00  10.00
+16-OCT      / 10:  10.00   0.00  10.00  10.00
+15-NOV      / 11:  10.00   0.00  10.00  10.00
+16-DEC      / 12:  10.00   0.00  10.00  10.00
+*** Running test: bn_fifty_files.jnl
+! bn_fifty_files.jnl
+! We build OPeNDAP so that 100 files can be opened at a time.
+! Test with fifty.
+ 
+set mode ignore_error
+ 
+use 123456789000101_100101_test_numeric.nc
+use a1478.nc
+use a_cartesian_bug1179.nc
+use adouble_2D.nc
+use adouble.nc
+use b1478.nc
+use bad_taxis.nc
+use bounds_noenclose.nc
+use dstitle.nc
+use err542_poly_over_calendar.nc
+use err600_upcase.nc
+use err_calendar.nc
+use gappy_bounds.nc
+use illeg_axname.nc
+use longtitle1000.nc
+use missing_scale_off.nc
+use modfalse.nc
+use modulo_lon_time.nc
+use mylon.nc
+use nan_missing.nc
+use noglobalhistory.nc
+use ss_small.nc
+use sstnok_short.nc
+use sstok_short.nc
+use test0.nc
+use test_nan.nc
+use time_axis_seconds.nc
+use tripolar_subset.nc
+use varyscale_1.nc
+use varyscale_2.nc
+use xz_nozattrib.nc
+use z_wide_variation.nc
+use bn_strides.cdf
+use clim_airt_lev.cdf
+use climatological_axes.cdf
+use coads_climatology.cdf
+use coads_vwnd.cdf
+use err491_attval.cdf
+use geo_borders.cdf
+use gt4d011.cdf
+use gtbc011.cdf
+use gtsa056_1.cdf
+use gtsa056_2.cdf
+use levitus_climatology.cdf
+use non_COARDS.cdf
+use ocean_atlas_temp.cdf
+use reverse_axes.cdf
+use TAO_SST_clim.cdf
+use epic_formatted_file.nc
+use weird_name1.cdf
+ 
+cancel mode ignore_error
+ 
+*** Running test: bn603_bug_fixes.jnl
+! bn603_bug_fixes.jnl
+! test various fixes that went into version 6.03
+! 11-May-2006 ACM
+ 
+! Fix for bug 904
+! SHADE/LEV did not keep same levels after a SHADE/LINE
+GO bn_reset
+cancel mode verify
+GO err602_shade_line_lev.jnl
+! err602_shade_line_lev.jnl
+! Bug 904.
+! SHADE/LEV does not keep same levels after a SHADE/LINE
+! Was due to fact that SHADE/LINE makes PPL SHADE  call
+! followed by PPL CONTOUR/OVER call, but without indicating
+! that the same contour levels should be used.
+ 
+! Note that SHOW SYM LEV* indicates that the SHADE/LINE/KEY changes the levels.
+ 
+let a = {1,1}* ysequence({-.29,1.09})
+set view ul; shade/key a; sh sym lev*
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ur; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view ll; shade/line/key a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+set view lr; shade/lev a; sh sym lev*
+LEV_TEXT = ""
+LEV_MIN = "-0.3"
+LEV_MAX = "1.1"
+LEV_NUM = "28"
+LEV_DEL = "0.05"
+ 
+! Fix for bug 1302
+! Draw correct SHADE and FILL plots across the modulo branch cut.
+GO bn_reset
+cancel mode verify
+GO err602_curvi_modulo_cut
+! err602_curvi_modulo_cut.jnl
+! 5/07  bug 1302
+!
+! For the curvilinear modulo forms of SHADE and FILL, there appears to
+! be some inconsistency in plotting across the modulo cut.  SHADE omits
+! the half-cells that ought to touch the modulo cut.  FILL looks like
+! it's tryingto interpolate across the cut, but something's wrong.
+ 
+! Note this needs an update to tripolar_subset.nc to add some
+! coordinate center locations.
+ 
+use tripolar_subset.nc
+set view upper
+shade/hlim=75:85/vlim=-10:0/mod/pal=rnb2 0*u+mod(i+j,2),geolon_c,geolat_c
+set view lower
+fill/hlim=75:85/vlim=-10:0/mod u,geolon_c,geolat_c
+ 
+! Fix for bug 1388
+! SET LIST/PREC worked for multi-var listings, LIST/PREC= var1,var2 did not
+GO bn_reset
+cancel mode verify
+GO err602_list_prec
+! err602_list_prec.jnl
+! fixes for bug 1388: SET LIST/PREC worked for multi-variable listings,
+! but LIST/PRECISION= did not.
+ 
+use gt4d011.cdf
+ 
+! Here is a listing with default precision
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29  2.370E-04
+138.5W / 92:  27.25  2.380E-04
+137.5W / 93:  27.24  2.383E-04
+136.5W / 94:  27.18  2.380E-04
+ 
+! Previously this did not have the effect of changing the precision.
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=3 temp,salt
+139.5W / 91:  27.3  2.37E-04
+138.5W / 92:  27.3  2.38E-04
+137.5W / 93:  27.2  2.38E-04
+136.5W / 94:  27.2  2.38E-04
+ 
+! This has always worked
+SET LIST/PREC=7
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 temp,salt
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+! This should override the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1/PREC=2 TEMP,SALT
+139.5W / 91:  27.  2.4E-04
+138.5W / 92:  27.  2.4E-04
+137.5W / 93:  27.  2.4E-04
+136.5W / 94:  27.  2.4E-04
+ 
+! And then things should go back to the SET LIST/PREC setting
+LIST/NOHEAD/I=91:94/J=37/K=1/L=1 TEMP,SALT
+139.5W / 91:  27.29276  2.369705E-04
+138.5W / 92:  27.25388  2.379802E-04
+137.5W / 93:  27.23906  2.382890E-04
+136.5W / 94:  27.17807  2.380348E-04
+ 
+*** Running test: bn_set_var_name.jnl
+! bn_set_var_name.jnl
+! This has been in Ferret since v5.3 but never a benchmark test of it!
+! ACM 8/2007
+ 
+USE coads_climatology
+ 
+! Use SET VAR/NAME= to give a variable from the file a new name.
+SET VAR/NAME=my_sst sst
+SHOW DATA
+     currently SET data sets:
+    1> ./coads_climatology.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ MY_SST   SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:3       ...       ...
+ 
+ 
+LIST/X=179:183/Y=40/L=3 my_sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 17-MAR 02:58
+                39N   
+                65
+ 179E   / 80:  11.90
+ 179W   / 81:  12.12
+ 177W   / 82:  12.08
+ 
+! Now use a LET command to "fix" the data in any way we wish
+! Give it the original name, and now it has the new characteristics
+! but the old name.
+ 
+LET sst = 3*my_sst
+LIST/X=179:183/Y=40/L=3 sst
+             VARIABLE : 3*MY_SST
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (LONGITUDE)
+             LATITUDE : 39N
+             TIME     : 17-MAR 02:58
+                39N   
+                65
+ 179E   / 80:  35.69
+ 179W   / 81:  36.36
+ 177W   / 82:  36.24
+ 
+*** Running test: bn_memory_symbol.jnl
+Unable to resize Ferret's memory cache to 500000.000000 Mdoubles
+Ferret's memory cache remains at 0.200000 Mdoubles
+! bn_memory_symbol.jnl
+! Ferret v6.06 15-Aug-07
+! Symbol FERRET_MEMORY shows current size of Ferret memory in MWords
+ 
+sh sym ferret_memory
+FERRET_MEMORY = "25.6"
+ 
+set mem/siz=90
+sh sym ferret_memory
+FERRET_MEMORY = "90"
+show memory
+ Current size of FERRET memory cache: 90 MegaWords  (1 word = 4 bytes)
+ 
+set mem/size=0.05
+sh sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=500000  ! too large to allow
+sho sym ferret_memory
+FERRET_MEMORY = "0.2"
+ 
+set mem/siz=25.6  ! return to the default setting
+show memory
+ Current size of FERRET memory cache: 25.6 MegaWords  (1 word = 4 bytes)
+*** Running test: bn605_bug_fixes.jnl
+! bn604_bug_fixes.jnl
+! test various fixes that went into version 6.05
+! 27-July-2007 ACM
+ 
+! Fix for Bug 1524: irregular axis detected as REGULAR
+GO bn_reset
+cancel mode verify
+GO err604_irreg_axis.jnl
+! Bug 1524: irregular axis detected as REGULAR!
+ 
+!use climatological_axes
+sh ax MONTH_IRREG
+ name       axis              # pts   start                end
+ MONTH_IRREG TIME              12mi   16-JAN 12:00         15-DEC 17:49
+T0 = 01-JAN-0000 00:00:00
+   Axis span (to cell edges) = 365.2425 (modulo length = axis span)
+list t[gt=month_irreg], tbox[gt=month_irreg]
+             TIME: 01-JAN 00:00 to 31-DEC 05:49
+ Column  1: T is T (axis MONTH_IRREG)
+ Column  2: TBOX is TBOX (axis MONTH_IRREG)
+                         T   TBOX
+16-JAN 12      /  1:   15.5  31.00
+15-FEB 02      /  2:   45.1  28.24
+15-MAR 17      /  3:   74.7  31.00
+15-APR 05      /  4:  105.2  30.00
+15-MAY 17      /  5:  135.7  31.00
+15-JUN 05      /  6:  166.2  30.00
+15-JUL 17      /  7:  196.7  31.00
+15-AUG 17      /  8:  227.7  31.00
+15-SEP 05      /  9:  258.2  30.00
+15-OCT 17      / 10:  288.7  31.00
+15-NOV 05      / 11:  319.2  30.00
+15-DEC 17      / 12:  349.7  31.00
+ 
+ 
+! SHOW FUNCTIONS caused a crash or a message
+GO bn_reset
+cancel mode verify
+GO err605_show_func.jnl
+! err605_show_func.jnl
+! Reported by Andrew W.
+! SHOW FUNCTIONS caused a crash on his system; I see it only as a message
+! in SHOW FUNC/BRIEF
+ 
+SHOW FUNCTION/BRIEF
+Functions internal to Ferret:
+EXP(X)
+LOG(X)
+MAX(A,B)
+MIN(A,B)
+INT(X)
+ABS(X)
+SIN(theta)
+COS(theta)
+TAN(theta)
+LN(X)
+MOD(A,B)
+MISSING(A,B)
+IGNORE0(X)
+ATAN(X)
+ATAN2(A,B)
+ASIN(X)
+ACOS(X)
+RANDU(A)
+RANDN(A)
+RHO_UN(salt,temp,p)
+THETA_FO(salt,temp,p,ref)
+DAYS1900(year,month,day)
+RANDU2(A,ISEED)
+RANDN2(A,ISEED)
+XSEQUENCE(VAR)
+ECHO(STR,NUM)
+RESHAPE(A,B)
+ZAXREPLACE(V,ZVALS,ZAX)
+YSEQUENCE(VAR)
+ZSEQUENCE(VAR)
+TSEQUENCE(VAR)
+ESEQUENCE(VAR)
+FSEQUENCE(VAR)
+SAMPLEI(TO_BE_SAMPLED,X_INDICES)
+SAMPLEJ(TO_BE_SAMPLED,Y_INDICES)
+SAMPLEK(TO_BE_SAMPLED,Z_INDICES)
+SAMPLEL(TO_BE_SAMPLED,T_INDICES)
+SAMPLEM(TO_BE_SAMPLED,E_INDICES)
+SAMPLEN(TO_BE_SAMPLED,F_INDICES)
+SPAWN(STR)
+STRCMP(STR1,STR2)
+STRLEN(STR)
+UPCASE(STR)
+STRINDEX(STR1,SUBSTR)
+STRRINDEX(STR1,SUBSTR)
+DNCASE(STR)
+STRCAT(STR1,STR2)
+SUBSTRING(STR,OFFSET,LENGTH)
+STRFLOAT(STR)
+ 
+Externally defined functions available to Ferret:
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+BIN_INDEX_WT(INDEX,WT,INDXMAX)
+COMPRESSI(DAT)
+COMPRESSI_BY(dat,mask)
+COMPRESSJ(DAT)
+COMPRESSJ_BY(dat,mask)
+COMPRESSK(DAT)
+COMPRESSK_BY(dat,mask)
+COMPRESSL(DAT)
+COMPRESSL_BY(dat,mask)
+COMPRESSM(DAT)
+COMPRESSM_BY(dat,mask)
+COMPRESSN(DAT)
+COMPRESSN_BY(dat,mask)
+CONVOLVEI(COM,WEIGHT)
+CONVOLVEJ(COM,WEIGHT)
+CONVOLVEK(COM,WEIGHT)
+CONVOLVEL(COM,WEIGHT)
+CONVOLVEM(COM,WEIGHT)
+CONVOLVEN(COM,WEIGHT)
+CURV_RANGE(LONGITUDES,LATITUDES,xrange_lo,xrange_hi,yrange_lo,yrange_hi,modulo flag for X coordinates)
+CURV_TO_RECT(V,mapping)
+CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius)
+DATE1900(formatted date)
+DAYS1900TOYMDHMS(day1900)
+ECAT(A,B)
+ECAT_STR(A,B)
+ELEMENT_INDEX(VAR,VALUES)
+ELEMENT_INDEX_STR(VAR,STRINGS)
+ELEMENT_INDEX_STR_N(VAR,STRINGS)
+EOF_SPACE(A,frac_timeser)
+EOF_STAT(A,frac_timeser)
+EOF_TFUNC(A,frac_timeser)
+EREVERSE(A)
+EXPNDI_BY(dat,mask,outsize)
+EXPNDI_BY_T(dat,mask,n_profiles,max_profile_len)
+EXPNDI_BY_Z(dat,mask,n_profiles,max_profile_len)
+FCAT(A,B)
+FCAT_STR(A,B)
+FFTA(A)
+FFT_IM(A)
+FFT_INVERSE(A,B)
+FFTP(A)
+FFT_RE(A)
+FILL_XY(DATA,MASK,N)
+FINDHI(A,XRANGE,YRANGE)
+FINDLO(A,XRANGE,YRANGE)
+FLOATSTR(A,FMT)
+FREVERSE(A)
+IS_ELEMENT_OF(VAR,VALUES)
+IS_ELEMENT_OF_STR(VAR,VALUES)
+IS_ELEMENT_OF_STR_N(VAR,VALUES)
+LABWID(STR,HT)
+LANCZOS(A,F1,F2,N)
+LIST_VALUE_XML(tag,value,cdata_flag,outputfile)
+LSL_LOWPASS(A,cutoff_period,filter_span)
+MINMAX(A)
+MINUTES24(formatted time)
+NCO(operator,arguments)
+NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
+PT_IN_POLY(A,XVERT,YVERT)
+RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing_allowed)
+SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEI_MULTI(I_INDICES,DAT_TO_SAMPLE)
+SAMPLEJ_MULTI(J_INDICES,DAT_TO_SAMPLE)
+SAMPLEK_MULTI(K_INDICES,DAT_TO_SAMPLE)
+SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
+SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC)
+SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CLOSEST(DAT_TO_SAMPLE,XPTS,YPTS)
+SAMPLEXY_CURV(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_AVG(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXY_CURV_NRST(DAT_TO_SAMPLE,DAT_LON,DAT_LAT,XPTS,YPTS)
+SAMPLEXYT(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+SAMPLEXZ(DAT_TO_SAMPLE,XPTS,ZPTS)
+SAMPLEYZ(DAT_TO_SAMPLE,YPTS,ZPTS)
+SCAT2DDUPS(coord 1,coord 2,epsilon 1,epsilon 2)
+SCAT2GRID_BIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_BIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRIDGAUSS_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XT_V0(XPTS,TPTS,F,XAXPTS,TAXPTS,XSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XY_V0(XPTS,YPTS,F,XAXPTS,YAXPTS,XSCALE,YSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_XZ_V0(XPTS,ZPTS,F,XAXPTS,ZAXPTS,XSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YT_V0(YPTS,TPTS,F,YAXPTS,TAXPTS,YSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_YZ_V0(YPTS,ZPTS,F,YAXPTS,ZAXPTS,YSCALE,ZSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDGAUSS_ZT_V0(ZPTS,TPTS,F,ZAXPTS,TAXPTS,ZSCALE,TSCALE,CUTOFF,0)
+SCAT2GRIDLAPLACE_XT(XPTS,TPTS,F,XAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XY(XPTS,YPTS,F,XAXPTS,YAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_XZ(XPTS,ZPTS,F,XAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YT(YPTS,TPTS,F,YAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_YZ(YPTS,ZPTS,F,YAXPTS,ZAXPTS,KAY,NRNG)
+SCAT2GRIDLAPLACE_ZT(ZPTS,TPTS,F,ZAXPTS,TAXPTS,KAY,NRNG)
+SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
+SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,F,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_NOBS_XY(XPTS,YPTS,XAXPTS,YAXPTS)
+SCAT2GRID_NOBS_XYT(XPTS,YPTS,TPTS,XAXPTS,YAXPTS,TAXPTS)
+SCAT2GRID_T(TPTS,TAXIS)
+SORTI(DAT)
+SORTI_STR(STR)
+SORTJ(DAT)
+SORTJ_STR(STR)
+SORTK(DAT)
+SORTK_STR(STR)
+SORTL(DAT)
+SORTL_STR(STR)
+SORTM(DAT)
+SORTM_STR(STR)
+SORTN(DAT)
+SORTN_STR(STR)
+TAUTO_COR(A)
+TAX_DATESTRING(A,B,C)
+TAX_DAY(A,B)
+TAX_DAYFRAC(A,B)
+TAX_JDAY(A,B)
+TAX_JDAY1900(A,B)
+TAX_MONTH(A,B)
+TAX_TIMES(A)
+TAX_TSTEP(A,B)
+TAX_UNITS(A)
+TAX_YEAR(A,B)
+TAX_YEARFRAC(A,B)
+TCAT(A,B)
+TCAT_STR(A,B)
+TEST_OPENDAP(url)
+TRANSPOSE_XT(VAR)
+TRANSPOSE_XY(VAR)
+TRANSPOSE_XZ(VAR)
+TRANSPOSE_YT(VAR)
+TRANSPOSE_YZ(VAR)
+TRANSPOSE_ZT(VAR)
+TREVERSE(A)
+UNIQUE_STR2INT(A)
+WRITE_WEBROW(id,name,Cruise_Mask,filename)
+XAUTO_COR(A)
+XCAT(A,B)
+XCAT_STR(A,B)
+XREVERSE(A)
+YCAT(A,B)
+YCAT_STR(A,B)
+YREVERSE(A)
+ZAXREPLACE_AVG(V,ZVALS,ZAX)
+ZAXREPLACE_BIN(V,ZVALS,ZAX)
+ZAXREPLACE_REV(ZVALS,V,ZAX)
+ZAXREPLACE_ZLEV(V,THICKNESS,ZAX)
+ZCAT(A,B)
+ZCAT_STR(A,B)
+ZREVERSE(A)
+EOFSVD_SPACE(A)
+EOFSVD_STAT(A)
+EOFSVD_TFUNC(A)
+EXPND_BY_LEN(var,len,nx)
+EXPND_BY_LEN_STR(var,len,nx)
+FC_ISUBSET(index_list,lengths,nx,FullData)
+EXPNDI_BY_Z_COUNTS(dat,counts,max_profile_len)
+EXPNDI_ID_BY_Z_COUNTS(counts,max profile len)
+STR_MASK(STRING,MASK,--)
+SAMPLEXYT_NRST(DAT_TO_SAMPLE,XPTS,YPTS,TPTS)
+ADD_9(A,B,C,D,E,F,G,H,I)
+APPENDE(ENS,VAR)
+AVET(A)
+DATES(Offsets)
+FACTORIAL(A)
+FFT_AMP(A)
+FFTA_SAMPLE(A)
+FFT_PHAS(A)
+PASS_THRU(A)
+PERCENT_GOOD_T(A)
+STORAGE(A)
+STRING_ARG(Flags,NString)
+STUDENT_T_CUTOFF(P,nf)
+SUBTRACT(A,B)
+STATS_BETA_CDF(PTS,ALPHA,BETA)
+STATS_BETA_ISF(PTS,ALPHA,BETA)
+STATS_BETA_PDF(PTS,ALPHA,BETA)
+STATS_BETA_PPF(PTS,ALPHA,BETA)
+STATS_BETA_RVS(PTS,ALPHA,BETA)
+STATS_BETA_SF(PTS,ALPHA,BETA)
+STATS_BINOM_CDF(PTS,N,P)
+STATS_BINOM_ISF(PTS,N,P)
+STATS_BINOM_PMF(PTS,N,P)
+STATS_BINOM_PPF(PTS,N,P)
+STATS_BINOM_RVS(PTS,N,P)
+STATS_BINOM_SF(PTS,N,P)
+STATS_CAUCHY_CDF(PTS,M,GAMMA)
+STATS_CAUCHY_ISF(PTS,M,GAMMA)
+STATS_CAUCHY_PDF(PTS,M,GAMMA)
+STATS_CAUCHY_PPF(PTS,M,GAMMA)
+STATS_CAUCHY_RVS(PTS,M,GAMMA)
+STATS_CAUCHY_SF(PTS,M,GAMMA)
+STATS_CHI_CDF(PTS,DF)
+STATS_CHI_ISF(PTS,DF)
+STATS_CHI_PDF(PTS,DF)
+STATS_CHI_PPF(PTS,DF)
+STATS_CHI_RVS(PTS,DF)
+STATS_CHI_SF(PTS,DF)
+STATS_CHI2_CDF(PTS,DF)
+STATS_CHI2_ISF(PTS,DF)
+STATS_CHI2_PDF(PTS,DF)
+STATS_CHI2_PPF(PTS,DF)
+STATS_CHI2_RVS(PTS,DF)
+STATS_CHI2_SF(PTS,DF)
+STATS_EXPON_CDF(PTS,LAMBDA)
+STATS_EXPON_ISF(PTS,LAMBDA)
+STATS_EXPON_PDF(PTS,LAMBDA)
+STATS_EXPON_PPF(PTS,LAMBDA)
+STATS_EXPON_RVS(PTS,LAMBDA)
+STATS_EXPON_SF(PTS,LAMBDA)
+STATS_EXPONWEIB_CDF(PTS,K,LAMBDA,ALPHA)
+STATS_EXPONWEIB_ISF(PTS,K,LAMBDA,ALPHA)
+STATS_EXPONWEIB_PDF(PTS,K,LAMBDA,ALPHA)
+STATS_EXPONWEIB_PPF(PTS,K,LAMBDA,ALPHA)
+STATS_EXPONWEIB_RVS(PTS,K,LAMBDA,ALPHA)
+STATS_EXPONWEIB_SF(PTS,K,LAMBDA,ALPHA)
+STATS_F_CDF(PTS,DFN,DFD)
+STATS_F_ISF(PTS,DFN,DFD)
+STATS_F_PDF(PTS,DFN,DFD)
+STATS_F_PPF(PTS,DFN,DFD)
+STATS_F_RVS(PTS,DFN,DFD)
+STATS_F_SF(PTS,DFN,DFD)
+STATS_GAMMA_CDF(PTS,ALPHA,THETA)
+STATS_GAMMA_ISF(PTS,ALPHA,THETA)
+STATS_GAMMA_PDF(PTS,ALPHA,THETA)
+STATS_GAMMA_PPF(PTS,ALPHA,THETA)
+STATS_GAMMA_RVS(PTS,ALPHA,THETA)
+STATS_GAMMA_SF(PTS,ALPHA,THETA)
+STATS_GEOM_CDF(PTS,P)
+STATS_GEOM_ISF(PTS,P)
+STATS_GEOM_PMF(PTS,P)
+STATS_GEOM_PPF(PTS,P)
+STATS_GEOM_RVS(PTS,P)
+STATS_GEOM_SF(PTS,P)
+STATS_HYPERGEOM_CDF(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_HYPERGEOM_ISF(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_HYPERGEOM_PMF(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_HYPERGEOM_PPF(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_HYPERGEOM_RVS(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_HYPERGEOM_SF(PTS,NTOTAL,NGOOD,NDRAWN)
+STATS_INVGAMMA_CDF(PTS,ALPHA,BETA)
+STATS_INVGAMMA_ISF(PTS,ALPHA,BETA)
+STATS_INVGAMMA_PDF(PTS,ALPHA,BETA)
+STATS_INVGAMMA_PPF(PTS,ALPHA,BETA)
+STATS_INVGAMMA_RVS(PTS,ALPHA,BETA)
+STATS_INVGAMMA_SF(PTS,ALPHA,BETA)
+STATS_LAPLACE_CDF(PTS,MU,B)
+STATS_LAPLACE_ISF(PTS,MU,B)
+STATS_LAPLACE_PDF(PTS,MU,B)
+STATS_LAPLACE_PPF(PTS,MU,B)
+STATS_LAPLACE_RVS(PTS,MU,B)
+STATS_LAPLACE_SF(PTS,MU,B)
+STATS_LOGNORM_CDF(PTS,MU,SIGMA)
+STATS_LOGNORM_ISF(PTS,MU,SIGMA)
+STATS_LOGNORM_PDF(PTS,MU,SIGMA)
+STATS_LOGNORM_PPF(PTS,MU,SIGMA)
+STATS_LOGNORM_RVS(PTS,MU,SIGMA)
+STATS_LOGNORM_SF(PTS,MU,SIGMA)
+STATS_NBINOM_CDF(PTS,N,P)
+STATS_NBINOM_ISF(PTS,N,P)
+STATS_NBINOM_PMF(PTS,N,P)
+STATS_NBINOM_PPF(PTS,N,P)
+STATS_NBINOM_RVS(PTS,N,P)
+STATS_NBINOM_SF(PTS,N,P)
+STATS_NORM_CDF(PTS,MU,SIGMA)
+STATS_NORM_ISF(PTS,MU,SIGMA)
+STATS_NORM_PDF(PTS,MU,SIGMA)
+STATS_NORM_PPF(PTS,MU,SIGMA)
+STATS_NORM_RVS(PTS,MU,SIGMA)
+STATS_NORM_SF(PTS,MU,SIGMA)
+STATS_PARETO_CDF(PTS,XM,ALPHA)
+STATS_PARETO_ISF(PTS,XM,ALPHA)
+STATS_PARETO_PDF(PTS,XM,ALPHA)
+STATS_PARETO_PPF(PTS,XM,ALPHA)
+STATS_PARETO_RVS(PTS,XM,ALPHA)
+STATS_PARETO_SF(PTS,XM,ALPHA)
+STATS_POISSON_CDF(PTS,MU)
+STATS_POISSON_ISF(PTS,MU)
+STATS_POISSON_PMF(PTS,MU)
+STATS_POISSON_PPF(PTS,MU)
+STATS_POISSON_RVS(PTS,MU)
+STATS_POISSON_SF(PTS,MU)
+STATS_RANDINT_CDF(PTS,MIN,MAX)
+STATS_RANDINT_ISF(PTS,MIN,MAX)
+STATS_RANDINT_PMF(PTS,MIN,MAX)
+STATS_RANDINT_PPF(PTS,MIN,MAX)
+STATS_RANDINT_RVS(PTS,MIN,MAX)
+STATS_RANDINT_SF(PTS,MIN,MAX)
+STATS_T_CDF(PTS,DF)
+STATS_T_ISF(PTS,DF)
+STATS_T_PDF(PTS,DF)
+STATS_T_PPF(PTS,DF)
+STATS_T_RVS(PTS,DF)
+STATS_T_SF(PTS,DF)
+STATS_UNIFORM_CDF(PTS,MIN,MAX)
+STATS_UNIFORM_ISF(PTS,MIN,MAX)
+STATS_UNIFORM_PDF(PTS,MIN,MAX)
+STATS_UNIFORM_PPF(PTS,MIN,MAX)
+STATS_UNIFORM_RVS(PTS,MIN,MAX)
+STATS_UNIFORM_SF(PTS,MIN,MAX)
+STATS_WEIBULL_CDF(PTS,K,LAMBDA)
+STATS_WEIBULL_ISF(PTS,K,LAMBDA)
+STATS_WEIBULL_PDF(PTS,K,LAMBDA)
+STATS_WEIBULL_PPF(PTS,K,LAMBDA)
+STATS_WEIBULL_RVS(PTS,K,LAMBDA)
+STATS_WEIBULL_SF(PTS,K,LAMBDA)
+STATS_CDF(PTS,PDNAME,PDPARAMS)
+STATS_ISF(PROBS,PDNAME,PDPARAMS)
+STATS_PDF(PTS,PDNAME,PDPARAMS)
+STATS_PMF(PTS,PDNAME,PDPARAMS)
+STATS_PPF(PROBS,PDNAME,PDPARAMS)
+STATS_RVS(TEMPLATE,PDNAME,PDPARAMS)
+STATS_SF(PTS,PDNAME,PDPARAMS)
+STATS_CHISQUARE(SAMPLE_CNTS,EXPECT_CNTS,DELTA_DEGFREE)
+STATS_FIT(VALS,PDNAME,PDPARAMS)
+STATS_KSTEST1(SAMPLE,PDNAME,PDPARAMS)
+STATS_KSTEST2(SAMPLEA,SAMPLEB)
+STATS_LINREGRESS(XVALS,YVALS)
+STATS_PEARSONR(SAMPLEA,SAMPLEB)
+STATS_PERCENTILESOFSCORES(SAMPLE,SCORES)
+STATS_PROBPLOTVALS(SAMPLE,PDNAME,PDPARAMS)
+STATS_STATS(VALUES)
+STATS_SCORESATPERCENTILES(SAMPLE,PERCENTILES)
+STATS_SPEARMANR(SAMPLEA,SAMPLEB)
+STATS_TTEST1(SAMPLE,POPMEANS)
+STATS_TTEST2IND(SAMPLEA,SAMPLEB)
+STATS_TTEST2REL(SAMPLEA,SAMPLEB)
+STATS_ZSCORE(VALUES)
+STATS_HELPER(PDNAME)
+STATS_HISTOGRAM(VALS,BINS_TEMPLATE)
+SHAPEFILE_READXY(SHAPEFILE,MAXPTS)
+SHAPEFILE_READXYVAL(SHAPEFILE,VALNAME,MAXPTS)
+SHAPEFILE_READXYZ(SHAPEFILE,MAXPTS)
+SHAPEFILE_READXYZVAL(SHAPEFILE,VALNAME,MAXPTS)
+SHAPEFILE_WRITEVAL(SHAPEFILE,VALUE,VALNAME,MAPPRJ)
+SHAPEFILE_WRITEXYVAL(SHAPEFILE,GRIDX,GRIDY,VALUE,VALNAME,MAPPRJ)
+SHAPEFILE_WRITEXYZVAL(SHAPEFILE,GRIDX,GRIDY,GRIDZ,VALUE,VALNAME,MAPPRJ)
+CURV2RECT(CurvData,CurvCenterLons,CurvCenterLats,CurvCornerLons,CurvCornerLats,TemplateRectVar,Method)
+CURV3SRECT(CurvData,CurvLons,CurvLats,CurvBaths,CurvZetas,TemplateRectVar,Method)
+ 
+*** Running test: bn608_bug_fixes.jnl
+! bn608_bug_fixes
+! test various fixes that went into version 6.08
+! 24-Sep ACM
+ 
+! Fix for Bug 1539: SHOW VAR/XML
+GO bn_reset
+cancel mode verify
+GO err607_show_var_xml
+! Bug 1539 SHOW VAR/XML didnt show all vars.
+ 
+ 
+use gt4d011.cdf
+use coads_climatology
+ 
+let temp_1_regrid=temp[d=1,z=5.00:75.00 at ave]
+let sst_2_regrid=sst[d=2,t="15-Feb":"15-Mar"@ave]
+let sst_final=sst_2_regrid[d=2,gxy=temp_1_regrid[d=1]]
+ 
+! This shows all 3 vars
+show var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     SST_FINAL = SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]
+     SST_2_REGRID = SST[D=2,T="15-Feb":"15-Mar"@AVE]
+     TEMP_1_REGRID = TEMP[D=1,Z=5.00:75.00 at AVE]
+ 
+! But this showed only sst_final and sst_2_regrid (twice)
+show var/xml
+<global>
+<var name="SST_FINAL">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST_2_REGRID[D=2,GXY=TEMP_1_REGRID[D=1]]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="(G006)">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+</axes>
+</grid>
+</var>
+<var name="SST_2_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[SST[D=2,T="15-Feb":"15-Mar"@AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+</axes>
+</grid>
+</var>
+<var name="TEMP_1_REGRID">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[D=1,Z=5.00:75.00 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="PS3DT2">
+<axes>
+<xaxis>PSXT</xaxis>
+<yaxis>PSYT</yaxis>
+<taxis>TIME1</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+! err607_set_new_history_att
+GO bn_reset
+cancel mode verify
+GO err607_set_new_history_att
+! err607_set_new_history_att.jnl
+! Previously if we set a history attribute on a user-defined variable that
+! was based on a dataset variable, the default history attribute, From dataset
+! was always written. Now if we define our own, that is what is written.
+ 
+use coads_climatology.cdf
+let var = sst
+def att/output var.history = "from Sea Surface Temperature, coads_climatology.cdf"
+save/file=a.nc/clobber/x=180:200/y=1 var
+ 
+can data/all
+use a.nc
+show data
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ VAR      SST                              1:10      1:1       ...       1:3       ...       ...
+ 
+show att/all var
+     attributes for user-defined variables
+ var.long_name = SST 
+ var.missing_value = -1.E+34
+ var.history = from Sea Surface Temperature, coads_climatology.cdf 
+ 
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+GO bn_reset
+cancel mode verify
+GO err607_axis_minmax_syms
+! Bug 1542
+! Symbols YAXIS_MIN, YAXIS_MAX were 0 when values small
+! Should use scientific notation
+ 
+use coads_climatology
+let plotvar = sst[L=1]
+plot/y=35 plotvar/10000; sh sym yax*
+YAXIS_MIN = "8.0000010E-04"
+YAXIS_MAX = "2.1000002E-03"
+plot/y=35 plotvar/10000000; sh sym yax*
+YAXIS_MIN = "8.0000012E-07"
+YAXIS_MAX = "2.1000003E-06"
+plot/y=35 plotvar*10000000; sh sym yax*
+YAXIS_MIN = "8.0000000E+07"
+YAXIS_MAX = "2.1000000E+08"
+ 
+def axis/x=0.000004:0.000005/npoints=100 xax
+def axis/y=0.000001:0.000002/npoints=100 yax
+let a = x[gx=xax] + y[gy=yax]
+shade a; sh sym xax*; ; sh sym yax*
+XAXIS_REVERSED = "0"
+XAXIS_MIN = "3.99494949E-06"
+XAXIS_MAX = "5.0050505E-06"
+YAXIS_REVERSED = "0"
+YAXIS_MIN = "9.94949495E-07"
+YAXIS_MAX = "2.0050505E-06"
+ 
+ 
+ 
+! Error message for too many contour levels requested
+GO bn_reset
+cancel mode verify
+GO err607_lev_errmsg
+! err607_lev_errmsg.F
+! Make the error message more detailed, saying it is the choice of
+! number of contours that caused the error.
+ 
+SET MODE ignore
+SHADE/LEV=300/I=1:100/J=1:100 i+j
+ 
+SET MODE/LAST ignore
+*** Running test: bn_shade_trim.jnl
+! bn_shade_trim.jnl
+! Test new qualifier SHADE/TRIM which trims the region of
+! shade plot as is done by FILL. For LAS scripts which do
+! shade underlay for FILL plots.
+ 
+USE ocean_atlas_temp
+ 
+! See the region used by FILL
+SET VIEW upper
+FILL temp[L=2,X=180:200,Y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+! See the larger region used by default for SHADE
+SHADE temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.00000"
+XAXIS_MAX = "200.0000"
+YAXIS_MIN = "30.000000"
+YAXIS_MAX = "44.00000"
+ 
+! SHADE/TRIM trims the region as for a FILL plot
+SET VIEW lower
+SHADE/TRIM temp[L=2,X=180:200,y=30:44]
+SHOW SYM xaxis_min, xaxis_max, yaxis_min, yaxis_max
+XAXIS_MIN = "180.50000"
+XAXIS_MAX = "199.5000"
+YAXIS_MIN = "30.500000"
+YAXIS_MAX = "43.50000"
+ 
+*** Running test: bn_mode_nlevels.jnl
+! bn_mode_nlevels.jnl
+! 3-mar-2008
+! v6.1 MODE NLEVELS (default is 40)
+ 
+show mode nlevels
+      MODE            STATE        ARGUMENT
+      NLEVELS          SET              30
+use levitus_climatology
+ 
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "32"
+LEV_DEL = "1"
+ 
+! Old default value was 10
+set mode nlevels 10
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "16"
+LEV_DEL = "2"
+ 
+! set even higher
+set mode nlevels 80
+shade temp
+show sym lev*
+LEV_MIN = "-2"
+LEV_MAX = "30"
+LEV_NUM = "64"
+LEV_DEL = "0.5"
+ 
+! restore (new) default
+set mode nlevels 40
+ 
+*** Running test: bn61_bug_fixes.jnl
+! bn608_bug_fixes
+! test various fixes that went into version 6.1
+! 2-Jan-2008 ACM
+ 
+! Fix for Bug 1556:
+! Error processing parentheses on abstract axis names.
+GO bn_reset
+cancel mode verify
+GO err608_bug1556
+! err608_bug1556.jnl
+! Error processing parentheses on abstract axis names.
+!
+! The file was created with these commands, which MUST BE
+! in a separate Ferret session to see the bug.
+!
+!  use coads_climatology
+!  set axis/stride=20 `sst,return=xaxis`
+!  set axis/stride=10 `sst,return=yaxis`
+!  save/file=err608_bug1556.nc/clobber sst[L=1:2]
+ 
+USE err608_bug1556.nc
+SAVE/FILE=a.nc/CLOBBER sst[i=1:5:1,j=1:5:1,l=1:1:1]
+ 
+! The error was,
+!      LISTing to file out.nc
+!      **TMAP ERR: error in line definition
+!             file coords dont match variable coords on axis AX0
+!
+! The bug was fixed in cd_axis_outname.F
+ 
+ 
+! Fix for Bug 1538:
+! Precision of immediate-mode output of negative values
+GO bn_reset
+cancel mode verify
+GO err608_precision_neg_numbers
+! err608_precision_neg_numbers.jnl
+! ACM 1/2/2008
+! Bug 1538, precision of immediate-mode output of negative values
+! Fixed in tm_fmt.F
+ 
+! The output from a LIST command is correct:
+LIST/PREC=10 1.23456789e-15
+             VARIABLE : constant
+          1.234567890E-15
+ 
+! In immediate mode, output is incorrect, not enough precision:
+SAY `1.23456789e-15`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+SAY `1.23456789e-15,prec=10`
+ !-> MESSAGE/CONTINUE 1.23456789E-15
+1.23456789E-15
+*** Running test: bn_test_opendap.jnl
+! Test the test_opendap function: returns 0 if successful, or error code if not.
+SET MODE IGNORE
+ 
+!! Change to another server, this one not working 3/2012
+!!list test_opendap ("http://iridl.ldeo.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+!!list test_opendap ("http://iridl.ldeo.NOT.columbia.edu/SOURCES/.LEVITUS/.MONTHLY/.temp/dods")
+ 
+!! Change to another server, this one not working 8/2012
+list test_opendap ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+          0.0000
+list test_opendap ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             VARIABLE : TEST_OPENDAP ("http://ferret.pmel.NOT.noaa.gov/thredds/dodsC/data/PMEL/WOA05nc/monthly/s0112an1.nc")
+             X        : 1
+         -68.00
+ 
+ 
+CANCEL MODE IGNORE
+*** Running test: bn611_bug_fixes.jnl
+! bn611_bug_fixes.jnl
+! Fixes that go into v6.11 release
+ 
+GO bn_reset
+cancel mode verify
+GO err61_write_bounds
+! err61_write_bounds.jnl
+! test fixes for bugzilla 1534: write correct bounds
+! when bounds were read in from a netCDF file.
+ 
+def ax/x/edges xax={1,2,4,8,9}
+let a = x[gx=xax]
+save/clobber/file=a.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! This is the original bug report
+! The bounds attribute was written but the values were bad,
+! shown as _, _ in the netcdf output.
+can var a
+use a.nc
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+! It would also be useful to be able to tell Ferret
+! not to save the bounds at all.
+ 
+can data/all
+use a.nc
+can att/output (xax).bounds
+save/clobber/file=b.nc a
+sp ncdump a.nc >> all_ncdump.out
+ 
+GO bn_reset
+cancel mode verify
+GO err61_poly_shade_over_noaxes
+! err61_poly_shade_over_noaxes.jnl
+! See bug 1571
+ 
+! plot/ax=0,0,0,0 ; poly/over ! redraws the box
+ 
+set v ul; plot/ax=0,0,0,0 {0,1}; poly/ov {0,1},{0,1}
+set v ur; plot/set/ax=0,0,0,0 {0,1}; ppl plot; poly/ov {0,1},{0,1}
+set v ll; plot/ax=0,0,0,0 {0,1}; plot/ov {0,1}
+set v lr; plot/set/ax=0,0,0,0 {0,1}; ppl plot; plot/ov {0,1}
+can view
+ 
+! shade over polygon
+set view upper; polygon/thick/color=red/palette=blue/axes=0,0,0,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! shade/over/i=1:2/j=0:2/patt i+j
+shade/over/i=1:2/j=0:2/opac=25 i+j
+ 
+set view lower; polygon/thick/color=red/palette=blue/axes=1,1,1,0 {1,2,1}, {2,1,0.5}
+! KMS - changed for PyFerret - patterns not supported, so try translucent
+! fill/over/i=1:2/j=0:2/patt i+j
+fill/over/i=1:2/j=0:2/opac=25 i+j
+ 
+can view
+ 
+! Polygon over shade
+set view ul
+use err542_poly_over_calendar.nc
+shade/ax=0,1,1,0 pc
+poly/over/fill/pal=red/line/color=black/title="polygon" {220,240,280,250},{-20,70,40,-30}
+ 
+! Polygon over fill
+set view ur
+use gt4d011
+let v1={221,225,232,235}
+let v2={20,80,50,30}
+let v3={10,-3,16,3}
+fill/ax=1,0,0,1 temp[j=@ave,l=1]
+go polymark poly/lev=(-5,30,1)/pal=brown/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+set view ll
+plot/ax=0,0,1,1/vl=4:-4/hl=4:-4/vs/line/title="there should be just one triangle" {1,2,3,1},{0,2,1,0}
+poly/ov/col=2/pal=yellow {1,2,3,1},{0,2,1,0}
+ 
+set view lr
+vector/ax=0,1,1,0/k=1/l=1 u,v
+let v1={221,225,232,235}
+let v2={-3,2,0.5,2}
+let v3={10,-3,16,3}
+go polymark poly/lev=(-5,30,1)/fill/line=1/nolab/over v1 v2 v3 circle 2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_context_scalar_strings
+! err61_context_scalar_strings.jnl
+! Bug 1558, first present in Ferret v6.02
+! After SET GRID EZ error was about var not being a scalar.
+ 
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+set grid ez
+say `"a" EQ "a"`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_exit_script
+! Bug 1566 Andrew Wittenberb
+!
+! I discovered this when testing for an error condition, for which I wanted to
+! exit the current script with EXIT/SCRIPT.  It seems that EXIT doesn't always pop
+! the IF..ENDIF stack, resulting in a nesting error upon repeated invocations of
+! the script.
+!
+! Note also how the REPEAT at first works, then fails, then works, then fails, in
+! an alternating pattern.
+ 
+!        NOAA/PMEL TMAP
+!        FERRET v6.08
+!        Linux(g77) 2.4.21-32 - 11/13/07
+!         7-Mar-08 18:32
+ 
+sp rm -f b1566.jnl
+sp echo if 1 then > b1566.jnl
+sp echo if 1 then >> b1566.jnl
+sp echo exit/script >> b1566.jnl
+sp echo endif >> b1566.jnl
+sp echo endif >> b1566.jnl
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+!!  IFs nested too deep
+ 
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+rep/l=1:7 go b1566.jnl
+!-> REPEAT: L=1
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=2
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=3
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=4
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=5
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=6
+if 1 then
+if 1 then
+exit/script
+!-> REPEAT: L=7
+if 1 then
+if 1 then
+exit/script
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_new_attr_on_axis
+! err61_new_attr_on_axis.jnl
+! For any var or axis, allow adding an attribute
+! Fix for bug 1574
+ 
+use ocean_atlas_temp
+sh dat
+     currently SET data sets:
+    1> ./ocean_atlas_temp.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     Temperature                      1:360     1:180     1:1       1:2       ...       ...
+ 
+define att/output (`temp,return=xaxis`).long_name = "Here is a long name for the x axis of TEMP"
+ !-> define att/output (XAX_LEV9421_380).long_name = "Here is a long name for the x axis of TEMP"
+save/file=a.nc/clobber/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! It is saved even on a subset of the axis
+save/file=a.nc/clobber/i=1:12/j=50/l=2 temp
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+DEFINE AXIS/y=-60:60:2/units=deg yaxis
+LET v = y[gy=yaxis]
+ 
+DEFINE att/output (yaxis).standard_name = "latitude"
+ 
+save/file=a.nc/clobber v
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_varcontext_attributes
+! Examples from bn_attributes, where instead of var.att[specifiers]
+! we use var[specifiers].att  where appropriate.
+ 
+!-----
+ 
+! SHOW ATTRIBUTE examples
+ 
+can data/all
+can var/all
+ 
+use ocean_atlas_temp
+use gt4d011
+use levitus_climatology
+ 
+sh att temp[d=1].units
+     attributes for dataset: ./ocean_atlas_temp.cdf
+ TEMP.units = Deg C 
+ 
+ 
+! note .[d=1].dimnames does not work
+use coads_climatology
+use gt4d011
+ 
+let vnames = ..dimnames[d=1]
+let lnames = ..dimnames[d=2]
+list vnames
+             VARIABLE : ..DIMNAMES[D=ocean_atlas_temp]
+             SUBSET   : 4 points (X)
+ 1   / 1:"XAX_LEV9421_380"
+ 2   / 2:"YAX_LEV94"      
+ 3   / 3:"ZAXLEVIT191_1"  
+ 4   / 4:"TIME"           
+list lnames
+             VARIABLE : ..DIMNAMES[D=gt4d011]
+             SUBSET   : 20 points (X)
+ 1    /  1:"PSXT"      
+ 2    /  2:"PSYT"      
+ 3    /  3:"PSYTedges" 
+ 4    /  4:"PSZT"      
+ 5    /  5:"PSZTedges" 
+ 6    /  6:"TIME1"     
+ 7    /  7:"PSXT91_108"
+ 8    /  8:"PSYT35_56" 
+ 9    /  9:"PSZT1_10"  
+ 10   / 10:"PSYT35_55" 
+ 11   / 11:"PSXU"      
+ 12   / 12:"PSYU"      
+ 13   / 13:"PSYUedges" 
+ 14   / 14:"PSXU91_108"
+ 15   / 15:"PSYU35_55" 
+ 16   / 16:"PSZW"      
+ 17   / 17:"PSZWedges" 
+ 18   / 18:"PSYT36_55" 
+ 19   / 19:"PSZW1_10"  
+ 20   / 20:"PSYU35_56" 
+ 
+go bn_reset
+cancel mode verify
+ 
+ 
+!-----
+! more on number of attributes
+ 
+use levitus_climatology
+use ocean_atlas_temp
+let nat = temp.nattrs
+list nat
+             VARIABLE : TEMP.NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          5.000
+ 
+list (`temp,return=xaxis`)[d=2].nattrs
+ !-> list (XAX_LEV9421_380)[d=2].nattrs
+             VARIABLE : (XAX_LEV9421_380)[d=ocean_atlas_temp].NATTRS
+             FILENAME : ocean_atlas_temp.cdf
+          4.000
+ 
+use gt4d011
+say `temp[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 5
+5
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+list `($xaxnam)[d=1].nattrs`
+ !-> list 4
+             VARIABLE : constant
+          4.000
+say `($yaxnam)[d=1].nattrs`
+ !-> MESSAGE/CONTINUE 3
+3
+ 
+go bn_reset
+cancel mode verify
+ 
+!-----
+! more on access to attribute names and values as variables
+ 
+use coads_climatology
+use levitus_climatology
+use ocean_atlas_temp
+use gt4d011
+ 
+let a = temp.units
+list/d=3 a
+             VARIABLE : TEMP.UNITS
+             FILENAME : ocean_atlas_temp.cdf
+        "Deg C"
+list temp[d=3].units
+             VARIABLE : TEMP[d=ocean_atlas_temp].UNITS
+             FILENAME : gt4d011.cdf
+        "Deg C"
+list/d=3 temp.history
+             VARIABLE : TEMP.HISTORY
+             FILENAME : ocean_atlas_temp.cdf
+        "From ocean_atlas_monthly"
+ 
+can data/all
+can var/all
+ 
+use coads_climatology
+! This syntax does not work:
+! list sst[d=1].dimnames[i=2]
+ 
+! But this does
+let a = sst[d=1].dimnames
+list a[i=2]
+             VARIABLE : SST[d=coads_climatology].DIMNAMES
+             FILENAME : coads_climatology.cdf
+             X        : 2
+        "COADSY"
+ 
+go bn_reset
+cancel mode verify
+ 
+! When the variable context is given in an attribute
+! spec, we want to ignore the information except for the
+! dataset, and just return the attribute of the variable.
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[x=30:39,y=-90:90]
+list ($ferret_plot_var).long_name
+ !-> list sst[x=30:39,y=-90:90].long_name
+             VARIABLE : SST.LONG_NAME
+             FILENAME : coads_climatology.cdf
+        "SEA SURFACE TEMPERATURE"
+ 
+use coads_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).units
+ !-> list sst[d=1,x=30:35,y=-90:90].units
+             VARIABLE : SST[d=coads_climatology].UNITS
+             FILENAME : coads_climatology.cdf
+        "Deg C"
+ 
+use coads_climatology
+use levitus_climatology
+define symbol ferret_plot_var sst[d=1,x=30:35,y=-90:90]
+list ($ferret_plot_var).history
+ !-> list sst[d=1,x=30:35,y=-90:90].history
+             VARIABLE : SST[d=coads_climatology].HISTORY
+             FILENAME : levitus_climatology.cdf
+        "From coads_climatology"
+ 
+go bn_reset
+cancel mode verify
+ 
+use levitus_climatology
+use coads_climatology
+ 
+def sym xaxnam  "(`temp[d=1],return=xaxis`)"
+ !-> def sym xaxnam  "(XAXLEVITR1_160)"
+def sym yaxnam  "(`temp[d=1],return=yaxis`)"
+ !-> def sym yaxnam  "(YAXLEVITR1_90)"
+ 
+list ($xaxnam)[d=1].modulo
+ !-> list (XAXLEVITR1_160)[d=1].modulo
+             VARIABLE : (XAXLEVITR1_160)[d=levitus_climatology].MODULO
+             FILENAME : coads_climatology.cdf
+        " "
+list ($yaxnam).point_spacing[d=1]
+ !-> list (YAXLEVITR1_90).point_spacing[d=1]
+             VARIABLE : (YAXLEVITR1_90).POINT_SPACING[D=levitus_climatology]
+             FILENAME : levitus_climatology.cdf
+        "even"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_show_dat_var_xml
+! err61_show_dat_var_xml.jnl
+! See bug 1580. Intermediate variablels associated with a
+! variable that uses a grid-changing function should be
+! skipped when writing variables by SHOW DATA/VAR/XML
+ 
+! Define some varibles as in some of the tests of
+! zaxreplace. Write to files.
+ 
+! Define some variables as in some of the benchmark
+! tests of zaxreplace. Write to files.
+ 
+LET ddat = ZSEQUENCE({1126,1136,1146,1156,1166})
+LET cycle = ZSEQUENCE({346, 347, 349, 350, 351})
+DEFINE AXIS/Z=10:50:10 zaxis_orig
+LET cycle_orig = cycle[GZ=zaxis_orig at ASN]
+LET ddat_orig = ddat[GZ=zaxis_orig at ASN]
+ 
+SAVE/CLOBBER/FILE=z1.nc ddat_orig
+SAVE/CLOBBER/FILE=z2.nc cycle_orig
+ 
+! Now use this data and define a user variable
+! associated with datset 2 using ZAXREPLACE
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE z1
+USE z2
+DEFINE AXIS/Z=345:353:1 zaxis_des
+LET dummy = Z[GZ=zaxis_des]
+LET/D=2 ddat_a = ZAXREPLACE(ddat_orig[d=1], cycle_orig[d=2], dummy)
+ 
+! Note how there are intermediate variables associated with the
+! regridding operation
+ 
+SHOW DATA 2
+     currently SET data sets:
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ ------------------------------
+ DDAT_A[D=z2] = ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)
+ 
+ 
+! Those intermediate variables should be skipped
+! for SHOW DATA/VAR/XML
+ 
+SHOW DATA/VAR/XML 2
+<datasets>
+<dataset name="./z2.nc" default="true">
+<title> </title>
+<var name="CYCLE_ORIG">
+<attribute name="long_name" type="char">
+   <value><![CDATA[CYCLE[GZ=ZAXIS_ORIG at ASN]]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<grid name="GIX1">
+<axes>
+<zaxis>ZAXIS_ORIG</zaxis>
+</axes>
+</grid>
+</var>
+<var name="ddat_a">
+<attribute name="definition" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[ZAXREPLACE(DDAT_ORIG[D=1], CYCLE_ORIG[D=2], DUMMY)]]></value>
+</attribute>
+<grid name="(G006)">
+<axes>
+<zaxis>ZAXIS_DES</zaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="ZAXIS_ORIG">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>5</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>10</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>50</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[altitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXIS_ORIG]]></value>
+</attribute>
+</axis>
+<axis name="ZAXIS_DES">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>9</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>345</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>353</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[Z]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00
+ 30-FEB-1909 00 / 2:  59.00
+ 02-MAR-1909 00 / 3:  61.00
+ 04-MAR-1909 00 / 4:  63.00
+ 06-MAR-1909 00 / 5:  65.00
+ 08-MAR-1909 00 / 6:  67.00
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 3   / 3:  3.000
+save/clob/file=b.nc b
+ 
+*** Running test: bn_no_valid_on_plot.jnl
+! bn_no_valid_on_plot.jnl
+! Bug 1038 points out that the No Valid Data label that is
+! put onto 2D plot if there is no good data, is not put onto
+! 1D plots.  Add it to the variable title so it shows up in the key
+!
+! Plot a region where there is no data
+use coads_climatology
+plot/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C) No Valid Data                               
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.550E+00 0.120    0  SYSTEM  @ASLATITUDE : 39N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.350E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  7.750E+00  6.380E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  3.880E+00  6.080E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ 
+! and now valid data overlaid with all-missing data
+ 
+plot/x=56e:100e/y=10 sst[L=1]
+plot/over/x=56e:100e/y=40 sst[L=1]
+ppl list labels
+ @ACSEA SURFACE TEMPERATURE (Deg C)                                             
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.550E+00 0.120    0  SYSTEM  @ASLATITUDE : 9N
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  0.000E+00  6.350E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 3  7.750E+00  6.380E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 4  3.880E+00  6.080E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 5 -3.700E-01 -5.500E-01 0.080    0  SYSTEM  @ASSST[Y=39N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For plots with multi lines in one plot command, mark each if no data
+plot/x=56e:100e sst[L=1,y=10], sst[L=1,y=50], sst[L=1,y=20]
+ppl list labels
+                                                                                
+ @ASLONGITUDE                                                                   
+ @ASDeg C                                                                       
+
+          XPOS       YPOS     HGT   ROT   UNITS
+ LAB 1  0.000E+00  6.350E+00 0.120    0  SYSTEM  @ASTIME : 16-JAN 06:00
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 2  7.750E+00  6.380E+00 0.120    0  SYSTEM  @ASDATA SET: coads_climatology
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     RIGHT  JUSTIFY LABEL
+ LAB 3  3.880E+00  6.080E+00 0.120    0  SYSTEM  @A
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     CENTER JUSTIFY LABEL
+ LAB 4  2.490E+00 -7.900E-01 0.120    0  SYSTEM  @ASSST[Y=9N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 5  5.610E+00 -7.900E-01 0.114    0  SYSTEM  @ASSST[Y=49N] No Valid Data
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ LAB 6  2.490E+00 -1.050E+00 0.120    0  SYSTEM  @ASSST[Y=19N]
+ LINE PT:    0.000E+00 0.000E+00  NO LINE     LEFT   JUSTIFY LABEL
+ 
+! For 2D plots create a new MODE NODATA_LAB which if on, puts
+! the NO VALID DATA across the middle of the plot when there is
+! no data, but allows us to turn this off.
+ 
+CANCEL MODE nodata_lab
+SHADE/Y=80:90 sst[L=1]
+FILL/Y=80:90 sst[L=1]
+CONTOUR/Y=80:90 sst[L=1]
+ 
+VECTOR/Y=80:90 sst[L=1], sst[L=1]
+ 
+SET MODE/last nodata_lab
+*** Running test: bn_median.jnl
+! Test median smoothing tranform
+! Default length is 3
+ 
+use gtsa056_2.cdf
+let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
+plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]
+             DATA SET: ./gtsa056_2.cdf
+             TIME: 29-NOV-1982 10:30 to 01-JAN-1983 21:30
+             LONGITUDE: 180E
+             LATITUDE: 0
+             DEPTH (m): 5
+ Column  1: VAR is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983]
+ Column  2: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  3: VAR[T=@MED:3] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 3 pts on T)
+ Column  4: VAR[T=@MED:7] is U[X=180,Y=0,K=1,T=1-JAN-1982:1-JAN-1983] (median smoothed by 7 pts on T)
+                        VAR    VAR    VAR    VAR
+30-NOV-1982 23 / 106: -10.07 -10.07 -10.07 -11.98
+04-DEC-1982 00 / 107: -13.42 -13.42 -13.42 -10.07
+07-DEC-1982 01 / 108: -15.07 -13.42 -13.42 -10.07
+10-DEC-1982 02 / 109: -11.98 -11.98 -11.98 -10.07
+13-DEC-1982 03 / 110:  -4.63  -4.63  -4.63  -4.63
+16-DEC-1982 04 / 111:   0.77   0.77   0.77   0.77
+19-DEC-1982 05 / 112:   1.06   1.06   1.06   1.06
+22-DEC-1982 06 / 113:   2.75   2.75   2.75   2.75
+25-DEC-1982 07 / 114:   9.07   9.07   9.07   4.21
+28-DEC-1982 08 / 115:  10.80   9.07   9.07   4.21
+31-DEC-1982 09 / 116:   4.21  10.80  10.80   9.07
+ 
+use coads_climatology
+let var= sst[y=0,L=10]
+plot var,var[x=@med:3], var[x=@med:7]
+list/x=80w:50w var,var[x=@med:3], var[x=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LONGITUDE: 80W to 50W
+             LATITUDE: 1S
+             TIME: 15-FEB-0002 04:07
+ Column  1: VAR is SST[Y=0,L=10]
+ Column  2: VAR[X=@MED:3] is SST[Y=0,L=10] (median smoothed by 3 pts on X)
+ Column  3: VAR[X=@MED:7] is SST[Y=0,L=10] (median smoothed by 7 pts on X)
+               VAR    VAR    VAR
+79W   / 131:   ....  25.99  25.93
+77W   / 132:   ....   ....  25.99
+75W   / 133:   ....   ....  25.99
+73W   / 134:   ....   ....   ....
+71W   / 135:   ....   ....   ....
+69W   / 136:   ....   ....   ....
+67W   / 137:   ....   ....   ....
+65W   / 138:   ....   ....   ....
+63W   / 139:   ....   ....  27.80
+61W   / 140:   ....   ....  27.80
+59W   / 141:   ....  27.80  27.65
+57W   / 142:  27.80  27.80  27.70
+55W   / 143:  27.65  27.65  27.65
+53W   / 144:  27.43  27.65  27.65
+51W   / 145:  27.70  27.43  27.65
+ 
+let var= sst[x=180,L=10]
+plot var,var[y=@med:3], var[y=@med:7]
+list/y=-20:0 var,var[y=@med:3], var[y=@med:7]
+             DATA SET: ./coads_climatology.cdf
+             LATITUDE: 20S to 0
+             LONGITUDE: 179E
+             TIME: 15-FEB-0002 04:07
+ Column  1: VAR is SST[X=180,L=10]
+ Column  2: VAR[Y=@MED:3] is SST[X=180,L=10] (median smoothed by 3 pts on Y)
+ Column  3: VAR[Y=@MED:7] is SST[X=180,L=10] (median smoothed by 7 pts on Y)
+              VAR    VAR    VAR
+19S   / 36:  28.32  28.32  28.32
+17S   / 37:  28.57  28.57  28.57
+15S   / 38:  29.06  29.06  29.06
+13S   / 39:  29.43  29.24  29.23
+11S   / 40:  29.24  29.33  29.23
+9S    / 41:  29.33  29.24  29.23
+7S    / 42:  29.23  29.23  29.23
+5S    / 43:  28.97  28.97  28.97
+3S    / 44:  28.40  28.40  28.44
+1S    / 45:  28.36  28.40  28.40
+ 
+define axis/z=0:1000:20/depth zax
+let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
+plot/trans var, var[z=@med:3], var[z=@med:9]
+list/z=1:140 var, var[z=@med:3], var[z=@med:9]
+             Z: 1 to 140
+ Column  1: VAR is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX])
+ Column  2: VAR[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 3 pts on Z)
+ Column  3: VAR[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU(1+K[GZ=ZAX]) (median smoothed by 9 pts on Z)
+             VAR    VAR    VAR
+0     / 1:  1.900  1.900  0.3281
+20    / 2:  1.322  1.322  0.3281
+40    / 3:  0.328  0.328  0.2405
+60    / 4: -0.254 -0.157  0.3281
+80    / 5: -0.157 -0.254  0.3281
+100   / 6: -0.785 -0.157  0.3281
+120   / 7:  0.241  0.241  0.3281
+140   / 8:  0.390  0.390  0.3904
+ 
+set mode ignore
+! Argument to the median smoother must be odd.
+ 
+plot/trans var, var[z=@med:4]
+ 
+set mode/last ignore
+ 
+*** Running test: bn614_bug_fixes.jnl
+! bn614_bug_fixes.jnl
+! Fixes that go into v6.14 release
+ 
+GO bn_reset
+cancel mode verify
+GO err611_axislab
+! err611_axislab.jnl
+! Fix bug 1582: Horizontal axis label disappeared
+! if PPL AXLABP moves it to the upper axis
+ 
+plot/set/i=1:100 sin(i/6)
+ppl axlabp,1,-1
+ppl xlab TEMP(C)
+ppl ylab DEPTH
+ppl plot
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_360_calendar
+! err61_360_calendar.jnl
+!
+ 
+! This first has always been ok
+define axis/t=28-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+list t[gt=time]
+             VARIABLE : T
+                        axis TIME
+             SUBSET   : 6 points (TIME)
+             CALENDAR : 360_DAY
+ 28-FEB-1909 00 / 1:  57.00
+ 30-FEB-1909 00 / 2:  59.00
+ 02-MAR-1909 00 / 3:  61.00
+ 04-MAR-1909 00 / 4:  63.00
+ 06-MAR-1909 00 / 5:  65.00
+ 08-MAR-1909 00 / 6:  67.00
+ 
+! Should be able to specify 30-feb-1909 for a 360-day calendar but it
+! resulted in an error
+define axis/t=30-feb-1909:07-mar-1909:2/units=days/t0=1-jan-1909/calendar=d360 time
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_exit_if.jnl
+! err611_exit_if.jnl
+!
+! Bug 1587
+! This only in v6.11 GFDL release bug
+! Fixed in xeq_exit.F
+ 
+yes? sp echo if 1 then > a.jnl
+yes? sp echo exit/script >> a.jnl
+yes? sp echo endif >> a.jnl
+yes? sp echo go a > b.jnl
+yes? sp echo say hello >> b.jnl
+yes? go b  !the following fails to say "hello"
+go a
+if 1 then
+exit/script
+say hello
+hello
+go a
+if 1 then
+exit/script
+if 1 then
+exit/script
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_irreg.jnl
+! err611_save_irreg.jnl
+!
+! bug1587
+ 
+def axis/t time = {0,1,3}
+let a = t[gt=time]
+save/clob/file=a.nc a
+can var a
+can dat/all
+use a.nc
+save/clob/file=b.nc a
+let b = a
+list b
+             VARIABLE : A
+             FILENAME : a.nc
+             SUBSET   : 3 points (T)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 3   / 3:  3.000
+save/clob/file=b.nc b
+ 
+GO bn_reset
+cancel mode verify
+GO err611_wrong_fineaxis_range
+! err611_wrong_fineaxis_range.jnl
+! Bug 1594
+ 
+! (bug was on 64-bit machine only)
+! 7200-point axis in longitude. The coordinates run from -179.725 to 179.725,
+! delta 0.05.  If we give a range in x of -180:180 this is returned as index
+! 1:1  not 1:7200.  If we give a range of x=0:360 the correct range is used.
+ 
+! File saved from
+!use/order=xytz "http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/GHRSST/ghrsst_global"
+! save/clobber/file=fine_x_axis.nc sst[i=1:7200,y=0,L=1]
+ 
+use fine_x_axis
+sh grid sst
+    GRID GPY1
+ name       axis              # pts   start                end
+ LON       LONGITUDE         7200mr   179.97W(-179.97)     179.97E
+ LAT1800_1800 LATITUDE          1 r   0.025S               0.025S
+ ENS       Z (count)            1 r   1                    1
+ TIME1     TIME                 1 r   01-APR-2006 00:00    01-APR-2006 00:00
+ normal    E
+ normal    F
+ 
+! This first was wrong, returned data at x=-180
+list/x=180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.53
+ 
+list/i=7200 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180E
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.53
+list/x=-180 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.50
+list/i=1 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : fine_x_axis.nc
+             LONGITUDE: 180W(-180)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+          27.50
+ 
+! This gave a range in x of no points, so size was 1 should be 7200
+let the_plot_var = sst[x=-180:180]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+let the_plot_var = sst[x=0:360]
+say `the_plot_var,return=size`
+ !-> MESSAGE/CONTINUE 7200
+7200
+ 
+GO bn_reset
+cancel mode verify
+GO err611_digit_filename
+! err611_digit_filename.jnl
+! Under linux, FILE command fails if filename
+! starts with digit(s)
+ 
+! bug 287 (never had a benchmark test)
+ 
+REPEAT/RANGE=1:12:2/name=m \
+  (LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=`m`a.dat i; \
+   FILE/VAR="a`m`" `m`a.dat; LIST a`m`)
+!-> REPEAT: M:1
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=1a.dat i
+ !-> SET DATA/EZ/VAR="a1" 1a.dat
+ !-> LIST a1
+             VARIABLE : A1
+             FILENAME : 1a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:3
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=3a.dat i
+ !-> SET DATA/EZ/VAR="a3" 3a.dat
+ !-> LIST a3
+             VARIABLE : A3
+             FILENAME : 3a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:5
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=5a.dat i
+ !-> SET DATA/EZ/VAR="a5" 5a.dat
+ !-> LIST a5
+             VARIABLE : A5
+             FILENAME : 5a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:7
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=7a.dat i
+ !-> SET DATA/EZ/VAR="a7" 7a.dat
+ !-> LIST a7
+             VARIABLE : A7
+             FILENAME : 7a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:9
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=9a.dat i
+ !-> SET DATA/EZ/VAR="a9" 9a.dat
+ !-> LIST a9
+             VARIABLE : A9
+             FILENAME : 9a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+!-> REPEAT: M:11
+ !-> LIST/CLOBBER/NOHEAD/NOROWHEAD/I=1:3/FILE=11a.dat i
+ !-> SET DATA/EZ/VAR="a11" 11a.dat
+ !-> LIST a11
+             VARIABLE : A11
+             FILENAME : 11a.dat
+             SUBSET   : 3 points (X)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+SHOW DATA
+     currently SET data sets:
+    1> ./1a.dat
+ name     title                             I         J         K         L         M         N
+ A1       A1                               1:3       ...       ...       ...       ...       ...
+ 
+    2> ./3a.dat
+ name     title                             I         J         K         L         M         N
+ A3       A3                               1:3       ...       ...       ...       ...       ...
+ 
+    3> ./5a.dat
+ name     title                             I         J         K         L         M         N
+ A5       A5                               1:3       ...       ...       ...       ...       ...
+ 
+    4> ./7a.dat
+ name     title                             I         J         K         L         M         N
+ A7       A7                               1:3       ...       ...       ...       ...       ...
+ 
+    5> ./9a.dat
+ name     title                             I         J         K         L         M         N
+ A9       A9                               1:3       ...       ...       ...       ...       ...
+ 
+    6> ./11a.dat  (default)
+ name     title                             I         J         K         L         M         N
+ A11      A11                              1:3       ...       ...       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_parse_semicolon
+! err611_parse_semicolon.jnl
+! Bug 1608. The first time it was issued, the first command
+! below was split into two at the ;
+! Test this and some other combinations
+ 
+say "c ; d"
+c ; d
+say "c //d"
+c //d
+say "c (d"
+c (d
+say "c (d"; say "a ; b"
+"c (d"; say "a ; b"
+say "c (d; say a ; b"
+c (d; say a ; b
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ov_ax
+! err611_ov_ax.jnl
+!
+! bug 1609
+!
+! in the two lower panels, the plot/over/ax=0,0,0,0
+! messes up the ppl axlabp setting in the last command
+!
+ 
+can v
+set v ul; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2 {1,2,2,1},{0,0,3,0}
+set v ur; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+set v ll; ppl axlabp -1 -1; plot/nolab {-1,1,6}
+plot/ov/vs/nolab/line=2/ax=0,0,0,0 {1,2,2,1},{0,0,3,0}
+set v lr; ppl axlabp 0 0; plot/nolab {-1,1,6}
+ 
+GO bn_reset
+cancel mode verify
+GO err611_context_after_error
+! err611_context_after_error.jnl
+! ACM 11/12/08
+!
+! Bug 1421 - goes back even to older versions of Ferret e.g. 5.41 on stout
+! Context errors after
+!
+!    list a_regrid[d=1,gt=b[d=2]@mod]
+!    ...
+!    cancel data/all
+!
+! if the list command is issued before the variable a_regrid is defined.
+ 
+ 
+SET MODE ignore_error
+USE bug1421_a
+USE bug1421_b
+ 
+SHOW DATA
+     currently SET data sets:
+    1> ./bug1421_a.nc
+ name     title                             I         J         K         L         M         N
+ A        zonal wind stress                1:1       1:1       ...       1:20      ...       ...
+ 
+    2> ./bug1421_b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        T[GT=MON_IRREG_NLP]              ...       ...       ...       1:12      ...       ...
+ 
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+ LON88_88  LONGITUDE            1mr   141.25W              141.25W
+   Axis span (to cell edges) = 1 (modulo length = 360)
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+ LAT45_45  LATITUDE             1 r   1.011S               1.011S
+   Axis span (to cell edges) = 1
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ MON_IRREG_NLP TIME            12mi   16-JAN 12:00         16-DEC 12:00
+T0 = 01-JAN-0001 00:00:00
+CALENDAR = NOLEAP
+   Axis span (to cell edges) = 364 (modulo length = 365)
+ 
+DEF AXIS/T/UNITS="days"/T0="1-jan-0001"/cal=noleap tnew = tboxlo[GT=a[D=1]]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+LET a_regrid = a[D=1,GT=tnew at ASN]
+LIST a_regrid[D=1,GT=b[D=2]@MOD]
+             VARIABLE : A[D=bug1421_a,GT=TNEW at ASN]
+                        regrid: on T at MOD
+             SUBSET   : 12 points (TIME)
+             CALENDAR : NOLEAP
+             LONGITUDE: 141.3W
+             LATITUDE : 1S
+                        141.3W  
+                          1
+ 16-JAN 12      /  1:  0.05848
+ 15-FEB 00      /  2:  0.05188
+ 16-MAR 12      /  3:  0.04783
+ 16-APR 00      /  4:  0.03808
+ 16-MAY 12      /  5:  0.05938
+ 16-JUN 00      /  6:  0.06572
+ 16-JUL 12      /  7:  0.06153
+ 16-AUG 12      /  8:  0.07461
+ 16-SEP 00      /  9:  0.05815
+ 16-OCT 12      / 10:  0.06169
+ 16-NOV 00      / 11:  0.05655
+ 16-DEC 12      / 12:  0.05769
+ 
+CANCEL DATA/ALL
+SHOW AXIS LON88_88
+ name       axis              # pts   start                end
+SHOW AXIS LAT45_45
+ name       axis              # pts   start                end
+SHOW AXIS MON_IRREG_NLP
+ name       axis              # pts   start                end
+ 
+SET MODE/LAST ignore_error
+ 
+GO bn_reset
+cancel mode verify
+GO err611_isize_gc_fcns
+! err611_isize_gc_fcns.jnl
+! ACM 11/13/2008
+!
+! Testing the fix for bug 1523.  Previously after the SET REGION,
+! the RETURN= always returned a size of 10, the default region size.
+ 
+LET a = {1,2,3,4,5,6}
+ 
+! Should be 6
+SAY `a,RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+SET REGION/X=1:10
+! Should still be 6
+SAY `XSEQUENCE(a),RETURN=isize`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+! Should be 4
+SAY `XSEQUENCE(a[i=1:4]),RETURN=isize`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+SAY `XSEQUENCE(a[i=1:4]),RETURN=size`
+ !-> MESSAGE/CONTINUE 4
+4
+ 
+CANCEL REGION
+! Should be 5 then 6
+SAY `XSEQUENCE(a[i=1:5]),RETURN=size`
+ !-> MESSAGE/CONTINUE 5
+5
+SAY `XSEQUENCE(a),RETURN=size`
+ !-> MESSAGE/CONTINUE 6
+6
+ 
+GO bn_reset
+cancel mode verify
+GO err611_return_precision
+! err611_return_precision.jnl
+! 17-Nov-08 ACM
+ 
+! See bug 1611, where say "a`95,p=1`" yielded "a 95" but
+! "a`94,p=1`" yielded "a94"
+ 
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=1`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=1`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=1`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=1`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Note that an immediate expr with prec=0 returns an integer.
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`94,p=0`"
+ !-> MESSAGE/CONTINUE "a94"
+a94
+say "a`95,p=0`"
+ !-> MESSAGE/CONTINUE "a95"
+a95
+say "a`949,p=0`"
+ !-> MESSAGE/CONTINUE "a949"
+a949
+say "a`950,p=0`"
+ !-> MESSAGE/CONTINUE "a950"
+a950
+ 
+! Tests for non-integers
+! We always return at least one sig digit
+say "a`0.1,p=0`"
+ !-> MESSAGE/CONTINUE "a0.1"
+a0.1
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=1`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=1`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-94,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+say "a`-94.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-94.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-94"
+a-94
+ 
+say "a`-95,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+say "a`-95.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-96"
+a-96
+say "a`-95.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-95"
+a-95
+ 
+say "a`-949,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+say "a`-949.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-949.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-949"
+a-949
+ 
+say "a`-950,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+say "a`-950.99,p=0`"
+ !-> MESSAGE/CONTINUE "a-951"
+a-951
+say "a`-950.001,p=0`"
+ !-> MESSAGE/CONTINUE "a-950"
+a-950
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_var_ez
+! err611_set_var_ez.jnl
+! 6-Jan-2009
+! Ticket 1615
+!
+! SET VAR/UNITS=  etc for a variable in an EZ dataset
+! The settings were applied within the Ferret session (plots etc)
+! but not added to the attribute structure and not written to
+! output files.
+ 
+SP echo "err611_set_var_ez.jnl --- " >> all_ncdump.out
+ 
+! Create an ASCII dataset
+LET a = {1,3,5}
+LIST/NOHEAD/FORM=(F8.1)/FILE=dat.dat/CLOBBER a
+FILE/VAR=my_asc dat.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="micrograms/L"/TITLE="chlorophyll"/BAD=3 my_asc
+SHOW DAT/ATT
+     currently SET data sets:
+    1> ./dat.dat  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        7    F       dat.dat
+  
+ MY_ASC                FLOAT     long_name       CHAR        11   T       chlorophyll
+                                 missing_value   FLOAT       1    T       3
+                                 units           CHAR        12   T       micrograms/L
+  
+SAVE/FILE=a.nc/CLOBBER my_asc
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+! Create an Unformatted dataset
+LIST/FORM=UNF/file=unf.dat/CLOBBER a
+FILE/FORM=UNF/VAR=my_unf unf.dat
+ 
+! use SET VAR to add units, title, reset bad value
+SET VAR/UNITS="metres"/TITLE="Some Unformatted input"/BAD=5 my_unf
+SAVE/FILE=a.nc/CLOBBER my_unf
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_convert_missing_type
+! err611_convert_missing_type.jnl
+! Fix for bug 1620 message about converting data type of
+! missing value flag from double to float when the data
+! is from an EZ data set and being written to netCDF file.
+ 
+! Save some data and read it in as a delimited file
+ 
+LET xx = {-3,4,5}
+LET yy = {1,2,3}
+LIST/CLOBBER/NOHEAD/NOROWHEAD/FORM=(3f8.2)/FILE=lonlat.dat xx,yy
+DEFINE AXIS/X=1:3:1 xobs
+DEFINE GRID/X=xobs gobs
+COL/GRID=gobs/VAR="lon,lat"/TYPE="longitude,latitude"  lonlat.dat
+ 
+! On this SAVE, previously got a NOTE about converting the type of the
+! missing-value attribute to match the type of the variable.
+ 
+SAVE/CLOBBER/FILE=lonlat.nc lat, lon
+ 
+GO bn_reset
+cancel mode verify
+GO err611_shade_fill_levs
+! err611_shade_fill_levs.jnl
+! 2/27/2009
+! Bug 1641: On 32-bit linux, these give different
+! sets of levels. They should be the same.
+ 
+shade x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "20"
+LEV_DEL = "0.05"
+fill  x[gx=0:1:.1]*y[gy=0:1:.1]; sh sym lev*
+LEV_MIN = "0"
+LEV_MAX = "1"
+LEV_NUM = "20"
+LEV_DEL = "0.05"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_set_uvar_outtyp
+! err611_set_uvar_outtyp.jnl
+! fix for bug 1646: set outtype for user variables.
+ 
+sp echo "bn_attributes.jnl --- SET VAR/OUTTYPE for user variable" >> all_ncdump.out
+ 
+LET a = {1.1,2.2,3.3}
+SET VAR/OUTTYPE = double a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+! When changing to INT, need to also change the
+! missing-value flag.
+LET a = { 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}
+SET VAR/BAD=999/OUTTYPE=int a
+SAVE/CLOBBER/FILE=a.nc a
+SP ncdump a.nc >> all_ncdump.out
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_save_from_desc
+! err611_save_from_desc.jnl
+!
+! In Ferret v6.19+ this failed with
+!  ** netCDF error: Failed creating coord variable %%
+ 
+use coads_clim.des
+save/clobber/file=a.nc/i=100 sst
+ 
+GO bn_reset
+cancel mode verify
+GO err611_irregular_axis
+ ! err611_irregular_axis.jnl
+ 
+ ! See bug 1483, all about detecting irregular and regular axes. Finally
+ ! did the right thing and test double-precision coordinates in DP and
+ ! if single precision axes comes in, test that in SP.
+ 
+! The dataset was created as follows to have large time coordinates but
+! irregularly spaced.
+ 
+! define axis/t=1-jan-2008:"1-jan-2008:00:02:22":1/units=seconds/t0="1-jan-0001" tax
+! let cc = L[gt=tax]
+! save/file=cc.nc/clobber cc
+! Use ncdump to write a cdl file and edit that file to remove one time
+! coordinate and one value of cc. Run ncgen and write cc_irreg.nc
+ 
+! Previous versions of this detected the axis as regular.
+ 
+use cc_irreg.nc
+sh grid cc
+    GRID GCZ1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TAX       TIME               142 i   30-DEC-2007 00:00    30-DEC-2007 00:02
+ normal    E
+ normal    F
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err611_ef_string_result
+! err611_ef_string_result.jnl
+! testing the fix for bug 1621
+! call to EFCN_GET_RTN_TYPE wasn't hooked up in gcf_rtn_type.F
+!
+ 
+define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax
+define grid/t=tax gg
+let date_list = t[t=29000:29900:100]
+list tax_datestring(date_list,t[g=gg],"day")
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+let v = tax_datestring(date_list,t[g=gg],"day")
+list v
+             VARIABLE : TAX_DATESTRING(DATE_LIST,T[G=GG],"day")
+             SUBSET   : 10 points (T)
+ 29000   /  1:"09-JUN-1980"
+ 29100   /  2:"17-SEP-1980"
+ 29200   /  3:"26-DEC-1980"
+ 29300   /  4:"05-APR-1981"
+ 29400   /  5:"14-JUL-1981"
+ 29500   /  6:"22-OCT-1981"
+ 29600   /  7:"30-JAN-1982"
+ 29700   /  8:"10-MAY-1982"
+ 29800   /  9:"18-AUG-1982"
+ 29900   / 10:"26-NOV-1982"
+ 
+! Combine tax_datestring call with *cat_str function
+ 
+let yr = tax_datestring(date_list,t[g=gg],"second")
+let both = tcat_str(v, yr)
+list both
+             VARIABLE : TCAT_STR(V, YR)
+             SUBSET   : 20 points (T)
+ 1    /  1:"09-JUN-1980"         
+ 2    /  2:"17-SEP-1980"         
+ 3    /  3:"26-DEC-1980"         
+ 4    /  4:"05-APR-1981"         
+ 5    /  5:"14-JUL-1981"         
+ 6    /  6:"22-OCT-1981"         
+ 7    /  7:"30-JAN-1982"         
+ 8    /  8:"10-MAY-1982"         
+ 9    /  9:"18-AUG-1982"         
+ 10   / 10:"26-NOV-1982"         
+ 11   / 11:"09-JUN-1980 00:00:00"
+ 12   / 12:"17-SEP-1980 00:00:00"
+ 13   / 13:"26-DEC-1980 00:00:00"
+ 14   / 14:"05-APR-1981 00:00:00"
+ 15   / 15:"14-JUL-1981 00:00:00"
+ 16   / 16:"22-OCT-1981 00:00:00"
+ 17   / 17:"30-JAN-1982 00:00:00"
+ 18   / 18:"10-MAY-1982 00:00:00"
+ 19   / 19:"18-AUG-1982 00:00:00"
+ 20   / 20:"26-NOV-1982 00:00:00"
+ 
+let xt = xcat_str(v, yr)
+list xt
+             VARIABLE : XCAT_STR(V, YR)
+             SUBSET   : 2 by 10 points (X-T)
+                         1                     2            
+                          1                     2
+ 29000   /  1:"09-JUN-1980"         "09-JUN-1980 00:00:00"
+ 29100   /  2:"17-SEP-1980"         "17-SEP-1980 00:00:00"
+ 29200   /  3:"26-DEC-1980"         "26-DEC-1980 00:00:00"
+ 29300   /  4:"05-APR-1981"         "05-APR-1981 00:00:00"
+ 29400   /  5:"14-JUL-1981"         "14-JUL-1981 00:00:00"
+ 29500   /  6:"22-OCT-1981"         "22-OCT-1981 00:00:00"
+ 29600   /  7:"30-JAN-1982"         "30-JAN-1982 00:00:00"
+ 29700   /  8:"10-MAY-1982"         "10-MAY-1982 00:00:00"
+ 29800   /  9:"18-AUG-1982"         "18-AUG-1982 00:00:00"
+ 29900   / 10:"26-NOV-1982"         "26-NOV-1982 00:00:00"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err61_contour_subspan_reps
+! err61_contour_subspan_reps.jnl
+! Bug 1659.
+!
+!
+! CONTOUR (or FILL) doesn't work properly with a subspan modulo axis,
+! unlike SHADE. And we get different CONTOUR results if the subspan modulo
+! axis coordinates are supplied on the positive vs. the negative modulo branch.
+ 
+use coads_climatology
+let a = sst[x=120:284,y=-2:2 at ave]
+save/clob/file=a.nc a
+ 
+can var a
+use a
+set reg/x=125e:70w
+shade/x=-360:360 a
+fill/ov/pal=greyscale/x=-360:360 a
+cont/ov/x=-360:360 a
+ 
+! Now region in negative x
+ 
+can dat/all; can var/all
+ 
+use coads_climatology
+let b = sst[x=-240:-76,y=-2:2 at ave]
+save/clob/file=b.nc b
+ 
+can var b
+use b
+set reg/x=125e:70w
+shade/x=-360:360 b
+fill/ov/pal=greyscale/x=-360:360 b
+cont/ov/x=-360:360 b
+ 
+*** Running test: bn_mode_nodata_lab.jnl
+! bn_mode_nodata_lab
+! turns off the No Valid Data label on plots
+! (for line plots this is added to the plot label,
+!  if the mode is SET).
+ 
+SHOW MODE nodata_lab
+      MODE            STATE        ARGUMENT
+      NODATA_LAB       SET
+ 
+use coads_climatology
+let uwnd = sst
+let vwnd = -1*sst
+ 
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+can mode nodata_lab
+plot/y=50/x=70e:110e/L=1 sst
+shade/y=40:50/x=70e:110e/L=1 sst
+vec/y=40:50/x=70e:110e/L=1 uwnd,vwnd
+contour/y=40:50/x=70e:110e/L=1 vwnd
+contour/fill/y=40:50/x=70e:110e/L=1 vwnd
+ 
+set mode/last nodata_lab
+ 
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+! proleptic_gregorian_calendar.jnl
+! Allow PROLEPTIC_GREGORIAN as a calendar attribute
+! for the default Ferret calendar.
+ 
+set data proleptic_gregorian.nc
+show data
+     currently SET data sets:
+    1> ./proleptic_gregorian.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MY_DATA  SIN(L[GT=TDAYS])                 ...       ...       ...       1:32      ...       ...
+ 
+show axis tdays
+ name       axis              # pts   start                end
+ TDAYS     TIME                32 r   01-JAN-1988 00:00    01-FEB-1988 00:00
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 32
+*** Running test: bn_string_ngd_nbd.jnl
+! @NGD and @NBD for strings
+! Bad data is taken to be the null string
+! Compare with results for numeric data
+! *ACM 11/2008
+ 
+let a = {"a","b",,"cd"}
+list a[i=@ngd]
+             VARIABLE : {"a","b",,"cd"} (# of points)
+             X        : 0.5 to 4.5 (number of valid)
+          3.000
+ 
+let a = {"a","b",,"c",,"d",,,"e","f","g","h"}
+let b = { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3}
+list a[i=@nbd]
+             VARIABLE : {"a","b",,"c",,"d",,,"e","f","g","h"} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000
+list b[i=@nbd]
+             VARIABLE : { 3,  3 ,, 3 ,, 3 ,,, 3,  3,  3,  3} (# of points)
+             X        : 0.5 to 12.5 (number flagged bad)
+          4.000
+ 
+define axis/x=1:3:1 xax
+define axis/y=1:4:1 yax
+let v = x[gx=xax] + y[gy=yax]
+ 
+let av = reshape (a,v)
+let bv = reshape (b,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Y)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list av[j=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list bv[j=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Y        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list av[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000
+list bv[i=@ngd,j=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XY # valid)
+             Y        : 0.5 to 4.5 (XY # valid)
+          8.000
+ 
+ 
+define axis/x=1:3:1 xax
+define axis/z=1:4:1 zax
+let v = x[gx=xax] + z[gz=zax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  0.000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (Z)
+             X        : 0.5 to 3.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  1.000
+ 3   / 3:  2.000
+ 4   / 4:  0.000
+list av[k=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+list bv[k=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             Z        : 0.5 to 4.5 (number flagged bad)
+ 1   / 1:  1.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+list av[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000
+list bv[i=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XZ # bad)
+             Z        : 0.5 to 4.5 (XZ # bad)
+          4.000
+ 
+define axis/x=1:3:1 xax
+define axis/t=1:4:1 tax
+let v = x[gx=xax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list bv[i=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 4 points (T)
+             X        : 0.5 to 3.5 (number of valid)
+ 1   / 1:  2.000
+ 2   / 2:  2.000
+ 3   / 3:  1.000
+ 4   / 4:  3.000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 3 points (X)
+             T        : 0.5 to 4.5 (number of valid)
+ 1   / 1:  3.000
+ 2   / 2:  2.000
+ 3   / 3:  3.000
+list av[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000
+list bv[i=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 3.5 (XT # valid)
+             T        : 0.5 to 4.5 (XT # valid)
+          8.000
+ 
+!4D variable
+let a = {"a","b",,"c",,"d",,,"e","f","g","h","ab","bb",,"cb",,"db",,,"eb","fb","gb","hb"}
+let b = {3,3,,3,,3,,,3,3,3,3,3,3,,3,,3,,,3,3,3,3}
+ 
+define axis/x=1:2:1 xax
+define axis/y=1:2:1 yax
+define axis/z=1:3:1 zax
+define axis/t=1:2:1 tax
+let v = x[gx=xax] + y[gy=yax] + z[gz=zax] + t[gt=tax]
+ 
+let av = reshape (a,v)
+list av[i=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+list bv[i=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (Y-Z-T)
+             X        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  0.000  1.000
+ 2   / 2:  1.000  2.000
+ 3   / 3:  0.000  0.000
+list av[j=@nbd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+list bv[j=@nbd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 3 by 2 points (X-Z-T)
+             Y        : 0.5 to 2.5 (number flagged bad)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+ ---- L:2 T:   2
+ 1   / 1:  1.000  0.000
+ 2   / 2:  2.000  1.000
+ 3   / 3:  0.000  0.000
+list av[k=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+ ---- L:2 T:   2
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+list bv[k=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             Z        : 0.5 to 3.5 (number of valid)
+             1      2    
+             1      2
+ ---- L:1 T:   1
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+ ---- L:2 T:   2
+ 1   / 1:  2.000  3.000
+ 2   / 2:  1.000  2.000
+list av[L=@ngd]
+             VARIABLE : RESHAPE (A,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000  2.000
+ 2   / 2:  0.000  2.000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000  2.000
+ 2   / 2:  0.000  0.000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000  2.000
+ 2   / 2:  2.000  2.000
+list bv[L=@ngd]
+             VARIABLE : RESHAPE (B,V) (# of points)
+             SUBSET   : 2 by 2 by 3 points (X-Y-Z)
+             T        : 0.5 to 2.5 (number of valid)
+             1      2    
+             1      2
+ ---- K:1 Z:   1
+ 1   / 1:  2.000  2.000
+ 2   / 2:  0.000  2.000
+ ---- K:2 Z:   2
+ 1   / 1:  0.000  2.000
+ 2   / 2:  0.000  0.000
+ ---- K:3 Z:   3
+ 1   / 1:  2.000  2.000
+ 2   / 2:  2.000  2.000
+ 
+list av[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (A,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000
+ 2   / 2:  4.000
+list bv[i=@nbd,j=@nbd,k=@nbd]
+             VARIABLE : RESHAPE (B,V)
+             SUBSET   : 2 points (T)
+             X        : 0.5 to 2.5 (XYZ # bad)
+             Y        : 0.5 to 2.5 (XYZ # bad)
+             Z        : 0.5 to 3.5 (XYZ # bad)
+ 1   / 1:  4.000
+ 2   / 2:  4.000
+ 
+list bv[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (B,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00
+list av[i=@ngd,j=@ngd,k=@ngd,L=@ngd]
+             VARIABLE : RESHAPE (A,V)
+             X        : 0.5 to 2.5 (XYZT # valid)
+             Y        : 0.5 to 2.5 (XYZT # valid)
+             Z        : 0.5 to 3.5 (XYZT # valid)
+             T        : 0.5 to 2.5 (XYZT # valid)
+          16.00
+*** Running test: bn_cat_string.jnl
+! bn_cat_string.jnl
+! Test concatenation functions for string variables
+! ACM nov 08  See bug 1577
+ 
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat(a,b)
+             VARIABLE : XCAT(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+! (when xcat is called, and its args are strings,
+!  Ferret actually runs xcat_string)
+let a = xsequence({"Q", "R", "S"})
+let b = xsequence({"U", "V", "W"})
+list xcat_str(a,b)
+             VARIABLE : XCAT_STR(A,B)
+             SUBSET   : 6 points (X)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = ysequence({"Q", "R", "S"})
+let b = ysequence({"U", "V", "W"})
+list ycat(a,b)
+             VARIABLE : YCAT(A,B)
+             SUBSET   : 6 points (Y)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = zsequence({"Q", "R", "S"})
+let b = zsequence({"U", "V", "W"})
+list zcat(a,b)
+             VARIABLE : ZCAT(A,B)
+             SUBSET   : 6 points (Z)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+ 
+let a = tsequence({"Q", "R", "S"})
+let b = tsequence({"U", "V", "W"})
+list tcat(a,b)
+             VARIABLE : TCAT(A,B)
+             SUBSET   : 6 points (T)
+ 1   / 1:"Q"
+ 2   / 2:"R"
+ 3   / 3:"S"
+ 4   / 4:"U"
+ 5   / 5:"V"
+ 6   / 6:"W"
+*** Running test: bn_sort_strings.jnl
+! bn_sort_strings.jnl
+! 11/08 acm
+ 
+! show func/detail now shows the alternative function for
+! other arg types, if it exists.
+ 
+SHOW FUNC/DETAIL sorti
+SORTI(DAT)
+    Returns indices of data, sorted on the I axis in increasing order
+        Axes of result:
+          X: ABSTRACT (result will occupy indices 1...N)
+          Y: inherited from argument(s)
+          Z: inherited from argument(s)
+          T: inherited from argument(s)
+          E: inherited from argument(s)
+          F: inherited from argument(s)
+    DAT: variable to sort in I
+        Influence on output axes:
+          X: no influence (indicate argument limits with "[]")
+          Y: passed to result grid
+          Z: passed to result grid
+          T: passed to result grid
+          E: passed to result grid
+          F: passed to result grid
+    Alternative function called for other argument types: SORTI_STR
+ 
+ 
+let ai = {"a rat in the house will eat the zucchini", \
+  "a rat in the house will eat the ice cream", \
+  "ze rats in the house will eat the ice cream",\
+  "A rat in the house will eat the ICE CREAM" }
+ 
+let bi = {"AB", "C", "", "aa", "abc", ,"0"}
+ 
+let indx_ai = SORTI_STR(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI_STR(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+        INDX_AI                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI_STR(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI_STR(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+        INDX_BI   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+! Calling via SORTI
+let indx_ai = SORTI(ai)
+list indx_ai, samplei(ai,indx_ai)
+             X: 0.5 to 4.5
+ Column  1: INDX_AI is SORTI(AI)
+ Column  2: EX#2 is SAMPLEI(AI,INDX_AI)
+        INDX_AI                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bi = SORTI(bi)
+list indx_bi, samplei(bi,indx_bi)
+             X: 0.5 to 7.5
+ Column  1: INDX_BI is SORTI(BI)
+ Column  2: EX#2 is SAMPLEI(BI,INDX_BI)
+        INDX_BI   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTJ
+let aj = ysequence(ai)
+let bj = ysequence(bi)
+ 
+let indx_aj = SORTJ(aj)
+list indx_aj, samplej(aj,indx_aj)
+             Y: 0.5 to 4.5
+ Column  1: INDX_AJ is SORTJ(AJ)
+ Column  2: EX#2 is SAMPLEJ(AJ,INDX_AJ)
+        INDX_AJ                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bj = SORTJ(bj)
+list indx_bj, samplej(bj,indx_bj)
+             Y: 0.5 to 7.5
+ Column  1: INDX_BJ is SORTJ(BJ)
+ Column  2: EX#2 is SAMPLEJ(BJ,INDX_BJ)
+        INDX_BJ   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTK
+let ak = zsequence(ai)
+let bk = zsequence(bi)
+ 
+let indx_ak = SORTK(ak)
+list indx_ak, samplek(ak,indx_ak)
+             Z: 0.5 to 4.5
+ Column  1: INDX_AK is SORTK(AK)
+ Column  2: EX#2 is SAMPLEK(AK,INDX_AK)
+        INDX_AK                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bk = SORTK(bk)
+list indx_bk, samplek(bk,indx_bk)
+             Z: 0.5 to 7.5
+ Column  1: INDX_BK is SORTK(BK)
+ Column  2: EX#2 is SAMPLEK(BK,INDX_BK)
+        INDX_BK   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+ 
+! SORTL
+let al = tsequence(ai)
+let bl = tsequence(bi)
+ 
+let indx_al = SORTL(al)
+list indx_al, samplel(al,indx_al)
+             T: 0.5 to 4.5
+ Column  1: INDX_AL is SORTL(AL)
+ Column  2: EX#2 is SAMPLEL(AL,INDX_AL)
+        INDX_AL                       EX#2
+1   / 1:   4.000 "A rat in the house will eat the ICE CREAM"  
+2   / 2:   2.000 "a rat in the house will eat the ice cream"  
+3   / 3:   1.000 "a rat in the house will eat the zucchini"   
+4   / 4:   3.000 "ze rats in the house will eat the ice cream"
+ 
+let indx_bl = SORTL(bl)
+list indx_bl, samplel(bl,indx_bl)
+             T: 0.5 to 7.5
+ Column  1: INDX_BL is SORTL(BL)
+ Column  2: EX#2 is SAMPLEL(BL,INDX_BL)
+        INDX_BL   EX#2
+1   / 1:   7.000 "0"  
+2   / 2:   1.000 "AB" 
+3   / 3:   2.000 "C"  
+4   / 4:   4.000 "aa" 
+5   / 5:   5.000 "abc"
+6   / 6:    .... ""   
+7   / 7:    .... ""   
+ 
+*** Running test: bn_samplexyt.jnl
+! bn_samplexyt.jnl
+! 1/2009
+ 
+! Check the SAMPLEXYT function, should give missing results for T sample points
+! that lie beyond the ends of the T axis of the grid being sampled
+ 
+define axis/x=0:360:180/units=longitude/edges/modulo x1
+define axis/y=-90:90:45/units=latitude/edges y1
+define axis/t0=1-jan-1990/t=1-jan-1991:31-dec-1991:1/units=days/edges t1
+define grid/x=x1/y=y1/t=t1 g1
+ 
+let my_data = 0*x[g=g1]+y[g=g1]+t[g=g1]
+ 
+DEFINE AXIS/T0=1-JAN-1990/T=1-JAN-1990:31-DEC-1992:40/UNITS=DAYS/EDGES TSAMPLES
+LET TPTS = XSEQUENCE(T[GT=TSAMPLES])
+LET YPTS = XSEQUENCE((RANDU(TPTS)-0.5)*90)
+LET XPTS = 180 + 0*YPTS
+LET sampl_pts =  SAMPLEXYT(my_data,xpts,ypts,tpts)
+ 
+!  NOTE THAT THE SAMPLEXYT SHOULD FLAG POINTS BEFORE THE START OF THE TIME INTERVAL
+!  AND ALOS THOSE THAT LIE ABOVE THE END OF THE TIME INTERVAL
+ 
+! CHECK THE RESULTS WITH A LISTING
+list ypts, tpts, sampl_pts
+             X: 0.5 to 28.5
+ Column  1: YPTS is XSEQUENCE((RANDU(TPTS)-0.5)*90)
+ Column  2: TPTS is XSEQUENCE(T[GT=TSAMPLES])
+ Column  3: SAMPL_PTS is SAMPLEXYT(MY_DATA,XPTS,YPTS,TPTS)
+            YPTS   TPTS  SAMPL_PTS
+1    /  1:  20.54    20.    ....
+2    /  2: -29.07    60.    ....
+3    /  3:  26.64   100.    ....
+4    /  4: -28.97   140.    ....
+5    /  5: -17.10   180.    ....
+6    /  6:  -8.79   220.    ....
+7    /  7: -26.49   260.    ....
+8    /  8:  -9.00   300.    ....
+9    /  9: -19.19   340.    ....
+10   / 10: -19.84   380.   360.7
+11   / 11: -44.11   420.   376.4
+12   / 12:  34.07   460.   494.6
+13   / 13:  34.63   500.   535.1
+14   / 14:  -6.60   540.   533.9
+15   / 15: -39.01   580.   541.5
+16   / 16: -25.63   620.   594.9
+17   / 17: -22.97   660.   637.5
+18   / 18: -30.91   700.   669.6
+19   / 19: -22.52   740.    ....
+20   / 20: -20.65   780.    ....
+21   / 21: -41.66   820.    ....
+22   / 22:  39.14   860.    ....
+23   / 23:  22.88   900.    ....
+24   / 24: -41.03   940.    ....
+25   / 25:  33.35   980.    ....
+26   / 26:  22.54  1020.    ....
+27   / 27:  13.98  1060.    ....
+28   / 28:  21.99  1100.    ....
+ 
+! AND HERE WE SHOW IT GRAPHICALLY
+cancel mode calendar
+set view upper
+shade/hlim=20:1100 my_data[x=180]
+ 
+set view lower
+plot/vs/xlim=20:1100/ylim=0:1000 tpts, 0*MISSING(sampl_pts,0) + 500
+plot/vs/color=red/over tpts, sampl_pts
+ 
+ 
+set mode calendar
+*** Running test: bn_last_go_file.jnl
+! bn_last_go_file.jnl
+! test the automatically-defined symbol LAST_GO_FILE
+ 
+show sym last_go_file
+LAST_GO_FILE = "./bn_last_go_file.jnl"
+ 
+*** Running test: bn_cancel_upcase_uservar.jnl
+! bn_cancel_upcase_uservar.jnl
+!
+! Ferret v6.2
+! MODE upcase_only cancelled, now writes lowercase
+! spelling for user-defined variables and for coordinate
+! variables even coming from two different datasets.
+ 
+CANCEL MODE upcase
+ 
+! User variable with lowercase letters in the name
+ 
+DEFINE AXIS/t=1-jan-1999:31-jan-1999:1/units=days/t0=31-dec-1998 tday
+LET MyUpperLowerCaseVar = x[x=1:10] + t[gt=tday]
+save/file=a.nc/clobber MyUpperLowerCaseVar
+ 
+! Open two datafiles. These have variable and axis
+! names in lowercase.
+ 
+USE a1478.nc
+USE a_cartesian_bug1179.nc
+ 
+! Define an output variable with some axes from each dataset.
+LET/D=2 zvar = z[gz=temp[d=2]]
+LET newvar =  0*zvar[d=2] + olr[d=1]
+SET ATT/LIKE=olr[d=1] newvar
+SET ATT/OUTPUT=all newvar
+ 
+SAVE/APPEND/FILE=a.nc newvar
+SP ncdump -h a.nc >> all_ncdump.out
+ 
+SET MODE/LAST upcase_output
+*** Running test: bn_cdf_keepax.jnl
+! bn320_cdf
+! benchmark to test netCDF input and output
+! This is the same as bn_cdf with /KEEP_AXNAMES added to SAVE commands.
+ 
+! test many simultaneous netCDF files
+GO bn_cdf_keepax.sub1
+! bn230_cdf.sub1
+! benchmark to test multiple netCDF simultaneous accesses
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- clean up files before writing
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! delete old ones
+sp rm -f test0[a-p].cdf
+ 
+! write a bunch of em
+list/format=cdf/keep_axnames/append/l=1:500/file=test0a.cdf l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0b.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0c.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0d.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0e.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0f.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0g.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0h.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0i.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0j.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0k.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0l.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0m.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0n.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0o.cdf/rigid l
+list/format=cdf/keep_axnames/append/l=1:500/file=test0p.cdf/rigid l
+ 
+! initialize all at once
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+show data 1
+     currently SET data sets:
+    1> ./test0a.cdf
+ name     title                             I         J         K         L         M         N
+ L_       L                                ...       ...       ...       1:500     ...       ...
+       (axis ABSTRACT)
+ 
+show data/br
+     currently SET data sets:
+    1> ./test0a.cdf
+    2> ./test0b.cdf
+    3> ./test0c.cdf
+    4> ./test0d.cdf
+    5> ./test0e.cdf
+    6> ./test0f.cdf
+    7> ./test0g.cdf
+    8> ./test0h.cdf
+    9> ./test0i.cdf
+   10> ./test0j.cdf
+   11> ./test0k.cdf
+   12> ./test0l.cdf
+   13> ./test0n.cdf
+   14> ./test0m.cdf
+   15> ./test0o.cdf
+   16> ./test0p.cdf  (default)
+ 
+! test access to one
+stat l_[d=1]
+ 
+             L
+             axis ABSTRACT
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: ./test0a.cdf
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 1
+ Maximum value: 500
+ Mean    value: 250.5 (unweighted average)
+ Standard deviation: 144.48
+ 
+! test access to all
+stat l_[d=1]-l_[d=2]+l_[d=3]-l_[d=4]+l_[d=5]-l_[d=6]+l_[d=7]-l_[d=8]+l_[d=9]-l_[d=10]+l_[d=11]-l_[d=12]+l_[d=13]-l_[d=14]+l_[d=15]-l_[d=16]
+ 
+             L_[D=test0a]-L_[D=test0b]+L_[D=test0c]-L_[D=test0d]+L_[D=test0e]-L_[D=test0f]+L_[D=test0g]-L_[D=test0h]+L_[D=test0i]-L_[D=test0j]+L_[D=test0k]-L_[D=test0l]+L_[D=test0n]-L_[D=test0m
+             X:  N/A
+             Y:  N/A
+             Z:  N/A
+             T: 0.5 to 500.5
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 500 (1*1*1*500*1*1)
+ # flagged as bad  data: 500
+cancel data/all
+ 
+! test abstract variable io
+GO bn_cdf_keepax.sub2
+! bn230_cdf.sub2
+! benchmark to test abstract variable netCDF input and output
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel region
+canc var/all
+cancel data/all
+ 
+! define a realistic time series grid
+define axis/t="1-jan-1902":"1-jan-2010":1/unit=day tcentury
+define grid/like=abstract/t=tcentury gcentury
+let tlong = t[g=gcentury]
+ 
+let i1 = i
+let j1 = j
+let k1 = k
+let l1 = l[g=gcentury]
+let l2 = l
+let ij = i+j
+let ik = i+k
+let il = i+l1
+let jk = j+k
+let jl = j+l1
+let kl = k+l1
+let ijk = i+j+k
+let ikl = i+k+l1
+let ijl = i+j+l1
+let jkl = j+k+l1
+let ijkl = i+j+k+l1
+let ijk2 = i+j+k
+let ikl2 = i+k+l1
+let ijl2 = i+j+l1
+let jkl2 = j+k+l1
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/i=1:10/clobber/file=test_abs.cdf i1   ! not /APPEND - must be new
+list/format=cdf/keep_axnames/j=1:20/append/file=test_abs.cdf j1
+list/format=cdf/keep_axnames/k=1:100/append/file=test_abs.cdf k1
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l1           ! record axis
+list/format=cdf/keep_axnames/l=1:10/append/file=test_abs.cdf l2           ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/i=1:10/j=1:20/append/file=test_abs.cdf ij
+list/format=cdf/keep_axnames/i=1:10/k=1:100/append/file=test_abs.cdf ik
+list/format=cdf/keep_axnames/i=1:10/l=5:10/append/file=test_abs.cdf il
+list/format=cdf/keep_axnames/k=1:100/j=1:20/append/file=test_abs.cdf jk
+ 
+!3D
+set region/i=1:10/j=1:20/k=1:100/l=4:8
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=1:5 /l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=1:5 /j=6:10/l=11:12 ijl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:10/j=6:10/l=11:12 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_abs.cdf/i=6:8/j=6:8/l=8:10/k=3:5 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijk2[i=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ikl2[i=@ave,k=@sbx:3]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2[i=@ave,j=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf jkl2[k=@ave,l=@ave]
+list/format=cdf/keep_axnames/append/file=test_abs.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:12      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:12      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:12      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:12      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:12      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:12      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:12      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:12      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:12      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:12      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:12      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 12-JAN-1902 00:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                12 r   01-JAN-1902 00:00    12-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! make the time axis irregular by leaving out l=13
+list/format=cdf/keep_axnames/l=14:16/append/file=test_abs.cdf l1
+set data/format=cdf test_abs
+show data/full
+     currently SET data sets:
+    1> ./test_abs.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       I                                1:10      ...       ...       ...       ...       ...
+               on grid GEU1 with -1.E+34 for missing data
+             X=0.5:10.5  
+ J1       J                                ...       1:20      ...       ...       ...       ...
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ K1       K                                ...       ...       1:100     ...       ...       ...
+               on grid GEU3 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ L1       L[G=GCENTURY]                    ...       ...       ...       1:15      ...       ...
+               on grid GEU4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:10      ...       ...
+               on grid GEU5 with -1.E+34 for missing data
+             
+ IJ       I+J                              1:10      1:20      ...       ...       ...       ...
+               on grid GEU6 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IK       I+K                              1:10      ...       1:100     ...       ...       ...
+               on grid GEU7 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IL       I+L1                             1:10      ...       ...       1:15      ...       ...
+               on grid GEU8 with -1.E+34 for missing data
+             X=0.5:10.5  
+ JK       J+K                              ...       1:20      1:100     ...       ...       ...
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJK      I+J+K                            1:10      1:20      1:100     ...       ...       ...
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IKL      I+K+L1                           1:10      ...       1:100     1:15      ...       ...
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJL      I+J+L1                           1:10      1:20      ...       1:15      ...       ...
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ JKL      J+K+L1                           ...       1:20      1:100     1:15      ...       ...
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJKL     I+J+K+L1                         1:10      1:20      1:100     1:15      ...       ...
+               on grid GEU14 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ IJK2     I+J+K                            ...       1:20      1:100     ...       ...       ...
+       (X=0.5:10.5 at AVE)
+               on grid GEU9 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IKL2     I+K+L1                           ...       ...       1:100     1:15      ...       ...
+       (X=0.5:10.5 at AVE, box smoothed by 3 pts on Z)
+               on grid GEU15 with -1.E+34 for missing data
+             Z=0.5:100.5  
+ IJL2     I+J+L1                           ...       ...       ...       1:15      ...       ...
+       (X=0.5:10.5 at AV4, Y=0.5:20.5 at AV4)
+               on grid GEU4 with -1.E+34 for missing data
+             
+ JKL2     J+K+L1                           ...       1:20      ...       ...       ...       ...
+       (Z=0.5:100.5 at AV4, T=03-JAN-1902 12:00:08-JAN-1902 12:00 at AV4)
+               on grid GEU2 with -1.E+34 for missing data
+             Y=0.5:20.5  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:20      1:100     1:15      ...       ...
+       (X=0.5:10.5)
+               on grid GEU13 with -1.E+34 for missing data
+             Y=0.5:20.5  Z=0.5:100.5  
+ IJAVEKL  IJKL[J=@AVE]                     1:10      ...       1:100     1:15      ...       ...
+       (Y=0.5:20.5)
+               on grid GEU11 with -1.E+34 for missing data
+             X=0.5:10.5  Z=0.5:100.5  
+ IJKAVEL  IJKL[K=@AVE]                     1:10      1:20      ...       1:15      ...       ...
+       (Z=0.5:100.5)
+               on grid GEU12 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  
+ IJKLAVE  IJKL[L=@AVE]                     1:10      1:20      1:100     ...       ...       ...
+       (T=03-JAN-1902 12:00:08-JAN-1902 12:00)
+               on grid GEU10 with -1.E+34 for missing data
+             X=0.5:10.5  Y=0.5:20.5  Z=0.5:100.5  
+ 
+  time range: 01-JAN-1902 00:00 to 16-JAN-1902 00:00
+ 
+show grid ijkl
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+ 
+ 
+! list long time series using a rigid (non-record axis) time axis --> FAST
+list/clobber/format=cdf/keep_axnames/l=1:300000/rigid/file=test2.cdf l  ! without record dimension
+! list time series using the record dimension --> SLOW (1/50th as long axis)
+list/clobber/format=cdf/keep_axnames/l=1:5000 l                               ! auto-filename
+list/clobber/format=cdf/keep_axnames/t="1-jan-1902":"1-jan-2010"/rigid tlong  ! auto-filename
+ 
+! deliberate errors
+can dat/all
+set mode ignore
+list/format=cdf/keep_axnames/l=1:10/file=test_abs.cdf l    ! file exists error
+list/format=cdf/keep_axnames/i=5:15/l=5:10/append/file=test_abs.cdf il  ! inconsistent i limits
+list/format=cdf/keep_axnames/i=1:10/j=20:25/append/file=test_abs.cdf ij ! inconsistent j limits
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijl2              ! i and j not avg'd
+list/format=cdf/keep_axnames/append/file=test_abs.cdf ijkl[k=@ave]      ! k axis averaged
+list/format=cdf/keep_axnames/l=13/append/file=test_abs.cdf l1           ! inconsistent time pt
+set data/format=cdf test0a, test0b, test0c, test0d, test0e, test0f, test0g, test0h, test0i, test0j, test0k, test0l, test0n, test0m, test0o, test0p
+list/clobber/format=cdf/keep_axnames/i=1:10 i                                ! too many netcdf files
+canc data/all
+cancel mode ignore
+ 
+! show the grids created
+cancel variables/all
+set data/format=cdf test_abs
+show grid j1 jkl jkl2 iavejkl ijkl
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU2
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+    GRID GEU13
+ name       axis              # pts   start                end
+ normal    X
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+    GRID GEU14
+ name       axis              # pts   start                end
+ XAX       X                   10 r   1                    10
+ YAX       Y                   20 r   1                    20
+ ZAX       Z                  100 r   1                    100
+ TCENTURY1 TIME                15 i   01-JAN-1902 00:00    16-JAN-1902 00:00
+ normal    E
+ normal    F
+cancel data test_abs
+ 
+! test TMAP data io
+GO bn_cdf_keepax.sub3 	! matches old outputs by using /HEADING=enhanced
+! bn320_cdf.sub3
+! benchmark to test netCDF input and output of TMAP data set variables
+! this routine added 1/26/95 to test the SAVE/HEADING=enhanced option
+ 
+! V5 *sh* 7/99 added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil0.cdf/heading="enh" i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" j1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" k1
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l1       ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" l2       ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ij
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ik
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" il
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jk
+ 
+!3D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijk
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ikl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh"/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil0.cdf/heading="enh" ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil0
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil0.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid PS3DT1_NYZT with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       5:10      ...       ...       ...       ...
+               on grid PS3DT1_NXZT with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       5:15      ...       ...       ...
+               on grid PS3DU1_NXYT with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GRH1 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GRH2 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                    69:71      1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS2DU1_NT with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       5:15      ...       ...       ...
+               on grid G016_NYT with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid G016_NYZ with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       5:10      5:15      ...       ...       ...
+               on grid G002_NXT with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ IJK      TEMP[L=@AVE]                    70:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DT1_NT with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ IKL      TEMP[J=@AVE]                    70:72      ...       1:27      1:3       ...       ...
+       (Y=30S:50N)
+               on grid PS3DT1_NY with -1.E+34 for missing data
+             X=161W:158W  Z=0:4149  
+ IJL      TEMP[K=@AVE]                    70:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DT1_NZ with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  
+ JKL      TEMP[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130E:70W)
+               on grid GRH3 with -1.E+34 for missing data
+             Y=30S:50N  Z=0:4149  
+ IJKL     U                               69:72      1:100     1:27      1:3       ...       ...
+               on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ IAVEJKL  IJKL[I=@AVE]                     ...       1:100     1:27      1:3       ...       ...
+       (X=130.5E:69.5W)
+               on grid GRH4 with -1.E+34 for missing data
+             Y=28.8S:51.4N  Z=0:4149  
+ IJAVEKL  IJKL[J=@AVE]                    69:72      ...       1:27      1:3       ...       ...
+       (Y=28.8S:51.4N)
+               on grid PS3DU1_NY with -1.E+34 for missing data
+             X=161.5W:157.5W  Z=0:4149  
+ IJKAVEL  IJKL[K=@AVE]                    69:72      1:100     ...       1:3       ...       ...
+       (Z=0:4149)
+               on grid PS3DU1_NZ with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  
+ IJKLAVE  IJKL[L=@AVE]                    69:72      1:100     1:27      ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid PS3DU1_NT with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+    GRID PS3DU1
+ name       axis              # pts   start                end
+ PSXU      LONGITUDE          160mr   131E                 70W
+ PSYU      LATITUDE           100 i   27.672S              50N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ normal    E
+ normal    F
+cancel data test_fil0
+! 5/99 moved old bn230_cdf.sub3 to bn_cdf_keepax.sub4 to stay inline w/ old benchmarks *kob*
+GO bn_cdf_keepax.sub4
+! bn230_cdf
+! benchmark to test netCDF input and output of TMAP data set variables
+! requires version 2.30 or later
+! 6/92
+ 
+! V5 *sh* 7/99 -- added /CLOBBER
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+use gtbc011
+ 
+let i1 = x[g=temp,i=1:10]
+let j1 = y[g=temp,j=5:10]
+let k1 = z[g=u,k=5:15]
+let l1 = l[g=u,l=1:3]
+let l2 = l
+let ij = taux[l=@ave]
+let ik = i1+k1
+let il = i1+l1
+let jk = j1+k1
+let jl = j1+l1
+let kl = k1+l1
+let ijk = temp[l=@ave]
+let ikl = temp[j=@ave]
+let ijl = temp[k=@ave]
+let jkl = temp[i=@ave]
+let ijkl = u
+let ijk2 = temp
+let iavejkl = ijkl[i=@ave]
+let ijavekl = ijkl[j=@ave]
+let ijkavel = ijkl[k=@ave]
+let ijklave = ijkl[l=@ave]
+ 
+set region/l=1:2  ! i,j, and k unspecified
+ 
+! a bunch of basic geometries
+! 1d
+list/format=cdf/keep_axnames/clobber/file=test_fil.cdf i1      ! not /APPEND - must be new
+list/format=cdf/keep_axnames/append/file=test_fil.cdf j1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf k1
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l1           ! record axis
+list/format=cdf/keep_axnames/append/file=test_fil.cdf l2          ! rigid axis
+ 
+! 2D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ij
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ik
+list/format=cdf/keep_axnames/append/file=test_fil.cdf il
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jk
+ 
+!3D
+! The following is an error - axis already in the file
+!
+set mode ignore
+ 
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijk
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ikl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf jkl
+ 
+!4D
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkl
+ 
+! extend along time axis and write sub-regions
+! (note: this may leave undefined regions in other variables)
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=1:50/l=2:3 ijl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=51:100/l=2:3 ijl
+ 
+! rewrite a sub-region in the middle of the data
+list/format=cdf/keep_axnames/append/file=test_fil.cdf/j=30:40/k=5/l=1:3 ijkl
+ 
+! check documentation of transforms
+list/format=cdf/keep_axnames/append/file=test_fil.cdf iavejkl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijavekl
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijkavel
+list/format=cdf/keep_axnames/append/file=test_fil.cdf ijklave
+ 
+! look at what we've created - time axis should be regular
+set data/format=cdf test_fil
+show data/full
+     currently SET data sets:
+    1> ./gtbc011.cdf
+ 
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+             deg. C on grid PS3DT1 with -1.E+34 for missing data
+             X=161W:158W  Y=30S:50N  Z=0:4149  
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+             frac. by wt. less .035 on grid PS3DT1 with 0.01 for missing data
+             X=161W:159W  Y=30S:50N  Z=0:4149  
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DU1 with -1.E+34 for missing data
+             X=161.5W:157.5W  Y=28.8S:51.4N  Z=0:4149  
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+             cm/sec on grid PS3DW1 with -1.E+34 for missing data
+             X=161W:159W  Y=30S:50N  Z=5:4149  
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+             dynes/cm**2 on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+             cm**3/sec on grid PS2DU1 with -1.E+34 for missing data
+             X=161.5W:156.5W  Y=28.8S:51.4N  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+    2> ./test_fil.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ I1       X[G=TEMP,I=1:10]                 1:10      ...       ...       ...       ...       ...
+               on grid GLZ1 with -1.E+34 for missing data
+             X=130E:140E  
+ J1       Y[G=TEMP,J=5:10]                 ...       1:6       ...       ...       ...       ...
+               on grid GLZ2 with -1.E+34 for missing data
+             Y=21.1S:12.5S  
+ K1       Z[G=U,K=5:15]                    ...       ...       1:11      ...       ...       ...
+               on grid GLZ3 with -1.E+34 for missing data
+             Z=40:190  
+ L1       L[G=U,L=1:3]                     ...       ...       ...       1:3       ...       ...
+               on grid GLZ4 with -1.E+34 for missing data
+             
+ L2       L                                ...       ...       ...       1:2       ...       ...
+               on grid GLZ5 with -1.E+34 for missing data
+             
+ IJ       TAUX[L=@AVE]                     1:3       1:100     ...       ...       ...       ...
+       (T=15-MAR-1983 09:30:15-MAR-1983 11:30)
+               on grid GLZ6 with -1.E+34 for missing data
+             X=161.5W:158.5W  Y=28.8S:51.4N  
+ IK       I1+K1                            1:10      ...       1:11      ...       ...       ...
+               on grid GLZ7 with -1.E+34 for missing data
+             X=130E:140E  Z=40:190  
+ IL       I1+L1                            1:10      ...       ...       1:3       ...       ...
+               on grid GLZ8 with -1.E+34 for missing data
+             X=130E:140E  
+ JK       J1+K1                            ...       1:6       1:11      ...       ...       ...
+               on grid GLZ9 with -1.E+34 for missing data
+             Y=21.1S:12.5S  Z=40:190  
+ 
+  time range: 15-MAR-1983 10:00 to 15-MAR-1983 12:00
+ 
+cancel variable ijkl
+show grid ijkl
+cancel data test_fil
+ 
+set mode/last ignore
+ 
+GO bn_cdf_reversed_keepax.sub
+! bn320_cdf_reversed.sub
+! benchmark to test netCDF input of reverse-coordinate axes
+! this routine added 3/2/95
+ 
+cancel data/all
+cancel variables/all
+cancel region
+ 
+set data reverse_axes
+ 
+show data/var
+     currently SET data sets:
+    1> ./reverse_axes.cdf  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ FCN_NORM COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF1 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV  COS(X/10)*SIN(Y/2)               1:51      1:21      ...       ...       ...       ...
+               on grid GAF2 with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=10.5S:10.5N  
+ FCN_REV_SUB
+          COS(X/10)*SIN(Y/2)               1:51     10:19      ...       ...       ...       ...
+               on grid GREV with -1.E+34 for missing data
+             X=129.5E:179.5W  Y=1.5S:8.5N  
+ 
+ 
+list/x=180 fcn_norm,fcn_rev
+ WARNING: Listed variables have ambiguous coordinates on axes: Y
+             DATA SET: ./reverse_axes.cdf
+             LONGITUDE: 180E
+ Column  1: FCN_NORM is COS(X/10)*SIN(Y/2)
+ Column  2: FCN_REV is COS(X/10)*SIN(Y/2)
+       FCN_NOR  FCN_REV
+J /  1:  0.6332 -0.6332
+J /  2:  0.6455 -0.6455
+J /  3:  0.4997 -0.4997
+J /  4:  0.2316 -0.2316
+J /  5: -0.0932  0.0932
+J /  6: -0.3952  0.3952
+J /  7: -0.6004  0.6004
+J /  8: -0.6587  0.6587
+J /  9: -0.5556  0.5556
+J / 10: -0.3166  0.3166
+J / 11:  0.0000  0.0000
+J / 12:  0.3166 -0.3166
+J / 13:  0.5556 -0.5556
+J / 14:  0.6587 -0.6587
+J / 15:  0.6004 -0.6004
+J / 16:  0.3952 -0.3952
+J / 17:  0.0932 -0.0932
+J / 18: -0.2316  0.2316
+J / 19: -0.4997  0.4997
+J / 20: -0.6455  0.6455
+J / 21: -0.6332  0.6332
+list/x=180 fcn_rev_sub
+             VARIABLE : COS(X/10)*SIN(Y/2)
+             FILENAME : reverse_axes.cdf
+             SUBSET   : 10 points (LATITUDE)
+             LONGITUDE: 180E
+              180E   
+               51
+ 8N   / 19:  0.4997
+ 7N   / 18:  0.2316
+ 6N   / 17: -0.0932
+ 5N   / 16: -0.3952
+ 4N   / 15: -0.6004
+ 3N   / 14: -0.6587
+ 2N   / 13: -0.5556
+ 1N   / 12: -0.3166
+ 0    / 11:  0.0000
+ 1S   / 10:  0.3166
+*** Running test: bn_keep_axisnames.jnl
+! bn_keep_axisnames.jnl
+! 2/2009 ACM
+ 
+! save/KEEP_AXISNAMES prevents changes to
+! axis name when a subset is written.
+ 
+sh command list
+ LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D/HEADING/NOHEAD/SINGLE/FILE/APPEND/ORDER
+       /FORMAT/TITLE/PRECISIO/RIGID/ILIMITS/JLIMITS/KLIMITS/LLIMITS/MLIMITS
+       /NLIMITS/XLIMITS/YLIMITS/ZLIMITS/TLIMITS/ELIMITS/FLIMITS/CLOBBER
+       /QUIET/WIDTH/EDGES/BOUNDS/NOBOUNDS/NOROWLAB/KEEP_AXI/NCFORMAT/XCHUNK
+       /YCHUNK/ZCHUNK/TCHUNK/ECHUNK/FCHUNK/DEFLATE/SHUFFLE/ENDIAN/OUTTYPE
+       /CURVILIN/SIGMA
+define axis/x=1:100:1/units=deg x100
+define axis/t=1-jan-2000:31-jan-2000:1/units=days/t0=31-dec-1999 t31
+let a = x[gx=x100] + t[gt=t31]
+save/file=a.nc/clobber/i=30:40/L=15:28/KEEP_AXISNAMES a
+ 
+sp echo "bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+save/file=a.nc/clobber/i=30:40/L=15:28 a
+ 
+sp echo "bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+*** Running test: bn_key_label_minmax.jnl
+! bn_key_label_minmax.jnl
+ 
+! Label data min and max on vertical and horizontal keys
+ 
+can mode logo
+ 
+! One setting turns on annotate_key, which persists until turned off.
+PPL SHAKEY 1,,,,,,,,,,1
+ 
+use levitus_climatology
+shade/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+shade/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(-inf)(4,28,1)(inf) temp[z=0]
+ 
+fill/set/lev=(-inf)(4,28,1)(inf) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(-inf)(4,26,1)(inf), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! Now with closed-ended colorbars
+use levitus_climatology
+shade/lev=(4,28,1) temp[z=0]
+ 
+shade/set/lev=(4,28,1) temp[z=0]
+ppl shakey,1,0
+ppl shade
+ 
+ 
+! restore setting: keys not annotated
+PPL SHAKEY 1,,,,,,,,,,0
+ 
+! The setting can alternatively be made with the alias KEYMARK
+KEYMARK 1
+ 
+! FILL with min and max on vertical and horizontal keys
+ 
+fill/lev=(4,28,1) temp[z=0]
+ 
+fill/set/lev=(4,28,1) temp[z=0]
+PPL SHAKEY 1,0
+ppl fill
+ 
+! POLYGON with min and max on vertical key
+ 
+use coads_climatology
+def axis/x=0:360:5 xq
+def axis/y=-90:90:4 yq
+let fsst =  sst[l=1,gx=xq,gy=yq]
+ 
+let lon = xsequence(x[gx=xq] + 0*y[gy=yq])
+let lat = xsequence(0*x[gx=xq] + y[gy=yq])
+shade/nokey/pal=white/nolab/axes=0,0,0,0 fsst  ! set up
+go polymark poly/key/title="polygons"/lev=(4,26,1), lon, lat, xsequence(fsst), square, 0.4
+ 
+ 
+! restore setting: keys not annotated
+KEYMARK 0
+ 
+set mode/last logo
+shade/lev=35 sst[L=1]
+ 
+*** Running test: bn62_bug_fixes.jnl
+! bn62_bug_fixes.jnl
+! Fixes that go into v6.2 release
+ 
+GO bn_reset
+cancel mode verify
+GO err618_julday.jnl
+! err618_julday.jnl
+! Bug 1639
+! ACM 2/12/09
+ 
+! reported by Martin Shcmidt, 12-Feb-2009
+!
+define axis/t=1-dec-1998:31-mar-2002:12/unit=hours/t0=1-jan-1955/cal=gregorian tax
+define grid/t=tax tgrid
+let tdummy=0*t[gt=tgrid]
+ 
+let rjulianday = TAX_JDAY(t[gt=tdummy],tdummy)
+! This is correct
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00
+ 27-FEB-1999 12:00 / 178:  58.00
+ 28-FEB-1999 00:00 / 179:  59.00
+ 28-FEB-1999 12:00 / 180:  59.00
+ 01-MAR-1999 00:00 / 181:  60.00
+ 01-MAR-1999 12:00 / 182:  60.00
+ 02-MAR-1999 00:00 / 183:  61.00
+ 
+! Now look to somewhere else
+list/t=31-dec-1999:02-jan-2000 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 5 points (TIME)
+ 31-DEC-1999 00:00 / 791:  365.0
+ 31-DEC-1999 12:00 / 792:  365.0
+ 01-JAN-2000 00:00 / 793:    1.0
+ 01-JAN-2000 12:00 / 794:    1.0
+ 02-JAN-2000 00:00 / 795:    2.0
+ 
+! Now list the first region again. March 1 was
+! being listed as day 61 not day 60
+list/t=27-feb-1999:02-mar-1999 rjulianday
+             VARIABLE : TAX_JDAY(T[GT=TDUMMY],TDUMMY)
+             SUBSET   : 7 points (TIME)
+ 27-FEB-1999 00:00 / 177:  58.00
+ 27-FEB-1999 12:00 / 178:  58.00
+ 28-FEB-1999 00:00 / 179:  59.00
+ 28-FEB-1999 12:00 / 180:  59.00
+ 01-MAR-1999 00:00 / 181:  60.00
+ 01-MAR-1999 12:00 / 182:  60.00
+ 02-MAR-1999 00:00 / 183:  61.00
+ 
+GO bn_reset
+cancel mode verify
+GO err611_polygons.jnl
+! err611_polygons.jnl
+! bug 1661
+ 
+! Polygons over a depth axis, where the
+! plot is transposed, didnt appear.
+ 
+! (from error_bars_demo script) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+plot/title="vertical profile" yp4
+ 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+ 
+*** Running test: bn_convolve.jnl
+! bn_convolve.jnl
+! test convolutions, including with missing-data.
+! compare behavior with smoothing transform spz.
+ 
+let a = {0,1,1,0,1,0,0,0,,0,0,0}
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0}
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+               A     A      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+! The second argument does not have to be on the
+! same axis as the first.
+let b = ysequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = ysequence({.25,.5,.25})
+list b, b[j=@spz], convolvej(b,bpat), convolvej(b,{.1,.4,.4,.1})
+             Y: 0.5 to 12.5
+ Column  1: B is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[Y=@SPZ:3] is YSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Y)
+ Column  3: EX#3 is CONVOLVEJ(B,BPAT)
+ Column  4: EX#4 is CONVOLVEJ(B,{.1,.4,.4,.1})
+               B     B      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+ 
+let c = zsequence({0,1,1,0,1,0,0,0,,0,0,0})
+list c, c[k=@spz], convolvek(c,{.25,.5,.25})
+             Z: 0.5 to 12.5
+ Column  1: C is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: C[Z=@SPZ:3] is ZSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on Z)
+ Column  3: EX#3 is CONVOLVEK(C,{.25,.5,.25})
+               C     C      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+let d = tsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let dpat = tsequence({.25,.5,.25})
+list d, d[l=@spz], convolvel(d,{.25,.5,.25})
+             T: 0.5 to 12.5
+ Column  1: D is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: D[T=@SPZ:3] is TSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on T)
+ Column  3: EX#3 is CONVOLVEL(D,{.25,.5,.25})
+               D     D      EX#3
+1    /  1:  0.000    ....    ....
+2    /  2:  1.000  0.7500  0.7500
+3    /  3:  1.000  0.7500  0.7500
+4    /  4:  0.000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000
+6    /  6:  0.000  0.2500  0.2500
+7    /  7:  0.000  0.0000  0.0000
+8    /  8:  0.000    ....    ....
+9    /  9:   ....    ....    ....
+10   / 10:  0.000    ....    ....
+11   / 11:  0.000  0.0000  0.0000
+12   / 12:  0.000    ....    ....
+ 
+! 2D - convolvei convolves in x ...
+let a = {0,1,1,0,1,0,0,0,,0,0,0} + y[y=1:2]
+list a, a[i=@spz], convolvei(a,{.25,.5,.25})
+             X: 0.5 to 12.5
+             Y: 0.5 to 2.5
+ Column  1: A is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2]
+ Column  2: A[X=@SPZ:3] is {0,1,1,0,1,0,0,0,,0,0,0} + Y[Y=1:2] (Parzen smoothed by 3 pts on X)
+ Column  3: EX#3 is CONVOLVEI(A,{.25,.5,.25})
+               A     A    EX#3
+ ---- J:1 Y:   1
+1    /  1:  1.000   ....   ....
+2    /  2:  2.000  1.750  1.750
+3    /  3:  2.000  1.750  1.750
+4    /  4:  1.000  1.500  1.500
+5    /  5:  2.000  1.500  1.500
+6    /  6:  1.000  1.250  1.250
+7    /  7:  1.000  1.000  1.000
+8    /  8:  1.000   ....   ....
+9    /  9:   ....   ....   ....
+10   / 10:  1.000   ....   ....
+11   / 11:  1.000  1.000  1.000
+12   / 12:  1.000   ....   ....
+ ---- J:2 Y:   2
+1    /  1:  2.000   ....   ....
+2    /  2:  3.000  2.750  2.750
+3    /  3:  3.000  2.750  2.750
+4    /  4:  2.000  2.500  2.500
+5    /  5:  3.000  2.500  2.500
+6    /  6:  2.000  2.250  2.250
+7    /  7:  2.000  2.000  2.000
+8    /  8:  2.000   ....   ....
+9    /  9:   ....   ....   ....
+10   / 10:  2.000   ....   ....
+11   / 11:  2.000  2.000  2.000
+12   / 12:  2.000   ....   ....
+ 
+ 
+*** Running test: bn_tax_tstep.jnl
+! bn_tax_tstep.jnl
+!
+! Working with the coordinates of this axis loses accuracy because its
+! time origin is so far back from the time it represents
+ 
+DEFINE AXIS/T="1-JAN-2000:00:00:01":"1-JAN-2000:00:15:00":2/UNITS=seconds tsec
+LIST/L=440:451 T[GT=tsec]  ! See the accuracy problem here
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 12 points (TIME)
+ 01-JAN-2000 00:14:39 / 440:  3.123E+09
+ 01-JAN-2000 00:14:41 / 441:  3.123E+09
+ 01-JAN-2000 00:14:43 / 442:  3.123E+09
+ 01-JAN-2000 00:14:45 / 443:  3.123E+09
+ 01-JAN-2000 00:14:47 / 444:  3.123E+09
+ 01-JAN-2000 00:14:49 / 445:  3.123E+09
+ 01-JAN-2000 00:14:51 / 446:  3.123E+09
+ 01-JAN-2000 00:14:53 / 447:  3.123E+09
+ 01-JAN-2000 00:14:55 / 448:  3.123E+09
+ 01-JAN-2000 00:14:57 / 449:  3.123E+09
+ 01-JAN-2000 00:14:59 / 450:  3.123E+09
+ 01-JAN-2000 00:15:01 / 451:  3.123E+09
+ 
+LET bsin = SIN(t[GT=tsec]/40000)
+SAVE/FILE=a.nc/clobber bsin
+CAN VAR/all
+USE a.nc
+ 
+SET LIST/PREC=7
+! Reset the date to dec 1999
+! Function lets us leave off the leading 0.
+LIST/L=1:15  TAX_TSTEP(bsin, "1-dec-1999:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-dec-1999:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:  2678401.
+ 01-JAN-2000 00:00:03 /  2:  2678403.
+ 01-JAN-2000 00:00:05 /  3:  2678405.
+ 01-JAN-2000 00:00:07 /  4:  2678407.
+ 01-JAN-2000 00:00:09 /  5:  2678409.
+ 01-JAN-2000 00:00:11 /  6:  2678411.
+ 01-JAN-2000 00:00:13 /  7:  2678413.
+ 01-JAN-2000 00:00:15 /  8:  2678415.
+ 01-JAN-2000 00:00:17 /  9:  2678417.
+ 01-JAN-2000 00:00:19 / 10:  2678419.
+ 01-JAN-2000 00:00:21 / 11:  2678421.
+ 01-JAN-2000 00:00:23 / 12:  2678423.
+ 01-JAN-2000 00:00:25 / 13:  2678425.
+ 01-JAN-2000 00:00:27 / 14:  2678427.
+ 01-JAN-2000 00:00:29 / 15:  2678429.
+ 
+! argument can be upper or lowercase
+! Should list values 1, 3, 5...
+LIST/L=1:15  TAX_TSTEP(bsin, "1-JAN-2000:00:00:00" )
+             VARIABLE : TAX_TSTEP(BSIN, "1-JAN-2000:00:00:00" )
+             FILENAME : a.nc
+             SUBSET   : 15 points (TIME)
+ 01-JAN-2000 00:00:01 /  1:   1.00000
+ 01-JAN-2000 00:00:03 /  2:   3.00000
+ 01-JAN-2000 00:00:05 /  3:   5.00000
+ 01-JAN-2000 00:00:07 /  4:   7.00000
+ 01-JAN-2000 00:00:09 /  5:   9.00000
+ 01-JAN-2000 00:00:11 /  6:  11.00000
+ 01-JAN-2000 00:00:13 /  7:  13.00000
+ 01-JAN-2000 00:00:15 /  8:  15.00000
+ 01-JAN-2000 00:00:17 /  9:  17.00000
+ 01-JAN-2000 00:00:19 / 10:  19.00000
+ 01-JAN-2000 00:00:21 / 11:  21.00000
+ 01-JAN-2000 00:00:23 / 12:  23.00000
+ 01-JAN-2000 00:00:25 / 13:  25.00000
+ 01-JAN-2000 00:00:27 / 14:  27.00000
+ 01-JAN-2000 00:00:29 / 15:  29.00000
+ 
+! Test  with TAX_DATESTRING to set the date (but argument to
+! TAX_DATESTRING is also limited by precision so use a different
+! axis def.)
+ 
+DEFINE AXIS/T="1-JAN-1902:00:00:00":"1-JAN-1902:00:30:00":5/UNITS=seconds tsec
+LIST/L=200:205 T[GT=tsec]  ! accuracy loss in single-precision t
+             VARIABLE : T
+                        axis TSEC
+             SUBSET   : 6 points (TIME)
+ 01-JAN-1902 00:16:35 / 200:  30327395.
+ 01-JAN-1902 00:16:40 / 201:  30327400.
+ 01-JAN-1902 00:16:45 / 202:  30327405.
+ 01-JAN-1902 00:16:50 / 203:  30327410.
+ 01-JAN-1902 00:16:55 / 204:  30327415.
+ 01-JAN-1902 00:17:00 / 205:  30327420.
+ 
+LET tt = t[gt=tsec]
+LET reset_date = TAX_DATESTRING(`t[gt=tsec,l=1]`, tt, "sec")
+ !-> DEFINE VARIABLE reset_date = TAX_DATESTRING(30326400, tt, "sec")
+LIST/L=1:15 TAX_TSTEP(tt, "`reset_date`")
+ !-> LIST/L=1:15 TAX_TSTEP(tt, "01-JAN-1902 00:00:00")
+             VARIABLE : TAX_TSTEP(TT, "01-JAN-1902 00:00:00")
+             SUBSET   : 15 points (TIME)
+ 01-JAN-1902 00:00:00 /  1:   0.00000
+ 01-JAN-1902 00:00:05 /  2:   5.00000
+ 01-JAN-1902 00:00:10 /  3:  10.00000
+ 01-JAN-1902 00:00:15 /  4:  15.00000
+ 01-JAN-1902 00:00:20 /  5:  20.00000
+ 01-JAN-1902 00:00:25 /  6:  25.00000
+ 01-JAN-1902 00:00:30 /  7:  30.00000
+ 01-JAN-1902 00:00:35 /  8:  35.00000
+ 01-JAN-1902 00:00:40 /  9:  40.00000
+ 01-JAN-1902 00:00:45 / 10:  45.00000
+ 01-JAN-1902 00:00:50 / 11:  50.00000
+ 01-JAN-1902 00:00:55 / 12:  55.00000
+ 01-JAN-1902 00:01:00 / 13:  60.00000
+ 01-JAN-1902 00:01:05 / 14:  65.00000
+ 01-JAN-1902 00:01:10 / 15:  70.00000
+*** Running test: bn_grads_z.jnl
+! bn_grads_z.jnl
+! acm 3/31/09
+! Fixing bug 1651.
+! The file has no axis attributes other than units and long_name,
+! does not contain any other clues that Ferret uses to get a Z
+! axis direction but for variable AR, has attribute
+! DAXIS:long_name = "depth" ; This bug came from a question about the file
+! http://www.usgodae.org/dods/GDS_NC/gdem/sspgdemv3s"
+! See the bug report for more.
+ 
+USE grads_bug_file.nc
+ 
+! Previously A1 thru A4 showed as if on an x axis
+! A1 has z axis with long_name elev
+! A2 has z axis with long name height
+! A3 has z axis with long name level
+! A4 has z axis with long name layer
+SHOW DATA
+     currently SET data sets:
+    1> ./grads_bug_file.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AM       Z[GZ=CAXIS] + Y[GY=BAXIS] + X[G  1:10      1:5       1:5       ...       ...       ...
+ AR       Z[GZ=DAXIS]+ Y[GY=BAXIS] + X[GX  1:10      1:5       1:6       ...       ...       ...
+ A1                                        ...       ...       1:5       ...       ...       ...
+ A2                                        ...       ...       1:5       ...       ...       ...
+ A3                                        ...       ...       1:5       ...       ...       ...
+ A4                                        ...       ...       1:5       ...       ...       ...
+ 
+ 
+! The z axis of AM has no useful clues about its direction.
+! Ferret uses it as Z only because of the order in which it comes in
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     Z (METERS)           5 r   2                    10
+ normal    T
+ normal    E
+ normal    F
+ 
+! This axis has long_name = "depth" so it is (now) reversed.
+! Previously it was not.
+SH GRID ar
+    GRID GMY2
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ DAXIS     DEPTH (m)            6 i-  0                    8
+ normal    T
+ normal    E
+ normal    F
+ 
+! Can redefine the axis for variable AM to make it a z depth axis
+ 
+DEFINE SYMBOL zname = `am,RETURN=zaxis`
+ !-> DEFINE SYMBOL zname = CAXIS
+DEFINE AXIS/Z/UNITS="`am,RETURN=zunits`"/DEPTH ($zname) = Z[GZ=am]
+ !-> DEFINE AXIS/Z/UNITS="METERS"/DEPTH CAXIS = Z[GZ=am]
+SH GRID am
+    GRID GMY1
+ name       axis              # pts   start                end
+ AAXIS     X (METERS)          10 r   1                    10
+ BAXIS     Y (METERS)           5 r   1                    9
+ CAXIS     DEPTH (m)            5 r-  2                    10
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_clock_syms.jnl
+SH SYM delta_cpu, clock_secs, current_date, current_time
+DELTA_CPU = "0.527918"
+CLOCK_SECS = "0.307"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:28:56"
+! test special symbols DELTA_CPU, CLOCK_SECS
+!
+! NOTE THAT THE VALUES OF THE SYMBOLS WILL VARY FROM ONE
+! RUN OF THIS TO ANOTHER...
+ 
+use gt4d011
+shade/k=1 temp[L=@ave]
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0.050993"
+CLOCK_SECS = "0.358"
+ 
+repeat/k=1:10 shade temp[L=@ave]
+!-> REPEAT: K=1
+!-> REPEAT: K=2
+!-> REPEAT: K=3
+!-> REPEAT: K=4
+!-> REPEAT: K=5
+!-> REPEAT: K=6
+!-> REPEAT: K=7
+!-> REPEAT: K=8
+!-> REPEAT: K=9
+!-> REPEAT: K=10
+let ten_plots = ($DELTA_CPU)
+ !-> DEFINE VARIABLE ten_plots = 0.439933
+sh sym DELTA_CPU, CLOCK_SECS
+DELTA_CPU = "0"
+CLOCK_SECS = "0.798"
+ 
+let  sumclock = 0
+let  sumcpu = 0
+sh sym CLOCK_SECS
+CLOCK_SECS = "0.799"
+repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);\
+let sumcpu =`sumcpu + dt`)
+ !-> repeat/k=1:10 (shade/pal=rnb2 temp[L=@ave]; let dt = ($DELTA_CPU);let sumcpu =`sumcpu + dt`)
+!-> REPEAT: K=1
+ !-> DEFINE VARIABLE dt = 0.036994
+ !-> DEFINE VARIABLE sumcpu =0.036994
+!-> REPEAT: K=2
+ !-> DEFINE VARIABLE dt = 0.040994
+ !-> DEFINE VARIABLE sumcpu =0.077988
+!-> REPEAT: K=3
+ !-> DEFINE VARIABLE dt = 0.039994
+ !-> DEFINE VARIABLE sumcpu =0.117982
+!-> REPEAT: K=4
+ !-> DEFINE VARIABLE dt = 0.041993
+ !-> DEFINE VARIABLE sumcpu =0.159975
+!-> REPEAT: K=5
+ !-> DEFINE VARIABLE dt = 0.038994
+ !-> DEFINE VARIABLE sumcpu =0.198969
+!-> REPEAT: K=6
+ !-> DEFINE VARIABLE dt = 0.040994
+ !-> DEFINE VARIABLE sumcpu =0.239963
+!-> REPEAT: K=7
+ !-> DEFINE VARIABLE dt = 0.037994
+ !-> DEFINE VARIABLE sumcpu =0.277957
+!-> REPEAT: K=8
+ !-> DEFINE VARIABLE dt = 0.035995
+ !-> DEFINE VARIABLE sumcpu =0.313952
+!-> REPEAT: K=9
+ !-> DEFINE VARIABLE dt = 0.035995
+ !-> DEFINE VARIABLE sumcpu =0.349947
+!-> REPEAT: K=10
+ !-> DEFINE VARIABLE dt = 0.035994
+ !-> DEFINE VARIABLE sumcpu =0.385941
+ 
+say `sumcpu`
+ !-> MESSAGE/CONTINUE 0.385941
+0.385941
+sh sym CLOCK_SECS
+CLOCK_SECS = "1.187"
+ 
+SH SYM session_date, current_date, session_time, current_time
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:28"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:28:57"
+*** Running test: bn63_bug_fixes.jnl
+! bn63_bug_fixes.jnl
+! Fixes that go into v6.3 release
+ 
+GO bn_reset
+cancel mode verify
+GO err62_string_write_nc
+! err62_string_write_nc.jnl
+! Bug 1664: string variable written as a float.
+!
+ 
+!!!! Make a smaller file from the original file:
+ 
+!!!! use "/home/nstout/hankin/SOCAT_triples.nc"
+!!!! save/file=err62_string_write.nc/clobber cruise_id[i=1:104000:1000], cruise_no[i=1:104000:1000]
+ 
+! use "/home/nstout/hankin/SOCAT_triples.nc"
+! set mem/siz=200
+!DEFINE SYMBOL clen 3000
+ 
+use err62_string_write.nc
+DEFINE SYMBOL clen 30
+ 
+let I1d = i[g=cruise_no]
+ 
+let cm0 = IF CRUISE_NO NE CRUISE_NO[I=@SHF:-1] THEN 1    ! marks each real cruise
+let cm1 = if i eq 1 then 1 else cm0                      ! start of first cruise, too
+let cm2 = if MOD(cm1[i=@cib], ($clen) ) eq 0 then 1          ! break into chunks
+ !-> DEFINE VARIABLE cm2 = if MOD(cm1[i=@cib], 30 ) eq 0 then 1
+let mask = MISSING(cm1, cm2)
+ 
+DEFINE SYMBOL nk = `mask[i=@ngd]`
+ !-> DEFINE SYMBOL nk = 11
+ 
+! **** IF EITHER OF THESE LINES IS COMMENTED OUT
+!      THE STRING VAR cruise_id_xz IS SAVED OK
+let/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,`($nk)+1`,($clen) )
+ !-> DEFINE VARIABLE/title="cruise no"  cruise_no_xz = EXPNDI_BY_Z(cruise_no,mask,12,30 )
+SAVE/CLOBBER/FILE="a.nc"/i=1:10 cruise_no
+ 
+let kstarts = mask * i
+let kst = COMPRESSI(kstarts)
+let/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:($nk)])
+ !-> DEFINE VARIABLE/title="cruise ID" cruise_id_xz = SAMPLEI(cruise_id, kst[i=1:11])
+list/i=1:10 cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : err62_string_write.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+! *** THE VARIABLE cruise_id_xz GETS SAVED AS FLOAT INSTEAD OF STRING
+save/clobber/file=a.nc/i=1:10 cruise_id_xz
+ 
+! Check the file
+canc var/all
+use a.nc
+ 
+! Should be the same strings as above.
+list cruise_id_xz
+             VARIABLE : cruise ID
+             FILENAME : a.nc
+             SUBSET   : 10 points (X)
+ 1    /  1:"0001SFC_PRT"
+ 2    /  2:"0002SFC_PRT"
+ 3    /  3:"0003SFC_PRT"
+ 4    /  4:"0004SFC_PRT"
+ 5    /  5:"0005SFC_PRT"
+ 6    /  6:"0006SFC_PRT"
+ 7    /  7:"0008SFC_PRT"
+ 8    /  8:"007ASFC_PRT"
+ 9    /  9:"0101SFC_PRT"
+ 10   / 10:"0102SFC_PRT"
+ 
+GO bn_reset
+cancel mode verify
+GO err62_levset
+! err62_levset.jnl
+! fix for bug 1672, top color level chopped off in some circumstances
+! The color bar should extend to 385.4
+ 
+let var = 0*y + x
+shade/x=350:390/y=1:10/lev=(376.6,379.0,0.8)(379.0,385.4,0.2) var
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_thick_tic_time_axis
+! err62_thick_tic_time_axis.jnl
+! Fixing bug 1668
+!
+! On multi-year or multi-decade time-axis plots, the
+! dark line every year or 5- or 10-years, sometimes
+! disappeared due to pixel aliasing. Fixed by setting
+! the thick-line for these tics.
+ 
+ 
+define axis/t=1-jan-1990:1-jan-2010:1/units=months tax
+ 
+set mode meta timetics.plt
+let tt = l[gt=tax]
+set view upper; plot/thick/line cos(tt/20)
+set view lower; plot/thick/line/t=1-jan-1991:1-jan-1997 cos(tt/20)
+can view
+ 
+! Check that we get the thick dark black line for the tics on
+! plots with more line colors
+set mode linec:12
+sho mode linecolors
+      MODE            STATE        ARGUMENT
+      LINECOLORS       SET              12
+ 
+can win/all
+set win/new
+ 
+set mode meta timetics2.plt
+ 
+ppl color,7,100,50,0   ! orange
+ppl color,8,0,55,0     ! dark green
+ppl color,9,60,0,100   ! purple
+ppl color,10,100,60,70 ! pink
+ppl color,11,80,70,60  ! tan
+ppl color,12,100,75,0  ! yellow
+ 
+ 
+let tt = l[gt=tax]
+plot/thick/line \
+ cos(tt/20), cos(tt/24), cos(tt/28), cos(tt/32), \
+ cos(tt/36), cos(tt/40), cos(tt/44), cos(tt/48), \
+ cos(tt/52), cos(tt/56), cos(tt/60), cos(tt/64)
+ 
+can mode linecolors
+can win/all
+set win/new
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reset_after_inf
+! err62_reset_after_inf.jnl
+! Bug 1292
+! The levels did not reset to default closed levels
+ 
+set mode meta closed_lev.plt
+ 
+use levitus_climatology
+set view left
+shade/lev=(-inf)(2,24,2)(inf) temp[k=1]
+ 
+! The bug was that this did not reset to default closed levels
+set view right
+shade/lev=20 temp[k=1]
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_reversed_up
+! err62_reversed_up.jnl
+!
+! bug 1676:
+! reversed axis, positive up, with edges could
+! not check points-inside-edges and so would
+! just use midpts between coordinates as edges
+ 
+use lev_rev_up.nc
+ 
+use lev_rev_up.nc
+list z[gz=temp], zboxlo[gz=temp], zboxhi[gz=temp]
+             DATA SET: ./lev_rev_up.nc
+             Z (METERS): -5000 to 0
+ Column  1: Z is Z (axis ZAXLEVITR)
+ Column  2: ZBOXLO is ZBOXLO (axis ZAXLEVITR)
+ Column  3: ZBOXHI is ZBOXHI (axis ZAXLEVITR)
+                  Z  ZBOXLO ZBOXHI
+-5000   /  1: -5000. -5000. -4500.
+-4000   /  2: -4000. -4500. -3500.
+-3000   /  3: -3000. -3500. -2500.
+-2000   /  4: -2000. -2500. -1800.
+-1500   /  5: -1500. -1800. -1300.
+-1200   /  6: -1200. -1300. -1100.
+-1000   /  7: -1000. -1100.  -900.
+-800    /  8:  -800.  -900.  -700.
+-600    /  9:  -600.  -700.  -500.
+-400    / 10:  -400.  -500.  -350.
+-300    / 11:  -300.  -350.  -250.
+-200    / 12:  -200.  -250.  -180.
+-150    / 13:  -150.  -180.  -120.
+-100    / 14:  -100.  -120.   -90.
+-75     / 15:   -75.   -90.   -60.
+-50     / 16:   -50.   -60.   -32.
+-30     / 17:   -30.   -32.   -24.
+-20     / 18:   -20.   -24.   -12.
+-10     / 19:   -10.   -12.    -5.
+0       / 20:     0.    -5.     0.
+ 
+! shade/j=1 temp[z=-55:0]
+! let xpts = xsequence(x[gx=temp] + 0*z[gz=temp])
+! let zpts = xsequence(0*x[gx=temp] + z[gz=temp])
+! plot/over/vs/color=lightblue/sym=27 xpts,zpts
+ 
+GO bn_reset
+cancel mode verify
+GO err62_samplexy
+! err62_samplexy
+! bug 1677
+ 
+use coads_climatology
+ 
+! put the data on 1:360 for convenience in seeing whats going on
+save/clobber/file=xz.nc sst[x=1:360,L=1]
+can dat/all; can mem
+ 
+use xz
+ 
+let xpts = {357.6,358.8,359.9,360.,0.1,1.2,2.4}
+let ypts = 0*xpts
+ 
+let sr = SAMPLEXY(sst[L=1], xpts, ypts)
+ 
+! previously the middle 3 points of this were missing.
+list sr
+             VARIABLE : SAMPLEXY(SST[L=1], XPTS, YPTS)
+             FILENAME : xz.nc
+             SUBSET   : 7 points (X)
+             TIME     : 16-JAN 06:00
+ 1   / 1:  27.46
+ 2   / 2:  27.45
+ 3   / 3:  27.54
+ 4   / 4:  27.55
+ 5   / 5:  27.56
+ 6   / 6:  27.66
+ 7   / 7:  27.75
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_one_point_bounds
+! err62_one_point_bounds.jnl
+! Bug 1680
+! If a single-point axis has bounds specified,
+! then on a SAVE/BOUNDS, Ferret did not save the
+! correct bounds (but instead saved coord+/- 0.5)
+ 
+DEFINE AXIS/BOUNDS/Z/UNITS=meters myzaxis = {5}, {4.89,5.11}
+LET zz = Z[GZ=myzaxis]
+SAVE/BOUNDS/CLOBBER/FILE=a.nc zz
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             Z (METERS): 5
+ Column  1: Z is Z (axis MYZAXIS)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS)
+              Z  ZBOXLO ZBOXHI
+I / *:     5.000  4.890  5.110
+ 
+CAN DAT/ALL; CAN VAR/ALL
+USE a.nc
+! This should match the output of the LIST above
+LIST Z[GZ=zz], ZBOXLO[GZ=zz], ZBOXHI[GZ=zz]
+             DATA SET: ./a.nc
+             Z (meters): 5
+ Column  1: Z is Z (axis MYZAXIS1)
+ Column  2: ZBOXLO is ZBOXLO (axis MYZAXIS1)
+ Column  3: ZBOXHI is ZBOXHI (axis MYZAXIS1)
+              Z  ZBOXLO ZBOXHI
+I / *:     5.000  4.890  5.110
+ 
+GO bn_reset
+cancel mode verify
+GO err62_cos_lat_uncentered
+!err62_cos_lat_uncentered.jnl
+! See this thread, here is the esample, with his test.nc renamed to uncentered.nc
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00510.html
+! Also see the last comments from Andrew on bug 1348.
+ 
+use uncentered.nc
+define grid/like=test grd
+ 
+! list edges
+list yboxlo[g=grd],yboxhi[g=grd]
+             LATITUDE: 90S to 90N
+ Column  1: YBOXLO is YBOXLO (axis LAT_T)
+ Column  2: YBOXHI is YBOXHI (axis LAT_T)
+           YBOXLO  YBOXHI
+76.5S /  1: -90.00 -70.81
+66.4S /  2: -70.81 -62.73
+59.4S /  3: -62.73 -56.44
+53.7S /  4: -56.44 -51.06
+48.6S /  5: -51.06 -46.24
+44S   /  6: -46.24 -41.81
+39.7S /  7: -41.81 -37.67
+35.7S /  8: -37.67 -33.75
+31.9S /  9: -33.75 -30.00
+28.2S / 10: -30.00 -26.39
+24.6S / 11: -26.39 -22.89
+21.2S / 12: -22.89 -19.47
+17.8S / 13: -19.47 -16.13
+14.5S / 14: -16.13 -12.84
+11.2S / 15: -12.84  -9.59
+8S    / 16:  -9.59  -6.38
+4.8S  / 17:  -6.38  -3.18
+1.6S  / 18:  -3.18   0.00
+1.6N  / 19:   0.00   3.18
+4.8N  / 20:   3.18   6.38
+8N    / 21:   6.38   9.59
+11.2N / 22:   9.59  12.84
+14.5N / 23:  12.84  16.13
+17.8N / 24:  16.13  19.47
+21.2N / 25:  19.47  22.89
+24.6N / 26:  22.89  26.39
+28.2N / 27:  26.39  30.00
+31.9N / 28:  30.00  33.75
+35.7N / 29:  33.75  37.67
+39.7N / 30:  37.67  41.81
+44N   / 31:  41.81  46.24
+48.6N / 32:  46.24  51.06
+53.7N / 33:  51.06  56.44
+59.4N / 34:  56.44  62.73
+66.4N / 35:  62.73  70.81
+76.5N / 36:  70.81  90.00
+ 
+! calculate weights w1 and w2
+let rad = 3.14159265/180
+let w1 = (yboxhi[i=1,g=grd]-yboxlo[i=1,g=grd])*cos(y[i=1,g=grd]*rad)
+let w2 = sin(yboxhi[i=1,g=grd]*rad) - sin(yboxlo[i=1,g=grd]*rad)
+ 
+! list normalized weights
+list w1/w1[j=@sum],w2/w2[j=@sum]
+             LATITUDE: 90S to 90N
+ Column  1: EX#1 is W1/W1[J=@SUM]
+ Column  2: EX#2 is W2/W2[J=@SUM]
+               EX#1    EX#2
+76.5S /  1:  0.03826  0.02778
+66.4S /  2:  0.02750  0.02778
+59.4S /  3:  0.02725  0.02778
+53.7S /  4:  0.02718  0.02778
+48.6S /  5:  0.02716  0.02778
+44S   /  6:  0.02714  0.02778
+39.7S /  7:  0.02714  0.02778
+35.7S /  8:  0.02713  0.02778
+31.9S /  9:  0.02713  0.02778
+28.2S / 10:  0.02713  0.02778
+24.6S / 11:  0.02712  0.02778
+21.2S / 12:  0.02712  0.02778
+17.8S / 13:  0.02712  0.02778
+14.5S / 14:  0.02712  0.02778
+11.2S / 15:  0.02712  0.02778
+8S    / 16:  0.02712  0.02778
+4.8S  / 17:  0.02712  0.02778
+1.6S  / 18:  0.02712  0.02778
+1.6N  / 19:  0.02712  0.02778
+4.8N  / 20:  0.02712  0.02778
+8N    / 21:  0.02712  0.02778
+11.2N / 22:  0.02712  0.02778
+14.5N / 23:  0.02712  0.02778
+17.8N / 24:  0.02712  0.02778
+21.2N / 25:  0.02712  0.02778
+24.6N / 26:  0.02712  0.02778
+28.2N / 27:  0.02713  0.02778
+31.9N / 28:  0.02713  0.02778
+35.7N / 29:  0.02713  0.02778
+39.7N / 30:  0.02714  0.02778
+44N   / 31:  0.02714  0.02778
+48.6N / 32:  0.02716  0.02778
+53.7N / 33:  0.02718  0.02778
+59.4N / 34:  0.02725  0.02778
+66.4N / 35:  0.02750  0.02778
+76.5N / 36:  0.03826  0.02778
+ 
+! list weights calculated by Ferret at j=1,2,3,4,5,18
+let all = if test gt 0 then 1
+let total_area = all[x=@din,y=@din]
+let cell1 = if test eq 1 then 1
+let cell2 = if test eq 2 then 1
+let cell3 = if test eq 3 then 1
+let cell4 = if test eq 4 then 1
+let cell5 = if test eq 5 then 1
+let cell18 = if test eq 18 then 1
+list cell1[x=@din,y=@din]/total_area
+             VARIABLE : CELL1[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell2[x=@din,y=@din]/total_area
+             VARIABLE : CELL2[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell3[x=@din,y=@din]/total_area
+             VARIABLE : CELL3[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell4[x=@din,y=@din]/total_area
+             VARIABLE : CELL4[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell5[x=@din,y=@din]/total_area
+             VARIABLE : CELL5[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+list cell18[x=@din,y=@din]/total_area
+             VARIABLE : CELL18[X=@DIN,Y=@DIN]/TOTAL_AREA
+             FILENAME : uncentered.nc
+             LONGITUDE: 100E to 100E(460)
+             LATITUDE : 90S to 90N
+          0.02778
+ 
+GO bn_reset
+cancel mode verify
+GO err62_if_inside_repeat
+! err62_if_inside_repeat.jnl
+! Bug 1681. Parsing error when, inside the REPEAT, we have
+! endif) on a line of its own.
+ 
+! the fix for this bug causes a worse bug for GFDL (see #1706).
+! Thought I had a better fix but it turns out not. For now
+! reverting all the code surrounding these fixes. Do not
+! execute these tests.
+ 
+cancel mode verify
+test1
+test2
+test3
+Now try the same tests with IF 1 inside the REPEATs
+test4
+test5
+test6
+Now try the same tests with IF 1 to execute everything.
+test7
+  hello7
+  hello7
+test8
+  hello8
+  hello8
+test9
+  hello9
+  hello9
+Now try the same tests with IF 1 and ELSE.
+test10
+  hello10
+  hello10
+test11
+  hello11
+  hello11
+test12
+  hello12
+  hello12
+Now try the same tests with IF 0 and ELSE.
+test13
+  else13
+  else13
+test14
+  else14
+  else14
+test15
+  else15
+  else15
+Now try the same tests with IF 0 and ELIF.
+test16
+  elif16
+  elif16
+test17
+  elif17
+  elif17
+test18
+  elif18
+  elif18
+Next should a line that says --->here
+And then    a line that says 201.
+--->here
+   201.0
+done
+ 
+GO bn_reset
+cancel mode verify
+GO err62_title_curvi_plot
+! err62_title_curvi_plot.jnl
+! bug 1669; when the variable and its coordinate variables
+! come from different datasets, we get the variable def, not
+! its title as the main title.
+! The titles should all be SEA SURFACE TEMPERATURE (Deg C)
+ 
+use coads_climatology
+let xval = x[gx=sst[d=1]]+0*y[gy=sst[d=1]]
+let yval = y[gy=sst[d=1]]+0*x[gx=sst[d=1]]
+save/clob/file=a.nc sst[l=1:2], xval, yval
+ 
+can var/all
+use a.nc
+set v ul; shade sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; shade sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; fill sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; fill sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+can view
+set v ul; vector/xskip=10/yskip=10 sst[d=1,l=1],sst[d=1,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+set v ur; vector/xskip=10/yskip=10 sst[d=2,l=1],sst[d=2,l=2], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C) , SEA SURFACE TEMPERATURE (Deg C)"
+ 
+set v ll; contour sst[d=1,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+set v lr; contour sst[d=2,l=1], xval[d=2], yval[d=2]; sh sym labtit
+LABTIT = "SEA SURFACE TEMPERATURE (Deg C)"
+ 
+GO bn_reset
+cancel mode verify
+go err62_save_missingcoordvar
+! err62_save_missingcoordvar.jnl
+! see bug 1686
+! The dataset doesn't have a coordinate variable, in this case TIME
+! Ferret gives it an abstract axis, but then cant SAVE the variable.
+ 
+! This dataset behaves this way
+! use "http://test.opendap.org/opendap/data/nc/data.nc"
+ 
+! create a local dataset
+use timemissing.nc
+save/clobber/file=a.nc sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_contourbug
+! err62_contourbug.jnl
+! Bug 1688
+! contours of curvi data when x units not longitude
+! some contour lines draw across the plot
+ 
+let xb=x[x=0:290:10]
+let yb=y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb=I[x=0:290:10]*J[y=0:290:10]
+contour/hlimits=-100:400:50 xb2+zb,xb2,zb
+ 
+! A FILL version of the same general thing
+let xb = x[x=0:290:10]
+let yb = y[y=0:290:10]
+let xb2 = xb + 0*yb
+let zb = I[x=0:290:10] * J[y=0:290:10]
+fill/hlimits=-100:400:50 0.0000001*(xb2+zb)^3,xb2,zb
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_append_irreg_to_reg
+! err62_append_irreg_to_reg.jnl
+! bug 1692
+ 
+! See Patrick's report:
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00620.html
+! where he points to another example.
+!
+! Turns out he was appending irreg time coords to a regular time axis
+! and Ferret needs a better error message
+ 
+SET MODE IGNORE
+ 
+! By default a regular axis gets no bounds on a SAVE
+DEFINE AXIS/T t_axis = {1,2,3,4,5}
+LET var = T[GT=t_axis]
+SAVE/CLOBBER/FILE=t_bug.nc var
+ 
+! Now try to append this irregularly-spaced data to the above
+DEFINE AXIS/T t_axis = {6,8,9,10,12,13}
+SAVE/FILE=t_bug.nc/APPEND var
+ 
+! previously the message just said
+! ** netCDF error: Variable not found
+ 
+! Msg should explain that it was the bounds variable, needed
+! for the append, but not found in the existing file.
+ 
+SET MODE/LAST IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err62_axis_stride_off
+! err62_axis_stride_off.jnl
+! fixing bug 1689: offset shifted by 1 so /OFFSET=0 >> start index = 1
+ 
+USE truemonth.nc
+ 
+SET AXIS/STRIDE=12/OFFSET=0 truemonth  ! every January
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 20 points (TIME)
+ 16-JAN-1950 /  1:  0.8459
+ 16-JAN-1951 /  2: -0.4792
+ 16-JAN-1952 /  3: -0.0086
+ 16-JAN-1953 /  4:  0.5030
+ 16-JAN-1954 /  5: -0.8601
+ 16-JAN-1955 /  6:  0.9996
+ 16-JAN-1956 /  7: -0.8863
+ 16-JAN-1957 /  8:  0.5404
+ 16-JAN-1958 /  9: -0.0625
+ 16-JAN-1959 / 10: -0.4313
+ 16-JAN-1960 / 11:  0.8159
+ 16-JAN-1961 / 12: -0.9952
+ 16-JAN-1962 / 13:  0.9170
+ 16-JAN-1963 / 14: -0.6068
+ 16-JAN-1964 / 15:  0.1432
+ 16-JAN-1965 / 16:  0.3660
+ 16-JAN-1966 / 17: -0.7727
+ 16-JAN-1967 / 18:  0.9840
+ 16-JAN-1968 / 19: -0.9463
+ 16-JAN-1969 / 20:  0.6618
+ 
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX010)
+SET AXIS/STRIDE=12/OFFSET=11 truemonth ! every December
+LIST var
+             VARIABLE : COS(T[GT=TRUEMONTH]/100)
+             FILENAME : truemonth.nc
+             SUBSET   : 19 points (TIME)
+ DEC-1950 /  1: -0.7241
+ DEC-1951 /  2:  0.2968
+ DEC-1952 /  3:  0.2154
+ DEC-1953 /  4: -0.6635
+ DEC-1954 /  5:  0.9438
+ DEC-1955 /  6: -0.9853
+ DEC-1956 /  7:  0.7713
+ DEC-1957 /  8: -0.3640
+ DEC-1958 /  9: -0.1355
+ DEC-1959 / 10:  0.6006
+ DEC-1960 / 11: -0.9179
+ DEC-1961 / 12:  0.9950
+ DEC-1962 / 13: -0.8204
+ DEC-1963 / 14:  0.4383
+ DEC-1964 / 15:  0.0647
+ DEC-1965 / 16: -0.5423
+ DEC-1966 / 17:  0.8827
+ DEC-1967 / 18: -0.9998
+ DEC-1968 / 19:  0.8589
+ 
+SET MODE IGNORE_ERRROR
+! Previously didnt check for negative offset value
+CAN AXIS/STRIDE `var,return=taxis`
+ !-> CAN AXIS/STRIDE (AX005)
+SET AXIS/STRIDE=12/OFFSET=-1 truemonth
+ 
+! Previously didnt give err msg; just ignored non-positive stride value
+SET AXIS/STRIDE=-1/OFFSET=1 truemonth
+ 
+SET MODE/LAST IGNORE
+ 
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err62_compound_string_conditional
+! err62_compound_string_conditional
+! Bug 1380
+ 
+LIST 1 EQ 2 or 3 EQ 3  ! all numeric
+             VARIABLE : 1 EQ 2 OR 3 EQ 3
+          1.000
+ 
+LIST "a" EQ "b"
+             VARIABLE : "a" EQ "b"
+          0.0000
+LIST "b" EQ "b"
+             VARIABLE : "b" EQ "b"
+          1.000
+LIST "a" EQ "b" OR  "b" EQ "b"  ! should be 1
+             VARIABLE : "a" EQ "b" OR  "b" EQ "b"
+          1.000
+LIST "a" EQ "b" AND "b" EQ "b"  ! should be 0
+             VARIABLE : "a" EQ "b" AND "b" EQ "b"
+          0.0000
+ 
+LIST  "a" LE "b" AND 3 EQ 3  ! should be 1
+             VARIABLE : "a" LE "b" AND 3 EQ 3
+          1.000
+ 
+LIST 1 EQ 2 OR "A" EQ "B"    ! should be 0
+             VARIABLE : 1 EQ 2 OR "A" EQ "B"
+          0.0000
+ 
+*** Running test: bn_axis_reversed_syms.jnl
+! bn_axis_reversed_syms.jnl
+! XAXIS_REVERSED and YAXIS_REVERSED are
+! set to 0 or if the reversed-axis is
+! plotted upside-down, set to 1
+ 
+use gt4d011.cdf
+shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+shade/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! with /TRANS. None of these will have YAXIS_REVERSED=1
+shade/trans/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+contour/trans/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+vector/trans/j=41/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+fill/trans/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+shade/trans/j=41/k=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+ 
+! in viewports
+set view ul; shade/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ur; contour/i=91/j=35 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+set view ll; vector/k=1/l=4 u,v
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "0"
+set view lr; fill/j=41/l=4 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+! also set with  SHADE/SET
+cancel viewports
+ 
+shade/set/i=91/L=1 temp
+sh sym *axis_reversed
+XAXIS_REVERSED = "0"
+YAXIS_REVERSED = "1"
+ 
+*** Running test: bn_isdepth.jnl
+! Tests of `var,RETURN=ISDEPTH`
+ 
+define axis/units=meters/z=0:100:2 zup
+let zz = z[gz=zup]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+define axis/units=meters/z=0:200:2/depth zdn
+let zz = z[gz=zdn]
+say `zz,return=isdep`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use gtbc011
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+use coads_climatology
+say `sst,return=isdepth`
+ !-> MESSAGE/CONTINUE NORMAL
+NORMAL
+ 
+can data 2
+ 
+cancel axis/depth `temp,return=zaxis`
+ !-> cancel axis/depth PSZT
+say `temp,return=isdepth`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+*** Running test: bn_var_hist_levels.jnl
+! bn_var_hist_levels.jnl
+! Syntax for variance-based or histogram-based levels
+!
+ 
+use levitus_climatology
+ 
+! Variance levels
+shade/line/lev=50v/title="/LEV=50v" temp[K=1]
+ 
+! New symbol LEV_OPNLEVS captures the levels set with /V or VC
+sh sym lev*
+LEV_TEXT = "50V"
+LEV_MIN = "-2"
+LEV_MAX = "30.74"
+LEV_NUM = "56"
+LEV_DEL = "0.5"
+LEV_OPNLEVS = "(-2,3.05,0.505)(3.5,25.5,0.5)(25.5,25.5,0.505)(inf)"
+ 
+shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
+shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
+shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]
+ 
+! If the data has lots of negative data, the computation of
+! the std deviation was incorrect.  See ticket 1778.
+ 
+let negvar = -1* temp
+ 
+shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
+shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
+shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
+shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]
+ 
+! Histogram-based
+shade/line/lev=50h/title="/LEV=50h" temp[K=1]
+ 
+ 
+! Need some tests with centered levels and with /LINE
+ 
+let cvar = temp - 15
+ 
+shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
+shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
+shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]
+ 
+ 
+shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
+shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
+shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
+shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
+shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]
+ 
+! Histogram-based
+shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]
+ 
+*** Running test: bn64_bug_fixes.jnl
+! bn64_bug_fixes.jnl
+! Fixes that go into v6.4 release
+ 
+! (changes were made to err62_if_inside_repeat.jnl
+!  which is run previously.)
+ 
+GO bn_reset
+cancel mode verify
+GO err63_days1900toydmhms
+! err63_days1900toydmhms.jnl
+!
+! Bug reported by Jaison Kurian
+! 32-bit linux, this returned the wrong month
+! and day for start of March.
+ 
+define axis/t=21241:21245:1 tax
+let julshift = DAYS1900(1950,1,1)
+let julday   = t[gt=tax] + julshift
+let tpts     = DAYS1900TOYMDHMS(julday)
+list/k=2:3 tpts
+             VARIABLE : DAYS1900TOYMDHMS(JULDAY)
+             SUBSET   : 2 by 5 points (Z-T)
+                 2      3    
+                 2      3
+ 21241   / 1:   2.00  27.00
+ 21242   / 2:   2.00  28.00
+ 21243   / 3:   2.00  29.00
+ 21244   / 4:   3.00   1.00
+ 21245   / 5:   3.00   2.00
+ 
+GO bn_reset
+cancel mode verify
+GO err63_log_vaxis
+! err63_log_vaxis.jnl
+! fix for bug 1708
+! This example from Patrick Brockmann.
+ 
+! ok
+set view left
+def axis/z=10:10000:10 vert_axis_up
+plot/vlog z[gz=vert_axis_up]
+ 
+ 
+! not ok : left vertical log axis is down. right vertical axis is up
+set view right
+def axis/z=10:10000:10/depth vert_axis_dn
+plot/vlog z[gz=vert_axis_dn]
+ 
+GO bn_reset
+cancel mode verify
+GO err63_delim_E.jnl
+! err63_delim_E.jnl
+! bug 1700
+! On delimited reads, looking for strings ending with E for longitudes.
+! But need to check if its just a string ending in E such as ZAIRE
+ 
+sp rm -f names
+sp echo ZAIRE > names
+sp echo E >> names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             SUBSET   : 2 points (X)
+ 1   / 1:"ZAIRE"
+ 2   / 2:"E"    
+ 
+can dat/all
+sp rm -f names
+sp echo zaire > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "zaire"
+ 
+can dat/all
+sp rm -f names
+sp echo ZAIRA > names
+columns names
+list v1
+             VARIABLE : V1
+             FILENAME : names
+             X        : 1
+        "ZAIRA"
+*** Running test: bn_long_grid_names.jnl
+! bn_long_grid_names.jnl
+! test longer grid names (16 --> 64 chars)
+! tests taken from other bn scripts but with longer grid names
+ 
+! read onto a 2D grid
+DEFINE AXIS/X=1:3:1 xez1
+DEFINE GRID/X=XEZ1/Y=EZ ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+ 
+FILE/VAR="X1,X2"/COLUMNS=6/GRID=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 EZ.DAT
+SHOW DATA/FULL
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ 
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ X2       X2                               1:3       1:20480   ...       ...       ...       ...
+               on grid ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 with -1.E+34 for missing data
+             X=0.5:3.5  Y=0.5:20480.5  
+ 
+ /FORMAT = FREE
+ /SKIP = 0
+ /COLUMNS = 6
+LIST X1
+             VARIABLE : X1
+             FILENAME : EZ.DAT
+             SUBSET   : 3 by 5 points (X-Y)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0060  0.1760  0.2820
+ 2   / 2:  0.3550  0.3790  0.3930
+ 3   / 3:  0.4100  0.4170  0.4670
+ 4   / 4:  0.4350  0.4440  0.4700
+ 5   / 5:  0.4780  0.5150  0.4690
+SHOW DATA
+     currently SET data sets:
+    1> ./EZ.DAT  (default)
+ name     title                             I         J         K         L         M         N
+ X1       X1                               1:3       1:5       ...       ...       ...       ...
+ X2       X2                               1:3       1:5       ...       ...       ...       ...
+ 
+CAN DATA/ALL
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/z=2:20:2 zeven
+define axis/z=1:19:2 zodd
+define axis/t=2:20:2/t0="1-jan-1980"/unit=days teven
+define axis/t=1:19:2/t0="1-jan-1980"/unit=days todd
+ 
+define grid/x=xeven/y=yeven/z=zeven/t=teven even
+ 
+define grid/x=xodd/y=yodd/z=zodd/t=todd g00abcdefghijklmnopqrstuvwxyz1234567890
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*k[g=even] + l[g=even]
+ 
+LET v1234 = veven[g=g00abcdefghijklmnopqrstuvwxyz1234567890]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/Z=4.01:8.99/T=4.01:8.99
+ 
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             4      6      8    
+             2      3      4
+ ---- L:2 T:   05-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- K:3 Z:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- K:4 Z:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- L:3 T:   07-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- K:3 Z:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- K:4 Z:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- L:4 T:   09-JAN-1980 00:00
+ ---- K:2 Z:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- K:3 Z:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- K:4 Z:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-Z-TIME)
+             5      7      9    
+             3      4      5
+ ---- L:3 T:   06-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- K:4 Z:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- K:5 Z:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- L:4 T:   08-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- K:4 Z:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- K:5 Z:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- L:5 T:   10-JAN-1980 00:00
+ ---- K:3 Z:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- K:4 Z:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- K:5 Z:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*K[G=EVEN] + L[G=EVEN]
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/z=1:11/t=1:11 veven
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
+             X: 4 to 9
+             Y: 4 to 9
+             Z: 4.01 to 8.99
+             TIME: 05-JAN-1980 00:14 to 09-JAN-1980 23:45
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*3*3*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+go bn_reset
+cancel mode verify
+! regrid_transforms
+use gtsa056_1
+use gtsa056_2
+set mode diag
+ 
+define axis/t=15-jan-1982:15-mar-1984:120/unit=hour tax5day
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=u/t=tax5day g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day
+ getgrid EX#1     C:  7 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+define grid/like=u/x=xax10/z=w/t=tax5day g5_10g00abcdefghijklmnopqrstuvwxyz1234567890
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  8 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  9 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ 
+set reg/x=130w:125w/y=0:1.5/z=0:15/t=21-JAN-1982:24-jan-1982
+!set reg/i=101:105/j=41:42/k=1:2/l=3:4
+ 
+use gtsa056_1    	!kob 4/99
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid PS3DW11         PSXT      PSYT      PSZW      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ reading TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AAV, on Y at AAV*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.97  24.15  24.37  24.63
+ 25-JAN-1982 00 / 3:  23.89  23.98  24.17  24.40  24.65
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gx=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AVE
+ strip regrid on Y: TEMP --> XNTERMED         @LIN
+ strip regrid on Z: TEMP --> YNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  1 dset:   1 I:   95  106  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  1 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:   95  106  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at AVE, on Y at LIN*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.88  23.98  24.15  24.38  24.63
+ 25-JAN-1982 00 / 3:  23.88  23.97  24.15  24.39  24.64
+ 
+LIST temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ found   TEMP     M:  6 dset:   1 I:   95  106  J:   45   50  K:    1    2  L:    2    5  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  2 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  5 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  2 dset:   1 I:  100  101  J:   45   50  K:    1    2  L:    2    3  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  2 dset:   1 I:   12   12  J:   45   49  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  5 dset:   1 I:  100  101  J:   45   50  K:    1    1  L:    2    3  M: -999 -999  N: -999 -999
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5_10G00ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 on X at LIN, on Y at LIN*
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 by 2 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+             DEPTH (m): 10
+                       0      0.33N  0.67N  1N     1.33N 
+                       45     46     47     48     49
+ 20-JAN-1982 00 / 2:  23.75  23.76  23.87  24.04  24.25
+ 25-JAN-1982 00 / 3:  23.74  23.73  23.82  23.97  24.15
+ 
+! T axis
+use gtsa056_2	!kob  4/99
+set region/x=180W/y=0/z=5/t=21-JAN-1982:13-JUN-1983
+load temp[i=50:51,j=45:56,k=1:2,l=1:172]  ! preload to save time
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     1   172 dset:   2
+ reading TEMP     M:  5 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+plot temp
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=u]
+ dealloc  dynamic grid PS3DT1          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  9 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 10 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 10 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @LIN
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 10 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 10 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 10 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M:  8 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 4    complete
+plot/over temp[g=u at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M:  8 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @AAV
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 12 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @AAV
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M:  3 dset:   2 I:   50   51  J:   45   50  K:    1    2  L:    1  172  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 13 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 13 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ -DELETE TEMP     M: 14 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @AAV
+ strip regrid on Z: TEMP --> XNTERMED         @AVE
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ strip moduloing TEMP on T axis:     2   171 dset:   2
+ reading TEMP     M: 14 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1   168 dset:   2
+ regrid  TEMP     M: 15 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 15 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 15 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   45   56  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=u at asn]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ strip moduloing TEMP on T axis:     3   170 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 16 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 17 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 16 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  168  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     3   168 dset:   2
+ strip regrid on X: TEMP --> PS3DU1           @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 14 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    1  168  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 18 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 19 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 18 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    1    2  M: -999 -999  N: -999 -999
+ doing moduloing TEMP on T axis:     1     2 dset:   2
+setting up plot
+PPL plot 8    complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at asn]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @ASN
+ strip regrid on Y: TEMP --> XNTERMED         @ASN
+ strip regrid on Z: TEMP --> YNTERMED         @ASN
+ strip regrid on T: TEMP --> ZNTERMED         @ASN
+ reading TEMP     M: 18 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 21 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 9    complete
+plot/over temp[g=u,gt=u at ave]
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ allocate dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ found   TEMP     M:  7 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    3  170  M: -999 -999  N: -999 -999
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+setting up plot
+PPL plot 10   complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at ave]
+ dealloc  dynamic grid PS3DU1          PSXU      PSYU      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @AVE
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 22 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 11   complete
+plot/over temp[g=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890,gt=g5_10g00abcdefghijklmnopqrstuvwxyz1234567890 at ave]
+ dealloc  dynamic grid G5DAYG5DAYG5DAYGPSXU      PSYU      PSZT      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5_10G00ABCDEFGH @LIN
+ strip regrid on Z: TEMP --> XNTERMED         @LIN
+ strip regrid on T: TEMP --> ZNTERMED         @AVE
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 20 dset:   2 I:   50   51  J:   45   46  K:    1    2  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 20 dset:   2 I:    7    7  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 12   complete
+plot/over temp[g=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day,gt=g5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5dayg5day at asn]  ! invalid interpretation of data
+ dealloc  dynamic grid G5_10G00ABCDEFGHXAX10     PSYU      PSZW      TAX5DAY   NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ strip regrid on X: TEMP --> G5DAYG5DAYG5DAYG @LIN
+ strip regrid on T: TEMP --> XNTERMED         @ASN
+ found   TEMP     M: 13 dset:   2 I:   45   56  J:   45   46  K:    1    2  L:    2  171  M: -999 -999  N: -999 -999
+ regrid  TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ regrid XY
+ regrid  TEMP     M: 24 dset:   2 I:   50   50  J:   45   45  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+ -DELETE TEMP     M: 23 dset:   2 I:   50   51  J:   45   46  K:    1    1  L:    2  104  M: -999 -999  N: -999 -999
+setting up plot
+PPL plot 13   complete
+ 
+ 
+set mode/last diag
+ 
+go bn_reset
+cancel mode verify
+! regrid_to_user
+ 
+use coads_climatology
+use levitus_climatology
+ 
+! define test objects
+let a = sst[d=coads_climatology] + 1
+let b = sst + 1		! data set unspecified
+DEFINE AXIS/Y=20s:20n:.5/units=degrees yax
+DEFINE GRID/like=sst[d=coads_climatology]/y=yax gg12345678901234567890
+ 
+! reference data
+list/x=158e:161e/y=6s:4s temp[d=2,k=1]
+             VARIABLE : TEMPERATURE (DEG C)
+             FILENAME : levitus_climatology.cdf
+             SUBSET   : 3 by 2 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 0
+             158.5E 159.5E 160.5E 
+             139    140    141
+ 4.5S / 86:  29.51  29.44  29.38
+ 5.5S / 85:  29.59  29.53  29.46
+ 
+! basic regrid (implicit grid -- sst and temp geometries are mismatched)
+list/x=160e/y=5s temp[d=2,k=1,g=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 2 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ COADSY    LATITUDE            90 r   89S                  89N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! per axis regrid
+! 5/01 note: changed from y=0 yo y=5s to accomodate Y-truncated
+! levitus_climatology.cdf
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],gy=yax]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gy=yax,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! combined full grid and per-axis
+list/x=160e/y=5s temp[d=2,k=1,g=gg12345678901234567890,gx=a[d=1]]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+list/x=160e/y=5s temp[d=2,k=1,gx=a[d=1],g=gg12345678901234567890]
+             VARIABLE : TEMPERATURE (DEG C)
+                        regrid: 2 deg on X, 0.5 deg on Y
+             FILENAME : levitus_climatology.cdf
+             LONGITUDE: 159E
+             LATITUDE : 5S
+             DEPTH (m): 0
+          29.52
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ YAX       LATITUDE            81 r   20S                  20N
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+ 
+! pseudo-variable access
+list/i=1:4 i[g=a]		! a is previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let c = a
+list/i=1:4 i[g=c]		! c is not previously loaded
+             VARIABLE : I
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  1.000
+ 23E   / 2:  2.000
+ 25E   / 3:  3.000
+ 27E   / 4:  4.000
+let d = c
+list/i=1:4 x[gx=d]
+             VARIABLE : X
+                        axis COADSX
+             SUBSET   : 4 points (LONGITUDE)
+ 21E   / 1:  21.00
+ 23E   / 2:  23.00
+ 25E   / 3:  25.00
+ 27E   / 4:  27.00
+ 
+! DEFINE GRID based on a user-defined variable
+let e = d
+DEFINE GRID/LIKE=e/x=temp[d=levitus_climatology] gg123456789012345678901
+show grid gg123456789012345678901
+    GRID GG123456789012345678901
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+let f = sst[y=20s:20n:.1,d=coads_climatology]
+DEFINE GRID/LIKE=f/x=temp[d=levitus_climatology] gg123456789012345678902
+cancel variable f
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ (AX007)   LATITUDE           401 r   20S                  20N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   1
+ 
+! demonstrate proper management of dynamic axes
+DEFINE GRID/LIKE=gg123456789012345678902 gg123456789012345678903
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   2
+DEFINE GRID/like=temp[d=levitus_climatology] gg123456789012345678902
+show grid gg123456789012345678902
+    GRID GG123456789012345678902
+ name       axis              # pts   start                end
+ XAXLEVITR1_160 LONGITUDE     160mr   20.5E                179.5E
+ YAXLEVITR1_90 LATITUDE        90 r   89.5S                0.5S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    no implicit grids
+Dynamic axes:
+    AXIS (AX007)                         use count:   1
+ 
+! SET GRID using a user-defined variable
+let g = sst[x=0:30:.1,d=coads_climatology]
+set grid g
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+ 
+! The SET GRID (default) definition should be protected -- not altered
+load/d=coads_climatology sst[y=-10:10:.1,l=1,x=160e]
+show grid
+ Default grid for DEFINE VARIABLE is (G006)
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+show grid/dynamic
+Dynamic grids:
+    GRID (G005)                          use count:   1
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE           201 r   10S                  10N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+    GRID (G006)                          use count:   1
+ name       axis              # pts   start                end
+ (AX009)   LONGITUDE          301 r   0E                   30E
+ COADSY    LATITUDE            90 r   89S                  89N
+ normal    Z
+ TIME      TIME                 3mr   16-JAN 06:00         17-MAR 02:58
+ normal    E
+ normal    F
+Dynamic axes:
+    AXIS (AX010)                         use count:   1
+    AXIS (AX009)                         use count:   1
+    AXIS (AX007)                         use count:   1
+ 
+! deliberate errors
+set mode ignore
+load/x=160e/y=5s temp[d=2,k=1,g=no_exist12345678901234567890]	! non-existent target variable
+ 
+set mode/last ignore
+ 
+go bn_reset
+cancel mode verify
+ 
+! dynamic grid commands
+ 
+use coads_climatology
+use levitus_climatology
+ 
+DEFINE GRID/LIKE="temp[d=2,gx=sst[d=1],y=10s:2s:.2] + 5" mygrid_123456789012345678901234567890
+SHOW GRID mygrid_123456789012345678901234567890
+    GRID MYGRID_123456789012345678901234567890
+ name       axis              # pts   start                end
+ COADSX    LONGITUDE          180mr   21E                  19E(379)
+ (AX010)   LATITUDE            41 r   10S                  2S
+ ZAXLEVITR1_1 DEPTH (m)         1 r-  0                    0
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_xml_repl.jnl
+! bn_xml_repl.jnl
+! replace > and < and & with their html equivalents.
+ 
+use coads_climatology
+set var/title="a title with & and > and < characters" sst
+set var/units="<<" sst
+set att sst.history = "Adding some ampersands.& & to the history"
+sh dat/xml/var
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[<<]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[a title with & and > and < characters]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+shade/l=1 sst
+*** Running test: bn65_bug_fixes.jnl
+! bn65_bug_fixes.jnl
+! Fixes that go into v6.5 release
+ 
+GO bn_reset
+cancel mode verify
+GO err64_very_small_latlon
+! err64_very_small_latlon.jnl
+! Based on a report and data file from Jean Newman.
+ 
+use err64_small_latlon
+ 
+! crashed because of formats for lon/lat axis labels.
+shade bathy
+ 
+! This one uses so many digits it will not be formatted
+shade/i=1:10/j=1:10 bathy
+ 
+GO bn_reset
+cancel mode verify
+GO err64_packed_data
+! err64_packed_data.jnl
+! Test writing packed data. Prior to v6.4 this example shows the
+! crash described in bug 1715.
+ 
+! ncpdq from NCO operators
+! sp ncpdq fine_x_axis.nc err64_packed_data.nc
+use err64_packed_data.nc
+sh att/all sst
+     attributes for dataset: ./err64_packed_data.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ 
+! check that the coordinates packed by ncpdq are unpacked ok.
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : err64_packed_data.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+                   0.03S 
+                    1
+ 179.972W  /  1:  27.50
+ 179.922W  /  2:  27.48
+ 179.872W  /  3:  27.47
+ 179.822W  /  4:  27.47
+ 179.772W  /  5:  27.45
+ 179.722W  /  6:  27.43
+ 179.672W  /  7:  27.43
+ 179.622W  /  8:  27.43
+ 179.572W  /  9:  27.45
+ 179.522W  / 10:  27.46
+ 179.472W  / 11:  27.47
+ 179.422W  / 12:  27.46
+ 179.372W  / 13:  27.47
+ 179.322W  / 14:  27.48
+ 179.272W  / 15:  27.49
+ 
+! we can write the data out - saving the scaling to re-pack.
+set att/output sst.scale_factor
+set att/output sst.add_offset
+ 
+! With double-precision Ferret, need to write as float,
+! or the FillValue cant be represnted.
+ 
+set var/outtype=float sst
+ 
+save/clobber/file=mypack.nc/i=1:15 sst
+can data/all; use mypack.nc
+sh att/all sst
+     attributes for dataset: ./mypack.nc
+ SST.missing_value = 1.E+20
+ SST._FillValue = 1.E+20
+ SST.long_name = sea surface temperature [degc] 
+ SST.history = From ghrsst_global 
+ SST.scale_factor = -0.0001263447
+ SST.add_offset = 27.32
+ SST.Ferret_Precision_Note = This variable written using Ferret was converted from SHORT to FLOAT 
+ 
+list/i=1:15 sst
+             VARIABLE : sea surface temperature [degc]
+             FILENAME : mypack.nc
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 0.03S
+             Z (count): 1
+             TIME     : 01-APR-2006 00:00
+                   0.03S 
+                    1
+ 179.972W  /  1:  27.50
+ 179.922W  /  2:  27.48
+ 179.872W  /  3:  27.47
+ 179.822W  /  4:  27.47
+ 179.772W  /  5:  27.45
+ 179.722W  /  6:  27.43
+ 179.672W  /  7:  27.43
+ 179.622W  /  8:  27.43
+ 179.572W  /  9:  27.45
+ 179.522W  / 10:  27.46
+ 179.472W  / 11:  27.47
+ 179.422W  / 12:  27.46
+ 179.372W  / 13:  27.47
+ 179.322W  / 14:  27.48
+ 179.272W  / 15:  27.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_repl_9999999
+! bn_repl_9999999.jnl
+! Bug 1717
+! Bug on 64-bit ferret, replacing variable var= .9999999
+! which should just evaluate to 1. TM_FMT wound up with a
+! fortran FORMAT(I0) to write the value to the new command line.
+ 
+let var=0.9999999
+def view/xlim=0,`var`/ylim=0,1 view9999999
+ !-> def view/xlim=0,0.9999999/ylim=0,1 view9999999
+can view view9999999
+ 
+GO bn_reset
+cancel mode verify
+GO err64_shakey_missingdata
+! err64_shakey_missingdata.jnl
+! starting with v6.2 a polygon plot with all missing data.
+! The shakey is just blank, not the requested colors.
+!
+! was ok ferret_v6193
+!        Linux(g77) 2.4.21-32 - 02/18/09
+!
+! Not   FERRET v6.194
+!        Linux(g77) 2.4.21-32 - 03/03/09
+!
+! This is in fillpol - the fix to bug 1641
+ 
+! Define some data; zpts all missing
+let xpts = {3,5,6,7,8,9,10,13,15,16,17,18,19,21,22}
+let ypts = {1,2,3,4,5,6, 7, 8, 9, 4, 5, 6, 7, 8, 9}
+let zpts = { , , , , , ,  ,  ,  ,  ,  ,  ,  ,  ,  }
+ 
+plot/vs/line xpts,ypts
+go polytube polygon/over/key/lev=(0,6,1) xpts,ypts,zpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_return_precision
+!err64_return_precision.jnl
+! most of these resulted in *** - format too small.
+! see bug1611
+ 
+say `.099,p=-1`
+ !-> MESSAGE/CONTINUE 0.1
+0.1
+ 
+say `.99,p=-1`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+say `9.99,p=-1`
+ !-> MESSAGE/CONTINUE 10
+10
+ 
+say `99.99,p=-1`
+ !-> MESSAGE/CONTINUE 100
+100
+ 
+say `999.99,p=-1`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+say `999.999,p=-2`
+ !-> MESSAGE/CONTINUE 1000
+1000
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_parse_equals
+! err64_parse_equals
+! Bug1469 (and duplicate 1690)
+! Parsing equals sign when it is in a string within
+! grave accents.
+ 
+say `"+" EQ " "`
+ !-> MESSAGE/CONTINUE 0
+0
+ 
+say `"=" EQ "="`
+ !-> MESSAGE/CONTINUE 1
+1
+ 
+DEFINE SYMBOL my_sym  = `UPCASE("/lev=(0,30,2)")`
+ !-> DEFINE SYMBOL my_sym  = /LEV=(0,30,2)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err64_regrid_noleap
+! err64_regrid_noleap.jnl
+!
+! Bug 1723
+! Seen only under 32-bit, exec. built with netcdf4.1 library
+ 
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge tax = \
+    {419263, 419293, 419324, 419354, 419385, 419416, \
+    419444, 419475, 419505, 419536, 419566, 419597}
+def ax/t/unit=days/t0=1-jan-0001/cal=noleap/edge/modulo=365 tax_c = \
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
+ 
+let a = t[gt=tax]
+let a_c = t[gt=tax_c]
+let b = a_c[gt=a]
+list b[t=15-feb-1150]  ! missing??
+             VARIABLE : A_C[GT=A]
+             TIME     : 15-FEB-1150 00:00 NOLEAP
+          419430.
+ 
+list b  ! includes Feb 15 1150, not missing...
+             VARIABLE : A_C[GT=A]
+             SUBSET   : 11 points (TIME)
+             CALENDAR : NOLEAP
+ 16-SEP-1149 00 /  1:  419278.
+ 16-OCT-1149 12 /  2:  419309.
+ 16-NOV-1149 00 /  3:  419339.
+ 16-DEC-1149 12 /  4:  419370.
+ 16-JAN-1150 12 /  5:  419401.
+ 15-FEB-1150 00 /  6:  419430.
+ 16-MAR-1150 12 /  7:  419460.
+ 16-APR-1150 00 /  8:  419490.
+ 16-MAY-1150 12 /  9:  419521.
+ 16-JUN-1150 00 / 10:  419551.
+ 16-JUL-1150 12 / 11:  419582.
+ 
+list b[t=15-feb-1150]  ! Now ok??
+             VARIABLE : A_C[GT=A]
+             TIME     : 15-FEB-1150 00:00 NOLEAP
+          419430.
+ 
+GO bn_reset
+cancel mode verify
+GO err64_polymark_over_calendar
+! err64_polymark_over_calendar.jnl
+! bug1722.  Polymark script failed with calendar mismatch
+!           it should not if the overlay time axis is abstract.
+!
+def ax/t=1-jan-0002:1-jan-0010:1/cal=noleap/unit=year/edges tax
+let tval = t[gt=tax]
+plot tval
+let pos = {`tval[l=4]`,`tval[l=5]`}
+ !-> DEFINE VARIABLE pos = {5.5,6.5}
+poly/ov/nolab/line=15 pos,pos      ! this works
+ 
+! Here we got an error about mismatched calendars on time axes:
+go polymark "poly/ov/nolab/pal=red/line=1" pos pos " " circle .5
+ 
+ 
+*** Running test: bn_txtype_dmy.jnl
+! bn_txtype_dmy.jnl
+! 2/2010 ACM
+!
+! Testing Time Axis plot style "DMY" labels the year
+! as well as month or day,month on MON and DAY axes.
+! Symbol TXTYPE_SETTING contains YR, MON, DAY after the
+! axis type has been set for the axis; lets us plot/set
+! and then choose the time axis label style
+! Useful when going across years or plotting with /NOLAB
+ 
+set win/asp=1
+use gtsa056_2.cdf
+ 
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/x=140w/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/x=140w/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+ 
+! Same commands with the TIME axis on the vertical
+! Plot the whole series; txtype is YR
+plot/x=140w/y=-1/k=1/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "YR"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! This will be MON
+shade/y=-1/k=1/t=1-feb-1982:15-apr-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl shade
+ 
+! Also MON so setting not changed.
+contour/y=-1/k=1/t=1-feb-1982:15-feb-1982/set temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 1 THEN PPL TXTYPE,MON,DMY
+ppl contour
+ 
+ 
+! Is DAY so setting not changed.
+ 
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|MON>1|*>0") THEN PPL TXTYPE,MON,DMY
+ !-> if 0 THEN PPL TXTYPE,MON,DMY
+ppl plot
+ 
+! Set PPL TXTYPE with DAY,DMY
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:2-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "DAY"
+if ($TXTYPE_SETTING"0|DAY>1|*>0") THEN PPL TXTYPE,DAY,DMY
+ !-> if 1 THEN PPL TXTYPE,DAY,DMY
+ppl plot
+ 
+! If the type is going to be EITHER DAY or MON then set
+! the style to DMY. Leave the 1st argument blank to keep the
+! default
+plot/set/trans/x=140w/y=-1/k=1/t=27-feb-1982:28-mar-1982 temp
+sh sym TXTYPE_SETTING
+TXTYPE_SETTING = "MON"
+if ($TXTYPE_SETTING"0|DAY>1|MON>1|*>0") THEN PPL TXTYPE,,DMY
+ !-> if 1 THEN PPL TXTYPE,,DMY
+ppl plot
+ 
+! make sure this setting doesnt persist
+plot/y=-1/k=1/t=5-mar-1982:28-mar-1982/x=144w temp
+plot/y=-1/k=1/t=5-mar-1982:28-apr-1982/x=144w temp
+*** Running test: bn_n_open_dsets_sym.jnl
+ !  bn_n_open_dsets_sym.jnl
+! Ferret v6.5
+! New special symbol N_OPEN_DSETS, evaulated when requested.
+! Gives a count of the number of open datasets.
+ 
+! Initially should be zero
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+! Open some datasets
+use dstitle
+use TAO_SST_clim
+use clim_airt_lev
+ 
+! Check
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+! Open a few more. Any type of data
+set data tok_short.des
+ 
+list/clobber/file=list_of_numbers.dat/nohead/norowhead {1,3,4,5,6,8,9}
+file/var=v1 list_of_numbers.dat
+ 
+! now  there are five
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "5"
+ 
+! cancel a couple
+can data 3
+can data TAO_SST_clim
+ 
+! Now three
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "3"
+ 
+can dat/all
+sh sym N_OPEN_DSETS
+N_OPEN_DSETS = "0"
+ 
+*** Running test: bn_multi_decade.jnl
+! bn_multi_decade.jnl
+! New default no-small tics for multi-decade plots
+! See bug 670
+ 
+def axis/t="01-JAN-1860":"30-DEC-2300":5/edges/units="Days"/cal="360d" simutaxis1
+let tvar = t[gt=simutaxis1]*-1E+34
+ 
+define view/x=0:1/y=0.000:0.125 v1
+define view/x=0:1/y=0.125:0.250 v2
+define view/x=0:1/y=0.250:0.375 v3
+define view/x=0:1/y=0.375:0.500 v4
+define view/x=0:1/y=0.500:0.625 v5
+define view/x=0:1/y=0.625:0.750 v6
+define view/x=0:1/y=0.750:0.875 v7
+define view/x=0:1/y=0.875:1.000 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/nolab/ax=0,1,0,0/vlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/nolab/ax=0,1,0,0/vlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+ 
+cancel view
+ 
+! Test vertical time axes.
+ 
+define view/x=0.000:0.125/y=0:1 v1
+define view/x=0.125:0.250/y=0:1 v2
+define view/x=0.250:0.375/y=0:1 v3
+define view/x=0.375:0.500/y=0:1 v4
+define view/x=0.500:0.625/y=0:1 v5
+define view/x=0.625:0.750/y=0:1 v6
+define view/x=0.750:0.875/y=0:1 v7
+define view/x=0.875:1.000/y=0:1 v8
+ 
+! Plot a variety of time axis lengths.
+set view v1; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1870]
+set view v2; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1880]
+ 
+! New default: no small tics for multi-decade plots
+set view v3; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-1890]
+set view v4; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2000]
+set view v5; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2060]
+set view v6; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar[t=1-jan-1860:1-jan-2160]
+set view v7; plot/trans/nolab/ax=0,0,1,0/hlim=0:1 tvar
+ 
+! can plot the tics even on a multi-decade axis by specifying PPL TICS.
+set view v8; plot/trans/nolab/ax=0,0,1,0/hlim=0:1/set tvar
+  ppl tics,0.1,0.25
+  ppl plot
+*** Running test: bn_show_xml_file.jnl
+! bn_show_xml_file.jnl
+! Testing SHOW DATA/OUTFILE
+!         SHOW AXIS/OUTFILE
+!         SHOW VAR/OUTFILE
+!         SAY/OUTFILE
+!
+! Similar to LAS iosp script header.jnl
+! capability to be expanded to all SHOW commands in the future.
+! 5/2012:
+! Do this on a dataset with just one variable.
+! Dont do show axis/all. Just the axes for one variable is a lot of output.
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+USE ocean_atlas_temp.cdf
+ 
+DEFINE SYMBOL output_xml_file = the_xml_file.xml
+ 
+say/quiet/outfile=($output_xml_file)/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile=($output_xml_file)/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append <data>
+ 
+show var/xml/append/outfile=($output_xml_file)
+ !-> show var/xml/append/outfile=the_xml_file.xml
+show data/var/xml/append/outfile=($output_xml_file)
+ !-> show data/var/xml/append/outfile=the_xml_file.xml
+say/quiet/outfile=($output_xml_file)/append </data>
+ !-> MESSAGE/CONTINUE/quiet/outfile=the_xml_file.xml/append </data>
+ 
+! on 32-bit machine the cat command below doesnt show file contents if
+! the file is still open. Close it by listing to another file.
+list/clobber/file=dummy.dat 1
+ 
+ 
+! Note with the fix to ticket 883, the ordering of the axis listing is
+! different. This is unimportant to using the xml files.
+sp cat the_xml_file.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./ocean_atlas_temp.cdf" default="true">
+<title> </title>
+<var name="TEMP">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Temperature]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GBS1">
+<axes>
+<xaxis>XAX_LEV9421_380</xaxis>
+<yaxis>YAX_LEV94</yaxis>
+<zaxis>ZAXLEVIT191_1</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="XAX_LEV9421_380">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>20.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[XAX_LEV9421_380]]></value>
+</attribute>
+</axis>
+<axis name="YAX_LEV94">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[YAX_LEV94]]></value>
+</attribute>
+</axis>
+<axis name="ZAXLEVIT191_1">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[METERS]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[ZAXLEVIT191_1]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-02-15 16:29:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+*** Running test: bn66_bug_fixes.jnl
+! bn66_bug_fixes.jnl
+! Fixes that go into v6.6 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_averages.jnl
+ 
+use gt4d011
+set region/z=0:90/y=-3.5:3.5
+stat temp[x=@ave,t=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XT ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (XT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 198 (1*22*9*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 24.279
+ Maximum value: 31.248
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.7502
+ 
+stat temp[x=@ave,z=@ave]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W (XZ ave)
+             LATITUDE: 3.5S to 3.5N
+             DEPTH (m): 0 to 90 (XZ ave)
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 550 (1*22*1*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 25.194
+ Maximum value: 30.027
+ Mean    value: 28.047 (unweighted average)
+ Standard deviation: 1.1926
+ 
+list temp[x=@ave,z=@ave,t=@ave]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 22 points (LATITUDE)
+             LONGITUDE: 140W to 122W (XZT ave)
+             DEPTH (m): 0 to 90 (XZT ave)
+             TIME     : 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (XZT ave)
+ 3.5N  / 56:  27.59
+ 3.17N / 55:  27.76
+ 2.83N / 54:  27.90
+ 2.5N  / 53:  28.00
+ 2.17N / 52:  28.08
+ 1.83N / 51:  28.14
+ 1.5N  / 50:  28.16
+ 1.17N / 49:  28.16
+ 0.83N / 48:  28.15
+ 0.5N  / 47:  28.14
+ 0.17N / 46:  28.14
+ 0.17S / 45:  28.15
+ 0.5S  / 44:  28.18
+ 0.83S / 43:  28.21
+ 1.17S / 42:  28.23
+ 1.5S  / 41:  28.23
+ 1.83S / 40:  28.22
+ 2.17S / 39:  28.17
+ 2.5S  / 38:  28.08
+ 2.83S / 37:  27.96
+ 3.17S / 36:  27.80
+ 3.5S  / 35:  27.61
+ 
+stat temp[z=@ave,t=@ave,y=-2:2]
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 2S to 2N
+             DEPTH (m): 0 to 90 (ZT ave)
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00 (ZT ave)
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 234 (18*13*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 27.445
+ Maximum value: 28.925
+ Mean    value: 28.173 (unweighted average)
+ Standard deviation: 0.40997
+ 
+cancel region
+*** Running test: bn_netcdf4.jnl
+! bn_netcdf4.jnl
+! test syntax for controling NetCDF-4 intput and output.
+ 
+ 
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=4
+ 
+show nccache
+Current NCDF Chunk Cache size 4 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+show nccache
+Current NCDF Chunk Cache size 4.1943 MB, n_elems = 1009, preemption = 75
+ 
+set nccache/siz=8
+show nccache
+Current NCDF Chunk Cache size 8 MB, n_elems = 1009, preemption = 75
+cancel nccache
+ 
+! --------------------------
+! Set choice of chunking.
+can dat/all; can var/all; can mem/all
+ 
+use coads_climatology
+set var/title=deflate_x30_y30 sst
+ 
+save/file=nc4_deflate4.nc/clobber/ncformat=4/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! With /NCFORMAT=3 the other stuff is meaningless.  Will see NOTEs
+yes? save/file=nc4_nodeflate3.nc/clobber/ncformat=3/deflate=1/xchunk=30/ychunk=30/tchunk=1 sst
+ 
+! --------------------------
+! Compare choices of chunking.
+can var/all; can mem/all
+ 
+set var/title=deflate_x180_y90 sst
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=180/ychunk=90/tchunk=1 sst
+ 
+ 
+set var/title=undeflated sst
+ 
+save/file=nc4_nodeflate3.nc/clobber/ncformat=3 sst
+ 
+save/file=nc4_deflate4_xyt.nc/clobber/ncformat=4/deflate/shuffle/tchunk=2/xchunk=30/ychunk=20  sst
+save/file=nc4_deflate4_defaultchunk.nc/clobber/ncformat=4/deflate/shuffle sst
+ 
+ 
+! Write variable as INT
+CAN DAT/all; can var/all; can mem/all
+use levitus_climatology
+SET VAR/OUTTYPE=int/BAD=-99999 temp
+save/clobber/ncformat=classic/file=nc4_inttemp_classic.nc temp
+ 
+set list/ncformat=4/deflate=1/xchunk=10/ychunk=10/zchunk=1
+save/clobber/file=nc4_inttemp_set_list_deflate_chunk.nc temp
+ 
+save/clobber/shuffle=1/file=nc4_inttemp_shuffle_set_list_deflate_chunk.nc temp
+ 
+cancel list/all
+set list/ncformat=classic
+save/clobber/file=nc4_inttemp_set_classic.nc temp
+ 
+cancel list/all
+ 
+! Check SHOW LIST, and CANCEL LIST
+ 
+set list/xchunk=30/ychunk=20/tchunk=5/zchunk=1/deflate=1/shuffle=0/ncformat=4
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = NetCDF-4
+        Compression (deflate) level set to 1
+        XCHUNK size set to 30
+        YCHUNK size set to 20
+        ZCHUNK size set to 1
+        TCHUNK size set to 5
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+can list/all
+sh list/all
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! Intentional errors:
+can dat/all
+use coads_climatology
+set mode ignore
+! If set any chunksizes, must set them all
+save/file=nc4_deflate4_t1.nc/clobber/ncformat=4/deflate/shuffle/tchunk=1  sst
+ 
+! Chunk sizes bigger than dim sizes
+save/file=nc4_deflate4bigchunk.nc/clobber/ncformat=4/deflate=1/xchunk=6/ychunk=18/tchunk=15 sst
+can mode ignore
+ 
+*** Running test: bn_scat2grid_bin.jnl
+! bn_scat2grid_bin.jnl
+! Tests of scat2grid_bin and scat2grid_nbin functions.
+ 
+! define some variables (as in bench_gridding)
+ 
+define axis/t=1-jan-2010:30-mar-2010:1/units=days tin
+define axis/t=1-jan-2010:30-mar-2010:10/units=days tout
+let tt = t[gt=tout,L=1:10]
+sh grid tt
+    GRID (G001)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+ 
+define axis/x=0:10:0.05 x10
+define axis/y=0:10:0.05 y10
+define grid/x=x10/y=y10 g10x10
+set grid g10x10
+ 
+let WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+let PHASE = 0
+let KAPPA = 0.4
+let KX = 0.4
+let KY = 0.7
+let FCN1 = SIN(R)/(R+1)
+let R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+let X0 = 3
+let Y0 = 8
+LET sample_function = fcn1 + wave
+set view ul
+let xpts = x; let ypts = y
+SHADE/title="A field with 200 sample points marked" sample_function
+let xpts = 10*randu(i); let ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+define axis/x=1:10:.5 xax5
+define axis/y=1:10:.5 yax5
+define axis/x=1:10:.2 xax2
+define axis/y=1:10:.2 yax2
+set view ll
+let sgrid = scat2grid_bin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="Bin Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472 -0.3515
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....  0.4598
+ 8     / 15:    ....    ....  0.4264
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....  0.5147
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+ 
+set view lr
+let sgrid = scat2grid_bin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="Bin Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+                2       2.2     2.4     2.6     2.8     3     
+                 6       7       8       9      10      11
+ 1     /  1:    ....    ....    ....    ....    ....    ....
+ 1.2   /  2:    ....    ....    ....    ....    ....    ....
+ 1.4   /  3:    ....    ....    ....    ....    ....    ....
+ 1.6   /  4:    ....    ....    ....    ....  0.3250    ....
+ 1.8   /  5:    ....    ....    ....    ....    ....    ....
+ 2     /  6:    ....    ....    ....    ....    ....    ....
+ 2.2   /  7:    ....    ....    ....    ....    ....    ....
+ 2.4   /  8:    ....    ....    ....    ....    ....    ....
+ 2.6   /  9:    ....    ....  0.0915    ....    ....    ....
+ 2.8   / 10:    ....    ....    ....    ....    ....    ....
+ 3     / 11:    ....    ....    .... -0.0921 -0.1235    ....
+ 3.2   / 12:    ....    ....    ....    ....    ....    ....
+ 3.4   / 13:    ....    ....    ....    ....    ....    ....
+ 3.6   / 14:    ....    ....    ....    ....    ....    ....
+ 3.8   / 15:    ....    ....    ....    ....    ....    ....
+ 4     / 16:    ....    ....    ....    ....    ....    ....
+ 4.2   / 17: -0.1083    ....    ....    ....    ....    ....
+ 4.4   / 18:    ....    ....    ....    ....    ....    ....
+ 4.6   / 19:    ....    ....    ....    .... -0.1934    ....
+ 4.8   / 20:    ....    .... -0.2127    .... -0.2336    ....
+ 5     / 21:    .... -0.2851    ....    ....    ....    ....
+ 5.2   / 22:    ....    ....    ....    ....    ....    ....
+ 5.4   / 23:    ....    ....    ....    ....    ....    ....
+ 5.6   / 24: -0.4552    ....    ....    .... -0.4259    ....
+ 5.8   / 25:    .... -0.4810    ....    ....    ....    ....
+ 6     / 26:    ....    ....    ....    ....    ....    ....
+ 6.2   / 27:    ....    .... -0.4134    ....    ....    ....
+ 6.4   / 28:    ....    ....    ....    .... -0.3158    ....
+ 6.6   / 29: -0.2793    ....    ....    ....    ....    ....
+ 6.8   / 30:    ....    ....    ....    ....    ....    ....
+ 7     / 31:    ....    ....    ....    ....    ....    ....
+ 7.2   / 32:    ....    ....    ....    ....    ....    ....
+ 7.4   / 33:    ....    ....    ....    ....    ....    ....
+ 7.6   / 34:    ....    ....    ....    ....    ....    ....
+ 7.8   / 35:    ....    ....    ....    ....    ....  0.4264
+ 8     / 36:    ....    ....    ....    ....    ....    ....
+ 8.2   / 37:    ....    ....    ....    ....    ....    ....
+ 8.4   / 38:    ....    ....    ....    ....  0.6377    ....
+ 8.6   / 39:    ....    ....    ....    ....    ....    ....
+ 8.8   / 40:  0.4703    ....    ....    ....    ....    ....
+ 9     / 41:    ....  0.4883    ....    ....    ....    ....
+ 9.2   / 42:    ....    ....    ....    ....    ....    ....
+ 9.4   / 43:    ....    ....    ....    ....  0.3475    ....
+ 9.6   / 44:    ....    ....    ....    ....  0.2364    ....
+ 9.8   / 45:    ....    ....    ....    ....    ....    ....
+ 10    / 46:    ....    ....    ....    ....    ....    ....
+ 
+! Now the NBIN functios
+ 
+let sgrid = scat2grid_nbin_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5])
+SHADE/TITLE="NBIN Gridding (5,5) to 20x20 grid" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY (XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5])
+             SUBSET   : 3 by 19 points (X-Y)
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  1.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  2.000
+ 8     / 15:  0.000  0.000  1.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  1.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+set view lr
+let sgrid = scat2grid_nbin_xy(xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2])
+SHADE/TITLE="NBIN Gridding (1,1) to 100x100" sgrid
+list/x=2:3 sgrid
+             VARIABLE : SCAT2GRID_NBIN_XY(XPTS, YPTS, SAMPLE_FUNCTION, X[GX=XAX2], Y[GY=YAX2])
+             SUBSET   : 6 by 46 points (X-Y)
+               2      2.2    2.4    2.6    2.8    3     
+                6      7      8      9     10     11
+ 1     /  1:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.2   /  2:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.4   /  3:  0.000  0.000  0.000  0.000  0.000  0.000
+ 1.6   /  4:  0.000  0.000  0.000  0.000  1.000  0.000
+ 1.8   /  5:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2     /  6:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.2   /  7:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.4   /  8:  0.000  0.000  0.000  0.000  0.000  0.000
+ 2.6   /  9:  0.000  0.000  1.000  0.000  0.000  0.000
+ 2.8   / 10:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3     / 11:  0.000  0.000  0.000  1.000  1.000  0.000
+ 3.2   / 12:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.4   / 13:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.6   / 14:  0.000  0.000  0.000  0.000  0.000  0.000
+ 3.8   / 15:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4     / 16:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.2   / 17:  1.000  0.000  0.000  0.000  0.000  0.000
+ 4.4   / 18:  0.000  0.000  0.000  0.000  0.000  0.000
+ 4.6   / 19:  0.000  0.000  0.000  0.000  1.000  0.000
+ 4.8   / 20:  0.000  0.000  1.000  0.000  1.000  0.000
+ 5     / 21:  0.000  1.000  0.000  0.000  0.000  0.000
+ 5.2   / 22:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.4   / 23:  0.000  0.000  0.000  0.000  0.000  0.000
+ 5.6   / 24:  1.000  0.000  0.000  0.000  1.000  0.000
+ 5.8   / 25:  0.000  1.000  0.000  0.000  0.000  0.000
+ 6     / 26:  0.000  0.000  0.000  0.000  0.000  0.000
+ 6.2   / 27:  0.000  0.000  1.000  0.000  0.000  0.000
+ 6.4   / 28:  0.000  0.000  0.000  0.000  1.000  0.000
+ 6.6   / 29:  1.000  0.000  0.000  0.000  0.000  0.000
+ 6.8   / 30:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7     / 31:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.2   / 32:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.4   / 33:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.6   / 34:  0.000  0.000  0.000  0.000  0.000  0.000
+ 7.8   / 35:  0.000  0.000  0.000  0.000  0.000  1.000
+ 8     / 36:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.2   / 37:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.4   / 38:  0.000  0.000  0.000  0.000  1.000  0.000
+ 8.6   / 39:  0.000  0.000  0.000  0.000  0.000  0.000
+ 8.8   / 40:  1.000  0.000  0.000  0.000  0.000  0.000
+ 9     / 41:  0.000  1.000  0.000  0.000  0.000  0.000
+ 9.2   / 42:  0.000  0.000  0.000  0.000  0.000  0.000
+ 9.4   / 43:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.6   / 44:  0.000  0.000  0.000  0.000  1.000  0.000
+ 9.8   / 45:  0.000  0.000  0.000  0.000  0.000  0.000
+ 10    / 46:  0.000  0.000  0.000  0.000  0.000  0.000
+ 
+ 
+! Now the XYT functions
+ 
+let tpts = 39798 + 87*RANDU(I)
+show grid tt
+    GRID (G004)
+ name       axis              # pts   start                end
+ X10       X                  201 r   0                    10
+ Y10       Y                  201 r   0                    10
+ normal    Z
+ TOUT      TIME                10 r   01-JAN-2010 00:00    01-APR-2010 00:00
+ normal    E
+ normal    F
+ 
+let sgrid = scat2grid_bin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/clobber sgrid
+ 
+ 
+let ngrid = scat2grid_nbin_xyt (xpts, ypts, tpts, sample_function, x[gx=xax5], y[gy=yax5], tt)
+SAVE/FILE=a.nc/append ngrid
+ 
+can var/all
+use a.nc
+stat sgrid
+ 
+             SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.8 to 10.3
+             Y: 0.8 to 10.3
+             Z:  N/A
+             TIME: 27-DEC-2009 00:00 to 06-APR-2010 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 3464
+ Minimum value: -0.48583
+ Maximum value: 0.63765
+ Mean    value: 0.014003 (unweighted average)
+ Standard deviation: 0.28222
+stat ngrid
+ 
+             SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             X: 0.8 to 10.3
+             Y: 0.8 to 10.3
+             Z:  N/A
+             TIME: 27-DEC-2009 00:00 to 06-APR-2010 00:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./a.nc
+ 
+ Total # of data points: 3610 (19*19*1*10*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 3
+ Mean    value: 0.047645 (unweighted average)
+ Standard deviation: 0.24679
+list/x=2:3/L=3 sgrid
+             VARIABLE : SCAT2GRID_BIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : 21-JAN-2010 00:00
+                2       2.5     3     
+                 3       4       5
+ 1     /  1:    ....    ....    ....
+ 1.5   /  2:    ....  0.3250    ....
+ 2     /  3:  0.3365    ....    ....
+ 2.5   /  4:    ....  0.0915    ....
+ 3     /  5:    .... -0.0921 -0.1235
+ 3.5   /  6:    ....    ....    ....
+ 4     /  7:    ....    ....    ....
+ 4.5   /  8: -0.1083    .... -0.1934
+ 5     /  9: -0.2851 -0.2127 -0.2336
+ 5.5   / 10: -0.4247    .... -0.4259
+ 6     / 11: -0.4858 -0.4472    ....
+ 6.5   / 12: -0.2793    .... -0.3158
+ 7     / 13: -0.1265    ....    ....
+ 7.5   / 14:    ....    ....    ....
+ 8     / 15:    ....    ....    ....
+ 8.5   / 16:    ....    ....  0.6377
+ 9     / 17:  0.4793    ....    ....
+ 9.5   / 18:    ....  0.2919    ....
+ 10    / 19:    ....    ....    ....
+list/x=2:3/L=3 ngrid
+             VARIABLE : SCAT2GRID_NBIN_XYT (XPTS, YPTS, TPTS, SAMPLE_FUNCTION, X[GX=XAX5], Y[GY=YAX5], TT)
+             FILENAME : a.nc
+             SUBSET   : 3 by 19 points (X-Y)
+             TIME     : 21-JAN-2010 00:00
+               2      2.5    3     
+                3      4      5
+ 1     /  1:  0.000  0.000  0.000
+ 1.5   /  2:  0.000  1.000  0.000
+ 2     /  3:  2.000  0.000  0.000
+ 2.5   /  4:  0.000  1.000  0.000
+ 3     /  5:  0.000  1.000  1.000
+ 3.5   /  6:  0.000  0.000  0.000
+ 4     /  7:  0.000  0.000  0.000
+ 4.5   /  8:  1.000  0.000  1.000
+ 5     /  9:  1.000  1.000  1.000
+ 5.5   / 10:  2.000  0.000  1.000
+ 6     / 11:  1.000  2.000  0.000
+ 6.5   / 12:  1.000  0.000  1.000
+ 7     / 13:  1.000  0.000  0.000
+ 7.5   / 14:  0.000  0.000  0.000
+ 8     / 15:  0.000  0.000  0.000
+ 8.5   / 16:  0.000  0.000  1.000
+ 9     / 17:  2.000  0.000  0.000
+ 9.5   / 18:  0.000  2.000  0.000
+ 10    / 19:  0.000  0.000  0.000
+ 
+can mem /all
+can var /all
+can data /all
+set grid abstract
+can grid g10x10
+ 
+can axis yax2
+can axis xax2
+can axis yax5
+can axis xax5
+can axis y10
+can axis x10
+can axis tout
+can axis tin
+ 
+*** Running test: bn_axis_dir_symbols.jnl
+! bn_axis_dir_symbols.jnl
+! 5/2010
+!
+! For LAS:
+! SYMBOL AX_HORIZ and AX_VERT identify the direction of
+! the plot axes (x, y, z, or t).  Add this for 1D plots
+! as well as 2D ones.
+ 
+plot/i=1:10 i; show sym ax*; can sym ax*
+AX_HORIZ = "X"
+plot/j=1:10 j; show sym ax*; can sym ax*
+AX_HORIZ = "Y"
+ 
+use gt4d011
+plot/i=100/j=40/L=1 temp; show sym ax*; can sym ax*
+AX_VERT = "Z"
+ 
+use coads_climatology
+plot/x=180/y=0 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+plot/x=180/y=0/trans sst; show sym ax*; can sym ax*
+AX_VERT = "T"
+shade/x=180 sst; show sym ax*; can sym ax*
+AX_HORIZ = "T"
+AX_VERT = "Y"
+*** Running test: bn663_bug_fixes.jnl
+! bn663_bug_fixes.jnl
+! Fixes that go into v6.63 release
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_dots_in_dashes.jnl
+! err65_dots_in_dashes.jnl
+! Test fix to bug 1396: dots where there should
+! be gaps in dashed lines.
+! Same test has been added for -gif mode and
+! metafile batch mode
+ 
+can view
+set mode metafile dashbug.plt
+set v ul; plot/dash x[gx=0:20:.5]
+set v ur; plot/dash x[gx=0:20:.1]
+set v ll; plot/dash x[gx=0:20:.05]
+set v lr; plot/dash x[gx=0:20:.01]
+frame/file=dashbug.gif
+ 
+cancel mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err66_all_missing_lev_v.jnl
+! err66_all_missing_lev_v.jnl
+! Ferret hangs with /LEV=V and all missing data
+ 
+USE coads_climatology
+SHADE/L=1/X=60:70/Y=40:50/LEV=v sst
+ 
+FILL/L=2/X=60:70/Y=40:50/LEV=v sst
+*** Running test: bn_set_axis_regular.jnl
+! bn_set_axis_regular.jnl
+! Karl Smith, 5/2010
+! tests for SET AXIS /REGULAR
+ 
+! --- create irregular but monotonic data with integer endpoints
+set region /i=1:10 /j=1:10
+let deltax = if (i gt 1 and i lt 10) then 0.5 * sin((x - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let xdata = x + deltax
+let deltay = if (j gt 1 and j lt 10) then 0.5 * sin((y - 1.0) * 3.14159265 / 2.33333333) else 0.0
+let ydata = y - deltay
+ 
+! --- define axes and grid from this data
+define axis /x /from_data /name=myx xdata
+define axis /y /from_data /name=myy ydata
+define grid /x=myx /y=myy mygrid
+set grid mygrid
+ 
+! --- define a variable using this grid; show everything is irregular
+let myvar = 2 * x + y
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.3 to 10.7
+ 1.00000
+ 2.48746
+ 3.21694
+ 3.60908
+ 4.60908
+ 6.21694
+ 7.48746
+ 8.00000
+ 8.51254
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- setting a regular axis as regular does nothing
+set axis /regular myx
+list /format=(F8.5) x
+             VARIABLE : X
+                        axis MYX
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (X)
+             X        : 0.5 to 10.5
+ 1.00000
+ 2.00000
+ 3.00000
+ 4.00000
+ 5.00000
+ 6.00000
+ 7.00000
+ 8.00000
+ 9.00000
+10.00000
+list /format=(F8.5) y
+             VARIABLE : Y
+                        axis MYY
+             BAD FLAG : -1.E+34       
+             SUBSET   : 10 points (Y)
+             Y        : 0.7 to 10.3
+ 1.00000
+ 1.51254
+ 2.78306
+ 4.39092
+ 5.39092
+ 5.78306
+ 6.51254
+ 8.00000
+ 9.48746
+10.00000
+list myvar
+             VARIABLE : 2 * X + Y
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is MYGRID
+ Last successful data access was on grid MYGRID
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYX       X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- clean up
+go bn_reset
+cancel mode verify
+cancel grid mygrid
+ 
+! --- read a NetCDF file with the irregular axes and data
+use bn_set_axis_regular
+show data
+     currently SET data sets:
+    1> ./bn_set_axis_regular.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MYDATA   2 * X + Y                        1:10      1:10      ...       ...       ...       ...
+ 
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+               1      2.49   3.22   3.61   4.61   6.22   7.49   8      8.51   10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 i   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! --- force the x axis to be regular
+set axis /regular `..dimnames[i=1]`
+ !-> set axis /regular MYX1
+list mydata
+             VARIABLE : 2 * X + Y
+             FILENAME : bn_set_axis_regular.nc
+             SUBSET   : 10 by 10 points (X-Y)
+                1      2      3      4      5      6      7      8      9     10    
+                1      2      3      4      5      6      7      8      9     10
+ 1     /  1:   3.00   5.97   7.43   8.22  10.22  13.43  15.97  17.00  18.03  21.00
+ 1.51  /  2:   3.51   6.49   7.95   8.73  10.73  13.95  16.49  17.51  18.54  21.51
+ 2.78  /  3:   4.78   7.76   9.22  10.00  12.00  15.22  17.76  18.78  19.81  22.78
+ 4.39  /  4:   6.39   9.37  10.82  11.61  13.61  16.82  19.37  20.39  21.42  24.39
+ 5.39  /  5:   7.39  10.37  11.82  12.61  14.61  17.82  20.37  21.39  22.42  25.39
+ 5.78  /  6:   7.78  10.76  12.22  13.00  15.00  18.22  20.76  21.78  22.81  25.78
+ 6.51  /  7:   8.51  11.49  12.95  13.73  15.73  18.95  21.49  22.51  23.54  26.51
+ 8     /  8:  10.00  12.97  14.43  15.22  17.22  20.43  22.97  24.00  25.03  28.00
+ 9.49  /  9:  11.49  14.46  15.92  16.71  18.71  21.92  24.46  25.49  26.51  29.49
+ 10    / 10:  12.00  14.97  16.43  17.22  19.22  22.43  24.97  26.00  27.03  30.00
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GOZ1
+    GRID GOZ1
+ name       axis              # pts   start                end
+ MYX1      X                   10 r   1                    10
+ MYY       Y                   10 i   1                    10
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+*** Running test: bn_set_cancel_redirect.jnl
+! bn_set_cancel_redirect.jnl
+! Karl Smith, 5/2010
+! test for SET REDIRECT and CANCEL REDIRECT
+ 
+! --- 1. redirect/tee both stdout and stderr to a file
+set redirect /tee /file="redirect.txt" /clobber stdout stderr
+ 
+! --- 2. produce some output to both stdout and stderr
+define axis /x=0:6:0.5 myaxis
+set axis myaxis
+define grid /x=myaxis mygrid
+set grid mygrid
+let wave=sin(x)
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 3. cancel the stderr redirect and produce output
+cancel redirect stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 4. cancel all redirection and produce some output
+cancel redirect
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 5. show the contents of the redirect file
+! ---    should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 39 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+cancel var contents
+ 
+! --- 6. redirect/tee both stdout and stderr, appending to the redirect file
+set redirect /tee /file="redirect.txt" /append stdout stderr
+ 
+! --- 7. produce output to both stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 8. cancel the stdout redirect and produce output
+cancel redirect stdout
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 9. cancel all redirection and produce some output
+cancel redirect stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 10. results of CANCEL REDIRECT when nothing is redirected
+cancel redirect
+ 
+! --- 11. show the updated contents of the redirect file
+! ---     should be all contents of 2., stdout of 3. and nothing but the cancel from 4.
+! ---     plus all contents of 7. and stderr of 8.
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 69 points (X)
+ 1    /  1:" "                                                                         
+ 2    /  2:"! --- 2. produce some output to both stdout and stderr"                    
+ 3    /  3:"define axis /x=0:6:0.5 myaxis"                                             
+ 4    /  4:"set axis myaxis"                                                           
+ 5    /  5:"define grid /x=myaxis mygrid"                                              
+ 6    /  6:"set grid mygrid"                                                           
+ 7    /  7:"let wave=sin(x)"                                                           
+ 8    /  8:"list wave"                                                                 
+ 9    /  9:"             VARIABLE : SIN(X)"                                            
+ 10   / 10:"             SUBSET   : 13 points (X)"                                     
+ 11   / 11:" 0    /  1:  0.0000"                                                       
+ 12   / 12:" 0.5  /  2:  0.4794"                                                       
+ 13   / 13:" 1    /  3:  0.8415"                                                       
+ 14   / 14:" 1.5  /  4:  0.9975"                                                       
+ 15   / 15:" 2    /  5:  0.9093"                                                       
+ 16   / 16:" 2.5  /  6:  0.5985"                                                       
+ 17   / 17:" 3    /  7:  0.1411"                                                       
+ 18   / 18:" 3.5  /  8: -0.3508"                                                       
+ 19   / 19:" 4    /  9: -0.7568"                                                       
+ 20   / 20:" 4.5  / 10: -0.9775"                                                       
+ 21   / 21:" 5    / 11: -0.9589"                                                       
+ 22   / 22:" 5.5  / 12: -0.7055"                                                       
+ 23   / 23:" 6    / 13: -0.2794"                                                       
+ 24   / 24:"go /help"                                                                  
+ 25   / 25:" Use the GO command to name a file of FERRET commands to be executed."     
+ 26   / 26:"     e.g.   yes? GO filename"                                              
+ 27   / 27:" "                                                                         
+ 28   / 28:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 29   / 29:" "                                                                         
+ 30   / 30:"! --- 3. cancel the stderr redirect and produce output"                    
+ 31   / 31:"cancel redirect stderr"                                                    
+ 32   / 32:"show axis myaxis"                                                          
+ 33   / 33:" name       axis              # pts   start                end"            
+ 34   / 34:" MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"   Axis span (to cell edges) = 6.5"                                        
+ 36   / 36:"go /help"                                                                  
+ 37   / 37:" "                                                                         
+ 38   / 38:"! --- 4. cancel all redirection and produce some output"                   
+ 39   / 39:"cancel redirect"                                                           
+ 40   / 40:" "                                                                         
+ 41   / 41:"! --- 7. produce output to both stdout and stderr"                         
+ 42   / 42:"list wave"                                                                 
+ 43   / 43:"             VARIABLE : SIN(X)"                                            
+ 44   / 44:"             SUBSET   : 13 points (X)"                                     
+ 45   / 45:" 0    /  1:  0.0000"                                                       
+ 46   / 46:" 0.5  /  2:  0.4794"                                                       
+ 47   / 47:" 1    /  3:  0.8415"                                                       
+ 48   / 48:" 1.5  /  4:  0.9975"                                                       
+ 49   / 49:" 2    /  5:  0.9093"                                                       
+ 50   / 50:" 2.5  /  6:  0.5985"                                                       
+ 51   / 51:" 3    /  7:  0.1411"                                                       
+ 52   / 52:" 3.5  /  8: -0.3508"                                                       
+ 53   / 53:" 4    /  9: -0.7568"                                                       
+ 54   / 54:" 4.5  / 10: -0.9775"                                                       
+ 55   / 55:" 5    / 11: -0.9589"                                                       
+ 56   / 56:" 5.5  / 12: -0.7055"                                                       
+ 57   / 57:" 6    / 13: -0.2794"                                                       
+ 58   / 58:"go /help"                                                                  
+ 59   / 59:" Use the GO command to name a file of FERRET commands to be executed."     
+ 60   / 60:"     e.g.   yes? GO filename"                                              
+ 61   / 61:" "                                                                         
+ 62   / 62:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 63   / 63:" "                                                                         
+ 64   / 64:"! --- 8. cancel the stdout redirect and produce output"                    
+ 65   / 65:"cancel redirect stdout"                                                    
+ 66   / 66:" Use the GO command to name a file of FERRET commands to be executed."     
+ 67   / 67:"     e.g.   yes? GO filename"                                              
+ 68   / 68:" "                                                                         
+ 69   / 69:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 12. redirect only stdout to a file and produce some output to show stdout redirected, stderr normal
+! ---     warning: can get confusing - look ahead for file contents
+! ---     immediately following redirect line should be stderr of 12 and contents of 13,
+! ---     which shows file contents of stdout of 12 and cancel redirect of 13
+set redirect /file="redirect.txt" /clobber stdout
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 21 points (X)
+ 1    /  1:"list wave"                                                           
+ 2    /  2:"             VARIABLE : SIN(X)"                                      
+ 3    /  3:"             SUBSET   : 13 points (X)"                               
+ 4    /  4:" 0    /  1:  0.0000"                                                 
+ 5    /  5:" 0.5  /  2:  0.4794"                                                 
+ 6    /  6:" 1    /  3:  0.8415"                                                 
+ 7    /  7:" 1.5  /  4:  0.9975"                                                 
+ 8    /  8:" 2    /  5:  0.9093"                                                 
+ 9    /  9:" 2.5  /  6:  0.5985"                                                 
+ 10   / 10:" 3    /  7:  0.1411"                                                 
+ 11   / 11:" 3.5  /  8: -0.3508"                                                 
+ 12   / 12:" 4    /  9: -0.7568"                                                 
+ 13   / 13:" 4.5  / 10: -0.9775"                                                 
+ 14   / 14:" 5    / 11: -0.9589"                                                 
+ 15   / 15:" 5.5  / 12: -0.7055"                                                 
+ 16   / 16:" 6    / 13: -0.2794"                                                 
+ 17   / 17:"go /help"                                                            
+ 18   / 18:" "                                                                   
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                     
+ 21   / 21:"cancel redirect stdout"                                              
+cancel var contents
+ 
+! --- 14. redirect only stderr, appending to a file and produce some output to show stdout normal, stderr redirected
+set redirect /file="redirect.txt" /append stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 15. cancel the redirection and show the redirect file contents
+! ---     should be the stdout of 12, cancel redirect of 13, and stderr of 14
+cancel redirect stderr
+let contents = { spawn:"cat redirect.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect.txt" }
+             SUBSET   : 25 points (X)
+ 1    /  1:"list wave"                                                                 
+ 2    /  2:"             VARIABLE : SIN(X)"                                            
+ 3    /  3:"             SUBSET   : 13 points (X)"                                     
+ 4    /  4:" 0    /  1:  0.0000"                                                       
+ 5    /  5:" 0.5  /  2:  0.4794"                                                       
+ 6    /  6:" 1    /  3:  0.8415"                                                       
+ 7    /  7:" 1.5  /  4:  0.9975"                                                       
+ 8    /  8:" 2    /  5:  0.9093"                                                       
+ 9    /  9:" 2.5  /  6:  0.5985"                                                       
+ 10   / 10:" 3    /  7:  0.1411"                                                       
+ 11   / 11:" 3.5  /  8: -0.3508"                                                       
+ 12   / 12:" 4    /  9: -0.7568"                                                       
+ 13   / 13:" 4.5  / 10: -0.9775"                                                       
+ 14   / 14:" 5    / 11: -0.9589"                                                       
+ 15   / 15:" 5.5  / 12: -0.7055"                                                       
+ 16   / 16:" 6    / 13: -0.2794"                                                       
+ 17   / 17:"go /help"                                                                  
+ 18   / 18:" "                                                                         
+ 19   / 19:"! --- 13. cancel the redirection and show the redirect file contents"      
+ 20   / 20:"! ---     should be the "missing" stdout of 12."                           
+ 21   / 21:"cancel redirect stdout"                                                    
+ 22   / 22:" Use the GO command to name a file of FERRET commands to be executed."     
+ 23   / 23:"     e.g.   yes? GO filename"                                              
+ 24   / 24:" "                                                                         
+ 25   / 25:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+cancel var contents
+ 
+! --- 16. redirect/tee stdout to one file and stderr to another file
+set redirect /tee /file="redirect_stdout.txt" /clobber stdout
+set redirect /tee /file="redirect_stderr.txt" /clobber stderr
+ 
+! --- 17. produce some output
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 18. see what happens to messages (say, warn, error)
+say "   This is a say message"
+   This is a say message
+set axis /regular myaxis
+set mode ignore_error
+show grid garbage
+cancel mode ignore_error
+ 
+! --- 19. cancel redirections and show the contents of the files
+cancel redirect
+let contents = { spawn:"cat redirect_stdout.txt" }
+! ---     should be the stdout of 17, whatever stdout of 18, and cancel redirect from 19
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stdout.txt" }
+             SUBSET   : 24 points (X)
+ 1    /  1:"set redirect /tee /file="redirect_stderr.txt" /clobber stderr"   
+ 2    /  2:" "                                                               
+ 3    /  3:"! --- 17. produce some output"                                   
+ 4    /  4:"show grid mygrid"                                                
+ 5    /  5:"    GRID MYGRID"                                                 
+ 6    /  6:" name       axis              # pts   start                end"  
+ 7    /  7:" MYAXIS    X                   13 r   0                    6"    
+ 8    /  8:" normal    Y"                                                    
+ 9    /  9:" normal    Z"                                                    
+ 10   / 10:" normal    T"                                                    
+ 11   / 11:" normal    E"                                                    
+ 12   / 12:" normal    F"                                                    
+ 13   / 13:"go /help"                                                        
+ 14   / 14:" "                                                               
+ 15   / 15:"! --- 18. see what happens to messages (say, warn, error)"       
+ 16   / 16:"say "   This is a say message""                                  
+ 17   / 17:"   This is a say message"                                        
+ 18   / 18:"set axis /regular myaxis"                                        
+ 19   / 19:"set mode ignore_error"                                           
+ 20   / 20:"show grid garbage"                                               
+ 21   / 21:"cancel mode ignore_error"                                        
+ 22   / 22:" "                                                               
+ 23   / 23:"! --- 19. cancel redirections and show the contents of the files"
+ 24   / 24:"cancel redirect"                                                 
+cancel var contents
+let contents = { spawn:"cat redirect_stderr.txt" }
+! ---     should be the stderr of 17.
+list contents
+             VARIABLE : { SPAWN:"cat redirect_stderr.txt" }
+             SUBSET   : 7 points (X)
+ 1   / 1:" Use the GO command to name a file of FERRET commands to be executed."     
+ 2   / 2:"     e.g.   yes? GO filename"                                              
+ 3   / 3:" "                                                                         
+ 4   / 4:" Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 5   / 5:" *** NOTE: Axis is already regular: MYAXIS"                                
+ 6   / 6:" **ERROR: variable unknown or not in data set: GARBAGE"                    
+ 7   / 7:"show grid garbage"                                                         
+cancel var contents
+ 
+! --- 20. turn on journal mode to a special filename
+set mode journal:redirect_journal.txt
+ 
+! --- 21. turn on redirection to the journal with default source (stdout)
+set redirect /tee /journal
+ 
+! --- 22. produce some output to stdout and stderr
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 23. cancel journal redirect and produce some output
+! ---     should warn that stderr not redirected
+cancel redirect stdout stderr
+show axis myaxis
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+   Axis span (to cell edges) = 6.5
+go /help
+ 
+! --- 24. redirect/tee both stdout and stderr to the journal
+set redirect /tee /journal stderr stdout
+ 
+! --- 25. produce some output to stdout and stderr
+show grid mygrid
+    GRID MYGRID
+ name       axis              # pts   start                end
+ MYAXIS    X                   13 r   0                    6
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+go /help
+ 
+! --- 26. turn off journal mode
+set mode journal:ferret.jnl
+cancel mode journal
+ 
+! --- 27. produce some output to show journal redirect with no journal is not a problem
+list wave
+             VARIABLE : SIN(X)
+             SUBSET   : 13 points (X)
+ 0    /  1:  0.0000
+ 0.5  /  2:  0.4794
+ 1    /  3:  0.8415
+ 1.5  /  4:  0.9975
+ 2    /  5:  0.9093
+ 2.5  /  6:  0.5985
+ 3    /  7:  0.1411
+ 3.5  /  8: -0.3508
+ 4    /  9: -0.7568
+ 4.5  / 10: -0.9775
+ 5    / 11: -0.9589
+ 5.5  / 12: -0.7055
+ 6    / 13: -0.2794
+go /help
+ 
+! --- 28. cancel journal redirect and show contents of the journal file
+! ---     all redirected output should be commented, and should be the stdout of 22.,
+! ---     cancel redirect of 23., all contents of 25, and set mode journal of 26
+cancel redirect
+let contents = { spawn:"cat redirect_journal.txt" }
+list contents
+             VARIABLE : { SPAWN:"cat redirect_journal.txt" }
+             SUBSET   : 47 points (X)
+ 1    /  1:" ! NOAA/PMEL TMAP"                                                          
+ 2    /  2:" ! FERRET v6.9 (PyFerret 1.0.2)"                                            
+ 3    /  3:" ! Linux 2.6.18-371.4.1.el5 - 03/31/14"                                     
+ 4    /  4:" ! 31-Mar-14 17:29     "                                                    
+ 5    /  5:""                                                                           
+ 6    /  6:"! "                                                                         
+ 7    /  7:"!! --- 22. produce some output to stdout and stderr"                        
+ 8    /  8:"!list wave"                                                                 
+ 9    /  9:"!             VARIABLE : SIN(X)"                                            
+ 10   / 10:"!             SUBSET   : 13 points (X)"                                     
+ 11   / 11:"! 0    /  1:  0.0000"                                                       
+ 12   / 12:"! 0.5  /  2:  0.4794"                                                       
+ 13   / 13:"! 1    /  3:  0.8415"                                                       
+ 14   / 14:"! 1.5  /  4:  0.9975"                                                       
+ 15   / 15:"! 2    /  5:  0.9093"                                                       
+ 16   / 16:"! 2.5  /  6:  0.5985"                                                       
+ 17   / 17:"! 3    /  7:  0.1411"                                                       
+ 18   / 18:"! 3.5  /  8: -0.3508"                                                       
+ 19   / 19:"! 4    /  9: -0.7568"                                                       
+ 20   / 20:"! 4.5  / 10: -0.9775"                                                       
+ 21   / 21:"! 5    / 11: -0.9589"                                                       
+ 22   / 22:"! 5.5  / 12: -0.7055"                                                       
+ 23   / 23:"! 6    / 13: -0.2794"                                                       
+ 24   / 24:"!go /help"                                                                  
+ 25   / 25:"! "                                                                         
+ 26   / 26:"!! --- 23. cancel journal redirect and produce some output"                 
+ 27   / 27:"!! ---     should warn that stderr not redirected"                          
+ 28   / 28:"!cancel redirect stdout stderr"                                             
+ 29   / 29:"! "                                                                         
+ 30   / 30:"!! --- 25. produce some output to stdout and stderr"                        
+ 31   / 31:"!show grid mygrid"                                                          
+ 32   / 32:"!    GRID MYGRID"                                                           
+ 33   / 33:"! name       axis              # pts   start                end"            
+ 34   / 34:"! MYAXIS    X                   13 r   0                    6"              
+ 35   / 35:"! normal    Y"                                                              
+ 36   / 36:"! normal    Z"                                                              
+ 37   / 37:"! normal    T"                                                              
+ 38   / 38:"! normal    E"                                                              
+ 39   / 39:"! normal    F"                                                              
+ 40   / 40:"!go /help"                                                                  
+ 41   / 41:"! Use the GO command to name a file of FERRET commands to be executed."     
+ 42   / 42:"!     e.g.   yes? GO filename"                                              
+ 43   / 43:"! "                                                                         
+ 44   / 44:"! Use "GO/HELP filename" to read documentation in  the file to be executed."
+ 45   / 45:"! "                                                                         
+ 46   / 46:"!! --- 26. turn off journal mode"                                           
+ 47   / 47:"!set mode journal:ferret.jnl"                                               
+cancel var contents
+ 
+! --- clean-up: get rid of mygrid
+set grid abstract
+cancel grid mygrid
+ 
+!!! NOTE: journal mode is now turned off !!!
+*** Running test: bn_min_max_smoothers.jnl
+! bn_min_max_smoothers.jnl
+! New transforms @SMN and @SMX, smoothers based on the
+! min and max of the data in the window.
+sh trans
+variable transforms e.g.SST[T=1-jan:15-mar at DDC]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @ITP        interpolated                 @SPZ        Parzen smoothed
+   @AVE        averaged                     @FAV        ave-filled
+   @VAR        variance                     @FLN        linear-filled
+   @SUM        summed                       @FNR        nearest-filled
+   @RSU        running sum                  @NGD        number of valid
+   @SHF        shifted                      @NBD        number flagged bad
+   @MIN        minimum                      @LOC        location
+   @MAX        maximum                      @WEQ        weighted equal
+   @DDC        centered derivative          @CDA        closest dist above
+   @DDF        forward derivative           @CDB        closest dist below
+   @DDB        backwards derivative         @CIA        closest index above
+   @DIN        integrated                   @CIB        closest index below
+   @IIN        indef. integ.                @EVN        event mask
+   @SBX        box smoothed                 @MED        median smoothed
+   @SBN        binomial smoothed            @SMX        maximum smoothed
+   @SWL        Welch smoothed               @SMN        minimum smoothed
+   @SHN        Hanning smoothed             @STD        standard deviation
+ 
+regridding transforms e.g.SST[GX=x5deg at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @MOD        modulo ave
+   @AVE        box avgd                     @MODVAR     modulo var
+   @XACT       exact match                  @MODNGD     # gd mod pts
+   @ASN        index assn                   @MODNBD     #bad mod pts
+   @VAR        variance                     @MODSUM     modulo sum
+   @MIN        minimum                      @MODMIN     modulo min
+   @MAX        maximum                      @MODMAX     modulo max
+   @SUM        sum                          @NRST       nearst coord
+   @NGD        # gd pts
+ 
+auxiliary varible regridding transforms e.g.TEMP[GZ(depth)=zax at AVE]
+   code        description                  code        description
+   ----        -----------                  ----        -----------
+   @LIN        lin. interp.                 @PLAVE      pc-wise linear ave
+use gt4d011
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+ 
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+plot/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+ 
+plot/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+plot/k=1/l=1/x=123.5w temp, temp[j=@med], temp[j=@smx], temp[j=@smn]
+plot/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+ 
+! Numeric results
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med], temp[L=@smx], temp[L=@smn]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+ 
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:3], temp[L=@smx:3], temp[L=@smn:3]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on T)
+ Column  3: TEMP[T=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on T)
+ Column  4: TEMP[T=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.23  27.15
+23-AUG-1982 14 /  2:  27.23  27.23  27.36  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.54  27.23
+04-SEP-1982 18 /  4:  27.54  27.54  27.79  27.36
+10-SEP-1982 20 /  5:  27.79  27.79  28.09  27.54
+16-SEP-1982 22 /  6:  28.09  28.09  28.33  27.79
+23-SEP-1982 00 /  7:  28.33  28.33  28.47  28.09
+29-SEP-1982 02 /  8:  28.47  28.47  28.61  28.33
+05-OCT-1982 04 /  9:  28.61  28.61  28.91  28.47
+11-OCT-1982 06 / 10:  28.91  28.91  29.34  28.61
+17-OCT-1982 08 / 11:  29.34  29.34  29.76  28.91
+23-OCT-1982 10 / 12:  29.76  29.76  30.20  29.34
+29-OCT-1982 12 / 13:  30.20  30.20  30.75  29.76
+04-NOV-1982 14 / 14:  30.75  30.75  31.42  30.20
+10-NOV-1982 16 / 15:  31.42  31.42  31.84  30.75
+16-NOV-1982 18 / 16:  31.84  31.84  31.98  31.42
+22-NOV-1982 20 / 17:  31.98  31.98  32.13  31.84
+28-NOV-1982 22 / 18:  32.13  32.13  32.41  31.98
+05-DEC-1982 00 / 19:  32.41  32.41  32.73  32.13
+11-DEC-1982 02 / 20:  32.73  32.73  32.94  32.41
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.73
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.94
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.81
+04-JAN-1983 10 / 24:  32.81  32.81  32.94  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.81  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:5], temp[L=@smn:5]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:5] is TEMPERATURE (deg. C)(maximum smoothed by 5 pts on T)
+ Column  4: TEMP[T=@SMN:5] is TEMPERATURE (deg. C)(minimum smoothed by 5 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.36  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.54  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  27.79  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.09  27.23
+10-SEP-1982 20 /  5:  27.79  27.79  28.33  27.36
+16-SEP-1982 22 /  6:  28.09  28.09  28.47  27.54
+23-SEP-1982 00 /  7:  28.33  28.33  28.61  27.79
+29-SEP-1982 02 /  8:  28.47  28.47  28.91  28.09
+05-OCT-1982 04 /  9:  28.61  28.61  29.34  28.33
+11-OCT-1982 06 / 10:  28.91  28.91  29.76  28.47
+17-OCT-1982 08 / 11:  29.34  29.34  30.20  28.61
+23-OCT-1982 10 / 12:  29.76  29.76  30.75  28.91
+29-OCT-1982 12 / 13:  30.20  30.20  31.42  29.34
+04-NOV-1982 14 / 14:  30.75  30.75  31.84  29.76
+10-NOV-1982 16 / 15:  31.42  31.42  31.98  30.20
+16-NOV-1982 18 / 16:  31.84  31.84  32.13  30.75
+22-NOV-1982 20 / 17:  31.98  31.98  32.41  31.42
+28-NOV-1982 22 / 18:  32.13  32.13  32.73  31.84
+05-DEC-1982 00 / 19:  32.41  32.41  32.94  31.98
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  32.13
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.41
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.73
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.94  32.59
+list/x=123.5w/y=2.5/k=1 temp, temp[L=@med:5], temp[L=@smx:6], temp[L=@smn:6]
+             DATA SET: ./gt4d011.cdf
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[T=@MED:5] is TEMPERATURE (deg. C)(median smoothed by 5 pts on T)
+ Column  3: TEMP[T=@SMX:6] is TEMPERATURE (deg. C)(maximum smoothed by 6 pts on T)
+ Column  4: TEMP[T=@SMN:6] is TEMPERATURE (deg. C)(minimum smoothed by 6 pts on T)
+                      TEMP   TEMP   TEMP   TEMP
+17-AUG-1982 12 /  1:  27.15  27.23  27.54  27.15
+23-AUG-1982 14 /  2:  27.23  27.36  27.79  27.15
+29-AUG-1982 16 /  3:  27.36  27.36  28.09  27.15
+04-SEP-1982 18 /  4:  27.54  27.54  28.33  27.15
+10-SEP-1982 20 /  5:  27.79  27.79  28.47  27.23
+16-SEP-1982 22 /  6:  28.09  28.09  28.61  27.36
+23-SEP-1982 00 /  7:  28.33  28.33  28.91  27.54
+29-SEP-1982 02 /  8:  28.47  28.47  29.34  27.79
+05-OCT-1982 04 /  9:  28.61  28.61  29.76  28.09
+11-OCT-1982 06 / 10:  28.91  28.91  30.20  28.33
+17-OCT-1982 08 / 11:  29.34  29.34  30.75  28.47
+23-OCT-1982 10 / 12:  29.76  29.76  31.42  28.61
+29-OCT-1982 12 / 13:  30.20  30.20  31.84  28.91
+04-NOV-1982 14 / 14:  30.75  30.75  31.98  29.34
+10-NOV-1982 16 / 15:  31.42  31.42  32.13  29.76
+16-NOV-1982 18 / 16:  31.84  31.84  32.41  30.20
+22-NOV-1982 20 / 17:  31.98  31.98  32.73  30.75
+28-NOV-1982 22 / 18:  32.13  32.13  32.94  31.42
+05-DEC-1982 00 / 19:  32.41  32.41  32.97  31.84
+11-DEC-1982 02 / 20:  32.73  32.73  32.97  31.98
+17-DEC-1982 04 / 21:  32.94  32.94  32.97  32.13
+23-DEC-1982 06 / 22:  32.97  32.94  32.97  32.41
+29-DEC-1982 08 / 23:  32.94  32.94  32.97  32.59
+04-JAN-1983 10 / 24:  32.81  32.94  32.97  32.59
+10-JAN-1983 12 / 25:  32.59  32.81  32.97  32.59
+ 
+list/y=2.5/k=1/l=1/x=139.5W:122.5W temp, temp[i=@med], temp[i=@smx], temp[i=@smn]
+             DATA SET: ./gt4d011.cdf
+             LONGITUDE: 139.5W to 122.5W
+             LATITUDE: 2.5N
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[X=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on X)
+ Column  3: TEMP[X=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on X)
+ Column  4: TEMP[X=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on X)
+               TEMP   TEMP   TEMP   TEMP
+139.5W /  91:  26.58  26.65  26.65  26.58
+138.5W /  92:  26.65  26.65  26.90  26.58
+137.5W /  93:  26.90  26.90  27.14  26.65
+136.5W /  94:  27.14  27.14  27.24  26.90
+135.5W /  95:  27.24  27.18  27.24  27.14
+134.5W /  96:  27.18  27.18  27.24  26.91
+133.5W /  97:  26.91  26.91  27.18  26.70
+132.5W /  98:  26.70  26.81  26.91  26.70
+131.5W /  99:  26.81  26.81  27.01  26.70
+130.5W / 100:  27.01  27.01  27.16  26.81
+129.5W / 101:  27.16  27.16  27.21  27.01
+128.5W / 102:  27.21  27.20  27.21  27.16
+127.5W / 103:  27.20  27.20  27.21  27.18
+126.5W / 104:  27.18  27.18  27.20  27.14
+125.5W / 105:  27.14  27.14  27.18  27.13
+124.5W / 106:  27.13  27.14  27.15  27.13
+123.5W / 107:  27.15  27.15  27.17  27.13
+122.5W / 108:  27.17  27.17  27.17  27.15
+list/k=1/l=1/x=123.5w temp, temp[j=35:56 at med], temp[j=35:56 at smx], temp[j=35:56 at smn]
+             DATA SET: ./gt4d011.cdf
+             LATITUDE: 3.7S to 3.7N
+             LONGITUDE: 123.5W
+             DEPTH (m): 5
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Y=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Y)
+ Column  3: TEMP[Y=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Y)
+ Column  4: TEMP[Y=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Y)
+             TEMP   TEMP   TEMP   TEMP
+3.5S  / 35:  26.00  26.00  26.00  25.95
+3.17S / 36:  25.95  25.95  26.00  25.89
+2.83S / 37:  25.89  25.89  25.95  25.82
+2.5S  / 38:  25.82  25.82  25.89  25.74
+2.17S / 39:  25.74  25.74  25.82  25.66
+1.83S / 40:  25.66  25.66  25.74  25.60
+1.5S  / 41:  25.60  25.60  25.66  25.54
+1.17S / 42:  25.54  25.54  25.60  25.50
+0.83S / 43:  25.50  25.50  25.54  25.50
+0.5S  / 44:  25.50  25.50  25.54  25.50
+0.17S / 45:  25.54  25.54  25.63  25.50
+0.17N / 46:  25.63  25.63  25.76  25.54
+0.5N  / 47:  25.76  25.76  25.93  25.63
+0.83N / 48:  25.93  25.93  26.15  25.76
+1.17N / 49:  26.15  26.15  26.42  25.93
+1.5N  / 50:  26.42  26.42  26.69  26.15
+1.83N / 51:  26.69  26.69  26.92  26.42
+2.17N / 52:  26.92  26.92  27.15  26.69
+2.5N  / 53:  27.15  27.15  27.40  26.92
+2.83N / 54:  27.40  27.40  27.70  27.15
+3.17N / 55:  27.70  27.70  28.06  27.40
+3.5N  / 56:  28.06  28.06  28.06  27.70
+ 
+list/l=1/x=123.5w/y=2.5/z=0:100 temp, temp[k=@med], temp[k=@smx], temp[k=@smn]
+             DATA SET: ./gt4d011.cdf
+             DEPTH (m): 0 to 100
+             LONGITUDE: 123.5W
+             LATITUDE: 2.5N
+             TIME: 17-AUG-1982 12:00
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: TEMP[Z=@MED:3] is TEMPERATURE (deg. C)(median smoothed by 3 pts on Z)
+ Column  3: TEMP[Z=@SMX:3] is TEMPERATURE (deg. C)(maximum smoothed by 3 pts on Z)
+ Column  4: TEMP[Z=@SMN:3] is TEMPERATURE (deg. C)(minimum smoothed by 3 pts on Z)
+             TEMP   TEMP   TEMP   TEMP
+5     /  1:  27.15  27.15  27.15  27.10
+15    /  2:  27.10  27.10  27.15  27.10
+25    /  3:  27.10  27.10  27.10  27.10
+35    /  4:  27.10  27.10  27.10  27.09
+45    /  5:  27.09  27.09  27.10  26.84
+55    /  6:  26.84  26.84  27.09  26.21
+65    /  7:  26.21  26.21  26.84  25.40
+75    /  8:  25.40  25.40  26.21  24.51
+85    /  9:  24.51  24.51  25.40  23.54
+95    / 10:  23.54  24.51  24.51  23.54
+ 
+*** Running test: bn_vector_symbols.jnl
+! bn_vector_symbols.jnl
+! ACM 7/16/21010 Ferret V6.6.3
+!
+! On any vector plot command, define symbols
+! PPL_VECLEN containing the vector length scale
+! PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the skip
+!
+! They are defined whether they are automatically set or
+! set via qualifiers.
+ 
+VECTOR/I=1:10/J=1:20 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  7.39"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:10/J=1:20/LEN=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.00"
+PPL_VEC_XSKIP = "1"
+PPL_VEC_YSKIP = "1"
+ 
+VECTOR/I=1:300/J=1:200/LEN=8.2 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  8.20"
+PPL_VEC_XSKIP = "8"
+PPL_VEC_YSKIP = "7"
+ 
+VECTOR/I=1:300/J=1:200/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  25.1"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+VECTOR/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=8 i/j,j/i
+SHOW SYMBOL ppl_vec*
+PPL_VECLEN = "  12.2"
+PPL_VEC_XSKIP = "10"
+PPL_VEC_YSKIP = "8"
+ 
+! Also, vector/KEY turns on the key even if /NOLAB was set.
+VECTOR/NOLAB/KEY/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=6 i/j,j/i
+ 
+VECTOR/OVER/KEY/NOLAB/I=1:300/J=1:200/LEN=12.2/XSKIP=10/YSKIP=4 i/j,j/i
+*** Running test: bn_variance_large.jnl
+! bn_variance_large.jnl
+! Previous to v6.6.4, these returned messages **too big**
+ 
+USE coads_climatology
+LET huge = sst*1.e18
+STAT/L=1 huge
+ 
+             SST*1.E18
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+18
+ Maximum value: 3.1E+19
+ Mean    value: 1.652E+19 (unweighted average)
+ Standard deviation: 1.0139E+19
+SHADE/L=1/LEV=v huge
+ 
+LET huge = sst*1.e25
+STAT/L=1 huge
+ 
+             SST*1.E25
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: -1.8E+25
+ Maximum value: 3.1E+26
+ Mean    value: 1.652E+26 (unweighted average)
+ Standard deviation: 1.0139E+26
+SHADE/L=1/LEV=v huge
+ 
+CANCEL SYMBOL lev*
+*** Running test: bn_labnum_calendar.jnl
+! bn_labnum_calendar.jn.
+! Define new symbol, when a Calendar label is on
+! the plot, pointing to its ppl label number.
+ 
+! Use a non-standard calendar
+! label LABNUM_CALEN is defined.
+ 
+use gt4d011
+set axis/calendar=noleap `temp,return=taxis`
+ !-> set axis/calendar=noleap TIME1
+plot/x=132w/y=2n/k=1 temp
+sh sym LABNUM_CALEND
+LABNUM_CALEND = "4"
+sh sym lab($labnum_calend)
+ !-> sh sym lab4
+LAB4 = "CALENDAR: NOLEAP"
+ 
+*** Running test: bn665_bug_fixes.jnl
+! bn65_bug_fixes.jnl
+! test various fixes that went into version 6.6.5
+! 11/2010 ACM
+!
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_keep_case
+! err664_xml_keep_case.jnl
+!
+! See bug 1177, xml output should keep the original case of
+! variables and axis names.  Previously xml output upcased
+! variable and coordinate axis names.
+!
+! This dataset has variables and axes in various cases:
+! upper case axis TIME
+! lower case axis zt, variable temp
+! mixed case axes grid_x_T, grid_y_T
+ 
+!******* Note this is NOT implemented in the V6.65 release ******!
+!******* Needs further changes to integrate it with LAS    ******!
+ 
+use a_cartesian_bug1179.nc
+sh var/xml
+ 
+! List the xml for just the axes in this file. sho axis/all/xml
+! lists all axes here at the end of the benchmarks.
+ 
+LET axis_names = ..dimnames
+LET nd = ..ndims
+REPEAT/RANGE=1:`nd`/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+ !-> REPEAT/RANGE=1:4/name=m (DEFINE SYMBOL m = `m`; SH AXIS/XML `axis_names[i=($m)]`)
+!-> REPEAT: M:1
+ !-> DEFINE SYMBOL m = 1
+ !-> SH AXIS/XML TIME
+<axes>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[days since 1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>1900-02-15 03:00:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[1900-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[JULIAN]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:2
+ !-> DEFINE SYMBOL m = 2
+ !-> SH AXIS/XML grid_x_T
+<axes>
+<axis name="GRID_X_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>79</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Longitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_x_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:3
+ !-> DEFINE SYMBOL m = 3
+ !-> SH AXIS/XML grid_y_T
+<axes>
+<axis name="GRID_Y_T">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>1</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>-0.25</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Nominal Latitude of T-cell center]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[Y]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[grid_y_T]]></value>
+</attribute>
+</axis>
+</axes>
+!-> REPEAT: M:4
+ !-> DEFINE SYMBOL m = 4
+ !-> SH AXIS/XML zt
+<axes>
+<axis name="ZT">
+<attribute name="direction" type="char">
+   <value><![CDATA[K]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[meters]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>10</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>22.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>157.9952</value>
+</attribute>
+<attribute name="positive" type="char">
+   <value><![CDATA[down]]></value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value>uneven</value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="cartesian_axis" type="char">
+   <value><![CDATA[z]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[zt]]></value>
+</attribute>
+<attribute name="bounds" type="char">
+   <value>zt_bnds</value>
+</attribute>
+</axis>
+</axes>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_xml_one_point_axis
+! err664_xml_one_point_axis.jnl
+! See LAS ticket 969.
+! Previously the xml listing incorrectly skipped valid one-point axes.
+! (When an axis is averaged away xml listings correctly
+! skip the now-degenerate axis.
+ 
+USE a_cartesian_bug1179.nc
+SH DAT
+     currently SET data sets:
+    1> ./a_cartesian_bug1179.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     THETA_FO(SALT_EXTRAP,TEMP_EXTRA  1:1       1:1       1:10      1:1       ...       ...
+ 
+ 
+LET/D=1 a = temp
+! These listings should show the X,Y, and T axes, valid one-point axes
+! and also the Z axis which has 10 points.
+SH VAR/XML
+<global>
+<var name="A[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<zaxis>ZT</zaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+CANCEL VAR a
+ 
+LET/D=1 temp_ave_t = temp[Z=37.5:112.5 at AVE]
+! These listings should show the X,Y, and T axes, valid one-point axes
+! but not the Z axis, which has been averaged away.
+SH VAR/XML
+<global>
+<var name="TEMP_AVE_T[D=./a_cartesian_bug1179.nc]">
+<attribute name="definition" type="char">
+   <value><![CDATA[TEMP[Z=37.5:112.5 at AVE]]]></value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<grid name="GHU1">
+<axes>
+<xaxis>GRID_X_T</xaxis>
+<yaxis>GRID_Y_T</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</global>
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err65_read_epic_cdf
+! Ned Cokelet reports that the time coordinate is read incorrectly
+! from this file.  Should translate to  04-MAY-2007 05:02
+! Bug was in v6.4 - 6.6 Ferret
+ 
+set mode calendar:minutes ! this was set to months, back in bn_pattern.jnl
+use epic_formatted_file.nc
+list/prec=7 t[gt=t_28]
+             VARIABLE : T
+                        axis TIME
+             FILENAME : epic_formatted_file.nc
+             TIME     : 04-MAY-2007 05:02
+          38825.21
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err664_tax_fcns
+! err664_tax_fcns.jnl
+! Fixes for tickets 1766 and 1765
+ 
+! 1765 Functions did not test for missing data.
+ 
+ 
+! tax_ functions
+use gt4d011
+let tval = t[gt=temp]
+ 
+list tax_dayfrac({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_dayfrac({22702,24454,},tval)
+             VARIABLE : TAX_DAYFRAC({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  0.5000
+ 2   / 2:  0.5000
+ 3   / 3:    ....
+list tax_day({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_day({22702,24454,},tval)
+             VARIABLE : TAX_DAY({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  17.00
+ 2   / 2:  29.00
+ 3   / 3:   ....
+list tax_month({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_month({22702,24454,},tval)
+             VARIABLE : TAX_MONTH({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:   8.00
+ 2   / 2:  10.00
+ 3   / 3:   ....
+list tax_year({`tval[l=1]`,`tval[l=13]`,},tval)
+ !-> list tax_year({22702,24454,},tval)
+             VARIABLE : TAX_YEAR({22702,24454,},TVAL)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  1982.
+ 2   / 2:  1982.
+ 3   / 3:   ....
+ 
+! 1766 tax_year retured 0 for year 0001
+ 
+def ax/edge/t=1-jan-0000:1-jan-0005:1/unit=year tax
+let a = t[gt=tax]
+list tax_year(a,a)
+             VARIABLE : TAX_YEAR(A,A)
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:  0.000
+ JUL-0001 / 2:  1.000
+ JUL-0002 / 3:  2.000
+ JUL-0003 / 4:  3.000
+ JUL-0004 / 5:  4.000
+ JUL-0005 / 6:  5.000
+ 
+! Likewise no year for year 0000 and 0001 in tax_datestring
+ list tax_datestring(a, a, "day")
+             VARIABLE : TAX_DATESTRING(A, A, "day")
+             SUBSET   : 6 points (TIME)
+ JUL-0000 / 1:"01-JUL-0000"
+ JUL-0001 / 2:"01-JUL-0001"
+ JUL-0002 / 3:"02-JUL-0002"
+ JUL-0003 / 4:"02-JUL-0003"
+ JUL-0004 / 5:"01-JUL-0004"
+ JUL-0005 / 6:"01-JUL-0005"
+ 
+*** Running test: bn_floatstr.jnl
+! bn_floatstr.jnl
+! testing new function to convert floating-point
+! variables to strings.
+ 
+LET string = FLOATSTR({3.14159,2.71828},"(f3.1)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828},"(f3.1)")
+             SUBSET   : 2 points (X)
+ 1   / 1:"3.1"
+ 2   / 2:"2.7"
+ 
+! Missing data returned as the null string
+LET string = FLOATSTR({3.14159,2.71828,},"(g8.2)")
+LIST string
+             VARIABLE : FLOATSTR({3.14159,2.71828,},"(g8.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.1"
+ 2   / 2:" 2.7"
+ 3   / 3:""    
+ 
+! Test some large and small values
+LET var = {3.14159,2.71828,}
+LIST FLOATSTR(36*var,"(e9.4)")
+             VARIABLE : FLOATSTR(36*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".1131E+03"
+ 2   / 2:".9786E+02"
+ 3   / 3:""         
+LIST FLOATSTR(1.e14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E+15"
+ 2   / 2:".2718E+15"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(e9.4)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(e9.4)")
+             SUBSET   : 3 points (X)
+ 1   / 1:".3142E-13"
+ 2   / 2:".2718E-13"
+ 3   / 3:""         
+LIST FLOATSTR(1.e-14*var,"(f4.1)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(f4.1)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 0.0"
+ 2   / 2:" 0.0"
+ 3   / 3:""    
+LIST FLOATSTR(1.e-14*var,"(1pg9.2)")
+             VARIABLE : FLOATSTR(1.E-14*VAR,"(1pg9.2)")
+             SUBSET   : 3 points (X)
+ 1   / 1:" 3.14E-14"
+ 2   / 2:" 2.72E-14"
+ 3   / 3:""         
+ 
+! Result shape is inherited from the input variable
+USE gt4d011.cdf
+LIST/I=100/J=36:38/T=1-dec-1982:1-jan-1983 FLOATSTR(tauy, "(f8.4)")
+             VARIABLE : FLOATSTR(TAUY, "(f8.4)")
+             FILENAME : gt4d011.cdf
+             SUBSET   : 3 by 6 points (LATITUDE-TIME)
+             LONGITUDE: 130W
+                         3S        2.67S     2.33S   
+                          36        37        38
+ 28-NOV-1982 22 / 18:" -0.0272"" -0.0240"" -0.0208"
+ 05-DEC-1982 00 / 19:" -0.0283"" -0.0252"" -0.0220"
+ 11-DEC-1982 02 / 20:" -0.0294"" -0.0263"" -0.0232"
+ 17-DEC-1982 04 / 21:" -0.0357"" -0.0324"" -0.0291"
+ 23-DEC-1982 06 / 22:" -0.0470"" -0.0434"" -0.0397"
+ 29-DEC-1982 08 / 23:" -0.0583"" -0.0543"" -0.0503"
+ 
+USE coads_climatology
+LET var =  FLOATSTR(sst,"(1pg8.3)")
+ 
+LIST/X=165W:135W/Y=-50/L=1 var
+             VARIABLE : FLOATSTR(SST,"(1pg8.3)")
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                51S   
+                 20
+ 165W   /  88:"10.5"
+ 163W   /  89:"11.2"
+ 161W   /  90:"11.8"
+ 159W   /  91:"11.0"
+ 157W   /  92:"10.7"
+ 155W   /  93:"10.9"
+ 153W   /  94:"10.7"
+ 151W   /  95:"10.5"
+ 149W   /  96:"10.6"
+ 147W   /  97:"11.0"
+ 145W   /  98:"10.1"
+ 143W   /  99:"11.0"
+ 141W   / 100:""    
+ 139W   / 101:""    
+ 137W   / 102:""    
+ 135W   / 103:""    
+LIST/X=165W:135W/Y=-50/L=1 STRLEN(var)
+             VARIABLE : STRLEN(VAR)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 16 points (LONGITUDE)
+             LATITUDE : 51S
+             TIME     : 16-JAN 06:00
+                 51S   
+                 20
+ 165W   /  88:  4.000
+ 163W   /  89:  4.000
+ 161W   /  90:  4.000
+ 159W   /  91:  4.000
+ 157W   /  92:  4.000
+ 155W   /  93:  4.000
+ 153W   /  94:  4.000
+ 151W   /  95:  4.000
+ 149W   /  96:  4.000
+ 147W   /  97:  4.000
+ 145W   /  98:  4.000
+ 143W   /  99:  4.000
+ 141W   / 100:  0.000
+ 139W   / 101:  0.000
+ 137W   / 102:  0.000
+ 135W   / 103:  0.000
+*** Running test: bn67_bug_fixes.jnl
+! bn67_bug_fixes.jnl
+! test various fixes that went into version 6.7
+! 2/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err665_sum_4d_labels
+! A multi-dimensioned sum is now done as a 4D transformation.
+! the labels on a LISTing of the result contained ???
+! ticket 1788
+ 
+use coads_climatology
+list sst[X=125E,Y=75S:75N at sum,l=1:12 at sum]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 125E
+             LATITUDE : 75S to 75N (YT summed)
+             TIME     : 01-JAN 00:45 to 31-DEC-0002 18:13 (YT summed)
+          7563.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_din
+! err665_din
+! Fixing incorrect latitude corrections for single-point y axis,
+! and the @DIN transformation. See ticket 1348, comment 12.
+ 
+! Compute the correct area of a 10m-deep, 1-deglon cell at 26.5N.
+let pi = 3.1415926
+let/unit="m"/title="authalic radius of earth" r_authalic = 6371005
+let/unit="degrees_north" lat = 26.5
+let/unit="degrees_east" dx = 1
+let/unit="m" dz = 10
+let dx_meters = r_authalic * cos(lat * pi/180) * (dx * pi/180)
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          995122.
+ 
+! Next try to reproduce this with Ferret.
+! First make a one-cell XYZ variable, with a value of 1.
+def ax/x=279:280:1/modulo=360/unit=degrees_east/edge xax
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=26:27:1/unit=degrees_north/edge yax
+def ax/z=0:10:10/unit=m/edge/depth zax
+let p = 1+0*(x[gx=xax]+y[gy=yax]+z[gz=zax])
+ 
+! Compute its integral (area) over XZ.
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 26.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          995121.
+ 
+ 
+! Now do it farther north.
+LET/unit="degrees_north" lat = 72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=72:73:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5N
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+! Now in the south.
+LET/unit="degrees_north" lat = -72.5
+list dx_meters*dz
+             VARIABLE : DX_METERS*DZ
+          334370.
+ 
+! Next try to reproduce this with Ferret.
+! Compute its integral (area) over XZ.
+def ax/y=`lat-0.5`:`lat+0.5`:1/unit=degrees_north/edge yax
+ !-> def ax/y=-73:-72:1/unit=degrees_north/edge yax
+list p[x=279:380 at din,z=0:10 at din]
+             VARIABLE : 1+0*(X[GX=XAX]+Y[GY=YAX]+Z[GZ=ZAX])
+             LONGITUDE: 81W to 20E(380) (XZ integ.)
+             LATITUDE : 72.5S
+             DEPTH (m): 0 to 10 (XZ integ.)
+          334370.
+ 
+GO bn_reset
+cancel mode verify
+GO err665_centered_lev
+! err665_centered_lev
+! Bug 1803; computation of new levels isnt requested for
+! centered levels after a SHADE/LINE/LEV=c or FILL/LINE/LEV=c
+ 
+USE coads_climatology
+SHADE/L=1/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-32"
+LEV_MAX = "32"
+LEV_NUM = "32"
+LEV_DEL = "2"
+ 
+SHADE/L=1/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+FILL/L=3/LINE/KEY/LEV=c sst
+SHO SYM lev*
+LEV_TEXT = "C"
+LEV_MIN = "-34"
+LEV_MAX = "34"
+LEV_NUM = "34"
+LEV_DEL = "2"
+ 
+FILL/L=3/LINE/KEY/LEV=10c sst
+SHO SYM lev*
+LEV_TEXT = "10C"
+LEV_MIN = "-35"
+LEV_MAX = "35"
+LEV_NUM = "14"
+LEV_DEL = "5"
+ 
+GO bn_reset
+cancel mode verify
+GO err665_hours_since_T
+! err665_hours_since_T.jnl
+! Ticket 1806: allow time-axis units string to
+! be written with a T between the date and time parts,
+! e.g. units: "hours since 2011-03-08T12:00:00Z"
+ 
+! Check that T0 includes hour 12:00
+! Previously the hours, minutes, seconds were set to 00
+ 
+use hourst.nc
+sh axis/all hourax
+ name       axis              # pts   start                end
+ HOURAX    TIME                29 r   01-JAN-2001 12:00    15-JAN-2001 12:00
+T0 = 15-JAN-1901 12:00:00
+   Axis span (to cell edges) = 348
+ 
+GO bn_reset
+cancel mode verify
+GO err667_att_too_long
+! err667_att_too_long.jnl
+! 3/25/2011 ACM
+! bug 1820; too-long string attribute causes crash or hang
+ 
+use toolong.nc
+sh dat/att
+     currently SET data sets:
+    1> ./toolong.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        28   T       FERRET V6.7 (beta) 25-Mar-11
+                                 Conventions     CHAR        6    F       CF-1.0
+                                 nco_input_file_nINT         1    F       1000
+                                 nco_input_file_lCHAR        2048 F
+ b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2.h0.0001.SURF.nc b40.coup_carb.004.cam2. [...]
+  
+(LON273_289)           DOUBLE    long_name       CHAR        9    T       longitude
+                                 units           CHAR        12   T       degrees_east
+                                 modulo          DOUBLE      1    T       360
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        10   F       LON273_289
+  
+(LAT54_54)             DOUBLE    long_name       CHAR        8    T       latitude
+                                 units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 orig_file_axnameCHAR        8    F       LAT54_54
+  
+(TIME)                 DOUBLE    long_name       CHAR        23   T       time interval endpoints
+                                 units           CHAR        30   T       days since 0001-01-01 00:00:00
+                                 calendar        CHAR        6    T       noleap
+                                 axis            CHAR        1    T       T
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SFCO2                 FLOAT     units           CHAR        7    T       kg/m2/s
+                                 long_name       CHAR        16   T       CO2 surface flux
+                                 history         CHAR        10   T       From SFCO2
+  
+save/file=aa.nc/clobber sfco2
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_mode_desperate
+! err667_mode_desperate
+! 3/25/2011 ACM
+! Fixing bug 1819: too-large requests for value of
+! MODE DESPERATE, and formatting of the value of the
+! setting in SHOW MODE.
+ 
+set mode ignore
+ 
+! setting too large
+set mode desperate `9999999999`
+ !-> set mode desperate 1.E+10
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! another setting too large (previously value
+! was set to the first 10 digits of this)
+set mode desperate 1234567890123456789
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE     CANCELLED      2560000
+ 
+! Previously couldnt handle a floating point
+! input. Now we can.
+set mode desperate `96 * 1024 * 1024`
+ !-> set mode desperate 1.006633E+08
+show mode desperate
+      MODE            STATE        ARGUMENT
+      DESPERATE        SET           100663300
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err667_dup_axnames
+! err667_dup_axnames.jnl
+! See bug 1750
+!
+! create two files with same-named y-axis
+def ax/y=-90:90:5 yax_dup_axnames
+let g = y[gy=yax_dup_axnames]
+save/clob/file=g.nc g
+def ax/y=-30:30:5 yax_dup_axnames
+let h = y[gy=yax_dup_axnames]
+save/clob/file=h.nc h
+ 
+can var g h
+can ax yax_dup_axnames
+! collect variables into a single file
+use g.nc
+use h.nc
+ 
+save/clob/file="gh.nc" g[d=1], h[d=2]
+ 
+! When the two datasets are opened, they both have Y axes with the same name
+! but different contents, so internally the axis of H is named yax_dup_axnames1.
+! If there is not a duplicate name in the output file, we want to write H with
+! the original axis name. Check for that.
+ 
+save/clob/file="justh.nc" h[d=2]
+save/clob/file="justg.nc" g[d=1]
+ 
+GO bn_reset
+cancel mode verify
+GO err667_string_if
+! err667_string_if.jnl
+! Previously both of these LIST commands caused a crash.
+! tickets 1764, 1795
+!
+ 
+let a = {"x","y"}
+let b = IF a EQ "x" THEN "z" ELSE a
+list b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+let strings = {"a","b"}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 2 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err667_show_var_twice
+ ! err667_show_var_twice.jnl
+ ! ticket 1825
+ 
+use coads_climatology
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+sh var sst[d=1]
+ SST[D=1]: SEA SURFACE TEMPERATURE, in dataset ./coads_climatology.cdf
+ 
+!should return nothing
+sh var airt
+ 
+let/d=1 airt2 = airt*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+sh var airt2[d=1]
+ AIRT2[D=coads_climatology] = AIRT*2
+ 
+GO bn_reset
+cancel mode verify
+GO err667_5d_netcdf
+exit/script  ! this test is not valid for 6D Ferret.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+*** Running test: bn_NaN_note.jnl
+! bn_NaN_note.jnl
+! Ferret v6.7  2/2011
+! The message about no missing flags, and assuming NaN,
+! is issued only when MODE DIAGNOSTIC is turned on.
+ 
+! This dataset has no missing-valueu flags on its variables
+! No notes on opening it
+USE test0
+!
+! Close it and then open it with MODE DIAG
+! Now we get the NOTE
+GO bn_reset
+cancel mode verify
+SET MODE diag
+USE test0
+CANCEL MODE diag
+*** Running test: bn671_bug_fixes.jnl
+! bn671_bug_fixes.jnl
+! test various fixes that went into version 6.71
+! 4/2011 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err67_tax_modtime
+! err67_tax_modtime.jnl
+! 5/17/2011
+! tickets 1853, 1854: TAX_* functions returned
+! incorrect results when the time axis is modulo
+set mode ignore_error
+ 
+!use climatological_axes
+!can dat climatological_axes
+let tvar = t[gt=month_reg]
+ 
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"hour")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"hour")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR 08"
+ 16-APR      / 16:"16-APR 19"
+ 17-MAY      / 17:"17-MAY 05"
+ 16-JUN      / 18:"16-JUN 16"
+ 17-JUL      / 19:"17-JUL 02"
+ 16-AUG      / 20:"16-AUG 13"
+list/L=15:20 tax_datestring(t[gt=tvar],tvar,"day")
+             VARIABLE : TAX_DATESTRING(T[GT=TVAR],TVAR,"day")
+             SUBSET   : 6 points (TIME)
+ 17-MAR      / 15:"17-MAR"
+ 16-APR      / 16:"16-APR"
+ 17-MAY      / 17:"17-MAY"
+ 16-JUN      / 18:"16-JUN"
+ 17-JUL      / 19:"17-JUL"
+ 16-AUG      / 20:"16-AUG"
+list/L=15:20 tax_dayfrac(t[gt=tvar],tvar), tax_dayfrac(t[gt=tvar],tvar)*24.
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAYFRAC(T[GT=TVAR],TVAR)
+ Column  2: EX#2 is TAX_DAYFRAC(T[GT=TVAR],TVAR)*24.
+             (C001,V002)   EX#2
+17-MAR      / 15:  0.3662   8.79
+16-APR      / 16:  0.8031  19.27
+17-MAY      / 17:  0.2400   5.76
+16-JUN      / 18:  0.6769  16.25
+17-JUL      / 19:  0.1138   2.73
+16-AUG      / 20:  0.5506  13.21
+list/L=15:20 tax_day(t[gt=tvar],tvar), tax_jday(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_DAY(T[GT=TVAR],TVAR)
+ Column  2: TAX_JDAY(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   17.00    76.0
+16-APR      / 16:   16.00   106.0
+17-MAY      / 17:   17.00   137.0
+16-JUN      / 18:   16.00   167.0
+17-JUL      / 19:   17.00   198.0
+16-AUG      / 20:   16.00   228.0
+list/L=15:20 tax_month(t[gt=tvar],tvar), tax_yearfrac(t[gt=tvar],tvar)
+             TIME: 02-MAR 03:32 to 31-AUG 18:27
+ Column  1: TAX_MONTH(T[GT=TVAR],TVAR)
+ Column  2: TAX_YEARFRAC(T[GT=TVAR],TVAR)
+             (C001,V002)  (C001,V005)
+17-MAR      / 15:   3.000  0.2082
+16-APR      / 16:   4.000  0.2904
+17-MAY      / 17:   5.000  0.3753
+16-JUN      / 18:   6.000  0.4575
+17-JUL      / 19:   7.000  0.5425
+16-AUG      / 20:   8.000  0.6247
+! the following is an error for a modulo time axis
+list/L=15:20 tax_year(t[gt=tvar],tvar)
+list tax_units(tvar)
+             VARIABLE : TAX_UNITS(TVAR)
+          3600.
+ 
+GO bn_reset
+cancel mode verify
+GO err67_save_append_open
+! err67_save_append_open.jnl
+! ticket 1832
+! SAVE to a file that's open for reading
+ 
+! Create a file
+use gt4d011.cdf
+save/clobber/file=a.nc temp
+can data/all
+ 
+! Open for reading
+use a.nc
+let tempave = temp[t=@ave]
+let temp_mm = temp - tempave
+ 
+! read from the file and then append to it
+save/append/file=a.nc temp_mm
+ 
+! The dataset still shows just the original contents
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ 
+can dat/all
+ 
+! Close it and open again.
+! Now it shows the variable we appended
+use a.nc
+sh dat
+     currently SET data sets:
+    1> ./a.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:18      1:22      1:10      1:25      ...       ...
+ TEMP_MM  TEMP - TEMPAVE                   1:18      1:22      1:10      1:25      ...       ...
+       (T=14-AUG-1982 11:00:13-JAN-1983 13:00)
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err67_regridding_dyn
+! err67_regridding_dyn.jnl
+!  6/2011
+! See ticket 1862
+! Create three variables. Regrid one to the grid
+! of the other two which share an X axis and
+! have different Y axes; one coarser than the other.
+! The regridding and modulo operatinons incorrectly
+! re-use intermediate results.
+ 
+! Create test datasets to use
+use coads_climatology
+let filled = MISSING(sst[L=1], 0)
+save/file=cc.nc/clobber filled[x=-179:179]
+ 
+! Define an x axis over a different x range from above,
+! and two y axes, same y range but different resoloutions.
+ 
+define axis/x=0:356.25:3.75/units=deg lon
+define axis/y=-90:90/npoints=72/units=deg lat1
+define axis/y=-90:90/npoints=92/units=deg lat2
+ 
+save/clobber/file=c1.nc filled[gx=lon,gy=lat1]
+can mem
+save/clobber/file=c2.nc filled[gx=lon,gy=lat2]
+ 
+can dat/all; can mem; can var/all;
+ 
+! Now regrid the data coming in on x=-179:179 to the other grids
+use c1
+use c2
+use cc
+ 
+set view upper
+shade filled[d=3,gxy=filled[d=1]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=1]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c1]
+             FILENAME : cc.nc
+             SUBSET   : 21 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 72:   ....
+ 87.5N / 71:   0.00
+ 84.9N / 70:   0.00
+ 82.4N / 69:   0.00
+ 79.9N / 68:   0.00
+ 77.3N / 67:   0.00
+ 74.8N / 66:   0.00
+ 72.3N / 65:   0.00
+ 69.7N / 64:   0.96
+ 67.2N / 63:   3.25
+ 64.6N / 62:   5.60
+ 62.1N / 61:   6.40
+ 59.6N / 60:   7.31
+ 57N   / 59:   7.79
+ 54.5N / 58:   7.79
+ 52N   / 57:   9.27
+ 49.4N / 56:  11.43
+ 46.9N / 55:  12.80
+ 44.4N / 54:  14.01
+ 41.8N / 53:  15.02
+ 39.3N / 52:  15.98
+ 
+! The bug has data wrapped around incorrectly
+set view lower
+shade  filled[d=3,gxy=filled[d=2]]
+list/x=330/y=40:90 filled[d=3,gxy=filled[d=2]]
+             VARIABLE : MISSING(SST[L=1], 0)
+                        regrid: FILLED[D=c2]
+             FILENAME : cc.nc
+             SUBSET   : 26 points (LATITUDE)
+             LONGITUDE: 30W
+             TIME     : 16-JAN 06:00
+               30W   
+               89
+ 90N   / 92:   ....
+ 88N   / 91:   0.00
+ 86N   / 90:   0.00
+ 84.1N / 89:   0.00
+ 82.1N / 88:   0.00
+ 80.1N / 87:   0.00
+ 78.1N / 86:   0.00
+ 76.2N / 85:   0.00
+ 74.2N / 84:   0.00
+ 72.2N / 83:   0.00
+ 70.2N / 82:   0.59
+ 68.2N / 81:   2.23
+ 66.3N / 80:   4.17
+ 64.3N / 79:   5.74
+ 62.3N / 78:   6.37
+ 60.3N / 77:   6.93
+ 58.4N / 76:   7.66
+ 56.4N / 75:   7.76
+ 54.4N / 74:   7.81
+ 52.4N / 73:   8.75
+ 50.4N / 72:  10.77
+ 48.5N / 71:  11.99
+ 46.5N / 70:  13.01
+ 44.5N / 69:  13.95
+ 42.5N / 68:  14.76
+ 40.5N / 67:  15.50
+ 
+GO bn_reset
+cancel mode verify
+GO err67_reverse_bounds
+! err67_reverse_bounds.jnl
+!
+! Bug in reversing the bounds when an axis is reversed
+! previously this gave a warning:
+! NOTE: Error in bounds "lev_bnds" or bounds do not enclose point
+ 
+use reverse_z_bnds.nc
+list lev_var, zboxlo[gz=lev_var], zboxhi[gz=lev_var]
+             DATA SET: ./reverse_z_bnds.nc
+             Z: 0 to 1
+ Column  1: LEV_VAR is a variable on the depth axis (none)
+ Column  2: ZBOXLO is ZBOXLO (axis LEV)
+ Column  3: ZBOXHI is ZBOXHI (axis LEV)
+            LEV_VAR   ZBOXLO ZBOXHI
+0      /  1:   24.00  0.0000  0.009
+0.0216 /  2:   23.00  0.0089  0.034
+0.0542 /  3:   22.00  0.0343  0.074
+0.1001 /  4:   21.00  0.0741  0.126
+0.1574 /  5:   20.00  0.1262  0.189
+0.2239 /  6:   19.00  0.1886  0.259
+0.2977 /  7:   18.00  0.2593  0.336
+0.3765 /  8:   17.00  0.3361  0.417
+0.4565 /  9:   16.00  0.4170  0.496
+0.5318 / 10:   15.00  0.4961  0.568
+0.5998 / 11:   14.00  0.5676  0.632
+0.6608 / 12:   13.00  0.6320  0.690
+0.7152 / 13:   12.00  0.6896  0.741
+0.7635 / 14:   11.00  0.7408  0.786
+0.806  / 15:   10.00  0.7861  0.826
+0.8432 / 16:    9.00  0.8259  0.860
+0.8754 / 17:    8.00  0.8605  0.890
+0.9031 / 18:    7.00  0.8903  0.916
+0.9266 / 19:    6.00  0.9158  0.937
+0.9464 / 20:    5.00  0.9374  0.955
+0.9628 / 21:    4.00  0.9554  0.970
+0.9763 / 22:    3.00  0.9703  0.982
+0.9873 / 23:    2.00  0.9824  0.992
+0.9961 / 24:    1.00  0.9922  1.000
+ 
+GO bn_reset
+cancel mode verify
+GO err67_nrst_trans
+! err67_nrst_trans.jnl
+!
+! See ticket 1875: for short axes the @NRST transform
+! missed points - no valid data was returned from this LIST.
+ 
+define axis/x=333:335:1 xax
+define axis/x=300:400:10 xlong
+let x3 = x[gx=xax]
+let var = x3[gx=xlong at nrst]
+list var
+             VARIABLE : X3[GX=XLONG at NRST]
+             SUBSET   : 11 points (X)
+ 300   /  1:   ....
+ 310   /  2:   ....
+ 320   /  3:   ....
+ 330   /  4:  333.0
+ 340   /  5:  335.0
+ 350   /  6:   ....
+ 360   /  7:   ....
+ 370   /  8:   ....
+ 380   /  9:   ....
+ 390   / 10:   ....
+ 400   / 11:   ....
+*** Running test: bn68_bug_fixes.jnl
+! bn68_bug_fixes.jnl
+! test various fixes that went into version 6.8
+!
+GO bn_reset
+cancel mode verify
+GO err672_stray_line
+! err672_stray_line.jnl
+! bug 1545, present in older versions of Ferret too.
+! Lines ( as in go land ), that go near but outside the outer
+! corners of the plot, either from the bottom to the left side
+! of the plot, or from the top to the left, but not crossing
+! any axis, may cause a stray line to be drawn outward from the
+! corner.
+ 
+use coads_climatology
+shade/noax/nolab/nokey sst[x=148.68:262.0,y=-29.83:45.35,L=1]
+ 
+! Line near but not crossing from top to left
+plot/vs/over/nolab/line/sym {148.83, 148.33}, {45.5, 45.25}
+ 
+! Line near but not crossing from bottom to the left
+plot/over/vs/nolab/line/sym {148.83, 148.17}, {-29.96, -29.68}
+ 
+GO bn_reset
+cancel mode verify
+GO err672_tax_functions_prec
+! See ticket 1642: arg 1 of TAX_* functions
+! is a single-precision variale representing double-precision coords.
+ 
+ 
+set mode ignore
+ 
+define axis/t=30-jan-2010:31-dec-2010:86400/unit=seconds taxis
+let var = t[gt=taxis]
+ 
+! Previously this was incorrect- varied in the seconds place
+list/l=1:7 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:"30-JAN-2010 00:00:00"
+ 31-JAN-2010 00 / 2:"31-JAN-2010 00:00:00"
+ 01-FEB-2010 00 / 3:"01-FEB-2010 00:00:00"
+ 02-FEB-2010 00 / 4:"02-FEB-2010 00:00:00"
+ 03-FEB-2010 00 / 5:"03-FEB-2010 00:00:00"
+ 04-FEB-2010 00 / 6:"04-FEB-2010 00:00:00"
+ 05-FEB-2010 00 / 7:"05-FEB-2010 00:00:00"
+ 
+! Note there is no complete fix. This axis needs more than single-
+! precision representation at the far end.
+list/t=1-dec-2010:5-dec-2010 TAX_DATESTRING(t[gt=var],var,"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR],VAR,"seconds")
+             SUBSET   : 5 points (TIME)
+ 01-DEC-2010 00 / 306:"01-DEC-2010 00:00:00"
+ 02-DEC-2010 00 / 307:"02-DEC-2010 00:00:00"
+ 03-DEC-2010 00 / 308:"03-DEC-2010 00:00:00"
+ 04-DEC-2010 00 / 309:"04-DEC-2010 00:00:00"
+ 05-DEC-2010 00 / 310:"05-DEC-2010 00:00:00"
+ 
+! Likewise all these were off by a bit (except month and year)
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:   1.00
+ 02-FEB-2010 00 / 4:   2.00
+ 03-FEB-2010 00 / 5:   3.00
+ 04-FEB-2010 00 / 6:   4.00
+ 05-FEB-2010 00 / 7:   5.00
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.0000
+ 31-JAN-2010 00 / 2:  0.0000
+ 01-FEB-2010 00 / 3:  0.0000
+ 02-FEB-2010 00 / 4:  0.0000
+ 03-FEB-2010 00 / 5:  0.0000
+ 04-FEB-2010 00 / 6:  0.0000
+ 05-FEB-2010 00 / 7:  0.0000
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  40206.
+ 31-JAN-2010 00 / 2:  40207.
+ 01-FEB-2010 00 / 3:  40208.
+ 02-FEB-2010 00 / 4:  40209.
+ 03-FEB-2010 00 / 5:  40210.
+ 04-FEB-2010 00 / 6:  40211.
+ 05-FEB-2010 00 / 7:  40212.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  30.00
+ 31-JAN-2010 00 / 2:  31.00
+ 01-FEB-2010 00 / 3:  32.00
+ 02-FEB-2010 00 / 4:  33.00
+ 03-FEB-2010 00 / 5:  34.00
+ 04-FEB-2010 00 / 6:  35.00
+ 05-FEB-2010 00 / 7:  36.00
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  1.000
+ 31-JAN-2010 00 / 2:  1.000
+ 01-FEB-2010 00 / 3:  2.000
+ 02-FEB-2010 00 / 4:  2.000
+ 03-FEB-2010 00 / 5:  2.000
+ 04-FEB-2010 00 / 6:  2.000
+ 05-FEB-2010 00 / 7:  2.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  2010.
+ 31-JAN-2010 00 / 2:  2010.
+ 01-FEB-2010 00 / 3:  2010.
+ 02-FEB-2010 00 / 4:  2010.
+ 03-FEB-2010 00 / 5:  2010.
+ 04-FEB-2010 00 / 6:  2010.
+ 05-FEB-2010 00 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 30-JAN-2010 00 / 1:  0.08219
+ 31-JAN-2010 00 / 2:  0.08493
+ 01-FEB-2010 00 / 3:  0.08767
+ 02-FEB-2010 00 / 4:  0.09041
+ 03-FEB-2010 00 / 5:  0.09315
+ 04-FEB-2010 00 / 6:  0.09589
+ 05-FEB-2010 00 / 7:  0.09863
+ 
+! This axis even worse, all results the same
+! All of these will bail out with repeated ARG1 values
+define axis/t=1-jan-2010:2-jan-2010:5/unit=seconds taxis
+let var = t[gt=taxis]
+list/l=1:7 TAX_DATESTRING(t[gt=var,L=1:50],var[L=1:50],"seconds")
+             VARIABLE : TAX_DATESTRING(T[GT=VAR,L=1:50],VAR[L=1:50],"seconds")
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:"01-JAN-2010 00:00:00"
+ 01-JAN-2010 00:00:05 / 2:"01-JAN-2010 00:00:05"
+ 01-JAN-2010 00:00:10 / 3:"01-JAN-2010 00:00:10"
+ 01-JAN-2010 00:00:15 / 4:"01-JAN-2010 00:00:15"
+ 01-JAN-2010 00:00:20 / 5:"01-JAN-2010 00:00:20"
+ 01-JAN-2010 00:00:25 / 6:"01-JAN-2010 00:00:25"
+ 01-JAN-2010 00:00:30 / 7:"01-JAN-2010 00:00:30"
+ 
+list/l=1:7 TAX_DAY(t[gt=var], var)
+             VARIABLE : TAX_DAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_DAYFRAC(t[gt=var], var)
+             VARIABLE : TAX_DAYFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.000E+00
+ 01-JAN-2010 00:00:05 / 2:  5.787E-05
+ 01-JAN-2010 00:00:10 / 3:  1.157E-04
+ 01-JAN-2010 00:00:15 / 4:  1.736E-04
+ 01-JAN-2010 00:00:20 / 5:  2.315E-04
+ 01-JAN-2010 00:00:25 / 6:  2.894E-04
+ 01-JAN-2010 00:00:30 / 7:  3.472E-04
+list/l=1:7 TAX_jday1900(t[gt=var], var)
+             VARIABLE : TAX_JDAY1900(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  40177.
+ 01-JAN-2010 00:00:05 / 2:  40177.
+ 01-JAN-2010 00:00:10 / 3:  40177.
+ 01-JAN-2010 00:00:15 / 4:  40177.
+ 01-JAN-2010 00:00:20 / 5:  40177.
+ 01-JAN-2010 00:00:25 / 6:  40177.
+ 01-JAN-2010 00:00:30 / 7:  40177.
+list/l=1:7 TAX_jday(t[gt=var], var)
+             VARIABLE : TAX_JDAY(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_month(t[gt=var], var)
+             VARIABLE : TAX_MONTH(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  1.000
+ 01-JAN-2010 00:00:05 / 2:  1.000
+ 01-JAN-2010 00:00:10 / 3:  1.000
+ 01-JAN-2010 00:00:15 / 4:  1.000
+ 01-JAN-2010 00:00:20 / 5:  1.000
+ 01-JAN-2010 00:00:25 / 6:  1.000
+ 01-JAN-2010 00:00:30 / 7:  1.000
+list/l=1:7 TAX_year(t[gt=var], var)
+             VARIABLE : TAX_YEAR(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  2010.
+ 01-JAN-2010 00:00:05 / 2:  2010.
+ 01-JAN-2010 00:00:10 / 3:  2010.
+ 01-JAN-2010 00:00:15 / 4:  2010.
+ 01-JAN-2010 00:00:20 / 5:  2010.
+ 01-JAN-2010 00:00:25 / 6:  2010.
+ 01-JAN-2010 00:00:30 / 7:  2010.
+list/l=1:7 TAX_yearfrac(t[gt=var], var)
+             VARIABLE : TAX_YEARFRAC(T[GT=VAR], VAR)
+             SUBSET   : 7 points (TIME)
+ 01-JAN-2010 00:00:00 / 1:  0.002740
+ 01-JAN-2010 00:00:05 / 2:  0.002740
+ 01-JAN-2010 00:00:10 / 3:  0.002740
+ 01-JAN-2010 00:00:15 / 4:  0.002740
+ 01-JAN-2010 00:00:20 / 5:  0.002740
+ 01-JAN-2010 00:00:25 / 6:  0.002740
+ 01-JAN-2010 00:00:30 / 7:  0.002740
+ 
+! This example from Patrick B. Output of TAX_dayfrac repeats.
+! We need to just return an error mesage. Cant represent 2.5 years
+! of seconds as a single-precision variable. (Can't represent even a month...)
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=seconds/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+let a =  TAX_year(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let b =  TAX_jday(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+let c =  TAX_dayfrac(tt[t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], tt[L=76340000:76350000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  2010.000
+ 02-JUN-2010 13:34:41 / 76340082:  2010.000
+ 02-JUN-2010 13:34:42 / 76340083:  2010.000
+ 02-JUN-2010 13:34:43 / 76340084:  2010.000
+ 02-JUN-2010 13:34:44 / 76340085:  2010.000
+ 02-JUN-2010 13:34:45 / 76340086:  2010.000
+ 02-JUN-2010 13:34:46 / 76340087:  2010.000
+ 02-JUN-2010 13:34:47 / 76340088:  2010.000
+ 02-JUN-2010 13:34:48 / 76340089:  2010.000
+ 02-JUN-2010 13:34:49 / 76340090:  2010.000
+ 02-JUN-2010 13:34:50 / 76340091:  2010.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  153.0000
+ 02-JUN-2010 13:34:41 / 76340082:  153.0000
+ 02-JUN-2010 13:34:42 / 76340083:  153.0000
+ 02-JUN-2010 13:34:43 / 76340084:  153.0000
+ 02-JUN-2010 13:34:44 / 76340085:  153.0000
+ 02-JUN-2010 13:34:45 / 76340086:  153.0000
+ 02-JUN-2010 13:34:46 / 76340087:  153.0000
+ 02-JUN-2010 13:34:47 / 76340088:  153.0000
+ 02-JUN-2010 13:34:48 / 76340089:  153.0000
+ 02-JUN-2010 13:34:49 / 76340090:  153.0000
+ 02-JUN-2010 13:34:50 / 76340091:  153.0000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50"], TT[L=76340000:76350000])
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  0.5657407
+ 02-JUN-2010 13:34:41 / 76340082:  0.5657523
+ 02-JUN-2010 13:34:42 / 76340083:  0.5657639
+ 02-JUN-2010 13:34:43 / 76340084:  0.5657755
+ 02-JUN-2010 13:34:44 / 76340085:  0.5657870
+ 02-JUN-2010 13:34:45 / 76340086:  0.5657986
+ 02-JUN-2010 13:34:46 / 76340087:  0.5658102
+ 02-JUN-2010 13:34:47 / 76340088:  0.5658218
+ 02-JUN-2010 13:34:48 / 76340089:  0.5658333
+ 02-JUN-2010 13:34:49 / 76340090:  0.5658449
+ 02-JUN-2010 13:34:50 / 76340091:  0.5658565
+ 
+! Can do this example
+let a =  TAX_year(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let b =  TAX_jday(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+let c =  TAX_dayfrac(tt[t="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], tt[L=1080000:1090000])
+ 
+list/prec=7 a
+             VARIABLE : TAX_YEAR(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  2008.000
+ 13-JAN-2008 13:34:41 / 1085682:  2008.000
+ 13-JAN-2008 13:34:42 / 1085683:  2008.000
+ 13-JAN-2008 13:34:43 / 1085684:  2008.000
+ 13-JAN-2008 13:34:44 / 1085685:  2008.000
+ 13-JAN-2008 13:34:45 / 1085686:  2008.000
+ 13-JAN-2008 13:34:46 / 1085687:  2008.000
+ 13-JAN-2008 13:34:47 / 1085688:  2008.000
+ 13-JAN-2008 13:34:48 / 1085689:  2008.000
+ 13-JAN-2008 13:34:49 / 1085690:  2008.000
+ 13-JAN-2008 13:34:50 / 1085691:  2008.000
+list/prec=7 b
+             VARIABLE : TAX_JDAY(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  13.00000
+ 13-JAN-2008 13:34:41 / 1085682:  13.00000
+ 13-JAN-2008 13:34:42 / 1085683:  13.00000
+ 13-JAN-2008 13:34:43 / 1085684:  13.00000
+ 13-JAN-2008 13:34:44 / 1085685:  13.00000
+ 13-JAN-2008 13:34:45 / 1085686:  13.00000
+ 13-JAN-2008 13:34:46 / 1085687:  13.00000
+ 13-JAN-2008 13:34:47 / 1085688:  13.00000
+ 13-JAN-2008 13:34:48 / 1085689:  13.00000
+ 13-JAN-2008 13:34:49 / 1085690:  13.00000
+ 13-JAN-2008 13:34:50 / 1085691:  13.00000
+list/prec=7 c
+             VARIABLE : TAX_DAYFRAC(TT[T="13-JAN-2008:13:34:40":"13-JAN-2008:13:34:50"], TT[L=1080000:1090000])
+             SUBSET   : 11 points (TIME)
+ 13-JAN-2008 13:34:40 / 1085681:  0.5657407
+ 13-JAN-2008 13:34:41 / 1085682:  0.5657523
+ 13-JAN-2008 13:34:42 / 1085683:  0.5657639
+ 13-JAN-2008 13:34:43 / 1085684:  0.5657755
+ 13-JAN-2008 13:34:44 / 1085685:  0.5657870
+ 13-JAN-2008 13:34:45 / 1085686:  0.5657986
+ 13-JAN-2008 13:34:46 / 1085687:  0.5658102
+ 13-JAN-2008 13:34:47 / 1085688:  0.5658218
+ 13-JAN-2008 13:34:48 / 1085689:  0.5658333
+ 13-JAN-2008 13:34:49 / 1085690:  0.5658449
+ 13-JAN-2008 13:34:50 / 1085691:  0.5658565
+ 
+can mode ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err672_subscr_precision
+! err672_subscr_precision.jnl
+! See ticket 1888.
+ 
+ 
+def axis/t="1-jan-2008":"31-dec-2010":1/units=sec/t0="1-jan-2008" mytaxis
+let tt = t[gt=mytaxis]
+ 
+! This command should list 11 timesteps, previously listed only 8 (64-bit)
+! or 9 (32-bit).
+list/t="02-JUN-2010:13:34:40":"02-JUN-2010:13:34:50" tt
+             VARIABLE : T[GT=MYTAXIS]
+             SUBSET   : 11 points (TIME)
+ 02-JUN-2010 13:34:40 / 76340081:  7.634E+07
+ 02-JUN-2010 13:34:41 / 76340082:  7.634E+07
+ 02-JUN-2010 13:34:42 / 76340083:  7.634E+07
+ 02-JUN-2010 13:34:43 / 76340084:  7.634E+07
+ 02-JUN-2010 13:34:44 / 76340085:  7.634E+07
+ 02-JUN-2010 13:34:45 / 76340086:  7.634E+07
+ 02-JUN-2010 13:34:46 / 76340087:  7.634E+07
+ 02-JUN-2010 13:34:47 / 76340088:  7.634E+07
+ 02-JUN-2010 13:34:48 / 76340089:  7.634E+07
+ 02-JUN-2010 13:34:49 / 76340090:  7.634E+07
+ 02-JUN-2010 13:34:50 / 76340091:  7.634E+07
+ 
+GO bn_reset
+cancel mode verify
+GO err672_vert_axislabel
+! err672_vert_axislabel.jnl
+! bug 1896
+!
+! When the vertical axis needs a lot of characters
+! in the numeric axis, the axis label runs off the edge
+! of the plot
+ 
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+use gt4d011
+plot/x=130w psi[t=@din]
+ 
+! If the margins are too small the method just makes a nominal setting.
+go margins 0.2 0.6 0.2, 0.2
+plot/i=1:200 (sin(x/30))
+ 
+go margins "reset"
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_label_prec
+! See ticket 1907
+! Axis label format didnt give enough precision for accurate labels
+! for some cases where the range is between -1 and 1.
+ 
+! The upper tic was labeled 0.04 (or 0.05 depending on the OS and compiler)
+! Should be 0.045
+let v = {0.02, 0.047,0.007, 0.02}
+set view left
+plot v
+ 
+! This was a workaround
+set view right
+plot/set v
+ppl yfor (f5.3)
+ppl plot
+ 
+can view
+ 
+! Here are more variables that caused similar
+! inadequate precision in the format.
+ 
+let v = -1*{0.02, 0.042, 0.007, 0.02}
+set view left
+plot v
+ 
+! This one had labels -0.02, -0.02, -0.02, -0.01, -0.01, 0.00, 0.00, 0.1
+let v = {-0.023, -0.01, 0.007, 0.004}
+set view right
+plot v
+ 
+GO bn_reset
+cancel mode verify
+GO err672_long_show_axis
+! See ticket 1905 - axes with very large number of points overflowed
+! the format in SHOW AXIS commands
+ 
+define axis/t=1-jan-1900:1-jan-2000:1/units=minutes huge
+sh axis huge
+ name       axis              # pts   start                end
+ HUGE      TIME          52594561 r   01-JAN-1900 00:00    01-JAN-2000 00:00
+T0 = 01-JAN-1900
+   Axis span (to cell edges) = 52594561
+can axis huge
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_axis_order
+! err672_axis_order
+! See comment 5 under ticket 1774.
+ 
+ 
+use err67_axis_order.nc
+sp cp err67_axis_order.nc err67_axis_order_copy.nc
+use err67_axis_order_copy.nc
+sh dat
+     currently SET data sets:
+    1> ./err67_axis_order.nc
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+    2> ./err67_axis_order_copy.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UCOV     UCOV                             1:6       1:9       1:3       1:1       ...       ...
+ CONTROLE CONTROLE                         1:6       ...       ...       ...       ...       ...
+ NIVSIGS  NIVSIGS                          ...       ...       1:3       ...       ...       ...
+ NIVSIG   NIVSIG                           1:6       ...       ...       ...       ...       ...
+ AP       AP                               1:6       ...       ...       ...       ...       ...
+ 
+ 
+! Listings should be identical with the bug they are reversed.
+list/k=3/i=1 ucov[d=1]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order.nc
+             SUBSET   : 9 points (Y)
+             X        : 1
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+list/k=3/i=1 ucov[d=2]
+             VARIABLE : UCOV
+             FILENAME : err67_axis_order_copy.nc
+             SUBSET   : 9 points (Y)
+             X        : 1
+             Z        : 3
+             TIME     : 08-JAN-1980 00:00
+                1.014  
+                 1
+ -1.554 / 1: -642176.
+ -1.521 / 2: -621550.
+ -1.488 / 3: -700065.
+ -1.455 / 4: -640073.
+ 0.033  / 5: -375011.
+ 1.455  / 6: -153460.
+ 1.488  / 7:   10663.
+ 1.521  / 8:   60693.
+ 1.554  / 9:       0.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_runoff_page
+! err672_runoff_page
+! acm 5/3/2012
+! Test for the fix to ticket 1896 . Y-Axis labels may run off the
+! edge of the page if the numbers have lots of digits.
+! We change the ax-label size just for this axis issue a note.
+!
+! starting w/ v683, shrink yaxis lab size only if
+! MODE shrink_ylab is set. (ticket 1958)
+ 
+SET MODE shrink_ylab
+ 
+define axis/x=1:100:1 xax
+let/units="Observation value" var = 1.e37 * sin(randu(x[gx=xax])-1)
+plot var
+ 
+SET MODE/LAST shrink_ylab
+ 
+GO bn_reset
+cancel mode verify
+GO err672_samplexy_modulo
+! err672_samplexy_modulo.jnl
+! See ticket 1950: samplexy doesnt correctly do modulo operations.
+ 
+use coads_climatology
+! There is data at x=-20,y=0:
+list  sst[x=-20,y=0]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 21W(-21)
+             LATITUDE : 1S
+                   21W    
+                   -20
+ 16-JAN      / 1:  26.91
+ 15-FEB      / 2:  27.39
+ 17-MAR      / 3:  27.85
+ 
+! But samplexy doesn't find it.
+! Previously the last column was all-missing.
+list samplexy(sst,{160,180,-20},{0,0,0})
+             VARIABLE : SAMPLEXY(SST,{160,180,-20},{0,0,0})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  29.09  28.36  26.90
+ 15-FEB      / 2:  29.09  28.38  27.42
+ 17-MAR      / 3:  29.01  28.00  27.87
+ 
+! Check that we get data back at the edges of the longitude axis
+list  samplexy(sst,{21,379},{-41,-41})
+             VARIABLE : SAMPLEXY(SST,{21,379},{-41,-41})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 2 by 3 points (X-TIME)
+                     1      2    
+                     1      2
+ 16-JAN      / 1:  16.45  18.15
+ 15-FEB      / 2:  17.85  17.90
+ 17-MAR      / 3:  17.19  17.11
+ 
+! Check samplexyt
+let t1 = `t[gt=sst,L=1]`
+ !-> DEFINE VARIABLE t1 = 366
+list samplexyt(sst,{160,180,-20},{0,0,0},{`t1`,`t1`,`t1`})
+ !-> list samplexyt(sst,{160,180,-20},{0,0,0},{366,366,366})
+             VARIABLE : SAMPLEXYT(SST,{160,180,-20},{0,0,0},{366,366,366})
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (X)
+ 1   / 1:  29.09
+ 2   / 2:  28.36
+ 3   / 3:  26.90
+ 
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err672_varnames
+! err672_varnames.jnl
+! ticket 1938
+!
+! We can define variable names that match operators,
+! but not use them.
+!   yes? let ne = 5
+!   yes? list ne
+! previously the LET command was allowed but an error on the
+! LIST, (unless we do list 'NE'). Just disallow those names
+! to begin with, in xeq_define. Using these names now returns error
+! AND OR GT GE LT LE EQ NE, also IF and ELSE.
+ 
+SET MODE IGNORE
+ 
+LET AND = 5
+LET OR = 5
+LET GT = 5
+LET GE = 5
+LET LT = 5
+LET LE = 5
+LET EQ = 5
+LET NE = 5
+LET IF  = 5
+LET ELSE = 5
+ 
+CAN MODE IGNORE
+ 
+GO bn_reset
+cancel mode verify
+GO err672_dset_cx
+! err672_dset_cx.jnl
+! Ticket 1951: The dataset specified in list x[gx=a[d=1,i=1:3]] is not applied.
+!
+ 
+let a = x[gx=0:2:1]; save/clob/file=a1.nc a
+sho grid/x a
+    GRID (G008)
+ name       axis              # pts   start                end
+ (AX001)   X                    3 r   0                    2
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  0                     1          -0.5
+       2>  1                     1          0.5
+       3>  2                     1          1.5
+ 
+let a = x[gx=1:3:1]; save/clob/file=a2.nc a
+sho grid/x a
+    GRID (G008)
+ name       axis              # pts   start                end
+ (AX005)   X                    3 r   1                    3
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+       I     X                   XBOX      XBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+ 
+can var/all; can dat/all
+ 
+! It's already strange that the first axis is named AX002 and the second AX001,
+! but oh well. Let's use the first dataset, and list the axis values in two ways
+! that give identical answers. No problem here.
+ 
+use a1
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! Next we use the second dataset, and repeat the exact same commands as above --
+! note that we are again listing the variables from the first dataset, not the
+! second one. Our results shouldn't have changed, since they explicitly refer to
+! dataset 1 -- but one of them does change!
+ 
+use a2
+ 
+list x[gx=a[d=1]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The bug was that this listed 1,2,3 rather than 0,1,2
+list x[gx=a[d=1,i=1:3]]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+ 
+! The second LIST has somehow associated variable A from the first file
+! with AX001 from the second file!
+!
+! The only thing that the second USE should have changed about Ferret's state,
+! was that it brought a new dataset into memory and made it the default. Why should
+! that have affected the second evaluation of the variable from dataset 1?
+ 
+! Why is the following different?
+list x[gx=a[d=1],i=1:3]
+             VARIABLE : X
+                        axis AX001
+             SUBSET   : 3 points (X)
+ 0   / 1:  0.000
+ 1   / 2:  1.000
+ 2   / 3:  2.000
+*** Running test: bn_ifv.jnl
+! bn_ifv.jnl
+! test IFV IfValid masking for a variety of combos
+ 
+ 
+ 
+! operators
+CANCEL REGION
+SET REGION/I=1:5/J=1:5
+ 
+! IF, THEN, ELSE
+LIST/ORDER=X  IFV I GT 3 THEN I
+             VARIABLE : IFV I GT 3 THEN I
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/ORDER=X  IFV I GT 3 THEN I ELSE 0
+             VARIABLE : IFV I GT 3 THEN I ELSE 0
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IFV tests
+SET MODE IGNORE_ERRORS
+LIST/ORDER=X  IFV I GT 3 THEN ( IFV I LT 5 THEN I ELSE -9 ) ELSE .333	! err
+LET A = ifv I LT 5 THEN I ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = ifv I LT 5 THEN I ELSE (-9)
+LIST/ORDER=X  IFV I GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IFV I GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (X)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+CANCEL REGION
+ 
+LET r =  {1,2,0,1,,3,4,5,0,,1}
+LIST r, IF r THEN 1, IFV r THEN 1, IF r THEN 1 ELSE 2, IFV r THEN 1 ELSE 2
+             X: 0.5 to 11.5
+ Column  1: R is {1,2,0,1,,3,4,5,0,,1}
+ Column  2: EX#2 is IF R THEN 1
+ Column  3: EX#3 is IFV R THEN 1
+ Column  4: EX#4 is IF R THEN 1 ELSE 2
+ Column  5: EX#5 is IFV R THEN 1 ELSE 2
+               R   EX#2   EX#3   EX#4   EX#5
+1    /  1:  1.000  1.000  1.000  1.000  1.000
+2    /  2:  2.000  1.000  1.000  1.000  1.000
+3    /  3:  0.000   ....  1.000  2.000  1.000
+4    /  4:  1.000  1.000  1.000  1.000  1.000
+5    /  5:   ....   ....   ....  2.000  2.000
+6    /  6:  3.000  1.000  1.000  1.000  1.000
+7    /  7:  4.000  1.000  1.000  1.000  1.000
+8    /  8:  5.000  1.000  1.000  1.000  1.000
+9    /  9:  0.000   ....  1.000  2.000  1.000
+10   / 10:   ....   ....   ....  2.000  2.000
+11   / 11:  1.000  1.000  1.000  1.000  1.000
+ 
+! Mask with data that has integer values including zero,
+USE coads_climatology
+SET REG/L=1
+LET intvar = INT(sst/5)
+ 
+SET VIEW ul
+SHADE IF intvar THEN 1
+STAT IF intvar THEN 1
+ 
+             IF INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 8780
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+SET VIEW ur
+SHADE IFV intvar THEN 1
+STAT IFV intvar THEN 1
+ 
+             IFV INTVAR THEN 1
+             LONGITUDE: 20E to 20E(380)
+             LATITUDE: 90S to 90N
+             Z:  N/A
+             TIME: 16-JAN 06:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./coads_climatology.cdf
+ 
+ Total # of data points: 16200 (180*90*1*1*1*1)
+ # flagged as bad  data: 6694
+ Minimum value: 1
+ Maximum value: 1
+ Mean    value: 1 (unweighted average)
+ Standard deviation: 0
+ 
+! IFV on string arguments behaves just like IF.
+ 
+LET a = {"x","y"}
+LET b = IF a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IF A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+LET b = IFV a EQ "x" THEN "z" ELSE a
+LIST b
+             VARIABLE : IFV A EQ "x" THEN "z" ELSE A
+             SUBSET   : 2 points (X)
+ 1   / 1:"z"
+ 2   / 2:"y"
+ 
+ 
+let strings = {"a","b",}
+list IF strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IF STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+ 
+let strings = {"a","b",}
+list IFV strings EQ "a" THEN "" ELSE strings
+             VARIABLE : IFV STRINGS EQ "a" THEN "" ELSE STRINGS
+             SUBSET   : 3 points (X)
+ 1   / 1:"" 
+ 2   / 2:"b"
+ 3   / 3:"" 
+*** Running test: bn_randu2_randn2.jnl
+! Test randu2 and randn2 with newer random-number algorithm.
+! 9/2011 acm
+! Note that most of these results will differe from one
+! run of the benchmarks to the next.
+ 
+! Changes to make it easier to see that theser results vary from
+! one run to another because they are calls to random-number functions
+ 
+! 1/2014 *acm* To make it easier to clean up the logs for comparison, write
+! each output line with the text randu2_randn2 at the start of each line.
+ 
+can mode ver
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.099
+randu2_randn2       0.745
+randu2_randn2       0.727
+randu2_randn2       0.806
+randu2_randn2       0.630
+             VARIABLE : RANDU2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2       0.272
+randu2_randn2       0.190
+randu2_randn2       0.167
+randu2_randn2       0.600
+randu2_randn2       0.331
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.279
+randu2_randn2       0.868
+randu2_randn2       0.247
+randu2_randn2       0.991
+randu2_randn2       0.796
+randu2_randn2       0.525
+             VARIABLE : RANDU2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.705
+randu2_randn2       0.528
+randu2_randn2       0.876
+randu2_randn2       0.270
+randu2_randn2       0.039
+randu2_randn2       0.279
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDU2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       0.343
+randu2_randn2       0.598
+randu2_randn2       0.888
+randu2_randn2       0.608
+randu2_randn2       0.446
+randu2_randn2       0.900
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2      -0.753
+randu2_randn2      -1.614
+randu2_randn2       0.231
+randu2_randn2       1.101
+randu2_randn2      -1.611
+             VARIABLE : RANDN2(XBIG,-1)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 5 points (X)
+             X        : 0.5 to 5.5
+randu2_randn2      -0.920
+randu2_randn2       0.032
+randu2_randn2      -0.271
+randu2_randn2       2.174
+randu2_randn2       0.036
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2      -0.505
+randu2_randn2      -0.039
+randu2_randn2       1.500
+randu2_randn2      -0.807
+randu2_randn2      -0.832
+randu2_randn2      -0.095
+             VARIABLE : RANDN2(XX,0)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.362
+randu2_randn2      -1.480
+randu2_randn2      -1.408
+randu2_randn2       0.470
+randu2_randn2       0.966
+randu2_randn2      -2.000
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             VARIABLE : RANDN2(XX,12436)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 6 points (X)
+             X        : 0.5 to 6.5
+randu2_randn2       1.052
+randu2_randn2      -1.694
+randu2_randn2       0.249
+randu2_randn2       0.895
+randu2_randn2       0.919
+randu2_randn2      -0.124
+             Z: 1 to 140
+ Column  1: VAR2 is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1)
+ Column  2: VAR2[Z=@MED:3] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 3 pts on Z)
+ Column  3: VAR2[Z=@MED:9] is COS(Z[GZ=ZAX]/30) + RANDU2(1+K[GZ=ZAX],-1) (median smoothed by 9 pts on Z)
+randu2_randn2       1.081       1.672       0.732
+randu2_randn2       1.672       1.081       0.732
+randu2_randn2       0.732       0.732       0.483
+randu2_randn2       0.483       0.483       0.483
+randu2_randn2      -0.814      -0.312       0.483
+randu2_randn2      -0.312      -0.312       0.483
+randu2_randn2       0.290       0.290       0.483
+randu2_randn2       0.332       0.332       0.483
+*** Running test: bn_axis_cf.jnl
+! Ticket 1792: Write axes with CF-compliant units
+! and with standard name attributes for geophysical attrs.
+ 
+ 
+define axis/x=-10:10:2/units="deg" xax
+let xx = x[gx=xax]
+save/clobber/file=a.nc xx
+ 
+define axis/y=1:15:3/units="degrees" yax
+let yy = y[gy=yax]
+save/append/file=a.nc yy
+ 
+define axis/t="1-jan-2001":"5-jan-2001":1/units="DAYS"/t0="1-jan-2000" taxis
+let tt = t[gt=taxis]
+save/append/file=a.nc tt
+ 
+define axis/z/depth/units="meters" zaxdn = {0,10,40,100}
+let zdn = z[gz=zaxdn]
+save/append/file=a.nc zdn
+ 
+define axis/z/units="meters" zaxup = {0,10,40,100,200}
+let zup = z[gz=zaxup]
+save/append/file=a.nc zup
+ 
+sp echo "bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! If the axis is defined in a file or the command line as
+! having units of "degrees" in any of its forms, write units
+! as the cf-compliant "degrees_east" or "degrees_north"
+! Previously these would have been saved as "DEGREES" and "DEG"
+ 
+use degrees
+sh att/all (`var,return=xaxis`)
+ !-> sh att/all (XAXIS)
+     attributes for dataset: ./degrees.nc
+ (XAXIS).units = degrees_east 
+ (XAXIS).point_spacing = even 
+ (XAXIS).axis = X 
+ (XAXIS).modulo = 360
+ (XAXIS).orig_file_axname = XAXIS 
+save/clobber/file=a.nc var
+ 
+define axis/units="DEG"/y=-90:90:15 yfifteen
+save/append/file=a.nc y[gy=yfifteen]
+ 
+sp echo "bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+! This dataset has time units of "DAYS since ..."
+! On output, downcase the units string.
+ 
+use bn_strides
+sh att/all (TTIME)
+     attributes for dataset: ./bn_strides.cdf
+ (TTIME).units = DAYS since 1901-01-15 00:00:00 
+ (TTIME).time_origin = 15-JAN-1901 
+ (TTIME).point_spacing = even 
+ (TTIME).orig_file_axname = TTIME 
+save/clobber/file=a.nc xytvar
+ 
+sp echo "bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since" >> all_ncdump.out
+sp ncdump -h a.nc >> all_ncdump.out
+ 
+ 
+*** Running test: bn_repeated_coords.jnl
+! Test the use of micro-adjusting on NetCDF read
+! when coordinates are repeated.
+! See ticket 1910
+ 
+! Axis has repeated coordinate values.
+ 
+use repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      TIME                71 i   01-JAN-2001 00:00    01-JAN-2001 01:10
+T0 = 15-JAN-1901 00:00:00
+   Axis span (to cell edges) = 71
+list a[L=1:71:10]
+             VARIABLE : SIN(L[GT=TMIN]/30)
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+! Previous behavior is retained with qualifier /STRICT
+! The listing of variable aa here is identical to what is just above.
+can dat/all
+ 
+use/strict repeat_t_coord.nc
+show grid a
+    GRID GKT1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TMIN      T                   71 r   1                    71
+ normal    E
+ normal    F
+show axis tmin
+ name       axis              # pts   start                end
+ TMIN      T                   71 r   1                    71
+T0 = %%
+   Axis span (to cell edges) = 71
+ 
+define axis/t/t0=15-jan-1901/units=minute tnew = tmin
+let aa = RESHAPE(a, t[gt=tnew])
+list aa[L=1:71:10]
+             VARIABLE : RESHAPE(A, T[GT=TNEW])
+                        regrid: on T
+             FILENAME : repeat_t_coord.nc
+             SUBSET   : 8 points (TIME)
+ 01-JAN-2001 00:00:00 / 1:  0.0333
+ 01-JAN-2001 00:10:00 / 2:  0.3585
+ 01-JAN-2001 00:20:00 / 3:  0.6442
+ 01-JAN-2001 00:30:00 / 4:  0.8590
+ 01-JAN-2001 00:40:00 / 5:  0.9792
+ 01-JAN-2001 00:50:00 / 6:  0.9917
+ 01-JAN-2001 01:00:00 / 7:  0.8949
+ 01-JAN-2001 01:10:00 / 8:  0.6997
+ 
+*** Running test: bn_xml_header.jnl
+! bn_xml_header.jnl
+! run the exact script that LAS uses to make XML header files
+ 
+go xml_header_script.jnl xml_use_coads.jnl xml_out.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_coads.jnl"
+use coads_climatology
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out.xml" </data>
+sp cat xml_out.xml
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<data>
+<datasets>
+<dataset name="./coads_climatology.cdf" default="true">
+<title> </title>
+<var name="SST">
+<attribute name="units" type="char">
+   <value><![CDATA[Deg C]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[SEA SURFACE TEMPERATURE]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="missing_value" type="float">
+   <value>-1.E+34</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<grid name="GSQ1">
+<axes>
+<xaxis>COADSX</xaxis>
+<yaxis>COADSY</yaxis>
+<taxis>TIME</taxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="COADSX">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>180</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>21</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>379</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSX]]></value>
+</attribute>
+</axis>
+<axis name="COADSY">
+<attribute name="direction" type="char">
+   <value><![CDATA[J]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_north]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>90</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>-89</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>89</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value>no</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[COADSY]]></value>
+</attribute>
+</axis>
+<axis name="TIME">
+<attribute name="direction" type="char">
+   <value><![CDATA[L]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[hour since 0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>3</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>0000-01-16 06:00:00</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>0000-03-17 02:58:00</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="time_origin" type="char">
+   <value><![CDATA[0000-01-01 00:00:00]]></value>
+</attribute>
+<attribute name="calendar" type="char">
+   <value><![CDATA[GREGORIAN]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>8765.82</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[DOUBLE]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[TIME]]></value>
+</attribute>
+</axis>
+</axes>
+</data>
+ 
+! Here's one where the dataset has a string variable
+ 
+can dat/all
+ 
+go xml_header_script.jnl xml_use_numstring.jnl xml_out_string.xml
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+ 
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+ 
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ !-> IF 0 THEN
+ENDIF
+ 
+go "$1"
+ !-> go "xml_use_numstring.jnl"
+use numstring
+ 
+DEFINE SYMBOL output_xml_file = $2
+ !-> DEFINE SYMBOL output_xml_file = xml_out_string.xml
+ 
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+ !-> MESSAGE/CONTINUE/quiet/outfile="xml_out_string.xml"/append <data>
+ 
+show data/var/xml/append/outfile="($output_xml_file)" 1
+ !-> show data/var/xml/append/outfile="xml_out_string.xml" 1
+say/quiet/append/outfile="($output_xml_file)" </data>
+ !-> MESSAGE/CONTINUE/quiet/append/outfile="xml_out_string.xml" </data>
+ 
+! Find instances of dimension and list the next several lines
+sp grep -A5 dimension xml_out_string.xml
+<dimension>STRING1_7</dimension>
+<xaxis>XAX1_10</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+--
+<dimensions>
+<dimension name="STRING1_7">
+<attribute name="length" type="short">
+   <value>7</value>
+</attribute>
+</dimension>
+</dimensions>
+</data>
+*** Running test: bn_eof_simple.jnl
+! bn_eof_simple
+! Define a simple function with two known functions.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+ 
+! Define two locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:1:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:59.75:0.25 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a standing wave at each location.
+! The two waves are orthonormal and zero-mean over time.
+let spacetime = if (i eq 1) then cosT else sinT + 1
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    1 r   1                    1
+ normal    Z
+ TAXIS     T                  240 r   0                    59.75
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Run each of the eof functions and show the results.
+! Both are equally significant.  Eigenvalues should be 0.5.
+! Other EOF descriptions do not divide the covariance
+! matrix by the number of time values, in which case the
+! the eigenvalues will be much larger, but still equal
+! to each other.
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 2 by 3 points (X-Y)
+             1      2    
+             1      2
+ 1   / 1:   2.00   2.00
+ 2   / 2:  50.00  50.00
+ 3   / 3:   0.50   0.50
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally the vectors (0.0, sqrt(0.5)) and (sqrt(0.5), 0.0),
+! but might be mixed by rotation.
+! This is if the EOF functions are in units of the original data,
+! thus the eigenvectors times the square-root of the eigenvalue.
+! EOF vectors are always orthogonal to each other.
+list eofsvd_space(spacetime)
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 points (X-T)
+             1       2     
+              1       2
+ 1   / 1:  0.0000 -0.7071
+ 2   / 2: -0.7071  0.0000
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally sqrt(2.0) * (cosT, sinT), but may be mixed by rotation.
+! TAF vectors are always orthogonal to each other.
+list eofsvd_tfunc(spacetime)
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.000 -1.414
+ 0.25  /   2: -0.185 -1.402
+ 0.5   /   3: -0.366 -1.366
+ 0.75  /   4: -0.541 -1.307
+ 1     /   5: -0.707 -1.225
+ 1.25  /   6: -0.861 -1.122
+ 1.5   /   7: -1.000 -1.000
+ 1.75  /   8: -1.122 -0.861
+ 2     /   9: -1.225 -0.707
+ 2.25  /  10: -1.307 -0.541
+ 2.5   /  11: -1.366 -0.366
+ 2.75  /  12: -1.402 -0.185
+ 3     /  13: -1.414  0.000
+ 3.25  /  14: -1.402  0.185
+ 3.5   /  15: -1.366  0.366
+ 3.75  /  16: -1.307  0.541
+ 4     /  17: -1.225  0.707
+ 4.25  /  18: -1.122  0.861
+ 4.5   /  19: -1.000  1.000
+ 4.75  /  20: -0.861  1.122
+ 5     /  21: -0.707  1.225
+ 5.25  /  22: -0.541  1.307
+ 5.5   /  23: -0.366  1.366
+ 5.75  /  24: -0.185  1.402
+ 6     /  25:  0.000  1.414
+ 6.25  /  26:  0.185  1.402
+ 6.5   /  27:  0.366  1.366
+ 6.75  /  28:  0.541  1.307
+ 7     /  29:  0.707  1.225
+ 7.25  /  30:  0.861  1.122
+ 7.5   /  31:  1.000  1.000
+ 7.75  /  32:  1.122  0.861
+ 8     /  33:  1.225  0.707
+ 8.25  /  34:  1.307  0.541
+ 8.5   /  35:  1.366  0.366
+ 8.75  /  36:  1.402  0.185
+ 9     /  37:  1.414  0.000
+ 9.25  /  38:  1.402 -0.185
+ 9.5   /  39:  1.366 -0.366
+ 9.75  /  40:  1.307 -0.541
+ 10    /  41:  1.225 -0.707
+ 10.25 /  42:  1.122 -0.861
+ 10.5  /  43:  1.000 -1.000
+ 10.75 /  44:  0.861 -1.122
+ 11    /  45:  0.707 -1.225
+ 11.25 /  46:  0.541 -1.307
+ 11.5  /  47:  0.366 -1.366
+ 11.75 /  48:  0.185 -1.402
+ 12    /  49:  0.000 -1.414
+ 12.25 /  50: -0.185 -1.402
+ 12.5  /  51: -0.366 -1.366
+ 12.75 /  52: -0.541 -1.307
+ 13    /  53: -0.707 -1.225
+ 13.25 /  54: -0.861 -1.122
+ 13.5  /  55: -1.000 -1.000
+ 13.75 /  56: -1.122 -0.861
+ 14    /  57: -1.225 -0.707
+ 14.25 /  58: -1.307 -0.541
+ 14.5  /  59: -1.366 -0.366
+ 14.75 /  60: -1.402 -0.185
+ 15    /  61: -1.414  0.000
+ 15.25 /  62: -1.402  0.185
+ 15.5  /  63: -1.366  0.366
+ 15.75 /  64: -1.307  0.541
+ 16    /  65: -1.225  0.707
+ 16.25 /  66: -1.122  0.861
+ 16.5  /  67: -1.000  1.000
+ 16.75 /  68: -0.861  1.122
+ 17    /  69: -0.707  1.225
+ 17.25 /  70: -0.541  1.307
+ 17.5  /  71: -0.366  1.366
+ 17.75 /  72: -0.185  1.402
+ 18    /  73:  0.000  1.414
+ 18.25 /  74:  0.185  1.402
+ 18.5  /  75:  0.366  1.366
+ 18.75 /  76:  0.541  1.307
+ 19    /  77:  0.707  1.225
+ 19.25 /  78:  0.861  1.122
+ 19.5  /  79:  1.000  1.000
+ 19.75 /  80:  1.122  0.861
+ 20    /  81:  1.225  0.707
+ 20.25 /  82:  1.307  0.541
+ 20.5  /  83:  1.366  0.366
+ 20.75 /  84:  1.402  0.185
+ 21    /  85:  1.414  0.000
+ 21.25 /  86:  1.402 -0.185
+ 21.5  /  87:  1.366 -0.366
+ 21.75 /  88:  1.307 -0.541
+ 22    /  89:  1.225 -0.707
+ 22.25 /  90:  1.122 -0.861
+ 22.5  /  91:  1.000 -1.000
+ 22.75 /  92:  0.861 -1.122
+ 23    /  93:  0.707 -1.225
+ 23.25 /  94:  0.541 -1.307
+ 23.5  /  95:  0.366 -1.366
+ 23.75 /  96:  0.185 -1.402
+ 24    /  97:  0.000 -1.414
+ 24.25 /  98: -0.185 -1.402
+ 24.5  /  99: -0.366 -1.366
+ 24.75 / 100: -0.541 -1.307
+ 25    / 101: -0.707 -1.225
+ 25.25 / 102: -0.861 -1.122
+ 25.5  / 103: -1.000 -1.000
+ 25.75 / 104: -1.122 -0.861
+ 26    / 105: -1.225 -0.707
+ 26.25 / 106: -1.307 -0.541
+ 26.5  / 107: -1.366 -0.366
+ 26.75 / 108: -1.402 -0.185
+ 27    / 109: -1.414  0.000
+ 27.25 / 110: -1.402  0.185
+ 27.5  / 111: -1.366  0.366
+ 27.75 / 112: -1.307  0.541
+ 28    / 113: -1.225  0.707
+ 28.25 / 114: -1.122  0.861
+ 28.5  / 115: -1.000  1.000
+ 28.75 / 116: -0.861  1.122
+ 29    / 117: -0.707  1.225
+ 29.25 / 118: -0.541  1.307
+ 29.5  / 119: -0.366  1.366
+ 29.75 / 120: -0.185  1.402
+ 30    / 121:  0.000  1.414
+ 30.25 / 122:  0.185  1.402
+ 30.5  / 123:  0.366  1.366
+ 30.75 / 124:  0.541  1.307
+ 31    / 125:  0.707  1.225
+ 31.25 / 126:  0.861  1.122
+ 31.5  / 127:  1.000  1.000
+ 31.75 / 128:  1.122  0.861
+ 32    / 129:  1.225  0.707
+ 32.25 / 130:  1.307  0.541
+ 32.5  / 131:  1.366  0.366
+ 32.75 / 132:  1.402  0.185
+ 33    / 133:  1.414  0.000
+ 33.25 / 134:  1.402 -0.185
+ 33.5  / 135:  1.366 -0.366
+ 33.75 / 136:  1.307 -0.541
+ 34    / 137:  1.225 -0.707
+ 34.25 / 138:  1.122 -0.861
+ 34.5  / 139:  1.000 -1.000
+ 34.75 / 140:  0.861 -1.122
+ 35    / 141:  0.707 -1.225
+ 35.25 / 142:  0.541 -1.307
+ 35.5  / 143:  0.366 -1.366
+ 35.75 / 144:  0.185 -1.402
+ 36    / 145:  0.000 -1.414
+ 36.25 / 146: -0.185 -1.402
+ 36.5  / 147: -0.366 -1.366
+ 36.75 / 148: -0.541 -1.307
+ 37    / 149: -0.707 -1.225
+ 37.25 / 150: -0.861 -1.122
+ 37.5  / 151: -1.000 -1.000
+ 37.75 / 152: -1.122 -0.861
+ 38    / 153: -1.225 -0.707
+ 38.25 / 154: -1.307 -0.541
+ 38.5  / 155: -1.366 -0.366
+ 38.75 / 156: -1.402 -0.185
+ 39    / 157: -1.414  0.000
+ 39.25 / 158: -1.402  0.185
+ 39.5  / 159: -1.366  0.366
+ 39.75 / 160: -1.307  0.541
+ 40    / 161: -1.225  0.707
+ 40.25 / 162: -1.122  0.861
+ 40.5  / 163: -1.000  1.000
+ 40.75 / 164: -0.861  1.122
+ 41    / 165: -0.707  1.225
+ 41.25 / 166: -0.541  1.307
+ 41.5  / 167: -0.366  1.366
+ 41.75 / 168: -0.185  1.402
+ 42    / 169:  0.000  1.414
+ 42.25 / 170:  0.185  1.402
+ 42.5  / 171:  0.366  1.366
+ 42.75 / 172:  0.541  1.307
+ 43    / 173:  0.707  1.225
+ 43.25 / 174:  0.861  1.122
+ 43.5  / 175:  1.000  1.000
+ 43.75 / 176:  1.122  0.861
+ 44    / 177:  1.225  0.707
+ 44.25 / 178:  1.307  0.541
+ 44.5  / 179:  1.366  0.366
+ 44.75 / 180:  1.402  0.185
+ 45    / 181:  1.414  0.000
+ 45.25 / 182:  1.402 -0.185
+ 45.5  / 183:  1.366 -0.366
+ 45.75 / 184:  1.307 -0.541
+ 46    / 185:  1.225 -0.707
+ 46.25 / 186:  1.122 -0.861
+ 46.5  / 187:  1.000 -1.000
+ 46.75 / 188:  0.861 -1.122
+ 47    / 189:  0.707 -1.225
+ 47.25 / 190:  0.541 -1.307
+ 47.5  / 191:  0.366 -1.366
+ 47.75 / 192:  0.185 -1.402
+ 48    / 193:  0.000 -1.414
+ 48.25 / 194: -0.185 -1.402
+ 48.5  / 195: -0.366 -1.366
+ 48.75 / 196: -0.541 -1.307
+ 49    / 197: -0.707 -1.225
+ 49.25 / 198: -0.861 -1.122
+ 49.5  / 199: -1.000 -1.000
+ 49.75 / 200: -1.122 -0.861
+ 50    / 201: -1.225 -0.707
+ 50.25 / 202: -1.307 -0.541
+ 50.5  / 203: -1.366 -0.366
+ 50.75 / 204: -1.402 -0.185
+ 51    / 205: -1.414  0.000
+ 51.25 / 206: -1.402  0.185
+ 51.5  / 207: -1.366  0.366
+ 51.75 / 208: -1.307  0.541
+ 52    / 209: -1.225  0.707
+ 52.25 / 210: -1.122  0.861
+ 52.5  / 211: -1.000  1.000
+ 52.75 / 212: -0.861  1.122
+ 53    / 213: -0.707  1.225
+ 53.25 / 214: -0.541  1.307
+ 53.5  / 215: -0.366  1.366
+ 53.75 / 216: -0.185  1.402
+ 54    / 217:  0.000  1.414
+ 54.25 / 218:  0.185  1.402
+ 54.5  / 219:  0.366  1.366
+ 54.75 / 220:  0.541  1.307
+ 55    / 221:  0.707  1.225
+ 55.25 / 222:  0.861  1.122
+ 55.5  / 223:  1.000  1.000
+ 55.75 / 224:  1.122  0.861
+ 56    / 225:  1.225  0.707
+ 56.25 / 226:  1.307  0.541
+ 56.5  / 227:  1.366  0.366
+ 56.75 / 228:  1.402  0.185
+ 57    / 229:  1.414  0.000
+ 57.25 / 230:  1.402 -0.185
+ 57.5  / 231:  1.366 -0.366
+ 57.75 / 232:  1.307 -0.541
+ 58    / 233:  1.225 -0.707
+ 58.25 / 234:  1.122 -0.861
+ 58.5  / 235:  1.000 -1.000
+ 58.75 / 236:  0.861 -1.122
+ 59    / 237:  0.707 -1.225
+ 59.25 / 238:  0.541 -1.307
+ 59.5  / 239:  0.366 -1.366
+ 59.75 / 240:  0.185 -1.402
+ 
+! The sum over all significant EOFs of the outer product of
+! EOF(i) and TAF(i) should return the zero-time-meaned data
+! (original data with the time-series mean subtracted to give
+! a zero mean for each time series).
+! In this case, EOF(1) o TAF(1) + EOF(2) o TAF(2) = (cosT, sinT)
+ 
+! Missing-data cases
+!
+! If there are locations where the timeseries is all missing or incomplete
+! (as in a dataset where missing data represents land), return a result
+! based only locations with complete timeseries.
+ 
+def axis /X=1:3:1 xaxis
+let spacetime = if (i eq 1) then cosT else sinT + 1
+let space12 = if i ne 3 then spacetime
+ 
+list eofsvd_stat(space12)
+             VARIABLE : EOFSVD_STAT(SPACE12)
+             SUBSET   : 3 by 3 points (X-Y)
+             1      2      3    
+             1      2      3
+ 1   / 1:   2.00   2.00   2.00
+ 2   / 2:  50.00  50.00   0.00
+ 3   / 3:   0.50   0.50   0.00
+list eofsvd_space(space12)
+             VARIABLE : EOFSVD_SPACE(SPACE12)
+             SUBSET   : 3 by 3 points (X-T)
+             1       2       3     
+              1       2       3
+ 1   / 1:  0.0000 -0.7071    ....
+ 2   / 2: -0.7071  0.0000    ....
+ 3   / 3:    ....    ....    ....
+list eofsvd_tfunc(space12)
+             VARIABLE : EOFSVD_TFUNC(SPACE12)
+             SUBSET   : 3 by 240 points (X-T)
+                 1      2      3    
+                 1      2      3
+ 0     /   1:  0.000 -1.414   ....
+ 0.25  /   2: -0.185 -1.402   ....
+ 0.5   /   3: -0.366 -1.366   ....
+ 0.75  /   4: -0.541 -1.307   ....
+ 1     /   5: -0.707 -1.225   ....
+ 1.25  /   6: -0.861 -1.122   ....
+ 1.5   /   7: -1.000 -1.000   ....
+ 1.75  /   8: -1.122 -0.861   ....
+ 2     /   9: -1.225 -0.707   ....
+ 2.25  /  10: -1.307 -0.541   ....
+ 2.5   /  11: -1.366 -0.366   ....
+ 2.75  /  12: -1.402 -0.185   ....
+ 3     /  13: -1.414  0.000   ....
+ 3.25  /  14: -1.402  0.185   ....
+ 3.5   /  15: -1.366  0.366   ....
+ 3.75  /  16: -1.307  0.541   ....
+ 4     /  17: -1.225  0.707   ....
+ 4.25  /  18: -1.122  0.861   ....
+ 4.5   /  19: -1.000  1.000   ....
+ 4.75  /  20: -0.861  1.122   ....
+ 5     /  21: -0.707  1.225   ....
+ 5.25  /  22: -0.541  1.307   ....
+ 5.5   /  23: -0.366  1.366   ....
+ 5.75  /  24: -0.185  1.402   ....
+ 6     /  25:  0.000  1.414   ....
+ 6.25  /  26:  0.185  1.402   ....
+ 6.5   /  27:  0.366  1.366   ....
+ 6.75  /  28:  0.541  1.307   ....
+ 7     /  29:  0.707  1.225   ....
+ 7.25  /  30:  0.861  1.122   ....
+ 7.5   /  31:  1.000  1.000   ....
+ 7.75  /  32:  1.122  0.861   ....
+ 8     /  33:  1.225  0.707   ....
+ 8.25  /  34:  1.307  0.541   ....
+ 8.5   /  35:  1.366  0.366   ....
+ 8.75  /  36:  1.402  0.185   ....
+ 9     /  37:  1.414  0.000   ....
+ 9.25  /  38:  1.402 -0.185   ....
+ 9.5   /  39:  1.366 -0.366   ....
+ 9.75  /  40:  1.307 -0.541   ....
+ 10    /  41:  1.225 -0.707   ....
+ 10.25 /  42:  1.122 -0.861   ....
+ 10.5  /  43:  1.000 -1.000   ....
+ 10.75 /  44:  0.861 -1.122   ....
+ 11    /  45:  0.707 -1.225   ....
+ 11.25 /  46:  0.541 -1.307   ....
+ 11.5  /  47:  0.366 -1.366   ....
+ 11.75 /  48:  0.185 -1.402   ....
+ 12    /  49:  0.000 -1.414   ....
+ 12.25 /  50: -0.185 -1.402   ....
+ 12.5  /  51: -0.366 -1.366   ....
+ 12.75 /  52: -0.541 -1.307   ....
+ 13    /  53: -0.707 -1.225   ....
+ 13.25 /  54: -0.861 -1.122   ....
+ 13.5  /  55: -1.000 -1.000   ....
+ 13.75 /  56: -1.122 -0.861   ....
+ 14    /  57: -1.225 -0.707   ....
+ 14.25 /  58: -1.307 -0.541   ....
+ 14.5  /  59: -1.366 -0.366   ....
+ 14.75 /  60: -1.402 -0.185   ....
+ 15    /  61: -1.414  0.000   ....
+ 15.25 /  62: -1.402  0.185   ....
+ 15.5  /  63: -1.366  0.366   ....
+ 15.75 /  64: -1.307  0.541   ....
+ 16    /  65: -1.225  0.707   ....
+ 16.25 /  66: -1.122  0.861   ....
+ 16.5  /  67: -1.000  1.000   ....
+ 16.75 /  68: -0.861  1.122   ....
+ 17    /  69: -0.707  1.225   ....
+ 17.25 /  70: -0.541  1.307   ....
+ 17.5  /  71: -0.366  1.366   ....
+ 17.75 /  72: -0.185  1.402   ....
+ 18    /  73:  0.000  1.414   ....
+ 18.25 /  74:  0.185  1.402   ....
+ 18.5  /  75:  0.366  1.366   ....
+ 18.75 /  76:  0.541  1.307   ....
+ 19    /  77:  0.707  1.225   ....
+ 19.25 /  78:  0.861  1.122   ....
+ 19.5  /  79:  1.000  1.000   ....
+ 19.75 /  80:  1.122  0.861   ....
+ 20    /  81:  1.225  0.707   ....
+ 20.25 /  82:  1.307  0.541   ....
+ 20.5  /  83:  1.366  0.366   ....
+ 20.75 /  84:  1.402  0.185   ....
+ 21    /  85:  1.414  0.000   ....
+ 21.25 /  86:  1.402 -0.185   ....
+ 21.5  /  87:  1.366 -0.366   ....
+ 21.75 /  88:  1.307 -0.541   ....
+ 22    /  89:  1.225 -0.707   ....
+ 22.25 /  90:  1.122 -0.861   ....
+ 22.5  /  91:  1.000 -1.000   ....
+ 22.75 /  92:  0.861 -1.122   ....
+ 23    /  93:  0.707 -1.225   ....
+ 23.25 /  94:  0.541 -1.307   ....
+ 23.5  /  95:  0.366 -1.366   ....
+ 23.75 /  96:  0.185 -1.402   ....
+ 24    /  97:  0.000 -1.414   ....
+ 24.25 /  98: -0.185 -1.402   ....
+ 24.5  /  99: -0.366 -1.366   ....
+ 24.75 / 100: -0.541 -1.307   ....
+ 25    / 101: -0.707 -1.225   ....
+ 25.25 / 102: -0.861 -1.122   ....
+ 25.5  / 103: -1.000 -1.000   ....
+ 25.75 / 104: -1.122 -0.861   ....
+ 26    / 105: -1.225 -0.707   ....
+ 26.25 / 106: -1.307 -0.541   ....
+ 26.5  / 107: -1.366 -0.366   ....
+ 26.75 / 108: -1.402 -0.185   ....
+ 27    / 109: -1.414  0.000   ....
+ 27.25 / 110: -1.402  0.185   ....
+ 27.5  / 111: -1.366  0.366   ....
+ 27.75 / 112: -1.307  0.541   ....
+ 28    / 113: -1.225  0.707   ....
+ 28.25 / 114: -1.122  0.861   ....
+ 28.5  / 115: -1.000  1.000   ....
+ 28.75 / 116: -0.861  1.122   ....
+ 29    / 117: -0.707  1.225   ....
+ 29.25 / 118: -0.541  1.307   ....
+ 29.5  / 119: -0.366  1.366   ....
+ 29.75 / 120: -0.185  1.402   ....
+ 30    / 121:  0.000  1.414   ....
+ 30.25 / 122:  0.185  1.402   ....
+ 30.5  / 123:  0.366  1.366   ....
+ 30.75 / 124:  0.541  1.307   ....
+ 31    / 125:  0.707  1.225   ....
+ 31.25 / 126:  0.861  1.122   ....
+ 31.5  / 127:  1.000  1.000   ....
+ 31.75 / 128:  1.122  0.861   ....
+ 32    / 129:  1.225  0.707   ....
+ 32.25 / 130:  1.307  0.541   ....
+ 32.5  / 131:  1.366  0.366   ....
+ 32.75 / 132:  1.402  0.185   ....
+ 33    / 133:  1.414  0.000   ....
+ 33.25 / 134:  1.402 -0.185   ....
+ 33.5  / 135:  1.366 -0.366   ....
+ 33.75 / 136:  1.307 -0.541   ....
+ 34    / 137:  1.225 -0.707   ....
+ 34.25 / 138:  1.122 -0.861   ....
+ 34.5  / 139:  1.000 -1.000   ....
+ 34.75 / 140:  0.861 -1.122   ....
+ 35    / 141:  0.707 -1.225   ....
+ 35.25 / 142:  0.541 -1.307   ....
+ 35.5  / 143:  0.366 -1.366   ....
+ 35.75 / 144:  0.185 -1.402   ....
+ 36    / 145:  0.000 -1.414   ....
+ 36.25 / 146: -0.185 -1.402   ....
+ 36.5  / 147: -0.366 -1.366   ....
+ 36.75 / 148: -0.541 -1.307   ....
+ 37    / 149: -0.707 -1.225   ....
+ 37.25 / 150: -0.861 -1.122   ....
+ 37.5  / 151: -1.000 -1.000   ....
+ 37.75 / 152: -1.122 -0.861   ....
+ 38    / 153: -1.225 -0.707   ....
+ 38.25 / 154: -1.307 -0.541   ....
+ 38.5  / 155: -1.366 -0.366   ....
+ 38.75 / 156: -1.402 -0.185   ....
+ 39    / 157: -1.414  0.000   ....
+ 39.25 / 158: -1.402  0.185   ....
+ 39.5  / 159: -1.366  0.366   ....
+ 39.75 / 160: -1.307  0.541   ....
+ 40    / 161: -1.225  0.707   ....
+ 40.25 / 162: -1.122  0.861   ....
+ 40.5  / 163: -1.000  1.000   ....
+ 40.75 / 164: -0.861  1.122   ....
+ 41    / 165: -0.707  1.225   ....
+ 41.25 / 166: -0.541  1.307   ....
+ 41.5  / 167: -0.366  1.366   ....
+ 41.75 / 168: -0.185  1.402   ....
+ 42    / 169:  0.000  1.414   ....
+ 42.25 / 170:  0.185  1.402   ....
+ 42.5  / 171:  0.366  1.366   ....
+ 42.75 / 172:  0.541  1.307   ....
+ 43    / 173:  0.707  1.225   ....
+ 43.25 / 174:  0.861  1.122   ....
+ 43.5  / 175:  1.000  1.000   ....
+ 43.75 / 176:  1.122  0.861   ....
+ 44    / 177:  1.225  0.707   ....
+ 44.25 / 178:  1.307  0.541   ....
+ 44.5  / 179:  1.366  0.366   ....
+ 44.75 / 180:  1.402  0.185   ....
+ 45    / 181:  1.414  0.000   ....
+ 45.25 / 182:  1.402 -0.185   ....
+ 45.5  / 183:  1.366 -0.366   ....
+ 45.75 / 184:  1.307 -0.541   ....
+ 46    / 185:  1.225 -0.707   ....
+ 46.25 / 186:  1.122 -0.861   ....
+ 46.5  / 187:  1.000 -1.000   ....
+ 46.75 / 188:  0.861 -1.122   ....
+ 47    / 189:  0.707 -1.225   ....
+ 47.25 / 190:  0.541 -1.307   ....
+ 47.5  / 191:  0.366 -1.366   ....
+ 47.75 / 192:  0.185 -1.402   ....
+ 48    / 193:  0.000 -1.414   ....
+ 48.25 / 194: -0.185 -1.402   ....
+ 48.5  / 195: -0.366 -1.366   ....
+ 48.75 / 196: -0.541 -1.307   ....
+ 49    / 197: -0.707 -1.225   ....
+ 49.25 / 198: -0.861 -1.122   ....
+ 49.5  / 199: -1.000 -1.000   ....
+ 49.75 / 200: -1.122 -0.861   ....
+ 50    / 201: -1.225 -0.707   ....
+ 50.25 / 202: -1.307 -0.541   ....
+ 50.5  / 203: -1.366 -0.366   ....
+ 50.75 / 204: -1.402 -0.185   ....
+ 51    / 205: -1.414  0.000   ....
+ 51.25 / 206: -1.402  0.185   ....
+ 51.5  / 207: -1.366  0.366   ....
+ 51.75 / 208: -1.307  0.541   ....
+ 52    / 209: -1.225  0.707   ....
+ 52.25 / 210: -1.122  0.861   ....
+ 52.5  / 211: -1.000  1.000   ....
+ 52.75 / 212: -0.861  1.122   ....
+ 53    / 213: -0.707  1.225   ....
+ 53.25 / 214: -0.541  1.307   ....
+ 53.5  / 215: -0.366  1.366   ....
+ 53.75 / 216: -0.185  1.402   ....
+ 54    / 217:  0.000  1.414   ....
+ 54.25 / 218:  0.185  1.402   ....
+ 54.5  / 219:  0.366  1.366   ....
+ 54.75 / 220:  0.541  1.307   ....
+ 55    / 221:  0.707  1.225   ....
+ 55.25 / 222:  0.861  1.122   ....
+ 55.5  / 223:  1.000  1.000   ....
+ 55.75 / 224:  1.122  0.861   ....
+ 56    / 225:  1.225  0.707   ....
+ 56.25 / 226:  1.307  0.541   ....
+ 56.5  / 227:  1.366  0.366   ....
+ 56.75 / 228:  1.402  0.185   ....
+ 57    / 229:  1.414  0.000   ....
+ 57.25 / 230:  1.402 -0.185   ....
+ 57.5  / 231:  1.366 -0.366   ....
+ 57.75 / 232:  1.307 -0.541   ....
+ 58    / 233:  1.225 -0.707   ....
+ 58.25 / 234:  1.122 -0.861   ....
+ 58.5  / 235:  1.000 -1.000   ....
+ 58.75 / 236:  0.861 -1.122   ....
+ 59    / 237:  0.707 -1.225   ....
+ 59.25 / 238:  0.541 -1.307   ....
+ 59.5  / 239:  0.366 -1.366   ....
+ 59.75 / 240:  0.185 -1.402   ....
+ 
+ 
+! If there are no complete time series, the functions should bail with an error
+ 
+let spacegap = if L ne 2 then spacetime
+ 
+set mode ignore
+list eofsvd_stat(spacegap)
+list eofsvd_space(spacegap)
+list eofsvd_tfunc(spacegap)
+ 
+! clean-up
+set mode/last ignore
+can var spacetime
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+ 
+exit/script
+*** Running test: bn_eof_simple2.jnl
+! bn_eof_simple2
+! Define a simple function with four known functions, two of which are degenerate.
+! decompose with EOFs.
+! 7/2012
+! In version 6.8 (double precision), the old eof functions are not available
+! Run the script calling eofsvd functions and exit, leaving old eof function calls.
+ 
+! Define four locations.
+def axis /X=1:2:1 xaxis
+def axis /Y=1:2:1 yaxis
+ 
+! Thinking of the time axis as number of months.
+def axis /T=0.0:23.9:0.1 taxis
+def grid /X=xaxis /Y=yaxis /T=taxis xytgrid
+set grid xytgrid
+ 
+! Make standing waves with a period of 12 months.
+let cosT = cos(T * 3.141592653589793 / 6.0)
+let sinT = sin(T * 3.141592653589793 / 6.0)
+ 
+! Put a products of the standing waves at each location.
+let spacetime12 = if (i eq 1) and (j eq 1) then cost * cost else cost * sint + 1
+let spacetime123 = if (i eq 2) and (j eq 1) then cost * sint + 2 else spacetime12
+let spacetime = if (i eq 2) and (j eq 2) then sint * sint + 3 else spacetime123
+show grid spacetime
+    GRID XYTGRID
+ name       axis              # pts   start                end
+ XAXIS     X                    2 r   1                    2
+ YAXIS     Y                    2 r   1                    2
+ normal    Z
+ TAXIS     T                  240 r   0                    23.9
+ normal    E
+ normal    F
+ 
+show func eofsvd_stat
+EOFSVD_STAT(A)
+    SVD EOF statistics from XYT field. j=1:#EOFs, j=2:%variation, j=3:eigenvalues
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Two are of equal significance with eigenvalues of 0.25.
+! Two are negligable (eigenvalues of zero or close to it).
+list eofsvd_stat(spacetime)
+             VARIABLE : EOFSVD_STAT(SPACETIME)
+             SUBSET   : 4 by 3 points (X-Y)
+             1      2      3      4    
+             1      2      3      4
+ 1   / 1:   4.00   4.00   4.00   4.00
+ 2   / 2:  50.00  50.00   0.00   0.00
+ 3   / 3:   0.25   0.25   0.00   0.00
+ 
+show func eofsvd_space
+EOFSVD_SPACE(A)
+    Return SVD EOF spacial fields from XYT field
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- [ 0.35355,  0.0,
+!      0.0,     -0.35355 ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * (cosT^2 - sinT^2)
+!                     = 0.25 * sqrt(2.0) * cos2T
+! and
+! +- [ 0.0,      0.35355,
+!      0.35355,  0.0     ]  (norm^2 = 0.25)
+!      corresponding to 0.25 * sqrt(2.0) * 2 * cosT * sinT
+!                     = 0.25 * sqrt(2.0) * sin2T
+! The norm^2 of an EOF should be the eigenvalue.
+! The two EOFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let eofs = eofsvd_space(spacetime)
+! T axis of eofsvd_space is abstract, so following uses full spacetime
+list eofs[L=1:2]
+             VARIABLE : EOFSVD_SPACE(SPACETIME)
+             SUBSET   : 2 by 2 by 2 points (X-Y-T)
+             1       2     
+              1       2
+ ---- L:1 T:   1
+ 1   / 1:  0.0635 -0.3478
+ 2   / 2: -0.3478 -0.0635
+ ---- L:2 T:   2
+ 1   / 1:  0.3478  0.0635
+ 2   / 2:  0.0635 -0.3478
+ 
+show func eofsvd_tfunc
+EOFSVD_TFUNC(A)
+    Return SVD EOF time functions from XYT field.
+    A: Variable in x,y,t; may be fcn of z,e,f
+! Ideally:
+! +- sqrt(2.0) * cos2T  (norm^2 = 240)
+! +- sqrt(2.0) * sin2T  (norm^2 = 240)
+! The norm^2 of a TAF should be the number of time values.
+! The two TAFs should be orthogonal to each other.
+! Rotation (mixing) of these two may occur.
+let tafs = eofsvd_tfunc(spacetime)
+! X axis of eofsvd_tfunc is abstract, so following uses full spacetime
+list tafs[I=1:2]
+             VARIABLE : EOFSVD_TFUNC(SPACETIME)
+             SUBSET   : 2 by 240 points (X-T)
+                 1      2    
+                 1      2
+ 0     /   1:  0.254  1.391
+ 0.1   /   2:  0.107  1.410
+ 0.2   /   3: -0.041  1.414
+ 0.3   /   4: -0.188  1.402
+ 0.4   /   5: -0.334  1.374
+ 0.5   /   6: -0.476  1.332
+ 0.6   /   7: -0.612  1.275
+ 0.7   /   8: -0.742  1.204
+ 0.8   /   9: -0.864  1.120
+ 0.9   /  10: -0.976  1.023
+ 1     /  11: -1.078  0.916
+ 1.1   /  12: -1.168  0.798
+ 1.2   /  13: -1.245  0.672
+ 1.3   /  14: -1.308  0.538
+ 1.4   /  15: -1.357  0.398
+ 1.5   /  16: -1.391  0.254
+ 1.6   /  17: -1.410  0.107
+ 1.7   /  18: -1.414 -0.041
+ 1.8   /  19: -1.402 -0.188
+ 1.9   /  20: -1.374 -0.334
+ 2     /  21: -1.332 -0.476
+ 2.1   /  22: -1.275 -0.612
+ 2.2   /  23: -1.204 -0.742
+ 2.3   /  24: -1.120 -0.864
+ 2.4   /  25: -1.023 -0.976
+ 2.5   /  26: -0.916 -1.078
+ 2.6   /  27: -0.798 -1.168
+ 2.7   /  28: -0.672 -1.245
+ 2.8   /  29: -0.538 -1.308
+ 2.9   /  30: -0.398 -1.357
+ 3     /  31: -0.254 -1.391
+ 3.1   /  32: -0.107 -1.410
+ 3.2   /  33:  0.041 -1.414
+ 3.3   /  34:  0.188 -1.402
+ 3.4   /  35:  0.334 -1.374
+ 3.5   /  36:  0.476 -1.332
+ 3.6   /  37:  0.612 -1.275
+ 3.7   /  38:  0.742 -1.204
+ 3.8   /  39:  0.864 -1.120
+ 3.9   /  40:  0.976 -1.023
+ 4     /  41:  1.078 -0.916
+ 4.1   /  42:  1.168 -0.798
+ 4.2   /  43:  1.245 -0.672
+ 4.3   /  44:  1.308 -0.538
+ 4.4   /  45:  1.357 -0.398
+ 4.5   /  46:  1.391 -0.254
+ 4.6   /  47:  1.410 -0.107
+ 4.7   /  48:  1.414  0.041
+ 4.8   /  49:  1.402  0.188
+ 4.9   /  50:  1.374  0.334
+ 5     /  51:  1.332  0.476
+ 5.1   /  52:  1.275  0.612
+ 5.2   /  53:  1.204  0.742
+ 5.3   /  54:  1.120  0.864
+ 5.4   /  55:  1.023  0.976
+ 5.5   /  56:  0.916  1.078
+ 5.6   /  57:  0.798  1.168
+ 5.7   /  58:  0.672  1.245
+ 5.8   /  59:  0.538  1.308
+ 5.9   /  60:  0.398  1.357
+ 6     /  61:  0.254  1.391
+ 6.1   /  62:  0.107  1.410
+ 6.2   /  63: -0.041  1.414
+ 6.3   /  64: -0.188  1.402
+ 6.4   /  65: -0.334  1.374
+ 6.5   /  66: -0.476  1.332
+ 6.6   /  67: -0.612  1.275
+ 6.7   /  68: -0.742  1.204
+ 6.8   /  69: -0.864  1.120
+ 6.9   /  70: -0.976  1.023
+ 7     /  71: -1.078  0.916
+ 7.1   /  72: -1.168  0.798
+ 7.2   /  73: -1.245  0.672
+ 7.3   /  74: -1.308  0.538
+ 7.4   /  75: -1.357  0.398
+ 7.5   /  76: -1.391  0.254
+ 7.6   /  77: -1.410  0.107
+ 7.7   /  78: -1.414 -0.041
+ 7.8   /  79: -1.402 -0.188
+ 7.9   /  80: -1.374 -0.334
+ 8     /  81: -1.332 -0.476
+ 8.1   /  82: -1.275 -0.612
+ 8.2   /  83: -1.204 -0.742
+ 8.3   /  84: -1.120 -0.864
+ 8.4   /  85: -1.023 -0.976
+ 8.5   /  86: -0.916 -1.078
+ 8.6   /  87: -0.798 -1.168
+ 8.7   /  88: -0.672 -1.245
+ 8.8   /  89: -0.538 -1.308
+ 8.9   /  90: -0.398 -1.357
+ 9     /  91: -0.254 -1.391
+ 9.1   /  92: -0.107 -1.410
+ 9.2   /  93:  0.041 -1.414
+ 9.3   /  94:  0.188 -1.402
+ 9.4   /  95:  0.334 -1.374
+ 9.5   /  96:  0.476 -1.332
+ 9.6   /  97:  0.612 -1.275
+ 9.7   /  98:  0.742 -1.204
+ 9.8   /  99:  0.864 -1.120
+ 9.9   / 100:  0.976 -1.023
+ 10    / 101:  1.078 -0.916
+ 10.1  / 102:  1.168 -0.798
+ 10.2  / 103:  1.245 -0.672
+ 10.3  / 104:  1.308 -0.538
+ 10.4  / 105:  1.357 -0.398
+ 10.5  / 106:  1.391 -0.254
+ 10.6  / 107:  1.410 -0.107
+ 10.7  / 108:  1.414  0.041
+ 10.8  / 109:  1.402  0.188
+ 10.9  / 110:  1.374  0.334
+ 11    / 111:  1.332  0.476
+ 11.1  / 112:  1.275  0.612
+ 11.2  / 113:  1.204  0.742
+ 11.3  / 114:  1.120  0.864
+ 11.4  / 115:  1.023  0.976
+ 11.5  / 116:  0.916  1.078
+ 11.6  / 117:  0.798  1.168
+ 11.7  / 118:  0.672  1.245
+ 11.8  / 119:  0.538  1.308
+ 11.9  / 120:  0.398  1.357
+ 12    / 121:  0.254  1.391
+ 12.1  / 122:  0.107  1.410
+ 12.2  / 123: -0.041  1.414
+ 12.3  / 124: -0.188  1.402
+ 12.4  / 125: -0.334  1.374
+ 12.5  / 126: -0.476  1.332
+ 12.6  / 127: -0.612  1.275
+ 12.7  / 128: -0.742  1.204
+ 12.8  / 129: -0.864  1.120
+ 12.9  / 130: -0.976  1.023
+ 13    / 131: -1.078  0.916
+ 13.1  / 132: -1.168  0.798
+ 13.2  / 133: -1.245  0.672
+ 13.3  / 134: -1.308  0.538
+ 13.4  / 135: -1.357  0.398
+ 13.5  / 136: -1.391  0.254
+ 13.6  / 137: -1.410  0.107
+ 13.7  / 138: -1.414 -0.041
+ 13.8  / 139: -1.402 -0.188
+ 13.9  / 140: -1.374 -0.334
+ 14    / 141: -1.332 -0.476
+ 14.1  / 142: -1.275 -0.612
+ 14.2  / 143: -1.204 -0.742
+ 14.3  / 144: -1.120 -0.864
+ 14.4  / 145: -1.023 -0.976
+ 14.5  / 146: -0.916 -1.078
+ 14.6  / 147: -0.798 -1.168
+ 14.7  / 148: -0.672 -1.245
+ 14.8  / 149: -0.538 -1.308
+ 14.9  / 150: -0.398 -1.357
+ 15    / 151: -0.254 -1.391
+ 15.1  / 152: -0.107 -1.410
+ 15.2  / 153:  0.041 -1.414
+ 15.3  / 154:  0.188 -1.402
+ 15.4  / 155:  0.334 -1.374
+ 15.5  / 156:  0.476 -1.332
+ 15.6  / 157:  0.612 -1.275
+ 15.7  / 158:  0.742 -1.204
+ 15.8  / 159:  0.864 -1.120
+ 15.9  / 160:  0.976 -1.023
+ 16    / 161:  1.078 -0.916
+ 16.1  / 162:  1.168 -0.798
+ 16.2  / 163:  1.245 -0.672
+ 16.3  / 164:  1.308 -0.538
+ 16.4  / 165:  1.357 -0.398
+ 16.5  / 166:  1.391 -0.254
+ 16.6  / 167:  1.410 -0.107
+ 16.7  / 168:  1.414  0.041
+ 16.8  / 169:  1.402  0.188
+ 16.9  / 170:  1.374  0.334
+ 17    / 171:  1.332  0.476
+ 17.1  / 172:  1.275  0.612
+ 17.2  / 173:  1.204  0.742
+ 17.3  / 174:  1.120  0.864
+ 17.4  / 175:  1.023  0.976
+ 17.5  / 176:  0.916  1.078
+ 17.6  / 177:  0.798  1.168
+ 17.7  / 178:  0.672  1.245
+ 17.8  / 179:  0.538  1.308
+ 17.9  / 180:  0.398  1.357
+ 18    / 181:  0.254  1.391
+ 18.1  / 182:  0.107  1.410
+ 18.2  / 183: -0.041  1.414
+ 18.3  / 184: -0.188  1.402
+ 18.4  / 185: -0.334  1.374
+ 18.5  / 186: -0.476  1.332
+ 18.6  / 187: -0.612  1.275
+ 18.7  / 188: -0.742  1.204
+ 18.8  / 189: -0.864  1.120
+ 18.9  / 190: -0.976  1.023
+ 19    / 191: -1.078  0.916
+ 19.1  / 192: -1.168  0.798
+ 19.2  / 193: -1.245  0.672
+ 19.3  / 194: -1.308  0.538
+ 19.4  / 195: -1.357  0.398
+ 19.5  / 196: -1.391  0.254
+ 19.6  / 197: -1.410  0.107
+ 19.7  / 198: -1.414 -0.041
+ 19.8  / 199: -1.402 -0.188
+ 19.9  / 200: -1.374 -0.334
+ 20    / 201: -1.332 -0.476
+ 20.1  / 202: -1.275 -0.612
+ 20.2  / 203: -1.204 -0.742
+ 20.3  / 204: -1.120 -0.864
+ 20.4  / 205: -1.023 -0.976
+ 20.5  / 206: -0.916 -1.078
+ 20.6  / 207: -0.798 -1.168
+ 20.7  / 208: -0.672 -1.245
+ 20.8  / 209: -0.538 -1.308
+ 20.9  / 210: -0.398 -1.357
+ 21    / 211: -0.254 -1.391
+ 21.1  / 212: -0.107 -1.410
+ 21.2  / 213:  0.041 -1.414
+ 21.3  / 214:  0.188 -1.402
+ 21.4  / 215:  0.334 -1.374
+ 21.5  / 216:  0.476 -1.332
+ 21.6  / 217:  0.612 -1.275
+ 21.7  / 218:  0.742 -1.204
+ 21.8  / 219:  0.864 -1.120
+ 21.9  / 220:  0.976 -1.023
+ 22    / 221:  1.078 -0.916
+ 22.1  / 222:  1.168 -0.798
+ 22.2  / 223:  1.245 -0.672
+ 22.3  / 224:  1.308 -0.538
+ 22.4  / 225:  1.357 -0.398
+ 22.5  / 226:  1.391 -0.254
+ 22.6  / 227:  1.410 -0.107
+ 22.7  / 228:  1.414  0.041
+ 22.8  / 229:  1.402  0.188
+ 22.9  / 230:  1.374  0.334
+ 23    / 231:  1.332  0.476
+ 23.1  / 232:  1.275  0.612
+ 23.2  / 233:  1.204  0.742
+ 23.3  / 234:  1.120  0.864
+ 23.4  / 235:  1.023  0.976
+ 23.5  / 236:  0.916  1.078
+ 23.6  / 237:  0.798  1.168
+ 23.7  / 238:  0.672  1.245
+ 23.8  / 239:  0.538  1.308
+ 23.9  / 240:  0.398  1.357
+ 
+! Explanation:
+! Time series means = (0.5, 0.0, 0.0, 0.5) + (0, 1, 2, 3)
+! EOF1 * TAF1 = (0.5 * cos2T,  0.0, 0.0, -0.5 * cos2T)
+!             = (cosT^2 - 0.5, 0.0, 0.0, sinT^2 - 0.5)
+! EOF2 * TAF2 = (0.0, 0.5 * sin2T, 0.5 * sin2T, 0.0)
+!             = (0.0, cosT * sinT, cosT * sinT, 0.0)
+! Adding these three gives the original data
+ 
+! clean-up
+can var tafs
+can var eofs
+can var spacetime
+can var spacetime123
+can var spacetime12
+set grid abstract
+can grid xytgrid
+can axis taxis
+can axis yaxis
+can axis xaxis
+ 
+exit/script
+*** Running test: bn_interpolate_6d.jnl
+! bn_interpolate_6d.JNL
+! benchmark interpolation along various axes
+! including the E and F axis
+ 
+SET LIST/PRECISION=6
+SET MODE LATITUDE:4
+ 
+LET v = x + 10*y + 100*_e + 1000*_f
+SET REGION/X=1:3/Y=1:3/E=1:3/F=1:3
+DEF REG/X=1.5 xpt
+DEF REG/Y=1.05 ypt
+DEF REG/E=1.005 ept
+DEF REG/F=1.0005 fpt
+ 
+! first without interpolation
+CANCEL MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2121.00  2131.00
+ 2   / 2:  2211.00  2221.00  2231.00
+ 3   / 3:  2311.00  2321.00  2331.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3121.00  3131.00
+ 2   / 2:  3211.00  3221.00  3231.00
+ 3   / 3:  3311.00  3321.00  3331.00
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2211.00  2212.00  2213.00
+ 3   / 3:  2311.00  2312.00  2313.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3211.00  3212.00  3213.00
+ 3   / 3:  3311.00  3312.00  3313.00
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- N:2 F:   2
+ 1   / 1:  2111.00  2112.00  2113.00
+ 2   / 2:  2121.00  2122.00  2123.00
+ 3   / 3:  2131.00  2132.00  2133.00
+ ---- N:3 F:   3
+ 1   / 1:  3111.00  3112.00  3113.00
+ 2   / 2:  3121.00  3122.00  3123.00
+ 3   / 3:  3131.00  3132.00  3133.00
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+ ---- M:2 E:   2
+ 1   / 1:  1211.00  1212.00  1213.00
+ 2   / 2:  1221.00  1222.00  1223.00
+ 3   / 3:  1231.00  1232.00  1233.00
+ ---- M:3 E:   3
+ 1   / 1:  1311.00  1312.00  1313.00
+ 2   / 2:  1321.00  1322.00  1323.00
+ 3   / 3:  1331.00  1332.00  1333.00
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1121.00  1122.00  1123.00
+ 3   / 3:  1131.00  1132.00  1133.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  1211.00  1212.00  1213.00
+ 3   / 3:  1311.00  1312.00  1313.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1112.00  1113.00
+ 2   / 2:  2111.00  2112.00  2113.00
+ 3   / 3:  3111.00  3112.00  3113.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1
+             F        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  1211.00  1221.00  1231.00
+ 3   / 3:  1311.00  1321.00  1331.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1
+             E        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1121.00  1131.00
+ 2   / 2:  2111.00  2121.00  2131.00
+ 3   / 3:  3111.00  3121.00  3131.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1
+             Y        : 1
+              1        2        3     
+              1        2        3
+ 1   / 1:  1111.00  1211.00  1311.00
+ 2   / 2:  2111.00  2211.00  2311.00
+ 3   / 3:  3111.00  3211.00  3311.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1
+             Y        : 1
+             E        : 1
+             1        2        3     
+             1        2        3
+          1111.00  2111.00  3111.00
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1
+             Y        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1211.00  1311.00
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1121.00  1131.00
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1
+             E        : 1
+             F        : 1
+             1        2        3     
+             1        2        3
+          1111.00  1112.00  1113.00
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1
+             Y        : 1
+             E        : 1
+             F        : 1
+          1111.00
+ 
+! then with interpolation
+SET MODE INTERPOLATE
+GO bn_interpolate_6d.sub
+! bn_interpolate_6d.SUB
+! interpolate in various geometries
+ 
+! this routine assumes that a 4-D region and an expression are already set
+ 
+! cubes of data
+LIST v[@xpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (Y-E-F)
+             X        : 1.5 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1121.50  1131.50
+ 2   / 2:  1211.50  1221.50  1231.50
+ 3   / 3:  1311.50  1321.50  1331.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2121.50  2131.50
+ 2   / 2:  2211.50  2221.50  2231.50
+ 3   / 3:  2311.50  2321.50  2331.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3121.50  3131.50
+ 2   / 2:  3211.50  3221.50  3231.50
+ 3   / 3:  3311.50  3321.50  3331.50
+LIST v[@ypt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-E-F)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1211.50  1212.50  1213.50
+ 3   / 3:  1311.50  1312.50  1313.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2211.50  2212.50  2213.50
+ 3   / 3:  2311.50  2312.50  2313.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3211.50  3212.50  3213.50
+ 3   / 3:  3311.50  3312.50  3313.50
+LIST v[@ept]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-F)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- N:1 F:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- N:2 F:   2
+ 1   / 1:  2111.50  2112.50  2113.50
+ 2   / 2:  2121.50  2122.50  2123.50
+ 3   / 3:  2131.50  2132.50  2133.50
+ ---- N:3 F:   3
+ 1   / 1:  3111.50  3112.50  3113.50
+ 2   / 2:  3121.50  3122.50  3123.50
+ 3   / 3:  3131.50  3132.50  3133.50
+LIST v[@fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 by 3 points (X-Y-E)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ ---- M:1 E:   1
+ 1   / 1:  1111.50  1112.50  1113.50
+ 2   / 2:  1121.50  1122.50  1123.50
+ 3   / 3:  1131.50  1132.50  1133.50
+ ---- M:2 E:   2
+ 1   / 1:  1211.50  1212.50  1213.50
+ 2   / 2:  1221.50  1222.50  1223.50
+ 3   / 3:  1231.50  1232.50  1233.50
+ ---- M:3 E:   3
+ 1   / 1:  1311.50  1312.50  1313.50
+ 2   / 2:  1321.50  1322.50  1323.50
+ 3   / 3:  1331.50  1332.50  1333.50
+ 
+! planes of data
+LIST v[@ept, at fpt]	!XY
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-Y)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1122.00  1123.00  1124.00
+ 3   / 3:  1132.00  1133.00  1134.00
+LIST v[@ypt, at fpt]	!XE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-E)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  1212.00  1213.00  1214.00
+ 3   / 3:  1312.00  1313.00  1314.00
+LIST v[@ypt, at ept]	!XF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (X-F)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1113.00  1114.00
+ 2   / 2:  2112.00  2113.00  2114.00
+ 3   / 3:  3112.00  3113.00  3114.00
+LIST v[@xpt, at fpt]	!YE
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-E)
+             X        : 1.5 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  1212.00  1222.00  1232.00
+ 3   / 3:  1312.00  1322.00  1332.00
+LIST v[@xpt, at ept]	!YF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (Y-F)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1122.00  1132.00
+ 2   / 2:  2112.00  2122.00  2132.00
+ 3   / 3:  3112.00  3122.00  3132.00
+LIST v[@xpt, at ypt]	!EF
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 by 3 points (E-F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+              1        2        3     
+              1        2        3
+ 1   / 1:  1112.00  1212.00  1312.00
+ 2   / 2:  2112.00  2212.00  2312.00
+ 3   / 3:  3112.00  3212.00  3312.00
+ 
+! lines of data
+LIST/ORDER=F v[@xpt, at ypt, at ept]	! F
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (F)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  2112.50  3112.50
+LIST/ORDER=E v[@xpt, at ypt, at fpt]	! E
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (E)
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1212.50  1312.50
+LIST/ORDER=Y v[@xpt, at ept, at fpt]	! Y
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (Y)
+             X        : 1.5 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1122.50  1132.50
+LIST/ORDER=X v[@ypt, at ept, at fpt]	! X
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             SUBSET   : 3 points (X)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+             1        2        3     
+             1        2        3
+          1112.50  1113.50  1114.50
+ 
+! point of data
+LIST v[@xpt, at ypt, at ept, at fpt]
+             VARIABLE : X + 10*Y + 100*_E + 1000*_F
+             X        : 1.5 (interpolated)
+             Y        : 1.05 (interpolated)
+             E        : 1.00499999999999989 (interpolated)
+             F        : 1.000499999999999945 (interpolated)
+          1113.00
+*** Running test: bn_regrid_6d.jnl
+! bn_regrid_6d.jnl
+! version of bn_regrid, using E and F directions.
+ 
+set mode latit_label -4
+set mode long_label -4
+ 
+define axis/x=2:20:2 xeven
+define axis/x=1:19:2 xodd
+define axis/y=2:20:2 yeven
+define axis/y=1:19:2 yodd
+define axis/e=2:20:2 eeven
+define axis/e=1:19:2 eodd
+define axis/f=2:20:2/t0="1-jan-1980"/unit=days feven
+define axis/f=1:19:2/t0="1-jan-1980"/unit=days fodd
+ 
+! default grid
+define grid/x=xeven/y=yeven/e=eeven/f=feven even
+ 
+! 1 axis different
+define grid/x=xodd/y=yeven/e=eeven/f=feven g1
+define grid/x=xeven/y=yodd/e=eeven/f=feven g2
+define grid/x=xeven/y=yeven/e=eodd/f=feven g3
+define grid/x=xeven/y=yeven/e=eeven/f=fodd g4
+ 
+! 2 axes different
+define grid/x=xodd/y=yodd/e=eeven/f=feven g12
+define grid/x=xodd/y=yeven/e=eodd/f=feven g13
+define grid/x=xodd/y=yeven/e=eeven/f=fodd g14
+define grid/x=xeven/y=yodd/e=eodd/f=feven g23
+define grid/x=xeven/y=yodd/e=eeven/f=fodd g24
+define grid/x=xeven/y=yeven/e=eodd/f=fodd g33
+ 
+! 3 axes different
+define grid/x=xeven/y=yodd/e=eodd/f=fodd g234
+define grid/x=xodd/y=yeven/e=eodd/f=fodd g134
+define grid/x=xodd/y=yodd/e=eeven/f=fodd g124
+define grid/x=xodd/y=yodd/e=eodd/f=feven g123
+ 
+! all axes different
+define grid/x=xodd/y=yodd/e=eodd/f=fodd g1234
+ 
+LET veven = 1000*i[g=even] + 100*j[g=even] + 10*_m[g=even] + _n[g=even]
+ 
+LET v1    = veven[g=g1]
+LET v2    = veven[g=g2]
+LET v3    = veven[g=g3]
+LET v4    = veven[g=g4]
+LET v12   = veven[g=g12]
+LET v13   = veven[g=g13]
+LET v14   = veven[g=g14]
+LET v23   = veven[g=g23]
+LET v24   = veven[g=g24]
+LET v33   = veven[g=g33]
+LET v234  = veven[g=g234]
+LET v134  = veven[g=g134]
+LET v124  = veven[g=g124]
+LET v123  = veven[g=g123]
+LET v1234 = veven[g=g1234]
+ 
+SET REGION/X=4.01:8.99/Y=4.01:8.99/e=4.01:8.99/f=4.01:8.99
+ 
+! background
+list veven
+             VARIABLE : 1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+             4      6      8    
+             2      3      4
+ ---- N:2 F:   05-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2222.  3222.  4222.
+ 6   / 3:  2322.  3322.  4322.
+ 8   / 4:  2422.  3422.  4422.
+ ---- M:3 E:   6
+ 4   / 2:  2232.  3232.  4232.
+ 6   / 3:  2332.  3332.  4332.
+ 8   / 4:  2432.  3432.  4432.
+ ---- M:4 E:   8
+ 4   / 2:  2242.  3242.  4242.
+ 6   / 3:  2342.  3342.  4342.
+ 8   / 4:  2442.  3442.  4442.
+ ---- N:3 F:   07-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2223.  3223.  4223.
+ 6   / 3:  2323.  3323.  4323.
+ 8   / 4:  2423.  3423.  4423.
+ ---- M:3 E:   6
+ 4   / 2:  2233.  3233.  4233.
+ 6   / 3:  2333.  3333.  4333.
+ 8   / 4:  2433.  3433.  4433.
+ ---- M:4 E:   8
+ 4   / 2:  2243.  3243.  4243.
+ 6   / 3:  2343.  3343.  4343.
+ 8   / 4:  2443.  3443.  4443.
+ ---- N:4 F:   09-JAN-1980 00:00:00
+ ---- M:2 E:   4
+ 4   / 2:  2224.  3224.  4224.
+ 6   / 3:  2324.  3324.  4324.
+ 8   / 4:  2424.  3424.  4424.
+ ---- M:3 E:   6
+ 4   / 2:  2234.  3234.  4234.
+ 6   / 3:  2334.  3334.  4334.
+ 8   / 4:  2434.  3434.  4434.
+ ---- M:4 E:   8
+ 4   / 2:  2244.  3244.  4244.
+ 6   / 3:  2344.  3344.  4344.
+ 8   / 4:  2444.  3444.  4444.
+list v1234
+             VARIABLE : VEVEN[G=G1234]
+             SUBSET   : 3 by 3 by 3 by 3 points (X-Y-E-FORECAST)
+             5      7      9    
+             3      4      5
+ ---- N:3 F:   06-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2778.  3778.  4778.
+ 7   / 4:  2878.  3878.  4878.
+ 9   / 5:  2978.  3978.  4978.
+ ---- M:4 E:   7
+ 5   / 3:  2788.  3788.  4788.
+ 7   / 4:  2888.  3888.  4888.
+ 9   / 5:  2988.  3988.  4988.
+ ---- M:5 E:   9
+ 5   / 3:  2798.  3798.  4798.
+ 7   / 4:  2898.  3898.  4898.
+ 9   / 5:  2998.  3998.  4998.
+ ---- N:4 F:   08-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2779.  3779.  4779.
+ 7   / 4:  2879.  3879.  4879.
+ 9   / 5:  2979.  3979.  4979.
+ ---- M:4 E:   7
+ 5   / 3:  2789.  3789.  4789.
+ 7   / 4:  2889.  3889.  4889.
+ 9   / 5:  2989.  3989.  4989.
+ ---- M:5 E:   9
+ 5   / 3:  2799.  3799.  4799.
+ 7   / 4:  2899.  3899.  4899.
+ 9   / 5:  2999.  3999.  4999.
+ ---- N:5 F:   10-JAN-1980 00:00:00
+ ---- M:3 E:   5
+ 5   / 3:  2780.  3780.  4780.
+ 7   / 4:  2880.  3880.  4880.
+ 9   / 5:  2980.  3980.  4980.
+ ---- M:4 E:   7
+ 5   / 3:  2790.  3790.  4790.
+ 7   / 4:  2890.  3890.  4890.
+ 9   / 5:  2990.  3990.  4990.
+ ---- M:5 E:   9
+ 5   / 3:  2800.  3800.  4800.
+ 7   / 4:  2900.  3900.  4900.
+ 9   / 5:  3000.  4000.  5000.
+stat veven
+ 
+             1000*I[G=EVEN] + 100*J[G=EVEN] + 10*_M[G=EVEN] + _N[G=EVEN]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222
+ Maximum value: 4444
+ Mean    value: 3333 (unweighted average)
+ Standard deviation: 825.72
+ 
+! first all from one memory variable
+load/x=1:11/y=1:11/e=1:11/f=1:11 veven
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+! and now with recalculations at every step
+CANCEL MEMORY/ALL
+SET MODE STUPID
+GO bn_regrid.sub
+! BN200_REGRID.SUB
+! compare various regriddings to the original data
+ 
+stat v1[g=even]-veven, v1
+ 
+             V1[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722
+ Maximum value: 4944
+ Mean    value: 3833 (unweighted average)
+ Standard deviation: 825.72
+stat v2[g=even]-veven, v2
+ 
+             V2[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G2]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272
+ Maximum value: 4494
+ Mean    value: 3383 (unweighted average)
+ Standard deviation: 825.72
+stat v3[g=even]-veven, v3
+ 
+             V3[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G3]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227
+ Maximum value: 4449
+ Mean    value: 3338 (unweighted average)
+ Standard deviation: 825.72
+stat v4[g=even]-veven, v4
+ 
+             V4[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G4]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2222.5
+ Maximum value: 4444.5
+ Mean    value: 3333.5 (unweighted average)
+ Standard deviation: 825.72
+stat v12[g=even]-veven, v12
+ 
+             V12[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G12]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772
+ Maximum value: 4994
+ Mean    value: 3883 (unweighted average)
+ Standard deviation: 825.72
+stat v13[g=even]-veven, v13
+ 
+             V13[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G13]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727
+ Maximum value: 4949
+ Mean    value: 3838 (unweighted average)
+ Standard deviation: 825.72
+stat v14[g=even]-veven, v14
+ 
+             V14[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G14]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2722.5
+ Maximum value: 4944.5
+ Mean    value: 3833.5 (unweighted average)
+ Standard deviation: 825.72
+stat v23[g=even]-veven, v23
+ 
+             V23[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G23]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277
+ Maximum value: 4499
+ Mean    value: 3388 (unweighted average)
+ Standard deviation: 825.72
+stat v24[g=even]-veven, v24
+ 
+             V24[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G24]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2272.5
+ Maximum value: 4494.5
+ Mean    value: 3383.5 (unweighted average)
+ Standard deviation: 825.72
+stat v33[g=even]-veven, v33
+ 
+             V33[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G33]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2227.5
+ Maximum value: 4449.5
+ Mean    value: 3338.5 (unweighted average)
+ Standard deviation: 825.72
+stat v234[g=even]-veven, v234
+ 
+             V234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2277.5
+ Maximum value: 4499.5
+ Mean    value: 3388.5 (unweighted average)
+ Standard deviation: 825.72
+stat v134[g=even]-veven, v134
+ 
+             V134[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G134]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2727.5
+ Maximum value: 4949.5
+ Mean    value: 3838.5 (unweighted average)
+ Standard deviation: 825.72
+stat v124[g=even]-veven, v124
+ 
+             V124[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G124]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2772.5
+ Maximum value: 4994.5
+ Mean    value: 3883.5 (unweighted average)
+ Standard deviation: 825.72
+stat v123[g=even]-veven, v123
+ 
+             V123[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G123]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777
+ Maximum value: 4999
+ Mean    value: 3888 (unweighted average)
+ Standard deviation: 825.72
+stat v1234[g=even]-veven, v1234
+ 
+             V1234[G=EVEN]-VEVEN
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 0
+ Maximum value: 0
+ Mean    value: 0 (unweighted average)
+ Standard deviation: 0
+ 
+             VEVEN[G=G1234]
+             X: 4.01 to 8.99
+             Y: 4.01 to 8.99
+             Z:  N/A
+             T:  N/A
+             E: 4.0099999999999998 to 8.9900000000000002
+             FORECAST: 05-JAN-1980 00:14:24 to 09-JAN-1980 23:4
+             DATA SET: N/A
+ 
+ Total # of data points: 81 (3*3*1*1*3*3)
+ # flagged as bad  data: 0
+ Minimum value: 2777.5
+ Maximum value: 4999.5
+ Mean    value: 3888.5 (unweighted average)
+ Standard deviation: 825.72
+ 
+!****************** area-averaging regrids *******************
+! check easily computable area-averaged regrid
+LET vfine = X+Y
+LET vcoarse = vfine[g=gcoarse]
+ 
+! first test without COS(latitude) corrections
+define axis/x=1:100:1/unit=cm xfine
+define axis/x=5.5:95.5:10/unit=cm xcoarse
+define axis/y=1:100:1/unit=cm yfine
+define axis/y=5.5:95.5:10/unit=cm ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (X (CM)-Y (CM))
+             25.5   35.5   45.5   55.5   65.5   75.5  
+              3      4      5      6      7      8
+ 25.5 / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+ 35.5 / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 45.5 / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 55.5 / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 65.5 / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 75.5 / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             X (CM): 20.5 to 80.5
+             Y (CM): 20.5 to 80.5
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             X (CM): 20.5 to 80.5 (XY ave)
+             Y (CM): 20.5 to 80.5 (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      101.0  101.0
+ 
+! then test with COS(latitude) corrections
+define axis/x=1:100:1/unit=degrees xfine
+define axis/x=5.5:95.5:10/unit=degrees xcoarse
+define axis/y=1:100:1/unit=degrees yfine
+define axis/y=5.5:95.5:10/unit=degrees ycoarse
+define grid/x=xfine/y=yfine gfine
+define grid/x=xcoarse/y=ycoarse gcoarse
+ 
+set grid gfine
+set reg/x=20.5:80.5/y=20.5:80.5
+list vcoarse
+             VARIABLE : VFINE[G=GCOARSE]
+             SUBSET   : 6 by 6 points (LONGITUDE-LATITUDE)
+              25.5E  35.5E  45.5E  55.5E  65.5E  75.5E 
+               3      4      5      6      7      8
+ 75.5N / 8:  101.0  111.0  121.0  131.0  141.0  151.0
+ 65.5N / 7:   91.0  101.0  111.0  121.0  131.0  141.0
+ 55.5N / 6:   81.0   91.0  101.0  111.0  121.0  131.0
+ 45.5N / 5:   71.0   81.0   91.0  101.0  111.0  121.0
+ 35.5N / 4:   61.0   71.0   81.0   91.0  101.0  111.0
+ 25.5N / 3:   51.0   61.0   71.0   81.0   91.0  101.0
+stat vcoarse,vfine
+ 
+             VFINE[G=GCOARSE]
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 36 (6*6*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 51
+ Maximum value: 151
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+ 
+             X+Y
+             LONGITUDE: 20.5E to 80.5E
+             LATITUDE: 20.5N to 80.5N
+             Z:  N/A
+             T:  N/A
+             E:  N/A
+             F:  N/A
+             DATA SET: N/A
+ 
+ Total # of data points: 3600 (60*60*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 42
+ Maximum value: 160
+ Mean    value: 101 (unweighted average)
+ Standard deviation: 24.495
+list vcoarse[x=@ave,y=@ave],vfine[x=@ave,y=@ave]
+             LONGITUDE: 20.5E to 80.5E (XY ave)
+             LATITUDE: 20.5N to 80.5N (XY ave)
+ Column  1: VCOARSE is VFINE[G=GCOARSE]
+ Column  2: VFINE is X+Y
+         VCOARSE   VFINE
+I / *:      94.71  94.53
+ 
+!****************** F axis regridding *******************
+define axis/f="1-jan-1980":"1-jan-1982":24/t0="1-jan-1970" fax24
+define axis/f="1-jan-1980":"1-jan-1982":48/t0="1-jan-1920" fax48
+define grid/f=fax24 g24
+define grid/f=fax48 g48
+show grid/N=1:4 g24 g48
+    GRID G24
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX24     FORECAST           732 r   01-JAN-1980 00:00    01-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  24         31-DEC-1979 12:00:00   87648
+       2>  02-JAN-1980 00:00:00  24         01-JAN-1980 12:00:00   87672
+       3>  03-JAN-1980 00:00:00  24         02-JAN-1980 12:00:00   87696
+       4>  04-JAN-1980 00:00:00  24         03-JAN-1980 12:00:00   87720
+    GRID G48
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ FAX48     FORECAST           367 r   01-JAN-1980 00:00    02-JAN-1982 00:00
+ 
+       N     F                   FBOX      FBOXLO                TSTEP (HOURS)
+       1>  01-JAN-1980 00:00:00  48         31-DEC-1979 00:00:00   525960
+       2>  03-JAN-1980 00:00:00  48         02-JAN-1980 00:00:00   526008
+       3>  05-JAN-1980 00:00:00  48         04-JAN-1980 00:00:00   526056
+       4>  07-JAN-1980 00:00:00  48         06-JAN-1980 00:00:00   526104
+set region/F="1-jan-1980":"8-jan-1980"
+let a24 = _F[g=g24]
+let a48 = _F[g=g48]
+list a24
+             VARIABLE : _F[G=G24]
+             SUBSET   : 8 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.
+ 02-JAN-1980 00 / 2:  87672.
+ 03-JAN-1980 00 / 3:  87696.
+ 04-JAN-1980 00 / 4:  87720.
+ 05-JAN-1980 00 / 5:  87744.
+ 06-JAN-1980 00 / 6:  87768.
+ 07-JAN-1980 00 / 7:  87792.
+ 08-JAN-1980 00 / 8:  87816.
+list a48
+             VARIABLE : _F[G=G48]
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  525960.
+ 03-JAN-1980 00 / 2:  526008.
+ 05-JAN-1980 00 / 3:  526056.
+ 07-JAN-1980 00 / 4:  526104.
+ 
+list a24[g=g48]
+             VARIABLE : _F[G=G24]
+                        regrid: G48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1:  87648.
+ 03-JAN-1980 00 / 2:  87696.
+ 05-JAN-1980 00 / 3:  87744.
+ 07-JAN-1980 00 / 4:  87792.
+list a24[g=g48]-a48
+             VARIABLE : A24[G=G48]-A48
+             SUBSET   : 4 points (FORECAST)
+ 01-JAN-1980 00 / 1: -438312.
+ 03-JAN-1980 00 / 2: -438312.
+ 05-JAN-1980 00 / 3: -438312.
+ 07-JAN-1980 00 / 4: -438312.
+ 
+*** Running test: bn_syntax_6d.jnl
+! bn_syntax_6d.JNL
+! - test syntax interpretation of Program FERRET 6D
+ 
+! SET - SHOW - CANCEL DATA
+ 
+! 6D file based on gtbc011
+USE 6dfile
+ 
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+LIST/I=1:2/J=50/K=1/L=2/M=3/N=4 SALT
+             VARIABLE : (SALINITY(ppt) - 35) /1000 (frac. by wt. less .035)
+             FILENAME : 6dfile.nc
+             SUBSET   : 2 points (LONGITUDE)
+             LATITUDE : 6.2N
+             DEPTH (m): 5
+             TIME     : 15-MAR-1983 11:00
+             E        : 3
+             F        : 7
+               6.17N 
+               50
+ 160.5W / 1:  3.700
+ 159.5W / 2:  3.700
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SET GRID/SAVE
+SET GRID ABSTRACT
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid GNJ2
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+SHOW GRID/X=180:165W SALT
+    GRID GNJ2
+ name       axis              # pts   start                end
+ PSXT70_71 LONGITUDE            2mr   160.5W               159.5W
+ PSYT15_75 LATITUDE            61 i   10.169S              9.833N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME      TIME                 3 r   15-MAR-1983 10:00    15-MAR-1983 12:00
+ EAXIS     E                    5 r   1                    5
+ FAXIS     F                    4 r   1                    7
+ 
+       I     X                   XBOX      XBOXLO
+       0>  20E                   358        159W(-159)
+SET GRID/RESTORE
+SHOW GRID
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ 
+can dat/all
+ 
+! nested brackets (7/95 - version 4.01)
+use 6dfile,gt4d011
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1]
+ 
+             TEMPERATURE
+             LONGITUDE: 158.5W
+             LATITUDE: 2.8N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.97
+ Maximum value: 34.97
+ Mean    value: 34.97 (unweighted average)
+stat/k=1/l=1/j=40/i=3/M=3/N=4/d=2 temp[d=1,g=u]
+ 
+             TEMPERATURE
+             regrid: U
+             LONGITUDE: 159W
+             LATITUDE: 3N
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 3
+             F: 7
+             DATA SET: ./6dfile.nc
+ 
+ Total # of data points: 1 (1*1*1*1*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 34.962
+ Maximum value: 34.962
+ Mean    value: 34.962 (unweighted average)
+ 
+! a common example: continuation for REPEAT loops
+repeat/M=1:3 (cancel data/all;\
+show data;\
+let a = _m;\
+list/nohead a;\
+cancel variables/all;\
+)
+!-> REPEAT: M=1
+     currently SET data sets:
+          1.000
+!-> REPEAT: M=2
+     currently SET data sets:
+          2.000
+!-> REPEAT: M=3
+     currently SET data sets:
+          3.000
+*** Running test: bn_expressions_6d.jnl
+! bn_expressions_6d.jnl
+! testing expressions syntax in E and F directions.
+! Note pseudo-variables are _E,
+ 
+! test grid creation for a variety of combos
+let c1 = 2
+let m1 = _m
+let n1 = _n
+ 
+! ... constant plus variable or pseudovariable
+set reg/m=1:3
+list/order=e _m + 2
+             VARIABLE : _M + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + _m
+             VARIABLE : 2 + _M
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1 + 2
+             VARIABLE : M1 + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + m1
+             VARIABLE : 2 + M1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + c1
+             VARIABLE : _M + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + _m
+             VARIABLE : C1 + _M
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1 + c1
+             VARIABLE : M1 + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + m1
+             VARIABLE : C1 + M1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... constant plus variable or pseudovariable with modified region
+set reg/m=11:13
+list/order=e _m[m=1:3] + 2
+             VARIABLE : _M[M=1:3] + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + _m[m=1:3]
+             VARIABLE : 2 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1[m=1:3] + 2
+             VARIABLE : M1[M=1:3] + 2
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e 2 + m1[m=1:3]
+             VARIABLE : 2 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m[m=1:3] + c1
+             VARIABLE : _M[M=1:3] + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + _m[m=1:3]
+             VARIABLE : C1 + _M[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e m1[m=1:3] + c1
+             VARIABLE : M1[M=1:3] + C1
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e c1 + m1[m=1:3]
+             VARIABLE : C1 + M1[M=1:3]
+             SUBSET   : 3 points (E)
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables
+set reg/m=1:3/n=2
+list/order=e _m + _n
+             VARIABLE : _M + _N
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + n1
+             VARIABLE : _M + N1
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e n1 + _m
+             VARIABLE : N1 + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! ... two variables or pseudovariables with modified region
+set reg/m=1:3/n=1
+list/order=e _m + _n[n=2]
+             VARIABLE : _M + _N[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e _m + n1[n=2]
+             VARIABLE : _M + N1[N=2]
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+list/order=e n1[n=2] + _m
+             VARIABLE : N1[N=2] + _M
+             SUBSET   : 3 points (E)
+             F        : 2
+            1      2      3    
+            1      2      3
+          3.000  4.000  5.000
+ 
+! operators
+CANCEL REGION
+SET REGION/m=1:5/n=1:5
+LIST 10+2
+             VARIABLE : 10+2
+          12.00
+LIST/order=e  _m
+             VARIABLE : _M
+                        axis ABSTRACT
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  _m*3
+             VARIABLE : _M*3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+           3.00   6.00   9.00  12.00  15.00
+LIST/order=e  _m/3
+             VARIABLE : _M/3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/order=e  _m+3
+             VARIABLE : _M+3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          4.000  5.000  6.000  7.000  8.000
+LIST/order=e  _m-3
+             VARIABLE : _M-3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000  0.000  1.000  2.000
+LIST/order=e  _m^3
+             VARIABLE : _M^3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+            1.0    8.0   27.0   64.0  125.0
+LIST/order=e  _m EQ 3
+             VARIABLE : _M EQ 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/order=e  _m NE 3
+             VARIABLE : _M NE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/order=e  _m GT 3
+             VARIABLE : _M GT 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  1.000  1.000
+LIST/order=e  _m GE 3
+             VARIABLE : _M GE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/order=e  _m LT 3
+             VARIABLE : _M LT 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  0.000  0.000
+LIST/order=e  _m LE 3
+             VARIABLE : _M LE 3
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  1.000  0.000  0.000
+LIST/order=e  (_m LT 3) OR (_m GT 3)
+             VARIABLE : (_M LT 3) OR (_M GT 3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  1.000  0.000  1.000  1.000
+LIST/order=e  (_m LE 3) AND (_m GE 3)
+             VARIABLE : (_M LE 3) AND (_M GE 3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  0.000  0.000
+LIST/order=e  (_m+3)*3 - 9 - (_m+_m+_m)
+             VARIABLE : (_M+3)*3 - 9 - (_M+_M+_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.0000  0.0000  0.0000  0.0000
+LIST/order=e  _n * ( (_m+3)*3 - 9 - (_m+_m+_m) )
+             VARIABLE : _N * ( (_M+3)*3 - 9 - (_M+_M+_M) )
+             SUBSET   : 5 by 5 points (E-F)
+            1       2       3       4       5     
+             1       2       3       4       5
+ ---- N:1 F:   1
+ N:1 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:2 F:   2
+ N:2 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:3 F:   3
+ N:3 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:4 F:   4
+ N:4 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ ---- N:5 F:   5
+ N:5 F:   0.0000  0.0000  0.0000  0.0000  0.0000
+ 
+! IF, THEN, ELSE
+LIST/order=e  IF _m GT 3 THEN _m
+             VARIABLE : IF _M GT 3 THEN _M
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+           ....   ....   ....  4.000  5.000
+LIST/order=e  IF _m GT 3 THEN _m ELSE 0
+             VARIABLE : IF _M GT 3 THEN _M ELSE 0
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  0.000  4.000  5.000
+! error: nested IF tests
+SET MODE IGNORE_ERRORS
+LIST/order=e  IF _m GT 3 THEN ( IF _m LT 5 THEN _m ELSE -9 ) ELSE .333	! err
+LET A = IF _m LT 5 THEN _m ELSE -9					! err
+SET MODE/LAST IGNORE_ERRORS
+LET A = IF _m LT 5 THEN _m ELSE (-9)
+LIST/order=e  IF _m GT 3 THEN ( A ) ELSE .333
+             VARIABLE : IF _M GT 3 THEN ( A ) ELSE .333
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.333  0.333  4.000 -9.000
+ 
+! functions
+LIST/order=e  MAX(_m,3)
+             VARIABLE : MAX(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          3.000  3.000  3.000  4.000  5.000
+LIST/order=e  MIN(_m,3)
+             VARIABLE : MIN(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  3.000  3.000
+LIST/order=e  INT(_m/3)
+             VARIABLE : INT(_M/3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.000  1.000  1.000  1.000
+LIST/order=e  ABS(_m-3)
+             VARIABLE : ABS(_M-3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          2.000  1.000  0.000  1.000  2.000
+LIST/order=e  EXP(_m)
+             VARIABLE : EXP(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+            2.7    7.4   20.1   54.6  148.4
+LIST/order=e  LN(_m)
+             VARIABLE : LN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.000  0.693  1.099  1.386  1.609
+LIST/order=e  LN(EXP(_m))
+             VARIABLE : LN(EXP(_M))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  EXP(LN(_m))
+             VARIABLE : EXP(LN(_M))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  LOG(_m)
+             VARIABLE : LOG(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.0000  0.3010  0.4771  0.6021  0.6990
+LIST/order=e  LOG(10^_m)
+             VARIABLE : LOG(10^_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  10^LOG(_m)
+             VARIABLE : 10^LOG(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  3.000  4.000  5.000
+LIST/order=e  SIN(_m)
+             VARIABLE : SIN(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.8415  0.9093  0.1411 -0.7568 -0.9589
+LIST/order=e  ASIN(SIN(_m/3))
+             VARIABLE : ASIN(SIN(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.475
+LIST/order=e  COS(_m)
+             VARIABLE : COS(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.5403 -0.4161 -0.9900 -0.6536  0.2837
+LIST/order=e  ACOS(COS(_m/3))
+             VARIABLE : ACOS(COS(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333  1.667
+LIST/order=e  TAN(_m)
+             VARIABLE : TAN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.557 -2.185 -0.143  1.158 -3.381
+LIST/order=e  ATAN(TAN(_m/3))
+             VARIABLE : ATAN(TAN(_M/3))
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          0.333  0.667  1.000  1.333 -1.475
+LIST/n=1:3    ATAN2(_n-1,_m-1)
+             VARIABLE : ATAN2(_N-1,_M-1)
+             SUBSET   : 5 by 3 points (E-F)
+             1      2      3      4      5    
+             1      2      3      4      5
+ 1   / 1:   ....  0.000  0.000  0.000  0.000
+ 2   / 2:  1.571  0.785  0.464  0.322  0.245
+ 3   / 3:  1.571  1.107  0.785  0.588  0.464
+LIST/order=e  MOD(_m,3)
+             VARIABLE : MOD(_M,3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+          1.000  2.000  0.000  1.000  2.000
+LIST/order=e  IGNORE0(_m-3)
+             VARIABLE : IGNORE0(_M-3)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000   ....  1.000  2.000
+LIST/order=e  MISSING( IGNORE0(_m-3),-9 )
+             VARIABLE : MISSING( IGNORE0(_M-3),-9 )
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -2.000 -1.000 -9.000  1.000  2.000
+LIST/order=e  RANDU(_m)
+             VARIABLE : RANDU(_M)
+             SUBSET   : 5 points (E)
+            1       2       3       4       5     
+             1       2       3       4       5
+          0.3376  0.7238  0.0304  0.8499  0.1694
+LIST/order=e  RANDN(_m)
+             VARIABLE : RANDN(_M)
+             SUBSET   : 5 points (E)
+            1      2      3      4      5    
+            1      2      3      4      5
+         -0.267  0.283 -0.323  1.217 -0.304
+ 
+! syntax errors
+SET MODE IGNORE_ERRORS
+load a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21
+SET MODE/LAST IGNORE_ERRORS
+ 
+! test formatted output where the output field is too small
+LIST/m=1:3/FORMAT=(F6.2) 1/(_m-2)		! single column test
+             VARIABLE : 1/(_M-2)
+             BAD FLAG : -1.E+34       
+             SUBSET   : 3 points (E)
+             E        : 0.5 to 3.5
+ -1.00
+******
+  1.00
+LIST/m=1:3/FORMAT=(2F6.2) 1/(_m-2),2/(_m-2)	! multi-column test
+             E: 0.5 to 3.5
+ Column  1: EX#1 is 1/(_M-2)
+ Column  2: EX#2 is 2/(_M-2)
+ -1.00 -2.00
+************
+  1.00  2.00
+ 
+! test grid box limit pseudo-variables
+LIST/m=5:7 EBOXLO, EBOXHI
+             E: 4.5 to 7.5
+ Column  1: EBOXLO is EBOXLO (axis ABSTRACT)
+ Column  2: EBOXHI is EBOXHI (axis ABSTRACT)
+        EBOXLO  EBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+LIST/n=5:7 FBOXLO, FBOXHI
+             F: 4.5 to 7.5
+ Column  1: FBOXLO is FBOXLO (axis ABSTRACT)
+ Column  2: FBOXHI is FBOXHI (axis ABSTRACT)
+        FBOXLO  FBOXHI
+5   / 5:  4.500  5.500
+6   / 6:  5.500  6.500
+7   / 7:  6.500  7.500
+*** Running test: bn_direction_fcns_6d.jnl
+! bn_direction_functions_6d
+! Tests of sort, sample, reverse, convolve, compress, and compess_by
+! functions in the E and F directions.
+ 
+! Sort and sort-string in E direction
+ 
+let b = {5,4,3}
+let c = esequence(b)
+let m_index = sortm(c)
+list c, m_index, samplem(c, m_index)
+             E: 0.5 to 3.5
+ Column  1: C is ESEQUENCE(B)
+ Column  2: M_INDEX is SORTM(C)
+ Column  3: EX#3 is SAMPLEM(C, M_INDEX)
+             C  M_INDEX  EX#3
+1   / 1:  5.000   3.000  3.000
+2   / 2:  4.000   2.000  4.000
+3   / 3:  3.000   1.000  5.000
+ 
+let e1 = esequence({"q", "0", "c"})
+let m_index = sortm(e1)  ! or sortm_str
+list e1, m_index, samplem(e1, m_index)
+             E: 0.5 to 3.5
+ Column  1: E1 is ESEQUENCE({"q", "0", "c"})
+ Column  2: M_INDEX is SORTM(E1)
+ Column  3: EX#3 is SAMPLEM(E1, M_INDEX)
+         E1  M_INDEX EX#3
+1   / 1: "q"   2.000 "0"
+2   / 2: "0"   3.000 "c"
+3   / 3: "c"   1.000 "q"
+ 
+ 
+! Sort and sort-string in F direction
+ 
+let b = {5,4,3}
+let c = fsequence(b)
+let n_index = sortn(c)
+list c, n_index, samplen(c, n_index)
+             F: 0.5 to 3.5
+ Column  1: C is FSEQUENCE(B)
+ Column  2: N_INDEX is SORTN(C)
+ Column  3: EX#3 is SAMPLEN(C, N_INDEX)
+             C  N_INDEX  EX#3
+1   / 1:  5.000   3.000  3.000
+2   / 2:  4.000   2.000  4.000
+3   / 3:  3.000   1.000  5.000
+ 
+let f1 = fsequence({"q", "0", "c"})
+let n_index = sortn(f1)  ! or sortn_str
+list f1, n_index, samplen(f1, n_index)
+             F: 0.5 to 3.5
+ Column  1: F1 is FSEQUENCE({"q", "0", "c"})
+ Column  2: N_INDEX is SORTN(F1)
+ Column  3: EX#3 is SAMPLEN(F1, N_INDEX)
+         F1  N_INDEX EX#3
+1   / 1: "q"   2.000 "0"
+2   / 2: "0"   3.000 "c"
+3   / 3: "c"   1.000 "q"
+ 
+! Ereverse and Freverse
+use 6dfile
+ 
+list/i=1/j=15/k=1/l=1/n=1 temp, ereverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: E
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             F: 1
+ Column  1: TEMP is TEMPERATURE (deg. C)
+ Column  2: EX#2 is EREVERSE(TEMP)
+        TEMP   EX#2
+M / 1:  30.75  34.75
+M / 2:  31.75  33.75
+M / 3:  32.75  32.75
+M / 4:  33.75  31.75
+M / 5:  34.75  30.75
+list/i=1/j=15/k=1/l=1/m=1 temp, freverse(temp)
+ WARNING: Listed variables have ambiguous coordinates on axes: F
+             DATA SET: ./6dfile.nc
+             LONGITUDE: 160.5W
+             LATITUDE: 5.5S
+             DEPTH (m): 5
+             TIME: 15-MAR-1983 10:00
+             E: 1
+ Column  1: TEMP[D=6dfile,F=0:8] is TEMPERATURE (deg. C)
+ Column  2: EX#2 is FREVERSE(TEMP)
+        TEMP   EX#2
+N / 1:  30.75  31.35
+N / 2:  30.95  31.15
+N / 3:  31.15  30.95
+N / 4:  31.35  30.75
+can dat/all
+ 
+! ConvolveM, ConvolveN
+let a = esequence({0,1,1,0,1,0,0,0,,0,0,0})
+let apat = esequence({.25,.5,.25})
+list a, a[m=@spz], convolvem(a,apat), convolvem(a,{.1,.4,.4,.1})
+             E: 0.5 to 12.5
+ Column  1: A is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: A[E=@SPZ:3] is ESEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on E)
+ Column  3: EX#3 is CONVOLVEM(A,APAT)
+ Column  4: EX#4 is CONVOLVEM(A,{.1,.4,.4,.1})
+               A     A      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+let b = fsequence({0,1,1,0,1,0,0,0,,0,0,0})
+let bpat = fsequence({.25,.5,.25})
+list b, b[n=@spz], convolven(b,bpat), convolven(b,{.1,.4,.4,.1})
+             F: 0.5 to 12.5
+ Column  1: B is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0})
+ Column  2: B[F=@SPZ:3] is FSEQUENCE({0,1,1,0,1,0,0,0,,0,0,0}) (Parzen smoothed by 3 pts on F)
+ Column  3: EX#3 is CONVOLVEN(B,BPAT)
+ Column  4: EX#4 is CONVOLVEN(B,{.1,.4,.4,.1})
+               B     B      EX#3    EX#4
+1    /  1:  0.000    ....    ....    ....
+2    /  2:  1.000  0.7500  0.7500  0.8000
+3    /  3:  1.000  0.7500  0.7500  0.6000
+4    /  4:  0.000  0.5000  0.5000  0.5000
+5    /  5:  1.000  0.5000  0.5000  0.4000
+6    /  6:  0.000  0.2500  0.2500  0.1000
+7    /  7:  0.000  0.0000  0.0000    ....
+8    /  8:  0.000    ....    ....    ....
+9    /  9:   ....    ....    ....    ....
+10   / 10:  0.000    ....    ....    ....
+11   / 11:  0.000  0.0000  0.0000    ....
+12   / 12:  0.000    ....    ....    ....
+ 
+! CompressM, CompressN
+let a = esequence({0,1,1,,1,0,,0}) + fsequence({0,,1,,1})
+list a
+             VARIABLE : ESEQUENCE({0,1,1,,1,0,,0}) + FSEQUENCE({0,,1,,1})
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000   ....  1.000  0.000   ....  0.000
+ 2   / 2:   ....   ....   ....   ....   ....   ....   ....   ....
+ 3   / 3:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+list compressm(a)
+             VARIABLE : COMPRESSM(A)
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000  1.000  0.000  0.000   ....   ....
+ 2   / 2:   ....   ....   ....   ....   ....   ....   ....   ....
+ 3   / 3:  1.000  2.000  2.000  2.000  1.000  1.000   ....   ....
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:  1.000  2.000  2.000  2.000  1.000  1.000   ....   ....
+list compressn(a)
+             VARIABLE : COMPRESSN(A)
+             SUBSET   : 8 by 5 points (E-F)
+             1      2      3      4      5      6      7      8    
+             1      2      3      4      5      6      7      8
+ 1   / 1:  0.000  1.000  1.000   ....  1.000  0.000   ....  0.000
+ 2   / 2:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 3   / 3:  1.000  2.000  2.000   ....  2.000  1.000   ....  1.000
+ 4   / 4:   ....   ....   ....   ....   ....   ....   ....   ....
+ 5   / 5:   ....   ....   ....   ....   ....   ....   ....   ....
+ 
+let mask = esequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : ESEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-E)
+            101    102   
+           101    102
+ 1   / 1:  1.000  1.000
+ 2   / 2:   ....   ....
+ 3   / 3:  1.000  1.000
+ 4   / 4:   ....   ....
+ 5   / 5:  1.000  1.000
+list compressm_by(esequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSM_BY(ESEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-E)
+            101    102   
+           101    102
+ 1   / 1:  10.00  10.00
+ 2   / 2:  30.00  30.00
+ 3   / 3:  50.00  50.00
+ 4   / 4:   ....   ....
+ 5   / 5:   ....   ....
+ 
+let mask = fsequence({1,,1,,1}) + 0*L[l=101:102]
+list mask
+             VARIABLE : FSEQUENCE({1,,1,,1}) + 0*L[L=101:102]
+             SUBSET   : 2 by 5 points (T-F)
+            101    102   
+           101    102
+ 1   / 1:  1.000  1.000
+ 2   / 2:   ....   ....
+ 3   / 3:  1.000  1.000
+ 4   / 4:   ....   ....
+ 5   / 5:  1.000  1.000
+list compressn_by(fsequence({10,20,30,40,50}),mask)
+             VARIABLE : COMPRESSN_BY(FSEQUENCE({10,20,30,40,50}),MASK)
+             SUBSET   : 2 by 5 points (T-F)
+            101    102   
+           101    102
+ 1   / 1:  10.00  10.00
+ 2   / 2:  30.00  30.00
+ 3   / 3:  50.00  50.00
+ 4   / 4:   ....   ....
+ 5   / 5:   ....   ....
+*** Running test: bn_regrid_transforms_6d.jnl
+! bn_regrid_transforms_6d.jnl
+! benchmark to test regridding transformations and syntax
+! version of bn_regrid_transforms, using E and F directions.
+ 
+use gtsa056_1_ef
+set mode diag
+ 
+define axis/f=23-jan-1982:30-jan-1982:20/unit=hour fax20
+define axis/x=120e:60w:10/unit=degrees xax10
+define grid/like=temp/f=fax20 g5day
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ 
+set reg/x=130w:125w/y=0:1.5/e=1:2/f=23-JAN-1982:24-jan-1982/t=21-JAN-1982/z=5
+ 
+use gtsa056_1_ef    	!kob 4/99
+ 
+stat temp[g=g5day] - temp[g=g5day at ave]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ reading TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  2 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ 
+             TEMP[G=G5DAY] - TEMP[G=G5DAY at AVE]
+             LONGITUDE: 130W to 125W
+             LATITUDE: 0 to 1.5N
+             DEPTH (m): 5
+             TIME: 21-JAN-1982 16:00
+             E: 1 to 2
+             FORECAST: 23-JAN-1982 00:00:00 to 24-JAN-1982 00:0
+             DATA SET: ./gtsa056_1_ef.nc
+ 
+ Total # of data points: 120 (5*6*1*1*2*2)
+ # flagged as bad  data: 0
+ Minimum value: -1.7333
+ Maximum value: 2
+ Mean    value: 0.13333 (unweighted average)
+ Standard deviation: 1.8745
+ 
+! basic regrid tests
+LIST temp[g=g5day at ave]
+ -DELETE EX#1     M:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  2 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY on F at AVE
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 16:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  32.35  32.37  32.56  32.97  33.45
+ 1.17N / 45:  32.17  32.19  32.33  32.69  33.14
+ 0.83N / 44:  32.02  32.01  32.10  32.39  32.79
+ 0.5N  / 43:  31.93  31.90  31.91  32.09  32.43
+ 0.17N / 42:  31.89  31.84  31.79  31.86  32.10
+ 0.17S / 41:  31.95  31.86  31.77  31.74  31.87
+ ---- M:2 E:   2
+ 1.5N  / 46:  38.35  38.37  38.56  38.97  39.45
+ 1.17N / 45:  38.17  38.19  38.33  38.69  39.14
+ 0.83N / 44:  38.02  38.01  38.10  38.39  38.79
+ 0.5N  / 43:  37.93  37.90  37.91  38.09  38.43
+ 0.17N / 42:  37.89  37.84  37.79  37.86  38.10
+ 0.17S / 41:  37.95  37.86  37.77  37.74  37.87
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  37.75  37.77  37.96  38.37  38.85
+ 1.17N / 45:  37.57  37.59  37.73  38.09  38.54
+ 0.83N / 44:  37.42  37.41  37.50  37.79  38.19
+ 0.5N  / 43:  37.33  37.30  37.31  37.49  37.83
+ 0.17N / 42:  37.29  37.24  37.19  37.26  37.50
+ 0.17S / 41:  37.35  37.26  37.17  37.14  37.27
+ ---- M:2 E:   2
+ 1.5N  / 46:  43.75  43.77  43.96  44.37  44.85
+ 1.17N / 45:  43.57  43.59  43.73  44.09  44.54
+ 0.83N / 44:  43.42  43.41  43.50  43.79  44.19
+ 0.5N  / 43:  43.33  43.30  43.31  43.49  43.83
+ 0.17N / 42:  43.29  43.24  43.19  43.26  43.50
+ 0.17S / 41:  43.35  43.26  43.17  43.14  43.27
+LIST temp[g=g5day]	
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ eval    EX#1     C:  4 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M:  1 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+             VARIABLE : TEMPERATURE (deg. C)
+                        regrid: G5DAY
+             FILENAME : gtsa056_1_ef.nc
+             SUBSET   : 5 by 6 by 2 by 2 points (LONGITUDE-LATITUDE-E-FORECAST)
+             DEPTH (m): 5
+             TIME     : 21-JAN-1982 16:00
+              129.5W 128.5W 127.5W 126.5W 125.5W 
+              101    102    103    104    105
+ ---- N:1 F:   23-JAN-1982 00:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  34.35  34.37  34.56  34.97  35.45
+ 1.17N / 45:  34.17  34.19  34.33  34.69  35.14
+ 0.83N / 44:  34.02  34.01  34.10  34.39  34.79
+ 0.5N  / 43:  33.93  33.90  33.91  34.09  34.43
+ 0.17N / 42:  33.89  33.84  33.79  33.86  34.10
+ 0.17S / 41:  33.95  33.86  33.77  33.74  33.87
+ ---- M:2 E:   2
+ 1.5N  / 46:  40.35  40.37  40.56  40.97  41.45
+ 1.17N / 45:  40.17  40.19  40.33  40.69  41.14
+ 0.83N / 44:  40.02  40.01  40.10  40.39  40.79
+ 0.5N  / 43:  39.93  39.90  39.91  40.09  40.43
+ 0.17N / 42:  39.89  39.84  39.79  39.86  40.10
+ 0.17S / 41:  39.95  39.86  39.77  39.74  39.87
+ ---- N:2 F:   23-JAN-1982 20:00:00
+ ---- M:1 E:   1
+ 1.5N  / 46:  36.01  36.04  36.23  36.64  37.12
+ 1.17N / 45:  35.84  35.85  36.00  36.36  36.80
+ 0.83N / 44:  35.69  35.68  35.77  36.06  36.45
+ 0.5N  / 43:  35.59  35.56  35.58  35.76  36.09
+ 0.17N / 42:  35.56  35.50  35.46  35.53  35.76
+ 0.17S / 41:  35.62  35.53  35.44  35.41  35.53
+ ---- M:2 E:   2
+ 1.5N  / 46:  42.01  42.04  42.23  42.64  43.12
+ 1.17N / 45:  41.84  41.85  42.00  42.36  42.80
+ 0.83N / 44:  41.69  41.68  41.77  42.06  42.45
+ 0.5N  / 43:  41.59  41.56  41.58  41.76  42.09
+ 0.17N / 42:  41.56  41.50  41.46  41.53  41.76
+ 0.17S / 41:  41.62  41.53  41.44  41.41  41.53
+ 
+! unspecified regions
+SET MODE IGNORE	! V.5 change
+canc reg
+set reg/n=1:3/t=21-JAN-1982/z=5  ! x,y,e unspecified
+ 
+canc reg
+set reg/i=101:105/j=41:42/t=21-JAN-1982/z=5  ! e,f unspecified
+ 
+SET MODE/LAST IGNORE	! V.5 change
+ 
+! plot verifications
+set mode interp    ! regridding is also an interpolation
+cancel viewports
+set window/size=.5/aspect=.4 1
+ 
+! E axis
+use gtsa056_1_ef 		!kob 4/99
+set region/x=180E/y=0/f=23-JAN-1982/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  3 dset:   1 I:  101  105  J:   41   46  K:    1    1  L:    3    3  M:    1    2  N:    1    2
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  8 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ reading TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 1    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 2    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 3    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[Y=0 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ found   TEMP     M:  3 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    2
+ regrid  TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[Y=0 at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 4    complete
+ 
+! F axis
+set region/x=180/y=20s:20n/e=2/t=21-JAN-1982/z=5
+plot temp
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M:  7 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L: -999 -999  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  8 dset:   1 I: -999 -999  J: -999 -999  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M:  9 dset:   1 I: -999 -999  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ -DELETE TEMP     M: 10 dset:   1 I:   50   51  J:   41   42  K:    1    1  L:    2    3  M:    1    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ strip --> EX#1[F=23-JAN-198200:00:00 at ITP,D=1]
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  7 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ reading TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+ doing --> TEMP[F=23-JAN-198200:00:00 at ITP,D=1]
+setting up plot
+PPL plot 5    complete
+plot/over temp[g=g5day]
+ dealloc  dynamic grid GGR1            PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAXIS
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @LIN
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 11 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 6    complete
+plot/over temp[g=g5day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @AVE
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 7    complete
+plot/over temp[g=g5day at asn]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ strip --> EX#1[T=21-JAN-198200:00 at ITP,D=1]
+ strip --> EX#1[X=180E at ITP,D=1]
+ eval    EX#1     C:  6 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ strip regrid on F: TEMP --> G5DAY            @ASN
+ found   TEMP     M: 10 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    2
+ regrid  TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ doing --> TEMP[X=180E at ITP,D=1]
+ doing --> TEMP[T=21-JAN-198200:00 at ITP,D=1]
+setting up plot
+PPL plot 8    complete
+ 
+set mode/last interp
+cancel region
+ 
+! test 2D regrid
+define axis/e=1.1:2.1:1 eoffset
+define axis/e=2.5/npoints=1 e1pt
+define axis/e=1.5:2.5:1 e2pt
+define axis/e=1.5:2.5:.5 e4pt
+ 
+define axis/f=15-jan-1982:15-mar-1982:4/unit=day fax4day
+define axis/f=21-jan-1982/npoints=1/unit=day f1pt
+define axis/f=21-jan-1982:25-jan-1982/npoints=48/unit=hour f2pt
+define axis/f=15-jan-1982:15-mar-1982:96/unit=hour fax4day
+ 
+ 
+let a1 = _e[ge=e1pt]+_f[gf=f1pt]
+let a2 = _e[ge=e2pt]+_f[gf=f2pt]
+ 
+list a1[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid G5DAY           PSXT      PSYT5_89  PSZT1_2   TIME2     EAXIS     FAX20
+ -DELETE TEMP     M: 11 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L: -999 -999  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 12 dset:   1 I: -999 -999  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ -DELETE TEMP     M: 13 dset:   1 I:   50   51  J:    1   84  K:    1    1  L:    2    3  M:    2    2  N:    1    1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @AVE
+ strip regrid on F: A1 --> ENTERMED         @AVE
+ eval    A1       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ pseudo  _F       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ -DELETE _F       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    1
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F1PT
+ -DELETE _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1     2.1   
+                          1       2
+ 15-JAN-1982 00 /  1:    ....    ....
+ 19-JAN-1982 00 /  2:    ....  29594.
+ 23-JAN-1982 00 /  3:    ....  29594.
+ 27-JAN-1982 00 /  4:    ....    ....
+ 31-JAN-1982 00 /  5:    ....    ....
+ 04-FEB-1982 00 /  6:    ....    ....
+ 08-FEB-1982 00 /  7:    ....    ....
+ 12-FEB-1982 00 /  8:    ....    ....
+ 16-FEB-1982 00 /  9:    ....    ....
+ 20-FEB-1982 00 / 10:    ....    ....
+ 24-FEB-1982 00 / 11:    ....    ....
+ 28-FEB-1982 00 / 12:    ....    ....
+ 04-MAR-1982 00 / 13:    ....    ....
+ 08-MAR-1982 00 / 14:    ....    ....
+ 12-MAR-1982 00 / 15:    ....    ....
+ 16-MAR-1982 00 / 16:    ....    ....
+list a1[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @SUM
+ strip regrid on F: A1 --> ENTERMED         @SUM
+ found   A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1    2.1  
+                         1      2
+ 15-JAN-1982 00 /  1:   ....   ....
+ 19-JAN-1982 00 /  2:   ....  8878.
+ 23-JAN-1982 00 /  3:   ....  8878.
+ 27-JAN-1982 00 /  4:   ....   ....
+ 31-JAN-1982 00 /  5:   ....   ....
+ 04-FEB-1982 00 /  6:   ....   ....
+ 08-FEB-1982 00 /  7:   ....   ....
+ 12-FEB-1982 00 /  8:   ....   ....
+ 16-FEB-1982 00 /  9:   ....   ....
+ 20-FEB-1982 00 / 10:   ....   ....
+ 24-FEB-1982 00 / 11:   ....   ....
+ 28-FEB-1982 00 / 12:   ....   ....
+ 04-MAR-1982 00 / 13:   ....   ....
+ 08-MAR-1982 00 / 14:   ....   ....
+ 12-MAR-1982 00 / 15:   ....   ....
+ 16-MAR-1982 00 / 16:   ....   ....
+list a1[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A1 --> (G003)           @VAR
+ strip regrid on F: A1 --> ENTERMED         @VAR
+ found   A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ regrid  A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1   16
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E1PT]+_F[GF=F1PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                       1.1 2.1 
+                        1   2
+ 15-JAN-1982 00 /  1:........
+ 19-JAN-1982 00 /  2:........
+ 23-JAN-1982 00 /  3:........
+ 27-JAN-1982 00 /  4:........
+ 31-JAN-1982 00 /  5:........
+ 04-FEB-1982 00 /  6:........
+ 08-FEB-1982 00 /  7:........
+ 12-FEB-1982 00 /  8:........
+ 16-FEB-1982 00 /  9:........
+ 20-FEB-1982 00 / 10:........
+ 24-FEB-1982 00 / 11:........
+ 28-FEB-1982 00 / 12:........
+ 04-MAR-1982 00 / 13:........
+ 08-MAR-1982 00 / 14:........
+ 12-MAR-1982 00 / 15:........
+ 16-MAR-1982 00 / 16:........
+ 
+list a2[ge=eoffset at ave, gf=fax4day at ave]
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A1       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @AVE
+ strip regrid on F: A2 --> ENTERMED         @AVE
+ eval    A2       C:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ pseudo  _F       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ -DELETE _F       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1   48
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    F2PT
+ -DELETE _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at AVE, 96 hour on F at AVE
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                          1.1      2.1   
+                          1        2
+ 15-JAN-1982 00 /  1:     ....     ....
+ 19-JAN-1982 00 /  2:  710186.  710186.
+ 23-JAN-1982 00 /  3:  710234.  710234.
+ 27-JAN-1982 00 /  4:  710282.  710282.
+ 31-JAN-1982 00 /  5:     ....     ....
+ 04-FEB-1982 00 /  6:     ....     ....
+ 08-FEB-1982 00 /  7:     ....     ....
+ 12-FEB-1982 00 /  8:     ....     ....
+ 16-FEB-1982 00 /  9:     ....     ....
+ 20-FEB-1982 00 / 10:     ....     ....
+ 24-FEB-1982 00 / 11:     ....     ....
+ 28-FEB-1982 00 / 12:     ....     ....
+ 04-MAR-1982 00 / 13:     ....     ....
+ 08-MAR-1982 00 / 14:     ....     ....
+ 12-MAR-1982 00 / 15:     ....     ....
+ 16-MAR-1982 00 / 16:     ....     ....
+list a2[ge=eoffset at sum, gf=fax4day at sum]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @SUM
+ strip regrid on F: A2 --> ENTERMED         @SUM
+ found   A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at SUM, 96 hour on F at SUM
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                           1.1        2.1    
+                           1          2
+ 15-JAN-1982 00 /  1:       ....       ....
+ 19-JAN-1982 00 /  2:  2.131E+05  3.551E+05
+ 23-JAN-1982 00 /  3:  2.003E+07  3.338E+07
+ 27-JAN-1982 00 /  4:  2.131E+05  3.551E+05
+ 31-JAN-1982 00 /  5:       ....       ....
+ 04-FEB-1982 00 /  6:       ....       ....
+ 08-FEB-1982 00 /  7:       ....       ....
+ 12-FEB-1982 00 /  8:       ....       ....
+ 16-FEB-1982 00 /  9:       ....       ....
+ 20-FEB-1982 00 / 10:       ....       ....
+ 24-FEB-1982 00 / 11:       ....       ....
+ 28-FEB-1982 00 / 12:       ....       ....
+ 04-MAR-1982 00 / 13:       ....       ....
+ 08-MAR-1982 00 / 14:       ....       ....
+ 12-MAR-1982 00 / 15:       ....       ....
+ 16-MAR-1982 00 / 16:       ....       ....
+list a2[ge=eoffset at var, gf=fax4day at var]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ strip regrid on E: A2 --> (G004)           @VAR
+ strip regrid on F: A2 --> ENTERMED         @VAR
+ found   A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ regrid  A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+             VARIABLE : Variance of _E[GE=E2PT]+_F[GF=F2PT]
+                        regrid: 1 delta on E at VAR, 96 hour on F at VAR
+             SUBSET   : 2 by 16 points (E-FORECAST)
+                         1.1     2.1   
+                          1       2
+ 15-JAN-1982 00 /  1:    ....    ....
+ 19-JAN-1982 00 /  2:    ....    ....
+ 23-JAN-1982 00 /  3:    ....  0.0000
+ 27-JAN-1982 00 /  4:    ....    ....
+ 31-JAN-1982 00 /  5:    ....    ....
+ 04-FEB-1982 00 /  6:    ....    ....
+ 08-FEB-1982 00 /  7:    ....    ....
+ 12-FEB-1982 00 /  8:    ....    ....
+ 16-FEB-1982 00 /  9:    ....    ....
+ 20-FEB-1982 00 / 10:    ....    ....
+ 24-FEB-1982 00 / 11:    ....    ....
+ 28-FEB-1982 00 / 12:    ....    ....
+ 04-MAR-1982 00 / 13:    ....    ....
+ 08-MAR-1982 00 / 14:    ....    ....
+ 12-MAR-1982 00 / 15:    ....    ....
+ 16-MAR-1982 00 / 16:    ....    ....
+ 
+! 1/00 additions to check details of @MIN, at MAX bevavior
+ 
+let a1 = _e[ge=e1pt]
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   FAX4DAY
+ -DELETE A2       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   16
+ -DELETE A2       M: 14 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N:    1   48
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      F2PT
+ -DELETE A1       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N:    1    1
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      F1PT
+let a2 = _e[ge=e2pt]
+let a4 = _e[ge=e4pt]
+ 
+list a1[ge=eoffset at max]
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A1       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A1 --> (G003)           @MAX
+ eval    A1       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ allocate dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ pseudo  _E       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G002)          NORMAL    NORMAL    NORMAL    NORMAL    E1PT      NORMAL
+ regrid  A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E1PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:   ....
+ 2.1 / 2:  2.500
+list a2[ge=eoffset at max]
+ -DELETE _E       M: 11 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    1  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A1       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A2       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A2 --> (G004)           @MAX
+ eval    A2       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ pseudo  _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G003)          NORMAL    NORMAL    NORMAL    NORMAL    E2PT      NORMAL
+ regrid  A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E2PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.500
+list a4[ge=eoffset at max]
+ -DELETE _E       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A2       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid A4       C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @MAX
+ eval    A4       C:  7 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ allocate dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ pseudo  _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G004)          NORMAL    NORMAL    NORMAL    NORMAL    E4PT      NORMAL
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MAX
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.500
+list a4[ge=eoffset at min]
+ -DELETE _E       M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @MIN
+ found   A4       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at MIN
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.500
+ 2.1 / 2:  2.000
+list a4[ge=eoffset at sum] ! 5+5.5+6+6.5=23
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ strip regrid on E: A4 --> (G005)           @SUM
+ found   A4       M: 13 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    3  N: -999 -999
+ regrid  A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+             VARIABLE : _E[GE=E4PT]
+                        regrid: 1 delta on E at SUM
+             SUBSET   : 2 points (E)
+ 1.1 / 1:  1.050
+ 2.1 / 2:  4.200
+ 
+! time axes with different encodings
+define axis/f=1-jan-1990:5-jan-1990:1/units=days eday
+define axis/f=1-jan-1990:5-jan-1990:24/units=hours ehour
+let afcst = _f[gf=eday]
+list afcst
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    EOFFSET   NORMAL
+ -DELETE A4       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M:    1    2  N: -999 -999
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ getgrid AFCST    C:  7 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ eval    AFCST    C:  6 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ pseudo  _F       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+             VARIABLE : _F[GF=EDAY]
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G005)
+    GRID (G005)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EDAY      FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+list afcst[gf=ehour at max]
+ -DELETE _F       M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G005)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EDAY
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ eval    EX#1     C:  4 dset:   1 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ allocate dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+ strip regrid on F: AFCST --> (G006)           @MAX
+ found   AFCST    M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ regrid  AFCST    M: 15 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N:    1    5
+ dealloc  dynamic grid (G006)          NORMAL    NORMAL    NORMAL    NORMAL    NORMAL    EHOUR
+             VARIABLE : _F[GF=EDAY]
+                        regrid: 24 hour on F at MAX
+             SUBSET   : 5 points (FORECAST)
+ 01-JAN-1990 00 / 1:  32493.
+ 02-JAN-1990 00 / 2:  32494.
+ 03-JAN-1990 00 / 3:  32495.
+ 04-JAN-1990 00 / 4:  32496.
+ 05-JAN-1990 00 / 5:  32497.
+show grid
+ Default grid for DEFINE VARIABLE is ABSTRACT
+ Last successful data access was on grid (G006)
+    GRID (G006)
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ EHOUR     FORECAST             5 r   01-JAN-1990 00:00    05-JAN-1990 00:00
+ 
+set mode/last diag
+*** Running test: bn_aggregate_e.jnl
+! bn_aggregate_e.jnl
+! using the DEFINE ATTRIBUTE/E command
+! Datasets share sst, but only ens1 has airt.
+ 
+set mode diag
+ 
+use ens1, ens2, ens3, ens4
+define data/agg/title fourfiles = ens1, ens3, ens2, ens4
+ 
+! The grid of SST is known.
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 sst[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G006)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering SST on E axis:     1     4 dset:   5
+ reading SST      M:  1 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     1     1 dset:   1
+ reading SST      M:  3 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     2     2 dset:   3
+ reading SST      M:  4 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     3     3 dset:   2
+ reading SST      M:  5 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering SST on E axis:     4     4 dset:   4
+ doing --> SST[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : SST_IN (Deg C)
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+            13N    15N    17N    19N    21N    23N    25N    27N    29N   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:   28.5   28.4   27.9   27.5   26.7   25.6   ....   ....   ....
+ 2   / 2:   85.5   85.3   83.7   82.4   80.2   76.7   ....   ....   ....
+ 3   / 3:   57.0   56.9   55.8   54.9   53.5   51.1   ....   ....   ....
+ 4   / 4:  114.1  113.8  111.6  109.8  106.9  102.2   ....   ....   ....
+cancel data fourfiles
+ -DELETE SST      M:  2 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ -DELETE SST      M:  6 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L: -999 -999  M:    1    4  N: -999 -999
+ dealloc  dynamic grid (G006)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ 
+! Create airt in the other datasets by LET/D definitions.
+let/d=ens2 airt = sst + 1
+let/d=ens3 airt = sst + 1
+let/d=ens4 airt = sst + 1
+ 
+define data/agg fourfiles = ens1, ens3, ens2, ens4
+ getgrid AIRT     C:  5 dset:   3 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   2 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+ getgrid AIRT     C:  5 dset:   4 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid GOH1            COADSX116_COADSY52_6NORMAL    TIME      NORMAL    NORMAL
+show data fourfiles
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+list/i=3 airt[T=@ave]
+ getgrid EX#1     C:  5 dset:   5 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid (G007)          COADSX116_COADSY52_6NORMAL    TIME      ENSEMBLE  NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   5 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M:    1    4  N: -999 -999
+ strip --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+ strip aggregate gathering AIRT on E axis:     1     4 dset:   5
+ reading AIRT     M:  6 dset:   1 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     1     1 dset:   1
+ eval    AIRT     C:  9 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:  7 dset:   3 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M:  8 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     2     2 dset:   3
+ eval    AIRT     C:  9 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M:  8 dset:   2 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 10 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     3     3 dset:   2
+ eval    AIRT     C:  9 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ reading SST      M: 10 dset:   4 I:    3    3  J:    1    9  K: -999 -999  L:    1   12  M: -999 -999  N: -999 -999
+ constan cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ -DELETE cnst     M: 12 dset:   0 I: -999 -999  J: -999 -999  K: -999 -999  L: -999 -999  M: -999 -999  N: -999 -999
+ doing aggregate gathering AIRT on E axis:     4     4 dset:   4
+ doing --> AIRT[T=01-JAN00:45:31-DEC06:34 at AVE,D=5]
+             VARIABLE : AIR TEMPERATURE (DEG C)
+             DATA SET : Ensemble
+             FILENAME : FOURFILES
+             SUBSET   : 9 by 4 points (LATITUDE-E)
+             LONGITUDE: 105W
+             TIME     : 01-JAN 00:45 to 31-DEC 06:34 (averaged)
+            13N    15N    17N    19N    21N    23N    25N    27N    29N   
+             1      2      3      4      5      6      7      8      9
+ 1   / 1:   27.7   27.6   27.1   26.7   25.8   25.2   ....   ....   ....
+ 2   / 2:   86.5   86.3   84.7   83.4   81.2   77.7   ....   ....   ....
+ 3   / 3:   58.0   57.9   56.8   55.9   54.5   52.1   ....   ....   ....
+ 4   / 4:  115.1  114.8  112.6  110.8  107.9  103.2   ....   ....   ....
+ 
+cancel mode diag
+cancel data/all
+cancel var/all
+ 
+! Subsets of coads_climatology and monthly_navy_winds.
+! Define an ensemble after making LET/D definitions so that
+! variables have the same name and grid.
+use coads_uw
+use navy_uw
+ 
+! Define the ensemble dataset
+ 
+! intentional errors:
+set mode ignore
+ 
+! Use dataset thats not open.
+define data/agg windy = 1,2,3
+ 
+! No variables on comparable grids.
+define data/agg windy = 1,2
+ 
+set mode/last ignore
+ 
+! Rename the varibles in dataset 2, then define UWND and VWND as
+! variables on the grid of dset 1.
+set dat 2
+set var/name=uin uwnd
+set var/name=vin vwnd
+ 
+! Define uwnd and vwnd in dataset 2 to have the grid of
+! those variables in dataset 1
+ 
+let/d=2/units="`uin,return=units`"/title="`uin,return=title`" \
+ uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="ZONAL WIND"  uwnd = uin[d=2,gxy=uwnd[d=1],gt=uwnd[d=1]@mod]
+let/d=2/units="`vin,return=units`"/title="`vin,return=title`" \
+ vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ !-> DEFINE VARIABLE/d=2/units="M/S"/title="MERIDIONAL WIND"  vwnd = vin[d=2,gxy=vwnd[d=1],gt=vwnd[d=1]@mod]
+ 
+show data
+     currently SET data sets:
+    1> ./coads_uw.nc
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      ...       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      ...       ...
+ SPEH     SPECIFIC HUMIDITY                1:30      1:30      ...       1:12      ...       ...
+ 
+    2> ./navy_uw.nc  (default)
+ name     title                             I         J         K         L         M         N
+ UIN      ZONAL WIND                       1:30      1:30      ...       1:30      ...       ...
+ VIN      MERIDIONAL WIND                  1:30      1:30      ...       1:30      ...       ...
+ ------------------------------
+ VWND[D=navy_uw] = VIN[D=2,GXY=VWND[D=1],GT=VWND[D=1]@MOD]
+ UWND[D=navy_uw] = UIN[D=2,GXY=UWND[D=1],GT=UWND[D=1]@MOD]
+ 
+ 
+! Define the ensemble dataset
+define data/agg windy = 1,2
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 29N
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: UWND[D=WINDY,E=1] is ZONAL WIND (M/S)
+ Column  4: VWND[D=WINDY,E=2] is MERIDIONAL WIND (M/S)
+ Column  5: UWND[D=WINDY,E=0.5:2.5 at AVE] is ZONAL WIND (M/S)
+               UWND    UWND   UWND    VWND    UWND
+59W    / -30:  1.643  0.2317  1.643  0.2317  0.9371
+57W    / -29:  1.404  0.1102  1.404  0.1102  0.7573
+55W    / -28:  1.353 -0.0184  1.353 -0.0184  0.6674
+53W    / -27:  1.210 -0.1624  1.210 -0.1624  0.5237
+51W    / -26:  1.086 -0.3088  1.086 -0.3088  0.3887
+ 
+! Use the other order. As long as we have a file variable, we're ok
+ 
+cancel data 3
+ 
+! Define the ensemble dataset
+define data/agg windy = 2,1
+ 
+! The grid of the aggregate variables with LET/D is known.
+show data windy
+     currently SET data sets:
+    3> WINDY  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ UWND     ZONAL WIND                       1:30      1:30      ...       1:12      1:2       ...
+ VWND     MERIDIONAL WIND                  1:30      1:30      ...       1:12      1:2       ...
+ 
+ 
+! Use variable from the new dataset
+list/l=3/y=30/x=-59:-51 uwnd[d=1], uwnd[d=2], uwnd[d=3,e=1], uwnd[d=3,e=2], uwnd[d=3,e=@ave]
+             LONGITUDE: 59W(-59) to 51W(-51)
+             LATITUDE: 29N
+             TIME: 17-MAR 02:58
+ Column  1: UWND[D=coads_uw] is ZONAL WIND (M/S)
+ Column  2: UWND[D=navy_uw] is ZONAL WIND (M/S)
+ Column  3: VWND[D=WINDY,E=1] is MERIDIONAL WIND (M/S)
+ Column  4: UWND[D=WINDY,E=2] is ZONAL WIND (M/S)
+ Column  5: VWND[D=WINDY,E=0.5:2.5 at AVE] is MERIDIONAL WIND (M/S)
+               UWND    UWND    VWND   UWND    VWND
+59W    / -30:  1.643  0.2317  0.2317  1.643  0.9371
+57W    / -29:  1.404  0.1102  0.1102  1.404  0.7573
+55W    / -28:  1.353 -0.0184 -0.0184  1.353  0.6674
+53W    / -27:  1.210 -0.1624 -0.1624  1.210  0.5237
+51W    / -26:  1.086 -0.3088 -0.3088  1.086  0.3887
+ 
+can data/all
+can var/all
+ 
+! DEFINE DATA/HIDE
+! SHOW DATA/HIDDEN
+! Alias ENSEMBLE for DEFINE DATA/AGG/E
+ 
+! If define the ensemble with /HIDE then SHOW DAT will skip the
+! member datasets and show only the ensemble.
+! show dat/hidden forces showing all
+ 
+sh command define
+ DEFINE
+ DEFINE REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DEFAULT/DX/DY/DZ/DT/DE/DF/DI/DJ/DK
+         /DL/DM/DN
+ DEFINE GRID/X/Y/Z/T/E/F/FILE/LIKE
+ DEFINE VARIABLE/TITLE/UNITS/QUIET/DATASET/BAD/REMOTE
+ DEFINE AXIS/X/Y/Z/T/E/F/FILE/UNITS/T0/NAME/FROMDATA/DEPTH/MODULO/NPOINTS
+         /EDGES/CALENDAR/BOUNDS/QUIET
+ DEFINE VIEWPORT/TEXT/XLIMITS/YLIMITS/SIZE/ORIGIN/CLIP/AXES
+ DEFINE ALIAS
+ DEFINE SYMBOL
+ DEFINE ATTRIBUT/D/TYPE/OUTPUT/QUIET
+ DEFINE PYFUNC/NAME
+ DEFINE DATA/AGGREGAT/E/TITLE/QUIET/HIDE
+sh command show
+ SHOW/ALL
+ SHOW WINDOW/ALL
+ SHOW REGION/ALL
+ SHOW AXIS/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+ SHOW EXPRSION/ALL
+ SHOW LIST/ALL
+ SHOW DATA/ALL/BRIEF/FULL/VARIABLE/FILES/XML/ATTR/OUTFILE/APPEND/CLOBBER
+       /HIDDEN
+ SHOW MODE/ALL
+ SHOW MOVIE/ALL
+ SHOW VARIABLE/ALL/DATASET/DIAG/USER/XML/OUTFILE/APPEND/CLOBBER/TREE/SIGMA
+       /CURVILIN
+ SHOW COMMANDS/ALL
+ SHOW MEMORY/ALL/TEMPORY/PERMANT/FREE
+ SHOW GRID/ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/DYNAMIC/XML/OUTFILE/APPEND/CLOBBER
+ SHOW VIEWPORT/ALL
+ SHOW TRANFORM/ALL
+ SHOW ALIAS/ALL
+ SHOW SYMBOL/ALL
+ SHOW ATTRIBUT/ALL/DATASET/OUTPUT
+ SHOW NCCACHE
+ SHOW GIFFILE
+ SHOW FUNCTION/ALL/BRIEF/EXTERNAL/INTERNAL/DETAILS
+ SHOW QUERIES/ALL
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ 
+! should just show the ensemble set
+sh dat
+     currently SET data sets:
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! If ask for a member set by name or number, do show it
+sh dat 2
+     currently SET data sets:
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+sh dat ens3
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! should show all members plus ensemble
+sh dat/hidden
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> FOURFILES  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+ 
+! Should show original member datasets
+can dat fourfiles
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+can dat/all
+ 
+! Cancel a member, then the ensemble gets canceled.
+! The hidden members should show up.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2
+sh dat
+     currently SET data sets:
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+can dat  2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Cancel the ensemble, then hidden members get un-hidden.
+ 
+use ens1, ens2, ens3, ens4
+ensemble/HIDE/title="uvars in dset 2"  my_ens = 1,2,3,4
+ 
+! members hidden, showing only ensemble.
+sh dat
+     currently SET data sets:
+    5> MY_ENS  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+can dat my_ens
+ 
+! Cancel ensemble dataset: members un-hidden
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    2> ./ens2.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+! Define several ensembles with /HIDE
+ensemble/HIDE/title="ensemble with hidden members" fourfiles = ens1, ens2, ens3, ens4
+ensemble/HIDE/title="ensemble with hidden members" some = ens1, ens2
+ensemble/HIDE/title="ensemble with hidden members" more = ens2, ens3, ens4
+ 
+! Shows all the ensembles
+sh dat
+     currently SET data sets:
+    5> FOURFILES     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:4       ...
+ 
+    6> SOME     Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:2       ...
+ 
+    7> MORE  (default)  Ferret-defined Ensemble dataset
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      1:3       ...
+ 
+ 
+! Cancel a member of all the ensembles.
+! Cancels dataset 2 and also the ensemble sets.
+can dat 2
+sh dat
+     currently SET data sets:
+    1> ./ens1.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ AIRT     AIR TEMPERATURE                  1:10      1:9       ...       1:12      ...       ...
+ 
+    3> ./ens3.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+    4> ./ens4.nc
+ name     title                             I         J         K         L         M         N
+ SST      SST_IN                           1:10      1:9       ...       1:12      ...       ...
+ 
+ 
+*** Running test: bn_6d_lab_mode.jnl
+! bn_6d_lab_mode.jnl
+!
+! Tests of CANCEL MODE 6d_lab, writes SHOW and STAT output in classic 4D form.
+!
+use gt4d011
+ 
+! Mode affects output of SHOW
+ 
+set mode 6d_lab  ! this is the default setting
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+cancel mode 6d_lab
+show data
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25
+ 
+ 
+! Mode affects output of SHOW GRID
+ 
+set mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ normal    E
+ normal    F
+cancel mode 6d_lab
+show grid temp
+    GRID PS3DT2
+ name       axis              # pts   start                end
+ PSXT      LONGITUDE          160mr   130.5E               70.5W
+ PSYT      LATITUDE           100 i   28.836S              48.568N
+ PSZT      DEPTH (m)           27 i-  5                    3824
+ TIME1     TIME                25 r   17-AUG-1982 12:00    10-JAN-1983 12:00
+ 
+! Mode affects output of STAT
+ 
+set mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.7S to 3.7N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             E:  N/A
+             F:  N/A
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25*1*1)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+cancel mode 6d_lab
+stat temp
+ 
+             TEMPERATURE
+             LONGITUDE: 140W to 122W
+             LATITUDE: 3.7S to 3.7N
+             DEPTH (m): 0 to 100
+             TIME: 14-AUG-1982 11:00 to 13-JAN-1983 13:00
+             DATA SET: ./gt4d011.cdf
+ 
+ Total # of data points: 99000 (18*22*10*25)
+ # flagged as bad  data: 0
+ Minimum value: 21.597
+ Maximum value: 33.497
+ Mean    value: 27.704 (unweighted average)
+ Standard deviation: 2.4542
+ 
+! Mode affects diagnostic output
+ 
+set mode diag
+set mode 6d_lab
+list/L=1:8 taux[x=@ave,y=@ave]
+ dealloc  dynamic grid PS3DT2          PSXT      PSYT      PSZT      TIME1     NORMAL    NORMAL
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1  M:    1    1  N:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1     NORMAL    NORMAL
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ strip --> TAUX[Y=28.8S:51.4N at AV4,D=1]
+ reading TAUX     M:  2 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8  M: -999 -999  N: -999 -999
+ doing --> TAUX[Y=3.5S:3.5N at AV4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY ave)
+             LATITUDE : 3.5S to 3.5N (XY ave)
+ 17-AUG-1982 12 / 1: -0.2742
+ 23-AUG-1982 14 / 2: -0.2363
+ 29-AUG-1982 16 / 3: -0.1984
+ 04-SEP-1982 18 / 4: -0.1605
+ 10-SEP-1982 20 / 5: -0.1227
+ 16-SEP-1982 22 / 6: -0.1041
+ 23-SEP-1982 00 / 7: -0.1047
+ 29-SEP-1982 02 / 8: -0.1054
+cancel mode 6d_lab
+list/L=1:8 taux[x=@sum,y=@sum]
+ dealloc  dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1
+ getgrid EX#1     C:  5 dset:   1 I:    1    1  J:    1    1  K:    1    1  L:    1    1
+ allocate dynamic grid PS2DU2          PSXU      PSYU      NORMAL    TIME1
+ strip limits reconciliation : EX#1
+ eval    EX#1     C:  5 dset:   1 I:    1  160  J:    1  100  K: -999 -999  L:    1    8
+ strip --> TAUX[Y=28.8S:51.4N at SM4,D=1]
+ found   TAUX     M:  2 dset:   1 I:   91  108  J:   35   55  K: -999 -999  L:    1    8
+ doing --> TAUX[Y=3.5S:3.5N at SM4,D=1]
+             VARIABLE : ZONAL WIND STRESS (dynes/cm**2)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 8 points (TIME)
+             LONGITUDE: 139.5W to 121.5W (XY summed)
+             LATITUDE : 3.5S to 3.5N (XY summed)
+ 17-AUG-1982 12 / 1: -103.6
+ 23-AUG-1982 14 / 2:  -89.3
+ 29-AUG-1982 16 / 3:  -75.0
+ 04-SEP-1982 18 / 4:  -60.7
+ 10-SEP-1982 20 / 5:  -46.4
+ 16-SEP-1982 22 / 6:  -39.3
+ 23-SEP-1982 00 / 7:  -39.6
+ 29-SEP-1982 02 / 8:  -39.8
+can mode diag
+ 
+! restore default setting
+set mode 6d_lab
+*** Running test: bn682_bug_fixes.jnl
+! bn682_bug_fixes.jnl
+! test various fixes that went into version 6.82
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err681_dims_direction
+! err681_dims_direction.jnl
+! ticket 1955: Code still existed that determined axis direction
+! according to axis name.  Here, coordinate variables are defined,
+! but their dimensions are not coordinate variables, so there isn't
+! direct info in the file about the directions of the dimensions.
+! netcdf dims {
+! dimensions:
+!        ETA = 4 ;
+!        TAU1 = 7 ;
+!        ZT_OCEAN = 1 ;
+! variables:
+!  ...
+!        float LON_C(TAU, ETA) ;
+!                LON_C:long_name = "uv longitude" ;
+!                LON_C:units = "degrees_E" ;
+!                LON_C:history = "From data_1302" ;
+!
+! Where tau is intended to be a Y axis and ETA is an X axis.
+! 4D Ferret puts these in an X and a T direction, and inital versions
+! of 6D Ferret had them in the E and T directions.  They should just
+! get assigned by position, here with TAU in the Y direction an ETA in x.
+ 
+use dims_not_coord
+sh dat
+     currently SET data sets:
+    1> ./dims_not_coord.nc  (default)
+ name     title                             I         J         K         L         M         N
+ U        zonal current                    1:4       1:7       1:1       ...       ...       ...
+ LON_C    uv longitude                     1:4       1:7       ...       ...       ...       ...
+ LAT_C    uv latitude                      1:4       1:7       ...       ...       ...       ...
+ 
+sho grid lon_c
+    GRID GOS2
+ name       axis              # pts   start                end
+ ETA       X                    4 r   1                    4
+ TAU1      Y                    7 r   1                    7
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+*** Running test: bn683_bug_fixes.jnl
+! bn683_bug_fixes.jnl
+! test various fixes that went into version 6.83
+! 8/2012 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err682_shrink_axlab
+! err682_shrink_axlab.jnl
+! See ticket 1958. Scripts may want the axis labels to
+! run out of the viewport or off the page. So shrink labels
+! only if MODE SHRINK_YLAB has been set.
+! See also err672_runoff_page.jnl and err672_vert_axislabel.jnl
+!
+! Default setting, mode shrink_ylab is cancelled.
+ 
+! The lower plot has its vertical axis labels intact and visible.
+! The upper one will have them shrink away to nothing.
+ 
+set view lr
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode shrink_ylab
+ 
+set view ur
+go magnify
+plot/vs {-1,1},{-1,1}
+ 
+set mode/last shrink_ylab
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_xact_high_prec
+! err682_xact_high_prec.jnl
+! based on an example from the Users List,
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00477.html
+ 
+! shows that the @XACT regridding in double-precision Ferret is broken.
+ 
+ 
+Let time = {\
+ 22585.3295833333,\
+ 22585.3302777778,\
+ 22585.3309722222,\
+ 22585.3316666667,\
+ 22585.3323611111,\
+ 22585.3330555556,\
+ 22585.33375,\
+ 22585.3344444444,\
+ 22585.3351388889,\
+ 22585.3358333333}
+ 
+Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time
+ 
+Let fake_var = T[GT=my_axis]
+Let var = RANDU( fake_var )
+Let var_regrid = RESHAPE( var, fake_var )
+ 
+List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
+             VARIABLE : RESHAPE( VAR, FAKE_VAR )
+             SUBSET   : 10 points (TIME)
+ 02-NOV-2011 07:54:36 /  1:  0.6251
+ 02-NOV-2011 07:55:36 /  2:  0.2209
+ 02-NOV-2011 07:56:36 /  3:  0.6074
+ 02-NOV-2011 07:57:36 /  4:  0.3226
+ 02-NOV-2011 07:58:36 /  5:  0.1075
+ 02-NOV-2011 07:59:36 /  6:  0.2257
+ 02-NOV-2011 08:00:36 /  7:  0.0811
+ 02-NOV-2011 08:01:36 /  8:  0.8980
+ 02-NOV-2011 08:02:36 /  9:  0.7163
+ 02-NOV-2011 08:03:36 / 10:  0.6649
+ 
+! Note that if we define the axis as below, the regridding is
+! successful. But the @XACT regridding in v6.82 was requiring too
+! much matching precision.
+ 
+!    DEFINE AXIS/t="02-nov-2011:07:54:36":"02-nov-2011:08:03:36":60/units=seconds/T0=1-JAN-1950 my_axis
+!    let time = t[gt=my_axis]
+!    Let var = TSEQUENCE( RANDU( time ) )
+!    Let fake_var = T[GT=my_axis]
+!    Let var_regrid = RESHAPE( var, fake_var )
+ 
+! New time axis
+Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds
+ 
+Let var_sec = var_regrid[ GT=t_axis_seconds at XACT ]
+ 
+! Here we got no good data, should be one at 7:54:36.
+ 
+List /T="2-nov-2011 07:54:30":"2-nov-2011 07:54:50" var_sec
+             VARIABLE : VAR_REGRID[ GT=T_AXIS_SECONDS at XACT ]
+             SUBSET   : 21 points (TIME)
+ 02-NOV-2011 07:54:30 / 114871:    ....
+ 02-NOV-2011 07:54:31 / 114872:    ....
+ 02-NOV-2011 07:54:32 / 114873:    ....
+ 02-NOV-2011 07:54:33 / 114874:    ....
+ 02-NOV-2011 07:54:34 / 114875:    ....
+ 02-NOV-2011 07:54:35 / 114876:    ....
+ 02-NOV-2011 07:54:36 / 114877:  0.6251
+ 02-NOV-2011 07:54:37 / 114878:    ....
+ 02-NOV-2011 07:54:38 / 114879:    ....
+ 02-NOV-2011 07:54:39 / 114880:    ....
+ 02-NOV-2011 07:54:40 / 114881:    ....
+ 02-NOV-2011 07:54:41 / 114882:    ....
+ 02-NOV-2011 07:54:42 / 114883:    ....
+ 02-NOV-2011 07:54:43 / 114884:    ....
+ 02-NOV-2011 07:54:44 / 114885:    ....
+ 02-NOV-2011 07:54:45 / 114886:    ....
+ 02-NOV-2011 07:54:46 / 114887:    ....
+ 02-NOV-2011 07:54:47 / 114888:    ....
+ 02-NOV-2011 07:54:48 / 114889:    ....
+ 02-NOV-2011 07:54:49 / 114890:    ....
+ 02-NOV-2011 07:54:50 / 114891:    ....
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_if_yes_exit
+! err682_if_yes_exit.jnl
+! Ticket 1965
+!
+! As reported by Hein Zelle
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00487.html
+! This should exit the script on failure of the first test.
+! Instead it continues on and only exits with the /script qualifier or as part
+! of a block
+ 
+let test = 1
+if `test` then exit
+ !-> if 1 then exit
+ 
+GO bn_reset
+cancel mode verify
+GO err682_use_no_quotes
+! err682_use_no_quotes.jnl
+! See ticket 1974 - on 64-bit machines, this statement causes a crash.
+! It should just generate an error message, as the file spec. should have
+! quotes around it.
+ 
+SET MODE ignore
+use ./z1.nc
+ 
+CANCEL MODE ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err682_axis_no_clue
+! err682_axis_no_clue.jnl
+! See ticket 1975. The axis sax is intended to be
+! used as a Y axis. The axes of the variable are
+! TEMP(zax, sax, xax). The grid should be XYZ but
+! Ferret v6.82 created a grid thats XZT instead.
+ 
+use xsz.nc
+sh dat
+     currently SET data sets:
+    1> ./xsz.nc  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                      1:5       1:7       1:3       ...       ...       ...
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_grid_merge
+! err682_grid_merge.jnl
+! Bug 1972. When merging contexts, the calendar time-axis
+! info gets lost, causing an error with the time axis.
+ 
+use truemonth.nc
+let a = 2
+let b = a * var
+list a*var[t=1-jan-1960:1-jan-1961]
+             VARIABLE : A*VAR[T=1-JAN-1960:1-JAN-1961]
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.632
+ 15-FEB-1960 12 / 122:  1.901
+ 16-MAR-1960 12 / 123:  2.000
+ 16-APR-1960 00 / 124:  1.917
+ 16-MAY-1960 12 / 125:  1.658
+ 16-JUN-1960 00 / 126:  1.246
+ 16-JUL-1960 12 / 127:  0.718
+ 16-AUG-1960 12 / 128:  0.114
+ 16-SEP-1960 00 / 129: -0.490
+ 16-OCT-1960 12 / 130: -1.050
+ 16-NOV-1960 00 / 131: -1.513
+ 16-DEC-1960 12 / 132: -1.836
+ 
+! The bug had this statement failing with a time-region error
+list b[T=1-JAN-1960:1-JAN-1961]
+             VARIABLE : A * VAR
+             FILENAME : truemonth.nc
+             SUBSET   : 12 points (TIME)
+ 16-JAN-1960 12 / 121:  1.632
+ 15-FEB-1960 12 / 122:  1.901
+ 16-MAR-1960 12 / 123:  2.000
+ 16-APR-1960 00 / 124:  1.917
+ 16-MAY-1960 12 / 125:  1.658
+ 16-JUN-1960 00 / 126:  1.246
+ 16-JUL-1960 12 / 127:  0.718
+ 16-AUG-1960 12 / 128:  0.114
+ 16-SEP-1960 00 / 129: -0.490
+ 16-OCT-1960 12 / 130: -1.050
+ 16-NOV-1960 00 / 131: -1.513
+ 16-DEC-1960 12 / 132: -1.836
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err682_scale_no_offset
+! err682_scale_no_offset.jnl
+! See ticket 1980 and the report on the Ferret list at
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00585.html
+! Dataset with a scale_factor attributue on variables but no add_offset att.
+ 
+ 
+use err682_scale_no_offset.nc
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+ 
+can dat 1
+use err682_scale_no_offset.nc
+say `sst_cor[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+use tripolar_subset
+can dat 2
+ 
+say `sst_rms[x=@ngd,y=@ngd]` SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91 SHOULD BE 91
+91 SHOULD BE 91
+load sst_rms
+ 
+say `sst_rms[x=@ngd,y=@ngd]`  SHOULD BE 91
+ !-> MESSAGE/CONTINUE 91  SHOULD BE 91
+91  SHOULD BE 91
+load sst_rms
+say `sst_rms[x=@nbd,y=@nbd]`  SHOULD BE 30
+ !-> MESSAGE/CONTINUE 30  SHOULD BE 30
+30  SHOULD BE 30
+ 
+GO bn_reset
+cancel mode verify
+GO err682_append_packed
+! err682_append_packed.jnl
+! See ticket 2004. Write packed variable with scale attributes
+! Append more values, data was not correctly scaled.
+ 
+use append_pack.nc
+list temp  ! values should be  28.69, 28.63
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : append_pack.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E
+                        1
+ 01-JAN-1994 12 / 1:  28.69
+ 02-JAN-1994 12 / 2:  28.63
+ 
+cancel mode upcase_output
+set att/output=all temp
+save/clobber/file=a.nc/outtype=short/L=1 temp
+save/append/file=a.nc/outtype=short/L=2 temp
+ 
+can data/all
+use a.nc
+ 
+list temp  ! values should match those above.
+             VARIABLE : Potential temperature (degrees C)
+             FILENAME : a.nc
+             SUBSET   : 2 points (TIME)
+             LONGITUDE: 180E(179.9)
+             LATITUDE : 0.05S
+             DEPTH (m): 2.5
+                      179.95E
+                        1
+ 01-JAN-1994 12 / 1:  28.69
+ 02-JAN-1994 12 / 2:  28.63
+ 
+set mode/last upcase_output
+*** Running test: bn_outtype.jnl
+! bn_outtype
+! Tests of output-type control:
+!  SET VAR/OUTTYPE
+!  SET LIST/OUTTYPE
+!  save/x=300/y=0:5/OUTTYPE
+ 
+! SET LIST/OUTTYPE takes precedence over the variable type from
+! an input dataset or the SET VAR/OUTTYPE
+! save/x=300/y=0:5/OUTTYPE takes precedence over both
+ 
+! SET VAR/OUTTYPE
+can dat/all
+use coads_climatology
+ 
+let sst2 = 2*sst
+set var/outtype=double sst2
+ 
+! For saving as INT and smaller, the default missing value
+! can't be the default Ferret value
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+! sst is saved in its native type, float
+! sst2 and sst3 have SET VAR/OUTTYPE types
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! SET LIST/OUTTYPE overrides native type and SET VAR/OUTTYPE
+can var/all
+ 
+let sst2 = 2*sst
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+set list/outtype=double
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=short
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  SHORT     missing_value   SHORT       1    T       -999
+                                 _FillValue      SHORT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=byte
+let/bad=-99 sst4 = missing(sst, -99)
+save/x=300/y=0:5/clobber/file=mytype.nc sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! shows the outtype
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = Byte
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! CANCEL LIST/OUTTYPE
+cancel list/outtype
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst, sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        5    T       2*SST
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+set list/outtype=int
+save/x=300/y=0:5/clobber/file=mytype.nc sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+cancel list/all
+show list
+        SET LIST/PRECISION =   4
+        SET LIST/FORMAT = [Default]
+        SET LIST/HEADING is ENABLED
+        SET LIST/APPEND is DISABLED
+        SET LIST/FILE=AUTO [created by program] ( when LIST/FILE is used )
+        SET LIST/OUTTYPE = [Default]
+           ----
+        NetCDF-4 settings:
+        NetCDF file type = classic
+        NetCDF chunk sizes = default
+        SHUFFLE set to on
+        ENDIAN set to native
+ 
+! SAVE/OUTTYPE overrides all other settings
+can var/all
+let sst2 = 2*sst3
+ 
+let/bad=-999 sst3 = missing(sst, -999)
+set var/outtype=int sst3
+ 
+let/bad=-99 sst4 = missing(sst, -99)
+set var/outtype=short sst4
+ 
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  DOUBLE    missing_value   DOUBLE      1    T       -999
+                                 _FillValue      DOUBLE      1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=float sst2, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST2                  FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        6    T       2*SST3
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  FLOAT     missing_value   FLOAT       1    T       -999
+                                 _FillValue      FLOAT       1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=byte sst4
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  BYTE      missing_value   BYTE        1    T       -99
+                                 _FillValue      BYTE        1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Type will be int
+set list/outtype=float
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=int sst4, sst3
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 modulo          CHAR        1    T
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          CHAR        1    T
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST4                  INT       missing_value   INT         1    T       -99
+                                 _FillValue      INT         1    T       -99
+                                 long_name       CHAR        17   T       MISSING(SST, -99)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ SST3                  INT       missing_value   INT         1    T       -999
+                                 _FillValue      INT         1    T       -999
+                                 long_name       CHAR        18   T       MISSING(SST, -999)
+                                 history         CHAR        22   T       From coads_climatology
+  
+ 
+! Go back to default setting.
+can list/outtype
+*** Running test: bn_ribbon_plot.jnl
+! bn_ribbon_plot.jnl
+! Test color-line-by variable style of plots
+ 
+show alias ribbon
+   Alias       Command
+   -----       -------
+   RIBBON      PLOT/RIBBON
+ 
+! ribbon plot is 3-variable RIBBON/VS plot
+! RIBBON/VS/LEV= xpts, ypts, var
+! or 2-variable line plot in any direction.
+! RIBBON/LEV= var1, var2
+ 
+! File variables
+use TAO_SST_clim
+set view ul; RIBBON/thick/i=3/lev=10 sst_clim[j=6], sst_clim[j=5]
+set view ur; RIBBON/j=3/lev=10/thick sst_clim[l=6], sst_clim[L=9]
+set view ll; RIBBON/thick/L=3/lev=10 sst_clim[j=4], sst_clim[j=6]
+use gt4d011.cdf
+set view lr; RIBBON/l=15/j=40/lev=v/thick/pal=rnb2 temp[i=96], temp[i=103]
+can data/all
+ 
+! xpts, ypts all present, compare when var has missing.
+ 
+can view
+let/title="Xpts"/units=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+ 
+let/title="SST"/units="Deg C" ypts {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+ 
+let/title="VAR"/Units="V" var =  {\
+14.16,14.31,13.34,11.90,12.19,11.20,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,-0.23,-1.97, 2.94,-0.65}
+ 
+set view ul
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+! Gaps in one of the vs variables
+set view ur
+RIBBON/vs/line/thick/vlim=26:30 xpts,ypts,var
+ 
+let/title="SST"/units="Deg C" ypts2 {\
+29.42,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94} - 0.3
+ 
+let/title="VAR"/Units="V" var2 =  {\
+14.16,14.31,13.34,,,,13.57,12.25,10.37, 9.22,10.05, 5.91, \
+3.13, 6.88, 2.02, 8.63,,-1.97, 2.94,-0.65}
+ 
+! /FAST does not interpolate colors from one point to the next
+list xpts, ypts2, var2
+             X: 0.5 to 20.5
+ Column  1: XPTS is Xpts (degrees_east)
+ Column  2: YPTS2 is SST (Deg C)
+ Column  3: VAR2 is VAR (V)
+            XPTS   YPTS2  VAR2
+1    /  1:  151.0  29.12  14.16
+2    /  2:  153.0  29.13  14.31
+3    /  3:  155.0  29.03  13.34
+4    /  4:  157.0  28.89   ....
+5    /  5:  159.0  28.92   ....
+6    /  6:  161.0  28.82   ....
+7    /  7:  163.0  29.06  13.57
+8    /  8:  165.0  28.92  12.25
+9    /  9:  167.0  28.74  10.37
+10   / 10:  169.0  28.62   9.22
+11   / 11:  171.0  28.70  10.05
+12   / 12:  173.0  28.29   5.91
+13   / 13:  175.0  28.01   3.13
+14   / 14:  177.0  28.39   6.88
+15   / 15:  179.0  27.90   2.02
+16   / 16:  181.0  28.56   8.63
+17   / 17:  183.0  27.68   ....
+18   / 18:  185.0  27.50  -1.97
+19   / 19:  187.0  27.99   2.94
+20   / 20:  189.0  27.64  -0.65
+RIBBON/vs/line/nokey/over/thick=3/fast xpts,ypts2,var2
+ 
+let yp3 = if var2 then ypts2 - 0.3
+PLOT/over/nolab/vs/line/color=black/sym=20 xpts, yp3
+ 
+ 
+! Testing other palettes
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+set view ll
+RIBBON/vs/line/lev=(1,9,1)/pal=ten_by_levels xpts,ypts,var
+ 
+ 
+let/title="Xpts"/units=degrees_east xpts = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,\
+15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35}
+ 
+let/title="Ypts"/units=degrees_north  ypts = { 9.04, 8.67, 8.96, 9.29, 9.18, 9.42,\
+ 9.43, 9.33, 9.19, 9.22, 9.12, 9.36, 9.22, 9.04, 8.92, 9.00, 8.59,\
+ 8.31, 8.69, 8.20, 8.86, 7.98, 7.80, 8.29, 7.94, 8.05, 7.85, 7.55,\
+ 7.56, 6.82, 7.04, 6.66, 6.56, 7.36, 6.52}
+ 
+let/title="SST"/Units="Deg C" var =  {\
+ 1.5,  1.5,  1.5,  1.5,  1.5,\
+ 2.5,  2.5,  2.5,  2.5,  2.5,\
+ 3.5,  3.5,  3.5,  3.5,  3.5,\
+ 4.5,  4.5,  4.5,  4.5,  4.5,\
+ 5.5,  5.5,  5.5,  5.5,  5.5,\
+ 6.5,  6.5,  6.5,  6.5,  6.5,\
+ 7.5,  7.5,  7.5,  7.5,  7.5}
+ 
+set view lr
+RIBBON/vs/line/thick/lev=(1,8,1)/pal=ten_by_levels xpts,ypts,var
+ 
+PLOT/vs/over/sym=20 xpts,ypts
+ 
+ 
+can view
+ 
+! Do an overlay on a map.
+! To use RIBBON/SET, finish with PPL RIBBON/OVER
+ 
+use coads_climatology
+let mask = if sst then 0 else 1
+shade/NOLAB/L=1/x=-50:100/y=-60:50/pal=grayscale mask
+ 
+RIBBON/vs/over/nolab/thick=3/sym=20/key/set xpts, ypts, var
+ppl shakey,1,0
+ppl ribbon/over
+*** Running test: bn_descr_4digit.jnl
+ ! bn_descr_4digit.jnl
+ ! See ticket 1969: step files have 3- or 4-digit extensions
+ ! coads_clim.999, coads_clim.1000, coads_clim.1001
+ 
+use coads_clim_4digit.des
+sh dat
+     currently SET data sets:
+    1> ./coads_clim_4digit.des  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:4       1:4       ...       1:6       ...       ...
+ 
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             DATA SET : COAD
+             FILENAME : coads_clim_4digit.des
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                     2
+ 16-JAN-1900 / 1:  28.20
+ 15-FEB-1900 / 2:  28.36
+ 18-MAR-1900 / 3:  28.35
+ 17-APR-1900 / 4:  28.22
+ 17-MAY-1900 / 5:  28.49
+ 17-JUN-1900 / 6:  28.32
+*** Running test: bn_axis_outtype.jnl
+! bn_axis_outtype.jnl
+!  SET AXIS/OUTTYPE
+! 23-Oct-2012
+ 
+can dat/all
+use coads_climatology
+ 
+set axis/outtype=float `sst,return=xaxis`
+ !-> set axis/outtype=float COADSX
+set axis/outtype=float `sst,return=yaxis`
+ !-> set axis/outtype=float COADSY
+set axis/outtype=float `sst,return=taxis`
+ !-> set axis/outtype=float TIME
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        FLOAT     units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          FLOAT       1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME1)                FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+  
+ 
+! SAVE/OUTTYPE sets the type of the variable not the axes
+save/x=300/y=0:5/clobber/file=mytype.nc/outtype=double sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        FLOAT     units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          FLOAT       1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          FLOAT     units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME1)                FLOAT     units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          FLOAT       1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ 
+! Restore the axis type from the file
+ 
+set axis/outtype=input `sst,return=xaxis`
+ !-> set axis/outtype=input COADSX
+set axis/outtype=input `sst,return=yaxis`
+ !-> set axis/outtype=input COADSY
+set axis/outtype=input `sst,return=taxis`
+ !-> set axis/outtype=input TIME
+ 
+save/x=300/y=0:5/clobber/file=mytype.nc sst
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(COADSX140_140)        DOUBLE    units           CHAR        12   T       degrees_east
+                                 point_spacing   CHAR        4    T       even
+                                 modulo          DOUBLE      1    T       360
+                                 axis            CHAR        1    T       X
+                                 standard_name   CHAR        9    F       longitude
+                                 orig_file_axnameCHAR        13   F       COADSX140_140
+  
+(COADSY46_48)          DOUBLE    units           CHAR        13   T       degrees_north
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       Y
+                                 standard_name   CHAR        8    F       latitude
+                                 orig_file_axnameCHAR        11   F       COADSY46_48
+  
+(TIME)                 DOUBLE    units           CHAR        30   T       hour since 0000-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-0000 00:00:00
+                                 modulo          DOUBLE      1    T       8765.82
+                                 axis            CHAR        1    T       T
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        4    F       TIME
+  
+ SST                   FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        23   T       SEA SURFACE TEMPERATURE
+                                 history         CHAR        22   T       From coads_climatology
+                                 units           CHAR        5    T       Deg C
+                                 Ferret_PrecisionCHAR        69   F       This variable written using Ferret was converted from FLOAT to DOUBLE
+  
+ 
+! User-defined axes are output as double by default.
+ 
+define axis/t=1-jan-1990:1-feb-1990:2/units=hours myhours
+let tt = t[gt=myhours] - `t[gt=myhours,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myhours] - 779832
+ 
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+set axis/outtype=int myhours
+set var/bad=-9999 tt
+ 
+save/clobber/file=mytype.nc/outtype=int tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             INT       units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    INT       missing_value   INT         1    T       -9999
+                                 _FillValue      INT         1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+! Restore the type of non-file axis, to double
+ 
+set axis/outtype=input myhours
+save/clobber/file=mytype.nc tt
+use mytype.nc; sh dat/att mytype.nc; can data mytype
+     currently SET data sets:
+    2> ./mytype.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(MYHOURS1)             DOUBLE    units           CHAR        31   T       hours since 1901-01-15 00:00:00
+                                 axis            CHAR        1    T       T
+                                 calendar        CHAR        9    T       GREGORIAN
+                                 time_origin     CHAR        11   T       15-JAN-1901
+                                 standard_name   CHAR        4    F       time
+                                 orig_file_axnameCHAR        7    F       MYHOURS
+  
+ TT                    DOUBLE    missing_value   DOUBLE      1    T       -9999
+                                 _FillValue      DOUBLE      1    T       -9999
+                                 long_name       CHAR        22   T       T[GT=MYHOURS] - 779832
+  
+ 
+ 
+! not all axes can be correctly represented in all data types
+! Intentional errors:
+set mode ignore
+ 
+define axis/t=1-jan-1990:1-feb-1992:2/units=seconds myseconds
+let tt = t[gt=myseconds] - `t[gt=myseconds,L=1]`
+ !-> DEFINE VARIABLE tt = t[gt=myseconds] - 2.8073952E+09
+ 
+set axis/outtype=int myseconds
+save/L=32875000:32875201/clobber/file=mytype.nc tt
+ 
+ 
+use proleptic_gregorian.nc
+set axis/outtype=byte `my_data,return=taxis`
+ !-> set axis/outtype=byte TDAYS
+save/clobber/file=mytype.nc my_data
+ 
+set axis/outtype=int `my_data,return=taxis`
+ !-> set axis/outtype=int TDAYS
+save/clobber/file=mytype.nc my_data
+ 
+cancel mode ignore
+ 
+*** Running test: bn_axis_nonmonotonic.jnl
+! bn_axis_nonmonotonic.jnl
+! bn_define_axis doesnt test the case where the varible is not monotonic
+! ACM 11/2012  With Ferret v6.83+ the message tells us the index value
+ 
+! Intentional error
+ 
+set mode ignore
+let tvar = {85, 86, 86, 87, 88, 89, 90, 91, 92, 92, 92, 91, 92, 94, 95, 98}
+define axis/t/units=days tax = tvar
+ 
+cancel mode ignore
+*** Running test: bn_vec_mod.jnl
+! bn_vec_mod.jnl
+! /MODULO qualifier for the vector command.
+! 12/12/2012 ACM
+!
+! (Note for a test of POLY/MODULO see
+! /home/users/ansley/ans_ferret/users/brockmann/polymod.jnl)
+ 
+use tripolar_subset.nc
+ 
+! Define a V component for vectors
+ 
+let fakev = 0.8*u - 0.1*geolat_c
+set view ul
+vec u,fakev,geolon_c,geolat_c
+set view ll
+vec/MOD/HLIM=0:360 u,fakev,geolon_c,geolat_c
+set view lr
+vec/MOD/HLIM=-180:180 u,fakev,geolon_c,geolat_c
+ 
+can view
+*** Running test: bn685_bug_fixes.jnl
+! bn685_bug_fixes.jnl
+! test various fixes that went into version 6.85
+! 1/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err684_label_quotes
+! err684_label_quotes.jnl
+! See ticket 1298.
+ 
+! A long-standing bug, error message if a label
+! enclosed in single quotes is sent to pplus
+! The single quotes triggers an attempt to translate
+! a pplus symbol.
+ 
+plot/set/i=1:12 1./i
+  ppl xlab "'My X label'"
+  ppl ylab "'My Y Label'"
+  ppl title "'A title w/ single quotes'. Need not be in pairs: Ka'imimoana"
+ppl plot
+ 
+ 
+! Here is the example from the ticket
+ 
+! This is ok
+say "'hello'"
+'hello'
+ 
+! this returned an error
+label 4.5 .5 0 0 .3 "'hello'"
+ 
+GO bn_reset
+cancel mode verify
+GO err684_context_shape
+! when limits are omitted with a compressing transformation the grave
+! accent R=SHAPE erroneously includes the corresponding axis in the shape
+ 
+! The problem was when INTERP_CONTEXT calls COMPLETE_MISSING_LIMITS.
+! That routine fills in both the SS and the WW limits as the full axis span.
+! in a full-fledged evaluation occurred the ss limits would be set to
+! -999:-999 at the time that the transform was stripped from the stack
+ 
+! The fix is to simulate this action inside of INTERP_CONTEXT
+ 
+use coads_climatology
+say `sst[l=1:12 at ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `sst[l=@ave],ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+let a = sst[l=1:12 at ave]
+let b = sst[l=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XY
+XY
+ 
+GO bn_reset
+cancel mode verify
+GO err684_tax_fcns
+!err684_tax_fcns.jnl
+! See ticket 2043, bug in workaround for single-precision arguments
+!                  no longer needed in double-precision Ferret
+! The output at 13-oct and 18-oct was incorrect
+ 
+ define axis/t/units=days/t0=1-jan-1950 tday = { \
+ 20724.935546875, 20729.921875, 20734.951171875,\
+20739.96484375, 20744.939453125, 20749.8984375, 20754.92578125}
+ 
+ let var = t[gt=tday]
+ 
+ 
+ list/L=3:7 tax_datestring(var, var, "second")
+             VARIABLE : TAX_DATESTRING(VAR, VAR, "second")
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:"08-OCT-2006 22:49:41"
+ 13-OCT-2006 23 / 4:"13-OCT-2006 23:09:22"
+ 18-OCT-2006 22 / 5:"18-OCT-2006 22:32:48"
+ 23-OCT-2006 21 / 6:"23-OCT-2006 21:33:45"
+ 28-OCT-2006 22 / 7:"28-OCT-2006 22:13:07"
+ 
+ list/L=3:7 tax_day(var, var)
+             VARIABLE : TAX_DAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:   8.00
+ 13-OCT-2006 23 / 4:  13.00
+ 18-OCT-2006 22 / 5:  18.00
+ 23-OCT-2006 21 / 6:  23.00
+ 28-OCT-2006 22 / 7:  28.00
+ 
+ list/L=3:7 tax_dayfrac(var, var)
+             VARIABLE : TAX_DAYFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.9512
+ 13-OCT-2006 23 / 4:  0.9648
+ 18-OCT-2006 22 / 5:  0.9394
+ 23-OCT-2006 21 / 6:  0.8984
+ 28-OCT-2006 22 / 7:  0.9258
+ 
+ list/L=3:7 tax_jday(var, var)
+             VARIABLE : TAX_JDAY(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  281.0
+ 13-OCT-2006 23 / 4:  286.0
+ 18-OCT-2006 22 / 5:  291.0
+ 23-OCT-2006 21 / 6:  296.0
+ 28-OCT-2006 22 / 7:  301.0
+ 
+ list/L=3:7 tax_jday1900(var, var)
+             VARIABLE : TAX_JDAY1900(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  38996.
+ 13-OCT-2006 23 / 4:  39001.
+ 18-OCT-2006 22 / 5:  39006.
+ 23-OCT-2006 21 / 6:  39011.
+ 28-OCT-2006 22 / 7:  39016.
+ 
+ list/L=3:7 tax_month(var, var)
+             VARIABLE : TAX_MONTH(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  10.00
+ 13-OCT-2006 23 / 4:  10.00
+ 18-OCT-2006 22 / 5:  10.00
+ 23-OCT-2006 21 / 6:  10.00
+ 28-OCT-2006 22 / 7:  10.00
+ 
+ list/L=3:7 tax_yearfrac(var, var)
+             VARIABLE : TAX_YEARFRAC(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  0.7699
+ 13-OCT-2006 23 / 4:  0.7836
+ 18-OCT-2006 22 / 5:  0.7973
+ 23-OCT-2006 21 / 6:  0.8110
+ 28-OCT-2006 22 / 7:  0.8247
+ 
+ list/L=3:7 tax_year(var, var)
+             VARIABLE : TAX_YEAR(VAR, VAR)
+             SUBSET   : 5 points (TIME)
+ 08-OCT-2006 22 / 3:  2006.
+ 13-OCT-2006 23 / 4:  2006.
+ 18-OCT-2006 22 / 5:  2006.
+ 23-OCT-2006 21 / 6:  2006.
+ 28-OCT-2006 22 / 7:  2006.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_subset
+! err684_bug_save_subset
+! see ticke 2064, precision in internal comparison of coordinate data
+ 
+! previously gave a message about inconsistent coords
+ 
+use bug_save_subset.nc
+save/clobber/file=aa.nc/i=5:15 sh
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_line_plot_zero
+! err684_line_plot_zero.jnl
+! plot all-zero variable gave blank plot.
+! For a correct plot, yaxis_min and yaxis_max should be -1.0 and 1.0 not 0.0, 0.0
+ 
+plot {0,0,0}
+sh sym yaxis*
+YAXIS_MIN = "-1.0000000"
+YAXIS_MAX = "1.000000"
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_delimited_precision
+! err684_delimited_precision.jnl
+! 5/2013 Fixing bug 2066
+! Reading numeric data with /FORM=DELIM converted to single precision
+ 
+! Data has numeric, longitude, and latitude values needing double precision.
+! The seconds portion of time is also now read with double precision
+sp cat delim_prec.dat
+  734654.0000  330.1234500E  42.00001000N  00:00:1.00000001
+  734654.0104  330.1234600E  42.00004000N  00:00:1.00000003
+  734654.0208  330.1234700E  42.00006000N  00:00:1.00000007
+  734654.0313  330.1234800E  42.00007000N  00:00:1.000000095
+ 
+! Delimited read, automatically detect data types
+set data/ez/format=delim/del=" " delim_prec.dat
+list/i=1:5/prec=10 v1,v2,v3,v4
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: V1
+ Column  2: V2 is V2 (degrees_east)(Longitude)
+ Column  3: V3 is V3 (degrees_north)(Latitude)
+ Column  4: V4 is V4 (hours)(Time of day)
+                  V1       V2           V3             V4
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+! Delimited read, specify data types
+can dat/all
+set data/ez/format=delim/del=" "/var="day,lon,lat,tim"/type="numeric,longitude,latitude,time" delim_prec.dat
+list/prec=10 day, lon, lat, tim
+             DATA SET: ./delim_prec.dat
+             X: 0.5 to 4.5
+ Column  1: DAY
+ Column  2: LON is LON (degrees_east)(Longitude)
+ Column  3: LAT is LAT (degrees_north)(Latitude)
+ Column  4: TIM is TIM (hours)(Time of day)
+                 DAY       LON          LAT            TIM
+1   / 1:  734654.0000  330.1234500  42.00001000  2.777777806E-04
+2   / 2:  734654.0104  330.1234600  42.00004000  2.777777861E-04
+3   / 3:  734654.0208  330.1234700  42.00006000  2.777777972E-04
+4   / 4:  734654.0313  330.1234800  42.00007000  2.777778042E-04
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err6842_context_shape
+! err6842_context_shape.jnl
+! 5/2013 acm
+! Continuing the fixes for #1801 (see ticket 2051, and
+! see err68_context_shape.jnl
+ 
+! Compound expressions did not always return the correct
+! result,depending on the order of the sub-expressions.
+ 
+use coads_climatology
+ 
+! All the returns in this script should say XYT
+ 
+! Here the second used to just say XY
+ 
+let a = sst - sst[t=1:12 at ave]
+let b = sst - sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+let a = sst[t=1:12 at ave] + sst
+let b = sst[t=@ave] + sst
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+! The second used to just say XY
+! and the third said XY
+ 
+let a = sst - sst[t=1:12 at ave] + sst[x=1:100 at ave]
+let b = sst - sst[t=@ave] + sst[x=@ave]
+let c = sst - sst[x=@ave] + sst[t=@ave]
+say `a,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `b,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+say `c,ret=shape`
+ !-> MESSAGE/CONTINUE XYT
+XYT
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_evnt_z
+! err684_evnt_z.jnl
+! see ticket 2054
+ 
+! Result of @EVNT is correct in x direction
+ 
+let my_var1 = { 0, 0, 1, 2, 3, 4 }
+let my_event1 = my_var1[x=@evnt:0.1]
+list my_var1, my_event1! Right answer
+             X: 0.5 to 6.5
+ Column  1: MY_VAR1 is { 0, 0, 1, 2, 3, 4 }
+ Column  2: MY_EVENT1 is MY_VAR1[X=@EVNT:0.1]
+        MY_VAR1  MY_EVENT1
+1   / 1:   0.000   0.000
+2   / 2:   0.000   0.000
+3   / 3:   1.000   1.000
+4   / 4:   2.000   1.000
+5   / 5:   3.000   1.000
+6   / 6:   4.000   1.000
+ 
+! Should be same in the Z direction:
+ 
+let my_var = zsequence( my_var1)
+let my_event = my_var[z=@evnt:0.1]
+list my_var, my_event
+             Z: 0.5 to 6.5
+ Column  1: MY_VAR is ZSEQUENCE( MY_VAR1)
+ Column  2: MY_EVENT is MY_VAR[Z=@EVNT:0.1]
+        MY_VAR  MY_EVENT
+1   / 1:  0.000   0.000
+2   / 2:  0.000   0.000
+3   / 3:  1.000   1.000
+4   / 4:  2.000   1.000
+5   / 5:  3.000   1.000
+6   / 6:  4.000   1.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_save_expression
+! err684_save_expression.jnl
+! Bug 2076. If we write out an expression that has not been defined
+! as a user-variable, the variable didn't have missing_value and _FillValue
+! attributes and was written as single-precision float.
+ 
+! Define a variable - result is correct
+use coads_climatology
+let a = sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+save/clob/file=a.nc a
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		A:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		A:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ A = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+save/clob/file=aa.nc sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	double E410(TIME) ;
+		E410:missing_value = -1.e+34 ;
+		E410:_FillValue = -1.e+34 ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.0994369294620974, -0.0415768591396031, 0.141480238198142 ;
+}
+ 
+! Double check the missing-value matches what is written.
+ 
+save/clob/file=aa.nc/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Can we ask to save as another data type?
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will fail.
+ 
+save/clob/file=aa.nc/outtype=float sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+sp ncdump aa.nc
+netcdf aa {
+dimensions:
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float E410(TIME) ;
+		E410:missing_value = -1.e+34f ;
+		E410:_FillValue = -1.e+34f ;
+		E410:long_name = "SST[X=@AVE,Y=@AVE]-SST[X=@AVE,Y=@AVE,T=@AVE]" ;
+		E410:long_name_mod = "X=20E:20E(380), Y=90S:90N, T=01-JAN 00:45:01-APR 08:12" ;
+		E410:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ E410 = -0.09943693, -0.04157686, 0.1414802 ;
+}
+ 
+save/clob/file=aa.nc/outtype=float/y=-81:-75 sst[x=@ave]-sst[x=@ave,t=@ave]
+use aa.nc
+list e410
+             VARIABLE : SST[X=@AVE]-SST[X=@AVE,T=@AVE]
+                        X=20E:20E(380), T=01-JAN 00:45:01-APR 08:12
+             FILENAME : aa.nc
+             SUBSET   : 4 by 3 points (LATITUDE-TIME)
+                    81S    79S    77S    75S   
+                     1      2      3      4
+ 16-JAN      / 1:   ....   ....  0.278  0.379
+ 15-FEB      / 2:   ....   .... -0.005 -0.122
+ 17-MAR      / 3:   ....   .... -1.028 -0.484
+ 
+can dat 2
+ 
+! Note can't set the bad-flag of an expresion so
+! asking for type of INT cannot match missing to
+! data type so will return an error.
+ 
+set mode ignore
+save/clob/file=aa.nc/outtype=int sst[x=@ave,y=@ave]-sst[x=@ave,y=@ave,t=@ave]
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_degC_axlab
+! err684_degC_axlab.jnl
+! ACM 6/2013
+! See ticket 2080. Units of degree_C interpreted as if degree_north.
+ 
+ppl clsplt
+set win/asp=1
+can mode logo
+set mode meta degC_axlab.plt
+ 
+let/units="degree_C"/title=temperature temp = {1,2,3,2,0}
+let/units="m"/title=depth depth = {1,5,1,5,0}
+plot/vs temp, depth
+ 
+set mode/last meta
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err684_null_stringwrite
+! err684_null_stringwrite.jnl
+! 18-Jun-2013 ACM
+!
+! Bug 2081
+! write a null string variable (0-length string) to NetCDF
+ 
+! This is ok
+let avar = {"a", "", "c"}
+save/file=a.nc/clobber avar
+ 
+! Write just a null value resulted in a NetCDF library error
+ 
+set mode ignore
+let anull = avar[i=2]
+ 
+save/clobber/file=a.nc anull
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_FillValue_xml
+! err684_FillValue_xml.jnl
+! ACM 6/2013
+!
+! See the dataset at http://ferret.pmel.noaa.gov/thredds/dodsC/woa09_1deg_monthly
+! where the "number of" variables have  _FillValues attributes = -2147483647
+! This value was being written to the xml headers as a float, without enough precision.
+! See las ticket #761, fixes in show_data_set_vars_xml.F
+ 
+! should be    <value>-2147483647</value>
+! instead of:  <value>-2.147484E+09</value>
+ 
+use fill_value_int.nc
+sh dat/var/xml
+<datasets>
+<dataset name="./fill_value_int.nc" default="true">
+<title>INT variable with _FillValue -2147483647</title>
+<var name="A_dd">
+<attribute name="units" type="char">
+   <value><![CDATA[1]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[Number of O2 Utilization Observations]]></value>
+</attribute>
+<attribute name="_FillValue" type="float">
+   <value>     -2147483647</value>
+</attribute>
+<attribute name="ferret_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[LONG]]></value>
+</attribute>
+<grid name="GEW1">
+<axes>
+<xaxis>LON</xaxis>
+</axes>
+</grid>
+</var>
+</dataset>
+</datasets>
+<axes>
+<axis name="LON">
+<attribute name="direction" type="char">
+   <value><![CDATA[I]]></value>
+</attribute>
+<attribute name="units" type="char">
+   <value><![CDATA[degrees_east]]></value>
+</attribute>
+<attribute name="length" type="short">
+   <value>2</value>
+</attribute>
+<attribute name="start" type="double">
+   <value>300.5</value>
+</attribute>
+<attribute name="end" type="double">
+   <value>301.5</value>
+</attribute>
+<attribute name="point_spacing" type="char">
+   <value><![CDATA[even]]></value>
+</attribute>
+<attribute name="modulo" type="char">
+   <value><![CDATA[yes]]></value>
+</attribute>
+<attribute name="modulo_length" type="short">
+   <value>360</value>
+</attribute>
+<attribute name="infile_datatype" type="char">
+   <value><![CDATA[FLOAT]]></value>
+</attribute>
+<attribute name="long_name" type="char">
+   <value><![CDATA[longitude]]></value>
+</attribute>
+<attribute name="axis" type="char">
+   <value><![CDATA[X]]></value>
+</attribute>
+<attribute name="standard_name" type="char">
+   <value><![CDATA[longitude]]></value>
+</attribute>
+<attribute name="orig_file_axname" type="char">
+   <value><![CDATA[lon]]></value>
+</attribute>
+</axis>
+</axes>
+ 
+GO bn_reset
+cancel mode verify
+GO err684_axticlab
+! err684_axticlab
+! 7/10/2013 *acm
+!
+! ticket 1990: axis tic labels for higher precison data
+! had just 2 digits, and didnt capture the data range.
+ 
+set mode meta axticlabel.plt
+ 
+let/title="tic labels on dependent axis" var = {\
+1.715,1.7136,1.711,1.7083,1.7056,1.703,1.7003,1.6976,1.695,1.6923,\
+1.6897,1.687,1.6843,1.6817,1.679,1.6765,1.676,1.676}
+ 
+plot/line/sym/title="Vert axis labels should be 1.675 thru 1.715" var
+can mode meta
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_dotstart
+! err684_dotstart.jnl
+! 12-Jul-2013 ACM
+!
+! Bug 2084. Avoid a STOP if the expression starts with a .
+!           Issue a normal error message if its an invalid string.
+ 
+set mode ignore
+ 
+! This previously kicked out with  STOP ALG_BREAK_UP
+! Now will issue an error
+list .hello
+ 
+! Related syntax: var.att. Generate errors since no dataset is open
+list a.units
+list ..history
+ 
+! Just a dot is interpretd as a number.
+list .
+             VARIABLE : constant
+          0.0000
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err684_vfine_to_coarse
+ ! err684_vfine_to_coarse
+ ! see ticket 2070.
+ 
+def ax/x/edge axi = {0,31,61,92}
+def ax/x/edge axi_coarse = {0, 92}
+let vdat = {3.034547, 3.078104, 3.059311}
+let v = vdat[gx=axi at asn]
+let v_coarse = v[gx=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GX=AXI_COARSE at MAX]
+             X        : 46
+          3.078
+list v eq v_coarse[gx=v at ave]
+             VARIABLE : V EQ V_COARSE[GX=V at AVE]
+             SUBSET   : 3 points (X)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Y direction
+can var/all
+ 
+def ax/y/edge axi = {0,31,61,92}
+def ax/y/edge axi_coarse = {0, 92}
+let vdat = ySEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gy=axi at asn]
+let v_coarse = v[gy=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GY=AXI_COARSE at MAX]
+             Y        : 46
+          3.078
+list v eq v_coarse[gy=v at ave]
+             VARIABLE : V EQ V_COARSE[GY=V at AVE]
+             SUBSET   : 3 points (Y)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! Z direction
+can var/all
+ 
+def ax/z/edge axi = {0,31,61,92}
+def ax/z/edge axi_coarse = {0, 92}
+let vdat = zSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gz=axi at asn]
+let v_coarse = v[gz=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GZ=AXI_COARSE at MAX]
+             Z        : 46
+          3.078
+list v eq v_coarse[gz=v at ave]
+             VARIABLE : V EQ V_COARSE[GZ=V at AVE]
+             SUBSET   : 3 points (Z)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! T direction
+can var/all
+ 
+def ax/t/edge axi = {0,31,61,92}
+def ax/t/edge axi_coarse = {0, 92}
+let vdat = TSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gt=axi at asn]
+let v_coarse = v[gt=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GT=AXI_COARSE at MAX]
+             T        : 46
+          3.078
+list v eq v_coarse[gt=v at ave]
+             VARIABLE : V EQ V_COARSE[GT=V at AVE]
+             SUBSET   : 3 points (T)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+! E direction
+can var/all
+ 
+def ax/e/edge axi = {0,31,61,92}
+def ax/e/edge axi_coarse = {0, 92}
+let vdat = ESEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[ge=axi at asn]
+let v_coarse = v[ge=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GE=AXI_COARSE at MAX]
+             E        : 46
+          3.078
+list v eq v_coarse[ge=v at ave]
+             VARIABLE : V EQ V_COARSE[GE=V at AVE]
+             SUBSET   : 3 points (E)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+ 
+ 
+! F direction
+can var/all
+ 
+def ax/f/edge axi = {0,31,61,92}
+def ax/f/edge axi_coarse = {0, 92}
+let vdat = FSEQUENCE({3.034547, 3.078104, 3.059311})
+let v = vdat[gf=axi at asn]
+let v_coarse = v[gf=axi_coarse at max]
+ 
+list v_coarse
+             VARIABLE : V[GF=AXI_COARSE at MAX]
+             F        : 46
+          3.078
+list v eq v_coarse[gf=v at ave]
+             VARIABLE : V EQ V_COARSE[GF=V at AVE]
+             SUBSET   : 3 points (F)
+ 15.5 / 1:  0.000
+ 46   / 2:  1.000
+ 76.5 / 3:  0.000
+ 
+GO bn_reset
+cancel mode verify
+GO err684_repeated_coordindates
+! err685_repeated_coordindates.jnl
+!  The NOTE about repeated axis coordaintes reported the wrong index location.
+ 
+use latestOb.nc
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_packed_output
+! err684_packed_output.jnl
+! See ticket 2089
+! By default keep the output type, means we need to
+! re-pack packed data.
+ 
+use err684_packed_output.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : err684_packed_output.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+! data is SHORT, is not scaled
+ 
+save/clobber/file=sst_new.nc sst
+ 
+can data/all
+use sst_new.nc
+list/i=1:3 sst
+             VARIABLE : Daily Sea Surface Temperature (degC)
+             FILENAME : sst_new.nc
+             SUBSET   : 3 by 4 points (LONGITUDE-LATITUDE)
+             TIME     : 01-OCT-2012 00:00
+              80.13E 80.38E 80.63E 
+                1      2      3
+ 15.88N / 4:   ....   ....  29.03
+ 15.63N / 3:   ....  29.18  29.09
+ 15.38N / 2:  29.36  29.21  29.10
+ 15.13N / 1:  29.40  29.27  29.13
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_string_dim_name
+! err685_string_dim_name.jnl
+! Ticket 2091. If the string variable shares its dimension name,
+! want to just mark it as a file variable not a coord variable.
+ 
+! Previously issued warnings about string coordinate variable.
+use trajectory_trajectory_name.nc
+ 
+! Previously trajectory was not listed among the file variables.
+list ..varnames
+             VARIABLE : ..VARNAMES
+             FILENAME : trajectory_trajectory_name.nc
+             SUBSET   : 6 points (X)
+ 1   / 1:"trajectory"
+ 2   / 2:"rowSize"   
+ 3   / 3:"longitude" 
+ 4   / 4:"latitude"  
+ 5   / 5:"time"      
+ 6   / 6:"temp"      
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err684_define_grid
+! err684_define_grid.jnl
+! 25-Oct-2013 ACM
+!
+! Bug 2096, defining grid with some user-defined axes. Previously
+! this resulted in err msg with inappropriate orientation for Z axis
+ 
+define axis/z=0:100:2/depth/unit=meters zax
+define axis/x=-178:-157:1/units=degrees_east lon_ax
+define axis/y=54:66:0.5/units=degrees_north lat_ax
+ 
+define grid/x=lon_ax/y=lat_ax/z=zax three_d_grd
+ 
+*** Running test: bn_dsg_e_x.jnl
+! bn_dsg_e.jnl
+!
+!  Discrete Sampling Geometries files
+!  Create grids such that the instance dimension
+!  is on the E axis, so that the variable which
+!  has the cf_role attribute has an E grid.
+!  The obs axis is in the X direction.
+ 
+use dsg.nc
+sh dat
+     currently SET data sets:
+    1> ./dsg.nc  (default)
+ name     title                             I         J         K         L         M         N
+ ROWSIZE  number of obs for this profile   ...       ...       ...       ...       1:3       ...
+ PROFILE  profile ID: Cruise and Station   ...       ...       ...       ...       1:3       ...
+ TIME     time                             ...       ...       ...       ...       1:3       ...
+ LATITUDE station latitude                 ...       ...       ...       ...       1:3       ...
+ LONGITUDE
+          station longitude                ...       ...       ...       ...       1:3       ...
+ POT_TEMP_DEGC
+          pot_temp_degc                    1:34      ...       ...       ...       ...       ...
+ SAL      sal                              1:34      ...       ...       ...       ...       ...
+ 
+sh att profile
+     attributes for dataset: ./dsg.nc
+ profile.missing_value = -1.E+34
+ profile._FillValue = -1.E+34
+ profile.long_name = profile ID: Cruise and Station 
+ profile.cf_role = profile_id 
+ profile.history = From FINAL_verification_data_all_PacOOS_NHL_OCNMS_CCCC_03072013.txt 
+sh grid rowsize
+    GRID GEN1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ normal    T
+ PROF      E                    3 r   1                    3
+ normal    F
+sh grid sal
+    GRID GEN2
+ name       axis              # pts   start                end
+ OBS       X                   34 r   1                    34
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+*** Running test: bn_nco_append.jnl
+! bn_nco_append.jnl
+! 5/2013 add a test appending files with ncks
+ 
+ ! These functions use Unix NCO utilities, found at http://nco.sourceforge.net/
+ ! If NCO is not installed, it is fine to comment out this script when running
+ ! the Ferret benchmark suite.
+ 
+! Prior to v6.85 Ferret's NCO function always included -O for Override.
+! Appending failed. In v6.85+, if -A is included then dont send -O to ncks.
+use z1
+use z2
+sh dat
+     currently SET data sets:
+    1> ./z1.nc
+ name     title                             I         J         K         L         M         N
+ DDAT_ORIG
+          DDAT[GZ=ZAXIS_ORIG at ASN]          ...       ...       1:5       ...       ...       ...
+ 
+    2> ./z2.nc  (default)
+ name     title                             I         J         K         L         M         N
+ CYCLE_ORIG
+          CYCLE[GZ=ZAXIS_ORIG at ASN]         ...       ...       1:5       ...       ...       ...
+ 
+ 
+! Write a file to be appended to and append variable in z1.nc to the file.
+ 
+save/clobber/file=append_to_this.nc cycle_orig
+load nco("ncks", "-A -h z1.nc append_to_this.nc")
+sp ncdump -h append_to_this.nc
+netcdf append_to_this {
+dimensions:
+	ZAXIS_ORIG = 5 ;
+variables:
+	double ZAXIS_ORIG(ZAXIS_ORIG) ;
+		ZAXIS_ORIG:point_spacing = "even" ;
+		ZAXIS_ORIG:axis = "Z" ;
+		ZAXIS_ORIG:standard_name = "altitude" ;
+	double CYCLE_ORIG(ZAXIS_ORIG) ;
+		CYCLE_ORIG:missing_value = -1.e+34 ;
+		CYCLE_ORIG:_FillValue = -1.e+34 ;
+		CYCLE_ORIG:long_name = "CYCLE[GZ=ZAXIS_ORIG at ASN]" ;
+		CYCLE_ORIG:history = "From z2" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_nobounds.jnl
+! bn_nobounds.jnl
+! The SAVE/NOBOUNDS qualifier causes bounds never to be written
+! even if the data is irregular, and even if the axis came into
+! Ferret with bounds.
+ 
+define axis/x/units=meters xirreg = {0,1,2,4,8}
+let avar = x[gx=xirreg]
+save/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+	bnds = 2 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:units = "meters" ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+		XIRREG:bounds = "XIRREG_bnds" ;
+	double XIRREG_bnds(XIRREG, bnds) ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ XIRREG_bnds =
+  -0.5, 0.5,
+  0.5, 1.5,
+  1.5, 3,
+  3, 6,
+  6, 10 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+save/nobounds/clobber/file=a.nc avar
+sp ncdump a.nc
+netcdf a {
+dimensions:
+	XIRREG = 5 ;
+variables:
+	double XIRREG(XIRREG) ;
+		XIRREG:units = "meters" ;
+		XIRREG:point_spacing = "uneven" ;
+		XIRREG:axis = "X" ;
+	double AVAR(XIRREG) ;
+		AVAR:missing_value = -1.e+34 ;
+		AVAR:_FillValue = -1.e+34 ;
+		AVAR:long_name = "X[GX=XIRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XIRREG = 0, 1, 2, 4, 8 ;
+
+ AVAR = 0, 1, 2, 4, 8 ;
+}
+ 
+! The dataset has a bounds attribute on the time axis
+! (the bounds themselves get corrected by Ferret on opening the file)
+use gappy_bounds.nc
+sh dat
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ A        SST[X=150:180 at AVE,Y=-10:0 at AVE]   ...       ...       ...       1:6       ...       ...
+ 
+ 
+! See the bounds attribute on the t axis
+sh dat/att
+     currently SET data sets:
+    1> ./gappy_bounds.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        24   T       FERRET V5.60   24-May-04
+  
+(TGAP)                 DOUBLE    units           CHAR        30   T       DAYS since 1990-01-01 00:00:00
+                                 time_origin     CHAR        20   T       01-JAN-1990 00:00:00
+                                 axis            CHAR        1    T       T
+                                 bounds          CHAR        9    T       TGAP_bnds
+                                 orig_file_axnameCHAR        4    F       TGAP
+  
+ TGAP_bnds             DOUBLE
+  
+ A                     FLOAT     missing_value   FLOAT       1    T       -1.E+34
+                                 _FillValue      FLOAT       1    T       -1.E+34
+                                 long_name       CHAR        30   T       SST[X=150:180 at AVE,Y=-10:0 at AVE]
+                                 history         CHAR        10   T       From coads
+  
+ 
+! On a SAVE/NOBOUNDS, do not write the bounds
+! and do not write a bounds attribute on the axis.
+save/clobber/file=a.nc/nobounds a
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:standard_name = "time" ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! On a SAVE either with /BOUNDS or no bounds qualifier,
+! bounds are written for this irregular time axis.
+save/clobber/file=a.nc/bounds a
+ 
+sp ncdump -h a.nc	
+netcdf a {
+dimensions:
+	TGAP = UNLIMITED ; // (6 currently)
+	bnds = 2 ;
+variables:
+	double TGAP(TGAP) ;
+		TGAP:units = "days since 1990-01-01 00:00:00" ;
+		TGAP:time_origin = "01-JAN-1990 00:00:00" ;
+		TGAP:axis = "T" ;
+		TGAP:bounds = "TGAP_bnds" ;
+		TGAP:standard_name = "time" ;
+	double TGAP_bnds(TGAP, bnds) ;
+	float A(TGAP) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "SST[X=150:180 at AVE,Y=-10:0 at AVE]" ;
+		A:history = "From coads" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+*** Running test: bn_write_integer_att.jnl
+! bn_write_integer_att.jnl
+!  ACM 6/2013
+!
+! This file has an integer attribute
+!    MHCHLA:numberOfObservations = 15736939 ;
+! With double-precision Ferret, we need to call CD_WRITE_ATTVAL_DP
+! in cdf_list.F, so that the value, read in as a double, is written
+! out correctly (else get a netcdf data type matching error).
+ 
+use write_int_att.nc
+sh att mhchla
+     attributes for dataset: ./write_int_att.nc
+ MHCHLA.missing_value = -9999999
+ MHCHLA._FillValue = -9999999
+ MHCHLA.actual_range = 0.00049, 91.76669
+ MHCHLA.coordsys = geographic 
+ MHCHLA.fraction_digits = 2
+ MHCHLA.long_name = Chlorophyll-a, Aqua MODIS, NPP, 0.05 degrees, Global, Science Quality 
+ MHCHLA.numberOfObservations = 15736939
+ MHCHLA.percentCoverage = 0.4216215
+ MHCHLA.standard_name = concentration_of_chlorophyll_in_sea_water 
+ MHCHLA.units = mg m-3 
+ MHCHLA.history = From http://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/MH/chla/mday 
+set att/output=all mhchla
+save/file=a.nc/clobber mhchla
+ 
+sp ncdump a.nc | grep numberOfObservations
+		MHCHLA:numberOfObservations = 15736939 ;
+ 
+ 
+*** Running test: bn_descriptor_mc.jnl
+! bn_descriptor_mc.jnl
+! 7/2013 ACM
+! See ticket 2087
+!
+! Allow extension ".mc" to indicate a descriptor file, as discussed in
+! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00355.html
+!
+use des.mc
+list/x=180/y=0 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.mc
+             SUBSET   : 6 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+                   179E   
+                    80
+ 16-JAN-0000 / 1:  28.20
+ 15-FEB-0000 / 2:  28.36
+ 17-MAR-0000 / 3:  28.35
+ 16-APR-0000 / 4:  28.22
+ 16-MAY-0000 / 5:  28.49
+ 16-JUN-0000 / 6:  28.32
+ 
+! Also implement /FORMAT=desriptor for both USE and SET DATA
+ 
+use/format=desc des.my_descriptor
+list /x=300/y=10 sst
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : des.my_descriptor
+             SUBSET   : 4 points (TIME)
+             LONGITUDE: 61W
+             LATITUDE : 9N
+                    61W   
+                   140
+ 17-MAR-0000 / 1:  26.58
+ 16-APR-0000 / 2:  27.17
+ 16-MAY-0000 / 3:  27.22
+ 16-JUN-0000 / 4:  27.66
+*** Running test: bn_plot_color_only.jnl
+! bn_plot_color_only.jnl
+! 9/20/2013 ACM
+! ticket 2094
+!  PLOT/COLOR with no argument skips the black pen and starts with the next one.
+ 
+let pi=atan(1.)*4.
+let a = (-1)*pi*4 + i[i=1:500]*(8*pi/500)
+let b = sin(a)/a
+ 
+ 
+set view upper
+plot/color b, b[i=@shf:20]
+ 
+! With user-defined colors
+ppl color 2, 0, 50, 100
+ppl color 3, 100, 50, 0
+set view lower
+plot/color/thick=3/dash=(0.05,0.1,0.2,0.1) b, b[i=@shf:20]
+ 
+! With extra user-defined colors
+can view
+set mode linec:12
+can win/all; set win/new
+ppl color,7,100,65,51   ! orange
+ppl color,8,0,55,0      ! dark green
+ppl color,9,60,0,100    ! purple
+ppl color,10,100,70,100 ! magenta
+ppl color,11,80,70,60   ! tan
+ppl color,12,100,88,0   ! yellow
+ 
+plot/thick/color/line/i=1:100 \
+ cos(i/20), cos(i/24), cos(i/28), cos(i/32), \
+ cos(i/36), cos(i/40), cos(i/44), cos(i/48), \
+ cos(i/52), cos(i/56), cos(i/60), cos(i/64)
+ 
+cancel mode linecolors
+can win/all; set win/new
+ 
+! If lines are plotted using /OVER, Ferret keeps track of the number of lines
+! and continues with the next set of colors. When /startcolor is given, the
+! count is incremented so that subsequent plots continue with the color
+! sequence.
+ 
+! colors 1, 2, 3, 4
+set view upper
+plot/thick/i=1:50/vlim=-1.1:1.1 sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! colors 2, 3, 4, 5
+set view lower
+plot/thick/i=1:50/vlim=-1.1:1.1/COLOR sin(i/6)
+plot/thick/i=1:50/over sin(i/7)
+plot/thick/i=1:50/over 0.6*sin(i/8)
+plot/thick/i=1:50/over 0.6*sin(i/9)
+ 
+! intentional errors
+! /COLOR (w/o argument) not allowed on PLOT/OVER.
+ 
+can view
+set mode ignore
+ 
+plot/i=1:100 sin(i/6)
+plot/i=1:100/over/COLOR 0.6*sin(i/7)
+ 
+! PLOT/COLOR not allowed on PLOT/RIBBON.
+ 
+can view
+plot/i=1:100/ribbon/COLOR sin(i/6),0.6*sin(i/7)
+ 
+set mode/last ignore
+ 
+ 
+*** Running test: bn_vtree.jnl
+! bn_tree.jnl
+ 
+! 11/2013 -- demonstrate SHOW VARIABLE/TREE and RETRUN=STATUS
+ 
+CANCEL DATA/ALL
+! pure abstract variable -- no dataset
+let a = 1
+show var/tree a
+   A = 1
+ 
+let b = 1
+let c = SIN(b)
+show var/tree c
+   C = SIN(B)
+     B = 1
+ 
+! create dummy datasets so we'll have named file variables to play with
+let fv1 = 1
+let fvx = x[i=1:3]
+let fvz = Z[k=1:3]
+SAVE/CLOBBER/QUIET/FILE=my_file_vars.nc fv1, fvx, fvz
+SAVE/CLOBBER/QUIET/FILE=other_file_vars.nc fv1
+SAVE/CLOBBER/QUIET/FILE=another_file_vars.nc fv1
+CAN VAR/ALL
+use  my_file_vars, other_file_vars, another_file_vars
+set data 1
+ 
+! ================
+ 
+! more pure abstract variables
+let a = 1
+let b = 1
+let c = SIN(b)
+go bn_vtree.sub c
+/TREE=ALL
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=USER
+   in default dataset my_file_vars
+   C = SIN(B)
+     B = 1
+/TREE=FILE
+c is ready and AVAILABLE
+************************
+ 
+! file variables
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1
+/TREE=USER
+/TREE=FILE
+   FV1[d=my_file_vars]
+fv1 is ready and AVAILABLE
+************************
+show var/tree/d=other_file_vars fv1
+ 
+! expressions
+let a = fv1 + fvx
+go bn_vtree.sub a
+/TREE=ALL
+   in default dataset my_file_vars
+   A = FV1 + FVX
+     FV1
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   A = FV1 + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+a is ready and AVAILABLE
+************************
+ 
+let a = fv1[d=1] - fv1[d=2]
+vtree=file a
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+vtree=all a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=1 a
+   in default dataset my_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1
+     FV1[d=other_file_var]
+vtree=all /d=2 a
+   in default dataset other_file_vars
+   A = FV1[D=1] - FV1[D=2]
+     FV1[d=my_file_var]
+     FV1
+********************************
+ 
+! unrecognized variable names
+go bn_vtree.sub noexist
+/TREE=ALL
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! unrecognized dataset
+go bn_vtree.sub v[d=noexist]
+/TREE=ALL
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   V[D=NOEXIST] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   V[D=NOEXIST]  (unknown dataset)
+the problem is UNKNOWN DATASET: V[D=NOEXIST]
+************************
+ 
+! unrecognized dataset and variable
+go bn_vtree.sub novar[d=nodset]
+/TREE=ALL
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=USER
+   in default dataset my_file_vars
+   NOVAR[D=NODSET] ??                           <== UNKNOWN DATASET ******
+/TREE=FILE
+   NOVAR[D=NODSET]  (unknown dataset)
+the problem is UNKNOWN DATASET: NOVAR[D=NODSET]
+************************
+ 
+let b = noexist
+go bn_vtree.sub b
+/TREE=ALL
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset my_file_vars
+   B = NOEXIST
+     NOEXIST ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   NOEXIST  (unknown variable)
+the problem is UNKNOWN VARIABLE: NOEXIST
+************************
+ 
+! grid-changing functions
+go bn_vtree.sub RESHAPE(fvx,fvz)
+/TREE=ALL
+   in default dataset my_file_vars
+   FVX
+   FVZ
+/TREE=USER
+/TREE=FILE
+   FVX[d=my_file_vars]
+   FVZ[d=my_file_vars]
+RESHAPE(fvx,fvz) is ready and AVAILABLE
+************************
+ 
+! file variable aux var
+LET Zpts = Z[Z=0:500:100]
+define axis/z/units=meters zax = zpts
+LET fv1z = fv1[gz(fvz)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+     FV1
+       FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(FVZ)=ZPTS] + FVX
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! user-defined aux vars
+let depth = z[g=fvz]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+let depth = z[g=fvz]+ 0*fvz[k=1]
+LET fv1z = fv1[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+     FV1
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(DEPTH)=ZPTS] + FVX
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+fv1z is ready and AVAILABLE
+************************
+ 
+! unknown aux var
+LET fv1z = fv1[gz(noexist)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = FV1[GZ(NOEXIST)=ZPTS] + FVX
+       NOEXIST   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN AUXILIARY VARIABLE: NOEXIST
+************************
+ 
+! unknown variable with known aux var
+LET fv1z = noexist[gz(depth)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+         FVZ
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(DEPTH)=ZPTS] + FVX
+     NOEXIST[GZ(DEPTH)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       DEPTH = Z[G=FVZ]+ 0*FVZ[K=1]
+/TREE=FILE
+   NOEXIST[GZ(DEPTH)=ZPTS]  (unknown variable)
+   FVZ[d=my_file_vars]
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(DEPTH)=ZPTS]
+************************
+ 
+! unknown variable with unknown aux var
+LET fv1z = noexist[gz(unknown_aux)=zpts] + fvx
+go bn_vtree.sub fv1z
+/TREE=ALL
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+     FVX
+/TREE=USER
+   in default dataset my_file_vars
+   FV1Z = NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] + FVX
+     NOEXIST[GZ(UNKNOWN_AUX)=ZPTS] ??                           <== UNKNOWN VARIABLE ******
+       UNKNOWN_AUX   (unknown auxiliary variable)
+/TREE=FILE
+   NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]  (unknown variable)
+   UNKNOWN_AUX  (unknown auxiliary variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: NOEXIST[GZ(UNKNOWN_AUX)=ZPTS]
+************************
+ 
+! aggregate (ensemble) dataset of file variables
+define data/agg my_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fv1
+/TREE=ALL
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+     FV1[d=my_file_var]
+     FV1[d=other_file_var]
+     FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_AGG
+   FV1   (aggregate variable)
+/TREE=FILE
+ 
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fv1 is ready and AVAILABLE
+************************
+ 
+! aggregation in which some members are uvars
+let/d=other_file_vars   fvx = fv1 + x[gx=fvx[d=1],i=1:3]
+let/d=another_file_vars fvx = 2*fv1 + x[gx=fvx[d=1],i=1:3]
+define data/agg my_uvar_agg = my_file_vars, other_file_vars, another_file_vars
+go bn_vtree.sub fvx
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=my_file_var]
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=other_file_var]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+       FV1[d=another_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   FVX   (aggregate variable)
+     FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+     FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+/TREE=FILE
+ 
+   FVX[d=my_file_vars]
+   FV1[d=other_file_vars]
+   FV1[d=another_file_vars]
+fvx is ready and AVAILABLE
+************************
+ 
+! recursions
+! ... a circular parent dependency is a recursion; sibling dependency is not
+let p0 = s1 + p1
+let p1 = s2 + p2
+let p2 = s3 + p3
+let p3 = p1 + S3
+go bn_vtree.sub p0    ! recursion
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = P1 + S3
+           P1 =   *** WARNING: RECURSIVE DEFINITION.  See above
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S3  (unknown variable)
+the problem is ILLEGAL RECURSIVE VARIABLES: P1
+************************
+let p3 = s1 + S3
+go bn_vtree.sub p0    ! ok
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   P0 = S1 + P1
+     S1 ??                           <== UNKNOWN VARIABLE ******
+     P1 = S2 + P2
+       S2 ??                           <== UNKNOWN VARIABLE ******
+       P2 = S3 + P3
+         S3 ??                           <== UNKNOWN VARIABLE ******
+         P3 = S1 + S3
+           S1 ??                           <== UNKNOWN VARIABLE ******
+           S3 ??                           <== UNKNOWN VARIABLE ******
+/TREE=FILE
+   S1  (unknown variable)
+   S2  (unknown variable)
+   S3  (unknown variable)
+   S1  (unknown variable)
+   S3  (unknown variable)
+the problem is UNKNOWN VARIABLE: S1
+************************
+ 
+! suppressing duplicated siblings (twins)
+let fv = fv1 + fv1 + fv1
+let uv = fvx + fvx + fvx
+show var/tree/d=my_file_vars    fv
+   in default dataset my_file_vars
+   FV = FV1 + FV1 + FV1
+show var/tree/d=my_uvar_agg     fv
+   in default dataset MY_UVAR_AGG
+   FV = FV1 + FV1 + FV1
+     FV1   (aggregate variable)
+show var/tree/d=other_file_vars uv
+   in default dataset other_file_vars
+   UV = FVX + FVX + FVX
+     FVX = FV1 + X[GX=FVX[D=1],I=1:3]
+show var/tree/d=my_uvar_agg     uv
+   in default dataset MY_UVAR_AGG
+   UV = FVX + FVX + FVX
+     FVX   (aggregate variable)
+       FVX[d=other_file_var] = FV1 + X[GX=FVX[D=1],I=1:3]
+       FVX[d=another_file_var] = 2*FV1 + X[GX=FVX[D=1],I=1:3]
+***************************
+ 
+! suppressing duplicates elsewhere in the family tree ("defined above")
+let b = c
+let c = 1
+let v1 = a  + b + b^2
+let v2 = v1 + b + a + a        ! a appears after v1
+let v3 = a + v1 + b + a + a    ! a appears before v1
+go bn_vtree.sub v2
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+         FV1[d=my_file_var]
+         FV1[d=other_file_var]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V2 = V1 + B + A + A
+     V1 = A  + B + B^2
+       A = FV1[D=1] - FV1[D=2]
+       B = C
+         C = 1
+     B =  (defined above)
+     A =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v2 is ready and AVAILABLE
+************************
+go bn_vtree.sub v3
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+       FV1[d=my_file_var]
+       FV1[d=other_file_var]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   V3 = A + V1 + B + A + A
+     A = FV1[D=1] - FV1[D=2]
+     V1 = A  + B + B^2
+       A =  (defined above)
+       B = C
+         C = 1
+     B =  (defined above)
+/TREE=FILE
+   FV1[d=my_file_vars]
+   FV1[d=other_file_vars]
+v3 is ready and AVAILABLE
+************************
+ 
+! collections of trees handled as a group
+! display from large tree size to small, suppressing definitions already displayed
+cancel var/all
+let a = f
+let b = fv1[d=my_file_vars]
+let c = 1
+let d = b + c
+let e = 1
+go bn_vtree.sub "a, b, c, noexist, d, e, fvx[d=my_file_vars]"
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+       FV1[d=my_file_var]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+   FVX[d=my_file_var]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = B + C
+     B = FV1[D=MY_FILE_VARS]
+     C = 1
+   A = F
+     F ??                           <== UNKNOWN VARIABLE ******
+   NOEXIST ??                           <== UNKNOWN VARIABLE ******
+   E = 1
+/TREE=FILE
+   F  (unknown variable)
+   FV1[d=my_file_vars]
+   NOEXIST  (unknown variable)
+   FVX[d=my_file_vars]
+the problem is UNKNOWN VARIABLE: F
+************************
+ 
+! reporting other errors in definitions
+  set mode ignore
+ 
+  ! unidentified grid
+  let a = i[i=1:5]
+  let b = a[g=noexist]
+  go bn_vtree.sub b
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   B = A[G=NOEXIST]
+     A[G=NOEXIST]   (unknown grid)
+/TREE=FILE
+   A[G=NOEXIST]  (unknown grid)
+the problem is UNKNOWN GRID: A[G=NOEXIST]
+************************
+  list b
+ 
+  ! syntax error - format of longitude
+  let c = a[x=45s]
+  go bn_vtree.sub c
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   C = A[X=45S]
+     A[X=45S]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[X=45S]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[X=45S]
+************************
+  list c
+ 
+  ! syntax error - extra comma
+  let d = a[i=1,,j=2]
+  go bn_vtree.sub d
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   D = A[I=1,,J=2]
+     A[I=1,,J=2]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[I=1,,J=2]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[I=1,,J=2]
+************************
+  list d
+ 
+  ! syntax error - unknown pseudovariable
+  let e = a[p=1]
+  go bn_vtree.sub e
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   E = A[P=1]
+     A[P=1]   *** WARNING: ERROR IN DEFINITION
+/TREE=FILE
+   A[P=1]   *** WARNING: SYNTAX ERROR
+the problem is ERROR IN EXPRESSION: A[P=1]
+************************
+  list e
+ 
+  ! out of limit region -- not detectable as error, because grids are never determined
+  let f = a[i=10]
+  go bn_vtree.sub f
+/TREE=ALL
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=USER
+   in default dataset MY_UVAR_AGG
+   F = A[I=10]
+     A = I[I=1:5]
+/TREE=FILE
+f is ready and AVAILABLE
+************************
+  list f
+ 
+  set mode/last ignore
+ 
+! dependency through attribute sharing (not yet implemented)
+let a = fvz.long_name[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = FVZ.LONG_NAME[D=1]
+let a = ..history[d=1]
+show var/tree a
+   in default dataset MY_UVAR_AGG
+   A = ..HISTORY[D=1]
+*** Running test: bn686_bug_fixes.jnl
+! bn686_bug_fixes
+! test various fixes that went into version 6.86
+! 11/2013 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ribbon_by_val
+! err685_ribbon_by_val.jnl
+! 11/21/2013
+! See ticket 2111: Palette that is by_lev or by_value
+! in combination with a /missing=  caused errors
+ 
+us coads_climatology
+let ypts = y[gy=sst]
+let xpts = sst[L=1,x=150]
+let fpts = sst[L=1,x=150]
+plot/vs/line/thick/ribbon/MISS=black/PAL=ocean_temp xpts, ypts, fpts
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_ppl_palette
+! err685_ppl_palette.jnl
+! Further fix for ticket 2049. If the palette or pattern file
+! name given in PPL SHASET SPECTRUM=  or  PPL PATSET PATTERN=
+! started with a space, the command failed.
+ 
+pal  rnb2
+use levitus_climatology; shade/k=1 temp
+ 
+pal  bluescale.spk
+use levitus_climatology; shade/k=1 temp
+ 
+! pyferret does not yet support patterns
+! pattern    4patterns
+use coads_climatology
+shade/pal=black/lev=(10,30,5,-3)/key/L=1 sst
+ 
+pal   default
+! pyferret does not yet support patterns
+! pattern   solid
+ 
+fill sst[l=@ave]
+! pyferret does not yet support patterns
+! pattern   tiny_squares.pat
+fill/lev=(15,21,2)/over/nolab/pal=black sst[l=@ave]
+ 
+! restore defaults
+palette default
+! pyferret does not yet support patterns
+! pattern solid
+ 
+GO bn_reset
+cancel mode verify
+GO err685_show_grid_e
+! err685_show_grid_e.jnl
+! See ticket 2122
+! SHOW GRID/E and SHOW GRID/F failed
+ 
+def ax /e=1:12:1 ense
+def ax /f=1:10:1 verf
+def ax /t=1980:2013:1 yrt
+def grid /e=ense/t=yrt/f=verf gensy
+sh grid gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+sh grid /e gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       M     E                   EBOX      EBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+      11>  11                    1          10.5
+      12>  12                    1          11.5
+sh grid /f gensy
+    GRID GENSY
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ YRT       T                   34 r   1980                 2013
+ ENSE      E                   12 r   1                    12
+ VERF      F                   10 r   1                    10
+ 
+       N     F                   FBOX      FBOXLO
+       1>  1                     1          0.5
+       2>  2                     1          1.5
+       3>  3                     1          2.5
+       4>  4                     1          3.5
+       5>  5                     1          4.5
+       6>  6                     1          5.5
+       7>  7                     1          6.5
+       8>  8                     1          7.5
+       9>  9                     1          8.5
+      10>  10                    1          9.5
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_lowercaseAxis
+! err685_lowercaseAxis.jnl
+! Ticket  2126
+! If the axis name is lower case in the file, and we do SET AXIS commands
+! to reset units etc, the axis is "lost" to commands like SHOW AXIS
+ 
+use lowercaseTime.nc
+sh dat
+     currently SET data sets:
+    1> ./lowercaseTime.nc  (default)
+ name     title                             I         J         K         L         M         N
+ AA                                        ...       ...       ...       1:15      ...       ...
+ BB                                        ...       ...       ...       1:8       ...       ...
+ 
+! This axis has uppercase in the file
+set axis/t0=1-jan-2001/units=days uppercasetime
+ 
+! All this was correct
+show axis uppercasetime
+ name       axis              # pts   start                end
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 8
+show grid bb
+    GRID GHC2
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ UPPERCASETIME TIME             8 r   02-JAN-2001 00:00    09-JAN-2001 00:00
+ normal    E
+ normal    F
+ 
+! This variable has axis time, lowercase in the file
+sh grid aa
+    GRID GHC1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ TIME      T                   15 r   1                    15
+ normal    E
+ normal    F
+set axis/t0=1-jan-2001/units=days time
+ 
+! showed no output
+show axis time
+ name       axis              # pts   start                end
+ TIME      TIME                15 r   02-JAN-2001 00:00    16-JAN-2001 00:00
+T0 = 1-JAN-2001
+   Axis span (to cell edges) = 15
+ 
+! The axis did get changed but is inconsistently listed in the
+! internal arrays that store axis info.
+ 
+list/L=1:5 aa
+             VARIABLE : AA
+             FILENAME : lowercaseTime.nc
+             SUBSET   : 5 points (TIME)
+ 02-JAN-2001 00 / 1:  1.000
+ 03-JAN-2001 00 / 2:  2.000
+ 04-JAN-2001 00 / 3:  3.000
+ 05-JAN-2001 00 / 4:  4.000
+ 06-JAN-2001 00 / 5:  5.000
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_redefine_uvar_att
+! err685_redefine_uvar_att.jnl
+! ticket 2127 Redefine an attribute for a
+!   user variable, with bounds-checking on,
+!   returned a runtime error.
+ 
+let a = 1
+define att/type=string  a.ival = 99
+define att/type=STRING  a.ival = 99
+ 
+GO bn_reset
+cancel mode verify
+GO err685_use_no_extension
+! Ticket 2128: if no extension, we should try .cdf, .nc, .des
+!  but .des was not being tried.
+ 
+! The directory contains files with all three extensions
+sp ls duplicate.*
+duplicate.cdf
+duplicate.des
+duplicate.nc
+ 
+! The one that's used is .nc
+use duplicate
+sh dat
+     currently SET data sets:
+    1> ./duplicate.nc  (default)
+ name     title                             I         J         K         L         M         N
+ SST      SEA SURFACE TEMPERATURE          1:1       1:10      ...       1:3       ...       ...
+ 
+ 
+set mode ignore
+! Specify a nonexistent file with an extension
+use nosuchfile.nc
+ 
+! Specify a nonexistent file, no extension
+use nosuchfile
+ 
+! There is a file called snoopy.dat but not .cdf, .nc, or .des
+! Check for correct error messages.
+use snoopy
+ 
+use snoopy.dat
+ 
+set mode/last ignore
+ 
+GO bn_reset
+cancel mode verify
+GO err685_samplexy
+! err685_samplexy.jnl
+! Fix for ticket 2137. out-of-bounds error
+! sending sub-range of variable into samplexy
+ 
+! running this, with bounds-checking on, resulted in a bounds error.
+use coads_climatology
+let lon = {300,301,302}
+let lat = {11,12,13}
+list  samplexy(sst[x=290:310,y=0:20], lon, lat)
+             VARIABLE : SAMPLEXY(SST[X=290:310,Y=0:20], LON, LAT)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 by 3 points (X-TIME)
+                     1      2      3    
+                     1      2      3
+ 16-JAN      / 1:  26.84  26.77  26.66
+ 15-FEB      / 2:  26.60  26.52  26.35
+ 17-MAR      / 3:  26.68  26.61  26.49
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err685_shade_set
+! err685_shade_set.jnl
+!
+! test fix for bug 883
+! Inside a SHADE/SET, and several other plot commands,
+! if we do an operation that evalueates an expression, the
+! plot is then blank.
+ 
+can dat/all
+ 
+can view
+use climatological_axes
+def axis/t=1-jan-2000:31-jan-2010:1/units=days timax
+let tseries = t[gt=timax]
+! evaluate info about an expression, with a different grid than the
+! epression being SHADED, inside a SHADE/SET
+shade/set tseries*z[gz=1:5:1]
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !GAVE A BLANK PLOT
+ 
+shade/set tseries*z[gz=1:5:1]
+ppl shade !but this works
+ 
+shade/set tseries*z[gz=1:5:1]
+say `tseries,r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+let a = tseries*z[gz=1:5:1]
+shade/set a
+say `tseries[GT=month_irreg at mod],r=tunit`
+ !-> MESSAGE/CONTINUE DAYS
+DAYS
+ppl shade !and this works
+ 
+shade/title="`tseries[GT=month_irreg],r=tunit`" tseries*z[gz=1:5:1]
+ !-> shade/title="DAYS" tseries*z[gz=1:5:1]
+ 
+can var/all; can mem
+can axis timax
+set mode/last logo
+ 
+GO bn_reset
+cancel mode verify
+GO err686_individual_levels
+! err686_individual_levels.jnl
+! Ticket 2142
+! The bug appeared just in a beta release of v686. The behavior needs a test.
+ 
+use coads_climatology
+ 
+cancel symbol lev*
+shade/l=1/lev=(10)(20)(30)(40) sst
+ 
+! The levels should be min,max,del = 10,40,10
+sh sym lev*
+LEV_TEXT = "(10)(20)(30)(40)"
+LEV_MIN = "10"
+LEV_MAX = "40"
+LEV_NUM = "3"
+LEV_DEL = "10"
+ 
+cancel symbol lev*
+contour/l=1/lev=(10)(15)(20)(25)(30) sst
+sh sym lev*
+LEV_TEXT = "(10)(15)(20)(25)(30)"
+LEV_MIN = "10"
+LEV_MAX = "30"
+LEV_NUM = "4"
+LEV_DEL = "5"
+ 
+*** Running test: bn_long_symnames.jnl
+! bn_long_symnames.jnl
+! *ACM* 11/22/2013
+! Allow longer names for Ferret symbols
+ 
+! Define a couple of symbols longer than previous limit of 30
+define symbol ferret_temperature_equilibrator_min = -2
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+! SHOW
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+FERRET_TEMPERATURE_EQUILIBRATOR_MAX = "35"
+ 
+! CANCEL
+can sym ferret_temperature_equilibrator_max
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "-2"
+ 
+! DEFINE and redefine
+define symbol ferret_temperature_equilibrator_min = 0
+define symbol ferret_temperature_equilibrator_max = 35
+ 
+can sym *max
+ 
+show symbol ferret_temperature_*
+FERRET_TEMPERATURE_EQUILIBRATOR_MIN = "0"
+ 
+ 
+! bn_symbols had a line to
+! demonstrate the 30 character cap on symbol length
+! Lets demonstrate the 120 character cap on symbol length
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890 = 5
+define symbol q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567890q23456789012345678901234567xxxaaaa = 6
+show symbol q*
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890 = "5"
+Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567890Q23456789012345678901234567XXX = "6"
+*** Running test: bn_strdim.jnl
+! bn_strdim.jnl
+! Keep the string dimension name and size from the intput file
+! on writing the string variable.
+ 
+use strdimfile.nc
+ 
+! Previously Ferret created the string dimension name and length
+! Now it keeps the file's name and length.
+ 
+save/file=a.nc/clobber labels
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	ENSEMBLE = 3 ;
+	maxStrlen64 = 64 ;
+variables:
+	double ENSEMBLE(ENSEMBLE) ;
+		ENSEMBLE:long_name = "Ensemble of Realizations" ;
+		ENSEMBLE:axis = "E" ;
+		ENSEMBLE:point_spacing = "even" ;
+	char LABELS(ENSEMBLE, maxStrlen64) ;
+		LABELS:long_name = "Realizations" ;
+		LABELS:history = "From http://dunkel.pmel.noaa.gov:8930/thredds/dodsC/data/atmos3.ncml" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! The behavior is unchanged for user-defined variables
+! Dimension name is created from STRING and the length
+! length is the max length of strings in the variable.
+ 
+let/title="mystrings" strvar = {"alpha", "beta", "gamma"}
+save/file=a.nc/clobber strvar
+sp ncdump -h a.nc
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_5 = 5 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char STRVAR(XAX1_3, STRING1_5) ;
+		STRVAR:long_name = "mystrings" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+*** Running test: bn_single_colorlev.jnl
+! bn_single_colorlev.jnl
+! Ticket 2123, mis-labeled color bars when
+! single level is specified with a range of values
+ 
+use coads_climatology
+ 
+! Previously this labeled both top and bottom with 20
+shade/lev=(20,25,5)/L=1 sst
+ 
+! These cases were correct, and the reason for the above behavior
+shade/lev=(5)/L=1 INT(sst)
+shade/lev=(25)/L=1 INT(sst)
+ 
+! Label upper and lower end of the color bar with the range
+fill/lev=(20,30,10)/L=1 sst
+ 
+*** Running test: bn69_bug_fixes.jnl
+! bn687_bug_fixes
+! test various fixes that went into version 6.87
+! 02/2014 ACM
+ 
+GO bn_reset
+cancel mode verify
+GO err686_long_list_varnames
+! err686_long_list_varnames.jnl
+!
+! bug 2114
+! Reading a file with 54 variables. The names of variables get long,
+! and the list gets truncated by the SET DATA command.
+!
+ 
+columns/skip=1/var="\
+sta,\
+type,\
+month,\
+day,\
+year,\
+hour,\
+minute,\
+longitude,\
+latitude,\
+bottomD,\
+sampledepth,\
+dep,\
+temp,\
+sal,\
+xCO2_water_sst_wet_ppm,\
+xCO2_water_equi_temp_wet_ppm,\
+xCO2_water_sst_dry_ppm,\
+xCO2_water_equi_temp_dry_ppm,\
+fCO2_water_sst_100humidity_uatm,\
+fCO2_water_corr_25_uatm,\
+fCO2_water_corr_to_20,\
+fCO2_water_equi_uatm,\
+pCO2_water_sst_100humidity_uatm,\
+pCO2_water_equi_temp,\
+pCO2_theta_SW_corrected_to_sst,\
+Temperature_equi,\
+Pressure_atm,\
+Pressure_equi,\
+wind_direc_deg,\
+wind_speed,\
+ship_speed,\
+ship_direc,\
+Humidity,\
+woa_sss,\
+woa_land_marker,\
+pressure_ncep_slp,\
+speed_calc_knots,\
+etopo2_depth,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm,\
+fCO2_from_pCO2_water_water_equi_temp,\
+fCO2_from_pCO2_water_sst_100humidity_uatm,\
+fCO2_insitu_from_fCO2_water_equi_uatm,\
+fCO2_insitu_from_fCO2_water_sst_100humidty_uatm,\
+fCO2_from_pCO2_water_water_equi_temp_ncep,\
+fCO2_from_pCO2_water_sst_100humidity_uatm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_woa,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep,\
+fCO2_insitu_from_xCO2_water_equi_temp_dry_ppm_ncep_woa,\
+fCO2_insitu_from_xCO2_water_sst_dry_ppm_ncep_woa,\
+fCO2_rec,\
+fco2_source" \
+longvarnames.tsv
+ 
+! The list was cut off after woa_land_marker.
+! Try to load a variable later than that in the list.
+ 
+list etopo2_depth
+             VARIABLE : ETOPO2_DEPTH
+             FILENAME : longvarnames.tsv
+             SUBSET   : 10 points (X)
+ 1    /  1: -97.00
+ 2    /  2: -97.00
+ 3    /  3: -97.00
+ 4    /  4: -97.00
+ 5    /  5: -97.00
+ 6    /  6: -97.00
+ 7    /  7: -97.00
+ 8    /  8: -99.00
+ 9    /  9: -99.00
+ 10   / 10: -99.00
+ 
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_faxis_label
+! err686_faxis_label.jnl
+! 3/11/2014 ACM
+! ticket 2149
+! If the time axis has a calendar label, region label for F axis
+! shouldn't automatically get it.
+ 
+! Define a variable with a Julian calendar axis, and an abstract F axis
+ 
+define axis/t=1-jan-2000:1-jan-2010:1/units=days/calendar=julian jtime
+define axis/f=1:10:1 faxis
+ 
+use err64_small_latlon.nc
+let bath_tf = bathy  +  _N[gf=faxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! This label should be just F : 3
+sh sym lab($labnum_f)
+ !-> sh sym lab2
+LAB2 = "F : 3"
+ 
+! Might an F axis have a calendar?
+define axis/f=1-jan-2000:12-jan-2000:1/units=days/calendar=julian naxis
+let bath_tf = bathy  +  _N[gf=naxis] + 0*t[gt=jtime]
+shade/n=3/L=6 bath_tf
+ 
+! If so its label will show Julian too.
+sh sym lab($labnum_f)
+ !-> sh sym lab2
+LAB2 = "FORECAST : 03-JAN-2000 00:00:00 JULIAN"
+ 
+GO bn_reset
+cancel mode verify
+GO err686_dup_axnames
+! err686_dup_axnames
+! Ticket 1750
+!
+! Make some datasets. Same axis length and name,
+! different coordinates.
+ 
+def ax/x=1:4:1 xaxis_test
+let a = x[gx=xaxis_test]
+save/clob/file=a.nc a
+def ax/x=11:14:1 xaxis_test
+let b = x[gx=xaxis_test]
+save/clob/file=b.nc b
+can var/all; can dat/all
+ 
+! Check axis coords.
+use a; use b
+sh dat
+     currently SET data sets:
+    1> ./a.nc
+ name     title                             I         J         K         L         M         N
+ A        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+    2> ./b.nc  (default)
+ name     title                             I         J         K         L         M         N
+ B        X[GX=XAXIS_TEST]                 1:4       ...       ...       ...       ...       ...
+ 
+sh grid a[d=1]
+    GRID GSI1
+ name       axis              # pts   start                end
+ XAXIS_TEST1 X                  4 r   1                    4
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+sh grid b[d=2]
+    GRID GRR1
+ name       axis              # pts   start                end
+ XAXIS_TEST X                   4 r   11                   14
+ normal    Y
+ normal    Z
+ normal    T
+ normal    E
+ normal    F
+ 
+! Write b with its Ferret internal axis name XAXIS_TEST1
+save/clob/file=c.nc a[d=1],b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST1 = 4 ;
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Yet more combinations
+save/clob/file=c.nc b, a[d=1]
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+	XAXIS_TEST1 = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+	double XAXIS_TEST1(XAXIS_TEST1) ;
+		XAXIS_TEST1:point_spacing = "even" ;
+		XAXIS_TEST1:axis = "X" ;
+	double A(XAXIS_TEST1) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAXIS_TEST]" ;
+		A:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! We can use /KEEP_AXISNAMES, changes XAXIS_TEST1 to XAXIS_TEST
+save/clobber/file=c.nc b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 4 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Subsets also use XAXIS_TEST1
+save/clobber/file=c.nc/i=2:4 b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST2_4 = 3 ;
+variables:
+	double XAXIS_TEST2_4(XAXIS_TEST2_4) ;
+		XAXIS_TEST2_4:point_spacing = "even" ;
+		XAXIS_TEST2_4:axis = "X" ;
+	double B(XAXIS_TEST2_4) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! Unless we use /KEEP_AXISNAMES - which removes renaming
+! due to subsetting and also due to internal names
+save/clobber/file=c.nc/i=2:4/keep b
+sp ncdump -h c.nc
+netcdf c {
+dimensions:
+	XAXIS_TEST = 3 ;
+variables:
+	double XAXIS_TEST(XAXIS_TEST) ;
+		XAXIS_TEST:point_spacing = "even" ;
+		XAXIS_TEST:axis = "X" ;
+	double B(XAXIS_TEST) ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "X[GX=XAXIS_TEST]" ;
+		B:history = "From b" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+ 
+! If we try /KEEP_AXISNAMES but there is a conflict, it's an err
+set mode ignore
+save/clobber/keep/file=nc b,a[d=1]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_cancel_invalid_var
+! err686_cancel_invalid_var
+! ticket 2159
+ 
+! The cancel variable ran into an incorrect setting
+! for variable-in-memory
+ 
+set mode ignore
+let b = 1
+shade b
+ 
+set mode/last ignore
+cancel var b
+ 
+! Shade plot of a less-than-one cell region. Its where the bug came from.
+use coads_climatology
+shade/x=161.1:161.3/y=0.2:0.4/L=1 sst
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_redef_ascii_att
+! err686_redef_ascii_att.jnl
+! Bug 2161
+! DEFINE ATT to redefine title or units for variable
+! in ascii dataset caused crash
+ 
+columns/delim=" " EZ.DAT
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ 
+! A new attribuge causes no problems
+define att/output v1.comment = "First var from EZ.DAT"
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = V1 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ 
+! Initial definition of units is ok.
+! Re-defining the title or units causes crash
+define att/output v1.long_name = "vee one"
+ 
+! Initial definition of units is ok.
+! Re-defining units causes crash
+define att/output v1.units="km"
+define att/output v1.units="meters"
+ 
+sh att v1
+     attributes for dataset: ./EZ.DAT
+ V1.long_name = vee one 
+ V1.missing_value = -1.E+34
+ V1.comment = First var from EZ.DAT 
+ V1.units = meters 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_sho_nonexist_att
+! err686_sho_nonexist_att.jnl
+! See ticket 2133
+ 
+!  Too many error messages were issued on this error
+set mode ignore
+ 
+use levitus_climatology
+show att temp.noexist[d=levitus_climatology]
+ 
+set mode/last ignore
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO err686_set_var_name
+! err686_set_var_name.jnl
+! ticket 2152
+! rename user var or file var. Err message was
+! wrong if the name already exists.
+ 
+SET MODE IGNORE
+ 
+let a = 1
+let b = 2
+! Intentional error, new name is already a defined variable
+set var/name=b a
+! This rename is ok
+set var/name=c a
+sh var
+ Created by DEFINE VARIABLE:
+ >>> Definitions that replace any file variable of same name:
+     B = 2
+     C = 1
+ 
+use gt4d011.cdf
+! Intentional error, new name already in file
+set var/name=temp salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+! This rename is ok
+set var/name=salinity salt
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ 
+ 
+! Test LET/D variables:
+let/d=1 myvar = taux - tauy
+! This is an error, new name already in file
+set var/name=psi myvar
+! This is ok, new let/d name associated with the file
+set var/name=diff myvar
+show dat
+     currently SET data sets:
+    1> ./gt4d011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     91:108    35:56      1:10      1:25      ...       ...
+ SALINITY (SALINITY(ppt) - 35) /1000      91:108    35:55      1:10      1:25      ...       ...
+ U        ZONAL VELOCITY                  91:108    35:55      1:10      1:25      ...       ...
+ V        MERIDIONAL VELOCITY             91:108    35:55      1:10      1:25      ...       ...
+ W        VERTICAL VELOCITY               91:108    36:55      1:10      1:25      ...       ...
+ TAUX     ZONAL WIND STRESS               91:108    35:55      ...       1:25      ...       ...
+ TAUY     MERIDIONAL WIND STRESS          91:108    35:55      ...       1:25      ...       ...
+ PSI      STREAM FUNCTION                 91:108    35:56      ...       1:25      ...       ...
+ ------------------------------
+ DIFF[D=gt4d011] = TAUX - TAUY
+ 
+ 
+ 
+ 
+SET MODE/LAST ignore
+*** Running test: bn_bad_axis_bounds.jnl
+! bn_bad_axis_bounds
+! Ticket 2146 If there are invalid axis bounds
+! make them into a dependent variable.
+ 
+use badbounds.nc
+show data
+     currently SET data sets:
+    1> ./badbounds.nc  (default)
+ name     title                             I         J         K         L         M         N
+ MONTH_IRREG_BNDS
+                                           1:2       ...       ...       1:12      ...       ...
+       (invalid axis bounds)
+ TEMP2    TEMP[GT=MONTH_IRREG at ASN]         1:1       1:1       1:1       1:12      ...       ...
+ 
+*** Running test: bn_enter_exit_GO.jnl
+! GO bn_enter_exit_GO
+! Lines to allow trace of GO scripts:
+!
+! ! Enter_GO and ! Exit_GO lines written to the journal file
+! or output file only if SET REDIRECT is turned on
+ 
+! Check that we have the ! Enter_GO and ! Exit_GO lines
+ 
+set redirect/tee/journal
+go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ 
+! Inside an IF
+let a = 1
+if `a gt 0` THEN GO bn_shortgo2
+ !-> if 1 THEN GO bn_shortgo2
+! Enter_GO bn_shortgo2
+! bn_shortgo2.jnl
+! short script extracted from bn_negative_t for bn_enter_exit_GO
+ 
+DEFINE AXIS/T=-10:10:2 tax
+LET tvar = t[gt=tax]
+GO bn_short.sub tvar ave
+! Enter_GO bn_short.sub tvar ave
+! bn_short.sub
+! short script extracted from bn_negative_t.sub for bn_enter_exit_GO
+ 
+LIST/nohead/norow $1[t=-5:9@$2]	! neg/pos t endpoints
+ !-> LIST/nohead/norow tvar[t=-5:9 at ave]	! neg/pos t endpoints
+   2.000
+ 
+! Exit_GO
+! Exit_GO
+ 
+! Inside a REPEAT
+define symbol ok = 0
+repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+ !-> repeat/L=1:3 (if ($ok) then go bn_shortgo; def sym ok = `($ok)+1`)
+!-> REPEAT: L=1
+ !-> if 0 then go bn_shortgo
+ !-> def sym ok = 1
+!-> REPEAT: L=2
+ !-> if 1 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 2
+!-> REPEAT: L=3
+ !-> if 2 then go bn_shortgo
+! Enter_GO bn_shortgo
+! bn_shortgo.jnl
+! short script for bn_enter_exit_GO
+ 
+plot/i=1:15/color=red/thick i
+! Exit_GO
+ !-> def sym ok = 3
+ 
+cancel redirect
+*** Running test: bn_stddev.jnl
+! bn_std.jnl
+! New StdDev transform
+ 
+use coads_climatology
+list/x=100/y=10 sst[t=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 9N
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (standard deviation)
+          0.6651
+list/x=100/L=1 sst[y=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 99E
+             LATITUDE : 90S to 90N (standard deviation)
+             TIME     : 16-JAN 06:00
+          10.12
+list/y=10/L=1 sst[x=@STD]
+             VARIABLE : SEA SURFACE TEMPERATURE (Deg C)
+             FILENAME : coads_climatology.cdf
+             LONGITUDE: 20E to 20E(380) (standard deviation)
+             LATITUDE : 9N
+             TIME     : 16-JAN 06:00
+          0.7078
+ 
+use gt4d011.cdf
+list/y=3/l=1/x=233 u[z=@STD]
+             VARIABLE : ZONAL VELOCITY (cm/sec)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 127W
+             LATITUDE : 3N
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          3.366
+list/y=3/l=1 temp[x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             SUBSET   : 10 points (DEPTH (m))
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 2.8N
+             TIME     : 17-AUG-1982 12:00
+ 5     /  1:  0.2463
+ 15    /  2:  0.2536
+ 25    /  3:  0.2661
+ 35    /  4:  0.2647
+ 45    /  5:  0.2006
+ 55    /  6:  0.0981
+ 65    /  7:  0.2053
+ 75    /  8:  0.3932
+ 85    /  9:  0.5569
+ 95    / 10:  0.7732
+list/y=3/l=1 temp[z=@std,x=@std]
+             VARIABLE : TEMPERATURE (deg. C)
+             FILENAME : gt4d011.cdf
+             LONGITUDE: 140W to 122W (standard deviation)
+             LATITUDE : 2.8N
+             DEPTH (m): 0 to 100 (standard deviation)
+             TIME     : 17-AUG-1982 12:00
+          0.1895
+*** Running test: bn_set_axis_name.jnl
+! bn_set_axis_name.jnl
+! ticket 2160 Implementing new qualifier SET AXIS/NAME
+! 3/2014
+!
+!
+! Prepare a dataset with a time axis
+ 
+define axis/t=1-may-2010:5-may-2010:1/units=days daysaxis
+let a = t[gt=daysaxis]
+save/clobber/file=a.nc a
+ 
+cancel variable a
+cancel axis daysaxis
+ 
+!  We define some axis, then open a dataset with an axis of that name.
+ 
+define axis/t=1-jan-2000:31-jan-2000:1/units=days daysaxis
+ 
+use a.nc
+ 
+! The axis in the dataset has been renamed.
+say `a,return=taxis`
+ !-> MESSAGE/CONTINUE DAYSAXIS1
+DAYSAXIS1
+ 
+! So, rename our user-defined axis
+set axis/name=days2000 daysaxis
+ 
+! and now rename the one from the dataset back to its original name
+set axis/name=daysaxis `a,return=taxis`
+ !-> set axis/name=daysaxis DAYSAXIS1
+sh grid a
+    GRID GSI1
+ name       axis              # pts   start                end
+ normal    X
+ normal    Y
+ normal    Z
+ daysaxis  TIME                 5 r   01-MAY-2010 00:00    05-MAY-2010 00:00
+ normal    E
+ normal    F
+ 
+cancel data/all
+ 
+! If an axis is used in several datsets, renaming it of course
+! changes the name for all grids.
+! The attribute structure gets updated as well.
+ 
+! Make several datasets with the same x axis.
+define axis/x=1:13:1/units=meters x13axis
+let a = x[gx=x13axis]
+let b = 3*x[gx=x13axis]
+let c = 5*x[gx=x13axis]
+save/clobber/file=a.nc a
+save/clobber/file=b.nc b
+save/clobber/file=c.nc c
+ 
+can var/all
+can axis x13axis
+ 
+! Open them in Ferret; all grids are the same.
+use a.nc, b.nc, c.nc
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE X13AXIS
+X13AXIS
+ 
+! Rename the axis
+set axis/name=x_in_meters x13axis
+say `a[d=1],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `b[d=2],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+say `c[d=3],return=xaxis`
+ !-> MESSAGE/CONTINUE x_in_meters
+x_in_meters
+ 
+! For SHOW DAT/ATT we get info from the attribute structure.
+! It has the udated name.
+sh dat/att
+     currently SET data sets:
+    1> ./a.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ A                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        13   T       X[GX=X13AXIS]
+  
+    2> ./b.nc
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ B                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       3*X[GX=X13AXIS]
+  
+    3> ./c.nc  (default)
+ Variable    VarType(in dset)    AttributeName   AttType     Size OutFlag AttValue
+------------------------------------------------------------------------------------------
+  
+ .                               history         CHAR        38   T       FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14
+                                 Conventions     CHAR        6    F       CF-1.0
+  
+(x_in_meters)          DOUBLE    units           CHAR        6    T       meters
+                                 point_spacing   CHAR        4    T       even
+                                 axis            CHAR        1    T       X
+                                 orig_file_axnameCHAR        7    F       X13AXIS
+  
+ C                     DOUBLE    missing_value   DOUBLE      1    T       -1.E+34
+                                 _FillValue      DOUBLE      1    T       -1.E+34
+                                 long_name       CHAR        15   T       5*X[GX=X13AXIS]
+  
+ 
+! Intentional errors
+set mode ignore
+ 
+! Name already in use
+set axis/name=days2000 x_in_meters
+ 
+! Missing or illegal name
+set axis/name x_in_meters
+set axis/name=45 x_in_meters
+set axis/name=.fr x_in_meters
+ 
+set mode/last ignore
+*** Running test: bn_all_ef.jnl
+SET MODE VERIFY
+! bn_all_ef.jnl
+! - run all the benchmark tests for externally-linked external functions.
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_external_functions.jnl
+! Tests of external functions that are distributed as shared object files.
+ 
+! Jon's benchmarks
+go bench_examples
+set mode ignore_error
+show func/ext add_9
+ADD_9(A,B,C,D,E,F,G,H,I)
+    (demonstration function) adds 9 arguments
+show func/ext ave*
+AVE_SCAT2GRID_T(TPTS,VPTS,TAXIS)
+    Compute average of a variable in each cell of output time axis
+    TPTS: T coordinates of scattered input time coordinates
+    VPTS: Variable at times in TPTS
+    TAXIS: Output time axis
+AVET(A)
+    (demonstration function) returns the time average
+    A: data to be averaged over the time axis
+show func pass_thru
+PASS_THRU(A)
+    (demonstration function) sets result equal to input
+    A: this arg is passed through
+show func sto*
+STORAGE(A)
+    sets result equal to input/10
+    A: input
+ 
+go bench_add_9
+! Bench_add_9.jnl
+!  ACM  8/99
+!  benchmark script for testing external function add_9.
+! Note: bench_add_9_visual contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a1 = sst[d=1,l=1]
+let a2 = sst[d=1,l=2]
+let a3 = sst[d=1,l=3]
+ 
+let a = add_9(a1,a2,a3,a1,a2,a3,a1,a2,a3)
+ 
+list a
+             VARIABLE : ADD_9(A1,A2,A3,A1,A2,A3,A1,A2,A3)
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  263.6
+ 153E   / 67:  264.5
+ 155E   / 68:  264.2
+ 157E   / 69:  261.3
+ 159E   / 70:  260.9
+ 161E   / 71:  262.4
+ 163E   / 72:  264.0
+ 165E   / 73:  261.1
+ 167E   / 74:  260.9
+ 169E   / 75:  261.0
+ 171E   / 76:  259.3
+ 173E   / 77:  257.9
+ 175E   / 78:  257.0
+ 177E   / 79:  259.1
+ 179E   / 80:  254.8
+list  a - 3 * sst[d=1,l=1:3 at sum]
+             VARIABLE : A - 3 * SST[D=coads_climatology,L=1:3 at SUM]
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 161E   / 71:  0.0000
+ 163E   / 72:  0.0000
+ 165E   / 73:  0.0000
+ 167E   / 74:  0.0000
+ 169E   / 75:  0.0000
+ 171E   / 76:  0.0000
+ 173E   / 77:  0.0000
+ 175E   / 78:  0.0000
+ 177E   / 79:  0.0000
+ 179E   / 80:  0.0000
+set mode/last ignore_errors
+go bench_avet
+! Bench_avet.jnl
+!  ACM  8/99
+!  benchmark script for testing external function avet.
+! Note: bench_avet_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+use coads_climatology
+set region/x=151E:179E/y=0
+ 
+let a = avet(sst)
+list a
+             VARIABLE : AVET(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+                1S    
+                45
+ 151E   / 66:  29.28
+ 153E   / 67:  29.39
+ 155E   / 68:  29.35
+ 157E   / 69:  29.03
+ 159E   / 70:  28.99
+ 161E   / 71:  29.15
+ 163E   / 72:  29.33
+ 165E   / 73:  29.01
+ 167E   / 74:  28.99
+ 169E   / 75:  29.00
+ 171E   / 76:  28.81
+ 173E   / 77:  28.66
+ 175E   / 78:  28.56
+ 177E   / 79:  28.79
+ 179E   / 80:  28.31
+list a - sst[l=@ave]
+             VARIABLE : A - SST[L=@AVE]
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 15 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                  1S      
+                  45
+ 151E   / 66:  0.000E+00
+ 153E   / 67: -3.553E-15
+ 155E   / 68:  0.000E+00
+ 157E   / 69:  0.000E+00
+ 159E   / 70:  3.553E-15
+ 161E   / 71:  7.105E-15
+ 163E   / 72:  3.553E-15
+ 165E   / 73:  0.000E+00
+ 167E   / 74:  0.000E+00
+ 169E   / 75:  3.553E-15
+ 171E   / 76:  0.000E+00
+ 173E   / 77:  3.553E-15
+ 175E   / 78:  0.000E+00
+ 177E   / 79:  3.553E-15
+ 179E   / 80:  3.553E-15
+ 
+can region
+let a = x[i=1:9,k=1:5] + t[l=1:5]
+let b = x[i=1:9,k=1:5]
+let c = avet(a)
+list b, c
+             X: 0.5 to 9.5
+ Column  1: B is X[I=1:9,K=1:5]
+ Column  2: C is AVET(A)
+             B     C
+1   / 1:  1.000   4.00
+2   / 2:  2.000   5.00
+3   / 3:  3.000   6.00
+4   / 4:  4.000   7.00
+5   / 5:  5.000   8.00
+6   / 6:  6.000   9.00
+7   / 7:  7.000  10.00
+8   / 8:  8.000  11.00
+9   / 9:  9.000  12.00
+ 
+set mode/last ignore_errors
+go bench_pass_thru
+! Bench_pass_thru.jnl
+!  ACM  8/99
+!  benchmark script for testing external function pass_thru.
+! Note: bench_pass_thru_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+can region
+let a = pass_thru(x)
+list a[i=1:20]
+             VARIABLE : PASS_THRU(X)
+             SUBSET   : 20 points (X)
+ 1    /  1:   1.00
+ 2    /  2:   2.00
+ 3    /  3:   3.00
+ 4    /  4:   4.00
+ 5    /  5:   5.00
+ 6    /  6:   6.00
+ 7    /  7:   7.00
+ 8    /  8:   8.00
+ 9    /  9:   9.00
+ 10   / 10:  10.00
+ 11   / 11:  11.00
+ 12   / 12:  12.00
+ 13   / 13:  13.00
+ 14   / 14:  14.00
+ 15   / 15:  15.00
+ 16   / 16:  16.00
+ 17   / 17:  17.00
+ 18   / 18:  18.00
+ 19   / 19:  19.00
+ 20   / 20:  20.00
+set region/i=1:20
+list sin(a)
+             VARIABLE : SIN(A)
+             SUBSET   : 20 points (X)
+ 1    /  1:  0.8415
+ 2    /  2:  0.9093
+ 3    /  3:  0.1411
+ 4    /  4: -0.7568
+ 5    /  5: -0.9589
+ 6    /  6: -0.2794
+ 7    /  7:  0.6570
+ 8    /  8:  0.9894
+ 9    /  9:  0.4121
+ 10   / 10: -0.5440
+ 11   / 11: -1.0000
+ 12   / 12: -0.5366
+ 13   / 13:  0.4202
+ 14   / 14:  0.9906
+ 15   / 15:  0.6503
+ 16   / 16: -0.2879
+ 17   / 17: -0.9614
+ 18   / 18: -0.7510
+ 19   / 19:  0.1499
+ 20   / 20:  0.9129
+can var/all
+can region
+ 
+use coads_climatology
+let a = pass_thru(sst[l=@ave,y=@sbx:11])
+list/x=50 a
+             VARIABLE : PASS_THRU(SST[L=@AVE,Y=@SBX:11])
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+let a = pass_thru(sst)
+set region/@w
+list/x=50 a[l=1]
+             VARIABLE : PASS_THRU(SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 16-JAN 06:00
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   0.59
+ 71N   / 81:   0.62
+ 69N   / 80:   0.45
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   3.32
+ 43N   / 67:   4.72
+ 41N   / 66:   4.84
+ 39N   / 65:   8.63
+ 37N   / 64:   8.07
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:  18.91
+ 27N   / 59:  20.83
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:  25.41
+ 13N   / 52:  25.37
+ 11N   / 51:  25.82
+ 9N    / 50:  27.20
+ 7N    / 49:  26.11
+ 5N    / 48:  26.10
+ 3N    / 47:  26.25
+ 1N    / 46:  26.44
+ 1S    / 45:  27.01
+ 3S    / 44:  27.61
+ 5S    / 43:  28.24
+ 7S    / 42:  28.71
+ 9S    / 41:  28.46
+ 11S   / 40:  28.07
+ 13S   / 39:  28.15
+ 15S   / 38:  28.08
+ 17S   / 37:  28.29
+ 19S   / 36:  27.61
+ 21S   / 35:  27.59
+ 23S   / 34:  27.06
+ 25S   / 33:  26.70
+ 27S   / 32:  25.89
+ 29S   / 31:  24.65
+ 31S   / 30:  23.86
+ 33S   / 29:  22.16
+ 35S   / 28:  20.58
+ 37S   / 27:  19.20
+ 39S   / 26:  17.51
+ 41S   / 25:  14.44
+ 43S   / 24:   8.55
+ 45S   / 23:   7.51
+ 47S   / 22:   5.77
+ 49S   / 21:   4.21
+ 51S   / 20:   3.64
+ 53S   / 19:   2.87
+ 55S   / 18:   2.67
+ 57S   / 17:   2.05
+ 59S   / 16:   1.37
+ 61S   / 15:   1.33
+ 63S   / 14:   0.77
+ 65S   / 13:  -0.04
+ 67S   / 12:  -0.93
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+list/x=50 a[l=@ave,y=@sbx:11]
+             VARIABLE : PASS_THRU(SST)
+                        box smoothed by 11 pts on Y
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 90 points (LATITUDE)
+             LONGITUDE: 49E
+             TIME     : 01-JAN 00:45 to 01-APR 08:12 (averaged)
+               49E   
+               15
+ 89N   / 90:   ....
+ 87N   / 89:   ....
+ 85N   / 88:   ....
+ 83N   / 87:   ....
+ 81N   / 86:   ....
+ 79N   / 85:   ....
+ 77N   / 84:   ....
+ 75N   / 83:   ....
+ 73N   / 82:   ....
+ 71N   / 81:   ....
+ 69N   / 80:   ....
+ 67N   / 79:   ....
+ 65N   / 78:   ....
+ 63N   / 77:   ....
+ 61N   / 76:   ....
+ 59N   / 75:   ....
+ 57N   / 74:   ....
+ 55N   / 73:   ....
+ 53N   / 72:   ....
+ 51N   / 71:   ....
+ 49N   / 70:   ....
+ 47N   / 69:   ....
+ 45N   / 68:   ....
+ 43N   / 67:   ....
+ 41N   / 66:   ....
+ 39N   / 65:   ....
+ 37N   / 64:   ....
+ 35N   / 63:   ....
+ 33N   / 62:   ....
+ 31N   / 61:   ....
+ 29N   / 60:   ....
+ 27N   / 59:   ....
+ 25N   / 58:   ....
+ 23N   / 57:   ....
+ 21N   / 56:   ....
+ 19N   / 55:   ....
+ 17N   / 54:   ....
+ 15N   / 53:   ....
+ 13N   / 52:   ....
+ 11N   / 51:   ....
+ 9N    / 50:   ....
+ 7N    / 49:   ....
+ 5N    / 48:  26.94
+ 3N    / 47:  27.22
+ 1N    / 46:  27.48
+ 1S    / 45:  27.67
+ 3S    / 44:  27.78
+ 5S    / 43:  27.92
+ 7S    / 42:  28.04
+ 9S    / 41:  28.12
+ 11S   / 40:  28.18
+ 13S   / 39:  28.14
+ 15S   / 38:  28.03
+ 17S   / 37:  27.82
+ 19S   / 36:  27.45
+ 21S   / 35:  27.04
+ 23S   / 34:  26.52
+ 25S   / 33:  25.86
+ 27S   / 32:  25.09
+ 29S   / 31:  24.17
+ 31S   / 30:  23.04
+ 33S   / 29:  21.37
+ 35S   / 28:  19.60
+ 37S   / 27:  17.68
+ 39S   / 26:  15.76
+ 41S   / 25:  13.87
+ 43S   / 24:  11.98
+ 45S   / 23:  10.18
+ 47S   / 22:   8.45
+ 49S   / 21:   6.82
+ 51S   / 20:   5.33
+ 53S   / 19:   4.03
+ 55S   / 18:   3.19
+ 57S   / 17:   2.42
+ 59S   / 16:   ....
+ 61S   / 15:   ....
+ 63S   / 14:   ....
+ 65S   / 13:   ....
+ 67S   / 12:   ....
+ 69S   / 11:   ....
+ 71S   / 10:   ....
+ 73S   /  9:   ....
+ 75S   /  8:   ....
+ 77S   /  7:   ....
+ 79S   /  6:   ....
+ 81S   /  5:   ....
+ 83S   /  4:   ....
+ 85S   /  3:   ....
+ 87S   /  2:   ....
+ 89S   /  1:   ....
+ 
+set mode/last ignore_errors
+go bench_storage
+! Bench_storage.jnl
+!  ACM  8/99
+!  benchmark script for testing external function storage.
+! Note: bench_storage_visual.jnl contains plots of similar computations
+ 
+set mode ignore_errors
+ 
+use gtsa056_1
+let a = storage(temp)
+set region/k=1/l=5/i=1:2/j=44:50
+list  a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 2 by 7 points (LONGITUDE-LATITUDE)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+              130.5E 131.5E 
+                1      2
+ 1.5N  / 50:   ....  2.955
+ 1.17N / 49:   ....  2.962
+ 0.83N / 48:   ....  2.966
+ 0.5N  / 47:   ....  2.973
+ 0.17N / 46:   ....  2.985
+ 0.17S / 45:   ....  2.990
+ 0.5S  / 44:   ....   ....
+ 
+can region
+set region/x=140w/y=10n/k=1
+list a
+             VARIABLE : STORAGE(TEMP)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 5 points (TIME)
+             LONGITUDE: 140.5W
+             LATITUDE : 9.8N
+             DEPTH (m): 5
+                      140.5W 
+                       90
+ 15-JAN-1982 14 / 1:  2.656
+ 18-JAN-1982 15 / 2:  2.654
+ 21-JAN-1982 16 / 3:  2.652
+ 24-JAN-1982 17 / 4:  2.649
+ 27-JAN-1982 18 / 5:  2.646
+ 
+can region
+ 
+let b = temp[x=140e:60w]
+let c = storage(b)
+list/i=11:20 c[k=1,l=5,j=44:50 at ave]
+             VARIABLE : STORAGE(B)
+             FILENAME : gtsa056_1.cdf
+             SUBSET   : 10 points (LONGITUDE)
+             LATITUDE : 0.7S to 1.7N (averaged)
+             DEPTH (m): 5
+             TIME     : 27-JAN-1982 18:00
+ 140.5E / 11:  2.953
+ 141.5E / 12:  2.956
+ 142.5E / 13:  2.961
+ 143.5E / 14:  2.966
+ 144.5E / 15:  2.968
+ 145.5E / 16:  2.968
+ 146.5E / 17:  2.967
+ 147.5E / 18:  2.970
+ 148.5E / 19:  2.974
+ 149.5E / 20:  2.979
+ 
+set mode/last ignore_errors
+ 
+go bench_subtract
+! Bench_subtract.jnl
+!  ACM  8/99
+!  benchmark script for testing external function subtract.
+! Note: bench_subtract_visual.jnl contains plots of similar computations
+! V550 *sh* 11/02 - documentation note only reflecting subspan modulo
+ 
+set mode ignore_errors
+ 
+can region
+use ocean_atlas_temp
+use coads_climatology
+let oatemp = temp[d=ocean_atlas_temp,g=sst[d=coads_climatology]]
+set region/l=1
+let a = subtract(oatemp,sst)
+list/x=150:160/y=0  a
+             VARIABLE : SUBTRACT(OATEMP,SST)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+let b = oatemp- sst
+list/x=150:160/y=0  a - b
+             VARIABLE : A - B
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0000
+ 153E   / 67:  0.0000
+ 155E   / 68:  0.0000
+ 157E   / 69:  0.0000
+ 159E   / 70:  0.0000
+ 
+can region
+let a = oatemp[l=1]
+let b = sst[l=1]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             DEPTH (m): 0
+             TIME     : 16-JAN 06:00
+                 1S    
+                 45
+ 151E   / 66:  0.0233
+ 153E   / 67:  0.0346
+ 155E   / 68:  0.1315
+ 157E   / 69:  0.2809
+ 159E   / 70:  0.2610
+ 
+let a = oatemp[x=180]
+let b = sst[x=180]
+list/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 3 points (TIME)
+             LONGITUDE: 179E
+             LATITUDE : 1S
+             DEPTH (m): 0
+                    179E   
+                     80
+ 16-JAN      / 1:  0.1934
+ 15-FEB      / 2:  0.1304
+ 17-MAR      / 3:    ....
+ 
+can region
+let a = x[i=1:30]
+let b = y[j=1:30]
+list/y=15 subtract(a,b)  ! pre: V550 this gave a valid MARCH. Valid behavior chg in V550
+             VARIABLE : SUBTRACT(A,B)
+             SUBSET   : 30 points (X)
+             Y        : 15
+              15    
+              15
+ 1    /  1: -14.00
+ 2    /  2: -13.00
+ 3    /  3: -12.00
+ 4    /  4: -11.00
+ 5    /  5: -10.00
+ 6    /  6:  -9.00
+ 7    /  7:  -8.00
+ 8    /  8:  -7.00
+ 9    /  9:  -6.00
+ 10   / 10:  -5.00
+ 11   / 11:  -4.00
+ 12   / 12:  -3.00
+ 13   / 13:  -2.00
+ 14   / 14:  -1.00
+ 15   / 15:   0.00
+ 16   / 16:   1.00
+ 17   / 17:   2.00
+ 18   / 18:   3.00
+ 19   / 19:   4.00
+ 20   / 20:   5.00
+ 21   / 21:   6.00
+ 22   / 22:   7.00
+ 23   / 23:   8.00
+ 24   / 24:   9.00
+ 25   / 25:  10.00
+ 26   / 26:  11.00
+ 27   / 27:  12.00
+ 28   / 28:  13.00
+ 29   / 29:  14.00
+ 30   / 30:  15.00
+ 
+can region
+let a = sst[l=1]
+let b = 26
+list/x=150:160/y=0 subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+list/x=150:160/y=0 subtract(a,26)
+             VARIABLE : SUBTRACT(A,26)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 16-JAN 06:00
+                1S    
+                45
+ 151E   / 66:  3.416
+ 153E   / 67:  3.431
+ 155E   / 68:  3.334
+ 157E   / 69:  3.190
+ 159E   / 70:  3.219
+ 
+let b = sst[x=180,y=0,l=@ave]
+list/x=150:160/y=0  subtract(a,b)
+             VARIABLE : SUBTRACT(A,B)
+             FILENAME : coads_climatology.cdf
+             SUBSET   : 5 points (LONGITUDE)
+             LATITUDE : 1S
+             TIME     : 01-JAN 00:45 to 01-APR 08:12
+                1S    
+                45
+ 151E   / 66:  1.109
+ 153E   / 67:  1.124
+ 155E   / 68:  1.027
+ 157E   / 69:  0.883
+ 159E   / 70:  0.912
+ 
+set mode/last ignore_errors
+ 
+ 
+ 
+!!!!!!!!!!!!!!!!!!!!!!
+!
+! YAY!! End of bench_examples.jnl without crashing!!!!
+!
+!!!!!!!!!!!!!!!!!!!!!!
+ 
+! Ansley's benchmarks
+! move bench tests that test internal external functions to their
+! own .jnl file  bn_internal_external_functions
+!
+! 4/2006 all efs distributed with Ferret except writev5d and the
+!        examples tested in bench_examples.jnl are now internally linked.
+ 
+GO bn_reset
+cancel mode verify
+go bench_v5d
+! benchmark for Vis5D external function
+! 5/99 ACM
+ 
+ 
+!  Write data to a Vis5D file.  The first argument to the
+!  GO script is the file, arguments 2 through 9 are variable names to be written.
+! 7/2007 Funtion doesnt want to write a variable that doesnt have a vertical variation.
+!        To get a basic test of the function, make some data on a regularly-spaced xy grid.
+ 
+can region
+ set mode ignore_error
+ 
+use gt4d011.cdf
+def axis/y=1:100:1/units=degrees yax
+let tr = temp[gy=yax at asn]
+go vis5d_write " " tr
+To view the file with Vis5D say:   GO vis5d_start vis5d_out.v5d
+ 
+set mode/last ignore_error
+ 
+ 
+GO bn_reset
+cancel mode verify
+GO bn_ef_v5d_strings.jnl
+! bn_ef_v5d_strings.jnl
+! Taken out of bn_strings, because it calls so file writev5d.
+! testing string argument to external function.
+! 5/4/05 acm
+exit/script ! I dont have writev5d on this machine.
+ 
+go bn_reset
+cancel mode verify
+go bn_fcn_calls.jnl
+! Simple tests of external functions
+! these are not otherwise tested in the benchmarkd
+! ACM 23-Aug-2006
+! 05/07 *acm* move tests of date1900, tax_* functions and
+!             fill_xy to bn_internal_external_functions.jnl
+ 
+exit
+ 
+exit/command
+*** Running test: bn_startupfile.jnl
+ Current size of FERRET memory cache: 31 MegaWords  (1 word = 4 bytes)
+PPL$XPIXEL = "1008"
+PPL$YPIXEL = "816"
+BYTEORDER = "LITTLE"
+FERRET_VERSION = "6.9"
+FERRET_PLATFORM = "Linux 2.6.18-371.4.1.el5"
+FERRET_PRECISION = "double"
+NETCDF_VERSION = "4.3.1.1 of Feb 25 2014 11:38:15 $"
+FERRET_MEMORY = "31"
+SESSION_DATE = "31-Mar-14"
+SESSION_TIME = "17:30"
+SESSION_PID = "25931"
+DELTA_CPU = "0.540917"
+CLOCK_SECS = "0.32"
+CURRENT_DATE = "31-Mar-14"
+CURRENT_TIME = "17:30:10"
+N_OPEN_DSETS = "0"
+PROGRAM_NAME = "PyFerret"
+LAST_GO_FILE = "./bn_startupfile.jnl"
+PPL$FORMAT = "(3F10.2)"
+PPL$PLTNME = "ferret.png"
+PPL$TEKNME = "/dev/tty"
+PPL$XLEN = "7.750"
+PPL$YLEN = "5.750"
+PPL$XORG = "1.375"
+PPL$YORG = "1.375"
+PPL$WIDTH = "10.50"
+PPL$HEIGHT = "8.500"
+PPL$LINE_COUNT = "0"
+PPL$XFACT1 = "1.000"
+PPL$XOFF1 = "0.000"
+PPL$YFACT1 = "1.000"
+PPL$YOFF1 = "0.000"
+PPL$VIEW_X = "0.000"
+PPL$VIEW_Y = "0.000"
+PPL$VIEW_Z = "0.000"
+PPL$COMMAND_FILE = "$$MEMBUF$$"
+VP_WIDTH = "10.5"
+VP_HEIGHT = "8.5"
+PPL$SCALE = "1.0000"
+WIN_TITLE = "31-Mar-14_17:30"
+VP_SCALE = "1"
+VP_RT_MARGIN = "1.375"
+VP_TOP_MARGIN = "1.375"
+VP_XLO = "0"
+VP_XHI = "1"
+VP_YLO = "0"
+VP_YHI = "1"
+      MODE            STATE        ARGUMENT
+      DIAGNOSTIC    CANCELLED           99
+      VERIFY        CANCELLED      DEFAULT
+      INTERPOLATE   CANCELLED
+      IGNORE_ERROR  CANCELLED
+      STUPID        CANCELLED
+      JOURNAL          SET         startup_tests.jnl
+      LONG_LABEL       SET               1
+      LATIT_LABEL   CANCELLED            1
+      DEPTH_LABEL      SET              -4
+      CALENDAR         SET         minutes
+      6D_LAB           SET
+      ASCII_FONT       SET
+      SEGMENT          SET
+      WAIT          CANCELLED
+      DESPERATE     CANCELLED      3100000
+      GKS              SET
+      REFRESH          SET
+      METAFILE      CANCELLED      ferret.png
+      PPLLIST       CANCELLED      ppllist.out
+      GUI           CANCELLED
+      LOGO             SET
+      LABELS           SET
+      GRATICULE        SET
+      LINECOLORS       SET               7
+      UPCASE_OUTPU     SET
+      NLEVELS          SET             100
+      NODATA_LAB       SET
+      SHRINK_YLAB   CANCELLED
+      CURVILINEAR   CANCELLED
+      SIGMA         CANCELLED
+     currently SET data sets:
+    1> ./gtbc011.cdf  (default)
+ name     title                             I         J         K         L         M         N
+ TEMP     TEMPERATURE                     70:72      1:100     1:27      1:3       ...       ...
+ SALT     (SALINITY(ppt) - 35) /1000      70:71      1:100     1:27      1:3       ...       ...
+ U        ZONAL VELOCITY                  69:72      1:100     1:27      1:3       ...       ...
+ V        MERIDIONAL VELOCITY             69:72      1:100     1:27      1:3       ...       ...
+ W        VERTICAL VELOCITY               70:71      1:100     1:27      1:3       ...       ...
+ TAUX     ZONAL WIND STRESS               69:71      1:100     ...       1:3       ...       ...
+ TAUY     MERIDIONAL WIND STRESS          69:71      1:100     ...       1:3       ...       ...
+ PSI      STREAM FUNCTION                 69:73      1:100     ...       1:3       ...       ...
+ 
+Ended at Mon Mar 31 17:30:10 PDT 2014
diff --git a/bench/test_results/pyferret_run_tests_ncdump b/bench/test_results/pyferret_run_tests_ncdump
new file mode 100644
index 0000000..92f2bbe
--- /dev/null
+++ b/bench/test_results/pyferret_run_tests_ncdump
@@ -0,0 +1,2926 @@
+*** Running test: bn_syntax.jnl
+*** Running test: bn_dollar.jnl
+*** Running test: bn_grave.jnl
+*** Running test: bn_letd.jnl
+*** Running test: bn_if.jnl
+*** Running test: bn_expressions.jnl
+*** Running test: bn_geometry.jnl
+*** Running test: bn_output.jnl
+*** Running test: bn_in_plane.jnl
+*** Running test: bn_compress.jnl
+*** Running test: bn_interpolate.jnl
+*** Running test: bn_regrid.jnl
+*** Running test: bn_ez.jnl
+*** Running test: bn_plot.jnl
+*** Running test: bn_curv.jnl
+*** Running test: bn_symbols.jnl
+*** Running test: bn_comma_delimited.jnl
+*** Running test: bn_dynamic_grids.jnl
+*** Running test: bn_cdf.jnl
+*** Running test: bn_regrid_transforms.jnl
+*** Running test: bn_axis_limits.jnl
+*** Running test: bn_movie.jnl
+*** Running test: bn_ez_order.jnl
+*** Running test: bn_user.jnl
+*** Running test: bn_stream.jnl
+*** Running test: bn_mc.jnl
+*** Running test: bn_negative_t.jnl
+*** Running test: bn_xact_regrid.jnl
+*** Running test: bn_gc_functions.jnl
+*** Running test: bn491_bug_fixes.jnl
+*** Running test: bn_odd_variable_name.jnl
+*** Running test: bn_test_stream.jnl
+*** Running test: bn_define_axes.jnl
+*** Running test: bn_polygon.jnl
+*** Running test: bn500_bug_fixes.jnl
+err491_dp_time_write.jnl --- 1 original file
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (1 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969 ;
+
+ MY_VAR = 50757969 ;
+}
+err491_dp_time_write.jnl --- 2 after append
+netcdf out {
+dimensions:
+	T5 = UNLIMITED ; // (2 currently)
+variables:
+	double T5(T5) ;
+		T5:units = "min since 1901-01-15 00:00:00" ;
+		T5:axis = "T" ;
+		T5:calendar = "GREGORIAN" ;
+		T5:time_origin = "15-JAN-1901" ;
+		T5:standard_name = "time" ;
+	double MY_VAR(T5) ;
+		MY_VAR:missing_value = -1.e+34 ;
+		MY_VAR:_FillValue = -1.e+34 ;
+		MY_VAR:long_name = "T[GT=T5]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ T5 = 50757969, 50757974 ;
+
+ MY_VAR = 50757969, 50757974 ;
+}
+*** Running test: bn_sample.jnl
+*** Running test: bn_strides_revs_perms.jnl
+*** Running test: bn_non_COARDS_netCDF.jnl
+*** Running test: bn_cache_hits.jnl
+*** Running test: bn_regrid_to_user.jnl
+*** Running test: bn_calendar.jnl
+*** Running test: bn_dash_dot.jnl
+*** Running test: bn_flowlines.jnl
+*** Running test: bn_logaxes.jnl
+*** Running test: bn_internal_external_functions.jnl
+*** Running test: bn_modulo_strides.jnl
+*** Running test: bn_axis_viewports.jnl
+*** Running test: bn_strings.jnl
+bn_strings.jnl --- 1 original file
+netcdf test_string {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+	STRING1_16 = 16 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char A(XAX1_3, STRING1_10) ;
+		A:long_name = "{\"hello\",\"goodbye\", \"wave to me\"}" ;
+	char B(STRING1_16) ;
+		B:long_name = "\"one line of text\"" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A =
+  "hello",
+  "goodbye",
+  "wave to me" ;
+
+ B = "one line of text" ;
+}
+bn_strings.jnl --- 2 append to file
+bn_strings.jnl --- 3 enhanced heading
+netcdf test_string {
+dimensions:
+	grid_definition = 1 ;
+	XAX1_19 = 19 ;
+	XAX1_192_5 = 4 ;
+	STRING1_17 = 17 ;
+variables:
+	char GFP3(grid_definition) ;
+		GFP3:axes = "XAX1_19 NORMAL NORMAL NORMAL NORMAL NORMAL" ;
+	double XAX1_19(XAX1_19) ;
+		XAX1_19:point_spacing = "even" ;
+		XAX1_19:axis = "X" ;
+	double XAX1_192_5(XAX1_192_5) ;
+		XAX1_192_5:child_axis = " " ;
+		XAX1_192_5:point_spacing = "even" ;
+		XAX1_192_5:axis = "X" ;
+	char D(XAX1_192_5, STRING1_17) ;
+		D:parent_grid = "GFP3" ;
+		D:slab_min_index = 2, 1, 1, 1 ;
+		D:slab_max_index = 5, 1, 1, 1 ;
+		D:long_name = "partial filename list" ;
+		D:history = "From test_string" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ GFP3 = "" ;
+
+ XAX1_19 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ;
+
+ XAX1_192_5 = 2, 3, 4, 5 ;
+
+ D =
+  "dummy1.str_test",
+  "dummy2.str_test",
+  "dummy3.str_test",
+  "dummy4.str_test" ;
+}
+bn_strings.jnl --- 4 sample and ysequence functions on string var
+netcdf foo {
+dimensions:
+	XAX1_4 = 4 ;
+	STRING1_1 = 1 ;
+	YAX1_3 = 3 ;
+variables:
+	double XAX1_4(XAX1_4) ;
+		XAX1_4:point_spacing = "even" ;
+		XAX1_4:axis = "X" ;
+	char A(XAX1_4, STRING1_1) ;
+		A:long_name = "{\"a\",,\" \",\"\"}" ;
+	double YAX1_3(YAX1_3) ;
+		YAX1_3:point_spacing = "even" ;
+		YAX1_3:axis = "Y" ;
+	char B(YAX1_3, STRING1_1) ;
+		B:long_name = "SAMPLEJ(YSEQUENCE({\"a\",\"b\",,\"d\",\"e\",\"f\"}),{2,,1})" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_4 = 1, 2, 3, 4 ;
+
+ A =
+  "a",
+  "",
+  " ",
+  "" ;
+
+ YAX1_3 = 1, 2, 3 ;
+
+ B =
+  "b",
+  "",
+  "a" ;
+}
+*** Running test: bn_axcontrol.jnl
+*** Running test: bn_vec_curv.jnl
+*** Running test: bn_delimited_read.jnl
+*** Running test: bn541_bug_fixes.jnl
+*** Running test: bn_cancel_axes.jnl
+*** Running test: bn542_bug_fixes.jnl
+*** Running test: bn_subspan_modulo.jnl
+*** Running test: bn_dots.jnl
+*** Running test: bn_lev_symbols.jnl
+*** Running test: bn_mode_logo_lab.jnl
+*** Running test: bn_modulo_attribute.jnl
+*** Running test: bn550_bug_fixes.jnl
+*** Running test: bn551_bug_fixes.jnl
+err550_nc_seconds.jnl --- seconds of time axis
+		TIME:time_origin = "10-JUN-1996 04:03:36" ;
+*** Running test: bn_multi_line_labels.jnl
+*** Running test: bn552_bug_fixes.jnl
+*** Running test: bn_set_var_scale_off.jnl
+*** Running test: bn_longvarnames.jnl
+*** Running test: bn_shakey.jnl
+*** Running test: bn_eof_4d.jnl
+*** Running test: bn_abstract_axis_names.jnl
+*** Running test: bn_many_polygons.jnl
+*** Running test: bn_fill_irregular.jnl
+*** Running test: bn_xml_output.jnl
+*** Running test: bn_test_nan.jnl
+*** Running test: bn553_bug_fixes.jnl
+*** Running test: bn_graticules.jnl
+*** Running test: bn_repeat_range.jnl
+*** Running test: bn554_bug_fixes.jnl
+*** Running test: bn_bounds.jnl
+bn_bounds.jnl --- 1 output of bounds on irreg axes.
+netcdf a {
+dimensions:
+	MONTH_IRREG = UNLIMITED ; // (12 currently)
+	bnds = 2 ;
+variables:
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "T[GT=MONTH_IRREG]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+    196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 181.2425,
+  181.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425,
+  273.2425, 304.2425,
+  304.2425, 334.2425,
+  334.2425, 365.2425 ;
+
+ V = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 
+    227.7425, 258.2425, 288.7425, 319.2425, 349.7425 ;
+}
+bn_bounds.jnl --- 2 long irreg axes.
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (5 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628 ;
+}
+bn_bounds.jnl --- 3 Append later time steps, adding a void point
+netcdf a {
+dimensions:
+	COADSX90_90 = 1 ;
+	COADSY66_66 = 1 ;
+	TCOADS = UNLIMITED ; // (10 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_90(COADSX90_90) ;
+		COADSX90_90:units = "degrees_east" ;
+		COADSX90_90:modulo = " " ;
+		COADSX90_90:point_spacing = "even" ;
+		COADSX90_90:axis = "X" ;
+		COADSX90_90:standard_name = "longitude" ;
+	double COADSY66_66(COADSY66_66) ;
+		COADSY66_66:units = "degrees_north" ;
+		COADSY66_66:point_spacing = "even" ;
+		COADSY66_66:axis = "Y" ;
+		COADSY66_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double V(TCOADS, COADSY66_66, COADSX90_90) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(VWND,28.5)" ;
+		V:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_90 = 199 ;
+
+ COADSY66_66 = 41 ;
+
+ TCOADS = 91050, 91080.5, 91111, 91141.5, 91172.5, 91264.5, 91355, 91384.5, 
+    91415, 91445.5 ;
+
+ TCOADS_bnds =
+  91035, 91065,
+  91065, 91096,
+  91096, 91126,
+  91126, 91157,
+  91157, 91188,
+  91188, 91341,
+  91341, 91369,
+  91369, 91400,
+  91400, 91430,
+  91430, 91461 ;
+
+ V =
+  4,
+  1.94999992847443,
+  4.25,
+  1.6599999666214,
+  -0.129999995231628,
+  _,
+  -1.0699999332428,
+  3.35999989509583,
+  -3.86999988555908,
+  3.93999981880188 ;
+}
+bn_bounds.jnl --- 4 depth axis, bounds positive up
+netcdf a {
+dimensions:
+	ZIRR = 4 ;
+	bnds = 2 ;
+variables:
+	double ZIRR(ZIRR) ;
+		ZIRR:units = "meters" ;
+		ZIRR:point_spacing = "uneven" ;
+		ZIRR:axis = "Z" ;
+		ZIRR:bounds = "ZIRR_bnds" ;
+		ZIRR:positive = "down" ;
+		ZIRR:standard_name = "depth" ;
+	double ZIRR_bnds(ZIRR, bnds) ;
+	double T2(ZIRR) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "Z[GZ=ZIRR]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ ZIRR = 0, 10, 40, 70 ;
+
+ ZIRR_bnds =
+  -5, 5,
+  5, 25,
+  25, 55,
+  55, 85 ;
+
+ T2 = 0, 10, 40, 70 ;
+}
+bn_bounds.jnl --- 5 SAVE on irregular time axis, multi-dimensional save.
+netcdf a {
+dimensions:
+	COADSX81_83 = 3 ;
+	COADSY46_49 = 4 ;
+	MONTH_IRREG = UNLIMITED ; // (8 currently)
+	bnds = 2 ;
+variables:
+	double COADSX81_83(COADSX81_83) ;
+		COADSX81_83:units = "degrees_east" ;
+		COADSX81_83:modulo = " " ;
+		COADSX81_83:point_spacing = "even" ;
+		COADSX81_83:axis = "X" ;
+		COADSX81_83:standard_name = "longitude" ;
+	double COADSY46_49(COADSY46_49) ;
+		COADSY46_49:units = "degrees_north" ;
+		COADSY46_49:point_spacing = "even" ;
+		COADSY46_49:axis = "Y" ;
+		COADSY46_49:standard_name = "latitude" ;
+	double MONTH_IRREG(MONTH_IRREG) ;
+		MONTH_IRREG:units = "days since 0000-01-01 00:00:00" ;
+		MONTH_IRREG:time_origin = "01-JAN-0000 00:00:00" ;
+		MONTH_IRREG:modulo = " " ;
+		MONTH_IRREG:axis = "T" ;
+		MONTH_IRREG:standard_name = "time" ;
+		MONTH_IRREG:bounds = "MONTH_IRREG_bnds" ;
+	double MONTH_IRREG_bnds(MONTH_IRREG, bnds) ;
+	double V(MONTH_IRREG, COADSY46_49, COADSX81_83) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "MISSING(SST[GT=MONTH_IRREG], 28)" ;
+		V:history = "From coads_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_83 = 181, 183, 185 ;
+
+ COADSY46_49 = 1, 3, 5, 7 ;
+
+ MONTH_IRREG = 15.5, 45.12125, 74.7425, 105.2425, 135.7425, 181.7425, 
+    227.7425, 258.2425 ;
+
+ MONTH_IRREG_bnds =
+  0, 31,
+  31, 59.2425,
+  59.2425, 90.2425,
+  90.2425, 120.2425,
+  120.2425, 151.2425,
+  151.2425, 212.2425,
+  212.2425, 243.2425,
+  243.2425, 273.2425 ;
+
+ V =
+  28.2849935840911, 28.414627680037, 27.9161884993111,
+  27.9765395405733, 28.2538326818959, 28.2807402581306,
+  28.2439206183922, 28.0639671835704, 28.4098884258851,
+  27.8988069263938, 28.1024085497053, 27.7289905177585,
+  28.4160049287061, 28.4018177891461, 28.0223225569069,
+  28.3564239921735, 28.4116722185187, 27.9981931574269,
+  27.9975107377818, 28.1639069786096, 28.1146483772156,
+  27.9665335861598, 27.7497643747061, 27.8315865878107,
+  28.0636671118728, 27.5906545051978, 27.7380534023442,
+  27.9418187705116, 28.0035441744124, 27.7237886368008,
+  27.8988417091574, 27.8729683348804, 27.9324667419545,
+  27.8429933705147, 27.8182966108574, 27.9089173534895,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  _, _, _,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28,
+  28, 28, 28 ;
+}
+bn_bounds.jnl --- 6 SAVE on regular time axis with bounds attribute
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	bnds = 2 ;
+	COADSY46_46 = 1 ;
+	TIME = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:bounds = "COADSX81_81_bnds" ;
+	double COADSX81_81_bnds(COADSX81_81, bnds) ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:bounds = "COADSY46_46_bnds" ;
+	double COADSY46_46_bnds(COADSY46_46, bnds) ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81_bnds =
+  180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46_bnds =
+  0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIME_bnds =
+  0.757499999999993, 731.2425,
+  731.2425, 1461.7275,
+  1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 7 SAVE on regular time axis with edges attributes
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSX81_81edges = 2 ;
+	COADSY46_46 = 1 ;
+	COADSY46_46edges = 2 ;
+	TIME = UNLIMITED ; // (3 currently)
+	TIMEedges = 4 ;
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = " " ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+		COADSX81_81:edges = "COADSX81_81edges" ;
+	double COADSX81_81edges(COADSX81_81edges) ;
+		COADSX81_81edges:edges = " " ;
+	double COADSY46_46(COADSY46_46) ;
+		COADSY46_46:units = "degrees_north" ;
+		COADSY46_46:point_spacing = "even" ;
+		COADSY46_46:axis = "Y" ;
+		COADSY46_46:standard_name = "latitude" ;
+		COADSY46_46:edges = "COADSY46_46edges" ;
+	double COADSY46_46edges(COADSY46_46edges) ;
+		COADSY46_46edges:edges = " " ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+		TIME:edges = "TIMEedges" ;
+	double TIMEedges(TIMEedges) ;
+		TIMEedges:edges = " " ;
+	float SST(TIME, COADSY46_46, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSX81_81edges = 180, 182 ;
+
+ COADSY46_46 = 1 ;
+
+ COADSY46_46edges = 0, 2 ;
+
+ TIME = 366, 1096.485, 1826.97 ;
+
+ TIMEedges = 0.757499999999993, 731.2425, 1461.7275, 2192.2125 ;
+
+ SST =
+  28.28389,
+  28.41851,
+  28.0468 ;
+}
+bn_bounds.jnl --- 8 outputting bounds on all irregular axes, depth axis
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:bounds = "ZAX_bnds" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+*** Running test: bn_all_leap.jnl
+*** Running test: bn570_bug_fixes.jnl
+*** Running test: bn_modstats.jnl
+*** Running test: bn_mc_vary_scale.jnl
+*** Running test: bn_plot_nokey.jnl
+*** Running test: bn580_bug_fixes.jnl
+*** Running test: bn_inf_levels.jnl
+*** Running test: bn_regulart.jnl
+*** Running test: bn_labwid.jnl
+*** Running test: bn_redefine_taxis_mc.jnl
+*** Running test: bn_illegal_axisname.jnl
+*** Running test: bn_exit_script.jnl
+*** Running test: bn_exit_cycle.jnl
+*** Running test: bn_curv_mod.jnl
+*** Running test: bn_shade_keycont.jnl
+*** Running test: bn581_bug_fixes.jnl
+err580_irreg_bounds.jnl --- 
+netcdf a {
+dimensions:
+	TIME = UNLIMITED ; // (2 currently)
+	bnds = 2 ;
+variables:
+	double TIME(TIME) ;
+		TIME:axis = "T" ;
+		TIME:bounds = "TIME_bnds" ;
+	double TIME_bnds(TIME, bnds) ;
+	double A(TIME) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "T[GT=TIME]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ TIME = 0.5, 2 ;
+
+ TIME_bnds =
+  0, 1,
+  1, 3 ;
+
+ A = 0.5, 2 ;
+}
+err580_long_title.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_10 = 10 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double X_(XAX1_10) ;
+		X_:missing_value = -1.e+34 ;
+		X_:_FillValue = -1.e+34 ;
+		X_:long_name = "X" ;
+		X_:long_name_mod = "axis ABSTRACT" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title longer than 80 characters a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789" ;
+data:
+
+ XAX1_10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+
+ X_ = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ;
+}
+err580_long_dsettitle.jnl --- 
+netcdf longtitle {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A(XAX1_5) ;
+		A:missing_value = -1.e+34f ;
+		A:_FillValue = -1.e+34f ;
+		A:long_name = "A" ;
+		A:history = "From x" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:title = "a long title, longer than the previous limit of 80 characters.  Previously various buffers were set to 80, and storage in ds_title was also too short." ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A = 1, 2, 3, 4, 5 ;
+}
+err580_cdc_timeaxis.jnl --- 
+netcdf my_cdc_timeaxis {
+dimensions:
+	TCDC = UNLIMITED ; // (15 currently)
+variables:
+	double TCDC(TCDC) ;
+		TCDC:units = "days since 0001-01-01 00:00:00" ;
+		TCDC:axis = "T" ;
+		TCDC:calendar = "GREGORIAN" ;
+		TCDC:time_origin = "01-JAN-0001 00:00:00" ;
+		TCDC:standard_name = "time" ;
+	double A(TCDC) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "SIN(T[GT=TCDC]/10000)" ;
+		A:history = "From t0_cdc" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_tab_comma_multivar.jnl
+*** Running test: bn_element_functions.jnl
+*** Running test: bn_long_revision_num.jnl
+bn_long_revision_num.jnl --- history attribute
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+*** Running test: bn_window_title.jnl
+*** Running test: bn_last_error.jnl
+*** Running test: bn_deg_min.jnl
+*** Running test: bn_dp_readscale.jnl
+*** Running test: bn_bounds_defineax.jnl
+bn_bounds_defineax.jnl --- N+1 def of bounds.
+netcdf irrxzt {
+dimensions:
+	XAX = 6 ;
+	bnds = 2 ;
+	ZAX = 5 ;
+	TAX = UNLIMITED ; // (5 currently)
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double ZAX(ZAX) ;
+		ZAX:point_spacing = "uneven" ;
+		ZAX:axis = "Z" ;
+		ZAX:bounds = "ZAX_bnds" ;
+		ZAX:positive = "down" ;
+		ZAX:standard_name = "depth" ;
+	double ZAX_bnds(ZAX, bnds) ;
+	double TAX(TAX) ;
+		TAX:axis = "T" ;
+		TAX:bounds = "TAX_bnds" ;
+	double TAX_bnds(TAX, bnds) ;
+	double V(TAX, ZAX, XAX) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "X[GX=XAX] +Z[GZ=ZAX] + T[GT=TAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1, 2, 5, 6, 7, 8 ;
+
+ XAX_bnds =
+  0.5, 1.5,
+  1.5, 3.5,
+  3.5, 5.5,
+  5.5, 6.5,
+  6.5, 7.5,
+  7.5, 8.5 ;
+
+ ZAX = 0, 20, 50, 75, 120 ;
+
+ ZAX_bnds =
+  0, 10,
+  10, 30,
+  30, 60,
+  60, 90,
+  90, 150 ;
+
+ TAX = 1, 2, 9, 10, 11 ;
+
+ TAX_bnds =
+  0.5, 1.5,
+  1.5, 5.5,
+  5.5, 9.5,
+  9.5, 10.5,
+  10.5, 11.5 ;
+
+ V =
+  2, 3, 6, 7, 8, 9,
+  22, 23, 26, 27, 28, 29,
+  52, 53, 56, 57, 58, 59,
+  77, 78, 81, 82, 83, 84,
+  122, 123, 126, 127, 128, 129,
+  3, 4, 7, 8, 9, 10,
+  23, 24, 27, 28, 29, 30,
+  53, 54, 57, 58, 59, 60,
+  78, 79, 82, 83, 84, 85,
+  123, 124, 127, 128, 129, 130,
+  10, 11, 14, 15, 16, 17,
+  30, 31, 34, 35, 36, 37,
+  60, 61, 64, 65, 66, 67,
+  85, 86, 89, 90, 91, 92,
+  130, 131, 134, 135, 136, 137,
+  11, 12, 15, 16, 17, 18,
+  31, 32, 35, 36, 37, 38,
+  61, 62, 65, 66, 67, 68,
+  86, 87, 90, 91, 92, 93,
+  131, 132, 135, 136, 137, 138,
+  12, 13, 16, 17, 18, 19,
+  32, 33, 36, 37, 38, 39,
+  62, 63, 66, 67, 68, 69,
+  87, 88, 91, 92, 93, 94,
+  132, 133, 136, 137, 138, 139 ;
+}
+*** Running test: bn_attributes.jnl
+bn_attributes.jnl --- 1 attributes of string variables
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+	STRING1_10 = 10 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	char VAR_B(XAX1_3, STRING1_10) ;
+		VAR_B:long_name = "my strings" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ VAR_B =
+  "Seattle",
+  "Skykomish",
+  "Snoqualmie" ;
+}
+bn_attributes.jnl --- 2 access and edit attributes of coordinate variables.
+netcdf a {
+dimensions:
+	COADSX105_105 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME1 = UNLIMITED ; // (3 currently)
+variables:
+	double COADSX105_105(COADSX105_105) ;
+		COADSX105_105:units = "degrees_east" ;
+		COADSX105_105:modulo = " " ;
+		COADSX105_105:point_spacing = "even" ;
+		COADSX105_105:newatt = 0.f ;
+		COADSX105_105:axis = "X" ;
+		COADSX105_105:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 0000-01-01 00:00:00" ;
+		TIME1:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME1:modulo = " " ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float SST(TIME1, COADSY45_45, COADSX105_105) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX105_105 = 229 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME1 = 366, 1096.485, 1826.97 ;
+}
+bn_attributes.jnl --- 3 modulo set to false
+netcdf a {
+dimensions:
+	COADSX81_81 = 1 ;
+	COADSY45_45 = 1 ;
+	TIME2 = UNLIMITED ; // (12 currently)
+variables:
+	double COADSX81_81(COADSX81_81) ;
+		COADSX81_81:units = "degrees_east" ;
+		COADSX81_81:modulo = "false" ;
+		COADSX81_81:point_spacing = "even" ;
+		COADSX81_81:axis = "X" ;
+		COADSX81_81:standard_name = "longitude" ;
+	double COADSY45_45(COADSY45_45) ;
+		COADSY45_45:units = "degrees_north" ;
+		COADSY45_45:point_spacing = "even" ;
+		COADSY45_45:axis = "Y" ;
+		COADSY45_45:standard_name = "latitude" ;
+	double TIME2(TIME2) ;
+		TIME2:units = "hour since 0000-01-01 00:00:00" ;
+		TIME2:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME2:modulo = " " ;
+		TIME2:axis = "T" ;
+		TIME2:standard_name = "time" ;
+	float SST(TIME2, COADSY45_45, COADSX81_81) ;
+		SST:missing_value = -1.e+34f ;
+		SST:_FillValue = -1.e+34f ;
+		SST:long_name = "SEA SURFACE TEMPERATURE" ;
+		SST:history = "From coads_climatology" ;
+		SST:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX81_81 = 181 ;
+
+ COADSY45_45 = -1 ;
+
+ TIME2 = 366, 1096.485, 1826.97, 2557.455, 3287.94, 4018.425, 4748.91, 
+    5479.395, 6209.88, 6940.365, 7670.85, 8401.335 ;
+}
+bn_attributes.jnl --- 4 CANCEL MODE upcase_output; original file:
+netcdf err491_attval {
+dimensions:
+	Ti = UNLIMITED ; // (1 currently)
+	Yc = 127 ;
+	Xc = 35 ;
+variables:
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+	double Yc(Yc) ;
+		Yc:long_name = "Latitude" ;
+		Yc:units = "degrees_north" ;
+	double Xc(Xc) ;
+		Xc:long_name = "Longitude" ;
+		Xc:units = "degrees_east" ;
+	short Elev(Ti, Yc, Xc) ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:valid_range = -9., 9. ;
+		Elev:_FillValue = -32768s ;
+		Elev:missing_value = -32767s ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+
+// global attributes:
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:history = "a\n",
+			"" ;
+		:option = 1 ;
+		:run_mode = 3 ;
+		:srfc_bndry = 3 ;
+		:rad_penet = 2 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:title = "K-Bay OAR3d model (200m)                                                        " ;
+		:command = "                                                                                                                                                                                                                                                                                                                                " ;
+		:remark = "Generated by oar3d                                                                                                                                              " ;
+		:x_units = "degrees                                                                         " ;
+		:y_units = "degrees                                                                         " ;
+		:z_units = "                                                                                " ;
+		:nx = 35 ;
+		:ny = 127 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 5 before CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	XC3_3 = 1 ;
+	YC2_4 = 3 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC3_3(XC3_3) ;
+		XC3_3:long_name = "Longitude" ;
+		XC3_3:units = "degrees_east" ;
+		XC3_3:modulo = 360. ;
+		XC3_3:point_spacing = "even" ;
+		XC3_3:axis = "X" ;
+		XC3_3:standard_name = "longitude" ;
+	double YC2_4(YC2_4) ;
+		YC2_4:long_name = "Latitude" ;
+		YC2_4:units = "degrees_north" ;
+		YC2_4:point_spacing = "uneven" ;
+		YC2_4:axis = "Y" ;
+		YC2_4:standard_name = "latitude" ;
+		YC2_4:bounds = "YC2_4_bnds" ;
+	double YC2_4_bnds(YC2_4, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC2_4, XC3_3) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 6 after CANCEL MODE upcase_output
+netcdf a {
+dimensions:
+	Xc3_3 = 1 ;
+	Yc2_4 = 3 ;
+	bnds = 2 ;
+	Ti = UNLIMITED ; // (1 currently)
+variables:
+	double Xc3_3(Xc3_3) ;
+		Xc3_3:long_name = "Longitude" ;
+		Xc3_3:units = "degrees_east" ;
+		Xc3_3:modulo = 360. ;
+		Xc3_3:point_spacing = "even" ;
+		Xc3_3:axis = "X" ;
+		Xc3_3:standard_name = "longitude" ;
+	double Yc2_4(Yc2_4) ;
+		Yc2_4:long_name = "Latitude" ;
+		Yc2_4:units = "degrees_north" ;
+		Yc2_4:point_spacing = "uneven" ;
+		Yc2_4:axis = "Y" ;
+		Yc2_4:standard_name = "latitude" ;
+		Yc2_4:bounds = "Yc2_4_bnds" ;
+	double Yc2_4_bnds(Yc2_4, bnds) ;
+	double Ti(Ti) ;
+		Ti:long_name = "Time" ;
+		Ti:units = "day" ;
+		Ti:axis = "T" ;
+		Ti:standard_name = "time" ;
+	short Elev(Ti, Yc2_4, Xc3_3) ;
+		Elev:missing_value = -32767s ;
+		Elev:_FillValue = -32768s ;
+		Elev:long_name = "Surface elevation" ;
+		Elev:units = "meter" ;
+		Elev:scale_factor = 0.000274674967954587 ;
+		Elev:add_offset = 0. ;
+		Elev:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 7 outtput flags to control attribute output
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 8 outtput all flags
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+		AA:missing_value = -1.e+34 ;
+		AA:_FillValue = -1.e+34 ;
+		AA:long_name = "12" ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+		BB:my_title = "This is my new variable bb" ;
+		BB:another_attr = 6.f ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 9 Just output the default attributes
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 10 Output none of the attributes for aa
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double AA ;
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	double BB(XAX1_5) ;
+		BB:missing_value = -1.e+34 ;
+		BB:_FillValue = -1.e+34 ;
+		BB:long_name = "{3,4.5,6,7,4}" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+}
+bn_attributes.jnl --- 11 Surpress output of an attribute that Ferret would otherwise add.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 12 Check that settings hold for child axis.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380281_340 = 60 ;
+	YAX_LEV94121_135 = 15 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380281_340(XAX_LEV9421_380281_340) ;
+		XAX_LEV9421_380281_340:units = "degrees_east" ;
+		XAX_LEV9421_380281_340:modulo = " " ;
+		XAX_LEV9421_380281_340:standard_name = "longitude" ;
+	double YAX_LEV94121_135(YAX_LEV94121_135) ;
+		YAX_LEV94121_135:units = "degrees_north" ;
+		YAX_LEV94121_135:point_spacing = "even" ;
+		YAX_LEV94121_135:axis = "Y" ;
+		YAX_LEV94121_135:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94121_135, XAX_LEV9421_380281_340) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 13 cancel output of attributes of the variable.
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV94 = 180 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (2 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV94(YAX_LEV94) ;
+		YAX_LEV94:units = "degrees_north" ;
+		YAX_LEV94:point_spacing = "even" ;
+		YAX_LEV94:axis = "Y" ;
+		YAX_LEV94:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV94, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 14 attributes of data from ez data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float A1(XAX1_5) ;
+		A1:missing_value = -1.e+34f ;
+		A1:_FillValue = -1.e+34f ;
+		A1:long_name = "A1" ;
+		A1:three = 1.f, 2.f, 3.f ;
+		A1:history = "From EZ.DAT" ;
+	float A2(XAX1_5) ;
+		A2:missing_value = -1.e+34f ;
+		A2:_FillValue = -1.e+34f ;
+		A2:long_name = "A2" ;
+		A2:history = "From EZ.DAT" ;
+	float A3(XAX1_5) ;
+		A3:missing_value = -1.e+34f ;
+		A3:_FillValue = -1.e+34f ;
+		A3:long_name = "A3" ;
+		A3:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ A1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ A2 = 0.8865, 0.6643, 0.6071, 0.5535, 0.5337 ;
+
+ A3 = 0.176, 0.379, 0.417, 0.444, 0.515 ;
+}
+bn_attributes.jnl --- 15 attributes of data from delimited data.
+netcdf a {
+dimensions:
+	XAX1_5 = 5 ;
+variables:
+	double XAX1_5(XAX1_5) ;
+		XAX1_5:point_spacing = "even" ;
+		XAX1_5:axis = "X" ;
+	float V1(XAX1_5) ;
+		V1:missing_value = -1.e+34f ;
+		V1:_FillValue = -1.e+34f ;
+		V1:long_name = "V1" ;
+		V1:strval = "2" ;
+		V1:history = "From EZ.DAT" ;
+	float V4(XAX1_5) ;
+		V4:missing_value = -1.e+34f ;
+		V4:_FillValue = -1.e+34f ;
+		V4:long_name = "V4" ;
+		V4:history = "From EZ.DAT" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_5 = 1, 2, 3, 4, 5 ;
+
+ V1 = 0.006, 0.355, 0.41, 0.435, 0.478 ;
+
+ V4 = 0.7597, 0.6455, 0.5935, 0.5458, 0.5147 ;
+}
+bn_attributes.jnl --- 16 attributes of user vars
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{12,14,15}" ;
+		A:three = 1.f, 2.f, 3.f ;
+		A:four = "theory" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 12, 14, 15 ;
+}
+bn_attributes.jnl --- 17 global attrs.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:simulation = "K-Bay OAR3d model (200m)" ;
+		:start_date = "980105000000" ;
+		:option = 0 ;
+		:run_mode = 0 ;
+		:srfc_bndry = 0 ;
+		:rad_penet = 0 ;
+		:dt_external = 1. ;
+		:dt_internal = 15. ;
+		:horiz_diff = 0.2 ;
+		:inv_prandtl = 0.2 ;
+		:min_slope = 0.2 ;
+		:command = " " ;
+		:remark = "Generated by oar3d" ;
+		:x_units = "degrees" ;
+		:y_units = "degrees" ;
+		:z_units = " " ;
+		:nx = 0 ;
+		:ny = 0 ;
+		:x_min = 0. ;
+		:x_max = 0. ;
+		:y_min = 0. ;
+		:y_max = 0. ;
+		:z_min = 0. ;
+		:z_max = 0. ;
+		:x_inc = 0. ;
+		:y_inc = 0. ;
+		:z_scale_factor = 0. ;
+		:z_add_offset = 0. ;
+		:node_offset = 0. ;
+}
+bn_attributes.jnl --- 18 choose global attr to write
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC = 127 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+	PSXT100_100 = 1 ;
+	PSYT35_56 = 22 ;
+	PSZT11_1 = 1 ;
+	TIME1 = 25 ;
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC(YC) ;
+		YC:long_name = "Latitude" ;
+		YC:units = "degrees_north" ;
+		YC:point_spacing = "uneven" ;
+		YC:axis = "Y" ;
+		YC:standard_name = "latitude" ;
+		YC:bounds = "YC_bnds" ;
+	double YC_bnds(YC, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+	double PSXT100_100(PSXT100_100) ;
+		PSXT100_100:units = "degrees_east" ;
+		PSXT100_100:point_spacing = "even" ;
+		PSXT100_100:modulo = 360. ;
+		PSXT100_100:axis = "X" ;
+		PSXT100_100:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_1(PSZT11_1) ;
+		PSZT11_1:units = "meters" ;
+		PSZT11_1:positive = "down" ;
+		PSZT11_1:point_spacing = "uneven" ;
+		PSZT11_1:axis = "Z" ;
+		PSZT11_1:standard_name = "depth" ;
+		PSZT11_1:bounds = "PSZT11_1_bnds" ;
+	double PSZT11_1_bnds(PSZT11_1, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:point_spacing = "even" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	float TEMP(TIME1, PSZT11_1, PSYT35_56, PSXT100_100) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:dt_internal = 15. ;
+}
+bn_attributes.jnl --- 19 scale and offset attr.
+netcdf a {
+dimensions:
+	XC = 35 ;
+	YC1_1 = 1 ;
+	bnds = 2 ;
+	TI = UNLIMITED ; // (1 currently)
+variables:
+	double XC(XC) ;
+		XC:long_name = "Longitude" ;
+		XC:units = "degrees_east" ;
+		XC:modulo = 360. ;
+		XC:point_spacing = "even" ;
+		XC:axis = "X" ;
+		XC:standard_name = "longitude" ;
+	double YC1_1(YC1_1) ;
+		YC1_1:long_name = "Latitude" ;
+		YC1_1:units = "degrees_north" ;
+		YC1_1:point_spacing = "uneven" ;
+		YC1_1:axis = "Y" ;
+		YC1_1:standard_name = "latitude" ;
+		YC1_1:bounds = "YC1_1_bnds" ;
+	double YC1_1_bnds(YC1_1, bnds) ;
+	double TI(TI) ;
+		TI:long_name = "Time" ;
+		TI:units = "day" ;
+		TI:axis = "T" ;
+		TI:standard_name = "time" ;
+	short ELEV(TI, YC1_1, XC) ;
+		ELEV:missing_value = -32767s ;
+		ELEV:_FillValue = -32768s ;
+		ELEV:long_name = "Surface elevation" ;
+		ELEV:units = "meter" ;
+		ELEV:scale_factor = 0.000274674967954587 ;
+		ELEV:add_offset = 0. ;
+		ELEV:history = "From err491_attval" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XC = -135.50957036625, -135.496120344706, -135.482670323162, 
+    -135.469220301618, -135.455770280074, -135.44232025853, 
+    -135.428870236985, -135.415420215441, -135.401970193897, 
+    -135.388520172353, -135.375070150809, -135.361620129265, 
+    -135.348170107721, -135.334720086177, -135.321270064633, 
+    -135.307820043089, -135.294370021545, -135.28092, -135.267469978456, 
+    -135.254019956912, -135.240569935368, -135.227119913824, 
+    -135.21366989228, -135.200219870736, -135.186769849192, 
+    -135.173319827648, -135.159869806104, -135.14641978456, 
+    -135.132969763016, -135.119519741471, -135.106069719927, 
+    -135.092619698383, -135.079169676839, -135.065719655295, -135.052269633751 ;
+
+ YC1_1 = 58.5947143787844 ;
+
+ YC1_1_bnds =
+  58.5912104049205, 58.5982183526484 ;
+
+ TI = 1.78368055555556 ;
+
+ ELEV =
+  -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767, 
+    -32767, -32767, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 10702, 
+    10702, 10702, 10702, 10702, 10702, 10702, -32767, -32767, -32767, -32767, 
+    -32767, -32767, -32767, -32767, -32767, -32767 ;
+}
+bn_attributes.jnl --- 20 set data type on output int4
+	int TEMP(TIME1, PSZT11_1, PSYT48_48, PSXT91_108) ;
+		TEMP:missing_value = -1000 ;
+		TEMP:_FillValue = -1000 ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From gt4d011" ;
+		TEMP:units = "deg. C" ;
+
+// global attributes:
+--
+ TEMP =
+  26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 26, 26, 26, 26, 26, 25, 25, 25 ;
+}
+bn_attributes.jnl --- 21 set data type on output double
+	double SALT(TIME1, PSZT11_1, PSYT48_48, PSXT91_108) ;
+		SALT:missing_value = 0.00999999977648258 ;
+		SALT:_FillValue = 0.00999999977648258 ;
+		SALT:long_name = "(SALINITY(ppt) - 35) /1000" ;
+		SALT:history = "From gt4d011" ;
+		SALT:units = "frac. by wt. less .035" ;
+		SALT:Ferret_Precision_Note = "This variable written using Ferret was converted from FLOAT to DOUBLE" ;
+
+// global attributes:
+--
+ SALT =
+  0.00016033259453252, 0.000142609584145248, 0.000126281287521124, 
+    0.000120904369396158, 0.000120412340038456, 0.000123045203508809, 
+bn_attributes.jnl --- 22 outtype=input
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+	byte THE_BULLET(I, J) ;
+		THE_BULLET:long_name = "THE_BULLET" ;
+		THE_BULLET:history = "From test0" ;
+	short ORDER(I, J) ;
+		ORDER:long_name = "ORDER" ;
+		ORDER:history = "From test0" ;
+	int RIGUE(I, J) ;
+		RIGUE:long_name = "RIGUE" ;
+		RIGUE:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+
+ THE_BULLET =
+  -127, 0, 127,
+  -128, -1, -127 ;
+
+ ORDER =
+  1, 2, 3,
+  4, 5, 6 ;
+
+ RIGUE =
+  2, 3, 4,
+  5, 6, 7 ;
+}
+bn_attributes.jnl --- 23 more user-defined vars
+netcdf a {
+variables:
+	double B ;
+		B:missing_value = -1.e+34 ;
+		B:_FillValue = -1.e+34 ;
+		B:long_name = "hello" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ B = 1 ;
+}
+bn_attributes.jnl --- 24 output redefined attr
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	float VWND(TCOADS, COADSY65_66, COADSX90_91) ;
+		VWND:missing_value = -1.e+34f ;
+		VWND:_FillValue = -1.e+34f ;
+		VWND:long_name = "MERIDIONAL WIND" ;
+		VWND:history = "From coads_vwnd" ;
+		VWND:units = "M/S" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ VWND =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 25 output new attr on user-defined var
+netcdf a {
+dimensions:
+	COADSX90_91 = 2 ;
+	COADSY65_66 = 2 ;
+	TCOADS = UNLIMITED ; // (1 currently)
+	bnds = 2 ;
+variables:
+	double COADSX90_91(COADSX90_91) ;
+		COADSX90_91:units = "degrees_east" ;
+		COADSX90_91:modulo = " " ;
+		COADSX90_91:point_spacing = "uneven" ;
+		COADSX90_91:axis = "X" ;
+		COADSX90_91:standard_name = "longitude" ;
+	double COADSY65_66(COADSY65_66) ;
+		COADSY65_66:units = "degrees_north" ;
+		COADSY65_66:point_spacing = "uneven" ;
+		COADSY65_66:new_att = "somthing" ;
+		COADSY65_66:axis = "Y" ;
+		COADSY65_66:standard_name = "latitude" ;
+	double TCOADS(TCOADS) ;
+		TCOADS:units = "days since 1700-01-01 00:00:00" ;
+		TCOADS:time_origin = "01-JAN-1700 00:00:00" ;
+		TCOADS:axis = "T" ;
+		TCOADS:standard_name = "time" ;
+		TCOADS:bounds = "TCOADS_bnds" ;
+	double TCOADS_bnds(TCOADS, bnds) ;
+	double T2(TCOADS, COADSY65_66, COADSX90_91) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "2*VWND" ;
+		T2:history = "From coads_vwnd" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ COADSX90_91 = 199, 201 ;
+
+ COADSY65_66 = 39, 41 ;
+
+ TCOADS = 89864.5 ;
+
+ TCOADS_bnds =
+  89849, 89880 ;
+
+ T2 =
+  _, _,
+  _, _ ;
+}
+bn_attributes.jnl --- 26 attributes of axes
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "degrees" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:new_att = "something" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+		PSXT91_108:standard_name = "longitude" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "degrees_north" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:standard_name = "latitude" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT91_108 = 18 ;
+	PSYT35_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (1 currently)
+variables:
+	double PSXT91_108(PSXT91_108) ;
+		PSXT91_108:units = "meters" ;
+		PSXT91_108:point_spacing = "even" ;
+		PSXT91_108:new_att = "something" ;
+		PSXT91_108:modulo = 360. ;
+		PSXT91_108:axis = "X" ;
+	double PSYT35_56(PSYT35_56) ;
+		PSYT35_56:units = "meters" ;
+		PSYT35_56:point_spacing = "uneven" ;
+		PSYT35_56:axis = "Y" ;
+		PSYT35_56:bounds = "PSYT35_56_bnds" ;
+	double PSYT35_56_bnds(PSYT35_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double T2(TIME1, PSZT11_10, PSYT35_56, PSXT91_108) ;
+		T2:missing_value = -1.e+34 ;
+		T2:_FillValue = -1.e+34 ;
+		T2:long_name = "T*TEMP" ;
+		T2:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160 = 160 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160(XAXLEVITR1_160) ;
+		XAXLEVITR1_160:units = "degrees_east" ;
+		XAXLEVITR1_160:modulo = " " ;
+		XAXLEVITR1_160:point_spacing = "even" ;
+		XAXLEVITR1_160:new_att = "something" ;
+		XAXLEVITR1_160:axis = "X" ;
+		XAXLEVITR1_160:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	float TEMP(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160) ;
+		TEMP:missing_value = -1.e+10f ;
+		TEMP:_FillValue = -1.e+10f ;
+		TEMP:long_name = "TEMPERATURE" ;
+		TEMP:history = "From levitus_climatology" ;
+		TEMP:units = "DEG C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAXLEVITR1_160161_161 = 1 ;
+	YAXLEVITR1_9090_90 = 1 ;
+	ZAXLEVITR1_1 = 1 ;
+variables:
+	double XAXLEVITR1_160161_161(XAXLEVITR1_160161_161) ;
+		XAXLEVITR1_160161_161:units = "degrees_east" ;
+		XAXLEVITR1_160161_161:modulo = " " ;
+		XAXLEVITR1_160161_161:point_spacing = "even" ;
+		XAXLEVITR1_160161_161:new_att = "something" ;
+		XAXLEVITR1_160161_161:axis = "X" ;
+		XAXLEVITR1_160161_161:standard_name = "longitude" ;
+	double YAXLEVITR1_9090_90(YAXLEVITR1_9090_90) ;
+		YAXLEVITR1_9090_90:units = "degrees_north" ;
+		YAXLEVITR1_9090_90:point_spacing = "even" ;
+		YAXLEVITR1_9090_90:axis = "Y" ;
+		YAXLEVITR1_9090_90:standard_name = "latitude" ;
+	double ZAXLEVITR1_1(ZAXLEVITR1_1) ;
+		ZAXLEVITR1_1:units = "meters" ;
+		ZAXLEVITR1_1:positive = "down" ;
+		ZAXLEVITR1_1:point_spacing = "even" ;
+		ZAXLEVITR1_1:axis = "Z" ;
+		ZAXLEVITR1_1:standard_name = "depth" ;
+	double TWO(ZAXLEVITR1_1, YAXLEVITR1_9090_90, XAXLEVITR1_160161_161) ;
+		TWO:missing_value = -1.e+34 ;
+		TWO:_FillValue = -1.e+34 ;
+		TWO:long_name = "2*TEMP[Y=0:15,X=180:200]" ;
+		TWO:history = "From levitus_climatology" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 27 attributes of  user-defined axes
+netcdf string4d {
+dimensions:
+	X2AX = 2 ;
+	Y3AX = 3 ;
+	Z4AX = 4 ;
+	T2AX = UNLIMITED ; // (2 currently)
+	STRING1_5 = 5 ;
+variables:
+	double X2AX(X2AX) ;
+		X2AX:point_spacing = "even" ;
+		X2AX:axis = "X" ;
+		X2AX:modulo = " " ;
+	double Y3AX(Y3AX) ;
+		Y3AX:point_spacing = "even" ;
+		Y3AX:axis = "Y" ;
+	double Z4AX(Z4AX) ;
+		Z4AX:point_spacing = "even" ;
+		Z4AX:axis = "Z" ;
+		Z4AX:positive = "up" ;
+		Z4AX:standard_name = "altitude" ;
+	double T2AX(T2AX) ;
+		T2AX:axis = "T" ;
+	char AXY(T2AX, Z4AX, Y3AX, X2AX, STRING1_5) ;
+		AXY:long_name = "RESHAPE (A,RVAR)" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- 28 Define a new global attribute
+bn_attributes.jnl --- 29 SET ATT/OUTPUT=all for global attrs and a var
+netcdf a {
+dimensions:
+	J = 3 ;
+	I = 2 ;
+	l = 3 ;
+variables:
+	float J(J) ;
+		J:point_spacing = "even" ;
+		J:axis = "X" ;
+	int I(I) ;
+		I:point_spacing = "even" ;
+		I:axis = "Y" ;
+	char BROILED(I, J, l) ;
+		BROILED:act = "text string\n",
+			"\t123" ;
+		BROILED:acb = 10b ;
+		BROILED:acs = -200s ;
+		BROILED:acl = 17000 ;
+		BROILED:acf = -2.f, 1.f, 0.f ;
+		BROILED:acd = -1., 2.71828182845905 ;
+		BROILED:long_name = "BROILED" ;
+		BROILED:history = "From test0" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+		:glob = "Global attribute" ;
+		:FERRET_comment = "File written via LAS. Attributes are inherited from originating dataset" ;
+data:
+
+ J = 2, 4, 6 ;
+
+ I = 10, 20 ;
+
+ BROILED =
+  "ind",
+  "ist",
+  "ing",
+  "uis",
+  "hab",
+  "le" ;
+}
+bn_attributes.jnl --- 29 SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	double FAREN(TIME1, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -1.e+34 ;
+		FAREN:_FillValue = -1.e+34 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	PSXT191_108 = 18 ;
+	PSYT135_56 = 22 ;
+	bnds = 2 ;
+	PSZT11_10 = 10 ;
+	TIME1 = UNLIMITED ; // (25 currently)
+variables:
+	double PSXT191_108(PSXT191_108) ;
+		PSXT191_108:units = "degrees_east" ;
+		PSXT191_108:point_spacing = "even" ;
+		PSXT191_108:modulo = 360. ;
+		PSXT191_108:axis = "X" ;
+		PSXT191_108:standard_name = "longitude" ;
+	double PSYT135_56(PSYT135_56) ;
+		PSYT135_56:units = "degrees_north" ;
+		PSYT135_56:point_spacing = "uneven" ;
+		PSYT135_56:axis = "Y" ;
+		PSYT135_56:standard_name = "latitude" ;
+		PSYT135_56:bounds = "PSYT135_56_bnds" ;
+	double PSYT135_56_bnds(PSYT135_56, bnds) ;
+	double PSZT11_10(PSZT11_10) ;
+		PSZT11_10:units = "meters" ;
+		PSZT11_10:positive = "down" ;
+		PSZT11_10:point_spacing = "uneven" ;
+		PSZT11_10:axis = "Z" ;
+		PSZT11_10:standard_name = "depth" ;
+		PSZT11_10:bounds = "PSZT11_10_bnds" ;
+	double PSZT11_10_bnds(PSZT11_10, bnds) ;
+	double TIME1(TIME1) ;
+		TIME1:units = "hour since 1980-01-14 14:00:00" ;
+		TIME1:time_origin = "14-JAN-1980 14:00:00" ;
+		TIME1:axis = "T" ;
+		TIME1:standard_name = "time" ;
+	int FAREN(TIME1, PSZT11_10, PSYT135_56, PSXT191_108) ;
+		FAREN:missing_value = -999 ;
+		FAREN:_FillValue = -999 ;
+		FAREN:long_name = "TEMP*9/5 + 32" ;
+		FAREN:units = "Deg F" ;
+		FAREN:history = "From gt4d011" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_transforms.jnl
+*** Running test: bn_variance.jnl
+*** Running test: bn_linecolors.jnl
+*** Running test: bn_cdf_errmsg.jnl
+*** Running test: bn600_bug_fixes.jnl
+*** Running test: bn601_bug_fixes.jnl
+*** Running test: bn_set_strides.jnl
+*** Running test: bn_lsl_lowpass.jnl
+*** Running test: bn_return_xmod_tmod.jnl
+*** Running test: bn602_bug_fixes.jnl
+*** Running test: bn_modnbd.jnl
+*** Running test: bn_fifty_files.jnl
+*** Running test: bn603_bug_fixes.jnl
+*** Running test: bn_set_var_name.jnl
+*** Running test: bn_memory_symbol.jnl
+*** Running test: bn605_bug_fixes.jnl
+*** Running test: bn608_bug_fixes.jnl
+*** Running test: bn_shade_trim.jnl
+*** Running test: bn_mode_nlevels.jnl
+*** Running test: bn61_bug_fixes.jnl
+*** Running test: bn_test_opendap.jnl
+*** Running test: bn611_bug_fixes.jnl
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX = 4 ;
+	bnds = 2 ;
+variables:
+	double XAX(XAX) ;
+		XAX:point_spacing = "uneven" ;
+		XAX:axis = "X" ;
+		XAX:bounds = "XAX_bnds" ;
+	double XAX_bnds(XAX, bnds) ;
+	double A(XAX) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=XAX]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX = 1.5, 3, 6, 8.5 ;
+
+ XAX_bnds =
+  1, 2,
+  2, 4,
+  4, 8,
+  8, 9 ;
+
+ A = 1.5, 3, 6, 8.5 ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_380 = 360 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_380(XAX_LEV9421_380) ;
+		XAX_LEV9421_380:units = "degrees_east" ;
+		XAX_LEV9421_380:modulo = " " ;
+		XAX_LEV9421_380:point_spacing = "even" ;
+		XAX_LEV9421_380:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_380:axis = "X" ;
+		XAX_LEV9421_380:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_380) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX_LEV9421_3801_12 = 12 ;
+	YAX_LEV9450_50 = 1 ;
+	ZAXLEVIT191_1 = 1 ;
+	TIME = UNLIMITED ; // (1 currently)
+variables:
+	double XAX_LEV9421_3801_12(XAX_LEV9421_3801_12) ;
+		XAX_LEV9421_3801_12:units = "degrees_east" ;
+		XAX_LEV9421_3801_12:modulo = " " ;
+		XAX_LEV9421_3801_12:point_spacing = "even" ;
+		XAX_LEV9421_3801_12:long_name = "Here is a long name for the x axis of TEMP" ;
+		XAX_LEV9421_3801_12:axis = "X" ;
+		XAX_LEV9421_3801_12:standard_name = "longitude" ;
+	double YAX_LEV9450_50(YAX_LEV9450_50) ;
+		YAX_LEV9450_50:units = "degrees_north" ;
+		YAX_LEV9450_50:point_spacing = "even" ;
+		YAX_LEV9450_50:axis = "Y" ;
+		YAX_LEV9450_50:standard_name = "latitude" ;
+	double ZAXLEVIT191_1(ZAXLEVIT191_1) ;
+		ZAXLEVIT191_1:units = "meters" ;
+		ZAXLEVIT191_1:positive = "down" ;
+		ZAXLEVIT191_1:point_spacing = "even" ;
+		ZAXLEVIT191_1:axis = "Z" ;
+		ZAXLEVIT191_1:standard_name = "depth" ;
+	double TIME(TIME) ;
+		TIME:units = "hour since 0000-01-01 00:00:00" ;
+		TIME:time_origin = "01-JAN-0000 00:00:00" ;
+		TIME:modulo = " " ;
+		TIME:axis = "T" ;
+		TIME:standard_name = "time" ;
+	float TEMP(TIME, ZAXLEVIT191_1, YAX_LEV9450_50, XAX_LEV9421_3801_12) ;
+		TEMP:missing_value = -1.e+34f ;
+		TEMP:_FillValue = -1.e+34f ;
+		TEMP:long_name = "Temperature" ;
+		TEMP:history = "From ocean_atlas_monthly" ;
+		TEMP:units = "Deg C" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	YAXIS = 61 ;
+variables:
+	double YAXIS(YAXIS) ;
+		YAXIS:units = "degrees_north" ;
+		YAXIS:point_spacing = "even" ;
+		YAXIS:axis = "Y" ;
+		YAXIS:standard_name = "latitude" ;
+	double V(YAXIS) ;
+		V:missing_value = -1.e+34 ;
+		V:_FillValue = -1.e+34 ;
+		V:long_name = "Y[GY=YAXIS]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_no_valid_on_plot.jnl
+*** Running test: bn_median.jnl
+*** Running test: bn614_bug_fixes.jnl
+err611_set_var_ez.jnl --- 
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_ASC(XAX1_3) ;
+		MY_ASC:missing_value = 3.f ;
+		MY_ASC:_FillValue = 3.f ;
+		MY_ASC:long_name = "chlorophyll" ;
+		MY_ASC:units = "micrograms/L" ;
+		MY_ASC:history = "From dat.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	float MY_UNF(XAX1_3) ;
+		MY_UNF:missing_value = 5.f ;
+		MY_UNF:_FillValue = 5.f ;
+		MY_UNF:long_name = "Some Unformatted input" ;
+		MY_UNF:units = "metres" ;
+		MY_UNF:history = "From unf.dat" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_attributes.jnl --- SET VAR/OUTTYPE for user variable
+netcdf a {
+dimensions:
+	XAX1_3 = 3 ;
+variables:
+	double XAX1_3(XAX1_3) ;
+		XAX1_3:point_spacing = "even" ;
+		XAX1_3:axis = "X" ;
+	double A(XAX1_3) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "{1.1,2.2,3.3}" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_3 = 1, 2, 3 ;
+
+ A = 1.1, 2.2, 3.3 ;
+}
+netcdf a {
+dimensions:
+	XAX1_12 = 12 ;
+variables:
+	double XAX1_12(XAX1_12) ;
+		XAX1_12:point_spacing = "even" ;
+		XAX1_12:axis = "X" ;
+	int A(XAX1_12) ;
+		A:missing_value = 999 ;
+		A:_FillValue = 999 ;
+		A:long_name = "{ 3.77, 4.00, 4.10, 4.33, 4.38, 4.27, 4.31, 4.40, 4.75, 5.01, 5.27, 5.52}" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+data:
+
+ XAX1_12 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ;
+
+ A = 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5 ;
+}
+*** Running test: bn_mode_nodata_lab.jnl
+*** Running test: bn_proleptic_gregorian_calendar.jnl
+*** Running test: bn_string_ngd_nbd.jnl
+*** Running test: bn_cat_string.jnl
+*** Running test: bn_sort_strings.jnl
+*** Running test: bn_samplexyt.jnl
+*** Running test: bn_last_go_file.jnl
+*** Running test: bn_cancel_upcase_uservar.jnl
+netcdf a {
+dimensions:
+	XAX1_10 = 10 ;
+	TDAY = UNLIMITED ; // (31 currently)
+	LON1_5 = 5 ;
+	LAT1_5 = 5 ;
+	bnds = 2 ;
+	ZT = 10 ;
+	TIME1478 = 3 ;
+variables:
+	double XAX1_10(XAX1_10) ;
+		XAX1_10:point_spacing = "even" ;
+		XAX1_10:axis = "X" ;
+	double TDAY(TDAY) ;
+		TDAY:units = "days since 1998-12-31 00:00:00" ;
+		TDAY:axis = "T" ;
+		TDAY:calendar = "GREGORIAN" ;
+		TDAY:time_origin = "31-DEC-1998" ;
+		TDAY:standard_name = "time" ;
+	double MyUpperLowerCaseVar(TDAY, XAX1_10) ;
+		MyUpperLowerCaseVar:missing_value = -1.e+34 ;
+		MyUpperLowerCaseVar:_FillValue = -1.e+34 ;
+		MyUpperLowerCaseVar:long_name = "X[X=1:10] + T[GT=TDAY]" ;
+	double LON1_5(LON1_5) ;
+		LON1_5:point_spacing = "even" ;
+		LON1_5:axis = "X" ;
+		LON1_5:standard_name = "longitude" ;
+	double LAT1_5(LAT1_5) ;
+		LAT1_5:point_spacing = "uneven" ;
+		LAT1_5:axis = "Y" ;
+		LAT1_5:standard_name = "latitude" ;
+		LAT1_5:bounds = "LAT1_5_bnds" ;
+	double LAT1_5_bnds(LAT1_5, bnds) ;
+	float ZT(ZT) ;
+		ZT:units = "meters" ;
+		ZT:positive = "down" ;
+		ZT:point_spacing = "uneven" ;
+		ZT:axis = "Z" ;
+		ZT:standard_name = "depth" ;
+		ZT:bounds = "ZT_bnds" ;
+	float ZT_bnds(ZT, bnds) ;
+	double TIME1478(TIME1478) ;
+		TIME1478:calendar = "NOLEAP" ;
+		TIME1478:point_spacing = "even" ;
+		TIME1478:axis = "T" ;
+		TIME1478:standard_name = "time" ;
+	double newvar(TIME1478, ZT, LAT1_5, LON1_5) ;
+		newvar:missing_value = -999. ;
+		newvar:_FillValue = -999. ;
+		newvar:long_name = "outgoing longwave radiation" ;
+		newvar:units = "watts/m2" ;
+		newvar:history = "From a" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_cdf_keepax.jnl
+*** Running test: bn_keep_axisnames.jnl
+bn_keep_axisnames.jnl --- test SAVE/KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X100 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X100(X100) ;
+		X100:units = "degrees_east" ;
+		X100:point_spacing = "even" ;
+		X100:axis = "X" ;
+		X100:modulo = 360. ;
+		X100:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X100) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_keep_axisnames.jnl --- without /KEEP_AXISNAMES
+netcdf a {
+dimensions:
+	X10030_40 = 11 ;
+	T31 = UNLIMITED ; // (14 currently)
+variables:
+	double X10030_40(X10030_40) ;
+		X10030_40:units = "degrees_east" ;
+		X10030_40:point_spacing = "even" ;
+		X10030_40:axis = "X" ;
+		X10030_40:modulo = 360. ;
+		X10030_40:standard_name = "longitude" ;
+	double T31(T31) ;
+		T31:units = "days since 1999-12-31 00:00:00" ;
+		T31:axis = "T" ;
+		T31:calendar = "GREGORIAN" ;
+		T31:time_origin = "31-DEC-1999" ;
+		T31:standard_name = "time" ;
+	double A(T31, X10030_40) ;
+		A:missing_value = -1.e+34 ;
+		A:_FillValue = -1.e+34 ;
+		A:long_name = "X[GX=X100] + T[GT=T31]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_key_label_minmax.jnl
+*** Running test: bn62_bug_fixes.jnl
+*** Running test: bn_convolve.jnl
+*** Running test: bn_tax_tstep.jnl
+*** Running test: bn_grads_z.jnl
+*** Running test: bn_clock_syms.jnl
+*** Running test: bn63_bug_fixes.jnl
+*** Running test: bn_axis_reversed_syms.jnl
+*** Running test: bn_isdepth.jnl
+*** Running test: bn_var_hist_levels.jnl
+*** Running test: bn64_bug_fixes.jnl
+*** Running test: bn_long_grid_names.jnl
+*** Running test: bn_xml_repl.jnl
+*** Running test: bn65_bug_fixes.jnl
+*** Running test: bn_txtype_dmy.jnl
+*** Running test: bn_n_open_dsets_sym.jnl
+*** Running test: bn_multi_decade.jnl
+*** Running test: bn_show_xml_file.jnl
+*** Running test: bn66_bug_fixes.jnl
+*** Running test: bn_netcdf4.jnl
+*** Running test: bn_scat2grid_bin.jnl
+*** Running test: bn_axis_dir_symbols.jnl
+*** Running test: bn663_bug_fixes.jnl
+*** Running test: bn_set_axis_regular.jnl
+*** Running test: bn_set_cancel_redirect.jnl
+*** Running test: bn_min_max_smoothers.jnl
+*** Running test: bn_vector_symbols.jnl
+*** Running test: bn_variance_large.jnl
+*** Running test: bn_labnum_calendar.jnl
+*** Running test: bn665_bug_fixes.jnl
+*** Running test: bn_floatstr.jnl
+*** Running test: bn67_bug_fixes.jnl
+*** Running test: bn_NaN_note.jnl
+*** Running test: bn671_bug_fixes.jnl
+*** Running test: bn68_bug_fixes.jnl
+*** Running test: bn_ifv.jnl
+*** Running test: bn_randu2_randn2.jnl
+*** Running test: bn_axis_cf.jnl
+bn_axis_cf.jnl, degrees_east, degrees_north, std names on axes:
+netcdf a {
+dimensions:
+	XAX = 11 ;
+	YAX = 6 ;
+	TAXIS = UNLIMITED ; // (5 currently)
+	ZAXDN = 4 ;
+	bnds = 2 ;
+	ZAXUP = 5 ;
+variables:
+	double XAX(XAX) ;
+		XAX:units = "degrees_east" ;
+		XAX:point_spacing = "even" ;
+		XAX:axis = "X" ;
+		XAX:modulo = 360. ;
+		XAX:standard_name = "longitude" ;
+	double XX(XAX) ;
+		XX:missing_value = -1.e+34 ;
+		XX:_FillValue = -1.e+34 ;
+		XX:long_name = "X[GX=XAX]" ;
+	double YAX(YAX) ;
+		YAX:units = "degrees_north" ;
+		YAX:point_spacing = "even" ;
+		YAX:axis = "Y" ;
+		YAX:standard_name = "latitude" ;
+	double YY(YAX) ;
+		YY:missing_value = -1.e+34 ;
+		YY:_FillValue = -1.e+34 ;
+		YY:long_name = "Y[GY=YAX]" ;
+	double TAXIS(TAXIS) ;
+		TAXIS:units = "days since 2000-01-01 00:00:00" ;
+		TAXIS:axis = "T" ;
+		TAXIS:calendar = "GREGORIAN" ;
+		TAXIS:time_origin = "1-JAN-2000" ;
+		TAXIS:standard_name = "time" ;
+	double TT(TAXIS) ;
+		TT:missing_value = -1.e+34 ;
+		TT:_FillValue = -1.e+34 ;
+		TT:long_name = "T[GT=TAXIS]" ;
+	double ZAXDN(ZAXDN) ;
+		ZAXDN:units = "meters" ;
+		ZAXDN:point_spacing = "uneven" ;
+		ZAXDN:axis = "Z" ;
+		ZAXDN:bounds = "ZAXDN_bnds" ;
+		ZAXDN:positive = "down" ;
+		ZAXDN:standard_name = "depth" ;
+	double ZAXDN_bnds(ZAXDN, bnds) ;
+	double ZDN(ZAXDN) ;
+		ZDN:missing_value = -1.e+34 ;
+		ZDN:_FillValue = -1.e+34 ;
+		ZDN:long_name = "Z[GZ=ZAXDN]" ;
+	double ZAXUP(ZAXUP) ;
+		ZAXUP:units = "meters" ;
+		ZAXUP:point_spacing = "uneven" ;
+		ZAXUP:axis = "Z" ;
+		ZAXUP:bounds = "ZAXUP_bnds" ;
+		ZAXUP:standard_name = "altitude" ;
+	double ZAXUP_bnds(ZAXUP, bnds) ;
+	double ZUP(ZAXUP) ;
+		ZUP:missing_value = -1.e+34 ;
+		ZUP:_FillValue = -1.e+34 ;
+		ZUP:long_name = "Z[GZ=ZAXUP]" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Convert forms of DEG, degrees to degrees_east:
+netcdf a {
+dimensions:
+	XAXIS = 31 ;
+	YFIFTEEN = 13 ;
+variables:
+	double XAXIS(XAXIS) ;
+		XAXIS:units = "degrees_east" ;
+		XAXIS:point_spacing = "even" ;
+		XAXIS:axis = "X" ;
+		XAXIS:modulo = 360. ;
+		XAXIS:standard_name = "longitude" ;
+	float VAR(XAXIS) ;
+		VAR:missing_value = -1.e+34f ;
+		VAR:_FillValue = -1.e+34f ;
+		VAR:long_name = "X[GX=XAXIS]" ;
+		VAR:history = "From degrees" ;
+	double YFIFTEEN(YFIFTEEN) ;
+		YFIFTEEN:units = "degrees_north" ;
+		YFIFTEEN:point_spacing = "even" ;
+		YFIFTEEN:axis = "Y" ;
+		YFIFTEEN:standard_name = "latitude" ;
+	double Y_(YFIFTEEN) ;
+		Y_:missing_value = -1.e+34 ;
+		Y_:_FillValue = -1.e+34 ;
+		Y_:long_name = "Y" ;
+		Y_:long_name_mod = "axis YFIFTEEN" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+bn_axis_cf.jnl, Downcase units, e.g. in time axis DAYS since
+netcdf a {
+dimensions:
+	XLON = 40 ;
+	YLAT = 30 ;
+	TTIME = UNLIMITED ; // (20 currently)
+variables:
+	double XLON(XLON) ;
+		XLON:units = "degrees_east" ;
+		XLON:point_spacing = "even" ;
+		XLON:modulo = 360. ;
+		XLON:axis = "X" ;
+		XLON:standard_name = "longitude" ;
+	double YLAT(YLAT) ;
+		YLAT:units = "degrees_north" ;
+		YLAT:point_spacing = "even" ;
+		YLAT:axis = "Y" ;
+		YLAT:standard_name = "latitude" ;
+	double TTIME(TTIME) ;
+		TTIME:units = "days since 1901-01-15 00:00:00" ;
+		TTIME:time_origin = "15-JAN-1901 00:00:00" ;
+		TTIME:axis = "T" ;
+		TTIME:standard_name = "time" ;
+	float XYTVAR(TTIME, YLAT, XLON) ;
+		XYTVAR:missing_value = -1.e+34f ;
+		XYTVAR:_FillValue = -1.e+34f ;
+		XYTVAR:long_name = "L*1000 + J*10 + I" ;
+		XYTVAR:history = "From bn_strides" ;
+
+// global attributes:
+		:history = "FERRET V6.9 (PyFerret 1.0.2) 31-Mar-14" ;
+		:Conventions = "CF-1.0" ;
+}
+*** Running test: bn_repeated_coords.jnl
+*** Running test: bn_xml_header.jnl
+*** Running test: bn_eof_simple.jnl
+*** Running test: bn_eof_simple2.jnl
+*** Running test: bn_interpolate_6d.jnl
+*** Running test: bn_regrid_6d.jnl
+*** Running test: bn_syntax_6d.jnl
+*** Running test: bn_expressions_6d.jnl
+*** Running test: bn_direction_fcns_6d.jnl
+*** Running test: bn_regrid_transforms_6d.jnl
+*** Running test: bn_aggregate_e.jnl
+*** Running test: bn_6d_lab_mode.jnl
+*** Running test: bn682_bug_fixes.jnl
+*** Running test: bn683_bug_fixes.jnl
+*** Running test: bn_outtype.jnl
+*** Running test: bn_ribbon_plot.jnl
+*** Running test: bn_descr_4digit.jnl
+*** Running test: bn_axis_outtype.jnl
+*** Running test: bn_axis_nonmonotonic.jnl
+*** Running test: bn_vec_mod.jnl
+*** Running test: bn685_bug_fixes.jnl
+*** Running test: bn_dsg_e_x.jnl
+*** Running test: bn_nco_append.jnl
+*** Running test: bn_nobounds.jnl
+*** Running test: bn_write_integer_att.jnl
+*** Running test: bn_descriptor_mc.jnl
+*** Running test: bn_plot_color_only.jnl
+*** Running test: bn_vtree.jnl
+*** Running test: bn686_bug_fixes.jnl
+*** Running test: bn_long_symnames.jnl
+*** Running test: bn_strdim.jnl
+*** Running test: bn_single_colorlev.jnl
+*** Running test: bn69_bug_fixes.jnl
+*** Running test: bn_bad_axis_bounds.jnl
+*** Running test: bn_enter_exit_GO.jnl
+*** Running test: bn_stddev.jnl
+*** Running test: bn_set_axis_name.jnl
+*** Running test: bn_all_ef.jnl
+*** Running test: bn_startupfile.jnl
diff --git a/bench/test_results/startup_tests2.pdf b/bench/test_results/startup_tests2.pdf
new file mode 100644
index 0000000..48b5c14
Binary files /dev/null and b/bench/test_results/startup_tests2.pdf differ
diff --git a/bench/test_results/timetics.pdf b/bench/test_results/timetics.pdf
new file mode 100644
index 0000000..1461827
Binary files /dev/null and b/bench/test_results/timetics.pdf differ
diff --git a/bench/test_results/timetics2.pdf b/bench/test_results/timetics2.pdf
new file mode 100644
index 0000000..d02be64
Binary files /dev/null and b/bench/test_results/timetics2.pdf differ
diff --git a/bench/test_results/vec_curv.pdf b/bench/test_results/vec_curv.pdf
new file mode 100644
index 0000000..d6756a0
Binary files /dev/null and b/bench/test_results/vec_curv.pdf differ
diff --git a/bench/test_results/vec_curv2.pdf b/bench/test_results/vec_curv2.pdf
new file mode 100644
index 0000000..be1b9c6
Binary files /dev/null and b/bench/test_results/vec_curv2.pdf differ
diff --git a/bench/test_results/viewaxes.pdf b/bench/test_results/viewaxes.pdf
new file mode 100644
index 0000000..459e835
Binary files /dev/null and b/bench/test_results/viewaxes.pdf differ
diff --git a/bench/test_trans.html b/bench/test_trans.html
new file mode 100644
index 0000000..b532744
--- /dev/null
+++ b/bench/test_trans.html
@@ -0,0 +1,7 @@
+<html> 
+<body bgcolor="gray"> 
+<img src="testbackground.gif"/>
+
+</body> 
+</html> 
+
diff --git a/bench/time_axis_seconds.nc b/bench/time_axis_seconds.nc
new file mode 100644
index 0000000..6be534f
Binary files /dev/null and b/bench/time_axis_seconds.nc differ
diff --git a/bench/timemissing.nc b/bench/timemissing.nc
new file mode 100644
index 0000000..1704ebd
Binary files /dev/null and b/bench/timemissing.nc differ
diff --git a/bench/tnok_short.des b/bench/tnok_short.des
new file mode 100644
index 0000000..7080b52
--- /dev/null
+++ b/bench/tnok_short.des
@@ -0,0 +1,38 @@
+ ********************************************************************************
+ *        comments                                                              *
+ ******************************************************************************** 
+ $FORMAT_RECORD
+   D_TYPE        = '  MC'
+   D_FORMAT      = '  1A'
+ $END
+ $BACKGROUND_RECORD
+   D_TITLE       = '10 Day SST Composite'
+   D_T0TIME      = '01-jan-1970 00:00:00'
+   D_TIME_UNIT   = 86400
+   D_TIME_MODULO = .false.
+   D_CALTYPE	 = 'JULIAN'
+ $END
+ $MESSAGE_RECORD
+      D_MESSAGE     = ' '
+      D_ALERT_ON_OPEN      = .FALSE.
+      D_ALERT_ON_OUTPUT    = .FALSE.
+
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ &STEPFILE_RECORD
+   S_FILENAME    = 'sstnok_short.nc'
+   S_AUX_SET_NUM = 0
+   S_START       = 12418
+   S_END 	 = 12418
+   S_DELTA       = 2
+   S_NUM_OF_FILES	= 1
+   S_REGVARFLAG  = ' '
+ $ END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
diff --git a/bench/tok_short.des b/bench/tok_short.des
new file mode 100644
index 0000000..3c01594
--- /dev/null
+++ b/bench/tok_short.des
@@ -0,0 +1,38 @@
+ ********************************************************************************
+ *        comments                                                              *
+ ******************************************************************************** 
+ $FORMAT_RECORD
+   D_TYPE        = '  MC'
+   D_FORMAT      = '  1A'
+ $END
+ $BACKGROUND_RECORD
+   D_TITLE       = '10 Day SST Composite'
+   D_T0TIME      = '01-jan-1970 00:00:00'
+   D_TIME_UNIT   = 86400
+   D_TIME_MODULO = .false.
+   D_CALTYPE	 = 'JULIAN'
+ $END
+ $MESSAGE_RECORD
+      D_MESSAGE     = ' '
+      D_ALERT_ON_OPEN      = .FALSE.
+      D_ALERT_ON_OUTPUT    = .FALSE.
+
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ &STEPFILE_RECORD
+   S_FILENAME    = 'sstok_short.nc'
+   S_AUX_SET_NUM = 0
+   S_START       = 12418
+   S_END 	 = 12418
+   S_DELTA       = 2
+   S_NUM_OF_FILES	= 1
+   S_REGVARFLAG  = ' '
+ $END
+
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
diff --git a/bench/toolong.nc b/bench/toolong.nc
new file mode 100644
index 0000000..d1afbb8
Binary files /dev/null and b/bench/toolong.nc differ
diff --git a/bench/trajectory_trajectory_name.nc b/bench/trajectory_trajectory_name.nc
new file mode 100644
index 0000000..e3927a1
Binary files /dev/null and b/bench/trajectory_trajectory_name.nc differ
diff --git a/bench/tripolar_subset.nc b/bench/tripolar_subset.nc
new file mode 100644
index 0000000..dff2576
Binary files /dev/null and b/bench/tripolar_subset.nc differ
diff --git a/bench/truemonth.nc b/bench/truemonth.nc
new file mode 100644
index 0000000..b1627c3
Binary files /dev/null and b/bench/truemonth.nc differ
diff --git a/bench/twoType.dat b/bench/twoType.dat
new file mode 100644
index 0000000..6d86d1b
Binary files /dev/null and b/bench/twoType.dat differ
diff --git a/bench/uncentered.nc b/bench/uncentered.nc
new file mode 100644
index 0000000..88f83e0
Binary files /dev/null and b/bench/uncentered.nc differ
diff --git a/bench/vary_scale.des b/bench/vary_scale.des
new file mode 100644
index 0000000..e449cac
--- /dev/null
+++ b/bench/vary_scale.des
@@ -0,0 +1,49 @@
+*******************************************************************************
+*  make up a des file to test different scaling values  within files          *
+*  cdl files edited to put in scale_factor and add-offset, each different     * 
+*******************************************************************************
+ $FORMAT_RECORD
+   D_TYPE               = '  MC',
+   D_FORMAT             = '  1A',
+   D_SOURCE_CLASS       = 'MODEL OUTPUT',
+ $END
+ $BACKGROUND_RECORD
+  D_EXPNUM             = '0000',
+  D_MODNUM             = '  00',
+  D_TITLE              = 'Model Output, Daily Averages',
+  D_T0TIME             = '1-jan-1990 00:00:00',
+  D_TIME_UNIT          = 86400.,
+  D_TIME_MODULO        = .FALSE.,
+ $END
+ $MESSAGE_RECORD
+   D_MESSAGE            = ' ',
+   D_ALERT_ON_OPEN      = F,
+   D_ALERT_ON_OUTPUT    = F,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = "varyscale_1.nc",
+   S_AUX_SET_NUM        = 0,
+   S_START              = 0.
+   S_END                = 9.,
+   S_DELTA              = 1.,
+   S_NUM_OF_FILES       = 1,
+ $END
+ **************************************************
+ $EXTRA_RECORD
+ $END
+ $STEPFILE_RECORD
+   S_FILENAME           = "varyscale_2.nc",
+   S_AUX_SET_NUM        = 0,
+   S_START              = 10.,
+   S_END                = 19.,
+   S_DELTA              = 1.,
+   S_NUM_OF_FILES       = 1,
+ $END
+ **************************************************
+ $STEPFILE_RECORD
+   S_FILENAME           = '**END OF STEPFILES**'
+ $END
+ **************************************************
diff --git a/bench/varyscale_1.nc b/bench/varyscale_1.nc
new file mode 100644
index 0000000..9aaed41
Binary files /dev/null and b/bench/varyscale_1.nc differ
diff --git a/bench/varyscale_2.nc b/bench/varyscale_2.nc
new file mode 100644
index 0000000..2e354e8
Binary files /dev/null and b/bench/varyscale_2.nc differ
diff --git a/bench/weird_name1.cdf b/bench/weird_name1.cdf
new file mode 100644
index 0000000..acf3bf0
Binary files /dev/null and b/bench/weird_name1.cdf differ
diff --git a/bench/write_int_att.nc b/bench/write_int_att.nc
new file mode 100644
index 0000000..957f722
Binary files /dev/null and b/bench/write_int_att.nc differ
diff --git a/bench/xml_header_script.jnl b/bench/xml_header_script.jnl
new file mode 100644
index 0000000..1b02fbc
--- /dev/null
+++ b/bench/xml_header_script.jnl
@@ -0,0 +1,22 @@
+!header.jnl
+! argument 1 is a script that opens the dataset
+! argument 2 is the name of the xml file to write
+! Requires Ferret v6.5 or higher
+
+! This is the header.jnl script from LAS; comment out can mode verify
+! Ferret v685, show/data/var/xml includes the output of show axis, so remove that.
+
+! cancel mode verify
+IF `($ferret_version) LT 6.5` THEN
+ say header.jnl requires Ferret v6.5 or higher
+ exit/script
+ENDIF
+
+go "$1"
+DEFINE SYMBOL output_xml_file = $2
+
+say/quiet/outfile="($output_xml_file)"/clobber <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+say/quiet/outfile="($output_xml_file)"/append <data>
+
+show data/var/xml/append/outfile="($output_xml_file)" 1
+say/quiet/append/outfile="($output_xml_file)" </data> 
diff --git a/bench/xml_use_coads.jnl b/bench/xml_use_coads.jnl
new file mode 100644
index 0000000..4415c52
--- /dev/null
+++ b/bench/xml_use_coads.jnl
@@ -0,0 +1,2 @@
+use coads_climatology
+
diff --git a/bench/xml_use_numstring.jnl b/bench/xml_use_numstring.jnl
new file mode 100644
index 0000000..73d53e1
--- /dev/null
+++ b/bench/xml_use_numstring.jnl
@@ -0,0 +1,2 @@
+use numstring
+
diff --git a/bench/xsz.nc b/bench/xsz.nc
new file mode 100644
index 0000000..6da3383
Binary files /dev/null and b/bench/xsz.nc differ
diff --git a/bench/xz_nozattrib.nc b/bench/xz_nozattrib.nc
new file mode 100644
index 0000000..c5431e8
Binary files /dev/null and b/bench/xz_nozattrib.nc differ
diff --git a/bench/z_wide_variation.nc b/bench/z_wide_variation.nc
new file mode 100644
index 0000000..79d50b9
Binary files /dev/null and b/bench/z_wide_variation.nc differ
diff --git a/bin/Fdata b/bin/Fdata
new file mode 100755
index 0000000..0b8b4b6
--- /dev/null
+++ b/bin/Fdata
@@ -0,0 +1,25 @@
+#! /bin/sh
+# Fdata file_template
+# determine if FERRET data files matching file_template are currently on-line by
+# searching the paths in FER_DATA
+
+if [ $# -ne 1 ]; then
+   echo "usage: Fdata data_file_template"
+   exit
+fi
+
+found=0
+for subdir in ${FER_DATA} ; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"$1"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      ( cd "${subdir}" ; /bin/ls -l ${filelist} )
+      found=1
+      echo " " 
+   fi
+done
+
+if [ ${found} -eq 0 ]; then
+   echo "No files matching '$1' were found"
+fi
+
diff --git a/bin/Fdescr b/bin/Fdescr
new file mode 100755
index 0000000..490cb73
--- /dev/null
+++ b/bin/Fdescr
@@ -0,0 +1,25 @@
+#! /bin/sh
+# Fdescr file_template    
+# determine if FERRET descriptor files matching template are currently on-line
+# by searching the paths in FER_DESCR
+
+if [ $# -ne 1 ]; then
+   echo "usage: Fdescr descriptor_file_template"
+   exit
+fi
+
+found=0
+for subdir in ${FER_DESCR}; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"$1"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      ( cd "${subdir}" ; /bin/ls -l ${filelist} )
+      found=1
+      echo " " 
+   fi
+done
+
+if [ ${found} -eq 0 ]; then
+   echo "No files matching '$1' were found"
+fi
+
diff --git a/bin/Fenv b/bin/Fenv
new file mode 100755
index 0000000..07125de
--- /dev/null
+++ b/bin/Fenv
@@ -0,0 +1,5 @@
+#! /bin/sh
+# Fenv    
+# list the environment variables relevant to the FERRET program
+
+env | grep FER | sort
diff --git a/bin/Fgo b/bin/Fgo
new file mode 100755
index 0000000..92c3de5
--- /dev/null
+++ b/bin/Fgo
@@ -0,0 +1,79 @@
+#! /bin/sh
+# Fgo go_file_template    
+# determine if files matching go_file_template are currently on-line by
+# searching the paths in FER_GO
+
+print_usage() {
+   echo " "
+   echo "Usage:"
+   echo "    Fgo [ -help | -d | -l | -more ]  go_file_template"
+   echo " "
+   echo "where options include: "
+   echo "    -help    print this help message and exit"
+   echo "    -d       generate filename list with descriptions (default)"
+   echo "    -l       generate long listing without descriptions"
+   echo "    -more    display files matching the given template using more"
+   echo " "
+   echo "These options precede the file template.  Files matching the"
+   echo "given template are then listed, or displayed using more if"
+   echo "the -more option is used.  All options are mutually exclusive."
+   echo "To see all of the Go tools/journal files available, enter: "
+   echo "    Fgo '*'"
+   echo "It is important to have the quotes around any asterisks"
+   echo "in the file template."
+   echo " " 
+}
+
+#check for proper amount of args.  One arg is the filename or template. 
+if [ $# -le 0 ] || [ $# -gt 2 ]; then
+   print_usage
+   exit 1
+fi
+
+# check for help flag
+if echo "$1" | grep -q '^-h' ; then
+   print_usage
+   exit 1
+fi
+
+if [ $# -eq 1 ]; then
+   option=""
+   template="$1"
+else
+   option="$1"
+   template="$2"
+fi
+
+# check to see if file contains .jnl 
+if ! echo "${template}" | grep -q '\.jnl' ; then
+   template="${template}*.jnl"
+fi
+
+found=0
+for subdir in ${FER_GO}; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"${template}"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      if [ -z "${option}" ] || [ "${option}" == "-d" ]; then
+         for gofile in ${filelist} ; do
+            descript=`cd ${subdir} ; grep -i ' description: ' ${gofile} | sed -e 's/\! [dD][eE][sS][cC][rR][iI][pP][tT][iI][oO][nN]: //'`
+            echo "${gofile}: ${descript}"
+         done
+      elif [ "${option}" == "-l" ]; then
+         ( cd "${subdir}" ; /bin/ls -l ${filelist} )
+      elif [ "${option}" == "-m" ] || [ "${option}" == "-more" ]; then
+         ( cd "${subdir}" ; more ${filelist} )
+      else
+         echo "Invalid option: ${option}"
+         print_usage
+         exit 1
+      fi
+      echo " " 
+      found=1
+   fi
+done
+
+if [ $found -eq 0 ]; then
+   echo "No files matching ${template} were found"
+fi
+
diff --git a/bin/Fgrids b/bin/Fgrids
new file mode 100755
index 0000000..71e525d
--- /dev/null
+++ b/bin/Fgrids
@@ -0,0 +1,25 @@
+#! /bin/sh
+# Fgrids grid_file_template    
+# determine if FERRET grid files matching template are currently on-line
+# by searching the paths in FER_GRIDS
+
+if [ $# -ne 1 ]; then
+   echo "usage: Fgrids grid_file_template"
+   exit
+fi
+
+found=0
+for subdir in ${FER_GRIDS} ; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"$1"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      ( cd ${subdir} ; /bin/ls -l ${filelist} )
+      echo " " 
+      found=1
+   fi
+done
+
+if [ ${found} -eq 0 ]; then
+   echo "No files matching $1 were found"
+fi
+
diff --git a/bin/Finstall b/bin/Finstall
new file mode 100755
index 0000000..23f7b47
--- /dev/null
+++ b/bin/Finstall
@@ -0,0 +1,535 @@
+#! /bin/sh
+## NOAA PMEL TMAP
+## Finstall
+## Does two things:
+## Option 1) extracts the contents of fer_executables.tar.gz into $FER_DIR
+##           after renaming any existing files that would have been overwritten
+## Option 2) modifies ferret_paths_template and pyferret_template files to 
+##           specify locations of ferret software and demo data sets to create 
+##           the ferret_paths and pyferret files.
+## All changes are recorded, with a timestamp, in the log file
+## $FER_DIR/bin/Finstall.log
+
+
+### Assign $fer_dir, the desired FER_DIR value
+get_fer_dir() {
+    if [ -n "${FER_DIR}" ]; then
+        fer_dir="${FER_DIR}"
+        echo " "
+        echo " The environment variable FER_DIR is currently defined as "
+        echo " '${FER_DIR}' "
+        echo " This is the directory where the 'fer_environment.tar.gz' "
+        echo " file was installed/extracted. "
+        echo " "
+        read -p " Is that correct and acceptable (y/n) [y] " ans
+        if [ -z "${ans}" ] || [ "${ans}" = "Y" ] || [ "${ans}" = "y" ]; then
+            return 0
+        fi
+    fi
+
+    until [ 0 = 1 ]; do
+        echo " "
+        echo " Enter the name of the directory where the 'fer_environment.tar.gz' "
+        echo " file was installed/extracted (FER_DIR).  The location recommended "
+        echo " in the Ferret installation guide was '/usr/local/ferret'. "
+        echo " "
+        read -p " FER_DIR --> " fer_dir
+        if [ ! -d "${fer_dir}" ]; then
+            echo " '${fer_dir}' is not a directory"
+        else
+#           resolve relative pathnames
+            fer_dir=`cd "${fer_dir}" ; pwd`
+            if [ ! -x "${fer_dir}/bin/Fenv" ]; then
+                echo " The Ferret environment files are not in "
+                echo " '${fer_dir}' "
+            else
+                return 0
+            fi
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### Assign $fer_dsets, the desired FER_DSETS value
+get_fer_dsets() {
+    if [ -n "${FER_DSETS}" ]; then
+        fer_dsets="${FER_DSETS}"
+        echo " "
+        echo " The environment variable FER_DSETS is currently defined as "
+        echo " '${FER_DSETS}' "
+        echo " This is the directory where the 'fer_dsets.tar.gz' file was "
+        echo " installed/extracted."
+        echo " "
+        read -p " Is that correct and acceptable (y/n) [y] " ans
+        if [ -z "${ans}" ] || [ "${ans}" = "Y" ] || [ "${ans}" = "y" ]; then
+            return 0
+        fi
+    fi
+
+    until [ 0 = 1 ]; do
+        echo " "
+        echo " Enter the name of the directory where the 'fer_dsets.tar.gz' "
+        echo " file was installed/extracted (FER_DSETS)."
+        echo " "
+        read -p " FER_DSETS --> " fer_dsets
+        if [ ! -d "${fer_dsets}" ]; then
+            echo " '${fer_dsets}' is not a directory"
+        else
+#           resolve relative pathnames
+            fer_dsets=`cd "${fer_dsets}" ; pwd`
+            if [ ! -f "${fer_dsets}/data/coads_climatology.cdf" ]; then
+                echo " The Ferret demonstration data files are not in "
+                echo " '${fer_dsets}' "
+            else
+                return 0
+            fi
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### Assign $ferpaths_dir, the directory to contain the ferret_paths.* files
+get_ferpaths_dir() {
+    until [ 0 = 1 ]; do
+        echo " "
+        echo " Enter the name of the directory where you want to place "
+        echo " the newly created 'ferret_paths.csh', 'ferret_path.sh', "
+        echo " pyferret files; for example, '/usr/local/bin'."
+        echo " "
+        read -p " desired ferret_paths location --> " ferpaths_dir
+        if [ ! -d "${ferpaths_dir}" ]; then
+            echo " '${ferpaths_dir}' is not a directory"
+        else
+#           resolve relative pathnames
+            ferpaths_dir=`cd "${ferpaths_dir}" ; pwd`
+#           if ferret_paths* exists, check to see if it's OK to replace
+            if [ -f "${ferpaths_dir}/ferret_paths.csh" ] || \
+               [ -f "${ferpaths_dir}/ferret_paths.sh" ] ||
+               [ -f "${ferpaths_dir}/pyferret.csh" ] ||
+               [ -f "${ferpaths_dir}/pyferret.sh" ] ; then
+                echo " "
+                if [ -f "${ferpaths_dir}/ferret_paths.csh" ]; then
+                    echo " ${ferpaths_dir}/ferret_paths.csh already exists"
+                fi
+                if [ -f "${ferpaths_dir}/ferret_paths.sh" ]; then
+                    echo " ${ferpaths_dir}/ferret_paths.sh already exists"
+                fi
+                if [ -f "${ferpaths_dir}/pyferret.csh" ]; then
+                    echo " ${ferpaths_dir}/pyferret.csh already exists"
+                fi
+                if [ -f "${ferpaths_dir}/pyferret.sh" ]; then
+                    echo " ${ferpaths_dir}/pyferret.sh already exists"
+                fi
+                read -p " Rename and create new? (n/y) [n] " ans
+                if [ "${ans}" = "Y" ] || [ "${ans}" = "y" ]; then
+                    return 0
+                fi
+                read -p " Select a different directory? (y/n) [y] " ans
+                if [ -n "${ans}" ] && [ "${ans}" != "Y" ] && [ "${ans}" != "y" ]; then
+                    return 1
+                fi
+            else
+                return 0
+            fi
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### assign $ferpaths_link, the link destination, if any, for ferret_paths
+get_ferpaths_link() {
+    echo " "
+    echo " To duplicate behavior found in older version of Ferret, you can "
+    echo " create a link (shortcut) 'ferret_paths' that refers to either "
+    echo " 'ferret_paths.csh' or 'ferret_paths.sh'.  This is simply a "
+    echo " convenience for users and should only be done on systems where "
+    echo " all Ferret users work under the same shell (such as tcsh or bash). "
+    echo " The files 'ferret_path.csh' and 'ferret_paths.sh' can always be "
+    echo " used regardless of the answer to this question. "
+    until [ 0 = 1 ]; do
+        echo " "
+        echo " ferret_paths link options: "
+        echo "    c - link to ferret_paths.csh (all users work under tcsh, csh) "
+        echo "    s - link to ferret_paths.sh (all users work under bash, dash, ksh, sh) "
+        echo "    n - do not create the link (use ferret_paths.csh or ferret_paths.sh)"
+        read -p " ferret_paths link to create? (c/s/n) [n] --> " ans
+        if [ -z "$ans" ] || [ "$ans" = 'n' ] || [ "$ans" = 'N' ]; then
+           ferpaths_link=''
+           return 0
+        elif [ "$ans" = 'c' ] || [ "$ans" = 'C' ]; then
+           ferpaths_link='ferret_paths.csh'
+           return 0
+        elif [ "$ans" = 's' ] || [ "$ans" = 'S' ]; then
+           ferpaths_link='ferret_paths.sh'
+           return 0
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### Get python_executable and python_subdirectory
+get_python_vars() {
+    echo " "
+    echo " Enter the desired python executable to use for running PyFerret. "
+    echo " This may simply be 'python', but on systems with multiple versions "
+    echo " of python, you need to specify the version to use, such as 'python2.6' "
+    echo " or 'python2.7', or the full-path name to desired version of python. "
+    until [ 0 = 1 ]; do
+        echo " "
+        read -p " python executable to use: ['python'] --> " ans
+        if [ -z "$ans" ]; then
+            ans='python'
+        fi
+#       expand to the full path name, just to be safe (may not be necessary)
+        python_executable=`which "$ans"`
+#       assign python_subdirectory as 'python2.6' or 'python2.7' using the version
+#       number reported by the python executable (which validates the python executable)
+        python_subdirectory=`${ans} -c "import sys; print 'python%i.%i' % sys.version_info[:2]"`
+        if echo "${python_subdirectory}" | grep -q '^python2\.[67]$'; then
+            return 0
+        elif echo "${python_subdirectory}" | grep -q '^python'; then
+            echo " ${ans} appears to be ${python_subdirectory}; only python2.6 or python2.7 supported "
+        else
+            echo " ${ans} does not appear to be a valid python executable "
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### Write a message to ${fer_dir}/bin/Finstall.log (creating it if it does not exist)
+write_log_message() {
+#   Sanity check
+    if [ -z "${fer_dir}" ]; then
+        echo " Unexpected script error: fer_dir not defined in write_log_message "
+        exit 1
+    fi
+#   get_fer_dir ensures ${fer_dir}/bin already exists
+#   Create Finstall.log file if it does not exist
+    logfile="${fer_dir}/bin/Finstall.log"
+    if [ ! -f "${logfile}" ]; then
+        echo " Creating Finstall.log in ${fer_dir}/bin "
+        timestamp=`/bin/date +' %D %T'`
+        if ! echo "${timestamp} Created Finstall.log " > "${logfile}" ; then
+            return 1
+        fi
+    fi
+
+    timestamp=`/bin/date +' %D %T'`
+    if ! echo "${timestamp} $1 " >> "${logfile}" ; then
+        return 1
+    fi
+}
+
+
+### Edit the ferret_paths_template.{csh,sh} files to create the ferret_paths.{csh,sh} files 
+### and edit the pyferret_template.{csh,sh} files to create the pyferret.{csh.sh} files.
+create_ferret_paths_and_pyferret() {
+#   Check for existing ferret_paths.csh
+    if [ -f "${ferpaths_dir}/ferret_paths.csh" ]; then
+        if mv -f "${ferpaths_dir}/ferret_paths.csh" "${ferpaths_dir}/ferret_paths.csh.old"; then
+            echo " "
+            echo " Renamed existing ${ferpaths_dir}/ferret_paths.csh "
+            echo "               to ${ferpaths_dir}/ferret_paths.csh.old "
+            write_log_message "Renamed existing ${ferpaths_dir}/ferret_paths.csh"
+            write_log_message "              to ${ferpaths_dir}/ferret_paths.csh.old"
+        fi
+    fi
+#   Create new ferret_paths.csh
+    if sed -e "/setenv FER_DIR/c\\
+setenv FER_DIR \"${fer_dir}\"" \
+           -e "/setenv FER_DSETS/c\\
+setenv FER_DSETS \"${fer_dsets}\"" \
+           "${fer_dir}/bin/ferret_paths_template.csh" \
+           > "${ferpaths_dir}/ferret_paths.csh" ; then
+        echo " "
+        echo " Created ${ferpaths_dir}/ferret_paths.csh "
+        write_log_message "Created ${ferpaths_dir}/ferret_paths.csh"
+    else
+        echo " "
+        echo " Unable to create ${ferpaths_dir}/ferret_paths.csh "
+        write_log_message "Unable to create ${ferpaths_dir}/ferret_paths.csh"
+    fi
+#   Check for existing ferret_paths.sh
+    if [ -f "${ferpaths_dir}/ferret_paths.sh" ]; then
+        if mv -f "${ferpaths_dir}/ferret_paths.sh" "${ferpaths_dir}/ferret_paths.sh.old"; then
+            echo " "
+            echo " Renamed existing ${ferpaths_dir}/ferret_paths.sh "
+            echo "               to ${ferpaths_dir}/ferret_paths.sh.old "
+            write_log_message "Renamed existing ${ferpaths_dir}/ferret_paths.sh"
+            write_log_message "              to ${ferpaths_dir}/ferret_paths.sh.old"
+        fi
+    fi
+#   Create new ferret_paths.sh
+    if sed -e "/export FER_DIR=/c\\
+export FER_DIR=\"${fer_dir}\"" \
+           -e "/export FER_DSETS=/c\\
+export FER_DSETS=\"${fer_dsets}\"" \
+           "${fer_dir}/bin/ferret_paths_template.sh" \
+           > "${ferpaths_dir}/ferret_paths.sh" ; then
+        echo " "
+        echo " Created ${ferpaths_dir}/ferret_paths.sh "
+        write_log_message "Created ${ferpaths_dir}/ferret_paths.sh"
+    else
+        echo " "
+        echo " Unable to create ${ferpaths_dir}/ferret_paths.sh"
+        write_log_message "Unable to create ${ferpaths_dir}/ferret_paths.sh"
+    fi
+#   Check for existing ferret_paths
+    if [ -f "${ferpaths_dir}/ferret_paths" ]; then
+        if mv -f "${ferpaths_dir}/ferret_paths" "${ferpaths_dir}/ferret_paths.old"; then
+            echo " "
+            echo " Renamed existing ${ferpaths_dir}/ferret_paths "
+            echo "               to ${ferpaths_dir}/ferret_paths.old "
+            write_log_message "Renamed existing ${ferpaths_dir}/ferret_paths"
+            write_log_message "              to ${ferpaths_dir}/ferret_paths.old"
+        fi
+    fi
+#   Link ferret_paths to the appropriate file
+    if [ -n "${ferpaths_link}" ]; then
+        if ( cd "${ferpaths_dir}" ; ln -s "${ferpaths_link}" "ferret_paths" ) ; then
+            echo " "
+            echo " Created ${ferpaths_dir}/ferret_paths "
+            echo "     as a link to ${ferpaths_link} "
+            write_log_message "Created ${ferpaths_dir}/ferret_paths"
+            write_log_message "    as a link to ${ferpaths_link}"
+        else
+            echo " "
+            echo " Unable to create ${ferpaths_dir}/ferret_paths "
+            write_log_message "Unable to create ${ferpaths_dir}/ferret_paths"
+        fi
+    fi
+#   Check for existing pyferret.csh
+    if [ -f "${fer_dir}/bin/pyferret.csh" ]; then
+        if mv -f "${fer_dir}/bin/pyferret.csh" "${fer_dir}/bin/pyferret.csh.old"; then
+            echo " "
+            echo " Renamed existing ${fer_dir}/bin/pyferret.csh "
+            echo "               to ${fer_dir}/bin/pyferret.csh.old "
+            write_log_message "Renamed existing ${fer_dir}/bin/pyferret.csh"
+            write_log_message "              to ${fer_dir}/bin/pyferret.csh.old"
+        fi
+    fi
+#   Create new pyferret.csh
+    if sed -e "/set python_exe = /c\\
+set python_exe = \"${python_executable}\"" \
+           -e "/set python_subdir = /c\\
+set python_subdir = \"${python_subdirectory}\"" \
+           "${fer_dir}/bin/pyferret_template.csh" \
+           > "${fer_dir}/bin/pyferret.csh" ; then
+        chmod +x "${fer_dir}/bin/pyferret.csh"
+        echo " "
+        echo " Created executable script ${fer_dir}/bin/pyferret.csh "
+        write_log_message "Created executable script ${fer_dir}/bin/pyferret.csh"
+    else
+        echo " "
+        echo " Unable to create ${fer_dir}/bin/pyferret.csh "
+        write_log_message "Unable to create ${fer_dir}/bin/pyferret.csh"
+    fi
+#   Check for existing pyferret.sh
+    if [ -f "${fer_dir}/bin/pyferret.sh" ]; then
+        if mv -f "${fer_dir}/bin/pyferret.sh" "${fer_dir}/bin/pyferret.sh.old"; then
+            echo " "
+            echo " Renamed existing ${fer_dir}/bin/pyferret.sh "
+            echo "               to ${fer_dir}/bin/pyferret.sh.old "
+            write_log_message "Renamed existing ${fer_dir}/bin/pyferret.sh"
+            write_log_message "              to ${fer_dir}/bin/pyferret.sh.old"
+        fi
+    fi
+#   Create new pyferret.sh
+    if sed -e "/python_exe=/c\\
+python_exe=\"${python_executable}\"" \
+           -e "/python_subdir=/c\\
+python_subdir=\"${python_subdirectory}\"" \
+           "${fer_dir}/bin/pyferret_template.sh" \
+           > "${fer_dir}/bin/pyferret.sh" ; then
+        chmod +x "${fer_dir}/bin/pyferret.sh"
+        echo " "
+        echo " Created executable script ${fer_dir}/bin/pyferret.sh "
+        write_log_message "Created executable script ${fer_dir}/bin/pyferret.sh"
+    else
+        echo " "
+        echo " Unable to create ${fer_dir}/bin/pyferret.sh"
+        write_log_message "Unable to create ${fer_dir}/bin/pyferret.sh"
+    fi
+#   Check for existing pyferret
+    if [ -f "${fer_dir}/bin/pyferret" ]; then
+        if mv -f "${fer_dir}/bin/pyferret" "${fer_dir}/bin/pyferret.old"; then
+            echo " "
+            echo " Renamed existing ${fer_dir}/bin/pyferret "
+            echo "               to ${fer_dir}/bin/pyferret.old "
+            write_log_message "Renamed existing ${fer_dir}/bin/pyferret"
+            write_log_message "              to ${fer_dir}/bin/pyferret.old"
+        fi
+    fi
+#   Link pyferret to pyferret.sh, regardless of user's shell, 
+#   since it is run as an executable script
+    if ( cd "${fer_dir}/bin" ; ln -s "pyferret.sh" "pyferret" ) ; then
+        echo " "
+        echo " Created executable script ${fer_dir}/bin/pyferret "
+        write_log_message "Created executable script ${fer_dir}/bin/pyferret "
+    else
+        echo " "
+        echo " Unable to create executable script ${fer_dir}/bin/pyferret "
+        write_log_message "Unable to create executable script ${fer_dir}/bin/pyferret "
+    fi
+}
+
+
+### Assign $ferexec_dir, the directory containing the fer_executables.tar.gz file
+get_ferexec_dir() {
+    until [ 0 = 1 ]; do
+        echo " "
+        echo " Enter the name of the directory containing the "
+        echo " 'fer_executables.tar.gz file. "
+        read -p " 'fer_executables.tar.gz' location --> " ferexec_dir
+        if [ ! -d "${ferexec_dir}" ]; then
+            echo " '${ferexec_dir}' is not a directory"
+        else
+#           resolve relative pathnames
+            ferexec_dir=`cd "${ferexec_dir}" ; pwd`
+            if [ ! -f "${ferexec_dir}/fer_executables.tar.gz" ]; then
+                echo " 'fer_executables.tar.gz' is not in ${ferexec_dir}"
+            else
+                return 0
+            fi
+        fi
+    done
+#   should not get here - return error
+    return 1
+}
+
+
+### Install the contents of $ferexec_dir/fer_executables.tar.gz into $fer_dir
+install_execs() {
+    write_log_message "Installing/updating from ${ferexec_dir}/fer_executables.tar.gz"
+
+#   Get the list of files in the tar file
+    exetar_files=`tar tzf ${ferexec_dir}/fer_executables.tar.gz`
+    if [ -z "${exetar_files}" ]; then
+#        tar should have already printed a more appropriate error message
+         echo " No files found in ${ferexec_dir}/fer_executables.tar.gz "
+         write_log_message "No files found in ${ferexec_dir}/fer_executables.tar.gz"
+         return 1
+    fi
+
+#   Make sure the tar file is the right format
+    lib_files=`tar tzf ${ferexec_dir}/fer_executables.tar.gz lib`
+    if [ -z "${lib_files}" ]; then
+         echo " Aborting - old style fer_executables.tar.gz "
+         write_log_message "Aborting - old style fer_executables.tar.gz"
+         return 1
+    fi
+
+#   Rename old files if they exist
+    echo " Renaming (by appending '.old') any existing files in ${fer_dir} "
+    echo "     that will be replaced by files in ${ferexec_dir}/fer_executables.tar.gz "
+    for exefile in ${exetar_files} ; do
+        if [ -f "${fer_dir}/${exefile}" ]; then
+            if mv -f "${fer_dir}/${exefile}" "${fer_dir}/${exefile}.old" ; then
+                write_log_message "Renamed existing ${exefile} to ${exefile}.old"
+            else
+                echo " Aborting - unable to rename ${fer_dir}/${exefile} "
+                write_log_message "Aborting - unable to rename ${exefile}"
+                return 1
+            fi
+        fi
+    done
+
+#   Extract the files into $fer_dir
+    echo " Extracting files from ${ferexec_dir}/fer_executables.tar.gz "
+    echo "                    to ${fer_dir} "
+    if ( cd "${fer_dir}" ; tar xzf "${ferexec_dir}/fer_executables.tar.gz" ) ; then
+        for exefile in ${exetar_files} ; do
+            write_log_message "Extracted ${exefile}"
+        done
+    else
+        return 1
+    fi
+}
+
+
+### Main script
+### Info message printed only once
+echo " "
+echo " This script can do two things for you to help install Ferret: "
+echo " "
+echo " (1) Install the Ferret executables into FER_DIR/bin from the "
+echo "     fer_executables.tar.gz file."
+echo " "
+echo "     You will want to run this option if you are installing "
+echo "     Ferret for the first time or if you are updating Ferret "
+echo "     with new executables."
+echo " "
+echo " (2) Modify the shell scripts 'ferret_paths_template.csh' and "
+echo "     'ferret_paths_template.sh' to set environment variables "
+echo "     FER_DIR and FER_DSETS to the directories at your site "
+echo "     containing the Ferret software and demonstration data. "
+echo " "
+echo "     The files 'ferret_paths.csh' and 'ferret_paths.sh' are "
+echo "     created in a directory you choose.  Furthermore, the link "
+echo "     (shortcut) 'ferret_paths' can be created which refers to "
+echo "     either 'ferret_paths.csh' or 'ferret_paths.sh'. "
+echo " "
+echo "     Sourcing one of these files ('source ferret_paths.csh' "
+echo "     for csh or tcsh, '. ferret_paths.sh' for bash, sh ksh, "
+echo "     or dash) will set up a user's environment for running "
+echo "     ferret. "
+echo " "
+echo "     This also creates the executable shell scripts "
+echo "     'pyferret.csh' and 'pyferret.sh'. "
+echo " "
+echo "     You will want to run this option if you are installing "
+echo "     Ferret for the first time or if you relocated where "
+echo "     Ferret is installed. "
+echo " "
+
+### Print menu and act on choice
+until [ 0 = 1 ]; do
+    echo " "
+    echo " Enter your choice:"
+    echo " (1) Install executables, (2) Customize ferret_paths files, (3,q,x) Exit"
+    read -p " (1, 2, 3, q, x) --> " choice
+    case "$choice" in
+        1)
+            echo " "
+            echo " Install executables..."
+            if get_fer_dir && get_ferexec_dir; then
+                if ! install_execs; then
+                    echo " "
+                    echo " There is a problem manipulating files in "
+                    echo " "$fer_dir" "
+                    echo " Check your privileges to change files in that directory "
+                    echo " and try again. "
+                fi
+            fi
+            ;;
+        2)
+            echo " "
+            echo " Customize ferret_paths files..."
+            if get_fer_dir && get_fer_dsets && get_ferpaths_dir && \
+               get_ferpaths_link && get_python_vars; then
+                create_ferret_paths_and_pyferret
+            else
+                echo " "
+                echo " ferret_paths files NOT created "
+            fi
+            ;;
+        3 | 'q' | 'Q' | 'x' | 'X')
+            exit 0
+            ;;
+        *)
+            ;;
+    esac
+done
+# should not get here - return error
+exit 1
+
diff --git a/bin/Fpalette b/bin/Fpalette
new file mode 100755
index 0000000..010bea7
--- /dev/null
+++ b/bin/Fpalette
@@ -0,0 +1,79 @@
+#! /bin/sh
+# Fpalette file_template    
+# determine if FERRET palette files matching template are currently on-line
+# by searching the paths in FER_PALETTE
+
+print_usage() {
+   echo " "
+   echo "Usage:"
+   echo "    Fpalette [ -help | -d | -l | -more ]  palette_file_template"
+   echo  " "
+   echo "where options include: "
+   echo "    -help    print this help message and exit"
+   echo "    -d       generate filename list with descriptions (default)"
+   echo "    -l       generate long listing without descriptions"
+   echo "    -more    display files matching the given template using more"
+   echo " "
+   echo "These options precede the file template.  Files matching the"
+   echo "given template are then listed, or displayed using more if"
+   echo "the -more option is used.  All options are mutually exclusive."
+   echo "To see all of the Palette files available, enter:"
+   echo "    Fpalette '*'"
+   echo "It is important to have the quotes around any asterisks"
+   echo "in the file template."
+   echo " " 
+}
+
+#check for proper amount of args.  One arg is the filename or template. 
+if [ $# -lt 1 ] || [ $# -gt 2 ]; then
+   print_usage
+   exit 1
+fi
+
+# check for help flag
+if echo "$1" | grep -q '^-h' ; then
+   print_usage
+   exit 1
+fi
+
+if [ $# -eq 1 ]; then
+   option=""
+   template="$1"
+else
+   option="$1"
+   template="$2"
+fi
+
+# check to see if file contains .spk
+if ! echo "${template}" | grep -q '\.spk' ; then
+   template="${template}*.spk"
+fi
+
+found=0
+for subdir in ${FER_PALETTE}; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"${template}"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      if [ -z "${option}" ] || [ "${option}" = "-d" ]; then
+         for palfile in ${filelist} ; do
+            descript=`cd ${subdir} ; grep -i ' description: ' ${palfile} | sed -e 's/\! [dD][eE][sS][cC][rR][iI][pP][tT][iI][oO][nN]: //'`
+            echo "${palfile}: ${descript}"
+         done
+      elif [ "${option}" = "-l" ]; then
+         ( cd "${subdir}" ; /bin/ls -l ${filelist} )
+      elif [ "${option}" = "-m" ] || [ "${option}" = "-more" ]; then
+         ( cd "${subdir}" ; more ${filelist} )
+      else
+         echo "Invalid option: ${option}"
+         print_usage
+         exit 1
+      fi
+      echo " " 
+      found=1
+   fi
+done
+
+if [ $found -eq 0 ]; then
+   echo "No files matching ${template} were found"
+fi
+
diff --git a/bin/Fpattern b/bin/Fpattern
new file mode 100755
index 0000000..8543ca0
--- /dev/null
+++ b/bin/Fpattern
@@ -0,0 +1,79 @@
+#! /bin/sh
+# Fpattern file_template    
+# determine if FERRET pattern files matching template are currently on-line
+# by searching the paths in FER_PALETTE
+
+print_usage() {
+   echo " "
+   echo "Usage:"
+   echo "    Fpattern [ -help | -d | -l | -more ]  pattern_file_template"
+   echo  " "
+   echo "where options include: "
+   echo "    -help    print this help message and exit"
+   echo "    -d       generate filename list with descriptions (default)"
+   echo "    -l       generate long listing without descriptions"
+   echo "    -more    display files matching the given template using more"
+   echo " "
+   echo "These options precede the file template.  Files matching the"
+   echo "given template are then listed, or displayed using more if"
+   echo "the -more option is used.  All options are mutually exclusive."
+   echo "To see all of the Pattern files available, enter:"
+   echo "    Fpattern '*'"
+   echo "It is important to have the quotes around any asterisks"
+   echo "in the file template."
+   echo " " 
+}
+
+#check for proper amount of args.  One arg is the filename or template. 
+if [ $# -lt 1 ] || [ $# -gt 2 ]; then
+   print_usage
+   exit 1
+fi
+
+# check for help flag
+if echo "$1" | grep -q '^-h' ; then
+   print_usage
+   exit 1
+fi
+
+if [ $# -eq 1 ]; then
+   option=""
+   template="$1"
+else
+   option="$1"
+   template="$2"
+fi
+
+# check to see if file contains .pat
+if ! echo "${template}" | grep -q '\.pat' ; then
+   template="${template}*.pat"
+fi
+
+found=0
+for subdir in ${FER_PALETTE}; do
+   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"${template}"\* -print`
+   if [ -n "${filelist}" ]; then
+      echo "* * * * * * * * in ${subdir}"
+      if [ -z "${option}" ] || [ "${option}" = "-d" ]; then
+         for patfile in ${filelist} ; do
+            descript=`cd ${subdir} ; grep -i ' description: ' ${patfile} | sed -e 's/\! [dD][eE][sS][cC][rR][iI][pP][tT][iI][oO][nN]: //'`
+            echo "${patfile}: ${descript}"
+         done
+      elif [ "${option}" = "-l" ]; then
+         ( cd "${subdir}" ; /bin/ls -l ${filelist} )
+      elif [ "${option}" = "-m" ] || [ "${option}" = "-more" ]; then
+         ( cd "${subdir}" ; more ${filelist} )
+      else
+         echo "Invalid option: ${option}"
+         print_usage
+         exit 1
+      fi
+      echo " " 
+      found=1
+   fi
+done
+
+if [ $found -eq 0 ]; then
+   echo "No files matching ${template} were found"
+fi
+
diff --git a/bin/Fprint_template b/bin/Fprint_template
new file mode 100755
index 0000000..4f46a64
--- /dev/null
+++ b/bin/Fprint_template
@@ -0,0 +1,297 @@
+#! /bin/sh
+# Fprint
+# Script to translate metafiles generated by Ferret.  It runs either gksm2ps
+# (on systems where Ferret uses xgks -- releases after Mar 1994), or mtt;
+# please see the documentation on those.  It is intended to simplify sending
+# plots to printers, to an output file only, or to a workstation screen.  This
+# version translates to PostScript or Xwindow output.
+#
+# The script should work without modification to send output to the default
+# printer at your site (whichever is specified in $PRINTER).
+#
+# The default behavior of this script is to translate metafiles to color PS (or
+# grayscale) using line types appropriate for a monochrome PS printer.
+#
+# BUT the script should be modified to include the printers at your site.
+# The section "MODIFY HERE" below contains case statements.  Each case is
+# intended to be the name of a printer at your site, and the options set
+# for that case determines the default action taken by the metafile translator.
+# For example, whether lines are rendered in color or b&w.  The printers named
+# in this template illustrate the use for supported device types.
+#
+# Examples of use:
+#
+# "Fprint metafile.plt" translates and prints 'metafile.plt' on $PRINTER
+# "Fprint -P COLOR_PS metafile.plt" sends the plot to printer COLOR_PS
+# "Fprint -o my_plot.ps metafile.plt" writes to a PS file named 'my_plot.ps'
+# "Fprint -X metafile.plt" renders on the workstation screen.
+#
+# If you have questions please send email to davison at pmel.noaa.gov
+
+# 12.15.94 Due to a bug in the DEC OSF lpr command, use of the -s (symbolic
+# link, ie, don't copy the file -- used with large files) with the -r option
+# (remove file after printing) cannot be done.  The file is deleted before it
+# printed.  Consequently for OSF machines, I have dropped the use of the -r
+# option and the print files will accumulate.
+
+print_usage() {
+   if [ -n "$err_txt" ]; then
+      echo " "
+      echo "ERROR: You made a syntax error near $err_txt"
+      echo " "
+   fi
+   echo "Script to translate Ferret's graphics metafile(s) to PostScript"
+   echo "usage: Fprint [-P printer || -o file_name || -X]"
+   echo "              [-p landscape || portrait] [-# <number of copies>]"
+   echo "              [-l ps || cps] [-R] metafile(s)"
+   echo " "
+   echo "   -P: send PostScript output to the named printer"
+   echo "   -o: send PostScript output to a file and don't print the plots"
+   echo "   -X: send the plots to your X Window for preview"
+   echo "   -p: page orientation, landscape or portrait"
+   echo "   -#: print more than one copy of the plots"
+   echo "   -l: line styles, ps = monochrome, cps = color"
+   echo "   -R: do not rename files with a date stamp appended (default is to stamp)"
+   echo "   -C: Output a CMYK postscript file (default is RGB)"
+   echo "Examples: "
+   echo "    Fprint metafile.plt*"
+   echo "    Fprint -P our_color_printer -l cps -# 10 metafile.plt*"
+   echo "    Fprint -p portrait -R metafile.plt.~2~"
+}
+
+if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
+   print_usage
+   exit
+fi
+
+touch Fprint_output0.ps
+rm -f Fprint_output*.ps
+
+output_args=" "
+output="printer"
+printer_named=0
+translator_args="-l cps -d cps"
+
+gksm2ps_files=""
+mtt_files=""
+got_gksm2ps_files=0
+got_mtt_files=0
+
+REMOVE="-r"
+
+# Pick off arguments til the end of the arguments
+while [ $# != 0 ]; do
+   case "$1" in
+#     Send output to named printer
+      "-P")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-P $1"
+            print_usage
+            exit 1
+         fi
+         output_args="$output_args -P$1"
+         output="printer"
+         fprinter=$1
+         printer_named=1
+         shift
+         ;;
+#     Output is to be directed to plot file and not printed
+      "-o")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-o $1"
+            print_usage
+            exit 1
+         fi
+         translator_args="$translator_args -o $1"
+         output="file"
+         shift
+         ;;
+#     Output is to be directed to Xwindow
+      "-X")
+         shift
+         translator_args=""
+         output="Xwindow"
+         ;;
+#     Print N copies
+      "-#")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-# $1"
+            print_usage
+            exit 1
+         fi
+         output_args="$output_args -#$1"
+         shift
+         ;;
+#     Page orientation: landscape or portrait
+      "-p")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-p $1"
+            print_usage
+            exit 1
+         fi
+         if [ "$1" != "landscape" ] && [ "$1" != "portrait" ]; then
+            err_txt="-p $1"
+            print_usage
+            exit 1
+         fi
+         translator_args="$translator_args -p $1"
+         shift
+         ;;
+#     Line color: cps (color) or ps (b&w)
+      "-l")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-l $1"
+            print_usage
+            exit 1
+         fi
+         if [ "$1" != "cps" ] && [ "$1" != "ps" ]; then
+            err_txt="-l $1"
+            print_usage
+            exit 1
+         fi
+         translator_args="$translator_args -l $1"
+         shift
+         ;;
+#     Supported devices: cps (color PostScript) or phaser (TEK phaser ps)
+      "-d")
+         shift
+         val=`echo $1 | cut -c1`
+         if [ "$val" = "-" ]; then
+            err_txt="-d $1"
+            print_usage
+            exit 1
+         fi
+         if [ "$1" != "cps" ] && [ "$1" != "phaser" ]; then
+            err_txt="-d $1"
+            print_usage
+            exit 1
+         fi
+         translator_args="$translator_args -d $1"
+         shift
+         ;;
+#     Don't append to metafiles with date stamp when translation is complete
+      "-R")
+         translator_args="$translator_args -R"
+         shift
+         ;;
+#     Use CMYK color model
+      "-C")
+         translator_args="$translator_args -C"
+         shift
+         ;;
+#     Everything else is passed to translator -- gotta be a file
+      *)
+         if [ ! -f $1 ]; then
+            echo " "
+            echo "ERROR: $1 is not a file name"
+            echo " "
+            print_usage
+            exit 1
+         fi
+         if head -n 1 $1 | grep -q "^GKSM" ; then
+            gksm2ps_files="$gksm2ps_files $1"
+            got_gksm2ps_files=1
+         else
+            mtt_files="$mtt_files $1"
+            got_mtt_files=1
+         fi
+         shift
+         ;;
+   esac
+done
+
+if [ "$output" = "printer" ] && [ $printer_named -ne 0 ]; then
+
+############################ MODIFY HERE ###################################
+
+#    Now set device characteristics for named printers
+   case "$fprinter" in
+#     If the printer is a color PS printer, use that device type
+      "COLOR_PS")
+         translator_args="$translator_args -l cps -d cps"
+         ;;
+#     BUT If the printer is a PHASER PX with transfer sheets, type is "phaser"
+      "PHASER_PX_TRANSFER")
+         translator_args="$translator_args -l cps -d phaser"
+         ;;
+#     The following example printers take the default options mentioned above.
+      "MONOCHROME_PS1")
+         ;;
+      "MONOCHROME_PS2")
+         ;;
+      "MONOCHROME_PS3")
+         ;;
+#     The named printer is not a valid choice
+      *)
+#        This is the sort of message I anticipate the user getting
+#        if one names an unsupported printer:
+#
+#        echo -n "'${fprinter}' is not a valid printer."
+#        if [ -n "$PRINTER" ]; then
+#           echo " The default printer is $PRINTER."
+#        else
+#           echo " "
+#        endif
+#        echo " Available printers are COLOR_PS, PHASER_PX_TRANSFER,"
+#        echo " MONOCHROME_PS1, MONOCHROME_PS2, and MONOCHROME_PS3"
+#
+#        For now a user gets this message:
+         echo " "
+         echo " The Fprint script has not been set up to use the -P option"
+         echo " yet -- it should work with the default printer."
+         echo " "
+         exit
+   esac
+
+##################### END OF "MODIFY HERE" SECTION ##########################
+
+fi
+
+# Now process the metafile(s) and print the plot file if appropriate
+if [ `uname -s` = "OSF1" ]; then
+   REMOVE=""
+fi
+case $output in
+   "printer")
+      if [ $got_gksm2ps_files -ne 0 ]; then
+         gksm2ps -o Fprint_output1$$.ps $translator_args $gksm2ps_files
+         if [ -f Fprint_output1$$.ps ]; then
+            lpr -s ${REMOVE} $output_args ./Fprint_output1$$.ps
+         fi
+      fi
+
+      if [ $got_mtt_files -ne 0 ]; then
+         mtt -o Fprint_output2$$.ps $translator_args $mtt_files
+         if [ -f Fprint_output2$$.ps ]; then
+            lpr -s ${REMOVE} $output_args ./Fprint_output2$$.ps
+         fi
+      fi
+      ;;
+   "file")
+      if [ $got_gksm2ps_files -ne 0 ]; then
+         gksm2ps $translator_args $gksm2ps_files
+      fi
+      if [ $got_mtt_files -ne 0 ]; then
+         mtt $translator_args $mtt_files
+      fi
+      ;;
+   "Xwindow")
+      if [ $got_gksm2ps_files -ne 0 ]; then
+         gksm2ps -X $gksm2ps_files
+      fi
+      if [ $got_mtt_files -ne 0 ]; then
+         mtt $mtt_files
+      fi
+      ;;
+esac
+
diff --git a/bin/Fpurge b/bin/Fpurge
new file mode 100755
index 0000000..ed7ff67
--- /dev/null
+++ b/bin/Fpurge
@@ -0,0 +1,15 @@
+#! /bin/sh
+# Fpurge
+# remove all but the current version of the indicated file(s)
+
+# example usage:  Fpurge metafile.plt
+
+# no argument given: explain the ropes
+if [ $# -ne "1" ]; then
+     echo '*** Syntax error - name 1 filename as template, only ***'
+     echo '  Usage:  Fpurge  filename.extension'
+     echo 'Example:  Fpurge ferret.jnl'
+     exit
+fi
+
+rm "$1".~*~
diff --git a/bin/FshowGO b/bin/FshowGO
new file mode 100755
index 0000000..1157fb2
--- /dev/null
+++ b/bin/FshowGO
@@ -0,0 +1,19 @@
+#! /bin/sh
+# FshowGo
+# Search for Enter_GO and Exit_GO lines in a log from a Ferret script
+# Format them indenting to show the nesting of calls.
+# 
+# Ferret writes Enter_GO and Exit_GO to Std Output if SET REDIRECT has been turned on.
+#
+# example 
+# > ferret
+#
+# yes? set redirect/tee/clobber/file=mylog.out
+# yes? go myscript.jnl
+# yes? exit
+# 
+# > FshowGo mylog.out
+#
+
+gawk '/Enter_GO/ {FS=" "; count++; x=0; while(++x<=count){printf "  "};printf "GO ";{for(i=3;i<=NF;i++) printf "%s ",$i };printf "\n"} /Exit_GO/ {count--}' $*
+
diff --git a/bin/Fsort b/bin/Fsort
new file mode 100755
index 0000000..008a5ec
--- /dev/null
+++ b/bin/Fsort
@@ -0,0 +1,17 @@
+#! /bin/sh
+# sort a list of names given as arguments into increasing
+# order based on their ~nnn~ version number extensions
+# at most one name should be without ~nnn~
+
+# example usage:  Fsort metafile.plt*
+# example in context:	animate `Fsort metafile.plt*`
+# ... or in a more complex example
+#	animate start_frame `Fsort series1.plt*` `Fsort series2.plt*` end_frame
+
+echo "$*" | awk -f $FER_DIR/bin/Fsort.nawk
+
+# Note:
+# Here is an alternative version that uses sort for the "tilda" filenames
+# and sed to put the filename with no tilda version number at the end:
+# ls !* | sort -t\~ +1n | sed -e '/\~/\!h' -e '/\~/\!d' -e '$p' -e '$x'
+
diff --git a/bin/Fsort.nawk b/bin/Fsort.nawk
new file mode 100644
index 0000000..327c681
--- /dev/null
+++ b/bin/Fsort.nawk
@@ -0,0 +1,36 @@
+# Fsort.nawk
+# nawk routine to sort files with ~nnn~ endings into increasing order
+# this routine presumes that all files except at most 1 will have
+# the ~nnn~ ending
+# input should be a list of names - all on a single record
+# output will be similar
+
+# syntax:  nawk -f Fsort.awk
+# example: echo metafile.plt* | nawk -f Fsort.awk
+
+BEGIN     { maxnum = 0 }
+
+# save the names in an array "name" indexed by the nn value in ~nn~
+# save the single name without ~nn~ as index 0
+     { for ( i=1; i<=NF; i++ )
+	{ {pos = match($i,/~[0-9]*~/)}
+	   { if (pos==0)
+	        { name[0] = $i }
+	     else
+	        { num = substr($i,pos+1,RLENGTH-2)
+                  if (num>maxnum) {maxnum = num}
+	          name[num] = $i }
+	   }
+	}
+     }
+
+
+# spit the names back out in order - name lacking ~nnn~ last
+# skip missing names
+END     {
+	 for (i=1; i<=maxnum; i++)
+	   { if (length(name[i]) != 0 ) {printf "%s ",name[i]} }
+	 if (length(name[0]) != 0 ) {printf "%s ",name[0]}
+	 printf "\n"
+	}
+
diff --git a/bin/build_fonts/README b/bin/build_fonts/README
new file mode 100644
index 0000000..bc1b616
--- /dev/null
+++ b/bin/build_fonts/README
@@ -0,0 +1,27 @@
+README file for the directory build_fonts
+
+Ansley Manke 1/21/2009.
+
+These are the files needed to build the Ferret fonts. 
+They were copied from 
+/home/porter2/davison/ppld/f1_2/source/fonts
+
+In that directory were subdirectories /vms  and /unix.
+These directories are saved under /original, and the 
+/unix directory is modified for simplicity and completeness,
+renaming the input files to in_fnt01a.chr, ... and changing 
+the Makefile so it directly makes the binary font files with
+the names that Ferret expects to find.
+
+Also added clean and install targets.
+
+If the environmnent variable PLOTFONTS is defined, then the 
+install target installs the files where Ferret will find them.
+
+   make		  Builds and run the program to write the binary font files
+
+   make install	  Copies the files to the directory indicated by PLOTFONTS
+
+   make clean     Removes the executable and the binary font files.
+
+
diff --git a/bin/build_fonts/unix/Makefile b/bin/build_fonts/unix/Makefile
new file mode 100644
index 0000000..23e620a
--- /dev/null
+++ b/bin/build_fonts/unix/Makefile
@@ -0,0 +1,89 @@
+#    Makefile for the fonts
+#  1/2009 Ansley Manke From Jerry Davison's files
+#
+#    builds and runs the executable to write the
+#    binary character and symbol font files. 
+#    Just use long lists of files.
+#    Expects environment variables F77 and PLOTFONTS to be defined.
+#    No need for any compiler flags.
+
+include ../../../site_specific.mk
+include ../../../platform_specific.mk.$(BUILDTYPE)
+
+all:    binary 
+
+binary:	binary.F
+	$(F77) $(FFLAGS) -o binary binary.F
+	./binary   in_fnt01a.chr  fnt01.chr
+	./binary   in_fnt02a.chr  fnt02.chr
+	./binary   in_fnt03a.chr  fnt03.chr
+	./binary   in_fnt04a.chr  fnt04.chr
+	./binary   in_fnt05a.chr  fnt05.chr
+	./binary   in_fnt06a.chr  fnt06.chr
+	./binary   in_fnt07a.chr  fnt07.chr
+	./binary   in_fnt08a.chr  fnt08.chr
+	./binary   in_fnt09a.chr  fnt09.chr
+	./binary   in_fnt10a.chr  fnt10.chr
+	./binary   in_fnt11a.chr  fnt11.chr
+	./binary   in_fnt12a.chr  fnt12.chr
+	./binary   in_fnt13a.chr  fnt13.chr
+	./binary   in_fnt14a.chr  fnt14.chr
+	./binary   in_fnt15a.chr  fnt15.chr
+	./binary   in_fnt16a.chr  fnt16.chr
+	./binary   in_fnt17a.chr  fnt17.chr
+	./binary   in_fnt18a.chr  fnt18.chr
+	./binary   in_fnt19a.chr  fnt19.chr
+	./binary   in_fnt20a.sym  fnt20.sym
+	./binary   in_fnt21a.sym  fnt21.sym
+	./binary   in_fnt22a.sym  fnt22.sym
+	./binary   in_fnt23a.sym  fnt23.sym
+	./binary   in_fnt24a.sym  fnt24.sym
+	./binary   in_fnt25a.sym  fnt25.sym
+	./binary   in_fnt26a.sym  fnt26.sym
+	./binary   in_fnt27a.sym  fnt27.sym
+	./binary   in_fnt28a.sym  fnt28.sym
+	./binary   in_fnt29a.sym  fnt29.sym
+	./binary   in_fnt30a.sym  fnt30.sym
+	./binary   in_fnt31a.chr  fnt31.chr
+	./binary   in_fnt32a.chr  fnt32.chr
+	./binary   in_fnt33a.sym  fnt33.sym
+
+install:
+	cp fnt01.chr $(PLOTFONTS)
+	cp fnt02.chr $(PLOTFONTS)
+	cp fnt03.chr $(PLOTFONTS)
+	cp fnt04.chr $(PLOTFONTS)
+	cp fnt05.chr $(PLOTFONTS)
+	cp fnt06.chr $(PLOTFONTS)
+	cp fnt07.chr $(PLOTFONTS)
+	cp fnt08.chr $(PLOTFONTS)
+	cp fnt09.chr $(PLOTFONTS)
+	cp fnt10.chr $(PLOTFONTS)
+	cp fnt11.chr $(PLOTFONTS)
+	cp fnt12.chr $(PLOTFONTS)
+	cp fnt13.chr $(PLOTFONTS)
+	cp fnt14.chr $(PLOTFONTS)
+	cp fnt15.chr $(PLOTFONTS)
+	cp fnt16.chr $(PLOTFONTS)
+	cp fnt17.chr $(PLOTFONTS)
+	cp fnt18.chr $(PLOTFONTS)
+	cp fnt19.chr $(PLOTFONTS)
+	cp fnt20.sym $(PLOTFONTS)
+	cp fnt21.sym $(PLOTFONTS)
+	cp fnt22.sym $(PLOTFONTS)
+	cp fnt23.sym $(PLOTFONTS)
+	cp fnt24.sym $(PLOTFONTS)
+	cp fnt25.sym $(PLOTFONTS)
+	cp fnt26.sym $(PLOTFONTS)
+	cp fnt27.sym $(PLOTFONTS)
+	cp fnt28.sym $(PLOTFONTS)
+	cp fnt29.sym $(PLOTFONTS)
+	cp fnt30.sym $(PLOTFONTS)
+	cp fnt31.chr $(PLOTFONTS)
+	cp fnt32.chr $(PLOTFONTS)
+	cp fnt33.sym $(PLOTFONTS)
+	cp fondat.dat $(PLOTFONTS)
+
+clean: 
+	rm -f binary fnt*.*
+
diff --git a/bin/build_fonts/unix/binary.F b/bin/build_fonts/unix/binary.F
new file mode 100644
index 0000000..8c188e2
--- /dev/null
+++ b/bin/build_fonts/unix/binary.F
@@ -0,0 +1,34 @@
+	program binary
+	character file*120
+	integer*2 ascii(128),icnt,ibase,irast,ilen
+c
+	integer*2 x(5000),y(5000)
+c
+	integer ij
+	call getarg(1,file)
+	open(1,file=file,status='old')
+	call getarg(2,file)
+	if(file.eq.' ')call exit(0)
+	open(2,file=file,status='new',form='unformatted')
+	read(1,987)icnt,ibase,irast
+987	format(1x,i2,2i4)
+	if(icnt.eq.99)then
+	read(1,985)(ascii(ij),ij=1,128)
+	ilen=ascii(128)
+	else
+	read(1,985)(ascii(ij),ij=1,icnt+1)
+	ilen=ascii(icnt+1)
+	do 1010 ij=icnt+1,128
+1010	ascii(ij)=1
+	endif
+985	format(1x,20i4)
+	read(1,984)(x(ij),ij=1,ilen)
+	read(1,984)(y(ij),ij=1,ilen)
+984	format(1x,40i2)
+	close(1)
+	write(2)icnt,ibase,irast,ilen
+	write(2)(ascii(ij),ij=1,127)
+	write(2)(x(ij),ij=1,ilen)
+	write(2)(y(ij),ij=1,ilen)
+	close(2)
+	end
diff --git a/bin/build_fonts/unix/fondat.dat b/bin/build_fonts/unix/fondat.dat
new file mode 100644
index 0000000..8d82d4c
--- /dev/null
+++ b/bin/build_fonts/unix/fondat.dat
@@ -0,0 +1,33 @@
+ 01SR 0 1133fnt01.chr  SIMPLEX ROMAN
+ 02DR 0 2470fnt02.chr  DUPLEX ROMAN
+ 03TR 0 3964fnt03.chr  TRIPLEX ROMAN
+ 04CR 0 2204fnt04.chr  COMPLEX ROMAN
+ 05CS 0 2694fnt05.chr  COMPLEX SCRIPT
+ 06TI 0 3829fnt06.chr  TRIPLEX ITALIC
+ 07GE 0 4457fnt07.chr  GOTHIC ENGLISH
+ 08IR 0 1948fnt08.chr  INDEXICAL COMPLEX ROMAN
+ 09SS 0 1451fnt09.chr  SIMPLEX SCRIPT
+ 10CI 0 1630fnt10.chr  COMPLEX ITALIC
+ 11II 0 1435fnt11.chr  INDEXICAL COMPLEX ITALIC
+ 12SG 0  798fnt12.chr  SIMPLEX GREEK
+ 13CG 0 1497fnt13.chr  COMPLEX GREEK
+ 14IG 0 1298fnt14.chr  INDEXICAL COMPLEX GREEK
+ 15GG 0 3541fnt15.chr  GOTHIC GERMAN
+ 16GI 0 2581fnt16.chr  GOTHIC ITALIAN
+ 17CC 0 2164fnt17.chr  COMPLEX CYRILLIC
+ 18AR 0  629fnt18.chr  CARTOGRAPHIC ROMAN
+ 19AG 0  275fnt19.chr  CARTOGRAPHIC GREEK
+ 20ZO 1 1011fnt20.sym  ZODIAC
+ 21MU 1 1146fnt21.sym  MUSIC
+ 22EL 1  376fnt22.sym  ELECTRICAL
+ 23WE 1  327fnt23.sym  WEATHER
+ 24MA 1 1901fnt24.sym  MATH
+ 25SM 1  728fnt25.sym  SIMPLEX MATH
+ 26MP 1  969fnt26.sym  MAP
+ 27LM 1  351fnt27.sym  LARGE MATH
+ 28IZ 1  400fnt28.sym  INDEXICAL ZODIAC
+ 29IM 1 1058fnt29.sym  INDEXICAL MATH
+ 30CA 1  258fnt30.sym  CARTOGRAPHIC
+ 31AS-1 1380fnt31.chr  ASCII SIMPLEX ROMAN
+ 32AC-1 2451fnt32.chr  ASCII COMPLEX ROMAN
+ 33PM 1  714fnt33.sym  PLOT MARKS
\ No newline at end of file
diff --git a/bin/build_fonts/unix/in_fnt01a.chr b/bin/build_fonts/unix/in_fnt01a.chr
new file mode 100644
index 0000000..57f7aa1
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt01a.chr
@@ -0,0 +1,66 @@
+ 99  -9  21 ;SIMPLEX ROMAN-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1 938 974 981 996   11098 9701028
+ 104010701056 8991052 8921024 719 738 744 760 777 785 804 829 836 867 909 9221080
+ 10631089 948   1   3  13  38  58  75  88  98 122 132 136 148 158 165 178 188 211
+  226 252 270 292 299 311 318 331 338 346   1   1   1   1   1   1 356 375 394 410
+  429 448 458 482 494 504 517 527 531 551 563 582 601 620 630 649 659 671 678 691
+  698 709   1   1   1   1   11133
+ 925091 09250 0 85095 5508993935093 2 5 6 7 7 6 5 25093 2 5 6 7 7 6 5 2935090 8 7
+  5 399979594939394959799 3 5 7 8508993935093 0 3 5 6 7 7 6 5 3 093509094945094 7
+ 5094 25094 7509094945094 75094 25090 8 7 5 399979594939394959799 3 5 7 8 850 3 8
+ 5089939350 7 75093 75096 0 05092 4 4 3 2 098969594945089939350 7935098 750909494
+ 5094 6508892925092 050 8 050 8 8508993935093 750 7 7508998969493929293949698 2 4
+  6 7 8 8 7 6 4 298508993935093 2 5 6 7 7 6 5 293508998969493929293949698 2 4 6 7
+  8 8 7 6 4 29850 1 7508993935093 2 5 6 7 7 6 5 29350 0 75090 7 5 298959393949597
+  3 5 6 7 7 5 29895935092 0 05093 750899393949699 1 4 6 7 7509192 050 8 050889095
+ 50 09550 0 55010 5509093 750 793509192 0 050 8 05090 7935093 75093 75091 6 650 6
+  4 29997959494959799 2 4 65090949450949698 1 3 5 6 6 5 3 19896945091 6 4 2999795
+ 9494959799 2 4 65091 6 650 6 4 29997959494959799 2 4 6509194 6 6 5 4 29997959494
+ 959799 2 4 65095 5 3 1 0 05097 45091 6 6 5 4 2999750 6 4 29997959494959799 2 4 6
+ 50919595509598 0 3 5 6 6509699 0 1 09950 0 05095 0 1 2 1 050 1 1 098965091959550
+  5955099 65096 0 050858989508992949799 0 050 0 3 5 810111150919595509598 0 3 5 6
+  650919997959494959799 2 4 6 7 7 6 4 2995090949450949698 1 3 5 6 6 5 3 198969450
+ 91 6 650 6 4 29997959494959799 2 4 650939797509798 0 2 55092 6 5 29996959698 3 5
+  6 6 5 29996955095 0 0 1 3 55097 4509195959698 1 3 650 6 6509294 050 6 050899296
+ 50 09650 0 450 8 4509295 650 695509294 050 6 0989694935092 6955095 65095 6509099
+ 96949393949699 1 4 6 7 7 6 4 19950909698 1 150909494959698 2 4 5 6 6 5 393 75090
+ 95 6 0 3 5 6 7 7 6 4 1989594935090 393 850 3 35090 595949598 1 4 6 7 7 6 4 19895
+ 94935090 6 5 2 0979594949597 0 1 4 6 7 7 6 4 1 09795945090 7975093 7509098959494
+ 9597 1 4 6 7 7 6 5 29895949393949699 3 5 6 6 5 2985090 6 5 3 09996949393949699 0
+  3 5 6 6 5 3 09895945095 099 0 1 05095 1 099 0 1 1 0995095 099 0 1 050 099 0 1 0
+ 5095 099 0 1 050 1 099 0 1 1 0995095 0 050 099 0 1 050919494959698 2 4 5 6 6 5 4
+  0 050 099 0 1 05096 0 05092969650 4 45093999796969799 1 3 4 4 3 1995090989850 2
+  250 7 5 298959393949597 3 5 6 7 7 5 29895935089 9915093 4 2 098979798 0 2 45093
+ 9698 0 2 3 3 2 09896508791 95087 0 05091 9508791 95091 95092 0 05095 550 5955095
+  1 09999 0 1 05095 099 0 1 1 09950871010 9 8 7 6 4 2 0989492919090919299 0 1 1 0
+ 989695959698 3 5 7 9101050
+  850 988 9 088 9 0 2 2501088 9 0888889909294969798 0989899 0 2 5 7 8 9 950119391
+ 89888889919396 1 4 6 8 9 9 8 6 4501088 9 0888889919396 1 4 6 8 9 950 988 9 08888
+  09898 0 9 950 888 9 08888 098985011939189888889919396 1 4 6 8 9 9 8 6 4 1 0 1 1
+ 501188 9 088 9 0989850 488 950 888 4 7 8 9 9 8 7 4 2501088 9 088 2 097 950 788 9
+  0 9 9501288 9 088 9 088 9 088 9501188 9 088 9 088 950118889919396 1 4 6 8 9 9 8
+  6 4 1969391898888501088 9 08888899092959798999950118889919396 1 4 6 8 9 9 8 6 4
+  1969391898888 0 511501088 9 088888990929496979898 098 9501091898888899193959697
+ 99 0 1 3 6 8 9 9 8 650 888 9 08888501188 3 6 8 9 9 8 6 38850 988 9 088 9501288 9
+  088 9 088 9 088 9501088 9 088 950 98898 9 08898501088 9 08888 0 9 9501095 9 098
+ 9695959698 1 3 6 8 9 9 8 650 988 9 0989695959698 1 3 6 8 9 9 8 650 9989695959698
+  1 3 6 8 9 9 8 6501088 9 0989695959698 1 3 6 8 9 9 8 650 9 1 199979695959698 1 3
+  6 8 9 9 8 650 788888992 9 09595501095111415161615 0989695959698 1 3 6 8 9 9 8 6
+ 501088 9 0999695959699 950 48889888788 095 950 58889888788 0951215161650 888 9 0
+ 95 5 0 1 950 488 9501595 9 0999695959699 9 0999695959699 9501095 9 0999695959699
+  95010959698 1 3 6 8 9 9 8 6 3 19896959550 99516 0989695959698 1 3 6 8 9 9 8 650
+ 109516 0989695959698 1 3 6 8 9 9 8 650 695 9 0 19896959550 9989695959698 0 1 2 3
+  5 6 8 9 9 8 650 788 5 8 9 9 09595501095 5 8 9 9 8 5 095 950 895 9 095 9501195 9
+  095 9 095 9 095 950 995 9 095 950 895 9 095 91315161650 995 9 09595 0 9 9501088
+ 899297 0 5 8 9 9 8 5 097928988885010929188 95010939290898888899092949699 9 95010
+ 888896969798 1 3 6 8 9 9 8 7 5501088 2 2 088 950108888979695959698 1 3 6 8 9 9 8
+  7 5501091898888899297 2 6 8 9 9 8 6 3 2999796969799 2501088 9 08888501088899193
+ 95969798 0 2 5 7 8 9 9 8 7 5 2 098979695939189888850109598 0 1 1 098959491898888
+ 899195 0 5 8 9 9 8 650 5 7 8 9 8 750 5 8 9 8 7 810121350 59596979695 0 7 8 9 8 7
+ 50 59596979695 0 8 9 8 7 810121350 588 2 0 7 8 9 8 750 9939290898888899092949697
+ 99 2 0 7 8 9 8 750 4889550 88895 0889550 78889919395969695939189888850108413 084
+ 13 09189888889919395969799 0 1 3 6 8 9 9 8 65011841650 78486899398 2 711141650 7
+ 8486899398 2 71114165013 0 0501391 9 0 0 050139797 0 3 350 894 6 097 3 097 350 5
+ 8889919394939250 5908988899193945013979695959698 3 6 8 9 9 8 7 5 3 1 09695939189
+ 888991939699 6 8 9 9 8 750
diff --git a/bin/build_fonts/unix/in_fnt02a.chr b/bin/build_fonts/unix/in_fnt02a.chr
new file mode 100644
index 0000000..d757aad
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt02a.chr
@@ -0,0 +1,132 @@
+ 99  -9  21 ;DUPLEX ROMAN-UPPER CASE                                    
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   12005241724402211   1213924052272
+ 22972322237119062362188922631468151115241559160816271681174417571826193119642089
+ 238821142030   1   3  24  69 108 141 169 191 236 259 268 289 312 327 354 375 416
+  444 493 528 572 588 613 628 655 672 690   1   1   1   1   1   1 711 748 785 818
+  855 892 917 966 992101710421065107411171143118012171254127613271344137013851412
+ 14291447   1   1   1   1   12470
+ 925090 09250 0939250 0 7 850 0 85095 55094 6509094945095955094 2 5 6 7 7 6 5 250
+ 95 2 5 6 6 5 25095 2 5 6 7 7 6 5 2945095 2 5 6 6 5 2955090 8 7 5 399979594939394
+ 959799 3 5 7 850 8 7 6 5 39997959494959799 3 5 6 7 8509094945095955094 1 4 6 7 8
+  8 7 6 4 1945095 1 4 5 6 7 7 6 5 4 195509195955096965095 75096 7 75096 2 25096 2
+ 5096 7 75095 750919595509696955095 75096 7 75096 2 25096 25090 8 7 5 39997959493
+ 9394959799 3 5 7 8 8 350 8 7 6 5 399979695949495969799 3 5 6 7 7 3 3508993935093
+ 94949350 7 6 6 750 7 75094 65094 65096 0 0 150 0 1 15092 4 4 3 19997969550 4 5 5
+  4 3 19997969550909494955094959550 8 79550 8955098 7 85099 850919595509596965096
+  7 75095 750889292509393925093 05092 050 8 050 7 050 7 7 850 8 85089939350949493
+ 5094 75093 650 6 650 6 7 7508998969493929293949698 2 4 6 7 8 8 7 6 4 29850999694
+ 9393949699 1 4 6 7 7 6 4 19950909494509595945094 3 5 6 7 7 6 5 3955095 3 5 6 6 5
+  395508998969493929293949698 2 4 6 7 8 8 7 6 4 298509996949393949699 1 4 6 7 7 6
+  4 19950 1 6 750 1 2 750909494509595945094 2 5 6 7 7 6 5 2955095 2 5 6 6 5 29550
+  0 6 750 1 75090 7 5 298959393949597 2 4 5 6 6 5 29896959350 7 5 4 2989594949597
+  2 4 6 7 7 5 29895935092 0 050 1 1 05094 7 7509494 750899393949699 1 4 6 7 75093
+ 9494959699 1 4 5 6 6 7509092 0509293 050 8 7 050 8 0508789955089909550 09550 095
+ 50 0 550 0 5501110 55011 5509093 6 7509394 750 7 69350 79493509193 0 0 1509394 1
+ 50 8 7 050 8 1 15090 69350 7945093 7509393 65094 7 75093 75090 5 5 650 5 6 650 5
+  3 19896949393949698 1 3 550 5 19896959494959698 1 550909494955094959550959799 2
+  4 6 7 7 6 4 2999795509599 2 4 5 6 6 5 4 299955091 6 4 29997959494959799 2 4 650
+  6 5 4 29997969595969799 2 4 5 65090 5 5 650 5 6 650 5 3 19896949393949698 1 3 5
+ 50 5 19896959494959698 1 5509195 6 6 5 4 29997959494959799 2 4 65095 5 5 4 29997
+ 969595969799 2 4 5 65094 5 3 1 0 0 150 5 5 3 150 2 1 15097 4 4509797 45090 6 5 5
+  4 3 19997969450 6 6 5 3 198969450 5 3 19896949393949698 1 3 550 5 1989695949495
+ 9698 1 5509094949550949595509598 0 3 5 6 6509598 0 2 4 5 5 65096 09999 0 1 2 2 1
+  050 0 0 1 1 050 0 0 150 0 1 15096 09999 0 1 2 2 1 050 0 0 1 1 050 0 0 150 0 1 1
+ 50909494955094959550 6 59550 6955098 4 65099 65096 0 0 150 0 1 15085898990508990
+ 905090939598 0 1 1509093959799 0 0 150 1 4 6 911121250 1 4 6 8101111125090949495
+ 50949595509598 0 3 5 6 6509598 0 2 4 5 5 650919997959494959799 2 4 6 7 7 6 4 299
+ 509997969595969799 2 4 5 6 6 5 4 29950909494955094959550959799 2 4 6 7 7 6 4 299
+ 9795509599 2 4 5 6 6 5 4 299955090 5 5 650 5 6 650 5 3 19896949393949698 1 3 550
+  5 19896959494959698 1 5509397979850979898509899 1 3 6509899 1 3 6 65092 6 5 299
+ 96959698 3 550 4 5 5 450 5 299965097969550 6 5 450 5 2999650979697509698 3 5 6 6
+  5 29996955095 0 0 150 0 1 15097 4 4509797 4509094949597 0 2 5509495959698 0 2 5
+ 50 5 5 650 5 6 6509294 0509495 050 6 5 050 6 0508891965091929650 09650 09650 0 4
+ 50 0 450 9 8 450 9 4509194 5 6509495 650 6 59450 69594509294 0509495 050 6 5 096
+ 50 6 097965091 49450 6965094 6509494 45096 6 65094 650909996949393949699 1 4 6 7
+  7 6 4 19950979594949597509699 1 450 3 5 6 6 5 350 4 1999650909698 1 150969698 0
+  0 150909494959698 2 4 5 6 6 5 394509495959698 2 4 5 5 4 2935094 7 75093 7509095
+  699509595 550 5985099 1 4 6 7 7 6 4 198959493945098 1 4 650 2 5 6 6 5 250 6 4 1
+ 9895945097945090 3 3 450 4 450 493 850 3945094 8 8509095945096955095 5 55096 550
+ 9598 1 4 6 7 7 6 4 1989594939450949597 1 4 650 2 5 6 6 5 250 6 4 198959450979450
+ 90 4 5 6 5 2 0979594949597 0 1 4 6 7 7 6 4 1 0979550 5 2 09750989695959699509597
+  0 1 4 650 2 5 6 6 5 250 6 4 1 0979550999695509093 797509393 650 696975090989594
+ 94959698 2 4 5 6 6 5 298959494959698 2 4 5 6 6 5 298509695959698 2 4 6 7 7 6 5 2
+ 9895949393949698 2 4 5 5 450 5 2989550949750 3 65090 5 3 09996949393949699 0 3 5
+  6 6 5 3 0989594959650 5 4 150 5 3 09996945098959494959850949699 0 3 550 1 4 5 5
+  4 250 3 098955095 09999 0 1 2 2 1 050 0 0 1 1 05095 2 1 09999 0 1 2 2 19950 0 0
+  1 1 050 1 250 2 15095 09999 0 1 2 2 1 050 0 0 1 1 050 09999 0 1 2 2 1 050 0 0 1
+  1 05095 09999 0 1 2 2 1 050 0 0 1 1 050 2 1 09999 0 1 2 2 19950 0 0 1 1 050 1 2
+ 50 2 15095 0 0 150 0 1 150 09999 0 1 2 2 1 050 0 0 1 1 050919494959699 2 5 6 7 7
+  6 5 3 0509495959699 2 5 6 6 5 3 050959850 3 650 6 250 0 0 1 150 09999 0 1 2 2 1
+  050 0 0 1 1 05095 2 09999 0 1 2 2 1 09950 0 0 1 1 050 0995099 05095 2 1 09999 0
+  1 2 2 19950 0 0 1 1 050 1 250 2 1508810 8 6 5 3 2 19995939292939499 1 2 2 19998
+ 9695959698 3 6 810501010 8 650 7 6 4 3 1999593929191929499 0 1 1 050 19998965097
+ 96969799 4 6 810105091 0 0 150 0 1 150 5 7 5 2999694949596 4 5 6 6 5 299979650 5
+  4 29996959596 4 6 7 7 6 5 29996949650 6 35089 9919250 910925093 3 1999796969799
+  1 3 450 3 4 2 098979798 0 2 450939698 0 2 3 3 2 098969750969799 1 3 4 4 3 19997
+ 5092 099 1 050 0 050 0 199 0509596 4 55095 5509595 5 550 5 4969550 59550 5 59595
+ 508892 9 9509292 95088 0 0 150 0 1 15092 9 9509292 9508892 9 9509292 95092 9 950
+ 9292 95096 1 0 050 1 050 1 2 050919695955096955096979550 5 4 450 5 450 5 6 45093
+ 999796969799 1 3 4 4 3 19950999697 1 4 39950 1979699 3 4 150
+  8501088 9 091 9 9 091 9 9 088 9 0 3 3 0 4 4501088 9 089 8 0888889909295979899 0
+ 89899092959798 0989899 0 2 5 7 8 9 9 09999 0 2 5 7 8 85011939189888889919396 1 4
+  6 8 9 9 8 6 4 0939391908989909396 1 4 7 8 8 7 6 4 4501188 9 089 8 0888889919396
+  1 4 6 8 9 9 0898990919396 1 4 6 7 8 8501088 9 089 8 08888 0898988 0989899 09999
+  0 8 8 9 0 9 950 988 9 089 9 9 08888 0898988 0989899 099995011939189888889919396
+  1 4 6 8 9 9 8 6 4 0 0 093939190898990919396 1 4 6 7 8 8 7 6 4 1 1 0501188 9 088
+ 88 9 9 08888 9 9 088 9 09898 0999950 588 9 9 08888 950 988 4 7 8 8 7 4 4 08888 4
+  7 8 9 9 8 7 4501188 9 9 08888 9 08888 0 088 1 097 9 9 097 950 888 9 08888 8 0 8
+  8 9 0 9 9501288 9 093 9 9 093 9 088 6 088 6 093 9 093 9 9 088 9501188 9 091 9 9
+  091 9 088 6 088 6 08888 950118889919396 1 4 6 8 9 9 8 6 4 1969391898888 0899093
+ 96 1 4 7 8 8 7 4 19693908989501088 9 089 9 9 088888990929597989999 0898990929597
+ 989850118889919396 1 4 6 8 9 9 8 6 4 1969391898888 089909396 1 4 7 8 8 7 4 19693
+ 908989 0 61111 0 6 611501088 9 089 9 9 088888990929597989999 08989909295979898 0
+ 99 9 9 099 950109189888889919395969799 0 1 3 6 7 8 8 7 6 6 091919089899091939596
+ 9899 1 3 6 8 9 9 8 650 989 9 089 9 9 0888889 0888989501188 3 6 8 9 9 8 6 388 088
+ 88 3 6 7 8 8 7 6 38888501088 9 08888 6 08888 6 088 9501388 9 08888 6 088 6 091 9
+  091 9 088 6 08888 6 088 9501088 9 9 08888 9 08888 9 088 9 950108898 9 9 0888898
+  0888898 08898 9501088 9 088 9 08888 0888989 0 8 8 9 0 9 9501095 9 9 09595 9 098
+ 9695959698 1 3 6 8 9 9 8 6 09896969798 1 3 6 7 8 8 6501088 9 9 08888 9 098969595
+ 9698 1 3 6 8 9 9 8 6 09896969798 1 3 6 7 8 8 650 9989695959698 1 3 6 8 9 9 8 6 0
+ 98999796969798 1 3 6 7 8 8 7 5 6501088 9 9 08888 9 0989695959698 1 3 6 8 9 9 8 6
+  09896969798 1 3 6 7 8 8 650 9 2 299979695959698 1 3 6 8 9 9 8 6 0 1 19997969697
+ 98 1 3 6 7 8 8 7 5 650 888888992 9 9 088898990 08992 9 0959596 09596965010959510
+ 13141515141313 09510131516161513 0989695959698 1 3 6 8 9 9 8 6 09896969798 1 3 6
+  7 8 8 6501088 9 9 08888 9 0999695959699 9 0999796969799 9 950 58889909191908988
+ 88 08990908989 095 9 9 09595 950 5888990919190898888 08990908989 0951616 0959516
+ 50 988 9 9 08888 9 09595 5 095 6 0 2 9 9 0 1 950 588 9 9 08888 9501695 9 9 09595
+  9 0999695959699 9 0999796969799 9 9 0999695959699 9 0999796969799 9 9501095 9 9
+  09595 9 0999695959699 9 0999796969799 9 95010959698 1 3 6 8 9 9 8 6 3 198969595
+  0969798 1 3 6 7 8 8 7 6 3 1989796965010951616 0959516 0989695959698 1 3 6 8 9 9
+  8 6 09896969798 1 3 6 7 8 8 65010951616 0959516 0989695959698 1 3 6 8 9 9 8 6 0
+ 9896969798 1 3 6 7 8 8 650 795 9 9 09595 9 0 198969595 0 1999796969550 998969595
+ 9698 0 1 3 4 0 3 5 6 8 0 7 8 8 7 0 8 6 6 0989896 097969697 09698 0 099 0 2 3 5 6
+  8 9 9 8 650 688 9 9 08888 9 0959596 0959696501095 5 8 9 9 8 5 09595 5 7 8 8 7 5
+  095 9 9 09595 950 895 9 09595 7 09595 7 095 9501295 9 09595 6 095 6 098 9 098 9
+  095 6 09595 6 095 950 995 9 9 09595 9 09595 9 095 9 950 895 9 09595 7 09595 716
+  095 9161650 996 9 095 8 09595 0959696 0 8 8 9 0 9 9501088899297 0 5 8 9 9 8 5 0
+ 9792898888 0899297 0 5 8 0 7 8 8 7 0 8 5 0979289 0908989905010929188 9 092939290
+  9 95010939290898888899092949699 9 09393929089899092949699 9 0 8 8 9 0 9 9501088
+ 8897 0888989 08897 096969799 2 3 6 8 9 9 8 7 5 5 0979798 1 09799 2 3 6 8 0 4 7 8
+  8 7 5 0 8 6501091 9 9 088 9 088 4 4 091 4 0 3 3 450108897 08996 0888889 08989 0
+ 9695959698 1 3 6 8 9 9 8 7 5 5 09797969697 0 09698 1 3 6 8 0 4 7 8 8 7 5 0 8 650
+ 10899191898888899297 2 6 8 9 9 8 6 3 2999796969799 090898990 0899297 2 6 8 0 4 7
+  8 8 7 4 0 8 6 3 29997 0 198979798 1 09799 250108888 9 0888989 088 9 95010888991
+ 939596979899 0 2 5 7 8 8 7 5 2 099989796959391898888 089919395969798 0 2 5 7 8 9
+  9 8 7 5 2 098979695939189 090898990 0 6 8 0 8 6501098 0 1 1 0989594918988888991
+ 95 0 5 8 9 9 8 6 6 8 09598 0 09699 0 09996 0 09895949189 0939089899093 0899195 0
+  5 8 0 7 8 8 750 6 6 7 8 9 9 8 7 6 6 0 7 8 8 7 750 6 8 9 9 8 7 6 6 7101213 0 7 8
+  8 7 7 0 910 0 81250 6959697989897969595 09697979696 0 6 7 8 9 9 8 7 6 6 0 7 8 8
+  7 750 6959697989897969595 09697979696 0 8 9 9 8 7 6 6 7101213 0 7 8 8 7 7 0 910
+  0 81250 688 2 2 08888 2 0 6 7 8 9 9 8 7 6 6 0 7 8 8 7 7501093929089888889909294
+ 96979899 0939392908989909294969798 09189 08991 09598 098 2 298 0 6 7 8 9 9 8 7 6
+  6 0 7 8 8 7 750 68889919495959493929293 09394949393 08993 0919250 6909191908988
+ 8889929495 08990908989 09192 09094501395959698 4 6 7 8 8 7 5 3 1 097959391898888
+ 8991939699 5 8 9 9 095969697 09698 4 6 8 9 9 8 7 5 3 1999695939189 090898990 089
+ 91939699 5 7 8 8 95010841313 0848413 091918988888991939596 0 1 3 5 7 8 8 7 6 091
+ 9089899091939599 1 3 5 7 8 9 9 8 6 6 0 6 85012841616 084841650 78486899398 2 711
+ 141616 0848486899398 2 711141650 78486899398 2 711141616 0848486899398 2 7111416
+ 50 8888999 0 088 0 0888999 0 091919797 09197 091929697 091919797 09197 091929697
+ 50139999 0 099 0 0501391 8 8 09191 8 09999 0 099 0 05013959596 0959696 0 3 3 4 0
+  3 4 450 5888995 08995 088899550 9888995 08995 0888995 0888995 08995 088899550 7
+ 88899193959696959391898888 088919596938988 08889939695918850
diff --git a/bin/build_fonts/unix/in_fnt03a.chr b/bin/build_fonts/unix/in_fnt03a.chr
new file mode 100644
index 0000000..0682c36
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt03a.chr
@@ -0,0 +1,208 @@
+ 99  -9  21 ;TRIPLEX ROMAN-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   13481391139343694   1361938993760
+ 37883816386533823856336537512796284728762939301630453101317132153295340734403569
+ 388235943516   1   3  40 119 157 220 304 375 436 518 558 604 674 727 791 831 886
+  946102411051150120812541289134514001449   1   1   1   1   1   11491154615941629
+ 16821724176518551921196520072069210122012267231423752431247525192542258626182664
+ 27132754   1   1   1   1   13964
+ 925090 0935099 550 0 650 0 75095 450919750 2 950939250939550 5 350 5 450 6 85089
+ 94945095955096965091 3 6 7 8 8 7 6 350 6 7 7 650 3 5 6 6 5 35096 3 6 7 8 8 7 6 3
+ 9150 6 7 7 650 3 5 6 6 5 35092945093945097965098965094925094935096975096985089 6
+  7 7 6 4 299969493929293949699 2 4 6 7509594939394955099979594949597995089949450
+ 95955096965091 1 4 6 7 8 8 7 6 4 19150 5 6 7 7 6 550 1 3 5 6 6 5 3 1509294509394
+ 509796509896509492509493509697509698508994945095955096965091 7 75096 250 2 25091
+  7 750929450939450979650989650 2 750 4 750 5 750 6 750 2 1 250 2 0 250 298 25094
+ 9250949350969750969850 2 750 4 750 5 750 6 7508994945095955096965091 7 75096 250
+  2 250919950929450939450979650989650 2 750 4 750 5 750 6 750 2 1 250 2 0 250 298
+  25094925094935096975096985089 6 7 7 6 4 299969493929293949699 2 4 6 7 750959493
+ 93949550999795949495979950 6 650 5 5 450 21050 3 550 4 550 8 750 9 7508893935094
+ 9450959550 5 550 6 650 7 750909850 2105095 550909850 210509193509293509695509795
+ 50 3 550 4 550 8 750 9 750939150939250959650959750 5 350 5 450 7 850 7 950949999
+ 50 0 050 1 15096 45096 450979950989950 2 150 3 150999750999850 1 250 1 35092 1 1
+  09950 2 2 150 3 3 299979594949596979796955095959696955098 65099 150 0 150 4 350
+  5 35088939350949450959550 6955098 55099 65099 750909850 3 950909850 2 950919350
+ 929350969550979550 5 650 8 650939150939250959650959750 5 350 5 85091969650979750
+ 98985093 15093 8 850949650959650999850 0985096945096955098995098 050 3 850 5 850
+  6 850 7 8508792925092995093995094 050 69950 6 650 7 750 8 850899450 61150899550
+  31150909250 9 85010 850929050929450 6 450 6 550 8 950 810508893935093 75094 650
+ 95 750 7 750909550 41050909650919350 5 750 9 75093915093955089999694939292939496
+ 99 1 4 6 7 8 8 7 6 4 1995095949393949550 5 6 7 7 6 550999795949495979950 1 3 5 6
+  6 5 3 1508994945095955096965091 3 6 7 8 8 7 6 39650 6 7 7 650 3 5 6 6 5 3509199
+ 509294509394509796509896509492509493509697509698508999969493929293949699 1 4 6 7
+  8 8 7 6 4 1995095949393949550 5 6 7 7 6 550999795949495979950 1 3 5 6 6 5 3 150
+ 969799 0 2 3 4 5 7 8 850 4 5 6 750 3 5 6 7 8508994945095955096965091 3 6 7 8 8 7
+  6 39650 6 7 7 650 3 5 6 6 5 350 0 2 3 5 6 8 9 950 5 6 7 850 2 3 6 7 8 950919950
+ 92945093945097965098965094925094935096975096985090 6 7 7 6 4 1989593939497 3 5 6
+  6 550949597 3 5 6509594949597 3 6 7 7 6 5 29996949393945090929250999950 0 050 1
+  150 8 85092 85096 450939250949250959250979250 3 850 5 850 6 850 7 8509997509998
+ 50 1 250 1 350889393949699 1 4 6 7 75094949550959596979950909850 410509193509293
+ 50969550979550 5 750 9 7509093 05094 0 05095 150 7 050919850 3 95092945096955097
+ 9550 5 750 8 7508892965093969650949750 0979650 0 450 1 4 450 2 550 8 5 450899750
+  0 250 51150909350919350959450969450 6 85010 8509093 55094 65095 750 69450919850
+  3 950919750 2 950929550969550979550 4 650 8 650949250949650 5 350 5 450 5 85089
+ 9299995093 0 05094 1 150 7 150909750 4105096 450919350969450 5 750 9 75099975099
+ 9850 1 250 1 35090 7939350 59350 69450 7955093 7 750949350959350969350989350 2 7
+ 50 4 750 5 750 6 750919696979795959698 2 4 5 6 6 7 850 4 5 5 650 2 3 4 4 5 8 950
+  4 3989594949598 1 3 4509695959650 399979696979850899494959750959550919696509697
+ 99 1 4 6 7 7 6 4 199979650 5 6 6 550 1 3 4 5 5 4 3 15092945093945090 5 5 4 4 6 6
+  4 29996949393949699 1 4 650959494955099979695959697995090 4 4 950 5 550 1 6 650
+  4 3 19996949393949699 1 3 4509594949550999796959596979950 2 450 3 450 6 750 6 8
+ 509095 6 6 5 4 19996949393949699 1 4 650 5 5 4509594949550 4 4 3 150999796959596
+ 97995093 5 5 4 4 6 6 5 2 099989850 0999950 2 1 0 05095 45095 350989650989750 0 1
+ 50 0 25091 6 7 8 7 6 4 3509997969595969799 1 3 4 5 5 4 3 199509796969750 3 4 4 3
+ 5099989797989950 1 2 3 3 2 15096959494959699 3 6 7509699 3 650949598 3 6 7 7 6 3
+ 97949393949750979594949597508994945095955091969650969798 0 3 5 6 7 750 5 6 650 3
+  4 5 550919950 21050929450939450949250949350969750969850 5 350 5 450 7 850 7 950
+ 949999 1 19950 0 05099 150999950 0 05096 1 15096 450979950989950999750999850 1 2
+ 50 1 35093 0 0 2 2 050 1 150 0 250 0 0999850 1 1 05097 2 2 1 0989594949696959550
+ 98 05099 0508994945095955091969650 59650 0 750 0 65099 550 2 950919950 2 9509294
+ 50939450 3 550 8 550949250949350969750969850 5 350 4 85094999950 0 05096 1 15096
+  450979950989950999750999850 1 250 1 3508388885089895085909050909192949799 0 1 1
+ 5099 0 0509798999950 1 2 3 5 8101112125010111150 8 910105085935096 450 715508688
+ 50878850888650888750909150909250999750999850 1 250 1 35010 85010 950121350121450
+ 8994945095955091969650969798 0 3 5 6 7 750 5 6 650 3 4 5 550919950 2105092945093
+ 9450949250949350969750969850 5 350 5 450 7 850 7 950909996949393949699 1 4 6 7 7
+  6 4 199509594949550 5 6 6 550999796959596979950 1 3 4 5 5 4 3 15089949450959550
+ 91969650969799 1 4 6 7 7 6 4 199979650 5 6 6 550 1 3 4 5 5 4 3 15091995092945093
+ 945094925094935096975096985090 4 450 5 550 3 5 6 650 4 3 19996949393949699 1 3 4
+ 509594949550999796959596979950 1 950 4 250 4 350 6 750 6 85091969650979750939898
+ 50 5 5 4 4 6 6 5 3 199985093 15094965095965096945096955098995098 05092 5 6 6 5 4
+  2989695959698 3 5 6509695509698 3 550 6 550959698 3 5 6 6 5 3999796959596509398
+ 9899 0 2 4 6 7509999 05098 0 0 1 25095 450899494959698 1 3 4 5509595965091969697
+ 9850 5 51050 6 650 2 7 750929450939450 7 850 7 9509194 05095 05096 150 6 1 05092
+ 9950 2 850939650989650 4 650 7 65088929650939650949750 0979650 0 450 1 450 0 2 5
+ 50 8 5 450899750 51150909350969450 6 85010 8509094 45095 55096 650 59550929950 2
+  850929850 1 850939550989650 3 550 7 550959350959750 4 250 5 7509094 05095 05096
+  150 6 19896949291919393929250929950 2 850939650989650 4 650 7 65091 49450 59550
+  69650 694945094 6 650959450969450979450999450 1 650 3 650 4 650 5 6509099969493
+ 93949699 1 4 6 7 7 6 4 1995096959494959650 4 5 6 6 5 450999796959596979950 1 3 4
+  5 5 4 3 15090999950 0 050 1 150 198965095 550999750999850 1 250 1 3509094949595
+ 94509495969695949393949598 2 5 6 7 7 6 3989694939350 5 6 6 550 2 4 5 5 4 2985093
+ 9496 1 5 75096 1 5 65096 1 5 6 7 750909494959594509495969695949393949598 2 5 6 6
+  5 250 4 5 5 450 1 3 4 4 3 15099 2 4 6 7 7 6 5 2989594939394959696959450 5 6 6 5
+ 50 1 3 4 5 5 4 25094949595945090 1 150 2 250 3 350 392 85098 650 19950 1 050 3 4
+ 50 3 5509095939598 1 4 6 7 7 6 4 1989594939394959696959450 5 6 6 550 1 3 4 5 5 4
+  3 15094949595945095 55095 3509599 3 55090 4 4 5 5 450 5 4 3 3 4 5 6 6 5 3 09795
+ 949393949699 1 4 6 7 7 6 4 1999796955096959494959650 5 6 6 550 09897969595969799
+ 50 1 3 4 5 5 4 3 15090939350 7 7 6 2 1 0 050 1 0999950 6 1999898 05093949698 3 5
+  6 750959698 05093949698 35090989594949598 2 5 6 6 5 298509695959650 4 5 5 45098
+ 979696979850 2 3 4 4 3 2509895949393949598 2 5 6 7 7 6 5 2509594949550 5 6 6 550
+ 98969595969850 2 4 5 5 4 25090959596969550 5 4 3 19996949393949699 1 4 6 7 7 6 5
+  3 097959494959697979695509594949550 4 5 6 6 5 450999796959596979950 1 3 4 5 5 4
+  3 2 05095 09999 0 1 2 2 1 050 0 0 1 1 05095 2 1 09999 0 1 2 2 19950 0 0 1 1 050
+  1 250 2 15095 09999 0 1 2 2 1 050 0 0 1 1 050 09999 0 1 2 2 1 050 0 0 1 1 05095
+  09999 0 1 2 2 1 050 0 0 1 1 050 2 1 09999 0 1 2 2 19950 0 0 1 1 050 1 250 2 150
+ 95 09999 050 0 0 150 0 1 150 1 2 2 150 09999 0 1 2 2 1 050 0 0 1 1 0509195959696
+ 9494959698 2 5 6 7 7 6 5 150 5 6 6 550 2 4 5 5 4 350 0 0 1 1 050 09999 0 1 2 2 1
+  050 0 0 1 1 05095 2 09999 0 1 2 2 1 09950 0 0 1 1 050 0995099 05095 2 1 09999 0
+  1 2 2 19950 0 0 1 1 050 1 250 2 15087 9 9 8 81010 9 8 7 6 4 2 098949291919298 0
+  1 1 0989695959698 2 5 7 9101050939292939450 0 150 1 0509695509698 2 5 750969493
+ 93949850959699 3 6 8 9105090989850 2 250 6 6 5 5 7 7 6 5 2989593939497 3 5 6 6 5
+ 50949597 3 5 6509594949597 3 6 7 7 6 5 29895949393959594945089 9919250 910925093
+  3 1999796969799 1 35099989797989950 1 099989899 0 150939799 1 3 4 4 3 1999750 1
+  2 3 3 2 15099 0 1 2 2 1 0995092 099 1 050 0 050 0 199 0509596 4 55095 5509595 5
+  550 5 4969550 59550 5 59595508892 9 9509292 95088 0 0 150 0 1 15092 9 9509292 9
+ 508892 9 9509292 95092 9 9509292 95096 1 0 050 1 050 1 2 05091969595509695509697
+ 9550 5 4 450 5 450 5 6 45093999796969799 1 3 4 4 3 19950999697 1 4 39950 1979699
+  3 4 150
+  8501088 8 091 9 091 9 088 9 0 3 3 0 9 9 0 9 9 0 8 9 0 8 9 0 8 9 0 7 9 0 7 95011
+ 88 9 089 8 088 9 0888889909294969798 090929496 0888991959798 0989899 0 2 5 7 8 9
+  9 0 0 2 5 7 09899 1 6 8 9 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 9501091
+ 88949189888889919396 1 4 6 8 9 9 8 6 4 0919396 1 4 6 088899296 1 5 8 9501188 9 0
+ 89 8 088 9 0888889919396 1 4 6 8 9 9 0919396 1 4 6 088899296 1 5 8 9 08889 08890
+  08890 08889 0 8 9 0 7 9 0 7 9 0 8 9501088 9 089 8 088 9 0888894 09898 094 2 0 9
+  9 3 08889 08890 08890 08889 08889 08890 08891 08894 09498 2 09698 0 0979899 0 8
+  9 0 7 9 0 7 9 0 8 9 0 9 8 0 9 7 0 9 6 0 9 350 988 9 089 8 088 9 0888894 09898 0
+ 94 2 0 9 9 08889 08890 08890 08889 08889 08890 08891 08894 09498 2 09698 0 09798
+ 99 0 8 9 0 7 9 0 7 9 0 8 950129188949189888889919396 1 4 6 8 9 9 8 8 9 1 0919396
+  1 4 6 088899296 1 5 8 9 0 2 7 0 1 7 8 0 1 1 0 1 2 0 1 3 0 1 3 0 1 2501288 9 089
+  8 088 9 088 9 089 8 088 9 08888 08888 09898 0 9 9 0 9 9 08889 08890 08890 08889
+  08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 950 688 9
+  089 8 088 9 08888 0 9 9 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 950 888 5
+  8 9 089 5 8 088 5 8 9 9 8 6 4 3 3 4 5 6 6 0 4 5 5 4 4 08888 08889 08890 08890 0
+ 8889501088 9 089 8 088 9 089 0 098 9 098 9 096 9 08888 08888 0 9 9 0 9 9 08889 0
+ 8890 08890 08889 08889 08889 0 8 9 0 7 9 0 7 9 0 8 9 0 7 9 0 7 950 988 9 089 8 0
+ 88 9 08888 0 9 9 3 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 9 0 9 8 0 9 7 0
+  9 6 0 9 3501388 8 088 9 088 6 088 6 088 9 088 9 089 8 088 9 08888 08888 0 9 9 0
+  9 9 08889 08890 08889 0 8 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 9501288 8 088 9 088 6 0
+ 88 6 089 9 08888 08888 0 9 9 08889 08889 08889 0 8 9 0 8 950118889919397 0 4 6 8
+  9 9 8 6 4 0979391898888 0919396 1 4 6 0 6 4 1969391 088899296 1 5 8 9 0 9 8 5 1
+ 96928988501188 9 089 8 088 9 088888990929597989999 090929597 0888991969899 0 9 9
+  08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 950118889919397 0 4 6 8 9 9 8 6 4
+  0979391898888 0919396 1 4 6 0 6 4 1969391 088899296 1 5 8 9 0 9 8 5 196928988 0
+  6 4 3 3 4 61214141210 010121313 0 611121211501188 9 089 8 088 9 088888990929496
+ 979898 090929496 0888991959798 09899 1 7 9 9 7 5 0 5 7 8 8 099 0 6 7 7 6 0 9 9 0
+ 8889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 95010918894918988888991949698 0 1 3
+  6 8 094969799 0 2 0899193959698 0 2 5 7 8 9 9 8 6 3 9 650108894 088 9 089 8 088
+  9 08894 08888 0 9 9 08894 08891 08890 08889 08889 08890 08891 08894 0 8 9 0 7 9
+  0 7 9 0 8 9501288 3 6 8 9 9 8 6 389 089 4 6 088 4 7 8 9 08888 08888 08889 08890
+  08890 08889 08889 08889501088 9 088 6 9 088 6 089 9 08888 08888 08890 08890 088
+ 89 08889 08889501288 9 088 4 9 088 4 088 4 9 088 9 088 4 9 088 4 089 4 9 08888 0
+ 8888 08888 08889 08890 08890 08889 08889 08889501088 9 088 9 088 9 089 8 08888 0
+ 8888 0 9 9 0 9 9 08890 08890 08889 08889 08889 0 8 9 0 8 9 0 8 9 0 7 9 0 7 95011
+ 8899 9 08899 8 08899 9 08999 08888 08888 0 9 9 08889 08889 08889 08889 0 8 9 0 7
+  9 0 7 9 0 8 95010888894 088 9 088 9 088 9 0 9 9 3 08894 08891 08890 08889 0 9 8
+  0 9 7 0 9 6 0 9 35011989797999997969595969799 6 8 9 09799 6 8 0959698 6 8 9 9 0
+  0 1 2 3 5 6 8 9 9 8 6 0 3 5 6 8 0 1 2 3 5 6 8 9501088 9 8 8 089 7 08888 8 09896
+ 95959698 1 3 6 8 9 9 8 6 098 0 4 6 0959697 0 4 7 8 9 08889 0889050 9999898 0 098
+ 9695959698 1 3 6 8 9 9 8 6 098 0 4 6 0959697 0 4 7 8 9501188 9 9 089 8 08888 9 0
+ 989695959698 1 3 6 8 9 9 8 6 098 0 4 6 0959697 0 4 7 8 9 08889 08890 0 7 9 0 8 9
+ 50 9 1 199979695959698 1 3 6 8 9 9 8 6 0 09997 098 0 4 6 0 1989695 0959697 0 4 7
+  8 950 79089899191898888899093 9 09093 8 0888991 9 09595 0 9 9 0 8 9 0 7 9 0 7 9
+  0 8 9501096979695959697 095969799 1 3 4 5 5 4 3 19997969595 09799 1 3 0 3 19997
+  0959698 2 4 5 0 5 4 2989695 0 3 4 6 7 91011111213 0 9101011 0 7 8 9 91012131516
+ 1615131210 9 01615131210 9501288 9 089 8 08888 9 099979695959697 0 9 097 0 8 095
+ 9699 9 0 9 9 0 9 9 08889 08890 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 950
+  68890908888 08890 08989 095 9 096 8 09595 9 0 9 9 09596 09597 0 8 9 0 7 9 0 7 9
+  0 8 950 68890908888 08890 08989 095121516 0961114 095951114151616151313151514 0
+ 9596 09597501188 9 089 8 08888 9 096 5 0 1 9 0 2 9 0 2 9 09595 0 9 9 0 9 9 08889
+  08890 09596 09596 0 8 9 0 7 9 0 7 9 0 8 9 0 7 9 0 7 950 688 9 089 8 08888 9 0 9
+  9 08889 08890 0 8 9 0 7 9 0 7 9 0 8 9501795 9 096 8 09595 9 099979695959697 0 9
+  097 0 8 0959699 9 099979695959697 0 9 097 0 8 0959699 9 0 9 9 0 9 9 0 9 9 09596
+  09597 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 950
+ 1295 9 096 8 09595 9 099979695959697 0 9 097 0 8 0959699 9 0 9 9 0 9 9 09596 095
+ 97 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0 7 9 0 8 95010959698 1 3 6 8 9 9 8 6 3 1
+ 98969595 098 0 4 6 0 6 4 098 0959697 0 4 7 8 9 0 9 8 7 4 097969550109516 09615 0
+ 959516 0989695959698 1 3 6 8 9 9 8 6 098 0 4 6 0959697 0 4 7 8 9 01616 09596 095
+ 97 01516 01416 01416 0151650109616 09715 096969516 0989695959698 1 3 6 8 9 9 8 6
+  098 0 4 6 0959697 0 4 7 8 9 01616 01516 01416 01416 0151650 895 9 096 8 09595 9
+  097969698989695959698 1 0 9 9 09596 09597 0 8 9 0 7 9 0 7 9 0 8 950 99795999796
+ 9595969799 1 2 3 4 7 09699 0 0 1 2 3 0 4 8 09799 0 1 2 4 7 8 9 9 8 7 5 9 750 890
+  4 7 8 9 9 8 6 090 5 7 09088 5 8 9 09595501295 4 7 8 9 9 8 7 5 096 5 7 09595 5 8
+  9 095 9 9 096 8 09595 9 09596 09597 0 7 9 0 8 950 995 9 095 7 095 7 096 7 9 095
+ 95 09595 09597 09596 09596 09596501295 9 095 6 095 6 095 6 9 095 9 095 6 09595 6
+  096 6 9 09595 09595 09596 09596 09596 09596501095 9 095 9 095 9 096 8 09595 095
+ 95 0 9 9 0 9 9 09596 09596 09596 09596 0 8 9 0 8 9 0 8 9 0 8 950 995 9 095 7 095
+  7 096 713151616151313151514 09595 09595 09597 09596 09596 0959650 995 9 095 9 0
+ 95 9 0959599 0 9 9 5 09599 09598 09597 09596 0 9 8 0 9 7 0 9 6 0 9 5501088899297
+  0 5 8 9 9 8 5 09792898888 0909296 1 5 7 0 7 5 1969290 088899196 1 6 8 9 0 9 8 6
+  196918988501090 9 090 8 088 9 0889192 0 9 9 0 8 9 0 7 9 0 7 9 0 8 9501092939392
+ 92 0919192939494939290898888899092949698 0 1 3 6 9 090929496 0888992949698 0 0 7
+  6 6 7 7 6 0 6 8 8 7 0 6 9 9 8 6 450109293939292 0919192939494939290898888899194
+ 9697 089919496 0888991949697 0979798 0 2 5 7 8 9 9 8 7 5 4 3 3 4 5 6 6 0 0 2 5 7
+  0979899 2 5 8 9 0 4 5 5 4 4501091 9 090 8 088 9 088 3 3 0 9 9 0 8 9 0 7 9 0 7 9
+  0 8 9501088989695959698 1 3 6 8 9 9 8 7 5 4 3 3 4 5 6 6 098 0 4 6 0959697 0 4 7
+  8 9 0 4 5 5 4 4 08888 08989 09090898850109192929191 090909192939392918988888991
+ 9397 3 6 8 9 9 8 6 3 2999796969798 0 0919397 3 6 7 0 6 4 199 08889909296 3 6 8 9
+  0 9 8 7 4 198979650108894 088919499 1 5 9 0 0 2 5 9 09499 2 5 9 9 0929088889191
+ 9088 090898990 09291909091501088899194969797969491898888 089919496 096949189 088
+ 8991949697 0979694918988 0979899 1 5 7 8 9 9 8 7 5 1999897 099 1 5 7 0 7 5 199 0
+ 9798 1 5 8 9 0 9 8 5 198975010 5 6 6 5 5 09799 0 1 1 098959491898888899194 0 4 6
+  8 9 9 8 6 5 4 4 5 6 7 7 098969391 0909194 0 4 6 0 1 0999693908988 088899194 1 5
+  7 8 950 6 6 7 8 9 9 8 7 6 6 0 7 8 8 7 750 6 8 9 9 8 7 6 6 7101213 0 7 8 8 7 7 0
+  910 0 81250 6959697989897969595 09697979696 0 6 7 8 9 9 8 7 6 6 0 7 8 8 7 750 6
+ 959697989897969595 09697979696 0 8 9 9 8 7 6 6 7101213 0 7 8 8 7 7 0 910 0 81250
+  688899199 088 2 2 08888 2 088899199 0 6 7 8 9 9 8 7 6 6 0 7 8 8 7 7501093929294
+ 94929089888889909294969799 090919596 0888991959798 099 2 29999 0 6 7 8 9 9 8 7 6
+  6 0 7 8 8 7 750 68889919495959493929293 09394949393 08993 0919250 6909191908988
+ 8889929495 08990908989 09192 09094501397969698989695959698 3 6 8 9 9 8 6 3 19795
+ 9391898889919497 0 5 8 9 9 7 6 0 8 6 3 1 0 09591 09389 08993 09699 4 7 8 0 9 8 6
+  3 197 0919599 4 7 8 8 750108413 08413 0939292949492908988888991949698 0 1 3 6 8
+  094969799 0 2 0899193959698 0 2 5 7 8 9 9 8 7 5 3 3 5 5 45012841616 084841650 7
+ 8486899398 2 7111416 0909397 3 710 086889197 3 9121450 78486899398 2 7111416 090
+ 9397 3 710 086889197 3 9121450 8888999 0 088 0 0888999 0 091919797 09197 0919296
+ 97 091919797 09197 09192969750139999 0 099 0 0501391 8 8 09191 8 09999 0 099 0 0
+ 5013959596 0959696 0 3 3 4 0 3 4 450 5888995 08995 088899550 9888995 08995 08889
+ 95 0888995 08995 088899550 788899193959696959391898888 088919596938988 088899396
+ 95918850
diff --git a/bin/build_fonts/unix/in_fnt04a.chr b/bin/build_fonts/unix/in_fnt04a.chr
new file mode 100644
index 0000000..4e802d1
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt04a.chr
@@ -0,0 +1,120 @@
+ 99  -9  21 ;COMPLEX ROMAN-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   11936199220052162   1211219852034
+ 20552020208018992076189220301497153815501596164416581698174717791843190819212094
+ 208721031952   1   3  22  68 101 132 155 176 217 245 258 279 307 322 353 375 420
+  450 515 561 596 613 637 653 678 700 721   1   1   1   1   1   1 738 778 812 841
+  878 910 933 9941023104210681096110911541183122012571291131513481365139414101435
+ 14571480   1   1   1   1   12204
+ 925090 09350 0 750 0 65095 450919750 3 9508994945095955091 3 6 7 8 8 7 6 350 3 5
+  6 7 7 6 5 35095 3 6 7 8 8 7 6 39150 3 5 6 7 7 6 5 35089 6 7 7 6 4 1999694939292
+ 93949699 1 4 6 75099979594939394959799508994945095955091 1 4 6 7 8 8 7 6 4 19150
+  1 3 5 6 7 7 6 5 3 15089949450959550 1 15091 7 7 65095 15091 7 7 650899494509595
+ 50 1 15091 7 7 65095 15091985089 6 7 7 6 4 199969493929293949699 1 4 65099979594
+ 93939495979950 6 650 7 750 3105088939350949450 6 650 7 750909750 3105094 6509097
+ 50 3105095 0 050 1 15097 45097 45093 3 3 2 09896959596979650 2 2 1 05099 6508893
+ 9350949450 7945099 75098 650909750 3 950909750 3 9509196965097975093 05093 8 8 7
+ 508893935094 05093 050 7 050 7 750 8 850909450 71150909650 411508994945095 75095
+  750 7 750919550 410509197508999969493929293949699 1 4 6 7 8 8 7 6 4 19950999795
+ 9493939495979950 1 3 5 6 7 7 6 5 3 1508994945095955091 3 6 7 8 8 7 6 39550 3 5 6
+  7 7 6 5 3509198508999969493929293949699 1 4 6 7 8 8 7 6 4 199509997959493939495
+ 979950 1 3 5 6 7 7 6 5 3 15096969799 0 2 3 4 5 7 8 850 3 4 5 6 7 850899494509595
+ 5091 3 6 7 8 8 7 6 39550 3 5 6 7 7 6 5 350919850 0 2 3 6 7 8 950 2 3 5 6 8 9 950
+ 90 6 7 7 6 4 198959393949597 3 5 750939597 3 5 6 7 7 5 29996949393945091 0 050 1
+  150949393 8 8 75097 450889393949699 1 4 6 7 750949495979950909750 410509093 050
+ 94 050 7 050919750 3 95088929650939650 09650 0 450 1 450 8 450899650 511509093 6
+ 5094 750 79350919750 3 950919750 3 9509093 0 05094 1 150 8 150919750 4105097 450
+ 90 69350 79450949393 75093 7 7 65091969695959698 2 4 5 6 6 7 850 5 5 6 8 950 5 4
+ 989594949598 1 3 5509896959596985089949450959550959799 1 4 6 7 7 6 4 199979550 1
+  3 5 6 6 5 3 15091955090 5 4 5 6 6 4 29996949393949699 1 4 650999795949495979950
+ 90 5 550 6 650 5 3 19996949393949699 1 3 550999795949495979950 2 650 5 9509094 6
+  6 5 4 29996949393949699 1 4 650 5 5 45099979594949597995093 3 2 3 4 4 3 1999898
+ 50 1 099995095 35095 250919997969595969799 1 3 4 5 5 4 3 199509796969750 3 4 4 3
+ 50 4 5 7 7 550969594949598 3 6 750949598 3 6 7 7 6 39794939394975089949450959550
+ 9597 0 2 5 6 650 2 4 5 550919550919850 2 95095 099 0 1 050 0 050 1 15097 15097 4
+ 5095 1 0 1 2 150 2 2 19997969697989750 1 1 0995098 25089949450959550 59550 0 650
+ 99 550919550 2 850919850 2 85095 0 050 1 15097 15097 4508489895090905090929597 0
+  1 1509799 0 050 1 3 6 811121250 81011115086905086935097 450 8155089949450959550
+ 9597 0 2 5 6 650 2 4 5 550919550919850 2 950909996949393949699 1 4 6 7 7 6 4 199
+ 50999795949495979950 1 3 5 6 6 5 3 15089949450959550959799 1 4 6 7 7 6 4 1999795
+ 50 1 3 5 6 6 5 3 15091955091985090 5 550 6 650 5 3 19996949393949699 1 3 5509997
+ 95949495979950 2 950919696509797509798 0 2 5 6 6 5 4 55093975093 05092 5 6 6 5 4
+  2989695959698 3 5 650959698 3 5 6 6 5 39997969595965093989899 1 3 5 6509999 0 1
+ 5095 3508994949598 0 3 5509595969850 5 550 6 650919550 2 650 5 9509194 05095 050
+  6 050929850 2 85088929650939650 09650 0 450 1 450 8 450899650 511509094 55095 6
+ 50 69450929850 2 850929850 2 8509094 05095 050 6 09896949392939450929850 2 85091
+  59450 69550959494 65094 6 6 550909996949393949699 1 4 6 7 7 6 4 199509997969594
+ 949596979950 1 3 4 5 6 6 5 4 3 150909698 1 150 0 05096 550909495949393949598 2 5
+  6 7 7 6 3989694939350 2 4 5 6 6 5 29850939496 1 4 6 75096 1 5 6 7 7509094959493
+ 93949598 2 5 6 6 5 29950 2 4 5 5 4 250 2 4 6 7 7 6 5 2989594939394959450 5 6 6 5
+  4 25090 2 250 3 350 392 85099 65090959350939598 1 4 6 7 7 6 4 19895949393949594
+ 50 1 3 5 6 6 5 3 15095 55095 0 55090 5 4 5 6 6 5 3 09795949393949699 1 4 6 7 7 6
+  4 1 097959450 0989695949495979950 1 3 5 6 6 5 3 1509093935093949698 3 5 6 75094
+ 9698 350 7 7 6 2 1 0 050 6 1 099995090989594949598 2 5 6 6 5 2985098969595969850
+  2 4 5 5 4 2509895949393949598 2 5 6 7 7 6 5 250989695949495969850 2 4 5 6 6 5 4
+  25090 6 5 3 09996949393949699 1 4 6 7 7 6 5 3 097959494959695509997959494959799
+ 50 1 3 5 6 6 5 4 2 05095 099 0 1 05095 099 0 1 1 0995095 099 0 1 050 099 0 1 050
+ 95 099 0 1 050 099 0 1 1 0995095 099 0 1 050 0 050 099 0 1 050919596959494959698
+  1 4 5 6 6 5 4 0 050 1 3 4 5 5 4 250 099 0 1 05096 09950 1995092969550979550 4 3
+ 50 5 35093999796969799 1 3 4 4 3 1995092 0 05095 550 5955089 9915093 4 2 0989797
+ 98 0 2 450 2 099989899 0 250939698 0 2 3 3 2 098965098 0 1 2 2 1 098508791 95087
+  0 05091 9508791 95091 95095 0 1 09999 0 1509599 0 1 1 099 05088 9 8 91010 9 8 7
+  6 4 2 098959291919298 0 1 1 0989695959698 3 5 8 9101050959392929395509596 4 6 8
+ 5090989850 2 250 6 5 6 7 7 5 298959393949597 3 5 750939597 3 5 6 7 7 5 298959393
+ 94959450
+  8501088 9 088 9 091 9 0 3 3 0 9 9 0 9 9501188 9 088 9 0888889909294969798 08889
+ 909294969798 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8 950109194889189888889919396 1
+  4 6 8 9 9 8 6 4 08889919396 1 4 6 8 9501188 9 088 9 0888889919396 1 4 6 8 9 9 0
+ 8889919396 1 4 6 8 9501088 9 088 9 094 2 088889488 09898 0 9 9 3 950 988 9 088 9
+  094 2 088889488 09898 0 9 950129194889189888889919396 1 4 6 8 9 9 8 6 088899193
+ 96 1 4 6 8 9 0 1 9 0 1 9 0 1 1501288 9 088 9 088 9 088 9 08888 08888 09898 0 9 9
+  0 9 950 688 9 088 9 08888 0 9 950 888 5 8 9 9 8 6 4 3 4 5 088 5 8 9 08888501088
+  9 088 9 088 1 097 9 097 9 08888 08888 0 9 9 0 9 950 988 9 088 9 08888 0 9 9 3 9
+ 501388 9 088 6 088 9 088 9 088 9 088 9 08888 08888 0 9 9 0 9 9501288 9 088 7 090
+  9 088 9 08888 08888 0 9 950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 0888991
+ 9397 0 4 6 8 9 0 9 8 6 4 09793918988501188 9 088 9 088888990929597989999 0888990
+ 9295979899 0 9 950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4 6
+  8 9 0 9 8 6 4 09793918988 0 7 6 4 3 3 4 61314141211 0 61012131312501188 9 088 9
+  088888990929496979898 08889909294969798 0 9 9 09899 0 7 8 8 7 099 1 8 9 9 7 650
+ 109188949189888889919395969799 0 2 09395969899 0 2 6 8 9 9 8 6 3 9 6501088 9 088
+  9 0889488889488 0 9 9501288 3 6 8 9 9 8 6 388 088 3 6 8 9 08888 08888501088 9 0
+ 88 6 088 9 08888 08888501288 9 088 4 088 9 088 9 088 4 088 9 08888 08888501088 9
+  088 9 088 9 08888 08888 0 9 9 0 9 950118899 9 08899 9 08899 08888 08888 0 9 950
+ 1088 9 088 9 088948888 0 9 9 3 9501197989897969595969799 6 8 9 097 6 8 9 9 099 0
+  1 2 4 6 8 9 9 8 6 0 1 2 4 6 8 9501088 9 088 9 0989695959698 1 3 6 8 9 9 8 6 095
+ 9698 1 3 6 8 9 0888850 99899 099989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 950
+ 1188 9 088 9 0989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 9 08888 0 9 950 9 1 1
+ 99979695959698 1 3 6 8 9 9 8 6 0 19896 0959698 1 3 6 8 950 6899091908988888991 9
+  0888991 9 09595 0 9 9501095969799 1 3 4 5 5 4 3 19997969595 09698 2 4 0 4 29896
+  09796959696 0 3 4 6 7 910101112 0 7 8 9 910121315161615131210 9501188 9 088 9 0
+ 989695959698 9 0959698 9 08888 0 9 9 0 9 950 68889908988 095 9 095 9 09595 0 9 9
+ 50 68889908988 095131516161514131415 095131516 09595501088 9 088 9 095 5 0 1 9 0
+  1 9 08888 09595 0 9 9 0 9 950 688 9 088 9 08888 0 9 9501795 9 095 9 09896959596
+ 98 9 0959698 9 0989695959698 9 0959698 9 09595 0 9 9 0 9 9 0 9 9501195 9 095 9 0
+ 989695959698 9 0959698 9 09595 0 9 9 0 9 95010959698 1 3 6 8 9 9 8 6 3 198969595
+  0959698 1 3 6 8 9 0 9 8 6 3 198969550109516 09516 0989695959698 1 3 6 8 9 9 8 6
+  0959698 1 3 6 8 9 09595 0161650109516 09516 0989695959698 1 3 6 8 9 9 8 6 09596
+ 98 1 3 6 8 9 0161650 895 9 095 9 0 1989695959697989796 09595 0 9 950 99795999796
+ 9595969799 0 1 3 4 5 09899 0 2 3 4 7 8 9 9 8 7 5 9 750 888 5 8 9 9 8 6 088 5 8 9
+  09595501195 6 8 9 9 8 6 095 6 8 9 095 9 095 9 09595 09595 0 9 950 995 9 095 7 0
+ 95 9 09595 09595501295 9 095 6 095 9 095 9 095 6 095 9 09595 09595501095 9 095 9
+  095 9 09595 09595 0 9 9 0 9 950 995 9 095 7 095 913151616151415 09595 0959550 9
+ 95 9 095 9 095999595 0 9 9 5 9501088899297 0 5 8 9 9 8 5 09792898888 08889909297
+  0 5 7 8 9 0 9 8 7 5 097929089885010929188 9 089 9 0 9 9501092939493929089888889
+ 9092949698 0 1 3 6 9 088899092949698 0 0 7 6 6 8 8 7 6 0 6 9 9 8 6 4501092939493
+ 9290898888899194969797 0888991949697 09798 0 2 5 7 8 9 9 8 7 5 4 3 4 5 099 2 5 7
+  8 9501090 9 088 9 088 3 3 0 9 950108898 0989695959698 1 3 6 8 9 9 8 7 5 4 3 4 5
+  0959698 1 3 6 8 9 08888 08989885010919293929189888889919397 3 6 8 9 9 8 6 3 299
+ 9796969799 2 08889919397 3 6 8 9 0 9 8 6 3 299979650108894 09290888891919088 090
+ 898991 088919499 1 4 9 09499 1 4 9501088899194969797969491898888 0888991949697 0
+ 979694918988 0979899 1 5 7 8 9 9 8 7 5 1999897 0979899 1 5 7 8 9 0 9 8 7 5 19998
+ 9750109598 0 1 1 098959491898888899194 0 4 6 8 9 9 8 6 5 4 5 6 0 1 0989594918988
+  088899194 0 4 6 8 950 5 7 8 9 8 750 5 9 8 7 810121350 59596979695 0 7 8 9 8 750
+  59596979695 0 9 8 7 810121350 58890 29088 09096 0 7 8 9 8 750 99293949392908988
+ 8889909294969799 2 088899092949698 0 7 8 9 8 750 48895 0889550 88895 08895 08895
+  0889550 78889919395969695939189888850 888 0 09197 091975011841650 78486899398 2
+  7111416 086909398 2 7101450 78486899398 2 7111416 086909398 2 710145013 0 05013
+ 91 9 0 0 050139797 0 3 350 59089888991939450 58889919394939250139697989796959596
+ 98 3 6 8 9 9 8 6 3 19795939189888991939699 6 8 9 9 8 7 0 9 8 6 3 199 09395 6 8 9
+ 50108413 08413 0919293929189888889919395969799 0 2 09395969899 0 2 6 8 9 9 8 6 5
+  4 5 650
diff --git a/bin/build_fonts/unix/in_fnt05a.chr b/bin/build_fonts/unix/in_fnt05a.chr
new file mode 100644
index 0000000..e88de45
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt05a.chr
@@ -0,0 +1,144 @@
+ 99  -9  21 ;COMPLEX SCRIPT-UPPER CASE                                  
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   12417266726802544   1248826602590
+ 26112632264623812642237425861981202420402083213421452185223222632327239024022470
+ 265324792435   1   3  42 113 155 199 249 296 350 406 440 475 535 576 626 665 700
+  754 798 864 901 940 9801017105911121155   1   1   1   1   1   11200123412581281
+ 13151339136714061437145714821514153215781611164116721708173317561777180518291866
+ 19091942   1   1   1   1   12694
+ 925087 6 4 2999794918987868687888750 6 5 3 250 6 350 2 2 1 098969493939497 0 4 6
+ 5088 3 2 1999796949250 2 1999897959290898990919050979695939292939597 0 6 8 9 9 8
+  6 2 050 6 7 8 8 7 650 2 5 6 7 7 6 5 3 1 0 0 150 2 4 5 6 6 5 35090939292939699 3
+  5 7 8 8 7 5 299979594949598 0 3 5 6 6 5 3 1 050 5 3 09896959596985088 3 2 19997
+ 96949250 2 199989795929089899092949698 1 3 5 7 8 8 7 5 39895939292939596975091 5
+  4 4 5 7 8 8 7 5 2 099989899 150 2 09999 150 19996949393949597 0 3 5 6 6 5 3 1 0
+ 509997959494955089 5 4 2 099979550999896949393949699 9 6 5 4 2 1 098959391909091
+ 929150 1 5 6509798 0 4 6 8 65089929191929497 0 2 5 6 6 5 4 2 099989899 1 3 5 7 8
+ 50 5 3 1 09999 150 8 7 5 3 1979492919192939250 7 5 3 09750889493939497 097959493
+ 9189888889908950 0979694939150929395 4 6 91112121110 8 6 5 3 2 2 4 5 7 95010 8 6
+  4 3 3 45091 5 3 19998969450 7 5 2999796969799 3 7 5 4 2 09997949291919293925091
+  7 5 3 1989650 7 5 2999796969799 3 7 5 4 199989695939292939597 0 450889493939598
+  0979594939189888889908950 0979694939150 8 5 3 1985011101112121110 8 5 4 2985098
+  1 2 3 45098 0 1 2 4 5 7 950919594949597 0 3 5 8 9 9 8 7 5 4 29897959350 4 2 099
+ 98969391909091939598 0 3 5 75086 0969391898785848485868550 0989796969850 0999897
+ 979850 9 5 09850 9 7 6 5 5 7 8101250 9 8 7 6 6 75089 099979594929088878788898850
+  0 0 1 250 0 1 2 2501413141515141210 8 7 5 3 25090 199979594939394959799 2 4 6 7
+  8 8 7 6 5 3 199989850999795949495975088 3 2 1999796949250 2 1999897959290898990
+ 919050979695939292939597 0 4 7 8 9 9 8 7 4 2 050 4 6 7 8 8 7 6 45090 3 3 2 19997
+ 96969799 2 5 7 8 8 7 5 198969391909091939598 1 4 6 850 5 6 7 7 6 4 197935088 3 2
+  1999796949250 2 1999897959290898990919050979695939292939597 0 5 8 9 9 8 7 4 050
+  5 7 8 8 7 6 450 0 3 4 5 650 0 2 3 4 6 7 91150909695959698 1 4 6 91010 9 8 6 5 4
+  3 1 0989650 4 3 2 19996939190909192915091 7 6 4 2 1999750 1 0989695959698 110 8
+  7 6 4 3 2 0979593929293949350 3 7 850899092949597979693939450959696939292949698
+  1 3 450 8 4 3 3 5 6 81050 9 5 4 4 550899092949597979694949550959696949393959699
+  2 4 6 7 8 8 7 6 5 4 4 5 7 911508891908989909296959493925094949350 4 2 097959350
+  4 3 2 1 050 2 2 150141210 8 5 3 150909897959494959799 1 2 2 1999795929089899091
+ 905099 0 1 1 09896949250111011121211 9 7 5 3 1 0 0 1 2 3 5 750899294969799999797
+ 9850979898969698 0 3 5 7 85010 8 5 35011 9 7 5 3 198949291919293925089 8 7 5 4 3
+  199979450 1 0989695959698 111 9 8 7 6 4 299949089899092949799 2 5 750 4 8 95093
+  3 2 09896959494959799 1 250989695959750 4 2 2 4 6 7 950 5 3 3 4509494969850 195
+ 959798 0 2 3 3 4 5 6 850 29696975094 2 1 2 2 199979695959698 1 4 650999796969850
+ 93 3 2 09896959494959799 1 250989695959750 8 2 2 4 6 7 950 9 3 3 450949799 0 1 1
+  099979695959698 1 4 65099979696985097 0 3 5 6 6 5 3 293939496979899 1 3 4 650 2
+  1 09795935093 3 2 09896959494959799 1 250989695959750 49850 5 2 098979594949597
+  0 4 7 9509494969850 19450 295509799 1 2 4 4 3 3 450 2 3 3 2 2 4 6 7 95096 1 0 1
+  2 15099979799 1 2 450 09898995096 1 0 1 2 150999350 09795939290898990929599 2 4
+ 509494969850 19450 29550 3 3 4 3 2 0975097 0 1 2509799 0 2 3 6 850969698 050 397
+ 9799 1 2 450 4989899508787899193939150919292905093959798 0 098509899999750 0 2 4
+  5 7 7 6 6 750 5 6 6 5 5 7 9101250919193959797955095969694509799 1 2 4 4 3 3 450
+  2 3 3 2 2 4 6 7 95093 09896959494959799 1 2 3 3 2 09999 0 2 4 6 750989695959750
+ 9494969850999050 091509799 1 2 4 4 3 3 450 2 3 3 2 2 4 6 7 95093 3 2 09896959494
+ 959799 150989695959750 4989899 1 2 2 4 7 950 5 2 0985094949698 0 098509899999750
+  0 2 4 5 450 4 4 5 6 8509696989999 2 3 3 2 05099 1 2 2 0509698 3 6 850969698 050
+  3979799 1 2 450 49898995098 45093969494969799 1 3509795959650 4 2 2 4 6 7 950 5
+  3 3 45093969594949697 0 2 3 350979695959650 3 4 5 6 850909492919193949698509593
+ 92929350 09898 0 1 3 5 6 650 19999 050 6 7 8 91150929294969899999897959493939493
+ 50 5 4 5 5 4 3 1 09999 0 3 6 85099 050 1995098995099975093969494969799 1 3509795
+ 959650 49850 5 2 098979594949597 0 4 7 95094949698 0 2 2 1989650 0 1 1 098509698
+ 999998969493939497 0 4 7509697989897965090 299979594939394959799 2 4 6 7 8 8 7 6
+  4 250 2 0989695949495975099 1 3 5 6 7 7 6 45090 29750 49850 4 1989650 399965090
+ 97989796969798 1 4 7 8 8 7 5 29895939150 4 6 7 7 6 49850929395 0 3 5 65095 0 3 5
+  6509097989796969798 1 4 7 8 8 7 4 150 4 6 7 7 6 45099 1 4 5 6 6 5 4 19794939292
+ 93949350 1 3 4 5 5 4 3 15090 6 050 7 150 792 8509099945099 95099 4 950949598 1 4
+  5 6 6 5 3 0979493929293949350 1 3 4 5 5 4 2 05090 7 6 7 8 8 7 5 299979594939394
+ 9597 0 3 5 6 6 5 4 29997959450 2 098969594949550 0 2 4 5 5 45090969450 9 8 6 199
+ 989750 6 0989796509598 0 5509698 0 5 7 8 95090 1989796969799 2 6 7 8 8 7 4 150 1
+ 99989797989950 2 5 6 7 7 6 45099959392929396 0 4 5 6 6 5 4 2509996949393949650 0
+  3 4 5 5 45090 7 6 4 299979695959698 1 4 6 7 8 8 7 6 4 2999694939394959450979696
+ 9799 150 6 7 7 6 5 3 199509598979899985095989798999998965095 1 0 1 2 15098979899
+ 5095 1 0 1 2 150989798999998965095 3 2 050 3 050 3 4 050989798999850909798979696
+ 9798 1 5 8 9 9 8 7 19999 0 250 5 7 8 8 7 6 45098979899985095 4 2 1 1 2 3 25095 3
+  2 3 4 4 3 1508710 910111110 9 7 5 098969390898990919398 0 2 3 3 2 09897979899 1
+  3 5 7 8 8509391909091929850979899 1 3 5 7 85090 29450 79950 8 7 8 9 9 8 7 4 097
+ 95959697 4 6509597 4 5 6 6 5 4 19794939292939493508913875093 8 4 199979696979899
+ 50 4 19998979798995092 1 2 3 4 4 3 199969250 1 2 3 3 2 199965092 2 25097 750 797
+ 508791 95087 0 05091 9508791 95091 95096 3 150 4 15091989650999650 7 550 8 55093
+  199989899 1 3 5 6 6 5 3 150
+  8501088909398 1 5 8 9 9 8 6 5 6 7 08892 2 9 088 9 0 9 7 4 2 09999 0 2 5 8 9 9 8
+ 501289909297 3 5 8 9 09093 1 4 6 8 9 9 8 6 5 6 7 0949697979694929089888889919395
+ 969797 0888991939596 0979899 1 4 7 8 9 9 8 6 3 0979899 1 4 7 9501190929496979796
+ 95939189888889929599 3 6 8 9 9 8 6 4 2 0 0 1 3 08889929599 3 6 8 9501189909297 3
+  5 8 9 09093 1 4 6 8 9 9 8 6 5 5 6 8 9 9 8 6 29794918988888991939596969593501091
+ 929495959391898888899092949697 08890929597 0979798 0 2 5 7 8 9 9 8 6 4 2 0 0 1 3
+  09798 0 2 6 85010909297 3 5 8 9 094969797959391898888899093 1 4 6 8 9 9 8 7 6 5
+  6 7 0888989 0 1 099999895 25011919395979898979693908988888991939699 1 2 2 19997
+  08889919396 0 2 097 1 5 7 8 9 9 8 6 5 4 5 6 0 1 4 6 8 9501294939189888899 5 7 8
+  9 9 8 6 5 6 7 08897 0 5 7 9 0 2 1 09796949290898888899294 0 4 7 9 9 8 6 0889094
+  0 4 7 950 7909398 3 5 8 9 09496979796949290898888909298 4 6 8 9 9 8 6 5 6 750 8
+ 88909398 711 095979898979593918988889193 2 6 81112131210 8 6 5 4 350129493918988
+ 8899 5 7 8 9 9 8 6 5 6 7 08897 0 5 7 9 08993959697 0899091908988888994959697 097
+ 98 0 7 9 09798 0 7 9 9 8 650 991939597989897969390898888899093 3 5 8 9 09094 1 4
+  6 8 9 9 8 6 5 5 6 8 9 9 8 650148897 3 6 8 9 9 8 6 5 6 7 0889599 4 8 9 0889297 4
+  8 9 08897 6 9 0889599 4 8 9 9 8 6 0889297 4 8 95012889298 3 5 8 9 9 8 6 5 6 7 0
+ 8893 4 9 08893 4 9 08990919089888889929499 5 950118889919496 0 4 7 8 9 9 8 6 3 1
+ 9793908989909296 1 4 0899296 0 4 7 9501189909297 3 5 8 9 09093 1 4 6 8 9 9 8 6 5
+  6 7 09496979796949290898888899092959798999998 088899092959798995011929496979898
+ 96949189888889919598 1 5 7 8 9 9 8 6 5 5 6 8 9 9 8 6 08889919598 1 4 7 950128990
+ 9297 3 5 8 9 09093 1 4 6 8 9 9 8 6 5 6 7 0949697979694929089888889919395969797 0
+ 88899193959697 09798 0 7 9 09798 0 7 9 9 8 6501091939597989897969390898888899092
+ 95 2 5 8 9 09296 3 6 8 9 9 8 6 5 4 5 650 9909297 3 5 8 9 09496979795939189888889
+ 9093 1 4 6 8 9 9 8 7 6 5 6 7 0888989501192898888909396 4 7 9 0889093 1 4 7 9 9 8
+  5 2 0 088 0 4 7 9 9 8 6 088 0 4 7 9501092898888909397 4 7 9 0889093 0 4 7 9 9 8
+  5 2989591898888899194969899995011949493918988889094 3 9 094 3 9 0889094 3 7 9 0
+ 889094 3 9 094 3 9 088899194 3 7 95010939494939189888889919498 3 6 8 9 9 8 6 5 6
+  7 08889919498 3 6 8 9 08990919089888889919498 3 6 8 9 9 8 6501192898888899197 0
+  2 088899197 0 2 2 1999694 08894 2 6 0889499 3 6 8 9 9 8 6 5 4 5 65010909297 0 2
+  5 7 8 9 09496979795939189888889909397 3 6 8 9 9 8 6 5 5 6 8 9 9 8 6 088898950 9
+  3 1 0 0 1 2 4 6 8 9 9 8 6 0 0 2 4 7 9 0 0 6 8 9 8 7 4 0 0 6 8 950 8 4 197 088 6
+  8 9 9 8 6 3 0 4 5 5 4 088 6 8 950 6 1 2 2 1 0 0 1 2 4 6 8 9 9 7 4 0 0 2 4 7 950
+  9 3 1 0 0 1 2 4 6 8 9 9 8 6 0 0 2 4 7 9 088 6 8 9 8 7 4 088 6 8 950 6 7 6 5 3 1
+  0 0 1 2 4 6 8 9 9 7 4 0 0 2 4 7 950 6 0979491898889911820212017 8 9 9 8 7 4 091
+ 96 0 9141850 9 3 1 0 0 1 2 4 6 8 9 9 8 6 0 0 2 4 7 9 0 018 0 0 91418202120181513
+ 11 9 7 450 9 4 197 088 9 088 9 0 3 1 0 0 1 3 6 8 9 0 0 1 3 6 8 9 8 7 450 4949596
+ 9594 0 0 6 8 9 8 7 4 0 0 6 8 950 49495969594 0 018 0 0 9141820212018151311 9 7 4
+ 50 8 4 197 088 9 088 9 0 0 1 1 0 0 2 3 0 3 4 8 9 0 3 4 8 9 9 7 450 4 4 197 088 6
+  8 9 8 7 4 088 6 8 95012 4 1 0 1 3 9 0 0 1 3 9 0 3 1 0 0 1 3 9 0 0 1 3 9 0 3 1 0
+  0 1 3 6 8 9 0 0 1 3 6 8 9 8 7 450 9 4 1 0 1 3 9 0 0 1 3 9 0 3 1 0 0 1 3 6 8 9 0
+  0 1 3 6 8 9 8 7 450 7 0 0 1 2 4 6 8 9 9 8 7 5 3 1 0 1 3 5 6 6 5 4 0 0 2 4 7 950
+  9 4 197 09421 09421 0 3 1 0 0 1 3 6 8 9 0 0 1 3 6 8 9 8 7 450 9 3 1 0 0 1 2 4 6
+  8 9 9 8 0 0 2 4 7 9 0 01820212017 9 9 7 4 0 0 9141850 8 4 1 0 1 3 9 0 0 1 3 9 0
+  3 1 0 0 3 0 0 3 5 5 450 8 4 199 1 3 5 7 8 9 0 1 3 5 7 9 0 8 9 9 7 450 4 4 197 0
+ 88 6 8 9 8 7 4 088 6 8 9 0969650 9 0 6 8 9 9 8 6 3 0 0 6 8 9 0 0 6 8 9 8 7 4 0 0
+  6 8 950 8 0 2 5 8 9 9 8 6 3 0 0 0 2 5 8 9 0 0 4 5 5 45011 0 2 5 8 9 9 8 6 0 0 2
+  5 8 9 0 0 6 8 9 9 8 6 3 0 0 0 6 8 9 0 0 4 5 5 450 8 4 1 0 0 1 3 6 8 9 9 8 7 7 8
+  0 1 2 2 1 0 0 1 3 6 8 9 9 7 4 0 1 3 0 1 3 0 6 8 0 6 850 9 0 6 8 9 9 8 6 3 0 0 6
+  8 9 0 018 0 0 9141820212018151311 9 7 450 7 4 1 0 0 1 4 6 8 9 0 0 1 4 6 8 0 910
+ 12151820212018151210 7 4 0 9101215182050118889919497 1 4 7 8 9 9 8 6 3 096939089
+ 8888 08889919497 1 4 7 9 0 9 8 6 3 096939088501192 9 088 9 088919394 09193945011
+ 929394939290898888899193959799 1 3 5 9 0888991939597 1 0 7 6 6 8 8 7 5 0 6 9 9 8
+  55011929394939290898888899193959798 0888991939597 0989899 0 2 5 7 8 9 9 8 7 5 4
+  3 4 5 09899 0 2 5 7 8 9501189 9 088 9 088 3 350118898 08888 0898988 09897969697
+ 98 0 3 6 8 9 9 8 7 5 4 3 4 5 0969798 0 3 6 8 95011919293929189888889919497 1 5 7
+  8 9 9 8 6 4 19998979798 0 2 08889919497 1 6 8 0 9 8 6 4 09850118894 0889194 0 3
+  5 9 094 0 3 5 9 091888891 0908989919190885011888990929597989897969491898888 088
+ 899092959798 098979694918988 09899 1 3 6 8 9 9 8 7 5 2 09998 09899 1 3 6 8 9 0 9
+  8 7 5 1995011959799 0 0999896939189888889909296 0 3 6 8 9 9 8 6 5 4 5 6 0999793
+ 918988 0899196 0 3 6 8 950 6 7 8 9 8 750 6 9 8 7 8 9111350 69596979695 0 7 8 9 8
+ 50 69596979695 0 9 8 7 8 9111350 68889 1 089 1 08889 1 0 7 8 9 8 750119293949392
+ 9089888889919395969899 1 2 2 088899193959697 0 7 8 9 8 750 68890929394939250 690
+ 8988899092945013969798979695959698 6 8 9 9 8 6 4 2 1 098979593918988899194 0 3 6
+  8 9 9 7 6 0 9 8 6 4 2 198 09499 2 5 7 8 8 750118413 08413 092939493929089888889
+ 91939596 0 2 0939599 0 2 5 7 8 9 9 8 7 5 4 3 4 55011841650 88487909397 2 6111416
+  087919598 3 8131650 78486899498 3 7101316 084879297 2 5 91350 988 0 09197 09197
+ 5013 0 0501391 9 0 0 050139797 0 3 350 58895 0889550 98895 08895 08895 0889550 8
+ 8889919395969695939189888850
diff --git a/bin/build_fonts/unix/in_fnt06a.chr b/bin/build_fonts/unix/in_fnt06a.chr
new file mode 100644
index 0000000..c80a9ed
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt06a.chr
@@ -0,0 +1,200 @@
+ 99  -9  21 ;TRIPLEX ITALIC-UPPER CASE                                  
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   13339377637993553   1348037643615
+ 36483681373032443721322736062694275327742827289229082958302030603165326733003434
+ 374734573374   1   3  42 121 163 227 308 379 445 527 567 615 688 738 807 851 908
+  969104811271172122712761312137014251477   1   1   1   1   1   11513156416171652
+ 17111745179118491891192719732023205021122155220222692327235824062430247325032552
+ 26042654   1   1   1   1   13829
+ 925090 39150 1 250 2 350 3 3 4 45094 25088945099 650918950919350 2 050 2 150 4 5
+ 508897915098925099935094 5 8 9 9 8 7 450 7 8 8 7 650 5 6 7 7 6 45096 4 6 7 7 6 4
+  08850 5 6 6 5 350 4 5 5 4 2 050959850969750 09850 19850928950929050939450929550
+ 90 8 910 9 9 8 7 5 2999795949393949598 1 3 5 6509997969594949550 2 0989796959596
+ 98508897915098925099935094 3 6 7 8 8 7 5 3 1978850 5 6 7 7 6 4 250 3 5 6 6 5 3 0
+ 9750959850969750 09850 1985092895092905093945092955088979150989250999350 3 15094
+  9 85096 25088 3 550959850969750 09850 19850 5 850 6 850 7 850 8 850 3 1 150 2 0
+  150 299 15092895092905093945092955098 350 0 350 3 55088979150989250999350 3 150
+ 94 9 85096 250889650959850969750 09850 19850 5 850 6 850 7 850 8 850 3 1 150 2 0
+  150 299 15092895092905093945092955090 8 910 9 9 8 7 5 2999795949393949598 0 3 5
+  7509997969594949550 4 5 650 2 09897969595969850 0 2 4 550 21050 3 550 4 550 8 6
+ 50 9 65087969050979150989250 8 250 9 35010 45093 150 5135094 65087955099 7509497
+ 50959650999750 09750 6 950 7 85011 95012 950918850918950929350919450 3 050 3 150
+  4 550 3 65093 29650 39750 4985099 75093 150 0 350 1 250 5 350 6 350979450979550
+ 98995097 05091 5 0999750 6 2 1 050 7 3 199979593929293949595949350939394949350 2
+ 1050 3 650 4 550 8 650 9 6508897915098925099935010955099 350 0 450 1 55094 250 7
+ 1350889650 0 750959850969750 09850 19850 81050121050928950929050939450929550 3 1
+ 50 3 250 4 65090999350 09450 1955096 45090 5 75097 050989950 2 050 3 05094915094
+ 9250959650949750 0 550 2 650 4 7508695895095969650969750979850 9989650 9 35010 4
+ 5011 550929750 91450869250 0 850939550949550121050131050898750899150 4 150 4 250
+  5 650 4 7508897915097 45098 45099 55010 5 450949950 71350889450959850969850 810
+ 5012105091895091935089 198969493929293949699 2 4 6 7 8 8 7 6 4 15097959493939450
+  3 5 6 7 7 650 199979695949495965099 1 3 4 5 6 6 5 4508897915098925099935094 6 9
+ 1010 9 7 39550 8 9 9 8 650 6 7 8 8 7 5 350889650959850969750 09850 1985092895092
+ 905093945092955089 198969493929293949699 2 4 6 7 8 8 7 6 4 15097959493939450 3 5
+  6 7 7 650 199979695949495965099 1 3 4 5 6 6 5 45094959798 0 1 2 3 4 550 2 3 450
+  1 1 2 4 5 5508897915098925099935094 5 8 9 9 8 7 49650 7 8 8 7 650 5 6 7 7 6 450
+  0 2 3 5 6 7 850 5 6 750 3 4 5 7 8 850889650959850969750 09850 19850928950929050
+ 93945092955089 8 910 9 9 8 7 4 09795959698 4 5 5 4509697 4 55097969697 3 5 6 6 5
+  4 197949392929192935089 29650 39750 4985095935011105095115093 150969350989450 0
+ 9550 71050 81050 9105010105097945097955098995097 05088969392929396 0 3 5 6105097
+ 949393945098959494965093 150 71350949750959650999750 09750 810501210509096969797
+ 50979850989950 9975094 150 61250959650999850 09750 7 95011 950879595939350969450
+ 979550 3959350 3 3 1 150 4 250 5 35011 3 15092 050 3 550 81450939650949550989650
+ 999650 911501311508996 25097 35098 450 9915094 150 6125088945099 650959750999850
+  09850 7 95011 950918950919350 2 050 2 150 3 550899599965096 0975097 1985010 150
+ 93 050 7135093 150949650989750999650 8105012105097945097955098995097 05089 89050
+  991501092501096945090 4 650979450989550 09650 0 450 2 550 3 65089 5 3 3 4 5 7 9
+ 1050 6 4 450 5 7 5 450 3 3 2 0989593929293949698 0 1 2 3509694939394509896959494
+ 9596509198969595969799 1 4 6 7 7 6 5 3 19998979650999796969750 4 5 6 6 55095 098
+ 9650 1 3 4 5 5 4 35096995097985091 5 5 4 4 6 6 5 3 097959494959698 0 3 550979695
+ 959650 09897969697985089 7 4 3 3 4 5 7 91050 8 5 4 450 4 9 5 450 3 3 2 098959392
+ 9293949698 0 1 2 3509594939394509896959494959650 5 850 6 750919599 2 5 6 5 3 097
+ 959494959698 0 3 550979695959650 09897969697985092 8 8 7 7 9 9 8 6 4 2 1 0999796
+ 959350 2 1 0989750 6 4 3 2 19998979593919090929291915096 75090 6 2 1999750 7 3 1
+ 50 6 8 4 2 097949291919393929250 4 4 3 1999694939394959799 1 2 3 450969594949550
+ 9997969595969750899791935098925094999350959799 1 3 5 6 6 450 5 5 4 450 5 3 3 4 5
+  7 9105095985096975093 2 2 4 4 250 3 350 2 45094959799 0 1 19950 0 0999950 09898
+ 99 0 2 4 55093 3 3 5 5 350 4 450 3 550959698 0 1 2 2 0999896949291919393929250 1
+  199989750 1 09897969450899791935098925094999350 7 7 6 6 8 8 7 5 3999750959799 0
+  2 3 55099 1 2509798 0 1 3 5 75095985096975094 299989899 0 2 4 550 3 099995099 4
+  09950 0 350 1 250828384868889909088508989875089888688509092949698 0 1 19950 0 0
+ 9850 099979950 1 3 5 7 91112121050111110105011 9 9101113151650888990929495969694
+ 509595935095949294509698 0 2 4 6 7 7 550 6 6 5 550 6 4 4 5 6 8101150909996949393
+ 949598 1 4 6 7 7 6 5 29950969594949550 4 5 6 6 5509997969595969850 1 3 4 5 5 4 2
+ 508990919395969797969350969695925096959150979899 0 2 4 6 7 8 8 7 5 2 098979750 6
+  7 7 6 550 4 5 6 6 5 4 25088965092895092905093945092955089 59950 6 050 5 7 150 3
+  3 2 0989593929293949698 0 1 2 350959493939450989695949495965096 450 09750 09850
+  1 250 0 35091929395979899999750989896509897959750 7 7 6 6 8 8 7 5 3 1995092 6 6
+  5 5 7 7 6 3 09796969799 2 4 5509796509799 2 450 5 450969799 2 4 5 5 4 198959494
+ 969695955093 299989899 0 2 4 550 3 0999950 2 4 0995096 6508889909294959696945095
+ 95949450959393949698 0 2 450 6 4 4 5 6 8101150 7 5 550 6 8 6 5509091929496979898
+ 965097979696509795959698 0 2 4 6 7 7 6 6 750858687899192939391509292919150929090
+ 9193959799 050 2 0 0 1 3 5 7 911121211111250 3 1 150 2 4 2 1508992949698 0 1 150
+ 989999989795939190909292919150 0 0999950 8 8 7 7 9 9 8 6 4 2 1 0 0 150989899 1 3
+  5 750899091939596979795509696959550969494959799 1 3 550 7 3 2 09850 8 4 250 7 9
+  5 3 19895939292949493935090 7 6 496949350 697959450 4 0979650 4 09795945094 3 5
+  65096 0 3 45096 0 3 5 65090 299979594939394959799 2 4 6 7 8 8 7 6 4 25099979695
+ 94949550 2 4 5 6 7 7 650 2 0989796959596975099 1 3 4 5 6 6 5 45090 2979950 5 398
+ 50 59950 5 2999750 2 09750909797989896969798 1 4 7 8 8 7 595939150 6 7 7 6 4 150
+  4 5 6 6 5 39550929395 0 5 65095 0 55095 0 3 5 6 650909797989896969798 1 4 7 8 8
+  7 6 4 150 6 7 7 6 550 4 5 6 6 5 3 15099 1 4 5 6 6 5 3 097949392929494939350 4 5
+  5 450 1 3 4 4 3 2 05090 5 0 250 8 6 150 8 250 892 8509099945099 95099 75098 3 7
+  950949598 1 4 5 6 6 5 39996949392929494939350 4 5 5 4 250 1 3 4 4 3 1995090 7 7
+  6 6 8 8 7 5 2999795949393949597 0 3 5 6 6 5 4 2999796955098969594949550 4 5 5 4
+ 50 2 09897969595969750 0 2 3 4 4 3 25090969450 9 8 6 2 0999850 0989750 6 0989796
+ 98509598 0 55097 0 5509597 0 5 7 8 95090 1989796969799 2 5 7 8 8 7 5 150 3985098
+ 9797985097 050 1 550 6 7 7 650 7 350 19998989950 2 4 5 6 6 55099959392929396 0 4
+  5 6 6 5 4 250 095509694939394509398 450 4 5 5 450 4 1509997959494959650 0 2 3 4
+  4 3 25090 6 5 4 299979695959698 1 4 6 7 8 8 7 6 4 29996949393959594945097969697
+ 50 6 7 7 6 5 350999897979899 150 4 5 6 6 5 4 3 19950959897979899 0 0999850989899
+ 99985095999897979899 0 0999896509898999998509999985095 1 0 0 1 2 3 3 2 150 1 1 2
+  2 1509897979899 0 099985098989999985095 1 0 0 1 2 3 3 2 150 1 1 2 2 15099989797
+ 9899 0 0999896509898999998509999985095 4 3 2 050 4 3 050 4 4 050 4 5 5 050989797
+ 9899 0 0999850989899999850909797989896969798 1 5 8 9 9 8 7 5 19999 1 250 3 850 7
+  8 8 7 6 450 5 6 7 7 6 5 1 0 0 1509897979899 0 099985098989999985095 5 3 2 1 1 2
+  3 4 4 3 250 3 2 250 2 2 3 3 25095 4 3 2 2 3 4 5 5 4 3 150 3 3 4 4 350 4 4 35087
+ 1010 9 9111110 9 7 5 098969390898990919398 0 2 3 3 2 09897979899 0 2 4 6 7 75094
+ 9050919090919294509899 2 45093929191929395 050979899 1 3 5 6 75090 29450 79950 8
+  8 7 7 9 9 8 7 4 09795959698 4 5 5 4509697 4 55097969697 3 5 6 6 5 4 19794939292
+ 949493935089138788501314885092 8 6 3 09896959596979950 19997969650 8 5 2 0999897
+ 9650969798995092 1 3 4 5 5 4 2 097949250 4 4 3 19950 1 2 3 450 4 3 2 1 098959250
+ 92 2 1 3 250 2 250 2 3 1 2509798 6 75097 7509797 7 750 7 6989750 79750 7 7979750
+ 8892 9 9509292 95088 0 0 150 0 1 15092 9 9509292 9508892 9 9509292 95092 9 95092
+ 92 95095 3 2 050 3 050 3 4 050909897955098955098999550 8 7 550 8 550 8 9 55093 1
+ 99989899 1 3 5 6 6 5 3 150 19899 3 6 5 150 39998 1 5 6 350
+  8501088 8 092 9 090 8 08890 7 9 0 3 3 0 9 9 0 9 9 0 8 9 0 8 9 0 8 9 0 7 9 0 7 9
+ 501288 9 088 9 088 9 08888899193969798 08991939697 0888991939698 0989899 1 3 6 8
+  9 9 099 1 3 6 8 098 0 3 6 8 9 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 950
+ 1190908894929089888889919497 1 4 7 8 9 9 8 6 4 090929497 1 5 7 08889929497 1 6 8
+  9501188 9 088 9 088 9 0888889909397 1 5 7 8 9 9 089909397 1 5 7 088909397 1 5 8
+  9 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 9501188 9 088 9 088 9 094 2 088
+ 8894 09898 0 9 9 4 08889 08890 08890 08889 08889 08890 08891 08894 09498 2 09698
+  0 0979899 0 8 9 0 7 9 0 7 9 0 8 9 0 9 8 0 9 7 0 7 4501088 9 088 9 088 9 094 2 0
+ 888894 09898 0 9 9 08889 08890 08890 08889 08889 08890 08891 08894 09498 2 09698
+  0 0979899 0 8 9 0 7 9 0 7 9 0 8 9501290908894929089888889919497 1 4 7 8 9 9 8 6
+  2 090929497 1 5 7 0 6 5 2 08889929497 1 6 8 9 0 9 8 5 2 0 2 2 0 2 3 0 2 5 0 2 4
+  0 2 3501388 9 088 9 088 9 088 9 088 9 088 9 08888 08888 09898 0 9 9 0 9 9 08889
+  08890 08890 08889 08889 08890 08890 08889 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9 0 7 9 0
+  7 9 0 8 950 788 9 088 9 088 9 08888 0 9 9 08889 08890 08890 08889 0 8 9 0 7 9 0
+  7 9 0 8 9501088 5 7 9 088 1 4 6 088 1 6 8 9 9 8 6 4 3 3 4 5 6 6 0 4 5 5 4 4 088
+ 88 08889 08890 08890 08889501188 9 088 9 088 9 089 0 097 9 097 9 096 8 08888 088
+ 88 0 9 9 0 9 9 08889 08890 08890 08889 08889 08889 0 8 9 0 7 9 0 7 9 0 8 9 0 8 9
+  0 7 9 0 7 9501088 9 088 9 088 9 08888 0 9 9 3 08889 08890 08890 08889 0 8 9 0 7
+  9 0 7 9 0 8 9 0 9 8 0 9 6 0 9 3501488 8 089 7 9 088 7 088 6 088 6 9 088 9 088 9
+  088 9 08888 08888 0 9 9 0 9 9 08889 08890 08890 08889 0 8 9 0 8 9 0 8 9 0 7 9 0
+  7 9 0 8 9501388 8 088 9 088 6 088 6 089 6 9 08888 08888 0 9 9 08889 08890 08889
+  08889 0 8 9 0 8 950118889919497 1 4 7 8 9 9 8 6 3 0969390898888 0919497 1 5 7 0
+  6 3 0969290 08889929497 1 6 8 9 0 9 8 5 3 096918988501188 9 088 9 088 9 0888889
+ 919396989999 08991939698 088899193969899 0 9 9 08889 08890 08890 08889 0 8 9 0 7
+  9 0 7 9 0 8 950118889919497 1 4 7 8 9 9 8 6 3 0969390898888 0919497 1 5 7 0 6 3
+  0969290 08889929497 1 6 8 9 0 9 8 5 3 096918988 0 6 4 3 3 4 611121211 0121313 0
+  61314141110501288 9 088 9 088 9 0888889919396979898 08991939697 0888991939698 0
+ 9899 0 6 7 7 6 0 7 8 8 0 0 8 9 9 6 5 0 9 9 08889 08890 08890 08889 0 8 9 0 7 9 0
+  7 9 0 8 950129090889492908988888991949698 1 3 6 8 09496 0 2 08991939598 0 2 5 7
+  8 9 9 8 7 5 3 9 7 7501188 9 088 9 088 9 08894 08894 08888 0 9 9 08894 08891 088
+ 89 08889 08890 08891 08894 0 8 9 0 7 9 0 7 9 0 8 950138899 3 6 8 9 9 8 6 389 088
+ 99 3 7 8 08899 3 7 9 08888 08888 08889 08890 08890 08889 08889 0888950108890 7 9
+  089 6 088 5 089 9 08888 08888 08890 08890 08889 08889 0888950138890 7 9 089 6 0
+ 88 5 088 5 9 08890 7 9 089 6 088 5 089 5 9 08888 08888 08888 08889 08890 08891 0
+ 8889 08889 08889501188 9 088 9 088 9 089 8 08888 08888 0 9 9 0 9 9 08890 08890 0
+ 8889 08889 08889 0 8 9 0 8 9 0 8 9 0 7 9 0 7 950118898 9 08898 9 08898 9 08998 0
+ 8888 08888 0 9 9 08889 08890 08889 08889 08889 0 8 9 0 7 9 0 7 9 0 8 9501188 9 0
+ 88 9 088 9 0888894 0 9 9 3 08894 08891 08889 0 9 8 0 9 6 0 9 3501195 2 6 8 9 9 7
+  5 095 2 8 09595 2 6 0 2999695959699 2 4 7 8 9 9 8 7 5 2 09699 2 5 7 0959799 2 5
+  8 950108895 1 5 7 8 9 9 8 5 2 097969595969799 2 0889599 5 8 0 7 5 29997 0888895
+  2 0 9 7 5 2999695 08889 0889050 9999898 0 0989695959699 2 4 7 8 9 9 8 5 09799 2
+  5 7 0959799 2 5 8 950118899 3 6 8 9 9 7 5 08899 3 8 08888 2 6 0 2999695959699 2
+  4 7 8 9 9 8 7 5 2 09799 2 5 7 0959799 2 5 8 9 08889 0889050 9 4 3 2 09896959596
+ 99 2 4 7 8 9 9 8 6 09799 2 5 7 0959799 2 5 8 950 8908989919189888889919396 0 912
+ 1416 09295 0 912 088909295 0 81113151616151313151514 09595501195 9121516 095 913
+  09595 91315161615141212141413 0 2999695959699 2 4 7 8 9 9 8 7 5 2 09799 2 5 7 0
+ 959799 2 5 8 9501188 9 9 088 9 08888 9 0 2989695959698 1 6 096 0 4 8 098 3 6 8 9
+  9 7 5 08889 0889050 68890908888 08890 08989 0999795959698 1 6 096 0 4 8 098 3 6
+  8 9 9 7 550 68890908888 08890 08989 0999795959698 1 81113151616151313151514 096
+  1 81113 098 2 9121416501188 9 9 088 9 08888 9 0979696989896959596 0 1 0 1 1 2 3
+  7 8 8 0 3 7 8 0 1 2 8 9 9 8 5 08889 0889050 68899 3 6 8 9 9 7 5 08899 3 8 08888
+  2 6 08889 088905017999795959698 1 9 096 1 9 098 2 9 9 0 1989695959698 1 9 096 1
+  9 098 2 9 9 0 1989695959698 1 6 096 0 4 8 098 3 6 8 9 9 7 55012999795959698 1 9
+  096 1 9 098 2 9 9 0 1989695959698 1 6 096 0 4 8 098 3 6 8 9 9 7 55010959699 2 4
+  7 8 9 9 8 5 2 097969595 09799 2 5 7 0 7 5 29997 0959799 2 5 8 9 0 9 7 5 2999695
+ 5011999795959698 1 516 096 1 516 098 216 0 299979695959697 0 2 5 8 9 9 8 5 2 097
+ 99 2 5 7 0959699 2 5 7 9 01616 01516 01416 01416 0151650109516 09516 0959516 0 2
+ 999695959699 2 4 7 8 9 9 8 7 5 2 09799 2 5 7 0959799 2 5 8 9 01616 01516 01416 0
+ 1416 0151650 9999795959698 2 9 096 2 9 098 2 9 9 097969698989695959698 250 99897
+ 97999997969595969799 1 2 3 4 6 09699 0 0 1 2 3 0 4 8 09799 0 1 2 4 6 8 9 9 8 7 5
+  5 7 7 650 78899 3 6 8 9 9 7 5 08899 3 8 08888 2 6 095955012999795959698 1 6 096
+  0 4 8 098 3 6 8 9 9 8 6 3 095 3 6 8 9 9 7 5 095 3 8 09595 2 65010999795959698 1
+  6 096 0 4 8 098 3 6 8 9 9 8 6 399959596985015999795959698 1 6 096 0 4 8 098 3 6
+  8 9 9 8 6 3 095 3 6 8 9 9 8 6 39995959698 095 3 8 09595 2 65011999695959698 0 0
+ 9596 0 4 6 8 9 9 8 6 6 8 8 7 097 0 4 7 097969698989695959698 0 4 8 9 0 4 6 8 9 9
+  8 55011999795959698 1 6 096 0 4 8 098 3 6 8 9 9 8 6 2 095 9121516 095 913 09595
+  913151616151412121414135010959799 5 7 9 0979798 0 097969697 097959597 0 0 7 7 6
+  4 0 7 8 8 7 0 7 9 9 7 450118889919497 1 4 7 8 9 9 8 6 3 0969390898888 090929497
+  1 5 7 0 7 5 3 0969290 08889929497 1 6 8 9 0 9 8 5 3 096918988501192 9 9 08892 9
+  088 9 088919394 09293945011939292949492908988888991939597 3 5 9 0899193959799 0
+ 888991939597 3 0 7 6 6 7 7 6 0 6 8 8 0 6 9 9 8 6 5501193929294949290898888899193
+ 95969798 08991939596 088899193959798 0989899 0 2 5 7 8 9 9 8 7 5 3 3 5 5 4 0 0 2
+  5 7 09899 1 5 7 8 9501192 9 9 08892 9 088 9 088 3 350118898 08888 08989 0909089
+ 88 0989796969798 0 3 6 8 9 9 8 7 5 3 3 5 5 4 098 0 3 6 8 0969799 3 6 8 950119291
+ 9193939189888889919497 1 4 7 8 9 9 8 6 4 1999897979899 1 0919497 1 5 7 0 6 4 199
+  08889929497 1 6 8 9 0 9 8 7 4 0989750118894 088919499 2 5 9 0 1 5 9 094 0 3 5 9
+  9 091888891 0898991 0919090919190885011888990929597989897969491898888 08889 090
+ 929697 09798 09897 096949189 08988 08890929698 0989796949088 09899 1 3 6 8 9 9 8
+  7 5 2 09998 09899 099 1 3 6 8 0 8 9 8 0 7 5 2 0 09998 09899 1 3 6 8 9 0 9 8 7 5
+  199985011969899 0 0999896939189888889909396 0 3 6 8 9 9 8 6 4 4 6 6 5 098969391
+  0909296 0 3 6 0 0999793908988 088899196 0 3 5 8 950 6 6 7 8 9 9 8 7 6 6 0 7 8 8
+  7 750 6 9 9 8 7 6 6 7 9111213 0 7 8 8 7 7 0 9101250 6959697989897969595 0969797
+ 9696 0 6 7 8 9 9 8 7 6 6 0 7 8 8 7 750 6959697989897969595 09697979696 0 9 9 8 7
+  6 6 7 9111213 0 7 8 8 7 7 0 9101250 6888889 2 08989 2 08990 2 0888990 2 0 6 7 8
+  9 9 8 7 6 6 0 7 8 8 7 75011939292949492908988888991939596979899 1 2 2 08889 089
+ 9193959697 08889919395969899 1 2 0 6 7 8 9 9 8 7 6 6 0 7 8 8 7 750 6888990929495
+ 9594939292 0899192 0939494939350 69191908988888991939495 08990908989 09192945013
+ 97969698989695959698 6 8 9 9 8 6 4 2 1 098979593918988899194 0 3 5 8 9 9 7 6 0 9
+  8 0 8 6 4 2 1 0 098 1 7 8 0 9 8 6 4 2 1 097 09497 0 4 7 8 8 750118413 08413 093
+ 9292949492908988888991949698 1 3 6 8 09496 0 2 08991939598 0 2 5 7 8 9 9 8 7 5 3
+  3 5 5 45012841616 084841650 8848587909397 1 6101316 0909397 210 0848689929497 1
+ 10 0 211141650 88487909499 3 710131516 09098 3 710 084868998 09099 3 6 811141650
+  9888999 0 088 0 0888999 0 091919797 09197 091929697 091919797 09197 09192969750
+ 139999 0 099 0 0501391 8 8 09191 8 09999 0 099 0 05013959596 0959696 0 3 3 4 0 3
+  4 450 5888995 08995 08889955010888995 08995 0888995 0888995 08995 088899550 888
+ 899193959696959391898888 088919596938988 08889939695918850
diff --git a/bin/build_fonts/unix/in_fnt07a.chr b/bin/build_fonts/unix/in_fnt07a.chr
new file mode 100644
index 0000000..335e418
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt07a.chr
@@ -0,0 +1,232 @@
+ 99  -9  21 ;GOTHIC ENGLISH-UPPER CASE                                  
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   14007440444274183   1412043924253
+ 42814309435839434349393142443425346834963545360336453699375937983870395839814090
+ 437541054038   1   3  64 175 245 318 413 505 593 706 774 840 9561042115012351315
+ 1386148615951690176218521925202120872174   1   1   1   1   1   12232228623312367
+ 24092442248425412589262526652716273928072853289429492994303330933122317032073265
+ 33253386   1   1   1   1   14457
+ 925089949698 0 1 8 9115099 0 7 8 9 750969899 6 7 8 91150949597989950989850959798
+ 5089919396985092969750899295969850 0945096 4508890929597995093965090929497995095
+ 949393919090919393509494509194509595949350 099989850999950 0 0999850 0 6 8 9 9 7
+  350 6 8 850 4 6 7 7 550 5 8 9 950 7 8 850 5 6 7 750929598 2 5509497 2 4509296 1
+  3 5 7 950 3 350 3 750 3 7508796949291909091929598 1 4 6 8 950929191939699 2 550
+ 9694939292939699 2 5 7 950989850999950 0 099985098 0 3 5 7 850 2 4 650 1 3 5 7 8
+ 50 5 5508991 5 7 8 85093 5 7 750919294 5 6 6509796959593929293959550969650939650
+ 9797969550919497 1 4509396 1 3509195 0 2 4 6 850 0 050 0 2 4 650 0 2 4 650899193
+ 959799509496509193959799509695949492919192949450959550929550969695945099 0 1 2 4
+  6 950 2 4 6 850 0 1 3 5 7 95099 0 1 2 4 650 2 4 550 0 1 3 4 6509396 0 5 9509598
+  5 8509397 4 7 9509999508892949799 15095985092949699 150989796969493939496965097
+ 97509497509898979650 1 1 0999593918950 2 250 2 6509897959250 3 3 650 6 3 3 29896
+ 94928950 1 3 6 8101150 5 7 950 4 6 8101150 6 650879694929190909192949699 3 6 8 9
+  9 8 7 5 3509291919250969493929293949650 7 8 8 750 3 5 6 7 7 6 5 350989850999950
+  0 099985098 0 3 5 7 850 2 4 650 1 3 5 7 850 7 3 350 3 750 3 7508890929597995093
+ 965090929497995095949393919090919393509494509194509595949350929598 1 3509497 0 2
+ 50929699 1 350 099989850999950 0 0999850 0 2 4 6 850 5 6 750 2 4 6 850 3 5 7 8 9
+  9 8 650 6 7 8 8 750 5 6 7 7 650 3 350 3 750 3 75091949699 2 45097 150949699 2 4
+ 50 1 0999997969697999950 0 05097 050 1 1 09950 7 5 4 4 3 19795939150 5 550 09997
+ 9450 7 6 6 5 3 1989693915090949699 2 45097 150949699 2 450 1 0999997969697999950
+  0 05097 050 1 1 09950 7 5 4 4 350 5 550 7 6 6 5 3 09794929293949594935092955088
+ 90929597995093965090929497995095949393919090919393509494509194509595949350929598
+  1 3509496 0 250929699 1 350 099989850999950 0 0999850 0 2 4 6 850 5 6 750 2 4 6
+  850 3 6 7 950 5 7 950 9 7 5 350 5 7 8 91050 7 850 5 6 7 8 91050 3 3508991939698
+  05094975091939598 050969594949291919294945095955092955096969594509396 0 5 95095
+ 98 5 8509397 4 7 950 1 0999950 0 050 1 1 09950 1 3 5 7 950 6 7 850 3 5 7 950 5 5
+ 50869493929290898990929250939350909350949493925087899193959697509093955087899294
+ 959697509498 2 2 3 45098 1 1 0 1 2 15098 1509697 0 0975097 0 099 1 4 550 2 61010
+ 111250 6 9 91150 6 950 4 5 8 8 550 5 8 8101250979750 5 55087899193959799 4 6 750
+ 959798 4 75091939597 2 4 5 750 4 6 8101150 5 7 950 4 6 8101150939190909193509193
+ 5089919396985092959750899295969850939350 7 750 0 1 3 5 750939599 150879694929190
+ 909192949699 1 4 6 8 91010 9 8 6 4 3 097509291919250969493929293949650 8 9 9 7 6
+ 50 4 6 7 8 8 7 5 3509797509898509999989750 3 350 3 5 6 850 3 5 6 850909394959593
+ 929293959592959597509596965093965093959697975097 0 4 8 850 4 7 750 2 3 6 650 0 3
+  650 1 3 550 0 2 4 6 850 0 050 0 2 4 650 0 2 4 650879694929190909192949698 2 4 6
+  8 91010 9 8 6 4 3 097509291919250969493929293949650 8 9 9 7 650 4 6 7 8 8 7 5 3
+ 509797509898509999989750 3 350 3 5 6 850 3 5 6 8509899 0 2 6 8 950 2 4 6 750 0 1
+  4 6 8 9508890929597995093965090929497995095949393919090919393509494509194509595
+ 949350929598 0 3509496 0 250929699 1 350 099989850999950 0 0999850 0 3 5 7 8 8 7
+  6 2 050 5 6 7 7 650 3 5 6 6 5 250 2 4 5 8 91050 5 7 950 2 4 6 8105089 3 2 09750
+  4 250 5 197949392939497 5 7 8 8 750939497 6 8 9 9 85093939497 7 91010 7 3509192
+ 94 3 4 4 3509294 2 35091919294 1 3 350919498 1 4509396 0 3509195 0 350 5 3 150 0
+ 985097959392929350879291909091939598 1 4 6 8 9509192949699 2 55092919192949699 2
+  5 7 95090919397 3 7 95098 2 65090919396 2 5 7 950 1 0989850999950 0 0999850 5 5
+ 50889092949799509396509092959799509392919192939598 1 4 6 8105092939699 250939292
+ 93949699 3 650 399989850999950 0 0999850 3 5 7 810 8 8 91050 7 8 7 6 7 7 950 5 6
+  650 3 350 3 650 3 65089929394949291919294949250949595509295509699 1509294959696
+  0 350929598 0 3 6 850 0 3 5 7 810 8 850 7 8 7 6 7 750 5 6 650 0 050 0 2 4 650 0
+  2 4 650879091929290898990929290509293935090935094969850909293949497995090939697
+ 99 2 4 5 7105097 0 2 2 5 750 0 1 1509799 0 09950 5 650 5 8101050 8 9 950 5 7 8 8
+  750979750 5 55097 05097 050 5 850 5 850899092949697 5 6 8509596 4 550929495 3 4
+  6 81050 5 7 91050 5 6 850 4 5 7 91050909193959650929495509091939550 5 150999550
+ 949850 1 65089929394949291919294949250949595509295509699 1509294959696 0 3509295
+ 98 0 3 650 0 3 5 7 810 8 8 7 5 3999450 7 8 7 6 7 750 5 6 6 850 6 4 150 7 4989450
+  0 050 0 2 4 650 0 2 4 65090 6 5 097959250 49650 8 5 3 0959450929497 3 8509397 1
+  5509296 0 4 6509496 0 4 8509599 3 7509297 3 6 850959950 2 65092989695959698 0 3
+ 50959697995096969799 0509698 1 3 4 6 5 5 6 75097969950 2 5 4 4 550959798 0 3 3 5
+  75095 05091949595935096959696995094979799 05093959798 0 3 55097 0 2 3 4 6 7 5 5
+ 50 2 4 450 0 1 3 3509296969495979850979799509898 0 199985096 0 2 3 5 650 1 2 450
+ 98 0 2 4 65091 0989595935096969950 0979799 05093959798 0 3 550959899 5 550989697
+ 98 4 45095 3 3509296969495979850979799509898 0 199985096 0 2 5 39850 1 45098 0 3
+ 509296969495979850979799509898 0 19998509699 1 2 4 550 0 1 3509899 1 3 550939650
+ 98 2509195959394969798 0 35096969850979799 0509597 0 2 3 5 7 5 5 4 2 099979550 1
+  4 450 1999850 0 1 3 3 4 450 2 1999795509194959593949697509695969698509497979997
+ 5097 0 2 3 4 6 7 5 5 3 250 2 4 4 350 0 1 3 3 2 2 3 4 25095 098 0 2 050 099 1 050
+  099979999 1 350 0 1 099 0 0 150 0 1 3 1 1 2 35095 098 0 2 050 099 1 050 0999799
+ 99 1 250 0 1 099 0 0 150 0 1 3 1 1 2 2 09898 05091949595939496975096959696985094
+ 979799975097 0 2 4 19750 1 350 0 250 1 2 4 5 650 1 2 3 450 0 1 2 4 6509598999997
+ 98 0 150 099 0 0 25098 1 1 3 4 2 15087899091918990929350919292945089919393959350
+ 93969899 1 1 3 15098 0 0 2509697999998 0 150 1 4 6 7 81011 9 9101150 6 8 8 950 4
+  5 7 7 911509193949595939496975095969698509395979799975097 0 2 3 4 6 7 5 5 6 750
+  2 4 4 550 0 1 3 3 5 750919595935096969950979799 05093959798 0 3 5509597 0 2 3 5
+  7 5 550 1 4 450 0 1 3 3509194959593959550959696979650969799509496979799 0509798
+  0 3 550979798955097 0 2 3 4 6 7 5 550 2 4 450 0 1 3 350919595935096969850979799
+  0509394969798 0 3509597 0 2 3 5 7 5 550 1 4 4 3 450 0 1 3 3 2 55092949596969495
+ 979850959797995094969898 0 199985098 2 3 5 650 1 2 450 0 2 4 65092959597 3 5 550
+ 969650 4 4509897979950 1 3 3 2509598 0 2 4 55099 15098 0 2 450 5 2 098969450 199
+ 50 2 0979450 5 4 2979450959899999798 0 150 099 0 0 25098 1 1 3 4 2 150969950 1 4
+ 509193949595935094969698509395979799 0509394969798 0 350 3 4 6 7 5 5 6 750 2 4 4
+  550 3 1 3 3 5 7509194959598 0 3 55095969699509496979798 050 3 4 6 7 5 550 2 4 4
+ 50 3 1 3 350879091919496995091929295509092939394965099979999 2 4 7 95098 0 0 350
+ 99 0 2 1 1 2 450 7 81011 9 950 6 8 850 7 5 7 7509093949697 1 2 4 6509597 2 45093
+ 959798 2 3 5 650 0 3 4 6 750 3 4 550 2 4 6 7509996959392509695945097959392509598
+ 50 1 4509193949595935094969698509395979799 0509394969798 0 350 3 4 6 7 5 5 4 2 0
+ 99979550 2 4 450 1999850 3 1 3 3 4 450 2 19997955091 69450949699 2 6509597 15094
+ 9698 2 6509498 1 4 65099 3 5509498 2 4 65096 45090949492509595985096969899509496
+  1 350 1 2 4 450 2 5 550 3 4 6 8 6 6509294969799 4 65090979899999750999899 0 0 2
+ 5097 0 1 1 3 4509798 0 1 2 4509094969899 1 4 65098 050949698 0 150 4 450 5 550 6
+  69996949393509397 1 4 8509699 4 7509398 3 6 8509094959798 0 4 650979950949698 0
+ 50 4 450 5 550 6 6 4 1995099 1 4 6 650 5 550 4 45093959799 05097995093959798 0 4
+  65090 39393 250 4 8 9 9 850949450959550 2 2 050 3 4 3 3 550 3 5 4 4 6 750 0 1 3
+  4 5 7509094945094 65095 45094 3 5 650 4 3 1979450 1 2 4 450 3 5 550 4 5 7 8 6 6
+ 5093959799 05097995093959798 0 4 65090949492509595985096969899509496 0 2 3 5 650
+  1 350 0 2 4 6509697 1 3 450 1 2 4 450 3 5 550 4 5 7 8 6 6509294969799 4 6509093
+ 9598 3 8509497 2 5509397 0 4 850 8 7 5 19998989950 09999 050 3 1 0 0 19950909494
+ 509595509696509496 1 3 450 1 2 4 450 3 5 550 4 5 7 8 6 6509496 4 650 6 496945094
+ 949250959598509696989950 4 450 5 550 6 6509294969799 4 6509094949250959597509696
+ 9899509496 1 350 1 2 4 450 2 5 550 3 4 6 8 6 650929395969799 3 45093959799 05097
+ 995093959798 0 4 65094 098 0 2 050 099 1 05094 0 098 0 1 1 09850 099 0 05094 098
+  0 2 050 099 1 050 098 0 2 050 099 1 05094 098 0 2 050 099 1 050 0 098 0 1 1 098
+ 50 099 0 05094 0999799 050 0 1 099 0 050 0 1 3 1 050 098 0 2 050 099 1 050919495
+ 9699 1 4 5 6 6 5 3 150959650 4 5 5 450949696979950 1 3 4 4 3 150 0 0 199 050 098
+  0 2 050 099 1 05094 2 09999 0 2 0 050 0 0 1 05094 0 098 0 1 1 09850 099 0 05087
+  7 8 91050 6 7 950 6 7 8 91050 7 150 09490965097 1979298 2 4 6 8 91050949150 097
+ 509398 2 4 6 950959150 096509399 3 4 6 9105090989850 2 250 2 4 5 5 7 6 5 2989593
+ 939497 3 5 6 6 550 6 550949597 3 5 6509594509594949597 3 6 7 7 6 5 2989594939595
+ 96985089 9919250 910925093 3 1999796969799 1 35099989797989950 1 099989899 0 150
+ 939799 1 3 4 4 3 1999750 1 2 3 3 2 15099 0 1 2 2 1 0995092 099 1 050 0 050 0 199
+  0509596 4 55095 5509595 5 550 5 4969550 59550 5 59595508892 9 9509292 95088 0 0
+  150 0 1 15092 9 9509292 9508892 9 9509292 95092 9 9509292 95096 1 0 050 1 050 1
+  2 050919695955096955096979550 5 4 450 5 450 5 6 45093999796969799 1 3 4 4 3 199
+ 50999697 1 4 39950 1979699 3 4 150
+  850119189888889 5 6 6 08990 6 8 7 6 0898990 6 8 9 9 6 09594939394 09495 0949496
+  0 9 7 6 6 7 0 7 7 8 0 9 8 8 9 7 092 6 0 1 150129088888988 08989 09089909088 093
+ 9496979798 09999 5 095 3 09898 093 2 4 5 0919294 3 093 1 091 0 2 3 0918889919395
+ 97 0899193 08990919496 09698 0 6 098 0 5 0969799 6 0 9 7 6 6 7 0 8 7 7 8 0 9 8 8
+  9 7 6 6 097 6 0 0 0 0 3 350118990929497 1 4 6 8 9 9 8 7 5 3 09396 1 5 7 8 8 7 0
+ 89919396 0 3 6 7 7 6 5 3 092 4 092 2 091 1 3 4 0929188898988 0899090 09091919088
+  091 6501288888991 6 0898991 5 08889909091 6 0939496979798 09999 4 095 2 09898 0
+ 93 1 3 4 0 9 7 6 6 7 0 8 7 7 8 0 9 8 8 9 7 6 6 090 6 095969695 0 1 0 0 150119088
+ 888988 08989 09089909088 0939496979798 09999 5 095 3 09898 093 2 4 5 09592908988
+ 8889 090898990 0929190909189 0 3 098979798 0989899 0 09999 098 0 9 7 6 6 7 0 8 7
+  7 8 0 9 8 8 9 7 095 650119088888988 08989 09089909088 0939496979798 09999 4 095
+  2 09898 093 1 3 4 092 7 8 8 6 6 7 9 092 6 09898 0 8 8 7 7 0919797 09999 5 7 9 9
+  8 8 9 0929188898988 0899090 09091919088 091 550128990929497 0 3 5 7 8 9 9 8 6 4
+  199989797 09396 1 4 089919396 1 4 6 8 0 6 5 199 0 9 8 7 5 1999897 092 5 092 3 0
+ 91 2 4 5 0929188898988 0899090 09091919088 09097 9 0 1 1 0 4 450129088888988 089
+ 89 09089909088 0939496979798 09999 5 095 3 09898 093 2 4 5 0 9 7 6 6 7 0 8 7 7 8
+  0 9 8 8 9 7 0919294 3 093 1 091 0 2 3 09189888889 0898990 089899189 09796949598
+  2 6 9 0959698 3 6 0969698 3 9 097 7 0 0 0 0 3 350109088888988 08989 09089909088
+  0939496979798 09999 4 095 2 09898 093 1 3 4 0909295 6 8 8 6 6 7 9 093 5 0 8 8 7
+  7 09092 4 6 8 9 9 8 8 950109088888988 08989 09089909088 0939496979798 09999 4 0
+ 95 2 09898 093 1 3 4 0909295 6 8 093 5 09092 4 6 8 9 9 8 6 4 3 3 4 5 5 0 4 45012
+ 9088888988 08989 09089909088 0939496979798 09999 5 095 3 09898 093 2 4 5 0 9 7 6
+  6 7 0 8 7 7 8 0 9 8 8 9 7 0919294 3 093 1 091 0 2 3 09189888889 0898990 0898991
+ 89 097949596 0959696 09699 1 3 0 1 2 6 8 8 0 4 8 0 1 2 8 9 9 8 097 7501190888889
+ 88 08989 09089909088 0939496979798 09999 5 095 3 09898 093 2 4 5 0 9 7 6 6 7 0 8
+  7 7 8 0 9 8 8 9 7 0919294 3 093 1 091 0 2 3 09189888889 0898990 089899189 089 6
+ 5014929395979798 09999 3 094 1 09898 092 0 2 3 0 9 7 6 6 7 7 6 0 7 7 8 0 9 8 8 9
+  9 8 6 0928892 5 7 7 08992 6 7 8 7 6 09898 09090939797 09999 6 7 9 7 6 0928892 5
+  7 7 08992 6 8 09898 09090939797 09999 7 9 7 090 6 090 65012918988888992 3 6 7 0
+ 899193 5 8 089899093 4 7 8 9 09091919088 0899090 09088898988 0979798 09999 09898
+  0 9 7 6 6 7 0 7 7 8 0 9 8 8 9 7 089 6 091 9 09495969695 0 2 1 1 250138889919396
+  0 3 5 7 8 9 9 8 7 5 3 09693918988899192 09295 1 4 088909295 1 4 6 8 0 4 1959190
+  0 8 6 4 195939089 092 5 092 3 092 2 4 5 089 8 095969695 0 1 0 0 150128889919797
+ 98 09999 7 9 81614 0909214 09898 08889909214 093918892 6 08992 6 0909093 7 0 6 6
+  7 0 7 7 8 0 8 8 9 7 6 09113 095969695 0 1 0 0 150138889919396 0 3 5 7 8 9 9 8 7
+  5 3 09693918988899192 09295 1 4 088909295 1 4 6 8 0 4 1959190 0 8 6 4 195939089
+  092 5 092 3 092 2 4 5 089 8 095969695 0 1 0 0 1 0 9 8 8 9141515 010131515 0 8 9
+ 1516161550129088888988 08989 09089909088 0939496979798 09999 5 095 3 09898 093 2
+  4 5 0 9 7 6 6 7 0 8 7 7 8 0 9 8 8 9 7 0919294 3 093 1 091 0 2 3 091898889919496
+ 9799 0 08989919596 0899092959799 099 0 1 6 7 7 0 2 6 8 099 1 7 9 7501291908988 0
+ 9089 0898888899092949596969798 0 3 093949595969799 1 09092939494959799 3 9 09798
+ 9999 0 1 3 099 0 0 1 09798 0 1 1 2 3 0 9 7 6 6 7 0 8 7 7 8 0 9 8 8 9 0899194 096
+ 99 0 1 3 4 4 3 45011929497 1 4 7 8 9 9 8 7 5 3 0 1 4 6 7 8 8 7 0929599 2 5 6 7 7
+  6 5 3 091898888898988 0899090 09190898991919088 0919293 4 093 2 092 1 3 4 091 6
+ 50129088888988 08989 09089909088 0929497 1 4 6 8 9 9 8 7 9 7 0 1 4 7 8 8 0929699
+  2 4 6 7 7 6 0919294 4 093 2 092 1 3 4 0919088899091 5 7 7 09190899091 6 8 09091
+  6 091 7 09696 0 0 05012888991979798 09999 6 7 09092 6 09898 0 7 7 8 088899092 6
+  6 7 0 7 7 8 9 7 6 6 092919088899091 6 09190899091 5 09091 6 092 6 095969695 0 1
+  0 0 15014888991979798 09999 6 7 09092 6 09898 0 7 7 8 088899092 6 6 7 0 7 7 8 9
+  7 6 7 9 7 6 0908890 6 6 7 08990 6 0909091 6 7 0 7 8 0908890 6 08990 6 0909091 6
+  7 090 6 090 6 09696 0 0 0 09696 0 0 050119189888889 7 8 8 08990 7 8 0898990 8 9
+  9 8 6 088898988 0899090 09091919088 0 9 7 6 6 7 0 7 7 8 0 9 8 8 9 08897 0 0 9 0
+ 9898 098985012888991979798 09999 6 7 09092 6 09898 0 7 7 8 088899092 6 6 7 0 7 7
+  8 9 7 6 092919088899091121416151414 09190899091 7 09091 6 9 0151414 014131314 0
+ 92 6 095969695 0 1 0 0 15010899197 1 5 9 093 4 0889296 0 6 8 09088898988 0899090
+ 89 09091919089 0 8 7 6 6 7 0 8 7 7 8 0 9 8 8 9 7 09898 0989850 9 0 2 4 6 8 9 7 6
+  0 4 6 7 8 0 2 4 6 7 7 098989796959798 6 7 7 0969797 0979796 7 8 09795969798 7 9
+  7 097 250 99092 6 7 0929089 6 8 09088 6 7 8 0 7 7 8 9 8 7 7 09897969596979798 7
+  09697 6 0979798 750 697 6 7 7 8 9 097 7 8 097 6 7 7 8 9 0979695969797 0969797 0
+ 979698989750 8959697 6 7 097 6 8 09597 6 7 8 0 7 7 8 9 8 7 7 090889197 7 0919089
+ 9197 6 09098 750 697 6 7 7 8 9 097 7 8 097 6 7 7 8 9 097969599 0 3 09699 09796 0
+ 50 590 6 7 7 8 9 090 7 8 090 6 7 7 8 9 0908988899090 0899090 09089919190 09595 0
+ 959550 997 6 7 7 8 9 8 7 6 098 7 8 097 6 7 7 0979796959697979810131516151414 096
+ 9810 0151414 0969798 81113 0151413131450 99092 6 7 7 8 9 0929089 7 8 09088 6 7 9
+  09897969596979798 7 911 09697 7 9 0979798 7111416161450 58890919088 089909089 0
+ 95969798 7 9 7 09897969798 7 8 095969798 6 7 750 58890919088 089909089 095969798
+  7 911 09897969798 7 9 095969798 711141616151650 89092 6 7 7 8 9 0929089 7 8 090
+ 88 6 7 9 098969598 0 3 09698 09699 0 0 1 6 7 7 0 1 2 7 8 0 1 2 7 9 750 59092 6 7
+  7 8 9 0929089 7 8 09088 6 7 7 8 95013979798 6 7 7 8 9 09697 7 8 0979597 6 7 9 0
+ 9897969597 6 7 9 09697 7 8 0979798 6 7 8 9 09897969596979798 6 7 7 09697 7 8 097
+ 9798 7 9 750 9979798 6 7 7 8 9 09697 7 8 0979597 6 7 9 09897969596979798 6 7 7 0
+ 9697 7 8 0979798 7 9 750 997 6 7 098 6 8 097 6 7 8 0 7 7 8 9 8 7 7 0979796959697
+ 9798 7 09698 6 0969798 750 99597 6 7 716 09697151412 0 7 7 8 0959697 6 7 8 0 8 9
+  8 7 7 0 8121416 09897969596979798 7 09697 6 0979798 750 997 6 7 098 7 8 097 6 7
+  7 0 7 7 8 9 8 7 6 0979796959697979816 09698151412 096979812141650 6979798 6 7 7
+  8 9 09697 7 8 0979597 6 7 7 8 9 09795969797 0969797 09698989750 897 1 2 2 3 7 0
+ 97 1 0 3 7 09697 1 2 0 2 3 7 8 0979695969695 09696 096979796 0 7 8 9 8 8 9 0 8 8
+  0 8 7 7 9 09597 0 5 950 59092 6 7 7 8 9 0929089 7 8 09088 6 7 7 8 9 09595 09595
+ 50 9979798 6 7 09697 7 8 0979597 6 7 7 0 7 7 8 9 8 7 6 09596979798 6 7 7 09697 7
+  8 0959798 7 9 750 99597 6 9 7 6 6 09697 6 8 0959697 5 6 7 09596979798 6 09697 5
+  0959798 650139597 6 9 7 6 09697 6 8 0959697 5 6 7 0959798 6 9 7 6 6 09697 6 8 0
+ 95969798 5 6 7 09596979798 6 09697 5 0959798 650 997979899 7 8 9 7 09697 7 8 097
+ 959697 5 6 7 7 0 195969695 0969797 097989795 0 3 9 8 8 9 0 8 7 7 0 7 6 7 9 0 2 2
+  0 2 250 9979798 6 7 09697 7 8 0979597 6 7 7 0 7 7 8 9 8 7 6 0959697979810131516
+ 151414 0969710 0151414 0959798 81113 0151413131450 995 9 09798989795 0969797 097
+ 95969695 0 9 7 6 6 7 0 7 7 8 0 9 8 8 9 7 0 2 2501090 6 7 091 6 8 090 6 7 8 09090
+ 8988 0899091 7 08991 6 08889909091 7 0 7 7 8 9 8 7 75010909193 6 7 091908991 7 8
+  0908890 6 7 7 0 7 7 8 9 8 7501090908988899090 09089 09091919089 09098 09197 090
+ 989899 1 4 9 0 9 7 6 6 7 0 8 7 7 8 0 9 8 8 9 7501090908988899090 09089 090919189
+  09097 09196 09097979899 09899 0 0 7 0 1 6 0 0 7 0 7 6 6 7 8 0 7 8 0 7 7 8 9 8 7
+  750108898 3 3 0 3 3 4 2 3 098 2 096 3 089 6 7 0929089 7 8 0889092 6 7 7 0 7 7 8
+  9 8 750108897 08888 08989 090908988 09495969797 0969697 7 09596 6 09495969697 7
+  0 7 6 6 7 8 0 7 8 0 7 7 8 9 8 7 7501090 6 7 091 6 8 090 6 7 8 090908988899090 0
+ 8990 089919190 09898979695 0979798 7 09698 6 09596979798 7 0 7 7 8 9 8 7 7501090
+ 88898988 089909089 09091919088 088909397 0 3 6 9 099 2 5 8 09598 1 4 7 950109197
+  09296 09197 09191908988 090909197 0899096 0888990909197 09797 0 0 09797 0 0 0 0
+  6 7 0 1 6 8 0 0 6 7 8 0 0 7 0 1 6 0 0 7 0 7 7 8 9 8 7 750109099 0 091 0 1 09099
+  0 0 090908988 0899091 7 08991 6 08889909091 7 0 0 0 1 2 1 09999 0 7 6 6 7 8 0 7
+  8 0 7 7 8 9 8 7 750 6 6 8 9 8 6 0 7 8 8 750 61210 8 6 8101213 0 7 8 9 750 69597
+ 989795 096979796 0 6 8 9 8 6 0 7 8 8 750 69597989795 096979796 01210 8 6 8101213
+  0 7 8 9 750 688899091 2 09190899091 2 088899091 2 0 6 8 9 8 6 0 7 8 8 750 99290
+ 89888889909294969899 09290 090919596 09293918988 0888991959799 099 29999 2 0 6 8
+  9 8 6 0 7 8 8 750 68889919395939189 09294939250 69492908890929495 0899091895013
+ 96979796 0979898 09899999896 096 2 0 3 9 498 097938894 0 6 8 9 9 8 6 0 8 4 09389
+  09499 5 7 8 8 0 8 3 09489 09399 5 6 7 7 650108413 08413 08889919392908988888991
+ 949698 0 1 3 6 8 09290 094969799 0 2 0 7 5 0899193959698 0 2 5 7 8 9 9 8 7 5 4 6
+  8 95012841616 084841650 78486899398 2 7111416 0909397 3 710 086889197 3 9121450
+  78486899398 2 7111416 0909397 3 710 086889197 3 9121450 8888999 0 088 0 0888999
+  0 091919797 09197 091929697 091919797 09197 09192969750139999 0 099 0 0501391 8
+  8 09191 8 09999 0 099 0 05013959596 0959696 0 3 3 4 0 3 4 450 5888995 08995 088
+ 899550 9888995 08995 0888995 0888995 08995 088899550 788899193959696959391898888
+  088919596938988 08889939695918850
diff --git a/bin/build_fonts/unix/in_fnt08a.chr b/bin/build_fonts/unix/in_fnt08a.chr
new file mode 100644
index 0000000..29481e9
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt08a.chr
@@ -0,0 +1,106 @@
+ 99  -7  13 ;INDEXICAL COMPLEX ROMAN-UPPER CASE                         
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   11711176417771914   1187217571802
+ 18191788184016741836166717981354138313941430147014841518155515781630168316961854
+ 184718631727   1   3  22  58  83 110 133 154 191 219 232 252 280 295 326 348 381
+  407 455 493 526 543 564 580 605 627 648   1   1   1   1   1   1 665 698 728 753
+  786 813 834 877 906 925 949 977 99010351064109311261156117912061221125012661291
+ 13131337   1   1   1   1   11948
+ 955093 09550 0 450 0 55097 250939850 2 7509296965097975094 1 4 5 4 150 1 3 4 3 1
+ 5097 1 4 5 5 4 19450 1 3 4 4 3 15093 4 5 5 4 29997969595969799 2 4 5509997969697
+ 99509296965097975094 1 4 5 6 6 5 4 19450 1 3 4 5 5 4 3 15092969650979750 1 15094
+  4 4 35097 15094 4 4 35092969650979750 1 15094 4 4 35097 15094995093 4 5 5 4 299
+ 97969595969799 2 45099979696979950 2 3 450 4 450 5 550 2 75092969650979750 4 450
+  5 550949950 2 75097 450949950 2 75096 0 050 1 15098 35098 35094 1 1 09950 2 2 1
+ 999896959697965099 45092969650979750 5975099 450 0 550949950 2 750949950 2 75093
+ 97975098985095 05095 5 5 4509195955096 05096 050 5 050 5 550 6 650939650 5 85093
+ 9750 3 8509296965097 45097 450 4 450949750 2 650949850939997969595969799 2 4 5 6
+  6 5 4 2995099979696979950 2 4 5 5 4 2509296965097975094 1 4 5 5 4 19750 1 3 4 4
+  3 150949950939997969595969799 2 4 5 6 6 5 4 2995099979696979950 2 4 5 5 4 25098
+ 9899 1 2 3 4 5 650 2 3 4 5509296965097975094 1 4 5 5 4 19750 1 3 4 4 3 150949950
+  1 2 3 4 5 650 1 3 4 55093 4 5 5 4 3 1999796969799 2 4 550969799 2 4 5 5 4 2 098
+ 979696975093 0 050 1 150969595 6 6 55098 3509296969799 2 4 5 5509797989950949950
+  3 7509395 05096 050 5 050939850 2 75091949750959750 09750 0 350 1 350 6 3509297
+ 50 4 8509396 45097 550 59650949950 2 750949950 2 7509496 0 05097 150 5 1 1509499
+ 50 2 75098 35094 49650 59750979696 55096 5 5 45094999898979799 2 4 4 5 650 2 3 3
+  550 3 098979798 1 2 350 098989950929696509797509798 0 2 4 5 5 4 2 0989750 2 3 4
+  4 3 25094975094 4 3 3 4 4 3 1999796969799 1 3 4509998979798995094 4 450 5 550 4
+  3 1999796969799 1 3 45099989797989950 2 550 4 7509497 4 4 3 1999796969799 1 3 4
+ 50 3 3 1509998979798995094 2 3 3 4 4 2 0989850 099995096 15096 1509499979799 1 3
+  3 199509998989950 1 2 2 150 2 3 45098979798 2 4509798 2 4 4 2989696985092969650
+ 9797509798 0 2 4 5 550 2 3 4 450949750949950 2 75096 0 0 1 1 050 0 050 1 15098 1
+ 5098 35096 1 1 2 2 150 1 1 050 2 2 09897979898975099 25092969650979750 59750 0 4
+ 50 1 550949750 2 750949950 2 75096 0 050 1 15098 15098 3508892925093935093949698
+  0 1 1509899 0 050 1 2 4 6 8 9 950 6 7 8 85090935090955098 350 61150929696509797
+ 509798 0 2 4 5 550 2 3 4 450949750949950 2 75094999796969799 2 4 5 5 4 299509998
+ 9797989950 2 3 4 4 3 250929696509797509798 0 2 4 5 5 4 2 0989750 2 3 4 4 3 25094
+ 975094995093 3 350 4 450 3 2 0989695959698 0 2 35098979696979850 1 6509397975098
+ 98509899 1 3 4 4 3 3 45095985095 05094 2 3 3 4 4 299979799 2 4509799 2 4 4 29997
+ 9798989950949898 0 2 3 3509999 05096 2509296969799 1 3 4509797989950 4 450 5 550
+ 949750 2 550 4 7509396 05097 050 4 050949950 2 65091949750959750 09750 0 350 1 3
+ 50 6 350929750 4 8509396 35097 450 49650949950 2 650949850 1 6509396 05097 050 4
+  0989695949495959450949950 2 65094 39650 49750979696 45096 4 4 35094999796969799
+  2 4 5 5 4 2995099989797989950 2 3 4 4 3 2509498 1 150 0 05097 45094979796969799
+  2 4 5 4 29997969650 2 3 4 3 250969798 1 4 55098 1 4 5 55094979796969799 2 4 5 4
+  250 2 3 4 3 250 0 2 4 5 5 4 299979696979750 2 3 4 4 3 25094 1 150 2 250 295 650
+ 99 4509497965097 45097 1 450969799 2 4 5 5 4 299979696979750 2 3 4 4 3 25094 4 4
+  5 5 4 2 0989796969799 2 4 5 5 4 2999650 0989797989950 2 3 4 4 3 25094969650 4 0
+ 9850 5 299509698 0 3509698 0 3 450949997969799 2 4 5 4 29950999897989950 2 3 4 3
+  250999796969799 2 4 5 5 4 25099989797989950 2 3 4 4 3 25094979796969799 1 3 4 5
+  5 4 2999796969799 2 550 1 3 4 4 3 2509998979798995096 099 0 1 05096 1 099 0 1 1
+ 995096 099 0 1 050 099 0 1 05096 099 0 1 050 1 099 0 1 1995096 099 0 1 050 0 050
+  099 0 1 0509496979796969799 2 4 5 5 4 1 0 0 150 2 4 4 3 150 0 0 1 1 05097 0 050
+  1 05094979750989750 3 350 4 3509599989899 1 2 2 1995095 0 05097 350 3975093 695
+ 5095 3 199989899 1 350 1 09999 0 150959799 1 2 2 199975099 0 1 1 099509194 65091
+  0 05094 6509194 65094 6509699 0 1 09999 1509699 1 1 099 0 15092 7 6 6 7 7 6 5 4
+  3 2 199979594949597 0 1 1 098979798 3 5 6 75097959597509798 4 55093999950 2 250
+  5 4 4 5 5 398969697 4 5509697 4 5 5 4 29997969697979650
+  550 793 6 096 6 093 6 0 2 2 0 6 6 0 6 650 893 6 093 6 0939394969899 09394969899
+  09999 0 2 3 5 6 6 099 0 2 3 5 650 7949397949393949598 1 4 5 6 6 5 3 0939598 1 4
+  650 893 6 093 6 09393949598 1 4 5 6 6 093949598 1 4 5 650 793 6 093 6 097 1 093
+ 939793 09999 0 6 6 2 650 693 6 093 6 097 1 093939793 09999 0 6 650 9949397949393
+ 949598 1 4 5 6 6 5 0939598 1 4 6 0 6 5 3 0 1 6 0 1 6 0 1 150 993 6 093 6 093 6 0
+ 93 6 09393 09393 09999 0 6 6 0 6 650 593 6 093 6 09393 0 6 650 693 3 5 6 093 3 5
+  6 6 5 3 2 3 4 0939350 893 6 093 6 093 1 099 6 099 6 09393 09393 0 6 6 0 6 650 6
+ 93 6 093 6 09393 0 6 6 2 6501093 6 096 6 093 3 093 6 093 6 093 6 09393 09393 0 6
+  6 0 6 650 893 6 095 6 093 4 093 6 09393 09393 0 6 650 893949598 1 4 5 6 6 5 4 1
+ 9895949393 0939598 1 4 6 0 6 4 198959350 793 6 093 6 0939394969799 0 0 093949697
+ 99 0 0 6 650 893949598 1 4 5 6 6 5 4 19895949393 0939598 1 4 6 0 6 4 1989593 0 5
+  3 2 2 3 8 9 9 8 0 3 6 8 950 893 6 093 6 0939394969799 0 0 09394969799 0 0 6 6 0
+  0 1 5 6 6 5 0 0 1 5 650 8959397959493939495979899 0 1 2 096979899 0 1 4 5 6 6 5
+  4 2 6 450 893 6 093 6 0939793939793 0 6 650 993 3 5 6 6 5 393 093 3 5 6 09393 0
+ 939350 793 6 093 3 093 6 09393 0939350 993 6 093 2 093 6 093 6 093 2 093 6 09393
+  0939350 893 6 093 6 093 6 09393 09393 0 6 6 0 6 650 793 0 6 093 0 093 0 6 09393
+  09393 0 6 650 793 6 093 6 093979393 0 6 6 2 650 89798999998979799 5 6 6 09799 5
+  6 0 0 1 2 3 5 6 6 5 3 0 1 3 5 650 793 6 093 6 0 098979798 0 3 5 6 6 5 3 09798 0
+  3 5 6 0939350 69999 0 09998979798 0 3 5 6 6 5 4 09798 0 3 5 650 993 6 093 6 0 0
+ 98979798 0 3 5 6 6 5 3 09798 0 3 5 6 09393 0 6 650 6 1 1 098979798 0 3 5 6 6 5 4
+  0 19997 09798 0 3 5 650 59394959594939395 6 09395 6 09797 0 6 650 79799 1 3 3 1
+ 999797 09799 1 3 0 3 19997 0989797 0 2 3 6 7 7 8 0 5 6 6 7 91010 9 7 650 993 6 0
+ 93 6 0 098979798 0 6 09798 0 6 09393 0 6 6 0 6 650 59394949393 097 6 097 6 09797
+  0 6 650 59394949393 097 810 097 81010 9 8 8 9 9 0979750 893 6 093 6 097 3 0 1 6
+  0 1 6 09393 09797 0 6 6 0 6 650 593 6 093 6 09393 0 6 6501397 6 097 6 0 0989797
+ 98 0 6 09798 0 6 0 098979798 0 6 09798 0 6 09797 0 6 6 0 6 6 0 6 650 997 6 097 6
+  0 098979798 0 6 09798 0 6 09797 0 6 6 0 6 650 79798 0 3 5 6 6 5 3 0989797 09798
+  0 3 5 6 0 6 5 3 0989750 79710 09710 0 098979798 0 3 5 6 6 5 3 09798 0 3 5 6 097
+ 97 0101050 79710 09710 0 098979798 0 3 5 6 6 5 3 09798 0 3 5 6 0101050 697 6 097
+  6 0 09897979899999898 09797 0 6 650 79798999998979798 0 1 2 3 099 0 1 2 5 6 6 5
+  4 4 5 650 593 4 6 6 5 4 093 4 6 0979750 997 3 5 6 6 5 3 097 3 5 6 097 6 097 6 0
+ 9797 09797 0 6 650 797 6 097 4 097 6 09797 0979750 997 6 097 3 097 6 097 6 097 3
+  097 6 09797 0979750 797 6 097 6 097 6 09797 09797 0 6 6 0 6 650 797 6 097 4 097
+  6 91010 9 8 8 9 9 09797 0979750 697 6 097 6 097999797 0 6 6 4 650 7939497 2 5 6
+  6 5 297949393 0939497 2 5 6 0 6 5 297949350 79693 6 094 6 0 6 650 7959696959493
+ 9394969899 0 1 3 6 09394969899 0 5 4 4 5 5 4 0 4 6 6 4 350 795969695949393949698
+ 99 09394969899 09999 0 2 3 5 6 6 5 4 3 3 4 099 0 2 3 5 650 795 6 093 6 093 2 2 0
+  6 650 79399 09393 0949493 09998979798 0 3 5 6 6 5 4 3 3 4 09798 0 3 5 650 79596
+ 9695949393949598 3 5 6 6 5 3 1999898 0 0939598 3 5 6 0 6 5 3 1999850 79397 095 2
+  6 09399 6 095939395 0959494959550 79394969899999896949393 09394969899 099989694
+ 93 099 0 2 3 5 6 6 5 3 2 099 099 0 2 3 5 6 0 6 5 3 2 09950 7 4 3 3 4 5 6 6 5 4 1
+ 96949393949698 0 1 199 0 6 4 1969493 093949698 0 150 4 4 5 6 5 450 4 5 6 5 4 5 7
+  950 49798999897 0 4 5 6 5 450 49798999897 0 5 6 5 4 5 7 950 49394 19493 09497 0
+  4 5 6 5 450 7969697979694939394969799 0 1 2 2 093959899 0 0 5 6 6 5 550 49398 0
+ 939850 69398 09398 09398 0939850 593949697979694939350 59298 09397 0939750 89010
+ 50 590929598 2 5 810 0929498 2 6 850 590929598 2 5 810 0929498 2 6 850 9 0 050 9
+ 94 6 0 0 050 99898 0 2 250 49495949394969850 49395979897969750 99898999998979798
+  2 4 5 6 6 5 4 2 1 09896949393949699 5 6 6 5 0 6 4 2 0 09698 5 650 89010 09010 0
+ 94949595949393949698 1 2 09697 0 2 4 5 6 6 5 4 3 3 4 450
diff --git a/bin/build_fonts/unix/in_fnt09a.chr b/bin/build_fonts/unix/in_fnt09a.chr
new file mode 100644
index 0000000..88d0850
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt09a.chr
@@ -0,0 +1,82 @@
+ 99  -9  21 ; SIMPLEX SCRIPT-UPPER CASE                                 
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  24  66  91 127 156 185 215 254 280 306 346 376 422 455 485
+  517 550 589 618 644 678 711 737 774 813   1   1   1   1   1   1 854 877 901 916
+  941 959 98410131043106010811115113411681192121612411269128513021319133913571383
+ 14041428   1   1   1   1   11451
+ 92508989919497 1 4 4 3 19996949393949699 2 75088 1 2 2 1 09997959392919192939496
+ 98 0 3 6 8 9 9 8 7 5 250 1 2 5 6 7 7 6 5 3 098975090 2 2 3 5 7 8 8 7 5 299979594
+ 939394959799 2 4 55089 2 0999897969593918988888991939598 1 4 6 8 9 9 8 7 5 2 0 0
+  1 3 5 8105090 4 4 5 7 8 8 7 4 09796969798 19895949393949598 1 4 6 75090 0989695
+ 9699 2 6 91150 6 4 2 09896949291919294965099 850898991959899 0 099989796969799 3
+  6 7 8 8 7 6 4 19794929191508895939292939596989999989694929089895095 4 6 9111212
+ 1110 8 6 4 3 3 4 5 7 8105091 5 3 1 09999 0 1 3 4 5 5 4 2 19997959392929395975092
+  2 098979798 0 2 3 4 4 3 0989796949393949698 1 550889593929293959698999998969492
+ 9089895012121110 8 6 4 2 09850 0 1 1 2 3 4 6 7 950919597 1 4 6 7 7 6 4 3 2 1 099
+ 98969492919192949699 2 4 7 950828785848485878890919190898750899294959798 0 1 1 0
+ 99975099 2 4 5 7 810111110 8 8 91012131550879290898990929395969695949250949799 0
+  2 4 6 7 7 6 4 4 5 6 8 9115090 299979594939394959799 2 4 6 7 8 8 7 6 4 2 0 0 1 3
+  5 8105088 1 2 2 1 0999795939291919293949698 0 3 8101112121110 8 5 3 25090 3 2 1
+ 999796969799 2 5 7 8 8 7 5 198969391909091939598 1 4 7 95088 1 2 2 1 09997959392
+ 91919293949698 0 3 7 910111110 9 7 4 1 2 3 3 4 6 8 91150909092949799 1 2 2 1 099
+ 989899 1 4 6 7 7 6 5 298959392925090 09896959699 2 6 91150 6 4 2 098969492919192
+ 949650879290898990929395969695949393949698 0 1 3 6 850 6 5 4 4 5 6 8 91150889391
+ 909091939496979796959494959799 2 4 6 7 8 8 7 6 5 4 4 5 7 95085908887878890919394
+ 949350 39350 3 150151310 7 4 1508896949393949698 0 1 19999 0 2 4 6 7 7 6 4501111
+ 10 8 6 4 29896949290898950889391909091939496979796959494959698 0 2 4 5 750 9 7 4
+  2 0989695959698 1 4 95090 3 2 1999796969799 2 5 7 8 8 7 5 2989693929293969899 0
+  0999896949393949699 2 85094 3 2 09896959494959799 1 2 4 3 3 4 5 7 81050959597 0
+  1 2 2 199989796969798 0 2 3 3 4 5 7 95095 2 2 199979695959698 1 4 65094 3 2 098
+ 96959494959799 1 2 850 4 3 3 4 5 7 81050969799 0 1 1 0999796969799 1 3 4 6509797
+  1 3 4 5 5 4 2 199969392929395969798 0 2 3 55094 3 2 09896959494959799 1 250 4 2
+ 98979594949598 1 3 6 950959597 0 1 2 2 199989796955095969799 1 3 4 4 3 3 4 5 7 8
+ 105098 1 1 2 2 15098 0989899 0 2 3 55098 1 1 2 2 15098 0949391909091949799 2 550
+ 959597 0 1 2 2 199989796955095969799 1 3 4 4 2995099 1 2 3 4 6 7 950979799 2 3 4
+  4 3 1 099989899 0 2 3 550878789919292919050919294969899999897509899 1 3 5 6 6 5
+  5 6 7 9101250929294969797969550969799 1 3 4 4 3 3 4 5 7 8105094 098969594949597
+ 99 1 2 3 3 2 09999 0 2 5 7 85093939596958950959698 0 2 3 3 2 199509597 0 3 5 850
+ 94 3 2 09896959494959799 150 4 3 198979798 0 1 1 3 6 9509595979898 1 2 2 1 1 2 3
+  5 6 8509696989999 1 2 2 0509698 2 4 5 750979799 150 4989899 1 3 4 65098 5509494
+ 969494959799 1 350 4 2 2 3 4 6 7 95094949695959697 0 2 3 350 3 4 5 7 95091949291
+ 919294969850 0989899 1 3 5 6 650 6 7 810125092929496989999 0 3 6 850 5 4 2 19796
+ 9493509494969494959799 1 350 498979594949598 1 3 6 95094949698 0 2 2 19996989999
+ 98979594949598 1 5 850
+  850 9 9 8 5 19488 9 6 3 19999 0 2 4 6 8 9 9501190919498 1 3 6 8 9 9 8 5 0979592
+ 9089888889919395969798 0989899 0 2 5 7 8 9 9 8 650109495969695939189888889919496
+  0 4 7 8 9 9 8 6 4501288899195 1 4 6 8 9 9 8 6 5 5 6 8 9 9 8 6 29793908988889092
+ 9598 0 2 350109293949493918988888991949697989899 0 2 5 7 8 9 9 8 6 4501094949391
+ 898888898988 08996 2 6 8 9 9 8 6 4 3 3 4 098985012 9 8 4999692898888899194969797
+ 96959399 4 6 8 9 9 8 6 4 250129594929189888889919397 3 7 9 9 8 6 0 0979694929089
+ 88889094 0 5 8 9 9 8 7 450 8 4 29997949189888889919499 4 6 8 9 9 8 6 4 3 3 450 7
+ 12 9 49892898888899295 0 9151820212018151210 8 650129594929189888889919397 3 7 9
+  9 8 6 091898888899194969797 09799 6 8 9 9 8 7 45010 0 099979593908888899196 1 4
+  6 8 9 9 8 6 5 5 6 8 9 9 8 650159594929189888889919398 2 9 0 2949089888889919398
+  2 9 0 2949089888889919398 5 8 9 9 8 7 450119594929189888889919398 2 9 0 2949089
+ 888889919398 5 8 9 9 8 7 450118889919496 0 4 7 8 9 9 8 6 3 197939089888890939699
+  1 3 4501390919498 1 3 6 8 9 9 8 5 097959290898888899092959798999998975012949697
+ 989896949189888889919598 1 5 7 8 9 9 8 6 5 5 6 8 9 9 8 6501390919498 1 3 6 8 9 9
+  8 5 09795929089888889909295979899999899 1 6 8 9 8 7 45010 9 8 6 299959289888889
+ 9193959799 1 3 5 7 8 9 9 8 6 4 250 994949391898888898988 08996 2 6 8 9 9 8 6 4 3
+  3 450119594929189888889919397 0 4 6 8 9 9 8 7 39588 09599 5 8 9 9 8 7 450119594
+ 929189888889919397 0 4 7 9 9 8 5 29895918988888991939698995013959492918988888991
+ 94 9 088 9 088 9 088899296 2 9501294949391898888899194 3 6 8 9 9 8 6 4 3 3 09189
+ 8888899194 3 6 8 9 9 8 650119594929189888889919397 0 4 6 8 9 9 8 6 3 195 08895 5
+ 1116202120181512 9 7 45011949697989896949189888889919598 2 5 8 9 9 8 6 5 5 6 7 9
+ 121517202120181512 9 7 45010 3 1 0 0 1 2 4 6 8 9 9 8 6 0 5 8 9 9 8 7 450 9 4 196
+ 94918988899195 2 8 9 9 8 6 3 0 4 5 5 450 6 2 1 0 0 1 2 4 6 8 9 9 7 45010 3 1 0 0
+  1 2 4 6 8 9 9 8 688 0 0 5 8 9 9 8 7 450 6 7 6 5 3 1 0 0 1 3 6 8 9 9 8 7 450 5 4
+ 999694918988899199 8151820212017 8 9 9 8 7 450 9 3 1 0 0 1 2 4 6 8 9 9 8 7 0 0 7
+ 1820212018151210 9 7 45010 4 19694918988899195 1 9 0 9 6 4 1 0 0 1 3 6 8 9 9 8 7
+  450 59596969595 0 4 0 6 8 9 9 8 7 450 59596969595 0 4 01820212018151210 9 7 450
+  9 4 19694918988899195 1 9 0 9 6 4 1 0 0 1 3 4 4 0 4 5 8 9 9 8 7 450 5 4 1969491
+ 8988899195 2 8 9 9 8 7 45012 4 1 0 1 2 6 9 0 6 4 1 0 0 1 2 6 9 0 6 4 1 0 0 1 3 6
+  8 9 9 8 7 45010 4 1 0 1 2 6 9 0 6 4 1 0 0 1 3 6 8 9 9 8 7 450 8 0 0 1 2 4 6 8 9
+  9 8 7 5 3 1 0 1 3 5 6 6 5 450 8 4 199 321 0 3 1 0 0 1 3 5 7 8 9 0 8 9 9 8 7 450
+  9 3 1 0 0 1 2 4 6 8 9 9 8 0 0 3 815182021201710 9 7 450 8 4 199 1 1 2 4 7 8 9 9
+  8 7 450 7 4 199 1 4 6 8 9 0 8 9 9 8 7 450 6 4 197 088 6 8 9 9 8 7 4 0969650 9 4
+  0 6 8 9 9 8 6 3 0 0 6 8 9 9 8 7 450 9 4 0 5 8 9 9 8 6 3 0 0 0 4 5 5 45012 0 2 5
+  7 9 9 8 6 0 0 6 8 9 9 8 6 3 0 0 0 4 5 5 450 8 4 1 0 0 1 8 9 9 7 4 0 1 0 0 1 8 9
+  9 850 9 4 0 6 8 9 9 8 6 3 0 01820212018151210 9 7 450 8 4 1 0 0 2 4 6 8 9101215
+ 1820212018151210 7 450
diff --git a/bin/build_fonts/unix/in_fnt10a.chr b/bin/build_fonts/unix/in_fnt10a.chr
new file mode 100644
index 0000000..90fb168
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt10a.chr
@@ -0,0 +1,90 @@
+ 99  -9  21 ; COMPLEX ITALIC-UPPER CASE                                 
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  22  64  99 130 153 174 217 245 258 280 308 323 354 376 419
+  447 509 552 588 605 631 647 672 694 715   1   1   1   1   1   1 732 772 809 835
+  878 905 941 9851017104410771112113111841222125512981332135913881407144514721514
+ 15571599   1   1   1   1   11630
+ 925090 39050 3 450 2 35094 350889450 0 6508897915098925094 5 8 9 9 8 7 450 5 7 8
+  8 7 6 45095 4 6 7 7 6 4 08850 4 5 6 6 5 3 05090 8 910 9 9 8 7 5 299979594939394
+ 9598 1 3 5 650 2 09896959494959698508897915098925094 3 6 7 8 8 7 5 3 1978850 3 5
+  6 7 7 6 4 2 0975088979150989250 2 05094 9 8 85095 15088 3 5 25088979150989250 2
+  05094 9 8 85095 15088955090 8 910 9 9 8 7 5 2999795949393949598 0 3 5 750 2 098
+ 9695949495969850 0 2 4 650 3105087969050979150 9 35010 45093 050 6135094 6508794
+ 50 0 75094 39750 49850 0 75094 15091 6 1 099979593929293949350 5 0999750 2 95088
+ 979150989250119450 1 550 0 45094 150 71350889550 1 75090999350 0945096 35090 5 7
+  4508796905096975097985010975010 45011 550939750101450879350 1 8508897915097 450
+ 97 45010 450949750 7135088945089 198969493929293949699 2 4 6 7 8 8 7 6 4 150 199
+ 979594939394965099 1 3 5 6 7 7 6 4508897915098925094 6 91010 9 7 39550 6 8 9 9 8
+  6 35088955089 198969493929293949699 2 4 6 7 8 8 7 6 4 150 199979594939394965099
+  1 3 5 6 7 7 6 4509494959798 0 1 1 2 4 5 550 1 2 3 4 5508897915098925094 5 8 9 9
+  8 7 49550 5 7 8 8 7 6 450 0 2 3 4 5 7 8 850 3 5 6 7 85088955089 8 910 9 9 8 7 4
+  09795959697 4 6509597 4 5 6 6 5 4 197949392929192935090 39750 49850979496111010
+ 5094 15088969392929396 0 3 5 610509794939394965093 050 7135090969750979850109750
+ 94 050 6125087959350969450 39350 3 150 4 25011 150929950 814508996 35097 4501090
+ 5094 050 61250889450 0 6509096 0975097 1985011 15094 050 7135094 15089 990501091
+ 50979496105090 4 6 35090 6 4 3 3 4 7 91050 7 5 4 4 550 4 4 3 1999694939394959799
+  1 3 4509997959494955090989494959650999550959698 0 2 4 5 6 6 5 3 09896959550 4 5
+  5 4 2 05095995091 5 5 6 6 5 3 097959494959698 0 3 550 098969595965090 8 4 3 3 4
+  7 91050 9 5 4 4 550 4 4 3 1999694939394959799 1 3 45099979594949550 5 950919599
+  2 5 6 5 3 097959494959698 0 3 550 098969595965093 8 7 8 9 9 8 6 4 3 2 198979650
+  6 4 3 2 099989796949291919293925097 75090 7 3 2 0979492919192939250 6 2 1999750
+  4 4 3 1999694939394959799 1 3 4509997959494955090989250999350959799 1 3 5 6 6 4
+  4 550 3 5 5 3 3 4 7 9105095995094 3 2 3 4 350959698 1 2 2 0 0 150 0 1 19999 0 3
+  5 65094 4 3 4 5 450969799 2 3 3 09998979593929293949350 1 2 2999897955090989250
+ 999350 6 5 6 7 7 6 5 3999795509799 1 2509798 0 1 3 5 75095995095 399989899 2 4 5
+ 50 4 09999 050 0 450838485879091919088508990908987509092949698 0 1 1985098 0 097
+ 50 0 2 4 6 8101111 9 91050 81010 8 8 9121415508889909295969695935094959594925095
+ 9799 1 3 5 6 6 4 4 550 3 5 5 3 3 4 7 9105091 097959494959698 0 3 5 6 6 5 4 2 050
+  0989695959650 0 2 4 5 5 45089909193969797969250959696959150969799 1 3 5 6 7 7 6
+  4 19997969650 5 6 6 5 3 15088955090 6 050 7 150 4 4 3 1999694939394959799 1 3 4
+ 509997959494955097 4509192939598999998965097989897955098 0 2 4 6 7 7 6 5 65092 6
+  6 7 7 6 3 097969697 4 5509697 4 5 5 4 19895949495955093 298979798 1 3 450 39998
+ 98995096 55088899092959696949496509495959393949698 0 2 450 6 4 3 3 4 7 91050 7 5
+  4 4 55090919294979898969698509697979595969899 2 4 6 7 7 6 750858687899293939191
+ 935091929290909193959799 050 2 0 0 1 3 5 7 9101111101150 3 1 1 35090939597 0 1 1
+ 5099 0 099989694939292939493509999 0 3 5 750 7 6 7 8 8 7 6 4 2 1 0 0 15089909193
+ 969797959597509596969494959799 1 3 550 8 4 3 1989593929293949350 7 3 2 0985090 7
+  6 496949350949597 0 4509597 0 4 6509496 0 3 55096 0 3 5 650
+  8501088 9 088 9 090 9 0 3 3 0 9 9 0 9 9501288 9 088 9 08888899193969798 0888991
+ 93969798 0989899 1 3 6 8 9 9 09899 1 3 6 8 9501190908894929089888889919497 1 4 7
+  8 9 9 8 6 4 08889919497 1 4 7 8 9501188 9 088 9 0888889909397 1 5 7 8 9 9 08889
+ 909397 1 5 7 8 9501188 9 088 9 094 2 088889488 09898 0 9 9 4 9501088 9 088 9 094
+  2 088889488 09898 0 9 9501290908894929089888889919497 1 4 7 8 9 9 8 6 2 0888991
+ 9497 1 4 7 8 9 0 9 8 6 2 0 2 2501388 9 088 9 088 9 088 9 08888 08888 09898 0 9 9
+  0 9 950 788 9 088 9 08888 0 9 950 988 5 7 8 9 9 8 6 4 3 4 5 088 5 7 9 088885011
+ 88 9 088 9 088 1 097 9 097 9 08888 08888 0 9 9 0 9 9501088 9 088 9 08888 0 9 9 3
+  9501488 9 088 9 088 7 088 9 088 9 088 9 08888 08888 0 9 9 0 9 9501388 9 088 6 0
+ 91 9 088 9 08888 08888 0 9 950118889919497 1 4 7 8 9 9 8 6 3 0969390898888 08889
+ 919497 1 4 7 9 0 9 8 6 3 096939088501188 9 088 9 0888889919396989999 08889919396
+ 9899 0 9 950118889919497 1 4 7 8 9 9 8 6 3 0969390898888 08889919497 1 4 7 9 0 9
+  8 6 3 096939088 0 7 6 4 3 3 4 61314141211 0 612131312501288 9 088 9 08888899193
+ 96979898 088899193969798 09899 0 8 9 9 7 6 0 0 7 8 8 7 0 9 950129090889492908988
+ 888991939596 0 2 0939599 0 2 5 7 8 9 9 8 7 5 3 9 7 7501188 9 088 9 0889488889488
+  0 9 950138899 3 6 8 9 9 8 6 388 08899 3 6 8 9 08888 08888501088 9 088 7 088 9 0
+ 8888 08888501388 9 088 7 088 9 088 9 088 7 088 9 08888 08888501188 9 088 9 088 9
+  08888 08888 0 9 9 0 9 950118898 9 08898 9 08898 08888 08888 0 9 9501188 9 088 9
+  088948888 0 9 9 3 9501195 2 6 8 9 9 7 5 095 2 6 8 9 0 2999695959699 2 5 7 8 9 9
+  8 5 2 0959699 2 6 850 988 1 4 7 8 088 1 0 198969595969799 2 5 8 9 9 8 5 1 09698
+  2 5 8 9 0888850 9989999989695959699 2 5 7 8 9 9 8 5 0959699 2 6 8501188 2 6 8 9
+  9 7 5 088 2 6 8 9 0 2999695959699 2 5 7 8 9 9 8 5 2 0959699 2 6 8 0888850 9 4 3
+  2 0989695959699 2 5 7 8 9 9 8 6 0959699 2 6 850 88990919089888889909295 91315 0
+ 88909296 5 912141516161514131415 09595501095 912151616151413121314 095 9121516 0
+  2999695959699 2 5 7 8 9 9 8 5 2 0959699 2 6 8501188 9 088 9 0 298969595969799 5
+  8 9 0959799 5 8 9 9 7 5 0888850 78889908988 0999795959699 5 8 9 0959699 5 8 9 9
+  7 550 78889908988 0999795959699 912141516161514131415 0959699 9121416501088 9 0
+ 88 9 09697989796959596 0 1 1 0 1 2 8 9 0 1 2 8 9 9 8 5 0888850 788 2 6 8 9 9 7 5
+  088 2 6 8 9 088885016999795959698 2 9 0959698 2 9 0 298969595969799 9 0959799 9
+  0 298969595969799 5 8 9 0959799 5 8 9 9 7 55011999795959698 2 9 0959698 2 9 0 2
+ 98969595969799 5 8 9 0959799 5 8 9 9 7 550 9959699 2 5 7 8 9 9 8 5 29997969595 0
+ 959699 2 6 8 0 9 8 5 298965010999795959698 216 0959698 216 0 299969595969799 2 5
+  8 9 9 8 5 2 09698 2 5 8 9 0161650109516 09516 0 2999695959699 2 5 7 8 9 9 8 5 2
+  0959699 2 6 8 0161650 8999795959698 2 9 0959698 2 9 0 298969595969798979650 997
+ 989897969595969799 0 4 5 09899 3 4 7 8 9 9 8 7 6 6 750 788 2 6 8 9 9 7 5 088 2 6
+  8 9 095955011999795959699 5 7 9 0959699 5 7 8 9 9 8 6 2 095 2 6 8 9 9 7 5 095 2
+  6 8 95010999795959699 5 7 9 0959699 5 7 8 9 9 8 6 3999595975014999795959699 5 7
+  9 0959699 5 7 8 9 9 8 6 4 095 4 7 8 9 9 8 6 4 0959597 095 4 7 950109996959597 0
+  09597 0 4 6 8 9 9 8 7 6 7 8 0 4 7 9 9 8 5 0969798979695959698 0 4 7 95010999795
+ 959699 5 7 9 0959699 5 7 8 9 9 8 6 2 095 912151616151413121314 095 9121516501095
+ 9799 5 7 9 09997959597 09796969797 0 7 7 8 8 7 0 7 9 9 7 550
diff --git a/bin/build_fonts/unix/in_fnt11a.chr b/bin/build_fonts/unix/in_fnt11a.chr
new file mode 100644
index 0000000..e628699
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt11a.chr
@@ -0,0 +1,80 @@
+ 99  -7  13 ;INDEXICAL COMPLEX ITALIC-UPPER CASE                        
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  22  57  83 110 133 154 188 216 229 249 277 292 323 345 378
+  403 450 486 515 532 553 569 594 616 637   1   1   1   1   1   1 654 687 720 743
+  779 803 827 862 892 919 946 979 99610431077110611421171119412191236127012951333
+ 13721408   1   1   1   1   11435
+ 955093 29350 1 250 2 35096 250919650 0 5509298945099955096 3 5 5 4 150 3 4 4 3 1
+ 5097 0 2 3 3 2999250 0 2 2 1995093 4 5 6 5 4 2 098979695959698 0 2 350 098979696
+ 98509298945099955096 2 4 5 5 4 3 2999250 2 3 4 4 3 2 1995092989450999550 1 05096
+  6 5 55097 05092 2 3 15092989450999550 1 05096 6 5 55097 05092975093 4 5 6 5 4 2
+  098979695959698 0 2 3 450 0989796969850 0 2 350 1 65092989450999550 6 250 7 350
+ 96 150 4 95097 450929750 0 55096 29850 39950 0 55096 15094 3 0999850 4 1 0989795
+ 9495969550 1 65092989450999550 79750 0 250 1 35096 150 4 950929750 0 55093999550
+  0965097 25093 3 4 25091979350979850989950 79850 7 350 8 450959850 71050919550 1
+  6509298945098 25099 250 6 250969950 4 85092965093 098979695959698 0 2 3 4 5 5 4
+  2 050 0989796969850 0 2 3 4 4 2509298945099955096 3 5 6 6 5 29750 3 5 5 4 25092
+ 975093 098979695959698 0 2 3 4 5 5 4 2 050 0989796969850 0 2 3 4 4 25097979899 0
+  0 1 2 350 0 1 2509298945099955096 3 5 6 6 5 29750 3 5 5 4 250 1 2 3 4 550 1 2 3
+  45092975093 5 6 7 6 5 3 098979798 3 4509798 3 4 4 3 19896959495965093 29850 399
+ 50989697 8 7 75096 1509298959597 1 3 4 750999696975096 150 5 95093979850989950 7
+ 985095 050 4 95091969550979650 29550 2 150 3 250 8 150949950 610509398 25099 350
+  7945096 150 4 950929750 0 5509498 0985099 150 7 1995096 150 4 95096 15094 69450
+  79550999798 75094 3 4 25093 4 2 2 3 5 6 750 5 3 3 450 3 3 199979695959698 0 250
+ 999796969850929795509896969850969799 1 3 4 4 3 2 09896959550 1 3 3 2 05095985093
+  3 3 4 3 199979695959698 0 2 35099979696985093 5 2 2 3 5 6 750 6 3 3 450 3 3 199
+ 979695959698 0 250999796969850 3 6509396 0 2 3 3 199979695959698 0 2 35099979696
+ 985095 5 6 6 4 2 198979650 4 3 29998969494955098 45093 4 2 1 050 5 3 2 098959495
+ 9650 3 3 199979695959698 0 250999796969850939894509995509798 0 2 4 4 3 3 450 2 3
+  3 2 2 3 5 6 75096995095 1 1 2 2 150969798 0 1 1 0 0 15099 0 09999 0 2 3 45095 2
+  2 3 3 250979899 1 2 2 0999795959650 0 1 19998975093989450999550 4 3 4 4 3 2 098
+ 9750979899 0 2 3 4509799 0 15096995096 1989899 1 2 350 29999 05099 2508889909193
+ 94949250929393915094959799 1 1995099 0 09850 1 2 4 6 8 8 7 7 850 6 7 7 6 6 7 910
+ 115092939495979898965096979795509899 1 3 5 5 4 4 550 3 4 4 3 3 4 6 7 85093999796
+ 95959698 0 2 3 4 4 3 19950999796969850 0 2 3 3 150929394959798989550969797945098
+  0 2 4 5 5 4 3 199979750 2 4 4 3 15092975093 4 050 5 150 3 3 199979695959698 0 2
+ 5099979696985098 3509495969799 0 098509899999750 0 1 3 4 5 5 4 55094 4 4 5 4 299
+ 979799 2 4509799 2 4 4 299979697975096 1989899 1 2 350 29999 05098 3509192939496
+ 97979696975095969695959799 1 250 4 2 2 3 5 6 750 5 3 3 4509293949597989897979850
+ 96979796969899 1 3 4 4 3 45090919293959696959596509495959494969799 050 2 0 0 250
+  3 1 1 2 3 5 7 8 8 7 85092959698 0 1 15099 0 0999896959494959450 6 5 6 6 5 4 2 1
+  0 0 1509999 0 2 4 550919293949697979696975095969695959799 1 250 4 2 1 050 5 3 2
+  098959495965093 5 5 4969595509697 0 35097 0 3 4509697 0 35097 0 3 450
+  550 793 6 095 6 093 6 0 2 2 0 6 6 0 6 650 793 6 093 6 0939394969899 09394969899
+  09999 0 1 3 5 6 6 099 1 3 5 650 694949396949393949597 0 3 5 6 6 5 3 0939597 0 4
+  650 793 6 093 6 09393949699 2 4 5 6 6 093949699 2 4 5 650 793 6 093 6 097 1 093
+ 939693 09999 0 6 6 3 650 693 6 093 6 097 1 093939693 09999 0 6 650 7949493969493
+ 93949597 0 3 5 6 6 5 4 1 0939597 0 4 6 0 6 4 1 0 1 150 993 6 093 6 093 6 093 6 0
+ 9393 09393 09999 0 6 6 0 6 650 593 6 093 6 09393 0 6 650 693 3 5 6 093 3 5 6 6 5
+  3 2 3 4 0939350 893 6 093 6 093 0 098 6 098 6 09393 09393 0 6 6 0 6 650 693 6 0
+ 93 6 09393 0 6 6 3 6501093 6 095 6 093 4 093 6 093 6 093 6 09393 09393 0 6 6 0 6
+  650 893 6 093 6 093 3 093 6 09393 09393 0 6 650 793949597 0 3 5 6 6 5 4 2999694
+ 9393 0939597 0 4 6 0 6 4 299959350 793 6 093 6 0939394959799 0 0 093959799 0 0 6
+  650 793949597 0 3 5 6 6 5 4 29996949393 0939597 0 4 6 0 6 4 2999593 0 5 4 3 3 4
+  8 9 9 8 0 4 8 950 893 6 093 6 0939394959799 0 0 093959799 0 0 0 5 6 6 5 0 0 1 5
+  6 0 6 650 89494939694939394959798 1 2 09697 0 1 4 5 6 6 5 3 6 5 550 893 6 093 6
+  0939693939693 0 6 650 993 3 5 6 6 5 393 093 3 5 6 09393 0939350 793 6 093 4 093
+  6 09393 0939350 993 6 093 4 093 6 093 6 093 4 093 6 09393 0939350 893 6 093 6 0
+ 93 6 09393 09393 0 6 6 0 6 650 79399 6 09399 09399 6 09393 09393 0 6 650 793 6 0
+ 93 6 093969393 0 6 6 3 650 897 4 5 6 6 5 3 097 4 5 6 0 19997979899 1 3 5 6 6 4 0
+ 9799 1 4 650 693 0 093 0 4 6 0 098979798 0 2 4 5 6 6 5 3 0 09799 2 4 6 0939350 6
+ 9899999897979899 1 3 5 6 6 5 4 09799 1 4 650 893 4 5 6 6 5 3 093 4 5 6 0 1999797
+ 9899 1 3 5 6 6 4 09799 1 4 6 0939350 5 3 2 1 09897979899 1 3 5 6 6 5 4 09799 1 4
+  650 6939493939496 7 910 0939496 7 91010 910 0979750 797 4 7 9 097 4 7 91010 9 9
+ 10 0 19997979899 1 3 5 6 6 4 09799 1 4 650 893 6 093 6 09998979798 0 3 5 6 09798
+  0 3 5 6 6 5 3 0939350 59394949393 0 098979798 0 3 5 6 09798 0 3 5 6 6 5 350 593
+ 94949393 0 098979798 0 7 91010 910 09798 0 7 91050 693 6 093 6 098999998979799 0
+  0 0 0 1 5 6 6 5 3 0 0 1 5 6 0939350 493 4 5 6 6 5 3 093 4 5 6 093935012 0989797
+ 9899 6 0979899 6 0999897979899 6 0979899 6 09998979798 0 3 5 6 09798 0 3 5 6 6 5
+  350 9 09897979899 6 0979899 6 09998979798 0 3 5 6 09798 0 3 5 6 6 5 350 6979899
+  1 3 5 6 6 5 4 2 0989797 09799 1 4 6 0 6 4 2999750 7 0989797989910 097989910 099
+ 979798 0 2 4 5 6 6 4 2 09799 2 4 6 0101050 79710 09710 0 19997979899 1 3 5 6 6 4
+  09799 1 4 6 0101050 6 09897979899 6 0979899 6 0999897979899999850 7989999989797
+ 98 0 1 2 3 099 0 1 2 5 6 6 5 4 4 550 593 4 5 6 6 5 3 093 4 5 6 0979750 8 0989797
+ 98 0 3 5 6 09798 0 3 5 6 6 5 4 097 4 5 6 6 5 3 097 4 5 650 6 098979798 0 3 5 6 0
+ 9798 0 3 5 6 6 5 3 09797985010 098979798 0 3 5 6 09798 0 3 5 6 6 5 4 097 4 5 6 0
+ 97 4 5 6 6 5 3 097979850 8 098979798 0 09798 0 3 5 6 6 5 4 4 5 098999998979798 0
+  3 5 6 0 3 5 6 6 5 350 7 098979798 0 3 5 6 09798 0 3 5 6 6 5 4 097 4 7 9 097 4 7
+  91010 9 91050 7979899 4 5 6 099979799 098989999 0 4 4 5 5 0 4 6 6 450
diff --git a/bin/build_fonts/unix/in_fnt12a.chr b/bin/build_fonts/unix/in_fnt12a.chr
new file mode 100644
index 0000000..cf996c5
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt12a.chr
@@ -0,0 +1,48 @@
+ 99  -9  21 ;SIMPLEX GREEK-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  13  78  45  55 254  38 276 114   1 118 128 135 148 168 191
+   88 201 216 227 234   1 302 158 283  68   1   1   1   1   1   1 320 345 464 395
+  420 717 377 739 512   1 522 542 552 574 619 638 484 652 672 691 700   1 775 589
+  754 440   1   1   1   1   1 798
+ 925091 09250 0 85095 5508993935093 2 5 6 7 7 6 5 25093 2 5 6 7 7 6 5 29350909494
+ 5094 65091 09250 0 85092 8509094945094 75094 25094 75090 7935093 75093 750899393
+ 50 7 75093 7508998969493929293949698 2 4 6 7 8 8 7 6 4 2985097 35096 0 050899393
+ 50 7935098 75091 09250 0 8508892925092 050 8 050 8 8508993935093 750 7 7509193 7
+ 5097 35093 7508998969493929293949698 2 4 6 7 8 8 7 6 4 2985089939350 7 75093 750
+ 8993935093 2 5 6 7 7 6 5 293509193 0935093 75093 75092 0 05093 75091939394959798
+ 99 0 050 7 7 6 5 3 2 1 05090 0 0509895949393949598 2 5 6 7 7 6 5 298509093 75093
+  75089 0 05091929394959699 1 4 5 6 7 8 950909397949393949699 1 4 6 7 7 6 3 75090
+ 999795949393949698 0 3 5 7 85099 1 2 3 5 6 7 85091 3 199979695949350 3 5 7 7 6 5
+  3 050 0 2 4 5 5 4 3 19997969550919294969799 0 1 1 050 8 7 6 098975091 299979594
+ 94959698 0 2 4 5 5 4 2 09999 0 2 4 65092 5 4 299979798 150 19795959698 1 3 55092
+  2 09999 0 3 650 6 2999695959698 1 2 2 1999850909192949697979694509698 0 2 4 6 6
+  5 250899091939596969595969799 1 3 4 5 6 6 5 3 1 0 0 1 3 5 85094 098979798 0 2 3
+ 5091979350 7 6 5 399979650969899 1 2 3 4509293959798 650 09450909791509695959799
+  1 3 550 7 5 4 4 5 7 9105091949796959450 7 6 5 3 097945092 2 09999 0 3 650 3 098
+ 979799 2 450 29896959597 1 2 2 0985092 098969595969799 1 3 5 6 6 5 4 2 050899894
+ 50 3 4 5 650919396 950919595969799 1 3 5 6 6 5 4 2 0989695915091 999979594949596
+ 98 0 2 4 5 5 4 3 15090 19850929497 8509091929496979795959799 2 4 6 7 75089979593
+ 929293949699 2 5 7 8 8 6 4 2 098955091939597 3 5 750 8 7 59593925088 49650899092
+ 9495959494959799 2 4 6 8 950889694929191929395979950 099 0 1 3 5 7 8 8 7 650
+  850 988 9 088 9 0 2 2501088 9 0888889909294969798 0989899 0 2 5 7 8 9 950 788 9
+  0888850 988 9 088 9 0 9 950 988 9 08888 09898 0 9 9501088 9 08888 0 9 9501188 9
+  088 9 0989850118889919396 1 4 6 8 9 9 8 6 4 1969391898888 0989850 488 9501088 9
+  088 2 097 950 988 9 088 9501288 9 088 9 088 9 088 9501188 9 088 9 088 950 98888
+  09898 0 9 950118889919396 1 4 6 8 9 9 8 6 4 1969391898888501188 9 088 9 0888850
+ 1088 9 08888899092959798999950 98898 9 08888 0 9 950 888 9 0888850 9939189888889
+ 9195 9 09391898888899195501088 9 093949597 0 2 3 4 4 3 2 09795949393501088 9 0 9
+ 88501188 9 094949599 1 2 3 3 2 1999594945010 9 9 298949189888889919498 2 9 95011
+ 959698 0 3 6 8 9 9 8 5 29895 095959698 6 8 9 950108889919598 2 816 0888890939596
+ 9797 09798 0 2 5 7 8 9 9 8 7 45010989695959697 0 4 9 09598 0 9131650 995959698 1
+  4 7 8 9 9 8 6 3 097959391898888899150 8979695959698 0 1 0 1 2 4 6 8 9 9 8 650 7
+ 88899091929393 0939597 0 3 5 7 91113151616145010999795959698 2 9 0 29896959597 0
+  5165010999795959698 3 6 8 9 9 8 5 3 0959289888890929598 0 250 595 2 6 8 9 9 7 5
+ 50 995 9 096959596 0 1 1 0 1 2 3 8 9 9 850 888888990 9 095 950119516 099 4 7 9 9
+  8 6 2 095 2 6 8 9 9 7 550 99595 1 6 9 09598 0 3 6 8 950 888899091929393 0939495
+ 9799 1 2 2 0 2 3 4 6 810121315161650 9959698 1 4 7 8 9 9 8 6 3 097969595501195 9
+  095 1 6 9 09896959550 9 1 4 7 8 9 9 8 6 3 0979695959698 116501195959698 1 4 7 8
+  9 9 8 6 3 0979695501095 9 0989695955010999795959698 4 7 9 9 8 6 298955011969799
+  2 5 7 8 9 9 8 6 3 097959597 1 61650 9959597141616 09597 011141650118816 0999795
+ 959698 3 6 8 9 9 8 6 398955011959699 2 5 8 9 9 8 5 0 1 5 8 9 9 8 5 299969550
diff --git a/bin/build_fonts/unix/in_fnt13a.chr b/bin/build_fonts/unix/in_fnt13a.chr
new file mode 100644
index 0000000..3b09e8c
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt13a.chr
@@ -0,0 +1,84 @@
+ 99  -9  21 ;COMPLEX GREEK-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  22 139  83  99 540  68 589 224   1 237 265 281 312 371 416
+  167 438 468 489 506   1 653 334 611 122   1   1   1   1   1   1 697 738 935 825
+  8701356 79613941013   1102910591083111211831216 9681239127113071324   114531137
+ 1418 903   1   1   1   1   11497
+ 925090 09350 0 750 0 65095 450919750 3 9508994945095955091 3 6 7 8 8 7 6 350 3 5
+  6 7 7 6 5 35095 3 6 7 8 8 7 6 39150 3 5 6 7 7 6 5 3509196965097975093 8 8 75093
+  05090 09250 0 850 0 75093 75092 85089949450959550 1 15091 7 7 65095 15091 7 7 6
+ 5090 69350 79450949393 75093 7 7 65088939350949450 6 650 7 750909750 3105094 650
+ 909750 310508999969493929293949699 1 4 6 7 8 8 7 6 4 199509997959493939495979950
+  1 3 5 6 7 7 6 5 3 150979750 3 35097 35097 35095 0 050 1 15097 45097 45088939350
+ 949450 7945099 75098 650909750 3 950909750 3 95090 09350 0 750 0 650919750 3 950
+ 8893935094 05093 050 7 050 7 750 8 850909450 71150909650 411508994945095 75095 7
+ 50 7 750919550 4105091975089939250 8 750979650 4 350939250 8 75093 75093 75097 3
+ 5097 35093 75093 7508999969493929293949699 1 4 6 7 8 8 7 6 4 1995099979594939394
+ 95979950 1 3 5 6 7 7 6 5 3 15088939350949450 6 650 7 750901050909750 31050899494
+ 5095955091 3 6 7 8 8 7 6 39550 3 5 6 7 7 6 5 3509198509093 0925092995092 7 8 650
+ 93 65092 7 8 65091 0 050 1 150949393 8 8 75097 4509193939495979899 0 05093959799
+ 50 8 8 7 6 4 3 2 1 150 8 6 4 25097 45090 0 050 1 1509895949393949598 3 6 7 8 8 7
+  6 39850989695949495969850 3 5 6 7 7 6 5 35097 45097 4509093 65094 750 793509197
+ 50 3 950919750 3 95089 0 050 1 1509192949596979950929394959699 2 5 6 7 8 950 2 4
+  5 6 7 9105097 45097 4508992939795939292939598 2 5 7 8 8 7 5 3 7 850959493939496
+ 9850 2 4 6 7 7 6 550939650 4 75089999694939292939698 0 3 5 7 8509997959493939496
+ 5099 1 3 4 6 7 850 1 2 3 5 6 8 95089 29997959493929150 2 098969594939250 2 4 6 7
+  7 6 5 29850 4 6 6 5 4 25098 2 4 5 5 4 3 0989695945098 1 3 4 4 3 2 0509091939597
+ 99 0 1 1 09750929498 050 8 7 6 1989650 7 6 5 15091 4 2 097959494959698 0 3 5 6 6
+  5 1 0 0 1 3 5 750 0989695959650 0 2 4 5 5 4 2 1 1 2 4 75091 6 4 298969698 15098
+ 979799 150 19694949598 1 3 550 197959596985091 2 09999 0 3 8 8 5 1989594949598 1
+  2 2 1999850 399969595969850899091939697979694509596969593509698 0 2 4 6 7 7 6 3
+ 50 4 6 6 5 2508889909295969695959697509495959494959799 1 3 5 6 7 7 6 4 2 0 0 1 3
+  5 850 1 3 4 5 6 6 5 45094 098979798 1 3 450 1999898995090969250979350 6 7 8 7 5
+  3999795509799 1 2509798 0 1 3 5 750909395979899 5 6 750959798 4 5 7 850 09250 0
+ 9350889589509690509594949698 0 2 450 6 3 3 4 7 91050 7 4 4 550909694509796959450
+  7 6 450 8 7 6 4 29997945093975091 2 09999 0 3 650 39997969698 1 450 3 098979799
+  150 19795949496 1 2 2 09850 19896959597 15091 097959494959698 0 3 5 6 6 5 4 2 0
+ 50 0989695959650 0 2 4 5 5 45089989450989550 4 450 4 550919396 950919396 9509094
+ 959698 0 3 5 6 6 5 4 2 09795949050 0 2 4 5 5 450 0989695915090 99996949393949597
+ 99 2 4 5 5 4 3 1509997959494955099 1 3 4 4 350 3 95090 19850 19950929497 8509294
+ 97 85090919294979898969698509697979595969899 2 4 6 7 7 6 5 6 750 6 7508997959392
+ 9293949699 2 5 7 8 8 6 4 2 098955092949699 2 5 750 8 6 4 2 09896509193959798 3 4
+  550959697 2 3 5 750 8 7 59593925088 39750 49650899092959696959597 0 2 5 7509495
+ 9594949597 0 2 4 6 7 9508892949796949291919293959799 050919293959799509999 0 1 3
+  5 7 8 8 7 6 5 7 85099 0 1 3 5 750
+  8501088 9 088 9 091 9 0 3 3 0 9 9 0 9 9501188 9 088 9 0888889909294969798 08889
+ 909294969798 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8 950 988 9 088 9 088889488 0 9
+  9501088 9 088 9 091 9 0 8 8 0 9 9501088 9 088 9 094 2 088889488 09898 0 9 9 3 9
+ 501088 9 088 9 088948888 0 9 9 3 9501288 9 088 9 088 9 088 9 08888 08888 09898 0
+  9 9 0 9 950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4 6 8 9 0
+  9 8 6 4 09793918988 095 2 095 2 09898 0999950 688 9 088 9 08888 0 9 9501088 9 0
+ 88 9 088 1 097 9 097 9 08888 08888 0 9 9 0 9 9501088 9 088 9 091 9 0 9 9 0 9 950
+ 1388 9 088 6 088 9 088 9 088 9 088 9 08888 08888 0 9 9 0 9 9501288 9 088 7 090 9
+  088 9 08888 08888 0 9 950118792 08792 096 1 096 1 0 510 0 510 08989 09090 09898
+  09999 0 7 7 0 8 850118889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4
+  6 8 9 0 9 8 6 4 09793918988501288 9 088 9 088 9 088 9 08888 0 9 9 0 9 9501188 9
+  088 9 088888990929597989999 08889909295979899 0 9 950118898 9 08898 088889488 0
+  8 8 0 9 9 3 9501088 9 088 9 0889488889488 0 9 950109391898888899195 9 091898991
+  09391898888899195 9 091898991 0 9 9501188 9 088 9 093949597 0 2 3 4 4 3 2 09795
+ 949393 093949597 0 2 3 4 0 4 3 2 097959493 08888 0 9 9501088 9 088 9 088 9 08888
+  08888 0 9 9 0 9 9501288 9 088 9 095949599 1 2 3 0949599 1 2 3 3 2 1999594 0 3 2
+  199959495 08888 0 9 95011 6 9 9 5 198949189888889919498 1 5 9 9 6 0 5 298949189
+ 88 08889919498 2 5 0 8 8 0 8 85012959698 0 3 6 8 9 9 8 5 29895 0959698 0 3 6 8 9
+  095959698 6 8 9 0959698 6 8 9 950108889919598 2 816 08889919598 2 816 088888990
+ 9395969797 0889093959697 09798 0 2 5 7 8 9 9 8 7 4 09798 0 2 5 7 8 9501098969595
+ 9697 0 4 816 097969697 09598 0 71216 09598 0 750109695959699 2 5 7 8 9 9 8 5 299
+ 9792908887878890 0959699 2 6 8 0 9 8 5 2989693918988889050 9989695959698 0 1 095
+ 9698 0 1 0 1 2 4 6 8 9 9 8 6 0 1 2 4 6 8 950 98889909192939392939597 0 3 5 7 911
+ 1315161615 09497 0 3 5 7 95011999795959698 2 9 0959698 2 9 0 2989695959697 0 516
+  09597 0 5165011999795959698 3 6 8 9 0959698 3 6 8 9 9 8 6 3 0959189888890929598
+  0 2 0 8 5 3 09591898850 695 2 6 8 9 9 7 5 095 2 6 8 9501095 9 095 9 09596969595
+ 96 0 1 1 0 1 2 8 9 0 1 2 8 9 9 8 550108888899092 6 8 9 0889092 6 8 9 9 095 9 095
+  950119516 09516 098 4 7 9 9 8 6 3 095 6 8 9 9 7 5 095 6 8 9501095 9 095 1 6 9 0
+ 9599 3 09598 0 3 5 7 8 9 0959550 888899091929393 09394959799 1 2 2 09394959799 1
+  2 0 2 3 4 6 8101213151616 0 2 3 4 6 8101250 9959699 2 5 7 8 9 9 8 5 29997969595
+  0959699 2 6 8 0 9 8 5 29896501196 9 096 9 096 9 096 9 098969595 09897969650 9 4
+  7 8 9 9 8 5 299979695959699 216 0 9 8 5 29896 0959699 216501195959699 2 5 7 8 9
+  9 8 5 299979695 0959699 2 6 8 0 9 8 5 29896 09696501096 9 096 9 098969595 09897
+ 96965010999795959698 4 7 9 0959698 4 7 8 9 9 8 6 3 097959697 0 0 3975011969799 2
+  5 7 8 9 9 8 6 3 097959597 1 616 0 5 7 8 8 7 5 3 097969698 1 71650 9959596981315
+ 16 095969813151616 09597 011141650118816 08816 0999795959698 3 6 8 8 7 4 1 09596
+ 98 3 6 8 9 9 8 6 3 1955011999796959699 2 5 8 9 9 8 5 2 0 5 7 8 8 7 5 0 2 5 8 9 9
+  8 5 2999695969799 0 5 7 8 8 7 550
diff --git a/bin/build_fonts/unix/in_fnt14a.chr b/bin/build_fonts/unix/in_fnt14a.chr
new file mode 100644
index 0000000..129dcf9
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt14a.chr
@@ -0,0 +1,74 @@
+ 99  -7  13 ;INDEXICAL COMPLEX GREEK-UPPER CASE                         
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  22 129  73  89 502  58 543 202   1 215 243 259 290 349 382
+  157 404 430 451 468   1 599 312 565 112   1   1   1   1   1   1 635 668 826 729
+  7691179 7091215 889   1 903 930 946 97310301059 8531080111011391154   11262 993
+ 1233 797   1   1   1   1   11298
+ 955093 09550 0 450 0 55097 250939850 2 7509296965097975094 1 4 5 4 150 1 3 4 3 1
+ 5097 1 4 5 5 4 19450 1 3 4 4 3 1509397975098985095 5 5 45095 05093 09450 0 550 0
+  65095 45094 65092969650979750 1 15094 4 4 35097 15094 4 4 35094 49650 597509796
+ 96 55096 5 5 45092969650979750 4 450 5 550949950 2 75097 450949950 2 75093999796
+ 9595969799 2 4 5 6 6 5 4 2995099979696979950 2 4 5 5 4 250999950 2 25099 25099 2
+ 5096 0 050 1 15098 35098 35092969650979750 5975099 450 0 550949950 2 750949950 2
+  75093 09550 0 450 0 550939850 2 7509195955096 05096 050 5 050 5 550 6 650939650
+  5 850939750 3 8509296965097 45097 450 4 450949750 2 65094985092959450 6 5509897
+ 50 3 250959450 6 55095 55095 55098 25098 25095 55095 550939997969595969799 2 4 5
+  6 6 5 4 2995099979696979950 2 4 5 5 4 25092969650979750 4 450 5 55094 750949950
+  2 7509296965097975094 1 4 5 5 4 19750 1 3 4 4 3 1509499509395 05096 1955095 5 6
+  45096 55095 5 6 45093 0 050 1 150969595 6 6 55098 350939596979899 0 050 6 5 4 3
+  2 1 1509596979899 050 6 5 4 3 2 15098 35093 0 050 1 150999695959699 2 5 6 6 5 2
+ 995099979696979950 2 4 5 5 4 25098 35098 3509396 45097 550 59650949950 2 7509499
+ 50 2 75092 0 050 1 150949596979950 2 4 5 6 75095969799 2 4 5 65098 35098 3509395
+ 96999595969799 2 4 5 6 6 2 5 650979696979950 2 4 5 5 450969850 3 550939997969595
+ 969899 1 3 5 6509997969697985099 1 3 5 650 1 2 4 6 75093 098979593509998969450 0
+  2 4 4 3 050 2 3 3 2 050 0 2 3 3 2 099979650 0 1 2 2 05093949698 0 1 1 050949698
+  0 150 5 4 1995093 199979695959698 0 2 3 4 4 3 09999 0 2 3 450999796969850 0 2 3
+  3 15099 0 2 45094 4 299979798 050999898 050 097969698 1 350 0989797985094 09999
+  1 4 4 1989796969798 0 1 1 0989750 19998979798 050919293949697979550959696945097
+ 98 0 2 4 4 150 2 3 3 050919293949697979850959696979899 1 2 3 4 4 3 2 09999 0 3 5
+ 5099 1 2 3 3 25096 0989899 1 3 450 19999 05093979450989550 3 4 5 4 2 097509798 0
+  2 4 5509799 1 25094949698 5509697 450 09550 096509397935098945096969799 1 250 4
+  2 2 3 5 6 750 5 3 3 4509296955097969550 4 4 5 4 29996955094975095 09999 1 450 2
+ 999898 0 350 2 09999 050 198979799 1 2 2 19950 199989899509399979695959698 0 2 3
+  4 4 3 19950999796969850 0 2 3 3 15091989550989650 2 150 2 2509395 6509395 65092
+  19997969592509997969350 1 3 4 4 3 2 098969550 1 3 3 2 05093 799979695959698 0 2
+  3 4 4 3 750999796969850 0 2 3 3 15093 19950 1 0509597 6509597 65092939495979898
+ 9797985096979796969899 1 3 4 4 3 45093979695959698 0 3 5 6 6 5 3 2 1 09750959698
+  0 3 5 650 6 5 3 150 099985093959698 1 2509697 0 2 350 4 296945091 29950 3985092
+ 939496979798 1 3 5509596969798 1 3 5 6 750929698989695949495969899 0 150949698 0
+ 50 0 0 1 3 5 6 6 5 4 4 550 0 1 3 550
+  550 793 6 096 6 093 6 0 2 2 0 6 6 0 6 650 893 6 093 6 0939394969899 09394969899
+  09999 0 2 3 5 6 6 099 0 2 3 5 650 693 6 093 6 093939793 0 6 650 793 6 095 6 093
+  6 0 5 5 0 6 650 793 6 093 6 097 1 093939793 09999 0 6 6 2 650 793 6 093 6 09397
+ 9393 0 6 6 2 650 993 6 093 6 093 6 093 6 09393 09393 09999 0 6 6 0 6 650 8939495
+ 98 1 4 5 6 6 5 4 19895949393 0939598 1 4 6 0 6 4 1989593 097 2 097 2 09999 0 0 0
+ 50 593 6 093 6 09393 0 6 650 893 6 093 6 093 1 099 6 099 6 09393 09393 0 6 6 0 6
+  650 793 6 096 6 093 6 0 6 6 0 6 6501093 6 096 6 093 3 093 6 093 6 093 6 09393 0
+ 9393 0 6 6 0 6 650 893 6 095 6 093 4 093 6 09393 09393 0 6 650 89295 09295 098 1
+  098 1 0 4 7 0 4 7 09393 09494 09999 0 0 0 0 5 5 0 6 650 893949598 1 4 5 6 6 5 4
+  19895949393 0939598 1 4 6 0 6 4 198959350 993 6 093 6 093 6 093 6 09393 0 6 6 0
+  6 650 793 6 093 6 0939394969799 0 0 09394969799 0 0 6 650 99399 09399 6 0939397
+ 93 0 5 5 0 6 6 2 650 893 6 093 6 0939793939793 0 6 650 8979493939497 6 097949393
+ 9497 6 0979594949597 0979594949597 0 6 650 893 6 093 6 0969799 0 2 3 3 2 0999796
+ 96 0969799 0 2 3 0 3 2 0999796 09393 0 6 650 893 6 093 6 093 6 09393 09393 0 6 6
+  0 6 650 993 6 093 6 0989797 1 3 0 3 1979798 097 0 2 3 3 2 097 09393 0 6 650 8 4
+  6 6 09795949393949597 0 6 6 4 0 3 0979593 0939597 0 3 0 5 5 0 5 550 9979899 1 3
+  5 6 6 5 3 097 09799 1 3 5 6 0979798 5 6 09798 5 6 650 6939597 310 09496 210 093
+ 9394969899 09394969899 099 0 2 4 5 6 6 5 2 099 0 2 4 650 799979798 1 610 0999898
+ 99 1 097 0 61050 797979899 1 3 5 6 6 5 4 2 09896949392929395 09799 1 4 6 0 6 4 2
+ 9997 09493939550 69897979899 0 1 0979899 1 0 1 2 3 5 6 6 5 0 1 2 3 5 650 5939495
+ 969695969798 0 2 4 5 6 7 91010 9 0969798 0 2 4 650 7 09897979899 6 0979899 6 099
+ 98979798 010 09798 01050 7 199989899 4 6 09899 3 5 6 6 5 4 29996949393949698 0 1
+  0 6 4 299969350 597 4 5 6 6 5 3 097 4 5 650 797 6 097 6 0979898979799 0 0 0 1 5
+  6 5 3 0 0 1 5 650 6939394 6 09394 6 098 6 098 650 89710 09710 0 3 5 6 6 5 4 097
+  4 5 6 6 5 3 097 4 5 650 797 6 097 3 6 0 09797 0 3 5 6 6 0979750 69394959696 096
+ 9798 0 1 1 0969798 0 1 0 1 2 3 5 6 7 8 91010 0 1 2 3 5 650 6979899 1 3 5 6 6 5 4
+  2 0989797 09799 1 4 6 0 6 4 2999750 898 6 098 6 098 6 098 6 0999797 099989850 6
+ 97979899 110 09799 110 09798 0 2 4 5 6 6 5 3 09799 2 4 650 997979899 1 3 5 6 6 5
+  4 2 09898 09799 1 4 6 0 6 4 2999750 898 6 098 6 0999797 099989850 6 098979798 0
+  3 5 6 09798 0 3 5 6 6 5 3 097979850 89899 1 3 5 6 6 5 3 098979798 0 310 0 3 4 5
+  5 4 2 0 0999898 0 0 3 61050 6979798 910 09798 91010 097 0 71050 99310 09310 0 0
+ 98979798 4 5 5 4 2 09798 2 5 6 6 5 2 09750 89898979899 1 3 5 6 6 5 3 0 0 3 5 5 3
+  0 0 5 6 6 4 2 098979898 0 3 5 5 450
diff --git a/bin/build_fonts/unix/in_fnt15a.chr b/bin/build_fonts/unix/in_fnt15a.chr
new file mode 100644
index 0000000..331e9d6
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt15a.chr
@@ -0,0 +1,186 @@
+ 99  -9  21 ;GOTHIC GERMAN-UPPER CASE                                   
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  66 168 248 328 424 519 619 712 796 880 9621036116512621335
+ 1436152516221706178818341935207921662241   1   1   1   1   1   12316236324142442
+ 24902518256826222673271327592823285329282978302030783122315531983236328433323405
+ 34503498   1   1   1   1   13541
+ 925088919291909193959798999998969491509798989750959697979694509497509397509196 3
+ 5010 91010 9 7 5 4 3 3 5 950 5 4 4 650 7 6 5 5 750878989909294949391919350939150
+ 9293939190909193969899 0 099975098999950969798989750 0 1 3 5 7 8 91050 7 850 5 6
+  7 8105010 050 7 91010 9 7 4 19892919050 6 7 950 4 7 91050 2 0949350 8 6 3 09693
+ 9190909192915088 098969492919192949699 2 5 7 95094939292939598509695949393949597
+  0 3 6 950 3 099989899 2 3 3509999 3 3509999 0 3 4 4 3 1 0989750 3 4 6 850 3 4 5
+ 50 2 4 6 8 950879090919396 0 3 5 7 91010 9 7 4 198929190509395 0 3 5 7 950 2 094
+ 9350909295 0 3 5 7 91050 8 6 3 0969391909091929150989594949696509595969650959597
+ 9796959392925088 098969492919192949699 2 5 7 95094939292939598509695949393949597
+  0 3 6 950 3 099989899 2 3 3509999 3 3509999 0 3 4 4 3 1 0989750 3 4 6 850 3 4 5
+ 50 2 4 6 8 950 3 750 7 81050 6 7 850 5 6 810508895939292939699 2 6509395 0 35092
+ 9395 0 6 8 9 9 8 750 1 09999 0 4 5 5 4 3 150 2 5 6 6 55099 1 4 6 7 7 6 4 1979493
+ 92929494935094939394509795949495959492919150 3 750 7 81050 6 7 850 5 6 8105087 3
+  2 19996939190909192949699 2 5 7 91010 9 75093929191929350 8 9 9 8 7509694939292
+ 93949650 5 7 8 8 7 550 3 098979798 1 2 2509898 2 250989899 2 3 3 2 099979650 2 7
+  85010 850 7115010 9 7 8 8 91110105088 0989695959698999950969699995096969799 0 0
+ 999896949291909091929150 0 2 4 65099 1509899 1 3 650 0 750 7 91010 9 7 4 050 6 8
+  9 9 850 4 5 7 8 8 7 6 450 4 2 09896959698 0 250 19950 0989650889896949392929394
+ 9799 2 5 7509496 0 2 35092939599 2 4 7 91010 9 750929392919192949698 0 250969799
+  0509495969899 1 4 6 7 8 8 7 5 4 450 7 7 4 450 6 7 7 6 4 3 3 5 7 8 8508898969493
+ 929293949799 2 5 7509496 0 2 35092939599 2 4 7 91010 9 750929392919192949698 0 2
+ 50969799 0509495969899 1 4 6 7 8 8 7 5 4 450 7 7 4 450 6 7 7 6 4 3 3 5 7 8 85087
+  9 8 6 3 09795949495989896509595989850969595969899999896949250909250899350909089
+ 9192929391905096969799 2 4 6 750 3 550 0 2 3 450 79850 3 7 8 950 2 6 850 1 5 710
+ 5089 8 7 4 3 3 4 6 7 750 4 4 7 750 5 4 4 5 7 8 8 7 6 398959493939496979796509494
+ 979750949495979898979592509597 0 3 6 8509697 1 25092949599 2 4 7 8 9508487878890
+ 92929189899150918950909191898888899193959798989796949190895096979796955092919050
+ 93959696959493929188509698 0 2 4 5 5 4 3 199989750 3 4 4 350 0999850 0 2 3 3 2 1
+  0999650 3 4 6 81011121350101150 8 9101113501310 9 8 8 911145010 9 9101250131110
+ 1011135086898990929494939191935093915092939391909091939698 0 1 1 099979493918950
+ 99 0 0999897509593915096989999989694928950 0 1 3 5 7 8 91050 7 850 5 6 7 8105010
+  7 6 5 5 6 81150 7 6 6 7 95010 8 7 7 8105086989694939395955094949595509494969695
+ 94929191509899 5 8 91010 9 8 6 3 097919089509899 5 7 850989899 5 7 91050 1999392
+ 50 7 5 29995929089899091905087909091939595949292945094925093949492919192949799 0
+  1 150 1 1 0989594949596955099 0 0995097989999509999989750 1 650 6 8 91010 9 7 4
+ 50 5 8 9 950 4 6 8 9 9 8 750 5 3 15099979550 5 3 19850 4 2 150999795508698969493
+ 939595509494959550949496969594929191509899 5 8 91010 9 850 6 3 097919089509899 5
+  7 850989899 5 7 91050 199939250 6 299959290898990919050 2 4 6101150 5 6 950 3 4
+  81012508689899092949493919193509391509293939190909193969899 0 09997959391509899
+ 9998509697989897955089915088925089898890919192908950 0 1 3 5 7 8 91050 7 850 5 6
+  7 8105010 050 2 6 81150 3 7 950 4 8 910508710 910111110 8 4 197939150 7 4 19794
+ 501110 8 4 19794929190909192949699 3 6 810111110 8 5 3 1999750949699 3 750919395
+ 98 3 7 9101150 6 5 1 05011 9 7 5 3 19997969697995088949291919295 0 3 7 910509294
+  0 3 650919294 0 3 7 91010 9 8 950 3 09999 1 150 0 0 1 150 0 0 2 2 1 09897975092
+ 93929191929497 1 4 7 9509495 1 3509192939599 2 5 8105089929394949250939595985091
+ 94969698 05092939597 0 450 2 3 4 4 6 950 3 5 5 750 1 4 7 6 6 7 85086898990929494
+ 93919193509391509293939190909193969899 0 099975098999950969798989750 0 1 3 5 7 9
+ 1050 7 850 5 6 7 81050 8 6 5 5 6 91050 6 950 5 6 91010 9 7 5 19892919050 2 09493
+ 50 8 6 3 09693919090919291508487878890929291898991509189509091918988888991949697
+ 9898979593509697979650949596969593509698 1 350 5 2 1 1 2 4 5 5 450 2 2 5 550 5 3
+  2 2 3 5 6 6 5 3 197959391898850969392509997949289888889908950 5 810121350101150
+  8 91011135011 9 8 8 9121350 91250 8 91213131211 9 6 350 7 6 4501210 8 6 5508893
+ 95979899995099999895939150969493509796949150959899 0 0 1 3 550919698 0 1 150 1 1
+  2 3 5 75099 0 2 4 950 1 2 5 7 950 4 6 750 3 4 6 95093959950 1 5 75095 550939599
+ 50 1 5 75087909091939595949292945094925093949492919192949799 0 1 1 09999 1 25099
+  0 09998 150979899999897 0 350 1 950 7 7 650 8 8 750 9 9 8 7 5 29895939293949350
+ 88969799 2 4 5 6 6 5 4 25099979650 4 5 5 450 2 3 4 4 3 25095969799 2 5 7 8 8 7 5
+  29896939250 6 7 7 650 2 5 6 6 5 4 2509796949350 09897959491909091925092 2999796
+ 95959697 3509697985099979696979950 0 1 3 3 5 850 1 4 4 650 2 3 5 650 5 650 5 5 6
+  7509294959650 2999796969550989797 050 2 0999898 0 15095969899 25098 4 5 6 6 5 4
+  250 3 4 550 2 4 5 5 4 25093 0 2 4 2 09796969799 350 1 35098979798995099989899 1
+ 509299969697 1 4 5 5 4 2509797 1 4 550979798 3 5 6 6 5 29950 0969695509797 05098
+ 98 0 15095969899509398 4 19796969799 350 3 050989797989950 2 099989899 15094 6 5
+  3 1999898979650 4 2 09950 6 5 4 2 09998509899 0 2 4 450969850 0 45098989950 198
+ 999950 0 0995092 299979695959697 3509697985099979696979950 0 1 3 3 4 4 350 1 4 4
+ 50 2 3 5 650 5 650 5 5 4 3 1989695959696509294959650 29997969695509897979850 2 0
+ 99989899 050959798 15098 4 5 6 6 5 4 29950 3 4 550 2 4 5 5 4 25095 09999 0 1 1 0
+ 5099 15099 15097989999 1 45098 0 0 2509699 0 250 1 250 1 1 2 35095 09999 0 1 1 0
+ 5099 15099 150979899999897955098 0 099509699 0 250 1 250 1 1 0989550 1 2 3509396
+ 979850 3 199989897965098989750 099995099989999 150 3 1 0 050 0 0 1 2509799 0 350
+  0 4 5 5 3 150 3 4 4 350 0 5 550969850 0 5509597989950 5 2 099999850 1 0 0 250 5
+  3 2 1 1 2 35098 0 1 45087899091919092509092929192939250889193939492509698999998
+  0509899 0 099 0 1 050939698 0 1 1 2 050 4 5 7 7 91250 5 8 81050 1 4 6 7 91050 9
+ 1050 9 91011509193949595949650949696959697965092959797989650 0 1 3 3 5 850 1 4 4
+  65097 0 2 3 5 650 5 650 5 5 6 75092969695509797 050999898 0 15095969899 2509699
+  4 5 6 6 5 4 250 3 4 550 2 4 5 5 4 250929795959696945096975096969797509696979898
+ 99 1 250989750 19950 2 0985096945098 4 5 6 6 5 4 250 3 4 550 2 4 5 5 4 25092 299
+ 979695959697 3509697985099979696979950 0 1 3 3 450 1 4 450 2 3 5 650 5 650 5 5 4
+ 5093969798989750979999 1509598 0 0 1 2509799 0 350 2 3 5 4 050 3 45094 6 5 3 199
+ 9898979650 4 2 09950 6 5 4 2 099985098 050989899509998999950 0 0995096985094 1 0
+ 99989650 1 1 4 450969950 1 45099999850 099 0 0 250 1 1 2 35098 0 1 4509193949595
+ 945094969698509295979799 05094959798 0 350 4 2 3 3 5 850 4 5 4 3 4 4 650 4 6 5 5
+  6 750929795959696955096969797 0509696979898 0 15095969899 25098 4 5 6 6 5 4 250
+  3 4 550 2 4 5 5 4 25088939191929291935092929393929394935092929394949593509799 0
+  0995099 0 1 1 450949799 1 2 2 4 55099 0 2 3 650 2 8 91010 9 8 650 7 8 950 6 8 9
+  9 8 6509397989999989695959698 1 4 4 3 35098 0 0 3509699 1 1 3 450 6 2 199979550
+  3 4 6 5 150 4 5509297959596969550969697979950969697989899 050959798 15098 4 5 6
+  6 5 4 29950 3 4 550 2 4 5 5 4 2509396 1 3 4 4 39950 1 350 0 2 3 3 2 150 1 3 4 4
+  3 1999796969799 550 0 2 35099 2 3 3 2 150
+  850129091929189888889909397 0 2 3 4 0909398 0 088899298 1 3 0 4 7 0 4 8 0 4 9 4
+  0899090898888899092 7 9 5 09092 6 8 0888992 5 7501399 0 1 1 09795929088 09793 0
+  1 098959391898888899092 0 3 5 09092 2 0888992 3 5 09189888889909293 09092 08889
+ 929393 09398 09597 0 3 6 8 9 9 8 5 5 6 0969698 0969799 1 0 8 8 5 5 0 7 8 8 7 5 4
+  4 6 8 9 8 75012908888899296 0 4 7 8 9 9 8 7 5 0909295 0 4 7 8 08889919599 3 5 7
+  8 8 7 5 088909193949698 0 2 093949899 09192949698 0 2 3 3 2 0 088899090 0899090
+  0899191908950139493918988888990929599 3 6 8 9 9 8 5 5 6 090898990919396 0 8 8 5
+  5 09391909091929497 0 0 7 8 8 7 5 4 4 6 8 9 8 7 090939597 1 3 0969799 0 0939599
+  1 3 4 4 3 25012908888899296 0 4 7 8 9 9 8 7 5 0909295 0 4 7 8 08889919599 3 5 7
+  8 8 7 5 088909193949698 0 2 093949899 09192949698 0 2 3 3 2 0 088899090 0899090
+  08991919089 09693 0939494 0949595 0959696945012969593918988888991 090898990 093
+ 919090919190898888 09091939597 1 4 7101112 098 1 4 7 9 0959799 1 4 7 91112121110
+  8 5 2 099 010 9 5 3 01211 9 5 2 09999 0 1 09894 0949595 0959696 096979795501392
+ 90898888899296 0 3 5 7 8 9 9 8 7 5 2999694 0909295 0 3 5 0 5 3999695 088899195 0
+  4 6 8 0 8 6 3999795 088909294959799 1 3 0949599 0 09293959799 1 3 4 4 3 1 09794
+ 92 08892 08991 0888989909291919088501388899193959799 1 3 0949599 0 09193959799 1
+  3 4 5 5 4 3 1999899 0 088909089 08990 08990919189 09893 0939699 2 5 7 8 9 09496
+ 99 3 5 0959597 0 4 6 7 8 0 8 8 7 7 81012131312 0 8 8 0 9 8 850139898979694929089
+ 8888899293 09089899091 0929190909192939392908989 0 6 7 8 7 5 4 4 5 71012 0 6 710
+ 11 0 4 5 7101112121110 8 5 3 09897 0 6 5 099 011 9 7 5 2 09896969798501398989796
+ 949290898888899293 09089899091 0929190909192939392908989 0 6 7 8 7 5 4 4 5 71012
+  0 6 71011 0 4 5 7101112121110 8 5 3 09897 0 6 5 099 011 9 7 5 2 098969697985013
+ 93918988888991939699 5 7 9 09697 3 4 090929597 1 4 6 8 9 9 8 0 4 8 0 7 5 0 4 6 7
+  7 8 6 5 5 4 09795939292939595 09395 092939496 09599 097 6 7 7 098 6 8 098 7 9 6
+ 5012 1 2 2 19997949290 099989493 0 2 1 09896949290898888899092949699 1 2 4 09394
+ 99 0 09092949799 1 3 5 7 0 5 5 7 8 8 7 0 6 6 8 8 0 7 6 6 8 9 9 8 7 5501699 0 1 1
+  09795929088 09793 0 1 098959391898888899194 0 3 5 7 9 8 8 09194 0 3 5 0 8 7 7 0
+ 889093 0 4 6 7 6 6 9 0898888899194 0 3 5 7 9 8 8 09194 0 4 0 8 7 7 0889093 1 5 7
+  6 6 9 09089888889909293 09092 08889929393 093959699 2 6 9 6 09698 2 5 8 0939597
+  1 5 7501499 0 1 1 09795929088 09793 0 1 098959391898888899194 0 3 5 7 9 8 8 9 0
+ 9193 0 3 5 6 0 8 7 7 0889093 0 4 7 6 6 9 09089888889909293 09092 08889929393 093
+ 959699 2 6 9 6 09698 2 5 8 0939597 1 5 75014888991939599 1 094959798 091939799 1
+  2 2 1 0 0888991939598 1 4 6 8 9 9 8 5 5 6 08990929394 088909193949698 0 8 8 5 5
+  0 7 8 8 7 5 4 4 6 8 9 8 7501499 0 1 1 09795929088 09793 0 1 0989593918988888990
+ 92 3 0 5101213131210 91011 090921012 0888992 3 0 5101213 09288 088919397 0 3 6 9
+  089939697 090929598 1 4 6 0 7 4 3 0 3 4 6 0 8 5 4 4 0 9 6 5 0 5 5 6501488899193
+ 9599 1 094959798 091939799 1 2 2 1 0 0888991939598 1 4 6 0 8 9 9 8 5 5 6 0899092
+ 9394 088909193949698 0 8 8 5 5 0 8 8 7 5 4 4 6 8 9 8 7 0 6 4 4 8 8 0 5 5 8 0 5 5
+  9 9 7501499 0 1 1 09795929088 09793 0 1 098959391898888899092 4 6 8 9 9 8 09092
+  4 6 0888992 4 7 9 0 4 8 0 7 5 0 4 6 7 7 8 6 5 5 4 09189888889909293 09092 08889
+ 929393 09398 097 7 9 6 097 6 8 096 6 7 75014908988899193939190909193 09290898990
+  091929289888889919396 0 3 5 7 8 9 9 8 7 5 29997969697 0 1 1 0 6 7 8 8 7 0 3 5 6
+  7 7 6 5 4 2 09797 1 1 099979798 1 2 2 19997959450139695939189888889929291 09089
+ 899092 0939190909193939189888990 091949698 2 4 09798 0 1 09496 0 2 4 5 5 4 2 0 7
+  8 9 8 6 4 4 5 7 8 8 7 0 5 5 8 8 0 6 5 5 6 8 9 9 8 65011909091 5 6 08990 6 8 091
+ 8890 5 7 7 0 6 6 7 9 7 4 0909091 7 9 6 08990 7 8 091889091 6 7 7501499 0 1 1 097
+ 95929088 09793 0 1 098959391898888899092 0 3 5 09092 2 0888992 3 5 0918988888992
+ 93 09092 08889929393 09393949698 0 2 09799 0959698 0 4 6 8 9 9 8 5 5 6 0 8 8 5 5
+  0 7 8 8 7 5 4 4 6 8 9 8 7501799 0 1 1 09795929088 09793 0 1 0989593918988888990
+ 929699 2 4 0909297 0 088899297 1 4 089888889 08889919598 1 3 5 7 09596 1 2 08889
+ 91949699 2 4 6 8 9 9 8 6 5 5 6 0 8 5 5 0 9 8 5 4 4 6 8 9 8 7 08888899293 09092 0
+ 8889929393 09393949698 0 2 09799 0959698 0 5 7 8 9 9 8 0 8 8 7 0 7 8 8 7 6501290
+ 9091929597 099 3 6 9 8 9 0 8 7 7 0 7 7 6 9 089909194 3 5 7 8 0918889919497 099 2
+  5 6 7 7 0 3 6 8 9 6 09491888988 0899090 090909188 0 19797 0979795 09898 0 19999
+  0999995501399 0 1 1 09795929088 09793 0 1 09895939189888889909297 0 2 3 5 5 090
+ 9298 1 3 6 088899298 2 4 7 4 09288 089 811 089 6 9 088 4 8101213131210 8 7 8 950
+ 129189888889909295979899 0999896 090919697 0888991969899 0 3 1 09999 0 2 4 81012
+ 131312 8 7 0 2 4 810 099 1 3 9111213 01211 8 7 0131211 8 7 7 810111150 995969798
+  1 4 7 9 6 0 4 7 8 09698 1 3 6 8 0969798 7 9 6 09698 6 8 095969797 09897 098 6 7
+  750 9909193 088899193 6 7 09193 6 8 088899093 6 7 8 0 7 7 8 9 8 0989597 0 3 6 7
+  8 0969799 09698 1 3 6 850 6969897959698 0 5 7 9 7 09697 098 0 5 7 8 09799 4 6 8
+ 50 9889193949698 0 3 6 8 09293959798 09091929597 0 3 6 8 9 09698 6 7 098 6 8 097
+  6 7 8 0 7 7 8 950 6 3999598 0 5 7 9 7 09996 098 0 5 7 8 0 0979799 4 6 850 78889
+ 89888890959798 090908989 088909191909091 0939596979798 09898 09898 098 214 09797
+ 96 9 098 21450 995969798 1 4 7 9 6 0 5 7 8 09698 1 3 6 8 0969798 6 91113 09698 8
+  095969797 09897 0981012131414131211111250 9909193 088899193 6 7 09193 7 8 08889
+ 9093 6 7 7 0 7 8 9 6 0989597 1 5 8101214 09697 0 09699 2 5 91250 588899091908988
+  08990 09089 0979798 7 9 6 09697 6 8 098959697 09897 098 6 7 750 588899091908988
+  08990 09089 0979798 9121314 09697 911 098959697 09897 098 9111314 0 9111250 790
+ 9193 088899193959798 098 6 7 0919395 0979795 6 8 088909397 098 6 7 7 0 7 8 9 6 0
+ 949192949697 092939496 0979798 09898 0989850 5909193 088899193 6 7 09193 7 8 088
+ 899093 6 7 7 0 7 8 9 65013979798 6 7 9 09698 6 7 8 7 6 0989597 6 7 9 0969799 6 7
+  9 0969799 6 7 8 7 6 09896959698 6 7 9 0969798 7 9 6 09698 6 8 0989695969797 098
+ 97 098 6 7 750 9979798 6 7 9 09698 6 7 8 7 6 0989597 6 7 9 0969798 7 9 6 09698 6
+  8 0989695969797 09897 098 6 7 750 998 6 7 098 6 8 09798 6 7 8 0 7 7 8 9 8 09897
+ 9597 0 3 6 7 8 0969799 09698 1 3 6 850 992949699 6 8 0 714 0959699 9 093949699 6
+  6 7 8 0 714 0 8 7 0 8 9 7 0 7 8 0989597 0 3 6 7 8 0969799 09698 1 3 6 850 99596
+ 9798 1 4 7 9 6 0 5 7 8 09698 1 3 6 8 0969798 614 09698 9 095969797 09897 098 614
+ 50 7979798 6 7 09698 7 8 0989597 6 7 7 0 7 8 9 6 09698979597 0969750 58889898888
+ 90959798 090908989 088909191909091 09398 098 214 0979796 9 098 214 0989850 69194
+ 969798 091979798 09898 09898 098 6 7 0979795 6 8 098 6 7 7 0 7 8 9 650 9979798 6
+  7 09698 6 8 0989597 6 7 8 0 7 7 8 9 8 6 0959798 7 9 6 09897969798 6 8 0959798 6
+  7 750 9939597 0 6 7 09697 0 6 8 0949597 0 6 7 8 0 7 7 8 9 8 0989597 0 3 6 7 8 0
+ 969799 09698 1 3 6 85013939597 0 6 7 9 09697 0 6 7 8 7 6 0949597 0 6 7 9 0969799
+  6 7 0969799 6 8 09896959698 6 7 8 0 7 7 8 9 8 0989597 0 2 6 7 8 0969799 09698 1
+  3 6 850 8979798 6 6 7 91113141413121213 09698 6 8 0989597 6 7 8 0 7 9 8 7 7 9 0
+ 9698979597 0969750 9939597 0 6 7 09697 0 7 8 0949597 0 6 7 7 0 7 8 9 6 0989597 1
+  5 8101214 09697 0 09699 2 5 91250 798959698 0 2 4 09697 0969799 0 2 3 0 3 5 711
+ 1314141311 9 7 6 4 0 4 5 7 0 4 6 811131450
diff --git a/bin/build_fonts/unix/in_fnt16a.chr b/bin/build_fonts/unix/in_fnt16a.chr
new file mode 100644
index 0000000..e0ef195
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt16a.chr
@@ -0,0 +1,138 @@
+ 99  -9  21 ;GOTHIC ITALIAN-UPPER CASE                                  
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  56 122 183 230 317 387 478 529 553 596 667 713 782 831 886
+  938101310831178124512971329139714391487   1   1   1   1   1   11561160416361660
+ 16931719175217941837187519131965198720542099212821762208224022822310235123882448
+ 24882538   1   1   1   1   12581
+ 925087969492919090919350929191925096949392929393929050 4 6 6 450 7 750 8 8509093
+ 99 4 8105092 650909399 4 8105087949450959550989696985090929498 3 6 8 8 750 6 7 7
+  650 3 5 6 6 550999796969798 1 4 7 91010 9 7 5 29894929050 8 9 9 850 4 7 8 8 7 5
+ 508710 9 8 6 4 1999694929190909192949699 1 4 6 8 91050 9 8 8 950 8 750 8 7 6 450
+ 9291919250969493929293949650 7 850 4 6 7 85087939350949450969595965090919396 1 4
+  6 8 91010 9 8 6 4 19693919050 8 9 9 850 4 6 7 8 8 7 6 4508710 9 8 6 4 199969492
+ 9190909192949699 1 4 6 8 91050 9 8 8 950 8 750 8 6 45092919192509694939292939496
+ 50 7 850 4 6 7 850929396 3 6 85098 0 3 5 75095 0 3 5 7 850 8 7 6 5 6 75087929250
+ 9593935097959494965090929497 1 4 6 7105010 9 8 8 91050 8 750 4 6 7 850949597 2 5
+  75099 2 4 65096 2 4 6 7 7 6 5 4 5 650909296 1 710508710 9 8 6 4 199969492919090
+ 9192949699 2 4 6 7 8 91050 9 8 8 950 8 750 8 7 6 4509291919250969493929293949650
+  6 7 750 4 5 6 6509394959493925092939597 0 3 550939597 0 250929497 3 7 850879292
+ 905093935096949450909296 1 71050949597 0 4 7 91010 9 750 8 9 9 850 4 6 7 8 8 7 7
+  81050909498 35087999950 0 050 1 150909498 2 61050909397 3 7105087 2 4 4 3 150 5
+  5 450 6 650909498 2 61050919090919396 1 4 6 81050919293509092939496508792929050
+ 93935096949450909296 1 71050949597 0 3 6 7 7 6 199989899 09950 5 6 6 550 3 5 5 4
+  150 1 4 7 8 8 750 5 7 750 1 4 6 7 8 91050909498 35087929250939350969494965010 8
+  7 6 6 7 950 8 7 7 85010 9 8 8 91050909296 1 71050909296 1 7105087999950 0 050 1
+  15096949291909091939598 2 5 7 91010 9 8 6 450929191925094939292939550 8 9 9 850
+  5 7 8 8 7 650909498 2 61050909397 3 71050879292905094939350979594945090929497 1
+  4 6 8 91010 9 750 8 9 9 850 4 6 7 8 8 7 7 8 91050909498 35087999694929190909192
+ 949699 1 4 6 8 91010 9 8 6 4 199509291919250969493929293949650 8 9 9 850 4 6 7 8
+  8 7 6 45087929250959393509997959494965090929699 2 5 7 91010 9 7 4 097959450 8 9
+  9 850 5 7 8 8 7 450909296 1 7105087999694929190909192949699 1 4 6 8 91010 9 8 6
+  4 199509291919250969493929293949650 8 9 9 850 4 6 7 8 8 7 6 450929396 2 91010 9
+  9105098 050939699 1 25087929290509393509494509092949699 3 7 91010 9 850 7 8 9 9
+  850 3 5 7 8 8 750 6 3 09898 0 3 6 81010 9 850 6 7 9 9 850 2 4 6 7 8 91050909498
+  35087 2 810 9 9 7 5 29895929191929497 0 2 3 4 450 9 8 95092939497 0 25093929293
+ 9598 0 2 4 5 65094959698 0 3 5 7 8 8 7 55098 0 3 6 8 9 9 8509192915096969798 0 3
+  6 91010 9 7 5 298959391919092985087999593929190909192939598 1 4 6 8 91010 9 7 5
+ 50 3 2 2 3 4 3509192949699 2 55092919192949699 2 5 7 910509093509394509192939599
+  5 810508794929190909192949699 3 6 85093929191925093949493929293949650 4 6 6 5 3
+ 50 7 7 650 8 81050909399 4 810508790 050919299 0509293 0 15010 050 5 350 7 3 2 2
+ 50909297 3 810508794929190909192949699 1 4 6 8 91010 9 8 65092919192935092939392
+ 9293949650 7 8 9 9 850 4 6 7 8 8 7 7 850999950 0 050 1 150909498 2 610508790 6 7
+ 509193 85094105010 15099925098959450999594939350909498 2 61050909296 1 7105087 6
+  650 7 750 8 8509391909091939598 1 4 6509497 35090919396 2 450909498 2 610509092
+ 9498 2 610508790919396 1 4 7 8 8 750 6 7 7 650 4 5 6 650 6 2 09898 0 2 650 2 4 5
+  4 250 7 91010 9 7 5 298959391909091929496989897969750 6 8 9 9 850 6 7 8 8 7 550
+ 9298959598 250969698509797 050 0959697965097 1 3 5 5 650 3 4 4 3 4 5 450 1 3 3 2
+  4 650919694959598 3 5509696985096989797 05097 2 5 550 2 4 450 0 3 35093969698 0
+ 5097979850989899 05096 2 4 2 050 1 35092 0959598 0 3 550969698509797 050989899 5
+  55098 4 450989598 3 35093969698 05097979850989899 05096 2 59850 1 450 0 3509397
+ 97969850989897989998509999 0985097 3 5 3 150 2 45094975099 35092959598 350969698
+ 509797 0509597 2 5 5 4 3 1999795979950 2 4 4 350989650 0 3 3 2 15091969495959496
+ 50969695969796509698979798965097 0 2 5 5 2 2 3 4 250 2 4 4 350 0 3 3 25095 098 0
+  2 050 099 0 1 050 098999998 050 0 1 099 0 099 0 1 050 0 2 1 1 2 05095 098 0 2 0
+ 50 099 0 1 050 0989999 250 0 1 099 0 0 150 0 2 1 1 2 2 09898 0509196949595949650
+ 969695969796509698979798965097 0 2 4 19750 1 350 0 250 0 1 2 4 650 1 2 3 450 1 2
+  4 5 65095 098999998 050 0 099 0 1 050 0 2 1 1 2 0508789909191909250919292919293
+ 925089919393949250939698 1 1 2 05098 0 099 0 1 05096999998 050 1 4 6 9 910 850 6
+  8 8 7 8 9 850 4 7 7 6 850919394959594965095969695969796509395979798965097 0 2 5
+  5 6 450 2 4 4 3 4 5 450 0 3 3 2 45092959598 3 550969698509797 0509597 2 5 550 2
+  4 450 0 3 350919495959395959496509696509496979799 050969799509798 3 55097979896
+ 5097 0 2 5 550 2 4 450 0 3 35092959598 350969698509797 0509597 2 5 5 6 450 2 4 4
+ 50 0 3 3 2 4509395969797969850979898979899985095979999 0985099 3 5 3 150 2 45092
+ 959597 3 5 5509696975097979850 3 4 450 2 3 35095 1 4 29950 0 350 5999597 1509799
+ 5095 098999998 050 0 099 0 1 050 0 2 1 1 2 050969950 1 450919394959598 350959696
+ 985093959797 050 4 6 5 5 6 750 4 5 4 3 4 4 550 4 2 3 3 5 7509194959599 1 5509596
+ 96995094969797 0 150 4 6 5 550 4 5 4 3 4 450 4 2 3 35087909191959799509192929550
+ 90929393969750 0989999 3 5 950 0 1 099 0 0 350 0 2 1 1 4 550 810 9 950 8 9 8 7 8
+  850 8 6 7 750919496 3 4 6509597 3 550949697 4 650 6 4 4 6 6 4 15099969496969494
+ 50969950 1 450919394959598 350959696985093959797 050 4 6 5 5 4 3 1999795979950 4
+  5 4 3 4 4 350989650 4 2 3 3 2 15094 09797 0 2 5 5 050 2 4 450 0 3 3 250 0 5 5 4
+  3 1999795979950 4 4 350989650 2 3 3 2 150
+  850139091939598 1 3 4 09497 1 3 090929497 0 4 6 8 9 09090 7 7 090 7 089 8 08889
+ 90908988 09898 0 9 8 7 7 8 9501389 8 089 8 08889 8 9 0929089888889919395 0909193
+ 95 08889919394 0 3 2 09896959494959799 2 5 7 8 9 9 8 7 5 09799 3 5 0949699 3 6 8
+ 5013889092908988888990929497 0 3 5 7 8 9 9 8 7 5 7 9 09095 2 7 09392 096939189 0
+ 9396 1 4 089919396 1 4 6 8 0 5 4 0 8 6 4 1501389 8 089 8 08889 8 9 0939189888889
+ 90929497 0 3 5 7 8 9 9 8 6 4 09396 1 4 089919396 1 4 6 8501388909290898888899092
+ 9497 0 3 5 7 8 9 9 8 7 5 7 9 09095 2 7 09392 0959189 09396 1 4 089919396 1 4 6 8
+  0 5 4 0 8 6 4 1 0989797999998 09899 0 099 097 0 1 1 098 0959494959695501390 8 0
+ 8990 7 0888991 7 7 0929089888889909188 088909497 1 3 09193 089919497 09897979898
+ 97 098999998 097 0 09997949393949594 0 9 8 7 7 8 95013889092908988888990929497 0
+  3 5 7 8 9 9 8 7 6 4 7 9 09095 2 7 09392 096939189 09396 1 4 089919396 1 4 6 8 0
+  6 4 0 0 8 7 499 0 1 0 1 2 2 1 098969595969899 09796969798 0989797999998501389 8
+  9 090 8 09090 8 0888990908988 09896949393949699 2 3 4 09698 1 3 093949597 1 4 6
+  8 9 0 9 8 8 9501391 7 092 6 091 7 0889091919088 0 9 8 7 7 8 950139191 6 8 9 091
+  6 7 090 7 0889091919088 09799 3 6 8 9 9 8 7 5 2 0 3 6 7 0 1 3 6 8 9501389 8 9 0
+ 90 8 09090 8 0888990908988 0989694939394959798 0 1 2 3 4 3 2 094959798 093959798
+  0 0 0 0 1 3 5 6 0 1 3 5 0 0 1 3 6 8 9 9 0 9 8 8 9501389 8 090 7 09090 7 7 09396
+ 98 1 3 5 6 097 0 3 5 0939599 2 6 9 0888990908988 0 9 8 7 7 8 9501391 7 092 6 091
+  7 0 7 5 4 3 095929089888889909295 0 3 4 5 7 0 3 09592 0 5 3 0949189 09295 0 3 0
+ 899194 0 3 5 0889091919088 0 9 8 7 7 8 9501390 8 9 09091 8 0888991 8 09290898888
+ 8990929497 1 3 4 09396 0 3 089919396 0 4 6 8 9 9 0 9 8 8 95013888990929497 0 3 5
+  7 8 9 9 8 7 5 3 097949290898888 09396 1 4 089919396 1 4 6 8 0 4 19693 0 8 6 4 1
+ 96939189501391 8 09092 7 088899193 7 7 093918988888990929597 0 2 3 3 2 097 09294
+ 98 0 089919498 1 3 0 9 8 7 7 8 95013888990929497 0 3 5 7 8 9 9 8 7 5 3 097949290
+ 898888 09396 1 4 089919396 1 4 6 8 0 4 19693 0 8 6 4 196939189 0 1 3 4 5 5 6 8 9
+  8 7 0 5 5 0 3 5 6 6 5501391 8 9 091 8 090 8 0939190898888899193969899 090919396
+ 98 0888991939799 0 0 1 1 098979798 0 3 5 6 6 099 0 4 5 2 09798 0 2 6 8 9 0 9 8 8
+  9501388898890929089888889929597 0 2 3 3 2 19998 0899092 098 0 1 2 2 1 091939698
+  0 1 1 0989797 09999989695959698 0 3 6 8 09594949597 0 3 5 0 5 7 8 0989795949393
+ 9497 0 2 5 7 8 9 9 8 7 5 7 9 8 95013909091929497 1 4 6 7 8 9 9 8 7 5 3 096939190
+  0909193949392 0 1 4 6 7 8 8 7 0929699 2 5 6 7 7 6 5 2 0 08891 09089 08989888990
+ 908988501390929497 0 3 5 7 8 9 9 8 7 0929497 1 4 09192939598 1 4 6 8 09090 6 8 9
+  090 6 7 089 7 9 0888990908988501388 9 08990 5 7 08990 5 6 088 9 096 1 09499 2 4
+  0888990908988501390929497 0 3 5 7 8 9 9 8 7 5 3 097949290 09497 0 3 5 092939497
+  0 4 6 8 0 5 3 09794 0 8 6 4 097949392 091 9 092 8 091 9 0889091919088501388 7 8
+  08990 8 090 9 08898 0 0 8 0 1 3 5 0 0 2 3 5 7 0889091919088 0 9 8 7 7 8 9501390
+  8 090 7 089 7 090929598 1 3 4 5 5 4 3 0 3 4 4 098 0 2 3 3 4 0889091919088 0 5 7
+  8 9 9 8 6501388899090888889919395 089919395 088899194 09697979694939394 0939495
+ 9697 09597 0 2 5 7 8 9 9 8 7 5 2 0979695959698999897 0959799 3 5 0969799 3 6 850
+  999 2 6 9 7 0 2 6 8 0 0 5 8 0 196959697 096969597 6 7 09697 6 7 8 7 6 09698 6 7
+  9 750 8908892 6 9 7 6 090 6 8 0908892 5 8 0979598 6 09698 6 09699 750 598 7 9 7
+  098 7 8 097 6 7 7 09895979896 0969750 89598 6 9 8 7 7 098 6 8 097 5 8 091889198
+  7 09198 6 091919298 750 698 7 9 7 098 7 8 097 6 7 7 0989599 3 09699 096 050 591
+  6 7 9 091 6 7 8 7 6 090 6 7 9 09188909189 08990 09595 0959550 998 6 9 7 098 6 8
+  097 5 8 098979598111314151514151615 096981113 01515 0969912141550 9908892 6 7 9
+  090 6 7 8 7 6 0908892 6 7 9 097969598 71114161614 09698 7 9 09699 81150 5889092
+ 9088 08990919089 0959798 6 7 9 09897969798 6 7 8 7 6 0959798 6 7 950 58890929088
+  08990919089 0959798 711 09897969798 7 9 0959798 811141615161650 8908892 6 7 9 0
+ 90 6 7 8 7 6 0908892 6 7 9 098969598 0 3 09698 09699 0 1 2 7 9 7 0 1 3 7 8 0 0 1
+  6 7 750 5908892 6 7 9 090 6 7 8 7 6 0908892 6 7 95013979798 6 7 9 09697 6 7 8 7
+  6 0979597 6 7 9 097969597 6 7 9 09697 6 7 8 7 6 09698 6 7 9 097969597 6 7 9 096
+ 97 6 7 8 7 6 09698 6 7 950 9979798 6 7 9 09697 6 7 8 7 6 0979597 6 7 9 097969597
+  6 7 9 09697 6 7 8 7 6 09698 6 7 950 898 6 9 7 6 098 6 8 097 5 8 098979598 6 096
+ 98 6 09699 750 89597 6 7 7131614 09714 0959697 6 7 8 0 7 7 8 0 8 9 7 6 0 8131614
+  097969598 6 09698 6 09699 750 998 6 9 7 098 6 8 097 5 8 098979598131614 0969814
+  0969913161450 6979798 6 7 9 09697 6 7 8 7 6 0979597 6 7 9 09795979896 0969750 8
+ 98 1 3 0 2 6 098 1 2 097 1 2 0 1 2 6 0 1 2 7 09895969796 09696 0 6 9 7 6 8 0 7 8
+ 50 5908892 6 7 9 090 6 7 8 7 6 0908892 6 7 9 09595 0959550 9979798 7 9 7 09697 7
+  8 0979597 6 8 0959798 6 7 7 09897969798 7 8 0959798 7 9 750 99597 6 9 7 5 09697
+  6 8 0959697 5 7 7 0959798 5 09897969798 5 0959798 650139597 6 9 7 6 09697 6 8 0
+ 959697 5 7 7 0959798 6 9 7 5 09897969798 6 8 0959798 5 7 7 0959798 5 09897969798
+  5 0959798 650 99798 8 9 7 09697 7 8 0979596 6 7 0959597979597 1 0 3 7 9 9 7 7 9
+  0 2 2 0 2 250 9979798 7 9 7 09697 7 8 0979597 6 8 0959798111314151514151615 098
+ 979697981213 01515 095979812141550 9969897969597 1 3 09697 1 09698 1 2 0 3 51113
+ 14151514151615 0 51213 01515 0 4 512141550
diff --git a/bin/build_fonts/unix/in_fnt17a.chr b/bin/build_fonts/unix/in_fnt17a.chr
new file mode 100644
index 0000000..744a7c0
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt17a.chr
@@ -0,0 +1,118 @@
+ 99  -9  21 ;COMPLEX CYRILLIC - UPPER CASE                              
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1 726 851 883   1   1
+    1 147   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+ 1055   1 925   1   3  22 955182819451973 100 170 2881266 354 398 424 455 483 528
+  783 550 580 613 995  54 814 704 630 242   1   12124   12011   11101114120371243
+ 14291753122812981401185214671506152915601588162518811647168417132072119019121806
+ 17301358   1   1   1   1   12164
+ 925090 09350 0 750 0 65095 450919750 3 9508994945095955091 7 7 65095 3 6 7 8 8 7
+  6 39150 3 5 6 7 7 6 5 3508994945095955091 3 6 7 8 8 7 6 350 3 5 6 7 7 6 5 35095
+  3 6 7 8 8 7 6 39150 3 5 6 7 7 6 5 3509196965097975093 8 8 75093 050889696959493
+ 9250 6 650 7 750931050891050898950908950 9105010105089949450959550 1 15091 7 7 6
+ 5095 15091 7 7 65085 0 050 1 15097 450899089888889909192939496 5 7 8 91011121313
+ 121112509694939291905096959493929189888750 5 7 8 9101150 5 6 7 8 9101213145097 4
+ 5090949393949698 2 5 6 6 5 29950 2 4 5 5 4 250 2 4 6 7 7 6 5 2979594939394959450
+  5 6 6 5 4 25088939350949450 6 650 7 750909750 31050 69450909750 310508893935094
+ 9450 6 650 7 750909750 31050 69450909750 31050969695959698 2 4 55088939350949450
+ 90975094 1 3 4 5 6 7 8 9 9 8 7 850 1 3 4 5 6 750 1 2 3 4 5 6 8 91050909750879595
+ 9493929190898990919050 6 650 7 750921050 310508893935094 05093 050 7 050 7 750 8
+  850909450 71150909650 4115088939350949450 6 650 7 750909750 3105094 650909750 3
+ 10508999969493929293949699 1 4 6 7 8 8 7 6 4 199509997959493939495979950 1 3 5 6
+  7 7 6 5 3 15088939350949450 6 650 7 750901050909750 310508994945095955091 3 6 7
+  8 8 7 6 39550 3 5 6 7 7 6 5 35091985089 6 7 7 6 4 199969493929293949699 1 4 6 7
+ 50999795949393949597995091 0 050 1 150949393 8 8 75097 4509093 05094 150 8 19998
+ 9695949495969550919750 4105088 0 050 1 15097 4509894929191929498 3 7 91010 9 7 3
+ 9850989593929293959850 3 6 8 9 9 8 6 35097 4509093 65094 750 79350919750 3 95091
+ 9750 3 95088939350949450 6 650 7 750909750 31050901050 910501010508893939497 0 3
+  5509494959750 5 550 6 650909750 2 950 2 95084898950909050 0 050 1 1501111501212
+ 5086935097 450 8155086155084898950909050 0 050 1 15011115012125086935097 450 815
+ 5086155014155015155088989850999950919090 25099 6 910111110 9 69550 6 8 91010 9 8
+  650859090509191508794509198 1 2 3 3 2 198875098 0 1 2 2 1 09850 9 950101050 613
+ 50 613509095955096965092995096 3 6 7 8 8 7 6 39250 3 5 6 7 7 6 5 350909493939496
+ 99 1 4 6 7 8 8 7 6 4 1989594939394959450 1 3 5 6 7 7 6 5 3 15098 750859090509191
+ 50879450879450 4 1999897979899 1 4 6 9111213131211 9 6 450 4 2 099989899 0 2 450
+  6 8101112121110 8 65091975089 5 550 6 650 99794939292939497 5509795949393949597
+ 50 0989794939291509897959492919150 2 95091969695959698 2 4 5 6 6 7 850 5 5 6 8 9
+ 50 5 4989594949598 1 3 5509896959596985090 6 59996949393949699 1 4 6 7 7 6 4 199
+ 96949350 6 5 399969450999795949495979950 1 3 5 6 6 5 3 1509095955096965092 3 6 7
+  7 6 350 3 5 6 6 5 35096 3 6 7 7 6 39250 3 5 6 6 5 3509095955096965092 6 6 55092
+ 995088969695949350 5 550 6 65093 950919090 9 9 8509094 6 6 5 4 29996949393949699
+  1 4 650 5 5 45099979594949597995087 0 050 1 15097 450929190919293959698 3 5 6 8
+  9101110 9509896959392509896949391908950 3 5 6 8 950 3 5 7 81011125097 450919594
+ 94959698 2 5 6 6 5 250 2 4 5 5 4 25099 2 5 6 6 5 29895949495969550 2 4 5 5 4 250
+ 89949450959550 5 550 6 650919850 2 950919850 2 950 5955089949450959550 5 550 6 6
+ 50919850 2 950919850 2 950 59550979796969799 1 3 450909595509696509299509698 1 2
+  4 5 6 7 6 55098 1 2 4 55098 0 1 3 4 6 7 8509299508996969594939291929350 5 550 6
+  65093 950 2 9508994945094 05095 050 6 050 6 650 7 750919550 61050919750 3105089
+ 949450959550 5 550 6 650919850 2 95095 550919850 2 950909996949393949699 1 4 6 7
+  7 6 4 19950999795949495979950 1 3 5 6 6 5 3 15089949450959550 5 550 6 65091 950
+ 919850 2 95089949450959550959799 1 4 6 7 7 6 4 199979550 1 3 5 6 6 5 3 150919550
+ 91985090 5 4 5 6 6 4 29996949393949699 1 4 65099979594949597995091 0 050 1 15095
+ 9494 7 7 65097 4509194 05095 050 6 09896949392939450929850 2 85090 0 050 1 15097
+  150 099989694939394969899 05096959494959650 5 6 7 7 6 550 1 2 3 5 7 8 8 7 5 3 2
+  15097 4509094 55095 650 69450929850 2 850929850 2 85089949450959550 5 550 6 650
+ 919850 2 95091 9 9 8508994949598 0 3 5509595969850 5 550 6 650919850 2 950 2 950
+ 85909050919150 0 050 1 15010105011115087945097 450 7145087145085909050919150 0 0
+ 50 1 15010105011115087945097 450 71450871414135090999950 0 050949393 350 0 4 7 8
+  8 7 49650 4 6 7 7 6 450879292509393508996509397 0 1 1 09789509799 0 0999750 7 7
+ 50 8 850 41150 411509297975098985094 15098 2 5 6 6 5 29450 2 4 5 5 4 25091959494
+ 959698 1 4 6 7 7 6 4 19896949495969550 1 3 5 6 6 5 3 150 0 650869191509292508895
+ 50889550 4 199989899 1 4 6 911121211 9 6 450 4 2 09999 0 2 450 6 810111110 8 650
+ 92985089 4 450 5 550 8979493939497 45097959494959750 29998969550 2 0999796949392
+ 50 1 850
+  8501088 9 088 9 091 9 0 3 3 0 9 9 0 9 9501188 9 088 9 088889488 0989899 0 2 5 7
+  8 9 9 09899 0 2 5 7 8 9501188 9 088 9 0888889909294969798 08889909294969798 098
+ 9899 0 2 5 7 8 9 9 09899 0 2 5 7 8 950 988 9 088 9 088889488 0 9 950128894 2 6 8
+  9 088 9 088 9 08888 0 9 9 0 916 0 916 0 916 0 916501088 9 088 9 094 2 088889488
+  09898 0 9 9 3 9501688 9 088 9 08888 0899091908988888991959798989795918988888990
+ 919089 09899 1 6 8 9 09899 1 6 8 9 9 8 6 09899 1 6 8 9 09899 1 6 8 9 9 8 6 0 9 9
+ 501091889491898888899194969797 0888991949697 09798 0 2 5 7 8 9 9 8 7 5 4 3 4 5 0
+ 99 2 5 7 8 9501288 9 088 9 088 9 088 9 08888 08888 090 7 0 9 9 0 9 9501288 9 088
+  9 088 9 088 9 08888 08888 090 7 0 9 9 0 9 9 0828181828485858482501288 9 088 9 0
+ 8888 098989795918988888990919089 09899 1 6 8 9 09899 1 6 8 9 9 8 6 0 9 950128894
+  2 6 8 9 9 8 7 6 7 8 088 9 088 9 08888 0 9 9501388 9 088 6 088 9 088 9 088 9 088
+  9 08888 08888 0 9 9 0 9 9501288 9 088 9 088 9 088 9 08888 08888 09898 0 9 9 0 9
+  950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4 6 8 9 0 9 8 6 4
+  09793918988501288 9 088 9 088 9 088 9 08888 0 9 9 0 9 9501188 9 088 9 088888990
+ 929597989999 08889909295979899 0 9 950109194889189888889919396 1 4 6 8 9 9 8 6 4
+  08889919396 1 4 6 8 9501088 9 088 9 0889488889488 0 9 9501188 4 088 4 088 4 7 8
+  9 9 8 7 6 7 8 08888 08888501388 9 088 9 08888 091929497 0 3 5 6 6 5 3 097949291
+ 91 091929497 0 3 5 6 0 6 5 3 097949291 0 9 9501088 9 088 9 088 9 08888 08888 0 9
+  9 0 9 9501288 9 088 9 088 9 088 9 08888 08888 0 9 9 0 916 0 91650118899 1 2 2 1
+ 99 08899 1 2 088 9 088 9 08888 08888 0 9 9501788 9 088 9 088 9 088 9 088 9 088 9
+  08888 08888 08888 0 9 9501788 9 088 9 088 9 088 9 088 9 088 9 08888 08888 08888
+  0 9 9 0 916 0 916501488 9 088 9 088948888 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8
+  9501588 9 088 9 08888 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8 9 088 9 088 9 08888
+  0 9 9501188 9 088 9 08888 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8 950119188949189
+ 888889919396 1 4 6 8 9 9 8 7 5 4 3 4 5 08889919396 1 4 6 8 9 09898501688 9 088 9
+  08888 0 9 9 08889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4 6 8 9 0
+  9 8 6 4 09793918988 09898501188 9 088 9 088888990929496979898 08889909294969798
+  09899 0 7 8 8 7 099 1 8 9 9 7 6 0 9 9501197989897969595969799 6 8 9 097 6 8 9 9
+  099 0 1 2 4 6 8 9 9 8 6 0 1 2 4 6 8 95010888991939699 3 6 8 9 9 8 6 3 198969595
+ 9698 1 0889091929496 0959698 1 3 6 8 9 0 9 8 6 3 1989695501095 9 095 9 095959698
+ 99 1 2 095969899 1 2 0 2 2 3 5 6 8 9 9 0 2 3 5 6 8 950 895 9 095 9 09595 095 0 9
+  950119599 5 8 9 095 9 095 9 09595 0 914 9 914 950 9 1 199979695959698 1 3 6 8 9
+  9 8 6 0 19896 0959698 1 3 6 8 9501495 9 095 9 09595 0969796959596 0 1 2 2 1 096
+ 9595969796 0 2 3 4 8 9 0 2 4 8 9 9 8 6 0 2 3 4 8 9 0 2 4 8 9 9 8 6 0 9 950 99795
+ 9997969595969899 1 2 095969899 1 2 0 2 2 3 5 6 8 9 9 8 6 5 4 5 6 0 2 3 5 6 8 950
+ 1195 9 095 9 095 9 095 9 09595 09595 0 9 9 0 9 9 096 8501195 9 095 9 095 9 095 9
+  09595 09595 0 9 9 0 9 9 096 8 0898888899192929189501095 9 095 9 09595 0 2 2 1 0
+ 969595969796 0 2 3 4 8 9 0 2 3 4 8 9 9 8 6 0 9 950119599 5 8 9 9 8 7 8 095 9 095
+  9 09595 0 9 9501295 9 095 9 095 7 095 9 095 9 095 9 09595 09595 0 9 9 0 9 95011
+ 95 9 095 9 095 9 095 9 09595 09595 0 2 2 0 9 9 0 9 95010959698 1 3 6 8 9 9 8 6 3
+  198969595 0959698 1 3 6 8 9 0 9 8 6 3 1989695501195 9 095 9 095 9 095 9 09595 0
+  9 9 0 9 950109516 09516 0989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 9 09595 0
+ 161650 99899 099989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 9501095 9 095 9 095
+  09595 095 0 9 950 995 9 095 7 095 913151616151415 09595 0959550118816 08816 088
+ 88 0989695959699 5 8 9 9 8 6 0959699 5 8 9 0959699 5 8 9 0989695959699 5 8 9 9 8
+  6 01616501095 9 095 9 095 9 09595 09595 0 9 9 0 9 9501195 9 095 9 095 9 095 9 0
+ 9595 09595 0 9 914 9501195 2 4 5 5 4 2 095 2 4 5 095 9 095 9 09595 09595 0 9 950
+ 1695 9 095 9 095 9 095 9 095 9 095 9 09595 09595 09595 0 9 9501695 9 095 9 095 9
+  095 9 095 9 095 9 09595 09595 09595 0 9 914 9501195 9 095 9 095 09595 0 2 2 3 5
+  6 8 9 9 0 2 3 5 6 8 9501395 9 095 9 09595 0 2 2 3 5 6 8 9 9 0 2 3 5 6 8 9 095 9
+  095 9 09595 0 9 950 995 9 095 9 09595 0 2 2 3 5 6 8 9 9 0 2 3 5 6 8 95010979599
+ 979695959698 1 3 6 8 9 9 8 6 5 4 5 6 0959698 1 3 6 8 9 0 2 2501595 9 095 9 09595
+  0 9 9 0959698 1 3 6 8 9 9 8 6 3 198969595 0959698 1 3 6 8 9 0 9 8 6 3 1989695 0
+  2 2501095 9 095 9 09595969899 1 2 2 095969899 1 2 0 2 3 4 8 9 0 2 3 4 8 9 9 8 6
+  0 9 950
diff --git a/bin/build_fonts/unix/in_fnt18a.chr b/bin/build_fonts/unix/in_fnt18a.chr
new file mode 100644
index 0000000..cdaa759
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt18a.chr
@@ -0,0 +1,40 @@
+ 99  -7   9 CARTOGRAPHIC ROMAN - UPPER CASE                             
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1 474 509 516 527   1 608 505 548
+  556 582 568 439 564 432 544 308 321 326 336 352 360 375 390 397 417 447 460 592
+  575 600 487   1   3  13  30  42  55  68  78  94 104 108 116 126 133 146 156 171
+  182 200 214 228 235 245 252 265 272 280   1   1   1   1   1   1   3  13  30  42
+   55  68  78  94 104 108 116 126 133 146 156 171 182 200 214 228 235 245 252 265
+  272 280   1   1   1   1   1 629
+ 965095 09650 0 45098 2509597975097 1 3 3 15097 1 3 3 1975095 4 2 098979798 0 2 4
+ 509597975097 0 2 3 3 2 097509597975097 35097 15097 3509597975097 35097 15095 4 2
+  098979798 0 2 4 450 1 45095979750 3 35097 35098 0 05096 1 1 09897975095979750 3
+ 975099 3509597975097 3509496965096 050 4 050 4 4509597975097 350 3 35095 0989797
+ 98 0 1 3 4 4 3 1 0509597975097 1 3 3 1975095 098979798 0 1 3 4 4 3 1 050 1 45095
+ 97975097 1 3 3 19750 0 35095 3 199979798 2 3 3 199975095 0 05096 45095979798 0 1
+  3 4 4509596 050 4 05094969850 09850 0 250 4 2509597 350 397509596 0 050 4 05095
+  3975097 35097 350 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 095 098979798 0 2 3 3 2 050
+ 9598 0 050959799 1 3 3 297 350959799 1 3 3 150 0 1 3 3 199975095 1 150 196 45095
+ 989799 0 2 3 2 099975098 25095 2 098979798 0 2 3 2 098975095 3995097 35095999797
+ 99 1 3 3 1995099979799 1 3 3 15095 3 2 0989798 0 2 3 3 2 0985098 0 0 1 1 05098 1
+  0 0 1 1 05098 0 0 1 1 050 0 0 1 1 05098 0 0 1 1 050 1 0 0 1 1 05098 0 050 1 150
+  0 0 1 1 0509698 0 1 3 3 0 0 1 1 350 0 0 1 1 05098 0 05096989850 2 2509699989899
+  1 2 2 1995095 3 199979799 2 3 3 1999750 0 05095 4965097 2 09999 0 2509698 0 1 1
+  098509496 45094 0 05096 4509496 45096 45095 0 05097 350 3975098 1 0 0 1 1 05098
+  1 0 0 1 1 05094 4 3 2 1 097969697 0 1 1 098979799 1 3 450
+  350 595 4 095 4 0 1 150 595 4 09595969899 09999 0 3 4 450 69695959698 1 3 4 4 3
+ 50 595 4 095959698 1 3 4 450 595 4 09595 09999 0 4 450 495 4 09595 0999950 69695
+ 959698 1 3 4 4 3 0 0 0 050 595 4 095 4 0999950 295 450 395 2 4 4 2 150 595 4 095
+  1 099 450 495 4 0 4 450 695 4 095 4 095 4 095 450 595 4 095 4 095 450 6959698 1
+  3 4 4 3 19896959550 595 4 095959699 0 050 6959698 1 3 4 4 3 198969595 0 2 550 5
+ 95 4 095959699 0 0 0 0 450 5969595969798 0 1 3 4 4 350 595 4 0959550 695 1 3 4 4
+  3 19550 595 4 095 450 695 4 095 4 095 4 095 450 595 4 095 450 59599 4 0959950 5
+ 95 4 09595 0 4 450 0 0 0 1 320 0 0 0 0 0 0 0 0 0 0 0 0 5959698 1 3 4 3 198969550
+  59795 450 59695959698 0 4 450 5969595969899 09999 0 3 4 4 350 595 4 095 1 150 5
+ 9599989899 1 3 4 4 3 0959550 595959698 1 3 4 3 1999899 150 595 4 0959550 5959698
+ 999998969595 099 0 3 4 4 3 09950 598 0 1 09896959698 1 3 4 450 3 3 4 4 3 350 3 4
+  4 3 3 5 750 39899999898 0 3 4 4 3 350 39899999898 0 4 4 3 3 5 750 395 0 095 0 0
+  3 4 4 3 350 5969595969899 0 09998 0 3 4 4 3 350 2959950 49599 0959950 495969899
+ 999896959550 5969595969899 0 1 3 4 4 3 094 550 594 550 4949698 1 3 550 3949698 1
+  3 550 6 0 050 696 4 0 0 050 69898 0 2 250 597 3 098 2 098 250 395979999989850 3
+ 96969595979950 6 0 0 1 3 4 4 3 1 099989695959698 1 3 4 450
diff --git a/bin/build_fonts/unix/in_fnt19a.chr b/bin/build_fonts/unix/in_fnt19a.chr
new file mode 100644
index 0000000..d3f6eaf
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt19a.chr
@@ -0,0 +1,22 @@
+ 99  -7   9 CARTOGRAPHIC GREEK                                          
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   3  13  70  37  47 228  30 242 101   1 105 115 122 135 158 173
+   80 183 194 205 212   1 262 145 249  60   1   1   1   1   1   1   3  13  70  37
+   47 228  30 242 101   1 105 115 122 135 158 173  80 183 194 205 212   1 262 145
+  249  60   1   1   1   1   1 275
+ 965095 09650 0 45098 2509597975097 1 3 3 15097 1 3 3 197509597975097 35095 09650
+  0 45096 4509597975097 35097 15097 35095 3975097 35097 35095979750 3 35097 35095
+  098979798 0 1 3 4 4 3 1 05099 250 2995098 0 05095979750 3975099 35095 09650 0 4
+ 509496965096 050 4 050 4 4509597975097 350 3 3509597 35098 250 2985097 35095 098
+ 979798 0 1 3 4 4 3 1 05095979750 3 35097 3509597975097 1 3 3 197509597 0975097 3
+ 5097 35095 0 05096 450959696979899 0 050 4 4 3 2 1 05094 0 05098969698 2 4 4 298
+ 509597 350 3975094 0 05096979799 1 3 3 450959799979798 0 1 3 4 4 2 450
+  350 595 4 095 4 0 1 150 595 4 09595969899 09999 0 3 4 450 495 4 0959550 595 4 0
+ 95 4 0 4 450 595 4 09595 09999 0 4 450 595 4 09595 0 4 450 595 4 095 4 0999950 6
+ 959698 1 3 4 4 3 198969595 099 0 099 050 295 450 595 4 095 1 099 450 595 4 095 4
+ 50 695 4 095 4 095 4 095 450 595 4 095 4 095 450 59595 099 0 099 0 0 4 450 69596
+ 98 1 3 4 4 3 19896959550 595 4 095 4 0959550 595 4 095959699 0 050 59599 4 09595
+  0 4 450 595 4 0959550 5979695959698 4 097969595969850 695 4 09798 1 2 2 1989797
+ 50 595 4 095 450 695 4 09798 1 2 2 1989750 6 4 4 0989695959698 0 4 450
diff --git a/bin/build_fonts/unix/in_fnt20a.sym b/bin/build_fonts/unix/in_fnt20a.sym
new file mode 100644
index 0000000..7f030ab
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt20a.sym
@@ -0,0 +1,55 @@
+ 27  -9  21 ZODIAC SYMBOLS                                              
+    1  40  86 114 143 175 204 235 280 318 350 375 403 416 465 514 555 607 638 687
+  736 785 827 858 892 926 9631011
+ 8799969391909091939699 2 5 810111110 8 5 29950 09999 0 1 2 2 1 050 0 0 1 1 05092
+ 989697995098979750 3 5 4 250 3 4 4509997969595969799 2 4 5 6 6 5 4 29950 0 050 1
+  15096 55091 0979594949597 0 1 4 6 7 7 6 4 1 050 0 050 1 15096 55086989592908989
+ 90929598 2 5 810111110 8 5 29850 0 05089115089989593929293959899 2 4 5 5 4 29998
+ 5011 5 9 350111110 45010 450889192949799 0 0999896935097989999989650 4 250 5 150
+ 93 7509195955096955095969799 2 5 6 6 5 350 2 4 5 5 2 2 3 5 75093965091 097959494
+ 9597 0 1 4 6 7 7 6 4 1 050 096 0 050 1 5 1 150 09999 0 1 2 2 1 050 0 0 1 1 05089
+ 99 0 050 2 1 150929393949699 0509594949550 9 8 8 7 5 2 150 6 7 7 65096 550899494
+ 5095955091 3 6 7 8 8 7 6 39550 3 5 6 7 7 6 5 35091 7 7 65090 7 39996949393949699
+  3 750 7 4 199989899 1 4 750889795939291919293959799 0 1 1 0999750 19850 8 05010
+  1509097 350 3975093 750 793508896949391909091939496979796939292939598 2 5 7 8 8
+  7 4 3 3 4 6 7 91010 9 7 6 45092939598 2 5 7 85088969493919090919394969797969392
+ 92939598 2 5 7 8 8 7 4 3 3 4 6 7 91010 9 7 6 45092939598 2 5 7 85088929191929496
+ 9899 0 150919395979899 0 050 91010 9 7 5 3 2 1 05010 8 6 4 3 2 1 150889192939598
+  2 5 7 8 9509192939598 2 5 7 8 9509896959494959799 1 3 5 6 6 5 4 250989695959650
+  4 5 5 4 25088959550969650 4 450 5 55091939598 2 5 7 95091939598 2 5 7 95088 994
+ 92919192949698999998 9509192939550999897955091 6 8 9 9 8 6 4 2 1 1 29150 9 8 7 5
+ 50 1 2 3 5508897959492919192949597989897929191929497 1 5 7 8 8 7 4 3 3 4 6 7 850
+ 95939292939450 1 4 6 7 7 6 450899093959550929494509598 0 05097999950 0 3 5 550 2
+  4 450 5 8 91010 9 8 6 39850 7 8 9 9 8 7 5 29850889195949393949699 1 4 6 7 7 6 5
+  950919795949495979950 1 3 5 6 6 5 3 95093 75093 750888992959550919494509598 1 1
+ 5097 0 050 1 4 7 7 950 3 6 6 8115089 89250 8 59950 6 39950 8 7 750 6 6 750999250
+ 989592509999509898995088909297509297 0 5 8 9 9 8 6 5 3 2 2 3 4 5 5 350 5 4 3 3 5
+  6 6 5 35088919498509397 0 35099 2 5 750 4 6 950919498509397 0 35099 2 5 750 4 6
+  9508892969899999896925092959799 050 09997959250 8 5 3 1 050 0 1 3 5 850 8 4 2 1
+  1 2 4 85091 95091 950
+ 148889919497 0 3 6 8 9 9 8 6 3 0979491898888 0979899 0 099989797 0989999989850 9
+ 88899192 0888991 088899192 0888991 09293949699 1 2 3 3 2 1999694939292 0 3 9 0 3
+  9 0 6 65010888991949598 0 1 1 098959491898888 0 1 9 0 1 9 0 5 550148889919497 1
+  4 7 91010 9 7 4 1979491898888 08810 099995014959698 1 2 5 7 8 8 7 5 2 198969595
+  089899096 089959197 090965010918988888991949799 1 3 08889919598 1 088 9 088 9 0
+  3 3501088 3 08899 099979695959698 0 2 4 0959698 0 6 8 9 9 7 088885010969799 2 3
+  6 8 9 9 8 6 3 299979696 090928896 090928896 0 1 2 3 4 4 3 2 1 1 0 2 3 3 2 25012
+ 9088 9 09088 9 090889598 0 1 1 090889699 090889598 0 1 1 090889699 0 5 5501188 9
+  088 9 088888990929597989999 08889909295979899 0 9 9 4 950 9898990929598 1 4 7 9
+ 1010 08990929598 1 4 7 91050139999 0 1 3 5 7 8 9 9 8 7 5 3 1 099 09099 092 0 099
+  2501093 7 093 7 097 3 097 35012 4 3 3 4 6 7 91010 9 7 6 4 097959290898990929597
+  0 4 6 7 91010 9 7 6 4 3 3 4 0959391909091939550129596969593929089899092939599 2
+  4 7 91010 9 7 4 29995939290898990929395969695 0 4 6 8 9 9 8 6 45013959492908989
+ 90919398 092909091929498 9 095949290898990919398 092909091929498 950128993959798
+ 9897959389 089929496979796949289 0979899 1 4 6 8 9 9 8 6 4 1999897 09899 1 4 7 0
+  7 4 19998501292 4 093 3 093 3 092 4 08991929393929189 0 7 5 4 3 3 4 5 750129191
+ 9294969899999896949292 095979899 095939291 0 6 6 5 3 199989899 1 3 5 5 0 2 09998
+  0 2 4 5 65011 3 2 2 3 5 6 8 9 9 8 6 5 39896939190898990929497 0 3 5 7 9 9 8 6 0
+  19896939190 08990929497 0 35013939093 4 09194 4 0939093 3 09194 3 0939093 9 091
+ 94 9 09390929598 1 3 5 7 9 091929598 1 3 5 7 95012 1 1 097959290898990929597 0 1
+  1 0 2 2 09795929089 08990929597 0 2 2 0 6 6 0 7 75013949194 6 09295 6 0949194 6
+  09295 6 0949194 5 7 09295 6 8 5501191 7 0919292 0939392 09194 0 09396 0 0 0 0 0
+  1 1 0 0 0 7 0 1 4 750129793 3 095 5989897959391909091939598 0 3 6 8 09091939599
+  2 5 7 85012979496 095979496 095979496 0959794 0 3 0 2 0 1 3 0 2 0 1 3 0 2 0 1 3
+  0501290929497 0 3 5 7 09091929497 0 0 3 5 6 7 09091929497 0 0 3 5 6 7 090929497
+  0 3 5 7 09898 0999950
diff --git a/bin/build_fonts/unix/in_fnt21a.sym b/bin/build_fonts/unix/in_fnt21a.sym
new file mode 100644
index 0000000..9f8a0b4
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt21a.sym
@@ -0,0 +1,61 @@
+ 32  -9  21 ;MUSIC SYMBOLS                                              
+    1  14  33  52  89 126 161 180 199 225 244 263 313 340 427 531 562 575 594 613
+  646 683 718 737 756 782 801 820 857 884 97110611146
+ 969999 1 1995099 150 19950929599 2 4 5 5 4 35095 1509598 2 4 55092 5 4 2989550 1
+ 9550 3 4 5 5 4 299955090 197949393949699 3 6 7 7 6 4 150 6 150 49994509793509499
+ 5096 1 650 3 75090 197949393949699 3 6 7 7 6 4 150 6 150 499945097935094995096 1
+  650 3 75092 1989695959698 0 3 5 6 6 5 3 15097 35096 45095 55096 65097 55098 450
+ 92979750 3 35095 55095 55095 55095 55092969650 4 45096 45096 45096 45096 4509296
+ 96509699 2 4 5 5 4 19996509699 2 450 3 4 4 3 15087909050101050901050901050901050
+ 90105092959550 5 55095 55095 55095 55095 5509295 550959799 2 4 5 5 3 3 25097 250
+ 99 550 4 450 3 550 5 3 19896959597979850 39850 195509696509597509298979795959698
+  1 3 55096965095975095 15098 350 5 550838990919190898888899193969899 0 09999 0 1
+  3 4 6 7 7 6 5 39892908887868687899296 0 4 6 8 9 9 8 7 5 29895939292939550898990
+ 908950 39994918988878788899250 0 3 5 7 8 8 7 6 4 25087969799 1 3 4 4 3 199979695
+ 959698 1 4 7 910111110 8 6 3 097959391909091939598 2 7111416509392919192949699 3
+  71113165098 25097 35096 45096 45096 45097 35098 2501515171715501616501517501515
+ 1717155016165015175086909050959550 5 55010105095 55095 55095 55095 55095 55095 5
+ 50969999 1 1995099 150 19950929599 2 4 5 5 4 35095 1509598 2 4 55092 5 4 2989550
+  19550 3 4 5 5 4 2999550909895949393949598 2 5 6 7 7 6 5 2985095949495969850 5 6
+  6 5 4 25090 197949393949699 3 6 7 7 6 4 150 6 150 499945097935094995096 1 650 3
+  75092 1989695959698 0 3 5 6 6 5 3 15097 35096 45095 55096 65097 55098 450929797
+ 50 3 35095 55095 55095 55095 55092969650 4 45096 45096 45096 45096 4509296965096
+ 99 2 4 5 5 4 19996509699 2 450 3 4 4 3 15087909050101050901050901050901050901050
+ 92959550 5 55095 55095 55095 55095 5509299 4 0 050 39950 2 298 0 350 5 3 1999796
+ 9697 050 5 3 1979798 050 19896509298979795959698 1 3 55096965095975095 15098 350
+  5 150838990919190898888899193969899 0 09999 0 1 3 4 6 7 7 6 5 39892908887868687
+ 899296 0 4 6 8 9 9 8 7 5 29895939292939550898990908950 39994918988878788899250 0
+  3 5 7 8 8 7 6 4 25091969799 1 3 4 4 3 199979695959698 1 5 912141515141311 8 499
+ 9550 5 811131414131210 7 2995098 25097 35096 45096 45096 45097 35098 25019192121
+ 19502020501921501919212119502020501921508690905091915095955099 1 19999 0 2 5 7 9
+ 1010 9 7 5 3 1 09997969799 0 1 3 5 7 91010 9 7 5 2 09999 1 19950 0 05099 150 7 8
+  9 9 8 750 0 0989698 0 050 7 8 9 9 8 750 0 05099 150
+  499 1 19999 099 1 099 150 898 0 2 4 7 91112 099 2 0 0 1 3 5 750 893959799 0 098
+  1 0888991939698 0 25010959698 0 2 4 5 5 4 2 098969595 09695 0959698 096 0 0 4 5
+  0 5 4 2 0 4 05010959698 0 2 4 5 5 4 2 098969595 09695 0959698 096 0 0 4 5 0 5 4
+  2 0 4 050 9959698 0 2 4 5 5 4 2 098969595 09895 0 096 0 297 0 398 0 4 0 0 5 250
+  88912 08811 09694 09795 0 5 3 0 6 450 888 6 09412 09694 09795 0 5 3 0 6 450 884
+  5 0969494959799 1 3 4 5 096959596 0959799 1 350139194 09194 09191 09292 09393 0
+ 949450 89699 09699 09696 09797 09898 0999950 894 6 094969797969593939597 09697 0
+ 9795 09396 09494 0 6 4 3 3 4 5 7 7 5 3 0 4 3 0 3 5 0 4 7 0 6 650 897959393959697
+ 979694 09396 09494 09597 09796 094 75012202019181717182022232322201814 377706563
+ 6262636569727477818587909296 0 4 7 91010 9 8 5 2989593919090919396 0 3 5 0181919
+ 1818 077818588919396 0 4 6 9 010 9 8 5 298959391905020 1 3 4 4 3 1999796969798 1
+  4 7 91010 9 7 5 298959291909091929497 1 6111517192020191715 09496 0 61014161819
+ 19181715 09797 09898 09999 0 0 0 0 1 1 0 2 2 0 3 3 09496969494 09496 09595 0 4 6
+  6 4 4 0 4 6 0 5 550148218 08218 08218 08218 09593 09694 09795 0 5 3 0 6 4 0 7 5
+ 50 499 1 19999 099 1 099 150 898 0 2 4 7 91112 099 2 0 0 1 3 5 750 893959799 0 0
+ 98 1 0888991939698 0 2501095969799 1 3 4 5 5 4 3 19997969595 09698 1 3 4 5 0 4 2
+ 999796955010959698 0 2 4 5 5 4 2 098969595 09695 0959698 096 0 0 4 5 0 5 4 2 0 4
+  050 9959698 0 2 4 5 5 4 2 098969595 09895 0 096 0 297 0 398 0 4 0 0 5 250 88912
+  08811 09694 09795 0 5 3 0 6 450 888 6 09412 09694 09795 0 5 3 0 6 450 884 5 096
+ 9494959799 1 3 4 5 096959596 0959799 1 350139194 09194 09191 09292 09393 0949450
+  89699 09699 09696 09797 09898 0999950 88595 2 3 094 1 09193 0 3 7 010 7 6 6 7 9
+ 111315 010 8 7 7111315 0 6 81150 897959393959697979694 09396 09494 09597 09796 0
+ 94 75012202019181717182022232322201814 3777065636262636569727477818587909296 0 4
+  7 91010 9 8 5 2989593919090919396 0 3 5 01819191818 077818588919396 0 4 6 9 010
+  9 8 5 298959391905024999796969799 1 3 4 4 3 2999693919090919396 0 5 91114172023
+ 25 090919396 0 5 91114172123 09797 09898 09999 0 0 0 0 1 1 0 2 2 0 3 3 094969694
+ 94 09496 09595 0 4 6 6 4 4 0 4 6 0 5 550148020 08020 08020 084848686838180808183
+ 86919496979796949699 0 1 4 6 4 3 3 4 6 91417192020191714141616 08486 08585 08183
+ 86919496 0949699 0 1 4 6 0 4 6 9141719 01416 0151550
diff --git a/bin/build_fonts/unix/in_fnt22a.sym b/bin/build_fonts/unix/in_fnt22a.sym
new file mode 100644
index 0000000..a673483
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt22a.sym
@@ -0,0 +1,23 @@
+ 39  -9  21 ;ELECTRICAL SYMBOLS                                         
+    1   5   9  13  17  21  25  29  33  37  41  45  49  53  57  66  75  84  93 103
+  113 123 133 139 145 151 157 181 205 229 253 275 295 322 334 344 350 357 367 376
+ 8080205086861450 0 0 0508686145086861450888812509393 750 0 0 0509393 75088881250
+ 9393 7509595 550 0 0 0509595 55089 09895929089895089898990929598 050 0 0 2 5 810
+ 111150 0111110 8 5 2 0508686899398 2 711145098 3 199989899 1 350979799 1 2 2 199
+ 97508686899398 2 711145093 0 793 050929296 4 850939393 7 750929492 8 65092929497
+ 99 2 3 4 4 3 2 199989796969798 1 3 6 85091111110 9 6 4 19794929191929497 1 4 6 9
+ 1011115092 8 6 3 198979696979899 1 2 3 4 4 3 299979492508989899091949699 3 6 8 9
+  9 8 6 3999694919089895087878890929599 3 6 8 9 8 5 199969493939495508787909398 1
+  4 6 7 7 6 4 1989695959698509799979799 1 3 3 1995099989899 1 2 2 19950 099 0 1 0
+ 50 0 0 1 3 4 5 5 4 3 1 0508686925097 350 8145086868614145092 09250 0 85086861450
+ 92 85098 2508686145086 05014 050
+ 20 0 05014148650 08020501486145014 0 05012 79350 7128850 0861450 78812501293 750
+  7 0 050 5 59550 093 750 595 550 0898990929598 050 0 0 2 5 81011115011111110 8 5
+  2 05011 098959290898950149799 1 2 2 1999750 386899398 2 7111450 286899398 2 711
+ 145014 3 199989899 1 350 79296 4 850 8 093 7 050 7 496 49650 8 698 29450 8111110
+  9 6 4 19794929191929497 1 4 6 91011115011 8 6 3 198979696979899 1 2 3 4 4 3 299
+ 97949250 889899091949699 3 6 8 9 9 8 6 39996949190898950 992949799 2 3 4 4 3 2 1
+ 99989796969798 1 3 6 850 998 0 2 3 4 4 3 198969494959698 1 4 7101250 7 2 4 5 5 4
+  29996949393949699 2 7101350 39799 1 3 3 1999797 09899 1 2 2 1999898 099 0 1 099
+ 50 59595969799 1 3 4 5 55014 0 0 0 0 0 0 0 05014 39797 350 886 0 086 05014 0 0 0
+  7 7 014145014 0 0 0 016 0 01650
diff --git a/bin/build_fonts/unix/in_fnt23a.sym b/bin/build_fonts/unix/in_fnt23a.sym
new file mode 100644
index 0000000..fcd7fc8
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt23a.sym
@@ -0,0 +1,20 @@
+ 19  -9  21 ;WEATHER SYMBOLS                                            
+    1  20  37  47  76 103 118 129 141 155 167 175 182 190 198 220 242 274 297 327
+ 98 1 099989899 0 1 1 099509999 0 099509899989899 1 2 2 19950 099 0 1 0509698 250
+  2985096 45095 099979550 0 1 3 550 09750 0 350 09850 0 25099 15095 5509595959697
+ 99 1 3 4 5 55098 25097 35096 45096 45095 550949494 0945094985094975094955095 099
+ 979550 0 1 3 55095 5 5 4 3 199979695955089111110 8 5 298959290898950959595969799
+  1 3 4 5 55094949699 1 4 650 0 0 2 3 2 050 0 0 3 4 4 3 25096 097969697985095 5 4
+  299979695959697 3 4 5 5 4 3 1989695508991908989909193959798 2 3 5 7 910111110 9
+ 5089 0 2 3 5 7 910111110 9 7 5 3 29897959391908989909193959798 0509093935090 999
+  950 8 91050 8 850 5 850 5 8105093 3 09896949393949699 1 4 6 75093949699 1 4 6 7
+  7 6 4 2 09750
+  1 0 1 1 099989899 1 3 4 099 0 0999950 29899 1 2 2 1999898 099 0 1 09950 497 3 0
+ 97 3 0 0 050 5939598 0 0939598 0 09599 09599 09799 09799 09999 0 0 050 5 0999796
+ 9595969799 0 09696 09797 09898 09999 0 0 050 088 0 088 09199 094 0 0979950 59395
+ 98 0 0939598 050 5 09997969595969799 05011 098959290898990929598 050 5 0 1 3 4 5
+  5 4 3 1 050 698 0 1 1 09850 3 3 2 0989750 4 0989694939350 0 0989694939350 59089
+ 8888899092949697 1 2 4 6 8 91010 9 85011 5 4 299979695959697 3 4 5 5 4 3 1989695
+ 5011 0 3 4 5 5 4 3 199979695959697 3 4 5 5 4 3 199979695959697 0501088 9 0888898
+  8 0 4 7 9 0 4 7 0 7 7 0 7 8 950 7838485879094 0 3 5 6 6 5 3 0 09895939292939598
+  4 81113141550
diff --git a/bin/build_fonts/unix/in_fnt24a.sym b/bin/build_fonts/unix/in_fnt24a.sym
new file mode 100644
index 0000000..5c00e4e
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt24a.sym
@@ -0,0 +1,101 @@
+ 78  -9  21 ;MATH AND PUNCTUATION                                       
+    1  48  92 126 162 217 274 287 313 357 400 428 474 544 597 652 739 828 849 853
+  874 895 908 921 948 975 980 985 989 9961000100710171027103410411057106410741084
+ 10891094110511161138116311721180118812071216122512341243125412681282129613101327
+ 1339135113631375142014361447148015311558159116411698174117541801183218891901
+ 909394 6 7 75094 650939394 6 75098949393949350939550949495959350 1 650 4 4 5 7 7
+  5 450 4 5 75089 4 3 4 5 5 3 09795949450 0989695955010 910111110 8 6 5 550 8 7 6
+  65091 950919850 2 95089 5 4 5 6 5 3 09795949450 09896959550 5 550 6 65091 65091
+ 9850 2 95089 4 3 4 5 5 350 6 09795949450 09896959550 5 550 6 65091 550919850 2 9
+ 5084 099 0 1 0989592908989509593919090501110111211 9 6 3 1 0 050 6 4 2 1 1501111
+ 5012125086125086935097 450 8155084 099 0 1 09895929089895095939190905010 9101111
+  95012 6 3 1 0 050 6 4 2 1 15011115012125086115086935097 450 8155095 0 050 1 150
+ 97 15097 45091 5 3 097959494959699 2 450 0989695959697995095 35091 2999796959494
+ 959799 2 4 5 6 7 7 6 4 250 2 0989796959596975099 1 3 4 5 6 6 5 45096 55089 39750
+  496509995939292939598 1 5 7 8 8 7 5 29950999694939394969850 1 4 6 7 7 6 4 25091
+  2 4 6 6 5 299969594949597 150999796959596 1 2 2 1995089949392929397985092939798
+ 98979594939292939597 0 2 4 7 8 8 7 5 3 2 1 1 2 3 250 4 6 7 7 6 55087 7 6 7 8 7 5
+  2999796959492919050 2 09897969493929190888685858687865013121314141311 9 8 7 6 3
+  2 15011 9 8 7 5 4 3 2 1999796969798975091125088 9 8 910 9 6 3 09897969593929150
+  3 199989795949392918987868687888750 7 5 4 4 5 8101150 8 6 5 5 65092 85088 7 6 7
+  8 8 65010 3 09897969593929150 3 199989795949392918987868687888750 9 5 4 4 5 810
+ 115010 6 5 5 65092 75082 2 1 2 3 2 097949291908987868550979593929189888786858381
+ 808081828150141314151411 8 5 3 2 1 098979650 8 6 4 3 2 0999897969492919192939250
+ 1210 9 9101315165013111010115086135082 2 1 2 3 2 0979492919089878685509795939291
+ 898887868583818080818281501211121313115015 8 5 3 2 1 098979650 8 6 4 3 2 0999897
+ 9694929191929392501410 9 9101315165015111010115086125094959698 1 2 2 0 0 150 0 1
+  19999 0 3 5 65089 9915093 4 2 098979798 0 2 450 2 099989899 0 250939698 0 2 3 3
+  2 098965098 0 1 2 2 1 098509397975098985097 45097 45093 2 250 3 35096 35096 350
+ 92 299989899 1 197 1 199989899 250 09999 050 09999 0509398 1 2 2 19999 39999 1 2
+  2 19850 0 1 1 050 0 1 1 05093 396 3509397 4975096 0 05093979750 3 3508791 95087
+  0 05091 95088 0 05092 85092 85088 0 05092 85092 8508993 750 7935095 099 0 1 050
+ 87 099 0 1 05091 950 099 0 1 0508791 95091 95087 7935091 95091 9508791 95091 950
+ 91 95088 892 8508892 8925088 892 85092 85092 8508892 8925092 85092 85088 9 7 5 3
+  099979593929293959799 0 3 5 7 95088919192949698 2 4 6 8 9509192949698 2 4 6 8 9
+  9508992 0 85092 0 85094 29750 2 397509498 3509897 3509093949699 1 4 6 750939496
+ 99 1 4 6 75095 099 0 1 1 0995095 1 09999 0 1 05095 0 1 09999 0 1509599 0 1 1 099
+  050879094 05093 050 9 05088 8 19795939292939597 1 85088929293949699 1 4 6 7 8 8
+ 50889299 3 5 7 8 8 7 5 399925088929293949699 1 4 6 7 8 85088 8 19795939292939597
+  1 85092 45087 6 9 650 3 8 35091 8509298 0 25095 0 550 0 05087949194509792975092
+  9509298 0 25095 0 550 0 05091 6 5 4 2 097959494959698 0 3 5 6 7 7 6 5 3 0989797
+ 989850 0989695959650 0 2 4 5 6 6 5 3509092 05093 050 8 05092 85093 750838691 050
+ 90 05016 05088 9 8 91010 9 7 5 3 2 1 098979650 4 3 2 099989795939190909192915088
+  9 8 91010 9 7 5 3 2 1 098979650 4 3 2 09998979593919090919291509996949393949699
+  1 4 6 7 7 6 4 199508810 9 7 5 3 2999896949291919294969899 2 3 5 7 910105088 991
+ 50969898979593919192949698 1 4 7 950 5 3 2 2 4 6 8 9 9 7 55088 9 8 91010 9 8 7 6
+  4 2 098959291919298 0 1 1 0989695959698 3 5 8 9101050959392929395509596 4 6 850
+ 87 5 4 299979695959698 1 3 45099979696979850 5 4 4 6 810111110 9 7 5 29996949291
+ 90909192949699 2 5 7 850 6 5 5 65090989850 2 250 6 5 6 7 7 5 298959393949597 3 5
+  750939597 3 5 6 7 7 5 2989593939495945090 19450 7 05094 85093 75092 3 2 3 4 4 3
+  1999796969799 45097 2 4 5 5 4 250989695959698 35096 1 3 4 4 3 19997969697989750
+ 92 099 0 1 050 0 050 099 0 1 05094969896945094 650 2 4 6 4 25092 099 0 1 050 0 0
+ 50 099 1 099 1 050 0 050 099 0 1 05094969896945094 650 2 4 6 4 25094969896945094
+  650 2 4 6 4 25091 6 65093 65098 65093 650
+ 109193 5 7 9 094 6 0919395 7 9 098 2 4 6 8 9 0 4 8 0 2 4 6 8 9 0 196 09194969694
+ 9391 0919496501289909190898888899194 9 088899194 9 0899091908988888991 9 0888991
+  9 09595 0 9 9 0 9 9501189909190898888899194 9 088899194 9 095 9 095 9 09595 0 9
+  9 0 9 95011899091908988 08888899194 9 088899194 9 090 9 088 9 09595 0 9 9 0 9 9
+ 501789909190898888899194 9 088899194 9 089909190898888899194 9 088899194 9 095 9
+  095 9 09595 0 9 9 0 9 9 0 9 9501789909190898888899194 9 088899194 9 08990919089
+ 88 08888899194 9 088899194 9 090 9 088 9 09595 0 9 9 0 9 9 0 9 950 695 9 095 9 0
+ 9595 0 9 950 89695959698 1 4 7 8 9 9 8 0959698 1 4 7 8 9 0 2 250108889929497 2 6
+  8 9 9 8 5 3 09591898888 08889929497 2 6 8 9 0 9 8 5 3 095918988 0989850118816 0
+ 8816 0959698 1 4 6 8 9 9 8 6 3 098969595 0959698 1 4 6 8 9 0 9 8 6 3 098969550 9
+ 95969897969595969799 1 3 5 8 095969799 1 3 8101213135011959698 0 3 7 9 0 0 2 6 9
+ 11141616151310 6 2999695959698 2 6 8 9 9 8 6 5 6 7 0959698 2 6 85013899091908988
+ 8889919396 0 91315 08889919396 5 912141516161514131415 08990919089888889909295 9
+ 1315 088909296 5 912141516161514131415 0959550128990919089888889919396 0 91315 0
+ 8889919396 5 912141516161514131415 095 2 6 8 9 9 7 5 095 2 6 8 9 095955012899091
+ 908988 0888889919396 0 91315 08889919396 5 912141516161514131415 088 2 6 8 9 9 7
+  5 088 2 6 8 9 0959550178990919089888889919396 0 91315 08889919396 5 91214151616
+ 1514131415 08990919089888889919396 0 91315 08889919396 5 912141516161514131415 0
+ 95 2 6 8 9 9 7 5 095 2 6 8 9 0959550178990919089888889919396 0 91315 08889919396
+  5 912141516161514131415 0899091908988 0888889919396 0 91315 08889919396 5 91214
+ 1516161514131415 088 2 6 8 9 9 7 5 088 2 6 8 9 0959550 7999795959699 5 8 9 09596
+ 99 5 8 9 9 7 55011841650 78486899398 2 7111416 086909398 2 7101450 78486899398 2
+  7111416 086909398 2 7101450 78416 08416 08484 0161650 78416 08416 08484 0161650
+  784879092959798 0 2 3 5 8101316 086899396 0 4 7111450 884879092959798 0 2 3 5 8
+ 101316 086899396 0 4 7111450 784 01650 784 01650 4841650 78416 084165013 0 05013
+ 91 9 0 0 0501292 9 0 0 0 0 9 9501292 9 09292 0 0 0501193 7 093 750 599 0 1 09950
+ 139192939291 0 0 0 0 7 8 9 8 750139797 0 3 3501391 9 09797 0 3 350139595 0 0 0 0
+  5 5501291 0 9501291 0 950128895 2 0 4 4 0 9 950128895 2 0 4 4 0 9 95013 5 5 4 2
+ 989796969799 1 3 4 4 3 2989695955012 3 198979798 1 2 2 199 0 199989899 2 3 3 299
+ 975011 297 2 0 298 250 68894 088899450 68894 088899450108890929393929088 0889193
+ 949493918850 59089888991939450 58889919394939250 59089888991939450 5888991939493
+ 9250 99595 7 095 9 084 95012929293949699 1 4 6 7 8 850129299 3 5 7 8 8 7 5 39992
+ 5012929293949699 1 4 6 7 8 85012 8 19795939292939597 1 85012929293949699 1 4 6 7
+  8 8 0 0 0501398 0 2 095 0 5 0 0 050 8949194 0979297 092 9501398 0 2 095 0 5 0 0
+  050 8 6 9 6 0 3 8 3 091 85010 0979695959699 2 5 7 8 9 9 8 6 3989390898888899091
+ 9190 0959699 2 6 8 0 9 8 6 398939088501088 9 088 7 088 9 08888 0898950169595 7 0
+ 96 9 076 95012858687868584848587899296 81214 0868892 4 8111315161615141314155012
+ 858687868584848587899296 81214 0868892 4 811131516161514131415 093949699 1 4 6 7
+  7 6 4 199969493935013 1 3 4 4 3 2989796969799 1 3 4 4 3 2989796969799 1501288 9
+  088909294959593918988888990908988 0 2 3 5 7 9 9 8 6 4 2 25013969798979695959698
+  3 6 8 9 9 8 6 3 19795939189888991939699 6 8 9 9 8 7 0 9 8 6 3 199 09395 6 8 950
+ 1496949393949598 1 3 4 4 3 1 0939598 1 3 4 093 1 3 4 4 2999794929089888889909294
+ 97 0 3 5 7 8 9 9 8 7 6 093 1 3 450108413 08413 0919293929189888889919395969799 0
+  2 09395969899 0 2 6 8 9 9 8 6 5 4 5 650118816 08816 09999 0 5 550 8919293929189
+ 88888991939597 0 09598 0 2 4 6 8 09698 0 2 4 6 9 0 4 7 9111315161615131211121350
+  88890929088 08816 099 216 299 09596959495 09595 0959695949550 88890929088 088 2
+  098 0 4 6 4 098 0 216 01214161412 09596959495 09595 09596959495 0 910 9 8 9 0 9
+  9 0 910 9 8 9501088 9 08888 09898 0 9 950
diff --git a/bin/build_fonts/unix/in_fnt25a.sym b/bin/build_fonts/unix/in_fnt25a.sym
new file mode 100644
index 0000000..12695c4
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt25a.sym
@@ -0,0 +1,42 @@
+ 43  -9  21 ;SIMPLEX MATH AND PUNCTUATION                               
+    1  11  29  56  73  97 119 136 143 153 166 182 192 214 218 225 240 268 272 284
+  296 300 304 311 318 325 335 342 351 360 370 383 419 448 455 462 467 486 520 547
+  568 617 673 728
+ 9192 050 8 05092 85094949695959697 0 2 3 350 3 4 5 7 95091 5 5 4 3 1999795949495
+ 9698 0 2 4 5 6 6 5 4 2 098965092 5 3 098969595969799 2 45095 35092 2 09897969595
+ 969799 1 3 4 5 6 6 5 4 25096 55090 496509996949393949699 1 4 6 7 7 6 4 1995091 6
+  5 299969594949597 1 2 2 1995095 099 0 1 05095 1 099 0 1 1 0995095 099 0 1 050 0
+ 99 0 1 05095 099 0 1 050 1 099 0 1 1 0995095 0 050 099 0 1 050919494959698 2 4 5
+  6 6 5 4 0 050 099 0 1 05096 0 05092969650 4 45093999796969799 1 3 4 4 3 1995090
+ 989850 2 250 7 5 298959393949597 3 5 6 7 7 5 29895935089 9915093 4 2 098979798 0
+  2 450939698 0 2 3 3 2 098965096 0 0508791 95087 0 05091 9508791 95091 9508993 7
+ 50 7935092 0 05095 550 5955095 099 0 1 05095 1 09999 0 1 05095 099 0 1 1 0995087
+  3 6 9 6 35091 95090 19450 7 05094 85093 750871010 9 8 7 6 4 2 09894929190909192
+ 99 0 1 1 0989695959698 3 5 7 91010508991929393929150 9 8 7 7 8 950919397 3 7 950
+ 919397 3 7 95093979750 3 35088 0 05091 95088 991 95087 099 0 1 050919091929150 9
+  8 910 95088 09693929293959799 050 0 4 7 8 8 7 5 3 1 050 0999850 0 1 25098 25088
+  099989695939292939496 050 0 1 2 4 5 7 8 8 7 6 4 05088 098949150 0 2 6 950919498
+  050 9 6 2 05088 0 2 4 6 8 9 9 8 6 4 150 1 3 4 4 3 19997969697995099969492919192
+ 949698 050 0999850 0 1 25098 25088 0 09950 09950 09997969697 050 0 1 3 4 4 3 050
+  096949291919250 0 4 6 8 9 9 850 096949291919250 0 4 6 8 9 9 8508891929495959450
+ 91919294959696959450 0989797999998 050 0 2 3 3 1 1 2 050 9 9 8 6 5 4 4 5 650 9 8
+  6 5 5 65093 750
+  988 9 088 9 0888850 9 4 0 5 8 9 9 8 6 3 0 0 0 4 5 5 450 9 3 0979695959698 1 4 7
+  8 9 9 8 6 3989390898888899150 89695959698 1 4 7 8 9 9 8 0 2 250 98889929497 2 6
+  8 9 9 8 5 3 09591898888 0989850108816 0959698 1 4 6 8 9 9 8 6 3 09896959550 997
+ 969595969799 1 3 5 81012131350 5 7 8 9 8 750 5 8 9 8 7 810121350 59596979695 0 7
+  8 9 8 750 59596979695 0 8 9 8 7 810121350 588 2 0 7 8 9 8 750 99392908988888990
+ 9294969799 2 0 7 8 9 8 750 4889550 88895 0889550 7888991939596969593918988885010
+ 8413 08413 09189888889919395969799 0 1 3 6 8 9 9 8 65011841650 78486899398 2 711
+ 141650 78486899398 2 711141650 484165013 0 0501391 9 0 0 050139797 0 3 3501193 7
+  093 750 894 6 097 3 097 350 599 0 1 09950 58889919394939250 5908988899193945013
+ 9598 0 2 5 0 0 050118416 08416 09797 0 3 35013979695959698 3 6 8 9 9 8 7 5 3 1 0
+ 9695939189888991939699 6 8 9 9 8 75011919397 3 7 9 0919397 3 7 9 0919293939291 0
+  9 8 7 7 8 950 784 9 084 9501284 9 0 9 9501284 9 950139192939291 0 7 8 9 8 7 0 7
+  8 9 8 75012909498 1 3 5 6 6 5 3 0909498 1 3 5 6 6 5 3 0 3 710 0 3 710 010105012
+ 9693919090919397 0 2 510 09693919090919397 0 2 5105012899297 0 0899297 0 0 0 3 8
+ 11 0 0 3 8115012 2 5 6 6 5 3 199989899 0999795939190909193959799 099989899 1 3 5
+  6 6 5 2 0 2 710 0 2 710 010105012 0 910 0 410 0919090919396 0 0919090919396 0 0
+  09796969799 0 0 09796969799 0 0 0 3 4 4 3 1 0 0 0 3 4 4 3 1 05012 1 1 2 4 6 8 0
+  1 09999 0 2 5 7 8 089919497 3 6 810 089919497 3 6 810 0 1 09999 0 2 5 7 8 0 1 1
+  2 4 6 8 0 4 450
diff --git a/bin/build_fonts/unix/in_fnt26a.sym b/bin/build_fonts/unix/in_fnt26a.sym
new file mode 100644
index 0000000..1985352
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt26a.sym
@@ -0,0 +1,54 @@
+ 42  -9  21 ;MAP SYMBOLS                                                
+    1  20  27  33  40  53  60  67  77 113 141 159 177 195 213 236 248 262 274 289
+  308 330 342 357 390 401 436 501 596 637 670 686 693 704 719 738 757 780 815 850
+  901 936 969
+ 939996949393949699 1 4 6 7 7 6 4 19950949494 6 6945093 093 7 05094 094 0 6 05092
+  098929795 0 5 3 8 2 05093 0 05093 7509595 550 5955095 0 05095 550 5955096999796
+ 969799 1 3 4 4 3 19950979750989850999950 0 050 1 150 2 250 3 350969696 4 4965097
+ 9750989850999950 0 050 1 150 2 250 3 35095 095 5 050 09750 0 350 09950 0 1509494
+  3 3945097 25097 250 0 250 0 25095 0 595 050 0 350 09750 0 150 0995097 69797 650
+  39850 39850 09850 0985094 096 694 4 050 0 050 09450 09650 0 450 0 650 0 0 050 0
+  7 050 1 4 15095 0 05097 350959799 1 3 55094 0 0509495 5 65098 2509395 550 59550
+ 97949350 3 6 75091969150 4 95095 950 5915096 45095 55091 0 05095 550 59550919450
+  9 65091 95094 6508995 15093 15089 9 9895094989894949898 2 2 6 6 2 2985093 7 6 4
+  19996949393949699 1 4 6 750 7 5 3 1999897979899 1 3 5 75093 093 7 050 0 793 050
+ 89989899 1 2 2508990929394949597 3 5 6 6 7 8101150891150999899 1 2 15092 0 050 0
+ 9950 0 15099 150 099989650999650 0 1 2 450 1 450 09694925098949250 0 4 6 850 2 6
+  850 098979750 0989750 0 2 3 350 0 2 35092 0 050 0 050 0 050 09950 0 15099 150 0
+ 999850 0 1 25098 0 250 098969550 0 2 4 5509698 0 2 450 098969493939450 0 2 4 6 7
+  7 6509698 0 2 450 0989795949392929450 0 2 3 5 6 7 8 8 6509597 0 3 55092 09950 0
+  15099 150 0 3 6 8 8 7 5 7 8 7 5 3 4 3 19997969795939293959392929497 05092 09950
+  0 15099 150 0 4 4 6 6 8 8 7 6 4 298969493929294949696 05091919350949650 0 050 6
+  450 9 75099 099 0 1 0509899989899 1 2 2 1995096999796969799 1 3 4 4 3 199509599
+ 97969595969799 1 3 4 5 5 4 3 19950939996949393949699 1 4 6 7 7 6 4 1995089989592
+ 90898990929598 2 5 810111110 8 5 298508398949289878584838384858789929498 2 6 811
+ 131516171716151311 8 6 298507898938986838179787879818386899398 2 711141719212222
+ 2119171411 7 2985059979187827773696663616059596061636669737782879197 3 913182327
+ 31343739404141403937343127231813 9 3975080 09895928987808283838486899598 050 0 2
+  5 8111320181717161411 5 2 05083 0989592898784838384868994 050 0 2 5 81113161717
+ 161411 6 050841650
+  793949699 1 4 6 7 7 6 4 1999694939350 694 6 6949450 792 4 49250 690 010 09050 8
+ 919797 1 7 3 7 197979150 793 7 0 0 050 595 5 095 550 594 6 097 3 097 350 4969799
+  1 3 4 4 3 199979696 099 1 098 2 097 3 097 3 097 3 098 2 099 150 496 4 49696 097
+  3 097 3 097 3 097 3 097 3 097 3 097 350 594 3 394 097 2 097 2 0 0 2 0 0 250 3 0
+  595 0 0 0 3 0 097 0 0 1 0 09950 5 69797 6 0 398 0 398 0 098 0 09850 6 095 5 0 0
+  097 0 0 3 0 099 0 0 150 694 59898 594 0 094 0 098 0 0 5 0 0 5 0 09850 793 7 093
+ 9699 095969750 594 6 09797 0 3 5 6 6 5 350 694 6 099979799 0 5 550 796 6 096 6 0
+ 949799 094979950 991 9 091 9 095 9 095 9 09191 0959550 989 4 09298 09298 0 410 0
+  410 0 4 4 0101050 992 4 09894 01010 01050 6949898 2 2 6 6 2 29898949450 7989694
+ 9393949699 1 4 6 7 7 6 4 2 098969595969799 1 3 4 5 5 4 250 792 4 492 0 89696 850
+ 11918988888991 0 8 6 4 29893929191929398 2 4 6 8 0 8 8 0 8 91010 9 850 895 1 0 1
+ 10 0 110 01010 095929089 09289 095929089 09289 095939395 0949495 095939395 09494
+ 95 0959697 0 09597 0 0959697 0 09597 050 89193 09698 0 1 3 0 710 0 710 01010 089
+ 9192 0899192 0929192 093969796 093969796 09797969797 098 1 2 2 0 1 2 098 1 2 2 0
+  1 2 0 2 2 1 2 2 0 3 6 7 8 8 7 5 7 8 0 3 6 7 8 8 7 5 7 8 0 8 8 7 8 850 8 710 0 7
+ 10 01010 0 7 8 8 6 3 2 2 09795949592908989909295949597 0 2 2 3 6 8 8 750 8 710 0
+  710 01010 0 7 6 4 3 0999491909089899090919499 0 3 4 6 750 998 0 09398 08997 093
+ 98 098 050 199 0 1 09950 29899 1 2 2 199989850 4969799 1 3 4 4 3 19997969650 595
+ 969799 1 3 4 5 5 4 3 1999796959550 793949699 1 4 6 7 7 6 4 199969493935011899092
+ 9598 2 5 810111110 8 5 298959290898950178384858789929498 2 6 8111315161717161513
+ 11 8 6 298949289878584838350227879818386899398 2 7111417192122222119171411 7 298
+ 93898683817978785041596061636669737782879197 3 913182327313437394041414039373431
+ 27231813 9 3979187827773696663616059595020838586868583909295 8111314141517 08385
+ 86868583909295 81113141415175017838586868583899398 2 6101417 0838586868583899398
+  2 6101417 0909050
diff --git a/bin/build_fonts/unix/in_fnt27a.sym b/bin/build_fonts/unix/in_fnt27a.sym
new file mode 100644
index 0000000..3972a56
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt27a.sym
@@ -0,0 +1,20 @@
+ 12  -9  21 LARGE MATH SYMBOLS                                          
+    1  23  47  76 105 120 135 174 213 246 279 294 351
+ 83909050919150 9 950101050861450869550 514508489998850889850879850871012 9508910
+ 50881012 95091 6 3 09897969595969798 0 3 650 3 19998979696979899 1 350919497 0 2
+  3 4 5 5 4 3 2 09794509799 1 2 3 4 4 3 2 199975091959595509696965095 65095 65091
+  4 4 450 5 5 55094 55094 55090 4 098979798 2 2 1 095 0 1 2 298979798 0 450 2 099
+ 989899 050 099989899 0 2509196 0 2 3 3 2989899 0 5 0999898 2 3 3 2 0965098 0 1 2
+  2 1 050 0 1 2 2 1 0985091 4 1999796969798 1 2 3 3 2 19950 1999897979899 2 3 4 4
+  3 1999650919699 1 3 4 4 3 2999897979899 15099 1 2 3 3 2 1989796969799 1 4507376
+ 83 05082995081 050 8 4 050851110 9 91011121211 9 7 5 3 2 1 099999897501010111110
+ 50 0 050 3 2 1 1 099989795939189888889909191908950898990908950
+ 178416 08416 08416 08416 08484 01616 016165015849816 08498 08499 084849184 01515
+  01616 91650 961677479838896 4121721263339 0677278828896 4121822283350 961677479
+ 838896 4121721263339 0677278828896 4121822283350 961 039 061 039 06161 0393950 9
+ 61 039 061 039 06161 0393950 961677176808492949697 0 3 4 6 8162024293339 0646871
+ 76808588 012152024293236501061677176808492949697 0 3 4 6 8162024293339 064687176
+ 808588 01215202429323650 96467707479859195 6101621262933 067717479849094 5 91521
+ 2630333650 96467707479859195 6101621262933 067717479849094 5 915212630333650 8 0
+  029 0 029 0 032 052923250156464656667676664626161626466697692243336 06566666565
+  07624 0646776 824313436383939383634333334353636 0343535343450
diff --git a/bin/build_fonts/unix/in_fnt28a.sym b/bin/build_fonts/unix/in_fnt28a.sym
new file mode 100644
index 0000000..fd5403c
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt28a.sym
@@ -0,0 +1,22 @@
+ 15  -7  13 ;INDEXICAL ZODIAC                                           
+    1  26  60  84 109 135 161 189 217 245 273 294 318 331 366 400
+ 909996949393949699 1 4 6 7 7 6 4 19950 099 0 1 050949998989950 2 3 3 250 0989797
+ 98 0 1 3 4 4 3 1 050 0 050 1 15097 45094 098979798 0 1 3 4 4 3 1 050 0 050 1 150
+ 97 450909996949393949699 1 4 6 7 7 6 4 19950 0 05093 75092 09897959494959798 0 1
+  1 050 5 050 0 5 550 0 4 5509294959799 0 099989650979899999850 4 350 5 25096 650
+ 92969650979650969799 1 3 4 4 2 2 3 4 550 1 3 3 2509497509497 0 050 4 1 150 09897
+ 9798 0 1 3 4 4 3 150 0 0 1 1 05092 0 05095959698 2 4 5 5509495965099 0 150 4 5 6
+ 5097 3509296965097975094 1 4 5 5 4 19750 1 3 4 4 3 15094 4 4 35094 5 29997969697
+ 99 2 550 5 2 09999 0 2 55092 09897959494959798 0 1 1 050 19950 5 050 6 1509398 2
+ 50 2985095 550 59550929795949495979898969595969799 2 4 5 6 6 5 3 3 4 6 7 7 6 450
+ 9698 3 550929795949495979898969595969799 2 4 5 6 6 5 3 3 4 6 7 7 6 4509698 3 550
+ 1093949699 1 4 6 7 7 6 4 19996949393 099 0 1 09950 793949596 093949596 0969799 0
+  2 3 3 2 099979696 0 3 7 0 3 7 0 5 550 79394969799 0 0999796949393 0 0 6 0 0 6 0
+  3 3501093949699 1 4 6 7 7 6 4 19996949393 093 7 0 0 050 7 09999 0 2 3 5 6 6 5 3
+  2 0 095 0 09595 0 09596 050 8949393949698 0 1 2 093949699 1 093 6 093 6 0 2 250
+  793 3 093 0 0 09897979899 2 4 6 7 7 6 09799 2 4 0939350 7969399 0969399 099 0 2
+  3 5 6 6 5 3 2 099 0 2 3 3 2 250 893 7 09398 0 1 1 09893 0959395 0959395 0959395
+  0 4 450 793 6 093 6 0939394969799 0 0 09394969799 0 0 6 6 3 650 79393949699 1 4
+  6 7 7 093949699 1 4 6 750 8 09999 0 2 3 5 6 6 5 3 2 0 09499 095 0 099 150 795 5
+  095 5 098 2 098 250 9 3 3 4 6 7 7 6 4 2 09795949393949597 0 2 4 6 7 7 6 4 3 3 0
+ 9594949550 9979796949393949698 0 3 5 6 7 7 6 5 3 0989694939394969797 0 5 6 6 550
diff --git a/bin/build_fonts/unix/in_fnt29a.sym b/bin/build_fonts/unix/in_fnt29a.sym
new file mode 100644
index 0000000..5f45089
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt29a.sym
@@ -0,0 +1,59 @@
+ 69  -7  13 ;INDEXICAL MATH AND PUNCTUATION                             
+    1   8  17  30  45  61  91  98 111 122 132 136 153 170 183 196 223 250 255 260
+  264 271 275 282 292 302 309 316 332 339 349 359 364 369 380 391 413 430 439 447
+  455 470 479 488 497 506 518 530 542 554 569 583 597 611 625 663 679 690 717 758
+  785 812 854 884 919 932 973100310461058
+ 96 099 0 1 05096 1 099 0 1 1995096 099 0 1 050 099 0 1 05096 099 0 1 050 1 099 0
+  1 1995096 099 0 1 050 0 050 099 0 1 0509496979796969799 2 4 5 5 4 1 0 0 150 2 4
+  4 3 150 0 0 1 1 05097 0 050 1 05094979750989750 3 350 4 3509599989899 1 2 2 199
+ 5095 0 05097 350 3975093 6955095 3 199989899 1 350 1 09999 0 150959799 1 2 2 199
+ 975099 0 1 1 099509598985099995098 35098 35095 1 150 2 25097 25097 25094 1 09999
+  0 098 0 09999 0 150 0995099 050 0995099 0509599 0 1 1 0 0 2 0 0 1 1 09950 0 150
+  1 050 0 150 1 05095 298 2509598 2985097 0 05095989850 2 2509194 65091 0 05094 6
+ 5092 0 05095 55095 55092 0 05095 55095 5509295 550 5955096 099 0 1 05091 099 0 1
+  05094 650 099 0 1 0509194 65094 65091 5955094 65094 6509194 65094 65094 65092 5
+ 95 5509295 5955092 595 55095 55095 5509295 5955095 55095 55090 7 5 3 2 099979694
+ 939394969799 0 2 3 5 7509294949597 3 5 650949597 3 5 6 6509295 0 55095 0 55096 1
+ 9850 1 298509699 2509998 25094969799 1 3 450969799 1 3 45096 1 099 0 1 1995096 1
+ 9999 0 1 099509699 0 1 09999 1509699 1 1 099 0 15092 59997969595969799 550929595
+ 969799 1 3 4 5 5509295 1 3 4 5 5 4 3 19550929595969799 1 3 4 5 55092 59997969595
+ 969799 55095 35091 2 3 6 3 250 3 5 35094 55095 0 0509798 0 2 35098 0 25091989794
+ 9798509795975095 65095 0 0509798 0 2 35098 0 25093 4 3 199979695959698 0 2 3 4 5
+  5 4 2999899 050999796969850 0 2 3 4 4 3 2509294 05095 050 6 05094 65096 5508991
+ 94 05093 050 9 05091 6 6 7 7 6 4 2 1 099989750 3 2 1 099989694939394945091 6 6 7
+  7 6 4 2 1 099989750 3 2 1 0999896949393949450999796969799 1 3 4 4 3 1995090 8 7
+  5 4 2 1999896959392929395969899 1 2 4 5 7 8 85092 69450979898979594949597 1 4 6
+ 50 3 2 2 3 5 6 6 5 35092 7 6 6 7 7 6 5 4 3 2 199979594949597 0 1 1 098979798 3 5
+  6 75097959597509798 4 55092 3 199989899 1 350 3 3 4 6 7 7 6 4 1 0979594949597 0
+  1 45093999950 2 250 5 4 4 5 5 398969697 4 5509697 4 5 5 4 2999796969797965093 0
+ 9650 4 05096 55095 45094 2 1 1 2 2 199989899 2 3509899 2 3 3 15099979798 1 25097
+ 98 1 2 2 19998989999985094 099 0 1 050 0 050 099 0 1 050 0 0509897969798 2 3 4 3
+  25094 0 1 099 0 099 1 050 0 199 0 099 0 1 0509897969798 2 3 4 3 2509897969798 2
+  3 4 3 25094 4 45096 45099 45096 450
+  4 4 5 6 5 450 4 5 6 5 4 5 7 950 49798999897 0 4 5 6 5 450 49798999897 0 5 6 5 4
+  5 7 950 49394 19493 09497 0 4 5 6 5 450 7969697979694939394969799 0 1 2 2 09395
+ 9899 0 0 5 6 6 5 550 49398 0939850 69398 09398 09398 0939850 5939496979796949393
+ 50 59298 09397 0939750 8901050 590929598 2 5 810 0929498 2 6 850 590929598 2 5 8
+ 10 0929498 2 6 850 59010 09010 09090 0101050 59010 09010 09090 0101050 590919395
+ 9798 0 2 3 5 7 910 09195 09397 0 3 7 0 5 950 6909193959798 0 2 3 5 7 910 09195 0
+ 9397 0 3 7 0 5 950 590 01050 590 01050 3901050 59010 0901050 9 0 050 994 6 0 0 0
+ 50 895 6 0 0 0 0 6 650 895 6 09595 0 0 050 895 5 095 550 499 0 1 09950 994959695
+ 94 0 0 0 0 4 5 6 5 450 99898 0 2 250 994 6 09898 0 2 250 99696 0 0 0 0 4 450 894
+  0 650 894 0 650 89397 1 0 2 2 0 6 650 89397 1 0 2 2 0 6 650 9 3 3 2 19897969697
+ 99 0 2 3 3 2 19897969650 8 2 09898 1 1 0 0 09999 2 2 09850 8 198 1 0 199 150 493
+ 97 093949750 49397 093949750 6939596969593 093969797969350 49495949394969850 493
+ 95979897969750 49495949394969850 49395979897969750 89595969799 1 3 4 5 550 895 1
+  3 4 5 5 4 3 19550 89595969799 1 3 4 5 550 8 59997969595969799 550 89595969799 1
+  3 4 5 5 0 0 050 99798 0 2 3 098 0 2 0 0 050 595 6 09897949798 097959750 99798 0
+  2 3 098 0 2 0 0 050 594 5 0 2 3 6 3 2 0 3 5 350 7 19897979899 1 3 5 6 6 5 4 299
+ 96949393949493 09799 1 4 6 0 6 4 29996949350 893 6 093 4 093 6 09393 0949450 997
+ 97 5 097 6 088 650 9919292919090929497 3 7 9 0919397 3 6 81010 9 8 8 950 9919292
+ 919090929497 3 7 9 0919397 3 6 81010 9 8 8 9 0969799 1 3 4 4 3 1999796965010 0 2
+  3 3 2 1989796969799 0 2 3 3 2 1989796969799 050 893 6 0939496979796949393949493
+  0 2 3 5 6 6 5 3 2 250 99898999998979798 2 4 5 6 6 5 4 2 1 09896949393949699 5 6
+  6 5 0 6 4 2 0 09698 5 650 998979799 0 2 2 1 097 1 2 2 09996949393949699 0 3 5 6
+  6 550 89010 09010 094949595949393949698 1 2 09697 0 2 4 5 6 6 5 4 3 3 4 450 793
+ 10 09310 09999 0 4 450 694949595949393949698 0 1 0969799 1 3 5 098 0 2 4 6 7 0 2
+  3 5 7 91010 9 8 8 9 950 69394959493 09599 099 1 4 199 0 410 0979697989797969798
+ 9750 6959493949599 0 3 4 099 0 3 4 8 910 9 8 097969798979796979897 0 6 5 6 7 6 6
+  5 6 7 650 793 6 09393 09999 0 6 650
diff --git a/bin/build_fonts/unix/in_fnt30a.sym b/bin/build_fonts/unix/in_fnt30a.sym
new file mode 100644
index 0000000..4c6f535
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt30a.sym
@@ -0,0 +1,17 @@
+ 26  -7   9   ;CARTOGRAPHIC SYMBOLS                                     
+    1   8  16  29  43  56  74  78  85  96 113 117 125 133 137 141 148 155 162 172
+  179 187 195 203 216 238 258
+ 98 0 0 1 1 05098 1 0 0 1 1 05098 0 0 1 1 050 0 0 1 1 05098 0 0 1 1 050 1 0 0 1 1
+  05098 0 050 1 150 0 0 1 1 0509698 0 1 3 3 0 0 1 1 350 0 0 1 1 05098 0 050969898
+ 50 2 2509699989899 1 2 2 1995095 3 199979799 2 3 3 1999750 0 05095 4965097 2 099
+ 99 0 2509698 0 1 1 0985098 0 0509496 45094 0 05096 4509496 45096 4509597 350 397
+ 5095 0 05097 350 3975098 0 0 1 1 05098 1 0 0 1 1 05098 1 0 0 1 1 05094 1 4 15096
+  45095 09850 3 15097 45097 45094 4 3 2 1 097969697 0 1 1 098979799 1 3 450949697
+ 979650 4 3 3 4509699 1 4509699 1 450
+  3 3 4 4 3 350 3 4 4 3 3 5 750 39899999898 0 3 4 4 3 350 39899999898 0 4 4 3 3 5
+  750 395 0 095 0 0 3 4 4 3 350 5969595969899 0 09998 0 3 4 4 3 350 2959950 49599
+  0959950 495969899999896959550 5969595969899 0 1 3 4 4 3 094 550 594 550 4949698
+  1 3 550 3949698 1 3 550 294 550 6 0 050 696 4 0 0 050 69898 0 2 250 597 3 097 3
+ 50 597 3 098 2 098 250 399 0 0999950 395979999989850 396969595979950 697 0 3 0 0
+  050 694 5 094 5 09898 0 1 150 6 0 0 1 3 4 4 3 1 099989695959698 1 3 4 450 69699
+  1 4 09699 1 4 096979796 0 4 3 3 450
diff --git a/bin/build_fonts/unix/in_fnt31a.chr b/bin/build_fonts/unix/in_fnt31a.chr
new file mode 100644
index 0000000..bc699ad
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt31a.chr
@@ -0,0 +1,78 @@
+ 99  -9  21 ;SIMPLEX ROMAN ASCII FONT
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   1 938 9741270 99612831098 9701028
+ 104010701056 8991052 8921024 719 738 744 760 777 785 804 829 836 867 909 9221218
+ 10631223 9481316   3  13  38  58  75  88  98 122 132 136 148 158 165 178 188 211
+  226 252 270 292 299 311 318 331 338 346113413731147125313771262 356 375 394 410
+  429 448 458 482 494 504 517 527 531 551 563 582 601 620 630 649 659 671 678 691
+  698 7091160121411871228   11380
+ 925091 09250 0 85095 5508993935093 2 5 6 7 7 6 5 25093 2 5 6 7 7 6 5 2935090 8 7
+  5 399979594939394959799 3 5 7 8508993935093 0 3 5 6 7 7 6 5 3 093509094945094 7
+ 5094 25094 7509094945094 75094 25090 8 7 5 399979594939394959799 3 5 7 8 850 3 8
+ 5089939350 7 75093 75096 0 05092 4 4 3 2 098969594945089939350 7935098 750909494
+ 5094 6508892925092 050 8 050 8 8508993935093 750 7 7508998969493929293949698 2 4
+  6 7 8 8 7 6 4 298508993935093 2 5 6 7 7 6 5 293508998969493929293949698 2 4 6 7
+  8 8 7 6 4 29850 1 7508993935093 2 5 6 7 7 6 5 29350 0 75090 7 5 298959393949597
+  3 5 6 7 7 5 29895935092 0 05093 750899393949699 1 4 6 7 7509192 050 8 050889095
+ 50 09550 0 55010 5509093 750 793509192 0 050 8 05090 7935093 75093 75091 6 650 6
+  4 29997959494959799 2 4 65090949450949698 1 3 5 6 6 5 3 19896945091 6 4 2999795
+ 9494959799 2 4 65091 6 650 6 4 29997959494959799 2 4 6509194 6 6 5 4 29997959494
+ 959799 2 4 65095 5 3 1 0 05097 45091 6 6 5 4 2999750 6 4 29997959494959799 2 4 6
+ 50919595509598 0 3 5 6 6509699 0 1 09950 0 05095 0 1 2 1 050 1 1 098965091959550
+  5955099 65096 0 050858989508992949799 0 050 0 3 5 810111150919595509598 0 3 5 6
+  650919997959494959799 2 4 6 7 7 6 4 2995090949450949698 1 3 5 6 6 5 3 198969450
+ 91 6 650 6 4 29997959494959799 2 4 650939797509798 0 2 55092 6 5 29996959698 3 5
+  6 6 5 29996955095 0 0 1 3 55097 4509195959698 1 3 650 6 6509294 050 6 050899296
+ 50 09650 0 450 8 4509295 650 695509294 050 6 0989694935092 6955095 65095 6509099
+ 96949393949699 1 4 6 7 7 6 4 19950909698 1 150909494959698 2 4 5 6 6 5 393 75090
+ 95 6 0 3 5 6 7 7 6 4 1989594935090 393 850 3 35090 595949598 1 4 6 7 7 6 4 19895
+ 94935090 6 5 2 0979594949597 0 1 4 6 7 7 6 4 1 09795945090 7975093 7509098959494
+ 9597 1 4 6 7 7 6 5 29895949393949699 3 5 6 6 5 2985090 6 5 3 09996949393949699 0
+  3 5 6 6 5 3 09895945095 099 0 1 05095 1 099 0 1 1 0995095 099 0 1 050 099 0 1 0
+ 5095 099 0 1 050 1 099 0 1 1 0995095 0 050 099 0 1 050919494959698 2 4 5 6 6 5 4
+  0 050 099 0 1 05096 0 05092969650 4 45093999796969799 1 3 4 4 3 1995090989850 2
+  250 7 5 298959393949597 3 5 6 7 7 5 29895935089 9915093 4 2 098979798 0 2 45093
+ 9698 0 2 3 3 2 09896508791 95087 0 05091 9508791 95091 95092 0 05095 550 5955095
+  1 09999 0 1 05095 099 0 1 1 09950871010 9 8 7 6 4 2 0989492919090919299 0 1 1 0
+ 989695959698 3 5 7 91010509397975098985097 45097 45093 2 250 3 35096 35096 35092
+  299989899 1 197 1 199989899 250 09999 050 09999 0509398 1 2 2 19999 39999 1 2 2
+  19850 0 1 1 050 0 1 1 05096 0 05088 892 8508892 8925088919192949698 2 4 6 8 950
+ 9192949698 2 4 6 8 9 9508992 0 85092 0 8509498 3509897 35090 19450 7 05094 85093
+  75088 99150969898979593919192949698 1 4 7 950 5 3 2 2 4 6 8 9 9 7 55087 5 4 299
+ 979695959698 1 3 45099979696979850 5 4 4 6 810111110 9 7 5 299969492919090919294
+ 9699 2 5 7 850 6 5 5 6508991 9508991 950
+  850 988 9 088 9 0 2 2501088 9 0888889909294969798 0989899 0 2 5 7 8 9 950119391
+ 89888889919396 1 4 6 8 9 9 8 6 4501088 9 0888889919396 1 4 6 8 9 950 988 9 08888
+  09898 0 9 950 888 9 08888 098985011939189888889919396 1 4 6 8 9 9 8 6 4 1 0 1 1
+ 501188 9 088 9 0989850 488 950 888 4 7 8 9 9 8 7 4 2501088 9 088 2 097 950 788 9
+  0 9 9501288 9 088 9 088 9 088 9501188 9 088 9 088 950118889919396 1 4 6 8 9 9 8
+  6 4 1969391898888501088 9 08888899092959798999950118889919396 1 4 6 8 9 9 8 6 4
+  1969391898888 0 511501088 9 088888990929496979898 098 9501091898888899193959697
+ 99 0 1 3 6 8 9 9 8 650 888 9 08888501188 3 6 8 9 9 8 6 38850 988 9 088 9501288 9
+  088 9 088 9 088 9501088 9 088 950 98898 9 08898501088 9 08888 0 9 9501095 9 098
+ 9695959698 1 3 6 8 9 9 8 650 988 9 0989695959698 1 3 6 8 9 9 8 650 9989695959698
+  1 3 6 8 9 9 8 6501088 9 0989695959698 1 3 6 8 9 9 8 650 9 1 199979695959698 1 3
+  6 8 9 9 8 650 788888992 9 09595501095111415161615 0989695959698 1 3 6 8 9 9 8 6
+ 501088 9 0999695959699 950 48889888788 095 950 58889888788 0951215161650 888 9 0
+ 95 5 0 1 950 488 9501595 9 0999695959699 9 0999695959699 9501095 9 0999695959699
+  95010959698 1 3 6 8 9 9 8 6 3 19896959550 99516 0989695959698 1 3 6 8 9 9 8 650
+ 109516 0989695959698 1 3 6 8 9 9 8 650 695 9 0 19896959550 9989695959698 0 1 2 3
+  5 6 8 9 9 8 650 788 5 8 9 9 09595501095 5 8 9 9 8 5 095 950 895 9 095 9501195 9
+  095 9 095 9 095 950 995 9 095 950 895 9 095 91315161650 995 9 09595 0 9 9501088
+ 899297 0 5 8 9 9 8 5 097928988885010929188 95010939290898888899092949699 9 95010
+ 888896969798 1 3 6 8 9 9 8 7 5501088 2 2 088 950108888979695959698 1 3 6 8 9 9 8
+  7 5501091898888899297 2 6 8 9 9 8 6 3 2999796969799 2501088 9 08888501088899193
+ 95969798 0 2 5 7 8 9 9 8 7 5 2 098979695939189888850109598 0 1 1 098959491898888
+ 899195 0 5 8 9 9 8 650 5 7 8 9 8 750 5 8 9 8 7 810121350 59596979695 0 7 8 9 8 7
+ 50 59596979695 0 8 9 8 7 810121350 588 2 0 7 8 9 8 750 9939290898888899092949697
+ 99 2 0 7 8 9 8 750 4889550 88895 0889550 78889919395969695939189888850108413 084
+ 13 09189888889919395969799 0 1 3 6 8 9 9 8 65011841650 78486899398 2 711141650 7
+ 8486899398 2 71114165013 0 0501391 9 0 0 050139797 0 3 350 894 6 097 3 097 350 5
+ 8889919394939250 5908988899193945013979695959698 3 6 8 9 9 8 7 5 3 1 09695939189
+ 888991939699 6 8 9 9 8 750 78416 08416 08484 0161650 78416 08416 08484 0161650 7
+ 84879092959798 0 2 3 5 8101316 086899396 0 4 7111450 884879092959798 0 2 3 5 810
+ 1316 086899396 0 4 7111450 48416501291 0 9501291 0 95012 3 198979798 1 2 2 199 0
+  199989899 2 3 3 299975011 297 2 0 298 250 68894 088899450118816 08816 09999 0 5
+  5501288 9 088909294959593918988888990908988 0 2 3 5 7 9 9 8 6 4 2 2501496949393
+ 949598 1 3 4 4 3 1 0939598 1 3 4 093 1 3 4 4 299979492908988888990929497 0 3 5 7
+  8 9 9 8 7 6 093 1 3 4501184165011161650
diff --git a/bin/build_fonts/unix/in_fnt32a.chr b/bin/build_fonts/unix/in_fnt32a.chr
new file mode 100644
index 0000000..2b41d44
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt32a.chr
@@ -0,0 +1,132 @@
+ 99  -9  21 ;COMPLEX ROMAN ASCII FONT
+    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
+    1   1   1   1   1   1   1   1   1   1   1   119361992234121622354211219852034
+ 20552020208018992076189220301497153815501596164416581698174717791843190819212289
+ 2087229419522387   3  22  68 101 132 155 176 217 245 258 279 307 322 353 375 420
+  450 515 561 596 613 637 653 678 700 721220524442218232424482333 738 778 812 841
+  878 910 933 9941023104210681096110911541183122012571291131513481365139414101435
+ 145714802231228522582299   12451
+ 925090 09350 0 750 0 65095 450919750 3 9508994945095955091 3 6 7 8 8 7 6 350 3 5
+  6 7 7 6 5 35095 3 6 7 8 8 7 6 39150 3 5 6 7 7 6 5 35089 6 7 7 6 4 1999694939292
+ 93949699 1 4 6 75099979594939394959799508994945095955091 1 4 6 7 8 8 7 6 4 19150
+  1 3 5 6 7 7 6 5 3 15089949450959550 1 15091 7 7 65095 15091 7 7 650899494509595
+ 50 1 15091 7 7 65095 15091985089 6 7 7 6 4 199969493929293949699 1 4 65099979594
+ 93939495979950 6 650 7 750 3105088939350949450 6 650 7 750909750 3105094 6509097
+ 50 3105095 0 050 1 15097 45097 45093 3 3 2 09896959596979650 2 2 1 05099 6508893
+ 9350949450 7945099 75098 650909750 3 950909750 3 9509196965097975093 05093 8 8 7
+ 508893935094 05093 050 7 050 7 750 8 850909450 71150909650 411508994945095 75095
+  750 7 750919550 410509197508999969493929293949699 1 4 6 7 8 8 7 6 4 19950999795
+ 9493939495979950 1 3 5 6 7 7 6 5 3 1508994945095955091 3 6 7 8 8 7 6 39550 3 5 6
+  7 7 6 5 3509198508999969493929293949699 1 4 6 7 8 8 7 6 4 199509997959493939495
+ 979950 1 3 5 6 7 7 6 5 3 15096969799 0 2 3 4 5 7 8 850 3 4 5 6 7 850899494509595
+ 5091 3 6 7 8 8 7 6 39550 3 5 6 7 7 6 5 350919850 0 2 3 6 7 8 950 2 3 5 6 8 9 950
+ 90 6 7 7 6 4 198959393949597 3 5 750939597 3 5 6 7 7 5 29996949393945091 0 050 1
+  150949393 8 8 75097 450889393949699 1 4 6 7 750949495979950909750 410509093 050
+ 94 050 7 050919750 3 95088929650939650 09650 0 450 1 450 8 450899650 511509093 6
+ 5094 750 79350919750 3 950919750 3 9509093 0 05094 1 150 8 150919750 4105097 450
+ 90 69350 79450949393 75093 7 7 65091969695959698 2 4 5 6 6 7 850 5 5 6 8 950 5 4
+ 989594949598 1 3 5509896959596985089949450959550959799 1 4 6 7 7 6 4 199979550 1
+  3 5 6 6 5 3 15091955090 5 4 5 6 6 4 29996949393949699 1 4 650999795949495979950
+ 90 5 550 6 650 5 3 19996949393949699 1 3 550999795949495979950 2 650 5 9509094 6
+  6 5 4 29996949393949699 1 4 650 5 5 45099979594949597995093 3 2 3 4 4 3 1999898
+ 50 1 099995095 35095 250919997969595969799 1 3 4 5 5 4 3 199509796969750 3 4 4 3
+ 50 4 5 7 7 550969594949598 3 6 750949598 3 6 7 7 6 39794939394975089949450959550
+ 9597 0 2 5 6 650 2 4 5 550919550919850 2 95095 099 0 1 050 0 050 1 15097 15097 4
+ 5095 1 0 1 2 150 2 2 19997969697989750 1 1 0995098 25089949450959550 59550 0 650
+ 99 550919550 2 850919850 2 85095 0 050 1 15097 15097 4508489895090905090929597 0
+  1 1509799 0 050 1 3 6 811121250 81011115086905086935097 450 8155089949450959550
+ 9597 0 2 5 6 650 2 4 5 550919550919850 2 950909996949393949699 1 4 6 7 7 6 4 199
+ 50999795949495979950 1 3 5 6 6 5 3 15089949450959550959799 1 4 6 7 7 6 4 1999795
+ 50 1 3 5 6 6 5 3 15091955091985090 5 550 6 650 5 3 19996949393949699 1 3 5509997
+ 95949495979950 2 950919696509797509798 0 2 5 6 6 5 4 55093975093 05092 5 6 6 5 4
+  2989695959698 3 5 650959698 3 5 6 6 5 39997969595965093989899 1 3 5 6509999 0 1
+ 5095 3508994949598 0 3 5509595969850 5 550 6 650919550 2 650 5 9509194 05095 050
+  6 050929850 2 85088929650939650 09650 0 450 1 450 8 450899650 511509094 55095 6
+ 50 69450929850 2 850929850 2 8509094 05095 050 6 09896949392939450929850 2 85091
+  59450 69550959494 65094 6 6 550909996949393949699 1 4 6 7 7 6 4 199509997969594
+ 949596979950 1 3 4 5 6 6 5 4 3 150909698 1 150 0 05096 550909495949393949598 2 5
+  6 7 7 6 3989694939350 2 4 5 6 6 5 29850939496 1 4 6 75096 1 5 6 7 7509094959493
+ 93949598 2 5 6 6 5 29950 2 4 5 5 4 250 2 4 6 7 7 6 5 2989594939394959450 5 6 6 5
+  4 25090 2 250 3 350 392 85099 65090959350939598 1 4 6 7 7 6 4 19895949393949594
+ 50 1 3 5 6 6 5 3 15095 55095 0 55090 5 4 5 6 6 5 3 09795949393949699 1 4 6 7 7 6
+  4 1 097959450 0989695949495979950 1 3 5 6 6 5 3 1509093935093949698 3 5 6 75094
+ 9698 350 7 7 6 2 1 0 050 6 1 099995090989594949598 2 5 6 6 5 2985098969595969850
+  2 4 5 5 4 2509895949393949598 2 5 6 7 7 6 5 250989695949495969850 2 4 5 6 6 5 4
+  25090 6 5 3 09996949393949699 1 4 6 7 7 6 5 3 097959494959695509997959494959799
+ 50 1 3 5 6 6 5 4 2 05095 099 0 1 05095 099 0 1 1 0995095 099 0 1 050 099 0 1 050
+ 95 099 0 1 050 099 0 1 1 0995095 099 0 1 050 0 050 099 0 1 050919596959494959698
+  1 4 5 6 6 5 4 0 050 1 3 4 5 5 4 250 099 0 1 05096 09950 1995092969550979550 4 3
+ 50 5 35093999796969799 1 3 4 4 3 1995092 0 05095 550 5955089 9915093 4 2 0989797
+ 98 0 2 450 2 099989899 0 250939698 0 2 3 3 2 098965098 0 1 2 2 1 098508791 95087
+  0 05091 9508791 95091 95095 0 1 09999 0 1509599 0 1 1 099 05088 9 8 91010 9 8 7
+  6 4 2 098959291919298 0 1 1 0989695959698 3 5 8 9101050959392929395509596 4 6 8
+ 5090989850 2 250 6 5 6 7 7 5 298959393949597 3 5 750939597 3 5 6 7 7 5 298959393
+ 949594509397975098985097 45097 45093 2 250 3 35096 35096 35092 299989899 1 197 1
+  199989899 250 09999 050 09999 0509398 1 2 2 19999 39999 1 2 2 19850 0 1 1 050 0
+  1 1 05096 0 05088 892 8508892 8925088919192949698 2 4 6 8 9509192949698 2 4 6 8
+  9 9508992 0 85092 0 8509498 3509897 35090 19450 7 05094 85093 75088 99150969898
+ 979593919192949698 1 4 7 950 5 3 2 2 4 6 8 9 9 7 55087 5 4 299979695959698 1 3 4
+ 5099979696979850 5 4 4 6 810111110 9 7 5 2999694929190909192949699 2 5 7 850 6 5
+  5 6508991 9508991 950
+  8501088 9 088 9 091 9 0 3 3 0 9 9 0 9 9501188 9 088 9 0888889909294969798 08889
+ 909294969798 0989899 0 2 5 7 8 9 9 09899 0 2 5 7 8 950109194889189888889919396 1
+  4 6 8 9 9 8 6 4 08889919396 1 4 6 8 9501188 9 088 9 0888889919396 1 4 6 8 9 9 0
+ 8889919396 1 4 6 8 9501088 9 088 9 094 2 088889488 09898 0 9 9 3 950 988 9 088 9
+  094 2 088889488 09898 0 9 950129194889189888889919396 1 4 6 8 9 9 8 6 088899193
+ 96 1 4 6 8 9 0 1 9 0 1 9 0 1 1501288 9 088 9 088 9 088 9 08888 08888 09898 0 9 9
+  0 9 950 688 9 088 9 08888 0 9 950 888 5 8 9 9 8 6 4 3 4 5 088 5 8 9 08888501088
+  9 088 9 088 1 097 9 097 9 08888 08888 0 9 9 0 9 950 988 9 088 9 08888 0 9 9 3 9
+ 501388 9 088 6 088 9 088 9 088 9 088 9 08888 08888 0 9 9 0 9 9501288 9 088 7 090
+  9 088 9 08888 08888 0 9 950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 0888991
+ 9397 0 4 6 8 9 0 9 8 6 4 09793918988501188 9 088 9 088888990929597989999 0888990
+ 9295979899 0 9 950118889919397 0 4 6 8 9 9 8 6 4 0979391898888 08889919397 0 4 6
+  8 9 0 9 8 6 4 09793918988 0 7 6 4 3 3 4 61314141211 0 61012131312501188 9 088 9
+  088888990929496979898 08889909294969798 0 9 9 09899 0 7 8 8 7 099 1 8 9 9 7 650
+ 109188949189888889919395969799 0 2 09395969899 0 2 6 8 9 9 8 6 3 9 6501088 9 088
+  9 0889488889488 0 9 9501288 3 6 8 9 9 8 6 388 088 3 6 8 9 08888 08888501088 9 0
+ 88 6 088 9 08888 08888501288 9 088 4 088 9 088 9 088 4 088 9 08888 08888501088 9
+  088 9 088 9 08888 08888 0 9 9 0 9 950118899 9 08899 9 08899 08888 08888 0 9 950
+ 1088 9 088 9 088948888 0 9 9 3 9501197989897969595969799 6 8 9 097 6 8 9 9 099 0
+  1 2 4 6 8 9 9 8 6 0 1 2 4 6 8 9501088 9 088 9 0989695959698 1 3 6 8 9 9 8 6 095
+ 9698 1 3 6 8 9 0888850 99899 099989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 950
+ 1188 9 088 9 0989695959698 1 3 6 8 9 9 8 6 0959698 1 3 6 8 9 08888 0 9 950 9 1 1
+ 99979695959698 1 3 6 8 9 9 8 6 0 19896 0959698 1 3 6 8 950 6899091908988888991 9
+  0888991 9 09595 0 9 9501095969799 1 3 4 5 5 4 3 19997969595 09698 2 4 0 4 29896
+  09796959696 0 3 4 6 7 910101112 0 7 8 9 910121315161615131210 9501188 9 088 9 0
+ 989695959698 9 0959698 9 08888 0 9 9 0 9 950 68889908988 095 9 095 9 09595 0 9 9
+ 50 68889908988 095131516161514131415 095131516 09595501088 9 088 9 095 5 0 1 9 0
+  1 9 08888 09595 0 9 9 0 9 950 688 9 088 9 08888 0 9 9501795 9 095 9 09896959596
+ 98 9 0959698 9 0989695959698 9 0959698 9 09595 0 9 9 0 9 9 0 9 9501195 9 095 9 0
+ 989695959698 9 0959698 9 09595 0 9 9 0 9 95010959698 1 3 6 8 9 9 8 6 3 198969595
+  0959698 1 3 6 8 9 0 9 8 6 3 198969550109516 09516 0989695959698 1 3 6 8 9 9 8 6
+  0959698 1 3 6 8 9 09595 0161650109516 09516 0989695959698 1 3 6 8 9 9 8 6 09596
+ 98 1 3 6 8 9 0161650 895 9 095 9 0 1989695959697989796 09595 0 9 950 99795999796
+ 9595969799 0 1 3 4 5 09899 0 2 3 4 7 8 9 9 8 7 5 9 750 888 5 8 9 9 8 6 088 5 8 9
+  09595501195 6 8 9 9 8 6 095 6 8 9 095 9 095 9 09595 09595 0 9 950 995 9 095 7 0
+ 95 9 09595 09595501295 9 095 6 095 9 095 9 095 6 095 9 09595 09595501095 9 095 9
+  095 9 09595 09595 0 9 9 0 9 950 995 9 095 7 095 913151616151415 09595 0959550 9
+ 95 9 095 9 095999595 0 9 9 5 9501088899297 0 5 8 9 9 8 5 09792898888 08889909297
+  0 5 7 8 9 0 9 8 7 5 097929089885010929188 9 089 9 0 9 9501092939493929089888889
+ 9092949698 0 1 3 6 9 088899092949698 0 0 7 6 6 8 8 7 6 0 6 9 9 8 6 4501092939493
+ 9290898888899194969797 0888991949697 09798 0 2 5 7 8 9 9 8 7 5 4 3 4 5 099 2 5 7
+  8 9501090 9 088 9 088 3 3 0 9 950108898 0989695959698 1 3 6 8 9 9 8 7 5 4 3 4 5
+  0959698 1 3 6 8 9 08888 08989885010919293929189888889919397 3 6 8 9 9 8 6 3 299
+ 9796969799 2 08889919397 3 6 8 9 0 9 8 6 3 299979650108894 09290888891919088 090
+ 898991 088919499 1 4 9 09499 1 4 9501088899194969797969491898888 0888991949697 0
+ 979694918988 0979899 1 5 7 8 9 9 8 7 5 1999897 0979899 1 5 7 8 9 0 9 8 7 5 19998
+ 9750109598 0 1 1 098959491898888899194 0 4 6 8 9 9 8 6 5 4 5 6 0 1 0989594918988
+  088899194 0 4 6 8 950 5 7 8 9 8 750 5 9 8 7 810121350 59596979695 0 7 8 9 8 750
+  59596979695 0 9 8 7 810121350 58890 29088 09096 0 7 8 9 8 750 99293949392908988
+ 8889909294969799 2 088899092949698 0 7 8 9 8 750 48895 0889550 88895 08895 08895
+  0889550 78889919395969695939189888850 888 0 09197 091975011841650 78486899398 2
+  7111416 086909398 2 7101450 78486899398 2 7111416 086909398 2 710145013 0 05013
+ 91 9 0 0 050139797 0 3 350 59089888991939450 58889919394939250139697989796959596
+ 98 3 6 8 9 9 8 6 3 19795939189888991939699 6 8 9 9 8 7 0 9 8 6 3 199 09395 6 8 9
+ 50108413 08413 0919293929189888889919395969799 0 2 09395969899 0 2 6 8 9 9 8 6 5
+  4 5 650 78416 08416 08484 0161650 78416 08416 08484 0161650 784879092959798 0 2
+  3 5 8101316 086899396 0 4 7111450 884879092959798 0 2 3 5 8101316 086899396 0 4
+  7111450 48416501291 0 9501291 0 95012 3 198979798 1 2 2 199 0 199989899 2 3 3 2
+ 99975011 297 2 0 298 250 68894 088899450118816 08816 09999 0 5 5501288 9 0889092
+ 94959593918988888990908988 0 2 3 5 7 9 9 8 6 4 2 2501496949393949598 1 3 4 4 3 1
+  0939598 1 3 4 093 1 3 4 4 299979492908988888990929497 0 3 5 7 8 9 9 8 7 6 093 1
+  3 4501184165011161650
diff --git a/bin/build_fonts/unix/in_fnt33a.sym b/bin/build_fonts/unix/in_fnt33a.sym
new file mode 100644
index 0000000..363307b
--- /dev/null
+++ b/bin/build_fonts/unix/in_fnt33a.sym
@@ -0,0 +1,42 @@
+ 88  -3   7 ;PLOT MARKS
+    1   8  15  22  29  33  37  41  45  53  61  69  77  85  93 101 109 116 123 129
+  135 148 161 168 175 186 197 208 219 226 233 240 247 253 259 265 271 279 287 304
+  321 328 335 346 357 362 367 373 379 384 389 397 405 412 419 427 435 443 451 459
+  467 475 483 491 499 507 515 520 525 535 545 553 561 568 575 585 595 605 615 625
+  635 651 667 675 683 691 699 707 714
+ 9898 25098 2509696 45096 45098 0 05098 25096 0 05096 4509898 2509696 450 0 0 050
+  0 0 0509999 0 150 0 0509898 0 250 0 0509999 0 150 0 0509898 0 250 0 0509799 099
+ 5097 0509498 0985094 050 0 1 0 150 0 350 0 2 0 250 0 6509898 2 29898509696 4 496
+ 96509898 0 298509696 0 496509898 25098 250 0 05098 2509696 45096 450 0 05096 450
+ 98 298 298 25096 496 496 4509898 2 29898 25098 2509696 4 49696 45096 45097979799
+  1 3 3 199975094949498 2 6 6 298945098 2 098 0 25096 4 096 0 45098 0 098 2 05096
+  0 096 4 05098 298 2985096 496 496509898 298 2509696 496 4509898 0 050 0 2509696
+  0 050 0 45098989999985099 15099 150 2 1 1 25096969898965098 25098 250 4 2 2 450
+ 98 0 298 0 05096 0 496 0 05098 0 05098 2 098 0 25096 0 05096 4 096 0 4509898 0 2
+ 509696 0 4509898 0 298509696 0 496509898 0 2509696 0 4509898 0 050 0 2509696 0 0
+ 50 0 450999999 1 19950989898 2 298509999 0 05099 1509898 0 05098 2509999 1 19999
+  1509898 2 29898 2509999 199 1 199509898 298 2 29850999999 250 1 150989898 450 2
+  25099 19999 1 1995098 29898 2 298509999 1 19999 1509898 2 29898 2509999 1 05098
+ 98 2 0509999 1509999 1 199509898 2509898 2 298509999 1 19999 1509898 2 29898 250
+ 9898 250 298509696 450 496509898 250 2985099 1509696 450 4965098 2509898 250 298
+ 5098 2509696 450 4965096 45098 0 05098 25098 25096 0 05096 45096 450989899999898
+ 5098 250 1 2 2 1 1509696989896965096 450 2 4 4 2 2509898 2985098 2509696 4965096
+  4509898 250 298 2509696 450 496 4509797 2 098 397509494 4 096 69450
+  2 298 098 250 4 496 096 450 2 298 0 0 050 4 496 0 0 050 2 0 050 4 0 050 0 29850
+  0 49650 1 1 0 1 0 0 350 2 2 0 2 0 0 650 199 099 0 09750 298 098 0 09450 099 0 1
+  0 0 050 098 0 2 0 0 050 399 0 1 0 0 050 698 0 2 0 0 050 2 2 29898 250 4 4 49696
+  450 2 298 2 250 4 496 4 450 2 298 098 2 0 298 0 0 050 4 496 096 4 0 496 0 0 050
+  2 29898 2 250 4 49696 4 450 2 2 29898 298 098 250 4 4 49696 496 096 450 399 1 3
+  3 19997979950 698 2 6 6 29894949850 2 098 0 2 050 4 096 0 4 050 2 298 0 09850 4
+  496 0 09650 2 29898 250 4 49696 450 29898 2 250 49696 4 450 298 096 0 09850 496
+  092 0 09650 29899 1 2 0 1 1 09999 09899 1 250 49698 2 4 0 2 2 09898 09698 2 450
+  2 2 0 0 29850 4 4 0 0 49650 2 298 0 0 098 0 2 050 4 496 0 0 096 0 4 050 2 298 2
+ 50 4 496 450 298 2989850 496 4969650 298 29850 496 49650 2 2 098 0 0 250 4 4 096
+  0 0 450 198 2 2989850 296 4 4969650 19998 2 0 2 250 29896 4 0 4 450 19898 0 0 2
+  250 29696 0 0 4 450 19898 0 0 2 250 29696 0 0 4 450 298 0 0 098 250 496 0 0 096
+  450 19898 0 0 2 250 29696 0 0 4 450 1 0 0 2 2989850 2 0 0 4 4969650 19898 250 2
+ 9696 450 1 0 0 098 2 2989850 2 0 0 096 4 4969650 1 2 29898 0 050 2 4 49696 0 050
+  29999 0 1 150 49898 0 2 250 29999 0 1 1 0 29850 49898 0 2 2 0 49650 29898 0 0 0
+  0 2 250 49696 0 0 0 0 4 450 2 197 09999 0 3 350 4 294 09898 0 6 650 29999989899
+  0 298 0 2 2 1 1 250 49898969698 0 496 0 4 4 2 2 450 29799 1 0 2 250 49498 2 0 4
+  450 2 2 2 0 1999750 4 4 4 0 2989450 399 297 2999950 698 494 4989850
diff --git a/bin/ferret_paths_template.csh b/bin/ferret_paths_template.csh
new file mode 100644
index 0000000..519e754
--- /dev/null
+++ b/bin/ferret_paths_template.csh
@@ -0,0 +1,92 @@
+##
+## Environment settings for Ferret for csh users.
+## Source this file before running ferret ('source ferret_paths.csh')
+##
+
+## The environment variable FER_DIR should be the pathname of
+## the directory you created for the FERRET software.
+setenv FER_DIR "/usr/local/ferret"
+
+## The environment variable FER_DSETS should be the pathname of
+## the directory you created for the FERRET demonstration data files (30+ Mbytes).
+setenv FER_DSETS "${FER_DIR}/fer_dsets"
+
+## Web browser for your system used in some "go" scripts
+setenv FER_WEB_BROWSER "firefox"
+
+## If "java -version" does not run from the command prompt,
+## or does not report a java 1.6.x version, the environment 
+## variable JAVA_HOME needs to be defined in order to run 
+## the ThreddsBrowser GUI.  The directory defined by this 
+## environment variable contains the java executable (version
+## 1.6.x) in the bin subdirectory (ie, bin/java).
+if ( ! $?JAVA_HOME ) then
+    ## try some common locations; 
+    if ( -x "/usr/java/latest/bin/java" ) then
+        setenv JAVA_HOME "/usr/java/latest"
+    else if ( -x "/usr/lib/jvm/java-1.6.0-sun/bin/java" ) then
+        setenv JAVA_HOME "/usr/lib/jvm/java-1.6.0-sun"
+    else if ( -x "/usr/lib/jvm/java-6-sun/bin/java" ) then
+        setenv JAVA_HOME "/usr/lib/jvm/java-6-sun"
+    endif
+    ## or comment the above out and just set your own location
+    # setenv JAVA_HOME "/my/java-1.6/home"
+endif
+
+## =========== The remainder of this file should not need modification ===========
+## =========== unless you want to add custom directories or sites to   ===========
+## =========== the Ferret's defaults.                                  ===========
+
+
+## Prepend ${FER_DIR}/bin to ${PATH}
+## System Manager: If you prefer not to modify PATH here, you may comment
+## out these lines and execute the file $FER_DIR/bin/install_ferret_links
+## which will create ferret links in /usr/local/bin.
+if ( "${PATH}" !~ "${FER_DIR}/bin:*" ) then
+    setenv PATH "${FER_DIR}/bin:${PATH}"
+    rehash
+endif
+
+## Space-separated list of default sites for ThreddsBrowser
+## (SET /DATA /BROWSE or its alias OPEN)
+## Assigned in this unusual way to make it easy to add/delete/rearrange sites.
+setenv FER_DATA_THREDDS ""
+setenv FER_DATA_THREDDS "${FER_DATA_THREDDS} http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml"
+setenv FER_DATA_THREDDS "${FER_DATA_THREDDS} ${FER_DSETS}"
+
+## Space-separated lists of directories examined when searching
+## for (data, descriptor, grid, go-script) files without path components
+setenv FER_DATA ". ${FER_DSETS}/data ${FER_DIR}/go ${FER_DIR}/examples"
+setenv FER_DESCR ". ${FER_DSETS}/descr"
+setenv FER_GRIDS ". ${FER_DSETS}/grids"
+setenv FER_GO ". ${FER_DIR}/go ${FER_DIR}/examples ${FER_DIR}/contrib"
+
+## Space-separated list of directories containing traditional
+## Ferret external function files (shared-object libraries)
+setenv FER_EXTERNAL_FUNCTIONS "${FER_DIR}/ext_func/libs"
+
+## Space-separated list of directories for Ferret color palettes
+setenv FER_PALETTE ". ${FER_DIR}/ppl"
+## Ferret's color palettes directory (old)
+setenv SPECTRA "${FER_DIR}/ppl"
+
+## Directory for Ferret fonts
+setenv FER_FONTS "${FER_DIR}/ppl/fonts"
+## Directory for Ferret fonts (old)
+setenv PLOTFONTS "${FER_DIR}/ppl/fonts"
+
+## Directory containing threddsBrowser.jar and toolsUI.jar for ThreddsBrowser
+setenv FER_LIBS "${FER_DIR}/lib"
+
+setenv FER_DAT "${FER_DIR}"
+
+## Faddpath: a tool to quickly add paths to the search lists
+alias Faddpath 'if ( "\!*" != "" ) then \
+                   setenv FER_GO "$FER_GO \!*" \
+                   setenv FER_DATA "$FER_DATA \!*" \
+                   setenv FER_DESCR "$FER_DESCR \!*" \
+                   setenv FER_GRIDS "$FER_GRIDS \!*" \
+                else \
+                   echo "    Usage: Faddpath new_directory_1 ... " \
+                endif'
+
diff --git a/bin/ferret_paths_template.sh b/bin/ferret_paths_template.sh
new file mode 100644
index 0000000..37bebc4
--- /dev/null
+++ b/bin/ferret_paths_template.sh
@@ -0,0 +1,94 @@
+##
+## Environment settings for Ferret for bash users.
+## Source this file before running ferret ('. ferret_paths.sh')
+##
+
+## The environment variable FER_DIR should be the pathname of
+## the directory you created for the FERRET software.
+export FER_DIR="/usr/local/ferret"
+
+## The environment variable FER_DSETS should be the pathname of
+## the directory you created for the FERRET demonstration data files (30+ Mbytes).
+export FER_DSETS="${FER_DIR}/fer_dsets"
+
+## Web browser for your system used in some "go" scripts
+export FER_WEB_BROWSER="firefox"
+
+## If "java -version" does not run from the command prompt,
+## or does not report a java 1.6.x version, the environment 
+## variable JAVA_HOME needs to be defined in order to run 
+## the ThreddsBrowser GUI.  The directory defined by this 
+## environment variable contains the java executable (version
+## 1.6.x) in the bin subdirectory (ie, bin/java).
+if [ -z "$JAVA_HOME" ]; then
+    ## try some common locations; 
+    if [ -x "/usr/java/latest/bin/java" ]; then
+        export JAVA_HOME="/usr/java/latest"
+    elif [ -x "/usr/lib/jvm/java-1.6.0-sun/bin/java" ]; then
+        export JAVA_HOME="/usr/lib/jvm/java-1.6.0-sun"
+    elif [ -x "/usr/lib/jvm/java-6-sun/bin/java" ]; then
+        export JAVA_HOME="/usr/lib/jvm/java-6-sun"
+    fi
+    ## or comment the above out and just set your own location
+    # export JAVA_HOME="/my/java-1.6/home"
+fi
+
+
+## =========== The remainder of this file should not need modification ===========
+## =========== unless you want to add custom directories or sites to   ===========
+## =========== the Ferret's defaults.                                  ===========
+
+
+## Prepend ${FER_DIR}/bin to ${PATH}
+## System Manager: If you prefer not to modify PATH here, you may comment
+## out these lines and execute the file $FER_DIR/bin/install_ferret_links
+## which will create ferret links in /usr/local/bin.
+if ! echo "${PATH}" | grep -q "^${FER_DIR}/bin:"; then
+    export PATH="${FER_DIR}/bin:${PATH}"
+fi
+
+## Space-separated list of default sites for ThreddsBrowser
+## (SET /DATA /BROWSE or its alias OPEN)
+## Assigned in this unusual way to make it easy to add/delete/rearrange sites.
+export FER_DATA_THREDDS=""
+export FER_DATA_THREDDS="${FER_DATA_THREDDS} http://ferret.pmel.noaa.gov/geoide/geoIDECleanCatalog.xml"
+export FER_DATA_THREDDS="${FER_DATA_THREDDS} ${FER_DSETS}"
+
+## Space-separated lists of directories examined when searching
+## for (data, descriptor, grid, go-script) files without path components
+export FER_DATA=". ${FER_DSETS}/data ${FER_DIR}/go ${FER_DIR}/examples"
+export FER_DESCR=". ${FER_DSETS}/descr"
+export FER_GRIDS=". ${FER_DSETS}/grids"
+export FER_GO=". ${FER_DIR}/go ${FER_DIR}/examples ${FER_DIR}/contrib"
+
+## Space-separated list of directories containing traditional
+## Ferret external function files (shared-object libraries)
+export FER_EXTERNAL_FUNCTIONS="${FER_DIR}/ext_func/libs"
+
+## Space-separated list of directories for Ferret color palettes
+export FER_PALETTE=". ${FER_DIR}/ppl"
+## Ferret's color palettes directory (old)
+export SPECTRA="${FER_DIR}/ppl"
+
+## Directory for Ferret fonts
+export FER_FONTS="${FER_DIR}/ppl/fonts"
+## Directory for Ferret fonts (old)
+export PLOTFONTS="${FER_DIR}/ppl/fonts"
+
+## Directory containing threddsBrowser.jar and toolsUI.jar for ThreddsBrowser
+export FER_LIBS="${FER_DIR}/lib"
+
+## Ferret directory (old)
+export FER_DAT="${FER_DIR}"
+
+## Faddpath: a tool to quickly add paths to the search lists
+Faddpath() { if [ -n "$*" ]
+             then
+                 export FER_GO="$FER_GO $*"
+                 export FER_DATA="$FER_DATA $*"
+                 export FER_DESCR="$FER_DESCR $*"
+                 export FER_GRIDS="$FER_GRIDS $*"
+             else
+                 echo "    Usage: Faddpath new_directory_1 ..."
+             fi }
+
diff --git a/bin/install_ferret_links b/bin/install_ferret_links
new file mode 100755
index 0000000..da5c9a4
--- /dev/null
+++ b/bin/install_ferret_links
@@ -0,0 +1,44 @@
+#! /bin/sh
+# install FERRET links in the /usr/local/bin area - eliminating the need to
+# modify the PATH variable
+# ver 1.0 4/92 *sh* - based on INSTALL_BIN routine
+
+# procedure options include
+# "i" (install) - copies sources, links and other files to installation area
+# "r" (remove)  - removes the "i" files
+
+until [ "$activity" = "i" ] || [ "$activity" = "r" ] || [ "$activity" = "q" ]; do
+   read -p "Install (i), remove (r), or quit (q)? " activity
+   case "$activity" in
+      "i")
+         echo "Installing FERRET links"
+         ;;
+      "r")
+         echo "Removing FERRET links"
+         ;;
+      "q")
+         exit
+         ;;
+      *)
+         echo "You must answer i, r, or q"
+   esac
+done
+
+# basic definitions
+source_area="$FER_DIR/bin"
+dest_area="/usr/local/bin"
+
+cd "$source_area"
+for binfile in * ; do
+   case "$activity" in
+      "i")
+         if ! echo $binfile | grep -q '~$' ; then
+            ln -s "$source_area/$binfile" "$dest_area/$binfile"
+         fi
+         ;;
+      "r")
+         rm "$dest_area/$binfile"
+         ;;
+   esac
+done
+
diff --git a/bin/make_environment_tar b/bin/make_environment_tar
new file mode 100755
index 0000000..9a0477e
--- /dev/null
+++ b/bin/make_environment_tar
@@ -0,0 +1,162 @@
+#! /bin/sh
+
+echo ""
+if [ $# -eq 3 ]; then
+    if [ "$3" = "-y" ]; then
+        auto_ans="y"
+    fi
+fi
+if [ $# -lt 2 -o $# -gt 3 ]; then
+   argerror="true"
+elif [ $# -eq 3 -a -z "${auto_ans}" ]; then
+   argerror="true"
+fi
+if [ -n "${argerror}" ]; then
+   echo "Usage:  $0  <svn_repository>  <target_dir>  [ -y ] "
+   echo ""
+   echo "    Creates the Ferret installation file fer_environment.tar.gz. "
+   echo "    The required files will be extracted from the subversion "
+   echo "    repository <svn_repository>; for example, "
+   echo "        file:///home/users/tmap/svn/repos/ferret/trunk "
+   echo "    to a temporary directory which this script will create. "
+   echo "    Font files and lib files are NOT included in the tar file "
+   echo "    generated.  The gzipped tar file fer_environment.tar.gz "
+   echo "    will be written in <target_dir>, which must already exist. "
+   echo "    If the option third argument '-y' is given, any questions "
+   echo "    normally asked by the script will be automatically answered "
+   echo "    with 'y'. "
+   echo ""
+   echo "    Special case: if <svn_repository> is '.', then the required "
+   echo "    files will be copied from the current directory instead of "
+   echo "    being extracted from a subversion repository.  Thus, in "
+   echo "    this case, this script should probably be invoked as: "
+   echo "        bin/make_environment_tar . <target_dir> "
+   echo ""
+   exit 1
+fi
+
+if [ "$1" = "." ]; then
+    source_dir=`pwd`
+else
+    info=`svn info "$1"`
+    if [ -z "${info}" ]; then
+#  svn has printed an appropriate error message
+#  (but still returned a zero status)
+       echo ""
+       exit 1
+    fi
+fi
+repository="$1"
+
+if [ ! -d "$2" ]; then
+   echo "$2 does not exist "
+   echo ""
+   exit 1
+fi
+# Make sure target_dir is a full pathname
+target_dir=`cd "$2" ; pwd`
+
+# Make a clean temporary directory for the tar file contents
+temp_dir="/var/tmp/fer_env_$$"
+rm -fr ${temp_dir}
+mkdir ${temp_dir}
+cd ${temp_dir}
+
+# Copy or checkout the required files.  The copying intentionally
+# makes exactly the same directory structure as the check-out in
+# order to minimize the divergent parts of this script.
+if [ "${repository}" = "." ]; then
+    echo "Copying FERRET environment files "
+    echo "from ${source_dir} "
+    echo "to ${temp_dir} "
+    echo "   shell scripts"
+    cp -f -r ${source_dir}/bin .
+    rm -f ./bin/build_fonts/unix/binary ./bin/build_fonts/unix/fnt*.* 2>&1 1> /dev/null
+    echo "   journal files"
+    cp -f -r ${source_dir}/jnls .
+    echo "   external function source files"
+    cp -f -r ${source_dir}/external_functions .
+#   remove any object files and libraries from this copy
+#   of what is suppose to be just the source files
+    find ${temp_dir}/external_functions -name \*.so -delete
+    find ${temp_dir}/external_functions -name \*.a -delete
+    find ${temp_dir}/external_functions -name \*.o -delete
+    echo "   palettes"
+    cp -f -r ${source_dir}/palettes .
+else
+    echo "Extracting FERRET environment files "
+    echo "from ${repository} "
+    echo "to ${temp_dir} "
+    echo "   shell scripts"
+    svn checkout -q ${repository}/bin
+    echo "   journal files"
+    svn checkout -q ${repository}/jnls
+    echo "   external function source files"
+    svn checkout -q ${repository}/external_functions
+    echo "   palettes"
+    svn checkout -q ${repository}/palettes
+fi
+
+# Move files into their proper position
+echo "Doing a bit of rearranging"
+mv jnls/* .
+rm -rf jnls
+mv palettes ppl
+mkdir ext_func
+mv external_functions ext_func/src
+
+# Remove files that should not be distributed
+echo "Removing clutter"
+rm -f bin/Fapropos* 2>&1 1> /dev/null
+rm -f bin/Fhelp* 2>&1 1> /dev/null
+rm -f bin/Findex* 2>&1 1> /dev/null
+rm -f bin/Finstall.[^c]* 2>&1 1> /dev/null
+rm -f bin/Ftoc* 2>&1 1> /dev/null
+rm -f bin/ferret_paths*_template 2>&1 1> /dev/null
+rm -f bin/make_*_tar 2>&1 1> /dev/null
+rm -fr bin/fonts_* 2>&1 1> /dev/null
+rm -fr bin/build_fonts/original 2>&1 1> /dev/null
+
+# Now set up the proper symbolic links
+echo "Setting up symbolic links"
+cd bin
+ln -s Fdescr Fdesc
+ln -s Fgrids Fgrid
+ln -s Fprint_template Fprint
+cd ..
+
+# Create the tar file
+ctar_file="${target_dir}/fer_environment.tar.gz"
+echo ""
+echo "The tar file will be created from the contents of "
+echo "${temp_dir}"
+echo "(which can now be examined or tweaked from another shell/window)"
+echo ""
+echo -n "Create gzipped tar file ${ctar_file} (y/n)? "
+if [ -n "$auto_ans" ]; then
+    ans="${auto_ans}"
+else
+    read ans
+fi
+while [ "${ans}" != "y"  -a "${ans}" != "n" ]; do
+   echo -n "Answer either y or n: "
+   read ans
+done
+if [ "${ans}" = "y" ]; then
+   echo ""
+   rm -f "${ctar_file}"
+   tar cvzf "${ctar_file}" --exclude .svn *
+   echo ""
+   ls -l "${ctar_file}"
+else
+   echo ""
+   echo "Tar file NOT created"
+fi
+
+# Clean up
+echo ""
+echo "Cleaning up - removing ${temp_dir}"
+cd "${target_dir}"
+rm -fr "${temp_dir}"
+echo ""
+
diff --git a/bin/make_executable_tar b/bin/make_executable_tar
new file mode 100755
index 0000000..6290664
--- /dev/null
+++ b/bin/make_executable_tar
@@ -0,0 +1,182 @@
+#! /bin/sh
+
+# mycp needs to recursively copy subdirectories for the lib/python* directories
+# verbose flag used to create info messages when running this script
+mycp="/bin/cp -v -r --preserve=timestamp"
+mylns="/bin/ln -v -s"
+
+echo ""
+if [ $# -eq 3 ]; then
+    if [ "$3" = "-y" ]; then
+        auto_ans="y"
+    fi
+fi
+if [ $# -lt 2 -o $# -gt 3 ]; then
+   argerror="true"
+elif [ $# -eq 3 -a -z "${auto_ans}" ]; then
+   argerror="true"
+fi
+if [ -n "${argerror}" ]; then
+   echo "Usage:  $0  <ferret_dir>  <target_dir>  [ -y ] "
+   echo ""
+   echo "    Creates the Ferret installation file fer_executables.tar.gz. "
+   echo "    The required files will be copied from the ferret source directory "
+   echo "    <ferret_dir>, in which ferret or pyferret, and the font files "
+   echo "    have been built.  All the files required will be copied to a temporary "
+   echo "    directory which this script will create.  Any missing executables will "
+   echo "    be noted.  The gzipped tar file fer_executables.tar.gz will be written "
+   echo "    in <target_dir>, which must already exist.  If the optional third "
+   echo "    argument '-y' is given, any questions normally asked by the script "
+   echo "    will be automatically answered with 'y'. "
+   echo ""
+   exit 1
+fi
+
+if [ ! -d "$1" ]; then
+   echo "$1 does not exist or is not a directory"
+   echo ""
+   exit 1
+fi
+ferret_dir=`cd "$1" ; pwd`
+if [ ! -d "$2" ]; then
+   echo "$2 does not exist or is not a directory"
+   echo ""
+   exit 1
+fi
+target_dir=`cd "$2" ; pwd`
+
+pyferret_dir="${ferret_dir}/pyferret_install"
+if [ ! -d "${pyferret_dir}" ]; then
+   echo "${pyferret_dir} does not exist or is not a directory"
+   echo "    pyferret module not created"
+   echo ""
+   pyferret_dir=""
+fi
+
+# Get the version of ferret recorded in the code
+version=`awk '/revision_level/ {print $4}' ${ferret_dir}/fer/dat/xrevision_data.F`
+if [ $? -ne 0 -o "${version}" = "" ]; then
+   echo "Unable to read the version number from xrevision_data.F in ${ferret_dir}/fer/dat"
+   echo ""
+   exit 1
+fi
+echo "Ferret version number is ${version}"
+echo ""
+
+# Make a clean temporary directory for the tar file contents
+temp_dir="/var/tmp/fer_exe_$$"
+rm -fr ${temp_dir}
+mkdir ${temp_dir}
+mkdir ${temp_dir}/bin
+
+# Copy fer/ferret_c
+if [ -x ${ferret_dir}/fer/ferret_c ]; then
+   ${mycp} ${ferret_dir}/fer/ferret_c ${temp_dir}/bin/ferret_v${version}
+   cd ${temp_dir}/bin
+   ${mylns} ferret_v${version} ferret
+else
+   echo "No ferret_c executable found in ${ferret_dir}/fer"
+#  An error only if pyferret_dir was not given
+   if [ "${pyferret_dir}" = "" ]; then
+      echo ""
+      exit 1
+   else
+      echo "   ferret_v<n> and ferret symbolic link not created"
+      echo ""
+   fi
+fi
+
+# Copy the external function shared-object library files
+mkdir -p ${temp_dir}/ext_func/libs
+find ${ferret_dir}/external_functions -type f -perm -100 -name \*.so -exec ${mycp} {} ${temp_dir}/ext_func/libs \;
+
+# Copy font files from bin/build_fonts/unix/
+fer_files=${ferret_dir}/bin/build_fonts/unix/f*
+if [ $? -ne 0 -o "${fer_files}" = "" ]; then
+   echo "No font files found in ${ferret_dir}/bin/build_fonts/unix"
+   echo ""
+   exit 1
+fi
+mkdir ${temp_dir}/ppl
+mkdir ${temp_dir}/ppl/fonts
+${mycp} ${fer_files} ${temp_dir}/ppl/fonts
+
+# Copy threddsBrowser/threddsBrowser.jar
+tb_jar=${ferret_dir}/threddsBrowser/threddsBrowser.jar
+if [ ! -r ${tb_jar} ]; then
+   echo "No threddsBrowser.jar file found ${ferret_dir}/threddsBrowser"
+   echo ""
+   exit 1
+fi
+mkdir ${temp_dir}/lib
+${mycp} ${tb_jar} ${temp_dir}/lib
+
+# Either copy threddsBrowser/toolsUI/toolsUI-4.1.jar ...
+toolsui_jar=${ferret_dir}/threddsBrowser/toolsUI/toolsUI-4.1.jar
+if [ ! -r ${toolsui_jar} ]; then
+   echo "No toolsUI-4.1.jar file found ${ferret_dir}/threddsBrowser/toolsUI"
+   echo ""
+   exit 1
+fi
+${mycp} ${toolsui_jar} ${temp_dir}/lib
+# ... or print a message about how to get toolsUI-4.1.jar
+# echo "To minimize size, the toolsUI-4.1.jar file is not included."
+# echo "The user needs to download the jar file from:"
+# echo "  ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.1/toolsUI-4.1.jar"
+# echo "(or we can just grab it from <ferret_dir>/threddsBrowser/toolsUI/)"
+# echo 'and put it under the $FER_LIBS ($FER_DIR/lib) subdirectory'
+
+# Create a symbolic link to a (possibly non-existant) toolsUI-4.1.jar file
+cd ${temp_dir}/lib
+${mylns} toolsUI-4.1.jar toolsUI.jar
+
+# Copy ferret_ef_mem_subsc.so
+${mycp} ${ferret_dir}/efmem/ferret_ef_mem_subsc.so ${temp_dir}/lib
+
+# Copy pyferret files
+if [ "${pyferret_dir}" != "" ]; then
+   python_dirs=`find ${pyferret_dir} -type d -name python\*`
+   if [ $? -ne 0 -o "${python_dirs}" = "" ]; then
+      echo "No python* directories found under ${pyferret_dir}"
+      echo ""
+      exit 1
+   fi
+   ${mycp} ${python_dirs} ${temp_dir}/lib
+fi
+
+# Create the tar file
+ctar_file="${target_dir}/fer_executables.tar.gz"
+echo ""
+echo "The tar file will be created from the contents of "
+echo "${temp_dir}"
+echo "(which can now be examined or tweaked from another shell/window)"
+echo ""
+echo -n "Create gzipped tar file ${ctar_file} (y/n)? "
+if [ -n "$auto_ans" ]; then
+    ans="${auto_ans}"
+else
+    read ans
+fi
+while [ "${ans}" != "y" -a "${ans}" != "n" ]; do
+   echo -n "Answer either y or n: "
+   read ans
+done
+if [ "${ans}" = "y" ]; then
+   echo ""
+   cd ${temp_dir}
+   rm -f "${ctar_file}"
+   tar cvzf "${ctar_file}" *
+   echo ""
+   ls -l "${ctar_file}"
+else
+   echo ""
+   echo "Tar file NOT created"
+fi
+
+# Clean up
+echo ""
+echo "Cleaning up - removing ${temp_dir}"
+cd "${target_dir}"
+rm -fr "${temp_dir}"
+echo ""
+
diff --git a/bin/make_source_tar b/bin/make_source_tar
new file mode 100755
index 0000000..96f643e
--- /dev/null
+++ b/bin/make_source_tar
@@ -0,0 +1,104 @@
+#! /bin/sh
+
+if [ $# -ne 2 ]; then
+   echo "Usage:  $0  <svn_repository>  <target_dir> "
+   echo ""
+   echo "    The required files will be extracted from <svn_repository> "
+   echo "    (e.g., 'file:///home/users/tmap/svn/repos/ferret/trunk') "
+   echo "    to a temporary directory which this script will create. "
+   echo "    The gzipped tar file fer_source.tar.gz will be written in "
+   echo "    <target_dir>, which must already exist. "
+   echo ""
+   exit 1
+fi
+
+info=`svn info "$1"`
+if [ -z "${info}" ]; then
+#  svn has printed an appropriate error message
+#  (but still returned a zero status)
+   echo ""
+   exit 1
+fi
+repository="$1"
+
+if [ ! -d "$2" ]; then
+   echo "$2 does not exist or is not a directory "
+   echo ""
+   exit 1
+fi
+# Make sure target_dir is a full pathname
+target_dir=`cd "$2" ; pwd`
+
+# Decide what to call the directory checked-out from svn
+datestamp=`date +%F`
+echo ${repository} | grep -q 'pyferret$'
+if [ $? -eq 0 ]; then
+   fer_name="pyferret_${datestamp}"
+else
+   fer_name="ferret_${datestamp}"
+fi
+
+# Make a clean temporary directory for the tar file contents
+temp_dir="/var/tmp/fer_src_$$"
+rm -fr ${temp_dir}
+mkdir ${temp_dir}
+cd ${temp_dir}
+
+# Checkout the required files
+echo "Extracting FERRET source code "
+echo "from ${repository} "
+echo "to ${temp_dir}/${fer_name} "
+svn checkout -q ${repository} ${fer_name}
+
+# Remove the html_docs subdirectory from the checked-out directory
+rm -rf ${fer_name}/html_docs
+
+# Remove threddsBrowser/toolsUI/toolsUI-4.1.jar for the check-out directory
+# Have the user download this file from ucar 
+# NO LONGER AVAILABLE from ucar; keep it in
+# echo ""
+# echo "NOTE: To minimize size, the toolsUI-4.1.jar file is not included."
+# echo "The user needs to download the jar file from:"
+# echo "  ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.1/toolsUI-4.1.jar"
+# echo "(or we can just grab it from <ferret_dir>/threddsBrowser/toolsUI/)"
+# echo 'and put it under the $FER_LIBS ($FER_DIR/lib) subdirectory'
+# rm ${fer_name}/threddsBrowser/toolsUI/toolsUI-4.1.jar
+
+# Remove the bench/metafile_masters_* directories as this time.  GKS metafiles
+# no longer produced, and currently not creating the PostScript files in RUN_TESTS.sh
+echo ""
+echo 'NOTE: The bench/metafile_masters_* directories are not included.'
+rm -fr ${fer_name}/bench/metafile_masters_*
+
+# Create the tar file
+ctar_file="${target_dir}/fer_source.tar.gz"
+echo ""
+echo "The tar file will be created from the contents "
+echo "(except for the .svn subdirectories) of "
+echo "${temp_dir}"
+echo "(which can now be examined or tweaked from another shell/window)"
+echo ""
+echo -n "Create gzipped tar file ${ctar_file} (y/n)? "
+read ans
+while [ "${ans}" != "y" -a "${ans}" != "n" ]; do
+   echo -n "Answer either y or n: "
+   read ans
+done
+if [ "${ans}" = "y" ]; then
+   echo ""
+   rm -f "${ctar_file}"
+   tar cvzf "${ctar_file}" --exclude .svn "${fer_name}"
+   echo ""
+   ls -l "${ctar_file}"
+else
+   echo ""
+   echo "Tar file NOT created"
+fi
+
+# Clean up
+echo ""
+echo "Cleaning up - removing ${temp_dir}"
+cd "${target_dir}"
+rm -fr "${temp_dir}"
+echo ""
+
diff --git a/bin/mtp b/bin/mtp
new file mode 100755
index 0000000..e9a4423
--- /dev/null
+++ b/bin/mtp
@@ -0,0 +1,3 @@
+#! /bin/sh
+echo "Please use the Fprint command to get hardcopy!"
+
diff --git a/bin/my_ferret_paths_template.csh b/bin/my_ferret_paths_template.csh
new file mode 100644
index 0000000..666df47
--- /dev/null
+++ b/bin/my_ferret_paths_template.csh
@@ -0,0 +1,28 @@
+## my_ferret_paths_template.csh
+##
+## Template for setting up a personal FERRET environment
+## for users working under the tcsh or csh shells.
+##
+## Copy this file to your own directory area and
+## customize it to suit your personal directory layout.
+## Then source it (as below) from your .login file
+## AFTER you source the generic ferret_paths.csh file.
+##
+## example:  (in your .login file)
+## source /usr/local/ferret_paths.csh    (or wherever your system mgr. has put it)
+## source $HOME/my_ferret_paths.csh
+
+## These are the environment variables you may wish to customize.
+## They are currently set up on the assumption that all your FERRET
+## work is done in the directory $HOME/ferret .
+
+   setenv FER_GO "$FER_GO $HOME/ferret"
+
+   setenv FER_DATA "$FER_DATA $HOME/ferret"
+
+   setenv FER_DESCR "$FER_DESCR $HOME/ferret"
+
+   setenv FER_GRIDS "$FER_GRIDS $HOME/ferret"
+
+   setenv FER_MODEL_RUNS "$HOME/ferret/model_runs"
+
diff --git a/bin/my_ferret_paths_template.sh b/bin/my_ferret_paths_template.sh
new file mode 100644
index 0000000..b643972
--- /dev/null
+++ b/bin/my_ferret_paths_template.sh
@@ -0,0 +1,28 @@
+## my_ferret_paths_template.sh
+##
+## Template for setting up a personal FERRET environment
+## for users working under the bash, ksh, dash, or sh shells.
+##
+## Copy this file to your own directory area and
+## customize it to suit your personal directory layout.
+## Then source it (as below) from your .bashrc file
+## AFTER you source the generic ferret_paths.sh file.
+##
+## example:  (in your .bashrc file)
+## . /usr/local/bin/ferret_paths.sh    (or wherever your system mgr. has put it)
+## . $HOME/my_ferret_paths.sh
+
+## These are the environment variables you may wish to customize.
+## They are currently set up on the assumption that all your FERRET
+## work is done in the directory $HOME/ferret .
+
+   export FER_GO="$FER_GO $HOME/ferret"
+
+   export FER_DATA="$FER_DATA $HOME/ferret"
+
+   export FER_DESCR="$FER_DESCR $HOME/ferret"
+
+   export FER_GRIDS="$FER_GRIDS $HOME/ferret"
+
+   export FER_MODEL_RUNS="$HOME/ferret/model_runs"
+
diff --git a/bin/pyferret_template.csh b/bin/pyferret_template.csh
new file mode 100644
index 0000000..c8fa14f
--- /dev/null
+++ b/bin/pyferret_template.csh
@@ -0,0 +1,55 @@
+#! /bin/csh
+## This C-shell script is used to initialize and run Ferret using the 
+## pyferret Python module.  The intent of this script is to provide a 
+## traditional Ferret interface through the pyferret module.
+
+## set python_exe to the (optionally full-path) python executable to use
+set python_exe = PYTHON_EXECUTABLE
+
+## set python_subdir to 'python2.6' or 'python2.7' 
+## whichever is appropriate for the above python executable
+set python_subdir = PYTHON_SUBDIRECTORY
+
+## Make sure the FER_* environment variables are assigned
+if ( ! $?FER_LIBS ) then
+## Either source the ferret_paths script to assign the environment variables
+#    source "/my/path/to/ferret_paths.csh"
+## or just throw an error if they should have already been defined
+    echo "**ERROR: Ferret environment variables are not defined"
+    exit 1
+##
+endif
+
+##
+## ==== The following should not need any modifications ====
+##
+
+
+## Assign the directory containing the pyferret Python package (directory)
+set pysite = "${FER_LIBS}/${python_subdir}/site-packages"
+
+## Add $pysite to the Python search path given by PYTHONPATH 
+## so the pyferret package will be found.
+if ( ! $?PYTHONPATH ) then
+    setenv PYTHONPATH "${pysite}"
+else
+    if ( "${PYTHONPATH}" !~ "*${pysite}*" ) then
+        setenv PYTHONPATH "${pysite}:${PYTHONPATH}"
+    endif
+endif
+
+## Add $pysite/pyferret to the shared-object library search path given 
+## by LD_LIBRARY_PATH so libpyferret.so will be found.
+if ( ! $?LD_LIBRARY_PATH ) then
+    setenv LD_LIBRARY_PATH "${pysite}/pyferret"
+else
+    if ( "${LD_LIBRARY_PATH}" !~ "*${pysite}/pyferret*" ) then
+        setenv LD_LIBRARY_PATH "${pysite}/pyferret:${LD_LIBRARY_PATH}"
+    endif
+endif
+
+## Finally, execute an in-line Python script to run Ferret using the pyferret 
+## module.  The init method explicity processes the $PYTHONSTARTUP file, if it
+## exists and if '-secure' was not given as a command-line argument.
+${python_exe} -i -c "import sys; import pyferret; (errval, errmsg) = pyferret.init(sys.argv[1:], True)" $*
+
diff --git a/bin/pyferret_template.sh b/bin/pyferret_template.sh
new file mode 100644
index 0000000..66a7285
--- /dev/null
+++ b/bin/pyferret_template.sh
@@ -0,0 +1,56 @@
+#! /bin/sh
+## This Bourne-shell script is used to initialize and run Ferret using 
+## the pyferret Python module.  The intent of this script is to provide 
+## a traditional Ferret interface through the pyferret module.
+
+## set python_exe to the (optionally full-path) python executable to use
+python_exe=PYTHON_EXECUTABLE
+
+## set python_subdir to 'python2.6' or 'python2.7' 
+## whichever is appropriate for the above python executable
+python_subdir=PYTHON_SUBDIRECTORY
+
+## Make sure the FER_* environment variables are assigned
+if [ -z "${FER_LIBS}" ]; then
+## Either source the ferret_paths script to assign the environment variables
+#    . "/my/path/to/ferret_paths.sh"
+## or just throw an error if they should have already been defined
+    echo "**ERROR: Ferret environment variables are not defined"
+    exit 1
+##
+fi
+
+
+##
+## ==== The following should not need any modifications ====
+##
+
+
+## Assign the directory containing the pyferret Python package (directory)
+pysite="${FER_LIBS}/${python_subdir}/site-packages"
+
+## Add pysite to the Python search path given by PYTHONPATH
+## so the pyferret package will be found.
+if [ -z "${PYTHONPATH}" ]; then
+    export PYTHONPATH="${pysite}"
+else
+    if ! echo "${PYTHONPATH}" | grep -q "${pysite}"; then
+        export PYTHONPATH="${pysite}:${PYTHONPATH}"
+    fi
+fi
+
+## Add $pysite/pyferret to the shared-object library search path given 
+## by LD_LIBRARY_PATH so libpyferret.so will be found.
+if [ -z "${LD_LIBRARY_PATH}" ]; then
+    export LD_LIBRARY_PATH="${pysite}/pyferret"
+else
+    if ! echo "${LD_LIBRARY_PATH}" | grep -q "${pysite}/pyferret"; then
+        export LD_LIBRARY_PATH="${pysite}/pyferret:${LD_LIBRARY_PATH}"
+    fi
+fi
+
+## Finally, execute an in-line Python script to run Ferret using the pyferret 
+## module.  The init method explicity processes the $PYTHONSTARTUP file, if it
+## exists and if '-secure' was not given as a command-line argument.
+${python_exe} -i -c "import sys; import pyferret; (errval, errmsg) = pyferret.init(sys.argv[1:], True)" $*
+
diff --git a/efmem/Makefile b/efmem/Makefile
new file mode 100644
index 0000000..5f4bd7f
--- /dev/null
+++ b/efmem/Makefile
@@ -0,0 +1,44 @@
+#
+# Site-specific defines
+#
+include ../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../platform_specific.mk.$(BUILDTYPE)
+
+#
+# The shared-object library ferret_ef_mem_subsc.so contains an external
+# copy of the common block FERRET_EF_MEM_SUBSC in a function which copies
+# the values from Ferret's internal copy of the common block.  These values
+# are obtained by calling the Ferret functions ef_get_arg_mem_subscripts,
+# ef_get_res_mem_subscripts, and ef_get_wrk_mem_subscripts.
+#
+# This shared-object library is loaded using dlopen with the RTLD_GLOBAL
+# flag so this external copy of the common block can be seen by all Ferret
+# Fortran external functions.  Python import uses the RTLD_LOCAL flag with
+# dlopen (for encapsulation), thus the reason Ferret's internal copy of the
+# common block is not seen by the Fortran external functions.
+#
+# The name intentionally does not start with "lib" since this library should
+# not be linked with anything.  Ferret loads it dynamically with dlopen.
+#
+EFMEMLIB = ferret_ef_mem_subsc.so
+
+#
+# Targets
+#
+
+all: $(EFMEMLIB)
+
+$(EFMEMLIB): copy_ferret_ef_mem_subsc.o
+	$(LD) $(LD_DYN_FLAGS) copy_ferret_ef_mem_subsc.o -lpyferret -o $(EFMEMLIB)
+
+clean:
+	rm -f *.o $(EFMEMLIB)
+
+#
+# End of Makefile
+#
diff --git a/efmem/copy_ferret_ef_mem_subsc.F b/efmem/copy_ferret_ef_mem_subsc.F
new file mode 100644
index 0000000..c5a8e16
--- /dev/null
+++ b/efmem/copy_ferret_ef_mem_subsc.F
@@ -0,0 +1,330 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* The shared-object library libferret_ef_mem_subsc.so created from this
+* source file contains an external copy of the common block FERRET_EF_MEM_SUBSC
+* in a function which copies the values from Ferret's internal copy of
+* the common block.  These values are obtained by calling the functions
+* ef_get_arg_mem_subscripts and ef_get_res_mem_subscripts given in Ferret.
+*
+* This shared-object library is loaded using dlopen with the RTLD_GLOBAL
+* flag so this external copy of the common block can be seen by all Ferret
+* Fortran external functions.  Python import uses the RTLD_LOCAL flag with
+* dlopen (for encapsulation), thus the reason Ferret's internal copy of the
+* common block is not seen by the Fortran external functions.
+*
+
+      SUBROUTINE COPY_FERRET_EF_MEM_SUBSC
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* local variables
+      INTEGER res_memlo(6), res_memhi(6)
+      INTEGER arg_memlo(6, EF_MAX_ARGS)
+      INTEGER arg_memhi(6, EF_MAX_ARGS)
+      INTEGER wrk_memlo(6, EF_MAX_WORK_ARRAYS)
+      INTEGER wrk_memhi(6, EF_MAX_WORK_ARRAYS)
+
+* get the result array dimensions from Ferret's local copy of the common block
+      CALL ef_get_res_mem_subscripts_6d(0, res_memlo, res_memhi)
+
+* copy the result array dimensions to this externally visible common block
+      memreslox = res_memlo(1)
+      memresloy = res_memlo(2) 
+      memresloz = res_memlo(3) 
+      memreslot = res_memlo(4) 
+      memresloe = res_memlo(5) 
+      memreslof = res_memlo(6) 
+
+      memreshix = res_memhi(1) 
+      memreshiy = res_memhi(2) 
+      memreshiz = res_memhi(3) 
+      memreshit = res_memhi(4) 
+      memreshie = res_memhi(5) 
+      memreshif = res_memhi(6) 
+
+* get the argument arrays dimensions from Ferret's local copy of the common block
+      CALL ef_get_arg_mem_subscripts_6d(0, arg_memlo, arg_memhi)
+
+* copy the argument arrays dimensions to this externally visible common block
+* this assumed EF_MAX_ARGS .EQ. 9
+      mem1lox = arg_memlo(1,1) 
+      mem2lox = arg_memlo(1,2) 
+      mem3lox = arg_memlo(1,3) 
+      mem4lox = arg_memlo(1,4) 
+      mem5lox = arg_memlo(1,5) 
+      mem6lox = arg_memlo(1,6) 
+      mem7lox = arg_memlo(1,7) 
+      mem8lox = arg_memlo(1,8) 
+      mem9lox = arg_memlo(1,9) 
+
+      mem1loy = arg_memlo(2,1) 
+      mem2loy = arg_memlo(2,2) 
+      mem3loy = arg_memlo(2,3) 
+      mem4loy = arg_memlo(2,4) 
+      mem5loy = arg_memlo(2,5) 
+      mem6loy = arg_memlo(2,6) 
+      mem7loy = arg_memlo(2,7) 
+      mem8loy = arg_memlo(2,8) 
+      mem9loy = arg_memlo(2,9) 
+
+      mem1loz = arg_memlo(3,1) 
+      mem2loz = arg_memlo(3,2) 
+      mem3loz = arg_memlo(3,3) 
+      mem4loz = arg_memlo(3,4) 
+      mem5loz = arg_memlo(3,5) 
+      mem6loz = arg_memlo(3,6) 
+      mem7loz = arg_memlo(3,7) 
+      mem8loz = arg_memlo(3,8) 
+      mem9loz = arg_memlo(3,9) 
+
+      mem1lot = arg_memlo(4,1) 
+      mem2lot = arg_memlo(4,2) 
+      mem3lot = arg_memlo(4,3) 
+      mem4lot = arg_memlo(4,4) 
+      mem5lot = arg_memlo(4,5) 
+      mem6lot = arg_memlo(4,6) 
+      mem7lot = arg_memlo(4,7) 
+      mem8lot = arg_memlo(4,8) 
+      mem9lot = arg_memlo(4,9) 
+
+      mem1loe = arg_memlo(5,1) 
+      mem2loe = arg_memlo(5,2) 
+      mem3loe = arg_memlo(5,3) 
+      mem4loe = arg_memlo(5,4) 
+      mem5loe = arg_memlo(5,5) 
+      mem6loe = arg_memlo(5,6) 
+      mem7loe = arg_memlo(5,7) 
+      mem8loe = arg_memlo(5,8) 
+      mem9loe = arg_memlo(5,9) 
+
+      mem1lof = arg_memlo(6,1) 
+      mem2lof = arg_memlo(6,2) 
+      mem3lof = arg_memlo(6,3) 
+      mem4lof = arg_memlo(6,4) 
+      mem5lof = arg_memlo(6,5) 
+      mem6lof = arg_memlo(6,6) 
+      mem7lof = arg_memlo(6,7) 
+      mem8lof = arg_memlo(6,8) 
+      mem9lof = arg_memlo(6,9) 
+
+      mem1hix = arg_memhi(1,1) 
+      mem2hix = arg_memhi(1,2) 
+      mem3hix = arg_memhi(1,3) 
+      mem4hix = arg_memhi(1,4) 
+      mem5hix = arg_memhi(1,5) 
+      mem6hix = arg_memhi(1,6) 
+      mem7hix = arg_memhi(1,7) 
+      mem8hix = arg_memhi(1,8) 
+      mem9hix = arg_memhi(1,9) 
+
+      mem1hiy = arg_memhi(2,1) 
+      mem2hiy = arg_memhi(2,2) 
+      mem3hiy = arg_memhi(2,3) 
+      mem4hiy = arg_memhi(2,4) 
+      mem5hiy = arg_memhi(2,5) 
+      mem6hiy = arg_memhi(2,6) 
+      mem7hiy = arg_memhi(2,7) 
+      mem8hiy = arg_memhi(2,8) 
+      mem9hiy = arg_memhi(2,9) 
+
+      mem1hiz = arg_memhi(3,1) 
+      mem2hiz = arg_memhi(3,2) 
+      mem3hiz = arg_memhi(3,3) 
+      mem4hiz = arg_memhi(3,4) 
+      mem5hiz = arg_memhi(3,5) 
+      mem6hiz = arg_memhi(3,6) 
+      mem7hiz = arg_memhi(3,7) 
+      mem8hiz = arg_memhi(3,8) 
+      mem9hiz = arg_memhi(3,9) 
+
+      mem1hit = arg_memhi(4,1) 
+      mem2hit = arg_memhi(4,2) 
+      mem3hit = arg_memhi(4,3) 
+      mem4hit = arg_memhi(4,4) 
+      mem5hit = arg_memhi(4,5) 
+      mem6hit = arg_memhi(4,6) 
+      mem7hit = arg_memhi(4,7) 
+      mem8hit = arg_memhi(4,8) 
+      mem9hit = arg_memhi(4,9) 
+
+      mem1hie = arg_memhi(5,1) 
+      mem2hie = arg_memhi(5,2) 
+      mem3hie = arg_memhi(5,3) 
+      mem4hie = arg_memhi(5,4) 
+      mem5hie = arg_memhi(5,5) 
+      mem6hie = arg_memhi(5,6) 
+      mem7hie = arg_memhi(5,7) 
+      mem8hie = arg_memhi(5,8) 
+      mem9hie = arg_memhi(5,9) 
+
+      mem1hif = arg_memhi(6,1) 
+      mem2hif = arg_memhi(6,2) 
+      mem3hif = arg_memhi(6,3) 
+      mem4hif = arg_memhi(6,4) 
+      mem5hif = arg_memhi(6,5) 
+      mem6hif = arg_memhi(6,6) 
+      mem7hif = arg_memhi(6,7) 
+      mem8hif = arg_memhi(6,8) 
+      mem9hif = arg_memhi(6,9) 
+
+* get the work arrays dimensions from Ferret's local copy of the common block
+      CALL ef_get_wrk_mem_subscripts_6d(0, wrk_memlo, wrk_memhi)
+
+* copy the work arrays dimensions to this externally visible common block
+* this assumed EF_MAX_WORK_ARRAYS .EQ. 9
+      wrk1lox = wrk_memlo(1,1) 
+      wrk2lox = wrk_memlo(1,2) 
+      wrk3lox = wrk_memlo(1,3) 
+      wrk4lox = wrk_memlo(1,4) 
+      wrk5lox = wrk_memlo(1,5) 
+      wrk6lox = wrk_memlo(1,6) 
+      wrk7lox = wrk_memlo(1,7) 
+      wrk8lox = wrk_memlo(1,8) 
+      wrk9lox = wrk_memlo(1,9) 
+
+      wrk1loy = wrk_memlo(2,1) 
+      wrk2loy = wrk_memlo(2,2) 
+      wrk3loy = wrk_memlo(2,3) 
+      wrk4loy = wrk_memlo(2,4) 
+      wrk5loy = wrk_memlo(2,5) 
+      wrk6loy = wrk_memlo(2,6) 
+      wrk7loy = wrk_memlo(2,7) 
+      wrk8loy = wrk_memlo(2,8) 
+      wrk9loy = wrk_memlo(2,9) 
+
+      wrk1loz = wrk_memlo(3,1) 
+      wrk2loz = wrk_memlo(3,2) 
+      wrk3loz = wrk_memlo(3,3) 
+      wrk4loz = wrk_memlo(3,4) 
+      wrk5loz = wrk_memlo(3,5) 
+      wrk6loz = wrk_memlo(3,6) 
+      wrk7loz = wrk_memlo(3,7) 
+      wrk8loz = wrk_memlo(3,8) 
+      wrk9loz = wrk_memlo(3,9) 
+
+      wrk1lot = wrk_memlo(4,1) 
+      wrk2lot = wrk_memlo(4,2) 
+      wrk3lot = wrk_memlo(4,3) 
+      wrk4lot = wrk_memlo(4,4) 
+      wrk5lot = wrk_memlo(4,5) 
+      wrk6lot = wrk_memlo(4,6) 
+      wrk7lot = wrk_memlo(4,7) 
+      wrk8lot = wrk_memlo(4,8) 
+      wrk9lot = wrk_memlo(4,9) 
+
+      wrk1loe = wrk_memlo(5,1) 
+      wrk2loe = wrk_memlo(5,2) 
+      wrk3loe = wrk_memlo(5,3) 
+      wrk4loe = wrk_memlo(5,4) 
+      wrk5loe = wrk_memlo(5,5) 
+      wrk6loe = wrk_memlo(5,6) 
+      wrk7loe = wrk_memlo(5,7) 
+      wrk8loe = wrk_memlo(5,8) 
+      wrk9loe = wrk_memlo(5,9) 
+
+      wrk1lof = wrk_memlo(6,1) 
+      wrk2lof = wrk_memlo(6,2) 
+      wrk3lof = wrk_memlo(6,3) 
+      wrk4lof = wrk_memlo(6,4) 
+      wrk5lof = wrk_memlo(6,5) 
+      wrk6lof = wrk_memlo(6,6) 
+      wrk7lof = wrk_memlo(6,7) 
+      wrk8lof = wrk_memlo(6,8) 
+      wrk9lof = wrk_memlo(6,9) 
+
+      wrk1hix = wrk_memhi(1,1) 
+      wrk2hix = wrk_memhi(1,2) 
+      wrk3hix = wrk_memhi(1,3) 
+      wrk4hix = wrk_memhi(1,4) 
+      wrk5hix = wrk_memhi(1,5) 
+      wrk6hix = wrk_memhi(1,6) 
+      wrk7hix = wrk_memhi(1,7) 
+      wrk8hix = wrk_memhi(1,8) 
+      wrk9hix = wrk_memhi(1,9) 
+
+      wrk1hiy = wrk_memhi(2,1) 
+      wrk2hiy = wrk_memhi(2,2) 
+      wrk3hiy = wrk_memhi(2,3) 
+      wrk4hiy = wrk_memhi(2,4) 
+      wrk5hiy = wrk_memhi(2,5) 
+      wrk6hiy = wrk_memhi(2,6) 
+      wrk7hiy = wrk_memhi(2,7) 
+      wrk8hiy = wrk_memhi(2,8) 
+      wrk9hiy = wrk_memhi(2,9) 
+
+      wrk1hiz = wrk_memhi(3,1) 
+      wrk2hiz = wrk_memhi(3,2) 
+      wrk3hiz = wrk_memhi(3,3) 
+      wrk4hiz = wrk_memhi(3,4) 
+      wrk5hiz = wrk_memhi(3,5) 
+      wrk6hiz = wrk_memhi(3,6) 
+      wrk7hiz = wrk_memhi(3,7) 
+      wrk8hiz = wrk_memhi(3,8) 
+      wrk9hiz = wrk_memhi(3,9) 
+
+      wrk1hit = wrk_memhi(4,1) 
+      wrk2hit = wrk_memhi(4,2) 
+      wrk3hit = wrk_memhi(4,3) 
+      wrk4hit = wrk_memhi(4,4) 
+      wrk5hit = wrk_memhi(4,5) 
+      wrk6hit = wrk_memhi(4,6) 
+      wrk7hit = wrk_memhi(4,7) 
+      wrk8hit = wrk_memhi(4,8) 
+      wrk9hit = wrk_memhi(4,9) 
+
+      wrk1hie = wrk_memhi(5,1) 
+      wrk2hie = wrk_memhi(5,2) 
+      wrk3hie = wrk_memhi(5,3) 
+      wrk4hie = wrk_memhi(5,4) 
+      wrk5hie = wrk_memhi(5,5) 
+      wrk6hie = wrk_memhi(5,6) 
+      wrk7hie = wrk_memhi(5,7) 
+      wrk8hie = wrk_memhi(5,8) 
+      wrk9hie = wrk_memhi(5,9) 
+
+      wrk1hif = wrk_memhi(6,1) 
+      wrk2hif = wrk_memhi(6,2) 
+      wrk3hif = wrk_memhi(6,3) 
+      wrk4hif = wrk_memhi(6,4) 
+      wrk5hif = wrk_memhi(6,5) 
+      wrk6hif = wrk_memhi(6,6) 
+      wrk7hif = wrk_memhi(6,7) 
+      wrk8hif = wrk_memhi(6,8) 
+      wrk9hif = wrk_memhi(6,9) 
+
+      RETURN
+      END
+
diff --git a/external_functions/Makefile b/external_functions/Makefile
new file mode 100644
index 0000000..136f0a7
--- /dev/null
+++ b/external_functions/Makefile
@@ -0,0 +1,88 @@
+#
+# Top level Makefile for Ferret External Functions
+#
+# September 09 1998
+# Jonathan Callahan
+#
+# ACM 1/2002  add fft directory back in: lsl_lowpass, inverse fcn.
+# ACM 4/2006  link all functions that are distributed statically; the
+#             directories below compile only example functions, functions
+#             under development, or used locally by PMEL/TMAP (e.g.romea fcns)
+ 
+#
+# Site-specific defines
+#
+include ../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macro Definitions
+#
+
+DIRS = contributed examples fft statistics
+MOREDIRS = contributed cmprsi_by decimate examples extrema featurecollections gridding fft las statistics tax_times
+# DIRS = contributed examples fft sort cflib closest_in_list hinterp featurecollections romea odd_formats cat statistics tax_times gridding zaxr 
+
+#
+# Targets
+#
+
+.PHONY : all
+all: optimized
+
+.PHONY : optimized
+optimized:
+	$(MAKE) "CFLAGS = $(CFLAGS) -O" "FFLAGS = $(FFLAGS) -O" build
+
+.PHONY : debug
+debug:
+	$(MAKE) "CFLAGS = $(CFLAGS) -O0 -g" "FFLAGS = $(FFLAGS) -O0 -g" build
+
+.PHONY: build
+build:
+	for i in $(DIRS) ; do \
+            if ! $(MAKE) -C $$i ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+.PHONY: buildmore
+buildmore:
+	for i in $(MOREDIRS) ; do \
+            if ! $(MAKE) -C $$i ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+.PHONY: install
+install:
+	for i in $(DIRS) ; do \
+            if ! $(MAKE) -C $$i install ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+.PHONY: installmore
+installmore:
+	for i in $(MOREDIRS) ; do \
+            if ! $(MAKE) -C $$i install ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+.PHONY: clean
+clean:
+	for i in $(DIRS) $(MOREDIRS) ; do \
+            if ! $(MAKE) -C $$i clean ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+#
+# End of Makefile
+#
diff --git a/external_functions/cat/Makefile b/external_functions/cat/Makefile
new file mode 100644
index 0000000..14a5422
--- /dev/null
+++ b/external_functions/cat/Makefile
@@ -0,0 +1,50 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	list_good.so xcat.so ycat.so zcat.so tcat.so xreverse.so yreverse.so zreverse.so treverse.so
+all:	list_good.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/cat/list_good.F b/external_functions/cat/list_good.F
new file mode 100644
index 0000000..6d02c69
--- /dev/null
+++ b/external_functions/cat/list_good.F
@@ -0,0 +1,251 @@
+*
+* list_good.F
+*
+* Ansley Manke
+* April 1, 2005
+*
+* This function lists the good values of a variable with its location.
+*
+
+      SUBROUTINE list_good_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 1000)
+      CALL ef_set_desc(id, descrip)
+
+ 1000 FORMAT(
+     .  'List the value and location of valid data. ',
+     .  'Return number of valid values')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE list_good_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+  
+      call ef_set_axis_limits(id, X_AXIS, 1, 1)
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE list_good_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER m1, m2
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  to hold coordinate values which will be REAL*8
+
+*  xaxsrc
+
+      iwork = 1
+
+      m1 = 1
+      m2 = 2*(1 + ABS(arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)))
+      IF (arg_lo_ss(X_AXIS,ARG1) .EQ. ef_unspecified_int4) THEN
+         m1 = 1
+         m2 = 1
+      ENDIF
+
+      CALL ef_set_work_array_dims (id, iwork, m1,1,1,1, m2,1,1,1)
+
+*  yaxsrc
+
+      iwork = 2
+      
+      m1 = 1
+      m2 = 2*(1 + ABS(arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)))
+      IF (arg_lo_ss(Y_AXIS,ARG1) .EQ. ef_unspecified_int4) THEN
+         m1 = 1
+         m2 = 1
+      ENDIF
+
+      CALL ef_set_work_array_dims (id, iwork, 1,m1,1,1, 1,m2,1,1)
+
+*  zaxsrc
+
+      iwork = 3
+
+      m1 = 1
+      m2 = 2*(1 + ABS(arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)))
+      IF (arg_lo_ss(Z_AXIS,ARG1) .EQ. ef_unspecified_int4) THEN
+         m1 = 1
+         m2 = 1
+      ENDIF
+
+      CALL ef_set_work_array_dims (id, iwork, 1,1,m1,1, 1,1,m2,1)
+
+*  taxsrc
+
+      iwork = 4
+
+      m1 = 1
+      m2 = 2*(1 + ABS(arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)))
+      IF (arg_lo_ss(t_AXIS,ARG1) .EQ. ef_unspecified_int4) THEN
+         m1 = 1
+         m2 = 1
+      ENDIF
+
+      CALL ef_set_work_array_dims (id, iwork, 1,1,1,m1, 1,1,1,m2)
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE list_good_compute(id, arg_1, result, 
+     .                xaxsrc, yaxsrc, zaxsrc, taxsrc)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL*8 xaxsrc(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yaxsrc(wrk2lox:wrk2hix, wrk2loy:wrk2hiy/2,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 zaxsrc(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz/2, wrk3lot:wrk3hit)
+      REAL*8 taxsrc(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit/2)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1
+      REAL xx, yy, zz, tt, count
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxsrc)
+
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxsrc)
+
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS, 
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxsrc)
+
+      CALL ef_get_coordinates(id, ARG1, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxsrc)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+c1000  FORMAT (4x, 4i10/, 4x, 4g15.8/  g15.8)
+1000  FORMAT (4i10, 4x,  g15.8)
+
+      print *, ' '
+      print *, ' good data from variable'
+      print *, '       I         J         K         L          VALUE'   
+c      print *, '         X         Y         Z         T'
+c      print *, ' VALUE'
+      print *, ' '
+
+      count = 0
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)         
+
+         IF (arg_1(i1,j1,k1,l1) .NE. bad_flag(ARG1)) THEN
+           xx = ef_unspecified_int4
+           IF (i1 .NE. ef_unspecified_int4) xx =  xaxsrc(i1,1,1,1)
+           yy = ef_unspecified_int4
+           IF (j1 .NE. ef_unspecified_int4) yy =  yaxsrc(1,j1,1,1)
+           zz = ef_unspecified_int4
+           IF (k1 .NE. ef_unspecified_int4) zz =  zaxsrc(1,1,k1,1)
+           tt = ef_unspecified_int4
+           IF (L1 .NE. ef_unspecified_int4) tt =  taxsrc(1,1,1,L1)
+           PRINT 1000, i1, j1, k1, l1, 
+c     .                 xx, yy, zz, tt,
+     .                 arg_1(i1,j1,k1,l1)
+           count = count + 1
+         ENDIF
+
+ 100  CONTINUE
+ 200  CONTINUE
+ 300  CONTINUE
+ 400  CONTINUE
+
+      result(i,j,k,l) = count
+
+      print *, ' '
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/tcat.F b/external_functions/cat/tcat.F
new file mode 100644
index 0000000..5384702
--- /dev/null
+++ b/external_functions/cat/tcat.F
@@ -0,0 +1,231 @@
+*
+* tcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+*
+* This function returns the T values of the two variables,
+* concatenated into one long list on an abstract t axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tcat_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the T values of two variables into one ',
+     .        'list on an abstract T axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE tcat_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tcat_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+               k = res_lo_ss(Z_AXIS)
+               DO 100 k1 = arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  k = k + res_incr(Z_AXIS)
+ 100           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+* concatenate in T - dont restart count of index L
+      
+      DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+               k = res_lo_ss(Z_AXIS)
+               DO 110 k2 = arg_lo_ss(Z_AXIS,ARG2),arg_hi_ss(Z_AXIS,ARG2)
+
+                  IF (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_2(i2,j2,k2,l2)
+                  ENDIF
+
+                  k = k + res_incr(Z_AXIS)
+ 110           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 410  CONTINUE
+
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/tcat_str.F b/external_functions/cat/tcat_str.F
new file mode 100644
index 0000000..dca8a5b
--- /dev/null
+++ b/external_functions/cat/tcat_str.F
@@ -0,0 +1,229 @@
+*
+* tcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract T axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tcat_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* *********************************************************************S*
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the T values of two string variables ',
+     .        'into one list on an abstract T axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+      CALL ef_set_result_type(id, STRING_RETURN)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE tcat_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tcat_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l, slen
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+               k = res_lo_ss(Z_AXIS)
+               DO 100 k1 = arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                       i1,j1,k1,l1, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  k = k + res_incr(Z_AXIS)
+ 100           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+* concatenate in T - dont restart count of index L
+      
+      DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+               k = res_lo_ss(Z_AXIS)
+               DO 110 k2 = arg_lo_ss(Z_AXIS,ARG2),arg_hi_ss(Z_AXIS,ARG2)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                       i2,j2,k2,l2, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  k = k + res_incr(Z_AXIS)
+ 110           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 410  CONTINUE
+
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/treverse.F b/external_functions/cat/treverse.F
new file mode 100644
index 0000000..c02ff70
--- /dev/null
+++ b/external_functions/cat/treverse.F
@@ -0,0 +1,186 @@
+*
+* treverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the T values of the input variables,
+* reversed and on an abstract T axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE treverse_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns values reversed in T direction on an abstract T axis')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE treverse_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      call ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE treverse_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_hi_ss(T_AXIS,ARG1),
+     .                     arg_lo_ss(T_AXIS,ARG1), -1
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/xcat.F b/external_functions/cat/xcat.F
new file mode 100644
index 0000000..0680e22
--- /dev/null
+++ b/external_functions/cat/xcat.F
@@ -0,0 +1,229 @@
+*
+* xcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the X values of the two variables,
+* concatenated into one long list on an abstract x axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE xcat_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the X values of two variables into one ',
+     .        'list on an abstract X axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE xcat_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xcat_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = 1   ! res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+* concatenate in X - dont restart count of index I
+      
+      DO 410 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 310 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 210 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  IF (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_2(i2,j2,k2,l2)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 210        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 310     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 410  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/xcat_str.F b/external_functions/cat/xcat_str.F
new file mode 100644
index 0000000..26f7163
--- /dev/null
+++ b/external_functions/cat/xcat_str.F
@@ -0,0 +1,231 @@
+*
+* xcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract x axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE xcat_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the X values of two string variables ',
+     .        'into one list on an abstract X axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+      
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE xcat_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xcat_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l, slen
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = 1   ! res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                       i1,j1,k1,l1, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+* concatenate in X - dont restart count of index I
+      
+      DO 410 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 310 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 210 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                       i2,j2,k2,l2, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 210        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 310     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 410  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/xreverse.F b/external_functions/cat/xreverse.F
new file mode 100644
index 0000000..5c14294
--- /dev/null
+++ b/external_functions/cat/xreverse.F
@@ -0,0 +1,185 @@
+*
+* xreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the X values of the input variables,
+* reversed and on an abstract x axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE xreverse_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns values reversed in X direction on an abstract X axis')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE xreverse_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xreverse_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_hi_ss(X_AXIS,ARG1), arg_lo_ss(X_AXIS,ARG1), -1
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/ycat.F b/external_functions/cat/ycat.F
new file mode 100644
index 0000000..af3445f
--- /dev/null
+++ b/external_functions/cat/ycat.F
@@ -0,0 +1,232 @@
+*
+* ycat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+*
+* This function returns the Y values of the two variables,
+* concatenated into one long list on an abstract Y axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ycat_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the Y values of two variables into one ',
+     .        'list on an abstract Y axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE ycat_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ycat_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 400 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 400  CONTINUE
+      
+* concatenate in Y - dont restart count of index J
+
+      DO 410 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 210 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  IF (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_2(i2,j2,k2,l2)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 410  CONTINUE
+      
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/ycat_str.F b/external_functions/cat/ycat_str.F
new file mode 100644
index 0000000..9d1c88f
--- /dev/null
+++ b/external_functions/cat/ycat_str.F
@@ -0,0 +1,230 @@
+*
+* ycat_str.F
+*
+* Ansley Manke
+* Nov 2008
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract y axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ycat_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the Y values of two string variables ',
+     .        'into one list on an abstract Y axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+      
+      CALL ef_set_result_type(id, STRING_RETURN)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE ycat_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ycat_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l, slen
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 400 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                       i1,j1,k1,l1, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 400  CONTINUE
+      
+* concatenate in Y - dont restart count of index J
+
+      DO 410 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 210 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                       i2,j2,k2,l2, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 410  CONTINUE
+      
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/yreverse.F b/external_functions/cat/yreverse.F
new file mode 100644
index 0000000..c6861c6
--- /dev/null
+++ b/external_functions/cat/yreverse.F
@@ -0,0 +1,185 @@
+*
+* yreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the Y values of the input variables,
+* reversed and on an abstract Y axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE yreverse_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns values reversed in Y direction on an abstract Y axis')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE yreverse_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      call ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE yreverse_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_hi_ss(Y_AXIS,ARG1), arg_lo_ss(Y_AXIS,ARG1), -1
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/zcat.F b/external_functions/cat/zcat.F
new file mode 100644
index 0000000..bbb90fb
--- /dev/null
+++ b/external_functions/cat/zcat.F
@@ -0,0 +1,231 @@
+*
+* zcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+*
+* This function returns the Z values of the two variables,
+* concatenated into one long list on an abstract Z axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zcat_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the Z values of two variables into one ',
+     .        'list on an abstract Z axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE zcat_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zcat_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 400 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 400  CONTINUE
+      
+* concatenate in Z - dont restart count of index K
+
+      DO 410 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  IF (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_2(i2,j2,k2,l2)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 410  CONTINUE
+      
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/zcat_str.F b/external_functions/cat/zcat_str.F
new file mode 100644
index 0000000..6be7ce7
--- /dev/null
+++ b/external_functions/cat/zcat_str.F
@@ -0,0 +1,229 @@
+*
+* zcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract T axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zcat_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Concatenates the T values of two string variables ',
+     .        'into one list on an abstract T axis')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+      
+      CALL ef_set_result_type(id, STRING_RETURN)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE zcat_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zcat_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l, slen
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 400 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 300 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                       i1,j1,k1,l1, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 200        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 300     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 400  CONTINUE
+      
+* concatenate in Z - dont restart count of index K
+
+      DO 410 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 310 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            j = res_lo_ss(Y_AXIS)
+            DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+               l = res_lo_ss(T_AXIS)
+               DO 110 l2 = arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                       i2,j2,k2,l2, slen,buff)
+                  CALL EF_PUT_STRING (buff, slen, result(1,i,j,k,l))
+
+                  l = l + res_incr(T_AXIS)
+ 110           CONTINUE
+
+               j = j + res_incr(Y_AXIS)
+ 210        CONTINUE
+
+            i = i + res_incr(X_AXIS)
+ 310     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 410  CONTINUE
+      
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cat/zreverse.F b/external_functions/cat/zreverse.F
new file mode 100644
index 0000000..5be0ed6
--- /dev/null
+++ b/external_functions/cat/zreverse.F
@@ -0,0 +1,185 @@
+*
+* zreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the Z values of the input variables,
+* reversed and on an abstract Z axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zreverse_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns values reversed in Z direction on an abstract Z axis')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE zreverse_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1
+
+      call ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zreverse_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1,j1,k1,l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1 = arg_hi_ss(Z_AXIS,ARG1),arg_lo_ss(Z_AXIS,ARG1),-1
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ENDIF
+
+                  l = l + res_incr(T_AXIS)
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/cflib/curv_to_lonlat_from_weights.c b/external_functions/cflib/curv_to_lonlat_from_weights.c
new file mode 100644
index 0000000..308ebe5
--- /dev/null
+++ b/external_functions/cflib/curv_to_lonlat_from_weights.c
@@ -0,0 +1,253 @@
+/**
+ * curv_to_lonlat_from_weights
+ * use regridding from curv_to_lonlat_regrid.c
+ * which regridded variable Lwave. 
+ */
+
+#include "nccf_regrid.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+#include <netcdf.h>
+#include <libcf_src.h>
+
+#include <nccf_coord.h>
+#include <nccf_grid.h>
+#include <nccf_data.h>
+#include <nccf_utility_functions.h>
+#include <nccf_handle_error.h>
+
+/*#include <config.h> */
+
+void
+setDataToFill(int nvertex, double FillValue, double data[]) {
+  int k;
+  for (k = 0; k < nvertex; ++k) {
+    data[k] = FillValue;
+  }
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+readCurvi(const int dims[],  const char *filename, const char *datavar,
+		     int coordIds[], int *gridId, int *dataId){
+  const int ndims = 2;
+  int nvertex = dims[0]*dims[1];
+  const int save = 1;
+  int status;
+  double *clon, *clat;
+  double *data;
+  int *imask;
+
+#define RANK 3
+#define D2D 2
+
+/* Define whole variable start/count should dynamically allocate these; dims[0], dims[1]*/
+static size_t start0[RANK] = {7,0,0};
+static size_t count0[RANK] = {1,336,896};
+
+/* Define 2D variable start/count */
+static size_t start1[D2D] = {0,0};
+static size_t count1[D2D] = {336,896};
+
+    int ncid, varid;
+    int i;
+    size_t start[RANK];
+    size_t count[RANK];
+
+  const char *dimnames[] = {"nj", "ni"};
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+  imask = ( int* )malloc( nvertex * sizeof( int ));
+
+    if((status = nc_open( filename, NC_NOWRITE, &ncid )))
+       ERR;
+
+    if((status = nc_inq_varid(ncid, datavar, &varid)))
+       ERR;
+
+    /* Read the first timestep */
+    memcpy(start,start0,sizeof(start0));
+    memcpy(count,count0,sizeof(count0));
+
+    printf("*** reading 1 timestep\n");
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)data)))
+       ERR;
+
+    /* Read the mask and coordinate variables */
+    memcpy(start,start1,sizeof(start1));
+    memcpy(count,count1,sizeof(count1));
+
+    printf("*** reading mask_rho\n");
+    if((status = nc_inq_varid(ncid, "mask_rho", &varid)))
+       ERR;
+	
+    if((status = nc_get_vara_int(ncid,varid,start,count,(int*)imask)))
+       ERR;
+
+    printf("*** reading lon coords\n");
+    if((status = nc_inq_varid(ncid, "lon_rho", &varid)))
+       ERR;
+	
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clon)))
+       ERR;
+
+    printf("*** reading lat coords\n");
+    if((status = nc_inq_varid(ncid, "lat_rho", &varid)))
+       ERR;
+
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clat)))
+       ERR;
+
+  if ((status = nccf_def_lat_coord(ndims, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(ndims, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "curvi_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "curvi_grid_scrip.nc"))) ERR;
+  /* args 3,4,5 are	standard_name,units,time_dimname,  */
+  if ((status = nccf_def_data(*gridId, datavar, NULL, NULL, NULL, dataId))) ERR;
+  if ((status = nccf_set_grid_validmask(*gridId, imask ))) ERR;
+
+
+  /* Set the data */
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+  free(imask);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+createLonLat(const double xymin[], const double xymax[], 
+	     const int dims[], 
+	     void (*setDataFunct)(int nv, double FillValue, double d[]),
+	     double FillValue, int coordIds[], int *gridId, int *dataId){
+
+  const int ndims = 2;
+  int nvertex = dims[0]*dims[1];
+  const int save = 1;
+  int status;
+  int i, j, k;
+  double *clon, *clat;
+  double *data;
+  double dxs[ndims];
+
+  const char *dimnames[] = {"nj", "ni"};
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+
+  for (i = 0; i < ndims; ++i) {
+    dxs[i] = (xymax[i] - xymin[i]) / (dims[i] - 1);
+  }
+
+  /* Populate coordinates and create lon/lat coordinate objects */
+  for (j = 0; j < dims[0]; ++j) {
+    for (i = 0; i < dims[1]; ++i) {
+      k = i + dims[1]*j;
+      clat[k] = xymin[0] + j*dxs[0];
+      clon[k] = xymin[1] + i*dxs[1];
+    }
+  }  
+
+  if ((status = nccf_def_lat_coord(ndims, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(ndims, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "lonlat_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "lonlat_grid_scrip.nc"))) ERR;
+  if ((status = nccf_def_data(*gridId, "data", NULL, NULL, NULL, dataId))) ERR;
+
+  /* Set the data */
+  setDataFunct(nvertex, FillValue, data);
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+writeData(int gridId, int dataId, const char *filename){
+
+  /* write lonlat data and coordinates to file */
+  int ncid, status;
+  if ((status = nc_create(filename, NC_CLOBBER, &ncid))) ERR;
+  if ((status = nccf_put_grid(gridId, ncid))) ERR;
+  if ((status = nccf_put_data(dataId, ncid))) ERR;
+  if ((status = nc_close(ncid))) ERR;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+int main(){
+
+  int status;
+  const int ndims = 2;
+  int i;
+  
+  int oriDims[] = {336,896}; 
+  int ori_coord_ids[ndims], ori_grid_id, oriDataId;
+
+  int tgtDims[] = {152, 315}; 
+  int tgt_coord_ids[ndims], tgt_grid_id, tgtDataId;
+  double xymin[] = {11., -102.0};
+  double xymax[] = {49., -52.0};
+  double FillValue = 9.96921E+36;
+ 
+  readCurvi(oriDims, "http://geoport.whoi.edu:8081/thredds/dodsC/coawst_2_2/fmrc/coawst_2_2_best.ncd", 
+	  "Lwave", ori_coord_ids, &ori_grid_id, &oriDataId);
+  createLonLat(xymin, xymax, tgtDims, setDataToFill, FillValue,
+	       tgt_coord_ids, &tgt_grid_id, &tgtDataId);
+
+  writeData(ori_grid_id, oriDataId, "curv_to_lonlat_from_weights_ori.nc");
+
+#ifdef HAVE_LAPACK_LIB
+  /* Create regrid object */
+  int regrid_id;
+  /* Retrieve the weights etc from file */
+  const char* put_filename = "curv_to_lonlat_regrid_weights.nc";
+  if(( status = nccf_def_regrid_from_file( put_filename, &regrid_id ))) ERR;
+
+  /* Interpolate */
+  if ((status = nccf_apply_regrid(regrid_id, oriDataId, tgtDataId))) ERR;
+
+  /* Write regrided data*/
+  writeData(tgt_grid_id, tgtDataId, "curv_to_lonlat_from_weights_intrp.nc");
+
+  /* Check */
+  int nvalid, ntargets;
+  if ((status = nccf_inq_regrid_ntargets(regrid_id, &ntargets))) ERR;
+  if ((status = nccf_inq_regrid_nvalid(regrid_id, &nvalid))) ERR;
+  double ratio = (double)(nvalid) / (double)(ntargets);
+  printf("ratio of valid to num target points = %f\n", ratio);
+
+  /* Clean up */
+  if ((status = nccf_free_regrid(regrid_id))) ERR;
+#endif
+
+
+  if ((status = nccf_free_data(oriDataId))) ERR;
+  if ((status = nccf_free_data(tgtDataId))) ERR;
+
+  if ((status = nccf_free_grid(ori_grid_id))) ERR;
+  if ((status = nccf_free_grid(tgt_grid_id))) ERR;
+
+  for (i = 0; i < ndims; ++i) {
+    if ((status = nccf_free_coord(ori_coord_ids[i]))) ERR;
+    if ((status = nccf_free_coord(tgt_coord_ids[i]))) ERR;
+  }
+
+  return 0;
+}
diff --git a/external_functions/cflib/curv_to_lonlat_regrid.c b/external_functions/cflib/curv_to_lonlat_regrid.c
new file mode 100644
index 0000000..4cb5077
--- /dev/null
+++ b/external_functions/cflib/curv_to_lonlat_regrid.c
@@ -0,0 +1,270 @@
+/**
+ * curv_to_lonlat_regrid
+ * from tst_tripolar_to_lonlat_regrid from the cflib distribution
+ */
+
+#include "nccf_regrid.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+#include <netcdf.h>
+#include <libcf_src.h>
+
+#include <nccf_coord.h>
+#include <nccf_grid.h>
+#include <nccf_data.h>
+#include <nccf_utility_functions.h>
+#include <nccf_handle_error.h>
+
+/*#include <config.h> */
+
+void
+setDataToFill(int nvertex, double FillValue, double data[]) {
+  int k;
+  for (k = 0; k < nvertex; ++k) {
+    data[k] = FillValue;
+  }
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+readCurvi(const int dims[],  const char *filename, const char *datavar,
+		     int coordIds[], int *gridId, int *dataId){
+  const int ndims = 2;
+  int nvertex = dims[0]*dims[1];
+  const int save = 1;
+  int status;
+  double *clon, *clat;
+  double *data;
+  int *imask;
+
+#define RANK 3
+#define D2D 2
+
+/* Define whole variable start/count should dynamically allocate these; dims[0], dims[1]*/
+static size_t start0[RANK] = {12,0,0};
+static size_t count0[RANK] = {1,336,896};
+
+/* Define 2D variable start/count */
+static size_t start1[D2D] = {0,0};
+static size_t count1[D2D] = {336,896};
+
+  int ncid, varid;
+  int i;
+  size_t start[RANK];
+  size_t count[RANK];
+
+  const char *dimnames[] = {"nj", "ni"};
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+  imask = ( int* )malloc( nvertex * sizeof( int ));
+
+    if((status = nc_open( filename, NC_NOWRITE, &ncid ))) ERR;
+
+    if((status = nc_inq_varid(ncid, datavar, &varid))) ERR;
+
+    /* Read one timestep */
+    memcpy(start,start0,sizeof(start0));
+    memcpy(count,count0,sizeof(count0));
+
+    printf("*** reading 1 timestep\n");
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)data))) ERR;
+
+    /* Read the mask and coordinate variables */
+    memcpy(start,start1,sizeof(start1));
+    memcpy(count,count1,sizeof(count1));
+
+    printf("*** reading mask_rho\n");
+    if((status = nc_inq_varid(ncid, "mask_rho", &varid))) ERR;
+	
+    if((status = nc_get_vara_int(ncid,varid,start,count,(int*)imask))) ERR;
+
+    printf("*** reading lon coords\n");
+    if((status = nc_inq_varid(ncid, "lon_rho", &varid))) ERR;
+	
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clon))) ERR;
+
+    printf("*** reading lat coords\n");
+    if((status = nc_inq_varid(ncid, "lat_rho", &varid))) ERR;
+
+    if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clat))) ERR;
+
+  if ((status = nccf_def_lat_coord(ndims, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(ndims, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "curvi_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "curvi_grid_scrip.nc"))) ERR;
+  /* args 3,4,5 are	standard_name,units,time_dimname,  */
+  if ((status = nccf_def_data(*gridId, datavar, NULL, NULL, NULL, dataId))) ERR;
+  if ((status = nccf_set_grid_validmask(*gridId, imask ))) ERR;
+
+
+  /* Set the data */
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+  free(imask);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+createLonLat(const double xymin[], const double xymax[], 
+	     const int dims[], 
+	     void (*setDataFunct)(int nv, double FillValue, double d[]),
+	     double FillValue, int coordIds[], int *gridId, int *dataId){
+
+  const int ndims = 2;
+  int nvertex = dims[0]*dims[1];
+  const int save = 1;
+  int status;
+  int i, j, k;
+  double *clon, *clat;
+  double *data;
+  double dxs[ndims];
+
+  const char *dimnames[] = {"nj", "ni"};
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+
+  for (i = 0; i < ndims; ++i) {
+    dxs[i] = (xymax[i] - xymin[i]) / (dims[i] - 1);
+  }
+
+  /* Populate coordinates and create lon/lat coordinate objects */
+  for (j = 0; j < dims[0]; ++j) {
+    for (i = 0; i < dims[1]; ++i) {
+      k = i + dims[1]*j;
+      clat[k] = xymin[0] + j*dxs[0];
+      clon[k] = xymin[1] + i*dxs[1];
+    }
+  }  
+
+  if ((status = nccf_def_lat_coord(ndims, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(ndims, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "lonlat_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "lonlat_grid_scrip.nc"))) ERR;
+  if ((status = nccf_def_data(*gridId, "data", NULL, NULL, NULL, dataId))) ERR;
+
+  /* Set the data. the VALUE of the data on this grid will be the fillvalue of
+     the regridded data. The output name of the variable also comes from the call above
+	 so could pass the original variable name to nccf_def_data.*/
+  setDataFunct(nvertex, FillValue, data);
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+writeData(int gridId, int dataId, const char *filename){
+
+  /* write lonlat data and coordinates to file */
+  int ncid, status;
+  if ((status = nc_create(filename, NC_CLOBBER, &ncid))) ERR;
+  if ((status = nccf_put_grid(gridId, ncid))) ERR;
+  if ((status = nccf_put_data(dataId, ncid))) ERR;
+  if ((status = nc_close(ncid))) ERR;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+int main(){
+
+  int status;
+  const int ndims = 2;
+  int i;
+  
+  int oriDims[] = {336,896}; 
+  int ori_coord_ids[ndims], ori_grid_id, oriDataId;
+
+  int tgtDims[] = {152, 315}; 
+  int tgt_coord_ids[ndims], tgt_grid_id, tgtDataId;
+  double xymin[] = {11., -102.0};
+  double xymax[] = {49., -52.0};
+  double FillValue = 9.96921E+36;
+
+  readCurvi(oriDims, "http://geoport.whoi.edu:8081/thredds/dodsC/coawst_2_2/fmrc/coawst_2_2_best.ncd", 
+	  "Lwave", ori_coord_ids, &ori_grid_id, &oriDataId);
+  createLonLat(xymin, xymax, tgtDims, setDataToFill, FillValue,
+	       tgt_coord_ids, &tgt_grid_id, &tgtDataId);
+
+  writeData(ori_grid_id, oriDataId, "curv_to_lonlat_regrid_ori.nc");
+
+#ifdef HAVE_LAPACK_LIB
+  /* Create regrid object */
+  int regrid_id;
+  /* the lon coordinates are not periodic in the sense that 360 is a different
+     coordinate value from 0, so no periodicity here */
+  const int is_periodic[] = {0, 0};
+  const int nitermax = 20;
+  const double tolpos = 1.e-2;
+  if ((status = nccf_def_regrid(ori_grid_id, tgt_grid_id, &regrid_id))) ERR;
+
+  /* Exclude cut in longitude from searchable domain */
+  /*  const int lo[] = {0, oriDims[1]/2 - 1}; */
+  /*  const int hi[] = {oriDims[0]/2, oriDims[1]/2}; */
+  /*  if ((status = nccf_add_regrid_forbidden(regrid_id, lo, hi))) ERR; */
+
+
+    printf("*** computing weights\n");
+  if ((status = nccf_compute_regrid_weights(regrid_id,
+					    nitermax,
+					    tolpos,
+					    is_periodic))) ERR;
+
+  
+  /* Write the weights, indices and inside_domain vars */
+  int ncid;
+  const char* put_filename = "curv_to_lonlat_regrid_weights12.nc";
+
+  if (( status = nc_create( put_filename, NC_CLOBBER, &ncid ))) ERR;
+  if (( status = nccf_put_regrid(regrid_id, ncid)));
+  if (( status = nc_close( ncid ))) ERR; 
+
+  /* Interpolate */
+  if ((status = nccf_apply_regrid(regrid_id, oriDataId, tgtDataId))) ERR;
+
+
+  /* Write regrided data*/
+  writeData(tgt_grid_id, tgtDataId, "curv_to_lonlat_regrid_intrp.nc");
+
+  /* Check */
+  int nvalid, ntargets;
+  if ((status = nccf_inq_regrid_ntargets(regrid_id, &ntargets))) ERR;
+  if ((status = nccf_inq_regrid_nvalid(regrid_id, &nvalid))) ERR;
+  double ratio = (double)(nvalid) / (double)(ntargets);
+  printf("ratio of valid to num target points = %f\n", ratio);
+
+  /* Clean up */
+  if ((status = nccf_free_regrid(regrid_id))) ERR;
+#endif
+
+
+  if ((status = nccf_free_data(oriDataId))) ERR;
+  if ((status = nccf_free_data(tgtDataId))) ERR;
+
+  if ((status = nccf_free_grid(ori_grid_id))) ERR;
+  if ((status = nccf_free_grid(tgt_grid_id))) ERR;
+
+  for (i = 0; i < ndims; ++i) {
+    if ((status = nccf_free_coord(ori_coord_ids[i]))) ERR;
+    if ((status = nccf_free_coord(tgt_coord_ids[i]))) ERR;
+  }
+
+  return 0;
+}
diff --git a/external_functions/cflib/fcn_curv_to_lonlat.c b/external_functions/cflib/fcn_curv_to_lonlat.c
new file mode 100644
index 0000000..d3a5735
--- /dev/null
+++ b/external_functions/cflib/fcn_curv_to_lonlat.c
@@ -0,0 +1,281 @@
+/**
+ * curv_to_lonlat_regrid
+ * from tst_tripolar_to_lonlat_regrid from the cflib distribution
+ */
+
+#include "nccf_regrid.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+#include <netcdf.h>
+#include <libcf_src.h>
+
+#include <nccf_coord.h>
+#include <nccf_grid.h>
+#include <nccf_data.h>
+#include <nccf_utility_functions.h>
+#include <nccf_handle_error.h>
+
+/*#include <config.h> */
+
+void
+setDataToFill(int nvertex, double FillValue, double data[]) {
+  int k;
+  for (k = 0; k < nvertex; ++k) {
+    data[k] = FillValue;
+  }
+}
+
+//////////////////////////////////////////////////////////////////////
+
+
+void 
+readCurvi(const char *filename, const char *datavar, 
+		  const char *xcoords, const char *ycoords, const char *maskvar, 
+		  int coordIds[], int *gridId, int *dataId){
+  const int nhoriz = 2;
+  int nvertex;
+  const int save = 1;
+  int status;
+  double *clon, *clat;
+  double *data;
+  int *imask;
+
+  int ncid, varid;
+  int i;
+  int vtype, ndims, natts, nx, ny;
+  int dimsizes[4];
+  int start[4], count[4];
+  int dims[2];
+  const char *dimnames[] = {"nj", "ni"};
+
+  if((status = nc_open( filename, NC_NOWRITE, &ncid ))) ERR;
+
+
+  if((status = nc_inq_varid(ncid, datavar, &varid))) ERR;
+
+/* we don't need varname, can send 0 instead.*/
+
+  if((status = nc_inq_var (ncid, varid, 0, &vtype, &ndims, dimsizes, &natts))) ERR;
+
+/* Last 2 dims are y and x */
+  nx = dimsizes[ndims-1];
+  ny = dimsizes[ndims-2];
+  nvertex = nx*ny;
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+  imask = ( int* )malloc( nvertex * sizeof( int ));
+
+  for (i = 0; i < 4; ++i) {
+    start[i] = 0;
+    count[i] = 1;
+    }
+  count[ndims-1] = nx;
+  count[ndims-2] = ny;
+
+  start[1] = 7; /* time step to read */
+
+ printf("*** reading 1 timestep\n");
+ if((status = nc_get_vara_double(ncid,varid,start,count,(double*)data))) ERR;
+
+    /* Read the mask and coordinate variables */
+  for (i = 0; i < 2; ++i) {
+    start[i] = 0;
+    }
+  count[1] = nx;
+  count[0] = ny;
+
+  printf("*** reading mask_rho\n");
+  if((status = nc_inq_varid(ncid, "maskvar", &varid))) ERR;
+	
+  if((status = nc_get_vara_int(ncid,varid,start,count,(int*)imask))) ERR;
+
+  printf("*** reading lon coords\n");
+  if((status = nc_inq_varid(ncid, "xcoords", &varid))) ERR;
+	
+  if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clon))) ERR;
+
+  printf("*** reading lat coords\n");
+  if((status = nc_inq_varid(ncid, "ycoords", &varid))) ERR;
+
+  if((status = nc_get_vara_double(ncid,varid,start,count,(double*)clat))) ERR;
+
+  if ((status = nccf_def_lat_coord(nhoriz, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(nhoriz, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "curvi_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "curvi_grid_scrip.nc"))) ERR;
+
+  /* args 3,4,5 are	standard_name,units,time_dimname,  */
+  if ((status = nccf_def_data(*gridId, datavar, NULL, NULL, NULL, dataId))) ERR;
+  if ((status = nccf_set_grid_validmask(*gridId, imask ))) ERR;
+
+
+  /* Set the data */
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+  free(imask);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+createLonLat(const double xymin[], const double xymax[], 
+	     const int dims[], 
+	     void (*setDataFunct)(int nv, double FillValue, double d[]),
+	     double FillValue, int coordIds[], int *gridId, int *dataId){
+
+  const int nhoriz = 2;
+  int nvertex = dims[0]*dims[1];
+  const int save = 1;
+  int status;
+  int i, j, k;
+  double *clon, *clat;
+  double *data;
+  double dxs[nhoriz];
+
+  const char *dimnames[] = {"nj", "ni"};
+
+  clat = ( double* )malloc( nvertex * sizeof( double ));
+  clon = ( double* )malloc( nvertex * sizeof( double ));
+  data = ( double* )malloc( nvertex * sizeof( double ));
+
+  for (i = 0; i < nhoriz; ++i) {
+    dxs[i] = (xymax[i] - xymin[i]) / (dims[i] - 1);
+  }
+
+  /* Populate coordinates and create lon/lat coordinate objects */
+  for (j = 0; j < dims[0]; ++j) {
+    for (i = 0; i < dims[1]; ++i) {
+      k = i + dims[1]*j;
+      clat[k] = xymin[0] + j*dxs[0];
+      clon[k] = xymin[1] + i*dxs[1];
+    }
+  }  
+
+  if ((status = nccf_def_lat_coord(nhoriz, dims, dimnames, clat, save, &coordIds[0]))) ERR;
+  if ((status = nccf_def_lon_coord(nhoriz, dims, dimnames, clon, save, &coordIds[1]))) ERR;
+  if ((status = nccf_def_grid(coordIds, "lonlat_grid", gridId))) ERR;
+  if ((status = nccf_save_grid_scrip(*gridId, "lonlat_grid_scrip.nc"))) ERR;
+  if ((status = nccf_def_data(*gridId, "data", NULL, NULL, NULL, dataId))) ERR;
+
+  /* Set the data. the VALUE of the data on this grid will be the fillvalue of
+     the regridded data. The output name of the variable also comes from the call above
+	 so could pass the original variable name to nccf_def_data.*/
+  setDataFunct(nvertex, FillValue, data);
+  if ((status = nccf_set_data_double(*dataId, data, save, 
+					    NC_FILL_DOUBLE))) ERR;
+
+  free(clat);
+  free(clon);
+  free(data);
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void 
+writeData(int gridId, int dataId, const char *filename){
+
+  /* write lonlat data and coordinates to file */
+  int ncid, status;
+  if ((status = nc_create(filename, NC_CLOBBER, &ncid))) ERR;
+  if ((status = nccf_put_grid(gridId, ncid))) ERR;
+  if ((status = nccf_put_data(dataId, ncid))) ERR;
+  if ((status = nc_close(ncid))) ERR;
+}
+
+//////////////////////////////////////////////////////////////////////
+/*int fcn_curv_to_lonlat (*curv_url, *curv_var, *curv_xcoords, *curv_ycoords, *curv_mask, klev, ltime, x0,xn,nx, y0,yn,ny)*/
+
+int main()
+	{
+
+  int status;
+  int i;
+  int ndims;
+  const int nhoriz = 2;
+  int ori_coord_ids[nhoriz], ori_grid_id, oriDataId;
+  int tgtDims[nhoriz], tgt_coord_ids[nhoriz], tgt_grid_id, tgtDataId;
+  double xymin[2];
+  double xymax[2];
+  double FillValue = 9.96921E+36;
+
+  readCurvi("http://geoport.whoi.edu:8081/thredds/dodsC/coawst_2_2/fmrc/coawst_2_2_best.ncd", 
+	  "Lwave", "lon_rho", "lat_rho", "mask_rho", ori_coord_ids, &ori_grid_id, &oriDataId);
+
+  createLonLat(xymin, xymax, tgtDims, setDataToFill, FillValue,
+	       tgt_coord_ids, &tgt_grid_id, &tgtDataId);
+
+  writeData(ori_grid_id, oriDataId, "curv_to_lonlat_regrid_ori.nc");
+
+#ifdef HAVE_LAPACK_LIB
+  /* Create regrid object */
+  int regrid_id;
+  /* the lon coordinates are not periodic in the sense that 360 is a different
+     coordinate value from 0, so no periodicity here */
+  const int is_periodic[] = {0, 0};
+  const int nitermax = 20;
+  const double tolpos = 1.e-2;
+  if ((status = nccf_def_regrid(ori_grid_id, tgt_grid_id, &regrid_id))) ERR;
+
+  /* Exclude cut in longitude from searchable domain */
+  /*  const int lo[] = {0, oriDims[1]/2 - 1}; */
+  /*  const int hi[] = {oriDims[0]/2, oriDims[1]/2}; */
+  /*  if ((status = nccf_add_regrid_forbidden(regrid_id, lo, hi))) ERR; */
+
+
+    printf("*** computing weights\n");
+  if ((status = nccf_compute_regrid_weights(regrid_id,
+					    nitermax,
+					    tolpos,
+					    is_periodic))) ERR;
+
+  
+  /* Write the weights, indices and inside_domain vars */
+  int ncid;
+  const char* put_filename = "curv_to_lonlat_regrid_weights12.nc";
+
+  if (( status = nc_create( put_filename, NC_CLOBBER, &ncid ))) ERR;
+  if (( status = nccf_put_regrid(regrid_id, ncid)));
+  if (( status = nc_close( ncid ))) ERR; 
+
+  /* Interpolate */
+  if ((status = nccf_apply_regrid(regrid_id, oriDataId, tgtDataId))) ERR;
+
+
+  /* Write regrided data*/
+  writeData(tgt_grid_id, tgtDataId, "curv_to_lonlat_regrid_intrp.nc");
+
+  /* Check */
+  int nvalid, ntargets;
+  if ((status = nccf_inq_regrid_ntargets(regrid_id, &ntargets))) ERR;
+  if ((status = nccf_inq_regrid_nvalid(regrid_id, &nvalid))) ERR;
+  double ratio = (double)(nvalid) / (double)(ntargets);
+  printf("ratio of valid to num target points = %f\n", ratio);
+
+  /* Clean up */
+  if ((status = nccf_free_regrid(regrid_id))) ERR;
+#endif
+
+
+  if ((status = nccf_free_data(oriDataId))) ERR;
+  if ((status = nccf_free_data(tgtDataId))) ERR;
+
+  if ((status = nccf_free_grid(ori_grid_id))) ERR;
+  if ((status = nccf_free_grid(tgt_grid_id))) ERR;
+
+  for (i = 0; i < nhoriz; ++i) {
+    if ((status = nccf_free_coord(ori_coord_ids[i]))) ERR;
+    if ((status = nccf_free_coord(tgt_coord_ids[i]))) ERR;
+  }
+
+  return 0;
+}
diff --git a/external_functions/closest_in_list/Makefile b/external_functions/closest_in_list/Makefile
new file mode 100644
index 0000000..b365de1
--- /dev/null
+++ b/external_functions/closest_in_list/Makefile
@@ -0,0 +1,48 @@
+#
+# Makefile for Ferret External Functions
+#
+# *sh* 2/26/00
+#
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	closest_in_zlist.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/closest_in_list/closest_in_zlist.F b/external_functions/closest_in_list/closest_in_zlist.F
new file mode 100644
index 0000000..1a004cd
--- /dev/null
+++ b/external_functions/closest_in_list/closest_in_zlist.F
@@ -0,0 +1,260 @@
+* 
+*  closest_in_zlist.F
+* 
+*  Steve Hankin
+*  12/27/2000
+* 
+*  Compress argument 1 along axis I by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE closest_in_zlist_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .          'Find the value in zlist that is closest to target' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'target')
+      CALL ef_set_arg_desc(id, arg,
+     .          'value(s) to look for - Z-increasing sorted')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'zlist')
+      CALL ef_set_arg_desc(id, arg,
+     .          'set of candidate values - Z-increasing sorted')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE closest_in_zlist_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE closest_in_zlist_compute(id, target, zlist, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL target(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL zlist(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2, k2lo
+      REAL dlo, dhi
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* pre-check that the zlist array has no missing values
+      DO 10 l = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+      DO 10 k = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+      DO 10 j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 10 i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+        IF (zlist(i,j,k,l) .EQ. bad_flag(2)) CALL
+     .             EF_BAIL_OUT(id, 'Missing value found in zlist')
+ 10   CONTINUE
+
+* pre-check that the zlist array is z-sorted
+      DO 25 l = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+      DO 25 j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 25 i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+        IF (arg_hi_ss(Z_AXIS,ARG2) .GT.  arg_lo_ss(Z_AXIS,ARG2)) THEN
+          DO 20 k = arg_lo_ss(Z_AXIS,ARG2)+1, arg_hi_ss(Z_AXIS,ARG2)
+            IF (zlist(i,j,k,l) .LT.zlist(i,j,k-1,l) ) CALL
+     .             EF_BAIL_OUT(id, 'Unsorted values in zlist')
+ 20       CONTINUE
+        ENDIF
+ 25   CONTINUE
+
+* pre-check that the target array is z-sorted
+      DO 35 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 35 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 35 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+        IF (arg_hi_ss(Z_AXIS,ARG1) .GT.  arg_lo_ss(Z_AXIS,ARG1)) THEN
+          DO 32 k = arg_lo_ss(Z_AXIS,ARG1)+1, arg_hi_ss(Z_AXIS,ARG1)
+            IF (target(i,j,k,l) .EQ. bad_flag(1)) THEN
+               DO 30 k2 = k+1, arg_hi_ss(Z_AXIS,ARG1)
+                 IF (target(i,j,k2,l) .NE. bad_flag(1)) CALL EF_BAIL_OUT
+     .                 (id, 'Z-unsorted missing values in target array')
+ 30            CONTINUE
+               GOTO 35
+            ENDIF
+            IF (target(i,j,k,l) .LT.target(i,j,k-1,l) ) CALL
+     .             EF_BAIL_OUT(id, 'Z-unsorted values in target array')
+ 32      CONTINUE
+        ENDIF
+ 35   CONTINUE
+
+* fill in the points as specified by the mask
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+        j1 = arg_lo_ss(Y_AXIS,ARG1)
+        j2 = arg_lo_ss(Y_AXIS,ARG2)
+        DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+          i1 = arg_lo_ss(X_AXIS,ARG1)
+          i2 = arg_lo_ss(X_AXIS,ARG2)
+          DO 200 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            k2lo = arg_lo_ss(Z_AXIS,ARG2)  ! best prospect for zlist < target
+            DO 100 k1=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+              IF (target(i1,j1,k1,l1) .EQ. bad_flag(1)) THEN
+                 result(i,j,k1,l) = bad_flag_result
+                 GOTO 100
+              ENDIF
+* ... find first value in zlist greater than the target
+              DO 50 k2 = k2lo+1, arg_hi_ss(Z_AXIS,ARG2)
+                IF (zlist(i2,j2,k2,l2) .GE. target(i1,j1,k1,l1)) THEN
+                  dlo = target(i1,j1,k1,l1) - zlist(i2,j2,k2lo,l2)
+                  dhi = zlist(i2,j2,k2,l2)  - target(i1,j1,k1,l1)
+                  IF ( ABS(dlo) .LE. ABS(dhi) ) THEN
+                     result(i,j,k1,l) = zlist(i2,j2,k2lo,l2)
+                  ELSE
+                     result(i,j,k1,l) = zlist(i2,j2,k2,l2)
+                  ENDIF
+                  GOTO 100
+                ELSE
+                  k2lo = k2
+                ENDIF
+ 50           CONTINUE
+
+              result(i,j,k1,l) = zlist(i2,j2,k2lo,l2) ! top value in zlist
+ 100        CONTINUE
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 200      CONTINUE
+
+          j1 = j1 + arg_incr(Y_AXIS,ARG1)
+          j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300    CONTINUE
+
+        l1 = l1 + arg_incr(T_AXIS,ARG1)
+        l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/Makefile b/external_functions/cmprsi_by/Makefile
new file mode 100644
index 0000000..7dcd0eb
--- /dev/null
+++ b/external_functions/cmprsi_by/Makefile
@@ -0,0 +1,53 @@
+#
+# Makefile for Ferret External Functions
+#
+# *sh* 12/27/00
+# *sh* 1/02 -- updated to add expndi_by
+# *sh* 2/02 -- updated to add expndi_by_z
+# *acm*2/02 -- cmprsi_by has been replaced by family of compress_by
+#              functions, which are internally linked.
+#
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	expndi_by.so expndi_by_z.so expndi_by_t.so cmprsi_by.so expndi_by_z_counts.so 
+all:	
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/cmprsi_by/cmprsi_by.F b/external_functions/cmprsi_by/cmprsi_by.F
new file mode 100644
index 0000000..d513a89
--- /dev/null
+++ b/external_functions/cmprsi_by/cmprsi_by.F
@@ -0,0 +1,239 @@
+* 
+*  cmprsi_by.F
+* 
+*  Steve Hankin
+*  12/27/2000
+* 
+*  Compress argument 1 along axis I by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE cmprsi_by_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Compress arg1 by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compression (multi-D)')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE cmprsi_by_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_i, lmsk
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_i = arg_hi_ss(X_AXIS,1) - arg_lo_ss(X_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(X_AXIS,2) - arg_lo_ss(X_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi_i ) my_hi_i = lmsk
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi_i)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE cmprsi_by_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER nout, ilo
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      ilo = res_lo_ss(X_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 40 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 30 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 20 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 10 i=ilo, res_hi_ss(X_AXIS)
+ 10            result(i,j,k,l) = bad_flag_result
+ 20         CONTINUE
+ 30      CONTINUE
+ 40   CONTINUE
+
+* fill in the points as specified by the mask
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               nout = 0
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               i2 = arg_lo_ss(X_AXIS,ARG2)
+               DO 100 i=ilo, res_hi_ss(X_AXIS)
+
+                  IF ( arg_2(i2,j2,k2,l2) .NE. bad_flag(2) ) THEN
+                     IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1)  ) THEN
+                        result(ilo+nout,j,k,l) = bad_flag_result
+                     ELSE
+                        result(ilo+nout,j,k,l) = arg_1(i1,j1,k1,l1) 
+                     END IF
+                     nout = nout + 1
+                  ENDIF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/expndi_by.F b/external_functions/cmprsi_by/expndi_by.F
new file mode 100644
index 0000000..3f82ed7
--- /dev/null
+++ b/external_functions/cmprsi_by/expndi_by.F
@@ -0,0 +1,242 @@
+* 
+*  expndi_by.F
+* 
+*  Steve Hankin
+*  1/16/2001
+* 
+*  Expand argument 1 by inserting a gap before each valid point in 
+* argument 2 along axis I
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .       'Expand arg1 by inserting gaps before valid pts of arg 2' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to gap-expand on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding gap insertions (multi-D)')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'outsize')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_one_val(id, ARG3, size)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER imax
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imax = res_hi_ss(X_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 40 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 30 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 20 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10            result(i,j,k,l) = bad_flag_result
+ 20         CONTINUE
+ 30      CONTINUE
+ 40   CONTINUE
+
+* fill in the points as specified by the mask
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               i2 = res_lo_ss(X_AXIS)
+               DO 100 i=arg_lo_ss(X_AXIS,ARG2),arg_hi_ss(X_AXIS,ARG2)
+
+                  IF ( arg_2(i,j2,k2,l2) .NE. bad_flag(2) ) THEN
+                     IF (i2 .GT. imax) CALL EF_BAIL_OUT(id,
+     .                  'Arg 3 size too small')
+                     result(i2,j,k,l) = bad_flag_result  ! insert a gap
+                     i2 = i2 + 1
+                  ENDIF
+                  IF (i2 .GT. imax) CALL EF_BAIL_OUT(id,
+     .                'Arg 3 size too small')
+                  result(i2,j,k,l) = arg_1(i1,j1,k1,l1) 
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + 1
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/expndi_by_t.F b/external_functions/cmprsi_by/expndi_by_t.F
new file mode 100644
index 0000000..f734ac4
--- /dev/null
+++ b/external_functions/cmprsi_by/expndi_by_t.F
@@ -0,0 +1,272 @@
+* 
+*  expndi_by_t.F
+* 
+*  Steve Hankin
+*  2/22/2001
+* 
+*  Expand argument 1 by createing a 2D XT structure from it with the 
+* separation between T columns given by the location of non-missing values in
+* argument 2. Thus the T columns created are "ragged"
+* Typical use is that arg 1 is a collection of vertical casts appended end-
+* to-end and that arg 2 flags the start of each cast
+
+*  Args 3 and 4 are constants -- the size of the X and T axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_t_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XT grid. (Typ. to split T-profiles)' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'each valid point starts a new T column')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'n_profiles')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_t_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+* output X axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+
+* output T axis size
+      CALL ef_get_one_val(id, ARG4, size)
+      CALL ef_set_axis_limits(id, T_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_t_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                               result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy,
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER imax, lmax, iout, lout
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* make sure inputs are conformable
+      IF ( (arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2))
+     . .OR.(arg_hi_ss(X_AXIS,ARG1) .NE. arg_hi_ss(X_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'X limits of args 1 and 2 mismatched')
+      IF ( (arg_lo_ss(T_AXIS,ARG1) .NE. arg_hi_ss(T_AXIS,ARG1))
+     . .OR.(arg_lo_ss(T_AXIS,ARG2) .NE. arg_hi_ss(T_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'T size of args 1 and 2 must be 1')
+
+* limits on output arrays
+        imax = res_hi_ss(X_AXIS)
+        lmax = res_hi_ss(T_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 40 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 30 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 20 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10            result(i,j,k,l) = bad_flag_result
+ 20         CONTINUE
+ 30      CONTINUE
+ 40   CONTINUE
+
+* fill in the points as specified by the mask
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      DO 400 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            iout = res_lo_ss(X_AXIS)
+            lout = res_lo_ss(T_AXIS)
+            IF ( arg_2(arg_lo_ss(X_AXIS,ARG2),j2,k2,l2)
+     .     .NE. bad_flag(2) ) THEN
+              iout = iout - 1  ! will immediately increment
+            ELSE
+              lout = lout - 1  ! will immediately increment
+            ENDIF
+            DO 200 i=arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)
+
+               IF ( arg_2(i,j2,k2,l2) .EQ. bad_flag(2) ) THEN
+*    ... add another element to this T column
+                  IF (lout .GE. lmax) CALL EF_BAIL_OUT(id,
+     .               'Arg 4 size too small')
+                  lout = lout + 1
+               ELSE
+*    ... start a new T column
+                  IF (iout .GE. imax) CALL EF_BAIL_OUT(id,
+     .               'Arg 3 size too small')
+                  iout = iout + 1
+                  lout = res_lo_ss(T_AXIS)
+               ENDIF
+               result(iout,j,k,lout) = arg_1(i,j1,k1,l1)
+
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/expndi_by_z.F b/external_functions/cmprsi_by/expndi_by_z.F
new file mode 100644
index 0000000..987a410
--- /dev/null
+++ b/external_functions/cmprsi_by/expndi_by_z.F
@@ -0,0 +1,272 @@
+* 
+*  expndi_by_z.F
+* 
+*  Steve Hankin
+*  2/22/2001
+* 
+*  Expand argument 1 by createing a 2D XZ structure from it with the 
+* separation between Z columns given by the location of non-missing values in
+* argument 2. Thus the Z columns created are "ragged"
+* Typical use is that arg 1 is a collection of vertical casts appended end-
+* to-end and that arg 2 flags the start of each cast
+
+*  Args 3 and 4 are constants -- the size of the X and Z axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_z_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XZ grid. (Typ. to split Z-profiles)' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'each valid point starts a new Z column')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'n_profiles')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_z_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+* output X axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+
+* output Z axis size
+      CALL ef_get_one_val(id, ARG4, size)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_z_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                               result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy,
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER imax,kmax, iout, kout
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* make sure inputs are conformable
+      IF ( (arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2))
+     . .OR.(arg_hi_ss(X_AXIS,ARG1) .NE. arg_hi_ss(X_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'X limits of args 1 and 2 mismatched')
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1))
+     . .OR.(arg_lo_ss(Z_AXIS,ARG2) .NE. arg_hi_ss(Z_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of args 1 and 2 must be 1')
+
+* limits on output arrays
+        imax = res_hi_ss(X_AXIS)
+        kmax = res_hi_ss(Z_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 40 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 30 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 20 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10            result(i,j,k,l) = bad_flag_result
+ 20         CONTINUE
+ 30      CONTINUE
+ 40   CONTINUE
+
+* fill in the points as specified by the mask
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            iout = res_lo_ss(X_AXIS)
+            kout = res_lo_ss(Z_AXIS)
+            IF ( arg_2(arg_lo_ss(X_AXIS,ARG2),j2,k2,l2)
+     .     .NE. bad_flag(2) ) THEN
+              iout = iout - 1  ! will immediately increment
+            ELSE
+              kout = kout - 1  ! will immediately increment
+            ENDIF
+            DO 200 i=arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)
+
+               IF ( arg_2(i,j2,k2,l2) .EQ. bad_flag(2) ) THEN
+*    ... add another element to this Z column
+                  IF (kout .GE. kmax) CALL EF_BAIL_OUT(id,
+     .               'Arg 4 size too small')
+                  kout = kout + 1
+               ELSE
+*    ... start a new Z column
+                  IF (iout .GE. imax) CALL EF_BAIL_OUT(id,
+     .               'Arg 3 size too small')
+                  iout = iout + 1
+                  kout = res_lo_ss(Z_AXIS)
+               ENDIF
+               result(iout,j,kout,l) = arg_1(i,j1,k1,l1)
+
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/expndi_by_z_counts.F b/external_functions/cmprsi_by/expndi_by_z_counts.F
new file mode 100644
index 0000000..897520c
--- /dev/null
+++ b/external_functions/cmprsi_by/expndi_by_z_counts.F
@@ -0,0 +1,273 @@
+* 
+*  expndi_by_z_counts.F
+* 
+*  Ansley Manke (from expndi_by_z)
+*  8/24/2011
+* 
+* Expand argument 1 by creating a 2D XZ structure from it with the 
+* separation between Z columns given by the lengths specified in 
+* argument 2. Argument 2 is a list of length N, where N is the number of 
+* Z columns to create, and each item in the list is the length of that 
+* column (the length of the cruise or profile). Thus the Z columns created 
+* are "ragged" Typical use is that arg 1 is a collection of vertical casts 
+* appended end-to-end and that arg 2 is the number of values in each cast.
+* The sum of the values in arg 2 is the length of argument 1. 
+
+*  Args 3 and 4 are constants -- the size of the X and Z axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_z_counts_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XZ grid. (Typ. to split Z-profiles)' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'counts')
+      CALL ef_set_arg_desc(id, arg,
+     .          'count of values in each profile')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_z_counts_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+      integer nx, arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+* output X axis size
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      arg = 2
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+* output Z axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_z_counts_compute(id, arg_1, arg_2, arg_3, 
+     .                               result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER imax,kmax, iout, kout, isum, kend
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* limits on output arrays
+        imax = res_hi_ss(X_AXIS)
+        kmax = res_hi_ss(Z_AXIS)
+
+* make sure input 2 is a list of length nprofile
+      IF (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 .NE. imax)
+     .       CALL EF_BAIL_OUT(id, 'Arg 2 must be of length given in arg3')
+
+* args 1 and 2 must not depend on z
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1))
+     . .OR.(arg_lo_ss(Z_AXIS,ARG2) .NE. arg_hi_ss(Z_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of args 1 and 2 must be 1')
+
+* sum of counts in arg 2 must be length of x-dimension of arg1
+
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      L2 = arg_lo_ss(T_AXIS,ARG2)
+      do 20 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      do 20 L2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+         isum = 0
+         DO 10 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            IF  (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2) .OR. 
+     .           INT(arg_2(i2,j2,k2,l2)) .LT. 0)
+     .          CALL EF_BAIL_OUT(id, 'elements of arg 2 are counts GE zero')
+            isum = isum + INT(arg_2(i2,j2,k2,l2))
+ 10   CONTINUE
+         IF (isum .NE. (arg_hi_ss(X_AXIS,ARG1)-arg_lo_ss(X_AXIS,ARG1)+1) )
+     .       CALL EF_BAIL_OUT(id, 
+     .         'arg 2 values must sum to x-dimension length of of arg1 ')
+ 20   CONTINUE
+
+* pre-fill the entire output result with missing value flags
+*  (since length of each profile may have different number of pts)
+      DO 60 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 50 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 40 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 30 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 30            result(i,j,k,l) = bad_flag_result
+ 40         CONTINUE
+ 50      CONTINUE
+ 60   CONTINUE
+
+* fill in the points as specified by the counts
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+	    i1 = 1
+            DO 200 iout=arg_lo_ss(X_AXIS,ARG2),arg_hi_ss(X_AXIS,ARG2)
+	       kend = INT(arg_2(iout,j2,k2,l2))
+               DO 100 kout = 1, kend
+                  result(iout,j,kout,l) = arg_1(i1,j1,k1,l1)
+                  i1 = i1 + 1
+ 100           CONTINUE
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/cmprsi_by/expndi_id_by_z_counts.F b/external_functions/cmprsi_by/expndi_id_by_z_counts.F
new file mode 100644
index 0000000..f58291d
--- /dev/null
+++ b/external_functions/cmprsi_by/expndi_id_by_z_counts.F
@@ -0,0 +1,246 @@
+* 
+*  expndi_id_by_z_counts.F
+* 
+*  Ansley Manke (from expndi_by_z)
+*  8/24/2011
+* 
+* Create a variable with profile ID, where argument 1 is the length
+* of the variable to be put into an XZ structure from it with the 
+* separation between Z columns given by the lengths specified in 
+* argument 2. Argument 2 is a list of length N, where N is the number of 
+* Z columns to create, and each item in the list is the length of that 
+* column (the length of the cruise or profile). Thus the Z columns created 
+* are "ragged" Typical use is that arg 1 is a collection of vertical casts 
+* appended end-to-end and that arg 2 is the number of values in each cast.
+* The sum of the values in arg 2 is the length of argument 1. 
+
+*  Args 3 and 4 are constants -- the size of the X and Z axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_id_by_z_counts_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Create 2D list, ID by profile-length on an XZ grid. (Typ. to split Z-profiles)' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'counts')
+      CALL ef_set_arg_desc(id, arg,
+     .          'count of values in each profile')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'max profile len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_id_by_z_counts_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+      integer arg, nx, nz
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+* output X axis size
+* output Z axis size
+
+* Length of x
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+* Length of z 
+      CALL ef_get_one_val(id, ARG2, size)
+      nz = INT(size)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, nz)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_id_by_z_counts_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER iout, kout, isum, kend, xlen, zlen
+      REAL size
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Length of x*z 
+
+      xlen = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      zlen = res_hi_ss(Z_AXIS) - res_lo_ss(Z_AXIS) + 1
+
+* arg 1 must not depend on z
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of arg 1 must be 1')
+
+* pre-fill the entire output result with missing value flags
+*  (since length of each profile may have different number of pts)
+      DO 60 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 50 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 40 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 30 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 30            result(i,j,k,l) = bad_flag_result
+ 40         CONTINUE
+ 50      CONTINUE
+ 60   CONTINUE
+
+* fill in the points as specified by the counts
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+	    i1 = 1
+            DO 200 iout = 1, xlen
+	       kend = INT(arg_2(iout,j2,k2,l2))
+               DO 100 kout = 1, kend
+                  result(iout,j,kout,l) = iout
+                  i1 = i1 + 1
+ 100           CONTINUE
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/contributed/Makefile b/external_functions/contributed/Makefile
new file mode 100644
index 0000000..214f898
--- /dev/null
+++ b/external_functions/contributed/Makefile
@@ -0,0 +1,56 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+# *sh* 2/2000 - removed SAMPLEIJ from target list (replaced by SAMPLEXY)
+#
+# *acm* 1/2001 - incorporate "make debug" as per SH Makefiles
+#  acm  2/2001   debug macros
+#  acm  5/2007   removed fill_xy from target list; now statically-linked.
+
+#
+# include site-specific definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform-specific definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/contributed/chdir.F b/external_functions/contributed/chdir.F
new file mode 100644
index 0000000..eb3481a
--- /dev/null
+++ b/external_functions/contributed/chdir.F
@@ -0,0 +1,158 @@
+* chdir.F
+*
+* Change current working directory.
+* Contributed by Andrew Wittenberg, Princeton University
+* 10/17/01
+* Changes by PMEL, to substitute the Ferret routine TM_LENSTR for
+* the trim function.
+
+      SUBROUTINE chdir_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id,'Change current working directory.' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name(id, arg, 'TO_DIRECTORY')
+      CALL ef_set_arg_desc(id, arg, 'desired working directory')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE chdir_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER itest, ilen
+      CHARACTER arg1_text*160
+      INTEGER CHDIR, TM_LENSTR1
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_get_arg_string(id, 1, arg1_text)
+      ilen = TM_LENSTR1(arg1_text)
+
+      WRITE(*,*) 'Changing directory to: ',arg1_text(1:ilen)
+      itest = CHDIR(arg1_text(1:ilen))
+
+
+cc original code:
+cc      WRITE(*,*) 'Changing directory to: ',trim(arg1_text)
+cc      itest = CHDIR(trim(arg1_text))
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      INTEGER FUNCTION TM_LENSTR1 (line)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the length of a character string as the position of the last 
+* non-blank character
+* unlike TM_LENSTR this routine will return a length of 1 (vs. 0) if the string
+* is all blanks
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 05/05/87 - based on TM_LENSTR rev. 0.00
+*
+* calling argument declarations:
+	CHARACTER*(*) line
+
+* internal variable declarations:
+	INTEGER	i, mright
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(line)
+
+	DO 100 i = mright,1,-1
+	IF (line(i:i) .NE. ' ') GOTO 200
+ 100	CONTINUE
+
+* for all blanks
+	TM_LENSTR1 = 1
+	RETURN
+
+* found non-blank
+ 200	TM_LENSTR1 = i
+	RETURN
+	END
+
diff --git a/external_functions/contributed/chdir_pmel.F b/external_functions/contributed/chdir_pmel.F
new file mode 100644
index 0000000..7110565
--- /dev/null
+++ b/external_functions/contributed/chdir_pmel.F
@@ -0,0 +1,148 @@
+* chdir_pmel.F
+*
+* Change current working directory.
+* -atw 10/17/01
+
+      SUBROUTINE chdir_pmel_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id,'Change current working directory.' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name(id, arg, 'TO_DIRECTORY')
+      CALL ef_set_arg_desc(id, arg, 'desired working directory')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE chdir_pmel_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER itest, ilen
+      CHARACTER arg1_text*160
+      INTEGER CHDIR, TM_LENSTR1
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_get_arg_string(id, 1, arg1_text)
+      ilen = TM_LENSTR1(arg1_text)
+
+      WRITE(*,*) 'Changing directory to: ',arg1_text(1:ilen)
+      itest = CHDIR(arg1_text(1:ilen))
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      INTEGER FUNCTION TM_LENSTR1 (line)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the length of a character string as the position of the last 
+* non-blank character
+* unlike TM_LENSTR this routine will return a length of 1 (vs. 0) if the string
+* is all blanks
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 05/05/87 - based on TM_LENSTR rev. 0.00
+*
+* calling argument declarations:
+	CHARACTER*(*) line
+
+* internal variable declarations:
+	INTEGER	i, mright
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(line)
+
+	DO 100 i = mright,1,-1
+	IF (line(i:i) .NE. ' ') GOTO 200
+ 100	CONTINUE
+
+* for all blanks
+	TM_LENSTR1 = 1
+	RETURN
+
+* found non-blank
+ 200	TM_LENSTR1 = i
+	RETURN
+	END
diff --git a/external_functions/contributed/fill_xy.F b/external_functions/contributed/fill_xy.F
new file mode 100644
index 0000000..3763435
--- /dev/null
+++ b/external_functions/contributed/fill_xy.F
@@ -0,0 +1,251 @@
+
+* fill_xy.F
+*
+* Martin Schmidt
+* Sept. 2001
+*
+* This function fill missing values by averaging over the neigbourhood
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fill_xy_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'fills missing values with average nearest neighbour values' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'this arg is filled')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     &     'mask (1 -> fill, missing -> do not fill)')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'the maximum number of fill-passes')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO )
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fill_xy_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+      REAL work_old (mem1lox:mem1hix, mem1loy:mem1hiy)
+      REAL work_new (mem1lox:mem1hix, mem1loy:mem1hiy)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER i3, j3, k3, l3
+      integer iavr, is, js, icl, icr, jcl, jcu
+      integer npass, npassmax
+      real    tavr
+      logical ready, not_land
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ready = .false.
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  work_new(i1,j1) = arg_1(i1,j1,k1,l1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               enddo
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            enddo
+            npass = 0
+            i3 = arg_lo_ss(X_AXIS,ARG3)
+            j3 = arg_lo_ss(Y_AXIS,ARG3)
+            npassmax = arg_3(i3,j3,k3,l3)
+            do while (.not.ready)
+               ready = .true.
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                     work_old(i1,j1) =work_new(i1,j1)
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  enddo
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               enddo
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+	       DO 201 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  DO 101 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+		     if (arg_2(i2,j2,k2,l2) .ne. bad_flag(2)
+     &                    .and.work_old(i1,j1).eq.bad_flag(1))then
+                        tavr= 0.
+                        iavr= 0
+                        icl = max0(mem1lox,i1-1)
+                        icr = min0(mem1hix,i1+1)
+                        jcl = max0(mem1loy,j1-1)
+                        jcu = min0(mem1hiy,j1+1)
+                        do is=icl, icr
+                           do js=jcl, jcu
+                              if(work_old(is,js).ne.bad_flag(1)) then
+                                 tavr=tavr+work_old(is,js)
+                                 iavr=iavr+1
+                              endif
+                           enddo
+                        enddo
+! If valid surrounding points have been found, replace the missing value
+! with the average over the neigbouring points
+! Since something has changed, a new pass is required -> ready = .false.
+                        if (iavr.ne.0) then
+                           if (iavr.eq.1) then
+! If the only only found point is at the corner, an ill posed
+! cellular automaton has to be avoided
+                              if (work_old(icl,jcu).eq.bad_flag(1).and.
+     &                            work_old(icr,jcu).eq.bad_flag(1).and.
+     &                            work_old(icr,jcl).eq.bad_flag(1).and.
+     &                            work_old(icl,jcl).eq.bad_flag(1)) then
+                                 work_new(i1,j1)=tavr/iavr
+                                 ready = .false.
+                              endif
+                           else
+                              work_new(i1,j1)=tavr/iavr
+                              ready = .false.
+                           endif
+                        endif
+		     endif
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 101              CONTINUE
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 201           CONTINUE
+               npass = npass + 1
+               if (npass.eq.npassmax) ready = .true.
+            enddo
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 202 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 102 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  result(i,j,k,l) = work_new(i1,j1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 102           CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 202        CONTINUE
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/contributed/neutral.F b/external_functions/contributed/neutral.F
new file mode 100644
index 0000000..8b63d0c
--- /dev/null
+++ b/external_functions/contributed/neutral.F
@@ -0,0 +1,272 @@
+*
+*  neutral.F
+*
+*  John Donners
+*  Jun 19th 2002
+*
+*  Returns neutral density
+*
+* On a SUN Solaris system compile with:
+*
+* f77 -PIC -G -z text -z muldefs neutral.F gamma.a /opt/SUNWspro/lib/libM77.so
+* /opt/SUNWspro/lib/lib{f77compat,fsu}.so -o neutral.so
+*
+* The gamma library (gamma.a) should be compiled with the -KPIC option.
+* Make sure all libraries are 32 bits compiled (without the -xarch=v9 flag)
+* Make sure the file gamma.nc is with the exact path in read-nc.F
+* Changed code in gamma-n.f. Now also complains about out of oceanographic
+* range, but doesn't quit anymore. Instead now returns -99.2, and jumps to
+* the end of the subroutine
+* The gamma library can be found at:
+* ftp://ftp.marine.csiro.au/pub/jackett/gamma.tar.Z
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information
+*  consists of the following:
+*
+*  descr              Text description of the function
+*
+*  num_args           Required number of arguments
+*
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+*
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE neutral_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,' neutral(salinity,temperature) returns'//
+     .  ' neutral density' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'S')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'T')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      CALL ef_set_num_work_arrays(id,3)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+      SUBROUTINE neutral_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mz1, mz2, mz3
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+
+      mz1 = 1 + ABS(arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1))
+      mz2 = 1 + ABS(arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1))
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1))
+
+
+*  lon
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1,
+     .   2*mz1, 1, 1, 1)
+
+*  lat
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1,
+     .   1, 2*mz2, 1, 1)
+
+*  z
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1,
+     .   1, 1, 2*mz3, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+*  In this subroutine we compute the result
+*
+      SUBROUTINE neutral_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+      REAL*8 lon(wrk1lox:wrk1hix/2,wrk1loy:wrk1hiy,wrk1loz:wrk1hiz,
+     .  wrk1lot:wrk1hit)
+      REAL*8 lat(wrk2lox:wrk2hix,wrk2loy:wrk2hiy/2,wrk2loz:wrk2hiz,
+     .  wrk2lot:wrk2hit)
+      REAL*8 depth(wrk3lox:wrk3hix,wrk3loy:wrk3hiy,wrk3loz:wrk3hiz/2,
+     .  wrk3lot:wrk3hit)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER ilon, jlat, kdepth
+      REAL*8 dum1,dum2, res
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), lon)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), lat)
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), depth)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      ilon = 1
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         jlat = 1
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            kdepth = 1
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+
+                  IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) .OR.
+     .                 arg_2(i2,j2,k2,l2) .EQ. bad_flag(2) ) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     call gamma_n(dble(arg_1(i1,j1,k1,l1)),
+     .                 dble(arg_2(i2,j2,k2,l2)),depth(1,1,kdepth,1),1,
+     .                 lon(ilon,1,1,1),lat(1,jlat,1,1),res,dum1,dum2)
+c                     print*,'s,t,p,lon,lat,res=',
+c     .                 dble(arg_1(i1,j1,k1,l1)),
+c     .                 dble(arg_2(i2,j2,k2,l2)),depth(1,1,kdepth,1),
+c     .                 lon(ilon,1,1,1),lat(1,jlat,1,1),res
+                     result(i,j,k,l)=real(res)
+                  END IF
+
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               kdepth = kdepth + 1
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            jlat = jlat + 1
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         ilon = ilon + 1
+ 400  CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/contributed/pco2.F b/external_functions/contributed/pco2.F
new file mode 100644
index 0000000..f914ce6
--- /dev/null
+++ b/external_functions/contributed/pco2.F
@@ -0,0 +1,722 @@
+* 
+*  pco2.F
+* 
+*  Andreas Schmittner (andreas at passagen.uni-kiel.de)
+*  Mai 26th 2004
+* 
+*  Returns pCO2 of water
+* 
+* 
+*
+
+
+      SUBROUTINE pco2_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'returns pCO2 (ppmv=uatm) using OCMIP routines' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'TEMP')
+      CALL ef_set_arg_unit(id, arg, 'deg C')
+      CALL ef_set_arg_desc(id, arg, 'temperature')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'SALT')
+      CALL ef_set_arg_unit(id, arg, 'su')
+      CALL ef_set_arg_desc(id, arg, 'salinity')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DIC')
+      CALL ef_set_arg_unit(id, arg, 'mmol/m^3')
+      CALL ef_set_arg_desc(id, arg, 'dissolved inorganic carbon')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'ALK')
+      CALL ef_set_arg_unit(id, arg, 'mmol/m^3')
+      CALL ef_set_arg_desc(id, arg, 'total alkalinity')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE pco2_compute(id, arg_1, arg_2, arg_3, arg_4, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy,
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER i3, j3, k3, l3
+      INTEGER i4, j4, k4, l4
+      real pt_in,sit_in,atmpres,phlo,phhi,co2ccn, ph, co2star, 
+     .     co2starair, dco2star, pco2surf, dpco2, pco2atm
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      co2ccn=280.
+      pt_in=0.5125e-3           !mol/m^3
+      atmpres=1.0               !atm
+      sit_in=7.6875e-03         !mol/m^3
+      phlo=6.
+      phhi=9.
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         j4 = arg_lo_ss(Y_AXIS,ARG4)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            k3 = arg_lo_ss(Z_AXIS,ARG3)
+            k4 = arg_lo_ss(Z_AXIS,ARG4)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            l4 = arg_lo_ss(T_AXIS,ARG4)
+            DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+
+                  IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) .OR. 
+     .                 arg_2(i2,j2,k2,l2) .EQ. bad_flag(2) .OR.
+     .                 arg_3(i3,j3,k3,l3) .EQ. bad_flag(3) .OR.
+     .                 arg_4(i4,j4,k4,l4) .EQ. bad_flag(4) ) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     call co2calc(arg_1(i1,j1,k1,l1)
+     &                    ,arg_2(i2,j2,k2,l2),arg_3(i3,j3,k3,l3)
+     &                    ,arg_4(i4,j4,k4,l4),pt_in,sit_in
+     &                    ,phlo,phhi,ph,co2ccn,atmpres,co2star
+     &                    ,co2starair,dco2star,pCO2surf,dpco2
+     &                    ,pCO2atm)
+                     result(i,j,k,l) = pCO2surf
+
+                  END IF
+
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+                  l3 = l3 + arg_incr(T_AXIS,ARG3)
+                  l4 = l4 + arg_incr(T_AXIS,ARG4)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               k3 = k3 + arg_incr(Z_AXIS,ARG3)
+               k4 = k4 + arg_incr(Z_AXIS,ARG4)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+c_ ---------------------------------------------------------------------
+c_ RCS lines preceded by "c_ "
+c_ ---------------------------------------------------------------------
+c_
+c_ $Source$ 
+c_ $Revision: 11439 $
+c_ $Date: 2010-11-08 11:39:30 -0800 (Mon, 08 Nov 2010) $   ;  $State$
+c_ $Author: ksmith $ ;  $Locker$
+c_
+c_ ---------------------------------------------------------------------
+c_ $Log$
+c_ Revision 1.1  2004/06/01 17:38:06  ansley
+c_ add pco2 function from Andreas Schmittner
+c_
+c_ Revision 1.8  1999/07/16 11:40:33  orr
+c_ Modifications by Keith Lindsay to fix inconsistency with common block
+c_ "species" (not the same in "ta_iter_1.f").
+c_ Also comment lines changed/added by J. Orr.
+c_
+c_ Revision 1.7  1999/04/26  13:04:54  orr
+c_ Modified USAGE comment, to include new arguments
+c_
+c_ Revision 1.6  1999/04/14 12:55:52  orr
+c_ Changed units for input arguments for tracers:
+c_ formerly in mol/metric ton (T); now in mol/m^3.
+c_ Used 1024.5 kg/m^3 as a constant conversion factor.
+c_ Modelers can now pass tracers on a per volume basis, as carried in models.
+c_
+c_ Revision 1.5  1999/04/06 16:57:37  orr
+c_ Changed calc of dpCO2 to account for diff atm pressure
+c_
+c_ Revision 1.4  1999/04/06 13:17:58  orr
+c_ Added 2 output arguments: pCO2surf and dpCO2
+c_ (see section 4 of Biotic HOWTO)
+c_
+c_ Revision 1.3  1999/04/05 15:59:11  orr
+c_ Cleaned up comments regarding units
+c_
+c_ Revision 1.2  1999/04/04 02:35:00  orr
+c_ Changed units for input and output tracers:
+c_ previously in umol/kg; now in mol/T
+c_ Can also pass input and output in mol/m^3 with little error.
+c_
+c_ Revision 1.1  1999/04/03  21:59:56  orr
+c_ Initial revision
+c_
+c_ ---------------------------------------------------------------------
+c_ 
+      subroutine co2calc(t,s,dic_in,ta_in,pt_in,sit_in
+     &                  ,phlo,phhi,ph,xtco2in,atmpres,co2star
+     &                  ,co2starair,dco2star,pCO2surf,dpCO2
+     &                  ,pCO2atm)
+C
+C-------------------------------------------------------------------------
+C SUBROUTINE CO2CALC
+C
+C PURPOSE
+C       Calculate delta co2* from total alkalinity and total CO2 at
+C temperature (t), salinity (s) and "atmpres" atmosphere total pressure. 
+C
+C USAGE
+C       call co2calc(t,s,dic_in,ta_in,pt_in,sit_in
+C    &                  ,phlo,phhi,ph,xco2_in,atmpres
+C    &                  ,co2star,dco2star,pCO2surf,dpco2)
+C
+C INPUT
+C       dic_in = total inorganic carbon (mol/m^3) 
+C                where 1 T = 1 metric ton = 1000 kg
+C       ta_in  = total alkalinity (eq/m^3) 
+C       pt_in  = inorganic phosphate (mol/m^3) 
+C       sit_in = inorganic silicate (mol/m^3) 
+C       t      = temperature (degrees C)
+C       s      = salinity (PSU)
+C       phlo   = lower limit of pH range
+C       phhi   = upper limit of pH range
+C       xco2_in=atmospheric mole fraction CO2 in dry air (ppmv) 
+C       atmpres= atmospheric pressure in atmospheres (1 atm==1013.25mbar)
+C
+C       Note: arguments dic_in, ta_in, pt_in, sit_in, and xco2_in are 
+C             used to initialize variables dic, ta, pt, sit, and xco2.
+C             * Variables dic, ta, pt, and sit are in the common block 
+C               "species".
+C             * Variable xco2 is a local variable.
+C             * Variables with "_in" suffix have different units 
+C               than those without.
+
+C OUTPUT
+C       co2star  = CO2*water (mol/m^3)
+C       dco2star = delta CO2 (mol/m^3)
+c       pco2surf = oceanic pCO2 (ppmv)
+c       dpco2    = Delta pCO2, i.e, pCO2ocn - pCO2atm (ppmv)
+C
+C IMPORTANT: Some words about units - (JCO, 4/4/1999)
+c     - Models carry tracers in mol/m^3 (on a per volume basis)
+c     - Conversely, this routine, which was written by observationalists 
+c       (C. Sabine and R. Key), passes input arguments in umol/kg  
+c       (i.e., on a per mass basis)
+c     - I have changed things slightly so that input arguments are in mol/m^3,
+c     - Thus, all input concentrations (dic_in, ta_in, pt_in, and st_in) 
+c       should be given in mol/m^3; output arguments "co2star" and "dco2star"  
+c       are likewise in mol/m^3.
+
+C FILES and PROGRAMS NEEDED
+C       drtsafe
+C       ta_iter_1
+C
+C--------------------------------------------------------------------------
+C
+        include "species.h"
+        real invtk,is,is2,xtco2in
+c        real k0,k1,k2,kkw,kb,ks,kf,k1p,k2p,k3p,ksi
+        real drtsafe
+        real t, s, dic_in, ta_in, pt_in, sit_in, phlo, phhi, ph, 
+     .       atmpres, co2star, co2starair, dco2star, pco2surf, dpco2, 
+     .       pco2atm, permil, permeg, xtco2, tk, tk100, tk1002, dlogtk, 
+     .       sqrtis, s2, sqrts, s15, scl, ff, x1, x2, xacc, htotal, 
+     .       htotal2
+
+        external ta_iter_1
+C
+
+c       ---------------------------------------------------------------------
+C       Change units from the input of mol/m^3 -> mol/kg:
+c       (1 mol/m^3)  x (1 m^3/1024.5 kg)
+c       where the ocean's mean surface density is 1024.5 kg/m^3
+c       Note: mol/kg are actually what the body of this routine uses 
+c       for calculations.  
+c       ---------------------------------------------------------------------
+        permil = 1.0 / 1024.5
+c       To convert input in mol/m^3 -> mol/kg 
+        pt=pt_in*permil
+        sit=sit_in*permil
+        ta=ta_in*permil
+        dic=dic_in*permil
+
+c       ---------------------------------------------------------------------
+C       Change units from uatm to atm. That is, atm is what the body of 
+c       this routine uses for calculations.
+c       ---------------------------------------------------------------------
+        permeg=1.e-6
+c       To convert input in uatm -> atm
+        xtco2=xtco2in*permeg
+c       ---------------------------------------------------------------------
+C
+C*************************************************************************
+C Calculate all constants needed to convert between various measured
+C carbon species. References for each equation are noted in the code. 
+C Once calculated, the constants are
+C stored and passed in the common block "const". The original version of this
+C code was based on the code by Dickson in Version 2 of "Handbook of Methods
+C for the Analysis of the Various Parameters of the Carbon Dioxide System
+C in Seawater", DOE, 1994 (SOP No. 3, p25-26). 
+C
+C Derive simple terms used more than once
+C
+        tk = 273.15 + t
+        tk100 = tk/100.0
+        tk1002=tk100*tk100
+        invtk=1.0/tk
+        dlogtk=log(tk)
+        is=19.924*s/(1000.-1.005*s)
+        is2=is*is
+        sqrtis=sqrt(is)
+        s2=s*s
+        sqrts=sqrt(s)
+        s15=s**1.5
+        scl=s/1.80655
+C
+C f = k0(1-pH2O)*correction term for non-ideality
+C
+C Weiss & Price (1980, Mar. Chem., 8, 347-359; Eq 13 with table 6 values)
+C
+        ff = exp(-162.8301 + 218.2968/tk100  +
+     &          90.9241*log(tk100) - 1.47696*tk1002 +
+     &          s * (.025695 - .025225*tk100 + 
+     &          0.0049867*tk1002))
+C
+C K0 from Weiss 1974
+C
+        k0 = exp(93.4517/tk100 - 60.2409 + 23.3585 * log(tk100) +
+     &          s * (.023517 - 0.023656 * tk100 + 0.0047036 * tk1002))
+
+C
+C kk1 = [H][HCO3]/[H2CO3]
+C k2 = [H][CO3]/[HCO3]
+C
+C Millero p.664 (1995) using Mehrbach et al. data on seawater scale 
+C
+        kk1=10**(-1*(3670.7*invtk - 62.008 + 9.7944*dlogtk -
+     &          0.0118 * s + 0.000116*s2))
+C
+        k2=10**(-1*(1394.7*invtk + 4.777 - 
+     &          0.0184*s + 0.000118*s2))
+C
+C kb = [H][BO2]/[HBO2]
+C
+C Millero p.669 (1995) using data from Dickson (1990)
+C
+        kb=exp((-8966.90 - 2890.53*sqrts - 77.942*s +
+     &          1.728*s15 - 0.0996*s2)*invtk +
+     &          (148.0248 + 137.1942*sqrts + 1.62142*s) +
+     &          (-24.4344 - 25.085*sqrts - 0.2474*s) *
+     &          dlogtk + 0.053105*sqrts*tk)
+C
+C k1p = [H][H2PO4]/[H3PO4]
+C
+C DOE(1994) eq 7.2.20 with footnote using data from Millero (1974)
+C
+        k1p = exp(-4576.752*invtk + 115.525 - 18.453 * dlogtk +
+     &          (-106.736*invtk + 0.69171) * sqrts +
+     &          (-0.65643*invtk - 0.01844) * s)
+C
+C k2p = [H][HPO4]/[H2PO4]
+C
+C DOE(1994) eq 7.2.23 with footnote using data from Millero (1974))
+C
+        k2p = exp(-8814.715*invtk + 172.0883 - 27.927 * dlogtk +
+     &          (-160.340*invtk + 1.3566) * sqrts +
+     &          (0.37335*invtk - 0.05778) * s)
+C
+C------------------------------------------------------------------------
+C k3p = [H][PO4]/[HPO4]
+C
+C DOE(1994) eq 7.2.26 with footnote using data from Millero (1974)
+C
+        k3p = exp(-3070.75*invtk - 18.141 + 
+     &          (17.27039*invtk + 2.81197) *
+     &          sqrts + (-44.99486*invtk - 0.09984) * s)
+C
+C------------------------------------------------------------------------
+C ksi = [H][SiO(OH)3]/[Si(OH)4]
+C
+C Millero p.671 (1995) using data from Yao and Millero (1995)
+C
+        ksi = exp(-8904.2*invtk + 117.385 - 19.334 * dlogtk +
+     &          (-458.79*invtk + 3.5913) * sqrtis +
+     &          (188.74*invtk - 1.5998) * is +
+     &          (-12.1652*invtk + 0.07871) * is2 +
+     &          log(1.0-0.001005*s))
+C
+C------------------------------------------------------------------------
+C kkw = [H][OH]
+C
+C Millero p.670 (1995) using composite data
+C
+        kkw = exp(-13847.26*invtk + 148.9652 - 23.6521 * dlogtk +
+     &          (118.67*invtk - 5.977 + 1.0495 * dlogtk) *
+     &          sqrts - 0.01615 * s)
+C
+C------------------------------------------------------------------------
+C ks = [H][SO4]/[HSO4]
+C
+C Dickson (1990, J. chem. Thermodynamics 22, 113)
+C
+        ks=exp(-4276.1*invtk + 141.328 - 23.093*dlogtk +
+     &          (-13856*invtk + 324.57 - 47.986*dlogtk) * sqrtis +
+     &          (35474*invtk - 771.54 + 114.723*dlogtk) * is -
+     &          2698*invtk*is**1.5 + 1776*invtk*is2 +
+     &          log(1.0 - 0.001005*s))
+C
+C------------------------------------------------------------------------
+C kf = [H][F]/[HF]
+C
+C Dickson and Riley (1979) -- change pH scale to total
+C
+        kf=exp(1590.2*invtk - 12.641 + 1.525*sqrtis +
+     &          log(1.0 - 0.001005*s) + 
+     &          log(1.0 + (0.1400/96.062)*(scl)/ks))
+C
+C------------------------------------------------------------------------
+C Calculate concentrations for borate, sulfate, and fluoride
+C
+C Uppstrom (1974)
+        bt = 0.000232 * scl/10.811
+C Morris & Riley (1966)
+        st = 0.14 * scl/96.062
+C Riley (1965)
+        ft = 0.000067 * scl/18.9984
+c        write(*,*) 'co2calc'
+c        write(*,*) k0,kk1,k2,kkw,kb,ks,kf,k1p,k2p,k3p,ksi
+c        write(*,*) ff,htotal
+c        write(*,*) bt,st,ft,sit,pt,ta
+
+C*************************************************************************
+C
+C Calculate [H+] total when DIC and TA are known at T, S and 1 atm.
+C The solution converges to err of xacc. The solution must be within
+C the range x1 to x2.
+C
+C If DIC and TA are known then either a root finding or iterative method
+C must be used to calculate htotal. In this case we use the Newton-Raphson
+C "safe" method taken from "Numerical Recipes" (function "rtsafe.f" with
+C error trapping removed).
+C
+C As currently set, this procedure iterates about 12 times. The x1 and x2
+C values set below will accomodate ANY oceanographic values. If an initial
+C guess of the pH is known, then the number of iterations can be reduced to
+C about 5 by narrowing the gap between x1 and x2. It is recommended that
+C the first few time steps be run with x1 and x2 set as below. After that,
+C set x1 and x2 to the previous value of the pH +/- ~0.5. The current
+C setting of xacc will result in co2star accurate to 3 significant figures
+C (xx.y). Making xacc bigger will result in faster convergence also, but this
+C is not recommended (xacc of 10**-9 drops precision to 2 significant figures).
+C
+C Parentheses added around negative exponents (Keith Lindsay)
+C
+        x1 = 10.0**(-phhi)
+        x2 = 10.0**(-phlo)
+        xacc = 1.e-10
+        htotal=drtsafe(ta_iter_1,x1,x2,xacc)
+
+c        write(*,*) 'htotal', htotal 
+C
+C Calculate [CO2*] as defined in DOE Methods Handbook 1994 Ver.2, 
+C ORNL/CDIAC-74, Dickson and Goyet, eds. (Ch 2 p 10, Eq A.49)
+C
+        htotal2=htotal*htotal
+        co2star = 1.0
+        co2star=dic*htotal2/(htotal2 + kk1*htotal + kk1*k2)
+        co2starair=xtco2*ff*atmpres
+        dco2star=co2starair-co2star
+        ph=-log10(htotal)
+
+c        write(*,*) 'co2calc'
+c        write(*,*) k12,k12p,k123p
+c        write(*,*) k0,kk1,k2,kkw,kb,ks,kf,k1p,k2p,k3p,ksi
+c        write(*,*) 'co2calc',ff,htotal
+c        write(*,*) bt,st,ft,sit,pt,ta
+c        write(*,*) 'CO2CALC' 
+c        write(*,*) 'starair, star', co2starair, co2star
+c        write(*,*) 'dic, dic_in', dic, dic_in
+c        write(*,*) 'dco2star', dco2star
+c        write(*,*) 'ph',ph
+
+c
+c       ---------------------------------------------------------------
+cc      Add two output arguments for storing pCO2surf
+cc      Should we be using K0 or ff for the solubility here?
+c       ---------------------------------------------------------------
+        pCO2surf = co2star / ff
+        dpCO2    = pCO2surf - xtco2*atmpres
+        pCO2atm = (pCO2surf - dpCO2) / permeg
+c        dco2star = dpCO2*ff
+C
+C  Convert units of output arguments
+c      Note: co2star and dco2star are calculated in mol/kg within this routine 
+c      Thus Convert now from mol/kg -> mol/m^3
+       co2star  = co2star / permil
+       dco2star = dco2star / permil
+
+
+c      Note: pCO2surf and dpCO2 are calculated in atm above. 
+c      Thus convert now to uatm
+       pCO2surf = pCO2surf / permeg
+       dpCO2    = dpCO2 / permeg
+c       dco2star = dco2star/ permeg
+C
+        return
+        end
+
+! source file: /home/andreas/models/UVic/2.6/npzd_co2/ctr/updates/ta_iter_1.F
+c_ ---------------------------------------------------------------------
+c_ RCS lines preceded by "c_ "
+c_ ---------------------------------------------------------------------
+c_
+c_ $Source$
+c_ $Revision: 11439 $
+c_ $Date: 2010-11-08 11:39:30 -0800 (Mon, 08 Nov 2010) $   ;  $State$
+c_ $Author: ksmith $ ;  $Locker$
+c_
+c_ ---------------------------------------------------------------------
+c_ $Log$
+c_ Revision 1.1  2004/06/01 17:38:06  ansley
+c_ add pco2 function from Andreas Schmittner
+c_
+c_ Revision 1.2  1999/09/01 17:55:41  orr
+c_ Fixed sign error in dfn/dx following remarks of C. Voelker (10/Aug/1999)
+c_
+c_ Revision 1.1  1999/04/03 22:00:42  orr
+c_ Initial revision
+c_
+c_ ---------------------------------------------------------------------
+c_
+
+        subroutine ta_iter_1(x,fn,df)
+      include "species.h"
+        real k12,k12p,k123p
+        real  x, fn, df, x2, x3, c, a, a2, da, b, b2, db
+c        real k0,k1,k2,kw,kb,ks,kf,k1p,k2p,k3p,ksi
+C
+C This routine expresses TA as a function of DIC, htotal and constants.
+C It also calculates the derivative of this function with respect to
+C htotal. It is used in the iterative solution for htotal. In the call
+C "x" is the input value for htotal, "fn" is the calculated value for TA
+C and "df" is the value for dTA/dhtotal
+C
+c        write(*,*) 'ta_iter_1'
+c        write(*,*) k0,k1,k2,kw,kb,ks,kf,k1p,k2p,k3p,ksi
+c        write(*,*) ff,htotal
+c        write(*,*) bt,st,ft,sit,pt,ta
+c        write(*,*) x
+
+	x2=x*x
+	x3=x2*x
+	k12 = kk1*k2
+	k12p = k1p*k2p
+	k123p = k12p*k3p
+	c = 1.0 + st/ks
+	a = x3 + k1p*x2 + k12p*x + k123p
+	a2=a*a
+	da = 3.0*x2 + 2.0*k1p*x + k12p
+	b = x2 + kk1*x + k12
+	b2=b*b
+	db = 2.0*x + kk1
+
+C
+C	fn = hco3+co3+borate+oh+hpo4+2*po4+silicate+hfree+hso4+hf+h3po4-ta
+C
+	fn = kk1*x*dic/b +
+     &	     2.0*dic*k12/b +
+     &	     bt/(1.0 + x/kb) +
+     &	     kkw/x +
+     &	     pt*k12p*x/a +
+     &	     2.0*pt*k123p/a +
+     &	     sit/(1.0 + x/ksi) -
+     &	     x/c -
+     &	     st/(1.0 + ks/(x*c)) -
+     &	     ft/(1.0 + kf/x) -
+     &	     pt*x3/a -
+     &	     ta
+
+C
+C	df = dfn/dx
+C
+	df = ((kk1*dic*b) - kk1*x*dic*db)/b2 -
+     &	     2.0*dic*k12*db/b2 -
+     &	     bt/kb/(1.0+x/kb)**2. -
+     &	     kkw/x2 +
+     &	     (pt*k12p*(a - x*da))/a2 -
+     &	     2.0*pt*k123p*da/a2 -
+     &	     sit/ksi/(1.0+x/ksi)**2. -
+     &	     1.0/c +
+     &	     st*(1.0 + ks/(x*c))**(-2.0)*(ks/(c*x2)) +
+     &	     ft*(1.0 + kf/x)**(-2.)*kf/x2 -
+     &	     pt*x2*(3.0*a-x*da)/a2
+
+c        write(*,*) k12,k12p,k123p
+c        write(*,*) fn, df
+
+	return
+	end
+
+
+! source file: /home/andreas/models/UVic/2.6/npzd_co2/ctr/updates/drtsafe.F
+c_ ---------------------------------------------------------------------
+c_ RCS lines preceded by "c_ "
+c_ ---------------------------------------------------------------------
+c_
+c_ $Source$
+c_ $Revision: 11439 $
+c_ $Date: 2010-11-08 11:39:30 -0800 (Mon, 08 Nov 2010) $   ;  $State$
+c_ $Author: ksmith $ ;  $Locker$
+c_
+c_ ---------------------------------------------------------------------
+c_ $Log$
+c_ Revision 1.1  2004/06/01 17:38:06  ansley
+c_ add pco2 function from Andreas Schmittner
+c_
+c_ Revision 1.1  1999/04/03 22:00:42  orr
+c_ Initial revision
+c_
+c_ ---------------------------------------------------------------------
+c_
+       REAL FUNCTION DRTSAFE(FUNCD,X1,X2,XACC)
+      include "species.h"
+
+      real funcd, x1, x2, xacc, fl, df, fh, xl, xh, swap, dxold,
+     .     dx, f, temp
+      integer j, maxit
+C
+C	File taken from Numerical Recipes. Modified  R.M.Key 4/94
+C
+      MAXIT=100
+      CALL FUNCD(X1,FL,DF)
+      CALL FUNCD(X2,FH,DF)
+      IF(FL .LT. 0.0) THEN
+        XL=X1
+        XH=X2
+      ELSE
+        XH=X1
+        XL=X2
+        SWAP=FL
+        FL=FH
+        FH=SWAP
+      END IF
+      DRTSAFE=.5*(X1+X2)
+      DXOLD=ABS(X2-X1)
+      DX=DXOLD
+      CALL FUNCD(DRTSAFE,F,DF)
+      DO 100, J=1,MAXIT
+        IF(((DRTSAFE-XH)*DF-F)*((DRTSAFE-XL)*DF-F) .GE. 0.0 .OR.
+     &	      ABS(2.0*F) .GT. ABS(DXOLD*DF)) THEN
+          DXOLD=DX
+          DX=0.5*(XH-XL)
+          DRTSAFE=XL+DX
+          IF(XL .EQ. DRTSAFE)RETURN
+        ELSE
+          DXOLD=DX
+          DX=F/DF
+          TEMP=DRTSAFE
+          DRTSAFE=DRTSAFE-DX
+          IF(TEMP .EQ. DRTSAFE)RETURN
+	END IF
+        IF(ABS(DX) .LT. XACC)RETURN
+        CALL FUNCD(DRTSAFE,F,DF)
+        IF(F .LT. 0.0) THEN
+          XL=DRTSAFE
+          FL=F
+        ELSE
+          XH=DRTSAFE
+          FH=F
+        END IF
+  100  CONTINUE
+      RETURN
+      END
diff --git a/external_functions/contributed/pco2_exampels.jnl b/external_functions/contributed/pco2_exampels.jnl
new file mode 100644
index 0000000..defdd29
--- /dev/null
+++ b/external_functions/contributed/pco2_exampels.jnl
@@ -0,0 +1,16 @@
+! pco2_examples.jnl
+! examples using pco2 function from Andreas Schmittner 
+! ACM 6/1/04
+
+! 1) list the pco2 at T=20 deg C, S=35 su, DIC=2.1617 mmol/m3 and
+!    ALK=2.4588 mmol/m3: 
+
+yes? list pco2(20,35,2.1617,2.4588) 
+         
+! 2) produce contour plot of pco2 as function of ALK and DIC in umol/kg at
+!    T=20 deg C, S=35 similar to Fig. 8.4 in "Najjar, R. G. 1992. Marine Biogeochemistry. 
+!    In: Climate System Modeling, Trenberth, K. (ed.), Cambridge University Press, Cambridge, England, 241-280."
+
+yes? DEFINE AXIS/x=1990:2350:40 xax
+yes? DEFINE AXIS/y=2320:2500:20 yax
+yes? CONTOUR pco2(20,35,x[gx=xax]*1e-6*1024.5,y[gy=yax]*1e-6*1024.5)
diff --git a/external_functions/contributed/species.h b/external_functions/contributed/species.h
new file mode 100644
index 0000000..a46decf
--- /dev/null
+++ b/external_functions/contributed/species.h
@@ -0,0 +1,11 @@
+! source file: /home/andreas/models/UVic/2.6/npzd_co2/ctr/updates/species.h
+c====================== include file "species.h" ==========================
+c
+        integer it_dic
+        real k0,kk1,k2,kkw,kb,ks,kf,k1p,k2p,k3p,ksi
+        real bt,st,ft,sit,pt,dic,ta
+        common /const/k0,kk1,k2,kkw,kb,ks,kf,k1p,k2p,k3p,ksi
+c,ff,htotal
+        common /species/bt,st,ft,sit,pt,dic,ta
+        common /dic/it_dic
+
diff --git a/external_functions/convolve/Makefile b/external_functions/convolve/Makefile
new file mode 100644
index 0000000..684b2c5
--- /dev/null
+++ b/external_functions/convolve/Makefile
@@ -0,0 +1,52 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+# *acm* 1/2001 - add "make debug" target as per SH Makefiles
+#  ACM  2/2001    use debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	convolvei.so convolvej.so convolvek.so convolvel.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/convolve/convolvei.F b/external_functions/convolve/convolvei.F
new file mode 100644
index 0000000..e255038
--- /dev/null
+++ b/external_functions/convolve/convolvei.F
@@ -0,0 +1,256 @@
+*
+* convolvei.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the I axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvei_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve I component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in X (and perhaps Y,Z,T) to convolve')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+	SUBROUTINE convolvei_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible
+* also: when bad data points are encountered in the component data all
+*	result data depending on it are flagged as bad, too
+
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      REAL xlen, ylen, zlen, tlen
+      INTEGER i, j, k, l
+      INTEGER hlen, ii, wlen
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG X AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen.
+
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+
+      wlen = max(xlen, ylen, zlen, tlen)
+      IF  (MOD(wlen,2) .EQ. 0) wlen = wlen + 1
+      hlen = wlen/ 2
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 500 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                  sum = 0.0
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  j2 = arg_lo_ss(Y_AXIS,ARG2)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  l2 = arg_lo_ss(T_AXIS,ARG2)
+
+                  DO 100 ii = -hlen, hlen
+
+                     IF (i1+ii .LT. arg_lo_ss(X_AXIS,ARG1)  .OR.
+     .                   i1+ii .GT. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+                        result(i,j,k,l) = bad_flag_result
+                        GOTO 190
+
+                     ELSE
+                        comp = arg_1(i1+ii,j1,k1,l1)
+                        IF (i2 .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                      i2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      j2 .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                      j2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      k2 .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                      k2 .GT. arg_hi_ss(Z_AXIS,ARG2)  .OR.
+     .                      l2 .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                      l2 .GT. arg_hi_ss(T_AXIS,ARG2)) THEN
+                               weight = 0.
+                        ELSE
+                           weight = arg_2(i2,j2,k2,l2)
+                        ENDIF
+          
+                        IF ( comp .EQ. bad_flag(ARG1)) THEN
+                           GOTO 190
+                        ELSE
+                           sum = sum + comp* weight
+                        ENDIF
+                     ENDIF
+
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+                     j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                     l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+ 100                 CONTINUE
+                     result(i,j,k,l) = sum
+
+ 190                 i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200              CONTINUE
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 300           CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 500  CONTINUE
+
+      RETURN
+      END	
diff --git a/external_functions/convolve/convolvej.F b/external_functions/convolve/convolvej.F
new file mode 100644
index 0000000..9799aff
--- /dev/null
+++ b/external_functions/convolve/convolvej.F
@@ -0,0 +1,255 @@
+*
+* convolvej.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the J axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvej_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve J component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in Y (and perhaps X,Z,T) to convolve')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+	SUBROUTINE convolvej_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the j-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible
+* also: when bad data points are encountered in the component data all
+*	result data depending on it are flagged as bad, too
+
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      INTEGER i, j, k, l
+      INTEGER xlen, ylen, zlen, tlen, jj
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER wlen, hlen
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG Y AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen.
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+
+      wlen = max(xlen, ylen, zlen, tlen)
+      IF  (MOD(wlen,2) .EQ. 0) wlen = wlen + 1
+      hlen = wlen/ 2
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 200 J = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+                  sum = 0.0
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  j2 = arg_lo_ss(Y_AXIS,ARG2)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  l2 = arg_lo_ss(T_AXIS,ARG2)
+
+                  DO 100 jj = -hlen, hlen
+
+                     IF (j1+jj .LT. arg_lo_ss(Y_AXIS,ARG1)  .OR.
+     .                   j1+jj .GT. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+                        result(i,j,k,l) = bad_flag_result
+                        GOTO 190
+
+                     ELSE
+                        comp = arg_1(i1,j1+jj,k1,l1)
+
+                        IF (i2 .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                      i2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      j2 .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                      j2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      k2 .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                      k2 .GT. arg_hi_ss(Z_AXIS,ARG2)  .OR.
+     .                      l2 .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                      l2 .GT. arg_hi_ss(T_AXIS,ARG2)) THEN
+                               weight = 0.
+                        ELSE
+                           weight = arg_2(i2,j2,k2,l2)
+                        ENDIF
+
+                        IF ( comp .EQ. bad_flag(ARG1)) THEN
+                           result(i,j,k,l) = bad_flag_result
+                           GOTO 190
+                        ELSE
+                           sum = sum + comp* weight
+                        ENDIF
+                     ENDIF
+
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+                     j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                     l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+ 100                 CONTINUE
+                     result(i,j,k,l) = sum
+
+ 190                 j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200              CONTINUE
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 300           CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 500  CONTINUE
+
+      RETURN
+      END	
diff --git a/external_functions/convolve/convolvek.F b/external_functions/convolve/convolvek.F
new file mode 100644
index 0000000..8dc3376
--- /dev/null
+++ b/external_functions/convolve/convolvek.F
@@ -0,0 +1,257 @@
+*
+* convolvek.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the K axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvek_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve K component of variable with weight function')
+
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in Z (and perhaps X,Y,T) to convolve')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+	SUBROUTINE convolvek_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the k-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible
+* also: when bad data points are encountered in the component data all
+*	result data depending on it are flagged as bad, too
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      integer i, j, k, l
+      INTEGER xlen, ylen, zlen, tlen, kk
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER wlen, hlen
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG Z AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen.
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+
+      wlen = max(xlen, ylen, zlen, tlen)
+      if (MOD(wlen,2) .EQ. 0) wlen = wlen + 1
+      hlen = wlen/ 2
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+
+                  sum = 0.0
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  j2 = arg_lo_ss(Y_AXIS,ARG2)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  l2 = arg_lo_ss(T_AXIS,ARG2)
+
+                  DO 100 kk = -hlen, hlen
+
+                     IF (k1+kk .LT. arg_lo_ss(Z_AXIS,ARG1)  .OR.
+     .                   k1+kk .GT. arg_hi_ss(Z_AXIS,ARG1) ) THEN
+                        result(i,j,k,l) = bad_flag_result
+                        GOTO 190
+
+                     ELSE
+                        comp = arg_1(i1,j1,k1+kk,l1)
+
+                        IF (i2 .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                      i2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      j2 .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                      j2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      k2 .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                      k2 .GT. arg_hi_ss(Z_AXIS,ARG2)  .OR.
+     .                      l2 .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                      l2 .GT. arg_hi_ss(T_AXIS,ARG2)) THEN
+                               weight = 0.
+                        ELSE
+                           weight = arg_2(i2,j2,k2,l2)
+                        ENDIF
+
+                        IF ( comp .EQ. bad_flag(ARG1)) THEN
+                           result(i,j,k,l) = bad_flag_result
+                           GOTO 190
+                        ELSE
+                           sum = sum + comp* weight
+                        ENDIF
+                     ENDIF
+
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+                     j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                     l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+ 100                 CONTINUE
+                     result(i,j,k,l) = sum
+
+ 190                 k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200              CONTINUE
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 300           CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 500  CONTINUE
+
+      RETURN
+      END	
diff --git a/external_functions/convolve/convolvel.F b/external_functions/convolve/convolvel.F
new file mode 100644
index 0000000..3105841
--- /dev/null
+++ b/external_functions/convolve/convolvel.F
@@ -0,0 +1,254 @@
+*
+* convolvel.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the L axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvel_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve L component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in T (and perhaps X,Y,Z) to convolve')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+	SUBROUTINE convolvel_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible
+* also: when bad data points are encountered in the component data all
+*	result data depending on it are flagged as bad, too
+
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      INTEGER i, j, k, l
+      INTEGER xlen, ylen, zlen, tlen, ll
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER wlen, hlen
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG T AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen.
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+
+      wlen = max(xlen, ylen, zlen, tlen)
+      IF  (MOD(wlen,2) .EQ. 0) wlen = wlen + 1
+      hlen = wlen/ 2
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+       
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+                  sum = 0.0
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  j2 = arg_lo_ss(Y_AXIS,ARG2)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  l2 = arg_lo_ss(T_AXIS,ARG2)
+
+                  DO 100 ll = -hlen, hlen
+
+                     IF (l1+ll .LT. arg_lo_ss(T_AXIS,ARG1)  .OR.
+     .                   l1+ll .GT. arg_hi_ss(T_AXIS,ARG1) ) THEN
+                        result(i,j,k,l) = bad_flag_result
+                        GOTO 190
+
+                     ELSE
+                        comp = arg_1(i1,j1,k1,l1+ll)
+                        IF (i2 .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                      i2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      j2 .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                      j2 .GT. arg_hi_ss(X_AXIS,ARG2)  .OR.
+     .                      k2 .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                      k2 .GT. arg_hi_ss(Z_AXIS,ARG2)  .OR.
+     .                      l2 .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                      l2 .GT. arg_hi_ss(T_AXIS,ARG2)) THEN
+                               weight = 0.
+                        ELSE
+                           weight = arg_2(i2,j2,k2,l2)
+                        ENDIF
+
+                        IF ( comp .EQ. bad_flag(ARG1)) THEN
+                           result(i,j,k,l) = bad_flag_result
+                           GOTO 190
+                        ELSE
+                           sum = sum + comp* weight
+                        ENDIF
+                     ENDIF
+
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+                     j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                     l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+ 100                 CONTINUE
+                     result(i,j,k,l) = sum
+
+ 190                 l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 500  CONTINUE
+
+      RETURN
+      END	
diff --git a/external_functions/date_and_time/Makefile b/external_functions/date_and_time/Makefile
new file mode 100644
index 0000000..23a485c
--- /dev/null
+++ b/external_functions/date_and_time/Makefile
@@ -0,0 +1,61 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+# dec-00 adapted for "date_and_time" function
+# 2/01 *sh* - restored the -C qualifier for debug target
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+DAT_OBJS = date_decode.o time_decode.o secs_to_ymdhms.o
+
+#
+# Rules
+#
+
+.c.so:
+	$(CC) $(CFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	date_decode.o time_decode.o secs_to_ymdhms.o date1900.o date1900.so minutes24.o minutes24.so days1900toymdhms.o days1900toymdhms.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)"  all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/date_and_time/date1900.F b/external_functions/date_and_time/date1900.F
new file mode 100644
index 0000000..3d6cc74
--- /dev/null
+++ b/external_functions/date_and_time/date1900.F
@@ -0,0 +1,211 @@
+*
+* date1900.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Dac, 2000
+
+* This function reads a GODAE (FNMOC) ship observations file (name passed
+* in) and returns the variables in a multi-dimensional array NoxNv where
+* No is the number of obs in the file and Nv is the number of variables
+* read (list of variables as per source code)
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE date1900_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert a date into Julian days since 1-Jan-1900' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id,  NORMAL, NORMAL, 
+     .                                  NORMAL,   NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name (id, arg, 'formatted date')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'dd-MMM-yy or dd-MMM-yyyy  (e.g. "20-Dec-00")')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE date1900_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE date1900_compute (id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+!      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+!      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+!     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*  names, units, characteristics of variables to send to Vis5D utility functions.
+
+        INTEGER slen
+        CHARACTER str_date*12
+        REAL DATE_DECODE, res
+        INTEGER TM_LENSTR1
+
+* NOTE: THIS ROUTINE NEEDS TO BE UPDATES WHEN FERRET SUPPORTS GRIDS OF STRINGS
+        CALL ef_get_arg_string(id, 1, str_date)
+
+* make it a null-terminated string
+        slen = MIN(TM_LENSTR1(str_date)+1,12)
+        str_date(slen:slen) = CHAR(0)
+
+        res = DATE_DECODE(str_date)
+        IF ( res .EQ. -1E34 ) THEN
+          result(memreslox,memresloy,memresloz,memreslot) =
+     .                  bad_flag_result
+        ELSE
+          result(memreslox,memresloy,memresloz,memreslot) =
+     .                  res
+        ENDIF
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/date_and_time/date_decode.c b/external_functions/date_and_time/date_decode.c
new file mode 100644
index 0000000..b296b21
--- /dev/null
+++ b/external_functions/date_and_time/date_decode.c
@@ -0,0 +1,107 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL
+,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+/*
+  Code to perform decoding of formatted dates and times
+ */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+float FORTRAN(days_from_day0) (double* days_1900, int* iyr, int* imon,
+                               int* iday);
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+
+float FORTRAN(date_decode) (char *strdate)
+{
+
+  int id,im,iy, ok;
+  char str3[4],str1[2];
+  char months[13][4] = {"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
+  double days_1900 = 59958230400.0 / (60.*60.*24.);
+
+  if (sscanf(strdate,"%d/%d/%d%1s",&im,&id,&iy,str1) == 3)
+    /* date as mm/dd/yy */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strdate,"%d-%d-%d%1s",&iy,&im,&id,str1) == 3)
+    /* date as yyyy-mm-dd */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strdate,"%d-%3s-%d%1s",&id,str3,&iy,str1) == 3)
+    /* date as dd-MMM-yy or dd-MMM-yyyy*/
+    {
+      /* 2 digit year */
+      if (iy < 30)   /* will break after 2029 or before 1930 */
+	iy += 2000;
+      else if (iy<100)
+	iy += 1900;
+      
+      /* translate month name */
+      ok = 0;
+      for (im=0; im<12; im++)
+	{
+	  if (strcasecmp(str3,months[im])==0)
+	    {
+	      im++;
+	      ok = 1;
+	      break;
+	    }
+	}
+    }
+  else
+    {
+      ok = 0;
+    }    
+
+  if (ok)
+    return  days_from_day0_(&days_1900,&iy,&im,&id);
+  else
+    return -1.e34;
+
+}
+
diff --git a/external_functions/date_and_time/days1900toymdhms.F b/external_functions/date_and_time/days1900toymdhms.F
new file mode 100644
index 0000000..7567409
--- /dev/null
+++ b/external_functions/date_and_time/days1900toymdhms.F
@@ -0,0 +1,241 @@
+*
+* days1900toymdhms.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Jan, 2001
+*
+* 12/12/02 *acm* bug fix: define the REAL*8 parameter  psecsto1900 using a 
+*                double precision constant .D0; the constant lost precision
+*                under linux.
+
+* This function converts a Julian day from 1-jan-1900 to a trio of 3 values
+* on the Z axis: year, month, day
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE days1900toymdhms_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert Julian day to values y,m,d,h,m,s on k=1,...,6' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .                                 ABSTRACT,        IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_name (id, arg, 'day1900')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Julian day counted from 1-jan-1900')
+      CALL ef_set_axis_influence (id, arg, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE days1900toymdhms_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+* 3 output values: year, month, day 
+        CALL EF_SET_AXIS_LIMITS(id, Z_AXIS, 1, 6)
+        
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE days1900toymdhms_compute (id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+        INTEGER i, j, k, l, k1, yr, mon, day, hr, min
+        REAL sec
+        REAL*8 num_secs
+
+        REAL*8  psecsto1900  ! seconds from 1-jan-0000 to 1-jan-1900
+        PARAMETER ( psecsto1900 = 59958230400.D0 )
+
+* get the subscripting limits and flags
+        CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+        CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+        CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure that we were not passes a span along the Z axis
+        IF (arg_lo_ss(Z_AXIS,1) .NE.  arg_hi_ss(Z_AXIS,1)) CALL
+     .          EF_BAIL_OUT(id, 'Cannot handle a Z range on argument') 
+
+* loop over all of the input values
+        k1 = arg_lo_ss(Z_AXIS,1)
+        DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+          DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+
+                 IF ( arg_1(i,j,k1,l) .EQ. bad_flag(1) ) THEN
+
+                    DO 90 k = 1, 6
+ 90                 result(i,j,k,l) = bad_flag_result
+
+                 ELSE
+
+                    num_secs = 24.D0*60.D0*60.D0 * arg_1(i,j,k1,l)
+     .                       + psecsto1900
+                    CALL SECS_TO_YMDHMS( num_secs,
+     .                                   yr, mon, day, hr, min, sec )
+                    result(i,j,1,l) = FLOAT(yr)
+                    result(i,j,2,l) = FLOAT(mon)
+                    result(i,j,3,l) = FLOAT(day)
+                    result(i,j,4,l) = FLOAT(hr)
+                    result(i,j,5,l) = FLOAT(min)
+                    result(i,j,6,l) = sec
+
+                 END IF
+
+
+ 100        CONTINUE
+ 300      CONTINUE
+ 400    CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/date_and_time/minutes24.F b/external_functions/date_and_time/minutes24.F
new file mode 100644
index 0000000..cc275d6
--- /dev/null
+++ b/external_functions/date_and_time/minutes24.F
@@ -0,0 +1,211 @@
+*
+* minutes24.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Dac, 2000
+
+* This function reads a GODAE (FNMOC) ship observations file (name passed
+* in) and returns the variables in a multi-dimensional array NoxNv where
+* No is the number of obs in the file and Nv is the number of variables
+* read (list of variables as per source code)
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE minutes24_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert a formatted time of day into minutes since 00:00' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id,  NORMAL, NORMAL, 
+     .                                  NORMAL,   NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name (id, arg, 'formatted time')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'hh:mm or hh:mm:ss.s  (e.g. "12:24:13")')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE minutes24_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE minutes24_compute (id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+!      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+!      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+!     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*  names, units, characteristics of variables to send to Vis5D utility functions.
+
+        INTEGER slen
+        CHARACTER str_time*12
+        REAL TIME_DECODE, res
+        INTEGER TM_LENSTR1
+
+* NOTE: THIS ROUTINE NEEDS TO BE UPDATES WHEN FERRET SUPPORTS GRIDS OF STRINGS
+        CALL ef_get_arg_string(id, 1, str_time)
+
+* make it a null-terminated string
+        slen = MIN(TM_LENSTR1(str_time)+1,12)
+        str_time(slen:slen) = CHAR(0)
+
+        res = TIME_DECODE(str_time)
+        IF ( res .EQ. -1E34 ) THEN
+          result(memreslox,memresloy,memresloz,memreslot) =
+     .                  bad_flag_result
+        ELSE
+          result(memreslox,memresloy,memresloz,memreslot) =
+     .                  res
+        ENDIF
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/date_and_time/secs_to_ymdhms.F b/external_functions/date_and_time/secs_to_ymdhms.F
new file mode 100644
index 0000000..dc5e1ad
--- /dev/null
+++ b/external_functions/date_and_time/secs_to_ymdhms.F
@@ -0,0 +1,147 @@
+	SUBROUTINE SECS_TO_YMDHMS ( num_secs,
+     .				    yr, mon, day, hr, min, sec )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Will break secs since 01-JAN-0000 00:00:00 into separate yr,mo,day,hr,min,sec
+* fields
+
+* V530 *sh* 1/02 - based upon tm_secs_to_date.F
+
+* Argument declarations
+	INTEGER	yr, mon, day, hr, min
+	REAL	sec
+	REAL*8	num_secs
+	
+*
+* Local Definition
+	INTEGER		month_by_day(365), leapadj, cent_cnt,
+     .			year_cnt, cent4_cnt, year4_cnt, tot_days,
+     .			tmp_days, days_before_month(12)
+	REAL*8		secs_in_minute, secs_in_hour, secs_in_day,
+     .			secs_in_year, secs_in_4years, secs_in_cent,
+     .			secs_in_4cents, total_secs
+
+	PARAMETER	(secs_in_minute	 = 60.,
+     .			 secs_in_hour	 = secs_in_minute*60.,
+     .			 secs_in_day	 = secs_in_hour*24.,
+     .			 secs_in_year	 = secs_in_day*365.,
+     .			 secs_in_4years	 = secs_in_day*(3*365.+366.),
+     .			 secs_in_cent    = secs_in_day*(76*365.+24*366.),
+     .			 secs_in_4cents  = 4*secs_in_cent+secs_in_day)
+
+	DATA month_by_day /31*01, 28*02, 31*03, 30*04, 31*05, 30*06,
+     .			   31*07, 31*08, 30*09, 31*10, 30*11, 31*12/
+	DATA days_before_month	/   0,  31,  59,  90, 120, 151,
+     .				  181, 212, 243, 273, 304, 334/
+
+* trap invalid input
+	IF ( num_secs .LT. 0 ) THEN
+	   yr = 0
+	   mon = 1
+	   day = 1
+	   hr = 0
+	   min = 0
+	   sec = 0.0
+	   RETURN
+	ENDIF
+
+* Initialize
+	total_secs = num_secs
+
+* Subtract year 0 off (it's a leap year)
+	total_secs = total_secs - secs_in_year - secs_in_day
+
+* make sure we aren't working in year 0
+	IF (total_secs .GE. 0) THEN
+
+* Decide which century it is
+	  cent4_cnt = INT(total_secs/secs_in_4cents)
+	  total_secs = total_secs - cent4_cnt*secs_in_4cents
+	  cent_cnt = INT(total_secs/secs_in_cent)
+* Dec 31 on leap century test (years 400,800,1200...)
+	  IF (cent_cnt .EQ. 4                         .AND.
+     .	      total_secs .GE. cent4_cnt-secs_in_day)   cent_cnt = 3
+	  total_secs = total_secs - cent_cnt*secs_in_cent
+	  yr = 400*cent4_cnt + 100*cent_cnt
+
+* Decide what year it is exactly (1 year for year 0)
+	  year4_cnt = INT(total_secs/secs_in_4years)
+	  total_secs = total_secs - year4_cnt*secs_in_4years
+	  year_cnt = INT(total_secs/secs_in_year)
+* Dec 31 on leap year test (years 0,4,8,12...)
+	  IF (year_cnt .EQ. 4                         .AND.
+     .	      total_secs .GE. secs_in_4years-secs_in_day)   year_cnt = 3
+	  total_secs = total_secs - year_cnt*secs_in_year
+	  yr = yr + 4*year4_cnt + year_cnt + 1
+
+	ELSE
+* Year 0 stuff
+	  yr = 0
+	  total_secs = total_secs + secs_in_year + secs_in_day
+	ENDIF
+
+* Is this a leap year? (every 4th century is, otherwise century isn't)
+	leapadj = 0
+	IF (MOD(yr,400) .EQ. 0) THEN
+	  leapadj = 1
+	ELSE IF (MOD(yr,4) .EQ. 0 .AND. MOD(yr,100) .NE. 0) THEN
+	  leapadj = 1
+	ENDIF
+
+* How many days into year is this
+	tot_days = INT(total_secs/secs_in_day)
+	total_secs = total_secs - tot_days*secs_in_day
+
+* Decide what month/day it is
+	tmp_days = tot_days - leapadj*INT(tot_days/366. + 307./366.)
+	IF (tmp_days .LT. 0) STOP 'negative subscript in TM_SECS_TO_DATE'
+	mon = month_by_day(tmp_days+1)
+	leapadj = INT(mon/12. +.75)*leapadj
+	day = tot_days - (days_before_month(mon)+leapadj) + 1
+
+* Calculate number of hours
+	hr = INT(total_secs/secs_in_hour)
+* Subtract seconds for number of hours
+	total_secs = total_secs - secs_in_hour*(hr)
+* Calculate number of minutes
+	min = INT(total_secs/secs_in_minute)
+* Subtract seconds for number of minutes
+	total_secs = total_secs - secs_in_minute*(min)
+* Calculate number of seconds
+	sec = total_secs
+
+* finished
+9990	RETURN
+	END
diff --git a/external_functions/date_and_time/time_decode.c b/external_functions/date_and_time/time_decode.c
new file mode 100644
index 0000000..b2bd6c8
--- /dev/null
+++ b/external_functions/date_and_time/time_decode.c
@@ -0,0 +1,83 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL
+,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+/*
+  Code to perform decoding of formatted dates and times
+ */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+
+float FORTRAN(time_decode) (char *strtime)
+{
+
+  int ih,im, ok;
+  float ss;
+  char str1[2];
+
+  if (sscanf(strtime,"%d:%d:%f%1s",&ih,&im,&ss,str1) == 3)
+    /* time as hh:mm:ss.s */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strtime,"%d:%d%1s",&ih,&im,str1) == 2)
+    /* time as hh:mm */
+    {
+      ss = 0.0;
+      ok = 1;
+    }
+  else
+    {
+      ok = 0;
+    }    
+
+  if (ok)
+    return  im + 60.*ih + ss/60.;
+  else
+    return -1.e34;
+
+}
+
diff --git a/external_functions/date_and_time/xgodae_obs.cmn b/external_functions/date_and_time/xgodae_obs.cmn
new file mode 100644
index 0000000..470bbfd
--- /dev/null
+++ b/external_functions/date_and_time/xgodae_obs.cmn
@@ -0,0 +1,6 @@
+        COMMON /xgodae_obs/ gobs_open, gobs_filename, nobs, nvars
+	LOGICAL gobs_open
+	INTEGER nobs, nvars
+	CHARACTER*160 gobs_filename
+
+
diff --git a/external_functions/decimate/Makefile b/external_functions/decimate/Makefile
new file mode 100644
index 0000000..d767c4c
--- /dev/null
+++ b/external_functions/decimate/Makefile
@@ -0,0 +1,41 @@
+#
+# Makefile for Ferret External Functions
+#
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+ 
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c  $<
+	$(LD) $(LD_DYN_FLAGS) $(SYSLIBS) $*.o -o $*.so
+
+#
+# Targets
+#
+
+all:	piecewise.so piecewise3.so piecewise3_z.so separate.so sample_fast_i.so sample_rows.so apply_qc.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) -g -Ddebug" "CFLAGS = $(CFLAGS) -g -Ddebug"  all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/decimate/decimate.jnl b/external_functions/decimate/decimate.jnl
new file mode 100644
index 0000000..e5eb650
--- /dev/null
+++ b/external_functions/decimate/decimate.jnl
@@ -0,0 +1,137 @@
+
+! one cruise
+! use "/home/data/socat/dsg_files4/cruise_33KM20070920.nc"
+use "/home/data/socat/dsg_files4/SOCAT2_data_table_b900_f2d1_5213_month_lon360_sort.nc"
+
+! def sym ncruises = 50
+! def sym ncruises = 200
+! def sym ncruises = 600
+! def sym ncruises = 1000
+def sym ncruises = `rowsize,return=msize`
+
+if ($ncruises"0|*>1") THEN 
+   let mmax = `rowsize[m=1:($ncruises)@sum]` ! 1st m cruises
+   let npts = mmax
+ELSE
+   let npts = `fco2_recomputed,return=isize`
+ENDIF
+
+set mem/siz=400
+
+! Keep only cruises which are not suspended or excluded
+let flag1 = if strcmp (qc_flag,"S") NE 0 then 1
+let flag2 = if strcmp (qc_flag,"X") NE 0 then 1
+
+let flag = flag1*flag2
+!let fco_keep = apply_qc (fco2_recomputed[i=1:`npts`], rowsize, flag)
+let fco_keep = fco2_recomputed
+
+!plot/i=1:`npts` fco2_recomputed, fco_keep
+
+
+! replace the last datum in each trajectory with the bad-value.
+! For the longitudes, also fix the crossings of the dateline.
+
+let fco_with_gaps = separate(fco_keep[i=1:`npts`], rowsize, 0)
+
+
+let lon_with_gaps = separate(longitude[i=1:`npts`], rowsize, 1)
+let lat_with_gaps = separate(latitude[i=1:`npts`], rowsize, 0)
+
+let npts = `lat_with_gaps,return=isize`
+
+can view
+! Sample using the piecewise linear approximation, applied to the 
+! distance along the globe of the lon-lat path.
+
+let nf = npts
+let control = 2
+let lontol = 0.5
+let lattol = `lontol`
+let fco2tol =`lontol*2`
+
+let decimate_lonlat = piecewise3(\
+lon_with_gaps, lat_with_gaps, fco_with_gaps, control, lontol, lattol, fco2tol)
+
+sh sym clock_secs
+let nout_lonlat = `decimate_lonlat[i=@ngd]`
+sh sym clock_secs
+
+def sym nout_lonlat = `nout_lonlat`
+
+let xsamplepts = xsequence(decimate_lonlat[i=1:($nout_lonlat)])
+def axis/x=1:($nout_lonlat):1 xsample_axis
+let samplepts = xsamplepts[gx=xsample_axis at asn] 
+
+
+! If there is a missing value in the fco2's make a gap in lon/lat there as well. Otherwise 
+! The ribbon plot with /miss=blank still fills halfway to the next location with a color, 
+! and that next location may be the next cruise, halfway around the world.
+
+let lons = if fco_with_gaps then lon_with_gaps
+let lats = if fco_with_gaps then lat_with_gaps
+
+LET/title="`fco2_recomputed,return=title` sampled"/units="`fco2_recomputed,return=units`" \
+ fco2sample = samplei(fco_with_gaps, samplepts)
+
+LET/title="`longitude,return=title`"/units="`longitude,return=units`" \
+ lonsample = samplei(lons, samplepts)
+
+LET/title="`latitude,return=title`"/units="`latitude,return=units`" \
+ latsample = samplei(lats, samplepts)
+
+
+
+sh sym clock_secs; load fco2sample; sh sym clock_secs
+
+def sym plottitle = Sampled with piecewise linear: `nout_lonlat` of original `nf` Points
+
+
+def sym plottitle = "`fco2_recomputed,return=title`<nl>($plottitle)" 
+
+say Sampled with piecewise linear: `nout_lonlat` of original `nf` Points, `nout_lonlat/nf`
+
+
+keymark 1
+! set win/new
+! go basemap x=-180:180 y=-90:90 20
+
+! Make a map in the style of SOCAT maps
+
+! set up for annotations-style LAS map 
+! Needs Faddpath to a set of LAS plot scripts
+
+DEFINE SYMBOL region_Y_range = 180
+DEFINE SYMBOL region_X_range = 360
+DEFINE SYMBOL ferret_view = xy
+DEFINE SYMBOL ferret_annotations = 1
+
+GO LAS_open_window
+
+DEFINE  SYMBOL basemap_palette = grayscale
+DEFINE SYMBOL basemap_levels = (-10000,-1000,1000)(-1000,0,100)
+USE etopo20
+SHADE/NOLABELS/NOKEY/PALETTE=($basemap_palette)/LEVELS=($basemap_levels) rose[x=-180:180,y=-90:90]
+
+DEFINE SYMBOL fland_palette =green_deep
+DEFINE SYMBOL fland_resolution 20
+GO fland ($fland_resolution) ($fland_palette)
+SET DATA 1
+
+! NOTE the automatic levels winds up looking all-green on the decimated 
+! data
+
+def sym vlevels = v
+def sym vlevels = (-inf)(160,260,20)(260,450,10)(440,560,20)(inf)
+
+sh sym clock_secs
+plot/over/pal=rnb/vs/ribbon/line/miss=blank/nolab/levels=($vlevels)/key/set lonsample, latsample, fco2sample
+go key_at_top
+ppl ribbon/over
+
+GO fland ($fland_resolution) ($fland_palette)
+sh sym clock_secs
+frame/file=sample_ribbon_($ncruises)Cruises.png
+
+sh sym clock_secs
+
diff --git a/external_functions/decimate/piecewise.F b/external_functions/decimate/piecewise.F
new file mode 100644
index 0000000..b643e26
--- /dev/null
+++ b/external_functions/decimate/piecewise.F
@@ -0,0 +1,761 @@
+*  piecewise.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Ansley Manke June 2013
+* implements stl2, Piecewise linear approximations of fewest line segments
+* described in http://www.computer.org/csdl/proceedings/afips/1972/5079/00/50790187.pdf
+* and a somewhat later version of the code, found at
+* http://www.netlib.org/toms/510
+*
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE piecewise_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Return indices to sample from piecewise linear interpolation' )
+
+      CALL ef_set_num_args(id, 5) !Y, E, IP as 3 args
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id, ABSTRACT, ABSTRACT, NORMAL, 
+     .                                      NORMAL, NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'variable to sample on I axis')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'Tolerances')
+      CALL ef_set_arg_desc(id, arg,
+     .          'array or single value containing tolerances to use')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+C THE CONTROL PARAMETER IP IS THE PRODUCT
+C  OF THREE INDICATORS I1,I2 AND I3.
+C  I1 INDICATES WHETHER OR NOT E IS AN
+C     ARRAY OF TOLERANCES.
+C     I1 = -1 INDICATES E IS AN ARRAY
+C     I1 = +1 INDICATES E IS A SINGLE NUMBER.
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'Num Tolerances')
+      CALL ef_set_arg_desc(id, arg,
+     .          '1 if single tolerance, -1 if tolerance array')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+C  I2 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION IS TO BE RESTRICTED TO
+C     THE 'TOLERANCE BAND' ABOUT THE DATA.
+C     I2 = 1 INDICATES NO BAND RESTRICTION
+C     I2 = 2 INDICATES APPLY THIS RESTRICTION
+C     (THE 'TOLERANCE BAND' IS A PIECEWISE
+C     LINEAR BAND CENTERED AT THE DATA WHOSE
+C     WIDTH IS DETERMINED BY THE TOLERANCES
+C     AT THE DATA POINTS.)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'Restrict')
+      CALL ef_set_arg_desc(id, arg,
+     .          '1 if restricting to tolerance band, 0 if not')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+C  I3 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION MUST BE CONTINUOUS.
+C     I3 = 1 INDICATES CONTINUITY NOT REQUIRED
+C     I3 = 3 INDICATES CONTINUITY IS REQUIRED
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'Continuous')
+      CALL ef_set_arg_desc(id, arg,
+     .          '1 if result is to be continuous, 0 if not')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+      
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE piecewise_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_i
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_i = arg_hi_ss(X_AXIS,1) - arg_lo_ss(X_AXIS,1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi_i)
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE piecewise_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER npts, iwork
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      npts = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+  
+* input x-axis coordinates
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE piecewise_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .                             arg_5, result, xpts)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work array since
+* they are not used and Fortran is column major
+
+      REAL xpts(wrk1lox:wrk1hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nx, nout, ilo, ip
+      REAL a3, a4, a5, bad_y
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* Compute the parameter IP
+
+      CALL ef_get_one_val(id, ARG3, a3)
+      CALL ef_get_one_val(id, ARG4, a4)
+      CALL ef_get_one_val(id, ARG5, a5)
+
+      IF (ABS(a3) .NE. 1) THEN
+         errtxt = 'Argument 3 must be -1 or 1'
+	 GOTO 999
+      ENDIF
+      IP = INT(a3)
+
+      IF (a4 .EQ. 1) THEN
+         IP = IP* 2
+      ELSE IF (a4 .EQ. 0) THEN
+         a4 = IP* 1
+      ELSE
+         errtxt = 'Argument 4 must be 0 or 1'
+	 GOTO 999
+      ENDIF
+
+      IF (a5 .EQ. 1) THEN
+         IP = IP* 3
+      ELSE IF (a4 .EQ. 0) THEN
+         IP = IP* 1
+      ELSE
+         errtxt = 'Argument 5 must be 0 or 1'
+	 GOTO 999
+      ENDIF
+
+	print *, ' ip = ', ip
+
+*  Set x coordinate - abstract axis.
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      DO 50 i = 1, nx
+         xpts(i) = i
+  50  CONTINUE
+
+* Initialize result
+
+      k = res_lo_ss(Z_AXIS)  ! index for unused dimensions
+
+      DO 150 j = 1, 3
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+	    result(i,j,k,k,k,k) = bad_flag_result
+ 100     CONTINUE
+ 150  CONTINUE
+
+      bad_y = bad_flag(ARG1)
+      CALL STL2(xpts, arg_1, arg_2, nx, bad_y, result(1,1,k,k,k,k), 
+     .   result(1,2,k,k,k,k), result(1,3,k,k,k,k), nout, IP)
+
+* Truncate result(j=1) to next lowest integer - its going to be
+* the set of coordinate values to sample at.
+
+      j = 1
+      DO 200 i = res_lo_ss(X_AXIS), nout
+	 result(i,j,k,k,k,k) = INT( result(i,j,k,k,k,k) )
+ 200  CONTINUE
+
+      RETURN
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
+
+      SUBROUTINE STL2(X, Y, E, M, bad_y, U, V, W, K, IP)
+
+C PIECEWISE LINEAR APPROXIMATIONS OF FEWEST
+C LINE SEGMENTS WITHIN GIVEN TOLERANCES.
+
+C X,Y,E AND M CONTAIN INPUT DATA.
+C U,V,K AND POSSIBLY W CONTAIN OUTPUT.
+
+C IP IS A PARAMETER DETERMINING THE OPERATION
+C  OF THE PROGRAM.
+
+C X AND Y ARE INPUT DATA ARRAYS OF M ELEMENTS
+C  X(I),Y(I) CONTAINS THE ITH DATA POINT.
+
+C E MAY BE A SINGLE TOLERANCE OR A TABLE OF
+C  TOLERANCES DEPENDING ON THE VALUE OF IP.
+C IF E IS AN ARRAY, THEN E(I) IS THE TOLERANCE
+C  ASSOCIATED WITH X(I),Y(I) AND E MUST CONTAIN
+C  M NONNEGATIVE ELEMENTS.
+
+C U AND V ARE OUTPUT ARRAYS OF K+1 ELEMENTS.
+C  U IS A PARTITION OF THE INTERVAL (X(1),X(N))
+C  WITH U(1)=X(1) AND U(K+1)=X(N).
+C  V(I) IS AN ORDINATE TO BE ASSOCIATED WITH
+C  U(I) IN THE APPROXIMATION.  (IF A CONTINUOUS
+C  APPROXIMATION IS REQUESTED, THEN V(I) IS
+C  'THE' ORDINATE TO BE ASSOCIATED WITH U(I).)
+
+C IF A CONTINUOUS APPROXIMATION IS REQUESTED,
+C  THEN W IS NOT USED.  IN THIS CASE THE ITH
+C  APPROXIMATING SEGMENT IS THE STRAIGHT LINE
+C  FROM U(I),V(I) TO U(I+1),V(I+1).
+
+C IF A CONTINUOUS APPROXIMATION IS NOT
+C  REQUESTED, THEN W IS A K-ELEMENT OUTPUT
+C  ARRAY.  IN THIS CASE THE ITH APPROXIMATING
+C  SEGMENT IS THE STRAIGHT LINE FROM
+C  U(I),W(I) TO U(I+1),V(I+1), AND V(1) IS
+C  SET EQUAL TO W(1).
+
+C K IS THE NUMBER OF SEGMENTS IN THE PIECE-
+C  WISE LINEAR APPROXIMATION GENERATED.  IN
+C  CASE OF AN ERROR RETURN, K WILL BE SET TO
+C  ZERO.
+
+C THE CONTROL PARAMETER IP IS THE PRODUCT
+C  OF THREE INDICATORS I1,I2 AND I3.
+C  I1 INDICATES WHETHER OR NOT E IS AN
+C     ARRAY OF TOLERANCES.
+C     I1 = -1 INDICATES E IS AN ARRAY
+C     I1 = +1 INDICATES E IS A SINGLE NUMBER.
+C  I2 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION IS TO BE RESTRICTED TO
+C     THE 'TOLERANCE BAND' ABOUT THE DATA.
+C     I2 = 1 INDICATES NO BAND RESTRICTION
+C     I2 = 2 INDICATES APPLY THIS RESTRICTION
+C     (THE 'TOLERANCE BAND' IS A PIECEWISE
+C     LINEAR BAND CENTERED AT THE DATA WHOSE
+C     WIDTH IS DETERMINED BY THE TOLERANCES
+C     AT THE DATA POINTS.)
+C  I3 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION MUST BE CONTINUOUS.
+C     I3 = 1 INDICATES CONTINUITY NOT REQUIRED
+C     I3 = 3 INDICATES CONTINUITY IS REQUIRED
+
+C CALL STL2 (X,Y,E,M,X,Y,E,M,IP) WILL NOT
+C  CAUSE PROBLEMS PROVIDED THAT
+C  EITHER A CONTINUOUS APPROXIMATION IS
+C  REQUESTED, OR E IS A SUFFICIENTLY LARGE
+C  ARRAY.
+
+C THE PROGRAM PERFORMS THE FOLLOWING DATA
+C  CHECKS.  ARE THE X-VALUES IN INCREASING
+C  ORDER.  ARE THE TOLERANCE(S) NONNEGATIVE.
+C  IS THE NUMBER OF DATA POINTS GREATER THAN
+C  ONE.  IF ANY CHECK FAILS, THE PROGRAM
+C  RETURNS WITH K SET EQUAL TO 0.  IN THIS
+C  CASE NO FURTHER PROCESSING IS ATTEMPTED.
+
+      IMPLICIT NONE
+* Calling arguments
+      REAL X(*), Y(*), E(*), U(*), V(*), W(*), bad_y
+      INTEGER M, K, IP
+
+* Local declarations
+      INTEGER N, ITCH, I, J, L, KEEP, INIT, INDC, IGRAZE,
+     .        IDIOT, IT, IPIV, KP
+      REAL EPSLN, SGN, XEYE, YEYE, TEMP1, SMIN, DX, 
+     .     SVX, SVY, SVMN, TEMP2, XINIT, YINIT, SLOPE, SMAX, 
+     .     SVMX, TEST
+
+      integer nothing, istop
+
+	istop = 34566
+
+      N = M
+      ITCH = IP
+      J = 1
+C ERROR CHECKS
+      IF (N.LE.1) GO TO 400
+      IF (E(1).LT.0.0) GO TO 400
+      DO 10 L=2,N
+        IF (X(L-1).GE.X(L)) GO TO 400
+        IF (ITCH.GE.0) GO TO 10
+        IF (E(L).LT.0.0) GO TO 400
+   10 CONTINUE
+C INITIALIZATION FOR ENTIRE PROGRAM
+      EPSLN = E(1)
+      SGN = 1.0
+      KEEP = 1
+      I = 1
+      
+      if (y(i) .eq. bad_y) THEN
+         do while (y(i) .eq. bad_y)
+            i = i + 1
+         enddo
+         i = i - 1
+      endif
+      if (i.eq.istop) then
+         nothing = 0
+      endif
+
+      U(i) = X(i)
+      J = 2
+      INIT = 1
+      INDC = 0
+      GO TO 30
+C INITIALIZATION FOR EACH SEGMENT
+   20 CONTINUE
+      J = J + 1
+      INIT = I
+      INDC = 0
+      IF (IABS(ITCH).LT.3) KEEP = I
+      IF (IABS(IABS(ITCH)-4).NE.2) GO TO 30
+C RESTRICTED TO TOLERANCE BAND
+      XEYE = U(J-1)
+      YEYE = V(J-1)
+      TEMP1 = EPSLN
+      IF (ITCH.LT.0) TEMP1 = TEMP1 + (SGN*E(I-1)-EPSLN)*(X(I)-U(J-1)
+     * )/(X(I)-X(I-1))
+      YINIT = YEYE - TEMP1 - TEMP1
+      GO TO 40
+   30 CONTINUE
+C NOT RESTRICTED TO TOLERANCE BAND
+      XEYE = X(I)
+      YEYE = Y(I) + EPSLN
+      YINIT = Y(I) - EPSLN
+      IF (IABS(ITCH).EQ.1 .OR. I.EQ.1) GO TO 40
+      TEMP1 = EPSLN
+      IF (ITCH.LT.0) TEMP1 = SGN*E(I+1)
+      SMIN = (Y(I+1)-YEYE-TEMP1)/(X(I+1)-XEYE)
+      IF (ITCH.LT.0) TEMP1 = SGN*E(I-1)
+      SMAX = (YEYE-Y(I-1)+TEMP1)/(XEYE-X(I-1))
+      IF (KEEP.EQ.I-1) GO TO 50
+      IT = I - 2
+      XINIT = XEYE
+      IPIV = I
+      IGRAZE = I
+      I = I + 1
+      if (i.eq.istop) then
+         nothing = 0
+      endif
+
+      if (y(i) .eq. bad_y) THEN
+         do while (y(i) .eq. bad_y)
+            i = i + 1
+         enddo
+         i = i - 1
+      endif
+
+      GO TO 150
+   40 CONTINUE
+      IF (XEYE.GE.X(I)) I = I + 1
+      IF (ITCH.LT.0) EPSLN = SGN*E(I)
+      DX = X(I) - XEYE
+      SMAX = (Y(I)+EPSLN-YEYE)/DX
+      SMIN = (Y(I)-EPSLN-YEYE)/DX
+   50 CONTINUE
+      XINIT = XEYE
+      IPIV = I
+      IGRAZE = I
+C DETERMINATION OF INDIVIDUAL SEGMENT
+   60 CONTINUE
+      IF (I.EQ.N) GO TO 260
+      I = I + 1
+      if (i.eq.istop) then
+         nothing = 0
+      endif
+   70 CONTINUE
+C TEST FOR NEW *MAX* SLOPE
+      DX = X(I) - XEYE
+      IF (ITCH.LT.0) EPSLN = SGN*E(I)
+      TEMP1 = (Y(I)+EPSLN-YEYE)/DX
+      TEST = TEMP1 - SMAX
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 80, 90, 100
+   80 CONTINUE
+C TEST FOR END OF CANDIDATE SEGMENT
+      TEST = TEMP1 - SMIN
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST.LT.0.0) GO TO 210
+      SMAX = TEMP1
+   90 CONTINUE
+C TEST FOR NEW *MIN* SLOPE
+      IPIV = I
+  100 CONTINUE
+      TEMP2 = (Y(I)-EPSLN-YEYE)/DX
+      TEST = TEMP2 - SMAX
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 110, 120, 140
+  110 CONTINUE
+      TEST = SMIN - TEMP2
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 120, 130, 60
+  120 CONTINUE
+      SMIN = TEMP2
+  130 CONTINUE
+      IGRAZE = I
+      GO TO 60
+C CHECK FOR PIVOT AT NEW EYE POINT
+  140 CONTINUE
+      IF (XEYE.EQ.X(IPIV)) GO TO 220
+      IF (ITCH.LT.0) EPSLN = SGN*E(IPIV)
+      INDC = 1
+      SVX = XEYE
+      SVY = YEYE
+      SVMN = SMIN
+      SVMX = SMAX
+      XEYE = X(IPIV)
+      YEYE = Y(IPIV) + EPSLN
+      SMIN = SMAX
+      SMAX = (YINIT-YEYE)/(XINIT-XEYE)
+      IF (KEEP.GE.IPIV) GO TO 170
+      IT = IPIV - 1
+  150 CONTINUE
+      TEMP2 = YEYE + EPSLN
+      DO 160 L=KEEP,IT
+        IF (ITCH.LT.0) TEMP2 = YEYE + SGN*E(L)
+        TEMP1 = (Y(L)-TEMP2)/(X(L)-XEYE)
+        TEST = TEMP1 - SMAX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST.LT.0.0) SMAX = TEMP1
+  160 CONTINUE
+  170 CONTINUE
+      IF (IPIV.GE.I-1) GO TO 70
+      IT = I - 2
+      TEMP2 = YEYE - EPSLN
+      IDIOT = IPIV
+      DO 200 L=IDIOT,IT
+        DX = X(L+1) - XEYE
+        IF (ITCH.LT.0) TEMP2 = YEYE - SGN*E(L+1)
+        TEMP1 = (Y(L+1)-TEMP2)/DX
+        TEST = TEMP1 - SMAX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST) 180, 190, 200
+  180   CONTINUE
+        SMAX = TEMP1
+  190   CONTINUE
+        IPIV = L + 1
+  200 CONTINUE
+      GO TO 70
+C END OF CURRENT SEGMENT
+  210 CONTINUE
+      TEMP2 = SMIN
+      IF (I.EQ.N) GO TO 240
+      KEEP = IGRAZE
+      GO TO 250
+  220 CONTINUE
+      TEMP2 = SMAX
+      IF (I.EQ.N) GO TO 230
+      SGN = -SGN
+      EPSLN = -EPSLN
+      KEEP = IPIV
+      GO TO 250
+  230 CONTINUE
+      IF (INDC.EQ.0 .OR. XEYE.NE.X(N-1)) GO TO 240
+      XEYE = SVX
+      YEYE = SVY
+      SMIN = SVMN
+      SMAX = SVMX
+  240 CONTINUE
+      U(J) = X(N-1)
+      YINIT = Y(N-1)
+      GO TO 270
+  250 CONTINUE
+      IF (IABS(IABS(ITCH)-4).NE.2) GO TO 300
+C DETERMINE KNOT ON EDGE OF TOLERANCE BAND
+      TEMP1 = 0.0
+      if (i.eq.istop) then
+         nothing = 0
+      endif
+      IF (ITCH.LT.0) TEMP1 = EPSLN - SGN*E(I-1)
+      TEMP1 = (Y(I)-Y(I-1)+TEMP1)/(X(I)-X(I-1))
+      U(J) = (Y(I)+EPSLN-YEYE-TEMP1*X(I)+TEMP2*XEYE)/(TEMP2-TEMP1)
+      GO TO 310
+  260 CONTINUE
+      U(J) = X(N)
+      YINIT = Y(N)
+  270 CONTINUE
+C CONTINUITY CHECK FOR LAST SEGMENT
+      IF (IABS(ITCH).GE.3 .OR. INIT.EQ.1) GO TO 290
+      IT = INIT - 1
+      SVMX = SMAX + SGN
+      TEMP2 = YEYE + EPSLN
+      DO 280 L=KP,IT
+        IF (ITCH.LT.0) TEMP2 = YEYE + SGN*E(L)
+        TEMP1 = (Y(L)-TEMP2)/(X(L)-XEYE)
+        TEST = TEMP1 - SVMX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST.LT.0.0) SVMX = TEMP1
+  280 CONTINUE
+      IF (ABS(SVMX-SMAX+SVMX-SMIN).LE.ABS(SMAX-SMIN)) SMAX = SVMX
+  290 CONTINUE
+C NEARNESS CHECK FOR LAST SEGMENT
+      TEMP2 = SMAX
+      TEMP1 = YEYE + SMAX*(U(J)-XEYE)
+      TEST = YINIT - TEMP1
+      IF (SGN.LT.0.0) TEST = -TEST
+      IF (TEST.GT.0.0) GO TO 310
+      TEMP2 = SMIN
+      TEMP1 = YEYE + SMIN*(U(J)-XEYE)
+      TEST = YINIT - TEMP1
+      IF (SGN.LT.0.0) TEST = -TEST
+      IF (TEST.LT.0.0) GO TO 310
+      TEMP2 = (YINIT-YEYE)/(U(J)-XEYE)
+      V(J) = YINIT
+      GO TO 320
+  300 CONTINUE
+      IF (IABS(ITCH).GE.3) GO TO 330
+      U(J) = 0.5*(X(I)+X(I-1))
+  310 CONTINUE
+      V(J) = YEYE + TEMP2*(U(J)-XEYE)
+  320 CONTINUE
+      IF (XEYE.NE.XINIT) GO TO 330
+      IF (IABS(ITCH).EQ.2) GO TO 360
+      IF (IABS(ITCH).NE.6) GO TO 330
+      IF (J.LE.2) GO TO 380
+      GO TO 390
+  330 CONTINUE
+C RECOMPUTATION OF KNOT FOR CONTINUITY
+      IF (J.LE.2) GO TO 370
+      IF (SLOPE.EQ.TEMP2) GO TO 360
+      YINIT = V(J-2)
+      IF (IABS(ITCH).LT.3) YINIT = W(J-2)
+      TEMP1 = (XEYE*TEMP2-U(J-2)*SLOPE+YINIT-YEYE)/(TEMP2-SLOPE)
+      IF (IABS(ITCH).GE.3) GO TO 350
+      IF (TEMP1.GT.XINIT) GO TO 360
+      TEST = ABS(EPSLN)
+      IDIOT = INIT - KP
+      DO 340 L=1,IDIOT
+        IT = INIT - L
+        IF (TEMP1.GE.X(IT)) GO TO 350
+        DX = Y(IT) - YEYE - TEMP2*(X(IT)-XEYE)
+        IF (ITCH.LT.0) TEST = E(IT)
+        IF (ABS(DX).GT.TEST) GO TO 360
+  340 CONTINUE
+  350 CONTINUE
+      U(J-1) = TEMP1
+      V(J-1) = YEYE + TEMP2*(U(J-1)-XEYE)
+      IF (IABS(ITCH).LT.3) W(J-1) = V(J-1)
+      GO TO 390
+  360 CONTINUE
+      W(J-1) = YEYE + TEMP2*(U(J-1)-XEYE)
+      GO TO 390
+  370 CONTINUE
+      IF (IABS(ITCH).LT.3) GO TO 360
+  380 CONTINUE
+      V(1) = YEYE + TEMP2*(U(1)-XEYE)
+  390 CONTINUE
+      SLOPE = TEMP2
+      KP = KEEP
+      IF (I.LT.N) GO TO 20
+      IF (X(N).EQ.U(J)) GO TO 400
+      IF (IABS(ITCH).LT.3) W(J) = V(J)
+      J = J + 1
+      U(J) = X(N)
+      V(J) = Y(N)
+  400 CONTINUE
+      IF (J.GE.2 .AND. IABS(ITCH).LT.3) V(1) = W(1)
+      K = J - 1
+      RETURN
+      END
diff --git a/external_functions/decimate/piecewise3.F b/external_functions/decimate/piecewise3.F
new file mode 100644
index 0000000..f034d37
--- /dev/null
+++ b/external_functions/decimate/piecewise3.F
@@ -0,0 +1,891 @@
+*  piecewise3.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Ansley Manke June 2013
+* implements stl2, Piecewise linear approximations of fewest line segments
+* described in http://www.computer.org/csdl/proceedings/afips/1972/5079/00/50790187.pdf
+* and a somewhat later version of the code, found at
+* http://www.netlib.org/toms/510
+*
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE piecewise3_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Return indices to sample from piecewise linear interpolation' )
+
+      CALL ef_set_num_args(id, 7) 
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, 
+     .                                              NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V1')
+      CALL ef_set_arg_desc(id, arg, '1st variable to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'V2')
+      CALL ef_set_arg_desc(id, arg, '2nd variable to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'V3')
+      CALL ef_set_arg_desc(id, arg, '3rd variable to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'Control parameter')
+      CALL ef_set_arg_desc(id, arg,
+     .          'Control parameter (e.g. 6 for ntol=rest=cont=1)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'Tol1')
+      CALL ef_set_arg_desc(id, arg, 'Tolerance for V1')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'Tol2')
+      CALL ef_set_arg_desc(id, arg, 'Tolerance for V2')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'Tol3')
+      CALL ef_set_arg_desc(id, arg, 'Tolerance for V3')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE piecewise3_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_i
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .        arg_incr (4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_i = arg_hi_ss(X_AXIS,1) - arg_lo_ss(X_AXIS,1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi_i)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE piecewise3_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims(id, array #,
+*                           xlo, ylo, zlo, tlo, 
+*                           xhi, yhi, zhi, thi)
+*
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .        arg_incr (4,EF_MAX_ARGS)
+      INTEGER npts, iwork
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      npts = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+  
+* input x-axis coordinates
+      iwork = 1
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                             npts, 1, 1, 1)
+
+* internal computation, u1 for y1
+      iwork = 2
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                             npts, 1, 1, 1)
+
+* internal computation, u2 for y2
+      iwork = 3
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                             npts, 1, 1, 1)
+
+* internal computation, u3 for y3
+      iwork = 4
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                             npts, 1, 1, 1)
+
+* internal computation, v
+      iwork = 5
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                           2*npts, 1, 1, 1)
+
+* internal computation, w
+      iwork = 6
+      CALL ef_set_work_array_dims(id, iwork,
+     .                                1, 1, 1, 1,
+     .                           2*npts, 1, 1, 1)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE piecewise3_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .        arg_5, arg_6, arg_7, result, xpts, u1, u2, u3, v, w)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .           mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz, 
+     .           mem7lot:mem7hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* Ignore the Y/Z/T/E/F dimensions in the work array since
+* they are not used and Fortran is column major
+
+      REAL xpts(wrk1lox:wrk1hix)
+
+      REAL u1(wrk2lox:wrk2hix)
+      REAL u2(wrk3lox:wrk3hix)
+      REAL u3(wrk4lox:wrk4hix)
+      REAL  v(wrk5lox:wrk5hix)
+      REAL  w(wrk6lox:wrk6hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4),
+     .        res_hi_ss(4),
+     .        res_incr (4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .        arg_incr (4,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  k
+      INTEGER nx, nout1, nout2, nout3, nmerge1, nmerge2, ip
+      REAL val, tol(3), bad_y
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Control parameter IP
+
+      CALL ef_get_one_val(id, ARG4, val)
+      IP = INT(val)
+
+* Tolerances
+
+      CALL ef_get_one_val(id, ARG5, tol(1))
+
+      CALL ef_get_one_val(id, ARG6, tol(2))
+
+      CALL ef_get_one_val(id, ARG7, tol(3))
+
+*  Set x coordinate - abstract axis.
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      DO 50 i = 1, nx
+         xpts(i) = i
+  50  CONTINUE
+
+      k = res_lo_ss(Z_AXIS)  ! index for unused dimensions
+
+* STL2 modified to truncate result to next lowest integer
+
+      bad_y = bad_flag(ARG1)
+      CALL STL2(xpts, arg_1, tol(1), nx, bad_y, bad_flag_result, 
+     .   u1, v, w, nout1, IP)
+      IF (nout1 .GT. res_hi_ss(X_AXIS)) THEN
+        write (errtxt,*) 'first call to STL2 returns too many data', nout1
+	 GOTO 999
+      ENDIF
+
+      bad_y = bad_flag(ARG2)
+      CALL STL2(xpts, arg_2, tol(2), nx, bad_y, bad_flag_result, 
+     .   u2, v, w, nout2, IP)
+      IF (nout1 .GT. res_hi_ss(X_AXIS)) THEN
+        write (errtxt,*) 'second call to STL2 returns too many data', nout2
+	 GOTO 999
+      ENDIF
+
+      bad_y = bad_flag(ARG3)
+      CALL STL2(xpts, arg_3, tol(3), nx, bad_y, bad_flag_result, 
+     .   u3, v, w, nout3, IP)
+      IF (nout1 .GT. res_hi_ss(X_AXIS)) THEN
+        write (errtxt,*) 'third call to STL2 returns too many data', nout3
+	 GOTO 999
+      ENDIF
+
+* Truncate result(j=1) to next lowest integer - its going to be
+* the set of coordinate values to sample at.
+
+      DO 100 i = 1, nout1+nout2
+	 w(i) = 0.
+ 100  CONTINUE
+
+      CALL merge (u1,nout1,u2,nout2,w,nmerge1)
+      IF (nout1 .GT. res_hi_ss(X_AXIS)) THEN
+        write (errtxt,*) 'nmerge1 too large', nmerge1
+	 GOTO 999
+      ENDIF
+
+      DO 200 i = 1, nout1+nout2
+	 v(i) = 0.
+ 200  CONTINUE
+
+      CALL merge (w,nmerge1,u3,nout3,v,nmerge2)
+	      IF (nout1 .GT. res_hi_ss(X_AXIS)) THEN
+        write (errtxt,*) 'nmerge2 too large', nmerge2
+	 GOTO 999
+      ENDIF
+
+      DO 300 i = 1, nmerge2
+        result(i,k,k,k) = v(i)
+ 300  CONTINUE
+
+      DO 400 i = nmerge2+1, res_hi_ss(X_AXIS)
+        result(i,k,k,k) = bad_flag_result
+ 400  CONTINUE
+
+      RETURN
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
+
+      SUBROUTINE STL2(X, Y, E, M, bad_y, bad_out, U, V, W, K, IP)
+
+C PIECEWISE LINEAR APPROXIMATIONS OF FEWEST
+C LINE SEGMENTS WITHIN GIVEN TOLERANCES.
+
+C X,Y,E AND M CONTAIN INPUT DATA.
+C U,V,K AND POSSIBLY W CONTAIN OUTPUT.
+
+C IP IS A PARAMETER DETERMINING THE OPERATION
+C  OF THE PROGRAM.
+
+C X AND Y ARE INPUT DATA ARRAYS OF M ELEMENTS
+C  X(I),Y(I) CONTAINS THE ITH DATA POINT.
+
+C E MAY BE A SINGLE TOLERANCE OR A TABLE OF
+C  TOLERANCES DEPENDING ON THE VALUE OF IP.
+C IF E IS AN ARRAY, THEN E(I) IS THE TOLERANCE
+C  ASSOCIATED WITH X(I),Y(I) AND E MUST CONTAIN
+C  M NONNEGATIVE ELEMENTS.
+
+C U AND V ARE OUTPUT ARRAYS OF K+1 ELEMENTS.
+C  U IS A PARTITION OF THE INTERVAL (X(1),X(N))
+C  WITH U(1)=X(1) AND U(K+1)=X(N).
+C  V(I) IS AN ORDINATE TO BE ASSOCIATED WITH
+C  U(I) IN THE APPROXIMATION.  (IF A CONTINUOUS
+C  APPROXIMATION IS REQUESTED, THEN V(I) IS
+C  'THE' ORDINATE TO BE ASSOCIATED WITH U(I).)
+
+C IF A CONTINUOUS APPROXIMATION IS REQUESTED,
+C  THEN W IS NOT USED.  IN THIS CASE THE ITH
+C  APPROXIMATING SEGMENT IS THE STRAIGHT LINE
+C  FROM U(I),V(I) TO U(I+1),V(I+1).
+
+C IF A CONTINUOUS APPROXIMATION IS NOT
+C  REQUESTED, THEN W IS A K-ELEMENT OUTPUT
+C  ARRAY.  IN THIS CASE THE ITH APPROXIMATING
+C  SEGMENT IS THE STRAIGHT LINE FROM
+C  U(I),W(I) TO U(I+1),V(I+1), AND V(1) IS
+C  SET EQUAL TO W(1).
+
+C K IS THE NUMBER OF SEGMENTS IN THE PIECE-
+C  WISE LINEAR APPROXIMATION GENERATED.  IN
+C  CASE OF AN ERROR RETURN, K WILL BE SET TO
+C  ZERO.
+
+C THE CONTROL PARAMETER IP IS THE PRODUCT
+C  OF THREE INDICATORS I1,I2 AND I3.
+C  I1 INDICATES WHETHER OR NOT E IS AN
+C     ARRAY OF TOLERANCES.
+C     I1 = -1 INDICATES E IS AN ARRAY
+C     I1 = +1 INDICATES E IS A SINGLE NUMBER.
+C  I2 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION IS TO BE RESTRICTED TO
+C     THE 'TOLERANCE BAND' ABOUT THE DATA.
+C     I2 = 1 INDICATES NO BAND RESTRICTION
+C     I2 = 2 INDICATES APPLY THIS RESTRICTION
+C     (THE 'TOLERANCE BAND' IS A PIECEWISE
+C     LINEAR BAND CENTERED AT THE DATA WHOSE
+C     WIDTH IS DETERMINED BY THE TOLERANCES
+C     AT THE DATA POINTS.)
+C  I3 INDICATES WHETHER OR NOT THE
+C     APPROXIMATION MUST BE CONTINUOUS.
+C     I3 = 1 INDICATES CONTINUITY NOT REQUIRED
+C     I3 = 3 INDICATES CONTINUITY IS REQUIRED
+
+C CALL STL2 (X,Y,E,M,X,Y,E,M,IP) WILL NOT
+C  CAUSE PROBLEMS PROVIDED THAT
+C  EITHER A CONTINUOUS APPROXIMATION IS
+C  REQUESTED, OR E IS A SUFFICIENTLY LARGE
+C  ARRAY.
+
+C THE PROGRAM PERFORMS THE FOLLOWING DATA
+C  CHECKS.  ARE THE X-VALUES IN INCREASING
+C  ORDER.  ARE THE TOLERANCE(S) NONNEGATIVE.
+C  IS THE NUMBER OF DATA POINTS GREATER THAN
+C  ONE.  IF ANY CHECK FAILS, THE PROGRAM
+C  RETURNS WITH K SET EQUAL TO 0.  IN THIS
+C  CASE NO FURTHER PROCESSING IS ATTEMPTED.
+
+      IMPLICIT NONE
+* Calling arguments
+      REAL X(*), Y(*), E(*), U(*), V(*), W(*), bad_y, bad_out
+      INTEGER M, K, IP
+
+* Local declarations
+      LOGICAL skipbad
+      INTEGER N, ITCH, I, J, L, KEEP, INIT, INDC, IGRAZE,
+     .        IDIOT, IT, IPIV, KP
+      REAL EPSLN, SGN, XEYE, YEYE, TEMP1, SMIN, DX, 
+     .     SVX, SVY, SVMN, TEMP2, XINIT, YINIT, SLOPE, SMAX, 
+     .     SVMX, TEST
+
+      N = M
+      ITCH = IP
+      J = 1
+C ERROR CHECKS
+      IF (N.LE.1) GO TO 400
+      IF (E(1).LT.0.0) GO TO 400
+      DO 10 L=2,N
+        IF (X(L-1).GE.X(L)) GO TO 400
+        IF (ITCH.GE.0) GO TO 10
+        IF (E(L).LT.0.0) GO TO 400
+   10 CONTINUE
+C INITIALIZATION FOR ENTIRE PROGRAM
+      EPSLN = E(1)
+      SGN = 1.0
+      KEEP = 1
+      I = 1
+
+      CALL PIECEWISE3_CHECKGAP (Y, bad_y, x, u, i, j, n, skipbad)
+      IF (skipbad) GOTO 30
+
+      U(i) = X(i)
+      J = 2
+      INIT = 1
+      INDC = 0
+      GO TO 30
+C INITIALIZATION FOR EACH SEGMENT
+   20 CONTINUE
+      J = J + 1
+      INIT = I
+      INDC = 0
+      IF (IABS(ITCH).LT.3) KEEP = I
+      IF (IABS(IABS(ITCH)-4).NE.2) GO TO 30
+C RESTRICTED TO TOLERANCE BAND
+      XEYE = U(J-1)
+      YEYE = V(J-1)
+      TEMP1 = EPSLN
+      IF (ITCH.LT.0) TEMP1 = TEMP1 + (SGN*E(I-1)-EPSLN)*(X(I)-U(J-1)
+     * )/(X(I)-X(I-1))
+      YINIT = YEYE - TEMP1 - TEMP1
+      GO TO 40
+   30 CONTINUE
+C NOT RESTRICTED TO TOLERANCE BAND
+      XEYE = X(I)
+      YEYE = Y(I) + EPSLN
+      YINIT = Y(I) - EPSLN
+      IF (IABS(ITCH).EQ.1 .OR. I.EQ.1) GO TO 40
+      TEMP1 = EPSLN
+      IF (ITCH.LT.0) TEMP1 = SGN*E(I+1)
+      SMIN = (Y(I+1)-YEYE-TEMP1)/(X(I+1)-XEYE)
+      IF (ITCH.LT.0) TEMP1 = SGN*E(I-1)
+      SMAX = (YEYE-Y(I-1)+TEMP1)/(XEYE-X(I-1))
+
+      IF (KEEP.EQ.I-1) GO TO 50
+      IT = I - 2
+      XINIT = XEYE
+      IPIV = I
+      IGRAZE = I
+      I = I + 1
+
+      CALL PIECEWISE3_CHECKGAP (Y, bad_y, x, u, i, j, n, skipbad)
+      IF (skipbad) GOTO 30
+
+      GO TO 150
+   40 CONTINUE
+      IF (XEYE.GE.X(I)) I = I + 1
+      IF (ITCH.LT.0) EPSLN = SGN*E(I)
+      DX = X(I) - XEYE
+      SMAX = (Y(I)+EPSLN-YEYE)/DX
+      SMIN = (Y(I)-EPSLN-YEYE)/DX
+   50 CONTINUE
+      XINIT = XEYE
+      IPIV = I
+      IGRAZE = I
+C DETERMINATION OF INDIVIDUAL SEGMENT
+   60 CONTINUE
+      IF (I.EQ.N) GO TO 260
+      I = I + 1
+      
+C New i, so does it point to a bad-val?
+
+      CALL PIECEWISE3_CHECKGAP (Y, bad_y, x, u, i, j, n, skipbad)
+      IF (skipbad) GOTO 30
+
+   70 CONTINUE
+ 
+C TEST FOR NEW *MAX* SLOPE
+      DX = X(I) - XEYE
+      IF (ITCH.LT.0) EPSLN = SGN*E(I)
+      TEMP1 = (Y(I)+EPSLN-YEYE)/DX
+      TEST = TEMP1 - SMAX
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 80, 90, 100
+   80 CONTINUE
+C TEST FOR END OF CANDIDATE SEGMENT
+      TEST = TEMP1 - SMIN
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST.LT.0.0) GO TO 210
+      SMAX = TEMP1
+   90 CONTINUE
+C TEST FOR NEW *MIN* SLOPE
+      IPIV = I
+  100 CONTINUE
+      TEMP2 = (Y(I)-EPSLN-YEYE)/DX
+      TEST = TEMP2 - SMAX
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 110, 120, 140
+  110 CONTINUE
+      TEST = SMIN - TEMP2
+      IF (SGN.LE.0.0) TEST = -TEST
+      IF (TEST) 120, 130, 60
+  120 CONTINUE
+      SMIN = TEMP2
+  130 CONTINUE
+      IGRAZE = I
+      GO TO 60
+C CHECK FOR PIVOT AT NEW EYE POINT
+  140 CONTINUE
+      IF (XEYE.EQ.X(IPIV)) GO TO 220
+      IF (ITCH.LT.0) EPSLN = SGN*E(IPIV)
+      INDC = 1
+      SVX = XEYE
+      SVY = YEYE
+      SVMN = SMIN
+      SVMX = SMAX
+      XEYE = X(IPIV)
+      YEYE = Y(IPIV) + EPSLN
+      SMIN = SMAX
+      SMAX = (YINIT-YEYE)/(XINIT-XEYE)
+      IF (KEEP.GE.IPIV) GO TO 170
+      IT = IPIV - 1
+  150 CONTINUE
+      TEMP2 = YEYE + EPSLN
+      DO 160 L=KEEP,IT
+        IF (ITCH.LT.0) TEMP2 = YEYE + SGN*E(L)
+        TEMP1 = (Y(L)-TEMP2)/(X(L)-XEYE)
+        TEST = TEMP1 - SMAX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST.LT.0.0) SMAX = TEMP1
+  160 CONTINUE
+  170 CONTINUE
+      IF (IPIV.GE.I-1) GO TO 70
+      IT = I - 2
+      TEMP2 = YEYE - EPSLN
+      IDIOT = IPIV
+      DO 200 L=IDIOT,IT
+        DX = X(L+1) - XEYE
+        IF (ITCH.LT.0) TEMP2 = YEYE - SGN*E(L+1)
+        TEMP1 = (Y(L+1)-TEMP2)/DX
+        TEST = TEMP1 - SMAX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST) 180, 190, 200
+  180   CONTINUE
+        SMAX = TEMP1
+  190   CONTINUE
+        IPIV = L + 1
+  200 CONTINUE
+      GO TO 70
+C END OF CURRENT SEGMENT
+  210 CONTINUE
+      TEMP2 = SMIN
+      IF (I.EQ.N) GO TO 240
+      KEEP = IGRAZE
+      GO TO 250
+  220 CONTINUE
+      TEMP2 = SMAX
+      IF (I.EQ.N) GO TO 230
+      SGN = -SGN
+      EPSLN = -EPSLN
+      KEEP = IPIV
+      GO TO 250
+  230 CONTINUE
+      IF (INDC.EQ.0 .OR. XEYE.NE.X(N-1)) GO TO 240
+      XEYE = SVX
+      YEYE = SVY
+      SMIN = SVMN
+      SMAX = SVMX
+  240 CONTINUE
+      U(J) = X(N-1)
+      YINIT = Y(N-1)
+      GO TO 270
+  250 CONTINUE
+      IF (IABS(IABS(ITCH)-4).NE.2) GO TO 300
+C DETERMINE KNOT ON EDGE OF TOLERANCE BAND
+      TEMP1 = 0.0
+      IF (ITCH.LT.0) TEMP1 = EPSLN - SGN*E(I-1)
+      TEMP1 = (Y(I)-Y(I-1)+TEMP1)/(X(I)-X(I-1))
+      
+      U(J) = (Y(I)+EPSLN-YEYE-TEMP1*X(I)+TEMP2*XEYE)/(TEMP2-TEMP1)
+
+      GO TO 310
+  260 CONTINUE
+      U(J) = X(N)
+      YINIT = Y(N)
+  270 CONTINUE
+C CONTINUITY CHECK FOR LAST SEGMENT
+      IF (IABS(ITCH).GE.3 .OR. INIT.EQ.1) GO TO 290
+      IT = INIT - 1
+      SVMX = SMAX + SGN
+      TEMP2 = YEYE + EPSLN
+      DO 280 L=KP,IT
+        IF (ITCH.LT.0) TEMP2 = YEYE + SGN*E(L)
+        TEMP1 = (Y(L)-TEMP2)/(X(L)-XEYE)
+        TEST = TEMP1 - SVMX
+        IF (SGN.LE.0.0) TEST = -TEST
+        IF (TEST.LT.0.0) SVMX = TEMP1
+  280 CONTINUE
+      IF (ABS(SVMX-SMAX+SVMX-SMIN).LE.ABS(SMAX-SMIN)) SMAX = SVMX
+  290 CONTINUE
+C NEARNESS CHECK FOR LAST SEGMENT
+      TEMP2 = SMAX
+      TEMP1 = YEYE + SMAX*(U(J)-XEYE)
+      TEST = YINIT - TEMP1
+      IF (SGN.LT.0.0) TEST = -TEST
+      IF (TEST.GT.0.0) GO TO 310
+      TEMP2 = SMIN
+      TEMP1 = YEYE + SMIN*(U(J)-XEYE)
+      TEST = YINIT - TEMP1
+      IF (SGN.LT.0.0) TEST = -TEST
+      IF (TEST.LT.0.0) GO TO 310
+      TEMP2 = (YINIT-YEYE)/(U(J)-XEYE)
+      V(J) = YINIT
+      GO TO 320
+  300 CONTINUE
+      IF (IABS(ITCH).GE.3) GO TO 330
+      U(J) = 0.5*(X(I)+X(I-1))
+  310 CONTINUE
+      V(J) = YEYE + TEMP2*(U(J)-XEYE)
+  320 CONTINUE
+      IF (XEYE.NE.XINIT) GO TO 330
+      IF (IABS(ITCH).EQ.2) GO TO 360
+      IF (IABS(ITCH).NE.6) GO TO 330
+      IF (J.LE.2) GO TO 380
+      GO TO 390
+  330 CONTINUE
+C RECOMPUTATION OF KNOT FOR CONTINUITY
+      IF (J.LE.2) GO TO 370
+      IF (SLOPE.EQ.TEMP2) GO TO 360
+      YINIT = V(J-2)
+      IF (IABS(ITCH).LT.3) YINIT = W(J-2)
+      TEMP1 = (XEYE*TEMP2-U(J-2)*SLOPE+YINIT-YEYE)/(TEMP2-SLOPE)
+      IF (IABS(ITCH).GE.3) GO TO 350
+      IF (TEMP1.GT.XINIT) GO TO 360
+      TEST = ABS(EPSLN)
+      IDIOT = INIT - KP
+      DO 340 L=1,IDIOT
+        IT = INIT - L
+        IF (TEMP1.GE.X(IT)) GO TO 350
+        DX = Y(IT) - YEYE - TEMP2*(X(IT)-XEYE)
+        IF (ITCH.LT.0) TEST = E(IT)
+        IF (ABS(DX).GT.TEST) GO TO 360
+  340 CONTINUE
+  350 CONTINUE
+      U(J-1) = TEMP1
+      V(J-1) = YEYE + TEMP2*(U(J-1)-XEYE)
+      IF (IABS(ITCH).LT.3) W(J-1) = V(J-1)
+      GO TO 390
+  360 CONTINUE
+      W(J-1) = YEYE + TEMP2*(U(J-1)-XEYE)
+      GO TO 390
+  370 CONTINUE
+      IF (IABS(ITCH).LT.3) GO TO 360
+  380 CONTINUE
+      V(1) = YEYE + TEMP2*(U(1)-XEYE)
+  390 CONTINUE
+      SLOPE = TEMP2
+      KP = KEEP
+      IF (I.LT.N) GO TO 20
+      IF (X(N).EQ.U(J)) GO TO 400
+      IF (IABS(ITCH).LT.3) W(J) = V(J)
+      J = J + 1
+      U(J) = X(N)
+      V(J) = Y(N)
+  400 CONTINUE
+      IF (J.GE.2 .AND. IABS(ITCH).LT.3) V(1) = W(1)
+      K = J
+
+* Truncate to integer values: indices at which to sample
+
+      DO 500 I = 1, K
+         u(i) = INT(u(i))
+  500 CONTINUE
+
+      RETURN
+      END
+
+      SUBROUTINE PIECEWISE3_CHECKGAP (Y, bad_y, x, u, i, j, 
+     .   n, skipbad)
+      REAL Y(*), bad_y, x(*), u(*)
+      INTEGER i, j, n
+      LOGICAL skipbad
+
+      skipbad = .FALSE.
+	 
+      IF ( Y(i).EQ.bad_y ) THEN
+	 IF (i.GT.2) THEN
+	    u(j) = x(i-1)
+	       
+	    IF ( j .gt. 1 .and. INT(u(j)) .LT. INT(u(j-1)) ) then
+	       j = j - 1
+	       DO WHILE (INT(u(j)) .LE. INT(u(j-1)) )
+		     j = j - 1
+	       ENDDO	  
+	       u(j) = x(i-1)
+	    ENDIF
+            IF ( j .gt. 1 .and. INT(u(j)) .EQ. INT(u(j-1)) ) j = j - 1
+
+            j = j + 1
+	 ENDIF
+         DO WHILE ( Y(i).EQ.bad_y .AND. i.LT.n)
+            i = i + 1
+         ENDDO
+         
+         IF (i.GT.1) u(j) = x(i-1)
+         IF (i.GE.n) THEN
+	    i = n
+	    u(j) = x(n)
+	 ENDIF
+         IF ( j .gt. 1 .and. INT(u(j)) .EQ. INT(u(j-1)) ) j = j - 1
+
+         j = j + 1
+         u(j) = x(i)
+         IF ( j .gt. 1 .and. INT(u(j)) .EQ. INT(u(j-1)) ) j = j - 1
+
+         j = j + 1
+         skipbad = .TRUE.
+      ENDIF
+
+      RETURN
+      END
+
+
+      subroutine merge(a,na,b,nb,c,nout)
+c http://en.wikibooks.org/wiki/Algorithm_Implementation/Sorting/Merge_sort#Fortran
+! Normal usage: NA+NB = NC
+! B overlays C(NA+1:NC)
+
+! modified to return nout instead of assuming treating NC, length of C as known.
+
+      integer  NA,NB,NC         
+      REAL  A(*), B(*), C(*)
+ 
+      integer I,J,K
+ 
+      I = 1
+      J = 1
+      K = 1
+      do while(I .LE. NA .and. J .LE. NB)
+         if (A(I) .LE. B(J)) then
+            C(K) = A(I)
+            I = I+1
+         else
+            C(K) = B(J)
+            J = J+1
+         endif
+         K = K + 1
+      enddo
+      do while (I .LE. NA)
+         C(K) = A(I)
+         I = I + 1
+          K = K + 1
+      enddo
+      do while (J .LE. NB)
+         C(K) = B(J)
+         J = J+1
+         K = K + 1
+      enddo
+
+* remove duplicates
+
+      j = 1
+      do i = 2, k
+         IF (c(i) .GT. c(i-1)) then
+	    j = j + 1
+	    c(j) = c(i)
+	 endif
+      enddo
+      nout = j
+
+      return
+ 
+      end ! subroutine merge
diff --git a/external_functions/decimate/sample.jnl b/external_functions/decimate/sample.jnl
new file mode 100644
index 0000000..214c26c
--- /dev/null
+++ b/external_functions/decimate/sample.jnl
@@ -0,0 +1,184 @@
+sh sym clock_secs
+use "/home/data/socat/SOCAT2_data_table_b900_f2d1_5213.nc"
+
+
+let siz = `fco2_recomputed,return=isize`
+
+def sym rtol = $1"0.01"
+let npts = $2"`siz`"
+let parm = $3"2"
+
+
+def sym tol = ($rtol)
+def sym parm = `parm`
+
+set mem/siz=400
+
+! replace the last datum in each trajectory with the bad-value.
+
+! Normalize the Fco2 data
+stat fco2_recomputed
+let fco2_norm = (fco2_recomputed - ($stat_mean))/($stat_std)
+
+sh sym clock_secs
+let/title="`fco2_recomputed,return=title` normalized"/units="`fco2_recomputed,return=units`" \
+ fco_norm_with_gaps = separate(fco2_norm[i=1:`npts`], rowsize, 0)
+
+let/title="`fco2_recomputed,return=title`"/units="`fco2_recomputed,return=units`" \
+ fco_with_gaps = separate(fco2_recomputed[i=1:`npts`], rowsize, 0)
+
+let/units="`longitude,return=units`"/title="`longitude,return=title`" \
+ lon_with_gaps = separate(longitude[i=1:`npts`], rowsize, 1)
+
+let/title="`latitude,return=title`"/units="`latitude,return=units`" lat_with_gaps =  \
+ separate(latitude[i=1:`npts`], rowsize, 0)
+
+let npts = `lat_with_gaps,return=isize`
+
+
+! Compute and save the distance between successive lon/lat locations on the globe
+!  Takes about 8 seconds on dunkel.
+! sh sym clock_secs
+! let/title="distance on sphere"/units="m" ypts_lonlat = dist2(lon_with_gaps, lat_with_gaps, `parm`)
+! save/clobber/file="/home/data/ansley/lonlat_dist_on_sphere.nc"  ypts_lonlat
+! sh sym clock_secs
+! can var ypts_lonlat
+! pause
+
+
+
+use "/home/data/ansley/lonlat_dist_on_sphere.nc"
+! Normalize the distance on the globe.
+stat ypts_lonlat[d=2]
+let dist_norm = (ypts_lonlat[d=2] - (($stat_mean)))/($stat_std)
+
+set data 1
+
+! Sample using the piecewise linear approximation, applied to the 
+! distance along the globe of the lon-lat path.
+
+let nf = npts
+let ntol = 1
+let rest = 1
+let cont = 1
+
+let decimate_lonlat = piecewise(dist_norm, ($rtol), ntol, rest, cont)
+
+let nout_lonlat = decimate_lonlat[j=1,i=@ngd]
+sh sym clock_secs
+load decimate_lonlat
+sh sym clock_secs
+
+say Sample with Tolerance `($rtol)` on lon/lat distance on sphere: Returned `nout_lonlat` of original `nf` Points, `nout_lonlat/nf`
+pause
+
+def sym nout_lonlat = `nout_lonlat`
+say `nout_lonlat/nf`
+
+
+let xsample_on_lonlat = xsequence(decimate_lonlat[j=1,i=1:($nout_lonlat)])
+def axis/x=1:($nout_lonlat):1 xsample_axis
+let sample_on_lonlat = xsample_on_lonlat[gx=xsample_axis at asn] 
+
+
+let fco2sample_lonlat = samplei(fco_with_gaps[i=1:`npts`], sample_on_lonlat)
+let fco2norm_sample_lonlat = samplei(fco_norm_with_gaps[i=1:`npts`], sample_on_lonlat)
+let lonsample_lonlat = samplei(lon_with_gaps[i=1:`npts`], sample_on_lonlat)
+let latsample_lonlat = samplei(lat_with_gaps[i=1:`npts`], sample_on_lonlat)
+
+! Now apply the piecewise linear approximation to the remaining points, fitting
+! lines through the fco2 measurements
+
+
+def sym rtol = 10*($tol)
+
+let decimate_fco2 = piecewise(fco2norm_sample_lonlat[i=1:($nout_lonlat)], ($rtol), ntol, rest, cont)
+
+sh sym clock_secs
+def sym nout_fco2 = `decimate_fco2[j=1,i=@ngd]`
+sh sym clock_secs
+
+say Sample again on fco2, with Tolerance `($rtol)`: Returned ($nout_fco2) of previous ($nout_lonlat) Points , `($nout_fco2)/($nout_lonlat)`
+pause
+
+let sample_on_both = xsequence(decimate_fco2[j=1,i=1:($nout_lonlat)])
+
+keymark 1
+! 1000000 takes a minute to plot, interactive mode
+
+! STYLES:
+
+! /line/fast/miss=blank
+! /sym=dot/miss=blank
+
+set win/siz=0.6
+g margins 0,0,0,0
+go basemap x=-180:180 y=-90:90 20
+
+
+LET/title="`fco2_recomputed,return=title` sampled"/units="`fco2_recomputed,return=units`" \
+ fco2sample = samplei(fco2sample_lonlat[i=1:($nout_lonlat)], sample_on_both)
+
+LET/title="`longitude,return=title`"/units="`longitude,return=units`" \
+ lonsample = samplei(lonsample_lonlat[i=1:($nout_lonlat)], sample_on_both)
+
+LET/title="`latitude,return=title`"/units="`latitude,return=units`" \
+ latsample = samplei(latsample_lonlat[i=1:($nout_lonlat)], sample_on_both)
+
+
+def sym plottitle = "`fco2_recomputed,return=title`<nl>($plottitle)" 
+def sym vlevels = (-inf)(160,260,20)(260,450,10)(440,560,20)(inf)
+
+let ribbon = 1
+IF `ribbon EQ 1` THEN
+
+sh sym clock_secs
+plot/over/pal=rnb/vs/ribbon/line/miss=blank/nolab/levels=($vlevels)/key lonsample, latsample, fco2sample
+sh sym clock_secs
+pause
+frame/file=sample_ribbon.gif
+
+exit/script
+ENDIF  ! ribbon
+
+! or
+
+
+!  Plot the twice-sampled data.
+! Note it doesn't help things to pre-load lonsample, latsample etc
+! when we define vars in GO POLYMARK, the uvars all get purged.
+
+let twice = 1
+
+if `twice EQ 1` THEN
+
+
+  sh sym clock_secs
+  go polymark poly/over/pal=rnb/nolab/levels=($vlevels)/key \
+  lonsample latsample fco2sample square 0.15
+  sh sym clock_secs
+
+
+!  label/nouser `($ppl$xlen)/2`, -0.8, 0, 0, 0.12, \
+!  @CR2-step decimation. lon/lat distance, parm ($parm): Sample w/ piecwise linear approx,<nl>\
+!  1st on path distance, then on fCO2. Start `npts` to ($($nout_fco2)) pts
+  frame/file=sample_tol($tol)_parm($parm).gif
+
+
+ELSE
+
+
+!  Plot the data sampled only using path distance.
+
+set mode diag
+  sh sym clock_secs
+  go polymark poly/over/pal=rnb/nolab/levels=($vlevels)/key \
+  lonsample_lonlat latsample_lonlat fco2sample_lonlat square 0.15
+sh sym clock_secs
+
+!  label/nouser `($ppl$xlen)/2`, -0.8, 0, 0, 0.12, \
+!  @CR2-step decimation. lon/lat distance, parm ($parm): Sample w/ piecwise linear approx,<nl>\
+!  only on path distance, (not on fCO2). Start `npts` to ($nout_lonlat) pts
+  frame/file=sample_tol($tol)_parm($parm)_distance_only.gif
+
+ENDIF
\ No newline at end of file
diff --git a/external_functions/decimate/sample3.jnl b/external_functions/decimate/sample3.jnl
new file mode 100644
index 0000000..4daf69c
--- /dev/null
+++ b/external_functions/decimate/sample3.jnl
@@ -0,0 +1,90 @@
+use "/home/data/socat/SOCAT2_data_table_b900_f2d1_5213.nc"
+
+
+let siz = `fco2_recomputed,return=isize`
+
+let rtol = $1"1"
+let npts = $2"`siz`"
+IF `npts gt 500000` THEN set mem/siz=200
+
+sh sym clock_secs
+let/title="`fco2_recomputed,return=title`"/units="`fco2_recomputed,return=units`"  \
+ fco_with_gaps = separate(fco2_recomputed[i=1:`npts`], rowsize)
+
+! stat fco2_recomputed[i=1:`npts`]
+! let fcn = (fco_with_gaps[i=1:`npts`]-(($stat_mean)))/($stat_std)
+! let fc = missing(fcn,0)
+
+let/units="`longitude,return=units`"/title="`longitude,return=title`" \
+lon_with_gaps = separate(longitude[i=1:`npts`], rowsize)
+
+! stat longitude[i=1:`npts`]
+!let/units="`longitude,return=units`"/title="`longitude,return=title` (moduloed)" \
+! lon_mod = lon_modx(lon_with_gaps[i=1:`npts`])
+! let lon = (lon_mod[i=1:`npts`]-(($stat_mean)))/($stat_std)
+
+let/title="`latitude,return=title`"/units="`latitude,return=units`" \
+ lat_with_gaps = separate(latitude[i=1:`npts`], rowsize)
+
+! stat latitude[i=1:`npts`]
+! let lat = (lat_with_gaps[i=1:`npts`]-(($stat_mean)))/($stat_std)
+
+! let ypts = fc+lon+lat
+
+let ypts = dist3(fco_with_gaps, lon_with_gaps, lat_with_gaps)
+
+load ypts
+sh sym clock_secs
+pause
+
+let nf = npts
+let ntol = 1
+let rest = 1
+let cont = 1
+
+keymark 1
+
+let decimate = piecewise(ypts, rtol,  ntol, rest, cont)
+
+let nout = decimate[j=1,i=@ngd]
+sh sym clock_secs
+load decimate
+sh sym clock_secs
+
+def sym plottitle = Sampled with Tolerance `rtol`: Returned `nout` of original `nf` Points
+let sample_pts = xsequence(decimate[j=1,i=1:`nout`])
+
+! 1000000 takes a minute to plot, interactive mode
+
+! STYLES:
+
+! /line/fast/miss=blank
+! /sym=dot/miss=blank
+
+go basemap x=-180:180 y=-90:90 20
+
+
+let/title="`fco2_recomputed,return=title` sampled"/units="`fco2_recomputed,return=units`" fco2sample = samplei(fco_with_gaps[i=1:`npts`], sample_pts)
+LET/units="`longitude,return=units`"/title="`longitude,return=title`" lonsample = samplei(lon_mod[i=1:`npts`], sample_pts)
+LET/units="`latitude,return=units`"/title="`latitude,return=title`" latsample = samplei(lat_with_gaps[i=1:`npts`], sample_pts)
+
+
+def sym plottitle = "`fco2_recomputed,return=title`<nl>($plottitle)" 
+def sym vlevels = (-inf)(160,260,20)(260,450,10)(440,560,20)(inf)
+
+sh sym clock_secs
+!plot/over/pal=rnb/vs/ribbon/sym=dot/miss=blank/nolab/levels=($vlevels)/key lonsample, latsample, fco2sample
+!sh sym clock_secs
+
+!frame/file=sample_ribbon.gif
+
+! or
+
+go polymark poly/over/pal=rnb/nolab/levels=($vlevels)/key lonsample, latsample, fco2sample, square, 0.075
+sh sym clock_secs
+frame/file=sample_poly.gif
+
+
+let x_var_data = lonsample
+let y_var_data = latsample
+let var_data = fco2sample
diff --git a/external_functions/decimate/sample_fast_i.F b/external_functions/decimate/sample_fast_i.F
new file mode 100644
index 0000000..cde1d05
--- /dev/null
+++ b/external_functions/decimate/sample_fast_i.F
@@ -0,0 +1,167 @@
+*  sample_fast_i.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Ansley Manke June 2013
+* Sample variable using a set of indices.
+*
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sample_fast_i_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Fast 1D sample variable using set of indices' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id, IMPLIED_BY_ARGS, NORMAL, 
+     .                             NORMAL, NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 'Variable to sample')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'Indices')
+      CALL ef_set_arg_desc(id, arg, 'List of indices at which to sample ')
+      CALL ef_set_axis_influence_6d(id, arg, YES, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE sample_fast_i_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* Function is intended only for variables in the x direction
+
+      REAL arg_1(mem1lox:mem1hix)
+      REAL arg_2(mem2lox:mem2hix)
+      REAL result(memreslox:memreshix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER	i, i2, isample
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+      
+         result(i) = bad_flag_result
+         IF (arg_2(i2) .NE. bad_flag_result) THEN
+            isample = INT(arg_2(i2))
+            result(i) = arg_1(isample)
+	 ENDIF
+	 i2 = i2 + arg_incr(X_AXIS,ARG2)
+  100 CONTINUE
+
+      RETURN
+
+      RETURN
+      END
diff --git a/external_functions/decimate/separate.F b/external_functions/decimate/separate.F
new file mode 100644
index 0000000..48b3b29
--- /dev/null
+++ b/external_functions/decimate/separate.F
@@ -0,0 +1,254 @@
+*  separate.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Ansley Manke June 2013
+* Given a data variable and a ROWSIZE indicating trajectory length,
+* Insert a bad-value between trajectories.
+*
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE separate_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Insert a bad-value between features' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id, ABSTRACT, NORMAL, NORMAL, 
+     .                                             NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'variable to sample on I axis')
+      CALL ef_set_axis_influence_6d(id, arg, YES, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'Rowsize')
+      CALL ef_set_arg_desc(id, arg,
+     .          'array with per-feature row lengths')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'FixLongitudes')
+      CALL ef_set_arg_desc(id, arg,
+     .          '1 if A is longitudes needing modulo fixes, 0 otherwise')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+      SUBROUTINE separate_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*     Use utility functions  to get context information about the arguments.
+*     indices.
+
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS), arg_hi_ss(6,EF_MAX_ARGS),
+     .     arg_incr(6,EF_MAX_ARGS)
+
+      INTEGER nx, nr, lo_lim, hi_lim
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+
+* will add a point for each row
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      nr = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss( E_AXIS, ARG2) + 1
+
+      lo_lim = 1
+      hi_lim = nx + nr - 1
+      CALL ef_set_axis_limits(id, X_AXIS, lo_lim, hi_lim)
+
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE separate_compute(id, arg_1, arg_2, arg_3, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+! We just know this is on the X axis and will be passed in and out correct.y.
+      REAL result(memreslox:memreshix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, i1, ir, k, m
+      INTEGER nx, ne, msum, rend
+      REAL fixlon, tol, nothing
+      LOGICAL ifix
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      k = res_lo_ss(Z_AXIS)  ! index for unused dimensions
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+
+      CALL ef_get_one_val(id, arg3, fixlon)
+      ifix =  (fixlon .GT. 0.8)
+      tol = 200.
+
+      i1 = 1
+      ir = 1
+      msum = 0
+      DO m = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS, ARG2)
+         rend = arg_2(k,k,k,k,m,k)
+	 msum = msum + rend
+	 IF (msum .GT. nx) msum = nx+1
+	 DO i = i1, msum
+	    result(ir) = arg_1(i,k,k,k,k,k)
+	    IF (ir.GT.1 .AND. ifix .AND. 
+     .              result(ir ).NE.bad_flag_result .AND. 
+     .              result(ir-1).NE.bad_flag_result) THEN
+	       IF ( result(ir)-result(ir-1) .GT. tol) 
+     .               result(ir) = result(ir) - 360.
+	       IF ( result(ir)-result(ir-1) .LT. -1*tol) 
+     .               result(ir) = result(ir) + 360.
+               
+            ENDIF
+	    ir = ir + 1
+	    IF (ir .GT. res_hi_ss(X_AXIS)) GOTO 9000
+	 ENDDO
+	 i1 = msum+1
+	 result(ir) = bad_flag_result
+	 ir = ir + 1
+	 IF (ir .GT. res_hi_ss(X_AXIS)) GOTO 9000
+      ENDDO
+
+ 9000 RETURN
+c 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
diff --git a/external_functions/ef_utility/ferret_cmn/EF_Util.cmn b/external_functions/ef_utility/ferret_cmn/EF_Util.cmn
new file mode 100644
index 0000000..f012ec8
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_Util.cmn
@@ -0,0 +1,80 @@
+c* EF_Util.cmn
+c*
+c* Jonathan Callahan
+c* July 10th 1997
+c*
+c* This is the header file to be included by routines which
+c* are part of the Ferret External Function library.
+c*
+c*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+c* 
+c*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+c* 
+c*                 *ac* 7.99 Added unspecified_int4
+c*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+c*				because of conflict with same-name parameter
+c*				in ferret.parm
+c*                 *ac* 9.99 Separate EF_Util.parm which is all that's needed 
+c*                           in the utility fcns in fer/ef_utility and the 
+c*                           EXTERNAL statements, to be included in EF code.
+c*                 *ac* 5/06 Add ef_set_result_type
+c*
+c*            1.4: *kms*  3/12 Add Fortran interfacing C functions; add _6d functions
+c*
+
+      INCLUDE 'ferret_cmn/EF_Util.parm'
+
+      EXTERNAL ef_bail_out
+      EXTERNAL ef_get_arg_info
+      EXTERNAL ef_get_arg_mem_subscripts
+      EXTERNAL ef_get_arg_mem_subscripts_6d
+      EXTERNAL ef_get_arg_ss_extremes
+      EXTERNAL ef_get_arg_ss_extremes_6d
+      EXTERNAL ef_get_arg_string
+      EXTERNAL ef_get_arg_subscripts
+      EXTERNAL ef_get_arg_subscripts_6d
+      EXTERNAL ef_get_arg_type
+      EXTERNAL ef_get_axis_dates
+      EXTERNAL ef_get_axis_info
+      EXTERNAL ef_get_axis_info_6d
+      EXTERNAL ef_get_axis_modulo_len
+      EXTERNAL ef_get_bad_flags
+      EXTERNAL ef_get_box_hi_lim
+      EXTERNAL ef_get_box_limits
+      EXTERNAL ef_get_box_lo_lim
+      EXTERNAL ef_get_box_size
+      EXTERNAL ef_get_coordinates
+      EXTERNAL ef_get_one_val
+      EXTERNAL ef_get_res_mem_subscripts
+      EXTERNAL ef_get_res_mem_subscripts_6d
+      EXTERNAL ef_get_res_subscripts
+      EXTERNAL ef_get_res_subscripts_6d
+      EXTERNAL ef_get_result_type
+      EXTERNAL ef_get_wrk_mem_subscripts
+      EXTERNAL ef_get_wrk_mem_subscripts_6d
+      EXTERNAL ef_set_arg_desc
+      EXTERNAL ef_set_arg_name
+      EXTERNAL ef_set_arg_type
+      EXTERNAL ef_set_arg_unit
+      EXTERNAL ef_set_axis_extend
+      EXTERNAL ef_set_axis_influence
+      EXTERNAL ef_set_axis_influence_6d
+      EXTERNAL ef_set_axis_inheritance
+      EXTERNAL ef_set_axis_inheritance_6d
+      EXTERNAL ef_set_axis_limits
+      EXTERNAL ef_set_axis_reduction
+      EXTERNAL ef_set_axis_reduction_6d
+      EXTERNAL ef_set_custom_axis
+      EXTERNAL ef_set_desc
+      EXTERNAL ef_set_has_vari_args
+      EXTERNAL ef_set_num_args
+      EXTERNAL ef_set_num_work_arrays
+      EXTERNAL ef_set_piecemeal_ok
+      EXTERNAL ef_set_piecemeal_ok_6d
+      EXTERNAL ef_set_result_type
+      EXTERNAL ef_set_work_array_dims
+      EXTERNAL ef_set_work_array_dims_6d
+      EXTERNAL ef_set_work_array_lens
+      EXTERNAL ef_set_work_array_lens_6d
+      EXTERNAL ef_version_test
+
diff --git a/external_functions/ef_utility/ferret_cmn/EF_Util.parm b/external_functions/ef_utility/ferret_cmn/EF_Util.parm
new file mode 100644
index 0000000..8b05a7a
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_Util.parm
@@ -0,0 +1,79 @@
+c* EF_Util.parm
+c*
+c* Jonathan Callahan
+c* July 10th 1997
+c*
+c* This is the header file to be included by routines which
+c* are part of the Ferret External Function library.
+c*
+c*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+c* 
+c*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+c* 
+c*                 *ac* 7.99 Added unspecified_int4
+c*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+c*				because of conflict with same-name parameter
+c*				in ferret.parm
+c*		   *ac* 9.99 Separate the parameters (previously EF_Util.cmn)  
+c*				external statements which will be included
+c*				in external functions code.
+c*		   *kob* 1/02 - add in int_buff and size_ibuff to use for
+c*                              strings being converted from c to fortran
+c*                 *acm* 1/03 - Add float_return and string_return
+c*           V6.02 *acm*11/06 - Change unspecified_int4 to -999. Fixes bug 1463 where
+c*                              where an index value of -111 was confused with this flag
+c*	     V6.8  *acm* 1/12 - Double precision Ferret. Declare arguments
+c*				and function results with either 2 or 1 as
+c*				the first (extra) dimension
+c*                 *kms* 2/12 - added e_axis and f_axis; increment ef_version 
+c*                 *kms* 3/12 - remove int_buff and size_ibuff since they are
+c*                              not in a common block (declare locally when needed)
+
+	integer ef_c, ef_f, yes, no,
+     .      x_axis, y_axis, z_axis, t_axis, e_axis, f_axis,
+     .      arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
+     .      custom, implied_by_args, normal, abstract,
+     .      retained, reduced, float_arg, string_arg, 
+     .	    ef_max_args, ef_max_work_arrays, ef_max_name_length, 
+     .      ef_max_description, ef_unspecified_int4,
+     .      float_return, string_return
+
+	parameter ( ef_c = 1,
+     .	            ef_f = 2,
+     .	            yes = 1,
+     .	            no = 0, 
+     .	            x_axis=1, 
+     .	            y_axis=2, 
+     .	            z_axis=3, 
+     .	            t_axis=4, 
+     .	            e_axis=5, 
+     .	            f_axis=6, 
+     .              arg1 = 1,
+     .              arg2 = 2,
+     .              arg3 = 3,
+     .              arg4 = 4,
+     .              arg5 = 5,
+     .              arg6 = 6,
+     .              arg7 = 7,
+     .              arg8 = 8,
+     .              arg9 = 9,
+     .	            custom = 101, 
+     .	            implied_by_args=102, 
+     .	            normal = 103, 
+     .	            abstract = 104, 
+     .              retained = 201,
+     .              reduced = 202,
+     .              float_arg = 1,
+     .              string_arg = 2,
+     .	            ef_max_args=9, 
+     .	            ef_max_work_arrays=9, 
+     .	            ef_max_name_length=40, 
+     .	            ef_max_description = 128, 
+     .	            ef_unspecified_int4 = -999,
+     .              float_return = 1,
+     .              string_return = 2)
+
+	real ef_version
+
+	parameter (ef_version = 1.4) 
+
diff --git a/external_functions/ef_utility/ferret_cmn/EF_Util_f90.inc b/external_functions/ef_utility/ferret_cmn/EF_Util_f90.inc
new file mode 100644
index 0000000..93a2378
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_Util_f90.inc
@@ -0,0 +1,81 @@
+!* EF_Util_f90.inc
+!*
+!* Jonathan Callahan
+!* July 10th 1997
+!*
+!* This is the header file to be included by routines which
+!* are part of the Ferret External Function library.
+!*
+!*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+!* 
+!*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+!* 
+!*                 *ac* 7.99 Added unspecified_int4
+!*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+!*				because of conflict with same-name parameter
+!*				in ferret.parm
+!*                 *ac* 9.99 Separate EF_Util.parm which is all that's needed 
+!*                           in the utility fcns in fer/ef_utility and the 
+!*                           EXTERNAL statements, to be included in EF code.
+!*                 *ac* 5/06 Add ef_set_result_type
+!*
+!*            1.4: *kms*  3/12 Add Fortran interfacing C functions; add _6d functions
+!*
+!* Converted to f90 by Andrew Wittenberg, 8/14/2012
+
+      INCLUDE 'ferret_cmn/EF_Util_f90.parm'
+
+      EXTERNAL ef_bail_out
+      EXTERNAL ef_get_arg_info
+      EXTERNAL ef_get_arg_mem_subscripts
+      EXTERNAL ef_get_arg_mem_subscripts_6d
+      EXTERNAL ef_get_arg_ss_extremes
+      EXTERNAL ef_get_arg_ss_extremes_6d
+      EXTERNAL ef_get_arg_string
+      EXTERNAL ef_get_arg_subscripts
+      EXTERNAL ef_get_arg_subscripts_6d
+      EXTERNAL ef_get_arg_type
+      EXTERNAL ef_get_axis_dates
+      EXTERNAL ef_get_axis_info
+      EXTERNAL ef_get_axis_info_6d
+      EXTERNAL ef_get_axis_modulo_len
+      EXTERNAL ef_get_bad_flags
+      EXTERNAL ef_get_box_hi_lim
+      EXTERNAL ef_get_box_limits
+      EXTERNAL ef_get_box_lo_lim
+      EXTERNAL ef_get_box_size
+      EXTERNAL ef_get_coordinates
+      EXTERNAL ef_get_one_val
+      EXTERNAL ef_get_res_mem_subscripts
+      EXTERNAL ef_get_res_mem_subscripts_6d
+      EXTERNAL ef_get_res_subscripts
+      EXTERNAL ef_get_res_subscripts_6d
+      EXTERNAL ef_get_result_type
+      EXTERNAL ef_get_wrk_mem_subscripts
+      EXTERNAL ef_get_wrk_mem_subscripts_6d
+      EXTERNAL ef_set_arg_desc
+      EXTERNAL ef_set_arg_name
+      EXTERNAL ef_set_arg_type
+      EXTERNAL ef_set_arg_unit
+      EXTERNAL ef_set_axis_extend
+      EXTERNAL ef_set_axis_influence
+      EXTERNAL ef_set_axis_influence_6d
+      EXTERNAL ef_set_axis_inheritance
+      EXTERNAL ef_set_axis_inheritance_6d
+      EXTERNAL ef_set_axis_limits
+      EXTERNAL ef_set_axis_reduction
+      EXTERNAL ef_set_axis_reduction_6d
+      EXTERNAL ef_set_custom_axis
+      EXTERNAL ef_set_desc
+      EXTERNAL ef_set_has_vari_args
+      EXTERNAL ef_set_num_args
+      EXTERNAL ef_set_num_work_arrays
+      EXTERNAL ef_set_piecemeal_ok
+      EXTERNAL ef_set_piecemeal_ok_6d
+      EXTERNAL ef_set_result_type
+      EXTERNAL ef_set_work_array_dims
+      EXTERNAL ef_set_work_array_dims_6d
+      EXTERNAL ef_set_work_array_lens
+      EXTERNAL ef_set_work_array_lens_6d
+      EXTERNAL ef_version_test
+
diff --git a/external_functions/ef_utility/ferret_cmn/EF_Util_f90.parm b/external_functions/ef_utility/ferret_cmn/EF_Util_f90.parm
new file mode 100644
index 0000000..37956a9
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_Util_f90.parm
@@ -0,0 +1,44 @@
+!* EF_Util_f90.parm
+!*
+!* Jonathan Callahan
+!* July 10th 1997
+!*
+!* This is the header file to be included by routines which
+!* are part of the Ferret External Function library.
+!*
+!*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+!*
+!*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+!*
+!*                 *ac* 7.99 Added unspecified_int4
+!*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+!*				because of conflict with same-name parameter
+!*				in ferret.parm
+!*		   *ac* 9.99 Separate the parameters (previously EF_Util.cmn)
+!*				external statements which will be included
+!*				in external functions code.
+!*		   *kob* 1/02 - add in int_buff and size_ibuff to use for
+!*                              strings being converted from c to fortran
+!*                 *acm* 1/03 - Add float_return and string_return
+!*           V6.02 *acm*11/06 - Change unspecified_int4 to -999. Fixes bug 1463 where
+!*                              where an index value of -111 was confused with this flag
+!*	     V6.8  *acm* 1/12 - Double precision Ferret. Declare arguments
+!*				and function results with either 2 or 1 as
+!*				the first (extra) dimension
+!*                 *kms* 2/12 - added e_axis and f_axis; increment ef_version
+!*                 *kms* 3/12 - remove int_buff and size_ibuff since they are
+!*                              not in a common block (declare locally when needed)
+!*
+!* Converted to f90 by Andrew Wittenberg, 8/14/2012
+
+integer, parameter :: ef_c = 1, ef_f = 2, yes = 1, no = 0
+integer, parameter :: x_axis=1, y_axis=2, z_axis=3, t_axis=4, e_axis=5, f_axis=6
+integer, parameter :: arg1=1, arg2=2, arg3=3, arg4=4, arg5=5, arg6=6,  arg7=7, arg8=8, arg9=9
+integer, parameter :: custom=101, implied_by_args=102, normal=103, abstract=104, retained=201
+integer, parameter :: reduced=202, float_arg=1, string_arg=2
+integer, parameter :: ef_max_args=9, ef_max_work_arrays=9, ef_max_name_length=40
+integer, parameter :: ef_max_description=128,  ef_unspecified_int4=-999
+integer, parameter :: float_return=1, string_return=2
+
+real, parameter :: ef_version = 1.4
+
diff --git a/external_functions/ef_utility/ferret_cmn/EF_mem_subsc.cmn b/external_functions/ef_utility/ferret_cmn/EF_mem_subsc.cmn
new file mode 100644
index 0000000..9d209de
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_mem_subsc.cmn
@@ -0,0 +1,147 @@
+* EF_mem_subsc.cmn - COMMON/ EF_MEM_SUBSC /
+*
+* Jonathan Callahan
+* September, 1998
+*
+* Subscript limits required to use adjustable array declarations in external
+* functions.  The "mem" subscripts will dimension arrays for Ferret
+* "memory resident" values (variables) while the "wrk" arrays are
+* dimension "working storage" arrays which are requested by the external
+* function.
+*
+* The subroutine efcn_compute will copy the contents of xmem_subsc.cmn
+* to the "mem" values before calling the external function's '_compute'
+* routine.  The "wrk" values will also be filled in at this time.
+*
+* 2/12 *kms* add E and F dimensions
+*            moved to EF_mem_subsc.defcmn so EF_mem_subsc is the external declaration
+* 6/12 *kms* added EXTERNAL since this block is part of Ferret
+* 8/12 *kms* added FERRET_ prefix to common block name to identify source 
+*            (primarily for PyFerret where this becomes global under Python)
+*
+
+*************************************************************************
+******                  PARAMETER DEFINITIONS                      ******
+
+        INTEGER     ef_max_mem_args
+        PARAMETER ( ef_max_mem_args = 12 )
+
+        EXTERNAL FERRET_EF_MEM_SUBSC
+        COMMON / FERRET_EF_MEM_SUBSC /
+     .      mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox,
+     .      mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox,
+     .      mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy,
+     .      mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy,
+     .      mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz,
+     .      mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz,
+     .      mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot,
+     .      mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot,
+     .      mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe,
+     .      mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe,
+     .      mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof,
+     .      mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof,
+     .
+     .      memreslox, memresloy, memresloz,
+     .      memreslot, memresloe, memreslof,
+     .
+     .      mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix,
+     .      mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix,
+     .      mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy,
+     .      mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy,
+     .      mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz,
+     .      mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz,
+     .      mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit,
+     .      mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit,
+     .      mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie,
+     .      mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie,
+     .      mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif,
+     .      mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif,
+     .
+     .      memreshix, memreshiy, memreshiz,
+     .      memreshit, memreshie, memreshif,
+     .
+     .      wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox,
+     .      wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox,
+     .      wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy,
+     .      wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy,
+     .      wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz,
+     .      wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz,
+     .      wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot,
+     .      wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot,
+     .      wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe,
+     .      wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe,
+     .      wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof,
+     .      wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof,
+     .
+     .      wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix,
+     .      wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix,
+     .      wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy,
+     .      wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy,
+     .      wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz,
+     .      wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz,
+     .      wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit,
+     .      wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit,
+     .      wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie,
+     .      wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie,
+     .      wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif,
+     .      wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
+
+        INTEGER
+     .      mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox,
+     .      mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox,
+     .      mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy,
+     .      mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy,
+     .      mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz,
+     .      mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz,
+     .      mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot,
+     .      mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot,
+     .      mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe,
+     .      mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe,
+     .      mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof,
+     .      mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof,
+     .
+     .      memreslox, memresloy, memresloz,
+     .      memreslot, memresloe, memreslof,
+     .
+     .      mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix,
+     .      mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix,
+     .      mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy,
+     .      mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy,
+     .      mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz,
+     .      mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz,
+     .      mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit,
+     .      mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit,
+     .      mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie,
+     .      mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie,
+     .      mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif,
+     .      mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif,
+     .
+     .      memreshix, memreshiy, memreshiz,
+     .      memreshit, memreshie, memreshif,
+     .
+     .      wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox,
+     .      wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox,
+     .      wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy,
+     .      wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy,
+     .      wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz,
+     .      wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz,
+     .      wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot,
+     .      wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot,
+     .      wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe,
+     .      wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe,
+     .      wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof,
+     .      wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof,
+     .
+     .      wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix,
+     .      wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix,
+     .      wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy,
+     .      wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy,
+     .      wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz,
+     .      wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz,
+     .      wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit,
+     .      wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit,
+     .      wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie,
+     .      wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie,
+     .      wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif,
+     .      wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
+
diff --git a/external_functions/ef_utility/ferret_cmn/EF_mem_subsc_f90.inc b/external_functions/ef_utility/ferret_cmn/EF_mem_subsc_f90.inc
new file mode 100644
index 0000000..861ac2a
--- /dev/null
+++ b/external_functions/ef_utility/ferret_cmn/EF_mem_subsc_f90.inc
@@ -0,0 +1,147 @@
+! EF_mem_subsc_f90.inc - COMMON/ EF_MEM_SUBSC /
+!
+! Jonathan Callahan
+! September, 1998
+!
+! Subscript limits required to use adjustable array declarations in external
+! functions.  The "mem" subscripts will dimension arrays for Ferret
+! "memory resident" values (variables) while the "wrk" arrays are
+! dimension "working storage" arrays which are requested by the external
+! function.
+!
+! The subroutine efcn_compute will copy the contents of xmem_subsc.cmn
+! to the "mem" values before calling the external function's '_compute'
+! routine.  The "wrk" values will also be filled in at this time.
+!
+! 2/12 *kms* add E and F dimensions
+!            moved to EF_mem_subsc.defcmn so EF_mem_subsc is the external declaration
+! 6/12 *kms* added EXTERNAL since this block is part of Ferret
+! 8/12 *kms* added FERRET_ prefix to common block name to identify source 
+!            (primarily for PyFerret where this becomes global under Python)
+!
+! Modified for f90 by Andrew Wittenberg, 8/14/2012
+!
+
+!************************************************************************
+!*****                  PARAMETER DEFINITIONS                      ******
+
+        INTEGER, PARAMETER :: ef_max_mem_args = 12
+
+        EXTERNAL FERRET_EF_MEM_SUBSC
+        COMMON / FERRET_EF_MEM_SUBSC / &
+            mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox, &
+            mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox, &
+            mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy, &
+            mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy, &
+            mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz, &
+            mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz, &
+            mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot, &
+            mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot, &
+            mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe, &
+            mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe, &
+            mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof, &
+            mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof, &
+
+            memreslox, memresloy, memresloz, &
+            memreslot, memresloe, memreslof, &
+
+            mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix, &
+            mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix, &
+            mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy, &
+            mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy, &
+            mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz, &
+            mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz, &
+            mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit, &
+            mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit, &
+            mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie, &
+            mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie, &
+            mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif, &
+            mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif, &
+
+            memreshix, memreshiy, memreshiz, &
+            memreshit, memreshie, memreshif, &
+
+            wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox, &
+            wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox, &
+            wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy, &
+            wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy, &
+            wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz, &
+            wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz, &
+            wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot, &
+            wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot, &
+            wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe, &
+            wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe, &
+            wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof, &
+            wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof, &
+
+            wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix, &
+            wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix, &
+            wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy, &
+            wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy, &
+            wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz, &
+            wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz, &
+            wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit, &
+            wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit, &
+            wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie, &
+            wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie, &
+            wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif, &
+            wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
+
+        INTEGER :: &
+            mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox, &
+            mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox, &
+            mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy, &
+            mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy, &
+            mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz, &
+            mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz, &
+            mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot, &
+            mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot, &
+            mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe, &
+            mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe, &
+            mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof, &
+            mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof, &
+
+            memreslox, memresloy, memresloz, &
+            memreslot, memresloe, memreslof, &
+
+            mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix, &
+            mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix, &
+            mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy, &
+            mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy, &
+            mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz, &
+            mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz, &
+            mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit, &
+            mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit, &
+            mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie, &
+            mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie, &
+            mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif, &
+            mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif, &
+
+            memreshix, memreshiy, memreshiz, &
+            memreshit, memreshie, memreshif, &
+
+            wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox, &
+            wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox, &
+            wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy, &
+            wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy, &
+            wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz, &
+            wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz, &
+            wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot, &
+            wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot, &
+            wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe, &
+            wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe, &
+            wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof, &
+            wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof, &
+
+            wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix, &
+            wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix, &
+            wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy, &
+            wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy, &
+            wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz, &
+            wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz, &
+            wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit, &
+            wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit, &
+            wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie, &
+            wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie, &
+            wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif, &
+            wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
diff --git a/external_functions/ef_utility/platform_specific.mk.i386-apple-darwin b/external_functions/ef_utility/platform_specific.mk.i386-apple-darwin
new file mode 100644
index 0000000..390f2c5
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.i386-apple-darwin
@@ -0,0 +1,37 @@
+#
+# platform_specific_includes.mk.i386-linux
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+# ACM 2/2001 debug flags
+
+INCLUDES        = -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG        =
+CC              = gcc
+RANLIB          = /usr/bin/ranlib
+CFLAGS          = -fPIC -Dlint -DVOID_SIGHANDLER -D_POSIX_VERSION -DDARWIN -DFULL_GUI_VERSION -O2 -DX_REFRESH -DXT_CODE $(INCLUDES)
+FC              = gfortran 
+F77		= gfortran
+F77SHFLAG       = 
+FFLAGS          = -fPIC -Dunix -Dgfortran -fno-second-underscore -fno-backslash -fdollar-ok -ffixed-line-length-132 \
+		  -fdefault-real-8 -fdefault-double-8 $(INCLUDES)
+LD		= gcc
+LD_DYN_FLAGS    = -dynamiclib -Wl,-undefined,dynamic_lookup  
+SYSLIBS         = 
+
+CPP             = /lib/gcc
+CPP_FLAGS       = -P -traditional -Ddouble_p $(INCLUDES)
+CFLAGS_DEBUG	= -g -Ddebug
+FFLAGS_DEBUG	= -g -Ddebug
+FER_LOCAL_EXTFCNS = /usr/local/src/FERRET/external_functions/libs
+
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#.F.so:
+#	$(FC) $(FFLAGS) $(<F)
+#	$(LD) $(LD_DYN_FLAGS) $*.o -o $*.so
+
+# gcc -dynamiclib -Wl,-undefined,dynamic_lookup -o add_9.dylib add_9.o
+#    gcc -dynamiclib -Wl,-undefined,dynamic_lookup -o .so .o
diff --git a/external_functions/ef_utility/platform_specific.mk.i386-linux b/external_functions/ef_utility/platform_specific.mk.i386-linux
new file mode 100644
index 0000000..7193446
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.i386-linux
@@ -0,0 +1,49 @@
+#
+# platform_specific_includes.mk.i386-linux
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+# ACM 2/2001 debug flags
+
+# this assumes INSTALL_FER_DIR and PYTHON_EXE has already been defined
+# in site_specific.mk
+
+INCLUDES	= -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG	=
+CC		= gcc
+CFLAGS		= -fPIC -m32 -Ddouble_p -O $(INCLUDES)
+
+FC		= gfortran
+F77		= gfortran
+F77SHFLAG	=
+FFLAGS		= -fPIC -m32 -Ddouble_p -fno-second-underscore \
+		  -fno-backslash -fdollar-ok -ffixed-line-length-132 -malign-double \
+		  -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES)
+
+RANLIB		= /usr/bin/ranlib
+
+LD		= gfortran
+LD_DYN_FLAGS	= -fPIC -m32 -shared -Wl,--no-undefined
+SYSLIBS		= -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret -lpyferret
+
+CPP		= /lib/cpp
+CPP_FLAGS	= -P -traditional -Ddouble_p $(INCLUDES)
+CFLAGS_DEBUG	= -O0 -g -Ddebug
+FFLAGS_DEBUG	= -O0 -g -fbounds-check -Ddebug
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
diff --git a/external_functions/ef_utility/platform_specific.mk.i386-linux-gnu b/external_functions/ef_utility/platform_specific.mk.i386-linux-gnu
new file mode 100644
index 0000000..651ce81
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.i386-linux-gnu
@@ -0,0 +1,49 @@
+#
+# platform_specific_includes.mk.i386-linux-gnu
+# (for Ubuntu and other "free" Linux distributions)
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+
+# this assumes INSTALL_FER_DIR and PYTHON_EXE has already been defined
+# in site_specific.mk
+
+INCLUDES	= -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG	=
+CC		= gcc
+CFLAGS		= -fPIC -m32 -Ddouble_p -O $(INCLUDES)
+
+FC		= gfortran
+F77		= gfortran
+F77SHFLAG	=
+FFLAGS		= -fPIC -m32 -Ddouble_p -fno-second-underscore \
+		  -fno-backslash -fdollar-ok -ffixed-line-length-132 -malign-double \
+		  -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES)
+
+RANLIB		= /usr/bin/ranlib
+
+LD		= gfortran
+LD_DYN_FLAGS	= -fPIC -m32 -shared -Wl,--no-undefined
+SYSLIBS		= -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret -lpyferret
+
+CPP		= /lib/cpp
+CPP_FLAGS	= -P -traditional -Ddouble_p $(INCLUDES)
+CFLAGS_DEBUG	= -O0 -g -Ddebug
+FFLAGS_DEBUG	= -O0 -g -fbounds-check -Ddebug
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
diff --git a/external_functions/ef_utility/platform_specific.mk.intel-mac b/external_functions/ef_utility/platform_specific.mk.intel-mac
new file mode 100644
index 0000000..d32f996
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.intel-mac
@@ -0,0 +1,42 @@
+#
+# platform_specific_includes.mk.intel-mac
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+# ACM 2/2001 debug flags
+
+# this assumes INSTALL_FER_DIR and PYTHON_EXE has already been defined
+# in site_specific.mk
+
+INCLUDES	= -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG	=
+CC		= gcc
+CFLAGS		= -fPIC -m64 -Ddouble_p -DHAVE_STDDEF_H -DHAVE_UNISTD_H \
+		  -O $(INCLUDES)
+
+FC		= gfortran
+F77		= gfortran
+F77SHFLAG	=
+FFLAGS		= -fPIC -m64 -Ddouble_p -DHAVE_STDDEF_H -DHAVE_UNISTD_H \
+		  -fno-second-underscore -fno-backslash -fdollar-ok \
+		  -ffixed-line-length-132 -fdefault-real-8 -fdefault-double-8 \
+		  -O $(INCLUDES)
+
+RANLIB		= /usr/bin/ranlib
+
+LD		= gfortran
+LD_DYN_FLAGS	= -fPIC -m64 -shared -Wl,-bundle
+SYSLIBS		= -L$(INSTALL_FER_DIR)/lib64/$(PYTHON_EXE)/site-packages/pyferret \
+		  -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret -lpyferret
+
+CPP		= /lib/cpp
+CPP_FLAGS	= -P -traditional $(INCLUDES)
+CFLAGS_DEBUG	= -O0 -g
+FFLAGS_DEBUG	= -O0 -g
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
diff --git a/external_functions/ef_utility/platform_specific.mk.x86_64-linux b/external_functions/ef_utility/platform_specific.mk.x86_64-linux
new file mode 100644
index 0000000..be8df36
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.x86_64-linux
@@ -0,0 +1,50 @@
+#
+# platform_specific_includes.mk.x86_64-linux
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+# ACM 2/2001 debug flags
+
+# this assumes INSTALL_FER_DIR and PYTHON_EXE has already been defined
+# in site_specific.mk
+
+INCLUDES	= -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG	=
+CC		= gcc
+CFLAGS		= -fPIC -m64 -Ddouble_p -O $(INCLUDES)
+
+FC		= gfortran
+F77		= gfortran
+F77SHFLAG	=
+FFLAGS		= -fPIC -m64 -Ddouble_p -fno-second-underscore \
+		  -fno-backslash -fdollar-ok -ffixed-line-length-132 \
+		  -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES)
+
+RANLIB		= /usr/bin/ranlib
+
+LD		= gfortran
+LD_DYN_FLAGS	= -fPIC -m64 -shared -Wl,--no-undefined
+SYSLIBS		= -L$(INSTALL_FER_DIR)/lib64/$(PYTHON_EXE)/site-packages/pyferret \
+		  -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret -lpyferret
+
+CPP		= /lib/cpp
+CPP_FLAGS	= -P -traditional -Ddouble_p $(INCLUDES)
+CFLAGS_DEBUG	= -O0 -g -Ddebug
+FFLAGS_DEBUG	= -O0 -g  -fbounds-check -Ddebug
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
diff --git a/external_functions/ef_utility/platform_specific.mk.x86_64-linux-gnu b/external_functions/ef_utility/platform_specific.mk.x86_64-linux-gnu
new file mode 100644
index 0000000..b1122c6
--- /dev/null
+++ b/external_functions/ef_utility/platform_specific.mk.x86_64-linux-gnu
@@ -0,0 +1,50 @@
+#
+# platform_specific_includes.mk.x86_64-linux-gnu 
+# (for Ubuntu and other "free" Linux distributions)
+#
+# This file is included in the External Function Makefiles and defines
+# platform specific macros
+
+# this assumes INSTALL_FER_DIR and PYTHON_EXE has already been defined
+# in site_specific.mk
+
+INCLUDES	= -I. -I../ef_utility -I../ef_utility/ferret_cmn
+
+CCSHFLAG	=
+CC		= gcc
+CFLAGS		= -fPIC -m64 -Ddouble_p -O $(INCLUDES)
+
+FC		= gfortran
+F77		= gfortran
+F77SHFLAG	=
+FFLAGS		= -fPIC -m64 -Ddouble_p -fno-second-underscore \
+		  -fno-backslash -fdollar-ok -ffixed-line-length-132 \
+		  -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES)
+
+RANLIB		= /usr/bin/ranlib
+
+LD		= gfortran
+LD_DYN_FLAGS	= -fPIC -m64 -shared -Wl,--no-undefined
+SYSLIBS		= -L$(INSTALL_FER_DIR)/lib64/$(PYTHON_EXE)/site-packages/pyferret \
+		  -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret -lpyferret
+
+CPP		= /lib/cpp
+CPP_FLAGS	= -P -traditional -Ddouble_p $(INCLUDES)
+CFLAGS_DEBUG	= -O0 -g -Ddebug
+FFLAGS_DEBUG	= -O0 -g  -fbounds-check -Ddebug
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
diff --git a/external_functions/ef_utility/site_specific.mk b/external_functions/ef_utility/site_specific.mk
new file mode 100644
index 0000000..1b501f7
--- /dev/null
+++ b/external_functions/ef_utility/site_specific.mk
@@ -0,0 +1,38 @@
+## Site-dependent definitions included in external function 
+## Makefiles in an installed PyFerret directory.  (This file
+## is not used when building PyFerret from source.)
+
+## Machine type for which to build Ferret/PyFerret
+##   x86_64-linux      for 64-bit RHEL
+##   x86_64-linux-gnu  for 64-bit Ubuntu and many "free" Linux systems
+##   i386-linux        for 32-bit RHEL
+##   i386-linux-gnu    for 32-bit Ubuntu and many "free" Linux systems
+## This value is used to determine which platform_specific.mk
+## file to include in the Makefiles.
+BUILDTYPE = $(HOSTTYPE)
+# BUILDTYPE = x86_64-linux
+# BUILDTYPE = x86_64-linux-gnu
+# BUILDTYPE = i386-linux
+# BUILDTYPE = i386-linux-gnu
+
+## INSTALL_FER_DIR and PYTHON_EXE are only used to construct
+## the location of pyferret library.  The library should be
+## (for either 32-bit or 64-bit Linux)
+## $(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-package/pyferret/libpyferret.so
+## or possibly (for 64-bit Linux only)
+## $(INSTALL_FER_DIR)/lib64/$(PYTHON_EXE)/site-package/pyferret/libpyferret.so
+
+## PyFerret installation directory, usually just $(FER_DIR)
+INSTALL_FER_DIR = $(FER_DIR)
+
+## Python version used by PyFerret, either python2.6 or python2.7
+PYTHON_EXE = python2.6
+# PYTHON_EXE = python2.7
+
+## FER_LOCAL_EXTFCNS is the directory in which to install
+## the Ferret Fortran external functions.  The example
+## functions that come with the PyFerret installation are
+## installed in $(INSTALL_FER_DIR)/ext_func/libs
+FER_LOCAL_EXTFCNS = $(INSTALL_FER_DIR)/ext_func/libs
+
+##
diff --git a/external_functions/eof/Makefile b/external_functions/eof/Makefile
new file mode 100644
index 0000000..ae7c050
--- /dev/null
+++ b/external_functions/eof/Makefile
@@ -0,0 +1,61 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM  2/2001  debug macros
+#  ACM  Jul 2001 Move to statically linked code in fer/efi.  name functions
+#                eofspace, eofstat, eoftfunc; with same code as in fer/efi,
+#                but with different INCLUDE statements for use in testing
+#                as dynamically-linked functions.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+SUB_OBJS = eofsubs.o
+
+#
+# Rules
+#
+
+#   once eof_space etc are linked into Ferret dont need SUB_OBJS
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	eofsvd_space.so eof_space_fix.so eof_tfunc_fix.so eof_stat_fix.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/eof/ann_trend.F b/external_functions/eof/ann_trend.F
new file mode 100644
index 0000000..ee9cc72
--- /dev/null
+++ b/external_functions/eof/ann_trend.F
@@ -0,0 +1,198 @@
+*
+*  ann_trend.f
+*
+* ansley manke
+* oct 1998
+*
+* Remove annual variation and trend from  a 2-d field.  Uses Jimmy Larsen's 
+* time series code.
+*
+
+
+*
+* in this subroutine we provide information about
+* the function.  the user configurable information 
+* consists of the following:
+*
+* descr              text description of the function
+*
+* num_args           required number of arguments
+*
+* axis_inheritance   type of axis for the result
+*                       ( custom, implied_by_args, normal, abstract )
+*                       custom          - user defined axis
+*                       implied_by_args - same axis as the incoming argument
+*                       normal          - the result is normal to this axis
+*                       abstract        - an axis which only has index values
+*
+* piecemeal_ok       for memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( yes, no )
+* 
+*
+* for each argument we provide the following information:
+*
+* name               text name for an argument
+*
+* unit               text units for an argument
+*
+* desc               text description of an argument
+*
+* axis_influence     are this argument's axes the same as the result grid?
+*                       ( yes, no )
+*
+* axis_extend       how much does ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINEann_trend_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            user configurable portion |
+*                                                                      |
+*                                                                      v
+
+      CALL ef_set_desc(id,
+     .  'compute eofs and time functions for x-y field w/gaps' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id, implied_by_args, 
+     .      implied_by_args, implied_by_args, implied_by_args)
+
+      CALL ef_set_piecemeal_ok(id, no, no, no, no)
+ 
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'a')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable in x,y,t')
+      CALL ef_set_axis_influence(ID, ARG, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            user configurable portion |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* in this subroutine we compute the result
+*
+
+      SUBROUTINE ann_trend_compute(id, arg_1, result)
+
+*  arg_1  variable, function of (x,y,t)
+*  result is the same variable with trend and annual variation removed
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      real bad_flag(ef_max_args), bad_flag_result
+      real arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+
+      real result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* after initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  the 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,ef_max_args), arg_hi_ss(4,ef_max_args),
+     .     arg_incr(4,ef_max_args)
+
+
+      INTEGER nwrk, nt
+      INTEGER i, j, k, l, i1, j1, k1, l1
+      REAL t_inc
+      PARAMETER (nwrk=1000)
+      REAL r(nwrk), gap(nwrk), fq, ssttmp(nwrk)
+      REAL w(50)
+      INTEGER nf, nyr
+      PARAMETER (nf=5, nyr=24)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      t_inc = res_incr(t_axis)
+      IF (t_inc .eq. 0) t_inc = 1
+
+      nt = (res_hi_ss(t_axis) - res_lo_ss(t_axis) + 1)/ t_inc
+      IF (nt .gt. nwrk) THEN
+         PRINT *, ' ann_trend.F: set dimension for work arrays >=', nt
+         GO TO 999
+      ENDIF
+
+      fq = 1.0 / (7200.0*24.*365.25/12.0)
+
+      CALL prolate(w, nyr, 1)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 500 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS), 
+     .               res_incr(Y_AXIS)
+
+         i1 = arg_lo_ss(X_AXIS, ARG1)
+         DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS), 
+     .               res_incr(X_AXIS)
+ 
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k = res_lo_ss(Z_AXIS)
+            nt = 1
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS), 
+     .               res_incr(T_AXIS)
+
+               ssttmp(nt) = arg_1(i1,j1,k1,l1) 
+               IF (ssttmp(nt) .eq. bad_flag(ARG1)) THEN
+                   ssttmp(nt) = bad_flag_result
+               ELSE 
+                   ssttmp(nt) = arg_1(i1,j1,k1,l1) 
+               ENDIF
+
+               nt = nt + 1
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+  100       CONTINUE
+
+            nt = nt - 1
+            CALL annualdai (fq, nt, ssttmp, r, gap, nf, 
+     .             bad_flag_result)
+            CALL trendflag2 (nt, ssttmp, bad_flag_result)
+            CALL piw (ssttmp, r, w, nt, bad_flag_result)
+
+            nt = 1
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+               result(i,j,k,l) = ssttmp(nt)
+               nt = nt + 1
+  200       CONTINUE
+
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+  400    CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+  500 CONTINUE
+
+      return
+
+  999 continue
+      return
+
+      end
+
+      
+*                                                                      ^
+*                                                                      |
+*                                            user configurable portion |
+************************************************************************
diff --git a/external_functions/eof/anntrend_subs.F b/external_functions/eof/anntrend_subs.F
new file mode 100644
index 0000000..2294479
--- /dev/null
+++ b/external_functions/eof/anntrend_subs.F
@@ -0,0 +1,727 @@
+
+
+c -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+ -+-+
+      subroutine annualdai (fq, nd, x, r, gap, nf, flag)
+
+c   computes annual variation r by robust least squares fit
+c   of nf sine and cosine terms to x and remove r from series x.
+
+c  calls: grossout, qr 
+
+      parameter (mf = 5, mt = 2* mf)
+      dimension x(*), r(*), gap(*)
+
+      real*8  g(mt,mt), a(mt), b(mt), cw(mt), sw(mt), cwa(mt), swa(mt), 
+     .        cm(mt), sm(mt), pi, freq, c, s, c2, cs, ss, cd, sd, cs2, 
+     .        cd2, v1, v2, v3, u1, u2, u3, g1, g2, g3, g4, gi, wi, 
+     .        vpy, ar, ai
+      real fq, flag
+      integer nd, nf
+
+c   number nf of frequencies for annual & higher harmonics
+
+      vpy = 365.25* 24.0* 7200.0* fq
+      year = nd/ vpy
+      if (year .lt. 3.0) return
+
+      pi = 3.1415926535897932384
+
+c   average over nave terms and decimate series
+
+      nave = vpy/ (2.0* (nf + 1))
+      if (nave .lt. 1) nave = 1
+      nda  = nd/ nave
+      
+      if (nave .eq. 1) then
+        do i = 1, nd
+          r(i) = x(i)
+        enddo
+      else
+        j2 = 0
+        do i = 1, nda
+          j1 = j2 + 1
+          j2 = j2 + nave
+          n  = 0
+          s  = 0.d0
+          do j = j1, j2
+            xj = x(j)
+            if (xj .ne. flag) then
+              n = n + 1
+              s = s + xj
+            endif
+          enddo
+          if (n .gt. 0) then
+            r(i) = s/ n
+          else
+            r(i) = flag
+          endif
+        enddo
+      endif
+
+c   outliers
+
+      call grossout (nda, 5.0, r, gap, flag)
+
+      ar = 0.d0
+      nr = 0
+      do i = 1, nda
+        ri = r(i)
+        if (ri .ne. flag) then
+          gap(i) = 1.0
+          nr = nr + 1
+          ar = ar + ri
+        else
+          r(i)   = 0.0
+          gap(i) = 0.0
+        endif
+      enddo
+
+      aa = ar/ nr
+      do i = 1, nda
+        if (r(i) .ne. flag) r(i) = r(i) - aa
+      enddo
+
+      do n = 1, nf
+        freq   = 2.d0* pi* n/ vpy
+        cw(n)  = cos (freq)
+        sw(n)  = sin (freq)
+        cwa(n) = cos (nave* freq)
+        swa(n) = sin (nave* freq)
+      enddo
+
+      do n = 1, nf
+        m = n + nf
+        c  = cwa(n)
+        s  = swa(n)
+        c2 = 2.d0* c
+        u1 = 0.d0
+        u2 = r(nda)
+        do i = nda - 1, 2, -1
+          u3 = c2* u2 - u1 + r(i)
+          u1 = u2
+          u2 = u3
+        enddo
+        a(n) = c* u2 - u1 + r(1)
+        a(m) = s* u2
+      enddo
+
+c   mean of terms set equal to zero
+
+      do n = 1, nf
+        c  = cwa(n)
+        s  = swa(n)
+        c2 = 2.d0* c
+        u1 = 0.d0
+        u2 = gap(nda)
+        do i = nda - 1, 2, -1
+          u3 = c2* u2 - u1 + gap(i)
+          u1 = u2
+          u2 = u3
+        enddo
+        cm(n) = c* u2 - u1 + gap(1)
+        sm(n) = s* u2
+      enddo
+
+      do m = 1, nf
+        mm = m + nf
+        do n = 1, m
+          nn = n + nf
+          c  = cwa(m)* cwa(n)
+          s  = swa(m)* swa(n)
+          cs = c - s
+          cd = c + s
+          s  = swa(m)* cwa(n)
+          c  = cwa(m)* swa(n)
+          ss = s + c
+          sd = s - c
+          cs2 = 2.d0* cs
+          cd2 = 2.d0* cd
+          gi = gap(nda)
+          u1 = 0.d0
+          u2 = gi
+          v1 = 0.d0
+          v2 = gi
+          do i = nda - 1, 2, -1
+            gi = gap(i)
+            u3 = cs2* u2 - u1 + gi
+            v3 = cd2* v2 - v1 + gi
+            u1 = u2
+            u2 = u3
+            v1 = v2
+            v2 = v3
+          enddo
+
+          g1 = gap(1) + 0.5d0* (cs* u2 - u1 + cd* v2 - v1)
+          g2 =          0.5d0* (ss* u2 - sd* v2)
+          g3 =          0.5d0* (ss* u2 + sd* v2)
+          g4 =          0.5d0* (cd* v2 - v1 - cs* u2 + u1)
+
+          g1 = g1 - cm(m)* cm(n)/ nr
+          g2 = g2 - cm(m)* sm(n)/ nr
+          g3 = g3 - sm(m)* cm(n)/ nr
+          g4 = g4 - sm(m)* sm(n)/ nr
+
+          g( m, n) = g1
+          g( n, m) = g1
+          g( m,nn) = g2
+          g(nn, m) = g2
+          g(mm, n) = g3
+          g( n,mm) = g3
+          g(mm,nn) = g4
+          g(nn,mm) = g4
+
+        enddo
+      enddo
+
+      nt = 2* nf
+
+      call qr (mt, nt, nt, g, a, b, resq)
+
+c   correction for averaging
+
+      if (nave .gt. 1) then
+        do n = 1, nf
+          m = n + nf
+            wi = pi* n/ vpy
+            ww = nave* sin (wi)/ sin (nave* wi)
+            c  = cos ((nave - 1)* wi)
+            s  = sin ((nave - 1)* wi)
+            ar = b(n)
+            ai = b(m)
+            b(n) = ww* (c* ar - s* ai)
+            b(m) = ww* (s* ar + c* ai)
+        enddo
+      endif
+
+c   annual variation r
+
+      do i = 1, nd
+        r(i) = 0.0
+      enddo
+
+      do n = 1, nf
+        c  = cw(n)
+        s  = sw(n)
+        c2 = 2.d0* c
+        u1 = b(n)
+        u2 = c* u1 + s* b(n + nf)
+        r(1) = r(1) + u1
+        r(2) = r(2) + u2
+        do i = 3, nd
+          u3 = c2* u2 - u1
+          r(i) = r(i) + u3
+          u1 = u2
+          u2 = u3
+        enddo
+      enddo
+
+c   remove annual variation r from series x
+
+      do i = 1, nd
+        if (x(i) .ne. flag) x(i) = x(i) - r(i)
+      enddo
+
+      return
+      end
+
+      subroutine trendflag2 (nd, x, flag)
+      real*8 xi, x0, x1, t0, t1, t2, wi, w1, w2, r1, r2, d 
+      dimension x(*)
+      real flag
+      integer nd
+
+      r1 = 1.d0/ nd
+      r2 = 2.d0/ nd
+      w1 = r2/ (1.d0 - r1)
+      w2 = (1.d0 + r1)/ (1.d0 - r1)
+
+      x0 = 0.d0
+      x1 = 0.d0
+      t0 = 0.d0
+      t1 = 0.d0
+      t2 = 0.d0
+      do i = 1, nd 
+        if (x(i) .ne. flag) then
+          xi = x(i)
+          wi = w1* i - w2
+          x0 = x0 + xi 
+          x1 = x1 + xi* wi
+          t0 = t0 + 1.d0
+          t1 = t1 + wi
+          t2 = t2 + wi**2
+        endif
+      enddo
+      x0 = x0/ t0
+      x1 = x1/ t0
+      t1 = t1/ t0
+      t2 = t2/ t0
+
+      d  = t2 - t1**2
+
+      c0 = (t2* x0 - t1* x1)/ d
+      c1 = (x1 - t1* x0)/ d 
+
+      do i = 1, nd 
+        xi = x(i)
+        if (xi .ne. flag) then
+          fi = w1* i - w2
+          x(i) = xi - c1* fi - c0
+        endif
+      enddo
+
+      return 
+      end
+      subroutine piw(sst, sstyear, w, ndim, flag)
+
+      integer ndim, j, n
+
+      integer nj, k, j1, j2
+
+      real sst(*), sstyear(*), sd, sw, sj, wk
+      real w(50)
+
+      real flag
+
+          sw = 0.0
+          sd = 0.0
+          nj = 0
+
+          do n = 1, ndim
+c            j1 = n - 6
+c            j2 = n + 5
+            j1 = n - 12
+            j2 = n + 11
+            nj = 0
+            if (j1 .lt. 1) then
+              sw = 0.0
+              sd = 0.0
+            else
+              if (j2 .lt. ndim) then
+                if(sst(j1)   .ne. flag .and. 
+     .             sst(j2+1) .ne. flag) then
+                  sd = 0.5* w(1)* (sst(j1) + sst(j2+1))
+                  sw = w(1)
+                else
+                  if(sst(j1) .ne. flag) then
+                    sd = w(1)* sst(j1)
+                    sw = w(1)
+                  else if(sst(j2+1) .ne. flag) then
+                    sd = w(1)* sst(j2+1)
+                    sw = w(1)
+                  endif
+                endif
+              else
+                if(sst(j1) .ne. flag) then
+                  sd = w(1)* sst(j1)
+                  sw = w(1)
+                endif
+              endif
+              nj = 1
+            endif
+            k = 1
+            do j = j1 + 1, j2
+              k = k + 1
+              if(j .ge. 1 .and. j .le. ndim) then
+                sj = sst(j)
+                if(sj .ne. flag) then
+                  wk = w(k)
+                  nj = nj + 1
+                  sw = sw + wk
+                  sd = sd + wk*sj
+                endif
+              endif
+            enddo
+c            if(sw .ne. 0.0) then
+            if(nj .ge. 12 .and. sw .ne. 0.0) then
+              sstyear(n) = sd / sw
+            else
+              sstyear(n) = flag
+            endif
+          enddo
+
+          do n = 1, ndim
+            sst(n) = sstyear(n)
+          enddo
+
+          return
+          end
+
+      subroutine prolate (w, nd, isw)
+
+c  calculates prolate spheroidal wavefunction data window for
+c  high resolution fourier analysis
+c  ref: d.j.thomson, bell syst. tech. j. 56,1769-1815 (1977)
+c
+c  w is a single precison real array of data window values
+c  nd is the number of points in w
+c  isw is a switch--isw=4 means use a 4-pi window, isw=1 means use
+c      the higher resolution pi window
+c
+c  scale factors=integral(boxcar)/integral(prolate window) are:
+c    4 pi prolate window--1.425658520238489
+c    pi prolate window--1.057568010371401
+c  these are the numbers to multiply the spectrum by for comparison
+c  with other windows
+c
+      ingeger nd, isw
+      real w(*)
+      real*8 xi, xn, x, d, u, dd, x1, x2
+      x1 = dble(1)
+      x2 = dble(2)
+      xn = dble(nd)/ x2
+      if (isw .eq. 4) then
+      	d = sqrt (x2/ 0.508125548147497d0)
+       	do i = 1, nd
+      	  xi = dble(i) - x1
+      	  x = xi/ xn - x1
+      	  u = (x1 - x)* (x1 + x)
+      	  dd = d*(((((((((((((((((((((
+     $        2.6197747176990866d-11*u+2.9812025862125737d-10)*u+
+     $        3.0793023552299688d-9)*u+2.8727486379692354d-8)*u+
+     $        2.4073904863499725d-7)*u+1.8011359410323110d-6)*u+
+     $        1.1948784162527709d-5)*u+6.9746276641509466d-5)*u+
+     $        3.5507361197109845d-4)*u+1.5607376779150113d-3)*u+
+     $        5.8542015072142441d-3)*u+1.8482388295519675d-2)*u+
+     $        4.8315671140720506d-2)*u+1.0252816895203814d-1)*u+
+     $        1.7233583271499150d-1)*u+2.2242525852102708d-1)*u+
+     $        2.1163435697968192d-1)*u+1.4041394473085307d-1)*u+
+     $        5.9923940532892353d-2)*u+1.4476509897632850d-2)*u+
+     $        1.5672417352380246d-3)*u+4.2904633140034110d-5)
+          w(i) = dd
+      	enddo
+      	return
+      else
+      	d = sqrt (x2)
+      	do i = 1, nd
+      	  xi = dble(i) - x1
+      	  x = xi/ xn - x1
+      	  u = (x1 - x)* (x1 + x)
+      	  dd = d*((((((((((
+     $        5.3476939016920851d-11*u+2.2654256220146656d-9)*u+
+     $        7.8075102004229667d-8)*u+2.1373409644281953d-6)*u+
+     $        4.5094847544714943d-5)*u+7.0498957221483167d-4)*u+
+     $        7.7412693304064753d-3)*u+5.5280627452077586d-2)*u+
+     $        2.2753754228751827d-1)*u+4.3433904277546202d-1)*u+
+     $        2.2902051859068017d-1)
+          w(i) = dd
+        enddo
+        return
+      endif
+      end
+      subroutine grossout (nd, sdmax, x, r)
+
+c   finds outliers in x at the sdmax standard deviation level and sets
+c   x = flag for outliers
+
+c   calls: robustsd
+
+      dimension  x(*), r(*)
+      integer nd
+      real sdmax
+
+      jd = 0
+      do i = 1, nd
+        xi = x(i)
+        if (xi .ne. flag) then
+          jd = jd + 1
+          r(jd) = xi
+        endif
+      enddo
+
+      call robustsd (jd, r, sd)
+        
+      jd = 0
+      do i = 1, nd
+        if (x(i) .ne. flag) then
+          jd = jd + 1
+          if (abs (r(jd)) .gt. sdmax) x(i) = flag
+        endif
+      enddo
+ 
+      return
+      end
+
+      subroutine qr(ndim, m, n, a, b, x, resq)
+
+      implicit double precision (a-h, o-z)
+      integer ndim, m, n
+
+c$$$$  calls no other routines
+c  solves over-determined least-squares problem  ax = b
+c  where  a  is an  m by n  matrix,  b  is an m-vector .
+c  resq  is the sum of squared residuals of optimal solution.  also used
+c  to signal error conditions - if -2 , system is underdetermined,  if
+c  -1,  system is singular.
+c  method - successive householder rotations.  see lawson+hanson - solv
+c  -ing least squares problems.
+c  routine will also work when m=n.
+c*****   caution -  a and b  are overwritten by this routine.
+
+      dimension a(ndim,*), b(*), x(*)
+      double precision sum,dot
+      real*4 resq
+c
+      resq=-2.0
+      if (m.lt.n) return
+c   loop ending on 1800 rotates  a  into upper triangular form
+      do 1800 j=1,n
+c  find constants for rotation and diagonal entry
+      sq=0.0
+      do 1100 i=j,m
+ 1100 sq=a(i,j)**2 + sq
+
+cc      qv1=-sign(dsqrt(sq),a(j,j))
+      signa = 1.
+      if (abs(a(j,j)) .ne. a(j,j)) signa = -1.
+      qv1=-1.* abs(dsqrt(sq)) * signa
+
+      u1=a(j,j) - qv1
+      a(j,j)=qv1
+      j1=j + 1
+      if (j1.gt.n) go to 1500
+c  rotate remaining columns of sub-matrix
+      do 1400 jj=j1,n
+      dot=u1*a(j,jj)
+      do 1200 i=j1,m
+ 1200 dot=a(i,jj)*a(i,j) + dot
+      const=dot/dabs(qv1*u1)
+      do 1300 i=j1,m
+ 1300 a(i,jj)=a(i,jj) - const*a(i,j)
+      a(j,jj)=a(j,jj) - const*u1
+ 1400 continue
+c  rotate  b  vector
+ 1500 dot=u1*b(j)
+      if (j1.gt.m) go to 1610
+      do 1600 i=j1,m
+ 1600 dot=b(i)*a(i,j) + dot
+ 1610 const=dot/dabs(qv1*u1)
+      b(j)=b(j) - const*u1
+      if (j1.gt.m) go to 1800
+      do 1700 i=j1,m
+ 1700 b(i)=b(i) - const*a(i,j)
+ 1800 continue
+c  solve triangular system by back-substitution.
+      resq=-1.0
+      do 2200 ii=1,n
+      i=n-ii+1
+      sum=b(i)
+      if (ii.eq.1) go to 2110
+      i1=i+1
+      do 2100 j=i1,n
+ 2100 sum=sum - a(i,j)*x(j)
+ 2110 if (a(i,i).eq. 0.0) return
+ 2200 x(i)=sum/a(i,i)
+c  find residual in overdetermined case.
+      resq=0.0
+      if (m.eq.n) return
+      i1=n+1
+      m=m
+      n=n
+      do 2300 i=i1,m
+ 2300 resq=b(i)**2 + resq
+      return
+      end
+
+      subroutine robustsd (nd, r, sd)
+
+c   robustly estimated standard deviation sd for nd values of r based on
+c   median of the absolute value of the deviations.
+
+c   calls: sort
+
+      dimension r(*), dum(1005)
+      integer nd, nh, nmax
+
+      nh = nd/ 2
+
+      smad = 0.67449
+
+      nmax = 1000
+      if (nd .le. nmax) then
+
+        do i = 1, nd
+          dum(i) = abs (r(i))
+        enddo
+
+        call sort (nd, dum)
+ 
+        if (2* nh .eq. nd) then
+          sd = 0.5* (dum(nh) + dum(nh + 1))/ smad
+        else
+          sd = dum(nh + 1)/ smad
+        endif
+
+        if (sd .eq. 0.0) then
+          do i = 1, nd
+            sd = sd + r(i)**2
+          enddo
+          sd = sqrt (sd/ nd)
+        endif
+
+      else
+
+c   preliminary standard deviation
+      
+        s = 0.0
+        do i = 1, nd
+          s  = s + r(i)**2
+        enddo
+        s = sqrt (s/ nd)
+
+        ds = sqrt (2.0* 3.141592654)* s* exp(0.5*smad**2)
+
+        smed = smad* s
+
+        mid = 0.6 + 0.5* nd
+
+c   median absolute deviation
+
+        nmed = -mid
+        do i = 1, nd
+          if (abs (r(i)) .le. smed) nmed = nmed + 1
+        enddo
+
+        if (nmed. eq. 0) go to 20
+
+        ds = - ds* nmed/ nd
+
+    2   sneg = smed
+        nneg = nmed
+        smed = smed + ds
+        nmed = -mid
+        do i = 1, nd
+          if (abs (r(i)) .le. smed) nmed = nmed + 1
+        enddo
+cc        if (nneg* sign(1, nmed) .gt. 0) go to 2
+
+        nsigna = 1
+        if (abs(nmed) .ne. nmed) nsigna = -1
+        if (nneg* nsigna .gt. 0) go to 2
+
+        if (nmed .eq. 0) go to 20
+
+        it = 0
+    4   it = it + 1
+
+        if (sneg .gt. smed) then
+          sd   = smed
+          smed = sneg
+          sneg = sd
+          nn   = nmed
+          nmed = nneg
+          nneg = nn
+        endif
+
+cc        if (nneg* sign(1, nmed) .lt. 0 .and. nmed - nneg .le. nmax) then
+
+        nsigna = 1
+        if (abs(nmed) .ne. nmed) nsigna = -1
+        if (nneg* nsigna .gt. 0) go to 2
+
+        if (nneg* nsigna .lt. 0 .and. nmed - nneg .le. nmax) then
+
+          jd = 0
+          do i = 1, nd
+            ri = abs (r(i))
+            if (ri .gt. sneg .and. ri .lt. smed) then
+              jd = jd + 1
+              dum(jd) = ri
+            endif
+          enddo
+
+          call sort (jd, dum)
+
+          if (2* nh .eq. nd) then
+            smed = 0.5* (dum( -nneg) + dum( -nneg + 1))
+          else
+            smed = dum( -nneg + 1)
+          endif
+
+          go to 20
+
+        endif
+
+        sd = 0.5* (sneg + smed)
+        nn = -mid
+        do i = 1, nd
+          if (abs (r(i)) .le. sd) nn = nn + 1
+        enddo
+
+        if (nn .eq. 0) then
+          smed = sd
+          go to 20
+        endif
+
+cc        if (nn* sign(1, nneg) .gt. 0) then
+
+        nsigna = 1
+        if (abs(nneg) .ne. nneg) nsigna = -1
+
+        if (nn* nsigna .gt. 0) then
+          sneg = sd
+          nneg = nn
+        else
+          smed = sd
+          nmed = nn
+        endif
+
+        if (it .lt. 10) go to 4
+
+   20   sd = smed/ smad
+
+      endif
+
+      rd = 1.0/ sd
+      do i = 1, nd
+        r(i) = rd* r(i)
+      enddo
+
+      return
+      end
+      subroutine sort (nd, x)
+
+c   ranks x base on code from numerical recipes.
+
+      dimension x(*)
+
+      if (nd .le. 1) return
+      l = nd/2 + 1
+      ir = nd
+
+   10 continue
+      
+      if (l .gt. 1) then
+        l = l - 1
+        xi = x(l)
+      else
+        xi = x(ir)
+        x(ir) = x(1)
+        ir = ir - 1
+        if (ir .eq. 1) then
+          x(1) = xi
+          return
+        endif
+      endif
+
+      i = l
+      j = l + l
+   20 if (j .le. ir) then
+        if (j .lt. ir) then
+          jj = j + 1
+          if (x(j) .lt. x(jj)) j = jj
+        endif
+        if (xi .lt. x(j)) then
+          x(i) = x(j)
+          i = j
+          j = j + j
+        else
+          j = ir + 1
+        endif
+        go to 20
+      endif
+
+      x(i) = xi
+
+      go to 10
+      
+      end
diff --git a/external_functions/examples/Makefile b/external_functions/examples/Makefile
new file mode 100644
index 0000000..007ce35
--- /dev/null
+++ b/external_functions/examples/Makefile
@@ -0,0 +1,56 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+ 
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c  $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	add_9.so appende.so avet.so dates.so factorial.so pass_thru.so percent_good_t.so \
+	storage.so string_arg.so subtract.so 
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/examples/add_9.F b/external_functions/examples/add_9.F
new file mode 100644
index 0000000..a624273
--- /dev/null
+++ b/external_functions/examples/add_9.F
@@ -0,0 +1,357 @@
+*
+* add_9.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* Returns the sum of nine arguments.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE add_9_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, '(demonstration function) adds 9 arguments')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, YES, YES, YES)
+
+* All arguments should be on the same grid
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'D')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'E')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'G')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'H')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, 'I')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE add_9_compute(id, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .                         arg_6, arg_7, arg_8, arg_9, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER i5, j5, k5, l5, m5, n5
+      INTEGER i6, j6, k6, l6, m6, n6
+      INTEGER i7, j7, k7, l7, m7, n7
+      INTEGER i8, j8, k8, l8, m8, n8
+      INTEGER i9, j9, k9, l9, m9, n9
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+      n5 = arg_lo_ss(F_AXIS,ARG5)
+      n6 = arg_lo_ss(F_AXIS,ARG6)
+      n7 = arg_lo_ss(F_AXIS,ARG7)
+      n8 = arg_lo_ss(F_AXIS,ARG8)
+      n9 = arg_lo_ss(F_AXIS,ARG9)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       m2 = arg_lo_ss(E_AXIS,ARG2)
+       m3 = arg_lo_ss(E_AXIS,ARG3)
+       m4 = arg_lo_ss(E_AXIS,ARG4)
+       m5 = arg_lo_ss(E_AXIS,ARG5)
+       m6 = arg_lo_ss(E_AXIS,ARG6)
+       m7 = arg_lo_ss(E_AXIS,ARG7)
+       m8 = arg_lo_ss(E_AXIS,ARG8)
+       m9 = arg_lo_ss(E_AXIS,ARG9)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        l2 = arg_lo_ss(T_AXIS,ARG2)
+        l3 = arg_lo_ss(T_AXIS,ARG3)
+        l4 = arg_lo_ss(T_AXIS,ARG4)
+        l5 = arg_lo_ss(T_AXIS,ARG5)
+        l6 = arg_lo_ss(T_AXIS,ARG6)
+        l7 = arg_lo_ss(T_AXIS,ARG7)
+        l8 = arg_lo_ss(T_AXIS,ARG8)
+        l9 = arg_lo_ss(T_AXIS,ARG9)
+        DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         k4 = arg_lo_ss(Z_AXIS,ARG4)
+         k5 = arg_lo_ss(Z_AXIS,ARG5)
+         k6 = arg_lo_ss(Z_AXIS,ARG6)
+         k7 = arg_lo_ss(Z_AXIS,ARG7)
+         k8 = arg_lo_ss(Z_AXIS,ARG8)
+         k9 = arg_lo_ss(Z_AXIS,ARG9)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          j2 = arg_lo_ss(Y_AXIS,ARG2)
+          j3 = arg_lo_ss(Y_AXIS,ARG3)
+          j4 = arg_lo_ss(Y_AXIS,ARG4)
+          j5 = arg_lo_ss(Y_AXIS,ARG5)
+          j6 = arg_lo_ss(Y_AXIS,ARG6)
+          j7 = arg_lo_ss(Y_AXIS,ARG7)
+          j8 = arg_lo_ss(Y_AXIS,ARG8)
+          j9 = arg_lo_ss(Y_AXIS,ARG9)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           i2 = arg_lo_ss(X_AXIS,ARG2)
+           i3 = arg_lo_ss(X_AXIS,ARG3)
+           i4 = arg_lo_ss(X_AXIS,ARG4)
+           i5 = arg_lo_ss(X_AXIS,ARG5)
+           i6 = arg_lo_ss(X_AXIS,ARG6)
+           i7 = arg_lo_ss(X_AXIS,ARG7)
+           i8 = arg_lo_ss(X_AXIS,ARG8)
+           i9 = arg_lo_ss(X_AXIS,ARG9)
+           DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) .OR.
+     .           arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) .OR.
+     .           arg_3(i3,j3,k3,l3,m3,n3) .EQ. bad_flag(ARG3) .OR.
+     .           arg_4(i4,j4,k4,l4,m4,n4) .EQ. bad_flag(ARG4) .OR.
+     .           arg_5(i5,j5,k5,l5,m5,n5) .EQ. bad_flag(ARG5) .OR.
+     .           arg_6(i6,j6,k6,l6,m6,n6) .EQ. bad_flag(ARG6) .OR.
+     .           arg_7(i7,j7,k7,l7,m7,n7) .EQ. bad_flag(ARG7) .OR.
+     .           arg_8(i8,j8,k8,l8,m8,n8) .EQ. bad_flag(ARG8) .OR.
+     .           arg_9(i9,j9,k9,l9,m9,n9) .EQ. bad_flag(ARG9) ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1) +
+     .                               arg_2(i2,j2,k2,l2,m2,n2) +
+     .                               arg_3(i3,j3,k3,l3,m3,n3) +
+     .                               arg_4(i4,j4,k4,l4,m4,n4) +
+     .                               arg_5(i5,j5,k5,l5,m5,n5) +
+     .                               arg_6(i6,j6,k6,l6,m6,n6) +
+     .                               arg_7(i7,j7,k7,l7,m7,n7) +
+     .                               arg_8(i8,j8,k8,l8,m8,n8) +
+     .                               arg_9(i9,j9,k9,l9,m9,n9)
+
+            ENDIF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+            i3 = i3 + arg_incr(X_AXIS,ARG3)
+            i4 = i4 + arg_incr(X_AXIS,ARG4)
+            i5 = i5 + arg_incr(X_AXIS,ARG5)
+            i6 = i6 + arg_incr(X_AXIS,ARG6)
+            i7 = i7 + arg_incr(X_AXIS,ARG7)
+            i8 = i8 + arg_incr(X_AXIS,ARG8)
+            i9 = i9 + arg_incr(X_AXIS,ARG9)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+           j3 = j3 + arg_incr(Y_AXIS,ARG3)
+           j4 = j4 + arg_incr(Y_AXIS,ARG4)
+           j5 = j5 + arg_incr(Y_AXIS,ARG5)
+           j6 = j6 + arg_incr(Y_AXIS,ARG6)
+           j7 = j7 + arg_incr(Y_AXIS,ARG7)
+           j8 = j8 + arg_incr(Y_AXIS,ARG8)
+           j9 = j9 + arg_incr(Y_AXIS,ARG9)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+          k2 = k2 + arg_incr(Z_AXIS,ARG2)
+          k3 = k3 + arg_incr(Z_AXIS,ARG3)
+          k4 = k4 + arg_incr(Z_AXIS,ARG4)
+          k5 = k5 + arg_incr(Z_AXIS,ARG5)
+          k6 = k6 + arg_incr(Z_AXIS,ARG6)
+          k7 = k7 + arg_incr(Z_AXIS,ARG7)
+          k8 = k8 + arg_incr(Z_AXIS,ARG8)
+          k9 = l9 + arg_incr(Z_AXIS,ARG9)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         l6 = l6 + arg_incr(T_AXIS,ARG6)
+         l7 = l7 + arg_incr(T_AXIS,ARG7)
+         l8 = l8 + arg_incr(T_AXIS,ARG8)
+         l9 = l9 + arg_incr(T_AXIS,ARG9)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+        m2 = m2 + arg_incr(E_AXIS,ARG2)
+        m3 = m3 + arg_incr(E_AXIS,ARG3)
+        m4 = m4 + arg_incr(E_AXIS,ARG4)
+        m5 = m5 + arg_incr(E_AXIS,ARG5)
+        m6 = m6 + arg_incr(E_AXIS,ARG6)
+        m7 = m7 + arg_incr(E_AXIS,ARG7)
+        m8 = m8 + arg_incr(E_AXIS,ARG8)
+        m9 = m9 + arg_incr(E_AXIS,ARG9)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+       n2 = n2 + arg_incr(F_AXIS,ARG2)
+       n3 = n3 + arg_incr(F_AXIS,ARG3)
+       n4 = l4 + arg_incr(F_AXIS,ARG4)
+       n5 = n5 + arg_incr(F_AXIS,ARG5)
+       n6 = n6 + arg_incr(F_AXIS,ARG6)
+       n7 = n7 + arg_incr(F_AXIS,ARG7)
+       n8 = n8 + arg_incr(F_AXIS,ARG8)
+       n9 = n9 + arg_incr(F_AXIS,ARG9)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/appende.F b/external_functions/examples/appende.F
new file mode 100644
index 0000000..0e6584a
--- /dev/null
+++ b/external_functions/examples/appende.F
@@ -0,0 +1,288 @@
+*
+* appende.F
+*
+* This function creates a new variable which is the first variable
+* with the second variable appended on the ensemble axis.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE appende_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'appends VAR to ENS along the ensemble axis')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                CUSTOM,          IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ENS')
+      CALL ef_set_arg_desc(id, arg, 'Initial variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'Variable to append')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we provide information about the custom axis.
+*
+
+      SUBROUTINE appende_custom_axes(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      REAL my_lo, my_hi, my_delta
+      CHARACTER*20 my_units
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      IF ( (arg_lo_ss(E_AXIS,ARG1) .EQ. ef_unspecified_int4) .AND.
+     .     (arg_hi_ss(E_AXIS,ARG1) .EQ. ef_unspecified_int4) ) THEN
+         my_lo = 1.0
+         my_hi = 1.0
+      ELSE
+         my_lo = arg_lo_ss(E_AXIS,ARG1)
+         my_hi = arg_hi_ss(E_AXIS,ARG1)
+      ENDIF
+      my_hi = my_hi + 
+     .        arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1.0
+      my_delta = 1.0
+      my_units = ' '
+
+      CALL ef_set_custom_axis(id, E_AXIS, my_lo, my_hi,
+     .                        my_delta, my_units, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE appende_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Initialize everything to undefined so nothing is missed
+      DO 10 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+  10  CONTINUE
+
+*     Start by copying the first variable
+*     (Ensemble axis must be outer-most loop)
+      m = res_lo_ss(E_AXIS)
+      DO 510 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 610 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 310 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 210 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+
+            END IF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 110     CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 210     CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 310     CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 410     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 610     CONTINUE
+
+         m = m + 1
+ 510  CONTINUE
+
+*     Now copy the second variable starting on the ensemble axis
+*     where the first variable left off (value of m not reset)
+
+      DO 520 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         n2 = arg_lo_ss(F_AXIS,ARG2)
+         DO 620 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         l2 = arg_lo_ss(T_AXIS,ARG2)
+         DO 420 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 320 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 220 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         i2 = arg_lo_ss(X_AXIS,ARG2)
+         DO 120 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(ARG2) ) THEN
+
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+
+            END IF
+
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 120     CONTINUE
+
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 220     CONTINUE
+
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 320     CONTINUE
+
+            l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 420     CONTINUE
+
+            n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 620     CONTINUE
+
+         m = m + 1
+ 520  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/avet.F b/external_functions/examples/avet.F
new file mode 100644
index 0000000..c18abf1
--- /dev/null
+++ b/external_functions/examples/avet.F
@@ -0,0 +1,195 @@
+*
+* avet.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* Returns the argument averaged over the T axis
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE avet_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_desc(id,
+     .        '(demonstration function) returns the time average')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, NO, YES, YES)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg,
+     .        'data to be averaged over the time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE avet_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      REAL    datasum
+      REAL    datacount
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        k1 = arg_lo_ss(Z_AXIS,ARG1)
+        DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+          i1 = arg_lo_ss(X_AXIS,ARG1)
+          DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*
+* Loop through time (using the argument indices) and calculate a running sum.
+*
+           datasum = 0.0
+           datacount = 0.0
+           DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+              IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+                 datasum = datasum + arg_1(i1,j1,k1,l1,m1,n1)
+                 datacount = datacount + 1.0
+              ENDIF
+ 400       CONTINUE
+
+*          Result is normal to the time axis, thus only one index
+*          on the result's time dimension
+           l = res_lo_ss(T_AXIS)
+
+*
+* If we had any good data, calculate the average;
+* otherwise set the result to undefined.
+*
+           IF ( datacount .GT. 0.0 ) THEN
+              result(i,j,k,l,m,n) = datasum / datacount
+           ELSE
+              result(i,j,k,l,m,n) = bad_flag_result
+           ENDIF
+
+           i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100      CONTINUE
+
+          j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/check6dlist.csh b/external_functions/examples/check6dlist.csh
new file mode 100755
index 0000000..ce9af6e
--- /dev/null
+++ b/external_functions/examples/check6dlist.csh
@@ -0,0 +1,25 @@
+#! /bin/tcsh -f
+#
+# C-shell script to check for functions that need to be renamed
+# for the 6D version
+#
+
+# list of functions that need to be renamed
+set funclist = ""
+set funclist = "$funclist ef_get_arg_subscripts"
+set funclist = "$funclist ef_get_axis_info"
+set funclist = "$funclist ef_get_res_subscripts"
+set funclist = "$funclist ef_get_string_arg_element"
+set funclist = "$funclist ef_get_string_arg_element_len"
+set funclist = "$funclist ef_set_axis_influence"
+set funclist = "$funclist ef_set_axis_inheritance"
+set funclist = "$funclist ef_set_axis_reduction"
+set funclist = "$funclist ef_set_piecemeal_ok"
+set funclist = "$funclist ef_set_work_array_dims"
+set funclist = "$funclist ef_set_work_array_lens"
+
+# case-insensitive search for the above functions without _6d appended
+foreach func ( ${funclist} )
+   grep -i ${func} $argv | grep -i -v ${func}_6d
+end
+
diff --git a/external_functions/examples/custom.F b/external_functions/examples/custom.F
new file mode 100644
index 0000000..0eb2c38
--- /dev/null
+++ b/external_functions/examples/custom.F
@@ -0,0 +1,200 @@
+*
+* custom.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* Returns A with its T axis replaced by a frequency axis.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE custom_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'multiply by 2 (test routine)' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, YES)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'X')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, ' ')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE custom_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+
+*     You could use utility functions at this point to get 
+*     grid information about the other arguments.  This info 
+*     could be used to determine the custom axis lo/hi/del 
+*     information.
+
+
+      CALL ef_set_custom_axis(id, T_AXIS, 0.0, 1000.0, 25.0,
+     .     'Hertz', NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE custom_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*     You could use utility functions at this point to get 
+*     context information about the other arguments.  This info 
+*     could be used to update the custom or abstract axis lo and hi
+*     indices.
+
+*      call ef_set_axis_limits(id, T_AXIS, 1, 40)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE custom_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+     
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/examples/dates.F b/external_functions/examples/dates.F
new file mode 100644
index 0000000..4ca1d9d
--- /dev/null
+++ b/external_functions/examples/dates.F
@@ -0,0 +1,293 @@
+*
+* dates.F
+*
+*
+* This function tests ef_get_axis_dates
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE dates_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_desc(id,
+     .        'Returns a string array of dates derived ' //
+     .        'from the time axis and the given offsets')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'Offsets')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Offsets from the time given by time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE dates_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+* The work array does not have to dimensioned along the time axis,
+* but could be if it makes the code clearer.  Later we just treat it
+* as a one-dimensional array, so just dimension along the first axis.
+
+* taxdat  time axis coordinates
+*         This is going to be a double precision array
+*         so allocate twice the size of the time axis
+*         in case REAL is REAL*4
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           2 * nt, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE dates_compute(id, arg_1, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+* String arrays are always viewed as double precision arrays
+* Thus the initial dimension of one or two depending on whether
+* REAL is REAL*8 or REAL*4
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused singleton final dimensions in the work arrays
+      REAL*8 taxdat(wrk1lox:wrk1hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER taxnum, slen, idx
+      REAL*8 newtime
+      CHARACTER*20 datebuf
+      CHARACTER*255 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Make sure the argument has a time axis
+      IF ( (arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .AND.
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         errtxt = 'Offsets does not have a time axis'
+         GOTO 999
+      ENDIF
+
+* Get the time axis coordinates
+      CALL ef_get_coordinates(id, ARG1, T_AXIS, arg_lo_ss(T_AXIS, ARG1),
+     .                        arg_hi_ss(T_AXIS, ARG1), taxdat)
+
+* Loop through the argument time offsets, assigning the result time strings
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+*       taxdat indices start at 1 (given in dates_work_size)
+        taxnum = 1
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+
+               newtime = taxdat(taxnum) + arg_1(i1,j1,k1,l1,m1,n1)
+
+*              Convert newtime into a date string.
+*              ef_get_axis_dates can work with an array of times,
+*              returning an array of date strings; here we just do one
+               CALL ef_get_axis_dates(id, ARG1, newtime, 1, datebuf)
+
+*              Get the actual length of the string
+               DO 15 idx = 20, 1, -1
+                  IF ( datebuf(idx:idx) .NE. ' ' ) THEN
+                     slen = idx
+                     GOTO 25
+                  ENDIF
+  15           CONTINUE
+
+*              Empty string if we get here
+               slen = 0
+
+  25           CONTINUE
+
+            ELSE
+
+*              Use an empty string as the undefined value
+               datebuf = ' '
+               slen = 0
+
+            ENDIF
+
+*           Put the date string (or empty string) into the string array
+            CALL ef_put_string(datebuf, slen, result(1,i,j,k,l,m,n))
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         taxnum = taxnum + 1
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/extend.F b/external_functions/examples/extend.F
new file mode 100644
index 0000000..4cd6c1a
--- /dev/null
+++ b/external_functions/examples/extend.F
@@ -0,0 +1,136 @@
+*
+*  extend.F
+*
+*  Simple test of axis extension.
+*
+*  Jonathan Callahan, October 1998
+*
+
+*
+*  In this subroutine we provide information about the function
+*
+      SUBROUTINE extend_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'text function for extending axes' )
+
+      CALL ef_set_num_args(id, 1)
+*
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,        !^ Normaly 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)   !| set by
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)             !V default
+*
+*
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'anything')
+      CALL ef_set_arg_unit(id, arg, 'un-normalized units')
+      CALL ef_set_axis_extend(id, arg, X_AXIS, -1, 1)
+      CALL ef_set_axis_extend(id, arg, Y_AXIS, -1, 1)
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE extend_compute(id, a, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL a(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*
+      INTEGER i1, j1, k1, l1, id
+      INTEGER i,  j,  k,  l
+
+*
+* get what we need
+*
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*
+* =========
+* Main Loop
+* =========
+* remember that the ARG1 axes are extended by -1,+1 in X and Y
+*
+
+             i1 = arg_lo_ss(X_AXIS,ARG1)+1
+      DO 400 i  = res_lo_ss(X_AXIS),res_hi_ss(X_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)+1
+        DO 300 j  = res_lo_ss(Y_AXIS),res_hi_ss(Y_AXIS)
+
+                k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 200 k  = res_lo_ss(Z_AXIS),res_hi_ss(Z_AXIS)
+
+                 l1 = arg_lo_ss(T_AXIS,ARG1)
+          DO 100 l  = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+
+
+             IF ( a(i1  ,j1  ,k1,l1) .EQ. bad_flag(1).OR.
+     .            a(i1+1,j1  ,k1,l1) .EQ. bad_flag(1)    ) THEN
+
+                result(i,j,k,l) = bad_flag_result
+
+             ELSE
+
+                result(i,j,k,l) = a(i,j,k,l) * 0.5
+
+             END IF
+
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100     CONTINUE
+
+        k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200    CONTINUE
+
+       j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300   CONTINUE
+
+      i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/examples/factorial.F b/external_functions/examples/factorial.F
new file mode 100644
index 0000000..f46e143
--- /dev/null
+++ b/external_functions/examples/factorial.F
@@ -0,0 +1,187 @@
+*
+* factorial.F
+*
+* Kevin McHugh
+* 13/05/2003
+*
+* Returns the product of the factorial.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+      SUBROUTINE factorial_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns factorial of int(input) when 0 <= input < 35')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, YES, YES, YES)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+**********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE factorial_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER nval, idx
+      REAL fctrl
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1)) .OR.
+     .           (arg_1(i1,j1,k1,l1,m1,n1) .GE. 35.0)           .OR.
+     .           (arg_1(i1,j1,k1,l1,m1,n1) .LT. 0.0)            ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+               nval = INT(arg_1(i1,j1,k1,l1,m1,n1))
+               fctrl = 1.0
+               DO 10 idx = 2, nval
+                  fctrl = fctrl * idx
+ 10            CONTINUE
+               result(i,j,k,l,m,n) = fctrl
+
+            ENDIF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/pass_thru.F b/external_functions/examples/pass_thru.F
new file mode 100644
index 0000000..6d3c201
--- /dev/null
+++ b/external_functions/examples/pass_thru.F
@@ -0,0 +1,186 @@
+*
+* pass_thru.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE pass_thru_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        '(demonstration function) sets result equal to input' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, YES, YES, YES)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'this arg is passed through')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pass_thru_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+*
+*              Or you could bail out if there is bad data
+*
+*              CALL EF_BAIL_OUT(id, 'I refuse to work with bad data.')
+*
+
+            ELSE
+
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+
+            END IF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/percent_good_t.F b/external_functions/examples/percent_good_t.F
new file mode 100644
index 0000000..db7ed4c
--- /dev/null
+++ b/external_functions/examples/percent_good_t.F
@@ -0,0 +1,202 @@
+*
+* percent_good_t.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+*     returns % good data at each time step
+*     SET REGION information is observed when computing the result
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* axis_reduction     Are the result axes 'reduced' with respect to the
+*                    argument axes from which they are inherited?
+*                       ( RETAINED, REDUCED )
+*                       RETAINED        - result axis has same extent as argument axis
+*                       REDUCED         - result axis is reduced to a point
+*                >>> The axis_reduction defaults to RETAINED and only needs
+*                >>> to be applied when the result is reduced to a point but
+*                >>> SET REGION information should still be applied to the
+*                >>> external function arguments. (e.g. a function returning a status flag)
+*                >>> In such a case the result axes should be IMPLIED_BY_ARGS
+*                >>> and REDUCED.  (as opposed to NORMAL and RETAINED)
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE percent_good_t_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .     '(demonstration function) returns % good data at each time')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, YES, NO, NO)
+      CALL ef_set_axis_reduction_6d(id, REDUCED,  REDUCED, REDUCED,
+     .                                  RETAINED, REDUCED, REDUCED)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'data to be checked')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE percent_good_t_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER good, total
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*
+* Note that we are looping on the argument subscripts rather than
+* the result subscripts. (Looping on result subscripts is the usual
+* way).  That's because the result has axes which are normal and the
+* loop count on those normal axes will be one (res_incr will be zero).
+*
+
+* Only one index value for the result X, Y, Z, E, and F axes
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+* Outer loop over T axis
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+* Sum over all other axes of the argument
+       good = 0
+       total = 0
+
+       DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+        DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+          DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+           DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            total = total + 1
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+               good = good + 1
+            END IF
+
+ 100       CONTINUE
+
+ 200      CONTINUE
+
+ 300     CONTINUE
+
+ 500    CONTINUE
+
+ 600   CONTINUE
+
+* Assign the result for this time step
+       result(i,j,k,l,m,n) = (good * 100.0) / total
+
+       l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/status.F b/external_functions/examples/status.F
new file mode 100644
index 0000000..1270686
--- /dev/null
+++ b/external_functions/examples/status.F
@@ -0,0 +1,189 @@
+*
+* status.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* This function checks the input variable for bad data
+* and returns 0 (no bad flags) or 1 (bad flags found)
+*
+* NB_ External functions need to have regions defined on
+*     the arguments to have those regions used in the
+*     external function calculation.  Regions defined
+*     with SET REGION will not have the desired effect.
+*
+*     Use a command like:
+*
+*     let a = status(sst[x=180:160w,y=0:20n,l=1])
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE status_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'test for bad flags in data' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, NORMAL, 
+     .     NORMAL, NORMAL, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg, 'data to be checked')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE status_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      print *, ' result lo limits', res_lo_ss
+      print *, ' result hi limits', res_hi_ss
+
+* We'll give the data the benefit of the doubt and assume that
+* it's good unless we find out otherwise.
+
+      DO 40 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 30 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 20 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  result(i,j,k,l) = 0
+
+ 10            CONTINUE
+ 20         CONTINUE
+ 30      CONTINUE
+ 40   CONTINUE
+
+*
+* Note that we are looping on the argument subscripts rather than
+* the result subscripts (the normal way).  That's because the result
+* has axes which are normal and the loop count on those normal axes 
+* will be one.
+*
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+               l = res_lo_ss(T_AXIS)
+               DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+                  IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) THEN
+
+                     result(i,j,k,l) = 1
+
+                  END IF
+
+                  l = l + res_incr(T_AXIS)
+                  
+ 100           CONTINUE
+
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/examples/storage.F b/external_functions/examples/storage.F
new file mode 100644
index 0000000..8aad524
--- /dev/null
+++ b/external_functions/examples/storage.F
@@ -0,0 +1,253 @@
+*
+* storage.F
+*
+* Ansley Manke  (from Jonathan Callahan's storage)
+* Dec 10 1998
+*
+* This function allocates working storage which is
+* the size of the first argument and then uses that
+* storage in calculation of the result.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE storage_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'sets result equal to input/10')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'input')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE storage_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ilo, jlo, klo, llo, mlo, nlo
+      INTEGER ihi, jhi, khi, lhi, mhi, nhi
+      INTEGER array_num
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ilo = arg_lo_ss(X_AXIS,ARG1)
+      jlo = arg_lo_ss(Y_AXIS,ARG1)
+      klo = arg_lo_ss(Z_AXIS,ARG1)
+      llo = arg_lo_ss(T_AXIS,ARG1)
+      mlo = arg_lo_ss(E_AXIS,ARG1)
+      nlo = arg_lo_ss(F_AXIS,ARG1)
+
+      ihi = arg_hi_ss(X_AXIS,ARG1)
+      jhi = arg_hi_ss(Y_AXIS,ARG1)
+      khi = arg_hi_ss(Z_AXIS,ARG1)
+      lhi = arg_hi_ss(T_AXIS,ARG1)
+      mhi = arg_hi_ss(E_AXIS,ARG1)
+      nhi = arg_hi_ss(F_AXIS,ARG1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              ilo, jlo, klo, llo, mlo, nlo,
+     .                              ihi, jhi, khi, lhi, mhi, nhi)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE storage_compute(id, arg_1, result, workspace)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL workspace(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .               wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+               workspace(i1,j1,k1,l1,m1,n1) =
+     .               arg_1(i1,j1,k1,l1,m1,n1) / 10.0
+               result(i,j,k,l,m,n) = workspace(i1,j1,k1,l1,m1,n1)
+
+            END IF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/string_arg.F b/external_functions/examples/string_arg.F
new file mode 100644
index 0000000..70fa489
--- /dev/null
+++ b/external_functions/examples/string_arg.F
@@ -0,0 +1,196 @@
+*
+* string_arg.F
+*
+
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information
+*  consists of the following:
+*
+*  descr              Text description of the function
+*
+*  num_args           Required number of arguments
+*
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+*
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE string_arg_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Sets result equal to numeric value of input string ' //
+     .        'using dimensions of array input')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'Flags')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Result assigned where this array is defined')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'NString')
+      CALL ef_set_arg_desc(id, arg,
+     .        'A single numeric value as a string')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE string_arg_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*256 argstring
+      REAL argval
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_arg_string(id, ARG2, argstring)
+      READ (argstring, FMT=10, ERR=999) argval
+  10  FORMAT(F12.8)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+               result(i,j,k,l,m,n) = argval
+
+            ENDIF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100       CONTINUE
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, 'Argument 2 is not a numeric string')
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/strings.F b/external_functions/examples/strings.F
new file mode 100644
index 0000000..6ddc811
--- /dev/null
+++ b/external_functions/examples/strings.F
@@ -0,0 +1,177 @@
+*
+* strings.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* type               The argument is one of ( FLOAT_ARG, STRING_ARG )
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE strings_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'sets result equal to input' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'this arg is passed through')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE strings_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CHARACTER arg_name*24, arg_title*128, arg_units*32
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_arg_info(id, 1, arg_name, arg_title, arg_units)
+      CALL ef_get_axis_info(id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      WRITE(6,*) arg_name, arg_title, arg_units
+      WRITE(6,*) ' axis              units          bkwd mod reg'
+
+      DO 50 i=1, 4
+      	WRITE(6,66) ax_name(i), ax_units(i), backward(i), modulo(i),
+     .     regular(i)
+50    CONTINUE
+
+   66 FORMAT (a16, 2x, a16, 3i4)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF ( arg_1(i,j,k,l) .EQ. bad_flag(1) ) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     result(i,j,k,l) = arg_1(i,j,k,l)
+
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/examples/subtract.F b/external_functions/examples/subtract.F
new file mode 100644
index 0000000..68d859f
--- /dev/null
+++ b/external_functions/examples/subtract.F
@@ -0,0 +1,199 @@
+*
+*  subtract.F
+*
+*  Jonathan Callahan
+*  Feb 19th 1998
+*
+*  Returns the difference of two arguments.
+*
+
+
+*
+*  In this subroutine we provide information about
+*  the function.  The user configurable information
+*  consists of the following:
+*
+*  descr              Text description of the function
+*
+*  num_args           Required number of arguments
+*
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+*
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE subtract_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'(demonstration function) returns: A - B' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, YES, YES, YES)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+*  In this subroutine we compute the result
+*
+      SUBROUTINE subtract_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+       m1 = arg_lo_ss(E_AXIS,ARG1)
+       m2 = arg_lo_ss(E_AXIS,ARG2)
+       DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        l2 = arg_lo_ss(T_AXIS,ARG2)
+        DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1)
+          j2 = arg_lo_ss(Y_AXIS,ARG2)
+          DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1)
+           i2 = arg_lo_ss(X_AXIS,ARG2)
+           DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            IF ( (arg_1(i1,j1,k1,l1,m1,n2) .EQ. bad_flag(ARG1)) .OR.
+     .           (arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2)) ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1) -
+     .                               arg_2(i2,j2,k2,l2,m2,n2)
+
+            ENDIF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 100       CONTINUE
+     
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 200      CONTINUE
+
+          k1 = k1 + arg_incr(Z_AXIS,ARG1)
+          k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400    CONTINUE
+
+        m1 = m1 + arg_incr(E_AXIS,ARG1)
+        m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500   CONTINUE
+
+       n1 = n1 + arg_incr(F_AXIS,ARG1)
+       n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/examples/times_table.F b/external_functions/examples/times_table.F
new file mode 100644
index 0000000..441cd37
--- /dev/null
+++ b/external_functions/examples/times_table.F
@@ -0,0 +1,214 @@
+*
+* times_table.F
+*
+* Jonathan Callahan
+* Feb 19th 1998
+*
+* Returns A with the T axis replaced by a multiplication table of length B.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* version            Ferret internal EF version number
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE times_table_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_desc(id,'creates a times table' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'argument being multiplied')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'N')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'extent of table')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE times_table_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      COMMON / times_table / my_lo_l, my_hi_l
+      INTEGER my_lo_l, my_hi_l
+
+      REAL value
+      INTEGER arg, ivalue
+
+*     You could use utility functions at this point to get 
+*     context information about the other arguments.  This info 
+*     could be used to update the custom or abstract axis lo and hi
+*     indices.
+
+      arg = 2
+
+      CALL ef_get_one_val(id, arg, value)
+      
+      ivalue = value
+
+      my_lo_l = 1
+      my_hi_l = ivalue
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE times_table_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      COMMON / times_table / my_lo_l, my_hi_l
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     This check to make sure we only have a single point on the T axis
+
+      IF ( arg_lo_ss(T_AXIS,ARG1) .NE. arg_hi_ss(T_AXIS,ARG1) ) THEN
+         WRITE (6,*) 'EF ERROR: Improper range on T axis of argument.'
+      END IF
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=my_lo_l, my_hi_l
+
+
+                  IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     result(i,j,k,l) = l * arg_1(i1,j1,k1,l1)
+
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/extrema/Makefile b/external_functions/extrema/Makefile
new file mode 100644
index 0000000..80b787b
--- /dev/null
+++ b/external_functions/extrema/Makefile
@@ -0,0 +1,58 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+# *sh* 2/2000 - removed SAMPLEIJ from target list (replaced by SAMPLEXY)
+#
+# ACM 2/2001  debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+ 
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.o:
+	$(F77) $(FFLAGS) -c $<
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o minminmax.o maxminmax.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:    minminmax.o maxminmax.o findhi.so findlo.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/extrema/findhi.F b/external_functions/extrema/findhi.F
new file mode 100644
index 0000000..b5cbde4
--- /dev/null
+++ b/external_functions/extrema/findhi.F
@@ -0,0 +1,356 @@
+*
+* findhi.F
+*
+* Ansley Manke
+* July 02, 2001
+*
+* This function locates local extrema, returning "highs".
+*
+* 1/21/01 change order of axes: result is on X axis, J index
+*         gives component of result (x,y,z)
+*         And change arguments 2 and 3 to RANGE rather than # Grid cells
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE findhi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('Find local maxima of var, return',
+     .        ' HIGHS on X axis. j=1 xpos,j=2 ypos,j=3 HI value')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, ABSTRACT, 
+     .			IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'var in X, Y and optionally Z, T')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Find local maxima in neighborhood +- XRANGE, data units')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Find local maxmia in neighborhood +- YRANGE, data units')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE findhi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo, my_hi, nx, ny
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the argument.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+      my_lo = 1
+      my_hi = 1
+
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+      my_hi = nx* ny	! an absolute upper bound
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+      my_lo = 1
+      my_hi = 1
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE findhi_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mx1, my1, mxy, mydim
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+      mydim = 3
+      mxy = mx1 * my1
+
+*  xyfield
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mx1, my1, 1, 1)
+
+*  zmaxlist
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mydim, mxy, 1, 1)
+
+*  xax
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   2*mx1, 1, 1, 1)
+
+*  yax
+      iwork = 4
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   2*my1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE findhi_compute(id, arg_1, arg_2, arg_3, result, 
+     .                          xyfield, zmaxlist, xax, yax)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, i1,j1, k1, l1, arg, nx, ny, nzmax, ip, jp,
+     .        neigh_x, neigh_y
+      REAL    dx, dy, xrange, yrange
+
+*  Dimension the work arrays.
+
+      REAL xyfield(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL zmaxlist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 xax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yax(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  Get the axis coordinates
+      arg = 1
+      CALL ef_get_coordinates(id, arg, X_AXIS, arg_lo_ss(X_AXIS,arg),
+     .   arg_hi_ss(X_AXIS,arg), xax)
+      CALL ef_get_coordinates(id, arg,Y_AXIS, arg_lo_ss(Y_AXIS,arg),
+     .   arg_hi_ss(Y_AXIS,arg), yax)
+
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      dx = xax(2,1,1,1) - xax(1,1,1,1)
+      dy = yax(2,1,1,1) - yax(1,1,1,1)
+
+*  Get the parameters neigh_x, neigh_y, to determine the region in which relative 
+*  mins are found: 
+C A RELATIVE MINIMUM (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) 
+C POINT WITHIN A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED 
+C HERE IS + OR - neigh_x IN THE X DIRECTION AND + OR - neigh_y IN THE Y 
+C DIRECTION
+
+      CALL ef_get_one_val (id, ARG2, xrange)
+      neigh_x = MAX(1, INT (xrange/dx))
+      CALL ef_get_one_val (id, ARG3, yrange)
+      neigh_y = MAX(1, INT (yrange/dy))
+
+*  For each level and each time, call maxminmax to get the maxima.
+*  Determine the coordinates of the max's and put with the max value
+*  into the result
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 400 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 300 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+	    DO 200 j = 1, ny
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = 1, nx
+                  xyfield(i,j,1,1) = arg_1(i1,j1,k1,l1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+  100          CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+  200       CONTINUE
+
+            CALL MAXMINMAX (xyfield, nx, nx, ny, neigh_x, neigh_y, 
+     .                      bad_flag(ARG1), zmaxlist, nzmax)
+
+C  result(i,1,k,l) = X index of max
+C  result(i,2,k,l) = Y index of max
+C  result(i,3,k,l) = z value at max
+
+            DO 210 i = 1, nzmax
+               ip = INT(zmaxlist(1,i,1,1))
+               jp = INT(zmaxlist(2,i,1,1))
+               result(i,1,k,l) = xax(ip,1,1,1)
+               result(i,2,k,l) = yax(jp,1,1,1)
+               result(i,3,k,l) = zmaxlist(3,i,1,1)
+ 210        CONTINUE
+
+C  Fill end of result with missing-data flags
+
+            DO 230 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               DO 220 i = nzmax+1, res_hi_ss(X_AXIS)
+                  result(i,j,k,l) = bad_flag_result
+ 220           CONTINUE
+ 230        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 300     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/extrema/findlo.F b/external_functions/extrema/findlo.F
new file mode 100644
index 0000000..fc8232b
--- /dev/null
+++ b/external_functions/extrema/findlo.F
@@ -0,0 +1,359 @@
+*
+* findlo.F
+*
+* Ansley Manke
+* July 02, 2001
+*
+* This function locates local extrema, returning "lows".
+*
+* 1/21/01 change order of axes: pts listed on X axis, J index
+*         gives component of result (x,y,z)
+*         And change arguments 2 and 3 to RANGE rather than # Grid cells
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE findlo_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('Find local minima of var, return',
+     .        ' LOWS on X axis. j=1 xpos,j=2 ypos,j=3 LO value')
+
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, ABSTRACT, 
+     .			IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'var in X, Y and optionally Z, T')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Find local minima in neighborhood +- XRANGE, data units')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Find local minima in neighborhood +- YRANGE, data units')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE findlo_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo, my_hi, nx, ny
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the argument.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+      my_lo = 1
+      my_hi = 1
+
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+      my_hi = nx* ny	! an absolute upper bound
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+      my_lo = 1
+      my_hi = 1
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE findlo_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mx1, my1, mxy, mydim
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+      mydim = 3
+      mxy = mx1 * my1
+
+
+*  xyfield
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mx1, my1, 1, 1)
+
+*  zminlist
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mydim, mxy, 1, 1)
+
+*  xax
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   2*mx1, 1, 1, 1)
+
+*  yax
+      iwork = 4
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   2*my1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE findlo_compute(id, arg_1, arg_2, arg_3, result, 
+     .                          xyfield, zminlist, xax, yax)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, i1, j1, k1, l1, arg, nx, ny, nzmin, ip, jp, 
+     .        neigh_x, neigh_y
+      REAL    dx, dy, xrange, yrange
+
+*  Dimension the work arrays.
+
+      REAL xyfield(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL zminlist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 xax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yax(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  Get the axis coordinates
+      arg = 1
+      CALL ef_get_coordinates(id, arg, X_AXIS, arg_lo_ss(X_AXIS,arg),
+     .   arg_hi_ss(X_AXIS,arg), xax)
+      CALL ef_get_coordinates(id, arg,Y_AXIS, arg_lo_ss(Y_AXIS,arg),
+     .   arg_hi_ss(Y_AXIS,arg), yax)
+
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      dx = xax(2,1,1,1) - xax(1,1,1,1)
+      dy = yax(2,1,1,1) - yax(1,1,1,1)
+
+*  Get the parameters neigh_x, neigh_y, to determine the region in which relative 
+*  mins are found: 
+C A RELATIVE MINIMUM (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) 
+C POINT WITHIN A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED 
+C HERE IS + OR - neigh_x IN THE X DIRECTION AND + OR - neigh_y IN THE Y 
+C DIRECTION
+
+      CALL ef_get_one_val (id, ARG2, xrange)
+      neigh_x = MAX(1, INT (xrange/dx))
+      CALL ef_get_one_val (id, ARG3, yrange)
+      neigh_y = MAX(1, INT (yrange/dy))
+
+*  For each level and each time, call minminmax to get the minima.
+*  Determine the coordinates of the min's and put with the min value
+*  into the result
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 400 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 300 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+	    DO 200 j = 1, ny
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = 1, nx
+                  xyfield(i,j,1,1) = arg_1(i1,j1,k1,l1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+  100          CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+  200       CONTINUE
+
+            CALL MINMINMAX (xyfield, nx, nx, ny, neigh_x, neigh_y, 
+     .                      bad_flag(ARG1), zminlist, nzmin)
+
+C  result(i,1,k,l) = X index of max
+C  result(i,2,k,l) = Y index of max
+C  result(i,3,k,l) = z value at max
+
+            DO 210 i = 1, nzmin
+               ip = INT(zminlist(1,i,1,1))
+               jp = INT(zminlist(2,i,1,1))
+               result(i,1,k,l) = xax(ip,1,1,1)
+               result(i,2,k,l) = yax(jp,1,1,1)
+               result(i,3,k,l) = zminlist(3,i,1,1)
+ 210        CONTINUE
+
+C  Fill end of result with missing-data flags
+
+            DO 230 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               DO 220 i = nzmin+1, res_hi_ss(X_AXIS)
+                  result(i,j,k,l) = bad_flag_result
+ 220           CONTINUE
+ 230        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 300     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/extrema/maxminmax.F b/external_functions/extrema/maxminmax.F
new file mode 100644
index 0000000..5e19818
--- /dev/null
+++ b/external_functions/extrema/maxminmax.F
@@ -0,0 +1,199 @@
+
+      SUBROUTINE maxMINMAX  (Z, L, MM, NN, neigh_x, neigh_y, badz, 
+     .                      zmaxlist, nzmax)
+C
+C  based on NCAR routine MINMAX, return maxima
+C  From the NCAR graphics library at http://ngwww.ucar.edu version 4.2
+C  Modified by Ansley Manke to regurn only the maxima for subroutine findhi.F
+C
+C-------------------------------------------------------------
+C	$Id: maxminmax.F 11665 2011-01-06 20:18:22Z ksmith $
+C                                                                      
+C                Copyright (C)  2000
+C        University Corporation for Atmospheric Research
+C                All Rights Reserved
+C
+C This file is free software; you can redistribute it and/or modify
+C it under the terms of the GNU General Public License as published
+C by the Free Software Foundation; either version 2 of the License, or
+C (at your option) any later version.
+C
+C This software is distributed in the hope that it will be useful, but
+C WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+C General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with this software; if not, write to the Free Software
+C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+C USA.
+C-------------------------------------------------------------
+
+CC THIS ROUTINE FINDS RELATIVE MINIMUMS AND MAXIMUMS.  A RELATIVE MINIMUM
+C (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) POINT WITHIN
+C A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED HERE
+C IS + OR - MN IN THE X DIRECTION AND + OR - NM IN THE Y DIRECTION.
+C
+C ORIGINATOR       DAVID KENNISON
+
+C  Ansley Manke changes for Ferret 7/01
+C	- remove sections that put label on plot
+C	- use "bad value" rather than SPECIAL VALUE, SPVAL
+C	- remove references to IOFFP, JOFFDT
+c	- new code and my comments in lowercase
+c	- return maxes.  For n = 1, nzmax:
+c	    zmaxlist(1,n) = i index of zmax point
+c	    zmaxlist(2,n) = j index of zmax point
+c	    zmaxlist(3,n) = z value at zmax point
+C
+      integer	L, MM, NN, m, n, nm1, mm1, jp, im, mn, ip, is, it, ii,
+     .		js, nm, jt, jk, ik, nzmax, neigh_x, neigh_y
+
+      real	Z(L,NN), aa, an, badz, zmaxlist(3,*)
+C
+      M = MM
+      N = NN
+
+c      MN = min(2,MAX(2,IFIX(FLOAT(M)/8.)))
+c      NM = min(2,MAX(2,IFIX(FLOAT(N)/8.)))
+
+      MN = neigh_x
+      NM = neigh_y
+
+      nzmax = 0
+C
+      NM1 = N-1
+      MM1 = M-1
+C
+C LINE LOOP FOLLOWS - THE COMPLETE TWO-DIMENSIONAL TEST FOR A MINIMUM OR
+C MAXIMUM OF THE FIELD IS ONLY PERFORMED FOR POINTS WHICH ARE MINIMA OR
+C MAXIMA ALONG SOME LINE - FINDING THESE CANDIDATES IS MADE EFFICIENT BY
+C USING A COUNT OF CONSECUTIVE INCREASES OR DECREASES OF THE FUNCTION
+C ALONG THE LINE
+C
+      DO 127 JP=2,NM1
+C
+         IM = MN-1
+         IP = -1
+         GO TO 126
+C
+C CONTROL RETURNS TO STATEMENT 10 AS LONG AS THE FUNCTION IS INCREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MAXIMUM
+C
+  101    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 104
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 102,103,104
+  102    IM = IM+1
+         GO TO 101
+  103    IM = 0
+         GO TO 101
+C
+C FUNCTION DECREASED - TEST FOR MAXIMUM ON LINE
+C
+  104    IF (IM .GE. MN) GO TO 106
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 106
+         DO 105 II=IS,IT
+            IF (AA .LE. Z(II,JP)) GO TO 112
+  105    CONTINUE
+  106    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 109
+         DO 108 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 107
+            IP = II-1
+            GO TO 125
+  107       IF (AA .LE. Z(II,JP)) GO TO 112
+  108    CONTINUE
+C
+C WE HAVE MAXIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MAXIMUM OF FIELD
+C
+  109    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 111 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 111
+            DO 110 IK=IS,IT
+               IF (Z(IK,JK).GE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 112
+  110       CONTINUE
+  111    CONTINUE
+
+	 nzmax = nzmax + 1
+	 zmaxlist(1,nzmax) = float(ip)
+	 zmaxlist(2,nzmax) = float(jp)
+	 zmaxlist(3,nzmax) = z(ip,jp)
+
+  112    IM = 1
+         IF (IP-MM1) 113,127,127
+C
+C CONTROL RETURNS TO STATEMENT 20 AS LONG AS THE FUNCTION IS DECREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MINIMUM
+C
+  113    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 116
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 116,115,114
+  114    IM = IM+1
+         GO TO 113
+  115    IM = 0
+         GO TO 113
+C
+C FUNCTION INCREASED - TEST FOR MINIMUM ON LINE
+C
+  116    IF (IM .GE. MN) GO TO 118
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 118
+         DO 117 II=IS,IT
+            IF (AA .GE. Z(II,JP)) GO TO 124
+  117    CONTINUE
+  118    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 121
+         DO 120 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 119
+            IP = II-1
+            GO TO 125
+  119       IF (AA .GE. Z(II,JP)) GO TO 124
+  120    CONTINUE
+C
+C WE HAVE MINIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MINIMUM OF FIELD
+C
+  121    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 123 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 123
+            DO 122 IK=IS,IT
+               IF (Z(IK,JK).LE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 124
+  122       CONTINUE
+  123    CONTINUE
+C
+  124    IM = 1
+         IF (IP-MM1) 101,127,127
+C
+C SKIP SPECIAL VALUES ON LINE
+C
+  125    IM = 0
+  126    IP = IP+1
+         IF (IP .GE. MM1) GO TO 127
+         IF (Z(IP+1,JP).EQ.badz) GO TO 125
+         IM = IM+1
+         IF (IM .LE. MN) GO TO 126
+         IM = 1
+         AN = Z(IP+1,JP)
+         IF (Z(IP,JP)-AN) 101,103,113
+C
+  127 CONTINUE
+C
+      RETURN
+
+      END
diff --git a/external_functions/extrema/minmax_label_demo.jnl b/external_functions/extrema/minmax_label_demo.jnl
new file mode 100644
index 0000000..288b738
--- /dev/null
+++ b/external_functions/extrema/minmax_label_demo.jnl
@@ -0,0 +1,29 @@
+! example to call label_hi_lo.jnl to label extrema 
+
+use coads_climatology
+set region/l=7/x=100:360/y=-20:60
+
+fill/line/pal=no_red slp; go fland
+go label_hi_lo.jnl slp label 10 8 green purple
+
+pause
+contour slp
+go fland
+go label_hi_lo.jnl slp mark 6 6 red blue
+
+pause
+! note: cannot set region in square brackets on the call to 
+!       label_hi_lo, but as long as the time region is set,the
+!       script gets ppl$xmin, ppl$xmax, etc and is ok
+
+can region
+set region/l=7
+fill/line/pal=no_red slp[l=7,x=100:360,y=-20:60]; go fland
+go label_hi_lo.jnl slp label 10 8 green purple
+
+message but this fails:
+
+can region
+
+fill/line/pal=no_red/l=7/x=100:360/y=-20:60 slp; go fland
+go label_hi_lo.jnl slp[l=7] label 10 8 green purple
diff --git a/external_functions/extrema/minminmax.F b/external_functions/extrema/minminmax.F
new file mode 100644
index 0000000..47c0737
--- /dev/null
+++ b/external_functions/extrema/minminmax.F
@@ -0,0 +1,196 @@
+      SUBROUTINE minMINMAX (Z, L, MM, NN, neigh_x, neigh_y, badz, 
+     .                      zminlist, nzmin)
+C
+C  based on NCAR routine MINMAX, return minima
+C  From the NCAR graphics library at http://ngwww.ucar.edu version 4.2
+C  Modified by Ansley Manke to regurn only the minima for subroutine findlo.F
+C-------------------------------------------------------------
+C	$Id: minminmax.F 11665 2011-01-06 20:18:22Z ksmith $
+C                                                                      
+C                Copyright (C)  2000
+C        University Corporation for Atmospheric Research
+C                All Rights Reserved
+C
+C This file is free software; you can redistribute it and/or modify
+C it under the terms of the GNU General Public License as published
+C by the Free Software Foundation; either version 2 of the License, or
+C (at your option) any later version.
+C
+C This software is distributed in the hope that it will be useful, but
+C WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+C General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with this software; if not, write to the Free Software
+C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+C USA.
+C-------------------------------------------------------------
+
+C THIS ROUTINE FINDS RELATIVE MINIMUMS AND MAXIMUMS.  A RELATIVE MINIMUM
+C (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) POINT WITHIN
+C A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED HERE
+C IS + OR - MN IN THE X DIRECTION AND + OR - NM IN THE Y DIRECTION.
+C
+C ORIGINATOR       DAVID KENNISON
+
+C  Ansley Manke changes for Ferret 7/01
+C	- remove sections that put label on plot
+C	- use "bad value" rather than SPECIAL VALUE, SPVAL
+C	- remove references to IOFFP, JOFFDT
+c	- new code and my comments in lowercase
+c	- return mins.  For n = 1, nzmin:
+c	    zminlist(1,n) = i index of zmin point
+c	    zminlist(2,n) = j index of zmin point
+c	    zminlist(3,n) = z value at zmin point
+C
+      integer	L, MM, NN, m, n, nm1, mm1, jp, im, mn, ip, is, it, ii, 
+     .		js, nm, jt, jk, ik, nzmin, neigh_x, neigh_y
+      real	Z(L,NN), aa, an, badz, zminlist(3,*)
+C
+      M = MM
+      N = NN
+
+c      MN = min(2,MAX(2,IFIX(FLOAT(M)/8.)))
+c      NM = min(2,MAX(2,IFIX(FLOAT(N)/8.)))
+
+      MN = neigh_x
+      NM = neigh_y
+
+      nzmin = 0
+C
+      NM1 = N-1
+      MM1 = M-1
+C
+C LINE LOOP FOLLOWS - THE COMPLETE TWO-DIMENSIONAL TEST FOR A MINIMUM OR
+C MAXIMUM OF THE FIELD IS ONLY PERFORMED FOR POINTS WHICH ARE MINIMA OR
+C MAXIMA ALONG SOME LINE - FINDING THESE CANDIDATES IS MADE EFFICIENT BY
+C USING A COUNT OF CONSECUTIVE INCREASES OR DECREASES OF THE FUNCTION
+C ALONG THE LINE
+C
+      DO 127 JP=2,NM1
+C
+         IM = MN-1
+         IP = -1
+         GO TO 126
+C
+C CONTROL RETURNS TO STATEMENT 10 AS LONG AS THE FUNCTION IS INCREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MAXIMUM
+C
+  101    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 104
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 102,103,104
+  102    IM = IM+1
+         GO TO 101
+  103    IM = 0
+         GO TO 101
+C
+C FUNCTION DECREASED - TEST FOR MAXIMUM ON LINE
+C
+  104    IF (IM .GE. MN) GO TO 106
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 106
+         DO 105 II=IS,IT
+            IF (AA .LE. Z(II,JP)) GO TO 112
+  105    CONTINUE
+  106    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 109
+         DO 108 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 107
+            IP = II-1
+            GO TO 125
+  107       IF (AA .LE. Z(II,JP)) GO TO 112
+  108    CONTINUE
+C
+C WE HAVE MAXIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MAXIMUM OF FIELD
+C
+  109    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 111 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 111
+            DO 110 IK=IS,IT
+               IF (Z(IK,JK).GE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 112
+  110       CONTINUE
+  111    CONTINUE
+
+  112    IM = 1
+         IF (IP-MM1) 113,127,127
+C
+C CONTROL RETURNS TO STATEMENT 20 AS LONG AS THE FUNCTION IS DECREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MINIMUM
+C
+  113    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 116
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 116,115,114
+  114    IM = IM+1
+         GO TO 113
+  115    IM = 0
+         GO TO 113
+C
+C FUNCTION INCREASED - TEST FOR MINIMUM ON LINE
+C
+  116    IF (IM .GE. MN) GO TO 118
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 118
+         DO 117 II=IS,IT
+            IF (AA .GE. Z(II,JP)) GO TO 124
+  117    CONTINUE
+  118    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 121
+         DO 120 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 119
+            IP = II-1
+            GO TO 125
+  119       IF (AA .GE. Z(II,JP)) GO TO 124
+  120    CONTINUE
+C
+C WE HAVE MINIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MINIMUM OF FIELD
+C
+  121    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 123 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 123
+            DO 122 IK=IS,IT
+               IF (Z(IK,JK).LE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 124
+  122       CONTINUE
+  123    CONTINUE
+
+	 nzmin = nzmin + 1
+	 zminlist(1,nzmin) = float(ip)
+	 zminlist(2,nzmin) = float(jp)
+	 zminlist(3,nzmin) = z(ip,jp)
+C
+  124    IM = 1
+         IF (IP-MM1) 101,127,127
+C
+C SKIP SPECIAL VALUES ON LINE
+C
+  125    IM = 0
+  126    IP = IP+1
+         IF (IP .GE. MM1) GO TO 127
+         IF (Z(IP+1,JP).EQ.badz) GO TO 125
+         IM = IM+1
+         IF (IM .LE. MN) GO TO 126
+         IM = 1
+         AN = Z(IP+1,JP)
+         IF (Z(IP,JP)-AN) 101,103,113
+C
+  127 CONTINUE
+C
+      RETURN
+
+      END
diff --git a/external_functions/extrema/testr.jnl b/external_functions/extrema/testr.jnl
new file mode 100644
index 0000000..72bb70f
--- /dev/null
+++ b/external_functions/extrema/testr.jnl
@@ -0,0 +1,36 @@
+
+use etopo60
+let neigh = $1%10%
+
+let xmin = 200
+let xmax = 280
+let ymin = 0
+let ymax = 60
+fill/pal=land_sea rose[x=`xmin`:`xmax`,y=`ymin`:`ymax`]
+contour/over/lev=(-6000,4000,500) rose[x=`xmin`:`xmax`,y=`ymin`:`ymax`]
+
+! use script for easier control
+go label_hi_lo rose label `neigh`, `neigh` blue red
+
+! add more labels as H and L?
+let n = min(2, `neigh - 1`)
+
+go label_hi_lo rose mark `n`, `n` purple green
+
+
+!let rosehi = findhi(rose[x=`xmin`:`xmax`,y=`ymin`:`ymax`], `neigh`, `neigh`)
+!let roselo = findlo(rose[x=`xmin`:`xmax`,y=`ymin`:`ymax`], `neigh`, `neigh`)
+
+!let xph = rosehi[i=1]
+!let yph = rosehi[i=2]
+!let zph = rosehi[i=3]
+
+!go polymark poly/over/nolab/pal=white xph,yph,zph,rectangle,1.2
+!repeat/k=1:20 (let xp=xph[j=`k`]; let yp=yph[j=`k`]; let zp=zph[j=`k`]; IF `xp NE 999` THEN IF `yp ne 999` THEN  label `xp`, `yp-0.5`, 0,0, 0.08, "@cr`zp`")
+
+!let xpl = roselo[i=1]
+!let ypl = roselo[i=2]
+!let zpl = roselo[i=3]
+
+!go polymark poly/over/nolab/pal=red xpl,ypl,zpl,rectangle,1.2
+!repeat/k=1:20 (let xp=xpl[j=`k`]; let yp=ypl[j=`k`]; let zp=zpl[j=`k`]; IF `xp NE 999` THEN IF `yp ne 999` THEN  label `xp`, `yp-0.5`, 0,0, 0.08, "@cr`zp`")
diff --git a/external_functions/featurecollections/Makefile b/external_functions/featurecollections/Makefile
new file mode 100644
index 0000000..76c953d
--- /dev/null
+++ b/external_functions/featurecollections/Makefile
@@ -0,0 +1,40 @@
+#
+# Makefile for Ferret External Functions
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+ 
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c  $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	fc_isubset.so expnd_by_len.so
+ 
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) -g -Ddebug" "CFLAGS = $(CFLAGS) -g -Ddebug"  all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/featurecollections/expnd_by_len.F b/external_functions/featurecollections/expnd_by_len.F
new file mode 100644
index 0000000..adcc9d5
--- /dev/null
+++ b/external_functions/featurecollections/expnd_by_len.F
@@ -0,0 +1,231 @@
+*
+* expnd_by_len.F
+*
+* Ansley Manke 12/2011
+*
+* This function takes a variable and a set of lengths
+* and returns the variable with element 1 repeated len1 times,
+* then element 2 repeated len2 times, etc.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expnd_by_len_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 
+     . 'Returns a variable expanded by the lengths given in arg 2' )
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, 
+     .     NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'var')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'1D variable to expand')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'len')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'lengths to expand each element of argument 1')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nx')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'length of result (sum of lengths in arg 2)')
+      CALL ef_set_arg_unit(id, arg, ' ')
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE expnd_by_len_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE expnd_by_len_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER m, n, count
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check that the lists are 1D
+
+      errtxt = 'Argument 1 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG1) - arg_lo_ss(i,ARG1) + 1 
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+
+      errtxt = 'Argument 2 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) + 1
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+      
+* Put the requested features into the result
+
+      i2=arg_lo_ss(X_AXIS,ARG2)
+      j2=arg_lo_ss(Y_AXIS,ARG2)
+      k2=arg_lo_ss(Z_AXIS,ARG2)
+      l2=arg_lo_ss(T_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 200 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 200 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+         IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) GOTO 300  ! done
+         IF ( arg_2(i2,j2,k2,l2) .EQ. bad_flag(2) ) GOTO 300
+
+	 val = arg_1(i1,j1,k1,l1)         ! variable value
+         count = INT(arg_2(i2,j2,k2,l2))  ! number to put
+
+         DO 100 n = 1, count
+            result(i,j,k,l) = val
+            i = i + 1
+ 100     CONTINUE
+
+      i2 = i2 + arg_incr(X_AXIS,ARG2)
+      j2 = j2 + arg_incr(Y_AXIS,ARG2)
+      k2 = k2 + arg_incr(Z_AXIS,ARG2)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200  CONTINUE
+
+ 300  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/external_functions/featurecollections/fc_isubset.F b/external_functions/featurecollections/fc_isubset.F
new file mode 100644
index 0000000..7135e4c
--- /dev/null
+++ b/external_functions/featurecollections/fc_isubset.F
@@ -0,0 +1,289 @@
+*
+* fc_isubset.F
+*
+* Ansley Manke 11/28/2011
+* See ticket 1897
+*
+* This function returns a subset of data given start indices and
+* sizes of features in a 1D array.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fc_isubset_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Returns a subset of a feature collection' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, CUSTOM, NORMAL, NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'index_list')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'starting indices of features of interest')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lengths')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'lengths of the features of interest')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nx')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'length of result (sum of lengths in arg 2)')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'FullData')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'input data: 1D list from which to select features')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE fc_isubset_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fc_isubset_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      CALL ef_set_custom_axis (id, X_AXIS, 1., val, 1., 'X', NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fc_isubset_compute(id, arg_1, arg_2, arg_3, arg_4, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER i4, j4, k4, l4
+      INTEGER m, n, count
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check that the lists are 1D
+
+      errtxt = 'Argument 1 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG1) - arg_lo_ss(i,ARG1) + 1 
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+
+      errtxt = 'Argument 2 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) + 1
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+      
+* Put the requested features into the result
+
+      i2=arg_lo_ss(X_AXIS,ARG2)
+      j2=arg_lo_ss(Y_AXIS,ARG2)
+      k2=arg_lo_ss(Z_AXIS,ARG2)
+      l2=arg_lo_ss(T_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+
+      DO 500 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      DO 500 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 500 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 500 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+         IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) GOTO 600  ! done
+         IF ( arg_2(i2,j2,k2,l2) .EQ. bad_flag(2) ) GOTO 600
+
+	 i4 = INT(arg_1(i1,j1,k1,l1))     ! start index
+         count = INT(arg_2(i2,j2,k2,l2))  ! number to put
+
+         l4 = arg_lo_ss(T_AXIS,ARG4)
+         DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+	    k4 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               j4 = res_lo_ss(Y_AXIS)
+	       DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  DO 100 n = 1, count
+                     result(i,j,k,l) = arg_4(i4,j4,k4,l4)
+                     i4 = i4 + 1
+                     i = i + 1
+ 100              CONTINUE
+ 
+                  j4 = j4 + arg_incr(Y_AXIS,ARG4)
+ 200           CONTINUE
+               k4 = k4 + arg_incr(Z_AXIS,ARG4)
+ 300        CONTINUE
+
+            l4 = l4 + arg_incr(T_AXIS,ARG4)
+ 400     CONTINUE
+
+      i2 = i2 + arg_incr(X_AXIS,ARG2)
+      j2 = j2 + arg_incr(Y_AXIS,ARG2)
+      k2 = k2 + arg_incr(Z_AXIS,ARG2)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 500  CONTINUE
+
+ 600  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/external_functions/fft/Makefile b/external_functions/fft/Makefile
new file mode 100644
index 0000000..08cbe0e
--- /dev/null
+++ b/external_functions/fft/Makefile
@@ -0,0 +1,60 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+# Ansley Manke: compile subroutines separately w/ fewer flags.
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+# 2/2001  debug macros
+# 1/2002  need $(F77) in .F.so rule
+#         and compile ffta_sample, fftp_sample functions
+# 7/2012  Do not need a special platform_specific file.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+SUB_OBJS = fftinv_subs.o
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	fftinv_subs.o fftsubs.o fft_amp.so fft_phas.so ffta_sample.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/fft/del_lopass.jnl b/external_functions/fft/del_lopass.jnl
new file mode 100644
index 0000000..3368250
--- /dev/null
+++ b/external_functions/fft/del_lopass.jnl
@@ -0,0 +1,8 @@
+
+go delta_function 512 delta
+list/l=1:20 delta
+
+let lp9 = lsl_lowpass(delta, 35, 9)
+
+let fft9=ffta(missing(lp9,0))
+plot/line fft9
diff --git a/external_functions/fft/delta_function.jnl b/external_functions/fft/delta_function.jnl
new file mode 100644
index 0000000..f604f1b
--- /dev/null
+++ b/external_functions/fft/delta_function.jnl
@@ -0,0 +1,16 @@
+! delta_function.jnl
+! Description: Defines a Dirac delta function at central point in time
+
+! Programmed by E. D. Cokelet, NOAA/PMEL, 30 Nov 1999
+
+! Usage:  go delta_function central_point_index_number output_function_name
+! The output delta function's time range will be 2*(central_point_index_number)
+
+can mode verify
+
+define axis/units=hours/t=1:`2*$1`:1 t_ax_delta
+let tim_delta = t[gt=t_ax_delta]
+define grid/t=t_ax_delta grid_delta
+
+let delta_delta = if tim_delta eq `$1` then 1 else 0
+let $2 = delta_delta[g=grid_delta]
diff --git a/external_functions/fft/fft_amp.F b/external_functions/fft/fft_amp.F
new file mode 100644
index 0000000..90b9c40
--- /dev/null
+++ b/external_functions/fft/fft_amp.F
@@ -0,0 +1,452 @@
+*
+* fft_amp.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssfft_amp = fft_amp(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fft_amp(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_amp_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 
+     . 'Computes fft amplitude spectra, normalized by 1/N, WITH CORRECTED FREQ AXIS' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable with regular time axis. Specify time explicitly e.g. fft_amp(var[l=1,96])')
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_amp_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL*8 yquist, freq1, freqn
+      REAL yq, f1, fn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_amp_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_amp_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_amp_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('fft_amp encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('fft_amp encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fft_im.F b/external_functions/fft/fft_im.F
new file mode 100644
index 0000000..6573204
--- /dev/null
+++ b/external_functions/fft/fft_im.F
@@ -0,0 +1,462 @@
+*------------------------------fft_im.F--------------------------------
+* fft_im.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+*
+* This function returns the imaginary part of the FFT transform. The result 
+* time axis is a custom axis in period 1./time  The time axis must be regular.
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_im_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*                                                                      V
+      CALL ef_set_desc(id, 'Computes imaginary part of fft transform' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis.')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_im_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+     
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_im_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_im_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_im_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+*
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l) = b(l,1,1,1)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fft_inverse.F b/external_functions/fft/fft_inverse.F
new file mode 100644
index 0000000..b031519
--- /dev/null
+++ b/external_functions/fft/fft_inverse.F
@@ -0,0 +1,383 @@
+*------------------------------fft_inverse.F---------------------------
+
+* fft_inverse.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* November 2001
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+*
+* This function computes inverse fft transform spectrum for each A,B,
+* where these are the real and imaginary part of the FFT coefficients.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_inverse_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 fcn_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      WRITE (fcn_desc, 20)
+      CALL ef_set_desc(id, fcn_desc)
+   20 FORMAT ( 'Computes inverse fft time series' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Real part of FFT coefficients')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .                 'Imaginary part of FFT coefficients')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_inverse_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*  Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntime = 1
+
+      nfreq = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      ntime = nfreq* 2
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, ntime)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_inverse_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 4.* 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_inverse_compute(id, arg_1, arg_2, result, 
+     .                               a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      INTEGER ntime, nfreq
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of freq points.
+
+      arg = 1
+      nfreq = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      ntime = nfreq* 2
+
+*  Check that arg1 and arg2 have the same axes.
+
+      IF (arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2) ) THEN
+         err_msg = 'X Axes of A and B coefficients must agree'
+         go to 999
+      ENDIF
+      IF (arg_lo_ss(Y_AXIS,ARG1) .NE. arg_lo_ss(Y_AXIS,ARG2)  ) THEN
+         err_msg = 'Y Axes of A and B coefficients must agree'
+         go to 999
+      ENDIF
+
+      IF (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_lo_ss(Z_AXIS,ARG2) ) THEN
+         err_msg = 'Z Axes of A and B coefficients must agree'
+         go to 999
+      ENDIF
+
+      IF (arg_lo_ss(T_AXIS,ARG1) .NE. arg_lo_ss(T_AXIS,ARG2)  ) THEN
+         err_msg = 'T Axes of A and B coefficients must agree'
+         go to 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ntime and trig functions.
+
+      CALL rffti (ntime, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+*
+* Calculate the inverse FFT for each series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nfreq
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i1,j1,k1,l1) .EQ. bad_flag(ARG2)) THEN
+
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  A(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  B(l,1,1,1) = arg_2(i1,j1,k1,l1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               CALL FFTINV (ntime, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l) = ts(l,1,1,1)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/fft/fft_phas.F b/external_functions/fft/fft_phas.F
new file mode 100644
index 0000000..ae42d02
--- /dev/null
+++ b/external_functions/fft/fft_phas.F
@@ -0,0 +1,455 @@
+*
+* fft_phas.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+* This function computes fft phase spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET sstp = fft_phas(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fft_phas(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_phas_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*                                                                      V
+      CALL ef_set_desc(id, 'Computes fft phase, WITH CORRECTED FREQ AXIS' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with regular time axis. Specify time explicitly e.g. fft_phas(v[l=1,96])')
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_phas_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+            
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+     
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_phas_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see fft_phasACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_phas_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_phas_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb,  rad
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('fft_phas encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      rad = 180.0/ 3.141592654
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = rad* ATAN2(-1.*bb, aa)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fft_re.F b/external_functions/fft/fft_re.F
new file mode 100644
index 0000000..b615b4c
--- /dev/null
+++ b/external_functions/fft/fft_re.F
@@ -0,0 +1,463 @@
+*------------------------------fft_re.F--------------------------------
+*
+* fft_re.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+* This function returns the real part of the FFT transform. The result time
+* axis is a custom axis in period 1./time  The time axis must be regular.
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_re_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*                                                                      V
+      CALL ef_set_desc(id, 'Computes real part of fft transform' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis.')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_re_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+     
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_re_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_re_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_re_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTP encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+*
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l) = a(l,1,1,1)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/fft/fft_sunspot.jnl b/external_functions/fft/fft_sunspot.jnl
new file mode 100644
index 0000000..7c7bdf6
--- /dev/null
+++ b/external_functions/fft/fft_sunspot.jnl
@@ -0,0 +1,50 @@
+!  Sunspot example
+
+DEFINE AXIS/T="1-jul-1700":"1-jul-1997":1/unit=yr tsun
+DEFINE GRID/T=tsun gsun
+FILE/VAR=sunspot_index/skip=3/G=gsun/FORMAT=(6x,f6.1) yearssn.dat
+
+!SET MODE META
+PLOT/SET_UP sunspot_index
+PPLUS TXLSZE 0.07
+PPL PLOT
+MESSAGE
+
+LET nd = sunspot_index[l=@NGD]
+LET nf = nd / 2
+LET yquist = 0.5
+LET freq1 = yquist/ nf
+
+DEFINE AXIS/t=`freq1`:`yquist`:`freq1`/UNITS=yr FAXIS
+DEFINE GRID/t=faxis gfreq
+SET GRID gfreq
+LET tpts = t
+
+LET fftsun = ffta(sunspot_index[l=1:`nd`])
+
+PLOT fftsun
+message
+
+!  Show the same plot in years/cycle
+LET fpts = 1./tpts
+
+let nff = fpts[l=@NGD]
+let nfs = fftsun[l=@NGD]
+let nfplot = MIN(`nff`, `nfs`)
+
+PLOT/VS/LINE/SET_UP fpts[l=1:`nfplot`], fftsun[l=1:`nfplot`]
+PPL XLAB YR/cycle
+PPL YLAB Amplitude Spectrum
+PPL XAXIS 0, 30, 1.
+PPL PLOT
+message
+
+!  Plot the power spectrum in years/cyc
+
+LET pspect = fftsun*fftsun
+PLOT/VS/LINE/SET_UP fpts[l=1:`nfplot`], pspect[l=1:`nfplot`]
+PPL XAXIS 1, 30, 1
+PPL XLAB years/cycle
+PPL YLAB Power Spectrum
+PPL PLOT
+MESSAGE
diff --git a/external_functions/fft/fft_synthesis_demo.jnl b/external_functions/fft/fft_synthesis_demo.jnl
new file mode 100644
index 0000000..6d7e981
--- /dev/null
+++ b/external_functions/fft/fft_synthesis_demo.jnl
@@ -0,0 +1,36 @@
+!-----------------------fft_synthesis_demo.jnl----------------------------
+! Usage: go fft_synthesis_demo
+! Description: Compute FFT of time series, invert FFT to resynthesize.
+! atw 11/01
+
+ppl cross 1 1
+let pi = 3.14159
+let deg_to_rad = pi/180       !degrees per radian
+let nt = 360                  !number of time points
+
+DEFINE AXIS/t=0:`nt-1`:1/unit=day tax
+DEFINE GRID/T=tax tgrid
+SET GRID tgrid
+
+message Define the signal: fundamental plus phase-shifted octave.
+let s = cos(2*pi*t/nt - 45*deg_to_rad) + cos(2*2*pi*t/nt - 90*deg_to_rad)
+
+message Get FFT statistics for fundamental and octave.
+let fa = ffta(s)         ! FFT amplitude
+let fp = 0-fftp(s)       ! FFT phase lag
+let fr = fft_re(s)       ! FFT real part
+let fi = fft_im(s)       ! FFT imaginary part
+list/l=1:2 fa, fp, fr, fi
+
+message Plot actual & synthetic signals (slight separation for viewing).
+let s_synth1 = fft_inverse(fr,fi)
+let s_synth1_lo = fft_inverse(IF l LE 1 THEN fr ELSE 0, IF l LE 1 THEN fi ELSE 0)
+let s_synth1_hi = fft_inverse(IF l GT 1 THEN fr ELSE 0, IF l GT 1 THEN fi ELSE 0)
+let s_synth2 = fft_inverse(fa*cos(fp*deg_to_rad),fa*sin(fp*deg_to_rad))
+plot/hl=0:`nt-1`:`nt/8`/vl=-2:2 s
+plot/ov .02+s_synth1[g=s at asn]
+plot/ov .04+s_synth2[g=s at asn]
+
+message Overlay lo/hi-pass signals.
+plot/ov s_synth1_lo
+plot/ov s_synth1_hi
diff --git a/external_functions/fft/ffta.F b/external_functions/fft/ffta.F
new file mode 100644
index 0000000..2f9558b
--- /dev/null
+++ b/external_functions/fft/ffta.F
@@ -0,0 +1,474 @@
+*
+* ffta.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta = ffta(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc, fcn_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      WRITE (fcn_desc, 20)
+      CALL ef_set_desc(id, fcn_desc)
+   20 FORMAT ( 'Computes fft amplitude spectra, ',
+     .          'normalized by 1/N' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .         'explicitly e.g. ffta(var[l=1,120])')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ffta_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL*8 yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/ffta_sample.F b/external_functions/fft/ffta_sample.F
new file mode 100644
index 0000000..2f295f6
--- /dev/null
+++ b/external_functions/fft/ffta_sample.F
@@ -0,0 +1,443 @@
+*
+* ffta_sample.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta_sample = ffta_sample(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta_sample(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* V5.53  *acm*  6/03 Correct the frequency axis:  Incorrect factor of
+*                     1.001 in freqn = 1.001*yquist
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_sample_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 
+     .   'Computes fft amplitude spectra, normalized by 1/N' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with regular time axis. Specify time explicitly e.g. ffta_sample(var[l=1,120])')
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ffta_sample_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_sample_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_sample_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_sample_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fftinv_subs.F b/external_functions/fft/fftinv_subs.F
new file mode 100644
index 0000000..d686b1c
--- /dev/null
+++ b/external_functions/fft/fftinv_subs.F
@@ -0,0 +1,523 @@
+
+      SUBROUTINE FFTINV (ND, X, a, b, WFT)
+      real X(*), WFT(*)
+      real a(*), b(*)
+      integer nd, nf, i, j
+
+C  From snsr, by Jim Larsen, PMEL 
+C  Ansley Manke: 11/2001 Change to undo scaling in FOUR_RE
+c   calls NCAR FFT code
+
+c   Calls:  RFFTB
+
+      NF = ND/ 2 
+
+      X(1) = 0.0
+      X(2) = a(1)
+
+      DO I = 1, NF-1 
+        J = 2* i
+        X(J)   = 0.5* a(i) 
+        X(J+1) = -0.5* b(i) 
+      ENDDO
+
+      X(ND) = a(nf)
+
+      CALL RFFTB (ND, X, WFT) 
+
+      RETURN 
+      END
+
+C     SUBROUTINE RFFTB(N,R,WSAVE)                                               
+C                                                                               
+C     SUBROUTINE RFFTB COMPUTES THE REAL PERODIC SEQUENCE FROM ITS              
+C     FOURIER COEFFICIENTS (FOURIER SYNTHESIS). THE TRANSFORM IS DEFINED        
+C     BELOW AT OUTPUT PARAMETER R.                                              
+C                                                                               
+C     INPUT PARAMETERS                                                          
+C                                                                               
+C     N       THE LENGTH OF THE ARRAY R TO BE TRANSFORMED.  THE METHOD          
+C             IS MOST EFFICIENT WHEN N IS A PRODUCT OF SMALL PRIMES.            
+C             N MAY CHANGE SO LONG AS DIFFERENT WORK ARRAYS ARE PROVIDED        
+C                                                                               
+C     R       A REAL ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE              
+C             TO BE TRANSFORMED                                                 
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             IN THE PROGRAM THAT CALLS RFFTB. THE WSAVE ARRAY MUST BE          
+C             INITIALIZED BY CALLING SUBROUTINE RFFTI(N,WSAVE) AND A            
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT             
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE               
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT           
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.                 
+C             THE SAME WSAVE ARRAY CAN BE USED BY RFFTF AND RFFTB.              
+C                                                                               
+C                                                                               
+C     OUTPUT PARAMETERS                                                         
+C                                                                               
+C     R       FOR N EVEN AND FOR I = 1,...,N                                    
+C                                                                               
+C                  R(I) = R(1)+(-1)**(I-1)*R(N)                                 
+C                                                                               
+C                       PLUS THE SUM FROM K=2 TO K=N/2 OF                       
+C                                                                               
+C                        2.*R(2*K-2)*COS((K-1)*(I-1)*2*PI/N)                    
+C                                                                               
+C                       -2.*R(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)                    
+C                                                                               
+C             FOR N ODD AND FOR I = 1,...,N                                     
+C                                                                               
+C                  R(I) = R(1) PLUS THE SUM FROM K=2 TO K=(N+1)/2 OF            
+C                                                                               
+C                       2.*R(2*K-2)*COS((K-1)*(I-1)*2*PI/N)                     
+C                                                                               
+C                      -2.*R(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)                     
+C                                                                               
+C      *****  NOTE                                                              
+C                  THIS TRANSFORM IS UNNORMALIZED SINCE A CALL OF RFFTF         
+C                  FOLLOWED BY A CALL OF RFFTB WILL MULTIPLY THE INPUT          
+C                  SEQUENCE BY N.                                               
+C                                                                               
+C     WSAVE   CONTAINS RESULTS WHICH MUST NOT BE DESTROYED BETWEEN              
+C             CALLS OF RFFTB OR RFFTF.                                          
+C                                                                               
+C                                                                               
+      SUBROUTINE RFFTB (N,R,WSAVE)                                              
+      INTEGER N
+      REAL       R(*)       ,WSAVE(*)     
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTB1 (N,R,WSAVE,WSAVE(N+1),WSAVE(2*N+1))                           
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTB1 (N,C,CH,WA,IFAC)                                        
+      INTEGER N, NF, NA, L1, IW, K1, IP, L2, IDO, IDL1, I, IX2, IX3, IX4
+      REAL       CH(*)      ,C(*)       ,WA(*)      ,IFAC(*)   
+      NF = IFAC(2)                                                              
+      NA = 0                                                                    
+      L1 = 1                                                                    
+      IW = 1                                                                    
+      DO 116 K1=1,NF                                                            
+         IP = IFAC(K1+2)                                                        
+         L2 = IP*L1                                                             
+         IDO = N/L2                                                             
+         IDL1 = IDO*L1                                                          
+         IF (IP .NE. 4) GO TO 103                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IF (NA .NE. 0) GO TO 101                                               
+         CALL RADB4 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 102                                                              
+  101    CALL RADB4 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3))                        
+  102    NA = 1-NA                                                              
+         GO TO 115                                                              
+  103    IF (IP .NE. 2) GO TO 106                                               
+         IF (NA .NE. 0) GO TO 104                                               
+         CALL RADB2 (IDO,L1,C,CH,WA(IW))                                        
+         GO TO 105                                                              
+  104    CALL RADB2 (IDO,L1,CH,C,WA(IW))                                        
+  105    NA = 1-NA                                                              
+         GO TO 115                                                              
+  106    IF (IP .NE. 3) GO TO 109                                               
+         IX2 = IW+IDO                                                           
+         IF (NA .NE. 0) GO TO 107                                               
+         CALL RADB3 (IDO,L1,C,CH,WA(IW),WA(IX2))                                
+         GO TO 108                                                              
+  107    CALL RADB3 (IDO,L1,CH,C,WA(IW),WA(IX2))                                
+  108    NA = 1-NA                                                              
+         GO TO 115                                                              
+  109    IF (IP .NE. 5) GO TO 112                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IX4 = IX3+IDO                                                          
+         IF (NA .NE. 0) GO TO 110                                               
+         CALL RADB5 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 111                                                              
+  110    CALL RADB5 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+  111    NA = 1-NA                                                              
+         GO TO 115                                                              
+  112    IF (NA .NE. 0) GO TO 113                                               
+         CALL RADBG (IDO,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))                         
+         GO TO 114                                                              
+  113    CALL RADBG (IDO,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))                        
+  114    IF (IDO .EQ. 1) NA = 1-NA                                              
+  115    L1 = L2                                                                
+         IW = IW+(IP-1)*IDO                                                     
+  116 CONTINUE                                                                  
+      IF (NA .EQ. 0) RETURN                                                     
+      DO 117 I=1,N                                                              
+         C(I) = CH(I)                                                           
+  117 CONTINUE                                                                  
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADB2 (IDO,L1,CC,CH,WA1)                                       
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,2,L1)           ,CH(IDO,L1,2)           ,          
+     1                WA1(*)          
+      REAL TR2, TI2
+      DO 101 K=1,L1                                                             
+         CH(1,K,1) = CC(1,1,K)+CC(IDO,2,K)                                      
+         CH(1,K,2) = CC(1,1,K)-CC(IDO,2,K)                                      
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            CH(I-1,K,1) = CC(I-1,1,K)+CC(IC-1,2,K)                              
+            TR2 = CC(I-1,1,K)-CC(IC-1,2,K)                                      
+            CH(I,K,1) = CC(I,1,K)-CC(IC,2,K)                                    
+            TI2 = CC(I,1,K)+CC(IC,2,K)                                          
+            CH(I-1,K,2) = WA1(I-2)*TR2-WA1(I-1)*TI2                             
+            CH(I,K,2) = WA1(I-2)*TI2+WA1(I-1)*TR2                               
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 DO 106 K=1,L1                                                             
+         CH(IDO,K,1) = CC(IDO,1,K)+CC(IDO,1,K)                                  
+         CH(IDO,K,2) = -(CC(1,2,K)+CC(1,2,K))                                   
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADB3 (IDO,L1,CC,CH,WA1,WA2)                                   
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,3,L1)           ,CH(IDO,L1,3)           ,          
+     1                WA1(*)     ,WA2(*)  
+      REAL TAUI, TAUR
+      REAL TR2, TI2, CR2, CI2, CR3, CI3, DR2, DI2, DI3, DR3
+      DATA TAUR,TAUI /-.5,.866025403784439/                                     
+      DO 101 K=1,L1                                                             
+         TR2 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         CR2 = CC(1,1,K)+TAUR*TR2                                               
+         CH(1,K,1) = CC(1,1,K)+TR2                                              
+         CI3 = TAUI*(CC(1,3,K)+CC(1,3,K))                                       
+         CH(1,K,2) = CR2-CI3                                                    
+         CH(1,K,3) = CR2+CI3                                                    
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TR2 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            CR2 = CC(I-1,1,K)+TAUR*TR2                                          
+            CH(I-1,K,1) = CC(I-1,1,K)+TR2                                       
+            TI2 = CC(I,3,K)-CC(IC,2,K)                                          
+            CI2 = CC(I,1,K)+TAUR*TI2                                            
+            CH(I,K,1) = CC(I,1,K)+TI2                                           
+            CR3 = TAUI*(CC(I-1,3,K)-CC(IC-1,2,K))                               
+            CI3 = TAUI*(CC(I,3,K)+CC(IC,2,K))                                   
+            DR2 = CR2-CI3                                                       
+            DR3 = CR2+CI3                                                       
+            DI2 = CI2+CR3                                                       
+            DI3 = CI2-CR3                                                       
+            CH(I-1,K,2) = WA1(I-2)*DR2-WA1(I-1)*DI2                             
+            CH(I,K,2) = WA1(I-2)*DI2+WA1(I-1)*DR2                               
+            CH(I-1,K,3) = WA2(I-2)*DR3-WA2(I-1)*DI3                             
+            CH(I,K,3) = WA2(I-2)*DI3+WA2(I-1)*DR3                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END    
+                                                 
+      SUBROUTINE RADBG (IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)                      
+      INTEGER IDO, IP, L1, IDL1, J, IC, L, LC
+      INTEGER IDP2, NBD, IPP2, IPPH, K, I, JC, J2, IK, IS, IDIJ
+      REAL            CH(IDO,L1,IP)          ,CC(IDO,IP,L1)          ,          
+     1                C1(IDO,L1,IP)          ,C2(IDL1,IP),                      
+     2                CH2(IDL1,IP)           ,WA(*)    
+      REAL PIMACH
+      REAL TPI, ARG, DCP, DSP , AR1, AI1, AR2, AR2H, DS2, DC2, DUM
+      REAL AR1H, AI2
+
+
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARG = TPI/FLOAT(IP)                                                       
+      DCP = COS(ARG)                                                            
+      DSP = SIN(ARG)                                                            
+      IDP2 = IDO+2                                                              
+      NBD = (IDO-1)/2                                                           
+      IPP2 = IP+2                                                               
+      IPPH = (IP+1)/2                                                           
+      IF (IDO .LT. L1) GO TO 103                                                
+      DO 102 K=1,L1                                                             
+         DO 101 I=1,IDO                                                         
+            CH(I,K,1) = CC(I,1,K)                                               
+  101    CONTINUE                                                               
+  102 CONTINUE                                                                  
+      GO TO 106                                                                 
+  103 DO 105 I=1,IDO                                                            
+         DO 104 K=1,L1                                                          
+            CH(I,K,1) = CC(I,1,K)                                               
+  104    CONTINUE                                                               
+  105 CONTINUE                                                                  
+  106 DO 108 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 107 K=1,L1                                                          
+            CH(1,K,J) = CC(IDO,J2-2,K)+CC(IDO,J2-2,K)                           
+            CH(1,K,JC) = CC(1,J2-1,K)+CC(1,J2-1,K)                              
+  107    CONTINUE                                                               
+  108 CONTINUE                                                                  
+      IF (IDO .EQ. 1) GO TO 116                                                 
+      IF (NBD .LT. L1) GO TO 112                                                
+      DO 111 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 110 K=1,L1                                                          
+            DO 109 I=3,IDO,2                                                    
+               IC = IDP2-I                                                      
+               CH(I-1,K,J) = CC(I-1,2*J-1,K)+CC(IC-1,2*J-2,K)                   
+               CH(I-1,K,JC) = CC(I-1,2*J-1,K)-CC(IC-1,2*J-2,K)                  
+               CH(I,K,J) = CC(I,2*J-1,K)-CC(IC,2*J-2,K)                         
+               CH(I,K,JC) = CC(I,2*J-1,K)+CC(IC,2*J-2,K)                        
+  109       CONTINUE                                                            
+  110    CONTINUE                                                               
+  111 CONTINUE                                                                  
+      GO TO 116                                                                 
+  112 DO 115 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 114 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DO 113 K=1,L1                                                       
+               CH(I-1,K,J) = CC(I-1,2*J-1,K)+CC(IC-1,2*J-2,K)                   
+               CH(I-1,K,JC) = CC(I-1,2*J-1,K)-CC(IC-1,2*J-2,K)                  
+               CH(I,K,J) = CC(I,2*J-1,K)-CC(IC,2*J-2,K)                         
+               CH(I,K,JC) = CC(I,2*J-1,K)+CC(IC,2*J-2,K)                        
+  113       CONTINUE                                                            
+  114    CONTINUE                                                               
+  115 CONTINUE                                                                  
+  116 AR1 = 1.                                                                  
+      AI1 = 0.                                                                  
+      DO 120 L=2,IPPH                                                           
+         LC = IPP2-L                                                            
+         AR1H = DCP*AR1-DSP*AI1                                                 
+         AI1 = DCP*AI1+DSP*AR1                                                  
+         AR1 = AR1H                                                             
+         DO 117 IK=1,IDL1                                                       
+            C2(IK,L) = CH2(IK,1)+AR1*CH2(IK,2)                                  
+            C2(IK,LC) = AI1*CH2(IK,IP)                                          
+  117    CONTINUE                                                               
+         DC2 = AR1                                                              
+         DS2 = AI1                                                              
+         AR2 = AR1                                                              
+         AI2 = AI1                                                              
+         DO 119 J=3,IPPH                                                        
+            JC = IPP2-J                                                         
+            AR2H = DC2*AR2-DS2*AI2                                              
+            AI2 = DC2*AI2+DS2*AR2                                               
+            AR2 = AR2H                                                          
+            DO 118 IK=1,IDL1                                                    
+               C2(IK,L) = C2(IK,L)+AR2*CH2(IK,J)                                
+               C2(IK,LC) = C2(IK,LC)+AI2*CH2(IK,JC)                             
+  118       CONTINUE                                                            
+  119    CONTINUE                                                               
+  120 CONTINUE                                                                  
+      DO 122 J=2,IPPH                                                           
+         DO 121 IK=1,IDL1                                                       
+            CH2(IK,1) = CH2(IK,1)+CH2(IK,J)                                     
+  121    CONTINUE                                                               
+  122 CONTINUE                                                                  
+      DO 124 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 123 K=1,L1                                                          
+            CH(1,K,J) = C1(1,K,J)-C1(1,K,JC)                                    
+            CH(1,K,JC) = C1(1,K,J)+C1(1,K,JC)                                   
+  123    CONTINUE                                                               
+  124 CONTINUE                                                                  
+      IF (IDO .EQ. 1) GO TO 132                                                 
+      IF (NBD .LT. L1) GO TO 128                                                
+      DO 127 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 126 K=1,L1                                                          
+            DO 125 I=3,IDO,2                                                    
+               CH(I-1,K,J) = C1(I-1,K,J)-C1(I,K,JC)                             
+               CH(I-1,K,JC) = C1(I-1,K,J)+C1(I,K,JC)                            
+               CH(I,K,J) = C1(I,K,J)+C1(I-1,K,JC)                               
+               CH(I,K,JC) = C1(I,K,J)-C1(I-1,K,JC)                              
+  125       CONTINUE                                                            
+  126    CONTINUE                                                               
+  127 CONTINUE                                                                  
+      GO TO 132                                                                 
+  128 DO 131 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 130 I=3,IDO,2                                                       
+            DO 129 K=1,L1                                                       
+               CH(I-1,K,J) = C1(I-1,K,J)-C1(I,K,JC)                             
+               CH(I-1,K,JC) = C1(I-1,K,J)+C1(I,K,JC)                            
+               CH(I,K,J) = C1(I,K,J)+C1(I-1,K,JC)                               
+               CH(I,K,JC) = C1(I,K,J)-C1(I-1,K,JC)                              
+  129       CONTINUE                                                            
+  130    CONTINUE                                                               
+  131 CONTINUE                                                                  
+  132 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      DO 133 IK=1,IDL1                                                          
+         C2(IK,1) = CH2(IK,1)                                                   
+  133 CONTINUE                                                                  
+      DO 135 J=2,IP                                                             
+         DO 134 K=1,L1                                                          
+            C1(1,K,J) = CH(1,K,J)                                               
+  134    CONTINUE                                                               
+  135 CONTINUE                                                                  
+      IF (NBD .GT. L1) GO TO 139                                                
+      IS = -IDO                                                                 
+      DO 138 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         IDIJ = IS                                                              
+         DO 137 I=3,IDO,2                                                       
+            IDIJ = IDIJ+2                                                       
+            DO 136 K=1,L1                                                       
+               C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J)          
+               C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J)            
+  136       CONTINUE                                                            
+  137    CONTINUE                                                               
+  138 CONTINUE                                                                  
+      GO TO 143                                                                 
+  139 IS = -IDO                                                                 
+      DO 142 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         DO 141 K=1,L1                                                          
+            IDIJ = IS                                                           
+            DO 140 I=3,IDO,2                                                    
+               IDIJ = IDIJ+2                                                    
+               C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J)          
+               C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J)            
+  140       CONTINUE                                                            
+  141    CONTINUE                                                               
+  142 CONTINUE                                                                  
+  143 RETURN                                                                    
+      END                                                                       
+
+                                                               
+      SUBROUTINE RADB4 (IDO,L1,CC,CH,WA1,WA2,WA3)                               
+      INTEGER IDO, L1, K, I, IDP2, IC
+      REAL       CC(IDO,4,L1)           ,CH(IDO,L1,4)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)      
+      REAL SQRT2
+      REAL TR1, TR2, TR3, TR4, TI1, TI2, TI3, TI4
+      REAL CR2, CR3, CR4, CI2, CI3, CI4
+      DATA SQRT2 /1.414213562373095/                                            
+      DO 101 K=1,L1                                                             
+         TR1 = CC(1,1,K)-CC(IDO,4,K)                                            
+         TR2 = CC(1,1,K)+CC(IDO,4,K)                                            
+         TR3 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         TR4 = CC(1,3,K)+CC(1,3,K)                                              
+         CH(1,K,1) = TR2+TR3                                                    
+         CH(1,K,2) = TR1-TR4                                                    
+         CH(1,K,3) = TR2-TR3                                                    
+         CH(1,K,4) = TR1+TR4                                                    
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TI1 = CC(I,1,K)+CC(IC,4,K)                                          
+            TI2 = CC(I,1,K)-CC(IC,4,K)                                          
+            TI3 = CC(I,3,K)-CC(IC,2,K)                                          
+            TR4 = CC(I,3,K)+CC(IC,2,K)                                          
+            TR1 = CC(I-1,1,K)-CC(IC-1,4,K)                                      
+            TR2 = CC(I-1,1,K)+CC(IC-1,4,K)                                      
+            TI4 = CC(I-1,3,K)-CC(IC-1,2,K)                                      
+            TR3 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            CH(I-1,K,1) = TR2+TR3                                               
+            CR3 = TR2-TR3                                                       
+            CH(I,K,1) = TI2+TI3                                                 
+            CI3 = TI2-TI3                                                       
+            CR2 = TR1-TR4                                                       
+            CR4 = TR1+TR4                                                       
+            CI2 = TI1+TI4                                                       
+            CI4 = TI1-TI4                                                       
+            CH(I-1,K,2) = WA1(I-2)*CR2-WA1(I-1)*CI2                             
+            CH(I,K,2) = WA1(I-2)*CI2+WA1(I-1)*CR2                               
+            CH(I-1,K,3) = WA2(I-2)*CR3-WA2(I-1)*CI3                             
+            CH(I,K,3) = WA2(I-2)*CI3+WA2(I-1)*CR3                               
+            CH(I-1,K,4) = WA3(I-2)*CR4-WA3(I-1)*CI4                             
+            CH(I,K,4) = WA3(I-2)*CI4+WA3(I-1)*CR4                               
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 CONTINUE                                                                  
+      DO 106 K=1,L1                                                             
+         TI1 = CC(1,2,K)+CC(1,4,K)                                              
+         TI2 = CC(1,4,K)-CC(1,2,K)                                              
+         TR1 = CC(IDO,1,K)-CC(IDO,3,K)                                          
+         TR2 = CC(IDO,1,K)+CC(IDO,3,K)                                          
+         CH(IDO,K,1) = TR2+TR2                                                  
+         CH(IDO,K,2) = SQRT2*(TR1-TI1)                                          
+         CH(IDO,K,3) = TI2+TI2                                                  
+         CH(IDO,K,4) = -SQRT2*(TR1+TI1)                                         
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                             
+                                                    
+      SUBROUTINE RADB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4)                           
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,5,L1)           ,CH(IDO,L1,5)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)     ,WA4(*)     
+      REAL TR2, TR3, TR4, TR5, TI2, TI3, TI4, TI5
+      REAL CR2, CR3, CR4, CR5, CI2, CI3, CI4, CI5
+      REAL DR2, DR3, DR4, DR5, DI2, DI3, DI4, DI5
+
+      REAL TR11,TI11,TR12,TI12
+      DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154,              
+     1-.809016994374947,.587785252292473/       
+     
+      DO 101 K=1,L1                                                             
+         TI5 = CC(1,3,K)+CC(1,3,K)                                              
+         TI4 = CC(1,5,K)+CC(1,5,K)                                              
+         TR2 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         TR3 = CC(IDO,4,K)+CC(IDO,4,K)                                          
+         CH(1,K,1) = CC(1,1,K)+TR2+TR3                                          
+         CR2 = CC(1,1,K)+TR11*TR2+TR12*TR3                                      
+         CR3 = CC(1,1,K)+TR12*TR2+TR11*TR3                                      
+         CI5 = TI11*TI5+TI12*TI4                                                
+         CI4 = TI12*TI5-TI11*TI4                                                
+         CH(1,K,2) = CR2-CI5                                                    
+         CH(1,K,3) = CR3-CI4                                                    
+         CH(1,K,4) = CR3+CI4                                                    
+         CH(1,K,5) = CR2+CI5                                                    
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TI5 = CC(I,3,K)+CC(IC,2,K)                                          
+            TI2 = CC(I,3,K)-CC(IC,2,K)                                          
+            TI4 = CC(I,5,K)+CC(IC,4,K)                                          
+            TI3 = CC(I,5,K)-CC(IC,4,K)                                          
+            TR5 = CC(I-1,3,K)-CC(IC-1,2,K)                                      
+            TR2 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            TR4 = CC(I-1,5,K)-CC(IC-1,4,K)                                      
+            TR3 = CC(I-1,5,K)+CC(IC-1,4,K)                                      
+            CH(I-1,K,1) = CC(I-1,1,K)+TR2+TR3                                   
+            CH(I,K,1) = CC(I,1,K)+TI2+TI3                                       
+            CR2 = CC(I-1,1,K)+TR11*TR2+TR12*TR3                                 
+            CI2 = CC(I,1,K)+TR11*TI2+TR12*TI3                                   
+            CR3 = CC(I-1,1,K)+TR12*TR2+TR11*TR3                                 
+            CI3 = CC(I,1,K)+TR12*TI2+TR11*TI3                                   
+            CR5 = TI11*TR5+TI12*TR4                                             
+            CI5 = TI11*TI5+TI12*TI4                                             
+            CR4 = TI12*TR5-TI11*TR4                                             
+            CI4 = TI12*TI5-TI11*TI4                                             
+            DR3 = CR3-CI4                                                       
+            DR4 = CR3+CI4                                                       
+            DI3 = CI3+CR4                                                       
+            DI4 = CI3-CR4                                                       
+            DR5 = CR2+CI5                                                       
+            DR2 = CR2-CI5                                                       
+            DI5 = CI2-CR5                                                       
+            DI2 = CI2+CR5                                                       
+            CH(I-1,K,2) = WA1(I-2)*DR2-WA1(I-1)*DI2                             
+            CH(I,K,2) = WA1(I-2)*DI2+WA1(I-1)*DR2                               
+            CH(I-1,K,3) = WA2(I-2)*DR3-WA2(I-1)*DI3                             
+            CH(I,K,3) = WA2(I-2)*DI3+WA2(I-1)*DR3                               
+            CH(I-1,K,4) = WA3(I-2)*DR4-WA3(I-1)*DI4                             
+            CH(I,K,4) = WA3(I-2)*DI4+WA3(I-1)*DR4                               
+            CH(I-1,K,5) = WA4(I-2)*DR5-WA4(I-1)*DI5                             
+            CH(I,K,5) = WA4(I-2)*DI5+WA4(I-1)*DR5                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                  
diff --git a/external_functions/fft/fftp.F b/external_functions/fft/fftp.F
new file mode 100644
index 0000000..4c96d47
--- /dev/null
+++ b/external_functions/fft/fftp.F
@@ -0,0 +1,477 @@
+*
+* fftp.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+* This function computes fft phase spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET sstp = fftp(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fftp(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fftp_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*                                                                      V
+      CALL ef_set_desc(id, 'Computes fft phase' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .         'explicitly e.g. fftp(var[l=1,120])')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fftp_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL*8 yquist, freq1, freqn
+      REAL   f1, fn
+            
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+     
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fftp_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fftp_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fftp_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb,  rad
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTP encountered missing data at (i,j,k,l)', 4I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      rad = 180.0/ 3.141592654
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+
+                     IF (i1 .EQ. ef_unspecified_int4 .AND.
+     .                   j1 .EQ. ef_unspecified_int4 .AND.
+     .                   k1 .EQ. ef_unspecified_int4 )
+     .                     WRITE (err_msg, 50) l
+
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = rad* ATAN2(-1.*bb, aa)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fftp_sample.F b/external_functions/fft/fftp_sample.F
new file mode 100644
index 0000000..8824b26
--- /dev/null
+++ b/external_functions/fft/fftp_sample.F
@@ -0,0 +1,449 @@
+*
+* fftp_sample.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft phase spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET sstp = fftp_sample(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fftp_sample(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+* V5.53  *acm*  6/03 Correct the frequency axis:  Incorrect factor of
+*                     1.001 in freqn = 1.001*yquist
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fftp_sample_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*                                                                      V
+      CALL ef_set_desc(id, 'Computes fft phase' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .         'explicitly e.g. fftp_sample(var[l=1,120])')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fftp_sample_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+     
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+                     outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fftp_sample_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fftp_sample_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fftp_sample_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb,  rad
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTP encountered missing data at (i,j,k,l)', 4I5)
+
+      rad = 180.0/ 3.141592654
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+*
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = rad* ATAN2(-1.*bb, aa)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/fft/fftsubs.F b/external_functions/fft/fftsubs.F
new file mode 100644
index 0000000..d4d7730
--- /dev/null
+++ b/external_functions/fft/fftsubs.F
@@ -0,0 +1,671 @@
+*  fftsubs.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+*   computation routines for FFT functions
+
+      SUBROUTINE four_re (nd, x, a, b, wft)
+      INTEGER nd, nf, i, j
+      REAL x(*), wft(*) 
+      REAL a(*), b(*), xn
+
+c   uses NCAR FFTPACK code
+
+C  Ansley Manke 1/2000 NOAA/PMEL   Return A, B real arrays with Fourier coefficients.
+C  Uses notes by Ned Cokelet 1/2000 on Swartztrauber FFTPACK code.
+
+c   Calls: RFFTF
+
+
+C  NF = number of frequencies, half the number of times.
+C  The code returns frequencies W(i) for i=0 to ND/2, with ND/2 rounded down.
+C  We do not return a(0) = R1/ND
+C  We return a(i) and b(i) for i=1,... ND/2  
+
+      nf = nd/ 2
+
+      CALL rfftf (nd, x, wft) 
+
+C  Normalizing factor of 1./N
+
+c      xn = 1.0
+      xn = 1.0/ REAL(nd)
+
+c   Save FFT coefficients in arrays a and b.
+      
+      j = 0
+      DO i = 1, nf-1
+        j = 2* i
+        a(i) =  2.* xn* x(j)
+        b(i) = -2.* xn* x(j+1) 
+      ENDDO
+
+C  Set a(nf) and b(nf) when nd is even/odd.
+
+      IF (nf*2 .eq. nd) THEN		! even ND
+         a(nf) = xn* x(nd)
+         b(nf) = 0.
+      ELSE				! odd ND
+         a(nf) = 2.* xn* x(nd-1)
+         b(nf) = -2.* xn* x(nd)
+      ENDIF
+
+      RETURN 
+      END
+
+                                                                 
+C     SUBROUTINE RFFTF(N,R,WSAVE)                                               
+C                                                                               
+C     SUBROUTINE RFFTF COMPUTES THE FOURIER COEFFICIENTS OF A REAL              
+C     PERODIC SEQUENCE (FOURIER ANALYSIS). THE TRANSFORM IS DEFINED             
+C     BELOW AT OUTPUT PARAMETER R.                                              
+C                                                                               
+C     INPUT PARAMETERS                                                          
+C                                                                               
+C     N       THE LENGTH OF THE ARRAY R TO BE TRANSFORMED.  THE METHOD          
+C             IS MOST EFFICIENT WHEN N IS A PRODUCT OF SMALL PRIMES.            
+C             N MAY CHANGE SO LONG AS DIFFERENT WORK ARRAYS ARE PROVIDED        
+C                                                                               
+C     R       A REAL ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE              
+C             TO BE TRANSFORMED                                                 
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             IN THE PROGRAM THAT CALLS RFFTF. THE WSAVE ARRAY MUST BE          
+C             INITIALIZED BY CALLING SUBROUTINE RFFTI(N,WSAVE) AND A            
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT             
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE               
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT           
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.                 
+C             THE SAME WSAVE ARRAY CAN BE USED BY RFFTF AND RFFTB.              
+C                                                                               
+C                                                                               
+C     OUTPUT PARAMETERS                                                         
+C                                                                               
+C     R       R(1) = THE SUM FROM I=1 TO I=N OF R(I)                            
+C                                                                               
+C             IF N IS EVEN SET L =N/2   , IF N IS ODD SET L = (N+1)/2           
+C                                                                               
+C               THEN FOR K = 2,...,L                                            
+C                                                                               
+C                  R(2*K-2) = THE SUM FROM I = 1 TO I = N OF                    
+C                                                                               
+C                       R(I)*COS((K-1)*(I-1)*2*PI/N)                            
+C                                                                               
+C                  R(2*K-1) = THE SUM FROM I = 1 TO I = N OF                    
+C                                                                               
+C                      -R(I)*SIN((K-1)*(I-1)*2*PI/N)                            
+C                                                                               
+C             IF N IS EVEN                                                      
+C                                                                               
+C                  R(N) = THE SUM FROM I = 1 TO I = N OF                        
+C                                                                               
+C                       (-1)**(I-1)*R(I)                                        
+C                                                                               
+C      *****  NOTE                                                              
+C                  THIS TRANSFORM IS UNNORMALIZED SINCE A CALL OF RFFTF         
+C                  FOLLOWED BY A CALL OF RFFTB WILL MULTIPLY THE INPUT          
+C                  SEQUENCE BY N.                                               
+C                                                                               
+C     WSAVE   CONTAINS RESULTS WHICH MUST NOT BE DESTROYED BETWEEN              
+C             CALLS OF RFFTF OR RFFTB.                                          
+C                                                                               
+      SUBROUTINE RFFTF (N,R,WSAVE)                                              
+      INTEGER N
+      REAL       R(*)       ,WSAVE(*)             
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTF1 (N,R,WSAVE,WSAVE(N+1),WSAVE(2*N+1))                           
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTF1 (N,C,CH,WA,IFAC)                                        
+      INTEGER N, NF, NA, L2, IW, K1, KH, IP, L1, IDO, IDL1, IX2, IX3
+      INTEGER I, IX4
+      REAL       CH(*)      ,C(*)       ,WA(*)      ,IFAC(*)   
+      NF = IFAC(2)                                                              
+      NA = 1                                                                    
+      L2 = N                                                                    
+      IW = N                                                                    
+      DO 111 K1=1,NF                                                            
+         KH = NF-K1                                                             
+         IP = IFAC(KH+3)                                                        
+         L1 = L2/IP                                                             
+         IDO = N/L2                                                             
+         IDL1 = IDO*L1                                                          
+         IW = IW-(IP-1)*IDO                                                     
+         NA = 1-NA                                                              
+         IF (IP .NE. 4) GO TO 102                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IF (NA .NE. 0) GO TO 101                                               
+         CALL RADF4 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 110                                                              
+  101    CALL RADF4 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 110                                                              
+  102    IF (IP .NE. 2) GO TO 104                                               
+         IF (NA .NE. 0) GO TO 103                                               
+         CALL RADF2 (IDO,L1,C,CH,WA(IW))                                        
+         GO TO 110                                                              
+  103    CALL RADF2 (IDO,L1,CH,C,WA(IW))                                        
+         GO TO 110                                                              
+  104    IF (IP .NE. 3) GO TO 106                                               
+         IX2 = IW+IDO                                                           
+         IF (NA .NE. 0) GO TO 105                                               
+         CALL RADF3 (IDO,L1,C,CH,WA(IW),WA(IX2))                                
+         GO TO 110                                                              
+  105    CALL RADF3 (IDO,L1,CH,C,WA(IW),WA(IX2))                                
+         GO TO 110                                                              
+  106    IF (IP .NE. 5) GO TO 108                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IX4 = IX3+IDO                                                          
+         IF (NA .NE. 0) GO TO 107                                               
+         CALL RADF5 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 110                                                              
+  107    CALL RADF5 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 110                                                              
+  108    IF (IDO .EQ. 1) NA = 1-NA                                              
+         IF (NA .NE. 0) GO TO 109                                               
+         CALL RADFG (IDO,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))                         
+         NA = 1                                                                 
+         GO TO 110                                                              
+  109    CALL RADFG (IDO,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))                        
+         NA = 0                                                                 
+  110    L2 = L1                                                                
+  111 CONTINUE                                                                  
+      IF (NA .EQ. 1) RETURN                                                     
+      DO 112 I=1,N                                                              
+         C(I) = CH(I)                                                           
+  112 CONTINUE                                                                  
+      RETURN                                                                    
+      END                         
+                                                                    
+C     SUBROUTINE RFFTI(N,WSAVE)                                                 
+C                                                                               
+C     SUBROUTINE RFFTI INITIALIZES THE ARRAY WSAVE WHICH IS USED IN             
+C     BOTH RFFTF AND RFFTB. THE PRIME FACTORIZATION OF N TOGETHER WITH          
+C     A TABULATION OF THE TRIGONOMETRIC FUNCTIONS ARE COMPUTED AND              
+C     STORED IN WSAVE.                                                          
+C                                                                               
+C     INPUT PARAMETER                                                           
+C                                                                               
+C     N       THE LENGTH OF THE SEQUENCE TO BE TRANSFORMED.                     
+C                                                                               
+C     OUTPUT PARAMETER                                                          
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             THE SAME WORK ARRAY CAN BE USED FOR BOTH RFFTF AND RFFTB          
+C             AS LONG AS N REMAINS UNCHANGED. DIFFERENT WSAVE ARRAYS            
+C             ARE REQUIRED FOR DIFFERENT VALUES OF N. THE CONTENTS OF           
+C             WSAVE MUST NOT BE CHANGED BETWEEN CALLS OF RFFTF OR RFFTB.        
+C                                                                               
+      SUBROUTINE RFFTI (N,WSAVE)      
+      INTEGER N
+      REAL       WSAVE(*)                                                  
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTI1 (N,WSAVE(N+1),WSAVE(2*N+1))                                   
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTI1 (N,WA,IFAC)                                             
+      INTEGER N, NL, NF, J, NTRY, NR, NQ, IB, I, IS, L1, NFM1, K1
+      INTEGER IP, LD, IDO, IPM, II, L2
+      REAL       WA(*)      ,IFAC(*)    ,NTRYH(4)         
+      REAL TPI, ARGH, ARGLD, FI, ARG, DUM
+      REAL PIMACH
+      DATA NTRYH(1),NTRYH(2),NTRYH(3),NTRYH(4)/4,2,3,5/                         
+      NL = N                                                                    
+      NF = 0                                                                    
+      J = 0                                                                     
+  101 J = J+1                                                                   
+      IF (J-4) 102,102,103                                                      
+  102 NTRY = NTRYH(J)                                                           
+      GO TO 104                                                                 
+  103 NTRY = NTRY+2                                                             
+  104 NQ = NL/NTRY                                                              
+      NR = NL-NTRY*NQ                                                           
+      IF (NR) 101,105,101                                                       
+  105 NF = NF+1                                                                 
+      IFAC(NF+2) = NTRY                                                         
+      NL = NQ                                                                   
+      IF (NTRY .NE. 2) GO TO 107                                                
+      IF (NF .EQ. 1) GO TO 107                                                  
+      DO 106 I=2,NF                                                             
+         IB = NF-I+2                                                            
+         IFAC(IB+2) = IFAC(IB+1)                                                
+  106 CONTINUE                                                                  
+      IFAC(3) = 2                                                               
+  107 IF (NL .NE. 1) GO TO 104                                                  
+      IFAC(1) = N                                                               
+      IFAC(2) = NF                                                              
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARGH = TPI/FLOAT(N)                                                       
+      IS = 0                                                                    
+      NFM1 = NF-1                                                               
+      L1 = 1                                                                    
+      IF (NFM1 .EQ. 0) RETURN                                                   
+      DO 110 K1=1,NFM1                                                          
+         IP = IFAC(K1+2)                                                        
+         LD = 0                                                                 
+         L2 = L1*IP                                                             
+         IDO = N/L2                                                             
+         IPM = IP-1                                                             
+         DO 109 J=1,IPM                                                         
+            LD = LD+L1                                                          
+            I = IS                                                              
+            ARGLD = FLOAT(LD)*ARGH                                              
+            FI = 0.                                                             
+            DO 108 II=3,IDO,2                                                   
+               I = I+2                                                          
+               FI = FI+1.                                                       
+               ARG = FI*ARGLD                                                   
+               WA(I-1) = COS(ARG)                                               
+               WA(I) = SIN(ARG)                                                 
+  108       CONTINUE                                                            
+            IS = IS+IDO                                                         
+  109    CONTINUE                                                               
+         L1 = L2                                                                
+  110 CONTINUE                                                                  
+      RETURN                                                                    
+      END
+   
+      
+      REAL FUNCTION PIMACH (DUM)                      
+C     PI=3.1415926535897932384626433832795028841971693993751058209749446        
+C                            
+      REAL DUM
+      PIMACH = 4.*ATAN(1.0)                                                     
+      RETURN                                                                    
+      END    
+                                                                            
+      SUBROUTINE RADFG (IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)                      
+      INTEGER IDO, IP, L1, IDL1, IPPH, IPP2, IDP2, NBD, IK, J, K, IS
+      INTEGER IDIJ, I, JC, L, LC, J2, IC
+      REAL       CH(IDO,L1,IP)          ,CC(IDO,IP,L1)          ,          
+     1                C1(IDO,L1,IP)          ,C2(IDL1,IP),                      
+     2                CH2(IDL1,IP)           ,WA(*)
+
+      REAL TPI, DUM, ARG, DCP, DSP, AR1, AI1, AR1H, DC2, DS2, AR2, AI2
+      REAL AR2H
+      REAL PIMACH
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARG = TPI/FLOAT(IP)                                                       
+      DCP = COS(ARG)                                                            
+      DSP = SIN(ARG)                                                            
+      IPPH = (IP+1)/2                                                           
+      IPP2 = IP+2                                                               
+      IDP2 = IDO+2                                                              
+      NBD = (IDO-1)/2                                                           
+      IF (IDO .EQ. 1) GO TO 119                                                 
+      DO 101 IK=1,IDL1                                                          
+         CH2(IK,1) = C2(IK,1)                                                   
+  101 CONTINUE                                                                  
+      DO 103 J=2,IP                                                             
+         DO 102 K=1,L1                                                          
+            CH(1,K,J) = C1(1,K,J)                                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      IF (NBD .GT. L1) GO TO 107                                                
+      IS = -IDO                                                                 
+      DO 106 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         IDIJ = IS                                                              
+         DO 105 I=3,IDO,2                                                       
+            IDIJ = IDIJ+2                                                       
+            DO 104 K=1,L1                                                       
+               CH(I-1,K,J) = WA(IDIJ-1)*C1(I-1,K,J)+WA(IDIJ)*C1(I,K,J)          
+               CH(I,K,J) = WA(IDIJ-1)*C1(I,K,J)-WA(IDIJ)*C1(I-1,K,J)            
+  104       CONTINUE                                                            
+  105    CONTINUE                                                               
+  106 CONTINUE                                                                  
+      GO TO 111                                                                 
+  107 IS = -IDO                                                                 
+      DO 110 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         DO 109 K=1,L1                                                          
+            IDIJ = IS                                                           
+            DO 108 I=3,IDO,2                                                    
+               IDIJ = IDIJ+2                                                    
+               CH(I-1,K,J) = WA(IDIJ-1)*C1(I-1,K,J)+WA(IDIJ)*C1(I,K,J)          
+               CH(I,K,J) = WA(IDIJ-1)*C1(I,K,J)-WA(IDIJ)*C1(I-1,K,J)            
+  108       CONTINUE                                                            
+  109    CONTINUE                                                               
+  110 CONTINUE                                                                  
+  111 IF (NBD .LT. L1) GO TO 115                                                
+      DO 114 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 113 K=1,L1                                                          
+            DO 112 I=3,IDO,2                                                    
+               C1(I-1,K,J) = CH(I-1,K,J)+CH(I-1,K,JC)                           
+               C1(I-1,K,JC) = CH(I,K,J)-CH(I,K,JC)                              
+               C1(I,K,J) = CH(I,K,J)+CH(I,K,JC)                                 
+               C1(I,K,JC) = CH(I-1,K,JC)-CH(I-1,K,J)                            
+  112       CONTINUE                                                            
+  113    CONTINUE                                                               
+  114 CONTINUE                                                                  
+      GO TO 121                                                                 
+  115 DO 118 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 117 I=3,IDO,2                                                       
+            DO 116 K=1,L1                                                       
+               C1(I-1,K,J) = CH(I-1,K,J)+CH(I-1,K,JC)                           
+               C1(I-1,K,JC) = CH(I,K,J)-CH(I,K,JC)                              
+               C1(I,K,J) = CH(I,K,J)+CH(I,K,JC)                                 
+               C1(I,K,JC) = CH(I-1,K,JC)-CH(I-1,K,J)                            
+  116       CONTINUE                                                            
+  117    CONTINUE                                                               
+  118 CONTINUE                                                                  
+      GO TO 121                                                                 
+  119 DO 120 IK=1,IDL1                                                          
+         C2(IK,1) = CH2(IK,1)                                                   
+  120 CONTINUE                                                                  
+  121 DO 123 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 122 K=1,L1                                                          
+            C1(1,K,J) = CH(1,K,J)+CH(1,K,JC)                                    
+            C1(1,K,JC) = CH(1,K,JC)-CH(1,K,J)                                   
+  122    CONTINUE                                                               
+  123 CONTINUE                                                                  
+C                                                                               
+      AR1 = 1.                                                                  
+      AI1 = 0.                                                                  
+      DO 127 L=2,IPPH                                                           
+         LC = IPP2-L                                                            
+         AR1H = DCP*AR1-DSP*AI1                                                 
+         AI1 = DCP*AI1+DSP*AR1                                                  
+         AR1 = AR1H                                                             
+         DO 124 IK=1,IDL1                                                       
+            CH2(IK,L) = C2(IK,1)+AR1*C2(IK,2)                                   
+            CH2(IK,LC) = AI1*C2(IK,IP)                                          
+  124    CONTINUE                                                               
+         DC2 = AR1                                                              
+         DS2 = AI1                                                              
+         AR2 = AR1                                                              
+         AI2 = AI1                                                              
+         DO 126 J=3,IPPH                                                        
+            JC = IPP2-J                                                         
+            AR2H = DC2*AR2-DS2*AI2                                              
+            AI2 = DC2*AI2+DS2*AR2                                               
+            AR2 = AR2H                                                          
+            DO 125 IK=1,IDL1                                                    
+               CH2(IK,L) = CH2(IK,L)+AR2*C2(IK,J)                               
+               CH2(IK,LC) = CH2(IK,LC)+AI2*C2(IK,JC)                            
+  125       CONTINUE                                                            
+  126    CONTINUE                                                               
+  127 CONTINUE                                                                  
+      DO 129 J=2,IPPH                                                           
+         DO 128 IK=1,IDL1                                                       
+            CH2(IK,1) = CH2(IK,1)+C2(IK,J)                                      
+  128    CONTINUE                                                               
+  129 CONTINUE                                                                  
+C                                                                               
+      IF (IDO .LT. L1) GO TO 132                                                
+      DO 131 K=1,L1                                                             
+         DO 130 I=1,IDO                                                         
+            CC(I,1,K) = CH(I,K,1)                                               
+  130    CONTINUE                                                               
+  131 CONTINUE                                                                  
+      GO TO 135                                                                 
+  132 DO 134 I=1,IDO                                                            
+         DO 133 K=1,L1                                                          
+            CC(I,1,K) = CH(I,K,1)                                               
+  133    CONTINUE                                                               
+  134 CONTINUE                                                                  
+  135 DO 137 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 136 K=1,L1                                                          
+            CC(IDO,J2-2,K) = CH(1,K,J)                                          
+            CC(1,J2-1,K) = CH(1,K,JC)                                           
+  136    CONTINUE                                                               
+  137 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IF (NBD .LT. L1) GO TO 141                                                
+      DO 140 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 139 K=1,L1                                                          
+            DO 138 I=3,IDO,2                                                    
+               IC = IDP2-I                                                      
+               CC(I-1,J2-1,K) = CH(I-1,K,J)+CH(I-1,K,JC)                        
+               CC(IC-1,J2-2,K) = CH(I-1,K,J)-CH(I-1,K,JC)                       
+               CC(I,J2-1,K) = CH(I,K,J)+CH(I,K,JC)                              
+               CC(IC,J2-2,K) = CH(I,K,JC)-CH(I,K,J)                             
+  138       CONTINUE                                                            
+  139    CONTINUE                                                               
+  140 CONTINUE                                                                  
+      RETURN                                                                    
+  141 DO 144 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 143 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DO 142 K=1,L1                                                       
+               CC(I-1,J2-1,K) = CH(I-1,K,J)+CH(I-1,K,JC)                        
+               CC(IC-1,J2-2,K) = CH(I-1,K,J)-CH(I-1,K,JC)                       
+               CC(I,J2-1,K) = CH(I,K,J)+CH(I,K,JC)                              
+               CC(IC,J2-2,K) = CH(I,K,JC)-CH(I,K,J)                             
+  142       CONTINUE                                                            
+  143    CONTINUE                                                               
+  144 CONTINUE                                                                  
+      RETURN                                                                    
+      END                         
+                                                                       
+      SUBROUTINE RADF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4)                           
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,L1,5)           ,CH(IDO,5,L1)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)     ,WA4(*)    
+      REAL CR2, CR3, CR4, CR5, CI2, CI3, CI4, CI5
+      REAL TR2, TR3, TR4, TR5, TI2, TI3, TI4, TI5
+      REAL DR2, DR3, DR4, DR5, DI2, DI3, DI4, DI5
+      REAL TR11, TI11, TR12, TI12
+      DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154,              
+     1-.809016994374947,.587785252292473/                                       
+      DO 101 K=1,L1                                                             
+         CR2 = CC(1,K,5)+CC(1,K,2)                                              
+         CI5 = CC(1,K,5)-CC(1,K,2)                                              
+         CR3 = CC(1,K,4)+CC(1,K,3)                                              
+         CI4 = CC(1,K,4)-CC(1,K,3)                                              
+         CH(1,1,K) = CC(1,K,1)+CR2+CR3                                          
+         CH(IDO,2,K) = CC(1,K,1)+TR11*CR2+TR12*CR3                              
+         CH(1,3,K) = TI11*CI5+TI12*CI4                                          
+         CH(IDO,4,K) = CC(1,K,1)+TR12*CR2+TR11*CR3                              
+         CH(1,5,K) = TI12*CI5-TI11*CI4                                          
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            DI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            DR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            DI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            DR4 = WA3(I-2)*CC(I-1,K,4)+WA3(I-1)*CC(I,K,4)                       
+            DI4 = WA3(I-2)*CC(I,K,4)-WA3(I-1)*CC(I-1,K,4)                       
+            DR5 = WA4(I-2)*CC(I-1,K,5)+WA4(I-1)*CC(I,K,5)                       
+            DI5 = WA4(I-2)*CC(I,K,5)-WA4(I-1)*CC(I-1,K,5)                       
+            CR2 = DR2+DR5                                                       
+            CI5 = DR5-DR2                                                       
+            CR5 = DI2-DI5                                                       
+            CI2 = DI2+DI5                                                       
+            CR3 = DR3+DR4                                                       
+            CI4 = DR4-DR3                                                       
+            CR4 = DI3-DI4                                                       
+            CI3 = DI3+DI4                                                       
+            CH(I-1,1,K) = CC(I-1,K,1)+CR2+CR3                                   
+            CH(I,1,K) = CC(I,K,1)+CI2+CI3                                       
+            TR2 = CC(I-1,K,1)+TR11*CR2+TR12*CR3                                 
+            TI2 = CC(I,K,1)+TR11*CI2+TR12*CI3                                   
+            TR3 = CC(I-1,K,1)+TR12*CR2+TR11*CR3                                 
+            TI3 = CC(I,K,1)+TR12*CI2+TR11*CI3                                   
+            TR5 = TI11*CR5+TI12*CR4                                             
+            TI5 = TI11*CI5+TI12*CI4                                             
+            TR4 = TI12*CR5-TI11*CR4                                             
+            TI4 = TI12*CI5-TI11*CI4                                             
+            CH(I-1,3,K) = TR2+TR5                                               
+            CH(IC-1,2,K) = TR2-TR5                                              
+            CH(I,3,K) = TI2+TI5                                                 
+            CH(IC,2,K) = TI5-TI2                                                
+            CH(I-1,5,K) = TR3+TR4                                               
+            CH(IC-1,4,K) = TR3-TR4                                              
+            CH(I,5,K) = TI3+TI4                                                 
+            CH(IC,4,K) = TI4-TI3                                                
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                           
+                                                                  
+      SUBROUTINE RADF2 (IDO,L1,CC,CH,WA1)                                       
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CH(IDO,2,L1)           ,CC(IDO,L1,2)           ,          
+     1                WA1(*)           
+      REAL TR2, TI2
+      DO 101 K=1,L1                                                             
+         CH(1,1,K) = CC(1,K,1)+CC(1,K,2)                                        
+         CH(IDO,2,K) = CC(1,K,1)-CC(1,K,2)                                      
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            TI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            CH(I,1,K) = CC(I,K,1)+TI2                                           
+            CH(IC,2,K) = TI2-CC(I,K,1)                                          
+            CH(I-1,1,K) = CC(I-1,K,1)+TR2                                       
+            CH(IC-1,2,K) = CC(I-1,K,1)-TR2                                      
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 DO 106 K=1,L1                                                             
+         CH(1,2,K) = -CC(IDO,K,2)                                               
+         CH(IDO,1,K) = CC(IDO,K,1)                                              
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END      
+                                                                       
+      SUBROUTINE RADF3 (IDO,L1,CC,CH,WA1,WA2)                                   
+      INTEGER IDO, L1, I, IC, K, IDP2
+      REAL       CH(IDO,3,L1)           ,CC(IDO,L1,3)           ,          
+     1                WA1(*)     ,WA2(*)     
+      REAL TAUR, TAUI, CR2, DR2, DI2, DR3, DI3, CI2, TR2, TI2, TR3, TI3
+      DATA TAUR,TAUI /-.5,.866025403784439/                                     
+      DO 101 K=1,L1                                                             
+         CR2 = CC(1,K,2)+CC(1,K,3)                                              
+         CH(1,1,K) = CC(1,K,1)+CR2                                              
+         CH(1,3,K) = TAUI*(CC(1,K,3)-CC(1,K,2))                                 
+         CH(IDO,2,K) = CC(1,K,1)+TAUR*CR2                                       
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            DI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            DR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            DI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            CR2 = DR2+DR3                                                       
+            CI2 = DI2+DI3                                                       
+            CH(I-1,1,K) = CC(I-1,K,1)+CR2                                       
+            CH(I,1,K) = CC(I,K,1)+CI2                                           
+            TR2 = CC(I-1,K,1)+TAUR*CR2                                          
+            TI2 = CC(I,K,1)+TAUR*CI2                                            
+            TR3 = TAUI*(DI2-DI3)                                                
+            TI3 = TAUI*(DR3-DR2)                                                
+            CH(I-1,3,K) = TR2+TR3                                               
+            CH(IC-1,2,K) = TR2-TR3                                              
+            CH(I,3,K) = TI2+TI3                                                 
+            CH(IC,2,K) = TI3-TI2                                                
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADF4 (IDO,L1,CC,CH,WA1,WA2,WA3)                               
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,L1,4)           ,CH(IDO,4,L1)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)  
+      REAL HSQT2
+      REAL CR2, CR3, CR4, CI2, CI3, CI4
+      REAL TR1, TR2, TR3, TR4, TI1, TI2, TI3, TI4
+      DATA HSQT2 /.7071067811865475/                                            
+      DO 101 K=1,L1                                                             
+         TR1 = CC(1,K,2)+CC(1,K,4)                                              
+         TR2 = CC(1,K,1)+CC(1,K,3)                                              
+         CH(1,1,K) = TR1+TR2                                                    
+         CH(IDO,4,K) = TR2-TR1                                                  
+         CH(IDO,2,K) = CC(1,K,1)-CC(1,K,3)                                      
+         CH(1,3,K) = CC(1,K,4)-CC(1,K,2)                                        
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            CR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            CI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            CR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            CI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            CR4 = WA3(I-2)*CC(I-1,K,4)+WA3(I-1)*CC(I,K,4)                       
+            CI4 = WA3(I-2)*CC(I,K,4)-WA3(I-1)*CC(I-1,K,4)                       
+            TR1 = CR2+CR4                                                       
+            TR4 = CR4-CR2                                                       
+            TI1 = CI2+CI4                                                       
+            TI4 = CI2-CI4                                                       
+            TI2 = CC(I,K,1)+CI3                                                 
+            TI3 = CC(I,K,1)-CI3                                                 
+            TR2 = CC(I-1,K,1)+CR3                                               
+            TR3 = CC(I-1,K,1)-CR3                                               
+            CH(I-1,1,K) = TR1+TR2                                               
+            CH(IC-1,4,K) = TR2-TR1                                              
+            CH(I,1,K) = TI1+TI2                                                 
+            CH(IC,4,K) = TI1-TI2                                                
+            CH(I-1,3,K) = TI4+TR3                                               
+            CH(IC-1,2,K) = TR3-TI4                                              
+            CH(I,3,K) = TR4+TI3                                                 
+            CH(IC,2,K) = TR4-TI3                                                
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 CONTINUE                                                                  
+      DO 106 K=1,L1                                                             
+         TI1 = -HSQT2*(CC(IDO,K,2)+CC(IDO,K,4))                                 
+         TR1 = HSQT2*(CC(IDO,K,2)-CC(IDO,K,4))                                  
+         CH(IDO,1,K) = TR1+CC(IDO,K,1)                                          
+         CH(IDO,3,K) = CC(IDO,K,1)-TR1                                          
+         CH(1,2,K) = TI1-CC(IDO,K,3)                                            
+         CH(1,4,K) = TI1+CC(IDO,K,3)                                            
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                   
diff --git a/external_functions/fft/invert.jnl b/external_functions/fft/invert.jnl
new file mode 100644
index 0000000..245357f
--- /dev/null
+++ b/external_functions/fft/invert.jnl
@@ -0,0 +1,70 @@
+!------------------------------invert.jnl-------------------------------
+! Ansley Manke Nov 2001
+
+ ! Compute FFT of time series; then invert to recover time series.
+
+set win/clear
+DEFINE AXIS/t=1:366:1 dayt
+
+DEFINE GRID/T=dayt  tgrid
+SET GRID tgrid
+LET fcn1 = sin(0.5*tpts - 6.) /2.
+LET fcn2 = cos(0.3*tpts)
+
+!  Use an analytic function.
+
+LET sample_function = fcn1 - fcn2 + 0.2* randu(tpts)
+LET tpts = t
+
+
+set view upper
+plot/title="original function" sample_function
+pause
+
+! Compute the equivalent of FFTA(sample_function)
+
+LET sample_re = fft_re(sample_function)
+LET sample_im = fft_im(sample_function)
+LET amp_fft = (sample_re* sample_re + sample_im* sample_im)^0.5
+
+! Compare with the computation in fcn FFTA
+
+set window/siz=0.4
+set view upper
+plot ffta(sample_function)
+set view lower
+plot amp_fft
+
+message "now overlay amplitude spectrum computed by FFTA"
+plot/over ffta(sample_function)
+
+message "next compare the phase function"
+
+! Compute the equivalent of FFTP(sample_function)
+
+LET rad = 180.0/ 3.141592654
+LET phas = rad* ATAN2(-1.*sample_im, sample_re)     ! the computation done in FFTP(v)
+
+! Compare with the computation of FFTA
+
+set window/siz=0.4
+set view upper
+plot fftp(sample_function)
+set view lower
+plot phas
+
+message "Overlay FFT phase computed by fftp"
+plot/over fftp(sample_function)
+
+
+message "next invert the FFT and compare with original time series"
+
+LET invert_ts = fft_inverse(sample_re, sample_im)
+set view upper
+plot/title="Original SAMPLE_FUNCTION" sample_function
+
+set view lower
+plot invert_ts
+ 
+message "now overlay the original time series function"
+plot/over sample_function
diff --git a/external_functions/fft/lsl_lowpass.F b/external_functions/fft/lsl_lowpass.F
new file mode 100644
index 0000000..a416331
--- /dev/null
+++ b/external_functions/fft/lsl_lowpass.F
@@ -0,0 +1,430 @@
+*
+* lsl_lowpass.F
+*
+* LSL-low_pass_filter from Ned Cokelet.
+*  Ansley Manke
+*  Dec 6 1999
+*
+* Returns the argument filtered with Least Squares Lanzcos filter in time.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE lsl_lowpass_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 label
+
+      WRITE (label, 10) 
+   10 FORMAT ( 'Returns Least Squares Lanzcos filter of ',
+     .          'equally-spaced time series' )
+      CALL ef_set_desc(id,label)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 3)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'data to be filtered')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'cutoff_period')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'period at which filter attains 1/2 amplitude. <=N')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'filter_span')
+      CALL ef_set_arg_desc(id, arg, 
+     . 'number of input data points used in each filtered output point')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE lsl_lowpass_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mt
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+*  x -- input time series
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mt, 1, 1, 1)
+
+*  y -- output time series
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mt, 1, 1, 1)
+
+*  h -- work array for subroutine LSL_low_pass_filter
+
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   mt, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE lsl_lowpass_compute(id, arg_1, arg_2, arg_3, result, 
+     .                              x, y, h)
+
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, n
+      INTEGER i1, j1, k1, l1
+      INTEGER nt
+      INTEGER filter_span
+      REAL cutoff_period
+      CHARACTER*255 err_msg
+
+*  Dimension the work arrays.
+
+      REAL x(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL y(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL h(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+
+*  Get argument and result subscripts and bad-data flags.
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Get cutoff parameter.
+
+      cutoff_period = arg_2(arg_lo_ss(X_AXIS,ARG2), 
+     .            arg_lo_ss(Y_AXIS,ARG2), arg_lo_ss(Z_AXIS,ARG2), 
+     .            arg_lo_ss(T_AXIS,ARG2))
+
+*  Get time percent parameter.
+
+      filter_span = arg_3(arg_lo_ss(X_AXIS,ARG3), 
+     .            arg_lo_ss(Y_AXIS,ARG3), arg_lo_ss(Z_AXIS,ARG3), 
+     .            arg_lo_ss(T_AXIS,ARG3))
+
+*  Get N = length of time series.
+
+      nt  =  1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      IF (filter_span .GT. nt) THEN
+         WRITE (err_msg, 10)
+   10    FORMAT('LSL_FILTER: The filter span must be less than or ', 
+     .             'equal to the number of points')
+         GOTO 999
+      ENDIF
+ 
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* Compute the filtered time series.
+
+               n = 1
+               DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+                  x(n,1,1,1) = arg_1(i1,j1,k1,l1)
+                  n = n + 1
+ 100           CONTINUE
+
+               CALL LSL_low_pass_filter (x, nt, cutoff_period, 
+     .            bad_flag(ARG1), filter_span, h, y)
+
+*  Put the filtred series in result
+
+               n = 1
+               DO 110 l= res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  IF (y(n,1,1,1) .NE. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = y(n,1,1,1)
+                  ELSE
+                     result(i,j,k,l) = bad_flag_result
+                  ENDIF
+                  n = n + 1
+ 110           CONTINUE
+
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+      
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+      subroutine LSL_low_pass_filter( 
+     1  x, N, cutoff_period, missing_value, filter_span, h, y )
+c
+c Least Squares Lanczos (LSL) low-pass filter:  This subroutine 
+c low-pass filters an equally spaced time series using least-squares 
+c approximation to the ideal low-pass filter of Bloomfield with Lanczos 
+c convergence factors.  It is very similar to subroutine LOPASS in 
+c Chapter 6, p. 149, of
+c 
+c Bloomfield, P., 1976, Fourier Analysis of Time Series: An 
+c    Introduction, John Wiley & Sons, New York, 258 pp.
+c
+c The main difference is that the present routine takes account of
+c missing values in the input time series.
+c
+c Inputs:
+c
+c x(N) = a real array of equally spaced points to low-pass filter
+c N    = the number of points in x
+c cutoff_period = the cutoff period (the period at which the filter
+c                 attains 1/2 amplitude or 1/4 "energy") measured in
+c                 units of delta t.  The cutoff_period must be less than
+c                 or equal to N.
+c filter_span = the number of input data points used in each filtered
+c               output point.  A wide filter gives a narrow frequency
+c               response transition band, but leads to ringing near
+c               data discontinuities and loss of filtered values at the
+c               end points and surrounding missing values.  A narrow
+c               filter reduces ringing and output data loss, but gives
+c               a wider frequency transition width, i.e. it falls off
+c               less rapidly at freqs. higher than the cutoff.
+c               The filter transition region lies in the period range
+c               between N*cutoff_period/(N + cutoff_period) and 
+c               N*cutoff_period/(N - cutoff_period). 
+c missing_value = the missing value flag that signals to exclude flagged
+c                 values from the computation.
+c Outputs:
+c
+c filter_span = the filter span should be an odd integer.  It is set to 
+c               the next lower odd number if the input is even.
+c y(N)        = the output array of filtered values.  Values near the
+c               ends and near gaps are filled with the missing value
+c               flag.
+c
+c Note on tidal filtering:  For hourly time series containing tidal
+c signals, some investigators use this filter with a 35-hour cutoff period
+c and a filter span of xxx hours to remove at least 99.5 % of the energy for
+c periods less than 25 hours.
+c
+c Adapted from Bloomfield by E. D. Cokelet, NOAA/PMEL, 3 Dec 1999    
+c
+c        1         2         3         4         5         6         7
+c23456789012345678901234567890123456789012345678901234567890123456789012
+c
+
+c acm  explicitly define and type all variables
+      integer n, i, j, ib, ie
+      real*4 cutoff_period, missing_value
+      real*8 pi, omega_c, h0, con, summ, temp, x1, x2, d1, d2
+
+      integer filter_span, half_span
+      real*4 x(*), h(*), y(*)
+
+c      d(z) = sin(z)/z      ! define statement function  (doesnt work on osf)
+
+      pi = 4.*atan(1.d0)
+
+c Make sure filter span is odd
+c
+      half_span = int( (filter_span - 1) / 2 )
+      filter_span = 2*half_span + 1
+c
+c
+c Calculate the filter weights and normalize them
+c
+      omega_c = 2 * pi / cutoff_period
+c
+      h0 = omega_c / pi
+      con = 2.*pi/float(filter_span)
+      summ = h0
+      do 10 i = 1, half_span
+         d1 = sin(float(i)*omega_c)/ (float(i)*omega_c)
+         d2 = sin(float(i)*con)/ (float(i)*con)
+c         h(i) = h0 * d( float(i)*omega_c ) * d( float(i)*con )
+         h(i) = h0 * d1 * d2
+         summ = summ + 2. * h(i)
+ 10   continue
+c
+      h0 = h0/summ
+      do 20 i = 1, half_span
+         h(i) = h(i) / summ
+ 20   continue
+c
+c
+c Put missing_value in the first and last half_span elements to
+c account for end effects
+c
+      do 30 i =1, half_span
+         y(i) = missing_value
+         j = N - i + 1
+         y(j) = missing_value
+ 30   continue
+c
+c
+c Filter by convolving.  
+c To account for gaps in the time series, set to missing any filtered
+c values that would require missing values to compute them.
+c
+      ib = half_span + 1
+      ie = N - half_span
+c
+      do 50 i = ib, ie
+         if (x(i) .eq. missing_value) then
+            temp = missing_value
+            go to 45
+         end if
+         temp = h0 * x(i)
+         do 40 j = 1, half_span
+   	    x1 = x(i - j)
+   	    x2 = x(i + j)
+   	    if ( ( x1 .eq. missing_value ) .or. 
+     1          ( x2 .eq. missing_value ) ) then
+   		temp = missing_value
+   		go to 45
+   	    end if
+	    temp = temp + h(j) * ( x1 + x2 )
+ 40      continue
+ 45      continue
+         y(i) = temp
+
+ 50   continue
+c
+      return
+      end
+
+c      real*8 function d(z)
+c
+cc      d(z) = sin(z)/z      ! define statement function  (doesnt work on osf)
+c
+c      real z
+c      d = sin(z)/ z
+c
+c      return
+c      end
diff --git a/external_functions/fft/sunspot_fft.dat b/external_functions/fft/sunspot_fft.dat
new file mode 100644
index 0000000..2030638
--- /dev/null
+++ b/external_functions/fft/sunspot_fft.dat
@@ -0,0 +1,154 @@
+             DATA SET: ./yearssn.dat
+             T (YR/CYC): -0.0016779 to 0.49832
+ Column  1: FREQ is L / 298
+ Column  2: EX#2 is 1./FREQ
+ Column  3: FFTSUN is TFFT_AMP(SUNSPOT_INDEX,FREQ[L=1:149])
+     0.00336   298.00000     5.49249
+     0.00671   149.00000     7.87738
+     0.01007    99.33334    19.44705
+     0.01342    74.50000     1.23650
+     0.01678    59.60000    11.73761
+     0.02013    49.66667     8.97863
+     0.02349    42.57143     3.99610
+     0.02685    37.25000     5.77600
+     0.03020    33.11111     3.66135
+     0.03356    29.80000     5.74712
+     0.03691    27.09091     3.99403
+     0.04027    24.83333     3.74793
+     0.04362    22.92308     2.22440
+     0.04698    21.28571     5.42652
+     0.05034    19.86667     1.11762
+     0.05369    18.62500     2.69469
+     0.05705    17.52941     2.63069
+     0.06040    16.55556     3.43626
+     0.06376    15.68421     2.93373
+     0.06711    14.90000     3.96566
+     0.07047    14.19048     3.10191
+     0.07383    13.54545     3.92487
+     0.07718    12.95652     8.52919
+     0.08054    12.41667     6.17860
+     0.08389    11.92000    11.08540
+     0.08725    11.46154     7.57448
+     0.09060    11.03704    28.36150
+     0.09396    10.64286    20.07696
+     0.09732    10.27586     9.64187
+     0.10067     9.93333    15.83482
+     0.10403     9.61290     8.80017
+     0.10738     9.31250     3.26306
+     0.11074     9.03030     1.68325
+     0.11409     8.76471     4.63663
+     0.11745     8.51429    10.24989
+     0.12081     8.27778     4.75489
+     0.12416     8.05405     5.93501
+     0.12752     7.84211     4.74322
+     0.13087     7.64103     1.91226
+     0.13423     7.45000     3.65315
+     0.13758     7.26829     3.59100
+     0.14094     7.09524     1.25941
+     0.14430     6.93023     1.75168
+     0.14765     6.77273     1.29277
+     0.15101     6.62222     1.29983
+     0.15436     6.47826     1.25542
+     0.15772     6.34043     1.01899
+     0.16107     6.20833     0.38481
+     0.16443     6.08163     2.01623
+     0.16779     5.96000     2.13465
+     0.17114     5.84314     3.23618
+     0.17450     5.73077     3.87919
+     0.17785     5.62264     0.53745
+     0.18121     5.51852     5.65883
+     0.18456     5.41818     1.33827
+     0.18792     5.32143     3.26664
+     0.19128     5.22807     1.45132
+     0.19463     5.13793     2.89561
+     0.19799     5.05085     2.66670
+     0.20134     4.96667     0.69898
+     0.20470     4.88525     2.61122
+     0.20805     4.80645     2.38314
+     0.21141     4.73016     2.15888
+     0.21477     4.65625     1.12802
+     0.21812     4.58462     1.52966
+     0.22148     4.51515     1.23105
+     0.22483     4.44776     0.84635
+     0.22819     4.38235     2.04886
+     0.23154     4.31884     1.56067
+     0.23490     4.25714     1.74422
+     0.23826     4.19718     0.79299
+     0.24161     4.13889     1.66737
+     0.24497     4.08219     0.83221
+     0.24832     4.02703     0.99149
+     0.25168     3.97333     1.53853
+     0.25503     3.92105     1.07436
+     0.25839     3.87013     1.03107
+     0.26174     3.82051     0.20165
+     0.26510     3.77215     1.63722
+     0.26846     3.72500     0.75253
+     0.27181     3.67901     1.55570
+     0.27517     3.63415     1.16236
+     0.27852     3.59036     0.79585
+     0.28188     3.54762     1.16743
+     0.28523     3.50588     0.31289
+     0.28859     3.46512     1.29855
+     0.29195     3.42529     0.62899
+     0.29530     3.38636     0.64749
+     0.29866     3.34831     0.26644
+     0.30201     3.31111     0.44657
+     0.30537     3.27473     1.19459
+     0.30872     3.23913     0.55273
+     0.31208     3.20430     1.85941
+     0.31544     3.17021     1.18171
+     0.31879     3.13684     0.99360
+     0.32215     3.10417     1.02850
+     0.32550     3.07217     0.22342
+     0.32886     3.04082     0.14945
+     0.33221     3.01010     0.11282
+     0.33557     2.98000     0.64482
+     0.33893     2.95050     0.57917
+     0.34228     2.92157     1.00083
+     0.34564     2.89320     0.68469
+     0.34899     2.86538     0.57930
+     0.35235     2.83810     0.57888
+     0.35570     2.81132     1.66339
+     0.35906     2.78505     0.24049
+     0.36242     2.75926     0.51706
+     0.36577     2.73395     0.62542
+     0.36913     2.70909     0.15956
+     0.37248     2.68468     0.53771
+     0.37584     2.66071     0.62390
+     0.37919     2.63717     0.60302
+     0.38255     2.61404     0.21897
+     0.38591     2.59130     0.37656
+     0.38926     2.56897     0.27823
+     0.39262     2.54701     0.42015
+     0.39597     2.52542     0.51981
+     0.39933     2.50420     0.82339
+     0.40268     2.48333     1.15261
+     0.40604     2.46281     0.13688
+     0.40940     2.44262     0.27196
+     0.41275     2.42276     0.72414
+     0.41611     2.40323     1.10933
+     0.41946     2.38400     0.65203
+     0.42282     2.36508     0.63535
+     0.42617     2.34646     0.61995
+     0.42953     2.32812     1.54030
+     0.43289     2.31008     0.87067
+     0.43624     2.29231     0.55194
+     0.43960     2.27481     0.40626
+     0.44295     2.25758     1.07985
+     0.44631     2.24060     0.54411
+     0.44966     2.22388     0.17844
+     0.45302     2.20741     0.64292
+     0.45638     2.19118     0.58340
+     0.45973     2.17518     0.60809
+     0.46309     2.15942     0.79994
+     0.46644     2.14388     1.11837
+     0.46980     2.12857     0.89278
+     0.47315     2.11348     0.22927
+     0.47651     2.09859     1.01846
+     0.47987     2.08392     0.58047
+     0.48322     2.06944     0.64730
+     0.48658     2.05517     0.96754
+     0.48993     2.04110     0.93807
+     0.49329     2.02721     0.59066
+     0.49664     2.01351     0.00000
+     0.50000     2.00000     0.23911
diff --git a/external_functions/fft/suntest.jnl b/external_functions/fft/suntest.jnl
new file mode 100644
index 0000000..350803c
--- /dev/null
+++ b/external_functions/fft/suntest.jnl
@@ -0,0 +1,29 @@
+!  Sunspot example
+
+DEFINE AXIS/T="1-jul-1700":"1-jul-1997":1/unit=yr tsun
+DEFINE GRID/T=tsun gsun
+FILE/VAR=sunspot_index/skip=3/G=gsun/FORMAT=(6x,f6.1) yearssn.dat
+
+LET nd = sunspot_index[l=@NGD]
+LET nf = nd / 2
+LET yquist = 0.5
+LET freq1 = yquist/ nf
+
+DEFINE AXIS/t=`freq1`:`yquist`:`freq1`/UNITS=yr FAXIS
+DEFINE GRID/t=faxis gfreq
+SET GRID gfreq
+LET tpts = t
+
+LET fftsun = ffta(sunspot_index)
+
+
+
+let fa = fft_re(sunspot_index)
+let fb = fft_im(sunspot_index)
+let famp = (fa*fa + fb*fb)^0.5
+
+set view upper
+plot fftsun
+
+set view lower
+plot famp
diff --git a/external_functions/fft/yearssn.dat b/external_functions/fft/yearssn.dat
new file mode 100644
index 0000000..dc84113
--- /dev/null
+++ b/external_functions/fft/yearssn.dat
@@ -0,0 +1,301 @@
+Yearly sunspot number
+from  http://www.moa.be/KSB-ORB/SIDC/    Royal Observatory of Belgium
+
+1700.5   5.0  
+1701.5  11.0  
+1702.5  16.0  
+1703.5  23.0  
+1704.5  36.0  
+1705.5  58.0  
+1706.5  29.0  
+1707.5  20.0  
+1708.5  10.0  
+1709.5   8.0  
+1710.5   3.0  
+1711.5    .0  
+1712.5    .0  
+1713.5   2.0  
+1714.5  11.0  
+1715.5  27.0  
+1716.5  47.0  
+1717.5  63.0  
+1718.5  60.0  
+1719.5  39.0  
+1720.5  28.0  
+1721.5  26.0  
+1722.5  22.0  
+1723.5  11.0  
+1724.5  21.0  
+1725.5  40.0  
+1726.5  78.0  
+1727.5 122.0  
+1728.5 103.0  
+1729.5  73.0  
+1730.5  47.0  
+1731.5  35.0  
+1732.5  11.0  
+1733.5   5.0  
+1734.5  16.0  
+1735.5  34.0  
+1736.5  70.0  
+1737.5  81.0  
+1738.5 111.0  
+1739.5 101.0  
+1740.5  73.0  
+1741.5  40.0  
+1742.5  20.0  
+1743.5  16.0  
+1744.5   5.0  
+1745.5  11.0  
+1746.5  22.0  
+1747.5  40.0  
+1748.5  60.0  
+1749.5  80.9  
+1750.5  83.4  
+1751.5  47.7  
+1752.5  47.8  
+1753.5  30.7  
+1754.5  12.2  
+1755.5   9.6  
+1756.5  10.2  
+1757.5  32.4  
+1758.5  47.6  
+1759.5  54.0  
+1760.5  62.9  
+1761.5  85.9  
+1762.5  61.2  
+1763.5  45.1  
+1764.5  36.4  
+1765.5  20.9  
+1766.5  11.4  
+1767.5  37.8  
+1768.5  69.8  
+1769.5 106.1  
+1770.5 100.8  
+1771.5  81.6  
+1772.5  66.5  
+1773.5  34.8  
+1774.5  30.6  
+1775.5   7.0  
+1776.5  19.8  
+1777.5  92.5  
+1778.5 154.4  
+1779.5 125.9  
+1780.5  84.8  
+1781.5  68.1  
+1782.5  38.5  
+1783.5  22.8  
+1784.5  10.2  
+1785.5  24.1  
+1786.5  82.9  
+1787.5 132.0  
+1788.5 130.9  
+1789.5 118.1  
+1790.5  89.9  
+1791.5  66.6  
+1792.5  60.0  
+1793.5  46.9  
+1794.5  41.0  
+1795.5  21.3  
+1796.5  16.0  
+1797.5   6.4  
+1798.5   4.1  
+1799.5   6.8  
+1800.5  14.5  
+1801.5  34.0  
+1802.5  45.0  
+1803.5  43.1  
+1804.5  47.5  
+1805.5  42.2  
+1806.5  28.1  
+1807.5  10.1  
+1808.5   8.1  
+1809.5   2.5  
+1810.5    .0  
+1811.5   1.4  
+1812.5   5.0  
+1813.5  12.2  
+1814.5  13.9  
+1815.5  35.4  
+1816.5  45.8  
+1817.5  41.1  
+1818.5  30.1  
+1819.5  23.9  
+1820.5  15.6  
+1821.5   6.6  
+1822.5   4.0  
+1823.5   1.8  
+1824.5   8.5  
+1825.5  16.6  
+1826.5  36.3  
+1827.5  49.6  
+1828.5  64.2  
+1829.5  67.0  
+1830.5  70.9  
+1831.5  47.8  
+1832.5  27.5  
+1833.5   8.5  
+1834.5  13.2  
+1835.5  56.9  
+1836.5 121.5  
+1837.5 138.3  
+1838.5 103.2  
+1839.5  85.7  
+1840.5  64.6  
+1841.5  36.7  
+1842.5  24.2  
+1843.5  10.7  
+1844.5  15.0  
+1845.5  40.1  
+1846.5  61.5  
+1847.5  98.5  
+1848.5 124.7  
+1849.5  96.3  
+1850.5  66.6  
+1851.5  64.5  
+1852.5  54.1  
+1853.5  39.0  
+1854.5  20.6  
+1855.5   6.7  
+1856.5   4.3  
+1857.5  22.7  
+1858.5  54.8  
+1859.5  93.8  
+1860.5  95.8  
+1861.5  77.2  
+1862.5  59.1  
+1863.5  44.0  
+1864.5  47.0  
+1865.5  30.5  
+1866.5  16.3  
+1867.5   7.3  
+1868.5  37.6  
+1869.5  74.0  
+1870.5 139.0  
+1871.5 111.2  
+1872.5 101.6  
+1873.5  66.2  
+1874.5  44.7  
+1875.5  17.0  
+1876.5  11.3  
+1877.5  12.4  
+1878.5   3.4  
+1879.5   6.0  
+1880.5  32.3  
+1881.5  54.3  
+1882.5  59.7  
+1883.5  63.7  
+1884.5  63.5  
+1885.5  52.2  
+1886.5  25.4  
+1887.5  13.1  
+1888.5   6.8  
+1889.5   6.3  
+1890.5   7.1  
+1891.5  35.6  
+1892.5  73.0  
+1893.5  85.1  
+1894.5  78.0  
+1895.5  64.0  
+1896.5  41.8  
+1897.5  26.2  
+1898.5  26.7  
+1899.5  12.1  
+1900.5   9.5  
+1901.5   2.7  
+1902.5   5.0  
+1903.5  24.4  
+1904.5  42.0  
+1905.5  63.5  
+1906.5  53.8  
+1907.5  62.0  
+1908.5  48.5  
+1909.5  43.9  
+1910.5  18.6  
+1911.5   5.7  
+1912.5   3.6  
+1913.5   1.4  
+1914.5   9.6  
+1915.5  47.4  
+1916.5  57.1  
+1917.5 103.9  
+1918.5  80.6  
+1919.5  63.6  
+1920.5  37.6  
+1921.5  26.1  
+1922.5  14.2  
+1923.5   5.8  
+1924.5  16.7  
+1925.5  44.3  
+1926.5  63.9  
+1927.5  69.0  
+1928.5  77.8  
+1929.5  64.9  
+1930.5  35.7  
+1931.5  21.2  
+1932.5  11.1  
+1933.5   5.7  
+1934.5   8.7  
+1935.5  36.1  
+1936.5  79.7  
+1937.5 114.4  
+1938.5 109.6  
+1939.5  88.8  
+1940.5  67.8  
+1941.5  47.5  
+1942.5  30.6  
+1943.5  16.3  
+1944.5   9.6  
+1945.5  33.2  
+1946.5  92.6  
+1947.5 151.6  
+1948.5 136.3  
+1949.5 134.7  
+1950.5  83.9  
+1951.5  69.4  
+1952.5  31.5  
+1953.5  13.9  
+1954.5   4.4  
+1955.5  38.0  
+1956.5 141.7  
+1957.5 190.2  
+1958.5 184.8  
+1959.5 159.0  
+1960.5 112.3  
+1961.5  53.9  
+1962.5  37.6  
+1963.5  27.9  
+1964.5  10.2  
+1965.5  15.1  
+1966.5  47.0  
+1967.5  93.7  
+1968.5 105.9  
+1969.5 105.5  
+1970.5 104.5  
+1971.5  66.6  
+1972.5  68.9  
+1973.5  38.0  
+1974.5  34.5  
+1975.5  15.5  
+1976.5  12.6  
+1977.5  27.5  
+1978.5  92.5  
+1979.5 155.4  
+1980.5 154.6  
+1981.5 140.5  
+1982.5 115.9  
+1983.5  66.6  
+1984.5  45.9  
+1985.5  17.9  
+1986.5  13.4  
+1987.5  29.2  
+1988.5 100.2  
+1989.5 157.6  
+1990.5 142.6  
+1991.5 145.7  
+1992.5  94.3  
+1993.5  54.6  
+1994.5  29.9  
+1995.5  17.5  
+1996.5   8.6  
+1997.5  21.5  
diff --git a/external_functions/godae_obs/Makefile b/external_functions/godae_obs/Makefile
new file mode 100644
index 0000000..5c12978
--- /dev/null
+++ b/external_functions/godae_obs/Makefile
@@ -0,0 +1,57 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+# dec-00 adapted for "godae_obs" function
+# ACM 2/2001
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+GOB_OBJS = ocn_obs.o
+
+#
+# Rules
+#
+
+.c.so:
+	$(CC) $(CFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(GOB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(GOB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	ocn_obs.o godae_obs.o godae_obs.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/godae_obs/godae_obs.F b/external_functions/godae_obs/godae_obs.F
new file mode 100644
index 0000000..a0c84a7
--- /dev/null
+++ b/external_functions/godae_obs/godae_obs.F
@@ -0,0 +1,224 @@
+*
+* godae_obs.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Dac, 2000
+
+* This function reads a GODAE (FNMOC) ship observations file (name passed
+* in) and returns the variables in a multi-dimensional array NoxNv where
+* No is the number of obs in the file and Nv is the number of variables
+* read (list of variables as per source code)
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE godae_obs_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Read an FNOC ship obs file - result in Nobs X 15 array' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id,  ABSTRACT, ABSTRACT, 
+     .                                  NORMAL,   NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name (id, arg, 'dtg FILENAME')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .                  'FNMOC "dtg" file in the form YYYYMMDDHH')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE godae_obs_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+      INTEGER OPEN_OCN_OBS
+      CHARACTER*80 errmsg
+
+      INCLUDE 'xgodae_obs.cmn'
+
+
+      CALL ef_get_arg_string(id, 1, gobs_filename)
+
+      IF (gobs_filename .EQ. " ") CALL ef_bail_out(id,
+     .          'No filename specified')
+
+      nobs = OPEN_OCN_OBS(gobs_filename,errmsg)
+      IF (nobs .LE. 0) CALL ef_bail_out(id, errmsg)
+
+* the same list of variables is read from every file
+      nvars = 15
+
+* indicate the number of variables to be returned on the X axis
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nobs)
+
+* indicate the number of observations to be returned on the Y axis
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, nvars)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE godae_obs_compute (id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*  names, units, characteristics of variables to send to Vis5D utility functions.
+
+        CHARACTER errmsg*80
+
+        INCLUDE 'xgodae_obs.cmn'
+
+C  Read data from the input file straight into Ferret
+      CALL READ_OCN_OBS(gobs_filename, result, nvars, nobs, errmsg)
+      IF ( errmsg.NE.' ' ) CALL ef_bail_out(id,
+     .          'No filename specified')
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
diff --git a/external_functions/godae_obs/ocn_obs.F b/external_functions/godae_obs/ocn_obs.F
new file mode 100644
index 0000000..891df97
--- /dev/null
+++ b/external_functions/godae_obs/ocn_obs.F
@@ -0,0 +1,1153 @@
+* support code for Ferret EF taken from "program ocn_obs"
+* *sh* 12/00
+
+* original documentation follows
+* for the Ferret EF application the code has been reduced to two subroutines
+*   INTEGER FUNCTION OPEN_OCN_OBS(filename,errmsg)
+*   SUBROUTINE READ_OCN_OBS(result, nvars, nobs, errmsg)
+
+*** START OF ORIGINAL DOCUMENTATION ***
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  ocn_obs
+c
+c DESCRIPTION:  simple driver for processing FNMOC ocean obs files
+c                  altim - TOPEX and ERS altimeter SSHA
+c                  mcsst - AVHRR SST retrievals
+c                profile - subsurface measures of in situ T and S
+c                   ship - in situ surface measures of T
+c                   ssmi - DMSP sea ice concentration retrievals
+c
+c               documentation of the variables for each ocean obs
+c               file is contained within the respective "rd" routines:
+c                  rd_altim, rd_mcssst, rd_prof, rd_ship, rd_ssmi
+c
+c               the first record in all of the FNMOC ocean obs files
+c               contains the number the observations in that file
+c               and the maximum number of observation levels (can be
+c               greater than 1 for the {dtg}.profile files).  as in
+c               this simple driver routine, these variables can be
+c               read and passed as automatic array dimensions to a
+c               subroutine.
+c
+c               the code assumes that the ocean obs data files are
+c               in a directory structure given by
+c                  $data_dir/altim
+c                           /mcsst
+c                           /profile
+c                           /ship
+c                           /ssmi
+c               where $data_dir is an environmental variable
+c               defined by "OCEAN_OBS_DIR" that describes the
+c               directory path to the top of ocean obs tree
+c
+c               all of the code required is concatentated in
+c               the ocn_obs.f file.  a compilation can be
+c               done using the following (for SGI)
+c                  f90 -r4 -i4 -o ocn_obs obs_obs.f
+c
+c               the GETARG and GETENV routines may be different
+c               on SUN SPARC workstations
+c
+c               to see what command line arguments are required,
+c               execute ocn_obs with no command line arguments
+c
+c               temperature units are deg C, salinity units are
+c               PSU, sea surface height units are meters, and
+c               sea ice concentration units are per cent.
+c
+c               unless otherwise specified, missing values are
+c               set to -999 in all of the ocean obs data files
+c
+c....................MAINTENANCE SECTION................................
+c
+c MODULES CALLED:
+c        Name                    Description
+c   --------------     -------------------------------------
+c   error_exit         standard error processing
+c   GETARG             retrieve command line argument
+c   GETENV             retrieve environmental variable
+c   rd_altim           read satellite altimeter SSHA observations
+c   rd_mcsst           read AVHRR satellite SST retrievals
+c   rd_prof            read profile temperatures and salinities
+c   rd_ship            read surface temperature observations
+c   rd_ssmi            read ssmi sea ice retrievals
+c
+c..............................END PROLOGUE.............................
+c
+
+*** END OF ORIGINAL DOCUMENTATION ***
+
+
+      SUBROUTINE READ_OCN_OBS(file_dtg, result, nvars, nobs, errmsg)
+
+      INTEGER nvars, nobs
+      REAL*4 result(nobs, nvars)
+      character file_dtg * 10
+      CHARACTER*(*) errmsg
+
+      integer    UNIT
+      parameter (UNIT = 60)
+
+      call rd_ship (UNIT, file_dtg, result, nvars, nobs)
+      close (UNIT)
+      errmsg = ' '
+      RETURN
+      END
+  
+*
+**********************
+*
+
+      INTEGER FUNCTION OPEN_OCN_OBS(file_dtg,err_msg)
+
+
+      implicit  none
+c
+c     ..set local data file fortran unit number
+c
+      integer    UNIT
+      parameter (UNIT = 60)
+c
+      character*(*) err_msg
+      character file_dtg * 10
+
+      character arg * 80
+      character data_dir * 256
+      logical   exist
+      character file_name * 256
+      integer   len
+      integer   n_arg
+      integer*4 n_lvl
+      integer*4 n_obs
+      character obs_typ * 5
+
+        INTEGER TM_LENSTR
+c
+c...............................executable..............................
+c
+
+c
+c     ..retrieve file root directory
+c
+        obs_typ = 'ship'
+
+c
+c     ..retrieve file root directory
+c
+      call GETENV ('OCN_OBS_DIR', data_dir)
+      len = TM_LENSTR (data_dir)
+      if (len .eq. 0) then
+         data_dir = '.'
+         len = TM_LENSTR (data_dir)
+      endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..profile observations
+c
+#if 0
+      if (obs_typ(1:4) .eq. 'prof') then
+         open (45, file='report.profile', status='unknown',
+     *             form='formatted')
+         write (45, '(''   ****** Reading PROFILE Data ******'')')
+         write (45, '(''   file date time group: '', a)') file_dtg
+         write (45, '(''    data directory path: '', a)')
+     *          data_dir(1:len)
+         file_name = data_dir(1:len) // '/profile/' //
+     *               file_dtg // '.profile'
+         len = TM_LENSTR (file_name)
+         inquire (file=file_name(1:len), exist=exist)
+         if (exist) then
+            open (UNIT, file=file_name(1:len), status='old',
+     *                  form='unformatted')
+            read (UNIT) n_obs, n_lvl
+            write (45, '(''        number profiles: '', i10)') n_obs
+            write (45, '(''      max number levels: '', i10)') n_lvl
+            if (n_obs .gt. 0) then
+               call rd_prof (UNIT, n_obs, n_lvl)
+            endif
+            close (UNIT)
+         else
+            write (err_msg, '(''file "'', a, ''" does not exist'')')
+     *             file_name(1:len)
+            call error_exit ('OCN_OBS', err_msg)
+         endif
+# endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..surface ship/buoy observations
+c
+!      else if (obs_typ(1:4) .eq. 'ship') then
+      if (obs_typ(1:4) .eq. 'ship') then
+         open (45, file='report.ship', status='unknown',
+     *             form='formatted')
+         write (45, '(''   ****** Reading SHIP Data ******'')')
+         write (45, '(''   file date time group: '', a)') file_dtg
+         write (45, '(''    data directory path: '', a)')
+     *          data_dir(1:len)
+         file_name = data_dir(1:len) // '/ship/' //
+     *               file_dtg // '.ship'
+         len = TM_LENSTR (file_name)
+         inquire (file=file_name(1:len), exist=exist)
+         if (exist) then
+            open (UNIT, file=file_name(1:len), status='old',
+     *                  form='unformatted')
+            read (UNIT) n_obs
+            write (45, '(''        number ship obs: '', i10)') n_obs
+
+c
+c   successfully opened the file
+c
+            err_msg = ' '
+            OPEN_OCN_OBS = n_obs
+            RETURN
+         else
+            err_msg = 'file "'//file_name(:len)//'" does not exist'
+            OPEN_OCN_OBS = 0
+         endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..mcsst observations
+c
+#if 0
+      else if (obs_typ(1:5) .eq. 'mcsst') then
+         open (45, file='report.mcsst', status='unknown',
+     *             form='formatted')
+         write (45, '(''   ****** Reading MCSST Data ******'')')
+         write (45, '(''   file date time group: '', a)') file_dtg
+         write (45, '(''    data directory path: '', a)')
+     *          data_dir(1:len)
+         file_name = data_dir(1:len) // '/mcsst/' //
+     *               file_dtg // '.mcsst'
+         len = TM_LENSTR (file_name)
+         inquire (file=file_name(1:len), exist=exist)
+         if (exist) then
+            open (UNIT, file=file_name(1:len), status='old',
+     *                  form='unformatted')
+            read (UNIT) n_obs
+            write (45, '(''       number mcsst obs: '', i10)') n_obs
+            if (n_obs .gt. 0) then
+               call rd_mcsst (UNIT, n_obs)
+            endif
+            close (UNIT)
+         else
+            write (err_msg, '(''file "'', a, ''" does not exist'')')
+     *             file_name(1:len)
+            call error_exit ('OCN_OBS', err_msg)
+         endif
+# endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..altimeter observations
+c
+#if 0
+      else if (obs_typ(1:5) .eq. 'altim') then
+         open (45, file='report.altim', status='unknown',
+     *             form='formatted')
+         write (45, '(''   ****** Reading ALTIM Data ******'')')
+         write (45, '(''   file date time group: '', a)') file_dtg
+         write (45, '(''    data directory path: '', a)')
+     *          data_dir(1:len)
+         file_name = data_dir(1:len) // '/altim/' //
+     *               file_dtg // '.altim'
+         len = TM_LENSTR (file_name)
+         inquire (file=file_name(1:len), exist=exist)
+         if (exist) then
+            open (UNIT, file=file_name(1:len), status='old',
+     *                  form='unformatted')
+            read (UNIT) n_obs
+            write (45, '(''       number altim obs: '', i10)') n_obs
+            if (n_obs .gt. 0) then
+               call rd_altim (UNIT, n_obs)
+            endif
+            close (UNIT)
+         else
+            write (err_msg, '(''file "'', a, ''" does not exist'')')
+     *             file_name(1:len)
+            call error_exit ('OCN_OBS', err_msg)
+         endif
+# endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..SSM/I sea ice observations
+c
+#if 0
+      else if (obs_typ(1:4) .eq. 'ssmi') then
+         open (45, file='report.ssmi', status='unknown',
+     *             form='formatted')
+         write (45, '(''   ****** Reading SSMI Data ******'')')
+         write (45, '(''   file date time group: '', a)') file_dtg
+         write (45, '(''    data directory path: '', a)')
+     *          data_dir(1:len)
+         file_name = data_dir(1:len) // '/ssmi/' //
+     *               file_dtg // '.ssmi'
+         len = TM_LENSTR (file_name)
+         inquire (file=file_name(1:len), exist=exist)
+         if (exist) then
+            open (UNIT, file=file_name(1:len), status='old',
+     *                  form='unformatted')
+            read (UNIT) n_obs
+            write (45, '(''        number ssmi obs: '', i10)') n_obs
+            if (n_obs .gt. 0) then
+               call rd_ssmi (UNIT, n_obs)
+            endif
+            close (UNIT)
+         else
+            write (err_msg, '(''file "'', a, ''" does not exist'')')
+     *             file_name(1:len)
+            call error_exit ('OCN_OBS', err_msg)
+         endif
+# endif
+c
+c-----------------------------------------------------------------------
+c
+c     ..unknown obs data type 
+c
+      else
+        err_msg = 'unknown obs TYPE'
+        OPEN_OCN_OBS = 0
+      endif
+c
+      stop
+      end
+
+
+      subroutine rd_altim (UNIT, n_obs)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  rd_altim
+c
+c DESCRIPTION:  reads the ALTIM ocean obs files and produces a report
+c
+c PARAMETERS:
+c      Name          Type        Usage            Description
+c   ----------     ---------     ------    ---------------------------
+c   n_obs           integer      input     number altim obs
+c   unit            integer      input     FORTRAN unit number
+c
+c ALTIMETER VARIABLES:
+c     ame       Type                     Description
+c   --------  --------    ----------------------------------------------
+c   ob_age     real       age of the observation in hours since
+c                         January 1, 1992.  provides a continuous
+c                         time variable
+c   ob_clim    real       SSHA climatological estimate at obs
+c                         location and sampling time
+c   ob_cycle   integer    satellite cycle number
+c   ob_dtg     character  SSHA obs date time group in the form
+c                         year, month, day, hour, minute,
+c                         second (YYYYMMDDHHMMSS)
+c   ob_glbl    real       SSHA global analysis estimate at obs
+c                         location and receipt time at FNMOC
+c   ob_lat     real       SSHA obs latitude (south negative)
+c   ob_lon     real       SSHA obs longitude (west negative)
+c   ob_qc      real       SSHA obs probability of a gross error
+c                         (assumes normal pdf of SSHA errors)
+c   ob_regn    real       SSHA regional analysis estimate at obs
+c                         location and receipt time at FNMOC
+c   ob_sat     integer    satellite ID (TOPEX, ERS, GFO) - see
+c                         ocn_types.h for codes
+c   ob_sgma    real       climatological variability of SSHA at
+c                         obs location and time of year
+c   ob_smpl    integer    sequential sample number along a
+c                         satellite track
+c   ob_ssh     real       SSHA observation (meters) in terms of
+c                         deviation from a long term TOPEX mean
+c   ob_track   integer    satellite track number for cycle
+c
+c..............................END PROLOGUE.............................
+c
+      implicit none
+c
+      include 'ocn_types.h'
+c
+c     ..local array dimensions
+c
+      integer*4 n_obs
+c
+      integer   i, k
+      real*4    ob_age (n_obs)
+      real*4    ob_clim (n_obs)
+      integer*4 ob_cycle (n_obs)
+      character ob_dtg (n_obs) * 14
+      real*4    ob_glbl (n_obs)
+      real*4    ob_lat (n_obs)
+      real*4    ob_lon (n_obs)
+      real*4    ob_qc (n_obs)
+      real*4    ob_regn (n_obs)
+      integer*4 ob_smpl (n_obs)
+      integer*4 ob_sat (n_obs)
+      real*4    ob_sgma (n_obs)
+      real*4    ob_ssh (n_obs)
+      integer*4 ob_track (n_obs)
+      integer   UNIT
+c
+c...............................executable..............................
+c
+c     ..read altimeter variables
+c
+      read (UNIT) (ob_age(i), i = 1, n_obs)
+      read (UNIT) (ob_clim(i), i = 1, n_obs)
+      read (UNIT) (ob_cycle(i), i = 1, n_obs)
+      read (UNIT) (ob_glbl(i), i = 1, n_obs)
+      read (UNIT) (ob_lat(i), i = 1, n_obs)
+      read (UNIT) (ob_lon(i), i = 1, n_obs)
+      read (UNIT) (ob_qc(i), i = 1, n_obs)
+      read (UNIT) (ob_regn(i), i = 1, n_obs)
+      read (UNIT) (ob_smpl(i), i = 1, n_obs)
+      read (UNIT) (ob_sat(i), i = 1, n_obs)
+      read (UNIT) (ob_sgma(i), i = 1, n_obs)
+      read (UNIT) (ob_ssh(i), i = 1, n_obs)
+      read (UNIT) (ob_track(i), i = 1, n_obs)
+      read (UNIT) (ob_dtg(i), i = 1, n_obs)
+c
+c     ..produce altimeter report
+c
+      k = 100
+      write (45, '(''  reporting skip factor: '', i10)') k
+      write (45, '(11x,''dtg'', 5x,''lat'', 5x,''lon'', 5x,''sat'',
+     *             5x,''ssh'', 4x,''clim'', 4x,''glbl'', 4x,''regn'',
+     *             6x,''qc'',  3x,''cycle'', 4x,''trak'', 4x,''smpl'',
+     *             4x,''sgma'')')
+      do i = 1, n_obs, k
+         write (45, '(a,2f8.2,i8,f8.4,3f8.3,f8.4,3i8,f8.4,2x,a)')
+     *          ob_dtg(i), ob_lat(i), ob_lon(i), ob_sat(i),
+     *          ob_ssh(i), ob_clim(i), ob_glbl(i), ob_regn(i),
+     *          ob_qc(i), ob_cycle(i), ob_track(i), ob_smpl(i),
+     *          ob_sgma(i), data_lbl(ob_sat(i))
+      enddo
+c
+      return
+      end
+
+
+      subroutine rd_mcsst (UNIT, n_obs)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  rd_mcsst
+c
+c DESCRIPTION:  reads the MCSST ocean obs files and produces a report
+c
+c PARAMETERS:
+c      Name          Type        Usage            Description
+c   ----------     ---------     ------    ---------------------------
+c   n_obs           integer      input     number mcsst obs
+c   unit            integer      input     FORTRAN unit number
+c
+c MCSST VARIABLES:
+c      Name      Type                      Description
+c   ----------  -------     --------------------------------------------
+c   ob_age      real        age of the observation in hours since
+c                           January 1, 1992.  provides a continuous
+c                           time variable
+c   ob_aod      real        NESDIS aeorosol optical depth at SST 
+c                           obs and sampling time (to within +/- 
+c                           24 hrs).  missing AODs are set to -1.
+c   ob_clim     real        NCEP SST climatological estimate at obs
+c                           location and sampling time
+c   ob_csgm     real        NCEP SST climatology variability estimate 
+c                           at obs location and receipt time at FNMOC
+c                           (not implemented yet)
+c   ob_dtg      character   SST obs date time group in the form year,
+c                           month, day, hour, minute (YYYYMMDDHHMM)
+c   ob_glbl     real        SST global analysis estimate at obs
+c                           location and receipt time at FNMOC
+c   ob_gsgm     real        global SST analysis variability estimate at
+c                           obs location and receipt time at FNMOC
+c                           (not implemented yet)
+c   ob_lat      real        SST obs latitude (south negative)
+c   ob_lon      real        SST obs longitude (west negative)
+c   ob_qc       real        SST obs probability of a gross error
+c                           (assumes normal pdf of SST errors)
+c   ob_regn                 SST regional analysis estimate at obs
+c                           location and receipt time at FNMOC
+c   ob_rsgm     real        regional SST analysis variability estimate
+c                           at obs location and receipt time at
+c                           FNMOC (not implemented yet)
+c   ob_sst      real        SST observation
+c   ob_type     integer     SST obseration data type; NOAA14 or NOAA15
+c                           day, night, relaxed day retrievals (see 
+c                           ocn_types.h for codes)
+c   ob_wm       integer     SST water mass indicator from Bayesian
+c                           classification scheme.  only valid in
+c                           western North Pacific, western North
+c                           Atlantic or GIN-Seas regions.  used to
+c                           prevent averaging of SST observations
+c                           from different water mass during the
+c                           computation of SST super-obs; helps
+c                           maintain SST fronts and eddies in the
+c                           analysis of western boundary currents
+c
+c..............................END PROLOGUE.............................
+c
+      implicit none
+c
+      include 'ocn_types.h'
+c
+c     ..local array dimensions
+c
+      integer*4 n_obs
+c
+      integer   i, k
+      real*4    ob_age (n_obs)
+      real*4    ob_aod (n_obs)
+      real*4    ob_clim (n_obs)
+      real*4    ob_csgm (n_obs)
+      character ob_dtg (n_obs) * 12
+      real*4    ob_glbl (n_obs)
+      real*4    ob_gsgm (n_obs)
+      real*4    ob_lat (n_obs)
+      real*4    ob_lon (n_obs)
+      real*4    ob_qc (n_obs)
+      real*4    ob_regn (n_obs)
+      real*4    ob_rsgm (n_obs)
+      real*4    ob_sst (n_obs)
+      integer*4 ob_type (n_obs)
+      integer*4 ob_wm (n_obs)
+      integer   UNIT
+c
+c...............................executable..............................
+c
+c     ..read mcsst variables
+c
+      read (UNIT) (ob_wm(i), i = 1, n_obs)
+      read (UNIT) (ob_glbl(i), i = 1, n_obs)
+      read (UNIT) (ob_lat(i), i = 1, n_obs)
+      read (UNIT) (ob_lon(i), i = 1, n_obs)
+      read (UNIT) (ob_age(i), i = 1, n_obs)
+      read (UNIT) (ob_clim(i), i = 1, n_obs)
+      read (UNIT) (ob_qc(i), i = 1, n_obs)
+      read (UNIT) (ob_type(i), i = 1, n_obs)
+      read (UNIT) (ob_regn(i), i = 1, n_obs)
+      read (UNIT) (ob_sst(i), i = 1, n_obs)
+      read (UNIT) (ob_aod(i), i = 1, n_obs)
+      read (UNIT) (ob_dtg(i), i = 1, n_obs)
+c     read (UNIT) (ob_csgm(i), i = 1, n_obs)
+c     read (UNIT) (ob_gsgm(i), i = 1, n_obs)
+c     read (UNIT) (ob_rsgm(i), i = 1, n_obs)
+      do i = 1, n_obs
+         ob_csgm(i) = -999.
+         ob_gsgm(i) = -999.
+         ob_rsgm(i) = -999.
+      enddo
+c
+c     ..produce mcsst report
+c
+      k = 100
+      write (45, '(''  reporting skip factor: '', i10)') k
+      write (45, '(9x,''dtg'', 5x,''lat'', 5x,''lon'', 4x,''type'',
+     *             5x,''sst'', 4x,''clim'', 4x,''glbl'', 4x,''regn'',
+     *             6x,''qc'',  5x,''aod'', 4x,''csgm'', 4x,''gsgm'',
+     *             4x,''rsgm'', 2x,''wm'')')
+      do i = 1, n_obs, k
+         write (45, '(a,2f8.2,i8,4f8.2,2f8.4,3f8.2,i4,2x,a)')
+     *          ob_dtg(i), ob_lat(i), ob_lon(i), ob_type(i),
+     *          ob_sst(i), ob_clim(i), ob_glbl(i), ob_regn(i),
+     *          ob_qc(i), ob_aod(i), ob_csgm(i), ob_gsgm(i),
+     *          ob_rsgm(i), ob_wm(i), data_lbl(ob_type(i))
+      enddo
+c
+      return
+      end
+
+
+      subroutine rd_prof (UNIT, n_obs, n_lvl)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  rd_prof
+c
+c DESCRIPTION:  reads the PROFILE ocean obs files and produces a report
+c
+c PARAMETERS:
+c      Name          Type        Usage            Description
+c   ----------     ---------     ------    ---------------------------
+c   n_obs           integer      input     number profile obs 
+c   n_lvl           integer      input     number profile levels
+c   unit            integer      input     FORTRAN unit number
+c
+c PROFILE VARIABLES:
+c     ame       Type                     Description
+c   --------  --------    ----------------------------------------------
+c   ob_btm     real       bottom depth in meters from DBDB5 data base
+c                         at profile lat,lon
+c   ob_clim    real       MODAS temperature climatology estimate at
+c                         profile location, levels and sampling time
+c   ob_dtg     character  profile observation sampling date time group
+c                         in the form  year, month, day, hour, minute,
+c                         second (YYYYMMDDHHMMSS)
+c   ob_glbl    real       global analysis estimate of profile
+c                         temperatures at profile obs location,
+c                         levels, and sampling time
+c   ob_lat     real       profile observation latitude (south negative)
+c   ob_lon     real       profile observation longitude (west negative)
+c   ob_ls      integer    number of observed profile salinity levels
+c                         (a zero indicates temperature-only profile)
+c   ob_lt      integer    number of observed profile temperature levels
+c   ob_lvl     real       observed (and extended) profile levels
+c   ob_modas   real       modas synthetic profile estimate at profile
+c                         location, levels, and sampling time.  the
+c                         predictor variables used in the generation
+c                         of the modas synthetic profile are the
+c                         ob_sst (SST) and ob_ssh (SSHA) variables.
+c   ob_nd      integer    total number of levels for profile observation
+c                         includes observed levels (ob_lt) plus levels
+c                         to vertically extend the profile to the bottom
+c   ob_rcpt    character  profile observation receipt time at FNMOC in
+c                         the form year, month, day, hour, minute
+c                         (YYYYMMDDHHMM); the difference between
+c                         ob_rcpt and ob_dtg gives the timeliness 
+c                         of the observation at FNMOC
+c   ob_regn    real       regional analysis estimate of profile
+c                         temperatures at profile obs location,
+c                         levels, and sampling time
+c   ob_sal     real       observed (and extended) profile salinities,
+c                         if salinity has not been observed it has been
+c                         estimated from climatological T/S regressions
+c   ob_scr     character  profile obs security classification code; "U"
+c                         for unclassified
+c   ob_sign    character  profile observation call sign
+c   ob_sprb    real       salinity profile level-by-level probability
+c                         of a gross error
+c   ob_sqc     real       salinity profile overall probability of gross
+c                         error (integrates level-by-level errors taking
+c                         into account layer thcknesses)
+c   ob_ssh     real       SSHA of profile dynamic height from long-term
+c                         hydrographic mean.  dynamic height has been
+c                         calculated relative to 2000 m or the bottom
+c                         whichever is shallower.  profile SSHA is
+c                         directly comparable to satellite altimeter
+c                         SSHA.  vertically extended levels may have
+c                         been used in the dynamic height computation,
+c                         so the profile SSHA values must be used with
+c                         care for shallow observed profiles (ob_lt)
+c   ob_sst     real       SST estimate (in order of high resoloution
+c                         regional analysis if available, global
+c                         analysis if available, profile SST if
+c                         observed shallow enough or SST climatology
+c                         (MODAS or GDEM)) valid at profile observation
+c                         location and sampling time
+c   ob_sstd    real       climatolgical estimates of variability of
+c                         salinity at profile location, levels and
+c                         sampling time (one standard deviation)
+c   ob_tmp     real       observed (and extended) profile temperatures
+c   ob_tqc     real       temperature profile overall probability of
+c                         gross error (integrates level-by-level errors
+c                         taking into account layer thcknesses)
+c   ob_tprb    real       temperature profile level-by-level probability
+c                         of a gross error
+c   ob_tstd    real       climatolgical estimates of variability of
+c                         temperature at profile location, levels and
+c                         sampling time (one standard deviation)
+c   ob_typ     integer    profile data type (see ocean_types.h for
+c                         codes)
+c 
+c..............................END PROLOGUE.............................
+c
+      implicit none         
+c
+      include 'ocn_types.h'
+c
+c     ..local array dimensions
+c
+      integer*4 n_obs
+      integer*4 n_lvl
+c
+      integer   i, j
+      real*4    ob_btm (n_obs)
+      real*4    ob_clim (n_lvl, n_obs)
+      character ob_dtg (n_obs) * 12
+      real*4    ob_glbl (n_lvl, n_obs)
+      real*4    ob_lat (n_obs)
+      real*4    ob_lon (n_obs)
+      real*4    ob_lvl (n_lvl, n_obs)
+      integer*4 ob_ls (n_obs)
+      integer*4 ob_lt (n_obs)
+      real*4    ob_modas (n_lvl, n_obs)
+      integer*4 ob_nd (n_obs)
+      real*4    ob_sprb (n_lvl, n_obs)
+      real*4    ob_sqc (n_obs)
+      real*4    ob_tprb (n_lvl, n_obs)
+      real*4    ob_tqc (n_obs)
+      character ob_rcpt (n_obs) * 12
+      real*4    ob_regn (n_lvl, n_obs)
+      character ob_scr (n_obs) * 1
+      character ob_sign (n_obs) * 7
+      real*4    ob_sal (n_lvl, n_obs)
+      real*4    ob_ssh (n_obs)
+      real*4    ob_sst (n_obs)
+      real*4    ob_sstd (n_lvl, n_obs)
+      real*4    ob_tmp (n_lvl, n_obs)
+      real*4    ob_tstd (n_lvl, n_obs)
+      integer*4 ob_typ (n_obs)
+      integer   UNIT
+c
+c...............................executable..............................
+c
+c     ..read profile variables
+c
+      read (UNIT) (ob_lt(i),  i = 1, n_obs)
+      read (UNIT) (ob_ssh(i), i = 1, n_obs)
+      read (UNIT) (ob_btm(i), i = 1, n_obs)
+      read (UNIT) (ob_lat(i), i = 1, n_obs)
+      read (UNIT) (ob_lon(i), i = 1, n_obs)
+      read (UNIT) (ob_nd(i),  i = 1, n_obs)
+      read (UNIT) (ob_sqc(i), i = 1, n_obs)
+      read (UNIT) (ob_tqc(i), i = 1, n_obs)
+      read (UNIT) (ob_typ(i), i = 1, n_obs)
+      do i = 1, n_obs
+         read (UNIT) (ob_lvl(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_modas(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_clim(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_glbl(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_regn(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_sprb(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_tprb(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_sal(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_tmp(j,i), j = 1, ob_nd(i))
+      enddo
+      read (UNIT) (ob_dtg(i), i = 1, n_obs)
+      read (UNIT) (ob_rcpt(i), i = 1, n_obs)
+      read (UNIT) (ob_scr(i), i = 1, n_obs)
+      read (UNIT) (ob_sign(i), i = 1, n_obs)
+      read (UNIT) (ob_ls(i), i = 1, n_obs)
+      read (UNIT) (ob_sst(i), i = 1, n_obs)
+      do i = 1, n_obs
+         read (UNIT) (ob_sstd(j,i), j = 1, ob_nd(i))
+         read (UNIT) (ob_tstd(j,i), j = 1, ob_nd(i))
+      enddo
+c
+c     ..produce profile report
+c
+      do i = 1, n_obs
+         write (45, '(110(''-''))')
+         write (45, '(''profile call sign           : "'', a, ''"'')')
+     *          ob_sign(i)
+         write (45, '(''profile latitude            : '', f12.2)')
+     *          ob_lat(i)
+         write (45, '(''profile longitude           : '', f12.2)')
+     *          ob_lon(i)
+         write (45, '(''profile observed DTG        : "'', a, ''"'')')
+     *          ob_dtg(i)
+         write (45, '(''profile received DTG        : "'', a, ''"'')')
+     *          ob_rcpt(i)
+         write (45, '(''DBDB5 bottom depth          : '', f12.1)')
+     *          ob_btm(i)
+         write (45, '(''profile data type code      : '', i12)')
+     *          ob_typ(i)
+         write (45, '(''profile data type           : "'', a, ''"'')')
+     *          data_lbl(ob_typ(i))
+         write (45, '(''total number levels         : '', i12)')
+     *          ob_nd(i)
+         write (45, '(''observed temperature levels : '', i12)')
+     *          ob_lt(i)
+         write (45, '(''observed salinity levels    : '', i12)')
+     *          ob_ls(i)
+         write (45, '(''temperature gross error     : '', f12.4)')
+     *          ob_tqc(i)
+         write (45, '(''salinity gross error        : '', f12.4)')
+     *          ob_sqc(i)
+         write (45, '(''sea surface height anomaly  : '', f12.4)')
+     *          ob_ssh(i)
+         write (45, '(''sea surface temperature     : '', f12.2)')
+     *          ob_sst(i)
+         write (45, '(''security classification     : '', 9x,
+     *          ''"'', a, ''"'')') ob_scr(i)
+         write (45, '(5x,''depth'', 6x,''temp'', 6x,''salt'',
+     *               3x,''tmp_std'', 3x,''sal_std'',
+     *               2x,''tmp_prob'', 2x,''sal_prob'',
+     *               6x,''clim'', 5x,''modas'',
+     *               6x,''glbl'', 6x,''regn'')')
+         do j = 1, ob_nd(i)
+            write (45, '(f10.1, 4f10.2, 2f10.4, 4f10.2)')
+     *             ob_lvl(j,i), ob_tmp(j,i), ob_sal(j,i),
+     *             ob_tstd(j,i), ob_sstd(j,i), ob_tprb(j,i),
+     *             ob_sprb(j,i), ob_clim(j,i), ob_modas(j,i),
+     *             ob_glbl(j,i), ob_regn(j,i)
+            if (ob_nd(i) .gt. ob_lt(i)) then
+               if (j .eq. ob_lt(i)) then
+                  write (45, '(10x, 100(''-''))') 
+               endif
+            endif
+         enddo
+      enddo
+c
+      return
+      end
+
+
+      subroutine rd_ship (UNIT, file_dtg, result, nvars, n_obs)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  rd_ship
+c
+c DESCRIPTION:  reads the SHIP ocean obs files and produces a report
+c
+c PARAMETERS:
+c      Name          Type        Usage            Description
+c   ----------     ---------     ------    ---------------------------
+c   n_obs           integer      input     number ship obs
+c   unit            integer      input     FORTRAN unit number
+c
+c MCSST VARIABLES:
+c      Name      Type                     Description
+c   ----------  -------     -------------------------------------------
+c   ob_age      real        age of the observation in hours since
+c                           January 1, 1992.  provides a continuous
+c                           time variable
+c   ob_clim     real        NCEP SST climatological estimate at obs
+c                           location and sampling time
+c   ob_csgm     real        NCEP SST climatology variability estimate
+c                           at obs location and receipt time at FNMOC
+c                           (not implemented yet)
+c   ob_dtg      character   SST obs date time group in the form year,
+c                           month, day, hour, minute (YYYYMMDDHHMM)
+c   ob_glbl     real        SST global analysis estimate at obs
+c                           location and receipt time at FNMOC
+c   ob_gsgm     real        global SST analysis variability estimate
+c                           at obs location and receipt time at FNMOC
+c                           (not implemented yet)
+c   ob_lat      real        SST obs latitude (south negative)
+c   ob_lon      real        SST obs longitude (west negative)
+c   ob_qc       real        SST obs probability of a gross error
+c                           (assumes normal pdf of SST errors)
+c   ob_rcpt     character   SST observation receipt time at FNMOC in
+c                           the form year, month, day, hour, minute
+c                           (YYYYMMDDHHMM); the difference between
+c                           ob_rcpt and ob_dtg gives the timeliness 
+c                           of the observation and the validity of
+c                           ob_glbl and ob_regn background estimates 
+c   ob_regn                 SST regional analysis estimate at obs
+c                           location and receipt time at FNMOC
+c   ob_rsgm     real        regional SST analysis variability estimate
+c                           at obs location and receipt time at FNMOC
+c                           (not implemented yet)
+c   ob_scr      character   SST obs security classification code; "U"
+c                           for unclassified
+c   ob_sign     character   SST observation call sign
+c   ob_sst      real        SST observation
+c   ob_type     integer     SST obseration data type; ship (ERI, bucket,
+c                           hull contact), buoy (fixed, drifting), CMAN
+c                           (see ocn_types.h for codes)
+c   ob_wm       integer     SST water mass indicator from Bayesian
+c                           classification scheme.  only valid in
+c                           western North Pacific, western North
+c                           Atlantic or GIN-Seas regions.  used to
+c                           prevent averaging of SST observations
+c                           from different water mass during the
+c                           computation of SST super-obs; helps
+c                           maintain SST fronts and eddies in the
+c                           analysis of western boundary currents
+c
+c..............................END PROLOGUE.............................
+c
+      implicit none
+c
+      include 'ocn_types.h'
+c
+c     ..local array dimensions
+c
+      integer*4 n_obs
+      integer*4 nvars
+      character file_dtg * 10
+      REAL*4 result(n_obs, nvars)
+c
+      integer   i
+      real*4    ob_age (n_obs)
+      real*4    ob_clim (n_obs)
+      real*4    ob_csgm (n_obs)
+      character ob_dtg (n_obs) * 12
+      real*4    ob_glbl (n_obs)
+      real*4    ob_gsgm (n_obs)
+      real*4    ob_lat (n_obs)
+      real*4    ob_lon (n_obs)
+      real*4    ob_qc (n_obs)
+      character ob_rcpt (n_obs) * 12
+      real*4    ob_regn (n_obs)
+      real*4    ob_rsgm (n_obs)
+      character ob_scr (n_obs) * 1
+      character ob_sign (n_obs) * 6
+      real*4    ob_sst (n_obs)
+      integer*4 ob_type (n_obs)
+      integer*4 ob_wm (n_obs)
+      integer   UNIT
+
+      integer iyr ,imo ,idy ,ihr ,imn,
+     .        iyr0,imo0,idy0,ihr0,imn0
+      REAL*8          TM_SECS_FROM_BC
+
+      integer
+     .  POB_WM,
+     .  POB_GLBL,
+     .  POB_LAT,
+     .  POB_LON,
+     .  POB_AGE,
+     .  POB_CLIM,
+     .  POB_QC,
+     .  POB_REGN,
+     .  POB_SST,
+     .  POB_TYPE,
+     .  POB_DTG,
+     .  POB_RCPT,
+     .  POB_SCR,
+     .  POB_SIGN
+
+      PARAMETER (
+     .  POB_WM = 2,
+     .  POB_GLBL = 3,
+     .  POB_LAT = 4,
+     .  POB_LON = 5,
+     .  POB_AGE = 6,
+     .  POB_CLIM = 7,
+     .  POB_QC = 8,
+     .  POB_REGN = 9,
+     .  POB_SST = 10,
+     .  POB_TYPE = 11,
+     .  POB_DTG = 12,
+     .  POB_RCPT = 13,
+     .  POB_SCR = 14,
+     .  POB_SIGN = 15 )
+
+c
+c...............................executable..............................
+c
+c     ..read ship variables
+c
+      read (UNIT) (ob_wm(i), i = 1, n_obs)
+      read (UNIT) (ob_glbl(i), i = 1, n_obs)
+      read (UNIT) (ob_lat(i), i = 1, n_obs)
+      read (UNIT) (ob_lon(i), i = 1, n_obs)
+      read (UNIT) (ob_age(i), i = 1, n_obs)
+      read (UNIT) (ob_clim(i), i = 1, n_obs)
+      read (UNIT) (ob_qc(i), i = 1, n_obs)
+      read (UNIT) (ob_regn(i), i = 1, n_obs)
+      read (UNIT) (ob_sst(i), i = 1, n_obs)
+      read (UNIT) (ob_type(i), i = 1, n_obs)
+      read (UNIT) (ob_dtg(i), i = 1, n_obs)
+      read (UNIT) (ob_rcpt(i), i = 1, n_obs)
+      read (UNIT) (ob_scr(i), i = 1, n_obs)
+      read (UNIT) (ob_sign(i), i = 1, n_obs)
+c     read (UNIT) (ob_csgm(i), i = 1, n_obs)
+c     read (UNIT) (ob_gsgm(i), i = 1, n_obs)
+c     read (UNIT) (ob_rsgm(i), i = 1, n_obs)
+      do i = 1, n_obs
+         ob_csgm(i) = -999.
+         ob_gsgm(i) = -999.
+         ob_rsgm(i) = -999.
+      enddo
+
+* RETURN THE RESULTS TO FERRET
+      do  i = 1, n_obs
+        result(i,1) = -999.
+        result(i,POB_WM)   = ob_wm(i)
+        result(i,POB_GLBL) = ob_glbl(i)
+        result(i,POB_LAT)  = ob_lat(i)
+        result(i,POB_LON)  = ob_lon(i)
+        result(i,POB_AGE)  = ob_age(i)
+        result(i,POB_CLIM) = ob_clim(i)
+        result(i,POB_QC)   = ob_qc(i)
+        result(i,POB_REGN) = ob_regn(i)
+        result(i,POB_SST)  = ob_sst(i)
+        result(i,POB_TYPE) = ob_type(i)
+* compute lag from observation to receipt of observation
+        READ ( ob_rcpt(i),'(I4,4I2)') iyr ,imo ,idy ,ihr ,imn
+        READ ( ob_dtg (i),'(I4,4I2)') iyr0,imo0,idy0,ihr0,imn0
+        result(i,POB_DTG)  =
+     .          (TM_SECS_FROM_BC(iyr,imo,idy,ihr,imn,0)
+     .        -  TM_SECS_FROM_BC(iyr0,imo0,idy0,ihr0,imn0,0)) / 3600.
+
+        result(i,POB_RCPT) = -999.   ! not needed
+        result(i,POB_SCR)  = -999.   ! ob_scr(i)
+        result(i,POB_SIGN) = -999.   ! ob_sign(i) -- useful?
+      enddo
+
+* return the number of obs in result(1,1)
+      result(1,1) = n_obs
+
+* return the numerical-encoded filename in result(2,1)
+      READ (file_dtg,'(I4,4I2)') iyr,imo,idy,ihr,imn
+      result(2,1) = (TM_SECS_FROM_BC(iyr,imo,idy,ihr,imn,0)
+     .            -  TM_SECS_FROM_BC(1992,1,1,0,0,0)) / 3600.
+
+c
+c     ..produce ship report
+c
+#ifdef DEBUG
+      write (45, '(9x,''dtg'', 3x,''sign '', 5x,''lat'', 5x,''lon'',
+     *             4x,''type'', 5x,''sst'', 4x,''clim'', 4x,''glbl'',
+     *             4x,''regn'', 6x,''qc'', 4x,''csgm'', 4x,''gsgm'',
+     *             4x,''rsgm'', 2x,''wm'', 2x,''sc'')')
+      do i = 1, n_obs
+         write (45, '(a,2x,a,2f8.2,i8,4f8.2,f8.4,3f8.2,i4,3x,a,2x,a)')
+     *          ob_dtg(i), ob_sign(i), ob_lat(i), ob_lon(i),
+     *          ob_type(i), ob_sst(i), ob_clim(i), ob_glbl(i),
+     *          ob_regn(i), ob_qc(i), ob_csgm(i), ob_gsgm(i),
+     *          ob_rsgm(i), ob_wm(i), ob_scr(i), data_lbl(ob_type(i))
+      enddo
+#endif
+c
+      return
+      end
+
+
+      subroutine rd_ssmi (UNIT, n_obs)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  rd_ssmi
+c
+c DESCRIPTION:  reads the SSMI sea ice ocean obs files and produces a
+c               report whether you want one or not
+c
+c PARAMETERS:
+c      Name          Type        Usage            Description
+c   ----------     ---------     ------    ---------------------------
+c   n_obs           integer      input     number ssmi obs
+c   unit            integer      input     FORTRAN unit number
+c
+c SSMI VARIABLES:
+c     ame       Type                     Description
+c   --------  --------    ----------------------------------------------
+c   ob_age     real       age of the observation in hours since
+c                         January 1, 1992.  provides a continuous
+c                         time variable
+c   ob_clim    real       ECMWF sea ice climatological estimate at
+c                         SSM/I sea ice location and sampling time
+c   ob_dtg     character  SSM/I sea ice retrieval date time group in
+c                         the form  year, month, day, hour, minute,
+c                         second (YYYYMMDDHHMMSS)
+c   ob_glbl    real       SSM/I sea ice global analysis estimate at
+c                         obs location and receipt time at FNMOC
+c   ob_ice     real       SSM/I sea ice concentration (per cent) 
+c   ob_lat     real       SSM/I sea ice latitude (south negative)
+c   ob_lon     real       SSM/I sea ice longitude (west negative)
+c   ob_mean    real       SSM/I 30 day mean sea ice concentration at
+c                         obs location and samping time
+c   ob_qc      real       SSM/I sea ice probability of a gross error
+c                         (assumes normal pdf of sea ice retrieval
+c                         errors)
+c   ob_regn    real       SSM/I sea ice regional analysis estimate at
+c                         obs location and receipt time at FNMOC
+c   ob_sat     integer    satellite ID (DMSP F11, F13, F14, F15);
+c                         see ocn_types.h for codes
+c
+c..............................END PROLOGUE.............................
+c
+      implicit none
+c
+      include 'ocn_types.h'
+c
+c     ..local array dimensions
+c
+      integer*4 n_obs
+c
+      integer   i, k
+      real*4    ob_age (n_obs)
+      real*4    ob_clim (n_obs)
+      character ob_dtg (n_obs) * 12
+      real*4    ob_glbl (n_obs)
+      real*4    ob_ice (n_obs)
+      real*4    ob_lat (n_obs)
+      real*4    ob_lon (n_obs)
+      real*4    ob_qc (n_obs)
+      real*4    ob_regn (n_obs)
+      integer*4 ob_sat (n_obs)
+      real*4    ob_mean (n_obs)
+      integer   UNIT
+c
+c...............................executable..............................
+c
+c     ..read ssmi variables
+c
+      read (UNIT) (ob_glbl(i), i = 1, n_obs)
+      read (UNIT) (ob_ice(i), i = 1, n_obs)
+      read (UNIT) (ob_lat(i), i = 1, n_obs)
+      read (UNIT) (ob_lon(i), i = 1, n_obs)
+      read (UNIT) (ob_qc(i), i = 1, n_obs)
+      read (UNIT) (ob_age(i), i = 1, n_obs)
+      read (UNIT) (ob_regn(i), i = 1, n_obs)
+      read (UNIT) (ob_sat(i), i = 1, n_obs)
+      read (UNIT) (ob_clim(i), i = 1, n_obs)
+      read (UNIT) (ob_mean(i), i = 1, n_obs)
+      read (UNIT) (ob_dtg(i), i = 1, n_obs)
+c
+c     ..produce ssmi report
+c
+      k = 1000
+      write (45, '(''  reporting skip factor: '', i10)') k
+      write (45, '(9x,''dtg'', 5x,''lat'', 5x,''lon'', 5x,''sat'',
+     *             5x,''ice'', 4x,''clim'', 4x,''glbl'', 4x,''regn'',
+     *             4x,''mean'', 6x,''qc'')')
+      do i = 1, n_obs, k
+         write (45, '(a,2f8.2,i8,5f8.2,f8.4,2x,a)')
+     *          ob_dtg(i), ob_lat(i), ob_lon(i), ob_sat(i),
+     *          ob_ice(i), ob_clim(i), ob_glbl(i), ob_regn(i),
+     *          ob_mean(i), ob_qc(i), data_lbl(ob_sat(i))
+      enddo
+c
+      return
+      end
+
+
+      subroutine error_exit (routine, message)
+c
+c.............................START PROLOGUE............................
+c
+c SCCS IDENTIFICATION:  %W% %G%
+c
+c MODULE NAME:  error_exit
+c
+c DESCRIPTION:  prints a fatal error message and terminates the program.
+c
+c PARAMETERS:
+c    Name          Type       Usage            Description
+c   -------     ----------    ------    ---------------------------
+c   routine     char * (*)    input     name of routine
+c   message     char * (*)    input     user supplied error message
+c
+c..............................END PROLOGUE.............................
+c
+      implicit  none
+c
+      integer   ln
+      character message * (*)
+      character routine * (*)
+
+        INTEGER TM_LENSTR1
+
+c
+c..............................executable...............................
+c
+c     ..determine message string length
+c
+      ln = TM_LENSTR1 (message)
+c
+      write (*, '(//, ''*** FATAL ERROR ('', a, '') ***'')') routine
+      write (*, '(/, a)') message(1:ln)
+      write (*, '(/, ''*** PROGRAM TERMINATED ***'', /)')
+c
+c     ..exit with non zero completion code
+c
+      stop 15
+      end
diff --git a/external_functions/godae_obs/ocn_types.h b/external_functions/godae_obs/ocn_types.h
new file mode 100644
index 0000000..5c4b76e
--- /dev/null
+++ b/external_functions/godae_obs/ocn_types.h
@@ -0,0 +1,104 @@
+c
+c  CODA Types
+c
+c  %W% %G%
+c
+c     ..CODA observation data types
+c
+c     Name                   Description
+c   ---------         ---------------------------
+c   MAX_TYPES         maximum number data types
+c   data_lbl          data type labels
+c
+      integer    MAX_TYPES
+      parameter (MAX_TYPES = 41)
+c
+      character data_lbl (0:MAX_TYPES) * 17
+c
+c   0 = All Data Combined
+      data      data_lbl(0)  / 'All Data Combined' /
+c   1 = Bathy Temperatures (C)
+      data      data_lbl(1)  / '    eXpendable BT' /
+c   2 = NOAA14 Day MCSSTs (C)
+      data      data_lbl(2)  / '    N14 Day MCSST' /
+c   3 = SHIP Engine Room Intake (C)
+      data      data_lbl(3)  / '         ERI SHIP' /
+c   4 = Fixed BUOY (C)
+      data      data_lbl(4)  / '       Fixed BUOY' /
+c   5 = Drifting BUOY (C)
+      data      data_lbl(5)  / '    Drifting BUOY' /
+c   6 = NOAA14 Night MCSSTs (C)
+      data      data_lbl(6)  / '  N14 Night MCSST' /
+c   7 = NOAA14 Relaxed Day MCSSTs (C)
+      data      data_lbl(7)  / 'N14 Rlx Day MCSST' /
+c   8 = SSM/I F11 Ice (%)
+      data      data_lbl(8)  / '    SSM/I F11 Ice' /
+c   9 = SSM/I F13 Ice (%)
+      data      data_lbl(9)  / '    SSM/I F13 Ice' /
+c  10 = SSM/I F14 Ice (%)
+      data      data_lbl(10) / '    SSM/I F14 Ice' /
+c  11 = Supplemental Ice (%)
+      data      data_lbl(11) / 'ECMWF Ice CLIMATE' /
+c  12 = Topex (M)
+      data      data_lbl(12) / '        Topex SSH' /
+c  13 = ERS2 (M)
+      data      data_lbl(13) / '         ERS2 SSH' /
+c  14 = GFO (M)
+      data      data_lbl(14) / '          GFO SSH' /
+c  15 = MODAS Temperature (C)
+      data      data_lbl(15) / 'MODAS Temperature' /
+c  16 = NCEP SST or GDEM 3D Climatology (C)
+      data      data_lbl(16) / ' NCEP SST CLIMATE' /
+c  17 = GOES9 Day SSTs (C)
+      data      data_lbl(17) / '    GOES9 Day SST' /
+c  18 = GOES9 Night SSTs (C)
+      data      data_lbl(18) / '  GOES9 Night SST' /
+c  19 = GOES9 Relaxed Day SSTs (C)
+      data      data_lbl(19) / 'GOES9 Rlx Day SST' /
+c  20 = TESAC Temperature (C)
+      data      data_lbl(20) / 'TESAC Temperature' /
+c  21 = SHIP Bucket (C)
+      data      data_lbl(21) / '      Bucket SHIP' /
+c  22 = SHIP Hull Sensor (C)
+      data      data_lbl(22) / ' Hull Sensor SHIP' /
+c  23 = CMAN SST (C)
+      data      data_lbl(23) / '         CMAN SST' /
+c  24 = NOAA15 Day MCSSTs (C)
+      data      data_lbl(24) / '    N15 Day MCSST' /
+c  25 = NOAA15 Night MCSSTs (C)
+      data      data_lbl(25) / '  N15 Night MCSST' /
+c  26 = NOAA15 Relaxed Day MCSSTs (C)
+      data      data_lbl(26) / 'N15 Rlx Day MCSST' /
+c  27 = Mechanical BT (C)
+      data      data_lbl(27) / '    Mechanical BT' /
+c  28 = Hydrocast BT (C)
+      data      data_lbl(28) / '     Hydrocast BT' /
+c  29 = SSM/I F15 Ice (%)
+      data      data_lbl(29) / '    SSM/I F15 Ice' /
+c  30 = In Situ Sea Surface Height Anomaly (M)
+      data      data_lbl(30) / '      In Situ SSH' /
+c  31 = SSM/I Ice Shelf
+      data      data_lbl(31) / '  SSM/I Ice Shelf' /
+c  32 = TESAC Salinity (PSU)
+      data      data_lbl(32) / '   TESAC Salinity' /
+c  33 = MODAS Salinity (PSU)
+      data      data_lbl(33) / '   MODAS Salinity' /
+c  34 = TRACK OB Temperature (C)
+      data      data_lbl(34) / '    TRACK OB Temp' /
+c  35 = TRACK OB Salinty (PSU)
+      data      data_lbl(35) / '    TRACK OB Salt' /
+c  36 = PALACE Float Temperature (C)
+      data      data_lbl(36) / 'PALACE Float Temp' /
+c  37 = PALACE Float Salinity (PSU)
+      data      data_lbl(37) / 'PALACE Float Salt' /
+c  38 = Supplemental MODAS far-field temperature (C)
+      data      data_lbl(38) / ' MODAS Suppl Temp' /
+c  39 = Supplemental MODAS far-field salinity (PSU)
+      data      data_lbl(39) / ' MODAS Suppl Salt' /
+c  40 = Supplemental Sea Surface Height Anomaly (M)
+      data      data_lbl(40) / ' Supplemental SSH' /
+c  41 = Supplemental Sea Ice SSTs (C)
+      data      data_lbl(41) / '      Sea Ice SST' /
+c
+c..End CODA Types
+c
diff --git a/external_functions/godae_obs/xgodae_obs.cmn b/external_functions/godae_obs/xgodae_obs.cmn
new file mode 100644
index 0000000..470bbfd
--- /dev/null
+++ b/external_functions/godae_obs/xgodae_obs.cmn
@@ -0,0 +1,6 @@
+        COMMON /xgodae_obs/ gobs_open, gobs_filename, nobs, nvars
+	LOGICAL gobs_open
+	INTEGER nobs, nvars
+	CHARACTER*160 gobs_filename
+
+
diff --git a/external_functions/gridding/Makefile b/external_functions/gridding/Makefile
new file mode 100644
index 0000000..2193405
--- /dev/null
+++ b/external_functions/gridding/Makefile
@@ -0,0 +1,59 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+# ACM 2/2001  debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+SUB_OBJS = modscatminmax.o nobsxytv.o scat2grid_subs_mask.o
+#SUB_OBJS = scat2grid_subs.o
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c  $<
+	$(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	$(SUB_OBJS) tracks2grid_std_xyt.so tracks2grid_ave_xyt.so scat2grid_std_xyt.so \
+	scat2grid_minmax_xyt.so scat2grid_mask_bin_xyt.so scat2grid_mask_minmax_xyt.so \
+	scat2grid_mask_nbin_xyt.so scat2grid_mask_std_xyt.so tracks2grid_mask_ave_xyt.so 
+
+#all:	$(SUB_OBJS) index_to_grid.so scat2grid_nobs_xy.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) -g -Ddebug" "CFLAGS = $(CFLAGS) -g -Ddebug"  all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/gridding/ave_scat2grid_t.F b/external_functions/gridding/ave_scat2grid_t.F
new file mode 100644
index 0000000..bdb969a
--- /dev/null
+++ b/external_functions/gridding/ave_scat2grid_t.F
@@ -0,0 +1,386 @@
+*
+*  ave_scat2grid_t.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Sep 2004
+
+* Inputs are a set of T coordinates and a variable on an abstract axis, and an 
+* output time axis. Returns a time series which is the average of the variable, 
+* based on the number of points that fall inside of each T cell. 
+* From scat2grid_t.F
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  ave_scat2grid_t_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT (
+     . 'Compute average of a variable in each cell of output time axis')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 3)
+
+      CALL ef_set_axis_inheritance(id, NORMAL, NORMAL, NORMAL, 
+     .                             IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 2)
+
+* output grid is determined by argument 3. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input time coordinates')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Variable at times in TPTS')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TAXIS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Output time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ave_scat2grid_t_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER ntout, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3)
+
+      nt2 = (ntout+1)* 2
+
+* tax  output t axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* workspace for computing average; same as result T axis
+
+      CALL ef_set_work_array_dims (id, 2, 
+     .      arg_lo_ss(T_AXIS,ARG3), 1, 1, 1, 
+     .      arg_hi_ss(T_AXIS,ARG3), 1, 1, 1)
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE ave_scat2grid_t_compute(id, arg_1, arg_2, arg_3,
+     .                               result, tax, counts)
+
+*  arg_1  tpts  Scattered t values to be gridded.
+*  arg_2  taxis to use for output
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i1n, i3, i3n, ntgrid
+      INTEGER ntpts, nvpts
+      REAL tt, vv
+      CHARACTER*250 errtxt
+      REAL factr
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulot(4), regular(4)
+
+*  Dimension the work arrays
+
+      REAL*8 tax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL counts(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+      REAL*8 top_box
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axis is modulo
+
+      CALL ef_get_axis_info (id, 3, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input argument
+
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) ntpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+* Check that arguments 1 and 2 have the same number of values
+
+      nvpts = 0
+
+      DO 200 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG2)
+            i1n = arg_hi_ss(m,ARG2)
+            if (i1n-i1 .NE. 0) nvpts = 1 + (i1n - i1)
+         ENDIF
+ 200  CONTINUE
+
+      IF (ntpts .EQ. 0) GOTO 900
+      IF (nvpts .NE. ntpts) THEN
+        errtxt = 'arguments 1 and 2 must have the same number of values'
+        GOTO 900
+      ENDIF
+
+*  Check tax is a T axis
+
+      i3 = arg_lo_ss(T_AXIS,ARG3)
+      i3n = arg_hi_ss(T_AXIS,ARG3)
+      ntgrid = i3n - i3 + 1
+
+      IF (i3 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Third argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+*  Get coordinates of output axis.
+
+      call ef_get_coordinates(id, ARG3, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG3), arg_hi_ss(T_AXIS, ARG3), tax)
+
+*  Get cell boundaries
+
+      CALL ef_get_box_lo_lim (id, ARG3, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG3), arg_hi_ss(T_AXIS, ARG3), tax)
+
+      CALL ef_get_box_hi_lim (id, ARG3, T_AXIS,
+     .   arg_hi_ss(T_AXIS, ARG3), arg_hi_ss(T_AXIS, ARG3), top_box)
+
+      L = res_hi_ss(T_AXIS)+1
+      tax(L,1,1,1) = top_box
+
+*  Compute result
+
+*  Initialize counts
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      DO 300 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         result(i,j,k,l)= 0.
+         counts(L,1,1,1)= 0.
+ 300  CONTINUE
+
+*  Loop over input tpts
+
+      L = res_lo_ss(T_AXIS)
+
+      DO 500 n = 1, ntpts
+
+        CALL pickout (arg_1, n, tt)
+        CALL pickout (arg_2, n, vv)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+        IF (modulot(4)) CALL modscat (tax, ntgrid, 1, tt)
+
+        IF ( tt .NE. bad_flag(ARG3) .AND. 
+     .       vv .NE. bad_flag(ARG2) ) THEN
+           DO 400 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+              IF (n .EQ. 1 .AND. tt .EQ. tax(L,1,1,1) ) THEN
+                 result(i,j,k,l) = result(i,j,k,l) + vv
+                 counts(L,1,1,1) = counts(L,1,1,1) + 1
+              ELSE IF (tt .GT. tax(L,1,1,1) .AND. 
+     .                 tt .LE. tax(L+1,1,1,1) ) THEN
+                result(i,j,k,l) = result(i,j,k,l) + vv
+                counts(L,1,1,1) = counts(L,1,1,1) + 1
+              ENDIF
+  400      CONTINUE
+
+         ENDIF
+
+ 500  CONTINUE
+
+* Compute average
+
+      DO 600 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+         IF (counts(L,1,1,1) .GT. 0.) THEN
+           result(i,j,k,l) = result(i,j,k,l)/ counts(L,1,1,1)
+         ELSE
+           result(i,j,k,l) = bad_flag_result
+         ENDIF
+ 600  CONTINUE
+
+      RETURN
+
+900   CONTINUE
+
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+      SUBROUTINE pickout (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the ave_scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/fco2_xyt_stats_year.jnl b/external_functions/gridding/fco2_xyt_stats_year.jnl
new file mode 100644
index 0000000..db5feb8
--- /dev/null
+++ b/external_functions/gridding/fco2_xyt_stats_year.jnl
@@ -0,0 +1,84 @@
+DEFINE AXIS/T0="1-jan-1970"/EDGES/UNITS=days tmnth = DAYS1900(year,month,1) - offset1970
+
+! Count of cruises with some data in each XYT cell
+   ! Send a scalar as argument 1 to just count the cruises
+   LET var = 1
+   LET/UNITS="count"/TITLE="Number of cruises" \
+     count_ncruise = TRACKS2GRID_AVE_XYT(var,LON,LAT,DATE,CRUISE_NO,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/($file_qual)/FILE="($gridded_outfile)" count_ncruise
+   sh axis tmnth
+   DEFINE SYMBOL file_qual = APPEND
+
+! Now count all of observations in each XYT cell
+   LET var = fco2_rec
+   LET/Units="count"/TITLE="Number of obs" \
+     count_nobs = SCAT2GRID_NBIN_XYT(LON,LAT,DATE,var,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/APPEND/FILE="($gridded_outfile)" count_nobs
+   sh axis tmnth
+
+! Mean by cruise of Fco2_rec, with some data in each XYT cell
+   LET var = fco2_rec
+   LET/UNITS="umol"/TITLE="fco2 mean - per cruise weighted" \
+    FCO2_AVE_WEIGHTED = TRACKS2GRID_AVE_XYT(VAR,LON,LAT,DATE,CRUISE_NO,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_ave_weighted
+   sh axis tmnth
+
+
+! Mean fco2_rec, all observations in each XYT cell
+   LET/UNITS="umol"/TITLE="fco2 mean - unweighted all obs" \
+     FCO2_AVE_UNWTD = SCAT2GRID_BIN_XYT(LON,LAT,DATE,fco2_rec,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_ave_unwtd
+   sh axis tmnth
+
+! Min and max fco2.  These are computed from one function with min at k=1, max at k=2.
+! Use the Z=1:1 at ave to remove the Z axis from the grid of the variable on output.
+   LET minmax = SCAT2GRID_MINMAX_XYT(lon, lat, date, fco2_rec, x[gx=xlon], y[gy=ylat], t[gt=tmnth])
+   LOAD minmax
+
+   LET/UNITS=umol/TITLE="fco2 min" fco2_min_unwtd = minmax[z=1:1 at ave]
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_min_unwtd
+   sh axis tmnth
+
+   LET/UNITS=umol/TITLE="fco2 max" fco2_max_unwtd = minmax[z=2:2 at ave]
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_max_unwtd
+
+   sh axis tmnth
+
+! Variance by cruise of Fco2_rec, with some data in each XYT cell
+   LET fvar = fco2_rec
+
+   LET/UNITS="umol"/TITLE="fco2 std dev - per cruise weighted" \
+    fco2_std_weighted = tracks2grid_std_xyt(fvar,lon,lat,\
+    date,cruise_no,x[gx=xlon],y[gy=ylat],t[gt=tmnth])
+
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_std_weighted
+   sh axis tmnth
+   
+
+! unweighted std dev fco2
+   LET/UNITS=umol/TITLE="fco2 std dev - unweighted all obs" \
+     fco2_std_unwtd = SCAT2GRID_STD_XYT(lon, lat, date, fco2_rec, x[gx=xlon], y[gy=ylat], t[gt=tmnth])
+   SAVE/APPEND/FILE="($gridded_outfile)" fco2_std_unwtd
+   sh axis tmnth
+
+
+! Mean delta-latitude of all observations in each XYT cell
+   LET nearest_lat = IF lat GE 0 THEN (INT(lat) + 0.5) ELSE (INT(lat) - 0.5)
+   LET y_from_lat = (lat - nearest_lat)
+   LET/UNITS="Deg N"/TITLE="Latitude average offset from cell center" \
+     lat_offset_unwtd = SCAT2GRID_BIN_XYT(LON,LAT,DATE,y_from_lat,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/APPEND/FILE="($gridded_outfile)" lat_offset_unwtd
+
+! Mean delta-longitude of all observations in each XYT cell
+   LET nearest_lon = IF lon GE 0 THEN (INT(lon) + 0.5) ELSE (INT(lon) - 0.5)
+   LET x_from_lon = (lon - nearest_lon) 
+   LET/UNITS="Deg E"/TITLE="Longitude average offset from cell center" \
+     lon_offset_unwtd = SCAT2GRID_BIN_XYT(LON,LAT,DATE,x_from_lon,X[GX=xlon],Y[GY=ylat],T[GT=tmnth])
+   
+   SAVE/APPEND/FILE="($gridded_outfile)" lon_offset_unwtd
+   sh axis tmnth
diff --git a/external_functions/gridding/index_to_grid.F b/external_functions/gridding/index_to_grid.F
new file mode 100644
index 0000000..0845170
--- /dev/null
+++ b/external_functions/gridding/index_to_grid.F
@@ -0,0 +1,211 @@
+
+*
+* index_to_grid.F
+*
+* Jonathan Callahan
+* Feb 25th 2002
+*
+* This function reads in tuples (i,j,val) which correspond
+* to the FORTRAN indices of the value.  Some sites use this
+* method to compress data for gridded fields.
+*
+* The fourth argument contains the destination grid.
+*
+* The tuples are assumed to already be defined on an abstract
+* X and real Z and T axes.  The examples I have seen so far
+* are model output at a single level and multiple timesteps.
+* The tuple output only corresponds to the X and Y axes and 
+* is used instead of assigning bad flags or masks.
+*
+* Note that the FORTRAN indices I and J DO NOT correspond
+* to the Ferret indices I and J.  The following interpretation
+* is made:
+*
+* FORTRAN I = row number = FERRET J = latitude (perhaps oriented N->S)
+* FORTRAN J = col number = FERRET I = longitude
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE index_to_grid_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'puts (I,J,VAL) tuples on grid of D' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'I')
+      CALL ef_set_arg_desc(id, arg, 'Fortran I index (row) of VAL ')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'J')
+      CALL ef_set_arg_desc(id, arg, 'Fortran J index (column) of VAL')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'VAL')
+      CALL ef_set_arg_desc(id, arg, 'Value at grid cell [I,J]')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'D')
+      CALL ef_set_arg_desc(id, arg, 'destination grid taken from D')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE index_to_grid_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                                 result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy,
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i3,j3,k3,l3
+
+      INTEGER index_i,index_j
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* First -- populate the result with bad flags.
+
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                     result(i,j,k,l) = bad_flag_result
+
+ 100           CONTINUE
+ 200        CONTINUE
+ 300     CONTINUE
+ 400  CONTINUE
+      
+
+* Second -- Loop over the K and L axes.
+*           Put the values where they belong.
+*
+*           Assumption: I,J,VAL are on the same grid.
+*           Assumption: I is the row # and is associated with a latitude
+*           Assumption: J is the col # and is associated with a longitude
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+* Note: there should not be a Y axis on argument 3
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 700 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         DO 600 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            DO 500 i3=arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+               index_i = i - 1 + arg_2(i3,j3,k3,l3) 
+               index_j = j - 1 + arg_1(i3,j3,k3,l3)
+               result(index_i,index_j,k,l) = arg_3(i3,j3,k3,l3)
+ 500        CONTINUE
+
+            k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 600     CONTINUE
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 700  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/gridding/modscatminmax.F b/external_functions/gridding/modscatminmax.F
new file mode 100644
index 0000000..05acec9
--- /dev/null
+++ b/external_functions/gridding/modscatminmax.F
@@ -0,0 +1,76 @@
+
+
+      SUBROUTINE modscatminmax (axlo, axhi, nscat, scatm)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* ACM 11/00
+*  Called by scat2gridlaplace* gridding functions.
+*  If there is a modulo axis, apply modulo-ness to the coordinates in that 
+*  direction of the scattered points.
+
+*  ax           axlo, axhi outer box range of the modulo axis
+*  nscat        input: number of scattered points, output: updated number.
+*  scatm        scattered points coordinate array in the direction of the 
+*               modulo axis
+
+      REAL scatm(*)
+      REAL*8 axlo, axhi
+      INTEGER nscat, i
+      REAL ax1, axf, scatpt, diff, range
+
+      ax1 = axlo
+      axf = axhi
+      range = axf - ax1
+      IF (range .EQ. 0.) RETURN  ! else the WHILE loops are infinite !
+
+      DO 100 i = 1, nscat
+         scatpt = scatm(i)
+         diff = scatpt - axf
+         DO WHILE (diff .GE. 0)
+            scatpt = scatpt - range
+            diff = scatpt - axf
+         ENDDO
+
+         diff = scatpt - ax1 
+         DO WHILE (diff .LT. 0.)
+            scatpt = scatpt + range
+            diff = scatpt - ax1
+         ENDDO
+
+         scatm(i) = scatpt
+  100 CONTINUE
+
+      RETURN
+      END
+
diff --git a/external_functions/gridding/nobsxytv.F b/external_functions/gridding/nobsxytv.F
new file mode 100644
index 0000000..b6ab230
--- /dev/null
+++ b/external_functions/gridding/nobsxytv.F
@@ -0,0 +1,67 @@
+
+c***********************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	nx,ny,nt=size of grids
+c  i	x1,y1,L1=west/south/earliest edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny,nt) number of obs in each (x,y,t) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobsxytv (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .             x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny, nt, obs_only, indx(4,2)
+	REAL xx, yy, tt, vv, x1, y1, t1, dx, dy, dt, xf, 
+     .       yf, tf, obs(nx,ny,2,nt)
+
+* Local variable declarations
+
+        REAL xxg, yyg, ttg
+        INTEGER ig, jg, Lg ! !!!!!!!!!!!!!!!!!!!!!!!! adding t dimension throughtout
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+	ttg = (tt-t1)/ dt + 1.
+
+c.................sum the value and count in each (x,y,t) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	Lg = NINT(ttg)
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (lg.LT.1 .OR. lg.GT.nt) RETURN
+
+	IF (obs_only .EQ. 0) THEN
+           IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .       Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs(ig,jg,1,Lg) = obs(ig,jg,1,Lg) + vv
+     		obs(ig,jg,2,Lg) = obs(ig,jg,2,Lg) + 1.
+	   ENDIF
+	ELSE
+	   IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .      Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs(ig,jg,1,Lg) = obs(ig,jg,1,Lg) + 1.
+	   ENDIF
+	ENDIF
+
+* Store the min and max index used in this cruise
+	indx(1,1) = MIN(indx(1,1), ig)
+	indx(1,2) = MAX(indx(1,2), ig)
+	indx(2,1) = MIN(indx(2,1), jg)
+	indx(2,2) = MAX(indx(2,2), jg)
+	indx(4,1) = MIN(indx(4,1), Lg)
+	indx(4,2) = MAX(indx(4,2), Lg)
+
+	RETURN
+	END
+
+
+
diff --git a/external_functions/gridding/scat2grid_mask_bin_xyt.F b/external_functions/gridding/scat2grid_mask_bin_xyt.F
new file mode 100644
index 0000000..771ff62
--- /dev/null
+++ b/external_functions/gridding/scat2grid_mask_bin_xyt.F
@@ -0,0 +1,530 @@
+*
+*  scat2grid_mask_bin_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2010
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_mask_bin_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Put scattered data into XYT grid by binning')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg,
+     .               'XY mask on the output grid 1=valid,0=ignore')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_mask_bin_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* counts
+      CALL ef_set_work_array_dims (id, 7, 1,1,1,1, nxout,nyout,1,ntout)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE  scat2grid_mask_bin_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi, counts)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+*  arg_8  xy mask on new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .     mem8lot:mem8hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+
+      REAL*8 counts(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .              wrk7loz:wrk7hiz, wrk7lot:wrk7hit) 
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n,k8,l8
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt, imask, jmask
+
+      REAL x1, y1
+      REAL xx, yy, tt, ff
+      
+      REAL*8 xax1, yax1
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+ 
+
+C  Get first coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG5, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG5), arg_lo_ss(X_AXIS, ARG5), xax1)
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_lo_ss(Y_AXIS, ARG6), yax1)
+      x1 = xax1
+      y1 = yax1
+
+*  Compute result
+
+*  Initialize result.
+
+        k = res_lo_ss(Z_AXIS)
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,k,l) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Initialize counts.
+
+        k = 1
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 counts(i,j,k,L) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+	 k8 = arg_lo_ss(Z_AXIS,ARG8)
+	 l8 = arg_lo_ss(T_AXIS,ARG8)
+         DO 300 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+
+            imask = INT(1+(xx-x1)/dx)
+            if (xx .LT. xaxlo(imask,1,1,1)) imask = imask - 1
+            if (xx .GT. xaxhi(imask,1,1,1)) imask = imask + 1
+            jmask = INT(1+(yy-y1)/dy)
+            if (yy .LT. yaxlo(jmask,1,1,1)) jmask = jmask - 1
+            if (yy .GT. yaxhi(jmask,1,1,1)) jmask = jmask + 1
+
+            IF (arg_8(imask,jmask,k8,l8) .NE. 1.) GOTO 300
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            i1 = 1
+            DO 520 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               IF ( xx.GE.xaxlo(i1,1,1,1) .AND.
+     .             xx.LT.xaxhi(i1,1,1,1)) THEN
+
+               j1 = 1
+               DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  IF (yy.GE.yaxlo(j1,1,1,1) .AND.
+     .                yy.LT.yaxhi(j1,1,1,1)) THEN
+
+	          l1 = 1
+	          DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                     IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .                   tt.LT.taxhi(l1,1,1,1)) THEN
+                        result(i,j,k,L) = result(i,j,k,L) + ff
+                        counts(i,j,1,L) = counts(i,j,1,L) + 1.0 
+                     ENDIF
+
+                    l1 = l1 + 1
+ 500              CONTINUE
+
+		  ENDIF ! if yy
+
+                  j1 = j1 + 1
+ 510           CONTINUE
+               ENDIF  ! if xx
+
+               i1 = i1 + 1
+ 520        CONTINUE
+
+         ENDIF  ! ff not bad
+
+300   CONTINUE
+
+* Compute result, average in each bin.
+
+      k = res_lo_ss(Z_AXIS)
+      i1 = 1
+      DO 620 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 610 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( counts(i,j,1,L) .GT. 0. ) THEN
+                  result(i,j,k,l) = result(i,j,k,l)/counts(i,j,1,L)
+               ELSE
+                  result(i,j,k,l) = bad_flag_result
+               ENDIF
+
+600         CONTINUE
+            j1 = j1 + 1
+610      CONTINUE
+         i1 = i1 + 1
+620   CONTINUE
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+
diff --git a/external_functions/gridding/scat2grid_mask_minmax_xyt.F b/external_functions/gridding/scat2grid_mask_minmax_xyt.F
new file mode 100644
index 0000000..8ef39d6
--- /dev/null
+++ b/external_functions/gridding/scat2grid_mask_minmax_xyt.F
@@ -0,0 +1,545 @@
+*
+*  scat2grid_mask_minmax_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2011
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_mask_minmax_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT 
+     .  ('Compute min/max per bin, putting scattered data into XYT grid')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg,
+     .               'XY mask on the output grid 1=valid,0=ignore')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE scat2grid_mask_minmax_xyt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      integer lo, hi
+      lo = 1
+      hi = 2
+      CALL ef_set_axis_limits(id, Z_AXIS, lo, hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_mask_minmax_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_mask_minmax_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+*  arg_8  xy mask on new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+
+      REAL x1, y1
+      REAL xx, yy, tt, ff, a1, a2
+      INTEGER imask, jmask, k8, l8
+      REAL*8 xax1, yax1
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+ 
+
+C  Get first coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG5, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG5), arg_lo_ss(X_AXIS, ARG5), xax1)
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_lo_ss(Y_AXIS, ARG6), yax1)
+      x1 = xax1
+      y1 = yax1
+
+*  Compute result
+
+*  Initialize result.
+
+        BIG = ABS(bad_flag_result)
+
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,1,l) = big
+                 result(i,j,2,l) = -1.*big
+              ENDDO
+           ENDDO
+        ENDDO
+
+
+*  Loop over x,y,t, placing the min and max function values in the cells.
+
+	 k8 = arg_lo_ss(Z_AXIS,ARG8)
+	 l8 = arg_lo_ss(T_AXIS,ARG8)
+         DO 300 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+
+            imask = INT(1+(xx-x1)/dx)
+            if (xx .LT. xaxlo(imask,1,1,1)) imask = imask - 1
+            if (xx .GT. xaxhi(imask,1,1,1)) imask = imask + 1
+            jmask = INT(1+(yy-y1)/dy)
+            if (yy .LT. yaxlo(jmask,1,1,1)) jmask = jmask - 1
+            if (yy .GT. yaxhi(jmask,1,1,1)) jmask = jmask + 1
+
+            IF (arg_8(imask,jmask,k8,l8) .NE. 1.) GOTO 300
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            i1 = 1
+            DO 520 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               IF ( xx.GE.xaxlo(i1,1,1,1) .AND.
+     .             xx.LT.xaxhi(i1,1,1,1)) THEN
+
+               j1 = 1
+               DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  IF (yy.GE.yaxlo(j1,1,1,1) .AND.
+     .                yy.LT.yaxhi(j1,1,1,1)) THEN
+
+	          l1 = 1
+	          DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                     IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .                   tt.LT.taxhi(l1,1,1,1)) THEN
+
+                        result(i,j,1,L) = MIN(ff, result(i,j,1,L))
+                        result(i,j,2,L) = MAX(ff, result(i,j,2,L))
+
+                     ENDIF
+
+                    l1 = l1 + 1
+ 500              CONTINUE
+
+		  ENDIF ! if yy
+
+                  j1 = j1 + 1
+ 510           CONTINUE
+               ENDIF  ! if xx
+
+               i1 = i1 + 1
+ 520        CONTINUE
+
+         ENDIF  ! ff not bad
+
+300   CONTINUE
+
+* Now set the missing-value flag for locations that had no data. 
+
+      i1 = 1
+      DO 620 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 610 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( result(i,j,1,l) .EQ. big) THEN
+                  result(i,j,1,l) = bad_flag_result
+               ENDIF
+
+600         CONTINUE
+            j1 = j1 + 1
+610      CONTINUE
+         i1 = i1 + 1
+620   CONTINUE
+
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/scat2grid_mask_nbin_xyt.F b/external_functions/gridding/scat2grid_mask_nbin_xyt.F
new file mode 100644
index 0000000..77a3323
--- /dev/null
+++ b/external_functions/gridding/scat2grid_mask_nbin_xyt.F
@@ -0,0 +1,486 @@
+*
+*  scat2grid_mask_nbin_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2010
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_mask_nbin_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Count observations when putting scattered data into  ',
+     .        'XYT grid by binning')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x, y, and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg,
+     .               'XY mask on the output grid 1=valid,0=ignore')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_mask_nbin_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE  scat2grid_mask_nbin_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+*  arg_8  xy mask on new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+
+      REAL x1, y1, xf, yf, tol
+      REAL xx, yy, tt, ff
+      INTEGER imask, jmask, k8, l8
+      REAL*8 xax1, yax1
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+ 
+C  Get first coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG5, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG5), arg_lo_ss(X_AXIS, ARG5), xax1)
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_lo_ss(Y_AXIS, ARG6), yax1)
+      x1 = xax1
+      y1 = yax1
+
+*  Compute result
+
+*  Initialize result.
+
+        k = res_lo_ss(Z_AXIS)
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,k,l) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+	 k8 = arg_lo_ss(Z_AXIS,ARG8)
+	 l8 = arg_lo_ss(T_AXIS,ARG8)
+         DO 300 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+            imask = INT(1+(xx-x1)/dx)
+            if (xx .LT. xaxlo(imask,1,1,1)) imask = imask - 1
+            if (xx .GT. xaxhi(imask,1,1,1)) imask = imask + 1
+            jmask = INT(1+(yy-y1)/dy)
+            if (yy .LT. yaxlo(jmask,1,1,1)) jmask = jmask - 1
+            if (yy .GT. yaxhi(jmask,1,1,1)) jmask = jmask + 1
+
+            IF (arg_8(imask,jmask,k8,l8) .NE. 1.) GOTO 300
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            i1 = 1
+            DO 520 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               IF( xx.GE.xaxlo(i1,1,1,1) .AND.
+     .             xx.LT.xaxhi(i1,1,1,1)) THEN
+
+               j1 = 1
+               DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  IF (yy.GE.yaxlo(j1,1,1,1) .AND.
+     .                yy.LT.yaxhi(j1,1,1,1))  THEN
+
+	          l1 = 1
+	          DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+	             IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .                   tt.LT.taxhi(l1,1,1,1)) THEN
+                        result(i,j,k,L) = result(i,j,k,L) + 1.0 
+	             ENDIF
+                     l1 = l1 + 1
+ 500              CONTINUE
+
+		  ENDIF ! if yy
+
+                  j1 = j1 + 1
+ 510           CONTINUE
+               ENDIF  ! if xx
+
+               i1 = i1 + 1
+ 520        CONTINUE
+         ENDIF  ! ff not bad
+
+300   CONTINUE
+
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/scat2grid_mask_std_xyt.F b/external_functions/gridding/scat2grid_mask_std_xyt.F
new file mode 100644
index 0000000..ee2d274
--- /dev/null
+++ b/external_functions/gridding/scat2grid_mask_std_xyt.F
@@ -0,0 +1,615 @@
+*
+*  scat2grid_mask_std_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2011
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_mask_STD_XYT_INIT(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT (
+     . 'Compute std putting scattered data into XYT grid by masked bins')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg,
+     .               'XY mask on the output grid 1=valid,0=ignore')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_mask_STD_XYT_WORK_SIZE(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* counts
+      k = 2
+      CALL ef_set_work_array_dims 
+     .    (id, 7, 1, 1, 1, 1, nxout, nyout, k, ntout)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_mask_STD_XYT_COMPUTE(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi, counts)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+*  arg_8  xy mask on new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .     mem8lot:mem8hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      REAL counts(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .              wrk7loz:wrk7hiz, wrk7lot:wrk7hit) 
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+
+      REAL x1, y1, xf, yf, tol, diff
+      REAL xx, yy, tt, ff
+      INTEGER imask, jmask, k8, l8
+      REAL*8 xax1, yax1
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+ 
+C  Get first coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG5, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG5), arg_lo_ss(X_AXIS, ARG5), xax1)
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_lo_ss(Y_AXIS, ARG6), yax1)
+      x1 = xax1
+      y1 = yax1
+
+*  Compute result
+
+*  Initialize result.
+
+        k = res_lo_ss(Z_AXIS)
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,k,l) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Initialize counts.
+
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 counts(i,j,1,L) = 0.0
+                 counts(i,j,2,L) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+	k8 = arg_lo_ss(Z_AXIS,ARG8)
+        l8 = arg_lo_ss(T_AXIS,ARG8)
+        DO 300 n = 1, nscat
+
+           CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+            imask = INT(1+(xx-x1)/dx)
+            if (xx .LT. xax(imask,1,1,1) - dx/2) imask = imask - 1
+            if (xx .GT. xax(imask,1,1,1) + dx/2) imask = imask + 1
+            jmask = INT(1+(yy-y1)/dy)
+            if (yy .LT. yax(jmask,1,1,1) - dy/2) jmask = jmask - 1
+            if (yy .GT. yax(jmask,1,1,1) + dy/2) jmask = jmask + 1
+
+            IF (arg_8(imask,jmask,k8,l8) .NE. 1.) GOTO 300
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+           IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+           k = res_lo_ss(Z_AXIS)
+           IF (ff .NE. bad_flag(ARG4)) THEN
+              i1 = 1
+              DO 520 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 IF ( xx.GE.xaxlo(i1,1,1,1) .AND.
+     .                xx.LT.xaxhi(i1,1,1,1)) THEN
+
+                 j1 = 1
+                 DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                    IF (yy.GE.yaxlo(j1,1,1,1) .AND.
+     .                  yy.LT.yaxhi(j1,1,1,1)) THEN
+
+	            l1 = 1
+	            DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                       IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .                     tt.LT.taxhi(l1,1,1,1)) THEN
+                          result(i,j,k,L) = result(i,j,k,L) + ff
+                          counts(i,j,1,L) = counts(i,j,1,L) + 1.0 
+                       ENDIF
+
+                      l1 = l1 + 1
+ 500                CONTINUE
+
+		    ENDIF ! if yy
+
+                    j1 = j1 + 1
+ 510             CONTINUE
+                 ENDIF  ! if xx
+
+                 i1 = i1 + 1
+ 520          CONTINUE
+
+           ENDIF  ! ff not bad
+
+300     CONTINUE
+
+* Compute average in each bin.
+
+      i1 = 1
+      DO 620 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 610 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( counts(i,j,1,L) .GT. 0. ) THEN
+                  result(i,j,k,l) = result(i,j,k,l)/counts(i,j,1,L)
+               ELSE
+                  result(i,j,k,l) = bad_flag_result
+               ENDIF
+
+600         CONTINUE
+            j1 = j1 + 1
+610      CONTINUE
+         i1 = i1 + 1
+620   CONTINUE
+
+* Compute std in each bin.
+
+
+
+*  Loop over x,y,t, accumulating square of the function values minus bin 
+*  mean in the appropriate slots in the grid.
+
+         DO 800 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+     
+            imask = INT(1+(xx-x1)/dx)
+            if (xx .LT. xax(imask,1,1,1) - dx/2) imask = imask - 1
+            if (xx .GT. xax(imask,1,1,1) + dx/2) imask = imask + 1
+            jmask = INT(1+(yy-y1)/dy)
+            if (yy .LT. yax(jmask,1,1,1) - dy/2) jmask = jmask - 1
+            if (yy .GT. yax(jmask,1,1,1) + dy/2) jmask = jmask + 1
+
+            IF (arg_8(imask,jmask,k8,l8) .NE. 1.) GOTO 800
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Accumulate obs-mean in cells; using counts[k=2]
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            i1 = 1
+            DO 720 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               IF ( xx.GE.xaxlo(i1,1,1,1) .AND.
+     .             xx.LT.xaxhi(i1,1,1,1)) THEN
+
+               j1 = 1
+               DO 710 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  IF (yy.GE.yaxlo(j1,1,1,1) .AND.
+     .                yy.LT.yaxhi(j1,1,1,1)) THEN
+
+	          l1 = 1
+	          DO 700 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                     IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .                   tt.LT.taxhi(l1,1,1,1)) THEN
+                        diff = ff - result(i,j,k,l)
+                        counts(i,j,2,L) = counts(i,j,2,L) + diff*diff
+                     ENDIF
+
+                    l1 = l1 + 1
+ 700              CONTINUE
+
+		  ENDIF ! if yy
+
+                  j1 = j1 + 1
+ 710           CONTINUE
+               ENDIF  ! if xx
+
+               i1 = i1 + 1
+ 720        CONTINUE
+
+         ENDIF  ! ff not bad
+
+800   CONTINUE
+
+
+* Compute std in each bin.
+
+      i1 = 1
+      DO 830 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 820 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 810 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( counts(i,j,1,L) .GT. 0. ) THEN
+                  result(i,j,k,l) = SQRT(counts(i,j,2,L)/counts(i,j,1,L))
+               ELSE
+                  result(i,j,k,l) = bad_flag_result
+               ENDIF
+
+810         CONTINUE
+            j1 = j1 + 1
+820      CONTINUE
+         i1 = i1 + 1
+830   CONTINUE
+
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+
diff --git a/external_functions/gridding/scat2grid_minmax_xyt.F b/external_functions/gridding/scat2grid_minmax_xyt.F
new file mode 100644
index 0000000..65e6111
--- /dev/null
+++ b/external_functions/gridding/scat2grid_minmax_xyt.F
@@ -0,0 +1,499 @@
+*
+*  scat2grid_minmax_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2011
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_minmax_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT 
+     . ('Compute min/max per bin, putting scattered data into XYT grid')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE scat2grid_minmax_xyt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, 2)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_minmax_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_minmax_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+
+      REAL x1, y1, xf, yf
+      REAL xx, yy, tt, ff, a1, a2
+      REAL xmin, xdel, ymin, ydel, tmin, tdel
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+
+      xmin = xaxlo(1,1,1,1)
+      xdel = xaxhi(1,1,1,1) - xmin
+      ymin = yaxlo(1,1,1,1)
+      ydel = yaxhi(1,1,1,1) - ymin
+      tmin = taxlo(1,1,1,1)
+      tdel = taxhi(1,1,1,1) - tmin
+ 
+
+*  Compute result
+
+*  Initialize result.
+
+        BIG = ABS(bad_flag_result)
+
+        k = res_lo_ss(Z_AXIS)
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,1,l) = big
+                 result(i,j,2,l) = -1.*big
+              ENDDO
+           ENDDO
+        ENDDO
+
+
+*  Loop over x,y,t, placing the min and max function values in the cells.
+
+         DO 300 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            i = INT(0.5+(xx - xmin)/xdel)
+            j = INT(0.5+(yy - ymin)/ydel)
+            l = INT(0.5+(tt - tmin)/tdel)
+
+	    IF ( L.GE.res_lo_ss(T_AXIS) .AND. L.LE.res_hi_ss(T_AXIS) ) THEN
+               result(i,j,1,L) = MIN(ff, result(i,j,1,L))
+               result(i,j,2,L) = MAX(ff, result(i,j,2,L))
+	    ENDIF
+
+         ENDIF  ! ff not bad
+
+300   CONTINUE
+
+* Now set the missing-value flag for locations that had no data. 
+
+      i1 = 1
+      DO 620 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 610 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( result(i,j,1,l) .EQ. big) THEN
+                  result(i,j,1,l) = bad_flag_result
+               ENDIF
+
+600         CONTINUE
+            j1 = j1 + 1
+610      CONTINUE
+         i1 = i1 + 1
+620   CONTINUE
+
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/scat2grid_nobs_xy.F b/external_functions/gridding/scat2grid_nobs_xy.F
new file mode 100644
index 0000000..3001d57
--- /dev/null
+++ b/external_functions/gridding/scat2grid_nobs_xy.F
@@ -0,0 +1,445 @@
+*
+*  scat2grid_nobs_xy.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* February 9, 2005 from scat2gridgauss_xy
+
+* Returns # observations in each grid cell when a variable is interpolated 
+* onto an equally-spaced X-Y grid.  Input is scattered locations xpts, ypts
+* and the desired result grid. Output is # observations in each grid cell 
+* when data is gridded in x and y.  Calls routine "nobs" based on Billy
+* Kessler's gaussmap-subs.f.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_nobs_xy_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Count observations when gridding scattered ',
+     .        'data to XY grid using Gaussian function')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .      NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+* Output grid is determined by arguments 3 and 4, the result's x and y axes. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input pairs')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input pairs')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_nobs_xy_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, nx2, ny2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* obs  work array - counts of observations 
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, 
+     .                             nxout, nyout, 1, 1)
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE  scat2grid_nobs_xy_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, result, xax, yax, obs)
+
+*  arg_1  xpts  \Scattered x,y pairs to be gridded.
+*  arg_2  ypts  / 
+*  arg_3  xaxis of new grid   
+*  arg_4  yaxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i3, i3n, j4, j4n
+
+      INTEGER nxpts, nypts, nscat
+      INTEGER nx, ny    
+      INTEGER i1n, i2n
+
+      REAL x1, y1, xf, yf
+      REAL xx, yy
+
+*  Dimension the work arrays
+
+      REAL*8 xax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yax(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL obs(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulox(4), moduloy(4), regular(4)
+
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 3, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+      CALL ef_get_axis_info (id, 4, ax_name, ax_units, backward, 
+     .                       moduloy, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      i3n = arg_hi_ss(X_AXIS,ARG3)
+
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      j4n = arg_hi_ss(Y_AXIS,ARG4)
+
+      nx = 1 + (i3n - i3)
+      ny = 1 + (j4n - j4)
+
+*  Check that xax is a X axis and yax a Y axis
+
+      IF (i3 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Third argument must be a X axis'
+         GO TO 999
+      ENDIF
+      IF (j4 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG3, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG3), arg_hi_ss(X_AXIS, ARG3), xax)
+
+      call ef_get_coordinates(id, ARG4, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG4), arg_hi_ss(Y_AXIS, ARG4), yax)
+
+*  Set start, end, and delta for output axes. 
+
+      x1 = xax(1,1,1,1)
+      y1 = yax(1,1,1,1)
+
+      xf = xax(nx,1,1,1)
+      yf = yax(ny,1,1,1)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF (nx .GT. 1) dx = (xf-x1)/ REAL(nx-1)
+      dy = yf - y1
+      IF (ny .GT. 1) dy = (yf-y1)/ REAL(ny-1) 
+
+
+*  Compute result
+
+*  Initialize counts.
+
+         DO j = 1, ny
+            DO i = 1, nx
+               obs(i,j,1,1) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted 
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 300 n = 1, nscat
+
+            CALL pickout2 (arg_1, arg_2, n, xx, yy)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF (modulox(1)) CALL modscat (xax, nx, 1, xx)
+            IF (moduloy(2)) CALL modscat (yax, ny, 1, yy)
+
+	    CALL nobs (xx, yy, nx, ny, x1, y1, dx, dy,
+     .		       xf, yf, obs)
+
+C ACM modulo 11/9/00  Put points within dx or dy of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF (modulox(1)) THEN
+               IF ((xx-x1 .GE. 0.) .AND. (xx-x1 .LT. dx) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL nobs (xxend, yy, nx, ny, x1, y1, dx, dy,
+     .                       xf, yf, obs)
+               ENDIF
+                     
+               IF ((xf-xx .GE. 0.)  .AND. (xf-xx .LT. dx) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL nobs (xxbeg, yy, nx, ny, x1, y1, dx, dy,
+     .                       xf, yf, obs)
+               ENDIF
+            ENDIF
+
+            IF (moduloy(2)) THEN
+               IF ((yy-y1 .GE. 0.0) .AND.  (yy-y1  .LT. dy) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL nobs (xx, yyend, nx, ny, x1, y1, dx, dy,
+     .                       xf, yf, obs)
+               ENDIF
+                     
+               IF ((yf-yy .LT. 0.)  .AND.  (yf-yy .LT. dy) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL nobs (xx, yybeg, nx, ny, x1, y1, dx, dy,
+     .		             xf, yf, obs)
+               ENDIF
+            ENDIF
+
+
+ 300     CONTINUE
+
+*  Put gridded fcn into result variable.
+
+         k = res_lo_ss(Z_AXIS)
+         l = res_lo_ss(T_AXIS)
+
+         i1 = 1
+         DO 410 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            j1 = 1
+            DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               result(i,j,k,l) = obs(i1,j1,1,1)
+               j1 = j1 + 1
+
+ 400        CONTINUE
+            i1 = i1 + 1
+ 410     CONTINUE
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+
+   20 FORMAT ('Input scattered x, y have different # of points', 2I8)
+
+   30 FORMAT ('No data in scattered x, y points')
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+
diff --git a/external_functions/gridding/scat2grid_std_xyt.F b/external_functions/gridding/scat2grid_std_xyt.F
new file mode 100644
index 0000000..1ce2786
--- /dev/null
+++ b/external_functions/gridding/scat2grid_std_xyt.F
@@ -0,0 +1,553 @@
+*
+*  scat2grid_std_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 2011
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  SCAT2GRID_STD_XYT_INIT(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT('Compute std putting scattered data into XYT grid by bins')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS,  NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .     'T coordinates of scattered input XYT')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+ 
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      WRITE (buff, 20)
+  20  FORMAT ('F(X,Y,T) Data at scattered input XYT')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .                   'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 30)
+  30  FORMAT ('T axis coordinates of the output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+      
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE SCAT2GRID_STD_XYT_WORK_SIZE(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2, i, k
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, ny2, 1, 1, 1)
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, nt2, 1, 1, 1)
+* taxhi  output t axis
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* counts
+      k = 2
+      CALL ef_set_work_array_dims 
+     .    (id, 7, 1, 1, 1, 1, nxout, nyout, k, ntout)
+
+      RETURN
+      END
+
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE SCAT2GRID_STD_XYT_COMPUTE(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, result, xaxlo, xaxhi, 
+     .     yaxlo, yaxhi, taxlo, taxhi, counts)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  fpts /
+*  arg_5  xaxis of new grid   
+*  arg_6  yaxis of new grid 
+*  arg_7  taxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .     mem7lot:mem7hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*  Dimension the work arrays
+
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy, 
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      REAL counts(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .              wrk7loz:wrk7hiz, wrk7lot:wrk7hit) 
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1
+      INTEGER i5, i5n, j6, j6n, l7, l7n
+
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+
+      REAL x1, y1, xf, yf, tol, diff
+      REAL xx, yy, tt, ff, c, fac
+      REAL xmin, xdel, ymin, ydel, tmin, tdel
+
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(5)*16, ax_units(5)*16
+      LOGICAL backward(5), modulox(5), regular(5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 5, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+      nypts = 0
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG2)
+            i2n = arg_hi_ss(m,ARG2)
+            if (i2n-i2 .NE. 0) nypts = 1 + (i2n - i2)
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            if (i2n-i2 .NE. 0) ntpts = 1 + (i2n - i2)
+         ENDIF
+120   CONTINUE
+
+      IF (nxpts .NE. nypts .OR. nxpts .EQ. 0) GOTO 900
+      IF (nxpts .NE. ntpts) GOTO 900
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      i5n = arg_hi_ss(X_AXIS,ARG5)
+
+      j6 = arg_lo_ss(Y_AXIS,ARG6)
+      j6n = arg_hi_ss(Y_AXIS,ARG6)
+
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      l7n = arg_hi_ss(T_AXIS,ARG7)
+
+      nx = 1 + (i5n - i5)
+      ny = 1 + (j6n - j6)
+      nt = 1 + (l7n - l7)
+
+*  Check that xax is a X axis and yax a Y axis and tax a T axis
+
+      IF (i5 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Fifth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      IF (j6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (l7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG5), arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG6), arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG7), arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+
+      xmin = xaxlo(1,1,1,1)
+      xdel = xaxhi(1,1,1,1) - xmin
+      ymin = yaxlo(1,1,1,1)
+      ydel = yaxhi(1,1,1,1) - ymin
+      tmin = taxlo(1,1,1,1)
+      tdel = taxhi(1,1,1,1) - tmin
+ 
+
+*  Compute result
+
+*  Initialize result.
+
+        k = res_lo_ss(Z_AXIS)
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 result(i,j,k,l) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Initialize counts.
+
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+           DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+              DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                 counts(i,j,1,L) = 0.0
+                 counts(i,j,2,L) = 0.0
+              ENDDO
+           ENDDO
+        ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+        DO 300 n = 1, nscat
+
+           CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+           IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Put fcn into result variable.
+
+           k = res_lo_ss(Z_AXIS)
+           IF (ff .NE. bad_flag(ARG4)) THEN
+
+              i = INT(0.5+(xx - xmin)/xdel)
+              j = INT(0.5+(yy - ymin)/ydel)
+              l = INT(0.5+(tt - tmin)/tdel)
+
+              IF ( L.GE.res_lo_ss(T_AXIS) .AND. L.LE.res_hi_ss(T_AXIS) ) THEN
+                 result(i,j,k,L) = result(i,j,k,L) + ff
+                 counts(i,j,1,L) = counts(i,j,1,L) + 1.0 
+              ENDIF
+
+           ENDIF  ! ff not bad
+
+300     CONTINUE
+
+* Compute average in each bin.
+
+      i1 = 1
+      DO 620 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 610 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( counts(i,j,1,L) .GT. 1. ) THEN
+                  result(i,j,k,l) = result(i,j,k,l)/counts(i,j,1,L)
+               ELSE
+                  result(i,j,k,l) = bad_flag_result
+               ENDIF
+
+600         CONTINUE
+            j1 = j1 + 1
+610      CONTINUE
+         i1 = i1 + 1
+620   CONTINUE
+
+* Compute std in each bin.
+
+
+
+*  Loop over x,y,t, accumulating square of the function values minus bin 
+*  mean in the appropriate slots in the grid.
+
+         DO 800 n = 1, nscat
+
+            CALL pickout4 (arg_1, arg_2, arg_3, arg_4, 
+     .                         n, xx, yy, tt, ff)
+
+*  If output X axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+            IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+     .         CALL modscatminmax (xaxlo(1,1,1,1), xaxhi(nx,1,1,1), 1, xx)
+
+*  Accumulate obs-mean in cells; using counts[k=2]
+
+         IF (ff .NE. bad_flag(ARG4)) THEN
+            
+
+           i = INT(0.5+(xx - xmin)/xdel)
+           j = INT(0.5+(yy - ymin)/ydel)
+           l = INT(0.5+(tt - tmin)/tdel)
+           IF ( L.GE.res_lo_ss(T_AXIS) .AND. L.LE.res_hi_ss(T_AXIS) ) THEN
+
+	      IF (result(i,j,k,l) .NE. bad_flag_result) THEN
+                 IF (tt.GE.taxlo(l1,1,1,1) .AND.
+     .               tt.LT.taxhi(l1,1,1,1) .AND.
+     .               result(i,j,k,l) .NE. bad_flag_result) THEN
+                    diff = ff - result(i,j,k,l)
+                    counts(i,j,2,L) = counts(i,j,2,L) + diff*diff
+                 ENDIF
+	      ENDIF
+           ENDIF
+
+         ENDIF  ! ff not bad
+
+800   CONTINUE
+
+
+* Compute std in each bin.
+
+      i1 = 1
+      DO 830 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = 1
+         DO 820 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            l1 = 1
+            DO 810 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF( counts(i,j,1,L) .GT. 0. ) THEN
+	          c = counts(i,j,1,L)
+	          fac = c/(c-1)
+                  result(i,j,k,l) = fac*SQRT(counts(i,j,2,L)/c)
+               ELSE
+                  result(i,j,k,l) = bad_flag_result
+               ENDIF
+
+810         CONTINUE
+            j1 = j1 + 1
+820      CONTINUE
+         i1 = i1 + 1
+830   CONTINUE
+
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. nypts) THEN
+         WRITE (errtxt,20) nxpts, nypts
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+ 20   FORMAT ('Input scattered x, y have different # of points', 2I8)
+ 30   FORMAT ('No data in scattered x, y points')
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+
diff --git a/external_functions/gridding/scat2grid_subs.F b/external_functions/gridding/scat2grid_subs.F
new file mode 100644
index 0000000..d2de6f3
--- /dev/null
+++ b/external_functions/gridding/scat2grid_subs.F
@@ -0,0 +1,210 @@
+* scat2grid_subs:  Subroutines called by the scat2grid functions.
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+      SUBROUTINE pickout1 (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the ave_scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
+
+
+      SUBROUTINE pickout2 (alon, alat, n, xx, yy)
+
+
+*  ACM 3/2000
+*  Called from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon and lat)
+
+      REAL alon(*), alat(*)
+      REAL xx, yy
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+
+      RETURN
+      END
+
+      SUBROUTINE pickout3 (alon, alat, atimes, n, xx, yy, tt)
+
+*  CALLed from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon,lat,time or lon,lat,depth)
+
+      REAL alon(*), alat(*), atimes(*)
+      REAL xx, yy, tt
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+
+      RETURN
+      END
+
+      SUBROUTINE pickout4 (alon, alat, atimes, vals, n, xx, yy, tt, vv)
+
+*  Called from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon,lat,time,value or lon,lat,depth,time, etc)
+
+      REAL alon(*), alat(*), atimes(*), vals(*)
+      REAL xx, yy, tt, vv
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      vv = vals(n)
+
+      RETURN
+      END
+
+c************************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy=x/y location of data pt (data units)
+c  i	nx,ny=size of grids
+c  i	x1,y1=west/south edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny) number of obs in each (x,y) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobs (xx, yy, nx, ny, x1, y1, dx, dy, 
+     .			 xf, yf, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny
+	REAL xx, yy, dx, dy, x1, y1, xf, yf, obs(nx,ny)
+
+* Local variable declarations
+
+        REAL xxg, yyg
+        INTEGER ig, jg
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+
+c.................save the number of obs in each (x,y) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny)
+     .		obs(ig,jg) = obs(ig,jg)+1.
+
+	RETURN
+	END
+
+
+
+c************************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	nx,ny,nt=size of grids
+c  i	x1,y1,L1=west/south/earliest edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny,nt) number of obs in each (x,y,t) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobsxyt (xx, yy, tt, nx, ny, nt, x1, y1, t1, 
+     .                 dx, dy, dt, xf, yf, tf, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny, nt
+	REAL xx, yy, tt, x1, y1, t1, dx, dy, dt, xf, 
+     .       yf, tf, obs(nx,ny,nt)
+
+* Local variable declarations
+
+        REAL xxg, yyg, ttg
+        INTEGER ig, jg, Lg ! !!!!!!!!!!!!!!!!!!!!!!!! adding t dimension throughtout
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+	ttg = (tt-t1)/ dt + 1.
+
+c.................save the number of obs in each (x,y,t) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	Lg = NINT(ttg)
+	IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .      Lg.GE.1 .AND. Lg.LE.nt   )
+     .		obs(ig,jg,Lg) = obs(ig,jg,Lg)+1.
+
+	RETURN
+	END
+
+
+      SUBROUTINE pickout (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the ave_scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/scat2grid_subs_mask.F b/external_functions/gridding/scat2grid_subs_mask.F
new file mode 100644
index 0000000..38c85bc
--- /dev/null
+++ b/external_functions/gridding/scat2grid_subs_mask.F
@@ -0,0 +1,62 @@
+* scat2grid_subs_mask:  Subroutines called by the scat2grid functions
+* where a mask is applied.
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+	SUBROUTINE maskxy (xx, yy, xaxis, yaxis, mask, nx, ny, flag)
+	REAL xx, yy, xaxis(nx), yaxis(ny), mask(nx,ny)
+	integer flag
+
+	REAL dx2, dy2
+
+	dx2 = (xaxis(2) - xaxis(1))/2
+	dy2 = (yaxis(2) - yaxis(1))/2
+
+        flag = 0
+	DO 100 j = 1, ny
+	   IF (yy.GE.yaxis(j)-dx2 .AND. yy.LT.yaxis(j)+dy2) THEN
+	      DO 200 i = 1, nx
+	         IF (xx.GE.xaxis(i)-dx2 .AND. xx.LT.xaxis(i)+dx2) THEN
+                    IF (mask(i,j) .EQ. 1) THEN
+		       flag = 1
+		       RETURN
+		    ENDIF
+		 ENDIF
+  200         CONTINUE
+           ENDIF
+  100   CONTINUE
+
+        RETURN
+	END
+
diff --git a/external_functions/gridding/scat2grid_t.F b/external_functions/gridding/scat2grid_t.F
new file mode 100644
index 0000000..744920e
--- /dev/null
+++ b/external_functions/gridding/scat2grid_t.F
@@ -0,0 +1,381 @@
+*
+*  scat2grid_t.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* May 2003 
+* 11-Jul-2003  Clean up section where we get box limits
+
+* Input is a set of T coordinates on an abstract axis, and an output time axis.
+* Returns a time series which is the number of points that fall inside of each T cell. 
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  scat2grid_t_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Count number of t points in each cell of output axis')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 2)
+c      CALL ef_set_num_args(id, 3)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .      IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+* output grid is determined by argument 2. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input time coordinates')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TAXIS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Output time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+c      arg = 3
+c      CALL ef_set_arg_type(id, arg, STRING_ARG)
+c      CALL ef_set_arg_name(id, arg, 'WHICH')
+c      CALL ef_set_arg_desc(id, arg, 
+c     .     'result to compute: SUM or AVG')
+c      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_t_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER ntout, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2)
+
+      nt2 = (ntout+1)* 2
+
+* tax  output t axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* workspace for computing average or variance; same as result T axis
+
+c      CALL ef_set_work_array_dims (id, 2, 
+c     .                             arg_lo_ss(T_AXIS,ARG2), 1, 1, 1, 
+c     .                             arg_hi_ss(T_AXIS,ARG2), 1, 1, 1)
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+c      SUBROUTINE scat2grid_t_compute(id, arg_1, arg_2, arg_3,
+c     .                               result, tax)
+
+      SUBROUTINE scat2grid_t_compute(id, arg_1, arg_2,
+     .                               result, tax)
+
+*  arg_1  tpts  Scattered t values to be gridded.
+*  arg_2  taxis to use for output
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+
+c      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+c     .     mem3lot:mem3hit)
+
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i1n, i2, i2n, ntgrid
+      INTEGER ntpts
+      REAL tt, del, del1
+      CHARACTER*250 errtxt
+
+c      INTEGER STR_UPCASE, arg, iflag
+c      INTEGER factr
+c      CHARACTER*3 str, rtype
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulot(4), regular(4)
+
+*  Dimension the work arrays
+
+      REAL*8 tax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+
+      REAL*8 top_box
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* Get result type to compute 
+
+c      arg = 3
+c      CALL ef_get_arg_string(id, arg, str)
+c      iflag = STR_UPCASE(rtype, str)
+
+*  Check to see if output axis is modulo
+
+      CALL ef_get_axis_info (id, 2, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input argument
+
+      ntpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG1)
+            i1n = arg_hi_ss(m,ARG1)
+            if (i1n-i1 .NE. 0) ntpts = 1 + (i1n - i1)
+         ENDIF
+ 100  CONTINUE
+
+      IF (ntpts .EQ. 0) GOTO 900
+
+*  Check tax is a T axis
+
+      i2 = arg_lo_ss(T_AXIS,ARG2)
+      i2n = arg_hi_ss(T_AXIS,ARG2)
+      ntgrid = i2n - i2 + 1
+
+      IF (i2 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Second argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axis.
+
+      call ef_get_coordinates(id, ARG2, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG2), arg_hi_ss(T_AXIS, ARG2), tax)
+
+C  Get cell boundaries
+
+      CALL ef_get_box_lo_lim (id, ARG2, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG2), arg_hi_ss(T_AXIS, ARG2), tax)
+
+      CALL ef_get_box_hi_lim (id, ARG2, T_AXIS,
+     .   arg_hi_ss(T_AXIS, ARG2), arg_hi_ss(T_AXIS, ARG2), top_box)
+
+      L = res_hi_ss(T_AXIS)+1
+      tax(L,1,1,1) = top_box
+
+*  Compute result
+
+*  Initialize counts
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      DO 300 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         result(i,j,k,l)= 0.
+ 300  CONTINUE
+
+*  Loop over input tpts
+
+      L = res_lo_ss(T_AXIS)
+
+      DO 500 n = 1, ntpts
+
+        CALL pickout (arg_1, n, tt)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+        IF (modulot(4)) CALL modscat (tax, ntgrid, 1, tt)
+
+        IF ( tt  .NE. bad_flag(ARG3) ) THEN
+           DO 400 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+              IF (n .EQ. 1 .AND. tt .EQ. tax(L,1,1,1) ) THEN
+                 result(i,j,k,l) = result(i,j,k,l) + 1.
+              ELSE IF (tt .GT. tax(L,1,1,1) .AND. 
+     .                 tt .LE. tax(L+1,1,1,1) ) THEN
+                result(i,j,k,l) = result(i,j,k,l) + 1.
+              ENDIF
+  400      CONTINUE
+
+         ENDIF
+
+ 500  CONTINUE
+
+c      IF (rtype .EQ. 'AVG') THEN
+c         factr = 1./FLOAT(ntpts)
+c         DO 600 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+c            result(i,j,k,l) = result(i,j,k,l)* factr
+c 600     CONTINUE
+c      ENDIF
+
+      RETURN
+
+900   CONTINUE
+
+      IF (ntpts .EQ. 0) THEN
+        WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+   30 FORMAT ('No data in scattered T points')
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+      SUBROUTINE pickout (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
diff --git a/external_functions/gridding/socat_decadal.jnl b/external_functions/gridding/socat_decadal.jnl
new file mode 100644
index 0000000..6748faf
--- /dev/null
+++ b/external_functions/gridding/socat_decadal.jnl
@@ -0,0 +1,99 @@
+ ! Compute decadal averages of SOCAT gridded data:
+ ! sum the counts
+ ! average the fco2 averages
+ ! min and max the fco2 min and max.
+
+use "/home/data/socat/SOCAT_tracks_gridded_monthly.nc"
+set mem/siz=70
+
+define symbol outfile = /home/data/socat/SOCAT_tracks_gridded_decadal_new.nc
+sp rm -f outfile
+
+! Define output time axis
+
+ 
+
+yes? let year = 1900+{70,80,90,100,110}
+yes? let month = 1
+yes? let day = 1
+yes? define axis/units=days/t0=1-jan-1900/edges tdecade = days1900(year, month, 1)
+
+
+! Regrid each variable to the decadal axis using the appropriate transform.
+
+define symbol invar = count_ncruise  ! count_ncruise or ($invar)
+define sym op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! Sum for each month, adding to the dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/clobber ($invar)_decade
+
+! Now the same for count_nobs
+define symbol invar = count_nobs  ! count_ncruise or count_nobs
+define symbol op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/append ($invar)_decade
+
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_weighted
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/append ($invar)_decade
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_unwtd
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/append ($invar)_decade
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_min_unwtd
+define symbol op = MIN
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/append ($invar)_decade
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_max_unwtd
+define symbol op = MAX
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_decade = ($invar)[gt=tdecade@($op)]
+save/file="($outfile)"/append ($invar)_decade
+
+! Add global attribute
+
+let status = nco_attr("($outfile)", "global", "title", "c", "a",\
+"SOCAT gridded v1.4 May 2011, QC-Flags A-D, WOCE-Flag 2 by Decade" )
+load status
diff --git a/external_functions/gridding/socat_monthly_climatology.jnl b/external_functions/gridding/socat_monthly_climatology.jnl
new file mode 100644
index 0000000..f3abc1b
--- /dev/null
+++ b/external_functions/gridding/socat_monthly_climatology.jnl
@@ -0,0 +1,96 @@
+ ! Compute monthly climatologies of SOCAT gridded data.
+ ! sum the counts
+ ! average the fco2 averages
+ ! min and max the fco2 min and max.
+
+use "/home/data/socat/SOCAT_tracks_gridded_monthly.nc"
+
+
+define symbol outfile = /home/data/socat/SOCAT_tracks_gridded_month_clim.nc
+sp rm -f outfile
+
+define symbol invar = count_ncruise  ! count_ncruise or ($invar)
+define sym op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+use climatological_axes
+can data 2
+
+let LL = l[gt=($invar)[d=1]]
+
+if `tax_month(LL[L=1], LL) NE 1` THEN 
+   say 'original time axis does not start in January'
+   exit/program
+endif
+ 
+! For plotting the climatologies
+define sym levsym=(v,0min)
+keymark,1
+set win/siz=0.5
+
+! Sum for each month, adding to the dataset
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+pause
+
+! Now the same for count_nobs
+define symbol invar = count_nobs  ! count_ncruise or count_nobs
+define symbol op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! All months
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+pause
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_weighted
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! All months
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+pause
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_unwtd
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! All months
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+pause
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_min_unwtd
+define symbol op = MIN
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! All months
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+pause
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_max_unwtd
+define symbol op = MAX
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! All months
+repeat/range=1:12/name=m (let imon = `m`; go clim_month)
+
+
+! Add global attributes
+
+let status = nco_attr("($outfile)", "global", "title", "c", "a",\
+"SOCAT gridded v1.4 May 2011, QC-Flags A-D, WOCE-Flag 2 Monthly Climatology" )
+load status
diff --git a/external_functions/gridding/socat_yearly.jnl b/external_functions/gridding/socat_yearly.jnl
new file mode 100644
index 0000000..7506f35
--- /dev/null
+++ b/external_functions/gridding/socat_yearly.jnl
@@ -0,0 +1,93 @@
+ ! Compute yearly averages of SOCAT gridded data:
+ ! sum the counts
+ ! average the fco2 averages
+ ! min and max the fco2 min and max.
+
+use "/home/data/socat/SOCAT_tracks_gridded_monthly.nc"
+set mem/siz=70
+
+define symbol outfile = /home/data/socat/SOCAT_tracks_gridded_yearly.nc
+sp rm -f outfile
+
+! Define output time axis
+
+DEFINE AXIS/t="1-jan-1970":"31-dec-2007":1/edges/units=year tyear
+
+
+! Regrid each variable to the yearly axis using the appropriate transform.
+
+define symbol invar = count_ncruise  ! count_ncruise or ($invar)
+define sym op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title` 
+define symbol units_out=`($invar)[d=1],return=units`
+
+! Sum for each month, adding to the dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/clobber ($invar)_year
+
+! Now the same for count_nobs
+define symbol invar = count_nobs  ! count_ncruise or count_nobs
+define symbol op = SUM
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/append ($invar)_year
+
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_weighted
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/append ($invar)_year
+
+! For FCO2 variables, average.
+define symbol invar = fco2_ave_unwtd
+define symbol op = AVE
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/append ($invar)_year
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_min_unwtd
+define symbol op = MIN
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/append ($invar)_year
+
+! For FCO2 min and max, use the min and max.
+define symbol invar = fco2_max_unwtd
+define symbol op = MAX
+
+define symbol title_out=`($invar)[d=1],return=title`
+define symbol units_out=`($invar)[d=1],return=units`
+
+
+! add to dataset
+let/title="($title_out)"/units="($units_out)"  ($invar)_year = ($invar)[gt=tyear@($op)]
+save/file="($outfile)"/append ($invar)_year
+
+! Add global attribute
+
+let status = nco_attr("($outfile)", "global", "title", "c", "a",\
+"SOCAT gridded v1.4 May 2011, QC-Flags A-D, WOCE-Flag 2 Yearly" )
+load status
diff --git a/external_functions/gridding/test_tracks2grid_var_xyt.jnl b/external_functions/gridding/test_tracks2grid_var_xyt.jnl
new file mode 100644
index 0000000..4eb893e
--- /dev/null
+++ b/external_functions/gridding/test_tracks2grid_var_xyt.jnl
@@ -0,0 +1,64 @@
+! compute cruiseVariance
+
+! create a coarse resolution XYT grid that can be used to anticipate the
+! volume of data in an arbitrary XYT region
+ 
+SET MEM/SIZ=300
+
+DEFINE AXIS/X=-179.5:179.5:1/UNITS=degrees_east/MODULO xlon
+DEFINE AXIS/Y=-89.5:89.5:1/UNITS=degrees_north ylat
+
+LET dx = `0.5* xbox[gx=xlon,i=1]`
+LET dy = `0.5* ybox[gy=ylat,j=1]`
+
+!Data contains lat,lon,date,data_id,cruise_id,cruise_no,fco2_rec
+USE "/home/data/socat/SOCAT_triples_1.3_fco2.nc"
+
+SET AXIS/STRIDE=1 `lon,return=xaxis`
+let ntimes = 10000
+let ntimes = `lon,return=isize`
+
+LET offset1970 = DAYS1900(1970,1,1)
+LET month = MOD(ii-1,12)+1
+LET year = 1970 + INT((ii-1)/12)
+
+! for entire time period of SOCAT
+LET ii = i[i=1:480]
+
+
+!LET ii = i[i=421:433] ! for the year 2005 only
+!LET ii = i[i=445:456] ! for the year 2007 only
+
+DEFINE AXIS/T0="1-jan-1970"/EDGES/UNITS=days tmnth = DAYS1900(year,month,1) - offset1970
+   
+! Variance by cruise of Fco2_rec, with some data in each XYT cell
+LET fvar = fco2_rec
+
+LET/UNITS="Variance"/\
+ TITLE="Variance variable fco2_rec over cruises with carbon obs in 1x1, monthly bins" \
+ fco2_weighted_var = TRACKS2GRID_VAR_XYT(fvar[i=1:`ntimes`],lon[i=1:`ntimes`],lat[i=1:`ntimes`],\
+ date[i=1:`ntimes`],cruise_no[i=1:`ntimes`],x[gx=xlon],y[gy=ylat],t[gt=tmnth])
+
+SP date
+SAVE/CLOBBER/FILE=SOCAT_var.nc fco2_weighted_var
+SP date
+
+can var/all
+use SOCAT_var
+
+
+shade/lev=(0,2200,100)(inf) fco2_weighted_var[t=@ave]
+go fland 20
+
+
+pause
+shade/lev/x=-10:10/y=40:60 fco2_weighted_var[t=@ave]
+SET DATA 1
+GO polymark poly/over/nokey/pal=greyscale lon, lat, cruise_no, square
+
+
+pause
+let fc =  FCO2_WEIGHTED_VAR^0.5
+shade fc[t=@ave]
+go fland 20
+
diff --git a/external_functions/gridding/tracks2grid_ave_fco2_xyt_stats.jnl b/external_functions/gridding/tracks2grid_ave_fco2_xyt_stats.jnl
new file mode 100644
index 0000000..19d194d
--- /dev/null
+++ b/external_functions/gridding/tracks2grid_ave_fco2_xyt_stats.jnl
@@ -0,0 +1,57 @@
+! compute cruiseDensity
+
+! create a coarse resolution XYT grid that can be used to anticipate the
+! volume of data in an arbitrary XYT region
+ 
+SET MEM/SIZ=300
+
+DEFINE AXIS/X=-179.5:179.5:1/UNITS=degrees_east/MODULO xlon
+DEFINE AXIS/Y=-89.5:89.5:1/UNITS=degrees_north ylat
+
+LET dx = `0.5* xbox[gx=xlon,i=1]`
+LET dy = `0.5* ybox[gy=ylat,j=1]`
+
+!Data contains lat,lon,date,data_id,cruise_id,cruise_no,fco2_rec
+! USE "/home/data/socat/SOCAT_triples_fco2.nc"
+
+ !USE "/home/data/socat/SOCAT_triples_AD_1.3_fco2.nc"
+
+use  "/home/data/socat/SOCAT_triples_averaged_8_30_2011_AD_1.3_fco2.nc"
+
+!SET AXIS/STRIDE=100 `lon,return=xaxis`
+
+! Triples have time with origin at start of 1970.
+LET offset1970 = DAYS1900(1970,1,1)
+LET month = MOD(ii-1,12)+1
+LET year = 1970 + INT((ii-1)/12)
+
+! for entire time period of SOCAT
+LET ii = i[i=1:480]
+
+! Repeat and do the calculation for 5-year intervals.
+LET i1 = 1
+LET i2 = 61
+LET del = 60
+
+let imax = 457  ! through the end of 2007
+
+DEFINE SYMBOL file_qual = CLOBBER  ! First time CLOBBBER, afterwards APPEND to the file.
+DEFINE SYMBOL gridded_outfile = /home/data/socat/SOCAT_tracks_gridded_stats_AD.nc
+DEFINE SYMBOL gridded_outfile = /home/data/socat/SOCAT_tracks_gridded_monthly.SOCAT_triples_averaged_8_30_2011_AD_1.3_fco2.nc
+
+repeat/range=1:10:1 ( \
+ LET ii = i[i=`i1`:`i2`]; \
+ GO fco2_xyt_stats_year.jnl; \
+ LET i1 = `i2`; \
+ LET i2 = `i2+del`; \
+ IF `i2 GT imax` THEN LET i2 = `imax`; \
+ IF `i1 GE imax` THEN exit/loop; \
+ )
+
+
+! Add global attributes
+
+let status = nco_attr("($gridded_outfile)", "global", "title", "c", "a",\
+"SOCAT gridded. SOCAT v1.4 May 2011, QC-Flags A-D, WOCE-Flag 2" )
+load status
+
diff --git a/external_functions/gridding/tracks2grid_ave_xyt.F b/external_functions/gridding/tracks2grid_ave_xyt.F
new file mode 100644
index 0000000..81409b3
--- /dev/null
+++ b/external_functions/gridding/tracks2grid_ave_xyt.F
@@ -0,0 +1,710 @@
+*
+*  tracks2grid_ave_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* June 2009  from scatgrid_nobs_xyt
+*
+* The input data points are not a simple scatter.  They are cruise tracks 
+* strung one after another .  (Each track will be a contiguous block of points 
+* in the input data arrays. )  And the subtlety is that each cruise needs to 
+* receive the same weight when determining the average for a cell, rather than 
+* each individual data point.  Which means effectively that you need to have 
+* two averaging processes .  You need to have a buffer (the individual cruise 
+* buffer) that is the size and shape of the output grid in which you average 
+* each individual cruise.  And then when the final point of each cruise from 
+* the input data is encountered, you need to add (average) the points from the 
+* individual cruise buffer into the output buffer, re-zeroing the individual 
+* cruise buffer as you do so, so it is ready to average the next cruise. 
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  tracks2grid_ave_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Average by cruise, when gridding scattered ',
+     .        'data to XYT grid.')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .        IMPLIED_BY_ARGS, NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 5)
+
+* Output grid is determined by arguments 4, 5, 6, the result's x, y, t axes. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Variable at scattered input XYT. Enter a scalar to just count Obs.')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input triples')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ICRUISE')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Cruise ID at scattered input locations')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 20)
+   20 FORMAT ('T axis coordinates, of a regular output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tracks2grid_ave_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG6) - arg_lo_ss(X_AXIS,ARG6)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG7) - arg_lo_ss(Y_AXIS,ARG7)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG8) - arg_lo_ss(T_AXIS,ARG8)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* Tax  output t axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* obs_cruise  work array - sum and counts of observations per cruise
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+* obs  work array - work array - sum and counts of observations
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE tracks2grid_ave_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, 
+     .      xax, yax, tax, obs_cruise, obs)
+
+*  arg_1  var
+*  arg_2  xpts  \
+*  arg_3  ypts   | Scattered x,y triples to be gridded.
+*  arg_4  tpts  / 
+*  arg_5  icruise
+*
+*  arg_6  xaxis of new grid   
+*  arg_7  yaxis of new grid
+*  arg_8  taxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .     mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, 
+     .     mem6loz:mem6hiz, mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, 
+     .     mem7loz:mem7hiz, mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1, k2
+      INTEGER i6,j7,L8,i6n,j7n,L8n
+
+      INTEGER nxpts, npts
+      INTEGER nx, ny, nt
+      INTEGER i1n, i2n
+      INTEGER obs_only
+
+      REAL x1, y1, t1, icruise, ncruise, xf, yf, tf
+      REAL xx, yy, tt, vv
+
+*  Dimension the work arrays
+
+      REAL*8 xax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yax(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 tax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL obs_cruise(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL obs(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulox(4), moduloy(4), modulot(4), regular(4)
+
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+      REAL*8 xax1,xaxf, yax1,yaxf, tax1,taxf
+      INTEGER indx(4,2)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      obs_only = 0	! 0 = var 1 is a variable to average.
+                        ! 1 = Compute a count of cruises with an obs in the grid cells
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 6, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+      CALL ef_get_axis_info (id, 7, ax_name, ax_units, backward, 
+     .                       moduloy, regular)
+      CALL ef_get_axis_info (id, 8, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG2)
+            i1n = arg_hi_ss(m,ARG2)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+            IF (nxpts .EQ. 0) GOTO 900
+         ENDIF
+ 100  CONTINUE
+
+      npts = 1
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG1)
+            i2n = arg_hi_ss(m,ARG1)
+            npts = 1 + (i2n - i2)
+            IF ((npts.NE.1) .AND. (npts.NE.nxpts)) GOTO 900
+         ENDIF
+ 110  CONTINUE
+      IF (npts .EQ. 1) obs_only = 1  ! just count up the obs
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 120  CONTINUE
+
+      DO 130 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG4) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG4)
+            i2n = arg_hi_ss(m,ARG4)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 130  CONTINUE
+
+      DO 140 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG5) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG5)
+            i2n = arg_hi_ss(m,ARG5)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 140  CONTINUE
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i6 = ef_unspecified_int4
+      j7 = ef_unspecified_int4
+      L8 = ef_unspecified_int4
+
+      i6 = arg_lo_ss(X_AXIS,ARG6)
+      i6n = arg_hi_ss(X_AXIS,ARG6)
+
+      j7 = arg_lo_ss(Y_AXIS,ARG7)
+      j7n = arg_hi_ss(Y_AXIS,ARG7)
+
+      L8 = arg_lo_ss(T_AXIS,ARG8)
+      L8n = arg_hi_ss(T_AXIS,ARG8)
+
+      nx = 1 + (i6n - i6)
+      ny = 1 + (j7n - j7)
+      nt = 1 + (L8n - L8)
+
+*  Check that xax is a X axis and yax a Y axis
+
+      IF (i6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a X axis'
+         GO TO 999
+      ENDIF
+      IF (j7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (L8 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Eighth argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax)
+
+      call ef_get_coordinates(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax)
+
+      call ef_get_coordinates(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax)
+
+*  Set start, end, and delta for output axes. 
+
+      x1 = xax(1,1,1,1)
+      y1 = yax(1,1,1,1)
+      t1 = tax(1,1,1,1)
+
+      xf = xax(nx,1,1,1)
+      yf = yax(ny,1,1,1)
+      tf = tax(nt,1,1,1)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF (nx .GT. 1) dx = (xf-x1)/ REAL(nx-1)
+      dy = yf - y1
+      IF (ny .GT. 1) dy = (yf-y1)/ REAL(ny-1) 
+      dt = tf - t1
+      IF (nt .GT. 1) dt = (tf-t1)/ REAL(nt-1) 
+
+      IF (nx .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax1,xaxf)
+         dx = xaxf - xax1
+      ENDIF
+      IF (ny .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax1,yaxf)
+         dy = yaxf - yax1
+      ENDIF
+         IF (nt .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax1,taxf)
+         tx = taxf - tax1
+      ENDIF
+
+
+      CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_lo_ss(X_AXIS, ARG6), xax1,xax1)
+      CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_hi_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xaxf,xaxf)
+
+*  Compute result
+
+*  Initialize counts.
+
+      k2 = 2
+      IF (obs_only .EQ. 1) k2 = 1
+
+      DO L = 1, nt
+      DO k = 1, k2
+      DO j = 1, ny
+      DO i = 1, nx
+         obs(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, k2
+      DO j = 1, ny
+      DO i = 1, nx
+         obs_cruise(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted 
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+      n = 1
+      CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+      icruise = ncc
+
+* For each cruise keep track of the index range it spans in the result grid
+* Then at the end of the cruise need only to process that subset of the grid.
+      indx(1,1) = nx
+      indx(1,2) = 1
+      indx(2,1) = ny
+      indx(2,2) = 1
+      indx(4,1) = nt
+      indx(4,2) = 1
+
+      DO 300 n = 1, nscat
+
+         CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+         IF (vv .EQ. bad_flag(ARG1) .OR. xx .EQ. bad_flag(ARG2) .OR. 
+     .          yy .EQ. bad_flag(ARG3) .OR. tt .EQ. bad_flag(ARG4) ) GOTO 300
+
+         IF (ncc .NE. icruise) THEN
+	    
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+	       IF (obs_only .EQ. 0) THEN
+                  IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+                     obs(i,j,1,L) = obs(i,j,1,L) + 
+     .                 obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+                     obs(i,j,2,L) = obs(i,j,2,L) + 1.
+		  ENDIF
+                  obs_cruise(i,j,1,L) = 0.
+                  obs_cruise(i,j,2,L) = 0.
+               ELSE
+                  IF (obs_cruise(i,j,1,L) .GT. 0.) THEN
+                     obs(i,j,1,L) = obs(i,j,1,L) + 1.
+                  ENDIF
+                  obs_cruise(i,j,1,L) = 0.
+               ENDIF
+            ENDDO
+            ENDDO
+            ENDDO
+
+	    icruise = ncc
+
+* reset indices
+            indx(1,1) = nx
+            indx(1,2) = 1
+            indx(2,1) = ny
+            indx(2,2) = 1
+            indx(4,1) = nt
+            indx(4,2) = 1
+	    
+	 ENDIF
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+c         IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+c     .         CALL modscatminmax (xax1, xaxf, 1, xx)
+
+         CALL nobsxytv (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .           x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+
+*  Put points within dx or dy  or dt of the end just beyond the
+*  other end, and use in the gridding computation.
+
+c         IF (modulox(1)) THEN
+c            IF ((xx-x1 .GE. 0.) .AND. (xx-x1 .LT. dx) ) THEN
+c               xxend = xf + (xx-x1)
+c               CALL nobsxytv (obs_only, xxend, yy, tt, vv, nx, ny, nt, 
+c     .              x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+c            ENDIF
+                     
+c            IF ((xf-xx .GE. 0.)  .AND. (xf-xx .LT. dx) ) THEN
+c               xxbeg = x1 - (xf-xx)
+c               CALL nobsxytv (obs_only, xxbeg, yy, tt, vv, nx, ny, nt, 
+c     .              x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+c            ENDIF
+c         ENDIF
+
+ 300     CONTINUE
+
+* Get data from the last cruise
+	    
+      DO L = indx(4,1), indx(4,2)
+      DO j = indx(2,1), indx(2,2)
+      DO i = indx(1,1), indx(1,2)
+         IF (obs_only .EQ. 0) THEN
+            IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+               obs(i,j,1,L) = obs(i,j,1,L) + 
+     .                 obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+               obs(i,j,2,L) = obs(i,j,2,L) + 1.
+            ENDIF
+            obs_cruise(i,j,1,L) = 0.
+            obs_cruise(i,j,2,L) = 0.
+         ELSE
+            IF (obs_cruise(i,j,1,L) .GT. 0.) THEN
+               obs(i,j,1,L) = obs(i,j,1,L) + 1.
+            ENDIF
+               obs_cruise(i,j,1,L) = 0.
+         ENDIF
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Put gridded fcn into result variable.
+
+      IF (obs_only .EQ. 0) THEN
+         k = res_lo_ss(Z_AXIS)
+         L1 = 1
+         DO 420 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            j1 = 1
+            DO 410 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = 1
+               DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (obs(i1,j1,2,L1) .GT. 0.) THEN
+                     result(i,j,k,l) = obs(i1,j1,1,L1)/obs(i1,j1,2,L1)
+		  ELSE
+                     result(i,j,k,l) = bad_flag_result
+		  ENDIF
+
+                  i1 = i1 + 1
+ 400           CONTINUE
+               j1 = j1 + 1
+
+ 410        CONTINUE
+            L1 = L1 + 1
+ 420     CONTINUE
+
+      ELSE
+         k = res_lo_ss(Z_AXIS)
+         L1 = 1
+         DO 520 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            j1 = 1
+            DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = 1
+               DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  result(i,j,k,l) = obs(i1,j1,1,L1)
+                  i1 = i1 + 1
+ 500           CONTINUE
+               j1 = j1 + 1
+
+ 510        CONTINUE
+            l1 = l1 + 1
+ 520     CONTINUE
+
+      ENDIF
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. npts) THEN
+         WRITE (errtxt,20)
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+   20 FORMAT 
+     . ('Input scattered var,x,y,t,cruiseID have different # of points')
+
+   30 FORMAT ('No data in scattered x,y,t points')
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+
+
+
+      SUBROUTINE pickoutxytcv (obs_only, vars, alon, alat, atimes,
+     .   cruises, n, vv, xx, yy, tt, ncc)
+
+*  Called from the scatter* family of gridding functions.
+*  Pick out nth item from a set of arrays, which are really 
+*  4-dimensioned arrays with normal axes on three of the four axes.
+
+      REAL alon(*), alat(*), atimes(*), cruises(*), vars(*)
+      REAL xx, yy, tt, vv
+      INTEGER obs_only, n, ncc
+
+      vv = 1.
+      IF (obs_only .EQ. 0) vv = vars(n)
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      ncc = cruises(n)
+
+      RETURN
+      END
+
+
diff --git a/external_functions/gridding/tracks2grid_mask_ave_xyt.F b/external_functions/gridding/tracks2grid_mask_ave_xyt.F
new file mode 100644
index 0000000..1d8ee0a
--- /dev/null
+++ b/external_functions/gridding/tracks2grid_mask_ave_xyt.F
@@ -0,0 +1,732 @@
+*
+*  tracks2grid_mask_ave_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* June 2009  from scatgrid_nobs_xyt
+*
+* The input data points are not a simple scatter.  They are cruise tracks 
+* strung one after another .  (Each track will be a contiguous block of points 
+* in the input data arrays. )  And the subtlety is that each cruise needs to 
+* receive the same weight when determining the average for a cell, rather than 
+* each individual data point.  Which means effectively that you need to have 
+* two averaging processes .  You need to have a buffer (the individual cruise 
+* buffer) that is the size and shape of the output grid in which you average 
+* each individual cruise.  And then when the final point of each cruise from 
+* the input data is encountered, you need to add (average) the points from the 
+* individual cruise buffer into the output buffer, re-zeroing the individual 
+* cruise buffer as you do so, so it is ready to average the next cruise. 
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  tracks2grid_mask_ave_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Average by cruise, when gridding scattered ',
+     .        'data to XYT grid where output grid is masked.')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .        IMPLIED_BY_ARGS, NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 5)
+
+* Output grid is determined by arguments 4, 5, 6, the result's x, y, t axes. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Variable at scattered input XYT. Enter a scalar to just count Obs.')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input triples')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ICRUISE')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Cruise ID at scattered input locations')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 20)
+   20 FORMAT ('T axis coordinates, of a regular output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg,  
+     .                   'XY mask on the output grid 1=valid, 0=ignore')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tracks2grid_mask_ave_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG6) - arg_lo_ss(X_AXIS,ARG6)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG7) - arg_lo_ss(Y_AXIS,ARG7)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG8) - arg_lo_ss(T_AXIS,ARG8)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* Tax  output t axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* obs_cruise  work array - sum and counts of observations per cruise
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+* obs  work array - work array - sum and counts of observations
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE tracks2grid_mask_ave_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, result, 
+     .      xax, yax, tax, obs_cruise, obs)
+
+*  arg_1  var
+*  arg_2  xpts  \
+*  arg_3  ypts   | Scattered x,y triples to be gridded.
+*  arg_4  tpts  / 
+*  arg_5  icruise
+*
+*  arg_6  xaxis of new grid   
+*  arg_7  yaxis of new grid
+*  arg_8  taxis of new grid
+*  arg_9  xy mask for output grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .     mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, 
+     .     mem6loz:mem6hiz, mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, 
+     .     mem7loz:mem7hiz, mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, 
+     .     mem9loz:mem9hiz, mem9lot:mem9hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, i2, j1, k1, l1, k2
+      INTEGER i6,j7,L8,i6n,j7n,L8n
+      INTEGER imask, jmask, k9, l9
+
+      INTEGER nxpts, npts
+      INTEGER nx, ny, nt
+      INTEGER i1n, i2n
+      INTEGER obs_only
+
+      REAL x1, y1, t1, icruise, ncruise, xf, yf, tf
+      REAL xx, yy, tt, vv
+
+*  Dimension the work arrays
+
+      REAL*8 xax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yax(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 tax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL obs_cruise(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL obs(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulox(4), moduloy(4), modulot(4), regular(4)
+
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+      REAL*8 xax1,xaxf, yax1,yaxf, tax1,taxf
+      INTEGER indx(4,2)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      obs_only = 0	! 0 = var 1 is a variable to average.
+                        ! 1 = Compute a count of cruises with an obs in the grid cells
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 6, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+      CALL ef_get_axis_info (id, 7, ax_name, ax_units, backward, 
+     .                       moduloy, regular)
+      CALL ef_get_axis_info (id, 8, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG2)
+            i1n = arg_hi_ss(m,ARG2)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+            IF (nxpts .EQ. 0) GOTO 900
+         ENDIF
+ 100  CONTINUE
+
+      npts = 1
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG1)
+            i2n = arg_hi_ss(m,ARG1)
+            npts = 1 + (i2n - i2)
+            IF ((npts.NE.1) .AND. (npts.NE.nxpts)) GOTO 900
+         ENDIF
+ 110  CONTINUE
+      IF (npts .EQ. 1) obs_only = 1  ! just count up the obs
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 120  CONTINUE
+
+      DO 130 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG4) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG4)
+            i2n = arg_hi_ss(m,ARG4)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 130  CONTINUE
+
+      DO 140 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG5) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG5)
+            i2n = arg_hi_ss(m,ARG5)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 140  CONTINUE
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i6 = ef_unspecified_int4
+      j7 = ef_unspecified_int4
+      L8 = ef_unspecified_int4
+
+      i6 = arg_lo_ss(X_AXIS,ARG6)
+      i6n = arg_hi_ss(X_AXIS,ARG6)
+
+      j7 = arg_lo_ss(Y_AXIS,ARG7)
+      j7n = arg_hi_ss(Y_AXIS,ARG7)
+
+      L8 = arg_lo_ss(T_AXIS,ARG8)
+      L8n = arg_hi_ss(T_AXIS,ARG8)
+
+      nx = 1 + (i6n - i6)
+      ny = 1 + (j7n - j7)
+      nt = 1 + (L8n - L8)
+
+*  Check that xax is a X axis and yax a Y axis
+
+      IF (i6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a X axis'
+         GO TO 999
+      ENDIF
+      IF (j7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (L8 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Eighth argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax)
+
+      call ef_get_coordinates(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax)
+
+      call ef_get_coordinates(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax)
+
+*  Set start, end, and delta for output axes. 
+
+      x1 = xax(1,1,1,1)
+      y1 = yax(1,1,1,1)
+      t1 = tax(1,1,1,1)
+
+      xf = xax(nx,1,1,1)
+      yf = yax(ny,1,1,1)
+      tf = tax(nt,1,1,1)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF (nx .GT. 1) dx = (xf-x1)/ REAL(nx-1)
+      dy = yf - y1
+      IF (ny .GT. 1) dy = (yf-y1)/ REAL(ny-1) 
+      dt = tf - t1
+      IF (nt .GT. 1) dt = (tf-t1)/ REAL(nt-1) 
+
+      IF (nx .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax1,xaxf)
+         dx = xaxf - xax1
+      ENDIF
+      IF (ny .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax1,yaxf)
+         dy = yaxf - yax1
+      ENDIF
+         IF (nt .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax1,taxf)
+         tx = taxf - tax1
+      ENDIF
+
+
+      CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_lo_ss(X_AXIS, ARG6), xax1,xax1)
+      CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_hi_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xaxf,xaxf)
+
+*  Compute result
+
+*  Initialize counts.
+
+      k2 = 2
+      IF (obs_only .EQ. 1) k2 = 1
+
+      DO L = 1, nt
+      DO k = 1, k2
+      DO j = 1, ny
+      DO i = 1, nx
+         obs(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, k2
+      DO j = 1, ny
+      DO i = 1, nx
+         obs_cruise(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted 
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+      n = 1
+      CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+      icruise = ncc
+
+* For each cruise keep track of the index range it spans in the result grid
+* Then at the end of the cruise need only to process that subset of the grid.
+      indx(1,1) = nx
+      indx(1,2) = 1
+      indx(2,1) = ny
+      indx(2,2) = 1
+      indx(4,1) = nt
+      indx(4,2) = 1
+
+      k9 = arg_lo_ss(Z_AXIS,ARG9)
+      l9 = arg_lo_ss(T_AXIS,ARG9)
+      DO 300 n = 1, nscat
+
+         CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+         IF (vv .EQ. bad_flag(ARG1) .OR. xx .EQ. bad_flag(ARG2) .OR. 
+     .          yy .EQ. bad_flag(ARG3) .OR. tt .EQ. bad_flag(ARG4) ) GOTO 300
+     
+         imask = INT(1+(xx-x1)/dx)
+         if (xx .LT. xax(imask,1,1,1) - dx/2) imask = imask - 1
+         if (xx .GT. xax(imask,1,1,1) + dx/2) imask = imask + 1
+         jmask = INT(1+(yy-y1)/dy)
+         if (yy .LT. yax(jmask,1,1,1) - dy/2) jmask = jmask - 1
+         if (yy .GT. yax(jmask,1,1,1) + dy/2) jmask = jmask + 1
+
+         IF (arg_9(imask,jmask,k9,l9) .NE. 1.) GOTO 300
+
+
+         IF (ncc .NE. icruise) THEN
+	    
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+	       IF (obs_only .EQ. 0) THEN
+                  IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+                     obs(i,j,1,L) = obs(i,j,1,L) + 
+     .                 obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+                     obs(i,j,2,L) = obs(i,j,2,L) + 1.
+		  ENDIF
+                  obs_cruise(i,j,1,L) = 0.
+                  obs_cruise(i,j,2,L) = 0.
+               ELSE
+                  IF (obs_cruise(i,j,1,L) .GT. 0.) THEN
+                     obs(i,j,1,L) = obs(i,j,1,L) + 1.
+                  ENDIF
+                  obs_cruise(i,j,1,L) = 0.
+               ENDIF
+            ENDDO
+            ENDDO
+            ENDDO
+
+	    icruise = ncc
+
+* reset indices
+            indx(1,1) = nx
+            indx(1,2) = 1
+            indx(2,1) = ny
+            indx(2,2) = 1
+            indx(4,1) = nt
+            indx(4,2) = 1
+	    
+	 ENDIF
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+
+c         IF  (modulox(1) .AND. xx.NE.bad_flag(ARG1))
+c     .         CALL modscatminmax (xax1, xaxf, 1, xx)
+
+         CALL nobsxytv (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .           x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+
+*  Put points within dx or dy  or dt of the end just beyond the
+*  other end, and use in the gridding computation.
+
+c         IF (modulox(1)) THEN
+c            IF ((xx-x1 .GE. 0.) .AND. (xx-x1 .LT. dx) ) THEN
+c               xxend = xf + (xx-x1)
+c               CALL nobsxytv (obs_only, xxend, yy, tt, vv, nx, ny, nt, 
+c     .              x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+c            ENDIF
+                     
+c            IF ((xf-xx .GE. 0.)  .AND. (xf-xx .LT. dx) ) THEN
+c               xxbeg = x1 - (xf-xx)
+c               CALL nobsxytv (obs_only, xxbeg, yy, tt, vv, nx, ny, nt, 
+c     .              x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+c            ENDIF
+c         ENDIF
+
+ 300     CONTINUE
+
+* Get data from the last cruise
+	    
+      DO L = indx(4,1), indx(4,2)
+      DO j = indx(2,1), indx(2,2)
+      DO i = indx(1,1), indx(1,2)
+         IF (obs_only .EQ. 0) THEN
+            IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+               obs(i,j,1,L) = obs(i,j,1,L) + 
+     .                 obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+               obs(i,j,2,L) = obs(i,j,2,L) + 1.
+            ENDIF
+            obs_cruise(i,j,1,L) = 0.
+            obs_cruise(i,j,2,L) = 0.
+         ELSE
+            IF (obs_cruise(i,j,1,L) .GT. 0.) THEN
+               obs(i,j,1,L) = obs(i,j,1,L) + 1.
+            ENDIF
+               obs_cruise(i,j,1,L) = 0.
+         ENDIF
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Put gridded fcn into result variable.
+
+      IF (obs_only .EQ. 0) THEN
+         k = res_lo_ss(Z_AXIS)
+         L1 = 1
+         DO 420 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            j1 = 1
+            DO 410 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = 1
+               DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (obs(i1,j1,2,L1) .GT. 0.) THEN
+                     result(i,j,k,l) = obs(i1,j1,1,L1)/obs(i1,j1,2,L1)
+		  ELSE
+                     result(i,j,k,l) = bad_flag_result
+		  ENDIF
+
+                  i1 = i1 + 1
+ 400           CONTINUE
+               j1 = j1 + 1
+
+ 410        CONTINUE
+            L1 = L1 + 1
+ 420     CONTINUE
+
+      ELSE
+         k = res_lo_ss(Z_AXIS)
+         L1 = 1
+         DO 520 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            j1 = 1
+            DO 510 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = 1
+               DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  result(i,j,k,l) = obs(i1,j1,1,L1)
+                  i1 = i1 + 1
+ 500           CONTINUE
+               j1 = j1 + 1
+
+ 510        CONTINUE
+            l1 = l1 + 1
+ 520     CONTINUE
+
+      ENDIF
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. npts) THEN
+         WRITE (errtxt,20)
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+   20 FORMAT 
+     . ('Input scattered var,x,y,t,cruiseID have different # of points')
+
+   30 FORMAT ('No data in scattered x,y,t points')
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+
+
+
+      SUBROUTINE pickoutxytcv (obs_only, vars, alon, alat, atimes,
+     .   cruises, n, vv, xx, yy, tt, ncc)
+
+*  Called from the scatter* family of gridding functions.
+*  Pick out nth item from a set of arrays, which are really 
+*  4-dimensioned arrays with normal axes on three of the four axes.
+
+      REAL alon(*), alat(*), atimes(*), cruises(*), vars(*)
+      REAL xx, yy, tt, vv
+      INTEGER obs_only, n, ncc
+
+      vv = 1.
+      IF (obs_only .EQ. 0) vv = vars(n)
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      ncc = cruises(n)
+
+      RETURN
+      END
+
+
diff --git a/external_functions/gridding/tracks2grid_std_xyt.F b/external_functions/gridding/tracks2grid_std_xyt.F
new file mode 100644
index 0000000..4df5e3f
--- /dev/null
+++ b/external_functions/gridding/tracks2grid_std_xyt.F
@@ -0,0 +1,897 @@
+*
+*  tracks2grid_std_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* October 2010 from tracks2grid_ave_xyt.F
+*
+* This is the description of the averaging function.
+* The input data points are not a simple scatter.  They are cruise tracks 
+* strung one after another.  (Each track will be a contiguous block of points 
+* in the input data arrays.)  And the subtlety is that each cruise needs to 
+* receive the same weight when determining the average for a cell, rather than 
+* each individual data point.  Which means effectively that you need to have 
+* two averaging processes.  You need to have a buffer (the individual cruise 
+* buffer) that is the size and shape of the output grid in which you average 
+* each individual cruise.  And then when the final point of each cruise from 
+* the input data is encountered, you need to add (average) the points from the 
+* individual cruise buffer into the output buffer, re-zeroing the individual 
+* cruise buffer as you do so, so it is ready to average the next cruise. 
+*
+* This function will return the std for the averages, based on weighted means,
+* for small samples, http://wapedia.mobi/en/Weighted_mean#6. and
+* http://wapedia.mobi/en/Weighted_mean#7.
+* 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  tracks2grid_std_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Weighted std by cruise, when gridding scattered ',
+     .        'data to XYT grid')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .        IMPLIED_BY_ARGS, NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 8)
+
+* Output grid is determined by arguments 4, 5, 6, the result's x, y, t axes. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VARIABLE')
+      CALL ef_set_arg_desc(id, arg, 'Variable at scattered input XYT.')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input triples')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ICRUISE')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Cruise ID at scattered input locations')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 20)
+   20 FORMAT ('T axis coordinates, of a regular output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tracks2grid_std_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG6) - arg_lo_ss(X_AXIS,ARG6)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG7) - arg_lo_ss(Y_AXIS,ARG7)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG8) - arg_lo_ss(T_AXIS,ARG8)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* Tax  output t axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* obs_cruise  work array - sum and counts of observations per cruise
+* x,y,t direction: output grid
+* z direction: 1..3
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, 
+     .                             nxout, nyout, 3, ntout)
+
+* cell_avg  work array - work array - sum and counts over cruises for cell average
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+* wi_sums k=1, sum of cruiseweight wi = sum of obs in the cells
+* x,y,t direction: output grid
+* z direction: 1
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, 
+     .                             nxout, nyout, 1, ntout)
+
+* cruisemean saving individual weighted cruise means. 
+* for computing s^2  sum of wi*(xi - weighted_mean)**2
+* x,y,t direction: output grid
+* z direction: 30 (max cruises per cell?)
+      CALL ef_set_work_array_dims (id, 7, 1, 1, 1, 1, 
+     .                             nxout, nyout, 30, ntout)
+
+* cruiseweight saving individual cruiseweight. 
+* for computing s^2  sum of wi*(xi - weighted_mean)**2
+* x,y,t direction: output grid
+* z direction: 30 (max cruises per cell?)
+      CALL ef_set_work_array_dims (id, 8, 1, 1, 1, 1, 
+     .                             nxout, nyout, 30, ntout)
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE tracks2grid_std_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xax, yax, tax, 
+     .     obs_cruise, cell_avg, wi_sums, cruisemean, cruiseweight)
+
+*  arg_1  var
+*  arg_2  xpts  \
+*  arg_3  ypts   | Scattered x,y triples to be gridded.
+*  arg_4  tpts  / 
+*  arg_5  icruise
+*
+*  arg_6  xaxis of new grid   
+*  arg_7  yaxis of new grid
+*  arg_8  taxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .     mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, 
+     .     mem6loz:mem6hiz, mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, 
+     .     mem7loz:mem7hiz, mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, 
+     .     mem9loz:mem9hiz, mem9lot:mem9hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i6,j7,L8,i6n,j7n,L8n
+
+      INTEGER nxpts, npts
+      INTEGER nx, ny, nt
+      INTEGER i1, i2, i1n, i2n
+      INTEGER obs_only, icruise, ncc, nc_cell, nk
+
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt, vv
+
+
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+      REAL cellmean, wt_cruise_mean, unwtd_mean,
+     .     wsumsq_ijl, wsumsq, diffsum, wtcruise, wtsq
+
+      REAL*8 xax1,xaxf, yax1,yaxf, tax1,taxf
+      INTEGER indx(4,2)
+
+*  Dimension the work arrays
+
+      REAL*8 xax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yax(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 tax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL obs_cruise(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL cell_avg(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL wi_sums(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      REAL cruisemean(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz, wrk7lot:wrk7hit)
+      REAL cruiseweight(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .               wrk8loz:wrk8hiz, wrk8lot:wrk8hit)
+
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulox(4), moduloy(4), modulot(4), regular(4)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      obs_only = 0	! Compute the std for average of variable (e.g. fco2)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 6, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+      CALL ef_get_axis_info (id, 7, ax_name, ax_units, backward, 
+     .                       moduloy, regular)
+      CALL ef_get_axis_info (id, 8, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG2)
+            i1n = arg_hi_ss(m,ARG2)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+            IF (nxpts .EQ. 0) GOTO 900
+         ENDIF
+ 100  CONTINUE
+
+      npts = 1
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG1)
+            i2n = arg_hi_ss(m,ARG1)
+            npts = 1 + (i2n - i2)
+            IF (npts.NE.nxpts) GOTO 900
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 120  CONTINUE
+
+      DO 130 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG4) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG4)
+            i2n = arg_hi_ss(m,ARG4)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 130  CONTINUE
+
+      DO 140 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG5) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG5)
+            i2n = arg_hi_ss(m,ARG5)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 140  CONTINUE
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i6 = ef_unspecified_int4
+      j7 = ef_unspecified_int4
+      L8 = ef_unspecified_int4
+
+      i6 = arg_lo_ss(X_AXIS,ARG6)
+      i6n = arg_hi_ss(X_AXIS,ARG6)
+
+      j7 = arg_lo_ss(Y_AXIS,ARG7)
+      j7n = arg_hi_ss(Y_AXIS,ARG7)
+
+      L8 = arg_lo_ss(T_AXIS,ARG8)
+      L8n = arg_hi_ss(T_AXIS,ARG8)
+
+      nx = 1 + (i6n - i6)
+      ny = 1 + (j7n - j7)
+      nt = 1 + (L8n - L8)
+
+*  Check that xax is a X axis and yax a Y axis
+
+      IF (i6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a X axis'
+         GO TO 999
+      ENDIF
+      IF (j7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (L8 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Eighth argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax)
+
+      call ef_get_coordinates(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax)
+
+      call ef_get_coordinates(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax)
+
+*  Set start, end, and delta for output axes. 
+
+      x1 = xax(1,1,1,1)
+      y1 = yax(1,1,1,1)
+      t1 = tax(1,1,1,1)
+
+      xf = xax(nx,1,1,1)
+      yf = yax(ny,1,1,1)
+      tf = tax(nt,1,1,1)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF (nx .GT. 1) dx = (xf-x1)/ REAL(nx-1)
+      dy = yf - y1
+      IF (ny .GT. 1) dy = (yf-y1)/ REAL(ny-1) 
+      dt = tf - t1
+      IF (nt .GT. 1) dt = (tf-t1)/ REAL(nt-1) 
+
+      IF (nx .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax1,xaxf)
+         dx = xaxf - xax1
+      ENDIF
+      IF (ny .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax1,yaxf)
+         dy = yaxf - yax1
+      ENDIF
+         IF (nt .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax1,taxf)
+         tx = taxf - tax1
+      ENDIF
+
+*  Compute result
+
+*  Initialize counts.
+
+      DO L = 1, nt
+      DO k = 1, 2
+      DO j = 1, ny
+      DO i = 1, nx
+         cell_avg(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, 3
+      DO j = 1, ny
+      DO i = 1, nx
+         obs_cruise(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, 1
+      DO j = 1, ny
+      DO i = 1, nx
+         wi_sums(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, wrk7hiz
+      DO j = 1, ny
+      DO i = 1, nx
+         cruisemean(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, wrk7hiz
+      DO j = 1, ny
+      DO i = 1, nx
+         cruiseweight(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted 
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+      n = 1
+      CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+      icruise = ncc
+
+* For each cruise keep track of the index range it spans in the result grid
+* Then at the end of the cruise need only to process that subset of the grid.
+      indx(1,1) = nx
+      indx(1,2) = 1
+      indx(2,1) = ny
+      indx(2,2) = 1
+      indx(4,1) = nt
+      indx(4,2) = 1
+
+      icstart = 1
+      DO 300 n = 1, nscat
+
+         CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+         IF (vv .EQ. bad_flag(ARG1) .OR. xx .EQ. bad_flag(ARG2) .OR. 
+     .          yy .EQ. bad_flag(ARG3) .OR. tt .EQ. bad_flag(ARG4) ) GOTO 300
+
+* We have come to the end of a cruise loop over cells represented by the last cruise,
+* summing and counting the observations in the cruise, computing cruiseweight. 
+* cruisemean is weighted cruise mean in cell
+* cruiseweight are variances for cruise mean in cell
+* cell_avg(i,j,1,L) cruise mean averaged over cruises in cell
+* cell_avg(i,j,2,L) is count of cruises in cell
+* wi_sums(i,j,1,L) sum of cruiseweight wi in cell
+
+         IF (ncc .NE. icruise) THEN  
+	    icend = n-1
+
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+
+	       IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+
+                  wt_cruise_mean = obs_cruise(i,j,1,L)/obs_cruise(i,j,3,L)
+
+                  unwtd_mean = obs_cruise(i,j,1,L) ! nobsxytv_var returns mean already computed
+
+                  cell_avg(i,j,1,L) = cell_avg(i,j,1,L) + wt_cruise_mean
+                  cell_avg(i,j,2,L) = cell_avg(i,j,2,L) + 1.  
+
+		  wi_sums(i,j,1,l) = wi_sums(i,j,1,l) + 1./obs_cruise(i,j,3,L)
+
+		  nc_cell = cell_avg(i,j,2,L)
+		  IF (nc_cell .GT. wrk7hiz) THEN
+                     print *, 'Num_obs in cell at I,J,L = ', i,j,L, 
+     .               ' is', nc_cell
+		     CALL ef_bail_out (id,
+     .      'too many cruises in cell. increase K size of work array 7,8')
+		  ENDIF
+
+		  cruisemean(i,j,nc_cell,l) = unwtd_mean
+		  cruiseweight(i,j,nc_cell,l) = 1./obs_cruise(i,j,3,L)
+
+	       ENDIF
+
+
+            ENDDO
+            ENDDO
+            ENDDO
+
+	    icruise = ncc
+
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+	       obs_cruise(i,j,1,L) = 0.
+	       obs_cruise(i,j,2,L) = 0.
+	       obs_cruise(i,j,3,L) = 0.
+            ENDDO
+            ENDDO
+            ENDDO
+
+* reset indices
+            indx(1,1) = nx
+            indx(1,2) = 1
+            indx(2,1) = ny
+            indx(2,2) = 1
+            indx(4,1) = nt
+            indx(4,2) = 1
+
+	 ENDIF
+
+*  Count and add up observations in each cell, in this cruise. 
+     
+         CALL nobsxytv_var (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .           x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise)
+
+ 300  CONTINUE
+
+* Get data from the last cruise
+
+      icend = n-1
+
+      DO L = indx(4,1), indx(4,2)
+         DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+
+	       IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+
+                  wt_cruise_mean = obs_cruise(i,j,1,L)/obs_cruise(i,j,3,L)
+
+                  unwtd_mean = obs_cruise(i,j,1,L) ! nobsxytv_var returns mean already computed
+
+                  cell_avg(i,j,1,L) = cell_avg(i,j,1,L) + wt_cruise_mean
+                  cell_avg(i,j,2,L) = cell_avg(i,j,2,L) + 1.  
+
+		  wi_sums(i,j,1,l) = wi_sums(i,j,1,l) + 1./obs_cruise(i,j,3,L)
+
+		  nc_cell = cell_avg(i,j,2,L)
+		  IF (nc_cell .GT. wrk7hiz) THEN
+                     print *, 'Num_obs in cell at I,J,L = ', i,j,L, 
+     .               ' is', nc_cell
+		     CALL ef_bail_out (id,
+     .      'too many cruises in cell. increase K size of work array 7,8')
+		  ENDIF
+
+		  cruisemean(i,j,nc_cell,l) = unwtd_mean
+		  cruiseweight(i,j,nc_cell,l) = 1./obs_cruise(i,j,3,L)
+
+	       ENDIF
+
+            ENDDO
+         ENDDO
+      ENDDO
+      
+*  Put gridded fcn into result variable.
+* wi_sums(i,j,1,L) sum of cruiseweight wi in cell
+* V1 sum of cruiseweight
+* V2 sum of cruiseweight squared
+* for s^2  wsumsq sum of wi*(xi - weighted_mean)**2
+
+      k = res_lo_ss(Z_AXIS)
+      DO 420 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 410 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               nc_cell = cell_avg(i,j,2,L)
+
+               IF (nc_cell .EQ. 0) THEN
+                   result(i,j,k,l) = bad_flag_result
+                   result(i,j,2,l) = bad_flag_result
+               ELSE IF (nc_cell .EQ. 1) THEN
+                   result(i,j,k,l) = 0.
+                   result(i,j,2,l) = wi_sums(i,j,1,L)
+
+* Compute sum of (cruise-cell-averages - weighted cell mean) squared\
+
+               ELSE IF (nc_cell .GT. 1) THEN
+
+                  cellmean = cell_avg(i,j,1,L)/wi_sums(i,j,1,l)
+
+                  wsumsq_ijl = 0.
+                  wsumsq = 0.
+		  v1 = 0.
+                  DO 500, nk = 1, nc_cell
+                      wtcruise = cruiseweight(i,j,nk,L)
+		      unwtd_mean = cruisemean(i,j,nk,L)
+
+		      wtsq = wtcruise*wtcruise
+		      wsumsq = wsumsq + wtsq  
+
+* Sum the squares of difference of unweighted cruise means 
+* minus weighted cell mean
+
+		      diffsum = unwtd_mean - cellmean
+                      wsumsq_ijl = wsumsq_ijl + wtcruise*(diffsum)**2
+
+ 500              CONTINUE
+                  V1 = wi_sums(i,j,1,l)
+                  V2 = wsumsq
+                  denom = V1*V1 - V2
+		  
+                  IF (ABS(denom) .GT. 1.e-6) THEN
+                     result(i,j,k,l) = SQRT(wsumsq_ijl* V1/denom)
+                  ELSE
+                     result(i,j,k,l) = bad_flag_result
+                  ENDIF
+	       ENDIF
+
+ 400        CONTINUE
+
+ 410     CONTINUE
+ 420  CONTINUE
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. npts) THEN
+         WRITE (errtxt,20)
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+   20 FORMAT 
+     . ('Input scattered var,x,y,t,cruiseID have different # of points')
+
+   30 FORMAT ('No data in scattered x,y,t points')
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+      SUBROUTINE pickoutxytcv (obs_only, vars, alon, alat, atimes,
+     .   cruises, n, vv, xx, yy, tt, ncc)
+
+*  Called from the scatter* family of gridding functions.
+*  Pick out nth item from a set of arrays, which are really 
+*  4-dimensioned arrays with normal axes on three of the four axes.
+
+      REAL alon(*), alat(*), atimes(*), cruises(*), vars(*)
+      REAL xx, yy, tt, vv
+      INTEGER obs_only, n, ncc
+
+      vv = 1.
+      IF (obs_only .EQ. 0) vv = vars(n)
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      ncc = cruises(n)
+
+      RETURN
+      END
+
+
+
+c***********************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c this version returns the cell mean in obs(ig,jg,1,Lg)
+c this version returns the cell variance in obs(ig,jg,3,Lg)
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	nx,ny,nt=size of grids
+c  i	x1,y1,L1=west/south/earliest edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny,nt) number of obs in each (x,y,t) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobsxytv_var (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .             x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny, nt, obs_only, indx(4,2)
+	REAL xx, yy, tt, vv, x1, y1, t1, dx, dy, dt, xf, 
+     .       yf, tf, obs(nx,ny,3,nt)
+
+* Local variable declarations
+
+        REAL xxg, yyg, ttg
+        INTEGER ig, jg, Lg ! !!!!!!!!!!!!!!!!!!!!!!!! adding t dimension throughtout
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+	ttg = (tt-t1)/ dt + 1.
+
+c.................sum the value and count in each (x,y,t) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	Lg = NINT(ttg)
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (lg.LT.1 .OR. lg.GT.nt) RETURN
+
+* See below for def of algorithm, mean, delta, M2
+
+	IF (obs_only .EQ. 0) THEN
+           IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .       Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs(ig,jg,2,Lg) = obs(ig,jg,2,Lg) + 1.	! count
+		delta = vv - obs(ig,jg,1,Lg)
+		obs(ig,jg,1,Lg) = obs(ig,jg,1,Lg) + delta/obs(ig,jg,2,Lg) ! current est of mean
+		obs(ig,jg,3,Lg) = obs(ig,jg,3,Lg) - delta*(vv - obs(ig,jg,1,Lg)) !M2
+	   ENDIF
+	ELSE
+	   IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .      Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs(ig,jg,1,Lg) = obs(ig,jg,1,Lg) + 1.
+	   ENDIF
+	ENDIF
+
+* Store the min and max index used in this cruise
+	indx(1,1) = MIN(indx(1,1), ig)
+	indx(1,2) = MAX(indx(1,2), ig)
+	indx(2,1) = MIN(indx(2,1), jg)
+	indx(2,2) = MAX(indx(2,2), jg)
+	indx(4,1) = MIN(indx(4,1), Lg)
+	indx(4,2) = MAX(indx(4,2), Lg)
+
+	RETURN
+	END
+
+
+
+
+
+c ----------------
+c http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm
+c def online_variance(data):
+c     n = 0
+c     mean = 0
+c     M2 = 0
+c 
+c     for x in data:
+c         n = n + 1
+c         delta = x - mean
+c         mean = mean + delta/n
+c         M2 = M2 + delta*(x - mean)  # This expression uses the new value of mean
+c 
+c     variance_n = M2/n
+c     variance = M2/(n - 1)
+c     return variance
+c ------------------
diff --git a/external_functions/gridding/tracks2grid_var_xyt.F b/external_functions/gridding/tracks2grid_var_xyt.F
new file mode 100644
index 0000000..a985d93
--- /dev/null
+++ b/external_functions/gridding/tracks2grid_var_xyt.F
@@ -0,0 +1,942 @@
+*
+*  tracks2grid_var_xyt.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* October 2010 from tracks2grid_ave_xyt.F
+*
+* This is the description of the averaging function.
+* The input data points are not a simple scatter.  They are cruise tracks 
+* strung one after another.  (Each track will be a contiguous block of points 
+* in the input data arrays.)  And the subtlety is that each cruise needs to 
+* receive the same weight when determining the average for a cell, rather than 
+* each individual data point.  Which means effectively that you need to have 
+* two averaging processes.  You need to have a buffer (the individual cruise 
+* buffer) that is the size and shape of the output grid in which you average 
+* each individual cruise.  And then when the final point of each cruise from 
+* the input data is encountered, you need to add (average) the points from the 
+* individual cruise buffer into the output buffer, re-zeroing the individual 
+* cruise buffer as you do so, so it is ready to average the next cruise. 
+*
+* This function will return the variance for the averages, based on weighted means,
+* for small samples, http://wapedia.mobi/en/Weighted_mean#7.
+* 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  tracks2grid_var_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*126 buff
+      WRITE (buff, 10)
+   10 FORMAT ('Weighted variance by cruise, when gridding scattered ',
+     .        'data to XYT grid. K=2, average cell span, cruises in cell')
+      CALL ef_set_desc(id, buff)
+
+      CALL ef_set_num_args(id, 8)
+c      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+c     .        IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .        IMPLIED_BY_ARGS, NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 9)
+
+* Output grid is determined by arguments 4, 5, 6, the result's x, y, t axes. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'Variable at scattered input XYT.')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'X coordinates of scattered input triples')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Y coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'T coordinates of scattered input triples')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ICRUISE')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Cruise ID at scattered input locations')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .                   'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      WRITE (buff, 20)
+   20 FORMAT ('T axis coordinates, of a regular output grid, with same ',
+     .       'units and origin as tpts')
+      CALL ef_set_arg_desc(id, arg, buff)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, YES)
+
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+c*
+c* In this subroutine we provide information about the lo and hi
+c* limits associated with each abstract or custom axis.   The user 
+c* configurable information consists of the following:
+c*
+c* lo_ss               lo subscript for an axis
+c*
+c* hi_ss               hi subscript for an axis
+c*
+c
+c      SUBROUTINE tracks2grid_var_xyt_result_limits(id)
+c
+c      INCLUDE 'ferret_cmn/EF_Util.cmn'
+c      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+c
+c      INTEGER id
+c
+c* **********************************************************************
+c*                                           USER CONFIGURABLE PORTION |
+c*                                                                     |
+c*                                                                     V
+c
+c
+c      CALL ef_set_axis_limits(id, Z_AXIS, 1, 2)
+c*                                                                     ^
+c*                                                                     |
+c*                                           USER CONFIGURABLE PORTION |
+c* **********************************************************************
+c
+c      RETURN 
+c      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tracks2grid_var_xyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG6) - arg_lo_ss(X_AXIS,ARG6)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG7) - arg_lo_ss(Y_AXIS,ARG7)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG8) - arg_lo_ss(T_AXIS,ARG8)
+
+      nx2 = nxout* 2
+      ny2 = nyout* 2
+      nt2 = ntout* 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx2, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, ny2, 1, 1, 1)
+
+* Tax  output t axis
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+* obs_cruise  work array - sum and counts of observations per cruise
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+* cell_avg  work array - work array - sum and counts over cruises for cell average
+* x,y,t direction: output grid
+* z direction: 1..2
+      CALL ef_set_work_array_dims (id, 5, 1, 1, 1, 1, 
+     .                             nxout, nyout, 2, ntout)
+
+* wi_sums k=1, sum of weights wi = sum of obs in the cells
+* x,y,t direction: output grid
+* z direction: 1
+      CALL ef_set_work_array_dims (id, 6, 1, 1, 1, 1, 
+     .                             nxout, nyout, 1, ntout)
+
+* cruisespan getting the min and max lon/lat for computing
+* the span of a cruise in each cell. 
+      CALL ef_set_work_array_dims (id, 7, 1, 1, 1, 1, 
+     .                             nxout, nyout, 4, ntout)
+
+* cruisemean saving individual weighted cruise means. 
+* for computing s^2  sum of wi*(xi - weighted_mean)**2
+* x,y,t direction: output grid
+* z direction: 30 (max cruises per cell?)
+      CALL ef_set_work_array_dims (id, 8, 1, 1, 1, 1, 
+     .                             nxout, nyout, 30, ntout)
+
+* span
+* for arc length for cruises in grid cell.
+* x,y,t direction: output grid
+* z direction: 30 (max cruises per cell?)
+      CALL ef_set_work_array_dims (id, 9, 1, 1, 1, 1, 
+     .                             nxout, nyout, 30, ntout)
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE tracks2grid_var_xyt_compute(id, arg_1, arg_2, arg_3, 
+     .     arg_4, arg_5, arg_6, arg_7, arg_8, result, xax, yax, tax, 
+     .     obs_cruise, cell_avg, wi_sums, cruisespan, cruisemean, span)
+
+*  arg_1  var
+*  arg_2  xpts  \
+*  arg_3  ypts   | Scattered x,y triples to be gridded.
+*  arg_4  tpts  / 
+*  arg_5  icruise
+*
+*  arg_6  xaxis of new grid   
+*  arg_7  yaxis of new grid
+*  arg_8  taxis of new grid
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .     mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .     mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, 
+     .     mem6loz:mem6hiz, mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, 
+     .     mem7loz:mem7hiz, mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, 
+     .     mem8loz:mem8hiz, mem8lot:mem8hit)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, 
+     .     mem9loz:mem9hiz, mem9lot:mem9hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i6,j7,L8,i6n,j7n,L8n
+
+      INTEGER nxpts, npts
+      INTEGER nx, ny, nt
+      INTEGER i1, i2, i1n, i2n
+      INTEGER obs_only, icruise, ncc, nc_cell, nk
+
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt, vv
+
+
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+      REAL spansq, cellspan, cellmean, wt_cruise_mean, unwtd_mean,
+     .     wsumsq_ijl, wsumsq, diffsum
+
+      REAL*8 xax1,xaxf, yax1,yaxf, tax1,taxf
+      INTEGER indx(4,2)
+
+*  Dimension the work arrays
+
+      REAL*8 xax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yax(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 tax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL obs_cruise(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL cell_avg(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL wi_sums(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      REAL cruisespan(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz, wrk7lot:wrk7hit)
+      REAL cruisemean(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .               wrk8loz:wrk8hiz, wrk8lot:wrk8hit)
+      REAL span(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .               wrk9loz:wrk9hiz, wrk9lot:wrk9hit)
+
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulox(4), moduloy(4), modulot(4), regular(4)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      obs_only = 0	! Compute the variance for average of variable (e.g. fco2)
+
+*  Check to see if output axes are modulo
+
+      CALL ef_get_axis_info (id, 6, ax_name, ax_units, backward, 
+     .                       modulox, regular)
+      CALL ef_get_axis_info (id, 7, ax_name, ax_units, backward, 
+     .                       moduloy, regular)
+      CALL ef_get_axis_info (id, 8, ax_name, ax_units, backward, 
+     .                       modulot, regular)
+
+*  Find number of points in scattered input points.  1-D arrays defining the 
+*  scattered data points may lie on the X, Y, Z, or T axis of the input arguments.
+
+      nxpts = 0
+
+      DO 100 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG2) .GE. 1) THEN
+            i1 = arg_lo_ss(m,ARG2)
+            i1n = arg_hi_ss(m,ARG2)
+            if (i1n-i1 .NE. 0) nxpts = 1 + (i1n - i1)
+            IF (nxpts .EQ. 0) GOTO 900
+         ENDIF
+ 100  CONTINUE
+
+      npts = 1
+      DO 110 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG1) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG1)
+            i2n = arg_hi_ss(m,ARG1)
+            npts = 1 + (i2n - i2)
+            IF (npts.NE.nxpts) GOTO 900
+         ENDIF
+ 110  CONTINUE
+
+      DO 120 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG3) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG3)
+            i2n = arg_hi_ss(m,ARG3)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 120  CONTINUE
+
+      DO 130 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG4) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG4)
+            i2n = arg_hi_ss(m,ARG4)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 130  CONTINUE
+
+      DO 140 m = X_AXIS, T_AXIS
+         IF (arg_lo_ss(m,ARG5) .GE. 1) THEN
+            i2 = arg_lo_ss(m,ARG5)
+            i2n = arg_hi_ss(m,ARG5)
+            npts = 1 + (i2n - i2)
+            IF (npts .NE. nxpts) GOTO 900
+         ENDIF
+ 140  CONTINUE
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      i6 = ef_unspecified_int4
+      j7 = ef_unspecified_int4
+      L8 = ef_unspecified_int4
+
+      i6 = arg_lo_ss(X_AXIS,ARG6)
+      i6n = arg_hi_ss(X_AXIS,ARG6)
+
+      j7 = arg_lo_ss(Y_AXIS,ARG7)
+      j7n = arg_hi_ss(Y_AXIS,ARG7)
+
+      L8 = arg_lo_ss(T_AXIS,ARG8)
+      L8n = arg_hi_ss(T_AXIS,ARG8)
+
+      nx = 1 + (i6n - i6)
+      ny = 1 + (j7n - j7)
+      nt = 1 + (L8n - L8)
+
+*  Check that xax is a X axis and yax a Y axis
+
+      IF (i6 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Sixth argument must be a X axis'
+         GO TO 999
+      ENDIF
+      IF (j7 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Seventh argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      IF (L8 .EQ. ef_unspecified_int4) THEN
+         WRITE (errtxt, *) 'Eighth argument must be a T axis'
+         GO TO 999
+      ENDIF
+
+C  Get coordinates of output axes.
+
+      call ef_get_coordinates(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax)
+
+      call ef_get_coordinates(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax)
+
+      call ef_get_coordinates(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax)
+
+*  Set start, end, and delta for output axes. 
+
+      x1 = xax(1,1,1,1)
+      y1 = yax(1,1,1,1)
+      t1 = tax(1,1,1,1)
+
+      xf = xax(nx,1,1,1)
+      yf = yax(ny,1,1,1)
+      tf = tax(nt,1,1,1)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF (nx .GT. 1) dx = (xf-x1)/ REAL(nx-1)
+      dy = yf - y1
+      IF (ny .GT. 1) dy = (yf-y1)/ REAL(ny-1) 
+      dt = tf - t1
+      IF (nt .GT. 1) dt = (tf-t1)/ REAL(nt-1) 
+
+      IF (nx .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG6, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG6), arg_hi_ss(X_AXIS, ARG6), xax1,xaxf)
+         dx = xaxf - xax1
+      ENDIF
+      IF (ny .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG7, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG7), arg_hi_ss(Y_AXIS, ARG7), yax1,yaxf)
+         dy = yaxf - yax1
+      ENDIF
+         IF (nt .EQ. 1) THEN 
+         CALL ef_get_box_limits(id, ARG8, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG8), arg_hi_ss(T_AXIS, ARG8), tax1,taxf)
+         tx = taxf - tax1
+      ENDIF
+
+*  Compute result
+
+*  Initialize counts.
+
+      DO L = 1, nt
+      DO k = 1, 2
+      DO j = 1, ny
+      DO i = 1, nx
+         cell_avg(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, 2
+      DO j = 1, ny
+      DO i = 1, nx
+         obs_cruise(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, 1
+      DO j = 1, ny
+      DO i = 1, nx
+         wi_sums(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, wrk8hiz
+      DO j = 1, ny
+      DO i = 1, nx
+         cruisemean(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO k = 1, wrk9hiz
+      DO j = 1, ny
+      DO i = 1, nx
+         span(i,j,k,L) = 0.
+      ENDDO
+      ENDDO
+      ENDDO
+      ENDDO
+
+      DO L = 1, nt
+      DO j = 1, ny
+      DO i = 1, nx
+         cruisespan(i,j,1,L) =  1000
+         cruisespan(i,j,2,L) = -1000.
+         cruisespan(i,j,3,L) =  1000.
+         cruisespan(i,j,4,L) = -1000.
+      ENDDO
+      ENDDO
+      ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted 
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z or T axis of ARG1 
+*  and ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+      n = 1
+      CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+      icruise = ncc
+
+* For each cruise keep track of the index range it spans in the result grid
+* Then at the end of the cruise need only to process that subset of the grid.
+      indx(1,1) = nx
+      indx(1,2) = 1
+      indx(2,1) = ny
+      indx(2,2) = 1
+      indx(4,1) = nt
+      indx(4,2) = 1
+
+      DO 300 n = 1, nscat
+
+         CALL pickoutxytcv (obs_only, arg_1, arg_2, arg_3, arg_4, arg_5,
+     .           n, vv, xx, yy, tt, ncc)
+         IF (vv .EQ. bad_flag(ARG1) .OR. xx .EQ. bad_flag(ARG2) .OR. 
+     .          yy .EQ. bad_flag(ARG3) .OR. tt .EQ. bad_flag(ARG4) ) GOTO 300
+
+* We have come to the end of a cruise loop over cells represented by the last cruise,
+* summing and counting the observations in the cruise, computing weights. 
+* weights are span of cruise across cell
+* cruisemean is weighted cruise mean in cell
+* cell_avg(i,j,1,L) weighted cruise mean averaged over cruises in cell
+* cell_avg(i,j,2,L) is count of cruises in cell
+* wi_sums(i,j,1,L) sum of weights wi in cell
+
+         IF (ncc .NE. icruise) THEN  
+	    icend = n-1
+
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+
+
+	       IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+                  spansq = (cruisespan(i,j,2,l)-cruisespan(i,j,1,l))**2 +
+     .                     (cruisespan(i,j,4,l)-cruisespan(i,j,3,l))**2
+                  cellspan = SQRT(spansq)
+
+                  wt_cruise_mean = cellspan*
+     .                obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+                  unwtd_mean = obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+
+                  cell_avg(i,j,1,L) = cell_avg(i,j,1,L) + wt_cruise_mean
+                  cell_avg(i,j,2,L) = cell_avg(i,j,2,L) + 1.  
+
+		  wi_sums(i,j,1,l) = wi_sums(i,j,1,l) + cellspan
+
+		  nc_cell = cell_avg(i,j,2,L)
+		  IF (nc_cell .GT. wrk8hiz) THEN
+                     print *, 'Num_obs in cell at I,J,L = ', i,j,L, 
+     .               ' is', nc_cell
+		     CALL ef_bail_out (id,
+     .      'too many cruises in cell. increase K size of work arrays 8,9')
+		  ENDIF
+
+		  cruisemean(i,j,nc_cell,l) = unwtd_mean
+		  span(i,j,nc_cell,l) = cellspan
+
+	       ENDIF
+
+
+            ENDDO
+            ENDDO
+            ENDDO
+
+	    icruise = ncc
+
+            DO L = indx(4,1), indx(4,2)
+            DO j = indx(2,1), indx(2,2)
+            DO i = indx(1,1), indx(1,2)
+	       obs_cruise(i,j,1,L) = 0.
+	       obs_cruise(i,j,2,L) = 0.
+            ENDDO
+            ENDDO
+            ENDDO
+
+* reset indices
+            indx(1,1) = nx
+            indx(1,2) = 1
+            indx(2,1) = ny
+            indx(2,2) = 1
+            indx(4,1) = nt
+            indx(4,2) = 1
+
+	 ENDIF
+
+*  Count and add up observations in each cell, in this cruise. Span computes the arc
+*  length of the current cruise.
+
+         CALL nobsxytv_span (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .           x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise,
+     .           cruisespan)
+
+ 300  CONTINUE
+
+* Get data from the last cruise
+
+      icend = n-1
+
+      DO L = indx(4,1), indx(4,2)
+      DO j = indx(2,1), indx(2,2)
+      DO i = indx(1,1), indx(1,2)
+
+	       IF (obs_cruise(i,j,2,L) .GT. 0.) THEN
+                  spansq = (cruisespan(i,j,2,l)-cruisespan(i,j,1,l))**2 +
+     .                     (cruisespan(i,j,4,l)-cruisespan(i,j,3,l))**2
+                  cellspan = SQRT(spansq)
+
+                  wt_cruise_mean = cellspan*
+     .                obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+                  unwtd_mean = obs_cruise(i,j,1,L)/obs_cruise(i,j,2,L)
+
+                  cell_avg(i,j,1,L) = cell_avg(i,j,1,L) + wt_cruise_mean
+                  cell_avg(i,j,2,L) = cell_avg(i,j,2,L) + 1.  
+
+		  wi_sums(i,j,1,l) = wi_sums(i,j,1,l) + cellspan
+
+		  nc_cell = cell_avg(i,j,2,L)
+		  IF (nc_cell .GT. wrk8hiz) THEN
+                     print *, 'Num_obs in cell at I,J,L = ', i,j,L, 
+     .               ' is', nc_cell
+		     CALL ef_bail_out (id,
+     .      'too many cruises in cell. increase K size of work arrays 8,9')
+		  ENDIF
+
+		  cruisemean(i,j,nc_cell,l) = unwtd_mean
+		  span(i,j,nc_cell,l) = cellspan
+
+	       ENDIF
+
+      ENDDO
+      ENDDO
+      ENDDO
+      
+*  Put gridded fcn into result variable.
+* wi_sums(i,j,1,L) sum of weights wi in cell
+* V1 sum of weights
+* V2 sum of weights squared
+* for s^2  wsumsq sum of wi*(xi - weighted_mean)**2
+
+      k = res_lo_ss(Z_AXIS)
+      DO 420 L = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 410 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               nc_cell = cell_avg(i,j,2,L)
+
+               IF (nc_cell .EQ. 0) THEN
+                   result(i,j,k,l) = bad_flag_result
+c                   result(i,j,2,l) = bad_flag_result
+               ELSE IF (nc_cell .EQ. 1) THEN
+                   result(i,j,k,l) = 0.
+c                   result(i,j,2,l) = span(i,j,1,L)
+
+* Compute sum of (cruise-cell-averages - weighted cell mean) squared\
+
+               ELSE IF (nc_cell .GT. 1) THEN
+
+                  cellmean = cell_avg(i,j,1,L)/wi_sums(i,j,1,l)
+
+                  wsumsq_ijl = 0.
+                  wsumsq = 0.
+		  v1 = 0.
+                  DO 500, nk = 1, nc_cell
+                      cellspan = span(i,j,nk,L)
+		      unwtd_mean = cruisemean(i,j,nk,L)
+
+		      spansq = cellspan*cellspan
+		      wsumsq = wsumsq + spansq
+
+* Sum the squares of difference of unweighted cruise means 
+* minus weighted cell mean
+
+		      diffsum = unwtd_mean - cellmean
+                      wsumsq_ijl = wsumsq_ijl + cellspan*(diffsum)**2
+
+ 500              CONTINUE
+                  V1 = wi_sums(i,j,1,l)
+                  V2 = wsumsq
+                  denom = V1*V1 - V2
+		  
+                  IF (ABS(denom) .GT. 1.e-6) THEN
+                     result(i,j,k,l) = wsumsq_ijl* V1/denom
+c                     IF (wsumsq .GT. 0.) result(i,j,2,l) = sqrt(wsumsq)
+                  ELSE
+                     result(i,j,k,l) = bad_flag_result
+c                     result(i,j,2,l) = bad_flag_result
+                  ENDIF
+	       ENDIF
+
+ 400        CONTINUE
+
+ 410     CONTINUE
+ 420  CONTINUE
+
+      RETURN
+
+900   CONTINUE
+
+      IF (nxpts .NE. npts) THEN
+         WRITE (errtxt,20)
+      ELSE IF (nxpts .EQ. 0) THEN
+         WRITE (errtxt, 30)
+      ENDIF
+      GOTO 999 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+   20 FORMAT 
+     . ('Input scattered var,x,y,t,cruiseID have different # of points')
+
+   30 FORMAT ('No data in scattered x,y,t points')
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      END
+
+      SUBROUTINE pickoutxytcv (obs_only, vars, alon, alat, atimes,
+     .   cruises, n, vv, xx, yy, tt, ncc)
+
+*  Called from the scatter* family of gridding functions.
+*  Pick out nth item from a set of arrays, which are really 
+*  4-dimensioned arrays with normal axes on three of the four axes.
+
+      REAL alon(*), alat(*), atimes(*), cruises(*), vars(*)
+      REAL xx, yy, tt, vv
+      INTEGER obs_only, n, ncc
+
+      vv = 1.
+      IF (obs_only .EQ. 0) vv = vars(n)
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      ncc = cruises(n)
+
+      RETURN
+      END
+
+
+
+c***********************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	nx,ny,nt=size of grids
+c  i	x1,y1,L1=west/south/earliest edge of grid (center of 1st box in data units)
+c  o 	obs_cruise(nx,ny,nt) number of obs in each (x,y,t) gridbox
+c  o 	cellspan arc length for cruise in current xyt gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobsxytv_span (obs_only, xx, yy, tt, vv, nx, ny, nt, 
+     .             x1, y1, t1, dx, dy, dt, xf, yf, tf, indx, obs_cruise,
+     .             cruisespan)
+
+
+* Argument declarations
+
+        INTEGER nx, ny, nt, obs_only, indx(4,2)
+	REAL xx, yy, tt, vv, x1, y1, t1, dx, dy, dt, xf, 
+     .       yf, tf, obs_cruise(nx,ny,2,nt), cruisespan(nx,ny,4,nt)
+
+* Local variable declarations
+
+        REAL xxg, yyg, ttg
+        INTEGER ig, jg, Lg
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+	ttg = (tt-t1)/ dt + 1.
+
+c.................sum the value and count in each (x,y,t) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	Lg = NINT(ttg)
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (ig.LT.1 .OR. ig.GT.nx) RETURN
+	IF (lg.LT.1 .OR. lg.GT.nt) RETURN
+
+
+	IF (obs_only .EQ. 0) THEN
+           IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .       Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs_cruise(ig,jg,1,Lg) = obs_cruise(ig,jg,1,Lg) + vv
+     		obs_cruise(ig,jg,2,Lg) = obs_cruise(ig,jg,2,Lg) + 1.
+	   ENDIF
+	ELSE
+	   IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .      Lg.GE.1 .AND. Lg.LE.nt   ) THEN
+     		obs_cruise(ig,jg,1,Lg) = obs_cruise(ig,jg,1,Lg) + 1.
+	   ENDIF
+	ENDIF
+
+* Keep the min and max lon and lat, to use in computing the span of the
+* cruise in this grid cell.
+	IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .       Lg.GE.1 .AND. Lg.LE.nt ) THEN
+           cruisespan(ig,jg,1,Lg) = MIN(cruisespan(ig,jg,1,Lg), xx)
+           cruisespan(ig,jg,2,Lg) = MAX(cruisespan(ig,jg,2,Lg), xx)
+           cruisespan(ig,jg,3,Lg) = MIN(cruisespan(ig,jg,3,Lg), yy)
+           cruisespan(ig,jg,4,Lg) = MAX(cruisespan(ig,jg,4,Lg), yy)
+	ENDIF
+
+* Store the min and max index used in this cruise
+	indx(1,1) = MIN(indx(1,1), ig)
+	indx(1,2) = MAX(indx(1,2), ig)
+	indx(2,1) = MIN(indx(2,1), jg)
+	indx(2,2) = MAX(indx(2,2), jg)
+	indx(4,1) = MIN(indx(4,1), Lg)
+	indx(4,2) = MAX(indx(4,2), Lg)
+
+	RETURN
+	END
diff --git a/external_functions/hinterp/Makefile b/external_functions/hinterp/Makefile
new file mode 100644
index 0000000..e0e6f6c
--- /dev/null
+++ b/external_functions/hinterp/Makefile
@@ -0,0 +1,56 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	rect_to_curv.so curv_to_rect_map.so curv_to_rect.so curv_range.so
+all:	curv_to_rect_fsu.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/hinterp/curv_range.F b/external_functions/hinterp/curv_range.F
new file mode 100644
index 0000000..5473bea
--- /dev/null
+++ b/external_functions/hinterp/curv_range.F
@@ -0,0 +1,736 @@
+*
+* curv_range.F
+*
+* Ansley Manke
+* March 2005
+*
+* This function finds the indices of the bounding box for taking 
+* a subset of a variable defined on a curvilinear grid.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE curv_range_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*120 descr
+
+      WRITE (descr, 100)
+      CALL ef_set_desc(id, descr )
+
+  100 FORMAT (
+     . 'find i,j bounds for subset of a variable in curvilinear ',
+     . 'coordinates' )
+
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'LONGITUDES')
+      CALL ef_set_arg_desc(id, arg, 
+     .             '2-D longitudes of curvilinear grid')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'LATITUDES')
+      CALL ef_set_arg_desc(id, arg, 
+     .             '2-D latitudes of curvilinear grid')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'xrange_lo')
+      CALL ef_set_arg_desc(id, arg, 'Minimum of longitude range')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'xrange_hi')
+      CALL ef_set_arg_desc(id, arg, 'Maximum of longitude range')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'yrange_lo')
+      CALL ef_set_arg_desc(id, arg, 'Minimum of latitude range')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'yrange_hi')
+      CALL ef_set_arg_desc(id, arg, 'Maximum of latitude range')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'modulo flag for X coordinates')
+      CALL ef_set_arg_desc(id, arg, '1= X modulo; 0= X not modulo')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE curv_range_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, 4)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE curv_range_compute(id, arg_1, arg_2, 
+     .           arg_3, arg_4, arg_5, arg_6, arg_7, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .           mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, 
+     .           mem6loz:mem6hiz, mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, 
+     .           mem7loz:mem7hiz, mem7lot:mem7hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER ilo, ihi, jlo, jhi, nrep, irep
+      REAL small, xrange_lo, xrange_hi, yrange_lo, yrange_hi, xx, xxp, 
+     .     yy, yyp, big, xadd, xmin, xmax, xmin_field, xmax_field, 
+     .     ymin_field, ymax_field, xmod, xdiff_lo, xdiff_hi, ydiff_lo, 
+     .     ydiff_hi
+      LOGICAL xmodulo, found_range
+      CHARACTER*100 errmsg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 3
+      CALL ef_get_one_val(id, arg, xrange_lo)
+      arg = 4
+      CALL ef_get_one_val(id, arg, xrange_hi)
+      arg = 5
+      CALL ef_get_one_val(id, arg, yrange_lo)
+      arg = 6
+      CALL ef_get_one_val(id, arg, yrange_hi)
+      arg = 7
+      CALL ef_get_one_val(id, arg, xmod)
+      xmodulo = (xmod .GT. 0.)
+
+c curv_range_test
+c* Set the values to some particular ones, to see if this is the function being executed.
+c
+c      j = res_lo_ss(Y_AXIS)
+c      k = res_lo_ss(Z_AXIS)
+c      l = res_lo_ss(T_AXIS)
+c
+c      result(1,j,k,l) = 11
+c      result(2,j,k,l) = 22
+c      result(3,j,k,l) = 33
+c      result(4,j,k,l) = 44
+c      RETURN
+
+* See if the user asked for the whole range of arg_1 and arg_2 
+
+
+      big = MAX (1.e34, ABS(bad_flag(ARG1)) )
+      big = MAX (big, ABS(bad_flag(ARG2)) )
+      xmin_field = big
+      xmax_field = -1.* big
+      ymin_field = big
+      ymax_field = -1.* big
+      DO 53 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      DO 52 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 51 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 50 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      
+         xmin_field = MIN(xmin_field, arg_1(i,j,k,l))
+         xmax_field = MAX(xmax_field, arg_1(i,j,k,l))
+         ymin_field = MIN(ymin_field, arg_2(i,j,k,l))
+         ymax_field = MAX(ymax_field, arg_2(i,j,k,l))
+
+ 50   CONTINUE
+ 51   CONTINUE
+ 52   CONTINUE
+ 53   CONTINUE
+
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+! use the range of the data field to decide how much precision 
+! to require for **requested range equals the data range**
+
+      small = 0.01* (xmax_field - xmin_field)
+      small = MIN(small, 0.01* (ymax_field - ymin_field) )
+
+      IF (small .LE. 0) THEN  ! if x or y range is 0 use the other direction
+         small = 0.01* (xmax_field - xmin_field)
+         small = MAX(small, 0.01* (ymax_field - ymin_field) )
+      ENDIF
+
+      IF (small .LE. 0) small = 1.e-4
+
+      xdiff_lo = ABS(xmin_field - xrange_lo) 
+      xdiff_hi = ABS(xmax_field - xrange_hi) 
+      ydiff_lo = ABS(ymin_field - yrange_lo) 
+      ydiff_hi = ABS(ymax_field - yrange_hi) 
+
+      IF (xdiff_lo .LT. small .AND. ydiff_lo .LT. small  .AND.
+     .    xdiff_hi .LT. small .AND. ydiff_hi .LT. small) THEN 
+         result(1,j,k,l) = arg_lo_ss(X_AXIS, ARG1)
+         result(2,j,k,l) = arg_hi_ss(X_AXIS, ARG1)
+         result(3,j,k,l) = arg_lo_ss(Y_AXIS, ARG2)
+         result(4,j,k,l) = arg_hi_ss(Y_AXIS, ARG2)
+         RETURN
+      ENDIF
+
+      IF (ydiff_lo .LT. small .AND. ydiff_hi .LT. small .AND. 
+     .     xmodulo) THEN
+         nrep = NINT((xrange_lo-xmin_field)/360.)
+         xdiff_lo = ABS(xmin_field+360.*nrep - xrange_lo)
+         nrep = NINT((xrange_hi-xmax_field)/360.)
+         xdiff_hi = ABS(xmax_field+360.*nrep - xrange_hi)
+         IF (xdiff_lo .LT. small .AND. xdiff_hi .LT. small ) THEN
+            result(1,j,k,l) = arg_lo_ss(X_AXIS, ARG1)
+            result(2,j,k,l) = arg_hi_ss(X_AXIS, ARG1)
+            result(3,j,k,l) = arg_lo_ss(Y_AXIS, ARG2)
+            result(4,j,k,l) = arg_hi_ss(Y_AXIS, ARG2)
+            RETURN
+         ENDIF
+      ENDIF
+
+* If the requested range is larger than the data, return whole range
+
+      IF (.NOT. xmodulo) THEN  
+         IF (xrange_lo.LT.xmin_field .AND. xrange_hi.GT.xmax_field .AND.
+     .       yrange_lo.LT.ymin_field .AND. yrange_hi.GT.ymax_field)THEN
+            result(1,j,k,l) = arg_lo_ss(X_AXIS, ARG1)
+            result(2,j,k,l) = arg_hi_ss(X_AXIS, ARG1)
+            result(3,j,k,l) = arg_lo_ss(Y_AXIS, ARG2)
+            result(4,j,k,l) = arg_hi_ss(Y_AXIS, ARG2)
+            RETURN
+         ENDIF
+      ELSE
+
+* If x is to be treated as modulo, use the code below to determine the indices, but
+* if the Y range is larger than the data, use the data min and/or max for y range.
+         IF (yrange_lo .LT. ymin_field) yrange_lo = ymin_field
+         IF (yrange_hi .GT. ymax_field) yrange_hi = ymax_field
+      ENDIF
+
+
+
+* Find range of I,J for which arg_1 is in xrange_lo, xrange_hi
+* and arg_2 is in yrange_lo, yrange_hi
+
+      ilo = arg_hi_ss(X_AXIS, ARG1)
+      ihi = arg_lo_ss(X_AXIS, ARG1)
+      jlo = arg_hi_ss(Y_AXIS, ARG2)
+      jhi = arg_lo_ss(y_AXIS, ARG2)
+
+      big = ABS(bad_flag(ARG1) )
+      xmin = big
+      xmax = -1.* big
+      found_range = .FALSE.
+
+      DO 400 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      DO 300 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 200 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 100 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         xx = arg_1(i,j,k,l)
+         yy = arg_2(i,j,k,l)
+         IF ( xx .EQ. bad_flag(1) ) GOTO 5500
+         IF ( yy .EQ. bad_flag(2) ) GOTO 5500
+
+         IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .        yy .GE. yrange_lo  .AND. yy .LE. yrange_hi ) THEN
+            found_range = .TRUE.
+            ilo = MIN(i,ilo)
+            ihi = MAX(i,ihi)
+            jlo = MIN(j,jlo)
+            jhi = MAX(j,jhi)
+            xmin = MIN(xmin, xx)
+            xmax = MAX(xmin, xx)
+         ENDIF
+
+ 100  CONTINUE
+ 200  CONTINUE
+ 300  CONTINUE
+ 400  CONTINUE
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+      IF (.NOT. found_range .AND. 
+     .    xrange_lo.GE.xmin_field .AND. xrange_hi.LE.xmax_field .AND.
+     .    yrange_lo.GE.ymin_field .AND. yrange_hi.LE.ymax_field ) THEN
+     
+         ilo = arg_hi_ss(X_AXIS, ARG1)
+         ihi = arg_lo_ss(X_AXIS, ARG1)
+         jlo = arg_hi_ss(Y_AXIS, ARG2)
+         jhi = arg_lo_ss(y_AXIS, ARG2)
+
+         DO 401 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)-1
+         DO 301 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)-1
+         DO 201 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+         DO 101 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+            xx = arg_1(i,j,k,l)
+            xxp = arg_1(i+1,j,k,l)
+            yy = arg_2(i,j,k,l)
+            yyp = arg_2(i,j+1,k,l)
+
+            IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .           yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j+1, jhi)
+            ENDIF
+
+            IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .           xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i+1, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j, jhi)
+            ENDIF
+
+            IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .           yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i+1, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j+1, jhi)
+            ENDIF
+
+ 101     CONTINUE
+ 201     CONTINUE
+ 301     CONTINUE
+ 401     CONTINUE
+      ENDIF
+
+      IF (xmodulo) THEN
+         IF (xmin .EQ. big) xmin = xmin_field
+         IF (xmax .EQ. -1.*big) xmax = xmax_field
+ 
+* Does the range found cover the requested xrange_lo,xrange_hi range?
+* If not we will need some modulo repetitions.
+
+         IF (xmin .GT. xrange_lo) THEN
+            nrep = NINT((xmin-xrange_lo)/360)
+            xadd = 0.
+            DO 501 irep = 1, nrep
+               xadd = xadd - 360.
+
+* Previous loop found no overlap of x coordinates and desired output range.
+* start over with xmax, xmin find whole range
+
+               IF (xmin .GT. xrange_hi) THEN
+                  xmin =  big 
+                  xmax = -1. * big   
+               ENDIF
+     
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 402 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+               DO 302 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               DO 202 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+               DO 102 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l) + xadd
+                  yy = arg_2(i,j,k,l)
+
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi  .AND.
+     .                 yy .GE. yrange_lo  .AND. yy .GE. yrange_hi ) THEN
+                     found_range = .TRUE.
+                     ilo = MIN(i,ilo)
+                     ihi = MAX(i,ihi) 
+                     jlo = MIN(j,jlo)
+                     jhi = MAX(j,jhi) 
+                     xmin = MIN(xmin, xx)
+                     xmax = MAX(xmin, xx)
+                  ENDIF
+
+ 102           CONTINUE
+ 202           CONTINUE
+ 302           CONTINUE
+ 402           CONTINUE
+
+               IF (.NOT. found_range) THEN
+               
+                  ilo = arg_hi_ss(X_AXIS, ARG1)
+                  ihi = arg_lo_ss(X_AXIS, ARG1)
+                  jlo = arg_hi_ss(Y_AXIS, ARG2)
+                  jhi = arg_lo_ss(y_AXIS, ARG2)
+
+                  DO 403 i = arg_lo_ss(X_AXIS,ARG1), 
+     .               arg_hi_ss(X_AXIS,ARG1)-1
+                  DO 303 j = arg_lo_ss(Y_AXIS,ARG1), 
+     .               arg_hi_ss(Y_AXIS,ARG1)
+                  DO 203 k = arg_lo_ss(Z_AXIS,ARG1), 
+     .               arg_hi_ss(Z_AXIS,ARG1)
+                  DO 103 l = arg_lo_ss(T_AXIS,ARG1), 
+     .               arg_hi_ss(T_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l) + xadd
+                  xxp = arg_1(i+1,j,k,l) + xadd
+                  yy = arg_2(i,j,k,l)
+
+                  IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp  .AND.
+     .                 yy .GE. yrange_lo  .AND. yy .GE. yrange_hi ) THEN
+                     found_range = .TRUE.
+                     ilo = MIN(i,ilo)
+                     ihi = MAX(i+1,ihi) 
+                     jlo = MIN(j,jlo)
+                     jhi = MAX(j,jhi) 
+                     xmin = MIN(xmin, xx)
+                     xmax = MAX(xmin, xxp)
+                  ENDIF
+
+ 103              CONTINUE
+ 203              CONTINUE
+ 303              CONTINUE
+ 403              CONTINUE
+               ENDIF
+
+               IF (xmin .EQ. big) xmin = xmin_field + xadd
+               IF (xmax .EQ. -1.*big) xmax = xmax_field + xadd
+
+ 501        CONTINUE
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+            IF (.NOT. found_range .AND. 
+     .     xrange_lo.GE.xmin_field .AND. xrange_hi.LE.xmax_field .AND.
+     .     yrange_lo.GE.ymin_field .AND. yrange_hi.LE.ymax_field ) THEN
+                       
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 404 i =arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)-1
+               DO 304 j =arg_lo_ss(Y_AXIS,ARG1),arg_hi_ss(Y_AXIS,ARG1)-1
+               DO 204 k =arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+               DO 104 l =arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l)+xadd
+                  xxp = arg_1(i+1,j,k,l)+xadd
+                  yy = arg_2(i,j,k,l)
+                  yyp = arg_2(i,j+1,k,l)
+      
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .              yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j+1, jhi)
+                  ENDIF
+
+                  IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .                 xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j, jhi)
+                  ENDIF
+
+                  IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .                 yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                  ENDIF
+
+ 104           CONTINUE
+ 204           CONTINUE
+ 304           CONTINUE
+ 404           CONTINUE
+            ENDIF
+
+         ENDIF
+   
+         IF (xmax .LT. xrange_hi) THEN
+            nrep = NINT((xrange_hi-xmax)/360.)
+            xadd = 0.
+               DO 502 irep = 1, nrep
+               xadd = xadd + 360.
+
+* Previous loop found no overlap of x coordinates and desired output range.
+* start over with xmax, xmin find whole range
+
+               IF (xmax .LT. xrange_lo) THEN
+                  xmin =  big 
+                  xmax = -1. * big   
+               ENDIF
+
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 405 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+               DO 305 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               DO 205 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+               DO 105 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l) + xadd
+                  yy = arg_2(i,j,k,l)
+
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi  .AND.
+     .                 yy .GE. yrange_lo  .AND. yy .GE. yrange_hi ) THEN
+                     found_range = .TRUE.
+                     ilo = MIN(i,ilo)
+                     ihi = MAX(i,ihi) 
+                     jlo = MIN(j,jlo)
+                     jhi = MAX(j,jhi) 
+                     xmin = MIN(xmin, xx)
+                     xmax = MAX(xmin, xx)
+                  ENDIF
+
+ 105           CONTINUE
+ 205           CONTINUE
+ 305           CONTINUE
+ 405           CONTINUE
+ 
+               IF (.NOT. found_range) THEN
+               
+                  ilo = arg_hi_ss(X_AXIS, ARG1)
+                  ihi = arg_lo_ss(X_AXIS, ARG1)
+                  jlo = arg_hi_ss(Y_AXIS, ARG2)
+                  jhi = arg_lo_ss(y_AXIS, ARG2)
+
+                  DO 406 i = arg_lo_ss(X_AXIS,ARG1), 
+     .               arg_hi_ss(X_AXIS,ARG1)-1
+                  DO 306 j = arg_lo_ss(Y_AXIS,ARG1), 
+     .               arg_hi_ss(Y_AXIS,ARG1)
+                  DO 206 k = arg_lo_ss(Z_AXIS,ARG1), 
+     .               arg_hi_ss(Z_AXIS,ARG1)
+                  DO 106 l = arg_lo_ss(T_AXIS,ARG1), 
+     .               arg_hi_ss(T_AXIS,ARG1)
+
+                     xx = arg_1(i,j,k,l) + xadd
+                     xxp = arg_1(i+1,j,k,l) + xadd
+                     yy = arg_2(i,j,k,l)
+                     yyp = arg_2(i,j+1,k,l)
+
+                     IF ( xrange_lo.GE.xx .AND. xrange_hi.LT.xxp.AND.
+     .                    yrange_lo.GE.yy .AND. yrange_hi.LT.yyp ) THEN
+                        found_range = .TRUE.
+                        ilo = MIN(i,ilo)
+                        ihi = MAX(i+1,ihi) 
+                        jlo = MIN(j,jlo)
+                        jhi = MAX(j,jhi) 
+                        xmin = MIN(xmin, xx)
+                        xmax = MAX(xmin, xxp)
+                     ENDIF
+
+ 106              CONTINUE
+ 206              CONTINUE
+ 306              CONTINUE
+ 406              CONTINUE
+               ENDIF
+ 
+               IF (xmin .EQ. big) xmin = xmin_field + xadd
+               IF (xmax .EQ. -1.*big) xmax = xmax_field + xadd
+
+ 502        CONTINUE
+
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+            IF (.NOT. found_range .AND.
+     .    xrange_lo.GE.xmin_field .AND. xrange_hi.LE.xmax_field .AND.
+     .    yrange_lo.GE.ymin_field .AND. yrange_hi.LE.ymax_field ) THEN
+     
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 407 i =arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)-1
+               DO 307 j =arg_lo_ss(Y_AXIS,ARG1),arg_hi_ss(Y_AXIS,ARG1)-1
+               DO 207 k =arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+               DO 107 l =arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l)+xadd
+                  xxp = arg_1(i+1,j,k,l)+xadd
+                  yy = arg_2(i,j,k,l)
+                  yyp = arg_2(i,j+1,k,l)
+      
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .              yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j+1, jhi)
+                  ENDIF
+
+                  IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .                 xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j, jhi)
+                  ENDIF
+
+                  IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .                 yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                  ENDIF
+
+ 107           CONTINUE
+ 207           CONTINUE
+ 307           CONTINUE
+ 407           CONTINUE
+            ENDIF
+
+
+         ENDIF
+
+      ENDIF  ! xmodulo
+
+
+* Return two cells out from the computed result, one to be sure we cover
+* the entire requested range (the coords may be cell centers or bounds, and
+* a second because the mapping in curv_to_rect uses neighbors around each
+* location to compute the result.
+
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 600 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l) = bad_flag_result
+ 600  CONTINUE
+
+      IF (found_range) THEN
+         result(1,j,k,l) = MAX(ilo-2, arg_lo_ss(X_AXIS, ARG1) )
+         result(2,j,k,l) = MIN(ihi+2, arg_hi_ss(X_AXIS, ARG1) )
+      ENDIF
+
+      IF (found_range) THEN
+         result(3,j,k,l) = MAX(jlo-2, arg_lo_ss(Y_AXIS, ARG2) )
+         result(4,j,k,l) = MIN(jhi+2, arg_hi_ss(Y_AXIS, ARG2) )
+      ENDIF
+
+      RETURN 
+
+ 5500 WRITE (errmsg, 1000) 'X', i, j
+ 1000 FORMAT (A1, 
+     . ' coordinates missing where valid value needed, at I,J=', 2i5)
+
+      CALL EF_BAIL_OUT(id, errmsg)
+
+ 5600 WRITE (errmsg, 1000) 'Y', i, j
+      CALL EF_BAIL_OUT(id, errmsg)
+
+
+      RETURN
+      END
diff --git a/external_functions/hinterp/curv_to_rect.F b/external_functions/hinterp/curv_to_rect.F
new file mode 100644
index 0000000..25fc3f1
--- /dev/null
+++ b/external_functions/hinterp/curv_to_rect.F
@@ -0,0 +1,329 @@
+
+! curv_to_rect.F
+! From Matt Harrison hinterp.F
+! to call only the spherical interpolation modules, and
+! recast in F77-compileable format.
+! ACM 3/2004
+!
+!   
+!   -- Check use of and document issue of cell bounds 
+!      vs cell centers.
+!
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+
+* acm 12/2004 Compute the sum of weights in routine apply_mapping; 
+*             sum of weights used when there is good data contributing 
+*             to the destination point.
+*             Remove use of mask_dst variable; never used.
+* acm  3/2005 The curvilinear data may be a subset.  If it was saved
+*             with SAVE/HEADING=ENHANCED, then the lo and hi subscripts
+*             in the dataset correspond to the subset, and we can use
+*             a map pre-computed using the entire dataset for this regridding.
+*             Pass the subscripts of the input curvilinear data to the 
+*             apply_mapping routine (if not a subset these are 1:max_ss).
+* ACM  1/2009 Correct bug with the indices passed into apply_mapping; Treating
+*             indices as if they start at 1 inside that routine lets us compute 
+*             and apply mapping functions based on subsets of the grid
+* ACM  1/2009 Correct bug with the indices passed into apply_mapping; Treating
+*             indices as if they start at 1 inside that routine lets us compute 
+*             and apply mapping functions based on subsets of the grid
+
+
+! In this SUBROUTINE we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE curv_to_rect_init(id)
+        
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT
+     .('Apply mapping to regrid from curvilinear to rectangular grid')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,  
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable to regrid, on curvilinear grid V(x,y,z,t)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mapping')
+      WRITE (descr, 30)
+   30 FORMAT ('mapping computed by curv_to_rect_MAP')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_init
+
+
+!
+! In this SUBROUTINE we compute the result
+!
+      SUBROUTINE curv_to_rect_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT none
+      
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER  id
+
+      REAL  bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      REAL  arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .       mem1lot:mem1hit)
+      REAL  arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .       mem2lot:mem2hit)
+
+      REAL  result(memreslox:memreshix, memresloy:memreshiy, 
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+! After initialization, the 'res_' arrays contain indexing information 
+! for the result axes.  The 'arg_' arrays will contain the indexing 
+! information for each variable's axes. 
+
+      INTEGER  res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER  arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+      
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  i, j, k, l, i1, j1, k1, l1, i2, j2, k2, l2, ih, jh,
+     .         num_nbrs, nlon_src, nlat_src, nlon_dst, nlat_dst
+
+      num_nbrs = 4
+      
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+      nlon_src = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nlat_src = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      nlon_dst = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      ih = arg_hi_ss(X_AXIS,ARG1)
+      jh = arg_hi_ss(Y_AXIS,ARG1)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO l = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+c     .        i1, ih, j1, jh,  ! line 2 of this call WAS...1,nlon_src, 1,nlat_src,
+            CALL apply_mapping ( arg_1(i1,j1,k1,l1), 
+     .        i1, ih, j1, jh,
+     .        arg_2(i2,j2,k2,l2), arg_2(i2,j2,k2,l2+1),
+     .        arg_2(i2,j2,k2,l2+2), result(i,j,k,l), nlon_src,
+     .        nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .        bad_flag(ARG1), bad_flag_result )
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_compute
+
+!#######################################################################
+            
+       subroutine apply_mapping (data_in, ilo, ihi, jlo, jhi,
+     .                           wt, i_lon, j_lat, data_out, 
+     .                           nlon_src, nlat_src, nlon_dst, nlat_dst,
+     .                           num_nbrs, bad_flag_in, bad_flag_out)
+
+! This is the last set of loops from horiz_interp_sphe, applying wt
+! to the data to compute the regridded result.
+
+! acm 7/2004 Add variable COUNT to set data to missing if there is nothing added
+! to the sum in a given output grid cell.  This had been done in the original code
+! by seeing if the value is a "land" value, but it is not general enough for our
+! purposes.
+
+! acm 12/2004 Compute the sum of weights here; weights only used when there
+!             is good data contributing to the destination point.
+
+       integer ilo, ihi, jlo, jhi
+       real data_in(ilo:ihi, jlo:jhi)     ! input field
+       real data_out(nlon_dst, nlat_dst)  ! output
+       real wt(nlon_dst, nlat_dst, num_nbrs)  
+
+       real i_lon(nlon_dst,nlat_dst,num_nbrs)
+       real j_lat(nlon_dst,nlat_dst,num_nbrs) 
+
+       real bad_flag_in, bad_flag_out
+
+       integer nlon_src, nlat_src, nlon_dst, nlat_dst, 
+     .         num_nbrs
+
+!--- some local variables ----------------------------------------
+       integer nlon_in, nlat_in, nlon_out, nlat_out, num_neighbors,
+     .               m, n, k, i, j
+       real sum
+       logical okij
+!-----------------------------------------------------------------
+
+! parameters
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+
+         nlon_in  = nlon_src
+         nlat_in  = nlat_src
+         nlon_out = nlon_dst
+         nlat_out = nlat_dst   
+         num_neighbors = num_nbrs
+
+         do m=1,nlon_out
+         do n=1,nlat_out
+
+            data_out(m,n) = 0.0
+            sum=0.0
+            do k=1, num_neighbors
+               i = i_lon(m,n,k)
+               j = j_lat(m,n,k)
+
+               okij = .TRUE.
+               IF (i .LT. ilo  .OR. i .GT. ihi) THEN
+                  okij = .FALSE.
+               ENDIF
+               IF (j .LT. jlo  .OR.  j .GT. jhi) THEN
+                  okij = .FALSE.
+               ENDIF
+
+
+               if (i.GT.0 .and. j.GT.0 .AND. okij) THEN
+                  IF (data_in(i,j) .NE. bad_flag_in ) THEN
+                     data_out(m,n) = data_out(m,n)+
+     .                                  data_in(i,j)*wt(m,n,k)
+                     sum = sum + wt(m,n,k)
+                  endif
+               else
+                  data_out(m,n) = bad_flag_out
+                  GO TO 33
+               endif
+            enddo
+
+            IF (sum .GT. epsln) THEN
+               data_out(m,n) = data_out(m,n)/sum
+            ELSE
+               data_out(m,n) = bad_flag_out
+            ENDIF
+  33        continue
+
+         enddo
+         enddo
+      
+
+         return
+       end ! subroutine horiz_interp_sphe
+      
+      
diff --git a/external_functions/hinterp/curv_to_rect_fsu.F b/external_functions/hinterp/curv_to_rect_fsu.F
new file mode 100644
index 0000000..b564bfd
--- /dev/null
+++ b/external_functions/hinterp/curv_to_rect_fsu.F
@@ -0,0 +1,329 @@
+
+! curv_to_rect_fsu.F
+! From Matt Harrison hinterp.F
+! to call only the spherical interpolation modules, and
+! recast in F77-compileable format.
+!
+! This is a special version of curv_to_rect, but with num_nbrs = 1 not 4.
+! the mapping function computed at FSU uses just one neighbor.
+!   
+!   -- Check use of and document issue of cell bounds 
+!      vs cell centers.
+!
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+
+* acm 12/2004 Compute the sum of weights in routine apply_mapping; 
+*             sum of weights used when there is good data contributing 
+*             to the destination point.
+*             Remove use of mask_dst variable; never used.
+* acm  3/2005 The curvilinear data may be a subset.  If it was saved
+*             with SAVE/HEADING=ENHANCED, then the lo and hi subscripts
+*             in the dataset correspond to the subset, and we can use
+*             a map pre-computed using the entire dataset for this regridding.
+*             Pass the subscripts of the input curvilinear data to the 
+*             apply_mapping routine (if not a subset these are 1:max_ss).
+* ACM  1/2009 Correct bug with the indices passed into apply_mapping; Treating
+*             indices as if they start at 1 inside that routine lets us compute 
+*             and apply mapping functions based on subsets of the grid
+
+
+! In this SUBROUTINE we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE curv_to_rect_fsu_init(id)
+        
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT
+     .('Apply mapping to regrid from curvilinear to rectangular grid')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,  
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable to regrid, on curvilinear grid V(x,y,z,t)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mapping')
+      WRITE (descr, 30)
+   30 FORMAT ('mapping computed by curv_to_rect_MAP')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_fsu_init
+
+
+!
+! In this SUBROUTINE we compute the result
+!
+      SUBROUTINE curv_to_rect_fsu_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT none
+      
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER  id
+
+      REAL  bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      REAL  arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .       mem1lot:mem1hit)
+      REAL  arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .       mem2lot:mem2hit)
+
+      REAL  result(memreslox:memreshix, memresloy:memreshiy, 
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+! After initialization, the 'res_' arrays contain indexing information 
+! for the result axes.  The 'arg_' arrays will contain the indexing 
+! information for each variable's axes. 
+
+      INTEGER  res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER  arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+      
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  i, j, k, l, i1, j1, k1, l1, i2, j2, k2, l2, ih, jh,
+     .         num_nbrs, nlon_src, nlat_src, nlon_dst, nlat_dst
+
+      num_nbrs = 4
+      num_nbrs = 1
+      
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+      nlon_src = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nlat_src = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      nlon_dst = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      ih = arg_hi_ss(X_AXIS,ARG1)
+      jh = arg_hi_ss(Y_AXIS,ARG1)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO l = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+c     .        i1, ih, j1, jh,  ! line 2 of this call WAS... 
+c     .        1,nlon_src, 1,nlat_src,  ! Or try  
+            CALL apply_mapping ( arg_1(i1,j1,k1,l1), 
+     .        i1, ih, j1, jh,
+     .        arg_2(i2,j2,k2,l2), arg_2(i2,j2,k2,l2+1),
+     .        arg_2(i2,j2,k2,l2+2), result(i,j,k,l), nlon_src,
+     .        nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .        bad_flag(ARG1), bad_flag_result )
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_fsu_compute
+
+!#######################################################################
+            
+       subroutine apply_mapping (data_in, ilo, ihi, jlo, jhi,
+     .                           wt, i_lon, j_lat, data_out, 
+     .                           nlon_src, nlat_src, nlon_dst, nlat_dst,
+     .                           num_nbrs, bad_flag_in, bad_flag_out)
+
+! This is the last set of loops from horiz_interp_sphe, applying wt
+! to the data to compute the regridded result.
+
+! acm 7/2004 Add variable COUNT to set data to missing if there is nothing added
+! to the sum in a given output grid cell.  This had been done in the original code
+! by seeing if the value is a "land" value, but it is not general enough for our
+! purposes.
+
+! acm 12/2004 Compute the sum of weights here; weights only used when there
+!             is good data contributing to the destination point.
+
+       integer ilo, ihi, jlo, jhi
+       real data_in(ilo:ihi, jlo:jhi)     ! input field
+       real data_out(nlon_dst, nlat_dst)  ! output
+       real wt(nlon_dst, nlat_dst, num_nbrs)  
+
+       real i_lon(nlon_dst,nlat_dst,num_nbrs)
+       real j_lat(nlon_dst,nlat_dst,num_nbrs) 
+
+       real bad_flag_in, bad_flag_out
+
+       integer nlon_src, nlat_src, nlon_dst, nlat_dst, 
+     .         num_nbrs
+
+!--- some local variables ----------------------------------------
+       integer nlon_in, nlat_in, nlon_out, nlat_out, num_neighbors,
+     .               m, n, k, i, j
+       real sum
+       logical okij
+!-----------------------------------------------------------------
+
+! parameters
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+
+         nlon_in  = nlon_src
+         nlat_in  = nlat_src
+         nlon_out = nlon_dst
+         nlat_out = nlat_dst   
+         num_neighbors = num_nbrs
+
+         do m=1,nlon_out
+         do n=1,nlat_out
+
+            data_out(m,n) = 0.0
+            sum=0.0
+            do k=1, num_neighbors
+               i = i_lon(m,n,k)
+               j = j_lat(m,n,k)
+
+               okij = .TRUE.
+               IF (i .LT. ilo  .OR. i .GT. ihi) THEN
+                  okij = .FALSE.
+               ENDIF
+               IF (j .LT. jlo  .OR.  j .GT. jhi) THEN
+                  okij = .FALSE.
+               ENDIF
+
+
+               if (i.GT.0 .and. j.GT.0 .AND. okij) THEN
+                  IF (data_in(i,j) .NE. bad_flag_in ) THEN
+                     data_out(m,n) = data_out(m,n)+
+     .                                  data_in(i,j)*wt(m,n,k)
+                     sum = sum + wt(m,n,k)
+                  endif
+               else
+                  data_out(m,n) = bad_flag_out
+                  GO TO 33
+               endif
+            enddo
+
+            IF (sum .GT. epsln) THEN
+               data_out(m,n) = data_out(m,n)/sum
+            ELSE
+               data_out(m,n) = bad_flag_out
+            ENDIF
+  33        continue
+
+         enddo
+         enddo
+      
+
+         return
+       end ! subroutine horiz_interp_sphe
+      
+      
diff --git a/external_functions/hinterp/curv_to_rect_map.F b/external_functions/hinterp/curv_to_rect_map.F
new file mode 100644
index 0000000..add1ad2
--- /dev/null
+++ b/external_functions/hinterp/curv_to_rect_map.F
@@ -0,0 +1,1092 @@
+! curv_to_rect_map.F  
+! From Matt Harrison hinterp.F
+! to call only the spherical interpolation modules, and
+! recast in F77-compileable format.
+! ACM 3/2004
+!  10/8/2004  add fourth argument radius  (max_dist) so this can be
+!             set to a smaller value for fine grids or small regions.
+!
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+! acm 12/2004 Compute the sum of weights in routine apply_mapping; 
+!             sum of weights used when there is good data contributing 
+!             to the destination point.
+!             Remove use of mask_dst variable; never used.
+
+
+
+! In this SUBROUTINE we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE curv_to_rect_map_init(id)
+        
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT
+     . ('Compute mapping for regridding: curvilinear to ',
+     .  'rectangular grid.')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_num_work_arrays(id, 8)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,  
+     .     IMPLIED_BY_ARGS, ABSTRACT, ABSTRACT)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'lon_in')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'Source grid longitudes (2-D)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lat_in')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Source grid latitudes (2-D)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'grid_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      WRITE (descr, 20)
+   20 FORMAT ('Any variable on destination Longitude-Latitude ',
+     .        'grid, Lon and Lat')
+      CALL ef_set_arg_desc(id, arg, descr)
+     .  
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'radius')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      WRITE (descr, 30)
+   30 FORMAT ('Source points falling ',
+     .   'within radius are included in mapping to destination point')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_init
+
+* Set the limits of the abstract axes for the result.
+
+      SUBROUTINE curv_to_rect_map_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, 4)
+      CALL ef_set_axis_limits(id, T_AXIS, 1, 3)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_result_limits
+
+
+
+*
+* In this SUBROUTINE we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE curv_to_rect_map_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER array_num
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+      INTEGER num_nbrs, nx, ny
+
+      num_nbrs = 4
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+
+
+* Define together as one work array:
+* i_lon_j_lat(nlon_dst, nlat_dst, num_nbrs, 2)
+*  integer i_lon(nlon_dst, nlat_dst, num_nbrs) 
+*  integer j_lat(nlon_dst, nlat_dst, num_nbrs) 
+*  indices for spherical interpolation - define together as one work array
+
+      array_num = 1
+      num_nbrs = 4
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 2)
+
+*  Define together as one work array:
+*  real src_dist(nlon_dst, nlat_dst, num_nbrs)
+*  real map_src_dist(nlon_dst, nlat_dst, num_nbrs)
+
+      array_num = 2
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 2)
+
+* Define together as one work array:
+* logical found_neighbors(nlon_dst, nlat_dst)
+* logical map_found_neighbors(nlon_dst, nlat_dst)
+
+      array_num = 3
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 1)
+
+* integer map_src_add(nlon_dst, nlat_dst, num_nbrs)
+
+      array_num = 4
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 1)
+
+* real wt(nlon_dst, nlat_dst, num_nbrs) 
+
+      array_num = 5
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 1)
+
+* Define together as one work array:
+* real src_grid_radians(nx_src, ny_src, 2, 1)
+* source grid longitudes (arg_1), translated to radians
+* source grid latitudes  (arg_2), translated to radians
+
+      array_num = 6
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG1), arg_lo_ss(Y_AXIS,ARG2), 1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG2), 2, 1)
+
+* real*8 dst_grid(MAX(nx_dst, ny_dst), 2, 1, 1)
+* destination rectangular grid, translated to radians
+* allocate 2* needed number of values, since this will be real*8
+
+      array_num = 7
+      nx =  arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny =  arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nx = MAX(nx,ny)
+      CALL ef_set_work_array_dims(id, array_num,
+     .        1,   1, 1, 1, 
+     .     2*nx, 2*2, 1, 1)
+
+* real dst_grid_radians(nx_dst, ny_dst, 2, 1)
+* destination rectangular grid, translated to radians
+
+      array_num = 8
+      nx =  arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny =  arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      CALL ef_set_work_array_dims(id, array_num,
+     .      1,  1, 1, 1, 
+     .     nx, ny, 2, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+!
+! In this SUBROUTINE we compute the result
+!
+      SUBROUTINE curv_to_rect_map_compute(id, arg_1, arg_2, arg_3,
+     .          arg_4, result, i_lon_j_lat, src_dist, 
+     .          found_neighbors, map_src_add, wt, 
+     .          src_grid_radians, dst_grid, dst_grid_radians)
+
+! Schematic:
+!    The following example illustrates a destination grid location (+) with 
+!    a (R)adius of influence (in radians) denoted by (=).  Valid source grid 
+!    locations (o) which fall within the radius of influence of the destination 
+!    point are used in the mapping. In this case, 4 valid source grid points fall
+!    within the radius of influence.   
+!
+! 
+!               o  o   o   o   o   o   o
+!                      =========
+!                     =         = 
+!               o  o = o   o   o = o   o
+!                   =        R    = 
+!                   =      +----->=
+!               o  o   o   x   x   x   x
+!                     =         =
+!                      =========
+!               o  o   o   x   x   x   x
+!
+!
+!
+      IMPLICIT none
+      
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+
+      INTEGER  id
+
+      REAL  bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      REAL  arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .       mem1lot:mem1hit)
+      REAL  arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .       mem2lot:mem2hit)
+      REAL  arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .       mem3lot:mem3hit)
+      REAL  arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .       mem4lot:mem4hit)
+
+      REAL  result(memreslox:memreshix, memresloy:memreshiy, 
+     .      memresloz:memreshiz, memreslot:memreshit)
+     
+* Declare work arrays
+
+      INTEGER i_lon_j_lat(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .              wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL src_dist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      LOGICAL found_neighbors(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .              wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      INTEGER map_src_add(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .              wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL wt(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .              wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL src_grid_radians(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .              wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      REAL*8 dst_grid(wrk7lox:wrk7hix/2, wrk7loy:wrk7hiy/2,
+     .              wrk7loz:wrk7hiz, wrk7lot:wrk7hit)
+      REAL dst_grid_radians(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .              wrk8loz:wrk8hiz, wrk8lot:wrk8hit)
+
+! After initialization, the 'res_' arrays contain indexing information 
+! for the result axes.  The 'arg_' arrays will contain the indexing 
+! information for each variable's axes. 
+
+      INTEGER  res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER  arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+      
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  i, j, k, l, arg, idim, interp_method, nx, ny,
+     .         nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .         ilon(4), jlat(4)
+
+! ilon and jlat are size of num_nbrs
+
+      REAL max_dist, pi, pi180
+      LOGICAL src_modulo
+
+      pi =  4.*ATAN(1.)
+      pi180 = pi/ 180.
+
+      num_nbrs = 4
+
+!  Get max_dist as an argument and convert to radians.
+cc      max_dist = 0.17
+      arg = 4
+      CALL ef_get_one_val(id, arg, max_dist)
+      max_dist = pi180*max_dist
+
+      src_modulo = .true.  ! Do we want this? Ferret does not now deal w/ modulo curvi data
+
+!  Loop over x,y,t of the input fields
+      
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      interp_method = 3
+!      WRITE(*,*) 'Using spherical regridding !!'
+
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+      nlon_src = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nlat_src = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      nlon_dst = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+
+      IF (nlon_src .NE. nx .OR. nlat_src .NE. ny) call ef_bail_out (id, 
+     . 'argument 2 must have the same x and y dimensions as argument 1')  
+
+* Tranlate input and output grid coordinates to radians.
+
+* arg_1 is lons_in
+* arg_2 is lats_in
+* src_grid_radians(nx_src, ny_src, 2, 1)
+
+      pi =  4.*ATAN(1.)
+      pi180 = pi/ 180.
+
+      DO j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         src_grid_radians(i,j,1,1) = pi180*arg_1(i,j,mem1loz,mem1lot)
+      ENDDO
+      ENDDO
+
+      DO j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         src_grid_radians(i,j,2,1) = pi180*arg_2(i,j,mem2loz,mem2lot)
+      ENDDO
+      ENDDO
+
+      arg = 3
+      idim = 1
+
+      CALL EF_GET_COORDINATES (id, arg, idim,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3), 
+     .     dst_grid(1,1,1,1) )
+
+      arg = 3
+      idim = 2
+
+      CALL EF_GET_COORDINATES (id, arg, idim,
+     .     arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     dst_grid(1,2,1,1) )
+
+      DO j = 1, nlat_dst
+      DO i = 1, nlon_dst
+        dst_grid_radians(i, j, 1, 1) = pi180* dst_grid(i,1,1,1)
+      ENDDO
+      ENDDO
+
+      DO j = 1, nlat_dst
+      DO i = 1, nlon_dst
+        dst_grid_radians(i, j, 2, 1) = pi180* dst_grid(j,2,1,1)
+      ENDDO
+      ENDDO
+
+      CALL horiz_interp_init_sphe(id, 
+     .        src_grid_radians(wrk6lox,wrk6loy,1,1), 
+     .        src_grid_radians(wrk6lox,wrk6loy,2,1), 
+     .        dst_grid_radians(wrk8lox,wrk8loy,1,1), 
+     .        dst_grid_radians(wrk8lox,wrk8loy,2,1),
+     .        i_lon_j_lat(wrk1lox,wrk1loy,wrk1loz,1), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,wrk1loz,2), 
+     .        ilon, jlat, 
+     .        src_dist(wrk2lox,wrk2loy,wrk2loz,1), 
+     .        src_dist(wrk2lox,wrk2loy,wrk2loz,2),
+     .        found_neighbors(wrk3lox,wrk3loy,1,wrk3lot), 
+     .        map_src_add, 
+     .        found_neighbors(wrk3lox,wrk3loy,1,wrk3lot), 
+     .        num_nbrs, max_dist, 
+     .        src_modulo, nlon_src, nlat_src, nlon_dst, nlat_dst)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      CALL save_mapping (src_dist, wt, 
+     .        found_neighbors(wrk3lox,wrk3loy,wrk3loz,wrk3lot), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,wrk1loz,1), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,wrk1loz,2), 
+     .        max_dist, nlon_src, nlat_src, 
+     .        nlon_dst, nlat_dst, num_nbrs, bad_flag_result,
+     .        result(i,j,k,l) )
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_compute
+
+      
+      subroutine horiz_interp_init_sphe(id, lon_in, lat_in, lon_out, 
+     .        lat_out, i_lon, j_lat, ilon, jlat, src_dist, map_src_dist,
+     .        found_neighbors, map_src_add, map_found_neighbors, 
+     .        num_nbrs, max_dist, src_modulo, nlon_src, nlat_src, 
+     .        nlon_dst, nlat_dst)
+      
+      integer id, nlon_src, nlat_src, nlon_dst, nlat_dst,  
+     .        num_nbrs, ilon(num_nbrs), jlat(num_nbrs), 
+     .        map_src_add(nlon_dst,nlat_dst,num_nbrs),
+     .        i_lon(nlon_dst,nlat_dst,num_nbrs),
+     .        j_lat(nlon_dst,nlat_dst,num_nbrs)
+
+      real    max_dist, 
+     .        lon_in(nlon_src, nlat_src),  lat_in(nlon_src, nlat_src), 
+     .        lon_out(nlon_dst, nlat_dst), lat_out(nlon_dst, nlat_dst),
+     .        src_dist(nlon_dst,nlat_dst,num_nbrs)
+
+      logical found_neighbors(nlon_dst,nlat_dst), src_modulo
+      
+!------local variables ---------------------------------------
+      
+      integer  i, j, n, num_neighbors, map_dst_xsize, map_dst_ysize, 
+     .         map_src_xsize, map_src_ysize, map_src_size
+      real     max_src_dist,
+     .         map_src_dist(nlon_dst,nlat_dst,num_nbrs)
+      
+      logical map_found_neighbors(nlon_dst, nlat_dst)
+
+!--------------------------------------------------------------
+      map_dst_xsize = nlon_dst
+      map_dst_ysize = nlat_dst
+      map_src_xsize = nlon_src
+      map_src_ysize = nlat_src
+      map_src_size = map_src_xsize*map_src_ysize
+      
+      num_neighbors = num_nbrs
+      max_src_dist = max_dist
+      
+!using radial_search to find the nearest points and corresponding distance.
+
+      call radial_search(id, lon_in, lat_in, lon_out, lat_out, 
+     .          map_src_add, map_src_dist, map_found_neighbors,
+     .          num_nbrs, max_dist, src_modulo, nlon_src, nlat_src,
+     .          nlon_dst, nlat_dst, map_src_size )
+      
+      do j=1,map_dst_ysize
+      do i=1,map_dst_xsize
+         do n=1,num_neighbors
+            if(map_src_add(i,j,n) .EQ. 0) then
+               jlat(n) = 0
+               ilon(n) = 0
+            else
+               jlat(n) = map_src_add(i,j,n)/map_src_xsize + 1
+               ilon(n) = map_src_add(i,j,n) - (jlat(n)-1)*map_src_xsize
+               if(ilon(n) .EQ. 0) then
+                  jlat(n) = jlat(n) - 1
+                  ilon(n) = map_src_xsize
+               endif
+            endif
+            i_lon(i,j,n) = ilon(n)
+            j_lat(i,j,n) = jlat(n)
+         enddo
+      
+      enddo
+      enddo
+      
+      do j=1,map_dst_ysize
+      do i=1,map_dst_xsize
+         do n=1,num_neighbors
+            src_dist(i,j,n) = map_src_dist(i,j,n)
+         enddo
+         found_neighbors(i,j) = map_found_neighbors(i,j)
+      enddo
+      enddo
+      
+      nlon_src = map_src_xsize
+      nlat_src = map_src_ysize
+      nlon_dst = map_dst_xsize
+      nlat_dst = map_dst_ysize
+      
+      return
+
+      end ! subroutine horiz_interp_init_sphe
+!#####################################################################
+      
+       subroutine radial_search(id, theta_src, phi_src, theta_dst, 
+     .      phi_dst, map_src_add, map_src_dist, map_found_neighbors, 
+     .      num_nbrs, max_dist, src_modulo, nlon_src, nlat_src,
+     .      nlon_dst, nlat_dst, map_src_size)
+      
+! x_dst,y_dst = destination grid lon,lat
+! x_src,y_src = source grid lon,lat
+
+
+!       theta_src = reshape(x_src,(/map_src_size/))
+!       phi_src = reshape(y_src,(/map_src_size/))
+!       theta_dst(:,:) = x_dst(:,:)
+!       phi_dst(:,:) = y_dst(:,:)      
+
+       integer id, nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .         map_src_add(nlon_dst,nlat_dst,num_nbrs)
+
+       real    theta_src(map_src_size), phi_src(map_src_size),  
+     .         theta_dst(nlon_dst, nlat_dst), 
+     .         phi_dst(nlon_dst, nlat_dst),
+     .         map_src_dist(nlon_dst,nlat_dst,num_nbrs), max_dist
+
+       logical map_found_neighbors(nlon_dst, nlat_dst), src_modulo
+       
+!-------local variables-----------------------------------------
+
+       integer i, j, n, bound, bound_start, bound_end, i0, j0, 
+     .         i_left, i_right, step, step_size, num_neighbors, 
+     .         map_dst_xsize, map_dst_ysize, map_src_xsize, 
+     .         map_src_ysize, map_dst_size, map_src_size
+
+       real    spherical_distance, d, nearest,res, max_src_dist, pi, 
+     .         tpi, hpi, min_theta_dst, max_theta_dst, min_phi_dst, 
+     .         max_phi_dst, min_theta_src, max_theta_src, min_phi_src,
+     .         max_phi_src, pi180
+
+       logical update_dest_neighbors, continue_search, found_neighbors,
+     .         continue_radial_search, result, src_is_modulo
+
+
+!---------------------------------------------------------------
+      
+
+! parameters
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+
+       pi = 4.*ATAN(1.)
+       tpi = 2.0*PI
+       hpi = 0.5*PI
+       
+        pi180 = pi/ 180.
+
+       map_dst_xsize = nlon_dst
+       map_dst_ysize = nlat_dst
+       map_src_xsize = nlon_src
+       map_src_ysize = nlat_src      
+       map_dst_size = map_dst_xsize*map_dst_ysize
+       map_src_size = map_src_xsize*map_src_ysize
+      
+       num_neighbors = num_nbrs
+       if (num_neighbors .LE. 0) call ef_bail_out (id, 
+     .   'num_neighbors must be > 0') 
+      
+       max_src_dist = max_dist
+       src_is_modulo = src_modulo
+      
+       do i = 1, nlon_dst
+       do j = 1, nlat_dst
+       do n = 1, num_nbrs
+          map_src_add(i,j,n) = 0
+          map_src_dist(i,j,n) = large
+       enddo
+       enddo
+       enddo
+      
+       min_theta_dst=tpi
+       max_theta_dst=0.0
+       min_phi_dst=pi
+       max_phi_dst=-pi
+       min_theta_src=tpi
+       max_theta_src=0.0
+       min_phi_src=pi
+       max_phi_src=-pi
+      
+            
+       do i = 1, nlon_dst
+       do j = 1, nlat_dst
+          if(theta_dst(i,j) .LT. 0.0) theta_dst(i,j)=theta_dst(i,j)+tpi
+          if(theta_dst(i,j) .GT. tpi) theta_dst(i,j)=theta_dst(i,j)-tpi
+          if(phi_dst(i,j) .LT. -1.* hpi) phi_dst(i,j) = -1.* hpi
+          if(phi_dst(i,j) .GT. hpi)  phi_dst(i,j) =  hpi
+       enddo
+       enddo
+       
+       do i = 1, map_src_size
+          if(theta_src(i) .LT. 0.0)  theta_src(i) = theta_src(i)+tpi
+          if(theta_src(i) .GT. tpi)  theta_src(i) = theta_src(i)-tpi
+          if(phi_src(i) .LT. -1.* hpi) phi_src(i) = -1.* hpi
+          if(phi_src(i) .GT. hpi)  phi_src(i) =  hpi
+       enddo
+
+       do j=1,map_dst_ysize
+       do i=1,map_dst_xsize
+          min_theta_dst = min(min_theta_dst,theta_dst(i,j))
+          max_theta_dst = max(max_theta_dst,theta_dst(i,j))
+          min_phi_dst = min(min_phi_dst,phi_dst(i,j))
+          max_phi_dst = max(max_phi_dst,phi_dst(i,j))
+       enddo
+       enddo
+      
+       do i=1,map_src_size
+          min_theta_src = min(min_theta_src,theta_src(i))
+          max_theta_src = max(max_theta_src,theta_src(i))
+          min_phi_src = min(min_phi_src,phi_src(i))
+          max_phi_src = max(max_phi_src,phi_src(i))
+       enddo
+      
+!  Note: do comparisons like these with a TM_FPEQ 
+
+c       if (min_phi_dst .LT. min_phi_src) print *, 
+c     .    '=> WARNING:  latitute of dest grid exceeds src: src, dest',
+c     .    min_phi_src, min_phi_dst, ' degrees src, dest:', 
+c     .    min_phi_src/pi180, min_phi_dst/pi180
+c       if (max_phi_dst .GT. max_phi_src) print *, 
+c     .    '=> WARNING:  latitute of dest grid exceeds src: src, dest',
+c     .    max_phi_src, max_phi_dst, ' degrees src, dest:', 
+c     .    max_phi_src/pi180, max_phi_dst/pi180
+c       if (min_theta_dst .LT. min_theta_src) print *, 
+c     .    '=> WARNING : longitude of dest grid exceeds src: src, dest',
+c     .    min_theta_src, min_theta_dst, ' degrees src, dest:', 
+c     .    min_theta_src/pi180, min_theta_dst/pi180
+c       if (max_theta_dst .GT. max_theta_src) print *, 
+c     .    '=> WARNING : longitude of dest grid exceeds src: src, dest',
+c     .    max_theta_src, max_theta_dst, ' degrees src, dest:', 
+c     .    max_theta_src/pi180, max_theta_dst/pi180
+      
+       do j=1,map_dst_ysize
+       do i=1,map_dst_xsize
+          found_neighbors=.false.
+          continue_search=.true.
+          step = 1
+          step_size = 1
+          nearest = 1.e3
+          do while (continue_search .and. step_size .GT. 0)
+             do while (step .LE. map_src_size .and. continue_search)
+! count land points as nearest neighbors
+                d = spherical_distance (theta_dst(i,j), phi_dst(i,j), 
+     .                                 theta_src(step),phi_src(step))
+                if (d .LE. max_src_dist) then
+                   found_neighbors = update_dest_neighbors(
+     .                    i, j, map_src_add, map_src_dist, 
+     .                    step, d, max_src_dist, 
+     .                    nlon_dst, nlat_dst, num_nbrs)
+                   if (found_neighbors) then
+                      n = 0
+                      i0 = mod(step,map_src_xsize)
+                      if (i0 .EQ. 0) i0 = map_src_xsize
+                      res = float(step)/float(map_src_xsize)
+!                     j0 = ceiling(res)
+                      j0 = -1.*INT(-1.*res)
+                      continue_radial_search = .true.
+                      do while (continue_radial_search)
+                         n = n+1 ! radial counter
+! left boundary 
+                         i_left = i0-n
+                         if (i_left .LE. 0) then
+                            if (src_is_modulo) then
+                               i_left = map_src_xsize + i_left
+                            else
+                               i_left = 1
+                            endif
+                         endif
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                  + i_left
+                         bound_end = min(j0+n-1,map_src_ysize-1)*
+     .                                   map_src_xsize + i_left
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         bound = bound_start
+                         continue_radial_search = .false.
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                            phi_dst(i,j), theta_src(bound), 
+     .                            phi_src(bound))
+                            result = update_dest_neighbors(
+     .                        i, j, map_src_add, map_src_dist, 
+     .                        bound, d, max_src_dist,
+     .                        nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + map_src_xsize
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! right boundary 
+                         i_right = i0+n
+                         if (i_right .GT. map_src_xsize) then
+                            if (src_is_modulo) then
+                               i_right = i_right - map_src_xsize
+                            else
+                               i_right = map_src_xsize
+                            endif
+                         endif
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                + i_right
+                         bound_end = min(j0+n-1,map_src_ysize-1)*
+     .                                 map_src_xsize + i_right
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                          phi_dst(i,j),
+     .                          theta_src(bound),phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + map_src_xsize
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! bottom boundary 
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                + i_left 
+                         bound_end =  max(j0-n-1,0)*map_src_xsize  
+     .                                + i_right 
+                         if (bound_start .GT. bound_end) then
+                            bound_start = max(j0-n-1,0)*map_src_xsize+1
+                            bound_end = max(j0-n,1)*map_src_xsize
+                         endif
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                          phi_dst(i,j),theta_src(bound),
+     .                          phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + 1
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! top boundary 
+                         bound_start = min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + i_left
+                         bound_end =  min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + i_right
+                         if (bound_start .GT. bound_end) then
+                            bound_start = min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + 1
+                            bound_end = min(j0+n,map_src_ysize-1)*
+     .                          map_src_xsize
+                         endif
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                            phi_dst(i,j), theta_src(bound),
+     .                            phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + 1
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+                      enddo
+                      continue_search = .false. ! stop looking
+                   endif
+                endif
+                step=step+step_size
+             enddo ! search loop
+             step = 1
+             step_size = step_size/2
+          enddo
+          map_found_neighbors(i,j) = found_neighbors
+       enddo 
+       enddo
+      
+     .                                
+      return
+      
+      end !  subroutine radial_search
+      
+!#####################################################################
+
+      real function spherical_distance(theta1,phi1,theta2,phi2)
+
+* Argument definitions
+      real theta1, phi1, theta2, phi2
+
+* local variable definitions
+      real r1(3), r2(3), cross(3), s, dot, ang, pi
+
+! parameters
+      real epsln
+cc      parameter (epsln=1.e-10)
+      parameter (epsln=4.e-7)
+
+! this is a simple, enough way to calculate distance on the sphere
+! first, construct cartesian vectors r1 and r2
+! then calculate the cross-product which is proportional to the area
+! between the 2 vectors.  The angular distance is arcsin of the 
+! distancealong the sphere
+!
+! theta is longitude and phi is latitude
+!
+
+      pi =  4.*ATAN(1.)
+
+      r1(1) = cos(theta1)*cos(phi1)
+      r1(2)=sin(theta1)*cos(phi1)
+      r1(3)=sin(phi1)
+
+      r2(1) = cos(theta2)*cos(phi2)
+      r2(2)=sin(theta2)*cos(phi2)
+      r2(3)=sin(phi2)
+
+      cross(1) = r1(2)*r2(3)-r1(3)*r2(2)
+      cross(2) = r1(3)*r2(1)-r1(1)*r2(3)
+      cross(3) = r1(1)*r2(2)-r1(2)*r2(1)
+
+      s = sqrt(cross(1)**2.+cross(2)**2.+cross(3)**2.)
+
+      s = min(s,1.0-epsln)
+
+      dot = r1(1)*r2(1) + r1(2)*r2(2) + r1(3)*r2(3)
+
+      if (dot .GT. 0) then
+          ang = asin(s)
+      else if (dot .LT. 0) then
+          ang = pi - asin(s)
+      else
+          ang = pi/2.
+      endif
+      
+      spherical_distance = abs(ang) ! in radians
+      
+      return
+      
+      end ! function spherical_distance
+
+!#####################################################################
+      logical function update_dest_neighbors(i, j, map_src_add, 
+     .             map_src_dist, src_add, d, max_src_dist, nx, ny, nn)
+ 
+* Argument definitions
+       integer i, j, nx, ny, nn, map_src_add(nx, ny, nn), src_add
+       real map_src_dist(nx, ny, nn), d, max_src_dist
+
+* local variables
+      integer n,m, num_neighbors
+
+      update_dest_neighbors = .false.
+      num_neighbors = nn
+
+! if (d .le. max_src_dist) then
+!    NLOOP : do n=1,num_neighbors
+!       DIST_CHK : if (d .lt. map_src_dist(n)) then
+!          if (n > 1 .and. src_add == map_src_add(n-1)) exit NLOOP
+!          do m=num_neighbors,n+1,-1
+!             map_src_add(m) = map_src_add(m-1)
+!             map_src_dist(m) = map_src_dist(m-1)
+!          enddo
+!          map_src_add(n) = src_add
+!          map_src_dist(n) = d
+!          update_dest_neighbors = .true.
+!          exit NLOOP ! n loop
+!       endif DIST_CHK
+!   end do NLOOP
+! endif
+
+      if (d .le. max_src_dist) then
+         do n=1,num_neighbors 
+            if (d .lt. map_src_dist(i,j,n)) then 
+cc               if (n .GT. 1 .and. src_add .NE. map_src_add(i,j,n-1)) 
+ccc               if (n .GT. 1 .and. src_add .EQ. map_src_add(i,j,n-1)) 
+ccc     .             GOTO 100
+               do m=num_neighbors,n+1,-1
+                  map_src_add(i,j,m) = map_src_add(i,j,m-1)
+                  map_src_dist(i,j,m) = map_src_dist(i,j,m-1)
+               enddo
+               map_src_add(i,j,n) = src_add
+               map_src_dist(i,j,n) = d
+               update_dest_neighbors = .true.
+               goto 100
+            endif 
+         end do 
+  100    continue
+
+      endif
+
+      return
+      end ! function update_dest_neighbors
+
+
+
+!#######################################################################
+            
+       subroutine save_mapping (src_dist, wt, 
+     .      found_neighbors, i_lon, j_lat, max_src_dist,  
+     .      nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs,
+     .      bad_flag_result, result)
+
+! compute wt, i_lon, and j_lat and save in the result.
+! result(nlon_dst,nlat_dst,num_nbrs,3)  where num_nbrs = 4 and
+! 
+!   result(m,n,k,1) = wt(m,n,k)
+!   result(m,n,k,2) = i_lon(m,n,k)
+!   result(m,n,k,3) = j_lat(m,n,k)
+
+! acm 12/2004 Compute the sum of weights in apply_mapping in function 
+!             curv_to_rect; weights only used when there is good data 
+!             contributing to the destination grid cell.
+
+       integer nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs
+
+       real src_dist(nlon_dst, nlat_dst, num_nbrs)
+       real wt(nlon_dst, nlat_dst, num_nbrs)  
+       real max_src_dist, bad_flag_result
+
+       integer i_lon(nlon_dst,nlat_dst,num_nbrs)
+       integer j_lat(nlon_dst,nlat_dst,num_nbrs) 
+
+!  Result contains wts, neighbors, for applying the regridding
+       real result(nlon_dst, nlat_dst, num_nbrs, 3)  
+
+       logical found_neighbors(nlon_dst,nlat_dst)
+
+!--- some local variables ----------------------------------------
+       integer nlon_in, nlat_in, nlon_out, nlat_out, num_neighbors,
+     .               m, n, k, i1, i2, j1, j2
+!-----------------------------------------------------------------
+      
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+      
+         nlon_in  = nlon_src
+         nlat_in  = nlat_src
+         nlon_out = nlon_dst
+         nlat_out = nlat_dst   
+         num_neighbors = num_nbrs
+
+!first calculate destination weight
+      
+         do m=1,nlon_out
+         do n=1,nlat_out
+
+! neighbors are sorted nearest to farthest
+! check nearest to see if it is a land point
+
+            i1 = i_lon(m,n,1)
+            j1 = j_lat(m,n,1)
+      
+            if(num_neighbors .gt. 1 ) then
+               i2 = i_lon(m,n,2)
+               j2 = j_lat(m,n,2)
+            endif
+      
+            do k=1, num_neighbors
+              if (src_dist(m,n,k) .LE. epsln) then
+                 wt(m,n,k) = large
+              else if(src_dist(m,n,k) .LE. max_src_dist ) then
+                 wt(m,n,k) = 1.0/src_dist(m,n,k)
+              else
+                 wt(m,n,k) = 0.0
+              endif
+           enddo
+
+         enddo
+         enddo
+      
+! Save wt, i_lon, j_lat for this curvi/rect grid pair.
+
+         do m=1,nlon_out
+         do n=1,nlat_out
+            do k=1, num_neighbors
+               result(m,n,k,1) = wt(m,n,k)
+               result(m,n,k,2) = i_lon(m,n,k)
+               result(m,n,k,3) = j_lat(m,n,k)
+            enddo
+         enddo
+         enddo
+      
+         return
+       end ! subroutine save_mapping
diff --git a/external_functions/hinterp/rect_to_curv.F b/external_functions/hinterp/rect_to_curv.F
new file mode 100644
index 0000000..67626b0
--- /dev/null
+++ b/external_functions/hinterp/rect_to_curv.F
@@ -0,0 +1,1029 @@
+! rect_to_curv.F
+! 
+! renamed from hinterp_bilinear.F  
+! From Matt Harrison hinterp.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+! to CALL only the bilinear interpolation modules, and
+! recast in F77-compileable code.
+! ACM 3/2004
+!
+! mjh at gfdl.gov
+! 2/20/2003
+!
+! In this subroutine we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE rect_to_curv_init(id)
+        
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT ('Regrid from rectangular to curvilinear grid')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_num_work_arrays(id, 8)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,  
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     ,  'variable V(x,y,z,t) on rectilinear grid')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lon_bounds_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Destination curvilinear grid longitude bounds(2-D)')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'lat_bounds_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Destination curvilinear grid latitude bounds(2-D)')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, NO)   
+      
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'missing_allowed')
+      WRITE (descr, 20)
+   20 FORMAT ('number of missing values allowed in four ',
+     .   'surrounding source cells: 0 to 3')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)      
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! subroutine rect_to_curv_init
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE rect_to_curv_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER array_num, nx, ny
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+
+*   real wti(nlon_dst,nlat_dst,2)      
+*   weights for bilinear interpolation 
+
+      array_num = 1
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 0, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 0)
+     
+*  real wtj(nlon_dst,nlat_dst,2)      
+*  weights for bilinear interpolation 
+
+      array_num = 2
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 0, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 0)
+
+*  real*8 in_lon_lat(max(nlat_src+1, nlon_src+1), 2) 
+*  edges of x,y input axes, will be declared real*8
+      array_num = 3
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 2
+      nx = MAX(nx,ny)
+      CALL ef_set_work_array_dims(id, array_num,
+     .        1,  1, 1, 1,
+     .     2*nx, 4, 1, 1)
+
+*  real rad_lon_lat(max(nlat_src+1, nlon_src+1), 2) 
+*  edges of input axes, will be declared real, converted to radians
+
+      array_num = 4
+      CALL ef_set_work_array_dims(id, array_num,
+     .     1,  1, 1, 1,
+     .     nx, 2, 1, 1)
+
+*  real out_lon(nlon_dst, nlat_dst)  
+*  edges of output longitude grid, will be converted to radians
+
+      array_num = 5
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      CALL ef_set_work_array_dims(id, array_num,
+     .     1,   1, 1, 1,
+     .     nx, ny, 1, 1)
+
+*  real out_lat(nlon_dst, nlat_dst)      
+*  edges of output latitude grid, will be converted to radians
+
+      array_num = 6
+      nx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      CALL ef_set_work_array_dims(id, array_num,
+     .     1,   1, 1, 1,
+     .     nx, ny, 1, 1)
+
+*  integer i_lon(nlon_dst,nlat_dst,2) 
+* indices for bilinear interpolation 
+* These will be declared integer inside the compute routine
+
+      array_num = 7
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 1)
+
+*  integer j_lat(nlon_dst,nlat_dst,2) 
+*  indices for bilinear interpolation 
+*  These will be declared integer inside the compute routine
+
+      array_num = 8
+      CALL ef_set_work_array_dims(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+!
+! In this subroutine we compute the result
+!
+      SUBROUTINE rect_to_curv_compute(id, arg_1, arg_2, arg_3, 
+     .          arg_4, result, wti, wtj, in_lon_lat,
+     .          rad_lon_lat, out_lon, out_lat, i_lon, j_lat)
+
+      implicit none
+      
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+
+      INTEGER  id
+
+      REAL  bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      REAL  arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .       mem1lot:mem1hit)
+      REAL  arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .       mem2lot:mem2hit)
+      REAL  arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .       mem3lot:mem3hit)      
+      REAL  arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .       mem4lot:mem4hit)       
+
+      REAL  result(memreslox:memreshix, memresloy:memreshiy, 
+     .      memresloz:memreshiz, memreslot:memreshit)
+     
+      REAL wti(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL wtj(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 in_lon_lat(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL rad_lon_lat(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL out_lon(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+      REAL out_lat(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz, wrk6lot:wrk6hit)
+      INTEGER i_lon(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz, wrk7lot:wrk7hit)
+      INTEGER j_lat(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .               wrk8loz:wrk8hiz, wrk8lot:wrk8hit)
+
+! After initialization, the 'res_' arrays contain indexing information 
+! for the result axes.  The 'arg_' arrays will contain the indexing 
+! information for each variable's axes. 
+
+      INTEGER  res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER  arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+      
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  arg, idim, i, j, k, l, interp_method
+      INTEGER  i1, j1, k1, l1, k2, k3, l2, l3, verbose,
+     .         nlon_src, nlat_src, nlon_dst, nlat_dst, nx, ny
+
+      REAL missing_permit, pi, pi180
+      CHARACTER*16 axname(4), ax_units(4) 
+      LOGICAL back(4), modulo(4), reg(4)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+! Get edges of coordinate boxes on input axes.  Convert to radians.
+
+      pi =  4.*ATAN(1.)
+      pi180 = pi/ 180.
+
+      arg = 1
+     
+      CALL ef_get_box_limits(id, ARG1, X_AXIS, arg_lo_ss(X_AXIS, ARG1), 
+     .   arg_hi_ss(X_AXIS, ARG1), 
+     .   in_lon_lat(1,1,1,1), in_lon_lat(1,3,1,1))
+
+! last box upper limit
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      in_lon_lat(nx+1,1,1,1) = in_lon_lat(nx,3,1,1)
+
+c      idim = 1
+c      CALL EF_GET_COORDINATES (id, arg, idim,
+c     .     arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)+1, 
+c     .     in_lon_lat(1,1,1,1) )
+
+! Transform degrees to radians
+
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2
+      DO i = 1, nx
+        rad_lon_lat(i, 1, 1, 1) = pi180* in_lon_lat(i,1,1,1)
+      ENDDO
+
+      CALL ef_get_box_limits(id, ARG1, Y_AXIS, arg_lo_ss(Y_AXIS, ARG1), 
+     .   arg_hi_ss(Y_AXIS, ARG1), 
+     .   in_lon_lat(1,2,1,1), in_lon_lat(1,4,1,1))
+
+! last box upper limit
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      in_lon_lat(ny+1,2,1,1) = in_lon_lat(ny,4,1,1)
+
+c      idim = 2
+c      CALL EF_GET_COORDINATES (id, arg, idim,
+c     .     arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)+1, 
+c     .     in_lon_lat(1,2,1,1) )
+
+! Transform degrees to radians
+
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 2
+      DO i = 1, ny
+        rad_lon_lat(i, 2, 1, 1) = pi180* in_lon_lat(i,2,1,1)
+      ENDDO
+
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+         DO i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            out_lon(i, j, 1, 1) = pi180* arg_2(i,j,k2,l2)
+         ENDDO
+      ENDDO
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO j = arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3)
+         DO i = arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+            out_lat(i, j, 1, 1) = pi180* arg_3(i,j,k3,l3)
+         ENDDO
+      ENDDO
+
+      CALL ef_get_axis_info(id,ARG1,axname,ax_units,back,modulo,reg)
+
+      interp_method = 2
+!      WRITE(*,*) 'Using bilinear regridding !!'
+
+! Number of missing cells to allow (0 to 3)
+
+      CALL ef_get_one_val (id, 4, missing_permit)
+      IF (missing_permit .LT. 0 .OR. missing_permit .GT. 3) 
+     .    CALL ef_bail_out (id, 'argument 6 must be between 0 and 3')
+
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+! nlon_src and nlat_src without the extra element for upper grid box (why?)
+
+      nlon_src = nx-1
+      nlat_src = ny-1
+      nlon_dst = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+
+      verbose = 0
+      CALL horiz_interp_init_bili (id, wti, wtj, i_lon, j_lat,  
+     .   nlon_src, nlat_src, nlon_dst, nlat_dst, interp_method, 
+     .   rad_lon_lat(1,1,1,1), rad_lon_lat(1,2,1,1), out_lon, out_lat, 
+     .   verbose, modulo(1) )
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO l = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            CALL horiz_interp_bili ( wti, wtj, i_lon, j_lat,  
+     .                    nlon_src, nlat_src, nlon_dst, 
+     .                    nlat_dst, interp_method, 
+     .                    arg_1(i1,j1,k1,l1), result(i,j,k,l),
+     .                    verbose, bad_flag(ARG1), bad_flag_result,
+     .                    missing_permit)
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! subroutine rect_to_curv_compute
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+*    horiz_interp_init_bili
+
+! From module hinterp_subs_mod
+
+
+! <CONTACT EMAIL='bw at gfdl.noaa.gov'>
+!   Bruce Wyman
+! </CONTACT>
+
+! <HISTORY SRC='http://www.gfdl.noaa.gov/fms-cgi-bin/cvsweb.cgi/FMS/'/>
+
+! <OVERVIEW>
+!   Performs spatial interpolation between grids.
+! </OVERVIEW>
+
+! <DESCRIPTION>
+!     This module can interpolate data from rectangular/tripolar grid
+!     to rectangular/tripolar grid. Three interpolation schems are used here.
+!     when the source grid is tripolar grid, inverse of square distance weighted
+!     scheme (spherical regrid) is used. When the source grid is rectangular 
+!     longitude/latitude grid, any one of following three schemes can be applied: 
+!     conservation scheme that conserves the area-weighed integral of the input field, 
+!     bilinear interpolation that use the surround four source grid to interpolate onto
+!     the destination grid, spherical regrid that use thes inverse of square distance
+!     as weight. User can choose the interpolation method in the horiz_interp_init.
+!     when the source grid is rectangular grid (1D), the default method is conserve
+!     scheme. When the source grid is tripolar grid (2D), spherical regrid is the 
+!     default algorithm and no other scheme can be applied. 
+
+!     There is an optional mask field for missing input data.
+!     An optional output mask field may be used in conjunction with
+!     the input mask to show where output data exists.
+! </DESCRIPTION>
+
+!-----------------------------------------------------------------------
+!
+!        Performs spatial interpolation between grids.
+!
+!-----------------------------------------------------------------------
+
+      
+
+
+!---- interfaces ----
+
+
+
+! <INTERFACE NAME='horiz_interp_init'>
+!   <OVERVIEW>
+!      Allocates space and initializes a derived-type variable
+!      that contains pre-computed interpolation indices and weights.
+!   </OVERVIEW>
+!   <DESCRIPTION>
+!      Allocates space and initializes a derived-type variable
+!      that contains pre-computed interpolation indices and weights
+!      for improved performance of multiple interpolations between
+!      the same grids. This routine does not need to be called if you
+!      are doing a single grid-to-grid interpolation.
+!   </DESCRIPTION>
+!   <IN NAME='lon_in' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians'>
+!      Longitude (in radians) for source data grid. when lon_in is 1D, it is the longitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lon_in is 2D, there are two cases: one is the longitude edges stored as
+!      pairs for each grid box (when interp_method is 1(conservative)), the other is the longitude
+!      of the center of each grid box. 
+!   </IN>
+!   <IN NAME='lat_in' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians'>
+!      Latitude (in radians) for source data grid. when lat_in is 1D, it is the latitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lat_in is 2D, it is the longitude of the center of each grid box.
+!      When interp_method is 1(conservative) or 2(bilinear), lon_in should be 1D.
+!   </IN>
+!   <IN NAME='lon_out' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians' >
+!      Longitude (in radians) for source data grid. when lon_in is 1D, it is the longitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lon_in is 2D, there are two cases: one is the longitude edges stored as
+!      pairs for each grid box (when interp_method is 1), the other is the longitude
+!      of the center of each grid box (when interp_method is 2). 
+!   </IN>
+!   <IN NAME='lat_out' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians' >
+!      Latitude (in radians) for source data grid. when lat_in is 1D, it is the latitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lat_in is 2D, there are two cases: one is the latitude edges stored as
+!      pairs for each grid box (when interp_method is 1), the other is the latitude
+!      of the center of each grid box (when interp_method is 2).
+!   </IN>
+!   <IN NAME='verbose' TYPE='integer'>
+!      Integer flag that controls the amount of printed output.
+!      verbose = 0, no output; = 1, min,max,means; = 2, still more
+!   </IN>
+!   <IN NAME='interp_method' TYPE='integer'> 
+!      interpolation method, = 1, using conservation scheme,
+!      = 2, using bilinear interpolation, = SPHERICA(3),using spherical regrid.
+!      when source grid is 1d, default value is CONSERVE; when source grid is 2d,
+!      default value is 'SPHERICA'.
+!   </IN>
+!   <IN NAME = 'src_modulo' >
+!      Indicate the source data grid is cyclic or not.
+!   </IN>
+!   <OUT NAME='Interp' >
+!      A derived-type variable containing indices and weights used for subsequent 
+!      interpolations. To reinitialize this variable for a different grid-to-grid 
+!      interpolation you must first use the 'horiz_interp_end' interface.
+!   </OUT>
+
+
+! </INTERFACE>
+
+
+C      real wti(nlon_dst,nlon_dst,2)      !weights for bilinear interpolation 
+C      real wtj(nlat_dst,nlat_dst,2)
+C      integer i_lon(nlon_dst,nlon_dst,2) !indices for bilinear interpolation 
+C      integer j_lat(nlat_dst,nlat_dst,2)
+C      integer nlon_src, nlat_src         !size of source grid
+C      integer nlon_dst, nlat_dst         !size of destination grid
+C      integer interp_method              !interpolation method.
+                                         !  =1, conservative scheme
+                                         !  =2, bilinear interpolation
+                                         !  =3, spherical regrid
+
+
+C Interp list:
+C wti, wtj, i_lon, j_lat, nlon_src, nlat_src, nlon_dst, nlat_dst, interp_method 
+
+C Interp allocation from subroutine horiz_interp_init_bili 
+
+      subroutine horiz_interp_init_bili (id, wti, wtj, i_lon, j_lat,  
+     .   nlon_src, nlat_src, nlon_dst,nlat_dst, interp_method, 
+     .   lon_in, lat_in, lon_out, lat_out, verbose, src_modulo )
+
+!-----------------------------------------------------------------------
+C inputs
+C  From type horiz_interp_type, variable Interp
+
+
+      real wti(nlon_dst,nlat_dst,2)      !weights for bilinear interpolation 
+      real wtj(nlon_dst,nlat_dst,2)
+      integer i_lon(nlon_dst,nlat_dst,2) !indices for bilinear interpolation 
+      integer j_lat(nlon_dst,nlat_dst,2)
+      integer nlon_src, nlat_src         !size of source grid
+      integer nlon_dst, nlat_dst         !size of destination grid
+      integer interp_method              !interpolation method.
+
+C Other inputs
+
+      real lon_in(*) , lat_in(*)
+      real lon_out(nlon_dst,nlat_dst), lat_out(nlon_dst,nlat_dst)
+      integer id, verbose
+      logical src_modulo
+!-----------------------------------------------------------------------
+C  Other declarations
+
+      integer INDP, nlon_in, nlat_in, nlon_out, nlat_out, n, m,
+     .   i, j, ie, is, je, js, istart, jstart, iend, jend, 
+     .   ln_err, lt_err, na, warns
+      real wtw, wte, wts, wtn, lon, lat, pi, tpi, hpi,      
+     .   glt_min, glt_max, gln_min, gln_max, min_lon, max_lon
+
+! parameters
+      real epsln, large
+      integer stdout 
+      parameter (epsln=1.e-10, large=1.e20, stdout = 6)
+
+      pi  =  3.14159265358979323846 
+      hpi = 0.5*pi
+      tpi = 4.0*hpi
+      glt_min = hpi
+      glt_max = -hpi
+      gln_min = tpi
+      gln_max = -tpi
+      min_lon = 0.0
+      max_lon = tpi
+      ln_err = 0
+      lt_err = 0
+
+      warns = verbose
+
+      nlon_in = nlon_src  
+      nlat_in = nlat_src
+      nlon_out = nlon_dst
+      nlat_out = nlat_dst
+
+      if(lon_in(nlon_in) - lon_in(1) .gt. tpi + epsln) 
+     . call ef_bail_out (id, 
+     . 'The range of source grid longitude may be no larger than tpi')
+
+      if(lon_in(1) .lt. 0.0) then
+        min_lon = lon_in(1)
+        max_lon = lon_in(nlon_in)
+      endif
+
+!     find longitude points of data within interval [-360., 360.]
+      istart = 1
+      do i=2,nlon_in
+        if (lon_in(i-1) .lt. -tpi .and. lon_in(i) .ge. -tpi) istart = i
+      enddo 
+      iend = nlon_in
+      do i=2,nlon_in
+        if (lon_in(i-1) .lt. tpi  .and. lon_in(i) .ge. tpi) iend = i
+      enddo
+
+!     find latitude points of data within interval [-90., 90.]
+      jstart = 1
+      do j=2,nlat_in
+        if (lat_in(j-1) .lt. -1.0 * hpi .and. 
+     .      lat_in(j  ) .ge. -1.0 * hpi) jstart = j
+      enddo 
+      jend = nlat_in
+      do j=2,nlat_in
+        if (lat_in(j-1) .lt. hpi .and. lat_in(j) .ge.hpi ) jend = j
+      enddo
+
+      do n = 1, nlat_out
+      do m = 1, nlon_out
+        lon = lon_out(m,n)
+        lat = lat_out(m,n)
+
+        if(lon .lt. min_lon) then
+         lon = lon + tpi
+        else if(lon .gt. max_lon) then
+         lon = lon - tpi
+        endif
+! when the input grid is in not cyclic, the output grid should located inside
+! the input grid
+      if(.not. src_modulo) then
+        if((lon .lt. lon_in(1)) .or. (lon .gt. lon_in(nlon_in))) 
+     .   call ef_bail_out(id, 
+     .'input grid not modulo, output grid must be inside input grid')
+
+
+      endif
+
+      glt_min = min(lat,glt_min)
+      glt_max = max(lat,glt_max)
+      gln_min = min(lon,gln_min)
+      gln_max = max(lon,gln_max)
+
+      na = iend - istart + 1
+      is = INDP(lon, lon_in(istart), na ) + istart - 1
+      if( lon_in(is) .gt. lon ) is = max(is - 1,istart)
+      if( lon_in(is) .eq. lon .and. is .eq. nlon_in) 
+     .      is = max(is - 1,istart)
+      ie = min(is+1,iend)
+      if(lon_in(is) .ne. lon_in(ie) .and. lon_in(is) .le. lon) then
+        wtw = ( lon_in(ie) - lon) / (lon_in(ie) - lon_in(is) )
+      else
+! east or west of the last data value. this could be because a
+! cyclic condition is needed or the dataset is too small. 
+        ln_err = 1
+        ie = istart
+        is = iend
+        if (lon_in(ie) .ge. lon ) then
+           wtw = (lon_in(ie) -lon)/(lon_in(ie)-lon_in(is)+tpi+epsln)
+        else
+          wtw = (lon_in(ie) -lon+tpi+epsln)/
+     .          (lon_in(ie)-lon_in(is)+tpi+epsln)
+        endif   
+      endif
+      wte = 1. - wtw
+
+      na = jend - jstart + 1
+      js = INDP(lat, lat_in(jstart), na ) + jstart - 1
+
+      if( lat_in(js) .gt. lat ) js = max(js - 1, jstart)
+      if( lat_in(js) .eq. lat .and. js .eq. jend) 
+     .     js = max(js - 1, jstart)
+      je = min(js + 1, jend)
+
+      if ( lat_in(js) .ne. lat_in(je) .and. lat_in(js) .le. lat) then
+        wts = ( lat_in(je) - lat )/(lat_in(je)-lat_in(js))
+      else
+!     north or south of the last data value. this could be because a
+!     pole is not included in the data set or the dataset is too small.
+!     in either case extrapolate north or south
+         lt_err = 1
+         wts = 1.
+      endif
+
+      wtn = 1. - wts
+      
+            i_lon (m,n,1) = is
+            i_lon (m,n,2) = ie
+            j_lat (m,n,1) = js
+            j_lat (m,n,2) = je
+            wti   (m,n,1) = wtw
+            wti   (m,n,2) = wte
+            wtj   (m,n,1) = wts
+            wtj   (m,n,2) = wtn
+      
+      enddo
+      enddo
+      if (ln_err .eq. 1 .and. warns .GT. 0) then
+        write (stdout,'(/,(1x,a))') 
+     . '==> Warning: the geographic data set does not extend far   ', 
+     . '             enough east or west - a cyclic boundary       ', 
+     . '             condition was applied. check if appropriate   '
+         write (stdout,'(/,(1x,a,2f8.4))') 
+     . '    data required between longitudes:', gln_min, gln_max,     
+     . '    data set is between longitudes:', 
+     .   lon_in(istart), lon_in(iend)
+         warns = warns - 1
+       endif
+!
+       if (lt_err .eq. 1 .and. warns .GT. 0) then
+         write (stdout,'(/,(1x,a))')
+     . '==> Warning: the geographic data set does not extend far   ',
+     . '             enough north or south - extrapolation from    ',
+     . '             the nearest data was applied. this may create ',
+     . '             artificial gradients near a geographic pole   ' 
+         write (stdout,'(/,(1x,a,2f8.4))')
+     . '    data required between latitudes:', glt_min, glt_max,
+     . '      data set is between latitudes:', 
+     .   lat_in(jstart), lat_in(jend)
+         warns = warns - 1
+       endif
+
+       return
+
+      end ! subroutine horiz_interp_init_bili
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+      subroutine horiz_interp_bili ( wti, wtj, i_lon, j_lat,  
+     .                    nlon_src, nlat_src, nlon_dst, 
+     .                    nlat_dst, interp_method, 
+
+     .                    data_in, data_out, verbose, 
+     .                    missing_value,  missing_result, 
+     .                    missing_permit)
+!-----------------------------------------------------------------------
+
+
+!-----------------------------------------------------------------------
+C  From type horiz_interp_type, variable Interp
+
+      real wti(nlon_dst,nlat_dst,2)      !weights for bilinear interpolation 
+      real wtj(nlon_dst,nlat_dst,2)
+      integer i_lon(nlon_dst,nlat_dst,2) !indices for bilinear interpolation 
+      integer j_lat(nlon_dst,nlat_dst,2)
+      integer nlon_src, nlat_src         !size of source grid
+      integer nlon_dst, nlat_dst         !size of destination grid
+      integer interp_method              !interpolation method.
+
+      real data_in(nlon_src, nlat_src)   ! input
+      real data_out(nlon_dst, nlat_dst)  ! output
+      integer verbose
+      real missing_value                 ! missing flag of input
+      real missing_result                ! missing flag for result
+      real missing_permit                ! Number of missing cells to allow
+!-----------------------------------------------------------------------
+      integer nlon_in, nlat_in, nlon_out, nlat_out, n, m,
+     .            is, ie, js, je, iverbose, num_missing, 
+     .            miss_in, miss_out
+      real  dwtsum, wtsum, min_in, max_in, avg_in, 
+     .            min_out, max_out, avg_out, wtw, wte, wts, wtn
+      real data(4)
+
+! parameters
+      real epsln, large
+      parameter (epsln=1.e-10, large=1.e20)
+
+      nlon_in  = nlon_src
+      nlat_in  = nlat_src
+      nlon_out = nlon_dst
+      nlat_out = nlat_dst
+
+      iverbose = verbose
+
+      do n = 1, nlat_out
+      do m = 1, nlon_out
+      data_out(m,n) = 0.0
+
+      is = i_lon (m,n,1) 
+      ie = i_lon (m,n,2)
+      js = j_lat (m,n,1)
+      je = j_lat (m,n,2)
+      wtw = wti(m,n,1)
+      wte = wti(m,n,2)
+      wts = wtj(m,n,1)
+      wtn = wtj(m,n,2)
+      data(1) = data_in(is,js)
+      data(2) = data_in(ie,js)
+      data(3) = data_in(ie,je)
+      data(4) = data_in(is,je)
+
+      call data_sum_bilinear ( data, wtw,wte, wts,wtn, dwtsum, wtsum, 
+     .   num_missing, missing_value)
+
+      if (num_missing .gt. missing_permit .or. wtsum .lt. epsln) then
+        data_out(m,n) = missing_result
+      else
+        data_out(m,n) = dwtsum/wtsum
+      endif
+      enddo
+      enddo
+
+!***********************************************************************
+! compute statistics: minimum, maximum, and mean
+!-----------------------------------------------------------------------
+
+!!      if (iverbose .GT. 0) then
+!!
+!!! compute statistics of input data
+!!
+!!       call stats_type2 (data_in, min_in, max_in, avg_in, 
+!!   .           miss_in, missing_value)
+!!
+!!! compute statistics of output data
+!!       call stats_type2 (data_out, min_out, max_out, avg_out, 
+!!   .          miss_out, missing_value)
+!!
+!!!---- output statistics ----
+!!! root_pe have the information of global mean, min and max
+!!
+!!       write (*,900)
+!!       write (*,901)  min_in ,max_in, avg_in
+!!         write (*,903)  miss_in
+!!         write (*,902)  min_out,max_out,avg_out
+!!         write (*,903)  miss_out
+!! 900     format (/,1x,10('-'),' output from horiz_interp ',10('-'))
+!! 901     format ('  input:  min=',f16.9,'  max=',f16.9,'  avg=',f22.15)
+!! 902     format (' output:  min=',f16.9,'  max=',f16.9,'  avg=',f22.15)
+!! 903     format ('          number of missing points = ',i6)
+!!
+!!      endif
+
+
+      return
+
+      end ! subroutine horiz_interp_bili
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+       integer function INDP (value, array, ia)
+       real array(*)
+       real value
+       integer ia
+!
+!=======================================================================
+!
+!     INDP = index of nearest data point within "array" corresponding to
+!            "value".
+
+!     inputs:
+!     value  = arbitrary data...same units as elements in "array"
+!     array  = array of data points  (must be monotonically increasing)
+
+!     output:
+!     INDP =  index of nearest data point to "value"
+!             if "value" is outside the domain of "array" then INDP = 1
+!             or "ia" depending on whether array(1) or array(ia) is
+!             closest to "value"
+!=======================================================================
+!
+       integer i
+       logical keep_going
+!
+       do i=2,ia
+         if (array(i) .lt. array(i-1)) then
+         write (6,*) 
+     .   ' => Error: array must be monotonically increasing in "INDP"', 
+     .   '          when searching for nearest element to value=',value
+         write (6,*) '           array(i) < array(i-1) for i=',i 
+         write (6,*) '           array(i) for i=1..ia follows:'
+         stop
+        endif
+      enddo
+      if (value .lt. array(1) .or. value .gt. array(ia)) then
+        if (value .lt. array(1))  INDP = 1
+        if (value .gt. array(ia)) INDP = ia
+      else
+        i=1
+        keep_going = .true.
+        do while (i .le. ia .and. keep_going)
+          i = i+1
+          if (value .le. array(i)) then
+            INDP = i
+            if (array(i)-value .gt. value-array(i-1)) INDP = i-1
+            keep_going = .false.
+          endif
+        enddo
+      endif
+      return
+      end ! function INDP
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+      subroutine data_sum_bilinear ( data, wtw, wte, wts, wtn, 
+     .                               dwtsum, wtsum, num_missing,
+     .                               missing_value  )
+
+!  sums up the data and weights for a single output grid box
+!-----------------------------------------------------------------------
+      real data(*)
+      real wtw, wte, wts, wtn
+      real dwtsum, wtsum
+      integer num_missing
+      real missing_value
+
+!  dwtsum = sum(data*wt*mask)
+!  wtsum  = sum(wt*mask)
+
+      integer i
+      real wt1, wt2
+!-----------------------------------------------------------------------
+
+
+      num_missing = 0
+      dwtsum = 0.0
+      wtsum  = 0.0
+
+      do i = 1,4
+      if(data(i) .eq. missing_value) then
+         num_missing = num_missing + 1
+      else
+         if (i .eq. 1) then
+            wt1= wtw
+            wt2 = wts
+         else if (i .eq. 2) then
+            wt1= wte
+            wt2 = wts
+         else if (i .eq. 3) then
+            wt1= wte
+            wt2 = wtn
+         else if (i  .eq. 4) then
+            wt1= wtw 
+            wt2 = wtn
+         endif
+
+         dwtsum = dwtsum + data(i) * wt1 * wt2
+         wtsum  = wtsum + wt1 * wt2
+      endif
+      enddo
+
+      return
+      end ! subroutine data_sum_bilinear
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+!---This statistics is for bilinear interpolation and spherical regrid.
+
+!!      subroutine stats_type2 ( dat, low, high, avg, miss, missing_value,
+!!     .  nlon, nlat)
+!!
+!!      real dat(nlon,nlat)
+!!      real low, high, avg  ! output
+!!      integer miss         ! output
+!!      real  missing_value  ! input
+!!      integer nlon, nlat   ! input
+!!
+!!
+!!      real dsum, npts
+!!      integer n, m
+!!
+!!      dsum = 0.0
+!!      miss = 0
+!!      npts = 0
+!!
+!!      do n = 1, nlat
+!!      do m = 1, nlon
+!!      IF (dat(m,n) .NE. missing_value) THEN
+!!         npts = npts + 1
+!!         low = MIN( low, dat(m,n) )
+!!         high = MAX (high, dat(m,n) )
+!!         dsum = dsum + dat(m,n)
+!!      ELSE
+!!         miss = miss + 1
+!!      ENDIF
+!!      ENDDO
+!!      ENDDO
+!!
+!!      if(npts .EQ. 0) then
+!!         avg = missing_value
+!!      else
+!!         avg = dsum/real(npts)
+!!      endif
+!!   
+!!      return
+!!
+!!      end  ! subroutine stats_type2
+
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/external_functions/lanczos/Makefile b/external_functions/lanczos/Makefile
new file mode 100644
index 0000000..9ed5be4
--- /dev/null
+++ b/external_functions/lanczos/Makefile
@@ -0,0 +1,51 @@
+#
+# Makefile for Ferret External Functions
+#
+# lanczos function from Brett McDaniel was in
+# Fortran 90.  Translated to f77 by Ansley Manke  6/25/04
+#
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:    lanczos.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/lanczos/lanczos.F b/external_functions/lanczos/lanczos.F
new file mode 100644
index 0000000..ae1e754
--- /dev/null
+++ b/external_functions/lanczos/lanczos.F
@@ -0,0 +1,319 @@
+!
+! lanczos.F90
+!
+! Bill Ivor Gustafson, ivor at ucdavis.edu
+! 29-oct-1999
+!
+! This function bandpass filters the input data in time 
+! using a Lanczos filter.  For details see:
+!   Duchon, C. E., 1979: Lanczos filtering in one and two dimensions.
+!        J. of App. Met., 18, 1016-1022.
+!
+! lanczos function from Brett McDaniel was in 
+! Fortran 90.  Translated to f77 by Ansley Manke, PMEL  6/25/04
+!   -change include files
+!   -allocate weight array with a lanczos_init function
+!   -change cycle and exit statements in loop 100 of 
+!    compute function to GOTO's
+!
+! In this subroutine we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE lanczos_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+! **********************************************************************
+!                                            USER CONFIGURABLE PORTION |
+!                                                                      |
+!                                                                      V
+
+      CALL ef_set_desc(id, 
+     .      'Bandpass filters data in time using a Lanczos filter' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .      IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'Data to be filtered in time (may also vary in x,y,z)')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'F1')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'Low frequency cutoff')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F2')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'High frequency cutoff')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'N')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'Number of weights (must be odd)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+!                                                                      ^
+!                                                                      |
+!                                            USER CONFIGURABLE PORTION |
+! **********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE lanczos_init
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE lanczos_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*
+* Set the work array X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER array_num, arg, nn
+      REAL val
+
+
+      arg = 4
+      CALL ef_get_one_val(id, arg, val)  
+
+      nn = val
+
+      array_num = 1
+
+! dimensions for weight array: nn = arg4
+
+      CALL ef_set_work_array_dims(id, array_num,
+     .     0, 0, 0, 0, 
+     .     nn, 0, 0, 0)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END ! SUBROUTINE lanczos_work_size
+
+
+
+      SUBROUTINE lanczos_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .                           result, weight)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .       mem1loz:mem1hiz, mem1lot:mem1hit),     
+     .      arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .       mem2loz:mem2hiz, mem2lot:mem2hit),     
+     .      arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .       mem3loz:mem3hiz, mem3lot:mem3hit),     
+     .      arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .        memresloz:memreshiz, memreslot:memreshit)
+
+      REAL weight(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+     
+! After initialization, the 'res_' arrays contain indexing information 
+! for the result axes.  The 'arg_' arrays will contain the indexing 
+! information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS), 
+     .        arg_incr(4,1:EF_MAX_ARGS)
+
+! **********************************************************************
+!                                            USER CONFIGURABLE PORTION |
+!                                                                      |
+!                                                                      V
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      integer m,nn
+      real aa,bb,f1,f2,pi,pik,sigma
+      real da
+
+      pi  = acos(-1.)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+! Get the counter values to cycle through, nw=2*nn+1...
+      i = arg_lo_ss(X_AXIS,ARG4)
+      j = arg_lo_ss(Y_AXIS,ARG4)
+      k = arg_lo_ss(Z_AXIS,ARG4)
+      l = arg_lo_ss(T_AXIS,ARG4)
+      if( mod(int(arg_4(i,j,k,l)),2) .EQ. 0 ) then
+         CALL EF_BAIL_OUT(id,'The number of weights must be odd.')
+      else
+         nn = ( arg_4(i,j,k,l)-1 )/2
+      endif
+
+! Calculate the weights...
+
+      i  = arg_lo_ss(X_AXIS,ARG2)
+      j  = arg_lo_ss(Y_AXIS,ARG2)
+      k  = arg_lo_ss(Z_AXIS,ARG2)
+      l  = arg_lo_ss(T_AXIS,ARG2)
+      f1 = arg_2(i,j,k,l)
+
+      i  = arg_lo_ss(X_AXIS,ARG3)
+      j  = arg_lo_ss(Y_AXIS,ARG3)
+      k  = arg_lo_ss(Z_AXIS,ARG3)
+      l  = arg_lo_ss(T_AXIS,ARG3)
+      f2 = arg_3(i,j,k,l)
+
+      weight(0,0,0,0)  = 2.*(f2-f1)
+      do k = 1,nn
+         pik   = pi*k
+         aa    = pik/nn
+         sigma = sin(aa)/aa
+         aa    = 2.*pik*f1
+         bb    = 2.*pik*f2
+         weight( k,0,0,0) = ( sin(bb)/pik - sin(aa)/pik )*sigma
+      end do
+
+c      print*,'Weights for k=0,...,n:'
+c      print*,(weight(k,0,0,0), k=0,nn)
+
+! For testing, calculate the response function...
+c      da = .0005
+c      aa = 0.0
+c      do while( aa .LT. .5 )
+c         bb = 0.
+c         do i = 1,nn
+c            bb = bb + weight(i,0,0,0)*cos(2.*pi*aa*float(i))
+c         end do
+c         bb = weight(0,0,0,0) + 2.*bb
+c         write(11,*) aa,bb
+c         aa = aa+da
+c      end do
+
+      if( res_hi_ss(T_AXIS) - res_lo_ss(T_AXIS) .LT. 2*nn ) then
+         CALL EF_BAIL_OUT(id, 
+     .     'Too many weights exist for the number of times present.')
+      endif
+
+! Apply the weights to the data...
+! NOTE:  The array indexes are setup inefficiently, but that's 
+!        how the Ferret folks set it up.
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+             do l=res_lo_ss(T_AXIS),res_lo_ss(T_AXIS)+nn-1
+                result(i,j,k,l) = bad_flag_result
+             end do
+             do l=res_hi_ss(T_AXIS)-nn+1,res_hi_ss(T_AXIS)
+                result(i,j,k,l) = bad_flag_result
+             end do
+
+             DO 100 l=res_lo_ss(T_AXIS)+nn, res_hi_ss(T_AXIS)-nn
+                if( arg_1(i1,j1,k1,l) .EQ. bad_flag(1) ) then
+                   result(i,j,k,l) = bad_flag_result
+                   GOTO 100
+                end if
+                result(i,j,k,l) = weight(0,0,0,0)*arg_1(i1,j1,k1,l)
+
+                do m = 1,nn
+                   if( arg_1(i1,j1,k1,l-m) .EQ. bad_flag(1) 
+     .                   .or. arg_1(i1,j1,k1,l+m) .EQ. bad_flag(1))then
+                       result(i,j,k,l) = bad_flag_result
+                    GOTO 110
+                   end if
+                   result(i,j,k,l) = result(i,j,k,l) + weight(m,0,0,0)* 
+     .                   ( arg_1(i1,j1,k1,l-m) + arg_1(i1,j1,k1,l+m) )
+                end do
+110             continue
+
+100          end do
+
+             k1 = k1 + arg_incr(Z_AXIS,ARG1)
+200        end do
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+300      end do
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+400   end do
+     
+!                                                                      ^
+!                                                                      |
+!                                            USER CONFIGURABLE PORTION |
+! **********************************************************************
+
+      RETURN 
+      END ! SUBROUTINE lanczos_compute
+
diff --git a/external_functions/lanczos/orig_code/lanczos.tar b/external_functions/lanczos/orig_code/lanczos.tar
new file mode 100644
index 0000000..505d9df
Binary files /dev/null and b/external_functions/lanczos/orig_code/lanczos.tar differ
diff --git a/external_functions/las/Makefile b/external_functions/las/Makefile
new file mode 100644
index 0000000..ce16f7f
--- /dev/null
+++ b/external_functions/las/Makefile
@@ -0,0 +1,56 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+#all:	write_webrow.so write_webrow_gwt.so list_value_xml.so
+all:	write_webrow_gwt.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/las/list_value_xml.F b/external_functions/las/list_value_xml.F
new file mode 100644
index 0000000..1087d62
--- /dev/null
+++ b/external_functions/las/list_value_xml.F
@@ -0,0 +1,317 @@
+*
+* list_value_xml.F
+*
+* Ansley Manke
+* May 24, 2011
+*
+* This function writes a string value to an xml string, and with a given tag 
+* and option to enclose it in CDATA escape. e.g.
+*
+*		<label><![CDATA[Z (m):]]></label>
+*		<value><![CDATA[0]]></value>
+*
+* it then lists the string to the named file.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE list_value_xml_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('write a string in xml format with specified ',
+     .        'tag and optional CDATA escape sequence')
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, 
+     .			NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'tag')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'tag to open and close with')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'value')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'single string value to write')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'cdata_flag')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .'enter 1 to request CDATA escape, 0 otherwise')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'outputfile')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'the filename to write to')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE list_value_xml_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo, my_hi, nx, ny
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the argument.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+      my_lo = 1
+      my_hi = 1
+
+      arg = 1
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE list_value_xml_compute(id, arg_1, arg_2, arg_3, 
+     .           arg_4, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy,
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(2,mem4lox:mem4hix, mem4loy:mem4hiy,
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i3, j3, k3, l3
+      INTEGER TM_LENSTR1, vlen, tlen, slen
+      CHARACTER*2048 outstring, first, second, third
+      CHARACTER*2048 outfile
+      CHARACTER*50 tag
+      CHARACTER*2048 value
+      CHARACTER*100 errtxt
+      INTEGER cdata_flag
+
+*  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4), tmodulo
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_result_type(id, rtype)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+*     Get the tag (string)
+      CALL ef_get_string_arg_element(id, ARG1, arg_1,
+     .     i1,j1,k1,l1,tlen,tag)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+*     Get the value (string)
+      CALL ef_get_string_arg_element(id, ARG2, arg_2,
+     .     i2,j2,k2,l2,vlen,value)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      cdata_flag = INT(arg_3(i3,j3,k3,l3))
+
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+*     Get the value (string)
+      CALL ef_get_string_arg_element(id, ARG4, arg_4,
+     .     i4,j4,k4,l4,flen,outfile)
+
+
+*		<value><![CDATA[0]]></value>
+*		<value>0</value>
+
+1000  FORMAT('<',a, '><![CDATA[')
+1010  FORMAT(a, ']]></', a, '>')
+1020  FORMAT(a, '>')
+1030  FORMAT('<',a, '>')
+1040  FORMAT(a, '</')
+1050  FORMAT(a, '>')
+1060  FORMAT(a)
+
+      IF (cdata_flag .EQ. 1) THEN
+         write (first,  1000) tag(1:tlen)
+         write (second, 1010) value(1:vlen)
+         write (third , 1020) tag(1:tlen)
+	 tlen = TM_LENSTR1(first)
+	 vlen = TM_LENSTR1(second)
+	 slen = TM_LENSTR1(third)
+         outstring = first(1:tlen)//second(1:vlen)//third(1:slen)
+      ELSE
+         write (first,  1030) tag(1:tlen)
+         write (second, 1040) value(1:vlen)
+         write (third , 1050) tag(1:tlen)
+	 tlen = TM_LENSTR1(first)
+	 vlen = TM_LENSTR1(second)
+	 slen = TM_LENSTR1(third)
+         outstring = first(1:tlen)//second(1:vlen)//third(1:slen)
+      ENDIF
+      vlen = TM_LENSTR1(outstring)
+      
+
+
+      iunit = 19
+
+       OPEN( UNIT        = iunit,
+     .       FILE        = outfile,
+     .       FORM        = 'FORMATTED',
+     .       ACCESS      = 'APPEND',
+     .       ERR         = 5010 )
+
+      WRITE (iunit, 1060) outstring(1:vlen)
+      CLOSE (iunit, ERR = 5020 )
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      result(i,j,k,l) = 1
+
+      RETURN
+     
+5010  CONTINUE
+      WRITE(errtxt,*) 'Error opening file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+5020  CONTINUE
+      WRITE(errtxt,*) 'Error closing file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/las/write_webrow.F b/external_functions/las/write_webrow.F
new file mode 100644
index 0000000..28d0204
--- /dev/null
+++ b/external_functions/las/write_webrow.F
@@ -0,0 +1,271 @@
+*
+* write_webrow.F
+*
+* Ansley Manke
+* April 2009
+*
+* This function writes a special webrowset file for LAS
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE write_webrow_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Write a webrowset file with cruise numbers and IDs')
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id,  ABSTRACT,
+     .     NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'id')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise IDs (string)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'name')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise name (string)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'Cruise_Mask')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Mask =1 at start of each cruise')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'filename')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Filename to write')
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE write_webrow_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nx
+
+      nx = 1
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE write_webrow_compute(id, arg_1, arg_2, arg_3, arg_4, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER slen, blen, iunit, icruise, nd
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 fname
+      CHARACTER*100 errtxt
+      CHARACTER*512 buff, buff_cname
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Get file name
+
+      arg = 4
+      CALL ef_get_arg_string(id, arg, fname)
+
+      iunit = 19
+
+       OPEN( UNIT        = iunit,
+     .       FILE        = fname,
+     .       FORM        = 'FORMATTED',
+     .       ACCESS      = 'SEQUENTIAL',
+     .       STATUS      = 'REPLACE',
+     .       ERR         = 5010 )
+
+* Write webrowset header.
+
+      buff = "<?xml version='1.0'?>"
+      slen = 21
+      WRITE (iunit, 1000) buff(1:slen)
+ 1000 FORMAT(A)
+      buff = "<webRowSet>"
+      slen = 99
+      WRITE (iunit, 1000) buff(1:slen)
+
+      WRITE (iunit, *) '<data>'
+
+* Write cruise ids and numbers to the webrowset file...
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      i = res_lo_ss(X_AXIS)
+
+* If the cruise_name is different from the cruise_id,
+* write the cruise_name in parentheses after the ID.
+
+      icruise = 0
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         IF (arg_3(i1,j1,k1,l1) .NE. bad_flag(ARG3)) THEN
+            icruise = icruise + 1 
+	    IF (icruise .LT. 10) 
+     .	       WRITE (iunit, 1010) icruise
+	    IF (icruise .GE. 10 .AND. icruise .LT. 100) 
+     .	       WRITE (iunit, 1012) icruise
+	    IF (icruise .GE. 100) 
+     .	        WRITE (iunit, 1014) icruise
+	    IF (icruise .GE. 1000) 
+     .	        WRITE (iunit, 1015) icruise
+
+            CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                          i1,j1,k1,l1, slen, buff)
+            CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                          i1,j1,k1,l1, blen, buff_cname)
+            IF (slen .EQ. blen) THEN
+	       IF (buff(:slen) .EQ. buff_cname(:slen)) blen = 0
+	    ENDIF
+            IF (blen .GT. 0) THEN
+	       buff(slen+1:slen+2) = ' ('
+	       slen = slen + 2
+	       buff(slen+1:slen+blen) = buff_cname(:blen)
+	       slen = slen + blen
+	       buff(slen+1:slen+1) = ')'
+	       slen = slen + 1
+	    ENDIF
+
+            WRITE (iunit, 1020) buff(1:slen)
+	 ENDIF
+ 100  CONTINUE
+
+1010  FORMAT('<currentRow>'/'<columnValue>'/I1/'</columnValue>')
+1012  FORMAT('<currentRow>'/'<columnValue>'/I2/'</columnValue>')
+1014  FORMAT('<currentRow>'/'<columnValue>'/I3/'</columnValue>')
+1015  FORMAT('<currentRow>'/'<columnValue>'/I4/'</columnValue>')
+1020  FORMAT('<columnValue>'/A/'</columnValue>'/'</currentRow>')
+
+* Write closing tag.
+      WRITE (iunit, 1030) 
+1030  FORMAT ('</data>'/'</webRowSet>')
+
+      CLOSE (iunit, ERR = 5020 )
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(Y_AXIS)
+      result(i,j,k,l) = 1.
+
+      RETURN 
+
+5010  CONTINUE
+      WRITE(errtxt,*) 'Error opening file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+5020  CONTINUE
+      WRITE(errtxt,*) 'Error closing file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
diff --git a/external_functions/las/write_webrow_gwt.F b/external_functions/las/write_webrow_gwt.F
new file mode 100644
index 0000000..63f624b
--- /dev/null
+++ b/external_functions/las/write_webrow_gwt.F
@@ -0,0 +1,271 @@
+*
+* write_webrow_gwt.F
+*
+* Ansley Manke
+* April 2009
+*
+* This function writes a special webrowset file for LAS
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE write_webrow_gwt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+      CHARACTER*100 descrip
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      WRITE (descrip, 100)
+      CALL ef_set_desc(id, descrip)
+  100 FORMAT ('Write a webrowset file with cruise numbers and IDs')
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id,  ABSTRACT,
+     .     NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'id')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise IDs (string)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'name')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise name (string)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'Cruise_Mask')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Mask =1 at start of each cruise')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'filename')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Filename to write')
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE write_webrow_gwt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER nx
+
+      nx = 1
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE write_webrow_gwt_compute(id, arg_1, arg_2, arg_3, arg_4, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER slen, blen, iunit, icruise, nd
+      INTEGER i1,j1,k1,l1, i2,j2,k2,l2
+      CHARACTER*512 fname
+      CHARACTER*100 errtxt
+      CHARACTER*512 buff, buff_cname
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Get file name
+
+      arg = 4
+      CALL ef_get_arg_string(id, arg, fname)
+
+      iunit = 19
+
+       OPEN( UNIT        = iunit,
+     .       FILE        = fname,
+     .       FORM        = 'FORMATTED',
+     .       ACCESS      = 'SEQUENTIAL',
+     .       STATUS      = 'REPLACE',
+     .       ERR         = 5010 )
+
+* Write webrowset header.
+
+      buff = "<?xml version='1.0'?>"
+      slen = 21
+      WRITE (iunit, 1000) buff(1:slen)
+ 1000 FORMAT(A)
+      buff = "<webRowSet>"
+      slen = 99
+      WRITE (iunit, 1000) buff(1:slen)
+
+      WRITE (iunit, *) '<data>'
+
+* Write cruise ids and numbers to the webrowset file...
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      i = res_lo_ss(X_AXIS)
+
+* If the cruise_name is different from the cruise_id,
+* write the cruise_name in parentheses after the ID.
+
+      icruise = 0
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         IF (arg_3(i1,j1,k1,l1) .NE. bad_flag(ARG3)) THEN
+            icruise = icruise + 1 
+	    IF (icruise .LT. 10) 
+     .	       WRITE (iunit, 1010) icruise
+	    IF (icruise .GE. 10 .AND. icruise .LT. 100) 
+     .	       WRITE (iunit, 1012) icruise
+	    IF (icruise .GE. 100) 
+     .	        WRITE (iunit, 1014) icruise
+	    IF (icruise .GE. 1000) 
+     .	        WRITE (iunit, 1015) icruise
+
+            CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                          i1,j1,k1,l1, slen, buff)
+            CALL EF_GET_STRING_ARG_ELEMENT(id, ARG2, arg_2,
+     .                          i1,j1,k1,l1, blen, buff_cname)
+            IF (slen .EQ. blen) THEN
+	       IF (buff(:slen) .EQ. buff_cname(:slen)) blen = 0
+	    ENDIF
+            IF (blen .GT. 0) THEN
+	       buff(slen+1:slen+2) = ' ('
+	       slen = slen + 2
+	       buff(slen+1:slen+blen) = buff_cname(:blen)
+	       slen = slen + blen
+	       buff(slen+1:slen+1) = ')'
+	       slen = slen + 1
+	    ENDIF
+
+            WRITE (iunit, 1020) buff(1:slen)
+	 ENDIF
+ 100  CONTINUE
+
+1010  FORMAT('<currentRow>'/'<columnValue>'/I1/'</columnValue>')
+1012  FORMAT('<currentRow>'/'<columnValue>'/I2/'</columnValue>')
+1014  FORMAT('<currentRow>'/'<columnValue>'/I3/'</columnValue>')
+1015  FORMAT('<currentRow>'/'<columnValue>'/I4/'</columnValue>')
+1020  FORMAT('<columnValue>'/A/'</columnValue>'/'</currentRow>')
+
+* Write closing tag.
+      WRITE (iunit, 1030) 
+1030  FORMAT ('</data>'/'</webRowSet>')
+
+      CLOSE (iunit, ERR = 5020 )
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(Y_AXIS)
+      result(i,j,k,l) = 1.
+
+      RETURN 
+
+5010  CONTINUE
+      WRITE(errtxt,*) 'Error opening file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+5020  CONTINUE
+      WRITE(errtxt,*) 'Error closing file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
diff --git a/external_functions/matlab/Makefile b/external_functions/matlab/Makefile
new file mode 100644
index 0000000..f801bf8
--- /dev/null
+++ b/external_functions/matlab/Makefile
@@ -0,0 +1,65 @@
+#
+# Makefile (for FERRET/fer/efi statically linked EF code)
+#
+# Feb 28, 2000  -- based on other TMAP external functions makefiles
+# Ansley Manke
+# Jonathan Callahan (with some help from Joe Sirott)
+#
+# *acm* 3/23/2000 link  ../common to ferret_cmn  rather than using the
+#       link in ef_utility (which may not be present when this is compiled.)
+#  ACM  2/2001  debug macros
+#
+#  Note that these functions must be decleared in ../ccr/EF_InternalUtil.c
+#  Run the perl script in this directory int_dlsym.pl ./ > intcode.c
+#  put the resulting lines in three places in EF_InternalUtil.c as
+#  noted in the comments at the start of that file.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Matlab specific. Only works for Solaris cc and f77 compiler
+# Dependent on location of MATLAB installation
+#
+MATLAB_INCLUDES=-I/opt/local/matlab/matlab5.2/extern/include
+MATLAB_DIR=/opt/local/matlab/matlab5.2/extern/lib/sol2
+MATLAB_LIBS=$(MATLAB_DIR)/libeng.so $(MATLAB_DIR)/libmat.so
+CFLAGS += $(MATLAB_INCLUDES) -K PIC
+FFLAGS += -PIC
+
+#
+# Macros
+#
+
+OBJSF = $(SRCS_F:.F=.o)
+
+#
+# Targets
+#
+
+all:	matlab.so matlab_func.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+clean:
+	rm -f *.so *.o
+
+matlab.so: matlab.o matlab_link.o
+	$(LD) -L $(MATLAB_DIR) $(LD_DYN_FLAGS) matlab.o \
+		matlab_link.o -leng -lmat $(SYSLIBS) -o matlab.so	
+
+matlab_func.so: matlab_func.o matlab_func_link.o
+	$(LD) -L $(MATLAB_DIR) $(LD_DYN_FLAGS) matlab_func.o \
+		matlab_func_link.o -leng -lmat $(SYSLIBS) -o matlab_func.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/matlab/matlab.F b/external_functions/matlab/matlab.F
new file mode 100644
index 0000000..da7d171
--- /dev/null
+++ b/external_functions/matlab/matlab.F
@@ -0,0 +1,176 @@
+*
+* matlab.F
+*
+* Joe Sirott
+*
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE matlab_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'test of MATLAB (3D Surface visualization)')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'X')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to plot')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE matlab_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*     You could use utility functions at this point to get 
+*     context information about the other arguments.  This info 
+*     could be used to update the custom or abstract axis lo and hi
+*     indices.
+
+      call ef_set_axis_limits(id, X_AXIS, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE matlab_compute(id, arg_1, result)
+
+C ACM  xmem_subsc.cmn change to EF_mem_subsc.cmn'
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+C ACM  change m1lox to mem1lox, etc.
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(mem10lox:mem10hix, mem10loy:mem10hiy, 
+     .     mem10loz:mem10hiz, mem10lot:mem10hit)
+
+* TODO -- what if coord length is greater than these values??
+
+C ACM  call ef_get_coordinates with REAL*8 arrays to get coord values
+
+      REAL*8 xcoords(8192), ycoords(8192)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1, xsize,  ysize
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS, 
+     1       arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xcoords ) 
+
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS, arg_lo_ss(Y_AXIS, ARG1),
+     1        arg_hi_ss(Y_AXIS, ARG1), ycoords ) 
+
+      xsize = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ysize = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  result(i,j,k,l) = 0
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+               END DO
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            END DO
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         END DO
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+      END DO
+      call matlab_demo(arg_1, xcoords, xsize, ycoords, ysize, 
+     1      bad_flag(1))
+     
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/matlab/matlab_func.F b/external_functions/matlab/matlab_func.F
new file mode 100644
index 0000000..e277e1b
--- /dev/null
+++ b/external_functions/matlab/matlab_func.F
@@ -0,0 +1,230 @@
+*
+* matlab.F
+*
+* Joe Sirott
+*
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE matlab_func_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'test of MATLAB function calls')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'S')
+      CALL ef_set_arg_unit(id, arg, 'PSU')
+      CALL ef_set_arg_desc(id, arg, 'Salinity')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'T')
+      CALL ef_set_arg_unit(id, arg, 'deg C')
+      CALL ef_set_arg_desc(id, arg, 'Temperature')
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+      SUBROUTINE matlab_func_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*     You could use utility functions at this point to get 
+*     context information about the other arguments.  This info 
+*     could be used to update the custom or abstract axis lo and hi
+*     indices.
+
+c      call ef_set_axis_limits(id, X_AXIS, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE matlab_func_compute(id, arg_1, arg_2, result)
+
+C ACM  xmem_subsc.cmn change to EF_mem_subsc.cmn'
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+C ACM  change m1lox to mem1lox, etc.
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(mem10lox:mem10hix, mem10loy:mem10hiy, 
+     .           mem10loz:mem10hiz, mem10lot:mem10hit)
+c
+c Ahh, Ferret and FORTRAN. No dynamic memory allocation, 
+c so set some array  limits for temporary storage and 
+c hope for the best.
+c
+      INTEGER MAXY,MAXZ
+      parameter(MAXY=1024,MAXZ=1024)
+      REAL stemp(MAXY, MAXZ)
+      REAL ttemp(MAXY, MAXZ)
+
+C ACM  call ef_get_coordinates with REAL*8 array to get coord values
+
+      REAL*8 ptemp(MAXZ)
+      REAL ptemp4(MAXZ)
+      REAL rtemp(MAXY, MAXZ)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, j2, k2, k1, l1, ysize,  zsize
+      LOGICAL firstTime
+
+      firstTime = .true.
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      ysize = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      zsize = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+c
+c TODO -- Error checking
+c 
+
+c
+c Get the depth axis for pressure
+c
+
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS, 
+     1       arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), ptemp )
+
+
+C ACM  Stick the coordinates in REAL arrays.  (also in the line above, a
+C      Z_axis was typed as X_axis)
+
+      DO l = 1, zsize
+         ptemp4(l) = ptemp(l)
+      ENDDO
+
+      i1 = res_lo_ss(X_AXIS)
+      DO i=arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1)
+         l1 = res_lo_ss(T_AXIS)
+         DO l=arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1)
+
+c
+c Copy slices to buffers
+c 
+            j2 = 1
+            do j=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               k2 = 1
+               do k=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+                  stemp(j2,k2) = arg_1(i,j,k,l)
+                  ttemp(j2,k2) = arg_2(i,j,k,l)
+                  k2 = k2 + 1
+               end do
+               j2 = j2 + 1
+            end do
+            
+c
+c Get the results from MATLAB
+c
+            call matlab_func_demo(firstTime,stemp,ttemp,ptemp4,
+     1            rtemp,ysize, zsize, bad_flag(1), MAXY, MAXZ)
+            firstTime = .false.
+c
+c Copy the results from MATLAB into the Ferret buffer
+c
+            j2 = 1
+            do j1=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               k2 = 1
+               do k1=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+c                  write(6,*) i1,j1,k1,l1,j2,k2,rtemp(j2, k2)
+                  result(i1,j1,k1,l1) = rtemp(j2, k2)
+                  k2 = k2 + 1
+               end do
+               j2 = j2 + 1
+            end do
+c
+c Copy to results array
+c
+            
+            l1 = l1 + 1
+         end do
+         i1 = i1 + 1
+      end do
+            
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/matlab/matlab_func_link.c b/external_functions/matlab/matlab_func_link.c
new file mode 100644
index 0000000..6e822ea
--- /dev/null
+++ b/external_functions/matlab/matlab_func_link.c
@@ -0,0 +1,147 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "engine.h"
+#define  BUFSIZE 8192
+#define NaN (0.0/0.0)		/* Anyone know a better way? */
+
+static void convertToDouble(float *data, double *ddata, float bad_flag,
+			    int ysize, int zsize, int maxy, int maxz);
+static void convertToFloat(double *ddata, float *data, float bad_flag,
+			    int ysize, int zsize, int maxy, int maxz);
+
+
+static Engine *ep = 0;
+int matlab_func_demo_(int *getFunction,
+		      float *sal, float *temp, float *pres, float *res,
+			 int *ysize, int *zsize, float *bad_flag,
+		         int *maxy, int *maxz){
+  mxArray *mSal = NULL, *mTemp = NULL, *mPres = NULL, *mRes = NULL;
+  double *dSal, *dTemp, *dPres, *dRes;
+  char buffer[BUFSIZE], cbuffer[BUFSIZE];
+  int size = *ysize * *zsize;
+  static int choice = 0;
+
+				/* Open MATLAB engine */
+  if (ep == 0){
+    if (!(ep = engOpen("\0"))) {
+      fprintf(stderr, "\nCan't start MATLAB engine\n");
+      return EXIT_FAILURE;
+    }
+  }
+
+				/* Set up the MATLAB output buffer */
+  engOutputBuffer(ep, buffer, BUFSIZE);
+
+  mSal = mxCreateDoubleMatrix(*ysize, *zsize, mxREAL);
+  mxSetName(mSal, "SAL");
+  dSal = mxGetPr(mSal);
+  mTemp = mxCreateDoubleMatrix(*ysize, *zsize, mxREAL);
+  mxSetName(mTemp, "TEMP");
+  dTemp = mxGetPr(mTemp);
+  mPres = mxCreateDoubleMatrix(1, *zsize, mxREAL);
+  mxSetName(mPres, "PRES");
+  dPres = mxGetPr(mPres);
+
+				/* Convert from float->double */
+  convertToDouble(temp, dTemp, *bad_flag, *ysize, *zsize, *maxy, *maxz);
+  convertToDouble(sal, dSal, *bad_flag, *ysize, *zsize, *maxy, *maxz);
+  convertToDouble(pres, dPres, *bad_flag, *zsize, 1, *zsize, 1);
+
+  /* Place the variables into the MATLAB workspace */
+  engPutArray(ep, mSal);
+  engPutArray(ep, mPres);
+  engPutArray(ep, mTemp);
+
+  /* Get the function choice */
+  if (*getFunction){
+    choice = 0;
+    while (choice < 1 || choice > 5){
+      printf("1) sw_adtg (adiabatic temperature gradient)\n");
+      printf("2) sw_cndr (conductivity ratio)\n");
+      printf("3) sw_cp (heat capacity)\n");
+      printf("4) sw_dens (density)\n");
+      printf("5) sw_gpan (geopotential anomaly)\n");
+      printf("Select a function: ");
+      scanf("%d", &choice);
+    }
+  }
+
+
+  sprintf(cbuffer, "res = matlab_func_test(%d,SAL,TEMP,PRES);", choice);
+  engEvalString(ep, cbuffer);
+  /*
+   * Echo the output from the command.  First two characters are
+   * always the double prompt (>>).
+   */
+  if (strlen(buffer) > 1)
+    printf("%s", buffer+2);
+
+  /* Get the result array */
+  mRes = engGetArray(ep,"res");
+  assert(mRes);
+  dRes = mxGetPr(mRes);
+  convertToFloat(dRes, res, *bad_flag, *ysize , *zsize, *maxy, *maxz);
+ 
+
+  mxDestroyArray(mSal);
+  mxDestroyArray(mPres);
+  mxDestroyArray(mTemp);
+  mxDestroyArray(mRes);
+  
+#if 0
+   engClose(ep);
+#endif
+	
+  return EXIT_SUCCESS;
+}
+
+static void convertToFloat(double *ddata, float *data, float bad_flag,
+			    int ysize, int zsize, int maxy, int maxz)
+{
+
+  int i=0,j,k;
+  for (k=0; k < zsize; ++k){
+    for (j=0; j < ysize; ++j){
+      double theData = ddata[i++];
+      int index = k * maxy + j;
+      if (isnan(theData)){
+	data[index] = bad_flag;
+      } else {
+	data[index] = theData;
+      }
+#if 0
+      printf("Converting: %d %lf -> %f\n", i, theData, data[i]);
+#endif
+    }
+  }
+}
+
+static void convertToDouble(float *data, double *ddata, float bad_flag,
+			    int ysize, int zsize, int maxy, int maxz)
+{
+
+  int i=0,j,k;
+  for (k=0; k < zsize; ++k){
+    for (j=0; j < ysize; ++j){
+      int index = k * maxy + j;
+      float theData = data[index];
+      if (theData == bad_flag){
+	ddata[i++] = NaN;
+      } else {
+	ddata[i++] = theData;
+      }
+#if 0
+      printf("Converting: %d %f -> %lf\n", i-1, theData, ddata[i-1]);
+#endif
+    }
+  }
+}
+
+
+
+
+
+
+
+
diff --git a/external_functions/matlab/matlab_link.c b/external_functions/matlab/matlab_link.c
new file mode 100644
index 0000000..8a1a9d1
--- /dev/null
+++ b/external_functions/matlab/matlab_link.c
@@ -0,0 +1,83 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "engine.h"
+#define  BUFSIZE 8192
+#define NaN (0.0/0.0)		/* Anyone know a better way? */
+
+static Engine *ep = 0;
+/*
+ * JS Changed coord arguments to double as external function API changed
+ */
+int matlab_demo_(float *data,
+		 double *xcoords, int *xsize,
+		 double *ycoords, int *ysize,
+		 float *bad_flag) {
+  mxArray *T = NULL, *result = NULL;
+  mxArray *mX = NULL, *mY = NULL;
+  char buffer[BUFSIZE], cbuffer[BUFSIZE];
+  double *ddata = 0, *mxData = 0, *myData = 0;;
+
+				/* Open MATLAB engine */
+  if (ep == 0){
+    if (!(ep = engOpen("\0"))) {
+      fprintf(stderr, "\nCan't start MATLAB engine\n");
+      return EXIT_FAILURE;
+    }
+  }
+
+  engOutputBuffer(ep, buffer, BUFSIZE);
+				/* Convert from float->double */
+  T = mxCreateDoubleMatrix(*xsize, *ysize, mxREAL);
+  mxSetName(T, "FERRET_DATA");
+  ddata = mxGetPr(T);
+
+  mX = mxCreateDoubleMatrix(*xsize, 1, mxREAL);
+  mxSetName(mX, "FERRET_XDATA");
+  mxData = mxGetPr(mX);
+  mY = mxCreateDoubleMatrix(*ysize, 1, mxREAL);
+  mxSetName(mY, "FERRET_YDATA");
+  myData = mxGetPr(mY);
+  
+  {
+    int i;
+    for (i=0; i < *xsize * *ysize; ++i){
+      float theData = data[i];
+      if (theData == *bad_flag){
+	ddata[i] = NaN;
+      } else {
+	ddata[i] = data[i];
+      }
+    }
+
+    memcpy(mxData, xcoords, sizeof(double)* *xsize);
+    memcpy(myData, ycoords, sizeof(double)* *ysize);
+  }
+
+  /* Place the variables into the MATLAB workspace */
+  engPutArray(ep, T);
+  engPutArray(ep, mX);
+  engPutArray(ep, mY);
+
+  
+  sprintf(cbuffer, "ferretdemo(FERRET_DATA', FERRET_XDATA', FERRET_YDATA');");
+  engEvalString(ep, cbuffer);
+  /*
+   * Echo the output from the command.  First two characters are
+   * always the double prompt (>>).
+   */
+  printf("%s", buffer+2);
+
+  mxDestroyArray(T);
+/*   engEvalString(ep, "close;"); */
+/*   engClose(ep); */
+	
+  return EXIT_SUCCESS;
+}
+
+
+
+
+
+
+
diff --git a/external_functions/ncedit/Makefile b/external_functions/ncedit/Makefile
new file mode 100644
index 0000000..ce34182
--- /dev/null
+++ b/external_functions/ncedit/Makefile
@@ -0,0 +1,55 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	nco.so nco_attr.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/ncedit/nco.F b/external_functions/ncedit/nco.F
new file mode 100644
index 0000000..c831caf
--- /dev/null
+++ b/external_functions/ncedit/nco.F
@@ -0,0 +1,143 @@
+*
+* nco.F
+*
+* Ansley Manke
+* March 1, 2005
+*
+* This function spawns any NCO call, with the first argument being the
+* NCO function name, and the second one long string which is the argument 
+* to nco including file names and actions.
+*
+* 
+      SUBROUTINE nco_init(id)
+
+* Define arguments and result
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Call an NCO utility' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, NORMAL, 
+     .                             NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'operator')
+      CALL ef_set_arg_desc(id, arg, 'name of operator')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'arguments')
+      CALL ef_set_arg_desc(id, arg, 'one string with all arguments')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      RETURN 
+      END
+
+* Define abstract output axis: 1 value
+
+      SUBROUTINE nco_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+      RETURN 
+      END
+
+*
+* Compute the result
+*
+      SUBROUTINE nco_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+ 
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+      INTEGER STRINGLEN, arg, blen, slen
+
+      CHARACTER*2048 argstring, buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      blen = 0
+
+      arg = 1
+      CALL ef_get_arg_string(id, arg, argstring)
+
+      slen = STRINGLEN(argstring)
+      buff = argstring(1:slen)//' -O -h '
+      blen = slen + 7
+
+      arg = 2
+      CALL ef_get_arg_string(id, arg, argstring)
+
+      slen = STRINGLEN(argstring)
+      buff = buff(1:blen)//argstring(1:slen)
+      blen = blen + slen 
+
+* Spawn the command 
+
+      result(res_lo_ss(X_AXIS), res_lo_ss(Y_AXIS), res_lo_ss(Z_AXIS), 
+     .         res_lo_ss(T_AXIS)) = bad_flag_result
+
+      CALL system( buff(1:blen) )
+
+      result(res_lo_ss(X_AXIS), res_lo_ss(Y_AXIS), res_lo_ss(Z_AXIS), 
+     .         res_lo_ss(T_AXIS)) = 1
+
+      RETURN 
+
+
+      END
+
+        INTEGER FUNCTION STRINGLEN (strin)
+
+* determine the length of a character string as the position of the last 
+* non-blank character 
+
+* from tm_lenstr (use tm_lenstr if this is ever converted to an
+* internally-linked function)
+
+* calling argument declarations:
+	CHARACTER*(*) strin
+
+* internal variable declarations:
+	INTEGER	mright, i
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(strin)
+
+        DO 100 i = mright,1,-1	
+           IF (strin(i:i) .NE. ' ') GOTO 200	 
+  100   CONTINUE
+
+* for all blanks
+        STRINGLEN = 0
+
+* Found non-blank
+  200   STRINGLEN = i
+
+	RETURN
+	END
diff --git a/external_functions/ncedit/nco_attr.F b/external_functions/ncedit/nco_attr.F
new file mode 100644
index 0000000..276c1e1
--- /dev/null
+++ b/external_functions/ncedit/nco_attr.F
@@ -0,0 +1,336 @@
+*
+* nco_attr.F
+*
+* Ansley Manke
+* March 1, 2005
+*
+* This function spawns a netCDF edit call, ncatted to edit 
+* an attribute (e.g. new attribute, edit or delete atttibute,
+* or add lines to the global history attribute)
+*
+* 
+*  Notes: 
+* 1) our ncatted does not have the i data type.  It returns the messages
+* 
+* > ncatted -O -h -a missing_value,A,o,i,3 x.nc 
+* ncatted: ERROR `i' is not a supported netCDF data type
+* ncatted: HINT: Valid data types are `c' = char, `f' = float, `d' = double,`s' = short, `l' = long, `b' = byte
+
+* 2) errors from ncatted do not stop the function from returning normally.
+
+      SUBROUTINE nco_attr_init(id)
+
+* Define arguments and result
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 
+     .  'Call ncatted to edit attributes in a netCDF file' )
+
+      CALL ef_set_num_args(id, 6)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, NORMAL, 
+     .                             NORMAL)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'FileName')
+      CALL ef_set_arg_desc(id, arg, 'netCDF file name')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VariableName')
+      CALL ef_set_arg_desc(id, arg, 'Variable name (or global)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'AttributeName')
+      CALL ef_set_arg_desc(id, arg, 'Attribute to change')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'AttType')
+      CALL ef_set_arg_desc(id, arg, 'Attribute type')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'Mode')
+      CALL ef_set_arg_desc(id, arg, 'o=edit, a=append, d=delete')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'AttributeValue')
+      CALL ef_set_arg_desc(id, arg, 'new value of attribute')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      RETURN 
+      END
+
+* Define abstract output axis: 1 value
+
+      SUBROUTINE nco_attr_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+      RETURN 
+      END
+
+*
+* Compute the result
+*
+      SUBROUTINE nco_attr_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .           arg_5, arg_6, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .           mem6lot:mem6hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+ 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+      INTEGER STRINGLEN, arg, blen, slen
+
+      REAL attval, val
+      REAL*8 dattval
+      INTEGER*2 isattval 
+      INTEGER iattval
+      CHARACTER*1 battval
+      CHARACTER*1 mode, atttype
+      CHARACTER*3 atttype_in
+      CHARACTER*1024 filename, attributevalue
+      CHARACTER*254 variablename, attributename, errmsg
+      CHARACTER*2048 buff
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 1
+      CALL ef_get_arg_string(id, arg, filename)
+      arg = 2
+      CALL ef_get_arg_string(id, arg, variablename)
+      arg = 3
+      CALL ef_get_arg_string(id, arg, attributename)
+      arg = 4
+      CALL ef_get_arg_string(id, arg, atttype_in)
+      arg = 5
+      CALL ef_get_arg_string(id, arg, mode)
+      arg = 6
+      CALL ef_get_arg_string(id, arg, attributevalue)
+
+      IF (STRINGLEN(atttype_in) .GT. 1) THEN
+         CALL EF_BAIL_OUT(id, 
+     .       'Attribute type must be f, d, i, l, s, c, or b')
+      ELSE
+         atttype = atttype_in(1:1)
+      ENDIF
+      
+      IF (atttype .EQ. 'i' .OR. atttype .EQ. 'l' .OR.
+     .         atttype .EQ. 'I' .OR. atttype .EQ. 'L') atttype = 'l'
+
+* Check for valid values of mode
+
+      IF (mode .EQ. 'o' .OR. mode .EQ. 'O') THEN
+         mode = 'o'
+      ELSE IF (mode .EQ. 'a' .OR. mode .EQ. 'A') THEN
+         mode = 'a'
+      ELSE IF (mode .EQ. 'd' .OR. mode .EQ. 'D') THEN
+         mode = 'd'
+      ELSE
+         CALL EF_BAIL_OUT(id, 'Mode must be o, a, or d')
+      ENDIF
+
+* Build the string for the ncatted command
+* ncatted -O -h att_nm,var_nm,mode,att_type,att_val filename
+* Mode will always be o for overwrite
+
+      buff = 'ncatted -O -h -a '
+      blen = 17
+
+      slen = STRINGLEN(attributename)
+      buff = buff(1:blen)//attributename(1:slen)//','
+      blen = blen + slen + 1
+
+      slen = STRINGLEN(variablename)
+      buff = buff(1:blen)//variablename(1:slen)//','//mode(1:1)//','
+      blen = blen + slen + 3
+
+      slen = STRINGLEN(atttype)
+      buff = buff(1:blen)//atttype(1:slen)//','
+      blen = blen + slen + 1
+
+! ncatted -O -h -a cartesian_axis,LAT,o,c,"Z" x.nc
+
+* Read the attribute value based on its type.
+* See documentation at the end of this file for attribute types.
+
+
+      IF (atttype .EQ. 'f' .OR. atttype .EQ. 'F') THEN
+         READ (attributevalue,*,err=501) attval
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'd' .OR. atttype .EQ. 'D') THEN
+         READ (attributevalue,*,err=502) dattval
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'i' .OR. atttype .EQ. 'l' .OR.
+     .         atttype .EQ. 'I' .OR. atttype .EQ. 'L') THEN
+         READ (attributevalue,*,err=503) iattval
+         READ (attributevalue,*,err=503) attval
+         val = iattval
+         IF (val .NE. attval) GOTO 503
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 's' .OR. atttype .EQ. 'S') THEN
+         READ (attributevalue,*,err=504) isattval
+         WRITE (attributevalue,*) isattval
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'c' .OR. atttype .EQ. 'C') THEN
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//'"'//attributevalue(1:slen)//'"'
+         blen = blen + slen + 3
+
+      ELSE IF (atttype .EQ. 'b' .OR. atttype .EQ. 'B') THEN
+         READ (attributevalue,*,err=505) battval
+         slen = STRINGLEN(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+      ELSE
+         CALL EF_BAIL_OUT(id, 
+     .       'Attribute type must be f, d, i, s, c, or b')
+      ENDIF
+
+* Append the file name
+
+      slen = STRINGLEN(filename)
+      buff = buff(1:blen)//' '//filename(1:slen)
+      blen = blen + slen + 1
+
+* Spawn the command 
+
+      result(res_lo_ss(X_AXIS), res_lo_ss(Y_AXIS), res_lo_ss(Z_AXIS), 
+     .         res_lo_ss(T_AXIS)) = bad_flag_result
+
+      CALL system( buff(1:blen) )
+
+      result(res_lo_ss(X_AXIS), res_lo_ss(Y_AXIS), res_lo_ss(Z_AXIS), 
+     .         res_lo_ss(T_AXIS)) = 1
+
+      RETURN 
+
+501   slen = STRINGLEN(attributevalue)
+      errmsg = 'Error reading attribute value as floating-point '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+502   slen = STRINGLEN(attributevalue)
+      errmsg = 'Error reading attribute value as double-precision '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+503   slen = STRINGLEN(attributevalue)
+      errmsg = 'Error reading attribute value as an integer '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+504   slen = STRINGLEN(attributevalue)
+      errmsg = 'Error reading attribute value as a short integer '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+505   slen = STRINGLEN(attributevalue)
+      errmsg = 'Error reading attribute value as a byte '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+      END
+
+
+* ncatted documentation: here are the attribute types      
+* f    Float. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_FLOAT.
+* d    Double. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_DOUBLE.
+* i    Integer. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_INT.
+* l    Long. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_LONG.
+* s    Short. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_SHORT.
+* c    Char. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_CHAR.
+* b    Byte. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_BYTE. 
+* 
+* 3.1 netCDF external data types
+* 
+* The external types supported by the netCDF interface are:
+* 
+* char    8-bit characters intended for representing text.
+* byte    8-bit signed or unsigned integers (see discussion below).
+* short  16-bit signed integers.
+* int    32-bit signed integers.
+* float  real 32-bit IEEE floating-point.
+* double 64-bit IEEE floating-point. 
+
+
+	INTEGER FUNCTION STRINGLEN (strin)
+
+* determine the length of a character string as the position of the last 
+* non-blank character 
+
+* from tm_lenstr (use tm_lenstr if this is ever converted to an
+* internally-linked function)
+
+* calling argument declarations:
+	CHARACTER*(*) strin
+
+* internal variable declarations:
+	INTEGER	mright, i
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(strin)
+
+        DO 100 i = mright,1,-1	
+           IF (strin(i:i) .NE. ' ') GOTO 200	 
+  100   CONTINUE
+
+* for all blanks
+        STRINGLEN = 0
+
+* Found non-blank
+  200   STRINGLEN = i
+
+	RETURN
+	END
diff --git a/external_functions/obs_viz/Makefile b/external_functions/obs_viz/Makefile
new file mode 100644
index 0000000..819f000
--- /dev/null
+++ b/external_functions/obs_viz/Makefile
@@ -0,0 +1,50 @@
+#
+# Makefile for Ferret External Functions
+#
+# 2/01 *sh*
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+DAT_OBJS = flag2ddups.o
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	$(DAT_OBJS) scat2ddups.o scat2ddups.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)"  all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/obs_viz/flag2ddups.F b/external_functions/obs_viz/flag2ddups.F
new file mode 100644
index 0000000..645807d
--- /dev/null
+++ b/external_functions/obs_viz/flag2ddups.F
@@ -0,0 +1,90 @@
+	SUBROUTINE FLAG2DDUPS( n, x, y, epsx, epsy, dup, seq )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Locate the duplicate coordinate pairs in a list of coordinates
+* Will be regarded as duplicate if X lies within espx distance and ditto y
+* The array "dup" will contain the number of duplicate "mates" for any
+*   given coordinate (i.e. 0 if no matches)
+* The array "seq' will contain the sequence number 0,1,2,... of the mates 
+
+* V530 *sh* 2/01
+
+* Argument declarations
+	INTEGER	n
+	REAL	epsx, epsy, x(n), y(n), dup(n), seq(n)
+
+* Internal variable declarations
+        INTEGER ii, jj, ndup
+        REAL xtarget, ytarget
+
+* initialize
+        DO ii = 1, n
+          dup(ii) = 0
+          seq(ii) = 0
+        END DO
+
+* find and label duplicates
+        DO ii = 1, n
+           
+* locate a unique coordinate
+           IF (dup(ii) .EQ. 0 ) THEN
+             xtarget = x(ii)
+             ytarget = y(ii)
+
+* mark sequence numbers for duplicates of this target
+             ndup = 0
+             DO jj = ii+1, n
+               IF (dup(jj) .EQ. 0 ) THEN
+                  IF ( (ABS(xtarget-x(jj)) .LE. epsx)
+     .           .AND. (ABS(ytarget-y(jj)) .LE. epsy) ) THEN
+                    ndup = ndup + 1
+                    seq(jj) = ndup
+                  ENDIF
+               ENDIF
+             END DO
+
+* mark number of duplicates found on each member of duplicate group
+             dup(ii) = ndup
+             IF (ndup .GT. 0) THEN
+               DO jj = ii+1, n
+                 IF ( (dup(jj).EQ.0)
+     .          .AND. (seq(jj).GT.0) ) dup(jj) = ndup 
+               END DO
+             ENDIF
+
+           ENDIF
+        END DO
+
+	RETURN
+	END
diff --git a/external_functions/obs_viz/scat2ddups.F b/external_functions/obs_viz/scat2ddups.F
new file mode 100644
index 0000000..e8c28b0
--- /dev/null
+++ b/external_functions/obs_viz/scat2ddups.F
@@ -0,0 +1,256 @@
+*
+* scat2ddups.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Jan, 2001
+
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE scat2ddups_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Flag non-unique points. '
+     .   //'L=1 - # dups of this pt, 2-sequence number' )  
+
+      CALL ef_set_num_args(id, 4)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .                                 IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_name (id, arg, 'coord 1')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Coordinate 1 (normally longitude)')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name (id, arg, 'coord 2')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Coordinate 2 (normally latitude)')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, NO)
+
+      arg = 3
+      CALL ef_set_arg_name (id, arg, 'epsilon 1')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Two coord 1s within epsilon 1 considered duplicates')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name (id, arg, 'epsilon 2')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Two coord 2s within epsilon 2 considered duplicates')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE scat2ddups_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+* 3 output values: year, month, day 
+        CALL EF_SET_AXIS_LIMITS(id, T_AXIS, 1, 2)
+        
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2ddups_compute (id, arg_1, arg_2, arg_3, arg_4,
+     .                               result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3
+      REAL arg_4
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+        INTEGER ii, size1, size2
+
+* get the subscripting limits and flags
+        CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+        CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+        CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure that we were not passes a span along the T axis
+        IF ( (arg_lo_ss(T_AXIS,ARG1) .NE.  arg_hi_ss(T_AXIS,ARG1))
+     .  .OR. (arg_lo_ss(T_AXIS,ARG2) .NE.  arg_hi_ss(T_AXIS,ARG2)) )
+     .          CALL EF_BAIL_OUT(id,
+     .                  'Cannot handle a T range on argument') 
+
+* ensure that the sizes of the inputs match
+        size1 = 1
+        size2 = 1
+        DO ii = 1,4
+           size1 = size1 * (arg_hi_ss(ii,ARG1)-arg_lo_ss(ii,ARG1)+1)
+           size2 = size2 * (arg_hi_ss(ii,ARG2)-arg_lo_ss(ii,ARG2)+1)
+        END DO
+        IF (size1 .NE. size2)  CALL EF_BAIL_OUT(id,
+     .                  'Coordinate arrays are not conformable')
+
+* ensure that the epsilon values make sense
+        IF (arg_3.LT.0.0 .OR. arg_4.LT.0.0) CALL EF_BAIL_OUT(id,
+     .                  'Negative epsilon value')
+
+* flag the duplicates
+        CALL FLAG2DDUPS(size1,
+     .                  arg_1(arg_lo_ss(X_AXIS,ARG1),
+     .                        arg_lo_ss(Y_AXIS,ARG1),
+     .                        arg_lo_ss(Z_AXIS,ARG1),
+     .                        arg_lo_ss(T_AXIS,ARG1)),
+     .                  arg_2(arg_lo_ss(X_AXIS,ARG2),
+     .                        arg_lo_ss(Y_AXIS,ARG2),
+     .                        arg_lo_ss(Z_AXIS,ARG2),
+     .                        arg_lo_ss(T_AXIS,ARG2)),
+     .                  arg_3,
+     .                  arg_4,
+     .                  result(memreslox, memresloy, 
+     .                         memresloz, 1),
+     .                  result(memreslox, memresloy, 
+     .                         memresloz, 2)  )
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/external_functions/pnpoly/Makefile b/external_functions/pnpoly/Makefile
new file mode 100644
index 0000000..214b37e
--- /dev/null
+++ b/external_functions/pnpoly/Makefile
@@ -0,0 +1,49 @@
+#
+# Makefile for Ferret External Functions
+#
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+SUB_OBJS = pnpoly_subs.o
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+#all:	pnpoly_subs.o pt_in_poly.so pt_in_poly_curvi.so
+all:	pnpoly_subs.o pt_in_poly.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/pnpoly/pnpoly_subs.F b/external_functions/pnpoly/pnpoly_subs.F
new file mode 100644
index 0000000..d23b6ad
--- /dev/null
+++ b/external_functions/pnpoly/pnpoly_subs.F
@@ -0,0 +1,289 @@
+
+C .................................................................. 
+
+      SUBROUTINE POLY_BOUND_BOX (xv, yv, nv, xvmin, xvmax, yvmin, yvmax)
+
+* Get the bounding box around the polygon. min and max variables
+* have been initialized.
+
+      REAL xv(*), yv(*), xvmin, xvmax, yvmin, yvmax
+      INTEGER nv
+      INTEGER i
+
+      DO 50 i = 1, nv
+         xvmin = MIN(xvmin, xv(i))
+         xvmax = MAX(xvmax, xv(i))
+         yvmin = MIN(yvmin, yv(i))
+         yvmax = MAX(yvmax, yv(i))
+  50  CONTINUE
+
+      RETURN
+      END
+
+
+C .................................................................. 
+	LOGICAL FUNCTION PP_FPEQ ( a, b )
+*
+*************
+* This is a copy of the Ferret function TM_FPEQ. It is included here
+* so that the function is a stand-alone function. When and if this
+* External Function is statically linked into the Ferret executable,
+* We can rename calls to PP_FPEQ back to TM_FPEQ and remove this subroutine.
+*************
+*
+* test to see if REAL*4 floating point numbers are equal to within
+* "reasonable" accuracy
+* REAL*4 (F_floating) machine error on the VAX is "approximately one part in
+* 2**23" or 1.2E-7.  Allow 4.E-7 as machine error after many typical roundoffs.
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/21/85
+* revision 0.10 - 10/23/87 - all variables explicitly declared
+*
+* calling arguments:
+	REAL	a, b
+
+* local parameters
+	REAL	   VAX_epsilon
+	PARAMETER (VAX_epsilon = 4.E-7)
+
+* treat relative error case (non-zero) separate fron zero case
+
+	IF  (a.NE.0.0   .AND.  b.NE.0.0 )  THEN
+
+	   PP_FPEQ =  ABS(a-b) .LE. ABS(b)*VAX_epsilon		! relative error
+
+	ELSE
+
+	   PP_FPEQ =	ABS(a) .LT. VAX_epsilon
+     .		.AND.   ABS(b) .LT. VAX_epsilon			! absolute error
+
+	ENDIF
+	RETURN
+	END
+
+C .................................................................. 
+C 
+C SUBROUTINE PNPOLY 
+C 
+C PURPOSE 
+C   TO DETERMINE WHETHER A POINT IS INSIDE A POLYGON 
+C 
+C USAGE 
+C   CALL PNPOLY (PX, PY, XX, YY, N, workx, worky, INOUT ) 
+C 
+C DESCRIPTION OF THE PARAMETERS 
+C   PX    - X-COORDINATE OF POINT IN QUESTION. 
+C   PY    - Y-COORDINATE OF POINT IN QUESTION. 
+C   XX    - N LONG VECTOR CONTAINING X-COORDINATES OF 
+C           VERTICES OF POLYGON. 
+C   YY    - N LONG VECTOR CONTAING Y-COORDINATES OF 
+C           VERTICES OF POLYGON. 
+C   N     - NUMBER OF VERTICES IN THE POLYGON. 
+C   workx - work array
+C   worky - work array
+C   INOUT - THE SIGNAL RETURNED: 
+C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+C 
+C REMARKS 
+C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+C   OPTIONALLY BE INCREASED BY 1. 
+C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+C   
+C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+C   NONE 
+C 
+C METHOD 
+C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+C   POINT IS INSIDE OF THE POLYGON. 
+C 
+C .................................................................. 
+C 
+      SUBROUTINE PNPOLY(PX,PY,XX,YY,N,X,Y,INOUT) 
+      REAL PX,X(*),Y(*),XX(*),YY(*) 
+      INTEGER N, INOUT
+
+      LOGICAL PP_FPEQ, MX,MY,NX,NY, b
+      INTEGER I, J, INOUT1, INOUT2
+      INOUT1 = 0
+      INOUT2 = 0
+
+* Change the original to see if X(J)=Y(J)=0. This loop finds matches 
+* for points on the left-hand edges 
+
+    6 DO 1 I=1,N 
+      X(I)=XX(I)-PX 
+    1 Y(I)=YY(I)-PY 
+      INOUT1=-1 
+      DO 2 I=1,N 
+      J=1+MOD(I,N) 
+      MX=X(I).GE.0.0 
+      NX=X(J).GE.0.0 
+      MY=Y(I).GE.0.0 
+      NY=Y(J).GE.0.0 
+
+      IF (PP_FPEQ(X(J),0.) .AND. PP_FPEQ(Y(J),0.)) GOTO 4
+
+      IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 2 
+      IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 3 
+      INOUT1=-INOUT1 
+      GO TO 2
+    3 CONTINUE
+      IF ( PP_FPEQ(X(J),Y(J)) ) THEN
+         IF(PP_FPEQ((Y(I)*X(J)-X(I)*Y(J)),0.)) THEN  
+            INOUT1 = 0
+            INOUT2 = 0
+            GOTO 50
+         ENDIF
+      ENDIF
+      IF( PP_FPEQ((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I)), 0.) ) GOTO 4
+      IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 2,4,5 
+    4 INOUT1 = 0
+      INOUT2 = 0
+      GOTO 50
+    5 INOUT1=-INOUT1 
+    2 CONTINUE 
+
+* Now do the same with the order of subtraction reversed when 
+* computing arrays X(I) and Y(I). This finds matches for points 
+* on the right-hand edges.
+
+      DO 11 I=1,N 
+      X(I)=PX-XX(I)
+   11 Y(I)=PY-YY(I) 
+      INOUT2=-1 
+      DO 12 I=1,N 
+      J=1+MOD(I,N) 
+      MX=X(I).GE.0.0 
+      NX=X(J).GE.0.0 
+      MY=Y(I).GE.0.0 
+      NY=Y(J).GE.0.0 
+
+      IF (PP_FPEQ(X(J),0.) .AND. PP_FPEQ(Y(J),0.)) GOTO 14
+
+      IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 12 
+      IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 13 
+      INOUT2=-INOUT2 
+      GO TO 12
+   13 CONTINUE
+      IF ( PP_FPEQ(X(J),Y(J)) ) THEN
+         IF(PP_FPEQ(Y(I)*X(J)-X(I)*Y(J), 0.)) THEN  
+            INOUT1 = 0
+            INOUT2 = 0
+            GOTO 50
+         ENDIF
+      ENDIF
+      IF( PP_FPEQ((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I)), 0.) ) GOTO 14
+      IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 12,14,15 
+   14 INOUT1 = 0
+      INOUT2 = 0
+      GOTO 50
+   15 INOUT2=-INOUT2 
+   12 CONTINUE 
+
+* Combine the results: -1 outside the polygon, 0 
+* on the edges or vertices, 1 inside the polygon.
+
+   50 CONTINUE
+      INOUT = (INOUT2 + INOUT1)/2
+      RETURN
+
+      END 
+
+*** ORIG  C >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+*** ORIG  C Here is the exact code from W. Randolph Franklin pages.
+*** ORIG  C Fortran Code for the Point in Polygon Test
+*** ORIG  
+*** ORIG  C>>>PNP1 
+*** ORIG  C 
+*** ORIG  C .................................................................. 
+*** ORIG  C 
+*** ORIG  C SUBROUTINE PNPOLY 
+*** ORIG  C 
+*** ORIG  C PURPOSE 
+*** ORIG  C   TO DETERMINE WHETHER A POINT IS INSIDE A POLYGON 
+*** ORIG  C 
+*** ORIG  C USAGE 
+*** ORIG  C   CALL PNPOLY (PX, PY, XX, YY, N, INOUT ) 
+*** ORIG  C 
+*** ORIG  C DESCRIPTION OF THE PARAMETERS 
+*** ORIG  C   PX    - X-COORDINATE OF POINT IN QUESTION. 
+*** ORIG  C   PY    - Y-COORDINATE OF POINT IN QUESTION. 
+*** ORIG  C   XX    - N LONG VECTOR CONTAINING X-COORDINATES OF 
+*** ORIG  C           VERTICES OF POLYGON. 
+*** ORIG  C   YY    - N LONG VECTOR CONTAING Y-COORDINATES OF 
+*** ORIG  C           VERTICES OF POLYGON. 
+*** ORIG  C   N     -  NUMBER OF VERTICES IN THE POLYGON. 
+*** ORIG  C   INOUT - THE SIGNAL RETURNED: 
+*** ORIG  C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+*** ORIG  C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+*** ORIG  C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+*** ORIG  C 
+*** ORIG  C REMARKS 
+*** ORIG  C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+*** ORIG  C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+*** ORIG  C   OPTIONALLY BE INCREASED BY 1. 
+*** ORIG  C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+*** ORIG  C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+*** ORIG  C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+*** ORIG  C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+*** ORIG  C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+*** ORIG  C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+*** ORIG  C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+*** ORIG  C   
+*** ORIG  C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+*** ORIG  C   NONE 
+*** ORIG  C 
+*** ORIG  C METHOD 
+*** ORIG  C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+*** ORIG  C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+*** ORIG  C   POINT IS INSIDE OF THE POLYGON. 
+*** ORIG  C 
+*** ORIG  C .................................................................. 
+*** ORIG  C 
+*** ORIG        SUBROUTINE PNPOLY(PX,PY,XX,YY,N,INOUT) 
+*** ORIG        REAL X(200),Y(200),XX(N),YY(N) 
+*** ORIG        LOGICAL MX,MY,NX,NY 
+*** ORIG        INTEGER O 
+*** ORIG  
+*** ORIG  C OUTPUT UNIT FOR PRINTED MESSAGES 
+*** ORIG        DATA O/6/ 
+*** ORIG        MAXDIM=200 
+*** ORIG        IF(N.LE.MAXDIM)GO TO 6 
+*** ORIG        WRITE(O,7)  
+*** ORIG      7 FORMAT('0WARNING:',I5,' TOO GREAT FOR THIS VERSION OF pt_in_poly. 
+*** ORIG       1 RESULTS INVALID')
+*** ORIG        RETURN
+*** ORIG      6 DO 1 I=1,N 
+*** ORIG        X(I)=XX(I)-PX 
+*** ORIG      1 Y(I)=YY(I)-PY 
+*** ORIG        INOUT=-1 
+*** ORIG        DO 2 I=1,N 
+*** ORIG        J=1+MOD(I,N) 
+*** ORIG        MX=X(I).GE.0.0 
+*** ORIG        NX=X(J).GE.0.0 
+*** ORIG        MY=Y(I).GE.0.0 
+*** ORIG        NY=Y(J).GE.0.0 
+*** ORIG        IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 2 
+*** ORIG        IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 3 
+*** ORIG        INOUT=-INOUT 
+*** ORIG        GO TO 2
+*** ORIG      3 IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 2,4,5 
+*** ORIG      4 INOUT=0   
+*** ORIG        RETURN 
+*** ORIG      5 INOUT=-INOUT 
+*** ORIG      2 CONTINUE 
+*** ORIG        RETURN 
+*** ORIG        END 
diff --git a/external_functions/pnpoly/pt_in_poly.F b/external_functions/pnpoly/pt_in_poly.F
new file mode 100644
index 0000000..df25cbd
--- /dev/null
+++ b/external_functions/pnpoly/pt_in_poly.F
@@ -0,0 +1,285 @@
+*
+* pt_in_poly.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+** Ansley Manke
+* January 2008
+*
+* This function implements the pnpoly code from W. Randolph Franklin found
+* in his web pages. The exact code from these web pages is preserved at the end of
+* this file; changes to it are the responsibility of Ferret program developers.
+
+* Copyright (c) 1970-2003, Wm. Randolph Franklin
+*
+* Permission is hereby granted, free of charge, to any person obtaining a 
+* copy of this software and associated documentation files (the "Software"), 
+* to deal in the Software without restriction, including without limitation 
+* the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+* and/or sell copies of the Software, and to permit persons to whom the 
+* Software is furnished to do so, subject to the following conditions:
+
+*  1. Redistributions of source code must retain the above copyright notice, 
+* this list of conditions and the following disclaimers.
+*   2. Redistributions in binary form must reproduce the above copyright 
+* notice in the documentation and/or other materials provided with the 
+* distribution.
+*   3. The name of W. Randolph Franklin may not be used to endorse or 
+* promote products derived from this Software without specific prior 
+* written permission. 
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
+* IN THE SOFTWARE. 
+*
+C W. Randolph Franklin
+C http://www.ecse.rpi.edu/Homepages/wrf/pmwiki/
+C http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#The%20C%20Code
+C http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#Fortran%20Code%20for%20the%20Point%20in%20Polygon%20Test
+
+C  RETURNS:
+C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+
+***********************************************************************
+*  Initialize the function
+
+      SUBROUTINE pt_in_poly_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     . ('Return -1 outside, 0 if on edge, 1 if inside polygon')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 4)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable on the XY grid and region to be tested')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XVERT')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'X-coordinates of vertices of polygon')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YVERT')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'Y-coordinates of vertices of polygon')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      RETURN 
+      END
+
+***********************************************************************
+
+* Request an amount of storage to be supplied by Ferret and passed
+* as additional arguments.
+
+      SUBROUTINE pt_in_poly_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+*
+* Set the work array X/Y/Z/T dimensions
+
+      INTEGER array_num, nx, ny, nv
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* These are going to be a double precision array, to contain axis 
+* coordinates so allocate 2* the size of the axes
+
+      nx = 2*( arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1 )
+      ny = 2*( arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1 )
+
+      array_num = 1
+      CALL ef_set_work_array_dims(id, array_num, 1,1,1,1, nx,1,1,1)
+      array_num = 2
+      CALL ef_set_work_array_dims(id, array_num, 1,1,1,1, ny,1,1,1)
+
+* Set two arrays the size of the number of vertices.
+
+      nv = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 
+      nv = MAX(nv, arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1 )
+      array_num = 3
+      CALL ef_set_work_array_dims(id, array_num, 1,1,1,1, nv,1,1,1)
+      array_num = 4
+      CALL ef_set_work_array_dims(id, array_num, 1,1,1,1, nv,1,1,1)
+
+      RETURN 
+      END
+
+* **********************************************************************
+
+      SUBROUTINE pt_in_poly_compute (id, arg_1, arg_2, arg_3, result, 
+     .   xcoords, ycoords, workx, worky)
+C 
+C REMARKS 
+C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+C   OPTIONALLY BE INCREASED BY 1. 
+C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+C   
+C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+C   NONE 
+C 
+C METHOD 
+C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+C   POINT IS INSIDE OF THE POLYGON. 
+C 
+C .................................................................. 
+C 
+      
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit)
+      REAL*8 xcoords(wrk1lox:wrk1hix)
+      REAL*8 ycoords(wrk2lox:wrk2hix)
+      REAL workx(wrk3lox:wrk3hix)
+      REAL worky(wrk4lox:wrk4hix)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER n, i,j,k,l, i1,j1, ii,jj, iarg
+      LOGICAL MX,MY,NX,NY 
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Get the x and y coordinates of the input variable
+
+      iarg = 1
+      CALL ef_get_coordinates (id, iarg, X_AXIS, 
+     .       arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xcoords)
+      CALL ef_get_coordinates (id, iarg, Y_AXIS, 
+     .       arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), ycoords)
+
+! Size of the list of polygon vertices
+
+      nv = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 
+      nv = MAX(nv, arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1 )
+
+* Get the bounding box around the polygon. Do not check points if they are
+* outside this bounding box
+ 
+      xvmin = ABS( bad_flag(ARG3) )
+      xvmax = -1*xvmin
+      yvmin = ABS( bad_flag(ARG4) )
+      yvmax = -1*yvmin
+
+      CALL POLY_BOUND_BOX(arg_2, arg_3, nv, xvmin, xvmax, yvmin, yvmax)
+
+* Loop over all points, checking if they are inside or outside the polygon.
+
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         PX = xcoords(i1) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            PY = ycoords(j1)
+
+            IF (px .GE. xvmin .AND. px .LE. xvmax .AND.
+     .          py .GE. yvmin .AND. py .LE. yvmax ) THEN
+               CALL PNPOLY (px, py, arg_2, arg_3, nv, 
+     .                      workx, worky, inout )
+               result(i,j,k,l)= FLOAT(inout)
+            ELSE
+               result(i,j,k,l) = -1
+            ENDIF
+
+      j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 100  CONTINUE
+
+      i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200  CONTINUE
+
+      RETURN 
+      END
+
+
+
diff --git a/external_functions/pyef/template.py b/external_functions/pyef/template.py
new file mode 100644
index 0000000..24203b3
--- /dev/null
+++ b/external_functions/pyef/template.py
@@ -0,0 +1,87 @@
+'''
+Template for creating a PyFerret Python External Function (PyEF).
+The names of the functions provided should not be changed.  By 
+default, PyFerret uses the name of the module as the function name.
+
+Copy this file using a name that you would like to be the function
+name, then modify the contents of these functions and comments as
+desired. 
+
+ at author: 
+'''
+import numpy
+
+
+def ferret_init(efid):
+    '''
+    Initialization function for this PyFerret PyEF.  Returns
+    a dictionary describing the features of this PyFerret PyEF.
+    At a minimum, assigns the number of arguments expected and 
+    a descriptions of the functions.  May also provide 
+    descriptions of the arguments and specifications for a 
+    non-standard result grid.
+    '''
+    init_dict = { }
+
+    init_dict["numargs"] = 1
+    init_dict["descript"] = "Pass through"
+
+    return init_dict
+
+
+def ferret_result_limits(efid):
+    '''
+    Defines the index limits for all abstract axes in the result grid.
+    Returns an (X,Y,Z,T,E,F)-axis six-tuple of either (low,high) pairs, 
+    for an abstract axis, or None, for a non-abstract axis.  The low 
+    and high values are integer values.  If the result grid has no 
+    abstract axes, this function will not be called and can be deleted.
+    '''
+    axis_limits = (None, None, None, None, None, None)
+
+    return axis_limits
+
+
+def ferret_custom_axes(efid):
+    '''
+    Defines all custom axes in ther result grid.  Returns a (X,Y,Z,T,E,F)-
+    axis six-tuple of either a (low, high, delta, unit_name, is_modulo) 
+    tuple, for a custom axis, or None, for a non-custom axis.  The low,
+    high, and delta values are floating-point values in units of the axis 
+    coordinate ("world coordinates").  If the result grid has no custom
+    axes, this function will not be called and can be deleted.
+    '''
+    axis_info = (None, None, None, None, None, None)
+    
+    return axis_info
+
+
+def ferret_compute(efid, result, result_bdf, inputs, input_bdfs):
+    '''
+    Computation function for this PyFerret PyEF.  Assign values to the
+    elements of result; do not reassign result itself.  In other words,
+    assign values using notation similar to 'result[...] = ...'; do not
+    use notation similar to 'result = ...' as this will simply define
+    a new local variable called result, hiding the variable passed into
+    this function.
+
+    If an error is detected, raise an appropriate exception.  ValueError
+    is commonly used for unexpected values.  IndexError is commonly used 
+    for unexpected array sizes.
+
+    Arguments:
+        result     - numpy float array to be assigned
+        result_bdf - numpy read-only float array of one element giving the 
+                     missing-data value to be used when assigning result
+        inputs     - tuple of numpy read-only float arrays giving the input
+                     values provided by the caller
+        input_bdfs - numpy read-only float arrays of one element giving the
+                     missing-data value for the corresponding inputs array
+    '''
+    # Create masks of values that are undefined and that are defined
+    bad_mask = ( inputs[0] == input_bdfs[0] )
+    good_mask = numpy.logical_not(bad_mask)
+    result[good_mask] = inputs[0][good_mask]
+    result[bad_mask] = result_bdf
+    return
+
diff --git a/external_functions/romea/Makefile b/external_functions/romea/Makefile
new file mode 100644
index 0000000..20244ad
--- /dev/null
+++ b/external_functions/romea/Makefile
@@ -0,0 +1,54 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#  ACM  2/2001  debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+SUB_OBJS = rr_density.o
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	rr_density.o ffta_2.so ffta_3.so ffta_sample.so fftabst.so rr_adv_sx.so rr_adv_sy.so rr_adv_sz.so rr_adv_tx.so rr_adv_ty.so rr_adv_tz.so rr_adv_umetric.so rr_adv_ux.so rr_adv_uy.so rr_adv_uz.so rr_adv_vmetric.so rr_adv_vx.so rr_adv_vy.so rr_adv_vz.so rr_av.so rr_cross_spectrum.so rr_cross_spectrum_abs.so rr_diff_sx.so rr_diff_sy.so rr_diff_sz.so rr_diff_tx.so rr_diff_ty.so rr_diff_tz.so rr_diff_umetric.so rr_diff_ux.so rr_diff_uy.so rr_diff_uz.so rr_diff_vmetric.so rr_diff_vx.so rr_ [...]
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/romea/ffta_2.F b/external_functions/romea/ffta_2.F
new file mode 100644
index 0000000..7e4e7c8
--- /dev/null
+++ b/external_functions/romea/ffta_2.F
@@ -0,0 +1,450 @@
+*
+* ffta_2.F            FFTA with a second argument, just passed along.
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta_2 = ffta_2(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta_2(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_2_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 'ffta of 2nd var')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'Variable with regular time axis. ')
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'b')
+      CALL ef_set_arg_desc(id, arg, 'scalar variable')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+      SUBROUTINE ffta_2_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = nd/2	
+
+      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+
+      freq1 = 1.* yquist/ float(nfreq)
+      freqn = 1.001*yquist
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+     .   outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_2_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_2_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_2_compute(id, arg_1, arg_2, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/romea/ffta_3.F b/external_functions/romea/ffta_3.F
new file mode 100644
index 0000000..61f6a1f
--- /dev/null
+++ b/external_functions/romea/ffta_3.F
@@ -0,0 +1,446 @@
+*
+* ffta_3.F            FFTA with a second argument, just passed along.
+*                     3rd argument is Number of frequencies.
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta_3 = ffta_3(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta_3(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_3_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 'ffta of 1st var')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'Variable with regular time axis. ')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'b')
+      CALL ef_set_arg_desc(id, arg, 'scalar variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nfreq')
+      CALL ef_set_arg_desc(id, arg, 'scalar variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ffta_3_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      arg = 3
+      call ef_get_one_val(id, arg, value)
+      nfreq = value	
+
+      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+
+      freq1 = 1.* yquist/ float(nfreq)
+      freqn = 1.001*yquist
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+     .   outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_3_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER nfreq
+      INTEGER arg
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      arg = 3
+      call ef_get_one_val(id, arg, value)
+      nfreq = value	
+
+      nfreq = value
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_3_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_3_compute(id, arg_1, arg_2, arg_3, result, 
+     .          a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/romea/ffta_sample_rr.F b/external_functions/romea/ffta_sample_rr.F
new file mode 100644
index 0000000..1989929
--- /dev/null
+++ b/external_functions/romea/ffta_sample_rr.F
@@ -0,0 +1,452 @@
+*
+* ffta_sample.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta_sample = ffta_sample(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta_sample(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_sample_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*110 arg_desc, fcn_desc
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      WRITE (fcn_desc, 20)
+      CALL ef_set_desc(id, fcn_desc)
+   20 FORMAT ( 'Computes fft amplitude spectra, ',
+     .          'normalized by 1/N' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, CUSTOM)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .         'explicitly e.g. ffta_sample(var[l=1,120])')
+
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ffta_sample_custom_axes(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER nfreq, nd
+
+      REAL yquist, freq1, freqn
+      
+      CHARACTER outunits*32
+      REAL boxsize(1)
+         
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info(id, arg, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .               arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = nd/2	
+
+      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+
+      freq1 = 1.* yquist/ float(nfreq)
+      freqn = 1.001*yquist
+
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+     .   outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_sample_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_sample_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_sample_compute(id, arg_1, result, a, b, wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/romea/fftabst.F b/external_functions/romea/fftabst.F
new file mode 100644
index 0000000..49113d1
--- /dev/null
+++ b/external_functions/romea/fftabst.F
@@ -0,0 +1,379 @@
+*
+* fftabst.F            FFTA with a second argument, and change CUSTOM to ABSTRACT.
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssfftabst = fftabst(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fftabst(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fftabst_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+c      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 'ffta of 2nd var')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'Variable with regular time axis. ')
+
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'b')
+      CALL ef_set_arg_desc(id, arg, 'scalar variable')
+
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fftabst_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+*     Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = 1
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fftabst_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims (id, 3, 1, 1, 1, 1, mtwork, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims (id, 4, 1, 1, 1, 1, mtdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fftabst_compute(id, arg_1, arg_2, result, a, b, 
+     .                            wft, ts)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+*  Dimension work arrays
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+
+      REAL aa, bb
+      INTEGER nd, nf
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CHARACTER*80 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l)', 4I5)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+      IF (.NOT. regular(T_AXIS)) THEN
+            WRITE (err_msg, *) 'Time axis must be a regular axis'
+            GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*
+* Calculate the FFT for each time series which have no missing data.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = 1, nd
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     WRITE (err_msg, 40) i1,j1,k1,l
+                     GO TO 999 
+                  ENDIF
+
+                  ts(l,1,1,1) = arg_1(i1,j1,k1,l1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l = res_lo_ss(T_AXIS)
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1)
+                   bb = b(l,1,1,1)
+                   result(i,j,k,l) = SQRT(aa*aa + bb*bb)
+ 110           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+      
diff --git a/external_functions/romea/rr_adv_sx.F b/external_functions/romea/rr_adv_sx.F
new file mode 100644
index 0000000..9135600
--- /dev/null
+++ b/external_functions/romea/rr_adv_sx.F
@@ -0,0 +1,237 @@
+*           rr_adv_sx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Computes the zonal nonlinear advective term: - u dS/dx
+*     Units :      (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_sx_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-u(dS/dx) nonlinear term (SALT/s);MOM2 T Grid.')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_sx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2 
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dyu
+      REAL adv_vet, adv_fe, cst
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+
+      adv_vet(i1,j1,k1,l1,iLat) = (arg_1(i1,j1,k1,l1)*dyu(iLat) + 
+     .              arg_1(i1,j1-1,k1,l1)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat) = adv_vet(i1,j1,k1,l1,iLat)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  (
+     .                  - (adv_fe(i1,j1,k1,l1,i2,j2,k2,l2,iLat) - 
+     .                    adv_fe(i1-1,j1,k1,l1,i2-1,j2,k2,l2,iLat)) 
+     .                       /2.
+     .                  + arg_2(i2,j2,k2,l2) *
+     .                     (  adv_vet(i1,j1,k1,l1,iLat) 
+     .                     - adv_vet(i1-1,j1,k1,l1,iLat) )   ) 
+     .                       /dxt(iLon)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_sy.F b/external_functions/romea/rr_adv_sy.F
new file mode 100644
index 0000000..f945abf
--- /dev/null
+++ b/external_functions/romea/rr_adv_sy.F
@@ -0,0 +1,229 @@
+*           rr_adv_sy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Computes the zonal nonlinear advective term:  - v dS/dy
+*     Units :      (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T
+
+*******************************************************************
+
+      SUBROUTINE RR_adv_sy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-v(dS/dy) nonlinear term (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_sy_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu
+      REAL adv_vnt, adv_fn, cst
+
+      INCLUDE 'rr_parameters.h'
+  
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      
+      adv_vnt(i1,j1,k1,l1,iLon) = (arg_1(i1,j1,k1,l1)*dxu(iLon) + 
+     .        arg_1(i1-1,j1,k1,l1)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLon) = adv_vnt(i1,j1,k1,l1,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2,j2+1,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1 
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  (
+     .                  - (adv_fn(i1,j1,k1,l1,i2,j2,k2,l2,iLon) - 
+     .                    adv_fn(i1,j1-1,k1,l1,i2,j2,k2,l2,iLon) ) 
+     .                            /2.
+     .                   + arg_2(i2,j2,k2,l2) * 
+     .                    (  adv_vnt(i1,j1,k1,l1,iLon)
+     .                     - adv_vnt(i1,j1-1,k1,l1,iLon) ) )
+     .                            /dyt(iLat)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_sz.F b/external_functions/romea/rr_adv_sz.F
new file mode 100644
index 0000000..22bec37
--- /dev/null
+++ b/external_functions/romea/rr_adv_sz.F
@@ -0,0 +1,232 @@
+*           rr_adv_sz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000      
+*
+*     Zonal nonlinear advective term:  - w dS/dz
+*     Units :  (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_sz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-w(dS/dz) nonlinear term (SALT/s);MOM2 T Grid.')
+      CALL ef_set_num_args         (id,3)
+      CALL ef_set_axis_inheritance (id,IMPLIED_BY_ARGS, 
+     .                                 IMPLIED_BY_ARGS, 
+     .                                 IMPLIED_BY_ARGS, 
+     .                                 IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+      CALL ef_set_arg_name         (id,ARG1,'U')
+      CALL ef_set_arg_desc         (id,ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id,ARG1,'cm/sec')
+      CALL ef_set_arg_type         (id,ARG1,FLOAT_ARG)
+      CALL ef_set_axis_influence   (id,ARG1,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id,ARG1,X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG1,Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG1,Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id,ARG2,'W')
+      CALL ef_set_arg_desc         (id,ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid.')
+      CALL ef_set_arg_unit         (id,ARG2,'cm/sec')
+      CALL ef_set_arg_type         (id,ARG2,FLOAT_ARG)
+      CALL ef_set_axis_influence   (id,ARG2,NO,NO,NO,YES)
+      CALL ef_set_axis_extend      (id,ARG2,X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG2,Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG2,Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id,ARG3,'SALT')
+      CALL ef_set_arg_desc         (id,ARG3,
+     . 'Salinity, on the MOM2 T Grid.')
+      CALL ef_set_arg_unit         (id,ARG3,'(ppt-35)/1000')
+      CALL ef_set_arg_type         (id,ARG3,FLOAT_ARG)
+      CALL ef_set_axis_influence   (id,ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id,ARG3,X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG3,Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id,ARG3,Z_AXIS,0,+1)
+      END
+
+
+
+
+      SUBROUTINE RR_adv_sz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16   ax_name(4)
+      CHARACTER*16   ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           adv_fb         
+
+      INCLUDE 'rr_parameters.h'
+
+      adv_fb(i2,j2,k2,l2,i3,j3,k3,l3) =  arg_2(i2,j2,k2,l2)
+     .                  * (arg_3(i3,j3,k3,l3) + arg_3(i3,j3,k3+1,l3))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'           .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'           .AND.
+     .         ax_units(3) .NE. 'METERS' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF 
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         ilat = 2  
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            iLon = 2
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+	       iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     IF (iZ .EQ. 1) THEN
+                        result(i,j,k,l) = (  
+     .                       arg_2(i2,j2,k2,l2)
+     .                  * (arg_3(i3,j3,k3,l3) + arg_3(i3,j3,k3+1,l3))
+     .                           / 2. 
+     .                       - arg_3(i3,j3,k3,l3) * 
+     .                              arg_2(i2,j2,k2,l2)  
+     .                    ) / (zW(iZ)*Meters_to_cm)     
+     .                     * sec_per_month
+                     ELSE
+                        result(i,j,k,l) =  ( 
+     .                      - (adv_fb(i2,j2,k2-1,l2,i3,j3,k3-1,l3)
+     .                        - adv_fb(i2,j2,k2,l2,i3,j3,k3,l3)) / 2.
+     .                      + arg_3(i3,j3,k3,l3) * (
+     .                          arg_2(i2,j2,k2-1,l2) - 
+     .                              arg_2(i2,j2,k2,l2) ) 
+     .                     )  /(zW(iZ-1)-zW(iZ))/Meters_to_cm        
+     .                     * sec_per_month
+                     ENDIF
+                  ENDIF
+                  iZ = iZ + 1
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+               ENDDO
+               iLon = iLon + 1
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+            ENDDO
+            iLat = iLat + 1
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         ENDDO
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END
+
diff --git a/external_functions/romea/rr_adv_tx.F b/external_functions/romea/rr_adv_tx.F
new file mode 100644
index 0000000..b3aada0
--- /dev/null
+++ b/external_functions/romea/rr_adv_tx.F
@@ -0,0 +1,185 @@
+*           rr_adv_tx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Zonal nonlinear advective term:  -u dT/dx
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_tx_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-u(dT/dx) nonlinear term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)   
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP ')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO,NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_tx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      
+      INTEGER        ilat
+      INTEGER        ilon
+
+      REAL           dxt, dyt, dyu
+      REAL           adv_vet, adv_fe, cst
+      
+      INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat) = adv_vet(i1,j1,k1,l1,iLat)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                  - (adv_fe(i1,j1,k1,l1,i2,j2,k2,l2,iLat) - 
+     .                    adv_fe(i1-1,j1,k1,l1,i2-1,j2,k2,l2,iLat)) 
+     .                       /2.
+     .                  + arg_2(i2,j2,k2,l2) *  
+     .                     (  adv_vet(i1,j1,k1,l1,iLat) 
+     .                     - adv_vet(i1-1,j1,k1,l1,iLat) )   ) 
+     .                       /dxt(iLon)/cst*sec_per_month
+                   ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_ty.F b/external_functions/romea/rr_adv_ty.F
new file mode 100644
index 0000000..43e8849
--- /dev/null
+++ b/external_functions/romea/rr_adv_ty.F
@@ -0,0 +1,190 @@
+*           rr_adv_ty.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal nonlinear advective term:  -v dT/dy
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_ty_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-v(dT/dy) nonlinear term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+      
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_ty_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+
+      REAL dxt, dyt, dxu
+      REAL adv_vnt, adv_fn, cst
+
+	INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+
+      adv_vnt(i,j,k,l,iLon) = (arg_1(i,j,k,l)*dxu(iLon) + 
+     .        arg_1(i-1,j,k,l)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLon) = adv_vnt(i1,j1,k1,l1,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2,j2+1,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1 
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l1) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  (
+     .                  - (adv_fn(i1,j1,k1,l1,i2,j2,k2,l2,iLon) - 
+     .                    adv_fn(i1,j1-1,k1,l1,i2,j2-1,k2,l2,iLon) ) 
+     .                            /2.
+     .                   + arg_2(i2,j2,k2,l2) *  
+     .                    (  adv_vnt(i1,j1,k1,l1,iLon)
+     .                     - adv_vnt(i1,j1-1,k1,l1,iLon) ) )
+     .                            /dyt(iLat)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_tz.F b/external_functions/romea/rr_adv_tz.F
new file mode 100644
index 0000000..674e9ea
--- /dev/null
+++ b/external_functions/romea/rr_adv_tz.F
@@ -0,0 +1,121 @@
+      SUBROUTINE RR_adv_tz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+      CALL ef_set_desc             (id,
+     .'-w(dT/dz) nonlinear term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+	CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+      END
+
+
+      SUBROUTINE RR_adv_tz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER        id
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      REAL*8         zW(1024)
+      INTEGER        iZ
+      REAL           adv_fb         
+      INCLUDE 'rr_parameters.h'
+
+      adv_fb(i2,j2,k2,l2,i3,j3,k3,l3) =  arg_2(i2,j2,k2,l2)
+     .                  * (arg_3(i3,j3,k3,l3) + arg_3(i3,j3,k3+1,l3))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (iZ .EQ. 1) THEN
+                        result(i,j,k,l) =
+     .                              arg_2(i2,j2,k2,l2)  
+     .                  * (arg_3(i3,j3,k3,l3) - arg_3(i3,j3,k3+1,l3))
+     .                                /zW(iZ)/Meters_to_cm 
+                  ELSE 
+                        result(i,j,k,l) = - ( 
+     .      	                adv_fb(i2,j2,k2-1,l2,i3,j3,k3-1,l3)
+     .                       - adv_fb(i2,j2,k2,  l2,i3,j3,k3,  l3))
+     .                         /2./(zW(iZ-1)-zW(iZ))/Meters_to_cm 
+     .                        + arg_3(i3,j3,k3,l3) * ( 
+     .                            arg_2(i2,j2,k2-1,l2) - 
+     .                               arg_2(i2,j2,k2,l2)) 
+     .                             /(zW(iZ-1)-zW(iZ))/Meters_to_cm 
+                  ENDIF
+                  iZ = iZ + 1
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+               ENDDO
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+            ENDDO
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         ENDDO
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END
+
+
diff --git a/external_functions/romea/rr_adv_umetric.F b/external_functions/romea/rr_adv_umetric.F
new file mode 100644
index 0000000..75b48ac
--- /dev/null
+++ b/external_functions/romea/rr_adv_umetric.F
@@ -0,0 +1,181 @@
+*           rr_adv_umetric.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Computes the zonal nonlinear advective metric:  uv tan(theta) / a
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_umetric_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     . 'Zonal momentum nonlinear metric term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+
+      END
+
+
+      SUBROUTINE RR_adv_umetric_compute(id, arg_1, arg_2, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2 
+
+      INTEGER        ilat
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL tng
+
+      REAL*8         yU(1024)
+
+	INCLUDE 'rr_parameters.h'
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            iLat = 1  
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            j2 = arg_lo_ss(Y_AXIS,ARG2)
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               
+               IF ( DABS(yU(iLat)) .EQ. 90.d0 ) THEN
+                 tng = 0.   ! handle special case
+               ELSE   
+                 tng = TAN (SNGL(yU(iLat)) * Degrees_to_radians) 
+               ENDIF
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               i2 = arg_lo_ss(X_AXIS,ARG2)
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = tng / RR_radius
+     .                       * ARG_1(i1,j1,k1,l1) 
+     .                       * ARG_2(i2,j2,k2,l2)*sec_per_month
+                  ENDIF
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_ux.F b/external_functions/romea/rr_adv_ux.F
new file mode 100644
index 0000000..5edfa6a
--- /dev/null
+++ b/external_functions/romea/rr_adv_ux.F
@@ -0,0 +1,274 @@
+*           rr_adv_ux.F
+*
+*           Rick Romea
+*  	    Jan. 24, 2000
+*
+*     Zonal nonlinear advective term in flux form:  - d(uu)/dx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_ux_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-u(du/dx) nonlinear advective momentum term(cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,  NO, NO, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_ux_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vet, adv_veu, adv_fe, csu
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C     adv_vet(i,k,j)=(u(i,k,j)*dyu(j)+u(i,k,j-1)*dyu(j-1))/2/dyt(j)
+C     adv_veu(i,k,j) = ((adv_vet(i,k,j)*dus(j)
+C     &                       + adv_vet(i,k,j+1)*dun(j)
+C     &                        )*duw(i+1) +    
+C     &                        (adv_vet(i+1,k,j)*dus(j)
+C     &                       + adv_vet(i+1,k,j+1)*dun(j)
+C     &                        )*due(i)) /   dyu(j) / dxt(i+1)
+C      adv_fe (i,k,j) = adv_veu(i,k,j)*(u(i,k,j)+u(i+1,k,j))
+C      ADV_Ux(i,k,j) = (adv_fe(i,k,j)-adv_fe(i-1,k,j))/dxu(i)/2/cos(phi(j))
+C
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_veu(i,j,k,l,iLat,iLon) =
+     . ((adv_vet(i,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i,j+1,k,l,iLat) * dun(iLat))*duw(iLon+1) +    
+     .  (adv_vet(i+1,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i+1,j+1,k,l,iLat) * dun(iLat))*due(iLon))
+     .                     / dyu(iLat) / dxt(iLon+1)
+      adv_fe (i,j,k,l,iLat,iLon) = adv_veu(i,j,k,l,iLat,iLon)
+     .                  *(arg_1(i,j,k,l) + arg_1(i+1,j,k,l))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'Deg'       .AND.
+     .         ax_units(2) .NE. 'DEG'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees'   .AND.
+     .         ax_units(2) .NE. 'Degrees'   .AND.
+     .         ax_units(2) .NE. 'DEGREES'   .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) 
+     .                        )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                  - (adv_fe(i1,j1,k1,l1,iLat,iLon) - 
+     .                    adv_fe(i1-1,j1,k1,l1,iLat,iLon-1) ) 
+     .                       /2.
+     .              + arg_1(i1,j1,k1,l1) *
+     .               ( adv_veu(i1,j1,k1,l1,iLat,iLon)
+     .                 -  adv_veu(i1-1,j1,k1,l1,iLat,iLon-1) )
+     .                  ) /dxu(iLon)/csu*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_uy.F b/external_functions/romea/rr_adv_uy.F
new file mode 100644
index 0000000..2160239
--- /dev/null
+++ b/external_functions/romea/rr_adv_uy.F
@@ -0,0 +1,276 @@
+*           rr_adv_uy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal nonlinear advective term:  -v du/dy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_uy_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-v(du/dy) nonlinear advective momentum term(cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_uy_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_vnu, adv_fn, csu
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i,j,k,l,iLon) = (arg_2(i,j,k,l)*dxu(iLon) + 
+     .        arg_2(i-1,j,k,l)*dxu(iLon-1)) /2./ dxt(iLon)
+
+      adv_vnu(i,j,k,l,iLat,iLon) =
+     . ((adv_vnt(i,  j,  k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j,  k,l,iLon) * due(iLon))*dus(iLat+1) +    
+     .  (adv_vnt(i,  j+1,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j+1,k,l,iLon) * due(iLon))*dun(iLat))
+     .                     / dyt(iLat+1) / dxu(iLon)
+
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) = 
+     .                	adv_vnu(i2,j2,k2,l2,iLat,iLon)
+     .                  *(arg_1(i1,j1,k1,l1) + arg_1(i1,j1+1,k1,l1))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  (
+     .             - (adv_fn(i1,j1,  k1,l1,i2,j2  ,k2,l2,iLat,  iLon)- 
+     .                adv_fn(i1,j1-1,k1,l1,i2,j2-1,k2,l2,iLat-1,iLon)) 
+     .                      /2.
+     .                  + arg_1(i1,j1,k1,l1) * (
+     .                     adv_vnu(i2,j2,k2,l2,iLat,iLon)
+     .                      - adv_vnu(i2,j2-1,k2,l2,iLat-1,iLon) )
+     .                      ) / dyu(iLat)/csu * sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_uz.F b/external_functions/romea/rr_adv_uz.F
new file mode 100644
index 0000000..8ff76df
--- /dev/null
+++ b/external_functions/romea/rr_adv_uz.F
@@ -0,0 +1,287 @@
+*           rr_adv_uz.F
+*
+*           Rick Romea
+*           March 16, 2000	
+*
+*     Zonal nonlinear advective term:  -w du/dz
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_uz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-w(du/dz) nonlinear advective momentum term(cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argumen (W)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      END
+
+
+
+
+      SUBROUTINE RR_adv_uz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16   ax_name(4)
+      CHARACTER*16   ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           dxt, dyt, dxu, dyu
+      REAL           dus, dun, duw, due
+      REAL           adv_fb, adv_vbu
+      REAL           csu, cst
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dzt     = vertical height of "u,v" or "t" grid box (in cm)
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+
+      adv_vbu(i,j,k,l,iLat,iLon) =
+     . ( arg_2(i,  j,  k,l) * dus(iLat) * duw(iLon) * cst(iLat)
+     . + arg_2(i+1,j,  k,l) * dus(iLat) * due(iLon) * cst(iLat) 
+     . + arg_2(i,  j+1,k,l) * dun(iLat) * duw(iLon) * cst(iLat+1)
+     . + arg_2(i+1,j+1,k,l) * dun(iLat) * due(iLon) * cst(iLat+1)
+     .                   ) / dyu(iLat) / dxu(iLon) / csu(iLat)
+
+      adv_fb(i1,j1,k1,l1,i2,j2,k2,l2, iLat,iLon) = 
+     .       	         adv_vbu(i2,j2,k2,l2,iLat,iLon)
+     .                  * (arg_1(i1,j1,k1,l1) + arg_1(i1,j1,k1+1,l1))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'           .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'           .AND.
+     .         ax_units(3) .NE. 'METERS' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF 
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         ilat = 2  
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            iLon = 2
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+	       iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     IF (iZ .EQ. 1) THEN
+  		         result(i,j,k,l) = ( 
+     .                        adv_fb(i1,j1,k1,l1,
+     .                               i2,j2,k2,l2, iLat,iLon) 
+     .                             / 2.
+     .                   - arg_1(i1,j1,k1,l1) *
+     .                     adv_vbu(i2,j2,k2,l2,iLat,iLon)
+     .                        ) / (zW(iZ)*Meters_to_cm)
+     .                            * sec_per_month
+	               ELSE
+			 result(i,j,k,l) = (
+     .                     - ( adv_fb(i1,j1,k1-1,l1,
+     .                                i2,j2,k2-1,l2,iLat,iLon)
+     .                       - adv_fb(i1,j1,k1,  l1,
+     .                                i2,j2,k2,  l2, iLat,iLon))
+     .                             / 2. 
+     .                   + arg_1(i1,j1,k1,l1) *
+     .                     ( adv_vbu(i2,j2,k2-1,l2,iLat,iLon)
+     .                      - adv_vbu(i2,j2,k2,l2,iLat,iLon) )
+     .                        ) / (zW(iZ-1)-zW(iZ))/Meters_to_cm
+     .                          * sec_per_month
+                     ENDIF
+                  ENDIF
+                  iZ = iZ + 1
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               ENDDO
+               iLon = iLon + 1
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+            ENDDO
+            iLat = iLat + 1
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END				
+
+
diff --git a/external_functions/romea/rr_adv_vmetric.F b/external_functions/romea/rr_adv_vmetric.F
new file mode 100644
index 0000000..a02fd6e
--- /dev/null
+++ b/external_functions/romea/rr_adv_vmetric.F
@@ -0,0 +1,156 @@
+*           rr_adv_vmetric.F
+*
+*           Rick Romea
+*           Jan. 5, 2000 
+*
+*     Meridional nonlinear advective metric: -vv tan(theta) / a
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_vmetric_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+      CALL ef_set_desc             (id,
+     .'Meridional momentum nonlinear metric (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      END
+
+
+      SUBROUTINE RR_adv_vmetric_compute(id, arg_1, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      INTEGER        ilat
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL tng
+
+      REAL*8         yU(1024)
+
+	INCLUDE 'rr_parameters.h'
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            iLat = 1  
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               
+               IF ( DABS(yU(iLat)) .EQ. 90.d0 ) THEN
+                 tng = 0.   ! handle special case
+               ELSE   
+                 tng = TAN (SNGL(yU(iLat)) * Degrees_to_radians) 
+               ENDIF
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1))THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = - tng / RR_radius
+     .                   * ARG_1(i1,j1,k1,l1) 
+     .                   * ARG_1(i1,j1,k1,l1) * sec_per_month
+ 
+                  ENDIF
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_vx.F b/external_functions/romea/rr_adv_vx.F
new file mode 100644
index 0000000..d3eccbe
--- /dev/null
+++ b/external_functions/romea/rr_adv_vx.F
@@ -0,0 +1,286 @@
+*           rr_adv_vx.F
+*
+*           Rick Romea
+*           Feb. 1, 2000
+*
+*     Meridional nonlinear advective term:  -u dv/dx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_vx_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-u(dv/dx) nonlinear advective momentum term (cm/s^2);MOM2 UGrid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_vx_compute(id, arg_1, arg_2, arg_3, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vet, adv_veu, adv_fe, csu
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C     adv_vet(i,k,j)=(u(i,k,j)*dyu(j)+u(i,k,j-1)*dyu(j-1))/2/dyt(j)
+C     adv_veu(i,k,j) = ((adv_vet(i,k,j)*dus(j)
+C     &                       + adv_vet(i,k,j+1)*dun(j)
+C     &                        )*duw(i+1) +    
+C     &                        (adv_vet(i+1,k,j)*dus(j)
+C     &                       + adv_vet(i+1,k,j+1)*dun(j)
+C     &                        )*due(i)) /   dyu(j) / dxt(i+1)
+C      adv_fe (i,k,j) = adv_veu(i,k,j)*(v(i,k,j)+v(i+1,k,j))
+C      ADV_Ux(i,k,j) = (adv_fe(i,k,j)-adv_fe(i-1,k,j))/dxu(i)/2/cos(phi(j))
+C
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_veu(i,j,k,l,iLat,iLon) =
+     . ((adv_vet(i,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i,j+1,k,l,iLat+1) * dun(iLat))*duw(iLon+1) +    
+     .  (adv_vet(i+1,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i+1,j+1,k,l,iLat+1) * dun(iLat))*due(iLon))
+     .                     / dyu(iLat) / dxt(iLon+1)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) = 
+     .	                adv_veu(i1,j1,k1,l1,iLat,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .               - (adv_fe(i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) - 
+     .                  adv_fe(i1-1,j1,k1,l1,i2-1,j2,k2,l2,iLat,iLon-1)) 
+     .                       /2.
+     .              + arg_2(i2,j2,k2,l2) *
+     .               ( adv_veu(i1,j1,k1,l1,iLat,iLon)
+     .                 -  adv_veu(i1-1,j1,k1,l1,iLat,iLon-1) )
+     .                  ) /dxu(iLon)/csu*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_vy.F b/external_functions/romea/rr_adv_vy.F
new file mode 100644
index 0000000..7e9c486
--- /dev/null
+++ b/external_functions/romea/rr_adv_vy.F
@@ -0,0 +1,244 @@
+*           rr_adv_vy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000	        
+*
+*     Meridional nonlinear advective term:  -v dv/dy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_vy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-v(dv/dy) nonlinear advective momentum term(cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_adv_vy_compute(id, arg_1, arg_2, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_vnu, adv_fn, csu
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i,j,k,l,iLon) = (arg_1(i,j,k,l)*dxu(iLon) + 
+     .        arg_1(i-1,j,k,l)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_vnu(i,j,k,l,iLat,iLon) =
+     . ((adv_vnt(i,j,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j,k,l,iLon) * due(iLon))*dus(iLat+1) +    
+     .  (adv_vnt(i,j+1,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j+1,k,l,iLon) * due(iLon))*dun(iLat))
+     .                     / dyt(iLat+1) / dxu(iLon)
+      adv_fn (i,j,k,l,iLat,iLon) = adv_vnu(i,j,k,l,iLat,iLon)
+     .                  *(arg_1(i,j,k,l) + arg_1(i,j+1,k,l))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  (
+     .               - (adv_fn(i1,j1,  k1,l1,iLat,  iLon)- 
+     .                  adv_fn(i1,j1-1,k1,l1,iLat-1,iLon)) 
+     .                      /2.
+     .                  + arg_1(i1,j1,k1,l1) * (
+     .                     adv_vnu(i1,j1,k1,l1,iLat,iLon)
+     .                      - adv_vnu(i1,j1-1,k1,l1,iLat-1,iLon) )
+     .                      ) / dyu(iLat)/csu * sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_adv_vz.F b/external_functions/romea/rr_adv_vz.F
new file mode 100644
index 0000000..de39458
--- /dev/null
+++ b/external_functions/romea/rr_adv_vz.F
@@ -0,0 +1,290 @@
+*           rr_adv_vz.F
+*
+*           Rick Romea
+*           March 16, 2000	     
+*
+*     Meridional nonlinear advective term:  -w dv/dz
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_adv_vz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-w(dv/dz) nonlinear advective momentum term(cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (W)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      END
+
+
+
+
+      SUBROUTINE RR_adv_vz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16   ax_name(4)
+      CHARACTER*16   ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           dxu, dyu
+      REAL           dus, dun, duw, due
+      REAL           adv_fb, adv_vbu
+      REAL           csu, cst
+	
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dzt     = vertical height of "u,v" or "t" grid box (in cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+
+      adv_vbu(i,j,k,l,iLat,iLon) =
+     . ( arg_2(i,  j,  k,l) * dus(iLat) * duw(iLon) * cst(iLat)
+     . + arg_2(i+1,j,  k,l) * dus(iLat) * due(iLon) * cst(iLat) 
+     . + arg_2(i,  j+1,k,l) * dun(iLat) * duw(iLon) * cst(iLat+1)
+     . + arg_2(i+1,j+1,k,l) * dun(iLat) * due(iLon) * cst(iLat+1)
+     .                   ) / dyu(iLat) / dxu(iLon) / csu(iLat)
+
+      adv_fb(i1,j1,k1,l1,i2,j2,k2,l2, iLat,iLon) = 
+     .       	         adv_vbu(i2,j2,k2,l2,iLat,iLon)
+     .                  * (arg_1(i1,j1,k1,l1) + arg_1(i1,j1,k1+1,l1))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'           .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'           .AND.
+     .         ax_units(3) .NE. 'METERS' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF 
+
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         ilat = 2  
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         
+            iLon = 2
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+	       k1 = arg_lo_ss(Z_AXIS,ARG1)
+	       k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     IF (k1 .EQ. 1) THEN
+  		         result(i,j,k,l) = ( 
+     .                        adv_fb(i1,j1,k1,l1,
+     .                               i2,j2,k2,l2, iLat,iLon) 
+     .                             / 2.
+     .                   - arg_1(i1,j1,k1,l1) *
+     .                     adv_vbu(i2,j2,k2,l2,iLat,iLon)
+     .                        ) /  (zW(iZ)*Meters_to_cm)
+     .                         * sec_per_month
+	               ELSE
+			 result(i,j,k,l) = (
+     .                     - ( adv_fb(i1,j1,k1-1,l1,
+     .                                i2,j2,k2-1,l2,iLat,iLon)
+     .                       - adv_fb(i1,j1,k1,  l1,
+     .                                i2,j2,k2,  l2, iLat,iLon) )
+     .                             / 2. 
+     .                   + arg_1(i1,j1,k1,l1) *
+     .                     ( adv_vbu(i2,j2,k2-1,l2,iLat,iLon)
+     .                      - adv_vbu(i2,j2,k2,l2,iLat,iLon) )
+     .                        ) / (zW(iZ-1)-zW(iZ))/Meters_to_cm 
+     .                               * sec_per_month
+                     ENDIF
+                  ENDIF
+
+	            iZ = iZ + 1
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               ENDDO
+
+               iLon = iLon + 1
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+            ENDDO
+
+            iLat = iLat + 1
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END
diff --git a/external_functions/romea/rr_av.F b/external_functions/romea/rr_av.F
new file mode 100644
index 0000000..36b8e32
--- /dev/null
+++ b/external_functions/romea/rr_av.F
@@ -0,0 +1,288 @@
+*     rr_av.F   ----    Rick Romea     Jun. 6, 2000
+*
+*     Vertical diffusion coefficient: Az (Units = cm^2/s)
+*
+*******************************************************************
+
+      SUBROUTINE RR_av_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+      CALL ef_set_desc(id,'Vertical diffusion coefficient:Az (cm^2/s)')
+      CALL ef_set_num_args(id,4)
+      CALL ef_set_axis_inheritance(id,IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG4,
+     . 'Salinity, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG4, '(ppt-35)/1000')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG4, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Z_AXIS,0,+1)
+
+      END 
+
+
+      SUBROUTINE RR_av_compute(id,arg_1,arg_2,arg_3,arg_4,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                       mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                       mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                       mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i4, j4, k4, l4
+
+      REAL*8         zT(1024)
+      INTEGER        iZ
+      REAL get_dzw,dzw,dzt,rhom1z,Ri,Potential_density
+
+      INCLUDE 'rr_parameters.h'
+
+      ! visc_cbu_back = 1.
+      ! wndmix = 10.
+      ! visc_cbu_limit = fricmx
+      ! fricmx = 50.
+      ! gravity = 980.6
+
+c*********************************************************************
+c     THIS IS THE MOM2 CODE:
+c
+c     dzt     = thickness of "t" grid cells (cm)
+c     dztr(k) = reciprocal of "dzt"
+c     dzw(k)  = vertical resolution of "w" grid cells (in cm)
+c     dzwr(k) = reciprocal of "dzw"
+c     visc_cbu       = viscosity coefficient at bottom of "u" cells (cm**2/s)
+c     visc_cbu_back  = background viscosity (cm**2/s)  =  1.
+c     fricmx         = maximum viscosity    (cm**2/s)  = 50.
+c     visc_cbu_limit = largest viscosity (cm**2/sec) = fricmx
+c     wndmix         = min value for mixing at surface to 
+c                     simulate high freq wind mixing. (cm**2/sec)  = 10.
+c     smf     = surface momentum flux (dynes/cm**2)
+c                smf(1) = taux     smf(2) = tauy
+c     grav    = gravity (cm/sec**2)
+c     epsln   = small value: 1.e-25
+c
+c      t1                = 1./(1. + 5.*riu(i,k,j))
+c      visc_cbu(i,k,j)   = fricmx*t1**2 + visc_cbu_back
+c      if(riu(i,k,j).lt.0.)visc_cbu(i,k,j)=visc_cbu_limit ! unstable
+c      if(visc_cbu(i,1,j).lt.wndmix)visc_cbu(i,1,j)=wndmix ! surface
+c
+c      riu(i,k,j) = -grav/4.*dzw(k)*(rhom1z(i,k,j+1) + rhom1z(i+1,k,j+1) +
+c     &                            rhom1z(i,k,j)   + rhom1z(i+1,k,j)) /
+c     &  ((u(i,k,j,1)-u(i,k+1,j,1))**2+(u(i,k,j,2)-u(i,k+1,j,2))**2 +  epsln) 
+c      rhom1z(i,k,j) = ro(i,k,j) - ro(i,k+1,j)
+c      do ks=1,2
+c        call statec (t(1,1,1,1,tlev), t(1,1,1,2,tlev), ro(1,1,jsmw)
+c     &,              max(js,jsmw), je, istrt-1, iend+1, ks)
+c*********************************************************************
+
+      !  Statement functions
+
+      dzw(iZ) =  get_dzw(iZ,zT) * Meters_to_cm
+      dzt(iZ) = (dzw(iZ-1) + dzw(iZ)) / 2.
+      rhom1z(i3,j3,k3,l3,i4,j4,k4,l4) =
+     .        Potential_density(arg_3(i3,j3,k3  ,l3),
+     .                          arg_4(i4,j4,k4  ,l4))
+     .      - Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                          arg_4(i4,j4,k4+1,l4)) 
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG3, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG3),
+     .                            arg_hi_ss(Z_AXIS,ARG3), zT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         j4 = arg_lo_ss(Y_AXIS,ARG4) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            i4 = arg_lo_ss(X_AXIS,ARG4) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               k4 = arg_lo_ss(Z_AXIS,ARG4)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_4(i4,  j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4-1,k4,l4) .EQ. bad_flag(ARG4)
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     Ri = - gravity/4. * dzw(iZ) * (
+     .                  rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4) + 
+     .                  rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) +
+     .                  rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4) + 
+     .                  rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) ) /
+     .               ( (arg_1(i1,j1,k1,l1)-arg_1(i1,j1,k1+1,l1))**2 +
+     .                 (arg_2(i2,j2,k2,l2)-arg_2(i2,j2,k2+1,l2))**2 
+     .                        + epsln )
+                     IF(Ri.lt.0.25)THEN
+                        result(i,j,k,l) = visc_cbu_limit  ! unstable
+                     ELSE
+                        result(i,j,k,l) = fricmx/(1.+5.*Ri)**2
+     .                                      + visc_cbu_back
+                     ENDIF
+                     IF(k1.EQ.1.AND.result(i,j,k,l).lt.wndmix)
+     .                   result(i,j,k,l)=wndmix ! surface
+                  ENDIF
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                  k4 = k4 + arg_incr(Z_AXIS,ARG4)
+               ENDDO
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+               i4 = i4 + arg_incr(X_AXIS,ARG4)
+            ENDDO
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         ENDDO               
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+      ENDDO
+      END
+
+
+      REAL FUNCTION Potential_density(T,S)
+      IMPLICIT NONE
+      REAL T ! Potential Temperature  
+      REAL S ! ( SALINITY(ppt) - 35) / 1000 
+      REAL Pressure / 1.0 / ! Bar
+      REAL Sppt ! Salinity (ppt)     
+      Sppt = 1.e3*S+35.  ! Convert S: -->  ppt
+      CALL RR_unesco(T,Sppt,Pressure,Potential_density)
+      Potential_density = Potential_density*1.e-3  ! Convert:kg/m^3-->g/cm^3
+      END				  
+
+      REAL FUNCTION get_dzw(iZ,zT) 
+      IMPLICIT NONE
+      INTEGER iZ
+      REAL*8 zT(iZ+1) 
+      IF(iZ.EQ.0)THEN
+	get_dzw=SNGL(zT(1))
+      ELSE
+        get_dzw=SNGL(zT(iZ+1)-zT(iZ))
+      ENDIF
+      END
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_cross_spectrum.F b/external_functions/romea/rr_cross_spectrum.F
new file mode 100644
index 0000000..908bb51
--- /dev/null
+++ b/external_functions/romea/rr_cross_spectrum.F
@@ -0,0 +1,1908 @@
+******************************************************************
+*
+*           rr_cross_spectrum.F
+*
+*             Rick Romea   Oct.8, 2000
+*
+*
+* Cross-spectral program
+*
+* INPUT:
+* arg_1  X1 (I, J, L=1:N) Real time series 1 		
+* arg_2  X2 (I, J, L=1:N) Real time series 2	
+* arg_3  Nf   Number of frequencies per band 	 
+* arg_4  P    Percentage level for significance (90, 95 or 99)
+*
+*        handed along:  Number of data points N
+*       		Sampling interval of data points
+*
+* OUTPUT:  ANSWER (I,J,K=1:11,L=1:Nb)
+*
+* ANSWER (I,J,K=1,L=Nb)	 Power in  band1	         
+* ANSWER (I,J,K=2,L=Nb)	 Power in band2	                 
+* ANSWER (I,J,K=3,L=Nb)	 Series 1: Upper confidence level	
+* ANSWER (I,J,K=4,L=Nb)  Series 1: Lower confidence level	
+* ANSWER (I,J,K=5,L=Nb)	 Series 2: Upper confidence level	
+* ANSWER (I,J,K=6,L=Nb)	 Series 2: Lower confidence level	
+* ANSWER (I,J,K=7,L=Nb)  Coherence-squared in each band	
+* ANSWER (I,J,K=8,L=Nb)  Phase in each band 	
+* ANSWER (I,J,K=9,L=Nb) Significant coherence squared
+* ANSWER (I,J,K=10,L=Nb) Upper confidence level for phase
+* ANSWER (I,J,K=11,L=Nb) Lower confidence level for phase
+*
+*       handed along: 	Number of bands	 Nb
+*                       frequency axis
+*
+******************************************************************
+
+      SUBROUTINE RR_cross_spectrum_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      PRINT*,'START INIT'
+
+      CALL ef_set_desc(id,'Computes auto and cross-spectrum')
+      CALL ef_set_num_args(id,4)
+ 
+      ! x and y unchanged
+      ! on output:  z-axis is ABSTRACT:  has k=1:12
+      ! on output:  t-axis is CUSTOM: converted to frequency axis
+
+      CALL ef_set_axis_inheritance(id,
+     .   IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,ABSTRACT,CUSTOM)   
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      !  Set a work array
+
+      CALL ef_set_num_work_arrays  (id, 8)
+
+      ! Describe the input arguments
+
+      ! arg_1  X1 (I, J, L=1:N) Real time series 1 		
+
+      CALL ef_set_arg_name         (id, ARG1, 'S1')
+      CALL ef_set_arg_desc         (id, ARG1, 'Series 1')
+      CALL ef_set_arg_unit         (id, ARG1, ' ')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,NO,NO)
+
+      ! arg_2  X2 (I, J, L=1:N) Real time series 2	
+
+      CALL ef_set_arg_name         (id, ARG2, 'S2')
+      CALL ef_set_arg_desc         (id, ARG2, 'Series 2')
+      CALL ef_set_arg_unit         (id, ARG2, ' ')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,NO,NO)
+
+      ! arg_3  Nf Number of frequencies per band 	 
+      !  scalar
+      
+      CALL ef_set_arg_name         (id, ARG3, 'Nf')
+      CALL ef_set_arg_desc         (id, ARG3, 
+     .                  'Number of frequencies per band')
+      CALL ef_set_arg_unit         (id, ARG3, ' ')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO,NO,NO,NO)
+
+      ! arg_4  P  Percentage level for significance (90, 95 or 99)
+      !  scalar
+
+      CALL ef_set_arg_name         (id, ARG4, 'P')
+      CALL ef_set_arg_desc         (id, ARG4,
+     .       'Percentage level for significance (90, 95 or 99)')
+      CALL ef_set_arg_unit         (id, ARG4, ' ') 
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO,NO,NO,NO)
+
+      PRINT*,'INIT DONE'
+ 
+      END
+
+C************************************************************************
+
+      SUBROUTINE  RR_cross_spectrum_custom_axes(id)
+      IMPLICIT NONE
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS)
+      INTEGER arg_hi_ss(4,EF_MAX_ARGS)
+      INTEGER  arg_incr(4,EF_MAX_ARGS)
+
+      CHARACTER*16 ax_name(4)
+      CHARACTER*16 ax_units(4)
+
+      LOGICAL backward(4)
+      LOGICAL modulo(4)
+      LOGICAL regular(4)
+
+      REAL          rNf, dt, T, df, f1, f2
+      REAL          flo, fhi, fdel
+      INTEGER       Nf, Nb, Npts
+      CHARACTER*32  outunits
+
+      WRITE(6,*)'START CUSTOM AXES, EF_MAX_ARGS', EF_MAX_ARGS
+      CALL FLUSH(6) 
+ 
+      PRINT*,'ef_get_arg_subscripts'
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      PRINT*,'arg_hi_ss',arg_hi_ss(T_AXIS,ARG1)  
+      PRINT*,'arg_lo_ss',arg_lo_ss(T_AXIS,ARG1) 
+
+      PRINT*,'ef_get_one_val'     
+      CALL ef_get_one_val(id, ARG3, rNf) 
+
+      PRINT*,'ef_get_axis_info'      
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, backward,
+     .     modulo, regular) ! Get the units for the time axis.
+
+      PRINT*,'ef_get_box_size'      
+      CALL ef_get_box_size(id, ARG1, T_AXIS, arg_lo_ss(T_AXIS,ARG1), 
+     .               arg_lo_ss(T_AXIS,ARG1), dt)  ! sampling interval = dt
+      PRINT*,'END EF CALLS'
+      CALL FLUSH(6)
+
+      ! Get the (integer) number of frequencies per band = Nf.
+
+      Nf=NINT(rNf)
+
+      ! Compute the number of points in the time series = Npts.
+
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+      ! Compute the number of bands
+
+      Nb = Npts/(2*Nf)
+
+      ! Compute the total time
+
+      T = FLOAT(Npts-1)*dt  
+
+      ! Frequency interval for each band
+
+      df = FLOAT(Nf)/T
+
+      ! First frequency (center of first band)
+
+      f1 = df/2.
+
+      ! Last frequency
+
+      f2 = f1 + FLOAT(Nb-1)*df
+
+      PRINT*,'NPTS = ',Npts
+      PRINT*,'Nf   = ',Nf
+      PRINT*,'dt   = ',dt
+      PRINT*,'Nb   = ',Nb
+      PRINT*,'T    = ',T
+      PRINT*,'df   = ',df
+      PRINT*,'f1   = ',f1
+      PRINT*,'f2   = ',f2
+      CALL FLUSH(6)
+
+      ! ef_set_custom_axis(id, axis, lo, hi, delta, unit, modulo) 
+
+      ! Set the label for the frequency axis =  1/units.
+
+      outunits = '1/' // ax_units(T_AXIS)
+
+      PRINT*,'outunits = ',outunits
+      CALL FLUSH(6)
+
+      CALL ef_set_custom_axis (id,T_AXIS,f1,f2,df,outunits,NO)
+
+      ! Set the label for the abstract axis 
+
+      outunits = 'ABSTRACT'
+
+      PRINT*,'outunits = ',outunits
+      CALL FLUSH(6)
+
+      flo = 1
+      fhi = 11
+      fdel = 1
+      CALL ef_set_custom_axis (id,Z_AXIS,flo,fhi,fdel,outunits,NO)
+
+      PRINT*,'END CUSTOM AXES'
+      CALL FLUSH(6)
+
+      END
+
+C************************************************************************
+
+      SUBROUTINE  RR_cross_spectrum_work_size(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER Npts
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),arg_hi_ss(4,EF_MAX_ARGS),
+     .                                 arg_incr(4,EF_MAX_ARGS)
+
+
+      PRINT*,'START WORK_SIZE'
+       
+      !  Get the number of points in the time series = Npts
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+      PRINT*,'NPTS = ',Npts
+
+      ! ef_set_work_array_dims(id,iarray,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi) 
+      CALL ef_set_work_array_dims(id,1,1,1,1,1,1,1,1,4*Npts+1) 
+      CALL ef_set_work_array_dims(id,2,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,3,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,4,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,5,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,6,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,7,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,8,1,1,1,1,1,1,1,2*Npts) 
+      
+      PRINT*,'END WORK_SIZE'
+      END
+
+
+
+C****************************************************************
+
+      SUBROUTINE RR_cross_spectrum_result_limits(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), 
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER Nb,Npts,Nf
+      REAL    rNf
+
+
+      PRINT*,'START RESULT_LIMITS'
+
+      ! TIME AXIS
+
+         !  Get the (integer) number of frequencies per band = Nf.
+
+         CALL ef_get_one_val(id, ARG3, rNf)  
+         Nf=NINT(rNf)
+
+      PRINT*,'Nf = ',Nf
+
+         !  Get the number of points in the time series = Npts.
+
+         CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+
+         Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+     
+      PRINT*,'NPTS = ',Npts
+
+
+         ! Number of bands
+
+         Nb = Npts/(2*Nf)
+
+      PRINT*,'Nb = ',Nb
+
+         CALL ef_set_axis_limits(id, T_AXIS, 1, Nb)
+
+      ! ABSTRACT Z AXIS
+
+         CALL ef_set_axis_limits(id, Z_AXIS, 1, 11)
+
+      PRINT*,'END RESULT_LIMITS'
+
+      END
+
+C************************************************************
+
+      SUBROUTINE RR_cross_spectrum_compute(id,S1,S2,ARG_3,ARG_4,ANSWER,
+     .                                WSAVE,a1,a2,b1,b2,X1,X2,C)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      REAL S1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .          mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL S2  (mem2lox:mem2hix, mem2loy:mem1hiy, 
+     .          mem2loz:mem2hiz, mem2lot:mem1hit)
+      REAL ARG_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .          mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL ARG_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .          mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL ANSWER (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  l
+      INTEGER i1, j1, l1
+      INTEGER i2, j2, l2
+
+      REAL    WSAVE(wrk1lot:wrk1hit)
+      REAL       a1(wrk2lot:wrk2hit)
+      REAL       b1(wrk3lot:wrk3hit)
+      REAL       a2(wrk4lot:wrk4hit)
+      REAL       b2(wrk5lot:wrk5hit)
+      REAL       X1(wrk6lot:wrk6hit)
+      REAL       X2(wrk7lot:wrk7hit)
+      COMPLEX     C(wrk8lot:wrk8hit)
+
+      INTEGER Npts,Nf,Nb,kk
+      REAL rNf,alpha,P,Coh2sig,lower,upper,PP,QQ,theta,GetStudentT  
+      EXTERNAL GetStudentT
+
+      PRINT*,'START COMPUTE'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+         
+      !  Get the number of points in the time series = Npts.
+
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+
+      PRINT*,'NPTS = ',Npts
+
+      !  Get the (integer) number of frequencies per band = Nf.
+
+      CALL ef_get_one_val(id, ARG3, rNf) 
+
+      Nf=NINT(rNf)
+         
+      PRINT*,'Nf = ',Nf
+
+      ! Number of bands
+
+      Nb = Npts/(2*Nf)
+
+
+      PRINT*,'Nb = ',Nb
+
+      ! Set up the cosine matrix
+
+      PRINT*,'START CFFTI'
+
+      CALL CFFTI(Npts,WSAVE)
+
+      PRINT*,'END CFFTI'
+
+      !  Significance level for coherence at P% with 2*Nf degrees of freedom
+      !  Ref: R.O.R.Y.Thompson, Coherence Significance Levels, AMS, 1979
+      
+      CALL ef_get_one_val(id, ARG4, P) 
+
+      alpha = 1.-P/100.
+      Coh2sig= 1.-alpha**(1./FLOAT(Nf-1))
+
+
+      !  Confidence intervals for the power spectral estimates
+      !
+      !   IF Gxx is the 'true' autospectral value, based on the 
+      !    band-averaged estimate <Gxx>, 
+      !    then, for Nf number of frequencies in band, 
+      !    we can say with P certainty that
+      !
+      !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+      !
+      !       (Bendat & Piersol, p.286)  
+
+      PRINT*,'START Confindence Intervals'
+      
+      CALL SpectralConfidenceIntervals(Nf,NINT(P),lower,upper)
+
+      PRINT*,'lower = ',lower
+      PRINT*,'upper = ',upper
+
+      ! START
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+        j1 = arg_lo_ss(Y_AXIS,ARG1)
+        j2 = arg_lo_ss(Y_AXIS,ARG2)
+        DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           ! Copy the arrays
+           
+           l=1 
+           DO l1=arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+              X1(l)=S1(i1,j1,1,l1)
+              l=l+1
+           ENDDO
+            
+           l=1 
+           DO l2=arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+              X2(l)=S1(i2,j2,1,l2)
+              l=l+1
+           ENDDO
+
+           ! Compute the raw spectral estimates
+
+           PRINT*,'FFT - 1'
+
+           CALL FFTreal(Npts,X1,a1,b1,WSAVE,C)
+
+           PRINT*,'FFT - 2'
+
+           CALL FFTreal(Npts,X2,a2,b2,WSAVE,C)
+
+           ! Compute the auto-spectra, coherence-squared and the phase
+          
+           ! Band average
+
+
+           PRINT*, 'START BAND AVERAGE'
+
+           DO L=1,Nb
+	      ANSWER(I,J,1,L)=0.  
+	      ANSWER(I,J,2,L)=0.  
+	      PP=0.  
+	      QQ=0. 	
+ 
+               DO kk=2+(L-1)*Nf,L*Nf+1
+                   ANSWER(I,J,1,L) = ANSWER(I,J,1,L)
+     .                        + a1(kk)*a1(kk) + b1(kk)*b1(kk)
+	   	   ANSWER(I,J,2,L) = ANSWER(I,J,2,L)
+     .                        + a2(kk)*a2(kk) + b2(kk)*b2(kk)
+                   PP = PP + a1(kk)*a2(kk) + b1(kk)*b2(kk)
+                   QQ = QQ + a2(kk)*b1(kk) - a1(kk)*b2(kk)
+
+	       ENDDO
+
+               !  Power spectrum for Series 1
+   	      
+               ANSWER(I,J,1,L) = 4.*ANSWER(I,J,1,L)/FLOAT(Nf)
+
+               !  Power spectrum for Series 2	
+
+               ANSWER(I,J,2,L) = 4.*ANSWER(I,J,2,L)/FLOAT(Nf)
+   	      
+
+               PP = 4.*PP/FLOAT(Nf)
+   	       QQ = 4.*QQ/FLOAT(Nf)
+
+               !  Coherence-squared in each band
+
+	       ANSWER(I,J,7,L) = (PP*PP+QQ*QQ)
+     .                     / (ANSWER(I,J,1,L)*ANSWER(I,J,2,L))
+
+                !  Phase in each band 
+
+	        IF(QQ.EQ.0..AND.PP.EQ.0.)THEN
+	           ANSWER(I,J,8,L)=0.
+	        ELSE
+	           ANSWER(I,J,8,L)=ATAN2(-QQ,PP)
+	        ENDIF
+
+                ! Compute significant coherence in each band 
+	        ! (currently constant for constant Nf)
+
+                ANSWER(I,J,9,L)=Coh2sig 
+
+                ! Compute Confidence limits for the phase
+                ! theta = +- phase error (rad) at P significance 
+	        !         with 2*Nf degrees of freedom
+	        ! (P.285 Koopmans .The Spectral Analysis of Time Series)
+                
+                IF(ANSWER(I,J,7,L).EQ.0.)THEN
+                  theta=3.14159              
+                ELSE
+                  theta = ASIN(  SQRT(  (1.-ANSWER(I,J,7,L)) / 
+     .                                    ANSWER(I,J,7,L) / 
+     .                                     FLOAT(2*Nf-2)   )
+     .                * GetStudentT(NINT(P),Nf)   )  
+                ENDIF
+                ANSWER (I,J,10,L) = ANSWER(I,J,8,L)+theta ! Upper confidence level for phase
+                ANSWER (I,J,11,L) = ANSWER(I,J,8,L)-theta ! Lower confidence level for phase
+
+                ! Confidence levels on the autospectrum 
+
+                ANSWER (I,J,3,L) = upper*ANSWER(I,J,1,L) ! Series 1: Upper confidence level	
+                ANSWER (I,J,4,L) = lower*ANSWER(I,J,1,L) ! Series 1: Lower confidence level	
+                ANSWER (I,J,5,L) = upper*ANSWER(I,J,2,L) ! Series 2: Upper confidence level	
+                ANSWER (I,J,6,L) = lower*ANSWER(I,J,2,L) ! Series 2: Lower confidence level	
+
+                PRINT*, 'END BAND AVERAGE'
+
+	   ENDDO
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2) 
+         ENDDO
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+      ENDDO
+      END
+
+
+	!******************************************
+	!
+	!  Confidence intervals for the power spectral estimates
+	!
+	!******************************************
+	! 
+        ! Nf = number of frequencys in band	(input)
+	! P  = percent level for significance (eg 90,95 0r 99 ) INPUT
+	! lower = lower bound (output)
+	! upper = upper bound (output)
+	!
+        !   IF Gxx is the 'true' autospectral value, based on the 
+	!    band-averaged estimate <Gxx>, 
+	!    then, for Nf number of frequencys in band,
+	!    we can say with 90% certainty that
+	!
+        !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+	!
+	!  lower = df/chi squared (df,alpha/2)
+	!  upper = df/chi squared (df,1-alpha/2)
+	!
+        ! df = degrees of freedom = 2*number of frequencys in band
+	!
+	! chi squared (n,alpha/2) -->  P=100*(1-alpha)
+	!
+	!  P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+	!
+	! Bendat & Piersol, p.286
+	! Bendat & Piersol, p.524 (table)
+
+      SUBROUTINE SpectralConfidenceIntervals(Nf,P,lower,upper)
+      IMPLICIT NONE
+      INTEGER Nf,P,df
+      REAL lower,upper
+	
+	!   P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+      
+      REAL chi_05(15) 
+      REAL chi_025(15)	  
+      REAL chi_005(15)
+      REAL chi_95(15)	  
+      REAL chi_975(15)  
+      REAL chi_995(15)  
+	
+      DATA chi_005 /10.6,14.86,18.55,21.96,25.19,28.3,31.3,34.27,37.16,
+     .               40.,42.8,45.56,48.29,50.99,53.67/		  
+      DATA chi_025 /7.38,11.14,14.45,17.53,20.48,23.34,26.12,28.85,
+     .               31.53,34.17,36.78,39.36,41.92,44.46,46.98/	  
+      DATA chi_05 /5.99,9.49,12.59,15.51,18.31,21.03,23.68,26.30,28.87,
+     .             31.41,33.92,36.42,38.88,41.34,43.77/
+      DATA chi_95 /.103,.711,1.64,2.73,3.94,5.23,6.57,7.96,8.39,10.85,
+     .             12.34,13.85,15.38,16.93,18.49/
+      DATA chi_975 /.0506,.484,1.24,2.18,3.25,4.4,5.63,6.91,8.23,9.59,
+     .              10.98,12.4,13.84,15.31,16.79/
+      DATA chi_995 /.01,.207,.676,1.34,2.16,3.07,4.07,5.14,6.26,7.43,
+     .              8.64,9.89,11.16,12.46,13.79/
+
+       df=Nf*2
+
+	IF(df.GT.100)THEN
+	  IF(P.EQ.90)THEN 
+	    lower=FLOAT(df)/146.57
+          upper=FLOAT(df)/95.7
+        ELSEIF(P.EQ.95)THEN
+		lower=FLOAT(df)/152.21
+          upper=FLOAT(df)/91.58
+	  ELSE  !  P.EQ.99
+	  	lower=FLOAT(df)/163.65
+          upper=FLOAT(df)/83.85
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+        	lower=FLOAT(df)/79.08
+          upper=FLOAT(df)/43.19
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/83.8
+          upper=FLOAT(df)/40.48
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/91.95
+          upper=FLOAT(df)/35.53
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/55.76
+          upper=FLOAT(df)/26.51
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/59.34
+          upper=FLOAT(df)/24.43
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/66.77
+          upper=FLOAT(df)/20.71
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/chi_05(Nf)
+          upper=FLOAT(df)/chi_95(Nf)
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/chi_025(Nf)
+          upper=FLOAT(df)/chi_975(Nf)
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/chi_005(Nf)
+          upper=FLOAT(df)/chi_995(Nf)
+	  ENDIF
+	ENDIF
+	END
+
+	!******************************************
+	! 
+	! Get the upper cutoff point of the Student T distribution 
+	! (P.341 Koopmans .The Spectral Analysis of Time Series)
+	!
+	!******************************************
+	   
+	REAL FUNCTION GetStudentT(P,Nf)
+        IMPLICIT NONE
+	INTEGER Nf,P,df  
+	REAL ST_90(15)
+	REAL ST_95(15)
+	REAL ST_99(15)
+	REAL T
+	DATA ST_90/2.92,2.132,1.943,1.86,1.812,1.782,1.761,1.746,
+     .           1.734,1.725,1.717,1.711,1.706,1.701,1.697/
+	DATA ST_95/4.303,2.776,2.447,2.306,2.228,2.179,2.145,2.12,
+     .           2.101,2.086,2.074,2.064,2.056,2.048,2.042/
+  	DATA ST_99/9.925,4.604,3.707,3.355,3.169,3.055,2.977,2.921,
+     .           2.878,2.845,2.819,2.797,2.779,2.763,2.75/
+
+	IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+           P=90 
+	   WRITE(6,*)'WARNING::P must be 90,95 or 99' 
+           WRITE(6,*)'         in SUBROUTINE PhaseConfidenceLimits'
+           WRITE(6,*)'  '
+           WRITE(6,*)'P set to 90%'
+	ENDIF
+ 
+        df=Nf*2
+
+	IF(df.GT.120)THEN
+     	  IF(P.EQ.90)THEN
+		T=1.645
+          ELSEIF(P.EQ.95)THEN
+		T=1.96
+	  ELSE  !  P.EQ.99
+		T=2.576
+	  ENDIF
+	ELSEIF(df.GT.80)THEN
+	  IF(P.EQ.90)THEN
+		T=1.658
+          ELSEIF(P.EQ.95)THEN
+		T=1.98
+	  ELSE  !  P.EQ.99
+		T=2.617
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+		T=1.671
+          ELSEIF(P.EQ.95)THEN
+		T=2.
+	  ELSE  !  P.EQ.99
+		T=2.66
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+		T=1.684
+          ELSEIF(P.EQ.95)THEN
+		T=2.021
+	  ELSE  !  P.EQ.99
+		T=2.704
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	    T=ST_90(Nf)
+        ELSEIF(P.EQ.95)THEN
+	    T=ST_95(Nf)
+	  ELSE  !  P.EQ.99
+	    T=ST_99(Nf)
+	  ENDIF
+	ENDIF
+	GetStudentT=T
+	END
+
+
+        !******************************************
+	!
+	! FFT OF A REAL PERIODIC SEQUENCE
+	! 
+	!******************************************
+     	!
+        !   N         = number of data points (input)
+	!   X(N)      = real input time series	(input)
+	!   a(N),b(N) = normalized Fourier coefficients (output)
+	!
+	!  Spectral estimates are:  S(k) = a(k) + i b(k)
+	!
+	!                                     i = sqrt(-1)
+	!
+	!
+	!            S(k)=THE SUM FROM n=1,...,N OF
+	!  
+        !                X(n)/N*EXP(-2*PI*i*k*n/N)
+	!		   so:
+	!                a(k) = (1/N) * THE SUM FROM n=1,...,N OF
+	!		              X(n) * cos(2*PI*k*n/N) 
+	!	
+	!		 b(k) = (1/N) * THE SUM FROM n=1,...,N OF  
+	!                           - X(n) * sin(2*PI*k*n/N)	
+	!
+	! T = N dt  is the fundamental period
+	! 
+        ! Frequencies are: f(k) = (k-1)/T  ;  k=1,..,N
+	! 
+	! Frequency interval between spectral estimates: 
+	!
+	!            df = 1/T  = 1/(N dt)
+	!
+	! Nyquist frequency is at: 
+	!
+	!            Nyquist = 1/(2dt) = N/(2T); k = N/2 + 1
+	!
+	!           So:  S[1] = mean of the time series
+	!                S[2] = S[N]
+	!                S[3] = S[N-1]
+	!                S[k] = S[N-k+1]
+	!
+	!           Note: S[(N/2+1] is set = 0
+	!               
+	SUBROUTINE FFTreal(Nin,X,a,b,WSAVE,C)
+	IMPLICIT NONE
+	INTEGER Nin,N,i
+	REAL X(*),a(*),b(*),WSAVE(*)
+	COMPLEX C(*)
+
+        ! Check if N is even
+
+	IF(MOD(Nin,2).EQ.0)THEN
+	  N=Nin
+	ELSE
+	  N=Nin-1
+	ENDIF
+	
+	! load complex array
+
+	DO i=1,N
+	  C(i)=CMPLX(X(i),0.)
+	ENDDO
+
+	! Compute the transform
+
+	CALL CFFTF(N,C,WSAVE)
+
+	! load and normalize the a and b arrays
+
+	DO i=1,N
+	  a(i)=REAL(C(i))/FLOAT(N)
+	  b(i)=AIMAG(C(i))/FLOAT(N)
+	ENDDO
+	  
+	! Set values at the nyquist to zero 
+
+	a(N/2+1)=0.
+	b(N/2+1)=0.
+
+	END
+
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+
+
+	!******************************************
+	!
+	!  Canned FFT Routines
+	!
+	!******************************************
+
+      subroutine cfftf (n,c,wsave)
+
+C  FORWARD COMPLEX DISCRETE FFT OF A COMPLEX PERIODIC SEQUENCE
+C
+C     EQUIVALENTLY, CFFTF COMPUTES THE FOURIER COEFFICIENTS 
+C     OF A COMPLEX PERIODIC SEQUENCE.
+C
+C     THE TRANSFORM IS NOT NORMALIZED. TO OBTAIN A NORMALIZED TRANSFORM
+C     THE OUTPUT MUST BE DIVIDED BY N. OTHERWISE A CALL OF CFFTF
+C     FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTF MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES. N
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTF. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(-I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+C
+      real       c(*)       ,wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, iw1, iw2
+
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftf1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cfftf1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  PASSF,PASSF5,PASSF3,PASSF2,PASSF4
+
+      real       ch(*)      ,c(*)       ,wa(*)      ,ifac(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      INTEGER i, n, nf, na, l1, iw, k1, ip, l2, ido, idot, idl1, 
+     .        ix2, ix3, ix4, nac, n2
+
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passf4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passf4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passf2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passf2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passf3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passf3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passf5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passf5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passf (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passf (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine cffti (n,wsave)
+
+C   INITIALIZE FOR CFFTF AND CFFTB
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI(N,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI INITIALIZES THE ARRAY WSAVE WHICH IS USED IN
+C     BOTH CFFTF AND CFFTB. THE PRIME FACTORIZATION OF N TOGETHER WITH
+C     A TABULATION OF THE TRIGONOMETRIC FUNCTIONS ARE COMPUTED AND
+C     STORED IN WSAVE.
+C
+C     INPUT PARAMETER
+C
+C     N       THE LENGTH OF THE SEQUENCE TO BE TRANSFORMED
+C
+C     OUTPUT PARAMETER
+C
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4*N+15
+C             THE SAME WORK ARRAY CAN BE USED FOR BOTH CFFTF AND CFFTB
+C             AS LONG AS N REMAINS UNCHANGED. DIFFERENT WSAVE ARRAYS
+C             ARE REQUIRED FOR DIFFERENT VALUES OF N. THE CONTENTS OF
+C             WSAVE MUST NOT BE CHANGED BETWEEN CALLS OF CFFTF OR CFFTB
+C
+
+      real       wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer  n, iw1, iw2
+
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cffti1 (n,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cffti1 (n,wa,ifac)
+C***REFER TO CFFTI
+C***ROUTINES CALLED  (NONE)
+
+      real       wa(*)      ,ifac(*)    ,ntryh(4)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, nl, nf, j, ntry, nq, nr, i, ib, l1, k1, ip, ld, l2, 
+     .        ido, idot, ipm,i1,ii
+      real    argh, wldc, wlds, arg, dl1c, dl1s, dc, ds, tpi, wldch
+
+      data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/3,4,2,5/
+      nl = n
+      nf = 0
+      j = 0
+  101 j = j+1
+      if (j-4) 102,102,103
+  102 ntry = ntryh(j)
+      go to 104
+  103 ntry = ntry+2
+  104 nq = nl/ntry
+      nr = nl-ntry*nq
+      if (nr) 101,105,101
+  105 nf = nf+1
+      ifac(nf+2) = ntry
+      nl = nq
+      if (ntry .ne. 2) go to 107
+      if (nf .eq. 1) go to 107
+      do 106 i=2,nf
+         ib = nf-i+2
+         ifac(ib+2) = ifac(ib+1)
+  106 continue
+      ifac(3) = 2
+  107 if (nl .ne. 1) go to 104
+      ifac(1) = n
+      ifac(2) = nf
+      tpi = 6.28318530717959
+      argh = tpi/float(n)
+      i = 2
+      l1 = 1
+      do 110 k1=1,nf
+         ip = ifac(k1+2)
+         ld = 0
+         l2 = l1*ip
+         ido = n/l2
+         idot = ido+ido+2
+         ipm = ip-1
+         wldc = 1.
+         wlds = 0.
+         arg = float(l1)*argh
+         dl1c = cos(arg)
+         dl1s = sin(arg)
+         do 109 j=1,ipm
+            i1 = i
+            wa(i-1) = 1.
+            wa(i) = 0.
+            ld = ld+l1
+            wldch = wldc
+            wldc = dl1c*wldc-dl1s*wlds
+            wlds = dl1s*wldch+dl1c*wlds
+            dc = wldc
+            ds = wlds
+            do 108 ii=4,idot,2
+               i = i+2
+               wa(i-1) = dc*wa(i-3)-ds*wa(i-2)
+               wa(i) = ds*wa(i-3)+dc*wa(i-2)
+  108       continue
+            if (ip .le. 5) go to 109
+            wa(i1-1) = wa(i-1)
+            wa(i1) = wa(i)
+  109    continue
+         l1 = l2
+  110 continue
+      end
+
+
+      subroutine cfftb (n,c,wsave)
+
+C INVERSE FFT OF A COMPLEX PERIODIC SEQUENCE
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB(N,C,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB COMPUTES THE BACKWARD COMPLEX DISCRETE FOURIER
+C     TRANSFORM (THE FOURIER SYNTHESIS). EQUIVALENTLY , CFFTB COMPUTES
+C     A COMPLEX PERIODIC SEQUENCE FROM ITS FOURIER COEFFICIENTS.
+C     THE TRANSFORM IS DEFINED BELOW AT OUTPUT PARAMETER C.
+C
+C     A CALL OF CFFTF FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE
+C     SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTB MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES.
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTB. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+
+C***ROUTINES CALLED  CFFTB1
+
+      real c(*), wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, iw1, iw2
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftb1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      return
+      end
+
+      subroutine cfftb1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  PASSB,PASSB5,PASSB3,PASSB2,PASSB4
+
+      real       ch(*)      ,c(*)       ,wa(*)      ,ifac(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, nf, na, l1, iw, k1, ip, l2, ido, idot, idl1,
+     .        ix2, ix3, ix4, nac, n2, i
+
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passb4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passb4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passb2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passb2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passb3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passb3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passb5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passb5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passb (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passb (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine passb (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(*)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer nac, ido, ip, l1, idl1, idot, nt, ipp2, ipph, idp, j, 
+     .        jc, k, i, idl, inc, l, lc, ik, idlj, idij, idj
+      real    war, wai
+
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)+wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passb2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr2, ti2
+
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2+wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2-wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passb3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(*)     ,wa2(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real taur, taui, tr2, cr2, ti2, ci2, cr3, ci3, dr2, dr3, di2, di3
+
+      data taur,taui /-.5,.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passb4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED (NONE)
+
+      real       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4, 
+     .        cr2, cr3, cr4, ci2, ci3, ci4
+
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,4,k)-cc(2,2,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,2,k)-cc(1,4,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,4,k)-cc(i,2,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,2,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2-wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2+wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3-wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3+wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4-wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4+wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)     ,wa4(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real tr2, tr4, tr5, tr11, tr12, ti2, ti3, ti4, ti5, ti11, ti12, 
+     .     cr2, cr3, cr4, cr5, ci2, ci3, ci4, ci5, dr4, dr5, 
+     .     di2, di3, di4, di5, tr3, dr3, dr2
+
+      data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154,
+     1-.809016994374947,.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4-wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4+wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5-wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5+wa4(i)*dr5
+  103    continue
+  104 continue
+      end
+
+      subroutine passf (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(*)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer nac, ido, ip, l1, idl1, idot, nt, ipp2, ipph, idp, j, jc,
+     .        k, i, idl, inc, l, lc, ik, idlj, idij, idj
+      real    war, wai
+
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = -wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)-wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passf2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr2, ti2
+
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2-wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2+wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passf3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(*)     ,wa2(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real taur, taui, tr2, cr2, ti2, ci2, cr3, ci3, dr2, dr3, di2, di3
+
+      data taur,taui /-.5,-.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passf4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    ti1, ti2, tr4, ti3, tr1, tr2, ti4, tr3, cr3, ci3, 
+     .        cr2, cr4, ci2, ci4
+
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,2,k)-cc(2,4,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,4,k)-cc(1,2,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,2,k)-cc(i,4,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,4,k)-cc(i-1,2,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2+wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2-wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3+wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3-wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4+wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4-wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)     ,wa4(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr11, ti11, tr12, ti12, ti5, ti2, ti4, ti3, tr5, tr2, 
+     .        tr4, tr3, cr2, ci2, cr3, ci3, cr5, ci5, cr4, ci4, dr3, 
+     .        dr4, di3, di4, dr5, dr2, di5, di2
+
+      data tr11,ti11,tr12,ti12 /.309016994374947,-.951056516295154,
+     1-.809016994374947,-.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4+wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4-wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5+wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5-wa4(i)*dr5
+  103    continue
+  104 continue
+      end 
diff --git a/external_functions/romea/rr_cross_spectrum_abs.F b/external_functions/romea/rr_cross_spectrum_abs.F
new file mode 100644
index 0000000..0369cd5
--- /dev/null
+++ b/external_functions/romea/rr_cross_spectrum_abs.F
@@ -0,0 +1,1795 @@
+******************************************************************
+*
+*           RR_cross_spectrum_abs.F
+*
+*             Rick Romea   Oct.8, 2000
+*
+*
+* Cross-spectral program
+*
+* INPUT:
+* arg_1  X1 (I, J, L=1:N) Real time series 1 		
+* arg_2  X2 (I, J, L=1:N) Real time series 2	
+* arg_3  Nf   Number of frequencies per band 	 
+* arg_4  P    Percentage level for significance (90, 95 or 99)
+*
+*        handed along:  Number of data points N
+*       		Sampling interval of data points
+*
+* OUTPUT:  ANSWER (I,J,K=1:11,L=1:Nb)
+*
+* ANSWER (I,J,K=1,L=Nb)	 Power in  band1	         
+* ANSWER (I,J,K=2,L=Nb)	 Power in band2	                 
+* ANSWER (I,J,K=3,L=Nb)	 Series 1: Upper confidence level	
+* ANSWER (I,J,K=4,L=Nb)  Series 1: Lower confidence level	
+* ANSWER (I,J,K=5,L=Nb)	 Series 2: Upper confidence level	
+* ANSWER (I,J,K=6,L=Nb)	 Series 2: Lower confidence level	
+* ANSWER (I,J,K=7,L=Nb)  Coherence-squared in each band	
+* ANSWER (I,J,K=8,L=Nb)  Phase in each band 	
+* ANSWER (I,J,K=9,L=Nb) Significant coherence squared
+* ANSWER (I,J,K=10,L=Nb) Upper confidence level for phase
+* ANSWER (I,J,K=11,L=Nb) Lower confidence level for phase
+*
+*       handed along: 	Number of bands	 Nb
+*                       frequency axis
+*
+******************************************************************
+
+      SUBROUTINE RR_cross_spectrum_abs_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      PRINT*,'START INIT'
+
+      CALL ef_set_desc(id,'Computes auto and cross-spectrum')
+      CALL ef_set_num_args(id,4)
+ 
+      ! x and y unchanged
+      ! on output:  z-axis is ABSTRACT:  has k=1:12
+      ! on output:  t-axis is CUSTOM: converted to frequency axis
+
+      CALL ef_set_axis_inheritance(id,
+     .   IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,ABSTRACT, ABSTRACT)   
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      !  Set a work array
+
+      CALL ef_set_num_work_arrays  (id, 8)
+
+      ! Describe the input arguments
+
+      ! arg_1  X1 (I, J, L=1:N) Real time series 1 		
+
+      CALL ef_set_arg_name         (id, ARG1, 'S1')
+      CALL ef_set_arg_desc         (id, ARG1, 'Series 1')
+      CALL ef_set_arg_unit         (id, ARG1, ' ')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,NO,NO)
+
+      ! arg_2  X2 (I, J, L=1:N) Real time series 2	
+
+      CALL ef_set_arg_name         (id, ARG2, 'S2')
+      CALL ef_set_arg_desc         (id, ARG2, 'Series 2')
+      CALL ef_set_arg_unit         (id, ARG2, ' ')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,NO,NO)
+
+      ! arg_3  Nf Number of frequencies per band 	 
+      !  scalar
+      
+      CALL ef_set_arg_name         (id, ARG3, 'Nf')
+      CALL ef_set_arg_desc         (id, ARG3, 
+     .                  'Number of frequencies per band')
+      CALL ef_set_arg_unit         (id, ARG3, ' ')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO,NO,NO,NO)
+
+      ! arg_4  P  Percentage level for significance (90, 95 or 99)
+      !  scalar
+
+      CALL ef_set_arg_name         (id, ARG4, 'P')
+      CALL ef_set_arg_desc         (id, ARG4,
+     .       'Percentage level for significance (90, 95 or 99)')
+      CALL ef_set_arg_unit         (id, ARG4, ' ') 
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO,NO,NO,NO)
+
+      PRINT*,'INIT DONE'
+ 
+      END
+
+
+C************************************************************************
+
+      SUBROUTINE  RR_cross_spectrum_abs_work_size(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER Npts
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),arg_hi_ss(4,EF_MAX_ARGS),
+     .                                 arg_incr(4,EF_MAX_ARGS)
+
+
+      PRINT*,'START WORK_SIZE'
+       
+      !  Get the number of points in the time series = Npts
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+      PRINT*,'NPTS = ',Npts
+
+      ! ef_set_work_array_dims(id,iarray,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi) 
+      CALL ef_set_work_array_dims(id,1,1,1,1,1,1,1,1,4*Npts+1) 
+      CALL ef_set_work_array_dims(id,2,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,3,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,4,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,5,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,6,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,7,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,8,1,1,1,1,1,1,1,2*Npts) 
+      
+      PRINT*,'END WORK_SIZE'
+      END
+
+
+
+C****************************************************************
+
+      SUBROUTINE RR_cross_spectrum_abs_result_limits(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), 
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER Nb,Npts,Nf
+      REAL    rNf
+
+
+      PRINT*,'START RESULT_LIMITS'
+
+      ! TIME AXIS
+
+         !  Get the (integer) number of frequencies per band = Nf.
+
+         CALL ef_get_one_val(id, ARG3, rNf)  
+         Nf=NINT(rNf)
+
+      PRINT*,'Nf = ',Nf
+
+         !  Get the number of points in the time series = Npts.
+
+         CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+
+         Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+     
+      PRINT*,'NPTS = ',Npts
+
+
+         ! Number of bands
+
+         Nb = Npts/(2*Nf)
+
+      PRINT*,'Nb = ',Nb
+
+         CALL ef_set_axis_limits(id, T_AXIS, 1, Nb)
+
+      ! ABSTRACT Z AXIS
+
+         CALL ef_set_axis_limits(id, Z_AXIS, 1, 11)
+
+      PRINT*,'END RESULT_LIMITS'
+
+      END
+
+C************************************************************
+
+      SUBROUTINE RR_cross_spectrum_abs_compute(id,S1,S2,arg_3,arg_4,
+     .                                ANSWER,WSAVE,a1,a2,b1,b2,X1,X2,C)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      REAL S1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .          mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL S2  (mem2lox:mem2hix, mem2loy:mem1hiy, 
+     .          mem2loz:mem2hiz, mem2lot:mem1hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .          mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .          mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL ANSWER (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  l
+      INTEGER i1, j1, l1
+      INTEGER i2, j2, l2
+
+      REAL    WSAVE(wrk1lot:wrk1hit)
+      REAL       a1(wrk2lot:wrk2hit)
+      REAL       b1(wrk3lot:wrk3hit)
+      REAL       a2(wrk4lot:wrk4hit)
+      REAL       b2(wrk5lot:wrk5hit)
+      REAL       X1(wrk6lot:wrk6hit)
+      REAL       X2(wrk7lot:wrk7hit)
+      COMPLEX     C(wrk8lot:wrk8hit)
+
+      INTEGER Npts,Nf,Nb,kk
+      REAL rNf,alpha,P,Coh2sig,lower,upper,PP,QQ,theta,GetStudentT  
+      EXTERNAL GetStudentT
+
+      PRINT*,'START COMPUTE'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+         
+      !  Get the number of points in the time series = Npts.
+
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+
+      PRINT*,'NPTS = ',Npts
+
+      !  Get the (integer) number of frequencies per band = Nf.
+
+      CALL ef_get_one_val(id, ARG3, rNf)  
+      Nf=NINT(rNf)
+         
+      PRINT*,'Nf = ',Nf
+
+      ! Number of bands
+
+      Nb = Npts/(2*Nf)
+
+
+      PRINT*,'Nb = ',Nb
+
+      ! Set up the cosine matrix
+
+      PRINT*,'START CFFTI'
+
+      CALL CFFTI(Npts,WSAVE)
+
+      PRINT*,'END CFFTI'
+
+      !  Significance level for coherence at P% with 2*Nf degrees of freedom
+      !  Ref: R.O.R.Y.Thompson, Coherence Significance Levels, AMS, 1979
+
+      CALL ef_get_one_val(id, ARG4, P)  
+      alpha = 1.-P/100.
+      Coh2sig= 1.-alpha**(1./FLOAT(Nf-1))
+
+
+      !  Confidence intervals for the power spectral estimates
+      !
+      !   IF Gxx is the 'true' autospectral value, based on the 
+      !    band-averaged estimate <Gxx>, 
+      !    then, for Nf number of frequencies in band, 
+      !    we can say with P certainty that
+      !
+      !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+      !
+      !       (Bendat & Piersol, p.286)  
+
+      PRINT*,'START Confindence Intervals'
+      
+      CALL SpectralConfidenceIntervals(Nf,NINT(P),lower,upper)
+
+      PRINT*,'lower = ',lower
+      PRINT*,'upper = ',upper
+
+      ! START
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+        j1 = arg_lo_ss(Y_AXIS,ARG1)
+        j2 = arg_lo_ss(Y_AXIS,ARG2)
+        DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           ! Copy the arrays
+           
+           l=1 
+           DO l1=arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+              X1(l)=S1(i1,j1,1,l1)
+              l=l+1
+           ENDDO
+            
+           l=1 
+           DO l2=arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+              X2(l)=S1(i2,j2,1,l2)
+              l=l+1
+           ENDDO
+
+           ! Compute the raw spectral estimates
+
+           PRINT*,'FFT - 1'
+
+           CALL FFTreal(Npts,X1,a1,b1,WSAVE,C)
+
+           PRINT*,'FFT - 2'
+
+           CALL FFTreal(Npts,X2,a2,b2,WSAVE,C)
+
+           ! Compute the auto-spectra, coherence-squared and the phase
+          
+           ! Band average
+
+
+           PRINT*, 'START BAND AVERAGE'
+
+           DO L=1,Nb
+	      ANSWER(I,J,1,L)=0.  
+	      ANSWER(I,J,2,L)=0.  
+	      PP=0.  
+	      QQ=0. 	
+ 
+               DO kk=2+(L-1)*Nf,L*Nf+1
+                   ANSWER(I,J,1,L) = ANSWER(I,J,1,L)
+     .                        + a1(kk)*a1(kk) + b1(kk)*b1(kk)
+	   	   ANSWER(I,J,2,L) = ANSWER(I,J,2,L)
+     .                        + a2(kk)*a2(kk) + b2(kk)*b2(kk)
+                   PP = PP + a1(kk)*a2(kk) + b1(kk)*b2(kk)
+                   QQ = QQ + a2(kk)*b1(kk) - a1(kk)*b2(kk)
+
+	       ENDDO
+
+               !  Power spectrum for Series 1
+   	      
+               ANSWER(I,J,1,L) = 4.*ANSWER(I,J,1,L)/FLOAT(Nf)
+
+               !  Power spectrum for Series 2	
+
+               ANSWER(I,J,2,L) = 4.*ANSWER(I,J,2,L)/FLOAT(Nf)
+   	      
+
+               PP = 4.*PP/FLOAT(Nf)
+   	       QQ = 4.*QQ/FLOAT(Nf)
+
+               !  Coherence-squared in each band
+
+	       ANSWER(I,J,7,L) = (PP*PP+QQ*QQ)
+     .                     / (ANSWER(I,J,1,L)*ANSWER(I,J,2,L))
+
+                !  Phase in each band 
+
+	        IF(QQ.EQ.0..AND.PP.EQ.0.)THEN
+	           ANSWER(I,J,8,L)=0.
+	        ELSE
+	           ANSWER(I,J,8,L)=ATAN2(-QQ,PP)
+	        ENDIF
+
+                ! Compute significant coherence in each band 
+	        ! (currently constant for constant Nf)
+
+                ANSWER(I,J,9,L)=Coh2sig 
+
+                ! Compute Confidence limits for the phase
+                ! theta = +- phase error (rad) at P significance 
+	        !         with 2*Nf degrees of freedom
+	        ! (P.285 Koopmans .The Spectral Analysis of Time Series)
+                
+                IF(ANSWER(I,J,7,L).EQ.0.)THEN
+                  theta=3.14159              
+                ELSE
+                  theta = ASIN(  SQRT(  (1.-ANSWER(I,J,7,L)) / 
+     .                                    ANSWER(I,J,7,L) / 
+     .                                     FLOAT(2*Nf-2)   )
+     .                * GetStudentT(NINT(P),Nf)   )  
+                ENDIF
+                ANSWER (I,J,10,L) = ANSWER(I,J,8,L)+theta ! Upper confidence level for phase
+                ANSWER (I,J,11,L) = ANSWER(I,J,8,L)-theta ! Lower confidence level for phase
+
+                ! Confidence levels on the autospectrum 
+
+                ANSWER (I,J,3,L) = upper*ANSWER(I,J,1,L) ! Series 1: Upper confidence level	
+                ANSWER (I,J,4,L) = lower*ANSWER(I,J,1,L) ! Series 1: Lower confidence level	
+                ANSWER (I,J,5,L) = upper*ANSWER(I,J,2,L) ! Series 2: Upper confidence level	
+                ANSWER (I,J,6,L) = lower*ANSWER(I,J,2,L) ! Series 2: Lower confidence level	
+
+                PRINT*, 'END BAND AVERAGE'
+
+	   ENDDO
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2) 
+         ENDDO
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+      ENDDO
+      END
+
+
+	!******************************************
+	!
+	!  Confidence intervals for the power spectral estimates
+	!
+	!******************************************
+	! 
+        ! Nf = number of frequencys in band	(input)
+	! P  = percent level for significance (eg 90,95 0r 99 ) INPUT
+	! lower = lower bound (output)
+	! upper = upper bound (output)
+	!
+        !   IF Gxx is the 'true' autospectral value, based on the 
+	!    band-averaged estimate <Gxx>, 
+	!    then, for Nf number of frequencys in band,
+	!    we can say with 90% certainty that
+	!
+        !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+	!
+	!  lower = df/chi squared (df,alpha/2)
+	!  upper = df/chi squared (df,1-alpha/2)
+	!
+        ! df = degrees of freedom = 2*number of frequencys in band
+	!
+	! chi squared (n,alpha/2) -->  P=100*(1-alpha)
+	!
+	!  P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+	!
+	! Bendat & Piersol, p.286
+	! Bendat & Piersol, p.524 (table)
+
+      SUBROUTINE SpectralConfidenceIntervals(Nf,P,lower,upper)
+      IMPLICIT NONE
+      INTEGER Nf,P,df
+      REAL lower,upper
+	
+	!   P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+      
+      REAL chi_05(15) 
+      REAL chi_025(15)	  
+      REAL chi_005(15)
+      REAL chi_95(15)	  
+      REAL chi_975(15)  
+      REAL chi_995(15)  
+	
+      DATA chi_005 /10.6,14.86,18.55,21.96,25.19,28.3,31.3,34.27,37.16,
+     .               40.,42.8,45.56,48.29,50.99,53.67/		  
+      DATA chi_025 /7.38,11.14,14.45,17.53,20.48,23.34,26.12,28.85,
+     .               31.53,34.17,36.78,39.36,41.92,44.46,46.98/	  
+      DATA chi_05 /5.99,9.49,12.59,15.51,18.31,21.03,23.68,26.30,28.87,
+     .             31.41,33.92,36.42,38.88,41.34,43.77/
+      DATA chi_95 /.103,.711,1.64,2.73,3.94,5.23,6.57,7.96,8.39,10.85,
+     .             12.34,13.85,15.38,16.93,18.49/
+      DATA chi_975 /.0506,.484,1.24,2.18,3.25,4.4,5.63,6.91,8.23,9.59,
+     .              10.98,12.4,13.84,15.31,16.79/
+      DATA chi_995 /.01,.207,.676,1.34,2.16,3.07,4.07,5.14,6.26,7.43,
+     .              8.64,9.89,11.16,12.46,13.79/
+
+       df=Nf*2
+
+	IF(df.GT.100)THEN
+	  IF(P.EQ.90)THEN 
+	    lower=FLOAT(df)/146.57
+          upper=FLOAT(df)/95.7
+        ELSEIF(P.EQ.95)THEN
+		lower=FLOAT(df)/152.21
+          upper=FLOAT(df)/91.58
+	  ELSE  !  P.EQ.99
+	  	lower=FLOAT(df)/163.65
+          upper=FLOAT(df)/83.85
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+        	lower=FLOAT(df)/79.08
+          upper=FLOAT(df)/43.19
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/83.8
+          upper=FLOAT(df)/40.48
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/91.95
+          upper=FLOAT(df)/35.53
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/55.76
+          upper=FLOAT(df)/26.51
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/59.34
+          upper=FLOAT(df)/24.43
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/66.77
+          upper=FLOAT(df)/20.71
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/chi_05(Nf)
+          upper=FLOAT(df)/chi_95(Nf)
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/chi_025(Nf)
+          upper=FLOAT(df)/chi_975(Nf)
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/chi_005(Nf)
+          upper=FLOAT(df)/chi_995(Nf)
+	  ENDIF
+	ENDIF
+	END
+
+	!******************************************
+	! 
+	! Get the upper cutoff point of the Student T distribution 
+	! (P.341 Koopmans .The Spectral Analysis of Time Series)
+	!
+	!******************************************
+	   
+	REAL FUNCTION GetStudentT(P,Nf)
+        IMPLICIT NONE
+	INTEGER Nf,P,df  
+	REAL ST_90(15)
+	REAL ST_95(15)
+	REAL ST_99(15)
+	REAL T
+	DATA ST_90/2.92,2.132,1.943,1.86,1.812,1.782,1.761,1.746,
+     .           1.734,1.725,1.717,1.711,1.706,1.701,1.697/
+	DATA ST_95/4.303,2.776,2.447,2.306,2.228,2.179,2.145,2.12,
+     .           2.101,2.086,2.074,2.064,2.056,2.048,2.042/
+  	DATA ST_99/9.925,4.604,3.707,3.355,3.169,3.055,2.977,2.921,
+     .           2.878,2.845,2.819,2.797,2.779,2.763,2.75/
+
+	IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+           P=90 
+	   WRITE(6,*)'WARNING::P must be 90,95 or 99' 
+           WRITE(6,*)'         in SUBROUTINE PhaseConfidenceLimits'
+           WRITE(6,*)'  '
+           WRITE(6,*)'P set to 90%'
+	ENDIF
+ 
+        df=Nf*2
+
+	IF(df.GT.120)THEN
+     	  IF(P.EQ.90)THEN
+		T=1.645
+          ELSEIF(P.EQ.95)THEN
+		T=1.96
+	  ELSE  !  P.EQ.99
+		T=2.576
+	  ENDIF
+	ELSEIF(df.GT.80)THEN
+	  IF(P.EQ.90)THEN
+		T=1.658
+          ELSEIF(P.EQ.95)THEN
+		T=1.98
+	  ELSE  !  P.EQ.99
+		T=2.617
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+		T=1.671
+          ELSEIF(P.EQ.95)THEN
+		T=2.
+	  ELSE  !  P.EQ.99
+		T=2.66
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+		T=1.684
+          ELSEIF(P.EQ.95)THEN
+		T=2.021
+	  ELSE  !  P.EQ.99
+		T=2.704
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	    T=ST_90(Nf)
+        ELSEIF(P.EQ.95)THEN
+	    T=ST_95(Nf)
+	  ELSE  !  P.EQ.99
+	    T=ST_99(Nf)
+	  ENDIF
+	ENDIF
+	GetStudentT=T
+	END
+
+
+        !******************************************
+	!
+	! FFT OF A REAL PERIODIC SEQUENCE
+	! 
+	!******************************************
+     	!
+        !   N         = number of data points (input)
+	!   X(N)      = real input time series	(input)
+	!   a(N),b(N) = normalized Fourier coefficients (output)
+	!
+	!  Spectral estimates are:  S(k) = a(k) + i b(k)
+	!
+	!                                     i = sqrt(-1)
+	!
+	!
+	!            S(k)=THE SUM FROM n=1,...,N OF
+	!  
+        !                X(n)/N*EXP(-2*PI*i*k*n/N)
+	!		   so:
+	!                a(k) = (1/N) * THE SUM FROM n=1,...,N OF
+	!		              X(n) * cos(2*PI*k*n/N) 
+	!	
+	!		 b(k) = (1/N) * THE SUM FROM n=1,...,N OF  
+	!                           - X(n) * sin(2*PI*k*n/N)	
+	!
+	! T = N dt  is the fundamental period
+	! 
+        ! Frequencies are: f(k) = (k-1)/T  ;  k=1,..,N
+	! 
+	! Frequency interval between spectral estimates: 
+	!
+	!            df = 1/T  = 1/(N dt)
+	!
+	! Nyquist frequency is at: 
+	!
+	!            Nyquist = 1/(2dt) = N/(2T); k = N/2 + 1
+	!
+	!           So:  S[1] = mean of the time series
+	!                S[2] = S[N]
+	!                S[3] = S[N-1]
+	!                S[k] = S[N-k+1]
+	!
+	!           Note: S[(N/2+1] is set = 0
+	!               
+	SUBROUTINE FFTreal(Nin,X,a,b,WSAVE,C)
+	IMPLICIT NONE
+	INTEGER Nin,N,i
+	REAL X(*),a(*),b(*),WSAVE(*)
+	COMPLEX C(*)
+
+        ! Check if N is even
+
+	IF(MOD(Nin,2).EQ.0)THEN
+	  N=Nin
+	ELSE
+	  N=Nin-1
+	ENDIF
+	
+	! load complex array
+
+	DO i=1,N
+	  C(i)=CMPLX(X(i),0.)
+	ENDDO
+
+	! Compute the transform
+
+	CALL CFFTF(N,C,WSAVE)
+
+	! load and normalize the a and b arrays
+
+	DO i=1,N
+	  a(i)=REAL(C(i))/FLOAT(N)
+	  b(i)=AIMAG(C(i))/FLOAT(N)
+	ENDDO
+	  
+	! Set values at the nyquist to zero 
+
+	a(N/2+1)=0.
+	b(N/2+1)=0.
+
+	END
+
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+
+
+	!******************************************
+	!
+	!  Canned FFT Routines
+	!
+	!******************************************
+
+      subroutine cfftf (n,c,wsave)
+
+C  FORWARD COMPLEX DISCRETE FFT OF A COMPLEX PERIODIC SEQUENCE
+C
+C     EQUIVALENTLY, CFFTF COMPUTES THE FOURIER COEFFICIENTS 
+C     OF A COMPLEX PERIODIC SEQUENCE.
+C
+C     THE TRANSFORM IS NOT NORMALIZED. TO OBTAIN A NORMALIZED TRANSFORM
+C     THE OUTPUT MUST BE DIVIDED BY N. OTHERWISE A CALL OF CFFTF
+C     FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTF MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES. N
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTF. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(-I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+C
+      real       c(*)       ,wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, iw1, iw2
+
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftf1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cfftf1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  PASSF,PASSF5,PASSF3,PASSF2,PASSF4
+
+      real       ch(*)      ,c(*)       ,wa(*)      ,ifac(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      INTEGER i, n, nf, na, l1, iw, k1, ip, l2, ido, idot, idl1, 
+     .        ix2, ix3, ix4, nac, n2
+
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passf4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passf4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passf2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passf2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passf3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passf3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passf5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passf5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passf (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passf (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine cffti (n,wsave)
+
+C   INITIALIZE FOR CFFTF AND CFFTB
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI(N,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI INITIALIZES THE ARRAY WSAVE WHICH IS USED IN
+C     BOTH CFFTF AND CFFTB. THE PRIME FACTORIZATION OF N TOGETHER WITH
+C     A TABULATION OF THE TRIGONOMETRIC FUNCTIONS ARE COMPUTED AND
+C     STORED IN WSAVE.
+C
+C     INPUT PARAMETER
+C
+C     N       THE LENGTH OF THE SEQUENCE TO BE TRANSFORMED
+C
+C     OUTPUT PARAMETER
+C
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4*N+15
+C             THE SAME WORK ARRAY CAN BE USED FOR BOTH CFFTF AND CFFTB
+C             AS LONG AS N REMAINS UNCHANGED. DIFFERENT WSAVE ARRAYS
+C             ARE REQUIRED FOR DIFFERENT VALUES OF N. THE CONTENTS OF
+C             WSAVE MUST NOT BE CHANGED BETWEEN CALLS OF CFFTF OR CFFTB
+C
+
+      real       wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer  n, iw1, iw2
+
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cffti1 (n,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cffti1 (n,wa,ifac)
+C***REFER TO CFFTI
+C***ROUTINES CALLED  (NONE)
+
+      real       wa(*)      ,ifac(*)    ,ntryh(4)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, nl, nf, j, ntry, nq, nr, i, ib, l1, k1, ip, ld, l2, 
+     .        ido, idot, ipm,i1,ii
+      real    argh, wldc, wlds, arg, dl1c, dl1s, dc, ds, tpi, wldch
+
+      data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/3,4,2,5/
+      nl = n
+      nf = 0
+      j = 0
+  101 j = j+1
+      if (j-4) 102,102,103
+  102 ntry = ntryh(j)
+      go to 104
+  103 ntry = ntry+2
+  104 nq = nl/ntry
+      nr = nl-ntry*nq
+      if (nr) 101,105,101
+  105 nf = nf+1
+      ifac(nf+2) = ntry
+      nl = nq
+      if (ntry .ne. 2) go to 107
+      if (nf .eq. 1) go to 107
+      do 106 i=2,nf
+         ib = nf-i+2
+         ifac(ib+2) = ifac(ib+1)
+  106 continue
+      ifac(3) = 2
+  107 if (nl .ne. 1) go to 104
+      ifac(1) = n
+      ifac(2) = nf
+      tpi = 6.28318530717959
+      argh = tpi/float(n)
+      i = 2
+      l1 = 1
+      do 110 k1=1,nf
+         ip = ifac(k1+2)
+         ld = 0
+         l2 = l1*ip
+         ido = n/l2
+         idot = ido+ido+2
+         ipm = ip-1
+         wldc = 1.
+         wlds = 0.
+         arg = float(l1)*argh
+         dl1c = cos(arg)
+         dl1s = sin(arg)
+         do 109 j=1,ipm
+            i1 = i
+            wa(i-1) = 1.
+            wa(i) = 0.
+            ld = ld+l1
+            wldch = wldc
+            wldc = dl1c*wldc-dl1s*wlds
+            wlds = dl1s*wldch+dl1c*wlds
+            dc = wldc
+            ds = wlds
+            do 108 ii=4,idot,2
+               i = i+2
+               wa(i-1) = dc*wa(i-3)-ds*wa(i-2)
+               wa(i) = ds*wa(i-3)+dc*wa(i-2)
+  108       continue
+            if (ip .le. 5) go to 109
+            wa(i1-1) = wa(i-1)
+            wa(i1) = wa(i)
+  109    continue
+         l1 = l2
+  110 continue
+      end
+
+
+      subroutine cfftb (n,c,wsave)
+
+C INVERSE FFT OF A COMPLEX PERIODIC SEQUENCE
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB(N,C,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB COMPUTES THE BACKWARD COMPLEX DISCRETE FOURIER
+C     TRANSFORM (THE FOURIER SYNTHESIS). EQUIVALENTLY , CFFTB COMPUTES
+C     A COMPLEX PERIODIC SEQUENCE FROM ITS FOURIER COEFFICIENTS.
+C     THE TRANSFORM IS DEFINED BELOW AT OUTPUT PARAMETER C.
+C
+C     A CALL OF CFFTF FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE
+C     SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTB MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES.
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTB. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+
+C***ROUTINES CALLED  CFFTB1
+
+      real c(*), wsave(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, iw1, iw2
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftb1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      return
+      end
+
+      subroutine cfftb1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  PASSB,PASSB5,PASSB3,PASSB2,PASSB4
+
+      real       ch(*)      ,c(*)       ,wa(*)      ,ifac(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer n, nf, na, l1, iw, k1, ip, l2, ido, idot, idl1,
+     .        ix2, ix3, ix4, nac, n2, i
+
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passb4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passb4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passb2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passb2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passb3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passb3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passb5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passb5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passb (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passb (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine passb (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(*)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer nac, ido, ip, l1, idl1, idot, nt, ipp2, ipph, idp, j, 
+     .        jc, k, i, idl, inc, l, lc, ik, idlj, idij, idj
+      real    war, wai
+
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)+wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passb2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr2, ti2
+
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2+wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2-wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passb3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(*)     ,wa2(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real taur, taui, tr2, cr2, ti2, ci2, cr3, ci3, dr2, dr3, di2, di3
+
+      data taur,taui /-.5,.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passb4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED (NONE)
+
+      real       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4, 
+     .        cr2, cr3, cr4, ci2, ci3, ci4
+
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,4,k)-cc(2,2,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,2,k)-cc(1,4,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,4,k)-cc(i,2,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,2,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2-wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2+wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3-wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3+wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4-wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4+wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)     ,wa4(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real tr2, tr4, tr5, tr11, tr12, ti2, ti3, ti4, ti5, ti11, ti12, 
+     .     cr2, cr3, cr4, cr5, ci2, ci3, ci4, ci5, dr4, dr5, 
+     .     di2, di3, di4, di5, tr3, dr3, dr2
+
+      data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154,
+     1-.809016994374947,.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4-wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4+wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5-wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5+wa4(i)*dr5
+  103    continue
+  104 continue
+      end
+
+      subroutine passf (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(*)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer nac, ido, ip, l1, idl1, idot, nt, ipp2, ipph, idp, j, jc,
+     .        k, i, idl, inc, l, lc, ik, idlj, idij, idj
+      real    war, wai
+
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = -wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)-wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passf2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr2, ti2
+
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2-wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2+wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passf3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(*)     ,wa2(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real taur, taui, tr2, cr2, ti2, ci2, cr3, ci3, dr2, dr3, di2, di3
+
+      data taur,taui /-.5,-.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passf4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    ti1, ti2, tr4, ti3, tr1, tr2, ti4, tr3, cr3, ci3, 
+     .        cr2, cr4, ci2, ci4
+
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,2,k)-cc(2,4,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,4,k)-cc(1,2,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,2,k)-cc(i,4,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,4,k)-cc(i-1,2,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2+wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2-wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3+wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3-wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4+wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4-wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      real       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(*)     ,wa2(*)     ,wa3(*)     ,wa4(*)
+
+* INTERNAL VARIABLE DECLARATIONS
+
+      integer ido, l1, k, i
+      real    tr11, ti11, tr12, ti12, ti5, ti2, ti4, ti3, tr5, tr2, 
+     .        tr4, tr3, cr2, ci2, cr3, ci3, cr5, ci5, cr4, ci4, dr3, 
+     .        dr4, di3, di4, dr5, dr2, di5, di2
+
+      data tr11,ti11,tr12,ti12 /.309016994374947,-.951056516295154,
+     1-.809016994374947,-.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4+wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4-wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5+wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5-wa4(i)*dr5
+  103    continue
+  104 continue
+      end 
diff --git a/external_functions/romea/rr_cross_spectrum_orig.F b/external_functions/romea/rr_cross_spectrum_orig.F
new file mode 100644
index 0000000..4c685ae
--- /dev/null
+++ b/external_functions/romea/rr_cross_spectrum_orig.F
@@ -0,0 +1,1796 @@
+******************************************************************
+*
+*           rr_cross_spectrum.F
+*
+*             Rick Romea   Oct.8, 2000
+*
+*
+* Cross-spectral program
+*
+* INPUT:
+* arg_1  X1 (I, J, L=1:N) Real time series 1 		
+* arg_2  X2 (I, J, L=1:N) Real time series 2	
+* arg_3  Nf   Number of frequencies per band 	 
+* arg_4  P    Percentage level for significance (90, 95 or 99)
+*
+*        handed along:  Number of data points N
+*       		Sampling interval of data points
+*
+* OUTPUT:  ANSWER (I,J,K=1:11,L=1:Nb)
+*
+* ANSWER (I,J,K=1,L=Nb)	 Power in  band1	         
+* ANSWER (I,J,K=2,L=Nb)	 Power in band2	                 
+* ANSWER (I,J,K=3,L=Nb)	 Series 1: Upper confidence level	
+* ANSWER (I,J,K=4,L=Nb)  Series 1: Lower confidence level	
+* ANSWER (I,J,K=5,L=Nb)	 Series 2: Upper confidence level	
+* ANSWER (I,J,K=6,L=Nb)	 Series 2: Lower confidence level	
+* ANSWER (I,J,K=7,L=Nb)  Coherence-squared in each band	
+* ANSWER (I,J,K=8,L=Nb)  Phase in each band 	
+* ANSWER (I,J,K=9,L=Nb) Significant coherence squared
+* ANSWER (I,J,K=10,L=Nb) Upper confidence level for phase
+* ANSWER (I,J,K=11,L=Nb) Lower confidence level for phase
+*
+*       handed along: 	Number of bands	 Nb
+*                       frequency axis
+*
+******************************************************************
+
+      SUBROUTINE RR_cross_spectrum_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      PRINT*,'START INIT'
+
+      CALL ef_set_desc(id,'Computes auto and cross-spectrum')
+      CALL ef_set_num_args(id,4)
+ 
+      ! x and y unchanged
+      ! on output:  z-axis is ABSTRACT:  has k=1:12
+      ! on output:  t-axis is CUSTOM: converted to frequency axis
+
+      CALL ef_set_axis_inheritance(id,
+     .   IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,CUSTOM,CUSTOM)   
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      !  Set a work array
+
+      CALL ef_set_num_work_arrays  (id, 8)
+
+      ! Describe the input arguments
+
+      ! arg_1  X1 (I, J, L=1:N) Real time series 1 		
+
+      CALL ef_set_arg_name         (id, ARG1, 'S1')
+      CALL ef_set_arg_desc         (id, ARG1, 'Series 1')
+      CALL ef_set_arg_unit         (id, ARG1, ' ')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,NO,NO)
+
+      ! arg_2  X2 (I, J, L=1:N) Real time series 2	
+
+      CALL ef_set_arg_name         (id, ARG2, 'S2')
+      CALL ef_set_arg_desc         (id, ARG2, 'Series 2')
+      CALL ef_set_arg_unit         (id, ARG2, ' ')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,NO,NO)
+
+      ! arg_3  Nf Number of frequencies per band 	 
+      !  scalar
+      
+      CALL ef_set_arg_name         (id, ARG3, 'Nf')
+      CALL ef_set_arg_desc         (id, ARG3, 
+     .                  'Number of frequencies per band')
+      CALL ef_set_arg_unit         (id, ARG3, ' ')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO,NO,NO,NO)
+
+      ! arg_4  P  Percentage level for significance (90, 95 or 99)
+      !  scalar
+
+      CALL ef_set_arg_name         (id, ARG4, 'P')
+      CALL ef_set_arg_desc         (id, ARG4,
+     .       'Percentage level for significance (90, 95 or 99)')
+      CALL ef_set_arg_unit         (id, ARG4, ' ') 
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO,NO,NO,NO)
+
+      PRINT*,'INIT DONE'
+ 
+      END
+
+C************************************************************************
+
+      SUBROUTINE  RR_cross_spectrum_custom_axes(id)
+      IMPLICIT NONE
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS)
+      INTEGER arg_hi_ss(4,EF_MAX_ARGS)
+      INTEGER  arg_incr(4,EF_MAX_ARGS)
+
+      CHARACTER*16 ax_name(4)
+      CHARACTER*16 ax_units(4)
+
+      LOGICAL backward(4)
+      LOGICAL modulo(4)
+      LOGICAL regular(4)
+
+      REAL          rNf, dt, T, df, f1, f2
+      INTEGER       Nf, Nb, Npts
+      CHARACTER*32  outunits
+
+      WRITE(6,*)'START CUSTOM AXES, EF_MAX_ARGS', EF_MAX_ARGS
+      CALL FLUSH(6) 
+ 
+      PRINT*,'ef_get_arg_subscripts'
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      PRINT*,'arg_hi_ss',arg_hi_ss(T_AXIS,ARG1)  
+      PRINT*,'arg_lo_ss',arg_lo_ss(T_AXIS,ARG1) 
+
+      PRINT*,'ef_get_one_val'     
+      CALL ef_get_one_val(id, ARG3, rNf)  
+      PRINT*,'ef_get_axis_info'      
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, backward,
+     .     modulo, regular) ! Get the units for the time axis.
+      PRINT*,'ef_get_box_size'      
+      CALL ef_get_box_size(id, ARG1, T_AXIS, arg_lo_ss(T_AXIS,ARG1), 
+     .               arg_lo_ss(T_AXIS,ARG1), dt)  ! sampling interval = dt
+      PRINT*,'END EF CALLS'
+      CALL FLUSH(6)
+
+      ! Get the (integer) number of frequencies per band = Nf.
+
+      Nf=NINT(rNf)
+
+      ! Compute the number of points in the time series = Npts.
+
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+      ! Compute the number of bands
+
+      Nb = Npts/(2*Nf)
+
+      ! Compute the total time
+
+      T = FLOAT(Npts-1)*dt  
+
+      ! Frequency interval for each band
+
+      df = FLOAT(Nf)/T
+
+      ! First frequency (center of first band)
+
+      f1 = df/2.
+
+      ! Last frequency
+
+      f2 = f1 + FLOAT(Nb-1)*df
+
+      PRINT*,'NPTS = ',Npts
+      PRINT*,'Nf   = ',Nf
+      PRINT*,'dt   = ',dt
+      PRINT*,'Nb   = ',Nb
+      PRINT*,'T    = ',T
+      PRINT*,'df   = ',df
+      PRINT*,'f1   = ',f1
+      PRINT*,'f2   = ',f2
+      CALL FLUSH(6)
+
+      ! ef_set_custom_axis(id, axis, lo, hi, delta, unit, modulo) 
+
+      ! Set the label for the frequency axis =  1/units.
+
+      outunits = '1/' // ax_units(T_AXIS)
+
+      PRINT*,'outunits = ',outunits
+      CALL FLUSH(6)
+
+      CALL ef_set_custom_axis (id,T_AXIS,f1,f2,df,outunits,NO)
+
+      ! Set the label for the abstract axis 
+
+      outunits = 'ABSTRACT'
+
+      PRINT*,'outunits = ',outunits
+      CALL FLUSH(6)
+
+      CALL ef_set_custom_axis (id,Z_AXIS,1,11,1,outunits,NO)
+
+      PRINT*,'END CUSTOM AXES'
+      CALL FLUSH(6)
+
+      END
+
+C************************************************************************
+
+      SUBROUTINE  RR_cross_spectrum_work_size(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER Npts
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),arg_hi_ss(4,EF_MAX_ARGS),
+     .                                 arg_incr(4,EF_MAX_ARGS)
+
+
+      PRINT*,'START WORK_SIZE'
+       
+      !  Get the number of points in the time series = Npts
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+      PRINT*,'NPTS = ',Npts
+
+      ! ef_set_work_array_dims(id,iarray,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi) 
+      CALL ef_set_work_array_dims(id,1,1,1,1,1,1,1,1,4*Npts+1) 
+      CALL ef_set_work_array_dims(id,2,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,3,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,4,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,5,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,6,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,7,1,1,1,1,1,1,1,Npts) 
+      CALL ef_set_work_array_dims(id,8,1,1,1,1,1,1,1,2*Npts) 
+      
+      PRINT*,'END WORK_SIZE'
+      END
+
+
+
+C****************************************************************
+
+      SUBROUTINE RR_cross_spectrum_result_limits(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), 
+     .        arg_hi_ss(4,EF_MAX_ARGS),
+     .         arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER Nb,Npts,Nf
+      REAL    rNf
+
+
+      PRINT*,'START RESULT_LIMITS'
+
+      ! TIME AXIS
+
+         !  Get the (integer) number of frequencies per band = Nf.
+
+         CALL ef_get_one_val(id, ARG3, rNf)  
+         Nf=NINT(rNf)
+
+      PRINT*,'Nf = ',Nf
+
+         !  Get the number of points in the time series = Npts.
+
+         CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr) 
+
+         Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+     
+      PRINT*,'NPTS = ',Npts
+
+
+         ! Number of bands
+
+         Nb = Npts/(2*Nf)
+
+      PRINT*,'Nb = ',Nb
+
+         CALL ef_set_axis_limits(id, T_AXIS, 1, Nb)
+
+      ! ABSTRACT Z AXIS
+
+         CALL ef_set_axis_limits(id, Z_AXIS, 1, 11)
+
+      PRINT*,'END RESULT_LIMITS'
+
+      END
+
+C************************************************************
+
+      SUBROUTINE RR_cross_spectrum_compute(id,S1,S2,rNf,P,ANSWER,
+     .                                WSAVE,a1,a2,b1,b2,X1,X2,C)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      REAL S1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .          mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL S2  (mem2lox:mem2hix, mem2loy:mem1hiy, 
+     .          mem2loz:mem2hiz, mem2lot:mem1hit)
+      REAL rNf
+      REAL P
+      REAL ANSWER (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  l
+      INTEGER i1, j1, l1
+      INTEGER i2, j2, l2
+
+      REAL    WSAVE(wrk1lot:wrk1hit)
+      REAL       a1(wrk2lot:wrk2hit)
+      REAL       b1(wrk3lot:wrk3hit)
+      REAL       a2(wrk4lot:wrk4hit)
+      REAL       b2(wrk5lot:wrk5hit)
+      REAL       X1(wrk6lot:wrk6hit)
+      REAL       X2(wrk7lot:wrk7hit)
+      COMPLEX     C(wrk8lot:wrk8hit)
+
+      INTEGER Npts,Nf,Nb,kk
+      REAL rNf,alpha,P,Coh2sig,lower,upper,PP,QQ,theta,GetStudentT  
+      EXTERNAL GetStudentT
+
+      PRINT*,'START COMPUTE'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+         
+      !  Get the number of points in the time series = Npts.
+
+      Npts = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1 
+
+
+      PRINT*,'NPTS = ',Npts
+
+      !  Get the (integer) number of frequencies per band = Nf.
+
+      Nf=NINT(rNf)
+         
+      PRINT*,'Nf = ',Nf
+
+      ! Number of bands
+
+      Nb = Npts/(2*Nf)
+
+
+      PRINT*,'Nb = ',Nb
+
+      ! Set up the cosine matrix
+
+      PRINT*,'START CFFTI'
+
+      CALL CFFTI(Npts,WSAVE)
+
+      PRINT*,'END CFFTI'
+
+      !  Significance level for coherence at P% with 2*Nf degrees of freedom
+      !  Ref: R.O.R.Y.Thompson, Coherence Significance Levels, AMS, 1979
+
+      alpha = 1.-P/100.
+      Coh2sig= 1.-alpha**(1./FLOAT(Nf-1))
+
+
+      !  Confidence intervals for the power spectral estimates
+      !
+      !   IF Gxx is the 'true' autospectral value, based on the 
+      !    band-averaged estimate <Gxx>, 
+      !    then, for Nf number of frequencies in band, 
+      !    we can say with P certainty that
+      !
+      !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+      !
+      !       (Bendat & Piersol, p.286)  
+
+      PRINT*,'START Confindence Intervals'
+      
+      CALL SpectralConfidenceIntervals(Nf,NINT(P),lower,upper)
+
+      PRINT*,'lower = ',lower
+      PRINT*,'upper = ',upper
+
+      ! START
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+        j1 = arg_lo_ss(Y_AXIS,ARG1)
+        j2 = arg_lo_ss(Y_AXIS,ARG2)
+        DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           ! Copy the arrays
+           
+           l=1 
+           DO l1=arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+              X1(l)=S1(i1,j1,1,l1)
+              l=l+1
+           ENDDO
+            
+           l=1 
+           DO l2=arg_lo_ss(T_AXIS,ARG2),arg_hi_ss(T_AXIS,ARG2)
+              X2(l)=S1(i2,j2,1,l2)
+              l=l+1
+           ENDDO
+
+           ! Compute the raw spectral estimates
+
+           PRINT*,'FFT - 1'
+
+           CALL FFTreal(Npts,X1,a1,b1,WSAVE,C)
+
+           PRINT*,'FFT - 2'
+
+           CALL FFTreal(Npts,X2,a2,b2,WSAVE,C)
+
+           ! Compute the auto-spectra, coherence-squared and the phase
+          
+           ! Band average
+
+
+           PRINT*, 'START BAND AVERAGE'
+
+           DO L=1,Nb
+	      ANSWER(I,J,1,L)=0.  
+	      ANSWER(I,J,2,L)=0.  
+	      PP=0.  
+	      QQ=0. 	
+ 
+               DO kk=2+(L-1)*Nf,L*Nf+1
+                   ANSWER(I,J,1,L) = ANSWER(I,J,1,L)
+     .                        + a1(kk)*a1(kk) + b1(kk)*b1(kk)
+	   	   ANSWER(I,J,2,L) = ANSWER(I,J,2,L)
+     .                        + a2(kk)*a2(kk) + b2(kk)*b2(kk)
+                   PP = PP + a1(kk)*a2(kk) + b1(kk)*b2(kk)
+                   QQ = QQ + a2(kk)*b1(kk) - a1(kk)*b2(kk)
+
+	       ENDDO
+
+               !  Power spectrum for Series 1
+   	      
+               ANSWER(I,J,1,L) = 4.*ANSWER(I,J,1,L)/FLOAT(Nf)
+
+               !  Power spectrum for Series 2	
+
+               ANSWER(I,J,2,L) = 4.*ANSWER(I,J,2,L)/FLOAT(Nf)
+   	      
+
+               PP = 4.*PP/FLOAT(Nf)
+   	       QQ = 4.*QQ/FLOAT(Nf)
+
+               !  Coherence-squared in each band
+
+	       ANSWER(I,J,7,L) = (PP*PP+QQ*QQ)
+     .                     / (ANSWER(I,J,1,L)*ANSWER(I,J,2,L))
+
+                !  Phase in each band 
+
+	        IF(QQ.EQ.0..AND.PP.EQ.0.)THEN
+	           ANSWER(I,J,8,L)=0.
+	        ELSE
+	           ANSWER(I,J,8,L)=ATAN2(-QQ,PP)
+	        ENDIF
+
+                ! Compute significant coherence in each band 
+	        ! (currently constant for constant Nf)
+
+                ANSWER(I,J,9,L)=Coh2sig 
+
+                ! Compute Confidence limits for the phase
+                ! theta = +- phase error (rad) at P significance 
+	        !         with 2*Nf degrees of freedom
+	        ! (P.285 Koopmans .The Spectral Analysis of Time Series)
+                
+                IF(ANSWER(I,J,7,L).EQ.0.)THEN
+                  theta=3.14159              
+                ELSE
+                  theta = ASIN(  SQRT(  (1.-ANSWER(I,J,7,L)) / 
+     .                                    ANSWER(I,J,7,L) / 
+     .                                     FLOAT(2*Nf-2)   )
+     .                * GetStudentT(NINT(P),Nf)   )  
+                ENDIF
+                ANSWER (I,J,10,L) = ANSWER(I,J,8,L)+theta ! Upper confidence level for phase
+                ANSWER (I,J,11,L) = ANSWER(I,J,8,L)-theta ! Lower confidence level for phase
+
+                ! Confidence levels on the autospectrum 
+
+                ANSWER (I,J,3,L) = upper*ANSWER(I,J,1,L) ! Series 1: Upper confidence level	
+                ANSWER (I,J,4,L) = lower*ANSWER(I,J,1,L) ! Series 1: Lower confidence level	
+                ANSWER (I,J,5,L) = upper*ANSWER(I,J,2,L) ! Series 2: Upper confidence level	
+                ANSWER (I,J,6,L) = lower*ANSWER(I,J,2,L) ! Series 2: Lower confidence level	
+
+                PRINT*, 'END BAND AVERAGE'
+
+	   ENDDO
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2) 
+         ENDDO
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+      ENDDO
+      END
+
+
+	!******************************************
+	!
+	!  Confidence intervals for the power spectral estimates
+	!
+	!******************************************
+	! 
+        ! Nf = number of frequencys in band	(input)
+	! P  = percent level for significance (eg 90,95 0r 99 ) INPUT
+	! lower = lower bound (output)
+	! upper = upper bound (output)
+	!
+        !   IF Gxx is the 'true' autospectral value, based on the 
+	!    band-averaged estimate <Gxx>, 
+	!    then, for Nf number of frequencys in band,
+	!    we can say with 90% certainty that
+	!
+        !  lower * <Gxx>  <=  Gxx  <=  upper * <Gxx> 
+	!
+	!  lower = df/chi squared (df,alpha/2)
+	!  upper = df/chi squared (df,1-alpha/2)
+	!
+        ! df = degrees of freedom = 2*number of frequencys in band
+	!
+	! chi squared (n,alpha/2) -->  P=100*(1-alpha)
+	!
+	!  P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+	!
+	! Bendat & Piersol, p.286
+	! Bendat & Piersol, p.524 (table)
+
+      SUBROUTINE SpectralConfidenceIntervals(Nf,P,lower,upper)
+      IMPLICIT NONE
+      INTEGER Nf,P,df
+      REAL lower,upper
+	
+	!   P  	alpha	alpha/2	 1-alpha/2
+	!  90    0.1     0.05	   0.95
+	!  95    0.05	 0.025	   0.975
+	!  99	 0.01	 0.005	   0.995
+      
+      REAL chi_05(15) 
+      REAL chi_025(15)	  
+      REAL chi_005(15)
+      REAL chi_95(15)	  
+      REAL chi_975(15)  
+      REAL chi_995(15)  
+	
+      DATA chi_005 /10.6,14.86,18.55,21.96,25.19,28.3,31.3,34.27,37.16,
+     .               40.,42.8,45.56,48.29,50.99,53.67/		  
+      DATA chi_025 /7.38,11.14,14.45,17.53,20.48,23.34,26.12,28.85,
+     .               31.53,34.17,36.78,39.36,41.92,44.46,46.98/	  
+      DATA chi_05 /5.99,9.49,12.59,15.51,18.31,21.03,23.68,26.30,28.87,
+     .             31.41,33.92,36.42,38.88,41.34,43.77/
+      DATA chi_95 /.103,.711,1.64,2.73,3.94,5.23,6.57,7.96,8.39,10.85,
+     .             12.34,13.85,15.38,16.93,18.49/
+      DATA chi_975 /.0506,.484,1.24,2.18,3.25,4.4,5.63,6.91,8.23,9.59,
+     .              10.98,12.4,13.84,15.31,16.79/
+      DATA chi_995 /.01,.207,.676,1.34,2.16,3.07,4.07,5.14,6.26,7.43,
+     .              8.64,9.89,11.16,12.46,13.79/
+
+       df=Nf*2
+
+	IF(df.GT.100)THEN
+	  IF(P.EQ.90)THEN 
+	    lower=FLOAT(df)/146.57
+          upper=FLOAT(df)/95.7
+        ELSEIF(P.EQ.95)THEN
+		lower=FLOAT(df)/152.21
+          upper=FLOAT(df)/91.58
+	  ELSE  !  P.EQ.99
+	  	lower=FLOAT(df)/163.65
+          upper=FLOAT(df)/83.85
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+        	lower=FLOAT(df)/79.08
+          upper=FLOAT(df)/43.19
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/83.8
+          upper=FLOAT(df)/40.48
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/91.95
+          upper=FLOAT(df)/35.53
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/55.76
+          upper=FLOAT(df)/26.51
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/59.34
+          upper=FLOAT(df)/24.43
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/66.77
+          upper=FLOAT(df)/20.71
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	   	lower=FLOAT(df)/chi_05(Nf)
+          upper=FLOAT(df)/chi_95(Nf)
+        ELSEIF(P.EQ.95)THEN
+	   	lower=FLOAT(df)/chi_025(Nf)
+          upper=FLOAT(df)/chi_975(Nf)
+	  ELSE  !  P.EQ.99
+	   	lower=FLOAT(df)/chi_005(Nf)
+          upper=FLOAT(df)/chi_995(Nf)
+	  ENDIF
+	ENDIF
+	END
+
+	!******************************************
+	! 
+	! Get the upper cutoff point of the Student T distribution 
+	! (P.341 Koopmans .The Spectral Analysis of Time Series)
+	!
+	!******************************************
+	   
+	REAL FUNCTION GetStudentT(P,Nf)
+        IMPLICIT NONE
+	INTEGER Nf,P,df  
+	REAL ST_90(15)
+	REAL ST_95(15)
+	REAL ST_99(15)
+	REAL T
+	DATA ST_90/2.92,2.132,1.943,1.86,1.812,1.782,1.761,1.746,
+     .           1.734,1.725,1.717,1.711,1.706,1.701,1.697/
+	DATA ST_95/4.303,2.776,2.447,2.306,2.228,2.179,2.145,2.12,
+     .           2.101,2.086,2.074,2.064,2.056,2.048,2.042/
+  	DATA ST_99/9.925,4.604,3.707,3.355,3.169,3.055,2.977,2.921,
+     .           2.878,2.845,2.819,2.797,2.779,2.763,2.75/
+
+	IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+           P=90 
+	   WRITE(6,*)'WARNING::P must be 90,95 or 99' 
+           WRITE(6,*)'         in SUBROUTINE PhaseConfidenceLimits'
+           WRITE(6,*)'  '
+           WRITE(6,*)'P set to 90%'
+	ENDIF
+ 
+        df=Nf*2
+
+	IF(df.GT.120)THEN
+     	  IF(P.EQ.90)THEN
+		T=1.645
+          ELSEIF(P.EQ.95)THEN
+		T=1.96
+	  ELSE  !  P.EQ.99
+		T=2.576
+	  ENDIF
+	ELSEIF(df.GT.80)THEN
+	  IF(P.EQ.90)THEN
+		T=1.658
+          ELSEIF(P.EQ.95)THEN
+		T=1.98
+	  ELSE  !  P.EQ.99
+		T=2.617
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+		T=1.671
+          ELSEIF(P.EQ.95)THEN
+		T=2.
+	  ELSE  !  P.EQ.99
+		T=2.66
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+		T=1.684
+          ELSEIF(P.EQ.95)THEN
+		T=2.021
+	  ELSE  !  P.EQ.99
+		T=2.704
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	    T=ST_90(Nf)
+        ELSEIF(P.EQ.95)THEN
+	    T=ST_95(Nf)
+	  ELSE  !  P.EQ.99
+	    T=ST_99(Nf)
+	  ENDIF
+	ENDIF
+	GetStudentT=T
+	END
+
+
+        !******************************************
+	!
+	! FFT OF A REAL PERIODIC SEQUENCE
+	! 
+	!******************************************
+     	!
+        !   N         = number of data points (input)
+	!   X(N)      = real input time series	(input)
+	!   a(N),b(N) = normalized Fourier coefficients (output)
+	!
+	!  Spectral estimates are:  S(k) = a(k) + i b(k)
+	!
+	!                                     i = sqrt(-1)
+	!
+	!
+	!            S(k)=THE SUM FROM n=1,...,N OF
+	!  
+        !                X(n)/N*EXP(-2*PI*i*k*n/N)
+	!		   so:
+	!                a(k) = (1/N) * THE SUM FROM n=1,...,N OF
+	!		              X(n) * cos(2*PI*k*n/N) 
+	!	
+	!		 b(k) = (1/N) * THE SUM FROM n=1,...,N OF  
+	!                           - X(n) * sin(2*PI*k*n/N)	
+	!
+	! T = N dt  is the fundamental period
+	! 
+        ! Frequencies are: f(k) = (k-1)/T  ;  k=1,..,N
+	! 
+	! Frequency interval between spectral estimates: 
+	!
+	!            df = 1/T  = 1/(N dt)
+	!
+	! Nyquist frequency is at: 
+	!
+	!            Nyquist = 1/(2dt) = N/(2T); k = N/2 + 1
+	!
+	!           So:  S[1] = mean of the time series
+	!                S[2] = S[N]
+	!                S[3] = S[N-1]
+	!                S[k] = S[N-k+1]
+	!
+	!           Note: S[(N/2+1] is set = 0
+	!               
+	SUBROUTINE FFTreal(Nin,X,a,b,WSAVE,C)
+	IMPLICIT NONE
+	INTEGER Nin,N,i
+	REAL X(1),a(1),b(1),WSAVE(1)
+	COMPLEX C(1)
+
+        ! Check if N is even
+
+	IF(MOD(Nin,2).EQ.0)THEN
+	  N=Nin
+	ELSE
+	  N=Nin-1
+	ENDIF
+	
+	! load complex array
+
+	DO i=1,N
+	  C(i)=CMPLX(X(i),0.)
+	ENDDO
+
+	! Compute the transform
+
+	CALL CFFTF(N,C,WSAVE)
+
+	! load and normalize the a and b arrays
+
+	DO i=1,N
+	  a(i)=REAL(C(i))/FLOAT(N)
+	  b(i)=AIMAG(C(i))/FLOAT(N)
+	ENDDO
+	  
+	! Set values at the nyquist to zero 
+
+	a(N/2+1)=0.
+	b(N/2+1)=0.
+
+	END
+
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+C *********************************************************************
+
+
+	!******************************************
+	!
+	!  Canned FFT Routines
+	!
+	!******************************************
+
+      subroutine cfftf (n,c,wsave)
+
+C  FORWARD COMPLEX DISCRETE FFT OF A COMPLEX PERIODIC SEQUENCE
+C
+C     EQUIVALENTLY, CFFTF COMPUTES THE FOURIER COEFFICIENTS 
+C     OF A COMPLEX PERIODIC SEQUENCE.
+C
+C     THE TRANSFORM IS NOT NORMALIZED. TO OBTAIN A NORMALIZED TRANSFORM
+C     THE OUTPUT MUST BE DIVIDED BY N. OTHERWISE A CALL OF CFFTF
+C     FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTF MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES. N
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTF. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(-I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+C
+
+      dimension       c(1)       ,wsave(1)
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftf1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cfftf1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  PASSF,PASSF5,PASSF3,PASSF2,PASSF4
+
+      dimension       ch(1)      ,c(1)       ,wa(1)      ,ifac(1)
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passf4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passf4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passf2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passf2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passf3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passf3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passf5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passf5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passf (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passf (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine cffti (n,wsave)
+
+C   INITIALIZE FOR CFFTF AND CFFTB
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI(N,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTI INITIALIZES THE ARRAY WSAVE WHICH IS USED IN
+C     BOTH CFFTF AND CFFTB. THE PRIME FACTORIZATION OF N TOGETHER WITH
+C     A TABULATION OF THE TRIGONOMETRIC FUNCTIONS ARE COMPUTED AND
+C     STORED IN WSAVE.
+C
+C     INPUT PARAMETER
+C
+C     N       THE LENGTH OF THE SEQUENCE TO BE TRANSFORMED
+C
+C     OUTPUT PARAMETER
+C
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4*N+15
+C             THE SAME WORK ARRAY CAN BE USED FOR BOTH CFFTF AND CFFTB
+C             AS LONG AS N REMAINS UNCHANGED. DIFFERENT WSAVE ARRAYS
+C             ARE REQUIRED FOR DIFFERENT VALUES OF N. THE CONTENTS OF
+C             WSAVE MUST NOT BE CHANGED BETWEEN CALLS OF CFFTF OR CFFTB
+C
+
+      dimension       wsave(1)
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cffti1 (n,wsave(iw1),wsave(iw2))
+      end
+
+      subroutine cffti1 (n,wa,ifac)
+C***REFER TO CFFTI
+C***ROUTINES CALLED  (NONE)
+
+      dimension       wa(1)      ,ifac(1)    ,ntryh(4)
+      data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/3,4,2,5/
+      nl = n
+      nf = 0
+      j = 0
+  101 j = j+1
+      if (j-4) 102,102,103
+  102 ntry = ntryh(j)
+      go to 104
+  103 ntry = ntry+2
+  104 nq = nl/ntry
+      nr = nl-ntry*nq
+      if (nr) 101,105,101
+  105 nf = nf+1
+      ifac(nf+2) = ntry
+      nl = nq
+      if (ntry .ne. 2) go to 107
+      if (nf .eq. 1) go to 107
+      do 106 i=2,nf
+         ib = nf-i+2
+         ifac(ib+2) = ifac(ib+1)
+  106 continue
+      ifac(3) = 2
+  107 if (nl .ne. 1) go to 104
+      ifac(1) = n
+      ifac(2) = nf
+      tpi = 6.28318530717959
+      argh = tpi/float(n)
+      i = 2
+      l1 = 1
+      do 110 k1=1,nf
+         ip = ifac(k1+2)
+         ld = 0
+         l2 = l1*ip
+         ido = n/l2
+         idot = ido+ido+2
+         ipm = ip-1
+         wldc = 1.
+         wlds = 0.
+         arg = float(l1)*argh
+         dl1c = cos(arg)
+         dl1s = sin(arg)
+         do 109 j=1,ipm
+            i1 = i
+            wa(i-1) = 1.
+            wa(i) = 0.
+            ld = ld+l1
+            wldch = wldc
+            wldc = dl1c*wldc-dl1s*wlds
+            wlds = dl1s*wldch+dl1c*wlds
+            dc = wldc
+            ds = wlds
+            do 108 ii=4,idot,2
+               i = i+2
+               wa(i-1) = dc*wa(i-3)-ds*wa(i-2)
+               wa(i) = ds*wa(i-3)+dc*wa(i-2)
+  108       continue
+            if (ip .le. 5) go to 109
+            wa(i1-1) = wa(i-1)
+            wa(i1) = wa(i)
+  109    continue
+         l1 = l2
+  110 continue
+      end
+
+
+      subroutine cfftb (n,c,wsave)
+
+C INVERSE FFT OF A COMPLEX PERIODIC SEQUENCE
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB(N,C,WSAVE)
+C
+C     *****************************************************************
+C
+C     SUBROUTINE CFFTB COMPUTES THE BACKWARD COMPLEX DISCRETE FOURIER
+C     TRANSFORM (THE FOURIER SYNTHESIS). EQUIVALENTLY , CFFTB COMPUTES
+C     A COMPLEX PERIODIC SEQUENCE FROM ITS FOURIER COEFFICIENTS.
+C     THE TRANSFORM IS DEFINED BELOW AT OUTPUT PARAMETER C.
+C
+C     A CALL OF CFFTF FOLLOWED BY A CALL OF CFFTB WILL MULTIPLY THE
+C     SEQUENCE BY N.
+C
+C     THE ARRAY WSAVE WHICH IS USED BY SUBROUTINE CFFTB MUST BE
+C     INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE).
+C
+C     INPUT PARAMETERS
+C
+C
+C     N      THE LENGTH OF THE COMPLEX SEQUENCE C. THE METHOD IS
+C            MORE EFFICIENT WHEN N IS THE PRODUCT OF SMALL PRIMES.
+C
+C     C      A COMPLEX ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE
+C
+C     WSAVE   A REAL WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 4N+1
+C             IN THE PROGRAM THAT CALLS CFFTB. THE WSAVE ARRAY MUST BE
+C             INITIALIZED BY CALLING SUBROUTINE CFFTI(N,WSAVE) AND A
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.
+C             THE SAME WSAVE ARRAY CAN BE USED BY CFFTF AND CFFTB.
+C
+C     OUTPUT PARAMETERS
+C
+C     C      FOR J=1,...,N
+C
+C                C(J)=THE SUM FROM K=1,...,N OF
+C
+C                      C(K)*EXP(I*J*K*2*PI/N)
+C
+C                            WHERE I=SQRT(-1)
+C
+C     WSAVE   CONTAINS INITIALIZATION CALCULATIONS WHICH MUST NOT BE
+C             DESTROYED BETWEEN CALLS OF SUBROUTINE CFFTF OR CFFTB
+
+C***ROUTINES CALLED  CFFTB1
+
+      dimension c(1), wsave(1)
+      if (n .eq. 1) return
+      iw1 = n+n+1
+      iw2 = iw1+n+n
+      call cfftb1 (n,c,wsave,wsave(iw1),wsave(iw2))
+      return
+      end
+
+      subroutine cfftb1 (n,c,ch,wa,ifac)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  PASSB,PASSB5,PASSB3,PASSB2,PASSB4
+
+      dimension       ch(1)      ,c(1)       ,wa(1)      ,ifac(1)
+      nf = ifac(2)
+      na = 0
+      l1 = 1
+      iw = 1
+      do 116 k1=1,nf
+         ip = ifac(k1+2)
+         l2 = ip*l1
+         ido = n/l2
+         idot = ido+ido
+         idl1 = idot*l1
+         if (ip .ne. 4) go to 103
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         if (na .ne. 0) go to 101
+         call passb4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3))
+         go to 102
+  101    call passb4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3))
+  102    na = 1-na
+         go to 115
+  103    if (ip .ne. 2) go to 106
+         if (na .ne. 0) go to 104
+         call passb2 (idot,l1,c,ch,wa(iw))
+         go to 105
+  104    call passb2 (idot,l1,ch,c,wa(iw))
+  105    na = 1-na
+         go to 115
+  106    if (ip .ne. 3) go to 109
+         ix2 = iw+idot
+         if (na .ne. 0) go to 107
+         call passb3 (idot,l1,c,ch,wa(iw),wa(ix2))
+         go to 108
+  107    call passb3 (idot,l1,ch,c,wa(iw),wa(ix2))
+  108    na = 1-na
+         go to 115
+  109    if (ip .ne. 5) go to 112
+         ix2 = iw+idot
+         ix3 = ix2+idot
+         ix4 = ix3+idot
+         if (na .ne. 0) go to 110
+         call passb5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+         go to 111
+  110    call passb5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4))
+  111    na = 1-na
+         go to 115
+  112    if (na .ne. 0) go to 113
+         call passb (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw))
+         go to 114
+  113    call passb (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw))
+  114    if (nac .ne. 0) na = 1-na
+  115    l1 = l2
+         iw = iw+(ip-1)*idot
+  116 continue
+      if (na .eq. 0) return
+      n2 = n+n
+      do 117 i=1,n2
+         c(i) = ch(i)
+  117 continue
+      end
+
+      subroutine passb (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      dimension       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(1)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)+wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passb2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(1)
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2+wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2-wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passb3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(1)     ,wa2(1)
+      data taur,taui /-.5,.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passb4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED (NONE)
+
+      dimension       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(1)     ,wa2(1)     ,wa3(1)
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,4,k)-cc(2,2,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,2,k)-cc(1,4,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,4,k)-cc(i,2,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,2,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2-wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2+wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3-wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3+wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4-wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4+wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTB
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(1)     ,wa2(1)     ,wa3(1)     ,wa4(1)
+      data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154,
+     1-.809016994374947,.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4-wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4+wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5-wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5+wa4(i)*dr5
+  103    continue
+  104 continue
+      end
+
+      subroutine passf (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      dimension       ch(ido,l1,ip)          ,cc(ido,ip,l1)          ,
+     1                c1(ido,l1,ip)          ,wa(1)      ,c2(idl1,ip),
+     2                ch2(idl1,ip)
+      idot = ido/2
+      nt = ip*idl1
+      ipp2 = ip+2
+      ipph = (ip+1)/2
+      idp = ip*ido
+C
+      if (ido .lt. l1) go to 106
+      do 103 j=2,ipph
+         jc = ipp2-j
+         do 102 k=1,l1
+            do 101 i=1,ido
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  101       continue
+  102    continue
+  103 continue
+      do 105 k=1,l1
+         do 104 i=1,ido
+            ch(i,k,1) = cc(i,1,k)
+  104    continue
+  105 continue
+      go to 112
+  106 do 109 j=2,ipph
+         jc = ipp2-j
+         do 108 i=1,ido
+            do 107 k=1,l1
+               ch(i,k,j) = cc(i,j,k)+cc(i,jc,k)
+               ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k)
+  107       continue
+  108    continue
+  109 continue
+      do 111 i=1,ido
+         do 110 k=1,l1
+            ch(i,k,1) = cc(i,1,k)
+  110    continue
+  111 continue
+  112 idl = 2-ido
+      inc = 0
+      do 116 l=2,ipph
+         lc = ipp2-l
+         idl = idl+ido
+         do 113 ik=1,idl1
+            c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2)
+            c2(ik,lc) = -wa(idl)*ch2(ik,ip)
+  113    continue
+         idlj = idl
+         inc = inc+ido
+         do 115 j=3,ipph
+            jc = ipp2-j
+            idlj = idlj+inc
+            if (idlj .gt. idp) idlj = idlj-idp
+            war = wa(idlj-1)
+            wai = wa(idlj)
+            do 114 ik=1,idl1
+               c2(ik,l) = c2(ik,l)+war*ch2(ik,j)
+               c2(ik,lc) = c2(ik,lc)-wai*ch2(ik,jc)
+  114       continue
+  115    continue
+  116 continue
+      do 118 j=2,ipph
+         do 117 ik=1,idl1
+            ch2(ik,1) = ch2(ik,1)+ch2(ik,j)
+  117    continue
+  118 continue
+      do 120 j=2,ipph
+         jc = ipp2-j
+         do 119 ik=2,idl1,2
+            ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc)
+            ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc)
+            ch2(ik,j) = c2(ik,j)+c2(ik-1,jc)
+            ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc)
+  119    continue
+  120 continue
+      nac = 1
+      if (ido .eq. 2) return
+      nac = 0
+      do 121 ik=1,idl1
+         c2(ik,1) = ch2(ik,1)
+  121 continue
+      do 123 j=2,ip
+         do 122 k=1,l1
+            c1(1,k,j) = ch(1,k,j)
+            c1(2,k,j) = ch(2,k,j)
+  122    continue
+  123 continue
+      if (idot .gt. l1) go to 127
+      idij = 0
+      do 126 j=2,ip
+         idij = idij+2
+         do 125 i=4,ido,2
+            idij = idij+2
+            do 124 k=1,l1
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  124       continue
+  125    continue
+  126 continue
+      return
+  127 idj = 2-ido
+      do 130 j=2,ip
+         idj = idj+ido
+         do 129 k=1,l1
+            idij = idj
+            do 128 i=4,ido,2
+               idij = idij+2
+               c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j)
+               c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j)
+  128       continue
+  129    continue
+  130 continue
+      end
+
+      subroutine passf2 (ido,l1,cc,ch,wa1)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,2,l1)           ,ch(ido,l1,2)           ,
+     1                wa1(1)
+      if (ido .gt. 2) go to 102
+      do 101 k=1,l1
+         ch(1,k,1) = cc(1,1,k)+cc(1,2,k)
+         ch(1,k,2) = cc(1,1,k)-cc(1,2,k)
+         ch(2,k,1) = cc(2,1,k)+cc(2,2,k)
+         ch(2,k,2) = cc(2,1,k)-cc(2,2,k)
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k)
+            tr2 = cc(i-1,1,k)-cc(i-1,2,k)
+            ch(i,k,1) = cc(i,1,k)+cc(i,2,k)
+            ti2 = cc(i,1,k)-cc(i,2,k)
+            ch(i,k,2) = wa1(i-1)*ti2-wa1(i)*tr2
+            ch(i-1,k,2) = wa1(i-1)*tr2+wa1(i)*ti2
+  103    continue
+  104 continue
+      end
+
+      subroutine passf3 (ido,l1,cc,ch,wa1,wa2)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,3,l1)           ,ch(ido,l1,3)           ,
+     1                wa1(1)     ,wa2(1)
+      data taur,taui /-.5,-.866025403784439/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         tr2 = cc(1,2,k)+cc(1,3,k)
+         cr2 = cc(1,1,k)+taur*tr2
+         ch(1,k,1) = cc(1,1,k)+tr2
+         ti2 = cc(2,2,k)+cc(2,3,k)
+         ci2 = cc(2,1,k)+taur*ti2
+         ch(2,k,1) = cc(2,1,k)+ti2
+         cr3 = taui*(cc(1,2,k)-cc(1,3,k))
+         ci3 = taui*(cc(2,2,k)-cc(2,3,k))
+         ch(1,k,2) = cr2-ci3
+         ch(1,k,3) = cr2+ci3
+         ch(2,k,2) = ci2+cr3
+         ch(2,k,3) = ci2-cr3
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            tr2 = cc(i-1,2,k)+cc(i-1,3,k)
+            cr2 = cc(i-1,1,k)+taur*tr2
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2
+            ti2 = cc(i,2,k)+cc(i,3,k)
+            ci2 = cc(i,1,k)+taur*ti2
+            ch(i,k,1) = cc(i,1,k)+ti2
+            cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k))
+            ci3 = taui*(cc(i,2,k)-cc(i,3,k))
+            dr2 = cr2-ci3
+            dr3 = cr2+ci3
+            di2 = ci2+cr3
+            di3 = ci2-cr3
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+  103    continue
+  104 continue
+      end
+
+      subroutine passf4 (ido,l1,cc,ch,wa1,wa2,wa3)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,4,l1)           ,ch(ido,l1,4)           ,
+     1                wa1(1)     ,wa2(1)     ,wa3(1)
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti1 = cc(2,1,k)-cc(2,3,k)
+         ti2 = cc(2,1,k)+cc(2,3,k)
+         tr4 = cc(2,2,k)-cc(2,4,k)
+         ti3 = cc(2,2,k)+cc(2,4,k)
+         tr1 = cc(1,1,k)-cc(1,3,k)
+         tr2 = cc(1,1,k)+cc(1,3,k)
+         ti4 = cc(1,4,k)-cc(1,2,k)
+         tr3 = cc(1,2,k)+cc(1,4,k)
+         ch(1,k,1) = tr2+tr3
+         ch(1,k,3) = tr2-tr3
+         ch(2,k,1) = ti2+ti3
+         ch(2,k,3) = ti2-ti3
+         ch(1,k,2) = tr1+tr4
+         ch(1,k,4) = tr1-tr4
+         ch(2,k,2) = ti1+ti4
+         ch(2,k,4) = ti1-ti4
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti1 = cc(i,1,k)-cc(i,3,k)
+            ti2 = cc(i,1,k)+cc(i,3,k)
+            ti3 = cc(i,2,k)+cc(i,4,k)
+            tr4 = cc(i,2,k)-cc(i,4,k)
+            tr1 = cc(i-1,1,k)-cc(i-1,3,k)
+            tr2 = cc(i-1,1,k)+cc(i-1,3,k)
+            ti4 = cc(i-1,4,k)-cc(i-1,2,k)
+            tr3 = cc(i-1,2,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = tr2+tr3
+            cr3 = tr2-tr3
+            ch(i,k,1) = ti2+ti3
+            ci3 = ti2-ti3
+            cr2 = tr1+tr4
+            cr4 = tr1-tr4
+            ci2 = ti1+ti4
+            ci4 = ti1-ti4
+            ch(i-1,k,2) = wa1(i-1)*cr2+wa1(i)*ci2
+            ch(i,k,2) = wa1(i-1)*ci2-wa1(i)*cr2
+            ch(i-1,k,3) = wa2(i-1)*cr3+wa2(i)*ci3
+            ch(i,k,3) = wa2(i-1)*ci3-wa2(i)*cr3
+            ch(i-1,k,4) = wa3(i-1)*cr4+wa3(i)*ci4
+            ch(i,k,4) = wa3(i-1)*ci4-wa3(i)*cr4
+  103    continue
+  104 continue
+      end
+
+      subroutine passf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4)
+
+C***REFER TO CFFTF
+C***ROUTINES CALLED  (NONE)
+
+      dimension       cc(ido,5,l1)           ,ch(ido,l1,5)           ,
+     1                wa1(1)     ,wa2(1)     ,wa3(1)     ,wa4(1)
+      data tr11,ti11,tr12,ti12 /.309016994374947,-.951056516295154,
+     1-.809016994374947,-.587785252292473/
+      if (ido .ne. 2) go to 102
+      do 101 k=1,l1
+         ti5 = cc(2,2,k)-cc(2,5,k)
+         ti2 = cc(2,2,k)+cc(2,5,k)
+         ti4 = cc(2,3,k)-cc(2,4,k)
+         ti3 = cc(2,3,k)+cc(2,4,k)
+         tr5 = cc(1,2,k)-cc(1,5,k)
+         tr2 = cc(1,2,k)+cc(1,5,k)
+         tr4 = cc(1,3,k)-cc(1,4,k)
+         tr3 = cc(1,3,k)+cc(1,4,k)
+         ch(1,k,1) = cc(1,1,k)+tr2+tr3
+         ch(2,k,1) = cc(2,1,k)+ti2+ti3
+         cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3
+         ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3
+         cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3
+         ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3
+         cr5 = ti11*tr5+ti12*tr4
+         ci5 = ti11*ti5+ti12*ti4
+         cr4 = ti12*tr5-ti11*tr4
+         ci4 = ti12*ti5-ti11*ti4
+         ch(1,k,2) = cr2-ci5
+         ch(1,k,5) = cr2+ci5
+         ch(2,k,2) = ci2+cr5
+         ch(2,k,3) = ci3+cr4
+         ch(1,k,3) = cr3-ci4
+         ch(1,k,4) = cr3+ci4
+         ch(2,k,4) = ci3-cr4
+         ch(2,k,5) = ci2-cr5
+  101 continue
+      return
+  102 do 104 k=1,l1
+         do 103 i=2,ido,2
+            ti5 = cc(i,2,k)-cc(i,5,k)
+            ti2 = cc(i,2,k)+cc(i,5,k)
+            ti4 = cc(i,3,k)-cc(i,4,k)
+            ti3 = cc(i,3,k)+cc(i,4,k)
+            tr5 = cc(i-1,2,k)-cc(i-1,5,k)
+            tr2 = cc(i-1,2,k)+cc(i-1,5,k)
+            tr4 = cc(i-1,3,k)-cc(i-1,4,k)
+            tr3 = cc(i-1,3,k)+cc(i-1,4,k)
+            ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3
+            ch(i,k,1) = cc(i,1,k)+ti2+ti3
+            cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3
+            ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3
+            cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3
+            ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3
+            cr5 = ti11*tr5+ti12*tr4
+            ci5 = ti11*ti5+ti12*ti4
+            cr4 = ti12*tr5-ti11*tr4
+            ci4 = ti12*ti5-ti11*ti4
+            dr3 = cr3-ci4
+            dr4 = cr3+ci4
+            di3 = ci3+cr4
+            di4 = ci3-cr4
+            dr5 = cr2+ci5
+            dr2 = cr2-ci5
+            di5 = ci2-cr5
+            di2 = ci2+cr5
+            ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2
+            ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2
+            ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3
+            ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3
+            ch(i-1,k,4) = wa3(i-1)*dr4+wa3(i)*di4
+            ch(i,k,4) = wa3(i-1)*di4-wa3(i)*dr4
+            ch(i-1,k,5) = wa4(i-1)*dr5+wa4(i)*di5
+            ch(i,k,5) = wa4(i-1)*di5-wa4(i)*dr5
+  103    continue
+  104 continue
+      end 
diff --git a/external_functions/romea/rr_density.F b/external_functions/romea/rr_density.F
new file mode 100644
index 0000000..b3b2adc
--- /dev/null
+++ b/external_functions/romea/rr_density.F
@@ -0,0 +1,51 @@
+c	rr_density.F
+c
+c     Rick Romea
+c           Jan. 4, 2000
+c
+c  Returns density from in-situ temperature,
+c  salinity, & depth using the UNESCO equation of state
+c
+c      call RR_unesco(temp,salinity,pressure,density)
+c
+c     input:
+c       temp             in-situ temperature  [deg C]
+c       salinity:        practical salinity units [approx. = ppt]
+c       pressure:        bars
+c     output:
+c       density:         Kg/m^3
+c
+c***********************************************************************
+
+      SUBROUTINE RR_unesco (t, s, p, rho)
+      IMPLICIT NONE
+      REAL   t,s,p,rho
+      REAL*8 rw,rsto,xkw,xksto,xkstp 
+      rw =     9.99842594d2 + 6.793952d-2*t - 9.095290d-3*t**2
+     &        + 1.001685d-4*t**3 - 1.120083d-6*t**4 + 6.536332d-9*t**5
+      rsto =   rw + (8.24493d-1 - 4.0899d-3*t + 7.6438d-5*t**2
+     &        - 8.2467d-7*t**3 + 5.3875d-9*t**4) * s
+     &       + (-5.72466d-3 + 1.0227d-4*t - 1.6546d-6*t**2) * s**1.5d0
+     &       + 4.8314d-4 * s**2
+      xkw =     1.965221d4 + 1.484206d2*t - 2.327105d0*t**2 +
+     &         1.360477d-2*t**3 - 5.155288d-5*t**4
+      xksto =   xkw + (5.46746d1 - 6.03459d-1*t + 1.09987d-2*t**2
+     &        - 6.1670d-5*t**3) * s
+     &       + (7.944d-2 + 1.6483d-2*t - 5.3009d-4*t**2) * s**1.5d0
+      xkstp =   xksto + (3.239908d0 + 1.43713d-3*t + 1.16092d-4*t**2
+     &        - 5.77905d-7*t**3) * p
+     &       + (2.2838d-3 - 1.0981d-5*t - 1.6078d-6*t**2) * p * s
+     &       + 1.91075d-4 * p * s**1.5d0
+     &       + (8.50935d-5 - 6.12293d-6*t + 5.2787d-8*t**2) * p**2
+     &       + (-9.9348d-7 + 2.0816d-8*t + 9.1697d-10*t**2) * p**2 * s
+      rho = SNGL(rsto / (1.d0 - p/xkstp)) 
+      END
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_sx.F b/external_functions/romea/rr_diff_sx.F
new file mode 100644
index 0000000..8ea699d
--- /dev/null
+++ b/external_functions/romea/rr_diff_sx.F
@@ -0,0 +1,233 @@
+*           rr_diff_sx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Zonal diffusive term: A S_xx
+*     Units :  (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_sx_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Ah d^2S/dx^2 diffusive term (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, required to access the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     .  'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     .  '(SALINITY(ppt) - 35)/1000')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_sx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu,xjt,ah_cstdxur
+      REAL cst,diff_fe,cstdxtr,diff_cet
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c  MOM2 Code:
+c
+c   DIFF_Tx(i,k,j) = (diff_fe(i,k,j) - diff_fe(i-1,k,j)) * cstdxtr(i,j)
+c
+c     diff_fe(i,k,j) = ah_cstdxur(i,j) * (t(i+1,k,j,n) - t(i,k,j,n))
+c     cstdxtr(i,j)   = cstr(j) * dxtr(i)
+c
+c       ah_cstdxur(i,j) = diff_cet(j) * cstr(j) * dxur(i)
+c
+c          diff_cet(j)  = ah*xjt(j)
+c
+c             ah = constant lateral diffusion coeff for tracers
+c                   ah = 2.e7(cm**2/sec)
+c             xjt(j) = 3.166 * dyt(j) * dytr(50) - 2.166
+c      
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dytr    = reciprocal of "dyt"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c 
+c     cst     = cosine of "t" grid point latitude
+c               cst(j)  = cos(phit(j))
+c     cstr    = reciprocal of "cst"
+c
+c        n = 1 => temperature
+c        n = 2 => salinity
+c
+c*********************************************************************
+
+      !  Statement functions
+
+      dxt(iLon) = SNGL(xU(iLon)-xU(iLon-1))*Longitude_to_cm
+      dyt(iLat) = SNGL(yU(iLat)-yU(iLat-1))*Latitude_to_cm
+      dxu(iLon) = SNGL(xT(iLon+1)-xT(iLon))*Longitude_to_cm
+      xjt(iLat) = 3.166*dyt(iLat)/dyt_ref-2.166
+      cst(iLat) = cos(SNGL(yT(iLat))*Degrees_to_radians) 
+      diff_cet(iLat) = ah*xjt(iLat)
+      ah_cstdxur(iLon,iLat) = diff_cet(iLat)/cst(iLat)/dxu(iLon)
+      cstdxtr(iLon,iLat) = 1./cst(iLat)/dxt(iLon)
+      diff_fe(i,j,k,l,iLon,iLat) = ah_cstdxur(iLon,iLat) 
+     .              * (arg_2(i+1,j,k,l) - arg_2(i,j,k,l))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               iLon = 2
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                   (diff_fe(i2  ,j2,k2,l2,iLon,iLat)
+     .                  - diff_fe(i2-1,j2,k2,l2,iLon-1,iLat))
+     .                      * cstdxtr(iLon,iLat) *sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_sy.F b/external_functions/romea/rr_diff_sy.F
new file mode 100644
index 0000000..f261ac2
--- /dev/null
+++ b/external_functions/romea/rr_diff_sy.F
@@ -0,0 +1,218 @@
+*           rr_diff_sy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Meridional diffusive term: A S_yy
+*     Units :    (SALINITY(ppm) - 0.035)/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_sy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Ah d^2S/dy^2 diffusive term (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, required to access the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     .  'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_sy_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         yT(1024)
+      INTEGER        ilat
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dyt,dyu,xjt
+      REAL cst,csu,diff_cnt,ahc_south,ahc_north
+     .               
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+c  MOM2 Code:
+c      DIFF_Ty(i,k,j) = ahc_north(j)*(t(i,k,j+1,n) - t(i,k,j,  n))
+c     &               - ahc_south(j)*(t(i,k,j  ,n) - t(i,k,j-1,n))
+c          ahc_north(j) = diff_cnt(j)*csu(j)*dyur(j)
+c     &                            *cstr(j)*dytr(j)
+c          ahc_south(j) = diff_cnt(j)*csu(j-1)*dyur(j-1)
+c     &                            *cstr(j)*dytr(j)
+c          diff_cnt(j)  = ah*xjt(j)
+c          xjt(j) = 3.166*dyt(j)*dytr(50)-2.166
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dytr   = reciprocal of "dyt"
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+c     dyur    = reciprocal of "dyu"
+c
+c     ah     = constant lateral diffusion coeff for tracers(cm**2/sec) 
+c               ah = 2.e7
+c     csu     = cosine of "u,v" grid point latitude
+c               csu(j)  = cos(phiu(j))
+c     cst     = cosine of "t" grid point latitude
+c               cst(j)  = cos(phit(j))
+c     cstr    = reciprocal of "cst"
+c     n = 1 => temperature
+c     n = 2 => salinity
+c*********************************************************************
+
+      !  Statement functions
+
+      dyt(iLat) = SNGL(yU(iLat)-yU(iLat-1))*Latitude_to_cm
+      dyu(iLat) = SNGL(yT(iLat+1)-yT(iLat))*Latitude_to_cm
+      xjt(iLat) = 3.166*dyt(iLat)/dyt_ref-2.166
+      diff_cnt(iLat) = ah*xjt(iLat)
+      cst(iLat) = cos(SNGL(yT(iLat))*Degrees_to_radians) 
+      csu(iLat) = cos(SNGL(yU(iLat))*Degrees_to_radians) 
+      ahc_south(iLat) = diff_cnt(iLat)*csu(iLat-1)
+     .                         /cst(iLat)/dyu(iLat)/dyt(iLat)
+      ahc_north(iLat) = diff_cnt(iLat)*csu(iLat)
+     .                         /cst(iLat)/dyu(iLat)/dyt(iLat)
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2
+            j2 = arg_lo_ss(Y_AXIS,ARG2) 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                  ahc_north(iLat)*
+     .                    (  arg_2(i2,j2+1,k2,l2)
+     .                     - arg_2(i2,j2  ,k2,l2))
+     .                - ahc_south(iLat)*
+     .                    (  arg_2(i2,j2  ,k2,l2) 
+     .                     - arg_2(i2,j2-1,k2,l2))
+     .                             )*sec_per_month
+                  ENDIF
+
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_sz.F b/external_functions/romea/rr_diff_sz.F
new file mode 100644
index 0000000..b0261ee
--- /dev/null
+++ b/external_functions/romea/rr_diff_sz.F
@@ -0,0 +1,455 @@
+*     rr_diff_sz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000  
+*
+*     Zonal diffusive term:  [Az S_z]_z
+*     Units : (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid : T   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_sz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     . 'd(Az dS/dz)/dz diffusive term (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 5)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      ! Define forth argument (SALT)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG4,
+     . 'Salinity, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG4, '(ppt-35)/1000')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG4, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Z_AXIS,0,+1)
+
+      ! Define fifth argument (SFLX)
+
+      CALL ef_set_arg_name         (id, ARG5, 'SFLX')
+      CALL ef_set_arg_desc         (id, ARG5,
+     . 'Surface salt flux.')
+      CALL ef_set_arg_unit         (id, ARG5, 'g/cm^2/sec')
+      CALL ef_set_arg_type         (id, ARG5, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG5, NO, NO, NO,YES)
+      CALL ef_set_axis_extend      (id, ARG5, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG5, Y_AXIS,-1,+1)
+
+      ! Define a work array
+
+      CALL ef_set_num_work_arrays  (id, 1)
+
+      END 
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_sz_work_size(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER res_lo_ss (4)
+      INTEGER res_hi_ss (4)
+      INTEGER res_incr  (4)
+      CALL ef_get_res_subscripts  (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_set_work_array_dims (id, 1,  
+     .    res_lo_ss(1),  res_lo_ss(2), res_lo_ss(3),  res_lo_ss(4),
+     .    res_hi_ss(1),  res_hi_ss(2), res_hi_ss(3),  res_hi_ss(4) )
+      END
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_sz_compute(id, 
+     .             arg_1,arg_2,arg_3,arg_4,arg_5,result,wrk_1)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                       mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                       mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                       mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           arg_5  (mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .                       mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      REAL           wrk_1  (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i4, j4, k4, l4
+      INTEGER        i5, j5, k5, l5
+
+      REAL*8         zT(1024)
+      REAL*8         zU(1024)
+  
+      INTEGER        iZ
+
+      REAL get_dzw,dzw,dzt,diff_fb,rhom1z,riu,Ri,Potential_density
+
+	INCLUDE 'rr_parameters.h'
+
+c*********************************************************************
+c     THIS IS THE MOM2 CODE:
+c
+c      DIFF_Tz(i,k,j) = (diff_fb(i,k-1,j) - diff_fb(i,k,j))*dztr(k)
+c
+c         diff_fb(i,k,j) = diff_cbt(i,k,j)*dzwr(k)*
+c     &                         (t(i,k,j,n) - t(i,k+1,j,n))
+c         diff_fb(i,0,j)  = stf(i,j,n)
+c     dzt    = thickness of "t" grid cells (cm)
+c     dztr   = reciprocal of "dzt"
+c     dzw(0) = zT(1)
+c     dzw(k) = zT(k+1)-zT(k)
+c
+c     diff_cbt = diffusion coefficient at bottom of "t" cells (cm**2/s)
+c     diff_cbt_back  = background diffusion coefficient (cm**2/s)=0.1
+c     fricmx         = maximum  diffusion coefficient (cm**2/s)  = 50.
+c     diff_cbt_limit = largest diffusion coefficient (cm**2/sec) = fricmx
+c     wndmix         = min value for diffusion coefficient at surface to 
+c                     simulate high freq wind mixing. (cm**2/sec)  = 10.
+c     stf     = surface heat flux (cal/cm2/sec)
+c     Note: units: 
+c        stf = Salt Flux = g/cm2/sec
+c
+c     grav    = gravity (cm/sec**2)
+c     epsln   = small value: 1.e-25
+c
+c     rit(i,k,j) =   (riu(i,k,j)   + riu(i-1,k,j)
+c    &              + riu(i,k,j-1) + riu(i-1,k,j-1)) / 4.
+c     riu(i,k,j) = -grav/4.*dzw(k)*(rhom1z(i,k,j+1) + rhom1z(i+1,k,j+1) +
+c    &                            rhom1z(i,k,j)   + rhom1z(i+1,k,j)) /
+c    &  ((u(i,k,j,1)-u(i,k+1,j,1))**2+(u(i,k,j,2)-u(i,k+1,j,2))**2 +  epsln) 
+c     rhom1z(i,k,j) = ro(i,k,j) - ro(i,k+1,j)
+c
+c     t2   = 1/(1 + 5*rit(i,k,j))
+c     diff_cbt(i,k,j,1) = fricmx*t2**3 + diff_cbt_back
+c     if(rit(i,k,j).lt.0.)diff_cbt(i,k,j,1)=diff_cbt_limit
+c     if(diff_cbt(i,1,j,1).lt.wndmix)diff_cbt(i,1,j,1)=wndmix
+c*********************************************************************
+
+      !  Statement functions
+
+      dzw(iZ) =  get_dzw(iZ,zT) * Meters_to_cm
+      dzt(iZ) = (dzw(iZ-1) + dzw(iZ)) / 2.
+      diff_fb(i,j,k,l,iZ) = wrk_1(i,j,k,l)/dzw(iZ)  ! wrk_1=diff_cbt
+     .                 *(arg_4(i,j,k,l)-arg_4(i,j,k+1,l)) ! arg_4 = S
+      rhom1z(i3,j3,k3,l3,i4,j4,k4,l4) =
+     .        Potential_density(arg_3(i3,j3,k3  ,l3),
+     .                          arg_4(i4,j4,k4  ,l4))
+     .      - Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                          arg_4(i4,j4,k4+1,l4)) 
+
+      riu (i1,j1,k1,l1,
+     .     i2,j2,k2,l2,
+     .     i3,j3,k3,l3,
+     .     i4,j4,k4,l4, iZ) =  - gravity/4. * dzw(iZ) * (
+     .                  rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4) + 
+     .                  rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) +
+     .                  rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4) + 
+     .                  rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) ) /
+     .               ( (arg_1(i1,j1,k1,l1)-arg_1(i1,j1,k1+1,l1))**2 +
+     .                 (arg_2(i2,j2,k2,l2)-arg_2(i2,j2,k2+1,l2))**2 
+     .                        + epsln )
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+      CALL ef_get_coordinates    (id, ARG3, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG3),
+     .                            arg_hi_ss(Z_AXIS,ARG3), zT)
+
+       ! Compute the viscosity coefficients
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      l5 = arg_lo_ss(T_AXIS,ARG5) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         j4 = arg_lo_ss(Y_AXIS,ARG4) + 1
+         j5 = arg_lo_ss(Y_AXIS,ARG5) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            i4 = arg_lo_ss(X_AXIS,ARG4) + 1
+            i5 = arg_lo_ss(X_AXIS,ARG5) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               k4 = arg_lo_ss(Z_AXIS,ARG4)
+               k5 = arg_lo_ss(Z_AXIS,ARG5)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_4(i4,  j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_5(i5,  j5,  k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5+1,j5,  k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5-1,j5,  k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5,  j5+1,k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5+1,j5+1,k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5-1,j5+1,k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5,  j5-1,k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5+1,j5-1,k5,l5) .EQ. bad_flag(ARG5) .OR.
+     .                arg_5(i5-1,j5-1,k5,l5) .EQ. bad_flag(ARG5) 
+     .                 )THEN
+                     wrk_1(i,j,k,l) = bad_flag_result
+                  ELSE
+                     Ri = (
+     .                     Riu  (i1,j1,k1,l1,
+     .                           i2,j2,k2,l2,
+     .                           i3,j3,k3,l3,
+     .                           i4,j4,k4,l4, iZ) 
+     .                       +
+     .                     Riu  (i1-1,j1,k1,l1,
+     .                           i2-1,j2,k2,l2,
+     .                           i3-1,j3,k3,l3,
+     .                           i4-1,j4,k4,l4, iZ) 
+     .                       +
+     .                     Riu  (i1,j1-1,k1,l1,
+     .                           i2,j2-1,k2,l2,
+     .                           i3,j3-1,k3,l3,
+     .                           i4,j4-1,k4,l4, iZ) 
+     .                       +
+     .                     Riu  (i1-1,j1-1,k1,l1,
+     .                           i2-1,j2-1,k2,l2,
+     .                           i3-1,j3-1,k3,l3,
+     .                           i4-1,j4-1,k4,l4, iZ) 
+     .                      ) / 4.
+
+                     ! Diffusion coefficient
+
+                     IF(Ri.lt.0.)THEN
+                        wrk_1(i,j,k,l) = diff_cbt_limit  ! unstable
+                     ELSE
+                        wrk_1(i,j,k,l) = fricmx/(1.+5.*Ri)**3
+     .                                      + diff_cbt_back
+                     ENDIF
+                     IF(k1.EQ.1.AND.wrk_1(i,j,k,l).lt.wndmix)THEN
+                        wrk_1(i,j,k,l)=wndmix ! surface
+                     ENDIF
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                  k4 = k4 + arg_incr(Z_AXIS,ARG4)
+                  k5 = k5 + arg_incr(Z_AXIS,ARG5)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+               i4 = i4 + arg_incr(X_AXIS,ARG4)
+               i5 = i5 + arg_incr(X_AXIS,ARG5)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+            j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         ENDDO               
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         l4 = l5 + arg_incr(T_AXIS,ARG5)
+      ENDDO
+
+      ! Now compute the term
+      
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j5 = arg_lo_ss(Y_AXIS,ARG5) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i5 = arg_lo_ss(X_AXIS,ARG5) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k5 = arg_lo_ss(Z_AXIS,ARG5)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF(wrk_1(i,j,k,l).EQ.bad_flag_result .OR. 
+     .                arg_1(i1,j1,k1+1,l1).EQ.bad_flag(ARG1))THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                    IF (k1.EQ.1) THEN  ! Top term is wind stress term
+                       result(i,j,k,l) = (   arg_5(i5,j5,k5,l5)
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ)  )
+     .                                     /dzt(iZ) * sec_per_month 
+                    ELSE
+                       result(i,j,k,l) = ( diff_fb(i1,j1,k1-1,l1,iZ-1)
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ) )
+     .                                     /dzt(iZ) * sec_per_month 
+                    ENDIF
+
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k5 = k5 + arg_incr(Z_AXIS,ARG5)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i5 = i5 + arg_incr(X_AXIS,ARG5)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         ENDDO               
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+      ENDDO
+
+      END
+
+	! Density at one Bar 
+
+      REAL FUNCTION Potential_density(T,S)
+      IMPLICIT NONE
+      REAL T ! Potential Temperature  
+      REAL S ! ( SALINITY(ppt) - 35) / 1000 
+      REAL Pressure / 1.0 / ! Bar
+      REAL Sppt ! Salinity (ppt)     
+      Sppt = 1.e3*S+35.  ! Convert S: -->  ppt
+      CALL RR_unesco(T,Sppt,Pressure,Potential_density)
+      Potential_density = Potential_density*1.e-3  ! Convert:kg/m^3-->g/cm^3
+      END
+
+
+      REAL FUNCTION get_dzw(iZ,zT) 
+      IMPLICIT NONE
+      INTEGER iZ
+      REAL*8 zT(iZ+1) 
+      IF(iZ.EQ.0)THEN
+        get_dzw=SNGL(zT(1))
+      ELSE
+        get_dzw=SNGL(zT(iZ+1)-zT(iZ))
+      ENDIF
+      END
diff --git a/external_functions/romea/rr_diff_tx.F b/external_functions/romea/rr_diff_tx.F
new file mode 100644
index 0000000..d891e0c
--- /dev/null
+++ b/external_functions/romea/rr_diff_tx.F
@@ -0,0 +1,204 @@
+*           rr_diff_tx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal diffusive term: A T_xx
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_tx_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Ah d^2T/dx^2 diffusive term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .  IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok     (id, NO,NO,NO,NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, required to access the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      END
+
+
+      SUBROUTINE RR_diff_tx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER        id
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+      REAL dxt, dyt, dxu,xjt
+      REAL cst,diff_fe
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c  MOM2 Code:
+c
+c   DIFF_Tx(i,k,j) = (diff_fe(i,k,j) - diff_fe(i-1,k,j)) * cstdxtr(i,j)
+c
+c     diff_fe(i,k,j) = ah_cstdxur(i,j) * (t(i+1,k,j,n) - t(i,k,j,n))
+c     cstdxtr(i,j)   = cstr(j) * dxtr(i)
+c
+c       ah_cstdxur(i,j) = diff_cet(j) * cstr(j) * dxur(i)
+c
+c          diff_cet(j)  = ah*xjt(j)
+c
+c             ah = constant lateral diffusion coeff for tracers
+c                   ah = 2.e7(cm**2/sec)
+c             xjt(j) = 3.166 * dyt(j) * dytr(50) - 2.166
+c      
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dytr    = reciprocal of "dyt"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c
+c     cst     = cosine of "t" grid point latitude
+c               cst(j)  = cos(phit(j))
+c     cstr    = reciprocal of "cst"
+c
+c        n = 1 => temperature
+c        n = 2 => salinity
+c
+c*********************************************************************
+
+      dxt(i) = SNGL(xU(i)-xU(i-1))*Longitude_to_cm
+      dyt(j) = SNGL(yU(j)-yU(j-1))*Latitude_to_cm
+      dxu(i) = SNGL(xT(i+1)-xT(i))*Longitude_to_cm
+      cst(i) = cos(SNGL(yT(i))*Degrees_to_radians) 
+      xjt(i) = 3.166*dyt(i)/dyt_ref-2.166
+      diff_fe(i,j,k,l,iLon,iLat) =ah*xjt(iLat) /cst(iLat)/dxu(iLon)
+     .              *(arg_2(i+1,j,k,l)-arg_2(i,j,k,l))
+
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               iLon = 2
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                   (diff_fe(i2  ,j2,k2,l2,iLon,iLat)
+     .                  - diff_fe(i2-1,j2,k2,l2,iLon-1,iLat))
+     .                      /cst(iLat)/dxt(iLon)*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+               iLat = iLat + 1
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_ty.F b/external_functions/romea/rr_diff_ty.F
new file mode 100644
index 0000000..7f7b484
--- /dev/null
+++ b/external_functions/romea/rr_diff_ty.F
@@ -0,0 +1,213 @@
+*           rr_diff_ty.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the meridional diffusive term: A T_yy
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_ty_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Ah(d^2T/dy^2) diffusive term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, required to access the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     .     'Potential temperature, on MOM2 T Grid.')
+      CALL ef_set_arg_unit         (id, ARG2,  '(oC')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      END
+
+
+      SUBROUTINE RR_diff_ty_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         yT(1024)
+      INTEGER        ilat
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dyt,dyu,xjt
+      REAL cst,csu,diff_cnt,ahc_south,ahc_north
+     .               
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+c  MOM2 Code:
+c      DIFF_Ty(i,k,j) = ahc_north(j)*(t(i,k,j+1,n) - t(i,k,j,  n))
+c     &               - ahc_south(j)*(t(i,k,j  ,n) - t(i,k,j-1,n))
+c          ahc_north(j) = diff_cnt(j)*csu(j)*dyur(j)
+c     &                            *cstr(j)*dytr(j)
+c          ahc_south(j) = diff_cnt(j)*csu(j-1)*dyur(j-1)
+c     &                            *cstr(j)*dytr(j)
+c          diff_cnt(j)  = ah*xjt(j)
+c          xjt(j) = 3.166*dyt(j)*dytr(50)-2.166
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dytr   = reciprocal of "dyt"
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+c     dyur    = reciprocal of "dyu"
+c
+c     ah     = constant lateral diffusion coeff for tracers(cm**2/sec) 
+c               ah = 2.e7
+c     csu     = cosine of "u,v" grid point latitude
+c               csu(j)  = cos(phiu(j))
+c     cst     = cosine of "t" grid point latitude
+c               cst(j)  = cos(phit(j))
+c     cstr    = reciprocal of "cst"
+c     n = 1 => temperature
+c     n = 2 => salinity
+c*********************************************************************
+
+      !  Statement functions
+
+      dyt(iLat) = SNGL(yU(iLat)-yU(iLat-1))*Latitude_to_cm
+      dyu(iLat) = SNGL(yT(iLat+1)-yT(iLat))*Latitude_to_cm
+      xjt(iLat) = 3.166*dyt(iLat)/dyt_ref-2.166
+      diff_cnt(iLat) = ah*xjt(iLat)
+      cst(iLat) = cos(SNGL(yT(iLat))*Degrees_to_radians) 
+      csu(iLat) = cos(SNGL(yU(iLat))*Degrees_to_radians) 
+      ahc_south(iLat) = diff_cnt(iLat)*csu(iLat-1)
+     .                         /cst(iLat)/dyu(iLat)/dyt(iLat)
+      ahc_north(iLat) = diff_cnt(iLat)*csu(iLat)
+     .                         /cst(iLat)/dyu(iLat)/dyt(iLat)
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                  ahc_north(iLat)*
+     .                    (  arg_2(i2,j2+1,k2,l2)
+     .                     - arg_2(i2,j2  ,k2,l2))
+     .                - ahc_south(iLat)*
+     .                    (  arg_2(i2,j2  ,k2,l2) 
+     .                     - arg_2(i2,j2-1,k2,l2))
+     .                             )*sec_per_month
+                  ENDIF
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+               iLat = iLat + 1
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_tz.F b/external_functions/romea/rr_diff_tz.F
new file mode 100644
index 0000000..c1508d1
--- /dev/null
+++ b/external_functions/romea/rr_diff_tz.F
@@ -0,0 +1,428 @@
+
+*     rr_diff_tz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000  
+*
+*     Zonal momentum diffusive term :  [Az T_z]_z
+*     Units :     oC/s
+*     MOM2 Grid :  T   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_tz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'d(Az dT/dz)/dz momentum diffusive term (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 5)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG4,
+     . 'Salinity, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG4, '(ppt-35)/1000')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG4, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG5, 'HFLX')
+      CALL ef_set_arg_desc         (id, ARG5,
+     . 'Surface heat flux.')
+      CALL ef_set_arg_unit         (id, ARG5, 'cal/cm^2/sec')
+      CALL ef_set_arg_type         (id, ARG5, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG5, NO, NO, NO,YES)
+      CALL ef_set_axis_extend      (id, ARG5, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG5, Y_AXIS,-1,+1)
+
+      END 
+
+
+      SUBROUTINE RR_diff_tz_compute(id, 
+     .             arg_1,arg_2,arg_3,arg_4,arg_5,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                       mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                       mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                       mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           arg_5  (mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .                       mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i4, j4, k4, l4
+      INTEGER        i5, j5, k5, l5
+
+      REAL*8         zT(1024)
+      REAL*8         zU(1024)
+  
+      INTEGER        iZ
+
+      REAL get_dzw,diff_fb,diff_cbt
+      REAL rhom1z,riu,Ri,Potential_density
+
+      INCLUDE 'rr_parameters.h'
+
+c  MOM2:  diff_fb(i,k,j)=diff_cbt(i,k,j)/dzw(k)*(t(i,k,j)-t(i,k+1,j))
+c         diff_cbt = diffusion coefficient at bottom of "t" cells (cm**2/s)
+c         dzw(k) = zT(k+1)-zT(k)
+
+      diff_fb(i,j,k,l,iZ) = diff_cbt/get_dzw(iZ,zT) 
+     .                 *(arg_3(i,j,k,l)-arg_3(i,j,k+1,l)) ! arg_3 = T
+
+c  MOM2:  rhom1z(i,k,j) = ro(i,k,j) - ro(i,k+1,j)
+
+      rhom1z(i3,j3,k3,l3,i4,j4,k4,l4) =
+     .        Potential_density(arg_3(i3,j3,k3  ,l3),   ! arg_3 = T
+     .                          arg_4(i4,j4,k4  ,l4))   ! arg_4 = S
+     .      - Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                          arg_4(i4,j4,k4+1,l4)) 
+
+c  MOM2:    grav    = gravity (cm/sec**2)
+c  MOM2:    epsln   = small value: 1.e-25
+     
+      ! rr_parameters.h :
+      !    REAL gravity = 980.6  cm/sec**2 
+      !    REAL epsln = 1.e-25
+ 
+c  MOM2:
+c     riu(i,k,j) = -grav/4.*dzw(k)*(rhom1z(i,k,j+1) + rhom1z(i+1,k,j+1) +
+c    &                            rhom1z(i,k,j)   + rhom1z(i+1,k,j)) /
+c    &  ((u(i,k,j,1)-u(i,k+1,j,1))**2+(u(i,k,j,2)-u(i,k+1,j,2))**2 +  epsln) 
+
+      riu (i1,j1,k1,l1,
+     .     i2,j2,k2,l2,
+     .     i3,j3,k3,l3,
+     .     i4,j4,k4,l4, iZ) =  - gravity/4. * get_dzw(iZ,zT) * (
+     .                  rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4) + 
+     .                  rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) +
+     .                  rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4) + 
+     .                  rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) ) /
+     .               ( (arg_1(i1,j1,k1,l1)-arg_1(i1,j1,k1+1,l1))**2 + !arg_1=U
+     .                 (arg_2(i2,j2,k2,l2)-arg_2(i2,j2,k2+1,l2))**2   !arg_2=V
+     .                        + epsln )
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+      CALL ef_get_coordinates    (id, ARG3, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG3),
+     .                            arg_hi_ss(Z_AXIS,ARG3), zT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         j4 = arg_lo_ss(Y_AXIS,ARG4) + 1
+         j5 = arg_lo_ss(Y_AXIS,ARG5) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            i4 = arg_lo_ss(X_AXIS,ARG4) + 1
+            i5 = arg_lo_ss(X_AXIS,ARG5) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               k4 = arg_lo_ss(Z_AXIS,ARG4)
+               k5 = arg_lo_ss(Z_AXIS,ARG5)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1,k1+1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_4(i4,  j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                (iZ .EQ. 1 .AND. 
+     .                    arg_5(i5,j5,k5,l5).EQ. bad_flag(ARG5))
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+
+
+c  MOM2:   rit(i,k,j)=(riu(i,k,j)+riu(i-1,k,j)+riu(i,k,j-1)+riu(i-1,k,j-1))/4
+
+                     Ri = (Riu(i1,  j1,  k1,l1, i2,  j2,  k2,l2,
+     .                         i3,  j3,  k3,l3, i4,  j4,  k4,l4,iZ) 
+     .                 +   Riu(i1-1,j1,  k1,l1, i2-1,j2,  k2,l2,
+     .                         i3-1,j3,  k3,l3, i4-1,j4,  k4,l4,iZ) 
+     .                 +   Riu(i1,  j1-1,k1,l1, i2,  j2-1,k2,l2,
+     .                         i3,  j3-1,k3,l3, i4,  j4-1,k4,l4,iZ) 
+     .                 +   Riu(i1-1,j1-1,k1,l1, i2-1,j2-1,k2,l2,
+     .                         i3-1,j3-1,k3,l3, i4-1,j4-1,k4,l4,iZ) 
+     .                      )/4.
+
+
+
+             ! Compute diffusion coefficient
+
+             ! REAL fricmx=maximum diffusion coefficient=50 cm**2/s 
+             ! REAL diff_cbt_limit=largest diffusion coefficient=50 cm**2/sec 
+             ! REAL diff_cbt_back=background diffusion coefficient=0.1 cm**2/s
+             ! REAL wndmix = min value for diffusion coefficient at surface to 
+             !               simulate high freq wind mixing = 10 cm**2/sec 
+             ! REAL Meters_to_cm = Convert: m --> cm = 100.
+             ! REAL sec_per_month = Time conversion :  Convert: month --> sec
+             !                      NOTE: sec_per_month currently set = 1, 
+             !                      so the function returns 
+             !                      oC/s, not oC/month
+
+c MOM2:   check stability: if(rit(i,k,j).lt.0.)diff_cbt(i,k,j,1)=diff_cbt_limit
+c                      diff_cbt(i,k,j,1) = fricmx*t2**3 + diff_cbt_back
+c                               t2 = 1/(1 + 5*rit(i,k,j))
+c         surface effect at top grid point:
+c                    if(diff_cbt(i,1,j,1).lt.wndmix)diff_cbt(i,1,j,1)=wndmix
+
+                     IF(Ri.lt.0.)THEN
+                        ! PRINT*,'WARNING::Ri<0.-->unstable'
+                        diff_cbt = diff_cbt_limit  ! unstable
+                     ELSE
+                        diff_cbt = fricmx/(1.+5.*Ri)**3
+     .                                      + diff_cbt_back
+                        IF(iZ.EQ.1.AND.diff_cbt.lt.wndmix)THEN
+                           !PRINT*,'surface flux pegged at wndmix'
+                           diff_cbt=wndmix   ! surface
+                        ENDIF
+                     ENDIF
+
+
+c  MOM2:
+c      DIFF_Tz(i,k,j) = (diff_fb(i,k-1,j) - diff_fb(i,k,j)) / dzt(k)
+c         diff_fb(i,0,j)  = stf(i,j,n)
+c     dzt    = thickness of "t" grid cells (cm)
+c     dzw(0) = zT(1)
+c     stf     = surface heat flux (cal/cm2/sec)
+c     Note: units: result(i,j,k,l)
+c        stf = Heat Flux/rho/Cp =(cal/cm2/sec)/(1 g/cm3)/(1. cal/g/oC)
+c            = oC-cm/sec
+
+                    IF (iZ.EQ.1) THEN  ! Top term is wind stress term
+                      result(i,j,k,l) = (   arg_5(i5,j5,k5,l5)  ! arg_5 = HFLX
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ)  )
+     .                /(SNGL(zT(1)+zT(2))/2.*Meters_to_cm)
+     .                         * sec_per_month 
+                    ELSE
+                       result(i,j,k,l) = ( diff_fb(i1,j1,k1-1,l1,iZ-1)
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ) )
+     .                /(SNGL(zT(iZ+1)-zT(iZ-1))/2. * Meters_to_cm)
+     .                         * sec_per_month 
+                    ENDIF
+
+
+!          GOTO 1009 
+          PRINT*
+          PRINT*
+          PRINT*,'i,j,k,l     = ', i,j,k,l
+          PRINT*,'i1,j1,k1,l1 = ', i1,j1,k1,l1
+          PRINT*,'i2,j2,k2,l2 = ', i2,j2,k2,l2
+          PRINT*,'i3,j3,k3,l3 = ', i3,j3,k3,l3
+          PRINT*,'i4,j4,k4,l4 = ', i4,j4,k4,l4
+          PRINT*,'i5,j5,k5,l5 = ', i5,j5,k5,l5
+          PRINT*,'iZ             = ',iZ
+          PRINT*,'zT(iZ)         = ',zT(iZ)
+          PRINT*,'get_dzw(iZ,zT) = ',get_dzw(iZ,zT)
+          PRINT*,'T(i3,j3,k3  ,l3) = ', arg_3(i3,j3,k3  ,l3)
+          PRINT*,'S(i4,j4,k4  ,l4) = ', arg_4(i4,j4,k4  ,l4)
+          PRINT*,'T(i3,j3,k3+1,l3) = ', arg_3(i3,j3,k3+1,l3)
+          PRINT*,'S(i4,j4,k4+1,l4) = ', arg_4(i4,j4,k4+1,l4) 
+          PRINT*,'T(i3+1,j3,k3  ,l3) = ', arg_3(i3+1,j3,k3  ,l3)
+          PRINT*,'S(i4+1,j4,k4  ,l4) = ', arg_4(i4+1,j4,k4  ,l4)
+          PRINT*,'T(i3+1,j3,k3+1,l3) = ', arg_3(i3+1,j3,k3+1,l3)
+          PRINT*,'S(i4+1,j4,k4+1,l4) = ', arg_4(i4+1,j4,k4+1,l4) 
+          PRINT*,'T(i3,j3+1,k3  ,l3) = ', arg_3(i3,j3+1,k3  ,l3)
+          PRINT*,'S(i4,j4+1,k4  ,l4) = ', arg_4(i4,j4+1,k4  ,l4)
+          PRINT*,'T(i3,j3+1,k3+1,l3) = ', arg_3(i3,j3+1,k3+1,l3)
+          PRINT*,'S(i4,j4+1,k4+1,l4) = ', arg_4(i4,j4+1,k4+1,l4) 
+          PRINT*,'T(i3+1,j3+1,k3  ,l3) = ', arg_3(i3+1,j3+1,k3  ,l3)
+          PRINT*,'S(i4+1,j4+1,k4  ,l4) = ', arg_4(i4+1,j4+1,k4  ,l4)
+          PRINT*,'T(i3+1,j3+1,k3+1,l3) = ', arg_3(i3+1,j3+1,k3+1,l3)
+          PRINT*,'S(i4+1,j4+1,k4+1,l4) = ', arg_4(i4+1,j4+1,k4+1,l4) 
+          PRINT*,'Potential_density(1) = ',
+     .           Potential_density(arg_3(i3,j3,k3  ,l3),   ! arg_3 = T
+     .                             arg_4(i4,j4,k4  ,l4))   ! arg_4 = S
+          PRINT*,'Potential_density(2) = ',
+     .           Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                             arg_4(i4,j4,k4+1,l4)) 
+          PRINT*,'rhom1z(1) = ',rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4)  
+          PRINT*,'rhom1z(2) = ',rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) 
+          PRINT*,'rhom1z(3) = ',rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4)  
+          PRINT*,'rhom1z(4) = ',rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) 
+          PRINT*,'Riu(1) = ',Riu(i1, j1, k1,l1, i2, j2, k2,l2,
+     .                         i3,  j3,  k3,l3, i4,  j4,  k4,l4,iZ)
+          PRINT*,'Riu(2) = ',Riu(i1-1,j1,  k1,l1, i2-1,j2,  k2,l2,
+     .                         i3-1,j3,  k3,l3, i4-1,j4,  k4,l4,iZ)
+          PRINT*,'Riu(3) = ',Riu(i1,  j1-1,k1,l1, i2,  j2-1,k2,l2,
+     .                         i3,  j3-1,k3,l3, i4,  j4-1,k4,l4,iZ)
+          PRINT*,'Riu(4) = ',Riu(i1-1,j1-1,k1,l1, i2-1,j2-1,k2,l2,
+     .                         i3-1,j3-1,k3,l3, i4-1,j4-1,k4,l4,iZ) 
+          PRINT*,'Ri     = ',Ri
+          PRINT*,'HFLX   = ',arg_5(i5,j5,k5,l5)
+          PRINT*,'diff_cbt = ',diff_cbt
+          PRINT*,'diff_fb  = ',diff_fb(i1,j1,k1,l1,iZ)
+          PRINT*,'result   = ',result(i,j,k,l)
+          PRINT*,'SNGL(zT(1)+zT(2))/2.*Meters_to_cm',
+     .           SNGL(zT(1)+zT(2))/2.*Meters_to_cm
+          PRINT* 
+          PRINT*,'*******************************************'
+          PRINT*
+ 1009     CONTINUE
+
+                  ENDIF
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                  k4 = k4 + arg_incr(Z_AXIS,ARG4)
+                  k5 = k5 + arg_incr(Z_AXIS,ARG5)
+               ENDDO
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+               i4 = i4 + arg_incr(X_AXIS,ARG4)
+               i5 = i5 + arg_incr(X_AXIS,ARG5)
+            ENDDO
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+            j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         ENDDO               
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)      
+      ENDDO
+      END
+
+
+
+
+      REAL FUNCTION Potential_density(T,S) ! Density at one Bar 
+      IMPLICIT NONE
+      REAL T ! Potential Temperature  
+      REAL S ! ( SALINITY(ppt) - 35) / 1000 
+      REAL Pressure / 1.0 / ! Bar
+      REAL Sppt ! Salinity (ppt)     
+      Sppt = 1.e3*S+35.  ! Convert S: -->  ppt
+      CALL RR_unesco(T,Sppt,Pressure,Potential_density)
+      Potential_density = Potential_density*1.e-3  ! Convert:kg/m^3-->g/cm^3
+      END						
+
+      REAL FUNCTION get_dzw(iZ,zT) 
+      IMPLICIT NONE
+      INCLUDE 'rr_parameters.h'
+      INTEGER iZ
+      REAL*8 zT(iZ+1)
+      IF(iZ.EQ.0)THEN
+	get_dzw=SNGL(zT(1))*Meters_to_cm 
+      ELSE
+        get_dzw=SNGL(zT(iZ+1)-zT(iZ))*Meters_to_cm
+      ENDIF
+      END
+
+
diff --git a/external_functions/romea/rr_diff_umetric.F b/external_functions/romea/rr_diff_umetric.F
new file mode 100644
index 0000000..674fc40
--- /dev/null
+++ b/external_functions/romea/rr_diff_umetric.F
@@ -0,0 +1,219 @@
+*           rr_diff_umetric.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal momentum diffusive metric term  
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_umetric_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Zonal momentum diffusive metric (cm/s^2); MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      END
+
+
+      SUBROUTINE RR_diff_umetric_compute(id, arg_1, arg_2, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      INTEGER        ilat,iLon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxmetr,csu,sine,tng,am3,am4,a3,a4
+
+      REAL*8         xU(1024)
+      REAL*8         yU(1024)
+
+      INCLUDE 'rr_parameters.h'
+
+C**********************************************************
+
+c MOM2 CODE:
+
+c     csu     = cosine of "u" grid point latitude
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     amix    = am
+
+c      DIFF_metric(i,k,j,n) = am3(j)*u(i,k,j,n) + am4(j,n)*dxmetr(i)
+c     &                    *(u(i+1,k,j,3-n) - u(i-1,k,j,3-n))
+
+c      am3(j)   =  amix*(1-tng(j)*tng(j))/(radius**2)
+c      am4(j,1) = -amix*2*sine(j)/(radius*csu(j)*csu(j))
+c      am4(j,2) = -am4(j,1)
+     
+c      tng(j)   = sine(j)/csu(j)
+c      sine(j)  = sin(phi(j))
+c      dxmetr(i) = 1 / (dxt(i) + dxt(i+1))
+
+C***************************************************
+
+
+      dxt(iLon)    = SNGL(xU(iLon)-xU(iLon-1))*Longitude_to_cm
+      dxmetr(iLon) = 1. / (dxt(iLon) + dxt(iLon+1))
+
+      csu(iLat)  = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+      sine(iLat) = sin(SNGL(yU(iLat)) * Degrees_to_radians)
+      tng(iLat)  = sine(iLat)/csu(iLat)
+      am3(iLat)  =  am*(1-tng(iLat)*tng(iLat))/(RR_radius**2)
+      am4(iLat)  = -am*2.*sine(iLat)/(RR_radius*csu(iLat)*csu(iLat))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), YU)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 1  
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            j2 = arg_lo_ss(Y_AXIS,ARG2)
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               
+               a3 = am3(iLat)
+               a4 = am4(iLat)
+
+               iLon = 1
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               i2 = arg_lo_ss(X_AXIS,ARG2)
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2+1,j2,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( 
+     .                    a3*arg_1(i1,j1,k1,l1)
+     .                  + a4*dxmetr(iLon)
+     .                     *(arg_2(i2+1,j2,k2,l2)-
+     .                       arg_2(i2-1,j2,k2,l2)) 
+     .                              ) * sec_per_month
+                  ENDIF
+
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_ux.F b/external_functions/romea/rr_diff_ux.F
new file mode 100644
index 0000000..20e2c43
--- /dev/null
+++ b/external_functions/romea/rr_diff_ux.F
@@ -0,0 +1,236 @@
+*           rr_diff_ux.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Zonal momemtum diffusive term :  Am u_xx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_ux_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Am(d^2u/dx^2) momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_ux_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxu, dyt
+      REAL diff_fe 
+      REAL csu,xjt
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C
+c
+c     csu     = cosine of "u" grid point latitude
+c     csur    = reciprocal of "csu"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+c
+c     am      = constant lateral viscosity coeff for momentum (input)
+c
+C     DIFF_Ux(i,k,j)  =(diff_fe(i,k,j)-diff_fe(i-1,k,j))*csudxur(i,j)
+C     csudxur(i,j)    = csur(j)*dxur(i)
+C     diff_fe(i,k,j)  = am_csudxtr(i,j)*(u(i+1,k,j,n)-u(i,k,j,n))
+C     am_csudxtr(i,j) = am*xjt(j)*csur(j)*dxtr(i+1)
+C     xjt(j)          = 3.166*dyt(j)*dytr(50)-2.166
+C
+C
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      csu(i) = cos(SNGL(yU(i)) * Degrees_to_radians) 
+
+!      xjt(i) = 3.166*dyt(i)/dyt(50)-2.166
+      xjt(i) = 3.166*dyt(i)/dyt_ref-2.166
+
+
+      diff_fe(i,j,k,l,iLat,iLon) = am * xjt(iLat)/csu(iLat)/dxt(iLon)
+     .                  *(arg_1(i+1,j,k,l) - arg_1(i,j,k,l))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                   (diff_fe(i1,j1,k1,l1,iLat,iLon) - 
+     .                    diff_fe(i1-1,j1,k1,l1,iLat,iLon-1) ) 
+     .                       /dxu(iLon)/csu(iLat)*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_uy.F b/external_functions/romea/rr_diff_uy.F
new file mode 100644
index 0000000..768b97d
--- /dev/null
+++ b/external_functions/romea/rr_diff_uy.F
@@ -0,0 +1,255 @@
+*           rr_diff_uy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Zonal momemtum diffusive term :  Am u_yy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_uy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Am(d^2u/dy^2) momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_uy_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxu, dyt, dyu
+      REAL cst, csu, xjt
+      REAL amc_north,amc_south,visc_cnu,xjv
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+c
+
+c     csu     = cosine of "u" grid point latitude
+c     csur    = reciprocal of "csu"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+
+c     am      = constant lateral viscosity coeff for momentum (input)
+
+c     DIFF_Uy(i,k,j) = amc_north(j)*(u(i,k,j+1,n) - u(i,k,j  ,n))
+c    &               - amc_south(j)*(u(i,k,j  ,n) - u(i,k,j-1,n))
+c
+c     amc_north(j) = visc_cnu(j)*cst(j+1)*dytr(j+1)*csur(j)*dyur(j)
+c     amc_south(j) = visc_cnu(j)*cst(j)  *dytr(j)  *csur(j)*dyur(j)
+c     visc_cnu(j)  = am * xjv(j)
+c     xjv(j)       = .5 * (xjt(j)+xjt(j+1))
+c     xjt(j)       = 3.166 * dyt(j) * dytr(50) - 2.166
+
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+      xjt(j) = 3.166*dyt(j)/dyt_ref-2.166
+      xjv(j) = .5 * (xjt(j)+xjt(j+1))
+      visc_cnu(j)  = am * xjv(iLat)
+      amc_north(j) = visc_cnu(j)*cst(j+1)/dyt(j+1)/csu(j)/dyu(j)
+      amc_south(j) = visc_cnu(j)*cst(j)  /dyt(j)  /csu(j)/dyu(j)
+
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                   amc_north(iLat)*
+     .                       (arg_1(i1,j1+1,k1,l1)-arg_1(i1,j1,k1,l1))
+     .                 - amc_south(iLat)*
+     .                       (arg_1(i1,j1  ,k1,l1)-arg_1(i1,j1-1,k1,l1))
+     .                              ) * sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_uz.F b/external_functions/romea/rr_diff_uz.F
new file mode 100644
index 0000000..e2391fa
--- /dev/null
+++ b/external_functions/romea/rr_diff_uz.F
@@ -0,0 +1,425 @@
+*     rr_diff_uz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Zonal momentum diffusive term :  [Az u_z]_z
+*     Units :     cm/s/s
+*     MOM2 Grid :  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_uz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'d(Az du/dz)/dz momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 5)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      ! Define forth argument (SALT)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG4,
+     . 'Salinity, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG4, '(ppt-35)/1000')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG4, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Z_AXIS,0,+1)
+
+      ! Define fifth argument (TAUX)
+
+      CALL ef_set_arg_name         (id, ARG5, 'TAUX')
+      CALL ef_set_arg_desc         (id, ARG5,
+     . 'Zonal wind stress.')
+      CALL ef_set_arg_unit         (id, ARG5, 'dynes/cm^2')
+      CALL ef_set_arg_type         (id, ARG5, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG5, NO, NO, NO,YES)
+      CALL ef_set_axis_extend      (id, ARG5, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG5, Y_AXIS,-1,+1)
+
+      ! Define a work array
+
+      CALL ef_set_num_work_arrays  (id, 1)
+
+      END 
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_uz_work_size(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER res_lo_ss (4)
+      INTEGER res_hi_ss (4)
+      INTEGER res_incr  (4)
+      CALL ef_get_res_subscripts  (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_set_work_array_dims (id, 1,  
+     .    res_lo_ss(1),  res_lo_ss(2), res_lo_ss(3),  res_lo_ss(4),
+     .    res_hi_ss(1),  res_hi_ss(2), res_hi_ss(3),  res_hi_ss(4) )
+      END
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_uz_compute(id, 
+     .             arg_1,arg_2,arg_3,arg_4,arg_5,result,wrk_1)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                       mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                       mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                       mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           arg_5  (mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .                       mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      REAL           wrk_1  (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i4, j4, k4, l4
+      INTEGER        i5, j5, k5, l5
+
+      REAL*8         zT(1024)
+      REAL*8         zU(1024)
+  
+      INTEGER        iZ
+
+      REAL get_dzw,dzw,dzt,diff_fb,rhom1z,Ri,Potential_density
+
+      INCLUDE 'rr_parameters.h'
+
+
+c*********************************************************************
+c     THIS IS THE MOM2 CODE:
+c
+c     dzt     = thickness of "t" grid cells (cm)
+c     dztr(k) = reciprocal of "dzt"
+c     dzw(k)  = vertical resolution of "w" grid cells (in cm)
+c     dzwr(k) = reciprocal of "dzw"
+c     visc_cbu       = viscosity coefficient at bottom of "u" cells (cm**2/s)
+c     wndmix         = min value for mixing at surface to 
+c                     simulate high freq wind mixing. (cm**2/sec)  = 10.
+c     smf     = surface momentum flux (dynes/cm**2)
+c                smf(1) = taux     smf(2) = tauy
+c     grav    = gravity (cm/sec**2)
+c     epsln   = small value: 1.e-25
+c
+c      DIFF_Uz(i,k,j) = (diff_fb(i,k-1,j)-diff_fb(i,k,j))*dztr(k)
+c      diff_fb(i,k,j) = visc_cbu(i,k,j)*dzwr(k)*(u(i,k,j,n)-u(i,k+1,j,n))
+c      diff_fb(i,0,j) = smf(i,j,n) ! taux (dynes/cm^3)
+c      t1                = 1./(1. + 5.*riu(i,k,j))
+c      visc_cbu(i,k,j)   = fricmx*t1**2 + visc_cbu_back
+c      if(riu(i,k,j).lt.0.)visc_cbu(i,k,j)=visc_cbu_limit ! unstable
+c      if(visc_cbu(i,1,j).lt.wndmix)visc_cbu(i,1,j)=wndmix ! surface
+c
+c      riu(i,k,j) = -grav/4.*dzw(k)*(rhom1z(i,k,j+1) + rhom1z(i+1,k,j+1) +
+c     &                            rhom1z(i,k,j)   + rhom1z(i+1,k,j)) /
+c     &  ((u(i,k,j,1)-u(i,k+1,j,1))**2+(u(i,k,j,2)-u(i,k+1,j,2))**2 +  epsln) 
+c      rhom1z(i,k,j) = ro(i,k,j) - ro(i,k+1,j)
+c
+c      do ks=1,2
+c        call statec (t(1,1,1,1,tlev), t(1,1,1,2,tlev), ro(1,1,jsmw)
+c     &,              max(js,jsmw), je, istrt-1, iend+1, ks)
+c*********************************************************************
+
+      !  Statement functions
+
+      dzw(iZ) =  get_dzw(iZ,zT) * Meters_to_cm
+      dzt(iZ) = (dzw(iZ-1) + dzw(iZ)) / 2.
+      diff_fb(i,j,k,l,iZ) = wrk_1(i,j,k,l)/dzw(iZ)  ! wrk_1=visc_cbu
+     .                 *(arg_1(i,j,k,l)-arg_1(i,j,k+1,l))
+      rhom1z(i3,j3,k3,l3,i4,j4,k4,l4) =
+     .        Potential_density(arg_3(i3,j3,k3  ,l3),
+     .                          arg_4(i4,j4,k4  ,l4))
+     .      - Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                          arg_4(i4,j4,k4+1,l4)) 
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+      CALL ef_get_coordinates    (id, ARG3, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG3),
+     .                            arg_hi_ss(Z_AXIS,ARG3), zT)
+
+       ! Compute the viscosity coefficients
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         j4 = arg_lo_ss(Y_AXIS,ARG4) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            i4 = arg_lo_ss(X_AXIS,ARG4) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               k4 = arg_lo_ss(Z_AXIS,ARG4)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                 
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_4(i4,  j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4-1,k4,l4) .EQ. bad_flag(ARG4)
+     .                 )THEN
+                     wrk_1(i,j,k,l) = bad_flag_result
+                  ELSE
+                     Ri = - gravity/4. * dzw(iZ) * (
+     .                  rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4) + 
+     .                  rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) +
+     .                  rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4) + 
+     .                  rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) ) /
+     .               ( (arg_1(i1,j1,k1,l1)-arg_1(i1,j1,k1+1,l1))**2 +
+     .                 (arg_2(i2,j2,k2,l2)-arg_2(i2,j2,k2+1,l2))**2 
+     .                        + epsln )
+
+                     ! Viscosity coefficient
+
+                     IF(Ri.lt.0.)THEN
+                        wrk_1(i,j,k,l) = visc_cbu_limit  ! unstable
+                     ELSE
+                        wrk_1(i,j,k,l) = fricmx/(1.+5.*Ri)**2
+     .                                      + visc_cbu_back
+                     ENDIF
+                     IF(k1.EQ.1.AND.wrk_1(i,j,k,l).lt.wndmix)THEN
+                        wrk_1(i,j,k,l)=wndmix ! surface
+                     ENDIF
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                  k4 = k4 + arg_incr(Z_AXIS,ARG4)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+               i4 = i4 + arg_incr(X_AXIS,ARG4)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         ENDDO               
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+      ENDDO
+
+      ! Now compute the term
+      
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j5 = arg_lo_ss(Y_AXIS,ARG5) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i5 = arg_lo_ss(X_AXIS,ARG5) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF(wrk_1(i,j,k,l).EQ. bad_flag_result)THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,j1,k1+1,l1) .EQ. bad_flag(ARG1) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                    IF (k.EQ.1) THEN  ! Top term is wind stress term
+                       IF (arg_5(i5,j5,k5,l5) .EQ. bad_flag(ARG5))THEN
+                          result(i,j,k,l) = bad_flag_result
+                       ELSE
+                          result(i,j,k,l) = (   arg_5(i5,j5,k5,l5)
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ)  )
+     .                                     /dzt(iZ) * sec_per_month 
+                       ENDIF
+                    ELSE
+                       result(i,j,k,l) = ( diff_fb(i1,j1,k1-1,l1,iZ-1)
+     .                                  -  diff_fb(i1,j1,k1,l1,iZ) )
+     .                                     /dzt(iZ) * sec_per_month 
+                    ENDIF
+
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i5 = i5 + arg_incr(X_AXIS,ARG5)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         ENDDO               
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+      ENDDO
+
+      END
+
+
+      ! Density at one Bar 
+
+      REAL FUNCTION Potential_density(T,S)
+      IMPLICIT NONE
+      REAL T ! Potential Temperature  
+      REAL S ! ( SALINITY(ppt) - 35) / 1000 
+      REAL Pressure / 1.0 / ! Bar
+      REAL Sppt ! Salinity (ppt)     
+      Sppt = 1.e3*S+35.  ! Convert S: -->  ppt
+      CALL RR_unesco(T,Sppt,Pressure,Potential_density)
+      Potential_density = Potential_density*1.e-3  ! Convert:kg/m^3-->g/cm^3
+      END
+
+
+	REAL FUNCTION get_dzw(iZ,zT) 
+      IMPLICIT NONE
+	INTEGER iZ
+      REAL*8 zT(iZ+1) 
+      IF(iZ.EQ.0)THEN
+	    get_dzw=SNGL(zT(1))
+      ELSE
+        get_dzw=SNGL(zT(iZ+1)-zT(iZ))
+      ENDIF
+	END
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_vmetric.F b/external_functions/romea/rr_diff_vmetric.F
new file mode 100644
index 0000000..4ad7c3c
--- /dev/null
+++ b/external_functions/romea/rr_diff_vmetric.F
@@ -0,0 +1,220 @@
+*           rr_diff_vmetric.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Meridional momentum diffusive metric term  
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_vmetric_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     . 'Meridional momentum diffusive metric (cm/s^2); MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+
+      END
+
+
+      SUBROUTINE RR_diff_vmetric_compute(id, arg_1, arg_2, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      INTEGER        ilat,iLon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxmetr,csu,sine,tng,am3,am4,a3,a4
+
+      REAL*8         xU(1024)
+      REAL*8         yU(1024)
+
+      INCLUDE 'rr_parameters.h'
+
+C**********************************************************
+c
+c MOM2 CODE:
+c
+c     csu     = cosine of "u" grid point latitude
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     amix    = am
+c
+c      DIFF_metric(i,k,j,n) = am3(j)*u(i,k,j,n) + am4(j,n)*dxmetr(i)
+c     &                    *(u(i+1,k,j,3-n) - u(i-1,k,j,3-n))
+c
+c      am3(j)   =  amix*(1-tng(j)*tng(j))/(radius**2)
+c      am4(j,1) = -amix*2*sine(j)/(radius*csu(j)*csu(j))
+c      am4(j,2) = -am4(j,1)
+c    
+c      tng(j)   = sine(j)/csu(j)
+c      sine(j)  = sin(phi(j))
+c      dxmetr(i) = 1 / (dxt(i) + dxt(i+1))
+c
+C***************************************************
+
+
+      dxt(iLon)    = SNGL(xU(iLon)-xU(iLon-1))*Longitude_to_cm
+      dxmetr(iLon) = 1. / (dxt(iLon) + dxt(iLon+1))
+ 
+      csu(iLat)  = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+      sine(iLat) = sin(SNGL(yU(iLat)) * Degrees_to_radians)
+      tng(iLat)  = sine(iLat)/csu(iLat)
+      am3(iLat)  =  am*(1-tng(iLat)*tng(iLat))/(RR_radius**2)
+      am4(iLat)  = -am*2.*sine(iLat)/(RR_radius*csu(iLat)*csu(iLat))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 1  
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            j2 = arg_lo_ss(Y_AXIS,ARG2)
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               
+               a3 = am3(iLat)
+               a4 = am4(iLat)
+
+               iLon = 1
+               i1 = arg_lo_ss(X_AXIS,ARG1)+1
+               i2 = arg_lo_ss(X_AXIS,ARG2)
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,k2,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( 
+     .                    a3*arg_2(i2,j2,k2,l2)
+     .                  - a4*dxmetr(iLon)
+     .                     *(arg_1(i1+1,j1,k1,l1)-
+     .                       arg_1(i1-1,j1,k1,l1)) 
+     .                              ) * sec_per_month
+                  ENDIF
+
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_vx.F b/external_functions/romea/rr_diff_vx.F
new file mode 100644
index 0000000..6bf1aae
--- /dev/null
+++ b/external_functions/romea/rr_diff_vx.F
@@ -0,0 +1,250 @@
+*           rr_diff_vx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Meridional momemtum diffusive term :  Am v_xx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_vx_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Am(d^2v/dx^2) momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_vx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxu, dyt
+      REAL diff_fe 
+      REAL csu,xjt
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C
+
+c     csu     = cosine of "u" grid point latitude
+c     csur    = reciprocal of "csu"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+
+c     am      = constant lateral viscosity coeff for momentum (input)
+
+C     DIFF_Ux(i,k,j)  =(diff_fe(i,k,j)-diff_fe(i-1,k,j))*csudxur(i,j)
+C     csudxur(i,j)    = csur(j)*dxur(i)
+C     diff_fe(i,k,j)  = am_csudxtr(i,j)*(u(i+1,k,j,n)-u(i,k,j,n))
+C     am_csudxtr(i,j) = am*xjt(j)*csur(j)*dxtr(i+1)
+C     xjt(j)          = 3.166*dyt(j)*dytr(50)-2.166
+C
+C
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      csu(i) = cos(SNGL(yU(i)) * Degrees_to_radians) 
+      xjt(i) = 3.166*dyt(i)/dyt_ref-2.166
+      diff_fe(i,j,k,l,iLat,iLon) = am * xjt(iLat)/csu(iLat)/dxt(iLon)
+     .                  *(arg_1(i+1,j,k,l) - arg_1(i,j,k,l))
+
+
+
+
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                   (diff_fe(i1,j1,k1,l1,iLat,iLon) - 
+     .                    diff_fe(i1-1,j1,k1,l1,iLat,iLon-1) ) 
+     .                       /dxu(iLon)/csu(iLat)*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_vy.F b/external_functions/romea/rr_diff_vy.F
new file mode 100644
index 0000000..06e579d
--- /dev/null
+++ b/external_functions/romea/rr_diff_vy.F
@@ -0,0 +1,255 @@
+*           rr_diff_vy.F
+*
+*           Rick Romea
+*           Jan.24, 2000
+*
+*     Meridional momemtum diffusive term :  Am v_yy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_vy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Am(d^2v/dy^2) momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_diff_vy_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dxu, dyt, dyu
+      REAL cst, csu, xjt
+      REAL amc_north,amc_south,visc_cnu,xjv
+
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+c
+c
+c     csu     = cosine of "u" grid point latitude
+c     csur    = reciprocal of "csu"
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dxur    = reciprocal of "dxu"
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxtr    = reciprocal of "dxt"
+c
+c     am      = constant lateral viscosity coeff for momentum (input)
+c
+c     DIFF_Uy(i,k,j) = amc_north(j)*(u(i,k,j+1,n) - u(i,k,j  ,n))
+c    &               - amc_south(j)*(u(i,k,j  ,n) - u(i,k,j-1,n))
+c
+c     amc_north(j) = visc_cnu(j)*cst(j+1)*dytr(j+1)*csur(j)*dyur(j)
+c     amc_south(j) = visc_cnu(j)*cst(j)  *dytr(j)  *csur(j)*dyur(j)
+c     visc_cnu(j)  = am * xjv(j)
+c     xjv(j)       = .5 * (xjt(j)+xjt(j+1))
+c     xjt(j)       = 3.166 * dyt(j) * dytr(50) - 2.166
+c
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      xjt(j) = 3.166*dyt(j)/dyt_ref-2.166
+      xjv(j) = .5 * (xjt(j)+xjt(j+1))
+      visc_cnu(j)  = am * xjv(iLat)
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+      amc_north(j) = visc_cnu(j)*cst(j+1)/dyt(j+1)/csu(j)/dyu(j)
+      amc_south(j) = visc_cnu(j)*cst(j)  /dyt(j)  /csu(j)/dyu(j)
+
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = (
+     .                   amc_north(iLat)*
+     .                       (arg_1(i1,j1+1,k1,l1)-arg_1(i1,j1,k1,l1))
+     .                 - amc_south(iLat)*
+     .                       (arg_1(i1,j1  ,k1,l1)-arg_1(i1,j1-1,k1,l1))
+     .                              ) * sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_diff_vz.F b/external_functions/romea/rr_diff_vz.F
new file mode 100644
index 0000000..67924d0
--- /dev/null
+++ b/external_functions/romea/rr_diff_vz.F
@@ -0,0 +1,418 @@
+*     rr_diff_vz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Meridional momentum diffusive term :  [Az v_z]_z
+*     Units :     cm/s/s
+*     MOM2 Grid :  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_diff_vz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'d(Az dv/dz)/dz momentum diffusive term (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 5)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      ! Define forth argument (SALT)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG4,
+     . 'Salinity, on MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG4, '(ppt-35)/1000')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG4, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG4, Z_AXIS,0,+1)
+
+      ! Define fifth argument (TAUY)
+
+      CALL ef_set_arg_name         (id, ARG5, 'TAUY')
+      CALL ef_set_arg_desc         (id, ARG5,
+     . 'Zonal wind stress.')
+      CALL ef_set_arg_unit         (id, ARG5, 'dynes/cm^2')
+      CALL ef_set_arg_type         (id, ARG5, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG5, NO, NO, NO,YES)
+      CALL ef_set_axis_extend      (id, ARG5, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG5, Y_AXIS,-1,+1)
+
+      ! Define a work array
+
+      CALL ef_set_num_work_arrays  (id, 1)
+
+      END 
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_vz_work_size(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER id
+      INTEGER res_lo_ss (4)
+      INTEGER res_hi_ss (4)
+      INTEGER res_incr  (4)
+      CALL ef_get_res_subscripts  (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_set_work_array_dims (id, 1,  
+     .    res_lo_ss(1),  res_lo_ss(2), res_lo_ss(3),  res_lo_ss(4),
+     .    res_hi_ss(1),  res_hi_ss(2), res_hi_ss(3),  res_hi_ss(4) )
+      END
+
+C*************************************************************************
+
+      SUBROUTINE RR_diff_vz_compute(id, 
+     .             arg_1,arg_2,arg_3,arg_4,arg_5,result,wrk_1)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                       mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                       mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                       mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                       mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           arg_5  (mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .                       mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      REAL           wrk_1  (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i4, j4, k4, l4
+      INTEGER        i5, j5, k5, l5
+
+      REAL*8         zT(1024)
+      REAL*8         zU(1024)
+  
+      INTEGER        iZ
+
+      REAL get_dzw,dzw,dzt,diff_fb,rhom1z,Ri,Potential_density
+
+      INCLUDE 'rr_parameters.h'
+
+c*********************************************************************
+c     THIS IS THE MOM2 CODE:
+c
+c     dzt     = thickness of "t" grid cells (cm)
+c     dztr(k) = reciprocal of "dzt"
+c     dzw(k)  = vertical resolution of "w" grid cells (in cm)
+c     dzwr(k) = reciprocal of "dzw"
+c     visc_cbu       = viscosity coefficient at bottom of "u" cells (cm**2/s)
+c     visc_cbu_back  = background viscosity (cm**2/s)  =  1.
+c     fricmx         = maximum viscosity    (cm**2/s)  = 50.
+c     visc_cbu_limit = largest viscosity (cm**2/sec) = fricmx
+c     wndmix         = min value for mixing at surface to 
+c                     simulate high freq wind mixing. (cm**2/sec)  = 10.
+c     smf     = surface momentum flux (dynes/cm**2)
+c                smf(1) = taux     smf(2) = tauy
+c     grav    = gravity (cm/sec**2)
+c     epsln   = small value: 1.e-25
+c
+c      DIFF_Uz(i,k,j) = (diff_fb(i,k-1,j)-diff_fb(i,k,j))*dztr(k)
+c      diff_fb(i,k,j) = visc_cbu(i,k,j)*dzwr(k)*(u(i,k,j,n)-u(i,k+1,j,n))
+c      diff_fb(i,0,j) = smf(i,j,n) ! taux (dynes/cm^3)
+c      t1                = 1./(1. + 5.*riu(i,k,j))
+c      visc_cbu(i,k,j)   = fricmx*t1**2 + visc_cbu_back
+c      if(riu(i,k,j).lt.0.)visc_cbu(i,k,j)=visc_cbu_limit ! unstable
+c      if(visc_cbu(i,1,j).lt.wndmix)visc_cbu(i,1,j)=wndmix ! surface
+c
+c      riu(i,k,j) = -grav/4.*dzw(k)*(rhom1z(i,k,j+1) + rhom1z(i+1,k,j+1) +
+c     &                            rhom1z(i,k,j)   + rhom1z(i+1,k,j)) /
+c     &  ((u(i,k,j,1)-u(i,k+1,j,1))**2+(u(i,k,j,2)-u(i,k+1,j,2))**2 +  epsln) 
+c      rhom1z(i,k,j) = ro(i,k,j) - ro(i,k+1,j)
+c
+c      do ks=1,2
+c        call statec (t(1,1,1,1,tlev), t(1,1,1,2,tlev), ro(1,1,jsmw)
+c     &,              max(js,jsmw), je, istrt-1, iend+1, ks)
+c*********************************************************************
+
+      !  Statement functions
+
+      dzw(iZ) =  get_dzw(iZ,zT) * Meters_to_cm
+      dzt(iZ) = (dzw(iZ-1) + dzw(iZ)) / 2.
+      diff_fb(i,j,k,l,iZ) = wrk_1(i,j,k,l)/dzw(iZ)  ! wrk_1=visc_cbu
+     .                 *(arg_2(i,j,k,l)-arg_2(i,j,k+1,l))
+      rhom1z(i3,j3,k3,l3,i4,j4,k4,l4) =
+     .        Potential_density(arg_3(i3,j3,k3  ,l3),
+     .                          arg_4(i4,j4,k4  ,l4))
+     .      - Potential_density(arg_3(i3,j3,k3+1,l3),
+     .                          arg_4(i4,j4,k4+1,l4)) 
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+      CALL ef_get_coordinates    (id, ARG3, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG3),
+     .                            arg_hi_ss(Z_AXIS,ARG3), zT)
+
+       ! Compute the viscosity coefficients
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         j4 = arg_lo_ss(Y_AXIS,ARG4) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            i4 = arg_lo_ss(X_AXIS,ARG4) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               k4 = arg_lo_ss(Z_AXIS,ARG4)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_4(i4,  j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4,  k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4+1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4,  j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4+1,j4-1,k4,l4) .EQ. bad_flag(ARG4) .OR.
+     .                arg_4(i4-1,j4-1,k4,l4) .EQ. bad_flag(ARG4)
+     .                  )THEN
+                     wrk_1(i,j,k,l) = bad_flag_result
+                  ELSE
+                     Ri = - gravity/4. * dzw(iZ) * (
+     .                  rhom1z(i3  ,j3+1,k3,l3,i4  ,j4+1,k4,l4) + 
+     .                  rhom1z(i3+1,j3+1,k3,l3,i4+1,j4+1,k4,l4) +
+     .                  rhom1z(i3  ,j3  ,k3,l3,i4  ,j4  ,k4,l4) + 
+     .                  rhom1z(i3+1,j3  ,k3,l3,i4+1,j4  ,k4,l4) ) /
+     .               ( (arg_1(i1,j1,k1,l1)-arg_1(i1,j1,k1+1,l1))**2 +
+     .                 (arg_2(i2,j2,k2,l2)-arg_2(i2,j2,k2+1,l2))**2 
+     .                        + epsln )
+
+                     ! Viscosity coefficient
+
+                     IF(Ri.lt.0.)THEN
+                        wrk_1(i,j,k,l) = visc_cbu_limit  ! unstable
+                     ELSE
+                        wrk_1(i,j,k,l) = fricmx/(1.+5.*Ri)**2
+     .                                      + visc_cbu_back
+                     ENDIF
+                     IF(k1.EQ.1.AND.wrk_1(i,j,k,l).lt.wndmix)THEN
+                        wrk_1(i,j,k,l)=wndmix ! surface
+                     ENDIF
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                  k4 = k4 + arg_incr(Z_AXIS,ARG4)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+               i4 = i4 + arg_incr(X_AXIS,ARG4)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         ENDDO               
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+      ENDDO
+
+      ! Now compute the term
+      
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j5 = arg_lo_ss(Y_AXIS,ARG5) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i5 = arg_lo_ss(X_AXIS,ARG5) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k5 = arg_lo_ss(Z_AXIS,ARG5)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF(wrk_1(i,j,k,l).EQ. bad_flag_result)THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF (arg_2(i2,j2,k2  ,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,j2,k2+1,l2) .EQ. bad_flag(ARG2) )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                    IF (k5.EQ.1) THEN  ! Top term is wind stress term
+                       IF (arg_5(i5,j5,k5,l5) .EQ. bad_flag(ARG5))THEN
+                          PRINT*,'BAD FLAG RESULT' 
+                          result(i,j,k,l) = bad_flag_result
+                       ELSE
+                          result(i,j,k,l) = (   arg_5(i5,j5,k5,l5)
+     .                                  -  diff_fb(i2,j2,k2,l2,iZ)  )
+     .                                     /dzt(iZ) * sec_per_month 
+                       ENDIF
+                    ELSE
+                       result(i,j,k,l) = ( diff_fb(i2,j2,k2-1,l2,iZ-1)
+     .                                  -  diff_fb(i2,j2,k2,l2,iZ) )
+     .                                     /dzt(iZ) * sec_per_month 
+                    ENDIF
+
+                  ENDIF
+
+                  iZ = iZ + 1 
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k5 = k5 + arg_incr(Z_AXIS,ARG5)
+               ENDDO
+
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i5 = i5 + arg_incr(X_AXIS,ARG5)
+            ENDDO
+
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         ENDDO               
+
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+      ENDDO
+
+      END
+
+
+      ! Density at one Bar 
+
+      REAL FUNCTION Potential_density(T,S)
+      IMPLICIT NONE
+      REAL T ! Potential Temperature  
+      REAL S ! ( SALINITY(ppt) - 35) / 1000 
+      REAL Pressure / 1.0 / ! Bar
+      REAL Sppt ! Salinity (ppt)     
+      Sppt = 1.e3*S+35.  ! Convert S: -->  ppt
+      CALL RR_unesco(T,Sppt,Pressure,Potential_density)
+      Potential_density = Potential_density*1.e-3  ! Convert:kg/m^3-->g/cm^3
+      END				  
+
+	REAL FUNCTION get_dzw(iZ,zT) 
+      IMPLICIT NONE
+	INTEGER iZ
+      REAL*8 zT(iZ+1) 
+      IF(iZ.EQ.0)THEN
+	    get_dzw=SNGL(zT(1))
+      ELSE
+        get_dzw=SNGL(zT(iZ+1)-zT(iZ))
+      ENDIF
+	END
diff --git a/external_functions/romea/rr_dsdt.F b/external_functions/romea/rr_dsdt.F
new file mode 100644
index 0000000..503d03b
--- /dev/null
+++ b/external_functions/romea/rr_dsdt.F
@@ -0,0 +1,153 @@
+*           rr_dsdt.F
+*
+*           Rick Romea
+*           Jan. 5, 2000
+*
+*     (Backward) time derivative of SALT
+*     Equation :  dSALT/dt = [ SALT(t) - SALT(t-1) ] / dt
+*     Units :     (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T  
+*
+*****************************************************************
+
+      SUBROUTINE RR_dsdt_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+      arg = 1
+
+      CALL ef_set_desc             (id,
+     .'d SALT/dt (Backward) time derivative (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, NO)
+      CALL ef_set_arg_name         (id, arg, 'SALT')
+      CALL ef_set_arg_desc         (id, arg,
+     . 'Salt, on the MOM2 T Grid.')
+      CALL ef_set_arg_unit         (id, arg,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, arg, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, arg, YES, YES, YES, YES)
+
+      !  Extend the time axis one point backward
+
+      CALL ef_set_axis_extend      (id, arg, T_AXIS,-1,0)
+      END
+
+
+      SUBROUTINE RR_dsdt_compute(id, arg_1, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result      
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         RR_times(1024)
+      LOGICAL        RR_badDt
+      REAL           RR_dt
+      REAL           RR_factor
+      INTEGER        iT
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, T_AXIS, 
+     .                            arg_lo_ss(T_AXIS,ARG1),
+     .                            arg_hi_ss(T_AXIS,ARG1), RR_times)
+
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+
+      IF (ax_units(4) .EQ. 'sec' ) THEN 
+         RR_factor = 1.
+      ELSEIF (ax_units(4) .EQ. 'min')THEN
+         RR_factor = 60.   
+      ELSEIF (ax_units(4) .EQ. 'hour' .OR. 
+     .        ax_units(4) .EQ. 'hours' )THEN
+         RR_factor = 3600.  
+      ELSEIF (ax_units(4) .EQ. 'day' .OR.
+     .        ax_units(4) .EQ. 'days'  )THEN
+         RR_factor = 86400. 
+      ELSE
+        WRITE (6,*)'Time axis units =', ax_units(4) 
+        !CALL ef_bail_out(id,
+        !.        'Time axis not specified as  sec, min, hour,or day.')
+      ENDIF
+
+      iT = 2
+      l1 = arg_lo_ss(T_AXIS,ARG1) + 1     ! Note: extended time axis
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         RR_dt =  SNGL(RR_times(iT) - RR_times(iT-1))
+         RR_badDt = RR_dt .EQ. 0.
+ 
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1)   .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,j1,k1,l1-1) .EQ. bad_flag(ARG1) .OR.
+     .                RR_badDt) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( arg_1(i1,j1,k1,l1)
+     .                    -   arg_1(i1,j1,k1,l1-1) ) / RR_dt
+     .                    / RR_factor	 * sec_per_month
+                  ENDIF
+               
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         ENDDO
+
+         iT = iT + 1
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_dtdt.F b/external_functions/romea/rr_dtdt.F
new file mode 100644
index 0000000..d3eeb05
--- /dev/null
+++ b/external_functions/romea/rr_dtdt.F
@@ -0,0 +1,152 @@
+*           rr_dTdt.F
+*
+*           Rick Romea
+*           Jan. 5, 2000
+*
+*     (Backward) time derivative of T
+*     Equation :  dT/dt = [ T(t) - T(t-1) ] / dt
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+********************************************************************
+
+      SUBROUTINE RR_dtdt_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+      arg = 1
+
+      CALL ef_set_desc             (id,
+     . 'dT/dt (Backward) time derivative(oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, NO)
+      CALL ef_set_arg_name         (id, arg, 'TEMP')
+      CALL ef_set_arg_desc         (id, arg,
+     . 'Potential Temperature, on the MOM2 T Grid.')
+      CALL ef_set_arg_unit         (id, arg, 'oC')
+      CALL ef_set_arg_type         (id, arg, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, arg, YES, YES, YES, YES)
+
+      !  Extend the time axis one point backward
+
+      CALL ef_set_axis_extend      (id, arg, T_AXIS,-1,0)
+      END
+
+
+      SUBROUTINE RR_dtdt_compute(id, arg_1, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      
+      INTEGER id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result      
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         RR_times(1024)
+      LOGICAL        RR_badDt
+      REAL           RR_dt
+      REAL           RR_factor
+      INTEGER        iT
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, T_AXIS, 
+     .                            arg_lo_ss(T_AXIS,ARG1),
+     .                            arg_hi_ss(T_AXIS,ARG1), RR_times)
+
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+
+      IF (ax_units(4) .EQ. 'sec' ) THEN 
+         RR_factor = 1.
+      ELSEIF (ax_units(4) .EQ. 'min')THEN
+         RR_factor = 60.   
+      ELSEIF (ax_units(4) .EQ. 'hour' .OR. 
+     .        ax_units(4) .EQ. 'hours' )THEN
+         RR_factor = 3600.  
+      ELSEIF (ax_units(4) .EQ. 'day' .OR.
+     .        ax_units(4) .EQ. 'days'  )THEN
+         RR_factor = 86400. 
+      ELSE
+        WRITE (6,*)'Time axis units =', ax_units(4) 
+        !CALL ef_bail_out(id,
+        !.   'Time axis not specified as  sec, min, hour,or day.')
+      ENDIF
+
+      iT = 2
+      l1 = arg_lo_ss(T_AXIS,ARG1) + 1     ! Note: extended time axis
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         RR_dt =  SNGL(RR_times(iT) - RR_times(iT-1))
+         RR_badDt = RR_dt .EQ. 0.
+ 
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1)   .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,j1,k1,l1-1) .EQ. bad_flag(ARG1) .OR.
+     .                RR_badDt) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( arg_1(i1,j1,k1,l1)
+     .                    -   arg_1(i1,j1,k1,l1-1) ) / RR_dt
+     .                    / RR_factor	 * sec_per_month
+                  ENDIF
+               
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         ENDDO
+
+	   iT = iT + 1
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_dudt.F b/external_functions/romea/rr_dudt.F
new file mode 100644
index 0000000..f486397
--- /dev/null
+++ b/external_functions/romea/rr_dudt.F
@@ -0,0 +1,153 @@
+*           rr_dudt.F
+*
+*           Rick Romea
+*           Jan. 5, 2000
+*
+*     (Backward) time derivative of u
+*     Equation :  du/dt = [ u(t) - u(t-1) ] / dt
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+******************************************************************
+
+      SUBROUTINE RR_dudt_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+      arg = 1
+
+      CALL ef_set_desc             (id,
+     .'du/dt (Backward) time derivative (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, NO)
+      CALL ef_set_arg_name         (id, arg, 'U')
+      CALL ef_set_arg_desc         (id, arg,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, arg, 'cm/sec')
+      CALL ef_set_arg_type         (id, arg, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, arg, YES, YES, YES, YES)
+
+      !  Extend the time axis one point backward
+
+      CALL ef_set_axis_extend      (id, arg, T_AXIS,-1,0)
+      END
+
+
+      SUBROUTINE RR_dudt_compute(id, arg_1, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         RR_times(1024)
+      LOGICAL        RR_badDt
+      REAL           RR_dt
+      REAL           RR_factor
+      INTEGER        iT
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, T_AXIS, 
+     .                            arg_lo_ss(T_AXIS,ARG1),
+     .                            arg_hi_ss(T_AXIS,ARG1), RR_times)
+
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+
+      IF (ax_units(4) .EQ. 'sec' ) THEN 
+         RR_factor = 1.
+      ELSEIF (ax_units(4) .EQ. 'min')THEN
+         RR_factor = 60.   
+      ELSEIF (ax_units(4) .EQ. 'hour' .OR. 
+     .        ax_units(4) .EQ. 'hours' )THEN
+         RR_factor = 3600.  
+      ELSEIF (ax_units(4) .EQ. 'day' .OR.
+     .        ax_units(4) .EQ. 'days'  )THEN
+         RR_factor = 86400. 
+      ELSE
+        WRITE (6,*)'Time axis units =', ax_units(4) 
+       !CALL ef_bail_out(id,
+       !.        'Time axis not specified as  sec, min, hour,or day.')
+      ENDIF
+
+      iT = 2
+      l1 = arg_lo_ss(T_AXIS,ARG1) + 1     ! Note: extended time axis
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         RR_dt =  SNGL(RR_times(iT) - RR_times(iT-1))
+         RR_badDt = RR_dt .EQ. 0.
+ 
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1)   .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,j1,k1,l1-1) .EQ. bad_flag(ARG1) .OR.
+     .                RR_badDt) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( arg_1(i1,j1,k1,l1)
+     .                    -   arg_1(i1,j1,k1,l1-1) ) / RR_dt
+     .                    / RR_factor	* sec_per_month
+                  ENDIF
+               
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               ENDDO
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         ENDDO
+
+	   iT = iT+1
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_dvdt.F b/external_functions/romea/rr_dvdt.F
new file mode 100644
index 0000000..e7a3513
--- /dev/null
+++ b/external_functions/romea/rr_dvdt.F
@@ -0,0 +1,167 @@
+*           rr_dvdt.F
+*
+*           Rick Romea
+*           Jan. 5, 2000
+*
+*     (Backward) time derivative of v
+*     Equation :  dv/dt = [ v(t) - v(t-1) ] / dt
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+******************************************************************
+
+      SUBROUTINE RR_dvdt_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+      arg = 1
+
+      CALL ef_set_desc             (id,
+     .'dv/dt (Backward) time derivative (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, NO)
+      CALL ef_set_arg_name         (id, arg, 'V')
+      CALL ef_set_arg_desc         (id, arg,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, arg, 'cm/sec')
+      CALL ef_set_arg_type         (id, arg, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, arg, YES, YES, YES, YES)
+
+      !  Extend the time axis one point backward
+
+      CALL ef_set_axis_extend      (id, arg, T_AXIS,-1,0)
+      END
+
+
+      SUBROUTINE RR_dvdt_compute(id, arg_1, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      EXTERNAL  RR_dudt_compute
+
+      INTEGER id
+
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      CALL RR_dudt_compute(id, arg_1, result)
+      END
+
+      SUBROUTINE RR_dudt_compute(id, arg_1, result)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         RR_times(1024)
+      LOGICAL        RR_badDt
+      REAL           RR_dt
+      REAL           RR_factor
+      INTEGER        iT
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, T_AXIS, 
+     .                            arg_lo_ss(T_AXIS,ARG1),
+     .                            arg_hi_ss(T_AXIS,ARG1), RR_times)
+
+      CALL ef_get_axis_info(id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+
+      IF (ax_units(4) .EQ. 'sec' ) THEN 
+         RR_factor = 1.
+      ELSEIF (ax_units(4) .EQ. 'min')THEN
+         RR_factor = 60.   
+      ELSEIF (ax_units(4) .EQ. 'hour' .OR. 
+     .        ax_units(4) .EQ. 'hours' )THEN
+         RR_factor = 3600.  
+      ELSEIF (ax_units(4) .EQ. 'day' .OR.
+     .        ax_units(4) .EQ. 'days'  )THEN
+         RR_factor = 86400. 
+      ELSE
+        WRITE (6,*)'Time axis units =', ax_units(4) 
+        !CALL ef_bail_out(id,
+        ! .        'Time axis not specified as  sec, min, hour,or day.')
+      ENDIF
+
+      iT = 2
+      l1 = arg_lo_ss(T_AXIS,ARG1) + 1     ! Note: extended time axis
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         RR_dt =  SNGL(RR_times(iT) - RR_times(iT-1))
+         RR_badDt = RR_dt .EQ. 0.
+ 
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1)   .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,j1,k1,l1-1) .EQ. bad_flag(ARG1) .OR.
+     .                RR_badDt) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = ( arg_1(i1,j1,k1,l1)
+     .                    -   arg_1(i1,j1,k1,l1-1) ) / RR_dt
+     .                    / RR_factor	* sec_per_month
+                  ENDIF
+               
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               ENDDO
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+            ENDDO
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         ENDDO
+
+	   iT = iT + 1
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+
+      END
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_sx.F b/external_functions/romea/rr_flux_sx.F
new file mode 100644
index 0000000..30095b9
--- /dev/null
+++ b/external_functions/romea/rr_flux_sx.F
@@ -0,0 +1,234 @@
+*           rr_flux_sx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Computes the zonal nonlinear advective flux term: -d(uS)/dx
+*     Units :      (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_sx_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(uS)/dx advective momentum: flux-form (SALT/s);MOM2 T Grid.')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_sx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2 
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt,  dyu
+      REAL adv_vet, adv_fe, cst
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+
+      adv_vet(i1,j1,k1,l1,iLat) = (arg_1(i1,j1,k1,l1)*dyu(iLat) + 
+     .              arg_1(i1,j1-1,k1,l1)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat) = adv_vet(i1,j1,k1,l1,iLat)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                  - (adv_fe(i1,j1,k1,l1,i2,j2,k2,l2,iLat) - 
+     .                    adv_fe(i1-1,j1,k1,l1,i2-1,j2,k2,l2,iLat)) 
+     .                       /2./dxt(iLon)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_sy.F b/external_functions/romea/rr_flux_sy.F
new file mode 100644
index 0000000..dc2f891
--- /dev/null
+++ b/external_functions/romea/rr_flux_sy.F
@@ -0,0 +1,230 @@
+*           rr_flux_sy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Computes the zonal nonlinear advective flux term:  - d(vS)/dy
+*     Units :      (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T
+
+*******************************************************************
+
+      SUBROUTINE RR_flux_sy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(vS)/dy advective momentum: flux-form (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (SALT)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_sy_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_fn, cst
+
+	INCLUDE 'rr_parameters.h'
+  
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i1,j1,k1,l1,iLon) = (arg_1(i1,j1,k1,l1)*dxu(iLon) + 
+     .        arg_1(i1-1,j1,k1,l1)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLon) = adv_vnt(i1,j1,k1,l1,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2,j2+1,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1 
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                  - (adv_fn(i1,j1,k1,l1,i2,j2,k2,l2,iLon) - 
+     .                    adv_fn(i1,j1-1,k1,l1,i2,j2,k2,l2,iLon) ) 
+     .                            /2./dyt(iLat)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_sz.F b/external_functions/romea/rr_flux_sz.F
new file mode 100644
index 0000000..1b9cd0a
--- /dev/null
+++ b/external_functions/romea/rr_flux_sz.F
@@ -0,0 +1,273 @@
+*           rr_flux_sz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000      
+*
+*     Zonal nonlinear advective flux term:  - d(wS)/dz
+*     Units :  (SALINITY(ppm) - 0.035) / s
+*     MOM2 Grid:  T   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_sz_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(wS)/dz advective momentum: flux-form (SALT/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (W)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (SALT)
+
+      CALL ef_set_arg_name         (id, ARG3, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Salinity, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3,
+     . '(SALINITY(ppt) - 35) /1000')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      END
+
+
+
+
+      SUBROUTINE RR_flux_sz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16   ax_name(4)
+      CHARACTER*16   ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           dxt, dyt, dxu, dyu
+      REAL           dus, dun, duw, due
+      REAL           adv_fb         
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dzt     = vertical height of "u,v" or "t" grid box (in cm)
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_fb(i2,j2,k2,l2,i3,j3,k3,l3) =  arg_2(i2,j2,k2,l2)
+     .                  * (arg_3(i3,j3,k3,l3) + arg_3(i3,j3,k3+1,l3))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'           .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'           .AND.
+     .         ax_units(3) .NE. 'METERS' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF 
+
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         ilat = 2  
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         
+            iLon = 2
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+	         iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .                arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     IF (iZ .EQ. 1) THEN
+                        result(i,j,k,l) =  
+     .                           adv_fb(i2,j2,k2,l2,i3,j3,k3,l3)
+     .                             / 2. / (zW(iZ)*Meters_to_cm)       
+     .                              * sec_per_month
+                     ELSE
+                        result(i,j,k,l) = - ( 
+     .      	                    adv_fb(i2,j2,k2-1,l2,i3,j3,k3-1,l3)
+     .                          - adv_fb(i2,j2,k2,  l2,i3,j3,k3,  l3))
+     .                         / 2. / (zW(iZ-1)-zW(iZ))/Meters_to_cm 
+     .                            * sec_per_month
+                     ENDIF
+                  ENDIF
+
+	            iZ = iZ + 1
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+               ENDDO
+
+               iLon = iLon + 1
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+            ENDDO
+
+            iLat = iLat + 1
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         ENDDO
+
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END
+
diff --git a/external_functions/romea/rr_flux_tx.F b/external_functions/romea/rr_flux_tx.F
new file mode 100644
index 0000000..6abe289
--- /dev/null
+++ b/external_functions/romea/rr_flux_tx.F
@@ -0,0 +1,239 @@
+*           rr_flux_tx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000 
+*
+*     Zonal nonlinear advective flux term:  -duT/dx
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_tx_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(uT)/dx advective momentum: flux-form (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP ')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO,NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_tx_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      
+      INTEGER        ilat
+      INTEGER        ilon
+      
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           dxt, dyt, dyu
+      REAL           adv_vet, adv_fe, cst
+      
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+
+      cst(iLat) = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat) = adv_vet(i1,j1,k1,l1,iLat)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info      (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                  - (adv_fe(i1,  j1,k1,l1,  i2,j2,k2,l2,iLat) - 
+     .                     adv_fe(i1-1,j1,k1,l1,i2-1,j2,k2,l2,iLat)) 
+     .                       /2./dxt(iLon)/cst(iLat)
+     .                      *sec_per_month
+                   ENDIF
+
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_ty.F b/external_functions/romea/rr_flux_ty.F
new file mode 100644
index 0000000..ad8666e
--- /dev/null
+++ b/external_functions/romea/rr_flux_ty.F
@@ -0,0 +1,229 @@
+*           rr_flux_ty.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal nonlinear advective flux term:  -dvT/dy
+*     Units :     oC/s
+*     MOM2 Grid:  T  
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_ty_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(vT)/dy advective momentum: flux-form (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (V)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_ty_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_fn, cst
+
+	INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i1,j1,k1,l1,iLon) = (arg_1(i1,j1,k1,l1)*dxu(iLon) + 
+     .        arg_1(i1-1,j1,k1,l1)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLon) = adv_vnt(i1,j1,k1,l1,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2,j2+1,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1 
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1 
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               cst = cos(SNGL(yT(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l1) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l1) .EQ. bad_flag(ARG2) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                 - (adv_fn(i1,j1,k1,l1,i2,j2,k2,l2,iLon) - 
+     .                    adv_fn(i1,j1-1,k1,l1,i2,j2-1,k2,l2,iLon) ) 
+     .                            /2./dyt(iLat)/cst*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_tz.F b/external_functions/romea/rr_flux_tz.F
new file mode 100644
index 0000000..89a56f8
--- /dev/null
+++ b/external_functions/romea/rr_flux_tz.F
@@ -0,0 +1,119 @@
+      SUBROUTINE RR_flux_tz_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+      CALL ef_set_desc             (id,
+     .'-d(wT)/dz advective momentum: flux-form (oC/s);MOM2 T Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+      END
+
+
+      SUBROUTINE RR_flux_tz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER        id
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+      INTEGER        i,  j,  k,  l
+      INTEGER        i2, j2, k2, l2
+      INTEGER        i3, j3, k3, l3
+      REAL*8         zW(1024)
+      INTEGER        iZ
+      REAL           adv_fb         
+      INCLUDE 'rr_parameters.h'
+      adv_fb(i2,j2,k2,l2,i3,j3,k3,l3)=arg_2(i2,j2,k2,l2)
+     .                  *(arg_3(i3,j3,k3,l3)+arg_3(i3,j3,k3+1,l3))
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         j3 = arg_lo_ss(Y_AXIS,ARG3) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            i3 = arg_lo_ss(X_AXIS,ARG3) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 	       iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                 IF (iZ .EQ. 1) THEN
+                     result(i,j,k,l) =  
+     .                           adv_fb(i2,j2,k2,l2,i3,j3,k3,l3)
+     .                             /2./zW(iZ)/Meters_to_cm 
+                 ELSE
+                       result(i,j,k,l) = - ( 
+     .      	                adv_fb(i2,j2,k2-1,l2,i3,j3,k3-1,l3)
+     .                       - adv_fb(i2,j2,k2,  l2,i3,j3,k3,  l3))
+     .                         / 2. /(zW(iZ-1)-zW(iZ))/Meters_to_cm 
+                  ENDIF
+                  iZ = iZ + 1
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                  k3 = k3 + arg_incr(Z_AXIS,ARG3)
+               ENDDO
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+               i3 = i3 + arg_incr(X_AXIS,ARG3)
+            ENDDO
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         ENDDO
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END
+
+
+
+
diff --git a/external_functions/romea/rr_flux_ux.F b/external_functions/romea/rr_flux_ux.F
new file mode 100644
index 0000000..2512e1d
--- /dev/null
+++ b/external_functions/romea/rr_flux_ux.F
@@ -0,0 +1,175 @@
+*           rr_flux_ux.F
+*
+*           Rick Romea
+*  	    Jan. 24, 2000
+*
+*     Zonal nonlinear advective term in flux form:  - d(uu)/dx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_ux_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(uu)/dx advective momentum: flux-form (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, YES, YES)
+
+      !  Extend the x and y axis one point backward and forward
+
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_ux_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER        id
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vet, adv_veu, adv_fe, csu
+      INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_veu(i,j,k,l,iLat,iLon) =
+     . ((adv_vet(i,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i,j+1,k,l,iLat) * dun(iLat))*duw(iLon+1) +    
+     .  (adv_vet(i+1,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i+1,j+1,k,l,iLat) * dun(iLat))*due(iLon))
+     .                     / dyu(iLat) / dxt(iLon+1)
+      adv_fe (i,j,k,l,iLat,iLon) = adv_veu(i,j,k,l,iLat,iLon)
+     .                  *(arg_1(i,j,k,l) + arg_1(i+1,j,k,l))
+
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2  
+            csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) 
+     .                 )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                  - (adv_fe(i1,j1,k1,l1,iLat,iLon) - 
+     .                     adv_fe(i1-1,j1,k1,l1,iLat,iLon)) 
+     .                       /2./dxu(iLon)/csu*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_uy.F b/external_functions/romea/rr_flux_uy.F
new file mode 100644
index 0000000..7ca5955
--- /dev/null
+++ b/external_functions/romea/rr_flux_uy.F
@@ -0,0 +1,194 @@
+*           rr_flux_uy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the zonal nonlinear advective flux term:  -dvu/dy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_uy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(vu)/dy advective momentum: flux-form (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,YES,YES,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_uy_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      INTEGER        id
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,j,k,l,i1,j1,k1,l1,i2,j2,k2,l2
+      REAL*8 yU(1024),xU(1024),yT(1024),xT(1024)
+      INTEGER ilat,ilon
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_vnu, adv_fn, csu
+      INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i,j,k,l,iLon) = (arg_2(i,j,k,l)*dxu(iLon) + 
+     .        arg_2(i-1,j,k,l)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_vnu(i,j,k,l,iLat,iLon) =
+     . ((adv_vnt(i,  j,  k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j,  k,l,iLon) * due(iLon))*dus(iLat+1)     
+     . +(adv_vnt(i,  j+1,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j+1,k,l,iLon) * due(iLon))*dun(iLat))
+     .                     / dyt(iLat+1) / dxu(iLon)
+      adv_fn (i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) = 
+     .                	adv_vnu(i2,j2,k2,l2,iLat,iLon)
+     .                  *(arg_1(i1,j1,k1,l1) + arg_1(i1,j1+1,k1,l1))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            ilat = 2  
+            csu = cos(SNGL(yU(iLat))*Degrees_to_radians) 
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)
+     .                  )THEN
+                          result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .             - (adv_fn(i1,j1,  k1,l1,i2,  j2,k2,l2,iLat,  iLon)- 
+     .                adv_fn(i1,j1-1,k1,l1,i2,j2-1,k2,l2,iLat-1,iLon)) 
+     .                     /2./dyu(iLat)/csu*sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_uz.F b/external_functions/romea/rr_flux_uz.F
new file mode 100644
index 0000000..5e7ef16
--- /dev/null
+++ b/external_functions/romea/rr_flux_uz.F
@@ -0,0 +1,216 @@
+*           rr_flux_uz.F
+*
+*           Rick Romea
+*           Jan. 24, 2000	 
+*
+*     Zonal nonlinear advective flux term:  -dwu/dz
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_uz_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(wu)/dz advective momentum: flux-form (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argumen (W)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      END
+
+
+
+
+      SUBROUTINE RR_flux_uz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      REAL           dxt, dyt, dxu, dyu
+      REAL           dus, dun, duw, due
+      REAL           adv_fb, adv_vbu
+      REAL           csu, cst
+      INCLUDE 'rr_parameters.h'
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+      adv_vbu(i,j,k,l,iLat,iLon,iZ) =
+     . ( arg_2(i,  j,  k,l) * dus(iLat) * duw(iLon) * cst(iLat)
+     . + arg_2(i+1,j,  k,l) * dus(iLat) * due(iLon) * cst(iLat) 
+     . + arg_2(i,  j+1,k,l) * dun(iLat) * duw(iLon) * cst(iLat+1)
+     . + arg_2(i+1,j+1,k,l) * dun(iLat) * due(iLon) * cst(iLat+1)
+     .                   ) / dyu(iLat) / dxu(iLon) / csu(iLat)
+      adv_fb(i1,j1,k1,l1,i2,j2,k2,l2, iLat,iLon,iZ) = 
+     .       	         adv_vbu(i2,j2,k2,l2,iLat,iLon,iZ)
+     .                  * (arg_1(i1,j1,k1,l1) + arg_1(i1,j1,k1+1,l1))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         ilat = 2  
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            iLon = 2
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                   ELSE
+                     IF(iZ.EQ.1)THEN
+			result(i,j,k,l) =  -1. *   ! added
+     .                     adv_fb(i1,j1,k1,l1,i2,j2,k2,l2, iLat,iLon,iZ) 
+     .                       /2./(zW(iZ)*Meters_to_cm)*sec_per_month
+	               ELSE
+			   result(i,j,k,l) =  -1. *  ! added
+     .              -(adv_fb(i1,j1,k1-1,l1,i2,j2,k2-1,l2,iLat,iLon,iZ-1)
+     .              - adv_fb(i1,j1,k1,  l1,i2,j2,k2,  l2, iLat,iLon,iZ))
+     .                       /2./(zW(iZ-1)-zW(iZ))/Meters_to_cm 
+     .                              * sec_per_month
+                     ENDIF
+                  ENDIF
+	          iZ = iZ + 1
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               ENDDO
+               iLon = iLon + 1
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+            ENDDO
+            iLat = iLat + 1
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         ENDDO
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END				
+
diff --git a/external_functions/romea/rr_flux_vx.F b/external_functions/romea/rr_flux_vx.F
new file mode 100644
index 0000000..10449dc
--- /dev/null
+++ b/external_functions/romea/rr_flux_vx.F
@@ -0,0 +1,274 @@
+*           rr_flux_vx.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Meridional nonlinear advective flux term:  -duv/dx
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_vx_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(uv)/dx advective momentum: flux-form (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (V)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_vx_compute(id, arg_1, arg_2, arg_3, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vet, adv_veu, adv_fe, csu
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C     adv_vet(i,k,j)=(u(i,k,j)*dyu(j)+u(i,k,j-1)*dyu(j-1))/2/dyt(j)
+C     adv_veu(i,k,j) = ((adv_vet(i,k,j)*dus(j)
+C     &                       + adv_vet(i,k,j+1)*dun(j)
+C     &                        )*duw(i+1) +    
+C     &                        (adv_vet(i+1,k,j)*dus(j)
+C     &                       + adv_vet(i+1,k,j+1)*dun(j)
+C     &                        )*due(i)) /   dyu(j) / dxt(i+1)
+C      adv_fe (i,k,j) = adv_veu(i,k,j)*(v(i,k,j)+v(i+1,k,j))
+C      ADV_Ux(i,k,j) = (adv_fe(i,k,j)-adv_fe(i-1,k,j))/dxu(i)/2/cos(phi(j))
+C
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vet(i,j,k,l,iLat) = (arg_1(i,j,k,l)*dyu(iLat) + 
+     .              arg_1(i,j-1,k,l)*dyu(iLat-1)) /2./ dyt(iLat)
+      adv_veu(i,j,k,l,iLat,iLon) =
+     . ((adv_vet(i,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i,j+1,k,l,iLat+1) * dun(iLat))*duw(iLon+1) +    
+     .  (adv_vet(i+1,j,k,l,iLat) * dus(iLat)
+     . + adv_vet(i+1,j+1,k,l,iLat+1) * dun(iLat))*due(iLon))
+     .                     / dyu(iLat) / dxt(iLon+1)
+      adv_fe (i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) = 
+     .	                adv_veu(i1,j1,k1,l1,iLat,iLon)
+     .                  *(arg_2(i2,j2,k2,l2) + arg_2(i2+1,j2,k2,l2))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2)
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                 - (adv_fe(i1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon) - 
+     .                    adv_fe(i1-1,j1,k1,l1,i2,j2,k2,l2,iLat,iLon-1)) 
+     .                      /2./dxu(iLon)/csu	 * sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_vy.F b/external_functions/romea/rr_flux_vy.F
new file mode 100644
index 0000000..7929257
--- /dev/null
+++ b/external_functions/romea/rr_flux_vy.F
@@ -0,0 +1,240 @@
+*           rr_flux_vy.F
+*
+*           Rick Romea
+*           Jan. 24, 2000	        
+*
+*     Meridional nonlinear flux form  advective term:  -d(vv)/dy
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_vy_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(vv)/dy advective momentum: flux-form (cm/s^2); MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, YES, YES)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+
+      ! Define second argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+
+      END
+
+
+      SUBROUTINE RR_flux_vy_compute(id, arg_1, arg_2, result)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+      INTEGER        ilat
+      INTEGER        ilon
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL dxt, dyt, dxu, dyu, dus, dun, duw, due
+      REAL adv_vnt, adv_vnu, adv_fn, csu
+
+	INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+C     THIS IS THE MOM2 CODE:
+C
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      !  Statement functions
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      adv_vnt(i,j,k,l,iLon) = (arg_1(i,j,k,l)*dxu(iLon) + 
+     .        arg_1(i-1,j,k,l)*dxu(iLon-1)) /2./ dxt(iLon)
+      adv_vnu(i,j,k,l,iLat,iLon) =
+     . ((adv_vnt(i,j,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j,k,l,iLon) * due(iLon))*dus(iLat+1) +    
+     .  (adv_vnt(i,j+1,k,l,iLon) * duw(iLon)
+     . + adv_vnt(i+1,j+1,k,l,iLon) * due(iLon))*dun(iLat))
+     .                     / dyt(iLat+1) / dxu(iLon)
+      adv_fn (i,j,k,l,iLat,iLon) = adv_vnu(i,j,k,l,iLat,iLon)
+     .                  *(arg_1(i,j,k,l) + arg_1(i,j+1,k,l))
+
+      ! Get axis data
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG2),
+     .                            arg_hi_ss(X_AXIS,ARG2), xT)
+      CALL ef_get_coordinates    (id, ARG2, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG2),
+     .                            arg_hi_ss(Y_AXIS,ARG2), yT)
+
+      ! Check axis units:  bail out if not lat and lon.
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+       ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+       ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ilat = 2  
+            j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+            DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               csu = cos(SNGL(yU(iLat)) * Degrees_to_radians) 
+
+               iLon = 2
+               i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+               DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (
+     .                arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) 
+     .                  )THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =
+     .                  -(adv_fn(i1,j1,k1,l1,iLat,iLon) - 
+     .                    adv_fn(i1,j1-1,k1,l1,iLat,iLon) ) 
+     .                  /2./dyu(iLat)/csu	* sec_per_month
+                  ENDIF
+                  iLon = iLon + 1
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               ENDDO
+
+               iLat = iLat + 1
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            ENDDO               
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_flux_vz.F b/external_functions/romea/rr_flux_vz.F
new file mode 100644
index 0000000..79837d8
--- /dev/null
+++ b/external_functions/romea/rr_flux_vz.F
@@ -0,0 +1,285 @@
+*           rr_flux_vz.F
+*
+*           Rick Romea
+*           March 16, 2000	     
+*
+*     Meridional nonlinear advective flux term:  -dwv/dz
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+*******************************************************************
+
+      SUBROUTINE RR_flux_vz_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'-d(wv)/dz advective momentum: flux-form (cm/s^2);MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, NO, NO, NO, NO)
+
+      ! Define first argument (U)
+
+      CALL ef_set_arg_name         (id, ARG1, 'V')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1)
+
+      ! Define second argument (W)
+
+      CALL ef_set_arg_name         (id, ARG2, 'W')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Vertical velocity, at T cell bottom on the MOM2 Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Z_AXIS,0,+1)
+
+      ! Define third argument (TEMP)
+
+      CALL ef_set_arg_name         (id, ARG3, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG3,
+     . 'Potential temperature, required to access MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'deg-C')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,-1,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Z_AXIS,0,+1)
+
+      END
+
+
+
+
+      SUBROUTINE RR_flux_vz_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+
+      REAL           bad_flag(EF_MAX_ARGS)
+      REAL           bad_flag_result
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         yU(1024)
+      REAL*8         xU(1024)
+      REAL*8         zW(1024)
+      REAL*8         yT(1024)
+      REAL*8         xT(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16   ax_name(4)
+      CHARACTER*16   ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL           dxt, dyt, dxu, dyu
+      REAL           dus, dun, duw, due
+      REAL           adv_fb, adv_vbu
+      REAL           csu, cst
+	
+      INCLUDE 'rr_parameters.h'
+
+C*********************************************************************
+C
+c     dzt     = vertical height of "u,v" or "t" grid box (in cm)
+c     dyt     = latitudinal height of "t" grid box (in cm)
+c     dxt     = longitudinal width of "t" grid box at the equator (cm)
+c     dxu     = longitudinal width of "u,v" grid box at the equator (cm) 
+c     dyu     = latitudinal height of "u,v" grid box (cm)
+C
+c     dus     = yu(j) - yt(j)
+c     dun     = yt(j+1) - yu(j)
+c     duw     = xu(i) - xt(i)
+c     due     = xt(i+1) - xu(i)
+C
+c     yu(j)   = latitude of the jth "u,v" point in degrees 
+c     yt(j)   = latitude of the jth "t" point in degrees   
+c     xt(i)   = longitude of the ith "t" point in degrees  
+c     xu(i)   = longitude of the ith "u,v" point in degrees
+C 
+C*********************************************************************
+
+      dxt(i) = SNGL (xU(i)   - xU(i-1)) * Longitude_to_cm
+      dyt(j) = SNGL (yU(j)   - yU(j-1)) * Latitude_to_cm
+      dxu(i) = SNGL (xT(i+1) - xT(i))   * Longitude_to_cm
+      dyu(j) = SNGL (yT(j+1) - yT(j))   * Latitude_to_cm
+      dus(j) = SNGL (yU(j)   - yT(j))   * Latitude_to_cm
+      dun(j) = SNGL (yT(j+1) - yU(j))   * Latitude_to_cm
+      duw(i) = SNGL (xU(i)   - xT(i))   * Longitude_to_cm
+      due(i) = SNGL (xT(i+1) - xU(i))   * Longitude_to_cm
+
+      cst(j) = cos(SNGL(yT(j)) * Degrees_to_radians) 
+      csu(j) = cos(SNGL(yU(j)) * Degrees_to_radians) 
+      adv_vbu(i,j,k,l,iLat,iLon,iZ) =
+     . ( arg_2(i,  j,  k,l) * dus(iLat) * duw(iLon) * cst(iLat)
+     . + arg_2(i+1,j,  k,l) * dus(iLat) * due(iLon) * cst(iLat) 
+     . + arg_2(i,  j+1,k,l) * dun(iLat) * duw(iLon) * cst(iLat+1)
+     . + arg_2(i+1,j+1,k,l) * dun(iLat) * due(iLon) * cst(iLat+1)
+     .                   ) / dyu(iLat) / dxu(iLon) / csu(iLat)
+      adv_fb(i1,j1,k1,l1,i2,j2,k2,l2, iLat,iLon,iZ) = 
+     .       	         adv_vbu(i2,j2,k2,l2,iLat,iLon,iZ)
+     .                  * (arg_1(i1,j1,k1,l1) + arg_1(i1,j1,k1+1,l1))
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG2, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG2),
+     .                            arg_hi_ss(Z_AXIS,ARG2), zW)
+      CALL ef_get_coordinates    (id, ARG3, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG3),
+     .                            arg_hi_ss(X_AXIS,ARG3), xT)
+      CALL ef_get_coordinates    (id, ARG3, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG3),
+     .                            arg_hi_ss(Y_AXIS,ARG3), yT)
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+       ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+       ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'           .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'           .AND.
+     .         ax_units(3) .NE. 'METERS' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+       ! CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF 
+
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         ilat = 2  
+         j1 = arg_lo_ss(Y_AXIS,ARG1) + 1
+         j2 = arg_lo_ss(Y_AXIS,ARG2) + 1
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         
+            iLon = 2
+            i1 = arg_lo_ss(X_AXIS,ARG1) + 1
+            i2 = arg_lo_ss(X_AXIS,ARG2) + 1
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+	       iZ = 1
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+	       k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,  j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_1(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .                arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     IF (k1 .EQ. 1) THEN
+				      result(i,j,k,l) = 
+     .                        adv_fb(i1,j1,k1,l1,
+     .                               i2,j2,k2,l2, iLat,iLon,iZ) 
+     .                             / 2. / (zW(iZ)*Meters_to_cm)
+     .                              * sec_per_month
+	               ELSE
+				      result(i,j,k,l) = 
+     .                     - ( adv_fb(i1,j1,k1-1,l1,
+     .                                i2,j2,k2-1,l2,iLat,iLon,iZ-1)
+     .                       - adv_fb(i1,j1,k1,  l1,
+     .                                i2,j2,k2,  l2, iLat,iLon,iZ) )
+     .                         /2./(zW(iZ-1)-zW(iZ))/Meters_to_cm 
+     .                         * sec_per_month
+                     ENDIF
+                  ENDIF
+
+	          iZ = iZ + 1
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               ENDDO
+
+               iLon = iLon + 1
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+               i2 = i2 + arg_incr(X_AXIS,ARG2)
+            ENDDO
+
+            iLat = iLat + 1
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END
diff --git a/external_functions/romea/rr_fv.F b/external_functions/romea/rr_fv.F
new file mode 100644
index 0000000..7649835
--- /dev/null
+++ b/external_functions/romea/rr_fv.F
@@ -0,0 +1,112 @@
+*           rr_fv.F
+*
+*           Rick Romea
+*           Jan. 5, 2000 
+*
+*     Coriolis term in the u momentum equation
+*     Equation :  fv
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+************************************************************************
+
+      SUBROUTINE RR_fv_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id, arg
+      arg = 1
+
+      CALL ef_set_desc             (id,
+     .  'Coriolis term fv (cm/s^2) on the MOM2 U Grid')
+      CALL ef_set_num_args         (id, 1)
+      CALL ef_set_has_vari_args    (id, NO)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, YES)
+      CALL ef_set_arg_name         (id, arg, 'V')
+      CALL ef_set_arg_desc         (id, arg,
+     . 'Meridional velocity, on the MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, arg, 'cm/sec')
+      CALL ef_set_arg_type         (id, arg, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, arg, YES, YES, YES, YES)
+
+      END
+
+************************************************************************
+
+      SUBROUTINE RR_fv_compute(id, arg_1, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  k,  l
+      INTEGER i1, j1, k1, l1
+
+      REAL*8     degrees_y(1024)
+      INTEGER    iLat
+      REAL       Coriolis
+
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), degrees_y)
+
+      iLat = 1
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         Coriolis = Two_Omega*
+     .                SIN(SNGL(degrees_y(iLat))*Degrees_to_radians) 
+
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) =  arg_1(i1,j1,k1,l1)*Coriolis
+     .                  * sec_per_month
+                  ENDIF
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+               ENDDO
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            ENDDO
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+         ENDDO
+
+         iLat = iLat + 1
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+      ENDDO
+      END
+
+
diff --git a/external_functions/romea/rr_geopotential_height.F b/external_functions/romea/rr_geopotential_height.F
new file mode 100644
index 0000000..2b31485
--- /dev/null
+++ b/external_functions/romea/rr_geopotential_height.F
@@ -0,0 +1,247 @@
+*  rr_geopotential_height.F
+*
+*     Rick Romea
+*     Jan. 20, 2000
+*
+*  Geopotential height (cm) = 
+*      Geopotential meters (m^2/s^2) / gravity (9.8 m/s^2) * 100
+*  
+************************************************************************
+
+      SUBROUTINE RR_geopotential_height_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,' Geopotential height (cm)')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_axis_reduction   (id, RETAINED,
+     .                                  RETAINED,         
+     .                                  REDUCED,
+     .                                  RETAINED)          
+      CALL ef_set_arg_name         (id, ARG1, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG1, 'In Situ Temperature')
+      CALL ef_set_arg_unit         (id, ARG1, 'oC')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG2, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG2, 'Salinity')
+      CALL ef_set_arg_unit         (id, ARG2, 'psu')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,YES,YES)
+
+      END
+
+c*******************************************************************
+
+      SUBROUTINE RR_geopotential_height_compute(id,arg_1,arg_2,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER  i,  j,  k,   l
+      INTEGER  i1, j1, k1, l1
+      INTEGER  i2, j2, k2, l2
+
+      REAL*8   zT(1024)
+
+      INTEGER  iZ
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL       Rho  ! function for density
+      REAL       dz,anomaly
+      INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! Check that upper z grid point is the surface z grid point
+	
+      IF (arg_lo_ss(Z_AXIS,ARG1) .NE. 1) THEN
+        CALL ef_bail_out(id,'TEMP:Upper grid point must be 1')
+      ENDIF
+      IF (arg_lo_ss(Z_AXIS,ARG2) .NE. 1) THEN
+        CALL ef_bail_out(id,'SALT:Upper grid point must be 1')
+      ENDIF
+ 
+      ! Get Z grid coordinates
+
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zT)
+
+      ! check axis units
+
+      CALL ef_get_axis_info  (id, ARG1, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(3) .NE. 'm'       .AND.
+     .         ax_units(3) .NE. 'meters'  .AND.
+     .         ax_units(3) .NE. 'M'       .AND.
+     .         ax_units(3) .NE. 'METERS'  .AND.
+     .         ax_units(3) .NE. 'meters_z' ) THEN
+        WRITE (6,*)'Z axis units =', ax_units(3) 
+        !CALL ef_bail_out(id,'Z axis must be in meters')
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+        j1 = arg_lo_ss(Y_AXIS,ARG1) 
+        j2 = arg_lo_ss(Y_AXIS,ARG2) 
+        DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           i1 = arg_lo_ss(X_AXIS,ARG1) 
+           i2 = arg_lo_ss(X_AXIS,ARG2) 
+           DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+              
+              ! This is a dummy axit, since z is reduced
+              DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                 result(i,j,k,l) = 0.  ! initialize at the surface
+                 iZ = 1
+                 k2 = arg_lo_ss(Z_AXIS,ARG2)
+                 DO k1 = arg_lo_ss(Z_AXIS,ARG1), 
+     .                   arg_hi_ss(Z_AXIS,ARG1),
+     .                    arg_incr(Z_AXIS,ARG1)     
+                   IF (arg_1(i1,j1,k1,l1) .EQ. bad_flag(ARG1) .OR.
+     .                 arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2) ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                     GOTO 1 ! Bail from this z-integration
+                   ELSE
+
+                     anomaly = 
+     .                   1. / Rho( arg_1(i1,j1,k1,l1),
+     .                           arg_2(i2,j2,k2,l2), SNGL(zT(iZ))) 
+     .                -  1. / Rho(  0.,  35.,  SNGL(zT(iZ)))   
+           
+                     IF(k1.EQ.1)THEN  ! Top z-grid point
+                       dz = (SNGL(zT(iZ+1)) + SNGL(zT(iZ)))   / 2.
+                     ELSEIF(k1.EQ.arg_hi_ss(Z_AXIS,ARG1))THEN ! Bottom z-point
+                       dz = (SNGL(zT(iZ))   - SNGL(zT(iZ-1))) / 2.    
+                     ELSE ! middle gridpoints
+                       dz = (SNGL(zT(iZ+1)) - SNGL(zT(iZ-1))) / 2.
+                     ENDIF
+                     result(i,j,k,l)=result(i,j,k,l)+anomaly*dz*1.e5
+                   ENDIF
+
+	           iZ = iZ + 1
+                   k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                 ENDDO
+              ENDDO 
+ 1	      CONTINUE
+              i1 = i1 + arg_incr(X_AXIS,ARG1)
+              i2 = i2 + arg_incr(X_AXIS,ARG2)
+           ENDDO
+
+           j1 = j1 + arg_incr(Y_AXIS,ARG1)
+           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         ENDDO
+
+      l1 = l1 + arg_incr(T_AXIS,ARG1)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO
+
+      END
+
+
+
+        REAL FUNCTION RHO(temperature,salinity,pressure)
+
+* The 1980 UNESCO International Equation of State (IES80)
+* *sh* 8/5/92 - adapted from C version supplied by John Osborne, PMEL
+
+*       This calculates rho (density kg/m^3) at salinity, 
+*	temperature, and pressure.  This will be potential density if 
+*	temperature is potential temperature.  The routine uses the high 
+*	pressure equation of state from Millero et al. 1980 and the one-
+*	atmosphere equation of state from Millero and Poisson 1981 as
+*	reported in Gill 1982.  The notation follows Millero et al. 1980
+*	and Millero and Poisson 1981.
+*	
+*	Note: the routine takes p in decibars and converts to bars for
+*	the calculations.
+*	
+*  Gill, A.E., 1982, Atmosphere-Ocean Dynamics, Academic Press, Inc., 662 pp. 
+*	
+*	Input Units:
+*			S: psu	T: deg. C  p: decibars.
+*			
+*	Output Units:
+*			rho: kg/m^3
+*			
+*	Check values:
+*			rho = 999.96675 	for S = 0,  T = 5,  p = 0
+*			rho = 1027.675465 	for S = 35, T = 5,  p = 0
+*			rho = 1062.538172 	for S = 35, T = 25, p = 10000.
+
+        REAL salinity, temperature, pressure
+	REAL S, T, p, rootS
+	REAL a, b, c, d, e
+	REAL Aw, Bw, Kw
+	REAL A2, B2, C2, Kzero, K
+	REAL rhoW, rhoZero
+	S = salinity
+	T = temperature
+	p = pressure / 10.
+	rootS = SQRT (S)
+	rhoW = ((((6.536332e-09 * T - 1.120083e-06) * T + 1.001685e-04)
+     .		* T - 9.095290e-03) * T + 6.793952e-02) * T + 999.842594
+	A2 = (((5.3875e-09 * T - 8.2467e-07) * T + 7.6438e-05)
+     .		* T - 4.0899e-03) * T + 8.24493e-01
+	B2 = (-1.6546e-06 * T + 1.0227e-04) * T - 5.72466e-03
+	C2 = 4.8314e-04
+	rhoZero	= (C2 * S + B2 * rootS + A2) * S + rhoW
+	IF ( pressure .EQ. 0.0 ) THEN
+	   RHO=rhoZero
+	   RETURN
+        ENDIF
+	a = ((-6.1670e-05*T+1.09987e-02)*T-6.03459e-01)*T+54.6746
+	b = (-5.3009e-04 * T + 1.6483e-02) * T + 7.944e-02
+	c = (-1.6078e-06 * T - 1.0981e-05) * T + 2.2838e-03
+	d = 1.91075e-04
+	e = (9.1697e-10 * T + 2.0816e-08) * T - 9.9348e-07
+	Aw = ((-5.77905e-07*T+1.16092e-04)*T+1.43713e-03)*T+3.239908
+	Bw = (5.2787e-08 * T - 6.12293e-06) * T + 8.50935e-05
+	Kw = (((-5.155288e-05 * T + 1.360477e-02) * T - 2.327105)
+     .		* T + 148.4206) * T + 19652.21
+	Kzero = (b * rootS + a) * S + Kw
+	K = ((e * p + d * rootS + c) * S + Bw * p + Aw) * p + Kzero
+	RHO = rhoZero / (1.0 - (p / K))
+	END
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_grad_pbc_u.F b/external_functions/romea/rr_grad_pbc_u.F
new file mode 100644
index 0000000..c9a3b49
--- /dev/null
+++ b/external_functions/romea/rr_grad_pbc_u.F
@@ -0,0 +1,297 @@
+*           rr_grad_pbc_u.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Baroclinic pressure gradient term in u momentum eq.
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+************************************************************************
+
+      SUBROUTINE RR_grad_pbc_u_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Baroclininc -dp/dx term (cm/s^2) on the MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity,required to access MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,0,+1)      
+
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential Temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'oC')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,0,+1)
+
+      
+      CALL ef_set_arg_name         (id, ARG3, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG3,
+     .  'Salinity on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'ppm-0.035')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,0,+1)
+
+      END
+
+************************************************************************
+
+      SUBROUTINE RR_grad_pbc_u_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3  (mem3lox:mem2hix, mem3loy:mem2hiy, 
+     .             mem3loz:mem2hiz, mem3lot:mem2hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  k,  l, m
+      INTEGER i2, j2, k2, l2, m1
+      INTEGER i3, j3, k3, l3
+
+      REAL*8         xU(1024)
+      REAL*8         yU(1024)
+      REAL*8         zU(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      REAL       csu, RR_temp2
+      REAL       dxt  
+      REAL*8     Rho  ! functions for density
+      REAL       ss,tt
+
+      ss(i,j,k,l) =  arg_3(i,j,k,l)*1000. + 35. ! True salinity (ppt)
+      tt(i,j,k,l) =  arg_2(i,j,k,l)
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! Check that upper z grid point is the surface z grid point
+	
+      IF (arg_lo_ss(Z_AXIS,ARG1) .NE. 1) THEN
+        CALL ef_bail_out(id,'U:Upper grid point must be surface')
+      ENDIF
+      IF (arg_lo_ss(Z_AXIS,ARG2) .NE. 1) THEN
+        CALL ef_bail_out(id,'TEMP:Upper grid point must be surface')
+      ENDIF
+      IF (arg_lo_ss(Z_AXIS,ARG3) .NE. 1) THEN
+        CALL ef_bail_out(id,'SALT:Upper grid point must be surface')
+      ENDIF
+
+      ! Get U grid coordinates
+
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)    
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+
+	! check axis units
+
+      CALL ef_get_axis_info  (id, ARG2, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        !CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        !CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      ! start the loop
+
+      iLat = 1
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      j3 = arg_lo_ss(Y_AXIS,ARG3) 
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         csu = COS(SNGL(yU(iLat))*Degrees_to_radians)
+         RR_temp2 = RR_temp1 / csu 
+         iLon = 1
+         i2 = arg_lo_ss(X_AXIS,ARG2) 
+         i3 = arg_lo_ss(X_AXIS,ARG3) 
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            dxt = SNGL(xU(iLon+1)-xU(iLon)) * Longitude_to_cm
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+               iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  IF (
+     .              arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) 
+     .                      ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                    IF (iZ .EQ. 1) THEN  ! Top z-grid point.
+                       result(i,j,k,l) = SNGL(zU(iZ)) * SNGL ( 
+     .                      Rho(DBLE(tt(i2+1,j2+1,k2,l2)),
+     .                          DBLE(ss(i3+1,j3+1,k3,l3)),zU(iZ)) 
+     .                    + Rho(DBLE(tt(i2+1,j2  ,k2,l2)),
+     .                          DBLE(ss(i3+1,j3,  k3,l3)),zU(iZ)) 
+     .                    - Rho(DBLE(tt(i2  ,j2+1,k2,l2)),
+     .                          DBLE(ss(i3  ,j3+1,k3,l3)),zU(iZ)) 
+     .                    - Rho(DBLE(tt(i2  ,j2  ,k2,l2)),
+     .                          DBLE(ss(i3  ,j3  ,k3,l3)),zU(iZ))
+     .                       )
+		    ELSE
+                       result(i,j,k,l) = 0.
+		       m1=arg_lo_ss(Z_AXIS,ARG2)+1
+                       DO m=2,iZ
+                          result(i,j,k,l) = result(i,j,k,l) + 
+     .                             SNGL (zU(m+1) - zU(m)) *SNGL( 
+     .                       Rho(DBLE(tt(i2+1,j2+1,m1  ,l2)),
+     .                           DBLE(ss(i3+1,j3+1,m1  ,l3)),zU(m  ))
+     .                     + Rho(DBLE(tt(i2+1,j2+1,m1-1,l2)),
+     .                           DBLE(ss(i3+1,j3+1,m1-1,l3)),zU(m-1))
+     .                     + Rho(DBLE(tt(i2+1,j2  ,m1  ,l2)),
+     .                           DBLE(ss(i3+1,j3  ,m1  ,l3)),zU(m  ))
+     .                     + Rho(DBLE(tt(i2+1,j2  ,m1-1,l2)), 
+     .                           DBLE(ss(i3+1,j3  ,m1-1,l3)),zU(m-1))
+     .                     - Rho(DBLE(tt(i2  ,j2+1,m1  ,l2)),
+     .                           DBLE(ss(i3  ,j3+1,m1  ,l3)),zU(m  ))
+     .                     - Rho(DBLE(tt(i2  ,j2+1,m1-1,l2)),
+     .                           DBLE(ss(i3  ,j3+1,m1-1,l3)),zU(m-1))
+     .                     - Rho(DBLE(tt(i2  ,j2  ,m1  ,l2)),
+     .                           DBLE(ss(i3  ,j3  ,m1  ,l3)),zU(m  ))
+     .                     - Rho(DBLE(tt(i2  ,j2  ,m1-1,l2)),
+     .                           DBLE(ss(i3  ,j3  ,m1-1,l3)),zU(m-1))
+     .                        )
+	               m1 = m1 + arg_incr(Z_AXIS,ARG2)
+                       ENDDO
+                       result(i,j,k,l) = result(i,j,k,l)/2.
+                    ENDIF
+                    result(i,j,k,l) = result(i,j,k,l)*RR_temp2/dxt
+     .                              * sec_per_month
+
+                  ENDIF
+	         iZ = iZ + 1
+                 k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                 k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                 ENDDO
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+            ENDDO
+            iLon = iLon + 1
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+            i3 = i3 + arg_incr(X_AXIS,ARG3)
+         ENDDO
+         iLat = iLat + 1
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+      ENDDO
+      END
+
+      ! Stolen KNUDSEN code to compute density
+
+      ! D = depth (m)
+      ! T = temperature (oC)
+      ! S = salinity (ppt)
+
+      REAL*8 FUNCTION Rho(T,S,D)
+      IMPLICIT NONE
+      REAL*8 T,S,D
+      REAL*8 T2,T3,S2,S3,F1,F2,F3,FS,SIGMA,A,B1,B2,B,CO,ALPHA
+      T2=T*T
+      T3=T2*T
+      S2=S*S
+      S3=S2*S
+      F1=-(T-3.98d0)**2*(T+283.d0)/(503.57d0*(T+67.26d0))
+      F2=T3*1.0843d-6-T2*9.8185d-5+T*4.786d-3
+      F3=T3*1.667d-8-T2*8.164d-7+T*1.803d-5
+      FS=S3*6.76786136d-6-S2*4.8249614d-4+S*8.14876577d-1
+      SIGMA=F1+(FS+3.895414d-2)*(1.d0-F2+F3*(FS-.22584586d0))
+      A=D*1.d-4*(105.5d0+T*9.5d0-T2*.158d0-D*T*1.5d-4)-
+     .(227.d0+T*28.33d0-T2*.551d0+T3*.004d0)
+      B1=(FS-28.1324d0)/10.d0
+      B2=B1*B1
+      B=-B1*(147.3d0-T*2.72d0+T2*.04d0-D*1.d-
+     .4*(32.4d0-.87d0*T+.02d0*T2))
+      B=B+B2*(4.5d0-.1d0*T-D*1.d-4*(1.8d0-.06d0*T))
+      CO=4886.d0/(1.d0+1.83d-5*D)
+      ALPHA=D*1.d-6*(CO+A+B)
+      Rho=(SIGMA+ALPHA)/(1.d0-1.d-3*ALPHA)
+      END
+
+
+
diff --git a/external_functions/romea/rr_grad_pbc_v.F b/external_functions/romea/rr_grad_pbc_v.F
new file mode 100644
index 0000000..6e00f27
--- /dev/null
+++ b/external_functions/romea/rr_grad_pbc_v.F
@@ -0,0 +1,306 @@
+*           rr_grad_pbc_v.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Baroclinic pressure gradient term in v momentum equation
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+************************************************************************
+
+
+	! NOTE: still need to fix up if first z grid point is not 1
+
+
+      SUBROUTINE RR_grad_pbc_v_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Barclininc -dp/dy term (cm/s^2) on the MOM2 U Grid')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_has_vari_args    (id, NO)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity,required to access MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,0,+1)
+      
+      CALL ef_set_arg_name         (id, ARG2, 'TEMP')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Potential Temperature, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'oC')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,0,+1)
+
+      
+      CALL ef_set_arg_name         (id, ARG3, 'SALT')
+      CALL ef_set_arg_desc         (id, ARG3,
+     .  'Salinity on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG3, 'ppm-0.035')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, NO, NO,YES,YES)
+      CALL ef_set_axis_extend      (id, ARG3, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG3, Y_AXIS,0,+1)
+
+      END
+
+c*******************************************************************
+
+      SUBROUTINE RR_grad_pbc_v_compute(id, arg_1, arg_2, arg_3, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3  (mem3lox:mem2hix, mem3loy:mem2hiy, 
+     .             mem3loz:mem2hiz, mem3lot:mem2hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  k,  l, m
+      INTEGER i2, j2, k2, l2, m1
+      INTEGER i3, j3, k3, l3
+
+      REAL*8         xU(1024)
+      REAL*8         yU(1024)
+      REAL*8         zU(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+      INTEGER        iZ
+
+      CHARACTER*16  ax_name(4)
+      CHARACTER*16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL       dyt  
+      REAL*8     Rho  ! functions for density
+      REAL       ss,tt
+
+      INCLUDE 'rr_parameters.h'
+
+      ! Statement Functions
+
+      ss(i,j,k,l) =  arg_3(i,j,k,l)*1000. + 35. ! True salinity (ppt)
+      tt(i,j,k,l) =  arg_2(i,j,k,l)
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+	! Check that upper z grid point is the surface z grid point
+	
+      IF (arg_lo_ss(Z_AXIS,ARG1) .NE. 1) THEN
+        CALL ef_bail_out(id,'U:Upper grid point must be surface')
+	ENDIF
+      IF (arg_lo_ss(Z_AXIS,ARG2) .NE. 1) THEN
+        CALL ef_bail_out(id,'TEMP:Upper grid point must be surface')
+      ENDIF
+      IF (arg_lo_ss(Z_AXIS,ARG3) .NE. 1) THEN
+        CALL ef_bail_out(id,'SALT:Upper grid point must be surface')
+	ENDIF
+
+      ! Get U grid coordinates
+
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)    
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zU)
+
+      ! check axis units
+
+      CALL ef_get_axis_info  (id, ARG2, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      ! start the loop
+
+      iLat = 1
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      j3 = arg_lo_ss(Y_AXIS,ARG3) 
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         dyt = SNGL (yU(iLat+1)-yU(iLat)) * Latitude_to_cm
+         iLon = 1
+         i2 = arg_lo_ss(X_AXIS,ARG2) 
+         i3 = arg_lo_ss(X_AXIS,ARG3) 
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+	       iZ = 1
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               k3 = arg_lo_ss(Z_AXIS,ARG3)
+               DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (
+     .              arg_2(i2,  j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2,  j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2,  j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2+1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2,  k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2+1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i2-1,j2-1,k2,l2) .EQ. bad_flag(ARG2) .OR.
+     .              arg_3(i3,  j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3,  j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3,  j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3+1,j3-1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3,  k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3+1,k3,l3) .EQ. bad_flag(ARG3) .OR.
+     .              arg_3(i3-1,j3-1,k3,l3) .EQ. bad_flag(ARG3) 
+     .                      ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                    IF (iZ .EQ. 1) THEN  ! Top z-grid point.
+                      
+                      result(i,j,k,l) = SNGL(zU(iZ)) * SNGL( 
+     .  Rho(DBLE(tt(i2+1,j2+1,k2,l2)),DBLE(ss(i3+1,j3+1,k3,l3)),zU(iZ)) 
+     . +Rho(DBLE(tt(i2  ,j2+1,k2,l2)),DBLE(ss(i3  ,j3+1,k3,l3)),zU(iZ)) 
+     . -Rho(DBLE(tt(i2+1,j2  ,k2,l2)),DBLE(ss(i3+1,j3  ,k3,l3)),zU(iZ)) 
+     . -Rho(DBLE(tt(i2  ,j2  ,k2,l2)),DBLE(ss(i3  ,j3  ,k3,l3)),zU(iZ))
+     .                         )
+                     ELSE
+                       result(i,j,k,l) = 0.
+					  
+		       m1=arg_lo_ss(Z_AXIS,ARG2)+1
+                       DO m=2,iZ
+                          result(i,j,k,l) = result(i,j,k,l) + 
+     .                             SNGL (zU(m+1) - zU(m)) * SNGL ( 
+     .            Rho(DBLE(tt(i2+1,j2+1,m1  ,l2)),
+     .                DBLE(ss(i3+1,j3+1,m1  ,l3)),zU(m  ))
+     .           +Rho(DBLE(tt(i2+1,j2+1,m1-1,l2)),
+     .                DBLE(ss(i3+1,j3+1,m1-1,l3)),zU(m-1))
+     .           +Rho(DBLE(tt(i2  ,j2+1,m1  ,l2)),
+     .                DBLE(ss(i3  ,j3+1,m1  ,l3)),zU(m  ))
+     .           +Rho(DBLE(tt(i2  ,j2+1,m1-1,l2)),
+     .                DBLE(ss(i3  ,j3+1,m1-1,l3)),zU(m-1))
+     .           -Rho(DBLE(tt(i2+1,j2  ,m1  ,l2)),
+     .                DBLE(ss(i3+1,j3  ,m1  ,l3)),zU(m  ))
+     .           -Rho(DBLE(tt(i2+1,j2  ,m1-1,l2)),
+     .                DBLE(ss(i3+1,j3  ,m1-1,l3)),zU(m-1))
+     .           -Rho(DBLE(tt(i2  ,j2  ,m1  ,l2)),
+     .                DBLE(ss(i3  ,j3  ,m1  ,l3)),zU(m  ))
+     .           -Rho(DBLE(tt(i2  ,j2  ,m1-1,l2)),
+     .                DBLE(ss(i3  ,j3  ,m1-1,l3)),zU(m-1))
+     .               )
+	               m1 = m1 + arg_incr(Z_AXIS,ARG2)
+                       ENDDO
+                       result(i,j,k,l) = result(i,j,k,l)/2.
+                     ENDIF
+                     result(i,j,k,l) = result(i,j,k,l)*RR_temp1/dyt
+     .                                   * sec_per_month
+
+                  ENDIF
+
+                 iZ = iZ + 1
+                 k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                 k3 = k3 + arg_incr(Z_AXIS,ARG3)
+                 ENDDO
+
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+            ENDDO
+
+            iLon = iLon + 1
+            i2 = i2 + arg_incr(X_AXIS,ARG2)
+            i3 = i3 + arg_incr(X_AXIS,ARG3)
+         ENDDO
+
+         iLat = iLat + 1
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+      ENDDO
+      END
+
+
+      ! Stolen KNUDSEN code to compute density
+
+      ! D = depth (m)
+      ! T = temperature (oC)
+      ! S = salinity (ppt)
+
+      REAL*8 FUNCTION Rho(T,S,D)
+      IMPLICIT NONE
+      REAL*8 T,S,D
+      REAL*8 T2,T3,S2,S3,F1,F2,F3,FS,SIGMA,A,B1,B2,B,CO,ALPHA
+      T2=T*T
+      T3=T2*T
+      S2=S*S
+      S3=S2*S
+      F1=-(T-3.98d0)**2*(T+283.d0)/(503.57d0*(T+67.26d0))
+      F2=T3*1.0843d-6-T2*9.8185d-5+T*4.786d-3
+      F3=T3*1.667d-8-T2*8.164d-7+T*1.803d-5
+      FS=S3*6.76786136d-6-S2*4.8249614d-4+S*8.14876577d-1
+      SIGMA=F1+(FS+3.895414d-2)*(1.d0-F2+F3*(FS-.22584586d0))
+      A=D*1.d-4*(105.5d0+T*9.5d0-T2*.158d0-D*T*1.5d-4)-
+     .(227.d0+T*28.33d0-T2*.551d0+T3*.004d0)
+      B1=(FS-28.1324d0)/10.d0
+      B2=B1*B1
+      B=-B1*(147.3d0-T*2.72d0+T2*.04d0-D*1.d-
+     .4*(32.4d0-.87d0*T+.02d0*T2))
+      B=B+B2*(4.5d0-.1d0*T-D*1.d-4*(1.8d0-.06d0*T))
+      CO=4886.d0/(1.d0+1.83d-5*D)
+      ALPHA=D*1.d-6*(CO+A+B)
+      Rho=(SIGMA+ALPHA)/(1.d0-1.d-3*ALPHA)
+      END
+
diff --git a/external_functions/romea/rr_grad_ps_u.F b/external_functions/romea/rr_grad_ps_u.F
new file mode 100644
index 0000000..a3035cb
--- /dev/null
+++ b/external_functions/romea/rr_grad_ps_u.F
@@ -0,0 +1,194 @@
+*           rr_grad_ps_u.F
+*
+*           Rick Romea
+*           Jan. 24, 2000
+*
+*     Computes the surface pressure gradient term in the u momentum equation
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+************************************************************************
+
+      SUBROUTINE RR_grad_ps_u_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Surface (barotropic) -dp/dx term (cm/s^2) on the MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_has_vari_args    (id, NO)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id, YES, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity,required to access MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,0,+1)
+      
+      CALL ef_set_arg_name         (id, ARG2, 'SURF_PRESS')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Surface Pressure, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'g/cm/sec^2')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,0,+1)
+      END
+
+************************************************************************
+
+      SUBROUTINE RR_grad_ps_u_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  k,  l
+      INTEGER i1, j1, k1, l1
+
+      REAL*8         xU(1024)
+      REAL*8         yU(1024)
+
+      INTEGER        ilat
+      INTEGER        ilon
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      INCLUDE 'rr_parameters.h'
+
+      REAL       csu
+      REAL       dxt
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! Get U grid coordinates
+
+      CALL ef_get_coordinates    (id, ARG1, X_AXIS, 
+     .                            arg_lo_ss(X_AXIS,ARG1),
+     .                            arg_hi_ss(X_AXIS,ARG1), xU)    
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+
+      ! check axis units
+
+      CALL ef_get_axis_info  (id, ARG2, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      ! start the loop
+
+      iLat = 1
+      j1 = arg_lo_ss(Y_AXIS,ARG2) 
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         csu = COS(SNGL(yU(iLat))*Degrees_to_radians) 
+
+         iLon = 1
+         i1 = arg_lo_ss(X_AXIS,ARG2) 
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            dxt = SNGL (xU(iLon+1)-xU(iLon)) * Longitude_to_cm
+
+            k1 = arg_lo_ss(Z_AXIS,ARG2)
+            DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG2)
+               DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF (
+     .              arg_2(i1,  j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG2) 
+     .                      ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = - (
+     .                            arg_2(i1+1,j1+1,k1,l1)
+     .                        +   arg_2(i1+1,j1  ,k1,l1)
+     .                        -   arg_2(i1  ,j1+1,k1,l1)
+     .                        -   arg_2(i1  ,j1  ,k1,l1)
+     .                ) / 2. / rho_zero / csu / dxt
+     .                 * sec_per_month
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG2)
+               ENDDO
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG2)
+            ENDDO
+
+            iLon = iLon + 1
+            i1 = i1 + arg_incr(X_AXIS,ARG2)
+         ENDDO
+
+         iLat = iLat + 1
+         j1 = j1 + arg_incr(Y_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_grad_ps_v.F b/external_functions/romea/rr_grad_ps_v.F
new file mode 100644
index 0000000..07f9187
--- /dev/null
+++ b/external_functions/romea/rr_grad_ps_v.F
@@ -0,0 +1,185 @@
+*           rr_grad_ps_v.F
+*
+*          Rick Romea
+*           Jan. 24, 2000
+*
+*     Surface pressure gradient term in the v momentum equation
+*     Units :     cm/s/s
+*     MOM2 Grid:  U   
+*
+************************************************************************
+
+      SUBROUTINE RR_grad_ps_v_init(id)
+	IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,
+     .'Surface (barotropic) -dp/dy term (cm/s^2) on the MOM2 U Grid')
+      CALL ef_set_num_args         (id, 2)
+      CALL ef_set_has_vari_args    (id, NO)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok     (id,  NO,  NO,  NO,  NO)
+
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1,
+     . 'Zonal velocity,required to access MOM2 U Grid. ')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG1, Y_AXIS,0,+1)
+      
+      CALL ef_set_arg_name         (id, ARG2, 'SURF_PRESS')
+      CALL ef_set_arg_desc         (id, ARG2,
+     . 'Surface Pressure, on the MOM2 T Grid. ')
+      CALL ef_set_arg_unit         (id, ARG2, 'g/cm/sec^2')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, NO, NO, NO, YES)
+      CALL ef_set_axis_extend      (id, ARG2, X_AXIS,0,+1)
+      CALL ef_set_axis_extend      (id, ARG2, Y_AXIS,0,+1)
+      END
+
+************************************************************************
+
+      SUBROUTINE RR_grad_ps_v_compute(id, arg_1, arg_2, result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER i,  j,  k,  l
+      INTEGER i1, j1, k1, l1
+
+      REAL*8         yU(1024)
+
+      INTEGER        ilat
+
+      CHARACTER *16  ax_name(4)
+      CHARACTER *16  ax_units(4)
+      LOGICAL        backward(4)
+      LOGICAL        modulo(4)
+      LOGICAL        regular(4)
+
+      REAL       dyt
+
+	INCLUDE 'rr_parameters.h'
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! Get U grid coordinates
+
+      CALL ef_get_coordinates    (id, ARG1, Y_AXIS, 
+     .                            arg_lo_ss(Y_AXIS,ARG1),
+     .                            arg_hi_ss(Y_AXIS,ARG1), yU)
+
+      ! check axis units
+
+      CALL ef_get_axis_info  (id, ARG2, ax_name, ax_units, 
+     .                                backward, modulo, regular) 
+      IF     ( ax_units(1) .NE. 'deg'       .AND.
+     .         ax_units(1) .NE. 'lon'       .AND.
+     .         ax_units(1) .NE. 'degrees_E' .AND.
+     .         ax_units(1) .NE. 'longitude' .AND.
+     .         ax_units(1) .NE. 'Longitude' .AND. 
+     .         ax_units(1) .NE. 'LONGITUDE' ) THEN
+        WRITE (6,*)'Longitude axis units =', ax_units(1) 
+        ! CALL ef_bail_out(id,'Longitude axis must be in degrees')
+      ENDIF
+
+      IF     ( ax_units(2) .NE. 'deg'       .AND.
+     .         ax_units(2) .NE. 'lat'       .AND.
+     .         ax_units(2) .NE. 'degrees_N' .AND.
+     .         ax_units(2) .NE. 'latitude'  .AND.
+     .         ax_units(2) .NE. 'Latitude'  .AND. 
+     .         ax_units(2) .NE. 'LATITUDE' ) THEN
+        WRITE (6,*)'Latitude axis units =', ax_units(2) 
+        ! CALL ef_bail_out(id,'Latitude axis must be in degrees')
+      ENDIF
+
+      ! start the loop
+
+      iLat = 1
+      j1 = arg_lo_ss(Y_AXIS,ARG2) 
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         dyt = SNGL  (yU(iLat+1)-yU(iLat)) * Longitude_to_cm
+
+         i1 = arg_lo_ss(X_AXIS,ARG2) 
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG2)
+            DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG2)
+               DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF (
+     .              arg_2(i1,  j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1,  j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1,  j1-1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1+1,j1-1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1,  k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1+1,k1,l1) .EQ. bad_flag(ARG2) .OR.
+     .              arg_2(i1-1,j1-1,k1,l1) .EQ. bad_flag(ARG2) 
+     .                      ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+                     result(i,j,k,l) = - (
+     .                            arg_2(i1+1,j1+1,k1,l1)
+     .                        +   arg_2(i1  ,j1+1,k1,l1)
+     .                        -   arg_2(i1+1,j1  ,k1,l1)
+     .                        -   arg_2(i1  ,j1  ,k1,l1)
+     .                ) / 2. / rho_zero / dyt
+     .                 * sec_per_month
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG2)
+               ENDDO
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG2)
+            ENDDO
+
+            i1 = i1 + arg_incr(X_AXIS,ARG2)
+         ENDDO
+
+         iLat = iLat + 1
+         j1 = j1 + arg_incr(Y_AXIS,ARG2)
+      ENDDO
+      END
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_parameters.h b/external_functions/romea/rr_parameters.h
new file mode 100644
index 0000000..b90ef46
--- /dev/null
+++ b/external_functions/romea/rr_parameters.h
@@ -0,0 +1,123 @@
+*           rr_parameters.h
+*
+*           Rick Romea
+*           Jan. 5 2000
+*
+*     Parameters for the RR external functions
+*
+*******************************************************************
+
+      ! Something good to eat!
+
+      REAL       RR_pi
+      PARAMETER (RR_pi = 3.1415927)
+      
+      ! Earth's radius (cm)
+
+      REAL       RR_radius
+      PARAMETER (RR_radius = 6370.e5) 
+      
+      ! Convert: degrees --> radians
+
+      REAL       Degrees_to_radians
+      PARAMETER (Degrees_to_radians = RR_pi/180.)
+
+      ! Coriolis term  (1/sec)
+
+      REAL       Two_Omega
+      PARAMETER (Two_Omega = 2. * RR_pi / 43082.)  
+	  
+      ! Convert: deg --> cm   
+
+      REAL       Longitude_to_cm
+      PARAMETER (Longitude_to_cm = RR_pi*RR_Radius/180.)
+
+      ! Convert: deg --> cm   
+     
+      REAL       Latitude_to_cm
+      PARAMETER (Latitude_to_cm = RR_pi*RR_Radius/180.)
+      
+      ! Convert: m --> cm
+
+      REAL       Meters_to_cm
+      PARAMETER (Meters_to_cm = 100.)
+
+      ! Density (g/cm^3)
+
+      REAL       Rho_zero
+      PARAMETER (Rho_zero = 1.035) 
+      
+      ! Time conversion :  Convert: month --> sec
+	
+      ! NOTE: I have set  sec_per_month = 1, so the functions return 
+      !       eg.,  cm/s/s, not cm/s/month
+  
+      REAL       sec_per_month
+      PARAMETER (sec_per_month = 1.)
+      ! PARAMETER (sec_per_month = 60.*60.*24.*30.)
+							   
+      ! ah = constant lateral diffusion coeff for tracers (cm**2/sec)
+
+      REAL       ah 
+      PARAMETER (ah = 2.e7)  
+	   
+      ! am = constant lateral viscosity coeff for momentum ( cm**2/sec)
+		 
+      REAL       am 
+      PARAMETER (am = 1.e7)  
+
+      ! fricmx = maximum  diffusion coefficient (cm**2/s) 
+
+      REAL       fricmx      
+      PARAMETER (fricmx = 50.)
+
+      ! diff_cbt_limit = large diffusion coefficient (cm**2/sec) 
+																         
+      REAL       diff_cbt_limit
+      PARAMETER (diff_cbt_limit = fricmx)
+      
+      ! diff_cbt_back  = background diffusion coefficient (cm**2/s)
+	  
+      REAL       diff_cbt_back 
+      PARAMETER (diff_cbt_back = 0.1)
+    	  
+      !  visc_cbu_limit = largest viscosity (cm**2/sec)
+      
+      REAL       visc_cbu_limit
+      PARAMETER (visc_cbu_limit = fricmx)
+      
+      ! visc_cbu_back  = background viscosity (cm**2/s)  
+	  
+      REAL       visc_cbu_back 
+      PARAMETER (visc_cbu_back = 1.)
+
+      ! wndmix = min value for diffusion coefficient at surface to 
+      !          simulate high freq wind mixing. (cm**2/sec)  
+	  										  
+      REAL       wndmix        
+      PARAMETER (wndmix = 10.)
+
+      ! gravity (cm/sec**2)
+     
+      REAL       gravity
+      PARAMETER (gravity = 980.6) 
+
+      REAL       grav
+      PARAMETER (grav = gravity) 
+
+      ! small value
+	
+      REAL       epsln
+      PARAMETER (epsln = 1.e-25)
+
+	  
+      ! Temporary variable
+
+      REAL	 RR_temp1
+      PARAMETER (RR_temp1 = -Meters_to_cm*gravity/2./Rho_zero)
+
+      ! 
+      REAL       dyt_ref  ! dyt(50)
+      PARAMETER (dyt_ref = .333*Latitude_to_cm)
+
+
diff --git a/external_functions/romea/rr_taux.F b/external_functions/romea/rr_taux.F
new file mode 100644
index 0000000..fcc1bcd
--- /dev/null
+++ b/external_functions/romea/rr_taux.F
@@ -0,0 +1,368 @@
+*  rr_taux.F
+*
+*     Rick Romea
+*     Feb. 4, 2000
+*
+*   Sea Surface Wind Stress  (DYNE/CM**2)  
+*  
+************************************************************************
+
+      SUBROUTINE RR_taux_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,' Zonal Wind Stress(dyn/cm^3)')
+      CALL ef_set_num_args         (id, 4)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS,IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+      CALL ef_set_axis_reduction   (id, RETAINED,RETAINED,         
+     .                                  RETAINED,RETAINED)          
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1, 'Zonal wind speed')
+      CALL ef_set_arg_unit         (id, ARG1, 'm/s')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2, 'Meridional wind speed')
+      CALL ef_set_arg_unit         (id, ARG2, 'm/s')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG3, 'AIRT')
+      CALL ef_set_arg_desc         (id, ARG3, 'AIR TEMPERATURE')
+      CALL ef_set_arg_unit         (id, ARG3, 'oC')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SST')
+      CALL ef_set_arg_desc         (id, ARG4, 'Sea Surface Temperature')
+      CALL ef_set_arg_unit         (id, ARG4, 'oC')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,YES,YES)
+
+      END
+
+c*******************************************************************
+
+      SUBROUTINE RR_taux_compute(id,arg_1,arg_2,arg_3,arg_4,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .             mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .             mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER  i,  j,  k,  l
+      INTEGER  i1, j1, l1
+      INTEGER  i2, j2, l2
+      INTEGER  i3, j3, l3
+      INTEGER  i4, j4, l4
+
+      REAL AirDensity
+      PARAMETER (AirDensity = 0.00125)
+      REAL zu
+      PARAMETER (zu = 10.)
+      REAL zt
+      PARAMETER (zt = 10.)
+      REAL zq
+      PARAMETER (zq = 0.)
+      REAL Cd, uz
+      REAL QZ,TOL,UW,WT,WQ
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! This is a dummy axis, since z is reduced
+      DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        l2 = arg_lo_ss(T_AXIS,ARG2)
+        l3 = arg_lo_ss(T_AXIS,ARG3)
+        l4 = arg_lo_ss(T_AXIS,ARG4)
+
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1) 
+          j2 = arg_lo_ss(Y_AXIS,ARG2) 
+          j3 = arg_lo_ss(Y_AXIS,ARG2) 
+          j4 = arg_lo_ss(Y_AXIS,ARG3) 
+        
+          DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) 
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            i3 = arg_lo_ss(X_AXIS,ARG3)
+            i4 = arg_lo_ss(X_AXIS,ARG4)
+ 
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+              
+              IF (arg_1(i1,j1,k,l1) .EQ. bad_flag(ARG1) .OR.
+     .            arg_2(i2,j2,k,l2) .EQ. bad_flag(ARG2) .OR.
+     .            arg_3(i3,j3,k,l3) .EQ. bad_flag(ARG3) .OR.
+     .            arg_4(i4,j4,k,l4) .EQ. bad_flag(ARG4) )THEN
+                 result(i,j,k,l) = bad_flag_result
+              ELSE
+
+                uz = SQRT(arg_1(i1,j1,k,l1)*arg_1(i1,j1,k,l1)
+     .                +  arg_2(i2,j2,k,l2)*arg_2(i2,j2,k,l2))
+                IF (uz .LT. 0.1) THEN
+                  result(i,j,k,l) = 0.
+                ELSE 
+                  CALL Bulk(uz,zu,arg_3(i3,j3,k,l3),zt,QZ,zq,
+     .                       arg_4(i4,j4,k,l4),TOL,UW,WT,WQ,Cd)
+                  result(i,j,k,l) = AirDensity * Cd * uz 
+     .                                * arg_1(i1,j1,k,l1)*1.e4
+                ENDIF 
+              ENDIF
+
+              i1 = i1 + arg_incr(X_AXIS,ARG1)
+              i2 = i2 + arg_incr(X_AXIS,ARG2)
+              i3 = i3 + arg_incr(X_AXIS,ARG3)
+              i4 = i4 + arg_incr(X_AXIS,ARG4)
+            ENDDO ! i index
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+          ENDDO ! j index
+
+          l1 = l1 + arg_incr(T_AXIS,ARG1)
+          l2 = l2 + arg_incr(T_AXIS,ARG2)
+          l3 = l3 + arg_incr(T_AXIS,ARG3)
+          l4 = l4 + arg_incr(T_AXIS,ARG4)
+        ENDDO ! l index
+
+      ENDDO  ! k index
+
+      END
+
+
+
+
+
+
+	SUBROUTINE BULK(UZ,ZU,TZ,ZT,QZ,ZQ,TSFC,TOL,UW,WT,WQ,CD)
+
+*	Minor (I hope) mods made for SSMI stress calc's
+*	J Davison 1.24.91
+*	No mods made for ECMWF stress calc's
+*	J Davison 3.22.93
+
+C	FOLLOWING PROCEDURES AND COEFFICIENTS IN LARGE AND POND (1981 AND
+C	1982 BULK; ESTIMATE
+C		1) TOL, THE STABILITY PARAMETER Z/L AT Z=10 METERS
+C		2)  UW, THE KINEMATIC MOMENTUM FLUX (M/S)**2
+C		3)  WT, THE KINEMATIC SENSIBLE HEAT FLUX (DEGREES M/S)
+C		4)  WQ, THE KINEMATIC LATENT HEAT FLUX (M/S, G/M**3)
+C
+C	FROM	1)  UZ, THE MEAN WIND SPEED  [M/S -- JD 1.24.91] AT HEIGHT ZU
+C		2)  TZ, THE MEAN AIR TEMPERATURE (CELSIUS)       AT HEIGHT ZT
+C		3)  QZ, THE MEAN AIR HUMIDITY (G/M**3)           AT HEIGHT ZQ
+C		4) TSFC, THE SEA SURFACE TEMPERATURE (CELSIUS)
+C
+c      OPTIONS  1) set ZQ=0 to assume a relative humidity of RH=75%
+c                DEH changed so RH is set in calling pgm and passed thru common
+c                if zq=0.    change made 12/30/85
+
+*		 Not 'passed thru common' but initialized in a data stmt JD 1.91
+
+C		2) SET ZT=0 TO FIND ONLY UW AT NEUTRAL STABILITY
+C		3) SET ZU=0 TO RETURN ONLY WITH TOL
+C
+C     ASSUME	1) A NEUTRAL 10M DRAG COEFFICIENT CDN=0.00115  U10<UCH  11M/S
+C				          =0.00049 + 0.000065  U10>UCH  11M/S
+C		2) A NEUTRAL 10M STANTON NUMBER   CTN=0.00115  Z/L<0    0
+C						     =0.00075  Z/L>0    0
+C		3) A NEUTRAL 10M DALTON NUMBER    CEN=0.00115  ALWAYS
+C		4) VONK = 0.40 VON KARMAN'S CONSTANT
+C		5) THE SMALL WT REGRESSION, WTR BELOW IF BIG=FALSE
+C		       WITH A=(.0008,  Z/L>0)   =(.0010,  Z/L<0)
+	LOGICAL BIG
+
+*  ARGUMENT DECLARATIONS
+
+      REAL UZ, ZU, TZ, ZT, QZ, ZQ, TSFC, TOL, UW, WT, WQ, CD
+
+*  LOCAL VARIABLE DECLARATIONS
+
+      INTEGER iter
+      REAL    a, u, dth, t, cda, cts, ctu, cea, uch, rh, vonk, delth, 
+     .        qsat, delq, tkelv, f1, t0, udt, f2, wtr, u3, zuol, ztol, 
+     .        zqol, p10, pg10, s10, sg10, phim, phi, psim, phit, psimt, 
+     .        psit, phiq, psimq, rk, up, cp, u10, diff, cdn, sqcd, rcd,
+     .        ctn, rcdt, ct, rkt, dth10, cen, rcdq, ce, psi, psiq
+
+	WTR(A,U,DTH) = 0.002 + A*U*DTH
+C
+C		6) THE SATURATION HUMIDITY OF AIR AT T CELSIUS QSAT(T) SAT(T) I
+C
+	QSAT(T) = 640380000./EXP(5107.4/(273.16 + T))
+C
+	DATA CDA,CTS,CTU,CEA,UCH/0.00115,0.00075,0.00115,0.00115,10./
+	DATA RH,VONK/0.75,0.40/
+
+*	Mod made to incorporate INITAL2 within the BULK subroutine JD 1.24.91
+	tol = 0.0
+	uw  = 0.0
+	wt  = 0.0
+	wq  = 0.0
+	cd  = 0.0
+*	End mod JD 1.24.91
+
+C				ARE THE TEMPERATURES RELIABLE??
+
+	IF(ZT .GT. 0.2) GO TO 1
+	TOL = 0.0
+	GO TO 3
+C
+C YES		CALCULATE A BULK STABILITY PARAMETER AT 10 METERS FROM
+C		   DELTH, SURFACE-AIR POTENTIAL TEMPERATURE DIFFERENCE
+C		   QSFC,  SURFACE  ABSOLUTE  HUMIDITY
+C		   T0,    LOCAL MEAN VIRTUAL TEMPERATURE
+   1	DELTH = TSFC-TZ-0.01*ZT
+	IF(ZQ .LE. 0.0) QZ = RH*QSAT(TZ)
+	DELQ = 0.98*QSAT(TSFC)-QZ
+	TKELV = 273.16 + TZ
+	F1 = 0.00000172
+	T0 = TKELV + QZ*F1*TKELV**2
+C
+C		IS /WT/ LARGE ENOUGH TO USE TRANSFER COEFFICIENTS?
+C
+	UDT = UZ*DELTH
+	IF((UDT .LT. 10.) .AND. (UDT .GT. -15.)) GO TO 2
+C YES
+	BIG = .TRUE.
+	F2 = 1.00
+	IF(DELTH .LT. 0.0) F2 = 0.70
+	TOL = 0.0 - 1000.*F2/T0/UZ**2*(DELTH + F1/F2*DELQ*T0**2)
+	GO TO 3
+C
+C NO		       DEAL WITH SMALL SENSIBLE HEAT FLUXES
+C
+   2	BIG = .FALSE.
+	A = 0.0010
+	IF(DELTH .LT. 0.0) A = 0.0008
+	WT = WTR(A,UZ,DELTH)
+	WQ = CEA*UZ*DELQ
+	U3 = (SQRT(CDA)*UZ)**3
+	TOL = 0.0 - 39./U3/T0*(WT + F1*WQ*T0**2)
+C
+C		RETURN WITH ONLY TOL IF ZU NOT GREATER THAN 0.2
+C 
+  3	IF(ZU .LE. 0.2) RETURN
+	ZUOL = TOL*ZU/10.0
+	ZTOL = TOL*ZT/10.0
+	ZQOL = TOL*ZQ/10.0
+C		EVALUATE THE STABILITY FUNCTIONS IN FZOL
+	CALL FZOL(TOL,P10,PG10,S10,SG10)
+	CALL FZOL(ZUOL,PHIM,PHI,PSIM,PSI)
+	CALL FZOL(ZTOL,PHI,PHIT,PSIMT,PSIT)
+	CALL FZOL(ZQOL,PHI,PHIQ,PSIMQ,PSIQ)
+C
+C	SOLVE FOR U10 AND CDN ITERATIVELY
+C
+	RK = (ALOG(ZU/10.0) - PSIM + S10)/VONK
+	ITER = 1
+	UP = UZ/(1.0 + SQRT(CDA)*RK)
+  22	CP = CDA
+	IF(UP .GT. UCH) CP = (0.49 + 0.065*UP)/1000.
+	U10 = UZ/(1.0 + SQRT(CP)*RK)
+	DIFF = (UP - U10)/UP
+	UP = U10
+	IF(DIFF .LE. 0.01) GO TO 4
+	ITER = ITER + 1
+	IF(ITER .LE. 5) GO TO 22
+	WRITE(8,66) ITER,U10,DIFF,CP
+  66	FORMAT('-',5X,'TOO BAD, FAILED TO CONVERGE IN 5 ITERATIONS',
+     .  I6,3F16.4)
+	STOP
+C
+C		SOLVED FOR U10, NOW FIND CDN AND CD
+C		THEN GET UW FROM BULK FORMULA
+C
+   4	CDN = CDA
+	IF(U10 .GT. UCH) CDN = (0.49 + 0.065*U10)/1000.
+	SQCD = SQRT(CDN)
+	RCD = 1.0 + SQCD/VONK*(ALOG(ZU/10.0) - PSIM)
+	CD = CDN/RCD**2
+	UW = 0.0 - CD*UZ**2
+C
+C		SENSIBLE HEAT FLUX IF ZT SET GREATER THAN 0.02
+C
+	IF(ZT .LE. 0.02) GO TO 5
+	CTN = CTU
+	IF(DELTH .LT. 0.0) CTN = CTS
+	RCDT = 1.0 + SQCD/VONK*(ALOG(ZT/10.0) - PSIMT)
+	CT = CTN/RCDT/(1.0 + CTN/VONK/SQCD*(ALOG(ZT/10.) - PSIT))
+	WT = CT*UZ*DELTH
+	IF(BIG) GO TO 5
+C			CALCULATE SMALL SENSIBLE HEAT FLUX
+	RKT = (ALOG(ZT/10.0) - PSIT + SG10)/VONK
+	DTH10 = DELTH - CT/SQRT(CD)*RKT*(DELTH)
+	WT = WTR(A,U10,DTH10)
+C
+C		LATENT (MOISTURE) FLUX IF ZQ SET GREATER THAN 0.02
+C
+   5	IF(ZQ .LE. 0.02) RETURN
+	CEN = CEA
+	RCDQ = 1.0 + SQCD/VONK*(ALOG(ZQ/10.0) - PSIMQ)
+	CE = CEN/RCDQ/(1.0 + CEN/VONK/SQCD*(ALOG(ZQ/10.) - PSIQ))
+	WQ = CE*UZ*DELQ
+	RETURN
+	END
+C
+	SUBROUTINE FZOL(ZOL,PHIM,PHIG,PSIM,PSIG)
+C FZOL:		SUBROUTINE TO ESTIMATE THE STABILITY FUNCTIONS
+C		USING THE MOST UP TO DATE FLUX-PROFILE RELATIONSHIPS
+C
+
+*  ARGUMENT DECLARATIONS
+
+        REAL ZOL,PHIM,PHIG,PSIM,PSIG
+
+*  LOCAL VARIABLE DECLARATIONS
+
+        REAL X
+
+	IF(ZOL .GE. 0.0) GO TO 2
+C		UNSTABLE
+	X = (1.0 - 16.0*ZOL)**0.25
+	PHIM = 1.0/X
+	PHIG = PHIM**2
+	PSIG = 2.0*ALOG(0.5 + 0.5*X**2)
+	PSIM = 0.5*PSIG + 2.0*ALOG(0.5*(1.0 + X)) - 2.0*ATAN(X) + 1.571
+	RETURN
+C
+C		STABLE
+C
+  2	PHIG = 1.0 + 7.0*ZOL
+	PHIM = 1.0 + 7.0*ZOL
+	PSIG = -7.0*ZOL
+	PSIM = -7.0*ZOL
+	RETURN
+	END
+
diff --git a/external_functions/romea/rr_tauy.F b/external_functions/romea/rr_tauy.F
new file mode 100644
index 0000000..f759d18
--- /dev/null
+++ b/external_functions/romea/rr_tauy.F
@@ -0,0 +1,366 @@
+*  rr_tauy.F
+*
+*     Rick Romea
+*     Feb. 4, 2000
+*
+*   Sea Surface Wind Stress  (DYNE/CM**2)  
+*  
+************************************************************************
+
+      SUBROUTINE RR_tauy_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id, 
+     .       'Meridional Wind Stress(dyn/cm^3)')
+      CALL ef_set_num_args         (id, 4)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS,IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+      CALL ef_set_axis_reduction   (id, RETAINED,RETAINED,         
+     .                                  RETAINED,RETAINED)          
+      CALL ef_set_arg_name         (id, ARG1, 'U')
+      CALL ef_set_arg_desc         (id, ARG1, 'Zonal wind speed')
+      CALL ef_set_arg_unit         (id, ARG1, 'm/s')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG2, 'V')
+      CALL ef_set_arg_desc         (id, ARG2, 'Meridional wind speed')
+      CALL ef_set_arg_unit         (id, ARG2, 'm/s')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG3, 'AIRT')
+      CALL ef_set_arg_desc         (id, ARG3, 'AIR TEMPERATURE')
+      CALL ef_set_arg_unit         (id, ARG3, 'oC')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, YES,YES,YES,YES)
+
+      CALL ef_set_arg_name         (id, ARG4, 'SST')
+      CALL ef_set_arg_desc         (id, ARG4, 'Sea Surface Temperature')
+      CALL ef_set_arg_unit         (id, ARG4, 'oC')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,YES,YES,YES)
+
+      END
+
+c*******************************************************************
+
+      SUBROUTINE RR_tauy_compute(id,arg_1,arg_2,arg_3,arg_4,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS)
+      REAL bad_flag_result
+      REAL arg_1  (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .             mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2  (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .             mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3  (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .             mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4  (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .             mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result (memreslox:memreshix, memresloy:memreshiy, 
+     .             memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER  res_lo_ss (4)
+      INTEGER  res_hi_ss (4)
+      INTEGER  res_incr  (4)
+
+      INTEGER  arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER  arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER  i,  j,  k,  l
+      INTEGER  i1, j1, l1
+      INTEGER  i2, j2, l2
+      INTEGER  i3, j3, l3
+      INTEGER  i4, j4, l4
+
+      REAL AirDensity
+      PARAMETER (AirDensity = 0.00125)
+      REAL zu
+      PARAMETER (zu = 10.)
+      REAL zt
+      PARAMETER (zt = 10.)
+      REAL zq
+      PARAMETER (zq = 0.)
+      REAL Cd, uz
+      REAL QZ,TOL,UW,WT,WQ
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags      (id, bad_flag,  bad_flag_result)
+
+      ! This is a dummy axis, since z is reduced
+      DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+        l1 = arg_lo_ss(T_AXIS,ARG1)
+        l2 = arg_lo_ss(T_AXIS,ARG2)
+        l3 = arg_lo_ss(T_AXIS,ARG3)
+        l4 = arg_lo_ss(T_AXIS,ARG4)
+
+        DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+          j1 = arg_lo_ss(Y_AXIS,ARG1) 
+          j2 = arg_lo_ss(Y_AXIS,ARG2) 
+          j3 = arg_lo_ss(Y_AXIS,ARG2) 
+          j4 = arg_lo_ss(Y_AXIS,ARG3) 
+        
+          DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1) 
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            i3 = arg_lo_ss(X_AXIS,ARG3)
+            i4 = arg_lo_ss(X_AXIS,ARG4)
+ 
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+              
+              IF ( arg_1(i1,j1,k,l1) .EQ. bad_flag(ARG1) .OR.
+     .            arg_2(i2,j2,k,l2) .EQ. bad_flag(ARG2) .OR.
+     .            arg_3(i3,j3,k,l3) .EQ. bad_flag(ARG3) .OR.
+     .            arg_4(i4,j4,k,l4) .EQ. bad_flag(ARG4) )THEN
+                 result(i,j,k,l) = bad_flag_result
+              ELSE
+
+                uz = SQRT(arg_1(i1,j1,k,l1)*arg_1(i1,j1,k,l1)
+     .                +  arg_2(i2,j2,k,l2)*arg_2(i2,j2,k,l2))
+                IF (uz .LT. 0.1) THEN
+                  result(i,j,k,l) = 0.
+                ELSE 
+                  CALL Bulk(uz,zu,arg_3(i3,j3,k,l3),zt,QZ,zq,
+     .                       arg_4(i4,j4,k,l4),TOL,UW,WT,WQ,Cd)
+                  result(i,j,k,l) = AirDensity * Cd * uz 
+     .                                * arg_2(i2,j2,k,l2)*1.e4
+                ENDIF 
+              ENDIF
+
+              i1 = i1 + arg_incr(X_AXIS,ARG1)
+              i2 = i2 + arg_incr(X_AXIS,ARG2)
+              i3 = i3 + arg_incr(X_AXIS,ARG3)
+              i4 = i4 + arg_incr(X_AXIS,ARG4)
+            ENDDO ! i index
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j4 = j4 + arg_incr(Y_AXIS,ARG4)
+          ENDDO ! j index
+
+          l1 = l1 + arg_incr(T_AXIS,ARG1)
+          l2 = l2 + arg_incr(T_AXIS,ARG2)
+          l3 = l3 + arg_incr(T_AXIS,ARG3)
+          l4 = l4 + arg_incr(T_AXIS,ARG4)
+        ENDDO ! l index
+
+      ENDDO  ! k index
+
+      END
+
+
+
+
+
+	SUBROUTINE BULK(UZ,ZU,TZ,ZT,QZ,ZQ,TSFC,TOL,UW,WT,WQ,CD)
+
+*	Minor (I hope) mods made for SSMI stress calc's
+*	J Davison 1.24.91
+*	No mods made for ECMWF stress calc's
+*	J Davison 3.22.93
+
+C	FOLLOWING PROCEDURES AND COEFFICIENTS IN LARGE AND POND (1981 AND
+C	1982 BULK; ESTIMATE
+C		1) TOL, THE STABILITY PARAMETER Z/L AT Z=10 METERS
+C		2)  UW, THE KINEMATIC MOMENTUM FLUX (M/S)**2
+C		3)  WT, THE KINEMATIC SENSIBLE HEAT FLUX (DEGREES M/S)
+C		4)  WQ, THE KINEMATIC LATENT HEAT FLUX (M/S, G/M**3)
+C
+C	FROM	1)  UZ, THE MEAN WIND SPEED  [M/S -- JD 1.24.91] AT HEIGHT ZU
+C		2)  TZ, THE MEAN AIR TEMPERATURE (CELSIUS)       AT HEIGHT ZT
+C		3)  QZ, THE MEAN AIR HUMIDITY (G/M**3)           AT HEIGHT ZQ
+C		4) TSFC, THE SEA SURFACE TEMPERATURE (CELSIUS)
+C
+c      OPTIONS  1) set ZQ=0 to assume a relative humidity of RH=75%
+c                DEH changed so RH is set in calling pgm and passed thru common
+c                if zq=0.    change made 12/30/85
+
+*		 Not 'passed thru common' but initialized in a data stmt JD 1.91
+
+C		2) SET ZT=0 TO FIND ONLY UW AT NEUTRAL STABILITY
+C		3) SET ZU=0 TO RETURN ONLY WITH TOL
+C
+C     ASSUME	1) A NEUTRAL 10M DRAG COEFFICIENT CDN=0.00115  U10<UCH  11M/S
+C				          =0.00049 + 0.000065  U10>UCH  11M/S
+C		2) A NEUTRAL 10M STANTON NUMBER   CTN=0.00115  Z/L<0    0
+C						     =0.00075  Z/L>0    0
+C		3) A NEUTRAL 10M DALTON NUMBER    CEN=0.00115  ALWAYS
+C		4) VONK = 0.40 VON KARMAN'S CONSTANT
+C		5) THE SMALL WT REGRESSION, WTR BELOW IF BIG=FALSE
+C		       WITH A=(.0008,  Z/L>0)   =(.0010,  Z/L<0)
+	LOGICAL BIG
+
+*  ARGUMENT DECLARATIONS
+
+      REAL UZ, ZU, TZ, ZT, QZ, ZQ, TSFC, TOL, UW, WT, WQ, CD
+
+*  LOCAL VARIABLE DECLARATIONS
+
+      INTEGER iter
+      REAL    a, u, dth, t, cda, cts, ctu, cea, uch, rh, vonk, delth, 
+     .        qsat, delq, tkelv, f1, t0, udt, f2, wtr, u3, zuol, ztol, 
+     .        zqol, p10, pg10, s10, sg10, phim, phi, psim, phit, psimt, 
+     .        psit, phiq, psimq, rk, up, cp, u10, diff, cdn, sqcd, rcd,
+     .        ctn, rcdt, ct, rkt, dth10, cen, rcdq, ce, psi, psiq
+
+	WTR(A,U,DTH) = 0.002 + A*U*DTH
+C
+C		6) THE SATURATION HUMIDITY OF AIR AT T CELSIUS QSAT(T) SAT(T) I
+C
+	QSAT(T) = 640380000./EXP(5107.4/(273.16 + T))
+C
+	DATA CDA,CTS,CTU,CEA,UCH/0.00115,0.00075,0.00115,0.00115,10./
+	DATA RH,VONK/0.75,0.40/
+
+*	Mod made to incorporate INITAL2 within the BULK subroutine JD 1.24.91
+	tol = 0.0
+	uw  = 0.0
+	wt  = 0.0
+	wq  = 0.0
+	cd  = 0.0
+*	End mod JD 1.24.91
+
+C				ARE THE TEMPERATURES RELIABLE??
+
+	IF(ZT .GT. 0.2) GO TO 1
+	TOL = 0.0
+	GO TO 3
+C
+C YES		CALCULATE A BULK STABILITY PARAMETER AT 10 METERS FROM
+C		   DELTH, SURFACE-AIR POTENTIAL TEMPERATURE DIFFERENCE
+C		   QSFC,  SURFACE  ABSOLUTE  HUMIDITY
+C		   T0,    LOCAL MEAN VIRTUAL TEMPERATURE
+   1	DELTH = TSFC-TZ-0.01*ZT
+	IF(ZQ .LE. 0.0) QZ = RH*QSAT(TZ)
+	DELQ = 0.98*QSAT(TSFC)-QZ
+	TKELV = 273.16 + TZ
+	F1 = 0.00000172
+	T0 = TKELV + QZ*F1*TKELV**2
+C
+C		IS /WT/ LARGE ENOUGH TO USE TRANSFER COEFFICIENTS?
+C
+	UDT = UZ*DELTH
+	IF((UDT .LT. 10.) .AND. (UDT .GT. -15.)) GO TO 2
+C YES
+	BIG = .TRUE.
+	F2 = 1.00
+	IF(DELTH .LT. 0.0) F2 = 0.70
+	TOL = 0.0 - 1000.*F2/T0/UZ**2*(DELTH + F1/F2*DELQ*T0**2)
+	GO TO 3
+C
+C NO		       DEAL WITH SMALL SENSIBLE HEAT FLUXES
+C
+   2	BIG = .FALSE.
+	A = 0.0010
+	IF(DELTH .LT. 0.0) A = 0.0008
+	WT = WTR(A,UZ,DELTH)
+	WQ = CEA*UZ*DELQ
+	U3 = (SQRT(CDA)*UZ)**3
+	TOL = 0.0 - 39./U3/T0*(WT + F1*WQ*T0**2)
+C
+C		RETURN WITH ONLY TOL IF ZU NOT GREATER THAN 0.2
+C 
+  3	IF(ZU .LE. 0.2) RETURN
+	ZUOL = TOL*ZU/10.0
+	ZTOL = TOL*ZT/10.0
+	ZQOL = TOL*ZQ/10.0
+C		EVALUATE THE STABILITY FUNCTIONS IN FZOL
+	CALL FZOL(TOL,P10,PG10,S10,SG10)
+	CALL FZOL(ZUOL,PHIM,PHI,PSIM,PSI)
+	CALL FZOL(ZTOL,PHI,PHIT,PSIMT,PSIT)
+	CALL FZOL(ZQOL,PHI,PHIQ,PSIMQ,PSIQ)
+C
+C	SOLVE FOR U10 AND CDN ITERATIVELY
+C
+	RK = (ALOG(ZU/10.0) - PSIM + S10)/VONK
+	ITER = 1
+	UP = UZ/(1.0 + SQRT(CDA)*RK)
+  22	CP = CDA
+	IF(UP .GT. UCH) CP = (0.49 + 0.065*UP)/1000.
+	U10 = UZ/(1.0 + SQRT(CP)*RK)
+	DIFF = (UP - U10)/UP
+	UP = U10
+	IF(DIFF .LE. 0.01) GO TO 4
+	ITER = ITER + 1
+	IF(ITER .LE. 5) GO TO 22
+	WRITE(8,66) ITER,U10,DIFF,CP
+  66	FORMAT('-',5X,'TOO BAD, FAILED TO CONVERGE IN 5 ITERATIONS',
+     .  I6,3F16.4)
+	STOP
+C
+C		SOLVED FOR U10, NOW FIND CDN AND CD
+C		THEN GET UW FROM BULK FORMULA
+C
+   4	CDN = CDA
+	IF(U10 .GT. UCH) CDN = (0.49 + 0.065*U10)/1000.
+	SQCD = SQRT(CDN)
+	RCD = 1.0 + SQCD/VONK*(ALOG(ZU/10.0) - PSIM)
+	CD = CDN/RCD**2
+	UW = 0.0 - CD*UZ**2
+C
+C		SENSIBLE HEAT FLUX IF ZT SET GREATER THAN 0.02
+C
+	IF(ZT .LE. 0.02) GO TO 5
+	CTN = CTU
+	IF(DELTH .LT. 0.0) CTN = CTS
+	RCDT = 1.0 + SQCD/VONK*(ALOG(ZT/10.0) - PSIMT)
+	CT = CTN/RCDT/(1.0 + CTN/VONK/SQCD*(ALOG(ZT/10.) - PSIT))
+	WT = CT*UZ*DELTH
+	IF(BIG) GO TO 5
+C			CALCULATE SMALL SENSIBLE HEAT FLUX
+	RKT = (ALOG(ZT/10.0) - PSIT + SG10)/VONK
+	DTH10 = DELTH - CT/SQRT(CD)*RKT*(DELTH)
+	WT = WTR(A,U10,DTH10)
+C
+C		LATENT (MOISTURE) FLUX IF ZQ SET GREATER THAN 0.02
+C
+   5	IF(ZQ .LE. 0.02) RETURN
+	CEN = CEA
+	RCDQ = 1.0 + SQCD/VONK*(ALOG(ZQ/10.0) - PSIMQ)
+	CE = CEN/RCDQ/(1.0 + CEN/VONK/SQCD*(ALOG(ZQ/10.) - PSIQ))
+	WQ = CE*UZ*DELQ
+	RETURN
+	END
+C
+	SUBROUTINE FZOL(ZOL,PHIM,PHIG,PSIM,PSIG)
+C FZOL:		SUBROUTINE TO ESTIMATE THE STABILITY FUNCTIONS
+C		USING THE MOST UP TO DATE FLUX-PROFILE RELATIONSHIPS
+C
+
+*  ARGUMENT DECLARATIONS
+
+        REAL ZOL,PHIM,PHIG,PSIM,PSIG
+
+*  LOCAL VARIABLE DECLARATIONS
+
+	IF(ZOL .GE. 0.0) GO TO 2
+C		UNSTABLE
+	X = (1.0 - 16.0*ZOL)**0.25
+	PHIM = 1.0/X
+	PHIG = PHIM**2
+	PSIG = 2.0*ALOG(0.5 + 0.5*X**2)
+	PSIM = 0.5*PSIG + 2.0*ALOG(0.5*(1.0 + X)) - 2.0*ATAN(X) + 1.571
+	RETURN
+C
+C		STABLE
+C
+  2	PHIG = 1.0 + 7.0*ZOL
+	PHIM = 1.0 + 7.0*ZOL
+	PSIG = -7.0*ZOL
+	PSIM = -7.0*ZOL
+	RETURN
+	END
+
diff --git a/external_functions/romea/rr_uux_qiao.F b/external_functions/romea/rr_uux_qiao.F
new file mode 100644
index 0000000..e768ddd
--- /dev/null
+++ b/external_functions/romea/rr_uux_qiao.F
@@ -0,0 +1,109 @@
+      SUBROUTINE RR_uux_Qiao_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,'u du/dx from Qiao (1997)')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'u4') 
+      CALL ef_set_arg_desc         (id, ARG1, 'u4')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG2, 'u1')
+      CALL ef_set_arg_desc         (id, ARG2, 'u1')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,  NO, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG3, 'u3')
+      CALL ef_set_arg_desc         (id, ARG3, 'u3')
+      CALL ef_set_arg_unit         (id, ARG3, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3,  NO, YES, YES, YES)
+
+      END
+
+
+      SUBROUTINE RR_uux_Qiao_compute(id,arg_1,arg_2,arg_3,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i2, j2, k2, l2
+
+      REAL           dx
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      dx = 425.2e5  ! 4 degrees of longitude in cm (at the equator)
+      ! dy = 212.7e5  ! 2 degrees of latitude in cm
+
+      i  = res_lo_ss(X_AXIS)
+      i1 = arg_lo_ss(X_AXIS,ARG1) 
+      i2 = arg_lo_ss(X_AXIS,ARG2) 
+      i3 = arg_lo_ss(X_AXIS,ARG3) 
+
+      j  = res_lo_ss(Y_AXIS)
+      j1 = arg_lo_ss(Y_AXIS,ARG1) 
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      j3 = arg_lo_ss(Y_AXIS,ARG3) 
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+           !  ARG_1 = u4 
+           !  ARG_2 = u1
+           !  ARG_3 = u3
+
+           result(i,j,k,l) = ARG_1(i1,j1,k1,l1) *
+     .        (ARG_3(i3,j3,k3,l3)-ARG_2(i2,j2,k2,l2))/dx
+
+           k1 = k1 + arg_incr(Z_AXIS,ARG1)
+           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+           k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         ENDDO 
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END				
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_vuy_qiao.F b/external_functions/romea/rr_vuy_qiao.F
new file mode 100644
index 0000000..b41306e
--- /dev/null
+++ b/external_functions/romea/rr_vuy_qiao.F
@@ -0,0 +1,108 @@
+      SUBROUTINE RR_vuy_Qiao_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,'v du/dy from Qiao (1997)')
+      CALL ef_set_num_args         (id, 3)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'v4') 
+      CALL ef_set_arg_desc         (id, ARG1, 'v4')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG2, 'u2')
+      CALL ef_set_arg_desc         (id, ARG2, 'u2')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2, YES,  NO, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG3, 'u5')
+      CALL ef_set_arg_desc         (id, ARG3, 'u5')
+      CALL ef_set_arg_unit         (id, ARG3, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3, YES,  NO, YES, YES)
+
+      END
+
+
+      SUBROUTINE RR_vuy_Qiao_compute(id,arg_1,arg_2,arg_3,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i1, j1, k1, l1
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i2, j2, k2, l2
+
+      REAL           dy
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      dy = 212.7e5  ! 2 degrees of latitude in cm
+
+      i  = res_lo_ss(X_AXIS)
+      i1 = arg_lo_ss(X_AXIS,ARG1) 
+      i2 = arg_lo_ss(X_AXIS,ARG2) 
+      i3 = arg_lo_ss(X_AXIS,ARG3) 
+
+      j  = res_lo_ss(Y_AXIS)
+      j1 = arg_lo_ss(Y_AXIS,ARG1) 
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      j3 = arg_lo_ss(Y_AXIS,ARG3) 
+
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+           !  ARG_1 = v4 
+           !  ARG_2 = u2
+           !  ARG_3 = u5
+
+           result(i,j,k,l) = ARG_1(i1,j1,k1,l1) *
+     .        (ARG_3(i3,j3,k3,l3)-ARG_2(i2,j2,k2,l2))/dy
+
+           k1 = k1 + arg_incr(Z_AXIS,ARG1)
+           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+           k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         ENDDO 
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+      ENDDO               
+      END				
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_w_qiao.F b/external_functions/romea/rr_w_qiao.F
new file mode 100644
index 0000000..2b57615
--- /dev/null
+++ b/external_functions/romea/rr_w_qiao.F
@@ -0,0 +1,158 @@
+      SUBROUTINE RR_w_Qiao_init(id)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+      CALL ef_set_desc             (id,'w integral from Qiao (1997)')
+      CALL ef_set_num_args         (id, 5)
+      CALL ef_set_axis_inheritance (id, IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS, 
+     .                                  IMPLIED_BY_ARGS)
+
+      CALL ef_set_arg_name         (id, ARG1, 'u4') 
+      CALL ef_set_arg_desc         (id, ARG1, 'u4')
+      CALL ef_set_arg_unit         (id, ARG1, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG1, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG1, YES, YES, YES, YES)
+      CALL ef_set_axis_extend      (id, ARG1, Z_AXIS,0,+1) 
+ 
+      CALL ef_set_arg_name         (id, ARG2, 'u1')
+      CALL ef_set_arg_desc         (id, ARG2, 'u1')
+      CALL ef_set_arg_unit         (id, ARG2, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG2, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG2,  NO, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG3, 'u3')
+      CALL ef_set_arg_desc         (id, ARG3, 'u3')
+      CALL ef_set_arg_unit         (id, ARG3, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG3, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG3,  NO, YES, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG4, 'v2')
+      CALL ef_set_arg_desc         (id, ARG4, 'v2')
+      CALL ef_set_arg_unit         (id, ARG4, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG4, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG4, YES,  NO, YES, YES)
+
+      CALL ef_set_arg_name         (id, ARG5, 'v5')
+      CALL ef_set_arg_desc         (id, ARG5, 'v5')
+      CALL ef_set_arg_unit         (id, ARG5, 'cm/sec')
+      CALL ef_set_arg_type         (id, ARG5, FLOAT_ARG)
+      CALL ef_set_axis_influence   (id, ARG5, YES,  NO, YES, YES)
+
+      END
+
+
+      SUBROUTINE RR_w_Qiao_compute(id,arg_1,arg_2,arg_3,arg_4,
+     .                             arg_5,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER        id
+      REAL           arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                      mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL           arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .                      mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL           arg_3 (mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .                      mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL           arg_4 (mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .                      mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL           arg_5 (mem5lox:mem5hix, mem5loy:mem5hiy, 
+     .                      mem5loz:mem5hiz, mem5lot:mem5hit)
+      REAL           result (memreslox:memreshix,memresloy:memreshiy,
+     .                       memresloz:memreshiz,memreslot:memreshit)
+      INTEGER        res_lo_ss (4)
+      INTEGER        res_hi_ss (4)
+      INTEGER        res_incr  (4)
+      INTEGER        arg_lo_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_hi_ss (4,EF_MAX_ARGS)
+      INTEGER        arg_incr  (4,EF_MAX_ARGS)
+
+      INTEGER        i,  j,  k,  l
+      INTEGER        i5, j5, k5, l5
+      INTEGER        i4, j4, k4, l4
+      INTEGER        i3, j3, k3, l3
+      INTEGER        i2, j2, k2, l2
+
+      REAL*8         zW(1024)
+      INTEGER        iZ
+      REAL           dx, dy, dz, sum
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .                            arg_lo_ss(Z_AXIS,ARG1),
+     .                            arg_hi_ss(Z_AXIS,ARG1), zW)
+
+      dx = 425.2e5  ! 4 degrees of longitude in cm (at the equator)
+      dy = 212.7e5  ! 2 degrees of latitude in cm
+
+      ! Single index
+
+      i  = res_lo_ss(X_AXIS)
+      i2 = arg_lo_ss(X_AXIS,ARG2) 
+      i3 = arg_lo_ss(X_AXIS,ARG3) 
+      i4 = arg_lo_ss(X_AXIS,ARG4) 
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+
+      j  = res_lo_ss(Y_AXIS)
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      j3 = arg_lo_ss(Y_AXIS,ARG3) 
+      j4 = arg_lo_ss(Y_AXIS,ARG4) 
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      l3 = arg_lo_ss(T_AXIS,ARG3) 
+      l4 = arg_lo_ss(T_AXIS,ARG4) 
+      l5 = arg_lo_ss(T_AXIS,ARG5) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         iZ = 1
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         k4 = arg_lo_ss(Z_AXIS,ARG4)
+         k5 = arg_lo_ss(Z_AXIS,ARG5)
+
+         sum  = 0.
+
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+           IF(k.EQ.1)THEN
+              dz = 100. * (zW(1)+zW(2))/2.
+           ELSE
+              dz = 100. * (zW(iZ+1)-zW(iZ-1))/2.
+           ENDIF
+
+           !  ARG_1 = u4 
+           !  ARG_2 = u1
+           !  ARG_3 = u3
+           !  ARG_4 = v2
+           !  ARG_5 = v5
+ 
+           sum = sum - (
+     .        (ARG_3(i3,j3,k3,l3)-ARG_2(i2,j2,k2,l2))/dx +
+     .        (ARG_4(i4,j4,k4,l4)-ARG_5(i5,j5,k5,l5))/dy ) * dz 
+
+           result(i,j,k,l) = sum
+
+           iZ = iZ + 1
+           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+           k3 = k3 + arg_incr(Z_AXIS,ARG3)
+           k4 = k4 + arg_incr(Z_AXIS,ARG4)
+           k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         ENDDO 
+
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END				
+
+
+
+
+
+
diff --git a/external_functions/romea/rr_wuz_qiao.F b/external_functions/romea/rr_wuz_qiao.F
new file mode 100644
index 0000000..6d2dae5
--- /dev/null
+++ b/external_functions/romea/rr_wuz_qiao.F
@@ -0,0 +1,84 @@
+      SUBROUTINE RR_wuz_Qiao_init(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+      CALL ef_set_desc             (id,'w du/dz from Qiao (1997)')
+      CALL ef_set_num_args         (id,2)
+      CALL ef_set_axis_inheritance (id,IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS,IMPLIED_BY_ARGS,IMPLIED_BY_ARGS)
+      CALL ef_set_arg_name         (id,ARG1,'w') 
+      CALL ef_set_arg_desc         (id,ARG1,'w-computed')
+      CALL ef_set_arg_unit         (id,ARG1,'cm/sec')
+      CALL ef_set_arg_type         (id,ARG1,FLOAT_ARG)
+      CALL ef_set_axis_influence   (id,ARG1,YES,YES,YES,YES)
+      CALL ef_set_arg_name         (id,ARG2,'u4')
+      CALL ef_set_arg_desc         (id,ARG2,'u-station 4')
+      CALL ef_set_arg_unit         (id,ARG2,'cm/sec')
+      CALL ef_set_arg_type         (id,ARG2,FLOAT_ARG)
+      CALL ef_set_axis_influence   (id,ARG2,YES,YES,YES,YES)
+      END
+
+
+      SUBROUTINE RR_wuz_Qiao_compute(id,arg_1,arg_2,result)
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+      REAL dz,arg_1 (mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .               mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL    arg_2 (mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .               mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL    result(memreslox:memreshix,memresloy:memreshiy,
+     .               memresloz:memreshiz,memreslot:memreshit)
+      INTEGER res_lo_ss(4),res_hi_ss(4),res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS),arg_hi_ss(4,EF_MAX_ARGS)
+      INTEGER arg_incr(4,EF_MAX_ARGS)
+      INTEGER i,j,k,l,i1,j1,k1,l1,i2,j2,k2,l2,iZ,id
+      REAL*8  zW(1024)
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_coordinates    (id, ARG1, Z_AXIS, 
+     .              arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1), zW)
+      i  = res_lo_ss(X_AXIS)
+      i1 = arg_lo_ss(X_AXIS,ARG1) 
+      i2 = arg_lo_ss(X_AXIS,ARG2) 
+      j  = res_lo_ss(Y_AXIS)
+      j1 = arg_lo_ss(Y_AXIS,ARG1) 
+      j2 = arg_lo_ss(Y_AXIS,ARG2) 
+      l1 = arg_lo_ss(T_AXIS,ARG1) 
+      l2 = arg_lo_ss(T_AXIS,ARG2) 
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         iZ = 1
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+           !  ARG_1 = w     ARG_2 = u4
+
+           IF(k.EQ.res_lo_ss(Z_AXIS))THEN
+              dz = 100. * (zW(1)+zW(2))/2.
+              result(i,j,k,l) = ARG_1(i1,j1,k1,l1)/2.
+     .                   *(ARG_2(i2,j2,k2,l2)-
+     .                        ARG_2(i2,j2,k2+1,l2))/dz
+           ELSEIF(k.EQ. res_hi_ss(Z_AXIS))THEN  ! last z point
+              result(i,j,k,l) =  result(i,j,k-1,l)
+           ELSE
+              dz = 100. * (zW(iZ+1)-zW(iZ-1))/2.
+              result(i,j,k,l) = (ARG_1(i1,j1,k1,l1) +
+     .                            ARG_1(i1,j1,k1+1,l1))/2
+     .                   *(ARG_2(i2,j2,k2,l2)-
+     .                        ARG_2(i2,j2,k2+1,l2))/dz    
+           ENDIF
+           iZ = iZ + 1
+           k1 = k1 + arg_incr(Z_AXIS,ARG1)
+           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         ENDDO 
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+      ENDDO               
+      END				
+
+
+
+
+
+
diff --git a/external_functions/sort/Makefile b/external_functions/sort/Makefile
new file mode 100644
index 0000000..53e5ea3
--- /dev/null
+++ b/external_functions/sort/Makefile
@@ -0,0 +1,56 @@
+ #
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+# *sh* 2/2000 - removed SAMPLEIJ from target list (replaced by SAMPLEXY)
+#
+# *acm* 1/2001 - incorporate "make debug" as per SH Makefiles
+#  acm  2/2001   debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+ 
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:    sorti_str.so bin_index_wt.so samplei_multi.so samplej_multi.so samplek_multi.so samplel_multi.so is_element_of_str.so samplexyt_nrst.so
+#all:    compressi_str.so string_to_id.so 
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/sort/bin_index_wt.F b/external_functions/sort/bin_index_wt.F
new file mode 100644
index 0000000..671ffd0
--- /dev/null
+++ b/external_functions/sort/bin_index_wt.F
@@ -0,0 +1,206 @@
+*
+* bin_index_wt.F
+*
+* Ansley Manke
+* October 2002
+*
+* This function sorts the indicies, and gathers them into bins, along
+* with their associated weights.  Returns the weights for each bin, 
+* followed by missing-data after the last bin.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE bin_index_wt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, gathered into bins on the X axis')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, NORMAL, NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'INDEX')
+      CALL ef_set_arg_desc(id, arg, 'Bin indices: sorted, 1D on x axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WT')
+      CALL ef_set_arg_desc(id, arg, 'Weight for with each index')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'INDXMAX')
+      CALL ef_set_arg_desc(id, arg, 'Maximum index value')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE bin_index_wt_result_limits(id)
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_one_val(id, ARG3, size)
+
+      my_lo_l = 1
+      my_hi_l = INT(size + 1)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE bin_index_wt_compute(id, arg_1, arg_2, arg_3,result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER ndx, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+          result(i,j,k,l) = 0.0
+  100 CONTINUE
+
+      ndx = res_lo_ss(X_AXIS)
+      DO 200 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+          IF (INT(arg_1(i1,j1,k1,l1)) .EQ. ndx) THEN
+              result(ndx,j,k,l) = result(ndx,j,k,l) + arg_2(i1,j1,k1,l1)
+          ELSEIF (INT(arg_1(i1,j1,k1,l1)) .GT. 0) THEN
+              ndx = INT(arg_1(i1,j1,k1,l1))
+              result(ndx,j,k,l) = arg_2(i1,j1,k1,l1)
+          ENDIF
+  200 CONTINUE
+
+      DO 300 i = ndx+1, res_hi_ss(X_AXIS)
+         result(i,j,k,l) = bad_flag_result
+  300 CONTINUE
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/compressi.F b/external_functions/sort/compressi.F
new file mode 100644
index 0000000..280cf41
--- /dev/null
+++ b/external_functions/sort/compressi.F
@@ -0,0 +1,231 @@
+*
+* compressi.F
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on I axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the I axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, IMPLIED_BY_ARGS,
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in I')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressi_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER nbad, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 500 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               nsrt = 0
+               nbad = 0
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     result(nsrt,j,k,l) = arg_1(i1,j1,k1,l1)
+
+                  ELSE
+                     nbad = nbad + 1
+                  END IF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+      
+*
+* Compress argument, putting bad data at the end.
+*
+               DO 200 m = 1, nbad
+                  m_indx = m + nsrt
+                  result(m_indx,j,k,l) = bad_flag_result
+ 200           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 300        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 400     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 500  CONTINUE
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/compressi_str.F b/external_functions/sort/compressi_str.F
new file mode 100644
index 0000000..dd00d55
--- /dev/null
+++ b/external_functions/sort/compressi_str.F
@@ -0,0 +1,278 @@
+*
+* compressi_str.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Ansley Manke
+* Mar 2013
+*
+* This function compresses string data on I axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM compressi_strNG v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressi_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the I axis: Missing ',
+     .        '(null string) points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in I')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressi_str_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nstring, nbad, slen
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*2048 instring
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS, ARG1)
+                  DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     nstring = 0
+                     nbad = 0
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                        CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, instring)
+                        IF (slen .GT. 0) THEN
+			   nstring = nstring+1
+			   CALL EF_PUT_STRING 
+     .                      (instring, slen, result(nstring,j,k,l,m,n))
+                        ELSE
+                           nbad = nbad + 1
+                        ENDIF
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*
+* Compress argument, putting bad data at the end.
+*
+      slen = 1
+      instring = ''
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 650 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 550 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 450 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 350 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS, ARG1)
+                  DO 250 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     DO 150 ndx = 1, nbad
+                        nstring = nstring + 1
+                        CALL EF_PUT_STRING 
+     .                      (instring, slen, result(nstring,j,k,l,m,n))
+ 150                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 250              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 350           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 450        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 550     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 650  CONTINUE
+
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/compressj.F b/external_functions/sort/compressj.F
new file mode 100644
index 0000000..c676372
--- /dev/null
+++ b/external_functions/sort/compressj.F
@@ -0,0 +1,231 @@
+*
+* compressj.F
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on J axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressj_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the J axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in J')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressj_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressj_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER nbad, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               nsrt = 0
+               nbad = 0
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     result(i,nsrt,k,l) = arg_1(i1,j1,k1,l1)
+
+                  ELSE
+                     nbad = nbad + 1
+                  END IF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 100           CONTINUE
+      
+*
+* Compress argument, putting bad data at the end.
+*
+               DO 200 m = 1, nbad
+                  m_indx = m + nsrt
+                  result(i,m_indx,k,l) = bad_flag_result
+ 200           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 300        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 500  CONTINUE
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/compressk.F b/external_functions/sort/compressk.F
new file mode 100644
index 0000000..55e4455
--- /dev/null
+++ b/external_functions/sort/compressk.F
@@ -0,0 +1,231 @@
+*
+* compressk.F
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on K axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressk_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the K axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in K')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressk_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(Z_AXIS,arg) - arg_lo_ss(Z_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressk_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER nbad, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               nsrt = 0
+               nbad = 0
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     result(i,j,nsrt,l) = arg_1(i1,j1,k1,l1)
+
+                  ELSE
+                     nbad = nbad + 1
+                  END IF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 100           CONTINUE
+      
+*
+* Compress argument, putting bad data at the end.
+*
+               DO 200 m = 1, nbad
+                  m_indx = m + nsrt
+                  result(i,j,m_indx,l) = bad_flag_result
+ 200           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 300        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 500  CONTINUE
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/compressl.F b/external_functions/sort/compressl.F
new file mode 100644
index 0000000..006b605
--- /dev/null
+++ b/external_functions/sort/compressl.F
@@ -0,0 +1,230 @@
+*
+* compressl.F
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on L axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressl_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the L axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in L')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressl_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressl_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER nbad, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS, ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               nsrt = 0
+               nbad = 0
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     result(i,j,k,nsrt) = arg_1(i1,j1,k1,l1)
+
+                  ELSE
+                     nbad = nbad + 1
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+      
+*
+* Compress argument, putting bad data at the end.
+*
+               DO 200 m = 1, nbad
+                  m_indx = m + nsrt
+                  result(i,j,k,m_indx) = bad_flag_result
+ 200           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 400     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 500  CONTINUE
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/sort/element_index.F b/external_functions/sort/element_index.F
new file mode 100644
index 0000000..c03f72f
--- /dev/null
+++ b/external_functions/sort/element_index.F
@@ -0,0 +1,198 @@
+*
+* element_index.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE element_index_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Return index value in ARG2 for each point in ARG1')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'list of values to match')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE element_index_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id
+      INTEGER i, j, k, l
+      INTEGER i2, j2, k2, l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for values matching arg2
+
+      DO 410 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+      DO 310 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 210 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 110 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         result(i,j,k,l) = bad_flag_result
+
+         DO 400 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+         DO 300 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+         DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+         DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+
+            IF ( arg_1(i,j,k,l) .NE. bad_flag(1) .AND.
+     .           arg_2(i2,j2,k2,l2) .NE. bad_flag(2)) THEN
+
+               IF (arg_1(i,j,k,l) .EQ. arg_2(i2,j2,k2,l2) ) THEN
+                 result(i,j,k,l) = i2
+                 GOTO 9000
+              ENDIF
+            ENDIF
+
+ 100     CONTINUE
+ 200     CONTINUE
+ 300     CONTINUE
+ 400     CONTINUE
+
+9000     CONTINUE
+
+ 110  CONTINUE
+ 210  CONTINUE
+ 310  CONTINUE
+ 410  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/external_functions/sort/element_index_str.F b/external_functions/sort/element_index_str.F
new file mode 100644
index 0000000..a294eea
--- /dev/null
+++ b/external_functions/sort/element_index_str.F
@@ -0,0 +1,215 @@
+*
+* element_index_str.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE element_index_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Return index value in ARG2 for each string in ARG1')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'string data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'STRINGS')
+      CALL ef_set_arg_desc(id, arg, 'list of strings to match')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE element_index_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+*  string args need to be twice the length.
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+ 
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, arg
+      INTEGER i, j, k, l
+      INTEGER i2, j2, k2, l2
+      INTEGER slen1, slen2
+      CHARACTER text1*20, text2*20
+
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+
+      DO 410 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+      DO 310 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 210 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 110 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         result(i,j,k,l) = bad_flag_result
+         
+         arg = 1
+         CALL ef_get_string_arg_element(id, arg, arg_1, 
+     .                                           i,j,k,l, text1)
+         CALL ef_get_string_arg_element_len(id, arg, arg_1, 
+     .                                           i,j,k,l, slen1)
+
+         DO 400 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+         DO 300 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+         DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+         DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+
+            arg = 2
+            CALL ef_get_string_arg_element(id, arg, arg_2, 
+     .                                           i2,j2,k2,l2, text2)
+            CALL ef_get_string_arg_element_len(id, arg, arg_2, 
+     .                                           i2,j2,k2,l2, slen2)
+
+            IF (slen1 .EQ. slen2) THEN
+              IF (text1(:slen1) .EQ. text2(:slen2)) THEN
+                 result(i,j,k,l) = i2
+                 GOTO 9000
+              ENDIF
+            ENDIF
+
+ 100     CONTINUE
+ 200     CONTINUE
+ 300     CONTINUE
+ 400     CONTINUE
+
+9000     CONTINUE
+
+ 110  CONTINUE
+ 210  CONTINUE
+ 310  CONTINUE
+ 410  CONTINUE
+ 
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/is_element_of.F b/external_functions/sort/is_element_of.F
new file mode 100644
index 0000000..cf6eac9
--- /dev/null
+++ b/external_functions/sort/is_element_of.F
@@ -0,0 +1,244 @@
+*
+* is_element_of.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 2003
+*
+*  Return logical value (integer 1 or 0); If argument 1 takes on any of 
+*  the values of the second argument, return 1, else 0.
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE is_element_of_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns 1 if first argument contains any of the ',
+     .        'values in argument 2, else 0')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to test')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'values to search for')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE is_element_of_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X axis.
+*
+
+      my_lo_l = 1
+      my_hi_l = 1
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE is_element_of_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for values matching arg2
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      result(i,j,k,l) = 0.
+
+      DO 400 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+      DO 300 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+      DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+      DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+
+         DO 410 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+         DO 310 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS, ARG1)
+         DO 210 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS, ARG1)
+         DO 110 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS, ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1) .NE. bad_flag(1) .AND.
+     .           arg_2(i2,j2,k2,l2) .NE. bad_flag(2)) THEN
+
+               IF (arg_1(i1,j1,k1,l1) .EQ. arg_2(i2,j2,k2,l2) ) THEN
+                  result(i,j,k,l) = 1.
+                  GO TO 9000
+               ENDIF
+            ENDIF
+
+ 110     CONTINUE
+ 210     CONTINUE
+ 310     CONTINUE
+ 410     CONTINUE
+
+ 100  CONTINUE
+ 200  CONTINUE
+ 300  CONTINUE
+ 400  CONTINUE
+      
+9000  RETURN
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/is_element_of_str.F b/external_functions/sort/is_element_of_str.F
new file mode 100644
index 0000000..1729f86
--- /dev/null
+++ b/external_functions/sort/is_element_of_str.F
@@ -0,0 +1,263 @@
+*
+* is_element_of_str.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* August 2005
+*
+*  For string arguments, 
+*  Return logical value (integer 1 or 0); If argument 1 takes on any of 
+*  the values of the second argument, return 1, else 0.
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE is_element_of_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns 1 if first argument contains any of the ',
+     .        'values in argument 2, else 0')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to test')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'strings to search for')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE is_element_of_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X axis.
+*
+
+      my_lo_l = 1
+      my_hi_l = 1
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE is_element_of_str_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+*   string args need to be twice the length.
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+ 
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, arg
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER slen1, slen2
+      CHARACTER text1*20, text2*20
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      result(i,j,k,l) = 0.
+
+      DO 400 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+      DO 300 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+      DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+      DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+
+         DO 410 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+         DO 310 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS, ARG1)
+         DO 210 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS, ARG1)
+         DO 110 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS, ARG1)
+
+            arg = 1
+            CALL ef_get_string_arg_element(id, arg, arg_1, 
+     .                                           i1,j1,k1,l1, text1)
+            CALL ef_get_string_arg_element_len(id, arg, arg_1, 
+     .                                           i1,j1,k1,l1, slen1)
+
+
+            arg = 2
+            CALL ef_get_string_arg_element(id, arg, arg_2, 
+     .                                           i2,j2,k2,l2, text2)
+            CALL ef_get_string_arg_element_len(id, arg, arg_2, 
+     .                                           i2,j2,k2,l2, slen2)
+
+            IF (slen1 .EQ. slen2) THEN
+               IF (text1(:slen1) .EQ. text2(:slen2)) THEN
+                  result(i,j,k,l) = 1.
+                  GO TO 9000
+               ENDIF
+            ENDIF
+
+ 110     CONTINUE
+ 210     CONTINUE
+ 310     CONTINUE
+ 410     CONTINUE
+
+ 100  CONTINUE
+ 200  CONTINUE
+ 300  CONTINUE
+ 400  CONTINUE
+      
+9000  RETURN
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/pickt.F b/external_functions/sort/pickt.F
new file mode 100644
index 0000000..db24d33
--- /dev/null
+++ b/external_functions/sort/pickt.F
@@ -0,0 +1,296 @@
+*
+* pickt.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 1999
+*  Redo July 2000
+*
+*  Apply a mask to data.  Returns a result with an ABSTRACT T axis.
+*  Take only those points where tmask had valid (non-missing) points.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE pickt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data masked; result on abstract t axis ',
+     .        'where tmask has valid points')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg, 
+     .  '1-D mask, same length as t-axis of VAR')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE pickt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract T axis based on ARG2.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = nt
+      IF (arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pickt_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER nlen1, nlen2, ndims
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check that ARG2 is 1-D.  
+
+      ndims = 0
+      DO 88 m = X_AXIS, T_AXIS
+         IF (arg_incr(m,ARG2) .GT. 0) THEN
+           nlen2 = arg_hi_ss(m,ARG2) - arg_lo_ss(m,ARG2)
+           ndims = ndims + 1
+         ENDIF
+  88  CONTINUE
+
+      IF (ndims .LE. 0  .OR.  ndims .GT. 1) THEN
+         WRITE (errtxt, *) 'ARG2 (mask) must be 1-dimensional'
+         GOTO 999
+      ENDIF
+
+C  Check that the dimension of the mask matches the  t axis of the variable.
+
+      IF (arg_incr(T_AXIS,ARG1) .GT. 0) nlen1 = arg_hi_ss(T_AXIS,ARG1) 
+     .    - arg_lo_ss(T_AXIS,ARG1)
+
+      IF (nlen2 .NE. nlen1) THEN
+         WRITE (errtxt, *) 
+     .    'ARG2 (mask) must be the same length as the t-axis of ARG1'
+         GOTO 999
+      ENDIF
+
+C  Apply the mask.
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                l1 = arg_lo_ss(T_AXIS,ARG1)
+                l2 = arg_lo_ss(T_AXIS,ARG2)
+
+                DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  Check that this value of ARG_2 is not missing; set the result
+
+
+                  IF (arg_2(i2,j2,k2,l2) .ne. bad_flag(ARG2)) THEN
+                        result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ELSE
+                        result(i,j,k,l) = bad_flag_result
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/pickx.F b/external_functions/sort/pickx.F
new file mode 100644
index 0000000..76d1d65
--- /dev/null
+++ b/external_functions/sort/pickx.F
@@ -0,0 +1,297 @@
+*
+* pickx.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 1999
+*  Redo July 2000
+*
+*  Apply a mask to data.  Returns a result with an ABSTRACT X axis.
+*  Take only those points where mask had valid (non-missing) points.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE pickx_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data masked; result on abstract x axis ',
+     .        'where mask has valid points')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg, 
+     .      '1-D mask, same length as x-axis of VAR')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE pickx_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X axis.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx
+      IF (arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pickx_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER nlen1, nlen2, ndims
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check that ARG2 is 1-D.  
+
+      ndims = 0
+      nlen2 = 0
+      DO 88 m = X_AXIS, T_AXIS
+         IF (arg_incr(m,ARG2) .GT. 0) THEN
+           nlen2 = arg_hi_ss(m,ARG2) - arg_lo_ss(m,ARG2)
+           ndims = ndims + 1
+         ENDIF
+  88  CONTINUE
+
+      IF (ndims .LE. 0  .OR.  ndims .GT. 1) THEN
+         WRITE (errtxt, *) 'ARG2 (mask) must be 1-dimensional'
+         GOTO 999
+      ENDIF
+
+C  Check that the dimension of the mask matches the  x axis of the variable.
+
+      IF (arg_incr(X_AXIS,ARG1) .GT. 0) nlen1 = arg_hi_ss(X_AXIS,ARG1) 
+     .    - arg_lo_ss(X_AXIS,ARG1)
+
+      IF (nlen2 .NE. nlen1) THEN
+         WRITE (errtxt, *) 
+     .    'ARG2 (mask) must be the same length as the x-axis of ARG1'
+         GOTO 999
+      ENDIF
+
+C  Apply the mask.
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                i1 = arg_lo_ss(X_AXIS,ARG1)
+                i2 = arg_lo_ss(X_AXIS,ARG2)
+
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+*  Check that this value of ARG_2 is not missing; set the result
+
+                   If (arg_2(i2,j2,k2,l2) .ne. bad_flag(ARG2)) THEN
+                        result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ELSE
+                        result(i,j,k,l) = bad_flag_result
+                  END IF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1) 
+                  i2 = i2 + arg_incr(X_AXIS,ARG2) 
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/picky.F b/external_functions/sort/picky.F
new file mode 100644
index 0000000..4720e7d
--- /dev/null
+++ b/external_functions/sort/picky.F
@@ -0,0 +1,296 @@
+*
+* picky.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 1999
+*  Redo July 2000
+*
+*  Apply a mask to data.  Returns a result with an ABSTRACT Y axis.
+*  Take only those points where mask had valid (non-missing) points.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE picky_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data masked; result on abstract y axis ',
+     .        'where mask has valid points')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id,  IMPLIED_BY_ARGS, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg, 
+     .        '1-D mask, same length as y-axis of VAR')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE picky_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract Y axis.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = ny
+      IF (arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE picky_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER nlen1, nlen2, ndims
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check that ARG2 is 1-D.  
+
+      ndims = 0
+      DO 88 m = X_AXIS, T_AXIS
+         IF (arg_incr(m,ARG2) .GT. 0) THEN
+           nlen2 = arg_hi_ss(m,ARG2) - arg_lo_ss(m,ARG2) 
+           ndims = ndims + 1
+         ENDIF
+  88  CONTINUE
+
+      IF (ndims .LE. 0  .OR.  ndims .GT. 1) THEN
+         WRITE (errtxt, *) 'pickY: ARG2 (mask) must be 1-dimensional'
+         GOTO 999
+      ENDIF
+
+C  Check that the dimension of the mask matches the y axis of the variable.
+
+      IF (arg_incr(Y_AXIS,ARG1) .GT. 0) nlen1 = arg_hi_ss(Y_AXIS,ARG1) 
+     .    - arg_lo_ss(Y_AXIS,ARG1)
+
+      IF (nlen2 .NE. nlen1) THEN
+         WRITE (errtxt, *) 
+     .    'ARG2 (mask) must be the same length as the y-axis of ARG1'
+         GOTO 999
+      ENDIF
+
+C  Apply the mask.
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                j = res_lo_ss(Y_AXIS)
+                j1 = arg_lo_ss(Y_AXIS,ARG1)
+                j2 = arg_lo_ss(Y_AXIS,ARG2)
+
+                DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Check that this value of ARG_2 is not missing; set the result
+
+                   If (arg_2(i2,j2,k2,l2) .ne. bad_flag(ARG2)) THEN
+                        result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ELSE
+                        result(i,j,k,l) = bad_flag_result
+                  END IF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1) 
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2) 
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/pickz.F b/external_functions/sort/pickz.F
new file mode 100644
index 0000000..f959f6d
--- /dev/null
+++ b/external_functions/sort/pickz.F
@@ -0,0 +1,297 @@
+*
+* pickz.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 1999
+*  Redo  July 2000
+*
+*  Apply a mask to data.  Returns a result with an ABSTRACT Z axis.
+*  Take only those points where mask had valid (non-missing) points.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE pickz_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data masked; result on abstract Z axis ',
+     .        'where mask has valid points')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS,
+     .        IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to mask')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_desc(id, arg, 
+     .   '1-D mask, same length as z-axis of VAR')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE pickz_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract Z axis.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = ny
+      IF (arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pickz_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER nlen1, nlen2, ndims
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check that ARG2 is 1-D.  
+
+      ndims = 0
+      nlen2 = 0
+      DO 88 m = X_AXIS, T_AXIS
+         IF (arg_incr(m,ARG2) .GT. 0) THEN
+           nlen2 = arg_hi_ss(m,ARG2) - arg_lo_ss(m,ARG2)
+           ndims = ndims + 1
+         ENDIF
+  88  CONTINUE
+
+      IF (ndims .LE. 0  .OR.  ndims .GT. 1) THEN
+         WRITE (errtxt, *) 'ARG2 (mask) must be 1-dimensional'
+         GOTO 999
+      ENDIF
+
+C  Check that the dimension of the mask matches the  x axis of the variable.
+
+      IF (arg_incr(Z_AXIS,ARG1) .GT. 0) nlen1 = arg_hi_ss(Z_AXIS,ARG1) 
+     .    - arg_lo_ss(Z_AXIS,ARG1)
+
+      IF (nlen2 .NE. nlen1) THEN
+         WRITE (errtxt, *) 
+     .    'ARG2 (mask) must be the same length as the z-axis of ARG1'
+         GOTO 999
+      ENDIF
+
+C  Apply the mask.
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                k = res_lo_ss(Z_AXIS)
+                k2 = arg_lo_ss(Z_AXIS,ARG2)
+                k1 = arg_lo_ss(Z_AXIS,ARG1)
+
+                DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Check that this value of ARG_2 is not missing; set the result
+
+                   If (arg_2(i2,j2,k2,l2) .ne. bad_flag(ARG2)) THEN
+                        result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                  ELSE
+                        result(i,j,k,l) = bad_flag_result
+                  END IF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1) 
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2) 
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/external_functions/sort/samplei_multi.F b/external_functions/sort/samplei_multi.F
new file mode 100644
index 0000000..eb4ae0c
--- /dev/null
+++ b/external_functions/sort/samplei_multi.F
@@ -0,0 +1,274 @@
+*
+* samplei_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the I axis using a set of indices
+* which may be different for the j,k,L dimensions.
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplei_multi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to I indices which ',
+     . 'may vary in JKL')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'I_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'indices upon which to sample')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using I indices')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplei_multi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx
+      IF (arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplei_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER iorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                i1 = arg_lo_ss(X_AXIS,ARG1)
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                   aorder = arg_1(i1,j1,k1,l1)
+                   IF (i1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, i, aorder)
+                   iorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (iorder .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                   iorder .GT. arg_hi_ss(X_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(iorder,j2,k2,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(iorder,j2,k2,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(iorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(X_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(X_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of I indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL ef_bail_out(id, errtxt)
+
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+      SUBROUTINE pickindex(arr, iindex, aorder)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.  Collapse
+*  array arr to one dimension and return the i'th point.
+
+      real arr(*), aorder
+      integer iindex
+
+      aorder = arr(iindex)
+
+      return
+      end
diff --git a/external_functions/sort/samplej_multi.F b/external_functions/sort/samplej_multi.F
new file mode 100644
index 0000000..f10c6d6
--- /dev/null
+++ b/external_functions/sort/samplej_multi.F
@@ -0,0 +1,273 @@
+*
+* samplej_multi.F
+*
+* Ansley Manke
+* May 1998
+*
+* This function samples data along the J axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplej_multi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to J indices which ',
+     . 'may vary in IKL')
+      CALL ef_set_desc(id, fcn_desc)
+
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'J_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using J indices')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplej_multi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = ny
+      IF (arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplej_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, k2, l2
+      INTEGER jorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                   aorder = arg_1(i1,j1,k1,l1)
+                   IF (j1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, j, aorder)
+                  jorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (jorder .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                   jorder .GT. arg_hi_ss(Y_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,jorder,k2,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,jorder,k2,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      RETURN 
+
+999   CONTINUE
+      aindex(1) = LEFINT(jorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(Y_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(Y_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of J indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      SUBROUTINE pickindex(arr, jindex, aorder)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.  Collapse
+*  the array to one dimension and return the j'th point.
+
+      real arr(*), aorder
+      integer jindex
+
+      aorder = arr(jindex)
+
+      return
+      end
diff --git a/external_functions/sort/samplek_multi.F b/external_functions/sort/samplek_multi.F
new file mode 100644
index 0000000..6c038a9
--- /dev/null
+++ b/external_functions/sort/samplek_multi.F
@@ -0,0 +1,275 @@
+*
+* samplek_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the K axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplek_multi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to K indices which ',
+     . 'may vary in IJL')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'K_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using K indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplek_multi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nz
+      IF (arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplek_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, l2
+      INTEGER korder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                  aorder = arg_1(i1,j1,k1,l1)
+                  IF (k1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, k, aorder)
+                  korder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (korder .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                   korder .GT. arg_hi_ss(Z_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,j2,korder,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,j2,korder,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(korder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(Z_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(Z_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of Z indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL ef_bail_out(id, errtxt)
+      RETURN
+      END
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+      SUBROUTINE pickindex(arr, kindex, aorder)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.  Collapse
+*  the array to one dimension and return the k'th point.
+
+      real arr(*), aorder
+      integer kindex
+
+      aorder = arr(kindex)
+
+      return
+      end
diff --git a/external_functions/sort/samplel_multi.F b/external_functions/sort/samplel_multi.F
new file mode 100644
index 0000000..e17f0c1
--- /dev/null
+++ b/external_functions/sort/samplel_multi.F
@@ -0,0 +1,278 @@
+*
+* samplel_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the L axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplel_multi_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to L indices which ',
+     . 'may vary in IJK')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'L_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using L indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplel_multi_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+*  If there is a list of indices along the T-axis of ARG1, use the
+*  argument subscripts for the abstract axis limits.
+
+      my_lo_l = 1
+      my_hi_l = nt
+
+      IF (arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) .EQ. 0) 
+     .    my_hi_l = MAX(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplel_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .      mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2
+      INTEGER lorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3)
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                  aorder = arg_1(i1,j1,k1,l1)
+                  IF (l1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, l, aorder)
+                  lorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (lorder .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                   lorder .GT. arg_hi_ss(T_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,j2,k2,lorder) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,j2,k2,lorder)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(lorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(T_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(T_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of L indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+      SUBROUTINE pickindex(arr, lindex, aorder)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.  Collapse
+*  the array to one dimension and return the l'th point.
+
+      real arr(*), aorder
+      integer lindex
+
+      aorder = arr(lindex)
+
+      return
+      end
diff --git a/external_functions/sort/samplexy_closest.F b/external_functions/sort/samplexy_closest.F
new file mode 100644
index 0000000..1d7e666
--- /dev/null
+++ b/external_functions/sort/samplexy_closest.F
@@ -0,0 +1,577 @@
+*
+* samplexy_closest.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*
+*   Version of samplexy to get data at the nearest grid point rather
+*   than doing interpolation.
+*
+* This function samples 4-d data on the x and y axes indicated by args 2 and 3
+* 9/10/99  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+*
+* 1/13/2000 acm -- fix so that xpts and/or ypts can be on any axis.
+* 3/ 1/2000 ACM -- fix bug in the definition of the work arrays
+* 6/ 8/2000 ACM -- fix bug in incrementing k2, k3, l2, l3
+*
+* 7/2000  acm -- merge Bernadettes and increment fix into this version
+* 5/2001  acm -- allow modulo axes
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+*  2/2001 acm -- check that modulo axes are also regular, and fix delmodx, delmody
+*  2/2002 acm -- check xpt and ypt (x and y points to sample) that values arent missing.
+*
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_closest_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .   'using nearest valid grid intersection')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_closest_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_closest_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mxh, myh, mxl, myl
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1)  - arg_lo_ss(Y_AXIS,ARG1) + 1)
+
+*  xaxdat
+      CALL ef_set_work_array_dims (id, 1, mxl, 1, 1, 1, mxh, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims (id, 2, myl, 1, 1, 1, myh, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexy_closest_compute(id, arg_1, arg_2, arg_3,
+     .        result, xaxdat, yaxdat)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER ndimx, ndimy
+
+*  Set up work arrays
+
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+
+      INTEGER imatch, jmatch
+      INTEGER ibot, itop, jbot, jtop
+      REAL fxbot, fxtop
+      REAL xbot, xtop, ybot, ytop
+      REAL x_to_xbot, x_to_xtop, y_to_ybot, y_to_ytop
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      INTEGER xlo, xhi, ylo, yhi
+      REAL dx, dy, delmodx, delmody, xpt, ypt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      ndimx = 0
+      ndimy = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF (arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) .GT.0) 
+     .       ndimx = ndimx + 1
+         IF (arg_hi_ss(i,ARG3) - arg_lo_ss(i,ARG3) .GT.0) 
+     .       ndimy = ndimy + 1
+  110 CONTINUE
+
+      IF (nx .NE. ny   .OR.  ndimx .GT. 1  .OR. ndimy .GT.1) THEN
+         WRITE (err_msg, 10)
+         GO TO 999
+      ENDIF
+
+   10 FORMAT(
+     . 'Arguments 2 and 3 must be 1-dimensional lists of equal length')
+
+*  Get x and y coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+*  Check to see if input x,y  axis is modulo
+
+      CALL ef_get_axis_info (id, ARG1, ax_name, ax_units, backward, 
+     .                       modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         IF (.NOT. regular(1)) THEN
+            err_msg = 'cannot handle MODULO axis that is not regular'
+            go to 999
+         ELSE
+            dx = xaxdat(xlo+1,1,1,1) - xaxdat(xlo,1,1,1)
+            delmodx = xaxdat(xhi,1,1,1) - xaxdat(xlo,1,1,1) + dx
+         ENDIF
+      ENDIF
+      IF ( modulo(2) ) THEN
+         IF (.NOT. regular(2)) THEN
+            err_msg = 'cannot handle MODULO axis that is not regular'
+            go to 999
+         ELSE
+            dy = yaxdat(ylo+1,1,1,1) - yaxdat(ylo,1,1,1)
+            delmody = yaxdat(yhi,1,1,1) - yaxdat(ylo,1,1,1)
+         ENDIF
+      ENDIF
+
+*  For each (xpt,ypt) pair, search the data array 
+*   arg_1 for the nearest higher (x,y) grid coordinates.  Find the 
+*   nearest in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         ibot = ef_unspecified_int4	! Check if xpt points in xax range.
+         imatch = 0
+
+	 xpt = arg_2(i2,j2,k2,l2)
+	 ypt = arg_3(i3,j3,k3,l3)
+         IF (xpt .EQ. bad_flag(ARG2) .OR. ypt .EQ. bad_flag(ARG3)) THEN
+            DO 700 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 600 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                    result(i,j,k,l) = bad_flag_result
+  600          CONTINUE
+  700       CONTINUE
+
+         ELSE
+
+            DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+               IF (xpt .GE. xaxdat(i1,1,1,1)) ibot = i1
+               IF (xpt .EQ. xaxdat(i1,1,1,1)) imatch = i1
+
+cbf      may be some derivation from the exact value can be allowed:
+cbf      if (xpt - xaxdat(i1,1,1,1)).le.eps)   imatch = i1
+
+*  Locate the X point within the range of modulo X axis 
+
+ 	       IF (modulo(1)) THEN
+	          DO WHILE (xpt .GE. xaxdat(xhi,1,1,1) ) 
+                     xpt = xpt - delmodx
+	          ENDDO
+	          DO WHILE (xpt .LT. xaxdat(xlo,1,1,1) )
+		     xpt = xpt + delmodx
+	          ENDDO
+	       ENDIF
+
+  100       CONTINUE
+            i1 = arg_hi_ss(X_AXIS,ARG1)
+            IF (xpt .GT. xaxdat(i1,1,1,1)) THEN
+               ibot = ef_unspecified_int4		! ARG_2 XPT outside of range 
+		           				! (non modulo)
+            ENDIF
+
+cbf       for matching the next neighbour is not of interest
+            IF (imatch .NE. 0) then
+               itop = ibot
+            ELSE
+               itop = ibot + 1
+            ENDIF
+            IF (ibot .EQ. ef_unspecified_int4) itop = ibot
+
+cbf        analogously in y direction
+            jbot = ef_unspecified_int4	! Check if ypt points in yax range.
+            jmatch = 0
+
+   	    ypt = arg_3(i3,j3,k3,l3)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               IF (ypt .GE. yaxdat(j1,1,1,1) ) jbot = j1
+            IF (ypt .EQ. yaxdat(j1,1,1,1) ) jmatch = j1
+cbf         IF (ypt - yaxdat(j1,1,1,1) ) .LE. eps) jmatch = j1
+
+*  Locate the Y point within the range of modulo Y axis 
+
+	       IF (modulo(2)) THEN
+	          DO WHILE (ypt .GE. yaxdat(yhi,1,1,1) ) 
+                     ypt = ypt - delmody
+	          ENDDO
+	          DO WHILE (ypt .LT. yaxdat(ylo,1,1,1) )
+		     ypt = ypt + delmody
+	          ENDDO
+	       ENDIF
+
+  200       CONTINUE
+            j1 = arg_hi_ss(Y_AXIS,ARG1)
+            IF (arg_3(i3,j3,k3,l3) .GE. yaxdat(j1,1,1,1) ) THEN
+                jbot = ef_unspecified_int4		! ARG_3 YPT outside of range 
+						        ! (non modulo)
+
+            ENDIF
+
+            IF (jmatch .NE. 0) then
+                jtop = jbot
+            ELSE
+               jtop = jbot + 1
+            ENDIF
+            IF (jbot .EQ. ef_unspecified_int4) jtop = jbot
+            IF (jtop .GE. arg_hi_ss(Y_AXIS,ARG1)) 
+     .                           jtop = arg_hi_ss(Y_AXIS,ARG1)        !10/2001 acm
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               l3 = arg_lo_ss(T_AXIS,ARG3)
+               DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  First get the nearest grid value in x
+
+	          IF (ibot .EQ. ef_unspecified_int4  .OR.  
+     .		      jbot .EQ. ef_unspecified_int4) THEN
+                     result(i,j,k,l) = bad_flag_result
+	          ELSE 
+                     IF (ibot .GE. arg_lo_ss(X_AXIS,ARG1)  .AND.
+     .                   itop .LE. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+                        xbot = xaxdat(ibot,1,1,1)
+                        xtop = xaxdat(itop,1,1,1)
+                        x_to_xbot = abs(xpt - xbot)
+                        x_to_xtop = abs(xpt - xtop)
+
+                        IF (x_to_xbot .LE. x_to_xtop) THEN
+                           fxbot = arg_1(ibot,jbot,k1,l1)
+                           fxtop = arg_1(ibot,jtop,k1,l1)
+
+! ????????????????????????what if one is missing?  Do you want to use next nearest?
+!                         does NRST code would get NEAREST good point, however far away?
+
+                        ELSE
+                           fxbot = arg_1(itop,jbot,k1,l1)
+                           fxtop = arg_1(itop,jtop,k1,l1)
+                        ENDIF
+
+*  Now get nearest grid point in y, getting value at (x,y)
+
+ 
+                        IF (jmatch .NE. 0) THEN
+                           result(i,j,k,l) = fxbot
+                        ELSE
+                           IF (jbot .GE. arg_lo_ss(Y_AXIS,ARG1)  .AND.
+     .                        jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+                              ybot = yaxdat(jbot,1,1,1)
+                              ytop = yaxdat(jtop,1,1,1)
+
+                              y_to_ybot = abs(ypt - ybot)
+                              y_to_ytop = abs(ypt - ytop)
+
+                              IF (y_to_ybot .LE. y_to_ytop) THEN
+                                 result(i,j,k,l) = fxbot
+                              ELSE
+                                 result(i,j,k,l) = fxtop 
+
+                              ENDIF
+                           ELSE
+                              result(i,j,k,l) = bad_flag_result
+                           ENDIF
+                        ENDIF
+
+                     ELSE
+                        result(i,j,k,l) = bad_flag_result
+                     ENDIF  !IF (ibot .GE. arg_lo_ss...
+
+	          ENDIF  ! itop, jtop not ef_unspecified_int4
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+
+ 300           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400        CONTINUE
+
+         ENDIF  ! xpt and ypt not bad values
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         j = j + res_incr(Y_AXIS)
+500   CONTINUE
+
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexy_curv.F b/external_functions/sort/samplexy_curv.F
new file mode 100644
index 0000000..8b64e2e
--- /dev/null
+++ b/external_functions/sort/samplexy_curv.F
@@ -0,0 +1,472 @@
+*
+* samplexy_curv.F
+*
+* Ansley Manke
+* 4/03 
+* ???  Note: does not currently deal with modulo data  ???
+* 1/06 Remove calls to SIGN to compile with f90 on IRIX.
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .   'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nx, ny
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx*ny, 2, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+
+
+
+      SUBROUTINE samplexy_curv_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .       arg_5, result, xlocations)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+
+*  Set up work arrays
+
+      REAL xlocations(wrk1lox:wrk1lox+(wrk1hix-wrk1lox),wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL ylocations(2)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+      INTEGER i4,j4,k4,l4
+      INTEGER i5,j5,k5,l5
+
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      REAL xpt, ypt, ydiff, yd
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, ybot, ytop
+      REAL frac
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+
+      IF (nx1 .NE. nx2 .OR. nx2 .NE. nx3 .OR. nx1 .NE. nx3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+      IF (ny1 .NE. ny2 .OR. ny2 .NE. ny3 .OR. ny1 .NE. ny3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      ndimx = 0
+      ndimy = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF(arg_hi_ss(i,ARG4) - arg_lo_ss(i,ARG4) .GT.0) ndimx=ndimx + 1
+         IF(arg_hi_ss(i,ARG5) - arg_lo_ss(i,ARG5) .GT.0) ndimy=ndimy + 1
+  110 CONTINUE
+
+      IF (nx .NE. ny   .OR.  ndimx .GT. 1  .OR. ndimy .GT.1) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+
+
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 600 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+	 xpt = arg_4(i4,j4,k4,l4)
+
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         l2 = arg_lo_ss(T_AXIS,ARG2)
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+c            icross = SIGN(1, (xpt - arg_2(i2,j2,k2,l2)) )
+            icross = 1
+            IF ((xpt - arg_2(i2,j2,k2,l2)) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+c               iloc = SIGN(1, (xpt-arg_2(i2,j2,k2,l2)) )
+               iloc = 1
+               IF ((xpt-arg_2(i2,j2,k2,l2)) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1) = MAX(i2-1,1)
+                  xlocations(nloc,2,1,1) = j2
+c                  icross = SIGN(1, (xpt - arg_2(i2,j2,k2,l2)) )
+                  icross = 1
+                  IF ((xpt - arg_2(i2,j2,k2,l2)) .LT. 0.) icross = -1
+               ENDIF
+
+  100       CONTINUE
+  200    CONTINUE
+
+* Which of those locations is nearest xpt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         l3 = arg_lo_ss(T_AXIS,ARG3)
+
+         DO 300 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1)
+            j3 = xlocations(iloc,2,1,1)
+               yd = ABS(ypt - arg_3(i3,j3,k3,l3))
+
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  300   CONTINUE
+
+        ibot = xlocations(ptloc,1,1,1)
+        jbot = xlocations(ptloc,2,1,1)
+        IF (ibot .GE. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+        IF (jbot .GE. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+        itop = ibot + 1
+        jtop = jbot + 1
+
+*  First interpolate in x, getting values of the fcn at (x,jbot)  and (x,jtop)
+
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         DO 500 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               IF (ibot .GE. arg_lo_ss(X_AXIS,ARG1)  .AND. 
+     .              itop .LT. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+                  xbot = arg_2(ibot,jbot,k2,l2)
+                  xtop = arg_2(itop,jbot,k2,l2)
+      
+                  fbb = arg_1(ibot,jbot,k1,l1) 
+                  ftb = arg_1(itop,jbot,k1,l1)
+                  fbt = arg_1(ibot,jtop,k1,l1)
+                  ftt = arg_1(itop,jtop,k1,l1)
+
+                  IF (fbb .NE. bad_flag(ARG1)  .AND.
+     .                ftb .NE. bad_flag(ARG1)  .AND.
+     .                fbt .NE. bad_flag(ARG1)  .AND.
+     .                ftt .NE. bad_flag(ARG1) ) THEN
+
+
+                     frac = (xpt - xbot ) / (xtop - xbot)
+                     fxbot = fbb + frac* (ftb - fbb)
+                     fxtop = fbt + frac* (ftt - fbt)
+
+*  Now interpolate in y, getting value at (x,y)
+
+                     IF (jbot .GE. arg_lo_ss(Y_AXIS,ARG1)  .AND. 
+     .                   jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+                        ybot = arg_3(ibot,jbot,k3,l3)
+                        ytop = arg_3(ibot,jtop,k3,l3)
+
+                        frac = (ypt - ybot)/ (ytop - ybot)
+                           result(i,j,k,l) = fxbot + frac* (fxtop-fxbot)
+                        ELSE
+                              result(i,j,k,l) = bad_flag_result
+                        ENDIF
+
+                     ELSE
+                        result(i,j,k,l) = bad_flag_result
+                     ENDIF		! bad_flag(ARG1) test
+                  ENDIF
+
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+
+ 400        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+            k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 500     CONTINUE
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+600   CONTINUE
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexy_curv_avg.F b/external_functions/sort/samplexy_curv_avg.F
new file mode 100644
index 0000000..8507d58
--- /dev/null
+++ b/external_functions/sort/samplexy_curv_avg.F
@@ -0,0 +1,548 @@
+*
+* samplexy_curv_avg.F
+*
+* Ansley Manke
+* 4/03 
+* ???  Note: does not currently deal with modulo data  ???
+* 1/06 Remove calls to SIGN to compile with f90 on IRIX.
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_avg_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .   'using unweighted averaging')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_avg_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_avg_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nx, ny
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx*ny, 2, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+
+
+
+      SUBROUTINE samplexy_curv_avg_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .       arg_5, result, xlocations)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+
+*  Set up work arrays
+
+      REAL xlocations(wrk1lox:wrk1lox+(wrk1hix-wrk1lox),wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL ylocations(2)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+      INTEGER i4,j4,k4,l4
+      INTEGER i5,j5,k5,l5
+
+      LOGICAL need_modulo
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      REAL xpt, ypt, ydiff, yd
+      REAL xptmin, xptmax, xcoordmin, xcoordmax
+      REAL fbb, ftb, fbt, ftt
+      REAL sum, count
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+
+      IF (nx1 .NE. nx2 .OR. nx2 .NE. nx3 .OR. nx1 .NE. nx3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+      IF (ny1 .NE. ny2 .OR. ny2 .NE. ny3 .OR. ny1 .NE. ny3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      ndimx = 0
+      ndimy = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF(arg_hi_ss(i,ARG4) - arg_lo_ss(i,ARG4) .GT.0) ndimx=ndimx + 1
+         IF(arg_hi_ss(i,ARG5) - arg_lo_ss(i,ARG5) .GT.0) ndimy=ndimy + 1
+  110 CONTINUE
+
+      IF (nx .NE. ny   .OR.  ndimx .GT. 1  .OR. ndimy .GT.1) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+      
+* Initialize result
+
+      DO 104 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 103 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 102 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 101 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                     result(i,j,k,l) = bad_flag_result
+
+ 101           CONTINUE
+ 102        CONTINUE
+ 103     CONTINUE
+ 104  CONTINUE
+
+* Get range of arg_2, longitude coordinates, and arg_4, xpts to sample.
+* is modulo-ing needed?
+
+      xcoordmin = ABS(bad_flag(ARG2))
+      xcoordmax = -1. * xcoordmin
+
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      DO 106 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 105 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         IF (arg_2(i2,j2,k2,l2) .NE. bad_flag(ARG2)) THEN
+            xcoordmin = MIN(arg_2(i2,j2,k2,l2), xcoordmin)
+            xcoordmax = MAX(arg_2(i2,j2,k2,l2), xcoordmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, curvilinear X coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+  105 CONTINUE
+  106 CONTINUE
+
+
+      xptmin = ABS(bad_flag(ARG4))
+      xptmax = -1.* xptmin
+      DO 204 l4 = arg_lo_ss(T_AXIS,ARG4), arg_hi_ss(T_AXIS,ARG4)
+      DO 203 k4 = arg_lo_ss(Z_AXIS,ARG4), arg_hi_ss(Z_AXIS,ARG4)
+      DO 202 j4 = arg_lo_ss(Y_AXIS,ARG4), arg_hi_ss(Y_AXIS,ARG4)
+      DO 201 i4 = arg_lo_ss(X_AXIS,ARG4), arg_hi_ss(X_AXIS,ARG4)
+
+         IF (arg_4(i4,j4,k4,l4) .NE. bad_flag(ARG4)) THEN
+            xptmin = MIN(arg_4(i4,j4,k4,l4), xptmin)
+            xptmax = MAX(arg_4(i4,j4,k4,l4), xptmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, sample x points, contains missing values'
+            GOTO 999
+         ENDIF
+  201 CONTINUE
+  202 CONTINUE
+  203 CONTINUE
+  204 CONTINUE
+
+      IF (xptmin .LT. xcoordmin) THEN
+         need_modulo = .TRUE.
+         add_xcoord = -360.
+      ENDIF
+      IF (xptmax .GT. xcoordmax) THEN
+         need_modulo = .TRUE.
+         add_xcoord = 360.
+      ENDIF
+ 
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 600 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+         xadd = 0.
+	 xpt = arg_4(i4,j4,k4,l4)
+         IF (need_modulo .AND. 
+     .       ((xpt .LT. xcoordmin) .OR.(xpt .GT. xcoordmax)) )
+     .    xadd = add_xcoord
+
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         l2 = arg_lo_ss(T_AXIS,ARG2)
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            xcoord = arg_2(i2,j2,k2,l2) + xadd
+c               icross = SIGN(1, (xpt - xcoord) )
+            icross = 1
+            IF ((xpt - xcoord) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+c               iloc = SIGN(1, (xpt-xcoord) )
+               xcoord = arg_2(i2,j2,k2,l2) + xadd
+
+               iloc = 1
+               IF ((xpt-xcoord) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1) = MAX(i2-1,1)
+                  xlocations(nloc,2,1,1) = j2
+c                  icross = SIGN(1, (xpt - xcoord) )
+                  icross = 1
+                  IF ((xpt - xcoord) .LT. 0.) icross = -1
+               ENDIF
+  100       CONTINUE
+
+  200    CONTINUE
+
+* Which of those locations is nearest ypt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         l3 = arg_lo_ss(T_AXIS,ARG3)
+
+         DO 300 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1)
+            j3 = xlocations(iloc,2,1,1)
+            IF (arg_3(i3,j3,k3,l3) .EQ. bad_flag(ARG3)) THEN
+               err_msg =
+     .      'ARG 3, curvilinear Y coordinates, contains missing values'
+               GOTO 999
+            ENDIF
+
+            yd = ABS(ypt - arg_3(i3,j3,k3,l3))
+
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  300   CONTINUE
+
+        ibot = xlocations(ptloc,1,1,1)
+        jbot = xlocations(ptloc,2,1,1)
+        IF (ibot .GE. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+        IF (jbot .GE. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+        itop = ibot + 1
+        jtop = jbot + 1
+
+*  First interpolate in x, getting values of the fcn at (x,jbot)  and (x,jtop)
+
+
+         IF (ibot .GE. arg_lo_ss(X_AXIS,ARG1)  .AND. 
+     .              itop .LT. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            k3 = arg_lo_ss(Z_AXIS,ARG3)
+            DO 500 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               l3 = arg_lo_ss(T_AXIS,ARG3)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      
+                  fbb = arg_1(ibot,jbot,k1,l1) 
+                  ftb = arg_1(itop,jbot,k1,l1)
+                  fbt = arg_1(ibot,jtop,k1,l1)
+                  ftt = arg_1(itop,jtop,k1,l1)
+
+                  count = 0.
+                  sum = 0.
+                  IF (fbb .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + fbb
+                  ENDIF
+                  IF (ftb .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + ftb
+                  ENDIF
+                  IF (fbt .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + fbt
+                  ENDIF
+                  IF (ftt .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + ftt
+                  ENDIF
+
+*  If any data present, set the value at (x,y)
+
+                  IF (count .GT. 0.) THEN
+                     result(i,j,k,l) = sum/count
+                  ELSE
+                     result(i,j,k,l) = bad_flag_result
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+                  l3 = l3 + arg_incr(T_AXIS,ARG3)
+
+ 400           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 500       CONTINUE
+
+         ENDIF  ! IF (ibot .GE. ...  .AND. itop .LT.  ...
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+600   CONTINUE
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexy_curv_nrst.F b/external_functions/sort/samplexy_curv_nrst.F
new file mode 100644
index 0000000..55fcd05
--- /dev/null
+++ b/external_functions/sort/samplexy_curv_nrst.F
@@ -0,0 +1,537 @@
+*
+* samplexy_curv_nrst.F
+*
+* Ansley Manke
+* 4/07
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5, returning nearest location.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_nrst_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*          USER CONFIGURABLE PORTION |
+*   |
+*   V
+      CHARACTER*120 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data at a set of (X,Y) points, ',
+     .   'from nearest loc on XY curvilinear grid')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*   ^
+*   |
+*          USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_nrst_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*          USER CONFIGURABLE PORTION |
+*   |
+*   V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*   ^
+*   |
+*          USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_nrst_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*           USER CONFIGURABLE PORTION |
+*    |
+*    V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nx, ny
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nx*ny, 2, 1, 1)
+
+*    ^
+*    |
+*           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+
+
+
+      SUBROUTINE samplexy_curv_nrst_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .       arg_5, result, xlocations)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .     mem5lot:mem5hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*          USER CONFIGURABLE PORTION |
+*   |
+*   V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+
+*  Set up work arrays
+
+      REAL xlocations(wrk1lox:wrk1lox+(wrk1hix-wrk1lox),wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL ylocations(2)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+      INTEGER i4,j4,k4,l4
+      INTEGER i5,j5,k5,l5
+
+      LOGICAL need_modulo
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      REAL xpt, ypt, ydiff, yd
+      REAL xptmin, xptmax, xcoordmin, xcoordmax
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+
+      IF (nx1 .NE. nx2 .OR. nx2 .NE. nx3 .OR. nx1 .NE. nx3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+      IF (ny1 .NE. ny2 .OR. ny2 .NE. ny3 .OR. ny1 .NE. ny3) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      ndimx = 0
+      ndimy = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF(arg_hi_ss(i,ARG4) - arg_lo_ss(i,ARG4) .GT.0) ndimx=ndimx + 1
+         IF(arg_hi_ss(i,ARG5) - arg_lo_ss(i,ARG5) .GT.0) ndimy=ndimy + 1
+  110 CONTINUE
+
+      IF (nx .NE. ny   .OR.  ndimx .GT. 1  .OR. ndimy .GT.1) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+      
+* Initialize result
+
+      DO 104 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 103 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 102 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 101 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                     result(i,j,k,l) = bad_flag_result
+
+ 101           CONTINUE
+ 102        CONTINUE
+ 103     CONTINUE
+ 104  CONTINUE
+
+* Get range of arg_2, longitude coordinates, and arg_4, xpts to sample.
+* is modulo-ing needed?
+
+      xcoordmin = ABS(bad_flag(ARG2))
+      xcoordmax = -1. * xcoordmin
+
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      DO 106 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 105 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         IF (arg_2(i2,j2,k2,l2) .NE. bad_flag(ARG2)) THEN
+            xcoordmin = MIN(arg_2(i2,j2,k2,l2), xcoordmin)
+            xcoordmax = MAX(arg_2(i2,j2,k2,l2), xcoordmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, curvilinear X coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+  105 CONTINUE
+  106 CONTINUE
+
+
+      xptmin = ABS(bad_flag(ARG4))
+      xptmax = -1.* xptmin
+      DO 204 l4 = arg_lo_ss(T_AXIS,ARG4), arg_hi_ss(T_AXIS,ARG4)
+      DO 203 k4 = arg_lo_ss(Z_AXIS,ARG4), arg_hi_ss(Z_AXIS,ARG4)
+      DO 202 j4 = arg_lo_ss(Y_AXIS,ARG4), arg_hi_ss(Y_AXIS,ARG4)
+      DO 201 i4 = arg_lo_ss(X_AXIS,ARG4), arg_hi_ss(X_AXIS,ARG4)
+
+         IF (arg_4(i4,j4,k4,l4) .NE. bad_flag(ARG4)) THEN
+            xptmin = MIN(arg_4(i4,j4,k4,l4), xptmin)
+            xptmax = MAX(arg_4(i4,j4,k4,l4), xptmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, sample x points, contains missing values'
+            GOTO 999
+         ENDIF
+  201 CONTINUE
+  202 CONTINUE
+  203 CONTINUE
+  204 CONTINUE
+
+      IF (xptmin .LT. xcoordmin) THEN
+         need_modulo = .TRUE.
+         add_xcoord = -360.
+      ENDIF
+      IF (xptmax .GT. xcoordmax) THEN
+         need_modulo = .TRUE.
+         add_xcoord = 360.
+      ENDIF
+ 
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 600 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+         xadd = 0.
+	 xpt = arg_4(i4,j4,k4,l4)
+         IF (need_modulo .AND. 
+     .       ((xpt .LT. xcoordmin) .OR.(xpt .GT. xcoordmax)) )
+     .    xadd = add_xcoord
+
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         l2 = arg_lo_ss(T_AXIS,ARG2)
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            xcoord = arg_2(i2,j2,k2,l2) + xadd
+            icross = 1
+            IF ((xpt - xcoord) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+               xcoord = arg_2(i2,j2,k2,l2) + xadd
+
+               iloc = 1
+               IF ((xpt-xcoord) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1) = MAX(i2-1,1)
+                  xlocations(nloc,2,1,1) = j2
+                  icross = 1
+                  IF ((xpt - xcoord) .LT. 0.) icross = -1
+               ENDIF
+  100       CONTINUE
+
+  200    CONTINUE
+
+* Which of those locations is nearest ypt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         l3 = arg_lo_ss(T_AXIS,ARG3)
+
+         DO 300 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1)
+            j3 = xlocations(iloc,2,1,1)
+            IF (arg_3(i3,j3,k3,l3) .EQ. bad_flag(ARG3)) THEN
+               err_msg =
+     .      'ARG 3, curvilinear Y coordinates, contains missing values'
+               GOTO 999
+            ENDIF
+
+            yd = ABS(ypt - arg_3(i3,j3,k3,l3))
+
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  300   CONTINUE
+
+        ibot = xlocations(ptloc,1,1,1)
+        jbot = xlocations(ptloc,2,1,1)
+        IF (ibot .GE. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+        IF (jbot .GE. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+        itop = ibot + 1
+        jtop = jbot + 1
+
+*  Return the function value closest to the xy value
+
+        IF (ibot .GE. arg_lo_ss(X_AXIS,ARG1)  .AND. 
+     .              itop .LT. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           k2 = arg_lo_ss(Z_AXIS,ARG2)
+           k3 = arg_lo_ss(Z_AXIS,ARG3)
+           DO 500 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              l2 = arg_lo_ss(T_AXIS,ARG2)
+              l3 = arg_lo_ss(T_AXIS,ARG3)
+              DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                 xbot = arg_2(ibot,jbot,k2,l2)
+                 xtop = arg_2(itop,jbot,k2,l2)
+
+                 ybot = arg_3(ibot,jbot,k3,l3)
+                 ytop = arg_3(ibot,jtop,k3,l3)
+
+                 dmin = SQRT((xpt - xbot )**2 + (ypt - ybot)**2 )
+                 ii = ibot
+                 jj = jbot
+                 dd =   SQRT((xpt - xtop )**2 + (ypt - ybot)**2 )
+                 IF (dd .LT. dmin) THEN
+                      ii = itop
+                      jj = jbot
+                      dmin = dd
+                 ENDIF
+                 dd =   SQRT((xpt - xbot )**2 + (ypt - ytop)**2 )
+                 IF (dd .LT. dmin) THEN
+                      ii = ibot
+                      jj = jtop
+                      dmin = dd
+                 ENDIF
+                 dd =   SQRT((xpt - xtop )**2 + (ypt - ytop)**2 )
+                 IF (dd .LT. dmin) THEN
+                      ii = itop
+                      jj = jtop
+                      dmin = dd
+                 ENDIF
+                  
+                 result(i,j,k,l) = arg_1(ii,jj,k1,l1) 
+
+                 l1 = l1 + arg_incr(T_AXIS,ARG1)
+                 l2 = l2 + arg_incr(T_AXIS,ARG2)
+                 l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400          CONTINUE
+              
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 500       CONTINUE
+
+         ENDIF  ! IF (ibot .GE. ...  .AND. itop .LT.  ...
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+600   CONTINUE
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexyt.F b/external_functions/sort/samplexyt.F
new file mode 100644
index 0000000..c9cfe60
--- /dev/null
+++ b/external_functions/sort/samplexyt.F
@@ -0,0 +1,691 @@
+*
+* samplexyt.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*  -------------------------------------------------------------------
+*
+* This function samples 4-d data at the x, y, t locations indicated by 
+* args 2, 3,4
+* 1/18/08  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y and t axes,
+*         and keeps the z axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y,T) points, ',
+     .   'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS, NORMAL)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 5)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 'T values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexyt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexyt_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mxh, myh, mth, mxl, myl, mtl
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* Allocate double the length of the axes for REAL*8 work arrays.
+* For x and t axes allow yet one more point for handling modulo axes
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mtl = arg_lo_ss(T_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1)  - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mth = mtl + 
+     .     2* (arg_hi_ss(T_AXIS,ARG1)  - arg_lo_ss(T_AXIS,ARG1) + 2)
+
+*  xaxdat
+      CALL ef_set_work_array_dims (id, 1, mxl, 1, 1, 1, mxh, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims (id, 2, myl, 1, 1, 1, myh, 1, 1, 1)
+
+*  taxdat
+      CALL ef_set_work_array_dims (id, 3, mtl, 1, 1, 1, mth, 1, 1, 1)
+
+*  taxdatlo
+      CALL ef_set_work_array_dims (id, 4, mtl, 1, 1, 1, mth, 1, 1, 1)
+
+*  taxdathi
+      CALL ef_set_work_array_dims (id, 5, mtl, 1, 1, 1, mth, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE samplexyt_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .      result, xaxdat, yaxdat, taxdat, taxdatlo, taxdathi)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .     mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER nt, ntx, nty, ntz, ntt
+      INTEGER ndimx, ndimy, ndimt
+
+*  Set up work arrays
+
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+      REAL*8 taxdat(wrk3lox:wrk3lox+(wrk3hix-wrk3lox)/2,wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit)
+      REAL*8 taxdatlo(wrk4lox:wrk4lox+(wrk4hix-wrk4lox)/2,wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz, wrk4lot:wrk4hit)
+      REAL*8 taxdathi(wrk5lox:wrk5lox+(wrk5hix-wrk5lox)/2,wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz, wrk5lot:wrk5hit)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+      INTEGER i4,j4,k4,l4
+
+      LOGICAL ok
+      INTEGER STR_UPCASE, ic, imatch, jmatch, lmatch
+      INTEGER ibot, itop, jbot, jtop, lbot, ltop
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, ybot, ytop, tbot, ttop
+      REAL frac, tfrac_lo, tfrac_hi, aa, bb
+      CHARACTER err_msg*255, test_str*16
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      INTEGER xlo, xhi, ylo, yhi, tlo, thi
+      REAL dx, dt, delmodx, delmodt, xpt, ypt, tpt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      ntx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nty = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      ntz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      ntt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nt = max(ntx, nty, ntz, ntt)
+
+      ndimx = 0
+      ndimy = 0
+      ndimt = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF (arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) .GT.0) 
+     .       ndimx = ndimx + 1
+         IF (arg_hi_ss(i,ARG3) - arg_lo_ss(i,ARG3) .GT.0) 
+     .       ndimy = ndimy + 1
+         IF (arg_hi_ss(i,ARG4) - arg_lo_ss(i,ARG4) .GT.0) 
+     .       ndimt = ndimt + 1
+  110 CONTINUE
+
+      IF (nx.NE.ny  .OR.  nx.NE.nt  .OR.
+     .    ndimx.GT.1  .OR. ndimy.GT.1  .OR.  ndimt.GT.1) THEN
+         WRITE (err_msg, 10)
+         GO TO 999
+      ENDIF
+
+   10 FORMAT(
+     . 'Arguments 2, 3, and 4 must be 1-dimensional ',
+     . 'lists of equal length')
+
+*  Get x, y, t coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+      CALL ef_get_coordinates(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+      CALL ef_get_box_lo_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdatlo)
+      CALL ef_get_box_hi_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdathi)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+
+*  Check to see if input x axis is modulo
+
+      CALL ef_get_axis_info (id, ARG1, ax_name, ax_units, backward, 
+     .                       modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      tlo = arg_lo_ss(T_AXIS,ARG1)
+      thi = arg_hi_ss(T_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(1))
+         ok = (test_str(1:3) .EQ. 'DEG' .OR. regular(1))
+         IF (.NOT. ok) THEN
+            err_msg = 'cannot handle MODULO axis that is not regular'
+            go to 999
+         ELSE
+            dx = xaxdat(xlo+1,1,1,1) - xaxdat(xlo,1,1,1)
+            delmodx = xaxdat(xhi,1,1,1) - xaxdat(xlo,1,1,1) + dx
+            xaxdat(xhi+1,1,1,1) = xaxdat(xlo,1,1,1)
+            IF (ok) delmodx = 360.
+         ENDIF
+      ENDIF
+      IF ( modulo(4) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(4))
+         ok = (regular(4))
+         IF (.NOT. ok) THEN
+            err_msg = 'cannot handle MODULO T axis that is not regular'
+            go to 999
+         ELSE
+            dt = taxdathi(tlo,1,1,1) - taxdatlo(tlo,1,1,1)
+            delmodt = taxdat(thi,1,1,1) - taxdat(tlo,1,1,1) + dt
+            taxdat(thi+1,1,1,1) = taxdat(tlo,1,1,1)
+         ENDIF
+      ENDIF
+
+*  For each (xpt,ypt,tpt) triple, 
+*  1) search the time coordinates of arg 1 for the nearest Time match
+*  2) search the data array arg_1 for the nearest higher (x,y) grid 
+*     coordinates.  Interpolate in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      j = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(T_AXIS)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         ibot = ef_unspecified_int4	! Check if xpt points in xax range.
+         imatch = 0
+
+	 xpt = arg_2(i2,j2,k2,l2)
+	 ypt = arg_3(i3,j3,k3,l3)
+	 tpt = arg_4(i3,j3,k3,l3)
+
+         IF (xpt .EQ. bad_flag(ARG2) .OR. ypt .EQ. bad_flag(ARG3) 
+     .       .OR. tpt .EQ. bad_flag(ARG4) ) THEN
+            DO 700 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l) = bad_flag_result
+  700       CONTINUE
+
+         ELSE
+* Find location of TPT in grid
+            Lbot = ef_unspecified_int4	! Check if tpt point in tax range.
+            Lmatch = 0
+            DO 600 i4 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(t_AXIS,ARG1)
+               IF (tpt .GE. taxdatlo(i4,1,1,1)) Lbot = i4
+               IF (tpt .EQ. taxdat(i4,1,1,1)) Lmatch = i4
+ 	       IF (modulo(4)) THEN
+	          DO WHILE (tpt .GE. taxdathi(thi,1,1,1) ) 
+                     tpt = tpt - delmodt
+	          ENDDO
+	          DO WHILE (tpt .LT. taxdatlo(tlo,1,1,1) )
+		     tpt = tpt + delmodt
+	          ENDDO
+	       ENDIF
+
+  600       CONTINUE
+
+* Check that tpt is not beyond the upper end of the time axis range.
+            IF (tpt .GT. taxdathi(arg_hi_ss(t_AXIS,ARG1),1,1,1)) 
+     .	       Lbot = ef_unspecified_int4
+
+	    IF (Lbot .EQ. ef_unspecified_int4) THEN
+               DO 800 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  result(i,j,k,l) = bad_flag_result
+  800          CONTINUE
+               GOTO 400
+
+            ELSE
+
+               IF (lmatch .NE. 0) then
+                  ltop = lbot
+               ELSE
+                  ltop = lbot + 1
+                  ltop = lbot  ! when using cell bounds taxdatlo, taxdathi
+               ENDIF
+               IF (lbot .EQ. ef_unspecified_int4) ltop = lbot
+
+               tbot = taxdatlo(lbot,1,1,1)
+               ttop = taxdathi(ltop,1,1,1)
+
+               IF (ltop .GE. arg_hi_ss(T_AXIS,ARG1)) 
+     .               ltop = arg_hi_ss(T_AXIS,ARG1)
+               IF (ttop .LT. tbot) THEN
+                  lbot = arg_hi_ss(T_AXIS,ARG1)
+                  ltop = arg_lo_ss(T_AXIS,ARG1)
+                  tbot = tbot - delmodt
+                  IF (tpt .GT. ttop) tpt = tpt - delmodt
+               ENDIF
+               
+               IF (ttop .EQ. tbot) THEN 
+                  tfrac_lo = 1.
+               ELSE
+                  tfrac_lo = (ttop - tpt )/ (ttop - tbot)
+               ENDIF
+               tfrac_hi = 1. - tfrac_lo
+ 
+            ENDIF
+            DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+               IF (xpt .GE. xaxdat(i1,1,1,1)) ibot = i1
+               IF (xpt .EQ. xaxdat(i1,1,1,1)) imatch = i1
+
+cbf      may be some derivation from the exact value can be allowed:
+cbf      if (xpt - xaxdat(i1,1,1,1)).le.eps)   imatch = i1
+
+*  Locate the X point within the range of modulo X axis 
+
+ 	       IF (modulo(1)) THEN
+	          DO WHILE (xpt .GE. xaxdat(xhi,1,1,1) ) 
+                     xpt = xpt - delmodx
+	          ENDDO
+	          DO WHILE (xpt .LT. xaxdat(xlo,1,1,1) )
+		     xpt = xpt + delmodx
+	          ENDDO
+	       ENDIF
+
+  100       CONTINUE
+            i1 = arg_hi_ss(X_AXIS,ARG1)
+            IF (xpt .GT. xaxdat(i1,1,1,1)) THEN
+               IF (.NOT. modulo(1)) 
+     .             ibot = ef_unspecified_int4		! ARG_2 XPT outside of range 
+		           				! (non modulo)
+            ENDIF
+
+cbf       for matching the next neighbour is not of interest
+            IF (imatch .NE. 0) then
+               itop = ibot
+            ELSE
+               itop = ibot + 1
+            ENDIF
+
+            IF (ibot .EQ. ef_unspecified_int4) THEN
+               itop = ibot
+            ELSE
+
+               xbot = xaxdat(ibot,1,1,1)
+               xtop = xaxdat(itop,1,1,1)
+c ---
+               IF (modulo(1) .AND. xtop .LT. xbot) THEN
+                  ibot = arg_hi_ss(X_AXIS,ARG1)
+                  itop = arg_lo_ss(X_AXIS,ARG1)
+                  xbot = xbot - delmodx
+                  IF (xpt .GT. xtop) xpt = xpt - delmodx
+               ENDIF
+c ---
+            ENDIF
+
+
+cbf        analogously in y direction
+            jbot = ef_unspecified_int4	! Check if ypt points in yax range.
+            jmatch = 0
+
+   	    ypt = arg_3(i3,j3,k3,l3)
+            DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               IF (ypt .GE. yaxdat(j1,1,1,1) ) jbot = j1
+            IF (ypt .EQ. yaxdat(j1,1,1,1) ) jmatch = j1
+cbf         IF (ypt - yaxdat(j1,1,1,1) ) .LE. eps) jmatch = j1
+
+  200       CONTINUE
+            j1 = arg_hi_ss(Y_AXIS,ARG1)
+            IF (arg_3(i3,j3,k3,l3) .GE. yaxdat(j1,1,1,1) ) THEN
+                jbot = ef_unspecified_int4		! ARG_3 YPT outside of range 
+						        ! (non modulo)
+
+            ENDIF
+
+            IF (jmatch .NE. 0) then
+                jtop = jbot
+            ELSE
+               jtop = jbot + 1
+            ENDIF
+            IF (jbot .EQ. ef_unspecified_int4) jtop = jbot
+            IF (jtop .GE. arg_hi_ss(Y_AXIS,ARG1)) 
+     .                           jtop = arg_hi_ss(Y_AXIS,ARG1)        !10/2001 acm
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 333 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               l3 = arg_lo_ss(T_AXIS,ARG3)
+
+*  First interpolate in x, getting values of the fcn at (x,jbot) and (x,jtop)
+
+               IF (ibot .EQ. ef_unspecified_int4  .OR.  
+     .		      jbot .EQ. ef_unspecified_int4) THEN
+                  result(i,j,k,l) = bad_flag_result
+               ELSE 
+
+                  aa = arg_1(ibot,jbot,k1,lbot)
+                  bb = arg_1(ibot,jbot,k1,ltop)
+                  fbb = aa* tfrac_lo + bb* tfrac_hi
+
+                  aa = arg_1(itop,jbot,k1,lbot)
+                  bb = arg_1(itop,jbot,k1,ltop)
+                  ftb = aa* tfrac_lo + bb* tfrac_hi
+
+                  aa = arg_1(ibot,jtop,k1,lbot)
+                  bb = arg_1(ibot,jtop,k1,ltop)
+                  fbt = aa* tfrac_lo + bb* tfrac_hi
+
+                  aa = arg_1(itop,jtop,k1,lbot)
+                  bb = arg_1(itop,jtop,k1,ltop)
+                  ftt = aa* tfrac_lo + bb* tfrac_hi
+
+                  IF (fbb .NE. bad_flag(ARG1)  .AND.
+     .                ftb .NE. bad_flag(ARG1)  .AND.
+     .                fbt .NE. bad_flag(ARG1)  .AND.
+     .                ftt .NE. bad_flag(ARG1) ) THEN
+
+cbf    for matching x-axis no interpolation is need
+                     IF (imatch .NE. 0) THEN
+                        fxbot = fbb
+                        fxtop = fbt
+                     ELSE
+                        frac = (xpt - xbot )/ (xtop - xbot)
+                        fxbot = fbb + frac* (ftb - fbb)
+                        fxtop = fbt + frac* (ftt - fbt)
+                     ENDIF
+
+*  Now interpolate in y, getting value at (x,y)
+
+                     IF (jbot .GE. arg_lo_ss(Y_AXIS,ARG1)  .AND.
+     .                   jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+                        ybot = yaxdat(jbot,1,1,1)
+                        ytop = yaxdat(jtop,1,1,1)
+
+                        IF (jmatch .NE. 0) THEN
+                             result(i,j,k,l) = fxbot
+                        ELSE
+                            frac = (ypt - ybot)/ (ytop-ybot)
+                            result(i,j,k,l) = fxbot + frac* 
+     .                                         (fxtop - fxbot)
+                        ENDIF
+                     ELSE
+                        result(i,j,k,l) = bad_flag_result
+                     ENDIF
+
+                  ELSE
+                     result(i,j,k,l) = bad_flag_result
+                  ENDIF	   ! fbb,ftp, etc not bad flags
+
+	       ENDIF  ! itop, jtop not ef_unspecified_int4
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 333        CONTINUE
+
+         ENDIF  ! xpt and ypt not bad values
+ 400     CONTINUE
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         j = j + res_incr(Y_AXIS)
+500   CONTINUE
+
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexyt_nrst.F b/external_functions/sort/samplexyt_nrst.F
new file mode 100644
index 0000000..011cffe
--- /dev/null
+++ b/external_functions/sort/samplexyt_nrst.F
@@ -0,0 +1,721 @@
+*
+* samplexyt_nrst.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*  -------------------------------------------------------------------
+*
+* This function samples 4-d data at the x, y, t locations indicated by 
+* args 2, 3,4
+* 1/18/08  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y and t axes,
+*         and keeps the z axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexyt_nrst_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y,T) points, ',
+     .        'using nearest grid intersection')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 5)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 'T values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexyt_nrst_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexyt_nrst_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mxh, myh, mth, mxl, myl, mtl
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* Allocate double the length of the axes for REAL*8 work arrays.
+* For x and t axes allow yet one more point for handling modulo axes
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mtl = arg_lo_ss(T_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mth = mtl + 
+     .     2* (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 2)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  taxdat
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdatlo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdathi
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexyt_nrst_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .         result, xaxdat, yaxdat, taxdat, taxdatlo, taxdathi)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2)
+      REAL*8 taxdat(wrk3lox:wrk3lox+(wrk3hix-wrk3lox)/2)
+      REAL*8 taxdatlo(wrk4lox:wrk4lox+(wrk4hix-wrk4lox)/2)
+      REAL*8 taxdathi(wrk5lox:wrk5lox+(wrk5hix-wrk5lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER STR_UPCASE
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER nt, ntx, nty, ntz, ntt, nte, ntf
+      INTEGER ndimx, ndimy, ndimt
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER ic, imatch, jmatch, lmatch
+      INTEGER ibot, itop, jbot, jtop, lbot, ltop
+      INTEGER xlo, xhi, ylo, yhi, tlo, thi
+      LOGICAL ok
+
+      REAL xbot, xtop, ybot, ytop, tbot, ttop
+      REAL x_to_xbot, x_to_xtop, y_to_ybot, y_to_ytop, t_to_tbot, t_to_ttop
+      REAL dx, dt, delmodx, delmodt, xpt, ypt, tpt
+      CHARACTER err_msg*255, test_str*16
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = MAX(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nye = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      ny = MAX(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ntx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nty = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      ntz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      ntt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nte = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      ntf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nt = MAX(ntx, nty, ntz, ntt, nte, ntf)
+
+      ndimx = 0
+      ndimy = 0
+      ndimt = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) )
+     .       ndimx = ndimx + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) )
+     .       ndimy = ndimy + 1
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) )
+     .       ndimt = ndimt + 1
+   10 CONTINUE
+
+      IF ((nx .NE. ny) .OR. (nx .NE. nt) .OR. 
+     .    (ndimx .GT. 1) .OR. (ndimy .GT. 1) .OR. (ndimt .GT. 1)) THEN
+         WRITE (err_msg, 20)
+         GO TO 999
+      ENDIF
+
+   20 FORMAT('Arguments 2, 3, and 4 must be 1-dimensional ',
+     .       'lists of equal length')
+
+*  Get x, y, t coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+      CALL ef_get_coordinates(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+      CALL ef_get_box_lo_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdatlo)
+      CALL ef_get_box_hi_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdathi)
+
+*  Check to see if input x axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      tlo = arg_lo_ss(T_AXIS,ARG1)
+      thi = arg_hi_ss(T_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(1))
+         ok = (test_str(1:3) .EQ. 'DEG' .OR. regular(1))
+         IF ( .NOT. ok ) THEN
+            err_msg = 'cannot handle MODULO X axis that is not regular'
+            GO TO 999
+         ENDIF
+         dx = xaxdat(xlo+1) - xaxdat(xlo)
+         delmodx = 360.
+         xaxdat(xhi+1) = xaxdat(xlo)
+      ENDIF
+      IF ( modulo(4) ) THEN
+         IF ( .NOT. regular(4) ) THEN
+            err_msg = 'cannot handle MODULO T axis that is not regular'
+            GO TO 999
+         ENDIF
+         dt = taxdathi(tlo) - taxdatlo(tlo)
+         delmodt = taxdat(thi) - taxdat(tlo) + dt
+         taxdat(thi+1) = taxdat(tlo)
+      ENDIF
+
+*  For each (xpt,ypt,tpt) triple, 
+*  1) search the time coordinates of arg 1 for the nearest Time match
+*  2) search the data array arg_1 for the nearest higher (x,y) grid 
+*     coordinates.  Interpolate in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+* Y-axis and T-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         ypt = arg_3(i3,j3,k3,l3,m3,n3)
+         tpt = arg_4(i4,j4,k4,l4,m4,n4)
+
+         IF ( xpt .EQ. bad_flag(ARG2) .OR.
+     .        ypt .EQ. bad_flag(ARG3) .OR.
+     .        tpt .EQ. bad_flag(ARG4) ) THEN
+            DO 30 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 30 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 30 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   30       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+* Try to get tpt in range if the T-axis is modulo
+         IF ( modulo(4) ) THEN
+            DO WHILE ( tpt .GE. taxdathi(thi) ) 
+               tpt = tpt - delmodt
+            ENDDO
+            DO WHILE ( tpt .LT. taxdatlo(tlo) )
+               tpt = tpt + delmodt
+            ENDDO
+         ENDIF
+
+* Check if tpt is in the T-axis range.
+         lbot = ef_unspecified_int4
+         lmatch = ef_unspecified_int4
+         DO 410 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+            IF ( TM_FPEQ(tpt, taxdat(l1)) ) THEN
+               lmatch = l1
+               GOTO 420
+            ELSE IF ( tpt .GE. taxdatlo(l1) ) THEN
+               lbot = l1
+            ENDIF
+  410    CONTINUE
+
+* Check that tpt is not beyond the upper end of the T-axis range.
+         IF ( tpt .GT. taxdathi(thi) ) THEN
+            IF ( .NOT. modulo(4) )
+     .         lbot = ef_unspecified_int4
+         ENDIF
+
+  420    IF ( lmatch .NE. ef_unspecified_int4 ) THEN
+            lbot = lmatch
+            ltop = lmatch
+         ELSE IF ( lbot .NE. ef_unspecified_int4 ) THEN
+*           using cell bounds taxdatlo, taxdathi
+            ltop = lbot
+         ELSE
+*           tpt outside the grid
+            DO 430 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 430 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 430 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  430       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         tbot = taxdatlo(lbot)
+         ttop = taxdathi(ltop)
+
+         IF ( modulo(4) .AND. (ttop .LT. tbot) ) THEN
+            lbot = thi
+            ltop = tlo
+            tbot = tbot - delmodt
+            IF ( tpt .GT. ttop )
+     .         tpt = tpt - delmodt
+         ENDIF
+
+         t_to_tbot = ABS(tpt - tbot)
+         t_to_ttop = ABS(tpt - ttop)
+         IF (t_to_tbot .LE. t_to_ttop) THEN
+            l1 = lbot
+         ELSE
+            l1 = lbot+1
+         ENDIF
+ 
+* Try to get xpt in range if the X-axis is modulo
+         IF ( modulo(1) ) THEN
+            DO WHILE ( xpt .GE. xaxdat(xhi) ) 
+               xpt = xpt - delmodx
+            ENDDO
+            DO WHILE ( xpt .LT. xaxdat(xlo) )
+               xpt = xpt + delmodx
+            ENDDO
+         ENDIF
+
+* Check if xpt is in the X-axis range.
+         ibot = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+
+         DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xpt, xaxdat(i1)) ) THEN
+               imatch = i1
+               GOTO 120
+            ELSE IF ( xpt .GT. xaxdat(i1) ) THEN
+               ibot = i1
+            ENDIF
+  110    CONTINUE
+
+* Check that xpt is not beyond the upper end of the X-axis range.
+         IF ( xpt .GT. xaxdat(xhi) ) THEN
+            IF ( .NOT. modulo(1) ) 
+     .         ibot = ef_unspecified_int4
+         ENDIF
+
+  120    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+            ibot = imatch
+            itop = imatch
+         ELSE IF ( ibot .NE. ef_unspecified_int4 ) THEN
+* If modulo(1) then there is an extra xaxdat so itop is in range
+            itop = ibot + 1
+         ELSE
+*           xpt outside the grid
+            DO 130 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 130 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 130 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  130       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         xbot = xaxdat(ibot)
+         xtop = xaxdat(itop)
+         IF ( modulo(1) .AND. (xtop .LT. xbot) ) THEN
+            ibot = xhi
+            itop = xlo
+            xbot = xbot - delmodx
+            IF (xpt .GT. xtop)
+     .         xpt = xpt - delmodx
+         ENDIF
+         x_to_xbot = ABS(xpt - xbot)
+         x_to_xtop = ABS(xpt - xtop)
+         IF (x_to_xbot .LE. x_to_xtop) THEN
+            i1 = ibot
+         ELSE
+            i1 = ibot+1
+         ENDIF
+
+
+* Check if ypt is in the Y-axis range.
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         DO 210 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(ypt, yaxdat(j1)) ) THEN
+               jmatch = j1
+               GOTO 220
+            ELSE IF ( ypt .GT. yaxdat(j1) ) THEN
+               jbot = j1
+            ENDIF
+  210    CONTINUE
+
+* Check that ypt is not beyond the upper end of the Y-axis range.
+         IF ( ypt .GT. yaxdat(yhi) ) THEN
+             jbot = ef_unspecified_int4
+         ENDIF
+
+  220    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+            jbot = jmatch
+            jtop = jmatch
+         ELSE IF ( jbot .NE. ef_unspecified_int4) THEN
+            jtop = jbot + 1
+         ELSE
+*           ypt outside the grid
+            DO 230 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 230 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 230 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  230       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         ybot = yaxdat(jbot)
+         ytop = yaxdat(jtop)
+         y_to_ybot = ABS(ypt - ybot)
+         y_to_ytop = ABS(ypt - ytop)
+         IF (y_to_ybot .LE. y_to_ytop) THEN
+            j1 = jbot
+         ELSE
+            j1 = jbot+1
+         ENDIF
+
+* Loop through the Z/E/F axes, assigning results for this coordinate pair
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( i1 .EQ. ef_unspecified_int4 .OR.
+     .              j1 .EQ. ef_unspecified_int4 .OR.
+     .              l1 .EQ. ef_unspecified_int4) THEN 
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+	          result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+               ENDIF
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2, one of the ARG3, and one of ARG4 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+  700 CONTINUE
+
+      RETURN
+
+  999 CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/samplexz.F b/external_functions/sort/samplexz.F
new file mode 100644
index 0000000..9084614
--- /dev/null
+++ b/external_functions/sort/samplexz.F
@@ -0,0 +1,538 @@
+*
+* samplexz.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that INCLUDE 'ferret_cmn/s this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke  from samplexy  5/15/01
+* 11-Jan-06 *acm* declare xlo, xhi, zlo, zhi  as integer not real
+*
+* This function samples 4-d data on the x and z axes indicated by args 2 and 3
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexz_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Z) points, ',
+     .   'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, IMPLIED_BY_ARGS, 
+     .     NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg, 'Z values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexz_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      my_lo_l = 1
+      my_hi_l = max(nx,ny)
+      my_hi_l = max(my_hi_l,nz)
+      my_hi_l = max(my_hi_l,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexz_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mxh, mzh, mxl, mzl
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      mzl = arg_lo_ss(Z_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1)
+      mzh = mzl + 
+     .     2* (arg_hi_ss(Z_AXIS,ARG1)  - arg_lo_ss(Z_AXIS,ARG1) + 1)
+
+*  xaxdat
+      CALL ef_set_work_array_dims (id, 1, mxl, 1, 1, 1, mxh, 1, 1, 1)
+
+*  zaxdat
+      CALL ef_set_work_array_dims (id, 2, mzl, 1, 1, 1, mzh, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE samplexz_compute(id, arg_1, arg_2, arg_3, result,
+     .       xaxdat, zaxdat)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mxdat, mydat
+      INTEGER mxdat, mydat
+      INTEGER nx, nxx, nxy, nxz, nxt
+      INTEGER nz, nzx, nzy, nzz, nzt
+      INTEGER ndimx, ndimz
+
+*  Set up work arrays
+
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 zaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+
+      INTEGER imatch, kmatch
+      INTEGER ibot, itop, kbot, ktop
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, zbot, ztop
+      REAL frac
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      REAL delmodx, delmodz, xpt, zpt
+      INTEGER xlo, xhi, zlo, zhi
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nx = max(nxx, nxy, nxz, nxt)
+
+      nzx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nzy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nzz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nzt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nz = max(nzx, nzy, nzz, nzt)
+
+      ndimx = 0
+      ndimz = 0
+      DO 110 i = X_AXIS,T_AXIS
+         IF (arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) .GT.0) 
+     .       ndimx = ndimx + 1
+         IF (arg_hi_ss(i,ARG3) - arg_lo_ss(i,ARG3) .GT.0) 
+     .       ndimz= ndimz + 1
+  110 CONTINUE
+
+      IF (nx .NE. nz   .OR.  ndimx .GT. 1  .OR. ndimz .GT.1) THEN
+         WRITE (err_msg, 10)
+         GO TO 999
+      ENDIF
+
+   10 FORMAT(
+     . 'Arguments 2 and 3 must be 1-dimensional lists of equal length')
+
+*  Get  and z coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxdat)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+*  Check to see if input x,z  axis is modulo
+
+      CALL ef_get_axis_info (id, ARG1, ax_name, ax_units, backward, 
+     .                       modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      zlo = arg_lo_ss(Z_AXIS,ARG1)
+      zhi = arg_hi_ss(Z_AXIS,ARG1)
+
+      IF ( modulo(1) ) delmodx = xaxdat(xhi,1,1,1) - xaxdat(xlo,1,1,1)
+      IF ( modulo(3) ) delmodz = zaxdat(zhi,1,1,1) - zaxdat(zlo,1,1,1)
+
+*  For each (xpt,zpt) pair, search the data array 
+*   arg_1 for the nearest higher (x,z) grid coordinates.  Interpolate 
+*   in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 500 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         ibot = ef_unspecified_int4	! Check if xpt points in xax range.
+         imatch = 0
+
+	 xpt = arg_2(i2,j2,k2,l2)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF (xpt .GE. xaxdat(i1,1,1,1)) ibot = i1
+            if (xpt .EQ. xaxdat(i1,1,1,1)) imatch = i1
+
+cbf      may be some derivation from the exact value can be allowed:
+cbf      if (xpt - xaxdat(i1,1,1,1)).le.eps)   imatch = i1
+
+*  Locate the X point within the range of modulo X axis 
+
+	    IF (modulo(1)) THEN
+	       DO WHILE (xpt .GE. xaxdat(xhi,1,1,1) ) 
+                  xpt = xpt - delmodx
+	       ENDDO
+	       DO WHILE (xpt .LT. xaxdat(xlo,1,1,1) )
+		  xpt = xpt + delmodx
+	       ENDDO
+	    ENDIF
+
+  100    CONTINUE
+         i1 = arg_hi_ss(X_AXIS,ARG1)
+         IF (xpt .GT. xaxdat(i1,1,1,1)) THEN
+             ibot = ef_unspecified_int4		! ARG_2 XPT outside of range 
+						! (non modulo)
+         ENDIF
+
+cbf       for matching the next neighbour is not of interest
+         IF (imatch .NE. 0) then
+            itop = ibot
+         ELSE
+            itop = ibot + 1
+         ENDIF
+         IF (ibot .EQ. ef_unspecified_int4) itop = ibot
+
+cbf        analogously in z direction
+         kbot = ef_unspecified_int4	! Check if ypt points in zax range.
+         kmatch = 0
+
+	 zpt = arg_3(i3,j3,k3,l3)
+         DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+            IF (zpt .GE. zaxdat(k1,1,1,1) ) kbot = k1
+            IF (zpt .EQ. zaxdat(k1,1,1,1) ) kmatch = k1
+cbf         IF zpt - zaxdat(k1,1,1,1) ) .LE. eps) kmatch = k1
+
+*  Locate the Z point within the range of modulo Z axis 
+
+	    IF (modulo(3)) THEN
+	       DO WHILE (zpt .GE. zaxdat(zhi,1,1,1) ) 
+                  zpt = zpt - delmodz
+	       ENDDO
+	       DO WHILE (zpt .LT. zaxdat(zlo,1,1,1) )
+		  zpt = zpt + delmodz
+	       ENDDO
+	    ENDIF
+
+  200    CONTINUE
+         k1 = arg_hi_ss(Z_AXIS,ARG1)
+         IF (arg_3(i3,j3,k3,l3) .GE. zaxdat(k1,1,1,1) ) THEN
+            kbot = ef_unspecified_int4		! ARG_3 ZPT outside of range 
+						! (non modulo)
+
+         ENDIF
+
+         IF (kmatch .NE. 0) then
+            ktop = kbot
+         ELSE
+            ktop = kbot + 1
+         ENDIF
+         IF (kbot .EQ. ef_unspecified_int4) ktop = kbot
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  First interpolate in x, getting values of the fcn at (x,kbot) and (x,ktop)
+
+	       IF (ibot .EQ. ef_unspecified_int4  .OR.  
+     .		   kbot .EQ. ef_unspecified_int4) THEN
+                 result(i,j,k,l) = bad_flag_result
+	       ELSE 
+                  IF (ibot .GE. arg_lo_ss(X_AXIS,ARG1)  .AND.
+     .                itop .LE. arg_hi_ss(X_AXIS,ARG1) ) THEN
+
+                     xbot = xaxdat(ibot,1,1,1)
+                     xtop = xaxdat(itop,1,1,1)
+
+                     fbb = arg_1(ibot,j1,kbot,l1)
+                     ftb = arg_1(itop,j1,kbot,l1)
+                     fbt = arg_1(ibot,j1,ktop,l1)
+                     ftt = arg_1(itop,j1,ktop,l1)
+
+                     IF (fbb .NE. bad_flag(ARG1)  .AND.
+     .                   ftb .NE. bad_flag(ARG1)  .AND.
+     .                   fbt .NE. bad_flag(ARG1)  .AND.
+     .                   ftt .NE. bad_flag(ARG1) ) THEN
+
+cbf                 for matching x-axis no interpolation is need
+                          if (imatch.ne.0) then
+                             fxbot = fbb
+                             fxtop = fbt
+                          else
+                             frac = (xpt - xbot )/ (xtop - xbot)
+                             fxbot = fbb + frac* (ftb - fbb)
+                             fxtop = fbt + frac* (ftt - fbt)
+                          endif
+
+*  Now interpolate in y, getting value at (x,y)
+
+                       IF (kbot .GE. arg_lo_ss(Z_AXIS,ARG1)  .AND.
+     .                     ktop .LE. arg_hi_ss(Z_AXIS,ARG1) ) THEN
+                          zbot = zaxdat(kbot,1,1,1)
+                          ztop = zaxdat(ktop,1,1,1)
+
+                          IF (kmatch .NE. 0) THEN
+                             result(i,j,k,l) = fxbot
+                          ELSE
+                            frac = (zpt - zbot)/ (ztop-zbot)
+
+                            result(i,j,k,l) = fxbot + frac* 
+     .                                         (fxtop - fxbot)
+                          ENDIF
+                       ELSE
+                           result(i,j,k,l) = bad_flag_result
+                       ENDIF
+
+                    ELSE
+                        result(i,j,k,l) = bad_flag_result
+                    ENDIF  ! bad_flag(ARG1) test
+                  ENDIF	   ! fbb,ftp, etc not bad flags
+
+	       ENDIF  ! itop, jtop not ef_unspecified_int4
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+
+ 300        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 400     CONTINUE
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         k = k + res_incr(Z_AXIS)
+500   CONTINUE
+
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/sampleyz.F b/external_functions/sort/sampleyz.F
new file mode 100644
index 0000000..3fda1c4
--- /dev/null
+++ b/external_functions/sort/sampleyz.F
@@ -0,0 +1,543 @@
+*
+* sampleyz.F
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* From samplexy.F
+* Wednesday, May 02, 2001
+* 11-Jan-06 *acm* declare ylo, yhi, zlo, zhi as integer not real
+*
+* This function samples 4-d data at y and z pts indicated by args 2 and 3
+* 
+*         Result is abstract on the Y axis, normal on the z axis,
+*         and keeps the x and t axes of the input 4-d data.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sampleyz_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (Y,X) points, ',
+     .   'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, ABSTRACT, 
+     .     NORMAL, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t) to sample')
+      CALL ef_set_axis_influence(id, arg, YES, NO, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg, 'Z values of sample points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE sampleyz_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER mz_lo_l, mz_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+      mz_lo_l = 1
+      mz_hi_l = max(nx,ny)
+      mz_hi_l = max(mz_hi_l,nz)
+      mz_hi_l = max(mz_hi_l,nt)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, mz_lo_l, mz_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sampleyz_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,ylo,zlo,zlo,tlo,yhi,zhi,zhi,thi)
+*
+      INTEGER myl, myh, mzl, mzh
+
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mzl = arg_lo_ss(Z_AXIS,ARG1)
+
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mzh = mzl + 
+     .     2* (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1)
+
+*  yax
+      CALL ef_set_work_array_dims (id, 1, myl, 1, 1, 1, myh, 1, 1, 1)
+
+*  zax
+      CALL ef_set_work_array_dims (id, 2, mzl, 1, 1, 1, mzh, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE sampleyz_compute(id, arg_1, arg_2, arg_3, result,
+     .       yax, zax)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable's axes.
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      COMMON /STOR/ mydat, mzdat
+      INTEGER mydat, mzdat
+      INTEGER ny, nyx, nyy, nyz, nyt
+      INTEGER nz, nzx, nzy, nzz, nzt
+      INTEGER ndimy, ndimz
+
+*  Set up work arrays
+
+      REAL*8 yax(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL*8 zax(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+      INTEGER i, j, k, l
+      INTEGER i1,j1,k1,l1
+      INTEGER i2,j2,k2,l2
+      INTEGER i3,j3,k3,l3
+
+      INTEGER jmatch, kmatch
+      INTEGER jbot, jtop, kbot, ktop
+      REAL fbot, ftop, fbb, ftb, fbt, ftt
+      REAL ybot, ytop, zbot, ztop
+      REAL frac
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+      REAL delmody, delmodz, ypt, zpt
+      INTEGER ylo, yhi, zlo, zhi
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nyx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      ny = max(nyx, nyy, nyz, nyt)
+
+      nzx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nzy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nzz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nzt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nz = max(nzx, nzy, nzz, nzt)
+
+      ndimy = 0
+      ndimz = 0
+      DO 110 i = X_AXIS, T_AXIS
+         IF (arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) .GT.0) 
+     .       ndimy = ndimy + 1
+         IF (arg_hi_ss(i,ARG3) - arg_lo_ss(i,ARG3) .GT.0) 
+     .       ndimz= ndimz + 1
+  110 CONTINUE
+
+      IF (ny .NE. nz   .OR.  ndimy .GT. 1  .OR. ndimz .GT.1) THEN
+         WRITE (err_msg, 10)
+         GO TO 999
+      ENDIF
+
+   10 FORMAT(
+     . 'Arguments 2 and 3 must be 1-dimensional lists of equal length')
+
+*  Get y and z coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yax)
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zax)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+*  Check to see if input y or z  axis is modulo
+
+      CALL ef_get_axis_info (id, ARG1, ax_name, ax_units, backward, 
+     .                       modulo, regular)
+
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      zlo = arg_lo_ss(Z_AXIS,ARG1)
+      zhi = arg_hi_ss(Z_AXIS,ARG1)
+
+      IF ( modulo(1) ) delmody = yax(yhi,1,1,1) - yax(ylo,1,1,1)
+      IF ( modulo(2) ) delmodz = zax(zhi,1,1,1) - zax(zlo,1,1,1)
+
+*  For each (ypt,zpt) pair, search the data array 
+*   arg_1 for the nearest higher (y,z) grid coordinates.  Interpolate 
+*   in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 500 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         jbot = ef_unspecified_int4	! Check if ypt points in xax range.
+         jmatch = 0
+
+	 ypt = arg_2(i2,j2,k2,l2)
+         DO 100 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF (ypt .GE. yax(j1,1,1,1)) jbot = j1
+            if (ypt .EQ. yax(j1,1,1,1)) jmatch = j1
+
+cbf      may be some derivation from the exact value can be allowed:
+cbf      if (ypt - yax(j1,1,1,1)).le.eps)   jmatch = j1
+
+*  Locate the Y point within the range of modulo Y axis 
+
+	    IF (modulo(2)) THEN
+	       DO WHILE (ypt .GE. yax(yhi,1,1,1) ) 
+                  ypt = ypt - delmody
+	       ENDDO
+	       DO WHILE (ypt .LT. yax(ylo,1,1,1) )
+		  ypt = ypt + delmody
+	       ENDDO
+	    ENDIF
+
+  100    CONTINUE
+
+         j1 = arg_hi_ss(Y_AXIS,ARG1)
+         IF (ypt .GT. yax(j1,1,1,1)) THEN
+             jbot = ef_unspecified_int4		! ARG_2 ypt outside of range 
+						! (non modulo)
+         ENDIF
+
+cbf       for matching the next neighbour is not of interest
+         IF (jmatch .NE. 0) then
+            jtop = jbot
+         ELSE
+            jtop = jbot + 1
+         ENDIF
+         IF (jbot .EQ. ef_unspecified_int4) jtop = jbot
+
+cbf        analogously in z direction
+         kbot = ef_unspecified_int4	! Check if zpt points in yax range.
+         kmatch = 0
+
+	 zpt = arg_3(i3,j3,k3,l3)
+         DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+            IF (zpt .GE. zax(k1,1,1,1) ) kbot = k1
+            IF (zpt .EQ. zax(k1,1,1,1) ) kmatch = k1
+cbf         IF (zpt - zax(k1,1,1,1) ) .LE. eps) kmatch = k1
+
+*  Locate the Z point within the range of modulo Z axis 
+
+	    IF (modulo(3)) THEN
+	       DO WHILE (zpt .GE. zax(zhi,1,1,1) ) 
+                  zpt = zpt - delmodz
+	       ENDDO
+	       DO WHILE (zpt .LT. zax(zlo,1,1,1) )
+		  zpt = zpt + delmodz
+	       ENDDO
+	    ENDIF
+
+  200    CONTINUE
+         k1 = arg_hi_ss(Z_AXIS,ARG1)
+         IF (arg_3(i3,j3,k3,l3) .GE. zax(k1,1,1,1) ) THEN
+            kbot = ef_unspecified_int4		! ARG_3 zpt outside of range 
+						! (non modulo)
+
+         ENDIF
+
+c         print *, ' ypt,zpt,jbot,kbot', ypt,zpt,jbot,kbot
+
+         IF (kmatch .NE. 0) then
+            ktop = kbot
+         ELSE
+            ktop = kbot + 1
+         ENDIF
+         IF (kbot .EQ. ef_unspecified_int4) ktop = kbot
+
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  First interpolate in y, getting values of the fcn at (y,kbot) and (y,ktop)
+
+	       IF (jbot .EQ. ef_unspecified_int4  .OR.  
+     .		   kbot .EQ. ef_unspecified_int4) THEN
+                 result(i,j,k,l) = bad_flag_result
+	       ELSE 
+                  IF (jbot .GE. arg_lo_ss(Y_AXIS,ARG1)  .AND.
+     .                jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+
+                     ybot = yax(jbot,1,1,1)
+                     ytop = yax(jtop,1,1,1)
+
+                     fbb = arg_1(i1,jbot,kbot,l1)
+                     fbt = arg_1(i1,jtop,kbot,l1)	!
+                     ftb = arg_1(i1,jbot,ktop,l1)	!
+                     ftt = arg_1(i1,jtop,ktop,l1)
+
+                     IF (fbb .NE. bad_flag(ARG1)  .AND.
+     .                   ftb .NE. bad_flag(ARG1)  .AND.
+     .                   fbt .NE. bad_flag(ARG1)  .AND.
+     .                   ftt .NE. bad_flag(ARG1) ) THEN
+
+cbf                 for matching x-axis no interpolation is need
+                          if (jmatch.eq.0) then
+                             fbot = fbb
+                             ftop = fbt
+                          else
+                             frac = (ypt - ybot )/ (ytop - ybot)
+                             fbot = fbb + frac* (ftb - fbb)
+                             ftop = fbt + frac* (ftt - fbt)
+                          endif
+
+*  Now interpolate in z, getting value at (y,z)
+
+                       IF (kbot .GE. arg_lo_ss(Z_AXIS,ARG1)  .AND.
+     .                     ktop .LE. arg_hi_ss(Z_AXIS,ARG1) ) THEN
+                          zbot = zax(kbot,1,1,1)
+                          ztop = zax(ktop,1,1,1)
+
+                          if(kmatch.eq.0) then
+                             result(i,j,k,l) = fbot
+                          else
+                            frac = (zpt - zbot)/ (ztop-zbot)
+
+                            result(i,j,k,l) = fbot + frac* 
+     .                                         (ftop - fbot)
+
+                          endif
+                       ELSE
+                           result(i,j,k,l) = bad_flag_result
+                       ENDIF
+
+                    ELSE
+                        result(i,j,k,l) = bad_flag_result
+                    ENDIF  ! bad_flag(ARG1) test
+                  ENDIF	   ! fbb,ftp, etc not bad flags
+
+	       ENDIF  ! jtop, ktop not ef_unspecified_int4
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+
+ 300        CONTINUE
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400     CONTINUE
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         k = k + res_incr(Z_AXIS)
+500   CONTINUE
+
+
+      RETURN
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/external_functions/sort/shellsort.F b/external_functions/sort/shellsort.F
new file mode 100644
index 0000000..7aaaf5b
--- /dev/null
+++ b/external_functions/sort/shellsort.F
@@ -0,0 +1,43 @@
+      SUBROUTINE SHELL(SDAT, IDAT,N)
+
+
+*from http://www.cs.mcgill.ca/~ratzer/progs15_6.html  23-APR-1998
+* Changed data to REAL. Added IDAT, to sort along with SDAT.  
+* Removed NCOUNTS, NCOMP, NSWAP.
+
+      REAL     SDAT(*)
+      INTEGER  IDAT(*), N, M
+      INTEGER  I, J
+      M=N
+      DO WHILE (M .gt. 1)
+         M=(M+2)/3
+         DO I=M+1,N
+            DO J=I,M+1,-M
+               IF(SDAT(J-M) .ge. SDAT(J)) then
+                 CALL SWAPR(SDAT,J,J-M)
+                 CALL SWAPI(IDAT,J,J-M)
+               endif
+            END DO 
+         END DO 
+      END DO
+      RETURN
+      END !SUBROUTINE SHELL
+!
+
+      SUBROUTINE SWAPI(IDAT,K,L)
+      INTEGER IDAT(*),K,L
+      INTEGER M
+      M=IDAT(K)
+      IDAT(K)=IDAT(L)
+      IDAT(L)=M
+      RETURN
+      END !SUROUTINE SWAPI
+
+      SUBROUTINE SWAPR(SDAT,K,L)
+      REAL SDAT(*), S
+      INTEGER K,L
+      S=SDAT(K)
+      SDAT(K)=SDAT(L)
+      SDAT(L)=S
+      RETURN
+      END !SUROUTINE SWAP
diff --git a/external_functions/sort/sorti_str.F b/external_functions/sort/sorti_str.F
new file mode 100644
index 0000000..b3d2597
--- /dev/null
+++ b/external_functions/sort/sorti_str.F
@@ -0,0 +1,403 @@
+*
+* sorti_str.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Nov 2008
+* V6.2 *acm* SORTI for strings
+*
+* This function sorts data on x axis in increasing order.
+* Returns index of sorted values.  
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*  	LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sorti_str_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted ',
+     .        'on the I axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, IMPLIED_BY_ARGS,
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+c      CALL ef_set_num_work_arrays(id, 2)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in I')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sorti_str_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sorti_str_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mxdat
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mxdat = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+
+
+c* sort_dat
+c      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, mxdat, 20, 1, 1)  !!!????
+
+* sort_indx
+      CALL ef_set_work_array_dims (id, 2, 1, 1, 1, 1, mxdat, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+c      SUBROUTINE sorti_str_compute(id, arg_1, result, sort_dat, sort_indx)
+      SUBROUTINE sorti_str_compute(id, arg_1, result, sort_indx)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER nbad, m_indx
+      INTEGER m, nsrt
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+
+*  Dimension work arrays
+
+c      CHARACTER*20 sort_dat(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+c     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+      REAL sort_indx(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+      character*20 my_sort_dat(50)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 600 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 500 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               nsrt = 0
+               nbad = 0
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT(id, ARG1, arg_1,
+     .                       i2,j2,k2,l2, slen, my_sort_dat(nsrt) )
+                  sort_indx(nsrt,1,1,1) = i1
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+      
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (my_sort_dat, 
+     .                                   sort_indx, nsrt)
+
+               DO 200 m = 1, nsrt
+                  result(m,j,k,l) = sort_indx(m,1,1,1)
+ 200           CONTINUE
+
+               DO 300 m = 1, nbad
+                  m_indx = m + nsrt
+                  result(m_indx,j,k,l) = bad_flag_result
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 500     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 600  CONTINUE
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+      SUBROUTINE HEAP2_STR (RA, IB, N)
+
+C  Ansley Manke
+C  From Numerical Recipes, Heapsort subroutine SORT2
+C  with change noted below for the case where N=1
+
+      INTEGER N
+      CHARACTER RA(*), RRA
+
+      INTEGER L, IR, J, I, NGD
+      REAL IB(*), IIB
+
+* From SHELLR
+* since the input array may be large but sparse, begin by sorting
+* the missing value flags to the end of the list
+
+      ngd = 0
+      DO j = 1, n
+c         IF (RA(j) .NE. bad) THEN
+            ngd = ngd + 1
+            RA(ngd) = RA(j)
+            IB(ngd) = IB(j)
+c          ENDIF 
+      END DO
+
+c      DO j = ngd+1, nc
+c         RA(j) = bad
+c         IB(j) = 0.0  ! just for house-keeping
+c      END DO
+
+      L = NGD/2 + 1
+      IR = NGD
+
+      IF (NGD .LT. 1) RETURN
+
+   10 CONTINUE
+         IF (L .GT. 1) THEN
+            L = L - 1
+            RRA = RA(L)
+            IIB = IB(L)
+         ELSE
+            RRA = RA(IR)
+            IIB = IB(IR) 
+            RA(IR) = RA(1)
+            IB(IR) = IB(1)
+            IR = IR - 1
+            IF (IR .LE. 1) THEN	! *acm* Num Recipes has .EQ. here,
+				!       but this fails in the case where	
+				!       the loop starts with L=1
+               RA(1) = RRA
+               IB(1) = IIB
+               RETURN
+            ENDIF
+          ENDIF
+
+          I = L
+          J = L + L
+   20     IF (J .LE. IR) THEN
+             IF (J .LT. IR) THEN
+                IF (RA(J) .LT. RA(J+1)) J = J + 1
+             ENDIF
+             IF (RRA .LT. RA(J)) THEN
+                RA(I) = RA(J)
+                IB(I) = IB(J)
+                I = J
+                J = J + J
+             ELSE
+                J = IR + 1
+             ENDIF
+             GO TO 20
+          ENDIF
+
+          RA(I) = RRA
+          IB(I) = IIB
+      GO TO 10
+
+      END
diff --git a/external_functions/sort/string_to_id.F b/external_functions/sort/string_to_id.F
new file mode 100644
index 0000000..310ad4f
--- /dev/null
+++ b/external_functions/sort/string_to_id.F
@@ -0,0 +1,188 @@
+*
+* string_to_id.F
+*
+* Ansley Manke
+* March 2013
+*
+*  Convert a sorted list of strings to a list of numeric ID's:
+*    the first string encountered is ID=1,
+*    the next unique string encountered is ID=2, etc.
+*
+* This function takes two string arguments and one numeric argument.
+* It returns a string result.  The result is the first N letters of the 
+* first argument prepended to the string in the second argument, where N
+* is the number of characters to take from the strings of arg1.
+* 
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE string_to_id_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Return numeric IDs for each new string in sorted list of strings')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STRINGS')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'string argument')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE string_to_id_compute(id, arg_1,  result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+*  ! string arg and result need to be twice the length.
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l, i1,i2,i3,i4
+      INTEGER iarg, slen1, alen, nchar
+      REAL value
+      CHARACTER text1*1000, this_string*1000
+      LOGICAL isnew
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      aindex = 0
+      alen = 1
+      this_string = " "
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  iarg = 1
+ 	          CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1, slen1, text1)
+                  CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, iarg, arg_1, 
+     .                                           i1,j1,k1,l1, slen1)
+
+                  isnew = .FALSE.
+                  IF (slen1 .EQ. alen) THEN
+	             IF (text1(:slen1) .NE. this_string(:alen)) isnew = .TRUE.
+                  ELSE
+	             isnew = .TRUE.
+                  ENDIF
+
+                  IF (isnew) THEN
+	             aindex = aindex + 1
+	             this_string = text1
+	             alen = slen1
+                  ENDIF
+	    
+                  result(i,j,k,l) = aindex
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+ 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/statistics/Makefile b/external_functions/statistics/Makefile
new file mode 100644
index 0000000..fd41ad7
--- /dev/null
+++ b/external_functions/statistics/Makefile
@@ -0,0 +1,55 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+#all:	student_t_cutoff.so minmax.so
+all:	student_t_cutoff.so
+  
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/statistics/get_student_t_carson.F b/external_functions/statistics/get_student_t_carson.F
new file mode 100644
index 0000000..afaa295
--- /dev/null
+++ b/external_functions/statistics/get_student_t_carson.F
@@ -0,0 +1,73 @@
+
+       REAL FUNCTION GetStudentT(P,Nf)
+       IMPLICIT NONE
+   INTEGER Nf,P,df    
+   REAL ST_90(100)
+   REAL ST_95(100)
+   REAL ST_99(100)
+   REAL T
+   DATA ST_90/6.314,2.920,2.353,2.132,2.015,1.943,1.895,1.860,
+    .           1.833,1.812,1.796,1.782,1.771,1.761,1.753,1.746,
+    .           1.740,1.734,1.729,1.725,1.721,1.717,1.714,1.711,
+    .           1.708,1.706,1.703,1.701,1.699,1.697,1.696,1.694,
+    .           1.692,1.691,1.690,1.688,1.687,1.686,1.685,1.684,
+    .           1.683,1.682,1.681,1.680,1.679,1.679,1.678,1.677,
+    .           1.677,1.676,1.675,1.675,1.674,1.674,1.673,1.673,
+    .           1.672,1.672,1.671,1.671,1.670,1.670,1.669,1.669,
+    .           1.669,1.668,1.668,1.668,1.667,1.667,1.667,1.666,
+    .           1.666,1.666,1.665,1.665,1.665,1.665,1.664,1.664,
+    .           1.664,1.664,1.663,1.663,1.663,1.663,1.663,1.662,
+    .           1.662,1.662,1.662,1.662,1.661,1.661,1.661,1.661,
+    .           1.661,1.661,1.660,1.660/
+   DATA ST_95/12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,
+    .           2.228,2.201,2.179,2.160,2.145,2.131,2.120,2.110,2.101,
+    .           2.093,2.086,2.080,2.074,2.069,2.064,2.060,2.056,2.052,
+    .           2.048,2.045,2.042,2.040,2.037,2.035,2.032,2.030,2.028,
+    .           2.026,2.024,2.023,2.021,2.020,2.018,2.017,2.015,2.014,
+    .           2.013,2.012,2.011,2.010,2.009,2.008,2.007,2.006,2.005,
+    .           2.004,2.003,2.002,2.002,2.001,2.000,2.000,1.999,1.998,
+    .           1.998,1.997,1.997,1.996,1.995,1.995,1.994,1.994,1.993,
+    .           1.993,1.993,1.992,1.992,1.991,1.991,1.990,1.990,1.990,
+    .           1.989,1.989,1.989,1.988,1.988,1.988,1.987,1.987,1.987,
+    .           1.986,1.986,1.986,1.986,1.985,1.985,1.985,1.984,1.984,1.984/
+   DATA ST_99/63.657,9.925,5.841,4.604,4.032,3.707,3.499,3.355,3.250,
+    .           3.169,3.106,3.055,3.012,2.977,2.947,2.921,2.898,2.878,
+    .           2.861,2.845,2.831,2.819,2.807,2.797,2.787,2.779,2.771,
+    .           2.763,2.756,2.750,2.744,2.738,2.733,2.728,2.724,2.719,
+    .           2.715,2.712,2.708,2.704,2.701,2.698,2.695,2.692,2.690,
+    .           2.687,2.685,2.682,2.680,2.678,2.676,2.674,2.672,2.670,
+    .           2.668,2.667,2.665,2.663,2.662,2.660,2.659,2.657,2.656,
+    .           2.655,2.654,2.652,2.651,2.650,2.649,2.648,2.647,2.646,
+    .           2.645,2.644,2.643,2.642,2.641,2.640,2.640,2.639,2.638,
+    .           2.637,2.636,2.636,2.635,2.634,2.634,2.633,2.632,2.632,
+    .           2.631,2.630,2.630,2.629,2.629,2.628,2.627,2.627,2.626,2.626/
+
+   IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+          P=90
+      WRITE(6,*)'WARNING::P must be 90,95 or 99'
+          WRITE(6,*)'         in SUBROUTINE PhaseConfidenceLimits'
+          WRITE(6,*)'  '
+          WRITE(6,*)'P set to 90%'
+   ENDIF
+
+       df=Nf-1
+
+   IF(df.GT.100)THEN
+          IF(P.EQ.90)THEN
+       T=1.645
+         ELSEIF(P.EQ.95)THEN
+       T=1.96
+     ELSE  !  P.EQ.99
+       T=2.576
+     ENDIF
+   ELSE ! df <= 100
+     IF(P.EQ.90)THEN
+       T=ST_90(df)
+         ELSEIF(P.EQ.95)THEN
+       T=ST_95(df)
+     ELSE  !  P.EQ.99
+       T=ST_99(df)
+     ENDIF
+   ENDIF
+   GetStudentT=T
+   END
diff --git a/external_functions/statistics/locij.F b/external_functions/statistics/locij.F
new file mode 100644
index 0000000..81c5ed2
--- /dev/null
+++ b/external_functions/statistics/locij.F
@@ -0,0 +1,199 @@
+*
+* locij.F
+*
+* Ansley Manke
+* April 4, 2005
+*
+* This function returns the I,J location as FRACTIONAL I,J 
+* interpolated in x and Y where the value of the field is reached.
+
+
+      SUBROUTINE locij_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Return fractional i,j locations of value' )
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .    ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+
+      CALL ef_set_arg_desc(id, arg, 'Data field, up to 4-D')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'Value')
+
+      CALL ef_set_arg_desc(id, arg, 'Data value to find')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE locij_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .          mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .          mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .           memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .    arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER i,j,k,l
+      INTEGER i2, j2, k2, l2, p, nf
+      REAL value, GetStudentT
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C test value of P 
+
+      arg = 1
+      CALL ef_get_one_val(id, arg, value)
+      p = value
+
+      IF (P.NE.90 .AND. P.NE.95 .AND. P.NE.99)
+     .         CALL EF_BAIL_OUT(id,'P must be 90, 95 or 99')
+
+C Loop over field of N, return value of missing if n is not at least 1
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF ( arg_2(i2,j2,k2,l2) .EQ. bad_flag(2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+                     nf = arg_2(i2,j2,k2,l2)
+                     IF ( nf .LE. 1) THEN
+                        result(i,j,k,l) = bad_flag_result
+                     ELSE
+                        result(i,j,k,l) = GetStudentT(p, nf)
+                     ENDIF
+
+                  END IF
+
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      
+      RETURN 
+      END
+
+       REAL FUNCTION GetStudentT(P,Nf)
+       IMPLICIT NONE
+        INTEGER Nf,P,df    
+        REAL ST_90(100)
+        REAL ST_95(100)
+        REAL ST_99(100)
+        REAL T
+        DATA ST_90/6.314,2.920,2.353,2.132,2.015,1.943,1.895,1.860,
+     .          1.833,1.812,1.796,1.782,1.771,1.761,1.753,1.746,
+     .          1.740,1.734,1.729,1.725,1.721,1.717,1.714,1.711,
+     .          1.708,1.706,1.703,1.701,1.699,1.697,1.696,1.694,
+     .          1.692,1.691,1.690,1.688,1.687,1.686,1.685,1.684,
+     .          1.683,1.682,1.681,1.680,1.679,1.679,1.678,1.677,
+     .          1.677,1.676,1.675,1.675,1.674,1.674,1.673,1.673,
+     .          1.672,1.672,1.671,1.671,1.670,1.670,1.669,1.669,
+     .          1.669,1.668,1.668,1.668,1.667,1.667,1.667,1.666,
+     .          1.666,1.666,1.665,1.665,1.665,1.665,1.664,1.664,
+     .          1.664,1.664,1.663,1.663,1.663,1.663,1.663,1.662,
+     .          1.662,1.662,1.662,1.662,1.661,1.661,1.661,1.661,
+     .          1.661,1.661,1.660,1.660/
+      DATA ST_95/12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,
+     .          2.228,2.201,2.179,2.160,2.145,2.131,2.120,2.110,2.101,
+     .          2.093,2.086,2.080,2.074,2.069,2.064,2.060,2.056,2.052,
+     .          2.048,2.045,2.042,2.040,2.037,2.035,2.032,2.030,2.028,
+     .          2.026,2.024,2.023,2.021,2.020,2.018,2.017,2.015,2.014,
+     .          2.013,2.012,2.011,2.010,2.009,2.008,2.007,2.006,2.005,
+     .          2.004,2.003,2.002,2.002,2.001,2.000,2.000,1.999,1.998,
+     .          1.998,1.997,1.997,1.996,1.995,1.995,1.994,1.994,1.993,
+     .          1.993,1.993,1.992,1.992,1.991,1.991,1.990,1.990,1.990,
+     .          1.989,1.989,1.989,1.988,1.988,1.988,1.987,1.987,1.987,
+     .          1.986,1.986,1.986,1.986,1.985,1.985,1.985,1.984,1.984,
+     .          1.984/
+      DATA ST_99/63.657,9.925,5.841,4.604,4.032,3.707,3.499,3.355,3.250,
+     .          3.169,3.106,3.055,3.012,2.977,2.947,2.921,2.898,2.878,
+     .          2.861,2.845,2.831,2.819,2.807,2.797,2.787,2.779,2.771,
+     .          2.763,2.756,2.750,2.744,2.738,2.733,2.728,2.724,2.719,
+     .          2.715,2.712,2.708,2.704,2.701,2.698,2.695,2.692,2.690,
+     .          2.687,2.685,2.682,2.680,2.678,2.676,2.674,2.672,2.670,
+     .          2.668,2.667,2.665,2.663,2.662,2.660,2.659,2.657,2.656,
+     .          2.655,2.654,2.652,2.651,2.650,2.649,2.648,2.647,2.646,
+     .          2.645,2.644,2.643,2.642,2.641,2.640,2.640,2.639,2.638,
+     .          2.637,2.636,2.636,2.635,2.634,2.634,2.633,2.632,2.632,
+     .          2.631,2.630,2.630,2.629,2.629,2.628,2.627,2.627,2.626,
+     .          2.626/
+
+        IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+               P=90
+        ENDIF
+
+        df=Nf-1
+        IF (df .LE. 0) then
+           t =1.
+        endif
+
+        IF(df.GT.100)THEN
+               IF(P.EQ.90)THEN
+            T=1.645
+              ELSEIF(P.EQ.95)THEN
+            T=1.96
+          ELSE  !  P.EQ.99
+            T=2.576
+          ENDIF
+        ELSE ! df <= 100
+          IF(P.EQ.90)THEN
+            T=ST_90(df)
+              ELSEIF(P.EQ.95)THEN
+            T=ST_95(df)
+          ELSE  !  P.EQ.99
+            T=ST_99(df)
+          ENDIF
+        ENDIF
+        GetStudentT=T
+        END
diff --git a/external_functions/statistics/minmax.F b/external_functions/statistics/minmax.F
new file mode 100644
index 0000000..1ea4301
--- /dev/null
+++ b/external_functions/statistics/minmax.F
@@ -0,0 +1,180 @@
+*
+* minmax.F
+*
+* Ansley Manke
+* May 2009
+*
+* This function returns the min and max of a variable
+* Faster than individually computing the min and max
+* or running the STAT command.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE minmax_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns min and max of a var. result[i=1]=min,result[i=1]=max' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     NORMAL, NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Variable')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE minmax_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, 2)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE minmax_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      REAL amin, amax
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      amin =    ABS(bad_flag(1))
+      amax = -1*ABS(bad_flag(1))
+
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1) .NE. bad_flag(1) ) THEN
+            amin = MIN(amin, arg_1(i1,j1,k1,l1) )
+            amax = MAX(amax, arg_1(i1,j1,k1,l1) )
+         END IF
+
+ 100  CONTINUE
+ 200  CONTINUE
+ 300  CONTINUE
+ 400  CONTINUE
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      result(i,j,k,l) = amin
+      result(i+1,j,k,l) = amax
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/statistics/student_t.F b/external_functions/statistics/student_t.F
new file mode 100644
index 0000000..fdd52e8
--- /dev/null
+++ b/external_functions/statistics/student_t.F
@@ -0,0 +1,77 @@
+	!******************************************
+	! 
+	! Get the upper cutoff point of the Student T distribution 
+	! (P.341 Koopmans .The Spectral Analysis of Time Series)
+	!
+	!******************************************
+	   
+	REAL FUNCTION GetStudentT(P,Nf)
+        IMPLICIT NONE
+	INTEGER Nf,P,df  
+	REAL ST_90(15)
+	REAL ST_95(15)
+	REAL ST_99(15)
+	REAL T
+	DATA ST_90/2.92,2.132,1.943,1.86,1.812,1.782,1.761,1.746,
+     .           1.734,1.725,1.717,1.711,1.706,1.701,1.697/
+	DATA ST_95/4.303,2.776,2.447,2.306,2.228,2.179,2.145,2.12,
+     .           2.101,2.086,2.074,2.064,2.056,2.048,2.042/
+  	DATA ST_99/9.925,4.604,3.707,3.355,3.169,3.055,2.977,2.921,
+     .           2.878,2.845,2.819,2.797,2.779,2.763,2.75/
+
+	IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+           P=90 
+	   WRITE(6,*)'WARNING::P must be 90,95 or 99' 
+           WRITE(6,*)'         in SUBROUTINE PhaseConfidenceLimits'
+           WRITE(6,*)'  '
+           WRITE(6,*)'P set to 90%'
+	ENDIF
+ 
+        df=Nf*2
+
+	IF(df.GT.120)THEN
+     	  IF(P.EQ.90)THEN
+		T=1.645
+          ELSEIF(P.EQ.95)THEN
+		T=1.96
+	  ELSE  !  P.EQ.99
+		T=2.576
+	  ENDIF
+	ELSEIF(df.GT.80)THEN
+	  IF(P.EQ.90)THEN
+		T=1.658
+          ELSEIF(P.EQ.95)THEN
+		T=1.98
+	  ELSE  !  P.EQ.99
+		T=2.617
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+		T=1.671
+          ELSEIF(P.EQ.95)THEN
+		T=2.
+	  ELSE  !  P.EQ.99
+		T=2.66
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+		T=1.684
+          ELSEIF(P.EQ.95)THEN
+		T=2.021
+	  ELSE  !  P.EQ.99
+		T=2.704
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	    T=ST_90(Nf)
+          ELSEIF(P.EQ.95)THEN
+	    T=ST_95(Nf)
+	  ELSE  !  P.EQ.99
+	    T=ST_99(Nf)
+	  ENDIF
+	ENDIF
+	GetStudentT=T
+	END
+
+
+
diff --git a/external_functions/statistics/student_t_cutoff.F b/external_functions/statistics/student_t_cutoff.F
new file mode 100644
index 0000000..bd5a4cb
--- /dev/null
+++ b/external_functions/statistics/student_t_cutoff.F
@@ -0,0 +1,203 @@
+*
+* student_t_cutoff.F
+*
+* Ansley Manke
+* April 4, 2005
+*
+
+* This function returns the upper cutoff point of the Student T distribution 
+*  (P.341 Koopmans .The Spectral Analysis of Time Series)
+*  From Rick Romea's student_t.F
+
+
+      SUBROUTINE student_t_cutoff_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Return student-t cutoff' )
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .    IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'P')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Confidence Limit')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'nf')
+      CALL ef_set_arg_unit(id, arg, 'Number in sample')
+
+      CALL ef_set_arg_desc(id, arg, 'nf')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE student_t_cutoff_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .          mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .          mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .           memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .    arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER arg
+      INTEGER i,j,k,l
+      INTEGER i2, j2, k2, l2, p, nf
+      REAL value, GetStudentT
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C test value of P 
+
+      arg = 1
+      CALL ef_get_one_val(id, arg, value)
+      p = value
+
+      IF (P.NE.90 .AND. P.NE.95 .AND. P.NE.99)
+     .         CALL EF_BAIL_OUT(id,'P must be 90, 95 or 99')
+
+C Loop over field of N, return value of missing if n is not at least 1
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF ( arg_2(i2,j2,k2,l2) .EQ. bad_flag(2)) THEN
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+                     nf = arg_2(i2,j2,k2,l2)
+                     IF ( nf .LE. 1) THEN
+                        result(i,j,k,l) = bad_flag_result
+                     ELSE
+                        result(i,j,k,l) = GetStudentT(p, nf)
+                     ENDIF
+
+                  END IF
+
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      
+      RETURN 
+      END
+
+       REAL FUNCTION GetStudentT(P,Nf)
+       IMPLICIT NONE
+        INTEGER Nf,P,df    
+        REAL ST_90(100)
+        REAL ST_95(100)
+        REAL ST_99(100)
+        REAL T
+        DATA ST_90/6.314,2.920,2.353,2.132,2.015,1.943,1.895,1.860,
+     .          1.833,1.812,1.796,1.782,1.771,1.761,1.753,1.746,
+     .          1.740,1.734,1.729,1.725,1.721,1.717,1.714,1.711,
+     .          1.708,1.706,1.703,1.701,1.699,1.697,1.696,1.694,
+     .          1.692,1.691,1.690,1.688,1.687,1.686,1.685,1.684,
+     .          1.683,1.682,1.681,1.680,1.679,1.679,1.678,1.677,
+     .          1.677,1.676,1.675,1.675,1.674,1.674,1.673,1.673,
+     .          1.672,1.672,1.671,1.671,1.670,1.670,1.669,1.669,
+     .          1.669,1.668,1.668,1.668,1.667,1.667,1.667,1.666,
+     .          1.666,1.666,1.665,1.665,1.665,1.665,1.664,1.664,
+     .          1.664,1.664,1.663,1.663,1.663,1.663,1.663,1.662,
+     .          1.662,1.662,1.662,1.662,1.661,1.661,1.661,1.661,
+     .          1.661,1.661,1.660,1.660/
+      DATA ST_95/12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,
+     .          2.228,2.201,2.179,2.160,2.145,2.131,2.120,2.110,2.101,
+     .          2.093,2.086,2.080,2.074,2.069,2.064,2.060,2.056,2.052,
+     .          2.048,2.045,2.042,2.040,2.037,2.035,2.032,2.030,2.028,
+     .          2.026,2.024,2.023,2.021,2.020,2.018,2.017,2.015,2.014,
+     .          2.013,2.012,2.011,2.010,2.009,2.008,2.007,2.006,2.005,
+     .          2.004,2.003,2.002,2.002,2.001,2.000,2.000,1.999,1.998,
+     .          1.998,1.997,1.997,1.996,1.995,1.995,1.994,1.994,1.993,
+     .          1.993,1.993,1.992,1.992,1.991,1.991,1.990,1.990,1.990,
+     .          1.989,1.989,1.989,1.988,1.988,1.988,1.987,1.987,1.987,
+     .          1.986,1.986,1.986,1.986,1.985,1.985,1.985,1.984,1.984,
+     .          1.984/
+      DATA ST_99/63.657,9.925,5.841,4.604,4.032,3.707,3.499,3.355,3.250,
+     .          3.169,3.106,3.055,3.012,2.977,2.947,2.921,2.898,2.878,
+     .          2.861,2.845,2.831,2.819,2.807,2.797,2.787,2.779,2.771,
+     .          2.763,2.756,2.750,2.744,2.738,2.733,2.728,2.724,2.719,
+     .          2.715,2.712,2.708,2.704,2.701,2.698,2.695,2.692,2.690,
+     .          2.687,2.685,2.682,2.680,2.678,2.676,2.674,2.672,2.670,
+     .          2.668,2.667,2.665,2.663,2.662,2.660,2.659,2.657,2.656,
+     .          2.655,2.654,2.652,2.651,2.650,2.649,2.648,2.647,2.646,
+     .          2.645,2.644,2.643,2.642,2.641,2.640,2.640,2.639,2.638,
+     .          2.637,2.636,2.636,2.635,2.634,2.634,2.633,2.632,2.632,
+     .          2.631,2.630,2.630,2.629,2.629,2.628,2.627,2.627,2.626,
+     .          2.626/
+
+        IF(P.NE.90.AND.P.NE.95.AND.P.NE.99)THEN
+               P=90
+        ENDIF
+
+        df=Nf-1
+        IF (df .LE. 0) then
+           t =1.
+        endif
+
+        IF(df.GT.100)THEN
+               IF(P.EQ.90)THEN
+            T=1.645
+              ELSEIF(P.EQ.95)THEN
+            T=1.96
+          ELSE  !  P.EQ.99
+            T=2.576
+          ENDIF
+        ELSE ! df <= 100
+          IF(P.EQ.90)THEN
+            T=ST_90(df)
+              ELSEIF(P.EQ.95)THEN
+            T=ST_95(df)
+          ELSE  !  P.EQ.99
+            T=ST_99(df)
+          ENDIF
+        ENDIF
+        GetStudentT=T
+        END
diff --git a/external_functions/statistics/student_t_cutoff_df.F b/external_functions/statistics/student_t_cutoff_df.F
new file mode 100644
index 0000000..dd2ba72
--- /dev/null
+++ b/external_functions/statistics/student_t_cutoff_df.F
@@ -0,0 +1,197 @@
+*
+* student_t_cutoff.F
+*
+* Ansley Manke
+* April 4, 2005
+*
+
+* This function returns the upper cutoff point of the Student T distribution 
+*  (P.341 Koopmans .The Spectral Analysis of Time Series)
+*  From Rick Romea's student_t.F
+
+
+      SUBROUTINE student_t_cutoff_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Return student-t cutoff' )
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'P')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Confidence Limit')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DF')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'Degrees of freedom')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE student_t_cutoff_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1, p, df
+      REAL GetStudentT
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  IF ( arg_1(i,j,k,l) .EQ. bad_flag(1) .OR.
+     .                 arg_2(i,j,k,l) .EQ. bad_flag(2)) THEN
+
+                     result(i,j,k,l) = bad_flag_result
+
+                  ELSE
+
+                     p = arg_1(i,j,k,l)
+                     df = arg_2(i,j,k,l)
+
+                     IF (P.NE.90 .AND. P.NE.95 .AND. P.NE.99)
+     .                   CALL EF_BAIL_OUT(id,'P must be 90,95 or 99')
+                     IF (df .LE. 0)
+     .                   CALL EF_BAIL_OUT(id,'DF must be positive')
+
+                     result(i,j,k,l) = GetStudentT(p, df)
+
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+      
+      RETURN 
+      END
+
+	!******************************************
+	! 
+	! Get the upper cutoff point of the Student T distribution 
+	! (P.341 Koopmans .The Spectral Analysis of Time Series)
+	!
+	!******************************************
+	   
+c	REAL FUNCTION GetStudentT(P,Nf)
+	REAL FUNCTION GetStudentT(P,df)
+        IMPLICIT NONE
+
+        INTEGER Nf,P,df  
+ 
+	REAL ST_90(15)
+	REAL ST_95(15)
+	REAL ST_99(15)
+	REAL T
+	DATA ST_90/2.92,2.132,1.943,1.86,1.812,1.782,1.761,1.746,
+     .           1.734,1.725,1.717,1.711,1.706,1.701,1.697/
+	DATA ST_95/4.303,2.776,2.447,2.306,2.228,2.179,2.145,2.12,
+     .           2.101,2.086,2.074,2.064,2.056,2.048,2.042/
+  	DATA ST_99/9.925,4.604,3.707,3.355,3.169,3.055,2.977,2.921,
+     .           2.878,2.845,2.819,2.797,2.779,2.763,2.75/
+
+
+c        df=Nf*2
+        nf = df/2
+        IF (df .EQ. 1) nf = 1
+
+	IF(df.GT.120)THEN
+     	  IF(P.EQ.90)THEN
+		T=1.645
+          ELSEIF(P.EQ.95)THEN
+		T=1.96
+	  ELSE  !  P.EQ.99
+		T=2.576
+	  ENDIF
+	ELSEIF(df.GT.80)THEN
+	  IF(P.EQ.90)THEN
+		T=1.658
+          ELSEIF(P.EQ.95)THEN
+		T=1.98
+	  ELSE  !  P.EQ.99
+		T=2.617
+	  ENDIF
+	ELSEIF(df.GT.50)THEN
+	  IF(P.EQ.90)THEN
+		T=1.671
+          ELSEIF(P.EQ.95)THEN
+		T=2.
+	  ELSE  !  P.EQ.99
+		T=2.66
+	  ENDIF
+	ELSEIF(df.GT.30)THEN
+	  IF(P.EQ.90)THEN
+		T=1.684
+          ELSEIF(P.EQ.95)THEN
+		T=2.021
+	  ELSE  !  P.EQ.99
+		T=2.704
+	  ENDIF
+	ELSE ! df <= 30
+	  IF(P.EQ.90)THEN
+	    T=ST_90(Nf)
+          ELSEIF(P.EQ.95)THEN
+	    T=ST_95(Nf)
+	  ELSE  !  P.EQ.99
+	    T=ST_99(Nf)
+	  ENDIF
+	ENDIF
+	GetStudentT=T
+	END
+
diff --git a/external_functions/stringfcns/Makefile b/external_functions/stringfcns/Makefile
new file mode 100644
index 0000000..411b03e
--- /dev/null
+++ b/external_functions/stringfcns/Makefile
@@ -0,0 +1,57 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+#  ACM 2/2002  change targets to all and extras; somehow standard
+#               not working well w/ linux.
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	str_missing.so efstrings.so maxstrlen.so pass_thru_string.so \
+	pick_a_string.so string_cat3.so string_len_sum.so strings_as_args.so \
+	length_of_strings.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/stringfcns/efstrings.F b/external_functions/stringfcns/efstrings.F
new file mode 100644
index 0000000..cc2e176
--- /dev/null
+++ b/external_functions/stringfcns/efstrings.F
@@ -0,0 +1,215 @@
+*
+* efstrings.F
+*
+* Ansley Manke
+* May 2002
+*
+* Returns A testing additional string capabilities
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, efstrings )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE efstrings_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Demo Function: tests string utilities' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE efstrings_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER iarg, ns
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      iarg = 1
+      ns = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      CALL ef_set_work_array_dims(id, iarg, 1,1,1,1, 1,1,1,2*ns)
+
+      iarg = 2
+      CALL ef_set_work_array_dims(id, iarg, 1,1,1,1, 1,1,1,20*ns)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE efstrings_compute(id, arg_1, result, tax)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+      REAL*8 tax(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER rtype, iarg, slen
+      CHARACTER*20 textstring, datestring
+      CHARACTER*3 short
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_result_type(id, rtype)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates (id, ARG1, T_AXIS, 
+     .       arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), tax)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+C get the string and its length
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1, slen, textstring)
+
+C get just the length
+                  CALL EF_GET_STRING_ARG_ELEMENT_LEN(id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1,  slen)
+
+C What if the string buffer were declared too short?
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1, slen, short)
+
+C just copy the pointer to the result
+                  IF (l .EQ. res_lo_ss(T_AXIS)) THEN
+                     CALL EF_PUT_STRING_PTR
+     .                 (arg_1(1,i1,j1,k1,l1),result(1,i,j,k,l))
+
+C Copy a new string to the result
+                  ELSE IF (l .EQ. res_lo_ss(T_AXIS)+1) THEN
+                     textstring = 'new'
+                     slen = 3
+                     CALL EF_PUT_STRING (textstring, slen, result(1,i,j,k,l))
+                  ELSE
+
+C Compute other string values and put them in the result.
+                     CALL EF_GET_AXIS_DATES 
+     .                  (id, ARG1, tax(1,1,1,L1), 1, datestring)
+                     slen = 20
+                     CALL EF_PUT_STRING (datestring, slen, result(1,i,j,k,l))
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+     
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/length_of_strings.F b/external_functions/stringfcns/length_of_strings.F
new file mode 100644
index 0000000..7433b88
--- /dev/null
+++ b/external_functions/stringfcns/length_of_strings.F
@@ -0,0 +1,145 @@
+*
+* length_of_strings.F
+*
+* Ansley Manke
+* May 2002
+*
+* Returns length of strings in input array.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE length_of_strings_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+
+      CALL ef_set_desc(id,
+     . 'Demo Function:Returns the lengths of strings in A' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, FLOAT_RETURN)
+
+      arg = 1
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE length_of_strings_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER atype, iarg, slen
+      CHARACTER*100 errmsg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_arg_type (id, 1, atype)
+      IF (atype .NE. STRING_ARG) THEN
+        errmsg = 'must call with string argument'
+        GO TO 5000
+      ENDIF
+
+      iarg = 1
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, ARG1, arg_1, 
+     .                 i1,j1,k1,l1,  slen)
+
+                  result(i,j,k,l) = slen
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+      RETURN 
+ 5000 CALL EF_BAIL_OUT(id,errmsg)
+
+      RETURN
+
+      END
diff --git a/external_functions/stringfcns/maxstrlen.F b/external_functions/stringfcns/maxstrlen.F
new file mode 100644
index 0000000..6daa303
--- /dev/null
+++ b/external_functions/stringfcns/maxstrlen.F
@@ -0,0 +1,105 @@
+*
+* maxstrlen.F
+*
+* Ansley Manke
+* May 2002
+*
+* Returns max length of strings in input array.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, maxstrlen )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE maxstrlen_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+
+      CALL ef_set_desc(id,
+     .  'Demo Function:Returns the max length of strings in A' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, NORMAL, NORMAL, NORMAL, NORMAL)
+      CALL ef_set_result_type(id, FLOAT_RETURN)
+
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, YES)
+
+      arg = 1
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'Array of strings')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE maxstrlen_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER atype, iarg, slen
+      CHARACTER*100 errmsg
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+
+      CALL ef_get_arg_type (id, 1, atype)
+      IF (atype .NE. STRING_ARG) THEN
+        errmsg = 'must call with string argument'
+        GO TO 5000
+      ENDIF
+
+      iarg = 1
+
+      CALL EF_GET_STRING_ARG_MAX_LEN (id, iarg, arg_1, slen)
+      result(res_lo_ss(X_AXIS), res_lo_ss(Y_AXIS), 
+     .       res_lo_ss(Z_AXIS), res_lo_ss(T_AXIS))  = slen
+
+      RETURN 
+ 5000 CALL EF_BAIL_OUT(id,errmsg)
+
+      RETURN
+      END
diff --git a/external_functions/stringfcns/pass_thru_string.F b/external_functions/stringfcns/pass_thru_string.F
new file mode 100644
index 0000000..0e85d34
--- /dev/null
+++ b/external_functions/stringfcns/pass_thru_string.F
@@ -0,0 +1,153 @@
+*
+* pass_thru_string.F
+*
+* Ansley Manke
+* 15-dec-2003
+*
+* This function sets the return to be equal
+* to argument, which is a string array.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE pass_thru_string_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Demo Function: sets result equal to input' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'this arg is passed through')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, 1, STRING_ARG)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pass_thru_string_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+! string arg and result need to be twice the length.
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  CALL EF_PUT_STRING_PTR(arg_1(1,i1,j1,k1,l1),
+     .                                   result(1,i,j,k,l) )
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/pick_a_string.F b/external_functions/stringfcns/pick_a_string.F
new file mode 100644
index 0000000..6fee156
--- /dev/null
+++ b/external_functions/stringfcns/pick_a_string.F
@@ -0,0 +1,210 @@
+*
+* pick_a_string.F
+*
+* Ansley Manke
+* 15-dec-2003
+*
+* This function chooses an element element of the first
+* argument, which is a 1-D string array, and we choose
+* the element given by the (scalar) second argument
+* 
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE pick_a_string_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Demo Function: sets result equal to one element of input' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, '1-D string argument')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'N')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id,arg,'Pick Nth element in the X direction')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, FLOAT_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE pick_a_string_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*     You could use utility functions at this point to get 
+*     context information about the other arguments.  This info 
+*     could be used to update the custom or abstract axis lo and hi
+*     indices.
+
+      call ef_set_axis_limits(id, X_AXIS, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE pick_a_string_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+*  ! string arg and result need to be twice the length.
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem1hix, mem2loy:mem1hiy, 
+     .           mem2loz:mem1hiz, mem2lot:mem1hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER indx, nx
+      REAL value
+      CHARACTER*40 err_msg
+      
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_one_val(id, 2, value)
+      indx = value
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      IF (indx .LT. 1 .OR. indx .GT. nx) THEN
+         WRITE (err_msg, *) 'Argument 2 too small or large. NX=', nx
+         CALL EF_BAIL_OUT (id, err_msg)
+      ENDIF
+
+      i1 = indx
+
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+c                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+c     .                               i1,j1,k1,l1, slen, textstring)
+c                  CALL EF_PUT_STRING (textstring, slen, result(1,i,j,k,l))
+
+                   CALL EF_PUT_STRING_PTR(arg_1(1,i1,j1,k1,l1),
+     .                            result(1,i,j,k,l) )
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+ 400   CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/str_missing.F b/external_functions/stringfcns/str_missing.F
new file mode 100644
index 0000000..fbbfe97
--- /dev/null
+++ b/external_functions/stringfcns/str_missing.F
@@ -0,0 +1,206 @@
+*
+* str_missing.F
+*
+* Ansley Manke
+* 8-Feb-2011
+*
+* This function replaces the strings in argument 2 with the string in argument 3
+* according to a mask, arg 1.
+* STR_MISSING(mask, default_string, replacement_string)
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE str_missing_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 fcn_desc
+
+ 10   FORMAT ('Replace the strings in arg2 with the string in arg3 ',
+     .       'according to a mask, arg1.')
+
+      WRITE (fcn_desc, 10) 
+      CALL ef_set_desc(id, fcn_desc)
+
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'mask: substitute arg3 in arg2 where mask=1')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, FLOAT_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'string array')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'REPL')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Scalar string to substitute')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE str_missing_compute(id, arg_1, arg_2, 
+     .                                   arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+*  ! string arg and result need to be twice the length.
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(2,mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER i3, j3, k3, l3
+      INTEGER iarg, slen2, slen3
+      CHARACTER text2*2048, text3*2048
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Get replacement string
+      i3=arg_lo_ss(X_AXIS, ARG3)
+      j3=arg_lo_ss(Y_AXIS, ARG3)
+      k3=arg_lo_ss(Z_AXIS, ARG3)
+      l3=arg_lo_ss(T_AXIS, ARG3)
+
+      CALL ef_get_string_arg_element(id, ARG3, arg_3,
+     .     i3,j3,k3,l3,slen3,text3)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  iarg = 2
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, iarg, arg_2, 
+     .                                      i2,j2,k2,l2, slen2, text2)
+                  IF (arg_1(i1,j1,k1,l1) .EQ. 1) THEN
+                     text2 = text3
+                     slen2 = slen3
+                  ENDIF
+                  CALL EF_PUT_STRING (text2, slen2, result(i,j,k,l))
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+ 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/string_cat3.F b/external_functions/stringfcns/string_cat3.F
new file mode 100644
index 0000000..81d6d9c
--- /dev/null
+++ b/external_functions/stringfcns/string_cat3.F
@@ -0,0 +1,193 @@
+*
+* string_cat3.F
+*
+* Ansley Manke
+* May 2006
+*
+* Returns concatenation of 3 strings
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, string_cat3 )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE string_cat3_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+
+      CALL ef_set_desc(id,
+     .  'Demo Function: Returns concatenation of 3 strings' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'string1')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_desc(id, arg, 'string2')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_arg_desc(id, arg, 'string3')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE string_cat3_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .     mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(2,mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1, i2, j2, k2, l2, i3, j3, k3, l3
+      INTEGER atype, iarg, slen, slen1, slen2, slen3
+      CHARACTER*100 errmsg, str1*255, str2*255, str3*255
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_arg_type (id, ARG1, atype)
+      IF (atype .NE. STRING_ARG) THEN
+        errmsg = 'must call with string arguments'
+        GO TO 5000
+      ENDIF
+
+      CALL ef_get_arg_type (id, ARG2, atype)
+      IF (atype .NE. STRING_ARG) THEN
+        errmsg = 'must call with string arguments'
+        GO TO 5000
+      ENDIF
+
+      CALL ef_get_arg_type (id, ARG3, atype)
+      IF (atype .NE. STRING_ARG) THEN
+        errmsg = 'must call with string arguments'
+        GO TO 5000
+      ENDIF
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            k3 = arg_lo_ss(Z_AXIS,ARG3)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               l3 = arg_lo_ss(T_AXIS,ARG3)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                     
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1, slen1, str1)
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG2, arg_2, 
+     .                                      i2,j2,k2,l2, slen2, str2)
+                  CALL EF_GET_STRING_ARG_ELEMENT (id, ARG3, arg_3, 
+     .                                      i3,j3,k3,l3, slen3, str3)
+                  
+                     slen = slen1 + slen2 + slen3
+                     CALL EF_PUT_STRING (
+     .                  str1(:slen1)//str2(:slen2)//str3(:slen3), 
+     .                  slen, result(1,i,j,k,l))
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+                  l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+               k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+      
+      RETURN 
+ 5000 CALL EF_BAIL_OUT(id,errmsg)
+
+      RETURN
+
+      END
diff --git a/external_functions/stringfcns/string_len_sum.F b/external_functions/stringfcns/string_len_sum.F
new file mode 100644
index 0000000..3ab5605
--- /dev/null
+++ b/external_functions/stringfcns/string_len_sum.F
@@ -0,0 +1,182 @@
+*
+* string_len_sum.F
+*
+* Ansley Manke
+* 17-dec-2003
+*
+* This function takes two string arguments and returns a real
+* result.  The result is the sum of the lengths of the strings.
+* 
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE string_len_sum_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Demo Function: Return sum of lengths of string 1 and string2')
+      CALL ef_set_result_type(id, FLOAT_RETURN)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'S1')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, '1-D string argument')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'S2')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, '1-D string argument')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE string_len_sum_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+*  ! string arg and result need to be twice the length.
+
+      REAL arg_1(2,mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2,mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER iarg, slen
+      integer slen1, slen2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  iarg = 1
+ 	          CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, ARG1, arg_1, 
+     .               i1,j1,k1,l1, slen1)
+                  iarg = 2
+ 	          CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, iarg, arg_2, 
+     .               i2,j2,k2,l2, slen2)
+
+                  result(i,j,k,l) = slen1 + slen2
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+ 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/strings_as_args.F b/external_functions/stringfcns/strings_as_args.F
new file mode 100644
index 0000000..2c29641
--- /dev/null
+++ b/external_functions/stringfcns/strings_as_args.F
@@ -0,0 +1,209 @@
+*
+* strings_as_args.F
+*
+* Ansley Manke
+* 17-dec-2003
+*
+* This function takes two string arguments and one numeric argument.
+* It returns a string result.  The result is the first N letters of the 
+* first argument prepended to the string in the second argument, where N
+* is the number of characters to take from the strings of arg1.
+* 
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE strings_as_args_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Demo Function: Prepend first NCHAR characters of string 1 onto string2')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     . IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'S1')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'string argument')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'S2')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'string argument')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'NCHAR')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, '# characters to take from S1')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, FLOAT_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE strings_as_args_compute(id, arg_1, arg_2, 
+     .                                   arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+
+*  ! string arg and result need to be twice the length.
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER iarg, slen, slen1, slen2, nchar
+      REAL value
+      CHARACTER text1*10, text2*10, textout*20
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_one_val (id, 3, value)
+      nchar = value
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               l2 = arg_lo_ss(T_AXIS,ARG2)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  iarg = 1
+ 	          CALL EF_GET_STRING_ARG_ELEMENT (id, ARG1, arg_1, 
+     .                                      i1,j1,k1,l1, slen1, text1)
+                  CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, iarg, arg_1, 
+     .                                           i1,j1,k1,l1, slen1)
+                  iarg = 2
+ 	          CALL EF_GET_STRING_ARG_ELEMENT (id, iarg, arg_2, 
+     .                                      i2,j2,k2,l2, slen2, text2)
+                  CALL EF_GET_STRING_ARG_ELEMENT_LEN (id, iarg, arg_2, 
+     .                                           i1,j1,k1,l1, slen2)
+
+                  iarg = 1
+                  IF (slen1 .GE. nchar) THEN
+                     textout = text1(1:nchar)//text2
+                     slen = nchar + slen2
+                  ELSE
+                     textout = text1(1:slen1)//text2
+                     slen = slen1 + slen2
+                  ENDIF
+
+                  CALL EF_PUT_STRING (textout, slen, result(i,j,k,l))
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+ 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/stringfcns/stringtests.jnl b/external_functions/stringfcns/stringtests.jnl
new file mode 100644
index 0000000..a71e76f
--- /dev/null
+++ b/external_functions/stringfcns/stringtests.jnl
@@ -0,0 +1,51 @@
+
+def axis/t=101:110:1/units=days/t0=1-jan-2000 tax
+let tt = t[gt=tax]
+let a = RESHAPE({"aaaa", "bb", "ccc", "ddddddddd", "e", "fff", "gggggg", "hh", "iiiii", "jjjjjjjjjjjjjj"}, tt)
+list efstrings(a)
+
+pause
+
+let a = {"one", "m", "mississippi", "iowa", "florida"}
+list maxstrlen(a)
+
+pause
+def axis/x=1:3:1 xax
+def axis/z=2:20:2 zax
+let var = x[gx=xax]  + z[gz=zax]
+let a = RESHAPE({"PMEL", "carries", "out", "interdisciplinary", "scientific", "investigations", "in", "oceanography", "and", "atmospheric", "science.", "Current", "PMEL", "programs", "focus", "on", "open", "ocean", "observations", "in", "support", "of", "long-term", "monitoring", "and", "prediction", "of", "the", "ocean", "environment"}, var)
+
+list pass_thru_string (a)
+pause
+
+list pick_a_string(a,2)
+pause
+
+list maxstrlen(a)
+pause
+
+! Fcns inherit grid of result from both args, so have Ferret conformability rules
+
+list length_of_strings(a)
+
+list string_len_sum(a,"..")
+pause
+
+! Two vars on the same grid
+let a = {"one", "two"}
+let b= {"_", "_bbb"}
+
+list string_len_sum(a, b)
+
+list string_cat3(a,b, ".dat")
+
+pause
+
+
+def axis/x=1:3:1 xax
+def axis/z=2:20:2 zax
+let var = x[gx=xax]  + z[gz=zax]
+let a = RESHAPE({"PMEL", "carries", "out", "interdisciplinary", "scientific", "investigations", "in", "oceanography", "and", "atmospheric", "science.", "Current", "PMEL", "programs", "focus", "on", "open", "ocean", "observations", "in", "support", "of", "long-term", "monitoring", "and", "prediction", "of", "the", "ocean", "environment"}, var)
+
+list string_cat3(a, " ", a)
+
diff --git a/external_functions/tax_times/Makefile b/external_functions/tax_times/Makefile
new file mode 100644
index 0000000..890e0c8
--- /dev/null
+++ b/external_functions/tax_times/Makefile
@@ -0,0 +1,51 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	tax_index_datestring.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/tax_times/tax.h b/external_functions/tax_times/tax.h
new file mode 100644
index 0000000..60d5341
--- /dev/null
+++ b/external_functions/tax_times/tax.h
@@ -0,0 +1,2 @@
+
+      parameter (DAYS_PER_YEAR=365.25)
diff --git a/external_functions/tax_times/tax_datestring.F b/external_functions/tax_times/tax_datestring.F
new file mode 100644
index 0000000..778bc14
--- /dev/null
+++ b/external_functions/tax_times/tax_datestring.F
@@ -0,0 +1,260 @@
+*
+* tax_datestring.F
+*
+* Jing Y. Li 
+* May 2006
+* 18-may-2006 ACM change to compare only the first 3 characters of the precision string.
+*
+* Returns string of dates 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, tax_datestring )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE tax_datestring_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns date string for time axis coordinate values' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*     Set data type as string
+      arg = 3
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'output precision')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_datestring_compute(id, arg_1, arg_2, arg_3, 
+     .           result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(2,mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i3, j3, k3, l3
+      INTEGER rtype, slen
+      CHARACTER*20 datestring
+      CHARACTER*3 precistring
+      REAL*8 ddate
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_result_type(id, rtype)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Get the precision for output
+      i3=arg_lo_ss(X_AXIS, ARG3)
+      j3=arg_lo_ss(Y_AXIS, ARG3)
+      k3=arg_lo_ss(Z_AXIS, ARG3)
+      l3=arg_lo_ss(T_AXIS, ARG3)
+
+*     Get the output presicion (string)
+      CALL ef_get_string_arg_element(id, ARG3, arg_3,
+     .     i3,j3,k3,l3,slen,precistring)
+
+      CALL LOWER(precistring)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                 ddate =  arg_1(i1,j1,k1,l1)
+
+C     Get the string value of dates and put them in the result.
+                 CALL EF_GET_AXIS_DATES 
+     .                (id, ARG2, ddate, 1, datestring)
+
+                 If(precistring .EQ. 'sec') THEN
+                     slen = 20
+                     CALL EF_PUT_STRING (datestring, slen,
+     .                    result(1,i,j,k,l))
+                 
+                 ELSE If(precistring .EQ. 'min') THEN
+                     slen = 17
+                     CALL EF_PUT_STRING (datestring(1:17), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE If(precistring .EQ. 'hou') THEN
+                     slen = 14
+                     CALL EF_PUT_STRING (datestring(1:14), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE If(precistring .EQ. 'day') THEN
+                     slen = 11
+                     CALL EF_PUT_STRING (datestring(1:11), slen, 
+     .                    result(1,i,j,k,l))
+
+                 ELSE IF(precistring .EQ. 'mon') THEN
+                     slen = 8
+                     CALL EF_PUT_STRING (datestring(4:11), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE IF(precistring .EQ. 'yea') THEN
+                     slen = 4
+                     CALL EF_PUT_STRING (datestring(8:11), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE
+                     slen = 20
+                     CALL EF_PUT_STRING (datestring, slen,
+     .                    result(1,i,j,k,l))
+
+                 ENDIF
+                 
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+     
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+****************************************************************
+*
+      SUBROUTINE LOWER(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Converts a string to lowercase.
+*
+      EXTERNAL LENGTH
+      INTEGER  LENGTH
+      CHARACTER*1 LETTER
+      INTEGER ISHIFT,I
+      ISHIFT=ICHAR('a')-ICHAR('A')
+      DO 10 I=1,LENGTH(TEXT)
+        LETTER=TEXT(I:I)
+        IF('A'.LE.LETTER.AND.LETTER.LE.'Z') THEN
+          TEXT(I:I)=CHAR(ICHAR(LETTER)+ISHIFT)
+        END IF
+   10 CONTINUE
+      RETURN
+      END
+
+***************************************************************
+*
+      INTEGER FUNCTION LENGTH(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Computes the length of a string without trailing blanks.
+*
+      INTEGER I
+
+      DO 1 I=LEN(TEXT),1,-1
+        IF(TEXT(I:I).NE.' ') THEN
+          GO TO 2
+        END IF
+    1 CONTINUE
+      I=1
+    2 CONTINUE
+      LENGTH=I
+
+      RETURN
+      END
+
diff --git a/external_functions/tax_times/tax_day.F b/external_functions/tax_times/tax_day.F
new file mode 100644
index 0000000..981f24d
--- /dev/null
+++ b/external_functions/tax_times/tax_day.F
@@ -0,0 +1,187 @@
+*
+* tax_day.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns day specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_day_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns days of month of time axis coordinate values' )
+   
+*      CALL ef_set_num_work_arrays(id,1)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_day_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+      REAL*8 ddate
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the datebuf corresponding to time ddate for the variable ARG2
+                  CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+*                  print *, datebuf
+                  
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date and time.
+                  READ (datebuf,110,err=900) day_of_mon, cmon, iyear
+     
+                  result(i,j,k,l) = day_of_mon 
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_day',  
+     .  datebuf
+
+      RETURN
+      END
diff --git a/external_functions/tax_times/tax_dayfrac.F b/external_functions/tax_times/tax_dayfrac.F
new file mode 100644
index 0000000..ef9a7bc
--- /dev/null
+++ b/external_functions/tax_times/tax_dayfrac.F
@@ -0,0 +1,188 @@
+*
+* tax_dayfrac.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns day fraction ([0,1]) specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_dayfrac_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns fraction of day of time axis coordinate values' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_dayfrac_compute(id, arg_1, arg_2, result) 
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      INTEGER ihour, iminute, isec
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+*                print *, datebuf
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read time.
+                READ (datebuf,120,err=900) ihour, iminute, isec
+
+                result(i,j,k,l)=(isec/3600.0+iminute/60.0+ihour)/24.0  
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+* 110  FORMAT (i2, 1x, a3, 1x, i4) 
+ 120  FORMAT (11x, 3(1x,i2))
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_dayfrac',  
+     .  datebuf
+
+      RETURN
+      END
diff --git a/external_functions/tax_times/tax_index_datestring.F b/external_functions/tax_times/tax_index_datestring.F
new file mode 100644
index 0000000..1715127
--- /dev/null
+++ b/external_functions/tax_times/tax_index_datestring.F
@@ -0,0 +1,309 @@
+*
+* tax_index_datestring.F
+*
+* Jing Y. Li 
+* May 2006
+* 18-may-2006 ACM change to compare only the first 3 characters of the precision string.
+*
+* Returns string of dates 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, tax_index_datestring )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE tax_index_datestring_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns date string for time axis coordinate values' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'indices of time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*     Set data type as string
+      arg = 3
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'output precision')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_index_datestring_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER ntout, nt2
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2)
+
+      nt2 = (ntout+1)* 2
+
+* tax  output t axis
+      CALL ef_set_work_array_dims (id, 1, 1, 1, 1, 1, nt2, 1, 1, 1)
+
+      RETURN
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_index_datestring_compute(id, arg_1, arg_2, arg_3, 
+     .           result, tax)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(2,mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+
+      REAL result(2,memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i3, j3, k3, l3
+      INTEGER rtype, slen, iindex
+      CHARACTER*20 datestring
+      CHARACTER*3 precistring
+      REAL*8 ddate
+
+*  Dimension the work arrays
+
+      REAL*8 tax(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_result_type(id, rtype)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Get the precision for output
+      i3=arg_lo_ss(X_AXIS, ARG3)
+      j3=arg_lo_ss(Y_AXIS, ARG3)
+      k3=arg_lo_ss(Z_AXIS, ARG3)
+      l3=arg_lo_ss(T_AXIS, ARG3)
+
+*     Get the output presicion (string)
+      CALL ef_get_string_arg_element(id, ARG3, arg_3,
+     .     i3,j3,k3,l3,slen,precistring)
+
+      CALL LOWER(precistring)
+
+* Get coordinates of time axis
+
+      call ef_get_coordinates(id, ARG2, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG2), arg_hi_ss(T_AXIS, ARG2), tax)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                 iindex = arg_1(i1,j1,k1,l1)
+                 ddate =  tax(iindex,1,1,1)
+
+C     Get the string value of dates and put them in the result.
+                 CALL EF_GET_AXIS_DATES 
+     .                (id, ARG2, ddate, 1, datestring)
+
+                 If(precistring .EQ. 'sec') THEN
+                     slen = 20
+                     CALL EF_PUT_STRING (datestring, slen,
+     .                    result(1,i,j,k,l))
+                 
+                 ELSE If(precistring .EQ. 'min') THEN
+                     slen = 17
+                     CALL EF_PUT_STRING (datestring(1:17), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE If(precistring .EQ. 'hou') THEN
+                     slen = 14
+                     CALL EF_PUT_STRING (datestring(1:14), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE If(precistring .EQ. 'day') THEN
+                     slen = 11
+                     CALL EF_PUT_STRING (datestring(1:11), slen, 
+     .                    result(1,i,j,k,l))
+
+                 ELSE IF(precistring .EQ. 'mon') THEN
+                     slen = 8
+                     CALL EF_PUT_STRING (datestring(4:11), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE IF(precistring .EQ. 'yea') THEN
+                     slen = 4
+                     CALL EF_PUT_STRING (datestring(8:11), slen,
+     .                    result(1,i,j,k,l))
+
+                 ELSE
+                     slen = 20
+                     CALL EF_PUT_STRING (datestring, slen,
+     .                    result(1,i,j,k,l))
+
+                 ENDIF
+                 
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+     
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+****************************************************************
+*
+      SUBROUTINE LOWER(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Converts a string to lowercase.
+*
+      EXTERNAL LENGTH
+      INTEGER  LENGTH
+      CHARACTER*1 LETTER
+      INTEGER ISHIFT,I
+      ISHIFT=ICHAR('a')-ICHAR('A')
+      DO 10 I=1,LENGTH(TEXT)
+        LETTER=TEXT(I:I)
+        IF('A'.LE.LETTER.AND.LETTER.LE.'Z') THEN
+          TEXT(I:I)=CHAR(ICHAR(LETTER)+ISHIFT)
+        END IF
+   10 CONTINUE
+      RETURN
+      END
+
+***************************************************************
+*
+      INTEGER FUNCTION LENGTH(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Computes the length of a string without trailing blanks.
+*
+      INTEGER I
+
+      DO 1 I=LEN(TEXT),1,-1
+        IF(TEXT(I:I).NE.' ') THEN
+          GO TO 2
+        END IF
+    1 CONTINUE
+      I=1
+    2 CONTINUE
+      LENGTH=I
+
+      RETURN
+      END
+
diff --git a/external_functions/tax_times/tax_jday.F b/external_functions/tax_times/tax_jday.F
new file mode 100644
index 0000000..2402579
--- /dev/null
+++ b/external_functions/tax_times/tax_jday.F
@@ -0,0 +1,225 @@
+*
+* tax_jday.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns day of current year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_jday_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns days of year of time axis coordinate values' )
+   
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_jday_compute(id, arg_1, arg_2, result) 
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, imon, day_of_mon, day_of_year
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l,m 
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imon = 0
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                READ (datebuf, 110, err=900) 
+     .               day_of_mon, cmon, iyear
+
+                CALL juldate(cmon, day_of_mon, iyear, day_of_year)
+                result(i,j,k,l) = day_of_year 
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_jday',  
+     .  datebuf
+
+      RETURN
+      END
+      
+      SUBROUTINE juldate(cmon, day_of_mon, iyear, day_of_year)
+
+*     Convert day of month to day of year
+
+      INTEGER i, iyear
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, ndaymo(12)
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      imon = 0
+      DO 100 i=1,12
+          IF(cmon .EQ. months(i)) imon = i 
+ 100  CONTINUE
+
+*     Check if it is a leap year
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0)) 
+     .     .OR.
+     .     (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      END IF
+
+      day_of_year = day_of_mon
+      DO 200 i =1, imon -1
+          day_of_year = day_of_year + ndaymo(i) 
+ 200  CONTINUE
+
+      RETURN
+      END
+*                                                                      ^
+*                                                                      |
+*                                                                      |
+* **********************************************************************
diff --git a/external_functions/tax_times/tax_jday1900.F b/external_functions/tax_times/tax_jday1900.F
new file mode 100644
index 0000000..298db54
--- /dev/null
+++ b/external_functions/tax_times/tax_jday1900.F
@@ -0,0 +1,277 @@
+*
+* tax_jday1900.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns day of current year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+*
+* 2006-05-12 add code to handle years before 1900
+
+      SUBROUTINE tax_jday1900_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns days since 1900 of time axis coordinate values' )
+   
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_jday1900_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, imon, day_of_mon, day_since_1900
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l,m 
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imon = 0
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+             l1 = arg_lo_ss(T_AXIS,ARG1)
+             DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date and time.
+               READ (datebuf, 110, err=900)  day_of_mon, cmon, iyear
+
+               CALL juldate1900(cmon, day_of_mon, iyear, day_since_1900)
+               result(i,j,k,l) = day_since_1900 
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100         CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_jday1900',  
+     .  datebuf
+
+      RETURN
+      END
+      
+* **********************************************************************
+*     Convert day of month to day since 1900
+*     Returns -1 if the year is before 1900
+
+      SUBROUTINE juldate1900(cmon, day_of_mon, iyear, day_since_1900)
+
+      INTEGER i, j, iyear
+      INTEGER yrstart,yrend
+      LOGICAL isafter1900
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, day_since_1900, ndaymo(12)
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      imon = 0
+      DO 100 i=1,12
+          IF(cmon .EQ. months(i)) imon = i 
+ 100  CONTINUE
+
+      yrstart = 1900
+      yrend = iyear-1
+      isafter1900 = .TRUE. 
+      day_since_1900 = -1
+
+      IF(iyear .LT. 1900) THEN
+          yrstart = iyear+1
+          yrend = 1899
+          isafter1900 = .FALSE.          
+          day_since_1900 = 0
+      ENDIF
+
+*     Total days between yrstart and yrend
+      DO 200 i = yrstart, yrend
+
+*     Check if it is a leap year
+          IF ( ((mod(i,4) .EQ. 0) .AND. (mod(i,100) .NE. 0))
+     .     .OR.
+     .     (mod(i, 400) .EQ. 0)) THEN
+              ndaymo(2) = 29
+          ELSE
+              ndaymo(2) = 28
+          ENDIF
+ 
+          day_since_1900 = day_since_1900 + 
+     .                    (ndaymo(2) + 7*31 + 4*30)
+
+ 200  CONTINUE
+
+*     Add days of current year
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0))
+     .     .OR.
+     .     (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+      IF(isafter1900) THEN
+*     Year after 1900
+          day_of_year = day_of_mon
+          DO 300 j =1, imon -1
+              day_of_year = day_of_year + ndaymo(j)
+ 300      CONTINUE
+       
+          day_since_1900 = day_since_1900 + day_of_year
+      ELSE
+*     Year before 1900
+          day_of_year = day_of_mon
+          DO 400 j =1, imon -1
+              day_of_year = day_of_year + ndaymo(j)
+ 400      CONTINUE
+
+          day_since_1900 = -1*(day_since_1900 + 
+     .                     ndaymo(2) + 7*31 + 4*30- day_of_year+1)
+
+      ENDIF
+
+      RETURN
+      END
+*                                                                      ^
+*                                                                      |
+*                                                                      |
+* **********************************************************************
diff --git a/external_functions/tax_times/tax_month.F b/external_functions/tax_times/tax_month.F
new file mode 100644
index 0000000..e237765
--- /dev/null
+++ b/external_functions/tax_times/tax_month.F
@@ -0,0 +1,196 @@
+*
+* taxmonth.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns month specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_month_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns months of time axis coordinate values' )
+   
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_month_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, imon, day_of_mon
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l,m 
+      INTEGER i1, j1, k1, l1
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imon = 0
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                  CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                  READ (datebuf,110,err=900) day_of_mon, cmon, iyear
+
+                  DO 50 m=1,12
+                    IF (cmon .EQ. months(m)) imon=m
+ 50               CONTINUE  
+
+                  
+                  result(i,j,k,l) = imon 
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_year',  
+     .  datebuf
+
+      RETURN
+      END
diff --git a/external_functions/tax_times/tax_times.F b/external_functions/tax_times/tax_times.F
new file mode 100644
index 0000000..9c1a0d7
--- /dev/null
+++ b/external_functions/tax_times/tax_times.F
@@ -0,0 +1,177 @@
+*
+* tax_times.F
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* axis_reduction     Are the result axes 'reduced' with respect to the 
+*                    argument axes from which they are inherited?
+*                       ( RETAINED, REDUCED ) 
+*                       RETAINED        - result axis has same extent as argument axis
+*                       REDUCED         - result axis is reduced to a point
+*                >>> The axis_reduction defaults to RETAINED and only needs
+*                >>> to be applied when the result is reduced to a point but
+*                >>> SET REGION information should still be applied to the
+*                >>> external function arguments. (e.g. a function returning a status flag)
+*                >>> In such a case the result axes should be IMPLIED_BY_ARGS
+*                >>> and REDUCED.  (as opposed to NORMAL and RETAINED)
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_times_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . '(demonstration function) returns % good data at each time' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_axis_reduction(id, REDUCED, REDUCED, REDUCED,
+     .     RETAINED)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'data to be checked')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_times_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id, good, total
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*
+* Note that we are looping on the argument subscripts rather than
+* the result subscripts. (Looping on result subscripts is the normal 
+* way).  That's because the result has axes which are normal and the
+* loop count on those normal axes will be one.
+*
+      l = res_lo_ss(T_AXIS)
+      DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+ 
+      good = 0
+      total = 0
+
+      i = res_lo_ss(X_AXIS)
+      DO 400 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+ 
+         j = res_lo_ss(Y_AXIS)
+         DO 300 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+ 
+            k = res_lo_ss(Z_AXIS)
+            DO 200 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+ 
+                  total = total + 1
+
+                  IF ( arg_1(i1,j1,k1,l1) .NE. bad_flag(1) ) THEN
+ 
+                     good = good + 1
+ 
+                  END IF
+ 
+               k = k + res_incr(Z_AXIS)
+ 200        CONTINUE
+ 
+            j = j + res_incr(Y_AXIS)
+ 300     CONTINUE
+ 
+         i = i + res_incr(X_AXIS)
+ 400  CONTINUE
+      
+         result(i,j,k,l) = (good * 100.0) / total
+
+         l = l + res_incr(T_AXIS)
+ 100  CONTINUE
+
+
+ 
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/tax_times/tax_tstep.F b/external_functions/tax_times/tax_tstep.F
new file mode 100644
index 0000000..8026bf3
--- /dev/null
+++ b/external_functions/tax_times/tax_tstep.F
@@ -0,0 +1,646 @@
+*
+* tax_year.F
+*
+* Jing Y. Li 
+* May 31 2006
+*
+* This function returns time step values
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE tax_tstep_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns time step values based on the new time origin' )
+   
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      CALL ef_set_arg_desc(id, arg, 'desired time origin')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_tstep_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(2, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, dayofmon, hour, minute, second
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+      
+      CHARACTER*20 t0string
+      INTEGER t0year, t0day
+      CHARACTER*3 t0mon
+
+      REAL*8 ddate
+
+      CHARACTER*16 axname(4), axunits(4)
+      LOGICAL bkw1(4), mod1(4), reg1(4)
+      CHARACTER*16 tunit
+
+      REAL timesincet0
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Get the time origin (t0) string
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      j2 = arg_lo_ss(Y_AXIS, ARG2)
+      k2 = arg_lo_ss(Z_AXIS, ARG2)
+      l2 = arg_lo_ss(T_AXIS, ARG2)
+ 
+*     Get the desired time origin
+      CALL ef_get_string_arg_element(id, ARG2, arg_2,
+     .     i2, j2, k2, l2, slen, t0string)
+
+*     Get time axis unit
+      CALL ef_get_axis_info(id, ARG1, axname, axunits, bkw1, mod1, reg1)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG1,ddate,1,datebuf)
+
+                print *, datebuf
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+*                READ (datebuf,110,err=900) dayofmon, cmon, iyear
+*                READ (datebuf,120,err=900) hour, minute, second
+
+                tunit = axunits(4)
+
+                CALL time_since_t0(t0string,datebuf,tunit,timesincet0)
+ 
+                result(i,j,k,l) = timesincet0
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error for reading t0string in tax_tstep ',
+     .  t0string
+
+      RETURN
+
+      END
+
+*********************************************************************
+*
+*     Compute the time since desired t0
+*
+*********************************************************************
+      SUBROUTINE time_since_t0(t0string, datebuf, tunit, timesincet0)
+      
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*16 tunit
+      REAL timesincet0
+
+      INTEGER secondsincet0, minutesincet0, hoursincet0
+      INTEGER daysincet0, monthsincet0, yearsincet0
+
+      CALL LOWER(tunit)
+
+*     Compute time since t0, check time axis unit
+      IF( tunit(1:3) .EQ. 'sec') THEN
+          CALL second_since_t0(t0string, datebuf, secondsincet0)
+          timesincet0 = secondsincet0
+      ELSE IF(tunit(1:3) .EQ. 'min') THEN
+          CALL minute_since_t0(t0string, datebuf, minutesincet0)
+          timesincet0 = minutesincet0
+      ELSE IF(tunit(1:3) .EQ. 'hou') THEN
+          CALL hour_since_t0(t0string, datebuf, hoursincet0)
+          timesincet0 = hoursincet0
+      ELSE IF(tunit(1:3) .EQ. 'day') THEN
+          CALL day_since_t0(t0string, datebuf, daysincet0)
+          timesincet0 = daysincet0
+      ELSE IF(tunit(1:3) .EQ. 'mon') THEN
+          CALL month_since_t0(t0string, datebuf, monthsincet0)
+          timesincet0 = monthsincet0
+      ELSE IF(tunit(1:3) .EQ. 'yea') THEN
+          CALL year_since_t0(t0string, datebuf, yearsincet0)
+          timesincet0 = yearsincet0
+      ELSE 
+          timesincet0=0.
+      ENDIF
+
+      RETURN
+      END
+
+*******************************************************************
+*     Compute second since t0
+*******************************************************************
+      SUBROUTINE second_since_t0(t0string, datebuf, secondsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER minutesincet0, secondsincet0
+
+      INTEGER isecond, t0second
+
+      t0hour = 0
+
+      CALL minute_since_t0(t0string, datebuf, minutesincet0)
+      secondsincet0 = 60*minutesincet0
+
+*     Get t0's minute
+      READ (t0string, 110, err=800) t0second
+
+*     Get current minute
+      READ (datebuf, 110, err=900) isecond
+
+ 110  FORMAT (18x, i2)
+
+*     Adjust minutes of current date
+      secondsincet0 = secondsincet0 - (60-isecond)
+
+*     Adjust minutes of t0
+      secondsincet0 = secondsincet0 + (60 - t0second)
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+
+*******************************************************************
+*     Compute minutes since t0
+*******************************************************************
+      SUBROUTINE minute_since_t0(t0string, datebuf, minutesincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER minutesincet0, hoursincet0
+
+      INTEGER iminute, t0minute
+
+      t0hour = 0
+
+      CALL hour_since_t0(t0string, datebuf, hoursincet0)
+      minutesincet0 = 60*hoursincet0
+
+*     Get t0's minute
+      READ (t0string, 110, err=800) t0minute
+
+*     Get current minute
+      READ (datebuf, 110, err=900) iminute
+
+ 110  FORMAT (15x, i2, 3x)
+
+*     Adjust minutes of current date
+      minutesincet0 = minutesincet0 - (60-iminute)
+
+*     Adjust minutes of t0
+      minutesincet0 = minutesincet0 + (60 - t0minute)
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute hours since t0
+*******************************************************************
+      SUBROUTINE hour_since_t0(t0string, datebuf, hoursincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER hoursincet0, daysincet0
+       
+      INTEGER ihour, t0hour      
+
+      t0hour = 0
+
+      CALL day_since_t0(t0string, datebuf, daysincet0)
+      hoursincet0 = 24*daysincet0
+
+      print *, daysincet0
+
+*     Get t0's hour
+      READ (t0string, 110, err=800) t0hour
+
+*     Get current hour
+      READ (datebuf, 110, err=900) ihour
+
+ 110  FORMAT (12x, i2, 6x)
+
+*     Adjust hours of current date
+      hoursincet0 = hoursincet0 - (24-ihour)
+
+*     Adjust hours of t0
+      hoursincet0 = hoursincet0 + (24 - t0hour)
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+*******************************************************************
+*     Compute the days since t0
+*     Assume that t0 is before the current year
+*******************************************************************
+      SUBROUTINE day_since_t0(t0string, datebuf, daysincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER daysincet0
+
+      INTEGER t0day, t0year
+      CHARACTER*3 t0mon
+
+      INTEGER dayofmon, iyear 
+      CHARACTER*3 cmon
+
+      CHARACTER*3 months(12)
+      INTEGER it0mon, imon
+      INTEGER i, j, m
+      INTEGER yrstart,yrend
+      INTEGER dayofyear, ndaymo(12)
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      DATA months/'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
+     .            'aug', 'sep', 'oct', 'nov', 'dec'/
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0day, t0mon, t0year
+      
+*     Get current date
+      READ (datebuf, 110, err=900) dayofmon, cmon, iyear
+   
+ 110  FORMAT (i2, 1x, a3, 1x, i4)
+
+      CALL LOWER(t0mon)
+      CALL LOWER(cmon)
+
+      print *, t0mon, cmon
+
+*     Convert a month from string to number
+      DO 50 m=1,12
+          IF (t0mon .EQ. months(m)) it0mon=m
+          IF (cmon .EQ. months(m)) imon=m
+ 50   CONTINUE
+
+      print *, imon, it0mon
+
+      yrstart = t0year
+      yrend = iyear-1
+      daysincet0 = 0
+
+*     Total days between yrstart and yrend
+      DO 200 i = yrstart, yrend
+
+*     Check if it is a leap year
+          IF ( ((mod(i,4) .EQ. 0) .AND. (mod(i,100) .NE. 0))
+     .       .OR.
+     .       (mod(i, 400) .EQ. 0)) THEN
+                ndaymo(2) = 29
+          ELSE
+                ndaymo(2) = 28
+          ENDIF
+
+          daysincet0 = daysincet0 + (ndaymo(2) + 7*31 + 4*30)
+
+ 200  CONTINUE
+
+*     ***************************
+*     Adjust days of current year
+*     ***************************
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0))
+     .       .OR.
+     .       (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+*     Compute day of current year
+      dayofyear = dayofmon
+      DO 300 j =1, imon -1
+          dayofyear = dayofyear + ndaymo(j)
+ 300  CONTINUE
+
+*     Add days of current year 
+          daysincet0 = daysincet0 + dayofyear
+
+*     *****************************
+*     Adjust days in the year of t0
+*     *****************************
+      IF ( ((mod(t0year,4) .EQ. 0) .AND. (mod(t0year,100) .NE. 0))
+     .       .OR.
+     .       (mod(t0year, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+*     Compute day of current year
+      dayofyear = t0day
+      DO 400 j =1, it0mon -1
+          dayofyear = dayofyear + ndaymo(j)
+ 400  CONTINUE
+
+*     Subtract days of year t0
+      daysincet0 = daysincet0 - dayofyear
+
+      RETURN
+
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for timr origin in tax_tstep',
+     .  t0string
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute month since t0
+*******************************************************************
+      SUBROUTINE month_since_t0(t0string, datebuf, monthsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER monthsincet0
+      CHARACTER*3 t0mon, cmon
+      CHARACTER*3 months(12)
+      INTEGER iyear, t0year, it0mon, imon
+      INTEGER m
+
+      DATA months/'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
+     .            'aug', 'sep', 'oct', 'nov', 'dec'/
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0mon, t0year
+*     Get current date
+      READ (datebuf, 110, err=900) cmon, iyear
+
+ 110  FORMAT (3x, a3, 1x, i4)
+
+      CALL LOWER(t0mon)
+      CALL LOWER(cmon)
+*     Convert a month from string to number
+      DO 50 m=1,12
+          IF (t0mon .EQ. months(m)) it0mon=m
+          IF (cmon .EQ. months(m)) imon=m
+ 50   CONTINUE
+
+      monthsincet0= (12-it0mon) + (iyear-t0year-1)*12 + imon
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for time origin in tax_tstep: ',
+     .  t0string
+      RETURN
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep: ',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute year since t0
+*******************************************************************
+      SUBROUTINE year_since_t0(t0string, datebuf, yearsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      INTEGER yearsincet0
+      INTEGER iyear, t0year
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0year
+*     Get current date
+      READ (datebuf, 110, err=900) iyear
+ 110  FORMAT (7x, i4)
+
+      yearsincet0 = iyear - t0year 
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for time origin in tax_tstep: ',
+     .  t0string
+      RETURN
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep: ',
+     .  datebuf
+      RETURN
+
+      END
+
+
+****************************************************************
+*
+      SUBROUTINE LOWER(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Converts a string to lowercase.
+*
+      EXTERNAL LENGTH
+      INTEGER  LENGTH
+      CHARACTER*1 LETTER
+      INTEGER ISHIFT,I
+      ISHIFT=ICHAR('a')-ICHAR('A')
+      DO 10 I=1,LENGTH(TEXT)
+        LETTER=TEXT(I:I)
+        IF('A'.LE.LETTER.AND.LETTER.LE.'Z') THEN
+          TEXT(I:I)=CHAR(ICHAR(LETTER)+ISHIFT)
+        END IF
+   10 CONTINUE
+      RETURN
+      END
+
+***************************************************************
+*
+      INTEGER FUNCTION LENGTH(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Computes the length of a string without trailing blanks.
+*
+      INTEGER I
+
+      DO 1 I=LEN(TEXT),1,-1
+        IF(TEXT(I:I).NE.' ') THEN
+          GO TO 2
+        END IF
+    1 CONTINUE
+      I=1
+    2 CONTINUE
+      LENGTH=I
+
+      RETURN
+      END
+
diff --git a/external_functions/tax_times/tax_units.F b/external_functions/tax_times/tax_units.F
new file mode 100644
index 0000000..87dafce
--- /dev/null
+++ b/external_functions/tax_times/tax_units.F
@@ -0,0 +1,226 @@
+*
+* tax_units.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns year specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+* 2006-05-11 It only works with the unit nameing convention in xunits_data.F
+
+      SUBROUTINE tax_units_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns units of time axis coordinate values, in seconds' )
+   
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_axis_reduction(id, REDUCED, REDUCED, REDUCED, REDUCED)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_units_compute(id, arg_1, result)
+
+*      INCLUDE 'tax.h' 
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INCLUDE 'xunits.cmn_text'
+      EXTERNAL xunits_data
+
+      INTEGER iun
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER iyear, day_of_mon
+      CHARACTER*3 cmon
+      CHARACTER*16 axname(4), axunits(4)
+      LOGICAL bkw1(4), mod1(4), reg1(4)
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Get axis information
+      CALL ef_get_axis_info(id, ARG1, axname, axunits, bkw1, mod1, reg1)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                DO 99 iun=pun_1st_time, pun_last_time 
+*                  print *, un_name(iun)
+
+                  CALL LOWER(axunits(4))
+                  IF( ( un_name(iun) .EQ. axunits(4))           .OR.
+     .                ( un_name(iun)(1:2) .EQ. axunits(4)(1:2)) .OR.
+     .                ( (un_name(iun) .EQ. 'yr')                .AND. 
+     .                  (axunits(4) .EQ. 'year') ) )THEN
+
+                    result(i,j,k,l) = un_convert(iun) 
+                  END IF
+ 99             CONTINUE
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+****************************************************************
+*
+      SUBROUTINE LOWER(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Converts a string to lowercase.
+*
+      EXTERNAL LENGTH
+      INTEGER  LENGTH
+      CHARACTER*1 LETTER
+      INTEGER ISHIFT,I
+      ISHIFT=ICHAR('a')-ICHAR('A')
+      DO 10 I=1,LENGTH(TEXT)
+        LETTER=TEXT(I:I)
+        IF('A'.LE.LETTER.AND.LETTER.LE.'Z') THEN
+          TEXT(I:I)=CHAR(ICHAR(LETTER)+ISHIFT)
+        END IF
+   10 CONTINUE
+      RETURN
+      END
+
+***************************************************************
+*
+      INTEGER FUNCTION LENGTH(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Computes the length of a string without trailing blanks.
+*
+      INTEGER I
+
+      DO 1 I=LEN(TEXT),1,-1
+        IF(TEXT(I:I).NE.' ') THEN
+          GO TO 2
+        END IF
+    1 CONTINUE
+      I=1
+    2 CONTINUE
+      LENGTH=I
+
+      RETURN
+      END
+
+
+
diff --git a/external_functions/tax_times/tax_year.F b/external_functions/tax_times/tax_year.F
new file mode 100644
index 0000000..9f6a0f7
--- /dev/null
+++ b/external_functions/tax_times/tax_year.F
@@ -0,0 +1,185 @@
+*
+* tax_year.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns year specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE tax_year_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns years of time axis coordinate values' )
+   
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_year_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1 
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                READ (datebuf,110,err=900) day_of_mon, cmon, iyear
+     
+                result(i,j,k,l) = iyear
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_year',  
+     .  datebuf
+
+      RETURN
+      END
diff --git a/external_functions/tax_times/tax_yearfrac.F b/external_functions/tax_times/tax_yearfrac.F
new file mode 100644
index 0000000..e976906
--- /dev/null
+++ b/external_functions/tax_times/tax_yearfrac.F
@@ -0,0 +1,240 @@
+*
+* tax_yearfrac.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns fraction of year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_yearfrac_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns fraction of year of time axis coordinate values' )
+   
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_yearfrac_compute(id, arg_1, arg_2, result) 
+      
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*20 datebuf
+      INTEGER iyear, imon, day_of_mon, day_of_year, days_this_year
+      CHARACTER*3 cmon
+      CHARACTER*80 err_msg
+
+      REAL*8 ddate
+
+      INTEGER i,j,k,l,m 
+      INTEGER i1, j1, k1, l1
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imon = 0
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+           k1 = arg_lo_ss(Z_AXIS,ARG1)
+           DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 100 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                ddate = arg_1(i1,j1,k1,l1)
+
+*     Get the string-date for each time
+                CALL ef_get_axis_dates(id,ARG2,ddate,1,datebuf)
+*                print *, datebuf
+
+*     If datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date and time.
+                READ (datebuf, 110, err=900) day_of_mon, cmon, iyear
+
+                CALL juldate(cmon, day_of_mon, iyear, day_of_year,
+     .               days_this_year)
+
+                result(i,j,k,l) = day_of_year/REAL(days_this_year) 
+
+                l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100          CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 400  CONTINUE
+
+ 110  FORMAT (i2, 1x, a3, 1x, i4) 
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_yearfrac',  
+     .  datebuf
+
+      RETURN
+      END
+
+************************************************************************      
+*     This subroutine returns day number of current year and the total 
+*     number of days of current year.
+      SUBROUTINE juldate(cmon, day_of_mon, iyear, day_of_year, 
+     .           days_this_year)
+
+*     Convert day of month to day of year
+
+      INTEGER i, iyear
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, ndaymo(12)
+      INTEGER days_this_year
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      imon = 0
+      DO 100 i=1,12
+          IF(cmon .EQ. months(i)) imon = i 
+ 100  CONTINUE
+
+*     Check if it is a leap year
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0)) 
+     .     .OR.
+     .     (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      END IF
+
+*     Compute day number within current year
+      day_of_year = day_of_mon
+      DO 200 i =1, imon -1
+          day_of_year = day_of_year + ndaymo(i) 
+ 200  CONTINUE
+
+*     Compute total days of current year
+      days_this_year = 0
+      DO 300 i =1, 12 
+          days_this_year = days_this_year + ndaymo(i)
+ 300  CONTINUE
+
+      RETURN
+      END
+*                                                                      ^
+*                                                                      |
+*                                                                      |
+* **********************************************************************
diff --git a/external_functions/tax_times/xunits.cmn_text b/external_functions/tax_times/xunits.cmn_text
new file mode 100644
index 0000000..3deb7b3
--- /dev/null
+++ b/external_functions/tax_times/xunits.cmn_text
@@ -0,0 +1,48 @@
+* XUNITS.CMN - unit names and conversion factors
+*
+* revision 0.00 - 04/15/88 - 
+* added pun_millibars and pun_decibars 12/19/94
+*
+
+* 9/26/95: interchanged pun_meters (was 3) with pun_millibars (was 9)
+*	   because TM_UNIT_ID was interpreting "mbar" as "mters"
+*	   ==> required changes to xunits_data.F, too
+* 3/5/01 acm  add  more units for alternative calendar types:
+*             secs per 365.25 days (change xunits_data.F too)
+*             also add all types of months: 1/12 of seconds/year 
+
+	INTEGER		pun_1st_time,
+     .			pun_last_time,
+     .			pun_1st_len,
+     .			pun_last_len,
+     .			pun_1st_unit,
+     .			pun_last_unit,
+     .			pun_num_alt,
+     .			pun_degrees,
+     .			pun_meters,
+     .			pun_millibars,
+     .			pun_decibars
+
+	PARAMETER     ( pun_1st_time  = -16,
+     .			pun_last_time = -1,
+     .			pun_1st_len   = 1,
+     .			pun_last_len  = 15, 
+     .			pun_1st_unit  = pun_1st_time,
+     .			pun_last_unit = pun_last_len,
+     .			pun_num_alt   = 20,
+     .			pun_degrees   = 4,
+     .			pun_meters    = 9,	! formerly 3
+     .			pun_millibars = 3,	! formerly 9
+     .			pun_decibars  = 10 )
+
+
+	
+	INTEGER		un_alt_subsc( pun_num_alt )
+	REAL		un_convert  ( pun_1st_unit:pun_last_unit )
+	CHARACTER*12	un_name     ( pun_1st_unit:pun_last_unit ),
+     .			un_alt_name ( pun_num_alt )
+
+	COMMON/ XUNIT /	un_alt_subsc,		! subscripts of unit names
+     .			un_convert,		! conversion factors
+     .			un_name,		! unit names
+     .			un_alt_name		! alternative unit names
diff --git a/external_functions/tax_times/xunits_data.F b/external_functions/tax_times/xunits_data.F
new file mode 100644
index 0000000..f817660
--- /dev/null
+++ b/external_functions/tax_times/xunits_data.F
@@ -0,0 +1,217 @@
+	BLOCK DATA XUNITS_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* unit names and conversion factors
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 04/15/88
+* revision 0.01 - 11/21/88 - variable initialization changed to char_initXX
+* revision 0.02 - 01/12/90 - added mb (kludge - not really convertible) *sh*
+* revision 0.03 - 07/23/92 - added "layer" and "level" (unconvertible units)
+*             (to eliminate error msg for these commonly used units)
+* revision 0.04 - 12/19/94 - made mb non-convertible (1.0 instead of 0.01)
+*			     and added unconvertible decibars
+* 9/26/95 - interchanged the values (order) of pun_meters and pun_millibars
+*		because TM_UNIT_ID was incorrectly interpreting "mbar"
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* V5 *kob* 3/99 - add gregorian_ye[ar], year360, year366 units and also added
+*              year365 as an alternate unit to the common year.
+*    *sh* 7/99 - add alias "dbar" and change "month" definition to 1/12
+*		 of 365.2425 day year 
+*    *kob* 11/99 - add alternate unit "year" which is equal to a 
+*                  gregorian_year
+* *sh* 12/99 - add "degree" as an alternate name since exact match is now
+*	required on names
+* V510: 3/00 *sh* - added "minute" and "month"
+* V520: 6/00 *sh* bug fix: exact matching in TM_UNIT_ID broke "seconds" match
+*		         - add "hr" as an abbreviation for hours
+*       1 day later: ops -- "hour" should be the standard, not "hr"
+* V530: 2/01 *acm* add units for alternative calendars, secs per various
+*		   years and 1/12 of those for "month"
+* V532: 5/01 *sh* - added "metre"
+* V554: 2/04 *acm*  default year length is 365.2425 days
+* V570 *acm* 5/04  Add the calendar ALL_LEAP = 366_DAY, and units for the corresp. month.
+
+* local variable declarations
+!	INTEGER	i
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xunits.cmn_text'
+
+
+	DATA	un_name   ( 0)	/ ' '	/,	! FOR UNIDENTIFIED UNITS
+     .		un_convert( 0)	/ 1.0 /
+
+	DATA	un_name( 1)	/ 'cm'		/,
+     .		un_name( 2)	/ 'km'		/,
+     .		un_name(pun_meters)	/ 'm'		/,
+     .		un_name(pun_degrees)	/ 'deg'		/,
+     .		un_name( 5)	/ 'ft'		/,
+     .		un_name( 6)	/ 'in'		/,
+     .		un_name( 7)	/ 'mile'	/,
+     .		un_name( 8)	/ 'mm'		/,
+     .		un_name(pun_millibars)	/ 'mb'		/,
+     .		un_name(pun_decibars)	/ 'dbar'	/,
+     .		un_name(11)	/ char_init12	/,
+     .		un_name(12)	/ char_init12	/,
+     .		un_name(13)	/ char_init12	/,
+     .		un_name(14)	/ 'level' 	/,
+     .		un_name(15)	/ 'layer'	/
+
+	DATA	un_name( -1)	/ 'sec'		/,
+     .		un_name( -2)	/ 'min'		/,
+     .		un_name( -3)	/ 'hour'	/,
+     .		un_name( -4)	/ 'day'		/,
+     .		un_name( -5)	/ 'mon'		/,
+     .		un_name( -6)	/ 'yr'		/,
+     .		un_name( -7)	/ 'M2 cycles'	/,
+     .		un_name( -8)	/ 'year366'     /,
+     .		un_name( -9)	/ 'year360'     /,
+     .		un_name(-10)	/ 'gregorian_ye'/
+     .		un_name(-11)	/ 'noleap_ye'/
+     .		un_name(-12)	/ 'julian_ye'/
+     .		un_name(-13)	/ 'mon_noleap'/
+     .		un_name(-14)	/ 'mon_360'/
+     .		un_name(-15)	/ 'mon_julian'/
+
+	DATA	un_convert( 1)	/ .01		/,
+     .		un_convert( 2)	/ 1000.		/,
+     .		un_convert(pun_meters)	/ 1.0		/,
+     .		un_convert( 4)	/ deg2m		/,
+     .		un_convert( 5)	/ 0.3048	/,
+     .		un_convert( 6)	/ 0.0254	/,
+     .		un_convert( 7)	/ 1609.		/,
+     .		un_convert( 8)	/ .001		/,
+     .		un_convert(pun_millibars)	/ 1.0 /,! not convertible 12/94
+     .		un_convert(pun_decibars)	/ 1.0 /,! kludge: not cnvertble
+     .		un_convert(11)	/ real4_init	/,
+     .		un_convert(12)	/ real4_init	/,
+     .		un_convert(13)	/ real4_init	/,
+     .		un_convert(14)	/ 1.0    	/, ! kludge for not convertible
+     .		un_convert(15)	/ 1.0    	/  ! kludge for not convertible
+
+	DATA	un_convert( -1)	/ 1.0		/,
+     .		un_convert( -2)	/ 60.		/,
+     .		un_convert( -3)	/ 3600.		/, ! sec per hour
+     .		un_convert( -4)	/ 86400.	/, ! sec per day
+     .		un_convert( -5)	/ 2629746.	/, ! 1/12 of 365.2425 year
+
+c     .		un_convert( -6)	/ 31536000.	/, ! sec per 365 day year (OLD default)
+     .		un_convert( -6)	/ 31556952.	/  ! sec per 365.2425 year
+
+     .		un_convert( -7)	/ 44712.	/, ! sec per M2 cycle
+     .		un_convert( -8)	/ 31622400.	/, ! sec per 366 day year
+     .		un_convert( -9)	/ 31104000.	/, ! sec per 360 day year
+     .		un_convert(-10)	/ 31556952.	/  ! sec per 365.2425 year
+
+     .		un_convert(-11)	/ 31536000.	/ ! sec per 365.0 day year
+     .		un_convert(-12)	/ 31557600.	/ ! sec per 365.25 day year
+
+     .		un_convert(-13)	/ 2628000.	/ ! 1/12 of sec per 365 day year
+     .		un_convert(-14)	/ 2592000.	/ ! 1/12 of sec per 360 day year
+     .		un_convert(-15)	/ 2629800.	/ ! 1/12 of sec per 365.25 day year
+     .		un_convert(-16)	/ 2635200.	/ ! 1/12 of sec per 366 day year
+
+	DATA	un_alt_name ( 1) / 'centim'	/,
+     .		un_alt_subsc( 1) / 1 /,
+     .
+     .		un_alt_name ( 2) / 'kilom'	/,
+     .		un_alt_subsc( 2) / 2 /,
+     .
+     .		un_alt_name ( 3) / 'milim'	/,
+     .		un_alt_subsc( 3) / 8 /,
+     .
+     .		un_alt_name ( 4) / 'lat'	/,
+     .		un_alt_subsc( 4) / pun_degrees /,
+     .
+     .		un_alt_name ( 5) / 'lon'	/,
+     .		un_alt_subsc( 5) / pun_degrees /,
+     .
+     .		un_alt_name ( 6) / 'feet'	/,
+     .		un_alt_subsc( 6) / 5 /,
+     .
+     .		un_alt_name ( 7) / 'foot'	/,
+     .		un_alt_subsc( 7) / 5 /,
+     .
+     .		un_alt_name ( 8) / 'meter'	/,! after all other "xxxxmeters"
+     .		un_alt_subsc( 8) / pun_meters /,
+     .
+     .		un_alt_name ( 9) / 'year365'/,
+     .		un_alt_subsc( 9) / -6 /,
+     .
+     .		un_alt_name (10) / 'millibar'	/,
+     .		un_alt_subsc(10) / pun_millibars /,
+     .
+     .		un_alt_name (11) / 'decibar'	/,
+     .		un_alt_subsc(11) / pun_decibars /,
+     .
+     .		un_alt_name (12) / 'common_year'/,
+     .		un_alt_subsc(12) / -6 /,
+     .
+     .		un_alt_name (13) / 'mbar'	/,
+     .		un_alt_subsc(13) / pun_millibars /,
+     .
+     .		un_alt_name (14) / 'year'	/,
+     .		un_alt_subsc(14) / -10 /,
+     .
+     .		un_alt_name (15) / 'degree'	/,
+     .		un_alt_subsc(15) / pun_degrees /,
+     .
+     .		un_alt_name (16) / 'month'	/,
+     .		un_alt_subsc(16) / -5 /,
+     .
+     .		un_alt_name (17) / 'minute'	/,
+     .		un_alt_subsc(17) / -2 /,
+     .
+     .		un_alt_name (18) / 'second'	/,
+     .		un_alt_subsc(18) / -1 /,
+     .
+     .		un_alt_name (19) / 'hr'		/,
+     .		un_alt_subsc(19) / -3 /,
+     .
+     .		un_alt_name (20) / 'metre'	/, ! those Brits ...
+     .		un_alt_subsc(20) /  pun_meters /
+!     .		un_alt_name (20) / char_init12	/,
+!     .		un_alt_subsc(20) / 0 /
+
+	END
diff --git a/external_functions/transpose/Makefile b/external_functions/transpose/Makefile
new file mode 100644
index 0000000..1714d74
--- /dev/null
+++ b/external_functions/transpose/Makefile
@@ -0,0 +1,55 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+# *sh* 2/2000 - removed SAMPLEIJ from target list (replaced by SAMPLEXY)
+#
+# *acm* 1/2001 - incorporate "make debug" as per SH Makefiles
+#  acm  2/2001   debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+ 
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+# all:    transpose_xz.so transpose_xy.so transpose_xt.so transpose_yz.so transpose_yt.so transpose_zt.so
+all:
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/transpose/transpose_xt.F b/external_functions/transpose/transpose_xt.F
new file mode 100644
index 0000000..ae4a178
--- /dev/null
+++ b/external_functions/transpose/transpose_xt.F
@@ -0,0 +1,222 @@
+*
+* transpose_xt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes X and T axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in X and T')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_x, my_hi_x, my_lo_t, my_hi_t,nx,nt
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_x = 1
+      my_hi_x = nx
+      my_lo_t = 1
+      my_hi_t = nt
+
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_t, my_hi_t)
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_x, my_hi_x)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xt_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                l1 = arg_lo_ss(T_AXIS, ARG1)
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 100            CONTINUE
+                i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200         CONTINUE
+             j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 300      CONTINUE
+          k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/transpose/transpose_xy.F b/external_functions/transpose/transpose_xy.F
new file mode 100644
index 0000000..873e342
--- /dev/null
+++ b/external_functions/transpose/transpose_xy.F
@@ -0,0 +1,222 @@
+*
+* transpose_xy.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xy_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes x and y axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in X and Y')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xy_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_x, my_hi_x, my_lo_y, my_hi_y,ny,nx
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_x = 1
+      my_hi_x = nx
+      my_lo_y = 1
+      my_hi_y = ny
+
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_y, my_hi_y)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_x, my_hi_x)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xy_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+               j1 = arg_lo_ss(Y_AXIS, ARG1)
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 100            CONTINUE
+                i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200         CONTINUE
+             k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300      CONTINUE
+          l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/transpose/transpose_xz.F b/external_functions/transpose/transpose_xz.F
new file mode 100644
index 0000000..b135908
--- /dev/null
+++ b/external_functions/transpose/transpose_xz.F
@@ -0,0 +1,222 @@
+*
+* transpose_xz.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xz_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes x and z axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in X and Z')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xz_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_x, my_hi_x, my_lo_z, my_hi_z,nx,nz
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_x = 1
+      my_hi_x = nx
+      my_lo_z = 1
+      my_hi_z = nz
+
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_z, my_hi_z)
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_x, my_hi_x)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xz_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 100            CONTINUE
+                i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200         CONTINUE
+             j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 300      CONTINUE
+          l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/transpose/transpose_yt.F b/external_functions/transpose/transpose_yt.F
new file mode 100644
index 0000000..c11f718
--- /dev/null
+++ b/external_functions/transpose/transpose_yt.F
@@ -0,0 +1,222 @@
+*
+* transpose_yt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_yt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes Y and T axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in Y and T')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_yt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_t, my_hi_t, my_lo_y, my_hi_y,ny,nt
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract T and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_t = 1
+      my_hi_t = nt
+      my_lo_y = 1
+      my_hi_y = ny
+
+
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_y, my_hi_y)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_t, my_hi_t)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_yt_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+            j1 = arg_lo_ss(Y_AXIS, ARG1)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                l1 = arg_lo_ss(T_AXIS, ARG1)
+                DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 100            CONTINUE
+                j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200         CONTINUE
+             k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300      CONTINUE
+          i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/transpose/transpose_yz.F b/external_functions/transpose/transpose_yz.F
new file mode 100644
index 0000000..e97ee79
--- /dev/null
+++ b/external_functions/transpose/transpose_yz.F
@@ -0,0 +1,222 @@
+*
+* transpose_yz.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_yz_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes Y and Z axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in Y and Z')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_yz_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_z, my_hi_z, my_lo_y, my_hi_y,ny,nz
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract Z and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_z = 1
+      my_hi_z = nz
+      my_lo_y = 1
+      my_hi_y = ny
+
+
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_y, my_hi_y)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_z, my_hi_z)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_yz_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         i1 = arg_lo_ss(X_AXIS, ARG1)
+         DO 300 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            j1 = arg_lo_ss(Y_AXIS, ARG1)
+            DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+                k1 = arg_lo_ss(Z_AXIS, ARG1)
+                DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 100            CONTINUE
+                j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200         CONTINUE
+             i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 300      CONTINUE
+          l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/transpose/transpose_zt.F b/external_functions/transpose/transpose_zt.F
new file mode 100644
index 0000000..ccdb82a
--- /dev/null
+++ b/external_functions/transpose/transpose_zt.F
@@ -0,0 +1,222 @@
+*
+* transpose_zt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_zt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'transposes Z and T axes of given variable' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, ABSTRACT)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in Z and T')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES,YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_zt_result_limits(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER my_lo_z, my_hi_z, my_lo_t, my_hi_t,nz,nt
+      CHARACTER*100 errtxt
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*     Set the abstract X and Y axes.
+*
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1
+
+      my_lo_z = 1
+      my_hi_z = nz
+      my_lo_t = 1
+      my_hi_t = nt
+
+
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_t, my_hi_t)
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_z, my_hi_z)
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+
+      END
+
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_zt_compute(id, arg_1, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check to make sure both axis have points to transpose
+      IF ((arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ELSEIF  ((arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .        (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         write(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            k1 = arg_lo_ss(Z_AXIS, ARG1)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                l1 = arg_lo_ss(T_AXIS, ARG1)
+                DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+                   IF (arg_1(i1,j1,k1,l1) .ne. bad_flag(ARG1)) THEN
+                      result(i,j,k,l) = arg_1(i1,j1,k1,l1)
+                   ELSE
+                      result(i,j,k,l) = bad_flag_result
+                   ENDIF
+                   l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 100            CONTINUE
+                k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 200         CONTINUE
+             j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 300      CONTINUE
+          i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 400   CONTINUE
+       RETURN 
+       
+ 999   CONTINUE
+
+       CALL EF_BAIL_OUT(id, errtxt)
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/external_functions/v5d/Makefile b/external_functions/v5d/Makefile
new file mode 100644
index 0000000..65a5c26
--- /dev/null
+++ b/external_functions/v5d/Makefile
@@ -0,0 +1,58 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#  ACM 2/2001  debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+include v5d_platform_specific_flags.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+V5D_OBJS = binio.o v5d.o
+
+#
+# Rules
+#
+
+.c.o:
+	$(CC) $(V5DFLAGS) $(CFLAGS) -c $<
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $(V5D_OBJS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+all:	binio.o v5d.o writev5d.so
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/v5d/binio.c b/external_functions/v5d/binio.c
new file mode 100644
index 0000000..36ebb34
--- /dev/null
+++ b/external_functions/v5d/binio.c
@@ -0,0 +1,813 @@
+
+/*
+ * Vis5D system for visualizing five dimensional gridded data sets.
+ * Copyright (C) 1990 - 2000 Bill Hibbard, Johan Kellum, Brian Paul,
+ * Dave Santek, and Andre Battaiola.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * As a special exception to the terms of the GNU General Public
+ * License, you are permitted to link Vis5D with (and distribute the
+ * resulting source and executables) the LUI library (copyright by
+ * Stellar Computer Inc. and licensed for distribution with Vis5D),
+ * the McIDAS library, and/or the NetCDF library, where those
+ * libraries are governed by the terms of their own licenses.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include "config.h"
+
+/*
+ * Functions to do binary I/O of floats, ints.
+ *
+ * >>>> These functions are built on top of Unix I/O functions, not stdio! <<<<
+ *
+ * The file format is assumed to be BIG-ENDIAN.
+ * If the configure script detects a little endian
+ * CPU then byte-swapping will be done.  
+ *
+ * If an ANSI compiler is used prototypes and ANSI function declarations
+ * are used.  Otherwise use K&R conventions.
+ *
+ * If we're running on a CRAY (8-byte ints and floats), conversions will
+ * be done as needed.
+ */
+
+
+/*
+ * Updates:
+ *
+ * April 13, 1995, brianp
+ *   added cray_to_ieee and iee_to_cray array conversion functions.
+ *   fixed potential cray bug in write_float4_array function.
+ *
+ */
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef _CRAY
+#  include <string.h>
+#endif
+#include "binio.h"
+
+
+
+
+/**********************************************************************/
+/******                     Byte Flipping                         *****/
+/**********************************************************************/
+
+
+#define FLIP4( n )  (  (n & 0xff000000) >> 24     \
+                     | (n & 0x00ff0000) >> 8      \
+                     | (n & 0x0000ff00) << 8      \
+                     | (n & 0x000000ff) << 24  )
+
+
+#define FLIP2( n )  (((unsigned short) (n & 0xff00)) >> 8  |  (n & 0x00ff) << 8)
+
+
+
+/*
+ * Flip the order of the 4 bytes in an array of 4-byte words.
+ */
+void flip4( const unsigned int *src, unsigned int *dest, int n )
+{
+   int i;
+
+   for (i=0;i<n;i++) {
+      unsigned int tmp = src[i];
+      dest[i] = FLIP4( tmp );
+   }
+}
+
+
+
+/*
+ * Flip the order of the 2 bytes in an array of 2-byte words.
+ */
+void flip2( const unsigned short *src, unsigned short *dest, int n )
+{
+   int i;
+
+   for (i=0;i<n;i++) {
+      unsigned short tmp = src[i];
+      dest[i] = FLIP2( tmp );
+   }
+}
+
+
+#ifdef _CRAY
+/*****************************************************************************
+*
+* The following source code is in the public domain.
+* Specifically, we give to the public domain all rights for future licensing
+* of the source code, all resale rights, and all publishing rights.
+*
+* We ask, but do not require, that the following message be included in all
+* derived works:
+*
+* Portions developed at the National Center for Supercomputing Applications at
+* the University of Illinois at Urbana-Champaign.
+*
+* THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
+* SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
+* WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
+*
+****************************************************************************/
+
+/** THESE ROUTINES MUST BE COMPILED ON THE CRAY ONLY SINCE THEY **/
+/** REQUIRE 8-BYTES PER C-TYPE LONG                             **/
+
+/* Cray to IEEE single precision */
+static void c_to_if( long *t, const long *f)
+{
+    if (*f != 0){
+        *t = (((*f & 0x8000000000000000) |      /* sign bit */
+                 ((((*f & 0x7fff000000000000) >> 48)-16258) << 55)) + /* exp */
+                 (((*f & 0x00007fffff000000) +
+                    ((*f & 0x0000000000800000) << 1)) << 8));  /* mantissa */
+    }
+    else *t = *f;
+}
+
+
+#define C_TO_IF( T, F )							\
+	if (F != 0) {							\
+		T = (((F & 0x8000000000000000) |			\
+		((((F & 0x7fff000000000000) >> 48)-16258) << 55)) +	\
+		(((F & 0x00007fffff000000) +				\
+		((F & 0x0000000000800000) << 1)) << 8));		\
+	}								\
+	else {								\
+		T = F;							\
+	}
+
+
+
+/* IEEE single precison to Cray */
+static void if_to_c( long *t, const long *f)
+{
+    if (*f != 0) {
+        *t = (((*f & 0x8000000000000000) |
+                ((*f & 0x7f80000000000000) >> 7) +
+                (16258 << 48)) |
+                (((*f & 0x007fffff00000000) >> 8) | (0x0000800000000000)));
+        if ((*f << 1) == 0) *t = 0;
+    }
+    else *t = *f;
+}
+
+/* T and F must be longs! */
+#define IF_TO_C( T, F )							\
+	if (F != 0) {							\
+		T = (((F & 0x8000000000000000) |			\
+		((F & 0x7f80000000000000) >> 7) +			\
+		(16258 << 48)) |					\
+		(((F & 0x007fffff00000000) >> 8) | (0x0000800000000000)));  \
+		if ((F << 1) == 0) T = 0;				\
+	}								\
+	else {								\
+		T = F;							\
+	}
+
+
+
+
+/*
+ * Convert an array of Cray 8-byte floats to an array of IEEE 4-byte floats.
+ */
+void cray_to_ieee_array( long *dest, const float *source, int n )
+{
+   long *dst;
+   const long *src;
+   long tmp1, tmp2;
+   int i;
+
+   dst = dest;
+   src = (const long *) source;
+
+   for (i=0;i<n;i+=2) {       /* add 1 in case n is odd */
+      c_to_if( &tmp1, &src[i] );
+      c_to_if( &tmp2, &src[i+1] );
+      *dst = (tmp1 & 0xffffffff00000000) | (tmp2 >> 32);
+      dst++;
+   }
+}
+
+
+
+/*
+ * Convert an array of IEEE 4-byte floats to an array of 8-byte Cray floats.
+ */
+void ieee_to_cray_array( float *dest, const long *source, int n )
+{
+   long *dst;
+   const long *src;
+   int i;
+   long ieee;
+
+   src = source;
+   dst = (long *) dest;
+
+   for (i=0;i<n;i++) {
+      /* most significant 4-bytes of ieee contain bit pattern to convert */
+      if ((i&1)==0) {
+         /* get upper half */
+         ieee = src[i/2] & 0xffffffff00000000;
+      }
+      else {
+         /* get lower half */
+         ieee = src[i/2] << 32;
+      }
+      if_to_c( dst, &ieee );
+      dst++;
+   }
+}
+
+
+#endif /*_CRAY*/
+
+
+
+/**********************************************************************/
+/*****                     Read Functions                         *****/
+/**********************************************************************/
+
+
+/*
+ * Read a block of bytes.
+ *  Input:  f - the file descriptor to read from.
+ *         b - address of buffer to read into.
+ *         n - number of bytes to read.
+ * Return:  number of bytes read, 0 if error.
+ */
+int read_bytes( int f, void *b, int n )
+{
+   return read( f, b, n );
+}
+
+
+
+/*
+ * Read an array of 2-byte integers.
+ * Input:  f - file descriptor
+ *         iarray - address to put integers
+ *         n - number of integers to read.
+ * Return:  number of integers read.
+ */
+int read_int2_array( int f, short *iarray, int n )
+{
+#ifdef _CRAY
+   int i;
+   signed char *buffer;
+   int nread;
+   buffer = (signed char *) malloc( n * 2 );
+   if (!buffer)  return 0;
+   nread = read( f, buffer, n*2 );
+   if (nread<=0)  return 0;
+   nread /= 2;
+   for (i=0;i<nread;i++) {
+      /* don't forget about sign extension! */
+      iarray[i] = (buffer[i*2] * 256) | buffer[i*2+1];
+   }
+   free( buffer );
+   return nread;
+#else
+   int nread = read( f, iarray, n*2 );
+   if (nread<=0)
+      return 0;
+#ifndef WORDS_BIGENDIAN
+   flip2( (const unsigned short *) iarray, (unsigned short *) iarray, nread/2);
+#endif
+   return nread/2;
+#endif
+}
+
+
+
+/*
+ * Read an array of unsigned 2-byte integers.
+ * Input:  f - file descriptor
+ *         iarray - address to put integers
+ *         n - number of integers to read.
+ * Return:  number of integers read.
+ */
+int read_uint2_array( int f, unsigned short *iarray, int n )
+{
+#ifdef _CRAY
+   int i;
+   unsigned char *buffer;
+   int nread;
+   buffer = (unsigned char *) malloc( n * 2 );
+   if (!buffer)  return 0;
+   nread = read( f, buffer, n*2 );
+   if (nread<=0)  return 0;
+   nread /= 2;
+   for (i=0;i<nread;i++) {
+      iarray[i] = (buffer[i*2] << 8) | buffer[i*2+1];
+   }
+   free( buffer );
+   return nread;
+#else
+   int nread = read( f, iarray, n*2 );
+   if (nread<=0)
+      return 0;
+#ifndef WORDS_BIGENDIAN
+   flip2( iarray, iarray, nread/2 );
+#endif
+   return nread/2;
+#endif
+}
+
+
+
+/*
+ * Read a 4-byte integer.
+ * Input:  f - the file descriptor to read from
+ *         i - pointer to integer to put result into.
+ * Return:  1 = ok, 0 = error
+ */
+int read_int4( int f, int *i )
+{
+#ifndef WORDS_BIGENDIAN
+   /* read big endian and convert to little endian */
+   unsigned int n;
+   if (read( f, &n, 4 )==4) {
+      *i = FLIP4( n );
+      return 1;
+   }
+   else {
+      return 0;
+   }
+#else
+   if (read( f, i, 4 )==4) {
+#  ifdef _CRAY
+      *i = *i >> 32;
+#  endif
+      return 1;
+   }
+   else {
+      return 0;
+   }
+#endif
+}
+
+
+
+/*
+ * Read an array of 4-byte integers.
+ * Input:  f - file descriptor
+ *         iarray - address to put integers
+ *         n - number of integers to read.
+ * Return:  number of integers read.
+ */
+int read_int4_array( int f, int *iarray, int n )
+{
+#ifdef _CRAY
+   int j, nread;
+   int *buffer;
+
+   buffer = (int *) malloc( (n+1)*4 );
+   if (!buffer)
+      return 0;
+   nread = read( f, buffer, 4*n );
+   if (nread<=0) {
+      return 0;
+   }
+   nread /= 4;
+
+   for (j=0;j<nread;j++) {
+      if ((j&1)==0) {
+         iarray[j] = buffer[j/2] >> 32;
+      }
+      else {
+         iarray[j] = buffer[j/2] & 0xffffffff;
+      }
+   }
+   free( buffer );
+   return nread;
+#else
+   int nread = read( f, iarray, 4*n );
+   if (nread<=0)
+     return 0;
+#  ifndef WORDS_BIGENDIAN
+      flip4( (const unsigned int *) iarray, (unsigned int *) iarray, nread/4 );
+#  endif
+   return nread/4;
+#endif
+}
+
+
+
+/*
+ * Read a 4-byte IEEE float.
+ * Input:  f - the file descriptor to read from.
+ *         x - pointer to float to put result into.
+ * Return:  1 = ok, 0 = error
+ */
+int read_float4( int f, float *x )
+{
+#ifdef _CRAY
+   long buffer = 0;
+
+   if ( read( f, &buffer, 4 )==4 ) {
+      /* convert IEEE float (buffer) to Cray float (x) */
+      if_to_c( (long *) x, &buffer );
+      return 1;
+    }
+    return 0;
+#else
+#  ifndef WORDS_BIGENDIAN
+      unsigned int n, *iptr;
+      if (read( f, &n, 4 )==4) {
+         iptr = (unsigned int *) x;
+         *iptr = FLIP4( n );
+         return 1;
+      }
+      else {
+         return 0;
+      }
+#  else
+      if (read( f, x, 4 )==4) {
+         return 1;
+      }
+      else {
+         return 0;
+      }
+#  endif
+#endif
+}
+
+
+
+/*
+ * Read an array of 4-byte IEEE floats.
+ * Input:  f - file descriptor
+ *         x - address to put floats
+ *         n - number of floats to read.
+ * Return:  number of floats read.
+ */
+int read_float4_array( int f, float *x, int n )
+{
+#ifdef _CRAY
+   /* read IEEE floats into buffer, then convert to Cray format */
+   long *buffer;
+   int i, nread;
+
+   buffer = (long *) malloc( (n+1) * 4 );
+   if (!buffer) return 0;
+   nread = read( f, buffer, n*4 );
+   if (nread<=0)  return 0;
+   nread /= 4;
+   ieee_to_cray_array( x, buffer, nread );
+   free( buffer );
+   return nread;
+#else
+   int nread = read( f, x, 4*n );
+   if (nread<=0)
+      return 0;
+#ifndef WORDS_BIGENDIAN
+   flip4( (const unsigned int *) x, (unsigned int*) x, nread/4 );
+#endif
+   return nread/4;
+#endif
+}
+
+
+
+/*
+ * Read a block of memory.
+ * Input:  f - file descriptor
+ *         data - address of first byte
+ *         elements - number of elements to read
+ *         elsize - size of each element to read (1, 2 or 4)
+ * Return: number of elements written
+ */
+int read_block( int f, void *data, int elements, int elsize )
+{
+   if (elsize==1) {
+      return read( f, data, elements );
+   }
+   else if (elsize==2) {
+#ifndef WORDS_BIGENDIAN
+      int n;
+      n = read( f, data, elements*2 ) / 2;
+      if (n==elements) {
+         flip2( (const unsigned short *) data, (unsigned short *) data,
+                elements );
+      }
+      return n;
+#else
+      return read( f, data, elements*2 ) / 2;
+#endif
+   }
+   else if (elsize==4) {
+#ifndef WORDS_BIGENDIAN
+      int n;
+      n = read( f, data, elements*4 ) / 4;
+      if (n==elements) {
+         flip4( (const unsigned int *) data, (unsigned int *) data, elements );
+      }
+      return n;
+#else
+      return read( f, data, elements*4 ) / 4;
+#endif
+   }
+   else {
+      printf("Fatal error in read_block(): bad elsize (%d)\n", elsize );
+      abort();
+   }
+   return 0;
+}
+
+
+
+
+/**********************************************************************/
+/*****                         Write Functions                    *****/
+/**********************************************************************/
+
+
+
+/*
+ * Write a block of bytes.
+ * Input:  f - the file descriptor to write to.
+ *         b - address of buffer to write.
+ *         n - number of bytes to write.
+ * Return:  number of bytes written, 0 if error.
+ */
+int write_bytes( int f, const void *b, int n )
+{
+   return write( f, b, n );
+}
+
+
+
+
+/*
+ * Write an array of 2-byte integers.
+ * Input:  f - file descriptor
+ *         iarray - address to put integers
+ *         n - number of integers to write.
+ * Return:  number of integers written
+ */
+int write_int2_array( int f, const short *iarray, int n )
+{
+#ifdef _CRAY
+   printf("write_int2_array not implemented!\n");
+   exit(1);
+#else
+   int nwritten;
+#ifndef WORDS_BIGENDIAN
+   flip2( (const unsigned short *) iarray, (unsigned short *) iarray, n );
+#endif
+   nwritten = write( f, iarray, 2*n );
+#ifndef WORDS_BIGENDIAN
+   flip2( (const unsigned short *) iarray, (unsigned short *) iarray, n );
+#endif
+   if (nwritten<=0)
+      return 0;
+   return nwritten/2;
+#endif
+}
+
+
+
+/*
+ * Write an array of 2-byte unsigned integers.
+ * Input:  f - file descriptor
+ *         iarray - address to put integers
+ *         n - number of integers to write.
+ * Return:  number of integers written
+ */
+int write_uint2_array( int f, const unsigned short *iarray, int n )
+{
+#ifdef _CRAY
+   int i, nwritten;
+   unsigned char *buffer;
+   buffer = (unsigned char *) malloc( 2*n );
+   if (!buffer)  return 0;
+   for (i=0;i<n;i++) {
+      buffer[i*2] = (iarray[i] >> 8) & 0xff;
+      buffer[i*2+1] = iarray[i] & 0xff;
+   }
+   nwritten = write( f, buffer, 2*n );
+   free( buffer );
+   if (nwritten<=0)
+      return 0;
+   else
+      return nwritten/2;
+#else
+   int nwritten;
+#ifndef WORDS_BIGENDIAN
+   flip2( iarray, (unsigned short *) iarray, n );
+#endif
+   nwritten = write( f, iarray, 2*n );
+#ifndef WORDS_BIGENDIAN
+   flip2( iarray, (unsigned short *) iarray, n );
+#endif
+   if (nwritten<=0)
+      return 0;
+   else
+      return nwritten/2;
+#endif
+}
+
+
+
+/*
+ * Write a 4-byte integer.
+ *Input:  f - the file descriptor
+ *         i - the integer
+ * Return:  1 = ok, 0 = error
+ */
+int write_int4( int f, int i )
+{
+#ifdef _CRAY
+   i = i << 32;
+   return write( f, &i, 4 ) > 0;
+#else
+#  ifndef WORDS_BIGENDIAN
+     i = FLIP4( i );
+#  endif
+   return write( f, &i, 4 ) > 0;
+#endif
+}
+
+
+
+/*
+ * Write an array of 4-byte integers.
+ * Input:  f - the file descriptor
+ *         i - the array of ints
+ *           n - the number of ints in array
+ *  Return:  number of integers written.
+ */
+int write_int4_array( int f, const int *i, int n )
+{
+#ifdef _CRAY
+   int j, nwritten;
+   char *buf, *b, *ptr;
+
+   b = buf = (char *) malloc( n*4 + 8 );
+   if (!b)
+      return 0;
+   ptr = (char *) i;
+   for (j=0;j<n;j++) {
+      ptr += 4;      /* skip upper 4 bytes */
+      *b++ = *ptr++;
+      *b++ = *ptr++;
+      *b++ = *ptr++;
+      *b++ = *ptr++;
+   }
+   nwritten = write( f, buf, 4*n );
+   free( buf );
+   if (nwritten<=0)
+      return 0;
+   else
+      return nwritten / 4;
+#else
+#  ifndef WORDS_BIGENDIAN
+      int nwritten;
+      flip4( (const unsigned int *) i, (unsigned int *) i, n );
+      nwritten = write( f, i, 4*n );
+      flip4( (const unsigned int *) i, (unsigned int *) i, n );
+      if (nwritten<=0)
+         return 0;
+      else
+        return nwritten / 4;
+#  else
+      return write( f, i, 4*n ) / 4;
+#  endif
+#endif
+}
+
+
+
+/*
+ * Write a 4-byte IEEE float.
+ * Input:  f - the file descriptor
+ *         x - the float
+ * Return:  1 = ok, 0 = error
+ */
+int write_float4( int f, float x )
+{
+#ifdef _CRAY
+   char buffer[8];
+   c_to_if( (long *) buffer, (const long *) &x );
+   return write( f, buffer, 4 ) > 0;
+#else
+#  ifndef WORDS_BIGENDIAN
+      float y;
+      unsigned int *iptr = (unsigned int *) &y, temp;
+      y = (float) x;
+      temp = FLIP4( *iptr );
+      return write( f, &temp, 4 ) > 0;
+#  else
+      float y;
+      y = (float) x;
+      return write( f, &y, 4 ) > 0;
+#  endif
+#endif
+}
+
+
+
+/*
+ * Write an array of 4-byte IEEE floating point numbers.
+ * Input:  f - the file descriptor
+ *         x - the array of floats
+ *         n - number of floats in array
+ * Return:  number of float written.
+ */
+int write_float4_array( int f, const float *x, int n )
+{
+#ifdef _CRAY
+   /* convert cray floats to IEEE and put into buffer */
+   int nwritten;
+   long *buffer;
+   buffer = (long *) malloc( n*4 + 8 );
+   if (!buffer)
+      return 0;
+   cray_to_ieee_array( buffer, x, n );
+   nwritten = write( f, buffer, 4*n );
+   free( buffer );
+   if (nwritten<=0)
+      return 0;
+   else
+      return nwritten / 4;
+#else
+#  ifndef WORDS_BIGENDIAN
+      int nwritten;
+      flip4( (const unsigned int *) x, (unsigned int *) x, n );
+      nwritten = write( f, x, 4*n );
+      flip4( (const unsigned int *) x, (unsigned int *) x, n );
+      if (nwritten<=0)
+         return 0;
+      else 
+         return nwritten / 4;
+#  else
+      return write( f, x, 4*n ) / 4;
+#  endif
+#endif
+}
+
+
+
+/*
+ * Write a block of memory.
+ * Input:  f - file descriptor
+ *         data - address of first byte
+ *         elements - number of elements to write
+ *         elsize - size of each element to write (1, 2 or 4)
+ * Return: number of elements written
+ */
+int write_block( int f, const void *data, int elements, int elsize )
+{
+   if (elsize==1) {
+      return write( f, data, elements );
+   }
+   else if (elsize==2) {
+#ifndef WORDS_BIGENDIAN
+      int n;
+      flip2( (const unsigned short *) data, (unsigned short *) data, elements);
+      n = write( f, data, elements*2 ) / 2;
+      flip2( (const unsigned short *) data, (unsigned short *) data, elements);
+      return n;
+#else
+      return write( f, data, elements*2 ) / 2;
+#endif
+   }
+   else if (elsize==4) {
+#ifndef WORDS_BIGENDIAN
+      int n;
+      flip4( (const unsigned int *) data, (unsigned int *) data, elements );
+      n = write( f, data, elements*4 ) / 4;
+      flip4( (const unsigned int *) data, (unsigned int *) data, elements );
+      return n;
+#else
+      return write( f, data, elements*4 ) / 4;
+#endif
+   }
+   else {
+      printf("Fatal error in write_block(): bad elsize (%d)\n", elsize );
+      abort();
+   }
+   return 0;
+}
diff --git a/external_functions/v5d/binio.h b/external_functions/v5d/binio.h
new file mode 100644
index 0000000..c250cfb
--- /dev/null
+++ b/external_functions/v5d/binio.h
@@ -0,0 +1,109 @@
+/*
+ * Vis5D system for visualizing five dimensional gridded data sets.
+ * Copyright (C) 1990 - 2000 Bill Hibbard, Johan Kellum, Brian Paul,
+ * Dave Santek, and Andre Battaiola.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * As a special exception to the terms of the GNU General Public
+ * License, you are permitted to link Vis5D with (and distribute the
+ * resulting source and executables) the LUI library (copyright by
+ * Stellar Computer Inc. and licensed for distribution with Vis5D),
+ * the McIDAS library, and/or the NetCDF library, where those
+ * libraries are governed by the terms of their own licenses.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+/*
+ * Functions to do binary I/O of floats, ints, etc. with byte swapping
+ * as needed.
+ */
+
+
+#ifndef BINIO_H
+#define BINIO_H
+
+
+/* Include files which define SEEK_SET, O_RD_ONLY, etc. */
+/* and prototype open(), close(), lseek(), etc. */
+#include <unistd.h>
+#include <fcntl.h>
+
+/* SGJ: use extern "C" if included from a C++ file: */
+#ifdef __cplusplus
+extern "C" {
+#endif				/* __cplusplus */
+
+extern void flip4( const unsigned int *src, unsigned int *dest, int n );
+
+extern void flip2( const unsigned short *src, unsigned short *dest, int n );
+
+
+#ifdef _CRAY
+  extern void cray_to_ieee_array( long *dest, const float *source, int n );
+  extern void ieee_to_cray_array( float *dest, const long *source, int n );
+#endif
+
+
+/**********************************************************************/
+/*****                     Read Functions                         *****/
+/**********************************************************************/
+
+
+extern int read_bytes( int f, void *b, int n );
+
+extern int read_int2_array( int f, short *iarray, int n );
+
+extern int read_uint2_array( int f, unsigned short *iarray, int n );
+
+extern int read_int4( int f, int *i );
+
+extern int read_int4_array( int f, int *iarray, int n );
+
+extern int read_float4( int f, float *x );
+
+extern int read_float4_array( int f, float *x, int n );
+
+extern int read_block( int f, void *data, int elements, int elsize );
+
+
+
+/**********************************************************************/
+/*****                         Write Functions                    *****/
+/**********************************************************************/
+
+
+extern int write_bytes( int f, const void *b, int n );
+
+extern int write_int2_array( int f, const short *iarray, int n );
+
+extern int write_uint2_array( int f, const unsigned short *iarray, int n );
+
+extern int write_int4( int f, int i );
+
+extern int write_int4_array( int f, const int *iarray, int n );
+
+extern int write_float4( int f, float x );
+
+extern int write_float4_array( int f, const float *x, int n );
+
+extern int write_block( int f, const void *data, int elements, int elsize );
+
+#ifdef __cplusplus
+}                               /* extern "C" */
+#endif				/* __cplusplus */
+
+#endif
diff --git a/external_functions/v5d/config.h b/external_functions/v5d/config.h
new file mode 100644
index 0000000..800ffd4
--- /dev/null
+++ b/external_functions/v5d/config.h
@@ -0,0 +1,325 @@
+/* config.h.  Generated automatically by configure.  */
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to installed location of Vis5d data files. */
+#define DATA_PREFIX "/usr/local/share/vis5d+/"
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#define ENABLE_NLS 1
+
+/* Define to dummy `main' function (if any) required to link to the Fortran 77
+   libraries. */
+/* #undef F77_DUMMY_MAIN */
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+#define F77_FUNC(name,INTL) name ## _
+
+/* As F77_FUNC, but for C identifiers containing underscores. */
+#define F77_FUNC_(name,INTL) name ## __
+
+/* Define if you have `alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#define HAVE_ALLOCA_H 1
+
+/* Define if you have the <argz.h> header file. */
+#define HAVE_ARGZ_H 1
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+#define HAVE_DCGETTEXT 1
+
+/* Define if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the `feof_unlocked' function. */
+#define HAVE_FEOF_UNLOCKED 1
+
+/* Define if you have the `fgets_unlocked' function. */
+#define HAVE_FGETS_UNLOCKED 1
+
+/* Define if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the `getc_unlocked' function. */
+#define HAVE_GETC_UNLOCKED 1
+
+/* Define if you have the `getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define if you have the `getgid' function. */
+#define HAVE_GETGID 1
+
+/* Define if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#define HAVE_GETTEXT 1
+
+/* Define if you have the `getuid' function. */
+#define HAVE_GETUID 1
+
+/* Define if you have the <GL/gl.h> header file. */
+#define HAVE_GL_GL_H 1
+
+/* Define if you have the iconv() function. */
+#define HAVE_ICONV 1
+
+/* Do we have Fortran idate function? */
+/* #undef HAVE_IDATE */
+
+/* Define if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#define HAVE_LANGINFO_CODESET 1
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#define HAVE_LC_MESSAGES 1
+
+/* Define if you have the <libintl.h> header file. */
+#define HAVE_LIBINTL_H 1
+
+/* Define if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+/* Define if you have the `mcidas_lib' library (-lmcidas_lib). */
+/* #undef HAVE_LIBMCIDAS_LIB */
+
+/* Do we have NetCDF library? */
+#define HAVE_LIBNETCDF 1
+
+/* Define if you have the `png' library (-lpng). */
+#define HAVE_LIBPNG 1
+
+/* Have Tcl library? */
+/* #undef HAVE_LIBTCL */
+
+/* Define if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Do we have McIDAS library? */
+/* #undef HAVE_MCIDAS */
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the `mempcpy' function. */
+#define HAVE_MEMPCPY 1
+
+/* Do we have mixkit library? */
+/* #undef HAVE_MIXKIT */
+
+/* Define if you have the <mixkit/mixio.h> header file. */
+/* #undef HAVE_MIXKIT_MIXIO_H */
+
+/* Define if you have a working `mmap' system call. */
+#define HAVE_MMAP 1
+
+/* Define if you have the `munmap' function. */
+#define HAVE_MUNMAP 1
+
+/* Define if you have the <netcdf.h> header file. */
+#define HAVE_NETCDF_H 1
+
+/* Define if you have the <nl_types.h> header file. */
+#define HAVE_NL_TYPES_H 1
+
+/* Define if we have OpenGL libraries. */
+#define HAVE_OPENGL 1
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef HAVE_PTHREAD */
+
+/* Have POSIX threads? */
+/* #undef HAVE_PTHREADS */
+
+/* Define if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define if you have the `setenv' function. */
+#define HAVE_SETENV 1
+
+/* Define if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define if you have the `setrlimit' function. */
+#define HAVE_SETRLIMIT 1
+
+/* Define if we have SGI GL libraries. */
+/* #undef HAVE_SGI_GL */
+
+/* Have SGI sproc? */
+/* #undef HAVE_SGI_SPROC */
+
+/* Define if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the `stpcpy' function. */
+#define HAVE_STPCPY 1
+
+/* Define if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Have SunOS threads? */
+/* #undef HAVE_SUNOS_THREADS */
+
+/* Define if you have the <sysmp.h> header file. */
+/* #undef HAVE_SYSMP_H */
+
+/* Define if you have the <sys/lock.h> header file. */
+/* #undef HAVE_SYS_LOCK_H */
+
+/* Define if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define if you have the <sys/prctl.h> header file. */
+#define HAVE_SYS_PRCTL_H 1
+
+/* Define if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define if you have the <sys/sysmp.h> header file. */
+/* #undef HAVE_SYS_SYSMP_H */
+
+/* Define if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if you have the `tsearch' function. */
+#define HAVE_TSEARCH 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <X11/Xm/MwmUtil.h> header file. */
+/* #undef HAVE_X11_XM_MWMUTIL_H */
+
+/* Define if you have the `XMesaGetBackBuffer' function. */
+/* #undef HAVE_XMESAGETBACKBUFFER */
+
+/* Define if you have the `__argz_count' function. */
+#define HAVE___ARGZ_COUNT 1
+
+/* Define if you have the `__argz_next' function. */
+#define HAVE___ARGZ_NEXT 1
+
+/* Define if you have the `__argz_stringify' function. */
+#define HAVE___ARGZ_STRINGIFY 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST 
+
+/* path to Image Magick convert program */
+#define IMCONVERT "/usr/bin/convert"
+
+/* Have McIDAS sidecar? */
+/* #undef MCIDAS_SIDECAR */
+
+/* Name of package */
+#define PACKAGE "vis5d+"
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+   your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* Define to disable multi-threading. */
+#define SINGLE_TASK 1
+
+/* The size of a `float', as computed by sizeof. */
+#define SIZEOF_FLOAT 4
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `signed char', as computed by sizeof. */
+#define SIZEOF_SIGNED_CHAR 1
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.3.0-beta"
+
+/* directory containing message catalogs */
+#define VIS5D_LOCALE_DIR "/usr/local/share/locale"
+
+/* max. memory to use (MB), 0 for no maximum */
+#define VIS5D_MAX_MEM 0
+
+/* where the source was built */
+#define VIS5D_SOURCE_DIR "/home/porter/ansley/external_functions/v5d/vis5d+-1.3.0-beta"
+
+/* Define if your processor stores words with the most significant byte first
+   (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define if the X Window System is missing or not being used. */
+/* #undef X_DISPLAY_MISSING */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+/* #undef inline */
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
diff --git a/external_functions/v5d/v5d.c b/external_functions/v5d/v5d.c
new file mode 100644
index 0000000..6b59ed5
--- /dev/null
+++ b/external_functions/v5d/v5d.c
@@ -0,0 +1,3298 @@
+/* v5d.c */
+
+
+/*
+ * Vis5D system for visualizing five dimensional gridded data sets.
+ * Copyright (C) 1990 - 2000 Bill Hibbard, Johan Kellum, Brian Paul,
+ * Dave Santek, and Andre Battaiola.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * As a special exception to the terms of the GNU General Public
+ * License, you are permitted to link Vis5D with (and distribute the
+ * resulting source and executables) the LUI library (copyright by
+ * Stellar Computer Inc. and licensed for distribution with Vis5D),
+ * the McIDAS library, and/or the NetCDF library, where those
+ * libraries are governed by the terms of their own licenses.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ 
+Note: Ansley Manke 10/98. Ferret-external-functions version of this file, with 
+MAXVARS changed to MAX_V5_VARS. Make the same change in v5d.h, v5d.c, and 
+v5df_fer.h
+
+ */
+
+#include "config.h"
+
+
+/* this should be updated when the file version changes */
+#define FILE_VERSION "4.3"
+
+
+
+/*
+ * New grid file format for Vis5d:
+ *
+ * The header is a list of tagged items.  Each item has 3 parts:
+ *    1. A tag which is a 4-byte integer identifying the type of item.
+ *    2. A 4-byte integer indicating how many bytes of data follow.
+ *    3. The binary data.
+ *
+ * If we need to add new information to a file header we just create a
+ * new tag and add the code to read/write the information.
+ *
+ * If we're reading a header and find an unknown tag, we can use the
+ * length field to skip ahead to the next tag.  Therefore, the file
+ * format is forward (and backward) compatible.
+ *
+ * Grid data is stored as either:
+ *     1-byte unsigned integers  (255=missing)
+ *     2-byte unsigned integers  (65535=missing)
+ *     4-byte IEEE floats        ( >1.0e30 = missing) 
+ *
+ * All numeric values are stored in big endian order.  All floating point
+ * values are in IEEE format.
+ */
+
+
+
+/*
+ * Updates:
+ *
+ * April 13, 1995, brianp
+ *   finished Cray support for 2-byte and 4-byte compress modes
+ */
+
+
+
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "binio.h"
+#include "v5d.h"
+#include "vis5d.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#  include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#  include <fcntl.h>
+#endif
+
+#ifndef SEEK_SET
+#  define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+#  define SEEK_CUR 1
+#endif
+#ifndef SEEK_END
+#  define SEEK_END 2
+#endif
+
+
+
+/*
+ * Currently defined tags:
+ * Note:  the notation a[i] doesn't mean a is an array of i elements,
+ * rather it just refers to the ith element of a[].
+ *
+ * Tags marked as PHASED OUT should be readable but are no longer written.
+ * Old tag numbers can't be reused!
+ * 
+ */
+
+
+/*      TAG NAME        VALUE       DATA (comments)                     */
+/*----------------------------------------------------------------------*/
+#define TAG_ID          0x5635440a  /* hex encoding of "V5D\n"          */
+
+/* general stuff 1000+ */
+#define TAG_VERSION     1000        /* char*10 FileVersion              */
+#define TAG_NUMTIMES    1001        /* int*4 NumTimes                   */
+#define TAG_NUMVARS     1002        /* int*4 NumVars                    */
+#define TAG_VARNAME     1003        /* int*4 var; char*10 VarName[var]  */
+
+#define TAG_NR          1004        /* int*4 Nr                         */ 
+#define TAG_NC          1005        /* int*4 Nc                         */
+#define TAG_NL          1006        /* int*4 Nl  (Nl for all vars)      */
+#define TAG_NL_VAR      1007        /* int*4 var; int*4 Nl[var]         */
+#define TAG_LOWLEV_VAR  1008        /* int*4 var; int*4 LowLev[var]     */
+
+#define TAG_TIME        1010        /* int*4 t;  int*4 TimeStamp[t]     */
+#define TAG_DATE        1011        /* int*4 t;  int*4 DateStamp[t]     */
+
+#define TAG_MINVAL      1012        /* int*4 var;  real*4 MinVal[var]   */
+#define TAG_MAXVAL      1013        /* int*4 var;  real*4 MaxVal[var]   */
+
+#define TAG_COMPRESS    1014        /* int*4 CompressMode; (#bytes/grid)*/
+
+#define TAG_UNITS       1015        /* int *4 var; char*20 Units[var]   */
+
+/* vertical coordinate system 2000+ */
+#define TAG_VERTICAL_SYSTEM 2000    /* int*4 VerticalSystem             */
+#define TAG_VERT_ARGS    2100       /* int*4 n;  real*4 VertArgs[0..n-1]*/
+
+#define TAG_BOTTOMBOUND  2001       /* real*4 BottomBound     (PHASED OUT)  */
+#define TAG_LEVINC       2002       /* real*4 LevInc      (PHASED OUT)      */
+#define TAG_HEIGHT       2003    /* int*4 l;  real*4 Height[l] (PHASED OUT) */
+
+
+/* projection 3000+ */
+#define TAG_PROJECTION   3000       /* int*4 projection:                    */
+                                    /*   0 = generic linear                 */
+                                    /*   1 = cylindrical equidistant        */
+                                    /*   2 = Lambert conformal/Polar Stereo */
+                                    /*   3 = rotated equidistant            */
+#define TAG_PROJ_ARGS    3100       /* int *4 n;  real*4 ProjArgs[0..n-1]   */
+
+#define TAG_NORTHBOUND   3001       /* real*4 NorthBound       (PHASED OUT) */
+#define TAG_WESTBOUND    3002       /* real*4 WestBound        (PHASED OUT) */
+#define TAG_ROWINC       3003       /* real*4 RowInc           (PHASED OUT) */
+#define TAG_COLINC       3004       /* real*4 ColInc           (PHASED OUT) */
+#define TAG_LAT1         3005       /* real*4 Lat1             (PHASED OUT) */
+#define TAG_LAT2         3006       /* real*4 Lat2             (PHASED OUT) */
+#define TAG_POLE_ROW     3007       /* real*4 PoleRow          (PHASED OUT) */
+#define TAG_POLE_COL     3008       /* real*4 PoleCol          (PHASED OUT) */
+#define TAG_CENTLON      3009       /* real*4 CentralLon       (PHASED OUT) */
+#define TAG_CENTLAT      3010       /* real*4 CentralLat       (PHASED OUT) */
+#define TAG_CENTROW      3011       /* real*4 CentralRow       (PHASED OUT) */
+#define TAG_CENTCOL      3012       /* real*4 CentralCol       (PHASED OUT) */
+#define TAG_ROTATION     3013       /* real*4 Rotation         (PHASED OUT) */
+#define TAG_ROWINCKM     3014       /* real*4 RowIncKm         (PHASED OUT) */
+#define TAG_COLINCKM     3015       /* real*4 ColIncKm         (PHASED OUT) */
+
+
+#define TAG_END                9999
+
+
+
+
+
+
+/**********************************************************************/
+/*****                  Miscellaneous Functions                   *****/
+/**********************************************************************/
+
+
+float pressure_to_height(float pressure)
+{
+  return (float) DEFAULT_LOG_EXP * log((double) pressure / DEFAULT_LOG_SCALE);
+}
+
+float height_to_pressure(float height)
+{
+  return (float) DEFAULT_LOG_SCALE * exp((double) height / DEFAULT_LOG_EXP);
+}
+
+
+/*
+ * Return current file position.
+ * Input:  f - file descriptor
+ */
+static off_t ltell( int f )
+{
+   return lseek( f, 0, SEEK_CUR );
+}
+
+
+/*
+ * Copy up to maxlen characters from src to dst stopping upon whitespace
+ * in src.  Terminate dst with null character.
+ * Return:  length of dst.
+ */
+static int copy_string2( char *dst, const char *src, int maxlen )
+{
+   int i;
+
+   for (i=0;i<maxlen;i++) dst[i] = src[i];
+   for (i=maxlen-1; i>=0; i--) {
+     if (dst[i]==' ' || i==maxlen-1) dst[i] = 0;
+     else break;
+   }
+   return strlen(dst);
+}
+
+
+
+/*
+ * Copy up to maxlen characters from src to dst stopping upon whitespace
+ * in src.  Terminate dst with null character.
+ * Return:  length of dst.
+ */
+static int copy_string( char *dst, const char *src, int maxlen )
+{
+   int i;
+
+   for (i=0;i<maxlen;i++) {
+      if (src[i]==' ' || i==maxlen-1) {
+         dst[i] = 0;
+         break;
+      }
+      else {
+         dst[i] = src[i];
+      }
+   }
+   return i;
+}
+
+
+
+/*
+ * Convert a date from YYDDD format to days since Dec 31, 1899,
+ * which was Sunday, so it's easy to calculate a weekday.
+ */
+int v5dYYDDDtoDays( int yyddd )
+{
+   int iy, id, idays;
+
+   iy = yyddd / 1000;
+   id = yyddd - 1000*iy;
+   if (iy >= 1900)
+     iy -= 1900;
+   else if (iy < 50)
+     iy += 100; /* WLH 31 July 96 << 31 Dec 99 */
+   idays = 365*iy + (iy-1)/4 - (iy-1)/100 + (iy+299)/400 + id;
+
+   return idays;
+}
+
+
+/*
+ * Convert a time from HHMMSS format to seconds since midnight.
+ */
+int v5dHHMMSStoSeconds( int hhmmss )
+{
+   int h, m, s;
+
+   h = hhmmss / 10000;
+   m = (hhmmss / 100) % 100;
+   s = hhmmss % 100;
+
+   return s + m*60 + h*60*60;
+}
+
+
+
+/*
+ * Convert a day since Dec 31, 1899 to YYDDD format.
+ */
+int v5dDaysToYYDDD( int days )
+{
+   int iy, id, iyyddd;
+   int leaps;
+
+   /*
+     Julian day starts from 1, it is easier to calculate from 0
+   */
+   days--;
+
+   /*
+     Every 400 years is a leap year.
+     400 years have 97 leap years.
+     We start at 1900, so add 300 years first.
+     300 years have 72 leap years.
+   */
+   leaps = (days+(300*365+72))/(400*365+97);
+
+   /*
+     Every 100 years is not a leap year.
+     100 years have 24 leap years.
+   */
+   leaps -= (days-leaps)/(365*100+24);
+
+   /*
+     4 years have 1 leap year.
+    */
+   leaps += (days-leaps)/(365*4+1);
+
+   iy = (days-leaps) / 365;
+   id = days-leaps-365*iy + 1;
+   iyyddd = (iy+1900)*1000+id;
+
+   return iyyddd;
+}
+
+
+/*
+ * Convert a time in seconds since midnight to HHMMSS format.
+ */
+int v5dSecondsToHHMMSS( int seconds )
+{
+   int hh, mm, ss;
+
+   hh = seconds / (60*60);
+   mm = (seconds / 60) % 60;
+   ss = seconds % 60;
+   return hh*10000 + mm * 100 + ss;
+}
+
+
+
+
+void v5dPrintStruct( const v5dstruct *v )
+{
+   static char day[7][10] = { "Sunday", "Monday", "Tuesday", "Wednesday",
+                              "Thursday", "Friday", "Saturday" };
+   int time, var, i;
+   int maxnl;
+
+   maxnl = 0;
+   for (var=0;var<v->NumVars;var++) {
+      if (v->Nl[var]+v->LowLev[var]>maxnl) {
+         maxnl = v->Nl[var]+v->LowLev[var];
+      }
+   }
+
+   if (v->FileFormat==0) {
+      if (v->FileVersion[0] == 0) {
+        printf("File format: v5d  version: (4.0 or 4.1)\n");
+      }
+      else {
+        printf("File format: v5d  version: %s\n", v->FileVersion);
+      }
+   }
+   else {
+      printf("File format: comp5d  (Vis5d 3.3 or older)\n");
+   }
+
+   if (v->CompressMode==1) {
+      printf("Compression:  1 byte per gridpoint.\n");
+   }
+   else {
+      printf("Compression:  %d bytes per gridpoint.\n", v->CompressMode);
+   }
+   printf("header size=%d\n", v->FirstGridPos);
+   printf("sizeof(v5dstruct)=%d\n", (int) sizeof(v5dstruct) );
+   printf("\n");
+
+   printf("NumVars = %d\n", v->NumVars );
+
+   printf("Var  Name       Units      Rows  Cols  Levels LowLev  MinVal       MaxVal\n");
+   for (var=0;var<v->NumVars;var++) {
+      printf("%3d  %-10s %-10s %3d   %3d   %3d    %3d",
+             var+1, v->VarName[var], v->Units[var],
+             v->Nr, v->Nc, v->Nl[var], v->LowLev[var] );
+      if (v->MinVal[var] > v->MaxVal[var]) {
+         printf("     MISSING      MISSING\n");
+      }
+      else {
+         printf("     %-12g %-12g\n", v->MinVal[var], v->MaxVal[var] );
+      }
+   }
+
+   printf("\n");
+
+   printf("NumTimes = %d\n", v->NumTimes );
+   printf("Step    Date(YYYYDDD)    Time(HH:MM:SS)   Day\n");
+   for (time=0;time<v->NumTimes;time++) {
+      int i = v->TimeStamp[time];
+      printf("%3d        %7d       %5d:%02d:%02d     %s\n",
+             time+1,
+             v->DateStamp[time],
+             i/10000, (i/100)%100, i%100,
+             day[ v5dYYDDDtoDays(v->DateStamp[time]) % 7 ]);
+   }
+   printf("\n");
+
+   switch (v->VerticalSystem) {
+      case 0:
+         printf("Generic linear vertical coordinate system:\n");
+         printf("\tBottom Bound: %f\n", v->VertArgs[0] );
+         printf("\tIncrement between levels:  %f\n", v->VertArgs[1] );
+         break;
+      case 1:
+         printf("Equally spaced levels in km:\n");
+         printf("\tBottom Bound: %f\n", v->VertArgs[0] );
+         printf("\tIncrement: %f\n", v->VertArgs[1] );
+         break;
+      case 2:
+         printf("Unequally spaced levels in km:\n");
+         printf("Level\tHeight(km)\n");
+         for (i=0;i<maxnl;i++) {
+            printf("%3d\t%-15.8f\n", i+1, v->VertArgs[i] );
+         }
+         break;
+      case 3:
+         printf("Unequally spaced levels in mb:\n");
+         printf("Level\tPressure(mb)\n");
+         for (i=0;i<maxnl;i++) {
+            printf("%3d\t%-15.8f\n", i+1, height_to_pressure(v->VertArgs[i]) );
+         }
+         break;
+      default:
+         printf("Bad VerticalSystem value: %d\n", v->VerticalSystem );
+   }
+   printf("\n");
+
+   switch (v->Projection) {
+      case 0:
+         printf("Generic linear projection:\n");
+         printf("\tNorth Boundary: %f\n", v->ProjArgs[0] );
+         printf("\tWest Boundary: %f\n", v->ProjArgs[1] );
+         printf("\tRow Increment: %f\n", v->ProjArgs[2] );
+         printf("\tColumn Increment: %f\n", v->ProjArgs[3] );
+         break;
+      case 1:
+         printf("Cylindrical Equidistant projection:\n");
+         printf("\tNorth Boundary: %f degrees\n", v->ProjArgs[0] );
+         printf("\tWest Boundary: %f degrees\n", v->ProjArgs[1] );
+         printf("\tRow Increment: %f degrees\n", v->ProjArgs[2] );
+         printf("\tColumn Increment: %f degrees\n", v->ProjArgs[3] );
+/*
+         printf("\tSouth Boundary: %f degrees\n",
+                v->NorthBound - v->RowInc * (v->Nr-1) );
+         printf("\tEast Boundary: %f degrees\n",
+                v->WestBound - v->ColInc * (v->Nc-1) );
+*/
+         break;
+      case 2:
+         printf("Lambert Conformal projection:\n");
+         printf("\tStandard Latitude 1: %f\n", v->ProjArgs[0] );
+         printf("\tStandard Latitude 2: %f\n", v->ProjArgs[1] );
+         printf("\tNorth/South Pole Row: %f\n", v->ProjArgs[2] );
+         printf("\tNorth/South Pole Column: %f\n", v->ProjArgs[3] );
+         printf("\tCentral Longitude: %f\n", v->ProjArgs[4] );
+         printf("\tColumn Increment: %f km\n", v->ProjArgs[5] );
+         break;
+      case 3:
+         printf("Stereographic:\n");
+         printf("\tCenter Latitude: %f\n", v->ProjArgs[0] );
+         printf("\tCenter Longitude: %f\n", v->ProjArgs[1] );
+         printf("\tCenter Row: %f\n", v->ProjArgs[2] );
+         printf("\tCenter Column: %f\n", v->ProjArgs[3] );
+         printf("\tColumn Spacing: %f\n", v->ProjArgs[4] );
+         break;
+      case 4:
+         /* WLH 4-21-95 */
+         printf("Rotated equidistant projection:\n");
+         printf("\tLatitude of grid(0,0): %f\n", v->ProjArgs[0] );
+         printf("\tLongitude of grid(0,0): %f\n", v->ProjArgs[1] );
+         printf("\tRow Increment: %f degress\n", v->ProjArgs[2] );
+         printf("\tColumn Increment: %f degrees\n", v->ProjArgs[3] );
+         printf("\tCenter Latitude: %f\n", v->ProjArgs[4] );
+         printf("\tCenter Longitude: %f\n", v->ProjArgs[5] );
+         printf("\tRotation: %f degrees\n", v->ProjArgs[6] );
+         break;
+      case 5:
+         printf("Mercator:\n");
+         printf("\tCenter Latitude: %f\n", v->ProjArgs[0] );
+         printf("\tCenter Longitude: %f\n", v->ProjArgs[1] );
+         printf("\tRow Increment: %f Kilometers\n", v->ProjArgs[2] );
+         printf("\tCol Increment: %f Kilometers\n", v->ProjArgs[3] );
+         break;
+      /* ZLB 02-09-2000 */
+      case -1:
+         printf("Generic unequally spaced projection:\n");
+         printf("Column\tPosition\n");
+         for (i=0;i<v->Nc;i++) {
+            printf("%3d\t%-15.8f\n", i+1, v->ProjArgs[i+v->Nr] );
+         }
+         printf("Row\tPosition\n");
+         for (i=0;i<v->Nr;i++) {
+            printf("%3d\t%-15.8f\n", i+1, v->ProjArgs[i] );
+         }
+         break;
+      default:
+         printf("Bad projection number: %d\n", v->Projection );
+   }
+}
+
+
+
+/*
+ * Compute the location of a compressed grid within a file.
+ * Input:  v - pointer to v5dstruct describing the file header.
+ *         time, var - which timestep and variable.
+ * Return:  file offset in bytes
+ */
+static int grid_position( const v5dstruct *v, int time, int var )
+{
+   int pos, i;
+
+   assert( time >= 0 );
+   assert( var >= 0 );
+   assert( time < v->NumTimes );
+   assert( var < v->NumVars );
+
+   pos = v->FirstGridPos + time * v->SumGridSizes;
+   for (i=0;i<var;i++) {
+      pos += v->GridSize[i];
+   }
+
+   return pos;
+}
+
+
+
+/*
+ * Compute the ga and gb (de)compression values for a grid.
+ * Input:  nr, nc, nl - size of grid
+ *         data - the grid data
+ *         ga, gb - arrays to store results.
+ *         minval, maxval - pointer to floats to return min, max values
+ *         compressmode - 1, 2 or 4 bytes per grid point
+ * Output:  ga, gb - the (de)compression values
+ *          minval, maxval - the min and max grid values
+ * Side effect:  the MinVal[var] and MaxVal[var] fields in g may be
+ *               updated with new values.
+ */
+static void compute_ga_gb( int nr, int nc, int nl, 
+                           const float data[], int compressmode,
+                           float ga[], float gb[],
+                           float *minval, float *maxval )
+{
+#ifdef SIMPLE_COMPRESSION
+   /*
+    * Compute ga, gb values for whole grid.
+    */
+   int i, lev, allmissing, num;
+   float min, max, a, b;
+
+   min = 1.0e30;
+   max = -1.0e30;
+   num = nr * nc * nl;
+   allmissing = 1;
+   for (i=0;i<num;i++) {
+      if (!IS_MISSING(data[i])) {
+         if (data[i]<min)  min = data[i];
+         if (data[i]>max)  max = data[i];
+         allmissing = 0;
+      }
+   }
+   if (allmissing) {
+      a = 1.0;
+      b = 0.0;
+   }
+   else {
+      a = (max-min) / 254.0;
+      b = min;
+   }
+
+   /* return results */
+   for (i=0;i<nl;i++) {
+      ga[i] = a;
+      gb[i] = b;
+   }
+
+   *minval = min;
+   *maxval = max;
+#else
+   /*
+    * Compress grid on level-by-level basis.
+    */
+#  define SMALLVALUE -1.0e30
+#  define BIGVALUE 1.0e30
+#  define ABS(x)   ( ((x) < 0.0) ? -(x) : (x) )
+   float gridmin, gridmax;
+   float levmin[MAXLEVELS], levmax[MAXLEVELS];
+   float d[MAXLEVELS], dmax;
+   float ival, mval;
+   int j, k, lev, nrnc;
+
+   nrnc = nr * nc;
+
+   /* find min and max for each layer and the whole grid */
+   gridmin = BIGVALUE;
+   gridmax = SMALLVALUE;
+   j = 0;
+
+
+   for (lev=0;lev<nl;lev++) {
+      float min, max;
+      min = BIGVALUE;
+      max = SMALLVALUE;
+      for (k=0;k<nrnc;k++) {
+         if (!IS_MISSING(data[j]) && data[j]<min)
+            min = data[j];
+         if (!IS_MISSING(data[j]) && data[j]>max)
+            max = data[j];
+         j++;
+      }
+
+      if (min<gridmin)
+        gridmin = min;
+      if (max>gridmax)
+        gridmax = max;
+      levmin[lev] = min;
+      levmax[lev] = max;
+   }
+
+/* WLH 2-2-95 */
+#ifdef KLUDGE
+   /* if the grid minimum is within delt of 0.0, fudge all values */
+   /* within delt of 0.0 to delt, and recalculate mins and maxes */
+   {
+      float delt;
+      int nrncnl = nrnc * nl;
+
+      delt = (gridmax - gridmin)/100000.0;
+      if ( ABS(gridmin) < delt && gridmin!=0.0 && compressmode != 4 ) {
+         float min, max;
+         for (j=0; j<nrncnl; j++) {
+            if (!IS_MISSING(data[j]) && data[j]<delt)
+              data[j] = delt;
+         }
+         /* re-calculate min and max for each layer and the whole grid */
+         gridmin = delt;
+         for (lev=0;lev<nl;lev++) {
+            if (ABS(levmin[lev]) < delt)
+              levmin[lev] = delt;
+            if (ABS(levmax[lev]) < delt)
+              levmax[lev] = delt;
+         }
+      }
+   }
+#endif
+
+   /* find d[lev] and dmax = MAX( d[0], d[1], ... d[nl-1] ) */
+   dmax = 0.0;
+   for (lev=0;lev<nl;lev++) {
+      if (levmin[lev]>=BIGVALUE && levmax[lev]<=SMALLVALUE) {
+         /* all values in the layer are MISSING */
+         d[lev] = 0.0;
+      }
+      else {
+         d[lev] = levmax[lev]-levmin[lev];
+      }
+      if (d[lev]>dmax)
+         dmax = d[lev];
+   }
+
+   /*** Compute ga (scale) and gb (bias) for each grid level */
+   if (dmax==0.0) {
+      /*** Special cases ***/
+      if (gridmin==gridmax) {
+         /*** whole grid is of same value ***/
+         for (lev=0; lev<nl; lev++) {
+            ga[lev] = gridmin;
+            gb[lev] = 0.0;
+         }
+      }
+      else {
+         /*** every layer is of a single value ***/
+         for (lev=0; lev<nl; lev++) {
+            ga[lev] = levmin[lev];
+            gb[lev] = 0.0;
+         }
+      }
+   }
+   else {
+      /*** Normal cases ***/
+      if (compressmode == 1) {
+#define ORIGINAL
+#ifdef ORIGINAL
+         ival = dmax / 254.0;
+         mval = gridmin;
+
+         for (lev=0; lev<nl; lev++) {
+            ga[lev] = ival;
+            /* WLH 2 Aug 2000 */
+            if (levmin[lev] > levmax[lev]) {
+              gb[lev] = 0.0;
+            }
+            else {
+              gb[lev] = mval + ival * (int) ( (levmin[lev]-mval) / ival ); 
+            }
+         }
+#else
+         for (lev=0; lev<nl; lev++) {
+            if (d[lev]==0.0) {
+               ival = 1.0;
+            }
+            else {
+               ival = d[lev] / 254.0;
+            }
+            ga[lev] = ival;
+            gb[lev] = levmin[lev];
+         }
+#endif
+      }
+      else if (compressmode == 2) {
+         ival = dmax / 65534.0;
+         mval = gridmin;
+
+         for (lev=0; lev<nl; lev++) {
+            ga[lev] = ival;
+            /* WLH 2 Aug 2000 */
+            if (levmin[lev] > levmax[lev]) {
+              gb[lev] = 0.0;
+            }
+            else {
+              gb[lev] = mval + ival * (int) ( (levmin[lev]-mval) / ival ); 
+            }
+         }
+      }
+      else {
+         assert( compressmode==4 );
+         for (lev=0; lev<nl; lev++) {
+            ga[lev] = 1.0;
+            gb[lev] = 0.0;
+         }
+      }
+   }
+
+   /* update min, max values */
+   *minval = gridmin;
+   *maxval = gridmax;
+#endif
+}
+
+
+
+
+/*
+ * Compress a 3-D grid from floats to 1-byte unsigned integers.
+ * Input: nr, nc, nl - size of grid
+ *        compressmode - 1, 2 or 4 bytes per grid point
+ *        data - array of [nr*nc*nl] floats
+ *        compdata - pointer to array of [nr*nc*nl*compressmode] bytes
+ *                   to put results into.
+ *        ga, gb - pointer to arrays to put ga and gb decompression values
+ *        minval, maxval - pointers to float to return min & max values
+ * Output:  compdata - the compressed grid data
+ *          ga, gb - the decompression values
+ *          minval, maxval - the min and max grid values
+ */
+void v5dCompressGrid( int nr, int nc, int nl, int compressmode,
+                      const float data[],
+                      void *compdata, float ga[], float gb[],
+                      float *minval, float *maxval )
+{
+   int nrnc = nr * nc;
+   int nrncnl = nr * nc * nl;
+   V5Dubyte *compdata1 = (V5Dubyte *) compdata;
+   V5Dushort *compdata2 = (V5Dushort *) compdata;
+
+   /* compute ga, gb values */
+   compute_ga_gb( nr, nc, nl, data, compressmode, ga, gb, minval, maxval );
+
+   /* compress the data */
+   if (compressmode==1) {
+      int i, lev, p;
+      p = 0;
+      for (lev=0;lev<nl;lev++) {
+         float one_over_a, b;
+/* WLH 5 Nov 98
+         b = gb[lev] - 0.0001;
+*/
+         /* WLH 5 Nov 98 */
+         b = gb[lev];
+                                /* subtract an epsilon so the int((d-b)/a) */
+                                /* expr below doesn't get mis-truncated. */
+         if (ga[lev]==0.0) {
+            one_over_a = 1.0;
+         }
+         else {
+            one_over_a = 1.0 / ga[lev];
+         }
+         for (i=0;i<nrnc;i++,p++) {
+            if (IS_MISSING(data[p])) {
+               compdata1[p] = 255;
+            }
+            else {
+/* MJK 1.19.99
+               compdata1[p] = (V5Dubyte) (int) ((data[p]-b) * one_over_a);
+*/
+               compdata1[p] = (V5Dubyte) rint((data[p]-b) * one_over_a);
+               if (compdata1[p] >= 255){
+                  compdata1[p] = (V5Dubyte) (int) (255.0 - .0001);
+               }
+            }
+         }
+      }
+   }
+
+   else if (compressmode == 2) {
+      int i, lev, p;
+      p = 0;
+      for (lev=0;lev<nl;lev++) {
+         float one_over_a, b;
+/* WLH 5 Nov 98
+         b = gb[lev] - 0.0001;
+*/
+         /* WLH 5 Nov 98 */
+         b = gb[lev];
+
+         if (ga[lev]==0.0) {
+            one_over_a = 1.0;
+         }
+         else {
+            one_over_a = 1.0 / ga[lev];
+         }
+#ifdef _CRAY
+         /* this is tricky because sizeof(V5Dushort)==8, not 2 */
+         for (i=0;i<nrnc;i++,p++) {
+            V5Dushort compvalue;
+            if (IS_MISSING(data[p])) {
+               compvalue = 65535;
+            }
+            else {
+/* MJK 3.2.99
+               compvalue = (V5Dushort) (int) ((data[p]-b) * one_over_a);
+*/
+               compvalue = (V5Dushort) rint((data[p]-b) * one_over_a);
+            }
+            compdata1[p*2+0] = compvalue >> 8;     /* upper byte */
+            compdata1[p*2+1] = compvalue & 0xffu;  /* lower byte */
+         }
+#else
+         for (i=0;i<nrnc;i++,p++) {
+            if (IS_MISSING(data[p])) {
+               compdata2[p] = 65535;
+            }
+            else {
+               compdata2[p] = (V5Dushort) rint((data[p]-b) * one_over_a);
+
+/*
+               compdata2[p] = (V5Dushort) (int) ((data[p]-b) * one_over_a);
+*/
+/* MJK 3.24.99 I put this here so if the value is close
+   to the missing value and get's rounded up it won't come out
+   as missing data */
+               if (compdata2[p] == 65535){
+                  compdata2[p] = 65534;
+               }
+            }
+         }
+         /* TODO: byte-swapping on little endian??? */
+#endif
+      }
+   }
+
+   else {
+      /* compressmode==4 */
+#ifdef _CRAY
+      cray_to_ieee_array( compdata, data, nrncnl );
+#else
+      /* other machines: just copy 4-byte IEEE floats */
+      assert( sizeof(float)==4 );
+      memcpy( compdata, data, nrncnl*4 );
+      /* TODO: byte-swapping on little endian??? */
+#endif
+   }
+}
+
+
+
+/*
+ * Decompress a 3-D grid from 1-byte integers to 4-byte floats.
+ * Input:  nr, nc, nl - size of grid
+ *         compdata - array of [nr*nr*nl*compressmode] bytes
+ *         ga, gb - arrays of decompression factors
+ *         compressmode - 1, 2 or 4 bytes per grid point
+ *         data - address to put decompressed values
+ * Output:  data - uncompressed floating point data values
+ */
+void v5dDecompressGrid( int nr, int nc, int nl, int compressmode,
+                        void *compdata, float ga[], float gb[],
+                        float data[] )
+{
+   int nrnc = nr * nc;
+   int nrncnl = nr * nc * nl;
+   V5Dubyte *compdata1 = (V5Dubyte *) compdata;
+   V5Dushort *compdata2 = (V5Dushort *) compdata;
+
+   if (compressmode == 1) {
+      int p, i, lev;
+      p = 0;
+      for (lev=0;lev<nl;lev++) {
+         float a = ga[lev];
+         float b = gb[lev];
+
+         /* WLH 2-2-95 */
+         float d, aa;
+         int id;
+         if (a > 0.0000000001) {
+           d = b / a;
+           id = floor(d);
+           d = d - id;
+           aa = a * 0.000001;
+         }
+         else {
+           id = 1;
+         }
+         if (-254 <= id && id <= 0 && d < aa) {
+           for (i=0;i<nrnc;i++,p++) {
+              if (compdata1[p]==255) {
+                 data[p] = MISSING;
+              }
+              else {
+                 data[p] = (float) (int) compdata1[p] * a + b;
+                 if (fabs(data[p]) < aa) data[p] = aa;
+              }
+           }
+         }
+         else {
+           for (i=0;i<nrnc;i++,p++) {
+              if (compdata1[p]==255) {
+                 data[p] = MISSING;
+              }
+              else {
+                 data[p] = (float) (int) compdata1[p] * a + b;
+              }
+           }
+         }
+         /* end of WLH 2-2-95 */
+      }
+   }
+
+   else if (compressmode == 2) {
+      int p, i, lev;
+      p = 0;
+      for (lev=0;lev<nl;lev++) {
+         float a = ga[lev];
+         float b = gb[lev];
+#ifdef _CRAY
+         /* this is tricky because sizeof(V5Dushort)==8, not 2 */
+         for (i=0;i<nrnc;i++,p++) {
+            int compvalue;
+            compvalue = (compdata1[p*2] << 8) | compdata1[p*2+1];
+            if (compvalue==65535) {
+               data[p] = MISSING;
+            }
+            else {
+               data[p] = (float) compvalue * a + b;
+            }
+         }
+#else
+         /* sizeof(V5Dushort)==2! */
+         for (i=0;i<nrnc;i++,p++) {
+            if (compdata2[p]==65535) {
+               data[p] = MISSING;
+            }
+            else {
+               data[p] = (float) (int) compdata2[p] * a + b;
+            }
+         }
+#endif
+      }
+   }
+
+   else {
+      /* compressmode==4 */
+#ifdef _CRAY
+      ieee_to_cray_array( data, compdata, nrncnl );
+#else
+      /* other machines: just copy 4-byte IEEE floats */
+      assert( sizeof(float)==4 );
+      memcpy( data, compdata, nrncnl*4 );
+#endif
+   }
+}
+
+
+
+
+/*
+ * Return the size (in bytes) of the 3-D grid specified by time and var.
+ * Input:  v - pointer to v5dstruct describing the file
+ *         time, var - which timestep and variable
+ * Return:  number of data points.
+ */
+int v5dSizeofGrid( const v5dstruct *v, int time, int var )
+{
+   return v->Nr * v->Nc * v->Nl[var] * v->CompressMode;
+}
+
+
+
+/*
+ * Initialize a v5dstructure to reasonable initial values.
+ * Input:  v - pointer to v5dstruct.
+ */
+void v5dInitStruct( v5dstruct *v )
+{
+   int i;
+
+   /* set everything to zero */
+   memset( v, 0, sizeof(v5dstruct) );
+
+   /* special cases */
+   v->Projection = -1;
+   v->VerticalSystem = -1;
+
+   for (i=0;i<MAX_V5_VARS;i++) {
+      v->MinVal[i] = MISSING;
+      v->MaxVal[i] = -MISSING;
+      v->LowLev[i] = 0;
+   }
+
+   /* set file version */
+   strcpy(v->FileVersion, FILE_VERSION);
+
+   v->CompressMode = 1;
+   v->FileDesc = -1;
+}
+
+
+
+/*
+ * Return a pointer to a new, initialized v5dstruct.
+ */
+v5dstruct *v5dNewStruct( void )
+{
+   v5dstruct *v;
+
+   v = (v5dstruct *) malloc( sizeof(v5dstruct) );
+   if (v) {
+      v5dInitStruct(v);
+   }
+   return v;
+}
+
+
+
+/*
+ * Free an initialized v5dstruct. (Todd Plessel)
+ */
+void v5dFreeStruct( v5dstruct* v )
+{
+   /*assert( v5dVerifyStruct( v ) );*/
+   free( v );
+   v = 0;
+}
+
+
+
+/*
+ * Do some checking that the information in a v5dstruct is valid.
+ * Input:  v - pointer to v5dstruct
+ * Return:  1 = g is ok, 0 = g is invalid
+ */
+int v5dVerifyStruct( const v5dstruct *v )
+{
+   int var, i, invalid, maxnl;
+
+   invalid = 0;
+
+   if (!v)
+      return 0;
+
+   /* Number of variables */
+   if (v->NumVars<0) {
+      printf("Invalid number of variables: %d\n", v->NumVars );
+      invalid = 1;
+   }
+   else if (v->NumVars>MAX_V5_VARS) {
+      printf("Too many variables: %d  (Maximum is %d)\n",
+             v->NumVars, MAX_V5_VARS);
+      invalid = 1;
+   }
+
+   /* Variable Names */
+   for (i=0;i<v->NumVars;i++) {
+      if (v->VarName[i][0]==0) {
+         printf("Missing variable name: VarName[%d]=\"\"\n", i );
+         invalid = 1;
+      }
+   }
+
+   /* Number of timesteps */
+   if (v->NumTimes<0) {
+      printf("Invalid number of timesteps: %d\n", v->NumTimes );
+      invalid = 1;
+   }
+   else if (v->NumTimes>MAXTIMES) {
+      printf("Too many timesteps: %d  (Maximum is %d)\n",
+             v->NumTimes, MAXTIMES );
+      invalid = 1;
+   }
+
+   /* Make sure timestamps are increasing */
+   for (i=1;i<v->NumTimes;i++) {
+      int date0 = v5dYYDDDtoDays( v->DateStamp[i-1] );
+      int date1 = v5dYYDDDtoDays( v->DateStamp[i] );
+      int time0 = v5dHHMMSStoSeconds( v->TimeStamp[i-1] );
+      int time1 = v5dHHMMSStoSeconds( v->TimeStamp[i] );
+      if (date1<date0 || (time1<=time0 && date1==date0)) {
+         printf("Timestamp for step %d must be later than step %d\n", i, i-1);
+         invalid = 1;
+      }
+   }
+
+   /* Rows */
+   if (v->Nr<2) {
+      printf("Too few rows: %d (2 is minimum)\n", v->Nr );
+      invalid = 1;
+   }
+   else if (v->Nr>MAXROWS) {
+      printf("Too many rows: %d (%d is maximum)\n", v->Nr, MAXROWS );
+      invalid = 1;
+   }
+
+   /* Columns */
+   if (v->Nc<2) {
+      printf("Too few columns: %d (2 is minimum)\n", v->Nc );
+      invalid = 1;
+   }
+   else if (v->Nc>MAXCOLUMNS) {
+      printf("Too many columns: %d (%d is maximum)\n", v->Nc, MAXCOLUMNS );
+      invalid = 1;
+   }
+
+   /* Levels */
+   maxnl = 0;
+   for (var=0;var<v->NumVars;var++) {
+      if (v->LowLev[var] < 0) {
+         printf("Low level cannot be negative for var %s: %d\n",
+                 v->VarName[var], v->LowLev[var] );
+         invalid = 1;
+      }
+      if (v->Nl[var]<1) {
+         printf("Too few levels for var %s: %d (1 is minimum)\n",
+                 v->VarName[var], v->Nl[var] );
+         invalid = 1;
+      }
+      if (v->Nl[var]+v->LowLev[var]>MAXLEVELS) {
+         printf("Too many levels for var %s: %d (%d is maximum)\n",
+                 v->VarName[var], v->Nl[var]+v->LowLev[var], MAXLEVELS );
+         invalid = 1;
+      }
+      if (v->Nl[var]+v->LowLev[var]>maxnl) {
+         maxnl = v->Nl[var]+v->LowLev[var];
+      }
+   }
+
+   if (v->CompressMode != 1 && v->CompressMode != 2 && v->CompressMode != 4) {
+      printf("Bad CompressMode: %d (must be 1, 2 or 4)\n", v->CompressMode );
+      invalid = 1;
+   }
+
+   switch (v->VerticalSystem) {
+      case 0:
+      case 1:
+         if (v->VertArgs[1]==0.0) {
+            printf("Vertical level increment is zero, must be non-zero\n");
+            invalid = 1;
+         }
+         break;
+      case 2:
+         /* Check that Height values increase upward */
+         for (i=1;i<maxnl;i++) {
+            if (v->VertArgs[i] <= v->VertArgs[i-1]) {
+               printf("Height[%d]=%f <= Height[%d]=%f, level heights must increase\n",
+                      i, v->VertArgs[i], i-1, v->VertArgs[i-1] );
+               invalid = 1;
+               break;
+            }
+         }
+         break;
+      case 3:
+         /* Check that Pressure values decrease upward */
+         for (i=1;i<maxnl;i++) {
+            if (v->VertArgs[i] <= v->VertArgs[i-1]) {
+               printf("Pressure[%d]=%f >= Pressure[%d]=%f, level pressures must decrease\n",
+                      i, height_to_pressure(v->VertArgs[i]),
+                      i-1, height_to_pressure(v->VertArgs[i-1]) );
+               invalid = 1;
+               break;
+            }
+         }
+         break;
+      default:
+         printf("VerticalSystem = %d, must be in 0..3\n", v->VerticalSystem );
+         invalid = 1;
+   }
+
+
+   switch (v->Projection) {
+      case 0:  /* Generic */
+         if (v->ProjArgs[2]==0.0) {
+            printf("Row Increment (ProjArgs[2]) can't be zero\n");
+            invalid = 1;
+         }
+         if (v->ProjArgs[3]==0.0) {
+            printf("Column increment (ProjArgs[3]) can't be zero\n");
+            invalid = 1;
+         }
+         break;
+      case 1:  /* Cylindrical equidistant */
+         if (v->ProjArgs[2]<0.0) {
+            printf("Row Increment (ProjArgs[2]) = %g  (must be >=0.0)\n",
+                   v->ProjArgs[2] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[3]<=0.0) {
+            printf("Column Increment (ProjArgs[3]) = %g  (must be >=0.0)\n",
+                   v->ProjArgs[3] );
+            invalid = 1;
+         }
+         break;
+      case 2:  /* Lambert Conformal */
+         if (v->ProjArgs[0]<-90.0 || v->ProjArgs[0]>90.0) {
+            printf("Lat1 (ProjArgs[0]) out of range: %g\n", v->ProjArgs[0] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[1]<-90.0 || v->ProjArgs[1]>90.0) {
+            printf("Lat2 (ProjArgs[1] out of range: %g\n", v->ProjArgs[1] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[5]<=0.0) {
+            printf("ColInc (ProjArgs[5]) = %g  (must be >=0.0)\n",
+                   v->ProjArgs[5] );
+            invalid = 1;
+         }
+         break;
+      case 3:  /* Stereographic */
+         if (v->ProjArgs[0]<-90.0 || v->ProjArgs[0]>90.0) {
+            printf("Central Latitude (ProjArgs[0]) out of range: ");
+            printf("%g  (must be in +/-90)\n", v->ProjArgs[0] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[1]<-180.0 || v->ProjArgs[1]>180.0) {
+            printf("Central Longitude (ProjArgs[1]) out of range: ");
+            printf("%g  (must be in +/-180)\n", v->ProjArgs[1] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[4]<0) {
+            printf("Column spacing (ProjArgs[4]) = %g  (must be positive)\n",
+                   v->ProjArgs[4]);
+            invalid = 1;
+         }
+         break;
+      case 4:  /* Rotated */
+         /* WLH 4-21-95 */
+         if (v->ProjArgs[2]<=0.0) {
+            printf("Row Increment (ProjArgs[2]) = %g  (must be >=0.0)\n",
+                   v->ProjArgs[2] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[3]<=0.0) {
+            printf("Column Increment = (ProjArgs[3]) %g  (must be >=0.0)\n",
+                   v->ProjArgs[3] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[4]<-90.0 || v->ProjArgs[4]>90.0) {
+            printf("Central Latitude (ProjArgs[4]) out of range: ");
+            printf("%g  (must be in +/-90)\n", v->ProjArgs[4] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[5]<-180.0 || v->ProjArgs[5]>180.0) {
+            printf("Central Longitude (ProjArgs[5]) out of range: ");
+            printf("%g  (must be in +/-180)\n", v->ProjArgs[5] );
+            invalid = 1;
+         }
+         if (v->ProjArgs[6]<-180.0 || v->ProjArgs[6]>180.0) {
+            printf("Central Longitude (ProjArgs[6]) out of range: ");
+            printf("%g  (must be in +/-180)\n", v->ProjArgs[6] );
+            invalid = 1;
+         }
+         break;
+      case 5: /*Mercator*/
+         if (v->ProjArgs[2] == 0.0){
+            printf("Row Increment(Km) can not be 0.0\n");
+            invalid = 1;
+         }
+         if (v->ProjArgs[3] == 0.0){
+            printf("Column Increment(Km) can not be 0.0\n");
+            invalid = 1;
+         }
+         break;
+      /* ZLB 02-09-2000 */
+      case -1:  /* Generic non equally spaced */
+         for (i=1;i<v->Nr;i++) {
+            if (v->ProjArgs[i] <= v->ProjArgs[i-1]) {
+               printf("Row[%d]=%f >= Row[%d]=%f, row coordinates must increase\n",
+                      i, v->ProjArgs[i], i-1, v->ProjArgs[i-1] );
+               invalid = 1;
+               break;
+            }
+         }
+         if (invalid) break;
+         for (i=v->Nr+1;i<v->Nr+v->Nc;i++) {
+            if (v->ProjArgs[i] <= v->ProjArgs[i-1]) {
+               printf("Column[%d]=%f >= Column[%d]=%f, Column coordinates must increase\n",
+                      i-v->Nr, v->ProjArgs[i], i-v->Nr-1, v->ProjArgs[i-1] );
+               invalid = 1;
+               break;
+            }
+         }
+         break;
+      default:
+         printf("Projection = %d, must be in -1..5\n", v->Projection);
+         invalid = 1;
+   }
+
+   return !invalid;
+}
+
+
+
+/*
+ * Get the McIDAS file number and grid number associated with the grid
+ * identified by time and var.
+ * Input:  v - v5d grid struct
+ *         time, var - timestep and variable of grid
+ * Output:  mcfile, mcgrid - McIDAS grid file number and grid number
+ */
+int v5dGetMcIDASgrid( v5dstruct *v, int time, int var,
+                      int *mcfile, int *mcgrid )
+{
+   if (time<0 || time>=v->NumTimes) {
+      printf("Bad time argument to v5dGetMcIDASgrid: %d\n", time );
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Bad var argument to v5dGetMcIDASgrid: %d\n", var );
+      return 0;
+   }
+
+   *mcfile = (int) v->McFile[time][var];
+   *mcgrid = (int) v->McGrid[time][var];
+   return 1;
+}
+
+
+
+/*
+ * Set the McIDAS file number and grid number associated with the grid
+ * identified by time and var.
+ * Input:  v - v5d grid struct
+ *         time, var - timestep and variable of grid
+ *         mcfile, mcgrid - McIDAS grid file number and grid number
+ * Return:  1 = ok, 0 = error (bad time or var)
+ */
+int v5dSetMcIDASgrid( v5dstruct *v, int time, int var,
+                      int mcfile, int mcgrid )
+{
+   if (time<0 || time>=v->NumTimes) {
+      printf("Bad time argument to v5dSetMcIDASgrid: %d\n", time );
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Bad var argument to v5dSetMcIDASgrid: %d\n", var );
+      return 0;
+   }
+
+   v->McFile[time][var] = (short) mcfile;
+   v->McGrid[time][var] = (short) mcgrid;
+   return 1;
+}
+
+
+
+/**********************************************************************/
+/*****                    Input Functions                         *****/
+/**********************************************************************/
+
+
+
+/*
+ * Read the header from a COMP* file and return results in the v5dstruct.
+ * Input:  f - the file descriptor
+ *         v - pointer to a v5dstruct.
+ * Return:  1 = ok, 0 = error.
+ */
+static int read_comp_header( int f, v5dstruct *v )
+{
+   unsigned int id;
+
+   /* reset file position to start of file */
+   lseek( f, 0, SEEK_SET );
+
+   /* read file ID */
+   read_int4( f, (int *) &id );
+
+   if (id==0x80808080 || id==0x80808081) {
+      /* Older COMP5D format */
+      int gridtimes, gridparms;
+      int i, j, it, iv, nl;
+      int gridsize;
+      float hgttop, hgtinc;
+      /*char *compgrid;*/
+
+      if (id==0x80808080) {
+         /* 20 vars, 300 times */
+         gridtimes = 300;
+         gridparms = 20;
+      }
+      else {
+         /* 30 vars, 400 times */
+         gridtimes = 400;
+         gridparms = 30;
+      }
+
+      v->FirstGridPos = 12*4 + 8*gridtimes + 4*gridparms;
+
+      read_int4( f, &v->NumTimes );
+      read_int4( f, &v->NumVars );
+      read_int4( f, &v->Nr );
+      read_int4( f, &v->Nc );
+      read_int4( f, &nl );
+      for (i=0;i<v->NumVars;i++) {
+         v->Nl[i] = nl;
+         v->LowLev[i] = 0;
+      }
+      read_float4( f, &v->ProjArgs[0] );
+      read_float4( f, &v->ProjArgs[1] );
+      read_float4( f, &hgttop );
+      read_float4( f, &v->ProjArgs[2] );
+      read_float4( f, &v->ProjArgs[3] );
+      read_float4( f, &hgtinc );
+/*
+      for (i=0;i<nl;i++) {
+         v->Height[nl-i-1] = hgttop - i * hgtinc;
+      }
+*/
+      v->VerticalSystem = 1;
+      v->VertArgs[0] = hgttop - hgtinc * (nl-1);
+      v->VertArgs[1] = hgtinc;
+
+      /* read dates and times */
+      for (i=0;i<gridtimes;i++) {
+         read_int4( f, &j );
+         v->DateStamp[i] = v5dDaysToYYDDD( j );
+      }
+      for (i=0;i<gridtimes;i++) {
+         read_int4( f, &j );
+         v->TimeStamp[i] = v5dSecondsToHHMMSS( j );
+      }
+
+      /* read variable names */
+      for (i=0;i<gridparms;i++) {
+         char name[4];
+         read_bytes( f, name, 4 );
+         /* remove trailing spaces, if any */
+         for (j=3;j>0;j--) {
+            if (name[j]==' ' || name[j]==0)
+              name[j] = 0;
+            else
+              break;
+         }
+         strncpy( v->VarName[i], name, 4 );
+         v->VarName[i][4] = 0;
+      }
+
+      gridsize = ( (v->Nr * v->Nc * nl + 3) / 4) * 4;
+      for (i=0;i<v->NumVars;i++) {
+         v->GridSize[i] = 8 + gridsize;
+      }
+      v->SumGridSizes = (8+gridsize) * v->NumVars;
+
+      /* read the grids and their ga,gb values to find min and max values */
+
+      for (i=0;i<v->NumVars;i++) {
+         v->MinVal[i] = 999999.9;
+         v->MaxVal[i] = -999999.9;
+      }
+
+      /*compgrid = (char *) malloc( gridsize );*/
+
+      for (it=0; it<v->NumTimes; it++) {
+         for (iv=0; iv<v->NumVars; iv++) {
+            float ga, gb;
+            float min, max;
+
+            read_float4( f, &ga );
+            read_float4( f, &gb );
+
+            /* skip ahead by 'gridsize' bytes */
+            if (lseek( f, gridsize, SEEK_CUR )==-1) {
+               printf("Error:  Unexpected end of file, ");
+               printf("file may be corrupted.\n");
+               return 0;
+            }
+            min = -(125.0+gb)/ga;
+            max = (125.0-gb)/ga;
+            if (min<v->MinVal[iv])  v->MinVal[iv] = min;
+            if (max>v->MaxVal[iv])  v->MaxVal[iv] = max;
+         }
+      }
+
+      /*free( compgrid );*/
+
+      /* done */
+   }
+   else if (id==0x80808082 || id==0x80808083) {
+      /* Newer COMP5D format */
+      int gridtimes, gridsize;
+      int it, iv, nl, i, j;
+      float delta;
+
+      read_int4( f, &gridtimes );
+      read_int4( f, &v->NumVars );
+      read_int4( f, &v->NumTimes );
+      read_int4( f, &v->Nr );
+      read_int4( f, &v->Nc );
+      read_int4( f, &nl );
+      for (i=0;i<v->NumVars;i++) {
+         v->Nl[i] = nl;
+      }
+
+      read_float4( f, &v->ProjArgs[2] );
+      read_float4( f, &v->ProjArgs[3] );
+
+      /* Read height and determine if equal spacing */
+      v->VerticalSystem = 1;
+      for (i=0;i<nl;i++) {
+         read_float4( f, &v->VertArgs[i] );
+         if (i==1) {
+            delta = v->VertArgs[1] - v->VertArgs[0];
+         }
+         else if (i>1) {
+            if (delta != (v->VertArgs[i] - v->VertArgs[i-1])) {
+               v->VerticalSystem = 2;
+            }
+         }
+      }
+      if (v->VerticalSystem==1) {
+         v->VertArgs[1] = delta;
+      }
+
+      /* read variable names */
+      for (iv=0; iv<v->NumVars; iv++) {
+         char name[8];
+
+         read_bytes( f, name, 8 );
+
+         /* remove trailing spaces, if any */
+         for (j=7;j>0;j--) {
+            if (name[j]==' ' || name[j]==0)
+              name[j] = 0;
+            else
+              break;
+         }
+         strncpy( v->VarName[iv], name, 8 );
+         v->VarName[iv][8] = 0;
+      }
+
+      for (iv=0;iv<v->NumVars;iv++) {
+         read_float4( f, &v->MinVal[iv] );
+      }
+      for (iv=0;iv<v->NumVars;iv++) {
+         read_float4( f, &v->MaxVal[iv] );
+      }
+      for (it=0;it<gridtimes;it++) {
+         read_int4( f, &j );
+         v->TimeStamp[it] = v5dSecondsToHHMMSS( j );
+      }
+      for (it=0;it<gridtimes;it++) {
+         read_int4( f, &j );
+         v->DateStamp[it] = v5dDaysToYYDDD( j );
+      }
+      for (it=0;it<gridtimes;it++) {
+         float nlat;
+         read_float4( f, &nlat );
+         if (it==0)  v->ProjArgs[0] = nlat;
+      }
+      for (it=0;it<gridtimes;it++) {
+         float wlon;
+         read_float4( f, &wlon );
+         if (it==0)  v->ProjArgs[1] = wlon;
+      }
+
+      /* calculate grid storage sizes */
+      if (id==0x80808082) {
+         gridsize = nl*2*4 + ( (v->Nr * v->Nc * nl + 3) / 4) * 4;
+      }
+      else {
+         /* McIDAS grid and file numbers present */
+         gridsize = 8 + nl*2*4 + ( (v->Nr * v->Nc * nl + 3) / 4) * 4;
+      }
+      for (i=0;i<v->NumVars;i++) {
+         v->GridSize[i] = gridsize;
+      }
+      v->SumGridSizes = gridsize * v->NumVars;
+
+      /* read McIDAS numbers??? */
+
+      /* size (in bytes) of all header info */
+      v->FirstGridPos = 9*4 + v->Nl[0]*4 + v->NumVars*16 + gridtimes*16;
+
+   }
+
+   v->CompressMode = 1; /* one byte per grid point */
+   v->Projection = 1;  /* Cylindrical equidistant */
+   v->FileVersion[0] = 0;
+
+   return 1;
+}
+
+
+
+/*
+ * Read a compressed grid from a COMP* file.
+ * Return:  1 = ok, 0 = error.
+ */
+static int read_comp_grid( v5dstruct *v, int time, int var,
+                           float *ga, float *gb, void *compdata )
+{
+   unsigned int pos;
+   V5Dubyte bias;
+   int i, n, nl;
+   int f;
+   V5Dubyte *compdata1 = (V5Dubyte *) compdata;
+
+   f = v->FileDesc;
+
+   /* move to position in file */
+   pos = grid_position( v, time, var );
+   lseek( f, pos, SEEK_SET );
+
+   if (v->FileFormat==0x80808083) {
+      /* read McIDAS grid and file numbers */
+      int mcfile, mcgrid;
+      read_int4( f, &mcfile );
+      read_int4( f, &mcgrid );
+      v->McFile[time][var] = (short) mcfile;
+      v->McGrid[time][var] = (short) mcgrid;
+   }
+
+   nl = v->Nl[var];
+
+   if (v->FileFormat==0x80808080 || v->FileFormat==0x80808081) {
+      /* single ga,gb pair for whole grid */
+      float a, b;
+      read_float4( f, &a );
+      read_float4( f, &b );
+      /* convert a, b to new v5d ga, gb values */
+      for (i=0;i<nl;i++) {
+         if (a==0.0) {
+            ga[i] = gb[i] = 0.0;
+         }
+         else {
+            gb[i] = (b+128.0) / -a;
+            ga[i] = 1.0 / a;
+         }
+      }
+      bias = 128;
+   }
+   else {
+      /* read ga, gb arrays */
+      read_float4_array( f, ga, v->Nl[var] );
+      read_float4_array( f, gb, v->Nl[var] );
+
+      /* convert ga, gb values to v5d system */
+      for (i=0;i<nl;i++) {
+         if (ga[i]==0.0) {
+            ga[i] = gb[i] = 0.0;
+         }
+         else {
+            /*gb[i] = (gb[i]+125.0) / -ga[i];*/
+            gb[i] = (gb[i]+128.0) / -ga[i];
+            ga[i] = 1.0 / ga[i];
+         }
+      }
+      bias = 128;  /* 125 ??? */
+   }
+
+   /* read compressed grid data */
+   n = v->Nr * v->Nc * v->Nl[var];
+   if (read_bytes( f, compdata1, n )!=n)
+      return 0;
+
+   /* convert data values to v5d system */
+   n = v->Nr * v->Nc * v->Nl[var];
+   for (i=0;i<n;i++) {
+      compdata1[i] += bias;
+   }
+
+   return 1;
+}
+
+
+
+/*
+ * Read a v5d file header.
+ * Input:  f - file opened for reading.
+ *         v - pointer to v5dstruct to store header info into.
+ * Return:  1 = ok, 0 = error.
+ */
+static int read_v5d_header( v5dstruct *v )
+{
+#define SKIP(N)   lseek( f, N, SEEK_CUR )
+   int end_of_header = 0;
+   unsigned int id;
+   int idlen, var, numargs;
+   int f;
+
+   f = v->FileDesc;
+
+   /* first try to read the header id */
+   read_int4( f, (int*) &id );
+   read_int4( f, &idlen );
+   if (id==TAG_ID && idlen==0) {
+      /* this is a v5d file */
+      v->FileFormat = 0;
+   }
+   else if (id>=0x80808080 && id<=0x80808083) {
+      /* this is an old COMP* file */
+      v->FileFormat = id;
+      return read_comp_header( f, v );
+   }
+   else {
+      /* unknown file type */
+      printf("Error: not a v5d file\n");
+      return 0;
+   }
+
+   v->CompressMode = 1; /* default */
+
+   while (!end_of_header) {
+      int tag, length;
+      int i, var, time, nl, lev;
+
+      if (read_int4(f,&tag)<1 || read_int4(f,&length)<1) {
+         printf("Error while reading header, premature EOF\n");
+         return 0;
+      }
+
+      switch (tag) {
+         case TAG_VERSION:
+            assert( length==10 );
+            read_bytes( f, v->FileVersion, 10 );
+            /* Check if reading a file made by a future version of Vis5D */
+            if (strcmp(v->FileVersion, FILE_VERSION)>0) {
+               /* WLH 6 Oct 98 */
+               printf("Warning: Trying to read a version %s file,", v->FileVersion);
+               printf(" you should upgrade Vis5D.\n");
+            }
+            break;
+         case TAG_NUMTIMES:
+            assert( length==4 );
+            read_int4( f, &v->NumTimes );
+            break;
+         case TAG_NUMVARS:
+            assert( length==4 );
+            read_int4( f, &v->NumVars );
+            break;
+         case TAG_VARNAME:
+            assert( length==14 );   /* 1 int + 10 char */
+            read_int4( f, &var );
+            read_bytes( f, v->VarName[var], 10 );
+            break;
+         case TAG_NR:
+            /* Number of rows for all variables */
+            assert( length==4 );
+            read_int4( f, &v->Nr );
+            break;
+         case TAG_NC:
+            /* Number of columns for all variables */
+            assert( length==4 );
+            read_int4( f, &v->Nc );
+            break;
+         case TAG_NL:
+            /* Number of levels for all variables */
+            assert( length==4 );
+            read_int4( f, &nl );
+            for (i=0;i<v->NumVars;i++) {
+               v->Nl[i] = nl;
+            }
+            break;
+         case TAG_NL_VAR:
+            /* Number of levels for one variable */
+            assert( length==8 );
+            read_int4( f, &var );
+            read_int4( f, &v->Nl[var] );
+            break;
+         case TAG_LOWLEV_VAR:
+            /* Lowest level for one variable */
+            assert( length==8 );
+            read_int4( f, &var );
+            read_int4( f, &v->LowLev[var] );
+            break;
+
+         case TAG_TIME:
+            /* Time stamp for 1 timestep */
+            assert( length==8 );
+            read_int4( f, &time );
+            read_int4( f, &v->TimeStamp[time] );
+            break;
+         case TAG_DATE:
+            /* Date stamp for 1 timestep */
+            assert( length==8 );
+            read_int4( f, &time );
+            read_int4( f, &v->DateStamp[time] );
+            break;
+
+         case TAG_MINVAL:
+            /* Minimum value for a variable */
+            assert( length==8 );
+            read_int4( f, &var );
+            read_float4( f, &v->MinVal[var] );
+            break;
+         case TAG_MAXVAL:
+            /* Maximum value for a variable */
+            assert( length==8 );
+            read_int4( f, &var );
+            read_float4( f, &v->MaxVal[var] );
+            break;
+         case TAG_COMPRESS:
+            /* Compress mode */
+            assert( length==4 );
+            read_int4( f, &v->CompressMode );
+            break;
+         case TAG_UNITS:
+            /* physical units */
+            assert( length==24 );
+            read_int4( f, &var );
+            read_bytes( f, v->Units[var], 20 );
+            break;
+
+         /*
+          * Vertical coordinate system
+          */
+         case TAG_VERTICAL_SYSTEM:
+            assert( length==4 );
+            read_int4( f, &v->VerticalSystem );
+            if (v->VerticalSystem<0 || v->VerticalSystem>3) {
+               printf("Error: bad vertical coordinate system: %d\n",
+                      v->VerticalSystem );
+            }
+            break;
+         case TAG_VERT_ARGS:
+            read_int4( f, &numargs );
+            assert( numargs <= MAXVERTARGS );
+            read_float4_array( f, v->VertArgs, numargs );
+            assert( length==numargs*4+4 );
+            break;
+         case TAG_HEIGHT:
+            /* height of a grid level */
+            assert( length==8 );
+            read_int4( f, &lev );
+            read_float4( f, &v->VertArgs[lev] );
+            break;
+         case TAG_BOTTOMBOUND:
+            assert( length==4 );
+            read_float4( f, &v->VertArgs[0] );
+            break;
+         case TAG_LEVINC:
+            assert( length==4 );
+            read_float4( f, &v->VertArgs[1] );
+            break;
+
+         /*
+          * Map projection information
+          */
+         case TAG_PROJECTION:
+            assert( length==4 );
+            read_int4( f, &v->Projection );
+	    /* WLH 4-21-95 */
+	    /* ZLB 04-06-02 */
+            if (v->Projection<-1 || v->Projection>5) {
+               printf("Error while reading header, bad projection (%d)\n",
+                       v->Projection );
+               return 0;
+            }
+            break;
+         case TAG_PROJ_ARGS:
+            read_int4( f, &numargs );
+            assert( numargs <= MAXPROJARGS );
+            read_float4_array( f, v->ProjArgs, numargs );
+            assert( length==4*numargs+4 );
+            break;
+         case TAG_NORTHBOUND:
+            assert( length==4 );
+            if (v->Projection==0 || v->Projection==1 || v->Projection==4) {
+               read_float4( f, &v->ProjArgs[0] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_WESTBOUND:
+            assert( length==4 );
+            if (v->Projection==0 || v->Projection==1 || v->Projection==4) {
+               read_float4( f, &v->ProjArgs[1] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_ROWINC:
+            assert( length==4 );
+            if (v->Projection==0 || v->Projection==1 || v->Projection==4) {
+               read_float4( f, &v->ProjArgs[2] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_COLINC:
+            assert( length==4 );
+            if (v->Projection==0 || v->Projection==1 || v->Projection==4) {
+               read_float4( f, &v->ProjArgs[3] );
+            }
+            else if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[5] );
+            }
+            else if (v->Projection==3) {
+               read_float4( f, &v->ProjArgs[4] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_ROWINCKM:
+            assert( length==4 );
+            if (v->Projection==5){
+               read_float4( f, &v->ProjArgs[2] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_COLINCKM:
+            assert( length==4 );
+            if (v->Projection==5){
+               read_float4( f, &v->ProjArgs[3] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_LAT1:
+            assert( length==4 );
+            if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[0] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_LAT2:
+            assert( length==4 );
+            if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[1] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_POLE_ROW:
+            assert( length==4 );
+            if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[2] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_POLE_COL:
+            assert( length==4 );
+            if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[3] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_CENTLON:
+            assert( length==4 );
+            if (v->Projection==2) {
+               read_float4( f, &v->ProjArgs[4] );
+            }
+            else if (v->Projection==3 || v->Projection==5) {
+               read_float4( f, &v->ProjArgs[1] );
+            }
+            else if (v->Projection==4) { /* WLH 4-21-95 */
+               read_float4( f, &v->ProjArgs[5] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_CENTLAT:
+            assert( length==4 );
+            if (v->Projection==3 || v->Projection==5) {
+               read_float4( f, &v->ProjArgs[0] );
+            }
+            else if (v->Projection==4) { /* WLH 4-21-95 */
+               read_float4( f, &v->ProjArgs[4] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_CENTROW:
+            assert( length==4 );
+            if (v->Projection==3) {
+               read_float4( f, &v->ProjArgs[2] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_CENTCOL:
+            assert( length==4 );
+            if (v->Projection==3) {
+               read_float4( f, &v->ProjArgs[3] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+         case TAG_ROTATION:
+            assert( length==4 );
+            if (v->Projection==4) { /* WLH 4-21-95 */
+               read_float4( f, &v->ProjArgs[6] );
+            }
+            else {
+               SKIP( 4 );
+            }
+            break;
+
+         case TAG_END:
+            /* end of header */
+            end_of_header = 1;
+            lseek( f, length, SEEK_CUR );
+            break;
+
+         default:
+            /* unknown tag, skip to next tag */
+            printf("Unknown tag: %d  length=%d\n", tag, length );
+            lseek( f, length, SEEK_CUR );
+            break;
+      }
+
+   }
+
+   v5dVerifyStruct( v );
+
+   /* Now we're ready to read the grid data */
+
+   /* Save current file pointer */
+   v->FirstGridPos = ltell(f);
+
+   /* compute grid sizes */
+   v->SumGridSizes = 0;
+   for (var=0;var<v->NumVars;var++) {
+      v->GridSize[var] = 8 * v->Nl[var] + v5dSizeofGrid( v, 0, var );
+      v->SumGridSizes += v->GridSize[var];
+   }
+
+   return 1;
+#undef SKIP
+}
+
+
+
+
+/*
+ * Open a v5d file for reading.
+ * Input:  filename - name of v5d file to open
+ *         v - pointer to a v5dstruct in which to put header info or NULL
+ *             if a struct should be dynamically allocated.
+ * Return:  NULL if error, else v or a pointer to a new v5dstruct if v was NULL
+ */
+v5dstruct *v5dOpenFile( const char *filename, v5dstruct *v )
+{
+   int fd;
+
+   fd = open( filename, O_RDONLY );
+   if (fd==-1) {
+      /* error */
+      return 0;
+   }
+
+   if (v) {
+      v5dInitStruct( v );
+   }
+   else {
+      v = v5dNewStruct();
+      if (!v) {
+         return NULL;
+      }
+   }
+
+   v->FileDesc = fd;
+   v->Mode = 'r';
+   if (read_v5d_header( v )) {
+      return v;
+   }
+   else {
+      return NULL;
+   }
+}
+
+
+
+
+/*
+ * Read a compressed grid from a v5d file.
+ * Input:  v - pointer to v5dstruct describing the file
+ *         time, var - which timestep and variable
+ *         ga, gb - arrays to store grid (de)compression values
+ *         compdata - address of where to store compressed grid data.
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dReadCompressedGrid( v5dstruct *v, int time, int var,
+                           float *ga, float *gb, void *compdata )
+{
+   int pos, n, k;
+
+   if (time<0 || time>=v->NumTimes) {
+      printf("Error in v5dReadCompressedGrid: bad timestep argument (%d)\n",
+             time);
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Error in v5dReadCompressedGrid: bad var argument (%d)\n",
+             var);
+      return 0;
+   }
+
+   if (v->FileFormat) {
+      /* old COMP* file */
+      return read_comp_grid( v, time, var, ga, gb, compdata );
+   }
+
+   /* move to position in file */
+   pos = grid_position( v, time, var );
+   lseek( v->FileDesc, pos, SEEK_SET );
+
+   /* read ga, gb arrays */
+   read_float4_array( v->FileDesc, ga, v->Nl[var] );
+   read_float4_array( v->FileDesc, gb, v->Nl[var] );
+
+   /* read compressed grid data */
+   n = v->Nr * v->Nc * v->Nl[var];
+   if (v->CompressMode==1) {
+      k = read_block( v->FileDesc, compdata, n, 1 )==n;
+   }
+   else if (v->CompressMode==2) {
+      k = read_block( v->FileDesc, compdata, n, 2 )==n;
+   }
+   else if (v->CompressMode==4) {
+      k = read_block( v->FileDesc, compdata, n, 4 )==n;
+   }
+   if (!k) {
+      /* error */
+      printf("Error in v5dReadCompressedGrid: read failed, bad file?\n");
+   }
+   return k;
+
+
+/*
+   n = v->Nr * v->Nc * v->Nl[var] * v->CompressMode;
+   if (read( v->FileDesc, compdata, n )==n)
+      return 1;
+   else
+      return 0;
+*/
+}
+
+
+
+
+/*
+ * Read a grid from a v5d file, decompress it and return it.
+ * Input:  v - pointer to v5dstruct describing file header
+ *         time, var - which timestep and variable.
+ *         data - address of buffer to put grid data
+ * Output:  data - the grid data
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dReadGrid( v5dstruct *v, int time, int var, float data[] )
+{
+   float ga[MAXLEVELS], gb[MAXLEVELS];
+   void *compdata;
+   int bytes;
+
+   if (time<0 || time>=v->NumTimes) {
+      printf("Error in v5dReadGrid: bad timestep argument (%d)\n", time);
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Error in v5dReadGrid: bad variable argument (%d)\n", var);
+      return 0;
+   }
+
+   /* allocate compdata buffer */
+   if (v->CompressMode==1) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
+   }
+   else if (v->CompressMode==2) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
+   }
+   else if (v->CompressMode==4) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
+   }
+   compdata = (void *) malloc( bytes );
+   if (!compdata) {
+      printf("Error in v5dReadGrid: out of memory (needed %d bytes)\n", bytes);
+      return 0;
+   }
+
+   /* read the compressed data */
+   if (!v5dReadCompressedGrid( v, time, var, ga, gb, compdata )) {
+      return 0;
+   }
+
+   /* decompress the data */
+   v5dDecompressGrid( v->Nr, v->Nc, v->Nl[var], v->CompressMode,
+                      compdata, ga, gb, data );
+
+   /* free compdata */
+   free( compdata );
+   return 1;
+}
+
+
+
+
+/**********************************************************************/
+/*****                   Output Functions                         *****/
+/**********************************************************************/
+
+
+
+static int write_tag( v5dstruct *v, int tag, int length, int newfile )
+{
+   if (!newfile) {
+      /* have to check that there's room in header to write this tagged item */
+      if (v->CurPos+8+length > v->FirstGridPos) {
+         printf("Error: out of header space!\n");
+         /* Out of header space! */
+         return 0;
+      }
+   }
+
+   if (write_int4( v->FileDesc, tag )==0)  return 0;
+   if (write_int4( v->FileDesc, length )==0)  return 0;
+   v->CurPos += 8 + length;
+   return 1;
+}
+
+
+
+/*
+ * Write the information in the given v5dstruct as a v5d file header.
+ * Note that the current file position is restored when this function
+ * returns normally.
+ * Input:  f - file already open for writing
+ *         v - pointer to v5dstruct
+ * Return:  1 = ok, 0 = error.
+ */
+static int write_v5d_header( v5dstruct *v )
+{
+   int var, time, filler, maxnl;
+   int f;
+   int newfile;
+   /* ZLB */
+   int n;
+
+   if (v->FileFormat!=0) {
+      printf("Error: v5d library can't write comp5d format files.\n");
+      return 0;
+   }
+
+   f = v->FileDesc;
+
+   if (!v5dVerifyStruct( v ))
+      return 0;
+
+   /* Determine if we're writing to a new file */
+   if (v->FirstGridPos==0) {
+      newfile = 1;
+   }
+   else {
+      newfile = 0;
+   }
+
+   /* compute grid sizes */
+   v->SumGridSizes = 0;
+   for (var=0;var<v->NumVars;var++) {
+      v->GridSize[var] = 8 * v->Nl[var] + v5dSizeofGrid( v, 0, var );
+      v->SumGridSizes += v->GridSize[var];
+   }
+
+   /* set file pointer to start of file */
+   lseek( f, 0, SEEK_SET );
+   v->CurPos = 0;
+
+   /*
+    * Write the tagged header info
+    */
+#define WRITE_TAG( V, T, L )  if (!write_tag(V,T,L,newfile))  return 0;
+
+   /* ID */
+   WRITE_TAG( v, TAG_ID, 0 );
+
+   /* File Version */
+   WRITE_TAG( v, TAG_VERSION, 10 );
+   write_bytes( f, FILE_VERSION, 10 );
+
+   /* Number of timesteps */
+   WRITE_TAG( v, TAG_NUMTIMES, 4 );
+   write_int4( f, v->NumTimes );
+
+   /* Number of variables */
+   WRITE_TAG( v, TAG_NUMVARS, 4 );
+   write_int4( f, v->NumVars );
+
+   /* Names of variables */
+   for (var=0;var<v->NumVars;var++) {
+      WRITE_TAG( v, TAG_VARNAME, 14 );
+      write_int4( f, var );
+      write_bytes( f, v->VarName[var], 10 );
+   }
+
+   /* Physical Units */
+   for (var=0;var<v->NumVars;var++) {
+      WRITE_TAG( v, TAG_UNITS, 24 );
+      write_int4( f, var );
+      write_bytes( f, v->Units[var], 20 );
+   }
+
+   /* Date and time of each timestep */
+   for (time=0;time<v->NumTimes;time++) {
+      WRITE_TAG( v, TAG_TIME, 8 );
+      write_int4( f, time );
+      write_int4( f, v->TimeStamp[time] );
+      WRITE_TAG( v, TAG_DATE, 8 );
+      write_int4( f, time );
+      write_int4( f, v->DateStamp[time] );
+   }
+
+   /* Number of rows */
+   WRITE_TAG( v, TAG_NR, 4 );
+   write_int4( f, v->Nr );
+
+   /* Number of columns */
+   WRITE_TAG( v, TAG_NC, 4 );
+   write_int4( f, v->Nc );
+
+   /* Number of levels, compute maxnl */
+   maxnl = 0;
+   for (var=0;var<v->NumVars;var++) {
+      WRITE_TAG( v, TAG_NL_VAR, 8 );
+      write_int4( f, var );
+      write_int4( f, v->Nl[var] );
+      WRITE_TAG( v, TAG_LOWLEV_VAR, 8 );
+      write_int4( f, var );
+      write_int4( f, v->LowLev[var] );
+      if (v->Nl[var]+v->LowLev[var]>maxnl) {
+         maxnl = v->Nl[var]+v->LowLev[var];
+      }
+   }
+
+   /* Min/Max values */
+   for (var=0;var<v->NumVars;var++) {
+      WRITE_TAG( v, TAG_MINVAL, 8 );
+      write_int4( f, var );
+      write_float4( f, v->MinVal[var] );
+      WRITE_TAG( v, TAG_MAXVAL, 8 );
+      write_int4( f, var );
+      write_float4( f, v->MaxVal[var] );
+   }
+
+   /* Compress mode */
+   WRITE_TAG( v, TAG_COMPRESS, 4 );
+   write_int4( f, v->CompressMode );
+
+   /* Vertical Coordinate System */
+   WRITE_TAG( v, TAG_VERTICAL_SYSTEM, 4 );
+   write_int4( f, v->VerticalSystem );
+   /* ZLB 02-09-2000 */
+#if 0
+   WRITE_TAG( v, TAG_VERT_ARGS, 4+4*MAXVERTARGS );
+   write_int4( f, MAXVERTARGS );
+   write_float4_array( f, v->VertArgs, MAXVERTARGS );
+#else
+   n = ( v->VerticalSystem == 0 || v->VerticalSystem == 1 ) ? 2 : maxnl;
+   WRITE_TAG( v, TAG_VERT_ARGS, 4+4*n );
+   write_int4( f, n );
+   write_float4_array( f, v->VertArgs, n );
+#endif
+
+   /* Map Projection */
+   WRITE_TAG( v, TAG_PROJECTION, 4 );
+   write_int4( f, v->Projection );
+   /* ZLB 02-09-2000 */
+#if 0
+   WRITE_TAG( v, TAG_PROJ_ARGS, 4+4*MAXPROJARGS );
+   write_int4( f, MAXPROJARGS );
+   write_float4_array( f, v->ProjArgs, MAXPROJARGS );
+#else
+   n= ( v->Projection != -1 ) ? 10 : v->Nc + v->Nr;
+   WRITE_TAG( v, TAG_PROJ_ARGS, 4+4*n );
+   write_int4( f, n );
+   write_float4_array( f, v->ProjArgs, n );
+#endif
+
+   /* write END tag */
+   if (newfile) {
+      /* We're writing to a brand new file.  Reserve 10000 bytes */
+      /* for future header growth. */
+      WRITE_TAG( v, TAG_END, 10000 );
+      lseek( f, 10000, SEEK_CUR );
+
+      /* Let file pointer indicate where first grid is stored */
+      v->FirstGridPos = ltell( f );
+   }
+   else {
+      /* we're rewriting a header */
+      filler = v->FirstGridPos - ltell(f);
+      WRITE_TAG( v, TAG_END, filler-8 );
+   }
+
+#undef WRITE_TAG
+
+   return 1;
+}
+
+
+
+/*
+ * Open a v5d file for writing.  If the named file already exists,
+ * it will be deleted.
+ * Input:  filename - name of v5d file to create.
+ *         v - pointer to v5dstruct with the header info to write.
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dCreateFile( const char *filename, v5dstruct *v )
+{
+   mode_t mask;
+   int fd;
+
+   mask = 0666;
+   fd = open( filename, O_WRONLY | O_CREAT | O_TRUNC, mask );
+   if (fd==-1) {
+      printf("Error in v5dCreateFile: open failed\n");
+      v->FileDesc = -1;
+      v->Mode = 0;
+      return 0;
+   }
+   else {
+      /* ok */
+      v->FileDesc = fd;
+      v->Mode = 'w';
+      /* write header and return status */
+      return write_v5d_header(v);
+   }
+}
+
+
+
+/*
+ * Open a v5d file for updating/appending and read the header info.
+ * Input:  filename - name of v5d file to open for updating.
+ *         v - pointer to v5dstruct in which the file header info will be
+ *             put.  If v is NULL a v5dstruct will be allocated and returned.
+ * Return:  NULL if error, else v or a pointer to a new v5dstruct if v as NULL
+ */
+v5dstruct *v5dUpdateFile( const char *filename, v5dstruct *v )
+{
+   int fd;
+
+   fd = open( filename, O_RDWR );
+   if (fd==-1) {
+      return NULL;
+   }
+
+   if (!v) {
+      v = v5dNewStruct();
+      if (!v) {
+         return NULL;
+      }
+   }
+
+   v->FileDesc = fd;
+   v->Mode = 'w';
+
+   if (read_v5d_header( v )) {
+      return v;
+   }
+   else {
+      return NULL;
+   }
+}
+
+
+
+/*
+ * Write a compressed grid to a v5d file.
+ * Input:  v - pointer to v5dstruct describing the file
+ *         time, var - which timestep and variable
+ *         ga, gb - the GA and GB (de)compression value arrays
+ *         compdata - address of array of compressed data values
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dWriteCompressedGrid( const v5dstruct *v, int time, int var,
+                            const float *ga, const float *gb,
+                            const void *compdata )
+{
+   int pos, n, k;
+
+   /* simple error checks */
+   if (v->Mode!='w') {
+      printf("Error in v5dWriteCompressedGrid: file opened for reading,");
+      printf(" not writing.\n");
+      return 0;
+   }
+   if (time<0 || time>=v->NumTimes) {
+      printf("Error in v5dWriteCompressedGrid: bad timestep argument (%d)\n",
+             time);
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Error in v5dWriteCompressedGrid: bad variable argument (%d)\n",
+             var);
+      return 0;
+   }
+
+   /* move to position in file */
+   pos = grid_position( v, time, var );
+   if (lseek( v->FileDesc, pos, SEEK_SET )<0) {
+      /* lseek failed, return error */
+      printf("Error in v5dWrite[Compressed]Grid: seek failed, disk full?\n");
+      return 0;
+   }
+
+   /* write ga, gb arrays */
+   k = 0;
+   if (write_float4_array( v->FileDesc, ga, v->Nl[var] ) == v->Nl[var] &&
+       write_float4_array( v->FileDesc, gb, v->Nl[var] ) == v->Nl[var]) {
+      /* write compressed grid data (k=1=OK, k=0=Error) */
+      n = v->Nr * v->Nc * v->Nl[var];
+      if (v->CompressMode==1) {
+         k = write_block( v->FileDesc, compdata, n, 1 )==n;
+      }
+      else if (v->CompressMode==2) {
+         k = write_block( v->FileDesc, compdata, n, 2 )==n;
+      }
+      else if (v->CompressMode==4) {
+         k = write_block( v->FileDesc, compdata, n, 4 )==n;
+      }
+   }
+
+   if (k==0) {
+      /* Error while writing */
+      printf("Error in v5dWrite[Compressed]Grid: write failed, disk full?\n");
+   }
+   return k;
+
+/*
+   n = v->Nr * v->Nc * v->Nl[var] * v->CompressMode;
+   if (write_bytes( v->FileDesc, compdata, n )!=n) {
+      printf("Error in v5dWrite[Compressed]Grid: write failed, disk full?\n");
+      return 0;
+   }
+   else {
+      return 1;
+   }
+*/
+}
+
+
+
+
+/*
+ * Compress a grid and write it to a v5d file.
+ * Input:  v - pointer to v5dstruct describing the file
+ *         time, var - which timestep and variable (starting at 0)
+ *         data - address of uncompressed grid data
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dWriteGrid( v5dstruct *v, int time, int var, const float data[] )
+{
+   float ga[MAXLEVELS], gb[MAXLEVELS];
+   void *compdata;
+   int n, bytes;
+   float min, max;
+
+   if (v->Mode!='w') {
+      printf("Error in v5dWriteGrid: file opened for reading,");
+      printf(" not writing.\n");
+      return 0;
+   }
+   if (time<0 || time>=v->NumTimes) {
+      printf("Error in v5dWriteGrid: bad timestep argument (%d)\n", time);
+      return 0;
+   }
+   if (var<0 || var>=v->NumVars) {
+      printf("Error in v5dWriteGrid: bad variable argument (%d)\n", var);
+      return 0;
+   }
+
+   /* allocate compdata buffer */
+   if (v->CompressMode==1) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
+   }
+   else if (v->CompressMode==2) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
+   }
+   else if (v->CompressMode==4) {
+      bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
+   }
+   compdata = (void *) malloc( bytes );
+   if (!compdata) {
+      printf("Error in v5dWriteGrid: out of memory (needed %d bytes)\n",
+             bytes );
+      return 0;
+   }
+
+   /* compress the grid data */
+   v5dCompressGrid( v->Nr, v->Nc, v->Nl[var], v->CompressMode, data,
+                    compdata, ga, gb, &min, &max );
+
+   /* update min and max value */
+   if (min<v->MinVal[var])
+      v->MinVal[var] = min;
+   if (max>v->MaxVal[var])
+      v->MaxVal[var] = max;
+
+   /* write the compressed grid */
+   n = v5dWriteCompressedGrid( v, time, var, ga, gb, compdata );
+
+   /* free compdata */
+   free( compdata );
+
+   return n;
+}
+
+
+
+/*
+ * Close a v5d file which was opened with open_v5d_file() or
+ * create_v5d_file().
+ * Input: f - file descriptor
+ * Return:  1 = ok, 0 = error
+ */
+int v5dCloseFile( v5dstruct *v )
+{
+   int status = 1;
+
+   if (v->Mode=='w') {
+      /* rewrite header because writing grids updates the minval and */
+      /* maxval fields */
+      lseek( v->FileDesc, 0, SEEK_SET );
+      status = write_v5d_header( v );
+      lseek( v->FileDesc, 0, SEEK_END );
+      close( v->FileDesc );
+   }
+   else if (v->Mode=='r') {
+      /* just close the file */
+      close(v->FileDesc);
+   }
+   else {
+      printf("Error in v5dCloseFile: bad v5dstruct argument\n");
+      return 0;
+   }
+   v->FileDesc = -1;
+   v->Mode = 0;
+   return status;
+}
+
+
+
+
+/**********************************************************************/
+/*****           Simple v5d file writing functions.               *****/
+/**********************************************************************/
+
+/* JPE 09-19-2000
+ * Create a new v5d structure specifying both a map projection and vertical
+ * coordinate system.  See README file for argument details.
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dCreateStruct(v5dstruct *v, int numtimes, int numvars,
+               int nr, int nc, const int nl[],
+               const char varname[MAX_V5_VARS][10],
+               const int timestamp[], const int datestamp[],
+               int compressmode,
+               int projection,
+               const float proj_args[],
+               int vertical,
+               const float vert_args[] )
+{
+   int var, time, maxnl, i;
+
+
+   v->NumTimes = numtimes;
+   v->NumVars = numvars;
+   v->Nr = nr;
+   v->Nc = nc;
+   maxnl = nl[0];
+   for (var=0;var<numvars;var++) {
+      if (nl[var]>maxnl) {
+         maxnl = nl[var];
+      }
+      v->Nl[var] = nl[var];
+      v->LowLev[var] = 0;
+      strncpy( v->VarName[var], varname[var], 10 );
+      v->VarName[var][9] = 0;
+   }
+
+   /* time and date for each timestep */
+   for (time=0;time<numtimes;time++) {
+      v->TimeStamp[time] = timestamp[time];
+      v->DateStamp[time] = datestamp[time];
+   }
+
+   v->CompressMode = compressmode;
+
+   /* Map projection and vertical coordinate system */
+   v->Projection = projection;
+   memcpy( v->ProjArgs, proj_args, MAXPROJARGS*sizeof(float) );
+
+   v->VerticalSystem = vertical;
+   if (vertical == 3) {
+     /* convert pressures to heights */
+     for (i=0; i< maxnl; i++) {
+       if (vert_args[i] > 0.000001) {
+         v->VertArgs[i] = pressure_to_height(vert_args[i]);
+       }
+       else v->VertArgs[i] = 0.0;
+     }
+   }
+   else {
+     memcpy( v->VertArgs, vert_args, MAXVERTARGS*sizeof(float) );
+   }
+	return 0;
+}
+
+
+static v5dstruct *Simple = NULL;
+
+
+/*
+ * Create a new v5d file specifying both a map projection and vertical
+ * coordinate system.  See README file for argument details.
+ * Return:  1 = ok, 0 = error.
+ */
+int v5dCreate( const char *name, int numtimes, int numvars,
+               int nr, int nc, const int nl[],
+               const char varname[MAX_V5_VARS][10],
+               const int timestamp[], const int datestamp[],
+               int compressmode,
+               int projection,
+               const float proj_args[],
+               int vertical,
+               const float vert_args[] )
+{
+
+
+   /* initialize the v5dstruct */
+   Simple = v5dNewStruct();
+   v5dCreateStruct(Simple, numtimes,numvars,nr,nc,nl,varname,timestamp,datestamp,
+						 compressmode, projection, proj_args, vertical, vert_args);
+
+   /* create the file */
+   if (v5dCreateFile( name, Simple )==0) {
+     printf("Error in v5dCreateSimpleFile: unable to create %s\n", name );
+     return 0;
+   }
+   else {
+      return 1;
+   }
+}
+
+
+
+
+
+
+/*
+ * Create a new v5d file using minimal information.
+ * Return:  1 = ok, 0 = error.  See README file for argument details.
+ */
+int v5dCreateSimple( const char *name, int numtimes, int numvars,
+                     int nr, int nc, int nl,
+                     const char varname[MAX_V5_VARS][10],
+                     const int timestamp[], const int datestamp[],
+                     float northlat, float latinc,
+                     float westlon, float loninc,
+                     float bottomhgt, float hgtinc )
+{
+   int nlvar[MAX_V5_VARS];
+   int compressmode, projection, vertical;
+   float proj_args[100], vert_args[MAXLEVELS];
+   int i;
+
+   for (i=0;i<numvars;i++) {
+      nlvar[i] = nl;
+   }
+
+   compressmode = 1;
+
+   projection = 1;
+   proj_args[0] = northlat;
+   proj_args[1] = westlon;
+   proj_args[2] = latinc;
+   proj_args[3] = loninc;
+
+   vertical = 1;
+   vert_args[0] = bottomhgt;
+   vert_args[1] = hgtinc;
+
+   return v5dCreate( name, numtimes, numvars, nr, nc, nlvar,
+                     varname, timestamp, datestamp, compressmode,
+                     projection, proj_args, vertical, vert_args );
+}
+
+
+
+/*
+ * Set lowest levels for each variable (other than default of 0).
+ * Input: lowlev - array [NumVars] of ints
+ * Return:  1 = ok, 0 = error
+ */
+int v5dSetLowLev( int lowlev[] )
+{
+  int var;
+
+  if (Simple) {
+     for (var=0;var<Simple->NumVars;var++) {
+        Simple->LowLev[var] = lowlev[var];
+     }
+     return 1;
+  }
+  else {
+     printf("Error: must call v5dCreate before v5dSetLowLev\n");
+     return 0;
+  }
+}
+
+
+/*
+ * Set the units for a variable.
+ * Input:  var - a variable in [1,NumVars]
+ *         units - a string
+ * Return:  1 = ok, 0 = error
+ */
+int v5dSetUnits( int var, const char *units )
+{
+  if (Simple) {
+     if (var>=1 && var<=Simple->NumVars) {
+        strncpy( Simple->Units[var-1], units, 19 );
+        Simple->Units[var-1][19] = 0;
+        return 1;
+     }
+     else {
+        printf("Error: bad variable number in v5dSetUnits\n");
+        return 0;
+     }
+  }
+  else {
+     printf("Error: must call v5dCreate before v5dSetUnits\n");
+     return 0;
+  }
+}
+
+
+
+/*
+ * Write a grid to a v5d file.
+ * Input:  time - timestep in [1,NumTimes]
+ *         var - timestep in [1,NumVars]
+ *         data - array [nr*nc*nl] of floats
+ * Return:  1 = ok, 0 = error
+ */
+int v5dWrite( int time, int var, const float data[] )
+{
+   if (Simple) {
+      if (time<1 || time>Simple->NumTimes) {
+         printf("Error in v5dWrite: bad timestep number: %d\n", time );
+         return 0;
+      }
+      if (var<1 || var>Simple->NumVars) {
+         printf("Error in v5dWrite: bad variable number: %d\n", var );
+      }
+      return v5dWriteGrid( Simple, time-1, var-1, data );
+   }
+   else {
+      printf("Error: must call v5dCreate before v5dWrite\n");
+      return 0;
+   }
+}
+
+
+
+/*
+ * Close a v5d file after the last grid has been written to it.
+ * Return:  1 = ok, 0 = error
+ */
+int v5dClose( void )
+{
+   if (Simple) {
+     int ok = v5dCloseFile( Simple );
+     v5dFreeStruct( Simple );
+     return ok;
+   }
+   else {
+     printf("Error: v5dClose: no file to close\n");
+     return 0;
+   }
+}
+
+
+
+/**********************************************************************/
+/*****                FORTRAN-callable simple output              *****/
+/**********************************************************************/
+
+#ifdef F77_FUNC
+
+/*
+ * Create a v5d file.  See README file for argument descriptions.
+ * Return:  1 = ok, 0 = error.
+ */
+int F77_FUNC(v5dcreate,V5DCREATE)
+           ( const char *name, const int *numtimes, const int *numvars,
+             const int *nr, const int *nc, const int nl[],
+             const char varname[][10],
+             const int timestamp[], const int datestamp[],
+             const int *compressmode,
+             const int *projection,
+             const float proj_args[],
+             const int *vertical,
+             const float vert_args[] )
+{
+   char filename[100];
+   char names[MAX_V5_VARS][10];
+   int i, maxnl, args;
+
+   /* copy name to filename and remove trailing spaces if any */
+   copy_string( filename, name, 100 );
+
+   /*
+    * Check for uninitialized arguments
+    */
+   if (*numtimes<1) {
+      printf("Error: numtimes invalid\n");
+      return 0;
+   }
+   if (*numvars<1) {
+      printf("Error: numvars invalid\n");
+      return 0;
+   }
+   if (*nr<2) {
+      printf("Error: nr invalid\n");
+      return 0;
+   }
+   if (*nc<2) {
+      printf("Error: nc invalid\n");
+      return 0;
+   }
+   maxnl = 0;
+   for (i=0;i<*numvars;i++) {
+      if (nl[i]<1) {
+         printf("Error: nl(%d) invalid\n", i+1);
+         return 0;
+      }
+      if (nl[i]>maxnl) {
+         maxnl = nl[i];
+      }
+   }
+
+   for (i=0;i<*numvars;i++) {
+      if (copy_string2( names[i], varname[i], 10)==0) {
+         printf("Error: unitialized varname(%d)\n", i+1);
+         return 0;
+      }
+   }
+
+   for (i=0;i<*numtimes;i++) {
+      if (timestamp[i]<0) {
+         printf("Error: times(%d) invalid\n", i+1);
+         return 0;
+      }
+      if (datestamp[i]<0) {
+         printf("Error: dates(%d) invalid\n", i+1);
+         return 0;
+      }
+   }
+
+   if (*compressmode != 1 && *compressmode != 2 && *compressmode != 4) {
+      printf("Error: compressmode invalid\n");
+      return 0;
+   }
+
+   switch (*projection) {
+      case 0:
+         args = 4;
+         break;
+      case 1:
+         args = 0;
+         if (IS_MISSING(proj_args[0])) {
+            printf("Error: northlat (proj_args(1)) invalid\n");
+            return 0;
+         }
+         if (IS_MISSING(proj_args[1])) {
+            printf("Error: westlon (proj_args(2)) invalid\n");
+            return 0;
+         }
+         if (IS_MISSING(proj_args[2])) {
+            printf("Error: latinc (proj_args(3)) invalid\n");
+            return 0;
+         }
+         if (IS_MISSING(proj_args[3])) {
+            printf("Error: loninc (proj_args(4)) invalid\n");
+            return 0;
+         }
+         break;
+      case 2:
+         args = 6;
+         break;
+      case 3:
+         args = 5;
+         break;
+      case 4:
+         args = 7;
+         break;
+/* MJK 12.12.99 */
+      case 5:
+         args = 4;
+         break;
+      /* ZLB 02-09-2000 */
+      case -1:
+         args = *nr + *nc;
+         break;
+      default:
+         args = 0;
+         printf("Error: projection invalid\n");
+         return 0;
+   }
+   for (i=0;i<args;i++) {
+      if (IS_MISSING(proj_args[i])) {
+         printf("Error: proj_args(%d) invalid\n", i+1);
+         return 0;
+      }
+   }
+
+   switch (*vertical) {
+      case 0:
+/* WLH 31 Oct 96  -  just fall through 
+         args = 4;
+         break;
+*/
+      case 1:
+         args = 0;
+         if (IS_MISSING(vert_args[0])) {
+            printf("Error: bottomhgt (vert_args(1)) invalid\n");
+            return 0;
+         }
+         if (IS_MISSING(vert_args[1])) {
+            printf("Error: hgtinc (vert_args(2)) invalid\n");
+            return 0;
+         }
+         break;
+      case 2:
+      case 3:
+         args = maxnl;
+         break;
+      default:
+         args = 0;
+         printf("Error: vertical invalid\n");
+         return 0;
+   }
+   for (i=0;i<args;i++) {
+      if (IS_MISSING(vert_args[i])) {
+         printf("Error: vert_args(%d) invalid\n", i+1);
+         return 0;
+      }
+   }
+
+   return v5dCreate( filename, *numtimes, *numvars, *nr, *nc, nl,
+                     (const char(*)[10]) names, timestamp, datestamp,
+                     *compressmode,
+                     *projection, proj_args, *vertical, vert_args );
+}
+
+
+
+
+/*
+ * Create a simple v5d file.  See README file for argument descriptions.
+ * Return:  1 = ok, 0 = error.
+ */
+int F77_FUNC(v5dcreatesimple,V5DCREATESIMPLE)
+           ( const char *name, const int *numtimes, const int *numvars,
+             const int *nr, const int *nc, const int *nl,
+             const char varname[][10],
+             const int timestamp[], const int datestamp[],
+             const float *northlat, const float *latinc,
+             const float *westlon, const float *loninc,
+             const float *bottomhgt, const float *hgtinc )
+{
+   int compressmode, projection, vertical;
+   float projarg[100], vertarg[MAXLEVELS];
+   int varnl[MAX_V5_VARS];
+   int i;
+
+   for (i=0;i<MAX_V5_VARS;i++) {
+      varnl[i] = *nl;
+   }
+
+   compressmode = 1;
+
+   projection = 1;
+   projarg[0] = *northlat;
+   projarg[1] = *westlon;
+   projarg[2] = *latinc;
+   projarg[3] = *loninc;
+
+   vertical = 1;
+   vertarg[0] = *bottomhgt;
+   vertarg[1] = *hgtinc;
+
+   return F77_FUNC(v5dcreate,V5DCREATE)
+                   ( name, numtimes, numvars, nr, nc, varnl,
+                     varname, timestamp, datestamp, &compressmode,
+                     &projection, projarg, &vertical, vertarg );
+}
+
+
+
+/*
+ * Set lowest levels for each variable (other than default of 0).
+ * Input: lowlev - array [NumVars] of ints
+ * Return:  1 = ok, 0 = error
+ */
+int F77_FUNC(v5dsetlowlev,V5DSETLOWLEV)
+          ( int *lowlev )
+{
+   return v5dSetLowLev(lowlev);
+}
+
+
+
+/*
+ * Set the units for a variable.
+ * Input: var - variable number in [1,NumVars]
+ *        units - a character string
+ * Return:  1 = ok, 0 = error
+ */
+int F77_FUNC(v5dsetunits,V5DSETUNITS)
+          ( int *var, char *name )
+{
+   char buf[20];
+   copy_string( buf, name, 20 );
+
+   return v5dSetUnits( *var, buf );
+}
+
+
+
+/*
+ * Write a grid of data to the file.
+ * Input:  time - timestep in [1,NumTimes]
+ *         var - timestep in [1,NumVars]
+ *         data - array [nr*nc*nl] of floats
+ * Return:  1 = ok, 0 = error
+ */
+int F77_FUNC(v5dwrite,V5DWRITE)
+          ( const int *time, const int *var, const float *data )
+{
+   return v5dWrite( *time, *var, data );
+}
+
+
+
+/*
+ * Specify the McIDAS GR3D file number and grid number which correspond
+ * to the grid specified by time and var.
+ * Input:  time, var - timestep and variable of grid (starting at 1)
+ *         mcfile, mcgrid - McIDAS grid file number and grid number
+ * Return:  1 = ok, 0 = errror (bad time or var)
+ */
+int F77_FUNC(v5dmcfile,V5DMCFILE)
+         ( const int *time, const int *var,
+           const int *mcfile, const int *mcgrid )
+{
+   if (*time<1 || *time>Simple->NumTimes) {
+      printf("Bad time argument to v5dSetMcIDASgrid: %d\n", *time );
+      return 0;
+   }
+   if (*var<1 || *var>Simple->NumVars) {
+      printf("Bad var argument to v5dSetMcIDASgrid: %d\n", *var );
+      return 0;
+   }
+
+   Simple->McFile[*time-1][*var-1] = (short) *mcfile;
+   Simple->McGrid[*time-1][*var-1] = (short) *mcgrid;
+   return 1;
+}
+
+
+
+/*
+ * Close a simple v5d file.
+ */
+int F77_FUNC(v5dclose,V5DCLOSE)()
+{
+   return v5dClose();
+}
+
+
+/*
+ * Open a pre-existing v5d file for appending.
+ */
+int F77_FUNC(v5dupdate,V5DUPDATE)
+         ( const char *name )
+{
+   char filename[100];
+
+   /* copy name to filename and remove trailing spaces if any */
+   copy_string( filename, name, 100 );
+   Simple = v5dNewStruct();
+   if (!Simple)
+      return 0;
+   if (!v5dUpdateFile ( filename, Simple ))
+      return 0;
+   return 1;
+}
+
+
+/*
+ * Update the timestep count and the vector defining timesteps.
+ * This is useful for incremental output from fortran model code.
+ * Each timestep can be appended to the v5d file independently.
+ */
+int F77_FUNC(v5dupdatetimes,V5DUPDATETIMES)
+          ( const int *numtimes,
+            const int timestamp[], const int datestamp[] )
+{
+   int time;
+
+   if (!Simple) {
+      printf("Error: must call v5dupdate before v5dupdatetimes\n");
+      return 0;
+   }
+   /*
+    * Check for uninitialized arguments
+    */
+   if (*numtimes < 1) {
+      printf("Error: v5dupdatetimes: numtimes invalid: %d\n", *numtimes);
+      return 0;
+   }
+
+   for (time = 0; time < *numtimes; time++) {
+      if (timestamp[time] < 0) {
+         printf("Error: v5dupdatetimes: times(%d) invalid: %d\n", time+1,timestamp[time]);
+         return 0;
+      }
+      if (datestamp[time] < 0) {
+         printf("Error: v5dupdatetimes: dates(%d) invalid: %d\n", time+1,datestamp[time]);
+         return 0;
+      }
+   }
+   Simple->NumTimes = *numtimes;
+   for (time = 0; time < *numtimes; time++) {
+      Simple->TimeStamp[time] = timestamp[time];
+      Simple->DateStamp[time] = datestamp[time];
+   }
+   return 1;
+}
+
+#endif /* F77_FUNC */
diff --git a/external_functions/v5d/v5d.h b/external_functions/v5d/v5d.h
new file mode 100644
index 0000000..b23d836
--- /dev/null
+++ b/external_functions/v5d/v5d.h
@@ -0,0 +1,345 @@
+/*
+ * Vis5D system for visualizing five dimensional gridded data sets.
+ * Copyright (C) 1990 - 2000 Bill Hibbard, Johan Kellum, Brian Paul,
+ * Dave Santek, and Andre Battaiola.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * As a special exception to the terms of the GNU General Public
+ * License, you are permitted to link Vis5D with (and distribute the
+ * resulting source and executables) the LUI library (copyright by
+ * Stellar Computer Inc. and licensed for distribution with Vis5D),
+ * the McIDAS library, and/or the NetCDF library, where those
+ * libraries are governed by the terms of their own licenses.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+Note: Ansley Manke 6/07. Ferret-external-functions version of this file, with 
+MAXVARS changed to MAX_V5_VARS. Make the same change in v5d.h, v5d.c, and 
+v5df_fer.h
+ */
+
+#ifndef V5D_H
+#define V5D_H
+
+/* SGJ: use extern "C" if included from a C++ file: */
+#ifdef __cplusplus
+extern "C" {
+#endif				/* __cplusplus */
+
+/*
+ * A numeric version number which we can test for in utility programs which
+ * use the v5d functions.  For example, we can do tests like this:
+ * #if V5D_VERSION > 42
+ *      do something
+ * #else
+ *      do something else
+ * #endif
+ *
+ * If V5D_VERSION is not defined, then its value is considered to be zero.
+ */
+
+#define V5D_VERSION 42
+
+
+/*
+ * Define our own 1 and 2-byte data types.  We use these names to avoid
+ * collisions with types defined by the OS include files.
+ */
+typedef unsigned char V5Dubyte;     /* Must be 1 byte, except for cray */
+typedef unsigned short V5Dushort;   /* Must be 2 byte, except for cray */
+
+
+
+#define MISSING 1.0e35
+#define IS_MISSING(X)  ( (X) >= 1.0e30 )
+
+
+/* Limits on 5-D grid size:  (must match those in v5df.h!!!) */
+#define MAX_V5_VARS     200
+#define MAXTIMES    400
+#define MAXROWS     400
+#define MAXCOLUMNS  400 
+#define MAXLEVELS   400
+
+#define MAXRECS     10000
+
+/************************************************************************/
+/***                                                                  ***/
+/*** Functions for writing v5d files.  See README file for details.   ***/
+/*** These are the functions user's will want for writing file        ***/
+/*** converters, etc.                                                 ***/
+/***                                                                  ***/
+/************************************************************************/
+extern int v5dCreateSimple( const char *name,
+                            int numtimes, int numvars,
+                            int nr, int nc, int nl,
+                            const char varname[MAX_V5_VARS][10],
+                            const int timestamp[],
+                            const int datestamp[],
+                            float northlat, float latinc,
+                            float westlon, float loninc,
+                            float bottomhgt, float hgtinc );
+
+
+extern int v5dCreate( const char *name,
+                      int numtimes, int numvars,
+                      int nr, int nc, const int nl[],
+                      const char varname[MAX_V5_VARS][10],
+                      const int timestamp[],
+                      const int datestamp[],
+                      int compressmode,
+                      int projection,
+                      const float proj_args[],
+                      int vertical,
+                      const float vert_args[] );
+
+
+extern int v5dWrite( int time, int var, const float data[] );
+
+
+extern int v5dClose( void );
+
+
+extern int v5dSetLowLev( int lowlev[] );
+
+extern int v5dSetUnits( int var, const char *units );
+
+
+
+/************************************************************************/
+/***                                                                  ***/
+/*** Definition of v5d struct and function prototypes.                ***/
+/*** These functions are used by vis5d and advanced v5d utilities.    ***/
+/***                                                                  ***/
+/************************************************************************/
+
+/* ZLB 02-09-2000 */
+#define MAXPROJARGS (MAXROWS+MAXCOLUMNS+1)
+#define MAXVERTARGS (MAXLEVELS+1)
+
+/*
+ * This struct describes the structure of a .v5d file.
+ */
+typedef struct {
+    /* PUBLIC (user can freely read, sometimes write, these fields) */
+        int NumTimes;                   /* Number of time steps */
+        int NumVars;                    /* Number of variables */
+        int Nr;                         /* Number of rows */
+        int Nc;                         /* Number of columns */
+        int Nl[MAX_V5_VARS];                /* Number of levels per variable */
+        int LowLev[MAX_V5_VARS];            /* Lowest level per variable */
+        char VarName[MAX_V5_VARS][10];      /* 9-character variable names */
+        char Units[MAX_V5_VARS][20];        /* 19-character units for variables */
+        int TimeStamp[MAXTIMES];        /* Time in HHMMSS format */
+        int DateStamp[MAXTIMES];        /* Date in YYDDD format */
+        float MinVal[MAX_V5_VARS];          /* Minimum variable data values */
+        float MaxVal[MAX_V5_VARS];          /* Maximum variable data values */
+
+        /* This info is used for external function computation */
+        short McFile[MAXTIMES][MAX_V5_VARS];/* McIDAS file number in 1..9999 */
+        short McGrid[MAXTIMES][MAX_V5_VARS];/* McIDAS grid number in 1..? */
+
+        int VerticalSystem;             /* Which vertical coordinate system */
+        float VertArgs[MAXVERTARGS];    /* Vert. Coord. Sys. arguments... */
+
+        /*
+        IF VerticalSystem==0 THEN
+                -- Linear scale, equally-spaced levels in generic units
+                VertArgs[0] = Height of bottom-most grid level in generic units
+                VertArgs[1] = Increment between levels in generic units
+        ELSE IF VerticalSystem==1 THEN
+                -- Linear scale, equally-spaced levels in km
+                VertArgs[0] = Height of bottom grid level in km
+                VertArgs[1] = Increment between levels in km
+        ELSE IF VerticalSystem==2 THEN
+                -- Linear scale, Unequally spaced levels in km
+                VertArgs[0] = Height of grid level 0 (bottom) in km
+                ...                ...
+                VertArgs[n] = Height of grid level n in km
+        ELSE IF VerticalSystem==3 THEN
+                -- Linear scale, Unequally spaced levels in mb
+                VertArgs[0] = Pressure of grid level 0 (bottom) in mb
+                ...             ...
+                VertArgs[n] = Pressure of grid level n in mb
+        ENDIF
+        */
+
+        int Projection;                     /* Which map projection */
+        float ProjArgs[MAXPROJARGS];        /* Map projection arguments... */
+
+        /*
+        IF Projection==0 THEN
+                -- Rectilinear grid, generic units
+                ProjArgs[0] = North bound, Y coordinate of grid row 0
+                ProjArgs[1] = West bound, X coordiante of grid column 0
+                ProjArgs[2] = Increment between rows
+                ProjArgs[3] = Increment between colums
+                NOTES: X coordinates increase to the right, Y increase upward.
+                NOTES: Coordinate system is right-handed.
+        ELSE IF Projection==1 THEN
+                -- Cylindrical equidistant (Old Vis5d)
+                -- Rectilinear grid in lat/lon
+                ProjArgs[0] = Latitude of grid row 0, north bound, in degrees
+                ProjArgs[1] = Longitude of grid column 0, west bound, in deg.
+                ProjArgs[2] = Increment between rows in degrees
+                ProjArgs[3] = Increment between rows in degrees
+                NOTES: Coordinates (degrees) increase to the left and upward.
+        ELSE IF Projection==2 THEN
+                -- Lambert conformal
+                ProjArgs[0] = Standared Latitude 1 of conic projection
+                ProjArgs[1] = Standared Latitude 2 of conic projection
+                ProjArgs[2] = Row of North/South pole
+                ProjArgs[3] = Column of North/South pole
+                ProjArgs[4] = Longitude which is parallel to columns
+                ProjArgs[5] = Increment between grid columns in km
+        ELSE IF Projection==3 THEN
+                -- Polar Stereographic
+                ProjArgs[0] = Latitude of center of projection
+                ProjArgs[1] = Longitude of center of projection
+                ProjArgs[2] = Grid row of center of projection
+                ProjArgs[3] = Grid column of center of projection
+                ProjArgs[4] = Increment between grid columns at center in km
+        ELSE IF Projection==4 THEN
+                -- Rotated
+                ProjArgs[0] = Latitude on rotated globe of grid row 0
+                ProjArgs[1] = Longitude on rotated globe of grid column 0
+                ProjArgs[2] = Degrees of latitude on rotated globe between
+                                grid rows
+                ProjArgs[3] = Degrees of longitude on rotated globe between
+                                grid columns
+                ProjArgs[4] = Earth latitude of (0, 0) on rotated globe
+                ProjArgs[5] = Earth longitude of (0, 0) on rotated globe
+                ProjArgs[6] = Clockwise rotation of rotated globe in degrees
+        ELSE IF Projection == 5 THEN
+                -- Mercator
+                ProjArgs[0] = Latitude of center of projection
+                ProjArgs[1] = Longitude of center of projection
+                ProjArgs[2] = Row Increment in Kilometers
+                ProjArgs[3] = Column Increment in Kilometers
+        ELSE IF Projection==-1 THEN
+        	ProjArgs[0]    = coordinate of latitude[0] (row[0])
+        	...
+        	ProjArgs[n]    = coordinate of latitude[n] (row[n])
+
+        	ProjArgs[NR]   = coordinate of latitude[0] (column[0])
+        	...
+        	ProjArgs[NR+n] = coordinate of latitude[n] (column[n])
+        ENDIF
+        */
+
+        int CompressMode;        /* 1, 2 or 4 = # bytes per grid point */
+        char FileVersion[10];    /* 9-character version number */
+
+    /* PRIVATE (not to be touched by user code) */
+        unsigned int FileFormat; /* COMP5D file version or 0 if .v5d */
+        int FileDesc;            /* Unix file descriptor */
+        char Mode;               /* 'r' = read, 'w' = write */
+        int CurPos;              /* current position of file pointer */
+        int FirstGridPos;        /* position of first grid in file */
+        int GridSize[MAX_V5_VARS];   /* size of each grid */
+        int SumGridSizes;        /* sum of GridSize[0..NumVars-1] */
+} v5dstruct;
+
+
+
+extern float pressure_to_height( float pressure);
+
+extern float height_to_pressure( float height );
+
+
+
+
+extern int v5dYYDDDtoDays( int yyddd );
+
+extern int v5dHHMMSStoSeconds( int hhmmss );
+
+extern int v5dDaysToYYDDD( int days );
+
+extern int v5dSecondsToHHMMSS( int seconds );
+
+
+extern void v5dPrintStruct( const v5dstruct *v );
+
+
+extern v5dstruct *v5dNewStruct( void );
+
+extern void v5dFreeStruct( v5dstruct* v );
+
+extern void v5dInitStruct( v5dstruct *v );
+
+extern int v5dVerifyStruct( const v5dstruct *v );
+
+
+extern void v5dCompressGrid( int nr, int nc, int nl, int compressmode,
+                             const float data[], void *compdata,
+                             float ga[], float gb[],
+                             float *minval, float *maxval );
+
+
+extern void v5dDecompressGrid( int nr, int nc, int nl, int compressmode,
+                               void *compdata,
+                               float ga[], float gb[],
+                               float data[] );
+
+
+extern int v5dSizeofGrid( const v5dstruct *v, int time, int var );
+
+
+extern v5dstruct *v5dOpenFile( const char *filename, v5dstruct *v );
+
+
+extern int v5dCreateFile( const char *filename, v5dstruct *v );
+
+
+extern v5dstruct *v5dUpdateFile( const char *filename, v5dstruct *v );
+
+
+extern int v5dCloseFile( v5dstruct *v );
+
+
+extern int v5dReadCompressedGrid( v5dstruct *v,
+                                  int time, int var,
+                                  float *ga, float *gb,
+                                  void *compdata );
+
+
+extern int v5dReadGrid( v5dstruct *v, int time, int var, float data[] );
+
+
+extern int v5dWriteCompressedGrid( const v5dstruct *v,
+                                   int time, int var,
+                                   const float *ga, const float *gb,
+                                   const void *compdata );
+
+
+extern int v5dWriteGrid( v5dstruct *v, int time, int var, const float data[] );
+
+  /* JPE added 09-19-2000  */
+extern int v5dCreateStruct( v5dstruct *v, int numtimes, int numvars,
+										int nr, int nc, const int nl[],
+										const char varname[MAX_V5_VARS][10],
+										const int timestamp[], const int datestamp[],
+										int compressmode,
+										int projection,
+										const float proj_args[],
+										int vertical,
+										const float vert_args[] );
+
+
+
+#ifdef __cplusplus
+}                               /* extern "C" */
+#endif				/* __cplusplus */
+
+#endif
diff --git a/external_functions/v5d/v5d_platform_specific_flags.mk.i386-linux b/external_functions/v5d/v5d_platform_specific_flags.mk.i386-linux
new file mode 100644
index 0000000..7a46f1c
--- /dev/null
+++ b/external_functions/v5d/v5d_platform_specific_flags.mk.i386-linux
@@ -0,0 +1,8 @@
+#
+# v5d_platform_specific_includes.mk.i486-linux
+#
+# This file is included in the Vis5D External Function Makefiles and defines
+# platform specific macros 
+
+
+V5DFLAGS          = -DLITTLE
diff --git a/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-darwin b/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-darwin
new file mode 100644
index 0000000..7a46f1c
--- /dev/null
+++ b/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-darwin
@@ -0,0 +1,8 @@
+#
+# v5d_platform_specific_includes.mk.i486-linux
+#
+# This file is included in the Vis5D External Function Makefiles and defines
+# platform specific macros 
+
+
+V5DFLAGS          = -DLITTLE
diff --git a/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-linux b/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-linux
new file mode 100644
index 0000000..7a46f1c
--- /dev/null
+++ b/external_functions/v5d/v5d_platform_specific_flags.mk.x86_64-linux
@@ -0,0 +1,8 @@
+#
+# v5d_platform_specific_includes.mk.i486-linux
+#
+# This file is included in the Vis5D External Function Makefiles and defines
+# platform specific macros 
+
+
+V5DFLAGS          = -DLITTLE
diff --git a/external_functions/v5d/v5df_fer.h b/external_functions/v5d/v5df_fer.h
new file mode 100644
index 0000000..e5ecdb9
--- /dev/null
+++ b/external_functions/v5d/v5df_fer.h
@@ -0,0 +1,40 @@
+C v5df.h
+
+C Include file for using v5d functions from FORTRAN programs
+
+
+C Function prototypes.  See the README file for details.  These are
+C the functions you'll want to use for writing v5d file converters.
+
+c Note: Ansley Manke 10/98. Ferret-external-functions version of this file, with 
+c MAXVARS changed to MAX_V5_VARS. Make the same change in v5d.h, v5d.c, and 
+c v5df_fer.h
+
+
+      integer v5dcreate
+
+      integer v5dcreatesimple
+
+      integer v5dwrite
+
+      integer v5dmcfile
+
+      integer v5dclose
+
+
+C 5-D grid limits, must match those in v5d.h!!!
+      integer MAX_V5_VARS, MAXTIMES, MAXROWS, MAXCOLUMNS, MAXLEVELS
+
+      parameter (MAX_V5_VARS=200)
+      parameter (MAXTIMES=400)
+      parameter (MAXROWS=400)
+      parameter (MAXCOLUMNS=400)
+      parameter (MAXLEVELS=400)
+
+C Missing values
+      real MISSING
+      integer IMISSING
+
+      parameter (MISSING=1.0E35)
+      parameter (IMISSING=-987654)
+
diff --git a/external_functions/v5d/vis5d.h b/external_functions/v5d/vis5d.h
new file mode 100644
index 0000000..923a64f
--- /dev/null
+++ b/external_functions/v5d/vis5d.h
@@ -0,0 +1,112 @@
+/*
+ * Vis5D system for visualizing five dimensional gridded data sets.
+ * Copyright (C) 1990 - 2000 Bill Hibbard, Johan Kellum, Brian Paul,
+ * Dave Santek, and Andre Battaiola.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * As a special exception to the terms of the GNU General Public
+ * License, you are permitted to link Vis5D with (and distribute the
+ * resulting source and executables) the LUI library (copyright by
+ * Stellar Computer Inc. and licensed for distribution with Vis5D),
+ * the McIDAS library, and/or the NetCDF library, where those
+ * libraries are governed by the terms of their own licenses.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+/*
+ * This configuration file contains options which can be safely
+ * changed by the user.
+ */
+
+
+
+#ifndef VIS5D_H
+#define VIS5D_H
+
+
+/*
+ * Amount of physical RAM in megabytes:
+ * vis5d normally uses a bounded amount of memory to avoid swapping.
+ * When the limit is reached, the least-recently-viewed graphics will
+ * be deallocated.  If MBS is set to 0, however, vis5d will use ordinary
+ * malloc/free and not deallocate graphics (ok for systems with a lot
+ * of memory (>=128MB)).
+ */
+#ifdef VIS5D_MAX_MEM /* from config.h, via configure --with-memory=MB */
+#  define MBS VIS5D_MAX_MEM
+#else
+#  define MBS 0
+#endif
+
+
+
+/* Default topography file: */
+#define TOPOFILE "EARTH.TOPO"
+
+
+/* Default map lines files: */
+#define WORLDFILE "OUTLSUPW"
+#define USAFILE "OUTLUSAM"
+
+
+/* Default filename of Tcl startup commands: */
+#define TCL_STARTUP_FILE "vis5d.tcl"
+
+
+/* Default directory to search for user functions: */
+#define FUNCTION_PATH "userfuncs"
+
+
+/* Default animation rate in milliseconds: */
+#define ANIMRATE 100
+
+#define	DEFAULT_MAXTMESH	-1	/* no max	*/
+#define	DEFAULT_VSTRIDE		4	
+
+
+/* Default scale and exponent values for logrithmic vertical coordinate system: */
+#define DEFAULT_LOG_SCALE  1012.5
+#define DEFAULT_LOG_EXP  -7.2
+
+#define DEFAULT_SOUNDFONTNAME "6x12"
+
+/**********************************************************************/
+/**********************************************************************/
+/***          USERS:  DON'T CHANGE ANYTHING BEYOND THIS POINT       ***/
+/**********************************************************************/
+/**********************************************************************/
+
+/*
+ * Define BIG_GFX to allow larger isosurfaces, contour slices, etc. if
+ * there's enough memory.
+#if MBS==0 || MBS>=128
+#  define BIG_GFX
+#endif
+ */
+
+#define BIG_GFX
+
+
+/*
+ * Shared by code above and below API:
+ */
+#define MAX_LABEL   1000
+#define MAX_FUNCS   100
+
+
+
+#endif
diff --git a/external_functions/v5d/vis5d_append.jnl b/external_functions/v5d/vis5d_append.jnl
new file mode 100644
index 0000000..1b4a714
--- /dev/null
+++ b/external_functions/v5d/vis5d_append.jnl
@@ -0,0 +1,35 @@
+\cancel mode verify 
+
+! Description:  Set filename and write a vis5d file with up to 8 variables.
+!  Data is written to a scratch file, then appended to the data in the file.
+
+
+! Script usage:
+!                arg 1     arg 2      arg 3       arg 4           arg 9   
+!      GO wv5d [file-name]  variable1 [variable2] [variable3] ... [variable8]
+
+!       defaults: file-name="vis5d_out.v5d"
+!    
+!  Must have at least one variable
+!  Default to 0 any more variables not specified.
+
+! test argument before performing any actions
+
+query/ignore $2"<vis5d_append writes at least one variable to the file. Supply variable name"
+
+
+!  Write the scratch file with new time records.
+ 
+DEFINE SYMBOL VIS5D_FILENAME = appnd_scratch.v5d
+let vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, "appnd_scratch.v5d")
+LOAD/TEMPORARY vflag
+
+!  v5dappend utility appends the new file onto the old.
+
+MESSAGE/CONTINUE !
+sp v5dappend appnd_scratch.v5d $1%vis5d_out.v5d%
+sp rm appnd_scratch.v5d
+
+set mode/last verify
+
+
diff --git a/external_functions/v5d/vis5d_start.jnl b/external_functions/v5d/vis5d_start.jnl
new file mode 100644
index 0000000..62167ed
--- /dev/null
+++ b/external_functions/v5d/vis5d_start.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! vis5d_start.jnl --  Starts vis5d for a file in .v5d format
+!                   
+! Ansley Manke
+! 7/98
+ 
+! Description:  Set filename and start vis5d .
+ 
+!                          arg 1     
+!  usage:  GO vis5d_start file-name 
+ 
+!  Must have the filename.
+ 
+!query/ignore $1"<Argument 1 is the Vis5D file name."
+define symbol filename $1"vis5d_out.v5d"
+sp vis5d -box 2 1 1 -date ($filename)
diff --git a/external_functions/v5d/vis5d_write.jnl b/external_functions/v5d/vis5d_write.jnl
new file mode 100644
index 0000000..4eca30b
--- /dev/null
+++ b/external_functions/v5d/vis5d_write.jnl
@@ -0,0 +1,34 @@
+\cancel mode verify 
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! wv5d.jnl
+! *acm* 7/98
+ 
+! Description:  Write up to 8 Ferret variables to a Vis5D file.
+
+!                                arg 1   arg 2  arg 3  arg 4      arg 9   
+!  usage:  yes? GO vis5d_write filename  var1  [var2] [var3] ... [var8]
+! $1 - the Vis5D file name, defaults to vis5d_out.v5d
+! $2 - First Ferret variable to write
+! $3 - (optional) further variables to write
+! ...
+! $9 - (optional) further variables to write
+
+! example:
+!   yes? SET DATA coads_climatology
+!   yes? GO vis5d_write coads-clim.v5d sst airt uwnd vwnd
+
+! Check arguments
+
+QUERY/IGNORE $2"<vis5d_write writes at least one variable to the file. Supply variable name"
+
+!  Define the file and load vflag to call the external function and write it.
+
+LET/QUIET vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, "$1%vis5d_out.v5d%")
+
+LOAD/TEMPORARY vflag
+
+!  Give an option of viewing the file now.
+
+SAY To view the file with Vis5D say:   GO vis5d_start $1%vis5d_out.v5d%
+
+set mode/last verify
diff --git a/external_functions/v5d/writev5d.F b/external_functions/v5d/writev5d.F
new file mode 100644
index 0000000..f433961
--- /dev/null
+++ b/external_functions/v5d/writev5d.F
@@ -0,0 +1,1322 @@
+*
+* writev5d.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* June 30 1998
+*
+* This function takes up to 8 variables from ferret data sets
+* and writes them in Vis5D format.  Send in variables to write in the
+* first several parameter positions; fill the remaining positions with "0"
+* and the name of the file to write in the 9th argument. 
+* Requires variables to be on the same x-y grid, grids can vary in depth.
+*
+*  Use v5dcreate, v5dwrite, v5dclose from the v5d utility functions; these
+*  are in binio.c and v5d.c
+*
+*  ACM  25-Mar-1999  put in filename as an argument.
+*
+*  ACM 8/May/99 Use REDUCED axes, call ef_set_work_array_lens 
+*               function to set gwork
+*
+*  ACM 8/99 Read either a date and time or a timestep from the "datebuf"
+*           that is returned from ef_get_axis_dates
+*
+*  ACM 8/00 Initialize variable lowlev
+* 
+*  ACM 11/01 Change testing of Time axis values to allow creating single-time
+*            step files (later perhaps appended together)
+*          -  single timestep and t>=0 use it
+*          -  single timestep and t<0  use date=time=0 (some abstract axes...)
+*          -  multiple timesteps and any t<0 bail out. V5d doesn't allow neg times
+*
+*  ACM 10/03 Pass the ibkwd flag to wrt_v5d_steps. Flip the data in Z only
+*            if the Z axis is a depth axis.
+*  ACM  6/07 Remove Loop 400 in routine settimes: time axes have already been 
+*            tested for whether they are monotonic. This fixes bug 1516. We can go
+*            across the 1999-2000 year boundary, but still only works if the year
+*            span is within 1950 - 2049.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE writev5d_init (id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Write up to 8 variables to a Vis5D-formatted file  V5.1' )
+
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_reduction (id, REDUCED, REDUCED, 
+     .        REDUCED, REDUCED)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .        IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 2)
+
+*  All variables should be on the same grid (except for the vertical 
+*  component). There is no result variable sent back to FERRET - a
+*  Vis5D file is written.
+
+      arg = 1
+      CALL ef_set_arg_name (id, arg, 'V1')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name (id, arg, 'V2')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name (id, arg, 'V3')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name (id, arg, 'V4')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 5
+      CALL ef_set_arg_name (id, arg, 'V5')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 6
+      CALL ef_set_arg_name (id, arg, 'V6')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 7
+      CALL ef_set_arg_name (id, arg, 'V7')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 8
+      CALL ef_set_arg_name (id, arg, 'V8')
+      CALL ef_set_axis_influence (id, arg, YES, YES, YES, YES)
+
+      arg = 9
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name (id, arg, 'FILENAME')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg, 'Name of the Vis5D file to write')
+      CALL ef_set_axis_influence (id, arg, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE writev5d_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T dimensions
+*
+* ef_set_work_array_lens(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+*  Include file for the Vis5D utility functions thad write the file.
+*  We have a separate Ferret version that renames a parameter "MAXVARS.
+
+      INCLUDE 'v5df_fer.h'
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER max_row, min_col, max_col, min_lev, max_lev
+      INTEGER array_num
+      INTEGER nwork, nax
+      INTEGER min_row, iarg, max_lev_all
+
+*  Set work array size. gwork is a work array whose output dimensions
+*  are reset in routine wrt_v5d_steps
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Get max number of rows in all variables
+      min_row = MAXROWS
+      max_row = 1
+      DO 111 iarg = 1, EF_MAX_ARGS
+         IF (arg_lo_ss(X_AXIS,iarg) .NE. ef_unspecified_int4) 
+     .     min_row = min(min_row, arg_lo_ss(X_AXIS,iarg))
+
+         IF (arg_hi_ss(X_AXIS,iarg) .NE. ef_unspecified_int4) 
+     .     max_row = max(max_row, arg_hi_ss(X_AXIS,iarg))
+
+  111 CONTINUE
+      IF (min_row .EQ. ef_unspecified_int4 .OR. 
+     .    max_row .EQ. ef_unspecified_int4) THEN          
+        min_row = 1
+        max_row = 1
+      ENDIF
+      max_row = max_row - min_row + 1
+
+*  Get max number of columns in all variables
+      min_col = MAXCOLUMNS
+      max_col = 1
+      DO 222 iarg = 1, EF_MAX_ARGS
+         IF (arg_lo_ss(Y_AXIS,iarg) .NE. ef_unspecified_int4) 
+     .     min_col = min(min_col, arg_lo_ss(Y_AXIS,iarg))
+
+         IF (arg_hi_ss(Y_AXIS,iarg) .NE. ef_unspecified_int4) 
+     .     max_col = max(max_col, arg_hi_ss(Y_AXIS,iarg))
+
+  222 CONTINUE
+      IF (min_col .EQ. ef_unspecified_int4 .OR. 
+     .    max_col .EQ. ef_unspecified_int4) THEN          
+        min_col = 1
+        max_col = 1
+      ENDIF
+      max_col = max_col - min_col + 1
+
+*  Get total number of levels in all variables together
+
+      min_lev = MAXLEVELS
+      max_lev = 1
+      max_lev_all = 0
+      DO 333 iarg = 1, EF_MAX_ARGS
+         IF (arg_lo_ss(Z_AXIS,iarg) .NE. ef_unspecified_int4) 
+     .     min_lev = min(min_lev, arg_lo_ss(Z_AXIS,iarg))
+
+         IF (arg_hi_ss(Z_AXIS,iarg) .NE. ef_unspecified_int4) THEN
+           max_lev = max(max_lev, arg_hi_ss(Z_AXIS,iarg))
+           max_lev_all = max_lev_all + max_lev
+         ENDIF
+
+  333 CONTINUE
+      IF (min_lev .EQ. ef_unspecified_int4 .OR. 
+     .    max_lev .EQ. ef_unspecified_int4) THEN          
+        min_lev = 1
+        max_lev = 1
+        max_lev_all = 1
+      ENDIF
+      IF (max_lev_all .eq. 0) max_lev_all = 1
+
+*  gwork
+
+      nwork = max_row* max_col* max_lev_all
+
+      array_num = 1
+      CALL ef_set_work_array_dims(id, array_num, 1, 1, 1, 1, 
+     .     NWORK, 1, 1, 1)
+
+*  ax_vals
+
+      nax = 4* max( max_row, max_col, max_lev_all)
+      array_num = 2
+      CALL ef_set_work_array_dims(id, array_num, 1, 1, 1, 1, 
+     .     nax, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE writev5d_compute (id, arg_1, arg_2, arg_3,
+     .   arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, result, 
+     .   gwork, ax_vals)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id, arg
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz, 
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz, 
+     .     mem8lot:mem8hit)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz, 
+     .     mem9lot:mem9hit)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+      REAL gwork(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+
+      REAL*8 ax_vals(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz, wrk2lot:wrk2hit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+ 
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*  Include file for the Vis5D utility functions thad write the file.
+*  We have a separate Ferret version that renames a parameter "MAXVARS.
+
+      INCLUDE 'v5df_fer.h'
+
+      CHARACTER v5d_filename*160
+      CHARACTER arg_name*24, arg_title*128, arg_units*32
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      INTEGER i, m, n
+      INTEGER numtimes, nlev, numvars, nr, nc, ier
+
+      CHARACTER*255 err_msg
+
+*  Set axis and output arrays.     MAX's are from v5df_fer.h
+
+      REAL*8 xax(MAXCOLUMNS), yax(MAXROWS) 
+
+      INTEGER MAXVARS_OUT
+      PARAMETER (MAXVARS_OUT = EF_MAX_ARGS - 1)
+
+      INTEGER timestamp(MAXTIMES), datestamp(MAXTIMES)
+      INTEGER ndep(MAXVARS_OUT)
+
+*  Initialize the variables to missing values
+
+      DATA (datestamp(i),i=1,MAXTIMES) / MAXTIMES*IMISSING /
+      DATA (timestamp(i),i=1,MAXTIMES) / MAXTIMES*IMISSING /
+
+      INTEGER compress, projection, vertical
+
+      INTEGER idx, idy
+      REAL dx, dy, proj_args(4), vert_args(MAXLEVELS)
+      INTEGER lowlev(MAX_V5_VARS)
+
+*  Initialize the variable names
+
+      CHARACTER*10 varname(MAXVARS_OUT)
+      DATA varname/'var1', 'var2', 'var3', 'var4', 'var5', 'var6', 
+     .          'var7', 'var8'/
+
+*  Initialize lowlev
+      DATA lowlev/MAX_V5_VARS*0/
+ 
+*  Names of Vis5D utility functions.
+
+c      INTEGER v5dcreate
+c      INTEGER v5dsetlowlev
+c      INTEGER v5dclose
+
+*  names, units, characteristics of variables to send to Vis5D utility functions.
+
+      CHARACTER*24 zaxis_units(MAXVARS_OUT)
+      CHARACTER var_units(MAXVARS_OUT)*32
+      LOGICAL ibkwd(MAXVARS_OUT)
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags (id, bad_flag, bad_flag_result)
+
+*  Get coordinate axes.  Note Ferret lists x axis in East longitude and
+*  Vis5D assumes West longitude.
+
+      CALL ef_get_coordinates (id, ARG1, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xax)
+      CALL ef_get_coordinates (id, ARG1, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yax)
+
+*  Determine number of variables to write.
+
+      numvars = 0
+
+      DO 100 m = 1, MAXVARS_OUT
+         idx = max(arg_incr(X_AXIS,m), 1)
+         idy = max(arg_incr(Y_AXIS,m), 1)
+
+         nc = (arg_hi_ss(X_AXIS, m) - arg_lo_ss(X_AXIS, m))/ idx
+         nr = (arg_hi_ss(Y_AXIS, m) - arg_lo_ss(Y_AXIS, m))/ idy
+
+         IF (nc .GT. 1  .AND.  nr .GT. 1) numvars = m
+  100 CONTINUE
+
+*  Check that the x and y axes for the grids are the same for all variables.
+*  Set number of elements in each direction.  Make a NORMAL axis have 
+*  one element.
+
+      CALL checkxy (id, numvars, xax, yax, nr, nc, dx, dy, ax_vals, 
+     .              err_msg, ier)
+      IF (ier .EQ. 0) GO TO 999
+
+C  Set projection arguments for the Vis5D file. 
+
+      proj_args(1) = yax(nr)
+      proj_args(3) = dy
+      proj_args(2) = 360. - xax(1)
+      proj_args(4) = dx
+
+C  Get file name. variable names, and variable units from ferret internal 
+C  definitions
+
+      arg = 9
+      CALL ef_get_arg_string(id, arg, v5d_filename)
+
+      IF (v5d_filename .EQ. " ") v5d_filename = 'v5d_ferret_file.v5d'		
+
+C  Get  variable names, and variable units from ferret internal definitions
+
+      DO 50 n = 1, numvars
+
+         CALL ef_get_arg_info (id, n, arg_name, arg_title, arg_units)
+         CALL ef_get_axis_info (id,n, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+         varname(n) = arg_name
+         var_units(n) = arg_units
+         zaxis_units(n) = ax_units(3)
+         ibkwd(n) = backward(3) 
+
+   50 CONTINUE 
+
+C  Set time steps.
+
+      CALL settimes (id, numvars, numtimes, timestamp, datestamp, 
+     .               ax_vals, err_msg, ier)
+
+      IF (ier .EQ. 0) GO TO 999
+
+*  Set z steps. 
+
+      CALL setzlevs (id, numvars, vertical, vert_args, zaxis_units,  
+     .               ibkwd, ndep, nlev, lowlev, err_msg, ier)
+
+      IF (ier .EQ. 0) THEN
+         GO TO 999
+      END IF
+
+      compress = 1
+      projection = 0
+
+*  Create the Vis5D file
+      
+      ier = v5dcreate (v5d_filename, numtimes, numvars, nr, nc, 
+     .             ndep, varname, timestamp, datestamp, compress, 
+     .             projection, proj_args, vertical, vert_args)
+
+      IF (ier .EQ. 0) THEN
+        WRITE (err_msg,*) 
+     . '(Above are v5dcreate error msgs.) Error during v5d file create.'
+        GO TO 999
+      END IF
+
+*  Call v5dSetLowLev to specify vertical offset, in grid level index 
+*  for each variable.
+
+      ier = v5dsetlowlev (lowlev)
+
+*  v5dsetlowlev returns 0, but the file still works.
+
+c      IF (ier .EQ. 0) THEN
+c        write(err_msg,*) ' Error during Vis5D set low levels.'
+c        goto 999
+c      END IF
+
+*  Call routine to set variable units in Vis5D file.
+
+      DO 300 m = 1, numvars
+         CALL v5dsetunits (m, var_units(m))
+  300 CONTINUE
+
+*  Fill the data array and write to the Vis5D file for each timestep.
+
+      CALL wrt_v5d_steps (id, nr, nc, ndep, nlev, numvars, ibkwd, arg_1, 
+     .      arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8,  
+     .      result, gwork, err_msg, ier)
+      IF (ier .EQ. 0) THEN
+         GO TO 999
+      END IF
+
+*  Close the v5d file and exit
+
+      ier = v5dclose()
+
+      IF (ier .EQ. 0) THEN
+         WRITE (err_msg,*) 
+     . '(Above are v5dclose error msgs.) Error during v5d file close. '
+         GO TO 999
+      END IF
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+************************************************************************
+
+      SUBROUTINE wrt_v5d_steps (id, nr, nc, ndep, nlev, numvars, ibkwd,
+     .     arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8,  
+     .     result, g, err_msg, ier)
+
+
+*  Write an (x,y,z) grid for each timestep to the Vis5D file.
+c
+c   note that g(1,1,1) is the north west bottom corner
+c   and g(nlat,nlon,ndep) is the south east top corner.
+c
+c  Order of g    3-D array of grid values; 
+c    number of values = nlat*nlon*ndep(var)
+c                ordered as data[row+nr*(col+nc*lev)] where row incr from
+c                North to South, col increases from West to East, and lev
+c                increases from bottom to top
+c
+
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      LOGICAL ibkwd(*)
+      INTEGER id
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .     mem4lot:mem4hit)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .     mem5lot:mem5hit)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .     mem6lot:mem6hit)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz, 
+     .     mem7lot:mem7hit)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz, 
+     .     mem8lot:mem8hit)
+
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,  
+     .     memresloz:memreshiz,memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+      INTEGER  l, m
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+
+      INCLUDE 'v5df_fer.h'
+
+      INTEGER numvars, nr, nc, nl
+      INTEGER ndep(*), nlev, index
+
+      REAL baddat, argdat
+
+      CHARACTER*(*) err_msg
+      integer ier
+
+*  Set output array.
+
+      REAL*4 g(nr, nc, nlev)
+
+c      INTEGER v5dwrite
+
+*  Get subscript limits.
+
+      CALL ef_get_res_subscripts (id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags (id, bad_flag, bad_flag_result)
+  
+*  Fill and write grids in space for each time step and each variable.
+*  i1,j1,k1,l1 argument indices; ferret variables being written.
+*  i2,j2,k2,l2 Vis5D grid indices 1:nc, 1:nr, 1:nl, 1:ntime
+
+      DO 500 m = 1, numvars
+
+         l2 = 1
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+
+            i2 = 1
+            DO 300 i1 = arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)
+
+               j2 = 1
+               DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1),arg_hi_ss(Y_AXIS,ARG1)
+
+                  k1 = arg_lo_ss(Z_AXIS,m)      ! depth may vary w/ m
+
+                  nl = ndep(m)
+                  DO 100 k2 = 1, nl
+                     index = k2
+                     IF (ibkwd(m)) index = nl-k2+1
+                     baddat = bad_flag(m)
+ 
+                     IF (m .EQ. 1) argdat = arg_1(i1,j1,k1,l1) 
+                     IF (m .EQ. 2) argdat = arg_2(i1,j1,k1,l1) 
+                     IF (m .EQ. 3) argdat = arg_3(i1,j1,k1,l1) 
+                     IF (m .EQ. 4) argdat = arg_4(i1,j1,k1,l1) 
+                     IF (m .EQ. 5) argdat = arg_5(i1,j1,k1,l1) 
+                     IF (m .EQ. 6) argdat = arg_6(i1,j1,k1,l1) 
+                     IF (m .EQ. 7) argdat = arg_7(i1,j1,k1,l1) 
+                     IF (m .EQ. 8) argdat = arg_8(i1,j1,k1,l1) 
+
+
+                     IF (argdat .EQ. baddat) THEN
+                        g(nr-j2+1,i2,index) = MISSING
+                     ELSE 
+                        g(nr-j2+1,i2,index) = argdat
+                     END IF
+
+                     k1 = k1 + arg_incr(Z_AXIS,m)	! depth may vary w/ m
+ 100              CONTINUE
+
+                  j2 = j2 + 1
+ 200           CONTINUE
+
+               i2 = i2 + 1
+ 300        CONTINUE
+   
+*  Write the time step to the Vis5D file.
+
+            ier = v5dwrite (l2, m, g)		! l=time step, m=variable #
+
+            IF (ier .EQ. 0) THEN
+               WRITE (err_msg,*) ' Error during v5d file write. ',
+     .                           ' Time step ', l
+               GO TO 999
+            END IF
+
+            l2 = l2 + 1
+ 400     CONTINUE
+
+ 500  CONTINUE
+
+      RETURN
+
+ 999  CONTINUE
+
+      RETURN
+
+      END
+
+*                                                                      ^
+*                                                                      |
+************************************************************************
+
+      SUBROUTINE checkxy (id, numvars, xax, yax, nr, nc, dx, dy, 
+     .         ax_vals, err_msg, ier)
+
+*  Check that there is at least one variable to write to the Vis5D file.
+*  Check the x and y axes for the variables: they must agree with xax, yax
+*  from arg_1, and not exceed the limits in the include file v5df.h
+*  Set nr = # rows and nc = # columns.
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INCLUDE 'v5df_fer.h'
+
+* After initialization, the 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER ier
+      INTEGER i, j, m
+      INTEGER numvars, nc, nr, ncm, nrm
+
+      REAL*8 xax(*), yax(*), ax_vals(*)
+      REAL   dx, dy
+
+      CHARACTER*(*) err_msg
+
+      CHARACTER ax_name(4)*16, ax_units(4)*16
+      LOGICAL backward(4), modulo(4), regular(4)
+
+      IF (numvars .LT. 1) THEN
+         ier = 1
+      ELSE
+         ier = 1
+         CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+         CALL ef_get_axis_info (id, 1, ax_name, ax_units, backward,
+     .     modulo, regular)
+
+*  Set number of elements in each direction.  Let a NORMAL axis have 
+*  one element.
+
+      IF (arg_hi_ss(X_AXIS,ARG1) .EQ. arg_lo_ss(X_AXIS,ARG1)  .OR.  
+     .       arg_incr(X_AXIS,ARG1) .EQ. 0) THEN 
+         dx = 1.
+         nc = 1
+      ELSE
+         dx = abs(xax(2) - xax(1))
+         nc = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+*  Check that the x axis is equally-spaced.
+
+         IF (.NOT. regular(1)) THEN
+            WRITE (err_msg, *) 'Vis5D uses only equally spaced ',
+     .            'X-axis.  Regrid the data in x.'
+            GO TO 999
+         END IF
+
+      END IF
+
+      IF (arg_hi_ss(Y_AXIS,ARG1) .EQ. arg_lo_ss(Y_AXIS,ARG1)  .OR.  
+     .       arg_incr(Y_AXIS,ARG1) .EQ. 0) THEN 
+         dy = 1.
+         nr = 1
+      ELSE
+         dy = abs(yax(2) - yax(1))
+         nr = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+*  Check that the axis is equally-spaced.
+
+         IF (.NOT. regular(2)) THEN
+            WRITE (err_msg, *) 'Vis5D uses only equally spaced ',
+     .            'Y-axis.  Regrid the data in y.'
+            GO TO 999
+         END IF
+
+  
+      END IF
+
+C  Check number of columns and rows against Vis5D maxima.
+
+         IF (nr .GT. MAXROWS) THEN
+            WRITE (err_msg, *) nr, 'Too many rows. Vis5D Max is ', 
+     .                  MAXROWS
+            ier = 0
+            GO TO 999
+         ENDIF
+         IF (nc .GT. MAXCOLUMNS) THEN
+            WRITE (err_msg, *) nr, 'Too many columns. Vis5D Max is ',
+     .                  MAXCOLUMNS
+            ier = 0
+            GO TO 999
+         ENDIF
+
+         IF (nr .LE. 1  .OR.  nc .LE. 1)  THEN
+            WRITE (err_msg, *) 'The grid for all variables must',
+     .         ' have two or more grid points in x and y directions '
+             ier = 0
+             GO TO 999
+         ENDIF
+
+*  Get coordinate axes for variables 2 through numvars.
+*  Check with Vis5D max and compare with xax and yax.
+
+         DO 400 m = 2, numvars
+            ncm = 
+     .        (arg_hi_ss(X_AXIS,m) - arg_lo_ss(X_AXIS,m) + 1)/ 
+     .         arg_incr(X_AXIS,m)
+
+            IF (ncm .GT. MAXCOLUMNS) ier = 0
+            IF (ncm .NE. nc) ier = 0
+
+            CALL ef_get_coordinates (id, m, X_AXIS, 
+     .        arg_lo_ss(X_AXIS, m), arg_hi_ss(X_AXIS, m), ax_vals)
+           
+
+            DO 300 i = 1, nc
+               IF (xax(i) .NE. ax_vals(i)) ier = 0
+ 300        CONTINUE
+
+ 400     CONTINUE  
+
+         IF (ier .eq. 0) THEN
+            WRITE (err_msg, *) 'Vis5D X axes for all variables must ',
+     .           ' be the same.'
+            go to 999
+         ENDIF
+
+         DO 600 m = 2, numvars
+            nrm = 
+     .        (arg_hi_ss(Y_AXIS,m) - arg_lo_ss(Y_AXIS,m) + 1)/ 
+     .         arg_incr(Y_AXIS,m)
+
+            IF (nrm .GT. MAXROWS) ier = 0
+            IF (nrm .NE. nr) ier = 0
+
+           CALL ef_get_coordinates (id, m, Y_AXIS, 
+     .         arg_lo_ss(Y_AXIS, m), arg_hi_ss(Y_AXIS, m), ax_vals)
+
+            DO 500 j = 1, nr
+               IF (yax(j) .NE. ax_vals(j)) ier = 0
+ 500        CONTINUE
+
+ 600     CONTINUE  
+         IF (ier .eq. 0) THEN
+            WRITE (err_msg, *) 'Vis5D Y axes for all variables must ',
+     .           ' be the same.'
+            go to 999
+         ENDIF
+
+      END IF
+
+      RETURN
+  999 ier = 0
+      END
+
+*                                                                      ^
+*                                                                      |
+************************************************************************
+
+      SUBROUTINE settimes (id, numvars, numtimes, timestamp, datestamp, 
+     .                     ax_vals, err_msg, ier)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INCLUDE 'v5df_fer.h'
+
+* After initialization, the 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+
+      INTEGER id, iarg, l
+      INTEGER numtimes
+
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER ier, m, nlm, icentury
+      INTEGER numvars
+
+      REAL*8 tax(MAXTIMES), ax_vals(*)
+      INTEGER lasttime, thistime, lastdate, thisdate
+
+      INTEGER iyear, ihour, iminute, isec
+      CHARACTER*3 cmon
+      INTEGER day_of_mon, day_of_year
+      CHARACTER*20 datebuf(MAXTIMES)
+      CHARACTER*(*) err_msg
+
+      INTEGER timestamp(*), datestamp(*)
+
+      ier = 1
+
+*  Set time steps; check that there arent too many for Vis5D.
+
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      IF (arg_hi_ss(T_AXIS,ARG1) .EQ. arg_lo_ss(T_AXIS,ARG1) .or.
+     .      arg_incr(T_AXIS,ARG1) .EQ. 0) THEN 
+         numtimes = 1
+      ELSE
+         numtimes = 
+     .     (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1)/
+     .     arg_incr(T_AXIS,ARG1)
+         IF (numtimes .GT. MAXTIMES) THEN
+            ier = 0
+            WRITE (err_msg,*) ' Vis5D has a limit of ', MAXTIMES, 
+     .        ' timesteps.', ' DATA region has', numtimes
+            GO TO 999
+         END IF
+      END IF
+
+*  Get time axis coordinates for first variable.
+
+      CALL ef_get_coordinates (id, ARG1, T_AXIS, 
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), tax)
+
+*  Get time axis for remaining variables.  Check that thay are 
+*  the same as for the first variable.  
+
+      DO 200 m = 2, numvars
+         IF (arg_hi_ss(T_AXIS,m) .EQ. arg_lo_ss(T_AXIS,m) .or.
+     .      arg_incr(T_AXIS,m) .EQ. 0) THEN 
+            nlm = 1
+         ELSE
+            nlm = 
+     .        (arg_hi_ss(T_AXIS,m) - arg_lo_ss(T_AXIS,m) + 1)/ 
+     .         arg_incr(T_AXIS,m)
+         ENDIF
+
+         IF (nlm .NE. numtimes) THEN
+            ier = 0
+            WRITE (err_msg,*) ' Vis5D: All variables must have same ',
+     .                        '# time steps'
+            GO TO 999
+         END IF
+
+         CALL ef_get_coordinates (id, m, T_AXIS, 
+     .       arg_lo_ss(T_AXIS, m), arg_hi_ss(T_AXIS, m), ax_vals)
+
+         IF (numtimes .GT. 1) THEN
+
+            DO 100 l = 1, numtimes
+               IF (tax(l) .NE. ax_vals(l)) GO TO 999
+ 100        CONTINUE
+         ELSE
+            ax_vals(1) = tax(1)
+         ENDIF
+
+ 200  CONTINUE  
+
+* If the time axis of grid is not a normal axis, convert to dates and
+* write to timestamp and datestamp in the form that Vis5D expects.
+
+      IF (numtimes .EQ. 1  .AND. tax(1) .LT. 0) THEN    ! some normal axes have -t.
+         datestamp(1) = 0
+         timestamp(1) = 0
+
+      ELSE
+
+*  If there are negative time-axis values, bail out.
+
+         DO 101 l = 1, numtimes
+            IF (tax(l) .LT. 0) THEN
+               WRITE (err_msg,*) 
+     .          ' Vis5D does not allow negative values on time axis.'
+               GO TO 999
+            ENDIF
+
+101      CONTINUE
+
+         iarg = 1
+         CALL ef_get_axis_dates (id, iarg, tax, numtimes, datebuf)
+
+*  Set up the datestamp and timestamp
+
+         DO 300 l = 1, numtimes
+
+*  If datebuf is in form "DD-MON-YYYY HH:MM:SS".  Read date and time; convert
+*  to Vis5D time and date stamps.
+
+            IF (datebuf(l)(3:3) .EQ. '-') THEN
+               READ (datebuf(l), 110, err=900) day_of_mon, cmon, iyear
+               CALL juldate (cmon, day_of_mon, iyear, day_of_year)
+
+               READ (datebuf(l), 120, err=900) ihour, iminute, isec
+
+* note:  Vis5D uses 2-digit years; years YY <=50 are considered to be 20YY,
+*        years YY > 50 are considered to be 19YY.
+
+               IF (iyear .GT. 0) THEN
+                  icentury = iyear/ 100
+                  icentury = icentury * 100
+                  iyear = iyear - icentury
+                  if (iyear .eq. 100) iyear = 0
+
+               END IF
+ 
+               datestamp(l) = 1000* iyear + day_of_year	
+               timestamp(l) = isec + 100 * iminute + 10000* ihour
+
+*  datebuf not in form "DD-MON-YYYY HH:MM:SS".  Try just reading the time as 
+*  a number...
+
+            ELSE
+               datestamp(l) = 0
+               READ (datebuf(l), *, err=900) timestamp(l)
+
+            ENDIF	! IF (datebuf(l)(3:3) .EQ. '-')
+
+  300    CONTINUE
+
+      ENDIF		! IF (numtimes .EQ. 1) 
+
+
+  110 FORMAT (i2, 1x, a3, 1x, i4)
+  120 FORMAT (11x, 3(1x,i2))
+
+      RETURN
+
+*  Error reading the dates/times. 
+
+  900 CONTINUE
+
+      WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for Vis5D',  
+     .  datebuf(l)
+
+  999 ier = 0
+      RETURN
+      END
+
+*                                                                      ^
+*                                                                      |
+************************************************************************
+
+      SUBROUTINE juldate (cmon, day_of_mon, iyr, day_of_year)
+
+*  Convert character month and day of month to day of year.
+
+      INTEGER i, iyr
+      CHARACTER*(*) cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, ndaymo(12)
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+      DATA ndaymo/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
+ 
+
+      imon = 0
+      DO 100 i = 1, 12
+        IF (cmon .EQ. months(i)) imon = i
+  100 CONTINUE
+
+      IF (mod(iyr, 4) .EQ. 0) ndaymo(2) = 29
+
+      day_of_year = day_of_mon
+      DO 200 i = 1, imon - 1
+         day_of_year = day_of_year + ndaymo(i)
+  200 CONTINUE
+
+      RETURN
+      END
+*                                                                      ^
+*                                                                      |
+************************************************************************
+      SUBROUTINE setzlevs (id, numvars, vertical, vert_args, 
+     .            zaxis_units, ibkwd, ndep, nlev, lowlev, err_msg, ier)
+
+*  Set z steps.  Must be either the same for all variables or some variables 
+*  can be surface data only.
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+      INTEGER numvars, nlev, ndepmax, nltot, lv
+      INTEGER m, l, ier
+
+
+      INCLUDE 'v5df_fer.h'
+
+      INTEGER ndep(*), vertical, vert(MAX_V5_VARS)
+      INTEGER lowlev(*)
+      REAL vert_args(MAXLEVELS), sort_args(MAXLEVELS*EF_MAX_ARGS)
+      REAL*8 zax(MAXLEVELS)
+      REAL all_levs(MAXLEVELS, EF_MAX_ARGS)
+
+      LOGICAL seq, ibkwd(*)
+
+      REAL dep_fac(EF_MAX_ARGS)
+
+      CHARACTER*(*) zaxis_units(*), err_msg
+
+*  Get axis subscripts and coordinates.
+
+      CALL ef_get_arg_subscripts (id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nlev = 1
+      ndepmax = 1
+      DO 200 m = 1, numvars
+
+         CALL ef_get_coordinates (id, m, Z_AXIS, 
+     .   arg_lo_ss(Z_AXIS, m), arg_hi_ss(Z_AXIS, m), zax)
+
+*  Get axis units and determine conversion to KM if possible.  If
+*  units are other than cm, m, km, or mb then they will be Vis5D 
+*  "generic units"; vertical = 0
+* !ACM  ???  Leave cm or m alone and let them be generic units...
+* !ACM       But, if some are CM, others in M, want to convert to same units...
+
+         IF (zaxis_units(m) .EQ. 'cm'  .OR. 
+     .         zaxis_units(m) .EQ. 'CM') THEN
+            dep_fac(m) = 1./1000000.
+            vert(m) = 1
+
+         ELSE IF (zaxis_units(m) .EQ. 'm'  .OR.  zaxis_units(m) .EQ. 'M'  
+     .            .OR.  zaxis_units(m) .EQ. 'METERS'   .OR.  
+     .            zaxis_units(m) .EQ. 'meters') THEN
+            dep_fac(m) = 1./1000.
+            vert(m) = 1
+
+         ELSE IF (zaxis_units(m) .EQ. 'km'  .OR. 
+     .             zaxis_units(m) .EQ. 'KM') THEN
+            dep_fac(m) = 1.
+            vert(m) = 1
+
+         ELSE IF (zaxis_units(m) .EQ. 'mb'  .OR.  
+     .             zaxis_units(m) .EQ. 'MB') THEN
+            dep_fac(m) = 1.
+            vert(m) = 3
+
+         ELSE 
+            dep_fac(m) = 1.
+            vert(m) = 0
+         END IF
+
+*  !ACM Here we could check and see if all the vertical axes are the same, and
+*  set vert_args more simply if so. 
+
+*  vertical = 0 for equally spaced levels in generic units 
+*  vertical = 1 for equally spaced levels in km
+*  vertical = 2 for unequally spaced levels in km
+*  vertical = 3 for unequally spaced levels in mb
+
+*  Get delta-z and determine if the axis is equally spaced.
+
+         IF (arg_hi_ss(Z_AXIS,m) .EQ. arg_lo_ss(Z_AXIS,m)) THEN 
+            ndep(m) = 1 
+            vert(m) = 0
+
+*  Put DATA for a var w/normal axis at the surface.
+            all_levs(1,m) = 0.	
+         ELSE
+
+            vertical = 2
+
+            ndep(m) = 
+     .        (arg_hi_ss(Z_AXIS,m) - arg_lo_ss(Z_AXIS,m) + 1)/ 
+     .         arg_incr(Z_AXIS,m)
+
+            DO 100 l = 1, ndep(m)
+               IF (ibkwd(m)) THEN
+                  all_levs(ndep(m)-l+1, m) = -1.D0* zax(l)* dep_fac(m) 
+               ELSE
+                  all_levs(l,m) = zax(l)* dep_fac(m) 
+               END IF
+  100       CONTINUE
+
+
+        END IF
+
+         ndepmax = max(ndepmax, ndep(m))
+  200 CONTINUE
+
+!  !!!  Vis5D allows us to start some variables at one level and others
+!       somewhere else.  doesn't have a structure to allow skipping some
+!       levels in any variable. 
+
+!ACM  Because of the result grid being set as inherited from the first 
+!     variable, need to have any variables with depth levels come first
+!     in the calling sequence to writev5d.F ??  Test for this...
+
+*  Sort the union of all levels into the array vert_args.
+
+      IF (ndepmax .GT. 1) THEN
+         nltot = 0
+         DO 400 m = 1, numvars
+            DO 300 l = 1, ndep(m)
+               nltot = nltot + 1
+               sort_args(nltot) = all_levs(l, m)
+  300       CONTINUE
+  400    CONTINUE
+
+         CALL shellsort1 (sort_args, nltot)
+
+*  Remove duplicates.
+
+         nlev = 1
+         vert_args(1) = sort_args(1) 
+         DO 500 l = 2, nltot 
+            IF (sort_args(l) .NE. sort_args(nlev) ) THEN
+               nlev = nlev + 1
+               sort_args(nlev) = sort_args(l)
+               vert_args(nlev) = sort_args(l)
+            END IF
+  500    CONTINUE
+
+         if (nlev .GT. MAXLEVELS) THEN
+            WRITE (err_msg,*) 'Too many levels, all variables ',
+     .           'together. Max is ', MAXLEVELS
+            ier = 0
+            goto 999
+         ENDIF
+
+*  Compare the set of levels for each variable with vert_args.  If the 
+*  variable's levels are in vert_args with the sequence intact, then set 
+*  lowlev appropriately.
+
+         DO 800 m = 1, numvars
+
+*  Find the first element of vert_args that matches the low level of this var.
+
+            seq = .false.
+            DO 700 l = 1, nlev
+               IF (all_levs(1, m) .EQ. vert_args(l) ) THEN
+                  lowlev(m) = l - 1
+                  seq = .true.
+
+                  DO 600 lv = 1, ndep(m)
+                     IF (all_levs(lv, m)  .NE.  vert_args(l+lv-1) )
+     .                   seq = .false.
+  600             CONTINUE
+
+               END IF
+  700       CONTINUE
+
+            IF (.NOT. seq) THEN
+               WRITE (err_msg,*) ' IF levels for different variables ', 
+     .             'intersect they must be in sequence with no ', 
+     .             'skips.  Levels for argument ', m, 
+     .             ' not sequential'
+               GO TO 999
+            END IF
+
+  800    CONTINUE
+
+      ELSE
+         vertical = 0
+         vert_args(2) = 1.
+
+      END IF	! ndepmax .GT. 1
+
+      ier = 1
+
+      RETURN
+
+  999 ier = 0
+
+      RETURN
+      END
+
+      SUBROUTINE shellsort1 (SDAT, N)
+
+
+*from http://www.cs.mcgill.ca/~ratzer/progs15_6.html  23-APR-1998
+* Changed data to REAL. 
+* Removed NCOUNTS, NCOMP, NSWAP.
+
+      REAL     SDAT(*)
+      INTEGER  M, N, I, J
+
+      M=N
+      DO WHILE (M .GT. 1)
+         M=(M+2)/3
+         DO I=M+1,N
+            DO J=I,M+1,-M
+               IF (SDAT(J-M) .GE. SDAT(J)) THEN
+                 CALL swapr (SDAT,J,J-M)
+               END IF
+            END DO 
+         END DO 
+      END DO
+      RETURN
+      END !SUBROUTINE SHELL
+!
+
+      SUBROUTINE swapr (SDAT,K,L)
+      REAL SDAT(*), S
+      INTEGER K,L
+      S=SDAT(K)
+      SDAT(K)=SDAT(L)
+      SDAT(L)=S
+      RETURN
+      END !SUROUTINE SWAP
+
+
diff --git a/external_functions/zaxr/Makefile b/external_functions/zaxr/Makefile
new file mode 100644
index 0000000..1eec861
--- /dev/null
+++ b/external_functions/zaxr/Makefile
@@ -0,0 +1,54 @@
+#
+# Makefile for Ferret External Functions
+#
+# January 20 1998
+# Jonathan Callahan
+#
+#  15-Nov-1999 Ansley Manke
+#  remove refs to ef_utility/*.o  (now in ferret executable)
+#
+#  ACM 2/2001  debug macros
+
+#
+# include site specific macro definitions
+#
+include ../ef_utility/site_specific.mk
+
+#
+# include platform specific macro definitions
+#
+include ../ef_utility/platform_specific.mk.$(BUILDTYPE)
+
+#
+# Macros
+#
+
+.SUFFIXES: .so
+
+#
+# Rules
+#
+
+.F.so:
+	$(F77) $(FFLAGS) -c $<
+	$(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so
+
+#
+# Targets
+#
+
+# all:	zaxreplace_avg.so zaxreplace_bin.so zaxreplace_lin.so zaxreplace_zlev.so zaxreplace_rev.so
+all:	zaxreplace_xyt.so zaxreplace_lin.so 
+
+debug:
+	$(MAKE) "FFLAGS = $(FFLAGS) $(FFLAGS_DEBUG)" "CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)" all
+
+install:
+	cp *.so $(FER_LOCAL_EXTFCNS)
+
+clean:
+	-rm -f *.o *.so
+
+#
+# End of Makefile
+#
diff --git a/external_functions/zaxr/zaxreplace_avg.F b/external_functions/zaxr/zaxreplace_avg.F
new file mode 100644
index 0000000..ead6c58
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_avg.F
@@ -0,0 +1,488 @@
+*
+* zaxreplace_avg.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1998
+* 11/2001  clarify function description
+*  7/2003  Bug fix; last source point wasnt associated with a dest box
+*          when the destination axis continues beyond the source range
+*
+*
+* Replace Z axis, using weighted averaging over bins
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_avg_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     .  ('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .    'using weighted average' )
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      CALL ef_set_num_work_arrays(id, 8)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_avg_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mz2, mz3
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+
+      mz2 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2))
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+
+      mz2 = 2* mz2
+      mz3 = 2* mz3
+
+*  zaxsrc
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_lo_lim
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_hi_lim
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_lo_new
+      iwork = 4
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_hi_new
+      iwork = 5
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  dbox_lo_lim
+      iwork = 6
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*  dbox_hi_lim
+      iwork = 7
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_avg_compute(id, arg_1, arg_2, arg_3, 
+     .     result, zaxsrc, sbox_lo_lim, sbox_hi_lim, sbox_lo_new, 
+     .     sbox_hi_new, dbox_lo_lim, dbox_hi_lim)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER ifirst, iw, nbox, nsrc
+      INTEGER nsrc_lo, nsrc_hi
+      REAL frac, xsrc_min, xsrc_max, xsrc_lo, xsrc_hi, xsrcdiff
+      REAL wtd, arg1_val, arg1_val_last, wtd_last
+      REAL*8 sum, wtdsum
+      REAL dbox_lo, dbox_hi
+c      CHARACTER*132 err_msg
+
+*  Dimension work arrays
+
+      REAL*8 zaxsrc(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz/2, wrk1lot:wrk1hit)
+      REAL*8 sbox_lo_lim(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz/2, wrk2lot:wrk2hit)
+      REAL*8 sbox_hi_lim(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz/2, wrk3lot:wrk3hit)
+      REAL*8 sbox_lo_new(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz/2, wrk4lot:wrk4hit)
+      REAL*8 sbox_hi_new(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz/2, wrk5lot:wrk5hit)
+      REAL*8 dbox_lo_lim(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz/2, wrk6lot:wrk6hit)
+      REAL*8 dbox_hi_lim(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz/2, wrk7lot:wrk7hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      CALL ef_get_coordinates(id, ARG2, Z_AXIS, 
+     .   arg_lo_ss(Z_AXIS, ARG2), arg_hi_ss(Z_AXIS, ARG2), zaxsrc)
+
+      CALL ef_get_box_limits(id, ARG2, Z_AXIS, arg_lo_ss(Z_AXIS, ARG2), 
+     .   arg_hi_ss(Z_AXIS, ARG2), sbox_lo_lim, sbox_hi_lim)
+
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3), 
+     .   arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+      ifirst = 1
+      iw = 0
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*
+
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+
+
+*  Translate the source boxes to the new axis units.
+
+               DO 500 k = arg_lo_ss(Z_AXIS,ARG1), 
+     .                    arg_hi_ss(Z_AXIS,ARG1)
+
+*  Find the point on the source axis just below the box limit.  Interpolate
+*  to get the box limit in new units.
+
+                  nbox = 1
+
+                  DO WHILE (zaxsrc(1,1,nbox,1) .LT. 
+     .                      sbox_lo_lim(1,1,k,1) )
+                     nbox = nbox + 1
+                  ENDDO
+
+                  IF (nbox .eq. 1) THEN 
+                     sbox_lo_new(1,1,k,1) = arg_2(i2,j2,nbox,l2)
+                  ELSE
+                     frac = (sbox_lo_lim(1,1,k,1) - 
+     .                      zaxsrc(1,1,nbox-1,1))/
+     .                   (zaxsrc(1,1,nbox,1) - zaxsrc(1,1,nbox-1,1)) 
+                     sbox_lo_new(1,1,k,1) = arg_2(i2,j2,nbox-1,l2) + 
+     .                      frac* 
+     .                  (arg_2(i2,j2,nbox,l2) - arg_2(i2,j2,nbox-1,l2))
+                  ENDIF
+
+
+                  nbox = 1
+
+                  DO WHILE (zaxsrc(1,1,nbox,1) .LT. sbox_hi_lim(1,1,k,1)
+     .                      .AND.
+     .                  nbox .lt. arg_hi_ss(Z_AXIS,ARG1))
+                     nbox = nbox + 1
+                  ENDDO
+
+                  IF (nbox .eq. 1) THEN 
+                     sbox_hi_new(1,1,k,1) = arg_2(i2,j2,nbox,l2) 
+                  ELSE
+                     frac = (sbox_hi_lim(1,1,k,1) - 
+     .                       zaxsrc(1,1,nbox-1,1))/
+     .                  (zaxsrc(1,1,nbox,1) - zaxsrc(1,1,nbox-1,1)) 
+                     sbox_hi_new(1,1,k,1) = arg_2(i2,j2,nbox-1,l2) + 
+     .                      frac* 
+     .                   (arg_2(i2,j2,nbox,l2) - arg_2(i2,j2,nbox-1,l2))
+                  ENDIF
+
+
+  500          CONTINUE 
+
+* For each z line accumulate weighted source points and weights to get
+* the average value.   Loop through the each destination grid box.
+
+
+               sum = 0.
+               wtdsum = 0.
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+
+                  nsrc_lo = 1
+                  nsrc_hi = 1
+
+                  DO WHILE 
+     .                  (sbox_lo_new(1,1,nsrc_lo,1) .LT. 
+     .                      dbox_lo_lim(1,1,k,1) )
+                     nsrc_lo = nsrc_lo + 1
+                     IF (nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG2)) GO TO 11
+                  ENDDO
+  11              CONTINUE
+
+*  Find any portion of the source box lying in the destination box.
+
+                  DO WHILE 
+     .                  (sbox_lo_new(1,1,nsrc_hi,1) .LE. 
+     .                      dbox_hi_lim(1,1,k,1) )
+                     nsrc_hi = nsrc_hi + 1
+                     IF (nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG2)) GO TO 22
+                  ENDDO
+  22              CONTINUE
+
+                  nsrc_hi = nsrc_hi - 1
+
+*  No source boxes within this destination box.
+
+                  IF (nsrc_hi .LT. nsrc_lo) THEN
+                     IF (wtdsum .NE. 0.) THEN
+                        result(i,j,k,l) = sum / wtdsum
+                     ELSE
+                        result(i,j,k,l) = bad_flag_result
+                     ENDIF
+                     GO TO 160
+                  ENDIF
+
+                  DO 90 nsrc = nsrc_lo, nsrc_hi
+
+*  Get fraction of this source box lying within the destination box. 
+
+	               xsrc_min = sbox_lo_new(1,1,nsrc,1)
+	               xsrc_max = sbox_hi_new(1,1,nsrc,1)
+
+                       dbox_hi = dbox_hi_lim(1,1,k,1)
+                       dbox_lo = dbox_lo_lim(1,1,k,1)
+
+	               xsrc_lo = MAX(xsrc_min, dbox_lo)
+	               xsrc_hi = MIN(xsrc_max, dbox_hi)
+
+                       xsrcdiff = xsrc_max - xsrc_min
+                       wtd = 0.
+                       IF (xsrcdiff .NE. 0.) 
+     .                     wtd = (xsrc_hi - xsrc_lo)/xsrcdiff
+
+                       arg1_val = arg_1(i1,j1,nsrc,l1)
+                       IF (arg1_val .ne. bad_flag(ARG1)) THEN
+	                  sum   = sum  + wtd * arg1_val
+                          wtdsum  = wtdsum + wtd
+
+                          arg1_val_last = arg1_val
+                          wtd_last = wtd
+
+                       ENDIF
+  
+  90              CONTINUE
+
+* If we had any good data, calculate the average.
+
+                  IF (wtdsum .NE. 0.) THEN
+                     result(i,j,k,l) = sum / wtdsum
+
+*  Start next average with remaining weighted part of the last box with
+*  was not within the destination box.
+
+                     sum = (1.- wtd_last)* arg1_val_last
+                     wtdsum = 1.- wtd_last
+                  ELSE 
+                     result(i,j,k,l) = bad_flag_result
+                     sum = 0.
+                     wtdsum = 0.
+                  ENDIF
+
+ 160              CONTINUE
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
diff --git a/external_functions/zaxr/zaxreplace_avg.jnl b/external_functions/zaxr/zaxreplace_avg.jnl
new file mode 100644
index 0000000..0a80f1a
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_avg.jnl
@@ -0,0 +1,153 @@
+! Examples for external function ZAXREPLACE_AVG
+! ACM 8/99
+
+
+define axis/depth/z=0:33:1 zax
+define grid/z=zax gg
+let my_profile = sin(z[g=gg])
+
+list  zaxreplace_avg(my_profile, z[g=gg], Z[z=0.2:33:5])
+
+list my_profile[z=0.2:33:5 at ave]
+
+plot my_profile
+plot/over/line/symbol=2  my_profile[z=0.2:33:5 at ave]
+plot/over/line/symbol=27   zaxreplace_avg(my_profile, z[g=gg], Z[z=0.2:33:5])
+
+message
+
+! ----------------------------
+
+
+use levitus_climatology
+sh data
+show/i=120/j=120/k=1:20 grid temp
+
+
+define axis/z=0:500:100/depth dep100
+define grid/like=GLEVITR1/z=dep100 gl100
+show/k=1:40 grid gl100
+
+
+let a =  zaxreplace_avg(temp, z[gz=ZAXLEVITR], z[gz=dep100])
+
+let b = temp[g=gl100]
+
+set view ul
+shade/y=0/ylimits=0:500:100./levels=(0., 30., 2.)  temp
+
+set view ur
+shade/y=0/ylimits=0:500:100./levels=(0., 30., 2.)  b
+
+set view ll
+shade/y=0/ylimits=0:500:100./levels=(0., 30., 2.) a
+
+let c = b - a
+
+set view lr
+shade/levels=(-15., 15., 2)/y=0/ylimits=0:500:100.  c
+! shade/levels=(-2., 2., 0.2)/y=0/ylimits=0:500:100.  c
+
+message
+
+set region/x=150e/y=0
+
+can view 
+plot/symbol=2/title=" " b
+plot/line/symbol=28/over/title="original temp" temp
+plot/symbol=2/over/title="regridded temp" b
+plot/symbol=18/over/title="zaxr" a
+
+message
+
+! ----------------------------
+
+can region
+use levitus_climatology
+
+define axis/z=0:5000:1000/depth dep1000
+define grid/like=GLEVITR1/z=dep1000 gl1000
+show/k=1:40 grid gl1000
+
+
+let a =  zaxreplace_avg(temp, z[gz=ZAXLEVITR], z[gz=dep1000])
+
+let b = temp[g=gl1000]
+
+set view ul
+shade/y=0/ylimits=0:5000:1000./levels=(0., 30., 2.)  temp
+
+set view ur
+shade/y=0/ylimits=0:5000:1000./levels=(0., 30., 2.)  b
+
+set view ll
+shade/y=0/ylimits=0:5000:1000./levels=(0., 30., 2.) a
+
+let c = b - a
+
+set view lr
+shade/y=0/ylimits=0:5000:1000./levels=(-15., 15., 2)  c
+! 
+message
+
+set region/x=150e/y=0
+
+can view 
+plot/symbol=2/title=" " b
+plot/line/symbol=28/over/title="original temp" temp
+plot/symbol=2/over/title="regridded temp" b
+plot/symbol=18/over/title="zaxreplace_avg" a
+
+message
+
+
+! ----------------------------
+can region 
+use levitus_climatology
+! sho data
+set region/x=180
+
+let density = RHO_UN(salt, temp, z[g=temp])
+! sh/k=1:51 grid temp
+! sh/k=1:51 grid density
+
+! list/format=(f10.3)/k=1:51/i=180/j=90 density
+! stat density[z=0:1000]
+
+! define axis/z=1022:1032:0.2/units="density units"/depth zdens
+define axis/z=1022:1032:1.0/units="density units"/depth zdens
+let temp_on_dens = zaxreplace(temp[z=0:1000], density[z=0:1000], z[gz=zdens])
+
+! show/k=1:51 grid temp_on_dens
+! list/k=1:51/i=180/j=90 temp_on_dens
+
+PALETTE inverse_greyscale
+!set mode meta
+
+set view ul
+shade/k=1:51/i=180/title="Temp(density)  zaxreplace" temp_on_dens
+
+let temp_on_dens =  zaxreplace_avg(temp[z=0:1000], density[z=0:1000], z[gz=zdens])
+! list/k=1:51/i=180/j=90 temp_on_dens
+
+
+set view ur
+shade/k=1:51/i=180/title="Temp(density)  zaxr fcn" temp_on_dens
+
+set view ll
+shade/k=1:51/i=180/title="Temp as fcn of depth"  temp
+
+
+! ----------------------------
+
+use levitus_climatology
+set region/x=180
+
+let density = RHO_UN(salt, temp, z[g=temp])
+define axis/z=1022:1032:1.0/units="density units"/depth zdens
+
+let temp_dens_fcn =  zaxreplace_avg(temp[z=0:1000], density[z=0:1000], z[gz=zdens])
+
+
+set region/y=22.5N
+list temp_dens_fcn 
diff --git a/external_functions/zaxr/zaxreplace_bin.F b/external_functions/zaxr/zaxreplace_bin.F
new file mode 100644
index 0000000..abb886e
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_bin.F
@@ -0,0 +1,416 @@
+*
+* zaxreplace_bin.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1999
+* 11/2001  clarify function description
+*  7/2003  fix bug in finding the source points in this destination box
+
+* Replace Z axis, using unweighted averaging over bins.
+* Find the source points within each destination box, average them.
+
+* Points that match a destination box edge are arbitrarily put in the
+* box whose lower bound they match, e.g. 500 is put in the500-600 box 
+* not the 400-500 box. 
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_bin_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     .  ('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .    'using unweighted average' )
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      CALL ef_set_num_work_arrays(id, 7)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_bin_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mz2, mz3
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+
+      mz2 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2))
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+
+      mz2 = 2* mz2
+      mz3 = 2* mz3
+
+*  zaxsrc
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_lo_lim
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_hi_lim
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  sbox_lo_new
+      iwork = 4
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*  dbox_lo_lim
+      iwork = 5
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*  dbox_hi_lim
+      iwork = 6
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*  vvals
+      iwork = 7
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz2, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_bin_compute(id, arg_1, arg_2, arg_3, 
+     .     result, zaxsrc, sbox_lo_lim, sbox_hi_lim, sbox_lo_new, 
+     .     dbox_lo_lim, dbox_hi_lim, vvals)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER nsrc, nsrc_lo, nsrc_hi
+      REAL*8 sum
+      REAL count, arg1_val
+
+*  Dimension work arrays
+
+      REAL*8 zaxsrc(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz/2, wrk1lot:wrk1hit)
+      REAL*8 sbox_lo_lim(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz/2, wrk2lot:wrk2hit)
+      REAL*8 sbox_hi_lim(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz/2, wrk3lot:wrk3hit)
+      REAL*8 sbox_lo_new(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz/2, wrk4lot:wrk4hit)
+      REAL*8 dbox_lo_lim(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz/2, wrk5lot:wrk5hit)
+      REAL*8 dbox_hi_lim(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz/2, wrk6lot:wrk6hit)
+      REAL*8 vvals(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz/2, wrk7lot:wrk7hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      CALL ef_get_coordinates(id, ARG2, Z_AXIS, 
+     .   arg_lo_ss(Z_AXIS, ARG2), arg_hi_ss(Z_AXIS, ARG2), zaxsrc)
+
+      CALL ef_get_box_limits(id, ARG2, Z_AXIS, arg_lo_ss(Z_AXIS, ARG2), 
+     .   arg_hi_ss(Z_AXIS, ARG2), sbox_lo_lim, sbox_hi_lim)
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3), 
+     .   arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*
+
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+
+* For each z line accumulate unweighted source points to get
+* the average value.   Loop through the each destination grid box.
+
+               sum = 0.
+               count = 0.
+
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+
+                  nsrc_lo = 1
+                  nsrc_hi = 1
+
+                  DO WHILE 
+     .                  (arg_2(i2,j2,nsrc_lo,l2) .LT. 
+     .                      dbox_lo_lim(1,1,k,1) )
+                     nsrc_lo = nsrc_lo + 1
+                     IF (nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG2)) GO TO 11
+                  ENDDO
+  11              CONTINUE
+
+
+*  Find any portion of the source box lying in the destination box.
+
+                  DO WHILE 
+     .                  (arg_2(i2,j2,nsrc_hi,l2) .LT. 
+     .                      dbox_hi_lim(1,1,k,1) )
+                     nsrc_hi = nsrc_hi + 1
+                     IF (nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG2)) GO TO 22
+                  ENDDO
+  22              CONTINUE
+
+                  nsrc_hi = nsrc_hi - 1
+
+*  No source points within this destination box.
+
+                  IF (nsrc_hi .LT. nsrc_lo) THEN
+                     result(i,j,k,l) = bad_flag_result
+                     GO TO 160
+                  ENDIF
+
+*  Average function values lying within the destination box. 
+
+                  DO 90 nsrc = nsrc_lo, nsrc_hi
+
+                       arg1_val = arg_1(i1,j1,nsrc,l1)
+                       IF (arg1_val .ne. bad_flag(ARG1)) THEN
+	                  sum   = sum  + arg1_val
+                          count  = count + 1.
+                       ENDIF
+  
+  90              CONTINUE
+
+* If we had any good data, calculate the average.
+
+                  IF (count .NE. 0.) THEN
+                      result(i,j,k,l) = sum / count
+
+*  Start next average.
+
+                     sum = 0.
+                     count = 0.
+                  ELSE 
+                     result(i,j,k,l) = bad_flag_result
+                     sum = 0.
+                     count = 0.
+                  ENDIF
+
+ 160              CONTINUE
+
+                  nsrc_lo = nsrc_lo
+                  nsrc_hi = nsrc_lo
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
diff --git a/external_functions/zaxr/zaxreplace_lin.F b/external_functions/zaxr/zaxreplace_lin.F
new file mode 100644
index 0000000..a5016ff
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_lin.F
@@ -0,0 +1,384 @@
+*
+* zaxreplace_lin.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* august 2004
+*
+* V580:10/04 *acm* Fix for bug 1037. Before the loop calling hunt_r4,
+*                  set the initial guess for nsrc_lo to 1 not 0.  
+*
+* Replace Z axis, using linear interpolation 
+* (same as zaxreplace, as first step towards zaxreplace_zlev)
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_lin_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 descr
+
+      CALL ef_set_desc(id, 
+     . 'regrid V onto Z axis of ZAX based on layer thickness ')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'THICKNESS')
+      WRITE (descr, 20)
+   20 FORMAT ('Thickness corresponding to input Z axis values ',
+     .        'in units of output Z axis')
+
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_lin_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER nsrc_lo, klo, khi
+      REAL frac, zval
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+
+      klo = arg_lo_ss(Z_AXIS, ARG2)
+      khi = arg_hi_ss(Z_AXIS, ARG2)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+* --- first set this to do regular linear interpolation, as in zaxreplace,
+*     and check that it replicates the behavior of zaxreplace.  Then
+*     deal with layer thicknesses.
+
+* For each z line interpolate. 
+
+               nsrc_lo = 0
+
+               nsrc_lo = 1    ! fixes bug where if zval equals 1st point in axis
+                              ! we got no match.
+
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* ... next Z axis value (arg3) to locate
+
+                  zval = arg_3(i3,j3,k,l3)
+
+* ... search the Z field (arg_2) for the index just below this value
+* ... note that nsrc_lo is always referenced to a starting index of 1
+
+	          CALL HUNT_R4(arg_2, 1, khi, zval, nsrc_lo, frac)
+
+* ... interpolate data arg_1 field to get result
+
+                  IF ( frac .LT. 0.0 ) THEN
+* ... no luck -- the Z axis value we seek is outside the range in com2
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF ( arg_1(i1,j1,nsrc_lo,l1) .EQ. 
+     .                            bad_flag(ARG1) ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF ( frac .EQ. 1.0 ) THEN                  ! exactly on point
+	             result(i,j,k,l) = arg_1(i1,j1,nsrc_lo,l1)
+                  ELSE
+	             result(i,j,k,l) =  frac* arg_1(i1,j1,nsrc_lo,l1)
+     .			     + (1-frac)* arg_1(i1,j1,nsrc_lo+1,l1)
+               ENDIF
+ 100        CONTINUE
+
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+	SUBROUTINE HUNT_R4 (x1,lo_dim,hi_dim,x2,ndx_lo, frac)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+* V450:  7/97 - new, cloned from double prec. version hunt.F
+*             - also return "frac" - the interpolation factor for ndx_lo 
+
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real		x1(lo_dim:hi_dim),x2, frac
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(hi_dim) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+!	   else if (x2 .ge. x1(ndx_hi) .eqv. ascnd) then (ORIGINAL CODE)
+	   else if (x2 .gt. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	IF (ndx_hi - ndx_lo .eq. 1) THEN
+
+* return result -- including interpolation fraction
+
+	   IF (ndx_lo.GE.lo_dim .AND. ndx_lo.LT.hi_dim) THEN
+	      IF (x2 .EQ. x1(ndx_lo)) THEN
+	         frac = 1.0
+	      ELSE
+	         frac = (x1(ndx_hi)-x2) / (x1(ndx_hi)-x1(ndx_lo))
+	      ENDIF
+	   ELSE    
+	      frac = -999.0
+	   ENDIF
+	   return
+	ENDIF
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/external_functions/zaxr/zaxreplace_rev.F b/external_functions/zaxr/zaxreplace_rev.F
new file mode 100644
index 0000000..26f74e0
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_rev.F
@@ -0,0 +1,486 @@
+*
+* zaxreplace_rev.F
+! version of zaxreplace_avg, with order of arguments 1 and 2 reversed
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1998
+* 11/2001  clarify function description
+*  7/2003  Bug fix; last source point wasnt associated with a dest box
+*          when the destination axis continues beyond the source range
+*
+*
+* Replace Z axis, using weighted averaging over bins
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_rev_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     .  ('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .    'using weighted average' )
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      CALL ef_set_num_work_arrays(id, 8)
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_rev_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER mz1, mz3
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+
+      mz1 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1))
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+
+      mz1 = 2* mz1
+      mz3 = 2* mz3
+
+*  zaxsrc
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz1, 1)
+
+*  sbox_lo_lim
+      iwork = 2
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz1, 1)
+
+*  sbox_hi_lim
+      iwork = 3
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz1, 1)
+
+*  sbox_lo_new
+      iwork = 4
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz1, 1)
+
+*  sbox_hi_new
+      iwork = 5
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz1, 1)
+
+*  dbox_lo_lim
+      iwork = 6
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*  dbox_hi_lim
+      iwork = 7
+      CALL ef_set_work_array_dims (id, iwork, 1, 1, 1, 1, 
+     .   1, 1, mz3, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_rev_compute(id, arg_1, arg_2, arg_3, 
+     .     result, zaxsrc, sbox_lo_lim, sbox_hi_lim, sbox_lo_new, 
+     .     sbox_hi_new, dbox_lo_lim, dbox_hi_lim)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER ifirst, iw, nbox, nsrc
+      INTEGER nsrc_lo, nsrc_hi
+      REAL frac, xsrc_min, xsrc_max, xsrc_lo, xsrc_hi, xsrcdiff
+      REAL wtd, arg2_val, arg2_val_last, wtd_last
+      REAL*8 sum, wtdsum
+      REAL dbox_lo, dbox_hi
+c      CHARACTER*132 err_msg
+
+*  Dimension work arrays
+
+      REAL*8 zaxsrc(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .               wrk1loz:wrk1hiz/2, wrk1lot:wrk1hit)
+      REAL*8 sbox_lo_lim(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .               wrk2loz:wrk2hiz/2, wrk2lot:wrk2hit)
+      REAL*8 sbox_hi_lim(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz/2, wrk3lot:wrk3hit)
+      REAL*8 sbox_lo_new(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .               wrk4loz:wrk4hiz/2, wrk4lot:wrk4hit)
+      REAL*8 sbox_hi_new(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .               wrk5loz:wrk5hiz/2, wrk5lot:wrk5hit)
+      REAL*8 dbox_lo_lim(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .               wrk6loz:wrk6hiz/2, wrk6lot:wrk6hit)
+      REAL*8 dbox_hi_lim(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .               wrk7loz:wrk7hiz/2, wrk7lot:wrk7hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS, 
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxsrc)
+
+      CALL ef_get_box_limits(id, ARG1, Z_AXIS, arg_lo_ss(Z_AXIS, ARG1), 
+     .   arg_hi_ss(Z_AXIS, ARG1), sbox_lo_lim, sbox_hi_lim)
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3), 
+     .   arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+      ifirst = 1
+      iw = 0
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*
+
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+
+
+*  Translate the source boxes to the new axis units.
+
+               DO 500 k = arg_lo_ss(Z_AXIS,ARG2), 
+     .                    arg_hi_ss(Z_AXIS,ARG2)
+
+*  Find the point on the source axis just below the box limit.  Interpolate
+*  to get the box limit in new units.
+
+                  nbox = 1
+
+                  DO WHILE (zaxsrc(1,1,nbox,1) .LT. 
+     .                      sbox_lo_lim(1,1,k,1) )
+                     nbox = nbox + 1
+                  ENDDO
+
+                  IF (nbox .eq. 1) THEN 
+                     sbox_lo_new(1,1,k,1) = arg_1(i1,j1,nbox,l1)
+                  ELSE
+                     frac = (sbox_lo_lim(1,1,k,1) - 
+     .                      zaxsrc(1,1,nbox-1,1))/
+     .                   (zaxsrc(1,1,nbox,1) - zaxsrc(1,1,nbox-1,1)) 
+                     sbox_lo_new(1,1,k,1) = arg_1(i1,j1,nbox-1,l1) + 
+     .                      frac* 
+     .                  (arg_1(i1,j1,nbox,l1) - arg_1(i1,j1,nbox-1,l1))
+                  ENDIF
+
+                  nbox = 1
+
+                  DO WHILE (zaxsrc(1,1,nbox,1) .LT. sbox_hi_lim(1,1,k,1)
+     .                      .AND.
+     .                  nbox .lt. arg_hi_ss(Z_AXIS,ARG2))
+                     nbox = nbox + 1
+                  ENDDO
+
+                  IF (nbox .eq. 1) THEN 
+                     sbox_hi_new(1,1,k,1) = arg_1(i1,j1,nbox,l1) 
+                  ELSE
+                     frac = (sbox_hi_lim(1,1,k,1) - 
+     .                       zaxsrc(1,1,nbox-1,1))/
+     .                  (zaxsrc(1,1,nbox,1) - zaxsrc(1,1,nbox-1,1)) 
+                     sbox_hi_new(1,1,k,1) = arg_1(i1,j1,nbox-1,l1) + 
+     .                      frac* 
+     .                   (arg_1(i1,j1,nbox,l1) - arg_1(i1,j1,nbox-1,l1))
+                  ENDIF
+
+  500          CONTINUE 
+
+* For each z line accumulate weighted source points and weights to get
+* the average value.   Loop through the each destination grid box.
+
+
+               sum = 0.
+               wtdsum = 0.
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+
+                  nsrc_lo = 1
+                  nsrc_hi = 1
+
+                  DO WHILE 
+     .                  (sbox_lo_new(1,1,nsrc_lo,1) .LT. 
+     .                      dbox_lo_lim(1,1,k,1) )
+                     nsrc_lo = nsrc_lo + 1
+                     IF (nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG1)) GO TO 11
+                  ENDDO
+  11              CONTINUE
+
+*  Find any portion of the source box lying in the destination box.
+
+                  DO WHILE 
+     .                  (sbox_lo_new(1,1,nsrc_hi,1) .LE. 
+     .                      dbox_hi_lim(1,1,k,1) )
+                     nsrc_hi = nsrc_hi + 1
+                     IF (nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG1)) GO TO 22
+                  ENDDO
+  22              CONTINUE
+
+                  nsrc_hi = nsrc_hi - 1
+
+*  No source boxes within this destination box.
+
+                  IF (nsrc_hi .LT. nsrc_lo) THEN
+                     IF (wtdsum .NE. 0.) THEN
+                        result(i,j,k,l) = sum / wtdsum
+                     ELSE
+                        result(i,j,k,l) = bad_flag_result
+                     ENDIF
+                     GO TO 160
+                  ENDIF
+
+                  DO 90 nsrc = nsrc_lo, nsrc_hi
+
+*  Get fraction of this source box lying within the destination box. 
+
+	               xsrc_min = sbox_lo_new(1,1,nsrc,1)
+	               xsrc_max = sbox_hi_new(1,1,nsrc,1)
+
+                       dbox_hi = dbox_hi_lim(1,1,k,1)
+                       dbox_lo = dbox_lo_lim(1,1,k,1)
+
+	               xsrc_lo = MAX(xsrc_min, dbox_lo)
+	               xsrc_hi = MIN(xsrc_max, dbox_hi)
+
+                       xsrcdiff = xsrc_max - xsrc_min
+                       wtd = 0.
+                       IF (xsrcdiff .NE. 0.) 
+     .                     wtd = (xsrc_hi - xsrc_lo)/xsrcdiff
+
+                       arg2_val = arg_2(i2,j2,nsrc,l2)
+                       IF (arg2_val .ne. bad_flag(ARG2)) THEN
+	                  sum   = sum  + wtd * arg2_val
+                          wtdsum  = wtdsum + wtd
+
+                          arg2_val_last = arg2_val
+                          wtd_last = wtd
+
+                       ENDIF
+  
+  90              CONTINUE
+
+* If we had any good data, calculate the average.
+
+                  IF (wtdsum .NE. 0.) THEN
+                     result(i,j,k,l) = sum / wtdsum
+
+*  Start next average with remaining weighted part of the last box with
+*  was not within the destination box.
+
+                     sum = (1.- wtd_last)* arg2_val_last
+                     wtdsum = 1.- wtd_last
+                  ELSE 
+                     result(i,j,k,l) = bad_flag_result
+                     sum = 0.
+                     wtdsum = 0.
+                  ENDIF
+
+ 160              CONTINUE
+
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
diff --git a/external_functions/zaxr/zaxreplace_xyt.F b/external_functions/zaxr/zaxreplace_xyt.F
new file mode 100644
index 0000000..ac5dfa5
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_xyt.F
@@ -0,0 +1,384 @@
+*
+* zaxreplace_xyt.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* august 2004
+*
+* V580:10/04 *acm* Fix for bug 1037. Before the loop calling hunt_r4,
+*                  set the initial guess for nsrc_lo to 1 not 0.  
+*
+* Replace Z axis, using linear interpolation 
+* (same as zaxreplace, as first step towards zaxreplace_zlev)
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_xyt_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 descr
+
+      WRITE (descr, 20)
+   10 FORMAT ('regrid V onto Z axis of ZAX based on ',
+     .    'Z values in ZVALS. ZVALS may vary in XYT ')
+
+      CALL ef_set_desc(id, descr )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'THICKNESS')
+      WRITE (descr, 20)
+   20 FORMAT ('Thickness corresponding to input Z axis values ',
+     .        'in units of output Z axis')
+
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_xyt_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER nsrc_lo, klo, khi
+      REAL frac, zval
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+
+      klo = arg_lo_ss(Z_AXIS, ARG2)
+      khi = arg_hi_ss(Z_AXIS, ARG2)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+* For each z line interpolate. 
+
+               nsrc_lo = 0
+
+               nsrc_lo = 1    ! fixes bug where if zval equals 1st point in axis
+                              ! we got no match.
+
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+* ... next Z axis value (arg3) to locate
+
+                  zval = arg_3(i3,j3,k,l3)
+
+* ... search the Z field (arg_2) for the index just below this value
+* ... note that nsrc_lo is always referenced to a starting index of 1
+
+	          CALL HUNT_R4(arg_2(i2,j2,mem2loz,l2), 
+     .                         1, khi, zval, nsrc_lo, frac)
+
+* ... interpolate data arg_1 field to get result
+
+                  IF ( frac .LT. 0.0 ) THEN
+* ... no luck -- the Z axis value we seek is outside the range in com2
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF ( arg_1(i1,j1,nsrc_lo,l1) .EQ. 
+     .                            bad_flag(ARG1) ) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSEIF ( frac .EQ. 1.0 ) THEN                  ! exactly on point
+	             result(i,j,k,l) = arg_1(i1,j1,nsrc_lo,l1)
+                  ELSE
+	             result(i,j,k,l) =  frac* arg_1(i1,j1,nsrc_lo,l1)
+     .			     + (1-frac)* arg_1(i1,j1,nsrc_lo+1,l1)
+               ENDIF
+ 100        CONTINUE
+
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+	SUBROUTINE HUNT_R4 (x1,lo_dim,hi_dim,x2,ndx_lo, frac)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+* V450:  7/97 - new, cloned from double prec. version hunt.F
+*             - also return "frac" - the interpolation factor for ndx_lo 
+
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real		x1(lo_dim:hi_dim),x2, frac
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(lo_dim+1) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+!	   else if (x2 .ge. x1(ndx_hi) .eqv. ascnd) then (ORIGINAL CODE)
+	   else if (x2 .gt. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	IF (ndx_hi - ndx_lo .eq. 1) THEN
+
+* return result -- including interpolation fraction
+
+	   IF (ndx_lo.GE.lo_dim .AND. ndx_lo.LT.hi_dim) THEN
+	      IF (x2 .EQ. x1(ndx_lo)) THEN
+	         frac = 1.0
+	      ELSE
+	         frac = (x1(ndx_hi)-x2) / (x1(ndx_hi)-x1(ndx_lo))
+	      ENDIF
+	   ELSE    
+	      frac = -999.0
+	   ENDIF
+	   return
+	ENDIF
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/external_functions/zaxr/zaxreplace_zlev.F b/external_functions/zaxr/zaxreplace_zlev.F
new file mode 100644
index 0000000..8fe17e0
--- /dev/null
+++ b/external_functions/zaxr/zaxreplace_zlev.F
@@ -0,0 +1,471 @@
+*
+* zaxreplace_zlev.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* august 2004
+* V580:10/04 *acm* Fix for bug 1037. Before the loop calling hunt_r4,
+*                  set the initial guess for nsrc_lo to 1 not 0.  
+*
+*
+*
+* Replace Z axis, where input Z axis is layer and 
+* second argument is layer thickness
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_zlev_init(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 descr
+
+      CALL ef_set_desc(id, 
+     . 'regrid V onto Z axis of ZAX based on layer thickness ')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, YES, YES, YES, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable on native z axis')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'THICKNESS')
+      WRITE (descr, 20)
+   20 FORMAT ('Thickness corresponding to input Z axis layers ',
+     .        'in units of output Z axis')
+
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg, 
+     .'Variable with desired z (depth) axis points')
+      CALL ef_set_axis_influence(id, arg, NO, NO, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_zlev_work_size(id)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims(id,array #,xlo,ylo,zlo,tlo,xhi,yhi,zhi,thi)
+*
+      INTEGER nz
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = 1 + ABS(arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2))
+
+*  zdepth
+      iwork = 1
+      CALL ef_set_work_array_dims (id, iwork,
+     .   1, 1,  1, 1, 
+     .   nz, 1, 1, 1)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_zlev_compute(id, arg_1, arg_2, arg_3, 
+     .    result, zdepth)
+
+      INCLUDE 'ferret_cmn/EF_Util.cmn'
+      INCLUDE 'ferret_cmn/EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .     mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l
+      INTEGER i1, j1, l1, i2, j2, l2, i3, j3, l3
+      INTEGER nsrc_lo, klo, khi
+      REAL sum, lasthalf, frac, zval, zmin, zmax
+      real a1, a2
+
+* declare work array
+      REAL zdepth(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .            wrk1loz:wrk1hiz, wrk1lot:wrk1hit)
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* 
+*  Loop over x,y,t of the input fields
+*
+
+      klo = arg_lo_ss(Z_AXIS, ARG2)
+      khi = arg_hi_ss(Z_AXIS, ARG2)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 400 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         j3 = arg_lo_ss(Y_AXIS,ARG3)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            l3 = arg_lo_ss(T_AXIS,ARG3)
+            DO 200 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+* Compute depths at this location and time. Depth coordinate is at 
+* half of the current grid cell, plus half of the previous grid cell.
+
+               sum = 0.
+               lasthalf = 0.
+c               print *, ' forming the zdepth array. k, zdepth:'
+
+               DO 500 k = klo, khi
+                  zdepth(k,1,1,1) = 0.
+                  IF ( arg_2(i2,j2,k,l2) .NE. bad_flag(ARG2) ) THEN
+                     sum = sum + lasthalf + 0.5*arg_2(i2,j2,k,l2)
+                     lasthalf = 0.5*arg_2(i2,j2,k,l2)
+                  ENDIF
+
+* If there are any layer thickness, fill the end of the array with 
+* the sum of thicknesses up to the deepest.
+
+                  IF (sum .NE. 0.) zdepth(k,1,1,1) = sum
+c                  print *, k, zdepth(k,1,1,1)
+500           CONTINUE
+              zmin = zdepth(klo,1,1,1)
+              zmax = zdepth(khi,1,1,1)
+
+* For each z line interpolate. 
+
+               nsrc_lo = 0
+               nsrc_lo = 1    ! fixes bug where if zval equals 1st point in axis
+                              ! we got no match.
+
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+                  result(i,j,k,l) = bad_flag_result  ! Initialize
+
+                  IF (sum .EQ. 0) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+* ... next Z axis value (arg3) to locate
+
+                     zval = arg_3(i3,j3,k,l3)
+
+* ... search the Z field (arg_2) for the index just below this value
+* ... note that nsrc_lo is always referenced to a starting index of 1
+  
+                     IF (zval .LT. zmin) THEN
+                        frac = -999
+                     ELSE IF (zval .GT. zmax) THEN
+                        frac = -999
+                     ELSE
+                        CALL HUNT_R4 (zdepth,1,khi,zval,nsrc_lo,frac)
+                     ENDIF
+
+* ... interpolate data arg_1 field to get result
+
+                     IF ( frac .LT. 0.0 ) THEN
+* ... no luck -- the Z axis value we seek is outside the range in com2
+                        result(i,j,k,l) = bad_flag_result
+                     ELSEIF ( arg_1(i1,j1,nsrc_lo,l1) .EQ. 
+     .                                 bad_flag(ARG1) .OR. 
+     .                        arg_1(i1,j1,nsrc_lo+1,l1) .EQ. 
+     .                               bad_flag(ARG1)   ) THEN
+                        result(i,j,k,l) = bad_flag_result
+                     ELSEIF ( frac .EQ. 1.0 ) THEN                  ! exactly on point
+	                result(i,j,k,l) = arg_1(i1,j1,nsrc_lo,l1)
+                     ELSE
+                        a1 = arg_1(i1,j1,nsrc_lo,l1)
+                        a2 = arg_1(i1,j1,nsrc_lo+1,l1)
+	                result(i,j,k,l) =  frac* arg_1(i1,j1,nsrc_lo,l1)
+     .		                 + (1-frac)* arg_1(i1,j1,nsrc_lo+1,l1)
+                  ENDIF
+
+               ENDIF  ! IF (sum .EQ. 0) THEN
+ 100        CONTINUE
+
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+               l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+            j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 400  CONTINUE
+
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+	SUBROUTINE HUNT_R4 (x1,lo_dim,hi_dim,x2,ndx_lo, frac)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+* V450:  7/97 - new, cloned from double prec. version hunt.F
+*             - also return "frac" - the interpolation factor for ndx_lo 
+
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real		x1(lo_dim:hi_dim),x2, frac
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(hi_dim) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+!	   else if (x2 .ge. x1(ndx_hi) .eqv. ascnd) then (ORIGINAL CODE)
+	   else if (x2 .gt. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	IF (ndx_hi - ndx_lo .eq. 1) THEN
+
+* return result -- including interpolation fraction
+
+	   IF (ndx_lo.GE.lo_dim .AND. ndx_lo.LT.hi_dim) THEN
+	      IF (x2 .EQ. x1(ndx_lo)) THEN
+	         frac = 1.0
+	      ELSE
+	         frac = (x1(ndx_hi)-x2) / (x1(ndx_hi)-x1(ndx_lo))
+	      ENDIF
+	   ELSE    
+	      frac = -999.0
+	   ENDIF
+	   return
+	ENDIF
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/fer/AIX_MODIFICATIONS.LOG b/fer/AIX_MODIFICATIONS.LOG
new file mode 100644
index 0000000..642553f
--- /dev/null
+++ b/fer/AIX_MODIFICATIONS.LOG
@@ -0,0 +1,347 @@
+List of Modifications as made by Daniel Robitaille    
+				(daniel at sequoia.atmos.berkeley.edu)
+
+on his attempt to compile Ferret under AIX 4.3
+
+This list is intended only as a guide to assist others in compiling and linking
+Ferret under IBM AIX 4.x OS's.  The list is neither edited nor verified, 
+and there may be items which are specific to an individuals system setup.
+
+
+
+
+======================================================================  
+
+setenv TMAP_LOCAL /mnt/sequoia/ark6/daniel/ferret/AIX4.2
+symbolic link cc to gcc
+  (our cc setup is broken, and it was easier than trying to refine "cc"
+   to "gcc" in the various Makefiles)
+  
+=======================================================================
+ ./fer/Makefile
+
+  when creating xrevision_type_data.F, ( in "update" section),  just do
+  a normal ">" instead of ">!"
+
+======================================================================
+ in ./lib
+   ln -s ../list-2.1/liblist.a .
+   ln -s /usr/local/lib/libXpm.a .
+
+======================================================================
+mv platform_specific_flags.mk.aix platform_specific_flags.mk.rs6000
+ and modified it for FFLAGS and some PATHs
+
+HOSTTYPE was "rs6000" by default on our server instead of "aix"
+
+   added -DXT_CODE to CFLAGS and FFLAGS
+        (to compile ./fer/gui/UxMethod.c)
+
+   added -ldl to SYSLIB  (for dynamic loading functions dlopen, etc)
+
+======================================================================
+modified:
+  ./fer/ccr/EF_ExternalUtil.c
+  ./fer/ccr/EF_InternalUtil.c
+
+  removed hard-coded link to /home/r3/tmap/local/sun/include/list.h
+     should be  ../../list-2.1/list.h
+
+================================================================
+
+Modified ./fer/ctx/Makefile
+         ./fer/dat/Makefile
+         ./fer/doo/Makefile
+         ./fer/efn/Makefile
+         ./fer/fmt/Makefile
+         ./fer/ino/Makefile
+         ./fer/mem/Makefile
+         ./fer/ocn/Makefile
+         ./fer/plt/Makefile
+         ./fer/rpn/Makefile
+         ./fer/stk/Makefile
+         ./fer/utl/Makefile
+         ./fer/xeq/Makefile
+         ./fer/special/Makefile
+
+  (that's all the fortran 90 makefiles)
+
+ Added:
+
+.SUFFIXES:
+.SUFFIXES: .o .f .F .c .f90 .F90
+
+.F.o :
+        xlf90 $(FFLAGS)           $*.F       
+
+===============================================================
+
+Renamed  "INHERIRED_LIMITS" to "INLIMITS"
+ in ./fer/ctx/inherited_limits.F
+    ./fer/ctx/flesh_out_axis.F
+    ./fer/ctx/merge_grid.F
+    ./fer/ctx/mergify_grid_axis.F
+
+ It seems AIX compiler doesn't like Function logical with more than
+  8 characters  in their label.
+
+
+===============================================================
+
+The cpp has serious problems with  single-quotes and ?? or ???
+Just need to replace single-quotes with double-quotes.
+
+Modified  
+  ./fer/doo/regrid_comments.F
+      replaced
+           REGRID_COMMENTS = 'regridded ???'
+      by
+           REGRID_COMMENTS = "regridded ???"
+              
+
+  ./fer/fmt/alg_trans_titl.F
+      replaced 
+           ALG_TRANS_TITL = '???'
+      by
+           ALG_TRANS_TITL = "???"
+    
+
+  ./fer/fmt/lohi_string.F
+      replaced
+           strbuf = '???'
+      by
+           strbuf = "???"
+
+ ./fer/gnl/pop_cs.F
+      replaced
+           STOP 'cs_stk_??'
+      by
+           STOP "cs_stk_??"
+
+ ./fer/ino/read_ez.F
+     replaced
+            6000   CALL ERRMSG( ferr_internal, status, 'READ_EZ ??',
+*4900 )
+     by
+            6000   CALL ERRMSG( ferr_internal, status, "READ_EZ ??",
+*4900 )
+
+ ./fer/mem/delete_variable.F
+      replaced
+            CALL WARN( 'CORRUPTION! mr_protected ????' )
+      by
+            CALL WARN( "CORRUPTION! mr_protected ????" )
+
+ ./fer/rpn/alg_trans_code.F
+      replaced
+              ALG_TRANS_CODE = '???'
+      by
+              ALG_TRANS_CODE = "???"
+
+ ./fer/stk/eval_expr.F
+      replaced
+              IF ( cx_stack_ptr .NE. cx_cmnd+1 ) WRITE (6,*)
+'get_cmnd_???'
+      by
+              IF ( cx_stack_ptr .NE. cx_cmnd+1 ) WRITE (6,*)
+"get_cmnd_???"
+
+
+ ./fer/stk/get_prot_cmnd_data.F
+      replaced
+              IF ( cx_stack_ptr .NE. cx_cmnd+nu ) WRITE (6,*)
+'get_cmnd_???'
+      by
+              IF ( cx_stack_ptr .NE. cx_cmnd+nu ) WRITE (6,*)
+"get_cmnd_???"
+
+ ./fer/stk/is_do_gc_fcn.F
+      replaced
+              IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*)
+'OP_STK??'   ! temp
+      by
+              IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*)
+"OP_STK??"   ! temp
+
+ ./fer/stk/is_do_op.F
+      replaced
+              IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*)
+'OP_STK??'   ! temp
+      by
+              IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*)
+"OP_STK??"   ! temp
+
+ ./fer/xeq/xeq_define.F
+     replaced
+        5400   CALL ERRMSG( ferr_syntax, status,
+     .                  cmnd_buff(:len_cmnd)//' ???', *5000 )
+     by
+        5400   CALL ERRMSG( ferr_syntax, status,
+     .                  cmnd_buff(:len_cmnd)//" ???", *5000 )
+
+ ./fer/xeq/xeq_endif.F
+     replaced
+       5400   CALL ERRMSG( ferr_internal, status, 'ENDIF ifstk??',
+*5000)
+     by
+       5400   CALL ERRMSG( ferr_internal, status, "ENDIF ifstk??",
+*5000)
+
+
+===================================================
+ ./fer/gnl/dollar_command.F
+   removed this AIX_XLF special case:
+
+#ifdef AIX_XLF
+           risc_buff = cmnd(iptr+1:)
+           cmnd(dollar:) = arg(1:lenarg) // risc_buff
+           lencmnd = (dollar-1) + lenarg + (lencmnd-iptr)   ! new length
+#else
+           cmnd(dollar:) = arg(1:lenarg) // cmnd(iptr+1:)
+           lencmnd = (dollar-1) + lenarg + (lencmnd-iptr)   ! new length
+#endif
+
+=====================================================
+ ./fer/gnl/show_1_function.F
+
+  continuation character "1" was in the wrong column for this statement:
+
+    CHARACTER units*40, gcf_name*40, ef_arg_name*40, ef_descr*80,
+    1    ef_units*40
+
+
+ ./fer/mem/find_var_name.F
+  various continous character "1" were in the wrong column
+   (5 of them)
+
+
+======================================================
+ ./fer/rpn/alg_break_up.F
+    continuation character "1" was in the wrong column for the data
+statements
+
+======================================================
+ ./fer/utl/gcf_get_axis_srcs.F
+    continuation character "2" was in the wrong colunm in two locations
+
+====================================================== 
+ ./fer/utl/itsa_modulo_gcf.F
+    continuation character "1" was in the wrong colunm in two locations
+
+======================================================
+ ./fer/utl/match_quoted_name.F
+    continuation character "1" was in the wrong colunm in one location
+
+======================================================
+ ./fer/xeq/ceq_show.F
+    continuation character "1" was in the wrong colunm in one location
+
+======================================================
+
+copied ./fer/platform_specific_flags.mk.rs6000 to ./ppl
+ and made PPLUS_FFLAGS similar to FFLAGS
+
+Added to PPLUS_FFLAGS:
+   -DNO_OPEN_CARRIAGECONTROL
+   -DNO_OPEN_READONLY
+   -Dxgks
+Removed -u from PPLUS_FFLAGS  (allow undefined typing) 
+
+=======================================================
+
+ modified   
+    ./ppl/tmapadds/Makefile
+    ./ppl/complot/Makefile
+    ./ppl/ourlib/Makefile
+    ./ppl/plot/Makefile
+    ./ppl/plotlib/Makefile
+    ./ppl/pplepic/Makefile
+    ./ppl/pplp_only/Makefile
+    ./ppl/pplusr/Makefile
+    ./ppl/symlib/Makefile
+ 
+ (they are all fortran 90 makefiles that need to be modified)
+
+ replaced 
+    $(FC) $(PPLUS_FFLAGS) -c $<
+ by
+    .SUFFIXES:
+    .SUFFIXES: .o .f .F .c .f90 .F90
+
+    .F.o :
+         $(FC) $(PPLUS_FFLAGS) -c $*.F
+
+========================================================
+
+ ./ppl/tmapadds/shade.F
+
+ continuation symbol "1" in the wrong column in 3 locations
+
+========================================================
+
+
+  ./fmt/Makefile
+Modified Makefile for fortran compiler lines:
+
+F77=f77
+
+.SUFFIXES:
+.SUFFIXES: .o .f .F .c .f90 .F90
+
+.c.o:
+        (cc $(CFLAGS) -c $(DEBUG) $(<F))
+
+.F.o:
+        $(F77) -c $(DEBUG) $(FFLAGS) $*.F
+
+==========================================================
+
+ ./fmt/src/readline.c
+
+added:        
+  #include <string.h>
+  #include <sys/dir.h>
+  #define direct dirent
+  #define d_namlen d_reclen
+
+==========================================================
+
+ ./fer/ccr/fermain_c.c
+
+   replaced
+     char *meta_name = ".gif"; /* Unused dummy name */
+     set_batch_graphics_(meta_name);
+      ++i;
+
+ by
+     char *meta_name = ".gif"; /* Unused dummy name */
+   #ifdef NO_ENTRY_NAME_UNDERSCORES
+     set_batch_graphics(meta_name);
+   #else
+     set_batch_graphics_(meta_name);
+   #endif
+     ++i;
+
+===========================================================
+
+ ./fer/Makefile
+  
+  added special/aix_routines.o to FEROBJS_DFLT
+
+===========================================================
+
+ ./fer/ccr/EF_Internal.c
+ ./fer/ccr/EF_External.c
+
+   Need to add a NO_ENTRY_NAME_UNDERSCORES case for various
+  cases
+===========================================================
+
+ ./fer/gui/ferret_structures.h
+ 
+  include   list.h should point to
+    ../../list-2.1/list.h
+
+===========================================================
+
+
diff --git a/fer/AIX_MODIFICATIONS_SCHMIDT.LOG b/fer/AIX_MODIFICATIONS_SCHMIDT.LOG
new file mode 100644
index 0000000..c52e939
--- /dev/null
+++ b/fer/AIX_MODIFICATIONS_SCHMIDT.LOG
@@ -0,0 +1,330 @@
+AIX modifications log from Martin Schmidt.
+
+export TMAP_LOCAL=/silotmp/mschmidt/ferret_54
+export HOSTTYPE=aix
+
+_______________________________________________________________________________
+cd list-2.1
+Edit the Makefile
+DEFINES = -O2
+
+MANDIR	= ${TMAP_LOCAL}/man
+LIBDIR	= ${TMAP_LOCAL}/lib
+INCDIR	= ${TMAP_LOCAL}/include
+
+mkdir ../lib ../include
+mkdir -p ../man/man3 
+
+Do this as root for install
+su
+make all
+make install
+make install.man
+
+_______________________________________________________________________________
+cd readline-4.1
+
+CFLAGS='-O2 -qmaxmem=8084' ./configure --prefix=$TMAP_LOCAL
+
+make check
+Target "check" is up to date.
+
+su
+cd ..
+chown -R mschmidt.staff include lib man
+
+cd -
+make install
+OK
+
+cd examples
+make
+rl works
+_______________________________________________________________________________
+cd xgks
+
+change the preprocessor call in configure from CPP to CPP -C
+CPP='${CC-cc} -E' ---> CPP='${CC-cc} -E -C' line 345
+
+./configure --prefix=$TMAP_LOCAL
+
+chmod u+w progs/star.f progs/gksdemo.f
+
+nc progs/star.f progs/gksdemo.f
+First line in star.f uncommented
+argument of setcol in line 900 of gksdemo.f removed
+added to gksdemo.f
+      program gks
+      call gksdem
+      stop
+      end
+      
+make all
+make install
+star draws a yellow star
+gksdemo basically works but crashs in some menue items.
+_______________________________________________________________________________
+cd ppl
+cd tmapadds
+nc fillpol.F setup_color_table.F shade.F
+wrong continuation lines changed
+symlib/setsym.F
+wrong program flow corrected
+
+gmake l�uft durch
+_______________________________________________________________________________
+cd fmt  
+edit
+/silotmp/mschmidt/ferret_54/fmt/src/Makefile      
+add$ (FINCLUDES) to comp_nocpp
+nc src/tm_break_date.F
+nc src/tm_secs_from_bc.F
+nc src/tm_secs_to_date.F
+wrong continuation lines changed
+
+cd fer
+
+ ./gui/UxXt.h 
+> #if defined(__STDC__) && !defined(SOLARIS) && !defined(sun4) && !defined(aix)
+---
+< #if defined(__STDC__) && !defined(SOLARIS) && !defined(sun4)
+=====================================================================
+It is not allowed to redefine MAX_MENU_ITEMS. It is only 20 in the Xm system! 
+ ./gui/JC_Utility.h
+> /*#define MAX_MENU_ITEMS 256*/
+---
+< #define MAX_MENU_ITEMS 256
+=====================================================================
+ ./doo/regrid_comments.F 
+> 	REGRID_COMMENTS = "regridded ???"
+---
+< 	REGRID_COMMENTS = 'regridded ???'
+======================================================
+efi/compressk_by.F
+long line splitted
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     1                             ABSTRACT, IMPLIED_BY_ARGS)
+
+======================================================
+ ./fmt/alg_trans_titl.F
+> 	ALG_TRANS_TITL = "???"
+---
+< 	ALG_TRANS_TITL = '???'
+======================================================
+ ./fmt/lohi_string.F
+> 	   strbuf = "???"
+---
+< 	   strbuf = '???'
+======================================================
+ ./gnl/name_equal_string.F
+>      .			cmnd_buff(:len_cmnd)//" ???", *5000 )
+---
+<      .			cmnd_buff(:len_cmnd)//' ???', *5000 )
+======================================================
+ ./gnl/pop_cs.F
+> 	      STOP "cs_stk_??"
+---
+< 	      STOP 'cs_stk_??'
+======================================================
+ ./gnl/show_1_function.F
+>      1          ef_units*40, ax_remark*64
+---
+< 	1    ef_units*40, ax_remark*64
+> 	         ax_remark = "???"
+---
+< 	         ax_remark = '???'
+======================================================
+ ./gnl/name_equal_string.F
+>      .			cmnd_buff(:len_cmnd)//" ???", *5000 )
+---
+<      .			cmnd_buff(:len_cmnd)//' ???', *5000 )
+======================================================
+ ./ino/read_ez.F
+>  6000	CALL ERRMSG( ferr_internal, status, "READ_EZ ??", *4900 )
+---
+<  6000	CALL ERRMSG( ferr_internal, status, 'READ_EZ ??', *4900 )
+======================================================
+ ./ino/read_binary.F
+<      1		       ds_grid_start(idim,fvar) + 1
+---
+> 	1		       ds_grid_start(idim,fvar) + 1
+======================================================
+./ino/read_delimited.F 
+>  6000 CALL ERRMSG( ferr_internal, status, "READ_EZ ??", *4900 )
+---
+<  6000 CALL ERRMSG( ferr_internal, status, 'READ_EZ ??', *4900 )
+======================================================
+./ino/read_perl.F 
+>     1		          ds_grid_start(idim,fvar) + 1
+---
+<     1		          ds_grid_start(idim,fvar) + 1
+======================================================
+ ./mem/delete_variable.F
+> 	      CALL WARN( "CORRUPTION! mr_protected ????" )
+---
+< 	      CALL WARN( 'CORRUPTION! mr_protected ????' )
+======================================================
+ ./mem/find_var_name.F
+<      1	      THEN
+---
+> 	1	   THEN
+120c120
+<      1	         THEN
+---
+> 	1	      THEN
+134c134
+<      1	   THEN
+---
+> 	1	THEN
+157c157
+<      1	   THEN
+---
+> 	1	THEN
+170c170
+<      1	         THEN
+---
+> 	1	      THEN
+======================================================
+
+ ./rpn/alg_break_up.F
+112c112
+<      1    / 2, 3, 4,-1,-1, 5, 5, 1, 4,  3,10,11,-1,12,-2/
+---
+> 	1    / 2, 3, 4,-1,-1, 5, 5, 1, 4,  3,10,11,-1,12,-2/
+114c114
+<      1    / 7, 3, 7, 7, 7, 7, 7, 7, 7,  3, 7, 7, 7, 7,-2/
+---
+> 	1    / 7, 3, 7, 7, 7, 7, 7, 7, 7,  3, 7, 7, 7, 7,-2/
+116c116
+<      1    / 7, 3,-1,-1,-1, 7, 7, 7, 8,  3, 7,-1,-1, 7,-2/
+---
+> 	1    / 7, 3,-1,-1,-1, 7, 7, 7, 8,  3, 7,-1,-1, 7,-2/
+118c118
+<      1    / 7, 4, 4, 6,-1, 7, 7, 7, 4, -1, 7,-1,-1, 7,-2/
+---
+> 	1    / 7, 4, 4, 6,-1, 7, 7, 7, 4, -1, 7,-1,-1, 7,-2/
+120c120
+<      1    /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+---
+> 	1    /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+122c122
+<      1    / 6, 6, 6, 9, 5, 6, 6, 6, 6,  6, 6, 6, 6, 6, 6/
+---
+> 	1    / 6, 6, 6, 9, 5, 6, 6, 6, 6,  6, 6, 6, 6, 6, 6/
+124c124
+<      1    /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+---
+> 	1    /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+126c126
+<      1    / 8, 8, 7, 7, 7, 7, 7, 7, 7,  7, 7, 7, 7, 7,-2/
+---
+> 	1    / 8, 8, 7, 7, 7, 7, 7, 7, 7,  7, 7, 7, 7, 7,-2/
+128c128
+<      1    / 9, 9, 9, 9, 9, 9, 9, 9, 9,  9, 9, 9, 9, 9, 9/
+---
+> 	1    / 9, 9, 9, 9, 9, 9, 9, 9, 9,  9, 9, 9, 9, 9, 9/
+130c130
+<      1    / 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10/
+---
+> 	1    / 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10/
+132c132
+<      1    /11,11,-1,-1,-1,11,11,11,11, 11,11,-1, 5,11,11/
+---
+> 	1    /11,11,-1,-1,-1,11,11,11,11, 11,11,-1, 5,11,11/
+134c134
+<      1    / 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12/
+---
+> 	1    / 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12/
+======================================================
+ ./rpn/alg_trans_code.F
+> 	ALG_TRANS_CODE = "???"
+---
+< 	ALG_TRANS_CODE = '???'
+
+======================================================
+ ./stk/eval_expr.F
+> 	   IF ( cx_stack_ptr .NE. cx_cmnd+1 ) WRITE (6,*) "get_cmnd_???"
+---
+< 	   IF ( cx_stack_ptr .NE. cx_cmnd+1 ) WRITE (6,*) 'get_cmnd_???'
+======================================================
+ ./stk/get_prot_cmnd_data.F
+< 	   IF ( cx_stack_ptr .NE. cx_cmnd+nu ) WRITE (6,*) "get_cmnd_???"
+---
+> 	   IF ( cx_stack_ptr .NE. cx_cmnd+nu ) WRITE (6,*) 'get_cmnd_???'
+======================================================
+ ./stk/is_do_gc_fcn.F
+> 	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) "OP_STK??"	! temp
+---
+< 	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) 'OP_STK??'	! temp
+======================================================
+ ./stk/is_do_op.F
+> 	   STOP "??? fcn or op"
+---
+< 	   STOP '??? fcn or op'
+232c232
+> 	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) "OP_STK??"	! temp
+---
+< 	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) 'OP_STK??'	! temp
+======================================================
+
+ ./utl/gcf_get_axis_srcs.F
+>      2	   STOP 'gcf_get_axis_srcs'
+---
+< 	2	STOP 'gcf_get_axis_srcs'
+93c93
+>      2	   STOP 'gcf_get_axis_srcs'
+---
+< 	2	STOP 'gcf_get_axis_srcs'
+====================================================== 
+ ./utl/itsa_modulo_gcf.F
+>      1	.EQ. pgc_axis_supplied_herein 
+---
+< 	1	.EQ. pgc_axis_supplied_herein 
+79c79
+>      1	.EQ. pgc_axis_supplied_herein 
+---
+> 	1	.EQ. pgc_axis_supplied_herein 
+======================================================
+ ./utl/match_quoted_name.F
+>      1	   UPPER_CASE( test_string(i:i) ) ) GOTO 200
+---
+< 	1	   UPPER_CASE( test_string(i:i) ) ) GOTO 200
+======================================================
+ ./xeq/xeq_define.F
+>      .			buff1(:TM_LENSTR1(buff1))//" = ???", *5000 )
+---
+<      .			buff1(:TM_LENSTR1(buff1))//' = ???', *5000 )
+======================================================
+ ./xeq/xeq_endif.F
+>  5400	CALL ERRMSG( ferr_internal, status, "ENDIF ifstk??", *5000)
+---
+<  5400	CALL ERRMSG( ferr_internal, status, 'ENDIF ifstk??', *5000)
+======================================================
+gui/UxXt.h
+comment out line 34
+====================================================== 
+FORTRAN definition instead of underscores
+fmt/src/ez_delimited_read.c FORTRAN(days_from_day0)
+/fmt/src/tm_switch_nan.c
+ef_utility/EF_Util.c
+ccr/free_c_string_array.c
+ccr/init_c_string_array.c
+ccr/copy_c_string.c
+ccr/replace_bad_data_sub.c
+ccr/get_sys_cmnd.c
+ccr/add_c_pointer.c
+ccr/xfer_c_ptrs.c
+ccr/free_c_pointer.c
+ccr/save_c_string.c
+ccr/get_c_string_len.c
+ccr/get_c_string.c
+ccr/get_max_c_string_len.c
+ccr/get_offset_c_string_len.c
+ccr/get_offset_c_string.c
+ccr/binaryRead.h changed definition of FORTRAN
+ccr/compare_c_strings.c
+ccr/replaceable_bad_flags.c
+
+Variable cont_key shifted, since misaligned
+ppl/shade_vars.cmn
+
diff --git a/fer/Makefile b/fer/Makefile
new file mode 100644
index 0000000..30c8ee4
--- /dev/null
+++ b/fer/Makefile
@@ -0,0 +1,114 @@
+#
+# Simple makefile for launching other makes to build all the ferret libraries
+#
+
+#
+# Site-specific defines
+#
+include ../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../platform_specific.mk.$(BUILDTYPE)
+
+PLATFORM := $(shell uname -rs)
+VERSION_INFO := (PyFerret $(PYFERRET_VERSION))
+DATE := $(shell /bin/date +%D)
+
+#
+# Macros
+#
+
+DIRS = ccr cferbind ctx dat doo efi efn ef_utility fmt gnl grdel \
+       ino mem ocn plt pyf rpn stk utl xeq special
+
+LIBS = ccr cferbind ctx dat doo efi efn ef_utility fmt gnl grdel \
+       ino mem ocn plt pyf rpn stk utl xeq 
+
+#
+# Targets
+#
+
+.PHONY : all
+all: optimized
+
+
+.PHONY : optimized
+optimized:
+	$(MAKE) "CFLAGS = $(CFLAGS) -O -DNDEBUG" \
+		"FFLAGS = $(FFLAGS) -O -DNDEBUG" \
+		"PPLUS_FFLAGS = $(PPLUS_FFLAGS) -O -DNDEBUG" \
+		build
+
+.PHONY : debug
+debug:
+	$(MAKE) "CFLAGS = $(CFLAGS) -O0 -g" \
+		"FFLAGS = $(FFLAGS) -O0 -g -fbounds-check" \
+		"PPLUS_FFLAGS = $(PPLUS_FFLAGS) -O0 -g" \
+		build
+
+.PHONY : build
+build: update special_code ppl_libraries fmt_libraries fer_libraries
+
+
+.PHONY : update
+update:
+	rm -f special/xmake_date_data.[Ffo]
+	sed "s&xxxxxxxx&$(DATE)&" < special/xmake_date_data.template > special/xmake_date_data.F
+	rm -f special/xrevision_type_data.[Ffo]
+	sed -e 's&mmmmmmmm&$(VERSION_INFO)&' -e 's&(/&(&' -e 's&/)&)&' < special/xrevision_type_data.template > special/xrevision_type_data.F 
+	rm -f special/xplatform_type_data.[Ffo]
+	sed -e 's&mmmmmmmm&$(PLATFORM)&' -e 's&(/&(&' -e 's&/)&)&' < special/xplatform_type_data.template > special/xplatform_type_data.F 
+
+
+.PHONY : special_code
+special_code: update
+	$(MAKE) -C special all
+
+
+.PHONY : ppl_libraries
+ppl_libraries:
+	$(MAKE) -C ../ppl
+
+
+.PHONY : fmt_libraries
+fmt_libraries:
+	$(MAKE) -C ../fmt/src
+
+
+.PHONY : fer_libraries
+fer_libraries: update
+	for i in $(LIBS) ; do \
+            if ! $(MAKE) -C $$i ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+
+.PHONY : clean
+clean: ppl_clean fmt_clean fer_clean
+	rm -f ../lib/*
+
+
+.PHONY : ppl_clean
+ppl_clean:
+	$(MAKE) -C ../ppl clean
+
+
+.PHONY : fmt_clean
+fmt_clean:
+	$(MAKE) -C ../fmt/src clean
+
+
+.PHONY : fer_clean
+fer_clean:
+	for i in $(DIRS) ; do \
+            $(MAKE) -C $$i clean ; \
+        done
+	rm -f special/xmake_date_data.F special/xrevision_type_data.F special/xplatform_type_data.F
+
+#
+# End of Makefile
+#
diff --git a/fer/ccr/EF_InternalUtil.c b/fer/ccr/EF_InternalUtil.c
new file mode 100644
index 0000000..6b47588
--- /dev/null
+++ b/fer/ccr/EF_InternalUtil.c
@@ -0,0 +1,4161 @@
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granteHd the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+
+/* EF_InternalUtil.c
+ *
+ * Jonathan Callahan
+ * Sep 4th 1997
+ *
+ * This file contains all the utility functions which Ferret
+ * needs in order to communicate with an external function.
+ */
+
+/* Ansley Manke  March 2000
+ *  Additions to allow internally linked external functions.
+ *  Source code is in the directory FERRET/fer/efi
+ *  In that directory, run the perl script int_dlsym.pl
+ *  int_dlsym.pl ./ > intlines.c
+ *  The result is lines of C code to be put into this file.
+ *  Search for the comment string --------------------
+ *
+ *  1.  Function declaration lines.  Need to edit these to have
+ *      the correct number of arguments for the _compute subroutines.
+ *  2.  definition of N_INTEF and structure I_EFnames
+ *  3.  internal_dlsym lines at the end
+
+* Jonathan Callahan and Ansley Manke  30-May-2000
+ * Fix memory leak:  already_have_internals needs to be tested for when 
+ * we find the external function in efcn_gather_info  and set TRUE once
+ * the internals have been set for the first time, also in efcn_gather_info.
+
+* Ansley Manke  August 2001
+ * add EOF_SPACE, EOF_STAT, EOF_TFUNC to the functions that are
+ * statically linked 
+
+* V5.4 *acm* 10/01 add compress* to the statically linked fcns
+* v6.0 *acm*  5/06 many more functions internally linked.
+* V6.0 *acm*  5/06 string results for external functions
+* v6.0 *acm*  5/06 internal_dlsym was missing the nco functions.
+* V6.03 *acm& 5/07 Add tax_ functions, fill_xy to the statically-linked functions
+* V6.07 *acm* 8/07 remove xunits_data from list of I_EFnames; it should never 
+*                  have been there.
+* V6.12 *acm* 8/07 add functions scat2grid_bin_xy and scat2grid_nobs_xy.F
+* V6.2 *acm* 11/08 New functions XCAT_STR, YCAT_STR, ...
+* V6.2 *acm* 11/08 New internally-called function efcn_get_alt_type_fcn to
+*                  get the name of a function to call if the arguments are of
+*                  a different type than defined in the current function. E.g. 
+*                  this lets the user reference XCAT with string arguments and  
+*                  Ferret will run XCAT_STR
+* V6.6 *acm* 4/10 add functions scat2grid_nbin_xy and scat2grid_nbin_xyt.F
+* V664 *kms*  9/10 Added python-backed external functions via $FER_DIR/lib/libpyefcn.so
+*                  Made external function language check more robust
+*                  Check that GLOBAL_ExternalFunctionsList is not NULL in ef_ptr_from_id_ptr
+*      *kms* 11/10 Check for libpyefcn.so in $FER_LIBS instead of $FER_DIR/lib
+*      *kms* 12/10 Eliminated libpyefcn.so; link to pyefcn static library
+*                  This makes libpython2.X a required library.
+* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferret.h
+*      *kms*  3/12 Add E and F dimensions 
+*/
+
+
+/* .................... Includes .................... */
+ 
+#include <Python.h> /* make sure Python.h is first */
+
+#include <unistd.h>		/* for convenience */
+#include <stdlib.h>		/* for convenience */
+#include <stdio.h>		/* for convenience */
+#include <string.h>		/* for convenience */
+#include <fcntl.h>		/* for fcntl() */
+#include <dlfcn.h>		/* for dynamic linking */
+#include <signal.h>             /* for signal() */
+#include <setjmp.h>             /* required for jmp_buf */
+
+#include "ferret.h"
+#include "EF_Util.h"
+#include "list.h"		/* locally added list library */
+#include "pyferret.h"		/* python external funtion interfaces */
+
+
+/* ................ Global Variables ................ */
+/*
+ * The memory_ptr, mr_list_ptr and cx_list_ptr are obtained from Ferret
+ * and cached whenever they are passed into one of the "efcn_" functions.
+ * These pointers can be accessed by the utility functions in efn_ext/.
+ * This way the EF writer does not need to see these pointers.
+ *
+ * This is the instantiation of these values.
+ */
+
+DFTYPE *GLOBAL_memory_ptr;
+int    *GLOBAL_mr_list_ptr;
+int    *GLOBAL_cx_list_ptr;
+int    *GLOBAL_mres_ptr;
+DFTYPE *GLOBAL_bad_flag_ptr;
+
+static LIST *STATIC_ExternalFunctionList;
+
+/*
+ * The jumpbuffer is used by setjmp() and longjmp().
+ * setjmp() is called by FORTRAN(efcn_compute)() in EF_InternalUtil.c and
+ * saves the stack environment in jumpbuffer for later use by longjmp().
+ * This allows one to bail out of external functions and still
+ * return control to Ferret.
+ * Check "Advanced Progrmming in the UNIX Environment" by Stevens
+ * sections 7.10 and 10.14 to understand what's going on with these.
+ */
+static jmp_buf jumpbuffer;
+static sigjmp_buf sigjumpbuffer;
+static volatile sig_atomic_t canjump;
+
+static int I_have_scanned_already = FALSE;
+static int I_have_warned_already = TRUE; /* Warning turned off Jan '98 */
+
+static void *internal_dlsym(char *name);
+static void *ferret_ef_mem_subsc_so_ptr;
+static void (*copy_ferret_ef_mem_subsc_ptr)(void);
+
+/* ............. Function Declarations .............. */
+/*
+ * Note that all routines called directly from Ferret,
+ * ie. directly from Fortran, should be all lower case,
+ * be of type 'void', pass by reference and should end with 
+ * an underscore.
+ */
+
+
+/* .... Functions called by Ferret .... */
+
+int  FORTRAN(efcn_scan)( int * );
+int  FORTRAN(efcn_already_have_internals)( int * );
+
+void FORTRAN(create_pyefcn)(char fname[], int *lenfname, char pymod[], int *lenpymod,
+                            char errstring[], int *lenerrstring);
+
+int  FORTRAN(efcn_gather_info)( int * );
+void FORTRAN(efcn_get_custom_axes)( int *, int *, int * );
+void FORTRAN(efcn_get_result_limits)( int *, DFTYPE *, int *, int *, int * );
+void FORTRAN(efcn_compute)( int *, int *, int *, int *, int *, DFTYPE *, int *, DFTYPE *, int * );
+
+
+void FORTRAN(efcn_get_custom_axis_sub)( int *, int *, double *, double *, double *, char *, int * );
+
+int  FORTRAN(efcn_get_id)( char * );
+int  FORTRAN(efcn_match_template)( int *, char * );
+
+void FORTRAN(efcn_get_name)( int *, char * );
+void FORTRAN(efcn_get_version)( int *, DFTYPE * );
+void FORTRAN(efcn_get_descr)( int *, char * );
+void FORTRAN(efcn_get_alt_type_fcn)( int *, char * );
+int  FORTRAN(efcn_get_num_reqd_args)( int * );
+void FORTRAN(efcn_get_has_vari_args)( int *, int * );
+void FORTRAN(efcn_get_axis_will_be)( int *, int * );
+void FORTRAN(efcn_get_axis_reduction)( int *, int * );
+void FORTRAN(efcn_get_piecemeal_ok)( int *, int * );
+
+void FORTRAN(efcn_get_axis_implied_from)( int *, int *, int * );
+void FORTRAN(efcn_get_axis_extend_lo)( int *, int *, int * );
+void FORTRAN(efcn_get_axis_extend_hi)( int *, int *, int * );
+void FORTRAN(efcn_get_axis_limits)( int *, int *, int *, int * );
+int  FORTRAN(efcn_get_arg_type)( int *, int *);
+void FORTRAN(efcn_get_arg_name)( int *, int *, char * );
+void FORTRAN(efcn_get_arg_unit)( int *, int *, char * );
+void FORTRAN(efcn_get_arg_desc)( int *, int *, char * );
+int  FORTRAN(efcn_get_rtn_type)( int *);
+
+
+/* .... Functions called internally .... */
+
+/* Fortran routines from the efn/ directory */
+void FORTRAN(efcn_copy_array_dims)(void);
+void FORTRAN(efcn_set_work_array_dims)(int *, int *, int *, int *, int *, int *, int *,
+                                              int *, int *, int *, int *, int *, int *);
+void FORTRAN(efcn_get_workspace_addr)(DFTYPE *, int *, DFTYPE *);
+
+static void EF_signal_handler(int signo);
+static void (*fpe_handler)(int);      /* function pointers */
+static void (*segv_handler)(int);
+static void (*int_handler)(int);
+static void (*bus_handler)(int);
+int EF_Util_setsig();
+int EF_Util_ressig();
+
+
+void FORTRAN(ef_err_bail_out)(int *, char *);
+
+void EF_store_globals(DFTYPE *, int *, int *, int *, DFTYPE *);
+
+ExternalFunction *ef_ptr_from_id_ptr(int *);
+
+int  EF_ListTraverse_fprintf( char *, char * );
+int  EF_ListTraverse_FoundName( char *, char * );
+int  EF_ListTraverse_MatchTemplate( char *, char * );
+int  EF_ListTraverse_FoundID( char *, char * );
+
+int  EF_New( ExternalFunction * );
+
+/*  ------------------------------------
+ *  Statically linked external functions 
+ *  Declarations generated by the perl script int_dlsym.pl.
+ *  Need to fill out the arguments for the _compute subroutines.
+ */
+
+void FORTRAN(ffta_init)(int *);
+void FORTRAN(ffta_custom_axes)(int *);
+void FORTRAN(ffta_result_limits)(int *);
+void FORTRAN(ffta_work_size)(int *);
+void FORTRAN(ffta_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fftp_init)(int *);
+void FORTRAN(fftp_custom_axes)(int *);
+void FORTRAN(fftp_result_limits)(int *);
+void FORTRAN(fftp_work_size)(int *);
+void FORTRAN(fftp_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fft_im_init)(int *);
+void FORTRAN(fft_im_custom_axes)(int *);
+void FORTRAN(fft_im_result_limits)(int *);
+void FORTRAN(fft_im_work_size)(int *);
+void FORTRAN(fft_im_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fft_inverse_init)(int *);
+void FORTRAN(fft_inverse_result_limits)(int *);
+void FORTRAN(fft_inverse_work_size)(int *);
+void FORTRAN(fft_inverse_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fft_re_init)(int *);
+void FORTRAN(fft_re_custom_axes)(int *);
+void FORTRAN(fft_re_result_limits)(int *);
+void FORTRAN(fft_re_work_size)(int *);
+void FORTRAN(fft_re_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(sampleij_init)(int *);
+void FORTRAN(sampleij_result_limits)(int *);
+void FORTRAN(sampleij_work_size)(int *);
+void FORTRAN(sampleij_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+       DFTYPE *, DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(samplei_multi_init)(int *);
+void FORTRAN(samplei_multi_result_limits)(int *);
+void FORTRAN(samplei_multi_compute)(int *, DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(samplej_multi_init)(int *);
+void FORTRAN(samplej_multi_result_limits)(int *);
+void FORTRAN(samplej_multi_compute)(int *, DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(samplek_multi_init)(int *);
+void FORTRAN(samplek_multi_result_limits)(int *);
+void FORTRAN(samplek_multi_compute)(int *, DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(samplel_multi_init)(int *);
+void FORTRAN(samplel_multi_result_limits)(int *);
+void FORTRAN(samplel_multi_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplet_date_init)(int *);
+void FORTRAN(samplet_date_result_limits)(int *);
+void FORTRAN(samplet_date_work_size)(int *);
+void FORTRAN(samplet_date_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexy_init)(int *);
+void FORTRAN(samplexy_result_limits)(int *);
+void FORTRAN(samplexy_work_size)(int *);
+void FORTRAN(samplexy_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexyt_init)(int *);
+void FORTRAN(samplexyt_result_limits)(int *);
+void FORTRAN(samplexyt_work_size)(int *);
+void FORTRAN(samplexyt_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexyt_nrst_init)(int *);
+void FORTRAN(samplexyt_nrst_result_limits)(int *);
+void FORTRAN(samplexyt_nrst_work_size)(int *);
+void FORTRAN(samplexyt_nrst_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xy_init)(int *);
+void FORTRAN(scat2gridgauss_xy_work_size)(int *);
+void FORTRAN(scat2gridgauss_xy_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xz_init)(int *);
+void FORTRAN(scat2gridgauss_xz_work_size)(int *);
+void FORTRAN(scat2gridgauss_xz_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_yz_init)(int *);
+void FORTRAN(scat2gridgauss_yz_work_size)(int *);
+void FORTRAN(scat2gridgauss_yz_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xt_init)(int *);
+void FORTRAN(scat2gridgauss_xt_work_size)(int *);
+void FORTRAN(scat2gridgauss_xt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_yt_init)(int *);
+void FORTRAN(scat2gridgauss_yt_work_size)(int *);
+void FORTRAN(scat2gridgauss_yt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_zt_init)(int *);
+void FORTRAN(scat2gridgauss_zt_work_size)(int *);
+void FORTRAN(scat2gridgauss_zt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xy_v0_init)(int *);
+void FORTRAN(scat2gridgauss_xy_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_xy_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xz_v0_init)(int *);
+void FORTRAN(scat2gridgauss_xz_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_xz_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_yz_v0_init)(int *);
+void FORTRAN(scat2gridgauss_yz_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_yz_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_xt_v0_init)(int *);
+void FORTRAN(scat2gridgauss_xt_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_xt_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_yt_v0_init)(int *);
+void FORTRAN(scat2gridgauss_yt_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_yt_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridgauss_zt_v0_init)(int *);
+void FORTRAN(scat2gridgauss_zt_v0_work_size)(int *);
+void FORTRAN(scat2gridgauss_zt_v0_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridlaplace_xy_init)(int *);
+void FORTRAN(scat2gridlaplace_xy_work_size)(int *);
+void FORTRAN(scat2gridlaplace_xy_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridlaplace_xz_init)(int *);
+void FORTRAN(scat2gridlaplace_xz_work_size)(int *);
+void FORTRAN(scat2gridlaplace_xz_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridlaplace_yz_init)(int *);
+void FORTRAN(scat2gridlaplace_yz_work_size)(int *);
+void FORTRAN(scat2gridlaplace_yz_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(scat2gridlaplace_xt_init)(int *);
+void FORTRAN(scat2gridlaplace_xt_work_size)(int *);
+void FORTRAN(scat2gridlaplace_xt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridlaplace_yt_init)(int *);
+void FORTRAN(scat2gridlaplace_yt_work_size)(int *);
+void FORTRAN(scat2gridlaplace_yt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2gridlaplace_zt_init)(int *);
+void FORTRAN(scat2gridlaplace_zt_work_size)(int *);
+void FORTRAN(scat2gridlaplace_zt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(sorti_init)(int *);
+void FORTRAN(sorti_result_limits)(int *);
+void FORTRAN(sorti_work_size)(int *);
+void FORTRAN(sorti_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sorti_str_init)(int *);
+void FORTRAN(sorti_str_result_limits)(int *);
+void FORTRAN(sorti_str_work_size)(int *);
+void FORTRAN(sorti_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+                   
+void FORTRAN(sortj_init)(int *);
+void FORTRAN(sortj_result_limits)(int *);
+void FORTRAN(sortj_work_size)(int *);
+void FORTRAN(sortj_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sortj_str_init)(int *);
+void FORTRAN(sortj_str_result_limits)(int *);
+void FORTRAN(sortj_str_work_size)(int *);
+void FORTRAN(sortj_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+
+void FORTRAN(sortk_init)(int *);
+void FORTRAN(sortk_result_limits)(int *);
+void FORTRAN(sortk_work_size)(int *);
+void FORTRAN(sortk_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sortk_str_init)(int *);
+void FORTRAN(sortk_str_result_limits)(int *);
+void FORTRAN(sortk_str_work_size)(int *);
+void FORTRAN(sortk_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+
+void FORTRAN(sortl_init)(int *);
+void FORTRAN(sortl_result_limits)(int *);
+void FORTRAN(sortl_work_size)(int *);
+void FORTRAN(sortl_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sortl_str_init)(int *);
+void FORTRAN(sortl_str_result_limits)(int *);
+void FORTRAN(sortl_str_work_size)(int *);
+void FORTRAN(sortl_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+
+
+void FORTRAN(sortm_init)(int *);
+void FORTRAN(sortm_result_limits)(int *);
+void FORTRAN(sortm_work_size)(int *);
+void FORTRAN(sortm_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sortm_str_init)(int *);
+void FORTRAN(sortm_str_result_limits)(int *);
+void FORTRAN(sortm_str_work_size)(int *);
+void FORTRAN(sortm_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+
+
+void FORTRAN(sortn_init)(int *);
+void FORTRAN(sortn_result_limits)(int *);
+void FORTRAN(sortn_work_size)(int *);
+void FORTRAN(sortn_compute)(int *, DFTYPE *, DFTYPE *, 
+      DFTYPE *, DFTYPE *);
+
+void FORTRAN(sortn_str_init)(int *);
+void FORTRAN(sortn_str_result_limits)(int *);
+void FORTRAN(sortn_str_work_size)(int *);
+void FORTRAN(sortn_str_compute)(int *, char *, DFTYPE *, 
+      char *, DFTYPE *);
+
+void FORTRAN(tauto_cor_init)(int *);
+void FORTRAN(tauto_cor_result_limits)(int *);
+void FORTRAN(tauto_cor_work_size)(int *);
+void FORTRAN(tauto_cor_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+
+void FORTRAN(xauto_cor_init)(int *);
+void FORTRAN(xauto_cor_result_limits)(int *);
+void FORTRAN(xauto_cor_work_size)(int *);
+void FORTRAN(xauto_cor_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *);
+						   
+void FORTRAN(eof_space_init)(int *);
+void FORTRAN(eof_space_result_limits)(int *);
+void FORTRAN(eof_space_work_size)(int *);
+void FORTRAN(eof_space_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+						   
+void FORTRAN(eof_stat_init)(int *);
+void FORTRAN(eof_stat_result_limits)(int *);
+void FORTRAN(eof_stat_work_size)(int *);
+void FORTRAN(eof_stat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+						   
+void FORTRAN(eof_tfunc_init)(int *);
+void FORTRAN(eof_tfunc_result_limits)(int *);
+void FORTRAN(eof_tfunc_work_size)(int *);
+void FORTRAN(eof_tfunc_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+						   
+						   
+void FORTRAN(eofsvd_space_init)(int *);
+void FORTRAN(eofsvd_space_result_limits)(int *);
+void FORTRAN(eofsvd_space_work_size)(int *);
+void FORTRAN(eofsvd_space_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *);
+						   
+void FORTRAN(eofsvd_stat_init)(int *);
+void FORTRAN(eofsvd_stat_result_limits)(int *);
+void FORTRAN(eofsvd_stat_work_size)(int *);
+void FORTRAN(eofsvd_stat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *);
+						   
+void FORTRAN(eofsvd_tfunc_init)(int *);
+void FORTRAN(eofsvd_tfunc_result_limits)(int *);
+void FORTRAN(eofsvd_tfunc_work_size)(int *);
+void FORTRAN(eofsvd_tfunc_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                           DFTYPE *);
+ 
+void FORTRAN(compressi_init)(int *);
+void FORTRAN(compressi_result_limits)(int *);
+void FORTRAN(compressi_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressj_init)(int *);
+void FORTRAN(compressj_result_limits)(int *);
+void FORTRAN(compressj_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressk_init)(int *);
+void FORTRAN(compressk_result_limits)(int *);
+void FORTRAN(compressk_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressl_init)(int *);
+void FORTRAN(compressl_result_limits)(int *);
+void FORTRAN(compressl_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressm_init)(int *);
+void FORTRAN(compressm_result_limits)(int *);
+void FORTRAN(compressm_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressn_init)(int *);
+void FORTRAN(compressn_result_limits)(int *);
+void FORTRAN(compressn_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressi_by_init)(int *);
+void FORTRAN(compressi_by_result_limits)(int *);
+void FORTRAN(compressi_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressj_by_init)(int *);
+void FORTRAN(compressj_by_result_limits)(int *);
+void FORTRAN(compressj_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressk_by_init)(int *);
+void FORTRAN(compressk_by_result_limits)(int *);
+void FORTRAN(compressk_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressl_by_init)(int *);
+void FORTRAN(compressl_by_result_limits)(int *);
+void FORTRAN(compressl_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressm_by_init)(int *);
+void FORTRAN(compressm_by_result_limits)(int *);
+void FORTRAN(compressm_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(compressn_by_init)(int *);
+void FORTRAN(compressn_by_result_limits)(int *);
+void FORTRAN(compressn_by_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(labwid_init)(int *);
+void FORTRAN(labwid_result_limits)(int *);
+void FORTRAN(labwid_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolvei_init)(int *);
+void FORTRAN(convolvei_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolvej_init)(int *);
+void FORTRAN(convolvej_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolvek_init)(int *);
+void FORTRAN(convolvek_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolvel_init)(int *);
+void FORTRAN(convolvel_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolvem_init)(int *);
+void FORTRAN(convolvem_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(convolven_init)(int *);
+void FORTRAN(convolven_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(curv_range_init)(int *);
+void FORTRAN(curv_range_result_limits)(int *);
+void FORTRAN(curv_range_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(curv_to_rect_map_init)(int *);
+void FORTRAN(curv_to_rect_map_result_limits)(int *);
+void FORTRAN(curv_to_rect_map_work_size)(int *);
+void FORTRAN(curv_to_rect_map_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                                       DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+void FORTRAN(curv_to_rect_init)(int *);
+void FORTRAN(curv_to_rect_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(rect_to_curv_init)(int *);
+void FORTRAN(rect_to_curv_work_size)(int *);
+void FORTRAN(rect_to_curv_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                                       DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(date1900_init)(int *);
+void FORTRAN(date1900_result_limits)(int *);
+void FORTRAN(date1900_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(days1900toymdhms_init)(int *);
+void FORTRAN(days1900toymdhms_result_limits)(int *);
+void FORTRAN(days1900toymdhms_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(minutes24_init)(int *);
+void FORTRAN(minutes24_result_limits)(int *);
+void FORTRAN(minutes24_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(element_index_init)(int *);
+void FORTRAN(element_index_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(element_index_str_init)(int *);
+void FORTRAN(element_index_str_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(element_index_str_n_init)(int *);
+void FORTRAN(element_index_str_n_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expnd_by_len_init)(int *);
+void FORTRAN(expnd_by_len_result_limits)(int *);
+void FORTRAN(expnd_by_len_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expnd_by_len_str_init)(int *);
+void FORTRAN(expnd_by_len_str_result_limits)(int *);
+void FORTRAN(expnd_by_len_str_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expndi_by_init)(int *);
+void FORTRAN(expndi_by_result_limits)(int *);
+void FORTRAN(expndi_by_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expndi_by_t_init)(int *);
+void FORTRAN(expndi_by_t_result_limits)(int *);
+void FORTRAN(expndi_by_t_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expndi_by_z_init)(int *);
+void FORTRAN(expndi_by_z_result_limits)(int *);
+void FORTRAN(expndi_by_z_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expndi_by_z_counts_init)(int *);
+void FORTRAN(expndi_by_z_counts_result_limits)(int *);
+void FORTRAN(expndi_by_z_counts_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(expndi_id_by_z_counts_init)(int *);
+void FORTRAN(expndi_id_by_z_counts_result_limits)(int *);
+void FORTRAN(expndi_id_by_z_counts_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fc_isubset_init)(int *);
+void FORTRAN(fc_isubset_result_limits)(int *);
+void FORTRAN(fc_isubset_custom_axes)(int *);
+void FORTRAN(fc_isubset_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(findhi_init)(int *);
+void FORTRAN(findhi_result_limits)(int *);
+void FORTRAN(findhi_work_size)(int *);
+void FORTRAN(findhi_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                            DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(findlo_init)(int *);
+void FORTRAN(findlo_result_limits)(int *);
+void FORTRAN(findlo_work_size)(int *);
+void FORTRAN(findlo_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                            DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(is_element_of_init)(int *);
+void FORTRAN(is_element_of_result_limits)(int *);
+void FORTRAN(is_element_of_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(is_element_of_str_init)(int *);
+void FORTRAN(is_element_of_str_result_limits)(int *);
+void FORTRAN(is_element_of_str_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+
+void FORTRAN(is_element_of_str_n_init)(int *);
+void FORTRAN(is_element_of_str_n_result_limits)(int *);
+void FORTRAN(is_element_of_str_n_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(lanczos_init)(int *);
+void FORTRAN(lanczos_work_size)(int *);
+void FORTRAN(lanczos_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                            DFTYPE *, DFTYPE *);
+
+void FORTRAN(lsl_lowpass_init)(int *);
+void FORTRAN(lsl_lowpass_work_size)(int *);
+void FORTRAN(lsl_lowpass_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+                            DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+							
+
+void FORTRAN(samplexy_curv_init)(int *);
+void FORTRAN(samplexy_curv_result_limits)(int *);
+void FORTRAN(samplexy_curv_work_size)(int *);
+void FORTRAN(samplexy_curv_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexy_curv_avg_init)(int *);
+void FORTRAN(samplexy_curv_avg_result_limits)(int *);
+void FORTRAN(samplexy_curv_avg_work_size)(int *);
+void FORTRAN(samplexy_curv_avg_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexy_curv_nrst_init)(int *);
+void FORTRAN(samplexy_curv_nrst_result_limits)(int *);
+void FORTRAN(samplexy_curv_nrst_work_size)(int *);
+void FORTRAN(samplexy_curv_nrst_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexy_closest_init)(int *);
+void FORTRAN(samplexy_closest_result_limits)(int *);
+void FORTRAN(samplexy_closest_work_size)(int *);
+void FORTRAN(samplexy_closest_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(samplexz_init)(int *);
+void FORTRAN(samplexz_result_limits)(int *);
+void FORTRAN(samplexz_work_size)(int *);
+void FORTRAN(samplexz_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(sampleyz_init)(int *);
+void FORTRAN(sampleyz_result_limits)(int *);
+void FORTRAN(sampleyz_work_size)(int *);
+void FORTRAN(sampleyz_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2ddups_init)(int *);
+void FORTRAN(scat2ddups_result_limits)(int *);
+void FORTRAN(scat2ddups_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(ave_scat2grid_t_init)(int *);
+void FORTRAN(ave_scat2grid_t_work_size)(int *);
+void FORTRAN(ave_scat2grid_t_compute)(int *, DFTYPE *, DFTYPE *,
+      DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_t_init)(int *);
+void FORTRAN(scat2grid_t_work_size)(int *);
+void FORTRAN(scat2grid_t_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_xt_init)(int *);
+void FORTRAN(transpose_xt_result_limits)(int *);
+void FORTRAN(transpose_xt_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_xy_init)(int *);
+void FORTRAN(transpose_xy_result_limits)(int *);
+void FORTRAN(transpose_xy_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_xz_init)(int *);
+void FORTRAN(transpose_xz_result_limits)(int *);
+void FORTRAN(transpose_xz_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_yt_init)(int *);
+void FORTRAN(transpose_yt_result_limits)(int *);
+void FORTRAN(transpose_yt_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_yz_init)(int *);
+void FORTRAN(transpose_yz_result_limits)(int *);
+void FORTRAN(transpose_yz_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(transpose_zt_init)(int *);
+void FORTRAN(transpose_zt_result_limits)(int *);
+void FORTRAN(transpose_zt_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(xcat_init)(int *);
+void FORTRAN(xcat_result_limits)(int *);
+void FORTRAN(xcat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(xcat_str_init)(int *);
+void FORTRAN(xcat_str_result_limits)(int *);
+void FORTRAN(xcat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(ycat_init)(int *);
+void FORTRAN(ycat_result_limits)(int *);
+void FORTRAN(ycat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(ycat_str_init)(int *);
+void FORTRAN(ycat_str_result_limits)(int *);
+void FORTRAN(ycat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(zcat_init)(int *);
+void FORTRAN(zcat_result_limits)(int *);
+void FORTRAN(zcat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zcat_str_init)(int *);
+void FORTRAN(zcat_str_result_limits)(int *);
+void FORTRAN(zcat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(tcat_init)(int *);
+void FORTRAN(tcat_result_limits)(int *);
+void FORTRAN(tcat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tcat_str_init)(int *);
+void FORTRAN(tcat_str_result_limits)(int *);
+void FORTRAN(tcat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(ecat_init)(int *);
+void FORTRAN(ecat_result_limits)(int *);
+void FORTRAN(ecat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(ecat_str_init)(int *);
+void FORTRAN(ecat_str_result_limits)(int *);
+void FORTRAN(ecat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(fcat_init)(int *);
+void FORTRAN(fcat_result_limits)(int *);
+void FORTRAN(fcat_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fcat_str_init)(int *);
+void FORTRAN(fcat_str_result_limits)(int *);
+void FORTRAN(fcat_str_compute)(int *, char *, char *, char *);
+
+void FORTRAN(xreverse_init)(int *);
+void FORTRAN(xreverse_result_limits)(int *);
+void FORTRAN(xreverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(yreverse_init)(int *);
+void FORTRAN(yreverse_result_limits)(int *);
+void FORTRAN(yreverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zreverse_init)(int *);
+void FORTRAN(zreverse_result_limits)(int *);
+void FORTRAN(zreverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(treverse_init)(int *);
+void FORTRAN(treverse_result_limits)(int *);
+void FORTRAN(treverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(ereverse_init)(int *);
+void FORTRAN(ereverse_result_limits)(int *);
+void FORTRAN(ereverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(freverse_init)(int *);
+void FORTRAN(freverse_result_limits)(int *);
+void FORTRAN(freverse_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zaxreplace_avg_init)(int *);
+void FORTRAN(zaxreplace_avg_work_size)(int *);
+void FORTRAN(zaxreplace_avg_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zaxreplace_bin_init)(int *);
+void FORTRAN(zaxreplace_bin_work_size)(int *);
+void FORTRAN(zaxreplace_bin_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zaxreplace_rev_init)(int *);
+void FORTRAN(zaxreplace_rev_work_size)(int *);
+void FORTRAN(zaxreplace_rev_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(zaxreplace_zlev_init)(int *);
+void FORTRAN(zaxreplace_zlev_work_size)(int *);
+void FORTRAN(zaxreplace_zlev_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(nco_attr_init)(int *);
+void FORTRAN(nco_attr_result_limits)(int *);
+void FORTRAN(nco_attr_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(nco_init)(int *);
+void FORTRAN(nco_result_limits)(int *);
+void FORTRAN(nco_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_datestring_init)(int *);
+void FORTRAN(tax_datestring_work_size)(int *);
+void FORTRAN(tax_datestring_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_day_init)(int *);
+void FORTRAN(tax_day_work_size)(int *);
+void FORTRAN(tax_day_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_dayfrac_init)(int *);
+void FORTRAN(tax_dayfrac_work_size)(int *);
+void FORTRAN(tax_dayfrac_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_jday1900_init)(int *);
+void FORTRAN(tax_jday1900_work_size)(int *);
+void FORTRAN(tax_jday1900_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_jday_init)(int *);
+void FORTRAN(tax_jday_work_size)(int *);
+void FORTRAN(tax_jday_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_month_init)(int *);
+void FORTRAN(tax_month_work_size)(int *);
+void FORTRAN(tax_month_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_times_init)(int *);
+void FORTRAN(tax_times_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_tstep_init)(int *);
+void FORTRAN(tax_tstep_work_size)(int *);
+void FORTRAN(tax_tstep_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_units_init)(int *);
+void FORTRAN(tax_units_compute)(int *, DFTYPE *, DFTYPE*);
+
+void FORTRAN(tax_year_init)(int *);
+void FORTRAN(tax_year_work_size)(int *);
+void FORTRAN(tax_year_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(tax_yearfrac_init)(int *);
+void FORTRAN(tax_yearfrac_work_size)(int *);
+void FORTRAN(tax_yearfrac_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(fill_xy_init)(int *);
+void FORTRAN(fill_xy_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(test_opendap_init)(int *);
+void FORTRAN(test_opendap_result_limits)(int *);
+void FORTRAN(test_opendap_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_bin_xy_init)(int *);
+void FORTRAN(scat2grid_bin_xy_work_size)(int *);
+void FORTRAN(scat2grid_bin_xy_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_bin_xyt_init)(int *);
+void FORTRAN(scat2grid_bin_xyt_work_size)(int *);
+void FORTRAN(scat2grid_bin_xyt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_nbin_xy_init)(int *);
+void FORTRAN(scat2grid_nbin_xy_work_size)(int *);
+void FORTRAN(scat2grid_nbin_xy_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_nbin_xyt_init)(int *);
+void FORTRAN(scat2grid_nbin_xyt_work_size)(int *);
+void FORTRAN(scat2grid_nbin_xyt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_nobs_xyt_init)(int *);
+void FORTRAN(scat2grid_nobs_xyt_work_size)(int *);
+void FORTRAN(scat2grid_nobs_xyt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(scat2grid_nobs_xy_init)(int *);
+void FORTRAN(scat2grid_nobs_xy_work_size)(int *);
+void FORTRAN(scat2grid_nobs_xy_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(unique_str2int_init)(int *);
+void FORTRAN(unique_str2int_compute)(char *, int *);
+
+void FORTRAN(bin_index_wt_init)(int *);
+void FORTRAN(bin_index_wt_result_limits)(int *);
+void FORTRAN(bin_index_wt_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(minmax_init)(int *);
+void FORTRAN(minmax_result_limits)(int *);
+void FORTRAN(minmax_compute)(int *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(floatstr_init)(int *);
+void FORTRAN(floatstr_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(pt_in_poly_init)(int *);
+void FORTRAN(pt_in_poly_work_size)(int *);
+void FORTRAN(pt_in_poly_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, 
+  DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(list_value_xml_init)(int *);
+void FORTRAN(list_value_xml_result_limits)(int *);
+void FORTRAN(list_value_xml_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(write_webrow_init)(int *);
+void FORTRAN(write_webrow_result_limits)(int *);
+void FORTRAN(write_webrow_compute)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+void FORTRAN(str_mask_init)(int *);
+void FORTRAN(str_mask_compute)(int *, DFTYPE *, DFTYPE *);
+
+/*
+ *  End of declarations for internally linked external functions
+ *  ------------------------------------ */
+
+
+/* .............. Function Definitions .............. */
+
+
+/* .... Functions for use by Ferret (to be called from Fortran) .... */
+
+/*
+ * Note that all routines called directly from Ferret,
+ * ie. directly from Fortran, should be all lower case,
+ * should pass by reference and should end with an underscore.
+ */
+
+/*
+ * Find all of the ~.so files in directories listed in the
+ * FER_EXTERNAL_FUNCTIONS environment variable and add all 
+ * the names and associated directory information to the 
+ * STATIC_ExternalFunctionList.
+ */
+int FORTRAN(efcn_scan)( int *gfcn_num_internal )
+{
+  FILE *file_ptr=NULL;
+  ExternalFunction ef; 
+ 
+  char file[EF_MAX_NAME_LENGTH]="";
+  char *path_ptr=NULL, path[8192]="";
+  char paths[8192]="", cmd[EF_MAX_DESCRIPTION_LENGTH]="";
+  int count=0, status=LIST_OK;
+  int i_intEF;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+    
+/*  ------------------------------------
+ *  Count and list the names of internally linked EF's
+ *  Lines with names are generated by the perl script 
+ *  int_dlsym.pl.  Check that N_INTEF is correctly defined below.
+ */
+
+#define N_INTEF 162
+
+struct {
+  char funcname[EF_MAX_NAME_LENGTH];
+} I_EFnames[N_INTEF];
+
+   strcpy(I_EFnames[0].funcname, "ave_scat2grid_t");
+   strcpy(I_EFnames[1].funcname, "bin_index_wt");
+   strcpy(I_EFnames[2].funcname, "compressi");
+   strcpy(I_EFnames[3].funcname, "compressi_by");
+   strcpy(I_EFnames[4].funcname, "compressj");
+   strcpy(I_EFnames[5].funcname, "compressj_by");
+   strcpy(I_EFnames[6].funcname, "compressk");
+   strcpy(I_EFnames[7].funcname, "compressk_by");
+   strcpy(I_EFnames[8].funcname, "compressl");
+   strcpy(I_EFnames[9].funcname, "compressl_by");
+   strcpy(I_EFnames[10].funcname, "compressm");
+   strcpy(I_EFnames[11].funcname, "compressm_by");
+   strcpy(I_EFnames[12].funcname, "compressn");
+   strcpy(I_EFnames[13].funcname, "compressn_by");
+   strcpy(I_EFnames[14].funcname, "convolvei");
+   strcpy(I_EFnames[15].funcname, "convolvej");
+   strcpy(I_EFnames[16].funcname, "convolvek");
+   strcpy(I_EFnames[17].funcname, "convolvel");
+   strcpy(I_EFnames[18].funcname, "convolvem");
+   strcpy(I_EFnames[19].funcname, "convolven");
+   strcpy(I_EFnames[20].funcname, "curv_range");
+   strcpy(I_EFnames[21].funcname, "curv_to_rect");
+   strcpy(I_EFnames[22].funcname, "curv_to_rect_map");
+   strcpy(I_EFnames[23].funcname, "date1900");
+   strcpy(I_EFnames[24].funcname, "days1900toymdhms");
+   strcpy(I_EFnames[25].funcname, "ecat");
+   strcpy(I_EFnames[26].funcname, "ecat_str");
+   strcpy(I_EFnames[27].funcname, "element_index");
+   strcpy(I_EFnames[28].funcname, "element_index_str");
+   strcpy(I_EFnames[29].funcname, "element_index_str_n");
+   strcpy(I_EFnames[30].funcname, "eof_space");
+   strcpy(I_EFnames[31].funcname, "eof_stat");
+   strcpy(I_EFnames[32].funcname, "eof_tfunc");
+   strcpy(I_EFnames[33].funcname, "ereverse");
+   strcpy(I_EFnames[34].funcname, "expndi_by");
+   strcpy(I_EFnames[35].funcname, "expndi_by_t");
+   strcpy(I_EFnames[36].funcname, "expndi_by_z");
+   strcpy(I_EFnames[37].funcname, "fcat");
+   strcpy(I_EFnames[38].funcname, "fcat_str");
+   strcpy(I_EFnames[39].funcname, "ffta");
+   strcpy(I_EFnames[40].funcname, "fft_im");
+   strcpy(I_EFnames[41].funcname, "fft_inverse");
+   strcpy(I_EFnames[42].funcname, "fftp");
+   strcpy(I_EFnames[43].funcname, "fft_re");
+   strcpy(I_EFnames[44].funcname, "fill_xy");
+   strcpy(I_EFnames[45].funcname, "findhi");
+   strcpy(I_EFnames[46].funcname, "findlo");
+   strcpy(I_EFnames[47].funcname, "floatstr");
+   strcpy(I_EFnames[48].funcname, "freverse");
+   strcpy(I_EFnames[49].funcname, "is_element_of");
+   strcpy(I_EFnames[50].funcname, "is_element_of_str");
+   strcpy(I_EFnames[51].funcname, "is_element_of_str_n");
+   strcpy(I_EFnames[52].funcname, "labwid");
+   strcpy(I_EFnames[53].funcname, "lanczos");
+   strcpy(I_EFnames[54].funcname, "list_value_xml");
+   strcpy(I_EFnames[55].funcname, "lsl_lowpass");
+   strcpy(I_EFnames[56].funcname, "minmax");
+   strcpy(I_EFnames[57].funcname, "minutes24");
+   strcpy(I_EFnames[58].funcname, "nco");
+   strcpy(I_EFnames[59].funcname, "nco_attr");
+   strcpy(I_EFnames[60].funcname, "pt_in_poly");
+   strcpy(I_EFnames[61].funcname, "rect_to_curv");
+   strcpy(I_EFnames[62].funcname, "sampleij");
+   strcpy(I_EFnames[63].funcname, "samplei_multi");
+   strcpy(I_EFnames[64].funcname, "samplej_multi");
+   strcpy(I_EFnames[65].funcname, "samplek_multi");
+   strcpy(I_EFnames[66].funcname, "samplel_multi");
+   strcpy(I_EFnames[67].funcname, "samplet_date");
+   strcpy(I_EFnames[68].funcname, "samplexy");
+   strcpy(I_EFnames[69].funcname, "samplexy_closest");
+   strcpy(I_EFnames[70].funcname, "samplexy_curv");
+   strcpy(I_EFnames[71].funcname, "samplexy_curv_avg");
+   strcpy(I_EFnames[72].funcname, "samplexy_curv_nrst");
+   strcpy(I_EFnames[73].funcname, "samplexyt");
+   strcpy(I_EFnames[74].funcname, "samplexz");
+   strcpy(I_EFnames[75].funcname, "sampleyz");
+   strcpy(I_EFnames[76].funcname, "scat2ddups");
+   strcpy(I_EFnames[77].funcname, "scat2grid_bin_xy");
+   strcpy(I_EFnames[78].funcname, "scat2grid_bin_xyt");
+   strcpy(I_EFnames[79].funcname, "scat2gridgauss_xt");
+   strcpy(I_EFnames[80].funcname, "scat2gridgauss_xt_v0");
+   strcpy(I_EFnames[81].funcname, "scat2gridgauss_xy");
+   strcpy(I_EFnames[82].funcname, "scat2gridgauss_xy_v0");
+   strcpy(I_EFnames[83].funcname, "scat2gridgauss_xz");
+   strcpy(I_EFnames[84].funcname, "scat2gridgauss_xz_v0");
+   strcpy(I_EFnames[85].funcname, "scat2gridgauss_yt");
+   strcpy(I_EFnames[86].funcname, "scat2gridgauss_yt_v0");
+   strcpy(I_EFnames[87].funcname, "scat2gridgauss_yz");
+   strcpy(I_EFnames[88].funcname, "scat2gridgauss_yz_v0");
+   strcpy(I_EFnames[89].funcname, "scat2gridgauss_zt");
+   strcpy(I_EFnames[90].funcname, "scat2gridgauss_zt_v0");
+   strcpy(I_EFnames[91].funcname, "scat2gridlaplace_xt");
+   strcpy(I_EFnames[92].funcname, "scat2gridlaplace_xy");
+   strcpy(I_EFnames[93].funcname, "scat2gridlaplace_xz");
+   strcpy(I_EFnames[94].funcname, "scat2gridlaplace_yt");
+   strcpy(I_EFnames[95].funcname, "scat2gridlaplace_yz");
+   strcpy(I_EFnames[96].funcname, "scat2gridlaplace_zt");
+   strcpy(I_EFnames[97].funcname, "scat2grid_nbin_xy");
+   strcpy(I_EFnames[98].funcname, "scat2grid_nbin_xyt");
+   strcpy(I_EFnames[99].funcname, "scat2grid_nobs_xy");
+   strcpy(I_EFnames[100].funcname, "scat2grid_nobs_xyt");
+   strcpy(I_EFnames[101].funcname, "scat2grid_t");
+   strcpy(I_EFnames[102].funcname, "sorti");
+   strcpy(I_EFnames[103].funcname, "sorti_str");
+   strcpy(I_EFnames[104].funcname, "sortj");
+   strcpy(I_EFnames[105].funcname, "sortj_str");
+   strcpy(I_EFnames[106].funcname, "sortk");
+   strcpy(I_EFnames[107].funcname, "sortk_str");
+   strcpy(I_EFnames[108].funcname, "sortl");
+   strcpy(I_EFnames[109].funcname, "sortl_str");
+   strcpy(I_EFnames[110].funcname, "sortm");
+   strcpy(I_EFnames[111].funcname, "sortm_str");
+   strcpy(I_EFnames[112].funcname, "sortn");
+   strcpy(I_EFnames[113].funcname, "sortn_str");
+   strcpy(I_EFnames[114].funcname, "tauto_cor");
+   strcpy(I_EFnames[115].funcname, "tax_datestring");
+   strcpy(I_EFnames[116].funcname, "tax_day");
+   strcpy(I_EFnames[117].funcname, "tax_dayfrac");
+   strcpy(I_EFnames[118].funcname, "tax_jday");
+   strcpy(I_EFnames[119].funcname, "tax_jday1900");
+   strcpy(I_EFnames[120].funcname, "tax_month");
+   strcpy(I_EFnames[121].funcname, "tax_times");
+   strcpy(I_EFnames[122].funcname, "tax_tstep");
+   strcpy(I_EFnames[123].funcname, "tax_units");
+   strcpy(I_EFnames[124].funcname, "tax_year");
+   strcpy(I_EFnames[125].funcname, "tax_yearfrac");
+   strcpy(I_EFnames[126].funcname, "tcat");
+   strcpy(I_EFnames[127].funcname, "tcat_str");
+   strcpy(I_EFnames[128].funcname, "test_opendap");
+   strcpy(I_EFnames[129].funcname, "transpose_xt");
+   strcpy(I_EFnames[130].funcname, "transpose_xy");
+   strcpy(I_EFnames[131].funcname, "transpose_xz");
+   strcpy(I_EFnames[132].funcname, "transpose_yt");
+   strcpy(I_EFnames[133].funcname, "transpose_yz");
+   strcpy(I_EFnames[134].funcname, "transpose_zt");
+   strcpy(I_EFnames[135].funcname, "treverse");
+   strcpy(I_EFnames[136].funcname, "unique_str2int");
+   strcpy(I_EFnames[137].funcname, "write_webrow");
+   strcpy(I_EFnames[138].funcname, "xauto_cor");
+   strcpy(I_EFnames[139].funcname, "xcat");
+   strcpy(I_EFnames[140].funcname, "xcat_str");
+   strcpy(I_EFnames[141].funcname, "xreverse");
+   strcpy(I_EFnames[142].funcname, "ycat");
+   strcpy(I_EFnames[143].funcname, "ycat_str");
+   strcpy(I_EFnames[144].funcname, "yreverse");
+   strcpy(I_EFnames[145].funcname, "zaxreplace_avg");
+   strcpy(I_EFnames[146].funcname, "zaxreplace_bin");
+   strcpy(I_EFnames[147].funcname, "zaxreplace_rev");
+   strcpy(I_EFnames[148].funcname, "zaxreplace_zlev");
+   strcpy(I_EFnames[149].funcname, "zcat");
+   strcpy(I_EFnames[150].funcname, "zcat_str");
+   strcpy(I_EFnames[151].funcname, "zreverse");
+   strcpy(I_EFnames[152].funcname, "eofsvd_space");
+   strcpy(I_EFnames[153].funcname, "eofsvd_stat");
+   strcpy(I_EFnames[154].funcname, "eofsvd_tfunc");
+   strcpy(I_EFnames[155].funcname, "expnd_by_len");
+   strcpy(I_EFnames[156].funcname, "expnd_by_len_str");
+   strcpy(I_EFnames[157].funcname, "fc_isubset");
+   strcpy(I_EFnames[158].funcname, "expndi_by_z_counts");
+   strcpy(I_EFnames[159].funcname, "expndi_id_by_z_counts");
+   strcpy(I_EFnames[160].funcname, "str_mask");
+   strcpy(I_EFnames[161].funcname, "samplexyt_nrst");
+
+/*    
+ *  ------------------------------------ 
+ */
+
+
+
+  if ( I_have_scanned_already ) {
+    return_val = list_size(STATIC_ExternalFunctionList);
+    return return_val;
+  }
+
+  if ( (STATIC_ExternalFunctionList = list_init()) == NULL ) {
+    fputs("**ERROR: efcn_scan: Unable to initialize STATIC_ExternalFunctionList.\n", stderr);
+    return_val = -1;
+    return return_val;
+  }
+
+  /*
+   * Open $FER_LIBS/ferret_ef_mem_subsc.so with RTLD_GLOBAL flag to create
+   * the external copy of the FERRET_EF_MEM_SUBSC common block.
+   */
+  path_ptr = getenv("FER_LIBS");
+  if ( path_ptr == NULL ) {
+     fputs("**ERROR: efcn_scan: FER_LIBS is not defined\n", stderr);
+     return_val = -1;
+     return return_val;
+  }
+  sprintf(path, "%s/ferret_ef_mem_subsc.so", path_ptr);
+  ferret_ef_mem_subsc_so_ptr = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
+  if ( ferret_ef_mem_subsc_so_ptr == NULL ) {
+     fprintf(stderr, "**ERROR: efcn_scan: dlopen of %s\n"
+                     "  failed -- %s\n", path, dlerror());
+     return_val = -1;
+     return return_val;
+  }
+  copy_ferret_ef_mem_subsc_ptr = 
+          (void (*)(void)) dlsym(ferret_ef_mem_subsc_so_ptr,
+                                 "copy_ferret_ef_mem_subsc_");
+  if ( copy_ferret_ef_mem_subsc_ptr == NULL ) {
+     fprintf(stderr, "**ERROR: efcn_scan: copy_ferret_ef_mem_subsc_\n"
+                     "  not found in $FER_LIBS/ferret_ef_mem_subsc.so\n"
+                     "  -- %s\n", dlerror());
+     return_val = -1;
+     return return_val;
+  }
+
+  /*
+   * Get internally linked external functions;  and add all 
+   * the names and associated directory information to the 
+   * STATIC_ExternalFunctionList.
+   */
+
+
+  /*
+   * Read a name at a time.
+   */
+
+      for (i_intEF = 0; i_intEF < N_INTEF;   i_intEF = i_intEF + 1 ) {
+	      strcpy(ef.path, "internally_linked");
+	      strcpy(ef.name, I_EFnames[i_intEF].funcname);
+	      ef.id = *gfcn_num_internal + ++count; /* pre-increment because F arrays start at 1 */
+	      ef.already_have_internals = NO;
+	      ef.internals_ptr = NULL;
+	      list_insert_after(STATIC_ExternalFunctionList, (char *) &ef, sizeof(ExternalFunction));
+
+      }
+
+  /*
+   * - Get all the paths from the "FER_EXTERNAL_FUNCTIONS" environment variable.
+   *
+   * - While there is another path:
+   *    - get the path;
+   *    - create a pipe for the "ls -1" command;
+   *    - read stdout and use each file name to create another external function entry;
+   *
+   */
+
+  if ( !getenv("FER_EXTERNAL_FUNCTIONS") ) {
+    if ( !I_have_warned_already ) {
+      fprintf(stderr, "\n"
+                      "WARNING: environment variable FER_EXTERNAL_FUNCTIONS not defined.\n\n");
+      I_have_warned_already = TRUE;
+    }
+    /* *kob* v5.32 - the return val was set to 0 below but that was wrong. 
+       That didn't take into account that on any system, the 
+       FER_EXTERNAL_FUNCTIONS env variable might not be set.  If that were the
+       case, a core dump occurred on all systems.  Set return_val to count, 
+       which was generated above - also have to  note that the ef's 
+       have been scanned*/
+    return_val = count; 
+    I_have_scanned_already = TRUE;
+    return return_val;
+  }
+
+  sprintf(paths, "%s", getenv("FER_EXTERNAL_FUNCTIONS"));
+    
+  path_ptr = strtok(paths, " \t");
+
+  if ( path_ptr == NULL ) {
+ 
+    fprintf(stderr, "\n"
+                    "WARNING:No paths were found in the environment variable FER_EXTERNAL_FUNCTIONS.\n\n");
+
+    return_val = 0;
+    return return_val;
+ 
+  } else {
+    
+    do {
+
+	  strcpy(path, path_ptr);
+
+      if (path[strlen(path)-1] != '/')
+        strcat(path, "/"); 
+
+      sprintf(cmd, "ls -1 %s", path);
+
+      /* Open a pipe to the "ls" command */
+      if ( (file_ptr = popen(cmd, "r")) == (FILE *) NULL ) {
+	    fputs("**ERROR: Cannot open pipe.\n", stderr);
+	    return_val = -1;
+	    return return_val;
+      }
+ 
+      /*
+       * Read a line at a time.
+       * Any ~.so files are assumed to be external functions.
+       */
+      while ( fgets(file, EF_MAX_NAME_LENGTH, file_ptr) != NULL ) {
+
+        char *extension;
+
+	    file[strlen(file)-1] = '\0';   /* chop off the carriage return */
+	    extension = &file[strlen(file)-3];
+	    if ( strcmp(extension, ".so") == 0 ) {
+          file[strlen(file)-3] = '\0'; /* chop off the ".so" */
+	      strcpy(ef.path, path);
+	      strcpy(ef.name, file);
+	      ef.id = *gfcn_num_internal + ++count; /* pre-increment because F arrays start at 1 */
+	      ef.already_have_internals = NO;
+	      ef.internals_ptr = NULL;
+	      list_insert_after(STATIC_ExternalFunctionList, (char *) &ef, sizeof(ExternalFunction));
+	    }
+
+      }
+ 
+      pclose(file_ptr);
+ 
+      path_ptr = strtok(NULL, " \t"); /* get the next directory */
+ 
+    } while ( path_ptr != NULL );
+
+    I_have_scanned_already = TRUE;
+  }
+
+  return_val = count;
+  return return_val;
+
+}
+
+
+/*
+ * Determine whether an external function has already 
+ * had its internals read.
+ */
+int FORTRAN(efcn_already_have_internals)( int *id_ptr )
+{
+  ExternalFunction *ef_ptr;
+  int return_val;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     return 0;
+  }
+
+  return_val = ef_ptr->already_have_internals;
+  return return_val;
+}
+
+
+
+/*
+ * Create a new python-backed external function.  The initialization of
+ * this function is done at this time to ensure that the python module is
+ * valid and contains suitable functions.  Initialization is accomplished
+ * using generic wrapper functions.
+ * Input arguments:
+ *    fname - name for the function
+ *    lenfname - actual length of the name in fname
+ *    pymod - name of the python module suitable for a python import statement
+ *            (eg, "package.subpackage.module")
+ *    lenpymod - actual length of the name in pymod
+ * Output arguments:
+ *    errstring - error message if something went wrong
+ *    lenerrstring - actual length of the string returned in errstring
+ * The value of lenerrstring will be zero if and only if there were no errors
+ *
+ * Note: this function assume Hollerith strings are passed as character arrays
+ *       (and max lengths appended as ints to the end of the argument list -
+ *        they are not listed here since unused; also permits saying the strings 
+ *        are simple arrays in Fortran)
+ */
+void FORTRAN(create_pyefcn)(char fname[], int *lenfname, char pymod[], int *lenpymod,
+                            char errstring[], int *lenerrstring)
+{
+    ExternalFunction ef; 
+    ExternalFunction *ef_ptr; 
+    char libname[1024];
+
+    /* Check string lengths since these values might possibly be exceeded */
+    if ( *lenpymod >= EF_MAX_DESCRIPTION_LENGTH ) {
+        sprintf(errstring, "Module name too long (must be less than %d characters)", EF_MAX_DESCRIPTION_LENGTH);
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+    if ( *lenfname >= EF_MAX_NAME_LENGTH ) {
+        sprintf(errstring, "Function name too long (must be less than %d characters)", EF_MAX_NAME_LENGTH);
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+
+    /* 
+     * Assign the local ExternalFunction structure, assigning the module name to the path element
+     * Get the ID for this new function by adding one to the ID of the last element in the list.
+     * (The IDs do not match the size of the list.)
+     */
+    ef.handle = NULL;
+    ef_ptr = (ExternalFunction *) list_rear(STATIC_ExternalFunctionList);
+    ef.id = ef_ptr->id + 1;
+    strncpy(ef.name, fname, *lenfname);
+    ef.name[*lenfname] = '\0';
+    strncpy(ef.path, pymod, *lenpymod);
+    ef.path[*lenpymod] = '\0';
+    ef.already_have_internals = FALSE;
+    ef.internals_ptr = NULL;
+
+    /* Add a copy of this ExternalFunction to the end of the global list of external functions */
+    list_mvrear(STATIC_ExternalFunctionList);
+    ef_ptr = (ExternalFunction *)list_insert_after(STATIC_ExternalFunctionList, (char *) &ef, sizeof(ExternalFunction));
+
+    /* Allocate and initialize the internals data for this ExternalFunction in the list */
+    if ( EF_New(ef_ptr) != 0 ) {
+        strcpy(errstring, "Unable to allocate memory for the internals data in create_pyefcn");
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+    ef_ptr->internals_ptr->language = EF_PYTHON;
+    ef_ptr->already_have_internals = TRUE;
+
+    /*
+     * Prepare for bailout possibilities by setting a signal handler for
+     * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+     * environment with sigsetjmp (for the signal handler) and setjmp 
+     * (for the "bail out" utility function).
+     */   
+    if ( EF_Util_setsig("create_pyefcn")) {
+        list_remove_rear(STATIC_ExternalFunctionList);
+        free(ef_ptr->internals_ptr);
+        free(ef_ptr);
+        strcpy(errstring, "Unable to set signal handlers in create_pyefcn");
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+    if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+        list_remove_rear(STATIC_ExternalFunctionList);
+        free(ef_ptr->internals_ptr);
+        free(ef_ptr);
+        strcpy(errstring, "Signal caught in create_pyefcn");
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+    if (setjmp(jumpbuffer) != 0) {
+        list_remove_rear(STATIC_ExternalFunctionList);
+        free(ef_ptr->internals_ptr);
+        free(ef_ptr);
+        strcpy(errstring, "ef_bail_out called in create_pyefcn");
+        *lenerrstring = strlen(errstring);
+        return;
+    }
+    canjump = 1;
+
+    pyefcn_init(ef_ptr->id, ef_ptr->path, errstring);
+
+    /* Restore the old signal handlers. */
+    EF_Util_ressig("create_pyefcn");
+
+    *lenerrstring = strlen(errstring);
+    if ( *lenerrstring > 0 ) {
+        list_remove_rear(STATIC_ExternalFunctionList);
+        free(ef_ptr->internals_ptr);
+        free(ef_ptr);
+    }
+    return;
+}
+
+
+
+/*
+ * Find an external function based on its integer ID and
+ * gather information describing the function. 
+ *
+ * Return values:
+ *     -1: error occurred, dynamic linking was unsuccessful
+ *      0: success
+ */
+int FORTRAN(efcn_gather_info)( int *id_ptr )
+{
+  ExternalFunction *ef_ptr;
+  int internally_linked;
+  char tempText[1024];
+  ExternalFunctionInternals *i_ptr;
+  void (*f_init_ptr)(int *);
+
+   /*
+    * Find the external function.
+    */
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      fprintf(stderr, "**ERROR: No external function of id %d was found.\n", *id_ptr);
+      return -1;
+   }
+   /* Check if this has already been done */
+   if (ef_ptr->already_have_internals)  {
+      return 0;
+   }
+   /* Check if this is an internal function */
+   if ( strcmp(ef_ptr->path,"internally_linked") == 0 )
+      internally_linked = TRUE;
+   else
+      internally_linked = FALSE;
+
+   /* Get a handle for the shared object if not internally linked */
+   if ( ! internally_linked ) {
+      strcat(tempText, ef_ptr->path);
+      strcat(tempText, ef_ptr->name);
+      strcat(tempText, ".so");
+
+      if ( (ef_ptr->handle = dlopen(tempText, RTLD_LAZY)) == NULL ) {
+         fprintf(stderr, "**ERROR in External Function %s:\n"
+                         "  Dynamic linking call dlopen() returns --\n"
+                         "  \"%s\".\n", ef_ptr->name, dlerror());
+         return -1;
+      }
+   }
+
+   /* Allocate and default initialize the internal information. */
+   if ( EF_New(ef_ptr) != 0 )
+      return -1;
+
+   /* Call the external function initialization routine */
+   i_ptr = ef_ptr->internals_ptr;
+
+   if ( i_ptr->language == EF_F ) {
+
+      /*
+       * Prepare for bailout possibilities by setting a signal handler for
+       * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+       * environment with sigsetjmp (for the signal handler) and setjmp 
+       * (for the "bail out" utility function).
+       */   
+      if ( EF_Util_setsig("efcn_gather_info")) {
+         return -1;
+      }
+
+      /* Set the signal return location and process jumps */
+      if ( sigsetjmp(sigjumpbuffer, 1) != 0 ) {
+         /* Must have come from bailing out */
+         return -1;
+      }
+      /* Set the bail out return location and process jumps */
+      if ( setjmp(jumpbuffer) != 0 ) {
+         /* Must have come from bailing out */
+         return -1;
+      }
+      canjump = 1;
+
+      /* Get the pointer to external function initialization routine */
+      sprintf(tempText, "%s_init_", ef_ptr->name);
+      if ( ! internally_linked ) {
+         f_init_ptr = (void (*)(int *))dlsym(ef_ptr->handle, tempText);
+      } else {
+         f_init_ptr = (void (*)(int *))internal_dlsym(tempText);
+      }
+      if ( f_init_ptr == NULL ) {
+         fprintf(stderr, "**ERROR in efcn_gather_info(): %s is not found.\n", tempText);
+         if ( ! internally_linked )
+            fprintf(stderr, "  dlerror: \"%s\"\n", dlerror());
+         EF_Util_ressig("efcn_gather_info");
+         return -1;
+      }
+
+      /*
+       * Call the initialization routine.  If it bails out,
+       * this will jump back to one of the setjmp methods, returning non-zero.
+       */
+      (*f_init_ptr)(id_ptr);
+      ef_ptr->already_have_internals = TRUE;
+
+      /* Restore the old signal handlers. */
+      if ( EF_Util_ressig("efcn_gather_info") ) {
+         return -1;
+      }
+
+   }
+   else {
+      /* Note: Python-backed external functions get initialized when added, so no support here for them */
+      fprintf(stderr, "**ERROR: unsupported language (%d) for efcn_gather_info.\n", i_ptr->language);
+      return -1;
+   }
+
+   return 0;
+}
+
+
+/*
+ * Find an external function based on its integer ID, 
+ * Query the function about custom axes. Store the context
+ * list information for use by utility functions.
+ */
+void FORTRAN(efcn_get_custom_axes)( int *id_ptr, int *cx_list_ptr, int *status )
+{
+  ExternalFunction *ef_ptr=NULL;
+  char tempText[EF_MAX_NAME_LENGTH]="";
+  int internally_linked = FALSE;
+
+  void (*fptr)(int *);
+
+  /*
+   * Initialize the status
+   */
+  *status = FERR_OK;
+
+  /*
+   * Store the context list globally.
+   */
+  EF_store_globals(NULL, NULL, cx_list_ptr, NULL, NULL);
+
+  /*
+   * Find the external function.
+   */
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  if ( (!strcmp(ef_ptr->path,"internally_linked")) ) {internally_linked = TRUE; }
+
+  if ( ef_ptr->internals_ptr->language == EF_F ) {
+
+    /*
+     * Prepare for bailout possibilities by setting a signal handler for
+     * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+     * environment with sigsetjmp (for the signal handler) and setjmp 
+     * (for the "bail out" utility function).
+     */   
+
+    if (EF_Util_setsig("efcn_get_custom_axes")) {
+      *status = FERR_EF_ERROR;
+       return;
+    }
+
+    /*
+     * Set the signal return location and process jumps
+     */
+    if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    /*
+     * Set the bail out return location and process jumps
+     */
+    if (setjmp(jumpbuffer) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    } 
+   
+    canjump = 1;
+
+    sprintf(tempText, "");
+    strcat(tempText, ef_ptr->name);
+    strcat(tempText, "_custom_axes_");
+
+    if (!internally_linked) {
+       fptr  = (void (*)(int *))dlsym(ef_ptr->handle, tempText);
+    } else {
+      fptr  = (void (*)(int *))internal_dlsym(tempText);
+    } 
+    (*fptr)( id_ptr );
+
+
+    /*
+     * Restore the old signal handlers.
+     */
+    if ( EF_Util_ressig("efcn_get_custom_axes")) {
+       return;
+    }
+
+    /* end of EF_F */
+  }
+  else if ( ef_ptr->internals_ptr->language == EF_PYTHON ) {
+      char errstring[2048];
+
+      /*
+       * Prepare for bailout possibilities by setting a signal handler for
+       * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+       * environment with sigsetjmp (for the signal handler) and setjmp 
+       * (for the "bail out" utility function).
+       */   
+      if ( EF_Util_setsig("efcn_get_custom_axes")) {
+          *status = FERR_EF_ERROR;
+           return;
+      }
+      if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      if (setjmp(jumpbuffer) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      canjump = 1;
+
+      /* Call pyefcn_custom_axes which in turn calls the ferret_custom_axes method in the python module */
+      pyefcn_custom_axes(*id_ptr, ef_ptr->path, errstring);
+      if ( strlen(errstring) > 0 ) {
+          /* (In effect) call ef_bail_out_ to process the error in a standard way */
+          ef_err_bail_out_(id_ptr, errstring);
+          /* Should never return - instead jumps to setjmp() returning 1 */
+      }
+
+      /* Restore the old signal handlers. */
+      EF_Util_ressig("efcn_get_custom_axes");
+
+      /* end of EF_PYTHON */
+  }
+  else {
+    *status = FERR_EF_ERROR;
+    fprintf(stderr, "**ERROR: unsupported language (%d) for efcn_get_custom_axes.\n", ef_ptr->internals_ptr->language);
+  }
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID, 
+ * Query the function about abstract axes. Pass memory,
+ * mr_list and cx_list info into the external function.
+ */
+void FORTRAN(efcn_get_result_limits)( int *id_ptr, DFTYPE *memory, int *mr_list_ptr, int *cx_list_ptr, int *status )
+{
+  ExternalFunction *ef_ptr=NULL;
+  char tempText[EF_MAX_NAME_LENGTH]="";
+  int internally_linked = FALSE;
+
+  void (*fptr)(int *);
+
+  /*
+   * Initialize the status
+   */
+  *status = FERR_OK;
+
+  /*
+   * Store the memory pointer and various lists globally.
+   */
+  EF_store_globals(memory, mr_list_ptr, cx_list_ptr, NULL, NULL);
+
+  /*
+   * Find the external function.
+   */
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  if ( (!strcmp(ef_ptr->path,"internally_linked")) ) {internally_linked = TRUE; }
+
+  if ( ef_ptr->internals_ptr->language == EF_F ) {
+
+    /*
+     * Prepare for bailout possibilities by setting a signal handler for
+     * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+     * environment with sigsetjmp (for the signal handler) and setjmp 
+     * (for the "bail out" utility function).
+     */   
+
+
+    if ( EF_Util_setsig("efcn_get_result_limits")) {
+      *status = FERR_EF_ERROR;
+       return;
+    }
+
+    /*
+     * Set the signal return location and process jumps
+     */
+    if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    /*
+     * Set the bail out return location and process jumps
+     */
+    if (setjmp(jumpbuffer) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    canjump = 1;
+
+
+    sprintf(tempText, "");
+    strcat(tempText, ef_ptr->name);
+    strcat(tempText, "_result_limits_");
+
+    if (!internally_linked) {
+      fptr  = (void (*)(int *))dlsym(ef_ptr->handle, tempText);
+    } else {
+      fptr  = (void (*)(int *))internal_dlsym(tempText);
+    }
+
+    (*fptr)( id_ptr);
+
+    /*
+     * Restore the old signal handlers.
+     */
+    if ( EF_Util_ressig("efcn_get_result_limits")) {
+       return;
+    }
+
+    /* end of EF_F */
+  }
+  else if ( ef_ptr->internals_ptr->language == EF_PYTHON ) {
+      char errstring[2048];
+
+      /*
+       * Prepare for bailout possibilities by setting a signal handler for
+       * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+       * environment with sigsetjmp (for the signal handler) and setjmp 
+       * (for the "bail out" utility function).
+       */   
+      if ( EF_Util_setsig("efcn_get_result_limits")) {
+          *status = FERR_EF_ERROR;
+           return;
+      }
+      if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      if (setjmp(jumpbuffer) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      canjump = 1;
+
+      /* Call pyefcn_result_limits which in turn calls the ferret_result_limits method in the python module */
+      pyefcn_result_limits(*id_ptr, ef_ptr->path, errstring);
+      if ( strlen(errstring) > 0 ) {
+          /* (In effect) call ef_bail_out_ to process the error in a standard way */
+          ef_err_bail_out_(id_ptr, errstring);
+          /* Should never return - instead jumps to setjmp() returning 1 */
+      }
+
+      /* Restore the old signal handlers. */
+      EF_Util_ressig("efcn_get_result_limits");
+
+      /* end of EF_PYTHON */
+  }
+  else {
+    *status = FERR_EF_ERROR;
+    fprintf(stderr, "**ERROR: unsupported language (%d) for efcn_get_result_limits.\n", ef_ptr->internals_ptr->language);
+  }
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID, 
+ * pass the necessary information and the data and tell
+ * the function to calculate the result.
+ */
+void FORTRAN(efcn_compute)( int *id_ptr, int *narg_ptr, int *cx_list_ptr, int *mr_list_ptr, int *mres_ptr,
+	DFTYPE *bad_flag_ptr, int *mr_arg_offset_ptr, DFTYPE *memory, int *status )
+{
+  ExternalFunction *ef_ptr=NULL;
+  ExternalFunctionInternals *i_ptr=NULL;
+  DFTYPE *arg_ptr[EF_MAX_COMPUTE_ARGS];
+  int xyzt=0, i=0, j=0;
+  int size=0;
+  char tempText[EF_MAX_NAME_LENGTH]="";
+  int internally_linked = FALSE;
+
+  /*
+   * Prototype all the functions needed for varying numbers of
+   * arguments and work arrays.
+   */
+
+  void (*fptr)(int *);
+  void (*f1arg)(int *, DFTYPE *, DFTYPE *);
+  void (*f2arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f3arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f4arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f5arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f6arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *);
+  void (*f7arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *);
+  void (*f8arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f9arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f10arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f11arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f12arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f13arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f14arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+        DFTYPE *);
+  void (*f15arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+        DFTYPE *, DFTYPE *);
+  void (*f16arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+        DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f17arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+        DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+  void (*f18arg)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+		DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+        DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *);
+
+  /*
+   * Initialize the status
+   */
+  *status = FERR_OK;
+
+  /*
+   * Store the array dimensions for memory resident variables and for working storage.
+   * Store the memory pointer and various lists globally.
+   */
+  FORTRAN(efcn_copy_array_dims)();
+  EF_store_globals(memory, mr_list_ptr, cx_list_ptr, mres_ptr, bad_flag_ptr);
+
+  /*
+   * Find the external function.
+   */
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) {
+    fprintf(stderr, "**ERROR in efcn_compute() finding external function: id = [%d]\n", *id_ptr);
+    *status = FERR_EF_ERROR;
+    return;
+  }
+  if ( (!strcmp(ef_ptr->path,"internally_linked")) ) {internally_linked = TRUE; }
+
+  i_ptr = ef_ptr->internals_ptr;
+
+  if ( i_ptr->language == EF_F ) {
+    /*
+     * Begin assigning the arg_ptrs.
+     */
+
+    /* First come the arguments to the function. */
+
+     for (i=0; i<i_ptr->num_reqd_args; i++) {
+       arg_ptr[i] = memory + mr_arg_offset_ptr[i];
+     }
+
+    /* Now for the result */
+
+     arg_ptr[i++] = memory + mr_arg_offset_ptr[EF_MAX_ARGS];
+
+    /* Now for the work arrays */
+
+    /*
+     * If this program has requested working storage we need to 
+     * ask the function to specify the amount of space needed
+     * and then create the memory here.  Memory will be released
+     * after the external function returns.
+     */
+    if (i_ptr->num_work_arrays > EF_MAX_WORK_ARRAYS) {
+
+	  fprintf(stderr, "**ERROR specifying number of work arrays in ~_init subroutine of external function %s\n"
+                          "\tnum_work_arrays[=%d] exceeds maximum[=%d].\n\n",
+                          ef_ptr->name, i_ptr->num_work_arrays, EF_MAX_WORK_ARRAYS);
+	  *status = FERR_EF_ERROR;
+	  return;
+
+    } else if (i_ptr->num_work_arrays < 0) {
+
+	  fprintf(stderr, "**ERROR specifying number of work arrays in ~_init subroutine of external function %s\n"
+                          "\tnum_work_arrays[=%d] must be a positive number.\n\n",
+                          ef_ptr->name, i_ptr->num_work_arrays);
+	  *status = FERR_EF_ERROR;
+	  return;
+
+    } else if (i_ptr->num_work_arrays > 0)  {
+
+      sprintf(tempText, "");
+      strcat(tempText, ef_ptr->name);
+      strcat(tempText, "_work_size_");
+
+      if (!internally_linked) {
+         fptr = (void (*)(int *))dlsym(ef_ptr->handle, tempText);
+      } else {
+         fptr  = (void (*)(int *))internal_dlsym(tempText);
+      }
+
+      if (fptr == NULL) {
+	fprintf(stderr, "**ERROR in efcn_compute() accessing %s\n", tempText);
+	*status = FERR_EF_ERROR;
+        return;
+      }
+      (*fptr)( id_ptr );
+
+
+	  /* Allocate memory for each individual work array */
+
+      for (j=0; j<i_ptr->num_work_arrays; i++, j++) {
+
+        int iarray, xlo, ylo, zlo, tlo, elo, flo,
+                    xhi, yhi, zhi, thi, ehi, fhi;
+        iarray = j+1;
+        xlo = i_ptr->work_array_lo[j][0];
+        ylo = i_ptr->work_array_lo[j][1];
+        zlo = i_ptr->work_array_lo[j][2];
+        tlo = i_ptr->work_array_lo[j][3];
+        elo = i_ptr->work_array_lo[j][4];
+        flo = i_ptr->work_array_lo[j][5];
+        xhi = i_ptr->work_array_hi[j][0];
+        yhi = i_ptr->work_array_hi[j][1];
+        zhi = i_ptr->work_array_hi[j][2];
+        thi = i_ptr->work_array_hi[j][3];
+        ehi = i_ptr->work_array_hi[j][4];
+        fhi = i_ptr->work_array_hi[j][5];
+
+        FORTRAN(efcn_set_work_array_dims)(&iarray, &xlo, &ylo, &zlo, &tlo, &elo, &flo,
+                                                   &xhi, &yhi, &zhi, &thi, &ehi, &fhi);
+
+        size = sizeof(DFTYPE) * (xhi-xlo+1) * (yhi-ylo+1) * (zhi-zlo+1) 
+                              * (thi-tlo+1) * (ehi-elo+1) * (fhi-flo+1);
+
+        arg_ptr[i] = (DFTYPE *)malloc(size);
+        if ( arg_ptr[i] == NULL ) { 
+          fprintf(stderr, "**ERROR in efcn_compute() allocating %d bytes of memory\n"
+                          "\twork array %d:  X=%d:%d, Y=%d:%d, Z=%d:%d, T=%d:%d, E=%d:%d, F=%d:%d\n", 
+                          size, iarray, xlo, xhi, ylo, yhi, zlo, zhi, tlo, thi, elo, ehi, flo, fhi);
+	  *status = FERR_EF_ERROR;
+	  return;
+        }
+      }
+
+    }
+
+    /*
+     * Copy the contents of Ferret's internal copy of the common block
+     * FERRET_EF_MEM_SUBSC to the external copy of this same common
+     * block using load_ferret_ef_mem_subsc_ in libferret_ef_mem_subsc.so
+     * Because libferret_ef_mem_subsc.so was loaded with RTLD_GLOBAL,
+     * this external copy of the common block will be seen by other
+     * Ferret Fotran external functions in shared-object libraries.
+     */
+    (*copy_ferret_ef_mem_subsc_ptr)();
+
+    /*
+     * Prepare for bailout possibilities by setting a signal handler for
+     * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+     * environment with sigsetjmp (for the signal handler) and setjmp 
+     * (for the "bail out" utility function).
+     */   
+
+    if ( EF_Util_setsig("efcn_compute")) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    /*
+     * Set the signal return location and process jumps
+     */
+    if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    /*
+     * Set the bail out return location and process jumps
+     */
+    if (setjmp(jumpbuffer) != 0) {
+      *status = FERR_EF_ERROR;
+      return;
+    }
+
+    canjump = 1;
+
+
+    /*
+     * Now go ahead and call the external function's "_compute_" function,
+     * prototyping it for the number of arguments expected.
+     */
+    sprintf(tempText, "");
+    strcat(tempText, ef_ptr->name);
+    strcat(tempText, "_compute_");
+
+    switch ( i_ptr->num_reqd_args + i_ptr->num_work_arrays ) {
+
+    case 1:
+	  if (!internally_linked) {
+            f1arg  = (void (*)(int *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f1arg  = (void (*)(int *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f1arg)( id_ptr, arg_ptr[0], arg_ptr[1] );
+	break;
+
+
+    case 2:
+	  if (!internally_linked) {
+            f2arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+            f2arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f2arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2] );
+	break;
+
+
+    case 3:
+	  if (!internally_linked) {
+	     f3arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+              dlsym(ef_ptr->handle, tempText);
+          } else {
+	     f3arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+              internal_dlsym(tempText);
+          }
+	  (*f3arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3] );
+	break;
+
+
+    case 4:
+	  if (!internally_linked) {
+            f4arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+            f4arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f4arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4] );
+	break;
+
+
+    case 5:
+	  if (!internally_linked) {
+	    f5arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+             DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f5arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, 
+             DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f5arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5] );
+	break;
+
+
+    case 6:
+	  if (!internally_linked) {
+	    f6arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f6arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f6arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6] );
+	break;
+
+
+    case 7:
+	  if (!internally_linked) {
+	    f7arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f7arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f7arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7] );
+	break;
+
+
+    case 8:
+	  if (!internally_linked) {
+	    f8arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f8arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f8arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8] );
+	break;
+
+
+    case 9:
+	  if (!internally_linked) {
+            f9arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+            f9arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f9arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9] );
+	break;
+
+
+    case 10:
+	  if (!internally_linked) {
+	    f10arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f10arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f10arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10] );
+	break;
+
+
+    case 11:
+	  if (!internally_linked) {
+            f11arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+            f11arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f11arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11] );
+	break;
+
+
+    case 12:
+	  if (!internally_linked) {
+	    f12arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f12arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f12arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12] );
+	break;
+
+
+    case 13:
+	  if (!internally_linked) {
+	    f13arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f13arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))
+             internal_dlsym(tempText);
+          }
+	  (*f13arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13] );
+	break;
+
+
+    case 14:
+	  if (!internally_linked) {
+	    f14arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f14arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f14arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13], arg_ptr[14] );
+	break;
+
+
+    case 15:
+	  if (!internally_linked) {
+	   f15arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+            DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+            DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	   f15arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+            DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+            DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f15arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13], arg_ptr[14], arg_ptr[15] );
+	break;
+
+
+    case 16:
+	  if (!internally_linked) {
+	    f16arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f16arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f16arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13], arg_ptr[14], arg_ptr[15], arg_ptr[16] );
+	break;
+
+
+    case 17:
+	  if (!internally_linked) {
+            f17arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+            f17arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f17arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13], arg_ptr[14], arg_ptr[15], arg_ptr[16],
+        arg_ptr[17] );
+	break;
+
+
+    case 18:
+	  if (!internally_linked) {
+	    f18arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))dlsym(ef_ptr->handle, tempText);
+          } else {
+	    f18arg  = (void (*)(int *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *,
+             DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *, DFTYPE *))internal_dlsym(tempText);
+          }
+	  (*f18arg)( id_ptr, arg_ptr[0], arg_ptr[1], arg_ptr[2], arg_ptr[3], arg_ptr[4],
+        arg_ptr[5], arg_ptr[6], arg_ptr[7], arg_ptr[8], arg_ptr[9], arg_ptr[10],
+        arg_ptr[11], arg_ptr[12], arg_ptr[13], arg_ptr[14], arg_ptr[15], arg_ptr[16],
+        arg_ptr[17], arg_ptr[18] );
+	break;
+
+
+    default:
+      fprintf(stderr, "**ERROR: External functions with more than %d arguments are not implemented.\n",
+                      EF_MAX_ARGS);
+      *status = FERR_EF_ERROR;
+      return;
+      break;
+
+    }
+
+    /*
+     * Restore the old signal handlers.
+     */
+    if ( EF_Util_ressig("efcn_compute")) {
+       *status = FERR_EF_ERROR;
+       return;
+    }
+
+    /*
+     * Now it's time to release the work space.
+     * With arg_ptr[0] for argument #1, and remembering one slot for the result,
+     * we should begin freeing up memory at arg_ptr[num_reqd_args+1].
+     */
+    for (i=i_ptr->num_reqd_args+1; i<i_ptr->num_reqd_args+1+i_ptr->num_work_arrays; i++) {
+      free(arg_ptr[i]);
+    }
+
+    /* Success for EF_F */
+  }
+  else if ( i_ptr->language == EF_PYTHON ) {
+      int   memlo[EF_MAX_COMPUTE_ARGS][NFERDIMS], memhi[EF_MAX_COMPUTE_ARGS][NFERDIMS],
+            steplo[EF_MAX_COMPUTE_ARGS][NFERDIMS], stephi[EF_MAX_COMPUTE_ARGS][NFERDIMS],
+            incr[EF_MAX_COMPUTE_ARGS][NFERDIMS];
+      DFTYPE badflags[EF_MAX_COMPUTE_ARGS];
+      char  errstring[2048];
+
+      /* First the results grid array, then the argument grid arrays */
+      arg_ptr[0] = memory + mr_arg_offset_ptr[EF_MAX_ARGS];
+      for (i = 0; i < i_ptr->num_reqd_args; i++) {
+          arg_ptr[i+1] = memory + mr_arg_offset_ptr[i];
+      }
+
+      /* Assign the memory limits, step values, and bad-data-flag values - first result, then arguments */
+      ef_get_res_mem_subscripts_6d_(id_ptr, memlo[0], memhi[0]);
+      ef_get_arg_mem_subscripts_6d_(id_ptr, &(memlo[1]), &(memhi[1]));
+      ef_get_res_subscripts_6d_(id_ptr, steplo[0], stephi[0], incr[0]);
+      ef_get_arg_subscripts_6d_(id_ptr, &(steplo[1]), &(stephi[1]), &(incr[1]));
+      ef_get_bad_flags_(id_ptr, &(badflags[1]), &(badflags[0]));
+
+      /* Reset zero increments to +1 or -1 for pyefcn_compute */
+      for (i = 0; i <= i_ptr->num_reqd_args; i++) {
+          for (j = 0; j < NFERDIMS; j++) {
+              if ( incr[i][j] == 0 ) {
+                  if ( steplo[i][j] <= stephi[i][j] )
+                      incr[i][j] = 1;
+                  else
+                      incr[i][j] = -1;
+              }
+          }
+      }
+
+      /*
+       * Prepare for bailout possibilities by setting a signal handler for
+       * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+       * environment with sigsetjmp (for the signal handler) and setjmp 
+       * (for the "bail out" utility function).
+       */   
+      if ( EF_Util_setsig("efcn_compute")) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      if (sigsetjmp(sigjumpbuffer, 1) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      if (setjmp(jumpbuffer) != 0) {
+          *status = FERR_EF_ERROR;
+          return;
+      }
+      canjump = 1;
+
+      /* Call pyefcn_compute which in turn calls the ferret_compute method in the python module */
+      pyefcn_compute(*id_ptr, ef_ptr->path, arg_ptr, (i_ptr->num_reqd_args)+1, memlo, memhi, steplo, stephi, incr, badflags, errstring);
+      if ( strlen(errstring) > 0 ) {
+          /* (In effect) call ef_bail_out_ to process the error in a standard way */
+          ef_err_bail_out_(id_ptr, errstring);
+          /* Should never return - instead jumps to setjmp() returning 1 */
+      }
+
+      /* Restore the original signal handlers */
+      EF_Util_ressig("efcn_compute");
+
+      /* Success for EF_PYTHON */
+  }
+  else {
+    fprintf(stderr, "**ERROR: unsupported language (%d) for efcn_compute.\n", i_ptr->language);
+    *status = FERR_EF_ERROR;
+  }
+
+  return;
+}
+
+
+/*
+ * A signal handler for SIGFPE, SIGSEGV, SIGINT and SIGBUS signals generated
+ * while executing an external function.  See "Advanced Programming
+ * in the UNIX Environment" p. 299 ff for details.
+ *
+ * This routine should never return since a signal was raised indicating a
+ * problem.  The siglongjump rewinds back to where sigsetjmp was called with
+ * the current sigjumpbuffer.
+ */
+static void EF_signal_handler(int signo)
+{
+   if ( canjump == 0 ) {
+      fprintf(stderr, "EF_signal_handler invoked with signal %d but canjump = 0", signo);
+      fflush(stderr);
+      abort();
+   }
+
+   /*
+    * Restore the old signal handlers.
+    */
+   if ( EF_Util_ressig("efcn_compute")) {
+      /* error message already printed */
+      fflush(stderr);
+      abort();
+   }
+
+   if (signo == SIGFPE) {
+      fprintf(stderr, "**ERROR in external function: Floating Point Error\n");
+      canjump = 0;
+      siglongjmp(sigjumpbuffer, 1);
+   } else if (signo == SIGSEGV) {
+      fprintf(stderr, "**ERROR in external function: Segmentation Violation\n");
+      canjump = 0;
+      siglongjmp(sigjumpbuffer, 1);
+   } else if (signo == SIGINT) {
+      fprintf(stderr, "**External function halted with Control-C\n");
+      canjump = 0;
+      siglongjmp(sigjumpbuffer, 1);
+   } else if (signo == SIGBUS) {
+      fprintf(stderr, "**ERROR in external function: Hardware Fault\n");
+      canjump = 0;
+      siglongjmp(sigjumpbuffer, 1);
+   } else {
+      fprintf(stderr, "**ERROR in external function: signo = %d\n", signo);
+      canjump = 0;
+      siglongjmp(sigjumpbuffer, 1);
+   }
+
+}
+
+
+/*
+ * Find an external function based on its name and
+ * return the integer ID associated with that funciton.
+ */
+int FORTRAN(efcn_get_id)( char name[] )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int status=LIST_OK;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+  /*
+   * Find the external function.
+   */
+
+  status = list_traverse(STATIC_ExternalFunctionList, name, EF_ListTraverse_FoundName,
+                         (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  /*
+   * If the search failed, set the id_ptr to ATOM_NOT_FOUND.
+   */
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+
+  ef_ptr=(ExternalFunction *)list_curr(STATIC_ExternalFunctionList); 
+
+  return_val = ef_ptr->id;
+
+  return return_val;
+}
+
+
+/*
+ * Determine whether a function name matches a template.
+ * Return 1 if the name matchs.
+ */
+int FORTRAN(efcn_match_template)( int *id_ptr, char template[] )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int status=LIST_OK;
+  int EF_LT_MT_return;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return return_val; }
+
+  EF_LT_MT_return = EF_ListTraverse_MatchTemplate((char *)template, (char *)ef_ptr);
+  
+  /* The list package forces 'list traversal' functions to return
+   * 0 whenever a match is found.  We want to return a more reasonable
+   * 1 (=true) if we find a match.
+   */
+  if ( EF_LT_MT_return == FALSE ) {
+	return_val = 1;
+  } else {
+    return_val = 0;
+  }
+
+  return return_val;
+}
+
+
+/*
+ */
+void FORTRAN(efcn_get_custom_axis_sub)( int *id_ptr, int *axis_ptr, double *lo_ptr, double *hi_ptr, 
+			       double *del_ptr, char *unit, int *modulo_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  /*
+   * Find the external function.
+   */
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  strcpy(unit, ef_ptr->internals_ptr->axis[*axis_ptr-1].unit);
+  *lo_ptr = ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_lo;
+  *hi_ptr = ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_hi;
+  *del_ptr = ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_del;
+  *modulo_ptr = ef_ptr->internals_ptr->axis[*axis_ptr-1].modulo;
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the name.
+ */
+void FORTRAN(efcn_get_name)( int *id_ptr, char *name )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  strcpy(name, ef_ptr->name);
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the version number.
+ */
+void FORTRAN(efcn_get_version)( int *id_ptr, DFTYPE *version )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  *version = ef_ptr->internals_ptr->version;
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the description.
+ */
+void FORTRAN(efcn_get_descr)( int *id_ptr, char *descr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  strcpy(descr, ef_ptr->internals_ptr->description);
+
+  return;
+}
+
+/*
+ * Find an external function based on its integer ID and
+ * return the name of an alternate function that operates 
+ * with string arguments.
+ *
+ * *kms* 2/11 - assign blank-terminated (not null-terminated)
+ * string since code using this name expects this style.
+ * Assumes alt_str_name has been intialized to all-blank.
+ */
+void FORTRAN(efcn_get_alt_type_fcn)( int *id_ptr, char *alt_str_name )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  strcpy(alt_str_name, ef_ptr->internals_ptr->alt_fcn_name);
+  alt_str_name[strlen(alt_str_name)] = ' ';
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the number of arguments.
+ */
+int FORTRAN(efcn_get_num_reqd_args)( int *id_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return return_val; }
+
+  return_val = ef_ptr->internals_ptr->num_reqd_args;
+
+  return return_val;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the flag stating whether the function has
+ * a variable number of arguments.
+ */
+void FORTRAN(efcn_get_has_vari_args)( int *id_ptr, int *has_vari_args_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  *has_vari_args_ptr = ef_ptr->internals_ptr->has_vari_args;
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the axis sources (merged, normal, abstract, custom).
+ */
+void FORTRAN(efcn_get_axis_will_be)( int *id_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->axis_will_be[X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->axis_will_be[Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->axis_will_be[Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->axis_will_be[T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->axis_will_be[E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->axis_will_be[F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the axis_reduction (retained, reduced) information.
+ */
+void FORTRAN(efcn_get_axis_reduction)( int *id_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->axis_reduction[X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->axis_reduction[Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->axis_reduction[Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->axis_reduction[T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->axis_reduction[E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->axis_reduction[F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the piecemeal_ok information.  This lets Ferret
+ * know if it's ok to break up a calculation along an axis
+ * for memory management reasons.
+ */
+void FORTRAN(efcn_get_piecemeal_ok)( int *id_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->piecemeal_ok[F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the (boolean) 'axis_implied_from' information for
+ * a particular argument to find out if its axes should
+ * be merged in to the result grid.
+ */
+void FORTRAN(efcn_get_axis_implied_from)( int *id_ptr, int *iarg_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->axis_implied_from[index][F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'arg_extend_lo' information for a particular
+ * argument which tells Ferret how much to extend axis limits
+ * when providing input data (e.g. to compute a derivative).
+ */
+void FORTRAN(efcn_get_axis_extend_lo)( int *id_ptr, int *iarg_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->axis_extend_lo[index][F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'arg_extend_hi' information for a particular
+ * argument which tells Ferret how much to extend axis limits
+ * when providing input data (e.g. to compute a derivative).
+ */
+void FORTRAN(efcn_get_axis_extend_hi)( int *id_ptr, int *iarg_ptr, int *array_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  
+  array_ptr[X_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][X_AXIS];
+  array_ptr[Y_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][Y_AXIS];
+  array_ptr[Z_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][Z_AXIS];
+  array_ptr[T_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][T_AXIS];
+  array_ptr[E_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][E_AXIS];
+  array_ptr[F_AXIS] = ef_ptr->internals_ptr->axis_extend_hi[index][F_AXIS];
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'axis_limits' information for a particular
+ * argument.
+ */
+void FORTRAN(efcn_get_axis_limits)( int *id_ptr, int *axis_ptr, int *lo_ptr, int *hi_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *axis_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  
+  *lo_ptr = ef_ptr->internals_ptr->axis[index].ss_lo;
+  *hi_ptr = ef_ptr->internals_ptr->axis[index].ss_hi;
+  
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'arg_type' information for a particular
+ * argument which tells Ferret whether an argument is a 
+ * DFTYPE or a string.
+ */
+int FORTRAN(efcn_get_arg_type)( int *id_ptr, int *iarg_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int return_val=0;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return return_val; }
+  
+  return_val = ef_ptr->internals_ptr->arg_type[index];
+  
+  return return_val;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'rtn_type' information for the result which
+ * tells Ferret whether an argument is a DFTYPE or a string.
+ */
+int FORTRAN(efcn_get_rtn_type)( int *id_ptr )
+{
+  ExternalFunction *ef_ptr=NULL;
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return return_val; }
+  
+  return_val = ef_ptr->internals_ptr->return_type;
+  
+  return return_val;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the name of a particular argument.
+ */
+void FORTRAN(efcn_get_arg_name)( int *id_ptr, int *iarg_ptr, char *string )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+  int i=0, printable=FALSE;
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  
+  /*
+   * JC_NOTE: if the argument has no name then memory gets overwritten, corrupting
+   * the address of iarg_ptr and causing a core dump.  I need to catch that case
+   * here.
+   */
+
+  for (i=0;i<strlen(ef_ptr->internals_ptr->arg_name[index]);i++) {
+    if (isgraph(ef_ptr->internals_ptr->arg_name[index][i])) {
+      printable = TRUE;
+      break;
+    }
+  }
+
+  if ( printable ) {
+    strcpy(string, ef_ptr->internals_ptr->arg_name[index]);
+  } else {
+    strcpy(string, "--");
+  }
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the units for a particular argument.
+ */
+void FORTRAN(efcn_get_arg_unit)( int *id_ptr, int *iarg_ptr, char *string )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  
+  ef_ptr=(ExternalFunction *)list_curr(STATIC_ExternalFunctionList); 
+  
+  strcpy(string, ef_ptr->internals_ptr->arg_unit[index]);
+
+  return;
+}
+
+
+/*
+ * Find an external function based on its integer ID and
+ * return the description of a particular argument.
+ */
+void FORTRAN(efcn_get_arg_desc)( int *id_ptr, int *iarg_ptr, char *string )
+{
+  ExternalFunction *ef_ptr=NULL;
+  int index = *iarg_ptr - 1; /* C indices are 1 less than Fortran */ 
+
+  if ( (ef_ptr = ef_ptr_from_id_ptr(id_ptr)) == NULL ) { return; }
+  
+  strcpy(string, ef_ptr->internals_ptr->arg_desc[index]);
+
+  return;
+}
+
+
+
+/*
+ * This function should never return since there was a user-detected
+ * error of some sort.  The call to longjump rewinds back to where
+ * setjmp was called with the current jumpbuffer.
+ */
+void FORTRAN(ef_err_bail_out)(int *id_ptr, char *text)
+{
+   ExternalFunction *ef_ptr=NULL;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      fprintf(stderr, "Unknown external function ID of %d in ef_err_bail_out", *id_ptr);
+      fflush(stderr);
+      abort();
+   }
+   if ( canjump == 0 ) {
+      fputs("ef_err_bail_out called with canjump = 0", stderr);
+      fflush(stderr);
+      abort();
+   }
+   /*
+    * Restore the old signal handlers.
+    */
+   if ( EF_Util_ressig("efcn_compute")) {
+      /* error message already printed */
+      fflush(stderr);
+      abort();
+   }
+
+   fprintf(stderr, "\n"
+                   "Bailing out of external function \"%s\":\n"
+                   "\t%s\n", ef_ptr->name, text);
+
+   longjmp(jumpbuffer, 1);
+}
+
+
+
+/* .... Object Oriented Utility Functions .... */
+
+
+/*
+ * Allocate space for and initialize the internal
+ * information for an EF.
+ *
+ * Return values:
+ *     -1: error allocating space
+ *      0: success
+ */
+int EF_New( ExternalFunction *this )
+{
+  ExternalFunctionInternals *i_ptr=NULL;
+  int status=LIST_OK, i=0, j=0;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+
+  /*
+   * Allocate space for the internals.
+   * If the allocation failed, print a warning message and return.
+   */
+
+  this->internals_ptr = malloc(sizeof(ExternalFunctionInternals));
+  i_ptr = this->internals_ptr;
+
+  if ( i_ptr == NULL ) {
+    fprintf(stderr, "**ERROR in EF_New(): cannot allocate ExternalFunctionInternals.\n");
+    return_val = -1;
+    return return_val;
+  }
+
+
+  /*
+   * Initialize the internals.
+   */
+
+  /* Information about the overall function */
+
+  i_ptr->version = EF_VERSION;
+  strcpy(i_ptr->description, "");
+  i_ptr->language = EF_F;
+  i_ptr->num_reqd_args = 1;
+  i_ptr->has_vari_args = NO;
+  i_ptr->num_work_arrays = 0;
+  i_ptr->return_type = FLOAT_RETURN;
+  for (i=0; i<NFERDIMS; i++) {
+    for (j=0; j<EF_MAX_WORK_ARRAYS; j++) {
+      i_ptr->work_array_lo[j][i] = 1;
+      i_ptr->work_array_hi[j][i] = 1;
+    }
+    i_ptr->axis_will_be[i] = IMPLIED_BY_ARGS;
+    i_ptr->axis_reduction[i] = RETAINED;
+    i_ptr->piecemeal_ok[i] = NO;
+  }
+
+  /* Information specific to each argument of the function */
+
+  for (i=0; i<EF_MAX_ARGS; i++) {
+    for (j=0; j<NFERDIMS; j++) {
+      i_ptr->axis_implied_from[i][j] = YES;
+      i_ptr->axis_extend_lo[i][j] = 0;
+      i_ptr->axis_extend_hi[i][j] = 0;
+    }
+    i_ptr->arg_type[i] = FLOAT_ARG;
+    strcpy(i_ptr->arg_name[i], "");
+    strcpy(i_ptr->arg_unit[i], "");
+    strcpy(i_ptr->arg_desc[i], "");
+  }
+
+  return return_val;
+
+}
+
+
+/* .... UtilityFunctions for dealing with STATIC_ExternalFunctionList .... */
+
+/*
+ * Store the global values which will be needed by utility routines
+ * in EF_ExternalUtil.c
+ */
+void EF_store_globals(DFTYPE *memory_ptr, int *mr_list_ptr, int *cx_list_ptr, 
+	int *mres_ptr, DFTYPE *bad_flag_ptr)
+{
+  int i=0;
+
+  GLOBAL_memory_ptr = memory_ptr;
+  GLOBAL_mr_list_ptr = mr_list_ptr;
+  GLOBAL_cx_list_ptr = cx_list_ptr;
+  GLOBAL_mres_ptr = mres_ptr;
+  GLOBAL_bad_flag_ptr = bad_flag_ptr;
+
+}
+
+
+/*
+ * Find an external function based on an integer id
+ * and return the pointer to the function.
+ * Returns NULL if it fails.
+ */
+ExternalFunction *ef_ptr_from_id_ptr(int *id_ptr)
+{
+   ExternalFunction *ef_ptr;
+   int status;
+
+   /* Check if the list has been created to avoid a seg fault if called indiscriminately */
+   if ( STATIC_ExternalFunctionList == NULL ) {
+      return NULL;
+   }
+
+   /* Search the list for the function ID */
+   status = list_traverse(STATIC_ExternalFunctionList, (char *) id_ptr, EF_ListTraverse_FoundID,
+                          (LIST_FRNT | LIST_FORW | LIST_ALTR));
+   if ( status != LIST_OK ) {
+      return NULL;
+   }
+
+   /* Get the pointer to the function from the list */
+   ef_ptr = (ExternalFunction *) list_curr(STATIC_ExternalFunctionList); 
+   return ef_ptr;
+}
+
+
+int EF_ListTraverse_fprintf( char *data, char *curr )
+{
+   FILE *File_ptr=(FILE *)data;
+   ExternalFunction *ef_ptr=(ExternalFunction *)curr; 
+
+   fprintf(stderr, "path = \"%s\", name = \"%s\", id = %d, internals_ptr = %ld\n",
+	   ef_ptr->path, ef_ptr->name, ef_ptr->id, (long) (ef_ptr->internals_ptr));
+
+   return TRUE;
+}
+ 
+
+/*
+ * Ferret always capitalizes everything so we'd better
+ * be case INsensitive.
+ */
+int EF_ListTraverse_FoundName( char *data, char *curr )
+{
+  ExternalFunction *ef_ptr=(ExternalFunction *)curr; 
+
+  if ( !strcasecmp(data, ef_ptr->name) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+
+int EF_ListTraverse_MatchTemplate( char data[], char *curr )
+{
+  ExternalFunction *ef_ptr=(ExternalFunction *)curr; 
+
+  int i=0, star_skip=FALSE;
+  char upname[EF_MAX_DESCRIPTION_LENGTH];
+  char *t, *n;
+
+  for (i=0; i<strlen(ef_ptr->name); i++) {
+    upname[i] = toupper(ef_ptr->name[i]);
+  }
+  upname[i] = '\0';
+
+  n = upname;
+
+  for (i=0, t=data; i<strlen(data); i++, t++) {
+
+    if ( *t == '*' ) {
+
+      star_skip = TRUE;
+      continue;
+
+    } else if ( *t == '?' ) {
+
+      if ( star_skip ) {
+	continue;
+      } else {
+	if ( ++n == '\0' ) /* end of name */
+	  return TRUE; /* no match */
+	else
+	  continue;
+      }
+
+    } else if ( star_skip ) {
+
+      if ( (n = strchr(n, *t)) == NULL ) { /* character not found in rest of name */
+	return TRUE; /* no match */
+      } else {
+	star_skip = FALSE;
+      }
+
+    } else if ( *n == '\0' ) /* end of name */
+      return TRUE; /* no match */
+
+    else if ( *t == *n ) {
+      n++;
+      continue;
+    }
+
+    else
+      return TRUE; /* no match */
+
+  } 
+
+  /* *sh* if any non-wildcard characters remain in the "curr" name, then reject
+     probably a bug remains for a regexp ending in "?" */
+  if ( *n == '\0' || star_skip )
+    return FALSE; /* got all the way through: a match */
+  else
+    return TRUE; /* characters remain--e.g. "xx5" does not math regexp "xx" */
+
+}
+
+
+int EF_ListTraverse_FoundID( char *data, char *curr )
+{
+  ExternalFunction *ef_ptr=(ExternalFunction *)curr; 
+  int ID=*((int *)data);
+
+  if ( ID == ef_ptr->id ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+
+int EF_Util_setsig(char fcn_name[])
+{
+    /*
+     * Prepare for bailout possibilities by setting a signal handler for
+     * SIGFPE, SIGSEGV, SIGINT and SIGBUS and then by cacheing the stack 
+     * environment with sigsetjmp (for the signal handler) and setjmp 
+     * (for the "bail out" utility function).
+     */   
+
+    if ( (fpe_handler = signal(SIGFPE, EF_signal_handler)) == SIG_ERR ) {
+      fprintf(stderr, "**ERROR in %s() catching SIGFPE.\n", fcn_name);
+      return 1;
+    }
+    if ( (segv_handler = signal(SIGSEGV, EF_signal_handler)) == SIG_ERR ) {
+      fprintf(stderr, "**ERROR in %s() catching SIGSEGV.\n", fcn_name);
+      return 1;
+    }
+    if ( (int_handler = signal(SIGINT, EF_signal_handler)) == SIG_ERR ) {
+      fprintf(stderr, "**ERROR in %s() catching SIGINT.\n", fcn_name);
+      return 1;
+    }
+    if ( (bus_handler = signal(SIGBUS, EF_signal_handler)) == SIG_ERR ) {
+      fprintf(stderr, "**ERROR in %s() catching SIGBUS.\n", fcn_name);
+      return 1;
+    }
+
+    /* the setjmp and sigsetjmp code moved to in-line 10/00 --
+     * longjump returns cannot be made reliably into a subroutine that may
+     *no longer be active on the stack
+     */
+
+    return 0;
+}
+
+
+int EF_Util_ressig(char fcn_name[])
+{
+    /*
+     * Restore the old signal handlers.
+     */
+    if (signal(SIGFPE, (*fpe_handler)) == SIG_ERR) {
+      fprintf(stderr, "**ERROR in %s() restoring default SIGFPE handler.\n", fcn_name);
+      return 1;
+    }
+    if (signal(SIGSEGV, (*segv_handler)) == SIG_ERR) {
+      fprintf(stderr, "**ERROR in %s() restoring default SIGSEGV handler.\n", fcn_name);
+      return 1;
+    }
+    if (signal(SIGINT, (*int_handler)) == SIG_ERR) {
+      fprintf(stderr, "**ERROR in %s() restoring default SIGINT handler.\n", fcn_name);
+      return 1;
+    }
+    if (signal(SIGBUS, (*bus_handler)) == SIG_ERR) {
+      fprintf(stderr, "**ERROR in %s() restoring default SIGBUS handler.\n", fcn_name);
+      return 1;
+    }
+    return 0;
+}
+
+
+/* 
+ *  ------------------------------------
+
+ *  internal_dlsym
+ *  Accept a string and return the function pointer 
+ *
+ *  The names of all subroutines of internally linked EF's
+ *  generated by the perl script int_dlsym.pl.  Check the
+ *  first if statement - change else if to if.
+ *
+ *   ACM 2-25-00 Solaris and OSF both have the trailing
+ *   underscore for statically-linked routines. */
+
+static void *internal_dlsym(char *name) {
+
+/* ffta.F */
+if ( !strcmp(name,"ffta_init_") ) return (void *)FORTRAN(ffta_init);
+else if ( !strcmp(name,"ffta_custom_axes_") ) return (void *)FORTRAN(ffta_custom_axes);
+else if ( !strcmp(name,"ffta_result_limits_") ) return (void *)FORTRAN(ffta_result_limits);
+else if ( !strcmp(name,"ffta_work_size_") ) return (void *)FORTRAN(ffta_work_size);
+else if ( !strcmp(name,"ffta_compute_") ) return (void *)FORTRAN(ffta_compute);
+
+/* fftp.F */
+else if ( !strcmp(name,"fftp_init_") ) return (void *)FORTRAN(fftp_init);
+else if ( !strcmp(name,"fftp_custom_axes_") ) return (void *)FORTRAN(fftp_custom_axes);
+else if ( !strcmp(name,"fftp_result_limits_") ) return (void *)FORTRAN(fftp_result_limits);
+else if ( !strcmp(name,"fftp_work_size_") ) return (void *)FORTRAN(fftp_work_size);
+else if ( !strcmp(name,"fftp_compute_") ) return (void *)FORTRAN(fftp_compute);
+
+/* fft_im.F */
+else if ( !strcmp(name,"fft_im_init_") ) return (void *)FORTRAN(fft_im_init);
+else if ( !strcmp(name,"fft_im_custom_axes_") ) return (void *)FORTRAN(fft_im_custom_axes);
+else if ( !strcmp(name,"fft_im_result_limits_") ) return (void *)FORTRAN(fft_im_result_limits);
+else if ( !strcmp(name,"fft_im_work_size_") ) return (void *)FORTRAN(fft_im_work_size);
+else if ( !strcmp(name,"fft_im_compute_") ) return (void *)FORTRAN(fft_im_compute);
+
+/* fft_inverse.F */
+else if ( !strcmp(name,"fft_inverse_init_") ) return (void *)FORTRAN(fft_inverse_init);
+else if ( !strcmp(name,"fft_inverse_result_limits_") ) return (void *)FORTRAN(fft_inverse_result_limits);
+else if ( !strcmp(name,"fft_inverse_work_size_") ) return (void *)FORTRAN(fft_inverse_work_size);
+else if ( !strcmp(name,"fft_inverse_compute_") ) return (void *)FORTRAN(fft_inverse_compute);
+
+/* fft_re.F */
+else if ( !strcmp(name,"fft_re_init_") ) return (void *)FORTRAN(fft_re_init);
+else if ( !strcmp(name,"fft_re_custom_axes_") ) return (void *)FORTRAN(fft_re_custom_axes);
+else if ( !strcmp(name,"fft_re_result_limits_") ) return (void *)FORTRAN(fft_re_result_limits);
+else if ( !strcmp(name,"fft_re_work_size_") ) return (void *)FORTRAN(fft_re_work_size);
+else if ( !strcmp(name,"fft_re_compute_") ) return (void *)FORTRAN(fft_re_compute);
+
+/* sampleij.F */
+else if ( !strcmp(name,"sampleij_init_") ) return (void *)FORTRAN(sampleij_init);
+else if ( !strcmp(name,"sampleij_result_limits_") ) return (void *)FORTRAN(sampleij_result_limits);
+else if ( !strcmp(name,"sampleij_work_size_") ) return (void *)FORTRAN(sampleij_work_size);
+else if ( !strcmp(name,"sampleij_compute_") ) return (void *)FORTRAN(sampleij_compute);
+
+
+/* samplei_multi.F */
+else if ( !strcmp(name,"samplei_multi_init_") ) return (void *)FORTRAN(samplei_multi_init);
+else if ( !strcmp(name,"samplei_multi_result_limits_") ) return (void *)FORTRAN(samplei_multi_result_limits);
+else if ( !strcmp(name,"samplei_multi_compute_") ) return (void *)FORTRAN(samplei_multi_compute);
+
+/* samplej_multi.F */
+else if ( !strcmp(name,"samplej_multi_init_") ) return (void *)FORTRAN(samplej_multi_init);
+else if ( !strcmp(name,"samplej_multi_result_limits_") ) return (void *)FORTRAN(samplej_multi_result_limits);
+else if ( !strcmp(name,"samplej_multi_compute_") ) return (void *)FORTRAN(samplej_multi_compute);
+
+/* samplek_multi.F */
+else if ( !strcmp(name,"samplek_multi_init_") ) return (void *)FORTRAN(samplek_multi_init);
+else if ( !strcmp(name,"samplek_multi_result_limits_") ) return (void *)FORTRAN(samplek_multi_result_limits);
+else if ( !strcmp(name,"samplek_multi_compute_") ) return (void *)FORTRAN(samplek_multi_compute);
+
+/* samplel_multi.F */
+else if ( !strcmp(name,"samplel_multi_init_") ) return (void *)FORTRAN(samplel_multi_init);
+else if ( !strcmp(name,"samplel_multi_result_limits_") ) return (void *)FORTRAN(samplel_multi_result_limits);
+else if ( !strcmp(name,"samplel_multi_compute_") ) return (void *)FORTRAN(samplel_multi_compute);
+
+/* samplet_date.F */
+else if ( !strcmp(name,"samplet_date_init_") ) return (void *)FORTRAN(samplet_date_init);
+else if ( !strcmp(name,"samplet_date_result_limits_") ) return (void *)FORTRAN(samplet_date_result_limits);
+else if ( !strcmp(name,"samplet_date_work_size_") ) return (void *)FORTRAN(samplet_date_work_size);
+else if ( !strcmp(name,"samplet_date_compute_") ) return (void *)FORTRAN(samplet_date_compute);
+
+/* samplexy.F */
+else if ( !strcmp(name,"samplexy_init_") ) return (void *)FORTRAN(samplexy_init);
+else if ( !strcmp(name,"samplexy_result_limits_") ) return (void *)FORTRAN(samplexy_result_limits);
+else if ( !strcmp(name,"samplexy_work_size_") ) return (void *)FORTRAN(samplexy_work_size);
+else if ( !strcmp(name,"samplexy_compute_") ) return (void *)FORTRAN(samplexy_compute);
+
+/* samplexyt.F */
+else if ( !strcmp(name,"samplexyt_init_") ) return (void *)FORTRAN(samplexyt_init);
+else if ( !strcmp(name,"samplexyt_result_limits_") ) return (void *)FORTRAN(samplexyt_result_limits);
+else if ( !strcmp(name,"samplexyt_work_size_") ) return (void *)FORTRAN(samplexyt_work_size);
+else if ( !strcmp(name,"samplexyt_compute_") ) return (void *)FORTRAN(samplexyt_compute);
+
+/* samplexyt_nrst.F */
+else if ( !strcmp(name,"samplexyt_nrst_init_") ) return (void *)FORTRAN(samplexyt_nrst_init);
+else if ( !strcmp(name,"samplexyt_nrst_result_limits_") ) return (void *)FORTRAN(samplexyt_nrst_result_limits);
+else if ( !strcmp(name,"samplexyt_nrst_work_size_") ) return (void *)FORTRAN(samplexyt_nrst_work_size);
+else if ( !strcmp(name,"samplexyt_nrst_compute_") ) return (void *)FORTRAN(samplexyt_nrst_compute);
+
+/* samplexy_curv.F */
+else if ( !strcmp(name,"samplexy_curv_init_") ) return (void *)FORTRAN(samplexy_curv_init);
+else if ( !strcmp(name,"samplexy_curv_result_limits_") ) return (void *)FORTRAN(samplexy_curv_result_limits);
+else if ( !strcmp(name,"samplexy_curv_work_size_") ) return (void *)FORTRAN(samplexy_curv_work_size);
+else if ( !strcmp(name,"samplexy_curv_compute_") ) return (void *)FORTRAN(samplexy_curv_compute);
+
+/* samplexy_curv_avg.F */
+else if ( !strcmp(name,"samplexy_curv_avg_init_") ) return (void *)FORTRAN(samplexy_curv_avg_init);
+else if ( !strcmp(name,"samplexy_curv_avg_result_limits_") ) return (void *)FORTRAN(samplexy_curv_avg_result_limits);
+else if ( !strcmp(name,"samplexy_curv_avg_work_size_") ) return (void *)FORTRAN(samplexy_curv_avg_work_size);
+else if ( !strcmp(name,"samplexy_curv_avg_compute_") ) return (void *)FORTRAN(samplexy_curv_avg_compute);
+
+/* samplexy_curv_nrst.F */
+else if ( !strcmp(name,"samplexy_curv_nrst_init_") ) return (void *)FORTRAN(samplexy_curv_nrst_init);
+else if ( !strcmp(name,"samplexy_curv_nrst_result_limits_") ) return (void *)FORTRAN(samplexy_curv_nrst_result_limits);
+else if ( !strcmp(name,"samplexy_curv_nrst_work_size_") ) return (void *)FORTRAN(samplexy_curv_nrst_work_size);
+else if ( !strcmp(name,"samplexy_curv_nrst_compute_") ) return (void *)FORTRAN(samplexy_curv_nrst_compute);
+
+/* samplexy_closest.F */
+else if ( !strcmp(name,"samplexy_closest_init_") ) return (void *)FORTRAN(samplexy_closest_init);
+else if ( !strcmp(name,"samplexy_closest_result_limits_") ) return (void *)FORTRAN(samplexy_closest_result_limits);
+else if ( !strcmp(name,"samplexy_closest_work_size_") ) return (void *)FORTRAN(samplexy_closest_work_size);
+else if ( !strcmp(name,"samplexy_closest_compute_") ) return (void *)FORTRAN(samplexy_closest_compute);
+
+/* samplexz.F */
+else if ( !strcmp(name,"samplexz_init_") ) return (void *)FORTRAN(samplexz_init);
+else if ( !strcmp(name,"samplexz_result_limits_") ) return (void *)FORTRAN(samplexz_result_limits);
+else if ( !strcmp(name,"samplexz_work_size_") ) return (void *)FORTRAN(samplexz_work_size);
+else if ( !strcmp(name,"samplexz_compute_") ) return (void *)FORTRAN(samplexz_compute);
+
+/* sampleyz.F */
+else if ( !strcmp(name,"sampleyz_init_") ) return (void *)FORTRAN(sampleyz_init);
+else if ( !strcmp(name,"sampleyz_result_limits_") ) return (void *)FORTRAN(sampleyz_result_limits);
+else if ( !strcmp(name,"sampleyz_work_size_") ) return (void *)FORTRAN(sampleyz_work_size);
+else if ( !strcmp(name,"sampleyz_compute_") ) return (void *)FORTRAN(sampleyz_compute);
+
+/* scat2grid_bin_xy.F */
+else if ( !strcmp(name,"scat2grid_bin_xy_init_") ) return (void *)FORTRAN(scat2grid_bin_xy_init);
+else if ( !strcmp(name,"scat2grid_bin_xy_work_size_") ) return (void *)FORTRAN(scat2grid_bin_xy_work_size);
+else if ( !strcmp(name,"scat2grid_bin_xy_compute_") ) return (void *)FORTRAN(scat2grid_bin_xy_compute);
+
+/* scat2grid_bin_xyt.F */
+else if ( !strcmp(name,"scat2grid_bin_xyt_init_") ) return (void *)FORTRAN(scat2grid_bin_xyt_init);
+else if ( !strcmp(name,"scat2grid_bin_xyt_work_size_") ) return (void *)FORTRAN(scat2grid_bin_xyt_work_size);
+else if ( !strcmp(name,"scat2grid_bin_xyt_compute_") ) return (void *)FORTRAN(scat2grid_bin_xyt_compute);
+
+/* scat2grid_nbin_xy.F */
+else if ( !strcmp(name,"scat2grid_nbin_xy_init_") ) return (void *)FORTRAN(scat2grid_nbin_xy_init);
+else if ( !strcmp(name,"scat2grid_nbin_xy_work_size_") ) return (void *)FORTRAN(scat2grid_nbin_xy_work_size);
+else if ( !strcmp(name,"scat2grid_nbin_xy_compute_") ) return (void *)FORTRAN(scat2grid_nbin_xy_compute);
+
+/* scat2grid_nbin_xyt.F */
+else if ( !strcmp(name,"scat2grid_nbin_xyt_init_") ) return (void *)FORTRAN(scat2grid_nbin_xyt_init);
+else if ( !strcmp(name,"scat2grid_nbin_xyt_work_size_") ) return (void *)FORTRAN(scat2grid_nbin_xyt_work_size);
+else if ( !strcmp(name,"scat2grid_nbin_xyt_compute_") ) return (void *)FORTRAN(scat2grid_nbin_xyt_compute);
+
+/* scat2gridgauss_xy.F */
+else if ( !strcmp(name,"scat2gridgauss_xy_init_") ) return (void *)FORTRAN(scat2gridgauss_xy_init);
+else if ( !strcmp(name,"scat2gridgauss_xy_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xy_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xy_compute_") ) return (void *)FORTRAN(scat2gridgauss_xy_compute);
+
+/* scat2gridgauss_xz.F */
+else if ( !strcmp(name,"scat2gridgauss_xz_init_") ) return (void *)FORTRAN(scat2gridgauss_xz_init);
+else if ( !strcmp(name,"scat2gridgauss_xz_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xz_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xz_compute_") ) return (void *)FORTRAN(scat2gridgauss_xz_compute);
+
+/* scat2gridgauss_yz.F */
+else if ( !strcmp(name,"scat2gridgauss_yz_init_") ) return (void *)FORTRAN(scat2gridgauss_yz_init);
+else if ( !strcmp(name,"scat2gridgauss_yz_work_size_") ) return (void *)FORTRAN(scat2gridgauss_yz_work_size);
+else if ( !strcmp(name,"scat2gridgauss_yz_compute_") ) return (void *)FORTRAN(scat2gridgauss_yz_compute);
+
+/* scat2gridgauss_xt.F */
+else if ( !strcmp(name,"scat2gridgauss_xt_init_") ) return (void *)FORTRAN(scat2gridgauss_xt_init);
+else if ( !strcmp(name,"scat2gridgauss_xt_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xt_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xt_compute_") ) return (void *)FORTRAN(scat2gridgauss_xt_compute);
+
+/* scat2gridgauss_yt.F */
+else if ( !strcmp(name,"scat2gridgauss_yt_init_") ) return (void *)FORTRAN(scat2gridgauss_yt_init);
+else if ( !strcmp(name,"scat2gridgauss_yt_work_size_") ) return (void *)FORTRAN(scat2gridgauss_yt_work_size);
+else if ( !strcmp(name,"scat2gridgauss_yt_compute_") ) return (void *)FORTRAN(scat2gridgauss_yt_compute);
+
+/* scat2gridgauss_zt.F */
+else if ( !strcmp(name,"scat2gridgauss_zt_init_") ) return (void *)FORTRAN(scat2gridgauss_zt_init);
+else if ( !strcmp(name,"scat2gridgauss_zt_work_size_") ) return (void *)FORTRAN(scat2gridgauss_zt_work_size);
+else if ( !strcmp(name,"scat2gridgauss_zt_compute_") ) return (void *)FORTRAN(scat2gridgauss_zt_compute);
+
+/* scat2gridgauss_xy_v0.F */
+else if ( !strcmp(name,"scat2gridgauss_xy_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_xy_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_xy_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xy_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xy_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_xy_v0_compute);
+
+/* scat2gridgauss_xz.F */
+else if ( !strcmp(name,"scat2gridgauss_xz_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_xz_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_xz_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xz_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xz_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_xz_v0_compute);
+
+/* scat2gridgauss_yz.F */
+else if ( !strcmp(name,"scat2gridgauss_yz_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_yz_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_yz_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_yz_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_yz_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_yz_v0_compute);
+
+/* scat2gridgauss_xt.F */
+else if ( !strcmp(name,"scat2gridgauss_xt_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_xt_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_xt_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_xt_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_xt_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_xt_v0_compute);
+
+/* scat2gridgauss_yt.F */
+else if ( !strcmp(name,"scat2gridgauss_yt_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_yt_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_yt_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_yt_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_yt_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_yt_v0_compute);
+
+/* scat2gridgauss_zt.F */
+else if ( !strcmp(name,"scat2gridgauss_zt_v0_init_") ) return (void *)FORTRAN(scat2gridgauss_zt_v0_init);
+else if ( !strcmp(name,"scat2gridgauss_zt_v0_work_size_") ) return (void *)FORTRAN(scat2gridgauss_zt_v0_work_size);
+else if ( !strcmp(name,"scat2gridgauss_zt_v0_compute_") ) return (void *)FORTRAN(scat2gridgauss_zt_v0_compute);
+
+/* scat2gridlaplace_xy.F */
+else if ( !strcmp(name,"scat2gridlaplace_xy_init_") ) return (void *)FORTRAN(scat2gridlaplace_xy_init);
+else if ( !strcmp(name,"scat2gridlaplace_xy_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_xy_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_xy_compute_") ) return (void *)FORTRAN(scat2gridlaplace_xy_compute);
+
+/* scat2gridlaplace_xz.F */
+else if ( !strcmp(name,"scat2gridlaplace_xz_init_") ) return (void *)FORTRAN(scat2gridlaplace_xz_init);
+else if ( !strcmp(name,"scat2gridlaplace_xz_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_xz_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_xz_compute_") ) return (void *)FORTRAN(scat2gridlaplace_xz_compute);
+
+/* scat2gridlaplace_yz.F */
+else if ( !strcmp(name,"scat2gridlaplace_yz_init_") ) return (void *)FORTRAN(scat2gridlaplace_yz_init);
+else if ( !strcmp(name,"scat2gridlaplace_yz_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_yz_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_yz_compute_") ) return (void *)FORTRAN(scat2gridlaplace_yz_compute);
+
+/* scat2gridlaplace_xt.F */
+else if ( !strcmp(name,"scat2gridlaplace_xt_init_") ) return (void *)FORTRAN(scat2gridlaplace_xt_init);
+else if ( !strcmp(name,"scat2gridlaplace_xt_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_xt_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_xt_compute_") ) return (void *)FORTRAN(scat2gridlaplace_xt_compute);
+
+/* scat2gridlaplace_yt.F */
+else if ( !strcmp(name,"scat2gridlaplace_yt_init_") ) return (void *)FORTRAN(scat2gridlaplace_yt_init);
+else if ( !strcmp(name,"scat2gridlaplace_yt_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_yt_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_yt_compute_") ) return (void *)FORTRAN(scat2gridlaplace_yt_compute);
+
+/* scat2gridlaplace_zt.F */
+else if ( !strcmp(name,"scat2gridlaplace_zt_init_") ) return (void *)FORTRAN(scat2gridlaplace_zt_init);
+else if ( !strcmp(name,"scat2gridlaplace_zt_work_size_") ) return (void *)FORTRAN(scat2gridlaplace_zt_work_size);
+else if ( !strcmp(name,"scat2gridlaplace_zt_compute_") ) return (void *)FORTRAN(scat2gridlaplace_zt_compute);
+
+/* scat2grid_nobs_xy.F */
+else if ( !strcmp(name,"scat2grid_nobs_xy_init_") ) return (void *)FORTRAN(scat2grid_nobs_xy_init);
+else if ( !strcmp(name,"scat2grid_nobs_xy_work_size_") ) return (void *)FORTRAN(scat2grid_nobs_xy_work_size);
+else if ( !strcmp(name,"scat2grid_nobs_xy_compute_") ) return (void *)FORTRAN(scat2grid_nobs_xy_compute);
+
+else if ( !strcmp(name,"scat2grid_nobs_xyt_init_") ) return (void *)FORTRAN(scat2grid_nobs_xyt_init);
+else if ( !strcmp(name,"scat2grid_nobs_xyt_work_size_") ) return (void *)FORTRAN(scat2grid_nobs_xyt_work_size);
+else if ( !strcmp(name,"scat2grid_nobs_xyt_compute_") ) return (void *)FORTRAN(scat2grid_nobs_xyt_compute);
+
+/* sorti.F */
+else if ( !strcmp(name,"sorti_init_") ) return (void *)FORTRAN(sorti_init);
+else if ( !strcmp(name,"sorti_result_limits_") ) return (void *)FORTRAN(sorti_result_limits);
+else if ( !strcmp(name,"sorti_work_size_") ) return (void *)FORTRAN(sorti_work_size);
+else if ( !strcmp(name,"sorti_compute_") ) return (void *)FORTRAN(sorti_compute);
+
+/* sorti_str.F */
+else if ( !strcmp(name,"sorti_str_init_") ) return (void *)FORTRAN(sorti_str_init);
+else if ( !strcmp(name,"sorti_str_result_limits_") ) return (void *)FORTRAN(sorti_str_result_limits);
+else if ( !strcmp(name,"sorti_str_work_size_") ) return (void *)FORTRAN(sorti_str_work_size);
+else if ( !strcmp(name,"sorti_str_compute_") ) return (void *)FORTRAN(sorti_str_compute);
+
+/* sortj.F */
+else if ( !strcmp(name,"sortj_init_") ) return (void *)FORTRAN(sortj_init);
+else if ( !strcmp(name,"sortj_result_limits_") ) return (void *)FORTRAN(sortj_result_limits);
+else if ( !strcmp(name,"sortj_work_size_") ) return (void *)FORTRAN(sortj_work_size);
+else if ( !strcmp(name,"sortj_compute_") ) return (void *)FORTRAN(sortj_compute);
+
+/* sortj_str.F */
+else if ( !strcmp(name,"sortj_str_init_") ) return (void *)FORTRAN(sortj_str_init);
+else if ( !strcmp(name,"sortj_str_result_limits_") ) return (void *)FORTRAN(sortj_str_result_limits);
+else if ( !strcmp(name,"sortj_str_work_size_") ) return (void *)FORTRAN(sortj_str_work_size);
+else if ( !strcmp(name,"sortj_str_compute_") ) return (void *)FORTRAN(sortj_str_compute);
+
+/* sortk.F */
+else if ( !strcmp(name,"sortk_init_") ) return (void *)FORTRAN(sortk_init);
+else if ( !strcmp(name,"sortk_result_limits_") ) return (void *)FORTRAN(sortk_result_limits);
+else if ( !strcmp(name,"sortk_work_size_") ) return (void *)FORTRAN(sortk_work_size);
+else if ( !strcmp(name,"sortk_compute_") ) return (void *)FORTRAN(sortk_compute);
+
+/* sortk_str.F */
+else if ( !strcmp(name,"sortk_str_init_") ) return (void *)FORTRAN(sortk_str_init);
+else if ( !strcmp(name,"sortk_str_result_limits_") ) return (void *)FORTRAN(sortk_str_result_limits);
+else if ( !strcmp(name,"sortk_str_work_size_") ) return (void *)FORTRAN(sortk_str_work_size);
+else if ( !strcmp(name,"sortk_str_compute_") ) return (void *)FORTRAN(sortk_str_compute);
+
+/* sortl.F */
+else if ( !strcmp(name,"sortl_init_") ) return (void *)FORTRAN(sortl_init);
+else if ( !strcmp(name,"sortl_result_limits_") ) return (void *)FORTRAN(sortl_result_limits);
+else if ( !strcmp(name,"sortl_work_size_") ) return (void *)FORTRAN(sortl_work_size);
+else if ( !strcmp(name,"sortl_compute_") ) return (void *)FORTRAN(sortl_compute);
+
+/* sortl_str.F */
+else if ( !strcmp(name,"sortl_str_init_") ) return (void *)FORTRAN(sortl_str_init);
+else if ( !strcmp(name,"sortl_str_result_limits_") ) return (void *)FORTRAN(sortl_str_result_limits);
+else if ( !strcmp(name,"sortl_str_work_size_") ) return (void *)FORTRAN(sortl_str_work_size);
+else if ( !strcmp(name,"sortl_str_compute_") ) return (void *)FORTRAN(sortl_str_compute);
+
+/* sortm.F */
+else if ( !strcmp(name,"sortm_init_") ) return (void *)FORTRAN(sortm_init);
+else if ( !strcmp(name,"sortm_result_limits_") ) return (void *)FORTRAN(sortm_result_limits);
+else if ( !strcmp(name,"sortm_work_size_") ) return (void *)FORTRAN(sortm_work_size);
+else if ( !strcmp(name,"sortm_compute_") ) return (void *)FORTRAN(sortm_compute);
+
+/* sortm_str.F */
+else if ( !strcmp(name,"sortm_str_init_") ) return (void *)FORTRAN(sortm_str_init);
+else if ( !strcmp(name,"sortm_str_result_limits_") ) return (void *)FORTRAN(sortm_str_result_limits);
+else if ( !strcmp(name,"sortm_str_work_size_") ) return (void *)FORTRAN(sortm_str_work_size);
+else if ( !strcmp(name,"sortm_str_compute_") ) return (void *)FORTRAN(sortm_str_compute);
+
+/* sortn.F */
+else if ( !strcmp(name,"sortn_init_") ) return (void *)FORTRAN(sortn_init);
+else if ( !strcmp(name,"sortn_result_limits_") ) return (void *)FORTRAN(sortn_result_limits);
+else if ( !strcmp(name,"sortn_work_size_") ) return (void *)FORTRAN(sortn_work_size);
+else if ( !strcmp(name,"sortn_compute_") ) return (void *)FORTRAN(sortn_compute);
+
+/* sortn_str.F */
+else if ( !strcmp(name,"sortn_str_init_") ) return (void *)FORTRAN(sortn_str_init);
+else if ( !strcmp(name,"sortn_str_result_limits_") ) return (void *)FORTRAN(sortn_str_result_limits);
+else if ( !strcmp(name,"sortn_str_work_size_") ) return (void *)FORTRAN(sortn_str_work_size);
+else if ( !strcmp(name,"sortn_str_compute_") ) return (void *)FORTRAN(sortn_str_compute);
+
+/* tauto_cor.F */
+else if ( !strcmp(name,"tauto_cor_init_") ) return (void *)FORTRAN(tauto_cor_init);
+else if ( !strcmp(name,"tauto_cor_result_limits_") ) return (void *)FORTRAN(tauto_cor_result_limits);
+else if ( !strcmp(name,"tauto_cor_work_size_") ) return (void *)FORTRAN(tauto_cor_work_size);
+else if ( !strcmp(name,"tauto_cor_compute_") ) return (void *)FORTRAN(tauto_cor_compute);
+
+/* xauto_cor.F */
+else if ( !strcmp(name,"xauto_cor_init_") ) return (void *)FORTRAN(xauto_cor_init);
+else if ( !strcmp(name,"xauto_cor_result_limits_") ) return (void *)FORTRAN(xauto_cor_result_limits);
+else if ( !strcmp(name,"xauto_cor_work_size_") ) return (void *)FORTRAN(xauto_cor_work_size);
+else if ( !strcmp(name,"xauto_cor_compute_") ) return (void *)FORTRAN(xauto_cor_compute);
+
+/* eof_space.F */
+else if ( !strcmp(name,"eof_space_init_") ) return (void *)FORTRAN(eof_space_init);
+else if ( !strcmp(name,"eof_space_result_limits_") ) return (void *)FORTRAN(eof_space_result_limits);
+else if ( !strcmp(name,"eof_space_work_size_") ) return (void *)FORTRAN(eof_space_work_size);
+else if ( !strcmp(name,"eof_space_compute_") ) return (void *)FORTRAN(eof_space_compute);
+
+/* eof_stat.F */
+else if ( !strcmp(name,"eof_stat_init_") ) return (void *)FORTRAN(eof_stat_init);
+else if ( !strcmp(name,"eof_stat_result_limits_") ) return (void *)FORTRAN(eof_stat_result_limits);
+else if ( !strcmp(name,"eof_stat_work_size_") ) return (void *)FORTRAN(eof_stat_work_size);
+else if ( !strcmp(name,"eof_stat_compute_") ) return (void *)FORTRAN(eof_stat_compute);
+
+/* eof_tfunc.F */
+else if ( !strcmp(name,"eof_tfunc_init_") ) return (void *)FORTRAN(eof_tfunc_init);
+else if ( !strcmp(name,"eof_tfunc_result_limits_") ) return (void *)FORTRAN(eof_tfunc_result_limits);
+else if ( !strcmp(name,"eof_tfunc_work_size_") ) return (void *)FORTRAN(eof_tfunc_work_size);
+else if ( !strcmp(name,"eof_tfunc_compute_") ) return (void *)FORTRAN(eof_tfunc_compute);
+
+/* eofsvd_space.F */
+else if ( !strcmp(name,"eofsvd_space_init_") ) return (void *)FORTRAN(eofsvd_space_init);
+else if ( !strcmp(name,"eofsvd_space_result_limits_") ) return (void *)FORTRAN(eofsvd_space_result_limits);
+else if ( !strcmp(name,"eofsvd_space_work_size_") ) return (void *)FORTRAN(eofsvd_space_work_size);
+else if ( !strcmp(name,"eofsvd_space_compute_") ) return (void *)FORTRAN(eofsvd_space_compute);
+
+/* eofsvd_stat.F */
+else if ( !strcmp(name,"eofsvd_stat_init_") ) return (void *)FORTRAN(eofsvd_stat_init);
+else if ( !strcmp(name,"eofsvd_stat_result_limits_") ) return (void *)FORTRAN(eofsvd_stat_result_limits);
+else if ( !strcmp(name,"eofsvd_stat_work_size_") ) return (void *)FORTRAN(eofsvd_stat_work_size);
+else if ( !strcmp(name,"eofsvd_stat_compute_") ) return (void *)FORTRAN(eofsvd_stat_compute);
+
+/* eofsvd_tfunc.F */
+else if ( !strcmp(name,"eofsvd_tfunc_init_") ) return (void *)FORTRAN(eofsvd_tfunc_init);
+else if ( !strcmp(name,"eofsvd_tfunc_result_limits_") ) return (void *)FORTRAN(eofsvd_tfunc_result_limits);
+else if ( !strcmp(name,"eofsvd_tfunc_work_size_") ) return (void *)FORTRAN(eofsvd_tfunc_work_size);
+else if ( !strcmp(name,"eofsvd_tfunc_compute_") ) return (void *)FORTRAN(eofsvd_tfunc_compute);
+
+/* compressi.F */
+else if ( !strcmp(name,"compressi_init_") ) return (void *)FORTRAN(compressi_init);
+else if ( !strcmp(name,"compressi_result_limits_") ) return (void *)FORTRAN(compressi_result_limits);
+else if ( !strcmp(name,"compressi_compute_") ) return (void *)FORTRAN(compressi_compute);
+
+/* compressj.F */
+else if ( !strcmp(name,"compressj_init_") ) return (void *)FORTRAN(compressj_init);
+else if ( !strcmp(name,"compressj_result_limits_") ) return (void *)FORTRAN(compressj_result_limits);
+else if ( !strcmp(name,"compressj_compute_") ) return (void *)FORTRAN(compressj_compute);
+
+/* compressk.F */
+else if ( !strcmp(name,"compressk_init_") ) return (void *)FORTRAN(compressk_init);
+else if ( !strcmp(name,"compressk_result_limits_") ) return (void *)FORTRAN(compressk_result_limits);
+else if ( !strcmp(name,"compressk_compute_") ) return (void *)FORTRAN(compressk_compute);
+
+/* compressl.F */
+else if ( !strcmp(name,"compressl_init_") ) return (void *)FORTRAN(compressl_init);
+else if ( !strcmp(name,"compressl_result_limits_") ) return (void *)FORTRAN(compressl_result_limits);
+else if ( !strcmp(name,"compressl_compute_") ) return (void *)FORTRAN(compressl_compute);
+
+/* compressm.F */
+else if ( !strcmp(name,"compressm_init_") ) return (void *)FORTRAN(compressm_init);
+else if ( !strcmp(name,"compressm_result_limits_") ) return (void *)FORTRAN(compressm_result_limits);
+else if ( !strcmp(name,"compressm_compute_") ) return (void *)FORTRAN(compressm_compute);
+
+/* compressn.F */
+else if ( !strcmp(name,"compressn_init_") ) return (void *)FORTRAN(compressn_init);
+else if ( !strcmp(name,"compressn_result_limits_") ) return (void *)FORTRAN(compressn_result_limits);
+else if ( !strcmp(name,"compressn_compute_") ) return (void *)FORTRAN(compressn_compute);
+
+/* compressi_by.F */
+else if ( !strcmp(name,"compressi_by_init_") ) return (void *)FORTRAN(compressi_by_init);
+else if ( !strcmp(name,"compressi_by_result_limits_") ) return (void *)FORTRAN(compressi_by_result_limits);
+else if ( !strcmp(name,"compressi_by_compute_") ) return (void *)FORTRAN(compressi_by_compute);
+
+/* compressj_by.F */
+else if ( !strcmp(name,"compressj_by_init_") ) return (void *)FORTRAN(compressj_by_init);
+else if ( !strcmp(name,"compressj_by_result_limits_") ) return (void *)FORTRAN(compressj_by_result_limits);
+else if ( !strcmp(name,"compressj_by_compute_") ) return (void *)FORTRAN(compressj_by_compute);
+
+/* compressk_by.F */
+else if ( !strcmp(name,"compressk_by_init_") ) return (void *)FORTRAN(compressk_by_init);
+else if ( !strcmp(name,"compressk_by_result_limits_") ) return (void *)FORTRAN(compressk_by_result_limits);
+else if ( !strcmp(name,"compressk_by_compute_") ) return (void *)FORTRAN(compressk_by_compute);
+
+/* compressl_by.F */
+else if ( !strcmp(name,"compressl_by_init_") ) return (void *)FORTRAN(compressl_by_init);
+else if ( !strcmp(name,"compressl_by_result_limits_") ) return (void *)FORTRAN(compressl_by_result_limits);
+else if ( !strcmp(name,"compressl_by_compute_") ) return (void *)FORTRAN(compressl_by_compute);
+
+/* compressm_by.F */
+else if ( !strcmp(name,"compressm_by_init_") ) return (void *)FORTRAN(compressm_by_init);
+else if ( !strcmp(name,"compressm_by_result_limits_") ) return (void *)FORTRAN(compressm_by_result_limits);
+else if ( !strcmp(name,"compressm_by_compute_") ) return (void *)FORTRAN(compressm_by_compute);
+
+/* compressn_by.F */
+else if ( !strcmp(name,"compressn_by_init_") ) return (void *)FORTRAN(compressn_by_init);
+else if ( !strcmp(name,"compressn_by_result_limits_") ) return (void *)FORTRAN(compressn_by_result_limits);
+else if ( !strcmp(name,"compressn_by_compute_") ) return (void *)FORTRAN(compressn_by_compute);
+
+/* labwid.F */
+else if ( !strcmp(name,"labwid_init_") ) return (void *)FORTRAN(labwid_init);
+else if ( !strcmp(name,"labwid_result_limits_") ) return (void *)FORTRAN(labwid_result_limits);
+else if ( !strcmp(name,"labwid_compute_") ) return (void *)FORTRAN(labwid_compute);
+
+/* convolvei.F */
+else if ( !strcmp(name,"convolvei_init_") ) return (void *)FORTRAN(convolvei_init);
+else if ( !strcmp(name,"convolvei_compute_") ) return (void *)FORTRAN(convolvei_compute);
+
+/* convolvej.F */
+else if ( !strcmp(name,"convolvej_init_") ) return (void *)FORTRAN(convolvej_init);
+else if ( !strcmp(name,"convolvej_compute_") ) return (void *)FORTRAN(convolvej_compute);
+
+/* convolvek.F */
+else if ( !strcmp(name,"convolvek_init_") ) return (void *)FORTRAN(convolvek_init);
+else if ( !strcmp(name,"convolvek_compute_") ) return (void *)FORTRAN(convolvek_compute);
+
+/* convolvel.F */
+else if ( !strcmp(name,"convolvel_init_") ) return (void *)FORTRAN(convolvel_init);
+else if ( !strcmp(name,"convolvel_compute_") ) return (void *)FORTRAN(convolvel_compute);
+
+/* convolvem.F */
+else if ( !strcmp(name,"convolvem_init_") ) return (void *)FORTRAN(convolvem_init);
+else if ( !strcmp(name,"convolvem_compute_") ) return (void *)FORTRAN(convolvem_compute);
+
+/* convolven.F */
+else if ( !strcmp(name,"convolven_init_") ) return (void *)FORTRAN(convolven_init);
+else if ( !strcmp(name,"convolven_compute_") ) return (void *)FORTRAN(convolven_compute);
+
+/* curv_range.F */
+else if ( !strcmp(name,"curv_range_init_") ) return (void *)FORTRAN(curv_range_init);
+else if ( !strcmp(name,"curv_range_result_limits_") ) return (void *)FORTRAN(curv_range_result_limits);
+else if ( !strcmp(name,"curv_range_compute_") ) return (void *)FORTRAN(curv_range_compute);
+
+/* curv_to_rect_map.F */
+else if ( !strcmp(name,"curv_to_rect_map_init_") ) return (void *)FORTRAN(curv_to_rect_map_init);
+else if ( !strcmp(name,"curv_to_rect_map_result_limits_") ) return (void *)FORTRAN(curv_to_rect_map_result_limits);
+else if ( !strcmp(name,"curv_to_rect_map_work_size_") ) return (void *)FORTRAN(curv_to_rect_map_work_size);
+else if ( !strcmp(name,"curv_to_rect_map_compute_") ) return (void *)FORTRAN(curv_to_rect_map_compute);
+
+/* curv_to_rect.F */
+else if ( !strcmp(name,"curv_to_rect_init_") ) return (void *)FORTRAN(curv_to_rect_init);
+else if ( !strcmp(name,"curv_to_rect_compute_") ) return (void *)FORTRAN(curv_to_rect_compute);
+
+/* rect_to_curv.F */
+else if ( !strcmp(name,"rect_to_curv_init_") ) return (void *)FORTRAN(rect_to_curv_init);
+else if ( !strcmp(name,"rect_to_curv_work_size_") ) return (void *)FORTRAN(rect_to_curv_work_size);
+else if ( !strcmp(name,"rect_to_curv_compute_") ) return (void *)FORTRAN(rect_to_curv_compute);
+
+/* date1900.F */
+else if ( !strcmp(name,"date1900_init_") ) return (void *)FORTRAN(date1900_init);
+else if ( !strcmp(name,"date1900_result_limits_") ) return (void *)FORTRAN(date1900_result_limits);
+else if ( !strcmp(name,"date1900_compute_") ) return (void *)FORTRAN(date1900_compute);
+
+/* days1900toymdhms.F */
+else if ( !strcmp(name,"days1900toymdhms_init_") ) return (void *)FORTRAN(days1900toymdhms_init);
+else if ( !strcmp(name,"days1900toymdhms_result_limits_") ) return (void *)FORTRAN(days1900toymdhms_result_limits);
+else if ( !strcmp(name,"days1900toymdhms_compute_") ) return (void *)FORTRAN(days1900toymdhms_compute);
+
+/* minutes24.F */
+else if ( !strcmp(name,"minutes24_init_") ) return (void *)FORTRAN(minutes24_init);
+else if ( !strcmp(name,"minutes24_result_limits_") ) return (void *)FORTRAN(minutes24_result_limits);
+else if ( !strcmp(name,"minutes24_compute_") ) return (void *)FORTRAN(minutes24_compute);
+
+/* element_index.F */
+else if ( !strcmp(name,"element_index_init_") ) return (void *)FORTRAN(element_index_init);
+else if ( !strcmp(name,"element_index_compute_") ) return (void *)FORTRAN(element_index_compute);
+
+/* element_index_str.F */
+else if ( !strcmp(name,"element_index_str_init_") ) return (void *)FORTRAN(element_index_str_init);
+else if ( !strcmp(name,"element_index_str_compute_") ) return (void *)FORTRAN(element_index_str_compute);
+
+/* element_index_str_n.F */
+else if ( !strcmp(name,"element_index_str_n_init_") ) return (void *)FORTRAN(element_index_str_n_init);
+else if ( !strcmp(name,"element_index_str_n_compute_") ) return (void *)FORTRAN(element_index_str_n_compute);
+
+/* expnd_by_len.F */
+else if ( !strcmp(name,"expnd_by_len_init_") ) return (void *)FORTRAN(expnd_by_len_init);
+else if ( !strcmp(name,"expnd_by_len_result_limits_") ) return (void *)FORTRAN(expnd_by_len_result_limits);
+else if ( !strcmp(name,"expnd_by_len_compute_") ) return (void *)FORTRAN(expnd_by_len_compute);
+
+/* expnd_by_len_str.F */
+else if ( !strcmp(name,"expnd_by_len_str_init_") ) return (void *)FORTRAN(expnd_by_len_str_init);
+else if ( !strcmp(name,"expnd_by_len_str_result_limits_") ) return (void *)FORTRAN(expnd_by_len_str_result_limits);
+else if ( !strcmp(name,"expnd_by_len_str_compute_") ) return (void *)FORTRAN(expnd_by_len_str_compute);
+
+/* expndi_by.F */
+else if ( !strcmp(name,"expndi_by_init_") ) return (void *)FORTRAN(expndi_by_init);
+else if ( !strcmp(name,"expndi_by_result_limits_") ) return (void *)FORTRAN(expndi_by_result_limits);
+else if ( !strcmp(name,"expndi_by_compute_") ) return (void *)FORTRAN(expndi_by_compute);
+
+/* expndi_by_t.F */
+else if ( !strcmp(name,"expndi_by_t_init_") ) return (void *)FORTRAN(expndi_by_t_init);
+else if ( !strcmp(name,"expndi_by_t_result_limits_") ) return (void *)FORTRAN(expndi_by_t_result_limits);
+else if ( !strcmp(name,"expndi_by_t_compute_") ) return (void *)FORTRAN(expndi_by_t_compute);
+
+/* expndi_by_z.F */
+else if ( !strcmp(name,"expndi_by_z_init_") ) return (void *)FORTRAN(expndi_by_z_init);
+else if ( !strcmp(name,"expndi_by_z_result_limits_") ) return (void *)FORTRAN(expndi_by_z_result_limits);
+else if ( !strcmp(name,"expndi_by_z_compute_") ) return (void *)FORTRAN(expndi_by_z_compute);
+
+/* expndi_by_z_counts.F */
+else if ( !strcmp(name,"expndi_by_z_counts_init_") ) return (void *)FORTRAN(expndi_by_z_counts_init);
+else if ( !strcmp(name,"expndi_by_z_counts_result_limits_") ) return (void *)FORTRAN(expndi_by_z_counts_result_limits);
+else if ( !strcmp(name,"expndi_by_z_counts_compute_") ) return (void *)FORTRAN(expndi_by_z_counts_compute);
+
+/* expndi_id_by_z_counts.F */
+else if ( !strcmp(name,"expndi_id_by_z_counts_init_") ) return (void *)FORTRAN(expndi_id_by_z_counts_init);
+else if ( !strcmp(name,"expndi_id_by_z_counts_result_limits_") ) return (void *)FORTRAN(expndi_id_by_z_counts_result_limits);
+else if ( !strcmp(name,"expndi_id_by_z_counts_compute_") ) return (void *)FORTRAN(expndi_id_by_z_counts_compute);
+
+/* fc_isubset.F */
+else if ( !strcmp(name,"fc_isubset_init_") ) return (void *)FORTRAN(fc_isubset_init);
+else if ( !strcmp(name,"fc_isubset_result_limits_") ) return (void *)FORTRAN(fc_isubset_result_limits);
+else if ( !strcmp(name,"fc_isubset_custom_axes_") ) return (void *)FORTRAN(fc_isubset_custom_axes);
+else if ( !strcmp(name,"fc_isubset_compute_") ) return (void *)FORTRAN(fc_isubset_compute);
+
+/* findhi.F */
+else if ( !strcmp(name,"findhi_init_") ) return (void *)FORTRAN(findhi_init);
+else if ( !strcmp(name,"findhi_result_limits_") ) return (void *)FORTRAN(findhi_result_limits);
+else if ( !strcmp(name,"findhi_work_size_") ) return (void *)FORTRAN(findhi_work_size);
+else if ( !strcmp(name,"findhi_compute_") ) return (void *)FORTRAN(findhi_compute);
+
+/* findlo.F */
+else if ( !strcmp(name,"findlo_init_") ) return (void *)FORTRAN(findlo_init);
+else if ( !strcmp(name,"findlo_result_limits_") ) return (void *)FORTRAN(findlo_result_limits);
+else if ( !strcmp(name,"findlo_work_size_") ) return (void *)FORTRAN(findlo_work_size);
+else if ( !strcmp(name,"findlo_compute_") ) return (void *)FORTRAN(findlo_compute);
+
+/* is_element_of.F */
+else if ( !strcmp(name,"is_element_of_init_") ) return (void *)FORTRAN(is_element_of_init);
+else if ( !strcmp(name,"is_element_of_result_limits_") ) return (void *)FORTRAN(is_element_of_result_limits);
+else if ( !strcmp(name,"is_element_of_compute_") ) return (void *)FORTRAN(is_element_of_compute);
+
+/* is_element_of_str.F */
+else if ( !strcmp(name,"is_element_of_str_init_") ) return (void *)FORTRAN(is_element_of_str_init);
+else if ( !strcmp(name,"is_element_of_str_result_limits_") ) return (void *)FORTRAN(is_element_of_str_result_limits);
+else if ( !strcmp(name,"is_element_of_str_compute_") ) return (void *)FORTRAN(is_element_of_str_compute);
+
+/* is_element_of_str_n.F */
+else if ( !strcmp(name,"is_element_of_str_n_init_") ) return (void *)FORTRAN(is_element_of_str_n_init);
+else if ( !strcmp(name,"is_element_of_str_n_result_limits_") ) return (void *)FORTRAN(is_element_of_str_n_result_limits);
+else if ( !strcmp(name,"is_element_of_str_n_compute_") ) return (void *)FORTRAN(is_element_of_str_n_compute);
+
+/* lanczos.F */
+else if ( !strcmp(name,"lanczos_init_") ) return (void *)FORTRAN(lanczos_init);
+else if ( !strcmp(name,"lanczos_work_size_") ) return (void *)FORTRAN(lanczos_work_size);
+else if ( !strcmp(name,"lanczos_compute_") ) return (void *)FORTRAN(lanczos_compute);
+
+/* lsl_lowpass.F */
+else if ( !strcmp(name,"lsl_lowpass_init_") ) return (void *)FORTRAN(lsl_lowpass_init);
+else if ( !strcmp(name,"lsl_lowpass_work_size_") ) return (void *)FORTRAN(lsl_lowpass_work_size);
+else if ( !strcmp(name,"lsl_lowpass_compute_") ) return (void *)FORTRAN(lsl_lowpass_compute);
+
+/* scat2grid_t.F */
+else if ( !strcmp(name,"scat2grid_t_init_") ) return (void *)FORTRAN(scat2grid_t_init);
+else if ( !strcmp(name,"scat2grid_t_work_size_") ) return (void *)FORTRAN(scat2grid_t_work_size);
+else if ( !strcmp(name,"scat2grid_t_compute_") ) return (void *)FORTRAN(scat2grid_t_compute);
+
+/* ave_scat2grid_t.F */
+else if ( !strcmp(name,"ave_scat2grid_t_init_") ) return (void *)FORTRAN(ave_scat2grid_t_init);
+else if ( !strcmp(name,"ave_scat2grid_t_work_size_") ) return (void *)FORTRAN(ave_scat2grid_t_work_size);
+else if ( !strcmp(name,"ave_scat2grid_t_compute_") ) return (void *)FORTRAN(ave_scat2grid_t_compute);
+
+/* scat2ddups.F */
+else if ( !strcmp(name,"scat2ddups_init_") ) return (void *)FORTRAN(scat2ddups_init);
+else if ( !strcmp(name,"scat2ddups_result_limits_") ) return (void *)FORTRAN(scat2ddups_result_limits);
+else if ( !strcmp(name,"scat2ddups_compute_") ) return (void *)FORTRAN(scat2ddups_compute);
+
+/* transpose_xt.F */
+else if ( !strcmp(name,"transpose_xt_init_") ) return (void *)FORTRAN(transpose_xt_init);
+else if ( !strcmp(name,"transpose_xt_result_limits_") ) return (void *)FORTRAN(transpose_xt_result_limits);
+else if ( !strcmp(name,"transpose_xt_compute_") ) return (void *)FORTRAN(transpose_xt_compute);
+
+/* transpose_xy.F */
+else if ( !strcmp(name,"transpose_xy_init_") ) return (void *)FORTRAN(transpose_xy_init);
+else if ( !strcmp(name,"transpose_xy_result_limits_") ) return (void *)FORTRAN(transpose_xy_result_limits);
+else if ( !strcmp(name,"transpose_xy_compute_") ) return (void *)FORTRAN(transpose_xy_compute);
+
+/* transpose_xz.F */
+else if ( !strcmp(name,"transpose_xz_init_") ) return (void *)FORTRAN(transpose_xz_init);
+else if ( !strcmp(name,"transpose_xz_result_limits_") ) return (void *)FORTRAN(transpose_xz_result_limits);
+else if ( !strcmp(name,"transpose_xz_compute_") ) return (void *)FORTRAN(transpose_xz_compute);
+
+/* transpose_yt.F */
+else if ( !strcmp(name,"transpose_yt_init_") ) return (void *)FORTRAN(transpose_yt_init);
+else if ( !strcmp(name,"transpose_yt_result_limits_") ) return (void *)FORTRAN(transpose_yt_result_limits);
+else if ( !strcmp(name,"transpose_yt_compute_") ) return (void *)FORTRAN(transpose_yt_compute);
+
+/* transpose_yz.F */
+else if ( !strcmp(name,"transpose_yz_init_") ) return (void *)FORTRAN(transpose_yz_init);
+else if ( !strcmp(name,"transpose_yz_result_limits_") ) return (void *)FORTRAN(transpose_yz_result_limits);
+else if ( !strcmp(name,"transpose_yz_compute_") ) return (void *)FORTRAN(transpose_yz_compute);
+
+/* transpose_zt.F */
+else if ( !strcmp(name,"transpose_zt_init_") ) return (void *)FORTRAN(transpose_zt_init);
+else if ( !strcmp(name,"transpose_zt_result_limits_") ) return (void *)FORTRAN(transpose_zt_result_limits);
+else if ( !strcmp(name,"transpose_zt_compute_") ) return (void *)FORTRAN(transpose_zt_compute);
+
+/* xcat.F */
+else if ( !strcmp(name,"xcat_init_") ) return (void *)FORTRAN(xcat_init);
+else if ( !strcmp(name,"xcat_result_limits_") ) return (void *)FORTRAN(xcat_result_limits);
+else if ( !strcmp(name,"xcat_compute_") ) return (void *)FORTRAN(xcat_compute);
+
+/* xcat_str.F */
+else if ( !strcmp(name,"xcat_str_init_") ) return (void *)FORTRAN(xcat_str_init);
+else if ( !strcmp(name,"xcat_str_result_limits_") ) return (void *)FORTRAN(xcat_str_result_limits);
+else if ( !strcmp(name,"xcat_str_compute_") ) return (void *)FORTRAN(xcat_str_compute);
+
+/* ycat.F */
+else if ( !strcmp(name,"ycat_init_") ) return (void *)FORTRAN(ycat_init);
+else if ( !strcmp(name,"ycat_result_limits_") ) return (void *)FORTRAN(ycat_result_limits);
+else if ( !strcmp(name,"ycat_compute_") ) return (void *)FORTRAN(ycat_compute);
+
+/* ycat_str.F */
+else if ( !strcmp(name,"ycat_str_init_") ) return (void *)FORTRAN(ycat_str_init);
+else if ( !strcmp(name,"ycat_str_result_limits_") ) return (void *)FORTRAN(ycat_str_result_limits);
+else if ( !strcmp(name,"ycat_str_compute_") ) return (void *)FORTRAN(ycat_str_compute);
+
+/* zcat.F */
+else if ( !strcmp(name,"zcat_init_") ) return (void *)FORTRAN(zcat_init);
+else if ( !strcmp(name,"zcat_result_limits_") ) return (void *)FORTRAN(zcat_result_limits);
+else if ( !strcmp(name,"zcat_compute_") ) return (void *)FORTRAN(zcat_compute);
+
+/* zcat_str.F */
+else if ( !strcmp(name,"zcat_str_init_") ) return (void *)FORTRAN(zcat_str_init);
+else if ( !strcmp(name,"zcat_str_result_limits_") ) return (void *)FORTRAN(zcat_str_result_limits);
+else if ( !strcmp(name,"zcat_str_compute_") ) return (void *)FORTRAN(zcat_str_compute);
+
+/* tcat.F */
+else if ( !strcmp(name,"tcat_init_") ) return (void *)FORTRAN(tcat_init);
+else if ( !strcmp(name,"tcat_result_limits_") ) return (void *)FORTRAN(tcat_result_limits);
+else if ( !strcmp(name,"tcat_compute_") ) return (void *)FORTRAN(tcat_compute);
+
+/* tcat_str.F */
+else if ( !strcmp(name,"tcat_str_init_") ) return (void *)FORTRAN(tcat_str_init);
+else if ( !strcmp(name,"tcat_str_result_limits_") ) return (void *)FORTRAN(tcat_str_result_limits);
+else if ( !strcmp(name,"tcat_str_compute_") ) return (void *)FORTRAN(tcat_str_compute);
+
+/* ecat.F */
+else if ( !strcmp(name,"ecat_init_") ) return (void *)FORTRAN(ecat_init);
+else if ( !strcmp(name,"ecat_result_limits_") ) return (void *)FORTRAN(ecat_result_limits);
+else if ( !strcmp(name,"ecat_compute_") ) return (void *)FORTRAN(ecat_compute);
+
+/* ecat_str.F */
+else if ( !strcmp(name,"ecat_str_init_") ) return (void *)FORTRAN(ecat_str_init);
+else if ( !strcmp(name,"ecat_str_result_limits_") ) return (void *)FORTRAN(ecat_str_result_limits);
+else if ( !strcmp(name,"ecat_str_compute_") ) return (void *)FORTRAN(ecat_str_compute);
+
+/* fcat.F */
+else if ( !strcmp(name,"fcat_init_") ) return (void *)FORTRAN(fcat_init);
+else if ( !strcmp(name,"fcat_result_limits_") ) return (void *)FORTRAN(fcat_result_limits);
+else if ( !strcmp(name,"fcat_compute_") ) return (void *)FORTRAN(fcat_compute);
+
+/* fcat_str.F */
+else if ( !strcmp(name,"fcat_str_init_") ) return (void *)FORTRAN(fcat_str_init);
+else if ( !strcmp(name,"fcat_str_result_limits_") ) return (void *)FORTRAN(fcat_str_result_limits);
+else if ( !strcmp(name,"fcat_str_compute_") ) return (void *)FORTRAN(fcat_str_compute);
+
+/* xreverse.F */
+else if ( !strcmp(name,"xreverse_init_") ) return (void *)FORTRAN(xreverse_init);
+else if ( !strcmp(name,"xreverse_result_limits_") ) return (void *)FORTRAN(xreverse_result_limits);
+else if ( !strcmp(name,"xreverse_compute_") ) return (void *)FORTRAN(xreverse_compute);
+
+/* yreverse.F */
+else if ( !strcmp(name,"yreverse_init_") ) return (void *)FORTRAN(yreverse_init);
+else if ( !strcmp(name,"yreverse_result_limits_") ) return (void *)FORTRAN(yreverse_result_limits);
+else if ( !strcmp(name,"yreverse_compute_") ) return (void *)FORTRAN(yreverse_compute);
+
+/* zreverse.F */
+else if ( !strcmp(name,"zreverse_init_") ) return (void *)FORTRAN(zreverse_init);
+else if ( !strcmp(name,"zreverse_result_limits_") ) return (void *)FORTRAN(zreverse_result_limits);
+else if ( !strcmp(name,"zreverse_compute_") ) return (void *)FORTRAN(zreverse_compute);
+
+/* treverse.F */
+else if ( !strcmp(name,"treverse_init_") ) return (void *)FORTRAN(treverse_init);
+else if ( !strcmp(name,"treverse_result_limits_") ) return (void *)FORTRAN(treverse_result_limits);
+else if ( !strcmp(name,"treverse_compute_") ) return (void *)FORTRAN(treverse_compute);
+
+/* ereverse.F */
+else if ( !strcmp(name,"ereverse_init_") ) return (void *)FORTRAN(ereverse_init);
+else if ( !strcmp(name,"ereverse_result_limits_") ) return (void *)FORTRAN(ereverse_result_limits);
+else if ( !strcmp(name,"ereverse_compute_") ) return (void *)FORTRAN(ereverse_compute);
+
+/* freverse.F */
+else if ( !strcmp(name,"freverse_init_") ) return (void *)FORTRAN(freverse_init);
+else if ( !strcmp(name,"freverse_result_limits_") ) return (void *)FORTRAN(freverse_result_limits);
+else if ( !strcmp(name,"freverse_compute_") ) return (void *)FORTRAN(freverse_compute);
+
+/* zaxreplace_avg.F */
+else if ( !strcmp(name,"zaxreplace_avg_init_") ) return (void *)FORTRAN(zaxreplace_avg_init);
+else if ( !strcmp(name,"zaxreplace_avg_work_size_") ) return (void *)FORTRAN(zaxreplace_avg_work_size);
+else if ( !strcmp(name,"zaxreplace_avg_compute_") ) return (void *)FORTRAN(zaxreplace_avg_compute);
+
+/* zaxreplace_bin.F */
+else if ( !strcmp(name,"zaxreplace_bin_init_") ) return (void *)FORTRAN(zaxreplace_bin_init);
+else if ( !strcmp(name,"zaxreplace_bin_work_size_") ) return (void *)FORTRAN(zaxreplace_bin_work_size);
+else if ( !strcmp(name,"zaxreplace_bin_compute_") ) return (void *)FORTRAN(zaxreplace_bin_compute);
+
+/* zaxreplace_rev.F */
+else if ( !strcmp(name,"zaxreplace_rev_init_") ) return (void *)FORTRAN(zaxreplace_rev_init);
+else if ( !strcmp(name,"zaxreplace_rev_compute_") ) return (void *)FORTRAN(zaxreplace_rev_compute);
+
+/* zaxreplace_zlev.F */
+else if ( !strcmp(name,"zaxreplace_zlev_init_") ) return (void *)FORTRAN(zaxreplace_zlev_init);
+else if ( !strcmp(name,"zaxreplace_zlev_work_size_") ) return (void *)FORTRAN(zaxreplace_zlev_work_size);
+else if ( !strcmp(name,"zaxreplace_zlev_compute_") ) return (void *)FORTRAN(zaxreplace_zlev_compute);
+
+/* nco.F */
+else if ( !strcmp(name,"nco_init_") ) return (void *)FORTRAN(nco_init);
+else if ( !strcmp(name,"nco_result_limits_") ) return (void *)FORTRAN(nco_result_limits);
+else if ( !strcmp(name,"nco_compute_") ) return (void *)FORTRAN(nco_compute);
+
+/* nco_attr.F */
+else if ( !strcmp(name,"nco_attr_init_") ) return (void *)FORTRAN(nco_attr_init);
+else if ( !strcmp(name,"nco_attr_result_limits_") ) return (void *)FORTRAN(nco_attr_result_limits);
+else if ( !strcmp(name,"nco_attr_compute_") ) return (void *)FORTRAN(nco_attr_compute);
+
+
+else if ( !strcmp(name,"tax_datestring_init_") ) return (void *)FORTRAN(tax_datestring_init);
+else if ( !strcmp(name,"tax_datestring_work_size_") ) return (void *)FORTRAN(tax_datestring_work_size);
+else if ( !strcmp(name,"tax_datestring_compute_") ) return (void *)FORTRAN(tax_datestring_compute);
+
+else if ( !strcmp(name,"tax_day_init_") ) return (void *)FORTRAN(tax_day_init);
+else if ( !strcmp(name,"tax_day_work_size_") ) return (void *)FORTRAN(tax_day_work_size);
+else if ( !strcmp(name,"tax_day_compute_") ) return (void *)FORTRAN(tax_day_compute);
+
+else if ( !strcmp(name,"tax_dayfrac_init_") ) return (void *)FORTRAN(tax_dayfrac_init);
+else if ( !strcmp(name,"tax_dayfrac_work_size_") ) return (void *)FORTRAN(tax_dayfrac_work_size);
+else if ( !strcmp(name,"tax_dayfrac_compute_") ) return (void *)FORTRAN(tax_dayfrac_compute);
+
+else if ( !strcmp(name,"tax_jday1900_init_") ) return (void *)FORTRAN(tax_jday1900_init);
+else if ( !strcmp(name,"tax_jday1900_work_size_") ) return (void *)FORTRAN(tax_jday1900_work_size);
+else if ( !strcmp(name,"tax_jday1900_compute_") ) return (void *)FORTRAN(tax_jday1900_compute);
+
+else if ( !strcmp(name,"tax_jday_init_") ) return (void *)FORTRAN(tax_jday_init);
+else if ( !strcmp(name,"tax_jday_work_size_") ) return (void *)FORTRAN(tax_jday_work_size);
+else if ( !strcmp(name,"tax_jday_compute_") ) return (void *)FORTRAN(tax_jday_compute);
+
+else if ( !strcmp(name,"tax_month_init_") ) return (void *)FORTRAN(tax_month_init);
+else if ( !strcmp(name,"tax_month_work_size_") ) return (void *)FORTRAN(tax_month_work_size);
+else if ( !strcmp(name,"tax_month_compute_") ) return (void *)FORTRAN(tax_month_compute);
+
+else if ( !strcmp(name,"tax_times_init_") ) return (void *)FORTRAN(tax_times_init);
+else if ( !strcmp(name,"tax_times_compute_") ) return (void *)FORTRAN(tax_times_compute);
+
+else if ( !strcmp(name,"tax_tstep_init_") ) return (void *)FORTRAN(tax_tstep_init);
+else if ( !strcmp(name,"tax_tstep_work_size_") ) return (void *)FORTRAN(tax_tstep_work_size);
+else if ( !strcmp(name,"tax_tstep_compute_") ) return (void *)FORTRAN(tax_tstep_compute);
+
+else if ( !strcmp(name,"tax_units_init_") ) return (void *)FORTRAN(tax_units_init);
+else if ( !strcmp(name,"tax_units_compute_") ) return (void *)FORTRAN(tax_units_compute);
+
+else if ( !strcmp(name,"tax_year_init_") ) return (void *)FORTRAN(tax_year_init);
+else if ( !strcmp(name,"tax_year_work_size_") ) return (void *)FORTRAN(tax_year_work_size);
+else if ( !strcmp(name,"tax_year_compute_") ) return (void *)FORTRAN(tax_year_compute);
+
+else if ( !strcmp(name,"tax_yearfrac_init_") ) return (void *)FORTRAN(tax_yearfrac_init);
+else if ( !strcmp(name,"tax_yearfrac_work_size_") ) return (void *)FORTRAN(tax_yearfrac_work_size);
+else if ( !strcmp(name,"tax_yearfrac_compute_") ) return (void *)FORTRAN(tax_yearfrac_compute);
+
+else if ( !strcmp(name,"fill_xy_init_") ) return (void *)FORTRAN(fill_xy_init);
+else if ( !strcmp(name,"fill_xy_compute_") ) return (void *)FORTRAN(fill_xy_compute);
+
+else if ( !strcmp(name,"test_opendap_init_") ) return (void *)FORTRAN(test_opendap_init);
+else if ( !strcmp(name,"test_opendap_result_limits_") ) return (void *)FORTRAN(test_opendap_result_limits);
+else if ( !strcmp(name,"test_opendap_compute_") ) return (void *)FORTRAN(test_opendap_compute);
+
+else if ( !strcmp(name,"unique_str2int_init_") ) return (void *)FORTRAN(unique_str2int_init);
+else if ( !strcmp(name,"unique_str2int_compute_") ) return (void *)FORTRAN(unique_str2int_compute);
+
+else if ( !strcmp(name,"bin_index_wt_init_") ) return (void *)FORTRAN(bin_index_wt_init);
+else if ( !strcmp(name,"bin_index_wt_result_limits_") ) return (void *)FORTRAN(bin_index_wt_result_limits);
+else if ( !strcmp(name,"bin_index_wt_compute_") ) return (void *)FORTRAN(bin_index_wt_compute);
+
+else if ( !strcmp(name,"minmax_init_") ) return (void *)FORTRAN(minmax_init);
+else if ( !strcmp(name,"minmax_result_limits_") ) return (void *)FORTRAN(minmax_result_limits);
+else if ( !strcmp(name,"minmax_compute_") ) return (void *)FORTRAN(minmax_compute);
+
+else if ( !strcmp(name,"floatstr_init_") ) return (void *)FORTRAN(floatstr_init);
+else if ( !strcmp(name,"floatstr_compute_") ) return (void *)FORTRAN(floatstr_compute);
+
+else if ( !strcmp(name,"pt_in_poly_init_") ) return (void *)FORTRAN(pt_in_poly_init);
+else if ( !strcmp(name,"pt_in_poly_work_size_") ) return (void *)FORTRAN(pt_in_poly_work_size);
+else if ( !strcmp(name,"pt_in_poly_compute_") ) return (void *)FORTRAN(pt_in_poly_compute);
+
+else if ( !strcmp(name,"list_value_xml_init_") ) return (void *)FORTRAN(list_value_xml_init);
+else if ( !strcmp(name,"list_value_xml_result_limits_") ) return (void *)FORTRAN(list_value_xml_result_limits);
+else if ( !strcmp(name,"list_value_xml_compute_") ) return (void *)FORTRAN(list_value_xml_compute);
+
+else if ( !strcmp(name,"write_webrow_init_") ) return (void *)FORTRAN(write_webrow_init);
+else if ( !strcmp(name,"write_webrow_result_limits_") ) return (void *)FORTRAN(write_webrow_result_limits);
+else if ( !strcmp(name,"write_webrow_compute_") ) return (void *)FORTRAN(write_webrow_compute);
+
+
+else if ( !strcmp(name,"str_mask_init_") ) return (void *)FORTRAN(str_mask_init);
+else if ( !strcmp(name,"str_mask_compute_") ) return (void *)FORTRAN(str_mask_compute);
+
+
+return NULL;
+ }
+/*  End of function pointer list for internally-linked External Functions
+ *  ------------------------------------ */
diff --git a/fer/ccr/LIB_NAME b/fer/ccr/LIB_NAME
new file mode 100644
index 0000000..8eab188
--- /dev/null
+++ b/fer/ccr/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libccr.a 
diff --git a/fer/ccr/Makefile b/fer/ccr/Makefile
new file mode 100644
index 0000000..2aaa538
--- /dev/null
+++ b/fer/ccr/Makefile
@@ -0,0 +1,36 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/ccr/SOURCE_FILES b/fer/ccr/SOURCE_FILES
new file mode 100644
index 0000000..61463f7
--- /dev/null
+++ b/fer/ccr/SOURCE_FILES
@@ -0,0 +1,42 @@
+SRCS_C = \
+add_c_pointer.c\
+batch_graphics.c\
+binaryRead.c\
+c_strcmp.c\
+c_strlen.c\
+c_upcase.c\
+c_dncase.c\
+c_strindex.c\
+c_strrindex.c\
+c_strcat.c\
+c_substr.c\
+c_strfloat.c\
+check_nan_data_sub.c\
+compare_c_strings.c\
+copy_c_string.c\
+perl_read.c\
+EF_InternalUtil.c\
+ferret_dispatch_c.c\
+ferret_query.c\
+free_c_pointer.c\
+free_c_string_array.c\
+get_c_string.c\
+get_c_string_len.c\
+get_max_c_string_len.c\
+get_offset_c_string.c\
+get_offset_c_string_len.c\
+get_sys_cmnd.c\
+init_c_string_array.c\
+linux_routines_c.c\
+list.c\
+replaceable_bad_flags.c \
+replace_bad_data_sub.c \
+run_thredds_browser.c\
+save_arg_pointers.c\
+save_c_string.c\
+set_nan.c\
+set_null_c_string.c\
+set_null_c_string_array.c\
+sizeof_pointer.c\
+write_dods.c\
+xfer_c_ptrs.c
diff --git a/fer/ccr/add_c_pointer.c b/fer/ccr/add_c_pointer.c
new file mode 100644
index 0000000..f09a858
--- /dev/null
+++ b/fer/ccr/add_c_pointer.c
@@ -0,0 +1,64 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ * Add integer offset to the given pointer.
+ * Pointer may be spaced "naturally" (del=0) or at 8 byte intervals (del=1).
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+double add_c_pointer_(ptr, del, offset)
+     char*** ptr;
+     int* del;
+     int* offset;
+{
+
+  int delta = *del ? 8/sizeof(char**) : 1;
+  union ptr_or_doub
+  {
+    double d;
+    char** ptr;
+  };
+  union ptr_or_doub new_ptr;
+
+  new_ptr.ptr = *ptr + (*offset * delta) ;
+
+  return new_ptr.d;
+
+}
diff --git a/fer/ccr/batch_graphics.c b/fer/ccr/batch_graphics.c
new file mode 100644
index 0000000..b44e7ca
--- /dev/null
+++ b/fer/ccr/batch_graphics.c
@@ -0,0 +1,75 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <assert.h>
+#include <string.h>
+#include "grdel.h"
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+/* set_batch_graphics */
+void FORTRAN(set_batch_graphics)(char *outfile)
+{
+  int length;
+  int status;
+  int aaint;
+
+  assert( outfile != NULL );
+  length = strlen(outfile);
+  /*
+   * This can be called either with (-batch) or without
+   * (-gif or -unmapped) a filename.  Only call
+   * save_metafile_name if a filename is given (-batch).
+   */
+  if ( length > 0 ) {
+     FORTRAN(save_metafile_name)(outfile, &length);
+     FORTRAN(assign_modemeta)();
+  }
+
+  /* 
+   * GKS metafile format no longer supported. The "-batch",
+   * "-gif", and "-unmapped" options do not change the workflow.
+   * If one of these option is given, however, windows are not
+   * made visible.  This allows the use of a faster graphics engine.
+   */
+  FORTRAN(fgd_set_unmapped_default)();
+}
+
diff --git a/fer/ccr/binaryRead.c b/fer/ccr/binaryRead.c
new file mode 100644
index 0000000..4fa7652
--- /dev/null
+++ b/fer/ccr/binaryRead.c
@@ -0,0 +1,524 @@
+/*
+ *
+ * Utility functions for reading binary data
+ *
+ * $Id: binaryRead.c 14442 2012-07-19 22:54:09Z ksmith $
+ *
+ *
+ * *kob*  4/06 v600 - changes for 64-bit build 
+ *
+ * * 1/12 *acm* - Ferret 6.8 Changes for double-precision ferret,
+ *                see the definition of macro DFTYPE in binaryRead.h
+ *   2/12 *kms* - Add E and F dimensions
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <assert.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "binaryRead.h"
+
+                                /* FORTRAN interface variables */
+static FileInfo *FFileInfo = 0; /* Implies only one open file at a time */
+static int Permutes[MAXDIMS];   /* Current permute array */
+static int Swap = 0;            /* Swap bytes flag */
+static char Errbuf[1024];       /* Store error messages */
+
+#define MAXTYPES 256
+static struct {
+  int length;
+  char type[MAXTYPES];
+} Types;
+
+static void freeMemory(FileInfo *);
+
+
+static int checkMem(void *p){
+  if (p == (void *)0){
+    fprintf(stderr, "Out of memory");
+    return 0;
+  }
+  return 1;
+}
+
+static void setError(char *str, char *mess) {
+  sprintf(Errbuf, str, mess);
+}
+
+static void tidyUp(FileInfo *file) {
+  close(file->fd);
+  freeMemory(file);
+}  
+
+static int errReturn(FileInfo *file) {
+  tidyUp(file);
+  return 0;
+}
+
+static int okReturn(FileInfo *file) {
+  tidyUp(file);
+  return 1;
+}
+
+static char *grabMemChunk(FileInfo *file){
+                                /* TODO -- mmap flags vary between Unixes */
+  MemInfo *mi = &file->minfo;
+  freeMemory(file);
+
+                                /* Align new chunk w/page */
+  {
+    int numPages = mi->filePos / file->pageSize;
+    int extra = mi->filePos % file->pageSize;
+    int position = numPages * file->pageSize;
+    int chunkSize = file->size - position;
+    if (chunkSize > MEM_INFO_BLOCKSIZE){
+      chunkSize = MEM_INFO_BLOCKSIZE;
+    }
+    mi->data = mmap(0, chunkSize, PROT_READ, MAP_SHARED, file->fd, position);
+    mi->relPos = extra;
+    mi->size = chunkSize;
+    mi->fileStartPos = position;
+  }
+  if (mi->data <= (char *)0){
+    mi->data = 0;
+    setError("Can't allocate enough memory for file %s", file->name);
+  }
+  return mi->data;
+}
+
+static void *initMemory(FileInfo *file) {
+                                /* Set up memory mapping */
+  MemInfo *mi = &file->minfo;
+  mi->data = 0;
+  mi->size = 0;
+  mi->relPos = 0;
+  mi->filePos = file->skip;        /* Skip over bytes at start of file */
+  if (!grabMemChunk(file)){
+    return 0;
+  }
+  return mi->data + mi->relPos;
+}
+
+static void *nextMemory(FileInfo *file, int amount) {
+  MemInfo *mi = &file->minfo;
+  mi->relPos += amount;
+  mi->filePos += amount;
+  if (mi->fileStartPos + mi->size < file->size){
+    if (mi->relPos > mi->size - MEM_INFO_MINTHRESH){
+      if (!(grabMemChunk(file)))
+        return 0;
+    }
+  }
+  return mi->data + mi->relPos;
+}
+
+static void freeMemory(FileInfo *file) {
+  MemInfo *mi = &file->minfo;
+  if (mi->data > (char *)0){
+    munmap(mi->data, mi->size);
+  }
+}
+
+static FileInfo *createBinaryReader(char *name, int lengths[MAXDIMS],
+                             int permutes[MAXDIMS], int skip, int swap){
+  FileInfo *fi = (FileInfo *)calloc(1, sizeof(FileInfo));
+  int i;
+                                /* Open file */
+  if (!checkMem(fi)){
+    return 0;
+  }
+  Errbuf[0] = '\0';
+  fi->pageSize = getpagesize();
+  fi->name = (char *)malloc(strlen(name)+1);
+  fi->doSwap = swap;
+  if (!checkMem(fi->name)){
+    return 0;
+  }
+  strcpy(fi->name, name);
+  fi->vindex = MAXDIMS-1;
+  for (i=0; i < MAXDIMS; ++i){
+    fi->lengths[i] = lengths[i];
+    assert(permutes[i] >= 0 && permutes[i] <= 6);
+    fi->permutes[i] = permutes[i];
+    if (permutes[i] == MAXDIMS-1){
+      fi->vindex = i;
+    }
+  }
+
+  fi->coeffs[0] = 1;
+  for (i = 1; i < MAXDIMS-1; i++)
+     fi->coeffs[i] = lengths[i-1] * fi->coeffs[i-1];
+  fi->coeffs[MAXDIMS-1] = 0;        /* Dimension for variables */
+
+  fi->skip = skip;
+  fi->debug = 0;
+  fi->vars = 0;
+  fi->nvars = 0;
+  fi->size = 0;
+  fi->fd = open(fi->name, O_RDONLY);
+  if (fi->fd < 0){
+    setError("Can't open file %s for reading", name);
+    return 0;
+  }
+  {
+    struct stat statbuf;
+    if (fstat(fi->fd, &statbuf) < 0){
+      setError("Can't get size of file %s", fi->name);
+      return 0;
+    }
+    fi->size = statbuf.st_size;
+  }
+
+  return fi;
+}
+
+static void deleteVar(VarInfo *theVar) {
+  free(theVar);
+}
+
+static void deleteBinaryReader(FileInfo *fi){
+  free(fi->vars);
+  tidyUp(fi);
+  free(fi->name);
+  free(fi);
+}
+
+static int addVar(FileInfo *fi, DFTYPE *data, int type, int doRead){
+  VarInfo *theVar = 0;
+  int i;
+
+  if (fi->vars == (VarInfo *)0){
+    fi->vars = malloc(sizeof(VarInfo));
+  } else {
+    fi->vars = (VarInfo *)realloc(fi->vars, sizeof(VarInfo)*(fi->nvars+1));
+  }
+  if (!checkMem(fi->vars)){
+    return 0;
+  }
+  theVar = &fi->vars[fi->nvars];
+  ++fi->nvars;
+  theVar->data = data;
+  theVar->doRead = doRead;
+  theVar->type = type;
+  switch(type){
+  case 'b':
+    theVar->dataSize = sizeof(char);
+    break;
+  case 's':
+    theVar->dataSize = sizeof(short);
+    break;
+  case 'i':
+    theVar->dataSize = sizeof(int);
+    break;
+  case 'f':
+    theVar->dataSize = sizeof(float);
+    break;
+  case 'd':
+    theVar->dataSize = sizeof(double);
+    break;
+  default:
+    abort();
+  }
+  fi->lengths[MAXDIMS-1] = fi->nvars; 
+  return 1;
+}
+
+
+static void SWAP(unsigned char *p1, unsigned char *p2)
+{
+  unsigned char c = *p2;
+  *p2 = *p1;
+  *p1 = c;
+}
+
+/* switch the order of the bytes in a long integer */
+static int SWAP32(void *i_in)
+{
+  unsigned char *inptr = (unsigned char *)i_in;
+  SWAP(inptr, &inptr[3]);
+  SWAP(&inptr[1], &inptr[2]);
+}
+ 
+/* switch the order of the bytes in a short integer */
+static void SWAP16(void *i_in)
+{
+  unsigned char *inptr = (unsigned char *)i_in;
+  SWAP(inptr, &inptr[1]);
+}
+ 
+static double SWAP64(void *i_in)
+{
+  unsigned char *inptr = (unsigned char *)i_in;
+  SWAP(inptr, &inptr[7]);
+  SWAP(&inptr[1], &inptr[6]);
+  SWAP(&inptr[2], &inptr[5]);
+  SWAP(&inptr[3], &inptr[4]);
+}
+
+static int readVars(FileInfo *file) {
+  int i,j,k,l,m,n,v;
+  DFTYPE *dst;
+  char *src = initMemory(file);
+  int *permutes = file->permutes;
+  int *lengths = file->lengths;
+  int *coeffs = file->coeffs;
+  int indexes[MAXDIMS];
+  union {
+    short s;
+    int i;
+    float f;
+    double d;
+  } buf;                        /* Union needed to insure correct data align */
+  VarInfo *var;
+  int dataSize;
+  char type;
+  int index;
+
+  assert( MAXDIMS == 7 );
+  for (v=0; v < lengths[permutes[6]]; ++v){
+    indexes[6] = v;
+    for (n=0; n < lengths[permutes[5]]; ++n){
+      indexes[5] = n;
+      for (m=0; m < lengths[permutes[4]]; ++m){
+        indexes[4] = m;
+        for (l=0; l < lengths[permutes[3]]; ++l){
+          indexes[3] = l;
+          for (k=0; k < lengths[permutes[2]]; ++k){
+            indexes[2] = k;
+            for (j=0; j < lengths[permutes[1]]; ++j){
+              indexes[1] = j;
+              for (i=0; i < lengths[permutes[0]]; ++i){
+
+                if (src == NULL){
+                  return 0;
+                }
+                indexes[0] = i;
+                var = &file->vars[indexes[file->vindex]];
+                dataSize = var->dataSize;
+                if (var->doRead){
+                  /* Get the permuted index */
+                  index = indexes[0] * coeffs[permutes[0]] +
+                          indexes[1] * coeffs[permutes[1]] +
+                          indexes[2] * coeffs[permutes[2]] +
+                          indexes[3] * coeffs[permutes[3]] +
+                          indexes[4] * coeffs[permutes[4]] +
+                          indexes[5] * coeffs[permutes[5]] +
+                          indexes[6] * coeffs[permutes[6]];
+                  dst = var->data + index;
+                  type = var->type;
+                  switch(type){
+                  case 'b':
+                    *dst = (DFTYPE) *(char *)src;
+                    break;
+                  case 's':
+                    memcpy(&buf.s, src, sizeof(short));
+                    if (file->doSwap)
+                      SWAP16(&buf.s);
+                    *dst = (DFTYPE) buf.s;
+                    break;
+                  case 'i':
+                    memcpy(&buf.i, src, sizeof(int));
+                    if (file->doSwap)
+                      SWAP32(&buf.i);
+                    *dst = (DFTYPE) buf.i;
+                    break;
+                  case 'f':
+                    memcpy(&buf.f, src, sizeof(float));
+                    if (file->doSwap)
+                      SWAP32(&buf.f);
+                    *dst = (DFTYPE) buf.f;
+                    break;
+                  case 'd':
+                    memcpy(&buf.d, src, sizeof(double));
+                    if (file->doSwap)
+                      SWAP64(&buf.d);
+                    *dst = (DFTYPE) buf.d;
+                    break;
+                  default:
+                    abort();
+                  }
+#ifdef DEBUG_MEy
+                  printf("%f at (%d,%d,%d,%d,%d,%d,%d)\n", *dst, i, j, k, l, m, n, v);
+#endif
+                }
+                src = nextMemory(file, dataSize);
+
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  return 1;
+}
+
+static int readBinary(FileInfo *file){
+                                /* Screen out zero length files */
+  if (file->size == 0){
+    setError("File %s is an empty file", file->name);
+    return errReturn(file);
+  }
+
+                                /* Sanity check for size match */
+  {
+    int dimLength = 1, totalLength = 0, i;
+    for (i=0; i < MAXDIMS-1; ++i){ /* Length of all non variable dimensions */
+      dimLength *= file->lengths[i];
+    }
+    for (i=0; i < file->nvars; ++i){
+      totalLength += file->vars[i].dataSize * dimLength;
+    }
+    if (totalLength > file->size - file->skip){
+      setError("Size of file %s doesn't match size specified by variables/grid",
+               file->name);
+      return errReturn(file);
+    }
+  }
+
+
+  if (!readVars(file)){
+    return errReturn(file);
+  }
+
+  return okReturn(file);
+}
+  
+int FORTRAN(br_open)(char *name, int lengths[MAXDIMS],
+                                  int permutes[MAXDIMS], int *iskip){
+  int skip = (*iskip) * sizeof(DFTYPE); /* Words -> bytes */
+  assert(FFileInfo == 0);
+  FFileInfo = createBinaryReader(name, lengths, permutes, skip, Swap);
+  return FFileInfo != 0;
+}
+
+int FORTRAN(br_add_var)(DFTYPE *data, int *doRead) {
+  assert(FFileInfo != 0);
+  assert(Types.length > 0);
+  if (Types.length != 1 && FFileInfo->nvars >= Types.length){
+    setError("%s",
+             "Number of args in /type doesn't match number of variables");
+    return 0;
+  }
+  {
+    char type;
+    if (Types.length == 1){        /* All variables same type */
+      type = Types.type[0];
+    } else {
+      type = Types.type[FFileInfo->nvars];
+    }
+    return addVar(FFileInfo, data, type, *doRead);
+  }
+}
+
+int FORTRAN(br_read)() {
+  assert(FFileInfo != 0);
+  return readBinary(FFileInfo);
+}
+
+void FORTRAN(br_close)() {
+  if (FFileInfo != 0){
+    deleteBinaryReader(FFileInfo);
+    FFileInfo = 0;
+  }
+}
+
+void FORTRAN(br_get_error)(char *buf) {
+  strcpy(buf, Errbuf);
+}
+
+void FORTRAN(br_get_permutes)(int *permutes) {
+  int i;
+  for (i=0; i < MAXDIMS; ++i){
+    permutes[i] = Permutes[i];
+  }
+}
+
+void FORTRAN(br_set_atts)(int *permutes, int *swap) {
+  int i;
+  for (i=0; i < MAXDIMS; ++i){
+    Permutes[i] = permutes[i]-1; /* FORTRAN -> C indexing */
+  }
+  Swap = *swap;
+}
+
+static int get_type(char *type, char *result) {
+  char c1, c2;
+  if (strlen(type) != 2)
+    return 0;
+  c1 = tolower(*type);
+  c2 = tolower(type[1]);
+  switch(c1){
+  case 'i':
+    switch(c2){
+    case '1':
+      *result = 'b';
+      return 1;
+    case '2':
+      *result = 's';
+      return 1;
+    case '4':
+      *result = 'i';
+      return 1;
+    }
+    return 0;
+  case 'r':
+    switch(c2){
+    case '4':
+      *result = 'f';
+      return 1;
+    case '8':
+      *result = 'd';
+      return 1;
+    }
+    return 0;
+  }
+  return 0;
+}
+
+/* Type string can be either one item, which implies that all
+ * variables are the same type, or a comma delimited set of
+ * types
+ */
+int FORTRAN(br_set_type)(char *type) {
+  char buf[1024];
+  char *token, *cp, *cp1;
+  char result;
+  int count = 0;
+
+                                /* Zero out types */
+  Types.length = 0;
+
+                                /* Strip out white space */
+  cp = type;
+  cp1 = buf;
+  while (*cp != '\0'){
+    if (*cp != ' ' && *cp != '\t'){
+      *cp1++ = *cp;
+    }
+    ++cp;
+  }
+  *cp1 = '\0';
+
+                                /* Get comma delimited list */
+  token = strtok(buf, ",");
+  while (token != 0 && *token != '\0'){
+    if (!get_type(token, &result)){
+      setError("Bad argument to /type -- %s", token);
+      return 0;
+    }
+    ++Types.length;
+    Types.type[count++] = result;
+    token = strtok(0, ",");
+  }
+  return 1;
+}
+
diff --git a/fer/ccr/binaryRead.h b/fer/ccr/binaryRead.h
new file mode 100644
index 0000000..8843d4d
--- /dev/null
+++ b/fer/ccr/binaryRead.h
@@ -0,0 +1,70 @@
+#ifndef BINARYREAD_H
+#define BINARYREAD_H
+/*
+ * Utility functions for reading binary data
+ *
+ * $Id: binaryRead.h 14336 2012-07-10 23:31:50Z ksmith $
+ *
+ * *acm*  5/07 v603 - fix prototype of createBinaryRead to use MAXDIMS rather 
+ *                    than hardwired to 4; to match what is in .c file.
+ *			  (Found by Andy Jacobson doing the MAC build.)
+ *
+ * * 1/12 *acm* - Ferret 6.8 Changes for double-precision ferret,
+ *                see the define macro DFTYPE in binaryRead.h
+ *   2/12 *kms* - Add E and F dimensions
+ */
+
+#define MEM_INFO_BLOCKSIZE      1048576	/* Max mem chunk size */
+#define MEM_INFO_MINTHRESH      1024 /* No closer to mmap boundary than this! */
+
+/* Easier way of handling single/double floating-point declarations */
+#ifdef double_p
+#define DFTYPE double
+#else
+#define DFTYPE float
+#endif
+
+
+typedef struct _MemInfo {
+  char *data;			/* Memory mapped file contents */
+  int relPos;			/* Position relative to mem block start */
+  int filePos;			/* Position relative to file start */
+  int fileStartPos;		/* Position of memory chunk relative to file origin */
+  int size;			/* Size of current memory block */
+} MemInfo;
+
+typedef struct _VarInfo {
+  /*  Passed values */
+  char type;			/* Data type 'b', 's', 'i', 'f', 'd' */
+  int doRead;			/* If true, read data */
+  DFTYPE *data;			/* Data for variable -- assumed preallocated */
+  
+  /* Calculated values */
+  int dataSize;			/* Size of variable data type */
+} VarInfo;
+
+/* One additional dimension for variables */
+#define MAXDIMS  7
+
+typedef struct _FileInfo {
+  MemInfo minfo;		/* Memory mapped file stuff */
+  char *name;			/* Name of file containing binary data */
+  int skip;			/* Number of bytes to skip at start of file */
+  int debug;			/* Debug flag */
+  VarInfo *vars;		/* List of variables to read */
+  int nvars;			/* Number of variables */
+  int fd;			/* File handle */
+  int lengths[MAXDIMS];		/* Lengths of x,y,z,t */
+  int coeffs[MAXDIMS];		/* Coefficients calc. from permute/length */
+  int permutes[MAXDIMS];	/* ijkl permutations from file -> memory */
+  int vindex;			/* Permuted index that is the variable index */
+  int size;			/* Size of file in bytes */
+  int pageSize;			/* System pagesize */
+  int doSwap;			/* Swap bytes */
+} FileInfo;
+
+#ifndef FORTRAN
+#define FORTRAN(a) a##_
+#endif
+
+#endif
diff --git a/fer/ccr/c_dncase.c b/fer/ccr/c_dncase.c
new file mode 100644
index 0000000..bb33088
--- /dev/null
+++ b/fer/ccr/c_dncase.c
@@ -0,0 +1,75 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return string in all lowercase
+ * 
+ * V541: *kob* 3/02
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+void c_dncase_(in_ptr, out_ptr)
+     char** in_ptr;
+     char** out_ptr;
+{
+   char* tmp;
+   char* tmp2;
+
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+   if ( *in_ptr == NULL ) {
+      /* undefined string given, so return an undefined string */
+      *out_ptr = NULL;
+      return;
+   }
+  
+   *out_ptr = (char *) malloc(sizeof(char) * (strlen(*in_ptr)+1));
+   if ( *out_ptr == NULL )
+      abort();
+
+   tmp = *out_ptr;
+   tmp2 = *in_ptr;
+   while ( *tmp2 != '\0' ) {
+      *tmp = tolower(*tmp2);
+      tmp++;
+      tmp2++;
+   }
+   *tmp = '\0';
+}
diff --git a/fer/ccr/c_strcat.c b/fer/ccr/c_strcat.c
new file mode 100644
index 0000000..576985b
--- /dev/null
+++ b/fer/ccr/c_strcat.c
@@ -0,0 +1,92 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Concatenate two strings, returning the output pointer to the new string
+ *
+ * v5.41 *kob*  3/02
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <string.h>
+
+void c_strcat_(in_ptr1, in_ptr2, out_ptr)  
+     char** in_ptr1;
+     char** in_ptr2;
+     char** out_ptr;
+{
+   char* tmp1; 
+   char* tmp2;
+   int len1;
+   int len2;
+
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+
+   /* this treats an undefined string the same as an empty string */
+   if ( *in_ptr1 == NULL )
+      len1 = 0;
+   else
+      len1 = strlen(*in_ptr1);
+   if ( *in_ptr2 == NULL )
+      len2 = 0;
+   else
+      len2 = strlen(*in_ptr2);
+
+   *out_ptr = (char *) malloc(sizeof(char) * (len1 + len2 + 1));
+   if ( *out_ptr == NULL )
+      abort();
+
+   tmp2 = *out_ptr;
+   if ( *in_ptr1 != NULL ) {
+      tmp1 = *in_ptr1;
+      while ( *tmp1 != '\0' ) {
+         *tmp2 = *tmp1;
+         tmp1++;
+         tmp2++;
+      } 
+   } 
+   if ( *in_ptr2 != NULL ) {
+      tmp1 = *in_ptr2;
+      while ( *tmp1 != '\0' ) {
+         *tmp2 = *tmp1;
+         tmp1++;
+         tmp2++;
+      }
+   }
+   *tmp2 = '\0';
+}
diff --git a/fer/ccr/c_strcmp.c b/fer/ccr/c_strcmp.c
new file mode 100644
index 0000000..21e8aaf
--- /dev/null
+++ b/fer/ccr/c_strcmp.c
@@ -0,0 +1,63 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Compare 2 strings with strcmp -- case-sensitive
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+void c_strcmp_(in_ptr1, in_ptr2, out_ptr)
+     char** in_ptr1;
+     char** in_ptr2;
+     int* out_ptr;
+{
+   char *str1;
+   char *str2;
+
+   /* this treats an undefined string the same as an empty string */
+   if ( *in_ptr1 == NULL )
+      str1 = "";
+   else
+      str1 = *in_ptr1;
+   if ( *in_ptr2 == NULL )
+      str2 = "";
+   else
+      str2 = *in_ptr2;
+
+   *out_ptr = strcmp(str1, str2);
+}
diff --git a/fer/ccr/c_strfloat.c b/fer/ccr/c_strfloat.c
new file mode 100644
index 0000000..59e9b06
--- /dev/null
+++ b/fer/ccr/c_strfloat.c
@@ -0,0 +1,74 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return a float value from a character string
+ *
+ * v5.41 *kob*  3/02
+ *
+ * *acm*  3/05 v581 - return bad_value if input cannot be converted to numeric
+ * *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *                                       definition of macro DFTYPE in ferret.h.
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include "ferret.h"
+
+void c_strfloat_(in_ptr, out_ptr, bad_ptr)
+     char** in_ptr;
+     DFTYPE* out_ptr;
+     DFTYPE* bad_ptr;
+{
+   double dval;
+   char  *endptr;
+
+   if ( *in_ptr == NULL ) {
+      /* no string defined, so set to the bad value */
+      *out_ptr = *bad_ptr;
+      return;
+   }
+
+   dval = strtod(*in_ptr, &endptr);
+   if ( endptr == *in_ptr ) {
+      /* not numeric, so set to the bad value */
+      *out_ptr = *bad_ptr;
+   }
+   else {
+      *out_ptr = (DFTYPE) dval;
+   }
+}
+
diff --git a/fer/ccr/c_strindex.c b/fer/ccr/c_strindex.c
new file mode 100644
index 0000000..8c0b534
--- /dev/null
+++ b/fer/ccr/c_strindex.c
@@ -0,0 +1,66 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Find first occurence of substring in string
+ *
+ * v5.41: *kob* 3/02
+ * V552: *kob* 4/03 - change func type to void
+ *
+ */ 
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+void c_strindex_(in_ptr1, in_ptr2, out_ptr)
+     char** in_ptr1;
+     char** in_ptr2;
+     int* out_ptr;
+{
+   char * result;
+
+   if ( (*in_ptr1 == NULL) || (*in_ptr2 == NULL) ) {
+      /* an undefined string given, so set to no match found */
+      *out_ptr = 0;
+      return;
+   }
+
+   result = strstr(*in_ptr1, *in_ptr2); 
+   if ( result != NULL ) {
+      *out_ptr = (result-(*in_ptr1)+1); 
+   } else {
+      *out_ptr = 0;
+   }
+}
diff --git a/fer/ccr/c_strlen.c b/fer/ccr/c_strlen.c
new file mode 100644
index 0000000..c9ca8f4
--- /dev/null
+++ b/fer/ccr/c_strlen.c
@@ -0,0 +1,56 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return length of string argument
+ *
+ * V541: *kob* 3/02
+ * V552: *kob* 4/03 - change func type to void
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+void c_strlen_(in_ptr, out_ptr)
+     char** in_ptr;
+     int* out_ptr;
+{
+   /* this treats an undefined string the same as an empty string */
+   if ( *in_ptr == NULL )
+      *out_ptr = 0;
+   else
+      *out_ptr = strlen(*in_ptr);
+}
diff --git a/fer/ccr/c_strrindex.c b/fer/ccr/c_strrindex.c
new file mode 100644
index 0000000..48874b0
--- /dev/null
+++ b/fer/ccr/c_strrindex.c
@@ -0,0 +1,73 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return last occurence of substring in string, i.e. search 
+ * from the right
+ * 
+ * *kob* 3/02
+ * V552: *kob* 4/03 - change func type to void
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+void c_strrindex_(in_ptr1, in_ptr2, out_ptr)
+     char** in_ptr1;
+     char** in_ptr2;
+     int* out_ptr;
+{
+   char *result;
+   char *tmp;
+
+   if ( (*in_ptr1 == NULL) || (*in_ptr2 == NULL) ) {
+      /* an undefined string given, so set to no match found */
+      *out_ptr = 0;
+      return;
+   }
+
+   result = strstr(*in_ptr1, *in_ptr2); 
+   if ( result != NULL ) {
+      while (result) {
+         tmp = result;
+         result = strstr(++result, *in_ptr2); 
+      }
+      *out_ptr = (tmp-(*in_ptr1)+1); 
+   }
+   else {
+      *out_ptr = 0;
+   }
+}
diff --git a/fer/ccr/c_substr.c b/fer/ccr/c_substr.c
new file mode 100644
index 0000000..fe4abf3
--- /dev/null
+++ b/fer/ccr/c_substr.c
@@ -0,0 +1,87 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return a substring of a given length starting from offset
+ * of given string.
+ * 
+ * If offset is greater than full string length, return an empty string.  If offset is less then
+ * full string length, but offset+substring length is greater than full string lenght, just
+ * return rest of full string in substring.  
+ *
+ * V541: *kob* 3/02
+ * V680  *acm* 1/12  Call with integers for offset and length. (goes with double-precision changes)
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void c_substr_(in_ptr, offset, length, out_ptr)
+     char** in_ptr;
+     int* offset;
+     int* length;
+     char** out_ptr;     
+{
+   char* tmp;
+   char* tmp2;
+   int i, int_length, int_offset;
+
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+   if ( *in_ptr == NULL ) {
+      /* undefined string given, so return an undefined string */
+      *out_ptr = NULL;
+      return;
+   }
+
+   int_length = (int)(*length + 0.5);
+   int_offset = (int)(*offset + 0.5) - 1;
+
+   *out_ptr = (char *) malloc(sizeof(char) * (int_length + 1));
+   if ( *out_ptr == NULL )
+      abort();
+
+   tmp2 = *in_ptr;
+   for (i = 0; (i < int_offset) && (*tmp2 != '\0'); i++)
+      tmp2++;
+   tmp = *out_ptr;
+   for (i = 0; (i < int_length) && (*tmp2 != '\0'); i++) {
+      *tmp = *tmp2;
+      tmp++;
+      tmp2++;
+   }
+   *tmp = '\0';
+}
diff --git a/fer/ccr/c_upcase.c b/fer/ccr/c_upcase.c
new file mode 100644
index 0000000..5455cc0
--- /dev/null
+++ b/fer/ccr/c_upcase.c
@@ -0,0 +1,75 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Return string in all uppercase
+ * 
+ * V541: *kob* 3/02
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+void c_upcase_(in_ptr, out_ptr)
+     char** out_ptr;
+     char** in_ptr;
+{
+   char* tmp;
+   char* tmp2;
+
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+   if ( *in_ptr == NULL ) {
+      /* undefined string given, so return an undefined string */
+      *out_ptr = NULL;
+      return;
+   }
+
+   *out_ptr = (char *) malloc(sizeof(char) * (strlen(*in_ptr) + 1));
+   if ( *out_ptr == NULL )
+      abort();
+
+   tmp = *out_ptr;
+   tmp2 = *in_ptr;
+   while ( *tmp2 != '\0' ) {
+      *tmp = toupper(*tmp2);
+      tmp++;
+      tmp2++;
+   }
+   *tmp = '\0';
+}
diff --git a/fer/ccr/check_nan_data_sub.c b/fer/ccr/check_nan_data_sub.c
new file mode 100644
index 0000000..7e2adbe
--- /dev/null
+++ b/fer/ccr/check_nan_data_sub.c
@@ -0,0 +1,70 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*
+ * check_nan_data_sub.c :
+ * If the missing-flag is not NaN, replace any NaN values with the bad-flag
+ *
+ * *acm* - 8/18/10
+ * *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret,
+ *                    see the definition of macro DFTYPE in ferret.h.
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <float.h>
+#include "ferret.h"
+
+void check_nan_data_sub_ ( DFTYPE *src, 
+			   int *size, DFTYPE *data_bad )
+
+{
+  int i;
+
+  /* If the missing-flag is NaN, do nothing */
+
+  if (isnan(*data_bad)) {
+	  i = 1;
+  }
+  else {
+    for (i=0; i<*size; i++) {
+      if (isnan(src[i])) {
+	   src[i] = *data_bad;
+      }
+    }
+  }
+}
+
diff --git a/fer/ccr/compare_c_strings.c b/fer/ccr/compare_c_strings.c
new file mode 100644
index 0000000..8880277
--- /dev/null
+++ b/fer/ccr/compare_c_strings.c
@@ -0,0 +1,62 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Compare 2 strings with strcasecmp -- case-insensitive
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+int compare_c_strings_(ptr_1, ptr_2)
+     char** ptr_2;
+     char** ptr_1;
+{
+   char *str1;
+   char *str2;
+
+   /* this treats undefined strings the same as empty strings */
+   if ( *ptr_1 == NULL )
+      str1 = "";
+   else
+      str1 = *ptr_1;
+   if ( *ptr_2 == NULL )
+      str2 = "";
+   else
+      str2 = *ptr_2;
+
+   return strcasecmp(str1, str2);
+}
+
diff --git a/fer/ccr/copy_c_string.c b/fer/ccr/copy_c_string.c
new file mode 100644
index 0000000..46f2c90
--- /dev/null
+++ b/fer/ccr/copy_c_string.c
@@ -0,0 +1,64 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * Allocate storage and copy the given input string,
+ * returning the output pointer
+ *
+ *  V540: *sh* 9/01 - added support for string arrays
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <string.h>
+
+void copy_c_string_(in_ptr, out_ptr)
+     char** out_ptr;
+     char** in_ptr;
+{
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+   if ( *in_ptr == NULL ) {
+     *out_ptr = NULL;
+     return;
+   }
+
+   *out_ptr = (char *) malloc(sizeof(char) * (strlen(*in_ptr) + 1));
+   if ( *out_ptr == NULL )
+      abort();
+
+   strcpy(*out_ptr, *in_ptr);
+}
diff --git a/fer/ccr/ferret_dispatch_c.c b/fer/ccr/ferret_dispatch_c.c
new file mode 100644
index 0000000..d584adb
--- /dev/null
+++ b/fer/ccr/ferret_dispatch_c.c
@@ -0,0 +1,139 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/*
+*	ferret_dispatch_c - C interface routine to set up structure arguments
+*	                    for calling ferret_dispatch.F
+*
+* TMAP interactive data analysis program
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*/
+
+/*
+* revision history:
+*   11/16/94 - updated to use macro declarations from ferret_shared_buffer.h
+*
+*   05/25/95 - added ifdef check for trailing underscores not needed on HP *kob*
+*   *js* 6.99 Set line buffering if in server mode
+*  *acm* 1/12 - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*              definition of macro DFTYPE in ferret.h 
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ferret.h>
+#include "ferret_shared_buffer.h"
+
+/* function prototype for FORTRAN routine */
+/* added ifdef for necessity of trailing underscores *kob* */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#   ifdef _NO_PROTO
+void ferret_dispatch_( );
+#   else
+void ferret_dispatch( DFTYPE *memory, char *init_command, int *rtn_flags,
+		       int *nflags, char *rtn_chars, int *nchars, int *nerrlines );
+#   endif
+#else                     /*NO_ENTRY_NAME_UNDERSCORES*/
+#   ifdef _NO_PROTO
+void ferret_dispatch_( );
+#   else
+void ferret_dispatch_( DFTYPE *memory, char *init_command, int *rtn_flags,
+		       int *nflags, char *rtn_chars, int *nchars, int *nerrlines );
+#   endif
+#endif                    /*NO_ENTRY_NAME_UNDERSCORES*/
+
+#ifdef _NO_PROTO
+void ferret_dispatch_c( memory, init_command, sBuffer )
+DFTYPE *memory;
+char *init_command;
+smPtr sBuffer;
+#else
+void ferret_dispatch_c( DFTYPE *memory, char *init_command, smPtr sBuffer )
+#endif
+{
+  int flag_buff_size  = NUMFLAGS;
+  int TEXTLENGTH_size  = TEXTLENGTH;
+  int NUMDOUBLES_size = NUMDOUBLES;
+
+/* call the FORTRAN program that actually does the FERRET command */
+/* all arguments must be pointers for FORTRAN */
+/*ifdef check added 5/95 *kob* */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+  ferret_dispatch
+#else
+  ferret_dispatch_
+#endif
+                  ( memory, init_command, sBuffer->flags, &flag_buff_size,
+		    sBuffer->text, &TEXTLENGTH_size, &(sBuffer->numStrings) );
+
+  return;
+}
+
+static int SecureFlag = 0;
+static int ServerFlag = 0;
+
+/*
+ * Routines for setting/getting security settings
+ */
+void set_secure() {
+  SecureFlag = 1;
+}
+
+int FORTRAN(is_secure)() {
+  return SecureFlag;
+}
+/*
+ * Routines for setting/getting server settings
+ */
+void set_server() {
+  ServerFlag = 1;
+  /* Should always be line buffered */
+  setvbuf(stdout, NULL, _IOLBF, 0);
+  setvbuf(stderr, NULL, _IOLBF, 0);
+}
+
+int FORTRAN(is_server)() {
+  return ServerFlag;
+}
+
diff --git a/fer/ccr/ferret_query.c b/fer/ccr/ferret_query.c
new file mode 100644
index 0000000..8a8b19b
--- /dev/null
+++ b/fer/ccr/ferret_query.c
@@ -0,0 +1,155 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/*
+*	ferret_query - C routine to query state information from FERRET 
+*
+* TMAP interactive data analysis program
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*/
+
+/*
+* revision history:
+*   11/16/94 - updated to use macro declarations from ferret_shared_buffer.h
+*   
+*   05/25/95 - added ifdef check for trailing underscores not needed on HP *kob*
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "ferret_shared_buffer.h"
+
+/* function prototype for FORTRAN routine */
+/* added ifdef for necessity of trailing underscores *kob* */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#    ifdef _NO_PROTO
+void ferret_query_f( );
+#    else
+void ferret_query_f( int *query, int *flags, int *nflags,
+		      char *text, int *ntext,
+		      int *numStrings, int *numNumbers,
+		      double *nums, int *ncoord,
+		      char *arg1, char *arg2, char *arg3,
+		      char *arg4, char *arg5,
+		      int *status );
+#    endif
+#else                              /*NO_ENTRY_NAME_UNDERSCORES*/
+#    ifdef _NO_PROTO
+void ferret_query_f_( );
+#    else
+void ferret_query_f_( int *query, int *flags, int *nflags,
+		      char *text, int *ntext,
+		      int *numStrings, int *numNumbers,
+		      double *nums, int *ncoord,
+		      char *arg1, char *arg2, char *arg3,
+		      char *arg4, char *arg5,
+		      int *status );
+#    endif
+#endif                             /*NO_ENTRY_NAME_UNDERSCORES*/
+
+#ifdef _NO_PROTO
+int ferret_query(query, sBuffer, arg1, arg2, arg3, arg4, arg5 )
+int query;
+smPtr sBuffer;
+char *arg1, *arg2, *arg3, *arg4, *arg5;
+
+#else
+int ferret_query(int query, smPtr sBuffer,
+		 char *arg1, char *arg2, char *arg3, char *arg4, char *arg5 )
+#endif
+{
+  int flag_buff_size  = NUMFLAGS;
+  int TEXTLENGTH_size  = TEXTLENGTH;
+  int NUMDOUBLES_size = NUMDOUBLES;
+
+  int status, i;
+
+/* diagnostic code */
+#ifdef QUERY_DEBUG
+  printf("Query number %d\n",query);
+  if ( arg1[0] ) printf("Arg 1 = %s\n",arg1);
+  if ( arg2[0] ) printf("Arg 2 = %s\n",arg2);
+  if ( arg3[0] ) printf("Arg 3 = %s\n",arg3);
+  if ( arg4[0] ) printf("Arg 4 = %s\n",arg4);
+  if ( arg5[0] ) printf("Arg 5 = %s\n",arg4);
+  *(sBuffer->text) = 'Q';
+#endif
+
+/* call the FORTRAN program that actually does the query */
+/* all arguments must be pointers for FORTRAN */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+  ferret_query_f
+#else
+  ferret_query_f_
+#endif
+                 ( &query, sBuffer->flags, &flag_buff_size,
+		   sBuffer->text, &TEXTLENGTH_size,
+		   &(sBuffer->numStrings), &(sBuffer->numNumbers),
+		   &(sBuffer->nums[0]), &NUMDOUBLES_size,
+		   arg1, arg2, arg3, arg4, arg5, &status );
+
+
+/* diagnostic code */
+#ifdef QUERY_DEBUG
+  for (i=0; i<NUMFLAGS; i++) printf("Flag %d is %d\n",i,sBuffer->flags[i]);
+  {
+    char *ptext = sBuffer->text;
+    while (*ptext) {
+      putchar((int) *ptext);
+      if (13 == (int) *ptext ) putchar('\n');
+      ptext++;
+    }
+  }
+/*  printf("Returned text:%s\n",sBuffer->text); */
+  printf("numStrings: %d\n",sBuffer->numStrings);
+  printf("numNumbers: %d\n",sBuffer->numNumbers);
+  for (i=0; i<sBuffer->numNumbers; i++) printf("Object %d is %g\n",i,
+					      sBuffer->nums[i]);
+#endif
+
+  return( status );
+}
+
diff --git a/fer/ccr/free_c_pointer.c b/fer/ccr/free_c_pointer.c
new file mode 100644
index 0000000..0587c6a
--- /dev/null
+++ b/fer/ccr/free_c_pointer.c
@@ -0,0 +1,50 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *   Free the memory associated with the passed pointer.
+ *   Pointer is passed by reference -- as per a FORTRAN subroutine call.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void free_c_pointer_(fer_ptr)
+     char*** fer_ptr;
+{
+   free(*fer_ptr);
+   *fer_ptr = NULL;
+}
diff --git a/fer/ccr/free_c_string_array.c b/fer/ccr/free_c_string_array.c
new file mode 100644
index 0000000..46a1830
--- /dev/null
+++ b/fer/ccr/free_c_string_array.c
@@ -0,0 +1,64 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ * *sh* 9/2000
+ * *sh* 6/01 - allow null pointers (free memory only if non-null)
+ * 
+ *   Free the string arrays pointed to by this Ferret variable 
+ *   Note: for portability the Ferret array is 8-byte
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void free_c_string_array_(fer_ptr, length)
+     char*** fer_ptr;
+     int* length;
+{
+   char** each_str_ptr = *fer_ptr;
+   int i;
+
+   /* free the individual strings */
+   for (i=0; i<*length; i++) {
+      if ( *each_str_ptr != NULL ) {
+         free(*each_str_ptr);
+         *each_str_ptr = NULL;
+      }
+      each_str_ptr += 8/sizeof(char**);
+   }
+   /* memory for the array itself is from Ferret's memory block */
+}
diff --git a/fer/ccr/get_c_string.c b/fer/ccr/get_c_string.c
new file mode 100644
index 0000000..e1946de
--- /dev/null
+++ b/fer/ccr/get_c_string.c
@@ -0,0 +1,59 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *  Return (copy) the null-terminated string to the array provided
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+void get_c_string_(ptr_ptr, outstring, maxlen)
+     char** ptr_ptr;
+     char* outstring;
+     int* maxlen;
+{
+    char *str1;
+
+   /* treats an undefined string the same as an empty string */
+   if ( *ptr_ptr == NULL )
+      str1 = "";
+   else
+      str1 = *ptr_ptr;
+
+   strncpy(outstring, str1, *maxlen);
+}
+
diff --git a/fer/ccr/get_c_string_len.c b/fer/ccr/get_c_string_len.c
new file mode 100644
index 0000000..e033d9b
--- /dev/null
+++ b/fer/ccr/get_c_string_len.c
@@ -0,0 +1,53 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *  Return the length of the null-terminated string as given by FORTRAN.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+int get_c_string_len_(ptr_ptr)
+     char** ptr_ptr;
+{
+   /* treats an undefined string the same as an empty string */
+   if ( *ptr_ptr == NULL )
+      return 0;
+
+   return (int)strlen(*ptr_ptr);
+}
+
diff --git a/fer/ccr/get_max_c_string_len.c b/fer/ccr/get_max_c_string_len.c
new file mode 100644
index 0000000..6b2259d
--- /dev/null
+++ b/fer/ccr/get_max_c_string_len.c
@@ -0,0 +1,65 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *  Return the maximum length of the array of null-terminated strings
+ *  as given by FORTRAN.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+int get_max_c_string_len_(fer_ptr, nstr)
+     char*** fer_ptr;
+     int* nstr;
+{
+   char** each_str_ptr;
+   int max=0;
+   int i, slen;
+
+   each_str_ptr = *fer_ptr;   /* holds pointer to the first string */
+
+   for (i = 0; i < *nstr; i++) {
+      if ( *each_str_ptr != NULL ) {
+         slen = strlen(*each_str_ptr);
+         if (slen > max) max = slen;
+      }
+      each_str_ptr += 8/sizeof(char**);
+   }
+
+   return max;
+}
+
diff --git a/fer/ccr/get_offset_c_string.c b/fer/ccr/get_offset_c_string.c
new file mode 100644
index 0000000..c57c6f3
--- /dev/null
+++ b/fer/ccr/get_offset_c_string.c
@@ -0,0 +1,70 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ *  Return (copy) the null-terminated string to the array provided,
+ *  converting to blank-terminated strings.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+
+void get_offset_c_string_(fer_ptr, offset, outstring, maxlen)
+     char*** fer_ptr;
+     int* offset;
+     char* outstring;
+     int* maxlen;
+{
+   char** each_str_ptr;
+   char* str_ptr;
+   int i = 0;
+
+   /* treats an undefined string (in the array) the same as an empty string */
+   each_str_ptr = *fer_ptr;   /* holds pointer to the first string */
+   each_str_ptr += *offset * 8/sizeof(char**); /* point to the desired strng */ 
+   str_ptr = *each_str_ptr;
+
+   /* copy the characters of the string, itself, up to maxlen */
+   if ( str_ptr != NULL ) {
+      while ( (i < *maxlen) && (*str_ptr != '\0') ) {
+         outstring[i++] = *(str_ptr++);
+      }
+   }
+
+   /* pad the remainder with blanks */
+   while ( i < *maxlen ) {
+      outstring[i++] = ' ';
+   }
+}
+
diff --git a/fer/ccr/get_offset_c_string_len.c b/fer/ccr/get_offset_c_string_len.c
new file mode 100644
index 0000000..4f9904e
--- /dev/null
+++ b/fer/ccr/get_offset_c_string_len.c
@@ -0,0 +1,59 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ * Return the length of the null-terminated string as given by FORTRAN.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+int get_offset_c_string_len_(fer_ptr, offset)
+     char*** fer_ptr;
+     int* offset;
+{
+   char** each_str_ptr;
+
+   /* treats an undefined string the same as an empty string */
+   each_str_ptr = *fer_ptr;   /* holds pointer to the first string */
+   each_str_ptr += *offset * 8/sizeof(char**);  /* point to the desired strng */ 
+
+   if ( *each_str_ptr == NULL )
+      return 0;
+
+   return (int)strlen(*each_str_ptr);
+}
+
diff --git a/fer/ccr/get_sys_cmnd.c b/fer/ccr/get_sys_cmnd.c
new file mode 100644
index 0000000..93e12f0
--- /dev/null
+++ b/fer/ccr/get_sys_cmnd.c
@@ -0,0 +1,180 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/*
+ * execute the passed command string and append the lines of input to the
+ * array of strings supplied
+ * V530  9/00 *sh*
+ *
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+void get_sys_cmnd_(fer_ptr, nlines, cmd, stat)
+     char*** fer_ptr; /* output: char** pointer to strings */
+     int* nlines; /* output: number of strings read */
+     char* cmd; /* input: the shell command to execute */
+     int* stat;
+{
+    char** sarray;
+    int linebufsize =  BUFSIZ;  /* initial size of input line buffer */
+    char* buf;
+    char* newbuf;
+    char** newsarray;
+    FILE *fpipe;
+    char* pmnt;
+    int nincr  = 0;  /* lines read in in this increment of the sarray */
+    int i, slen;
+    int incomplete;  /* if buffer is too small for some input line */
+    int increment = BUFSIZ;  /* extend length of char** ptr next by this */
+    int last_increment = increment;
+
+    /* initialize */
+    *nlines = 0;
+    *stat = 0;
+
+    /*
+     * Use calloc for sarray to initialize everything to NULL pointers
+     * for Ferret's string arrays.
+     */
+    sarray = (char **) calloc(BUFSIZ, sizeof(char *));
+    if ( sarray == NULL ) {
+       *stat = 1;
+       return;
+    }
+
+    buf = (char *) malloc(sizeof(char) * linebufsize);
+    if ( buf == NULL ) {
+       free(sarray);
+       *stat = 1;
+       return;
+    }
+
+    fpipe = popen(cmd, "r");
+    if ( fpipe != NULL ) {
+
+       /* read one newline-terminated input line */
+       while ( fgets(buf, linebufsize, fpipe) != NULL ) {
+          slen = strlen(buf);
+          incomplete = buf[slen-1] != '\n';
+          if (incomplete) {
+             /* line buffer wasn't large enough --> allocate more */
+             while (incomplete) {
+                linebufsize += BUFSIZ;
+                newbuf = (char *) realloc(buf, sizeof(char) * linebufsize);
+                if ( newbuf == NULL ) {
+                   free(buf);
+                   for (i = 0; i < *nlines; i++)
+                      free(sarray[i]);
+                   free(sarray);
+                   *stat = 1;
+                   return;
+                }
+                buf = newbuf;
+                if (fgets(buf+slen, BUFSIZ, fpipe) != 0) {
+                   slen = strlen(buf);
+                   incomplete = buf[slen-1] != '\n';
+                }
+                else
+                   incomplete = 0;
+             }
+          }
+          buf[slen-1] = 0;  /* remove newline */
+
+          /* make and save a permanent copy of the input line */
+          /* BUG FIX *kob* v552 - need to add one to string length for null */
+          pmnt = (char *) malloc(sizeof(char) * (int)(strlen(buf)+1));
+          if ( pmnt == NULL ) {
+             free(buf);
+             for (i = 0; i < *nlines; i++)
+                free(sarray[i]);
+             free(sarray);
+             *stat = 1;
+             return;
+          }
+          strcpy(pmnt, buf);
+          if ( nincr == last_increment ) {
+             /* double the length of the string pointer array */
+             last_increment = increment;
+             increment *= 2;
+             newsarray = (char **) realloc(sarray, sizeof(char *) * increment);
+             if ( newsarray == NULL ) {
+                free(buf);
+                for (i = 0; i < *nlines; i++)
+                   free(sarray[i]);
+                free(sarray);
+                free(pmnt);
+                *stat = 1;
+                return;
+             }
+             sarray = newsarray;
+             /* Initialize new string pointer to NULL for Ferret's string arrays. */
+             for (i = *nlines; i < increment; i++)
+                sarray[i] = NULL;
+             nincr = 0;
+          }
+          sarray[(*nlines)++] = pmnt; 
+          nincr++;
+       }
+
+       /* done with the pipe */
+       pclose(fpipe);
+    }
+
+    /* buf no longer needed */
+    free(buf);
+
+    /* always return at least one string (avoid FORTRAN probs) */
+    /* *kob* v552 - bug fix - still need to allocate space for the null string */
+    if (*nlines == 0 ) {
+       pmnt = (char *) malloc(sizeof(char));
+       if ( pmnt == NULL ) {
+          free(sarray);
+          *stat = 1;
+          return;
+       }
+       *pmnt = 0;
+       sarray[0] = pmnt;
+       *nlines = 1;
+    }
+
+    /* Return the char** pointer */
+    *fer_ptr = sarray;
+    return;
+}
+
diff --git a/fer/ccr/gui_init.c b/fer/ccr/gui_init.c
new file mode 100644
index 0000000..c61a7a3
--- /dev/null
+++ b/fer/ccr/gui_init.c
@@ -0,0 +1,64 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*
+ * Init gui dependent code
+ * JS 3.99
+ *
+ *
+ *  *acm*  1/12 Ferret 6.8 ifdef double_p for double-precision ferret. Define dp_gui_get_memory
+ *  *kms*  3/12 Removed XWindow GUI code which is no longer used.
+ */
+
+/*  *acm*  1/12     - Ferret 6.8 ifdef double_p for double-precision ferret. Define dp_gui_get_memory */
+
+#include <Python.h> /* make sure Python.h is first */
+#include "ferret.h"
+
+static DFTYPE *mem;
+
+int gui_init(void) {
+    return 0;
+}
+
+DFTYPE **gui_get_memory(void) {
+    return &mem;
+}
+
+void gui_run(int *argc, char **argv){
+    ;
+}
+
diff --git a/fer/ccr/init_c_string_array.c b/fer/ccr/init_c_string_array.c
new file mode 100644
index 0000000..826cded
--- /dev/null
+++ b/fer/ccr/init_c_string_array.c
@@ -0,0 +1,61 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ *  Save the address of Ferrets "memory(1,mr_blk1(mr))" as the contents
+ *  of fer_ptr
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void init_c_string_array_(length, mr_blk1, fer_ptr)
+     int* length;
+     char** mr_blk1;
+     char*** fer_ptr;
+{
+   int i;
+   char** ptr;
+
+   /* save the pointer */
+   *fer_ptr = mr_blk1;
+
+   /* good house-keepping */
+   ptr = mr_blk1;
+   for (i=0; i<*length; i++) {
+      *ptr = NULL;
+      ptr += (8/sizeof(char**));
+   }
+}
diff --git a/fer/ccr/linux_routines_c.c b/fer/ccr/linux_routines_c.c
new file mode 100644
index 0000000..6e0c36f
--- /dev/null
+++ b/fer/ccr/linux_routines_c.c
@@ -0,0 +1,50 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+/*
+ * Routine needed only for linux.  nag F90 didn't have a perror routine,
+ * so the c version of it is called.
+ *
+ * kob 3/97
+ */
+         
+void linux_perror_(char *string)
+{
+  perror(string);
+}
diff --git a/fer/ccr/list.c b/fer/ccr/list.c
new file mode 100644
index 0000000..3c8eebe
--- /dev/null
+++ b/fer/ccr/list.c
@@ -0,0 +1,485 @@
+/* list.c -- a generic list package
+ * 
+ * Last edited: Tue Jul 28 15:37:24 1992 by bcs (Bradley C. Spatz) on wasp
+ *
+ * Copyright (C) 1992, Bradley C. Spatz, bcs at ufl.edu
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * We define the following routines here:
+ *
+ *    LIST *list_init()
+ *    LIST *list_mvprev(list)
+ *    LIST *list_mvnext(list)
+ *    char *list_insert_before(list, data, bytes)
+ *    char *list_insert_after(list, data, bytes)
+ *    char *list_remove_front(list)
+ *    char *list_remove_curr(list)
+ *    char *list_remove_rear(list)
+ *    int list_traverse(list, data, func, opts);
+ *    void list_free(list, dealloc)
+ *
+ * and the following here or in list.h if USE_MACROS defined for compilation.
+ *
+ *    char *list_front(list)
+ *    char *list_curr(list)
+ *    char *list_rear(list)
+ *    LIST *list_mvfront(list)
+ *    LIST *list_mvrear(list)
+ *    int list_size(list)
+ *    int list_empty(list)
+ *
+ * for
+ *
+ *    LIST *list;
+ *    char *data;
+ *    int bytes;
+ *    int func(data, curr)
+ *       char *data;
+ *       char *curr;
+ *    void dealloc(data)
+ *       char *data;
+ */
+
+static char brag[] = "$$Version: list-2.1 Copyright (C) 1992 Bradley C. Spatz";
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "list.h"
+
+
+LIST *list_init(void)
+{
+   LIST *list;
+
+   /* Allocate, initialize, and return a new list. */
+   list = (LIST *) malloc(sizeof(LIST));
+   list->size = 0;
+   list->front = NULL;;
+   list->rear = NULL;;
+   list->curr = NULL;;
+   return(list);
+}
+
+
+LIST *list_mvprev(LIST *list)
+{
+   /* Move to the previous link, if possible.  Note that the following
+    * compound conditional expression *requires* a short-circuit evaluation.
+    */
+   if ((list->curr != NULL) && (list->curr->prev != NULL)) {
+      list->curr = list->curr->prev;
+      return(list);
+   }
+   else
+      return(NULL);
+}
+
+
+LIST *list_mvnext(LIST *list)
+{
+   /* Move to the next link, if possible.  Note that the following
+    * compound conditional expression *requires* a short-circuit evaluation.
+    */
+   if ((list->curr != NULL) && (list->curr->next != NULL)) {
+      list->curr = list->curr->next;
+      return(list);
+   }
+   else
+      return(NULL);
+}
+
+
+/* The following are definitions of these routines as functions.  We can
+ * force thse to be implemented as macros by compiling with -DUSE_MACROS.
+ * The macros are defined in the header file(s).  The macros afford better
+ * performance, and if users know the routines are implemented as such,
+ * they can always wrap their own functions aroud the macros if they need
+ * function semantics (i.e. using the routines as pointers, as in passing
+ * the routines as parameters to other functions.
+ *
+ * #ifndef USE_MACROS 
+ * Macros no longer in header file.
+ */
+LIST *list_mvfront(LIST *list)
+{
+   /* Move to the front of the list.*/
+   list->curr = list->front;
+   return(list);
+}
+
+
+LIST *list_mvrear(LIST *list)
+{
+   /* Move to the front of the list.*/
+   list->curr = list->rear;
+   return(list);
+}
+
+
+int list_empty(LIST *list)
+{
+   /* Return 1 if the list is empty.  0 otherwise. */
+   return((list->front == NULL) ? TRUE : FALSE);
+}
+
+
+char *list_front(LIST *list)
+{
+   return((list->front == NULL) ? NULL : (list->front->data));
+}
+
+
+char *list_curr(LIST *list)
+{
+   return((list->curr == NULL) ? NULL : (list->curr->data));
+}
+
+
+char *list_rear(LIST *list)
+{
+   return((list->rear == NULL) ? NULL : (list->rear->data));
+}
+
+
+int list_size(LIST *list)
+{
+   return(list->size);
+}
+
+/*
+ * #endif
+ */
+
+static LIST_ELEMENT *list_create_element(char *data, int bytes)
+{
+   LIST_ELEMENT *new;
+
+   /* Allocate storage for the new node and its data.  Return NULL if
+    * unable to allocate.
+    */
+   new = (LIST_ELEMENT *) malloc(sizeof(LIST_ELEMENT));
+   if (new == NULL) {
+      return(NULL);
+   }
+
+   /* Allocate storage for the data only if requested; i.e. if bytes > 0.
+    * Then either copy the data or just the reference into the node.
+    */
+   if (bytes > 0) {
+      new->data = (char *) malloc(bytes);
+      if (new->data == NULL) {
+	 return(NULL);
+      }
+      (void) memcpy(new->data, data, bytes);
+   }
+   else {
+      new->data = (char *) data;
+   }
+
+   return(new);
+}
+
+
+char *list_insert_before(LIST *list, char *data, int bytes)
+{
+   LIST_ELEMENT *new;
+
+   /* Allocate storage for the new element and its data.*/
+   new = list_create_element(data, bytes);
+   if (new == NULL)
+      return(NULL);
+
+   /* Now insert the element before the current, considering the cases:
+    *    1) List is empty
+    *    2) Inserting at front
+    *    3) Otherwise
+    * We handle them directly, in order.
+    */
+   if (list->front == NULL) {
+      /* The list is empty.  Easy. */
+      new->prev = new->next = NULL;
+      list->front = list->rear = list->curr = new;
+   }
+   else if (list->curr->prev == NULL) {
+      /* Inserting at the front. */
+      new->prev = NULL;
+      new->next = list->curr;
+      list->curr->prev = new;
+      list->front = new;
+   }
+   else {
+      /* Otherwise. */
+      new->prev = list->curr->prev;
+      list->curr->prev->next = new;
+      new->next = list->curr;
+      list->curr->prev = new;
+   }
+
+   list->curr = new;
+   list->size++;
+   return(new->data);
+}
+
+
+char *list_insert_after(LIST *list, char *data, int bytes)
+{
+   LIST_ELEMENT *new;
+
+   /* Allocate storage for the new element and its data.*/
+   new = list_create_element(data, bytes);
+   if (new == NULL)
+      return(NULL);
+
+   /* Now insert the element after the current, considering the cases:
+    *    1) List is empty
+    *    2) Inserting at rear
+    *    3) Otherwise
+    * We handle them directly, in order.
+    */
+   if (list->front == NULL) {
+      /* The list is empty.  Easy. */
+      new->prev = new->next = NULL;
+      list->front = list->rear = list->curr = new;
+   }
+   else if (list->curr->next == NULL) {
+      /* Inserting at the rear. */
+      new->next = NULL;
+      new->prev = list->curr;
+      list->curr->next = new;
+      list->rear = new;
+   }
+   else {
+      /* Otherwise. */
+      new->next = list->curr->next;
+      new->next->prev = new;
+      new->prev = list->curr;
+      list->curr->next = new;
+   }
+
+   list->curr = new;
+   list->size++;
+   return(new->data);
+}
+
+
+static char *list_remove_single(LIST *list)
+{
+   char *data;
+
+   /* The list has one element.  Easy. */
+   data = list->curr->data;
+   free(list->curr);
+   list->front = list->rear = list->curr = NULL;
+   list->size--;
+   return (data);
+}
+
+
+char *list_remove_front(LIST *list)
+{
+   LIST_ELEMENT *temp;
+   char *data;
+
+   /* Removing and return front element, or NULL if empty.  If curr
+    * is the front, then curr becomes the next element.
+    */
+   if (list->front == NULL) {
+      /* List is empty.  Easy. */
+      return(NULL);
+   }
+   else if (list->front == list->rear) {
+      /* List has only one element.  Easy. */
+      data = list_remove_single(list);
+   }
+   else {
+      /* List has more than one element.  Make sure to check if curr
+       * points to the front.
+       */
+      data = list->front->data;
+      list->front->next->prev = NULL;
+      temp = list->front;
+      list->front = temp->next;
+      if (list->curr == temp)
+	 list->curr = temp->next;
+      free(temp);
+      list->size--;
+   }
+
+   return(data);
+}
+
+
+char *list_remove_rear(LIST *list)
+{
+   LIST_ELEMENT *temp;
+   char *data;
+
+   /* Removing and return rear element, or NULL if empty.  If curr
+    * is the rear, then curr becomes the previous element.
+    */
+   if (list->front == NULL) {
+      /* List is empty.  Easy. */
+      return(NULL);
+   }
+   else if (list->front == list->rear) {
+      /* List has only one element.  Easy. */
+      data = list_remove_single(list);
+   }
+   else {
+      /* List has more than one element.  Make sure to check if curr
+       * points to the rear.
+       */
+      data = list->rear->data;
+      list->rear->prev->next = NULL;
+      temp = list->rear;
+      list->rear = temp->prev;
+      if (list->curr == temp)
+	 list->curr = temp->prev;
+      free(temp);
+      list->size--;
+   }
+
+   return(data);
+}
+
+
+char *list_remove_curr(LIST *list)
+{
+   LIST_ELEMENT *temp;
+   char *data;
+
+   /* Remove the current element, returning a pointer to the data, or
+    * NULL if the list is empty.  Set curr to the next element unless
+    * curr is at the rear, in which case curr becomes the previous
+    * element.
+    */
+   if (list->front == NULL) {
+      /* The list is empty.  Easy. */
+      return(NULL);
+   }
+   else if (list->front == list->rear) {
+      /* The list has one element.  Easy. */
+      data = list_remove_single(list);
+   }
+   else if (list->curr == list->front) {
+      /* Removing front element.  Easy. */
+      data = list_remove_front(list);
+   }
+   else if (list->curr == list->rear) {
+      /* Removing from the rear.  Easy.*/
+      data = list_remove_rear(list);
+   }
+   else {
+      /* Otherwise.  Must be inside a 3-element or larger list. */
+      data = list->curr->data;
+      temp = list->curr;
+      temp->next->prev = temp->prev;
+      temp->prev->next = temp->next;
+      list->curr = temp->next;
+      free(temp);
+      list->size--;
+   }
+
+   return(data);
+}
+
+
+int list_traverse(LIST *list, char *data, int (*func)(char *, char *), int opts)
+{
+   LIST_ELEMENT *lp;
+   int status, rc;
+
+   /* Traverse the list according to opts, calling func at each element,
+    * until func returns 0 or the extent of the list is reached.  We return
+    * 0 if the list is empty, 2 if we tried to go beyond the extent of the
+    * list, and 1 otherwise.  We may or may not affect the current element
+    * pointer.
+    */
+   if (list->front == NULL)
+      return(LIST_EMPTY);
+   
+   /* Decide where to start. */
+   if ((opts & LIST_CURR) == LIST_CURR) {
+      lp = list->curr;
+   }
+   else if ((opts & LIST_REAR) == LIST_REAR) {
+      lp = list->rear;
+   }
+   else {
+      lp = list->front;
+   }
+   
+   /* Now decide if to update the current element pointer. */
+   if ((opts & LIST_ALTR) == LIST_ALTR)
+      list->curr = lp;
+
+   /* Now go until 0 is returned or we hit the extent of the list. */
+   rc = LIST_OK;
+   status = TRUE;
+   while(status) {
+      status = (*func)(data, lp->data);
+      if (status) {
+	 if ((((opts & LIST_BACK) == LIST_BACK) ? (lp->prev) : (lp->next))
+	     == NULL) {
+	    /* Tried to go beyond extent of list. */
+	    status = FALSE;
+	    rc = LIST_EXTENT;
+	 }
+	 else {
+	    /* Decide where to go next. */
+	    lp = (((opts & LIST_BACK) == LIST_BACK) ? (lp->prev) : (lp->next));
+
+	    /* Now decide if to update the current element pointer. */
+	    if ((opts & LIST_ALTR) == LIST_ALTR)
+	       list->curr = lp;
+	 }
+      }
+   }
+
+   return(rc);
+}
+
+
+void list_free(LIST *list, void (*dealloc)(char *))
+{
+   char *data;
+
+   /* Move to the front of the list.  Start removing elements from the
+    * front.  Free up the data element by either applying the user-supplied
+    * deallocation routine or free(3).  When we've gone through all the
+    * elements, free the list descriptor.
+    */
+   list_mvfront(list);
+   while (! list_empty(list)) {
+      data = list_remove_front(list);
+      /* Apply either no deallocation function to each node, our own, or
+       * a user-supplied version.
+       */
+      if ( dealloc != LIST_NODEALLOC ) {
+	 if ( dealloc == LIST_DEALLOC ) {
+	    free(data);
+	 }
+	 else {
+	    (*dealloc)(data);
+	 }
+      }
+   }
+
+   free(list);
+}
diff --git a/fer/ccr/perl_read.c b/fer/ccr/perl_read.c
new file mode 100644
index 0000000..52952ff
--- /dev/null
+++ b/fer/ccr/perl_read.c
@@ -0,0 +1,23 @@
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <stdlib.h>
+#include "ferret.h"
+#include "binaryRead.h"
+
+int FORTRAN(pl_read_var)(DFTYPE *mem, int *lengths){
+  return 0;
+}
+
+void FORTRAN(pl_get_error)(char *buf) {
+}
+
+int FORTRAN(pl_open)(char *script_name) {
+  fprintf(stderr, "Attempt to use pl_open with Perl disabled\n");
+  exit(1);
+  return -1;
+}
+
+int FORTRAN(pl_close)() {
+  return -1;
+}
+
diff --git a/fer/ccr/replace_bad_data_sub.c b/fer/ccr/replace_bad_data_sub.c
new file mode 100644
index 0000000..4743bdc
--- /dev/null
+++ b/fer/ccr/replace_bad_data_sub.c
@@ -0,0 +1,79 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*
+ * replace_bad_data_sub.c :
+ *  replace the missing value if it is either NaN, or if it is equal to
+ *  the old bad value
+ *
+ * *kob* - 2/18/99
+ * v553 *kob* - if the new_bad is NaN, we need to replace any possible
+ *              NaN's in the data, and also swap the old and new bad.  This 
+ *              could happen if use did a set var/bad=nan - new feature
+ * *acm*  1/12 - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *              definition of macro DFTYPE in ferret.h
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <math.h>
+#include "ferret.h"
+
+void FORTRAN(replace_bad_data_sub)( DFTYPE *old_bad, DFTYPE *src, 
+			   int *size, DFTYPE *new_bad )
+
+{
+  int i;
+  double tmp;
+  
+  if (isnan(*old_bad)) {
+    for (i=0; i<*size; i++)
+      if (isnan(src[i])) src[i] = *new_bad;
+  } 
+  else if (isnan(*new_bad)) {
+    for (i=0; i<*size; i++) {
+      if (isnan(src[i])) {
+	src[i] = *old_bad;
+      }
+    }
+    *new_bad = *old_bad;
+  }
+  else {
+    for (i=0; i<*size; i++) {
+      if (src[i] == *old_bad) src[i] = *new_bad;
+    }
+  }
+}
+
diff --git a/fer/ccr/replaceable_bad_flags.c b/fer/ccr/replaceable_bad_flags.c
new file mode 100644
index 0000000..1abc411
--- /dev/null
+++ b/fer/ccr/replaceable_bad_flags.c
@@ -0,0 +1,63 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*
+ * replaceable_bad_flags :
+ *  check for a missing or bad value flag of NaN.  if either flag is Nan,
+ *  or if the flags differ, return a true. otherwise, if both flags are the 
+ *  same and not NaN, no need to replace them, so return a false
+ *
+ * *kob* - 2/18/99 
+ * *acm*  1/12 - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *              definition of macro DFTYPE in ferret.h
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <math.h>
+#include "ferret.h"
+
+int FORTRAN(replaceable_bad_flags)(bad1, bad2)
+     DFTYPE *bad1, *bad2;
+
+{
+  if (isnan(*bad1) || isnan(*bad2))
+    return 1; 
+  else if (*bad1 != *bad2)
+    return 1;
+  else
+    return 0;
+
+}
diff --git a/fer/ccr/run_thredds_browser.c b/fer/ccr/run_thredds_browser.c
new file mode 100644
index 0000000..34b2c49
--- /dev/null
+++ b/fer/ccr/run_thredds_browser.c
@@ -0,0 +1,277 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "run_thredds_browser.h"
+
+/*
+ * Interface to the FORTRAN function:
+ * INTEGER FUNCTION RUN_THREDDS_BROWSER(DATASET_NAME, ERR_WARN_MSG)
+ *         CHARACTER*(*) DATASET_NAME, ERR_WARN_MSG
+ * where the return value is the actual length of the name in DATASET_NAME
+ * if successful, 0 if canceled, -1 if error.  (See runThreddsBrowser)
+ * Assumes DATASET_NAME and ERR_WARN_MSG are blank-filled when passed
+ * to this function.  Does not do bounds checking.
+ *
+ * Assumes Holerith strings are passed as a char array with a max string 
+ * length appended to the end of the argument list.  Also assumes the C 
+ * name is the single underscore appended to the lower-cased FORTRAN name.
+ */
+int run_thredds_browser_(char dataset_name[], char err_warn_msg[], int max_len_dataset_name, int max_len_err_warn_msg) {
+    int len_dataset_name;
+
+    /* Run the browser */
+    len_dataset_name = runThreddsBrowser(dataset_name, err_warn_msg);
+
+    /* Replace the null terminators with blanks */
+    dataset_name[strlen(dataset_name)] = ' ';
+    err_warn_msg[strlen(err_warn_msg)] = ' ';
+
+    /* Return the return value from runThreddsBrowser */
+    return len_dataset_name;
+}
+
+/*
+ * Verifies access to Java 6 or later (version 1.6+) and runs the ThreddsBrowser Java 
+ * application.  Writes the dataset name output from ThreddsBrowser to datasetName and 
+ * any warning messages are written to errWarn.  The length of datasetName is returned.
+ * If the user cancels out of the ThreddsBrowser, datasetName is empty and zero is 
+ * returned.  If an error occurs, datasetName is empty, -1 is returned and an error 
+ * message is written to errWarn.
+ *
+ * Requires the environment variable FER_LIBS and the jar files
+ * ${FER_LIBS}/threddsBrowser.jar (from the ThreddsBrowser Java project) and
+ * ${FER_LIBS}/toolsUI.jar (from http://www.unidata.ucar.edu/software/netcdf-java/)
+ */
+int runThreddsBrowser(char datasetName[], char errWarn[]) {
+    char *envVal;
+    char  javaExeName[FILENAME_MAX];
+    int   version;
+    char  errMsg[256];
+    char  classPath[2*FILENAME_MAX];
+    char *argvStack[5];
+    FILE *pipeFile;
+    pid_t childPid;
+    char  output[2*FILENAME_MAX];
+    char *strptr;
+
+    datasetName[0] = '\0';
+    errWarn[0] = '\0';
+
+    /* Check if JAVA_HOME is defined and reasonable */
+    envVal = getenv("JAVA_HOME");
+    if ( envVal != NULL ) {
+        snprintf(javaExeName, FILENAME_MAX, "%s/bin/java", envVal);
+        version = getJavaVersion(javaExeName, errMsg);
+        if ( version == -1 ) {
+            strcat(errWarn, errMsg);
+            strcat(errWarn, "WARNING: Ignoring environment variable JAVA_HOME (invalid path)\n");
+            envVal = NULL;
+       }
+        else if ( version < 6 ) {
+            strcat(errWarn, "WARNING: Ignoring environment variable JAVA_HOME (java version too old)\n");
+            envVal = NULL;
+        }
+    }
+
+    /* JAVA_HOME either undefined or unacceptable, so try java without a path */
+    if ( envVal == NULL ) {
+        strcpy(javaExeName, "java");
+        version = getJavaVersion(javaExeName, errMsg);
+        if ( version == -1 ) {
+            strcat(errWarn, errMsg);
+        }
+        if ( version < 6 ) {
+            strcat(errWarn, "ERROR: unable to find version 6 (or later) of Java\n");
+            return -1;
+        }
+    }
+
+    /* Create the class path for the jar files needed */
+    envVal = getenv("FER_LIBS");
+    if ( envVal == NULL ) {
+        strcat(errWarn, "ERROR: environment variable FER_LIBS is not defined\n");
+        return -1;
+    }
+    snprintf(classPath, 2*FILENAME_MAX, "%s/threddsBrowser.jar:%s/toolsUI.jar", envVal, envVal);
+
+    /* Run the ThreddsBrowser application */
+    argvStack[0] = javaExeName;
+    argvStack[1] = "-classpath";
+    argvStack[2] = classPath;
+    argvStack[3] = "gov.noaa.pmel.ferret.threddsBrowser.ThreddsBrowser";
+    argvStack[4] = NULL;
+
+    pipeFile = executableOutput(argvStack, &childPid, errMsg);
+    if ( pipeFile == NULL ) {
+        strcat(errWarn, errMsg);
+        return -1;
+    }
+
+    /* Get the dataset name */
+    while ( fgets(output, 2*FILENAME_MAX, pipeFile) != NULL ) {
+        if ( strncmp(output, "USE \"", 5) == 0 ) {
+            /* get the contents between the double quotes */
+            strptr = strrchr(output, '"');
+            if ( strptr > output + 4 ) {
+                *strptr = '\0';
+                strcpy(datasetName, output + 5);
+            }
+        }
+        else {
+           strcat(errWarn, output);
+        }
+    }
+
+    /* Close the read end of the pipe and reap the child process */
+    fclose(pipeFile);
+    waitpid(childPid, NULL, 0);
+
+    return strlen(datasetName);
+}
+
+/*
+ * Return the Java version of the given java executable.  The version is obtained
+ * from parsing the output from running the java executable with the "-version"
+ * flag.  So a version string of "1.5.0_05" will return 5 and "1.6.0_20" will return 6.
+ * If an error occurs, -1 is returned and an error message is written to errMsg.
+ */
+int getJavaVersion(char javaExeName[], char errMsg[]) {
+    char *argvStack[3];
+    FILE *pipeFile;
+    pid_t childPid;
+    char  output[FILENAME_MAX];
+    int   versionNum;
+    int   major, minor, revision, build;
+
+    /* Run this java executable with the -version flag */
+    argvStack[0] = javaExeName;
+    argvStack[1] = "-version";
+    argvStack[2] = NULL;
+    pipeFile = executableOutput(argvStack, &childPid, errMsg);
+    if ( pipeFile == NULL ) {
+        return -1;
+    }
+
+    /* Get the version number string - note that this is printed to stderr */
+    versionNum = -1;
+    while ( fgets(output, FILENAME_MAX, pipeFile) != NULL ) {
+        if ( sscanf(output, "java version \"%d.%d.%d_%d", &major, &minor, &revision, &build) == 4 ) {
+            /* if 1.x, the version is the x */
+            if ( major == 1 ) {
+                versionNum = minor;
+            }
+        }
+    }
+
+    /* Close the read end of the pipe and reap the child process */
+    fclose(pipeFile);
+    waitpid(childPid, NULL, 0);
+
+    if ( versionNum == -1 )
+        strcpy(errMsg, "Unable to interpret the Java version\n");
+    return versionNum;
+}
+
+/*
+ * Forks off a child process that becomes the executable given by exeArgv,
+ * which matches the argv array given as the second argument to execvp.
+ * The first argument to execvp will be exeArgv[0].  On success, the PID of
+ * the child process will be returned in childPidPtr, and a FILE is returned
+ * from which the combined stdout and stderr output of the execuable can be
+ * read.  On error, NULL is returned, the value in childPidPtr is unchanged,
+ * an error message is written to errMsg, and any child process which might
+ * have been created has been killed using SIGTERM and reaped.
+ */
+FILE *executableOutput(char *exeArgv[], pid_t *childPidPtr, char errMsg[]) {
+    int   fildes[2];
+    pid_t childPid;
+    FILE *outFile;
+
+    if ( pipe(fildes) != 0 ) {
+        sprintf(errMsg, "Unable to create a pipe: %s\n", strerror(errno));
+        return NULL;
+    }
+
+    childPid = fork();
+    if ( childPid < 0 ) {
+        /* error - this is the parent and there is no child */
+        sprintf(errMsg, "Unable to fork off a child process: %s\n", strerror(errno));
+        close(fildes[0]);
+        close(fildes[1]);
+        return NULL;
+    }
+
+    if ( childPid == 0 ) {
+        /* child which never returns - close the read end of the pipe */
+        close(fildes[0]);
+
+        /* redirect stdout and stderr to the writing end of the pipe */
+        if ( (dup2(fildes[1], 1) < 0) || (dup2(fildes[1], 2) < 0) )
+            exit(1);
+
+        /* become the program given in argsStack */
+        execvp(exeArgv[0], exeArgv);
+
+        /* if execvp returns, an error has occurred */
+        exit(1);
+    }
+
+    /* parent - close the write end of the pipe */
+    close(fildes[1]);
+
+    /* create a FILE wrapping the reading end of the pipe */
+    outFile = fdopen(fildes[0], "r");
+    if ( outFile == NULL ) {
+        sprintf(errMsg, "Unable to create a FILE from a pipe file descriptor: %s\n", strerror(errno));
+        kill(childPid, SIGTERM);
+        waitpid(childPid, NULL, 0);
+        close(fildes[0]);
+        return NULL;
+    }
+
+    /* parent records the child pid and returns a FILE wrapping the reading end of the pipe to the child */
+    *childPidPtr = childPid;
+    return outFile;
+}
+
diff --git a/fer/ccr/run_thredds_browser.h b/fer/ccr/run_thredds_browser.h
new file mode 100644
index 0000000..9eac361
--- /dev/null
+++ b/fer/ccr/run_thredds_browser.h
@@ -0,0 +1,21 @@
+#ifndef RUNTHREDDSBROWSER_H_
+#define RUNTHREDDSBROWSER_H_
+
+#include <Python.h> /* make sure Python.h is alway first */
+#include <sys/types.h>
+#include <stdio.h>
+
+/* 
+ * Interface to the FORTRAN function:
+ * INTEGER FUNCTION RUN_THREDDS_BROWSER(DATASET_NAME, ERR_WARN_MSG)
+ *         CHARACTER*(*) DATASET_NAME, ERR_WARN_MSG
+ */
+extern int run_thredds_browser_(char dataset_name[], char err_warn_msg[], 
+                                int max_len_data_set, int max_len_err_warn_msg);
+
+/* Standard C functions */
+extern int   runThreddsBrowser(char datasetName[], char errWarn[]);
+extern int   getJavaVersion(char javaExeName[], char errMsg[]);
+extern FILE *executableOutput(char *exeArgv[], pid_t *childPidPtr, char errMsg[]);
+
+#endif /* RUNTHREDDSBROWSER_H_ */
diff --git a/fer/ccr/save_arg_pointers.c b/fer/ccr/save_arg_pointers.c
new file mode 100644
index 0000000..70f576e
--- /dev/null
+++ b/fer/ccr/save_arg_pointers.c
@@ -0,0 +1,134 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/*
+ * save_arg_pointers.c
+ *
+ * Cache pointers passed from FORTRAN.
+ * Later these pointers can be used to access the arrays in SUBROUTINES
+ * which did not get these args passed.
+ *
+ * programmer - steve hankin
+ * NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+ *
+ * revision 0.0 - 3/5/97
+ * 3/05 *acm* - new routines for SHADE/MOD curvilinear data: 
+ *              curv_coord_add and curv_coord_range
+ * 1/12 *acm* - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *              definition of macro DFTYPE in ferret.h
+ */
+
+#include "ferret.h"
+ 
+/* global cache pointer */
+DFTYPE *xpos_cache, *ypos_cache;
+
+void FORTRAN(save_arg_pointers)( DFTYPE *xpos_arr, DFTYPE *ypos_arr )
+
+{
+  extern DFTYPE *xpos_cache, *ypos_cache;
+  xpos_cache = xpos_arr;
+  ypos_cache = ypos_arr;
+
+  return;
+}
+
+/*******************/
+
+/* prototype for FORTRAN subroutine to be called */
+void FORTRAN(curv_coord_sub) ( DFTYPE *xi, DFTYPE *yi, int *n,
+                      DFTYPE *xpos_cache, DFTYPE *ypos_cache,
+                      DFTYPE *xinv, DFTYPE *yinv, int *status );
+
+/* prototype for FORTRAN subroutine to be called */
+void FORTRAN(curv_coord_add_sub) ( DFTYPE *xi, DFTYPE *yi, int *n,
+                      DFTYPE *xpos_cache, DFTYPE *ypos_cache,
+                      DFTYPE *xinv, DFTYPE *yinv, DFTYPE *xadd,
+		              int *first, int*xfield_is_modulo, int *status );
+
+/* prototype for FORTRAN subroutine to be called */
+void FORTRAN(curv_coord_range_sub) ( DFTYPE *uc, DFTYPE *xpos_cache, DFTYPE *ypos_cache, 
+                      int *ilo, int *ihi, int *jlo, int *jhi, 
+		      int *status );
+
+/*******************/
+
+/* curv_coord: this routine, called from FORTRAN, will make the
+arrays of X and Y positions available
+ */
+
+void FORTRAN(curv_coord)(DFTYPE *xi, DFTYPE *yi, int *n,
+		DFTYPE *xinv, DFTYPE *yinv, int *status)
+
+{
+  extern DFTYPE *xpos_cache, *ypos_cache;
+  FORTRAN(curv_coord_sub)( xi, yi, n, xpos_cache, ypos_cache, xinv, yinv, status );
+  return;
+}
+
+/*******************/
+
+/* curv_coord_add: this routine, called from FORTRAN, will make the
+arrays of X and Y positions available, with an offset in the X coords
+*/
+
+void FORTRAN(curv_coord_add)(DFTYPE *xi, DFTYPE *yi, int *n,
+		 DFTYPE *xinv, DFTYPE *yinv, DFTYPE *xadd, int *first, int*xfield_is_modulo, int *status)
+
+{
+  extern DFTYPE *xpos_cache, *ypos_cache;
+  FORTRAN(curv_coord_add_sub)(  xi, yi, n, xpos_cache, ypos_cache, xinv, yinv, xadd, first, xfield_is_modulo, status );
+
+  return;
+}
+
+/*******************/
+
+/* curv_coord_range: this routine, called from FORTRAN, will compute
+   range within Y coordinates actually needed for the vlimits 
+   that were requested (x may be modulo so we need full range).
+ */
+
+void FORTRAN(curv_coord_range)(DFTYPE *uc, int *ilo, int *ihi, int *jlo, int *jhi, int *status)
+
+{
+  extern DFTYPE *xpos_cache, *ypos_cache;
+  FORTRAN(curv_coord_range_sub)(uc, xpos_cache, ypos_cache, ilo, ihi, jlo, jhi, status );
+
+  return;
+}
diff --git a/fer/ccr/save_c_string.c b/fer/ccr/save_c_string.c
new file mode 100644
index 0000000..49e7050
--- /dev/null
+++ b/fer/ccr/save_c_string.c
@@ -0,0 +1,72 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *   Allocate dynamic memory and save a string returning the pointer to it
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void save_c_string_(string, inlen, fer_ptr, offset, stat)
+     char* string;
+     int* inlen;
+     char*** fer_ptr;
+     int* offset;
+     int* stat;
+{
+   int i;
+   char* ptr;
+   char** each_str_ptr;
+
+   ptr = (char *) malloc(sizeof(char) * (*inlen + 1));
+   if ( ptr != NULL ) {
+      for (i=0; i<*inlen; i++)
+         ptr[i] = string[i];
+      ptr[*inlen] = '\0';
+      
+      /* save the pointer to the string */
+      each_str_ptr = *fer_ptr;   /* holds pointer to the first string */
+      each_str_ptr += *offset * 8/sizeof(char**); /* point to the desired string */ 
+      if ( *each_str_ptr != NULL )
+         free( *each_str_ptr );
+      *each_str_ptr = ptr;
+
+      *stat = 0;
+   }
+   else
+      *stat = 1;
+}
diff --git a/fer/ccr/set_nan.c b/fer/ccr/set_nan.c
new file mode 100644
index 0000000..b29b1af
--- /dev/null
+++ b/fer/ccr/set_nan.c
@@ -0,0 +1,77 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*
+ * set_nan.c:
+ *
+ *  set a float (or double) value to NaN - needed for the command
+ *      set variable/bad=nan var_name
+ *
+ *  kob - 05/03
+ * v600  4/06 *acm* - Change set_nan from a float function to void, passing
+ *                    back the result as an argument. Needed for port to 64-bit 
+ * *acm*  1/12 - Ferret 6.8 ifdef double_p for double-precision ferret,
+ *               see the definition of macro DFTYPE in ferret.h 
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <signal.h>
+#include <stdio.h>
+#include <math.h>
+#include "ferret.h"
+
+void FORTRAN(set_nan) (DFTYPE *val)
+{
+  sigset_t block_fpe;
+
+  /* initialize the signal mask */
+  sigemptyset(&block_fpe);
+  sigaddset(&block_fpe, SIGFPE); 
+
+  /* block SIGFPE so we don't have problems generating NaN */
+  sigprocmask(SIG_BLOCK, &block_fpe, NULL); 
+
+  /* calculating the inverse hyperbolic cosine of a value less
+     than 1 will result in NaN - seems better than doing a divide
+     by 0 */
+  *val = acosh(.2);  
+  /*val = 1./0.; */
+
+  /* unblock SIGFPE */
+  sigprocmask(SIG_UNBLOCK, &block_fpe, NULL); 
+
+  return;
+}
diff --git a/fer/ccr/set_null_c_string.c b/fer/ccr/set_null_c_string.c
new file mode 100644
index 0000000..c7ee430
--- /dev/null
+++ b/fer/ccr/set_null_c_string.c
@@ -0,0 +1,55 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+ * V533 *sh* 6/01 
+ *
+ * Allocate storage for null string and set into Ferret string array
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void set_null_c_string_(out_ptr)
+     char** out_ptr;
+{
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+
+   *out_ptr = (char *) malloc(sizeof(char));
+   if ( *out_ptr == NULL )
+      abort();
+   **out_ptr = '\0';
+}
diff --git a/fer/ccr/set_null_c_string_array.c b/fer/ccr/set_null_c_string_array.c
new file mode 100644
index 0000000..d473d5b
--- /dev/null
+++ b/fer/ccr/set_null_c_string_array.c
@@ -0,0 +1,62 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *   Fill the indicated region of memory with pointers to null strings
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void set_null_c_string_array_(fer_ptr, nstr)
+     char*** fer_ptr;
+     int* nstr;
+{
+   char** each_str_ptr;
+   int i;
+
+   each_str_ptr = *fer_ptr;   /* holds pointer to the first string */
+
+   for (i=0; i<*nstr; i++) {
+      if ( *each_str_ptr != NULL )
+         free(*each_str_ptr);
+      *each_str_ptr = (char *) malloc(sizeof(char));
+      if ( *each_str_ptr == NULL )
+         abort();
+      **each_str_ptr = '\0';
+
+      each_str_ptr += 8/sizeof(char**);
+   }
+}
diff --git a/fer/ccr/sizeof_pointer.c b/fer/ccr/sizeof_pointer.c
new file mode 100644
index 0000000..0079214
--- /dev/null
+++ b/fer/ccr/sizeof_pointer.c
@@ -0,0 +1,45 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *  return the size (in units of bytes) of a pointer to a character
+ */
+
+int sizeof_pointer_()
+{
+  return (int) sizeof(char*);
+}
+
diff --git a/fer/ccr/write_dods.c b/fer/ccr/write_dods.c
new file mode 100644
index 0000000..35738cc
--- /dev/null
+++ b/fer/ccr/write_dods.c
@@ -0,0 +1,170 @@
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <netinet/in.h> /* for htonl; header probably varies by platform */
+#include <assert.h>
+
+/*
+ * if clobber == 0, open filename for overwriting.
+ * if clobber == 1, open filename for appending
+ * if swap == 0, just write the data as is.
+ * if swap == 1, byte-swap the data, then write it.
+ *
+ * write length to file twice, followed by data, all
+ * in network byte order (big-endian)
+ *
+ * returns 0 for success, non-zero for error
+ * (sets Unix errno, see strerror for error messages)
+ * Richard Rogers 9/03
+ * Ansley Manke 9/03  Make inputs all pointers, send in length of
+ *                    filename string; put filename in new ptr
+ *                    variable. (As in save_c_string.c)
+
+ * Richard Rogers 10/15/03  fixed potential memory leak, check for
+ *                          malloc failure, added some assertions,
+ *                          use bulk-write if not byte swapping, use
+ *                          strncpy to copy non-NULL terminated filename,
+ *                          #include <netinet/in.h> for htonl, added
+ *                          write_dods_double_
+
+ * Richard Rogers 10/28/03  added #include<string.h> for strncpy,
+ *                          fixed bug in error handling
+ *                          NOTE: rr 10/28/03 The length parameter is 
+ *                          passed as a signed int, while fwrite() 
+ *                          appears to return an unsigned int. That's 
+ *                          fine as long as length is less than 2e31.
+ */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+int write_dods_(char*filename, int* slen, int *clobber, int *swap, 
+                int *length, float *data) 
+{
+  FILE *f;
+  int i, length_n, result = 0;
+  char* fileptr;
+
+  union {
+    int i;
+    float f;
+  } hack;
+
+  assert(filename);
+  assert(sizeof(int) == 4);  /* should be true for majority of platforms */
+  assert(sizeof(float) == 4);
+
+  /* allocate memory and save the filename to null-terminated string */
+
+  if ( fileptr = (char *) malloc(sizeof(char) * (*slen + 1) ) ) {
+    strncpy (fileptr, filename, *slen);
+    fileptr[*slen] = 0;    /* null-terminate the stored string */
+  } else goto cleanup;
+
+  if (*clobber)
+    f = fopen (fileptr, "wb");
+  else
+    f = fopen (fileptr, "ab");
+  if (!f) goto cleanup;
+
+  length_n = htonl(*length);
+  if (fwrite ((const void *) &length_n, sizeof(int), 1, f) != 1)
+    goto cleanup;
+  if (fwrite ((const void *) &length_n, sizeof(int), 1, f) != 1)
+    goto cleanup;
+
+  if (*swap) {
+    for (i=0; i < *length; i+=1) {
+      hack.f = data[i];
+      hack.i = htonl(hack.i);
+      if (fwrite ((const void *) &(hack.f), sizeof(float), 1, f) != 1)
+        goto cleanup;
+    }
+  } else {
+    if (fwrite ((const void *) data, sizeof(float), *length, f) != *length)
+      goto cleanup;
+  }
+
+cleanup:
+  if (fileptr) free(fileptr);
+  result = errno;
+  if (f) {
+    if (errno) {             /* preserve original error even if close fails */
+      fclose (f);
+    } else {               
+      if (fclose (f))
+	result = errno;      /* return the error from close */
+    }
+  }
+  return result;
+}
+
+
+int write_dods_double_(char*filename, int* slen, int *clobber, int *swap, 
+                       int *length, double *data) 
+{
+  FILE *f;
+  int i, length_n, result = 0;
+  char* fileptr;
+
+  union {
+    int i[2];
+    double d;
+  } hack;
+
+  assert(filename);
+  assert(sizeof(int) == 4);
+  assert(sizeof(double) == 8);
+
+  /* allocate memory and save the filename to null-terminated string */
+
+  if ( fileptr = (char *) malloc(sizeof(char) * (*slen + 1) ) ) {
+    strncpy (fileptr, filename, *slen);
+    fileptr[*slen] = 0;    /* null-terminate the stored string */
+  } else goto cleanup;
+
+  if (*clobber)
+    f = fopen (fileptr, "wb");
+  else
+    f = fopen (fileptr, "ab");
+  if (!f) goto cleanup;
+
+  length_n = htonl(*length);
+  if (fwrite ((const void *) &length_n, sizeof(int), 1, f) != 1)
+    goto cleanup;
+  if (fwrite ((const void *) &length_n, sizeof(int), 1, f) != 1)
+    goto cleanup;
+
+  if (*swap) {
+    for (i=0; i < *length; i+=1) {
+      int t;
+      hack.d = data[i];
+      t = hack.i[0];
+      hack.i[0] = htonl(hack.i[1]);
+      hack.i[1] = htonl(t);
+      if (fwrite ((const void *) &(hack.d), sizeof(double), 1, f) != 1)
+        goto cleanup;
+    }
+  } else {
+    if (fwrite ((const void *) data, sizeof(double), *length, f) != *length)
+      goto cleanup;
+  }
+
+cleanup:
+  if (fileptr) free(fileptr);
+  result = errno;
+  if (f) {
+    if (errno) {             /* preserve original error even if close fails */
+      fclose (f);
+    } else {               
+      if (fclose (f))
+	result = errno;      /* return the error from close */
+    }
+  }
+  return result;
+}
diff --git a/fer/ccr/xfer_c_ptrs.c b/fer/ccr/xfer_c_ptrs.c
new file mode 100644
index 0000000..b378804
--- /dev/null
+++ b/fer/ccr/xfer_c_ptrs.c
@@ -0,0 +1,68 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+
+/* 
+ *  Copy pointer values from the source array of pointers to the destination
+ *  Pointer may be spaced "naturally" (_del=0) or at 8 byte intervals (_del=1).
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void xfer_c_ptrs_(src_ptr, src_del, src_offset,
+		  dst_ptr, dst_del, dst_offset, nptr)
+     char*** src_ptr;
+     int* src_del;
+     int* src_offset;
+     char*** dst_ptr;
+     int* dst_del;
+     int* dst_offset;
+     int* nptr;
+{
+   int src_delta = *src_del ? 8/sizeof(char**) : 1;
+   int dst_delta = *dst_del ? 8/sizeof(char**) : 1;
+   char** src = *src_ptr + (*src_offset * src_delta) ;
+   char** dst = *dst_ptr + (*dst_offset * dst_delta) ;
+   int i;
+
+   for (i=0; i<*nptr; i++) {
+      if ( *dst != NULL )
+         free(*dst);
+      *dst = *src;
+      src += src_delta;
+      dst += dst_delta;
+   }
+}
diff --git a/fer/cferbind/Makefile b/fer/cferbind/Makefile
new file mode 100644
index 0000000..d1251a6
--- /dev/null
+++ b/fer/cferbind/Makefile
@@ -0,0 +1,39 @@
+#
+# Makefile for Ferret bindings written in C
+#
+
+include ../../site_specific.mk
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+LIBNAME = ../../lib/libcferbind.a
+CHDRS = $(wildcard *.h) ../grdel/grdel.h
+CSRCS = $(wildcard *.c)
+COBJS = $(CSRCS:.c=.o)
+
+.PHONY : all
+all : optimized
+
+# The -I$(CAIRO_DIR)/include/cairo is only needed for older cairo's (1.2) own include files
+
+.PHONY : optimized
+optimized :
+	$(MAKE) "CFLAGS = $(CFLAGS) -I$(CAIRO_DIR)/include/cairo -Wall -Wno-pointer-to-int-cast -Werror -DNDEBUG -O" $(LIBNAME)
+
+.PHONY : debug
+debug :
+	$(MAKE) "CFLAGS = $(CFLAGS) -I$(CAIRO_DIR)/include/cairo -Wall -Wno-pointer-to-int-cast -Werror -O0 -g" $(LIBNAME)
+
+$(LIBNAME) : $(COBJS)
+	$(AR) $(ARFLAGS) $(LIBNAME) $(COBJS)
+	$(RANLIB) $(LIBNAME)
+
+$(COBJS) : $(CHDRS)
+
+.PHONY : clean
+clean :
+	rm -f *.o $(LIBNAME)
+
+#
+# End of Makefile
+#
+
diff --git a/fer/cferbind/cairoCFerBind.h b/fer/cferbind/cairoCFerBind.h
new file mode 100644
index 0000000..2d035a1
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind.h
@@ -0,0 +1,171 @@
+#ifndef CAIRO_CFERBIND_H_
+#define CAIRO_CFERBIND_H_
+
+/* Make sure Python.h is always included first */
+#include <Python.h>
+#include <cairo/cairo.h>
+/* Use of grdelBool (int) and grdelType (void *) is just to clarify intent */
+#include "grdel.h"
+
+/* Size of filename string arrays */
+#define CCFB_NAME_SIZE 512
+
+/* DPI to use for the Cairo "Window" */
+#define CCFB_WINDOW_DPI 96
+
+/* Factor for converting pixels to points */
+#define CCFB_POINTS_PER_PIXEL (72.0 / (double) CCFB_WINDOW_DPI)
+
+typedef enum CCFBImageFormat_enum {
+    CCFBIF_PNG = 0,
+    CCFBIF_PDF,
+    CCFBIF_PS,
+    CCFBIF_SVG,
+    CCFBIF_REC,
+} CCFBImageFormat;
+
+typedef struct CCFBSides_struct {
+    double left;
+    double right;
+    double top;
+    double bottom;
+} CCFBSides;
+
+extern const char *CCFBColorId;
+typedef struct CCFBColor_Struct {
+    const char *id;
+    double redfrac;
+    double greenfrac;
+    double bluefrac;
+    double opaquefrac;
+} CCFBColor;
+
+extern const char *CCFBPenId;
+typedef struct CCFBPen_Struct {
+    const char *id;
+    CCFBColor color;
+    double width;
+    int    numdashes;
+    double dashes[8];
+    cairo_line_cap_t captype;
+    cairo_line_join_t jointype;
+} CCFBPen;
+
+extern const char *CCFBBrushId;
+typedef struct CCFBBrush_Struct {
+    const char *id;
+    CCFBColor color;
+    cairo_pattern_t *pattern;
+} CCFBBrush;
+
+/* Structure for creating a linked list of image or recording surfaces */
+typedef struct CCFBPicture_Struct {
+    struct CCFBPicture_Struct *next;
+    cairo_surface_t *surface;
+    int segid;
+} CCFBPicture;
+
+typedef struct CairoCFerBindData_struct {
+    /* image size in pixels */
+    int imagewidth;
+    int imageheight;
+    int minsize;
+    /* clearing color */
+    CCFBColor lastclearcolor;
+    /* image filename and format */
+    char imagename[CCFB_NAME_SIZE];
+    CCFBImageFormat imageformat;
+    /* Anti-alias non-text elements? */
+    int antialias;
+    /* Use colors with an alpha channel (ARGB32)? */
+    int usealpha;
+    /* data for recreating the current view */
+    CCFBSides fracsides;
+    int clipit;
+    /* Scaling factor for line widths, symbol sizes, and font sizes */
+    double widthfactor;
+    /* Linked list of image or recording surfaces, with segment IDs */
+    CCFBPicture *firstpic;
+    CCFBPicture *lastpic;
+    int segid;
+    /*
+     * The current surface and context.  These are not created until 
+     * a view is created and drawing is about to begin.  Ferret will 
+     * modify the above values, possibly multiple times, prior to the 
+     * start of drawing.
+     */
+    cairo_surface_t *surface;
+    cairo_t *context;
+    /* Flag that something has been drawn to the current surface */
+    int somethingdrawn;
+    /*
+     * Flag that something about the image has changed since the last 
+     * update.  Only really used by the PipedImager/PyQtCairo engine.
+     */
+    int imagechanged;
+    /*
+     * The image displayer.
+     * Only assigned and used by the PipedImager/PyQtCairo engine.
+     */
+    grdelType viewer;
+} CairoCFerBindData;
+
+grdelBool cairoCFerBind_setImageName(CFerBind *self, const char *imagename,
+                        int imgnamelen, const char *formatname, int fmtnamelen);
+grdelBool cairoCFerBind_createSurface(CFerBind *self);
+grdelBool cairoCFerBind_deleteWindow(CFerBind *self);
+grdelBool cairoCFerBind_setAntialias(CFerBind *self, int antialias);
+grdelBool cairoCFerBind_beginView(CFerBind *self, double lftfrac, double btmfrac,
+                                  double rgtfrac, double topfrac, int clipit);
+grdelBool cairoCFerBind_clipView(CFerBind *self, int clipit);
+grdelBool cairoCFerBind_endView(CFerBind *self);
+grdelBool cairoCFerBind_beginSegment(CFerBind *self, int segid);
+grdelBool cairoCFerBind_endSegment(CFerBind *self);
+grdelBool cairoCFerBind_deleteSegment(CFerBind *self, int segid);
+grdelBool cairoCFerBind_updateWindow(CFerBind *self);
+grdelBool cairoCFerBind_clearWindow(CFerBind *self, grdelType fillcolor);
+grdelBool cairoCFerBind_redrawWindow(CFerBind *self, grdelType fillcolor);
+grdelBool cairoCFerBind_windowScreenInfo(CFerBind *self, float *dpix, float *dpiy,
+                                         int *screenwidth, int *screenheight);
+grdelBool cairoCFerBind_resizeWindow(CFerBind *self, double width, double height);
+grdelBool cairoCFerBind_scaleWindow(CFerBind *self, double scale);
+grdelBool cairoCFerBind_showWindow(CFerBind *self, int visible);
+grdelBool cairoCFerBind_saveWindow(CFerBind *self, const char *filename, int namelen,
+                                   const char *formatname, int fmtnamelen, int transbkg,
+                                   double xinches, double yinches, 
+                                   int xpixels, int ypixels,
+                                   void **annotations, int numannotations);
+grdelType cairoCFerBind_createColor(CFerBind *self, double redfrac,
+                        double greenfrac, double bluefrac, double opaquefrac);
+grdelBool cairoCFerBind_deleteColor(CFerBind *self, grdelType color);
+grdelType cairoCFerBind_createFont(CFerBind *self, const char *familyname, int namelen,
+                        double fontsize, int italic, int bold, int underlined);
+grdelBool cairoCFerBind_deleteFont(CFerBind *self, grdelType font);
+grdelType cairoCFerBind_createPen(CFerBind *self, grdelType color, double width,
+                                  const char *style, int stlen, const char *capstyle,
+                                  int capstlen, const char *joinstyle, int joinstlen);
+grdelBool cairoCFerBind_replacePenColor(CFerBind *self,
+                                        grdelType pen, grdelType color);
+grdelBool cairoCFerBind_deletePen(CFerBind *self, grdelType pen);
+grdelType cairoCFerBind_createBrush(CFerBind *self, grdelType color,
+                                    const char *style, int stlen);
+grdelBool cairoCFerBind_replaceBrushColor(CFerBind *self,
+                                          grdelType brush, grdelType color);
+grdelBool cairoCFerBind_deleteBrush(CFerBind *self, grdelType brush);
+grdelType cairoCFerBind_createSymbol(CFerBind *self, const char *symbolname, int namelen);
+grdelBool cairoCFerBind_deleteSymbol(CFerBind *self, grdelType symbol);
+grdelBool cairoCFerBind_setWidthFactor(CFerBind *self, double widthfactor);
+grdelBool cairoCFerBind_drawMultiline(CFerBind *self, double ptsx[], double ptsy[],
+                                      int numpts, grdelType pen);
+grdelBool cairoCFerBind_drawPoints(CFerBind *self, double ptsx[], double ptsy[],
+                                   int numpts, grdelType symbol, grdelType color,
+                                   double symsize);
+grdelBool cairoCFerBind_drawPolygon(CFerBind *self, double ptsx[], double ptsy[],
+                                    int numpts, grdelType brush, grdelType pen);
+grdelBool cairoCFerBind_drawRectangle(CFerBind *self, double left, double bottom,
+                        double right, double top, grdelType brush, grdelType pen);
+grdelBool cairoCFerBind_drawText(CFerBind *self, const char *text, int textlen,
+                                 double startx, double starty, grdelType font,
+                                 grdelType color, double rotation);
+
+#endif
diff --git a/fer/cferbind/cairoCFerBind_beginSegment.c b/fer/cferbind/cairoCFerBind_beginSegment.c
new file mode 100644
index 0000000..5b938ed
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_beginSegment.c
@@ -0,0 +1,50 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Starts a "Segment" for this "Window".
+ * A "Segment" is a group of drawing commands.
+ *
+ * Arguments:
+ *     segid  - ID for this segment.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_beginSegment(CFerBind *self, int segid)
+{
+    CairoCFerBindData *instdata;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_beginSegment: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Ignore this call if not an image or recording surface */
+    if ( (instdata->imageformat != CCFBIF_PNG) &&
+         (instdata->imageformat != CCFBIF_REC) ) {
+        return 1;
+    }
+     
+    /* If something drawn, create that picture with the old segment ID */
+    if ( instdata->somethingdrawn ) {
+        if ( ! cairoCFerBind_endView(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+
+    /* assign the new segment ID to use */
+    instdata->segid = segid;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_beginView.c b/fer/cferbind/cairoCFerBind_beginView.c
new file mode 100644
index 0000000..297d73e
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_beginView.c
@@ -0,0 +1,67 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Starts a "View" for this "Window".
+ * In this case (Cairo), assigns the clipping rectangle
+ * that may be used for the subsequent drawings.
+ *
+ * Arguments:
+ *     lftfrac - view left edge as a fraction [0.0, 1.0) of the window size
+ *     btmfrac - view bottom edge as a fraction (0.0, 1.0] of the window size
+ *     rgtfrac - view right edge as a fraction (0.0, 1.0] of the window size
+ *     topfrac - view top edge as a fraction [0.0, 1.0) of the window size
+ *     clipit  - value passed to cairoCFerBind_clipView
+ *               (clip drawing to this view rectangle?)
+ *
+ * The fractions are from the top left corner; thus lftfrac must be less than
+ * rgtfrac and topfrac must be less than btmfrac.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_beginView(CFerBind *self, double lftfrac, double btmfrac,
+                                  double rgtfrac, double topfrac, int clipit)
+{
+    CairoCFerBindData *instdata;
+    int result;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_beginView: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Verify valid view fractions */
+    if ( (0.0 > lftfrac) || (lftfrac >= rgtfrac) || (rgtfrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_beginView: invalid left (%#.3f) "
+                             "and/or right (%#.3f) fractions", lftfrac, rgtfrac);
+        return 0;
+    }
+    if ( (0.0 > topfrac) || (topfrac >= btmfrac) || (btmfrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_beginView: invalid top (%#.3f) "
+                             "and/or bottom (%#.3f) fractions", topfrac, btmfrac);
+        return 0;
+    }
+
+    /* Assign the view rectangle fractions */
+    instdata->fracsides.left = lftfrac;
+    instdata->fracsides.bottom = btmfrac;
+    instdata->fracsides.right = rgtfrac;
+    instdata->fracsides.top = topfrac;
+
+    /* Assign clipping */
+    result = self->clipView(self, clipit);
+
+    return result;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_clearWindow.c b/fer/cferbind/cairoCFerBind_clearWindow.c
new file mode 100644
index 0000000..a2e6fcf
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_clearWindow.c
@@ -0,0 +1,76 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * "Clears the Window".
+ *
+ * This function destroys any existing surface and context if
+ * anything has been drawn.  The clearing color is assigned to
+ * the given color; however, the clearing color is only used
+ * as the background color in raster images if transparency is
+ * not desired.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_clearWindow(CFerBind *self, grdelType fillcolor)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+    CCFBPicture *delpic;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_clearWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    colorobj = (CCFBColor *) fillcolor;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_clearWindow: unexpected error, "
+                            "fillcolor is not CCFBColor struct");
+        return 0;
+    }
+
+    /* If something was drawn, delete the context and surface */
+    if ( instdata->somethingdrawn ) {
+        if ( instdata->context == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_clearWindow: unexpected error, "
+                                "something drawn without a context");
+            return 0;
+        }
+        if ( instdata->surface == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_clearWindow: unexpected error, "
+                                "something drawn without a surface");
+            return 0;
+        }
+        cairo_destroy(instdata->context);
+        instdata->context = NULL;
+        cairo_surface_finish(instdata->surface);
+        cairo_surface_destroy(instdata->surface);
+        instdata->surface = NULL;
+        instdata->somethingdrawn = 0;
+    }
+
+    /* Delete any stored pictures */
+    while ( instdata->firstpic != NULL ) {
+        delpic = instdata->firstpic;
+        instdata->firstpic = delpic->next;
+        cairo_surface_finish(delpic->surface);
+        cairo_surface_destroy(delpic->surface);
+        PyMem_Free(delpic);
+    }
+    instdata->lastpic = NULL;
+
+    /* Copy the given color structure values to lastclearcolor */
+    instdata->lastclearcolor = *colorobj;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_clipView.c b/fer/cferbind/cairoCFerBind_clipView.c
new file mode 100644
index 0000000..a7ec1f1
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_clipView.c
@@ -0,0 +1,71 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Turns on or off clipping of subsequent drawing to the current
+ * view rectangle.
+ *
+ * Arguments:
+ *     clipit - clip drawing to the current view rectangle?
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_clipView(CFerBind *self, int clipit)
+{
+    CairoCFerBindData *instdata;
+    double left, bottom, right, top;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_clipView: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    instdata->clipit = clipit;
+
+    if ( instdata->context == NULL ) {
+        /* No context yet, so done */
+        return 1;
+    }
+
+    /* Clear any clipping rectangle that may be present in the context */
+    cairo_reset_clip(instdata->context);
+
+    /* If no clipping desired, done */
+    if ( ! clipit )
+        return 1;
+
+    /*
+     * Convert the view fractions to positions on the surface.
+     * No need to revalidate these positions since they are
+     * floating-point values.
+     */
+    left = instdata->fracsides.left * instdata->imagewidth;
+    right = instdata->fracsides.right * instdata->imagewidth;
+    top = instdata->fracsides.top * instdata->imageheight;
+    bottom = instdata->fracsides.bottom * instdata->imageheight;
+    if ( instdata->imageformat != CCFBIF_PNG ) {
+        left   *= CCFB_POINTS_PER_PIXEL;
+        right  *= CCFB_POINTS_PER_PIXEL;
+        top    *= CCFB_POINTS_PER_PIXEL;
+        bottom *= CCFB_POINTS_PER_PIXEL;
+    }
+
+    /* Create the clipping rectangle path */
+    cairo_new_path(instdata->context);
+    cairo_rectangle(instdata->context, left, top, right - left, bottom - top);
+
+    /* Assign the clipping rectangle, removing the above path */
+    cairo_clip(instdata->context);
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createBrush.c b/fer/cferbind/cairoCFerBind_createBrush.c
new file mode 100644
index 0000000..6a0b2b2
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createBrush.c
@@ -0,0 +1,90 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/* Instatiate the global value */
+const char *CCFBBrushId = "CCFBBrushId";
+
+/*
+ * Create a brush object for this "Window".
+ *
+ * Arguments:
+ *     color     - color for the brush
+ *     style     - name of the style of the brush (case-insensitive);
+ *                 currently, only "solid" is supported
+ *     stlen     - actual length of style
+ *
+ * Returns a brush object when successful.   If an error occurs,
+ * grdelerrmsg is assigned an appropriate error message and NULL
+ * is returned.
+ */
+grdelType cairoCFerBind_createBrush(CFerBind *self, grdelType color,
+                                    const char *style, int stlen)
+{
+    CCFBColor *colorobj;
+    CCFBBrush *brushobj;
+    int        k;
+    char       stname[16];
+    int        brushtype;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createBrush: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createBrush: unexpected error, "
+                            "color is not CCFBColor struct");
+        return NULL;
+    }
+
+    /*
+     * Interpret the style argument.  Just assign an integer value
+     * that will later be used to create the appropriate pattern.
+     */
+    for (k = 0; (k < stlen) && (k < 15); k++)
+        stname[k] = (char) tolower(style[k]);
+    stname[k] = '\0';
+    if ( strcmp(stname, "solid") == 0 )
+        brushtype = 0;
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createBrush: "
+                             "unknown brush style of '%s'", stname);
+        return NULL;
+    }
+
+    /* Create the brush object */
+    brushobj = (CCFBBrush *) PyMem_Malloc(sizeof(CCFBBrush));
+    if ( brushobj == NULL ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createBrush: "
+                            "out of memory for a CCFBBrush structure");
+        return NULL;
+    }
+    brushobj->id = CCFBBrushId;
+
+    /* Copy the color structure */
+    brushobj->color = *colorobj;
+
+    /* Assign the pattern attribute, if appropriate */
+    if ( brushtype == 0 ) {
+        /* solid - just use the color for the source */
+        brushobj->pattern = NULL;
+    }
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createBrush: unexpected error, "
+                             "unrecognized brushtype %d", brushtype);
+        PyMem_Free(brushobj);
+        return NULL;
+    }
+
+    return brushobj;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createColor.c b/fer/cferbind/cairoCFerBind_createColor.c
new file mode 100644
index 0000000..b31936d
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createColor.c
@@ -0,0 +1,76 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/* Instatiate the global value */
+const char *CCFBColorId = "CCFBColorId";
+
+/*
+ * Create a color object for this "Window".
+ *
+ * Arguments:
+ *     redfrac    - red fraction [0.0, 1.0]
+ *     greenfrac  - green fraction [0.0, 1.0]
+ *     bluefrac   - blue fraction [0.0, 1.0]
+ *     opaquefrac - opaque fraction [0.0, 1.0]
+ *                  (0.0 is transparent, 1.0 is opaque)
+ *
+ * Returns a color object if successful.   If an error occurs,
+ * grdelerrmsg is assigned an appropriate error message and NULL
+ * is returned.
+ */
+grdelType cairoCFerBind_createColor(CFerBind *self, double redfrac,
+                        double greenfrac, double bluefrac, double opaquefrac)
+{
+    CCFBColor *colorobj;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createColor: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    /* Verify valid fractions */
+    if ( (0.0 > opaquefrac) || (opaquefrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_createColor: "
+                             "invalid opaque fraction (%#.3f)", opaquefrac);
+        return NULL;
+    }
+    if ( (0.0 > redfrac) || (redfrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_createColor: "
+                             "invalid red fraction (%#.3f)", redfrac);
+        return NULL;
+    }
+    if ( (0.0 > greenfrac) || (greenfrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_createColor: "
+                             "invalid green fraction (%#.3f)", greenfrac);
+        return NULL;
+    }
+    if ( (0.0 > bluefrac) || (bluefrac > 1.0) ){
+        sprintf(grdelerrmsg, "cairoCFerBind_createColor: "
+                             "invalid blue fraction (%#.3f)", bluefrac);
+        return NULL;
+    }
+
+    colorobj = (CCFBColor *) PyMem_Malloc(sizeof(CCFBColor));
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createColor: "
+                            "out of memory for a CCFBColor structure");
+        return NULL;
+    }
+
+    colorobj->id = CCFBColorId;
+    colorobj->redfrac = redfrac;
+    colorobj->greenfrac = greenfrac;
+    colorobj->bluefrac = bluefrac;
+    colorobj->opaquefrac = opaquefrac;
+
+    return colorobj;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createFont.c b/fer/cferbind/cairoCFerBind_createFont.c
new file mode 100644
index 0000000..3f6ad2d
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createFont.c
@@ -0,0 +1,34 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Create a font object for this "Window".
+ *
+ * Currently stubbed since it is currently not used by Ferret;
+ * thus always fails.
+ *
+ * Returns a font object if successful.   If an error occurs,
+ * grdelerrmsg is assigned an appropriate error message and NULL
+ * is returned.
+ */
+grdelType cairoCFerBind_createFont(CFerBind *self, const char *familyname, int namelen,
+                        double fontsize, int italic, int bold, int underlined)
+{
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createFont: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    /* TODO: implement */
+    strcpy(grdelerrmsg, "cairoCFerBind_createFont: unexpected error, "
+                        "stubbed function");
+    return NULL;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createPen.c b/fer/cferbind/cairoCFerBind_createPen.c
new file mode 100644
index 0000000..2629b9e
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createPen.c
@@ -0,0 +1,176 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/* Instatiate the global value */
+const char *CCFBPenId = "CCFBPenId";
+
+/*
+ * Create a pen object for this "Window".
+ *
+ * Arguments:
+ *     color     - color for the pen
+ *     width     - line width of the pen in points (1/72 inches)
+ *     style     - name of the line style of the pen (case-insensitive);
+ *                 currently, one of "solid", "dash", "dot", "dashdot"
+ *     stlen     - actual length of style
+ *     capstyle  - name of the cap style of the pen (case-insensitive);
+ *                 currently, one of "butt", "round", "square"
+ *     capstlen  - actual length of capstyle
+ *     joinstyle - name of the join style of the pen (case-insensitive);
+ *                 currently, one of "miter", "round", "bevel"
+ *     joinstlen - actual length of joinstyle
+ *
+ * Returns a pen object when successful.   If an error occurs,
+ * grdelerrmsg is assigned an appropriate error message and NULL
+ * is returned.
+ */
+grdelType cairoCFerBind_createPen(CFerBind *self, grdelType color, double width,
+                                  const char *style, int stlen, const char *capstyle,
+                                  int capstlen, const char *joinstyle, int joinstlen)
+{
+    CCFBColor        *colorobj;
+    CCFBPen          *penobj;
+    int               k;
+    char              stname[16];
+    int               linetype;
+    cairo_line_cap_t  captype;
+    cairo_line_join_t jointype;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createPen: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createPen: unexpected error, "
+                            "color is not CCFBColor struct");
+        return NULL;
+    }
+
+    /*
+     * When drawing, the actual pen width is always at least 1 pixel;
+     * thus a width of exactly zero is always a 1 pixel wide.
+     */
+    if ( width < 0.0 ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_createPen: "
+                             "invalid line width of %#.1f", width);
+        return NULL;
+    }
+
+    /*
+     * Interpret the style argument.  Just assign an integer value
+     * that will later be used to create the appropriate dashes array.
+     */
+    for (k = 0; (k < stlen) && (k < 15); k++)
+        stname[k] = (char) tolower(style[k]);
+    stname[k] = '\0';
+    if ( strcmp(stname, "solid") == 0 )
+        linetype = 0;
+    else if ( strcmp(stname, "dash") == 0 )
+        linetype = 1;
+    else if ( strcmp(stname, "dot") == 0 )
+        linetype = 2;
+    else if ( strcmp(stname, "dashdot") == 0 )
+        linetype = 3;
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createPen: "
+                             "unknown line style of '%s'", stname);
+        return NULL;
+    }
+
+    /* Interpret the cap style */
+    for (k = 0; (k < capstlen) && (k < 15); k++)
+        stname[k] = (char) tolower(capstyle[k]);
+    stname[k] = '\0';
+    if ( strcmp(stname, "butt") == 0 )
+        captype = CAIRO_LINE_CAP_BUTT;
+    else if ( strcmp(stname, "round") == 0 )
+        captype = CAIRO_LINE_CAP_ROUND;
+    else if ( strcmp(stname, "square") == 0 )
+        captype = CAIRO_LINE_CAP_SQUARE;
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createPen: "
+                             "unknown line cap style of '%s'", stname);
+        return NULL;
+    }
+
+    /* Interpret the join style */
+    for (k = 0; (k < joinstlen) && (k < 15); k++)
+        stname[k] = (char) tolower(joinstyle[k]);
+    stname[k] = '\0';
+    if ( strcmp(stname, "miter") == 0 )
+        jointype = CAIRO_LINE_JOIN_MITER;
+    else if ( strcmp(stname, "round") == 0 )
+        jointype = CAIRO_LINE_JOIN_ROUND;
+    else if ( strcmp(stname, "bevel") == 0 )
+        jointype = CAIRO_LINE_JOIN_BEVEL;
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createPen: "
+                             "unknown line join style of '%s'", stname);
+        return NULL;
+    }
+
+    /* Create the pen object */
+    penobj = (CCFBPen *) PyMem_Malloc(sizeof(CCFBPen));
+    if ( penobj == NULL ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createPen: "
+                            "out of memory for a CCFBPen structure");
+        return NULL;
+    }
+    penobj->id = CCFBPenId;
+
+    /* Copy the color structure */
+    penobj->color = *colorobj;
+
+    /* Line width */
+    penobj->width = width;
+
+    /* Assign the appropriate dashes array in units of line widths */
+    switch( linetype ) {
+    case 0:
+        /* solid */
+        penobj->numdashes = 0;
+        break;
+    case 1:
+        /* dash */
+        penobj->dashes[0] = 8.0;
+        penobj->dashes[1] = 2.0;
+        penobj->numdashes = 2;
+        break;
+    case 2:
+        /* dot */
+        penobj->dashes[0] = 2.0;
+        penobj->dashes[1] = 2.0;
+        penobj->numdashes = 2;
+        break;
+    case 3:
+        /* dashdot */
+        penobj->dashes[0] = 8.0;
+        penobj->dashes[1] = 2.0;
+        penobj->dashes[2] = 2.0;
+        penobj->dashes[3] = 2.0;
+        penobj->numdashes = 4;
+        break;
+    default:
+        sprintf(grdelerrmsg, "cairoCFerBind_createPen: unexpected error, "
+                             "linetype of %d", linetype);
+        PyMem_Free(penobj);
+        return NULL;
+    }
+
+    /* Assign the cap and join types */
+    penobj->captype = captype;
+    penobj->jointype = jointype;
+
+    return penobj;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createSurface.c b/fer/cferbind/cairoCFerBind_createSurface.c
new file mode 100644
index 0000000..224e1a1
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createSurface.c
@@ -0,0 +1,189 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <cairo/cairo-pdf.h>
+#include <cairo/cairo-ps.h>
+#include <cairo/cairo-svg.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Creates the Cairo Surface and Context for this image.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_createSurface(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+    char  *fmtname;
+    double width;
+    double height;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createSurface: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Create the surface if it does not exist */
+    if ( instdata->surface == NULL ) {
+        /*
+         * Sanity check: the context includes the surface, but cairoCFerBind
+         * also maintains a separate reference to the surface; thus, if there
+         * is no surface, there should not be a context.
+         */
+        if ( instdata->context != NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_createSurface: unexpected error, "
+                                "NULL surface but non-NULL context");
+            return 0;
+        }
+
+        /* Create the appropriate surface */
+        switch( instdata->imageformat ) {
+        case CCFBIF_PNG:
+            /* Surface size is given in integer pixels */
+            instdata->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+                                      instdata->imagewidth, instdata->imageheight);
+            instdata->usealpha = 1;
+            /* Note that all surface values are initialized to zero (transparent) */
+            fmtname = "PNG";
+            break;
+        case CCFBIF_PDF:
+            /* Surface size is given in (floating-point) points */
+            width = (double) instdata->imagewidth * CCFB_POINTS_PER_PIXEL;
+            height = (double) instdata->imageheight * CCFB_POINTS_PER_PIXEL;
+            instdata->surface = cairo_pdf_surface_create(instdata->imagename,
+                                                         width, height);
+            instdata->usealpha = 0;
+            fmtname = "PDF";
+            break;
+        case CCFBIF_PS:
+            /* Surface size is given in (floating-point) points */
+            width = (double) instdata->imagewidth * CCFB_POINTS_PER_PIXEL;
+            height = (double) instdata->imageheight * CCFB_POINTS_PER_PIXEL;
+            if ( width > height ) {
+                /*
+                 * Landscape orientation
+                 * Swap width and height and then translate and rotate (see
+                 * below) per Cairo requirements.
+                 */
+                instdata->surface = cairo_ps_surface_create(instdata->imagename,
+                                                            height, width);
+            }
+            else {
+                /* Portrait orientation */
+                instdata->surface = cairo_ps_surface_create(instdata->imagename,
+                                                            width, height);
+            }
+            /* Do not use alpha channel - prevents embedded image */
+            instdata->usealpha = 0;
+            fmtname = "PS";
+            break;
+        case CCFBIF_SVG:
+            /* Surface size is given in (floating-point) points */
+            width = (double) instdata->imagewidth * CCFB_POINTS_PER_PIXEL;
+            height = (double) instdata->imageheight * CCFB_POINTS_PER_PIXEL;
+            instdata->surface = cairo_svg_surface_create(instdata->imagename,
+                                                         width, height);
+            instdata->usealpha = 1;
+            fmtname = "SVG";
+            break;
+        case CCFBIF_REC:
+            /* Surface size is given in (floating-point) points */
+            width = (double) instdata->imagewidth * CCFB_POINTS_PER_PIXEL;
+            height = (double) instdata->imageheight * CCFB_POINTS_PER_PIXEL;
+            instdata->surface = 
+                cairo_svg_surface_create_for_stream(NULL, NULL, width, height);
+            instdata->usealpha = 1;
+            fmtname = "SVG REC";
+            break;
+        default:
+            sprintf(grdelerrmsg, "cairoCFerBind_createSurface: unexpected error, "
+                                 "unknown imageformat %d", instdata->imageformat);
+            return 0;
+        }
+
+        /* Check for failure to create the surface */
+        if ( cairo_surface_status(instdata->surface) != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_createSurface: "
+                                 "problems creating a %s surface", fmtname);
+            cairo_surface_destroy(instdata->surface);
+            instdata->surface = NULL;
+            return 0;
+        }
+        /* 
+         * Set a low resolution for fallback raster images in vector drawings.
+         * We really do not want this to be used or even created.
+         */
+        if ( instdata->imageformat != CCFBIF_PNG )
+            cairo_surface_set_fallback_resolution(instdata->surface, 32.0, 32.0);
+    }
+
+    /* Create the Context if it does not exist */
+    if ( instdata->context == NULL ) {
+        instdata->context = cairo_create(instdata->surface);
+        if ( cairo_status(instdata->context) != CAIRO_STATUS_SUCCESS ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_createSurface: "
+                                "problems creating a context from a surface");
+            cairo_destroy(instdata->context);
+            instdata->context = NULL;
+            cairo_surface_finish(instdata->surface);
+            cairo_surface_destroy(instdata->surface);
+            instdata->surface = NULL;
+            return 0;
+        }
+
+        /*
+         * If landscape PostScript, translate and rotate the coordinate system
+         * to correct for swapped width and height (per Cairo requirements).
+         */
+        if ( instdata->imageformat == CCFBIF_PS ) {
+            width = (double) instdata->imagewidth * CCFB_POINTS_PER_PIXEL;
+            height = (double) instdata->imageheight * CCFB_POINTS_PER_PIXEL;
+            if ( width > height ) {
+                /* surface was created with coordinates (0,0) to (height, width) */
+                cairo_matrix_t transmat;
+
+                /* Add a "comment" telling PostScript it is landscape */
+                cairo_ps_surface_dsc_begin_page_setup(instdata->surface);
+                cairo_ps_surface_dsc_comment(instdata->surface,
+                                         "%%PageOrientation: Landscape");
+                /* Translate and rotate 90 degrees */
+                cairo_matrix_init(&transmat, 0.0, -1.0, 1.0, 0.0, 0.0, width);
+                cairo_set_matrix(instdata->context, &transmat);
+                /*
+                 * The transformed coordinate system goes from (0,0) at the top
+                 * left corner to (width, height) at the bottom right corner.
+                 */
+            }
+            else {
+                /* Add a "comment" telling PostScript it is portrait */
+                cairo_ps_surface_dsc_begin_page_setup(instdata->surface);
+                cairo_ps_surface_dsc_comment(instdata->surface,
+                                         "%%PageOrientation: Portrait");
+            }
+        }
+
+        /* Set the antialiasing state in the context */
+        if ( instdata->antialias )
+            cairo_set_antialias(instdata->context, CAIRO_ANTIALIAS_DEFAULT);
+        else
+            cairo_set_antialias(instdata->context, CAIRO_ANTIALIAS_NONE);
+
+        /* Set the appropriate clipping rectangle (if any) */
+        if ( ! cairoCFerBind_clipView(self, instdata->clipit) ) {
+            /* grdelerrmsg appropriately assigned */
+            return 0;
+        }
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createSymbol.c b/fer/cferbind/cairoCFerBind_createSymbol.c
new file mode 100644
index 0000000..afec103
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createSymbol.c
@@ -0,0 +1,67 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Create a symbol object for this "Window".
+ *
+ * Currently known symbol names (all single-character):
+ *     '.' (period) - small filled circle
+ *     'o' (lowercase oh) - unfilled circle
+ *     '+' (plus) - plus
+ *     'x' (lowercase ex) - ex
+ *     '*' (asterisk) - asterisk
+ *     '^' (caret) - unfilled triangle
+ *     '#' (pound sign) - unfilled square
+ *
+ * Returns a sybmol object if successful.   If an error occurs,
+ * grdelerrmsg is assigned an appropriate error message and NULL
+ * is returned.
+ */
+grdelType cairoCFerBind_createSymbol(CFerBind *self, const char *symbolname, int namelen)
+{
+    char symname[8];
+    int  k;
+    grdelType symbol;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createSymbol: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    /* null-terminate the symbol name, which should be short */
+    for (k = 0; (k < 7) && (k < namelen); k++)
+        symname[k] = symbolname[k];
+    symname[k] = '\0';
+
+    /* The symbol object is just a cast of a character value to a pointer type */
+    if ( strcmp(symname, ".") == 0 )
+        symbol = (grdelType) '.';
+    else if ( strcmp(symname, "o") == 0 )
+        symbol = (grdelType) 'o';
+    else if ( strcmp(symname, "+") == 0 )
+        symbol = (grdelType) '+';
+    else if ( strcmp(symname, "x") == 0 )
+        symbol = (grdelType) 'x';
+    else if ( strcmp(symname, "*") == 0 )
+        symbol = (grdelType) '*';
+    else if ( strcmp(symname, "^") == 0 )
+        symbol = (grdelType) '^';
+    else if ( strcmp(symname, "#") == 0 )
+        symbol = (grdelType) '#';
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_createSymbol: "
+                             "unknown symbol '%s'", symname);
+        return NULL;
+    }
+
+    return symbol;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_createWindow.c b/fer/cferbind/cairoCFerBind_createWindow.c
new file mode 100644
index 0000000..77e0265
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_createWindow.c
@@ -0,0 +1,101 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Creates a Cario instance of a CFerBind struct.
+ *
+ * A pointer to created bindings instance is returned if
+ * successful.  If an error occurs, grdelerrmsg is assigned
+ * an appropriate error message and NULL is returned.
+ */
+CFerBind *cairoCFerBind_createWindow(void)
+{
+    CFerBind *bindings;
+    CairoCFerBindData *instdata;
+
+    /* Create the bindings structure */
+    bindings = (CFerBind *) PyMem_Malloc(sizeof(CFerBind));
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createWindow: "
+                            "Out of memory for a CFerBind structure");
+        return NULL;
+    }
+    /* Zero out everything to catch errors */
+    memset(bindings, 0, sizeof(CFerBind));
+
+    /* Identify the type of bindings using the pointer address to the global name */
+    bindings->enginename = CairoCFerBindName;
+
+    /* Assign the bindings functions */
+    bindings->setImageName = cairoCFerBind_setImageName;
+    bindings->deleteWindow = cairoCFerBind_deleteWindow;
+    bindings->setAntialias = cairoCFerBind_setAntialias;
+    bindings->beginView = cairoCFerBind_beginView;
+    bindings->clipView = cairoCFerBind_clipView;
+    bindings->endView = cairoCFerBind_endView;
+    bindings->beginSegment = cairoCFerBind_beginSegment;
+    bindings->endSegment = cairoCFerBind_endSegment;
+    bindings->deleteSegment = cairoCFerBind_deleteSegment;
+    bindings->updateWindow = cairoCFerBind_updateWindow;
+    bindings->clearWindow = cairoCFerBind_clearWindow;
+    bindings->redrawWindow = cairoCFerBind_redrawWindow;
+    bindings->windowScreenInfo = cairoCFerBind_windowScreenInfo;
+    bindings->resizeWindow = cairoCFerBind_resizeWindow;
+    bindings->scaleWindow = cairoCFerBind_scaleWindow;
+    bindings->showWindow = cairoCFerBind_showWindow;
+    bindings->saveWindow = cairoCFerBind_saveWindow;
+    bindings->createColor = cairoCFerBind_createColor;
+    bindings->deleteColor = cairoCFerBind_deleteColor;
+    bindings->createFont = cairoCFerBind_createFont;
+    bindings->deleteFont = cairoCFerBind_deleteFont;
+    bindings->createPen = cairoCFerBind_createPen;
+    bindings->replacePenColor = cairoCFerBind_replacePenColor;
+    bindings->deletePen = cairoCFerBind_deletePen;
+    bindings->createBrush = cairoCFerBind_createBrush;
+    bindings->replaceBrushColor = cairoCFerBind_replaceBrushColor;
+    bindings->deleteBrush = cairoCFerBind_deleteBrush;
+    bindings->createSymbol = cairoCFerBind_createSymbol;
+    bindings->deleteSymbol = cairoCFerBind_deleteSymbol;
+    bindings->setWidthFactor = cairoCFerBind_setWidthFactor;
+    bindings->drawMultiline = cairoCFerBind_drawMultiline;
+    bindings->drawPoints = cairoCFerBind_drawPoints;
+    bindings->drawPolygon = cairoCFerBind_drawPolygon;
+    bindings->drawRectangle = cairoCFerBind_drawRectangle;
+    bindings->drawText = cairoCFerBind_drawText;
+
+    /* Create the instance-specific data structure */
+    bindings->instancedata = (CairoCFerBindData *) PyMem_Malloc(sizeof(CairoCFerBindData));
+    if ( bindings->instancedata == NULL ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_createWindow: "
+                            "Out of memory for a CairoCFerBindData structure");
+        PyMem_Free(bindings);
+        return NULL;
+    }
+    /* Initialize everything to zero */
+    memset(bindings->instancedata, 0, sizeof(CairoCFerBindData));
+
+    /* Set non-zero default values */
+    instdata = (CairoCFerBindData *) bindings->instancedata;
+    /* Default Cairo surface type */
+    instdata->imageformat = CCFBIF_REC;
+    /* default image size and minimum allowed value */
+    instdata->imagewidth = (int) (10.5 * CCFB_WINDOW_DPI);
+    instdata->imageheight = (int) (8.5 * CCFB_WINDOW_DPI);
+    instdata->minsize = 128;
+    /* default clear color of opaque white */
+    instdata->lastclearcolor.id = CCFBColorId;
+    instdata->lastclearcolor.redfrac = 1.0;
+    instdata->lastclearcolor.greenfrac = 1.0;
+    instdata->lastclearcolor.bluefrac = 1.0;
+    instdata->lastclearcolor.opaquefrac = 1.0;
+    /* default line width scaling factor */
+    instdata->widthfactor = CCFB_WINDOW_DPI * 0.75 / 72.0;
+
+    return bindings;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteBrush.c b/fer/cferbind/cairoCFerBind_deleteBrush.c
new file mode 100644
index 0000000..584f4d4
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteBrush.c
@@ -0,0 +1,44 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Delete the given brush object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteBrush(CFerBind *self, grdelType brush)
+{
+    CCFBBrush *brushobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteBrush: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    brushobj = (CCFBBrush *) brush;
+    if ( brushobj->id != CCFBBrushId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteBrush: unexpected error, "
+                            "brush is not CCFBBrush struct");
+        return 0;
+    }
+
+    /* Destroy any pattern given in this brush */
+    if ( brushobj->pattern != NULL )
+        cairo_pattern_destroy(brushobj->pattern);
+
+    /* Wipe the id to detect errors */
+    brushobj->id = NULL;
+
+    /* Free the memory */
+    PyMem_Free(brush);
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteColor.c b/fer/cferbind/cairoCFerBind_deleteColor.c
new file mode 100644
index 0000000..60cda63
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteColor.c
@@ -0,0 +1,40 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Delete the given color object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteColor(CFerBind *self, grdelType color)
+{
+    CCFBColor *colorobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteColor: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteColor: unexpected error, "
+                            "color is not CCFBColor struct");
+        return 0;
+    }
+
+    /* Wipe the id to detect errors */
+    colorobj->id = NULL;
+
+    /* Free the memory */
+    PyMem_Free(color);
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteFont.c b/fer/cferbind/cairoCFerBind_deleteFont.c
new file mode 100644
index 0000000..88c7654
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteFont.c
@@ -0,0 +1,32 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Delete a font object for this "Window".
+ *
+ * Currently stubbed since it is currently not used by Ferret;
+ * thus always fails.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteFont(CFerBind *self, grdelType font)
+{
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteFont: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    /* TODO: implement */
+    strcpy(grdelerrmsg, "cairoCFerBind_deleteFont: unexpected error, "
+                        "stubbed function");
+    return 0;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deletePen.c b/fer/cferbind/cairoCFerBind_deletePen.c
new file mode 100644
index 0000000..da162de
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deletePen.c
@@ -0,0 +1,40 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Delete the given pen object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deletePen(CFerBind *self, grdelType pen)
+{
+    CCFBPen *penobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deletePen: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    penobj = (CCFBPen *) pen;
+    if ( penobj->id != CCFBPenId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deletePen: unexpected error, "
+                            "pen is not CCFBPen struct");
+        return 0;
+    }
+
+    /* Wipe the id to detect errors */
+    penobj->id = NULL;
+
+    /* Free the memory */
+    PyMem_Free(pen);
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteSegment.c b/fer/cferbind/cairoCFerBind_deleteSegment.c
new file mode 100644
index 0000000..43ea41f
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteSegment.c
@@ -0,0 +1,96 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Deletes the drawing commands in the indicated Segment of a Window. 
+ *
+ * Arguments:
+ *     segid - ID of the segment to be deleted
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteSegment(CFerBind *self, int segid)
+{
+    CairoCFerBindData *instdata;
+    CCFBPicture *thispic;
+    CCFBPicture *delpic;
+    grdelBool    success;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteSegment: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Raise an error if not an image or recording surface */
+    if ( (instdata->imageformat != CCFBIF_PNG) &&
+         (instdata->imageformat != CCFBIF_REC) ) {
+        strcpy(grdelerrmsg, "Unable to delete drawing segments when "
+                            "writing directly to an image file");
+        return 0;
+    }
+     
+    /*
+     * End the current picture if it has something drawn 
+     * and is in the segment to delete 
+     */
+    if ( instdata->somethingdrawn && (instdata->segid == segid) ) {
+        if ( ! cairoCFerBind_endView(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+
+    while ( (instdata->firstpic != NULL) && 
+            (instdata->firstpic->segid == segid) ) {
+        delpic = instdata->firstpic;
+        instdata->firstpic = delpic->next;
+        cairo_surface_finish(delpic->surface);
+        cairo_surface_destroy(delpic->surface);
+        PyMem_Free(delpic);
+        instdata->imagechanged = 1;
+    }
+    instdata->lastpic = NULL;
+    thispic = instdata->firstpic;
+    while ( thispic != NULL )  {
+        instdata->lastpic = thispic;
+        if ( (thispic->next != NULL) &&
+             (thispic->next->segid == segid) ) {
+            delpic = thispic->next;
+            thispic->next = delpic->next;
+            cairo_surface_finish(delpic->surface);
+            cairo_surface_destroy(delpic->surface);
+            PyMem_Free(delpic);
+            instdata->imagechanged = 1;
+        }
+        else {
+            thispic = thispic->next;
+        }
+    }
+
+    /* 
+     * If PyQtCairo and a change was made, 
+     * the image displayed needs to be updated.
+     */
+    if ( instdata->imagechanged && 
+         (self->enginename == PyQtCairoCFerBindName) ) {
+        success = pyqtcairoCFerBind_updateWindow(self);
+        if ( ! success ) {
+            /* grdelerrmsg aleady assigned */
+            return 0;
+        }
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteSymbol.c b/fer/cferbind/cairoCFerBind_deleteSymbol.c
new file mode 100644
index 0000000..cd27be2
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteSymbol.c
@@ -0,0 +1,30 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Delete a symbol object for this "Window".
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteSymbol(CFerBind *self, grdelType symbol)
+{
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteSymbol: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    /*
+     * A symbol "object" is just a character value cast as a pointer type;
+     * thus nothing needs to be done to delete it.
+     */
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_deleteWindow.c b/fer/cferbind/cairoCFerBind_deleteWindow.c
new file mode 100644
index 0000000..8c9e966
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_deleteWindow.c
@@ -0,0 +1,63 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Deletes (frees) any allocated resources associated with this
+ * "Window" (bindings instance), and then deletes (frees) the
+ * bindings instance.  After calling this function, this bindings
+ * instance should no longer be used.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_deleteWindow(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+    CCFBPicture *delpic;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_deleteWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Delete any existing context and surface */
+    if ( instdata->context != NULL ) {
+        /*
+         * Explicitly call cairo_show_page before destroying the context.
+         * Cairo 1.2 (but not 1.4 or later) requires this call.
+         */
+        cairo_show_page(instdata->context);
+        cairo_destroy(instdata->context);
+        instdata->context = NULL;
+    }
+    if ( instdata->surface != NULL ) {
+        /* Explicitly finish the surface just to be safe */
+        cairo_surface_finish(instdata->surface);
+        cairo_surface_destroy(instdata->surface);
+        instdata->surface = NULL;
+    }
+    /* Delete any stored pictures */
+    while ( instdata->firstpic != NULL ) {
+        delpic = instdata->firstpic;
+        instdata->firstpic = delpic->next;
+        cairo_surface_finish(delpic->surface);
+        cairo_surface_destroy(delpic->surface);
+        PyMem_Free(delpic);
+    }
+    instdata->lastpic = NULL;
+
+    PyMem_Free(self->instancedata);
+    self->instancedata = NULL;
+    PyMem_Free(self);
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_drawMultiline.c b/fer/cferbind/cairoCFerBind_drawMultiline.c
new file mode 100644
index 0000000..9c2ff48
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_drawMultiline.c
@@ -0,0 +1,116 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Draw a series of connected line segments to this "Window".
+ *
+ * Arguments:
+ *     ptsx   - x-coordinates of the line segment endpoints
+ *     ptsy   - y-coordinates of the line segment endpoints
+ *     numpts - number of endpoints given in ptsx and ptsy
+ *     pen    - Pen object to use for drawing the lines
+ *
+ * Coordinates are in units of pixels from te upper left
+ * corner, increasing as one goes to the bottom right corner.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_drawMultiline(CFerBind *self, double ptsx[],
+                                      double ptsy[], int numpts, grdelType pen)
+{
+    CairoCFerBindData *instdata;
+    CCFBPen *penobj;
+    double   unitfactor;
+    double   xval, yval;
+    int      k;
+    double   adjwidth;
+    double   adjdashes[8];
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawMultiline: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( instdata->context == NULL ) {
+        /* Create the Cairo Surface and Context if they do not exist */
+        if ( ! cairoCFerBind_createSurface(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    penobj = (CCFBPen *) pen;
+    if ( penobj->id != CCFBPenId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawMultiline: unexpected error, "
+                            "pen is not CCFBPen struct");
+        return 0;
+    }
+    if ( numpts < 2 ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawMultiline: "
+                            "fewer than two points given");
+        return 0;
+    }
+
+    /* Convertions factor for those surfaces that expect points instead of pixels */
+    if ( instdata->imageformat == CCFBIF_PNG ) {
+        unitfactor = 1.0;
+    }
+    else {
+        unitfactor = CCFB_POINTS_PER_PIXEL;
+    }
+
+    /* Create the path that will be stroked */
+    cairo_new_path(instdata->context);
+    xval = ptsx[0] * unitfactor;
+    yval = ptsy[0] * unitfactor;
+    cairo_move_to(instdata->context, xval, yval);
+    for (k = 1; k < numpts; k++) {
+        xval = ptsx[k] * unitfactor;
+        yval = ptsy[k] * unitfactor;
+        cairo_line_to(instdata->context, xval, yval);
+    }
+
+    /* Assign the line color */
+    if ( instdata->usealpha )
+        cairo_set_source_rgba(instdata->context, penobj->color.redfrac,
+                              penobj->color.greenfrac, penobj->color.bluefrac,
+                              penobj->color.opaquefrac);
+    else
+        cairo_set_source_rgb(instdata->context, penobj->color.redfrac,
+                             penobj->color.greenfrac, penobj->color.bluefrac);
+    /* Assign the adjusted line width, which is in points */
+    adjwidth  = penobj->width * instdata->widthfactor;
+    /* width of zero is a cosmetic pen - make it 1 pixel wide */
+    if ( adjwidth == 0.0 )
+        adjwidth = 1.0;
+    adjwidth *= unitfactor;
+    cairo_set_line_width(instdata->context, adjwidth);
+    /* Assign the line style (solid/dash/dor/dashdot) using the adjusted width */
+    for (k = 0; k < penobj->numdashes; k++)
+        adjdashes[k] = penobj->dashes[k] * adjwidth;
+    cairo_set_dash(instdata->context, adjdashes, penobj->numdashes, 0.0);
+    if ( cairo_status(instdata->context) != CAIRO_STATUS_SUCCESS ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawMultiline: unexpected error, "
+                            "problems setting pen dashes");
+        return 0;
+    }
+    /* Assign the line cap and join styles */
+    cairo_set_line_cap(instdata->context, penobj->captype);
+    cairo_set_line_join(instdata->context, penobj->jointype);
+
+    /* stroke and remove the path */
+    cairo_stroke(instdata->context);
+    instdata->somethingdrawn = 1;
+    instdata->imagechanged = 1;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_drawPoints.c b/fer/cferbind/cairoCFerBind_drawPoints.c
new file mode 100644
index 0000000..61c6fe2
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_drawPoints.c
@@ -0,0 +1,203 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Draw discrete points in this "Window".
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_drawPoints(CFerBind *self, double ptsx[], double ptsy[],
+                                   int numpts, grdelType symbol, grdelType color,
+                                   double symsize)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+    char   symchar;
+    int    k;
+    double unitfactor;
+    double scalefactor;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawPoints: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( instdata->context == NULL ) {
+        /* Create the Cairo Surface and Context if they do not exist */
+        if ( ! cairoCFerBind_createSurface(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawPoints: unexpected error, "
+                            "color is not CCFBColor struct");
+        return 0;
+    }
+
+    /* Assign the (solid) color to use for the symbols */
+    if ( instdata->usealpha )
+        cairo_set_source_rgba(instdata->context, colorobj->redfrac,
+                              colorobj->greenfrac, colorobj->bluefrac,
+                              colorobj->opaquefrac);
+    else
+        cairo_set_source_rgb(instdata->context, colorobj->redfrac,
+                             colorobj->greenfrac, colorobj->bluefrac);
+
+    /* Convertions factor for those surfaces that expect points instead of pixels */
+    if ( instdata->imageformat == CCFBIF_PNG ) {
+        unitfactor = 1.0;
+    }
+    else {
+        unitfactor = CCFB_POINTS_PER_PIXEL;
+    }
+
+    /* Scaling factor to use for these symbols "drawn" as 100x100 pixel paths */
+    scalefactor  = symsize * instdata->widthfactor;
+    scalefactor *= unitfactor / 100.0;
+
+    /* Assign the line style for drawing the symbols */
+    cairo_set_line_width(instdata->context, 15.0 * scalefactor);
+    cairo_set_dash(instdata->context, NULL, 0, 0.0);
+    cairo_set_line_cap(instdata->context, CAIRO_LINE_CAP_SQUARE);
+    cairo_set_line_join(instdata->context, CAIRO_LINE_JOIN_BEVEL);
+
+    /* A symbol object is just a character cast as a pointer */
+    symchar = (char) symbol;
+    switch( symchar ) {
+    case '.':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_new_sub_path(instdata->context);
+            cairo_arc(instdata->context,
+                      ptsx[k] * unitfactor,
+                      ptsy[k] * unitfactor,
+                      20.0 * scalefactor,
+                      0.0, 2.0 * M_PI);
+            cairo_close_path(instdata->context);
+        }
+        cairo_fill(instdata->context);
+        break;
+    case 'o':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_new_sub_path(instdata->context);
+            cairo_arc(instdata->context,
+                      ptsx[k] * unitfactor,
+                      ptsy[k] * unitfactor,
+                      40.0 * scalefactor,
+                      0.0, 2.0 * M_PI);
+            cairo_close_path(instdata->context);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    case '+':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor,
+                          ptsy[k] * unitfactor - 40.0 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor,
+                          ptsy[k] * unitfactor + 40.0 * scalefactor);
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 40.0 * scalefactor,
+                          ptsy[k] * unitfactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 40.0 * scalefactor,
+                          ptsy[k] * unitfactor);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    case 'x':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 30.0 * scalefactor,
+                          ptsy[k] * unitfactor - 30.0 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 30.0 * scalefactor,
+                          ptsy[k] * unitfactor + 30.0 * scalefactor);
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 30.0 * scalefactor,
+                          ptsy[k] * unitfactor + 30.0 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 30.0 * scalefactor,
+                          ptsy[k] * unitfactor - 30.0 * scalefactor);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    case '*':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor,
+                          ptsy[k] * unitfactor - 40.0 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor,
+                          ptsy[k] * unitfactor + 40.0 * scalefactor);
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 34.641 * scalefactor,
+                          ptsy[k] * unitfactor - 20.0   * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 34.641 * scalefactor,
+                          ptsy[k] * unitfactor + 20.0   * scalefactor);
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 34.641 * scalefactor,
+                          ptsy[k] * unitfactor + 20.0   * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 34.641 * scalefactor,
+                          ptsy[k] * unitfactor - 20.0   * scalefactor);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    case '^':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_move_to(instdata->context,
+                          ptsx[k] * unitfactor - 40.0 * scalefactor,
+                          ptsy[k] * unitfactor + 30.0 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor,
+                          ptsy[k] * unitfactor - 39.282 * scalefactor);
+            cairo_line_to(instdata->context,
+                          ptsx[k] * unitfactor + 40.0 * scalefactor,
+                          ptsy[k] * unitfactor + 30.0 * scalefactor);
+            cairo_close_path(instdata->context);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    case '#':
+        cairo_new_path(instdata->context);
+        for (k = 0; k < numpts; k++) {
+            cairo_rectangle(instdata->context,
+                            ptsx[k] * unitfactor - 35.0 * scalefactor,
+                            ptsy[k] * unitfactor - 35.0 * scalefactor,
+                            70.0 * scalefactor,
+                            70.0 * scalefactor);
+        }
+        cairo_stroke(instdata->context);
+        break;
+    default:
+        sprintf(grdelerrmsg, "cairoCFerBind_drawPoints: unexpected error, "
+                             "unknown symbol '%c'", symchar);
+        return 0;
+    }
+
+    instdata->somethingdrawn = 1;
+    instdata->imagechanged = 1;
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_drawPolygon.c b/fer/cferbind/cairoCFerBind_drawPolygon.c
new file mode 100644
index 0000000..679a7f3
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_drawPolygon.c
@@ -0,0 +1,220 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Draw a polygon to this "Window".
+ *
+ * Arguments:
+ *     ptsx   - x-coordinates of the polygon vertices
+ *     ptsy   - y-coordinates of the polygon vertices
+ *     numpts - number of vertices given in ptsx and ptsy
+ *     brush  - Brush object to use for filling the polygon
+ *     pen    - Pen object to use for drawing the polygon edges
+ *
+ * Coordinates are in units of pixels from te upper left corner,
+ * increasing as one goes to the bottom right corner.  The last
+ * vertex given will always be attached to the first vertex.
+ *
+ * If the brush argument is NULL, the polygon will not be 
+ * filled.  If the pen argument is NULL, the polygon edges 
+ * will be drawn using a solid cosmetic pen with the same 
+ * color/pattern as the brush.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_drawPolygon(CFerBind *self, double ptsx[], double ptsy[],
+                                    int numpts, grdelType brush, grdelType pen)
+{
+    CairoCFerBindData *instdata;
+    CCFBBrush *brushobj;
+    CCFBPen   *penobj;
+    double     unitfactor;
+    double     xval, yval;
+    int        k;
+    double     adjwidth;
+    double     adjdashes[8];
+    int        antialias;
+    /* cairo_matrix_t current_transform; */
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( instdata->context == NULL ) {
+        /* Create the Cairo Surface and Context if they do not exist */
+        if ( ! cairoCFerBind_createSurface(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    if ( brush != NULL ) {
+        brushobj = (CCFBBrush *) brush;
+        if ( brushobj->id != CCFBBrushId ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: unexpected error, "
+                                "brush is not CCFBBrush struct");
+            return 0;
+        }
+    }
+    else
+        brushobj = NULL;
+    if ( pen != NULL ) {
+        penobj = (CCFBPen *) pen;
+        if ( penobj->id != CCFBPenId ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: unexpected error, "
+                                "pen is not CCFBPen struct");
+            return 0;
+        }
+    }
+    else
+        penobj = NULL;
+    if ( (brushobj == NULL) && (penobj == NULL) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: "
+                            "both brush and pen are NULL");
+        return 0;
+    }
+    if ( numpts < 2 ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: "
+                            "fewer than two points given");
+        return 0;
+    }
+
+    /* Convertions factor for those surfaces that expect points instead of pixels */
+    if ( instdata->imageformat == CCFBIF_PNG ) {
+        unitfactor = 1.0;
+    }
+    else {
+        unitfactor = CCFB_POINTS_PER_PIXEL;
+    }
+
+    /* Turn off antialiasing for this operation */
+    antialias = instdata->antialias;
+    cairoCFerBind_setAntialias(self, 0);
+
+    /* Create the path that will be filled and/or stroked */
+    cairo_new_path(instdata->context);
+    xval = ptsx[0] * unitfactor;
+    yval = ptsy[0] * unitfactor;
+    cairo_move_to(instdata->context, xval, yval);
+    for (k = 1; k < numpts; k++) {
+        xval = ptsx[k] * unitfactor;
+        yval = ptsy[k] * unitfactor;
+        cairo_line_to(instdata->context, xval, yval);
+    }
+    cairo_close_path(instdata->context);
+
+    if ( (brushobj != NULL) && (penobj == NULL) ) {
+        /* Simultaneously add a cosmetic pen around the fill */
+        /*
+         * cairo_push_group(instdata->context); 
+         */
+
+        /* Clear any transformation so it is not applied twice */
+        /*
+         * cairo_get_matrix(instdata->context, &current_transform);
+         * cairo_identity_matrix(instdata->context);
+         */
+
+        /* Draw with opaque colors in this group */
+
+        if ( brushobj->pattern != NULL )
+            cairo_set_source(instdata->context, brushobj->pattern);
+        else if ( instdata->usealpha )
+            cairo_set_source_rgba(instdata->context, brushobj->color.redfrac,
+                  brushobj->color.greenfrac, brushobj->color.bluefrac,
+                  brushobj->color.opaquefrac);
+        else
+            cairo_set_source_rgb(instdata->context, brushobj->color.redfrac,
+                  brushobj->color.greenfrac, brushobj->color.bluefrac);
+
+        /* Fill the rectangle, but preserve the path for stroking */
+        cairo_fill_preserve(instdata->context);
+
+        /* Stroke the path with a solid cosmetic line */
+        cairo_set_line_width(instdata->context, unitfactor);
+        cairo_set_dash(instdata->context, NULL, 0, 0.0);
+        cairo_set_line_cap(instdata->context, CAIRO_LINE_CAP_SQUARE);
+        cairo_set_line_join(instdata->context, CAIRO_LINE_JOIN_BEVEL);
+        cairo_stroke(instdata->context);
+
+        /* Reset the original transformation */
+        /*
+         * cairo_set_matrix(instdata->context, &current_transform);
+         */
+
+        /* Draw this group using the brush alpha value (if appropriate) */
+        /*
+         * cairo_pop_group_to_source(instdata->context);
+         * if ( instdata->usealpha )
+         *     cairo_paint_with_alpha(instdata->context, brushobj->color.opaquefrac);
+         * else
+         *     cairo_paint(instdata->context);
+         */
+    }
+    else {
+        /* First fill if requested */
+        if ( brushobj != NULL ) {
+            /* Fill pattern or solid color */
+            if ( brushobj->pattern != NULL )
+                cairo_set_source(instdata->context, brushobj->pattern);
+            else if ( instdata->usealpha )
+                cairo_set_source_rgba(instdata->context, brushobj->color.redfrac,
+                      brushobj->color.greenfrac, brushobj->color.bluefrac,
+                      brushobj->color.opaquefrac);
+            else
+                cairo_set_source_rgb(instdata->context, brushobj->color.redfrac,
+                      brushobj->color.greenfrac, brushobj->color.bluefrac);
+            /* Fill the polygon, but preserve the path for stroking */
+            cairo_fill_preserve(instdata->context);
+        }
+
+        /* Assign the line color to the context */
+        if ( instdata->usealpha )
+            cairo_set_source_rgba(instdata->context, penobj->color.redfrac,
+                  penobj->color.greenfrac, penobj->color.bluefrac,
+                  penobj->color.opaquefrac);
+        else
+            cairo_set_source_rgb(instdata->context, penobj->color.redfrac,
+                  penobj->color.greenfrac, penobj->color.bluefrac);
+        /* Assign the adjusted line width */
+        adjwidth = penobj->width * instdata->widthfactor;
+        /* width of zero is a cosmetic pen - make it 1 pixel wide */
+        if ( adjwidth == 0.0 )
+            adjwidth = 1.0;
+        adjwidth *= unitfactor;
+        cairo_set_line_width(instdata->context, adjwidth);
+        /* Assign the line style (solid/dash/dor/dashdot) using the adjusted width */
+        for (k = 0; k < penobj->numdashes; k++)
+            adjdashes[k] = penobj->dashes[k] * adjwidth;
+        cairo_set_dash(instdata->context, adjdashes, penobj->numdashes, 0.0);
+        if ( cairo_status(instdata->context) != CAIRO_STATUS_SUCCESS ) {
+            cairoCFerBind_setAntialias(self, antialias);
+            strcpy(grdelerrmsg, "cairoCFerBind_drawPolygon: unexpected error, "
+                                "problems setting pen dashes");
+            return 0;
+        }
+        /* Assign the line cap and join styles */
+        cairo_set_line_cap(instdata->context, penobj->captype);
+        cairo_set_line_join(instdata->context, penobj->jointype);
+
+        /* stroke and remove the path */
+        cairo_stroke(instdata->context);
+    }
+
+    /* Restore the original antialiasing state */
+    cairoCFerBind_setAntialias(self, antialias);
+
+    instdata->somethingdrawn = 1;
+    instdata->imagechanged = 1;
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_drawRectangle.c b/fer/cferbind/cairoCFerBind_drawRectangle.c
new file mode 100644
index 0000000..21738e1
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_drawRectangle.c
@@ -0,0 +1,213 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Draw a rectangle to this "Window".
+ *
+ * Arguments:
+ *     left   - left edge coordinate of the rectangle
+ *     bottom - bottom edge coordinate of the rectangle
+ *     right  - right edge coordinate of the rectangle
+ *     top    - top edge coordinate of the rectangle
+ *     brush  - Brush object to use for filling the rectangle
+ *     pen    - Pen object to use for drawing the rectangle edges
+ *
+ * Coordinates are in units of pixels from te upper left
+ * corner, increasing as one goes to the bottom right corner.
+ *
+ * If the brush argument is NULL, the rectangle will not be
+ * filled.  If the pen argument is NULL, the rectangle edges
+ * will be drawn using a solid cosmetic pen with the same
+ * color/pattern as the brush.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_drawRectangle(CFerBind *self, double left, double bottom,
+                        double right, double top, grdelType brush, grdelType pen)
+{
+    CairoCFerBindData *instdata;
+    CCFBBrush *brushobj;
+    CCFBPen   *penobj;
+    double     unitfactor;
+    double     adjleft;
+    double     adjtop;
+    double     adjwidth;
+    double     adjheight;
+    int        k;
+    double     adjdashes[8];
+    int        antialias;
+    /* cairo_matrix_t current_transform; */
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawRectangle: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( instdata->context == NULL ) {
+        /* Create the Cairo Surface and Context if they do not exist */
+        if ( ! cairoCFerBind_createSurface(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    if ( brush != NULL ) {
+        brushobj = (CCFBBrush *) brush;
+        if ( brushobj->id != CCFBBrushId ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_drawRectangle: unexpected error, "
+                                "brush is not CCFBBrush struct");
+            return 0;
+        }
+    }
+    else
+        brushobj = NULL;
+    if ( pen != NULL ) {
+        penobj = (CCFBPen *) pen;
+        if ( penobj->id != CCFBPenId ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_drawRectangle: unexpected error, "
+                                "pen is not CCFBPen struct");
+            return 0;
+        }
+    }
+    else
+        penobj = NULL;
+    if ( (brushobj == NULL) && (penobj == NULL) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawRectangle: "
+                            "both brush and pen are NULL");
+        return 0;
+    }
+
+    /* Convertions factor for those surfaces that expect points instead of pixels */
+    if ( instdata->imageformat == CCFBIF_PNG ) {
+        unitfactor = 1.0;
+    }
+    else {
+        unitfactor = CCFB_POINTS_PER_PIXEL;
+    }
+
+    /* Turn off antialiasing for this operation */
+    antialias = instdata->antialias;
+    cairoCFerBind_setAntialias(self, 0);
+
+    /* Create the path that will be filled and/or stroked */
+    cairo_new_path(instdata->context);
+    adjleft = left * unitfactor;
+    adjtop = top * unitfactor;
+    adjwidth = (right - left) * unitfactor;
+    adjheight = (bottom - top) * unitfactor;
+    cairo_rectangle(instdata->context, adjleft, adjtop, adjwidth, adjheight);
+
+    if ( (brushobj != NULL) && (penobj == NULL) ) {
+        /* Simultaneously add a cosmetic pen around the fill */
+        /*
+         * cairo_push_group(instdata->context); 
+         */
+
+        /* Clear any transformation so it is not applied twice */
+        /*
+         * cairo_get_matrix(instdata->context, &current_transform);
+         * cairo_identity_matrix(instdata->context);
+         */
+
+        /* Draw with opaque colors in this group */
+
+        if ( brushobj->pattern != NULL )
+            cairo_set_source(instdata->context, brushobj->pattern);
+        else if ( instdata->usealpha )
+            cairo_set_source_rgba(instdata->context, brushobj->color.redfrac,
+                  brushobj->color.greenfrac, brushobj->color.bluefrac,
+                  brushobj->color.opaquefrac);
+        else
+            cairo_set_source_rgb(instdata->context, brushobj->color.redfrac,
+                  brushobj->color.greenfrac, brushobj->color.bluefrac);
+
+        /* Fill the rectangle, but preserve the path for stroking */
+        cairo_fill_preserve(instdata->context);
+
+        /* Stroke the path with a solid cosmetic line */
+        cairo_set_line_width(instdata->context, unitfactor);
+        cairo_set_dash(instdata->context, NULL, 0, 0.0);
+        cairo_set_line_cap(instdata->context, CAIRO_LINE_CAP_SQUARE);
+        cairo_set_line_join(instdata->context, CAIRO_LINE_JOIN_BEVEL);
+        cairo_stroke(instdata->context);
+
+        /* Reset the original transformation */
+        /*
+         * cairo_set_matrix(instdata->context, &current_transform);
+         */
+
+        /* Draw this group using the brush alpha value (if appropriate) */
+        /*
+         * cairo_pop_group_to_source(instdata->context);
+         * if ( instdata->usealpha )
+         *     cairo_paint_with_alpha(instdata->context, brushobj->color.opaquefrac);
+         * else
+         *     cairo_paint(instdata->context);
+         */
+    }
+    else {
+        /* First fill if requested */
+        if ( brushobj != NULL ) {
+            /* Fill pattern or solid color */
+            if ( brushobj->pattern != NULL )
+                cairo_set_source(instdata->context, brushobj->pattern);
+            else if ( instdata->usealpha )
+                cairo_set_source_rgba(instdata->context, brushobj->color.redfrac,
+                      brushobj->color.greenfrac, brushobj->color.bluefrac,
+                      brushobj->color.opaquefrac);
+            else
+                cairo_set_source_rgb(instdata->context, brushobj->color.redfrac,
+                      brushobj->color.greenfrac, brushobj->color.bluefrac);
+            /* Fill the rectangle, but preserve the path for stroking */
+            cairo_fill_preserve(instdata->context);
+        }
+
+        /* Assign the line color to the context */
+        if ( instdata->usealpha )
+            cairo_set_source_rgba(instdata->context, penobj->color.redfrac,
+                  penobj->color.greenfrac, penobj->color.bluefrac,
+                  penobj->color.opaquefrac);
+        else
+            cairo_set_source_rgb(instdata->context, penobj->color.redfrac,
+                  penobj->color.greenfrac, penobj->color.bluefrac);
+        /* Assign the adjusted line width */
+        adjwidth = penobj->width * instdata->widthfactor;
+        /* width of zero is a cosmetic pen - make it 1 pixel wide */
+        if ( adjwidth == 0.0 )
+            adjwidth = 1.0;
+        adjwidth *= unitfactor;
+        cairo_set_line_width(instdata->context, adjwidth);
+        /* Assign the line style (solid/dash/dor/dashdot) using the adjusted width */
+        for (k = 0; k < penobj->numdashes; k++)
+            adjdashes[k] = penobj->dashes[k] * adjwidth;
+        cairo_set_dash(instdata->context, adjdashes, penobj->numdashes, 0.0);
+        if ( cairo_status(instdata->context) != CAIRO_STATUS_SUCCESS ) {
+            cairoCFerBind_setAntialias(self, antialias);
+            strcpy(grdelerrmsg, "cairoCFerBind_drawRectangle: unexpected error, "
+                                "problems setting pen dashes");
+            return 0;
+        }
+        /* Assign the line cap and join styles */
+        cairo_set_line_cap(instdata->context, penobj->captype);
+        cairo_set_line_join(instdata->context, penobj->jointype);
+
+        /* stroke and remove the path */
+        cairo_stroke(instdata->context);
+    }
+
+    /* Restore the original antialiasing state */
+    cairoCFerBind_setAntialias(self, antialias);
+
+    instdata->somethingdrawn = 1;
+    instdata->imagechanged = 1;
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_drawText.c b/fer/cferbind/cairoCFerBind_drawText.c
new file mode 100644
index 0000000..fd75cff
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_drawText.c
@@ -0,0 +1,51 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Draw text to this "Window".
+ *
+ * Currently stubbed since it is currently not used by Ferret;
+ * thus always fails.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_drawText(CFerBind *self, const char *text, int textlen,
+                                 double startx, double starty, grdelType font,
+                                 grdelType color, double rotation)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawText: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( instdata->context == NULL ) {
+        /* Create the Cairo Surface and Context if they do not exist */
+        if ( ! cairoCFerBind_createSurface(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_drawText: unexpected error, "
+                            "color is not CCFBColor struct");
+        return 0;
+    }
+
+    /* TODO: implement */
+    strcpy(grdelerrmsg, "cairoCFerBind_drawText: unexpected error, "
+                        "stubbed function");
+    return 0;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_endSegment.c b/fer/cferbind/cairoCFerBind_endSegment.c
new file mode 100644
index 0000000..a9aeb85
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_endSegment.c
@@ -0,0 +1,46 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Ends a "Segment" for this "Window".
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_endSegment(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_endSegment: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Ignore this call if not an image or recording surface */
+    if ( (instdata->imageformat != CCFBIF_PNG) &&
+         (instdata->imageformat != CCFBIF_REC) ) {
+        return 1;
+    }
+     
+    /* If something drawn, create that picture with the old segment ID */
+    if ( instdata->somethingdrawn ) {
+        if ( ! cairoCFerBind_endView(self) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+
+    /* assign the "no-segment" ID */
+    instdata->segid = 0;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_endView.c b/fer/cferbind/cairoCFerBind_endView.c
new file mode 100644
index 0000000..53372d2
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_endView.c
@@ -0,0 +1,102 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Ends a "View" for this "Window".
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_endView(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+    CCFBPicture       *thispic;
+    cairo_status_t     status;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_endView: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Nothing to do if neither an image nor recording surface */
+    if ( (instdata->imageformat != CCFBIF_PNG) &&
+         (instdata->imageformat != CCFBIF_REC) ) {
+        return 1;
+    }
+     
+    /* If something was drawn, delete the context but save the surface */
+    if ( instdata->somethingdrawn ) {
+        if ( instdata->context == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_endView: unexpected error, "
+                                "something drawn without a context");
+            return 0;
+        }
+        if ( instdata->surface == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_endView: unexpected error, "
+                                "something drawn without a surface");
+            return 0;
+        }
+
+        /* Allocate a new picture for the linked list */
+        thispic = (CCFBPicture *) PyMem_Malloc(sizeof(CCFBPicture));
+        if ( thispic == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_endView: "
+                                "Out of memory for a CCFBPicture structure");
+            return 0;
+        }
+
+        /* Only need the surface, not the context */
+        /* cairo_show_page(instdata->context); - adds a newpage */
+        /* Make sure the context is not in an error state */
+        status = cairo_status(instdata->context);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_endView: "
+                                 "cairo context error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+        cairo_destroy(instdata->context);
+        instdata->context = NULL;
+
+        cairo_surface_flush(instdata->surface);
+        /* Make sure the surface is not in an error state */
+        status = cairo_surface_status(instdata->surface);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_endView: "
+                                 "cairo surface error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+
+        /* Assign the current surface and segment ID to this picture */
+        thispic->next = NULL;
+        thispic->surface = instdata->surface;
+        thispic->segid = instdata->segid;
+
+        instdata->surface = NULL;
+        instdata->somethingdrawn = 0;
+
+        /* Add the picture to the linked list */
+        if ( instdata->lastpic == NULL ) {
+            instdata->firstpic = thispic;
+            instdata->lastpic = thispic;
+        }
+        else {
+            instdata->lastpic->next = thispic;
+            instdata->lastpic = thispic;
+        }
+
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_redrawWindow.c b/fer/cferbind/cairoCFerBind_redrawWindow.c
new file mode 100644
index 0000000..bd1d2f8
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_redrawWindow.c
@@ -0,0 +1,43 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * "Redraws the Window with a different background color".
+ *
+ * This function only changes the clearing color to the given
+ * background (fill) color.  Since this clearing color is not 
+ * used until the image is saved, nothing more needs to be done.
+ * 
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_redrawWindow(CFerBind *self, grdelType fillcolor)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_redrawWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    colorobj = (CCFBColor *) fillcolor;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_redrawWindow: unexpected error, "
+                            "fillcolor is not CCFBColor struct");
+        return 0;
+    }
+
+    /* Copy the given color structure values to lastclearcolor */
+    instdata->lastclearcolor = *colorobj;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_replaceBrushColor.c b/fer/cferbind/cairoCFerBind_replaceBrushColor.c
new file mode 100644
index 0000000..2f04e12
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_replaceBrushColor.c
@@ -0,0 +1,45 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Replace the color in the given brush object with that in
+ * the given color object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_replaceBrushColor(CFerBind *self,
+                                          grdelType brush, grdelType color)
+{
+    CCFBBrush *brushobj;
+    CCFBColor *colorobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replaceBrushColor: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    brushobj = (CCFBBrush *) brush;
+    if ( brushobj->id != CCFBBrushId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replaceBrushColor: unexpected error, "
+                            "brush is not CCFBBrush struct");
+        return 0;
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replaceBrushColor: unexpected error, "
+                            "color is not CCFBColor struct");
+        return 0;
+    }
+
+    brushobj->color = *colorobj;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_replacePenColor.c b/fer/cferbind/cairoCFerBind_replacePenColor.c
new file mode 100644
index 0000000..e293180
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_replacePenColor.c
@@ -0,0 +1,45 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Replace the color in the given pen object with that in
+ * the given color object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_replacePenColor(CFerBind *self,
+                                        grdelType pen, grdelType color)
+{
+    CCFBPen *penobj;
+    CCFBColor *colorobj;
+
+    /* Sanity checks */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replacePenColor: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    penobj = (CCFBPen *) pen;
+    if ( penobj->id != CCFBPenId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replacePenColor: unexpected error, "
+                            "pen is not CCFBPen struct");
+        return 0;
+    }
+    colorobj = (CCFBColor *) color;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_replacePenColor: unexpected error, "
+                            "color is not CCFBColor struct");
+        return 0;
+    }
+
+    penobj->color = *colorobj;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_resizeWindow.c b/fer/cferbind/cairoCFerBind_resizeWindow.c
new file mode 100644
index 0000000..276638e
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_resizeWindow.c
@@ -0,0 +1,79 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Resizes the "Window" to the given width and height.  These
+ * values are assumed to be in units of pixels.  In this case
+ * (Cairo), if the size changes, this function destroys any
+ * existing surface and context; thus clearing the image.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_resizeWindow(CFerBind *self, double width, double height)
+{
+    CairoCFerBindData *instdata;
+    int newwidth;
+    int newheight;
+    CCFBPicture *delpic;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_resizeWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Round width and height to the nearest integer value */
+    newwidth = (int) (width + 0.5);
+    newheight = (int) (height + 0.5);
+
+    /* Check the new width and height */
+    if ( (newwidth < instdata->minsize) || (newheight < instdata->minsize) ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_resizeWindow: size too small, "
+                             "width (%d) and height (%d) cannot be less "
+                             "than %d", newwidth, newheight, instdata->minsize);
+        return 0;
+    }
+
+    /* If the size is unchanged, nothing to do */
+    if ( (instdata->imagewidth == newwidth) && (instdata->imageheight == newheight) )
+        return 1;
+
+    /* Assign the new size */
+    instdata->imagewidth = newwidth;
+    instdata->imageheight = newheight;
+
+    /* Delete any existing context and surface (which uses the old size) */
+    if ( instdata->context != NULL ) {
+        cairo_destroy(instdata->context);
+        instdata->context = NULL;
+    }
+    if ( instdata->surface != NULL ) {
+        cairo_surface_finish(instdata->surface);
+        cairo_surface_destroy(instdata->surface);
+        instdata->surface = NULL;
+    }
+    instdata->somethingdrawn = 0;
+
+    /* Delete any existing linked-list pictures (which use the old size) */
+    while ( instdata->firstpic != NULL ) {
+        delpic = instdata->firstpic;
+        instdata->firstpic = delpic->next;
+        cairo_surface_finish(delpic->surface);
+        cairo_surface_destroy(delpic->surface);
+        PyMem_Free(delpic);
+    }
+    instdata->lastpic = NULL;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_saveWindow.c b/fer/cferbind/cairoCFerBind_saveWindow.c
new file mode 100644
index 0000000..4c1ab16
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_saveWindow.c
@@ -0,0 +1,551 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <cairo/cairo-pdf.h>
+#include <cairo/cairo-ps.h>
+#include <cairo/cairo-svg.h>
+#include <pango/pangocairo.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Saves this "Window" to file.
+ *
+ * Arguments:
+ *     filename   - name of the image file to create, 
+ *                  or an empty string or NULL
+ *     namelen    - actual length of filename (zero if NULL)
+ *     formatname - name of the image format (case insensitive)
+ *     fmtnamelen - actual length of format (zero if NULL)
+ *     transbkg   - leave the background transparent?
+ *     xinches    - horizontal size of vector image in inches
+ *     yinches    - vertical size of vector image in inches
+ *     xpixels    - horizontal size of raster image in pixels
+ *     ypixels    - vertical size of raster image in pixels
+ *     annotations - array of annotation strings; pointers are always 8 bytes apart
+ *     numannotations - number of annotation strings
+ *
+ * If filename is empty or NULL, the imagename argument for the
+ * last call to cairoCFerBind_setImageName is used for the
+ * filename.
+ *
+ * If format is empty or NULL, the image format is determined
+ * from the extension of the filename.  In this case it is
+ * an error if the extension does not exist or is not recognized.
+ * A filename consisting of only an extension (e.g., ".png")
+ * will be treated as not having an extension.
+ *
+ * If transbkg is non-zero, the saved image is filled with the 
+ * last clearing color before drawing the current image with a 
+ * transparent background.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_saveWindow(CFerBind *self, const char *filename, 
+                        int namelen, const char *formatname, int fmtnamelen, 
+                        int transbkg, double xinches, double yinches, 
+                        int xpixels, int ypixels, 
+                        void **annotations, int numannotations)
+{
+    CairoCFerBindData *instdata;
+    cairo_status_t     status;
+    const char        *imagename;
+    int                imgnamelen;
+    int                j, k;
+    char               fmtext[8];
+    char              *allannos;
+    cairo_surface_t   *annosurface;
+    cairo_t           *annocontext;
+    double             padding;
+    double             penwidth;
+    double             annowidth;
+    double             annoheight;
+    cairo_surface_t   *savesurface;
+    cairo_t           *savecontext;
+    PangoLayout       *annolayout;
+    double             layoutheight;
+    cairo_status_t     result;
+    char               savename[CCFB_NAME_SIZE];
+    double             savewidth;
+    double             saveheight;
+    int                usealpha;
+    double             scalefactor;
+    double             offset;
+    CCFBPicture       *thispic;
+
+    /* Sanity checks - this should NOT be called by the PyQtCairo engine */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* This might be called with no images present; if so, ignore the call */
+    if ( (instdata->surface == NULL) && (instdata->firstpic == NULL) ) {
+        return 1;
+    }
+
+    /* Make sure the context is not in an error state */
+    if ( instdata->context != NULL ) {
+        status = cairo_status(instdata->context);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                 "cairo context error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+    }
+
+    /* Just to be safe */
+    if ( instdata->surface != NULL ) {
+        cairo_surface_flush(instdata->surface);
+
+        /* Make sure the surface is not in an error state */
+        status = cairo_surface_status(instdata->surface);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                 "cairo surface error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+    }
+
+    /* 
+     * Only allow annotations with recording surfaces.
+     * Batch mode is deprecated and it is too complicated.
+     */
+    if ( (numannotations > 0) && (instdata->imageformat != CCFBIF_REC) ) {
+        strcpy(grdelerrmsg, "Annotations cannot be used with batch mode");
+        return 0;
+    }
+
+    /* Check the surface type */
+    if ( (instdata->imageformat != CCFBIF_PNG) &&
+         (instdata->imageformat != CCFBIF_REC) ) {
+        /* Silently ignore this command since this was probably called automatically */
+        return 1;
+    }
+
+    /* Get the image filename to use */
+    if ( namelen > 0 ) {
+        imagename = filename;
+        imgnamelen = namelen;
+    }
+    else {
+        imagename = instdata->imagename;
+        imgnamelen = strlen(instdata->imagename);
+    }
+
+    /* Check that a filename was given somewhere */
+    if ( imgnamelen <= 0 ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                            "unable to obtain a name for the image file");
+        return 0;
+    }
+    if ( imgnamelen >= CCFB_NAME_SIZE ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                            "filename too long for this program");
+        return 0;
+    }
+    /* Make a null-terminated copy of the filename */
+    strncpy(savename, imagename, imgnamelen);
+    savename[imgnamelen] = '\0';
+
+    /* Get the format name */
+    if ( fmtnamelen > 0 ) {
+        /* lowercase, null-terminated, and should be short */
+        for (j = 0; (j < 7) && (j < fmtnamelen); j++)
+            fmtext[j] = (char) toupper(formatname[j]);
+        fmtext[j] = '\0';
+    }
+    else {
+        /*
+         * Determine the format name based on the filename extension.
+         * Ignore filenames that only have a '.' at the beginning
+         * since these have been used for "not given" in Ferret.
+         */
+        for (k = imgnamelen - 1; k > 0; k--)
+            if ( imagename[k] == '.' )
+                break;
+        if ( k > 0 ) {
+            for (j = 0, k++; (j < 7) && (k < imgnamelen); j++, k++)
+                fmtext[j] = (char) toupper(imagename[k]);
+            fmtext[j] = '\0';
+        }
+        else
+            fmtext[0] = '\0';
+    }
+
+    if ( strcmp(fmtext, "GIF") == 0 ) {
+        strcpy(fmtext, "PNG");
+        /* Change  .gif filename extension to .png */
+        if ( (imgnamelen >= 4) &&
+             (strcasecmp(&(savename[imgnamelen-4]), ".gif") == 0) )
+            strcpy(&(savename[imgnamelen-4]), ".png");
+    }
+    else if ( strcmp(fmtext, "PLT") == 0 ) {
+        strcpy(fmtext, "PDF");
+        /* Change .plt filename extension to .pdf */
+        if ( (imgnamelen >= 4) &&
+             (strcasecmp(&(savename[imgnamelen-4]), ".plt") == 0) )
+            strcpy(&(savename[imgnamelen-4]), ".pdf");
+    }
+
+    /* If an image surface, can only output PNG */
+    if ( (instdata->imageformat == CCFBIF_PNG) &&
+         (strcmp(fmtext, "PNG") != 0) ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                "unrecognized format '%s' for an image surface", fmtext);
+        return 0;
+    }
+
+    if ( numannotations > 0 ) {
+        /* Allocate memory for the string with all the annotations */
+        for (k = 0, j = 0; k < numannotations; k++, j++)
+            j += strlen((char *) annotations[k * 8 / sizeof(void *)]);
+        allannos = (char *) PyMem_Malloc(j * sizeof(char));
+        if ( allannos == NULL ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                   "out of memory for concatenated annotations");
+            return 0;
+        }
+        /* Copy the annotations with newlines inbetween */
+        for (k = 0, j = 0; k < numannotations; k++, j++) {
+            strcpy(&(allannos[j]), (char *) annotations[k * 8 / sizeof(void *)]);
+            j += strlen((char *) annotations[k * 8 / sizeof(void *)]);
+            allannos[j] = '\n';
+        }
+        /* Remove the last newline */
+	allannos[j-1] = '\0';
+        /* padding and pen width in points */
+        padding = 12.0;
+        penwidth = 2.0;
+        /*
+         * Create the SVG recording surface for the annotations;
+         * keep the same width, less padding, as the image; the 
+         * height is actually arbitrary.
+         */
+        annowidth = (double) (instdata->imagewidth * CCFB_POINTS_PER_PIXEL 
+                              - 2 * padding);
+        annoheight = (double) (instdata->imageheight * CCFB_POINTS_PER_PIXEL
+                               - 2 * padding);
+        annosurface = cairo_svg_surface_create_for_stream(
+                                        NULL, NULL, annowidth, annoheight);
+        if ( cairo_surface_status(annosurface) != CAIRO_STATUS_SUCCESS ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                "problems creating a temp surface for annotations");
+            cairo_surface_destroy(annosurface);
+            PyMem_Free(allannos);
+            return 0;
+        }
+        annocontext = cairo_create(annosurface);
+        if ( cairo_status(annocontext) != CAIRO_STATUS_SUCCESS ) {
+            strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                "problems creating a temp context from a surface");
+            cairo_destroy(annocontext);
+            cairo_surface_finish(annosurface);
+            cairo_surface_destroy(annosurface);
+            PyMem_Free(allannos);
+            return 0;
+        }
+        /* Create the Pango layout for the annotations */
+	annolayout = pango_cairo_create_layout(annocontext);
+	pango_layout_set_width(annolayout, (int) (PANGO_SCALE * annowidth + 0.5));
+        pango_layout_set_wrap(annolayout, PANGO_WRAP_WORD_CHAR);
+        pango_layout_set_markup(annolayout, allannos, j-1);
+        /* Apply the annotations to this cairo surface */
+        pango_cairo_show_layout(annocontext, annolayout);
+        /* Get the actual size of the annotations in "device units" (points) */
+        pango_layout_get_pixel_size(annolayout, &j, &k);
+        layoutheight = (double) k;
+        /* Done with the Pango layout */
+        g_object_unref(annolayout);
+        /* Make sure the context is not in an error state */
+        status = cairo_status(annocontext);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                 "cairo annotation context error: %s", 
+                                 cairo_status_to_string(status));
+            cairo_destroy(annocontext);
+            cairo_surface_finish(annosurface);
+            cairo_surface_destroy(annosurface);
+            PyMem_Free(allannos);
+            return 0;
+        }
+        /* Only need the surface, not the context */
+        cairo_destroy(annocontext);
+
+        cairo_surface_flush(annosurface);
+        /* Make sure the surface is not in an error state */
+        status = cairo_surface_status(annosurface);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                                 "cairo annotation surface error: %s", 
+                                 cairo_status_to_string(status));
+            cairo_surface_finish(annosurface);
+            cairo_surface_destroy(annosurface);
+            PyMem_Free(allannos);
+            return 0;
+        }
+    }
+    else {
+        annosurface = NULL;
+        padding = 0;
+        penwidth = 0;
+        layoutheight = 0;
+    }
+
+    /* Create a temporary surface for the desired format */
+    if ( strcmp(fmtext, "PNG") == 0 ) {
+        /* Surface size is given in integer pixels */
+        savewidth = (double) xpixels;
+        saveheight = (double) ypixels;
+        scalefactor  = savewidth / instdata->imagewidth;
+        scalefactor += saveheight / instdata->imageheight;
+        /* layoutheight, padding, and recording surfaces are in points */
+        scalefactor /= 2.0 * CCFB_POINTS_PER_PIXEL;
+        saveheight += scalefactor * (layoutheight + 2.0 * padding);
+        savesurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+                                  (int) savewidth, (int) saveheight );
+        usealpha = 1;
+    }
+    else if ( strcmp(fmtext, "PDF") == 0 ) {
+        /* Surface size is given in (floating-point) points */
+        savewidth = xinches * 72.0;
+        saveheight = yinches * 72.0;
+        scalefactor  = savewidth / instdata->imagewidth;
+        scalefactor += saveheight / instdata->imageheight;
+        /* instdata image size is in pixels */
+        scalefactor /= 2.0 * CCFB_POINTS_PER_PIXEL;
+        saveheight += scalefactor * (layoutheight + 2.0 * padding);
+        savesurface = cairo_pdf_surface_create(savename, savewidth, saveheight);
+        usealpha = 0;
+    }
+    else if ( strcmp(fmtext, "PS") == 0 ) {
+        /* Surface size is given in (floating-point) points */
+        savewidth = xinches * 72.0;
+        saveheight = yinches * 72.0;
+        scalefactor  = savewidth / instdata->imagewidth;
+        scalefactor += saveheight / instdata->imageheight;
+        /* instdata image size is in pixels */
+        scalefactor /= 2.0 * CCFB_POINTS_PER_PIXEL;
+        saveheight += scalefactor * (layoutheight + 2.0 * padding);
+        if ( savewidth > saveheight ) {
+            /*
+             * Landscape orientation
+             * Swap savewidth and saveheight and then translate and rotate 
+             * (see below) per Cairo requirements.
+             */
+            savesurface = cairo_ps_surface_create(savename, saveheight, savewidth);
+        }
+        else {
+            /* Portrait orientation */
+            savesurface = cairo_ps_surface_create(savename, savewidth, saveheight);
+        }
+        /* Do not use alpha channel; otherwise it will be created with an embedded image */
+        usealpha = 0;
+    }
+    else if ( strcmp(fmtext, "SVG") == 0 ) {
+        /* Surface size is given in (floating-point) points */
+        savewidth = xinches * 72.0;
+        saveheight = yinches * 72.0;
+        scalefactor  = savewidth / instdata->imagewidth;
+        scalefactor += saveheight / instdata->imageheight;
+        /* instdata image size is in pixels */
+        scalefactor /= 2.0 * CCFB_POINTS_PER_PIXEL;
+        saveheight += scalefactor * (layoutheight + 2.0 * padding);
+        savesurface = cairo_svg_surface_create(savename, savewidth, saveheight);
+        usealpha = 1;
+    }
+    else {
+        sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                             "unrecognized format '%s'", fmtext);
+        return 0;
+    }
+
+    /* Check for failure to create the surface */
+    if ( cairo_surface_status(savesurface) != CAIRO_STATUS_SUCCESS ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                             "problems creating a temporary %s surface", fmtext);
+        cairo_surface_destroy(savesurface);
+        return 0;
+    }
+
+    /* 
+     * Set a low resolution for fallback raster images in vector drawings.
+     * We really do not want this to be used or even created.
+     */
+    if ( strcmp(fmtext, "PNG") != 0 ) {
+        cairo_surface_set_fallback_resolution(savesurface, 32.0, 32.0);
+    }
+
+    /* Create a temporary context for this temporary surface */
+    savecontext = cairo_create(savesurface);
+    if ( cairo_status(savecontext) != CAIRO_STATUS_SUCCESS ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_saveWindow: problems creating "
+                            "a temporary context for the temporary surface");
+        cairo_destroy(savecontext);
+        cairo_surface_destroy(savesurface);
+        return 0;
+    }
+
+    if ( (strcmp(fmtext, "PNG") == 0) && (instdata->imageformat == CCFBIF_PNG) ) {
+        /* 
+         * Both surface use units of pixels, so fix the scaling 
+         * factor computed for recording surfaces, which use points.
+         */
+        scalefactor *= CCFB_POINTS_PER_PIXEL;
+    }
+    /* Set the scale on the destination so the source will just fit. */
+    cairo_scale(savecontext, scalefactor, scalefactor);
+
+    /*
+     * If landscape PostScript, translate and rotate the coordinate system
+     * to correct for swapped savewidth and saveheight (per Cairo requirements).
+     */
+    if ( strcmp(fmtext, "PS") == 0 ) {
+       if ( savewidth > saveheight ) {
+            /* surface was created with coordinates (0,0) to (saveheight, savewidth) */
+            cairo_matrix_t transmat;
+
+            /* Add a "comment" telling PostScript it is landscape */
+            cairo_ps_surface_dsc_begin_page_setup(savesurface);
+            cairo_ps_surface_dsc_comment(savesurface,
+                                         "%%PageOrientation: Landscape");
+            /* Translate and rotate 90 degrees */
+            cairo_matrix_init(&transmat, 0.0, -1.0, 1.0, 0.0, 0.0, savewidth);
+            cairo_set_matrix(savecontext, &transmat);
+            /*
+             * The transformed coordinate system goes from (0,0) at the top
+             * left corner to (savewidth, saveheight) at the bottom right corner.
+             */
+        }
+        else {
+            /* Add a "comment" telling PostScript it is portrait */
+            cairo_ps_surface_dsc_begin_page_setup(savesurface);
+            cairo_ps_surface_dsc_comment(savesurface,
+                                         "%%PageOrientation: Portrait");
+        }
+    }
+
+    /* 
+     * If not a transparent background, or if the alpha channel 
+     * is not supported, fill in the background (with an opaque 
+     * color if the alpha channel is not supported).
+     */
+    if ( (! transbkg) || (! usealpha) ) {
+        if ( usealpha )
+            cairo_set_source_rgba(savecontext,
+                                  instdata->lastclearcolor.redfrac,
+                                  instdata->lastclearcolor.greenfrac,
+                                  instdata->lastclearcolor.bluefrac,
+                                  instdata->lastclearcolor.opaquefrac);
+        else
+            cairo_set_source_rgb(savecontext,
+                                 instdata->lastclearcolor.redfrac,
+                                 instdata->lastclearcolor.greenfrac,
+                                 instdata->lastclearcolor.bluefrac);
+        cairo_paint(savecontext);
+    }
+
+    /* Check using layoutheight just in case there was no text */
+    if ( layoutheight > 0.0 ) {
+        /* 
+         * Draw the annotations in a white-filled, black-outlined 
+         * rectangle at the top of the temporary surface.
+         */
+        cairo_new_path(savecontext);
+        cairo_rectangle(savecontext, 0.5 * penwidth, 0.5 * penwidth,
+              (instdata->imagewidth * CCFB_POINTS_PER_PIXEL - penwidth),
+              layoutheight + 2.0 * padding - penwidth);
+        /* white fill */
+        if ( usealpha )
+            cairo_set_source_rgba(savecontext, 1.0, 1.0, 1.0, 1.0);
+        else
+            cairo_set_source_rgb(savecontext, 1.0, 1.0, 1.0);
+        cairo_fill_preserve(savecontext);
+        /* black outline */
+        if ( usealpha )
+            cairo_set_source_rgba(savecontext, 0.0, 0.0, 0.0, 1.0);
+        else
+            cairo_set_source_rgb(savecontext, 0.0, 0.0, 0.0);
+        cairo_set_line_width(savecontext, penwidth);
+        cairo_set_dash(savecontext, NULL, 0, 0.0);
+        cairo_set_line_cap(savecontext, CAIRO_LINE_CAP_SQUARE);
+        cairo_set_line_join(savecontext, CAIRO_LINE_JOIN_MITER);
+        cairo_stroke(savecontext);
+        /* 
+         * Draw the transparent-background annotations image
+         * onto this temporary surface within the rectangle.
+         */
+        cairo_set_source_surface(savecontext, annosurface, padding, padding);
+        cairo_paint(savecontext);
+        offset = layoutheight + 2.0 * padding;
+    }
+    else {
+        offset = 0.0;
+    }
+
+    if ( annosurface != NULL ) {
+        /* Done with the annotation surface */
+        cairo_surface_finish(annosurface);
+        cairo_surface_destroy(annosurface);
+    }
+
+    /* 
+     * Draw the transparent-background images onto this 
+     * temporary surface, beneath any annotations rectangle.
+     */
+    for (thispic = instdata->firstpic; thispic != NULL; thispic = thispic->next) {
+        cairo_set_source_surface(savecontext, thispic->surface, 0.0, offset);
+        cairo_paint(savecontext);
+    }
+    if ( instdata->surface != NULL ) {
+        cairo_set_source_surface(savecontext, instdata->surface, 0.0, offset);
+        cairo_paint(savecontext);
+    }
+
+    /* Just to be safe */
+    cairo_show_page(savecontext);
+
+    /* Done with the temporary context */
+    cairo_destroy(savecontext);
+
+    /* Just to be safe */
+    cairo_surface_flush(savesurface);
+
+    if ( strcmp(fmtext, "PNG") == 0 ) {
+        /* Save the raster image in memory to file */
+        result = cairo_surface_write_to_png(savesurface, savename);
+        /* Done with the temporary surface */
+        cairo_surface_finish(savesurface);
+        cairo_surface_destroy(savesurface);
+    }
+    else {
+        /* 
+         * Vector images are written directly to file.
+         * Check there were no errors after finishing 
+         * off the surface.
+         */
+        cairo_surface_finish(savesurface);
+        result = cairo_surface_status(savesurface);
+        /* Done with the temporary surface */
+        cairo_surface_destroy(savesurface);
+    }
+
+    /* Analyze the results */
+    if ( result != CAIRO_STATUS_SUCCESS ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_saveWindow: "
+                             "error while saving to '%s'; %s",
+                             savename, cairo_status_to_string(result));
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_scaleWindow.c b/fer/cferbind/cairoCFerBind_scaleWindow.c
new file mode 100644
index 0000000..ca11284
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_scaleWindow.c
@@ -0,0 +1,28 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * "Sets the image scaling factor for a Window".
+ *
+ * This function does nothing after checking that self is valid,
+ * as the image is not displayed.
+ * 
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_scaleWindow(CFerBind *self, double scale)
+{
+    /* Sanity checks */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_scaleWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_setAntialias.c b/fer/cferbind/cairoCFerBind_setAntialias.c
new file mode 100644
index 0000000..aa50227
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_setAntialias.c
@@ -0,0 +1,45 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Turns on or off anti-aliasing on non-text graphics.
+ *
+ * Arguments:
+ *     antialias - if zero, set to CAIRO_ANTIALIAS_NONE
+ *                 otherwise, set to CAIRO_ANTIALIAS_DEFAULT
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_setAntialias(CFerBind *self, int antialias)
+{
+    CairoCFerBindData *instdata;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_setAntialias: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Record the desired antialias setting */
+    instdata->antialias = antialias;
+
+    /* Also set the antialiasing value in the context, if it exists */
+    if ( instdata->context != NULL ) {
+        if ( antialias )
+            cairo_set_antialias(instdata->context, CAIRO_ANTIALIAS_DEFAULT);
+        else
+            cairo_set_antialias(instdata->context, CAIRO_ANTIALIAS_NONE);
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_setImageName.c b/fer/cferbind/cairoCFerBind_setImageName.c
new file mode 100644
index 0000000..6ba42fd
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_setImageName.c
@@ -0,0 +1,161 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Assigns the name and format of the image file to be created.
+ * This will determine the type of Cairo surface that will be
+ * created.  Any existing surface and context will be deleted.
+ *
+ * Arguments:
+ *     imagename  - name for the image file (can be NULL)
+ *     imgnamelen - actual length of imagename (zero if NULL)
+ *     formatname - name of the image format; currently supported
+ *                  (case insensitive) values are "PNG", "PDF",
+ *                  "PS", "SVG", "", or NULL
+ *     fmtnamelen - actual length of formatname (zero if NULL)
+ *
+ * If formatname is "" or NULL, the filename extension of imagename,
+ * if it exists and is recognized, will determine the format.  If
+ * the extension does not exist or is not recognized, a recording
+ * PostScript surface will be created.  A filename consisting of 
+ * only an extension (e.g., ".png") will be treated as not having 
+ * an extension.
+ *
+ * A "GIF" format is silently converted to "PNG".  A "PLT" format
+ * is silently converted to "PDF".
+ *
+ * If a recording or an image surface is created, the saveWindow 
+ * function is used to save the image.  Thus, imagename is only 
+ * a default name that may not be used.  For other surfaces, the 
+ * saveWindow function does nothing as the drawing is being written 
+ * directly to file and cannot be saved to another file.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_setImageName(CFerBind *self, const char imagename[],
+                        int imgnamelen, const char formatname[], int fmtnamelen)
+{
+    int  j, k;
+    char fmtext[8];
+    CCFBImageFormat imageformat;
+    CairoCFerBindData *instdata;
+    CCFBPicture *delpic;
+
+    /* Sanity checks - this should NOT be called by the PyQtCairo engine */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_setImageName: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    if ( imgnamelen >= CCFB_NAME_SIZE ) {
+        sprintf(grdelerrmsg, "cairoCFerBind_setImageName: "
+                             "imgnamelen (%d) too large", imgnamelen);
+        return 0;
+    }
+
+    /* Get the format name */
+    if ( fmtnamelen > 0 ) {
+        /* lowercase, null-terminated, and should be short */
+        for (j = 0; (j < 7) && (j < fmtnamelen); j++)
+            fmtext[j] = (char) toupper(formatname[j]);
+        fmtext[j] = '\0';
+    }
+    else {
+        /*
+         * Determine the format name based on the filename extension.
+         * Ignore filenames that only have a '.' at the beginning
+         * since these have been used for "not given" in Ferret.
+         */
+        for (k = imgnamelen - 1; k > 0; k--)
+            if ( imagename[k] == '.' )
+                break;
+        if ( k > 0 ) {
+            for (j = 0, k++; (j < 7) && (k < imgnamelen); j++, k++)
+                fmtext[j] = (char) toupper(imagename[k]);
+            fmtext[j] = '\0';
+        }
+        else
+            fmtext[0] = '\0';
+    }
+
+    /* Get the format type from the format name */
+    if ( (strcmp(fmtext, "PNG") == 0) || (strcmp(fmtext, "GIF") == 0) ) {
+        imageformat = CCFBIF_PNG;
+    }
+    else if ( (strcmp(fmtext, "PDF") == 0) || (strcmp(fmtext, "PLT") == 0) ) {
+        imageformat = CCFBIF_PDF;
+    }
+    else if ( strcmp(fmtext, "PS") == 0 ) {
+        imageformat = CCFBIF_PS;
+    }
+    else if ( strcmp(fmtext, "SVG") == 0 ) {
+        imageformat = CCFBIF_SVG;
+    }
+    else if ( fmtnamelen <= 0 ) {
+        /* No format specified and unrecognized extension */
+        imageformat = CCFBIF_REC;
+    }
+    else {
+        /* An unrecognized format was specified */
+        sprintf(grdelerrmsg, "cairoCFerBind_setImageName: "
+                             "unrecognized format '%s'", fmtext);
+        return 0;
+    }
+
+    /* Update the instance data structure */
+    instdata = (CairoCFerBindData *) self->instancedata;
+    instdata->imageformat = imageformat;
+    strncpy(instdata->imagename, imagename, imgnamelen);
+    instdata->imagename[imgnamelen] = '\0';
+
+    if ( strcmp(fmtext, "GIF") == 0 ) {
+        /* Change .gif filename extension to .png */
+        if ( (imgnamelen >= 4) &&
+             (strcasecmp(&(instdata->imagename[imgnamelen-4]), ".gif") == 0) )
+            strcpy(&(instdata->imagename[imgnamelen-4]), ".png");
+    }
+    else if ( strcmp(fmtext, "PLT") == 0 ) {
+        /* Change .plt filename extension to .pdf */
+        if ( (imgnamelen >= 4) &&
+             (strcasecmp(&(instdata->imagename[imgnamelen-4]), ".plt") == 0) )
+            strcpy(&(instdata->imagename[imgnamelen-4]), ".pdf");
+    }
+
+    /* Delete any existing context and surface */
+    if ( instdata->context != NULL ) {
+        cairo_destroy(instdata->context);
+        instdata->context = NULL;
+    }
+    if ( instdata->surface != NULL ) {
+        cairo_surface_finish(instdata->surface);
+        cairo_surface_destroy(instdata->surface);
+        instdata->surface = NULL;
+    }
+    instdata->somethingdrawn = 0;
+
+    /* Delete any existing linked-list pictures */
+    while ( instdata->firstpic != NULL ) {
+        delpic = instdata->firstpic;
+        instdata->firstpic = delpic->next;
+        cairo_surface_finish(delpic->surface);
+        cairo_surface_destroy(delpic->surface);
+        PyMem_Free(delpic);
+    }
+    instdata->lastpic = NULL;
+    /*
+     * Defer creating a new surface and context until a drawing
+     * request is made.  Ferret may change size and other details
+     * before actually starting to draw.
+     */
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_setWidthFactor.c b/fer/cferbind/cairoCFerBind_setWidthFactor.c
new file mode 100644
index 0000000..1a7ecd4
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_setWidthFactor.c
@@ -0,0 +1,37 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Set the scaling factor for line widths and symbol sizes
+ * to convert from points (1/72 inches) to pixels, and to 
+ * apply any additional width scaling specified by factor.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_setWidthFactor(CFerBind *self, double factor)
+{
+    CairoCFerBindData *instdata;
+
+    /* Sanity check */
+    if ( (self->enginename != CairoCFerBindName) &&
+         (self->enginename != PyQtCairoCFerBindName) ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_setWidthFactor: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    if ( factor <= 0.0 ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_setWidthFactor: "
+                            "scaling factor must be positive");
+        return 0;
+    }
+
+    instdata = (CairoCFerBindData *) self->instancedata;
+    instdata->widthfactor = CCFB_WINDOW_DPI * factor / 72.0;
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_showWindow.c b/fer/cferbind/cairoCFerBind_showWindow.c
new file mode 100644
index 0000000..4f89543
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_showWindow.c
@@ -0,0 +1,27 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * "Show" this "Window".
+ * In this case (Cairo), this function does nothing since there
+ * is no displayed window associated with this engine.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_showWindow(CFerBind *self, int visible)
+{
+    /* Sanity check - this should NOT be called by the PyQtCairo engine */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_showWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_updateWindow.c b/fer/cferbind/cairoCFerBind_updateWindow.c
new file mode 100644
index 0000000..7a49009
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_updateWindow.c
@@ -0,0 +1,26 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Updates the "Window".
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool cairoCFerBind_updateWindow(CFerBind *self)
+{
+    /* Sanity check - this should NOT be called by the PyQtCairo engine */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_updateWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    /* nothing to do */
+
+    return 1;
+}
+
diff --git a/fer/cferbind/cairoCFerBind_windowScreenInfo.c b/fer/cferbind/cairoCFerBind_windowScreenInfo.c
new file mode 100644
index 0000000..4a81d94
--- /dev/null
+++ b/fer/cferbind/cairoCFerBind_windowScreenInfo.c
@@ -0,0 +1,32 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+
+/*
+ * Returns information about the default screen (display) of
+ * the window.  In this case (Cairo), these are hard-coded values.
+ *
+ * If an error occurs, grdelerrmsg is assigned an appropriate 
+ * error message and zero is returned; otherwise one is returned.
+ */
+grdelBool cairoCFerBind_windowScreenInfo(CFerBind *self, 
+                        float *dpix, float *dpiy,
+                        int *screenwidth, int *screenheight)
+{
+    /* Sanity check - this should NOT be called by the PyQtCairo engine */
+    if ( self->enginename != CairoCFerBindName ) {
+        strcpy(grdelerrmsg, "cairoCFerBind_windowScreenInfo: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+
+    *dpix = (float) CCFB_WINDOW_DPI;
+    *dpiy = (float) CCFB_WINDOW_DPI;
+    *screenwidth = (int) (20 * CCFB_WINDOW_DPI);
+    *screenheight = (int) (11.25 * CCFB_WINDOW_DPI);
+    return 1;
+}
+
diff --git a/fer/cferbind/cferbind.h b/fer/cferbind/cferbind.h
new file mode 100644
index 0000000..eeaa9d7
--- /dev/null
+++ b/fer/cferbind/cferbind.h
@@ -0,0 +1,104 @@
+#ifndef CFERBIND_H_
+#define CFERBIND_H_
+
+/* Make sure Python.h is always included first */
+#include <Python.h>
+/* Use of grdelBool (int) and grdelType (void *) is just to clarify intent */
+#include "grdel.h"
+
+/* Names of recognized engines */
+extern const char *CairoCFerBindName;
+extern const char *PyQtCairoCFerBindName;
+
+/*
+ * The bindings structure.  All functions should be defined in a bindings
+ * instance, but a definition may just be a function that does nothing
+ * if the action is not applicable or appropriate.
+ *
+ * The cferbind_createWindow function calls the appropriate createWindow
+ * function to create the bindings instance and any other appropriate
+ * initialization for this "Window".  Thus, there is no createWindow
+ * function in these bindings since it should never need to be called.
+ */
+typedef struct CFerBind_struct {
+     const char *enginename;
+     void       *instancedata;
+     grdelBool (*setImageName)(struct CFerBind_struct *self, const char *imagename,
+                               int imgnamelen, const char *formatname, int fmtnamelen);
+     grdelBool (*deleteWindow)(struct CFerBind_struct *self);
+     grdelBool (*setAntialias)(struct CFerBind_struct *self, int antialias);
+     grdelBool (*beginView)(struct CFerBind_struct *self,
+                            double leftfrac, double bottomfrac,
+                            double rightfrac, double topfrac, int clipit);
+     grdelBool (*clipView)(struct CFerBind_struct *self, int clipit);
+     grdelBool (*endView)(struct CFerBind_struct *self);
+     grdelBool (*beginSegment)(struct CFerBind_struct *self, int segid);
+     grdelBool (*endSegment)(struct CFerBind_struct *self);
+     grdelBool (*deleteSegment)(struct CFerBind_struct *self, int segid);
+     grdelBool (*updateWindow)(struct CFerBind_struct *self);
+     grdelBool (*clearWindow)(struct CFerBind_struct *self, grdelType fillcolor);
+     grdelBool (*redrawWindow)(struct CFerBind_struct *self, grdelType fillcolor);
+     grdelBool (*windowScreenInfo)(struct CFerBind_struct *self, float *dpix, float *dpiy,
+                             int *screenwidth, int *screenheight);
+     grdelBool (*resizeWindow)(struct CFerBind_struct *self,
+                               double width, double height);
+     grdelBool (*scaleWindow)(struct CFerBind_struct *self, double scale);
+     grdelBool (*showWindow)(struct CFerBind_struct *self, int visible);
+     grdelBool (*saveWindow)(struct CFerBind_struct *self, const char *filename,
+                             int namelen, const char *formatname, int fmtnamelen,
+                             int transbkg, double xinches, double yinches,
+                             int xpixels, int ypixels,
+                             void **annotations, int numannotations);
+     grdelType (*createColor)(struct CFerBind_struct *self, double redfrac,
+                              double greenfrac, double bluefrac, double opaquefrac);
+     grdelBool (*deleteColor)(struct CFerBind_struct *self, grdelType color);
+     grdelType (*createFont)(struct CFerBind_struct *self,
+                             const char *familyname, int namelen, double fontsize,
+                             int italic, int bold, int underlined);
+     grdelBool (*deleteFont)(struct CFerBind_struct *self, grdelType font);
+     grdelType (*createPen)(struct CFerBind_struct *self, grdelType color,
+                            double width, const char *style, int stlen,
+                            const char *capstyle, int capstlen,
+                            const char *joinstyle, int joinstlen);
+     grdelBool (*replacePenColor)(struct CFerBind_struct *self,
+                                  grdelType pen, grdelType color);
+     grdelBool (*deletePen)(struct CFerBind_struct *self, grdelType pen);
+     grdelType (*createBrush)(struct CFerBind_struct *self,
+                              grdelType color, const char *style, int stlen);
+     grdelBool (*replaceBrushColor)(struct CFerBind_struct *self,
+                                    grdelType brush, grdelType color);
+     grdelBool (*deleteBrush)(struct CFerBind_struct *self, grdelType brush);
+     grdelType (*createSymbol)(struct CFerBind_struct *self,
+                               const char *symbolname, int namelen);
+     grdelBool (*deleteSymbol)(struct CFerBind_struct *self, grdelType symbol);
+     grdelBool (*setWidthFactor)(struct CFerBind_struct *self, double widthfactor);
+     grdelBool (*drawMultiline)(struct CFerBind_struct *self, double ptsx[],
+                                double ptsy[], int numpts, grdelType pen);
+     grdelBool (*drawPoints)(struct CFerBind_struct *self, double ptsx[],
+                             double ptsy[], int numpts, grdelType symbol,
+                             grdelType color, double symsize);
+     grdelBool (*drawPolygon)(struct CFerBind_struct *self, double ptsx[],
+                              double ptsy[], int numpts, grdelType brush,
+                              grdelType pen);
+     grdelBool (*drawRectangle)(struct CFerBind_struct *self,
+                                double left, double bottom, double right,
+                                double top, grdelType brush, grdelType pen);
+     grdelBool (*drawText)(struct CFerBind_struct *self, const char *text, int textlen,
+                           double startx, double starty, grdelType font, grdelType color,
+                           double rotation);
+} CFerBind;
+
+/*
+ * Calls the appropriate createWindow function to create the bindings
+ * instance and any other appropriate initialization for this "Window". 
+ */
+CFerBind *cferbind_createWindow(const char *enginename, int engnamelen,
+                                const char *windowname, int winnamelen, int visible);
+
+/* The createWindow function for the Cairo engine */
+CFerBind *cairoCFerBind_createWindow(void);
+/* The createWindow function for the PyQtCairo engine */
+CFerBind *pyqtcairoCFerBind_createWindow(const char *windowname, int windnamelen,
+                                         int visible);
+
+#endif
diff --git a/fer/cferbind/cferbind_createWindow.c b/fer/cferbind/cferbind_createWindow.c
new file mode 100644
index 0000000..670e1da
--- /dev/null
+++ b/fer/cferbind/cferbind_createWindow.c
@@ -0,0 +1,61 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+
+/* Instantiate the globals */
+const char *CairoCFerBindName = "Cairo";
+const int lenCairoCFerBindName = 5;
+const char *PyQtCairoCFerBindName = "PipedImager";
+const int lenPyQtCairoCFerBindName = 11;
+
+/*
+ * Creates a CFerBind struct (bindings instance)
+ * appropriately assigned for the indicated graphics engine.
+ *
+ * The currently supported engines are:
+ *    "Cairo" - generation of image files only (unmapped) using Cairo
+ *    "PipedImager" - generate image file using Cairo and display using
+ *                    PipedImagerPQ
+ *
+ * For the "Cairo" engine, the windowname, winnamelen, and
+ * visible arguments are ignored as they is not applicable.
+ *
+ * Returns a pointer to the bindings instance if successful.
+ * If an error occurs, grdelerrmsg is assigned an appropriate
+ * error message and NULL is returned.
+ */
+CFerBind *cferbind_createWindow(const char *enginename, int engnamelen,
+                                const char *windowname, int winnamelen, int visible)
+{
+    CFerBind *bindings;
+    int k;
+
+    /* Check if the Cairo engine was specified */
+    if ( (engnamelen == lenCairoCFerBindName) &&
+         (strncmp(enginename, CairoCFerBindName, lenCairoCFerBindName) == 0) ) {
+        /* Create a bindings instance for a Cairo engine */
+        bindings = cairoCFerBind_createWindow();
+        return bindings;
+    }
+
+    /* Check if the PipedImager (previously called PyQtCairo) engine was specified */
+    if ( (engnamelen == lenPyQtCairoCFerBindName) &&
+         (strncmp(enginename, PyQtCairoCFerBindName, lenPyQtCairoCFerBindName) == 0) ) {
+        /* Create a bindings instance for a PipedImager engine */
+        bindings = pyqtcairoCFerBind_createWindow(windowname, winnamelen, visible);
+        return bindings;
+    }
+
+    /* Unknown CFerBind engine */
+    strcpy(grdelerrmsg, "Unknown engine: ");
+    if (engnamelen < 80)
+        k = engnamelen;
+    else
+        k = 80;
+    strncpy(grdelerrmsg + 16, enginename, k);
+    grdelerrmsg[k + 16] = '\0';
+    return NULL;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind.h b/fer/cferbind/pyqtcairoCFerBind.h
new file mode 100644
index 0000000..dac794e
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind.h
@@ -0,0 +1,26 @@
+#ifndef PYQTCAIRO_CFERBIND_H_
+#define PYQTCAIRO_CFERBIND_H_
+
+/* Make sure Python.h is always included first */
+#include <Python.h>
+#include "grdel.h"
+#include "cferbind.h"
+
+grdelBool pyqtcairoCFerBind_setImageName(CFerBind *self, const char *imagename,
+                            int imgnamelen, const char *formatname, int fmtnamelen);
+grdelBool pyqtcairoCFerBind_deleteWindow(CFerBind *self);
+grdelBool pyqtcairoCFerBind_updateWindow(CFerBind *self);
+grdelBool pyqtcairoCFerBind_clearWindow(CFerBind *self, grdelType fillcolor);
+grdelBool pyqtcairoCFerBind_redrawWindow(CFerBind *self, grdelType fillcolor);
+grdelBool pyqtcairoCFerBind_windowScreenInfo(CFerBind *self, float *dpix, float *dpiy,
+                                             int *screenwidth, int *screenheight);
+grdelBool pyqtcairoCFerBind_resizeWindow(CFerBind *self, double width, double height);
+grdelBool pyqtcairoCFerBind_scaleWindow(CFerBind *self, double scale);
+grdelBool pyqtcairoCFerBind_showWindow(CFerBind *self, int visible);
+grdelBool pyqtcairoCFerBind_saveWindow(CFerBind *self, const char *filename, int namelen,
+                                       const char *formatname, int fmtnamelen, int transbkg,
+                                       double xinches, double yinches, 
+                                       int xpixels, int ypixels,
+                                       void **annotations, int numannotations);
+
+#endif
diff --git a/fer/cferbind/pyqtcairoCFerBind_clearWindow.c b/fer/cferbind/pyqtcairoCFerBind_clearWindow.c
new file mode 100644
index 0000000..55dbfb0
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_clearWindow.c
@@ -0,0 +1,94 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Clears the displayed scene and the drawn image.
+ *
+ * This function destroys any existing surface and context if
+ * anything has been drawn.  The viewer is also cleared using
+ * the given color.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_clearWindow(CFerBind *self, grdelType fillcolor)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+    grdelType  viewercolor;
+    int        inanimation;
+    grdelBool  success;
+
+    /* Sanity checks */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_clearWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    colorobj = (CCFBColor *) fillcolor;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_clearWindow: unexpected error, "
+                            "fillcolor is not CCFBColor struct");
+        return 0;
+    }
+
+    /* If something was drawn, delete the context and surface */
+    success = cairoCFerBind_clearWindow(self, fillcolor);
+    if ( ! success ) {
+        /* grdelerrmsg already assigned */
+        return 0;
+    }
+
+    /* Create the color object for the viewer */
+    viewercolor = grdelColor(instdata->viewer, colorobj->redfrac,
+                             colorobj->greenfrac, colorobj->bluefrac,
+                             colorobj->opaquefrac);
+    if ( viewercolor == NULL ) {
+       /* grdelerrmsg already assigned */
+       return 0;
+    }
+
+    /* Only clear the displayed image if this is not in an animation */
+    fgd_getanimate_(&inanimation);
+    if ( ! inanimation ) {
+        /* Tell the viewer to clear the displayed scene */
+        success = grdelWindowClear(instdata->viewer, viewercolor);
+        if ( ! success ) {
+            /* delete the viewer color created here */
+            grdelColorDelete(viewercolor);
+            /* grdelerrmsg assigned by grdelWindowClear failure */
+            return 0;
+        }
+    }
+
+    /* Delete the viewer color object created here */
+    success = grdelColorDelete(viewercolor);
+    if ( ! success ) {
+       /* grdelerrmsg already assigned */
+       return 0;
+    }
+
+    if ( ! inanimation ) {
+        /*
+         * The viewer window was cleared, and the Cairo context and
+         * surface were deleted, so the images match.
+         */
+        instdata->imagechanged = 0;
+    }
+    else {
+        /*
+         * The viewer window was not cleared, but the Cairo context
+         * and surface were deleted, so the images probably do not match.
+         */
+        instdata->imagechanged = 1;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_createWindow.c b/fer/cferbind/pyqtcairoCFerBind_createWindow.c
new file mode 100644
index 0000000..30805ec
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_createWindow.c
@@ -0,0 +1,120 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Creates a PipedImager (previously called PyQtCairo) 
+ * instance of a CFerBind struct.
+ *
+ * A pointer to created bindings instance is returned if
+ * successful.  If an error occurs, grdelerrmsg is assigned
+ * an appropriate error message and NULL is returned.
+ */
+CFerBind *pyqtcairoCFerBind_createWindow(const char *windowname, int windnamelen,
+                                         int visible)
+{
+    CFerBind *bindings;
+    CairoCFerBindData *instdata;
+
+    /* Create the bindings structure */
+    bindings = (CFerBind *) PyMem_Malloc(sizeof(CFerBind));
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_createWindow: "
+                            "Out of memory for a CFerBind structure");
+        return NULL;
+    }
+    /* Zero out everything to catch errors */
+    memset(bindings, 0, sizeof(CFerBind));
+
+    /* Identify the type of bindings using the pointer address to the global name */
+    bindings->enginename = PyQtCairoCFerBindName;
+
+    /* binding functions specific for the PipedImager engine */
+    bindings->setImageName = pyqtcairoCFerBind_setImageName;
+    bindings->deleteWindow = pyqtcairoCFerBind_deleteWindow;
+    bindings->updateWindow = pyqtcairoCFerBind_updateWindow;
+    bindings->clearWindow = pyqtcairoCFerBind_clearWindow;
+    bindings->redrawWindow = pyqtcairoCFerBind_redrawWindow;
+    bindings->windowScreenInfo = pyqtcairoCFerBind_windowScreenInfo;
+    bindings->resizeWindow = pyqtcairoCFerBind_resizeWindow;
+    bindings->scaleWindow = pyqtcairoCFerBind_scaleWindow;
+    bindings->showWindow = pyqtcairoCFerBind_showWindow;
+    bindings->saveWindow = pyqtcairoCFerBind_saveWindow;
+
+    /* binding functions shared with the Cairo engine */
+    bindings->setAntialias = cairoCFerBind_setAntialias;
+    bindings->beginView = cairoCFerBind_beginView;
+    bindings->clipView = cairoCFerBind_clipView;
+    bindings->endView = cairoCFerBind_endView;
+    bindings->beginSegment = cairoCFerBind_beginSegment;
+    bindings->endSegment = cairoCFerBind_endSegment;
+    bindings->deleteSegment = cairoCFerBind_deleteSegment;
+    bindings->createColor = cairoCFerBind_createColor;
+    bindings->deleteColor = cairoCFerBind_deleteColor;
+    bindings->createFont = cairoCFerBind_createFont;
+    bindings->deleteFont = cairoCFerBind_deleteFont;
+    bindings->createPen = cairoCFerBind_createPen;
+    bindings->replacePenColor = cairoCFerBind_replacePenColor;
+    bindings->deletePen = cairoCFerBind_deletePen;
+    bindings->createBrush = cairoCFerBind_createBrush;
+    bindings->replaceBrushColor = cairoCFerBind_replaceBrushColor;
+    bindings->deleteBrush = cairoCFerBind_deleteBrush;
+    bindings->createSymbol = cairoCFerBind_createSymbol;
+    bindings->deleteSymbol = cairoCFerBind_deleteSymbol;
+    bindings->setWidthFactor = cairoCFerBind_setWidthFactor;
+    bindings->drawMultiline = cairoCFerBind_drawMultiline;
+    bindings->drawPoints = cairoCFerBind_drawPoints;
+    bindings->drawPolygon = cairoCFerBind_drawPolygon;
+    bindings->drawRectangle = cairoCFerBind_drawRectangle;
+    bindings->drawText = cairoCFerBind_drawText;
+
+    /* Create the instance-specific data structure */
+    bindings->instancedata = 
+        (CairoCFerBindData *) PyMem_Malloc(sizeof(CairoCFerBindData));
+    if ( bindings->instancedata == NULL ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_createWindow: "
+                            "Out of memory for a CairoCFerBindData structure");
+        PyMem_Free(bindings);
+        return NULL;
+    }
+    /* Initialize everything to zero */
+    memset(bindings->instancedata, 0, sizeof(CairoCFerBindData));
+
+    /* Set non-zero default values */
+    instdata = (CairoCFerBindData *) bindings->instancedata;
+    /* Cairo surface type - must be an image surface */
+    instdata->imageformat = CCFBIF_PNG;
+    /* default image size and minimum allowed value */
+    instdata->imagewidth = (int) 10.5 * CCFB_WINDOW_DPI;
+    instdata->imageheight = (int) 8.5 * CCFB_WINDOW_DPI;
+    instdata->minsize = 128;
+    /* default clear color of opaque white */
+    instdata->lastclearcolor.id = CCFBColorId;
+    instdata->lastclearcolor.redfrac = 1.0;
+    instdata->lastclearcolor.greenfrac = 1.0;
+    instdata->lastclearcolor.bluefrac = 1.0;
+    instdata->lastclearcolor.opaquefrac = 1.0;
+    /* default line width scaling factor */
+    instdata->widthfactor = CCFB_WINDOW_DPI * 0.75 / 72.0;
+
+    /*
+     * Get bindings to PipedImagerPQ for displaying the image.
+     * This prevents duplication of Python-calling code for those
+     * PipedImager methods interacting with the viewer.
+     */
+    instdata->viewer = grdelWindowCreate("PipedImagerPQ", 13, windowname,
+                                         windnamelen, visible);
+    if ( instdata->viewer == NULL ) {
+        /* grdelerrmsg already assigned */
+        PyMem_Free(bindings->instancedata);
+        PyMem_Free(bindings);
+        return NULL;
+    }
+
+    return bindings;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_deleteWindow.c b/fer/cferbind/pyqtcairoCFerBind_deleteWindow.c
new file mode 100644
index 0000000..2ea9ae1
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_deleteWindow.c
@@ -0,0 +1,53 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Deletes (frees) any allocated resources associated with this
+ * "Window" (bindings instance), and then deletes (frees) the
+ * bindings instance.  After calling this function, this bindings
+ * instance should no longer be used.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_deleteWindow(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_deleteWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /*
+     * First shut down the viewer and delete its bindings
+     * (contained in the instance data under these bindings).
+     */
+    success = grdelWindowDelete(instdata->viewer);
+    if ( ! success ) {
+        /* grdelerrmsg already defined */
+        return 0;
+    }
+
+    /*
+     * Then delete the cairo context, cairo surface, and
+     * these bindings.
+     */
+    success = cairoCFerBind_deleteWindow(self);
+    if ( ! success ) {
+        /* grdelerrmsg already defined */
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_redrawWindow.c b/fer/cferbind/pyqtcairoCFerBind_redrawWindow.c
new file mode 100644
index 0000000..326c379
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_redrawWindow.c
@@ -0,0 +1,75 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Redraws the displayed scene with the updated background color.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_redrawWindow(CFerBind *self, grdelType fillcolor)
+{
+    CairoCFerBindData *instdata;
+    CCFBColor *colorobj;
+    grdelType  viewercolor;
+    grdelBool  success;
+
+    /* Sanity checks */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_redrawWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    colorobj = (CCFBColor *) fillcolor;
+    if ( colorobj->id != CCFBColorId ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_redrawWindow: unexpected error, "
+                            "fillcolor is not CCFBColor struct");
+        return 0;
+    }
+
+    /* Update the clearing color for cairo */
+    success = cairoCFerBind_redrawWindow(self, fillcolor);
+    if ( ! success ) {
+        /* grdelerrmsg already assigned */
+        return 0;
+    }
+
+    /* Create the color object for the viewer */
+    viewercolor = grdelColor(instdata->viewer, colorobj->redfrac,
+                             colorobj->greenfrac, colorobj->bluefrac,
+                             colorobj->opaquefrac);
+    if ( viewercolor == NULL ) {
+       /* grdelerrmsg already assigned */
+       return 0;
+    }
+
+    /* Tell the viewer to redraw the current scene using this background color */
+    success = grdelWindowRedraw(instdata->viewer, viewercolor);
+    if ( ! success ) {
+        /* delete the viewer color created here */
+        grdelColorDelete(viewercolor);
+        /* grdelerrmsg assigned by grdelWindowClear failure */
+        return 0;
+    }
+
+    /* Delete the viewer color object created here */
+    success = grdelColorDelete(viewercolor);
+    if ( ! success ) {
+       /* grdelerrmsg already assigned */
+       return 0;
+    }
+
+    /*
+     * No changes were made to either the Cairo image or the image
+     * in the viewer window, so do not mess with instdata->imagechanged
+     */
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_resizeWindow.c b/fer/cferbind/pyqtcairoCFerBind_resizeWindow.c
new file mode 100644
index 0000000..b866e4f
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_resizeWindow.c
@@ -0,0 +1,71 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Resizes the "Window" to the given width and height.  These
+ * values are assumed to be in units of pixels.  If the size
+ * changes, this function clears the displayed scene and destroys
+ * any existing surface and context; thus clearing the image.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_resizeWindow(CFerBind *self, double width, double height)
+{
+    CairoCFerBindData *instdata;
+    int       newwidth;
+    int       newheight;
+    grdelBool success;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_resizeWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Round width and height to the nearest integer value */
+    newwidth = (int) (width + 0.5);
+    newheight = (int) (height + 0.5);
+
+    /* Check the new width and height */
+    if ( (newwidth < instdata->minsize) || (newheight < instdata->minsize) ) {
+        sprintf(grdelerrmsg, "pyqtcairoCFerBind_resizeWindow: size too small, "
+                             "width (%d) and height (%d) cannot be less "
+                             "than %d", newwidth, newheight, instdata->minsize);
+        return 0;
+    }
+
+    /* If the size is unchanged, nothing to do */
+    if ( (instdata->imagewidth == newwidth) && (instdata->imageheight == newheight) )
+        return 1;
+
+    /* Set the new size for the cairo image */
+    success = cairoCFerBind_resizeWindow(self, (double) newwidth, (double) newheight);
+    if ( ! success ) {
+        /* grdleerrmsg is already assigned */
+        return 0;
+    }
+
+    /* Tell the viewer of the new size */
+    success = grdelWindowSetSize(instdata->viewer, (double) newwidth, (double) newheight);
+    if ( ! success ) {
+        /* grdleerrmsg is already assigned */
+        return 0;
+    }
+    /*
+     * This assumes that the resize in the viewer cleared the window.
+     * The resize in Cairo deleted the context and surface.
+     */
+    instdata->imagechanged = 0;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_saveWindow.c b/fer/cferbind/pyqtcairoCFerBind_saveWindow.c
new file mode 100644
index 0000000..1ae8e45
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_saveWindow.c
@@ -0,0 +1,74 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Saves the current image to file.  Note that the viewer
+ * may have scaled the image.  If so, the scaled image is
+ * what will be saved to file.
+ *
+ * Arguments:
+ *     filename   - name of the image file to create, or an
+ *                  empty string or NULL
+ *     namelen    - actual length of filename (zero if NULL)
+ *     formatname - name of the image format (case insensitive)
+ *                  only raster image formats are supported
+ *     fmtnamelen - actual length of format (zero if NULL)
+ *     transbkg   - leave the background transparent?
+ *     xinches    - horizontal size of vector image in inches
+ *     yinches    - vertical size of vector image in inches
+ *     xpixels    - horizontal size of raster image in pixels
+ *     ypixels    - vertical size of raster image in pixels
+ *     annotations - array of annotation strings; pointers are always 8 bytes apart
+ *     numannotations - number of annotation strings
+ *
+ * If filename is empty or NULL, the imagename argument for the
+ * last call to pyqtcairoCFerBind_setImageName is used for the
+ * filename.
+ *
+ * If format is empty or NULL, the image format is determined
+ * from the extension of the filename.  In this case it is
+ * an error if the extension does not exist or is not recognized.
+ *
+ * If transbkg is non-zero, the image background will be
+ * transparent (if the format supports the alpha channel;
+ * otherwise it will be black).  If transbkg is zero, the
+ * image background will be the last clearing color specified.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_saveWindow(CFerBind *self, const char *filename,
+                       int namelen, const char *formatname, int fmtnamelen, 
+                       int transbkg, double xinches, double yinches, 
+                       int xpixels, int ypixels,
+                       void **annotations, int numannotations)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity checks */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_saveWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Tell the viewer to save the image using the given size */
+    success = grdelWindowSave(instdata->viewer, filename, namelen,
+                              formatname, fmtnamelen, transbkg,
+                              xinches, yinches, xpixels, ypixels,
+                              annotations, numannotations);
+    if ( ! success ) {
+        /* grdelerrmsg is already assigned */
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_scaleWindow.c b/fer/cferbind/pyqtcairoCFerBind_scaleWindow.c
new file mode 100644
index 0000000..50f5097
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_scaleWindow.c
@@ -0,0 +1,37 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Set the scaling factor for the displayed image.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_scaleWindow(CFerBind *self, double scale)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_scaleWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Pass the scaling factor on the the image displayer */
+    success = grdelWindowSetScale(instdata->viewer, scale);
+    if ( ! success ) {
+        /* grdelerrmsg already assigned */
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_setImageName.c b/fer/cferbind/pyqtcairoCFerBind_setImageName.c
new file mode 100644
index 0000000..807d02d
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_setImageName.c
@@ -0,0 +1,67 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Assigns the default name and format for saving the image
+ * from the PipedImagerPQ window.
+ *
+ * Arguments:
+ *     imagename  - name for the image file (can be NULL)
+ *     imgnamelen - actual length of imagename (zero if NULL)
+ *     formatname - name of the image format (case insensitive);
+ *                  (can be NULL)
+ *     fmtnamelen - actual length of formatname (zero if NULL)
+ *
+ * If formatname is "" or NULL, the filename extension of
+ * imagename, if it exists and is recognized, will determine
+ * the format.  Only raster formats are supported.
+ *
+ * The saveWindow function is used to save the (possibly
+ * scaled) image from PipedImagerPQ.  Thus, imagename
+ * and formatname are only defaults that may not be used.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_setImageName(CFerBind *self, const char imagename[],
+                         int imgnamelen, const char formatname[], int fmtnamelen)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity checks */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_setImageName: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Send the information to the image display engine */
+    success = grdelWindowSetImageName(instdata->viewer, imagename,
+                                      imgnamelen, formatname, fmtnamelen);
+    if ( ! success ) {
+        /* grdelerrmsg already assigned */
+        return 0;
+    }
+    /*
+     * A cairo_image_surface (CCFBIF_PNG) is always created and
+     * the image data is sent to PipedImagerPQ for display
+     * and saving to file.  Thus the information does not need
+     * to be recorded in the cairoCFerBindData structure.
+     *
+     * Since an image surface is always used, this call by itself
+     * does not trigger the need for a new surface or context if
+     * they exist.  If they do not exist, defer creating a new
+     * surface and context until a drawing request is made.
+     * Ferret may change size and other details before actually
+     * starting to draw.
+     */
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_showWindow.c b/fer/cferbind/pyqtcairoCFerBind_showWindow.c
new file mode 100644
index 0000000..366b286
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_showWindow.c
@@ -0,0 +1,37 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Make the viewer visible.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_showWindow(CFerBind *self, int visible)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_showWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Tell the view to make itself visible */
+    success = grdelWindowSetVisible(instdata->viewer, visible);
+    if ( ! success ) {
+        /* grdelerrmsg already assigned */
+        return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_updateWindow.c b/fer/cferbind/pyqtcairoCFerBind_updateWindow.c
new file mode 100644
index 0000000..063bb8e
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_updateWindow.c
@@ -0,0 +1,174 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <cairo/cairo.h>
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+#include "pyferret.h"
+
+/*
+ * Sends the current cairo-generated image to the viewer to be displayed.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool pyqtcairoCFerBind_updateWindow(CFerBind *self)
+{
+    CairoCFerBindData *instdata;
+    cairo_surface_t   *savesurface;
+    cairo_t           *savecontext;
+    cairo_status_t     status;
+    CCFBPicture       *thispic;
+    int width;
+    int height;
+    int stride;
+    const unsigned char *imagedata;
+    const BindObj *bindings;
+    PyObject *result;
+    PyObject *databytearray;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+    if ( ! instdata->imagechanged ) {
+        /* Nothing new about the image; ignore the call */
+        return 1;
+    }
+    if ( (instdata->surface == NULL) && (instdata->firstpic == NULL) ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: unexpected error, "
+                            "trying to update an empty image");
+        return 0;
+    }
+
+    /* Make sure the context is not in an error state */
+    if ( instdata->context != NULL ) {
+        status = cairo_status(instdata->context);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: "
+                                 "cairo context error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+    }
+
+    if ( instdata->surface != NULL ) {
+        /* Make sure all drawing to the surface is completed (paranoia) */
+        cairo_surface_flush(instdata->surface);
+        /* Make sure the surface is not in an error state */
+        status = cairo_surface_status(instdata->surface);
+        if ( status != CAIRO_STATUS_SUCCESS ) {
+            sprintf(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: "
+                                 "cairo surface error: %s", 
+                                 cairo_status_to_string(status));
+            return 0;
+        }
+    }
+
+    if ( instdata->firstpic != NULL ) {
+        /* create a temporary surface to combine all the pictures */
+        savesurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+                            instdata->imagewidth, instdata->imageheight);
+        if ( cairo_surface_status(savesurface) != CAIRO_STATUS_SUCCESS ) {
+            strcpy(grdelerrmsg, "pyqtCairoCFerBind_updateWindow: problems "
+                                "creating a combined pictures image surface");
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+            return 0;
+        }
+        savecontext = cairo_create(savesurface);
+        if ( cairo_status(savecontext) != CAIRO_STATUS_SUCCESS ) {
+            strcpy(grdelerrmsg, "pyqtCairoCFerBind_updateWindow: problems creating "
+                                "a context for the combined pictures image surface");
+            cairo_destroy(savecontext);
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+            return 0;
+        }
+        /* Draw the transparent-background images onto this temporary surface */
+        for (thispic = instdata->firstpic; thispic != NULL; thispic = thispic->next) {
+            cairo_set_source_surface(savecontext, thispic->surface, 0.0, 0.0);
+            cairo_paint(savecontext);
+        }
+        if ( instdata->surface != NULL ) {
+            cairo_set_source_surface(savecontext, instdata->surface, 0.0, 0.0);
+            cairo_paint(savecontext);
+        }
+        /* Just to be safe */
+        cairo_show_page(savecontext);
+        /* Done with the temporary context */
+        cairo_destroy(savecontext);
+        /* Just to be safe */
+        cairo_surface_flush(savesurface);
+    }
+    else {
+        /* Just use the one current surface */
+        savesurface = instdata->surface;
+    }
+
+    /* Get the image dimension and data from the image surface */
+    width = cairo_image_surface_get_width(savesurface);
+    height = cairo_image_surface_get_height(savesurface);
+    stride = cairo_image_surface_get_stride(savesurface);
+    imagedata = cairo_image_surface_get_data(savesurface);
+    if ( imagedata == NULL ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: "
+                            "cairo_image_surface_get_data failed");
+        if ( savesurface != instdata->surface ) {
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+        }
+        return 0;
+    }
+
+    bindings = grdelWindowVerify(instdata->viewer);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: unexpected error "
+                            "viewer is not a grdelWindow");
+        if ( savesurface != instdata->surface ) {
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+        }
+        return 0;
+    }
+
+    /* Call the updateWindow method of the bindings instance. */
+    databytearray = PyByteArray_FromStringAndSize((const char *) imagedata, stride * height);
+    if ( databytearray == NULL ) {
+        sprintf(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: error when creating "
+                "the image data bytearray: %s", pyefcn_get_error());
+        if ( savesurface != instdata->surface ) {
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+        }
+        return 0;
+    }
+    result = PyObject_CallMethod(bindings->pyobject, "newSceneImage",
+                                 "iiiN", width, height, stride, databytearray);
+    if ( result == NULL ) {
+        sprintf(grdelerrmsg, "pyqtcairoCFerBind_updateWindow: error when calling the "
+                "Python binding's newSceneImage method: %s", pyefcn_get_error());
+        if ( savesurface != instdata->surface ) {
+            cairo_surface_finish(savesurface);
+            cairo_surface_destroy(savesurface);
+        }
+        return 0;
+    }
+    Py_DECREF(result);
+
+    if ( savesurface != instdata->surface ) {
+        cairo_surface_finish(savesurface);
+        cairo_surface_destroy(savesurface);
+    }
+
+    instdata->imagechanged = 0;
+
+    return 1;
+}
+
diff --git a/fer/cferbind/pyqtcairoCFerBind_windowScreenInfo.c b/fer/cferbind/pyqtcairoCFerBind_windowScreenInfo.c
new file mode 100644
index 0000000..7bac417
--- /dev/null
+++ b/fer/cferbind/pyqtcairoCFerBind_windowScreenInfo.c
@@ -0,0 +1,41 @@
+/* Python.h should always be first */
+#include <Python.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "cairoCFerBind.h"
+#include "pyqtcairoCFerBind.h"
+
+/*
+ * Returns the horizontal and vertical resolution of this "Window"
+ * in units of dots (pixels) per inch.
+ *
+ * If an error occurs, grdelerrmsg is assigned an appropriate error 
+ * message and zero is returned; otherwise one is returned.
+ */
+grdelBool pyqtcairoCFerBind_windowScreenInfo(CFerBind *self, 
+                            float *dpix, float *dpiy,
+                            int *screenwidth, int *screenheight)
+{
+    CairoCFerBindData *instdata;
+    grdelBool success;
+
+    /* Sanity check */
+    if ( self->enginename != PyQtCairoCFerBindName ) {
+        strcpy(grdelerrmsg, "pyqtcairoCFerBind_windowScreenInfo: unexpected error, "
+                            "self is not a valid CFerBind struct");
+        return 0;
+    }
+    instdata = (CairoCFerBindData *) self->instancedata;
+
+    /* Get the values from viewer */
+    success = grdelWindowScreenInfo(instdata->viewer, dpix, dpiy, 
+                                    screenwidth, screenheight);
+    if ( ! success ) {
+       /* grdelerrmsg already assigned */
+       return 0;
+    }
+
+    return 1;
+}
+
diff --git a/fer/common/EF_Util.cmn b/fer/common/EF_Util.cmn
new file mode 100644
index 0000000..898fff5
--- /dev/null
+++ b/fer/common/EF_Util.cmn
@@ -0,0 +1,80 @@
+c* EF_Util.cmn
+c*
+c* Jonathan Callahan
+c* July 10th 1997
+c*
+c* This is the header file to be included by routines which
+c* are part of the Ferret External Function library.
+c*
+c*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+c* 
+c*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+c* 
+c*                 *ac* 7.99 Added unspecified_int4
+c*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+c*				because of conflict with same-name parameter
+c*				in ferret.parm
+c*                 *ac* 9.99 Separate EF_Util.parm which is all that's needed 
+c*                           in the utility fcns in fer/ef_utility and the 
+c*                           EXTERNAL statements, to be included in EF code.
+c*                 *ac* 5/06 Add ef_set_result_type
+c*
+c*            1.4: *kms*  3/12 Add Fortran interfacing C functions; add _6d functions
+c*
+
+      INCLUDE 'EF_Util.parm'
+
+      EXTERNAL ef_bail_out
+      EXTERNAL ef_get_arg_info
+      EXTERNAL ef_get_arg_mem_subscripts
+      EXTERNAL ef_get_arg_mem_subscripts_6d
+      EXTERNAL ef_get_arg_ss_extremes
+      EXTERNAL ef_get_arg_ss_extremes_6d
+      EXTERNAL ef_get_arg_string
+      EXTERNAL ef_get_arg_subscripts
+      EXTERNAL ef_get_arg_subscripts_6d
+      EXTERNAL ef_get_arg_type
+      EXTERNAL ef_get_axis_dates
+      EXTERNAL ef_get_axis_info
+      EXTERNAL ef_get_axis_info_6d
+      EXTERNAL ef_get_axis_modulo_len
+      EXTERNAL ef_get_bad_flags
+      EXTERNAL ef_get_box_hi_lim
+      EXTERNAL ef_get_box_limits
+      EXTERNAL ef_get_box_lo_lim
+      EXTERNAL ef_get_box_size
+      EXTERNAL ef_get_coordinates
+      EXTERNAL ef_get_one_val
+      EXTERNAL ef_get_res_mem_subscripts
+      EXTERNAL ef_get_res_mem_subscripts_6d
+      EXTERNAL ef_get_res_subscripts
+      EXTERNAL ef_get_res_subscripts_6d
+      EXTERNAL ef_get_result_type
+      EXTERNAL ef_get_wrk_mem_subscripts
+      EXTERNAL ef_get_wrk_mem_subscripts_6d
+      EXTERNAL ef_set_arg_desc
+      EXTERNAL ef_set_arg_name
+      EXTERNAL ef_set_arg_type
+      EXTERNAL ef_set_arg_unit
+      EXTERNAL ef_set_axis_extend
+      EXTERNAL ef_set_axis_influence
+      EXTERNAL ef_set_axis_influence_6d
+      EXTERNAL ef_set_axis_inheritance
+      EXTERNAL ef_set_axis_inheritance_6d
+      EXTERNAL ef_set_axis_limits
+      EXTERNAL ef_set_axis_reduction
+      EXTERNAL ef_set_axis_reduction_6d
+      EXTERNAL ef_set_custom_axis
+      EXTERNAL ef_set_desc
+      EXTERNAL ef_set_has_vari_args
+      EXTERNAL ef_set_num_args
+      EXTERNAL ef_set_num_work_arrays
+      EXTERNAL ef_set_piecemeal_ok
+      EXTERNAL ef_set_piecemeal_ok_6d
+      EXTERNAL ef_set_result_type
+      EXTERNAL ef_set_work_array_dims
+      EXTERNAL ef_set_work_array_dims_6d
+      EXTERNAL ef_set_work_array_lens
+      EXTERNAL ef_set_work_array_lens_6d
+      EXTERNAL ef_version_test
+
diff --git a/fer/common/EF_Util.h b/fer/common/EF_Util.h
new file mode 100644
index 0000000..a176623
--- /dev/null
+++ b/fer/common/EF_Util.h
@@ -0,0 +1,207 @@
+/* EF_Util.h
+ *
+ * Jonathan Callahan
+ * July 10th 1997
+ *
+ * This is the header file to be included by routines which
+ * are part of the Ferret External Function library.
+ *
+ * 990422 *jc* Changed "work_array_len" to "work_array_lo/hi"
+*  V6.0 *acm*  5/06 string results for external functions
+*  V6.2 *acm* 11/08 New element of the external function structure, alt_fcn_name
+*                  to store the name of a function to call if the arguments are of
+*                  a different type than defined in the current function. E.g.
+*                  this lets the user reference XCAT with string arguments and
+*                  Ferret will run XCAT_STR
+* V664  9/10 *kms* Add EF_PYTHON
+*       3/12 *kms* Add E and F dimensions; use NFERDIMS
+*/
+
+
+#ifndef _EF_UTIL_H
+#define _EF_UTIL_H
+
+/* .................... Includes .................... */
+
+/* DFTYPE, NFERDIMS, and FORTRAN defined in ferret.h */
+#include "ferret.h"
+
+/* .................... Defines ..................... */
+
+#define TRUE  1
+#define FALSE 0
+#define YES   1
+#define NO    0
+
+#define LO    0
+#define HI    1
+
+#define ATOM_NOT_FOUND 0   /* This should match the atom_not_found parameter in ferret.parm. */
+#define FERR_OK 3          /* This should match the ferr_ok parameter in errmsg.parm. */
+#define FERR_EF_ERROR 437  /* This should match the ferr_ef_error parameter in errmsg.parm. */
+
+#define EF_VERSION 1.4
+
+#define EF_MAX_NAME_LENGTH 40
+#define EF_MAX_DESCRIPTION_LENGTH 128
+#define EF_MAX_ARGS 9
+#define EF_MAX_WORK_ARRAYS 9
+#define EF_MAX_COMPUTE_ARGS 19 /* = EF_MAX_ARGS + EF_MAX_WORK_ARRAYS + 1 */
+
+enum { EF_C=1, EF_F, EF_PYTHON } EF_LANGUAGE_type;
+
+enum { X_AXIS=0, Y_AXIS, Z_AXIS, T_AXIS, E_AXIS, F_AXIS } EF_AXIS_type;
+
+/* The next two lines of parameters need to match numbers in ferret.parm */
+enum { CUSTOM=101, IMPLIED_BY_ARGS, NORMAL, ABSTRACT } EF_AXIS_SOURCE_type;
+enum { RETAINED=201, REDUCED } EF_AXIS_REDUCTION_type;
+
+/* These parameters need to match numbers in grid_chg_fcns.parm */
+enum { FLOAT_ARG=1, STRING_ARG } EF_ARG_type;
+
+/* These parameters need to match numbers in grid_chg_fcns.parm */
+enum { FLOAT_RETURN=1, STRING_RETURN } EF_RETURN_type;
+
+enum { CANNOT_ALLOCATE, INSUFFICIENT_DATA } EF_ERROR_type;
+
+/* .................... Typedefs .................... */
+
+typedef struct {
+  int  will_be, modulo;
+  int  ss_lo, ss_hi, ss_incr;
+  double ww_lo, ww_hi, ww_del;
+  char unit[EF_MAX_NAME_LENGTH];
+} Axis;
+
+
+/*
+ * This structure defines the information we can know about
+ * an internal function.  Ferret gets information from this
+ * structure by calling one of the C routines beginning with
+ * "efcn_".
+ */
+typedef struct {
+  /* Information about the overall function */
+  DFTYPE version;
+  char description[EF_MAX_DESCRIPTION_LENGTH];
+  char alt_fcn_name[EF_MAX_NAME_LENGTH];
+  int  language;
+  int  num_reqd_args, has_vari_args;
+  int  num_work_arrays;
+  int  work_array_lo[EF_MAX_WORK_ARRAYS][NFERDIMS];
+  int  work_array_hi[EF_MAX_WORK_ARRAYS][NFERDIMS];
+  int  axis_will_be[NFERDIMS];
+  int  axis_reduction[NFERDIMS];
+  int  piecemeal_ok[NFERDIMS];
+  int  return_type;
+  Axis axis[NFERDIMS];
+
+  /* Information specific to each argument of the function */
+  int  axis_implied_from[EF_MAX_ARGS][NFERDIMS];
+  int  axis_extend_lo[EF_MAX_ARGS][NFERDIMS];
+  int  axis_extend_hi[EF_MAX_ARGS][NFERDIMS];
+  int  arg_type[EF_MAX_ARGS];
+  char arg_name[EF_MAX_ARGS][EF_MAX_NAME_LENGTH];
+  char arg_unit[EF_MAX_ARGS][EF_MAX_NAME_LENGTH];
+  char arg_desc[EF_MAX_ARGS][EF_MAX_DESCRIPTION_LENGTH];
+} ExternalFunctionInternals;
+
+/*
+ * This structure defines the basic element of the
+ * GLOBAL_ExternalFunctionList.
+ */
+typedef struct {
+  void *handle;
+  char name[EF_MAX_NAME_LENGTH];
+  char path[EF_MAX_DESCRIPTION_LENGTH];
+  int id, already_have_internals;
+  ExternalFunctionInternals *internals_ptr;
+} ExternalFunction;
+
+/* ................ Global Variables ................ */
+/*
+ * The memory_ptr, mr_list_ptr and cx_list_ptr are obtained from Ferret
+ * and cached whenever they are passed into one of the "efcn_" functions.
+ * These pointers can be accessed by the utility functions in libef_util
+ * or lib_ef_c_util.  This way the EF writer does not need to see them.
+ */
+extern DFTYPE *GLOBAL_memory_ptr;
+extern int    *GLOBAL_mr_list_ptr;
+extern int    *GLOBAL_cx_list_ptr;
+extern int    *GLOBAL_mres_ptr;
+extern DFTYPE *GLOBAL_bad_flag_ptr;
+
+
+/* prototypes of external function used in ef funtions and PyFerret C functions */
+extern ExternalFunction *ef_ptr_from_id_ptr(int *id_ptr);
+extern void FORTRAN(ef_get_arg_subscripts_6d)(int *id, int steplo[][6], int stephi[][6], int incr[][6]);
+/* the coords argument in ef_get_coordinates is explicitly real*8  */
+extern void FORTRAN(ef_get_coordinates)(int *id, int *arg, int *axis, int *lo, int *hi, double coords[]);
+extern void FORTRAN(ef_get_box_size)(int *id, int *arg, int *axis, int *lo, int *hi, DFTYPE sizes[]);
+/* the lo_lims and hi_lims arguments in ef_get_box_limits is explicitly real*8 */
+extern void FORTRAN(ef_get_box_limits)(int *id, int *arg, int *axis, int *lo, int *hi, 
+                                       double lo_lims[], double hi_lims[]);
+/* the modlen argument in ef_get_axis_modulo_len is explicitly real*8 */
+extern void FORTRAN(ef_get_axis_modulo_len)(int *id, int *arg, int *axis, double *modlen);
+extern void FORTRAN(ef_get_one_val_sub)(int *id_ptr, DFTYPE *mem_ptr,
+                                        int *arg_ptr, DFTYPE *val_ptr);
+
+/* these are called by the 4D function definitions */
+extern void FORTRAN(ef_set_axis_influence_6d)(int *id_ptr, int *arg,
+                                              int *xax, int *yax, int *zax,
+                                              int *tax, int *eax, int *fax);
+extern void FORTRAN(ef_set_axis_inheritance_6d)(int *id_ptr,
+                                                int *xax, int *yax, int *zax,
+                                                int *tax, int *eax, int *fax);
+extern void FORTRAN(ef_set_axis_reduction_6d)(int *id_ptr,
+                                              int *xax, int *yax, int *zax,
+                                              int *tax, int *eax, int *fax);
+extern void FORTRAN(ef_set_piecemeal_ok_6d)(int *id_ptr,
+                                            int *xax, int *yax, int *zax,
+                                            int *tax, int *eax, int *fax);
+extern void FORTRAN(ef_set_work_array_dims_6d)(int *id_ptr, int *iarray,
+                                               int *xlo, int *ylo, int *zlo,
+                                               int *tlo, int *elo, int *flo,
+                                               int *xhi, int *yhi, int *zhi,
+                                               int *thi, int *ehi, int *fhi);
+extern void FORTRAN(ef_set_work_array_lens_6d)(int *id_ptr, int *iarray,
+                                               int *xlen, int *ylen, int *zlen,
+                                               int *tlen, int *elen, int *flen);
+
+extern void FORTRAN(ef_version_test)( DFTYPE * );
+
+extern void FORTRAN(ef_set_num_args)( int *, int * );
+extern void FORTRAN(ef_set_num_work_arrays)( int *, int * );
+extern void FORTRAN(ef_set_work_array_lens)( int *, int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_work_array_dims)( int *, int *, int *, int *, int *, int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_has_vari_args)( int *, int * );
+extern void FORTRAN(ef_set_axis_inheritance)( int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_piecemeal_ok)( int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_result_type)(int *, int *);
+extern void FORTRAN(ef_set_desc_sub)(int *, char *);
+
+extern void FORTRAN(ef_set_axis_influence)( int *, int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_axis_reduction)( int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_axis_extend)( int *, int *, int *, int *, int * );
+extern void FORTRAN(ef_set_axis_limits)(int *, int *, int *, int *);
+
+extern void FORTRAN(ef_set_arg_type)( int *, int *, int *);
+extern void FORTRAN(ef_set_arg_name_sub)(int *, int *, char *);
+extern void FORTRAN(ef_set_arg_desc_sub)(int *, int *, char *);
+extern void FORTRAN(ef_set_custom_axis_sub)(int *, int *, DFTYPE *, DFTYPE *, DFTYPE *, char *, int *);
+
+extern void FORTRAN(ef_get_bad_flags)(int *, DFTYPE *, DFTYPE *);
+extern void FORTRAN(ef_get_arg_type)(int *, int *, int *);
+extern void FORTRAN(ef_get_result_type)(int *, int *);
+
+extern void FORTRAN(ef_get_one_val)(int *, int *, DFTYPE *);
+
+extern void FORTRAN(ef_put_string)(char* , int* , char** );
+extern void FORTRAN(ef_put_string_ptr)(char**, char**);
+
+extern void FORTRAN(ef_get_cx_list)(int *);
+extern void FORTRAN(ef_get_mr_list)(int *);
+extern void FORTRAN(ef_get_mres)(int *);
+
+#endif /* _EF_UTIL_H */
+
diff --git a/fer/common/EF_Util.parm b/fer/common/EF_Util.parm
new file mode 100644
index 0000000..8b05a7a
--- /dev/null
+++ b/fer/common/EF_Util.parm
@@ -0,0 +1,79 @@
+c* EF_Util.parm
+c*
+c* Jonathan Callahan
+c* July 10th 1997
+c*
+c* This is the header file to be included by routines which
+c* are part of the Ferret External Function library.
+c*
+c*       EXTERNAL ef_version 1.1: *jc* 9.98 Added       EXTERNAL ef_max_work_arrays
+c* 
+c*            1.3: *jc* 4.99 Changed "work_array_len" to "work_array_lo/hi" in EF_Util.h
+c* 
+c*                 *ac* 7.99 Added unspecified_int4
+c*		   *sh* 8.99 Changed unspeficied_int4 to EF_unspecified_int4
+c*				because of conflict with same-name parameter
+c*				in ferret.parm
+c*		   *ac* 9.99 Separate the parameters (previously EF_Util.cmn)  
+c*				external statements which will be included
+c*				in external functions code.
+c*		   *kob* 1/02 - add in int_buff and size_ibuff to use for
+c*                              strings being converted from c to fortran
+c*                 *acm* 1/03 - Add float_return and string_return
+c*           V6.02 *acm*11/06 - Change unspecified_int4 to -999. Fixes bug 1463 where
+c*                              where an index value of -111 was confused with this flag
+c*	     V6.8  *acm* 1/12 - Double precision Ferret. Declare arguments
+c*				and function results with either 2 or 1 as
+c*				the first (extra) dimension
+c*                 *kms* 2/12 - added e_axis and f_axis; increment ef_version 
+c*                 *kms* 3/12 - remove int_buff and size_ibuff since they are
+c*                              not in a common block (declare locally when needed)
+
+	integer ef_c, ef_f, yes, no,
+     .      x_axis, y_axis, z_axis, t_axis, e_axis, f_axis,
+     .      arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
+     .      custom, implied_by_args, normal, abstract,
+     .      retained, reduced, float_arg, string_arg, 
+     .	    ef_max_args, ef_max_work_arrays, ef_max_name_length, 
+     .      ef_max_description, ef_unspecified_int4,
+     .      float_return, string_return
+
+	parameter ( ef_c = 1,
+     .	            ef_f = 2,
+     .	            yes = 1,
+     .	            no = 0, 
+     .	            x_axis=1, 
+     .	            y_axis=2, 
+     .	            z_axis=3, 
+     .	            t_axis=4, 
+     .	            e_axis=5, 
+     .	            f_axis=6, 
+     .              arg1 = 1,
+     .              arg2 = 2,
+     .              arg3 = 3,
+     .              arg4 = 4,
+     .              arg5 = 5,
+     .              arg6 = 6,
+     .              arg7 = 7,
+     .              arg8 = 8,
+     .              arg9 = 9,
+     .	            custom = 101, 
+     .	            implied_by_args=102, 
+     .	            normal = 103, 
+     .	            abstract = 104, 
+     .              retained = 201,
+     .              reduced = 202,
+     .              float_arg = 1,
+     .              string_arg = 2,
+     .	            ef_max_args=9, 
+     .	            ef_max_work_arrays=9, 
+     .	            ef_max_name_length=40, 
+     .	            ef_max_description = 128, 
+     .	            ef_unspecified_int4 = -999,
+     .              float_return = 1,
+     .              string_return = 2)
+
+	real ef_version
+
+	parameter (ef_version = 1.4) 
+
diff --git a/fer/common/EF_mem_subsc.cmn b/fer/common/EF_mem_subsc.cmn
new file mode 100644
index 0000000..a260f7c
--- /dev/null
+++ b/fer/common/EF_mem_subsc.cmn
@@ -0,0 +1,146 @@
+* EF_mem_subsc.cmn - COMMON/ EF_MEM_SUBSC /
+*
+* Jonathan Callahan
+* September, 1998
+*
+* Subscript limits required to use adjustable array declarations in external
+* functions.  The "mem" subscripts will dimension arrays for Ferret
+* "memory resident" values (variables) while the "wrk" arrays are
+* dimension "working storage" arrays which are requested by the external
+* function.
+*
+* The subroutine efcn_compute will copy the contents of xmem_subsc.cmn
+* to the "mem" values before calling the external function's '_compute'
+* routine.  The "wrk" values will also be filled in at this time.
+*
+* 2/12 *kms* add E and F dimensions
+*            moved to EF_mem_subsc.defcmn so EF_mem_subsc is the external declaration
+* 6/12 *kms* added EXTERNAL since this block is part of Ferret
+* 8/12 *kms* added FERRET_ prefix to common block name to identify source 
+*            (primarily for PyFerret where this becomes global under Python)
+*
+
+*************************************************************************
+******                  PARAMETER DEFINITIONS                      ******
+
+        INTEGER     ef_max_mem_args
+        PARAMETER ( ef_max_mem_args = 12 )
+
+        COMMON / FERRET_EF_MEM_SUBSC /
+     .      mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox,
+     .      mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox,
+     .      mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy,
+     .      mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy,
+     .      mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz,
+     .      mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz,
+     .      mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot,
+     .      mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot,
+     .      mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe,
+     .      mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe,
+     .      mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof,
+     .      mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof,
+     .
+     .      memreslox, memresloy, memresloz,
+     .      memreslot, memresloe, memreslof,
+     .
+     .      mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix,
+     .      mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix,
+     .      mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy,
+     .      mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy,
+     .      mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz,
+     .      mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz,
+     .      mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit,
+     .      mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit,
+     .      mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie,
+     .      mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie,
+     .      mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif,
+     .      mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif,
+     .
+     .      memreshix, memreshiy, memreshiz,
+     .      memreshit, memreshie, memreshif,
+     .
+     .      wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox,
+     .      wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox,
+     .      wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy,
+     .      wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy,
+     .      wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz,
+     .      wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz,
+     .      wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot,
+     .      wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot,
+     .      wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe,
+     .      wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe,
+     .      wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof,
+     .      wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof,
+     .
+     .      wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix,
+     .      wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix,
+     .      wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy,
+     .      wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy,
+     .      wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz,
+     .      wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz,
+     .      wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit,
+     .      wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit,
+     .      wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie,
+     .      wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie,
+     .      wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif,
+     .      wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
+
+        INTEGER
+     .      mem1lox, mem2lox, mem3lox, mem4lox,  mem5lox,  mem6lox,
+     .      mem7lox, mem8lox, mem9lox, mem10lox, mem11lox, mem12lox,
+     .      mem1loy, mem2loy, mem3loy, mem4loy,  mem5loy,  mem6loy,
+     .      mem7loy, mem8loy, mem9loy, mem10loy, mem11loy, mem12loy,
+     .      mem1loz, mem2loz, mem3loz, mem4loz,  mem5loz,  mem6loz,
+     .      mem7loz, mem8loz, mem9loz, mem10loz, mem11loz, mem12loz,
+     .      mem1lot, mem2lot, mem3lot, mem4lot,  mem5lot,  mem6lot,
+     .      mem7lot, mem8lot, mem9lot, mem10lot, mem11lot, mem12lot,
+     .      mem1loe, mem2loe, mem3loe, mem4loe,  mem5loe,  mem6loe,
+     .      mem7loe, mem8loe, mem9loe, mem10loe, mem11loe, mem12loe,
+     .      mem1lof, mem2lof, mem3lof, mem4lof,  mem5lof,  mem6lof,
+     .      mem7lof, mem8lof, mem9lof, mem10lof, mem11lof, mem12lof,
+     .
+     .      memreslox, memresloy, memresloz,
+     .      memreslot, memresloe, memreslof,
+     .
+     .      mem1hix, mem2hix, mem3hix, mem4hix,  mem5hix,  mem6hix,
+     .      mem7hix, mem8hix, mem9hix, mem10hix, mem11hix, mem12hix,
+     .      mem1hiy, mem2hiy, mem3hiy, mem4hiy,  mem5hiy,  mem6hiy,
+     .      mem7hiy, mem8hiy, mem9hiy, mem10hiy, mem11hiy, mem12hiy,
+     .      mem1hiz, mem2hiz, mem3hiz, mem4hiz,  mem5hiz,  mem6hiz,
+     .      mem7hiz, mem8hiz, mem9hiz, mem10hiz, mem11hiz, mem12hiz,
+     .      mem1hit, mem2hit, mem3hit, mem4hit,  mem5hit,  mem6hit,
+     .      mem7hit, mem8hit, mem9hit, mem10hit, mem11hit, mem12hit,
+     .      mem1hie, mem2hie, mem3hie, mem4hie,  mem5hie,  mem6hie,
+     .      mem7hie, mem8hie, mem9hie, mem10hie, mem11hie, mem12hie,
+     .      mem1hif, mem2hif, mem3hif, mem4hif,  mem5hif,  mem6hif,
+     .      mem7hif, mem8hif, mem9hif, mem10hif, mem11hif, mem12hif,
+     .
+     .      memreshix, memreshiy, memreshiz,
+     .      memreshit, memreshie, memreshif,
+     .
+     .      wrk1lox, wrk2lox, wrk3lox, wrk4lox,  wrk5lox,  wrk6lox,
+     .      wrk7lox, wrk8lox, wrk9lox, wrk10lox, wrk11lox, wrk12lox,
+     .      wrk1loy, wrk2loy, wrk3loy, wrk4loy,  wrk5loy,  wrk6loy,
+     .      wrk7loy, wrk8loy, wrk9loy, wrk10loy, wrk11loy, wrk12loy,
+     .      wrk1loz, wrk2loz, wrk3loz, wrk4loz,  wrk5loz,  wrk6loz,
+     .      wrk7loz, wrk8loz, wrk9loz, wrk10loz, wrk11loz, wrk12loz,
+     .      wrk1lot, wrk2lot, wrk3lot, wrk4lot,  wrk5lot,  wrk6lot,
+     .      wrk7lot, wrk8lot, wrk9lot, wrk10lot, wrk11lot, wrk12lot,
+     .      wrk1loe, wrk2loe, wrk3loe, wrk4loe,  wrk5loe,  wrk6loe,
+     .      wrk7loe, wrk8loe, wrk9loe, wrk10loe, wrk11loe, wrk12loe,
+     .      wrk1lof, wrk2lof, wrk3lof, wrk4lof,  wrk5lof,  wrk6lof,
+     .      wrk7lof, wrk8lof, wrk9lof, wrk10lof, wrk11lof, wrk12lof,
+     .
+     .      wrk1hix, wrk2hix, wrk3hix, wrk4hix,  wrk5hix,  wrk6hix,
+     .      wrk7hix, wrk8hix, wrk9hix, wrk10hix, wrk11hix, wrk12hix,
+     .      wrk1hiy, wrk2hiy, wrk3hiy, wrk4hiy,  wrk5hiy,  wrk6hiy,
+     .      wrk7hiy, wrk8hiy, wrk9hiy, wrk10hiy, wrk11hiy, wrk12hiy,
+     .      wrk1hiz, wrk2hiz, wrk3hiz, wrk4hiz,  wrk5hiz,  wrk6hiz,
+     .      wrk7hiz, wrk8hiz, wrk9hiz, wrk10hiz, wrk11hiz, wrk12hiz,
+     .      wrk1hit, wrk2hit, wrk3hit, wrk4hit,  wrk5hit,  wrk6hit,
+     .      wrk7hit, wrk8hit, wrk9hit, wrk10hit, wrk11hit, wrk12hit,
+     .      wrk1hie, wrk2hie, wrk3hie, wrk4hie,  wrk5hie,  wrk6hie,
+     .      wrk7hie, wrk8hie, wrk9hie, wrk10hie, wrk11hie, wrk12hie,
+     .      wrk1hif, wrk2hif, wrk3hif, wrk4hif,  wrk5hif,  wrk6hif,
+     .      wrk7hif, wrk8hif, wrk9hif, wrk10hif, wrk11hif, wrk12hif
+
diff --git a/fer/common/command.parm b/fer/common/command.parm
new file mode 100644
index 0000000..caff04f
--- /dev/null
+++ b/fer/common/command.parm
@@ -0,0 +1,71 @@
+* COMMAND.PARM
+* command numbers
+* V500 *sh* 2/99 -- added POLYGON command
+
+	INTEGER		cmnd_set,
+     .			cmnd_show,
+     .			cmnd_cancel,
+     .			cmnd_contour,
+     .			cmnd_list,
+     .			cmnd_plot,
+     .			cmnd_go,
+     .			cmnd_help,
+     .			cmnd_load,
+     .			cmnd_define,
+     .			cmnd_exit,
+     .			cmnd_message,
+     .			cmnd_vector,
+     .			cmnd_pplus,
+     .			cmnd_frame,
+     .			cmnd_repeat,
+     .			cmnd_stat,
+     .			cmnd_shade,
+     .			cmnd_spawn,
+     .			cmnd_user,
+     .			cmnd_wire,
+     .			cmnd_query,
+     .			cmnd_if,
+     .			cmnd_else,
+     .			cmnd_elif,
+     .			cmnd_endif,
+     .			cmnd_polygon,
+     .			cmnd_semicolon
+	INTEGER		subcmnd_variable,
+     .			subcmnd_set_data,
+     .			subcmnd_set_window,
+     .			subcmnd_canc_data,
+     .			subcmnd_canc_window
+
+	PARAMETER    (	cmnd_set     = 1,
+     .			cmnd_show    = 2,
+     .			cmnd_cancel  = 3,
+     .			cmnd_contour = 4,
+     .			cmnd_list    = 5,
+     .			cmnd_plot    = 6,
+     .			cmnd_go      = 7,
+     .			cmnd_help    = 8,
+     .			cmnd_load    = 9,
+     .			cmnd_define  = 10,
+     .			cmnd_exit    = 11,
+     .			cmnd_message = 12,
+     .			cmnd_vector  = 13,
+     .			cmnd_pplus   = 14,
+     .			cmnd_frame   = 15,
+     .			cmnd_repeat  = 16,
+     .			cmnd_stat    = 17,
+     .			cmnd_shade   = 18,
+     .			cmnd_spawn   = 19,
+     .			cmnd_user    = 20,
+     .			cmnd_wire    = 21,
+     .			cmnd_query   = 22,
+     .			cmnd_if      = 23,
+     .			cmnd_else    = 24,
+     .			cmnd_elif    = 25,
+     .			cmnd_endif   = 26,
+     .			cmnd_polygon = 27,
+     .			cmnd_semicolon = -123 ) ! not a real command
+	PARAMETER     (	subcmnd_variable = 4,
+     .			subcmnd_set_data = 6,
+     .			subcmnd_set_window = 2,
+     .			subcmnd_canc_data= 6,
+     .			subcmnd_canc_window = 2)
diff --git a/fer/common/dsimple.h b/fer/common/dsimple.h
new file mode 100644
index 0000000..a95f8ce
--- /dev/null
+++ b/fer/common/dsimple.h
@@ -0,0 +1,53 @@
+/* $XConsortium: dsimple.h,v 1.3 90/04/28 12:07:00 rws Exp $ */
+/*
+ * Just_display.h: This file contains the definitions needed to use the
+ *                 functions in just_display.c.  It also declares the global
+ *                 variables dpy, screen, and program_name which are needed to
+ *                 use just_display.c.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ *
+ * Send bugs, etc. to chariot at athena.mit.edu.
+ */
+
+    /* Global variables used by routines in just_display.c */
+
+char *program_name = "unknown_program";       /* Name of this program */
+Display *dpy;                                 /* The current display */
+int screen;                                   /* The current screen */
+
+#define INIT_NAME program_name=argv[0]        /* use this in main to setup
+                                                 program_name */
+
+    /* Declaritions for functions in just_display.c */
+
+void Fatal_Error();
+char *Malloc();
+char *Realloc();
+char *Get_Display_Name();
+Display *Open_Display();
+void Setup_Display_And_Screen();
+XFontStruct *Open_Font();
+void Beep();
+Pixmap ReadBitmapFile();
+void WriteBitmapFile();
+Window Select_Window_Args();
+
+#define X_USAGE "[host:display]"              /* X arguments handled by
+						 Get_Display_Name */
+#define SELECT_USAGE "[-root|-id <id>|-name <name>]"
+
+/*
+ * Other_stuff.h: Definitions of routines in other_stuff.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ *
+ * Send bugs, etc. to chariot at athena.mit.edu.
+ */
+
+unsigned long Resolve_Color();
+Pixmap Bitmap_To_Pixmap();
+Window Select_Window();
+void out();
+void blip();
+Window Window_With_Name();
diff --git a/fer/common/errmsg.parm b/fer/common/errmsg.parm
new file mode 100644
index 0000000..cdc6e0a
--- /dev/null
+++ b/fer/common/errmsg.parm
@@ -0,0 +1,136 @@
+* ERRMSG.PARM
+* error code PARAMETERS pertaining to program GFDL
+
+* V530: *sh* 9/00 - added ferr_data_type
+* V580: *am*11/04 - added ferr_nomessge
+* V600: *am* 6/05 - added ferr_unknown_attribute
+* V600: *am* 2/06 - added ferr_not_attribute
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V684 9/12 *acm*  - Add error code for file not found
+*                    (error message for font files not found)
+* V685+ *sh* 10/13 - added ferr_unknown_auxvar
+
+* error coding:
+*	gspecial +1--> gnoreport	- error codes requiring special action
+*	gnoreport+1--> greport		- error codes not requiring messages
+*	greport  +1--> ...		- error codes requiring error messages
+
+* internally used PARAMETERS:
+	INTEGER		gnum_special,gnum_noreport,gnum_report,
+     .			gspecial,    gnoreport,    greport,
+     .			ghelp_cue
+	CHARACTER*1	gno_errstring
+
+	PARAMETER     ( gspecial	= 2,	! avoid 0,1 as too special
+     .			gnoreport	= 200,
+     .			greport		= gnoreport + 200,
+     .			ghelp_cue	= greport + 1000,
+     .			gno_errstring	= ' '	)
+
+* special errors
+	INTEGER		ferr_ok,  ferr_erreq,  ferr_interrupt
+	PARAMETER     ( ferr_ok		= 1 + gspecial,
+     .			ferr_erreq	= 1 + ferr_ok,
+     .			ferr_interrupt	= 1 + ferr_erreq )
+	PARAMETER     ( gnum_special	= 3		 )
+
+* error codes requiring no message
+	INTEGER		ferr_TMAP_error, ferr_ODR_error, ferr_silent
+	PARAMETER     (	ferr_TMAP_error		= gnoreport		+ 1,
+     .			ferr_ODR_error		= ferr_TMAP_error	+ 1,
+     .			ferr_silent		= ferr_ODR_error	+ 1 )
+	PARAMETER     (	gnum_noreport	= 3 )
+
+* error codes requiring a message
+	INTEGER		ferr_insuff_memory,
+     .			ferr_too_many_vars,
+     .			ferr_perm_var,
+     .			ferr_syntax,
+     .			ferr_unknown_qualifier,
+     .			ferr_unknown_variable,
+     .			ferr_invalid_command,
+     .			ferr_regrid,
+     .			ferr_cmnd_too_complex,
+     .			ferr_unknown_data_set,
+     .			ferr_too_many_args,
+     .			ferr_not_implemented,
+     .			ferr_invalid_subcmnd,
+     .			ferr_relative_coord,
+     .			ferr_unknown_arg,
+     .			ferr_dim_underspec,
+     .			ferr_grid_definition,
+     .			ferr_internal,
+     .			ferr_line_too_long,
+     .			ferr_inconsist_plane,
+     .			ferr_inconsist_grid,
+     .			ferr_expr_too_complex,
+     .			ferr_stack_ovfl,
+     .			ferr_stack_undfl,
+     .			ferr_out_of_range,
+     .			ferr_prog_limit,
+     .			ferr_unknown_grid,
+     .			ferr_no_range,
+     .			ferr_var_not_in_set,
+     .			ferr_unknown_file_type,
+     .			ferr_limits,
+     .			ferr_descriptor,
+     .			ferr_bad_delta,
+     .			ferr_trans_nest,
+     .			ferr_state_not_set,
+     .			ferr_unknown_command,
+     .			ferr_ef_error,
+     .			ferr_data_type,
+     .			ferr_nomessge,
+     .			ferr_unknown_attribute,
+     .			ferr_not_attribute,
+     .			ferr_aggregate_error,
+     .			ferr_remotevar_error,
+     .			ferr_file_not_found,
+     .			ferr_unknown_auxvar
+	PARAMETER     ( ferr_insuff_memory	= greport		+ 1,
+     .			ferr_too_many_vars	= ferr_insuff_memory	+ 1,
+     .			ferr_perm_var		= ferr_too_many_vars	+ 1,
+     .			ferr_syntax		= ferr_perm_var		+ 1,
+     .			ferr_unknown_qualifier	= ferr_syntax		+ 1,
+     .			ferr_unknown_variable	= ferr_unknown_qualifier+ 1,
+     .			ferr_invalid_command	= ferr_unknown_variable	+ 1,
+     .			ferr_regrid		= ferr_invalid_command	+ 1,
+     .			ferr_cmnd_too_complex	= ferr_regrid		+ 1,
+     .			ferr_unknown_data_set	= ferr_cmnd_too_complex	+ 1,
+     .			ferr_too_many_args	= ferr_unknown_data_set	+ 1,
+     .			ferr_not_implemented	= ferr_too_many_args	+ 1,
+     .			ferr_invalid_subcmnd	= ferr_not_implemented	+ 1,
+     .			ferr_relative_coord	= ferr_invalid_subcmnd	+ 1,
+     .			ferr_unknown_arg	= ferr_relative_coord	+ 1,
+     .			ferr_dim_underspec	= ferr_unknown_arg	+ 1,
+     .			ferr_grid_definition	= ferr_dim_underspec	+ 1,
+     .			ferr_internal		= ferr_grid_definition	+ 1,
+     .			ferr_line_too_long	= ferr_internal		+ 1,
+     .			ferr_inconsist_plane	= ferr_line_too_long	+ 1)
+
+	PARAMETER     ( ferr_inconsist_grid	= ferr_inconsist_plane	+ 1,
+     .			ferr_expr_too_complex	= ferr_inconsist_grid	+ 1,
+     .			ferr_stack_ovfl		= ferr_expr_too_complex + 1,
+     .			ferr_stack_undfl	= ferr_stack_ovfl	+ 1,
+     .			ferr_out_of_range	= ferr_stack_undfl	+ 1,
+     .			ferr_prog_limit		= ferr_out_of_range	+ 1,
+     .			ferr_unknown_grid	= ferr_prog_limit	+ 1,
+     .			ferr_no_range		= ferr_unknown_grid	+ 1,
+     .			ferr_var_not_in_set	= ferr_no_range		+ 1,
+     .			ferr_unknown_file_type	= ferr_var_not_in_set	+ 1,
+     .			ferr_limits		= ferr_unknown_file_type+ 1,
+     .			ferr_descriptor		= ferr_limits		+ 1,
+     .			ferr_bad_delta		= ferr_descriptor	+ 1,
+     .			ferr_trans_nest		= ferr_bad_delta	+ 1,
+     .			ferr_state_not_set	= ferr_trans_nest	+ 1,
+     .			ferr_unknown_command	= ferr_state_not_set    + 1,
+     .			ferr_ef_error	        = ferr_unknown_command	+ 1,
+     .			ferr_data_type	        = ferr_ef_error 	+ 1,
+     .			ferr_nomessge	        = ferr_data_type 	+ 1,
+     .                  ferr_unknown_attribute  = ferr_nomessge         + 1,
+     .                  ferr_not_attribute      = ferr_unknown_attribute+ 1,
+     .                  ferr_aggregate_error    = ferr_not_attribute    + 1,
+     .                  ferr_remotevar_error    = ferr_aggregate_error  + 1,
+     .                  ferr_file_not_found     = ferr_remotevar_error  + 1,
+     .			ferr_unknown_auxvar	= ferr_file_not_found   + 1)
+	PARAMETER     ( gnum_report	= 45 )
diff --git a/fer/common/ferret.h b/fer/common/ferret.h
new file mode 100644
index 0000000..dd42e10
--- /dev/null
+++ b/fer/common/ferret.h
@@ -0,0 +1,120 @@
+#ifndef _FERRET_H 
+#define _FERRET_H
+
+
+/* non-ANSI function prototypes */
+#ifdef NO_ENTRY_NAME_UNDERSCORES      /*added ifdef for HP port *kob* 6.95*/
+
+void ctrlc_ast();   /* pointer to ^C interrupt routine */
+void initialize();
+void set_ctrl_c(); /* void set_ctrl_c_( void (*CTRLC_AST_)() ); */ 
+void help_text();
+void init_journal( );
+void no_journal( );
+void proclaim_c( );
+void init_memory( );
+void ferret_dispatch( );
+void save_ppl_memory_size( );
+void get_ppl_memory_size( );
+void reallo_ppl_memory();
+void ferret_dispatch_c();
+void WindowMapping();
+void mode_gui_on();
+void secs_to_date_c();
+double tm_secs_from_bc();
+void xgks_x_events();
+void gescinqxattr();
+void set_batch_graphics();
+void set_secure();
+void set_server();
+int  is_secure();
+
+#else
+
+void ctrlc_ast_();   /* pointer to ^C interrupt routine */
+void initialize_();
+void set_ctrl_c_(); /* void set_ctrl_c_( void (*CTRLC_AST_)() ); */ 
+void help_text();
+void init_journal_( );
+void no_journal_( );
+void proclaim_c_( );
+void init_memory_( );
+void ferret_dispatch_( );
+void save_ppl_memory_size_( );
+void get_ppl_memory_size_( );
+void ferret_dispatch_c();
+void WindowMapping();
+void mode_gui_on();
+void secs_to_date_c();
+double tm_secs_from_bc_();
+void xgks_x_events();
+void gescinqxattr();
+void set_batch_graphics_();
+void set_secure();
+void set_server();
+int  is_secure_();
+
+#endif
+
+#define NFERDIMS 6
+
+/* memory configuration defaults */
+/* NOTE!! PMEM_BLK_SIZE must match pmem_blk_size in xvariables.cmn */
+/* * V62  2/09 *acm*  increase initial memory by 4. */
+#define PMEM_BLK_SIZE 2*(160*100*4/10)  /*  2* 9/01 *sh* */
+#define PMAX_MEM_BLKS 2000
+
+/* from XPROG_STATE COMMON */
+#define TTOUT_LUN 6
+
+/* these parameters describe the first few integers of the buffer
+ returned by FERRET to its GUI*/
+#define FRTN_CONTROL  0    /* 1 in FORTRAN */
+#define FRTN_STATUS   1    /* 2 in FORTRAN */
+#define FRTN_ACTION   2    /* 3 in FORTRAN */
+#define FRTN_IDATA1   5    /* 6 in FORTRAN */
+#define FRTN_IDATA2   6    /* 7 in FORTRAN */
+#define FRTN_IDATA3   7    /* 8 in FORTRAN */
+
+/* who is in control according to return_buff(frtn_control) ?
+when the GUI is running FERRET control may return to the GUI at times
+other than at the completion of a command - for example, when FERRET
+is requesting that a warning message be displayed or that memory be
+reconfigured.  These codes indicate why FERRET has returned.
+FERRET will reset the control variable to "ctrl_not_finished" if
+the given command was really multiple commands and they are not yet complete*/
+#define FCTRL_BACK_TO_GUI  1
+#define FCTRL_IN_FERRET    2
+
+/* what special action has FERRET requested in return_buff(frtn_action) ? */
+#define FACTN_NO_ACTION        0
+#define FACTN_MEM_RECONFIGURE  1
+#define FACTN_EXIT             2
+#define FACTN_DISPLAY_WARNING  3
+#define FACTN_DISPLAY_ERROR    4
+#define FACTN_DISPLAY_TEXT     5
+#define FACTN_SYNCH_SET_DATA   6  /* added 11/1/94 */
+#define FACTN_SYNCH_LET        7
+#define FACTN_SYNCH_WINDOW     8
+#define FACTN_PAUSE           10
+
+/* Easier way of handling FORTRAN calls with underscore/no underscore */
+#ifndef FORTRAN
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+#endif
+
+/* *acm*  1/12 - Ferret 6.8 double-precision ferret */
+/* Easier way of handling single/double floating-point declarations */
+
+#ifdef double_p
+#define DFTYPE double
+#else
+#define DFTYPE float
+#endif
+
+#endif /* _FERRET_H */
+
diff --git a/fer/common/ferret.parm b/fer/common/ferret.parm
new file mode 100644
index 0000000..6404093
--- /dev/null
+++ b/fer/common/ferret.parm
@@ -0,0 +1,695 @@
+* FERRET.PARM
+* 7/96: added _4d_ transforms
+* 11/96: added pcdf_mode_* (for DODS caching)
+* 12/96: added pfcn_axis_* (for grid-changing functions)
+*	   and alg_grid_chg_fcn
+*  1/97: added "pcg_" parameters for grid changing functions
+*  9/97: added @NRDA,NRDB,NRIA,NRIB transforms
+* 10/97: added prgrd_xact_pts (eliminated prgrd_nearest)
+* 10/98: *jc* added pgc_span_*, trans_reduced (for grid-changing functions)
+* 12/98: added cat_const_var and alg_const_var
+*  1/99: added cat_string and alg_string
+*  8/99: *sh* added cat_work_mr
+* 12/99: *sh* added uvlim_hidden
+* V510 *sh* 1/00 - added uvar_on_hold
+* V530: *sh* 8/00 -- added ptype_* - data types
+*	*sh* 10/00 - increased max_context to support more complex expressions
+*	*sh* 3/00 -- added g=ax at near
+* V532: *sh* 5/01 - redefined arbitrary_large/small_<type>
+* V533: *sh* 6/01 - added transformation trans_event_mask (@evnt)
+*	          - ptype_native -> ptype_unknown
+*	     7/01 - replace alg_no_op with alg_if_marker and alg_then_marker
+* V550: *acm*9/02 - Increase max_gfdl_dsets to 100, along with maxdsets.
+*       *acm*10/02- Increase max_cx_predefined to 100: more user-defined regions.
+* V554 1/04 *acm* Add category cat_counter_var, and param alg_counter_var
+* V600 8/05 *acm* Add category cat_attrib_val, and param alg_attrib_val
+* V602 11/06 *acm* - Change unspecified_int4 to -999. Fixes bug 1463 where
+*                    where an index value of -111 was confused with this flag
+* V603 5/07  *acm* - added MODNBD modulo regridding statistic
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+* PyFr 11/10 *kms* - added category cat_pystat_var (python static variable)
+* V680  2/12 *kms* Add e_dim, and f_dim parameters, nferdims is in tmap_dims.parm
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690 12/13-3/14 *sh* added max_auxregrid_trans for aux variable regridding,
+*		  and the pcurv_ parameters for automated aux var regridding
+*		  pauto_1pt_ax, pinfer_frm_aux
+*		  added patnam_sigma, patnam_curvx, patnam_curvy
+* 		  turned max_context into a variable to allow aux frames above it
+
+* this should always match maxdsets in TMAP_FORMAT:
+	INTEGER		max_gfdl_dsets
+	PARAMETER     (	max_gfdl_dsets	  = 100 )! = maxdsets in XDSET_INFO
+
+* numerical constants
+	REAL		deg2rad, radius, deg2km, deg2m, m_radius
+	PARAMETER     ( deg2rad = 3.141592 / 180,
+     .			radius = 6370.E5,		! cm
+     .			m_radius = radius / 100.,	! meters
+     .			deg2km = deg2rad * radius * 1.E-5,
+     .			deg2m  = deg2km * 1000.  )
+
+* names of dimensions
+        INTEGER     x_dim,   y_dim,   z_dim,
+     .              t_dim,      e_dim,   f_dim,   no_dim
+        PARAMETER ( x_dim=1, y_dim=2, z_dim=3,
+     .              t_dim=4,    e_dim=5, f_dim=6, no_dim = 0 )
+
+* special data value flags
+	DOUBLE PRECISION	unspecified_val8,
+     .				unspec_val8_2,
+     .				arbitrary_large_val8,
+     .				arbitrary_small_val8,
+     .				arbitrary_large_int4,
+     .				arbitrary_small_int4,
+     .				ambiguous_val8
+	INTEGER			unspecified_int4,
+     .				ambiguous_int4
+	REAL			bad_val4,
+     .				arbitrary_large_val4,
+     .				arbitrary_small_val4,
+     .				unspecified_val4
+	CHARACTER*4		unspecified_name4
+* note: unspecified_int4 was changed from -9999 because of FORTRAN dimens. bug
+! 5/01 redefined arbitrary_* using /usr/include/float.h and limits.h on Solaris
+! 10/01 *kob* - fixed formatting bug - put "D" format rather than "E" for
+*                   arbitrary_large_val8 
+! DBL_MAX, FLT_MAX, INT_MAX, and INT_MIN
+	PARAMETER  (	unspecified_val8	= -2.E34,
+     .		  	unspec_val8_2		= -2.1E34,
+     .		arbitrary_large_val8	=  1.7976931348623157D+308,  ! DBL_MAX
+     .		arbitrary_small_val8	= (-arbitrary_large_val8),
+     .		arbitrary_large_val4	=  3.402823466E+38, ! FLT_MAX
+     .		arbitrary_small_val4	= -arbitrary_large_val4,
+     .		arbitrary_large_int4	=  2147483647, ! INT_MAX
+     .		arbitrary_small_int4	= (-2147483647-1), ! INT_MIN
+     .			ambiguous_val8		= -2.1E33,
+     .			unspecified_int4	= -999 ,
+     .			ambiguous_int4		= -8888 ,
+     .			bad_val4		= -1.E34,
+     .			unspecified_name4	= '&&&&',
+     .			unspecified_val4	= -2.5E34 )
+
+* 3/03 *kob* - kludge: this COMMON inserted to allow g77 to comply with all
+*              other compilers
+	CHARACTER*1	pCR
+	COMMON /XINIT_PROBLEMS/ pCR 
+*	PARAMETER     ( pCR = o'015' )
+
+
+
+* quantities relevant to management of memory and memory variables
+	INTEGER		mr_deleted,		mr_nonexist,
+     .			mr_out_of_bounds,	
+     .			mr_not_protected,	mr_perm_protected,
+     .			mr_in_progress,		mr_temporary,
+     .			var_name_nonexist,	mr_table_entry_only,
+     .			munknown_var_name,	mr_not_contiguous
+	PARAMETER     ( mr_deleted		= -777,
+     .			mr_temporary		= -888,
+     .			mr_in_progress		= -666,
+     .			mr_perm_protected	= -555,
+     .			mr_table_entry_only	= -444,
+     .			mr_nonexist		= 0 ,
+     .			mr_not_contiguous	= mr_nonexist - 1,
+     .			mr_out_of_bounds	= -1,
+     .			mr_not_protected	= 0,
+     .			var_name_nonexist	= 0 ,
+     .			munknown_var_name	= -5 )
+
+* flags indicating mode of memory variable search
+	LOGICAL		search_by_value, search_by_ss
+	PARAMETER     ( search_by_value = .TRUE.,
+     .			search_by_ss = .FALSE. )
+
+* flags to control context interpretation
+	LOGICAL		unknown_qual_bad,
+     .			unknown_qual_ok
+	PARAMETER     (	unknown_qual_bad = .TRUE.,
+     .			unknown_qual_ok  = .FALSE. )
+
+* codes regarding the categories of variables used by the program
+*    "cat" - "categories" of variables ("file","calc","user"...)
+	INTEGER		cat_work_mr,
+     .			cat_file_var, cat_calc_var,
+     .			cat_user_var, cat_dummy_var,
+     .			cat_expr_var, cat_axis_var,
+     .			cat_temp_var, cat_pseudo_var,
+     .			cat_constant, cat_file_rev,
+     .			cat_const_var,   cat_string,
+     .                  cat_counter_var, cat_attrib_val,
+     .                  cat_aggregate_var, cat_pystat_var
+	PARAMETER     ( cat_work_mr  = -9,
+     .			cat_file_var = 1,
+     .			cat_calc_var = 2,
+     .			cat_user_var = 3,
+     .			cat_dummy_var= 4,
+     .			cat_expr_var = 5,
+     .			cat_axis_var = 6,
+     .			cat_temp_var = 7,
+     .			cat_pseudo_var = 8,
+     .			cat_constant   = 9,
+     .			cat_file_rev   = 10,
+     .			cat_const_var  = 11,
+     .			cat_string     = 12,
+     .			cat_counter_var= 13,
+     .			cat_attrib_val = 14,
+     .			cat_aggregate_var= 15,
+     .                  cat_pystat_var = 16 )
+
+* codes referring to the user-defined variables
+	INTEGER		uvar_deleted,
+     .			uvar_on_hold,
+     .			uvar_no_more_vars,
+     .			cmnd_uvars_not_given,
+     .			uvlim_irrelevant,
+     .			uvlim_hidden,
+     .			uvlim_gvn_gnl,
+     .			uvlim_gvn_lo,
+     .			uvlim_gvn_lohi,
+     .			uvlim_gvn_xact,
+     .			uvlim_needed,
+     .			uvlim_need_lo,
+     .			uvlim_need_lohi,
+     .			uvlim_need_xact,
+     .			uvlim_unknown
+	PARAMETER     ( uvar_deleted		= -9,
+     .			uvar_on_hold		= -10,
+     .			uvar_no_more_vars	= -8,
+     .			cmnd_uvars_not_given	= -9,
+     .			uvlim_irrelevant	= -1,
+     .			uvlim_hidden		= -2,
+     .			uvlim_gvn_gnl		= 0,
+     .			uvlim_gvn_lo		= 1,
+     .			uvlim_gvn_lohi		= 2,
+     .			uvlim_gvn_xact		= 3,
+     .			uvlim_needed		= 4,
+     .			uvlim_need_lo		= 5,
+     .			uvlim_need_lohi		= 6,
+     .			uvlim_need_xact		= 7,
+     .			uvlim_unknown		= 100 )	! must be largest
+
+* conversion factors
+* convert [calcm**-2sec-1] to [wattm**-2] using rocp = 1 for water
+	REAL		q2wattm2 
+	PARAMETER     ( q2wattm2 = 86400./2.06 )
+
+* codes to interpret the instance of component variables needed for calculating
+* cvars (qdfz,rho, etc.) ... default is locations relative to current.
+* each of the special conditions (absolute, hourly-only, etc) is represented by
+* values greater than the flag pcv_*_flg with pcv_*_0 representing a coded
+* zero and pcv_*_1 representing an encoded 1
+* values encoded in pcv_keq1_* are absolute positions of components in a
+* calculation which are relevant only at k=1
+	INTEGER		pcv_range,		! allow +-range for each case
+     .			pcv_abs_flg,		! absolute positions ... eg. k=1
+     .			pcv_abs_0,
+     .			pcv_abs_1,
+     .			pcv_hourly_flg,	! use delta-t=0 unless hourly
+     .			pcv_hourly_0,
+     .			pcv_keq1_flg,		! component needed only at k=1
+     .			pcv_keq1_0,
+     .			pcv_keq1_1,
+     .			pcv_spec_flg		! flag special data set calcs
+	PARAMETER     ( pcv_range 	= 500,
+     .			pcv_abs_flg	= 1001,	! 1001<x<2000 ==> abs
+     .			pcv_spec_flg	= 1000,	! var#>1000 ==> special
+     .			pcv_abs_0	= pcv_abs_flg    + pcv_range,
+     .			pcv_abs_1	= pcv_abs_0 + 1,
+     .			pcv_hourly_flg  = pcv_abs_flg    + 2*pcv_range,
+     .			pcv_hourly_0	= pcv_hourly_flg + pcv_range,
+     .			pcv_keq1_flg    = pcv_hourly_flg + 2*pcv_range,
+     .			pcv_keq1_0	= pcv_keq1_flg   + pcv_range,
+     .			pcv_keq1_1      = pcv_keq1_0 + 1 )
+
+* codes to designate ( to FUNCTION WORLD ) which end of grid box
+	INTEGER		box_lo_lim,
+     .			box_middle,
+     .			box_hi_lim
+	PARAMETER     (	box_lo_lim = 1,
+     .			box_middle = 2,
+     .			box_hi_lim = 3	)
+
+* codes to designate rounding
+* (in FUNCTION ISUBSCRIPT to resolve ambiguities when coord is on box boundary)
+	INTEGER		round_up,
+     .			round_dn,
+     .			round_never
+	PARAMETER     ( round_up    = 1,
+     .			round_dn    = 2,
+     .			round_never = 3	)
+
+* codes to designate what mathematical transformations have been applied
+	INTEGER		max_plane_transform,
+     .			trans_compress_code,
+     .			trans_no_transform,
+     .			trans_average,
+     .			trans_interpolate,
+     .			trans_integ_def,
+     .			trans_integ_indef,
+     .			trans_max,
+     .			trans_min,
+     .			trans_smth_box,
+     .			trans_smth_binml,
+     .			trans_smth_hanng,
+     .			trans_smth_median,
+     .			trans_smth_max,
+     .			trans_smth_min,
+     .			trans_smth_parzn,
+     .			trans_smth_welch,
+     .			trans_deriv_cntr,
+     .			trans_deriv_fwrd,
+     .			trans_deriv_bkwd,
+     .			trans_subset,
+     .			trans_shift,
+     .			trans_4d_ave,
+     .			trans_4d_int_def,
+     .			trans_fill_ave,
+     .			trans_fill_interp,
+     .			trans_fill_near,
+     .			trans_locate,
+     .                  trans_wgted_eq,
+     .                  trans_sum,
+     .                  trans_run_sum,
+     .                  trans_std_dev,
+     .                  trans_variance,
+     .                  trans_npoints,   ! unused
+     .                  trans_good_pt,
+     .                  trans_bad_pt,
+     .                  trans_4d_var,
+     .                  trans_4d_good_pt,
+     .                  trans_4d_bad_pt,
+     .                  trans_reduced,
+     .                  trans_4d_sum
+	INTEGER		trans_nrst_dist_abv,
+     .			trans_nrst_dist_blw,
+     .			trans_nrst_indx_abv,
+     .			trans_nrst_indx_blw,
+     .			trans_event_mask
+
+	PARAMETER     ( trans_compress_code = 30,
+     .			trans_no_transform = 1,
+     .			trans_integ_indef  = 2,
+     .			trans_smth_box	   = 3,
+     .			trans_deriv_cntr   = 4,
+     .			trans_deriv_fwrd   = 5,
+     .			trans_deriv_bkwd   = 6,
+     .			trans_subset       = 7,
+     .			trans_shift	   = 8,
+     .			trans_fill_ave	   = 9,
+     .			trans_smth_binml   = 10,
+     .			trans_smth_hanng   = 11,
+     .			trans_smth_max     = 12,
+     .			trans_smth_median  = 13,
+     .			trans_smth_min     = 14,
+     .			trans_smth_parzn   = 15,
+     .			trans_smth_welch   = 16,
+     .                  trans_wgted_eq	   = 17,
+     .                  trans_run_sum	   = 18,
+     .			trans_fill_interp  = 20,
+     .			trans_fill_near    = 21 )
+	PARAMETER     (	trans_nrst_dist_abv = 22,
+     .			trans_nrst_dist_blw = 23,
+     .			trans_nrst_indx_abv = 24,
+     .			trans_nrst_indx_blw = 25,
+     .			trans_event_mask    = 26,
+     .			max_plane_transform = trans_event_mask )
+
+	PARAMETER     ( trans_average      = trans_compress_code + 1,
+     .			trans_interpolate  = trans_compress_code + 2,
+     .			trans_integ_def    = trans_compress_code + 3,
+     .			trans_max	   = trans_compress_code + 4,
+     .			trans_min	   = trans_compress_code + 5,
+     .			trans_4d_ave	   = trans_compress_code + 6,
+     .			trans_4d_int_def   = trans_compress_code + 7,
+     .			trans_locate	   = trans_compress_code + 8,
+     .			trans_sum	   = trans_compress_code + 9,
+     .                  trans_variance     = trans_compress_code + 10,
+     .                  trans_npoints      = trans_compress_code + 11,
+     .                  trans_good_pt      = trans_compress_code + 12,
+     .                  trans_bad_pt       = trans_compress_code + 13,
+     .                  trans_4d_var	   = trans_compress_code + 14,
+     .                  trans_4d_good_pt   = trans_compress_code + 15,
+     .                  trans_4d_bad_pt	   = trans_compress_code + 16,
+     .                  trans_reduced 	   = trans_compress_code + 17,
+     .                  trans_4d_sum 	   = trans_compress_code + 18,
+     .                  trans_std_dev      = trans_compress_code + 19)
+
+* codes to designate regridding transformations
+! unused but required to compile V4.11 code:
+	INTEGER		prgrd_rdn_dn
+	PARAMETER     (	prgrd_rdn_dn = 7 )
+	INTEGER		max_regrid_trans,
+     .			prgrd_exact,
+     .			prgrd_linear_interp,
+     .			prgrd_average,
+     .			prgrd_xy_ave,
+     .			prgrd_xy_lin,
+     .			prgrd_xact_pts,
+     .			prgrd_associate,
+     .			prgrd_variance,
+     .			prgrd_min,
+     .			prgrd_max,
+     .			prgrd_sum,
+     .			prgrd_good_pt,
+     .			prgrd_modulo,
+     .			prgrd_modvar,
+     .			prgrd_modngd,
+     .			prgrd_modnbd,
+     .			prgrd_modsum,
+     .			prgrd_modmin,
+     .			prgrd_modmax,
+     .			prgrd_nearest,
+     .			prgrd_from_source,
+     .			prgrd_from_ntrmed,
+     .			pinterpolate
+	PARAMETER     (	max_regrid_trans	= 30,   ! increased 11/95
+     .			prgrd_exact		= 1,
+     .			prgrd_linear_interp	= 2,
+     .			prgrd_average		= 3,
+     .			prgrd_xy_ave		= 4,
+     .			prgrd_xy_lin		= 20,
+     .			prgrd_xact_pts		= 5,
+     .			prgrd_associate		= 6,
+     .			prgrd_variance		= 7,
+     .			prgrd_min		= 8,
+     .			prgrd_max		= 9,
+     .			prgrd_sum		= 10,
+     .			prgrd_good_pt		= 11,
+     .			prgrd_modulo		= 12,
+     .			prgrd_modvar		= 13,
+     .			prgrd_modngd		= 14,
+     .			prgrd_modnbd		= 15,
+     .			prgrd_modsum		= 16,
+     .			prgrd_modmin		= 17,
+     .			prgrd_modmax		= 18,
+     .			prgrd_nearest		= 19,
+     .			prgrd_from_source	= -6,
+     .			prgrd_from_ntrmed	= -7,
+     .			pinterpolate		= 0 )
+
+* auxiliary regridding transformations
+	INTEGER		max_auxregrid_trans,
+     .			pauxrgrd_linear,
+     .			pauxrgrd_average,
+     .			pauxrgrd_pwlave,
+     .			pauxrgrd_thick_ave
+	PARAMETER     (	max_auxregrid_trans= max_regrid_trans+6,
+     .			pauxrgrd_linear    = max_regrid_trans+1,
+     .			pauxrgrd_average   = max_regrid_trans+2,
+     .			pauxrgrd_pwlave    = max_regrid_trans+3,
+     .			pauxrgrd_thick_ave = max_regrid_trans+4 )
+
+* auxiliary variable pointer merging
+*	paux_stat_na	   - no inherited aux coord
+*	paux_stat_passed   - aux coords inherited passively
+*	paux_stat_needed   - aux coords inherited and desired in graphics
+*	paux_stat_used	   - aux coords inherited but already regridded
+*	paux_stat_conflict - vars w differing aux coordinates in one expression
+*	paux_stat_notfound - named aux var not found in this dataset
+	INTEGER		paux_stat_na     ,
+     .			paux_stat_passed ,
+     .			paux_stat_needed ,
+     .			paux_stat_used   ,
+     .			paux_stat_conflict,
+     .			paux_stat_notfound
+	PARAMETER     ( paux_stat_na       = 1,
+     .			paux_stat_passed   = 2,
+     .			paux_stat_needed   = 3,
+     .			paux_stat_used     = 4,
+     .			paux_stat_conflict = 5,
+     .			paux_stat_notfound = 6)
+
+* codes to designate classes of items used within algebraic expressions
+	INTEGER		alg_operator,
+     .			alg_constant,
+     .			alg_variable,
+     .			alg_comma,
+     .			alg_function,
+     .			alg_pseudo_var,
+     .			alg_finished,
+     .			alg_unknown,
+     .			alg_log_struct,
+     .			alg_punctuation,
+     .			alg_operand,
+     .			alg_if_marker,
+     .			alg_then_marker,
+     .			alg_grid_chg_fcn,
+     .			alg_child_var,
+     .			alg_const_var,
+     .			alg_string,
+     .                  alg_counter_var,
+     .                  alg_attrib_val,
+     .                  alg_log_vstruct,
+     .                  alg_agg_var
+	PARAMETER     (	alg_operator   = 1,
+     .			alg_constant   = 2,
+     .			alg_variable   = 3,
+     .			alg_comma      = 4,
+     .			alg_function   = 5,
+     .			alg_pseudo_var = 6,
+     .			alg_finished   = 7,
+     .			alg_unknown    = 8,
+     .			alg_log_struct = 9,
+     .			alg_punctuation= 10,
+     .			alg_operand    = 11,
+     .			alg_if_marker    = 21,
+     .			alg_then_marker  = 22,
+     .			alg_grid_chg_fcn = 13,
+     .			alg_child_var    = 14,
+     .			alg_const_var    = 15,
+     .			alg_string	 = 16,
+     .                  alg_counter_var  = 17,
+     .                  alg_attrib_val   = 18,
+     .                  alg_log_vstruct  = 19,
+     .                  alg_agg_var	 = 20 )
+
+* codes to distinguish between context choices
+* (contexts describe space/time/variable/transformation/data_set,etc.)
+	INTEGER		max_noframe_context, min_context, max_cx_predefined
+	PARAMETER     ( max_noframe_context = 400,
+     .			max_cx_predefined = 100,
+     .			min_context = 1 - max_cx_predefined )
+
+	INTEGER		cx_none,
+     .			cx_buff,
+     .			cx_last,
+     .			cx_cmnd,
+     .			cx_plot,
+     .			cx_unused_yet,			! available buffer
+     .			cx_stack_ptr_base
+	PARAMETER     (	cx_none = 0,
+     .			cx_buff = 1,
+     .			cx_last = 2,
+     .			cx_cmnd = 3,
+     .			cx_plot = max_noframe_context+1,
+     .			cx_unused_yet = max_noframe_context+2,
+     .			cx_stack_ptr_base = cx_cmnd )
+
+* aid for documentation flags used to create strings describing variables
+	INTEGER		pdoc_offset_xform,
+     .			pdoc_regrid,
+     .			pdoc_dset
+	PARAMETER     (	pdoc_offset_xform = 6,
+     .			pdoc_regrid = 5,
+     .			pdoc_dset = 6 )
+
+	INTEGER		ovsiz_plane, ovsiz_off
+	PARAMETER     ( ovsiz_off = 0,
+     .			ovsiz_plane = -7 )
+
+	LOGICAL		nest_context,
+     .			replace_context
+
+	PARAMETER     ( nest_context	= .TRUE.,
+     .			replace_context = .FALSE. )
+
+* flag that data has no data set dependencies not in its definition
+	INTEGER		pdset_irrelevant
+	PARAMETER     (	pdset_irrelevant = 0 )
+
+* pointers to the 7 fundamental axes of the Cox/Phil./Sieg. model
+* eg mxt points to the X axis used by TEMP (and SALT, TAU, etc.)
+	INTEGER		mtime, mxt, mxu, myt, myu, mzt, mzw
+	PARAMETER     ( mtime = 1,
+     .			mxt   = 2,
+     .			mxu   = 3,
+     .			myt   = 4,
+     .			myu   = 5,
+     .			mzt   = 6,
+     .			mzw   = 7 )
+
+* pre-defined grids:.....
+* define "lines" ( 1 dimensional components of which grids are assembled)
+* parameter definitions are pointers to the lines
+*			("m" indicates parameter, "ps"= Philander/Seigel)
+	INTEGER		mpsxt, mpsxu, mpsyt, mpsyu, mpszt, mpszw
+	PARAMETER (	mpsxt	= 1,
+     .			mpsxu	= 2,
+     .			mpsyt	= 3,
+     .			mpsyu	= 4,
+     .			mpszt	= 5,
+     .			mpszw	= 6 )
+
+* define grids, themselves...
+* grids are formed of "outer products" (rectangular arrays) or "inner products"
+*	(ordered tuples) of lines.  (To use inner products the lines must be of
+*	the same length.)
+	INTEGER		mgrid_buff, mps2dt, mps2du, mps3dt, mps3du, mps3dw,
+     .			mps3dwu
+	PARAMETER (	mgrid_buff = 0,	! scratch buffer for grids
+     .			mps2dt	= 1,	! 2D temp(erature) grid
+     .			mps2du	= 2,	! 2D taux,tauy grid
+     .			mps3dt	= 3,	! 3D temp/salt grid
+     .			mps3du	= 4,	! 3d u/v grid
+     .			mps3dw	= 5,	! 3D w grid
+     .			mps3dwu	= 6 )	! 3D w grid calculate at uv points
+
+* codes for units
+	INTEGER		punot_app, pudiffusion, puheat_flux, putemp_dt,
+     .			puvel_dt, pupressure, pudensity, pupres_dx, puppt,
+     .			puvelocity, putemperature
+	PARAMETER     (	punot_app	=  1,
+     .			pudiffusion	=  2,
+     .			puheat_flux	=  3,
+     .			putemp_dt	=  4,
+     .			puvel_dt	=  5,
+     .			pupressure	=  6,
+     .			pudensity	=  7,
+     .			pupres_dx	=  8,
+     .			puppt		=  9,
+     .			puvelocity	= 10,
+     .			putemperature	= 11 )
+
+* codes for special grid features...
+* flag values stored in parameters
+	INTEGER		line_not_midpt, mnormal, munknown
+	PARAMETER     ( line_not_midpt	= 0,	! line not midpts of any other
+     .			mnormal		= 0,	! dimension is normal to grid
+     .			munknown	= -1 )	! dimension specs not known
+
+* search codes for locating single character strings ('atoms')
+	INTEGER		atom_not_found, atom_illegal_pos
+	PARAMETER     ( atom_not_found	 = 0,
+     .			atom_illegal_pos = -1 )
+
+* to point to descriptor of context or of memory variable
+	INTEGER		point_to_cx, point_to_mr
+	PARAMETER     ( point_to_cx = -5,
+     .			point_to_mr = -10 )
+
+* default program states
+	INTEGER		default_output_precision,
+     .			default_list_lun
+	PARAMETER     ( default_output_precision = 4,
+     .			default_list_lun	 = 19 )
+
+* display precisions for date/time strings
+	INTEGER		ptime_yr,  ptime_mon, ptime_day, ptime_hr,
+     .			ptime_min, ptime_sec
+	PARAMETER     ( ptime_yr  = 1,
+     .			ptime_mon = 2,
+     .			ptime_day = 3,
+     .			ptime_hr  = 4,
+     .			ptime_min = 5,
+     .			ptime_sec = 6 )
+
+* various modes of output (differentiated for GUI window controls)
+	INTEGER		pttmode_explct, pttmode_ops,
+     .			pttmode_help, pttmode_bull, pttmode_msg
+	PARAMETER     (	pttmode_explct	= 1,	! explicit requests -eg LIST
+     .			pttmode_ops	= 2,	! operational info -eg diag out
+     .			pttmode_help	= 3,	! help text
+     .			pttmode_bull	= 4,	! bulletin -eg vector spacing
+     .			pttmode_msg	= 5 )	! MESSAGE command output
+
+* clues to changes of units from transformations applied
+	INTEGER		punit_mod_variance,
+     .			punit_mod_loc,
+     .			punit_mod_npoints
+	PARAMETER     (	punit_mod_variance = 1,
+     .			punit_mod_loc      = 2,
+     .			punit_mod_npoints  = 3 )
+
+* NetCDF file creation modes (for DODS caching)
+	INTEGER		pcdf_mode_normal,
+     .			pcdf_mode_cache
+	PARAMETER     ( pcdf_mode_normal = 1,
+     .			pcdf_mode_cache = 2 )
+
+
+* various behaviors of axes in grid-changing functions
+* grid-changing functions
+* ... to provide internal instructions to Ferret on how to merge arguments
+	INTEGER		pgc_merge_axis,
+     .			pgc_ignore_axis,
+     .			pgc_impose_axis
+	PARAMETER     ( pgc_merge_axis  = 11,
+     .			pgc_ignore_axis = 12,
+     .			pgc_impose_axis = 13 )
+
+* ... for grid changing functions to describe themselves
+	INTEGER		pgc_axis_supplied_herein,
+     .			pgc_axis_implied_by_args,
+     .			pgc_axis_is_normal,
+     .			pgc_axis_is_abstract
+	PARAMETER     ( pgc_axis_supplied_herein = 101,
+     .			pgc_axis_implied_by_args = 102,
+     .			pgc_axis_is_normal       = 103,
+     .			pgc_axis_is_abstract     = 104 )
+
+* ... to specify axis reduction in a grid changing function
+*     These are the possible values of the gfcn_axis_reduction()
+*     property described in xgrid_chg_fcns.cmn.
+*     As an example, suppose an external function result returns a
+*     single value as a flag.  You might want "SET REGION"
+*     information, normally applied to the result context, to be
+*     used to determine the argument contexts.  In this case, some
+*     of the axes would specify
+*
+*     gfcn_axis_reduction(idim, iptr) = pgc_span_reduced
+ 
+	INTEGER		pgc_span_retained,
+     .          pgc_span_reduced
+	PARAMETER ( pgc_span_retained = 201,
+     .          pgc_span_reduced  = 202 )
+
+* data types
+	INTEGER		ptype_unknown,
+     .			ptype_float,
+     .			ptype_int4,
+     .			ptype_int2,
+     .			ptype_int1,
+     .			ptype_char,
+     .			ptype_string,
+     .			ptype_double,
+     .			ptype_native
+	PARAMETER     ( ptype_unknown = 0,
+     .			ptype_float = 1,
+     .			ptype_int4 = 2,
+     .			ptype_int2 = 3,
+     .			ptype_int1 = 4,
+     .			ptype_char = 5,
+     .			ptype_string = 6,
+     .			ptype_double = 7,
+     .			ptype_native = 999 )
+
+* status flags during automated auxiliary variable (curvilinear) regridding
+	INTEGER		pcurv_NA,
+     .			pcurv_needed,
+     .			pcurv_regridded
+	PARAMETER     ( pcurv_NA        = 1,
+     .			pcurv_needed    = 2,
+     .			pcurv_regridded = 3 )
+
+* special values used in setting up auxiliary and curvilinear regridding
+	INTEGER		pauto_1pt_ax, pinfer_frm_aux
+	PARAMETER     ( pauto_1pt_ax   = -123456,
+     .			pinfer_frm_aux = -123455 )
+
+* special attribute names
+	CHARACTER*11	patnam_sigma, patnam_curvx, patnam_curvy
+	PARAMETER     ( patnam_sigma = '__SigmaRef_',
+     .		        patnam_curvx = '__CurvxRef_',
+     .		        patnam_curvy = '__CurvxRef_'  )
\ No newline at end of file
diff --git a/fer/common/ferret_query.parm b/fer/common/ferret_query.parm
new file mode 100644
index 0000000..e994a84
--- /dev/null
+++ b/fer/common/ferret_query.parm
@@ -0,0 +1,17 @@
+* status codes returned by ferret_query_F
+* negative codes are FERRET status codes ferr_xxx...
+
+	INTEGER
+     .       QSTAT_OK,
+     .       QSTAT_UNKNOWN_QUERY,
+     .       QSTAT_BUFF_OVFLOW,
+     .       QSTAT_INVALID_ARG,
+     .       QSTAT_INTERNAL_ERROR
+
+	PARAMETER (
+     .       QSTAT_OK = 0,
+     .       QSTAT_UNKNOWN_QUERY = 1,
+     .       QSTAT_BUFF_OVFLOW = 2,
+     .       QSTAT_INVALID_ARG = 3,
+     .       QSTAT_INTERNAL_ERROR = 4 )
+
diff --git a/fer/common/ferret_shared_buffer.h b/fer/common/ferret_shared_buffer.h
new file mode 100644
index 0000000..339893a
--- /dev/null
+++ b/fer/common/ferret_shared_buffer.h
@@ -0,0 +1,55 @@
+/*
+ * ferret_shared_buffer.h
+ *
+ * John Osborne
+ * Jonathan Callahan (after Oct. 1995)
+ *
+ * This header file is included by files who's routines wish to have access to 
+ * the memory buffer which is shared between Ferret and the GUI.  The only access
+ * control is through the following test:
+ *
+ * 	  if ( sBuffer->flags[FRTN_CONTROL] == FCTRL_IN_FERRET ) 
+ *
+ */
+
+#ifndef _FERRET_SHARED_BUFFER_H 
+#define _FERRET_SHARED_BUFFER_H
+
+
+#define NUMFLAGS 10
+#define TEXTLENGTH 500
+#define NUMDOUBLES 2048
+
+#include "ferret.h"
+
+typedef struct sharedStruct {
+	int flags[NUMFLAGS];
+	char text[TEXTLENGTH];
+	char *textP;
+	int numStrings, numNumbers;
+ 	double nums[NUMDOUBLES];
+} sharedMem;
+
+typedef sharedMem *smPtr;
+
+/*
+ * Exactly one module must define __globalDefs.
+ * All others will reference sBuffer as "extern".
+ */
+
+#ifdef __globalDefs
+#define __global
+#else
+#define __global extern
+#endif
+
+__global smPtr sBuffer;
+
+__global DFTYPE *memory;
+__global float *ppl_memory;
+
+
+#undef __global
+
+
+#endif /* _FERRET_SHARED_BUFFER_H */
diff --git a/fer/common/fgrdel.cmn b/fer/common/fgrdel.cmn
new file mode 100644
index 0000000..a7a9202
--- /dev/null
+++ b/fer/common/fgrdel.cmn
@@ -0,0 +1,164 @@
+*
+* COMMON BLOCK for graphics delegate objects
+*
+
+* Maximums as parameters.  Note that the maximum number
+* of color, brush, font, pen and symbol objects is per
+* window object.  These objects from one window cannot
+* be shared with another window.
+
+        INTEGER maxwindowobjs,
+     .          maxcolorobjs,
+     .          maxbrushobjs,
+     .          maxfontobjs,
+     .          maxpenobjs,
+     .          maxsymbolobjs,
+     .          maxtransforms
+
+* maxwindowobjs should match (or exceed)
+* max_windows in xplot_state.cmn
+
+        PARAMETER(maxwindowobjs = 9,
+     .            maxcolorobjs = 320,
+     .            maxbrushobjs = 320,
+     .            maxfontobjs = 60,
+     .            maxpenobjs = 320,
+     .            maxsymbolobjs = 320,
+     .            maxtransforms = 60)
+
+* A NULL object (zero) as a parameter.
+* Undefined objects are set to nullobj
+
+        REAL*8 nullobj
+        PARAMETER(nullobj = 0.0)
+
+* The following are actually pointers to objects
+
+        REAL*8 windowobjs(maxwindowobjs),
+     .         colorobjs(maxcolorobjs, maxwindowobjs),
+     .         brushobjs(maxbrushobjs, maxwindowobjs),
+     .         fontobjs(maxfontobjs, maxwindowobjs),
+     .         penobjs(maxpenobjs, maxwindowobjs),
+     .         symbolobjs(maxsymbolobjs, maxwindowobjs)
+
+* Factor for normalized device coordinates.
+* Set by GSWKWN defining the NDC limits of the full window.
+        REAL*4 ndcxmax(maxwindowobjs),
+     .         ndcymax(maxwindowobjs)
+
+* Number of dots (pixels) per inch.  Assigned when creating the window.
+        REAL*4 windowdpix(maxwindowobjs),
+     .         windowdpiy(maxwindowobjs)
+
+* Scaling factor for line widths and symbol sizes
+        REAL*4 thickfactor(maxwindowobjs)
+
+* Coordinate transformation information (independent of window)
+* View limits defined in [0,1] normalized device coordinates
+        REAL*4 viewleftfrac(maxtransforms),
+     .         viewbottomfrac(maxtransforms),
+     .         viewrightfrac(maxtransforms),
+     .         viewtopfrac(maxtransforms)
+
+* Coordinate transformation information (independent of window)
+* View limits defined in user (world) coordinates
+        REAL*4 viewleftcoord(maxtransforms),
+     .         viewbottomcoord(maxtransforms),
+     .         viewrightcoord(maxtransforms),
+     .         viewtopcoord(maxtransforms)
+
+* Size of the full window in inches(?).  Used when creating
+* the window and updated when the window is resized.
+        REAL*4 windowwidth(maxwindowobjs),
+     .         windowheight(maxwindowobjs)
+
+* The ID number of the "active" window.  Zero means none are active.
+        INTEGER activewindow
+
+* The ID number of the "active" transformation.  Zero means the
+* implicit identity transformation is active.
+        INTEGER activetransform
+
+* The number of the "active" brush of the activewindowid window
+* used for filling areas.
+* Zero means no brush is active and if a brush is needed, create
+* a temporary brush from lastbrushcolor and lastbrushstyle.
+        INTEGER activebrush
+
+* The brush color number and style to use when creating a temporary
+* brush (activebrush not specified) when filling areas.
+        INTEGER lastbrushcolor
+        CHARACTER*64 lastbrushstyle
+        INTEGER lastbstylen
+
+* The ID number of the "active" pen of the activewindowid window
+* used for drawing lines.
+        INTEGER activepen
+
+* The ID number of the "active" symbol of the activewindowid window
+* used for drawing markers.
+        INTEGER activesymbol
+
+* Whether something has been drawn in the current view of the
+* active window.  Reset to .FALSE. when the view changes.
+        LOGICAL somethingdrawn
+
+* Whether clip the drawing to the current view
+        LOGICAL cliptoview(maxwindowobjs)
+
+* Simplest approach for retrieving color RGBA values was 
+* just to store them in the common block when they are set
+        REAL*4 colorrgba(4, maxcolorobjs, maxwindowobjs)
+
+* Color ID number used in brushes (for color updates)
+        INTEGER brushcolor(maxbrushobjs, maxwindowobjs)
+
+* Color ID number used in pens (for color updates)
+        INTEGER pencolor(maxpenobjs, maxwindowobjs)
+
+* Color ID number and sizes to use to draw the symbol object
+        INTEGER symbolcolor(maxsymbolobjs, maxwindowobjs)
+        REAL*4 symbolsize(maxsymbolobjs, maxwindowobjs)
+
+* Default engine for a new window.
+* Should not change after start-up.
+* Only reset by command-line options.
+        CHARACTER*64 defaultenginename
+
+* Transparent background for save-on-exit (-batch)?
+* Should not change after start-up.
+* Only reset by the "-transparent" command-line option.
+* Has nothing to do with "frame /transparent".
+        LOGICAL savetransparent
+
+* Name of the graphics engine used for each window.
+        CHARACTER*64 enginename(maxwindowobjs)
+
+* Antialiasing state for each window
+        LOGICAL antialias(maxwindowobjs)
+
+* Title for the window to be created.  The program flow
+* sets this in a separate call just before creating a window.
+        CHARACTER*128 windowtitle
+
+* And finally the common block containing all these variables
+        COMMON /FGRDEL/ 
+     .         windowobjs, colorobjs, brushobjs, fontobjs, 
+     .         penobjs, symbolobjs, 
+     .
+     .         colorrgba, symbolsize, windowdpix, windowdpiy, 
+     .         thickfactor, windowwidth, windowheight, 
+     .         ndcxmax, ndcymax, viewleftfrac, viewbottomfrac, 
+     .         viewrightfrac, viewtopfrac, viewleftcoord, 
+     .         viewbottomcoord, viewrightcoord, viewtopcoord, 
+     .
+     .         activewindow, activetransform, activebrush, 
+     .         activepen, activesymbol, lastbrushcolor,
+     .         lastbstylen, brushcolor, pencolor, symbolcolor, 
+     .
+     .         cliptoview, somethingdrawn, savetransparent, 
+     .         antialias, 
+     .
+     .         lastbrushstyle, defaultenginename, enginename, 
+     .         windowtitle
+
diff --git a/fer/common/gfdl.parm b/fer/common/gfdl.parm
new file mode 100644
index 0000000..ed366bd
--- /dev/null
+++ b/fer/common/gfdl.parm
@@ -0,0 +1,39 @@
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE HDIFFUS
+
+* PARAMETERS used in GFDL code
+
+      INTEGER IMT, JMT, KM, NT, LSEG, NISLE, LBC, LCYC	 		! 1524
+     *,KAV, NPS, NPN, NAS, NAF	 					! 1525
+     *,KMP1, KMP2, KMM1, IMTP1, IMTM1	 				! 1526
+     *,JMTM1, IMU, IMUM1, JMU, JMUM1	 				! 1527
+     *,IMTM2, JMTM2	 						! 1528
+     *,NSLAB, NWDS, NSWICH				 		! 1529
+     *,NDICES, NTMIN2	 						! 1530
+     *,ISCAN, JSCAN	 						! 1531
+     .,NT1		 						! 2885
+     .,im, jm
+ 
+      PARAMETER (IMT=160,JMT=100,KM=27,NT=2,LSEG=2,NISLE=1,LBC=4,LCYC=0	! 1524
+     *,KAV=16,NPS=5,NPN=7,NAS=NPN+NPS,NAF=15				! 1525
+     *,KMP1=KM+1,KMP2=KM+2,KMM1=KM-1,IMTP1=IMT+1,IMTM1=IMT-1		! 1526
+     *,JMTM1=JMT-1,IMU=IMT+LCYC-1,IMUM1=IMU-1,JMU=JMTM1,JMUM1=JMU-1	! 1527
+     *,IMTM2=IMT-2,JMTM2=JMT-2						! 1528
+     *,NSLAB=IMT*((NT+2)*KM+LBC),NWDS=IMT*JMT,NSWICH=LBC*IMT		! 1529
+     *,NDICES=2*LSEG*JMT+6*NISLE,NTMIN2=NT+1/NT				! 1530
+     *,ISCAN=IMT-1,JSCAN=JMT-2)						! 1531
+
+      PARAMETER (NT1=2)							! 2885
+
+	PARAMETER (im=160,jm=100)
+
+* from a variable grid in the original 205 code ...
+	REAL 		pfull_depth, hr		! temp for constant depth ocean
+	PARAMETER     ( pfull_depth = 4149.E2, HR = 1./pfull_depth )
+
+* from namelist variables
+	REAL 		dtsf, c2dtsf, acor
+	PARAMETER     ( dtsf = 3600., c2dtsf = 2.0 * dtsf, acor = 0.5 )
diff --git a/fer/common/gfdl_vms.parm b/fer/common/gfdl_vms.parm
new file mode 100644
index 0000000..a76ba9a
--- /dev/null
+++ b/fer/common/gfdl_vms.parm
@@ -0,0 +1,6 @@
+* GFDL_VMS.PARM
+* parameters used by program GFDL to communicate with VAX VMS
+
+	INTEGER	vms_str_success, vms_smg_success
+	PARAMETER ( vms_str_success = 0,
+     .		    vms_smg_success = 1 )
diff --git a/fer/common/gfnext.parm b/fer/common/gfnext.parm
new file mode 100644
index 0000000..0d057a7
--- /dev/null
+++ b/fer/common/gfnext.parm
@@ -0,0 +1,6 @@
+* GFNEXT_TEMP.PARM
+*	sh - temporary parameters for program development
+*	1/20/87
+*
+	INTEGER		ppsi
+	PARAMETER     (	ppsi = 8 )
diff --git a/fer/common/grid_chg_fcns.parm b/fer/common/grid_chg_fcns.parm
new file mode 100644
index 0000000..db0b33d
--- /dev/null
+++ b/fer/common/grid_chg_fcns.parm
@@ -0,0 +1,101 @@
+* GRID_CHG_FCNS.PARM - parameters for "grid changing functions" --
+* functions which are capable of delivering results on a grid which is
+* differs from the straightforward implications of the input arguments.
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_GET_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+* V450:
+* V500: 1/99 added parg_type in support of string arguments
+* V510: 8/99 added SAMPLE* functions
+* V533: 6/01 added parg_type_string_or_float
+*            and pfcn_return_string, pfcn_return_float
+*	     and p_spawn
+* V540: 10/01 -- more generalizable parg_type definitions
+*       12/01 -- added p_strcmp
+* v541: 03/02 -- added p_strlen,p_upcase,p_strindex,p_strrindex
+*		       p_dncase, p_strcat, p_substring, p_strfloat
+*                for new internal string handling functions  *kob*
+* 1/03: *kob* -- hardcode value for parg_type_float_or_string to 3 which
+*                is the value of ior(parg_type_float,parg_type_string).
+*                g77 won't allow intrinsic function in paramter stmt
+*  V6.0 *acm*  5/06 string results for external functions
+*                make pfcn_rtn_float = 1, pfcn_rtn_string  = 2, so they
+*                are compatible with parg_type_float=1, parg_type_string=2
+
+
+	INTEGER		p_xunravel, p_times2, p_reshape, p_zlayer,
+     .			p_yunravel, p_zunravel, p_tunravel, 
+     .			p_eunravel, p_funravel,
+     .			p_samplei, p_samplej, p_samplek, p_samplel, 
+     .			p_samplem, p_samplen,
+     .			p_spawn, p_strcmp, p_strlen, p_upcase, 
+     .                  p_strindex, p_strrindex, p_dncase, p_strcat,
+     .                  p_substring, p_strfloat
+
+	PARAMETER     ( p_xunravel = 1,
+     .			p_times2      = p_xunravel  + 1,
+     .			p_reshape     = p_times2    + 1,
+     .			p_zlayer      = p_reshape   + 1,
+     .			p_yunravel    = p_zlayer    + 1,
+     .			p_zunravel    = p_yunravel  + 1,
+     .			p_tunravel    = p_zunravel  + 1,
+     .			p_eunravel    = p_tunravel  + 1,
+     .			p_funravel    = p_eunravel  + 1,
+     .			p_samplei     = p_funravel  + 1,
+     .			p_samplej     = p_samplei   + 1,
+     .			p_samplek     = p_samplej   + 1,
+     .			p_samplel     = p_samplek   + 1,
+     .			p_samplem     = p_samplel   + 1,
+     .			p_samplen     = p_samplem   + 1,
+     .			p_spawn       = p_samplen   + 1,
+     .			p_strcmp      = p_spawn     + 1,
+     .                  p_strlen      = p_strcmp    + 1,
+     .                  p_upcase      = p_strlen    + 1,
+     .                  p_strindex    = p_upcase    + 1,
+     .                  p_strrindex   = p_strindex  + 1,
+     .                  p_dncase      = p_strrindex + 1,
+     .                  p_strcat      = p_dncase    + 1,
+     .                  p_substring   = p_strcat    + 1,
+     .                  p_strfloat    = p_substring + 1 )
+
+* parameters to control the passing of context information
+	INTEGER		pset_to_unspec, ppass_along
+	PARAMETER     ( pset_to_unspec = 1,
+     .			ppass_along    = 2 )
+
+* parameters to designate the data type of arguments
+	INTEGER		parg_type_float,
+     .			parg_type_string,
+     .			parg_type_double,
+     .			parg_type_byte,
+     .			parg_type_int16,
+     .			parg_type_int32,
+     .
+     .			parg_type_float_or_string
+	PARAMETER     ( parg_type_float  = 1,
+     .			parg_type_string = 2,
+     . 		        parg_type_float_or_string = 3,
+     .			parg_type_double = 4,
+     .			parg_type_byte   = 8,
+     .			parg_type_int16  = 16,
+     .			parg_type_int32  = 32)
+
+
+* parameters to designate the data type of return value of function
+	INTEGER		pfcn_rtn_string,
+     .			pfcn_rtn_float,
+     .			pfcn_rtn_arg1_type,
+     .			pfcn_rtn_arg2_type,
+     .			pfcn_rtn_arg3_type
+	PARAMETER     ( pfcn_rtn_float = 1,
+     .			pfcn_rtn_string  = 2,
+     .			pfcn_rtn_arg1_type  = -1,
+     .			pfcn_rtn_arg2_type  = -2, 
+     .			pfcn_rtn_arg3_type  = -3 )
+
diff --git a/fer/common/gui.parm b/fer/common/gui.parm
new file mode 100644
index 0000000..95fcbda
--- /dev/null
+++ b/fer/common/gui.parm
@@ -0,0 +1,65 @@
+* GUI.PARM
+* parameters for communication between FERRET and GUI control PROGRAM
+
+* these parameters describe the first few integers of the buffer
+* returned by FERRET to its GUI
+	INTEGER
+     .			frtn_control,
+     .			frtn_status,
+     .			frtn_action,
+     .			frtn_idata1,
+     .			frtn_idata2,
+     .			frtn_idata3
+	PARAMETER(
+     .			frtn_control = 1,
+     .			frtn_status  = 2,
+     .			frtn_action  = 3,
+     .			frtn_idata1  = 6,
+     .			frtn_idata2  = 7,
+     .			frtn_idata3  = 8 )
+
+
+* who is in control according to return_buff(frtn_control) ?
+* when the GUI is running FERRET control may return to the GUI at times
+* other than at the completion of a command - for example, when FERRET
+* is requesting that a warning message be displayed or that memory be
+* reconfigured.  These codes indicate why FERRET has returned.
+* FERRET will reset the control variable to "ctrl_not_finished" if
+* the given command was really multiple commands and they are not yet complete
+	INTEGER		fctrl_back_to_gui,
+     .			fctrl_in_ferret
+	PARAMETER     (	fctrl_back_to_gui = 1,
+     .			fctrl_in_ferret   = 2 )
+
+* what special action has FERRET requested in return_buff(frtn_action) ?
+	INTEGER
+     .			factn_no_action,
+     .			factn_mem_reconfigure,
+     .			factn_exit,
+     .			factn_display_warning,
+     .			factn_display_error,
+     .			factn_display_text,
+     .			factn_synch_set_data,
+     .			factn_synch_let,
+     .			factn_synch_window,
+     .			factn_pause
+
+	PARAMETER (
+     .			factn_no_action		= 0,
+     .			factn_mem_reconfigure	= 1,
+     .			factn_exit		= 2,
+     .			factn_display_warning	= 3,
+     .			factn_display_error	= 4,
+     .			factn_display_text	= 5,
+     .			factn_synch_set_data    = 6,
+     .			factn_synch_let         = 7,
+     .			factn_synch_window      = 8,
+     .			factn_pause		= 10)
+
+* output modes
+	INTEGER		ftxout_replace,
+     .			ftxout_append,
+     .			ftxout_new
+	PARAMETER     (	ftxout_replace = 0,
+     .			ftxout_append  = 1,
+     .			ftxout_new     = 3 )
diff --git a/fer/common/instance_table.parm b/fer/common/instance_table.parm
new file mode 100644
index 0000000..3e44611
--- /dev/null
+++ b/fer/common/instance_table.parm
@@ -0,0 +1,133 @@
+* INSTANCE_TABLE.PARM
+* values needed to construct variable "instance" table for computable variables
+* note: first slot in the "instance" table is left blank to be filled in by
+*	the currently requested variable in GET_TOP_INST
+******			PARAMETER DEFINITIONS				  ******
+
+	INTEGER		
+     .			pqcdz, qcdz_frame, to_qcdz,
+     .			ppcdz, pcdz_frame, to_pcdz,
+     .			prho0, rho0_frame, to_rho0,
+     .			pqdfz, qdfz_frame, to_qdfz,
+     .			pqdfh, qdfh_frame, to_qdfh,
+     .			pqadx, qadx_frame, to_qadx,
+     .			pqady, qady_frame, to_qady,
+     .			pqadz, qadz_frame, to_qadz,
+     .			pqad , qad_frame , to_qad ,
+     .			pqdf , qdf_frame , to_qdf ,
+     .			pqeva, qeva_frame, to_qeva,
+     .			ptau , tau_frame , to_tau ,
+     .			pqsen, qsen_frame, to_qsen,
+     .			pqrad, qrad_frame, to_qrad,
+     .			pqflx, qflx_frame, to_qflx,
+     .			prho , rho_frame , to_rho ,
+     .			pdpdx, dpdx_frame, to_dpdx,
+     .			pdpdy, dpdy_frame, to_dpdy,
+     .			pw_u , w_u_frame , to_w_u ,
+     .			puavz, uavz_frame, to_uavz,
+     .			pvavz, vavz_frame, to_vavz
+	INTEGER
+     .			pfuw ,  fuw_frame, to_fuw ,
+     .			pfvn ,  fvn_frame, to_fvn ,
+     .			puadx, uadx_frame, to_uadx,
+     .			puady, uady_frame, to_uady,
+     .			puadz, uadz_frame, to_uadz,
+     .			pvadx, vadx_frame, to_vadx,
+     .			pvady, vady_frame, to_vady,
+     .			pvadz, vadz_frame, to_vadz,
+     .			pudfh, udfh_frame, to_udfh,
+     .			pudfz, udfz_frame, to_udfz,
+     .			pvdfh, vdfh_frame, to_vdfh,
+     .			pvdfz, vdfz_frame, to_vdfz,
+     .			pucoi, ucoi_frame, to_ucoi,
+     .			pvcoi, vcoi_frame, to_vcoi,
+     .			pubpi, ubpi_frame, to_ubpi,
+     .			pvbpi, vbpi_frame, to_vbpi,
+     .			pubwi, ubwi_frame, to_ubwi,
+     .			pvbwi, vbwi_frame, to_vbwi,
+     .			pucoe, ucoe_frame, to_ucoe,
+     .			pvcoe, vcoe_frame, to_vcoe,
+     .			puad ,  uad_frame, to_uad ,
+     .			pvad ,  vad_frame, to_vad ,
+     .			pudf ,  udf_frame, to_udf ,
+     .			pvdf ,  vdf_frame, to_vdf
+	INTEGER
+     .			pdudt, dudt_frame, to_dudt,
+     .			pdvdt, dvdt_frame, to_dvdt,
+     .			pdwdt, dwdt_frame, to_dwdt,
+     .			pdtdt, dtdt_frame, to_dtdt,
+     .			pubps, ubps_frame, to_ubps,
+     .			pvbps, vbps_frame, to_vbps,
+     .			psali, sali_frame, to_sali,
+     .			pdens, dens_frame, to_dens,
+     .			pubp ,  ubp_frame, to_ubp ,
+     .			pvbp ,  vbp_frame, to_vbp ,
+     .			pcmsk, cmsk_frame, to_cmsk,
+     .			pw_t ,  w_t_frame, to_w_t ,
+     .			pcair, cair_frame, to_cair,
+     .			pair ,  air_frame, to_air ,
+     .			num_inst
+
+	PARAMETER
+     .	      ( pqcdz = 1, qcdz_frame = 3, to_qcdz = 0,
+     .		ppcdz = 2, pcdz_frame = 3, to_pcdz = to_qcdz + qcdz_frame,
+     .		prho0 = 3, rho0_frame = 2, to_rho0 = to_pcdz + pcdz_frame,
+     .		pqdfz = 4, qdfz_frame = 3, to_qdfz = to_rho0 + rho0_frame,
+     .		pqdfh = 5, qdfh_frame = 1, to_qdfh = to_qdfz + qdfz_frame,
+     .		pqadx = 6, qadx_frame = 2, to_qadx = to_qdfh + qdfh_frame,
+     .		pqady = 7, qady_frame = 2, to_qady = to_qadx + qadx_frame,
+     .		pqadz = 8, qadz_frame = 2, to_qadz = to_qady + qady_frame,
+     .		pqad  = 9,  qad_frame = 3, to_qad  = to_qadz + qadz_frame,
+     .		pqdf  = 10, qdf_frame = 2, to_qdf  = to_qad  +  qad_frame ,
+     .		pqeva = 11,qeva_frame = 3, to_qeva = to_qdf  +  qdf_frame ,
+     .		ptau  = 12, tau_frame = 2, to_tau  = to_qeva + qeva_frame,
+     .		pqsen = 13,qsen_frame = 3, to_qsen = to_tau  +  tau_frame ,
+     .		pqrad = 14,qrad_frame = 1, to_qrad = to_qsen + qsen_frame,
+     .		pqflx = 15,qflx_frame = 3, to_qflx = to_qrad + qrad_frame,
+     .		prho  = 16, rho_frame = 2, to_rho  = to_qflx + qflx_frame,
+     .		pdpdx = 17,dpdx_frame = 1, to_dpdx = to_rho  +  rho_frame,
+     .		pdpdy = 18,dpdy_frame = 1, to_dpdy = to_dpdx + dpdx_frame,
+     .		pw_u  = 19, w_u_frame = 2, to_w_u  = to_dpdy + dpdy_frame,
+     .		puavz = 20,uavz_frame = 1, to_uavz = to_w_u  +  w_u_frame,
+     .		pvavz = 21,vavz_frame = 1, to_vavz = to_uavz + uavz_frame )
+	PARAMETER (
+     .		pfuw  = 22,  fuw_frame = 3, to_fuw  = to_vavz + vavz_frame,
+     .		pfvn  = 23,  fvn_frame = 3, to_fvn  = to_fuw  +  fuw_frame,
+     .		puadx = 24, uadx_frame = 2, to_uadx = to_fvn  +  fvn_frame,
+     .		puady = 25, uady_frame = 2, to_uady = to_uadx + uadx_frame,
+     .		puadz = 26, uadz_frame = 2, to_uadz = to_uady + uady_frame,
+     .		pvadx = 27, vadx_frame = 2, to_vadx = to_uadz + uadz_frame,
+     .		pvady = 28, vady_frame = 2, to_vady = to_vadx + vadx_frame,
+     .		pvadz = 29, vadz_frame = 2, to_vadz = to_vady + vady_frame,
+     .		pudfh = 30, udfh_frame = 2, to_udfh = to_vadz + vadz_frame,
+     .		pudfz = 31, udfz_frame = 3, to_udfz = to_udfh + udfh_frame,
+     .		pvdfh = 32, vdfh_frame = 2, to_vdfh = to_udfz + udfz_frame,
+     .		pvdfz = 33, vdfz_frame = 3, to_vdfz = to_vdfh + vdfh_frame,
+     .		pucoi = 34, ucoi_frame = 1, to_ucoi = to_vdfz + vdfz_frame,
+     .		pvcoi = 35, vcoi_frame = 1, to_vcoi = to_ucoi + ucoi_frame,
+     .		pubpi = 36, ubpi_frame = 1, to_ubpi = to_vcoi + vcoi_frame,
+     .		pvbpi = 37, vbpi_frame = 1, to_vbpi = to_ubpi + ubpi_frame,
+     .		pubwi = 38, ubwi_frame = 1, to_ubwi = to_vbpi + vbpi_frame,
+     .		pvbwi = 39, vbwi_frame = 1, to_vbwi = to_ubwi + ubwi_frame,
+     .		pucoe = 40, ucoe_frame = 2, to_ucoe = to_vbwi + vbwi_frame,
+     .		pvcoe = 41, vcoe_frame = 2, to_vcoe = to_ucoe + ucoe_frame,
+     .		puad  = 42,  uad_frame = 3, to_uad  = to_vcoe + vcoe_frame,
+     .		pvad  = 43,  vad_frame = 3, to_vad  = to_uad  +  uad_frame,
+     .		pudf  = 44,  udf_frame = 2, to_udf  = to_vad  +  vad_frame,
+     .		pvdf  = 45,  vdf_frame = 2, to_vdf  = to_udf  +  udf_frame )
+	PARAMETER (
+     .		pdudt = 46, dudt_frame = 1, to_dudt = to_vdf  +  vdf_frame,
+     .		pdvdt = 47, dvdt_frame = 1, to_dvdt = to_dudt + dudt_frame,
+     .		pdwdt = 48, dwdt_frame = 1, to_dwdt = to_dvdt + dvdt_frame,
+     .		pdtdt = 49, dtdt_frame = 1, to_dtdt = to_dwdt + dwdt_frame,
+     .		pubps = 50, ubps_frame = 5, to_ubps = to_dtdt + dtdt_frame,
+     .		pvbps = 51, vbps_frame = 5, to_vbps = to_ubps + ubps_frame,
+     .		psali = 52, sali_frame = 1, to_sali = to_vbps + vbps_frame,
+     .		pdens = 53, dens_frame = 2, to_dens = to_sali + sali_frame,
+     .		pubp  = 54,  ubp_frame = 2, to_ubp  = to_dens + dens_frame,
+     .		pvbp  = 55,  vbp_frame = 2, to_vbp  = to_ubp  +  ubp_frame,
+     .		pcmsk = 56, cmsk_frame = 2, to_cmsk = to_vbp  +  vbp_frame,
+     .		pw_t  = 57,  w_t_frame = 2, to_w_t  = to_cmsk + cmsk_frame,
+     .		pcair = 58, cair_frame = 1, to_cair = to_w_t  +  w_t_frame,
+     .		pair  = 59,  air_frame = 2, to_air  = to_cair + cair_frame,
+     .					   num_inst = to_air  +  air_frame  )
diff --git a/fer/common/interp_stack.parm b/fer/common/interp_stack.parm
new file mode 100644
index 0000000..453294a
--- /dev/null
+++ b/fer/common/interp_stack.parm
@@ -0,0 +1,206 @@
+* INTERP_STACK.PARM
+* parameters needed for the functioning of the interpretation stack, only
+*
+* 10/98 *jc* added isact_reduce
+* 6/01 *sh* added isact_event_mask
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690 12/13 *sh* for auto-curvilinear Ferret
+
+* minimum working space provided to transformations
+	INTEGER		iswksiz
+	PARAMETER     ( iswksiz = 50 )
+
+* classes of stack activities
+	INTEGER		isact_class_trans,
+     .			isact_class_regrid,
+     .			isact_class_gather,
+     .			isact_class_modulo,
+     .			isact_class_reverse,
+     .			isact_class_impl_grid,
+     .			isact_class_reconcile,
+     .			isact_class_sample,
+     .			isact_class_subspan_fill,
+     .			isact_class_aggregate_gather,
+     .			isact_class_aux_plot_vars
+	PARAMETER     ( isact_class_trans    = 1,
+     .			isact_class_regrid   = 2,
+     .			isact_class_gather   = 3,
+     .			isact_class_modulo   = 4,
+     .			isact_class_reverse  = 5,
+     .			isact_class_impl_grid  = 6,
+     .			isact_class_reconcile  = 7,
+     .			isact_class_sample   = 8,
+     .			isact_class_subspan_fill = 9,
+     .			isact_class_aggregate_gather = 10,
+     .			isact_class_aux_plot_vars = 11 )
+
+* to help in defining classes of activity codes ...
+	INTEGER		isact_trans_code
+	PARAMETER     (	isact_trans_code  = 100 )
+
+* stack activities
+	INTEGER		isact_request,
+     .			isact_algebra,
+     .			isact_rotate,
+     .			isact_subset,
+     .			isact_xy2other,
+     .			isact_read,
+     .			isact_calculate,
+     .			isact_regrid,
+     .			isact_autogrid,
+     .			isact_gather,
+     .			isact_get_grid,
+     .			isact_modulo,
+     .			isact_reverse,
+     .			isact_impl_grid,
+     .			isact_reconcile,
+     .			isact_reduce,
+     .			isact_sample,
+     .			isact_subspan_fill,
+     .			isact_aggregate_gather,
+     .			isact_get_agg_grid,
+     .			isact_auxvar_regrid,
+     .			isact_var_ready,
+     .			isact_auxvar_ready,
+     .			isact_aux_plot_vars
+	PARAMETER     ( isact_request		= 1,
+     .			isact_algebra		= 2,
+     .			isact_rotate		= 3,
+     .			isact_subset		= 4,
+     .			isact_xy2other		= 5,
+     .			isact_read		= 6,
+     .			isact_calculate		= 7,
+     .			isact_regrid		= 8,
+     .			isact_autogrid		= 9,
+     .			isact_gather		= 10,
+     .			isact_get_grid		= 11,
+     .			isact_modulo		= 12,
+     .			isact_reverse		= 13,
+     .			isact_impl_grid		= 14,
+     .			isact_reconcile		= 15,
+     .			isact_sample		= 17,
+     .			isact_subspan_fill	= 18,
+     .			isact_aggregate_gather	= 19,
+     .			isact_get_agg_grid      = 20,
+     .			isact_auxvar_regrid	= 21,
+     .			isact_var_ready         = 22,
+     .			isact_auxvar_ready      = 23,
+     .			isact_aux_plot_vars     = 24,
+     .          	isact_reduce = 16 ) ! never used: GC fcns perform axis reduction
+
+* transformations (which are also stack activities)
+	INTEGER		isact_interp,
+     .			isact_average,
+     .			isact_integ_def,
+     .			isact_integ_indef,
+     .			isact_deriv_cntr,
+     .			isact_deriv_fwrd,
+     .			isact_deriv_bkwd,
+     .			isact_max,
+     .			isact_min,
+     .			isact_smth_max,
+     .			isact_smth_median,
+     .			isact_smth_min,
+     .			isact_smth_box,
+     .			isact_smth_binml,
+     .			isact_smth_hanng,
+     .			isact_smth_parzn,
+     .			isact_smth_welch,
+     .			isact_shift,
+     .			isact_4d_ave,
+     .			isact_4d_int_def,
+     .			isact_4d_var,
+     .			isact_4d_good_pt,
+     .			isact_4d_bad_pt,
+     .			isact_fill_ave,
+     .			isact_fill_interp,
+     .			isact_fill_near,
+     .			isact_locate,
+     .          	isact_wgted_eq,
+     .          	isact_sum,
+     .          	isact_run_sum,
+     .			isact_std_dev,
+     .			isact_variance,
+     .			isact_npoints,   ! unused
+     .			isact_good_pt,
+     .			isact_bad_pt,
+     .			isact_4d_sum
+	INTEGER		isact_nrst_dist_abv,
+     .			isact_nrst_dist_blw,
+     .			isact_nrst_indx_abv,
+     .			isact_nrst_indx_blw,
+     .			isact_event_mask
+
+	PARAMETER (
+     .		isact_interp		= isact_trans_code + trans_interpolate,
+     .		isact_average		= isact_trans_code + trans_average,
+     .		isact_integ_def		= isact_trans_code + trans_integ_def,
+     .		isact_integ_indef	= isact_trans_code + trans_integ_indef,
+     .		isact_deriv_cntr	= isact_trans_code + trans_deriv_cntr,
+     .		isact_deriv_fwrd	= isact_trans_code + trans_deriv_fwrd,
+     .		isact_deriv_bkwd	= isact_trans_code + trans_deriv_bkwd,
+     .		isact_max		= isact_trans_code + trans_max,
+     .		isact_min		= isact_trans_code + trans_min,
+     .		isact_smth_box		= isact_trans_code + trans_smth_box,
+     .		isact_smth_binml	= isact_trans_code + trans_smth_binml,
+     .		isact_smth_hanng	= isact_trans_code + trans_smth_hanng,
+     .		isact_smth_parzn	= isact_trans_code + trans_smth_parzn,
+     .		isact_smth_welch	= isact_trans_code + trans_smth_welch,
+     .		isact_shift		= isact_trans_code + trans_shift,
+     .		isact_4d_ave		= isact_trans_code + trans_4d_ave,
+     .		isact_4d_int_def	= isact_trans_code + trans_4d_int_def,
+     .		isact_4d_var		= isact_trans_code + trans_4d_var,
+     .		isact_4d_good_pt	= isact_trans_code + trans_4d_good_pt,
+     .		isact_4d_bad_pt		= isact_trans_code + trans_4d_bad_pt,
+     .		isact_fill_ave		= isact_trans_code + trans_fill_ave,
+     .		isact_locate		= isact_trans_code + trans_locate,
+     .          isact_wgted_eq		= isact_trans_code + trans_wgted_eq,
+     .          isact_sum		= isact_trans_code + trans_sum,
+     .          isact_run_sum		= isact_trans_code + trans_run_sum,
+     .		isact_std_dev		= isact_trans_code + trans_std_dev,
+     .		isact_variance		= isact_trans_code + trans_variance,
+     .		isact_npoints		= isact_trans_code + trans_npoints,
+     .		isact_good_pt		= isact_trans_code + trans_good_pt,
+     .		isact_bad_pt		= isact_trans_code + trans_bad_pt,
+     .		isact_fill_interp	= isact_trans_code + trans_fill_interp,
+     .		isact_fill_near		= isact_trans_code + trans_fill_near,
+     .		isact_smth_max		= isact_trans_code + trans_smth_max,
+     .		isact_smth_median	= isact_trans_code + trans_smth_median,
+     .		isact_smth_min		= isact_trans_code + trans_smth_min,
+     .		isact_4d_sum		= isact_trans_code + trans_4d_sum )
+	PARAMETER (
+     .		isact_nrst_dist_abv = isact_trans_code + trans_nrst_dist_abv,
+     .		isact_nrst_dist_blw = isact_trans_code + trans_nrst_dist_blw,
+     .		isact_nrst_indx_abv = isact_trans_code + trans_nrst_indx_abv,
+     .		isact_nrst_indx_blw = isact_trans_code + trans_nrst_indx_blw,
+     .		isact_event_mask    = isact_trans_code + trans_event_mask)
+
+* classes of stack objects
+	INTEGER		isobj_uvar,
+     .			isobj_1_item
+	PARAMETER     ( isobj_uvar   = 1,
+     .			isobj_1_item = 2 )
+
+* phases in the creation of a "merged" context for algebraic expressions
+	REAL		isalg_transfer, isalg_merge_1, isalg_merge_n,
+     .			isalg_allocate, isalg_getgrid
+	PARAMETER     ( isalg_allocate	= -1.,
+     .			isalg_getgrid   = -123.,
+     .			isalg_transfer	= 1.,
+     .			isalg_merge_1	= 2.,
+     .			isalg_merge_n	= 3. )
+
+* phases of completing operations
+	INTEGER		isphase_allatonce,
+     .			isphase_1,
+     .			isphase_2,
+     .			isphase_get_aux_var,
+     .			isphase_get_source_var,
+     .			isphase_do_aux_regrid
+	PARAMETER     ( isphase_allatonce      = 1000,
+     .			isphase_1	       = 1,
+     .			isphase_2	       = 2,
+     .			isphase_get_aux_var    = 1,
+     .			isphase_get_source_var = 2,
+     .			isphase_do_aux_regrid  = 3 )
+
diff --git a/fer/common/list.h b/fer/common/list.h
new file mode 100644
index 0000000..63066c8
--- /dev/null
+++ b/fer/common/list.h
@@ -0,0 +1,90 @@
+/* list.h -- data structures and such for generic list package
+ * 
+ * Last edited: Tue Jul 28 15:29:56 1992 by bcs (Bradley C. Spatz) on wasp
+ *
+ * Copyright (C) 1992, Bradley C. Spatz, bcs at ufl.edu
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/* Define a structure to describe the list. */
+struct list_t {
+   int size;
+   struct list_element_t *front;
+   struct list_element_t *rear;
+   struct list_element_t *curr;
+};
+
+/* Define a structure to describe each element in the list. */
+struct list_element_t {
+   struct list_element_t *prev;
+   struct list_element_t *next;
+   char *data;
+};
+
+/* Structs are ugly, so... */
+typedef struct list_t LIST;
+typedef struct list_element_t LIST_ELEMENT;
+
+/* Define some constants for controlling list traversals.  We
+ * bit-code the attributes so they can be OR'd together.
+ */
+#define LIST_FORW	0
+#define LIST_BACK	2
+#define LIST_FRNT	4
+#define LIST_CURR	8
+#define LIST_REAR	18
+/* 16 + 2, since REAR implies BACKwards. */
+#define LIST_SAVE	32
+#define LIST_ALTR	64
+
+/* Define some constants for return codes and such. */
+#ifndef TRUE
+#define TRUE  1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+/* LIST_DEALLOC and LIST_NODEALLOC are passed as pointer-to-function "standard" values */
+#define LIST_DEALLOC   ((void (*)(char *))(-1))
+#define LIST_NODEALLOC ((void (*)(char *))(-2))
+#define LIST_EMPTY      0
+#define LIST_OK         1
+#define LIST_EXTENT     2
+
+/* prototypes */
+LIST *list_init(void);
+LIST *list_mvprev(LIST *list);
+LIST *list_mvnext(LIST *list);
+char *list_insert_before(LIST *list, char *data, int bytes);
+char *list_insert_after(LIST *list, char *data, int bytes);
+char *list_remove_front(LIST *list);
+char *list_remove_rear(LIST *list);
+char *list_remove_curr(LIST *list);
+int   list_traverse(LIST *list, char *data, int (*func)(char *, char *), int opts);
+void  list_free(LIST *list, void (*dealloc)(char *));
+
+/* Yet more prototypes - previously were possibly macros */
+LIST *list_mvfront(LIST *list);
+LIST *list_mvrear(LIST *list);
+int   list_empty(LIST *list);
+char *list_front(LIST *list);
+char *list_curr(LIST *list);
+char *list_rear(LIST *list);
+int   list_size(LIST *list);
+
+
+
diff --git a/fer/common/movies.parm b/fer/common/movies.parm
new file mode 100644
index 0000000..c8cbd40
--- /dev/null
+++ b/fer/common/movies.parm
@@ -0,0 +1,5 @@
+
+	CHARACTER*16   plaser_flag
+	PARAMETER (plaser_flag = '....(laser disk)')	
+                                            
+	CHARACTER*3	pframe_hdf_runlen
diff --git a/fer/common/netcdf4_settings.cmn b/fer/common/netcdf4_settings.cmn
new file mode 100644
index 0000000..403298b
--- /dev/null
+++ b/fer/common/netcdf4_settings.cmn
@@ -0,0 +1,52 @@
+* netcdf4_settings.cmn
+* Parameters and flags controlling netcdf4 file output.
+*
+*	netcdf4_type	- netcdf format: 4=netcdf4, 3=netcdf3(=classic), 6=64-bit
+*	xchunk_size     - chunk size in X direction
+*	ychunk_size     - chunk size in Y direction
+*	zchunk_size     - chunk size in Z direction
+*	tchunk_size     - chunk size in T direction
+*	echunk_size     - chunk size in E direction
+*	fchunk_size     - chunk size in F direction
+*	deflate_lev	- deflate level (0 for no deflate)
+*	shuffle_flag    - shuffle - 0 or 1
+*	endian_code     - native=0, little=1, big=0 match nf_endian_* params
+*	default_cache_size - This is read and stored the first time cache size is queried.
+*			  to be used to restore the default.
+*	cache_size_mb   - cache_chunk size in mbytes
+*
+* The following are for saving the values the users enters via 
+* SET LIST/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE
+*	netcdf4_type_set - netcdf format: 4=netcdf4, 3=netcdf3(=classic), 6=64-bit
+*	xchunk_size_set  - chunk size in X direction
+*	ychunk_size_set  - chunk size in Y direction
+*	zchunk_size_set  - chunk size in Z direction
+*	tchunk_size_set  - chunk size in T direction
+*	echunk_size_set  - chunk size in E direction
+*	fchunk_size_set  - chunk size in F direction
+*	deflate_lev_set  - deflate level (0 for no deflate)
+*	shuffle_flag_set - shuffle - 0 or 1
+*	endian_code_set  - native=0, little=1, big=0 match nf_endian_* params
+*
+*    2/12 *kms* Moved cache_size_mb to the beginning to eliminate warnings about padding
+
+	COMMON/NETCDF4/cache_size_mb,
+     .		netcdf4_type, xchunk_size, ychunk_size, 
+     .		zchunk_size, tchunk_size, echunk_size, fchunk_size, 
+     .		deflate_lev, shuffle_flag, endian_code, 
+     .		netcdf4_type_set, xchunk_size_set, ychunk_size_set, 
+     .		zchunk_size_set, tchunk_size_set, echunk_size_set, 
+     .		fchunk_size_set,  deflate_lev_set, 
+     .		shuffle_flag_set, endian_code_set, 
+     .		default_cache_size
+
+	INTEGER 
+     .		netcdf4_type, xchunk_size, ychunk_size, 
+     .		zchunk_size, tchunk_size, echunk_size, fchunk_size, 
+     .		deflate_lev, shuffle_flag, endian_code, 
+     .		netcdf4_type_set, xchunk_size_set, ychunk_size_set, 
+     .		zchunk_size_set, tchunk_size_set, echunk_size_set, 
+     .		fchunk_size_set,  deflate_lev_set, 
+     .		shuffle_flag_set, endian_code_set, 
+     .		default_cache_size
+	REAL cache_size_mb   
diff --git a/fer/common/plot_setup.parm b/fer/common/plot_setup.parm
new file mode 100644
index 0000000..12fe1df
--- /dev/null
+++ b/fer/common/plot_setup.parm
@@ -0,0 +1,155 @@
+* PLOT_SETUP.PARM
+
+* V510 *sh* 3/00 - added ppl_dodsurl
+* V530 *acm* 3/01 - added ppl_calendar
+* PyFr *kms*  7/13 Added the dflt_*  parameters for ppl; 
+*                  added dflt_ to values that needs to be scaled;
+*                  added dflt_letsiz_small and dflt_letsiz_large;
+*                  Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin from xplot_setup.cmn,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale.
+* V686 *acm*12/13 - Need 2 more moveable labels in the upper-left block
+*                   for E and F dimension location labels LABNUM_E and LABNUM_F
+
+* default plot size values for PPL
+        REAL        dflt_xinches,
+     .              dflt_yinches,
+     .              dflt_imgscale,
+     .              dflt_thicken,
+     .              dflt_textprom
+        PARAMETER ( dflt_xinches   = 10.50,
+     .              dflt_yinches   =  8.50,
+     .              dflt_imgscale  =  0.83666,
+     .              dflt_thicken   =  1.00,
+     .              dflt_textprom  =  1.00 )
+
+* default lengths for PPL which need to be scaled by pplscale
+        REAL        dflt_xwhitelo,
+     .              dflt_ywhitelo,
+     .              dflt_xwhitehi,
+     .              dflt_ywhitehi,
+     .              dflt_tics_lg,
+     .              dflt_tics_sm,
+     .              dflt_con_labsp,
+     .              dflt_con_dshln,
+     .              dflt_vec_len
+        PARAMETER ( dflt_xwhitelo  =  1.375,
+     .              dflt_ywhitelo  =  1.375,
+     .              dflt_xwhitehi  =  1.375,
+     .              dflt_ywhitehi  =  1.375,
+     .              dflt_tics_lg   =  0.25,
+     .              dflt_tics_sm   =  0.125,
+     .              dflt_con_labsp =  5.00,
+     .              dflt_con_dshln =  0.04,
+     .              dflt_vec_len   =  0.50 )
+ 
+* parameters to communicate with PLOT+
+        INTEGER     ppl_centered,
+     .              ppl_left_just,
+     .              ppl_right_just,
+     .              ppl_sidebyside,
+     .              is
+        CHARACTER*1 from, line
+        PARAMETER ( ppl_centered   = 0,
+     .              ppl_left_just  = -1,
+     .              ppl_right_just = +1,
+     .              ppl_sidebyside = 1,
+     .              from = ' ',
+     .              line = ' ',
+     .              is = 0 )
+
+* parameters describing the locations of labels
+        INTEGER     lab_loc_axlen_plus,
+     .              lab_loc_axlen_times,
+     .              lab_loc_absolute,
+     .              ppl_title,
+     .              ppl_xlab,
+     .              ppl_ylab,
+     .              ppl_movlab,
+     .              ppl_dset,
+     .              ppl_aspect,
+     .              ppl_year,
+     .              ppl_datitl,
+     .              ppl_dodsurl,
+     .              ppl_calendar,
+     .              ppl_offset
+
+        PARAMETER ( lab_loc_axlen_times = 2,
+     .              lab_loc_axlen_plus  = 1,
+     .              lab_loc_absolute    = 0,
+     .              ppl_title           = -1,
+     .              ppl_xlab            = -2,
+     .              ppl_ylab            = -3,
+     .              ppl_movlab          = -4,
+     .              ppl_dset            = 7,
+     .              ppl_aspect          = 8,
+     .              ppl_year            = 9,
+     .              ppl_datitl          = 10,
+     .              ppl_offset          = 11,
+     .              ppl_dodsurl         = 12,
+     .              ppl_calendar        = 13 )
+
+* parameters giving the locations and sizes of labels and keys;
+* need to be scaled by pplscale or textscale except for key_line_frac
+        REAL        key_line_frac,
+     .              dflt_letsize_title,
+     .              dflt_letsize_label,
+     .              dflt_letsize_axis,
+     .              dflt_key_xspace0,
+     .              dflt_key_yspace0,
+     .              dflt_key_labht0,
+     .              dflt_key_xorigin,
+     .              dflt_key_yorigin,
+     .              dflt_key_xwhite_space,
+     .              dflt_key_ywhite_space,
+     .              dflt_ovkey_xspace,
+     .              dflt_ovkey_yspace,
+     .              dflt_ovkey_labht,
+     .              dflt_ovkey_xorigin,
+     .              dflt_ovkey_yorigin,
+     .              dflt_ul_labht0,
+     .              dflt_ul_yspace0,
+     .              dflt_ul_xorigin,
+     .              dflt_ul_yorigin
+
+        PARAMETER ( key_line_frac         =  0.30,
+     .              dflt_letsize_title    =  0.20,
+     .              dflt_letsize_label    =  0.12,
+     .              dflt_letsize_axis     =  0.10,
+     .              dflt_key_xspace0      =  3.00,
+     .              dflt_key_yspace0      =  0.25,
+     .              dflt_key_labht0       =  0.12,
+     .              dflt_key_xorigin      =  1.50,
+     .              dflt_key_yorigin      = -0.85,
+     .              dflt_key_xwhite_space =  0.30,
+     .              dflt_key_ywhite_space =  0.02,
+     .              dflt_ovkey_xspace     =  2.10,
+     .              dflt_ovkey_yspace     =  0.18,
+     .              dflt_ovkey_labht      =  0.08,
+     .              dflt_ovkey_xorigin    = -1.10,
+     .              dflt_ovkey_yorigin    = -0.60,
+     .              dflt_ul_labht0        =  0.12,
+     .              dflt_ul_yspace0       =  0.20,
+     .              dflt_ul_xorigin       =  0.00,
+     .              dflt_ul_yorigin       =  0.60 )
+
+* parameters used to determine VECTOR sizes
+        REAL        vxax_len, vyax_len, max_vecperinch
+        INTEGER     max_x_vec, max_y_vec
+        PARAMETER ( vxax_len = 8., 
+     .              vyax_len = 6., 
+     .              max_vecperinch = 5.,
+     .              max_x_vec = vxax_len * max_vecperinch, 
+     .              max_y_vec = vyax_len * max_vecperinch )
+
+* parameters to describe line styles
+        INTEGER     num_plain, num_sym, max_sym, num_fancy_lines
+        PARAMETER ( num_plain = 6,
+     .              num_fancy_lines = 18,
+     .              num_sym = 17,
+     .              max_sym = 88  )
+
diff --git a/fer/common/ppl_ax_save.cmn b/fer/common/ppl_ax_save.cmn
new file mode 100644
index 0000000..2875d58
--- /dev/null
+++ b/fer/common/ppl_ax_save.cmn
@@ -0,0 +1,14 @@
+
+* static storage in COMMON  (see ppl_axes_off.F)
+
+* v5.40 ACM take this out of ppl_axes_off.F etc.
+
+* plot settings changed by PLOT/AXES  PLOT/NOLAB  /PLOT/NOAXES  
+* which we want to restore to settings possibly made by PPL AXLAB commands
+* etc and which for backwards compatibility should persist
+
+	LOGICAL change_axlab, time_axis
+	INTEGER save_iaxon(4), save_labx, save_laby
+
+	COMMON /PPL_AX_SAVE/ 
+     .     save_iaxon, save_labx, save_laby, change_axlab, time_axis
diff --git a/fer/common/ppl_dash_save.cmn b/fer/common/ppl_dash_save.cmn
new file mode 100644
index 0000000..c63ba50
--- /dev/null
+++ b/fer/common/ppl_dash_save.cmn
@@ -0,0 +1,17 @@
+
+* static storage in COMMON  (see ppl_axes_off.F)
+
+* v5.40 ACM variables to save DASH state
+* V6.11 4/08 *acm* Fixes for bug 1571, state of axis on and off
+
+* plot settings changed by PLOT/DASH which we want to restore to settings 
+* possibly made by PPL LINE commands which for backwards compatibility 
+* should persist
+
+	LOGICAL dash_changed(NLINES)
+	INTEGER linenum_save
+        REAL dashsave(NLINES,4)
+ 
+	COMMON /PPL_DASH_SAVE/ 
+     .     dashsave, dash_changed, linenum_save
+
diff --git a/fer/common/pyferret.parm b/fer/common/pyferret.parm
new file mode 100644
index 0000000..d0b0fc1
--- /dev/null
+++ b/fer/common/pyferret.parm
@@ -0,0 +1,36 @@
+*  PYFERRET.PARM
+
+*     axis type parameters (must match those in pyferret.h)
+      INTEGER    AXISTYPE_LONGITUDE, AXISTYPE_LATITUDE, AXISTYPE_LEVEL,
+     .           AXISTYPE_TIME, AXISTYPE_CUSTOM, AXISTYPE_ABSTRACT,
+     .           AXISTYPE_NORMAL
+      PARAMETER (AXISTYPE_LONGITUDE = 1,
+     .           AXISTYPE_LATITUDE = 2,
+     .           AXISTYPE_LEVEL = 3,
+     .           AXISTYPE_TIME = 4,
+     .           AXISTYPE_CUSTOM = 5,
+     .           AXISTYPE_ABSTRACT = 6,
+     .           AXISTYPE_NORMAL = 7)
+
+*     time array index parameters (must be one more than those in pyferret.h)
+      INTEGER TIMEARRAY_DAYINDEX, TIMEARRAY_MONTHINDEX,
+     .        TIMEARRAY_YEARINDEX, TIMEARRAY_HOURINDEX,
+     .        TIMEARRAY_MINUTEINDEX, TIMEARRAY_SECONDINDEX
+      PARAMETER (TIMEARRAY_DAYINDEX  = 1,
+     .           TIMEARRAY_MONTHINDEX = 2,
+     .           TIMEARRAY_YEARINDEX = 3,
+     .           TIMEARRAY_HOURINDEX = 4,
+     .           TIMEARRAY_MINUTEINDEX = 5,
+     .           TIMEARRAY_SECONDINDEX = 6)
+
+*     calendar type parameters (must match those in pyferret.h)
+      INTEGER CALTYPE_NONE, CALTYPE_360DAY,
+     .        CALTYPE_NOLEAP, CALTYPE_GREGORIAN,
+     .        CALTYPE_JULIAN, CALTYPE_ALLLEAP
+      PARAMETER (CALTYPE_NONE = -1,
+     .           CALTYPE_360DAY = 0,
+     .           CALTYPE_NOLEAP = 50000,
+     .           CALTYPE_GREGORIAN = 52425,
+     .           CALTYPE_JULIAN = 52500,
+     .           CALTYPE_ALLLEAP = 60000)
+
diff --git a/fer/common/rpn.parm b/fer/common/rpn.parm
new file mode 100644
index 0000000..70f5a3a
--- /dev/null
+++ b/fer/common/rpn.parm
@@ -0,0 +1,45 @@
+*	RPN.PARM
+
+*	Parameters for RPN.FOR
+
+*	J Davison TMAP/JISAO/PMEL/NOAA
+*	10.20.87
+* 7/95 - increased number of states from 8 to 9 *sh* (see alg_break_up.F)
+* 12/96 *sh* added parameter right_paren
+* 7/97 - *sh* increased maxatoms
+* 7/98 - *sh* increased num_state and num_class to add single quoted varnames
+* 12/98 - *sh*  increased num_state and num_class to add {1,3,5} notation
+*  1/99 - *sh*  increased num_state and num_class to add string variables
+* V530  10/00 - *sh*  increased maxatoms and max_exp
+
+	integer		maxatoms,
+     .			max_fcn,
+     .			max_exp,
+     .			max_wte,
+     .			where,
+     .			pthen,
+     .			pelse,
+     .			comma,
+     .			added_left_paren,
+     .			left_paren,
+     .			right_paren,
+     .			inf_flg,
+     .			stk_flg,
+     .			num_state,
+     .			num_class
+
+	parameter     ( maxatoms		= 1000,
+     .			max_fcn 		= 25,
+     .			max_exp 		= 200,
+     .			max_wte			= 3,
+     .			where			= 1,
+     .			pthen			= 2,
+     .			pelse			= 3,
+     .			comma 			= 1,
+     .			added_left_paren	= 666,
+     .			left_paren		= 2,
+     .			right_paren		= 3,
+     .			inf_flg 		= 1,
+     .			stk_flg 		= 2,
+     .			num_state		= 12,
+     .			num_class		= 15 )
diff --git a/fer/common/slash.parm b/fer/common/slash.parm
new file mode 100644
index 0000000..8ebda1a
--- /dev/null
+++ b/fer/common/slash.parm
@@ -0,0 +1,702 @@
+* SLASH.PARM
+* v450:  5/29 -- added slash_noaxes
+* v491:  12.98 - added pattern for contour and shade *jd*
+* v500:  03.99 - added qualifiers for polygon *jd*
+* V510 *sh* 3/00 - added slash_set_data_tregular, slash_plot_color
+* V522+ *acm* 10/00 - added VECTOR/FLOWLINE (alias FLOW)
+* V530 *sh* 10/00 - added slash_set_data_type, slash_set_data_delimiters
+*	*sh* 1/01 - added slash_plot_step
+* V530 *kob* 1/01 - added slash_repeat_animate, slash_repeat_loop
+* V530 *acm* 5/01 - added slash_plot_dash
+* V533 *sh* 6/01 - added slash_set_var_name
+* V533 *acm*6/01 - added slash_is_logh, slash_is_logv
+* V540 *acm*7/01 - added /AXES[=TOP,BOTTOM,LEFT,RIGHT]  for plot commands
+*		     (PLOT, CONTOUR, POLYGON, SHADE, VECTOR)
+*      *kob* 8/01 - add slash_exit_command
+*                       slash_exit_loop
+*			slash_exit_prompt
+*			slash_exit_script
+*			slash_exit_program			
+*      *sh* 11/01 - add slash_list_width
+* V552:*acm*  4/02 - add SET VARIABLE/SCALEFAC/OFFSET
+* V553 *acm*  1/04 - added slash_repeat_range, slash_repeat_name
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* V570: *acm* 5/40 add LIST/EDGES LIST/BOUNDS for NetCDF output
+*       *acm* 6/04 - add SET AXIS/CALENDAR /T0 /UNITS
+*       *acm* 6/04 - add CANCEL AXIS/DEPTH
+* V580: *acm*10/04 - add SHOW VAR/XML
+* V580: *acm*11/04 - add PLOT/NOKEY
+* V581: *acm* 5/05 - add SHADE/MOD and CONTOUR/MOD
+* V581: *acm* 5/05 - add EXIT/CYCLE
+* V600: *acm* 2/06 - add SET VARIABLE/OUTTYPE
+*       *jli* 7/06 - add SET AXIS /STRIDE /OFFSET
+*       *acm* 7/06 - add CANCEL ATTRIBUTE /OUTPUT /DATA
+* V609: *acm* 2/08 - add SHADE/TRIM
+* V6.2  *acm* 5/08 new qualifier FRAME/TRANSPARENT
+* V6.2  *acm* 5/08 new qualifier LIST/KEEP_AXNAMES for CDF output
+* V6.6  *acm* 1/10 new qualifiers for LIST netCDF4: NCFORMAT,
+*                  XCHUNK,YCHUNK,ZCHUNK,TCHUNK,DEFLATE,SHUFFLE,ENDIAN
+* V6.5  *acm* 3/10 new qualifiers on (some) SHOW commands and on MESSAGE: 
+*                  /OUTFILE= /APPEND /CLOBBER
+* V6.6  *acm* 3/10 new qualifiers for SET LIST netCDF4: NCFORMAT,
+*                  DEFLATE,SHUFFLE,ENDIAN,XCHUNK,YCHUNK,ZCHUNK,TCHUNK
+*       *kms* 5/10 add SET AXIS/REGULAR to force interpreting the axis as regular
+*       *kms* 5/10 add SET REDIRECT /TEE /JOURNAL /FILE /APPEND /CLOBBER 
+*                  for stdout/stderr redirection
+*       *kms* 7/10 add SET DATA /BROWSE to browse for the dataset
+* V6.63 *acm* 7/10 Add VECTOR/KEY to force key even if /NOLAB
+* V664  8/10 *kms* Add EXIT /TOPYTHON
+* V68 *acm* 1/12   Add USE/STRICT; see ticket 1910.
+* PyFr  *kms* 1/12 Add SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL
+* V683  8/12 *acm*  New SET LIST/OUTTYPE CANCEL LIST/OUTTYPE, and SAVE/OUTTYPE 
+* V684 *adm* 12/12 Changes for POLY/MODULO and  VECTOR/MODULO on curvilinear plots.
+* PyFr  *kms* 2/13 Remove SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL
+* V685 *acm*  4/13 Add /HIDDEN on sho dat for aggregations.
+* V685 6/13 *acm* new qualifier SAVE/NOBOUNDS
+* V685 6/13 *acm* new qualifier SAVE/NOCOORDS
+* V685 6/13 *acm* new qualifier SHOW DATA/HIDDEN
+* PyFr  *kms*  7/13 Add /OPACITY to CONTOUR, PLOT, POLYGON, SHADE, VECTOR
+* PyFr  *kms*  7/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to FRAME
+* PyFr  *kms*  8/13 Add /ANNOTATE to FRAME
+* V686 9/13 *sh* new qualifier SHOW VARIABLES/TREE
+* V686 1/14 *acm* Ticket 2122: Fix param values for 
+*                  SHOW GRID/FILE, SHOW GRID/CLOBBER, SHOW GRID/APPEND
+* V690 12/13 *sh* /SIGMA and /CURVILINEAR
+* V687  3/14 *acm* add SET AXIS/NAME
+
+* command qualifier states
+	INTEGER		qual_on,
+     .			qual_off
+
+* command qualifiers
+	INTEGER		
+     .			slash_set_list_prec,
+     .			slash_set_list_out,
+     .			slash_set_list_form,
+     .			slash_set_list_append,
+     .			slash_set_list_heading,
+     .			slash_set_list_ncformat,
+     .			slash_set_list_endian,
+     .			slash_set_list_deflate,
+     .			slash_set_list_shuffle,
+     .			slash_set_list_xchunk,
+     .			slash_set_list_ychunk,
+     .			slash_set_list_zchunk,
+     .			slash_set_list_tchunk,
+     .			slash_set_list_echunk,
+     .			slash_set_list_fchunk,
+     .			slash_set_list_outtype,
+     .
+     .			slash_canc_list_all,
+     .			slash_canc_list_prec,
+     .			slash_canc_list_out,
+     .			slash_canc_list_form,
+     .			slash_canc_list_heading,
+     .			slash_canc_list_append,
+     .			slash_canc_list_outtyp,
+     .
+     .			slash_canc_axis_modulo,
+     .			slash_canc_axis_all,
+     .			slash_canc_axis_depth,
+     .                  slash_canc_axis_stride,
+     .
+     .			slash_canc_data_noerr,
+     .
+     .			slash_canc_var_data,
+     .			slash_canc_var_sigma,
+     .			slash_canc_var_curvi,
+     .
+     .			slash_canc_attr_output,
+     .			slash_canc_attr_data
+
+	INTEGER	
+     .			slash_set_movie_out,
+     .			slash_set_movie_compress,
+     .			slash_set_movie_laser,
+     .			slash_set_movie_start,
+     .
+     .			slash_show_axis_file,
+     .			slash_show_axis_append,
+     .			slash_show_axis_clobber,
+     .
+     .			slash_show_var_diag,
+     .			slash_show_var_user,
+     .			slash_show_var_xml,
+     .			slash_show_var_file,
+     .			slash_show_var_append,
+     .			slash_show_var_clobber,
+     .			slash_show_var_tree,
+     .			slash_show_var_sigma,
+     .			slash_show_var_curvi,
+     .
+     .			slash_show_grid_x0,
+     .			slash_show_grid_i0,
+     .			slash_show_grid_file,
+     .			slash_show_grid_clobber,
+     .			slash_show_grid_append,
+     .
+     .			slash_show_data_brief,
+     .			slash_show_data_file,
+     .			slash_show_data_append,
+     .			slash_show_data_clobber,
+     .			slash_show_data_hidden,
+     .
+     .			slash_show_func_detail,
+     .
+     .			slash_list_head,
+     .			slash_list_nohead,
+     .			slash_list_extend,
+     .			slash_list_title,
+     .			slash_list_precision,
+     .			slash_list_width,
+     .			slash_list_edges,
+     .			slash_list_bounds,
+     .			slash_list_nobounds,
+     .			slash_list_keepax,
+     .			slash_list_norow,
+     .			slash_list_ncformat,
+     .			slash_list_xchunk,
+     .			slash_list_ychunk,
+     .			slash_list_zchunk,
+     .			slash_list_tchunk,
+     .			slash_list_echunk,
+     .			slash_list_fchunk,
+     .			slash_list_deflate,
+     .			slash_list_shuffle,
+     .			slash_list_endian,
+     .			slash_list_outtype,
+     .			slash_list_curvi,
+     .			slash_list_sigma
+
+	INTEGER		
+     .			slash_set_data_ez,
+     .			slash_set_data_var,
+     .			slash_set_data_title,
+     .			slash_set_data_form,
+     .			slash_set_data_grid,
+     .			slash_set_data_skip,
+     .			slash_set_data_column,
+     .			slash_set_data_save,
+     .			slash_set_data_restore,
+     .			slash_set_data_order,
+     .			slash_set_data_type,
+     .			slash_set_data_swap,
+     .			slash_set_data_tregular,
+     .			slash_set_data_delimiters,
+     .                  slash_set_data_browse,
+     .                  slash_set_data_strict,
+     .
+     .			slash_set_var_title,
+     .			slash_set_var_unit,
+     .			slash_set_var_grid,
+     .			slash_set_var_bad,
+     .			slash_set_var_name,
+     .			slash_set_var_scale,
+     .			slash_set_var_offset,
+     .			slash_set_var_outtype,
+     .			slash_set_var_sigma,
+     .			slash_set_var_curvi,
+     .
+     .			slash_set_grid_save,
+     .			slash_set_grid_restore,
+     .
+     .			slash_set_axis_modulo,
+     .			slash_set_axis_depth,
+     .			slash_set_axis_calendar,
+     .			slash_set_axis_t0,
+     .			slash_set_axis_units,
+     .                  slash_set_axis_stride,
+     .                  slash_set_axis_offset,
+     .                  slash_set_axis_regular,
+     .                  slash_set_axis_outtype,
+     .                  slash_set_axis_name,
+     .
+     .			slash_set_memory_words,
+     .			slash_set_nccache_size,
+     .			slash_set_nccache_nelem,
+     .			slash_set_nccache_preemp,
+     .                  slash_set_attr_type,
+     .                  slash_set_attr_dset,
+     .                  slash_set_attr_output,
+     .                  slash_set_attr_like,
+     .                  slash_set_attr_quiet,
+     .
+     .                  slash_set_redirect_tee,
+     .                  slash_set_redirect_journal,
+     .                  slash_set_redirect_file,
+     .                  slash_set_redirect_append,
+     .                  slash_set_redirect_clobber
+
+	INTEGER		slash_cont_over_plot,
+     .			slash_cont_set_up,
+     .			slash_cont_frame,
+     .			slash_cont_transpz,
+     .			slash_cont_nolabels,
+     .			slash_cont_lev_same,
+     .			slash_cont_fill,
+     .			slash_cont_key,
+     .			slash_cont_line,
+     .			slash_cont_nokey,
+     .			slash_cont_spectrum,
+     .			slash_cont_pattern,
+     .			slash_cont_size,
+     .			slash_cont_spacing,
+     .			slash_cont_sigdig,
+     .			slash_cont_axes,
+     .                  slash_cont_hgrat,
+     .                  slash_cont_vgrat,
+     .                  slash_cont_grat,
+     .                  slash_cont_mod,
+     .                  slash_cont_thick,
+     .                  slash_cont_opacity,
+     .
+     .			slash_vect_over_plot,
+     .			slash_vect_set_up,
+     .			slash_vect_frame,
+     .			slash_vect_transpz,
+     .			slash_vect_aspect,
+     .			slash_vect_nolabels,
+     .			slash_vect_xskip,
+     .			slash_vect_yskip,
+     .			slash_vect_thick,
+     .			slash_vect_flowline,
+     .			slash_vect_density,
+     .			slash_vect_axes,
+     .			slash_vect_nokey,
+     .			slash_vect_hgrat,
+     .			slash_vect_vgrat,
+     .			slash_vect_grat,
+     .			slash_vect_key,
+     .			slash_vect_mod,
+     .                  slash_vect_opacity,
+     .
+     .			slash_strm_over_plot,
+     .			slash_strm_set_up,
+     .			slash_strm_frame,
+     .			slash_strm_transpz,
+     .			slash_strm_aspect,
+     .			slash_strm_nolabels,
+     .			slash_strm_density,
+     .			slash_strm_thick,
+     .
+     .			slash_shad_over_plot,
+     .			slash_shad_set_up,
+     .			slash_shad_frame,
+     .			slash_shad_transpz,
+     .			slash_shad_line,
+     .			slash_shad_nolabels,
+     .			slash_shad_lev_same,
+     .			slash_shad_key,
+     .			slash_shad_nokey,
+     .			slash_shad_pattern,
+     .			slash_shad_axes,
+     .			slash_shad_hgrat,
+     .			slash_shad_vgrat,
+     .			slash_shad_grat,
+     .			slash_shad_mod,
+     .			slash_shad_trim,
+     .			slash_shad_opacity,
+     .
+     .			slash_plot_over_plot,
+     .			slash_plot_set_up,
+     .			slash_plot_frame,
+     .			slash_plot_transpz,
+     .			slash_plot_vs,
+     .			slash_plot_symb,
+     .			slash_plot_nolabels,
+     .			slash_plot_line,
+     .			slash_plot_color,
+     .			slash_plot_thick,
+     .			slash_plot_symsize,
+     .			slash_plot_step,
+     .			slash_plot_dash,
+     .			slash_plot_axes,
+     .			slash_plot_hgrat,
+     .			slash_plot_vgrat,
+     .			slash_plot_grat,
+     .			slash_plot_nokey,
+     .			slash_plot_noyadjust,
+     .			slash_plot_key,
+     .			slash_plot_ribbon,
+     .			slash_plot_levels,
+     .			slash_plot_spectrum,
+     .			slash_plot_fast,
+     .			slash_plot_missing,
+     .                  slash_plot_opacity
+
+	INTEGER		slash_wire_over,
+     .			slash_wire_set_up,
+     .			slash_wire_frame,
+     .			slash_wire_transpz,
+     .			slash_wire_nolabels,
+     .			slash_wire_view,
+     .			slash_wire_zlimits,
+     .			slash_wire_zscale,
+     .
+     .			slash_frame_format,
+     .			slash_frame_file,
+     .			slash_frame_transp,
+     .			slash_frame_xinches,
+     .			slash_frame_yinches,
+     .			slash_frame_xpixels,
+     .			slash_frame_ypixels,
+     .			slash_frame_annotate,
+     .
+     .			slash_stat_brief,
+     .
+     .			slash_levels,
+     .			slash_length,
+     .			slash_noaxes,
+     .
+     .			slash_repeat_animate,
+     .			slash_repeat_loop,
+     .			slash_repeat_range,
+     .			slash_repeat_name,
+     .
+     .                  slash_exit_command,
+     .                  slash_exit_loop,
+     .			slash_exit_script,	
+     .			slash_exit_prompt,	
+     .			slash_exit_program,	
+     .			slash_exit_cycle,	
+     .			slash_exit_topython,	
+     .
+     .			slash_is_logh,
+     .			slash_is_logv	
+
+
+	PARAMETER     ( qual_on	 = -11,
+     .			qual_off = -12 )
+	PARAMETER     ( 
+     .			slash_set_list_prec   = 1,
+     .			slash_set_list_out    = 2,
+     .			slash_set_list_form   = 3,
+     .			slash_set_list_append = 4,
+     .			slash_set_list_heading= 5,
+     .			slash_set_list_ncformat=6,
+     .			slash_set_list_endian = 7,
+     .			slash_set_list_deflate= 8,
+     .			slash_set_list_shuffle= 9,
+     .			slash_set_list_xchunk= 10,
+     .			slash_set_list_ychunk= 11,
+     .			slash_set_list_zchunk= 12,
+     .			slash_set_list_tchunk= 13,
+     .			slash_set_list_echunk= 14,
+     .			slash_set_list_fchunk= 15,
+     .			slash_set_list_outtype=16,
+     .
+     .			slash_canc_list_all    = 1,
+     .			slash_canc_list_prec   = 2,
+     .			slash_canc_list_out    = 3,
+     .			slash_canc_list_form   = 4,
+     .			slash_canc_list_heading= 5,
+     .			slash_canc_list_append = 6,
+     .			slash_canc_list_outtyp = 7,
+     .
+     .			slash_canc_axis_modulo = 1,
+     .			slash_canc_axis_all    = 2,
+     .			slash_canc_axis_depth  = 3,
+     .                  slash_canc_axis_stride = 4,
+     .
+     .			slash_canc_data_noerr  = 2,
+     .
+     .			slash_canc_var_data	= 2,
+     .			slash_canc_var_sigma	= 3,
+     .			slash_canc_var_curvi	= 4,
+     .
+     .			slash_canc_attr_output	= 1,
+     .			slash_canc_attr_data	= 2,
+     .
+     .			slash_set_movie_out    = 1,
+     .			slash_set_movie_compress = 2,
+     .			slash_set_movie_laser  = 3,
+     .			slash_set_movie_start  = 4,
+     .
+     .			slash_show_var_diag = 3,
+     .			slash_show_var_user = 4,
+     .			slash_show_var_xml = 5,
+     .			slash_show_var_file = 6,
+     .			slash_show_var_append = 7,
+     .			slash_show_var_clobber = 8,
+     .			slash_show_var_tree = 9,
+     .			slash_show_var_sigma = 10,
+     .			slash_show_var_curvi = 11,
+     .
+     .			slash_show_grid_x0 = 7,
+     .			slash_show_grid_i0 = 1,
+     .			slash_show_grid_file = 16,
+     .			slash_show_grid_clobber = 17,
+     .			slash_show_grid_append = 18,
+     .
+     .			slash_show_data_brief = 2,
+     .			slash_show_data_file = 8,
+     .			slash_show_data_append = 9,
+     .			slash_show_data_clobber = 10,
+     .			slash_show_data_hidden = 11,
+     .
+     .			slash_show_func_detail = 1+4,
+     .			slash_show_axis_file = 1+14,
+     .			slash_show_axis_append = 1+15,
+     .			slash_show_axis_clobber = 1+16,
+     .
+     .			slash_list_head   = 1+13,
+     .			slash_list_nohead = 1+14,
+     .			slash_list_title  = 1+20,
+     .			slash_list_precision = 1+21,
+     .			slash_list_extend = 1+22,
+     .			slash_list_width = 1+37,
+     .			slash_list_edges = 1+38,
+     .			slash_list_bounds = 1+39,
+     .			slash_list_nobounds = 1+40,
+     .			slash_list_norow = 1+41,
+     .			slash_list_keepax = 1+42,
+     .			slash_list_ncformat = 1+43,
+     .			slash_list_xchunk = 1+44,
+     .			slash_list_ychunk = 1+45,
+     .			slash_list_zchunk = 1+46,
+     .			slash_list_tchunk = 1+47,
+     .			slash_list_echunk = 1+48,
+     .			slash_list_fchunk = 1+49,
+     .			slash_list_deflate = 1+50,
+     .			slash_list_shuffle = 1+51,
+     .			slash_list_endian  = 1+52,
+     .			slash_list_outtype = 1+53,
+     .			slash_list_curvi   = 1+54,
+     .			slash_list_sigma   = 1+55 )
+
+	PARAMETER     (
+     .			slash_set_data_ez	= 1,
+     .			slash_set_data_var	= 2,
+     .			slash_set_data_title	= 3,
+     .			slash_set_data_form	= 4,
+     .			slash_set_data_grid	= 5,
+     .			slash_set_data_skip	= 6,
+     .			slash_set_data_column	= 7,
+     .			slash_set_data_save	= 8,
+     .			slash_set_data_restore	= 9,
+     .			slash_set_data_order	= 10,
+     .			slash_set_data_type     = 11,
+     .			slash_set_data_swap     = 12,
+     .			slash_set_data_tregular = 13,
+     .			slash_set_data_delimiters = 14,
+     .                  slash_set_data_browse   = 15,
+     .                  slash_set_data_strict   = 16,
+     .
+     .			slash_set_var_title	= 1,
+     .			slash_set_var_unit	= 2,
+     .			slash_set_var_grid	= 3,
+     .			slash_set_var_bad	= 4,
+     .			slash_set_var_name	= 6,
+     .			slash_set_var_scale	= 7,
+     .			slash_set_var_offset	= 8,
+     .			slash_set_var_outtype	= 9,
+     .			slash_set_var_sigma	= 10,
+     .			slash_set_var_curvi	= 11,
+     .
+     .			slash_set_grid_save	= 1,
+     .			slash_set_grid_restore	= 2,
+     .
+     .			slash_set_axis_modulo	= 1,
+     .			slash_set_axis_depth    = 2,
+     .			slash_set_axis_calendar = 3,
+     .			slash_set_axis_t0       = 4,
+     .			slash_set_axis_units    = 5,
+     .                  slash_set_axis_stride   = 6,
+     .                  slash_set_axis_offset   = 7,
+     .			slash_set_axis_regular  = 8,
+     .			slash_set_axis_outtype  = 9,
+     .			slash_set_axis_name     = 10,
+     .
+     .			slash_set_memory_words	= 1,
+     .			slash_set_nccache_size	= 1,
+     .			slash_set_nccache_nelem	= 2,
+     .			slash_set_nccache_preemp= 3,
+     .
+     .                  slash_set_attr_type     = 1,
+     .                  slash_set_attr_dset     = 2,
+     .                  slash_set_attr_output   = 3,
+     .                  slash_set_attr_like     = 4,
+     .                  slash_set_attr_quiet    = 5,
+     .
+     .                  slash_set_redirect_tee     = 1,
+     .                  slash_set_redirect_journal = 2,
+     .                  slash_set_redirect_file    = 3,
+     .                  slash_set_redirect_append  = 4,
+     .                  slash_set_redirect_clobber = 5 )
+
+	PARAMETER     ( slash_cont_over_plot	= 1+12,
+     .			slash_cont_set_up	= 1+13,
+     .			slash_cont_frame	= 1+14,
+     .			slash_cont_transpz	= 1+16,
+     .			slash_cont_fill		= 1+17,
+     .			slash_cont_line		= 1+18,
+     .			slash_cont_nolabels	= 1+19,
+     .			slash_cont_lev_same	= 1+20,
+     .			slash_cont_key		= 1+21,
+     .			slash_cont_nokey	= 1+22,
+     .			slash_cont_spectrum	= 1+23,
+     .			slash_cont_size		= 1+30,
+     .			slash_cont_pattern	= 1+29,
+     .			slash_cont_spacing	= 1+31,
+     .			slash_cont_sigdig	= 1+32,
+     .			slash_cont_axes		= 1+38,
+     .			slash_cont_hgrat	= 1+39,
+     .			slash_cont_vgrat	= 1+40,
+     .			slash_cont_grat	        = 1+41,
+     .			slash_cont_mod	        = 1+42,
+     .                  slash_cont_thick        = 1+43,
+     .                  slash_cont_opacity      = 1+44,
+     .
+     .			slash_vect_over_plot	= 1+12,
+     .			slash_vect_set_up	= 1+13,
+     .			slash_vect_frame	= 1+14,
+     .			slash_vect_transpz	= 1+16,
+     .			slash_vect_aspect	= 1+18,
+     .			slash_vect_nolabels	= 1+19,
+     .			slash_vect_xskip	= 1+21,
+     .			slash_vect_yskip	= 1+22,
+     .			slash_vect_thick	= 1+23,
+     .			slash_vect_nokey	= 1+29,
+     .			slash_vect_flowline     = 1+30,
+     .			slash_vect_density      = 1+31,
+     .			slash_vect_axes		= 1+32,
+     .			slash_vect_hgrat	= 1+36,
+     .			slash_vect_vgrat	= 1+37,
+     .			slash_vect_grat 	= 1+38,
+     .			slash_vect_key	 	= 1+39,
+     .			slash_vect_mod		= 1+40,
+     .                  slash_vect_opacity      = 1+41,
+     .
+     .			slash_strm_over_plot	= 1+12,
+     .			slash_strm_set_up	= 1+12,
+     .			slash_strm_frame	= 1+14,
+     .			slash_strm_transpz	= 1+16,
+     .			slash_strm_aspect	= 1+18,
+     .			slash_strm_nolabels	= 1+19,
+     .			slash_strm_density	= 1+30,
+     .			slash_strm_thick	= 20,
+     .
+     .			slash_shad_over_plot	= 1+12,
+     .			slash_shad_set_up	= 1+13,
+     .			slash_shad_frame	= 1+14,
+     .			slash_shad_transpz	= 1+16,
+     .			slash_shad_trim		= 1+17,
+     .			slash_shad_line		= 1+18,
+     .			slash_shad_nolabels	= 1+19,
+     .			slash_shad_lev_same	= 1+20,
+     .			slash_shad_key		= 1+21,	
+     .			slash_shad_nokey	= 1+22,
+     .			slash_shad_axes		= 1+27,
+     .			slash_shad_pattern	= 1+29,
+     .			slash_shad_hgrat	= 1+30,
+     .			slash_shad_vgrat	= 1+31,
+     .			slash_shad_grat 	= 1+32,
+     .			slash_shad_mod   	= 1+33,
+     .                  slash_shad_opacity      = 1+36,
+     .
+     .			slash_plot_over_plot	= 1+13,
+     .			slash_plot_set_up	= 1+14,
+     .			slash_plot_frame	= 1+15,
+     .			slash_plot_transpz	= 1+17,
+     .			slash_plot_vs		= 1+18,
+     .			slash_plot_symb		= 1+19,
+     .			slash_plot_nolabels	= 1+20,
+     .			slash_plot_line		= 1+21,
+     .			slash_plot_color	= 1+22,
+     .			slash_plot_thick	= 1+23,
+     .			slash_plot_symsize	= 1+27,
+     .			slash_plot_step		= 1+29,
+     .			slash_plot_dash		= 1+30,
+     .			slash_plot_axes		= 1+31,
+     .			slash_plot_hgrat	= 1+32,
+     .			slash_plot_vgrat	= 1+33,
+     .			slash_plot_grat 	= 1+38,
+     .			slash_plot_nokey 	= 1+39,
+     .			slash_plot_noyadjust 	= 1+40,
+     .			slash_plot_key 		= 1+41,
+     .			slash_plot_ribbon 	= 1+42,
+     .			slash_plot_levels 	= 1+43,
+     .			slash_plot_spectrum 	= 1+44,
+     .			slash_plot_fast 	= 1+45,
+     .			slash_plot_missing 	= 1+46,
+     .                  slash_plot_opacity      = 1+47 )
+
+	PARAMETER     ( slash_wire_over		= 1+12,
+     .			slash_wire_set_up	= 1+13,
+     .			slash_wire_frame	= 1+14,
+     .			slash_wire_transpz	= 1+18,
+     .			slash_wire_nolabels	= 1+19,
+     .			slash_wire_view		= 1+16,
+     .			slash_wire_zlimits	= 1+17,
+     .			slash_wire_zscale	= 1+20,
+     .
+     .			slash_frame_format	= 0 + 1,
+     .			slash_frame_file	= 1 + 1,
+     .			slash_frame_transp	= 2 + 1,
+     .			slash_frame_xinches	= 3 + 1,
+     .			slash_frame_yinches	= 4 + 1,
+     .			slash_frame_xpixels	= 5 + 1,
+     .			slash_frame_ypixels	= 6 + 1,
+     .			slash_frame_annotate	= 7 + 1,
+     .
+     .			slash_stat_brief	= 0 + 1,
+
+     .			slash_levels		= 1+20,
+     .			slash_length		= 1+20,
+     .			slash_noaxes		= 1+28,
+     .
+     .
+     .                  slash_repeat_animate	= 12 + 1 ,
+     .                  slash_repeat_loop	= 13 + 1,
+     .                  slash_repeat_range	= 14 + 1 ,
+     .                  slash_repeat_name	= 15 + 1,
+     .
+     .			slash_exit_command	= 0 + 1,
+     .                  slash_exit_loop 	= 1 + 1,
+     .                  slash_exit_script 	= 2 + 1,
+     .                  slash_exit_prompt 	= 3 + 1,
+     .                  slash_exit_program 	= 4 + 1,
+     .                  slash_exit_cycle 	= 5 + 1,
+     .                  slash_exit_topython	= 6 + 1)
+
+	INTEGER		slash_xlimits, slash_ylimits, slash_title,
+     .			slash_pen, slash_hlimits, slash_vlimits,
+     .			slash_color
+	PARAMETER     ( slash_xlimits = 1 + 24,
+     .			slash_ylimits = 1 + 25,
+     .			slash_title   = 1 + 26,
+     .			slash_color   = 1 + 27,
+     .			slash_pen     = 1 + 33,
+     .			slash_hlimits = 1 + 34,
+     .			slash_vlimits = 1 + 35,
+     .			slash_is_logh = 1 + 36,
+     .			slash_is_logv = 1 + 37 )
+
+        INTEGER		slash_polygon_coord,
+     .			slash_polygon_line,
+     .			slash_polygon_fill,
+     .	                slash_polygon_key,
+     .			slash_polygon_nokey,
+     .			slash_polygon_color,
+     .			slash_polygon_thick,
+     .			slash_polygon_axes,
+     .			slash_polygon_hgrat,
+     .			slash_polygon_vgrat,
+     .			slash_polygon_grat,
+     .			slash_polygon_mod,
+     .                  slash_polygon_opacity
+
+	PARAMETER     ( slash_polygon_coord = 1 + 17,
+     .			slash_polygon_line  = 1 + 21,
+     .			slash_polygon_color = 1 + 22,
+     .			slash_polygon_thick = 1 + 27,
+     .                  slash_polygon_fill  = 1 + 30,
+     .			slash_polygon_key   = 1 + 31,
+     .			slash_polygon_nokey = 1 + 32,
+     .			slash_polygon_axes  = 1 + 33,
+     .			slash_polygon_hgrat  = 1 + 38,
+     .			slash_polygon_vgrat  = 1 + 39,
+     .			slash_polygon_grat   = 1 + 40,
+     .			slash_polygon_mod    = 1 + 41,
+     .                  slash_polygon_opacity = 1 + 42 )
+
diff --git a/fer/common/vax_machine.parm b/fer/common/vax_machine.parm
new file mode 100644
index 0000000..b8410d4
--- /dev/null
+++ b/fer/common/vax_machine.parm
@@ -0,0 +1,11 @@
+* VAX_MACHINE.PARM
+
+* parameters relevant to VAX numerical representations
+
+	INTEGER	int4_max
+	REAL	real4_epsilon
+	REAL*8  r8_int4_max
+
+	PARAMETER     (	int4_max	= 2147483647,	! = 2**31 - 1
+     .		        r8_int4_max	= 2147483647.D0,
+     .			real4_epsilon	= 2.**(-24)	)
diff --git a/fer/common/xactivity.cmn b/fer/common/xactivity.cmn
new file mode 100644
index 0000000..723cdc7
--- /dev/null
+++ b/fer/common/xactivity.cmn
@@ -0,0 +1,26 @@
+* XACTIVITY.CMN
+* COMMON declarations regarding current activity of program
+
+	PARAMETER     ( max_activity_stack = 10 )
+
+	INTEGER	      ( activity_unknown,
+     .			activity_initializing,
+     .			activity_waiting,
+     .			activity_thinking,
+     .			activity_reading,
+     .			activity_plotting,
+     .			activity_writing )
+
+	PARAMETER     ( activity_unknown	= 0,
+     .			activity_initializing	= 1,
+     .			activity_waiting	= 2,
+     .			activity_thinking	= 3,
+     .			activity_reading	= 4,
+     .			activity_plotting	= 5,
+     .			activity_writing	= 6 )
+  
+	INTEGER
+     .		activity_stack, activity_stack_level
+
+	COMMON / XACTIVITY /
+     .		activity_stack( max_activity_stack ), activity_stack_level
diff --git a/fer/common/xalgebra.cmn b/fer/common/xalgebra.cmn
new file mode 100644
index 0000000..86bac65
--- /dev/null
+++ b/fer/common/xalgebra.cmn
@@ -0,0 +1,110 @@
+* XALGEBRA.CMN - common declaration of algebraic operators and functions
+* Unix/RISC port - 1/91 - variables reordered to lie on word boundaries
+* increased number of regrid transforms and length of transform names
+
+* V430: added trans_4d
+* V450: added descriptions of functions
+* V510: *sh* reordered elements to avoid "padding before alg_4d_trans"
+* V554 1/04 *acm* - add counter variables for named REPEAT/RANGE control
+* V554 3/04 *acm* - reorder items in the common block to avoid warning msg when compiling
+* V600 2/06 *acm* - reorder items again, to avoid warning msg when compiling
+* V600 2/06 *kob* - declare alg_pvar_head as double, for 64-bit build
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*      2/12  *kms* Increased num_pseudo_vars from 20 to 30:
+*                  M, N, E, F, EBOX, FBOX, EBOXLO, FBOXLO, EBOXHI, FBOXHI
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+*      4/12  *acm* Increased num_pseudo_vars from 30 to 40
+*                  dont need MODE FOURDEE, use _E, _F, _M, _N.
+* V690 12/13 *sh* added auxiliary regridding transformations and updated
+*		  transformation descriptions
+
+	INTEGER		num_operators ,num_functions, num_pseudo_vars,
+     .			num_4d_pseudo_vars, num_log_structs, num_punctuations,
+     .			num_transforms,  max_4d_trans, max_fcn_args,
+     .                  num_counter_vars, cvar_text_len
+	PARAMETER     (	num_operators   = 18,
+     .			num_functions   = 25,
+     .			num_pseudo_vars = 40,
+     .			num_4d_pseudo_vars = 28,
+     .			num_log_structs = 3,
+     .			num_punctuations = 3,
+     .			num_transforms	= 60,
+     .			max_4d_trans    = 10,
+     .			max_fcn_args    = 75,
+     .                  num_counter_vars = 60,
+     .                  cvar_text_len    = 128)
+
+	INTEGER		offset_operators, offset_functions, offset_logic_struc
+	PARAMETER     (	offset_operators   = 0,
+     .			offset_functions   = num_operators,
+     .			offset_logic_struc = num_operators + num_functions )
+
+	COMMON / XALGEBRA /
+     .				alg_pvar_head,
+     .				alg_pvar_padding,
+     .				countervar_name_head,
+     .				countervar_name_padding,
+     .				alg_trans_dflt_arg,
+     .				alg_num_fcn_args,
+     .				alg_fcn_arg_ptr,
+     .				alg_trans_num, 
+     .				alg_4d_trans,
+     .				alg_1d_to_4d,
+     .				num_4d_trans,
+     .				csp_cvar,
+     .				alg_trans_its_int,
+     .				alg_trans_has_arg,
+     .				alg_regrid_vizb,	 
+     .				alg_op,
+     .				alg_fcn,	 
+     .				alg_fcn_descr,
+     .				alg_punct,
+     .				alg_struct,
+     .				alg_vstruct,
+     .				alg_pvar,
+     .				alg_cvar,
+     .				countervar_name,
+     .				alg_trans_text,	 
+     .				alg_trans_title,
+     .				alg_regrid_code,
+     .				alg_regrid_title,
+     .				alg_arg_name,
+     .				alg_arg_units,
+     .				alg_arg_descr
+
+        REAL*8          alg_pvar_head,
+     .                  alg_pvar_padding,
+     .                  countervar_name_head,
+     .                  countervar_name_padding
+	REAL		alg_trans_dflt_arg( num_transforms )
+        INTEGER		alg_num_fcn_args ( num_functions ),
+     .			alg_fcn_arg_ptr  ( num_functions )
+	INTEGER		alg_trans_num	 ( num_transforms )
+	INTEGER		alg_4d_trans	 ( max_4d_trans ),
+     .			alg_1d_to_4d	 ( max_4d_trans ),
+     .			num_4d_trans
+        INTEGER         csp_cvar         ( num_counter_vars )
+	LOGICAL		alg_trans_its_int( num_transforms ),
+     .			alg_trans_has_arg( num_transforms ),
+     .			alg_regrid_vizb  ( max_auxregrid_trans )
+
+	CHARACTER*4	alg_op           ( num_operators )
+	CHARACTER*8	alg_fcn	         ( num_functions )
+	CHARACTER*80	alg_fcn_descr    ( num_functions )
+	CHARACTER*1	alg_punct	 ( num_punctuations )
+	CHARACTER*8	alg_struct	 ( num_log_structs )
+	CHARACTER*8	alg_vstruct	 ( num_log_structs )
+	CHARACTER*8	alg_pvar         ( num_pseudo_vars )
+	CHARACTER*128	alg_cvar         ( num_counter_vars )
+        CHARACTER*128   countervar_name  ( num_counter_vars )
+	CHARACTER*3	alg_trans_text	 ( num_transforms )
+	CHARACTER*20	alg_trans_title	 ( num_transforms )
+	CHARACTER*6	alg_regrid_code	 ( max_auxregrid_trans )
+	CHARACTER*20	alg_regrid_title ( max_auxregrid_trans )
+
+	CHARACTER	alg_arg_name	 ( max_fcn_args )*80,
+     .			alg_arg_units	 ( max_fcn_args )*24,
+     .			alg_arg_descr	 ( max_fcn_args )*64
+
+
diff --git a/fer/common/xax_speed.cmn b/fer/common/xax_speed.cmn
new file mode 100644
index 0000000..ec80045
--- /dev/null
+++ b/fer/common/xax_speed.cmn
@@ -0,0 +1,8 @@
+! temp - until incorporated into TMAP library
+* XAX_SPEED.CMN
+* contains information about the relative access speeds of each axis
+*   2/12 *kms* Added E and F dimensions (set to nferdims)
+
+	INTEGER	    ds_ax_speed( nferdims, maxdsets )
+
+	COMMON /XAX_SPEED / ds_ax_speed
diff --git a/fer/common/xbox_bounds.cmn b/fer/common/xbox_bounds.cmn
new file mode 100644
index 0000000..c7c24a5
--- /dev/null
+++ b/fer/common/xbox_bounds.cmn
@@ -0,0 +1,4 @@
+* COMMON XBOX_BOUNDS - axis pointers used by SHADE within PLOT+
+
+	INTEGER bb_xaxis, bb_yaxis, bb_grid, bb_grid_inccount
+	COMMON/ XBOX_BOUNDS / bb_xaxis, bb_yaxis, bb_grid, bb_grid_inccount
diff --git a/fer/common/xcalc_vars.cmn b/fer/common/xcalc_vars.cmn
new file mode 100644
index 0000000..63e2ec7
--- /dev/null
+++ b/fer/common/xcalc_vars.cmn
@@ -0,0 +1,85 @@
+* XCALC_VARS.CMN - COMMON/ XCALC_VARS /
+* array declarations and information for "calculatable" variables 
+* ... variables derivable from Philander/COX model results
+* V200:  7/89 - extracted from xvariables
+*  2/12 *kms* Add E and F dimensions to cv_lo_ds and cv_hi_ds
+*             (set to nferdims), added cv_lo_d5 & 6, cv_hi_d5 & 6
+
+*	
+*	cvar_frame_start
+*		      - subscript pointer into "cv..." arrays to the frame
+*			(list) of variable cvances needed to compute this var
+*	cvar_frame_length
+*		      -	Number of variable cvances needed to cumpute this var
+
+	INTEGER		max_calc_vars,
+     .			max_cv
+	PARAMETER     (	max_calc_vars 	  = 65,
+     .			max_cv          = 200 )
+
+********************************************************************************
+******				COMMON DECLARATION			  ******
+
+	COMMON / XCALC_VARS /
+     .		num_calc_vars,
+     .
+     .		cvar_primary_name ( max_calc_vars ),
+     .		cvar_name_code    ( max_calc_vars ),
+     .		cvar_unit_code    ( max_calc_vars ),
+     .		cvar_grid	  ( max_calc_vars, max_gfdl_dsets ),
+     .		cvar_axes	  ( 3, max_calc_vars ),
+     .		cvar_frame_start  ( max_calc_vars ),
+     .		cvar_frame_length ( max_calc_vars ),
+     .		cvar_num_results  ( max_calc_vars ),
+     .
+     .		cv_category ( max_cv ),
+     .		cv_variable ( max_cv ),
+     .		cv_lo_ds    ( max_cv, nferdims ),
+     .		cv_hi_ds    ( max_cv, nferdims )
+
+********************************************************************************
+******			COMMON VARIABLE TYPE DECLARATIONS		  ******
+
+	INTEGER		num_calc_vars
+
+	INTEGER		cvar_num_results  ,
+     .			cvar_grid	  ,
+     .			cvar_axes	  ,
+     .			cvar_frame_start  ,
+     .			cvar_frame_length ,
+     .			cvar_unit_code
+	CHARACTER*40	cvar_primary_name
+	CHARACTER*4	cvar_name_code
+
+	INTEGER		cv_category ,
+     .			cv_variable ,
+     .			cv_grid ,
+     .			cv_lo_ds  ,
+     .			cv_hi_ds
+
+* equivalences to assist with declaration statements
+	INTEGER cv_lo_d1( max_cv ),
+     .		cv_lo_d2( max_cv ),
+     .		cv_lo_d3( max_cv ),
+     .		cv_lo_d4( max_cv ),
+     .		cv_lo_d5( max_cv ),
+     .		cv_lo_d6( max_cv ),
+     .		cv_hi_d1( max_cv ),
+     .		cv_hi_d2( max_cv ),
+     .		cv_hi_d3( max_cv ),
+     .		cv_hi_d4( max_cv ),
+     .		cv_hi_d5( max_cv ),
+     .		cv_hi_d6( max_cv )
+	EQUIVALENCE
+     .		( cv_lo_d1, cv_lo_ds(1,1) ),
+     .		( cv_lo_d2, cv_lo_ds(1,2) ),
+     .		( cv_lo_d3, cv_lo_ds(1,3) ),
+     .		( cv_lo_d4, cv_lo_ds(1,4) ),
+     .		( cv_lo_d5, cv_lo_ds(1,5) ),
+     .		( cv_lo_d6, cv_lo_ds(1,6) ),
+     .		( cv_hi_d1, cv_hi_ds(1,1) ),
+     .		( cv_hi_d2, cv_hi_ds(1,2) ),
+     .		( cv_hi_d3, cv_hi_ds(1,3) ),
+     .		( cv_hi_d4, cv_hi_ds(1,4) ),
+     .		( cv_hi_d5, cv_hi_ds(1,5) ),
+     .		( cv_hi_d6, cv_hi_ds(1,6) )
diff --git a/fer/common/xcommand.cmn b/fer/common/xcommand.cmn
new file mode 100644
index 0000000..8fb710b
--- /dev/null
+++ b/fer/common/xcommand.cmn
@@ -0,0 +1,463 @@
+* XCOMMAND.CMN
+* COMMON declaration for command,subcommand and qualifier names
+* 4/23/96 - increased total_num_alias from 30 to 150
+*	  - increased number of commands by 6 (adding IF, ELSE, ELIF, ENDIF)
+*			and room for growth
+* 8.98    - increased possible qualifiers for CONTOUR and SHADE *jd*
+* 12.98   - increased num_predefined_alias -> 14 for alias "pattern" *jd*
+* 2/99 *sh* - added POLYGON command
+* 3/99 *jd* - increase qualifiers for POLYGON to 30   
+* 3/99 *jc* - increased possible qualifiers for SHOW FUNCTION
+* 4/99 *sh* increased num_predefined_alias for PAUSE alias
+*      *sh* incresed qualifiers for DEFINE AXIS and SHOW AXIS
+* 6/99 *sh* increased num_predefined_alias for WHERE alias
+* V510 5/99 *sh* - increased number of quals for all graphics commands,
+*		for SHOW FUNC
+* V530 1/01 *kob*- increased number of quals for repeat command
+* V540: 10/01 *sh* - added alias COLUMNS for SET DATA/FORMAT=Delimited
+*       10/01*acm*- increased number of qualifiers for CONTOUR  (/AXES=)
+*       10/01 *kob* - increase number of qualifiers for EXIT (LOOP/SCRIPT, etc)
+* V553   9/03 *acm* - increased number of qualifiers for SHOW AXIS
+* V554   1/04 *acm* - increased number of quals for REPEAT command
+* V570   5/04 *acm* - increased number of qualifiers for LIST command 
+*                     for SAVE/BOUNDS, SAVE/EDGES
+*       *acm* 6/04 - add SET AXIS/CALENDAR /T0 /UNITS
+*       *acm* 6/04 - add CANCEL AXIS/DEPTH
+* V581  *acm* 5/05 *kob* - increase number of qualifiers for EXIT (adding /CYCLE)
+* V600:  3/07 *acm* - fixing bug 439&1390. Add logical variable its_action_command 
+* V600  *acm* 5/05 - add SHOW ATTRIBUTE
+*       *acm* 8/05 - add DEFINE ATTRIBUTE
+*       *acm* 9/05 - add SET ATTRIBUTE
+*       *acm* 7/06 -     CANCEL ATTRIBUTE /OUTPUT /DATA
+* V606  *acm* 7/06 -     DEFINE AXIS/QUIET
+* v62   *acm* 5/09 - new alias KEYMARK
+* v6.6  *acm* 1/10 - more qualifiers on LIST for netcdf4 control
+* V6.5  *acm* 3/10 new qualifiers on (some) SHOW commands and on MESSAGE: 
+*                  /OUTFILE= /APPEND /CLOBBER
+* V6.6 *kms*  5/10 add SET REDIRECT and CANCEL REDIRECT for stdout/stderr redirection
+*      *kms*  7/10 add OPEN alias for SET DATA /BROWSE
+* V664 *kms*  8/10 Add DEFINE PYFUNC /NAME=<alias> python.module.name
+* V6.8 *acm*  1/12 Add SET DATA/STRICT 
+* PyFr *kms*  3/11 Add CANCEL PYVAR /ALL /DATASET
+* PyFr *kms*  1/12 Add SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL
+* V68  *acm*  5/12 Add DEFINE DATA/AGGREGATE/TITLE/QUIET
+* V683 *acm*  8/12 New SET LIST/OUTTYPE CANCEL LIST/OUTTYPE, and SAVE/OUTTYPE 
+* V684 *acm* 12/12 Changes for VECTOR/MODULO on curvilinear plots.
+* PyFr *kms*  1/13 Remove SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL;
+* V685 *acm*  4/13 Add /HIDDEN on DEF DATA/AGG
+*                  Add /QUALITY= /AAlias /NoAAlias /ENGINE= to SET WINDOW
+* PyFr *kms*  7/13 Add /THICKEN to SET WINDOW to specify line thickness scaling factor
+* PyFr *kms*  7/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to SET WINDOW and FRAME
+* V685+ *sh*  9/13 Add SHOW VARIABLE/TREE and alias VTREE
+
+* PARAMETERS are used to store numbers of subcommands and qualifiers for use
+* in BLOCK DATA XCOMMAND_DATA.  They are also used to compute pointers into
+* arrays SUBCOMMANDS and QUALIFIERS.  This is done so that new commands,
+* subcommands and qualifiers may be added without manually recomputing the
+* pointer values.
+
+* parameter naming:
+*	nsubN		- number of subcommands of command N (always > 0 since
+*			  "    " is always regarded as a subcommand
+*	nqualNx		- number of qualifiers for command N, subcommand x
+*			  all qualifiers are "global" rather than "positional"
+*	nsub_atN	- pointer into array SUBCOMMANDS to first subcommand of
+*			  command N
+*	nqual_atNx	- pointer into array QUALIFIERS to first qualifier 
+*			  of command N, subcommand x. 
+
+* adding new commands,subcommands and qualifiers:
+* commands    - To add a command simply define the parameters for the new
+*		command at the end of the existing commands and update the 
+*		"summary PARAMETERS".  Then make corresponding additions to 
+*		BLOCK DATA XCOMMAND_DATA.
+* subcommands -	To add new subcommands simply change nsubN and insert additional
+*		lines of nqualNx = ... defining the numbers of qualifiers.  Be
+*		sure that nqual_atN+1a is updated.  Then make the corresponding
+*		additions to BLOCK DATA XCOMMAND_DATA.
+* qualifiers  -	To add new qualifiers simply update nqualNx and make the
+*		corresponding changes in BLOCK DATA XCOMMAND_DATA.
+
+
+* pointers to first elements of arrays
+	INTEGER		 nsub_at1  , nqual_at1a
+	PARAMETER	(nsub_at1=1, nqual_at1a=1)
+
+* SET		 - commmand # 1
+	INTEGER		nsub1      , nsub_at2  ,
+     .			nqual1a    , nqual_at1b,
+     .			nqual1b    , nqual_at1c,
+     .			nqual1c    , nqual_at1d,
+     .			nqual1d    , nqual_at1e,
+     .			nqual1e    , nqual_at1f,
+     .			nqual1f    , nqual_at1g,
+     .			nqual1g    , nqual_at1h,
+     .			nqual1h    , nqual_at1i,
+     .			nqual1i    , nqual_at1j,
+     .			nqual1j    , nqual_at1k,
+     .			nqual1k    , nqual_at1l,
+     .			nqual1l    , nqual_at1m,
+     .			nqual1m    , nqual_at1n,
+     .			nqual1n    , nqual_at1o,
+     .			nqual1o    , nqual_at1p,
+     .			nqual1p    , nqual_at1q,
+     .			nqual1q    , nqual_at1r,
+     .			nqual1r    , nqual_at1s,
+     .			nqual1s    , nqual_at1t,
+     .			nqual1t    , nqual_at2a
+	PARAMETER    (	nsub1   =20, nsub_at2   = nsub_at1   + nsub1,
+     .			nqual1a = 0, nqual_at1b = nqual_at1a + nqual1a,	!'    '
+     .			nqual1b =20, nqual_at1c = nqual_at1b + nqual1b,	!'WIND'
+     .			nqual1c =27, nqual_at1d = nqual_at1c + nqual1c,	!'REGI'
+     .			nqual1d = 1, nqual_at1e = nqual_at1d + nqual1d,	!'VIEW'
+     .			nqual1e = 0, nqual_at1f = nqual_at1e + nqual1e,	!'EXPR'
+     .			nqual1f =16, nqual_at1g = nqual_at1f + nqual1f,	!'LIST'
+     .			nqual1g =20, nqual_at1h = nqual_at1g + nqual1g,	!'DATA'
+     .			nqual1h = 1, nqual_at1i = nqual_at1h + nqual1h,	!'MODE'
+     .			nqual1i = 5, nqual_at1j = nqual_at1i + nqual1i,	!'MOVI'
+     .			nqual1j =13, nqual_at1k = nqual_at1j + nqual1j,	!'VARI'
+     .			nqual1k = 2, nqual_at1l = nqual_at1k + nqual1k,	!'GRID'
+     .			nqual1l =10, nqual_at1m = nqual_at1l + nqual1l,	!'AXIS'
+     .			nqual1m = 2, nqual_at1n = nqual_at1m + nqual1m,	!'MEMO'
+     .			nqual1n = 8, nqual_at1o = nqual_at1n + nqual1n,	!'ATTR'
+     .			nqual1o = 3, nqual_at1p = nqual_at1o + nqual1o,	!'NCCACHE'
+     .			nqual1p = 8, nqual_at1q = nqual_at1p + nqual1p,	!'REDIRECT'
+     .			nqual1q = 0, nqual_at1r = nqual_at1q + nqual1q,	!'GIFFILE'
+     .			nqual1r = 4, nqual_at1s = nqual_at1r + nqual1r,	!'****'
+     .			nqual1s = 4, nqual_at1t = nqual_at1s + nqual1s,	!'****'
+     .			nqual1t = 4, nqual_at2a = nqual_at1t + nqual1t	!'****'
+     .		      )
+
+ 
+* SHOW		 - commmand # 2
+	INTEGER		nsub2      , nsub_at3  ,
+     .			nqual2a    , nqual_at2b,
+     .			nqual2b    , nqual_at2c,
+     .			nqual2c    , nqual_at2d,
+     .			nqual2d    , nqual_at2e,
+     .			nqual2e    , nqual_at2f,
+     .			nqual2f    , nqual_at2g,
+     .			nqual2g    , nqual_at2h,
+     .			nqual2h    , nqual_at2i,
+     .			nqual2i    , nqual_at2j,
+     .			nqual2j    , nqual_at2k,
+     .			nqual2k    , nqual_at2l,
+     .			nqual2l    , nqual_at2m,
+     .			nqual2m    , nqual_at2n,
+     .			nqual2n    , nqual_at2o,
+     .			nqual2o    , nqual_at2p,
+     .			nqual2p    , nqual_at2q,
+     .			nqual2q    , nqual_at2r,
+     .			nqual2r    , nqual_at2s,
+     .			nqual2s    , nqual_at2t,
+     .			nqual2t    , nqual_at2u,
+     .			nqual2u    , nqual_at2v,
+     .			nqual2v    , nqual_at3a
+	PARAMETER    (	nsub2   =22, nsub_at3   = nsub_at2   + nsub2,
+     .			nqual2a = 1, nqual_at2b = nqual_at2a + nqual2a,	!'    '
+     .			nqual2b = 1, nqual_at2c = nqual_at2b + nqual2b,	!'WIND'
+     .			nqual2c = 1, nqual_at2d = nqual_at2c + nqual2c,	!'REGI'
+     .			nqual2d =20, nqual_at2e = nqual_at2d + nqual2d,	!'AXIS'
+     .			nqual2e = 1, nqual_at2f = nqual_at2e + nqual2e,	!'EXPR'
+     .			nqual2f = 1, nqual_at2g = nqual_at2f + nqual2f,	!'LIST'
+     .			nqual2g =15, nqual_at2h = nqual_at2g + nqual2g,	!'DATA'
+     .			nqual2h = 1, nqual_at2i = nqual_at2h + nqual2h,	!'MODE'
+     .			nqual2i = 1, nqual_at2j = nqual_at2i + nqual2i,	!'MOVI'
+     .			nqual2j =13, nqual_at2k = nqual_at2j + nqual2j,	!'VARI'
+     .			nqual2k = 1, nqual_at2l = nqual_at2k + nqual2k,	!'COMM'
+     .			nqual2l = 5, nqual_at2m = nqual_at2l + nqual2l,	!'MEMO'
+     .			nqual2m =20, nqual_at2n = nqual_at2m + nqual2m,	!'GRID'
+     .			nqual2n = 3, nqual_at2o = nqual_at2n + nqual2n,	!'VIEW'
+     .			nqual2o = 1, nqual_at2p = nqual_at2o + nqual2o,	!'TRAN'
+     .			nqual2p = 1, nqual_at2q = nqual_at2p + nqual2p,	!'ALIA'
+     .			nqual2q = 1, nqual_at2r = nqual_at2q + nqual2q,	!'SYMB'
+     .			nqual2r = 3, nqual_at2s = nqual_at2r + nqual2r,	!'ATTR'
+     .			nqual2s = 1, nqual_at2t = nqual_at2s + nqual2s,	!'NCCACHE'
+     .			nqual2t = 1, nqual_at2u = nqual_at2t + nqual2t,	!'GIFFILE'
+     .			nqual2u = 7, nqual_at2v = nqual_at2u + nqual2u,	!'FUNC'
+     .			nqual2v = 3, nqual_at3a = nqual_at2v + nqual2v	!'QUER'
+     .		      )
+
+* CANCEL 	 - commmand # 3
+	INTEGER		nsub3      , nsub_at4  ,
+     .			nqual3a    , nqual_at3b,
+     .			nqual3b    , nqual_at3c,
+     .			nqual3c    , nqual_at3d,
+     .			nqual3d    , nqual_at3e,
+     .			nqual3e    , nqual_at3f,
+     .			nqual3f    , nqual_at3g,
+     .			nqual3g    , nqual_at3h,
+     .			nqual3h    , nqual_at3i,
+     .			nqual3i    , nqual_at3j,
+     .			nqual3j    , nqual_at3k,
+     .			nqual3k    , nqual_at3l,
+     .			nqual3l    , nqual_at3m,
+     .			nqual3m    , nqual_at3n,
+     .			nqual3n    , nqual_at3o,
+     .			nqual3o    , nqual_at3p,
+     .			nqual3p    , nqual_at3q,
+     .			nqual3q    , nqual_at3r,
+     .			nqual3r    , nqual_at3s,
+     .			nqual3s    , nqual_at3t,
+     .			nqual3t    , nqual_at4a
+	PARAMETER    (	nsub3   =20, nsub_at4   = nsub_at3   + nsub3,
+     .			nqual3a = 0, nqual_at3b = nqual_at3a + nqual3a,	!'    '
+     .			nqual3b = 1, nqual_at3c = nqual_at3b + nqual3b,	!'WIND'
+     .			nqual3c =13, nqual_at3d = nqual_at3c + nqual3c,	!'REGI'
+     .			nqual3d = 3, nqual_at3e = nqual_at3d + nqual3d,	!'MEMO'
+     .			nqual3e = 1, nqual_at3f = nqual_at3e + nqual3e,	!'EXPR'
+     .			nqual3f = 7, nqual_at3g = nqual_at3f + nqual3f,	!'LIST'
+     .			nqual3g = 2, nqual_at3h = nqual_at3g + nqual3g,	!'DATA'
+     .			nqual3h = 1, nqual_at3i = nqual_at3h + nqual3h,	!'MODE'
+     .			nqual3i = 1, nqual_at3j = nqual_at3i + nqual3i,	!'MOVI'
+     .			nqual3j = 1, nqual_at3k = nqual_at3j + nqual3j,	!'VIEW'
+     .			nqual3k = 6, nqual_at3l = nqual_at3k + nqual3k,	!'VARI'
+     .			nqual3l = 6, nqual_at3m = nqual_at3l + nqual3l,	!'AXIS'
+     .			nqual3m = 1, nqual_at3n = nqual_at3m + nqual3m,	!'GRID'
+     .			nqual3n = 2, nqual_at3o = nqual_at3n + nqual3n,	!'ATTR'
+     .			nqual3o = 1, nqual_at3p = nqual_at3o + nqual3o,	!'REDIRECT'
+     .			nqual3p = 1, nqual_at3q = nqual_at3p + nqual3p,	!'ALIAS'
+     .			nqual3q = 1, nqual_at3r = nqual_at3q + nqual3q,	!'SYMBOL'
+     .			nqual3r = 1, nqual_at3s = nqual_at3r + nqual3r,	!'NCCACHE'
+     .			nqual3s = 3, nqual_at3t = nqual_at3s + nqual3s,	!'PYVAR'
+     .			nqual3t = 3, nqual_at4a = nqual_at3t + nqual3t	!'****'
+     .		      )
+
+* CONTOUR	 - commmand # 4
+	INTEGER		nsub4      , nsub_at5 ,
+     .			nqual4a    ,nqual_at5a
+	PARAMETER    (	nsub4   = 1, nsub_at5   = nsub_at4   + nsub4,
+     .			nqual4a = 45,nqual_at5a = nqual_at4a + nqual4a  )
+
+* LIST		 - commmand # 5
+	INTEGER		nsub5      , nsub_at6  ,
+     .			nqual5a    , nqual_at6a
+	PARAMETER    (	nsub5   = 1, nsub_at6   = nsub_at5   + nsub5,
+     .			nqual5a =60, nqual_at6a = nqual_at5a + nqual5a  )
+
+* PLOT	 	- commmand # 6
+	INTEGER		nsub6      , nsub_at7  ,
+     .			nqual6a    , nqual_at7a
+	PARAMETER    (	nsub6   = 1, nsub_at7   = nsub_at6   + nsub6,
+     .			nqual6a =48, nqual_at7a = nqual_at6a + nqual6a  )
+
+* GO		 - commmand # 7
+	INTEGER		nsub7      , nsub_at8   ,
+     .			nqual7a    , nqual_at8a
+	PARAMETER    (	nsub7   = 1, nsub_at8   = nsub_at7   + nsub7,
+     .			nqual7a = 9, nqual_at8a = nqual_at7a + nqual7a  )
+
+* HELP		 - commmand # 8
+	INTEGER		nsub8      , nsub_at9  ,
+     .			nqual8a    , nqual_at9a
+	PARAMETER    (	nsub8   = 1, nsub_at9   = nsub_at8   + nsub8,
+     .			nqual8a = 0, nqual_at9a = nqual_at8a + nqual8a  )
+
+* LOAD		 - commmand # 9
+	INTEGER		nsub9      , nsub_at10  ,
+     .			nqual9a    , nqual_at10a
+	PARAMETER    (	nsub9   = 1, nsub_at10   = nsub_at9   + nsub9,
+     .			nqual9a =16, nqual_at10a = nqual_at9a + nqual9a  )
+
+* DEFINE	 - commmand # 10
+	INTEGER		nsub10      , nsub_at11  ,
+     .			nqual10a    , nqual_at10b,
+     .			nqual10b    , nqual_at10c,
+     .			nqual10c    , nqual_at10d,
+     .			nqual10d    , nqual_at10e,
+     .			nqual10e    , nqual_at10f,
+     .			nqual10f    , nqual_at10g,
+     .			nqual10g    , nqual_at10h,
+     .			nqual10h    , nqual_at10i,
+     .			nqual10i    , nqual_at10j,
+     .			nqual10j    , nqual_at10k,
+     .			nqual10k    , nqual_at11a
+	PARAMETER    (	nsub10   =11, nsub_at11   = nsub_at10   + nsub10,
+     .			nqual10a = 0, nqual_at10b = nqual_at10a + nqual10a,!'  '
+     .			nqual10b =26, nqual_at10c = nqual_at10b + nqual10b,!REGI
+     .			nqual10c =11, nqual_at10d = nqual_at10c + nqual10c,!GRID
+     .			nqual10d = 6, nqual_at10e = nqual_at10d + nqual10d,!VARI
+     .			nqual10e =20, nqual_at10f = nqual_at10e + nqual10e,!AXIS
+     .			nqual10f = 8, nqual_at10g = nqual_at10f + nqual10f,!VIEW
+     .			nqual10g = 2, nqual_at10h = nqual_at10g + nqual10g,!ALIAS
+     .			nqual10h = 2, nqual_at10i = nqual_at10h + nqual10h,!SYMB
+     .			nqual10i = 4, nqual_at10j = nqual_at10i + nqual10i,!ATTR
+     .			nqual10j = 2, nqual_at10k = nqual_at10j + nqual10j,!PYFUNC
+     .			nqual10k =10, nqual_at11a = nqual_at10k + nqual10k !DATA
+     .		      )
+* EXIT		 - commmand # 11
+	INTEGER		nsub11      , nsub_at12  ,
+     .			nqual11a    , nqual_at12a
+	PARAMETER    (	nsub11   = 1, nsub_at12   = nsub_at11   + nsub11,
+     .			nqual11a = 8, nqual_at12a = nqual_at11a + nqual11a  )
+
+* MESSAGE	 - commmand # 12
+	INTEGER		nsub12      , nsub_at13  ,
+     .			nqual12a    , nqual_at13a
+	PARAMETER    (	nsub12   = 1, nsub_at13   = nsub_at12   + nsub12,
+     .			nqual12a = 7, nqual_at13a = nqual_at12a + nqual12a  )
+
+* VECTOR		 - commmand # 13
+	INTEGER		nsub13       , nsub_at14 ,
+     .			nqual13a     ,nqual_at14a
+	PARAMETER    (	nsub13   = 1, nsub_at14    = nsub_at13   + nsub13,
+     .			nqual13a = 45,nqual_at14a  = nqual_at13a + nqual13a  )
+
+* PPLUS		 - commmand # 14
+	INTEGER		nsub14      , nsub_at15 ,
+     .			nqual14a    , nqual_at15a
+	PARAMETER    (	nsub14   = 1, nsub_at15   = nsub_at14   + nsub14,
+     .			nqual14a = 2, nqual_at15a = nqual_at14a + nqual14a  )
+
+* FRAME		 - commmand # 15
+	INTEGER		nsub15      , nsub_at16 ,
+     .			nqual15a    , nqual_at16a
+	PARAMETER    (	nsub15   = 1, nsub_at16   = nsub_at15   + nsub15,
+     .			nqual15a = 8, nqual_at16a = nqual_at15a + nqual15a  )
+
+* REPEAT		 - commmand # 16
+	INTEGER		nsub16       , nsub_at17 ,
+     .			nqual16a     ,nqual_at17a
+	PARAMETER    (	nsub16   = 1, nsub_at17    = nsub_at16   + nsub16,
+     .			nqual16a =17,nqual_at17a  = nqual_at16a + nqual16a  )
+
+* STATISTICS		 - commmand # 17
+	INTEGER		nsub17       , nsub_at18 ,
+     .			nqual17a     ,nqual_at18a
+	PARAMETER    (	nsub17   = 1, nsub_at18    = nsub_at17   + nsub17,
+     .			nqual17a = 16,nqual_at18a  = nqual_at17a + nqual17a  )
+
+* SHADE			 - commmand # 18
+	INTEGER		nsub18       , nsub_at19 ,
+     .			nqual18a     ,nqual_at19a
+	PARAMETER    (	nsub18   = 1, nsub_at19    = nsub_at18   + nsub18,
+     .			nqual18a = 38,nqual_at19a  = nqual_at18a + nqual18a  )
+
+* SPAWN			 - commmand # 19
+	INTEGER		nsub19       , nsub_at20 ,
+     .			nqual19a     ,nqual_at20a
+	PARAMETER    (	nsub19   = 1, nsub_at20    = nsub_at19   + nsub19,
+     .			nqual19a = 0,nqual_at20a  = nqual_at19a + nqual19a  )
+
+* USER/OPT1/OPT2/COMMAND/I/J/...
+	INTEGER		nsub20       , nsub_at21 ,
+     .			nqual20a     ,nqual_at21a
+	PARAMETER    (	nsub20   = 1, nsub_at21    = nsub_at20   + nsub20,
+     .			nqual20a = 14,nqual_at21a  = nqual_at20a + nqual20a  )
+
+* WIRE/I/J/K/L/X/Y/Z/T/D/OVER/SET_/FRAME/VIEW/ZLIM/TITLE
+	INTEGER		nsub21       , nsub_at22 ,
+     .			nqual21a     ,nqual_at22a
+	PARAMETER    (	nsub21   = 1, nsub_at22    = nsub_at21   + nsub21,
+     .			nqual21a = 27,nqual_at22a  = nqual_at21a + nqual21a  )
+
+* QUERY/FILE/****/**** - command number 22
+	INTEGER		nsub22       , nsub_at23 ,
+     .			nqual22a     ,nqual_at23a
+	PARAMETER    (	nsub22   = 1, nsub_at23    = nsub_at22   + nsub22,
+     .			nqual22a = 3,nqual_at23a  = nqual_at22a + nqual22a  )
+
+* IF/****/**** - command number 23
+	INTEGER		nsub23       , nsub_at24 ,
+     .			nqual23a     ,nqual_at24a
+	PARAMETER    (	nsub23   = 1, nsub_at24    = nsub_at23   + nsub23,
+     .			nqual23a = 2,nqual_at24a  = nqual_at23a + nqual23a  )
+
+* ELSE/****/**** - command number 24
+	INTEGER		nsub24       , nsub_at25 ,
+     .			nqual24a     ,nqual_at25a
+	PARAMETER    (	nsub24   = 1, nsub_at25    = nsub_at24   + nsub24,
+     .			nqual24a = 2,nqual_at25a  = nqual_at24a + nqual24a  )
+
+* ELIF/****/**** - command number 25
+	INTEGER		nsub25       , nsub_at26 ,
+     .			nqual25a     ,nqual_at26a
+	PARAMETER    (	nsub25   = 1, nsub_at26    = nsub_at25   + nsub25,
+     .			nqual25a = 2,nqual_at26a  = nqual_at25a + nqual25a  )
+
+* ENDIF/****/**** - command number 26
+	INTEGER		nsub26       , nsub_at27 ,
+     .			nqual26a     ,nqual_at27a
+	PARAMETER    (	nsub26   = 1, nsub_at27    = nsub_at26   + nsub26,
+     .			nqual26a = 2,nqual_at27a  = nqual_at26a + nqual26a  )
+
+* POLYGON	- commmand number 27
+	INTEGER		nsub27       , nsub_at28 ,
+     .			nqual27a     ,nqual_at28a
+	PARAMETER    (	nsub27   = 1, nsub_at28    = nsub_at27   + nsub27,
+     .			nqual27a = 44,nqual_at28a  = nqual_at27a + nqual27a  )
+
+* ****/****/**** - command number 28
+	INTEGER		nsub28       , nsub_at29 ,
+     .			nqual28a     ,nqual_at29a
+	PARAMETER    (	nsub28   = 1, nsub_at29    = nsub_at28   + nsub28,
+     .			nqual28a = 2,nqual_at29a  = nqual_at28a + nqual28a  )
+
+* ****/****/**** - command number 29
+	INTEGER		nsub29       , nsub_at30 ,
+     .			nqual29a     ,nqual_at30a
+	PARAMETER    (	nsub29   = 1, nsub_at30    = nsub_at29   + nsub29,
+     .			nqual29a = 2,nqual_at30a  = nqual_at29a + nqual29a  )
+
+* ****/****/**** - command number 30
+	INTEGER		nsub30       , nsub_at31 ,
+     .			nqual30a     ,nqual_at31a
+	PARAMETER    (	nsub30   = 1, nsub_at31    = nsub_at30   + nsub30,
+     .			nqual30a = 2,nqual_at31a  = nqual_at30a + nqual30a  )
+
+* summary PARAMETERS
+	INTEGER		total_num_commands   ,
+     .			total_num_subcommands,
+     .			total_num_qualifiers,
+     .			total_num_alias,
+     .	                num_predefined_alias,
+     .			max_queries
+	PARAMETER    (	total_num_alias		= 150,  ! was 30 pre 4/96
+     .			total_num_commands	= 30,
+     .			total_num_subcommands	= nsub_at31 - 1,
+     .			total_num_qualifiers	= nqual_at31a - 1,
+     .	                num_predefined_alias    = 23,
+     .			max_queries		= 50 )
+
+* declarations
+	CHARACTER*8	commands    (total_num_commands),
+     .			subcommands (total_num_subcommands),
+     .			qualifiers  (total_num_qualifiers)
+	CHARACTER*8	alias_name  (total_num_alias)
+	CHARACTER*8	queries	    (max_queries)
+	CHARACTER*64	alias	    (total_num_alias)	     
+
+	INTEGER*2	num_subcommands   (total_num_commands),
+     .			subcommand_pointer(total_num_commands),
+     .			num_qualifs       (total_num_subcommands),
+     .			qualifier_pointer (total_num_subcommands),
+     .			alias_len	  (total_num_alias)
+        LOGICAL         its_action_command(total_num_commands)
+	INTEGER		num_queries
+
+	COMMON /XCOMMAND/	commands,
+     .				subcommands,
+     .				qualifiers,
+     .				its_action_command,
+     .				num_subcommands,
+     .				subcommand_pointer,
+     .				num_qualifs,
+     .				qualifier_pointer,
+     .				alias_name,
+     .				alias_len,
+     .				alias,
+     .				queries, num_queries
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fer/common/xcontext.cmn b/fer/common/xcontext.cmn
new file mode 100644
index 0000000..86bf1bb
--- /dev/null
+++ b/fer/common/xcontext.cmn
@@ -0,0 +1,186 @@
+* XCONTEXT.CMN
+* space/time/data_set/variable expression context information
+
+* 1/3/89 - added regridding transformations
+* V200:  5/17/89 - changed to 4D symmetry
+*	12/18/89 - added cx_plot
+* Unix/RISC port 1/91 - variables reordered to accomodate REAL*8 boundaries
+* V420: added cx_impl_grid for implicit grid creation
+* V450: added cx_calendar to enable time < 0
+* V510: *sh* added cx_formatted to record user inputs like X=130E:80W
+*	also moved cx_xtra_doc inside COMMON to Solaris avoid compiler ragging
+* V530:  8/00 *sh* - added cx_type for better string support (and future ...)
+* V550: *acm*10/02- Change cx_name to char*24
+*        2/12 *kms* Add E and F dimensions (set to nferdims),
+*                   added cx_lo_s5 & 6, cx_hi_s5 & 6
+* V685+ 3/13 *sh* added auxiliary regridding variables
+* V685+ 12/13 *acm* For 6D Ferret, cx_xtra_doc should have 2 more elements
+* V690 12/13 *sh* added cx_implicit_aux, cx_aux_given, cx_g_eq_regrid,
+*		 cx_aux_stat for automated curvilinear regridding
+*	         max_context made a variable to allow frames above it
+
+* the declarations below represent a stack of depth max_context for saving
+* the nested contexts.  The bottom few entries in the stack have special uses:
+*	_last	- context left from the last command
+*	_cmnd	- context of command after interpreting command qualifiers
+* the non-positive subscripts are used for storing pre-defined (user defined)
+* contexts
+
+* contexts are nested; the context of the current command is built from
+*	  i)	the default context ( usually left from the last command )
+*	 ii)	the qualifiers included in the current command line
+*	iii)	the qualifiers included with the variable names in expressions
+
+* note:	lists of modifiers to command contexts are also stored temporarily
+*	in the context stack
+
+*	cx_lo_ww	- lower bounds of space/time regions in world coords
+*	cx_lo_ss	- lower bounds of space/time regions in grid subscripts
+*	cx_hi_ww	- upper bounds of space/time regions in world coords
+*	cx_hi_ss	- upper bounds of space/time regions in grid subscripts
+*	cx_delta	- delta increment of space/time regions (in WORLD or
+*		  	  SUBSC according to cx_by_ss )
+*	cx_cal_id	- integer; which calendar used when computing cx_*ss 
+*                         in world coords
+*	cx_by_ss	- logical for how dimension was specified by user
+*	cx_trans	- mathematical transform applied to dimension
+*	cx_given	- logical for whether dimension was just changed
+*	cx_dset_gvn	- logical for whether data set was just changed
+*			( "is a context self-contained with respect to dset ? )
+*
+*	cx_unstand_grid	- (logical) - variable on its defining grid ?
+*	cx_regrid_trans	- regridding transformation for each axis
+*	cx_ovsiz	- flags whether data should be oversized
+*	cx_xtra_doc	- documentation flags (as in XPLOT_SETUP)
+*	cx_formatted	- flags if the latest input used formatted style
+*
+*       cx_naux         - number of auxiliary variables used in regridding
+*       cx_aux_var,cat  - var and cat of auxiliary vars (in parent dset)
+*	cx_valid_aux	- Boolean telling if aux var name was found
+*	cx_aux_arg_start,end - EQUIV. to cx_aux_var,cat. name string pointers
+*	cx_aux_given	- flags whether an aux var was specified
+*	cx_aux_stat	- flags if aux axis has been regridded or remains free 
+
+* The following variables exist only for the most recent "mods_cx"
+*	cx_g_eq_regrid  - flags whether g or gz or delta requested a new axis
+*	cx_grid_needs_dset - flags whether the specified target grid makes
+*		             sense only if the context dset is available
+
+* allocate some protected contexts at the top of the context stack
+	INTEGER		max_cx
+	PARAMETER     ( max_cx = max_noframe_context + 2 )
+
+	REAL*8	cx_lo_ww	 ( nferdims, min_context:max_cx ),
+     .		cx_hi_ww	 ( nferdims, min_context:max_cx ),
+     .		cx_delta	 ( nferdims, max_cx )
+	INTEGER	max_context
+	INTEGER	cx_lo_ss	 ( min_context:max_cx, nferdims ),
+     .		cx_hi_ss	 ( min_context:max_cx, nferdims ),
+     .		cx_trans	 ( nferdims, min_context:max_cx ),
+     .		cx_regrid_trans  ( nferdims, max_cx )
+	INTEGER	cx_stack_ptr,
+     .		cx_data_set ( max_cx ),
+     .		cx_category ( max_cx ),
+     .		cx_variable ( max_cx ),
+     .		cx_grid     ( max_cx ),
+     .		cx_type     ( max_cx ),
+     .		cx_ovsiz    ( max_cx ),
+     .		cx_impl_grid( max_cx ),
+     .		cx_cal_id   ( min_context:max_cx ),
+     .		cx_naux     ( max_cx ),
+     .		cx_aux_var  (nferdims, max_cx),
+     .		cx_aux_cat  (nferdims, max_cx),
+     .		cx_aux_stat (nferdims, max_cx )
+
+	LOGICAL	cx_unstand_grid	( max_cx ),
+     .		cx_by_ss	( nferdims, min_context:max_cx ),
+     .		cx_given	( nferdims, min_context:max_cx ),
+     .		cx_dset_gvn	( max_cx ),
+     .		cx_calendar	( min_context:max_cx ),
+     .		cx_grid_needs_dset,
+     .		cx_aux_given    ( nferdims, max_cx ),
+     .		cx_g_eq_regrid  ( nferdims),
+     .		cx_xtra_doc	( 0:12 ),
+     .		cx_has_impl_grid( max_cx ),
+     .		cx_formatted	( nferdims ),
+     .		cx_valid_aux 	(nferdims, max_cx ),
+     .		cx_implicit_aux ( max_cx )
+
+	REAL	cx_bad_data	( max_cx ),
+     .		cx_trans_arg	( nferdims, min_context:max_cx )
+
+	CHARACTER
+     .		cx_name		( min_context:0 )*24
+
+	COMMON / XCONTEXT /
+     .		cx_lo_ww,
+     .		cx_hi_ww,
+     .		cx_delta,
+     .		cx_bad_data,
+     .		cx_trans_arg,
+     .		cx_xtra_doc,
+     .		cx_lo_ss,
+     .		cx_hi_ss,
+     .		cx_trans,
+     .		cx_regrid_trans,
+     .		cx_stack_ptr,
+     .		cx_data_set,
+     .		cx_category,
+     .		cx_variable,
+     .		cx_naux,
+     .		cx_aux_var,
+     .		cx_aux_cat,
+     .		cx_aux_stat,
+     .		max_context,
+     .		cx_valid_aux,
+     .		cx_implicit_aux,
+     .		cx_grid,
+     .		cx_type,
+     .		cx_ovsiz,
+     .		cx_impl_grid,
+     .          cx_cal_id,
+     .		cx_unstand_grid,
+     .		cx_by_ss,
+     .		cx_given,
+     .		cx_dset_gvn,
+     .		cx_calendar,
+     .		cx_grid_needs_dset,
+     .		cx_aux_given,
+     .		cx_g_eq_regrid,
+     .		cx_has_impl_grid,
+     .		cx_formatted,
+     .		cx_name
+
+* equivalences to assist with declaration statements
+	INTEGER cx_lo_s1( max_cx ),
+     .		cx_lo_s2( max_cx ),
+     .		cx_lo_s3( max_cx ),
+     .		cx_lo_s4( max_cx ),
+     .		cx_lo_s5( max_cx ),
+     .		cx_lo_s6( max_cx ),
+     .		cx_hi_s1( max_cx ),
+     .		cx_hi_s2( max_cx ),
+     .		cx_hi_s3( max_cx ),
+     .		cx_hi_s4( max_cx ),
+     .		cx_hi_s5( max_cx ),
+     .		cx_hi_s6( max_cx )
+	EQUIVALENCE
+     .		( cx_lo_s1, cx_lo_ss(1,1) ),
+     .		( cx_lo_s2, cx_lo_ss(1,2) ),
+     .		( cx_lo_s3, cx_lo_ss(1,3) ),
+     .		( cx_lo_s4, cx_lo_ss(1,4) ),
+     .		( cx_lo_s5, cx_lo_ss(1,5) ),
+     .		( cx_lo_s6, cx_lo_ss(1,6) ),
+     .		( cx_hi_s1, cx_hi_ss(1,1) ),
+     .		( cx_hi_s2, cx_hi_ss(1,2) ),
+     .		( cx_hi_s3, cx_hi_ss(1,3) ),
+     .		( cx_hi_s4, cx_hi_ss(1,4) ),
+     .		( cx_hi_s5, cx_hi_ss(1,5) ),
+     .		( cx_hi_s6, cx_hi_ss(1,6) )
+
+* equivalences to assist with parsiong auxiliary variable names
+	INTEGER cx_aux_arg_start (nferdims, max_cx),
+     .		cx_aux_arg_end   (nferdims, max_cx)
+	EQUIVALENCE
+     .		( cx_aux_arg_start, cx_aux_var  ),
+     .		( cx_aux_arg_end,   cx_aux_cat )
diff --git a/fer/common/xcontext.equiv b/fer/common/xcontext.equiv
new file mode 100644
index 0000000..b38df60
--- /dev/null
+++ b/fer/common/xcontext.equiv
@@ -0,0 +1,69 @@
+* XCONTEXT.EQUIV
+* equivalence names for various contexts within COMMON / XCONTEXT /
+*
+*  2/12 *kms* Add E and F dimensions (set to nferdims)
+
+	REAL*8	cmnd_lo_ww ( nferdims ),
+     .		cmnd_hi_ww ( nferdims ),
+     .		cmnd_delta   ( nferdims )
+	INTEGER	cmnd_lo_ss ( nferdims ),
+     .		cmnd_hi_ss ( nferdims ),
+     .		cmnd_trans   ( nferdims )
+	LOGICAL	cmnd_norm    ( nferdims ),
+     .		cmnd_relative( nferdims ),
+     .		cmnd_by_ss( nferdims )
+	INTEGER	cmnd_data_set,
+     .		cmnd_category,
+     .		cmnd_variable,
+     .		cmnd_grid,
+     .		cmnd_dim1,
+     .		cmnd_dim2
+
+	REAL*8	expr_lo_ww ( nferdims ),
+     .		expr_hi_ww ( nferdims ),
+     .		expr_delta   ( nferdims )
+	INTEGER	expr_lo_ss ( nferdims ),
+     .		expr_hi_ss ( nferdims ),
+     .		expr_trans   ( nferdims )
+	LOGICAL	expr_norm    ( nferdims ),
+     .		expr_relative( nferdims ),
+     .		expr_by_ss( nferdims )
+	INTEGER	expr_data_set,
+     .		expr_category,
+     .		expr_variable,
+     .		expr_grid,
+     .		expr_dim1,
+     .		expr_dim2
+
+	EQUIVALENCE
+     .		( cmnd_lo_ww,  cx_lo_ww ( 1, cx_cmnd ) ),
+     .		( cmnd_hi_ww,  cx_hi_ww ( 1, cx_cmnd ) ),
+     .		( cmnd_delta  ,  cx_delta   ( 1, cx_cmnd ) ),
+     .		( cmnd_lo_ss,  cx_lo_ss ( 1, cx_cmnd ) ),
+     .		( cmnd_hi_ss,  cx_hi_ss ( 1, cx_cmnd ) ),
+     .		( cmnd_trans   , cx_trans   ( 1, cx_cmnd ) ),
+     .		( cmnd_norm    , cx_norm    ( 1, cx_cmnd ) ),
+     .		( cmnd_relative, cx_relative( 1, cx_cmnd ) ),
+     .		( cmnd_by_ss, cx_by_ss( 1, cx_cmnd ) ),
+     .		( cmnd_data_set, cx_data_set ( cx_cmnd ) ),
+     .		( cmnd_category, cx_category ( cx_cmnd ) ),
+     .		( cmnd_variable, cx_variable ( cx_cmnd ) ),
+     .		( cmnd_grid, cx_grid ( cx_cmnd ) ),
+     .		( cmnd_dim1    , cx_dim1     ( cx_cmnd ) ),
+     .		( cmnd_dim2    , cx_dim2     ( cx_cmnd ) )
+	EQUIVALENCE
+     .		( expr_lo_ww,  cx_lo_ww ( 1, cx_expr ) ),
+     .		( expr_hi_ww,  cx_hi_ww ( 1, cx_expr ) ),
+     .		( expr_delta  ,  cx_delta   ( 1, cx_expr ) ),
+     .		( expr_lo_ss,  cx_lo_ss ( 1, cx_expr ) ),
+     .		( expr_hi_ss,  cx_hi_ss ( 1, cx_expr ) ),
+     .		( expr_trans   , cx_trans   ( 1, cx_expr ) ),
+     .		( expr_norm    , cx_norm    ( 1, cx_expr ) ),
+     .		( expr_relative, cx_relative( 1, cx_expr ) ),
+     .		( expr_by_ss, cx_by_ss( 1, cx_expr ) ),
+     .		( expr_data_set, cx_data_set ( cx_expr ) ),
+     .		( expr_category, cx_category ( cx_expr ) ),
+     .		( expr_variable, cx_variable ( cx_expr ) ),
+     .		( expr_grid, cx_grid ( cx_expr ) ),
+     .		( expr_dim1    , cx_dim1     ( cx_expr ) ),
+     .		( expr_dim2    , cx_dim2     ( cx_expr ) )
diff --git a/fer/common/xcontrol.cmn b/fer/common/xcontrol.cmn
new file mode 100644
index 0000000..b7a3a93
--- /dev/null
+++ b/fer/common/xcontrol.cmn
@@ -0,0 +1,76 @@
+* XCONTROL.CMN - COMMON storage for control stack
+* the letters "CS" refer to "control stack"
+* *sh* 7/92 - added cs_save_*
+* *sh* 2/94 - increased cs_text size to match cmnd_buff
+* *kob* 12/97 - added  logical cs_is_calendar
+* *sh* 10/0 - increased saved command buffer size - match cmnd_buff_len
+* *kob* 1/01 - added cs_start and cs_loop for animations
+* V531 5/01 *sh* - added has_continuation_cmnd
+* V533 7/01 *sh* - increased cs_max from 10 to 200 (allowing recursive scripts)
+* V554 1/04 *acm* - add cs_repeatname for named /RANGE loop control
+* v580 11/04 *acm* use cx_cal_id to store the calendar used when
+*                  computing world coordinates. Save this in a repeat
+*                  with the other context info.  Also need cs_cal_id 
+*                  for repeat command.
+* V6.31 10/09 *acm*  Fixing bug 1706, by properly fixing # 1681. ENDIF inside a REPEAT 
+*              loop with semicolon-separated commands. New flag: bumped.
+
+	INTEGER		cs_max
+	PARAMETER     (	cs_max = 200 )
+
+	LOGICAL	cs_in_control,
+     .		cs_by_ss( cs_max ),
+     .		cs_save_by_ss( cs_max ),
+     .          cs_is_calendar(cs_max),
+     .		has_continuation_cmnd,
+     .          bumped
+	INTEGER	csp,			! control stack pointer
+     .		cs_lun     ( cs_max ),
+     .		cs_cmnd_num( cs_max ),
+     .		cs_axis    ( cs_max ),
+     .		cs_loop	   ( cs_max ),
+     .          cs_save_cal( cs_max ),
+     .          cs_cal_id  (cs_max),
+     .		len_cmnd_copy
+
+	REAL*8	cs_limit   ( cs_max ),
+     .		cs_delta   ( cs_max ),
+     .		cs_phase   ( cs_max ),
+     .		cs_save_lo ( cs_max ),
+     .		cs_save_hi ( cs_max ),
+     .		cs_start   ( cs_max )
+	CHARACTER*2048
+     .		cs_text    ( cs_max ),
+     .		cs_repeatname ( cs_max ),
+     .		cmnd_copy
+
+        CHARACTER*256 my_cbuff
+
+	COMMON / XCONTROL /
+     .		cs_limit   ,
+     .		cs_delta   ,
+     .		cs_phase   ,
+     .		cs_save_lo ,
+     .		cs_save_hi ,
+     .		cs_start   ,
+     .		csp	   ,
+     .		cs_cmnd_num,
+     .		cs_axis    ,
+     .		cs_loop    ,
+     .          cs_save_cal,
+     .          cs_cal_id,
+     .		cs_in_control,
+     .		cs_by_ss   ,
+     .		cs_save_by_ss,
+     .		cs_lun     ,
+     .		cs_text ,
+     .		cmnd_copy ,
+     .          cs_is_calendar,
+     .          cs_repeatname,
+     .		has_continuation_cmnd,
+     .		bumped,
+     .		len_cmnd_copy,
+     .          my_cbuff
+
+
+
diff --git a/fer/common/xcurvilinear.cmn b/fer/common/xcurvilinear.cmn
new file mode 100644
index 0000000..ca46251
--- /dev/null
+++ b/fer/common/xcurvilinear.cmn
@@ -0,0 +1,65 @@
+* COMMON/XCURVILINEAR -- COMMON to communicate arrays of X and Y positions
+*		to PLOT+ for curvilinear plotting
+
+* V612: 7/08 *acm*  Fix bug 1589; units_degrees flag stores whether the units of 
+*                   the x coordinates are something other than degrees
+* V68  *acm* 1/12  explicit REAL*4 declarations for double-precision ferret with
+*		    single-precision pplus
+* V687 *acm* 3/14  Ticket 2147: Need double-precision bad-values for coordinate variables 
+
+	COMMON/ XCURVILINEAR/
+     .		wwxmax, wwxmin,
+     .		wwymax, wwymin,
+     .		badx, bady,
+     .		curvilinear,
+     .		dim1_modulo, dim2_modulo,
+     .		dim1_edges,  dim2_edges,
+     .		minss_dim1, maxss_dim1,
+     .		minss_dim2, maxss_dim2,
+     .		xpos_loss_dim1, xpos_hiss_dim1,
+     .		xpos_loss_dim2, xpos_hiss_dim2,
+     .		ypos_loss_dim1, ypos_hiss_dim1,
+     .		ypos_loss_dim2, ypos_hiss_dim2,
+     .		xpos_off0_dim1,
+     .		xpos_off0_dim2,
+     .		ypos_off0_dim1,
+     .		ypos_off0_dim2,
+     .		xspan_1_dim1,
+     .		xspan_1_dim2,
+     .		yspan_1_dim1,
+     .		yspan_1_dim2,
+     .          xmodulo,
+     .          units_degrees,
+     .		curv_missing
+
+	LOGICAL	curvilinear,
+     .		dim1_modulo, dim2_modulo,
+     .		dim1_edges,  dim2_edges,
+     .		xspan_1_dim1,
+     .		xspan_1_dim2,
+     .		yspan_1_dim1,
+     .		yspan_1_dim2,
+     .          xmodulo,
+     .          units_degrees,
+     .		curv_missing
+	INTEGER
+     .		minss_dim1, maxss_dim1,
+     .		minss_dim2, maxss_dim2,
+     .		xpos_loss_dim1, xpos_hiss_dim1,
+     .		xpos_loss_dim2, xpos_hiss_dim2,
+     .		ypos_loss_dim1, ypos_hiss_dim1,
+     .		ypos_loss_dim2, ypos_hiss_dim2,
+     .		xpos_off0_dim1,
+     .		xpos_off0_dim2,
+     .		ypos_off0_dim1,
+     .		ypos_off0_dim2
+	REAL*4	badx, bady,
+     .		wwxmax, wwxmin,
+     .		wwymax, wwymin
+
+
+
+	COMMON/ XCURV_8/
+     .		badxcurv, badycurv
+	REAL	badxcurv, badycurv
+
diff --git a/fer/common/xcvar_calcs.cmn b/fer/common/xcvar_calcs.cmn
new file mode 100644
index 0000000..60b4e09
--- /dev/null
+++ b/fer/common/xcvar_calcs.cmn
@@ -0,0 +1,8 @@
+* XCVAR_CALCS.CMN
+* number of fields computed when a varianble is calculated
+* ( e.g. when HFLUX is called both QSEN and QEVA are computed )
+
+* 10/12/89
+	COMMON / XCVAR_CALCS / cvar_nres
+
+	INTEGER cvar_nres( max_calc_vars )
diff --git a/fer/common/xdelta_context.cmn b/fer/common/xdelta_context.cmn
new file mode 100644
index 0000000..20a686f
--- /dev/null
+++ b/fer/common/xdelta_context.cmn
@@ -0,0 +1,13 @@
+* XDELTA_CONTEXT.CMN
+* temporary storage for delta limits given in the form "/DX=val", etc.
+
+* V200:   5/2/90
+*          2/12 *kms* added E and F dimensions (set to nferdims)
+
+	REAL*8		dcx_lo(nferdims), dcx_hi(nferdims)
+	LOGICAL		dcx_given(nferdims), dcx_by_ss(nferdims)
+
+	COMMON / XDELTA_CONTEXT /
+     .		dcx_lo, dcx_hi,
+     .		dcx_given,
+     .		dcx_by_ss
diff --git a/fer/common/xdependency_tree.cmn b/fer/common/xdependency_tree.cmn
new file mode 100644
index 0000000..5a2772f
--- /dev/null
+++ b/fer/common/xdependency_tree.cmn
@@ -0,0 +1,54 @@
+* XDEPENDENCY_TREE.CMN
+* variables needed to manage and assess dependency tree
+
+* created 10/1/2013
+
+
+	COMMON/ XDEPENDENCY_TREE / dependency_nrows,
+     .		                   dependency_status,
+     .		                   dependency_status_rec,
+     .				   dependency_root_level,
+     .				   dependency_dflt_dset,
+     .				   dependency_max_recs,
+     .				   dependency_block1,
+     .				   dependency_current_tree_start,
+     .				   dependency_tree_mode,
+     .				   dependency_tree_show_uvars,
+     .				   dependency_tree_show_fvars
+
+
+	INTEGER			   dependency_nrows,
+     .				   dependency_status,
+     .				   dependency_status_rec,
+     .				   dependency_root_level,
+     .				   dependency_dflt_dset,
+     .				   dependency_max_recs,
+     .				   dependency_block1,
+     .				   dependency_current_tree_start
+	LOGICAL 		   dependency_tree_mode,
+     .				   dependency_tree_show_uvars,
+     .				   dependency_tree_show_fvars
+
+* number of fields needed per dependency element on the tree
+	INTEGER		dependency_nfields
+	PARAMETER     ( dependency_nfields = 9 )
+
+* dependency flag values -- ordered by increasing error severity
+	INTEGER		df_defined_earlier,
+     .			df_valid_aux_var, 
+     .			df_valid_var, 
+     .			df_unknown_grid, 
+     .			df_unknown_auxvar,
+     .			df_unknown_var,
+     .			df_unknown_dataset, 
+     .			df_syntax_error,
+     .			df_recursion_error
+	PARAMETER     ( df_defined_earlier = 1,
+     .			df_valid_aux_var   = 2, 
+     .			df_valid_var       = 3, 
+     .			df_unknown_grid	   = 4, 
+     .			df_unknown_auxvar  = 5,
+     .			df_unknown_var     = 6,
+     .			df_unknown_dataset = 7, 
+     .			df_syntax_error	   = 8,
+     .			df_recursion_error = 9 )
diff --git a/fer/common/xdset_parms.cmn b/fer/common/xdset_parms.cmn
new file mode 100644
index 0000000..23ade49
--- /dev/null
+++ b/fer/common/xdset_parms.cmn
@@ -0,0 +1,55 @@
+* XDSET_PARMS.CMN
+* special parameters for individual data sets
+* this common is mostly managed by GET_DSET_PARMS
+* needs maxdsets from *VARIABLES.CMN
+* 8/91 *sh* - added dp_nts30_wind
+
+	INTEGER	    max_spec_parms, 
+     .		    max_airt_clim
+	PARAMETER ( max_spec_parms = 40,
+     .		    max_airt_clim  = 5 )
+
+	LOGICAL		dp_flags	( maxdsets, max_spec_parms )
+	REAL		dp_real_vals	( maxdsets, max_spec_parms )
+	INTEGER		dp_int_vals	( maxdsets, max_spec_parms )
+	INTEGER		dp_airt_dset	( max_airt_clim )
+	CHARACTER*4	dp_airt_name	( max_airt_clim )
+
+
+	COMMON /XDSET_PARMS/ dp_flags, dp_airt_dset, dp_airt_name
+
+* logical, real and integer parameters all equivalenced
+	EQUIVALENCE ( dp_flags, dp_real_vals ),
+     .		    ( dp_flags, dp_int_vals  )
+
+* specific names for parameters already known
+* (future parameter equivalences may be imbedded in specific subroutines)
+	LOGICAL	dp_phil_sieg	( maxdsets ),
+     .		dp_cox		( maxdsets ),
+     .		dp_trop_pacific	( maxdsets ),
+     .		dp_phil_qflux	( maxdsets ),
+     .		dp_ramp1_qflux	( maxdsets ),
+     .		dp_ramp2_qflux	( maxdsets ),
+     .		dp_const_air_sst( maxdsets ),
+     .		dp_nts30_wind	( maxdsets )
+
+	INTEGER	dp_clim_air_sst	 ( maxdsets )
+
+	REAL	dp_delta_air_sst ( maxdsets ),
+     .		dp_min_wind	 ( maxdsets ),
+     .		dp_Am_factor	 ( maxdsets )
+
+	EQUIVALENCE
+     .		( dp_flags( 1, 1), dp_phil_sieg ),
+     .		( dp_flags( 1, 2), dp_cox ),
+     .		( dp_flags( 1, 3), dp_trop_pacific ),
+     .		( dp_flags( 1, 4), dp_phil_qflux ),
+     .		( dp_flags( 1, 5), dp_ramp1_qflux ),
+     .		( dp_flags( 1, 6), dp_ramp2_qflux ),
+     .		( dp_flags( 1, 7), dp_clim_air_sst ),
+     .		( dp_flags( 1, 8), dp_const_air_sst ),
+     .		( dp_flags( 1, 9), dp_nts30_wind ),
+     .		! #10 unused
+     .		( dp_flags( 1,11), dp_delta_air_sst ),
+     .		( dp_flags( 1,12), dp_min_wind ),
+     .		( dp_flags( 1,13), dp_Am_factor )
diff --git a/fer/common/xeddy.cmn b/fer/common/xeddy.cmn
new file mode 100644
index 0000000..682faeb
--- /dev/null
+++ b/fer/common/xeddy.cmn
@@ -0,0 +1,2 @@
+	COMMON /XEDDY/ AM,AH,FKPM,FKPH
+     .			,dtts,c2dtts,cmonthly
diff --git a/fer/common/xerrmsg_text.cmn b/fer/common/xerrmsg_text.cmn
new file mode 100644
index 0000000..36237ab
--- /dev/null
+++ b/fer/common/xerrmsg_text.cmn
@@ -0,0 +1,24 @@
+* XERRMSG_TEXT.CMN
+* text of error messages
+* 5/87 - added codes and last_error for HELP
+* 11/05 V600  -- ef_errtext contains text for new symbol 
+*             FER_LAST_ERROR, which all the text normally
+*             written to std out. 
+
+	COMMON/ XERRMSG_TEXT / last_error,
+     .                             len_efname, 
+     .				   len_eftext,
+     .				   err_text,
+     .				   report_err_code,
+     .				   noreport_err_code,
+     .				   special_err_code,
+     .                             ef_errtext,
+     .                             efname
+
+	INTEGER	     last_error, len_efname, len_eftext
+	CHARACTER*50 err_text(gnum_report)
+	CHARACTER*16 report_err_code  (gnum_report),
+     .		     noreport_err_code(gnum_noreport),
+     .		     special_err_code (gnum_special)
+	CHARACTER*1028	ef_errtext
+	CHARACTER*40	efname
diff --git a/fer/common/xfr_grid.cmn b/fer/common/xfr_grid.cmn
new file mode 100644
index 0000000..465d0ff
--- /dev/null
+++ b/fer/common/xfr_grid.cmn
@@ -0,0 +1,31 @@
+* XFR_GRID.CMN
+* common to supplement XTM_GRID in the TMAP_FORMAT library
+* 12/98 - added mgrid_xabstract, mgrid_yabstract, etc. z, and t
+*  2/12 *kms* Add mgrid_eabstract and mgrid_fabstract
+
+	INTEGER		max_special_grids
+	PARAMETER     ( max_special_grids = 10 )
+
+	COMMON / XFR_GRID / grd_stk_ptr,
+     .			    num_special_grids,
+     .			    special_grids
+
+	INTEGER	grd_stk_ptr,
+     .		num_special_grids,
+     .		special_grids( max_special_grids )
+
+* EQUIVALENCES
+	INTEGER mgrid_abstract,  mgrid_ez_dflt,
+     .		mgrid_xabstract, mgrid_yabstract, 
+     .		mgrid_zabstract, mgrid_tabstract,
+     .		mgrid_eabstract, mgrid_fabstract
+
+	EQUIVALENCE	( special_grids(1), mgrid_abstract ),
+     .			( special_grids(2), mgrid_ez_dflt  ),
+     .			( special_grids(3), mgrid_xabstract ),
+     .			( special_grids(4), mgrid_yabstract ),
+     .			( special_grids(5), mgrid_zabstract ),
+     .			( special_grids(6), mgrid_tabstract ),
+     .			( special_grids(7), mgrid_eabstract ),
+     .			( special_grids(8), mgrid_fabstract )
+
diff --git a/fer/common/xgfdl_masks.cmn b/fer/common/xgfdl_masks.cmn
new file mode 100644
index 0000000..dc8d305
--- /dev/null
+++ b/fer/common/xgfdl_masks.cmn
@@ -0,0 +1,12 @@
+*  COMMON containing GFDL model mask arrays
+* Linux Port *kob* 1/97 - added ifdef check for byte vs. integer
+	COMMON /XGFDL_MASKS/
+     .				umask,		! velocity, wind mask
+     .				tmask,		! temperature, salinity mask
+     .				kmt,		! bottom topography on t grid
+     .				kmu		! bottom topography on u grid
+#ifdef NEED_BYTE
+	 BYTE      umask(im,jm), tmask(im,jm), kmt(im,jm), kmu(im,jm)
+#else
+	 INTEGER*1 umask(im,jm), tmask(im,jm), kmt(im,jm), kmu(im,jm)
+#endif
diff --git a/fer/common/xgks_devices.cmn b/fer/common/xgks_devices.cmn
new file mode 100644
index 0000000..3c8be8b
--- /dev/null
+++ b/fer/common/xgks_devices.cmn
@@ -0,0 +1,16 @@
+* XGKS_DEVICES.CMN - list of DEC GKS device names
+
+	INTEGER		num_gks_devices,
+     .			num_meta_devices,
+     .			unknown_gks_device
+	PARAMETER     (	num_gks_devices  = 10,
+     .			num_meta_devices = 10,
+     .			unknown_gks_device = -9999 )
+
+	CHARACTER	gks_dev_name  (num_gks_devices )*8,
+     .			meta_dev_name (num_meta_devices)*8
+	INTEGER		gks_dev_wstype(num_gks_devices)
+
+	COMMON /XGKS_DEVICES/ gks_dev_name,
+     .			      gks_dev_wstype,
+     .			      meta_dev_name
diff --git a/fer/common/xgrid_chg_fcns.cmn b/fer/common/xgrid_chg_fcns.cmn
new file mode 100644
index 0000000..9dedb9b
--- /dev/null
+++ b/fer/common/xgrid_chg_fcns.cmn
@@ -0,0 +1,91 @@
+* XGRID_CHG_FCNS.CMN - common declaration of "grid changing functions" --
+* functions which are capable of delivering results on a grid which is
+* differs from the straightforward implications of the input arguments.
+
+* V450:
+* V500: 1/99 added gfcn_arg_type in support of string arguments
+* V533: 6/01 *sh* added gfcn_rtn_type in support of string functions
+*       2/12 *ksm* added E and F dimensions
+
+	INTEGER		pmax_grid_chg_fcns,
+     .			pmax_gfcn_args
+	PARAMETER     (	pmax_grid_chg_fcns = 400,
+     .			pmax_gfcn_args = 1000 )
+
+	COMMON / XGRID_CHG_FCN /
+     .				gfcn_version,
+     .				gfcn_num_internal, 
+     .				gfcn_num_reqd_args, 
+     .				gfcn_arg_ptr,
+     .				gfcn_arg_type, 
+     .				gfcn_rtn_type, 
+     .				gfcn_axis_will_be, 
+     .				gfcn_axis_reduction,
+     .				gfcn_has_vari_args, 
+     .				gfcn_piecemeal_ok, 
+     .				gfcn_axis_implied_from, 
+     .				gfcn_arg_extend_lo, 
+     .				gfcn_arg_extend_hi, 
+     .				gfcn_name,
+     .				gfcn_descr,
+     .				gfcn_arg_name,
+     .				gfcn_arg_units,
+     .				gfcn_arg_descr
+
+
+
+! for a later version -- support for "multi-component variables and functions"
+!     .				gfcn_num_comps, 
+!     .				gfcn_arg_num_comps, 
+
+* number of internally-defined grid-changing functions (inside Ferret)
+	INTEGER		gfcn_num_internal
+
+* version number of grid changing function (tells what features it supports)
+	REAL		gfcn_version          ( pmax_grid_chg_fcns )
+
+* name of grid changing function
+	CHARACTER*40	gfcn_name	      ( pmax_grid_chg_fcns )
+
+* text description of grid changing function
+	CHARACTER*128	 gfcn_descr	      ( pmax_grid_chg_fcns )
+
+* number of arguments and possibility of variable arguments
+	INTEGER		gfcn_num_reqd_args    ( pmax_grid_chg_fcns )
+	LOGICAL		gfcn_has_vari_args    ( pmax_grid_chg_fcns )
+
+* data type of function return
+	INTEGER		gfcn_rtn_type	   ( pmax_gfcn_args )
+
+!* number of components in the result (not used in V450)
+!	INTEGER		gfcn_num_comps    ( pmax_grid_chg_fcns )
+
+* type of axis of result: merged from args, normal, abstract, or custom
+	INTEGER		gfcn_axis_will_be    ( nferdims, pmax_grid_chg_fcns )
+
+* how to interpret a range on the result axis: pgc_span_retained or pgc_span_reduced
+	INTEGER		gfcn_axis_reduction  ( nferdims, pmax_grid_chg_fcns )
+
+* for memory optimization: axes where calculation may be performed piecemeal
+	LOGICAL		gfcn_piecemeal_ok  ( nferdims, pmax_grid_chg_fcns )
+
+* pointer from function to array of information about arguments
+	INTEGER		gfcn_arg_ptr       ( pmax_grid_chg_fcns )
+
+* for each argument: what is its required data type
+	INTEGER		gfcn_arg_type	   ( pmax_gfcn_args )
+
+* for each argument: should its axes be merged into the result grid?
+	LOGICAL		gfcn_axis_implied_from( nferdims, pmax_gfcn_args )
+
+* for each argument: does Ferret need to extend arg limits relative to result
+	INTEGER		gfcn_arg_extend_lo ( nferdims, pmax_gfcn_args ),
+     .			gfcn_arg_extend_hi ( nferdims, pmax_gfcn_args )
+
+* for each argument: what is the name, units, and description of it?
+	CHARACTER	gfcn_arg_name(pmax_gfcn_args)*40 ,
+     .			gfcn_arg_units(pmax_gfcn_args)*40,
+     .			gfcn_arg_descr(pmax_gfcn_args)*128
+
+!* for each argument: how many components in it?
+!	INTEGER		gfcn_arg_num_comps ( pmax_gfcn_args )
diff --git a/fer/common/xgui.cmn b/fer/common/xgui.cmn
new file mode 100644
index 0000000..eab964c
--- /dev/null
+++ b/fer/common/xgui.cmn
@@ -0,0 +1,19 @@
+* XGUI.CMN  -  special variables needed for GUI interactions
+* created 6/16/93
+* text buffers moved to TMAP common 2/95
+
+* funky kludge parameter -- max_gui_windows should NOT exist --it is the
+* same parameter as max_windows in xplot_state.cmn but I am too lazy to
+* reorganize COMMONs so that max_windows is a parameter in ferret.parm
+	INTEGER max_gui_windows
+	PARAMETER (max_gui_windows = 9)	! must be same as max_windows
+
+	COMMON/ XGUI / pipe_open, pipe_lun,
+     .		       gui_window_reported,
+     .		       gui_status,
+     .		       gui_fmt1, gui_char
+
+	LOGICAL pipe_open, gui_window_reported(max_gui_windows)
+	INTEGER pipe_lun, gui_status
+	CHARACTER*20	gui_fmt1
+	CHARACTER*1	gui_char
diff --git a/fer/common/xinterrupt.cmn b/fer/common/xinterrupt.cmn
new file mode 100644
index 0000000..a9b9413
--- /dev/null
+++ b/fer/common/xinterrupt.cmn
@@ -0,0 +1,3 @@
+	COMMON /XINTERRUPT/ interrupted
+
+	LOGICAL interrupted
diff --git a/fer/common/xlbr_io.cmn b/fer/common/xlbr_io.cmn
new file mode 100644
index 0000000..30fda42
--- /dev/null
+++ b/fer/common/xlbr_io.cmn
@@ -0,0 +1,5 @@
+* XLBR_IO - page size control information to assist with HELP io
+
+       COMMON /XPUT_OUTPUT/ line_count, stop_output
+       INTEGER line_count
+       LOGICAL stop_output
diff --git a/fer/common/xmake_date.cmn b/fer/common/xmake_date.cmn
new file mode 100644
index 0000000..f6860f3
--- /dev/null
+++ b/fer/common/xmake_date.cmn
@@ -0,0 +1,5 @@
+* XMAKE_DATE.CMN
+
+	COMMON/ XMAKE_DATE / make_date
+
+	CHARACTER*8 make_date
diff --git a/fer/common/xmem_subsc.cmn b/fer/common/xmem_subsc.cmn
new file mode 100644
index 0000000..42ee4c5
--- /dev/null
+++ b/fer/common/xmem_subsc.cmn
@@ -0,0 +1,78 @@
+* XMEM_SUBSC.CMN - COMMON/ XMEM_SUBSC /
+* non-array subscript limits required to use adjustable array declarations
+* after "VAX FORTRAN V5.2-33"
+
+* V200:  10/89 
+* Unix/RISC changes: direct declaration of unsubscripted vars, equivalence
+* to arrays.  Ultrix/RISC/FORTRAN doesn't permit EQUIVALENCED object to be
+* used as array declaration bounds
+* V500: 7/97 - increased number of subscripts from 6 to 12
+*       2/12 *kms* Add E and F dimensions
+
+********************************************************************************
+******			PARAMETER DEFINITIONS				  ******
+
+	INTEGER		max_mem_args
+	PARAMETER     ( max_mem_args = 12 )	! was 6 pre 7/97
+
+	COMMON / XMEM_SUBSC /
+     .		m1lox, m2lox, m3lox, m4lox,  m5lox,  m6lox,
+     .		m7lox, m8lox, m9lox, m10lox, m11lox, m12lox,
+     .		m1loy, m2loy, m3loy, m4loy,  m5loy,  m6loy,
+     .		m7loy, m8loy, m9loy, m10loy, m11loy, m12loy,
+     .		m1loz, m2loz, m3loz, m4loz,  m5loz,  m6loz,
+     .		m7loz, m8loz, m9loz, m10loz, m11loz, m12loz,
+     .		m1lot, m2lot, m3lot, m4lot,  m5lot,  m6lot,
+     .		m7lot, m8lot, m9lot, m10lot, m11lot, m12lot,
+     .		m1loe, m2loe, m3loe, m4loe,  m5loe,  m6loe,
+     .		m7loe, m8loe, m9loe, m10loe, m11loe, m12loe,
+     .		m1lof, m2lof, m3lof, m4lof,  m5lof,  m6lof,
+     .		m7lof, m8lof, m9lof, m10lof, m11lof, m12lof,
+     .
+     .		m1hix, m2hix, m3hix, m4hix,  m5hix,  m6hix,
+     .		m7hix, m8hix, m9hix, m10hix, m11hix, m12hix,
+     .		m1hiy, m2hiy, m3hiy, m4hiy,  m5hiy,  m6hiy,
+     .		m7hiy, m8hiy, m9hiy, m10hiy, m11hiy, m12hiy,
+     .		m1hiz, m2hiz, m3hiz, m4hiz,  m5hiz,  m6hiz,
+     .		m7hiz, m8hiz, m9hiz, m10hiz, m11hiz, m12hiz,
+     .		m1hit, m2hit, m3hit, m4hit,  m5hit,  m6hit,
+     .		m7hit, m8hit, m9hit, m10hit, m11hit, m12hit,
+     .		m1hie, m2hie, m3hie, m4hie,  m5hie,  m6hie,
+     .		m7hie, m8hie, m9hie, m10hie, m11hie, m12hie,
+     .		m1hif, m2hif, m3hif, m4hif,  m5hif,  m6hif,
+     .		m7hif, m8hif, m9hif, m10hif, m11hif, m12hif
+
+	INTEGER
+     .		m1lox, m2lox, m3lox, m4lox,  m5lox,  m6lox,
+     .		m7lox, m8lox, m9lox, m10lox, m11lox, m12lox,
+     .		m1loy, m2loy, m3loy, m4loy,  m5loy,  m6loy,
+     .		m7loy, m8loy, m9loy, m10loy, m11loy, m12loy,
+     .		m1loz, m2loz, m3loz, m4loz,  m5loz,  m6loz,
+     .		m7loz, m8loz, m9loz, m10loz, m11loz, m12loz,
+     .		m1lot, m2lot, m3lot, m4lot,  m5lot,  m6lot,
+     .		m7lot, m8lot, m9lot, m10lot, m11lot, m12lot,
+     .		m1loe, m2loe, m3loe, m4loe,  m5loe,  m6loe,
+     .		m7loe, m8loe, m9loe, m10loe, m11loe, m12loe,
+     .		m1lof, m2lof, m3lof, m4lof,  m5lof,  m6lof,
+     .		m7lof, m8lof, m9lof, m10lof, m11lof, m12lof,
+     .
+     .		m1hix, m2hix, m3hix, m4hix,  m5hix,  m6hix,
+     .		m7hix, m8hix, m9hix, m10hix, m11hix, m12hix,
+     .		m1hiy, m2hiy, m3hiy, m4hiy,  m5hiy,  m6hiy,
+     .		m7hiy, m8hiy, m9hiy, m10hiy, m11hiy, m12hiy,
+     .		m1hiz, m2hiz, m3hiz, m4hiz,  m5hiz,  m6hiz,
+     .		m7hiz, m8hiz, m9hiz, m10hiz, m11hiz, m12hiz,
+     .		m1hit, m2hit, m3hit, m4hit,  m5hit,  m6hit,
+     .		m7hit, m8hit, m9hit, m10hit, m11hit, m12hit,
+     .		m1hie, m2hie, m3hie, m4hie,  m5hie,  m6hie,
+     .		m7hie, m8hie, m9hie, m10hie, m11hie, m12hie,
+     .		m1hif, m2hif, m3hif, m4hif,  m5hif,  m6hif,
+     .		m7hif, m8hif, m9hif, m10hif, m11hif, m12hif
+
+* equivalences to assist with passing subscripts
+	INTEGER
+     .		lo_ss( max_mem_args, nferdims ),
+     .		hi_ss( max_mem_args, nferdims )
+
+	EQUIVALENCE
+     .		(lo_ss(1,1), m1lox), (hi_ss(1,1), m1hix)
diff --git a/fer/common/xonedim.cmn b/fer/common/xonedim.cmn
new file mode 100644
index 0000000..acf4aa5
--- /dev/null
+++ b/fer/common/xonedim.cmn
@@ -0,0 +1,55 @@
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE HDIFFUS
+
+* original version in GFDL model:
+!       COMMON /ONEDIM/							!  920
+!      * PHI (JMT),PXN (IMT),ZUN   (IMT)  ,DZ  (KM),TINIT(KM,NT),TMIX(NT),!  921
+!      1 PHIT(JMT),PXS (IMT),ZUS   (IMT)  ,ZDZ (KM),			!  922
+!      1 CS  (JMT),PYN (IMT),ZVN   (IMT)  ,DZ2R(KM),			!  923
+!      1 CSR (JMT),PYS (IMT),ZVS   (IMT)  ,C2DZ(KM),KAR(KM),		!  924
+!      1 CST (JMT),SFUB(IMT),ZUNENG(IMT,8),EEH (KM),EEM(KM),		!  925
+!      1 CSTR(JMT),SFU (IMT),ZUSENG(IMT,8),FFH (KM),FFM(KM),		!  926
+!      1 SINE(JMT),SFVB(IMT),ZVNENG(IMT,8),DZZ (KMP1),DZZ2R(KMP1),	!  927
+!      1 TNG (JMT),SFV (IMT),ZVSENG(IMT,8),ZDZZ(KMP1),			!  928
+!      * XJV(JMT),XJT(JMT),XIV(IMT),XIT(IMT),				!  929
+!      1 DYT(JMT),DYTR(JMT),DYT2R(JMT),DYU(JMT),DYUR(JMT),DYU2R(JMT),	!  930
+!      1 DYU4R(JMT),DYT4R(JMT),						!  931
+!      1 DXT(IMT),DXTR(IMT),DXT2R(IMT),DXU(IMT),DXUR(IMT),DXU2R(IMT),	!  932
+!      1 DXU4R(IMT),DXT4R(IMT),						!  933
+!      1 AATJ(IMT),AAUJ(IMT),BBTJ(IMT),BBUJ(IMT),			!  934
+!      1 ISZ(JMT,LSEG),IEZ(JMT,LSEG),COFIS(NISLE,2),			!  935
+!      1 ISIS(NISLE),IEIS(NISLE),JSIS(NISLE),JEIS(NISLE)		!  936
+
+* reduced version in use in TMAP programs
+	REAL
+     .	phi ,phit,zdz ,dz2r,c2dz,cs,
+     .	eem,ffm,eeh,ffh,csr,cst,cstr,sine,tng,
+     .	dzz,zdzz,xjv,xjt,xiv,
+     .	xit,dytr,dyur,dyu2r, dyu4r,dxtr,dxur,dxu2r,dxt4r,
+     .	aatj,bbtj,dyu,dxu,dyt,DXT,
+     .	AM,AH,FKPM,FKPH,BAH,BAM,dtts,dtuv,c2dtuv,c2dtts,cmonthly,
+     .	tfac1,tfac2,omega,grav,
+     .	dxv,dyv,dz,
+     .	xt,yt,xv,yv,z,zb,
+     .	boxtw,boxts
+
+	INTEGER	nts30, month
+
+	common /onedim/
+     .	phi (jmt),phit(jmt),zdz (km),dz2r(km),c2dz(km),cs(jmt),
+     .	eem(km), ffm(km),eeh(km),ffh(km),
+     .	csr(jmt),cst(jmt),cstr(jmt),sine(jmt),tng(jmt),
+     .	dzz(kmp1),zdzz(kmp1),xjv(jmt),xjt(jmt),xiv(imt),
+     .	xit(imt),dytr(jmt),dyur(jmt),dyu2r(jmt),dyu4r(jmt),
+     .	dxtr(imt),dxur(imt),dxu2r(imt),dxt4r(imt),
+     .	aatj(imt),bbtj(imt),dyu(jmt),dxu(imt),dyt(jmt),DXT(imt),
+     .
+     .	AM,AH,FKPM,FKPH,BAH,BAM,dtts,dtuv,c2dtuv,c2dtts,cmonthly,
+     .	nts30,month,tfac1,tfac2,omega,grav,
+     .
+     .	dxv(im),dyv(jm),dz(km),
+     .	xt(im),yt(jm),xv(im),yv(jm),z(km),zb(km),
+     .	boxtw,boxts
diff --git a/fer/common/xplatform_type.cmn b/fer/common/xplatform_type.cmn
new file mode 100644
index 0000000..1d84abb
--- /dev/null
+++ b/fer/common/xplatform_type.cmn
@@ -0,0 +1,8 @@
+* XPLATFORM_TYPE.CMN
+* *kob* 10/01 - variable to hold platform type executable was built on -
+*               for output in banner message
+* *acm* 10/09 - make the string longer
+ 
+        COMMON/ XPLATFORM_TYPE / platform_type
+
+        CHARACTER*40 platform_type
diff --git a/fer/common/xplot_setup.cmn b/fer/common/xplot_setup.cmn
new file mode 100644
index 0000000..2b2e99a
--- /dev/null
+++ b/fer/common/xplot_setup.cmn
@@ -0,0 +1,108 @@
+* XPLOT_SETUP.CMN - COMMON for physical plot description
+
+* vaiables coding:
+*	begins with "ul"--> refers to labels in the "upper left" corner
+*	begins with "key"-->refers to keys for lines and overlays
+*	ends with "_on" --> refers to what is currently on the screen and/or
+* 			    in the PLOT+ data bases
+*	contains "ov"	--> refers to overlays
+*	ends with "0"	--> refers to a suggested or pre-modification value
+*	  "space"	--> an abstract box within which a key must fit
+*         "size"	--> the portion of the abstract box that's occupied
+* *kob* 12/00 - add animate logical and active_win_id for animations
+* *sh* 9/01 - added white space defaults -- distance above/below axis ends
+*		to window or viewport edge (below == PLOT+ origin)
+* *acm* v552 3/03 Longer strings: changes for multi-line labels.
+* *acm* V600 9/05 window title: either set with SET WIN/TITLE or use 
+*                 session date/time.
+* *acm* V63  9/09 Introduction of syntax for variance-based and histogram levels
+* *acm* v68  1/12 move window title to xtoday.cmn.
+* *kms*      2/12 Add E and F dimensions to ul_dolab, plot_axis
+* *acm* v683 11/12 add sym_so_far - symbols on line plots. Used to be SAVEd in line_style.F
+* *kms* PyFr  7/13 Added pplscale for scaling standard lengths and text heights;
+*                  Added textscale for further scaling of text heights;
+*                  Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin to plot_setup.parm,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale and 
+*                  possible textscale.
+* V685+ *acm* 12/13 For 6D Ferret, key_doc longer for extra dimensions
+
+	LOGICAL	key_doc(0:12),
+     .		onedee_on,
+     .		twodee_on,
+     .		saved_ppl_yax,
+     .		ul_dolab(nferdims),
+     .		ovkey_ll_full,
+     .		animate,
+     .		first_frame,
+     .		need_std,
+     .		need_histo,
+     .		ribbon_plot
+	INTEGER	nvect_on,
+     .		ncont_on,
+     .		nlabs_on,
+     .		nline_on,
+     .		nkeys_on,
+     .		novkeys_on,
+     .		novkeys_ll,
+     .		key_ncolmn,
+     .		ul_nlabs,
+     .		plot_axis(nferdims), nplot_axis,
+     .		active_win_id,
+     .		sym_so_far
+
+	REAL	pplscale,
+     .          textscale,
+     .		key_yspace,
+     .		key_xspace,
+     .		key_labht,
+     .		key_xsize,
+     .		key_ysize,
+     .		ppl_saved_yorg,
+     .		ppl_saved_yaxlen
+
+	CHARACTER	ppl_buff*2048
+
+	COMMON / XPLOT_SETUP /
+     .          pplscale,
+     .          textscale,
+     .		key_yspace,
+     .		key_xspace,
+     .		key_labht,
+     .		key_xsize,
+     .		key_ysize,
+     .		ppl_saved_yorg,
+     .		ppl_saved_yaxlen,
+     .		animate,
+     .		first_frame,
+     .		need_std,
+     .		need_histo,
+     .		ribbon_plot,
+     .          active_win_id,
+     .          sym_so_far,
+     .		key_doc,
+     .		onedee_on,
+     .		twodee_on,
+     .		saved_ppl_yax,
+     .		ul_dolab,
+     .		ovkey_ll_full,
+     .		nvect_on,
+     .		ncont_on,
+     .		nlabs_on,
+     .		nline_on,
+     .		nkeys_on,
+     .		novkeys_on,
+     .		novkeys_ll,
+     .		key_ncolmn,
+     .		ul_nlabs,
+     .		plot_axis, nplot_axis,
+     .		ppl_buff
+
+* equivalences
+	LOGICAL		use_keys
+	EQUIVALENCE   ( key_doc(0), use_keys )
+
diff --git a/fer/common/xplot_state.cmn b/fer/common/xplot_state.cmn
new file mode 100644
index 0000000..80cf493
--- /dev/null
+++ b/fer/common/xplot_state.cmn
@@ -0,0 +1,133 @@
+* XPLOT_STATE.CMN
+* COMMON describing the state of GKS
+* 7/97 *sh* - increased max_viewport from 50 to 200
+* 6/99 *sh* - include info about the time axis currently on the screen
+* 1/00 *kob* - add win_id9 for animate window id -always nine
+* 1/00 *acm* - include saved_calendar_id with the time axis info
+* 1/00 *acm* - add saved_calendar_id with the time axis info
+* 6/01 *acm* - add h_logaxis, v_logaxis
+* 9/01 V540 *sh* - add vp_by_axis
+* 5/06 v600 *acm*  Flag no_plot_yet: changes so user can change the number of 
+*                  line colors.
+* V6.2  *acm* 5/08 new qualifier FRAME/TRANSPARENT
+* V68  *acm* 1/12  explicit REAL*4 declarations for double-precision ferret with
+*		    single-precision pplus
+* PyFr *kms*  7/13  add the wn_* arrays to hold ppl lengths for each window
+
+	INTEGER		max_windows,
+     .			max_viewport,
+     .			mvp_dflt
+	PARAMETER     ( max_windows = 9,
+     .			max_viewport= 200,
+     .			mvp_dflt = 0 )
+
+	LOGICAL		wn_open,
+     .			wn_active,
+     .			vp_opaque,
+     .			vp_by_axis,
+     .			pplus_started,
+     .			ppl_interrupted,
+     .			has_time_axis,
+     .			h_logaxis, 
+     .			v_logaxis,
+     .                  no_plot_yet
+
+	INTEGER		vp_num,
+     .			vp_seg0,
+     .			vp_segn,
+     .			curr_seg_name,
+     .			saved_calendar_id,
+     .			transparent
+
+        REAL*4          wn_xinches,
+     .                  wn_yinches,
+     .                  wn_xpixels,
+     .                  wn_ypixels,
+     .                  wn_xwhitelo,
+     .                  wn_xwhitehi,
+     .                  wn_ywhitelo,
+     .                  wn_ywhitehi,
+     .                  wn_pplscale,
+     .                  wn_textscale,
+     .                  wn_tics_lgx,
+     .                  wn_tics_smx,
+     .                  wn_tics_lgy,
+     .                  wn_tics_smy,
+     .                  wn_axlsze_x,
+     .                  wn_axlsze_y,
+     .                  wn_txlsze,
+     .                  wn_labset_mn,
+     .                  wn_labset_x,
+     .                  wn_labset_y,
+     .                  wn_labset_mv,
+     .                  wn_con_hgt,
+     .                  wn_con_labsp,
+     .                  wn_con_dshln,
+     .                  wn_con_spcln,
+     .                  wn_vec_len,
+     .			vp_size ,
+     .			vp_xorg ,
+     .			vp_yorg ,
+     .			vp_xclip,
+     .			vp_yclip,
+     .			xlowlef,
+     .			ylowlef,
+     .			saved_dt_min
+
+	CHARACTER	vp_name*16, saved_t1_date*14, transparent_color*10
+
+	COMMON / XPLOT_STATE /
+     .			pplus_started,
+     .			ppl_interrupted,
+     .			curr_seg_name,
+     .			saved_calendar_id,
+     .			transparent,
+     .
+     .			wn_open	 ( max_windows ),
+     .			wn_active( max_windows ),
+     .                  wn_xinches ( max_windows ),
+     .                  wn_yinches ( max_windows ),
+     .                  wn_xpixels ( max_windows ),
+     .                  wn_ypixels ( max_windows ),
+     .                  wn_xwhitelo ( max_windows ),
+     .                  wn_xwhitehi ( max_windows ),
+     .                  wn_ywhitelo ( max_windows ),
+     .                  wn_ywhitehi ( max_windows ),
+     .                  wn_pplscale ( max_windows ),
+     .                  wn_textscale ( max_windows ),
+     .                  wn_tics_lgx ( max_windows ),
+     .                  wn_tics_smx ( max_windows ),
+     .                  wn_tics_lgy ( max_windows ),
+     .                  wn_tics_smy ( max_windows ),
+     .                  wn_axlsze_x ( max_windows ),
+     .                  wn_axlsze_y ( max_windows ),
+     .                  wn_txlsze ( max_windows ),
+     .                  wn_labset_mn ( max_windows ),
+     .                  wn_labset_x ( max_windows ),
+     .                  wn_labset_y ( max_windows ),
+     .                  wn_labset_mv ( max_windows ),
+     .                  wn_con_hgt( max_windows ),
+     .                  wn_con_labsp( max_windows ),
+     .                  wn_con_dshln( max_windows ),
+     .                  wn_con_spcln( max_windows ),
+     .                  wn_vec_len( max_windows ),
+     .
+     .			vp_num,
+     .			vp_name ( mvp_dflt:max_viewport ),
+     .			vp_size ( mvp_dflt:max_viewport ),
+     .			vp_xorg ( mvp_dflt:max_viewport ),
+     .			vp_yorg ( mvp_dflt:max_viewport ),
+     .			vp_xclip( mvp_dflt:max_viewport ),
+     .			vp_yclip( mvp_dflt:max_viewport ),
+     .			vp_seg0 ( mvp_dflt:max_viewport ),
+     .			vp_segn ( mvp_dflt:max_viewport ),
+     .			vp_opaque(mvp_dflt:max_viewport ),
+     .			vp_by_axis(mvp_dflt:max_viewport ),
+     .
+     .			has_time_axis,
+     .			h_logaxis, 
+     .			v_logaxis,
+     .                  no_plot_yet,
+     .			saved_dt_min,
+     .			saved_t1_date,
+     .			transparent_color
diff --git a/fer/common/xpplus.cmn b/fer/common/xpplus.cmn
new file mode 100644
index 0000000..dfbc2a9
--- /dev/null
+++ b/fer/common/xpplus.cmn
@@ -0,0 +1,6 @@
+* COMMON for intercommunication of PPLUS parameters
+
+	INTEGER	icode
+
+	COMMON / XPPLUS / icode
+
diff --git a/fer/common/xprog_state.cmn b/fer/common/xprog_state.cmn
new file mode 100644
index 0000000..ed0c831
--- /dev/null
+++ b/fer/common/xprog_state.cmn
@@ -0,0 +1,307 @@
+* XPROG_STATE.CMN
+* COMMON declarations regarding state variables, command input,
+*	logical unit numbers, and logic flags
+*	added mode arguments
+* Unix/RISC port 1/91 - reordered variables for word alignment
+*		      - changed INTEGER to LOGICAL for mode_*****
+*		      - increased string length for "xwind_node"
+* V230: replaced list_dsf/tmap/unformatted with integer list_fmt_type
+*	1/93 commandeered meta_device for frame_compress
+* V300: 5/93 added modes ppllist and journal_file
+* V301: 1/94 renamed variable "meta_file" to "unused_char_var" to avoid name
+*		conflict with PLOT+ GKSCM2 COMMON
+*	1/94 increased command buffer size from 200 to 500
+*	2/94 incorporated a stack of past mode states
+* V320:12/94 added plist_stream
+* V420: 9/95 added plist_comma_del and plist_tab_del
+*	4/96 added controls for IF: if_*, pif_*, max_arg_list 20-->128
+* V450:11/96 added plist_cdf_cache
+* V510: 5/00 *sh* - added denig_xylim_msg_done. increased max_qual_list
+* V530:10/00 *sh* - increased input command buffer size to 2048
+*		  - increased max_item_list 25 -> 250
+*       4/01 *sh* - added in_get_grid_mode (for future use)
+*      10/01 *acm*- increased max_qual_list; CONTOUR needed more with /AXES=
+* V540:11/00 *sh* - added array last_cmnd_buff (formerly in get_prot_cmnd_data)
+* V550:12/02 *acm*- new MODE LOGO and MODE LABELS
+* V553: 8/03 *acm*- new scriptfile_name and state its_script
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+*       *acm* 6/04 - change ordering in the common block so compilers are happy
+* V580: *acm*10/04 - add silent_err, to be set true for SHOW VAR/XML when
+*                    checking for user variables not relevant to the context
+* V600: *acm* 5/06 - add new MODE LINECOLORS:[arg]
+* V600  *acm* 6/06 - add new MODE UPCASE_OUTPUT
+*       *jli* 8/06 - add plist_xml
+* V602 *acm*  1/07 - increase length of string list_format to resolve bug 1482
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V614  *acm* 10/08 - add new MODE NODATA_LAB
+* V6.6  *kms* 5/10 - add redirect_* variables and parameters for stdout/stderr redirection.
+* V6.7  *kms* 8/11 - moved one_cmnd_mode here since needed outside ferret_dispatch.F
+*       *kms*  2/12 Add pmode_ensemble_lab, pmode_forecast_lab,
+*                   mode_ensemble_lab, and mode_forecast_lab;
+*                   add E and F dimensions to ax_fmt and ax_dec_pt (set to nferdims)
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+* V6.8  *acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+*                 Remove mode_ensemble_lab, and mode_forecast_lab.
+*acm* 4/12 Remove MODE FOURDEE, using _E, _F, _M, _N instead, throughout.
+* V6.8  *acm  8/12 changes for SET LIST/OUTTYPE
+*acm* 8/12 New MODE shrink_ylab, see tickets 1896, 1958.
+* V685 *sh* 11/13 - added allowed_err. SHOW VAR/TREE to display despite errors
+* V690 *sh* 12/13 - added mode_auto_*, for automated curvilinear and sigma vars
+
+	INTEGER		cmnd_buff_len, max_qual_list, max_arg_list,
+     .			max_item_list, max_modes, mode_stack_size,
+     .			max_ifstk
+	PARAMETER     ( cmnd_buff_len = 2048,
+     .			max_qual_list = 60 ,	! increased from 50 3/12
+     .			max_arg_list  = 128 ,	! was 20 pre-4/96
+     .			max_item_list = 250 ,
+     .			max_modes     = 40 ,
+     .			mode_stack_size = 7,
+     .			max_ifstk     = 10 )
+
+	INTEGER		input_from_tty, input_from_file, input_from_cs
+	PARAMETER     ( input_from_tty		= 1,
+     .			input_from_file		= 2,
+     .			input_from_cs		= 3 )
+
+	INTEGER		pmode_diagnostic, pmode_verify, pmode_interpolate,
+     .			pmode_ignore_err, pmode_stupid, pmode_journal,
+     .			pmode_long_lab, pmode_lat_lab, pmode_depth_lab,
+     .			pmode_time_lab, pmode_6d_lab,
+     .			pmode_segment, pmode_font_ascii, pmode_wait,
+     .			pmode_reject, pmode_desperate, pmode_rpn,
+     .			pmode_gks, pmode_xwindows, pmode_metafile,
+     .			pmode_ppllist, pmode_gui, pmode_logo, pmode_labels,
+     .                  pmode_grat, pmode_linecolors, pmode_upcase_output,
+     .                  pmode_nlevels, pmode_nodata_lab, pmode_shrink_ylab,
+     .                  pmode_curvilinear, pmode_sigma
+
+	PARAMETER     ( pmode_diagnostic	= 1,
+     .			pmode_verify		= 2,
+     .			pmode_interpolate	= 3,
+     .			pmode_ignore_err	= 4,
+     .			pmode_stupid		= 5,
+     .			pmode_journal		= 6,
+     .			pmode_long_lab		= 7,
+     .			pmode_lat_lab		= 8,
+     .			pmode_depth_lab		= 9,
+     .			pmode_time_lab		= 10,
+     .			pmode_6d_lab		= 11,
+     .			pmode_font_ascii	= 12,
+     .			pmode_segment		= 13,
+     .			pmode_wait		= 14,
+     .			pmode_reject		= 15,
+     .			pmode_desperate		= 16 )
+	PARAMETER     ( 
+     .			pmode_rpn		= 17,
+     .			pmode_gks		= 18,
+     .			pmode_xwindows		= 19,
+     .			pmode_metafile		= 20,
+     .			pmode_ppllist		= 21,
+     .			pmode_gui		= 22,
+     .			pmode_logo		= 23,
+     .			pmode_labels		= 24,
+     .			pmode_grat		= 25,
+     .                  pmode_linecolors        = 26,
+     .                  pmode_upcase_output     = 27,
+     .                  pmode_nlevels           = 28,
+     .                  pmode_nodata_lab        = 29,
+     .                  pmode_shrink_ylab       = 30,
+     .			pmode_curvilinear	= 31,
+     .			pmode_sigma		= 32 )
+
+	CHARACTER	pmode_unused*10
+	PARAMETER     ( pmode_unused = '%% unused %%' )
+
+	INTEGER plist_default, plist_formatted, plist_unformatted,
+     .	        plist_epic, plist_gt, plist_ts, plist_cdf, plist_stream,
+     .		plist_comma_del, plist_tab_del, plist_cdf_cache, 
+     .		plist_dods, plist_xml
+	PARAMETER     (	plist_default	= 0,
+     .	 		plist_formatted	= 1,
+     .			plist_unformatted = 2,
+     .			plist_epic	= 3,
+     .			plist_gt	= 4,
+     .			plist_ts	= 5,
+     .			plist_cdf	= 6,
+     .			plist_stream	= 7,
+     .			plist_comma_del	= 8,
+     .			plist_tab_del	= 9,
+     .			plist_cdf_cache	= 10,
+     .			plist_dods	= 11,
+     .                  plist_xml       = 12 )
+
+	INTEGER		pif_skip_to_endif,
+     .			pif_doing_clause,
+     .			pif_skip_to_clause
+	PARAMETER     ( pif_skip_to_endif  = 1,
+     .			pif_doing_clause   = 2,
+     .			pif_skip_to_clause = 3 )
+
+*       Values for the redirect_*_flags.  Designed to be bit flags
+*       file = 0001, journal = 0010, commented = 0100, tee = 1000
+        INTEGER         redirect_none, redirect_file, redirect_journal,
+     .                  redirect_file_tee, redirect_journal_tee
+        PARAMETER     ( redirect_none        = 0,
+     .                  redirect_file        = 1,
+     .                  redirect_journal     = 6,
+     .                  redirect_file_tee    = 9,
+     .                  redirect_journal_tee = 14 )
+
+	INTEGER
+     .		prompt_len,
+     .		input_source,
+     .		cmnd_num, len_cmnd, len_last_cmnd, subcmnd_num,
+     .		num_qualifiers, qualifier_list, qual_start, qual_end,
+     .		qual_given,
+     .		num_args,  arg_start,  arg_end,
+     .		num_items, item_start, item_end,
+     .		list_digits,
+     .		mode_arg( max_modes, mode_stack_size ),
+     .		saved_dset,
+     .		saved_abstract_grid,
+     .		xwind_node_len,
+     .		genl_storage(25),
+     .		ifstk, if_cs(max_ifstk), if_doing(max_ifstk),
+     .          num_linecolors
+
+
+	LOGICAL
+     .		list_format_given, list_unformatted, list_dsf, list_redirected,
+     .		list_heading, list_append, list_tmap,
+     .		mouse_input,
+     .		mode_state( max_modes, mode_stack_size ),
+     .		frame_on,
+     .		interactive,
+     .		if_conditional,
+     .		denig_xylim_msg_done,
+     .		denig_pen_msg_done,
+     .		in_get_grid_mode,
+     .          its_script,
+     .          grat_on,
+     .          shade_trim,
+     .          silent_err,
+     .          allowed_err,
+     .          one_cmnd_mode,
+     .		mode_auto_curvi, mode_auto_curvi_last,
+     .		mode_auto_sigma, mode_auto_sigma_last
+
+
+! Note: available_char_var is unused
+	CHARACTER
+     .		cmnd_buff*2048,
+     .		last_cmnd_buff*2048,
+     .		prompt*8,
+     .		list_format*2048, list_file*2048, list_outtype*6,
+     .          show_file*2048,
+     .		mode_name( max_modes )*12,
+     .		frame_file*200,
+     .		ppl_wait*6,
+     .		frame_compress*8, available_char_var*80,
+     .		journal_file*80, ppllist_file*80,
+     .		xwind_node*40,
+     .          scriptfile_name*2048,
+     .          mode_grat_buff*512
+
+	INTEGER	ttin_lun, ttout_lun, cmnd_file_lun, list_lun,
+     .		cmnd_lun, jrnl_lun, err_lun, frame_lun, show_lun,
+     .		vms_kbd_id, vms_kbd_tbl,
+     .          redirect_stdout_lun, redirect_stderr_lun,
+     .          redirect_stdout_flags, redirect_stderr_flags
+
+* logical unit numbers
+	COMMON/ XLUN /
+     .		ttin_lun, ttout_lun, cmnd_file_lun, list_lun,
+     .		cmnd_lun, jrnl_lun, err_lun, frame_lun, show_lun,
+     .		vms_kbd_id, vms_kbd_tbl,
+     .          redirect_stdout_lun, redirect_stderr_lun,
+     .          redirect_stdout_flags, redirect_stderr_flags
+
+* program state information
+	COMMON/ XPROG_STATE /
+     .		interactive, prompt, prompt_len, 
+     .		input_source, mouse_input,
+     .		if_conditional, ifstk, if_cs, if_doing,
+     .          num_linecolors,
+     .		cmnd_buff, last_cmnd_buff,
+     .          mode_grat_buff,
+     .		len_cmnd, len_last_cmnd, cmnd_num, subcmnd_num,
+     .		num_qualifiers, qualifier_list(max_qual_list),
+     .		qual_start(max_qual_list), qual_end(max_qual_list),
+     .		qual_given(max_qual_list),
+     .		num_args,   arg_start(max_arg_list),  arg_end(max_arg_list),
+     .		num_items, item_start(max_item_list), item_end(max_item_list),
+     .		list_format_given, list_unformatted, list_dsf, list_redirected,
+     .		list_tmap,
+     .		list_format, list_digits, list_file,
+     .		list_heading, list_append, 
+     .		frame_on, frame_file,
+     .		mode_state, mode_arg,
+     .		saved_dset,
+     .		saved_abstract_grid,
+     .		denig_xylim_msg_done, denig_pen_msg_done,
+     .		in_get_grid_mode, 
+     .		mode_auto_curvi, mode_auto_curvi_last,
+     .		mode_auto_sigma, mode_auto_sigma_last,
+     .		frame_compress, available_char_var,
+     .		journal_file, ppllist_file,
+     .		xwind_node, xwind_node_len,
+     .		genl_storage, its_script, grat_on,
+     .          shade_trim, silent_err, allowed_err, one_cmnd_mode,
+     .		ppl_wait, mode_name, 
+     .          scriptfile_name, show_file, list_outtype
+
+* individual mode variable names
+	LOGICAL		mode_diagnostic, mode_verify, mode_interpolate,
+     .			mode_ignore_err, mode_stupid, mode_journal, 
+     .			mode_long_lab, mode_lat_lab, mode_depth_lab, 
+     .			mode_time_lab, mode_6d_lab,
+     .			mode_segment, mode_font_ascii, mode_wait,
+     .			mode_reject, mode_desperate, mode_rpn,
+     .			mode_gks, mode_xwindows, mode_metafile,
+     .			mode_ppllist, mode_gui, mode_logo, mode_labels,
+     .                  mode_grat, mode_linecolors, mode_upcase_output, 
+     .                  mode_nlevels, mode_nodata_lab, mode_shrink_ylab
+	EQUIVALENCE
+     .		( mode_state( pmode_diagnostic  ,1), mode_diagnostic  ),
+     .		( mode_state( pmode_verify      ,1), mode_verify      ),
+     .		( mode_state( pmode_interpolate ,1), mode_interpolate ),
+     .		( mode_state( pmode_ignore_err  ,1), mode_ignore_err  ),
+     .		( mode_state( pmode_stupid      ,1), mode_stupid      ),
+     .		( mode_state( pmode_journal     ,1), mode_journal     ),
+     .		( mode_state( pmode_long_lab    ,1), mode_long_lab    ),
+     .		( mode_state( pmode_lat_lab     ,1), mode_lat_lab     ),
+     .		( mode_state( pmode_depth_lab   ,1), mode_depth_lab   ),
+     .		( mode_state( pmode_time_lab    ,1), mode_time_lab    ),
+     .		( mode_state( pmode_6d_lab      ,1), mode_6d_lab      ),
+     .		( mode_state( pmode_font_ascii  ,1), mode_font_ascii  ),
+     .		( mode_state( pmode_segment     ,1), mode_segment     ),
+     .		( mode_state( pmode_wait        ,1), mode_wait        ),
+     .		( mode_state( pmode_reject      ,1), mode_reject      ),
+     .		( mode_state( pmode_desperate   ,1), mode_desperate   ),
+     .		( mode_state( pmode_rpn         ,1), mode_rpn         ),
+     .		( mode_state( pmode_gks         ,1), mode_gks         ),
+     .		( mode_state( pmode_xwindows    ,1), mode_xwindows    ),
+     .		( mode_state( pmode_metafile    ,1), mode_metafile    ),
+     .		( mode_state( pmode_ppllist     ,1), mode_ppllist     ),
+     .		( mode_state( pmode_gui         ,1), mode_gui         ),
+     .		( mode_state( pmode_logo        ,1), mode_logo        ),
+     .		( mode_state( pmode_labels      ,1), mode_labels      ),
+     .		( mode_state( pmode_grat        ,1), mode_grat        ),
+     .		( mode_state( pmode_linecolors  ,1), mode_linecolors  ),
+     .		( mode_state( pmode_upcase_output,1),mode_upcase_output),
+     .		( mode_state( pmode_nlevels     ,1), mode_nlevels     ),
+     .		( mode_state( pmode_nodata_lab  ,1), mode_nodata_lab  ),
+     .		( mode_state( pmode_shrink_ylab ,1), mode_shrink_ylab  )
+
+* axis label modes
+*     assumes sequential long, lat, depth, time, ensemble, forecast pmode values
+	LOGICAL		ax_fmt(nferdims)
+	INTEGER		ax_dec_pt(nferdims)
+	EQUIVALENCE	( mode_state( pmode_long_lab, 1 ), ax_fmt    ),
+     .			( mode_arg  ( pmode_long_lab, 1 ), ax_dec_pt )
+
+* list format types consolidated (6/92)
+	INTEGER	 	list_fmt_type
+	EQUIVALENCE	( list_fmt_type, list_dsf )
diff --git a/fer/common/xpyvar_info.cmn b/fer/common/xpyvar_info.cmn
new file mode 100644
index 0000000..6069c33
--- /dev/null
+++ b/fer/common/xpyvar_info.cmn
@@ -0,0 +1,34 @@
+*
+* information about static variables coming from Python (pyferret.put)
+*
+      INTEGER     maxpyvars
+      PARAMETER ( maxpyvars = 500 )
+*     memory for a C pointer to an allocated hash set
+      REAL*8        pyvar_code_head
+      REAL*8        pyvar_code_padding
+*
+      INTEGER*8     pyvar_ndarray_obj
+      REAL          pyvar_missing_flag
+      INTEGER       pyvar_dset_number
+      INTEGER       pyvar_grid_number
+      INTEGER       pyvar_grid_start
+      INTEGER       pyvar_grid_end
+      INTEGER       pyvar_type
+      CHARACTER*128 pyvar_code
+      CHARACTER*128 pyvar_title
+      CHARACTER*64  pyvar_units
+*
+      COMMON/ XPYVAR_INFO /
+     .         pyvar_code_head,
+     .         pyvar_code_padding,
+     .         pyvar_ndarray_obj(maxpyvars),
+     .         pyvar_missing_flag(maxpyvars),
+     .         pyvar_dset_number(maxpyvars),
+     .         pyvar_grid_number(maxpyvars),
+     .         pyvar_grid_start(nferdims,maxpyvars),
+     .         pyvar_grid_end(nferdims,maxpyvars),
+     .         pyvar_type(maxpyvars),
+     .         pyvar_code(maxpyvars),
+     .         pyvar_title(maxpyvars),
+     .         pyvar_units(maxpyvars)
+
diff --git a/fer/common/xregrid.cmn b/fer/common/xregrid.cmn
new file mode 100644
index 0000000..6d5f145
--- /dev/null
+++ b/fer/common/xregrid.cmn
@@ -0,0 +1,14 @@
+* initialization data for calendar axis regridding
+* see full description in tdest_world.F
+
+	LOGICAL		tcnvrt_ok
+	INTEGER		cnvrt_src_grid
+	REAL*8		tcnvrt_slope, tcnvrt_intercept
+
+	COMMON/ XREGRID /
+     .			cnvrt_src_grid,
+     .			tcnvrt_ok,
+     .			tcnvrt_slope,
+     .			tcnvrt_intercept
+
+
diff --git a/fer/common/xrevision.cmn b/fer/common/xrevision.cmn
new file mode 100644
index 0000000..a35cb19
--- /dev/null
+++ b/fer/common/xrevision.cmn
@@ -0,0 +1,9 @@
+* XREVISION.CMN
+
+	COMMON/ XREVISION /	program_name, len_program_name,
+     .				progname_mod, len_progname_mod,
+     .				revision_level
+
+	INTEGER		len_program_name, len_progname_mod
+	CHARACTER*20	program_name, progname_mod
+	REAL		revision_level
diff --git a/fer/common/xrevision_type.cmn b/fer/common/xrevision_type.cmn
new file mode 100644
index 0000000..7f354c1
--- /dev/null
+++ b/fer/common/xrevision_type.cmn
@@ -0,0 +1,6 @@
+* XREVISION_TYPE.CMN
+
+	COMMON/ XREVISION_TYPE / revision_type
+
+	CHARACTER*20 revision_type
+
diff --git a/fer/common/xrisc.cmn b/fer/common/xrisc.cmn
new file mode 100644
index 0000000..d697003
--- /dev/null
+++ b/fer/common/xrisc.cmn
@@ -0,0 +1,20 @@
+* XRISC - *sh* 2/1/91
+* RISC/FORTRAN compiler can't handle CHARACTER*(*) variables used in
+* character string concatenations ("//")
+* this common declares a buffer with a fixed length string in which to copy
+* the CHAR*(*) string
+
+* V5.0 - 8/99 *sh* this buffer is now used throughtout Ferret. When used during
+* symbol substitution and grave accent evals on command it limits the
+* command line length. So increase the buffer size.
+* V530 10/00 - increased to 2048 (should be at least as large as len_cmnd_buf)
+
+	INTEGER     size_rbuff
+	PARAMETER ( size_rbuff = 2048 )  ! was 256 pre 8/99
+
+	COMMON/ XRISC / len_rbuff, risc_buff
+	CHARACTER  risc_buff*(size_rbuff)
+	INTEGER    len_rbuff
+
+
+
diff --git a/fer/common/xtext_info.cmn b/fer/common/xtext_info.cmn
new file mode 100644
index 0000000..3e55f3b
--- /dev/null
+++ b/fer/common/xtext_info.cmn
@@ -0,0 +1,29 @@
+* XTEXT_INFO.CMN
+* pre-defined text strings for Program GFDL
+* 11/21/88 axis_orients moved to TMAP_FORMAT:XTM_GRID.CMN
+*   2/12 *kms* Add E and F dimensions to ww_dim_name, ss_dim_name,
+*              axis_title, and axis_title_len (set to nferdims)
+
+	INTEGER		num_reqd_file_vars
+	PARAMETER     ( num_reqd_file_vars = 9 )
+
+	CHARACTER*1	ww_dim_name( nferdims ),
+     .			ss_dim_name( nferdims )
+	CHARACTER*4	fvar_name_code( num_reqd_file_vars )
+	CHARACTER*9	axis_title( nferdims )
+	INTEGER		axis_title_len( nferdims )
+	CHARACTER*8	date_labels ( 6 )
+	INTEGER		date_str_len( 6 )
+	CHARACTER*16	unit_text   ( 15 )
+	CHARACTER*8	verify_modes( 3 )
+
+	COMMON /XTEXT_INFO/
+     .		axis_title_len,
+     .		date_str_len,
+     .		ww_dim_name,
+     .		ss_dim_name,
+     .		fvar_name_code,
+     .		axis_title,
+     .		date_labels,
+     .		unit_text,
+     .		verify_modes
diff --git a/fer/common/xtoday.cmn b/fer/common/xtoday.cmn
new file mode 100644
index 0000000..121324a
--- /dev/null
+++ b/fer/common/xtoday.cmn
@@ -0,0 +1,16 @@
+* XTODAY.CMN
+* 2/97 *kob* bumped up today_time from char*8 to char*10 for usage with
+*	f90 date_and_time routine
+* 2/10 *acm* Changes for CLOCK symbols that work with gfortran as well as g77.
+*            see special_symbol.F
+* *acm* v68  1/12 move window title to xtoday.cmn.
+
+
+	COMMON/ XTODAY /cpu_last, clock_start_count, 
+     .        today_date, today_time, window_title
+
+	CHARACTER*9 today_date
+	CHARACTER*10 today_time
+	CHARACTER*64 window_title
+	INTEGER clock_start_count
+	REAL*8 cpu_last
diff --git a/fer/common/xvariables.cmn b/fer/common/xvariables.cmn
new file mode 100644
index 0000000..989dd3b
--- /dev/null
+++ b/fer/common/xvariables.cmn
@@ -0,0 +1,442 @@
+* XVARIABLES.CMN - COMMON/ XVARIABLES /
+* array declarations and information for variables stored in memory and
+* information on variables that can be computed
+* variable-naming:
+* 2/88 - removed "num_file_vars"
+* 3/88 - modulo_var_pri 2000 --> 100000
+* 7/88 - added mv_flink/blink and mblk_flink/size for
+*	 efficient memory management  -  eliminated blk_in_use
+*      - split into 3 distinct COMMON areas:
+*	XBLOCK_MEM - with array memory, only
+*	XMR	   - with memory variable information
+*	XINTERP    - with instance table and interpretation stack information
+* 8/88 - dummy_mr moved from FERRET.PARM to here
+* 1/89 - added mr_unstand_grid and mr_regrid_trans
+* V200:  5/89 - major changes for FERRET 2.00.  4D-symmetrical memory variables
+* 	      - delete priorities handled through linked lists
+*	      - eliminated "named" variables ("nvar")
+*	      - all cvar-related stuff into XCALC_VARS
+* 	 2/90 - max_uvars 20 --> 100
+* V200 Unix/RISC port - eliminated REAL*8 boundary alignment problem
+*		        by placing REAL*8 variables first
+*    10/22/92 - added uvar_units, increased uvar_name_code to *24,
+*	        increased max_uvar to 250
+* V301: increased mem_blk_size x4  !!!
+* V312: 5/17/94  removed "memory" array from COMMON altogether
+
+* V402: 7/20/95 - added uvar_dset (for LET/D=...)
+* V420: 11/95   - added hash pile for "un_cached" results
+*	12/95	- added uvar_mod_pseudo to postpone modulo ops on uvars with
+*		  pseudo vars X,Y,Z,T,I,J,K, or L
+* V450: 7/97   - added uvar_parent and increates max_uvar
+* V491: 12/97  - increased max_uvar_items from 40 to 100 *kob*
+* v500: 3/99 - increased uvar_name_code, uvar_units to 64 and uvar_title
+*              to 128
+* V510: 8/99 *sh* allow other categories of cached mvars (mpv_nocache area)
+*	12/99 *sh* added uvar_lo/hi_ss/ww and uvar_by_ss
+*		(also fixed messed up comments)
+* V510: 5/00 *sh* added variable uvar_bad_data
+* V530: 8/00 *sh* added variable mr_c_pointer and mr_type
+* 	10/00 *sh* - increased max_intrp to support more complex commands
+*		     and uvar_text_len to support longer expressions
+* V533: 6/01 *sh* added variable mr_delta
+*	7/01 *sh* added variable uvar_data_type
+* V534: 9/01 *sh* doubled default memory size
+* v5.50 *acm*9/02 - up max_uvar from 400 to 2000
+* v552  *acm4/03 - increase uvar_name_code to 128 (also change test in xeq_define)
+* V600 2/06 *kob* - declare uvar_name_code_head etc as double, for 64-bit build
+* V608 9/07 *acm*  increase uvar_text_len to 2048; var defs can contain long URLs
+* V609 1/08 *acm*  increase max_mrs, pmv_npiles, max_intrp and max_uvar_items. 
+*                  The first 3 of these needed for LAS scripts doing comparisons 
+*                  along with seasonal averages; max_uvar_items reported once or 
+*                  twice as a limit that users have run into.
+* V61  3/08 *acm*  increase max_mrs again to 501.
+* V62  2/09 *acm*  increase initial memory by 4.
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*       2/12 *kms* Add E and F dimensions (set to nferdims);
+*                  added mr_lo_s5 & 6, mr_hi_s5 & 6;
+*                  reordered to remove padding
+* V685 1/13  *acm* implement LET/REMOTE
+* V690 9/13-1/14 *sh*  added aux var regridding,
+*	           including is_aux_ptr, and uvar_curvi_var/cat
+*		   added space at the top of the isp stack for nferdims auxvars
+
+* Terminology:
+*	"mr"	- "memory resident"
+*	("mv")	  table of information about variables currently stored in
+*		  memory
+*	"mblk"	- related to management of array "memory" where bulk data is
+*		  stored
+*	"uvar"	- information about user-defined variables (and implicit user-
+*		  defined variables given as command arguments)
+*	"is"	- pertaining to the "interpretation stack" on which user 
+*		  variables are evaluated, axis transformations are executed
+*		  and grids in awkward planes are assembled
+
+* BULK MEMORY MANAGEMENT:
+*  The free bulk memory list is organized as follows:
+*     o Each contiguous region of free memory is identified by its starting
+*	block number in from array "memory" - usually "mblk"
+*     o Each contiguous region of free memory contains its size (mblk_size)
+*	and link pointers to the surrounding free regions (mblk_&link)
+*     o The linked list is ordered by increasing mblk value
+*  Bulk memory in use is removed from the free list.  Its starting block #
+*   is found in "mr_blk1" (of the memory resident table) of the variable
+*   using this memory.  Its size is redundantly stored (an historical artifact)
+*   in both "mr_nblks" and mblk_size( start_block )
+
+* MEMORY RESIDENT TABLE MANAGEMENT:
+*  The slots of the memory variable table are organized as a number of doubly
+*   linked lists using mv_flink & mv_blink.  When a variable is to be stored in
+*   memory its context (data set, variable, category, etc.) is hashed to 
+*   produce a pile number (which linked list contains it).  This greatly
+*   reduces the number of table slots that must be searched locating a variable
+*   in memory.  The start link for each list is in subscript -1*pile# of
+*   mv_flink.
+*  Unused table slots are organized into a singly linked list starting at
+*   subscript 0 of mv_flink.
+
+* DELETION PRIORITIES
+*  Deletion priorities are handled through a doubly linked deletion priority
+*   list.  The most recently used/acquired variables are added to the head of
+*   the list indicating the lowest priority for deletion.  Variables may be
+*   removed from the list if they are in-progress or in-use.  See mr_protected.
+
+* explanation of selected variables:
+*	mr_blk1     - First memory block of contiguous storage for this var.
+*	mr_nblks    -	Number of contiguous storage blocks for this variable
+*			See further documemtation in GET_MEMORY
+*	mr_trans    - designates what mathematical transformations have been
+*			applied to the data along each axis (see FERRET.PARM)
+*	mv_flink      - forward and backwards links into the memory variable
+*	mv_blink	table.  Stored variables are hashed into pmv_npiles
+*			piles with start pointers stored in the negative
+*			subscripts of these arrays
+*	mblk_flink    - sizes and links of free contiguous regions
+*	mblk_size	available in array "memory"
+*	mblk_blink
+*
+*	mr_del_flink  -	forward and backwards links for the chain of variables
+*	mr_del_blink	that are available to be deleted if memory space runs
+*			short
+*	mr_del_last_mblk - memory region freed by the last deletion
+*	mr_del_last_size - size of that memory region
+*
+*	mr_protected  - flags variables as "deleted", "in_progress",
+*			"perm_protrcted" or "not_protected".  Variables which
+*			are needed as future components of calculations may
+*			be reserved (protecting them from deletion) by
+*			incrementing mr_protected.  This mechanism allows
+*			multiple calculations to claim the same component and
+*			still easily keep track of when all claims on the
+*			component have been released.
+*	
+*       mr_naux   	- number of auxiliary variables used in regridding
+*  	mr_aux_var,_cat	- var and cat of auxiliary vars (always in parent dset)
+*	uvar_title	- title text for plots, etc. of user-defined variables
+*	uvar_title_w_text
+*			- logical to determine if variable definition is part 
+*			  of title
+*	uvar_name_code	- 128 character user variable name
+*	uvar_units	- units string for variable
+*	uvar_text	- text of the algebraic expression defining the variable
+*	uvar_num_items	- number of "items" (functions,variables,operators,...)
+*			  in the text
+*	uvar_item_type	- coded (see alg_ in GFDLPROGRAM.PARM) item types
+*	uvar_item_start	- positions in text for starts of item text substrings
+*	uvar_item_end	- positions in text for ends   of item text substrings
+*	uvar_grid	- defining grid for the expression
+*	uvar_data_type	- data type for the expression
+*	uvar_aux_var	- points to the curvi aux coord var for each axis
+*	uvar_aux_cat	- points to the curvi aux coord var for each axis
+*	uvar_aux_stat	- tells if aux axis has been regridded or remains free
+*	uvar_need_dset  - flag if the uvar def'n is independent of dset
+*	uvar_given	- indicate degree to which definition of uvar specifies
+*			  limits along each axis
+*	uvar_dset	- name of data set to which uvar **belongs** (7/95)
+*	uvar_by_ss	- when uvlims are given in expression this tells how
+*	uvar_lo/hi_ss	- when uvlims are given in expression this tells what
+*	uvar_lo/hi_ww	- when uvlims are given in expression this tells what
+*	uvar_bad_data	- missing value flag to be used for this variable
+*	has_uvar_gc	- variable is a grid-changing variable
+
+*	isp	 	- interpretation stack pointer
+*	is_act   	- activity currently in progress
+*	is_cx		- default context buffer at current stack level
+*	is_big_cx	- context of full expression at current stack level
+*	is_phase 	- current  looping value for stack level
+*	is_obj   	- class of object for stack level
+*	is_axis  	- grid axis of transformation for this level
+*	is_uvar  	- pointer to text,name,etc. of uvar
+*	is_mr		- pointer to memory grid for result
+*	is_sum   	- stores a value that is accumulated at stack level
+*	is_aux_ptr      - pointer to nferdims of curvilinear vars at stack top
+
+*	uvar_remote	- is the user-variable a LET/REMOTE variable
+*	rvar_on_server	- indicates if F-TDS server knows about the LET def
+*	rvar_uvar	- associates the remote variable with a uvar
+*	rvar_dset	- dataset that hosts the remote definition
+*	rvar_varid	- netCDF var id of the remotely defined variable
+
+********************************************************************************
+******			PARAMETER DEFINITIONS				  ******
+
+* memory storage capacity
+	INTEGER		max_mrs,
+     .			max_mr_avail,
+     .			pmem_blk_size,
+     .			pmax_mem_blks,
+     .			pmv_npiles,
+     .			pmv_nocache_pile,
+     .			pmv_work_var_pile,
+     .			pmv_adjoint_var_pile,
+     .			pmv_lowest_head,
+     .			dummy_mr
+	PARAMETER     ( max_mrs   = 501,
+     .			dummy_mr  = max_mrs,
+     .			max_mr_avail = max_mrs - 1,
+     .			pmem_blk_size = 2*(160*100*4/10), !2* 9/01 see ferret.h
+     .			pmax_mem_blks   = 2000,
+     .			pmv_npiles     = 299,	! prime # of hash piles
+     .			pmv_nocache_pile = -pmv_npiles - 1,
+     .			pmv_work_var_pile = -pmv_npiles - 2,
+     .			pmv_adjoint_var_pile = -pmv_npiles - 3,
+     .			pmv_lowest_head = -pmv_npiles - 5)  ! -4, -5 unused
+! pmv_adjoint_pile reserved for future EF's returning multiple results
+
+	INTEGER		max_uvar,
+     .			max_uvar_items,
+     .			uvar_text_len,
+     .			max_intrp,
+     .			max_rvar
+	PARAMETER     (	max_uvar      	  = 2000,! total # uvars incl. "EX#."
+     .			max_uvar_items    =  200,! complexity of uvar expression
+     .			uvar_text_len	  = 2048,! max length of uvar expression
+     .			max_intrp	  =  400 ,! max depth of interp stack
+     .			max_rvar	  = 2000  )
+
+********************************************************************************
+******				COMMON DECLARATION			  ******
+
+	COMMON / XMEM_DESCR /
+     .		mem_blk_size,
+     .		max_mem_blks
+
+* Reordered as REAL*8, REAL (which may be REAL*8 or REAL*4), INTEGER, LOGICAL,
+* CHARACTER to eliminate padding requirements from the compiler.
+* uvar_name_code_head should be immediately followed by uvar_name_code_padding
+* uvar_num_items_head should be immediately followed by uvar_num_items_padding
+	COMMON / XMR / 
+     .		mr_lo_ww	( nferdims, max_mrs ),
+     .		mr_hi_ww	( nferdims, max_mrs ),
+     .		mr_delta	( nferdims, max_mrs ),
+     .		uvar_lo_ww	( nferdims, max_uvar ),
+     .		uvar_hi_ww	( nferdims, max_uvar ),
+     .		mr_c_pointer    ( max_mrs ),
+     .          uvar_name_code_head,
+     .          uvar_name_code_padding,
+     .          uvar_num_items_head,
+     .          uvar_num_items_padding,
+     .
+     .		mr_trans_arg	( nferdims, max_mrs ),
+     .		mr_bad_data   	( max_mrs ),
+     .		uvar_bad_data	( max_uvar ),
+     .		is_sum  	( max_intrp ),
+     .
+     .		mr_trans	( nferdims, max_mrs ),
+     .		mr_regrid_trans	( nferdims, max_mrs ),
+     .		mr_lo_ss	( max_mrs, nferdims ),
+     .		mr_hi_ss	( max_mrs, nferdims ),
+     .		mr_protected	( max_mrs ),
+     .		mr_blk1		( max_mrs ),
+     .		mr_nblks	( max_mrs ),
+     .		mr_data_set	( max_mrs ),
+     .		mr_category	( max_mrs ),
+     .		mr_variable	( max_mrs ),
+     .		mr_grid   	( max_mrs ),
+     .		mr_type   	( max_mrs ),
+     .		mr_naux   	( max_mrs ),
+     .		mr_aux_var	( nferdims, max_mrs ),
+     .		mr_aux_cat	( nferdims, max_mrs ),
+     .		mblk_flink      ( 0:pmax_mem_blks ),
+     .		mblk_blink      ( 0:pmax_mem_blks ),
+     .		mblk_size       ( 0:pmax_mem_blks ),
+     .		mv_flink        ( pmv_lowest_head:max_mrs ),
+     .		mv_blink        ( pmv_lowest_head:max_mrs ),
+     .		mr_del_flink    ( 0:max_mrs ),
+     .		mr_del_blink    ( 0:max_mrs ),
+     .		mr_del_last_mblk,
+     .		mr_del_last_size,
+     .		num_uvars_in_cmnd,
+     .		uvar_lo_ss	 ( max_uvar, nferdims ),
+     .		uvar_hi_ss	 ( max_uvar, nferdims ),
+     .		uvar_num_items   ( max_uvar ),
+     .		uvar_parent	 ( max_uvar ),
+     .		uvar_grid	 ( max_uvar, 0:max_gfdl_dsets ),
+     .		uvar_data_type	 ( max_uvar, 0:max_gfdl_dsets ),
+     .		uvar_aux_var	 ( max_uvar, nferdims, 0:max_gfdl_dsets ),
+     .		uvar_aux_cat	 ( max_uvar, nferdims, 0:max_gfdl_dsets ),
+     .		uvar_aux_stat	 ( max_uvar, nferdims ),
+     .		uvar_item_start	 ( max_uvar_items, max_uvar ),
+     .		uvar_item_end	 ( max_uvar_items, max_uvar ),
+     .		uvar_item_type	 ( max_uvar_items, max_uvar ),
+     .		uvar_given	 ( nferdims, max_uvar ),
+     .		uvar_dset	 ( max_uvar ),
+     .		uvar_remote	 ( max_uvar ),
+     .		rvar_on_server	 ( max_rvar ),
+     .		rvar_uvar	 ( max_rvar ),
+     .		rvar_dset	 ( max_rvar ),
+     .		rvar_varid	 ( max_rvar ),
+     .          deleted_list_result(max_uvar),
+     .          string_array_result(max_uvar),
+     .		max_usable_intrp,
+     .		isp,
+     .		is_act		( max_intrp ),
+     .		is_cx		( max_intrp ),
+     .		is_big_cx	( max_intrp ),
+     .		is_phase	( max_intrp ),
+     .		is_obj  	( max_intrp ),
+     .		is_axis 	( max_intrp ),
+     .		is_uvar 	( max_intrp ),
+     .		is_mr		( max_intrp ),
+     .		is_aux_ptr 	( max_intrp ),
+     .
+     .		mr_unstand_grid	 ( max_mrs ),
+     .		uvar_by_ss	 ( nferdims, max_uvar ),
+     .		uvar_mod_pseudo	 ( nferdims, max_uvar ),
+     .		uvar_ifv	 ( max_uvar ),
+     .		uvar_title_w_text( max_uvar ),
+     .		uvar_need_dset	 ( max_uvar ),
+     .		has_uvar_gc,
+     .
+     .		uvar_text	 ( max_uvar ),
+     .		uvar_title	 ( max_uvar ),
+     .		uvar_name_code	 ( max_uvar ),
+     .		uvar_units	 ( max_uvar )
+
+********************************************************************************
+******			COMMON VARIABLE TYPE DECLARATIONS		  ******
+
+	INTEGER	mem_blk_size,
+     .		max_mem_blks
+
+	INTEGER	mblk_flink,
+     .		mblk_blink,
+     .		mblk_size
+
+	INTEGER	mv_flink,
+     .		mv_blink,
+     .		mr_del_flink,
+     .		mr_del_blink,
+     .		mr_del_last_mblk,
+     .		mr_del_last_size
+
+	INTEGER		num_uvars_in_cmnd
+
+	LOGICAL		mr_unstand_grid
+
+	REAL		mr_bad_data  	,
+     .			mr_trans_arg	,
+     .			uvar_bad_data
+
+	REAL*8		mr_lo_ww	,
+     .			mr_hi_ww	,
+     .			mr_delta	,
+     .			uvar_lo_ww	,
+     .			uvar_hi_ww	,
+     .			mr_c_pointer      ! see note
+! Note: the actual data type for mr_c_pointer is **char
+! we allocate 8 bytes for 64-bit pointers
+
+	INTEGER		mr_lo_ss	,
+     .			mr_hi_ss	,
+     .			mr_trans	,
+     .			mr_data_set	,
+     .			mr_category	,
+     .			mr_variable	,
+     .			mr_protected	,
+     .			mr_blk1		,
+     .			mr_nblks	,
+     .			mr_grid 	,
+     .			mr_type 	,
+     .			mr_naux		,
+     .			mr_aux_var	,
+     .			mr_aux_cat	,
+     .			mr_regrid_trans
+
+	CHARACTER*128	uvar_title, uvar_name_code
+	CHARACTER*64	uvar_units
+	CHARACTER*2048	uvar_text	
+	LOGICAL		uvar_title_w_text,
+     .			uvar_need_dset,
+     .			uvar_mod_pseudo,
+     .			uvar_by_ss,
+     .			has_uvar_gc,
+     .			uvar_ifv,
+     .			uvar_remote,
+     .			rvar_on_server
+	REAL*8          uvar_name_code_head,
+     .                  uvar_name_code_padding,       
+     .                  uvar_num_items_head,
+     .                  uvar_num_items_padding
+        INTEGER		uvar_num_items  ,
+     .			uvar_grid	,
+     .			uvar_data_type	,
+     .			uvar_aux_var	,
+     .			uvar_aux_cat	,
+     .			uvar_aux_stat	,
+     .			uvar_item_start	,
+     .			uvar_item_end	,
+     .			uvar_item_type	,
+     .			uvar_given	,
+     .			uvar_parent	,
+     .			uvar_dset       ,
+     .			uvar_lo_ss	,
+     .			uvar_hi_ss      ,
+     .                  deleted_list_result,
+     .                  string_array_result,
+     .			rvar_uvar,
+     .			rvar_dset,
+     .			rvar_varid
+
+	INTEGER		isp,
+     .			max_usable_intrp,
+     .			is_act  ,
+     .			is_cx ,
+     .			is_big_cx ,
+     .			is_phase,
+     .			is_obj  ,
+     .			is_axis ,
+     .			is_uvar ,
+     .			is_mr,
+     .			is_aux_ptr
+	REAL		is_sum
+
+* equivalences to assist with declaration statements
+	INTEGER mr_lo_s1( max_mrs ),
+     .		mr_lo_s2( max_mrs ),
+     .		mr_lo_s3( max_mrs ),
+     .		mr_lo_s4( max_mrs ),
+     .		mr_lo_s5( max_mrs ),
+     .		mr_lo_s6( max_mrs ),
+     .		mr_hi_s1( max_mrs ),
+     .		mr_hi_s2( max_mrs ),
+     .		mr_hi_s3( max_mrs ),
+     .		mr_hi_s4( max_mrs ),
+     .		mr_hi_s5( max_mrs ),
+     .		mr_hi_s6( max_mrs )
+	EQUIVALENCE
+     .		( mr_lo_s1, mr_lo_ss(1,1) ),
+     .		( mr_lo_s2, mr_lo_ss(1,2) ),
+     .		( mr_lo_s3, mr_lo_ss(1,3) ),
+     .		( mr_lo_s4, mr_lo_ss(1,4) ),
+     .		( mr_lo_s5, mr_lo_ss(1,5) ),
+     .		( mr_lo_s6, mr_lo_ss(1,6) ),
+     .		( mr_hi_s1, mr_hi_ss(1,1) ),
+     .		( mr_hi_s2, mr_hi_ss(1,2) ),
+     .		( mr_hi_s3, mr_hi_ss(1,3) ),
+     .		( mr_hi_s4, mr_hi_ss(1,4) ),
+     .		( mr_hi_s5, mr_hi_ss(1,5) ),
+     .		( mr_hi_s6, mr_hi_ss(1,6) )
+
diff --git a/fer/common/xvideo.cmn b/fer/common/xvideo.cmn
new file mode 100644
index 0000000..b2cd284
--- /dev/null
+++ b/fer/common/xvideo.cmn
@@ -0,0 +1,2 @@
+	character odr_resp*(80)
+	common /odr_response_block/odr_resp
diff --git a/fer/common/xwindow_state.cmn b/fer/common/xwindow_state.cmn
new file mode 100644
index 0000000..c3f0268
--- /dev/null
+++ b/fer/common/xwindow_state.cmn
@@ -0,0 +1,11 @@
+*XWINDOW_STATE.CMN
+* Was a locally declared common block in plt/disp_set_up.F but the Linux
+* f90 compiler would not allow it.  I moved it to it's own file.  *kob* 1/97
+
+*		==> COMMON XWINDOW_STATE has been created **temporarily**
+*		    with the intention that it will be expanded in future
+*		    so overlays can be placed on **previously** drawn windows
+	COMMON /XWINDOW_STATE/ haxlo, haxhi, vaxlo, vaxhi
+	REAL*8  haxlo, haxhi, vaxlo, vaxhi
+* pre-initialize to [0,1] limits just to avoid misbehavior from non-init
+*	DATA  haxlo, haxhi, vaxlo, vaxhi/0.D0,1.D0,0.D0,1.D0/
diff --git a/fer/common/xwork_space.cmn b/fer/common/xwork_space.cmn
new file mode 100644
index 0000000..d3feb76
--- /dev/null
+++ b/fer/common/xwork_space.cmn
@@ -0,0 +1,7 @@
+* XWORK_SPACE.CMN
+* describes region of temporary work space allocated by GET_WORK_SPACE
+
+	COMMON / XWORK_SPACE / sp_last_size, sp_start_block, sp_num_blocks
+
+	INTEGER	sp_last_size, sp_start_block, sp_num_blocks
+
diff --git a/fer/ctx/LIB_NAME b/fer/ctx/LIB_NAME
new file mode 100644
index 0000000..55c8770
--- /dev/null
+++ b/fer/ctx/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libctx.a 
diff --git a/fer/ctx/Makefile b/fer/ctx/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/ctx/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/ctx/SOURCE_FILES b/fer/ctx/SOURCE_FILES
new file mode 100644
index 0000000..17674f5
--- /dev/null
+++ b/fer/ctx/SOURCE_FILES
@@ -0,0 +1,52 @@
+SRCS_F = \
+add_rdc_xform.F\
+addl_cx_doc.F\
+apply_auto_curv.F\
+apply_context_mods.F\
+apply_delta_context.F\
+aux_axis_from_arg.F\
+cgrid_axis.F\
+cgrid_size.F\
+cgrid_size_max.F\
+complete_missing_limits.F\
+confine_context.F\
+create_new_context.F\
+cs_set_context.F\
+cx_dim_len.F\
+cx_dim_len_zero.F\
+cx_ww_pos.F\
+del_cx_dim.F\
+flesh_out_axis.F\
+forget_past_context_mods.F\
+get_auto_aux_vars.F\
+get_aux_var_context.F\
+get_context_bad_flag.F\
+get_context_grid.F\
+get_cx_dims.F\
+get_cx_dims_zero.F\
+get_cx_modulo_axes.F\
+get_delta_context.F\
+get_new_cx.F\
+get_var_context.F\
+get_var_grid.F\
+grp_cx_doc.F\
+inherited_limits.F\
+init_context_mods.F\
+init_empty_context.F\
+known_data_type.F\
+merge_axis_with_offsets.F\
+merge_context.F\
+merge_grid.F\
+mergify_cx.F\
+nest_region_class.F\
+ov_grp_cx_doc.F\
+ovsiz_cx.F\
+parse_nam_dset.F\
+parse_var_name.F\
+plotify_grp_cx.F\
+pseudo_var_context.F\
+reconcile_com_dst_cx.F\
+region_class.F\
+restrict_file_limits.F\
+set_doc_flag.F\
+transfer_context.F 
diff --git a/fer/ctx/add_rdc_xform.F b/fer/ctx/add_rdc_xform.F
new file mode 100644
index 0000000..93d8875
--- /dev/null
+++ b/fer/ctx/add_rdc_xform.F
@@ -0,0 +1,150 @@
+      SUBROUTINE ADD_RDC_XFORM ( cx, status )
+
+* add a hidden @RDC transform if appropriate
+
+* programmer - jonathan callahan
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* version 5.0 - 10/20/98
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *kms* 4/13 change RETURN's in middle of idim loop to GOTO 100's
+
+* The @RDC ("reduced") transform is an attempt to use Ferret's
+* transform capabilities to create a result context which is 
+* of different dimensionality than the argument contexts while
+* passing result context information upstream to the arguments.
+*
+* Specifically, we are working with external functions where
+* we would like to have the result be a flag indicating success.
+* A simple example is the writev5d.F external function which
+* writes a vis5D file for some arguments over a set region.
+* Our result should be a one dimensional flag.  However, we 
+* would still like to be able to use SET REGION to specify the 
+* a region which should be applied to the arguments.  Normally,
+* SET REGION only applies to the result context so that we
+* currently, before this fix, have this behavior:
+*
+*	SET REGION/x180:160w/y=20s:20n/l=1
+*
+*	let a = writev5d(sst, airt)
+*	list a                          ! Lists 180 X 90 X 12 values
+* 
+* The workaround is the ugly:
+*
+*   let a = writev5d(sst[x=180:160w,y=20s:20n,l=1], airt[...])
+*
+*
+* The @RDC transform is applied internally in the grid 
+* determination phase and is hidden from the user.  The 
+* program structure is:
+*
+* interp_stack.F
+*        |
+*      grid
+*  determination -- get_uvar_grid.F -- is_uvar_grid.F -- get_var_context.F
+*      phase
+*        |
+*        |
+*
+*
+* This subroutine needs to apply the @RDC transform whenever
+* the result axis inherits from an argument axis but the
+* result axis is reduced.
+* This is really a sneaky way of saying that the argument context
+* depends on the result context (ie SET REGION information).
+*
+* Places where changes where made to accomodate @RDC:
+*
+* ferret.parm         -- pgc_span_*, trans_reduced
+* xgrid_chg_fcns.parm -- gfcn_reduction(4,pmax_grid_chg_fcns)
+* interp_stack.parm   -- isact_reduce
+* EF_Util.h           -- axis.reduction
+* EF_InternalUtil.c   -- efcn_get_axis_reduction_(), EF_New()
+* get_var_context.F   -- CALL ADD_RDC_XFORM()
+* gcf_impose_axes.F
+* interp_stack.F
+*
+
+      include 'tmap_dims.parm'
+      include 'xdset_info.cmn_text'
+      external xdset_info_data
+      include 'ferret.parm'
+      include 'xcontext.cmn'
+      include 'xgrid_chg_fcns.cmn'
+      include 'errmsg.parm'
+      
+      LOGICAL ITSA_GCVAR
+      INTEGER WHICH_GCFCN
+
+      LOGICAL valid_limits
+      INTEGER cx, status, uvar, gcfcn, idim
+      INTEGER axis_reduction(nferdims)
+      
+      valid_limits = .TRUE.
+
+      IF ( cx_category(cx) .EQ. cat_user_var ) THEN
+
+         uvar = cx_variable(cx)
+         IF ( ITSA_GCVAR(uvar) ) THEN
+
+            gcfcn = WHICH_GCFCN(uvar)
+
+            IF ( gcfcn .GT. gfcn_num_internal ) THEN
+
+               CALL EFCN_GET_AXIS_REDUCTION(gcfcn, axis_reduction)
+               DO 100 idim = 1, nferdims
+
+* Check that we have valid limits
+                  IF ( cx_by_ss(idim,cx) ) THEN
+                     IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 
+     .                 .OR. cx_hi_ss(cx,idim) .EQ. unspecified_int4 )
+     .                 THEN
+                          GOTO 100
+                     ENDIF
+                  ELSE
+                     IF ( cx_lo_ww(idim,cx) .EQ. unspecified_val8 
+     .                 .OR. cx_hi_ww(idim,cx) .EQ. unspecified_val8 )
+     .                 THEN
+                          GOTO 100
+                     ENDIF
+                  ENDIF
+
+* Check that we have a valid grid or else FLESH_OUT_AXIS will fail
+                  IF ( cx_grid(cx) .EQ. unspecified_int4 ) THEN
+                     GOTO 100
+                  ENDIF
+
+                  IF ( axis_reduction(idim) 
+     .                 .EQ. pgc_span_reduced ) THEN
+                     cx_trans    ( idim, cx ) = trans_reduced
+                     cx_trans_arg( idim, cx ) = bad_val4
+                     CALL FLESH_OUT_AXIS(idim, cx, status)
+                  ENDIF 
+
+ 100           CONTINUE
+
+            ENDIF
+
+*     Nothing to do YET for internal gc functions
+
+         ENDIF
+
+*     Nothing to do for non-gc functions
+         
+      ENDIF
+
+*     Nothing to do for non-user variables
+         
+*     No way to return non-ok status yet.
+
+      status = ferr_ok
+
+      RETURN
+
+* error exit
+
+* 5100   CALL ERRMSG( ferr_syntax,status,'illegal name: '//buff3,*5000 )
+
+      END
+      
diff --git a/fer/ctx/addl_cx_doc.F b/fer/ctx/addl_cx_doc.F
new file mode 100644
index 0000000..3dde23e
--- /dev/null
+++ b/fer/ctx/addl_cx_doc.F
@@ -0,0 +1,119 @@
+	SUBROUTINE ADDL_CX_DOC( joint_cx, addl_cx, overlay, flags )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* merge an additional variable context with those already merged into the
+* joint context for a plot.  See GRP_CX_DOC
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+* V230:  7/22/92 - added overlay argument for cases where the original plot
+*                  was unspecified on an axis but the overlay is not
+*                e.g. SHADE T_INDEPENDENT  CONTOUR/OVER T_DEPENDENT
+* *kob* 11/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER joint_cx, addl_cx 
+	LOGICAL	overlay, flags(0:12) 
+
+* internal variable declarations
+	INTEGER	idim, CX_DIM_LEN
+
+* document the grid in the key ??
+* ( as of FERRET v2.00 this is governed entirely by cx_unstand_grid )
+!	flags(pdoc_regrid) = cx_unstand_grid(addl_cx)
+!     .			 .AND. cx_unstand_grid(addl_cx)
+
+
+* document the data set in the key ??
+* (take any "real" data set over pdset_irrelevant)
+	IF ( cx_data_set(joint_cx) .EQ. pdset_irrelevant ) THEN
+	   cx_data_set(joint_cx) = cx_data_set(addl_cx)
+           IF ( overlay ) THEN   ! 7/92
+              flags(pdoc_dset) = .TRUE.
+              flags(0) = .TRUE.
+           ENDIF
+	ELSEIF ( cx_data_set(addl_cx) .NE. pdset_irrelevant ) THEN
+	   IF ( cx_data_set(addl_cx) .NE. cx_data_set(joint_cx) ) THEN
+	      cx_data_set(joint_cx) = unspecified_int4
+	      flags(pdoc_dset) = .TRUE.
+	      flags(0) = .TRUE.
+	   ENDIF
+	ENDIF
+
+* check each axis for documentation needs
+* note: unspec_val8_2 indicates differing limits between contexts
+*	unspecified_val8 indicates irrelevant (normal) limits
+	DO 100 idim = 1, nferdims
+	   IF ( cx_lo_ww(idim,addl_cx)  .EQ. unspecified_val8 ) GOTO 100
+	   IF ( cx_lo_ww(idim,joint_cx) .EQ. unspec_val8_2    ) GOTO 100
+	   IF ( cx_lo_ww(idim,joint_cx) .EQ. unspecified_val8 ) THEN
+	      CALL TRANSFER_AXIS( idim, addl_cx, joint_cx )
+              IF ( overlay ) THEN     ! 7/92
+                 flags(idim) =  CX_DIM_LEN( idim, addl_cx ) .EQ. 1
+                 IF ( flags(idim) ) flags(0) = .TRUE.
+              ENDIF
+	   ELSEIF(  cx_lo_ww(idim,joint_cx) .NE. cx_lo_ww(idim,addl_cx)
+     .		.OR.cx_hi_ww(idim,joint_cx) .NE. cx_hi_ww(idim,addl_cx) ) THEN
+	      cx_lo_ww(idim,joint_cx) = unspec_val8_2
+	      cx_hi_ww(idim,joint_cx) = unspec_val8_2
+	      flags(idim) = .TRUE.
+	      flags(idim+pdoc_offset_xform) = .TRUE.
+	      flags(0) = .TRUE.
+	   ENDIF
+	   IF( cx_trans_arg(idim,joint_cx) .NE. cx_trans_arg(idim,addl_cx)
+     .	  .OR. cx_trans(idim,joint_cx) .NE. cx_trans(idim,addl_cx) ) THEN
+	      cx_trans    (idim,joint_cx) = trans_no_transform
+	      cx_trans_arg(idim,joint_cx) = bad_val4
+	      flags(idim+pdoc_offset_xform) = .TRUE.
+	      flags(0) = .TRUE.
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ctx/apply_auto_curv.F b/fer/ctx/apply_auto_curv.F
new file mode 100644
index 0000000..ca783fe
--- /dev/null
+++ b/fer/ctx/apply_auto_curv.F
@@ -0,0 +1,151 @@
+	SUBROUTINE APPLY_AUTO_CURV( full_var_name, cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  setup auto-curvilinear loading of aux vars and regridding
+*      z = lo:hi at ave        ==> a curvi regrid to a 1pt axis via pcwz avrging
+*      z = lo:hi:delta      ==> a curvi regrid via linear interpolation
+*      z = lo:hi:delta at ave  ==> a curvi regrid via piececwise averaging
+*      z = pt               ==> a curvi regrid to a 1pt axis via linear interp
+* ... and for convenience also
+*      gz = axis, sigma
+*      gz = lo:hi:delta,sigma
+
+* V690 12/13 *sh* 
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER cx, status
+	CHARACTER*(*) full_var_name
+
+* internal variable declarations
+	INTEGER	idim, impl_grid
+	REAL	range, midpt
+
+
+* if any axes are set up for manual aux regridding, that takes precedence
+	IF (cx_naux(cx) .GT. 0) RETURN
+
+* loop over the implied curvilinear axes -- set them up for curvi regridding
+	DO idim = 1, nferdims
+
+* not a relevant axis?
+	   IF (cx_aux_stat(idim,cx) .EQ. paux_stat_na) CYCLE
+
+* if the region was specified by subscript suppresses implicit curvi regridding
+	   IF (cx_given(idim,cx)
+     .	 .AND. cx_by_ss(idim,cx)) CYCLE     ! ignore by_ss region limits
+
+* by default assume that we will be regridding this axis
+* a regrid implies that the aux axis status is "used"
+	  cx_aux_stat(idim,cx) = paux_stat_used 
+
+* modify the xform or regridding xform to be an aux var regrid xform
+	   IF ( cx_regrid_trans(idim,cx) .EQ. prgrd_average
+     .	  .    OR. cx_trans       (idim,cx) .EQ. trans_average) THEN
+	      CALL WARN_OCCASIONALLY(
+     .		   'Box-averaging not available for sigma axis '//
+     .		   'regridding.'//pCR//
+     .		   '           Using piecewise linear averaging instead, '//
+     .		   'equivalent to gz(depth)=0:100 at plave', 10, 101)
+	       cx_regrid_trans(idim,cx) = pauxrgrd_pwlave
+	       cx_trans       (idim,cx) = trans_no_transform
+	   ELSEIF (cx_regrid_trans(idim,cx) .EQ. prgrd_linear_interp) THEN
+	       cx_regrid_trans(idim,cx) = pauxrgrd_linear
+	   ELSEIF (cx_trans       (idim,cx) .NE. trans_no_transform
+     .	      .OR. cx_regrid_trans(idim,cx) .NE. unspecified_int4 ) THEN
+	       GOTO 5200
+	   ENDIF
+
+* modify the interpretation of the region to accommodate the curvi operations
+	   IF (cx_g_eq_regrid(idim)) THEN
+* GZ=axis or GZ=lo:hi:delta
+	      cx_aux_stat(idim,cx) = paux_stat_used  ! gz syntax sets itself up
+	   ELSEIF (cx_regrid_trans(idim,cx) .EQ. pauxrgrd_pwlave
+     .	     .AND. cx_delta(idim,cx)        .EQ. unspecified_val8) THEN
+* Z=lo:hi at ave ==> regrid to a single point axis with these lo:hi end points
+	      range = cx_hi_ww(idim,cx) - cx_lo_ww(idim,cx)
+	      midpt = (cx_hi_ww(idim,cx) + cx_lo_ww(idim,cx)) / 2.
+	      cx_lo_ww(idim,cx) = midpt - range/2
+	      cx_hi_ww(idim,cx) = midpt + range/2
+	      cx_delta(idim,cx) = pauto_1pt_ax
+	   ELSEIF ( cx_delta(idim,cx) .NE. unspecified_val8 ) THEN
+* z=lo:hi:delta and z=lo:hi:delta at ave
+	      CONTINUE
+	   ELSEIF (cx_given(idim,cx)
+     .	    .AND. cx_lo_ww(idim,cx) .EQ. cx_hi_ww(idim,cx)) THEN
+* Z=pt ==> regrid to a 1 point axis axis by interpolation
+	      cx_delta(idim,cx) = pauto_1pt_ax
+	   ELSE
+* no regridding after all -- just getting the aux vars for plotting
+	      cx_aux_stat(idim,cx) = paux_stat_needed
+	   ENDIF
+	   cx_implicit_aux(cx) = .TRUE.
+	   cx_naux(cx) = cx_naux(cx) + 1
+
+* curvilinear and sigma regridding always imply a new target axis
+* if it was not already created by GET_CONTEXT_MODS then create it here
+	   IF (.NOT.(    cx_aux_stat(idim,cx).EQ.paux_stat_needed
+     .	            .OR. cx_unstand_grid(cx)
+     .		    .OR. cx_has_impl_grid(cx))      ) THEN
+	      CALL ALLO_GRID_TO_CX(cx,impl_grid,status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      cx_unstand_grid(cx) = .TRUE.
+	   ENDIF
+	ENDDO
+
+	status = ferr_ok
+ 5000	RETURN
+
+* error exits
+ 5200	IF (idim .EQ. z_dim) THEN
+	   CALL ERRMSG( ferr_invalid_command, status,
+     .	     'xform not (yet) supported on sigma-Z var: '
+     .		//full_var_name, *5000)
+	ELSE
+	   CALL ERRMSG( ferr_invalid_command, status,
+     .	     'xform not (yet) supported on curvilinear var: '
+     .		//full_var_name, *5000)
+	ENDIF
+
+	END
+
diff --git a/fer/ctx/apply_context_mods.F b/fer/ctx/apply_context_mods.F
new file mode 100644
index 0000000..343d80c
--- /dev/null
+++ b/fer/ctx/apply_context_mods.F
@@ -0,0 +1,182 @@
+	SUBROUTINE APPLY_CONTEXT_MODS
+     .				( mods_cx, dest_cx, nest_new_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* modify the indicated destination context based on mods in mods_cx
+* apply only those modifications that can be done without for-certain knowledge
+* of the underlying grid.  For example, translating subscript values into
+* WORLD coordinates will be done in FINISH_CONTEXT_MODS instead of here
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/15/86
+* revision 0.1 -   4/8/87 - mods not applied to normal axes
+* revision 0.2 -  4/29/87 - fully incorporated relative (implied) coordinates
+*			  - and added check on transformation nesting
+* revision 0.3 - 5/12/87  - corrected bug of check being made to see if an axis
+*			    was normal as a test for applying a mod.  This is
+*			    invalid since the grid is not presumed to be known.
+* revision 0.4 - 8/18/87  - added transfer of trans_arg (for @SHF)
+* revision 0.5 - 9/11/87  - transfer delta only if command or if explicitly
+*			    given in variable modifier
+* revision 0.6 -  4/1/89  - apply regrididng transformations, too
+* V200:  5/19/89 - no nested transformations possible
+* 		 - eliminated "d" notation and "relative" logic
+*		 - changed logic of cx_given and cx_dset_given
+* V420: 9/95	 - Support for implicit grids
+*	10/95	 - xfer delta specifications whenever mods to axis are explicit
+*		 - also xfer cx_regrid_trans since dynamic axes may use
+* *kob* 9/97 - support for negative time steps - make sure cx_calendar
+*              gets transfered
+* *acm* v580 11/04 Transfer cx_cal_id, the calendar ID used when computing 
+*                  world coordinates
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 3/13 *sh* support for aux var regridding: var[gz(depth)=zax]
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	mods_cx, dest_cx, status
+	LOGICAL	nest_new_cx
+
+* internal variable declarations:
+!	LOGICAL		itsa_uvar
+	INTEGER		idim, var, trans, i
+!	CHARACTER	ALG_TRANS_CODE*3
+
+* first see if data_set or variable is being modified
+	cx_dset_gvn( dest_cx ) = cx_dset_gvn( mods_cx )
+	IF (cx_dset_gvn(mods_cx)) cx_data_set(dest_cx) = cx_data_set(mods_cx)
+	IF ( cx_variable( mods_cx ) .NE. unspecified_int4 ) THEN
+	   cx_variable( dest_cx ) = cx_variable( mods_cx )
+	   cx_category( dest_cx ) = cx_category( mods_cx )
+	ENDIF
+
+* modify the grid if the user said to explicitly
+	cx_unstand_grid ( dest_cx ) = cx_unstand_grid ( mods_cx )
+	cx_has_impl_grid( dest_cx ) = cx_has_impl_grid( mods_cx )
+	cx_has_impl_grid( mods_cx ) = .FALSE.	! house-keeping: only 1 cx SET
+	cx_impl_grid    ( dest_cx ) = cx_impl_grid    ( mods_cx )
+	IF ( cx_unstand_grid( mods_cx ) ) THEN
+	   cx_grid( dest_cx ) = cx_grid( mods_cx )
+	ENDIF
+* ... apply regrid transform to each axis (some may be "unspecified")
+	DO 50 idim = 1, nferdims
+ 50	cx_regrid_trans(idim,dest_cx) = cx_regrid_trans(idim,mods_cx)
+
+* apply modifications for each axis ( except normal axes, of course )
+	DO 100 idim = 1, nferdims
+	   IF ( .NOT.cx_given( idim, mods_cx )	   )	GOTO 100
+
+* ... "given" flag on dest context to represent limits (not transform) given
+	   cx_given( idim, dest_cx ) = 
+     .		cx_lo_ss( mods_cx, idim ) .NE. unspecified_int4
+     .	   .OR. cx_lo_ww( idim, mods_cx ) .NE. unspecified_val8
+
+* ... transfer coordinates if they were given (e.g. L=@SBX has no coords)
+	   IF ( cx_given( idim, dest_cx ) ) THEN
+	      cx_by_ss( idim, dest_cx ) = cx_by_ss( idim, mods_cx ) 
+	      IF ( cx_by_ss( idim, mods_cx ) ) THEN
+	         cx_lo_ss( dest_cx ,idim) = cx_lo_ss( mods_cx,idim)
+	         cx_hi_ss( dest_cx ,idim) = cx_hi_ss( mods_cx,idim)
+	         cx_lo_ww( idim,dest_cx ) = unspecified_val8
+	         cx_hi_ww( idim,dest_cx ) = unspecified_val8
+* kob 9/97 - need to reset cx_calendar as well
+		 IF (idim.EQ.t_dim .OR. idim.EQ.f_dim) THEN
+                    cx_calendar(dest_cx) = .FALSE.
+                    cx_cal_id(dest_cx) = unspecified_int4
+                 ENDIF
+	      ELSE
+	         cx_lo_ww( idim,dest_cx ) = cx_lo_ww( idim,mods_cx)
+	         cx_hi_ww( idim,dest_cx ) = cx_hi_ww( idim,mods_cx)
+	         cx_lo_ss( dest_cx ,idim) = unspecified_int4
+	         cx_hi_ss( dest_cx ,idim) = unspecified_int4
+* kob 9/97 - need to transfer cx_calendar as well
+		 IF (idim.EQ.t_dim .OR. idim.EQ.f_dim) THEN
+                    cx_calendar(dest_cx) = cx_calendar(mods_cx)
+                    cx_cal_id(dest_cx) = cx_cal_id(mods_cx)
+                 ENDIF
+
+	      ENDIF
+	      cx_delta( idim, dest_cx )   = cx_delta( idim, mods_cx ) ! 10/95
+	   ENDIF
+
+*  ... transfer transformation ( imposes @nul if nothing was given )
+	   trans = cx_trans(idim,mods_cx)
+!	   IF ( itsa_uvar ) THEN
+!* ... check for illegal nesting of transforms
+!* (note: in V2.0 omitting this doesn't generate errors - just inappropriate
+!*  behavior like @SBX on an @AVE axis generates a field of bad data)
+!* ... cannot use because @SBX is valid on U-U[K=@AVE] although it is need_xact
+!	     IF ( ( uvar_given( idim, var ) .EQ. uvlim_gvn_xact
+!     .	       .OR. uvar_given( idim, var ) .EQ. uvlim_need_xact )
+!     .	     .AND.( trans .NE. trans_no_transform ) ) GOTO 5100
+!	   ENDIF
+	   cx_trans   ( idim, dest_cx ) = trans
+	   cx_trans_arg(idim, dest_cx ) = cx_trans_arg(idim, mods_cx )
+
+*   ... transfer delta always for command mod or if explicit for variable mod
+	   IF ( .NOT.nest_new_cx )
+     .	   cx_delta( idim, dest_cx ) = cx_delta( idim, mods_cx ) 
+
+ 100	CONTINUE
+
+* transfer aux var info
+	cx_naux( dest_cx ) = cx_naux( mods_cx )
+	IF ( cx_naux(dest_cx) .GE. 1 ) THEN
+	   DO 200 i = 1, cx_naux( dest_cx )
+	      cx_aux_arg_start(i, dest_cx) = cx_aux_arg_start(i, mods_cx)
+	      cx_aux_arg_end  (i, dest_cx) = cx_aux_arg_end  (i, mods_cx)
+ 200	   CONTINUE
+	ENDIF
+
+	status = ferr_ok
+ 5000	RETURN
+! 5100	CALL ERRMSG( ferr_trans_nest, status,
+!     .		'invalid nesting of @'//ALG_TRANS_CODE(trans)//
+!     .		' on '//ww_dim_name(idim)//' axis', *5000 )
+	END
diff --git a/fer/ctx/apply_delta_context.F b/fer/ctx/apply_delta_context.F
new file mode 100644
index 0000000..362b6de
--- /dev/null
+++ b/fer/ctx/apply_delta_context.F
@@ -0,0 +1,116 @@
+	SUBROUTINE APPLY_DELTA_CONTEXT ( cx, reg_name, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* apply delta coordinate limits of the FORM DX
+* to the indicated context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   5/2/90 - extracted from GET_DELTA_CONTEXT
+* Unix/RISC port - 1/91 - cannot use "//" with char*(*)
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'	
+	include 'ferret.parm'	
+	include 'xcontext.cmn'
+	include 'xdelta_context.cmn'
+	include 'xtext_info.cmn'
+	include 'xrisc.cmn'
+
+* calling arguments:
+	INTEGER		cx, status
+	CHARACTER*(*)	reg_name
+
+* internal variables:
+	INTEGER		idim
+	LOGICAL		INVALID_R8_TO_I4
+
+* initialize fixed length string for RISC
+        risc_buff = reg_name
+        len_rbuff = MIN( size_rbuff, LEN(reg_name) )
+
+	DO 100 idim = 1, nferdims
+
+	   IF ( .NOT.dcx_given(idim) ) GOTO 100
+
+* apply delta limits from common
+	   IF ( dcx_by_ss(idim) .NEQV. cx_by_ss(idim,cx) ) THEN
+	      IF ( cx_lo_ss(cx,idim).EQ.unspecified_int4
+     .	     .AND. cx_lo_ww(idim,cx).EQ.unspecified_val8 ) THEN
+	         GOTO 5500
+	      ELSE
+	         GOTO 5300
+	      ENDIF
+	   ENDIF
+	   IF ( dcx_by_ss(idim) ) THEN
+	      IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) GOTO 5500
+	      IF ( INVALID_R8_TO_I4( dcx_lo(idim) )
+     .        .OR. INVALID_R8_TO_I4( dcx_hi(idim) )) GOTO 5400
+	      cx_lo_ss(cx,idim) = cx_lo_ss(cx,idim) + NINT( dcx_lo(idim) )
+	      cx_hi_ss(cx,idim) = cx_hi_ss(cx,idim) + NINT( dcx_hi(idim) )
+	   ELSE
+	      IF ( cx_lo_ww(idim,cx) .EQ. unspecified_val8 ) GOTO 5500
+	      cx_lo_ww(idim,cx) = cx_lo_ww(idim,cx) + dcx_lo(idim)
+	      cx_hi_ww(idim,cx) = cx_hi_ww(idim,cx) + dcx_hi(idim)
+	   ENDIF
+
+* flag that this axis was specified
+	   cx_given(idim,cx) = .TRUE.
+
+ 100	CONTINUE
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5300	CALL ERRMSG( ferr_relative_coord, status, 
+     .		     'must be a subscript or a world position'//pCR//
+     .		     'as in the original '//ww_dim_name(idim)//
+     .		     ' axis of region '//risc_buff(:len_rbuff), *5000)
+ 5400	CALL ERRMSG( ferr_out_of_range, status,
+     .		     'delta value is too large to be a subscript', *5000)
+ 5500	CALL ERRMSG( ferr_relative_coord, status,
+     .		     ww_dim_name(idim)//' axis coordinate is unspecified'//
+     .		     pCR//'on region '//risc_buff(:len_rbuff), *5000)
+
+	END
diff --git a/fer/ctx/aux_axis_from_arg.F b/fer/ctx/aux_axis_from_arg.F
new file mode 100644
index 0000000..a2765e1
--- /dev/null
+++ b/fer/ctx/aux_axis_from_arg.F
@@ -0,0 +1,59 @@
+	INTEGER FUNCTION AUX_AXIS_FROM_ARG( cx, arg_num )
+
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given the argument number within a specified aux var regrid
+* return the corresponding axis orientation (idim)
+
+	IMPLICIT NONE
+
+	include	'ferret.parm'
+        include 'tmap_dims.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	 cx, arg_num
+
+* internal variable declarations:
+	INTEGER	 i, idim
+
+
+* which auxiliary var is the subject of interest?
+* e.g. for "temp[gz(depth)=zax]" the argument "depth" is found in the z dim
+	i = 1
+	DO 100 idim = 1, nferdims
+	   IF (cx_aux_stat(idim, cx) .NE. paux_stat_na ) THEN
+! ??     .	 .AND. cx_aux_stat(idim, cx) .NE. paux_passed  ) THEN
+	      IF (i .EQ. arg_num) THEN
+	         GOTO 1000
+	      ELSE
+	         i = i + 1  ! not the right argument yet
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+* ... should never land here
+	CALL WARN( 'YIKES: aux_var_crptn' )
+
+ 1000	AUX_AXIS_FROM_ARG = idim
+	RETURN
+	END
diff --git a/fer/ctx/cgrid_axis.F b/fer/ctx/cgrid_axis.F
new file mode 100644
index 0000000..c9eff04
--- /dev/null
+++ b/fer/ctx/cgrid_axis.F
@@ -0,0 +1,63 @@
+	INTEGER FUNCTION CGRID_AXIS ( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the axis number for the indicated orientation of the grid in the
+* given context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/3/86
+* Unix/RISC port - 1/91 - cant use "/star" in documentation
+* V420 11/95 - documentation change and clean-up
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+	INTEGER	idim, cx
+
+* find the line number for the indicated axis of this grid
+	CGRID_AXIS = grid_line( idim, cx_grid(cx) )
+
+	RETURN
+	END
+
+
diff --git a/fer/ctx/cgrid_size.F b/fer/ctx/cgrid_size.F
new file mode 100644
index 0000000..337f09c
--- /dev/null
+++ b/fer/ctx/cgrid_size.F
@@ -0,0 +1,64 @@
+	INTEGER FUNCTION CGRID_SIZE ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of values in a 2D grid that lies within the plane
+* of the specified context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/24/86
+* revision 0.1 - 7/20/87 - kludge introduction of 1D grids for XY averages
+* V200:  5/18/89 - 4D symmetrical
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+	INTEGER	CX_DIM_LEN, cx
+
+	CGRID_SIZE = CX_DIM_LEN( 1, cx )
+     .		   * CX_DIM_LEN( 2, cx )
+     .		   * CX_DIM_LEN( 3, cx )
+     .		   * CX_DIM_LEN( 4, cx )
+     .		   * CX_DIM_LEN( 5, cx )
+     .		   * CX_DIM_LEN( 6, cx )
+
+	RETURN
+	END
diff --git a/fer/ctx/cgrid_size_max.F b/fer/ctx/cgrid_size_max.F
new file mode 100644
index 0000000..fd62f00
--- /dev/null
+++ b/fer/ctx/cgrid_size_max.F
@@ -0,0 +1,88 @@
+	INTEGER FUNCTION CGRID_SIZE_MAX ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of values used on the grid
+* of the specified context
+
+* unlike CGRID_SIZE which uses "1" as the size of unspecified regions this
+* one uses CAXIS_LEN - the maximum size.  A kludge in guessing this way.
+
+* another kludge is needed for abstract variables -- since the abstract
+* axis is deliberately defined to be "arbitrarily" long.  Use a length of
+* 1 in this case
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95 - from CGRID_SIZE
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 *acm*  6/13 Increase nominal length of abstract axis
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN, CAXIS_LEN, CGRID_AXIS, idim, i6d, axlen
+
+* to accomodate the ABSTRACT axis
+* (inefficient -- "mline_abstract" should be saved by DEFINE_SPECIAL_GRIDS)
+
+* initialize
+	i6d = 1
+
+	DO 100 idim = 1, nferdims
+	   IF (cx_lo_ss(cx,idim) .NE. unspecified_int4) THEN
+	      i6d = i6d * CX_DIM_LEN(idim,cx)
+	   ELSE
+	      axlen = CAXIS_LEN(idim,cx)
+	      IF ( axlen .EQ. 99999999 ) THEN
+	         axlen = 1	! kludge trap for ABSTRACT axis length
+	      ELSEIF ( axlen .GT. 5000 ) THEN
+	         axlen = 5000	! kludge 
+	      ENDIF
+	      i6d = i6d * axlen
+	   ENDIF
+ 100	CONTINUE
+
+	CGRID_SIZE_MAX = i6d
+
+	RETURN
+	END
diff --git a/fer/ctx/complete_missing_limits.F b/fer/ctx/complete_missing_limits.F
new file mode 100644
index 0000000..652369b
--- /dev/null
+++ b/fer/ctx/complete_missing_limits.F
@@ -0,0 +1,180 @@
+	SUBROUTINE COMPLETE_MISSING_LIMITS( cx )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* Replace unspecified limits in the given context with full-span limits
+* (not clear how cx_given sould be set ...)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*  V500 *sh* 3/99
+*       *sh* 4/99 - bug fix: ABSTRACT axes completed on some user vars
+*	*sh* 4/99 - add mode_stupid check
+*		    MODE STUPID:weak_cache in case future EF problems arise
+*	*sh* 5/99 - complete limits on implicit axes
+*  V510 *sh* 4/00 - netCDF variables may now have dynamic axes, so chg the
+*		    logic that checked for these
+*  V520 *sh* 6/00 - a cmnd with unspecified lims a conflicting X axes like
+*			LIST Xshort-Xlong
+*		    needs to generate an error. It does not because this
+*		    routine requests I=1:short from both components.
+*		    Change cx_by_ss to FALSE in here -- meaning that the
+*		    misleading behavior can occur only when each component
+*		    has the same number of points in the same world coord span
+*
+*  V541 *kob* 10/02 - BUG FIX - need to check the axis number for the 
+*                               abstract grid for EACH dimension - not
+*                               just x dimension, in order to correctly
+*                               have limits set
+* V550 *sh* 11/02 - added remark about weak_cache to 4/99 comments
+*			(remark copied from ChangeLog)
+* ??? v570 *acm* 7/04  do we want to use mabstract = grid_line( idim, saved_abstract_grid )
+*                      instead of getting the line from mgrid_abstract ???
+* v602 *acm* 12/06 use TM_GET_GRIDNUM ('ABSTRACT') to get the grid number of the grid
+*                  of abstract axes; mgrid_abstract and saved_abstract_grid refer to the
+*                  grid of a SET GRID gridname command.
+* v6.11 *acm* 4/08 Fix bug 1558: revert previous changes.
+*                  When we WANT the grid of a SET GRID gridname command, need to use
+*                  mgrid_abstract and saved_abstract_grid. I no longer know the reason 
+*                  for the previous change; it does not seem to fix any listed bug and
+*                  reverting does not break anything...
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690 1/14 *sh* removed special behavior for mode_stupid
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'implicit.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	LOGICAL needs_limits, its_unspec
+	INTEGER TM_GET_GRIDNUM,
+     .          idim, cat, var, grid, mabstract, line, status, grr
+
+* possible skip this routine
+! commented this out 1/2014 cuz it causes a crash in aux var processing
+! and it isn't clear why Ferret should function correctly when this line is here
+!	IF (mode_stupid) GOTO 1000
+
+* initialize
+	var  = cx_variable( cx )
+	cat  = cx_category( cx )
+	grid = cx_grid    ( cx )
+
+        grr = TM_GET_GRIDNUM ('ABSTRACT')
+
+	DO 100 idim = 1, nferdims
+
+* get the axis number for the abstract axis
+
+           grr = saved_abstract_grid
+           IF (grr .EQ. unspecified_int4) grr = mgrid_abstract
+	   mabstract = grid_line( idim, mgrid_abstract )
+
+	   IF ( cx_by_ss(idim, cx) ) THEN
+	      its_unspec = cx_lo_ss(cx,idim) .EQ. unspecified_int4
+	   ELSE
+	      its_unspec = cx_lo_ww(idim,cx) .EQ. unspecified_val8
+	   ENDIF
+
+	   IF ( its_unspec ) THEN
+
+	      line = grid_line( idim, grid )
+
+ 11	    needs_limits = line .NE. mnormal
+     .		       .AND. line .NE. mabstract
+
+* If the limits are given in the definition of the variable (e.g. A=B[J=3:5])
+* then it is not possible to complete the limits from the axis length, alone.
+* (5/99) However, do complete implicit axis ( >=max_lines ) lims, since
+* implicit axes are always full length. This will improve cache hits on
+* LOAD a, where a=netCDFvar[i=1:10:2] which uses netCDF strides
+* WARNING: For b=a[i=10:100:10];c=b[i=3:5] we have an implicit axis where the
+* axis length is NOT applicable. HOPEFULL completing these limits will not
+* cause a problem.
+* Note: 4/00 Since netCDF axes are now dynamic we can no longer use max_lines
+*	as a test of anything significant. I replaced the restriction 
+*	    " .	    .AND.  line .LT. max_lines ) THEN"
+*	with a test on line_parent. ALERT!
+
+	      IF ( needs_limits .AND. cat.EQ.cat_user_var
+     .	    .AND.  line_class(line) .NE. pline_class_stride ) THEN
+	         needs_limits = uvar_given(idim,var) .GE. uvlim_needed
+	      ENDIF
+
+	      IF ( needs_limits ) THEN
+
+	         cx_by_ss(idim, cx) = .TRUE.
+	         IF ( (cat .EQ. cat_file_var) .OR.
+     .                (cat .EQ. cat_aggregate_var) .OR.
+     .                (cat .EQ. cat_pystat_var) ) THEN
+	            CALL VAR_SS_LIMS( idim, cx,
+     .				      cx_lo_ss(cx,idim),
+     .				      cx_hi_ss(cx,idim)  )
+	         ELSE
+	            cx_lo_ss(cx,idim) = 1
+	            cx_hi_ss(cx,idim) = line_dim( line )
+	         ENDIF
+
+*  set cx_given to match behavior of "SET REGION limits"
+	         cx_given(idim, cx) = .FALSE.
+
+* flesh out the world coordinates, too
+	         CALL  FLESH_OUT_AXIS( idim, cx, status )
+* ... status ignored ...
+
+* matches to this region must be based on world coordinates (see 6/00 comments)
+	         cx_by_ss(idim, cx) = .FALSE.
+
+
+	      ENDIF
+
+	   ENDIF
+
+ 100	CONTINUE
+
+ 1000	RETURN
+
+	END
diff --git a/fer/ctx/confine_context.F b/fer/ctx/confine_context.F
new file mode 100644
index 0000000..222ec11
--- /dev/null
+++ b/fer/ctx/confine_context.F
@@ -0,0 +1,75 @@
+	SUBROUTINE CONFINE_CONTEXT( cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a skeletal context with a known grid confine the context limits to
+* within the grid limits
+* if date/time limits were specified convert to time steps here
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/5/88  - code lifted from FINISH_1_CONTEXT_MOD
+* revision 0.1 - 7/8/88  - avoid wiping out half of xy_ave transform
+* revision 0.2 - 7/28/88 - simplified date processing (no mixed dates/tsteps)
+* revision 0.3 - 1/12/89 - new error report for munknown axis
+* V200:  5/26/89 - removed bulk of routine to CONFINE_AXIS
+* V230:  7/20/92 - bug in error trapping fixed
+* *kob* 11/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, status
+
+* internal variable declarations:
+	INTEGER	idim
+
+	DO 500 idim = 1, nferdims
+    	   CALL CONFINE_AXIS( idim, cx, status )
+           IF ( status .NE. ferr_ok ) RETURN      ! 7/92 bug fix
+ 500    CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ctx/create_new_context.F b/fer/ctx/create_new_context.F
new file mode 100644
index 0000000..2e8c6dc
--- /dev/null
+++ b/fer/ctx/create_new_context.F
@@ -0,0 +1,66 @@
+	SUBROUTINE CREATE_NEW_CONTEXT( source_cx, new_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* push context stack to allocate space for a new context and copy the source
+* context into the new slot as default
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/23/87
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		source_cx, new_cx, status
+
+* push the context stack
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	new_cx = cx_stack_ptr
+
+* set up default values
+	CALL TRANSFER_CONTEXT( source_cx, new_cx )
+
+	RETURN
+	END
diff --git a/fer/ctx/cs_set_context.F b/fer/ctx/cs_set_context.F
new file mode 100644
index 0000000..0a48436
--- /dev/null
+++ b/fer/ctx/cs_set_context.F
@@ -0,0 +1,91 @@
+	SUBROUTINE CS_SET_CONTEXT
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer the information indicated in the current control stack level into
+* the default ("LAST") context
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 5/1/87
+* V200:  6/15/89 - reordered lo/hi_ss args
+* 9/97 *kob* - need to reset cx_calendar to false if cx_lo/hi_ww are
+*              not used
+* 12/97 *kob* - and set  cx_calendar to true if they are used....
+* *acm* v580 11/04 Introducing cx_cal_id, saves the calendar ID used 
+*                  when computing world coordinates
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* internal variable declarations:
+	INTEGER	idim
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+
+* initialize
+	idim = cs_axis( csp )
+
+* set up by subscript or by world coordinates
+	cx_by_ss( idim, cx_last ) = cs_by_ss( csp )
+
+	IF ( cs_by_ss( csp ) ) THEN
+	   cx_lo_ss( cx_last, idim ) = cs_phase( csp )
+	   cx_hi_ss( cx_last, idim ) = cs_phase( csp )
+	   cx_lo_ww( idim, cx_last ) = unspecified_val8
+	   cx_hi_ww( idim, cx_last ) = unspecified_val8
+* kob 9/97 - need to reset cx_calendar as well
+	   IF (idim .eq. t_dim) THEN
+              cx_calendar(cx_last) = .FALSE.
+              cx_cal_id(cx_last) = unspecified_int4
+           ENDIF
+	ELSE
+* kob 12/97 - i need to set cx_calendar to true here
+ 	   cx_lo_ss( cx_last, idim ) = unspecified_int4
+	   cx_hi_ss( cx_last, idim ) = unspecified_int4
+	   cx_lo_ww( idim, cx_last ) = cs_phase( csp )
+	   cx_hi_ww( idim, cx_last ) = cs_phase( csp )
+	   IF (idim .eq. t_dim) THEN
+              cx_calendar(cx_last) = cs_is_calendar(csp)
+              cx_cal_id ( cx_last) = cs_cal_id(csp)
+           ENDIF
+	ENDIF
+	   
+	RETURN
+	END
+
diff --git a/fer/ctx/cx_dim_len.F b/fer/ctx/cx_dim_len.F
new file mode 100644
index 0000000..7652a62
--- /dev/null
+++ b/fer/ctx/cx_dim_len.F
@@ -0,0 +1,61 @@
+	INTEGER FUNCTION CX_DIM_LEN ( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of points along the indicated axis of a variable context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+* revision 0.1 - 7/8/87  - checks transformations
+* V200:  5/18/89 - 4D-symmetrical - transforms reflected in subscript limits
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, cx
+
+	CX_DIM_LEN = cx_hi_ss( cx, idim ) 
+     .		   - cx_lo_ss( cx, idim ) + 1
+
+	RETURN
+	END
diff --git a/fer/ctx/cx_dim_len_zero.F b/fer/ctx/cx_dim_len_zero.F
new file mode 100644
index 0000000..55e145a
--- /dev/null
+++ b/fer/ctx/cx_dim_len_zero.F
@@ -0,0 +1,64 @@
+	INTEGER FUNCTION CX_DIM_LEN_ZERO ( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of points along the indicated axis of a variable context.
+* If the subscripts are undefined, return zero.
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* (based on cx_dim_len
+* V580: 10/8/04 *ACM*
+* If the subscripts are undefined, return zero.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, cx
+
+	CX_DIM_LEN_zero = cx_hi_ss( cx, idim ) 
+     .		      - cx_lo_ss( cx, idim ) + 1
+	IF ( (cx_hi_ss( cx, idim ) .EQ. unspecified_int4)  .OR.
+     .		(cx_lo_ss( cx, idim ) .EQ. unspecified_int4) )
+     .       CX_DIM_LEN_ZERO = 0
+
+	RETURN
+	END
diff --git a/fer/ctx/cx_ww_pos.F b/fer/ctx/cx_ww_pos.F
new file mode 100644
index 0000000..27985b5
--- /dev/null
+++ b/fer/ctx/cx_ww_pos.F
@@ -0,0 +1,72 @@
+	REAL FUNCTION CX_WW_POS( idim, cx, isubsc ) 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a single value representing the position of a context along an axis
+* if the axis has been reduced to a point by, say, averaging then return the
+* midpoint.
+* If no reasonable position can be found then return bad_val4
+
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		idim, cx, isubsc
+
+* internal variable declarations:
+	INTEGER	grid
+	REAL*8	TM_WORLD
+
+* initialize
+	grid = cx_grid(cx)
+
+	IF ( cx_lo_ss(cx,idim) .NE. unspecified_int4 ) THEN
+* ... send back exact position
+	   CX_WW_POS = TM_WORLD(isubsc,grid,idim,box_middle)
+	ELSEIF ( cx_lo_ww(idim,cx) .NE. unspecified_val8 ) THEN
+* ... send back midpoint of range
+	   CX_WW_POS = (cx_lo_ww(idim,cx)+cx_hi_ww(idim,cx)) / 2.
+	ELSE
+* ... no valid position ...
+	   CX_WW_POS = bad_val4
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/ctx/del_cx_dim.F b/fer/ctx/del_cx_dim.F
new file mode 100644
index 0000000..d176ba6
--- /dev/null
+++ b/fer/ctx/del_cx_dim.F
@@ -0,0 +1,66 @@
+	SUBROUTINE DEL_CX_DIM( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all data specifying an axis in a context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/23/87
+* V200:  5/19/89 - reordered _ss dims
+* 9/97 *kob* - eliminate newly create cx_calendar
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	cx, idim
+
+	cx_lo_ss    ( cx, idim ) = unspecified_int4
+	cx_hi_ss    ( cx, idim ) = unspecified_int4
+	cx_lo_ww    ( idim, cx ) = unspecified_val8
+	cx_hi_ww    ( idim, cx ) = unspecified_val8
+	cx_trans    ( idim, cx ) = trans_no_transform
+	cx_trans_arg( idim, cx ) = bad_val4
+	if (idim .EQ. t_dim) 
+     .      cx_calendar(cx) = .FALSE.
+
+	RETURN
+	END
diff --git a/fer/ctx/flesh_out_axis.F b/fer/ctx/flesh_out_axis.F
new file mode 100644
index 0000000..b5a19ea
--- /dev/null
+++ b/fer/ctx/flesh_out_axis.F
@@ -0,0 +1,328 @@
+	SUBROUTINE FLESH_OUT_AXIS( idim, cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a skeletal context with a known grid transfor the subscript coord
+* data to world coordinates and world to subscript on the specified axis
+* make sure all time coordinates are in time step values (vs. secs from BC)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/26/89 - extracted from FLESH_OUT_CONTEXT
+*                - handles axes of uvars where all region info is contained
+*		 - detects and set up interpolations
+*		 - inserts unspecified limits for file vars
+* V230:  7/20/92 - check TM_DATE_OK for valid time axis before doing time xlate
+*                - kludge fix to err230_fixed_limits.jnl
+*        8/10/92 - point location with transform (e.g. Z=5 at DIN) needs
+*                  exact location preserved for proper labelling
+* V320:	 11/2/94 - checking if interpolation is required needs to be based on
+*		   single precision coordinate comparison
+* V420:   1/96   - if the context being completed involves modulo
+*		   regridding then the interpretation of the limits is altered
+* *kob* 11/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* V450:   1/97   - fix to never-observed bug: the check
+*		        "uvar_given(idim,var) .LE. uvlim_gvn_xact"
+*		   ignores the possibility of uvlim_irrelevant
+*  *KOB* 9/97    - replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in 
+*                  order to use cx_calendar to determine style of taxis
+* V500 *kob* 3/99- up VAR_CODE decl from 8 to 64 chars
+*      *sh*  5/99 - go ahead and flesh out implicit axes (to improve cache hits
+*		    when netCDF strides are invoked)
+* V510: *sh* 12/99 - support for uvlim_hiddef (EF caching)
+*	*sh* 4/00 - since netCDF dsets now produce dynamic axes we cannot
+*		    use line .LT. max_lines as a test of an implicit axes
+* v5.3 *acm* 1/01 - line_cal_name is part of the data set information
+* V530: *sh* 4/01 - added comment about in_get_grid_mode
+* V533: *sh* 6/01 - added logic for strides (cx_delta)
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+* V560:*acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+* *acm* v580 11/04- Keep cx_cal_id, the calendar ID used when computing 
+*                  world coordinates
+* V580 *acm* 11/04- Fix divide by zero; cx_delta(idim,cx) is 0 if user
+*                   incorrectly specifies LIST/I=1:100:0 VAR
+* V68  *acm* 1/12  explicit single-precision calculations for consistent results in
+*		   for double-precision ferret
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+* V683  *acm*10/12  Fix bug 1972: cx_calendar and cx_cal_id are changed only
+*                   if it's the T dimension not the T or F dimension.
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'implicit.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+	include 'xtext_info.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+* calling argument declarations:
+	INTEGER	idim, cx, status
+
+* internal variable declarations:
+	LOGICAL TM_DATE_OK, TM_FPEQ, INHERITED_LIMITS, 
+     .		point, lim_redundant, is_time
+	INTEGER	TM_LENSTR1, ISUBSCR_CX,
+     .		ss, lo_ss, hi_ss, axis, grid, cat, var, ispread
+	INTEGER TM_GET_CALENDAR_ID, cal_id
+	REAL*8	TM_WORLD, SECS_TO_TSTEP, ww_nrst, ww_given
+	CHARACTER	VAR_CODE*128, string*128
+
+* initialize
+	var  = cx_variable( cx )
+	cat  = cx_category( cx )
+	grid = cx_grid    ( cx )
+	
+* For setting the calendar information just think about the time axis
+* (What if it's the F axis?)
+
+	is_time = idim .EQ. t_dim
+
+* check for special actions needed on user-defined variables
+* ( e.g. how to handle U[K=5] - U[K=1:10] )
+	IF ( cat .EQ. cat_user_var ) THEN
+	   lim_redundant = uvar_given( idim, var ) .LE. uvlim_gvn_xact
+     .		     .OR.  uvar_given( idim, var ) .EQ. uvlim_irrelevant
+     .		     .OR.  uvar_given( idim, var ) .EQ. uvlim_hidden
+	ELSE
+	   lim_redundant = .FALSE.
+	ENDIF
+
+* for modulo regridding the apparent limits supplied in the definition
+* are "swallowed" up by the regridding process. Externally applied limits
+* **should** be applied (e.g. A[GT=climatology at MOD,L=1:3] where A=SST[L=lo:hi])
+	IF ( .NOT.INHERITED_LIMITS(idim,cx) )  lim_redundant = .FALSE.
+
+* axis for this dimension
+	axis = grid_line( idim, grid )
+
+	IF ( axis .EQ. mnormal ) THEN
+* THIS AXIS IS NORMAL TO THE DEFINING GRID
+* wipe clean any stray information about it
+	   cx_lo_ss( cx, idim ) = unspecified_int4
+	   cx_hi_ss( cx, idim ) = unspecified_int4
+	   cx_lo_ww( idim, cx ) = unspecified_val8
+	   cx_hi_ww( idim, cx ) = unspecified_val8
+	   cx_delta( idim, cx ) = unspecified_val8
+	   cx_trans( idim, cx ) = trans_no_transform
+* kob 9/97 - need to reset cx_calendar as well
+
+	   IF (is_time) cx_calendar(cx) = .FALSE.
+
+* axes with fully "given" regions will have their regions determined via
+* MERGE_CONTEXT (when computed) or PASS_AMBIG_LIMS (when found in memory)
+* 5/99 - added ".AND. axis .LT. max_lines" -- we will go ahead with
+* fleshing out implicit axes (e.g. a[i=10:100:10])
+* to improve the cache hit rate when netCDF strides are used. Note the peril
+* in this is the behavior of a[i=3:5] where a=b[i=10:100:10]
+* 4/00: use line_class instead of max_lines as the test
+	ELSEIF ( .NOT.cx_given(idim,cx) .AND. lim_redundant
+     .		.AND. line_class(axis) .NE. pline_class_stride ) THEN
+!pre 4/00     .		.AND. axis .LT. max_lines ) THEN
+
+****
+* 7/92 kludge:
+* NOTE (4/01): logical variable in_get_grid_mode would be a more reliable soln
+* This routine is called by is_uvar_grid (while determining the grid)
+* BEFORE uvar_given has been determined.  When called from there lim_redundant
+* may be invalid.  Since uvar_given is initialized to uvlim_irrelevant we will
+* use this as value a test of whether the call is from is_uvar_grid
+* Probably it would be better to make this check while determining
+* lim_redundant, above, but that would be a more significant alteration of
+* working code - so this is the chicken-out solution
+* WAS:	   IF ( cx_trans(idim,cx) .NE. trans_no_transform ) GOTO 5000
+
+* 1/97 - might this kludge have been rendered unnecessary by the 1/97 change to
+*        the determination of lim_redundant??
+****
+	   IF ( cx_trans(idim,cx)    .NE. trans_no_transform
+     .    .AND. uvar_given(idim,var) .NE. uvlim_irrelevant ) GOTO 5000
+****
+	   cx_lo_ss( cx, idim ) = unspecified_int4
+	   cx_hi_ss( cx, idim ) = unspecified_int4
+	   cx_lo_ww( idim, cx ) = unspecified_val8
+	   cx_hi_ww( idim, cx ) = unspecified_val8
+	   cx_delta( idim, cx ) = unspecified_val8
+	   cx_trans( idim, cx ) = trans_no_transform
+* kob 9/97 - need to reset cx_calendar as well
+	   IF (is_time) THEN
+              cx_calendar(cx) = .FALSE.
+              cx_cal_id(cx) = unspecified_int4
+           ENDIF
+
+	ELSEIF ( cx_by_ss( idim, cx ) ) THEN
+* POSITIONS WERE SPECIFIED BY SUBSCRIPT
+* is there valid position data for this axis ?
+	   IF ( cx_lo_ss( cx, idim ) .EQ. unspecified_int4 ) THEN
+* ... no position data but maybe it's a file variable with only 1 point
+	      CALL VAR_SS_LIMS( idim, cx, lo_ss, hi_ss )
+! old	      IF ( lo_ss.EQ.unspecified_int4 .OR. lo_ss.NE.hi_ss ) RETURN
+	      IF ( lo_ss.EQ.unspecified_int4 ) RETURN
+	      cx_lo_ss(cx,idim) = lo_ss
+	      cx_hi_ss(cx,idim) = hi_ss
+	    ENDIF
+
+* if strides in use then set the upper subscript to correct parity
+	    IF (cx_delta(idim,cx) .NE. unspecified_val8) THEN
+	      IF (cx_delta(idim,cx) .LE. 0.) GOTO 5300
+	      ispread = cx_hi_ss(cx,idim) - cx_lo_ss(cx,idim)
+	      ispread = (ispread/NINT(cx_delta(idim,cx)))
+     .		      * NINT(cx_delta(idim,cx))
+	      cx_hi_ss(cx,idim) = cx_lo_ss(cx,idim) + ispread
+	    ENDIF
+
+* compute world positions as grid box edges
+	   cx_lo_ww(idim, cx) = TM_WORLD( cx_lo_ss( cx,idim),
+     .					  grid, idim, box_lo_lim )
+	   cx_hi_ww(idim, cx) = TM_WORLD( cx_hi_ss( cx,idim),
+     .					  grid, idim, box_hi_lim )
+
+	   IF ( is_time .AND. cx_calendar(cx) ) THEN
+             cal_id = TM_GET_CALENDAR_ID (line_cal_name(axis))
+             cx_cal_id(cx) = cal_id
+           ENDIF
+
+
+* POSITIONS WERE SPECIFIED BY WORLD COORDINATES
+	ELSE
+* is there valid position data for this axis ?
+	   IF ( cx_lo_ww( idim, cx ) .EQ. unspecified_val8 ) THEN
+* ... no position data but maybe it's a file variable with only 1 point
+	      CALL VAR_SS_LIMS( idim, cx, lo_ss, hi_ss )
+! old	      IF ( lo_ss.EQ.unspecified_int4 .OR. lo_ss.NE.hi_ss ) RETURN
+	      IF ( lo_ss.EQ.unspecified_int4 ) RETURN
+	      cx_lo_ss(cx,idim) = lo_ss
+	      cx_hi_ss(cx,idim) = hi_ss
+* ... compute world positions as grid box edges
+	      cx_lo_ww(idim, cx) = TM_WORLD( lo_ss, grid, idim, box_lo_lim )
+	      cx_hi_ww(idim, cx) = TM_WORLD( hi_ss, grid, idim, box_hi_lim )
+	    ENDIF
+
+	   point = cx_lo_ww(idim,cx) .EQ. cx_hi_ww(idim,cx)
+
+* convert times given as seconds from BC to time step values
+* *kob* 8/97 - use cx_calender instead of cx_lo_ww
+
+	   IF ( is_time .AND. cx_calendar(cx) ) THEN
+             cal_id = TM_GET_CALENDAR_ID (line_cal_name(axis))
+             IF ( TM_DATE_OK( line_t0(axis), cal_id ) ) THEN
+	         cx_lo_ww(idim,cx) =
+     .                SECS_TO_TSTEP( grid, idim, -cx_lo_ww(idim,cx) )
+	         cx_hi_ww(idim,cx) =
+     .                SECS_TO_TSTEP( grid, idim, -cx_hi_ww(idim,cx) )
+		 cx_calendar(cx) = .FALSE.
+                 cx_cal_id(cx) = cal_id
+              ENDIF
+	   ENDIF
+	      
+* world coordinate is a single point
+	   IF ( point ) THEN
+	      ww_given = cx_lo_ww(idim,cx)
+	      ss = ISUBSCR_CX(ww_given,grid,idim,cx,round_dn)
+	      ww_nrst = TM_WORLD( ss, grid, idim, box_middle )
+	      CALL GRID_SUBSCRIPT_EXTREMES( lo_ss, hi_ss, grid, idim )
+! ???	      CALL VAR_SS_LIMS( idim, cx, lo_ss, hi_ss )
+* ... need to interpolate ? 
+* Note: changed to TM_FPEQ(SNGL(xxx),...) 1/94  - testing indicates that
+*		double precision time ranges are nexer used at this point
+#ifdef double_p
+	      IF (  mode_interpolate
+     .	     .AND. .NOT.TM_FPEQ((ww_given),(ww_nrst)) ) THEN
+#else
+	      IF (  mode_interpolate
+     .	     .AND. .NOT.TM_FPEQ(SNGL(ww_given),SNGL(ww_nrst)) ) THEN
+#endif
+* ... set up context to interpolate
+	         IF ( cx_trans(idim,cx) .NE. trans_no_transform
+     .		.AND. cx_trans(idim,cx) .NE. trans_interpolate ) GOTO 5200
+	         cx_trans(idim,cx) = trans_interpolate
+	      ELSEIF ( cx_trans(idim,cx) .EQ. trans_no_transform ) THEN
+* ... interpolation not desired, needed or possible
+	         cx_lo_ww(idim,cx) = ww_nrst
+	         cx_hi_ww(idim,cx) = ww_nrst
+	         cx_lo_ss(cx,idim) = ss
+	         cx_hi_ss(cx,idim) = ss
+	      ELSE 
+* ... keep original (exact) limits if transformed axis ! 8/92
+	         cx_lo_ss(cx,idim) = ss
+	         cx_hi_ss(cx,idim) = ss
+	      ENDIF
+	   ELSE
+
+* world coordinates span a range
+* ... compute subscripts ( rounding inward to resolve ambiguities )
+	      cx_lo_ss( cx, idim ) = ISUBSCR_CX
+     .				(cx_lo_ww(idim, cx), grid, idim, cx,round_up)
+	      cx_hi_ss( cx, idim ) = ISUBSCR_CX 
+     .				(cx_hi_ww(idim, cx), grid, idim, cx,round_dn)
+	   ENDIF
+	ENDIF
+
+* TRANSFORMATION REDUCES RANGE TO A POINT ?
+	IF ( cx_trans(idim,cx) .GT. trans_compress_code ) THEN
+	   cx_lo_ss( cx, idim ) = unspecified_int4
+	   cx_hi_ss( cx, idim ) = unspecified_int4
+	   cx_by_ss( idim, cx ) = .FALSE.
+	ENDIF
+	   
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+! 5100	string = VAR_TRANS( idim, cx, slen )
+!	CALL ERRMSG( ferr_trans_nest, status,
+!     .			'DEFINEd var has fixed limits '//string(:slen), *5000 )
+ 5200	string = VAR_CODE( cx_category(cx), cx_variable(cx) )
+	CALL ERRMSG( ferr_trans_nest, status,
+     .		'cannot perform interpolation '//pCR//
+     .		ww_dim_name(idim)//' axis of '//string(:TM_LENSTR1(string))//
+     .		' is already transformed'//pCR//
+     .		'Can you define an intermediate variable ?',
+     .		*5000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'delta non-positive on '//ww_dim_name(idim)
+     .		//' axis of '//VAR_CODE(cx_category(cx),cx_variable(cx)),
+     .						*5000)
+	END
diff --git a/fer/ctx/forget_past_context_mods.F b/fer/ctx/forget_past_context_mods.F
new file mode 100644
index 0000000..cb853cc
--- /dev/null
+++ b/fer/ctx/forget_past_context_mods.F
@@ -0,0 +1,64 @@
+	SUBROUTINE FORGET_PAST_CONTEXT_MODS ( context )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* erase/clear away indicators of when last modifications were made to the given
+* context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - ???
+* revision 0.1 - 7/26/88 - documentation re-write
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	context
+
+* internal variable declarations:
+	INTEGER	idim
+
+	DO 100 idim = 1,nferdims
+ 100	cx_given( idim, context ) = .FALSE.
+
+	RETURN
+	END
diff --git a/fer/ctx/get_auto_aux_vars.F b/fer/ctx/get_auto_aux_vars.F
new file mode 100644
index 0000000..9a46228
--- /dev/null
+++ b/fer/ctx/get_auto_aux_vars.F
@@ -0,0 +1,130 @@
+	SUBROUTINE GET_AUTO_AUX_VARS( var, cat, dataset,
+     .			              curv_vars, curv_cats )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if curvilinear coordinates are applicable on a particular variable
+* by looking for the __SigmaRef_ and __CurviRef__ attributes
+* These may have been set either automatically, based upon CF 'coordinates'
+* and 'formula_terms' attributes found in a netCDF file, or have been set
+* manually using the SET VARIABLE/SIGMA and /CURV commands
+
+* inputs: var, cat, dset -- describe the variable for which we are seeking
+*		auxiliary coordinates
+* outputs: curv_vars, curv_cats -- the identities of the aux variables
+
+
+* *sh* 12/13
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xcommand.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xdset_info.cmn_text'
+
+* calling argument declarations
+	INTEGER	 var, cat, dataset,
+     .		 curv_vars(nferdims), curv_cats(nferdims)
+
+* internal variable declarations
+	LOGICAL	  NC_GET_ATTRIB, got_it
+	INTEGER	  TM_LENSTR1, 
+     .		  idim, dset, attlen, attoutflag, maxlen, varid, slen,
+     .		  status, aux_var, aux_cat
+	REAL	  attvals(10)   ! only if __SigmaRef_ mis-defined as numeric!
+	CHARACTER VAR_CODE*128, refvarname*128, varname*128,
+     .		  dsetname*128
+
+* XXXXX TEMPORARY -- if this is a uvar need to look at inherited uvar_aux*
+* as sources of curvilinear aux infor BUT will they be defined  get_grid 
+
+* initialize
+	dset = dataset
+	DO idim = 1, nferdims
+	   curv_vars(idim) = unspecified_int4
+	   curv_cats(idim) = unspecified_int4
+	ENDDO
+	varname = VAR_CODE(cat, var)
+
+* user-defined variables may be associated with inherited auxiliary variables
+	IF (cat .EQ. cat_user_var) THEN
+	   DO idim = 1, nferdims
+	      IF (uvar_aux_stat(var,idim) .EQ. paux_stat_passed
+     .	     .OR. uvar_aux_stat(var,idim) .EQ. paux_stat_needed ) THEN
+	         curv_vars(idim) = uvar_aux_var(var, idim, dataset)
+	         curv_cats(idim) = uvar_aux_cat(var, idim, dataset)
+	      ENDIF
+	   ENDDO
+	ENDIF
+
+* get the variable ID in the linked list  (user vars stored under dset=-1?)
+	IF (cat .EQ. cat_user_var) dset = -1  ! signals a uvar ??
+* NOTE: if dset=-1 signals uvar, it would seem that we'll see a bug if
+*       the same varname is used for LET/D definitions in two datasets
+	CALL CD_GET_VAR_ID (dset, varname, varid, status)  ! status check??
+
+* get the attribute value of '__SigmaRef_' (patnam_sigma)
+        maxlen = LEN(refvarname)
+        got_it = NC_GET_ATTRIB ( dset, varid, patnam_sigma,
+     .                           .FALSE., varname, maxlen,
+     .                           attlen, attoutflag, refvarname,
+     .                           attvals )
+        IF (.NOT.got_it) RETURN
+
+* Find the variable that has been named
+* NOTE:  wired to do only a Z axis  at this time  XXXXXXXXXXX
+        CALL FIND_VAR_NAME( dataset,
+     .			    refvarname,
+     .			    aux_cat, aux_var )
+	IF (aux_var .EQ. munknown_var_name) THEN
+* .... "Variable TEMP associated with non-existent sigma variable DEPTH"
+*      "in levitus_climatology"
+	   CALL GET_SHORT_DSET_NAME(dataset, dsetname, slen )
+	   CALL WARN('Variable '//varname(:TM_LENSTR1(varname)) //
+     .		' associated with non-existent sigma variable ' //
+     .		refvarname(:TM_LENSTR1(refvarname)) // pCR //
+     .		'           in ' //dsetname(:slen) )
+	ELSE
+	   curv_vars(z_dim) = aux_var
+	   curv_cats(z_dim) = aux_cat
+	ENDIF
+
+ 5000	RETURN
+
+* error exits
+
+	END
diff --git a/fer/ctx/get_aux_var_context.F b/fer/ctx/get_aux_var_context.F
new file mode 100644
index 0000000..6fa831a
--- /dev/null
+++ b/fer/ctx/get_aux_var_context.F
@@ -0,0 +1,174 @@
+	SUBROUTINE GET_AUX_VAR_CONTEXT
+     .		      ( var_cx,
+     .			aux_var_cx, 
+     .			aux_arg_num,
+     .			status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a full variable specification of the form:
+*			(eg.) TEMP[X=170E:170W,K=+1D,T=188979]
+* return in var_cx context information describing the exact variable instance
+* including variable, data set, grid, region and plane
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V685 - new based upon GET_VAR_CONTEXT
+
+* this routine gets the context of the auxiliary variable arguments (e.g."depth")
+* within parenthese in the format   VAR[gz(depth)=zax at ave]
+*  
+
+* it is performed in two steps: first get the context of the main variable
+* VAR.  Then use the context of the parent variable as the default for the
+* auxiliary variable ("depth")
+
+	IMPLICIT NONE
+
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+        include 'tmap_dims.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+        include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	 var_cx, aux_var_cx, aux_arg_num, status
+
+* internal variable declarations:
+	INTEGER	 TM_LENSTR1, AUX_AXIS_FROM_ARG,
+     .		 the_axis, var_axis, aux_var_axis, i, j, idim
+	CHARACTER*128 VAR_CODE, var_name, aux_var_name
+
+* initialize
+	status = ferr_ok
+
+* copy the var_context to form the base for the aux_var context
+	CALL TRANSFER_CONTEXT(var_cx, aux_var_cx)	
+
+* remove regridding requests - aux vars must always be on native grids
+	cx_has_impl_grid( aux_var_cx ) = .FALSE.
+	cx_unstand_grid ( aux_var_cx ) = .FALSE.
+	cx_grid		( aux_var_cx ) = unspecified_int4  ! cannot assume parent grid 
+
+* which auxiliary var is the subject of interest?
+* e.g. for "temp[gz(depth)=zax]" the argument "depth" is found in the z dim
+	the_axis = AUX_AXIS_FROM_ARG(var_cx, aux_arg_num)
+
+* pull the auxiliary variable identity from the parent context
+	cx_category(aux_var_cx) = cx_aux_cat(the_axis, var_cx)
+	cx_variable(aux_var_cx) = cx_aux_var(the_axis, var_cx)
+
+* remove traces of further aux var dependency
+	cx_naux         ( aux_var_cx ) = 0
+	DO idim = 1, nferdims
+	   cx_aux_cat (idim,aux_var_cx) = unspecified_int4  ! just bookkeeping
+	   cx_aux_var (idim,aux_var_cx) = unspecified_int4  ! just bookkeeping
+	   cx_aux_stat(idim,aux_var_cx) = paux_stat_na
+	ENDDO
+
+* insert bad data flag for variable
+	CALL GET_CONTEXT_BAD_FLAG( aux_var_cx )
+
+* insert data type for variable
+	CALL KNOWN_DATA_TYPE( aux_var_cx )
+
+* determine the defining grid of the auxiliary variable
+	CALL GET_CONTEXT_GRID ( aux_var_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+! check <0 to trap "hack" from GET_CONTEXT_MODS
+	IF ( cx_grid(aux_var_cx) .EQ. unspecified_int4
+     .	.OR. cx_grid(    var_cx) .EQ. unspecified_int4
+     .  .OR. cx_grid(    var_cx) .LE. 0                  ) RETURN 
+! return here is only reasonable during getgrid phase.  Not during eval phase.
+
+* set up the axes of the aux variable
+* only the regridding axis(s) of the aux grid may differ from the parent
+	DO 500 idim = 1, nferdims
+	   aux_var_axis = grid_line(idim,cx_grid(aux_var_cx))
+	   var_axis     = grid_line(idim,cx_grid(    var_cx))
+	   IF (idim .EQ. the_axis) THEN
+	      IF (aux_var_axis .EQ. mnormal) GOTO 5300 
+* ... set up to get the full index range on the regrid axes of the aux var
+              cx_lo_ss ( aux_var_cx, idim )  = unspecified_int4
+              cx_hi_ss ( aux_var_cx, idim )  = unspecified_int4
+              cx_lo_ww ( idim, aux_var_cx )  = unspecified_val8
+              cx_hi_ww ( idim, aux_var_cx )  = unspecified_val8
+              cx_by_ss ( idim, aux_var_cx )  = .FALSE.       !for bookkeeping
+              cx_given( idim, aux_var_cx )   = .FALSE.
+	   ELSEIF (aux_var_axis .EQ. var_axis) THEN
+	      GOTO 500		! already fleshed out through TRANSFER_CONTEXT
+	   ELSEIF (aux_var_axis .NE. mnormal) THEN
+	      GOTO 5400
+	   ENDIF
+	   CALL FLESH_OUT_AXIS( idim, aux_var_cx, status )  ! always ferr_ok
+	   IF (status .NE. ferr_ok) 
+     .	      CALL ERRMSG( ferr_internal, status, 'aux_var_ax', *5000)
+ 500	CONTINUE
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5300	aux_var_name = VAR_CODE(cx_category(aux_var_cx),
+     .			        cx_variable(aux_var_cx) )
+	var_name     = VAR_CODE(cx_category(var_cx),
+     .			        cx_variable(var_cx) )
+	i = TM_LENSTR1(aux_var_name)
+	j = TM_LENSTR1(    var_name)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .          'auxiliary variable '//
+     .		aux_var_name(:i)//' lacks the '//
+     .		ww_dim_name(the_axis)//' axis '//
+     .	        'it needs to regrid '//var_name(:j), *5000 )
+ 5400	aux_var_name = VAR_CODE(cx_category(aux_var_cx),
+     .			        cx_variable(aux_var_cx) )
+	var_name     = VAR_CODE(cx_category(var_cx),
+     .			        cx_variable(var_cx) )
+	i = TM_LENSTR1(aux_var_name)
+	j = TM_LENSTR1(    var_name)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .          'auxiliary variable '//
+     .		aux_var_name(:i)//' has a '//
+     .		ww_dim_name(idim)//' axis '//
+     .	        'not found on variable '//var_name(:j), *5000 )
+	END
diff --git a/fer/ctx/get_context_bad_flag.F b/fer/ctx/get_context_bad_flag.F
new file mode 100644
index 0000000..3ae952a
--- /dev/null
+++ b/fer/ctx/get_context_bad_flag.F
@@ -0,0 +1,81 @@
+	SUBROUTINE GET_CONTEXT_BAD_FLAG ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* insert bad data flag into context for variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/1/87
+
+* V510 5/00 *sh* - user variables with settable bad flags
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xpyvar_info.cmn'
+	include	'xvariables.cmn'
+
+	INTEGER cx
+
+
+	IF     ( cx_category( cx ) .EQ. cat_file_var .OR.
+     .           cx_category( cx ) .EQ. cat_aggregate_var ) THEN
+
+	   cx_bad_data( cx ) = ds_bad_flag( cx_variable( cx ) )
+
+        ELSEIF ( cx_category(cx) .EQ. cat_pystat_var ) THEN
+
+           cx_bad_data( cx ) = pyvar_missing_flag( cx_variable( cx ) )
+
+	ELSEIF     ( cx_category( cx ) .EQ. cat_user_var ) THEN
+
+	   cx_bad_data( cx ) = uvar_bad_data( cx_variable( cx ) )
+
+	ELSE
+
+	   cx_bad_data( cx ) = bad_val4
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/ctx/get_context_grid.F b/fer/ctx/get_context_grid.F
new file mode 100644
index 0000000..f3cc2ce
--- /dev/null
+++ b/fer/ctx/get_context_grid.F
@@ -0,0 +1,447 @@
+	SUBROUTINE GET_CONTEXT_GRID ( cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the grid to use for a single variable evaluation
+* the given context must have the logical cx_unstand_grid set and
+* if .TRUE. it must have a cx_grid value
+
+* (9/95) if cx_has_impl_grid is set then we must reconcile the grid that
+* is implied (cx_impl_grid) with a grid that may or may not have been
+* explicitly mentioned (cx_grid).
+*	If they match -- return the explicit grid
+*	If they don't -- complete the implicit grid definition
+* If an implicit grid matches an existing non-implicit grid return that,
+* else "allocate" an implicit grid (either by creating one or by incrementing
+* the usage count for that grid)
+* Also, if delta specifications were used (e.g. var[i=1:100:10]) then an
+* implicit axis AND grid must be created.
+
+*************************************
+* *** MANAGING DYNAMIC GRIDS AND AXES:  OVERVIEW  ***
+
+* see also explanations of TMAP library grid and axis allocation schemes
+* in routines TM_ALLO_DYN_GRID and TM_ALLO_DYN_LINE
+
+* Implicit (dynamic) grids and axes must be tracked so that 1) they
+* are deleted when no longer needed and 2) they are never deleted
+* while still in use.  Deletion makes the "slot" available for re-use.
+* The information indicating when a dynamic grid or line is needed is
+* contained in its "use count" (use_cnt).  At various points the terms
+* "incrementing", "allocating" and "using" may be used synonymously.
+* These refer to TM_ALLO_DYN_... and TM_USE_.... Similarly,
+* "decrementing" is the same as TM_DEALLOC_DYN_...  Deallocation may
+* or may not be the same as "deletion" of a grid or line -- it will be
+* deleted only if its usage count falls to zero.
+
+* Grids have their use count incremented for each user variable (or
+* intermediate result) that depends on the grid.  The "intermediate
+* result" refers to entities that come into existence only briefly
+* during the evaluation of an expression.  Take, for example, the
+* expression "VAR[gx=var2] + 5":  during the "get_grid" phase a
+* dynamic grid is determined for this expression and pointed to by
+* uvar_grid.  As a result of this "usage" the grids use-cnt is
+* incremented (from 0 to 1 if it is newly created).  Now during the
+* evaluation of the expression the intermediate result "VAR[gx=var2]"
+* will be passed to to GET_VAR_CONTEXT.  The routines GET_CONTEXT_MODS
+* and GET_CONTEXT_GRID will determine a grid for this sub-expression.
+* Since this grid happens to be the same as the grid of the full
+* expression (which differs only in the addition "+5") the use count
+* will be momentarily incremented (from 1 to 2) while this
+* intermediate result exists on the stack.
+
+* Usage of dynamic grids by intermediate results is tracked with the
+* boolean cx_has_impl_grid -- i.e. responsibility for incrementing and
+* decrementing lies with the **context**.  This responsibility may be
+* passed from one intermediate result to another.
+
+* A lines (axis) has its use count incremented whenever a grid uses
+* the line or whenever another (dynamic) line is created as a child of
+* this line.  Correspondingly the use count is decremented (resulting
+* in deletion if it falls to zero) whenever the corresponding grid or
+* child axis is deleted.  The responsibility in the grids is indicated
+* by grid_line(idim,grid) > max_lines.  The responsibility in child
+* lines is indicated in line_parent.  The responsibility for the line
+* may be transferred from one grid to another (see calls to
+* TM_COPY_GRID_W_LINE_USE)
+* Note: as of 4/00 ALL grids and axes maintain use counts
+
+*************************************
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 10/14/86
+* revision 0.1 - 2/18/88 - checks for unspecified grid ( used to flag computed
+*			   variables that are non-GFDL/205 output )
+* revision 0.2 -  4/7/88 - improved error message for calculated vars
+* revision 0.3 -  4/1/89 - determine regridding transformations
+
+* V230: 8/23/92 - impose xyave regrid if appropriate (was in GET_CONTEXT_MODS)
+* V420: 9/95	- Support for implicit grid: flesh out the grid here
+*	10/95	- support for implicit axes: create axes here and insert
+*		  into implicit grid
+*	 1/96	- idim subscripting bug fixed 1/96 ... how did it escape?
+
+* $Id: get_context_grid.F 17182 2014-04-01 00:38:04Z ksmith $ 
+*       - add check on cx_calendar rather than cx_lo/hi_ww to indicate whether time
+*         is date or timesteps
+* V500 *kob* 3/99- up VAR_CODE decl from 8 to 64 chars
+* V510: *sh* 9/99 - bug revealed while implementing SAMPLE* functions
+*		if cx_unstand_grid is FALSE on coming into this routine
+*		then the basic grid for the result shoud be std_grid. The
+*		value of use_grid upon entry cannot be trusted to be correct
+*	*sh* 4/00 - since netCDF dsets use dynamic grids now, all grids and
+*		  lines maintain a use count
+* V520: 6/00 *sh* - bug fix - if the quick exit is taken here because
+*		std_grid is not yet known the axes within the implicit grid
+*		were never allocated so dont deallocate them
+* V532: *sh* 6/01 - bug fix: err522_impl_ax_ignored.jnl -- the variable
+*		impl_grid wasn't initialized if cx_impl_grid was set
+*		in get_context_mods by gx=name
+* V533: *sh* 6/01 - set regrid transform for strides to prgrd_xact_pts
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690 12/13 *sh* set default regrid transforms for aux var regridding transform
+*	          set up dynamic axis if cx_delta=pauto_1pt_ax
+
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'interp_stack.parm'
+	include 'tmap_dims.parm'
+	include 'xcontext.cmn'
+	include 'xalgebra.cmn'
+	include 'xtext_info.cmn'
+	include 'xprog_state.cmn'
+	include 'implicit.parm'
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xfr_grid.cmn'   ! stack ptr should be in TMAP lib
+
+* calling argument declarations:
+	INTEGER	cx, status
+
+* internal variable declarations:
+        LOGICAL   GEOG_COS_FACTOR, GEOG_LABEL,
+     .		  its_dyn, has_impl_axis, explicit_unstd
+	INTEGER	  KNOWN_GRID, 
+     .		  use_grid, ilo, ihi,
+     .		  cat, var, dset, std_grid, std_axis, use_axis, idim,
+     .		  base_grid, impl_grid
+	REAL*8	  SECS_TO_TSTEP, dlo, dhi, delta
+	CHARACTER VAR_CODE*128
+
+* initialize
+	cat  = cx_category( cx )
+	var  = cx_variable( cx )
+	dset = cx_data_set( cx )
+        use_grid = cx_grid( cx )
+	explicit_unstd = cx_unstand_grid( cx ) ! 9/99
+
+* by this point the variable and data set must be known
+	IF ( var .EQ. unspecified_int4 )	CALL ERRMSG
+     .			( ferr_syntax,status,'no variable specified',*5000 )
+	IF ( ( cat.EQ.cat_file_var .OR. cat.EQ.cat_aggregate_var .OR. cat.EQ.cat_calc_var )
+     .	.AND. dset.EQ.unspecified_int4 )	CALL ERRMSG
+     .			( ferr_state_not_set,status,'SET DATA_SET',*5000 )
+
+* determine the standard grid for this variable
+	std_grid = KNOWN_GRID( dset, cat, var )
+
+* if the standard grid isn't known then return to the stack to get it
+	IF ( std_grid .EQ. unspecified_int4 ) THEN
+	   IF ( cx_has_impl_grid(cx) ) THEN
+#ifdef debug_dyn_grids
+	      IF ( mode_diagnostic )  CALL DIAG_OP
+     .	     ('dealloc ',isact_class_impl_grid,cx_impl_grid(cx),0)
+#endif
+* ... grid was barely started by GET_CONTEXT_MODS. Axes were never allocated
+	      CALL DEALLO_UNFORMED_GRID(status)
+	   ENDIF
+	   RETURN
+	ENDIF
+
+* regridding implied through delta values or special transformations?
+	has_impl_axis = .FALSE.
+	DO 10 idim = 1, nferdims
+	   IF (cx_delta(idim,cx) .NE. unspecified_val8) THEN
+* ... make sure the specified delta makes sense (this test moved 1/96)
+	      IF ( cx_delta(idim,cx) .NE. unspecified_val8
+     .	     .AND. cx_delta(idim,cx) .NE. pauto_1pt_ax
+     .	     .AND. cx_delta(idim,cx) .LE. 0.0D0		) GOTO 5200
+	      has_impl_axis = .TRUE.
+	   ENDIF
+ 10	CONTINUE
+	IF ( has_impl_axis ) THEN
+
+* ... we need an implicit grid to hold the axes so make it if we don't have one
+	   IF ( .NOT.cx_has_impl_grid(cx) ) THEN
+	      CALL ALLO_GRID_TO_CX( cx, impl_grid, status )
+	      IF (status .NE. ferr_ok) GOTO 5000
+	      cx_unstand_grid(cx) = .TRUE.
+	   ELSE
+	      impl_grid = cx_impl_grid(cx)  ! allo'd in get_context_mods 
+	   ENDIF
+* ... make the implicit axes and save them in the implicit grid
+	   DO 20 idim = 1, nferdims
+	      IF (cx_delta(idim,cx) .NE. unspecified_val8) THEN
+! ... trap for twice-defined axis of implicit grid is removed because
+!	var[g=var2,gx=lo:hi:del] needs to be a legal expression
+!	         IF ( grid_line(idim,impl_grid).NE.unspecified_int4 )
+!     .							GOTO 5100
+	         IF ( cx_by_ss(idim,cx) ) THEN
+* ... clip to axis ss limits
+	            CALL GRID_SUBSCRIPT_EXTREMES(ilo, ihi, std_grid, idim)
+		    IF (cx_lo_ss(cx,idim) .LT. ilo ) THEN	! ilo is 1
+! unused code: "modulo clip" -> ss #1 to be a multiple of delta from users strt
+!	               n = 1 - INT(cx_lo_ss(cx,idim)/cx_delta(idim,cx))
+!	               dlo = cx_lo_ss(cx,idim) + n * cx_delta(idim,cx)
+	               dlo = 1
+	            ELSE
+	               dlo = cx_lo_ss(cx,idim)
+	            ENDIF
+	            dlo = MAX(ilo, cx_lo_ss(cx,idim))
+	            dhi = MIN(ihi, cx_hi_ss(cx,idim))
+	            IF ( dlo .GT. dhi ) GOTO 5300
+	            CALL TM_GET_LIKE_DYN_LINE(	idim,
+     .						dlo,
+     .						dhi,
+     .						cx_delta(idim,cx),
+     .						grid_line(idim,std_grid),
+     .						pline_class_stride,
+     .						grid_line(idim,impl_grid),
+     .						status)
+	            cx_lo_ss(cx,idim) = 1
+	            cx_hi_ss(cx,idim) = line_dim(grid_line(idim,impl_grid))
+	            IF (cx_regrid_trans(idim,cx) .EQ. unspecified_int4 )
+     .			 cx_regrid_trans(idim,cx) = prgrd_xact_pts
+	         ELSE
+* ... dont clip to axis world limits
+* Note: It would be nicer not to clip but instead to allow any new size of
+*	dynamic axis.  Some time spent on this produced "explicit limit"
+*	errors from PASS_AMBIG_LIMS -- but only for irregular axis.  See
+*	try_impl_line_{ok,bad}.jnl in $fsrc/errors
+* ... copy into buffers because dates need to be modified to time steps
+	            dlo = cx_lo_ww(idim,cx)
+	            dhi = cx_hi_ww(idim,cx)
+	            delta = cx_delta(idim,cx)
+	            IF (delta .EQ. pauto_1pt_ax) THEN
+	               IF (dlo .EQ. dhi) THEN
+* generate a single point axis.  The delta of such a line is arbitrary.
+	                  IF (dlo .EQ. 0.0) THEN
+	                     delta = 0.00001
+	                  ELSE
+	                     delta = dlo * 0.00001
+	                  ENDIF
+	               ELSE
+	                  delta = dhi - dlo
+	                  dlo   = (dlo + dhi)/2
+	                  dhi   = dlo 
+	               ENDIF
+	            ENDIF
+	            IF (idim.EQ.t_dim .OR. idim.EQ.f_dim) THEN
+* 8/97 *kob* use cx_calender to check if time is date rather than time step
+	               IF ( cx_calendar(cx) ) THEN
+	                  IF (.NOT.GEOG_LABEL(idim,std_grid)) GOTO 5400
+	                  dlo = SECS_TO_TSTEP(std_grid,idim,-1.*cx_lo_ww(idim,cx))
+	                  dhi = SECS_TO_TSTEP(std_grid,idim,-1.*cx_hi_ww(idim,cx))
+			  delta = delta * 3600
+     .				/ line_tunit(grid_line(idim,std_grid)) !was hrs
+	               ENDIF
+	            ENDIF
+	            CALL TM_GET_LIKE_DYN_LINE(	idim,
+     .						dlo,
+     .						dhi,
+     .						delta,
+     .						grid_line(idim,std_grid),
+     .						pline_class_basic,
+     .						grid_line(idim,impl_grid),
+     .						status)
+	         ENDIF
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+!! this commented out block didn't work because an unspecified region
+!!   lead to the SET REGION default being imposed with ss limits in conflict
+!!   with the dynamic axis dimension
+!! Set up to look like regridding was requested without the limits specified
+!! This is so there is no conflict of explicit limits in cases like
+!!     LET a = var[i=lo1:hi1:del];   LIST a[i=lo2:hi2]
+!	         cx_lo_ss(cx,idim) = unspecified_int4
+!	         cx_hi_ss(cx,idim) = unspecified_int4
+!	         cx_lo_ww(idim,cx) = unspecified_val8
+!	         cx_hi_ww(idim,cx) = unspecified_val8
+!	         cx_given(idim,cx) = .FALSE.
+	         cx_delta(idim,cx) =  unspecified_val8
+	      ENDIF
+ 20	   CONTINUE
+	ENDIF
+
+* use the standard grid ?
+	IF ( .NOT. cx_unstand_grid( cx ) ) THEN
+	   cx_grid( cx ) = std_grid
+	   RETURN
+	ENDIF
+
+* handle implicit (dynamic) grid creation
+	IF ( cx_has_impl_grid(cx) ) THEN
+* ... build a (temporary) implicit grid (9/99 logic mod)
+	   IF ( explicit_unstd
+     .	  .AND. use_grid .NE. unspecified_int4 ) THEN
+	      base_grid = use_grid
+	   ELSE
+	      base_grid = std_grid
+	   ENDIF
+	   impl_grid = cx_impl_grid(cx)
+* ... any axis that wasn't given by the user comes from the source grid
+	   DO 50 idim = 1, nferdims
+	      IF ( grid_line(idim,impl_grid).EQ.unspecified_int4 )
+     .		   grid_line(idim,impl_grid) = grid_line(idim,base_grid)
+ 50	   CONTINUE
+	   use_grid = impl_grid
+
+* increment the use count of dynamic axes that are in-use by the temporary grid
+	   DO 60 idim = 1, nferdims
+ 60	   CALL TM_USE_LINE(grid_line(idim,impl_grid))
+	ENDIF
+
+* 9/95 check for incompatibilities in grid geometry -- requiring implicit grid
+* (i.e. chk for a normal axis in one grid without same in other)
+	DO 70 idim = 1, nferdims
+	   IF (  (grid_line(idim,std_grid).EQ.mnormal)
+     .    .NEQV. (grid_line(idim,use_grid).EQ.mnormal) )   THEN
+* ... allocate and initialize some work space if we don't already have it
+	      IF (.NOT.cx_has_impl_grid(cx)) THEN 
+	         CALL ALLO_GRID( impl_grid,status )
+	         IF (status .NE. ferr_ok) GOTO 5000
+	         CALL TM_COPY_GRID_W_LINE_USE(use_grid, impl_grid)
+	         grid_name(impl_grid) = '(conformable)'
+	         cx_has_impl_grid(cx) = .TRUE.
+!	         cx_impl_grid(cx) = impl_grid
+#ifdef debug_dyn_grids
+                 IF ( mode_diagnostic )  CALL DIAG_OP
+     .              ('allocate', isact_class_impl_grid, impl_grid, 0)
+#endif
+	      ENDIF
+	      CALL TM_DEALLO_DYN_LINE(grid_line(idim,impl_grid))
+	      grid_line(idim,impl_grid) = grid_line(idim,std_grid)
+	      CALL TM_USE_LINE(grid_line(idim,impl_grid))
+	   ENDIF
+ 70	CONTINUE
+
+* catalog implicit definition (which is temporarily stored on the grid
+* stack) as a dynamic grid -- checking for existing matching grids
+	IF ( cx_has_impl_grid(cx) ) THEN
+	   CALL TM_GET_LIKE_DYN_GRID(impl_grid,its_dyn,use_grid,
+     .			grd_stk_ptr, status)
+	   IF (status .NE. merr_ok) GOTO 5000
+	   IF ( its_dyn ) THEN
+	      IF ( mode_diagnostic )  CALL DIAG_OP
+     .	     ('allocate', isact_class_impl_grid, use_grid, 0)
+	   ELSE
+	      cx_has_impl_grid(cx) = .FALSE.
+	   ENDIF
+
+* ... deallocate the (now unnecessary) implicit stack-based grid
+#ifdef debug_dyn_grids
+	   IF ( mode_diagnostic )  CALL DIAG_OP
+     .	  ('dealloc ', isact_class_impl_grid, impl_grid, 0)
+#endif
+	   CALL DEALLO_GRID(status)
+
+	   cx_grid(cx) = use_grid
+	ENDIF
+
+* flesh out regridding transformations
+	DO 100 idim = 1, nferdims
+	   use_axis = grid_line( idim, use_grid )
+	   std_axis = grid_line( idim, std_grid )
+
+	   IF ( use_axis .EQ. std_axis ) THEN
+	      cx_regrid_trans( idim, cx ) = prgrd_exact
+	   ELSEIF ( cx_regrid_trans(idim,cx) .EQ. unspecified_int4 ) THEN
+	      IF (cx_naux(cx) .EQ. 0) THEN
+	         cx_regrid_trans( idim, cx ) = prgrd_linear_interp
+	      ELSE
+	         cx_regrid_trans( idim, cx ) = pauxrgrd_linear
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+
+* change X and Y linear average to area average if appropriate  ! 8/92
+        IF ( cx_regrid_trans(x_dim,cx) .EQ. prgrd_average
+     . .AND. cx_regrid_trans(y_dim,cx) .EQ. prgrd_average ) THEN
+           IF ( GEOG_COS_FACTOR(y_dim,std_grid)
+     .    .AND. GEOG_COS_FACTOR(y_dim,use_grid) ) THEN
+              cx_regrid_trans(x_dim,cx) = prgrd_xy_ave
+              cx_regrid_trans(y_dim,cx) = prgrd_xy_ave
+           ENDIF
+        ENDIF
+
+* change X and Y linear interpolation to call do_xylin_regrid if appropriate  ! 6/11
+        IF ( cx_regrid_trans(x_dim,cx) .EQ. prgrd_linear_interp
+     . .AND. cx_regrid_trans(y_dim,cx) .EQ. prgrd_linear_interp ) THEN
+           IF ( GEOG_COS_FACTOR(y_dim,std_grid)
+     .    .AND. GEOG_COS_FACTOR(y_dim,use_grid) ) THEN
+              cx_regrid_trans(x_dim,cx) = prgrd_xy_lin
+              cx_regrid_trans(y_dim,cx) = prgrd_xy_lin
+           ENDIF
+        ENDIF
+
+ 5000	RETURN
+
+* error exits
+! 5100	CALL ERRMSG( ferr_invalid_command, status,
+!     .		'mixed regridding and delta limits on '//ww_dim_name(idim)
+!     .		//' axis of '//VAR_CODE(cx_category(cx),cx_variable(cx)),
+!     .								*5000)
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'delta non-positive on '//ww_dim_name(idim)
+     .		//' axis of '//VAR_CODE(cx_category(cx),cx_variable(cx)),
+     .								*5000)
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'outside limits: '//ww_dim_name(idim)
+     .		//' axis of '//VAR_CODE(cx_category(cx),cx_variable(cx)),
+     .								*5000)
+ 5400	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Cannot use dates - not a calendar axis: '//
+     .		VAR_CODE(cx_category(cx),cx_variable(cx)),
+     .								*5000)
+	END
diff --git a/fer/ctx/get_cx_dims.F b/fer/ctx/get_cx_dims.F
new file mode 100644
index 0000000..a2050c3
--- /dev/null
+++ b/fer/ctx/get_cx_dims.F
@@ -0,0 +1,95 @@
+	SUBROUTINE GET_CX_DIMS( cx, ndim, dim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the "shape" of the region specified in context cx by returning
+* array, dim, which contains a permutation of the 4 defining axes 1,2,3,4
+* and, ndim, the number of axes for which there is a range of data.
+* The permutation is first those axes which contain a range of data
+* (subsampled from the ordering 1,2,3,4) followed by the axes for which the
+* context specifies only a single point
+
+* e.g. for the expression SST[X=130e:70w,t="1-jan-1982":"31-dec-1983",Y=0]
+* ndim = 2
+* dim = 1,4,2,3		(the Z axis is normal for SST)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  5/18/89 - complete re-write from GET_CONTEXT_PLANE
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER cx, ndim, dim(nferdims)
+
+* local variable declarations:
+	INTEGER	CX_DIM_LEN, idim, ii, clen(nferdims)
+
+* initialize
+	ndim = 0
+	DO 10 idim = 1, nferdims
+ 10	clen(idim) = CX_DIM_LEN( idim, cx )
+
+* find the axes with a range of values
+	DO 100 idim = 1, nferdims
+	   IF ( clen(idim) .GT. 1 ) THEN
+	      ndim = ndim + 1
+	      dim(ndim) = idim
+	   ENDIF
+ 100	CONTINUE
+
+* find the axes where the context is a single point
+	ii = ndim
+	DO 200 idim = 1, nferdims
+	   IF ( clen(idim) .EQ. 1 ) THEN
+	      ii = ii + 1
+	      dim(ii) = idim
+	   ENDIF
+ 200	CONTINUE
+
+	RETURN	   
+	END
diff --git a/fer/ctx/get_cx_dims_zero.F b/fer/ctx/get_cx_dims_zero.F
new file mode 100644
index 0000000..37840f0
--- /dev/null
+++ b/fer/ctx/get_cx_dims_zero.F
@@ -0,0 +1,111 @@
+	SUBROUTINE GET_CX_DIMS_ZERO( cx, ndim, dim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the "shape" of the region specified in context cx by returning
+* array, dim, which contains a permutation of the 4 defining axes 1,2,3,4
+* and, ndim, the number of axes for which there is a range of data.
+* The permutation is first those axes which contain a range of data
+* (subsampled from the ordering 1,2,3,4) followed by the axes for which the
+* context specifies only a single point
+
+* e.g. for the expression SST[X=130e:70w,t="1-jan-1982":"31-dec-1983",Y=0]
+* ndim = 2
+* dim = 1,4,2,3		(the Z axis is normal for SST)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  5/18/89 - complete re-write from GET_CONTEXT_PLANE
+* 10/2004 *acm*
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* For disp_init and extract_line, distinguish between axes which really 
+* have one point, and those for which the hi and lo subscripts on the axes 
+* are undefined. When undefined return zero from CX_DIM_LEN_ZERO. These axes 
+* are listed last in the heirarchy in array dim().  This means we can 
+* plot a variable with just one point in their range (if /HLIMITS or 
+* /VLIMITS are used to give PPLUS a range to draw).
+
+	include	'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER cx, ndim, dim(nferdims)
+
+* local variable declarations:
+	INTEGER	CX_DIM_LEN_ZERO, idim, ii, clen(nferdims)
+
+* initialize
+	ndim = 0
+	DO 10 idim = 1, nferdims
+ 10	clen(idim) = CX_DIM_LEN_ZERO( idim, cx )
+
+* find the axes with a range of values
+	DO 100 idim = 1, nferdims
+	   IF ( clen(idim) .GT. 1 ) THEN
+	      ndim = ndim + 1
+	      dim(ndim) = idim
+	   ENDIF
+ 100	CONTINUE
+
+* find the axes where the context is a single point
+	ii = ndim
+	DO 200 idim = 1, nferdims
+	   IF ( clen(idim) .EQ. 1) THEN
+	      ii = ii + 1
+	      dim(ii) = idim
+	   ENDIF
+ 200	CONTINUE
+
+* find the axes where the context is no points
+
+	DO 300 idim = 1, nferdims
+	   IF ( clen(idim) .EQ. 0 ) THEN
+	      ii = ii + 1
+	      dim(ii) = idim
+	   ENDIF
+ 300	CONTINUE
+
+	RETURN	   
+	END
diff --git a/fer/ctx/get_cx_modulo_axes.F b/fer/ctx/get_cx_modulo_axes.F
new file mode 100644
index 0000000..99fe681
--- /dev/null
+++ b/fer/ctx/get_cx_modulo_axes.F
@@ -0,0 +1,67 @@
+	SUBROUTINE GET_CX_MODULO_AXES( cx, modulo )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the modulo status of all 4 axes of a context grid
+* ... all 4 at once for performance reasons -- so this is called 1/4 as often
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+	INTEGER	cx
+	LOGICAL modulo(nferdims)
+
+* internal variable declarations:
+	INTEGER	grid, idim
+
+	grid = cx_grid(cx)
+
+	DO 100 idim = 1, nferdims
+ 100 	modulo(idim) = line_modulo(grid_line(idim,grid))	
+
+	RETURN
+	END
diff --git a/fer/ctx/get_delta_context.F b/fer/ctx/get_delta_context.F
new file mode 100644
index 0000000..9214a11
--- /dev/null
+++ b/fer/ctx/get_delta_context.F
@@ -0,0 +1,124 @@
+	SUBROUTINE GET_DELTA_CONTEXT ( slash_dx0, delta_given, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* interpret delta coordinate limits of the FORM DX
+* ... slash_dx0 is the qualifier number of dx less 1
+* qualifiers are assumed to be ordered dx,dy,dz,dt,di,dj,dk,dl
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/27/89
+*	  5/2/90 - half extracted to APPLY_DELTA_CONTEXT
+* V420 (IBM/AIX port of V411): 10/5/95 - buffer for "READ(var,*"
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* specifiers may give coordinate in subscript units (/DI,/DJ,/DK,/DL) or
+* may give coordinate in "world" units (/DX,/DY,/DZ,/DT)
+* the specifiers may be of the following forms:
+*	/q=val			specifies a single delta
+*	/q=val_1:val_2		specifies a separate delta for lowe and upper
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'	
+	include 'ferret.parm'	
+	include 'xcontext.cmn'
+	include 'xdelta_context.cmn'
+	include 'xprog_state.cmn'
+
+* calling arguments:
+	LOGICAL		delta_given
+	INTEGER		slash_dx0, status
+
+* internal variables:
+	INTEGER		TM_LENSTR1, colon_pos, wworss, idim, iqual, loc, rlen
+	CHARACTER	string*40, raw_string*44
+
+* initialize
+	delta_given = .FALSE.
+	DO 10 idim = 1, nferdims
+ 10	dcx_given( idim ) = .FALSE.
+
+* decode the delta qualifiers
+	DO 200 wworss = 0, (nferdims+1), nferdims
+	DO 100 idim = 1, nferdims
+
+	   iqual = slash_dx0 + wworss + idim
+	   loc = qual_given( iqual )
+	   IF ( loc .EQ. 0 ) GOTO 100
+
+	   delta_given = .TRUE.
+	   IF ( dcx_given(idim) ) GOTO 5100
+	   dcx_given(idim) = .TRUE.
+
+* get the qualifier string
+	   raw_string = cmnd_buff(qual_start(loc):qual_end(loc))
+	   rlen = TM_LENSTR1(raw_string)
+	   CALL EQUAL_STRING( raw_string, string, status )
+
+* decode it
+	   colon_pos = INDEX( string, ':' )
+	   IF ( colon_pos .EQ. 0 ) THEN
+	      READ( string, *, ERR=5200 ) dcx_lo(idim)
+	      dcx_hi(idim) = dcx_lo(idim)		   
+	   ELSE
+	      raw_string = string(:colon_pos-1)
+	      READ( raw_string, *, ERR=5200 ) dcx_lo(idim)	! AIX 10/95
+	      raw_string = string(colon_pos+1:)
+	      READ( raw_string, *, ERR=5200 ) dcx_hi(idim)	! AIX 10/95
+	   ENDIF
+
+* is it ww or ss ?
+	   dcx_by_ss(idim) = wworss .EQ. nferdims
+
+ 100	CONTINUE
+ 200	CONTINUE
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_relative_coord, status, 
+     .		     'subscript and world position given on same axis: '//
+     .		     raw_string(:rlen), *5000)
+ 5200	CALL ERRMSG( ferr_erreq, status, raw_string(:rlen), *5000)
+
+	END
diff --git a/fer/ctx/get_new_cx.F b/fer/ctx/get_new_cx.F
new file mode 100644
index 0000000..1e22831
--- /dev/null
+++ b/fer/ctx/get_new_cx.F
@@ -0,0 +1,113 @@
+	SUBROUTINE GET_NEW_CX ( dflt_cx, new_cx, apply_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* using the default context supplied and the context modifiers given with the
+* command produce a new context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/22/87 - code stoled from GET_CMND_DATA
+* revision 0.1 - 7/27/88 - added dflt_cx to get_context_mods call
+* V200:  5/19/89 - transforms not permitted on command line
+* V530:  8/00 *sh* - added data type sensitivity
+* V600 *acm* 3/06  fixing bugs nferdims39&1390, use apply_cx to say whether
+*                  to apply command context to grave-accent expressions.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations
+	INTEGER		dflt_cx, new_cx, status
+        LOGICAL         apply_cx
+
+* local variable declarations
+	INTEGER		idim, cmnd_mods_cx
+	CHARACTER	ALG_TRANS_CODE*3
+
+* de-allocate old context space
+	cx_stack_ptr = cx_stack_ptr_base
+
+* start with the default context for the evaluation of this expression
+	CALL TRANSFER_CONTEXT ( dflt_cx, new_cx )
+
+* create a clean stack slot to receive the command context modifications
+	cmnd_mods_cx = cx_stack_ptr + 1
+	CALL INIT_CONTEXT_MODS ( cmnd_mods_cx )
+
+* translate the command context modifiers into the modifications buffer
+	CALL GET_CONTEXT_MODS ( dflt_cx,
+     .				cmnd_buff,
+     .				cmnd_mods_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				unknown_qual_ok,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* transformation given on command line ?
+	DO 100 idim = 1, nferdims
+ 100	IF (cx_trans(idim,cmnd_mods_cx) .NE. trans_no_transform)
+     .        GOTO 5010
+
+        IF (apply_cx) THEN
+
+* modify the command context with the given modifiers
+	   CALL APPLY_CONTEXT_MODS
+     .			( cmnd_mods_cx, new_cx, replace_context, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+        ENDIF
+
+* set default data type
+
+	cx_type(new_cx) = unspecified_int4
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_syntax, status,
+     .	'transforms not permitted on command: @'//
+     .		ALG_TRANS_CODE( cx_trans(idim,cmnd_mods_cx) ), *5000 )
+	END
diff --git a/fer/ctx/get_var_context.F b/fer/ctx/get_var_context.F
new file mode 100644
index 0000000..ae028e3
--- /dev/null
+++ b/fer/ctx/get_var_context.F
@@ -0,0 +1,239 @@
+	SUBROUTINE GET_VAR_CONTEXT
+     .		      ( full_var_name, 
+     .			default_cx,
+     .			var_cx,
+     .			status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a full variable specification of the form:
+*			(eg.) TEMP[X=170E:170W,K=+1D,T=188979]
+* return in var_cx context information describing the exact variable instance
+* including variable, data set, grid, region and plane
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/15/86
+* revision 0.1 - 3/23/87 - added new TMAP library: time axes, file var. names,
+*						   bad data flag
+*			 - context mods from var name applied IN PARSE_VAR_NAME
+* revision 0.2 - 5/5/88  - FINISH_CONTEXT_MODS --> FLESH_OUT_CONTEXT
+*			   added CONFINE_CONTEXT
+* V200:  6/22/89 - eliminated GT_CONTEXT_PLANE
+*		 - added oversizing of contexts
+*		 - added test for irrelevant data set
+* V500: 10/20/98 *jc* - added ADD_RDC_XFORM
+* V510: 8/99 *sh* - g=unknown_uvar is allowed now. If happening, then skip
+*	final steps of context getting
+* V533: 6/01 *sh* - set data type
+* V603: 5/07 *acm*  Fix for bug 1475, before confine_axis check cx_by_ss(idim,cx)
+*                   If .true. check for transformation reducing range to a pt
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 4/13 *sh* parse the auxiliary regridding context terms ("*aux*"), too
+*	         and don't report errors in dependency_tree_mode
+* V690 12/13 *sh* bug fix when variable name unrecognized in VTREE mode
+
+	IMPLICIT NONE
+
+	include	'ferret.parm'
+	include	'errmsg.parm'
+        include 'tmap_dims.parm'
+	include 'xfr_grid.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+        include 'xdset_info.cmn_text'
+        include 'xdependency_tree.cmn'
+        external xdset_info_data
+
+* calling argument declarations:
+	INTEGER		default_cx, var_cx, status
+	CHARACTER*(*)	full_var_name
+
+* internal variable declarations:
+	LOGICAL		unreported_error
+	INTEGER		mods_cx, idim, i, istart, iend, cat, var, iarg,
+     .			ignore
+
+* initialize
+	unreported_error = .FALSE.
+	CALL TRANSFER_CONTEXT ( default_cx, var_cx )
+
+* find a context slot for the modifications that may be attached to the var name
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS ( mods_cx )
+
+* get variable and attached modifications
+	IF ( dependency_tree_mode ) allowed_err = .TRUE.  ! SHOW VAR/TREE
+	CALL PARSE_VAR_NAME ( full_var_name, var_cx, mods_cx, status )
+	allowed_err = .FALSE.
+	IF ( status .NE. ferr_ok ) THEN
+* ... when merely determining a dependency tree unknow var is OK
+	   IF ( dependency_tree_mode ) THEN
+	      cx_variable(var_cx) = unspecified_int4
+	      cx_category(var_cx) = unspecified_int4
+	      unreported_error = .TRUE.
+	      IF (cx_has_impl_grid(var_cx)) THEN
+	         IF (cx_impl_grid(var_cx).NE.grd_stk_ptr )
+     .					CALL WARN('crptn_get_var_ctxt')
+	         CALL DEALLO_GRID(i) ! 12/13 bug fix
+	      ENDIF
+	   ELSE
+	      GOTO 5000
+	   ENDIF
+	ENDIF
+
+* if explicit auxiliary regridding variables were detected, identify them
+	IF (cx_naux(var_cx).GT.0 .AND. .NOT.cx_implicit_aux(var_cx)) THEN
+	   iarg = 0
+* ... cx_naux always matches the number of valid cx_aux_arg_start values
+	   DO idim = 1, nferdims
+	      IF (cx_aux_arg_start(idim, var_cx) .NE. unspecified_int4) THEN
+	         iarg = iarg + 1
+	         cx_valid_aux(iarg,var_cx) = .TRUE.
+* ... make sure there are no square brackets
+* ... sq brtk contents like D= would require hard dependencies on the aux vars
+	         DO i = cx_aux_arg_start(idim,var_cx),
+     .		        cx_aux_arg_end  (idim,var_cx) 
+	            IF (full_var_name(i:i) .EQ. '[') GOTO 5100
+                 ENDDO
+* ... identify the aux variable name
+* ... btw note: cx_aux_arg_start is EQUIV to cx_aux_var. Ditto cx_aux_cat.
+	         istart = cx_aux_arg_start(idim,var_cx)
+	         iend   = cx_aux_arg_end  (idim,var_cx)
+	         CALL FIND_VAR_NAME( cx_data_set(var_cx),
+     .				     full_var_name(istart:iend),
+     .				     cat,
+     .				     var )
+	         IF (var .NE. munknown_var_name) THEN
+	            cx_aux_cat (idim,var_cx) = cat
+	            cx_aux_var (idim,var_cx) = var
+	            cx_aux_stat(idim,var_cx) = paux_stat_used
+	         ELSE
+	            cx_valid_aux(iarg,var_cx) = .FALSE. ! a name not found
+	            IF (.NOT. unreported_error) THEN
+	               status = ferr_unknown_auxvar
+		       unreported_error = .TRUE.
+	            ENDIF
+	         ENDIF	
+	      ENDIF
+	   ENDDO
+	ENDIF
+	IF (unreported_error) THEN
+	   CALL STACK_PTR_DN(cx_stack_ptr,cx_stack_ptr_base,ignore) ! mods_cx
+	   GOTO 5000
+	ENDIF
+
+* 8/99 If G=unknown_user_var was given then exit now.
+* It is recognizable because the text position is encoded in the grid number.
+* This should happen ONLY when this is called from IS_UVAR_GRID
+	IF ( cx_unstand_grid(var_cx)
+     . .AND. cx_grid(var_cx) .LT. unspecified_int4 ) GOTO 100
+
+* apply the hidden @RDC transform if appropriate
+	CALL ADD_RDC_XFORM( var_cx, status)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* insert bad data flag for variable
+	CALL GET_CONTEXT_BAD_FLAG( var_cx )
+
+* insert data type for variable
+	CALL KNOWN_DATA_TYPE( var_cx )
+
+* determine the defining grid
+	CALL GET_CONTEXT_GRID ( var_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* can't do more if the grid isn't known
+	IF ( cx_grid(var_cx) .EQ. unspecified_int4 ) GOTO 100
+
+* data set info may be irrelevant
+* indicate that now so memory searches will be correct
+	IF ( cx_category(var_cx) .EQ. cat_user_var ) THEN
+	   IF ( .NOT.uvar_need_dset(cx_variable(var_cx)) ) THEN
+	      cx_data_set(var_cx) = pdset_irrelevant
+*  ... flag that all data set info is contained within the variable
+	      cx_dset_gvn(var_cx) = .TRUE.
+	   ENDIF
+	ENDIF
+
+c Fix for bug 1475
+c FLESH_OUT_AXIS has a check for whether there is a transformation that
+c reduces the range to a point and if so sets cx_by_ss(idim,cx)=.FALSE.
+
+* flesh out the context on each axis with grid-related positions
+* seeing if cx_by_ss(idim,cx) should really be in effect
+	DO 11 idim = 1, nferdims
+	   IF ( cx_by_ss(idim,var_cx) ) THEN
+              CALL FLESH_OUT_AXIS( idim, var_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+ 11	CONTINUE
+
+* confine limits to grid
+	CALL CONFINE_CONTEXT ( var_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* flesh out the context on each axis with grid-related positions
+	DO 10 idim = 1, nferdims
+	   CALL FLESH_OUT_AXIS( idim, var_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+ 10	CONTINUE
+
+* enlarge the context ? (contour plots need data extending beyond plot region)
+	IF ( cx_ovsiz( var_cx) .NE. ovsiz_off ) CALL OVSIZ_CX( var_cx )
+
+* relinquish the stack space used for the modifications
+ 100	CALL STACK_PTR_DN ( cx_stack_ptr, cx_stack_ptr_base, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	RETURN
+
+* error exit
+ 5000	RETURN
+
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .          'square bracket modifiers may not be used with '//
+     .          'auxiliary regridding variables:'//pCR
+     .		//full_var_name, *5000 )
+
+ 5200	CALL ERRMSG( ferr_unknown_auxvar, status,
+     .          'regridding variable "'//
+     .		full_var_name(istart:iend)//
+     .          '" in '//full_var_name, *5000 )
+
+	END
diff --git a/fer/ctx/get_var_grid.F b/fer/ctx/get_var_grid.F
new file mode 100644
index 0000000..bec98e7
--- /dev/null
+++ b/fer/ctx/get_var_grid.F
@@ -0,0 +1,105 @@
+	INTEGER FUNCTION GET_VAR_GRID
+     .		      ( full_var_name, 
+     .			default_cx,
+     .			var_cx,
+     .			status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a full variable specification of the form:
+*			(eg.) TEMP[X=170E:170W:2]
+* return the grid, only, of the result
+
+* this routine extracted (by quick hack) from GET_VAR_CONTEXT so that GC
+* variables can determine their grids in advance of determining inheritance
+* for their arguments
+
+* V510: 1/00 *sh**
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER		default_cx, var_cx, status
+	CHARACTER*(*)	full_var_name
+
+* internal variable declarations:
+	INTEGER		mods_cx
+
+* initialize
+	CALL TRANSFER_CONTEXT ( default_cx, var_cx )
+
+* find a context slot for the modifications that may be attached to the var name
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS ( mods_cx )
+
+* get variable and attached modifications
+	CALL PARSE_VAR_NAME ( full_var_name, var_cx, mods_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* 8/99 If G=unknown_user_var was given then exit now.
+* It is recognizable because the text position is encoded in the grid number.
+* This should happen ONLY when this is called from IS_UVAR_GRID
+	IF ( cx_unstand_grid(var_cx)
+     . .AND. cx_grid(var_cx) .LT. unspecified_int4 ) GOTO 5100
+
+* determine the defining grid
+	CALL GET_CONTEXT_GRID ( var_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* can't do more if the grid isn't known
+	IF ( cx_grid(var_cx) .EQ. unspecified_int4 ) THEN
+	   GOTO 5100
+	ELSE
+	   GET_VAR_GRID = cx_grid(var_cx)
+	ENDIF
+
+* relinquish the stack space used for the modifications
+ 100	CALL STACK_PTR_DN ( cx_stack_ptr, cx_stack_ptr_base, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_unknown_grid, status, full_var_name, *5000 )
+	END
diff --git a/fer/ctx/grp_cx_doc.F b/fer/ctx/grp_cx_doc.F
new file mode 100644
index 0000000..542367d
--- /dev/null
+++ b/fer/ctx/grp_cx_doc.F
@@ -0,0 +1,80 @@
+	SUBROUTINE GRP_CX_DOC( cx_list, ncx, joint_cx, flags )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up joint context and document flags to summarize the contexts
+* of one or more variables that will be plotted (or listed) simultaneously
+* For example, PLOT U[Z=20],U[Z=50] will place data set and X,Y,T locations
+* in cx_plot and set up key_doc to display the Z location
+* This routine is called at the start of each fresh (non-overlay) plot
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+* V230:  7/22/92 - added overlay argument to ADDL_CX_DOC
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+	include	'ferret.parm'
+
+* calling argument declarations
+	LOGICAL	flags(0:12)
+	INTEGER	ncx, cx_list(ncx), joint_cx
+
+* internal variable declarations
+	INTEGER	i, idim
+
+* internal parameter declarations:
+        LOGICAL overlay
+        PARAMETER ( overlay = .TRUE. )
+
+* initialize the key documentation flags
+	DO 100 i = 0, 10
+ 100	flags(i) = .FALSE.
+
+* the context of the first variable is the starting point
+	CALL TRANSFER_CONTEXT( cx_list(1), joint_cx )
+
+* merge the other contexts with it
+	DO 200 i = 2, ncx
+ 200	CALL ADDL_CX_DOC( joint_cx, cx_list(i), .NOT.overlay, flags )
+
+* regridding is always displayed on the key, not the joint context
+!	cx_unstand_grid( cx_plot ) = .FALSE.
+	RETURN
+	END
diff --git a/fer/ctx/inherited_limits.F b/fer/ctx/inherited_limits.F
new file mode 100644
index 0000000..5710868
--- /dev/null
+++ b/fer/ctx/inherited_limits.F
@@ -0,0 +1,81 @@
+	LOGICAL FUNCTION INHERITED_LIMITS( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if the limits given within a definition (or within component
+* variables of the definition) should be inherited by a parent definition
+
+* for example: if A=SST[T=1-jan-1980:1-jan-1990]
+* then "A+5" inherits the 1:5 info
+* but A[gt=monthly_clim at mod] does NOT inherit -- the modulo regridding
+* swallows up the limits information and produces, always, a full axis
+* of (probably 12) values, as if no limits had been given.
+
+* Note: this logic is also applicable to inplicit axes. For example,
+* A=SST[X=160e:160w:.2] has explicit limits but the resulting new axis
+* created is always provided in full, as if no limits had been given.
+
+* However, this routine did not exist at the time that implicit axes
+* were developed ... so a kludgy work-around (IS_RECONCILE(?)) was developed.
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 1/96
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, cx
+
+* internal variable declarations:
+* ...
+
+* limits are inheritible unless modulo regridding was applied
+
+	INHERITED_LIMITS = .NOT.cx_unstand_grid(cx)
+     .			 .OR. 
+     .      (cx_regrid_trans(idim,cx).LT.prgrd_modulo
+     . .OR.  cx_regrid_trans(idim,cx).GT.prgrd_modmax)
+
+	RETURN
+	END
+
+
diff --git a/fer/ctx/init_context_mods.F b/fer/ctx/init_context_mods.F
new file mode 100644
index 0000000..d194427
--- /dev/null
+++ b/fer/ctx/init_context_mods.F
@@ -0,0 +1,104 @@
+	SUBROUTINE INIT_CONTEXT_MODS ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* prepare a clean,empty cx to receive a list of modifications
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - ????
+* revision 0.1 -  4/1/89  - added regridding transformations
+* V200:  6/28/89 - 4D symmetrical - init trans_arg, too, eliminate %%_relative
+*		 - init cx_dset_gvn, cx_grid_needs_dset
+* V420: 9/8/95 - added initializations for implicit grid creation
+* 
+*       8/97 *kob* - initalize cx_calendar - used to indicate whether a date
+*                    contains a string 
+* V510 *sh* - added cx_formatted
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685 3/2013 *sh* initialize auxiliary regrid variable info
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	INTEGER	idim, ivar
+
+* initialize everything but region
+	cx_variable( cx ) = unspecified_int4
+	cx_category( cx ) = unspecified_int4
+	cx_data_set( cx ) = unspecified_int4
+	cx_dset_gvn( cx ) = .FALSE.
+	cx_grid( cx )     = unspecified_int4
+	cx_unstand_grid( cx )  = .FALSE.
+	cx_has_impl_grid( cx ) = .FALSE.
+	cx_calendar(cx)        = .FALSE.
+	cx_grid_needs_dset     = .FALSE.
+	
+* initialize region
+* note: ss specifications are not used in storing modifications
+	DO 100 idim = 1, nferdims
+	   cx_lo_ss ( cx, idim )  = unspecified_int4
+	   cx_hi_ss ( cx, idim )  = unspecified_int4
+	   cx_lo_ww ( idim, cx )  = unspecified_val8
+	   cx_hi_ww ( idim, cx )  = unspecified_val8
+	   cx_delta ( idim, cx )  = unspecified_val8
+	   cx_trans ( idim, cx )  = trans_no_transform
+	   cx_trans_arg  ( idim, cx ) = bad_val4
+	   cx_by_ss      ( idim, cx ) = .FALSE.	!for bookkeeping
+	   cx_given      ( idim, cx ) = .FALSE.
+	   cx_aux_given  ( idim, cx ) = .FALSE.
+	   cx_aux_stat   ( idim, cx ) = paux_stat_na
+	   cx_regrid_trans(idim, cx ) = unspecified_int4 
+	   cx_formatted( idim )	  = .FALSE.
+100	CONTINUE
+
+* initialize info about auxiliary regridding variables
+	cx_naux( cx ) = 0
+	DO 200 ivar = 1, nferdims
+	   cx_aux_var  (ivar, cx) = unspecified_int4
+	   cx_aux_cat  (ivar, cx) = unspecified_int4
+ 200	CONTINUE
+
+
+	RETURN
+	END
diff --git a/fer/ctx/init_empty_context.F b/fer/ctx/init_empty_context.F
new file mode 100644
index 0000000..0f272c9
--- /dev/null
+++ b/fer/ctx/init_empty_context.F
@@ -0,0 +1,95 @@
+	SUBROUTINE INIT_EMPTY_CONTEXT ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up a "null" context suitable to merge other contexts on top of
+
+* V450: 1/97 - part of changes to accomodate grid-changing functions
+* 9/97 *kob* - initialize cx_calendar as well
+* V530:  8/00 *sh* - initialize data type to unspecified
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V690 *sh* 2/14 init auxiliary var-related context variables
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cx
+
+* internal variable declarations
+	INTEGER	idim
+
+* all contexts contain axis region information
+	DO 100 idim = 1,nferdims
+	   cx_lo_ss ( cx, idim )   = unspecified_int4
+	   cx_hi_ss ( cx, idim )   = unspecified_int4
+	   cx_lo_ww ( idim, cx )   = unspecified_val8
+	   cx_hi_ww ( idim, cx )   = unspecified_val8
+	   cx_trans ( idim, cx )   = trans_no_transform
+	   cx_by_ss ( idim, cx )   = .TRUE.
+	   cx_given ( idim, cx )   = .TRUE.		! <== (*)
+	   cx_aux_given( idim, cx ) = .FALSE.
+	   cx_aux_stat ( idim, cx ) = paux_stat_na
+	   cx_aux_var  ( idim, cx ) = unspecified_int4
+	   cx_aux_cat  ( idim, cx ) = unspecified_int4
+	   cx_aux_stat ( idim, cx ) = paux_stat_na
+	   cx_trans_arg( idim, cx ) = bad_val4
+	   cx_delta    ( idim, cx ) = unspecified_val8
+	   cx_regrid_trans(idim,cx)=unspecified_int4
+ 100	CONTINUE
+
+	cx_data_set( cx ) = unspecified_int4
+	cx_dset_gvn( cx ) = .TRUE.			! <== (*)
+	cx_category( cx ) = unspecified_int4
+	cx_variable( cx ) = unspecified_int4
+	cx_grid    ( cx ) = unspecified_int4
+	cx_type    ( cx ) = unspecified_int4
+!	cx_ovsiz   ( cx ) = JC_TODO:  what should this be?
+	cx_bad_data( cx ) = bad_val4
+
+	cx_unstand_grid ( cx ) = .FALSE.
+	cx_impl_grid    ( cx ) = unspecified_int4
+
+* kob 9/97 - need to initialize cx_calendar as well
+		 IF (idim .eq. t_dim) 
+     .                cx_calendar(cx) = .FALSE.
+
+* (*) initialized to TRUE so that ANDing with another context will yield
+*	TRUE only if "given" in that context
+
+	RETURN
+	END
diff --git a/fer/ctx/known_data_type.F b/fer/ctx/known_data_type.F
new file mode 100644
index 0000000..8e74502
--- /dev/null
+++ b/fer/ctx/known_data_type.F
@@ -0,0 +1,129 @@
+	SUBROUTINE KNOWN_DATA_TYPE ( cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the data type for the given variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533:  7/01
+* V554 1/04 *acm* - add counter_var 
+*      *kms* 11/10 added cat_pystat_var
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+        include 'xpyvar_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	INTEGER	dset, data_set, category, variable, idim, trans
+
+* initialize
+	category = cx_category(cx)
+	variable = cx_variable(cx)
+	data_set = cx_data_set(cx)
+
+* different procedure for determining grid from each category
+	IF     ( category .EQ. cat_file_var ) THEN
+
+	   cx_type(cx) =  ds_var_type(variable)
+
+	ELSEIF ( category .EQ. cat_aggregate_var ) THEN
+
+           cx_type(cx) = ds_var_type(variable)
+
+        ELSEIF ( category .EQ. cat_pystat_var ) THEN
+
+           cx_type(cx) =  pyvar_type(variable)
+
+	ELSEIF ( category .EQ. cat_calc_var ) THEN
+
+           cx_type(cx) = ptype_float
+
+	ELSEIF ( category .EQ. cat_user_var ) THEN
+
+* ... allow "abstract" expressions that don't depend on data set
+	   IF ( .NOT.uvar_need_dset(variable)
+     .	   .OR. data_set .EQ. unspecified_int4 ) THEN
+	      dset = pdset_irrelevant
+	   ELSE
+	      dset = data_set
+	   ENDIF
+	   cx_type(cx) = uvar_data_type( variable, dset )
+
+	ELSEIF ( category .EQ. cat_temp_var ) THEN
+!! here, variable may be up to 2000, mr_type is dimension 151
+	   cx_type(cx) = mr_type( variable )  
+
+	ELSEIF ( category .EQ. cat_counter_var ) THEN
+
+	   cx_type(cx) = ptype_float
+
+	ELSEIF ( category .EQ. cat_attrib_val ) THEN  !should have been set elsewhere
+
+	   IF (cx_type(cx) .EQ. 0 .OR. 
+     .         cx_type(cx) .EQ. unspecified_int4 ) 
+     .        STOP 'unknown var.att in KNOWN_DATA_TYPE'
+
+	ELSE
+
+	   STOP 'KNOWN_TYP'
+
+	ENDIF
+
+* For string variables the result data type of @NGD and @NBD is float.  
+	IF (cx_type(cx) .EQ. ptype_string) THEN
+	   DO 100, idim = 1, nferdims
+	      trans = cx_trans(idim, cx) 
+	      IF (trans .EQ. trans_good_pt    .OR.
+     .            trans .EQ. trans_bad_pt     .OR.
+     .            trans .EQ. trans_4d_good_pt .OR.
+     .            trans .EQ. trans_4d_bad_pt ) THEN
+                  cx_type(cx) = ptype_float
+       	       ENDIF
+ 100	   CONTINUE
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/ctx/merge_axis_with_offsets.F b/fer/ctx/merge_axis_with_offsets.F
new file mode 100644
index 0000000..b700d8f
--- /dev/null
+++ b/fer/ctx/merge_axis_with_offsets.F
@@ -0,0 +1,123 @@
+      SUBROUTINE MERGE_AXIS_WITH_OFFSETS( dflt_cx, mrg_cx, com_cx, 
+     .     idim, lo_off, hi_off )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Take an argument axis which has offsets and merge it into the
+* result context.
+
+*     JC_TODO: Explanation of logic and scenarios
+
+* programmer - jonathan callahan
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V500:  4/9/98   - extracted from merge_context
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685  *acm* 12/13 Fix bug in 6D Ferret decclarations, lo_off and hi_off
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations
+	INTEGER	dflt_cx, mrg_cx, com_cx, idim, lo_off(*), hi_off(*)
+
+* local variable declarations
+	INTEGER	temp_ss, ui4
+
+
+*     do the following for cx_lo_ss and then cx_hi_ss
+*     If the default context is undefined
+*        get argument context (undo offsets)
+*        If merge context is undefined:    use arg context
+*        Else:                             use intersection of mrg_cx and arg cx
+*        Endif
+*     Else context is defined
+*        merge context = default context
+*        prefill with missing value flag
+*     Endif
+
+        ui4 = unspecified_int4
+
+        IF ( cx_lo_ss(dflt_cx,idim) .EQ. ui4 ) THEN
+           temp_ss = cx_lo_ss(com_cx, idim) - lo_off(idim)
+           IF ( cx_lo_ss(mrg_cx,idim) .EQ. ui4 ) THEN
+              cx_lo_ss(mrg_cx,idim) = temp_ss
+           ELSE
+              cx_lo_ss(mrg_cx,idim) = 
+     .             MIN(cx_lo_ss(mrg_cx,idim),temp_ss)
+           ENDIF
+
+        ELSE
+           cx_lo_ss(mrg_cx,idim) = cx_lo_ss(dflt_cx,idim)
+*     prefill with bad flags
+
+        ENDIF
+        
+        IF ( cx_hi_ss(dflt_cx,idim) .EQ. ui4 ) THEN
+           temp_ss = cx_hi_ss(com_cx,idim) - hi_off(idim)
+           IF ( cx_hi_ss(mrg_cx,idim) .EQ. ui4 ) THEN
+              cx_hi_ss(mrg_cx,idim) = temp_ss
+           ELSE
+              cx_hi_ss(mrg_cx,idim) = 
+     .             MIN(cx_hi_ss(mrg_cx,idim),temp_ss)
+           ENDIF
+
+        ELSE
+           cx_hi_ss(mrg_cx,idim) = cx_hi_ss(dflt_cx,idim)
+*     prefill with bad flags
+
+        ENDIF
+
+
+*     JC_TODO: should I implement pieces of code from TRANSFER_AXIS?
+*
+*	cx_lo_ss ( dest, idim )   = cx_lo_ss ( source, idim )
+*	cx_hi_ss ( dest, idim )   = cx_hi_ss ( source, idim )
+*	cx_lo_ww ( idim, dest )   = cx_lo_ww ( idim, source )
+*	cx_hi_ww ( idim, dest )   = cx_hi_ww ( idim, source )
+*	cx_trans ( idim, dest )   = cx_trans ( idim, source )
+*	cx_by_ss ( idim, dest )   = cx_by_ss ( idim, source )
+*	cx_given ( idim, dest )   = cx_given ( idim, source )
+*	cx_trans_arg(idim, dest)  = cx_trans_arg(idim, source)
+** 8/97 *kob* 	
+*	IF (idim .EQ. t_dim) 
+*     .        cx_calendar(dest) = cx_calendar(source)
+
+
+* successful completion
+ 100	RETURN
+	END
diff --git a/fer/ctx/merge_context.F b/fer/ctx/merge_context.F
new file mode 100644
index 0000000..fa764a5
--- /dev/null
+++ b/fer/ctx/merge_context.F
@@ -0,0 +1,326 @@
+	SUBROUTINE MERGE_CONTEXT( its_gc, iarg, dflt_cx,
+     .				  mrg_cx, com_cx, com_str, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* combine new space/time/data_set/variable/grid context information into a 
+* single context checking for consistency 
+* (the merged grid is determined in advance by IS_UVAR_GRID)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/20/89 - complete re-write
+*	  4/2/90 - beef-up error message for incompatible axis lengths
+* Unix/RISC port - 1/91 - cant use "//" with CHAR*(*) variable
+*       10/27/92 - "documentation merge" option added
+* V450: 1/97	 - changes to accomodate grid changing functions.
+*		   MERGE_CONTEXT needs to know the argument number. Use this
+*		   to determine the nature of the context merging.
+* V533: *sh* 6/01 - merge data types (removed to MERGIFY_CX)
+*		  - allow longer char buffer for error message to prevent
+*			crash in pathological cases
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+	include	'xfr_grid.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations
+	LOGICAL		its_gc
+	INTEGER		iarg, dflt_cx, mrg_cx, com_cx, status
+	CHARACTER*(*)	com_str
+
+* local variable declarations
+	LOGICAL		ss_save
+	INTEGER		CGRID_AXIS, CX_DIM_LEN, WHICH_GCFCN,
+     .			idim, mrg_ax, mrg_len, com_ax, com_len, 
+     .			choice(4,5), i, icom, imrg, uvar,
+     .			com_str_slen, mrg_str_slen,
+     .			com_int_slen, mrg_int_slen, gcfcn,
+     .			axis_source(nferdims), lo_off(nferdims),  
+     .			hi_off(nferdims), action(nferdims)
+	CHARACTER	CX_DIM_STR*24, LEFINT*8, com_lims*24, mrg_lims*24,
+     .			com_int*8, mrg_int*8
+
+* local parameter declarations:
+	LOGICAL         no_decims
+	INTEGER		TAX,   ERR,   BUG,   NA
+	PARAMETER     ( TAX=1, ERR=2, BUG=3, NA=4,
+     .			no_decims = .FALSE. )
+
+* procedure:
+
+* A major question to answer in determining a merged context is: Where does
+* the context depend on the default region?  For example, TEMP[K=5] + TEMP[K=1]
+* requires no additional Z axis input and no Z axis labelling is needed (since
+* the information is part of the definition).  This non-dependence question
+* must be resolved AT THE OUTSET or memory resident data cannot be located
+* (cannot search memory without a fully specified context to look for).
+*
+* To address this question each context axis has the logical cx_given.
+* This flag tells if the coordinates for that axis were explicitly modified
+* in the most recent context level (e.g. TEMP[K=4] explicitly modifies the
+* K/Z axis).
+
+* Conformability of component dimensions must also be addressed.  An axis span
+* of 1 can be combined with anything (e.g. TEMP[K=1] + TEMP) but lengths
+* greater than 1 must match (e.g. TEMP[I=100:105] + TEMP[I=100:106] is illegal).
+
+* When multiple component have differing underlying axis definitions
+* another ambiguity must be resolved.
+* (e.g. the vars. U and W are on staggered Z axes in many models so what is the
+* Z axis of the expression U+W ?  How about U+W[K=1] ? )
+
+* Ambiguities and conflicts are resolved by arbitrarily choosing:
+*	1) the region from the first component with region IMPLICITLY defined
+*	      ... or failing that ...
+*	2) the region fom the first component with explicit region >1
+*	      ... or failing that ...
+*	3) the region from the first component with any explicit region
+
+* Expressions which are given on the command line present a special case.
+* e.g. LIST U[Z=10] should have the title of U and a depth label of 10 but
+*      LIST VNEW after DEFINE VAR VNEW=U[Z=10] should have a title of VNEW
+*      and no Z depth label.
+* Thus on-command-line expressions are sent to this routine only when they
+* have multiple component variables.
+
+* The following table summarizes the logic of merging a new component context
+* (com_cx) into a partially merged context (mrg_cx):
+* "cx_given" on a component axis means that the location was given with the
+*	     component (e.g. U[Z=0]) so it doesn't require outside information
+* "cx_given" on a the merged context means that all components had cx_given
+
+*	            1           2  COMPONENT    3             4
+*		      cx_given		         .NOT.cx_given
+*  size:            1          >1	        1	       >1
+*             -----------------------------------------------------------------
+*1          1 |   no action   | transfer axis | transfer axis | transfer axis |
+* cx_given    -----------------------------------------------------------------
+*2         >1 |   no action   |  no action    |    error      | transfer axis |
+*	      -----------------------------------------------------------------
+*3          1 |   no action   |    error      |  no action    | transf ax *** |
+* NOT.cx_gvn  -----------------------------------------------------------------
+*4         >1 |   no action   |  no action    |  no actn  *** |   no action   |
+*             -----------------------------------------------------------------
+*5 normal     | transfer axis | transfer axis | transfer axis | transfer axis |
+*             -----------------------------------------------------------------
+
+* error : cannot label expressions like yes? CONTOUR/K=1 U[K=1:3] - U
+*	   since the first component requires a labeled axis and the
+*	   second requires a single point to be named
+* "***"	:  situation can occur only in cases like
+*		DEFINE VAR TAVE = TEMP[K=@AVE]
+*		DEFINE VAR DIFF = TEMP - TAVE
+* ... so that both TEMP and TAVE have limits .NOT.given but one has length 1
+*	and the other has length possible .GT. 1
+
+	DATA (choice(i,1),i=1,4) / NA,  TAX, TAX, TAX /,
+     .	     (choice(i,2),i=1,4) / NA,   NA, ERR, TAX /,
+     .	     (choice(i,3),i=1,4) / NA,  ERR,  NA, TAX /,
+     .	     (choice(i,4),i=1,4) / NA,   NA,  NA,  NA /
+     .	     (choice(i,5),i=1,4) / TAX, TAX, TAX, TAX /
+
+**************************************************************************
+* get the variable under consideration from the merged context
+	uvar = cx_variable( mrg_cx )
+
+* merge data types  (removed to MERGIFY_CX -- uvars via uvar_data_type)
+!	IF (cx_type(mrg_cx) .EQ. ptype_unknown) THEN
+!	   cx_type(mrg_cx) = cx_type(com_cx)
+!	ELSEIF( cx_type(mrg_cx) .NE. cx_type(com_cx) ) THEN
+!! temporary hack until function return types are implemented
+!	   cx_type(mrg_cx) = ptype_float
+!	ENDIF
+
+* is this a grid changing variable? (1/97)
+	IF (its_gc) THEN
+	   gcfcn = WHICH_GCFCN(uvar)
+	   CALL GCF_GET_AXIS_SRCS(gcfcn, iarg, axis_source)
+	   CALL GCF_GET_ARG_LIMS (gcfcn, iarg, com_cx, cx_grid(mrg_cx),
+     .				 lo_off,  hi_off, action, status)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* initialize fixed length string for RISC
+	risc_buff = com_str
+	len_rbuff = MIN( size_rbuff, LEN(com_str) )
+
+* loop through the axes
+	DO 500 idim = 1,nferdims
+
+* argument of grid-changing function? (1/97)
+*
+*     If we should ignore the axis:     don't merge
+*     Else if we should impose an axis 
+*        If (pset_to_unspec):           don't merge
+*        Else (ppass_along):            imposed axis matches arg axis --> merge
+*     Else (we should merge an axis)
+*        If we have offsets:            special merge
+*        Else:                          all OK --> merge
+*     Endif
+
+           IF (its_gc ) THEN
+
+              IF (axis_source(idim).EQ.pgc_ignore_axis) THEN
+
+                 GOTO 500
+
+              ELSEIF (axis_source(idim).EQ.pgc_impose_axis) THEN
+
+                 IF (action(idim) .EQ. pset_to_unspec) THEN
+*     ... IS_DO_GC_FUNC will fill in the result limits on the imposed axes
+                    GOTO 500    ! leave it in its initialized (vacant) condition
+                 ELSE
+*     ... This is the special case of an imposed axis that matches the argument ax
+                    CONTINUE
+                 ENDIF
+
+              ELSE !(axis_source(idim) .EQ. pgc_merge_axis)
+
+                 IF  (lo_off(idim).NE.0 .OR. hi_off(idim).NE.0) THEN
+                    CALL MERGE_AXIS_WITH_OFFSETS(dflt_cx, mrg_cx, 
+     .                   com_cx, idim, lo_off, hi_off)
+                    GOTO 500
+                 ELSE
+                    CONTINUE
+                 ENDIF
+
+              ENDIF	 
+              
+           ENDIF
+
+
+* ignore axes for which region isn't known (e.g. X axis of pseudo-variable "Y")
+	   IF ( cx_lo_ww(idim,com_cx) .EQ. unspecified_val8 ) GOTO 500
+
+*********************************************************************
+* "documentation merge" option - a patch: 10/27/92
+* For special case where both the component and the merged context represent
+* idle, redundant documentation  e.g. TEMP[L=1:5 at AVE] + TEMP[L=2:3 at AVE]
+* If the component context is the same as the merged then save it;
+* if they differ then throw it away
+           IF (cx_given(idim,com_cx)
+     .           .AND. cx_lo_ss(com_cx,idim) .EQ. unspecified_int4
+     .    .AND.cx_given(idim,mrg_cx)
+     .           .AND. cx_lo_ss(mrg_cx,idim) .EQ. unspecified_int4) THEN
+              IF ( cx_lo_ww(idim,com_cx).NE.cx_lo_ww(idim,mrg_cx)
+     .       .OR.  cx_hi_ww(idim,com_cx).NE.cx_hi_ww(idim,mrg_cx) ) THEN
+                 cx_lo_ww(idim,com_cx)= unspecified_val8
+                 cx_hi_ww(idim,com_cx)= unspecified_val8
+              ENDIF
+           ENDIF
+*********************************************************************
+
+* get axes and lengths of data along them
+	   mrg_ax  = CGRID_AXIS( idim, mrg_cx )
+	   com_ax  = CGRID_AXIS( idim, com_cx )
+	   mrg_len = CX_DIM_LEN( idim, mrg_cx )
+	   com_len = CX_DIM_LEN( idim, com_cx )
+
+* PRE-TEST FOR ERROR CONDITIONS
+* ... non-conformable lengths
+	   IF ( mrg_len .NE. com_len
+     .    .AND. mrg_len.NE.1 .AND. com_len.NE.1 ) GOTO 5010
+
+* ignore data from non-matching axes (warning was given during grid merge)
+	   IF ( com_ax .NE. mrg_ax  ) GOTO 500
+	   IF ( mrg_ax .EQ. mnormal ) GOTO 9000
+
+* MERGE NEW COMPONENT WITH PREVIOUS DIMENSIONS
+	   IF ( cx_given(idim,com_cx) ) THEN
+	      icom = 1
+	   ELSE
+	      icom = 3
+	   ENDIF
+	   IF ( cx_given(idim,mrg_cx) ) THEN
+	      imrg = 1
+	   ELSE
+	      imrg = 3
+	   ENDIF
+	   IF ( com_len .GT. 1 ) icom = icom + 1
+	   IF ( mrg_len .GT. 1 ) imrg = imrg + 1
+	   IF ( cx_lo_ss(mrg_cx,idim) .EQ. unspecified_int4 ) imrg = 5
+
+* merge new component context with previous stuff
+*	          TAX   ERR   BUG   NA
+	   GOTO ( 100, 5020, 9000, 400 ) choice(icom,imrg)
+
+* transfer axis (component transforms don't belong to the merged context)
+ 100	   CALL TRANSFER_AXIS( idim, com_cx, mrg_cx )
+	   cx_trans    (idim, mrg_cx ) = trans_no_transform
+	   cx_trans_arg(idim, mrg_cx ) = bad_val4
+
+* "given" is false if any component doesn't have an explicit region
+ 400	   cx_given(idim,mrg_cx) = cx_given(idim,mrg_cx)
+     .			     .AND. cx_given(idim,com_cx)
+
+ 500	CONTINUE
+
+* successfully merged
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+* ... message to include "expr has N points (L=lo:hi)"
+ 5010	ss_save = cx_by_ss(idim,com_cx)
+	cx_by_ss(idim,com_cx) = .TRUE.
+	com_lims = CX_DIM_STR( idim,com_cx,':',no_decims,com_str_slen )
+	cx_by_ss(idim,com_cx) = ss_save
+	ss_save = cx_by_ss(idim,mrg_cx)
+	cx_by_ss(idim,mrg_cx) = .TRUE.
+	mrg_lims = CX_DIM_STR( idim,mrg_cx,':',no_decims,mrg_str_slen )
+	cx_by_ss(idim,mrg_cx) = ss_save
+	com_int = LEFINT(com_len,com_int_slen)
+	mrg_int = LEFINT(mrg_len,mrg_int_slen)
+	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		ww_dim_name(idim)//' axis'//pCR//
+     .		risc_buff(:len_rbuff)//
+     .		' has '//com_int(:com_int_slen)//' points ('//
+     .					com_lims(:com_str_slen)//')'//pCR//
+     .		'expression has '//mrg_int(:mrg_int_slen)//' points ('//
+     .					mrg_lims(:mrg_str_slen)//')', *5000 )
+ 5020	CALL ERRMSG( ferr_inconsist_plane+ghelp_cue, status,
+     .		'can''t label '//ww_dim_name(idim)//' axis of '//
+     .		risc_buff(:len_rbuff), *5000 )
+ 9000	CALL ERRMSG( ferr_internal, status, 'merge_cx', *5000 )
+	END
diff --git a/fer/ctx/merge_grid.F b/fer/ctx/merge_grid.F
new file mode 100644
index 0000000..03f26bb
--- /dev/null
+++ b/fer/ctx/merge_grid.F
@@ -0,0 +1,589 @@
+	SUBROUTINE MERGE_GRID(	iarg, its_gc, com_text,
+     .				mrg_cx, com_cx, uvar, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* combine the grid from a new component into the grid information from the
+* already-merged components
+* compute: 1) the aggregate grid (as a collection of 4 axes)
+*	   2) uvar_given - which tells how limits must be specified for each
+*		axis of the aggregate grid
+*  e.g. DEFINE VAR NEW = U[K=1]+TEMP[K=@AVE] where the 2 variables are on
+*					     different axes in all 4 dimensions
+*	The aggregate grid will be from U in X,Y and T since it is the first
+*	variable in the expression and from TEMP in Z since that axis is neede
+*	to label the result properly.
+*       UVAR_GIVEN will be "needed" on X,Y and T and "need_exact" on Z since
+*	NEW should be re-used from memory-resident storage only when the stored
+*	Z limits match the requested exactly.
+* note: components are merged in the reverse of the order of computation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/28/89 - complete re-write
+* 	 3/27/90 - re-word warning message a bit
+* RISC/Unix port *sh* 11/91: eliminate VMS-specific HELP coaching line
+* V230:  1/27/92 - changed uvlim_*_hi (unused) to uvlim_*_lohi to describe
+*                  @WEQ - exaxt limits required but a range of data
+*                - also added @RSUM (like @IIN)
+* V400: 11/9/94	 - use CALL WARN to display "Ambiguous coord"  message
+* V420: 9/95	 - Support for implicit grids: deallocate after it is used
+*	10/95	 - support for implicit axes: pass along use-count 
+*		   responsibility (TM_USE_LINE) for implicit axis to merged
+*		   grid since component will get deallocated
+*	 1/96	 - use INHERITED_LIMITS to ensure that modulo regridding
+*		   limits (embedded inside of expression) are not passed on
+*		   e.g. "5 + A[gt=climatology at MOD]" where A=SST[T=lo:hi] 
+*	2/27/96	 - axes for which cx_lo_ww was undefined were ignored.
+*		   This eliminated consideration of the Y
+*		   axis of LAT_ARG in r*lat_arg/LAT_REF	where
+*		   LAT_ARG = Y[Y=90S:90N:15]; r = 6; lat_ref = 45
+*		   The perverted logic sequence is explained at "2/27"
+* V430:	 5/96	 - fixing a bug that seems to have been here all along?????
+*		   the logic of this routine is based on cx_given, ignoring
+*		   limits given INSIDE of component definitions. Thus 
+*			let depth_z=h[x=110w,z=@iin]-h[x=110w]/2
+*			let r0=depth_z-x[g=gdepth]
+*		   resulted in an "Ambiguous axis" warning, ignoring the X=110W
+*		   Added variable expl_com_lims to the code
+* V450: 1/97	 - changes to accomodate grid changing functions.
+*		   MERGIFY_GRID is no
+*		   longer used.  The first component is handled in a manner
+*		   symmetrical with respect to the others.
+*		   Process a component even though it has unspecified ww lims.
+*		   Allow a com and a mrg axis both to be normal (axis_choice).
+*		   Maintain cx_given for the merged data set.
+*		   Added a row to the ax_choice table to deal with merged
+*			axis that was "uvlim_irrelevant"
+* V491:   2/23/98 - 1/97 check at line 400 for unspec cx_lo_ww introduced a bug
+*                 in cases like LET p=i[i=1:5]; LET q=i[i=1:5]; LET pq=p*q;
+*                 uvar_given for pq was set to uvlim_irrelevant instead of 
+*                 uvlim_gvn_gnl
+*         2/28/98 - further repair to resolve problem that re-appeared in
+*                 err490_l_ave.jnl: use "expl_com_lim" (explicit component
+*                 limits) **consistently** instead of cx_given to know whether
+*                 a new component does or does not possess its own limits
+* V500: *sh* 6/99 -- BUG COMMENT ONLY!! NOT FIXED. See err500_expl_lims.jnl
+*		  and find "6/99" in code below
+* V510: *sh* 12/99 - support for uvlim_hidden (EF caching)
+*	*sh* 12/99 - set the uvar_lo/hi limits along with uvar_given
+*	*sh* 12/99 - bug fix: rules for merging embodied in joint_match were
+*			wrong when new component is xact
+*	*sh*  4/00 - all grids and axes now maintain use counts 
+* V520  *sh* 6/00 - complete the support for uvlim_hidden. Was treated just
+*		    like uvlim_irrelevant in determining uvar_given
+* V533  *sh* 7/01 - determine data type of result
+* V64+ *acm 12/09 - Fix bug 1710: In the grid axis selection table, ax_choice(4,1)
+*                   changed from Not Possible to Not Applicable
+*      *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* v685 *acm* 4/13   Call WARN for warning message
+* v685 *acm* 5/13   Fix ticket 2051, setting uvar_given(idim,uvar) when the
+*                   user-variable has multiple sub-expressions
+* v690 *sh* 2/14  Determine the curvilinear (aux var) dependencies of the merged
+*		  expression
+
+	include 'tmap_dims.parm'
+	include 'grid_chg_fcns.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+	include	'xfr_grid.cmn'
+
+* calling argument declarations
+	LOGICAL		its_gc
+	INTEGER		iarg, mrg_cx, com_cx, uvar, status
+	CHARACTER	com_text*(*)
+
+* local variable declarations
+	LOGICAL		INHERITED_LIMITS, ITSA_PURE_SUM_VAR,
+     .			same, nest, expl_com_lim
+	INTEGER		CX_DIM_LEN, TM_LENSTR1, REGION_CLASS,
+     .			NEST_REGION_CLASS,  WHICH_GCFCN, GCF_RTN_TYPE,
+     .			mrg_grd, mrg_ax, mrg_len, com_grd, com_ax, com_len,
+     .			idim, i, icom, imrg, com_uvar, com_class, mrg_class,
+     .			uv_class, ax_choice(6,5), joint_match(0:3,0:3),
+     .			lims_gvn, gcfcn, axis_source(nferdims), uvar_test,
+     .			naux, blen
+	CHARACTER	VAR_CODE*128, buff*128
+
+* local parameter declarations
+	INTEGER		EXP,   IMP,   WRN1,   NP,   NA,  WRN2
+	PARAMETER     ( EXP=1, IMP=2, WRN1=3, NP=4, NA=5, WRN2=6 ) 
+	INTEGER		gnl,   lo,   lohi,   xact
+	PARAMETER     ( gnl=0, lo=1, lohi=2, xact=3 )
+
+* procedure:
+* the important considerations are
+*	o whether merged/component axes are same axis
+*	o whether merged/component axes are "irrelevant"
+*	o whether merged/comonent data spans are 1 or >1
+*	o whether merged/component region is given explicitly or implicitly
+*	o whether merged context depends on default data set
+
+* combinations of explicitly and implicitly defined data will take the axis
+* of the implicit component(s)
+* e.g. W[K=1:3] + U will have the Z/K axis from component U
+
+* when successfully completed the merged axis will be 
+*	1) the axis from the first component with region IMPLICITLY defined
+*	      ... or failing that ...
+*	2) the axis fom the first component with explicit region >1
+*	      ... or failing that ...
+*	3) the axis from the first component with any explicit region
+* If all components are normal to this axis the result, too, will be normal
+
+* * * * * * * * GRID AXIS SELECTION TABLE * * *
+*			  C O M P O N E N T
+*	       1      2     3       4     5       6  
+*                   expl_com_lim       .NOT.expl_com_lim 
+*                same          diff      same   diff 
+*  size:       1     >1      1     >1
+*	    ------------------------------------------
+*1       1  | EXP  |  *** | EXP | EXP |  IMP  | IMP  |
+*    given  ------------------------------------------
+*2      >1  | ***  |  NA  | NA  | WRN1|  IMP  | IMP  |
+*           ------------------------------------------
+*3.NOT.given| NA   |  NA  | NA  | NA  |  NA   | WRN2 |
+*           ------------------------------------------
+*4  normal  | NA** |  *** | EXP | EXP |  NA*  | IMP  | (NA* was *** pre 1/97, NA** was *** pre 12/09)
+*           ------------------------------------------
+*5  irrelev | EXP  |  EXP | EXP | EXP |  IMP  | IMP  |   (new row, 1/97)
+*           ------------------------------------------
+* EXP  - impose axis and explicit limits from component
+* IMP  - impose axis from component with implicit limits
+* ***  - impossible to occur
+* NA   - not applicable in determining grid (but still relevant in uvar_given)
+
+
+* * * DETERMINING UVAR_GIVEN * * *
+* There are subtlities associated with limits that are given in the UVAR
+* definition.  These are classified in uvar_given under these codings:
+* ("gvn" indicates lo/hi limits were given in square brackets)
+* ("gnl","lo","lohi" and "xact" encode special requirements of transformations)
+*	uvlim_irrelevant- limits irrelevant: NEW=10.1
+*	uvlim_hidden	- limits hidden inside on another axis: NEW=FFT(v)
+*	uvlim_gvn_gnl	- limits given in a gen'l way: NEW=U[K=1:5]
+*	uvlim_gvn_lo	- limits that require exact lo match: NEW=U[K=1:5 at IIN]
+*	uvlim_gvn_lohi	- limits require exact lohi match: NEW=U[K=1:5 at WEQ]
+*	uvlim_gvn_xact	- limits that reduce to a pt.: NEW=U[K=1:5 at AVE]
+*	uvlim_needed	- no limit info. given
+*	uvlim_need_lo	- no lims but transf. needs xact lo:NEW=U[K at IIN]
+*	uvlim_need_lohi	- no lims but transf. needs xact lohi:NEW=U[K=@WEQ]
+*	uvlim_need_xact - no lims but transf. needs xact: NEW=U[K at AVE]
+* note: i) uvlim_***_xact requires both limits to match exactly in order to
+*	   reuse memory-resident data
+
+* * * * DETERMINING UVAR_GIVEN WITH MULTIPLE COMPONENTS IN EXPRESSION * * *
+*		---  aggregate of previous components ---
+*			gnl	lo	lohi	  xact
+*		------------------------------------------
+* N C |	gnl	|	gnl	lo	lohi	gnl/xact |
+* E O |	lo	|	 lo	lo	lohi	 lo/xact |
+* W M |	lohi	|      lohi	lohi	lohi   lohi/xact |
+*   P |	xact	|      lohi	lohi    lohi	  xact	 |
+*		------------------------------------------
+* in this table the rows refer to the context qualifiers of new components
+* (i.e. what is given in square brackets).  The result of the table and
+* the columns are a generalization of the same concept applied to an aggregate
+* of components in an expression
+* gnl  == no match required e.g. "U"		or "U[K=1:5]"
+* lo   == match lo limit    e.g. "U[K=@IIN]"	or "U[K=1:5 at IIN]"
+* lohi == match lohi limit  e.g. "U[K=@WEQ]" 
+* xact == match both limits e.g. "U[K=@AVE]"	(b case in a/b above)
+*	  or neither limit e.g. "U[K=1:5 at AVE]"	(a case in a/b above)
+* "xact" is special because it refers to transformations that reduce a range
+*	of data to a point (like averaging).  If limits are included ("gvn")
+* 	it becomes self-documenting and axis-independent.
+
+	DATA	(ax_choice(i,1),i=1,6) / EXP,NP ,EXP,EXP, IMP,IMP  /,
+     .		(ax_choice(i,2),i=1,6) / NP ,NA ,NA ,WRN1,IMP,IMP  /,
+     .		(ax_choice(i,3),i=1,6) / NA ,NA ,NA ,NA , NA ,WRN2 /,  
+     .		(ax_choice(i,4),i=1,6) / NA ,NP ,EXP,EXP, NA ,IMP  /,
+     .		(ax_choice(i,5),i=1,6) / EXP,EXP,EXP,EXP, IMP,IMP  /
+! pre 1/97 .	(ax_choice(i,4),i=1,6) / NP , NP, EXP, EXP, NP , IMP  /
+! pre 12/09.	(ax_choice(i,4),i=1,6) / NP , NP ,EXP, EXP, NA ,IMP  /,
+
+	DATA	(joint_match(i,0),i=0,3) /  gnl,   lo, lohi, gnl  /,
+     .		(joint_match(i,1),i=0,3) /   lo,   lo, lohi, lo   /,
+     .		(joint_match(i,2),i=0,3) / lohi, lohi, lohi, lohi /,
+     .		(joint_match(i,3),i=0,3) / lohi, lohi, lohi, xact /
+
+**************************************************************************
+* is this a grid changing variable? (1/97)
+	
+	IF (its_gc) THEN
+	   gcfcn = WHICH_GCFCN(uvar)
+	   CALL GCF_GET_AXIS_SRCS(gcfcn, iarg, axis_source)
+	ENDIF
+
+* initialize
+	mrg_grd = cx_grid( mrg_cx )
+	com_grd = cx_grid( com_cx )
+
+* do we have nested user-defined variables ?
+	nest = cx_category( com_cx ) .EQ. cat_user_var
+	IF ( nest ) com_uvar = cx_variable( com_cx )
+
+* for merged context to be data set independent all components must be so
+	IF ( cx_category(com_cx) .EQ. cat_pseudo_var ) THEN
+* ... pseudo-vars are merged only if explicit "G=".  Was it G=var or G=grid ?
+	   cx_dset_gvn(mrg_cx) = cx_dset_gvn(mrg_cx)
+     .				.AND. .NOT.cx_grid_needs_dset
+	ELSE
+	   cx_dset_gvn(mrg_cx) = cx_dset_gvn(mrg_cx) .AND.
+     .	(cx_dset_gvn(com_cx).OR.cx_data_set(com_cx).EQ.pdset_irrelevant)
+	ENDIF
+
+* data type of result
+	IF (its_gc) THEN
+* ... can get result data type only when types of all arguments are known
+*     cuz it may be inherited from an argument
+	  IF (iarg .EQ. 1) THEN
+	    i = GCF_RTN_TYPE(gcfcn, com_cx)
+	    IF (i .EQ. pfcn_rtn_string) THEN
+	      cx_type(mrg_cx) = ptype_string
+	    ELSE
+	      cx_type(mrg_cx) = ptype_float
+	    ENDIF
+	  ENDIF
+	ELSE
+	  IF (uvar_num_items(uvar) .EQ. 1) THEN 
+	    cx_type(mrg_cx) = cx_type(com_cx)   ! v="a" or v=5
+
+* ... special HACK to allow string addition: "a" + "b"
+	  ELSEIF (ITSA_PURE_SUM_VAR(uvar)) THEN
+	    IF (cx_type(mrg_cx) .EQ. unspecified_int4) THEN
+	        cx_type(mrg_cx) = cx_type(com_cx)  ! inherit first arg type
+	    ELSEIF (cx_type(mrg_cx) .NE. cx_type(com_cx)) THEN
+	        cx_type(mrg_cx) = ptype_float      ! unmatched arg types
+	    ENDIF
+
+	  ELSE
+	    cx_type(mrg_cx) = ptype_float       ! expression float unless GC
+	  ENDIF
+	ENDIF
+
+* loop through the axes
+
+* 2/2014 - pass the aux var dependencies from the component to the merged result
+* merged result will contain a conflict wherever components point to different
+* aux variables for the same axis
+	naux = 0
+	DO idim = 1, nferdims
+	   IF (cx_aux_var(idim,com_cx) .NE. unspecified_int4) THEN
+	      naux = naux + 1
+	      IF (cx_aux_stat(idim,mrg_cx).EQ.paux_stat_conflict ) THEN
+* ... if previous merges had a conflict, it doesn't go away
+	         CONTINUE
+	      ELSEIF (cx_aux_stat(idim,mrg_cx).EQ.paux_stat_na) THEN
+	         cx_aux_var (idim,mrg_cx) = cx_aux_var (idim,com_cx)
+	         cx_aux_cat (idim,mrg_cx) = cx_aux_cat (idim,com_cx)
+	         cx_aux_stat(idim,mrg_cx) = cx_aux_stat(idim,com_cx)
+	      ELSEIF ( ( cx_aux_var(idim,mrg_cx)
+     .	            .NE. cx_aux_var(idim,com_cx) ) 
+     .		  .OR. ( cx_aux_cat(idim,mrg_cx)
+     .		    .NE. cx_aux_cat(idim,com_cx) )  ) THEN
+	         cx_aux_stat(idim,mrg_cx) = paux_stat_conflict
+	         cx_aux_var (idim,mrg_cx) = unspecified_int4
+	         cx_aux_cat (idim,mrg_cx) = unspecified_int4
+	         IF (mode_diagnostic) THEN
+* ... "Z axis auxiliary coordinates of expression in conflict.
+*     "Variable TEMP coordinates are from DEPTH1"
+*     "Other components indicate DEPTH2 
+	             buff = ww_dim_name(idim)//
+     .	' axis auxiliary coordinates of expression are in conflict.'
+	             CALL SPLIT_LIST(pttmode_explct, ttout_lun, buff, 0)
+	             buff = 'Variable '//VAR_CODE(cx_category(com_cx),
+     .						  cx_variable(com_cx))
+	             blen = TM_LENSTR1(buff)
+	             buff(blen+1:) = 'coordinates are from '//
+     .			VAR_CODE(cx_aux_cat(idim,com_cx),
+     .				 cx_aux_var(idim,com_cx) )//'.'
+	             CALL SPLIT_LIST(pttmode_explct, ttout_lun, buff, 0)
+	             buff = 'Other components indicate '//
+     .			VAR_CODE(cx_aux_cat(idim,mrg_cx),
+     .				 cx_aux_var(idim,mrg_cx) )//'.'
+	             CALL SPLIT_LIST(pttmode_explct, ttout_lun, buff, 0)
+	          ENDIF
+	       ELSEIF (cx_aux_stat(idim,mrg_cx).EQ.paux_stat_needed) THEN
+* ... new compoonent uses same aux as previously merged
+	         cx_aux_stat(idim,mrg_cx) = paux_stat_needed
+	       ENDIF
+	   ELSEIF (cx_aux_stat(idim,mrg_cx) .NE. paux_stat_na
+     .	     .AND. cx_aux_stat(idim,mrg_cx) .NE. paux_stat_passed ) THEN
+	       naux = naux + 1
+	   ENDIF
+	   IF (cx_aux_stat(idim,com_cx) .EQ. paux_stat_needed)
+     .			cx_aux_stat(idim,mrg_cx) = paux_stat_needed
+	ENDDO
+	cx_naux(mrg_cx) = naux
+
+* pass the axes and theirimplied dependencies to the merged result
+	DO 500 idim = 1, nferdims
+
+* get axes and lengths of data along them
+	   com_ax  = grid_line ( idim, com_grd )
+	   mrg_ax  = grid_line ( idim, mrg_grd )
+	   com_len = CX_DIM_LEN( idim, com_cx  )
+	   mrg_len = CX_DIM_LEN( idim, mrg_cx  )
+
+* arg of grid-changing function?
+	IF (its_gc ) THEN
+	   IF (    axis_source(idim).EQ.pgc_ignore_axis) THEN
+	      GOTO 500
+	   ELSEIF (axis_source(idim).EQ.pgc_impose_axis) THEN
+* ... imposed axes are handled later by GCF_IMPOSE_AXES
+	      GOTO 500
+	   ELSE
+* ... it is evidently, a mergible axis ... continue on
+	      CONTINUE
+	   ENDIF	      
+	ENDIF
+
+* ignore axes with unknown limits
+* 2/27/96 - kludge bug fix
+* Dynamic axes and the logic inadequacies of FLESH_OUT_AXIS have
+* created a problem. This check, which was here previously,
+*	   IF ( cx_lo_ww(idim,com_cx) .EQ. unspecified_val8 ) GOTO 500
+* was supposed to check if an axis has anything relevant to contribute. That
+* logic was based on the fact that during grid determination subscript limits
+* of 1:1,1:1,1:1,1:1 are supplied. Then FLESH_OUT_AXIS fills in the WW limits.
+* But as the 7/92 "kludge" in FLESH_OUT_AXIS explains the logic is not reliable
+* during grid determination. (A correct fix in that routine is to have a
+* global Boolean indicating if Ferret is in its grid determination phase.)
+* As a result, FLESH_OUT_AXIS may set the limits to unspecified ... counting
+* on them to be filled in by the variable definition, itself. (Correct
+* behavior for context determination, but not for grid determination).
+* These unspecified limits were causing the axis to be ignored.
+* On 2/27 we change this logic to use uvar_given to determine if this
+* axis should be ignored.
+
+* Made a special exception for mrg_ax being mnormal. In that case, even
+* the unspecified limits are relevant. This is a poorly understood kludge
+* fix to accomodate the fact that the grid is now initially set at all mnormal.
+	   IF ( cx_lo_ww(idim,com_cx) .EQ. unspecified_val8
+     .    .AND. mrg_ax .NE. mnormal				) THEN
+	      IF ( cx_category(com_cx) .NE. cat_user_var ) GOTO 500
+	      lims_gvn = uvar_given(idim, cx_variable(com_cx))
+	      IF ( lims_gvn.GT. uvlim_gvn_xact
+     .        .OR. lims_gvn.LT. uvlim_gvn_gnl ) GOTO 500
+	   ENDIF
+
+* 5/96 *sh*: have the limits of the new component been supplied?
+* Previously the code simply used cx_given(idim,com_cx) to decide this
+* but in doing so it missed the possibility that limits were given deeper
+* inside of the component definition.
+* Now we use expl_com_lim instead.
+* 1/97: avoid uvlim_irrelevant mistakenly implying expl_com_lims is TRUE
+*       by performing a more careful check on uvar_given than was done
+	   expl_com_lim = cx_given(idim,com_cx)
+	   IF ( nest ) expl_com_lim = expl_com_lim .OR. 
+     .		    (     uvar_given(idim,com_uvar).LE.uvlim_gvn_xact     
+     .		    .AND. uvar_given(idim,com_uvar).GE.uvlim_gvn_gnl  )
+* (NOTE: might a similar test be needed on mrg_cx?)
+
+* new axis same as merged one ?
+	   same = com_ax .EQ. mrg_ax
+! 5/96	   IF ( cx_given(idim,com_cx) .AND. cx_given(idim,mrg_cx) )
+	   IF ( expl_com_lim .AND. cx_given(idim,mrg_cx) )
+     .	      same  = same
+     .		.AND. cx_lo_ss(com_cx,idim) .EQ. cx_lo_ss(mrg_cx,idim)
+     .		.AND. cx_hi_ss(com_cx,idim) .EQ. cx_hi_ss(mrg_cx,idim)
+
+* determine pointers into logic table
+! 5/96	   IF ( cx_given(idim,com_cx) ) THEN
+	   IF ( expl_com_lim ) THEN
+	      IF ( same ) THEN
+	        icom = 1
+	      ELSE
+	        icom = 3
+	      ENDIF
+	   ELSE
+	      IF ( same ) THEN
+	        icom = 5
+	      ELSE
+	        icom = 6
+	      ENDIF
+	   ENDIF
+	   IF ( uvar_given(idim,uvar) .EQ. uvlim_irrelevant
+     .	   .OR.  uvar_given(idim,uvar) .EQ. uvlim_hidden  ) THEN
+	      imrg = 5
+	   ELSEIF ( mrg_ax .EQ. mnormal ) THEN
+	      imrg = 4
+	   ELSEIF ( cx_given(idim,mrg_cx) ) THEN
+	      IF ( mrg_len .EQ. 1 ) THEN
+	        imrg = 1
+	      ELSE
+	        imrg = 2
+	      ENDIF
+	   ELSE
+	      imrg = 3
+	   ENDIF
+! 6/99 NEXT LINE IS NOT AN ADEQUATE TEST!! com_len may in relity be GT 1, but
+! buried within a uvar def'n. uvar_given tells that limits are buried, but
+! NOT whether the limits are GT 1.
+!  example: "v" in  SST[x=180] + v, where v=X[GX=xax,I=1:10]
+	   IF ( com_len.GT.1 .AND. icom.LT.5 ) icom = icom + 1
+
+* update the merged cx_given value (added 1/97)
+	cx_given(idim,mrg_cx) = cx_given(idim,mrg_cx)
+     .			  .AND. expl_com_lim
+
+* take appropriate merging action
+*		  EXP  IMP WRN1   ***   NA  WRN2
+	   GOTO ( 100, 200,  90, 9000, 400, 190 ) ax_choice(icom,imrg)
+
+* give a warning before imposing ambiguous explicit limits
+* (use grid name as a flag to prevent multiple warnings)
+ 90	   IF ( grid_name(mrg_grd) .EQ. 'UVAR' ) CALL WARN
+     .			('Ambiguous coordinates on '//
+     .			ww_dim_name(idim)//' axis: '//
+     .			uvar_text(uvar)(:TM_LENSTR1(uvar_text(uvar))))
+	   grid_name(mrg_grd) = 'AMBG'
+
+* impose explicit limits from component that gave them (e.g. U[K=5])
+ 100	   CALL TM_USE_LINE(com_ax)
+	   CALL TM_DEALLO_DYN_LINE(mrg_ax)
+	   grid_line( idim, mrg_grd ) = com_ax
+	   cx_lo_ss( mrg_cx, idim ) = cx_lo_ss( com_cx, idim )
+	   cx_hi_ss( mrg_cx, idim ) = cx_hi_ss( com_cx, idim )
+	   GOTO 400
+
+* give a warning before imposing ambiguous implicit limits
+
+ 190	   IF ( grid_name(mrg_grd) .EQ. 'UVAR'
+     .		.OR. grid_name(mrg_grd) .EQ. 'AMBG' ) CALL WARN
+     .			('Ambiguous coordinates on '//
+     .			ww_dim_name(idim)//' axis: '//
+     .			uvar_text(uvar)(:TM_LENSTR1(uvar_text(uvar))))
+	   grid_name(mrg_grd) = 'AMBG'
+
+* impose an axis with implicit coordinates (inferred from the context)
+ 200	   CALL TM_USE_LINE(com_ax)
+	   CALL TM_DEALLO_DYN_LINE(mrg_ax)
+	   grid_line( idim, mrg_grd ) = com_ax
+
+* save implications about how limits are given in thi uvar_given(idim,uvar) .EQ. uvlim_s component
+* if the component is a user-defined variable then consider the implications
+* of its definition
+* com_class encodes the way limits are given in this component
+* uv_class is an intermediate for computing uvar_lim
+* ... first the a/b option in the joint_limit_match table
+
+* ... first screen out irrelevant cases
+* 2/23/98 - for a component which is a user var, uvar_given tells if it
+*           is irrelevant  
+*        For a component which is not, cx_lo_ww was already used prior to 2/98
+ 400	   IF ( nest ) THEN
+	      IF (uvar_given(idim,com_uvar).EQ.uvlim_irrelevant) THEN
+	         GOTO 500
+* (6/0) ... pass hidden limits if no specification preceded it
+	      ELSEIF (uvar_given(idim,com_uvar).EQ.uvlim_hidden) THEN
+	         IF ( uvar_given(idim,uvar).EQ.uvlim_irrelevant )
+     .				uvar_given(idim,uvar) = uvlim_hidden
+	         GOTO 500
+	      ENDIF
+	   ELSE
+	      IF (cx_lo_ww(idim,com_cx) .EQ. unspecified_val8) GOTO 500 ! 1/97
+	   ENDIF
+
+* If a previous component gave us uvlim_need_xact, we just kept that setting. 
+* for the entire expression. This was the cause of ticket 2051. Use 
+* uvlim_need_lohi instead for the tests below.
+
+cc	   IF ( uvar_given(idim,uvar) .EQ. uvlim_need_xact ) GOTO 500
+	   uvar_test =  uvar_given(idim,uvar)
+	   IF ( uvar_given(idim,uvar) .EQ. uvlim_need_xact ) uvar_test = uvlim_need_lohi
+
+* get limits-region class of new component
+	   IF ( nest ) THEN
+	      com_class = NEST_REGION_CLASS( idim, com_cx, com_uvar )
+	   ELSE
+	      com_class = REGION_CLASS( idim, com_cx )
+	   ENDIF
+
+	   IF ( uvar_given(idim,uvar) .EQ. uvlim_irrelevant 
+     .	   .OR. uvar_given(idim,uvar) .EQ. uvlim_hidden) THEN ! 1/97
+* nothing meaningful has been merged in so far
+	      uv_class = com_class				   ! 1/97
+	   ELSE
+* get limits-region class of so-far-merged components
+	      mrg_class = MOD( uvar_test, 4 )
+* how does the new component effect the merged class ?
+	      uv_class = joint_match( mrg_class, com_class )
+	   ENDIF
+
+* if the new component or any previous lacks given limits so does the result
+* e.g. LIST/K=1:5 U - U[K=3]
+* (the /K limits are lacking in the overall expression)
+!    2/28/98: replaced:  	   .OR. .NOT.cx_given(idim,com_cx)
+	   IF ( uvar_given(idim,uvar).GE. uvlim_needed
+     .	   .OR. .NOT.expl_com_lim
+     .	   .OR. .NOT.INHERITED_LIMITS(idim,com_cx) ) THEN
+	      uvar_given(idim,uvar) = uv_class + uvlim_needed
+	   ELSE
+	      uvar_given(idim,uvar) = uv_class
+	      IF ( cx_given(idim,com_cx) ) THEN
+	         CALL TRANSFER_CX_AXIS_TO_UV( idim, com_cx, uvar)
+	      ELSEIF ( expl_com_lim ) THEN
+	         CALL TRANSFER_UV_AXIS_TO_UV( idim, com_uvar, uvar)
+	      ENDIF
+	   ENDIF
+	
+ 500	CONTINUE
+
+* deallocate any implicit (temporary) grid that was created for this context
+	IF ( cx_has_impl_grid(com_cx) ) THEN
+	   IF ( mode_diagnostic )  CALL DIAG_OP
+     .		('dealloc ', isact_class_impl_grid, com_grd, 0)
+	   cx_has_impl_grid(com_cx) = .FALSE.
+	   CALL TM_DEALLO_DYN_GRID( com_grd )
+	ENDIF
+
+* successfully merged
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 9000	CALL ERRMSG( ferr_internal, status, 'mrg_grd_err', *5000 )
+	END
diff --git a/fer/ctx/mergify_cx.F b/fer/ctx/mergify_cx.F
new file mode 100644
index 0000000..534a4af
--- /dev/null
+++ b/fer/ctx/mergify_cx.F
@@ -0,0 +1,90 @@
+	SUBROUTINE MERGIFY_CX( dflt_cx, uvar, cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* impose a "merged look" on context cx by setting the data set to the default,
+* an dsetting the grid to the merged grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 5/00 *sh* set the bad value flag for the merged context
+* V533 7/01 *sh* - set the data type of the result
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	dflt_cx, uvar, cx, status
+
+* local variable declarations
+	INTEGER	KNOWN_GRID, idim
+
+* impose default data set or no data set as appropriate
+	IF ( uvar_need_dset( uvar ) ) THEN
+	   cx_data_set( cx ) = cx_data_set( dflt_cx )
+	ELSE
+	   cx_data_set( cx ) = pdset_irrelevant
+	ENDIF
+
+* point context to this user variable
+	cx_variable( cx ) = uvar
+	cx_category( cx ) = cat_user_var
+
+* get the missing value flag that corresponds to this variable
+	CALL GET_CONTEXT_BAD_FLAG( cx )
+
+* impose merged grid
+	cx_grid( cx ) = KNOWN_GRID( cx_data_set(cx), cat_user_var, uvar )
+	cx_unstand_grid( cx ) = .FALSE.
+
+* set the result data type (valid 
+	CALL KNOWN_DATA_TYPE(cx)
+
+* wipe out any transformations from first component of merged context
+	DO 100 idim = 1, nferdims
+	   cx_trans    ( idim, cx ) = trans_no_transform
+	   cx_trans_arg( idim, cx ) = bad_val4
+ 100	CONTINUE
+
+	RETURN
+
+* error exit
+! 5000	RETURN
+	END
diff --git a/fer/ctx/nest_region_class.F b/fer/ctx/nest_region_class.F
new file mode 100644
index 0000000..747dc71
--- /dev/null
+++ b/fer/ctx/nest_region_class.F
@@ -0,0 +1,123 @@
+	INTEGER FUNCTION NEST_REGION_CLASS( idim, cx, uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the region-limits class (uvar_given) of a user-defined variable
+* used as a component in another user-defined variable
+
+* for example,	DEFINE VARIABLE A = U[K=@AVE]
+*		DEFINE VARIABLE B = A[K=1:5] * 5
+* references to B have the K limits reduced to a point although it isn't
+* evident in the definition of B, alone.  This routine is used to determine
+* the uvar_given character of A[K=1:5] used as a component in B.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/18/89
+* V230:  1/27/92 - changed uvlim_*_hi (unused) to uvlim_*_lohi to describe
+*                  @WEQ - exaxt limits required but a range of data
+*                - also added @RSUM (like @IIN)
+*           ==>  commandeered "hi" to become "lohi" for @WEQ
+*    note: those table entries using "lohi" are less thoroughly tested
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'	
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations
+	INTEGER	idim, cx, uvar
+
+* local variable declarations
+	INTEGER	REGION_CLASS, iins, iout, nested(0:3,0:3)
+
+* local parameter declarations
+	INTEGER		gnl,   lo,   lohi,   xact
+	PARAMETER     ( gnl=0, lo=1, lohi=2, xact=3 )
+
+* * * * NESTING TABLE * * * *
+*			    ---  underlying user var definition  ---
+* (paradigm)	      U[K=1:5]	     U[K=@IIN]	     U[K=@WEQ]	    U[K=@AVE]
+*			gnl		lo		lohi		xact
+*		--------------------------------------------------------------
+* N C |	gnl	|	gnl		lo		lohi		xact |
+* E O |	lo	|	 lo		lo		lohi		xact |
+* W M |	lohi	|	lohi		lohi		lohi		xact |
+*   P |	xact	|	xact		xact		xact		xact |
+*		--------------------------------------------------------------
+* across the top of the table we have the class of the underlying definition
+* on the left we have the manner in which the new component is referenced
+* for example, if "DEFINE VARIABLE A=U[K=@AVE]" defines the underlying var
+*	       and "A[K=1:5]" is the new component then the column is "xact"
+*	       and the row is "gnl" indicating that the result is "xact".
+* (This makes sense as the new component will function like A[K=1:5 at AVE]
+*	- reducing to a point and requiring an exact match to locate it in mem.)
+*  or (ex#2)   if "DEFINE VARIABLE A=U" defines the underlying var
+*	       and "A[K=@AVE]" is the new component then the column is "gnl"
+*	       and the row is "xact" indicating that the result is "xact".
+
+* gnl  == no match required e.g. "U"		or "U[K=1:5]"
+* lo   == match lo limit    e.g. "U[K=@IIN]"	or "U[K=1:5 at IIN]"
+* lohi == match both limits (range of data)  e.g. "U[K=@WEQ]"
+* xact == match both limits (single point)   e.g. "U[K=@AVE]"
+* "xact" is special because it refers to transformations that reduce a range
+*	of data to a point (like averaging).
+
+	DATA	(nested(iins,0),iins=0,3) / gnl,   lo, lohi, xact /,
+     .		(nested(iins,1),iins=0,3) /  lo,   lo, lohi, xact /,
+     .		(nested(iins,2),iins=0,3) /lohi, lohi, lohi, xact /,
+     .		(nested(iins,3),iins=0,3) /xact, xact, xact, xact /
+
+**************************************************************************
+
+* terminology: in the example reference of A[K=1:5] where DEF VAR A=U[K=@AVE]
+* the "A[K=1:5]" is referred to as the "outside reference" and "U[K=@AVE]" is
+* the inside reference
+
+* get region-limits class of outside reference
+	iout = REGION_CLASS( idim, cx )
+
+* get region-limits class of inside reference
+	iins = MOD( uvar_given(idim,uvar), 4 )
+
+* pull nested reference from table
+	NEST_REGION_CLASS = nested( iins, iout )
+	
+	RETURN
+	END
diff --git a/fer/ctx/ov_grp_cx_doc.F b/fer/ctx/ov_grp_cx_doc.F
new file mode 100644
index 0000000..a1bb080
--- /dev/null
+++ b/fer/ctx/ov_grp_cx_doc.F
@@ -0,0 +1,77 @@
+	SUBROUTINE OV_GRP_CX_DOC( ov_cx, ncx, flags )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* merge additional variable contexts with those already merged into the
+* joint context for a plot to produce a list of documentation flags suitable
+* to make a key for this new context.  See GRP_CX_DOC
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+* V230:  7/22/92 - added overlay argument to ADDL_CX_DOC
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xplot_setup.cmn'
+
+* calling argument declarations
+	INTEGER ncx, ov_cx(ncx)
+	LOGICAL	flags(0:12)
+
+* internal variable declarations
+	INTEGER	i
+
+* internal parameter declarations:
+        LOGICAL overlay
+        PARAMETER ( overlay = .TRUE. )
+           
+* make a fresh copy of cx_plot and key_doc to keep current with the plot labels
+	CALL TRANSFER_CONTEXT( cx_plot, cx_buff )
+	DO 100 i = 0, 10
+ 100	flags(i) = key_doc(i)
+
+* merge the additional contexts
+	DO 200 i = 1, ncx
+ 200	CALL ADDL_CX_DOC( cx_buff, ov_cx(i), overlay, flags )
+
+	RETURN
+	END
diff --git a/fer/ctx/ovsiz_cx.F b/fer/ctx/ovsiz_cx.F
new file mode 100644
index 0000000..550ae29
--- /dev/null
+++ b/fer/ctx/ovsiz_cx.F
@@ -0,0 +1,119 @@
+	SUBROUTINE OVSIZ_CX( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* expand the context to grab more data than currently indicated
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/26/89
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	LOGICAL	ovsiz, user_var
+	INTEGER	grid, idim, ndim, pdim, dim(nferdims), ss, ii, status, var
+	REAL*8	TM_WORLD
+
+* initialize
+	user_var = cx_category(cx) .EQ. cat_user_var
+	var	 = cx_variable(cx)
+	grid	 = cx_grid(cx)
+	CALL GET_CX_DIMS( cx, ndim, dim )
+
+* can only perform over-sizing on a plane
+* cannot rely on ndim. e.g.: CONTOUR/k=lo:hi/i=lo:hi/j=lo:hi NEW
+*			where DEFINE VARIABLE NEW = U[K=@AVE]
+	pdim = 0
+	DO 100 ii = 1, ndim
+	   idim = dim(ii)
+	   IF ( user_var ) THEN
+	      IF ( uvar_given(idim,var) .EQ. uvlim_needed ) pdim = pdim + 1
+	   ELSE
+	      pdim = pdim + 1
+	   ENDIF
+ 100	CONTINUE
+	IF ( pdim .NE. 2 ) GOTO 1000
+
+	DO 200 ii = 1, ndim
+	   idim = dim(ii)
+
+* cannot resize safely if limits are given WITHIN user-var def'n
+	   IF ( user_var ) THEN
+	      IF ( uvar_given(idim,var) .NE. uvlim_needed ) GOTO 200
+	   ENDIF
+
+* assume resizing isn't needed until proven otherwise
+	   ovsiz = .FALSE.	
+* check lower limit
+	   ss = cx_lo_ss( cx, idim )
+	   IF ( cx_lo_ww(idim,cx) .LT. TM_WORLD(ss,grid,idim,box_middle) )
+     .									  THEN
+	        cx_lo_ss( cx, idim ) = ss - 1
+	        ovsiz = .TRUE.
+	   ENDIF
+* check upper limit
+	   ss = cx_hi_ss( cx, idim )
+	   IF ( cx_hi_ww(idim,cx) .GT. TM_WORLD(ss,grid,idim,box_middle) )
+     .									  THEN
+	        cx_hi_ss( cx, idim ) = ss + 1
+	        ovsiz = .TRUE.
+	   ENDIF
+* re-flesh axis if necessary
+	   IF ( ovsiz ) THEN
+	      cx_by_ss(idim,cx) = .TRUE.
+	      CALL CONFINE_AXIS  ( idim, cx, status )	! ignore status
+	      CALL FLESH_OUT_AXIS( idim, cx, status )	! ignore status
+	   ENDIF
+ 200	CONTINUE
+
+* flag that no further oversizing is needed
+ 1000	cx_ovsiz(cx) = ovsiz_off
+
+	RETURN
+	END
diff --git a/fer/ctx/parse_nam_dset.F b/fer/ctx/parse_nam_dset.F
new file mode 100644
index 0000000..ec235d0
--- /dev/null
+++ b/fer/ctx/parse_nam_dset.F
@@ -0,0 +1,176 @@
+	SUBROUTINE PARSE_NAM_DSET( full_var_name, default_cx,
+     .				       dset, cat, var, mods_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a full variable specification of the form:
+*			(eg.) TEMP[D=n,G=gname] (with optional region info)
+* return context information describing variable and data set
+
+* NOTE: THIS ROUTINE MAY CREATE AN IMPLICIT GRID that needs to be managed
+*	Check cx_has_impl_grid(mods_cx) in calling routine
+
+* Note that "dset" is both an input and output:  on input it is the
+*		default data set to be searched.  On output it is the
+*		data set that is correct.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V402: 7/95 - extracted from PARSE_NAM_DSET_GRD (w/out the grid part)
+* V450: 1/97 - use local variables instead of xPROG_STATE vars for item_start
+*		etc. to avoid conflict. (But share the max_item_list parameter
+*		from the COMMON area.
+* V500: *sh* 3/99 -- added comment WATCH IMPLICIT GRID MANAGEMENT
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687  *acm* 3/14 ticket 2133. Check for attribute name before looking for variable
+
+	include 'tmap_dims.parm'	
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER		default_cx, dset, cat, var, mods_cx, status
+	CHARACTER*(*)	full_var_name
+
+* internal variable declarations:
+	INTEGER		IGRID, var_cx, stk_stat,
+     .			full_name_len, left_bracket, right_bracket,
+     .			name_len, brac_nest, i, dot
+ 	LOGICAL		name_only
+* 1/97 addition
+	INTEGER	num_it, it_start(max_item_list), it_end(max_item_list)
+
+
+* set up error flag in case we fail
+	var = munknown_var_name
+
+* variable context level
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	var_cx = cx_stack_ptr
+	CALL TRANSFER_CONTEXT ( default_cx, var_cx )
+
+* modifications context level
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 4950
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS ( mods_cx )
+
+* separate simple name from possible modifiers
+	full_name_len = LEN   ( full_var_name )
+	left_bracket  = INDEX ( full_var_name, '[' )
+	name_only     = left_bracket .EQ. 0
+	IF ( name_only ) THEN
+	   name_len = full_name_len
+	ELSE
+	   name_len = left_bracket - 1
+* ... hunt for matching right bracket
+	   brac_nest = 1
+	   right_bracket = 0	! default to catch syntax errors
+	   DO 200 i = left_bracket+1,full_name_len
+	      IF ( full_var_name(i:i) .EQ. "[" ) THEN
+	         brac_nest = brac_nest + 1
+	      ELSEIF ( full_var_name(i:i) .EQ. "]" ) THEN
+	         brac_nest = brac_nest - 1
+	         IF ( brac_nest .EQ. 0 ) THEN
+	            right_bracket = i
+	            GOTO 210
+	         ENDIF
+	      ENDIF
+ 200	   CONTINUE
+ 210	   IF (   right_bracket .LE. left_bracket + 1
+     .	     .OR. name_len      .LE. 0			) GOTO 5100
+	ENDIF
+
+* break up the "[...,...,...]" into comma-separated arguments
+	IF ( .NOT.name_only ) THEN
+	   CALL PARSE_COMMA_LIST (	full_var_name,
+     .					left_bracket  + 1,
+     .					right_bracket - 1,
+     .					max_item_list,
+     .					num_it,
+     .					it_start,
+     .					it_end,
+     .					status		)
+	   IF ( status .NE. ferr_ok ) GOTO 4900
+	ELSE
+	   num_it = 0
+	ENDIF
+
+*interpret the list of items - unknown items represent errors
+	CALL GET_CONTEXT_MODS (	default_cx,
+     .				full_var_name,
+     .				mods_cx,
+     .				max_item_list,
+     .				num_it,
+     .				it_start,
+     .				it_end,
+     .				unknown_qual_bad,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 4900
+
+* apply data set to context if specified
+	IF ( cx_data_set( mods_cx ) .NE. unspecified_int4 )
+     .		cx_data_set( var_cx ) = cx_data_set( mods_cx )
+	IF (dset.EQ.unspecified_int4 .OR. cx_dset_gvn(mods_cx))
+     .		dset = cx_data_set( var_cx )
+
+* identify the simple variable name
+* (var = munknown_var_name will flag failure for the whole routine)
+* Look for a dot, indicating a varname.attname.
+
+	dot = INDEX(full_var_name(1:name_len),'.')
+	IF (dot .GT. 0) name_len = dot-1
+
+	CALL FIND_VAR_NAME( dset, full_var_name(1:name_len), cat, var )
+
+* relinquish the stack space used for the variable
+ 4900	CALL STACK_PTR_DN( cx_stack_ptr, cx_stack_ptr_base, stk_stat )
+
+* relinquish the stack space used for the modifications
+ 4950	CALL STACK_PTR_DN( cx_stack_ptr, cx_stack_ptr_base, stk_stat )
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, full_var_name, *4900 )
+ 5200	CALL ERRMSG( ferr_unknown_variable, status, full_var_name, *4900 )
+! 5300	CALL ERRMSG
+!     .		( ferr_unknown_data_set, status,'for '//full_var_name, *4900 )
+	END
diff --git a/fer/ctx/parse_var_name.F b/fer/ctx/parse_var_name.F
new file mode 100644
index 0000000..30434a4
--- /dev/null
+++ b/fer/ctx/parse_var_name.F
@@ -0,0 +1,319 @@
+	SUBROUTINE PARSE_VAR_NAME( full_var_name, var_cx, mods_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* parse a full variable specification of the form:
+*			(eg.) TEMP[X=170E:170W,K=+1D,T=188979]
+* return the context modifications in the modification buffer passed
+* and the updated (but not completed) variable context in the var context passed
+* (var_cx must contain the full default context at the time of the call)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/27/86
+* revision 0.1 - 2/25/87 - using PARAMETER munknown_var_name
+* revision 0.2 - 3/23/87 - added new TMAP library: time axes, file var. names
+*			   APPLY_CONTEXT_MODS now called in this routine
+* revision 0.3 - 9/16/87 - unknown_qual_bad moved to FERRET.PARM
+* revision 0.4 - 7/27/88 - added var_cx (default) to get_context_mods call
+* V200:  4/25/90 - initialize cx_given (bug): it was passed along from default
+*		   context if no mods were given.  Thus "list/i=101:105 temp"
+*		   would have cx_given(x_dim)=.true. whereas
+*		   "list/i=101:105 temp[x=@ave]" would have it .false.
+* V402: 7/95 - Allow nested [] of the form vname1[G=vname2[D=dset]]
+* V450: 1/97 - use local variables instead of xPROG_STATE vars for item_start
+*		etc. to avoid conflict. (But share the max_item_list parameter
+*		from the COMMON area.
+* V530:  8/00 *sh* - set the variables data type
+* V550: 10/02 *acm*- Look for @ in full_var_name when determining name_len
+* V554 1/04 *acm* - add category cat_counter_var
+* V600: 9/05 *acm* - add category cat_attrib_val
+* V611 5/08 *acm* Fix bug 1578; dataset specifiers applied correctly var[d=1].attname
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 3/13 *sh* support for auxiliary regridding variables
+*		 and SHOW VAR/DEPENDENCIES (unknown variable err not reported)
+* V690 12/13 *sh* set auto-curvilinear actions that are needed
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xdependency_tree.cmn'
+#include "netcdf.inc"
+
+* calling argument declarations:
+	CHARACTER*(*)	full_var_name
+	INTEGER		var_cx, mods_cx, status
+
+* internal variable declarations:
+	INTEGER		STR_SAME, TM_LENSTR1, 
+     .                  full_name_len, left_bracket, right_bracket, 
+     .			name_len, atsign, idim,  brac_nest, i,
+     .                  dset, varid, attype, attlen, attoutflag,
+     .                  attid, dot,
+     .			curv_vars(nferdims), curv_cats(nferdims)
+ 	LOGICAL		name_only, do_err, aux_given
+* 1/97 addition
+	INTEGER	num_it, it_start(max_item_list), it_end(max_item_list)
+        CHARACTER varname*512, attname*128, newname*512
+
+        newname = full_var_name
+
+* separate simple name from possible modifiers
+	full_name_len = TM_LENSTR1 ( newname )
+	left_bracket  = INDEX ( newname, '[' )
+	name_only     = left_bracket .EQ. 0
+	IF ( name_only ) THEN
+	   name_len = full_name_len
+	ELSE
+	   name_len = left_bracket - 1
+* ... hunt for matching right bracket
+	   brac_nest = 1
+	   right_bracket = 0	! default to catch syntax errors
+	   DO 200 i = left_bracket+1,full_name_len
+	      IF ( newname(i:i) .EQ. "[" ) THEN
+	         brac_nest = brac_nest + 1
+	      ELSEIF ( newname(i:i) .EQ. "]" ) THEN
+	         brac_nest = brac_nest - 1
+	         IF ( brac_nest .EQ. 0 ) THEN
+	            right_bracket = i
+	            GOTO 210
+	         ENDIF
+	      ENDIF
+ 200	   CONTINUE
+ 210	   IF (   right_bracket .LE. left_bracket + 1
+     .	     .OR. name_len      .LE. 0			) GOTO 5000
+	ENDIF
+
+        IF (left_bracket .GT. 0) THEN
+           dot = INDEX ( newname, '.' )
+           IF (dot .GT. right_bracket) THEN  ! this is a var[d=].attribute
+              newname = full_var_name(1:left_bracket-1)//
+     .         full_var_name(left_bracket:right_bracket)//
+     .         full_var_name(right_bracket+1:full_name_len)
+              full_name_len = TM_LENSTR1(newname)
+              name_len = full_name_len
+              name_only = .TRUE.
+           ENDIF
+        ENDIF
+
+* If full_var_name is b at asn, which can occur if b not yet loaded, return 
+* name_len is just up to the @
+
+        atsign = INDEX ( newname, '@' )
+        IF (atsign .GT. 0  .AND. name_only) THEN
+           name_len = atsign - 1
+    	   IF (   name_len      .LE. 0			) GOTO 5000
+        ENDIF
+
+* break up the "[...,...,...]" into comma-separated arguments
+	IF ( .NOT.name_only ) THEN
+	   CALL PARSE_COMMA_LIST (	newname,
+     .					left_bracket  + 1,
+     .					right_bracket - 1,
+     .					max_item_list,
+     .					num_it,
+     .					it_start,
+     .					it_end,
+     .					status		)
+	   IF ( status .NE. ferr_ok ) GOTO 5900
+	ELSE
+	   num_it = 0
+	ENDIF
+
+*interpret the list of items - unknown items represent errors
+	CALL GET_CONTEXT_MODS (	var_cx,
+     .				newname,
+     .				mods_cx,
+     .				max_item_list,
+     .				num_it,
+     .				it_start,
+     .				it_end,
+     .				unknown_qual_bad,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 5900
+
+* apply those context mods that don't need to know the grid
+* apply them now, before looking for the variable name, because the data set is
+* needed in the name search
+	DO 100 idim = 1, nferdims
+ 100	cx_given(idim,var_cx) = .FALSE.			! *sh* 4/90 bug fix
+	CALL APPLY_CONTEXT_MODS ( mods_cx, var_cx, nest_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5900
+
+* identify the simple variable name
+        CALL FIND_VAR_NAME( cx_data_set( var_cx ),
+     .			    newname(1:name_len),
+     .			    cx_category( var_cx ),
+     .			    cx_variable( var_cx ) )
+
+* always apply mods that describe the auxiliary regridding variables
+	cx_naux(var_cx) = cx_naux(mods_cx)
+	DO 102 idim = 1, nferdims
+	   cx_aux_arg_start(idim,var_cx) = cx_aux_arg_start(idim,mods_cx)
+	   cx_aux_arg_end  (idim,var_cx) = cx_aux_arg_end  (idim,mods_cx)
+	   cx_aux_stat     (idim,var_cx) = cx_aux_stat     (idim,mods_cx) 
+ 102	CONTINUE
+
+	IF ( cx_variable( var_cx ) .EQ. munknown_var_name ) THEN
+* bail out if this variable cannot be identified
+	   GOTO 5100
+	ELSEIF (cx_category(var_cx) .EQ. cat_file_var
+     .     .OR. cx_category(var_cx) .EQ. cat_user_var ) THEN
+* fill in the default aux vars associated with this variable
+	   CALL GET_AUTO_AUX_VARS( cx_variable(var_cx),
+     .				   cx_category(var_cx),
+     .				   cx_data_set(var_cx),
+     .				   curv_vars, curv_cats )
+	   DO idim = 1, nferdims
+	      IF ( curv_vars(idim) .NE. unspecified_int4
+     .	     .AND. cx_aux_stat(idim,var_cx) .EQ. paux_stat_na  ) THEN
+	         cx_aux_cat (idim,var_cx) = curv_cats(idim)
+	         cx_aux_var (idim,var_cx) = curv_vars(idim)
+	         cx_aux_stat(idim,var_cx) = paux_stat_passed
+	      ENDIF
+	   ENDDO
+	ENDIF
+
+* set up automated curvilinear actions:  aux variable loads and regridding
+* cases include
+*  [z=pt, sigma], [z=lo:hi:delta,sigma], [z=lo:hi at ave,sigma], [gz=zax,sigma]
+	cx_implicit_aux(var_cx) = .FALSE.   ! set default
+	aux_given = .FALSE.
+	DO idim = 1, nferdims
+	   aux_given = aux_given .OR. cx_aux_given(idim,mods_cx)
+	ENDDO
+	IF ( aux_given ) THEN
+	   IF ( cx_category(var_cx) .NE. cat_file_var
+     .	  .AND. cx_category(var_cx) .NE. cat_user_var ) GOTO 5200
+!	   IF (cx_mod_sigma .AND.
+!     .	     .NOT. (cx_given(z_dim,mods_cx)) GOTO 5300
+!	   IF (cx_mod_curvi .AND.
+!     .	     .NOT.(cx_given(x_dim,mods_cx).AND.cx_given(y_dim,mods_cx))
+!     .					 ) GOTO 5350
+	   CALL APPLY_AUTO_CURV(newname(:full_name_len), var_cx, status)
+	   IF (status .NE. ferr_ok) GOTO 5900
+	ENDIF
+
+* set the data type of the variable'
+	IF ( cx_category(var_cx) .EQ. cat_file_var ) THEN
+	   cx_type(var_cx) = ptype_float   ! TO BE GENERALIZED LATER (8/00)
+	ELSEIF ( cx_category(var_cx) .EQ. cat_aggregate_var ) THEN
+	   cx_type(var_cx) = ptype_float   
+        ELSEIF ( cx_category(var_cx) .EQ. cat_pystat_var ) THEN
+           cx_type(var_cx) = ptype_float
+	ELSEIF (cx_category(var_cx) .EQ. cat_calc_var ) THEN
+	   cx_type(var_cx) = ptype_float
+	ELSEIF (cx_category(var_cx) .EQ. cat_counter_var ) THEN
+	   cx_type(var_cx) = ptype_float
+        ELSEIF (cx_category(var_cx) .EQ. cat_attrib_val) THEN
+
+           do_err = .TRUE.
+           dset = cx_data_set(var_cx)
+           IF (dset .EQ. unspecified_int4) dset = -1  
+           CALL  BREAK_VARATTNAME ( newname(1:name_len),
+     .                              dset, varname, 
+     .                              attname, varid, do_err, status )
+
+           IF (status .NE. ferr_ok) GOTO 5100
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .           attid, attname, attype, attlen, attoutflag, status )
+
+              IF (status .NE. ferr_ok) THEN
+* Is it a pseudo-attribute for the variable?
+
+                 IF (STR_SAME(attname, 'attnames') .EQ. 0 .OR. 
+     .               STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+                    cx_type(var_cx) = ptype_string
+                 ELSEIF (STR_SAME(attname, 'ndims') .EQ. 0 .OR. 
+     .                   STR_SAME(attname, 'type')  .EQ. 0 .OR. 
+     .                   STR_SAME(attname, 'nattrs') .EQ. 0) THEN
+                    cx_type(var_cx) = ptype_float
+                 ELSE
+                    GOTO 5100
+                 ENDIF
+              ELSE
+
+                 cx_type(var_cx) = ptype_float
+                 IF (attype .EQ. NCCHAR) cx_type(var_cx) = ptype_string
+              ENDIF
+
+           ELSE
+
+* Is it a pseudo-attribute at the dataset level?
+              cx_type(var_cx) = ptype_float
+              IF (STR_SAME (attname, 'varnames')  .EQ. 0 .OR.
+     .            STR_SAME (attname, 'dimnames')  .EQ. 0 .OR.
+     .            STR_SAME (attname, 'attnames')  .EQ. 0 )
+     .         cx_type(var_cx) = ptype_string
+           ENDIF
+	ELSE
+	   cx_type(var_cx) = unspecified_int4 ! inherited from definition
+	ENDIF
+
+* successful completion:
+        status = ferr_ok
+	RETURN
+
+* error exits:
+ 5000	CALL ERRMSG( ferr_syntax, status, full_var_name, *5900 )
+ 5100	IF ( dependency_tree_mode ) THEN
+	   status = ferr_unknown_variable   ! set the status, but don't report
+	   GOTO 5900
+	ELSE
+	   CALL ERRMSG
+     .		( ferr_unknown_variable, status, full_var_name, *5900 )
+	ENDIF
+ 5200	CALL ERRMSG( ferr_syntax, status,
+     .		'SIGMA and CURVI can only be used on LET variables'//
+     .		' and file variables: '//full_var_name, *5900 )
+! 5300	CALL ERRMSG( ferr_syntax, status,
+!     .		'SIGMA must be accompanied by explicit Z limits: '
+!     .		//full_var_name, *5900 )
+! 5350	CALL ERRMSG( ferr_syntax, status,
+!     .		'CURVI must be accompanied by explicit X and Y limits: '
+!     .		//full_var_name, *5900 )
+
+ 5900	RETURN
+	END
diff --git a/fer/ctx/plotify_grp_cx.F b/fer/ctx/plotify_grp_cx.F
new file mode 100644
index 0000000..f2341c2
--- /dev/null
+++ b/fer/ctx/plotify_grp_cx.F
@@ -0,0 +1,116 @@
+	SUBROUTINE PLOTIFY_GRP_CX( cx_list, ncx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* modify the joint context and document flags for a plot so that information
+* which is implicitly documented via the plotting axes is not duplicated in
+* the plot labels
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  1/5/90
+* V230:   6/9/92 - added WIRE command
+*        7/22/92 - turn off in-plane key info e.g. xy plane: VECT u,v[g=temp]
+*  1/28/93 - for SHADE, CONTOUR and VECTOR return a 2D region if possible
+* V500: *sh* added POLYGON command
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include	'slash.parm'
+	include	'xcontext.cmn'
+	include	'xplot_setup.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations
+        INTEGER ncx, cx_list(ncx)
+
+* internal variable declarations
+	INTEGER	idim, cx, icx, ndim, ifix, pdim
+
+* for PLOT/VS and WIRE the along-axis limits do need to be displayed
+        IF ( cmnd_num .EQ. cmnd_wire
+     . .OR.  cmnd_num .EQ. cmnd_polygon
+     . .OR. (cmnd_num .EQ. cmnd_plot
+     . .AND. qual_given(slash_plot_vs).GT.0) ) RETURN
+
+* 1/93
+* for SHADE, CONTOUR, and VECTOR promote 0 and 1D regions to 2D if possible
+        IF ( cmnd_num .EQ. cmnd_contour
+     . .OR.  cmnd_num .EQ. cmnd_shade
+     . .OR.  cmnd_num .EQ. cmnd_vector ) THEN
+           ndim = nplot_axis + 1
+           DO 200 ifix = ndim, 2
+              DO 150 idim = 1, nferdims
+* axis already included in nplot_axis ?
+                 DO 100 pdim = 1, nplot_axis
+                    IF ( idim .EQ. plot_axis(pdim) ) GOTO 150
+ 100             CONTINUE
+                 DO 110 icx = 1, ncx
+                    cx = cx_list(icx)
+                    cx = cx_cmnd
+
+* suitable dimensions must have valid ww coords and indices
+                    IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4
+     .              .OR. cx_lo_ww(idim,cx) .EQ. unspecified_val8
+     .              .OR. cx_lo_ww(idim,cx) .GE. cx_hi_ww(idim,cx) )
+     .                                                    GOTO 150
+ 110             CONTINUE
+* found a suitable dimension to promote the plot context with
+                 plot_axis(ifix) = idim
+                 nplot_axis = nplot_axis + 1
+                 GOTO 200
+ 150          CONTINUE
+ 200       CONTINUE
+        ENDIF
+
+* limits along the plot axes are implicitly documented
+	DO 300 pdim = 1, nplot_axis
+	   idim = plot_axis(pdim)
+	   cx_lo_ww(idim,cx_plot) = unspecified_val8
+	   cx_hi_ww(idim,cx_plot) = unspecified_val8
+	   key_doc(idim) = .FALSE.      ! 7/92
+* ... but transformations along the plot axes are not
+	   key_doc(idim+pdoc_offset_xform) = .TRUE.
+ 300	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ctx/pseudo_var_context.F b/fer/ctx/pseudo_var_context.F
new file mode 100644
index 0000000..2637b08
--- /dev/null
+++ b/fer/ctx/pseudo_var_context.F
@@ -0,0 +1,341 @@
+	SUBROUTINE PSEUDO_VAR_CONTEXT
+     .		      ( full_pvar_name, 
+     .			dflt_cx,
+     .			pvar_cx,
+     .			pvdim,
+     .			status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a pseudo-variable
+* return in pvar_cx context information describing the exact instance
+* including grid and region
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/2/87
+* revision 0.1 - 5/5/88  - FINISH_CONTEXT_MODS --> FLESH_OUT_CONTEXT
+*			   added CONFINE_CONTEXT
+* V200: 6/26/89
+* V420: 9/27/95 - allow implicit grids underlying pseudo-var
+*	10/95	- allow implicit axes like i[i=1:10:2]
+*	11/95   - code to deal with T[T=date:date:delta]
+* 
+* kob  8/25/97 - use newly created cx_calender to check whether time is a date or time_step
+* V500: 2/22/99 *sh* - if ABSTRACT grid or normal axis then use XABSTRACT (or
+*			YABSTRACT, ZABSTRACT, TABSTRACT)
+*		       see Note at "the_real-ABSTRACT"
+* V510: 8/99 *sh* - for g=user_var the returned grid is LT unspecified_int4
+*		... having the text position of uvar encoded in it
+*		... exit out earliy in this case
+*	12/99 *sh* - for formatted lat or lon (e.g. Y[y=0:20n:2]), set units
+*	 4/00 *sh* - all grids and axes now maintain use counts
+* V530:  8/00 *sh* - assert float data type for pseudo-variable
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include 'tmap_dims.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include	'xfr_grid.cmn'
+	include	'xprog_state.cmn'
+	include 'xrisc.cmn'
+	include 'tmap_errors.parm'
+	include 'xunits.cmn_text'
+	include 'implicit.parm'
+	include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+	INTEGER		dflt_cx, pvar_cx, pvdim, status
+	CHARACTER*(*)	full_pvar_name
+
+* internal variable declarations:
+	LOGICAL		its_dyn, has_impl_axis, calendar, alloed_tmp
+	INTEGER		CGRID_AXIS, mods_cx, idim, pvax, base_grid,
+     .			impl_grid, like, tmp, the_real_ABSTRACT
+
+* internal parameter declarations
+	REAL*8		daysinsecs
+	PARAMETER     ( daysinsecs = 60.*60.*24.)
+
+* initialize fixed length string for RISC
+        risc_buff = full_pvar_name
+        len_rbuff = MIN( size_rbuff, LEN(full_pvar_name) )
+* ... Note: the variable mgrid_abstract gets changed by SET GRID, so here
+*     we use an ugly hack to capture the grid that is actually named "ABSTRACT"
+	the_real_ABSTRACT = mgrid_xabstract - 2
+
+* use default context as a starting point
+	CALL TRANSFER_CONTEXT ( dflt_cx, pvar_cx )
+
+* find a context slot for the modifications that may be attached to the var name
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS ( mods_cx )
+
+* get variable and attached modifications
+	CALL PARSE_VAR_NAME ( full_pvar_name, pvar_cx, mods_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	cx_type( pvar_cx ) = ptype_float 
+
+* axis of pseudo_var
+
+	pvdim = MOD( cx_variable(pvar_cx)-1, 6 ) + 1
+
+* temporary bug check: may not transform pseudo-variable
+	IF ( cx_trans(pvdim,pvar_cx) .NE. trans_no_transform ) CALL ERRMSG
+     .		( ferr_syntax, status,
+     .		'cannot transform pseudo-variables: '//
+     .		 risc_buff(:len_rbuff)//pCR//
+     .		'use DEFINE VARIABLE (e.g. DEF VAR ii=i) and transform that', 
+     .								*5000 )
+
+* pseudo var may not depend on any data set
+	IF ( .NOT.(cx_dset_gvn(mods_cx) .OR. cx_grid_needs_dset) ) THEN
+	   cx_data_set(pvar_cx) = pdset_irrelevant
+	ENDIF
+
+* bug check
+	IF ( cx_category(pvar_cx) .NE. cat_pseudo_var ) CALL ERRMSG
+     .			( ferr_internal, status, 'pseud_v', *5000 )
+
+* implicit axis of the form I[I=1:10:2] used?
+	has_impl_axis = cx_delta(pvdim,pvar_cx) .NE. unspecified_val8
+	IF ( has_impl_axis ) THEN
+
+* ... make sure the specified delta makes sense
+	   IF ( cx_delta(pvdim,pvar_cx) .LE. 0.0D0 ) GOTO 5200
+
+* ... need a temporary grid to hold the axes so make it if we don't have one
+	   IF ( .NOT.cx_has_impl_grid(pvar_cx) ) THEN
+	      CALL ALLO_GRID_TO_CX( pvar_cx, impl_grid, status )
+	      IF (status .NE. ferr_ok) GOTO 5000
+	   ENDIF
+	ENDIF
+
+* process implicit (dynamic) grids (9/95)
+* complete the implicit grid definition from the pieces provided
+* There is no reason that we **have to** retain any axes other than the
+* needed one but it reduces the proliferation of distinct grids if we do
+	IF ( cx_has_impl_grid(pvar_cx) ) THEN
+* ... build the grid
+*     Note: there is an (imperfect) subtlety in the selection of "base_grid"
+*	In an expression like "temp+x" the pseudo-variable inherits its axis
+*	from the variable "temp".  So in an expression like
+*	"temp[x=lo:hi:del]+X[x=lo:hi:del]" presumably the same would be true.
+*	This would require that base_grid was inherited --> pulled from 
+*	cx_grid(pvar_cx).  However, the inheritance only occurs after an
+*	initial pass through this routine where cx_grid(pvar_cx) is unknown.
+*	This means that the inherited base_grid based could vary from pass
+*	to pass -- leading to, say, the delta value 2 in X[x=lo:hi:2] being
+*	applied first to ABSTRACT and then to itself -- leading to a delta of
+*	4 and probably a crash.  This is side-stepped by using cx_grid(mods_cx)
+*	but with the result that the grid is not inherited.  To  work around
+*	the user must use "temp[x=lo:hi:del]+X[g=temp,x=lo:hi:del]"
+	   IF ( cx_grid(mods_cx) .NE. unspecified_int4 ) THEN
+	      base_grid = cx_grid(mods_cx)
+	   ELSE
+! 2/22/99 addition
+	      IF (mgrid_abstract .EQ. the_real_ABSTRACT) THEN
+	         base_grid = mgrid_xabstract + pvdim - 1
+	      ELSE
+		 base_grid = mgrid_abstract
+	      ENDIF
+	   ENDIF
+	   impl_grid = cx_impl_grid(pvar_cx)
+	   DO 50 idim = 1, nferdims
+	      IF ( grid_line(idim,impl_grid).EQ.unspecified_int4 )
+     .		   grid_line(idim,impl_grid) = grid_line(idim,base_grid)
+ 50	   CONTINUE
+	ENDIF
+
+* if a dynamic axis was requested create it with the named grid or axis
+* as a template and insert it into the dynamic grid 
+	IF ( has_impl_axis ) THEN
+* ... make the implicit axis and save it in the implicit grid
+	   like = grid_line(pvdim,impl_grid)
+	   IF ( cx_by_ss(pvdim,pvar_cx) ) THEN
+	      CALL TM_GET_LIKE_DYN_LINE( pvdim,
+     .					 DBLE(cx_lo_ss(pvar_cx,pvdim)),
+     .					 DBLE(cx_hi_ss(pvar_cx,pvdim)),
+     .					 cx_delta(pvdim,pvar_cx),
+     .					 like,
+     .					 pline_class_stride,
+     .					 grid_line(pvdim,impl_grid),
+     .					 status)
+	      cx_lo_ss(pvar_cx,pvdim) = 1
+	      cx_hi_ss(pvar_cx,pvdim) = line_dim(grid_line(pvdim,impl_grid))
+	   ELSE
+* ... special processing for calendar pseudo-variables and lat/long formatting
+* *kob* 8/97 check cx_calendar rather then cx_lo_ww
+	      calendar = pvdim.EQ.t_dim .AND. cx_calendar(pvar_cx)
+	      alloed_tmp = .FALSE.	! assume no dyn axis allocated
+	      IF ( calendar ) THEN
+* ... note: a minor misbehavior:  for the pseudo-variable
+* 	"T[g=temp,t=[t=1-jan-1982:1-jan-1983:24]" it would be nice to inherit
+*	line_t0, etc. from g=temp.  The current method does not. (11/95)
+	         cx_lo_ww(pvdim,pvar_cx) = cx_lo_ww(pvdim,pvar_cx)
+     .					/(-1 * daysinsecs)	! days since BC
+	         cx_hi_ww(pvdim,pvar_cx) = cx_hi_ww(pvdim,pvar_cx)
+     .					/(-1 * daysinsecs)	! days since BC
+* *kob* 9/997 - reset cx_calendar after conversion
+		 cx_calendar(pvar_cx) = .FALSE.
+	         cx_delta(pvdim,pvar_cx) = cx_delta(pvdim,pvar_cx)/24.
+	         CALL TM_ALLO_DYN_LINE( tmp, status )
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+	         alloed_tmp = .TRUE.
+	         CALL TM_COPY_LINE( like, tmp )
+	         line_t0(tmp) = '1-JAN-0000'
+	         line_shift_origin(tmp) = .FALSE.
+	         line_units(tmp) = 'DAYS'
+	         line_unit_code(tmp) = -4			! days
+	         line_tunit(tmp) = daysinsecs
+	         line_direction(tmp) = 'TI'
+	         like = tmp
+	      ELSEIF ( cx_formatted(pvdim) 
+     .		.AND. (pvdim.EQ.x_dim .OR. pvdim.EQ.y_dim) ) THEN
+	         CALL TM_ALLO_DYN_LINE( tmp, status )
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+	         alloed_tmp = .TRUE.
+	         CALL TM_COPY_LINE( like, tmp )
+	         line_unit_code(tmp) = pun_degrees
+	         IF ( pvdim .EQ. x_dim ) THEN
+		    line_units(tmp) = 'DEGREES_EAST'
+	            line_direction(tmp) = 'WE'
+	         ELSEIF ( pvdim .EQ. y_dim) THEN
+		    line_units(tmp) = 'DEGREES_NORTH'
+	            line_direction(tmp) = 'SN'
+	         ENDIF
+	         like = tmp
+	      ENDIF
+	      CALL TM_GET_LIKE_DYN_LINE( pvdim,
+     .					 cx_lo_ww(pvdim,pvar_cx),
+     .					 cx_hi_ww(pvdim,pvar_cx),
+     .					 cx_delta(pvdim,pvar_cx),
+     .					 like,
+     .					 pline_class_basic,
+     .					 grid_line(pvdim,impl_grid),
+     .					 status)
+	      IF ( alloed_tmp ) THEN
+	         CALL TM_DEALLO_DYN_LINE( tmp )
+	      ENDIF
+	   ENDIF
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   cx_delta(pvdim,pvar_cx) =  unspecified_val8
+	ENDIF
+
+	IF ( cx_has_impl_grid(pvar_cx) ) THEN
+* increment the use count of dynamic axes that are in-use by the temporary grid
+	   DO 25 idim = 1, nferdims
+ 25	   CALL TM_USE_LINE(grid_line(idim,impl_grid))
+
+* catalog the temporary grid as a dynamic grid checking for existing like grid
+* ... catalog it or reuse a previously cataloged version
+	   CALL TM_GET_LIKE_DYN_GRID(impl_grid,its_dyn,
+     .				cx_grid(pvar_cx),grd_stk_ptr,status)
+	   IF (status .NE. merr_ok) GOTO 5000
+	   IF ( its_dyn ) THEN
+	      IF ( mode_diagnostic )  CALL DIAG_OP
+     .	     ('allocate', isact_class_impl_grid, cx_grid(pvar_cx), 0)
+	   ELSE
+	      cx_has_impl_grid(pvar_cx) = .FALSE.
+	   ENDIF
+
+* ... deallocate the (now unnecessary) implicit stack-based grid
+#ifdef debug_dyn_grids
+	   IF ( mode_diagnostic )  CALL DIAG_OP
+     .	  ('dealloc ', isact_class_impl_grid, impl_grid, 0)
+#endif
+	   CALL DEALLO_GRID(status)
+
+* the dynamic (managed) grid has now replaced the temporary (stack) grid
+	   impl_grid = cx_grid(pvar_cx)
+
+	ENDIF
+
+* unknown grid for pseudo-variable is OK when program is determining grid
+* for an algebraic expression but not OK when it's time to evaluate the expr.
+	IF ( cx_grid(pvar_cx) .LE. unspecified_int4 ) GOTO 500	! 8/99
+
+* if the grid is ABSTRACT change it to X/Y/Z/TABSTRACT so other axes than
+* pvdim are not effected (2/22/99)
+	IF ( cx_grid(pvar_cx) .EQ. the_real_ABSTRACT )
+     .		 cx_grid(pvar_cx) = mgrid_xabstract + pvdim - 1
+
+* does the grid have a suitable axis for the pseudo-variable ?
+	pvax = CGRID_AXIS( pvdim, pvar_cx )
+	IF ( pvax.EQ.mnormal ) THEN
+	   cx_grid(pvar_cx) = mgrid_xabstract + pvdim - 1  ! 2/22/99
+	ELSEIF (pvax.EQ. munknown ) THEN
+	   GOTO 5100
+	ENDIF
+
+* insert bad data flag for variable
+	CALL GET_CONTEXT_BAD_FLAG( pvar_cx )
+
+* flesh out context removing all axes except those explicitly given
+	DO 100 idim = 1, nferdims
+	   IF ( idim .NE. pvdim ) THEN
+	      CALL DEL_CX_DIM( idim, pvar_cx )
+	   ELSE
+	      CALL CONFINE_AXIS  ( idim, pvar_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL FLESH_OUT_AXIS( idim, pvar_cx, status ) 	! ignore status
+	   ENDIF
+ 100	CONTINUE
+
+* relinquish the stack space used for the modifications
+ 500	CALL STACK_PTR_DN ( cx_stack_ptr, cx_stack_ptr_base, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	IF (cx_has_impl_grid(pvar_cx)) CALL TM_DEALLO_DYN_GRID(impl_grid)
+	CALL ERRMSG( ferr_inconsist_grid, status, full_pvar_name, *5000 )
+* 1/03 *kob* g77 port requires risc buff for arbitrary string concats
+ 5200	risc_buff = full_pvar_name
+	CALL ERRMSG( ferr_invalid_command, status, 
+     .	'non-positive delta value: '//risc_buff, *5000 )
+	END
diff --git a/fer/ctx/reconcile_com_dst_cx.F b/fer/ctx/reconcile_com_dst_cx.F
new file mode 100644
index 0000000..87c7711
--- /dev/null
+++ b/fer/ctx/reconcile_com_dst_cx.F
@@ -0,0 +1,79 @@
+	SUBROUTINE RECONCILE_COM_DST_CX( com_cx, dst_cx, protected_ax )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* The component context is fully fleshed out (necessarily, since
+* the component has already been obtained) whereas the destination (result)
+* context may still have some unknown axis limits.  So pass the component
+* information over to the destination on all except the critical axis
+* on which the transformation/regrid, etc is about to be performed
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95 - code lifted from IS_REGRID **including warnings about untested
+*			alternatives**
+* V530: *sh* 3/01 - bug fix: preserve cx_has_impl_grid
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	com_cx, dst_cx, protected_ax
+
+* local variable declarations
+	LOGICAL has_impl
+
+* Make the destination context like the source data context on all except
+* the regrid axis.  That one keeps the user-requested size.
+* (Other axes may have been modified by information embedded within a
+* user-variable definition.  An alternative (untested 8/89) approach is to
+* call PASS_AMBIG_LI** for uvars)
+
+* save the implicit grid status of the destination
+	has_impl = cx_has_impl_grid(dst_cx)
+
+	CALL TRANSFER_CONTEXT( com_cx, cx_buff )
+
+	CALL TRANSFER_AXIS( protected_ax, dst_cx, cx_buff )
+
+	CALL TRANSFER_CONTEXT( cx_buff, dst_cx )
+
+* restore the implicit grid status of the destination
+	cx_has_impl_grid(dst_cx) = has_impl
+
+	RETURN
+	END	
diff --git a/fer/ctx/region_class.F b/fer/ctx/region_class.F
new file mode 100644
index 0000000..0a4aab8
--- /dev/null
+++ b/fer/ctx/region_class.F
@@ -0,0 +1,84 @@
+	INTEGER FUNCTION REGION_CLASS( idim, cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the region-limits class of a component in an expression
+* the region-limits class encodes how limits must be specified in order to
+* match with memory-resident data.  (It is uvar_given without the 
+* "need"/"given" information.)
+
+* note: the classes that exist as of FERRET 2.00 are complete
+*	class 3 ("xact") assumes that any time both upper and lower limits must 
+*	match then this must be a compressing transformation.  There should
+*	really be a class "xact" to insist on exact match, uncompressed and a
+*	class "pt" that compresses as well.  This would require updating the
+*	tables in NEST_REGION_CLASS and MERGE_GRID.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/18/89
+* V230:  1/27/92 - changed uvlim_*_hi (unused) to uvlim_*_lohi to describe
+*                  @WEQ - exaxt limits required but a range of data
+*                - also added @RSUM (like @IIN)
+* V533: *sh* 6/01 - added trans_event_mask
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	idim, cx
+
+	IF ( cx_trans( idim, cx ) .GT. trans_compress_code ) THEN
+	   REGION_CLASS = 3    ! uvlim_*_xact
+	ELSEIF ( cx_trans( idim,cx ) .EQ. trans_integ_indef
+     .      .OR. cx_trans( idim,cx ) .EQ. trans_run_sum
+     .      .OR. cx_trans( idim,cx ) .EQ. trans_event_mask ) THEN
+	   REGION_CLASS = 1    ! uvlim_*_lo
+	ELSEIF ( cx_trans( idim,cx ) .EQ. trans_wgted_eq ) THEN
+           REGION_CLASS = 2    ! uvlim_*_lohi
+	ELSEIF ( cx_given( idim, cx )
+     .	   .AND. cx_lo_ss(cx,idim) .EQ. cx_hi_ss(cx,idim) ) THEN
+* ... e.g. U[K=3] ... defines a fixed point
+	   REGION_CLASS = 3
+	ELSE
+	   REGION_CLASS = 0  
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/ctx/restrict_file_limits.F b/fer/ctx/restrict_file_limits.F
new file mode 100644
index 0000000..95c8ebc
--- /dev/null
+++ b/fer/ctx/restrict_file_limits.F
@@ -0,0 +1,114 @@
+	SUBROUTINE RESTRICT_FILE_LIMITS ( cx, modified, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* restrict the context limits of a file variable to the range that is
+* indicated by ds_grid_start/end in COMMON
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500: 3/99 - *sh*
+*       5/99 *sh* - when strides are used on a netCDF variable, we may be
+*		looking at an implicit grid. In this case VAR_SS_LIMS returns
+*		unspecified_int4.
+*		NOTE: possible bug introduced with strides since the region
+*			checks here are bypassed altogether
+* V530: 11/00 *sh* - return "modified" flag
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	LOGICAL	modified
+	INTEGER	cx, status
+
+* internal variable declarations:
+	INTEGER 	TM_LENSTR1, 
+     .			idim, variable, category,
+     .			slen, slen2, hilim, lolim
+	CHARACTER*128	VAR_CODE, variable_code
+	CHARACTER	LEFINT*5, CX_DIM_STR*48, buff1*48, buff2*5
+
+* local parameter declarations
+	LOGICAL     full_precision
+	PARAMETER ( full_precision = .TRUE. )
+
+* --- end of introductory code ---
+
+* initialize
+	modified = .FALSE.
+	category = cx_category( cx )
+	variable = cx_variable( cx )
+
+	DO 10 idim = 1, nferdims
+	   IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) GOTO 10
+	   CALL VAR_SS_LIMS( idim, cx, lolim, hilim )
+	   IF ( lolim .EQ. unspecified_int4 ) GOTO 10
+	   IF ( cx_lo_ss(cx,idim) .GT. hilim .OR.
+     .          cx_hi_ss(cx,idim) .LT. lolim )
+     .		GOTO 5100
+	   IF ( (cx_lo_ss(cx,idim) .LT. lolim)
+     .     .OR. (cx_hi_ss(cx,idim) .GT. hilim) ) THEN
+	      IF (cx_lo_ss(cx,idim).LT.lolim) cx_lo_ss(cx,idim) = lolim
+	      IF (cx_hi_ss(cx,idim).GT.hilim) cx_hi_ss(cx,idim) = hilim
+	      cx_by_ss(idim, cx) = .TRUE.
+	      CALL FLESH_OUT_AXIS( idim, cx, status )
+	      IF ( status.NE.ferr_ok ) GOTO 5900
+	      modified = .TRUE.
+	   ENDIF
+ 10	CONTINUE
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5100	buff1 = CX_DIM_STR(idim, cx, ':',full_precision,slen)
+	WRITE(buff2,'(I5)') lolim
+	variable_code = VAR_CODE( category, variable )
+	CALL ERRMSG( ferr_limits, status,
+     .		variable_code(:TM_LENSTR1(variable_code))//
+     .		' does not contain '//buff1(:slen)//
+     .          pCR//'Data are available in '//ss_dim_name(idim)//
+     .		' ='//buff2//':'//LEFINT(hilim, slen2)
+     .		,*5900 )   ! 3/99
+ 5900	RETURN
+	END	
diff --git a/fer/ctx/set_doc_flag.F b/fer/ctx/set_doc_flag.F
new file mode 100644
index 0000000..c87a5f8
--- /dev/null
+++ b/fer/ctx/set_doc_flag.F
@@ -0,0 +1,76 @@
+	SUBROUTINE SET_DOC_FLAG( select, flags, init )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* maintain the document flag structure
+* if "init" then preset all flags to false
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+* V314: 8/24/94 *kob* IBM port - variable flag should be declared as logical and
+*				 not integer...caught by AIX xlf compiler
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+	include	'ferret.parm'
+
+* calling argument declarations
+* move flags variable from integer to logical declaration *kob* 8/94
+	LOGICAL	init, flags(0:12)
+	INTEGER select
+
+* internal variable declarations
+	INTEGER	i
+
+* initialize flags ?
+	IF ( init ) THEN
+	   DO 100 i = 0, 10
+ 100	   flags(i) = .FALSE.
+	ENDIF
+
+	IF ( select .EQ. 0 ) RETURN
+
+* set individual flag
+	flags( select ) = .TRUE.
+
+* set flag(0) to indicate that any other flag has been set
+	flags(0)    = .TRUE.
+
+	RETURN
+	END
diff --git a/fer/ctx/transfer_context.F b/fer/ctx/transfer_context.F
new file mode 100644
index 0000000..de3f009
--- /dev/null
+++ b/fer/ctx/transfer_context.F
@@ -0,0 +1,103 @@
+	SUBROUTINE TRANSFER_CONTEXT ( source, dest )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer space/time/data_set/variable context from one context buffer to
+* another
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/27/86
+* revision 0.1 - 8/18/87 - added cx_trans_arg
+* revision 1.0 - 9/23/87 - special logic for pre-defined contexts (dest<1)
+* revision 1.1 - 3/4/88  - corrected .LT. --> .LE. on cx value
+* revision 1.2 - 1/4/89  - added regridding transforms
+* V200:  5/31/89 - 4D symmetrical (using TRANSFER_AXIS)
+*		 - added cx_ovsiz, eliminated %%_relative
+* V420: 9/95	- Support for implicit grids (cx_has_impl_grid)
+* V530:  8/00 *sh* - transfer data type, too
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 3/13 *sh* support for aux var regridding: var[gz(depth)=zax]
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+	INTEGER	source, dest, idim, i
+
+* all contexts contain axis region information
+	DO 100 idim = 1, nferdims
+ 100	CALL TRANSFER_AXIS( idim, source, dest )
+
+* that's all that pre-defined contexts have
+	IF ( source .LE. 0 .OR. dest .LE. 0 ) RETURN
+
+	DO 200 idim = 1, nferdims
+	   cx_delta   ( idim, dest ) = cx_delta   ( idim, source )
+	   cx_regrid_trans(idim,dest)=cx_regrid_trans(idim,source)
+ 200	CONTINUE	
+
+	cx_data_set( dest ) = cx_data_set( source )
+	cx_dset_gvn( dest ) = cx_dset_gvn( source )
+	cx_category( dest ) = cx_category( source )
+	cx_variable( dest ) = cx_variable( source )
+	cx_grid    ( dest ) = cx_grid    ( source )
+	cx_type    ( dest ) = cx_type    ( source )
+	cx_ovsiz   ( dest ) = cx_ovsiz   ( source )
+	cx_bad_data( dest ) = cx_bad_data( source )
+
+	cx_unstand_grid ( dest ) = cx_unstand_grid ( source )
+	cx_impl_grid    ( dest ) = cx_impl_grid    ( source )
+
+* do not inherit cx_has_impl_grid.  It is a flag to say which cx
+* actually  **allocated** the grid
+*	cx_has_impl_grid( dest ) = .FALSE.
+
+* transfer aux var info
+	cx_naux( dest ) = cx_naux( source )
+	DO 300 i = 1, nferdims
+	   cx_aux_arg_start(i, dest) = cx_aux_arg_start(i, source)
+	   cx_aux_arg_end  (i, dest) = cx_aux_arg_end  (i, source)
+	   cx_aux_stat     (i, dest) = cx_aux_stat     (i, source)
+ 300	CONTINUE
+
+
+	RETURN
+	END
diff --git a/fer/dat/LIB_NAME b/fer/dat/LIB_NAME
new file mode 100644
index 0000000..2449a78
--- /dev/null
+++ b/fer/dat/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libdat.a 
diff --git a/fer/dat/Makefile b/fer/dat/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/dat/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/dat/SOURCE_FILES b/fer/dat/SOURCE_FILES
new file mode 100644
index 0000000..12475da
--- /dev/null
+++ b/fer/dat/SOURCE_FILES
@@ -0,0 +1,25 @@
+SRCS_F = \
+netcdf4_settings_data.F\
+xalgebra_data.F\
+xcalc_vars_data.F\
+xcommand_data.F\
+xcontext_data.F\
+xcontrol_data.F\
+xdependency_tree_data.F\
+xdset_parms_data.F\
+xfgrdel_data.F\
+xfr_grid_data.F\
+xgfdl_error_text_data.F\
+xgfdl_masks_data.F\
+xgks_devices_data.F\
+xgrid_chg_fcns_data.F\
+xgui_data.F\
+xonedim_data.F\
+xplot_setup_data.F\
+xplot_state_data.F\
+xprog_state_data.F\
+xpyvar_info_data.F\
+xrevision_data.F\
+xtext_info_data.F\
+xvariables_data.F\
+xwindow_state_data.F 
diff --git a/fer/dat/netcdf4_settings_data.F b/fer/dat/netcdf4_settings_data.F
new file mode 100644
index 0000000..3d65c3d
--- /dev/null
+++ b/fer/dat/netcdf4_settings_data.F
@@ -0,0 +1,72 @@
+	BLOCK DATA NETCDF4_LIST_SETTINGS_DATA
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize the settings for netcdf4 datasets and store them in common.
+
+        IMPLICIT NONE
+        include 'netcdf4_settings.cmn'
+
+*
+*	netcdf4_type	- netcdf format: 4=netcdf4, 3=netcdf3(=classic), 6=64-bit
+*	xchunk_size     - chunk size in X direction
+*	ychunk_size     - chunk size in Y direction
+*	zchunk_size     - chunk size in Z direction
+*	tchunk_size     - chunk size in T direction
+*	deflate_lev	- deflate level (0 for no deflate)
+*	shuffle_flag    - shuffle - 0 or 1
+*	endian_code     - native=0, little=1, big=0 match nf_endian_* params
+*	cache_size_mb   - cache_chunk size in mbytes
+
+	DATA netcdf4_type /3/
+	DATA xchunk_size  /0/
+	DATA ychunk_size  /0/
+	DATA zchunk_size  /0/
+	DATA tchunk_size  /0/
+	DATA deflate_lev  /0/
+	DATA shuffle_flag /0/
+	DATA endian_code  /0/
+	DATA netcdf4_type_set /3/
+	DATA xchunk_size_set  /0/
+	DATA ychunk_size_set  /0/
+	DATA zchunk_size_set  /0/
+	DATA tchunk_size_set  /0/
+	DATA deflate_lev_set  /0/
+	DATA shuffle_flag_set /0/
+	DATA endian_code_set  /0/
+	DATA default_cache_size  /0/
+
+* cache_size_mb is obtained on initialization by a call to the netcdf library.
+
+	END
diff --git a/fer/dat/xalgebra_data.F b/fer/dat/xalgebra_data.F
new file mode 100644
index 0000000..2938c05
--- /dev/null
+++ b/fer/dat/xalgebra_data.F
@@ -0,0 +1,801 @@
+	BLOCK DATA XALGEBRA_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* data initialization of algebraic operators and functions used by program GFDL
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/9/86
+* revision 1.0 - 12/9/86 - *sh*
+*		added functions and pseudo-variables
+* revision 1.1 - 6/22/87 - added SHF and AAV
+* revision 2.0 - 9/22/87 - eliminated geog* --> into XCONTEXT
+* revision 2.1 - 6/23/88 - added FAV - filling missing data with average
+* revision 2.2 - 1/3/89  - added regridding transformations
+* V200:  6/6/89-8/3/89 - added XY integrating, binomial smoothing, IGNORE0, EXP
+*	11/22/89 - reworked expression syntax for in-fix notation
+*	 1/12/90 - added info about the arguments of transformations
+*	 3/19/90 - added ATAN,ATAN2,ASIN,ACOS
+*	 3/29/90 - added RANDU,RANDN
+* for Unix/RISC port 9/91 - added @SHN, at SPZ, at SWL
+*                         - "integ'd" --> "integ" to avoid "'" in PPLUS
+* V230: 1/3/92 - added @SUM, @WEQ, @RSUM, @VAR, @NBD, @NGD
+*              - fleshed out trans_title for use with SHOW TRANSFORMATIONS
+*      3/23/92 - added @FLN and @FNR
+*       7/2/92 - changed @FLN and @FNR defaults to 1 (edge) from 3 (window)
+*       8/5/92 - added new functions RHO and THETA
+*      8/22/92 - added @ASN regridding
+*     10/22/92 - RHO --> RHO_UN, THETA --> THETA_UN
+* V300: 9/2/93 - reordered transforms for SHOW TRANS and QUERY TRANS
+* V320:  11/94 - added DAYS1900 function
+* V420:  10/95 - added regridding transforms: min,max,var,ngd,nbd,npt,sum 
+*	 11/95 - added modulo regridding: "@MOD"
+* V430:   7/96 - incorporate 4D transformations: AVE, VAR, DIN, NDG, NBD
+* V450:   7/97 - added function descriptions
+* V455    9/97 - added transforms @CDA,CDB,CIA,CIB
+* V490   10/97 - added regrid transform @XACT (removed unimplemented g=@NRS)
+*	       - changed title for g=@ASN from "1 to 1" to "index assn"
+* V491    4/98 - *kob* modified documentation order for function days1900
+*                      to correct year-month-day
+* V500   10/98 - *jc* added @RDC
+*         1/00 - *acm* Change alg_fcn_descr to "since 1900" (was 1990)
+*         1/00 - *acm* Corrected the order of argument listing for THETA_FO to 
+*                      match how the function is actually called.
+* V530   1/01 - *sh* - added XBOXLO, XBOXHI and family ...
+*	 3/01 - *sh* - adde g=ax at nrst
+* V533   6/01 - *sh* - added transformation @EVNT
+* 2/03 *kob* - g77 port - g77 will not allow intrinsic functions in PARAMETER
+*                         statements.  use character constant instead
+* V554 1/04  *acm* - additions for /RANGE repeat loop control; alg_cvar, countervar_name
+* V603 5/07  *acm* - added MODNBD modulo regridding statistic
+* V66+ 4/10  *acm* - change pressure to reference pressure for RHO_UN as 
+*                    suggested by James Orr and Billy Kessler
+* V6.7 1/11  *acm* - fix ticket 1788, initializing alg_trans_*
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*      2/12  *kms* Add M, N, E, F, EBOX, FBOX, EBOXLO, FBOXLO, EBOXHI, and FBOXHI
+*                  pseudo-variables
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+* V690 12/13 *sh* added auxiliary regridding transforms
+
+        IMPLICIT NONE
+	include	'ferret.parm'
+	include	'xalgebra.cmn'
+
+	CHARACTER*1	rubout
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( rubout = o'177' )
+#else
+	PARAMETER     ( rubout = CHAR(127) )
+#endif
+	INTEGER	i
+
+* single character operators:
+	DATA alg_op(  1 ) / '+' /,
+     .	     alg_op(  2 ) / '-' /,
+     .	     alg_op(  3 ) / '*' /,
+     .	     alg_op(  4 ) / '/' /,
+     .	     alg_op(  5 ) / '^' /,
+     .	     alg_op(  6 ) / 'AND' /,
+     .	     alg_op(  7 ) / 'OR' /,
+     .	     alg_op(  8 ) / 'GT' /,
+     .	     alg_op(  9 ) / 'GE' /,
+     .	     alg_op( 10 ) / 'LT' /,
+     .	     alg_op( 11 ) / 'LE' /,
+     .	     alg_op( 12 ) / 'EQ' /,
+     .	     alg_op( 13 ) / 'NE' /,
+     .	     alg_op( 14 ) / '%' /,	! undefined
+     .	     alg_op( 15 ) / '%' /,	! undefined
+     .	     alg_op( 16 ) / '%' /,	! undefined
+     .	     alg_op( 17 ) / '%' /,	! undefined
+     .	     alg_op( 18 ) / '%' /	! undefined
+
+* functions:
+	DATA alg_fcn		(  1 ) / 'EXP'      /,
+     .	     alg_num_fcn_args	(  1 ) / 1 	    /,
+     .	     alg_fcn_descr	(  1 ) / 'exponential e(X)' 	    /,
+     .	     alg_fcn_arg_ptr    (  1 ) / 1	    /,
+     .	     alg_arg_name     (  1 ) / 'X'	    /,
+     .	     alg_arg_units    (  1 ) / ' '	    /,
+     .	     alg_arg_descr    (  1 ) / ' '	    /,
+     .	     alg_fcn		(  2 ) / 'LOG'      /,
+     .	     alg_num_fcn_args	(  2 ) / 1 	    /
+     .	     alg_fcn_descr	(  2 ) / 'base 10 log(X)' 	    /,
+     .	     alg_fcn_arg_ptr    (  2 ) / 2	    /,
+     .	     alg_arg_name     (  2 ) / 'X'	    /,
+     .	     alg_arg_units    (  2 ) / ' '	    /,
+     .	     alg_arg_descr    (  2 ) / ' '	    /,
+     .	     alg_fcn		(  3 ) / 'MAX'      /,
+     .	     alg_num_fcn_args	(  3 ) / 2	    /,
+     .	     alg_fcn_descr	(  3 ) /
+     .			'point-by-point greater of A and B' 	    /,
+     .	     alg_fcn_arg_ptr    (  3 ) / 3	    /,
+     .	     alg_arg_name     (  3 ) / 'A'	    /,
+     .	     alg_arg_units    (  3 ) / ' '	    /,
+     .	     alg_arg_descr    (  3 ) / ' '	    /,
+     .	     alg_arg_name     (  4 ) / 'B'	    /,
+     .	     alg_arg_units    (  4 ) / ' '	    /,
+     .	     alg_arg_descr    (  4 ) / ' '	    /,
+     .       alg_fcn		(  4 ) / 'MIN'      /,
+     .	     alg_num_fcn_args 	(  4 ) / 2	    /,
+     .	     alg_fcn_descr	(  4 ) /
+     .			'point-by-point lesser of A and B' 	    /,
+     .	     alg_fcn_arg_ptr    (  4 ) / 5	    /,
+     .	     alg_arg_name     (  5 ) / 'A'	    /,
+     .	     alg_arg_units    (  5 ) / ' '	    /,
+     .	     alg_arg_descr    (  5 ) / ' '	    /,
+     .	     alg_arg_name     (  6 ) / 'B'	    /,
+     .	     alg_arg_units    (  6 ) / ' '	    /,
+     .	     alg_arg_descr    (  6 ) / ' '	    /,
+     .       alg_fcn		(  5 ) / 'INT'      /,
+     .	     alg_num_fcn_args	(  5 ) / 1	    /,
+     .	     alg_fcn_descr	(  5 ) / 'truncate to integer' 	    /,
+     .	     alg_fcn_arg_ptr    (  5 ) / 7	    /,
+     .	     alg_arg_name     (  7 ) / 'X'	    /,
+     .	     alg_arg_units    (  7 ) / ' '	    /,
+     .	     alg_arg_descr    (  7 ) / ' '	    /,
+     .       alg_fcn		(  6 ) / 'ABS'      /,
+     .	     alg_num_fcn_args	(  6 ) / 1	    /,
+     .	     alg_fcn_descr	(  6 ) / 'absolute value' 	    /,
+     .	     alg_fcn_arg_ptr    (  6 ) / 8	    /,
+     .	     alg_arg_name     (  8 ) / 'X'	    /,
+     .	     alg_arg_units    (  8 ) / ' '	    /,
+     .	     alg_arg_descr    (  8 ) / ' '	    /,
+     .       alg_fcn		(  7 ) / 'SIN'      /,
+     .	     alg_num_fcn_args	(  7 ) / 1 	    /,
+     .	     alg_fcn_descr	(  7 ) / ' ' 	    /,
+     .	     alg_fcn_arg_ptr    (  7 ) / 9	    /,
+     .	     alg_arg_name     (  9 ) / 'theta'	    /,
+     .	     alg_arg_units    (  9 ) / 'radians'	    /,
+     .	     alg_arg_descr    (  9 ) / 'angle'	    /,
+     .       alg_fcn		(  8 ) / 'COS'      /,
+     .	     alg_num_fcn_args	(  8 ) / 1 	    /,
+     .	     alg_fcn_descr	(  8 ) / ' ' 	    /,
+     .	     alg_fcn_arg_ptr    (  8 ) / 10	    /,
+     .	     alg_arg_name     ( 10 ) / 'theta'	    /,
+     .	     alg_arg_units    ( 10 ) / 'radians'	    /,
+     .	     alg_arg_descr    ( 10 ) / 'angle'	    /,
+     .       alg_fcn		(  9 ) / 'TAN'      /,
+     .	     alg_num_fcn_args	(  9 ) / 1 	    /,
+     .	     alg_fcn_descr	(  9 ) / ' ' 	    /,
+     .	     alg_fcn_arg_ptr    (  9 ) / 11	    /,
+     .	     alg_arg_name     ( 11 ) / 'theta'	    /,
+     .	     alg_arg_units    ( 11 ) / 'radians'	    /,
+     .	     alg_arg_descr    ( 11 ) / 'angle'	    /,
+     .       alg_fcn		( 10 ) / 'LN'       /,
+     .	     alg_num_fcn_args	( 10 ) / 1 	    /,
+     .	     alg_fcn_descr	( 10 ) / 'natural logarithm(X)'     /,
+     .	     alg_fcn_arg_ptr    ( 10 ) / 12	    /,
+     .	     alg_arg_name     ( 12 ) / 'X'	    /,
+     .	     alg_arg_units    ( 12 ) / ' '	    /,
+     .	     alg_arg_descr    ( 12 ) / ' '	    /
+	DATA
+     .       alg_fcn		( 11 ) / 'MOD'      /,
+     .	     alg_num_fcn_args	( 11 ) / 2 	    /,
+     .	     alg_fcn_descr	( 11 ) / 'modulo A using base B'  /,
+     .	     alg_fcn_arg_ptr    ( 11 ) / 13	    /,
+     .	     alg_arg_name     ( 13 ) / 'A'	    /,
+     .	     alg_arg_units    ( 13 ) / ' '	    /,
+     .	     alg_arg_descr    ( 13 ) / ' '	    /,
+     .	     alg_arg_name     ( 14 ) / 'B'	    /,
+     .	     alg_arg_units    ( 14 ) / ' '	    /,
+     .	     alg_arg_descr    ( 14 ) / ' '	    /,
+     .       alg_fcn		( 12 ) / 'MISSING'  /,
+     .	     alg_num_fcn_args	( 12 ) / 2 	    /,
+     .	     alg_fcn_descr	( 12 ) /
+     .				'substitute B where A is missing' /,
+     .	     alg_fcn_arg_ptr    ( 12 ) / 15	    /,
+     .	     alg_arg_name     ( 15 ) / 'A'	    /,
+     .	     alg_arg_units    ( 15 ) / ' '	    /,
+     .	     alg_arg_descr    ( 15 ) / ' '	    /,
+     .	     alg_arg_name     ( 16 ) / 'B'	    /,
+     .	     alg_arg_units    ( 16 ) / ' '	    /,
+     .	     alg_arg_descr    ( 16 ) / ' '	    /,
+     .       alg_fcn		( 13 ) / 'IGNORE0'  /,
+     .	     alg_num_fcn_args	( 13 ) / 1 	    /,
+     .	     alg_fcn_descr	( 13 )
+     .				/ 'substitute missing value for zeros' /,
+     .	     alg_fcn_arg_ptr    ( 13 ) / 17	    /,
+     .	     alg_arg_name     ( 17 ) / 'X'	    /,
+     .	     alg_arg_units    ( 17 ) / ' '	    /,
+     .	     alg_arg_descr    ( 17 ) / ' '	    /,
+     .       alg_fcn		( 14 ) / 'ATAN'	    /,
+     .	     alg_num_fcn_args	( 14 ) / 1 	    /,
+     .	     alg_fcn_descr	( 14 ) / 'arctan(X) in radians'    /,
+     .	     alg_fcn_arg_ptr    ( 14 ) / 18	    /,
+     .	     alg_arg_name     ( 18 ) / 'X'	    /,
+     .	     alg_arg_units    ( 18 ) / ' '	    /,
+     .	     alg_arg_descr    ( 18 ) / ' '	    /,
+     .       alg_fcn		( 15 ) / 'ATAN2'    /,
+     .	     alg_num_fcn_args	( 15 ) / 2 	    /,
+     .	     alg_fcn_descr	( 15 ) /
+     .			'arctan(A/B) in radians,  -pi<result<=pi'   /,
+     .	     alg_fcn_arg_ptr    ( 15 ) / 19	    /,
+     .	     alg_arg_name     ( 19 ) / 'A'	    /,
+     .	     alg_arg_units    ( 19 ) / ' '	    /,
+     .	     alg_arg_descr    ( 19 ) /
+     .		'if A>0 result>0, if A=0 B determines result'	    /,
+     .	     alg_arg_name     ( 20 ) / 'B'	    /,
+     .	     alg_arg_units    ( 20 ) / ' '	    /,
+     .	     alg_arg_descr    ( 20 ) /
+     .	'if A=0&B>0 res=0, if A=0&B<0 res=pi, if B=0 ABS(res)=pi/2' /,
+     .       alg_fcn		( 16 ) / 'ASIN'     /,
+     .	     alg_num_fcn_args	( 16 ) / 1 	    /,
+     .	     alg_fcn_descr	( 16 ) / 'arcsin(X) in radians'     /,
+     .	     alg_fcn_arg_ptr    ( 16 ) / 21	    /,
+     .	     alg_arg_name     ( 21 ) / 'X'	    /,
+     .	     alg_arg_units    ( 21 ) / ' '	    /,
+     .	     alg_arg_descr    ( 21 ) /
+     .			'ABS(X) must be less than or equal to 1'    /,
+     .       alg_fcn		( 17 ) / 'ACOS'     /,
+     .	     alg_num_fcn_args	( 17 ) / 1 	    /
+     .	     alg_fcn_descr	( 17 ) / 'arccos(X) in radians'     /,
+     .	     alg_fcn_arg_ptr    ( 17 ) / 22	    /,
+     .	     alg_arg_name     ( 22 ) / 'X'	    /,
+     .	     alg_arg_units    ( 22 ) / ' '	    /,
+     .	     alg_arg_descr    ( 22 ) /
+     .			'ABS(X) must be less than or equal to 1'    /,
+     .       alg_fcn		( 18 ) / 'RANDU'    /,
+     .	     alg_num_fcn_args	( 18 ) / 1 	    /
+     .	     alg_fcn_descr	( 18 )
+     .		/ 'random uniform [0,1] seeded from 1st value of A' /,
+     .	     alg_fcn_arg_ptr    ( 18 ) / 23	    /,
+     .	     alg_arg_name     ( 23 ) / 'A'	    /,
+     .	     alg_arg_units    ( 23 ) / ' '	    /,
+     .	     alg_arg_descr    ( 23 ) /
+     .			'field of random values will have shape of A'/,
+     .       alg_fcn		( 19 ) / 'RANDN'    /,
+     .	     alg_num_fcn_args	( 19 ) / 1 	    /,
+     .	     alg_fcn_descr	( 19 )
+     .			/ 'random normal seeded from 1st value of A' /,
+     .	     alg_fcn_arg_ptr    ( 19 ) / 24	    /,
+     .	     alg_arg_name     ( 24 ) / 'A'	    /,
+     .	     alg_arg_units    ( 24 ) / ' '	    /,
+     .	     alg_arg_descr    ( 24 ) /
+     .			'field of random values will have shape of A'/
+	DATA
+     .       alg_fcn		( 20 ) / 'RHO_UN'   /,
+     .	     alg_num_fcn_args	( 20 ) / 3 	    /,
+     .	     alg_fcn_descr	( 20 ) /
+     .		'UNESCO state equation (density) for ocean H2O (kg/m^3)'/,
+     .	     alg_fcn_arg_ptr    ( 20 ) / 25	    /,
+     .	     alg_arg_name     ( 25 ) / 'salt'	    /,
+     .	     alg_arg_units    ( 25 ) / 'psu'	    /,
+     .	     alg_arg_descr    ( 25 ) / 'salinity'   /,
+     .	     alg_arg_name     ( 26 ) / 'temp'	    /,
+     .	     alg_arg_units    ( 26 ) / 'deg. C'	    /,
+     .	     alg_arg_descr    ( 26 ) / 'temperature'/,
+     .	     alg_arg_name     ( 27 ) / 'p'	    /,
+     .	     alg_arg_units    ( 27 ) / 'decibars'   /,
+     .	     alg_arg_descr    ( 27 ) / 'reference pressure'   /,
+     .       alg_fcn		( 21 ) / 'THETA_FO' /,
+     .	     alg_num_fcn_args	( 21 ) / 4 	    /
+     .	     alg_fcn_descr	( 21 ) /
+     .			'Fofonoff (1977) potential temperature'/,
+     .	     alg_fcn_arg_ptr    ( 21 ) / 28	    /,
+     .	     alg_arg_name     ( 28 ) / 'salt'	    /,
+     .	     alg_arg_units    ( 28 ) / 'psu'	    /,
+     .	     alg_arg_descr    ( 28 ) / 'salinity'   /,
+     .	     alg_arg_name     ( 29 ) / 'temp'	    /,
+     .	     alg_arg_units    ( 29 ) / 'deg. C'	    /,
+     .	     alg_arg_descr    ( 29 ) / 'temperature'/,
+     .	     alg_arg_name     ( 30 ) / 'p'	    /,
+     .	     alg_arg_units    ( 30 ) / 'decibars'   /,
+     .	     alg_arg_descr    ( 30 ) / 'pressure'   /,
+     .	     alg_arg_name     ( 31 ) / 'ref'	    /,
+     .	     alg_arg_units    ( 31 ) / 'decibars'   /,
+     .	     alg_arg_descr    ( 31 ) / 'reference pressure' /,
+     .       alg_fcn		( 22 ) / 'DAYS1900'  /,
+     .	     alg_num_fcn_args	( 22 ) / 3 	    /
+     .	     alg_fcn_descr	( 22 ) 
+     .	     / 'days elapsed since 1-Jan-1900 (standard calendar)'/,
+     .	     alg_fcn_arg_ptr    ( 22 ) / 32	    /,
+     .	     alg_arg_name     ( 32 ) / 'year'	    /,
+     .	     alg_arg_units    ( 32 ) / ' '	    /,
+     .	     alg_arg_descr    ( 32 ) / ' '	    /,
+     .	     alg_arg_name     ( 33 ) / 'month'	    /,
+     .	     alg_arg_units    ( 33 ) / ' '	    /,
+     .	     alg_arg_descr    ( 33 ) / ' '	    /,
+     .	     alg_arg_name     ( 34 ) / 'day'	    /,
+     .	     alg_arg_units    ( 34 ) / ' '	    /,
+     .	     alg_arg_descr    ( 34 ) / ' '	    /,
+     .       alg_fcn		( 23 ) / 'RANDU2'    /,
+     .	     alg_num_fcn_args	( 23 ) / 2 	    /
+     .	     alg_fcn_descr	( 23 )
+     .		/ 'random uniform [0,1), Alternate algorithm' /,
+     .	     alg_fcn_arg_ptr    ( 23 ) / 35	    /,
+     .	     alg_arg_name     ( 35 ) / 'A'	    /,
+     .	     alg_arg_units    ( 35 ) / ' '	    /,
+     .	     alg_arg_descr    ( 35 ) /
+     .			'field of random values will have shape of A'/,
+     .	     alg_arg_name     ( 36 ) / 'ISEED'	    /,
+     .	     alg_arg_units    ( 36 ) / ' '	    /,
+     .	     alg_arg_descr    ( 36 ) / 
+     .         '-1=sys clock, 0=continue w/ previous seed, N>0 user-defined seed'/,
+     .       alg_fcn		( 24 ) / 'RANDN2'    /,
+     .	     alg_num_fcn_args	( 24 ) / 2 	    /,
+     .	     alg_fcn_descr	( 24 )
+     .			/ 'random normal, Alternate algorithm' /,
+     .	     alg_fcn_arg_ptr    ( 24 ) / 37	    /,
+     .	     alg_arg_name     ( 37 ) / 'A'	    /,
+     .	     alg_arg_units    ( 37 ) / ' '	    /,
+     .	     alg_arg_descr    ( 37 ) /
+     .			'field of random values will have shape of A'/,
+     .	     alg_arg_name     ( 38 ) / 'ISEED'	    /,
+     .	     alg_arg_units    ( 38 ) / ' '	    /,
+     .	     alg_arg_descr    ( 38 ) /
+     .         '-1=sys clock, 0=continue w/ previous seed, N>0 user-defined seed'/
+	DATA (alg_fcn(i),i=23,num_functions)/ 3*unspecified_name4 /  
+
+* logical structures:
+	DATA alg_struct(  1 ) / 'IF' /,		! formerly "WHERE"
+     .	     alg_struct(  2 ) / 'THEN' /,
+     .	     alg_struct(  3 ) / 'ELSE' /
+
+* logical if-valid structures:
+	DATA alg_vstruct(  1 ) / 'IFV' /,	
+     .	     alg_vstruct(  2 ) / 'THEN' /,
+     .	     alg_vstruct(  3 ) / 'ELSE' /
+
+* punctuation:
+	DATA alg_punct(  1 ) / ',' /,
+     .	     alg_punct(  2 ) / '(' /,
+     .	     alg_punct(  3 ) / ')' /
+
+* pseudo_variables:
+* Keep the classic 4D variables together, then the
+* ones for 6D. Lets us set mode fourdee to use M,N etc as
+* user variables.
+
+        DATA alg_pvar_head     / 0 /
+        DATA alg_pvar_padding  / 0 /
+	DATA alg_pvar	(  1 ) / 'I       ' /,
+     .       alg_pvar	(  2 ) / 'J       ' /,
+     .       alg_pvar	(  3 ) / 'K       ' /,
+     .       alg_pvar	(  4 ) / 'L       ' /,
+     .       alg_pvar	(  5 ) / '_M      ' /,
+     .       alg_pvar	(  6 ) / '_N      ' /,
+     .       alg_pvar	(  7 ) / 'X       ' /,
+     .       alg_pvar	(  8 ) / 'Y       ' /,
+     .       alg_pvar	(  9 ) / 'Z       ' /,
+     .       alg_pvar	( 10 ) / 'T       ' /,
+     .       alg_pvar	( 11 ) / '_E      ' /,
+     .       alg_pvar	( 12 ) / '_F      ' /
+     .       alg_pvar	( 13 ) / 'XBOX    ' /,
+     .       alg_pvar	( 14 ) / 'YBOX    ' /,
+     .       alg_pvar	( 15 ) / 'ZBOX    ' /,
+     .       alg_pvar	( 16 ) / 'TBOX    ' /,
+     .       alg_pvar	( 17 ) / 'EBOX    ' /,
+     .       alg_pvar	( 18 ) / 'FBOX    ' /,
+     .       alg_pvar	( 19 ) / 'XBOXLO  ' /,
+     .       alg_pvar	( 20 ) / 'YBOXLO  ' /,
+     .       alg_pvar	( 21 ) / 'ZBOXLO  ' /,
+     .       alg_pvar	( 22 ) / 'TBOXLO  ' /,
+     .       alg_pvar	( 23 ) / 'EBOXLO  ' /,
+     .       alg_pvar	( 24 ) / 'FBOXLO  ' /,
+     .       alg_pvar	( 25 ) / 'XBOXHI  ' /,
+     .       alg_pvar	( 26 ) / 'YBOXHI  ' /,
+     .       alg_pvar	( 27 ) / 'ZBOXHI  ' /,
+     .       alg_pvar	( 28 ) / 'TBOXHI  ' /,
+     .       alg_pvar	( 29 ) / 'EBOXHI  ' /,
+     .       alg_pvar	( 30 ) / 'FBOXHI  ' /
+! allow _I,_J,_K,_L,_X,_Y,_Z,_T which will be translated to just I,J,...Z,T.
+	DATA alg_pvar	( 31 ) / '_I      ' /,
+     .       alg_pvar	( 32 ) / '_J      ' /,
+     .       alg_pvar	( 33 ) / '_K      ' /,
+     .       alg_pvar	( 34 ) / '_L      ' /,
+     .       alg_pvar	( 35 ) / '_M      ' /,
+     .       alg_pvar	( 36 ) / '_N      ' /,
+     .       alg_pvar	( 37 ) / '_X      ' /,
+     .       alg_pvar	( 38 ) / '_Y      ' /,
+     .       alg_pvar	( 39 ) / '_Z      ' /,
+     .       alg_pvar	( 40 ) / '_T      ' /
+        DATA alg_cvar        /60*unspecified_name4/
+        DATA countervar_name_head / 0 /
+        DATA countervar_name_padding / 0 /
+        DATA countervar_name /60*unspecified_name4/
+
+	DATA
+     .		alg_trans_text ( 1 )	/ 'AV4' 		/, 
+     .		alg_trans_title( 1 )	/ '4D ave'		/,
+     .		alg_trans_num  ( 1 )	/ trans_4d_ave		/,
+     .		alg_trans_its_int ( 1)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 1)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 1)	/ bad_val4		/,	
+     .		alg_trans_text ( 2 )	/ 'IN4' 		/, 
+     .		alg_trans_title( 2 )	/ '4D integ.'		/,
+     .		alg_trans_num  ( 2 )	/ trans_4d_int_def	/,
+     .		alg_trans_its_int ( 2 )	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 2 )	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 2 )	/ bad_val4		/,
+     .		alg_trans_text ( 3 )	/ 'ITP' 		/, 
+     .		alg_trans_title( 3 )	/ 'interpolated'	/,
+     .		alg_trans_num  ( 3 )	/ trans_interpolate	/,
+     .		alg_trans_its_int ( 3 )	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 3 )	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 3 )	/ bad_val4		/,
+     .		alg_trans_text ( 4  )	/ 'AVE' 		/, 
+     .          alg_trans_title( 4  )	/ 'averaged'      	/,
+     .		alg_trans_num  ( 4  )	/ trans_average		/,
+     .		alg_trans_its_int ( 4 )	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 4 )	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 4 )	/ bad_val4		/,
+     .		alg_trans_text ( 5 )	/ 'VAR'  		/, 
+     .		alg_trans_title( 5 )	/ 'variance'    	/,
+     .		alg_trans_num  ( 5 )	/ trans_variance  	/,
+     .		alg_trans_its_int ( 5)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 5)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 5)	/ bad_val4		/,
+     .		alg_trans_text ( 6 )	/ 'SUM'  		/, 
+     .		alg_trans_title( 6 )	/ 'summed'              /,
+     .          alg_trans_num  ( 6 )	/ trans_sum	        /,
+     .		alg_trans_its_int ( 6)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 6)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 6)	/ bad_val4		/,
+     .		alg_trans_text ( 7 )	/ 'RSU'  		/, 
+     .		alg_trans_title( 7 )	/ 'running sum'  	/,
+     .		alg_trans_num  ( 7 )	/ trans_run_sum  	/,
+     .		alg_trans_its_int ( 7)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 7)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 7)	/ bad_val4		/,
+     .		alg_trans_text ( 8 )	/ 'SHF' 		/, 
+     .		alg_trans_title( 8 )	/ 'shifted'		/,
+     .		alg_trans_num  ( 8 )	/ trans_shift		/,
+     .		alg_trans_its_int ( 8)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 8)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 8)	/ 1.			/,
+     .		alg_trans_text ( 9  )	/ 'MIN' 		/, 
+     .		alg_trans_title( 9  )	/ 'minimum'		/,
+     .		alg_trans_num  ( 9  )	/ trans_min		/,
+     .		alg_trans_its_int ( 9)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 9)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 9)	/ bad_val4		/,
+     .		alg_trans_text ( 10  )	/ 'MAX' 		/, 
+     .		alg_trans_title( 10  )	/ 'maximum'		/,
+     .		alg_trans_num  ( 10  )	/ trans_max		/,
+     .		alg_trans_its_int ( 10)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 10)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 10)	/ bad_val4		/
+	DATA
+     .		alg_trans_text ( 11 )	/ ' '			/, ! for EXAM
+     .		alg_trans_title( 11 )	/ ' '			/,
+     .		alg_trans_num  ( 11 )	/ trans_no_transform	/,
+     .		alg_trans_its_int ( 11)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 11)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 11)	/ bad_val4		/,
+     .		alg_trans_text ( 12 )	/ 'NUL'			/, ! for @NUL
+     .		alg_trans_title( 12 )	/ ' '			/,
+     .		alg_trans_num  ( 12 )	/ trans_no_transform	/,
+     .		alg_trans_its_int ( 12)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 12)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 12)	/ bad_val4		/,
+     .		alg_trans_text ( 13  )	/ 'DDC' 		/, 
+     .		alg_trans_title( 13 )	/ 'centered derivative'	/,
+     .		alg_trans_num  ( 13 )	/ trans_deriv_cntr	/,
+     .		alg_trans_its_int ( 13)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 13)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 13)	/ bad_val4		/,
+     .		alg_trans_text ( 14 )	/ 'DDF' 		/, 
+     .		alg_trans_title( 14 )	/ 'forward derivative'	/,
+     .		alg_trans_num  ( 14 )	/ trans_deriv_fwrd	/,
+     .		alg_trans_its_int ( 14)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 14)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 14)	/ bad_val4		/,
+     .		alg_trans_text ( 15 )	/ 'DDB' 		/, 
+     .		alg_trans_title( 15 )	/ 'backwards derivative'/,
+     .		alg_trans_num  ( 15 )	/ trans_deriv_bkwd	/,
+     .		alg_trans_its_int ( 15)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 15)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 15)	/ bad_val4		/,
+     .		alg_trans_text ( 16 )	/ 'DIN' 		/, 
+     .		alg_trans_title( 16 )	/ 'integrated'		/,
+     .		alg_trans_num  ( 16 )	/ trans_integ_def	/,
+     .		alg_trans_its_int ( 16)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 16)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 16)	/ bad_val4		/,
+     .		alg_trans_text ( 17 )	/ 'IIN' 		/, 
+     .		alg_trans_title( 17 )	/ 'indef. integ.'	/,
+     .		alg_trans_num  ( 17 )	/ trans_integ_indef	/,
+     .		alg_trans_its_int ( 17)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 17)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 17)	/ bad_val4		/,
+     .		alg_trans_text ( 18 )	/ 'SBX' 		/, 
+     .		alg_trans_title( 18 )	/ 'box smoothed'	/,
+     .		alg_trans_num  ( 18 )	/ trans_smth_box	/,
+     .		alg_trans_its_int ( 18)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 18)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 18)	/ 3.			/,
+     .		alg_trans_text ( 19 )	/ 'SBN' 		/, 
+     .		alg_trans_title( 19 )	/ 'binomial smoothed'	/,
+     .		alg_trans_num  ( 19 )	/ trans_smth_binml	/,
+     .		alg_trans_its_int ( 19)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 19)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 19)	/ 3.			/,
+     .		alg_trans_text ( 20 )	/ 'SWL' 		/, 
+     .		alg_trans_title( 20 )	/ 'Welch smoothed'	/,
+     .		alg_trans_num  ( 20 )	/ trans_smth_welch	/,
+     .		alg_trans_its_int ( 20)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 20)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 20)	/ 3.			/
+	DATA
+     .		alg_trans_text ( 21 )	/ 'SHN' 		/, 
+     .		alg_trans_title( 21 )	/ 'Hanning smoothed'	/,
+     .		alg_trans_num  ( 21 )	/ trans_smth_hanng	/,
+     .		alg_trans_its_int ( 21)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 21)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 21)	/ 3.			/,
+     .		alg_trans_text ( 22 )	/ 'SPZ' 		/, 
+     .		alg_trans_title( 22 )	/ 'Parzen smoothed'	/,
+     .		alg_trans_num  ( 22 )	/ trans_smth_parzn	/,
+     .		alg_trans_its_int ( 22)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 22)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 22)	/ 3.			/,
+     .		alg_trans_text ( 23 )	/ 'FAV' 		/, 
+     .		alg_trans_title( 23 )	/ 'ave-filled'		/,
+     .		alg_trans_num  ( 23 )	/ trans_fill_ave	/,
+     .		alg_trans_its_int ( 23)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 23)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 23)	/ 3			/,
+     .		alg_trans_text ( 24 )	/ 'FLN' 		/, 
+     .		alg_trans_title( 24 )	/ 'linear-filled'	/,
+     .		alg_trans_num  ( 24 )	/ trans_fill_interp	/,
+     .		alg_trans_its_int ( 24)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 24)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 24)	/ 1.			/,
+     .		alg_trans_text ( 25 )	/ 'FNR' 		/, 
+     .		alg_trans_title( 25 )	/ 'nearest-filled'	/,
+     .		alg_trans_num  ( 25 )	/ trans_fill_near	/,
+     .		alg_trans_its_int ( 25)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 25)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 25)	/ 1.			/,
+     .		alg_trans_text ( 26 )	/ 'NGD'  		/, 
+     .		alg_trans_title( 26 )	/ 'number of valid'  	/,
+     .		alg_trans_num  ( 26 )	/ trans_good_pt  	/,
+     .		alg_trans_its_int ( 26)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 26)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 26)	/ bad_val4		/,
+     .		alg_trans_text ( 27 )	/ 'NBD'  		/, 
+     .		alg_trans_title( 27 )	/ 'number flagged bad' 	/,
+     .		alg_trans_num  ( 27 )	/ trans_bad_pt  	/,
+     .		alg_trans_its_int ( 27)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 27)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 27)	/ bad_val4		/,
+     .		alg_trans_text ( 28 )	/ 'LOC'			/, 
+     .		alg_trans_title( 28 )	/ 'location'		/,
+     .		alg_trans_num  ( 28 )	/ trans_locate		/,
+     .		alg_trans_its_int ( 28)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 28)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 28)	/ 0.0			/,
+     .		alg_trans_text ( 29 )	/ 'WEQ'  		/, 
+     .		alg_trans_title( 29 )	/ 'weighted equal'	/,
+     .		alg_trans_num  ( 29 )	/ trans_wgted_eq	/,
+     .		alg_trans_its_int ( 29)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 29)	/ .TRUE.		/,
+     .          alg_trans_dflt_arg( 29)	/ 0.0                   /,
+     .		alg_trans_text ( 30 )	/ 'VA4' 		/,
+     .		alg_trans_title( 30 )	/ '4D variance'		/,
+     .		alg_trans_num  ( 30 )	/ trans_4d_var		/,
+     .		alg_trans_its_int ( 30)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 30)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 30)	/ bad_val4		/
+	DATA
+     .		alg_trans_text ( 31 )	/ 'NG4' 		/,
+     .		alg_trans_title( 31 )	/ '4D # valid'		/,
+     .		alg_trans_num  ( 31 )	/ trans_4d_good_pt	/,
+     .		alg_trans_its_int ( 31)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 31)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 31)	/ bad_val4		/,
+     .		alg_trans_text ( 32 )	/ 'NB4' 		/,
+     .		alg_trans_title( 32 )	/ '4D # bad'		/,
+     .		alg_trans_num  ( 32 )	/ trans_4d_bad_pt	/,
+     .		alg_trans_its_int ( 32)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 32)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 32)	/ bad_val4		/
+	DATA
+     .		alg_trans_text ( 33 )	/ 'CDA' 		/,
+     .		alg_trans_title( 33 )	/ 'closest dist above'  /,
+     .		alg_trans_num  ( 33 )	/ trans_nrst_dist_abv	/,
+     .		alg_trans_its_int ( 33)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 33)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 33)	/ 1			/,
+     .		alg_trans_text ( 34 )	/ 'CDB' 		/,
+     .		alg_trans_title( 34 )	/ 'closest dist below'  /,
+     .		alg_trans_num  ( 34 )	/ trans_nrst_dist_blw	/,
+     .		alg_trans_its_int ( 34)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 34)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 34)	/ 1			/,
+     .		alg_trans_text ( 35 )	/ 'CIA' 		/,
+     .		alg_trans_title( 35 )	/ 'closest index above' /,
+     .		alg_trans_num  ( 35 )	/ trans_nrst_indx_abv	/,
+     .		alg_trans_its_int ( 35)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 35)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 35)	/ 1			/,
+     .		alg_trans_text ( 36 )	/ 'CIB' 		/,
+     .		alg_trans_title( 36 )	/ 'closest index below' /,
+     .		alg_trans_num  ( 36 )	/ trans_nrst_indx_blw	/,
+     .		alg_trans_its_int ( 36)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 36)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 36)	/ 1			/,
+     .		alg_trans_text ( 37 )	/ 'EVN' 		/,
+     .		alg_trans_title( 37 )	/ 'event mask'		/,
+     .		alg_trans_num  ( 37 )	/ trans_event_mask	/,
+     .		alg_trans_its_int ( 37)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 37)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 37)	/ 0.0			/,
+     .		alg_trans_text ( 38 )	/ 'MED' 		/,
+     .		alg_trans_title( 38 )	/ 'median smoothed'     /,
+     .		alg_trans_num  ( 38 )	/ trans_smth_median	/,
+     .		alg_trans_its_int ( 38)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 38)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 38)	/ 3		/,
+     .		alg_trans_text ( 39 )	/ 'SMX' 		/,
+     .		alg_trans_title( 39 )	/ 'maximum smoothed'     /,
+     .		alg_trans_num  ( 39 )	/ trans_smth_max	/,
+     .		alg_trans_its_int ( 39)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 39)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 39)	/ 3		/,
+     .		alg_trans_text ( 40 )	/ 'SMN' 		/,
+     .		alg_trans_title( 40 )	/ 'minimum smoothed'     /,
+     .		alg_trans_num  ( 40 )	/ trans_smth_min	/,
+     .		alg_trans_its_int ( 40)	/ .TRUE.		/,
+     .		alg_trans_has_arg ( 40)	/ .TRUE.		/,
+     .		alg_trans_dflt_arg( 40)	/ 3		        /,
+     .		alg_trans_text ( 41 )	/ 'SM4'  		/, 
+     .		alg_trans_title( 41 )	/ '4D summed'           /,
+     .          alg_trans_num  ( 41 )	/ trans_4d_sum	        /,
+     .		alg_trans_its_int ( 41)	/ .FALSE.		/,
+     .		alg_trans_has_arg ( 41)	/ .FALSE.		/,
+     .		alg_trans_dflt_arg( 41)/ bad_val4		/,
+     .		alg_trans_text ( 42 )	/ 'STD'  		/, 
+     .		alg_trans_title( 42 )	/ 'standard deviation'  /,
+     .		alg_trans_num  ( 42 )	/ trans_std_dev  	/
+
+        DATA    (alg_trans_num(i),i = 43, num_transforms)
+     .            /18*unspecified_int4 /
+
+	DATA
+     .		alg_regrid_title( prgrd_exact )		/ ' '	/,
+     .		alg_regrid_code ( prgrd_exact )		/ 'XAK'	/,	
+     .		alg_regrid_vizb ( prgrd_exact )		/ .FALSE.	/,
+     .		alg_regrid_title( prgrd_linear_interp )	/ 'lin. interp.'/,
+     .		alg_regrid_code ( prgrd_linear_interp )	/ 'LIN'	/,
+     .		alg_regrid_vizb ( prgrd_linear_interp )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_average )	/ 'box avgd'	/,
+     .		alg_regrid_code ( prgrd_average )	/ 'AVE'	/,
+     .		alg_regrid_vizb ( prgrd_average )	/ .TRUE. 	/,
+     .		alg_regrid_title( prgrd_xy_ave )	/ 'area avgd'	/,
+     .		alg_regrid_code ( prgrd_xy_ave )	/ 'AAV'	/,
+     .		alg_regrid_vizb ( prgrd_xy_ave )	/ .FALSE.	/,
+     .		alg_regrid_title( prgrd_xy_lin )	/ 'area intrp.' /,
+     .		alg_regrid_code ( prgrd_xy_lin )	/ 'LIN'	/,
+     .		alg_regrid_vizb ( prgrd_xy_lin )	/ .FALSE.	/,
+     .		alg_regrid_title( prgrd_xact_pts )	/ 'exact match'	/,
+     .		alg_regrid_code ( prgrd_xact_pts )	/ 'XACT'	/
+     .		alg_regrid_vizb ( prgrd_xact_pts )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_associate )	/ 'index assn'	/,
+     .		alg_regrid_code ( prgrd_associate )	/ 'ASN'	/,
+     .		alg_regrid_vizb ( prgrd_associate )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_variance )	/ 'variance'	/,
+     .		alg_regrid_code ( prgrd_variance )	/ 'VAR'	/,
+     .		alg_regrid_vizb ( prgrd_variance )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_min )		/ 'minimum'	/,
+     .		alg_regrid_code ( prgrd_min )		/ 'MIN'	/,
+     .		alg_regrid_vizb(  prgrd_min )		/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_max )		/ 'maximum'	/,
+     .		alg_regrid_code ( prgrd_max )		/ 'MAX'	/,
+     .		alg_regrid_vizb(  prgrd_max )		/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_sum )		/ 'sum'	/,
+     .		alg_regrid_code ( prgrd_sum )		/ 'SUM'	/,
+     .		alg_regrid_vizb(  prgrd_sum )		/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_good_pt )	/ '# gd pts'	/,
+     .		alg_regrid_code ( prgrd_good_pt )	/ 'NGD'	/,
+     .		alg_regrid_vizb ( prgrd_good_pt )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modulo )	/ 'modulo ave'	/,
+     .		alg_regrid_code ( prgrd_modulo )	/ 'MOD'	/
+     .		alg_regrid_vizb ( prgrd_modulo )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modvar )	/ 'modulo var'	/,
+     .		alg_regrid_code ( prgrd_modvar )	/ 'MODVAR'	/
+     .		alg_regrid_vizb ( prgrd_modvar )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modngd )	/ '# gd mod pts'/,
+     .		alg_regrid_code ( prgrd_modngd )	/ 'MODNGD'	/
+     .		alg_regrid_vizb ( prgrd_modngd )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modnbd )	/ '#bad mod pts'/,
+     .		alg_regrid_code ( prgrd_modnbd )	/ 'MODNBD'	/
+     .		alg_regrid_vizb ( prgrd_modnbd )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modsum )	/ 'modulo sum'	/,
+     .		alg_regrid_code ( prgrd_modsum )	/ 'MODSUM'	/
+     .		alg_regrid_vizb ( prgrd_modsum )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modmin )	/ 'modulo min'	/,
+     .		alg_regrid_code ( prgrd_modmin )	/ 'MODMIN'	/
+     .		alg_regrid_vizb ( prgrd_modmin )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_modmax )	/ 'modulo max'	/,
+     .		alg_regrid_code ( prgrd_modmax )	/ 'MODMAX'	/
+     .		alg_regrid_vizb ( prgrd_modmax )	/ .TRUE.	/,
+     .		alg_regrid_title( prgrd_nearest )	/ 'nearst coord'/,
+     .		alg_regrid_code ( prgrd_nearest )	/ 'NRST'	/
+     .		alg_regrid_vizb ( prgrd_nearest )	/ .TRUE.	/,
+     .		(alg_regrid_title(i),i=prgrd_nearest+1,max_regrid_trans)
+     .				/11*unspecified_name4/,
+     .		(alg_regrid_code (i),i=prgrd_nearest+1,max_regrid_trans)
+     .				/11*unspecified_name4/,
+     .		(alg_regrid_vizb (i),i=prgrd_nearest+1,max_regrid_trans)
+     .				/11*.FALSE./
+
+
+	DATA
+     .		alg_regrid_title(pauxrgrd_linear)	/ 'lin. interp.'/,
+     .		alg_regrid_code (pauxrgrd_linear)	/ 'LIN'	        /,
+     .		alg_regrid_vizb (pauxrgrd_linear)	/ .TRUE.	/,
+     .		alg_regrid_title(pauxrgrd_average)	/ 'box avgd'    /,
+     .		alg_regrid_code (pauxrgrd_average)	/ 'AVE'	        /,
+     .		alg_regrid_vizb (pauxrgrd_average)	/ .FALSE.	/,
+     .		alg_regrid_title(pauxrgrd_pwlave )	
+     .						/ 'pc-wise linear ave'  /,
+     .		alg_regrid_code (pauxrgrd_pwlave )	/ 'PLAVE'      /,
+     .		alg_regrid_vizb (pauxrgrd_pwlave )	/ .TRUE.	/,
+     .		alg_regrid_title(pauxrgrd_thick_ave)
+     .						/ 'box ave from thkness'/,
+     .		alg_regrid_code (pauxrgrd_thick_ave)/ unspecified_name4 /,
+     .		alg_regrid_vizb (pauxrgrd_thick_ave)	/ .FALSE.	/,
+     .		(alg_regrid_title(i),
+     .				i=pauxrgrd_thick_ave+1,max_auxregrid_trans)
+     .				/2*unspecified_name4/,
+     .		(alg_regrid_code (i),
+     .				i=pauxrgrd_thick_ave+1,max_auxregrid_trans)
+     .				/2*unspecified_name4/,
+     .		(alg_regrid_vizb (i),
+     .				i=pauxrgrd_thick_ave+1,max_auxregrid_trans)
+     .				/2*.FALSE./
+
+* translation table for substituting 1D transformations with 4D transforms
+	DATA	num_4d_trans/ 6 /
+	DATA	alg_1d_to_4d(1) /trans_average/,
+     .		alg_4d_trans(1) /trans_4d_ave/,
+     .		alg_1d_to_4d(2) /trans_integ_def/,
+     .		alg_4d_trans(2) /trans_4d_int_def/,
+     .		alg_1d_to_4d(3) /trans_variance/,
+     .		alg_4d_trans(3) /trans_4d_var/,
+     .		alg_1d_to_4d(4) /trans_good_pt/,
+     .		alg_4d_trans(4) /trans_4d_good_pt/,
+     .		alg_1d_to_4d(5) /trans_bad_pt/,
+     .		alg_4d_trans(5) /trans_4d_bad_pt/,
+     .		alg_1d_to_4d(6) /trans_sum/,
+     .		alg_4d_trans(6) /trans_4d_sum/
+
+	END
+
diff --git a/fer/dat/xcalc_vars_data.F b/fer/dat/xcalc_vars_data.F
new file mode 100644
index 0000000..7eefb9d
--- /dev/null
+++ b/fer/dat/xcalc_vars_data.F
@@ -0,0 +1,2472 @@
+	BLOCK DATA XCALC_VARS_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization of COMMON / XCALC_VARS /
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/21/89 - extracted from XVARIABLES_DTA with extensive changes
+*	10/12/89 - added cvar_num_results data
+*	 2/26/90 - CAIR requires only one component in the 4D version 2.00
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*         2/12 *kms* Add the E and F dimensions
+
+        IMPLICIT NONE
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'	! .cmn_text has an external
+	include 'ferret.parm'
+	include 'instance_table.parm'
+	include 'xcalc_vars.cmn'
+
+	INTEGER	i
+
+* local parameter declarations:
+	INTEGER     ptstep_1hr_b4, pcair_special, pairt_special, 
+     .              ptemp_special
+	PARAMETER ( ptstep_1hr_b4 = pcv_hourly_0 - 1,
+     .		    pcair_special = pcair  + pcv_spec_flg,
+     .		    pairt_special = pairt + pcv_spec_flg,
+     .		    ptemp_special = ptemp + pcv_spec_flg )
+
+* number of calculatable variables defined in this BLOCK DATA
+	DATA num_calc_vars	/ 59 /
+
+* computable variables pre-defined in program
+	DATA cvar_primary_name	( pqcdz )
+     .				/'VERTICAL HEAT DIFFUSION COEFFICIENT'/
+	DATA cvar_name_code	( pqcdz ) / 'QCDZ'	/
+	DATA cvar_unit_code	( pqcdz ) / pudiffusion /
+	DATA cvar_frame_start	( pqcdz ) / to_qcdz	/
+	DATA cvar_frame_length	( pqcdz ) / qcdz_frame	/
+	DATA cvar_num_results	( pqcdz ) / 2	/	! also PCDZ
+	DATA ( cvar_axes(i,pqcdz),i=1,3 ) / mxt, myt, mzw/
+
+	DATA cvar_primary_name	( ppcdz )
+     .				/'VERTICAL MOMENTUM DIFFUSION COEFFICIENT'/
+	DATA cvar_name_code	( ppcdz ) / 'PCDZ'	/
+	DATA cvar_unit_code	( ppcdz ) / pudiffusion /
+	DATA cvar_frame_start	( ppcdz ) / to_pcdz	/
+	DATA cvar_frame_length	( ppcdz ) / pcdz_frame	/
+	DATA cvar_num_results	( ppcdz ) / 2	/	! also QCDZ
+	DATA ( cvar_axes(i,ppcdz),i=1,3 ) / mxu, myu, mzw /
+
+	DATA cvar_primary_name	( prho0 ) / 'DENSITY REFERENCED TO SURFACE'/
+	DATA cvar_name_code	( prho0 ) / 'RHO0'	/
+	DATA cvar_unit_code	( prho0 ) / punot_app	/
+	DATA cvar_frame_start	( prho0 ) / to_rho0	/
+	DATA cvar_frame_length	( prho0 ) / rho0_frame	/
+	DATA cvar_num_results	( prho0 ) / 1	/
+	DATA ( cvar_axes(i,prho0),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqdfz ) 
+     .				/ 'VERTICAL HEAT DIFFUSION' /
+	DATA cvar_name_code	( pqdfz ) / 'QDFZ'	/
+	DATA cvar_unit_code	( pqdfz ) / putemp_dt	/
+	DATA cvar_frame_start	( pqdfz ) / to_qdfz	/
+	DATA cvar_frame_length	( pqdfz ) / qdfz_frame	/
+	DATA cvar_num_results	( pqdfz ) / 1	/
+	DATA ( cvar_axes(i,pqdfz),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqdfh ) / 'HORIZONTAL HEAT DIFFUSION' /
+	DATA cvar_name_code	( pqdfh ) / 'QDFH'	/
+	DATA cvar_unit_code	( pqdfh ) / putemp_dt	/
+	DATA cvar_frame_start	( pqdfh ) / to_qdfh	/
+	DATA cvar_frame_length	( pqdfh ) / qdfh_frame	/
+	DATA cvar_num_results	( pqdfh ) / 1	/
+	DATA ( cvar_axes(i,pqdfh),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqadx ) / 'ZONAL HEAT ADVECTION' /
+	DATA cvar_name_code	( pqadx ) / 'QADX'	/
+	DATA cvar_unit_code	( pqadx ) / putemp_dt	/
+	DATA cvar_frame_start	( pqadx ) / to_qadx	/
+	DATA cvar_frame_length	( pqadx ) / qadx_frame	/
+	DATA cvar_num_results	( pqadx ) / 1	/
+	DATA ( cvar_axes(i,pqadx),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqady ) / 'MERIDIONAL HEAT ADVECTION' /
+	DATA cvar_name_code	( pqady ) / 'QADY'	/
+	DATA cvar_unit_code	( pqady ) / putemp_dt	/
+	DATA cvar_frame_start	( pqady ) / to_qady	/
+	DATA cvar_frame_length	( pqady ) / qady_frame	/
+	DATA cvar_num_results	( pqady ) / 1	/
+	DATA ( cvar_axes(i,pqady),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqadz ) / 'VERTICAL HEAT ADVECTION' /
+	DATA cvar_name_code	( pqadz ) / 'QADZ'	/
+	DATA cvar_unit_code	( pqadz ) / putemp_dt	/
+	DATA cvar_frame_start	( pqadz ) / to_qadz	/
+	DATA cvar_frame_length	( pqadz ) / qadz_frame	/
+	DATA cvar_num_results	( pqadz ) / 1	/
+	DATA ( cvar_axes(i,pqadz),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqad  ) / 'TOTAL HEAT ADVECTION' /
+	DATA cvar_name_code	( pqad  ) / 'QAD '	/
+	DATA cvar_unit_code	( pqad  ) / putemp_dt	/
+	DATA cvar_frame_start	( pqad  ) / to_qad 	/
+	DATA cvar_frame_length	( pqad  ) / qad _frame	/
+	DATA cvar_num_results	( pqad  ) / 1	/
+	DATA ( cvar_axes(i,pqad ),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqdf  ) / 'TOTAL HEAT DIFFUSION' /
+	DATA cvar_name_code	( pqdf  ) / 'QDF '	/
+	DATA cvar_unit_code	( pqdf  ) / putemp_dt	/
+	DATA cvar_frame_start	( pqdf  ) / to_qdf 	/
+	DATA cvar_frame_length	( pqdf  ) / qdf _frame	/
+	DATA cvar_num_results	( pqdf  ) / 1	/
+	DATA ( cvar_axes(i,pqdf ),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pqeva ) / 'EVAPORATIVE HEAT' /
+	DATA cvar_name_code	( pqeva ) / 'QEVA'	/
+	DATA cvar_unit_code	( pqeva ) / puheat_flux	/
+	DATA cvar_frame_start	( pqeva ) / to_qeva	/
+	DATA cvar_frame_length	( pqeva ) / qeva_frame	/
+	DATA cvar_num_results	( pqeva ) / 2	/	! also computes QSEN
+	DATA ( cvar_axes(i,pqeva),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( ptau  ) / 'MAGNITUDE OF WIND STRESS' /
+	DATA cvar_name_code	( ptau  ) / 'TAU '	/
+	DATA cvar_unit_code	( ptau  ) / pupressure	/
+	DATA cvar_frame_start	( ptau  ) / to_tau 	/
+	DATA cvar_frame_length	( ptau  ) / tau _frame	/
+	DATA cvar_num_results	( ptau  ) / 1	/
+	DATA ( cvar_axes(i,ptau ),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( pqsen ) / 'SENSIBLE HEAT'/
+	DATA cvar_name_code	( pqsen ) / 'QSEN'	/
+	DATA cvar_unit_code	( pqsen ) / puheat_flux	/
+	DATA cvar_frame_start	( pqsen ) / to_qsen	/
+	DATA cvar_frame_length	( pqsen ) / qsen_frame	/
+	DATA cvar_num_results	( pqsen ) / 2	/	! also computes QEVA
+	DATA ( cvar_axes(i,pqsen),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( pqrad ) / 'RADIATIVE HEAT' /
+	DATA cvar_name_code	( pqrad ) / 'QRAD'	/
+	DATA cvar_unit_code	( pqrad ) / puheat_flux	/
+	DATA cvar_frame_start	( pqrad ) / to_qrad	/
+	DATA cvar_frame_length	( pqrad ) / qrad_frame	/
+	DATA cvar_num_results	( pqrad ) / 1	/
+	DATA ( cvar_axes(i,pqrad),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( pqflx ) / 'SURFACE HEAT FLUX' /
+	DATA cvar_name_code	( pqflx ) / 'QFLX'	/
+	DATA cvar_unit_code	( pqflx ) / puheat_flux	/
+	DATA cvar_frame_start	( pqflx ) / to_qflx	/
+	DATA cvar_frame_length	( pqflx ) / qflx_frame	/
+	DATA cvar_num_results	( pqflx ) / 1	/
+	DATA ( cvar_axes(i,pqflx),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( prho  ) / 'NORMALIZED DENSITY'/
+	DATA cvar_name_code	( prho  ) / 'RHO'	/
+	DATA cvar_unit_code	( prho  ) / punot_app	/
+	DATA cvar_frame_start	( prho  ) / to_rho	/
+	DATA cvar_frame_length	( prho  ) / rho_frame	/
+	DATA cvar_num_results	( prho  ) / 1	/
+	DATA ( cvar_axes(i,prho ),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pdpdx ) 
+     .				/ 'd/dX( BAROCLINIC PRESSURE )'/
+	DATA cvar_name_code	( pdpdx ) / 'DPDX'	/
+	DATA cvar_unit_code	( pdpdx ) / pupres_dx	/
+	DATA cvar_frame_start	( pdpdx ) / to_dpdx	/
+	DATA cvar_frame_length	( pdpdx ) / dpdx_frame	/
+	DATA cvar_num_results	( pdpdx ) / 2	/	! also DPDY
+	DATA ( cvar_axes(i,pdpdx),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pdpdy ) 
+     .				/ 'd/dY( BAROCLINIC PRESSURE )'/
+	DATA cvar_name_code	( pdpdy ) / 'DPDY'	/
+	DATA cvar_unit_code	( pdpdy ) / pupres_dx	/
+	DATA cvar_frame_start	( pdpdy ) / to_dpdy	/
+	DATA cvar_frame_length	( pdpdy ) / dpdy_frame	/
+	DATA cvar_num_results	( pdpdy ) / 2	/	! also DPDX
+	DATA ( cvar_axes(i,pdpdy),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pw_u  ) 
+     .				 / 'VERTICAL VELOCITY COMPUTED ON UV GRID' /
+	DATA cvar_name_code	( pw_u  ) / 'W_U '	/
+	DATA cvar_unit_code	( pw_u  ) / puvelocity	/
+	DATA cvar_frame_start	( pw_u  ) / to_w_u	/
+	DATA cvar_frame_length	( pw_u  ) / w_u_frame	/
+	DATA cvar_num_results	( pw_u  ) / 1	/
+	DATA ( cvar_axes(i,pw_u ),i=1,3 ) / mxu, myu, mzw /
+
+	DATA cvar_primary_name	( puavz ) 
+     .				 / 'VERTICALLY AVERAGED ZONAL VELOCITY'	/
+	DATA cvar_name_code	( puavz ) / 'UAVZ'	/
+	DATA cvar_unit_code	( puavz ) / puvelocity	/
+	DATA cvar_frame_start	( puavz ) / to_uavz	/
+	DATA cvar_frame_length	( puavz ) / uavz_frame	/
+	DATA cvar_num_results	( puavz ) / 2	/	! also VAVZ
+	DATA ( cvar_axes(i,puavz),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( pvavz ) 
+     .				 / 'VERTICALLY AVERAGED MERIDIONAL VELOCITY' /
+	DATA cvar_name_code	( pvavz ) / 'VAVZ'	/
+	DATA cvar_unit_code	( pvavz ) / puvelocity	/
+	DATA cvar_frame_start	( pvavz ) / to_vavz	/
+	DATA cvar_frame_length	( pvavz ) / vavz_frame	/
+	DATA cvar_num_results	( pvavz ) / 2	/	! also UAVZ
+	DATA ( cvar_axes(i,pvavz),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( pfuw  ) 
+     .					/ 'ZONAL ADVECTIVE COEFFICIENT, FUW' /
+	DATA cvar_name_code	( pfuw  ) / 'FUW ' 	/
+	DATA cvar_unit_code	( pfuw  ) / puvelocity	/
+	DATA cvar_frame_start	( pfuw  ) / to_fuw 	/
+	DATA cvar_frame_length	( pfuw  ) / fuw_frame	/
+	DATA cvar_num_results	( pfuw  ) / 1	/
+	DATA ( cvar_axes(i,pfuw ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pfvn  ) 
+     .				/ 'MERIDIONAL ADVECTIVE COEFFICIENT, FVN' /
+	DATA cvar_name_code	( pfvn  ) / 'FVN '	/
+	DATA cvar_unit_code	( pfvn  ) / puvelocity	/
+	DATA cvar_frame_start	( pfvn  ) / to_fvn 	/
+	DATA cvar_frame_length	( pfvn  ) / fvn_frame	/
+	DATA cvar_num_results	( pfvn  ) / 1	/
+	DATA ( cvar_axes(i,pfvn ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( puadx ) / 'ZONAL ADVECTION OF U' /
+	DATA cvar_name_code	( puadx ) / 'UADX'	/
+	DATA cvar_unit_code	( puadx ) / puvel_dt	/
+	DATA cvar_frame_start	( puadx ) / to_uadx	/
+	DATA cvar_frame_length	( puadx ) / uadx_frame	/
+	DATA cvar_num_results	( puadx ) / 1	/
+	DATA ( cvar_axes(i,puadx),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( puady ) / 'MERIDIONAL ADVECTION OF U' /
+	DATA cvar_name_code	( puady ) / 'UADY'	/
+	DATA cvar_unit_code	( puady ) / puvel_dt	/
+	DATA cvar_frame_start	( puady ) / to_uady	/
+	DATA cvar_frame_length	( puady ) / uady_frame	/
+	DATA cvar_num_results	( puady ) / 1	/
+	DATA ( cvar_axes(i,puady),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( puadz ) / 'VERTICAL ADVECTION OF U' /
+	DATA cvar_name_code	( puadz ) / 'UADZ'	/
+	DATA cvar_unit_code	( puadz ) / puvel_dt	/
+	DATA cvar_frame_start	( puadz ) / to_uadz	/
+	DATA cvar_frame_length	( puadz ) / uadz_frame	/
+	DATA cvar_num_results	( puadz ) / 1	/
+	DATA ( cvar_axes(i,puadz),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvadx ) / 'ZONAL ADVECTION OF V' /
+	DATA cvar_name_code	( pvadx ) / 'VADX'	/
+	DATA cvar_unit_code	( pvadx ) / puvel_dt	/
+	DATA cvar_frame_start	( pvadx ) / to_vadx	/
+	DATA cvar_frame_length	( pvadx ) / vadx_frame	/
+	DATA cvar_num_results	( pvadx ) / 1	/
+	DATA ( cvar_axes(i,pvadx),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvady ) / 'MERIDIONAL ADVECTION OF V' /
+	DATA cvar_name_code	( pvady ) / 'VADY'	/
+	DATA cvar_unit_code	( pvady ) / puvel_dt	/
+	DATA cvar_frame_start	( pvady ) / to_vady	/
+	DATA cvar_frame_length	( pvady ) / vady_frame	/
+	DATA cvar_num_results	( pvady ) / 1	/
+	DATA ( cvar_axes(i,pvady),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvadz ) / 'VERTICAL ADVECTION OF V' /
+	DATA cvar_name_code	( pvadz ) / 'VADZ'	/
+	DATA cvar_unit_code	( pvadz ) / puvel_dt	/
+	DATA cvar_frame_start	( pvadz ) / to_vadz	/
+	DATA cvar_frame_length	( pvadz ) / vadz_frame	/
+	DATA cvar_num_results	( pvadz ) / 1	/
+	DATA ( cvar_axes(i,pvadz),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pudfh ) / 'HORIZONTAL DIFFUSION OF U' /
+	DATA cvar_name_code	( pudfh ) / 'UDFH'	/
+	DATA cvar_unit_code	( pudfh ) / puvel_dt	/
+	DATA cvar_frame_start	( pudfh ) / to_udfh	/
+	DATA cvar_frame_length	( pudfh ) / udfh_frame	/
+	DATA cvar_num_results	( pudfh ) / 1	/
+	DATA ( cvar_axes(i,pudfh),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pudfz ) / 'VERTICAL DIFFUSION OF U' /
+	DATA cvar_name_code	( pudfz ) / 'UDFZ'	/
+	DATA cvar_unit_code	( pudfz ) / puvel_dt	/
+	DATA cvar_frame_start	( pudfz ) / to_udfz	/
+	DATA cvar_frame_length	( pudfz ) / udfz_frame	/
+	DATA cvar_num_results	( pudfz ) / 1	/
+	DATA ( cvar_axes(i,pudfz),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvdfh ) / 'HORIZONTAL DIFFUSION OF V' /
+	DATA cvar_name_code	( pvdfh ) / 'VDFH'	/
+	DATA cvar_unit_code	( pvdfh ) / puvel_dt	/
+	DATA cvar_frame_start	( pvdfh ) / to_vdfh	/
+	DATA cvar_frame_length	( pvdfh ) / vdfh_frame	/
+	DATA cvar_num_results	( pvdfh ) / 1	/
+	DATA ( cvar_axes(i,pvdfh),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvdfz ) / 'VERTICAL DIFFUSION OF V' /
+	DATA cvar_name_code	( pvdfz ) / 'VDFZ'	/
+	DATA cvar_unit_code	( pvdfz ) / puvel_dt	/
+	DATA cvar_frame_start	( pvdfz ) / to_vdfz	/
+	DATA cvar_frame_length	( pvdfz ) / vdfz_frame	/
+	DATA cvar_num_results	( pvdfz ) / 1	/
+	DATA ( cvar_axes(i,pvdfz),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pucoi ) 
+     .				/ 'U DUE TO IMPLICIT CORIOLIS CORRECTION' /
+	DATA cvar_name_code	( pucoi ) / 'UCOI'	/
+	DATA cvar_unit_code	( pucoi ) / puvel_dt	/
+	DATA cvar_frame_start	( pucoi ) / to_ucoi	/
+	DATA cvar_frame_length	( pucoi ) / ucoi_frame	/
+	DATA cvar_num_results	( pucoi ) / -9999	/
+	DATA ( cvar_axes(i,pucoi),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvcoi )  
+     .				/ 'V DUE TO IMPLICIT CORIOLIS CORRECTION' /
+	DATA cvar_name_code	( pvcoi ) / 'VCOI'	/
+	DATA cvar_unit_code	( pvcoi ) / puvel_dt	/
+	DATA cvar_frame_start	( pvcoi ) / to_vcoi	/
+	DATA cvar_frame_length	( pvcoi ) / vcoi_frame	/
+	DATA cvar_num_results	( pvcoi ) / -9999	/
+	DATA ( cvar_axes(i,pvcoi),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pubpi ) 
+     .				/ 'U DUE TO BAROCLINIC PRESSURE EFFECTS' /
+	DATA cvar_name_code	( pubpi ) / 'UBPI'	/
+	DATA cvar_unit_code	( pubpi ) / puvel_dt	/
+	DATA cvar_frame_start	( pubpi ) / to_ubpi	/
+	DATA cvar_frame_length	( pubpi ) / ubpi_frame	/
+	DATA cvar_num_results	( pubpi ) / 1	/
+	DATA ( cvar_axes(i,pubpi),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvbpi ) 
+     .				/ 'V DUE TO BAROCLINIC PRESSURE EFFECTS' /
+	DATA cvar_name_code	( pvbpi ) / 'VBPI'	/
+	DATA cvar_unit_code	( pvbpi ) / puvel_dt	/
+	DATA cvar_frame_start	( pvbpi ) / to_vbpi	/
+	DATA cvar_frame_length	( pvbpi ) / vbpi_frame	/
+	DATA cvar_num_results	( pvbpi ) / 1	/
+	DATA ( cvar_axes(i,pvbpi),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pubwi ) / 'U DUE TO WIND STRESS EFFECTS' /
+	DATA cvar_name_code	( pubwi ) / 'UBWI'	/
+	DATA cvar_unit_code	( pubwi ) / puvel_dt	/
+	DATA cvar_frame_start	( pubwi ) / to_ubwi	/
+	DATA cvar_frame_length	( pubwi ) / ubwi_frame	/
+	DATA cvar_num_results	( pubwi ) / 1	/
+	DATA ( cvar_axes(i,pubwi),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( pvbwi ) / 'V DUE TO WIND STRESS EFFECTS' /
+	DATA cvar_name_code	( pvbwi ) / 'VBWI'	/
+	DATA cvar_unit_code	( pvbwi ) / puvel_dt	/
+	DATA cvar_frame_start	( pvbwi ) / to_vbwi	/
+	DATA cvar_frame_length	( pvbwi ) / vbwi_frame	/
+	DATA cvar_num_results	( pvbwi ) / 1	/
+	DATA ( cvar_axes(i,pvbwi),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( pucoe ) 
+     .				/ 'U DUE TO EXPLICIT CORIOLIS CALCULATION' /
+	DATA cvar_name_code	( pucoe ) / 'UCOE'	/
+	DATA cvar_unit_code	( pucoe ) / puvel_dt	/
+	DATA cvar_frame_start	( pucoe ) / to_ucoe	/
+	DATA cvar_frame_length	( pucoe ) / ucoe_frame	/
+	DATA cvar_num_results	( pucoe ) / 2	/	! also VCOE
+	DATA ( cvar_axes(i,pucoe),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvcoe ) 
+     .				/ 'V DUE TO EXPLICIT CORIOLIS CALCULATION' /
+	DATA cvar_name_code	( pvcoe ) / 'VCOE'	/
+	DATA cvar_unit_code	( pvcoe ) / puvel_dt	/
+	DATA cvar_frame_start	( pvcoe ) / to_vcoe	/
+	DATA cvar_frame_length	( pvcoe ) / vcoe_frame	/
+	DATA cvar_num_results	( pvcoe ) / 2	/	! also UCOE
+	DATA ( cvar_axes(i,pvcoe),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( puad  ) / 'TOTAL ADVECTION OF U' /
+	DATA cvar_name_code	( puad  ) / 'UAD '	/
+	DATA cvar_unit_code	( puad  ) / puvel_dt	/
+	DATA cvar_frame_start	( puad  ) / to_uad 	/
+	DATA cvar_frame_length	( puad  ) / uad _frame	/
+	DATA cvar_num_results	( puad  ) / 1	/
+	DATA ( cvar_axes(i,puad ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvad  ) / 'TOTAL ADVECTION OF V' /
+	DATA cvar_name_code	( pvad  ) / 'VAD '	/
+	DATA cvar_unit_code	( pvad  ) / puvel_dt	/
+	DATA cvar_frame_start	( pvad  ) / to_vad 	/
+	DATA cvar_frame_length	( pvad  ) / vad _frame	/
+	DATA cvar_num_results	( pvad  ) / 1	/
+	DATA ( cvar_axes(i,pvad ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pudf  ) / 'TOTAL DIFFUSION OF U' /
+	DATA cvar_name_code	( pudf  ) / 'UDF '	/
+	DATA cvar_unit_code	( pudf  ) / puvel_dt	/
+	DATA cvar_frame_start	( pudf  ) / to_udf 	/
+	DATA cvar_frame_length	( pudf  ) / udf _frame	/
+	DATA cvar_num_results	( pudf  ) / 1	/
+	DATA ( cvar_axes(i,pudf ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvdf  ) / 'TOTAL DIFFUSION OF V' /
+	DATA cvar_name_code	( pvdf  ) / 'VDF '	/
+	DATA cvar_unit_code	( pvdf  ) / puvel_dt	/
+	DATA cvar_frame_start	( pvdf  ) / to_vdf 	/
+	DATA cvar_frame_length	( pvdf  ) / vdf _frame	/
+	DATA cvar_num_results	( pvdf  ) / 1	/
+	DATA ( cvar_axes(i,pvdf ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pdudt ) / 'd/dt(U)'	/
+	DATA cvar_name_code	( pdudt ) / 'DUDT'	/
+	DATA cvar_unit_code	( pdudt ) / puvel_dt	/
+	DATA cvar_frame_start	( pdudt ) / to_dudt	/
+	DATA cvar_frame_length	( pdudt ) / dudt_frame	/
+	DATA cvar_num_results	( pdudt ) / 1	/
+	DATA ( cvar_axes(i,pdudt),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pdvdt ) / 'd/dt(V)'/
+	DATA cvar_name_code	( pdvdt ) / 'DVDT'	/
+	DATA cvar_unit_code	( pdvdt ) / puvel_dt	/
+	DATA cvar_frame_start	( pdvdt ) / to_dvdt	/
+	DATA cvar_frame_length	( pdvdt ) / dvdt_frame	/
+	DATA cvar_num_results	( pdvdt ) / 1	/
+	DATA ( cvar_axes(i,pdvdt),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pdwdt ) / 'd/dt(W)'/
+	DATA cvar_name_code	( pdwdt ) / 'DWDT'	/
+	DATA cvar_unit_code	( pdwdt ) / puvel_dt	/
+	DATA cvar_frame_start	( pdwdt ) / to_dwdt	/
+	DATA cvar_frame_length	( pdwdt ) / dwdt_frame	/
+	DATA cvar_num_results	( pdwdt ) / 1	/
+	DATA ( cvar_axes(i,pdwdt),i=1,3 ) / mxu, myu, mzw /
+
+	DATA cvar_primary_name	( pdtdt ) / 'd/dt(TEMPERATURE)'/
+	DATA cvar_name_code	( pdtdt ) / 'DTDT'	/
+	DATA cvar_unit_code	( pdtdt ) / putemp_dt	/
+	DATA cvar_frame_start	( pdtdt ) / to_dtdt	/
+	DATA cvar_frame_length	( pdtdt ) / dtdt_frame	/
+	DATA cvar_num_results	( pdtdt ) / 1	/
+	DATA ( cvar_axes(i,pdtdt),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pubps ) 
+     .				/ 'U DUE TO SURFACE PRESSURE EFFECTS' /
+	DATA cvar_name_code	( pubps ) / 'UBPS'	/
+	DATA cvar_unit_code	( pubps ) / puvel_dt	/
+	DATA cvar_frame_start	( pubps ) / to_ubps	/
+	DATA cvar_frame_length	( pubps ) / ubps_frame	/
+	DATA cvar_num_results	( pubps ) / 1	/
+	DATA ( cvar_axes(i,pubps),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( pvbps ) 
+     .				/ 'V DUE TO SURFACE PRESSURE EFFECTS' /
+	DATA cvar_name_code	( pvbps ) / 'VBPS'	/
+	DATA cvar_unit_code	( pvbps ) / puvel_dt	/
+	DATA cvar_frame_start	( pvbps ) / to_vbps	/
+	DATA cvar_frame_length	( pvbps ) / vbps_frame	/
+	DATA cvar_num_results	( pvbps ) / 1	/
+	DATA ( cvar_axes(i,pvbps),i=1,3 ) / mxu, myu, mnormal /
+
+	DATA cvar_primary_name	( psali ) 
+     .				/ 'SALINITY'/
+	DATA cvar_name_code	( psali ) / 'SALI'	/
+	DATA cvar_unit_code	( psali ) / puppt	/
+	DATA cvar_frame_start	( psali ) / to_sali	/
+	DATA cvar_frame_length	( psali ) / sali_frame	/
+	DATA cvar_num_results	( psali ) / 1	/
+	DATA ( cvar_axes(i,psali),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pdens ) 
+     .				/ '(DENSITY-1)*1000'		/
+	DATA cvar_name_code	( pdens ) / 'DENS'	/
+	DATA cvar_unit_code	( pdens ) / pudensity	/
+	DATA cvar_frame_start	( pdens ) / to_dens	/
+	DATA cvar_frame_length	( pdens ) / dens_frame	/
+	DATA cvar_num_results	( pdens ) / 1	/
+	DATA ( cvar_axes(i,pdens),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pubp  ) 
+     .				/ 'U DUE TO TOTAL PRESSURE' /
+	DATA cvar_name_code	( pubp  ) / 'UBP '	/
+	DATA cvar_unit_code	( pubp  ) / puvel_dt	/
+	DATA cvar_frame_start	( pubp  ) / to_ubp 	/
+	DATA cvar_frame_length	( pubp  ) /  ubp_frame	/
+	DATA cvar_num_results	( pubp  ) / 1	/
+	DATA ( cvar_axes(i,pubp ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pvbp  ) 
+     .				/ 'V DUE TO TOTAL PRESSURE' /
+	DATA cvar_name_code	( pvbp  ) / 'VBP '	/
+	DATA cvar_unit_code	( pvbp  ) / puvel_dt	/
+	DATA cvar_frame_start	( pvbp  ) / to_vbp 	/
+	DATA cvar_frame_length	( pvbp  ) /  vbp_frame	/
+	DATA cvar_num_results	( pvbp  ) / 1	/
+	DATA ( cvar_axes(i,pvbp ),i=1,3 ) / mxu, myu, mzt /
+
+	DATA cvar_primary_name	( pcmsk ) / 'CONVECTIVE ADJUSTMENT MASK'/
+	DATA cvar_name_code	( pcmsk ) / 'CMSK'	/
+	DATA cvar_unit_code	( pcmsk ) / punot_app	/
+	DATA cvar_frame_start	( pcmsk ) / to_cmsk	/
+	DATA cvar_frame_length	( pcmsk ) / cmsk_frame	/
+	DATA cvar_num_results	( pcmsk ) / 1	/
+	DATA ( cvar_axes(i,pcmsk),i=1,3 ) / mxt, myt, mzt /
+
+	DATA cvar_primary_name	( pw_t  ) 
+     .				/ 'VERTICAL VELOCITY COMPUTED ON TS GRID'/
+	DATA cvar_name_code	( pw_t  ) / 'W_T '	/
+	DATA cvar_unit_code	( pw_t  ) / puvelocity	/
+	DATA cvar_frame_start	( pw_t  ) / to_w_t 	/
+	DATA cvar_frame_length	( pw_t  ) /  w_t_frame	/
+	DATA cvar_num_results	( pw_t  ) / 1	/
+	DATA ( cvar_axes(i,pw_t ),i=1,3 ) / mxt, myt, mzw /
+
+	DATA cvar_primary_name	( pcair ) / 'CLIMATOLOGICAL AIR TEMPERATURE'/
+	DATA cvar_name_code	( pcair ) / 'CAIR'	/
+	DATA cvar_unit_code	( pcair ) / putemperature /
+	DATA cvar_frame_start	( pcair ) / to_cair	/
+	DATA cvar_frame_length	( pcair ) / cair_frame	/
+	DATA cvar_num_results	( pcair ) / 1	/
+	DATA ( cvar_axes(i,pcair),i=1,3 ) / mxt, myt, mnormal /
+
+	DATA cvar_primary_name	( pair  ) / 'AIR TEMPERATURE'/
+	DATA cvar_name_code	( pair  ) / 'AIR '	/
+	DATA cvar_unit_code	( pair  ) / putemperature /
+	DATA cvar_frame_start	( pair  ) / to_air 	/
+	DATA cvar_frame_length	( pair  ) / air_frame	/
+	DATA cvar_num_results	( pair  ) / 1	/
+	DATA ( cvar_axes(i,pair ),i=1,3 ) / mxt, myt, mnormal /
+
+********************************************************************************
+* variable instances needed to  compute cvar variables
+
+	DATA cv_category (to_qcdz+1)/ cat_file_var	/
+	DATA cv_variable (to_qcdz+1)/ pu		/
+	DATA cv_lo_d1  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d1  (to_qcdz+1)/ 0		/
+	DATA cv_lo_d2  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d2  (to_qcdz+1)/ 0		/
+	DATA cv_lo_d3  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d3  (to_qcdz+1)/ 1		/
+	DATA cv_lo_d4  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d4  (to_qcdz+1)/ 0		/
+	DATA cv_lo_d5  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d5  (to_qcdz+1)/ 0		/
+	DATA cv_lo_d6  (to_qcdz+1)/ 0		/
+	DATA cv_hi_d6  (to_qcdz+1)/ 0		/
+
+	DATA cv_category (to_qcdz+2)/ cat_file_var	/
+	DATA cv_variable (to_qcdz+2)/ pv		/
+	DATA cv_lo_d1  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d1  (to_qcdz+2)/ 0		/
+	DATA cv_lo_d2  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d2  (to_qcdz+2)/ 0		/
+	DATA cv_lo_d3  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d3  (to_qcdz+2)/ 1		/
+	DATA cv_lo_d4  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d4  (to_qcdz+2)/ 0		/
+	DATA cv_lo_d5  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d5  (to_qcdz+2)/ 0		/
+	DATA cv_lo_d6  (to_qcdz+2)/ 0		/
+	DATA cv_hi_d6  (to_qcdz+2)/ 0		/
+
+	DATA cv_category (to_qcdz+3)/ cat_calc_var	/
+	DATA cv_variable (to_qcdz+3)/ prho0 		/
+	DATA cv_lo_d1  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d1  (to_qcdz+3)/ 0		/
+	DATA cv_lo_d2  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d2  (to_qcdz+3)/ 0		/
+	DATA cv_lo_d3  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d3  (to_qcdz+3)/ 1		/
+	DATA cv_lo_d4  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d4  (to_qcdz+3)/ 0		/
+	DATA cv_lo_d5  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d5  (to_qcdz+3)/ 0		/
+	DATA cv_lo_d6  (to_qcdz+3)/ 0		/
+	DATA cv_hi_d6  (to_qcdz+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_pcdz+1)/ cat_file_var	/
+	DATA cv_variable (to_pcdz+1)/ pu		/
+	DATA cv_lo_d1  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d1  (to_pcdz+1)/ 0		/
+	DATA cv_lo_d2  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d2  (to_pcdz+1)/ 0		/
+	DATA cv_lo_d3  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d3  (to_pcdz+1)/ 1		/
+	DATA cv_lo_d4  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d4  (to_pcdz+1)/ 0		/
+	DATA cv_lo_d5  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d5  (to_pcdz+1)/ 0		/
+	DATA cv_lo_d6  (to_pcdz+1)/ 0		/
+	DATA cv_hi_d6  (to_pcdz+1)/ 0		/
+
+	DATA cv_category (to_pcdz+2)/ cat_file_var	/
+	DATA cv_variable (to_pcdz+2)/ pv		/
+	DATA cv_lo_d1  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d1  (to_pcdz+2)/ 0		/
+	DATA cv_lo_d2  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d2  (to_pcdz+2)/ 0		/
+	DATA cv_lo_d3  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d3  (to_pcdz+2)/ 1		/
+	DATA cv_lo_d4  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d4  (to_pcdz+2)/ 0		/
+	DATA cv_lo_d5  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d5  (to_pcdz+2)/ 0		/
+	DATA cv_lo_d6  (to_pcdz+2)/ 0		/
+	DATA cv_hi_d6  (to_pcdz+2)/ 0		/
+
+	DATA cv_category (to_pcdz+3)/ cat_calc_var	/
+	DATA cv_variable (to_pcdz+3)/ prho0 		/
+	DATA cv_lo_d1  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d1  (to_pcdz+3)/ 0		/
+	DATA cv_lo_d2  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d2  (to_pcdz+3)/ 0		/
+	DATA cv_lo_d3  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d3  (to_pcdz+3)/ 1		/
+	DATA cv_lo_d4  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d4  (to_pcdz+3)/ 0		/
+	DATA cv_lo_d5  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d5  (to_pcdz+3)/ 0		/
+	DATA cv_lo_d6  (to_pcdz+3)/ 0		/
+	DATA cv_hi_d6  (to_pcdz+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_rho0+1)/ cat_file_var	/
+	DATA cv_variable (to_rho0+1)/ ptemp		/
+	DATA cv_lo_d1  (to_rho0+1)/ 0		/
+	DATA cv_hi_d1  (to_rho0+1)/ 0		/
+	DATA cv_lo_d2  (to_rho0+1)/ 0		/
+	DATA cv_hi_d2  (to_rho0+1)/ 0		/
+	DATA cv_lo_d3  (to_rho0+1)/ 0		/
+	DATA cv_hi_d3  (to_rho0+1)/ 0		/
+	DATA cv_lo_d4  (to_rho0+1)/ 0		/
+	DATA cv_hi_d4  (to_rho0+1)/ 0		/
+	DATA cv_lo_d5  (to_rho0+1)/ 0		/
+	DATA cv_hi_d5  (to_rho0+1)/ 0		/
+	DATA cv_lo_d6  (to_rho0+1)/ 0		/
+	DATA cv_hi_d6  (to_rho0+1)/ 0		/
+
+	DATA cv_category (to_rho0+2)/ cat_file_var	/
+	DATA cv_variable (to_rho0+2)/ psalt		/
+	DATA cv_lo_d1  (to_rho0+2)/ 0		/
+	DATA cv_hi_d1  (to_rho0+2)/ 0		/
+	DATA cv_lo_d2  (to_rho0+2)/ 0		/
+	DATA cv_hi_d2  (to_rho0+2)/ 0		/
+	DATA cv_lo_d3  (to_rho0+2)/ 0		/
+	DATA cv_hi_d3  (to_rho0+2)/ 0		/
+	DATA cv_lo_d4  (to_rho0+2)/ 0		/
+	DATA cv_hi_d4  (to_rho0+2)/ 0		/
+	DATA cv_lo_d5  (to_rho0+2)/ 0		/
+	DATA cv_hi_d5  (to_rho0+2)/ 0		/
+	DATA cv_lo_d6  (to_rho0+2)/ 0		/
+	DATA cv_hi_d6  (to_rho0+2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qdfz+1)/ cat_file_var	/
+	DATA cv_variable (to_qdfz+1)/ ptemp		/
+	DATA cv_lo_d1  (to_qdfz+1)/ 0		/
+	DATA cv_hi_d1  (to_qdfz+1)/ 0		/
+	DATA cv_lo_d2  (to_qdfz+1)/ 0		/
+	DATA cv_hi_d2  (to_qdfz+1)/ 0		/
+	DATA cv_lo_d3  (to_qdfz+1)/ -1		/
+	DATA cv_hi_d3  (to_qdfz+1)/ +1		/
+	DATA cv_lo_d4  (to_qdfz+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_qdfz+1)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_qdfz+1)/ 0		/
+	DATA cv_hi_d5  (to_qdfz+1)/ 0		/
+	DATA cv_lo_d6  (to_qdfz+1)/ 0		/
+	DATA cv_hi_d6  (to_qdfz+1)/ 0		/
+
+	DATA cv_category (to_qdfz+2)/ cat_calc_var	/
+	DATA cv_variable (to_qdfz+2)/ pqcdz		/
+	DATA cv_lo_d1  (to_qdfz+2)/ 0		/
+	DATA cv_hi_d1  (to_qdfz+2)/ 0		/
+	DATA cv_lo_d2  (to_qdfz+2)/ 0		/
+	DATA cv_hi_d2  (to_qdfz+2)/ 0		/
+	DATA cv_lo_d3  (to_qdfz+2)/ -1		/
+	DATA cv_hi_d3  (to_qdfz+2)/ 0		/
+	DATA cv_lo_d4  (to_qdfz+2)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_qdfz+2)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_qdfz+2)/ 0		/
+	DATA cv_hi_d5  (to_qdfz+2)/ 0		/
+	DATA cv_lo_d6  (to_qdfz+2)/ 0		/
+	DATA cv_hi_d6  (to_qdfz+2)/ 0		/
+
+	DATA cv_category (to_qdfz+3)/ cat_calc_var	/
+	DATA cv_variable (to_qdfz+3)/ pqflx		/
+	DATA cv_lo_d1  (to_qdfz+3)/ 0		/
+	DATA cv_hi_d1  (to_qdfz+3)/ 0		/
+	DATA cv_lo_d2  (to_qdfz+3)/ 0		/
+	DATA cv_hi_d2  (to_qdfz+3)/ 0		/
+	DATA cv_lo_d3  (to_qdfz+3)/ 0		/
+	DATA cv_hi_d3  (to_qdfz+3)/ 0		/
+	DATA cv_lo_d4  (to_qdfz+3)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_qdfz+3)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_qdfz+3)/ 0		/
+	DATA cv_hi_d5  (to_qdfz+3)/ 0		/
+	DATA cv_lo_d6  (to_qdfz+3)/ 0		/
+	DATA cv_hi_d6  (to_qdfz+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qdfh+1)/ cat_file_var	/
+	DATA cv_variable (to_qdfh+1)/ ptemp		/
+	DATA cv_lo_d1  (to_qdfh+1)/ -1		/
+	DATA cv_hi_d1  (to_qdfh+1)/ +1		/
+	DATA cv_lo_d2  (to_qdfh+1)/ -1		/
+	DATA cv_hi_d2  (to_qdfh+1)/ +1		/
+	DATA cv_lo_d3  (to_qdfh+1)/ 0		/
+	DATA cv_hi_d3  (to_qdfh+1)/ 0		/
+	DATA cv_lo_d4  (to_qdfh+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_qdfh+1)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_qdfh+1)/ 0		/
+	DATA cv_hi_d5  (to_qdfh+1)/ 0		/
+	DATA cv_lo_d6  (to_qdfh+1)/ 0		/
+	DATA cv_hi_d6  (to_qdfh+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qadx+1)/ cat_file_var	/
+	DATA cv_variable (to_qadx+1)/ ptemp		/
+	DATA cv_lo_d1  (to_qadx+1)/ -1		/
+	DATA cv_hi_d1  (to_qadx+1)/ +1		/
+	DATA cv_lo_d2  (to_qadx+1)/ -1		/
+	DATA cv_hi_d2  (to_qadx+1)/ 0		/
+	DATA cv_lo_d3  (to_qadx+1)/ 0		/
+	DATA cv_hi_d3  (to_qadx+1)/ 0		/
+	DATA cv_lo_d4  (to_qadx+1)/ 0		/
+	DATA cv_hi_d4  (to_qadx+1)/ 0		/
+	DATA cv_lo_d5  (to_qadx+1)/ 0		/
+	DATA cv_hi_d5  (to_qadx+1)/ 0		/
+	DATA cv_lo_d6  (to_qadx+1)/ 0		/
+	DATA cv_hi_d6  (to_qadx+1)/ 0		/
+
+	DATA cv_category (to_qadx+2)/ cat_file_var	/
+	DATA cv_variable (to_qadx+2)/ pu		/
+	DATA cv_lo_d1  (to_qadx+2)/ -1		/
+	DATA cv_hi_d1  (to_qadx+2)/ 0		/
+	DATA cv_lo_d2  (to_qadx+2)/ -1		/
+	DATA cv_hi_d2  (to_qadx+2)/ 0		/
+	DATA cv_lo_d3  (to_qadx+2)/ 0		/
+	DATA cv_hi_d3  (to_qadx+2)/ 0		/
+	DATA cv_lo_d4  (to_qadx+2)/ 0		/
+	DATA cv_hi_d4  (to_qadx+2)/ 0		/
+	DATA cv_lo_d5  (to_qadx+2)/ 0		/
+	DATA cv_hi_d5  (to_qadx+2)/ 0		/
+	DATA cv_lo_d6  (to_qadx+2)/ 0		/
+	DATA cv_hi_d6  (to_qadx+2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qady+1)/ cat_file_var	/
+	DATA cv_variable (to_qady+1)/ ptemp		/
+	DATA cv_lo_d1  (to_qady+1)/ 0		/
+	DATA cv_hi_d1  (to_qady+1)/ 0		/
+	DATA cv_lo_d2  (to_qady+1)/ -1		/
+	DATA cv_hi_d2  (to_qady+1)/ +1		/
+	DATA cv_lo_d3  (to_qady+1)/ 0		/
+	DATA cv_hi_d3  (to_qady+1)/ 0		/
+	DATA cv_lo_d4  (to_qady+1)/ 0		/
+	DATA cv_hi_d4  (to_qady+1)/ 0		/
+	DATA cv_lo_d5  (to_qady+1)/ 0		/
+	DATA cv_hi_d5  (to_qady+1)/ 0		/
+	DATA cv_lo_d6  (to_qady+1)/ 0		/
+	DATA cv_hi_d6  (to_qady+1)/ 0		/
+
+	DATA cv_category (to_qady+2)/ cat_file_var	/
+	DATA cv_variable (to_qady+2)/ pv		/
+	DATA cv_lo_d1  (to_qady+2)/ -1		/
+	DATA cv_hi_d1  (to_qady+2)/ 0		/
+	DATA cv_lo_d2  (to_qady+2)/ -1		/
+	DATA cv_hi_d2  (to_qady+2)/ 0		/
+	DATA cv_lo_d3  (to_qady+2)/ 0		/
+	DATA cv_hi_d3  (to_qady+2)/ 0		/
+	DATA cv_lo_d4  (to_qady+2)/ 0		/
+	DATA cv_hi_d4  (to_qady+2)/ 0		/
+	DATA cv_lo_d5  (to_qady+2)/ 0		/
+	DATA cv_hi_d5  (to_qady+2)/ 0		/
+	DATA cv_lo_d6  (to_qady+2)/ 0		/
+	DATA cv_hi_d6  (to_qady+2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qadz+1)/ cat_file_var	/
+	DATA cv_variable (to_qadz+1)/ ptemp		/
+	DATA cv_lo_d1  (to_qadz+1)/ 0		/
+	DATA cv_hi_d1  (to_qadz+1)/ 0		/
+	DATA cv_lo_d2  (to_qadz+1)/ 0		/
+	DATA cv_hi_d2  (to_qadz+1)/ 0		/
+	DATA cv_lo_d3  (to_qadz+1)/ -1		/
+	DATA cv_hi_d3  (to_qadz+1)/ +1		/
+	DATA cv_lo_d4  (to_qadz+1)/ 0		/
+	DATA cv_hi_d4  (to_qadz+1)/ 0		/
+	DATA cv_lo_d5  (to_qadz+1)/ 0		/
+	DATA cv_hi_d5  (to_qadz+1)/ 0		/
+	DATA cv_lo_d6  (to_qadz+1)/ 0		/
+	DATA cv_hi_d6  (to_qadz+1)/ 0		/
+
+	DATA cv_category (to_qadz+2)/ cat_file_var	/
+	DATA cv_variable (to_qadz+2)/ pw		/
+	DATA cv_lo_d1  (to_qadz+2)/ 0		/
+	DATA cv_hi_d1  (to_qadz+2)/ 0		/
+	DATA cv_lo_d2  (to_qadz+2)/ 0		/
+	DATA cv_hi_d2  (to_qadz+2)/ 0		/
+	DATA cv_lo_d3  (to_qadz+2)/ -1		/
+	DATA cv_hi_d3  (to_qadz+2)/ 0		/
+	DATA cv_lo_d4  (to_qadz+2)/ 0		/
+	DATA cv_hi_d4  (to_qadz+2)/ 0		/
+	DATA cv_lo_d5  (to_qadz+2)/ 0		/
+	DATA cv_hi_d5  (to_qadz+2)/ 0		/
+	DATA cv_lo_d6  (to_qadz+2)/ 0		/
+	DATA cv_hi_d6  (to_qadz+2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qad +1)/ cat_calc_var	/
+	DATA cv_variable (to_qad +1)/ pqadx		/
+	DATA cv_lo_d1  (to_qad +1)/ 0		/
+	DATA cv_hi_d1  (to_qad +1)/ 0		/
+	DATA cv_lo_d2  (to_qad +1)/ 0		/
+	DATA cv_hi_d2  (to_qad +1)/ 0		/
+	DATA cv_lo_d3  (to_qad +1)/ 0		/
+	DATA cv_hi_d3  (to_qad +1)/ 0		/
+	DATA cv_lo_d4  (to_qad +1)/ 0		/
+	DATA cv_hi_d4  (to_qad +1)/ 0		/
+	DATA cv_lo_d5  (to_qad +1)/ 0		/
+	DATA cv_hi_d5  (to_qad +1)/ 0		/
+	DATA cv_lo_d6  (to_qad +1)/ 0		/
+	DATA cv_hi_d6  (to_qad +1)/ 0		/
+
+	DATA cv_category (to_qad +2)/ cat_calc_var	/
+	DATA cv_variable (to_qad +2)/ pqady		/
+	DATA cv_lo_d1  (to_qad +2)/ 0		/
+	DATA cv_hi_d1  (to_qad +2)/ 0		/
+	DATA cv_lo_d2  (to_qad +2)/ 0		/
+	DATA cv_hi_d2  (to_qad +2)/ 0		/
+	DATA cv_lo_d3  (to_qad +2)/ 0		/
+	DATA cv_hi_d3  (to_qad +2)/ 0		/
+	DATA cv_lo_d4  (to_qad +2)/ 0		/
+	DATA cv_hi_d4  (to_qad +2)/ 0		/
+	DATA cv_lo_d5  (to_qad +2)/ 0		/
+	DATA cv_hi_d5  (to_qad +2)/ 0		/
+	DATA cv_lo_d6  (to_qad +2)/ 0		/
+	DATA cv_hi_d6  (to_qad +2)/ 0		/
+
+	DATA cv_category (to_qad +3)/ cat_calc_var	/
+	DATA cv_variable (to_qad +3)/ pqadz		/
+	DATA cv_lo_d1  (to_qad +3)/ 0		/
+	DATA cv_hi_d1  (to_qad +3)/ 0		/
+	DATA cv_lo_d2  (to_qad +3)/ 0		/
+	DATA cv_hi_d2  (to_qad +3)/ 0		/
+	DATA cv_lo_d3  (to_qad +3)/ 0		/
+	DATA cv_hi_d3  (to_qad +3)/ 0		/
+	DATA cv_lo_d4  (to_qad +3)/ 0		/
+	DATA cv_hi_d4  (to_qad +3)/ 0		/
+	DATA cv_lo_d5  (to_qad +3)/ 0		/
+	DATA cv_hi_d5  (to_qad +3)/ 0		/
+	DATA cv_lo_d6  (to_qad +3)/ 0		/
+	DATA cv_hi_d6  (to_qad +3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qdf +1)/ cat_calc_var	/
+	DATA cv_variable (to_qdf +1)/ pqdfh		/
+	DATA cv_lo_d1  (to_qdf +1)/ 0		/
+	DATA cv_hi_d1  (to_qdf +1)/ 0		/
+	DATA cv_lo_d2  (to_qdf +1)/ 0		/
+	DATA cv_hi_d2  (to_qdf +1)/ 0		/
+	DATA cv_lo_d3  (to_qdf +1)/ 0		/
+	DATA cv_hi_d3  (to_qdf +1)/ 0		/
+	DATA cv_lo_d4  (to_qdf +1)/ 0		/
+	DATA cv_hi_d4  (to_qdf +1)/ 0		/
+	DATA cv_lo_d5  (to_qdf +1)/ 0		/
+	DATA cv_hi_d5  (to_qdf +1)/ 0		/
+	DATA cv_lo_d6  (to_qdf +1)/ 0		/
+	DATA cv_hi_d6  (to_qdf +1)/ 0		/
+
+	DATA cv_category (to_qdf +2)/ cat_calc_var	/
+	DATA cv_variable (to_qdf +2)/ pqdfz		/
+	DATA cv_lo_d1  (to_qdf +2)/ 0		/
+	DATA cv_hi_d1  (to_qdf +2)/ 0		/
+	DATA cv_lo_d2  (to_qdf +2)/ 0		/
+	DATA cv_hi_d2  (to_qdf +2)/ 0		/
+	DATA cv_lo_d3  (to_qdf +2)/ 0		/
+	DATA cv_hi_d3  (to_qdf +2)/ 0		/
+	DATA cv_lo_d4  (to_qdf +2)/ 0		/
+	DATA cv_hi_d4  (to_qdf +2)/ 0		/
+	DATA cv_lo_d5  (to_qdf +2)/ 0		/
+	DATA cv_hi_d5  (to_qdf +2)/ 0		/
+	DATA cv_lo_d6  (to_qdf +2)/ 0		/
+	DATA cv_hi_d6  (to_qdf +2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qeva+1)/ cat_calc_var	/
+	DATA cv_variable (to_qeva+1)/ ptau		/
+	DATA cv_lo_d1  (to_qeva+1)/ 0		/
+	DATA cv_hi_d1  (to_qeva+1)/ 0		/
+	DATA cv_lo_d2  (to_qeva+1)/ 0		/
+	DATA cv_hi_d2  (to_qeva+1)/ 0		/
+	DATA cv_lo_d3  (to_qeva+1)/ 0		/
+	DATA cv_hi_d3  (to_qeva+1)/ 0		/
+	DATA cv_lo_d4  (to_qeva+1)/ 0		/
+	DATA cv_hi_d4  (to_qeva+1)/ 0		/
+	DATA cv_lo_d5  (to_qeva+1)/ 0		/
+	DATA cv_hi_d5  (to_qeva+1)/ 0		/
+	DATA cv_lo_d6  (to_qeva+1)/ 0		/
+	DATA cv_hi_d6  (to_qeva+1)/ 0		/
+
+	DATA cv_category (to_qeva+2)/ cat_file_var	/
+	DATA cv_variable (to_qeva+2)/ ptemp 		/
+	DATA cv_lo_d1  (to_qeva+2)/ 0		/
+	DATA cv_hi_d1  (to_qeva+2)/ 0		/
+	DATA cv_lo_d2  (to_qeva+2)/ 0		/
+	DATA cv_hi_d2  (to_qeva+2)/ 0		/
+	DATA cv_lo_d3  (to_qeva+2)/ 0		/
+	DATA cv_hi_d3  (to_qeva+2)/ 0		/
+	DATA cv_lo_d4  (to_qeva+2)/ 0		/
+	DATA cv_hi_d4  (to_qeva+2)/ 0		/
+	DATA cv_lo_d5  (to_qeva+2)/ 0		/
+	DATA cv_hi_d5  (to_qeva+2)/ 0		/
+	DATA cv_lo_d6  (to_qeva+2)/ 0		/
+	DATA cv_hi_d6  (to_qeva+2)/ 0		/
+
+	DATA cv_category (to_qeva+3)/ cat_calc_var	/
+	DATA cv_variable (to_qeva+3)/ pair		/
+	DATA cv_lo_d1  (to_qeva+3)/ 0		/
+	DATA cv_hi_d1  (to_qeva+3)/ 0		/
+	DATA cv_lo_d2  (to_qeva+3)/ 0		/
+	DATA cv_hi_d2  (to_qeva+3)/ 0		/
+	DATA cv_lo_d3  (to_qeva+3)/ 0		/
+	DATA cv_hi_d3  (to_qeva+3)/ 0		/
+	DATA cv_lo_d4  (to_qeva+3)/ 0		/
+	DATA cv_hi_d4  (to_qeva+3)/ 0		/
+	DATA cv_lo_d5  (to_qeva+3)/ 0		/
+	DATA cv_hi_d5  (to_qeva+3)/ 0		/
+	DATA cv_lo_d6  (to_qeva+3)/ 0		/
+	DATA cv_hi_d6  (to_qeva+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_tau +1)/ cat_file_var	/
+	DATA cv_variable (to_tau +1)/ ptaux		/
+	DATA cv_lo_d1  (to_tau +1)/ -1		/
+	DATA cv_hi_d1  (to_tau +1)/ 0		/
+	DATA cv_lo_d2  (to_tau +1)/ -1		/
+	DATA cv_hi_d2  (to_tau +1)/ 0		/
+	DATA cv_lo_d3  (to_tau +1)/ 0		/
+	DATA cv_hi_d3  (to_tau +1)/ 0		/
+	DATA cv_lo_d4  (to_tau +1)/ 0		/
+	DATA cv_hi_d4  (to_tau +1)/ 0		/
+	DATA cv_lo_d5  (to_tau +1)/ 0		/
+	DATA cv_hi_d5  (to_tau +1)/ 0		/
+	DATA cv_lo_d6  (to_tau +1)/ 0		/
+	DATA cv_hi_d6  (to_tau +1)/ 0		/
+
+	DATA cv_category (to_tau +2)/ cat_file_var	/
+	DATA cv_variable (to_tau +2)/ ptauy		/
+	DATA cv_lo_d1  (to_tau +2)/ -1		/
+	DATA cv_hi_d1  (to_tau +2)/ 0		/
+	DATA cv_lo_d2  (to_tau +2)/ -1		/
+	DATA cv_hi_d2  (to_tau +2)/ 0		/
+	DATA cv_lo_d3  (to_tau +2)/ 0		/
+	DATA cv_hi_d3  (to_tau +2)/ 0		/
+	DATA cv_lo_d4  (to_tau +2)/ 0		/
+	DATA cv_hi_d4  (to_tau +2)/ 0		/
+	DATA cv_lo_d5  (to_tau +2)/ 0		/
+	DATA cv_hi_d5  (to_tau +2)/ 0		/
+	DATA cv_lo_d6  (to_tau +2)/ 0		/
+	DATA cv_hi_d6  (to_tau +2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qsen+1)/ cat_calc_var	/
+	DATA cv_variable (to_qsen+1)/ ptau 		/
+	DATA cv_lo_d1  (to_qsen+1)/ 0		/
+	DATA cv_hi_d1  (to_qsen+1)/ 0		/
+	DATA cv_lo_d2  (to_qsen+1)/ 0		/
+	DATA cv_hi_d2  (to_qsen+1)/ 0		/
+	DATA cv_lo_d3  (to_qsen+1)/ 0		/
+	DATA cv_hi_d3  (to_qsen+1)/ 0		/
+	DATA cv_lo_d4  (to_qsen+1)/ 0		/
+	DATA cv_hi_d4  (to_qsen+1)/ 0		/
+	DATA cv_lo_d5  (to_qsen+1)/ 0		/
+	DATA cv_hi_d5  (to_qsen+1)/ 0		/
+	DATA cv_lo_d6  (to_qsen+1)/ 0		/
+	DATA cv_hi_d6  (to_qsen+1)/ 0		/
+
+	DATA cv_category (to_qsen+2)/ cat_file_var	/
+	DATA cv_variable (to_qsen+2)/ ptemp		/
+	DATA cv_lo_d1  (to_qsen+2)/ 0		/
+	DATA cv_hi_d1  (to_qsen+2)/ 0		/
+	DATA cv_lo_d2  (to_qsen+2)/ 0		/
+	DATA cv_hi_d2  (to_qsen+2)/ 0		/
+	DATA cv_lo_d3  (to_qsen+2)/ 0		/
+	DATA cv_hi_d3  (to_qsen+2)/ 0		/
+	DATA cv_lo_d4  (to_qsen+2)/ 0		/
+	DATA cv_hi_d4  (to_qsen+2)/ 0		/
+	DATA cv_lo_d5  (to_qsen+2)/ 0		/
+	DATA cv_hi_d5  (to_qsen+2)/ 0		/
+	DATA cv_lo_d6  (to_qsen+2)/ 0		/
+	DATA cv_hi_d6  (to_qsen+2)/ 0		/
+
+	DATA cv_category (to_qsen+3)/ cat_calc_var	/
+	DATA cv_variable (to_qsen+3)/ pair		/
+	DATA cv_lo_d1  (to_qsen+3)/ 0		/
+	DATA cv_hi_d1  (to_qsen+3)/ 0		/
+	DATA cv_lo_d2  (to_qsen+3)/ 0		/
+	DATA cv_hi_d2  (to_qsen+3)/ 0		/
+	DATA cv_lo_d3  (to_qsen+3)/ 0		/
+	DATA cv_hi_d3  (to_qsen+3)/ 0		/
+	DATA cv_lo_d4  (to_qsen+3)/ 0		/
+	DATA cv_hi_d4  (to_qsen+3)/ 0		/
+	DATA cv_lo_d5  (to_qsen+3)/ 0		/
+	DATA cv_hi_d5  (to_qsen+3)/ 0		/
+	DATA cv_lo_d6  (to_qsen+3)/ 0		/
+	DATA cv_hi_d6  (to_qsen+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qrad+1)/ cat_file_var	/
+	DATA cv_variable (to_qrad+1)/ ptemp_special	/
+	DATA cv_lo_d1  (to_qrad+1)/ 0		/
+	DATA cv_hi_d1  (to_qrad+1)/ 0		/
+	DATA cv_lo_d2  (to_qrad+1)/ 0		/
+	DATA cv_hi_d2  (to_qrad+1)/ 0		/
+	DATA cv_lo_d3  (to_qrad+1)/ 0		/	! SST
+	DATA cv_hi_d3  (to_qrad+1)/ 0		/	! SST
+	DATA cv_lo_d4  (to_qrad+1)/ 0		/
+	DATA cv_hi_d4  (to_qrad+1)/ 0		/
+	DATA cv_lo_d5  (to_qrad+1)/ 0		/
+	DATA cv_hi_d5  (to_qrad+1)/ 0		/
+	DATA cv_lo_d6  (to_qrad+1)/ 0		/
+	DATA cv_hi_d6  (to_qrad+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_qflx+1)/ cat_calc_var	/
+	DATA cv_variable (to_qflx+1)/ pqeva		/
+	DATA cv_lo_d1  (to_qflx+1)/ 0		/
+	DATA cv_hi_d1  (to_qflx+1)/ 0		/
+	DATA cv_lo_d2  (to_qflx+1)/ 0		/
+	DATA cv_hi_d2  (to_qflx+1)/ 0		/
+	DATA cv_lo_d3  (to_qflx+1)/ 0		/
+	DATA cv_hi_d3  (to_qflx+1)/ 0		/
+	DATA cv_lo_d4  (to_qflx+1)/ 0		/
+	DATA cv_hi_d4  (to_qflx+1)/ 0		/
+	DATA cv_lo_d5  (to_qflx+1)/ 0		/
+	DATA cv_hi_d5  (to_qflx+1)/ 0		/
+	DATA cv_lo_d6  (to_qflx+1)/ 0		/
+	DATA cv_hi_d6  (to_qflx+1)/ 0		/
+
+	DATA cv_category (to_qflx+2)/ cat_calc_var	/
+	DATA cv_variable (to_qflx+2)/ pqsen		/
+	DATA cv_lo_d1  (to_qflx+2)/ 0		/
+	DATA cv_hi_d1  (to_qflx+2)/ 0		/
+	DATA cv_lo_d2  (to_qflx+2)/ 0		/
+	DATA cv_hi_d2  (to_qflx+2)/ 0		/
+	DATA cv_lo_d3  (to_qflx+2)/ 0		/
+	DATA cv_hi_d3  (to_qflx+2)/ 0		/
+	DATA cv_lo_d4  (to_qflx+2)/ 0		/
+	DATA cv_hi_d4  (to_qflx+2)/ 0		/
+	DATA cv_lo_d5  (to_qflx+2)/ 0		/
+	DATA cv_hi_d5  (to_qflx+2)/ 0		/
+	DATA cv_lo_d6  (to_qflx+2)/ 0		/
+	DATA cv_hi_d6  (to_qflx+2)/ 0		/
+
+	DATA cv_category (to_qflx+3)/ cat_calc_var	/
+	DATA cv_variable (to_qflx+3)/ pqrad		/
+	DATA cv_lo_d1  (to_qflx+3)/ 0		/
+	DATA cv_hi_d1  (to_qflx+3)/ 0		/
+	DATA cv_lo_d2  (to_qflx+3)/ 0		/
+	DATA cv_hi_d2  (to_qflx+3)/ 0		/
+	DATA cv_lo_d3  (to_qflx+3)/ 0		/
+	DATA cv_hi_d3  (to_qflx+3)/ 0		/
+	DATA cv_lo_d4  (to_qflx+3)/ 0		/
+	DATA cv_hi_d4  (to_qflx+3)/ 0		/
+	DATA cv_lo_d5  (to_qflx+3)/ 0		/
+	DATA cv_hi_d5  (to_qflx+3)/ 0		/
+	DATA cv_lo_d6  (to_qflx+3)/ 0		/
+	DATA cv_hi_d6  (to_qflx+3)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_rho +1)/ cat_file_var	/
+	DATA cv_variable (to_rho +1)/ ptemp		/
+	DATA cv_lo_d1  (to_rho +1)/ 0		/
+	DATA cv_hi_d1  (to_rho +1)/ 0		/
+	DATA cv_lo_d2  (to_rho +1)/ 0		/
+	DATA cv_hi_d2  (to_rho +1)/ 0		/
+	DATA cv_lo_d3  (to_rho +1)/ 0		/
+	DATA cv_hi_d3  (to_rho +1)/ 0		/
+	DATA cv_lo_d4  (to_rho +1)/ 0		/
+	DATA cv_hi_d4  (to_rho +1)/ 0		/
+	DATA cv_lo_d5  (to_rho +1)/ 0		/
+	DATA cv_hi_d5  (to_rho +1)/ 0		/
+	DATA cv_lo_d6  (to_rho +1)/ 0		/
+	DATA cv_hi_d6  (to_rho +1)/ 0		/
+
+	DATA cv_category (to_rho +2)/ cat_file_var	/
+	DATA cv_variable (to_rho +2)/ psalt		/
+	DATA cv_lo_d1  (to_rho +2)/ 0		/
+	DATA cv_hi_d1  (to_rho +2)/ 0		/
+	DATA cv_lo_d2  (to_rho +2)/ 0		/
+	DATA cv_hi_d2  (to_rho +2)/ 0		/
+	DATA cv_lo_d3  (to_rho +2)/ 0		/
+	DATA cv_hi_d3  (to_rho +2)/ 0		/
+	DATA cv_lo_d4  (to_rho +2)/ 0		/
+	DATA cv_hi_d4  (to_rho +2)/ 0		/
+	DATA cv_lo_d5  (to_rho +2)/ 0		/
+	DATA cv_hi_d5  (to_rho +2)/ 0		/
+	DATA cv_lo_d6  (to_rho +2)/ 0		/
+	DATA cv_hi_d6  (to_rho +2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_dpdx+1)/ cat_calc_var	/
+	DATA cv_variable (to_dpdx+1)/ prho		/
+	DATA cv_lo_d1  (to_dpdx+1)/ 0		/
+	DATA cv_hi_d1  (to_dpdx+1)/ +1		/
+	DATA cv_lo_d2  (to_dpdx+1)/ 0		/
+	DATA cv_hi_d2  (to_dpdx+1)/ +1		/
+	DATA cv_lo_d3  (to_dpdx+1)/ 0		/	! needs k=1 absolute
+	DATA cv_hi_d3  (to_dpdx+1)/ 0		/
+	DATA cv_lo_d4  (to_dpdx+1)/ 0		/
+	DATA cv_hi_d4  (to_dpdx+1)/ 0		/
+	DATA cv_lo_d5  (to_dpdx+1)/ 0		/
+	DATA cv_hi_d5  (to_dpdx+1)/ 0		/
+	DATA cv_lo_d6  (to_dpdx+1)/ 0		/
+	DATA cv_hi_d6  (to_dpdx+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_dpdy+1)/ cat_calc_var	/
+	DATA cv_variable (to_dpdy+1)/ prho		/
+	DATA cv_lo_d1  (to_dpdy+1)/ 0		/
+	DATA cv_hi_d1  (to_dpdy+1)/ +1		/
+	DATA cv_lo_d2  (to_dpdy+1)/ 0		/
+	DATA cv_hi_d2  (to_dpdy+1)/ +1		/
+	DATA cv_lo_d3  (to_dpdy+1)/ 0		/	! needs k=1 absolute
+	DATA cv_hi_d3  (to_dpdy+1)/ 0		/
+	DATA cv_lo_d4  (to_dpdy+1)/ 0		/
+	DATA cv_hi_d4  (to_dpdy+1)/ 0		/
+	DATA cv_lo_d5  (to_dpdy+1)/ 0		/
+	DATA cv_hi_d5  (to_dpdy+1)/ 0		/
+	DATA cv_lo_d6  (to_dpdy+1)/ 0		/
+	DATA cv_hi_d6  (to_dpdy+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_w_u +1)/ cat_calc_var	/
+	DATA cv_variable (to_w_u +1)/ pfuw		/
+	DATA cv_lo_d1  (to_w_u +1)/ 0		/
+	DATA cv_hi_d1  (to_w_u +1)/ +1		/
+	DATA cv_lo_d2  (to_w_u +1)/ 0		/
+	DATA cv_hi_d2  (to_w_u +1)/ 0		/
+	DATA cv_lo_d3  (to_w_u +1)/ 0		/
+	DATA cv_hi_d3  (to_w_u +1)/ 0		/
+	DATA cv_lo_d4  (to_w_u +1)/ 0		/
+	DATA cv_hi_d4  (to_w_u +1)/ 0		/
+	DATA cv_lo_d5  (to_w_u +1)/ 0		/
+	DATA cv_hi_d5  (to_w_u +1)/ 0		/
+	DATA cv_lo_d6  (to_w_u +1)/ 0		/
+	DATA cv_hi_d6  (to_w_u +1)/ 0		/
+
+	DATA cv_category (to_w_u +2)/ cat_calc_var	/
+	DATA cv_variable (to_w_u +2)/ pfvn		/
+	DATA cv_lo_d1  (to_w_u +2)/ 0		/
+	DATA cv_hi_d1  (to_w_u +2)/ 0		/
+	DATA cv_lo_d2  (to_w_u +2)/ -1		/
+	DATA cv_hi_d2  (to_w_u +2)/ 0		/
+	DATA cv_lo_d3  (to_w_u +2)/ 0		/
+	DATA cv_hi_d3  (to_w_u +2)/ 0		/
+	DATA cv_lo_d4  (to_w_u +2)/ 0		/
+	DATA cv_hi_d4  (to_w_u +2)/ 0		/
+	DATA cv_lo_d5  (to_w_u +2)/ 0		/
+	DATA cv_hi_d5  (to_w_u +2)/ 0		/
+	DATA cv_lo_d6  (to_w_u +2)/ 0		/
+	DATA cv_hi_d6  (to_w_u +2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_uavz+1)/ cat_file_var	/
+	DATA cv_variable (to_uavz+1)/ ppsi		/
+	DATA cv_lo_d1  (to_uavz+1)/ 0		/
+	DATA cv_hi_d1  (to_uavz+1)/ +1		/
+	DATA cv_lo_d2  (to_uavz+1)/ 0		/
+	DATA cv_hi_d2  (to_uavz+1)/ +1		/
+	DATA cv_lo_d3  (to_uavz+1)/ 0		/
+	DATA cv_hi_d3  (to_uavz+1)/ 0		/
+	DATA cv_lo_d4  (to_uavz+1)/ 0		/
+	DATA cv_hi_d4  (to_uavz+1)/ 0		/
+	DATA cv_lo_d5  (to_uavz+1)/ 0		/
+	DATA cv_hi_d5  (to_uavz+1)/ 0		/
+	DATA cv_lo_d6  (to_uavz+1)/ 0		/
+	DATA cv_hi_d6  (to_uavz+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_vavz+1)/ cat_file_var	/
+	DATA cv_variable (to_vavz+1)/ ppsi		/
+	DATA cv_lo_d1  (to_vavz+1)/ 0		/
+	DATA cv_hi_d1  (to_vavz+1)/ +1		/
+	DATA cv_lo_d2  (to_vavz+1)/ 0		/
+	DATA cv_hi_d2  (to_vavz+1)/ +1		/
+	DATA cv_lo_d3  (to_vavz+1)/ 0		/
+	DATA cv_hi_d3  (to_vavz+1)/ 0		/
+	DATA cv_lo_d4  (to_vavz+1)/ 0		/
+	DATA cv_hi_d4  (to_vavz+1)/ 0		/
+	DATA cv_lo_d5  (to_vavz+1)/ 0		/
+	DATA cv_hi_d5  (to_vavz+1)/ 0		/
+	DATA cv_lo_d6  (to_vavz+1)/ 0		/
+	DATA cv_hi_d6  (to_vavz+1)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_fuw +1)/ cat_file_var	/
+	DATA cv_variable (to_fuw +1)/ ppsi		/
+	DATA cv_lo_d1  (to_fuw +1)/ -1		/	! extra for UAVZ
+	DATA cv_hi_d1  (to_fuw +1)/ +1		/	! extra for UAVZ
+	DATA cv_lo_d2  (to_fuw +1)/ 0		/
+	DATA cv_hi_d2  (to_fuw +1)/ +1		/
+	DATA cv_lo_d3  (to_fuw +1)/ 0		/
+	DATA cv_hi_d3  (to_fuw +1)/ 0		/
+	DATA cv_lo_d4  (to_fuw +1)/ 0		/
+	DATA cv_hi_d4  (to_fuw +1)/ 0		/
+	DATA cv_lo_d5  (to_fuw +1)/ 0		/
+	DATA cv_hi_d5  (to_fuw +1)/ 0		/
+	DATA cv_lo_d6  (to_fuw +1)/ 0		/
+	DATA cv_hi_d6  (to_fuw +1)/ 0		/
+
+	DATA cv_category (to_fuw +2)/ cat_calc_var	/
+	DATA cv_variable (to_fuw +2)/ puavz		/
+	DATA cv_lo_d1  (to_fuw +2)/ -1		/
+	DATA cv_hi_d1  (to_fuw +2)/ 0		/
+	DATA cv_lo_d2  (to_fuw +2)/ 0		/
+	DATA cv_hi_d2  (to_fuw +2)/ 0		/
+	DATA cv_lo_d3  (to_fuw +2)/ 0		/
+	DATA cv_hi_d3  (to_fuw +2)/ 0		/
+	DATA cv_lo_d4  (to_fuw +2)/ 0		/
+	DATA cv_hi_d4  (to_fuw +2)/ 0		/
+	DATA cv_lo_d5  (to_fuw +2)/ 0		/
+	DATA cv_hi_d5  (to_fuw +2)/ 0		/
+	DATA cv_lo_d6  (to_fuw +2)/ 0		/
+	DATA cv_hi_d6  (to_fuw +2)/ 0		/
+
+	DATA cv_category (to_fuw +3)/ cat_file_var	/
+	DATA cv_variable (to_fuw +3)/ pu		/
+	DATA cv_lo_d1  (to_fuw +3)/ -1		/
+	DATA cv_hi_d1  (to_fuw +3)/ 0		/
+	DATA cv_lo_d2  (to_fuw +3)/ 0		/
+	DATA cv_hi_d2  (to_fuw +3)/ 0		/
+	DATA cv_lo_d3  (to_fuw +3)/ 0		/
+	DATA cv_hi_d3  (to_fuw +3)/ 0		/
+	DATA cv_lo_d4  (to_fuw +3)/ 0		/
+	DATA cv_hi_d4  (to_fuw +3)/ 0		/
+	DATA cv_lo_d5  (to_fuw +3)/ 0		/
+	DATA cv_hi_d5  (to_fuw +3)/ 0		/
+	DATA cv_lo_d6  (to_fuw +3)/ 0		/
+	DATA cv_hi_d6  (to_fuw +3)/ 0		/
+
+***************************************************************************
+
+	DATA cv_category (to_fvn +1)/ cat_file_var	/
+	DATA cv_variable (to_fvn +1)/ ppsi		/
+	DATA cv_lo_d1  (to_fvn +1)/ 0		/
+	DATA cv_hi_d1  (to_fvn +1)/ +1		/
+	DATA cv_lo_d2  (to_fvn +1)/ 0		/	! extra for VAVZ
+	DATA cv_hi_d2  (to_fvn +1)/ +2		/	! extra for VAVZ
+	DATA cv_lo_d3  (to_fvn +1)/ 0		/
+	DATA cv_hi_d3  (to_fvn +1)/ 0		/
+	DATA cv_lo_d4  (to_fvn +1)/ 0		/
+	DATA cv_hi_d4  (to_fvn +1)/ 0		/
+	DATA cv_lo_d5  (to_fvn +1)/ 0		/
+	DATA cv_hi_d5  (to_fvn +1)/ 0		/
+	DATA cv_lo_d6  (to_fvn +1)/ 0		/
+	DATA cv_hi_d6  (to_fvn +1)/ 0		/
+
+	DATA cv_category (to_fvn +2)/ cat_calc_var	/
+	DATA cv_variable (to_fvn +2)/ pvavz		/
+	DATA cv_lo_d1  (to_fvn +2)/ 0		/
+	DATA cv_hi_d1  (to_fvn +2)/ 0		/
+	DATA cv_lo_d2  (to_fvn +2)/ 0		/
+	DATA cv_hi_d2  (to_fvn +2)/ +1		/
+	DATA cv_lo_d3  (to_fvn +2)/ 0		/
+	DATA cv_hi_d3  (to_fvn +2)/ 0		/
+	DATA cv_lo_d4  (to_fvn +2)/ 0		/
+	DATA cv_hi_d4  (to_fvn +2)/ 0		/
+	DATA cv_lo_d5  (to_fvn +2)/ 0		/
+	DATA cv_hi_d5  (to_fvn +2)/ 0		/
+	DATA cv_lo_d6  (to_fvn +2)/ 0		/
+	DATA cv_hi_d6  (to_fvn +2)/ 0		/
+
+	DATA cv_category (to_fvn +3)/ cat_file_var	/
+	DATA cv_variable (to_fvn +3)/ pv		/
+	DATA cv_lo_d1  (to_fvn +3)/ 0		/
+	DATA cv_hi_d1  (to_fvn +3)/ 0		/
+	DATA cv_lo_d2  (to_fvn +3)/ 0		/
+	DATA cv_hi_d2  (to_fvn +3)/ +1		/
+	DATA cv_lo_d3  (to_fvn +3)/ 0		/
+	DATA cv_hi_d3  (to_fvn +3)/ 0		/
+	DATA cv_lo_d4  (to_fvn +3)/ 0		/
+	DATA cv_hi_d4  (to_fvn +3)/ 0		/
+	DATA cv_lo_d5  (to_fvn +3)/ 0		/
+	DATA cv_hi_d5  (to_fvn +3)/ 0		/
+	DATA cv_lo_d6  (to_fvn +3)/ 0		/
+	DATA cv_hi_d6  (to_fvn +3)/ 0		/
+
+*****************************************************************************
+
+	DATA cv_category (to_uadx+1)/ cat_calc_var	/
+	DATA cv_variable (to_uadx+1)/ pfuw		/
+	DATA cv_lo_d1  (to_uadx+1)/ 0		/
+	DATA cv_hi_d1  (to_uadx+1)/ +1		/
+	DATA cv_lo_d2  (to_uadx+1)/ 0		/
+	DATA cv_hi_d2  (to_uadx+1)/ 0		/
+	DATA cv_lo_d3  (to_uadx+1)/ 0		/
+	DATA cv_hi_d3  (to_uadx+1)/ 0		/
+	DATA cv_lo_d4  (to_uadx+1)/ 0		/
+	DATA cv_hi_d4  (to_uadx+1)/ 0		/
+	DATA cv_lo_d5  (to_uadx+1)/ 0		/
+	DATA cv_hi_d5  (to_uadx+1)/ 0		/
+	DATA cv_lo_d6  (to_uadx+1)/ 0		/
+	DATA cv_hi_d6  (to_uadx+1)/ 0		/
+
+	DATA cv_category (to_uadx+2)/ cat_file_var	/
+	DATA cv_variable (to_uadx+2)/ pu		/
+	DATA cv_lo_d1  (to_uadx+2)/ -1		/
+	DATA cv_hi_d1  (to_uadx+2)/ +1		/
+	DATA cv_lo_d2  (to_uadx+2)/ 0		/
+	DATA cv_hi_d2  (to_uadx+2)/ 0		/
+	DATA cv_lo_d3  (to_uadx+2)/ 0		/
+	DATA cv_hi_d3  (to_uadx+2)/ 0		/
+	DATA cv_lo_d4  (to_uadx+2)/ 0		/
+	DATA cv_hi_d4  (to_uadx+2)/ 0		/
+	DATA cv_lo_d5  (to_uadx+2)/ 0		/
+	DATA cv_hi_d5  (to_uadx+2)/ 0		/
+	DATA cv_lo_d6  (to_uadx+2)/ 0		/
+	DATA cv_hi_d6  (to_uadx+2)/ 0		/
+
+*****************************************************************************
+
+	DATA cv_category (to_uady+1)/ cat_calc_var	/
+	DATA cv_variable (to_uady+1)/ pfvn		/
+	DATA cv_lo_d1  (to_uady+1)/ 0		/
+	DATA cv_hi_d1  (to_uady+1)/ 0		/
+	DATA cv_lo_d2  (to_uady+1)/ -1		/
+	DATA cv_hi_d2  (to_uady+1)/ 0		/
+	DATA cv_lo_d3  (to_uady+1)/ 0		/
+	DATA cv_hi_d3  (to_uady+1)/ 0		/
+	DATA cv_lo_d4  (to_uady+1)/ 0		/
+	DATA cv_hi_d4  (to_uady+1)/ 0		/
+	DATA cv_lo_d5  (to_uady+1)/ 0		/
+	DATA cv_hi_d5  (to_uady+1)/ 0		/
+	DATA cv_lo_d6  (to_uady+1)/ 0		/
+	DATA cv_hi_d6  (to_uady+1)/ 0		/
+
+	DATA cv_category (to_uady+2)/ cat_file_var	/
+	DATA cv_variable (to_uady+2)/ pu		/
+	DATA cv_lo_d1  (to_uady+2)/ 0		/
+	DATA cv_hi_d1  (to_uady+2)/ 0		/
+	DATA cv_lo_d2  (to_uady+2)/ -1		/
+	DATA cv_hi_d2  (to_uady+2)/ +1		/
+	DATA cv_lo_d3  (to_uady+2)/ 0		/
+	DATA cv_hi_d3  (to_uady+2)/ 0		/
+	DATA cv_lo_d4  (to_uady+2)/ 0		/
+	DATA cv_hi_d4  (to_uady+2)/ 0		/
+	DATA cv_lo_d5  (to_uady+2)/ 0		/
+	DATA cv_hi_d5  (to_uady+2)/ 0		/
+	DATA cv_lo_d6  (to_uady+2)/ 0		/
+	DATA cv_hi_d6  (to_uady+2)/ 0		/
+
+*****************************************************************************
+
+	DATA cv_category (to_uadz+1)/ cat_file_var	/
+	DATA cv_variable (to_uadz+1)/ pu		/
+	DATA cv_lo_d1  (to_uadz+1)/ 0		/
+	DATA cv_hi_d1  (to_uadz+1)/ 0		/
+	DATA cv_lo_d2  (to_uadz+1)/ 0		/
+	DATA cv_hi_d2  (to_uadz+1)/ 0		/
+	DATA cv_lo_d3  (to_uadz+1)/ -1		/
+	DATA cv_hi_d3  (to_uadz+1)/ +1		/
+	DATA cv_lo_d4  (to_uadz+1)/ 0		/
+	DATA cv_hi_d4  (to_uadz+1)/ 0		/
+	DATA cv_lo_d5  (to_uadz+1)/ 0		/
+	DATA cv_hi_d5  (to_uadz+1)/ 0		/
+	DATA cv_lo_d6  (to_uadz+1)/ 0		/
+	DATA cv_hi_d6  (to_uadz+1)/ 0		/
+
+	DATA cv_category (to_uadz+2)/ cat_calc_var	/
+	DATA cv_variable (to_uadz+2)/ pw_u		/
+	DATA cv_lo_d1  (to_uadz+2)/ 0		/
+	DATA cv_hi_d1  (to_uadz+2)/ 0		/
+	DATA cv_lo_d2  (to_uadz+2)/ 0		/
+	DATA cv_hi_d2  (to_uadz+2)/ 0		/
+	DATA cv_lo_d3  (to_uadz+2)/ -1		/
+	DATA cv_hi_d3  (to_uadz+2)/ 0		/
+	DATA cv_lo_d4  (to_uadz+2)/ 0		/
+	DATA cv_hi_d4  (to_uadz+2)/ 0		/
+	DATA cv_lo_d5  (to_uadz+2)/ 0		/
+	DATA cv_hi_d5  (to_uadz+2)/ 0		/
+	DATA cv_lo_d6  (to_uadz+2)/ 0		/
+	DATA cv_hi_d6  (to_uadz+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vadx+1)/ cat_calc_var	/
+	DATA cv_variable (to_vadx+1)/ pfuw		/
+	DATA cv_lo_d1  (to_vadx+1)/ 0		/
+	DATA cv_hi_d1  (to_vadx+1)/ +1		/
+	DATA cv_lo_d2  (to_vadx+1)/ 0		/
+	DATA cv_hi_d2  (to_vadx+1)/ 0		/
+	DATA cv_lo_d3  (to_vadx+1)/ 0		/
+	DATA cv_hi_d3  (to_vadx+1)/ 0		/
+	DATA cv_lo_d4  (to_vadx+1)/ 0		/
+	DATA cv_hi_d4  (to_vadx+1)/ 0		/
+	DATA cv_lo_d5  (to_vadx+1)/ 0		/
+	DATA cv_hi_d5  (to_vadx+1)/ 0		/
+	DATA cv_lo_d6  (to_vadx+1)/ 0		/
+	DATA cv_hi_d6  (to_vadx+1)/ 0		/
+
+	DATA cv_category (to_vadx+2)/ cat_file_var	/
+	DATA cv_variable (to_vadx+2)/ pv		/
+	DATA cv_lo_d1  (to_vadx+2)/ -1		/
+	DATA cv_hi_d1  (to_vadx+2)/ +1		/
+	DATA cv_lo_d2  (to_vadx+2)/ 0		/
+	DATA cv_hi_d2  (to_vadx+2)/ 0		/
+	DATA cv_lo_d3  (to_vadx+2)/ 0		/
+	DATA cv_hi_d3  (to_vadx+2)/ 0		/
+	DATA cv_lo_d4  (to_vadx+2)/ 0		/
+	DATA cv_hi_d4  (to_vadx+2)/ 0		/
+	DATA cv_lo_d5  (to_vadx+2)/ 0		/
+	DATA cv_hi_d5  (to_vadx+2)/ 0		/
+	DATA cv_lo_d6  (to_vadx+2)/ 0		/
+	DATA cv_hi_d6  (to_vadx+2)/ 0		/
+
+*****************************************************************************
+
+	DATA cv_category (to_vady+1)/ cat_calc_var	/
+	DATA cv_variable (to_vady+1)/ pfvn		/
+	DATA cv_lo_d1  (to_vady+1)/ 0		/
+	DATA cv_hi_d1  (to_vady+1)/ 0		/
+	DATA cv_lo_d2  (to_vady+1)/ -1		/
+	DATA cv_hi_d2  (to_vady+1)/ 0		/
+	DATA cv_lo_d3  (to_vady+1)/ 0		/
+	DATA cv_hi_d3  (to_vady+1)/ 0		/
+	DATA cv_lo_d4  (to_vady+1)/ 0		/
+	DATA cv_hi_d4  (to_vady+1)/ 0		/
+	DATA cv_lo_d5  (to_vady+1)/ 0		/
+	DATA cv_hi_d5  (to_vady+1)/ 0		/
+	DATA cv_lo_d6  (to_vady+1)/ 0		/
+	DATA cv_hi_d6  (to_vady+1)/ 0		/
+
+	DATA cv_category (to_vady+2)/ cat_file_var	/
+	DATA cv_variable (to_vady+2)/ pv		/
+	DATA cv_lo_d1  (to_vady+2)/ 0		/
+	DATA cv_hi_d1  (to_vady+2)/ 0		/
+	DATA cv_lo_d2  (to_vady+2)/ -1		/
+	DATA cv_hi_d2  (to_vady+2)/ +1		/
+	DATA cv_lo_d3  (to_vady+2)/ 0		/
+	DATA cv_hi_d3  (to_vady+2)/ 0		/
+	DATA cv_lo_d4  (to_vady+2)/ 0		/
+	DATA cv_hi_d4  (to_vady+2)/ 0		/
+	DATA cv_lo_d5  (to_vady+2)/ 0		/
+	DATA cv_hi_d5  (to_vady+2)/ 0		/
+	DATA cv_lo_d6  (to_vady+2)/ 0		/
+	DATA cv_hi_d6  (to_vady+2)/ 0		/
+
+*****************************************************************************
+
+	DATA cv_category (to_vadz+1)/ cat_file_var	/
+	DATA cv_variable (to_vadz+1)/ pv		/
+	DATA cv_lo_d1  (to_vadz+1)/ 0		/
+	DATA cv_hi_d1  (to_vadz+1)/ 0		/
+	DATA cv_lo_d2  (to_vadz+1)/ 0		/
+	DATA cv_hi_d2  (to_vadz+1)/ 0		/
+	DATA cv_lo_d3  (to_vadz+1)/ -1		/
+	DATA cv_hi_d3  (to_vadz+1)/ +1		/
+	DATA cv_lo_d4  (to_vadz+1)/ 0		/
+	DATA cv_hi_d4  (to_vadz+1)/ 0		/
+	DATA cv_lo_d5  (to_vadz+1)/ 0		/
+	DATA cv_hi_d5  (to_vadz+1)/ 0		/
+	DATA cv_lo_d6  (to_vadz+1)/ 0		/
+	DATA cv_hi_d6  (to_vadz+1)/ 0		/
+
+	DATA cv_category (to_vadz+2)/ cat_calc_var	/
+	DATA cv_variable (to_vadz+2)/ pw_u		/
+	DATA cv_lo_d1  (to_vadz+2)/ 0		/
+	DATA cv_hi_d1  (to_vadz+2)/ 0		/
+	DATA cv_lo_d2  (to_vadz+2)/ 0		/
+	DATA cv_hi_d2  (to_vadz+2)/ 0		/
+	DATA cv_lo_d3  (to_vadz+2)/ -1		/
+	DATA cv_hi_d3  (to_vadz+2)/ 0		/
+	DATA cv_lo_d4  (to_vadz+2)/ 0		/
+	DATA cv_hi_d4  (to_vadz+2)/ 0		/
+	DATA cv_lo_d5  (to_vadz+2)/ 0		/
+	DATA cv_hi_d5  (to_vadz+2)/ 0		/
+	DATA cv_lo_d6  (to_vadz+2)/ 0		/
+	DATA cv_hi_d6  (to_vadz+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_udfh+1)/ cat_file_var	/
+	DATA cv_variable (to_udfh+1)/ pu		/
+	DATA cv_lo_d1  (to_udfh+1)/ -1		/
+	DATA cv_hi_d1  (to_udfh+1)/ +1		/
+	DATA cv_lo_d2  (to_udfh+1)/ -1		/
+	DATA cv_hi_d2  (to_udfh+1)/ +1		/
+	DATA cv_lo_d3  (to_udfh+1)/ 0		/
+	DATA cv_hi_d3  (to_udfh+1)/ 0		/
+	DATA cv_lo_d4  (to_udfh+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_udfh+1)/ 0		/
+	DATA cv_lo_d5  (to_udfh+1)/ 0		/
+	DATA cv_hi_d5  (to_udfh+1)/ 0		/
+	DATA cv_lo_d6  (to_udfh+1)/ 0		/
+	DATA cv_hi_d6  (to_udfh+1)/ 0		/
+
+	DATA cv_category (to_udfh+2)/ cat_file_var	/
+	DATA cv_variable (to_udfh+2)/ pv		/
+	DATA cv_lo_d1  (to_udfh+2)/ -1		/
+	DATA cv_hi_d1  (to_udfh+2)/ +1		/
+	DATA cv_lo_d2  (to_udfh+2)/ -1		/
+	DATA cv_hi_d2  (to_udfh+2)/ +1		/
+	DATA cv_lo_d3  (to_udfh+2)/ 0		/
+	DATA cv_hi_d3  (to_udfh+2)/ 0		/
+	DATA cv_lo_d4  (to_udfh+2)/ 0		/
+	DATA cv_hi_d4  (to_udfh+2)/ 0		/
+	DATA cv_lo_d5  (to_udfh+2)/ 0		/
+	DATA cv_hi_d5  (to_udfh+2)/ 0		/
+	DATA cv_lo_d6  (to_udfh+2)/ 0		/
+	DATA cv_hi_d6  (to_udfh+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_udfz+1)/ cat_calc_var	/
+	DATA cv_variable (to_udfz+1)/ ppcdz		/
+	DATA cv_lo_d1  (to_udfz+1)/ 0		/
+	DATA cv_hi_d1  (to_udfz+1)/ 0		/
+	DATA cv_lo_d2  (to_udfz+1)/ 0		/
+	DATA cv_hi_d2  (to_udfz+1)/ 0		/
+	DATA cv_lo_d3  (to_udfz+1)/ -1		/
+	DATA cv_hi_d3  (to_udfz+1)/ 0		/
+	DATA cv_lo_d4  (to_udfz+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_udfz+1)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_udfz+1)/ 0		/
+	DATA cv_hi_d5  (to_udfz+1)/ 0		/
+	DATA cv_lo_d6  (to_udfz+1)/ 0		/
+	DATA cv_hi_d6  (to_udfz+1)/ 0		/
+
+	DATA cv_category (to_udfz+2)/ cat_file_var	/
+	DATA cv_variable (to_udfz+2)/ pu		/
+	DATA cv_lo_d1  (to_udfz+2)/ 0		/
+	DATA cv_hi_d1  (to_udfz+2)/ 0		/
+	DATA cv_lo_d2  (to_udfz+2)/ 0		/
+	DATA cv_hi_d2  (to_udfz+2)/ 0		/
+	DATA cv_lo_d3  (to_udfz+2)/ -1		/
+	DATA cv_hi_d3  (to_udfz+2)/ +1		/
+	DATA cv_lo_d4  (to_udfz+2)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_udfz+2)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_udfz+2)/ 0		/
+	DATA cv_hi_d5  (to_udfz+2)/ 0		/
+	DATA cv_lo_d6  (to_udfz+2)/ 0		/
+	DATA cv_hi_d6  (to_udfz+2)/ 0		/
+
+	DATA cv_category (to_udfz+3)/ cat_calc_var	/
+	DATA cv_variable (to_udfz+3)/ pubwi		/
+	DATA cv_lo_d1  (to_udfz+3)/ 0		/
+	DATA cv_hi_d1  (to_udfz+3)/ 0		/
+	DATA cv_lo_d2  (to_udfz+3)/ 0		/
+	DATA cv_hi_d2  (to_udfz+3)/ 0		/
+	DATA cv_lo_d3  (to_udfz+3)/ 0		/
+	DATA cv_hi_d3  (to_udfz+3)/ 0		/
+	DATA cv_lo_d4  (to_udfz+3)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_udfz+3)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_udfz+3)/ 0		/
+	DATA cv_hi_d5  (to_udfz+3)/ 0		/
+	DATA cv_lo_d6  (to_udfz+3)/ 0		/
+	DATA cv_hi_d6  (to_udfz+3)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vdfh+1)/ cat_file_var	/
+	DATA cv_variable (to_vdfh+1)/ pv		/
+	DATA cv_lo_d1  (to_vdfh+1)/ -1		/
+	DATA cv_hi_d1  (to_vdfh+1)/ +1		/
+	DATA cv_lo_d2  (to_vdfh+1)/ -1		/
+	DATA cv_hi_d2  (to_vdfh+1)/ +1		/
+	DATA cv_lo_d3  (to_vdfh+1)/ 0		/
+	DATA cv_hi_d3  (to_vdfh+1)/ 0		/
+	DATA cv_lo_d4  (to_vdfh+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_vdfh+1)/ 0		/
+	DATA cv_lo_d5  (to_vdfh+1)/ 0		/
+	DATA cv_hi_d5  (to_vdfh+1)/ 0		/
+	DATA cv_lo_d6  (to_vdfh+1)/ 0		/
+	DATA cv_hi_d6  (to_vdfh+1)/ 0		/
+
+	DATA cv_category (to_vdfh+2)/ cat_file_var	/
+	DATA cv_variable (to_vdfh+2)/ pu		/
+	DATA cv_lo_d1  (to_vdfh+2)/ -1		/
+	DATA cv_hi_d1  (to_vdfh+2)/ +1		/
+	DATA cv_lo_d2  (to_vdfh+2)/ -1		/
+	DATA cv_hi_d2  (to_vdfh+2)/ +1		/
+	DATA cv_lo_d3  (to_vdfh+2)/ 0		/
+	DATA cv_hi_d3  (to_vdfh+2)/ 0		/
+	DATA cv_lo_d4  (to_vdfh+2)/ 0		/
+	DATA cv_hi_d4  (to_vdfh+2)/ 0		/
+	DATA cv_lo_d5  (to_vdfh+2)/ 0		/
+	DATA cv_hi_d5  (to_vdfh+2)/ 0		/
+	DATA cv_lo_d6  (to_vdfh+2)/ 0		/
+	DATA cv_hi_d6  (to_vdfh+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vdfz+1)/ cat_calc_var	/
+	DATA cv_variable (to_vdfz+1)/ ppcdz		/
+	DATA cv_lo_d1  (to_vdfz+1)/ 0		/
+	DATA cv_hi_d1  (to_vdfz+1)/ 0		/
+	DATA cv_lo_d2  (to_vdfz+1)/ 0		/
+	DATA cv_hi_d2  (to_vdfz+1)/ 0		/
+	DATA cv_lo_d3  (to_vdfz+1)/ -1		/
+	DATA cv_hi_d3  (to_vdfz+1)/ 0		/
+	DATA cv_lo_d4  (to_vdfz+1)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_vdfz+1)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_vdfz+1)/ 0		/
+	DATA cv_hi_d5  (to_vdfz+1)/ 0		/
+	DATA cv_lo_d6  (to_vdfz+1)/ 0		/
+	DATA cv_hi_d6  (to_vdfz+1)/ 0		/
+
+	DATA cv_category (to_vdfz+2)/ cat_file_var	/
+	DATA cv_variable (to_vdfz+2)/ pv		/
+	DATA cv_lo_d1  (to_vdfz+2)/ 0		/
+	DATA cv_hi_d1  (to_vdfz+2)/ 0		/
+	DATA cv_lo_d2  (to_vdfz+2)/ 0		/
+	DATA cv_hi_d2  (to_vdfz+2)/ 0		/
+	DATA cv_lo_d3  (to_vdfz+2)/ -1		/
+	DATA cv_hi_d3  (to_vdfz+2)/ +1		/
+	DATA cv_lo_d4  (to_vdfz+2)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_vdfz+2)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_vdfz+2)/ 0		/
+	DATA cv_hi_d5  (to_vdfz+2)/ 0		/
+	DATA cv_lo_d6  (to_vdfz+2)/ 0		/
+	DATA cv_hi_d6  (to_vdfz+2)/ 0		/
+
+	DATA cv_category (to_vdfz+3)/ cat_calc_var	/
+	DATA cv_variable (to_vdfz+3)/ pvbwi		/
+	DATA cv_lo_d1  (to_vdfz+3)/ 0		/
+	DATA cv_hi_d1  (to_vdfz+3)/ 0		/
+	DATA cv_lo_d2  (to_vdfz+3)/ 0		/
+	DATA cv_hi_d2  (to_vdfz+3)/ 0		/
+	DATA cv_lo_d3  (to_vdfz+3)/ 0		/
+	DATA cv_hi_d3  (to_vdfz+3)/ 0		/
+	DATA cv_lo_d4  (to_vdfz+3)/ ptstep_1hr_b4	/
+	DATA cv_hi_d4  (to_vdfz+3)/ ptstep_1hr_b4	/
+	DATA cv_lo_d5  (to_vdfz+3)/ 0		/
+	DATA cv_hi_d5  (to_vdfz+3)/ 0		/
+	DATA cv_lo_d6  (to_vdfz+3)/ 0		/
+	DATA cv_hi_d6  (to_vdfz+3)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ucoi+1)/ cat_file_var	/
+	DATA cv_variable (to_ucoi+1)/ ptemp		/
+	DATA cv_lo_d1  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d1  (to_ucoi+1)/ 0		/
+	DATA cv_lo_d2  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d2  (to_ucoi+1)/ 0		/
+	DATA cv_lo_d3  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d3  (to_ucoi+1)/ 0		/
+	DATA cv_lo_d4  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d4  (to_ucoi+1)/ 0		/
+	DATA cv_lo_d5  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d5  (to_ucoi+1)/ 0		/
+	DATA cv_lo_d6  (to_ucoi+1)/ 0		/
+	DATA cv_hi_d6  (to_ucoi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vcoi+1)/ cat_file_var	/
+	DATA cv_variable (to_vcoi+1)/ ptemp		/
+	DATA cv_lo_d1  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d1  (to_vcoi+1)/ 0		/
+	DATA cv_lo_d2  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d2  (to_vcoi+1)/ 0		/
+	DATA cv_lo_d3  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d3  (to_vcoi+1)/ 0		/
+	DATA cv_lo_d4  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d4  (to_vcoi+1)/ 0		/
+	DATA cv_lo_d5  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d5  (to_vcoi+1)/ 0		/
+	DATA cv_lo_d6  (to_vcoi+1)/ 0		/
+	DATA cv_hi_d6  (to_vcoi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ubpi+1)/ cat_calc_var	/
+	DATA cv_variable (to_ubpi+1)/ pdpdx		/
+	DATA cv_lo_d1  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d1  (to_ubpi+1)/ 0		/
+	DATA cv_lo_d2  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d2  (to_ubpi+1)/ 0		/
+	DATA cv_lo_d3  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d3  (to_ubpi+1)/ 0		/
+	DATA cv_lo_d4  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d4  (to_ubpi+1)/ 0		/
+	DATA cv_lo_d5  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d5  (to_ubpi+1)/ 0		/
+	DATA cv_lo_d6  (to_ubpi+1)/ 0		/
+	DATA cv_hi_d6  (to_ubpi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vbpi+1)/ cat_calc_var	/
+	DATA cv_variable (to_vbpi+1)/ pdpdy		/
+	DATA cv_lo_d1  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d1  (to_vbpi+1)/ 0		/
+	DATA cv_lo_d2  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d2  (to_vbpi+1)/ 0		/
+	DATA cv_lo_d3  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d3  (to_vbpi+1)/ 0		/
+	DATA cv_lo_d4  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d4  (to_vbpi+1)/ 0		/
+	DATA cv_lo_d5  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d5  (to_vbpi+1)/ 0		/
+	DATA cv_lo_d6  (to_vbpi+1)/ 0		/
+	DATA cv_hi_d6  (to_vbpi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ubwi+1)/ cat_file_var	/
+	DATA cv_variable (to_ubwi+1)/ ptaux		/
+	DATA cv_lo_d1  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d1  (to_ubwi+1)/ 0		/
+	DATA cv_lo_d2  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d2  (to_ubwi+1)/ 0		/
+	DATA cv_lo_d3  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d3  (to_ubwi+1)/ 0		/
+	DATA cv_lo_d4  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d4  (to_ubwi+1)/ 0		/
+	DATA cv_lo_d5  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d5  (to_ubwi+1)/ 0		/
+	DATA cv_lo_d6  (to_ubwi+1)/ 0		/
+	DATA cv_hi_d6  (to_ubwi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vbwi+1)/ cat_file_var	/
+	DATA cv_variable (to_vbwi+1)/ ptauy		/
+	DATA cv_lo_d1  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d1  (to_vbwi+1)/ 0		/
+	DATA cv_lo_d2  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d2  (to_vbwi+1)/ 0		/
+	DATA cv_lo_d3  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d3  (to_vbwi+1)/ 0		/
+	DATA cv_lo_d4  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d4  (to_vbwi+1)/ 0		/
+	DATA cv_lo_d5  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d5  (to_vbwi+1)/ 0		/
+	DATA cv_lo_d6  (to_vbwi+1)/ 0		/
+	DATA cv_hi_d6  (to_vbwi+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ucoe+1)/ cat_file_var	/
+	DATA cv_variable (to_ucoe+1)/ pu		/
+	DATA cv_lo_d1  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d1  (to_ucoe+1)/ 0		/
+	DATA cv_lo_d2  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d2  (to_ucoe+1)/ 0		/
+	DATA cv_lo_d3  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d3  (to_ucoe+1)/ 0		/
+	DATA cv_lo_d4  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d4  (to_ucoe+1)/ 0		/
+	DATA cv_lo_d5  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d5  (to_ucoe+1)/ 0		/
+	DATA cv_lo_d6  (to_ucoe+1)/ 0		/
+	DATA cv_hi_d6  (to_ucoe+1)/ 0		/
+
+	DATA cv_category (to_ucoe+2)/ cat_file_var	/
+	DATA cv_variable (to_ucoe+2)/ pv		/
+	DATA cv_lo_d1  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d1  (to_ucoe+2)/ 0		/
+	DATA cv_lo_d2  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d2  (to_ucoe+2)/ 0		/
+	DATA cv_lo_d3  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d3  (to_ucoe+2)/ 0		/
+	DATA cv_lo_d4  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d4  (to_ucoe+2)/ 0		/
+	DATA cv_lo_d5  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d5  (to_ucoe+2)/ 0		/
+	DATA cv_lo_d6  (to_ucoe+2)/ 0		/
+	DATA cv_hi_d6  (to_ucoe+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vcoe+1)/ cat_file_var	/
+	DATA cv_variable (to_vcoe+1)/ pu		/
+	DATA cv_lo_d1  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d1  (to_vcoe+1)/ 0		/
+	DATA cv_lo_d2  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d2  (to_vcoe+1)/ 0		/
+	DATA cv_lo_d3  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d3  (to_vcoe+1)/ 0		/
+	DATA cv_lo_d4  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d4  (to_vcoe+1)/ 0		/
+	DATA cv_lo_d5  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d5  (to_vcoe+1)/ 0		/
+	DATA cv_lo_d6  (to_vcoe+1)/ 0		/
+	DATA cv_hi_d6  (to_vcoe+1)/ 0		/
+
+	DATA cv_category (to_vcoe+2)/ cat_file_var	/
+	DATA cv_variable (to_vcoe+2)/ pv		/
+	DATA cv_lo_d1  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d1  (to_vcoe+2)/ 0		/
+	DATA cv_lo_d2  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d2  (to_vcoe+2)/ 0		/
+	DATA cv_lo_d3  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d3  (to_vcoe+2)/ 0		/
+	DATA cv_lo_d4  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d4  (to_vcoe+2)/ 0		/
+	DATA cv_lo_d5  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d5  (to_vcoe+2)/ 0		/
+	DATA cv_lo_d6  (to_vcoe+2)/ 0		/
+	DATA cv_hi_d6  (to_vcoe+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_uad +1)/ cat_calc_var	/
+	DATA cv_variable (to_uad +1)/ puadx		/
+	DATA cv_lo_d1  (to_uad +1)/ 0		/
+	DATA cv_hi_d1  (to_uad +1)/ 0		/
+	DATA cv_lo_d2  (to_uad +1)/ 0		/
+	DATA cv_hi_d2  (to_uad +1)/ 0		/
+	DATA cv_lo_d3  (to_uad +1)/ 0		/
+	DATA cv_hi_d3  (to_uad +1)/ 0		/
+	DATA cv_lo_d4  (to_uad +1)/ 0		/
+	DATA cv_hi_d4  (to_uad +1)/ 0		/
+	DATA cv_lo_d5  (to_uad +1)/ 0		/
+	DATA cv_hi_d5  (to_uad +1)/ 0		/
+	DATA cv_lo_d6  (to_uad +1)/ 0		/
+	DATA cv_hi_d6  (to_uad +1)/ 0		/
+
+	DATA cv_category (to_uad +2)/ cat_calc_var	/
+	DATA cv_variable (to_uad +2)/ puady		/
+	DATA cv_lo_d1  (to_uad +2)/ 0		/
+	DATA cv_hi_d1  (to_uad +2)/ 0		/
+	DATA cv_lo_d2  (to_uad +2)/ 0		/
+	DATA cv_hi_d2  (to_uad +2)/ 0		/
+	DATA cv_lo_d3  (to_uad +2)/ 0		/
+	DATA cv_hi_d3  (to_uad +2)/ 0		/
+	DATA cv_lo_d4  (to_uad +2)/ 0		/
+	DATA cv_hi_d4  (to_uad +2)/ 0		/
+	DATA cv_lo_d5  (to_uad +2)/ 0		/
+	DATA cv_hi_d5  (to_uad +2)/ 0		/
+	DATA cv_lo_d6  (to_uad +2)/ 0		/
+	DATA cv_hi_d6  (to_uad +2)/ 0		/
+
+	DATA cv_category (to_uad +3)/ cat_calc_var	/
+	DATA cv_variable (to_uad +3)/ puadz		/
+	DATA cv_lo_d1  (to_uad +3)/ 0		/
+	DATA cv_hi_d1  (to_uad +3)/ 0		/
+	DATA cv_lo_d2  (to_uad +3)/ 0		/
+	DATA cv_hi_d2  (to_uad +3)/ 0		/
+	DATA cv_lo_d3  (to_uad +3)/ 0		/
+	DATA cv_hi_d3  (to_uad +3)/ 0		/
+	DATA cv_lo_d4  (to_uad +3)/ 0		/
+	DATA cv_hi_d4  (to_uad +3)/ 0		/
+	DATA cv_lo_d5  (to_uad +3)/ 0		/
+	DATA cv_hi_d5  (to_uad +3)/ 0		/
+	DATA cv_lo_d6  (to_uad +3)/ 0		/
+	DATA cv_hi_d6  (to_uad +3)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vad +1)/ cat_calc_var	/
+	DATA cv_variable (to_vad +1)/ pvadx		/
+	DATA cv_lo_d1  (to_vad +1)/ 0		/
+	DATA cv_hi_d1  (to_vad +1)/ 0		/
+	DATA cv_lo_d2  (to_vad +1)/ 0		/
+	DATA cv_hi_d2  (to_vad +1)/ 0		/
+	DATA cv_lo_d3  (to_vad +1)/ 0		/
+	DATA cv_hi_d3  (to_vad +1)/ 0		/
+	DATA cv_lo_d4  (to_vad +1)/ 0		/
+	DATA cv_hi_d4  (to_vad +1)/ 0		/
+	DATA cv_lo_d5  (to_vad +1)/ 0		/
+	DATA cv_hi_d5  (to_vad +1)/ 0		/
+	DATA cv_lo_d6  (to_vad +1)/ 0		/
+	DATA cv_hi_d6  (to_vad +1)/ 0		/
+
+	DATA cv_category (to_vad +2)/ cat_calc_var	/
+	DATA cv_variable (to_vad +2)/ pvady		/
+	DATA cv_lo_d1  (to_vad +2)/ 0		/
+	DATA cv_hi_d1  (to_vad +2)/ 0		/
+	DATA cv_lo_d2  (to_vad +2)/ 0		/
+	DATA cv_hi_d2  (to_vad +2)/ 0		/
+	DATA cv_lo_d3  (to_vad +2)/ 0		/
+	DATA cv_hi_d3  (to_vad +2)/ 0		/
+	DATA cv_lo_d4  (to_vad +2)/ 0		/
+	DATA cv_hi_d4  (to_vad +2)/ 0		/
+	DATA cv_lo_d5  (to_vad +2)/ 0		/
+	DATA cv_hi_d5  (to_vad +2)/ 0		/
+	DATA cv_lo_d6  (to_vad +2)/ 0		/
+	DATA cv_hi_d6  (to_vad +2)/ 0		/
+
+	DATA cv_category (to_vad +3)/ cat_calc_var	/
+	DATA cv_variable (to_vad +3)/ pvadz		/
+	DATA cv_lo_d1  (to_vad +3)/ 0		/
+	DATA cv_hi_d1  (to_vad +3)/ 0		/
+	DATA cv_lo_d2  (to_vad +3)/ 0		/
+	DATA cv_hi_d2  (to_vad +3)/ 0		/
+	DATA cv_lo_d3  (to_vad +3)/ 0		/
+	DATA cv_hi_d3  (to_vad +3)/ 0		/
+	DATA cv_lo_d4  (to_vad +3)/ 0		/
+	DATA cv_hi_d4  (to_vad +3)/ 0		/
+	DATA cv_lo_d5  (to_vad +3)/ 0		/
+	DATA cv_hi_d5  (to_vad +3)/ 0		/
+	DATA cv_lo_d6  (to_vad +3)/ 0		/
+	DATA cv_hi_d6  (to_vad +3)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_udf +1)/ cat_calc_var	/
+	DATA cv_variable (to_udf +1)/ pudfh		/
+	DATA cv_lo_d1  (to_udf +1)/ 0		/
+	DATA cv_hi_d1  (to_udf +1)/ 0		/
+	DATA cv_lo_d2  (to_udf +1)/ 0		/
+	DATA cv_hi_d2  (to_udf +1)/ 0		/
+	DATA cv_lo_d3  (to_udf +1)/ 0		/
+	DATA cv_hi_d3  (to_udf +1)/ 0		/
+	DATA cv_lo_d4  (to_udf +1)/ 0		/
+	DATA cv_hi_d4  (to_udf +1)/ 0		/
+	DATA cv_lo_d5  (to_udf +1)/ 0		/
+	DATA cv_hi_d5  (to_udf +1)/ 0		/
+	DATA cv_lo_d6  (to_udf +1)/ 0		/
+	DATA cv_hi_d6  (to_udf +1)/ 0		/
+
+	DATA cv_category (to_udf +2)/ cat_calc_var	/
+	DATA cv_variable (to_udf +2)/ pudfz		/
+	DATA cv_lo_d1  (to_udf +2)/ 0		/
+	DATA cv_hi_d1  (to_udf +2)/ 0		/
+	DATA cv_lo_d2  (to_udf +2)/ 0		/
+	DATA cv_hi_d2  (to_udf +2)/ 0		/
+	DATA cv_lo_d3  (to_udf +2)/ 0		/
+	DATA cv_hi_d3  (to_udf +2)/ 0		/
+	DATA cv_lo_d4  (to_udf +2)/ 0		/
+	DATA cv_hi_d4  (to_udf +2)/ 0		/
+	DATA cv_lo_d5  (to_udf +2)/ 0		/
+	DATA cv_hi_d5  (to_udf +2)/ 0		/
+	DATA cv_lo_d6  (to_udf +2)/ 0		/
+	DATA cv_hi_d6  (to_udf +2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vdf +1)/ cat_calc_var	/
+	DATA cv_variable (to_vdf +1)/ pvdfh		/
+	DATA cv_lo_d1  (to_vdf +1)/ 0		/
+	DATA cv_hi_d1  (to_vdf +1)/ 0		/
+	DATA cv_lo_d2  (to_vdf +1)/ 0		/
+	DATA cv_hi_d2  (to_vdf +1)/ 0		/
+	DATA cv_lo_d3  (to_vdf +1)/ 0		/
+	DATA cv_hi_d3  (to_vdf +1)/ 0		/
+	DATA cv_lo_d4  (to_vdf +1)/ 0		/
+	DATA cv_hi_d4  (to_vdf +1)/ 0		/
+	DATA cv_lo_d5  (to_vdf +1)/ 0		/
+	DATA cv_hi_d5  (to_vdf +1)/ 0		/
+	DATA cv_lo_d6  (to_vdf +1)/ 0		/
+	DATA cv_hi_d6  (to_vdf +1)/ 0		/
+
+	DATA cv_category (to_vdf +2)/ cat_calc_var	/
+	DATA cv_variable (to_vdf +2)/ pvdfz		/
+	DATA cv_lo_d1  (to_vdf +2)/ 0		/
+	DATA cv_hi_d1  (to_vdf +2)/ 0		/
+	DATA cv_lo_d2  (to_vdf +2)/ 0		/
+	DATA cv_hi_d2  (to_vdf +2)/ 0		/
+	DATA cv_lo_d3  (to_vdf +2)/ 0		/
+	DATA cv_hi_d3  (to_vdf +2)/ 0		/
+	DATA cv_lo_d4  (to_vdf +2)/ 0		/
+	DATA cv_hi_d4  (to_vdf +2)/ 0		/
+	DATA cv_lo_d5  (to_vdf +2)/ 0		/
+	DATA cv_hi_d5  (to_vdf +2)/ 0		/
+	DATA cv_lo_d6  (to_vdf +2)/ 0		/
+	DATA cv_hi_d6  (to_vdf +2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_dudt+1)/ cat_file_var	/
+	DATA cv_variable (to_dudt+1)/ pu   		/
+	DATA cv_lo_d1  (to_dudt+1)/ 0		/
+	DATA cv_hi_d1  (to_dudt+1)/ 0		/
+	DATA cv_lo_d2  (to_dudt+1)/ 0		/
+	DATA cv_hi_d2  (to_dudt+1)/ 0		/
+	DATA cv_lo_d3  (to_dudt+1)/ 0		/
+	DATA cv_hi_d3  (to_dudt+1)/ 0		/
+	DATA cv_lo_d4  (to_dudt+1)/ -1		/
+	DATA cv_hi_d4  (to_dudt+1)/ +1		/
+	DATA cv_lo_d5  (to_dudt+1)/ 0		/
+	DATA cv_hi_d5  (to_dudt+1)/ 0		/
+	DATA cv_lo_d6  (to_dudt+1)/ 0		/
+	DATA cv_hi_d6  (to_dudt+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_dvdt+1)/ cat_file_var	/
+	DATA cv_variable (to_dvdt+1)/ pv   		/
+	DATA cv_lo_d1  (to_dvdt+1)/ 0		/
+	DATA cv_hi_d1  (to_dvdt+1)/ 0		/
+	DATA cv_lo_d2  (to_dvdt+1)/ 0		/
+	DATA cv_hi_d2  (to_dvdt+1)/ 0		/
+	DATA cv_lo_d3  (to_dvdt+1)/ 0		/
+	DATA cv_hi_d3  (to_dvdt+1)/ 0		/
+	DATA cv_lo_d4  (to_dvdt+1)/ -1		/
+	DATA cv_hi_d4  (to_dvdt+1)/ +1		/
+	DATA cv_lo_d5  (to_dvdt+1)/ 0		/
+	DATA cv_hi_d5  (to_dvdt+1)/ 0		/
+	DATA cv_lo_d6  (to_dvdt+1)/ 0		/
+	DATA cv_hi_d6  (to_dvdt+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_dwdt+1)/ cat_file_var	/
+	DATA cv_variable (to_dwdt+1)/ pw   		/
+	DATA cv_lo_d1  (to_dwdt+1)/ 0		/
+	DATA cv_hi_d1  (to_dwdt+1)/ 0		/
+	DATA cv_lo_d2  (to_dwdt+1)/ 0		/
+	DATA cv_hi_d2  (to_dwdt+1)/ 0		/
+	DATA cv_lo_d3  (to_dwdt+1)/ 0		/
+	DATA cv_hi_d3  (to_dwdt+1)/ 0		/
+	DATA cv_lo_d4  (to_dwdt+1)/ -1		/
+	DATA cv_hi_d4  (to_dwdt+1)/ +1		/
+	DATA cv_lo_d5  (to_dwdt+1)/ 0		/
+	DATA cv_hi_d5  (to_dwdt+1)/ 0		/
+	DATA cv_lo_d6  (to_dwdt+1)/ 0		/
+	DATA cv_hi_d6  (to_dwdt+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_dtdt+1)/ cat_file_var	/
+	DATA cv_variable (to_dtdt+1)/ ptemp		/
+	DATA cv_lo_d1  (to_dtdt+1)/ 0		/
+	DATA cv_hi_d1  (to_dtdt+1)/ 0		/
+	DATA cv_lo_d2  (to_dtdt+1)/ 0		/
+	DATA cv_hi_d2  (to_dtdt+1)/ 0		/
+	DATA cv_lo_d3  (to_dtdt+1)/ 0		/
+	DATA cv_hi_d3  (to_dtdt+1)/ 0		/
+	DATA cv_lo_d4  (to_dtdt+1)/ -1		/
+	DATA cv_hi_d4  (to_dtdt+1)/ +1		/
+	DATA cv_lo_d5  (to_dtdt+1)/ 0		/
+	DATA cv_hi_d5  (to_dtdt+1)/ 0		/
+	DATA cv_lo_d6  (to_dtdt+1)/ 0		/
+	DATA cv_hi_d6  (to_dtdt+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ubps+1)/ cat_calc_var	/
+	DATA cv_variable (to_ubps+1)/ pudf		/
+	DATA cv_lo_d1  (to_ubps+1)/ 0		/
+	DATA cv_hi_d1  (to_ubps+1)/ 0		/
+	DATA cv_lo_d2  (to_ubps+1)/ 0		/
+	DATA cv_hi_d2  (to_ubps+1)/ 0		/
+	DATA cv_lo_d3  (to_ubps+1)/ 0		/
+	DATA cv_hi_d3  (to_ubps+1)/ 0		/
+	DATA cv_lo_d4  (to_ubps+1)/ 0		/
+	DATA cv_hi_d4  (to_ubps+1)/ 0		/
+	DATA cv_lo_d5  (to_ubps+1)/ 0		/
+	DATA cv_hi_d5  (to_ubps+1)/ 0		/
+	DATA cv_lo_d6  (to_ubps+1)/ 0		/
+	DATA cv_hi_d6  (to_ubps+1)/ 0		/
+
+	DATA cv_category (to_ubps+2)/ cat_calc_var	/
+	DATA cv_variable (to_ubps+2)/ puad		/
+	DATA cv_lo_d1  (to_ubps+2)/ 0		/
+	DATA cv_hi_d1  (to_ubps+2)/ 0		/
+	DATA cv_lo_d2  (to_ubps+2)/ 0		/
+	DATA cv_hi_d2  (to_ubps+2)/ 0		/
+	DATA cv_lo_d3  (to_ubps+2)/ 0		/
+	DATA cv_hi_d3  (to_ubps+2)/ 0		/
+	DATA cv_lo_d4  (to_ubps+2)/ 0		/
+	DATA cv_hi_d4  (to_ubps+2)/ 0		/
+	DATA cv_lo_d5  (to_ubps+2)/ 0		/
+	DATA cv_hi_d5  (to_ubps+2)/ 0		/
+	DATA cv_lo_d6  (to_ubps+2)/ 0		/
+	DATA cv_hi_d6  (to_ubps+2)/ 0		/
+
+	DATA cv_category (to_ubps+3)/ cat_calc_var	/
+	DATA cv_variable (to_ubps+3)/ pucoe		/
+	DATA cv_lo_d1  (to_ubps+3)/ 0		/
+	DATA cv_hi_d1  (to_ubps+3)/ 0		/
+	DATA cv_lo_d2  (to_ubps+3)/ 0		/
+	DATA cv_hi_d2  (to_ubps+3)/ 0		/
+	DATA cv_lo_d3  (to_ubps+3)/ 0		/
+	DATA cv_hi_d3  (to_ubps+3)/ 0		/
+	DATA cv_lo_d4  (to_ubps+3)/ 0		/
+	DATA cv_hi_d4  (to_ubps+3)/ 0		/
+	DATA cv_lo_d5  (to_ubps+3)/ 0		/
+	DATA cv_hi_d5  (to_ubps+3)/ 0		/
+	DATA cv_lo_d6  (to_ubps+3)/ 0		/
+	DATA cv_hi_d6  (to_ubps+3)/ 0		/
+
+	DATA cv_category (to_ubps+4)/ cat_calc_var	/
+	DATA cv_variable (to_ubps+4)/ pubpi		/
+	DATA cv_lo_d1  (to_ubps+4)/ 0		/
+	DATA cv_hi_d1  (to_ubps+4)/ 0		/
+	DATA cv_lo_d2  (to_ubps+4)/ 0		/
+	DATA cv_hi_d2  (to_ubps+4)/ 0		/
+	DATA cv_lo_d3  (to_ubps+4)/ 0		/
+	DATA cv_hi_d3  (to_ubps+4)/ 0		/
+	DATA cv_lo_d4  (to_ubps+4)/ 0		/
+	DATA cv_hi_d4  (to_ubps+4)/ 0		/
+	DATA cv_lo_d5  (to_ubps+4)/ 0		/
+	DATA cv_hi_d5  (to_ubps+4)/ 0		/
+	DATA cv_lo_d6  (to_ubps+4)/ 0		/
+	DATA cv_hi_d6  (to_ubps+4)/ 0		/
+
+	DATA cv_category (to_ubps+5)/ cat_calc_var	/
+	DATA cv_variable (to_ubps+5)/ pdudt		/
+	DATA cv_lo_d1  (to_ubps+5)/ 0		/
+	DATA cv_hi_d1  (to_ubps+5)/ 0		/
+	DATA cv_lo_d2  (to_ubps+5)/ 0		/
+	DATA cv_hi_d2  (to_ubps+5)/ 0		/
+	DATA cv_lo_d3  (to_ubps+5)/ 0		/
+	DATA cv_hi_d3  (to_ubps+5)/ 0		/
+	DATA cv_lo_d4  (to_ubps+5)/ 0		/
+	DATA cv_hi_d4  (to_ubps+5)/ 0		/
+	DATA cv_lo_d5  (to_ubps+5)/ 0		/
+	DATA cv_hi_d5  (to_ubps+5)/ 0		/
+	DATA cv_lo_d6  (to_ubps+5)/ 0		/
+	DATA cv_hi_d6  (to_ubps+5)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vbps+1)/ cat_calc_var	/
+	DATA cv_variable (to_vbps+1)/ pvdf		/
+	DATA cv_lo_d1  (to_vbps+1)/ 0		/
+	DATA cv_hi_d1  (to_vbps+1)/ 0		/
+	DATA cv_lo_d2  (to_vbps+1)/ 0		/
+	DATA cv_hi_d2  (to_vbps+1)/ 0		/
+	DATA cv_lo_d3  (to_vbps+1)/ 0		/
+	DATA cv_hi_d3  (to_vbps+1)/ 0		/
+	DATA cv_lo_d4  (to_vbps+1)/ 0		/
+	DATA cv_hi_d4  (to_vbps+1)/ 0		/
+	DATA cv_lo_d5  (to_vbps+1)/ 0		/
+	DATA cv_hi_d5  (to_vbps+1)/ 0		/
+	DATA cv_lo_d6  (to_vbps+1)/ 0		/
+	DATA cv_hi_d6  (to_vbps+1)/ 0		/
+
+	DATA cv_category (to_vbps+2)/ cat_calc_var	/
+	DATA cv_variable (to_vbps+2)/ pvad		/
+	DATA cv_lo_d1  (to_vbps+2)/ 0		/
+	DATA cv_hi_d1  (to_vbps+2)/ 0		/
+	DATA cv_lo_d2  (to_vbps+2)/ 0		/
+	DATA cv_hi_d2  (to_vbps+2)/ 0		/
+	DATA cv_lo_d3  (to_vbps+2)/ 0		/
+	DATA cv_hi_d3  (to_vbps+2)/ 0		/
+	DATA cv_lo_d4  (to_vbps+2)/ 0		/
+	DATA cv_hi_d4  (to_vbps+2)/ 0		/
+	DATA cv_lo_d5  (to_vbps+2)/ 0		/
+	DATA cv_hi_d5  (to_vbps+2)/ 0		/
+	DATA cv_lo_d6  (to_vbps+2)/ 0		/
+	DATA cv_hi_d6  (to_vbps+2)/ 0		/
+
+	DATA cv_category (to_vbps+3)/ cat_calc_var	/
+	DATA cv_variable (to_vbps+3)/ pvcoe		/
+	DATA cv_lo_d1  (to_vbps+3)/ 0		/
+	DATA cv_hi_d1  (to_vbps+3)/ 0		/
+	DATA cv_lo_d2  (to_vbps+3)/ 0		/
+	DATA cv_hi_d2  (to_vbps+3)/ 0		/
+	DATA cv_lo_d3  (to_vbps+3)/ 0		/
+	DATA cv_hi_d3  (to_vbps+3)/ 0		/
+	DATA cv_lo_d4  (to_vbps+3)/ 0		/
+	DATA cv_hi_d4  (to_vbps+3)/ 0		/
+	DATA cv_lo_d5  (to_vbps+3)/ 0		/
+	DATA cv_hi_d5  (to_vbps+3)/ 0		/
+	DATA cv_lo_d6  (to_vbps+3)/ 0		/
+	DATA cv_hi_d6  (to_vbps+3)/ 0		/
+
+	DATA cv_category (to_vbps+4)/ cat_calc_var	/
+	DATA cv_variable (to_vbps+4)/ pvbpi		/
+	DATA cv_lo_d1  (to_vbps+4)/ 0		/
+	DATA cv_hi_d1  (to_vbps+4)/ 0		/
+	DATA cv_lo_d2  (to_vbps+4)/ 0		/
+	DATA cv_hi_d2  (to_vbps+4)/ 0		/
+	DATA cv_lo_d3  (to_vbps+4)/ 0		/
+	DATA cv_hi_d3  (to_vbps+4)/ 0		/
+	DATA cv_lo_d4  (to_vbps+4)/ 0		/
+	DATA cv_hi_d4  (to_vbps+4)/ 0		/
+	DATA cv_lo_d5  (to_vbps+4)/ 0		/
+	DATA cv_hi_d5  (to_vbps+4)/ 0		/
+	DATA cv_lo_d6  (to_vbps+4)/ 0		/
+	DATA cv_hi_d6  (to_vbps+4)/ 0		/
+
+	DATA cv_category (to_vbps+5)/ cat_calc_var	/
+	DATA cv_variable (to_vbps+5)/ pdvdt		/
+	DATA cv_lo_d1  (to_vbps+5)/ 0		/
+	DATA cv_hi_d1  (to_vbps+5)/ 0		/
+	DATA cv_lo_d2  (to_vbps+5)/ 0		/
+	DATA cv_hi_d2  (to_vbps+5)/ 0		/
+	DATA cv_lo_d3  (to_vbps+5)/ 0		/
+	DATA cv_hi_d3  (to_vbps+5)/ 0		/
+	DATA cv_lo_d4  (to_vbps+5)/ 0		/
+	DATA cv_hi_d4  (to_vbps+5)/ 0		/
+	DATA cv_lo_d5  (to_vbps+5)/ 0		/
+	DATA cv_hi_d5  (to_vbps+5)/ 0		/
+	DATA cv_lo_d6  (to_vbps+5)/ 0		/
+	DATA cv_hi_d6  (to_vbps+5)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_sali+1)/ cat_file_var	/
+	DATA cv_variable (to_sali+1)/ psalt		/
+	DATA cv_lo_d1  (to_sali+1)/ 0		/
+	DATA cv_hi_d1  (to_sali+1)/ 0		/
+	DATA cv_lo_d2  (to_sali+1)/ 0		/
+	DATA cv_hi_d2  (to_sali+1)/ 0		/
+	DATA cv_lo_d3  (to_sali+1)/ 0		/
+	DATA cv_hi_d3  (to_sali+1)/ 0		/
+	DATA cv_lo_d4  (to_sali+1)/ 0		/
+	DATA cv_hi_d4  (to_sali+1)/ 0		/
+	DATA cv_lo_d5  (to_sali+1)/ 0		/
+	DATA cv_hi_d5  (to_sali+1)/ 0		/
+	DATA cv_lo_d6  (to_sali+1)/ 0		/
+	DATA cv_hi_d6  (to_sali+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_dens+1)/ cat_file_var	/
+	DATA cv_variable (to_dens+1)/ ptemp		/
+	DATA cv_lo_d1  (to_dens+1)/ 0		/
+	DATA cv_hi_d1  (to_dens+1)/ 0		/
+	DATA cv_lo_d2  (to_dens+1)/ 0		/
+	DATA cv_hi_d2  (to_dens+1)/ 0		/
+	DATA cv_lo_d3  (to_dens+1)/ 0		/
+	DATA cv_hi_d3  (to_dens+1)/ 0		/
+	DATA cv_lo_d4  (to_dens+1)/ 0		/
+	DATA cv_hi_d4  (to_dens+1)/ 0		/
+	DATA cv_lo_d5  (to_dens+1)/ 0		/
+	DATA cv_hi_d5  (to_dens+1)/ 0		/
+	DATA cv_lo_d6  (to_dens+1)/ 0		/
+	DATA cv_hi_d6  (to_dens+1)/ 0		/
+
+	DATA cv_category (to_dens+2)/ cat_file_var	/
+	DATA cv_variable (to_dens+2)/ psalt		/
+	DATA cv_lo_d1  (to_dens+2)/ 0		/
+	DATA cv_hi_d1  (to_dens+2)/ 0		/
+	DATA cv_lo_d2  (to_dens+2)/ 0		/
+	DATA cv_hi_d2  (to_dens+2)/ 0		/
+	DATA cv_lo_d3  (to_dens+2)/ 0		/
+	DATA cv_hi_d3  (to_dens+2)/ 0		/
+	DATA cv_lo_d4  (to_dens+2)/ 0		/
+	DATA cv_hi_d4  (to_dens+2)/ 0		/
+	DATA cv_lo_d5  (to_dens+2)/ 0		/
+	DATA cv_hi_d5  (to_dens+2)/ 0		/
+	DATA cv_lo_d6  (to_dens+2)/ 0		/
+	DATA cv_hi_d6  (to_dens+2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_ubp +1)/ cat_calc_var	/
+	DATA cv_variable (to_ubp +1)/ pubpi		/
+	DATA cv_lo_d1  (to_ubp +1)/ 0		/
+	DATA cv_hi_d1  (to_ubp +1)/ 0		/
+	DATA cv_lo_d2  (to_ubp +1)/ 0		/
+	DATA cv_hi_d2  (to_ubp +1)/ 0		/
+	DATA cv_lo_d3  (to_ubp +1)/ 0	/
+	DATA cv_hi_d3  (to_ubp +1)/ 0	/
+	DATA cv_lo_d4  (to_ubp +1)/ 0		/
+	DATA cv_hi_d4  (to_ubp +1)/ 0		/
+	DATA cv_lo_d5  (to_ubp +1)/ 0		/
+	DATA cv_hi_d5  (to_ubp +1)/ 0		/
+	DATA cv_lo_d6  (to_ubp +1)/ 0		/
+	DATA cv_hi_d6  (to_ubp +1)/ 0		/
+
+	DATA cv_category (to_ubp +2)/ cat_calc_var	/
+	DATA cv_variable (to_ubp +2)/ pubps		/
+	DATA cv_lo_d1  (to_ubp +2)/ 0		/
+	DATA cv_hi_d1  (to_ubp +2)/ 0		/
+	DATA cv_lo_d2  (to_ubp +2)/ 0		/
+	DATA cv_hi_d2  (to_ubp +2)/ 0		/
+	DATA cv_lo_d3  (to_ubp +2)/ 0		/
+	DATA cv_hi_d3  (to_ubp +2)/ 0		/
+	DATA cv_lo_d4  (to_ubp +2)/ 0		/
+	DATA cv_hi_d4  (to_ubp +2)/ 0		/
+	DATA cv_lo_d5  (to_ubp +2)/ 0		/
+	DATA cv_hi_d5  (to_ubp +2)/ 0		/
+	DATA cv_lo_d6  (to_ubp +2)/ 0		/
+	DATA cv_hi_d6  (to_ubp +2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_vbp +1)/ cat_calc_var	/
+	DATA cv_variable (to_vbp +1)/ pvbpi		/
+	DATA cv_lo_d1  (to_vbp +1)/ 0		/
+	DATA cv_hi_d1  (to_vbp +1)/ 0		/
+	DATA cv_lo_d2  (to_vbp +1)/ 0		/
+	DATA cv_hi_d2  (to_vbp +1)/ 0		/
+	DATA cv_lo_d3  (to_vbp +1)/ 0	/
+	DATA cv_hi_d3  (to_vbp +1)/ 0	/
+	DATA cv_lo_d4  (to_vbp +1)/ 0		/
+	DATA cv_hi_d4  (to_vbp +1)/ 0		/
+	DATA cv_lo_d5  (to_vbp +1)/ 0		/
+	DATA cv_hi_d5  (to_vbp +1)/ 0		/
+	DATA cv_lo_d6  (to_vbp +1)/ 0		/
+	DATA cv_hi_d6  (to_vbp +1)/ 0		/
+
+	DATA cv_category (to_vbp +2)/ cat_calc_var	/
+	DATA cv_variable (to_vbp +2)/ pvbps		/
+	DATA cv_lo_d1  (to_vbp +2)/ 0		/
+	DATA cv_hi_d1  (to_vbp +2)/ 0		/
+	DATA cv_lo_d2  (to_vbp +2)/ 0		/
+	DATA cv_hi_d2  (to_vbp +2)/ 0		/
+	DATA cv_lo_d3  (to_vbp +2)/ 0		/
+	DATA cv_hi_d3  (to_vbp +2)/ 0		/
+	DATA cv_lo_d4  (to_vbp +2)/ 0		/
+	DATA cv_hi_d4  (to_vbp +2)/ 0		/
+	DATA cv_lo_d5  (to_vbp +2)/ 0		/
+	DATA cv_hi_d5  (to_vbp +2)/ 0		/
+	DATA cv_lo_d6  (to_vbp +2)/ 0		/
+	DATA cv_hi_d6  (to_vbp +2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_cmsk+1)/ cat_file_var	/
+	DATA cv_variable (to_cmsk+1)/ ptemp		/
+	DATA cv_lo_d1  (to_cmsk+1)/ 0		/
+	DATA cv_hi_d1  (to_cmsk+1)/ 0		/
+	DATA cv_lo_d2  (to_cmsk+1)/ 0		/
+	DATA cv_hi_d2  (to_cmsk+1)/ 0		/
+	DATA cv_lo_d3  (to_cmsk+1)/ -1		/
+	DATA cv_hi_d3  (to_cmsk+1)/ +1		/
+	DATA cv_lo_d4  (to_cmsk+1)/ 0		/
+	DATA cv_hi_d4  (to_cmsk+1)/ 0		/
+	DATA cv_lo_d5  (to_cmsk+1)/ 0		/
+	DATA cv_hi_d5  (to_cmsk+1)/ 0		/
+	DATA cv_lo_d6  (to_cmsk+1)/ 0		/
+	DATA cv_hi_d6  (to_cmsk+1)/ 0		/
+
+	DATA cv_category (to_cmsk+2)/ cat_file_var	/
+	DATA cv_variable (to_cmsk+2)/ psalt		/
+	DATA cv_lo_d1  (to_cmsk+2)/ 0		/
+	DATA cv_hi_d1  (to_cmsk+2)/ 0		/
+	DATA cv_lo_d2  (to_cmsk+2)/ 0		/
+	DATA cv_hi_d2  (to_cmsk+2)/ 0		/
+	DATA cv_lo_d3  (to_cmsk+2)/ -1		/
+	DATA cv_hi_d3  (to_cmsk+2)/ +1		/
+	DATA cv_lo_d4  (to_cmsk+2)/ 0 		/
+	DATA cv_hi_d4  (to_cmsk+2)/ 0 		/
+	DATA cv_lo_d5  (to_cmsk+2)/ 0		/
+	DATA cv_hi_d5  (to_cmsk+2)/ 0		/
+	DATA cv_lo_d6  (to_cmsk+2)/ 0		/
+	DATA cv_hi_d6  (to_cmsk+2)/ 0		/
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	DATA cv_category (to_w_t +1)/ cat_file_var	/
+	DATA cv_variable (to_w_t +1)/ pu		/
+	DATA cv_lo_d1  (to_w_t +1)/ -1		/
+	DATA cv_hi_d1  (to_w_t +1)/ 0		/
+	DATA cv_lo_d2  (to_w_t +1)/ -1		/
+	DATA cv_hi_d2  (to_w_t +1)/ 0		/
+	DATA cv_lo_d3  (to_w_t +1)/ 0		/
+	DATA cv_hi_d3  (to_w_t +1)/ 0		/
+	DATA cv_lo_d4  (to_w_t +1)/ 0		/
+	DATA cv_hi_d4  (to_w_t +1)/ 0		/
+	DATA cv_lo_d5  (to_w_t +1)/ 0		/
+	DATA cv_hi_d5  (to_w_t +1)/ 0		/
+	DATA cv_lo_d6  (to_w_t +1)/ 0		/
+	DATA cv_hi_d6  (to_w_t +1)/ 0		/
+
+	DATA cv_category (to_w_t +2)/ cat_file_var	/
+	DATA cv_variable (to_w_t +2)/ pv		/
+	DATA cv_lo_d1  (to_w_t +2)/ -1		/
+	DATA cv_hi_d1  (to_w_t +2)/ 0		/
+	DATA cv_lo_d2  (to_w_t +2)/ -1		/
+	DATA cv_hi_d2  (to_w_t +2)/ 0		/
+	DATA cv_lo_d3  (to_w_t +2)/ 0		/
+	DATA cv_hi_d3  (to_w_t +2)/ 0		/
+	DATA cv_lo_d4  (to_w_t +2)/ 0		/
+	DATA cv_hi_d4  (to_w_t +2)/ 0		/
+	DATA cv_lo_d5  (to_w_t +2)/ 0		/
+	DATA cv_hi_d5  (to_w_t +2)/ 0		/
+	DATA cv_lo_d6  (to_w_t +2)/ 0		/
+	DATA cv_hi_d6  (to_w_t +2)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_cair+1)/ cat_file_var	/
+	DATA cv_variable (to_cair+1)/ pairt_special	/
+	DATA cv_lo_d1  (to_cair+1)/ 0		/
+	DATA cv_hi_d1  (to_cair+1)/ 0		/
+	DATA cv_lo_d2  (to_cair+1)/ 0		/
+	DATA cv_hi_d2  (to_cair+1)/ 0		/
+	DATA cv_lo_d3  (to_cair+1)/ 0		/
+	DATA cv_hi_d3  (to_cair+1)/ 0		/
+	DATA cv_lo_d4  (to_cair+1)/ 0		/
+	DATA cv_hi_d4  (to_cair+1)/ 0		/
+	DATA cv_lo_d5  (to_cair+1)/ 0		/
+	DATA cv_hi_d5  (to_cair+1)/ 0		/
+	DATA cv_lo_d6  (to_cair+1)/ 0		/
+	DATA cv_hi_d6  (to_cair+1)/ 0		/
+
+**************************************************************************
+
+	DATA cv_category (to_air +1)/ cat_file_var	/
+	DATA cv_variable (to_air +1)/ ptemp		/
+	DATA cv_lo_d1  (to_air +1)/ 0		/
+	DATA cv_hi_d1  (to_air +1)/ 0		/
+	DATA cv_lo_d2  (to_air +1)/ 0		/
+	DATA cv_hi_d2  (to_air +1)/ 0		/
+	DATA cv_lo_d3  (to_air +1)/ 0		/
+	DATA cv_hi_d3  (to_air +1)/ 0		/
+	DATA cv_lo_d4  (to_air +1)/ 0		/
+	DATA cv_hi_d4  (to_air +1)/ 0		/
+	DATA cv_lo_d5  (to_air +1)/ 0		/
+	DATA cv_hi_d5  (to_air +1)/ 0		/
+	DATA cv_lo_d6  (to_air +1)/ 0		/
+	DATA cv_hi_d6  (to_air +1)/ 0		/
+
+	DATA cv_category (to_air +2)/ cat_calc_var	/
+	DATA cv_variable (to_air +2)/ pcair_special	/
+	DATA cv_lo_d1  (to_air +2)/ 0		/
+	DATA cv_hi_d1  (to_air +2)/ 0		/
+	DATA cv_lo_d2  (to_air +2)/ 0		/
+	DATA cv_hi_d2  (to_air +2)/ 0		/
+	DATA cv_lo_d3  (to_air +2)/ 0		/
+	DATA cv_hi_d3  (to_air +2)/ 0		/
+	DATA cv_lo_d4  (to_air +2)/ 0		/
+	DATA cv_hi_d4  (to_air +2)/ 0		/
+	DATA cv_lo_d5  (to_air +2)/ 0		/
+	DATA cv_hi_d5  (to_air +2)/ 0		/
+	DATA cv_lo_d6  (to_air +2)/ 0		/
+	DATA cv_hi_d6  (to_air +2)/ 0		/
+
+	END
diff --git a/fer/dat/xcommand_data.F b/fer/dat/xcommand_data.F
new file mode 100644
index 0000000..98616ea
--- /dev/null
+++ b/fer/dat/xcommand_data.F
@@ -0,0 +1,1814 @@
+	BLOCK DATA XCOMMAND_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* command names, subcommands and qualifiers
+* numbers of subcommands and qualifiers is determined by COMMON/XCOMMAND/
+* see XCOMMAND.CMN for instructions on adding new options
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 3/20/86
+* V200:   7/5/89 - added CANCEL VARIABLE
+*	  9/1/89 - added CANC DATA/ALL,SET VAR and SET DATA/many_options
+*	 1/22/90 - added USER command
+*	  1/8/90 - added command aliases (LET and FILE)
+*	 5/17/90 - added PLOT/SYMBOL and PLOT/LINE
+*	  7/6/90 - added LIST/SINGLY
+*	 8/29/90 - added LIST/EPKEY=EPIC_key_number
+*	 8/31/90 - added SET MOVIE/START=
+* Unix/RISC port - 2/91 - cant use "/star" in documentation
+*		 - also fixed two doubly defined cells qualifiers()
+*		   at nqual_at2o+1 and nqual_at10d+4
+* V230: 1/3/92  - added SHOW TRANSFORMS
+*       1/27/92 - added aliases QUIT, DATA, and REGION
+*        6/8/92 - added CONTOUR/FILL/KEY/NOKEY/LINE
+*                       WIRE
+*                       DEFINE-SHOW-CANCEL ALIAS
+*       6/19/92 - made alias names 8 characters
+*       6/26/92 - added /RIGID to SET DATA/FORM=CDF
+*        7/6/92 - added /DEPTH to DEFINE AXIS
+*       8/25/92 - added /MODULO to DEFINE AXIS
+*       11/4/92 - added /UNITS to DEFINE VARIABLE
+*               - changed DEFINE VIEW/SIZE/ORIGIN/CLIP to /TEXT/XLIMITS/YLIMITS
+*       12/2/92 - added /ZSCALE to the WIRE command
+*       12/4/92 - restored /SIZE, /ORIGIN, and /CLIP to DEFINE VIEW
+*       1/14/93 - changed SET MOVIE/APPEND to /COMPRESS
+*        2/1/93 - added alias ANIMATE
+* V300  3/11/93 - added alias SPECTRUM
+*       5/24/93 - added qualifier CANC DATA/NOERROR
+*       6/16/93 - added QUERY command and 2 new blank commands
+* V301  10/22/93 - added /XLIMITS and /YLIMITS to PLOT command
+*	11/03/93 - added DEFINE AXIS/NPOINTS
+*	11/05/93 - changed QUERY/PIPE to QUERY/IGNORE (a NO-OP)
+*	11/23/93 - added USER/FILE
+*	12/8/93  - added VECTOR/XSKIP/YSKIP
+*	 1/19/94 - added alias LABEL
+*		 - and USER/FORMAT
+*	 2/10/94 - added CONTOTUR/PEN, VECTOR/PEN, and LET/QUIET
+* V310   4/11/94 - eliminated qualifier LIST/EPKEY -- use SAVE instead
+*	    5/94 - added SET DATA/ORDER
+* V320   4/11/94 - added SET MEMORY/SIZE=
+*	 8/03/94 - added FRAME/FORMAT= and FRAME/FILE=
+*	 8/05/94 - added SAVE/{XYZTIJKL}LIMITS=lo:hi
+*	10/28/94 - added GO/HELP
+*	 1/25/94 - added SAVE/TITLE="my title"
+* V400	  2/6/95 - added SHOW SYMBOL
+* V402	    7/95 - added DEFINE VAR/D, SHOW VAR/D, CANC VAR/D, SET VAR/D
+* V420	 9/22/95 - added SHOW MEMORY/GRIDS
+*	 9/29/95 - added LIST/precision=
+*	 2/7/96  - added STAT/BRIEF
+*	 4/23/96 - increased number of aliases from 30 to 150
+* V450	11/14/96 - added LIST/CLOBBER
+*	5/97	 - added /NOAXES to SHADE, PLOT, CONTOUR, and VECTOR
+*       7/97     - added SHOW FUNCTIONS
+*  *js* 7/98     - added SET DATA/TYPE and SET DATA/SWAP
+* v491  12.98    - added PATTERN support *jd*
+* v491  12.98    - added PATTERN alias *jd*
+* V500  2/99 - *kob* - add /QUIET to LIST command
+*       2/99 *sh* - added POLYGON command
+*       3/99 *jd* - more qualifs for POLYGON and fixed num_qualifs bug for it
+*       3/99 *jc* - added /INTERNAL to SHOW FUNCTION command
+*       4/99 *sh* - added PAUSE alias
+*	     *sh* - added DEFINE AXIS/EDGES and SHOW AXIS/X/Y/Z/T/E/F/IJ/K/L 
+*	     *sh* - added SET AXIS/DEPTH
+*	6/99 *sh* - added WHERE alias
+* V510  3/00 *sh* - added SET DATA/REGULAR_T
+*		  - added PLOT/COLOR=/THICKNESS=/SIZE=
+*		  - added POLYGON/COLOR=/THICKNESS=
+*		  - changed /PEN to /COLOR on CONTOUR and VECTOR
+*		  - added VECTOR/THICK
+*	5/00 *sh* - added DEFINE VARIABLE/BAD=
+*	5/00 *sh* - added CANCEL GRID
+*	5/00 *sh* - added /HLIMITS and /VLIMITS to graphics commands
+*		  - added /DETAILED to SHOW FUNCTIONS and to MESSAGE
+*	5/00 *sh* - restored /PEN as a "denigrated" command
+* V520: 6/00 *sh* - added MESSAGE/ERROR
+* V530: 10/00 *sh* - added added SET DATA/EZ  /TYPE=/DELIMITERS=
+*      10/00 *acm* - added VECTOR/FLOWLINE (alias FLOWLINE)
+*      1 /01 *sh* - added PLOT/STEP[=connected]
+*       1/01 *acm* - added DEFINE AXIS/CALENDAR qualifier
+*       5/01 *acm* - added PLOT/DASH[=(dn1,up1,dn2,up2) qualifier
+*       1/01 *acm* - added /CALENDAR qualifier
+* V531: 5/01 *kob* - replace old ANIMATE alias which spawned a call
+*	             to what must be the now-defunct xds with new 
+*		     animate alias which uses internal double buffering
+* V533: 6/01 *sh* - added SET VARIABLE/NAME=
+*            *acm* - added PLOT/VLOG, PLOT/HLOG: plot qualifiers to set log,
+*                    inverse log axes and log depth axes.
+*       7/01 *acm* - added /AXES[=TOP,BOTTOM,LEFT,RIGHT]  for 
+*		     PLOT, CONTOUR, POLYGON, SHADE, VECTOR.
+*       8/01 *kob* - add LOOP, PROMPT, SCRIPT, PROGRAM qualifiers 
+*                    to EXIT command
+* V540: 9/01 *sh* - added DEFINE VIEWPORT/AXES
+*	10/01 *sh* - added alias COLUMNS for SET DATA/FORMAT=Delimited
+*	11/01 *sh* - added list/width=
+* V541: 4/02 *acm* - remove CONTOUR/HLOG/VLOG; mistakenly put in here!!
+*                    note they were not used by xeq_contour...
+* V541: 5/02 *acm* - add VECTOR/NOKEY
+*       6/02 *acm* - add CANCEL AXIS/ALL
+* V552: 4/02 *acm* - add SET VARIABLE/SCALEFAC/OFFSET
+* V553: 7/03 *acm* - add SHOW DATA/XML for DAS, DDS output
+* V553: 7/03 *acm* - add SHOW AXIS/XML 
+* V553: 9/03 *acm* - add SHOW AXIS/DODS for binary output of axis coordinates
+*                       also needs /FILE=  and /APPEND
+* V554: 10/03 *acm* - add SHOW AXIS/EDGES/DODS for binary output of axis coordinates
+* V554:  1/04 *acm* - add REPEAT/RANGE=/NAME= qualifiers
+* V554:  2/04 *acm* - add /HGRAT=/VGRAT qualifiers to plot commands, setting 
+*                     GRATICULE lines at tic marks
+* V570:  5/04 *acm* - Add DEFINE AXIS/BOUNDS 
+*                     and LIST/EDGES, LIST/BOUNDS (for NetCDF output only)
+*       *acm* 6/05 - add SET AXIS/CALENDAR /T0 /UNITS
+*       *acm* 6/05 - add CANCEL AXIS/DEPTH
+* V580: 10/04 *acm* - add SHOW VARIABLES/XML
+* V580: 11/04 *acm* - add PLOT/NOKEY
+* V581:  2/05 *acm* - SHADE/MODULO for curvilinear plots
+* V581:  4/05 *acm* - CONTOUR/MODULO for curvilinear plots
+* V581:  5/05 *acm* - add EXIT/CYCLE
+* V590:  8/05 *acm* - add LIST/NOROWLAB
+
+* V600:  8/05 *acm* - add LIST/NOROWLAB
+* V600:  9/05 *acm* - add SET WINDOW/TITLE
+* V600:  3/07 *acm* - fixing bug 439&1390. Add logical variable its_action_command 
+* V600   6/05 *acm* - SHOW ATTRIBUTE[/ALL][/DATA=] var 
+*                   - SHOW DATA/ATTR output all attributes for nc files
+* V600:  8/05 *acm* - add LIST/NOROWLAB
+*       *acm* 8/05 - add DEFINE ATTRIBUTE
+*       *acm* 9/05 - add SET ATTRIBUTE
+*       *acm*10/05 - add CANCEL ATTRIBUTE
+* V600: 2/06 *acm* - add SET VARIABLE/OUTTYPE for attribute-handling additions
+*       7/06 *jli* - add SET AXIS/STRIDE /OFFSET for grid striding
+*       7/06 *jli* - add CANCEL AXIS/STRIDES
+*       *acm* 7/06 -     CANCEL ATTRIBUTE /OUTPUT /DATA
+* V603: 5/07 *acm* - Fix bug found by Andy Jacobson, in line 1465 index should be 30 not 29.
+* V606  8/07 *acm* - DEFINE AXIS/QUIET
+* V6.2  *acm* 5/08 new qualifier FRAME/TRANSPARENT
+* V6.2  *acm* 2/09 new qualifier LIST/KEEP_AXISNAMES
+* V6.2  *acm* 5/09 new alias KEYMARK
+* V6.6  *acm* 1/10 new qualifiers for LIST netCDF4: NCFORMAT,
+*                  XCHUNK,YCHUNK,ZCHUNK,TCHUNK,DEFLATE,SHUFFLE,ENDIAN
+* V6.5  *acm* 3/10 new qualifiers on (some) SHOW commands and on MESSAGE: 
+*                  /OUTFILE= /APPEND /CLOBBER
+* V6.6  *acm* 2/10 new qualifiers for SET LIST netCDF4: NCFORMAT,
+*                  XCHUNK,YCHUNK,ZCHUNK,TCHUNK,DEFLATE,SHUFFLE,ENDIAN
+*       *kms* 5/10 add SET AXIS/REGULAR to force interpreting the axis as regular
+*       *kms* 5/10 add SET REDIRECT /TEE /JOURNAL /FILE /APPEND /CLOBBER 
+*                  and CANCEL REDIRECT for stdout/stderr redirection
+*       *kms* 7/10 add SET DATA /BROWSE to browse for the dataset
+* V6.63 *acm* 7/10 Add VECTOR/KEY to force key even if /NOLAB
+*       *kms* 7/10 add SET DATA /BROWSE to browse for the dataset
+* V664  8.10 *kms* Add EXIT/TOPYTHON to exit the ferret_dispatch loop 
+*                  but just re-enter the loop if not under pyferret
+*                  Add DEFINE PYFUNC /NAME=<alias> python.module.name
+* V68 *acm* 1/12   Add USE/STRICT; see ticket 1910.
+* PyFr  *kms* 3/11 Add CANCEL PYVAR /ALL /DATASET
+* PyFr  *kms* 1/12 Add SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL
+* V68 *acm* 5/12   Add DEFINE DATA /AGGREGATE /NAME= /QUIET
+* V683*acm* 8/12   New SET LIST/OUTTYPE, CANCEL LIST/OUTTYPE and SAVE/OUTTYPE 
+* V683*acm 10/12   NEW SET AXIS/OUTTYPE to change default coordinate axis output type
+* V684 *acm* 12/12 Changes for POLY/MODULO and  VECTOR/MODULO on curvilinear plots.
+* V685 *acm*  1/13 DEFINE VARIABLE/REMOTE
+* V685 *acm*  6/13 new qualifier SAVE/NOBOUNDS
+* V685 *acm*  6/13 Dont add SAVE/NOCOORDS
+* PyFr  *kms* 1/13 Remove SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL;
+*                  Add /QUALITY= /AAlias /NoAAlias /ENGINE= to SET WINDOW
+* PyFr  *kms* 3/13 Change /AAlias and /NoAAlias to /AntiAlia[s] and /NoAntiAl[ias]
+* V685 *acm*  4/13 Add /HIDE on DEF DATA/AGG and SHOW DATA/HIDDEN
+* PyFr  *kms* 6/13  Add /COLOR= /OPACITY= to specify background color
+* PyFr  *kms* 7/13  Add /THICKEN to SET WINDOW to specify line thickness scaling factor
+* PyFr  *kms*  7/13 Add /OPACITY to CONTOUR, PLOT, POLYGON, SHADE, VECTOR
+* PyFr  *kms*  7/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to SET WINDOW and FRAME
+* PyFr  *kms*  8/13 Add /ANNOTATE to FRAME
+* V685 *sh*  9/13  Add SHOW VARIABLE/TREE and alias VTREE
+* V685 *acm* 11/13 Add /QUIET for DEFINE ATTRIBUTE
+* V690 *sh* 12/13 Add /CURVILINEAR and /SIGMA to action commands
+*		  Add SET,CANCEL,SHOW VARIABLE/SIGMA/CURVI
+* V687  3/14 *acm* add SET AXIS/NAME
+
+        IMPLICIT NONE
+	include 'ferret.parm'
+	include 'xcommand.cmn'
+
+* local variable declarations:
+        INTEGER i
+
+* SET	 - command # 1
+	DATA commands(1)			/ 'SET '	/
+        DATA its_action_command(1)              / .FALSE.       /
+	DATA num_subcommands(1)			/ nsub1		/
+	DATA subcommand_pointer(1)		/ nsub_at1	/
+* SET '    '
+	   DATA subcommands      (nsub_at1 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at1 + 0)	/ nqual1a	/
+	   DATA qualifier_pointer(nsub_at1 + 0)	/ nqual_at1a	/
+* SET WINDOW
+	   DATA subcommands      (nsub_at1 + 1)	/ 'WINDOW'	/
+	   DATA num_qualifs      (nsub_at1 + 1)	/ nqual1b	/
+	   DATA qualifier_pointer(nsub_at1 + 1)	/ nqual_at1b	/
+* SET WINDOW/SIZE...
+		DATA qualifiers  (nqual_at1b+0)	/ 'SIZE'	/
+		DATA qualifiers  (nqual_at1b+1)	/ 'NEW' 	/
+		DATA qualifiers  (nqual_at1b+2)	/ 'LOCATION'	/
+		DATA qualifiers  (nqual_at1b+3)	/ 'ASPECT'	/
+		DATA qualifiers  (nqual_at1b+4)	/ 'CLEAR'	/
+		DATA qualifiers  (nqual_at1b+5)	/ 'TITLE'	/
+		DATA qualifiers  (nqual_at1b+6)	/ 'QUALITY'	/
+		DATA qualifiers  (nqual_at1b+7)	/ 'ANTIALIA'	/
+		DATA qualifiers  (nqual_at1b+8)	/ 'NOANTIAL'	/
+		DATA qualifiers  (nqual_at1b+9)	/ 'ENGINE'	/
+		DATA qualifiers  (nqual_at1b+10)/ 'COLOR'	/
+		DATA qualifiers  (nqual_at1b+11)/ 'OPACITY'	/
+		DATA qualifiers  (nqual_at1b+12)/ 'THICKEN'	/
+		DATA qualifiers  (nqual_at1b+13)/ 'XPIXELS'	/
+		DATA qualifiers  (nqual_at1b+14)/ 'YPIXELS'	/
+		DATA qualifiers  (nqual_at1b+15)/ 'XINCHES'	/
+		DATA qualifiers  (nqual_at1b+16)/ 'YINCHES'	/
+		DATA qualifiers  (nqual_at1b+17)/ 'TEXTPROM'	/
+		DATA qualifiers  (nqual_at1b+18)/ '****'	/
+		DATA qualifiers  (nqual_at1b+19)/ '****'	/
+* SET REGION
+	   DATA subcommands      (nsub_at1 + 2)	/ 'REGION'	/
+	   DATA num_qualifs      (nsub_at1 + 2)	/ nqual1c	/
+	   DATA qualifier_pointer(nsub_at1 + 2)	/ nqual_at1c	/
+* SET REGION/I/J/K/L/M/N/X/Y/Z/T/E/F/DX/DY/DZ/DT/DE/DF/DI/DJ/DK/DL/DM/DN
+		DATA qualifiers  (nqual_at1c+0)	/ 'I'	/
+		DATA qualifiers  (nqual_at1c+1)	/ 'J'	/
+		DATA qualifiers  (nqual_at1c+2)	/ 'K'	/
+		DATA qualifiers  (nqual_at1c+3)	/ 'L'	/
+		DATA qualifiers  (nqual_at1c+4)	/ 'M'	/
+		DATA qualifiers  (nqual_at1c+5)	/ 'N'	/
+		DATA qualifiers  (nqual_at1c+6)	/ 'X'	/
+		DATA qualifiers  (nqual_at1c+7)	/ 'Y'	/
+		DATA qualifiers  (nqual_at1c+8)	/ 'Z'	/
+		DATA qualifiers  (nqual_at1c+9)	/ 'T'	/
+		DATA qualifiers  (nqual_at1c+10)/ 'E'/
+		DATA qualifiers  (nqual_at1c+11)/ 'F'/
+		DATA qualifiers  (nqual_at1c+12)/ '****'/   ! need this for alignment
+		DATA qualifiers  (nqual_at1c+13)/ '****'/   ! in get_delta_context
+		DATA qualifiers  (nqual_at1c+14)/ 'DX'/
+		DATA qualifiers  (nqual_at1c+15)/ 'DY'/
+		DATA qualifiers  (nqual_at1c+16)/ 'DZ'/
+		DATA qualifiers  (nqual_at1c+17)/ 'DT'/
+		DATA qualifiers  (nqual_at1c+18)/ 'DE'/
+		DATA qualifiers  (nqual_at1c+19)/ 'DF'/
+		DATA qualifiers  (nqual_at1c+20)/ 'DI'/
+		DATA qualifiers  (nqual_at1c+21)/ 'DJ'/
+		DATA qualifiers  (nqual_at1c+22)/ 'DK'/
+		DATA qualifiers  (nqual_at1c+23)/ 'DL'/
+		DATA qualifiers  (nqual_at1c+24)/ 'DM'/
+		DATA qualifiers  (nqual_at1c+25)/ 'DN'/
+		DATA qualifiers  (nqual_at1c+26)/ '****'/
+* SET VIEWPORT
+	   DATA subcommands      (nsub_at1 + 3)	/ 'VIEWPORT'	/
+	   DATA num_qualifs      (nsub_at1 + 3)	/ nqual1d	/
+	   DATA qualifier_pointer(nsub_at1 + 3)	/ nqual_at1d	/
+* SET VIEWPORT/SIZE/ORIGIN/CLIP
+		DATA qualifiers  (nqual_at1d+0)	/ '****'	/
+* SET EXPRSION
+	   DATA subcommands      (nsub_at1 + 4)	/ 'EXPRSION'	/
+	   DATA num_qualifs      (nsub_at1 + 4)	/ nqual1e	/
+	   DATA qualifier_pointer(nsub_at1 + 4)	/ nqual_at1e	/
+* SET LIST
+	   DATA subcommands      (nsub_at1 + 5)	/ 'LIST'	/
+	   DATA num_qualifs      (nsub_at1 + 5)	/ nqual1f	/
+	   DATA qualifier_pointer(nsub_at1 + 5)	/ nqual_at1f	/
+* SET LIST/PRECISION=#digits, /FILE=filename, /FORMAT=list_format, /APPEND, 
+* (for netcdf4 /NCFORMAT= /ENDIAN=, /DEFLATE=, /SHUFFLE=,  /XCHUNK...
+		DATA qualifiers  (nqual_at1f+0)	/ 'PRECISION'	/
+		DATA qualifiers  (nqual_at1f+1)	/ 'FILE'	/
+		DATA qualifiers  (nqual_at1f+2)	/ 'FORMAT'	/
+		DATA qualifiers  (nqual_at1f+3)	/ 'APPEND'	/
+		DATA qualifiers  (nqual_at1f+4)	/ 'HEADING'	/
+		DATA qualifiers  (nqual_at1f+5)	/ 'NCFORMAT'	/
+		DATA qualifiers  (nqual_at1f+6)	/ 'ENDIAN'	/
+		DATA qualifiers  (nqual_at1f+7)	/ 'DEFLATE'	/
+		DATA qualifiers  (nqual_at1f+8)	/ 'SHUFFLE'	/
+		DATA qualifiers  (nqual_at1f+9)	/ 'XCHUNK'	/
+		DATA qualifiers  (nqual_at1f+10)/ 'YCHUNK'	/
+		DATA qualifiers  (nqual_at1f+11)/ 'ZCHUNK'	/
+		DATA qualifiers  (nqual_at1f+12)/ 'TCHUNK'	/
+		DATA qualifiers  (nqual_at1f+13)/ 'ECHUNK'	/
+		DATA qualifiers  (nqual_at1f+14)/ 'FCHUNK'	/
+		DATA qualifiers  (nqual_at1f+15)/ 'OUTTYPE'	/
+* SET DATA_SET
+	   DATA subcommands      (nsub_at1 + 6)	/ 'DATA'	/
+	   DATA num_qualifs      (nsub_at1 + 6)	/ nqual1g	/
+	   DATA qualifier_pointer(nsub_at1 + 6)	/ nqual_at1g	/
+* SET DATA/FORM/GRID/TITL/SIZE/TYPE/BROWSE
+		DATA qualifiers  (nqual_at1g+0)	/ 'EZ'  	/
+		DATA qualifiers  (nqual_at1g+1)	/ 'VARIABLE'	/
+		DATA qualifiers  (nqual_at1g+2)	/ 'TITLE'	/
+		DATA qualifiers  (nqual_at1g+3)	/ 'FORMAT'	/
+		DATA qualifiers  (nqual_at1g+4)	/ 'GRID'	/
+		DATA qualifiers  (nqual_at1g+5)	/ 'SKIP'	/
+		DATA qualifiers  (nqual_at1g+6)	/ 'COLUMNS'	/
+		DATA qualifiers  (nqual_at1g+7)	/ 'SAVE'	/
+		DATA qualifiers  (nqual_at1g+8)	/ 'RESTORE'	/
+		DATA qualifiers  (nqual_at1g+9)	/ 'ORDER'	/   !5/94
+		DATA qualifiers  (nqual_at1g+10) / 'TYPE'       / 
+		DATA qualifiers  (nqual_at1g+11) / 'SWAP'       / 
+		DATA qualifiers  (nqual_at1g+12) / 'REGULART'   /
+		DATA qualifiers  (nqual_at1g+13) / 'DELIMITE'  /
+		DATA qualifiers  (nqual_at1g+14) / 'BROWSE'     /
+		DATA qualifiers  (nqual_at1g+15) / 'STRICT'     /
+		DATA qualifiers  (nqual_at1g+16) / '****'       /
+		DATA qualifiers  (nqual_at1g+17) / '****'       /
+		DATA qualifiers  (nqual_at1g+18) / '****'       /
+		DATA qualifiers  (nqual_at1g+19) / '****'       /
+* SET MODE
+	   DATA subcommands      (nsub_at1 + 7)	/ 'MODE'	/
+	   DATA num_qualifs      (nsub_at1 + 7)	/ nqual1h	/
+	   DATA qualifier_pointer(nsub_at1 + 7)	/ nqual_at1h	/
+* SET MODE/LAST
+		DATA qualifiers  (nqual_at1h+0)	/ 'LAST'	/
+* SET MOVIE
+	   DATA subcommands      (nsub_at1 + 8)	/ 'MOVI'	/
+	   DATA num_qualifs      (nsub_at1 + 8)	/ nqual1i	/
+	   DATA qualifier_pointer(nsub_at1 + 8)	/ nqual_at1i	/
+* SET MOVIE/FILE=filename/COMPRESS/LASER
+		DATA qualifiers  (nqual_at1i+0)	/ 'FILE'	/
+		DATA qualifiers  (nqual_at1i+1)	/ 'COMPRESS'	/
+		DATA qualifiers  (nqual_at1i+2)	/ 'LASER'	/
+		DATA qualifiers  (nqual_at1i+3)	/ 'START'	/
+		DATA qualifiers  (nqual_at1i+4)	/ '****'	/
+* SET VARIABLE
+	   DATA subcommands      (nsub_at1 + 9)	/ 'VARIABLE'	/
+	   DATA num_qualifs      (nsub_at1 + 9)	/ nqual1j	/
+	   DATA qualifier_pointer(nsub_at1 + 9)	/ nqual_at1j	/
+* SET VARIABLE/TITLE/UNIT/GRID/BAD/DATASET/NAME/SCALEFAC/OFFSET/OUTTYPE
+		DATA qualifiers  (nqual_at1j+0)	/ 'TITLE'	/
+		DATA qualifiers  (nqual_at1j+1)	/ 'UNIT'	/
+		DATA qualifiers  (nqual_at1j+2)	/ 'GRID'	/
+		DATA qualifiers  (nqual_at1j+3)	/ 'BAD'	/
+		DATA qualifiers  (nqual_at1j+4)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at1j+5)	/ 'NAME'	/
+		DATA qualifiers  (nqual_at1j+6)	/ 'SCALEFAC'	/
+		DATA qualifiers  (nqual_at1j+7)	/ 'OFFSET'	/
+		DATA qualifiers  (nqual_at1j+8)	/ 'OUTTYPE'	/
+		DATA qualifiers  (nqual_at1j+9)	/ 'SIGMA'	/
+		DATA qualifiers  (nqual_at1j+10)/ 'CURVILINEAR'	/
+		DATA qualifiers  (nqual_at1j+11)/ '****'	/
+		DATA qualifiers  (nqual_at1j+12)/ '****'	/
+* SET GRID
+	   DATA subcommands      (nsub_at1 +10)	/ 'GRID'	/
+	   DATA num_qualifs      (nsub_at1 +10)	/ nqual1k	/
+	   DATA qualifier_pointer(nsub_at1 +10)	/ nqual_at1k	/
+* SET GRID
+		DATA qualifiers  (nqual_at1k+0)	/ 'SAVE'	/
+		DATA qualifiers  (nqual_at1k+1)	/ 'RESTORE'	/
+* SET AXIS
+	   DATA subcommands      (nsub_at1 +11)	/ 'AXIS'	/
+	   DATA num_qualifs      (nsub_at1 +11)	/ nqual1l	/
+	   DATA qualifier_pointer(nsub_at1 +11)	/ nqual_at1l	/
+* SET AXIS / MODULO /DEPTH /CALENDAR /UNITS /T0 /STRIDE /OFFSET /REGULAR /OUTTYPE /NAME
+		DATA qualifiers  (nqual_at1l+0)	/ 'MODULO'	/
+		DATA qualifiers  (nqual_at1l+1)	/ 'DEPTH'	/
+		DATA qualifiers  (nqual_at1l+2)	/ 'CALENDAR'	/
+		DATA qualifiers  (nqual_at1l+3)	/ 'T0'	/
+		DATA qualifiers  (nqual_at1l+4)	/ 'UNITS'	/
+		DATA qualifiers  (nqual_at1l+5)	/ 'STRIDE'	/
+		DATA qualifiers  (nqual_at1l+6)	/ 'OFFSET'	/
+		DATA qualifiers  (nqual_at1l+7)	/ 'REGULAR'	/
+		DATA qualifiers  (nqual_at1l+8)	/ 'OUTTYPE'	/
+		DATA qualifiers  (nqual_at1l+9)	/ 'NAME'	/
+* SET MEMORY
+	   DATA subcommands      (nsub_at1 +12)	/ 'MEMORY'	/
+	   DATA num_qualifs      (nsub_at1 +12)	/ nqual1m	/
+	   DATA qualifier_pointer(nsub_at1 +12)	/ nqual_at1m	/
+* SET MEMO / MWORDS
+		DATA qualifiers  (nqual_at1m+0)	/ 'SIZE'	/
+		DATA qualifiers  (nqual_at1m+1)	/ '****'	/
+* SET ATTRIBUTE
+	   DATA subcommands      (nsub_at1 +13)	/ 'ATTRIBUT'	/
+	   DATA num_qualifs      (nsub_at1 +13)	/ nqual1n	/
+	   DATA qualifier_pointer(nsub_at1 +13)	/ nqual_at1n	/
+* SET ATRR /TYPE /DATASET /OUTPUT /LIKE 
+		DATA qualifiers  (nqual_at1n+0)	/ 'TYPE'	/
+		DATA qualifiers  (nqual_at1n+1)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at1n+2)	/ 'OUTPUT'	/
+		DATA qualifiers  (nqual_at1n+3)	/ 'LIKE'	/
+		DATA qualifiers  (nqual_at1n+4)	/ 'QUIET'	/
+		DATA qualifiers  (nqual_at1n+5)	/ '****'	/
+		DATA qualifiers  (nqual_at1n+6)	/ '****'	/
+		DATA qualifiers  (nqual_at1n+7)	/ '****'	/
+* SET NCCACHE							  ! cache chunk for reading
+	   DATA subcommands      (nsub_at1 +14)	/ 'NCCACHE'	/
+	   DATA num_qualifs      (nsub_at1 +14)	/ nqual1o	/
+	   DATA qualifier_pointer(nsub_at1 +14)	/ nqual_at1o	/
+* SET NCCACHE /SIZE/NELEMS/PREEMPT
+		DATA qualifiers  (nqual_at1o+0)	/ 'SIZE'	/
+		DATA qualifiers  (nqual_at1o+1)	/ 'NELEMS'	/
+		DATA qualifiers  (nqual_at1o+2)	/ 'PREEMPT'	/
+* SET REDIRECT							  ! redirecting stdout and/or stderr
+	   DATA subcommands      (nsub_at1 +15)	/ 'REDIRECT'	/
+	   DATA num_qualifs      (nsub_at1 +15)	/ nqual1p	/
+	   DATA qualifier_pointer(nsub_at1 +15)	/ nqual_at1p	/
+* SET REDIRECT /TEE /JOURNAL /FILE /APPEND /CLOBBER
+		DATA qualifiers  (nqual_at1p+0)	/ 'TEE'		/
+		DATA qualifiers  (nqual_at1p+1)	/ 'JOURNAL'	/
+		DATA qualifiers  (nqual_at1p+2)	/ 'FILE'	/
+		DATA qualifiers  (nqual_at1p+3)	/ 'APPEND'	/
+		DATA qualifiers  (nqual_at1p+4)	/ 'CLOBBER'	/
+		DATA qualifiers  (nqual_at1p+5)	/ '****'	/
+		DATA qualifiers  (nqual_at1p+6)	/ '****'	/
+		DATA qualifiers  (nqual_at1p+7)	/ '****'	/
+* SET GIFFILE							  ! set default gif filename and the pointer used in gif mode
+	   DATA subcommands      (nsub_at1 +16)	/ 'GIFFILE'	/
+	   DATA num_qualifs      (nsub_at1 +16)	/ nqual1q	/
+	   DATA qualifier_pointer(nsub_at1 +16)	/ nqual_at1q	/
+* SET ****							  ! unused (r)
+           DATA subcommands      (nsub_at1 +17)	/ '****'	/
+           DATA num_qualifs      (nsub_at1 +17)	/ nqual1r	/
+           DATA qualifier_pointer(nsub_at1 +17)	/ nqual_at1r	/
+* SET **** / ****
+                DATA qualifiers  (nqual_at1r+0)	/ '****'	/
+                DATA qualifiers  (nqual_at1r+1)	/ '****'	/
+                DATA qualifiers  (nqual_at1r+2)	/ '****'	/
+                DATA qualifiers  (nqual_at1r+3)	/ '****'	/
+* SET ****							  ! unused (s)
+	   DATA subcommands      (nsub_at1 +18)	/ '****'	/
+	   DATA num_qualifs      (nsub_at1 +18)	/ nqual1s	/
+	   DATA qualifier_pointer(nsub_at1 +18)	/ nqual_at1s	/
+* SET **** / ****
+		DATA qualifiers  (nqual_at1s+0)	/ '****'	/
+		DATA qualifiers  (nqual_at1s+1)	/ '****'	/
+		DATA qualifiers  (nqual_at1s+2)	/ '****'	/
+		DATA qualifiers  (nqual_at1s+3)	/ '****'	/
+* SET ****							  ! unused (t)
+	   DATA subcommands      (nsub_at1 +19)	/ '****'	/
+	   DATA num_qualifs      (nsub_at1 +19)	/ nqual1t	/
+	   DATA qualifier_pointer(nsub_at1 +19)	/ nqual_at1t	/
+* SET **** / ****
+		DATA qualifiers  (nqual_at1t+0)	/ '****'	/
+		DATA qualifiers  (nqual_at1t+1)	/ '****'	/
+		DATA qualifiers  (nqual_at1t+2)	/ '****'	/
+		DATA qualifiers  (nqual_at1t+3)	/ '****'	/
+
+* SHOW	 - command # 2
+	DATA commands(2)			/ 'SHOW '	/
+        DATA its_action_command(2)              / .FALSE.       /
+	DATA num_subcommands(2)			/ nsub2		/
+	DATA subcommand_pointer(2)		/ nsub_at2	/
+* SHOW '    '
+	   DATA subcommands      (nsub_at2 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at2 + 0)	/ nqual2a	/
+	   DATA qualifier_pointer(nsub_at2 + 0)	/ nqual_at2a	/
+* SHOW /ALL
+		DATA qualifiers  (nqual_at2a+0)	/ 'ALL '	/
+* SHOW WINDOWS
+	   DATA subcommands      (nsub_at2 + 1)	/ 'WINDOW'	/
+	   DATA num_qualifs      (nsub_at2 + 1)	/ nqual2b	/
+	   DATA qualifier_pointer(nsub_at2 + 1)	/ nqual_at2b	/
+* SHOW WINDOWS /ALL
+		DATA qualifiers  (nqual_at2b+0)	/ 'ALL '	/
+* SHOW REGION
+	   DATA subcommands      (nsub_at2 + 2)	/ 'REGION'	/
+	   DATA num_qualifs      (nsub_at2 + 2)	/ nqual2c	/
+	   DATA qualifier_pointer(nsub_at2 + 2)	/ nqual_at2c	/
+* SHOW REGIONS /ALL
+		DATA qualifiers  (nqual_at2c+0)	/ 'ALL '	/
+* SHOW AXIS
+	   DATA subcommands      (nsub_at2 + 3)	/ 'AXIS'	/
+	   DATA num_qualifs      (nsub_at2 + 3)	/ nqual2d	/
+	   DATA qualifier_pointer(nsub_at2 + 3)	/ nqual_at2d	/
+* SHOW AXIS /ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/XML/OUTFILE/APPEND/CLOBBER
+		DATA qualifiers  (nqual_at2d+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at2d+1)	/ 'I'	/
+		DATA qualifiers  (nqual_at2d+2)	/ 'J'	/
+		DATA qualifiers  (nqual_at2d+3)	/ 'K'	/
+		DATA qualifiers  (nqual_at2d+4)	/ 'L'	/
+		DATA qualifiers  (nqual_at2d+5)	/ 'M'	/
+		DATA qualifiers  (nqual_at2d+6)	/ 'N'	/
+		DATA qualifiers  (nqual_at2d+7)	/ 'X'	/
+		DATA qualifiers  (nqual_at2d+8)	/ 'Y'	/
+		DATA qualifiers  (nqual_at2d+9)	/ 'Z'	/
+		DATA qualifiers  (nqual_at2d+10)/ 'T'	/
+		DATA qualifiers  (nqual_at2d+11)/ 'E'	/
+		DATA qualifiers  (nqual_at2d+12)/ 'F'	/
+		DATA qualifiers  (nqual_at2d+13)/ 'XML'/
+		DATA qualifiers  (nqual_at2d+14)/ 'OUTFILE'/
+		DATA qualifiers  (nqual_at2d+15)/ 'APPEND'/
+		DATA qualifiers  (nqual_at2d+16)/ 'CLOBBER'/
+		DATA qualifiers  (nqual_at2d+17)/ '****'/
+		DATA qualifiers  (nqual_at2d+18)/ '****'/
+		DATA qualifiers  (nqual_at2d+19)/ '****'/
+
+* SHOW EXPRSIONION
+	   DATA subcommands      (nsub_at2 + 4)	/ 'EXPRSION'	/
+	   DATA num_qualifs      (nsub_at2 + 4)	/ nqual2e	/
+	   DATA qualifier_pointer(nsub_at2 + 4)	/ nqual_at2e	/
+* SHOW EXPRSIONION /ALL
+		DATA qualifiers  (nqual_at2e+0)	/ 'ALL '	/
+* SHOW LIST
+	   DATA subcommands      (nsub_at2 + 5)	/ 'LIST'	/
+	   DATA num_qualifs      (nsub_at2 + 5)	/ nqual2f	/
+	   DATA qualifier_pointer(nsub_at2 + 5)	/ nqual_at2f	/
+* SHOW LIST /ALL
+		DATA qualifiers  (nqual_at2f+0)	/ 'ALL '	/
+* SHOW DATA_SET
+	   DATA subcommands      (nsub_at2 + 6)	/ 'DATA'	/
+	   DATA num_qualifs      (nsub_at2 + 6)	/ nqual2g	/
+	   DATA qualifier_pointer(nsub_at2 + 6)	/ nqual_at2g	/
+* SHOW DATA_SET /ALL/BRIEF/FULL/VAR/FILE/XML/ATTR/OUTFILE/APPEND/CLOBBER/HIDDEN
+		DATA qualifiers  (nqual_at2g+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at2g+1)	/ 'BRIEF'	/
+		DATA qualifiers  (nqual_at2g+2)	/ 'FULL'	/
+		DATA qualifiers  (nqual_at2g+3)	/ 'VARIABLE'	/
+		DATA qualifiers  (nqual_at2g+4)	/ 'FILES'	/
+		DATA qualifiers  (nqual_at2g+5)	/ 'XML'		/
+		DATA qualifiers  (nqual_at2g+6)	/ 'ATTR'	/
+		DATA qualifiers  (nqual_at2g+7)	/ 'OUTFILE'	/
+		DATA qualifiers  (nqual_at2g+8)	/ 'APPEND'	/
+		DATA qualifiers  (nqual_at2g+9)	/ 'CLOBBER'	/
+		DATA qualifiers  (nqual_at2g+10)/ 'HIDDEN'	/
+		DATA qualifiers  (nqual_at2g+11)/ '****'	/
+		DATA qualifiers  (nqual_at2g+12)/ '****'	/
+		DATA qualifiers  (nqual_at2g+13)/ '****'	/
+		DATA qualifiers  (nqual_at2g+14)/ '****'	/
+* SHOW MODE
+	   DATA subcommands      (nsub_at2 + 7)	/ 'MODE'	/
+	   DATA num_qualifs      (nsub_at2 + 7)	/ nqual2h	/
+	   DATA qualifier_pointer(nsub_at2 + 7)	/ nqual_at2h	/
+* SHOW MODE /ALL
+		DATA qualifiers  (nqual_at2h+0)	/ 'ALL '	/
+* SHOW MOVIE
+	   DATA subcommands      (nsub_at2 + 8)	/ 'MOVIE'	/
+	   DATA num_qualifs      (nsub_at2 + 8)	/ nqual2i	/
+	   DATA qualifier_pointer(nsub_at2 + 8)	/ nqual_at2i	/
+* SHOW MOVIE /ALL
+		DATA qualifiers  (nqual_at2i+0)	/ 'ALL '	/
+* SHOW VARIABLES
+	   DATA subcommands      (nsub_at2 + 9)	/ 'VARIABLE'	/
+	   DATA num_qualifs      (nsub_at2 + 9)	/ nqual2j	/
+	   DATA qualifier_pointer(nsub_at2 + 9)	/ nqual_at2j	/
+* SHOW VARIABLES /ALL /DATASET /DIAGNOSTIC /USER /OUTFILE/APPEND/CLOBBER
+		DATA qualifiers  (nqual_at2j+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at2j+1)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at2j+2)	/ 'DIAG'	/
+		DATA qualifiers  (nqual_at2j+3)	/ 'USER'	/
+		DATA qualifiers  (nqual_at2j+4)	/ 'XML'		/
+		DATA qualifiers  (nqual_at2j+5)	/ 'OUTFILE'	/
+		DATA qualifiers  (nqual_at2j+6)	/ 'APPEND'	/
+		DATA qualifiers  (nqual_at2j+7)	/ 'CLOBBER'	/
+		DATA qualifiers  (nqual_at2j+8)	/ 'TREE'	/ ! was /DEPENDENCY
+		DATA qualifiers  (nqual_at2j+9)	/ 'SIGMA'	/
+		DATA qualifiers  (nqual_at2j+10)/ 'CURVILINEAR'	/
+		DATA qualifiers  (nqual_at2j+11)/ '****'	/
+		DATA qualifiers  (nqual_at2j+12)/ '****'	/
+* SHOW COMMANDS
+	   DATA subcommands      (nsub_at2 +10)	/ 'COMMANDS'	/
+	   DATA num_qualifs      (nsub_at2 +10)	/ nqual2k	/
+	   DATA qualifier_pointer(nsub_at2 +10)	/ nqual_at2k	/
+* SHOW COMMANDS /ALL
+		DATA qualifiers  (nqual_at2k+0)	/ 'ALL '	/
+* SHOW MEMORY
+	   DATA subcommands      (nsub_at2 +11)	/ 'MEMORY'	/
+	   DATA num_qualifs      (nsub_at2 +11)	/ nqual2l	/
+	   DATA qualifier_pointer(nsub_at2 +11)	/ nqual_at2l	/
+* SHOW MEMORY /ALL /TEMP /PERM /FREE
+		DATA qualifiers  (nqual_at2l+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at2l+1)	/ '****'	/
+		DATA qualifiers  (nqual_at2l+2)	/ 'TEMPORY'	/
+		DATA qualifiers  (nqual_at2l+3)	/ 'PERMANT'	/
+		DATA qualifiers  (nqual_at2l+4)	/ 'FREE'	/
+* SHOW GRID
+	   DATA subcommands      (nsub_at2 +12)	/ 'GRID'	/
+	   DATA num_qualifs      (nsub_at2 +12)	/ nqual2m	/
+	   DATA qualifier_pointer(nsub_at2 +12)	/ nqual_at2m	/
+* SHOW GRID /ALL/I/J/K/L/M/N/X/Y/Z/T/E/F/D/XML/OUTFILE/APPEND/CLOBBER 
+		DATA qualifiers  (nqual_at2m+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at2m+1)	/ 'I   '	/
+		DATA qualifiers  (nqual_at2m+2)	/ 'J   '	/
+		DATA qualifiers  (nqual_at2m+3)	/ 'K   '	/
+		DATA qualifiers  (nqual_at2m+4)	/ 'L   '	/
+		DATA qualifiers  (nqual_at2m+5)	/ 'M   '	/
+		DATA qualifiers  (nqual_at2m+6)	/ 'N   '	/
+		DATA qualifiers  (nqual_at2m+7)	/ 'X   '	/
+		DATA qualifiers  (nqual_at2m+8)	/ 'Y   '	/
+		DATA qualifiers  (nqual_at2m+9)	/ 'Z   '	/
+		DATA qualifiers  (nqual_at2m+10)/ 'T   '	/
+		DATA qualifiers  (nqual_at2m+11)/ 'E   '	/
+		DATA qualifiers  (nqual_at2m+12)/ 'F   '	/
+		DATA qualifiers  (nqual_at2m+13)/ 'DYNAMIC'	/
+		DATA qualifiers  (nqual_at2m+14)/ 'XML'	/
+		DATA qualifiers  (nqual_at2m+15)/ 'OUTFILE'	/
+		DATA qualifiers  (nqual_at2m+16)/ 'APPEND'	/
+		DATA qualifiers  (nqual_at2m+17)/ 'CLOBBER'	/
+		DATA qualifiers  (nqual_at2m+18)/ '****'	/
+		DATA qualifiers  (nqual_at2m+19)/ '****'	/
+* SHOW VIEW
+	   DATA subcommands      (nsub_at2 +13)	/ 'VIEWPORT'	/
+	   DATA num_qualifs      (nsub_at2 +13)	/ nqual2n	/
+	   DATA qualifier_pointer(nsub_at2 +13)	/ nqual_at2n	/
+* SHOW VIEW /ALL/ ****
+		DATA qualifiers  (nqual_at2n+0)	/ 'ALL'		/
+		DATA qualifiers  (nqual_at2n+1)	/ '****'	/
+		DATA qualifiers  (nqual_at2n+2)	/ '****'	/
+
+* SHOW TRANSFORMS
+	   DATA subcommands      (nsub_at2 +14)	/ 'TRANFORM'	/
+	   DATA num_qualifs      (nsub_at2 +14)	/ nqual2o	/
+	   DATA qualifier_pointer(nsub_at2 +14)	/ nqual_at2o	/
+* SHOW TRANS / ALL
+		DATA qualifiers  (nqual_at2o+0)	/ 'ALL'		/
+* SHOW ALIAS
+	   DATA subcommands      (nsub_at2 +15)	/ 'ALIAS'	/
+	   DATA num_qualifs      (nsub_at2 +15)	/ nqual2p	/
+	   DATA qualifier_pointer(nsub_at2 +15)	/ nqual_at2p	/
+* SHOW ALIAS / ****
+		DATA qualifiers  (nqual_at2p+0)	/ 'ALL'		/
+* SHOW SYMBOL
+	   DATA subcommands      (nsub_at2 +16)	/ 'SYMBOL'	/
+	   DATA num_qualifs      (nsub_at2 +16)	/ nqual2q	/
+	   DATA qualifier_pointer(nsub_at2 +16)	/ nqual_at2q	/
+* SHOW SYMBOL / ALL
+		DATA qualifiers  (nqual_at2q+0)	/ 'ALL'		/
+* SHOW ATTRIBUTE
+	   DATA subcommands      (nsub_at2 +17)	/ 'ATTRIBUT'	/
+	   DATA num_qualifs      (nsub_at2 +17)	/ nqual2r	/
+	   DATA qualifier_pointer(nsub_at2 +17)	/ nqual_at2r	/
+* SHOW ATTRIBUTE / ALL /DATASET /OUTPUT
+		DATA qualifiers  (nqual_at2r+0)	/ 'ALL'		/
+		DATA qualifiers  (nqual_at2r+1)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at2r+2)	/ 'OUTPUT'	/
+* SHOW NCCACHE
+	   DATA subcommands      (nsub_at2 +18)	/ 'NCCACHE'	/
+	   DATA num_qualifs      (nsub_at2 +18)	/ nqual2s	/
+	   DATA qualifier_pointer(nsub_at2 +18)	/ nqual_at2s	/
+* SHOW NCCACHE/ ****
+		DATA qualifiers  (nqual_at2s+0)	/ '****'	/
+* SHOW GIFFILE
+	   DATA subcommands      (nsub_at2 +19)	/ 'GIFFILE'	/
+	   DATA num_qualifs      (nsub_at2 +19)	/ nqual2t	/
+	   DATA qualifier_pointer(nsub_at2 +19)	/ nqual_at2t	/
+* SHOW GIFFILE/ ****
+		DATA qualifiers  (nqual_at2t+0)	/ '****'	/
+* SHOW FUNCTION
+	   DATA subcommands      (nsub_at2 +20)	/ 'FUNCTION'	/
+	   DATA num_qualifs      (nsub_at2 +20)	/ nqual2u	/
+	   DATA qualifier_pointer(nsub_at2 +20)	/ nqual_at2u	/
+* SHOW FUNCTION / ALL / BRIEF / EXTERNAL / INTERNAL
+		DATA qualifiers  (nqual_at2u+0)	/ 'ALL'		/
+		DATA qualifiers  (nqual_at2u+1)	/ 'BRIEF'	/
+		DATA qualifiers  (nqual_at2u+2)	/ 'EXTERNAL'	/
+		DATA qualifiers  (nqual_at2u+3)	/ 'INTERNAL'	/
+		DATA qualifiers  (nqual_at2u+4)	/ 'DETAILS'	/
+		DATA qualifiers  (nqual_at2u+5)	/ '****'	/
+		DATA qualifiers  (nqual_at2u+6)	/ '****'	/
+* SHOW QUERIES							 
+	   DATA subcommands      (nsub_at2 +21)	/ 'QUERIES'	/
+	   DATA num_qualifs      (nsub_at2 +21)	/ nqual2v	/
+	   DATA qualifier_pointer(nsub_at2 +21)	/ nqual_at2v	/
+* SHOW QUERIES / ****
+		DATA qualifiers  (nqual_at2v+0)	/ 'ALL'		/
+		DATA qualifiers  (nqual_at2v+1)	/ '****'	/
+		DATA qualifiers  (nqual_at2v+2)	/ '****'	/
+
+* CANCEL	 - command # 3
+	DATA commands(3)			/ 'CANCEL'	/
+        DATA its_action_command(3)              / .FALSE.       /
+	DATA num_subcommands(3)			/ nsub3		/
+	DATA subcommand_pointer(3)		/ nsub_at3	/
+* CANCEL '    '
+	   DATA subcommands      (nsub_at3 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at3 + 0)	/ nqual3a	/
+	   DATA qualifier_pointer(nsub_at3 + 0)	/ nqual_at3a	/
+* CANCEL WINDOW
+	   DATA subcommands      (nsub_at3 + 1)	/ 'WIND'	/
+	   DATA num_qualifs      (nsub_at3 + 1)	/ nqual3b	/
+	   DATA qualifier_pointer(nsub_at3 + 1)	/ nqual_at3b	/
+* CANCEL WINDOW /ALL
+		DATA qualifiers  (nqual_at3b+0)	/ 'ALL '	/
+* CANCEL REGION
+	   DATA subcommands      (nsub_at3 + 2)	/ 'REGION'	/
+	   DATA num_qualifs      (nsub_at3 + 2)	/ nqual3c	/
+	   DATA qualifier_pointer(nsub_at3 + 2)	/ nqual_at3c	/
+* CANCEL REGIONS /ALL/I/J/K/L/M/N/X/Y/Z/T/E/F
+		DATA qualifiers  (nqual_at3c+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at3c+1)	/ 'I   '	/
+		DATA qualifiers  (nqual_at3c+2)	/ 'J   '	/
+		DATA qualifiers  (nqual_at3c+3)	/ 'K   '	/
+		DATA qualifiers  (nqual_at3c+4)	/ 'L   '	/
+		DATA qualifiers  (nqual_at3c+5)	/ 'M   '	/
+		DATA qualifiers  (nqual_at3c+6)	/ 'N   '	/
+		DATA qualifiers  (nqual_at3c+7)	/ 'X   '	/
+		DATA qualifiers  (nqual_at3c+8)	/ 'Y   '	/
+		DATA qualifiers  (nqual_at3c+9)	/ 'Z   '	/
+		DATA qualifiers  (nqual_at3c+10)/ 'T   '	/
+		DATA qualifiers  (nqual_at3c+11)/ 'E   '	/
+		DATA qualifiers  (nqual_at3c+12)/ 'F   '	/
+* CANCEL MEMORY
+	   DATA subcommands      (nsub_at3 + 3)	/ 'MEMORY'	/
+	   DATA num_qualifs      (nsub_at3 + 3)	/ nqual3d	/
+	   DATA qualifier_pointer(nsub_at3 + 3)	/ nqual_at3d	/
+* CANCEL MEMORY /ALL
+		DATA qualifiers  (nqual_at3d+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at3d+1)	/ 'TEMPORY'	/
+		DATA qualifiers  (nqual_at3d+2)	/ 'PERMANT'	/
+* CANCEL EXPRSIONION
+	   DATA subcommands      (nsub_at3 + 4)	/ 'EXPRSION'	/
+	   DATA num_qualifs      (nsub_at3 + 4)	/ nqual3e	/
+	   DATA qualifier_pointer(nsub_at3 + 4)	/ nqual_at3e	/
+* CANCEL EXPRSION /ALL
+		DATA qualifiers  (nqual_at3e+0)	/ 'ALL '	/
+* CANCEL LIST
+	   DATA subcommands      (nsub_at3 + 5)	/ 'LIST'	/
+	   DATA num_qualifs      (nsub_at3 + 5)	/ nqual3f	/
+	   DATA qualifier_pointer(nsub_at3 + 5)	/ nqual_at3f	/
+* CANCEL LIST /ALL, /PRECISION, /FILE, /FORMAT
+		DATA qualifiers  (nqual_at3f+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at3f+1)	/ 'PRECISION'	/
+		DATA qualifiers  (nqual_at3f+2)	/ 'FILE'	/
+		DATA qualifiers  (nqual_at3f+3)	/ 'FORMAT'	/
+		DATA qualifiers  (nqual_at3f+4)	/ 'HEADING'	/
+		DATA qualifiers  (nqual_at3f+5)	/ 'APPEND'	/
+		DATA qualifiers  (nqual_at3f+6)	/ 'OUTTYPE'	/
+* CANCEL DATA_SET
+	   DATA subcommands      (nsub_at3 + 6)	/ 'DATA'	/
+	   DATA num_qualifs      (nsub_at3 + 6)	/ nqual3g	/
+	   DATA qualifier_pointer(nsub_at3 + 6)	/ nqual_at3g	/
+* CANCEL DATA /ALL
+		DATA qualifiers  (nqual_at3g+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at3g+1)	/ 'NOERROR'	/
+* CANCEL MODE
+	   DATA subcommands      (nsub_at3 + 7)	/ 'MODE'	/
+	   DATA num_qualifs      (nsub_at3 + 7)	/ nqual3h	/
+	   DATA qualifier_pointer(nsub_at3 + 7)	/ nqual_at3h	/
+* CANCEL MODE / ****
+		DATA qualifiers  (nqual_at3h+0)	/ '****'	/
+* CANCEL MOVIE
+	   DATA subcommands      (nsub_at3 + 8)	/ 'MOVIE'	/
+	   DATA num_qualifs      (nsub_at3 + 8)	/ nqual3i	/
+	   DATA qualifier_pointer(nsub_at3 + 8)	/ nqual_at3i	/
+* CANCEL MOVIE /ALL
+		DATA qualifiers  (nqual_at3i+0)	/ 'ALL '	/
+* CANCEL VIEWPORT
+	   DATA subcommands      (nsub_at3 + 9)	/ 'VIEWPORT'	/
+	   DATA num_qualifs      (nsub_at3 + 9)	/ nqual3j	/
+	   DATA qualifier_pointer(nsub_at3 + 9)	/ nqual_at3j	/
+		DATA qualifiers  (nqual_at3j+0)	/ '****' /
+* CANCEL VARIABLE
+	   DATA subcommands      (nsub_at3 +10)	/ 'VARIABLE'	/
+	   DATA num_qualifs      (nsub_at3 +10)	/ nqual3k	/
+	   DATA qualifier_pointer(nsub_at3 +10)	/ nqual_at3k	/
+		DATA qualifiers  (nqual_at3k+0)	/ 'ALL '	/
+		DATA qualifiers  (nqual_at3k+1)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at3k+2)	/ 'SIGMA'	/
+		DATA qualifiers  (nqual_at3k+3)	/ 'CURVILINEAR'	/
+		DATA qualifiers  (nqual_at3k+4)	/ '****'	/
+		DATA qualifiers  (nqual_at3k+5)	/ '****'	/
+* CANCEL AXIS
+	   DATA subcommands      (nsub_at3 +11)	/ 'AXIS'	/
+	   DATA num_qualifs      (nsub_at3 +11)	/ nqual3l	/
+	   DATA qualifier_pointer(nsub_at3 +11)	/ nqual_at3l	/
+		DATA qualifiers  (nqual_at3l+0)	/ 'MODULO'	/
+		DATA qualifiers  (nqual_at3l+1)	/ 'ALL'         /
+		DATA qualifiers  (nqual_at3l+2)	/ 'DEPTH'       /
+		DATA qualifiers  (nqual_at3l+3) / 'STRIDE'      /
+		DATA qualifiers  (nqual_at3l+4) / '****'        /
+		DATA qualifiers  (nqual_at3l+5) / '****'        /
+* CANCEL GRID
+	   DATA subcommands      (nsub_at3 +12)	/ 'GRID'	/
+	   DATA num_qualifs      (nsub_at3 +12)	/ nqual3m	/
+	   DATA qualifier_pointer(nsub_at3 +12)	/ nqual_at3m	/
+		DATA qualifiers  (nqual_at3m+0)	/ '****'	/
+* CANCEL ATTRIBUTE /OUTPUT /DATA
+	   DATA subcommands      (nsub_at3 +13)	/ 'ATTRIBUT'	/
+	   DATA num_qualifs      (nsub_at3 +13)	/ nqual3n	/
+	   DATA qualifier_pointer(nsub_at3 +13)	/ nqual_at3n	/
+		DATA qualifiers  (nqual_at3n+0)	/ 'OUTPUT'	/
+		DATA qualifiers  (nqual_at3n+1)	/ 'DATA'	/
+* CANCEL REDIRECT
+	   DATA subcommands      (nsub_at3 +14)	/ 'REDIRECT'	/
+	   DATA num_qualifs      (nsub_at3 +14)	/ nqual3o	/
+	   DATA qualifier_pointer(nsub_at3 +14)	/ nqual_at3o	/
+		DATA qualifiers  (nqual_at3o+0)	/ '****'	/
+* CANCEL ALIAS
+	   DATA subcommands      (nsub_at3 +15)	/ 'ALIAS'	/
+	   DATA num_qualifs      (nsub_at3 +15)	/ nqual3p	/
+	   DATA qualifier_pointer(nsub_at3 +15)	/ nqual_at3p	/
+		DATA qualifiers  (nqual_at3p+0)	/ 'ALL'	/
+* CANCEL SYMBOL							  
+	   DATA subcommands      (nsub_at3 +16)	/ 'SYMBOL'	/
+	   DATA num_qualifs      (nsub_at3 +16)	/ nqual3q	/
+	   DATA qualifier_pointer(nsub_at3 +16)	/ nqual_at3q	/
+		DATA qualifiers  (nqual_at3q+0)	/ 'ALL'	/
+* CANCEL NCCACHE
+	   DATA subcommands      (nsub_at3 +17)	/ 'NCCACHE'	/
+	   DATA num_qualifs      (nsub_at3 +17)	/ nqual3r	/
+	   DATA qualifier_pointer(nsub_at3 +17)	/ nqual_at3r	/
+		DATA qualifiers  (nqual_at3r+0)	/ '****'	/
+* CANCEL PYVAR
+	   DATA subcommands      (nsub_at3 +18)	/ 'PYVAR'	/
+	   DATA num_qualifs      (nsub_at3 +18)	/ nqual3s	/
+	   DATA qualifier_pointer(nsub_at3 +18)	/ nqual_at3s	/
+		DATA qualifiers  (nqual_at3s+0)	/ 'ALL'		/
+		DATA qualifiers  (nqual_at3s+1)	/ 'DATASET'	/
+		DATA qualifiers  (nqual_at3s+2)	/ '****'	/
+* CANCEL ****							  ! unused(t)
+	   DATA subcommands      (nsub_at3 +19)	/ '****'	/
+	   DATA num_qualifs      (nsub_at3 +19)	/ nqual3t	/
+	   DATA qualifier_pointer(nsub_at3 +19)	/ nqual_at3t	/
+		DATA qualifiers  (nqual_at3t+0)	/ '****'	/
+		DATA qualifiers  (nqual_at3t+1)	/ '****'	/
+		DATA qualifiers  (nqual_at3t+2)	/ '****'	/
+
+* CONTOUR - command # 4
+	DATA commands(4)			/ 'CONTOUR'	/
+        DATA its_action_command(4)              / .TRUE.        /
+	DATA num_subcommands(4)			/ nsub4		/
+	DATA subcommand_pointer(4)		/ nsub_at4	/
+* CONTOUR '    '
+	   DATA subcommands      (nsub_at4 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at4 + 0)	/ nqual4a	/
+	   DATA qualifier_pointer(nsub_at4 + 0)	/ nqual_at4a	/
+* CONTOUR/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE
+		DATA qualifiers  (nqual_at4a+0)	/ 'I'	/
+		DATA qualifiers  (nqual_at4a+1)	/ 'J'	/
+		DATA qualifiers  (nqual_at4a+2)	/ 'K'	/
+		DATA qualifiers  (nqual_at4a+3)	/ 'L'	/
+		DATA qualifiers  (nqual_at4a+4)	/ 'M'	/
+		DATA qualifiers  (nqual_at4a+5)	/ 'N'	/
+		DATA qualifiers  (nqual_at4a+6)	/ 'X'	/
+		DATA qualifiers  (nqual_at4a+7)	/ 'Y'	/
+		DATA qualifiers  (nqual_at4a+8)	/ 'Z'	/
+		DATA qualifiers  (nqual_at4a+9)	/ 'T'	/
+		DATA qualifiers  (nqual_at4a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at4a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at4a+12)/ 'OVERLAY'/	!/overlays
+		DATA qualifiers  (nqual_at4a+13)/ 'SET_UP'/	!/set_up
+		DATA qualifiers  (nqual_at4a+14)/ 'FRAME'/	!/frame
+		DATA qualifiers  (nqual_at4a+15)/ 'D'   /	!/data_set
+		DATA qualifiers  (nqual_at4a+16)/ 'TRANPOSE'/	!/transpose
+		DATA qualifiers  (nqual_at4a+17)/ 'FILL'/	!
+		DATA qualifiers  (nqual_at4a+18)/ 'LINE'/	!
+		DATA qualifiers  (nqual_at4a+19)/ 'NOLABEL'/	!/nolabel
+		DATA qualifiers  (nqual_at4a+20)/ 'LEVELS'/	!/levels_same
+		DATA qualifiers  (nqual_at4a+21)/ 'KEY' /	!
+		DATA qualifiers  (nqual_at4a+22)/ 'NOKEY'/	!
+		DATA qualifiers  (nqual_at4a+23)/ 'PALETTE'/	!
+		DATA qualifiers  (nqual_at4a+24)/ 'XLIMITS'/	!/xlimits
+		DATA qualifiers  (nqual_at4a+25)/ 'YLIMITS'/	!/ylimits
+		DATA qualifiers  (nqual_at4a+26)/ 'TITLE'/	!/title
+		DATA qualifiers  (nqual_at4a+27)/ 'COLOR'/	!/color
+		DATA qualifiers  (nqual_at4a+28)/ 'NOAXES'/	!/noaxes
+		DATA qualifiers  (nqual_at4a+29)/ 'PATTERN'/	!/pattern=
+		DATA qualifiers  (nqual_at4a+30)/ 'SIZE'/	!/size
+		DATA qualifiers  (nqual_at4a+31)/ 'SPACING'/	!/spacing
+		DATA qualifiers  (nqual_at4a+32)/ 'SIGDIG'/	!/sigdig
+		DATA qualifiers  (nqual_at4a+33)/ 'PEN'/	!/pen (denig!!)
+		DATA qualifiers  (nqual_at4a+34)/ 'HLIMITS'/	! horiz
+		DATA qualifiers  (nqual_at4a+35)/ 'VLIMITS'/	! vertical
+		DATA qualifiers  (nqual_at4a+36)/ '****'/	! HLOG (place holder, not implemented for contuor) 
+		DATA qualifiers  (nqual_at4a+37)/ '****'/	! VLOG (place holder)
+		DATA qualifiers  (nqual_at4a+38)/ 'AXES'/	! /axes[=...]
+		DATA qualifiers  (nqual_at4a+39)/ 'HGRATICU'/	! tic liness, dash or line
+		DATA qualifiers  (nqual_at4a+40)/ 'VGRATICU'/	! tic liness, color or pen#
+		DATA qualifiers  (nqual_at4a+41)/ 'GRATICUL'/	! 
+		DATA qualifiers  (nqual_at4a+42)/ 'MODULO'/	! modulo for curvilinear plots
+		DATA qualifiers  (nqual_at4a+43)/ 'THICKNES'/	! pen thickness
+		DATA qualifiers  (nqual_at4a+44)/ 'OPACITY'/	! overriding oapcity
+
+* LIST	 - command # 5
+	DATA commands(5)			/ 'LIST'	/
+        DATA its_action_command(5)              / .TRUE.        /
+	DATA num_subcommands(5)			/ nsub5		/
+	DATA subcommand_pointer(5)		/ nsub_at5	/
+* LIST '    '
+	   DATA subcommands      (nsub_at5 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at5 + 0)	/ nqual5a	/
+	   DATA qualifier_pointer(nsub_at5 + 0)	/ nqual_at5a	/
+* LIST/I/J/K/L/M/N/X/Y/Z/T/E/F/D /HEAD /NOHEAD /G /FILE /APPEND /ORDER /FORMAT /QUIET 
+		DATA qualifiers  (nqual_at5a+0)	/ 'I'	/
+		DATA qualifiers  (nqual_at5a+1)	/ 'J'	/
+		DATA qualifiers  (nqual_at5a+2)	/ 'K'	/
+		DATA qualifiers  (nqual_at5a+3)	/ 'L'	/
+		DATA qualifiers  (nqual_at5a+4)	/ 'M'	/
+		DATA qualifiers  (nqual_at5a+5)	/ 'N'	/
+		DATA qualifiers  (nqual_at5a+6)	/ 'X'	/
+		DATA qualifiers  (nqual_at5a+7)	/ 'Y'	/
+		DATA qualifiers  (nqual_at5a+8)	/ 'Z'	/
+		DATA qualifiers  (nqual_at5a+9)	/ 'T'	/
+		DATA qualifiers  (nqual_at5a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at5a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at5a+12)/ 'D'	/
+		DATA qualifiers  (nqual_at5a+13)/ 'HEADING'/
+		DATA qualifiers  (nqual_at5a+14)/ 'NOHEAD'/
+		DATA qualifiers  (nqual_at5a+15)/ 'SINGLE'/
+		DATA qualifiers  (nqual_at5a+16)/ 'FILE'/
+		DATA qualifiers  (nqual_at5a+17)/ 'APPEND'/
+		DATA qualifiers  (nqual_at5a+18)/ 'ORDER'/
+		DATA qualifiers  (nqual_at5a+19)/ 'FORMAT'/
+		DATA qualifiers  (nqual_at5a+20)/ 'TITLE'/
+		DATA qualifiers  (nqual_at5a+21)/ 'PRECISION'/ !used to be EPKEY 
+		DATA qualifiers  (nqual_at5a+22)/ 'RIGID'/ ! /RIGID (CDF)
+		DATA qualifiers  (nqual_at5a+23)/ 'ILIMITS'/ 
+		DATA qualifiers  (nqual_at5a+24)/ 'JLIMITS'/
+		DATA qualifiers  (nqual_at5a+25)/ 'KLIMITS'/
+		DATA qualifiers  (nqual_at5a+26)/ 'LLIMITS'/
+		DATA qualifiers  (nqual_at5a+27)/ 'MLIMITS'/
+		DATA qualifiers  (nqual_at5a+28)/ 'NLIMITS'/
+		DATA qualifiers  (nqual_at5a+29)/ 'XLIMITS'/
+		DATA qualifiers  (nqual_at5a+30)/ 'YLIMITS'/
+		DATA qualifiers  (nqual_at5a+31)/ 'ZLIMITS'/
+		DATA qualifiers  (nqual_at5a+32)/ 'TLIMITS'/
+		DATA qualifiers  (nqual_at5a+33)/ 'ELIMITS'/
+		DATA qualifiers  (nqual_at5a+34)/ 'FLIMITS'/
+		DATA qualifiers  (nqual_at5a+35)/ 'CLOBBER'/
+		DATA qualifiers  (nqual_at5a+36)/ 'QUIET'/
+		DATA qualifiers  (nqual_at5a+37)/ 'WIDTH'/
+		DATA qualifiers  (nqual_at5a+38)/ 'EDGES'/
+		DATA qualifiers  (nqual_at5a+39)/ 'BOUNDS'/
+		DATA qualifiers  (nqual_at5a+40)/ 'NOBOUNDS'/
+		DATA qualifiers  (nqual_at5a+41)/ 'NOROWLAB'/
+		DATA qualifiers  (nqual_at5a+42)/ 'KEEP_AXI'/
+		DATA qualifiers  (nqual_at5a+43)/ 'NCFORMAT'/
+		DATA qualifiers  (nqual_at5a+44)/ 'XCHUNK'/
+		DATA qualifiers  (nqual_at5a+45)/ 'YCHUNK'/
+		DATA qualifiers  (nqual_at5a+46)/ 'ZCHUNK'/
+		DATA qualifiers  (nqual_at5a+47)/ 'TCHUNK'/
+		DATA qualifiers  (nqual_at5a+48)/ 'ECHUNK'/
+		DATA qualifiers  (nqual_at5a+49)/ 'FCHUNK'/
+		DATA qualifiers  (nqual_at5a+50)/ 'DEFLATE'/
+		DATA qualifiers  (nqual_at5a+51)/ 'SHUFFLE'/
+		DATA qualifiers  (nqual_at5a+52)/ 'ENDIAN'/
+		DATA qualifiers  (nqual_at5a+53)/ 'OUTTYPE'/
+		DATA qualifiers  (nqual_at5a+54)/ 'CURVILIN'/
+		DATA qualifiers  (nqual_at5a+55)/ 'SIGMA'/
+		DATA qualifiers  (nqual_at5a+56)/ '****'/
+		DATA qualifiers  (nqual_at5a+57)/ '****'/
+		DATA qualifiers  (nqual_at5a+58)/ '****'/
+		DATA qualifiers  (nqual_at5a+59)/ '****'/
+
+* PLOT - command # 6
+	DATA commands(6)			/ 'PLOT'	/
+        DATA its_action_command(6)              / .TRUE.        /
+	DATA num_subcommands(6)			/ nsub6		/
+	DATA subcommand_pointer(6)		/ nsub_at6	/
+* PLOT '    '
+	   DATA subcommands      (nsub_at6 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at6 + 0)	/ nqual6a	/
+	   DATA qualifier_pointer(nsub_at6 + 0)	/ nqual_at6a	/
+* PLOT/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE/VS
+		DATA qualifiers  (nqual_at6a+0)	/ 'I'	/
+		DATA qualifiers  (nqual_at6a+1)	/ 'J'	/
+		DATA qualifiers  (nqual_at6a+2)	/ 'K'	/
+		DATA qualifiers  (nqual_at6a+3)	/ 'L'	/
+		DATA qualifiers  (nqual_at6a+4)	/ 'M'	/
+		DATA qualifiers  (nqual_at6a+5)	/ 'N'	/
+		DATA qualifiers  (nqual_at6a+6)	/ 'X'	/
+		DATA qualifiers  (nqual_at6a+7)	/ 'Y'	/
+		DATA qualifiers  (nqual_at6a+8)	/ 'Z'	/
+		DATA qualifiers  (nqual_at6a+9) / 'T'	/
+		DATA qualifiers  (nqual_at6a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at6a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at6a+12)/ '****'/
+		DATA qualifiers  (nqual_at6a+13)/ 'OVERLAY'/	!/overlays
+		DATA qualifiers  (nqual_at6a+14)/ 'SET_UP'/	!/set_up
+		DATA qualifiers  (nqual_at6a+15)/ 'FRAME'/	!/frame
+		DATA qualifiers  (nqual_at6a+16)/ 'D'   /	!/data_set
+		DATA qualifiers  (nqual_at6a+17)/ 'TRANPOSE'/	!/transpose
+		DATA qualifiers  (nqual_at6a+18)/ 'VS  '/	!/versus
+		DATA qualifiers  (nqual_at6a+19)/ 'SYMBOL'/	!/symbol
+		DATA qualifiers  (nqual_at6a+20)/ 'NOLABEL'/	!/nolabel
+		DATA qualifiers  (nqual_at6a+21)/ 'LINE'/	!/line
+		DATA qualifiers  (nqual_at6a+22)/ 'COLOR'/	!/color
+		DATA qualifiers  (nqual_at6a+23)/ 'THICKNES'/	!/thickness
+		DATA qualifiers  (nqual_at6a+24)/ 'XLIMITS'/	!/xlimits
+		DATA qualifiers  (nqual_at6a+25)/ 'YLIMITS'/	!/ylimits
+		DATA qualifiers  (nqual_at6a+26)/ 'TITLE'/	!/title
+		DATA qualifiers  (nqual_at6a+27)/ 'SIZE'/	!/size
+		DATA qualifiers  (nqual_at6a+28)/ 'NOAXES'/	!/noaxes
+		DATA qualifiers  (nqual_at6a+29)/ 'STEP'/	!/step
+		DATA qualifiers  (nqual_at6a+30)/ 'DASH'/	!/dash
+		DATA qualifiers  (nqual_at6a+31)/ 'AXES'/	!/axes[=]
+		DATA qualifiers  (nqual_at6a+32)/ 'HGRATICU'/	!horiz tic lines
+		DATA qualifiers  (nqual_at6a+33)/ 'VGRATICU'/	!vert tic lines
+		DATA qualifiers  (nqual_at6a+34)/ 'HLIMITS'/	! horiz
+		DATA qualifiers  (nqual_at6a+35)/ 'VLIMITS'/	! vertical
+		DATA qualifiers  (nqual_at6a+36)/ 'HLOG'/	! log axis horiz
+		DATA qualifiers  (nqual_at6a+37)/ 'VLOG'/	! log axis vert
+		DATA qualifiers  (nqual_at6a+38)/ 'GRATICUL'/	! tic lines
+		DATA qualifiers  (nqual_at6a+39)/ 'NOKEY'/	! nokey
+		DATA qualifiers  (nqual_at6a+40)/ 'NOYADJUS'/	! noyadjust
+		DATA qualifiers  (nqual_at6a+41)/ 'KEY'/	! [=cont] for Ribbon plot
+		DATA qualifiers  (nqual_at6a+42)/ 'RIBBON'/	! for Ribbon plot
+		DATA qualifiers  (nqual_at6a+43)/ 'LEVELS'/	! 
+		DATA qualifiers  (nqual_at6a+44)/ 'PALETTE'/	! 
+		DATA qualifiers  (nqual_at6a+45)/ 'FAST'/	! style for Ribbon plot
+		DATA qualifiers  (nqual_at6a+46)/ 'MISSING'/	! For missing-dat in ribbon plot
+		DATA qualifiers  (nqual_at6a+47)/ 'OPACITY'/	! overriding opacity
+
+* GO	 - command # 7
+	DATA commands(7)			/ 'GO  '	/
+        DATA its_action_command(7)              / .FALSE.       /
+	DATA num_subcommands(7)			/ nsub7		/
+	DATA subcommand_pointer(7)		/ nsub_at7	/
+* GO '    '
+	   DATA subcommands      (nsub_at7 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at7 + 0)	/ nqual7a	/
+	   DATA qualifier_pointer(nsub_at7 + 0)	/ nqual_at7a	/
+* GO (8 unused qualifiers)
+		DATA qualifiers  (nqual_at7a+0)	/ 'HELP'	/
+		DATA qualifiers  (nqual_at7a+1)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+2)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+3)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+4)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+5)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+6)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+7)	/ '****'	/
+		DATA qualifiers  (nqual_at7a+8)	/ '****'	/
+
+* HELP	 - command # 8
+	DATA commands(8)			/ 'HELP'	/
+        DATA its_action_command(8)              / .FALSE.       /
+	DATA num_subcommands(8)			/ nsub8		/
+	DATA subcommand_pointer(8)		/ nsub_at8	/
+* HELP '    '
+	   DATA subcommands      (nsub_at8 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at8 + 0)	/ nqual8a	/
+	   DATA qualifier_pointer(nsub_at8 + 0)	/ nqual_at8a	/
+
+* LOAD - command # 9
+	DATA commands(9)			/ 'LOAD'	/
+        DATA its_action_command(9)              / .TRUE.        /
+	DATA num_subcommands(9)			/ nsub9		/
+	DATA subcommand_pointer(9)		/ nsub_at9	/
+* LOAD '    '
+	   DATA subcommands      (nsub_at9 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at9 + 0)	/ nqual9a	/
+	   DATA qualifier_pointer(nsub_at9 + 0)	/ nqual_at9a	/
+* LOAD /TEMPORARY /PERMANENT /I/J/K/L/M/N/X/Y/Z/T/E/F/D /NAME
+		DATA qualifiers  (nqual_at9a+0)	/ 'TEMPORY'/
+		DATA qualifiers  (nqual_at9a+1)	/ 'PERMANT'/
+		DATA qualifiers  (nqual_at9a+2)	/ 'I'	/
+		DATA qualifiers  (nqual_at9a+3)	/ 'J'	/
+		DATA qualifiers  (nqual_at9a+4)	/ 'K'	/
+		DATA qualifiers  (nqual_at9a+5)	/ 'L'	/
+		DATA qualifiers  (nqual_at9a+6)	/ 'M'	/
+		DATA qualifiers  (nqual_at9a+7)	/ 'N'	/
+		DATA qualifiers  (nqual_at9a+8)	/ 'X'	/
+		DATA qualifiers  (nqual_at9a+9)	/ 'Y'	/
+		DATA qualifiers  (nqual_at9a+10)/ 'Z'	/
+		DATA qualifiers  (nqual_at9a+11)/ 'T'	/
+		DATA qualifiers  (nqual_at9a+12)/ 'E'	/
+		DATA qualifiers  (nqual_at9a+13)/ 'F'	/
+		DATA qualifiers  (nqual_at9a+14)/ 'D'	/
+		DATA qualifiers  (nqual_at9a+15)/ 'NAME'/
+
+* DEFINE - command # 10
+	DATA commands(10)			/ 'DEFINE'	/
+        DATA its_action_command(10)             / .FALSE.       /
+	DATA num_subcommands(10)		/ nsub10	/
+	DATA subcommand_pointer(10)		/ nsub_at10	/
+* DEFINE '    '
+	   DATA subcommands      (nsub_at10 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at10 + 0)/ nqual10a	/
+	   DATA qualifier_pointer(nsub_at10 + 0)/ nqual_at10a	/
+* DEFINE REGION
+	   DATA subcommands      (nsub_at10 + 1)/ 'REGION'	/
+	   DATA num_qualifs      (nsub_at10 + 1)/ nqual10b	/
+	   DATA qualifier_pointer(nsub_at10 + 1)/ nqual_at10b	/
+* DEFINE REGION /I/J/K/L/M/N/X/Y/Z/T/E/F /DEFAULT / ****
+		DATA qualifiers  (nqual_at10b+0)/ 'I'	/
+		DATA qualifiers  (nqual_at10b+1)/ 'J'	/
+		DATA qualifiers  (nqual_at10b+2)/ 'K'	/
+		DATA qualifiers  (nqual_at10b+3)/ 'L'	/
+		DATA qualifiers  (nqual_at10b+4)/ 'M'	/
+		DATA qualifiers  (nqual_at10b+5)/ 'N'	/
+		DATA qualifiers  (nqual_at10b+6)/ 'X'	/
+		DATA qualifiers  (nqual_at10b+7)/ 'Y'	/
+		DATA qualifiers  (nqual_at10b+8)/ 'Z'	/
+		DATA qualifiers  (nqual_at10b+9)/ 'T'	/
+		DATA qualifiers  (nqual_at10b+10)/ 'E'	/
+		DATA qualifiers  (nqual_at10b+11)/ 'F'	/
+		DATA qualifiers  (nqual_at10b+12)/ 'DEFAULT'/
+		DATA qualifiers  (nqual_at10b+13)/ '****'/
+		DATA qualifiers  (nqual_at10b+14)/ 'DX'/
+		DATA qualifiers  (nqual_at10b+15)/ 'DY'/
+		DATA qualifiers  (nqual_at10b+16)/ 'DZ'/
+		DATA qualifiers  (nqual_at10b+17)/ 'DT'/
+		DATA qualifiers  (nqual_at10b+18)/ 'DE'/
+		DATA qualifiers  (nqual_at10b+19)/ 'DF'/
+		DATA qualifiers  (nqual_at10b+20)/ 'DI'/
+		DATA qualifiers  (nqual_at10b+21)/ 'DJ'/
+		DATA qualifiers  (nqual_at10b+22)/ 'DK'/
+		DATA qualifiers  (nqual_at10b+23)/ 'DL'/
+		DATA qualifiers  (nqual_at10b+24)/ 'DM'/
+		DATA qualifiers  (nqual_at10b+25)/ 'DN'/
+* DEFINE GRID
+	   DATA subcommands      (nsub_at10 + 2)/ 'GRID'	/
+	   DATA num_qualifs      (nsub_at10 + 2)/ nqual10c	/
+	   DATA qualifier_pointer(nsub_at10 + 2)/ nqual_at10c	/
+* DEFINE GRID /X/Y/Z/T/E/F /FILE /LIKE
+		DATA qualifiers  (nqual_at10c+ 0)/ 'X'	  /
+		DATA qualifiers  (nqual_at10c+ 1)/ 'Y'	  /
+		DATA qualifiers  (nqual_at10c+ 2)/ 'Z'	  /
+		DATA qualifiers  (nqual_at10c+ 3)/ 'T'	  /
+		DATA qualifiers  (nqual_at10c+ 4)/ 'E'	  /
+		DATA qualifiers  (nqual_at10c+ 5)/ 'F'	  /
+		DATA qualifiers  (nqual_at10c+ 6)/ 'FILE' /
+		DATA qualifiers  (nqual_at10c+ 7)/ 'LIKE' /
+		DATA qualifiers  (nqual_at10c+ 8)/ '****' /
+		DATA qualifiers  (nqual_at10c+ 9)/ '****' /
+		DATA qualifiers  (nqual_at10c+10)/ '****' /
+* DEFINE VARIABLE
+	   DATA subcommands      (nsub_at10 + 3)/ 'VARIABLE'	/
+	   DATA num_qualifs      (nsub_at10 + 3)/ nqual10d	/
+	   DATA qualifier_pointer(nsub_at10 + 3)/ nqual_at10d	/
+* DEFINE VARIABLE /TITLE /UNITS /QUIET /DATASET /BAD /REMOTE
+		DATA qualifiers  (nqual_at10d+ 0)/ 'TITLE' /
+		DATA qualifiers  (nqual_at10d+ 1)/ 'UNITS' /
+		DATA qualifiers  (nqual_at10d+ 2)/ 'QUIET' /
+		DATA qualifiers  (nqual_at10d+ 3)/ 'DATASET' /
+		DATA qualifiers  (nqual_at10d+ 4)/ 'BAD' /
+		DATA qualifiers  (nqual_at10d+ 5)/ 'REMOTE' /
+* DEFINE AXIS
+	   DATA subcommands      (nsub_at10 + 4)/ 'AXIS'	/
+	   DATA num_qualifs      (nsub_at10 + 4)/ nqual10e	/
+	   DATA qualifier_pointer(nsub_at10 + 4)/ nqual_at10e	/
+* DEFINE AXIS /X/Y/Z/T/E/F /FILE /UNITS /QUIET ...
+		DATA qualifiers  (nqual_at10e+ 0)/ 'X'	  /
+		DATA qualifiers  (nqual_at10e+ 1)/ 'Y'	  /
+		DATA qualifiers  (nqual_at10e+ 2)/ 'Z'	  /
+		DATA qualifiers  (nqual_at10e+ 3)/ 'T'	  /
+		DATA qualifiers  (nqual_at10e+ 4)/ 'E'	  /
+		DATA qualifiers  (nqual_at10e+ 5)/ 'F'	  /
+		DATA qualifiers  (nqual_at10e+ 6)/ 'FILE' /
+		DATA qualifiers  (nqual_at10e+ 7)/ 'UNITS' /
+		DATA qualifiers  (nqual_at10e+ 8)/ 'T0' /
+		DATA qualifiers  (nqual_at10e+ 9)/ 'NAME' /
+		DATA qualifiers  (nqual_at10e+ 10)/ 'FROMDATA' /
+		DATA qualifiers  (nqual_at10e+ 11)/ 'DEPTH' /
+		DATA qualifiers  (nqual_at10e+ 12)/ 'MODULO' /
+		DATA qualifiers  (nqual_at10e+ 13)/ 'NPOINTS' /
+		DATA qualifiers  (nqual_at10e+ 14)/ 'EDGES' /
+		DATA qualifiers  (nqual_at10e+ 15)/ 'CALENDAR' /
+		DATA qualifiers  (nqual_at10e+ 16)/ 'BOUNDS' /
+		DATA qualifiers  (nqual_at10e+ 17)/ 'QUIET' /
+		DATA qualifiers  (nqual_at10e+ 18)/ '****' /
+		DATA qualifiers  (nqual_at10e+ 19)/ '****' /
+* DEFINE VIEW
+	   DATA subcommands      (nsub_at10 + 5)/ 'VIEWPORT'	/
+	   DATA num_qualifs      (nsub_at10 + 5)/ nqual10f	/
+	   DATA qualifier_pointer(nsub_at10 + 5)/ nqual_at10f	/
+* DEFINE VIEW /SIZE/TEXT/XLIMITS/YLIMITS/AXES ****
+		DATA qualifiers  (nqual_at10f+ 0)/ 'TEXT' /
+		DATA qualifiers  (nqual_at10f+ 1)/ 'XLIMITS' /
+		DATA qualifiers  (nqual_at10f+ 2)/ 'YLIMITS' /
+		DATA qualifiers  (nqual_at10f+ 3)/ 'SIZE' /
+		DATA qualifiers  (nqual_at10f+ 4)/ 'ORIGIN' /
+		DATA qualifiers  (nqual_at10f+ 5)/ 'CLIP' /
+		DATA qualifiers  (nqual_at10f+ 6)/ 'AXES' /
+		DATA qualifiers  (nqual_at10f+ 7)/ '****' /
+* DEFINE ALIAS
+	   DATA subcommands      (nsub_at10 + 6)/ 'ALIAS'	/
+	   DATA num_qualifs      (nsub_at10 + 6)/ nqual10g	/
+	   DATA qualifier_pointer(nsub_at10 + 6)/ nqual_at10g	/
+* DEFINE ALIAS / ****
+		DATA qualifiers  (nqual_at10g+ 0)/ '****' /
+		DATA qualifiers  (nqual_at10g+ 1)/ '****' /
+* DEFINE SYMBOL
+	   DATA subcommands      (nsub_at10 + 7)/ 'SYMBOL'	/
+	   DATA num_qualifs      (nsub_at10 + 7)/ nqual10h	/
+	   DATA qualifier_pointer(nsub_at10 + 7)/ nqual_at10h	/
+* DEFINE SYMBOL / ****
+		DATA qualifiers  (nqual_at10h+ 0)/ '****' /
+		DATA qualifiers  (nqual_at10h+ 1)/ '****' /
+* DEFINE ATTRIBUTE
+	   DATA subcommands      (nsub_at10 + 8)/ 'ATTRIBUT'	/
+	   DATA num_qualifs      (nsub_at10 + 8)/ nqual10i	/
+	   DATA qualifier_pointer(nsub_at10 + 8)/ nqual_at10i	/
+* DEFINE ATTRIBUTE /D /TYPE /OUTPUT /QUIET 
+		DATA qualifiers  (nqual_at10i+ 0)/ 'D' /
+		DATA qualifiers  (nqual_at10i+ 1)/ 'TYPE' /
+		DATA qualifiers  (nqual_at10i+ 2)/ 'OUTPUT' /
+		DATA qualifiers  (nqual_at10i+ 3)/ 'QUIET' /
+* DEFINE PYFUNC
+	   DATA subcommands      (nsub_at10 + 9)/ 'PYFUNC'	/
+	   DATA num_qualifs      (nsub_at10 + 9)/ nqual10j	/
+	   DATA qualifier_pointer(nsub_at10 + 9)/ nqual_at10j	/
+* DEFINE PYFUNC /NAME ****
+		DATA qualifiers  (nqual_at10j+ 0)/ 'NAME' /
+		DATA qualifiers  (nqual_at10j+ 1)/ '****' /
+* DEFINE DATA
+	   DATA subcommands      (nsub_at10 + 10)/ 'DATA'	/
+	   DATA num_qualifs      (nsub_at10 + 10)/ nqual10k	/
+	   DATA qualifier_pointer(nsub_at10 + 10)/ nqual_at10k	/
+* DEFINE DATA / AGGREGATE / TITLE /HIDE /E 
+		DATA qualifiers  (nqual_at10k+ 0)/ 'AGGREGATE' /
+		DATA qualifiers  (nqual_at10k+ 1)/ '****' / ! reserved for x
+		DATA qualifiers  (nqual_at10k+ 2)/ '****' / ! y
+		DATA qualifiers  (nqual_at10k+ 3)/ '****' / ! z
+		DATA qualifiers  (nqual_at10k+ 4)/ '****' / ! t
+		DATA qualifiers  (nqual_at10k+ 5)/ 'E'    /
+		DATA qualifiers  (nqual_at10k+ 6)/ '****' / ! f
+		DATA qualifiers  (nqual_at10k+ 7)/ 'TITLE' /
+		DATA qualifiers  (nqual_at10k+ 8)/ 'QUIET' /
+		DATA qualifiers  (nqual_at10k+ 9)/ 'HIDE' /
+
+* EXIT	 - command # 11
+	DATA commands(11)			/ 'EXIT'	/
+        DATA its_action_command(11)             / .FALSE.       /
+	DATA num_subcommands(11)		/ nsub11	/
+	DATA subcommand_pointer(11)		/ nsub_at11	/
+* EXIT '    '
+	   DATA subcommands      (nsub_at11 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at11 + 0)/ nqual11a	/
+	   DATA qualifier_pointer(nsub_at11 + 0)/ nqual_at11a	/
+* EXIT/COMMAND_FILE etc
+		DATA qualifiers  (nqual_at11a+0)/ 'COMMAND'	/
+		DATA qualifiers  (nqual_at11a+1)/ 'LOOP'	/
+		DATA qualifiers  (nqual_at11a+2)/ 'SCRIPT'	/
+		DATA qualifiers  (nqual_at11a+3)/ 'PROMPT'	/
+		DATA qualifiers  (nqual_at11a+4)/ 'PROGRAM'	/
+		DATA qualifiers  (nqual_at11a+5)/ 'CYCLE'	/
+		DATA qualifiers  (nqual_at11a+6)/ 'TOPYTHON'	/
+		DATA qualifiers  (nqual_at11a+7)/ '****'	/
+
+* MESSAGE	 - command # 12
+	DATA commands(12)			/ 'MESSAGE'	/
+        DATA its_action_command(12)             / .FALSE.       /
+	DATA num_subcommands(12)		/ nsub12	/
+	DATA subcommand_pointer(12)		/ nsub_at12	/
+* MESSAGE '    '
+	   DATA subcommands      (nsub_at12 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at12 + 0)/ nqual12a	/
+	   DATA qualifier_pointer(nsub_at12 + 0)/ nqual_at12a	/
+* MESSAGE/CONTINUE
+		DATA qualifiers  (nqual_at12a+0)/ 'CONTINUE'	/
+* MESSAGE/QUIET/JOURNAL/ERROR/OUTFILE/APPEND/CLOBBER
+		DATA qualifiers  (nqual_at12a+1)/ 'QUIET'	/
+		DATA qualifiers  (nqual_at12a+2)/ 'JOURNAL'	/
+		DATA qualifiers  (nqual_at12a+3)/ 'ERROR'	/
+		DATA qualifiers  (nqual_at12a+4)/ 'OUTFILE'	/
+		DATA qualifiers  (nqual_at12a+5)/ 'APPEND'	/
+		DATA qualifiers  (nqual_at12a+6)/ 'CLOBBER'	/
+
+* VECTOR - command # 13
+	DATA commands(13)			/ 'VECTOR'	/
+        DATA its_action_command(13)             / .TRUE.        /
+	DATA num_subcommands(13)		/ nsub13	/
+	DATA subcommand_pointer(13)		/ nsub_at13	/
+* VECTOR '    '
+	   DATA subcommands      (nsub_at13 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at13 + 0)/ nqual13a	/
+	   DATA qualifier_pointer(nsub_at13 + 0)/ nqual_at13a	/
+* VECTOR/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE
+		DATA qualifiers  (nqual_at13a+0)/ 'I'	/
+		DATA qualifiers  (nqual_at13a+1)/ 'J'	/
+		DATA qualifiers  (nqual_at13a+2)/ 'K'	/
+		DATA qualifiers  (nqual_at13a+3)/ 'L'	/
+		DATA qualifiers  (nqual_at13a+4)/ 'M'	/
+		DATA qualifiers  (nqual_at13a+5)/ 'N'	/
+		DATA qualifiers  (nqual_at13a+6)/ 'X'	/
+		DATA qualifiers  (nqual_at13a+7)/ 'Y'	/
+		DATA qualifiers  (nqual_at13a+8)/ 'Z'	/
+		DATA qualifiers  (nqual_at13a+9)/ 'T'	/
+		DATA qualifiers  (nqual_at13a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at13a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at13a+12)/ 'OVERLAY'/	!/overlays
+		DATA qualifiers  (nqual_at13a+13)/ 'SET_UP'/	!/set_up
+		DATA qualifiers  (nqual_at13a+14)/ 'FRAME'/	!/frame
+		DATA qualifiers  (nqual_at13a+15)/ 'D'   /	!/data_set
+		DATA qualifiers  (nqual_at13a+16)/ 'TRANPOSE'/	!/transpose
+		DATA qualifiers  (nqual_at13a+17)/ '****'/	!
+		DATA qualifiers  (nqual_at13a+18)/ 'ASPECT'/	!/aspect
+		DATA qualifiers  (nqual_at13a+19)/ 'NOLABEL'/	!/nolabel
+		DATA qualifiers  (nqual_at13a+20)/ 'LENGTH'/	!/length_same
+		DATA qualifiers  (nqual_at13a+21)/ 'XSKIP'/	!/xskip
+		DATA qualifiers  (nqual_at13a+22)/ 'YSKIP'/	!/yskip
+		DATA qualifiers  (nqual_at13a+23)/ 'THICK'/	!/thick
+		DATA qualifiers  (nqual_at13a+24)/ 'XLIMITS'/	!/xlimits
+		DATA qualifiers  (nqual_at13a+25)/ 'YLIMITS'/	!/ylimits
+		DATA qualifiers  (nqual_at13a+26)/ 'TITLE'/	!/title
+		DATA qualifiers  (nqual_at13a+27)/ 'COLOR'/	!/color
+		DATA qualifiers  (nqual_at13a+28)/ 'NOAXES'/	!/noaxes
+		DATA qualifiers  (nqual_at13a+29)/ 'NOKEY'/	!/nokey
+		DATA qualifiers  (nqual_at13a+30)/ 'FLOWLINE'/	!/flowline
+		DATA qualifiers  (nqual_at13a+31)/ 'DENSITY'/	!/density=
+		DATA qualifiers  (nqual_at13a+32)/ 'AXES'/	!/axes[=]
+		DATA qualifiers  (nqual_at13a+33)/ 'PEN'/	! pen (denigr!)
+		DATA qualifiers  (nqual_at13a+34)/ 'HLIMITS'/	! horiz
+		DATA qualifiers  (nqual_at13a+35)/ 'VLIMITS'/	! vertical
+		DATA qualifiers  (nqual_at13a+36)/ 'HGRATICU'/	! horiz tic lines
+		DATA qualifiers  (nqual_at13a+37)/ 'VGRATICU'/	! vert tic lines
+		DATA qualifiers  (nqual_at13a+38)/ 'GRATICUL'/
+		DATA qualifiers  (nqual_at13a+39)/ 'KEY'/	!KEY 
+		DATA qualifiers  (nqual_at13a+40)/ 'MODULO'/
+		DATA qualifiers  (nqual_at13a+41)/ 'OPACITY'/	! overriding opacity
+		DATA qualifiers  (nqual_at13a+42)/ '****'/
+		DATA qualifiers  (nqual_at13a+43)/ '****'/
+		DATA qualifiers  (nqual_at13a+44)/ '****'/
+
+* PPLUS	 - command # 14
+	DATA commands(14)			/ 'PPLUS'	/
+        DATA its_action_command(14)             / .FALSE.       /
+	DATA num_subcommands(14)		/ nsub14	/
+	DATA subcommand_pointer(14)		/ nsub_at14	/
+* PPLUS '    '
+	   DATA subcommands      (nsub_at14 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at14 + 0)/ nqual14a	/
+	   DATA qualifier_pointer(nsub_at14 + 0)/ nqual_at14a	/
+* PPLUS/RESET
+		DATA qualifiers  (nqual_at14a+0)/ 'RESET' /
+		DATA qualifiers  (nqual_at14a+1)/ '****' /
+
+* FRAME	 - command # 15
+	DATA commands(15)			/ 'FRAME'	/
+        DATA its_action_command(15)             / .FALSE.       /
+	DATA num_subcommands(15)		/ nsub15	/
+	DATA subcommand_pointer(15)		/ nsub_at15	/
+* FRAME '    '
+	   DATA subcommands      (nsub_at15 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at15 + 0)/ nqual15a	/
+	   DATA qualifier_pointer(nsub_at15 + 0)/ nqual_at15a	/
+* FRAME/FORMAT=.../FILE=.../TRANSPARENT
+*      /XINCHES=.../YINCHES=.../XPIXELS=.../YPIXELS=.../ANNOTATE=...
+		DATA qualifiers  (nqual_at15a+0)/ 'FORMAT'	/
+		DATA qualifiers  (nqual_at15a+1)/ 'FILE'	/
+		DATA qualifiers  (nqual_at15a+2)/ 'TRANSPAR'	/
+		DATA qualifiers  (nqual_at15a+3)/ 'XINCHES'	/
+		DATA qualifiers  (nqual_at15a+4)/ 'YINCHES'	/
+		DATA qualifiers  (nqual_at15a+5)/ 'XPIXELS'	/
+		DATA qualifiers  (nqual_at15a+6)/ 'YPIXELS'	/
+		DATA qualifiers  (nqual_at15a+7)/ 'ANNOTATE'	/
+
+* REPEAT - command # 16
+	DATA commands(16)			/ 'REPEAT'	/
+        DATA its_action_command(16)             / .FALSE.       /
+	DATA num_subcommands(16)		/ nsub16	/
+	DATA subcommand_pointer(16)		/ nsub_at16	/
+* REPEAT '    '
+	   DATA subcommands      (nsub_at16 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at16 + 0)/ nqual16a	/
+	   DATA qualifier_pointer(nsub_at16 + 0)/ nqual_at16a	/
+* REPEAT/I/J/K/L/M/N/X/Y/Z/T/E/F/ANIMATE/LOOP=[N]
+		DATA qualifiers  (nqual_at16a+0)/ 'I'	/
+		DATA qualifiers  (nqual_at16a+1)/ 'J'	/
+		DATA qualifiers  (nqual_at16a+2)/ 'K'	/
+		DATA qualifiers  (nqual_at16a+3)/ 'L'	/
+		DATA qualifiers  (nqual_at16a+4)/ 'M'	/
+		DATA qualifiers  (nqual_at16a+5)/ 'N'	/
+		DATA qualifiers  (nqual_at16a+6)/ 'X'	/
+		DATA qualifiers  (nqual_at16a+7)/ 'Y'	/
+		DATA qualifiers  (nqual_at16a+8)/ 'Z'	/
+		DATA qualifiers  (nqual_at16a+9)/ 'T'	/
+		DATA qualifiers  (nqual_at16a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at16a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at16a+12)/ 'ANIMATE' /
+		DATA qualifiers  (nqual_at16a+13)/ 'LOOP'  /
+		DATA qualifiers  (nqual_at16a+14)/ 'RANGE' /   
+		DATA qualifiers  (nqual_at16a+15)/ 'NAME' /   
+		DATA qualifiers  (nqual_at16a+16)/ '****' /  
+
+* STATISTICS - command # 17
+	DATA commands(17)			/ 'STAT'	/
+        DATA its_action_command(17)             / .TRUE.        /
+	DATA num_subcommands(17)		/ nsub17	/
+	DATA subcommand_pointer(17)		/ nsub_at17	/
+* STAT '    '
+	   DATA subcommands      (nsub_at17 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at17 + 0)	/ nqual17a	/
+	   DATA qualifier_pointer(nsub_at17 + 0)	/ nqual_at17a	/
+* STAT /I/J/K/L/M/N/X/Y/Z/T/E/F/D/G
+		DATA qualifiers  (nqual_at17a+0)	/ 'BRIEF'/
+		DATA qualifiers  (nqual_at17a+1)	/ '****'/
+		DATA qualifiers  (nqual_at17a+2)	/ 'I'	/
+		DATA qualifiers  (nqual_at17a+3)	/ 'J'	/
+		DATA qualifiers  (nqual_at17a+4)	/ 'K'	/
+		DATA qualifiers  (nqual_at17a+5)	/ 'L'	/
+		DATA qualifiers  (nqual_at17a+6)	/ 'M'	/
+		DATA qualifiers  (nqual_at17a+7)	/ 'N'	/
+		DATA qualifiers  (nqual_at17a+8)	/ 'X'	/
+		DATA qualifiers  (nqual_at17a+9)	/ 'Y'	/
+		DATA qualifiers  (nqual_at17a+10)	/ 'Z'	/
+		DATA qualifiers  (nqual_at17a+11)	/ 'T'	/
+		DATA qualifiers  (nqual_at17a+12)	/ 'E'	/
+		DATA qualifiers  (nqual_at17a+13)	/ 'F'	/
+		DATA qualifiers  (nqual_at17a+14)	/ 'D'	/
+		DATA qualifiers  (nqual_at17a+15)	/ '****'/
+
+* SHADE - command # 18
+	DATA commands(18)			/ 'SHADE'	/
+        DATA its_action_command(18)             / .TRUE.        /
+	DATA num_subcommands(18)		/ nsub18	/
+	DATA subcommand_pointer(18)		/ nsub_at18	/
+* SHADE '    '
+	   DATA subcommands      (nsub_at18 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at18 + 0)	/ nqual18a	/
+	   DATA qualifier_pointer(nsub_at18 + 0)	/ nqual_at18a	/
+* SHADE/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE/TRIM
+		DATA qualifiers  (nqual_at18a+0)/ 'I'	/
+		DATA qualifiers  (nqual_at18a+1)/ 'J'	/
+		DATA qualifiers  (nqual_at18a+2)/ 'K'	/
+		DATA qualifiers  (nqual_at18a+3)/ 'L'	/
+		DATA qualifiers  (nqual_at18a+4)/ 'M'	/
+		DATA qualifiers  (nqual_at18a+5)/ 'N'	/
+		DATA qualifiers  (nqual_at18a+6)/ 'X'	/
+		DATA qualifiers  (nqual_at18a+7)/ 'Y'	/
+		DATA qualifiers  (nqual_at18a+8)/ 'Z'	/
+		DATA qualifiers  (nqual_at18a+9)/ 'T'	/
+		DATA qualifiers  (nqual_at18a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at18a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at18a+12)/ 'OVERLAY'/	!/overlays
+		DATA qualifiers  (nqual_at18a+13)/ 'SET_UP'/	!/set_up
+		DATA qualifiers  (nqual_at18a+14)/ 'FRAME'/	!/frame
+		DATA qualifiers  (nqual_at18a+15)/ 'D'   /	!/data_set
+		DATA qualifiers  (nqual_at18a+16)/ 'TRANPOSE'/	!/transpose
+		DATA qualifiers  (nqual_at18a+17)/ 'TRIM'/	!/trim
+		DATA qualifiers  (nqual_at18a+18)/ 'LINE'/	!/lines
+		DATA qualifiers  (nqual_at18a+19)/ 'NOLABEL'/	!/nolabel
+		DATA qualifiers  (nqual_at18a+20)/ 'LEVELS'/	!/levels_same
+		DATA qualifiers  (nqual_at18a+21)/ 'KEY' /	!/key
+		DATA qualifiers  (nqual_at18a+22)/ 'NOKEY'/	!/nokey
+		DATA qualifiers  (nqual_at18a+23)/ 'PALETTE'/	!/palette=
+		DATA qualifiers  (nqual_at18a+24)/ 'XLIMITS'/	!/xlimits
+		DATA qualifiers  (nqual_at18a+25)/ 'YLIMITS'/	!/ylimits
+		DATA qualifiers  (nqual_at18a+26)/ 'TITLE'/	!/title
+		DATA qualifiers  (nqual_at18a+27)/ 'AXES'/	!/axes[=]
+		DATA qualifiers  (nqual_at18a+28)/ 'NOAXES'/	!/noaxes
+		DATA qualifiers  (nqual_at18a+29)/ 'PATTERN'/   !/pattern=
+		DATA qualifiers  (nqual_at18a+30)/ 'HGRATICU'/!tic lines, dash or line
+		DATA qualifiers  (nqual_at18a+31)/ 'VGRATICU'/!vert tic lines
+		DATA qualifiers  (nqual_at18a+32)/ 'GRATICUL'/	!
+		DATA qualifiers  (nqual_at18a+33)/ 'MODULO'/	! modulo for curvilinear plots
+		DATA qualifiers  (nqual_at18a+34)/ 'HLIMITS'/	! horiz
+		DATA qualifiers  (nqual_at18a+35)/ 'VLIMITS'/	! vertical
+		DATA qualifiers  (nqual_at18a+36)/ 'OPACITY'/	! overriding opacity
+		DATA qualifiers  (nqual_at18a+37)/ '****'/	! 
+
+* SPAWN - command # 19
+	DATA commands(19)			/ 'SPAWN'	/
+        DATA its_action_command(19)             / .FALSE.       /
+	DATA num_subcommands(19)		/ nsub19	/
+	DATA subcommand_pointer(19)		/ nsub_at19	/
+* SPAWN '    '
+	   DATA subcommands      (nsub_at19 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at19 + 0)	/ nqual19a	/
+	   DATA qualifier_pointer(nsub_at19 + 0)	/ nqual_at19a	/
+
+* USER - command # 20
+	DATA commands(20)			/ 'USER'	/
+        DATA its_action_command(20)             / .TRUE.        /
+	DATA num_subcommands(20)		/ nsub20	/
+	DATA subcommand_pointer(20)		/ nsub_at20	/
+* USER '    '
+	   DATA subcommands      (nsub_at20 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at20 + 0)	/ nqual20a	/
+	   DATA qualifier_pointer(nsub_at20 + 0)	/ nqual_at20a	/
+* USER/OPT1/OPT2
+		DATA qualifiers  (nqual_at20a+0)/ 'OPT1'	/
+		DATA qualifiers  (nqual_at20a+1)/ 'OPT2'	/
+		DATA qualifiers  (nqual_at20a+2)/ 'COMMAND'	/
+		DATA qualifiers  (nqual_at20a+3)/ 'I'		/
+		DATA qualifiers  (nqual_at20a+4)/ 'J'		/
+		DATA qualifiers  (nqual_at20a+5)/ 'K'		/
+		DATA qualifiers  (nqual_at20a+6)/ 'L'		/
+		DATA qualifiers  (nqual_at20a+7)/ 'X'		/
+		DATA qualifiers  (nqual_at20a+8)/ 'Y'		/
+		DATA qualifiers  (nqual_at20a+9)/ 'Z'		/
+		DATA qualifiers  (nqual_at20a+10)/ 'T'		/
+		DATA qualifiers  (nqual_at20a+11)/ 'D'		/
+		DATA qualifiers  (nqual_at20a+12)/ 'FILE'	/
+		DATA qualifiers  (nqual_at20a+13)/ 'FORMAT'	/
+
+* WIRE - command # 21
+	DATA commands(21)			/ 'WIRE'	/
+        DATA its_action_command(21)             / .TRUE.       /
+	DATA num_subcommands(21)		/ nsub21	/
+	DATA subcommand_pointer(21)		/ nsub_at21	/
+* WIRE '    '
+	   DATA subcommands      (nsub_at21 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at21 + 0)	/ nqual21a	/
+	   DATA qualifier_pointer(nsub_at21 + 0)	/ nqual_at21a	/
+* WIRE/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE
+		DATA qualifiers  (nqual_at21a+0) / 'I'	/
+		DATA qualifiers  (nqual_at21a+1) / 'J'	/
+		DATA qualifiers  (nqual_at21a+2) / 'K'	/
+		DATA qualifiers  (nqual_at21a+3) / 'L'	/
+		DATA qualifiers  (nqual_at21a+4) / 'M'	/
+		DATA qualifiers  (nqual_at21a+5) / 'N'	/
+		DATA qualifiers  (nqual_at21a+6) / 'X'	/
+		DATA qualifiers  (nqual_at21a+7) / 'Y'	/
+		DATA qualifiers  (nqual_at21a+8) / 'Z'	/
+		DATA qualifiers  (nqual_at21a+9) / 'T'	/
+		DATA qualifiers  (nqual_at21a+10) / 'E'	/
+		DATA qualifiers  (nqual_at21a+11) / 'F'	/
+		DATA qualifiers  (nqual_at21a+12) / 'OVERLAY'/ 
+		DATA qualifiers  (nqual_at21a+13) / 'SET_UP'/  
+		DATA qualifiers  (nqual_at21a+14)/ 'FRAME'/
+		DATA qualifiers  (nqual_at21a+15)/ 'D'   /
+		DATA qualifiers  (nqual_at21a+16)/ 'VIEWPOIN'/
+		DATA qualifiers  (nqual_at21a+17)/ 'ZLIMITS'/
+		DATA qualifiers  (nqual_at21a+18)/ 'TRANPOSE'/  
+		DATA qualifiers  (nqual_at21a+19)/ 'NOLABEL'/   
+		DATA qualifiers  (nqual_at21a+20)/ 'ZSCALE'/
+		DATA qualifiers  (nqual_at21a+21)/ '****'/
+		DATA qualifiers  (nqual_at21a+22)/ '****'/
+		DATA qualifiers  (nqual_at21a+23)/ '****'/
+		DATA qualifiers  (nqual_at21a+24)/ '****'/
+		DATA qualifiers  (nqual_at21a+25)/ '****'/
+		DATA qualifiers  (nqual_at21a+26)/ 'TITLE'/
+
+* QUERY - command # 22
+	DATA commands(22)			/ 'QUERY'	/
+        DATA its_action_command(22)             / .FALSE.       /
+	DATA num_subcommands(22)		/ nsub22	/
+	DATA subcommand_pointer(22)		/ nsub_at22	/
+* QUERY '    '
+	   DATA subcommands      (nsub_at22 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at22 + 0)	/ nqual22a	/
+	   DATA qualifier_pointer(nsub_at22 + 0)	/ nqual_at22a	/
+* QUERY /FILE
+		DATA qualifiers  (nqual_at22a+0)/ 'ALL'	/
+		DATA qualifiers  (nqual_at22a+1)/ 'FILE'	/
+		DATA qualifiers  (nqual_at22a+2)/ 'IGNORE'	/
+
+* IF - command # 23
+	DATA commands(23)			/ 'IF  '	/
+        DATA its_action_command(23)             / .FALSE.       /
+	DATA num_subcommands(23)		/ nsub23	/
+	DATA subcommand_pointer(23)		/ nsub_at23	/
+* IF '    '
+	   DATA subcommands      (nsub_at23 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at23 + 0)	/ nqual23a	/
+	   DATA qualifier_pointer(nsub_at23 + 0)	/ nqual_at23a	/
+* IF / ****
+		DATA qualifiers  (nqual_at23a+0)/ '****'	/
+		DATA qualifiers  (nqual_at23a+1)/ '****'	/
+
+* ELSE - command # 24
+	DATA commands(24)			/ 'ELSE'	/
+        DATA its_action_command(24)             / .FALSE.       /
+	DATA num_subcommands(24)		/ nsub24	/
+	DATA subcommand_pointer(24)		/ nsub_at24	/
+* ELSE '    '
+	   DATA subcommands      (nsub_at24 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at24 + 0)	/ nqual24a	/
+	   DATA qualifier_pointer(nsub_at24 + 0)	/ nqual_at24a	/
+* ELSE / ****
+		DATA qualifiers  (nqual_at24a+0)/ '****'	/
+		DATA qualifiers  (nqual_at24a+1)/ '****'	/
+
+* ELIF - command # 25
+	DATA commands(25)			/ 'ELIF'	/
+        DATA its_action_command(25)             / .FALSE.       /
+	DATA num_subcommands(25)		/ nsub25	/
+	DATA subcommand_pointer(25)		/ nsub_at25	/
+* ELIF '    '
+	   DATA subcommands      (nsub_at25 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at25 + 0)	/ nqual25a	/
+	   DATA qualifier_pointer(nsub_at25 + 0)	/ nqual_at25a	/
+* ELIF / ****
+		DATA qualifiers  (nqual_at25a+0)/ '****'	/
+		DATA qualifiers  (nqual_at25a+1)/ '****'	/
+
+* ENDIF - command # 26
+	DATA commands(26)			/ 'ENDIF'	/
+        DATA its_action_command(26)             / .FALSE.       /
+	DATA num_subcommands(26)		/ nsub26	/
+	DATA subcommand_pointer(26)		/ nsub_at26	/
+* ENDIF '    '
+	   DATA subcommands      (nsub_at26 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at26 + 0)	/ nqual26a	/
+	   DATA qualifier_pointer(nsub_at26 + 0)	/ nqual_at26a	/
+* ENDIF / ****
+		DATA qualifiers  (nqual_at26a+0)/ '****'	/
+		DATA qualifiers  (nqual_at26a+1)/ '****'	/
+
+* POLYGON - command # 27
+	DATA commands(27)			/ 'POLYGON'	/
+        DATA its_action_command(27)             / .TRUE.        /
+	DATA num_subcommands(27)		/ nsub6		/
+	DATA subcommand_pointer(27)		/ nsub_at27	/
+* POLYGON '    '
+	   DATA subcommands      (nsub_at27 + 0)/ '    '	/
+	   DATA num_qualifs      (nsub_at27 + 0)/ nqual27a	/
+	   DATA qualifier_pointer(nsub_at27 + 0)/ nqual_at27a	/
+* POLYGON/I/J/K/L/M/N/X/Y/Z/T/E/F/D/OVERLAY/SET_UP/FRAME/TRANSPOSE/COORD_AX
+		DATA qualifiers  (nqual_at27a+0)/ 'I'	/
+		DATA qualifiers  (nqual_at27a+1)/ 'J'	/
+		DATA qualifiers  (nqual_at27a+2)/ 'K'	/
+		DATA qualifiers  (nqual_at27a+3)/ 'L'	/
+		DATA qualifiers  (nqual_at27a+4)/ 'M'	/
+		DATA qualifiers  (nqual_at27a+5)/ 'N'	/
+		DATA qualifiers  (nqual_at27a+6)/ 'X'	/
+		DATA qualifiers  (nqual_at27a+7)/ 'Y'	/
+		DATA qualifiers  (nqual_at27a+8)/ 'Z'	/
+		DATA qualifiers  (nqual_at27a+9)/ 'T'	/
+		DATA qualifiers  (nqual_at27a+10)/ 'E'	/
+		DATA qualifiers  (nqual_at27a+11)/ 'F'	/
+		DATA qualifiers  (nqual_at27a+12)/ 'OVERLAY'/	!/overlays
+		DATA qualifiers  (nqual_at27a+13)/ 'SET_UP'/	!/set_up
+		DATA qualifiers  (nqual_at27a+14)/ 'FRAME'/	!/frame
+		DATA qualifiers  (nqual_at27a+15)/ 'D'   /	!/data_set
+		DATA qualifiers  (nqual_at27a+16)/ 'TRANPOSE'/	!/transpose
+		DATA qualifiers  (nqual_at27a+17)/ 'COORD_AX'/	!/coord_ax
+		DATA qualifiers  (nqual_at27a+18)/ '****'/	!/unused
+		DATA qualifiers  (nqual_at27a+19)/ 'NOLABEL'/	!/nolabel
+		DATA qualifiers  (nqual_at27a+20)/ 'LEVELS'/	!/levels_same
+		DATA qualifiers  (nqual_at27a+21)/ 'LINE'/	!/line
+		DATA qualifiers  (nqual_at27a+22)/ 'COLOR'/	!/color
+		DATA qualifiers  (nqual_at27a+23)/ 'PALETTE'/	!/palette=
+		DATA qualifiers  (nqual_at27a+24)/ 'XLIMITS'/	!/xlimits
+		DATA qualifiers  (nqual_at27a+25)/ 'YLIMITS'/	!/ylimits
+		DATA qualifiers  (nqual_at27a+26)/ 'TITLE'/	!/title
+		DATA qualifiers  (nqual_at27a+27)/ 'THICKNES'/	!/thickness
+		DATA qualifiers  (nqual_at27a+28)/ 'NOAXES'/	!/noaxes
+	        DATA qualifiers  (nqual_at27a+29)/ 'PATTERN'/   !/pattern=
+		DATA qualifiers  (nqual_at27a+30)/ 'FILL'/	!/fill
+		DATA qualifiers  (nqual_at27a+31)/ 'KEY'/	!/key
+		DATA qualifiers  (nqual_at27a+32)/ 'NOKEY'/	!/nokey
+		DATA qualifiers  (nqual_at27a+33)/ 'AXES'/	!/axes[=]
+		DATA qualifiers  (nqual_at27a+34)/ 'HLIMITS'/	! horizontal
+		DATA qualifiers  (nqual_at27a+35)/ 'VLIMITS'/	! vertical
+		DATA qualifiers  (nqual_at27a+36)/ 'HLOG'/	!log axis horiz
+		DATA qualifiers  (nqual_at27a+37)/ 'VLOG'/	!log axis vert
+		DATA qualifiers  (nqual_at27a+38)/ 'HGRATICU'/	!tic lines, dash or line
+		DATA qualifiers  (nqual_at27a+39)/ 'VGRATICU'/	!vert tic lines
+		DATA qualifiers  (nqual_at27a+40)/ 'GRATICUL'/
+		DATA qualifiers  (nqual_at27a+41)/ 'MODULO'/
+		DATA qualifiers  (nqual_at27a+42)/ 'OPACITY'/	! overriding opacity
+		DATA qualifiers  (nqual_at27a+43)/ '****'/
+
+* **** - command # 28
+	DATA commands(28)			/ '****'	/
+        DATA its_action_command(28)             / .FALSE.       /
+	DATA num_subcommands(28)		/ nsub28	/
+	DATA subcommand_pointer(28)		/ nsub_at28	/
+* **** '    '
+	   DATA subcommands      (nsub_at28 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at28 + 0)	/ nqual28a	/
+	   DATA qualifier_pointer(nsub_at28 + 0)	/ nqual_at28a	/
+* **** / ****
+		DATA qualifiers  (nqual_at28a+0)/ '****'	/
+		DATA qualifiers  (nqual_at28a+1)/ '****'	/
+
+* **** - command # 29
+	DATA commands(29)			/ '****'	/
+        DATA its_action_command(29)             / .FALSE.       /
+	DATA num_subcommands(29)		/ nsub29	/
+	DATA subcommand_pointer(29)		/ nsub_at29	/
+* **** '    '
+	   DATA subcommands      (nsub_at29 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at29 + 0)	/ nqual29a	/
+	   DATA qualifier_pointer(nsub_at29 + 0)	/ nqual_at29a	/
+* **** / ****
+		DATA qualifiers  (nqual_at29a+0)/ '****'	/
+		DATA qualifiers  (nqual_at29a+1)/ '****'	/
+
+* **** - command # 30
+	DATA commands(30)			/ '****'	/
+        DATA its_action_command(30)             / .FALSE.       /
+	DATA num_subcommands(30)		/ nsub30	/
+	DATA subcommand_pointer(30)		/ nsub_at30	/
+* **** '    '
+	   DATA subcommands      (nsub_at30 + 0)	/ '    '	/
+	   DATA num_qualifs      (nsub_at30 + 0)	/ nqual30a	/
+	   DATA qualifier_pointer(nsub_at30 + 0)	/ nqual_at30a	/
+* **** / ****
+		DATA qualifiers  (nqual_at30a+0)/ '****'	/
+		DATA qualifiers  (nqual_at30a+1)/ '****'	/
+
+* ******* ALIASES *********
+	DATA	alias_name(1)	/ 'LET'/,
+     .		alias_len(1)	/ 3 /,
+     .		alias(1)	/ 'DEFINE VARIABLE'/,
+     .		alias_name(2)	/ 'FILE'/,
+     .		alias_len(2)	/ 4 /,
+     .		alias(2)	/ 'SET DATA/EZ'/,
+     .		alias_name(3)	/ 'QUIT' /,  ! or "q" for happy Unix users
+     .		alias_len(3)	/ 4 /,
+     .		alias(3)	/ 'EXIT' /,
+     .		alias_name(4)	/ 'REGION' /,
+     .		alias_len(4)	/ 4 /,
+     .		alias(4)	/ 'SET REGION' /,
+     .		alias_name(5)	/ 'SAY' /,
+     .		alias_len(5)	/ 16 /,
+     .		alias(5)	/ 'MESSAGE/CONTINUE' /
+     .		alias_name(6)	/ 'FILL' /,
+     .		alias_len(6)	/ 12 /,
+     .		alias(6)	/ 'CONTOUR/FILL' /
+     .		alias_name(7)	/ 'ALIAS' /,
+     .		alias_len(7)	/ 12 /,
+     .		alias(7)	/ 'DEFINE ALIAS' /
+     .		alias_name(8)	/ 'UNALIAS' /,
+     .		alias_len(8)	/ 12 /,
+     .		alias(8)	/ 'CANCEL ALIAS' /
+     .		alias_name(9)	/ 'USE' /,
+     .		alias_len(9)	/ 16 /,
+     .		alias(9)	/ 'SET DAT/FORM=CDF' /
+     .		alias_name(10)	/ 'SAVE' /,
+     .		alias_len(10)	/ 15 /,
+     .		alias(10)	/ 'LIST/FORMAT=CDF' /,
+     .		alias_name(11)	/ 'PALETTE' /,
+     .		alias_len(11)	/ 20 /,
+     .		alias(11)	/ 'PPL SHASET SPECTRUM=' /,
+     .		alias_name(12)	/ 'LABEL' /,
+     .		alias_len(12)	/ 10 /,
+     .		alias(12)	/ 'PPL %LABEL' /,
+     .		alias_name(13)	/ 'ANIMATE' /,
+     .		alias_len(13)	/ 14 /,
+     .		alias(13)	/ 'REPEAT/ANIMATE' /,
+     .		alias_name(14)	/ 'PATTERN' /,
+     .		alias_len(14)	/ 19 /,
+     .		alias(14)	/ 'PPL PATSET PATTERN=' /
+     .		alias_name(15)	/ 'PAUSE' /,
+     .		alias_len(15)	/ 7 /,
+     .		alias(15)	/ 'MESSAGE' /,
+     .		alias_name(16)	/ 'WHERE' /,
+     .		alias_len(16)	/ 10 /,
+     .		alias(16)	/ 'PPL %WHERE' /
+     .		alias_name(17)	/ 'FLOWLINE' /,
+     .		alias_len(17)	/ 17 /,
+     .		alias(17)	/ 'VECTOR/FLOWLINE' /
+     .		alias_name(18)	/ 'COLUMNS' /,
+     .		alias_len(18)	/ 23 /,
+     .		alias(18)	/ 'SET DATA/FORM=delimited' /
+     .		alias_name(19)	/ 'KEYMARK' /,
+     .		alias_len(19)	/ 23 /,
+     .		alias(19)	/ 'PPL SHAKEY 1,,,,,,,,,,' /
+     .		alias_name(20)	/ 'OPEN' /,
+     .		alias_len(20)	/ 16 /,
+     .		alias(20)	/ 'SET DATA /BROWSE' /
+     .		alias_name(21)	/ 'RIBBON' /,
+     .		alias_len(21)	/ 11 /,
+     .		alias(21)	/ 'PLOT/RIBBON' /
+     .		alias_name(22)	/ 'ENSEMBLE' /,
+     .		alias_len(22)	/ 22 /,
+     .		alias(22)	/ 'DEFINE DATA/AGGREGAT/E' /
+     .		alias_name(23)	/ 'VTREE' /,
+     .		alias_len(23)	/ 13 /,
+     .		alias(23)	/ 'SHOW VAR/TREE' /
+
+        DATA
+     .		(alias_name(i),i=num_predefined_alias+1,150)
+     .                   / 127*unspecified_name4 /,
+     .		(alias_len(i),i=num_predefined_alias+1,150) / 127*4 /,
+     .		(alias(i),i=num_predefined_alias+1,150)
+     .                   / 127*unspecified_name4 /
+
+
+	DATA queries(1) / 'STATUS' /,
+     .	     queries(2) / 'MESSAGE' /,
+     .	     queries(3) / 'DSET' /,
+     .	     queries(4) / 'VARIABLE' /,
+     .	     queries(5) / 'GRID' /,
+     .	     queries(6) / 'AXIS' /,
+     .	     queries(7) / 'COORDS' /,
+     .	     queries(8) / 'TRANS' /,
+     .	     queries(9) / 'TRNARG' /,
+     .	     queries(10) / 'LVARS' /,
+     .	     queries(11) / 'DVARS' /,
+     .	     queries(12) / 'VBACK' /,
+     .	     queries(13) / 'DBACK' /,
+     .	     queries(14) / 'WINDOWS' /,
+     .	     queries(15) / 'WCURRENT' /,
+     .	     queries(16) / 'VPORTS' /,
+     .	     queries(17) / 'VCURRENT' /,
+     .	     queries(18) / 'VIEW' /,
+     .	     queries(19) / 'DCURRENT' /,
+     .	     queries(20) / 'SPAN' /,
+     .	     queries(21) / 'GAXIS' /,
+     .	     queries(22) / 'GCOORDS' /,
+     .	     queries(23) / 'SSPOINT' /,
+     .	     queries(24) / 'WWPOINT' /,
+     .	     queries(25) / ' ' /
+	DATA (queries(i),i=26,max_queries) / 25*unspecified_name4 /
+	DATA num_queries /0/   ! unused
+
+	END
+
diff --git a/fer/dat/xcontext_data.F b/fer/dat/xcontext_data.F
new file mode 100644
index 0000000..997a57b
--- /dev/null
+++ b/fer/dat/xcontext_data.F
@@ -0,0 +1,210 @@
+	BLOCK DATA XCONTEXT_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* variable declarations for COMMON/ XCONTEXT /
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/25/86
+* revision 1.0 - 9/22/87 - added negative contexts for stored regions
+* revision 1.1 - 3/10/88 - added "0:" to _ss limits
+* revision 1.2 - 7/8/88  - added cx_grid to initializations
+* revision 1.3 - 7/28/88 - initialize cx_stack_ptr
+* revision 1.4 - 1/3/89  - added regridding transformations
+* V200:  6/28/89 - eliminated _dim%,_norm,_rotation, added ss equivalences
+*		 - added cx_ovsiz to get oversized regions to fill contour plots
+*		 - eliminated _relative
+*	12/18/89 - added cx_plot (max_context-->max_cx), cx_xtra_doc
+* Ultrix/RISC port - 2/2/91 - Ultrix compiler doesnt permit variable to be
+*		defined multiple times by DATA statements
+*		Unix version requires implicit DO loops to be spelled out to
+*		avoid duplicate initialization
+*                   9/24/91 - fixed errors introduced by the above: pre-defined
+*                             regions "W", "T", etc. not properly initialized
+*                            (Arguably better to do this in a ferret_init file)
+* V230:  1/30/92: Sun port - fixed cx_name data initialization
+* V420: 9/8/95 - added initializations for implicit grid creation
+* V580: 11/04  - new cx_cal_id 
+*        2/12 *kms* Add the E and F dimensions (set to nferdims in tmap_dims.parm)
+* V685 3/13 *sh* - support for auxiliary regridding variables
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+	INTEGER	    ndcx, ndneg, num_cx_undefined, num_cx_predefined, 
+     .              all_undefined, ndm2t3, ndt3
+	PARAMETER ( ndcx  = nferdims * max_cx,
+     .		    num_cx_predefined = 3, ! 0, -1 and -2 are named cx's T,W,N
+     .		    num_cx_undefined = max_cx_predefined - num_cx_predefined,
+     .		    ndneg = nferdims * num_cx_undefined, 
+     .              all_undefined = max_cx+max_cx_predefined,
+     .              ndm2t3 = (nferdims - 2) * 3,
+     .              ndt3 = nferdims * 3 )
+	INTEGER	    i, j
+
+	DATA	cx_stack_ptr	/ cx_stack_ptr_base /
+
+	DATA	cx_data_set	/ max_cx*unspecified_int4	/,
+     .		cx_grid		/ max_cx*unspecified_int4	/,
+     .		cx_variable	/ max_cx*unspecified_int4	/,
+     .		cx_category	/ max_cx*unspecified_int4	/,
+     .		cx_has_impl_grid/ max_cx*.FALSE.		/
+
+* initialize positive subscripts
+	DATA	((cx_lo_ww(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *unspecified_val8 /
+	DATA	((cx_hi_ww(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *unspecified_val8 /
+	DATA	((cx_lo_ss(i,j),i=1,max_cx),j=1,nferdims)/ ndcx *unspecified_int4 /
+	DATA	((cx_hi_ss(i,j),i=1,max_cx),j=1,nferdims)/ ndcx *unspecified_int4 /
+	DATA	cx_delta	/ ndcx*unspecified_val8		/
+	DATA	((cx_trans(i,j),i=1,nferdims),j=1,max_cx)
+     .                                  / ndcx *trans_no_transform /
+	DATA	((cx_trans_arg(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *bad_val4	 /
+	DATA	((cx_by_ss(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *.FALSE.	 /
+	DATA	((cx_given(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *.FALSE.	 /
+	DATA	((cx_aux_var (i,j),i=1,nferdims),j=1,max_cx)/ ndcx *unspecified_int4 /
+	DATA	((cx_aux_cat (i,j),i=1,nferdims),j=1,max_cx)/ ndcx *unspecified_int4 /
+	DATA	((cx_aux_stat(i,j),i=1,nferdims),j=1,max_cx)/ ndcx *paux_stat_na /
+
+* initialize undefined negative subscripts
+	DATA	((cx_lo_ww(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *unspecified_val8 /
+	DATA	((cx_hi_ww(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *unspecified_val8 /
+	DATA	((cx_lo_ss(i,j),i=min_context,-3),j=1,nferdims)
+     .					/ ndneg *unspecified_int4 /
+	DATA	((cx_hi_ss(i,j),i=min_context,-3),j=1,nferdims)
+     .					/ ndneg *unspecified_int4 /
+	DATA	((cx_trans(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *trans_no_transform /
+	DATA	((cx_trans_arg(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *bad_val4	 /
+	DATA	((cx_by_ss(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *.FALSE.	 /
+	DATA	((cx_given(i,j),i=1,nferdims),j=min_context,-3)
+     .					/ ndneg *.FALSE.	 /
+
+
+	DATA
+     .		cx_unstand_grid	/ max_cx*.FALSE.		/,
+     .		cx_regrid_trans	/ ndcx*unspecified_int4	/
+
+	DATA	cx_ovsiz(cx_last)/ ovsiz_off /
+
+        DATA     cx_cal_id / all_undefined*unspecified_int4	/
+
+* pre-initialize unused named region subscripts
+* (added exact limits 1/92 for Sun port)
+	DATA	(cx_name(i),i=min_context,-3)/
+     .		num_cx_undefined*unspecified_name4 /
+
+* pre-initialize subscripts and axes of "W", "T", and "N" regions
+* (added 9/91 for Ultrix port)
+	DATA	((cx_lo_ww(i,j),i=3,nferdims),j=-2,0)
+     .					/ ndm2t3*unspecified_val8 /
+	DATA	((cx_hi_ww(i,j),i=3,nferdims),j=-2,0)
+     .					/ ndm2t3*unspecified_val8 /
+	DATA	((cx_lo_ss(i,j),i=-2,0),j=1,nferdims)
+     .					/ ndt3*unspecified_int4 /
+	DATA	((cx_hi_ss(i,j),i=-2,0),j=1,nferdims)
+     .					/ ndt3*unspecified_int4 /
+	DATA	((cx_trans(i,j),i=3,nferdims),j=-2,0)
+     .					/ ndm2t3*trans_no_transform /
+	DATA	((cx_trans_arg(i,j),i=3,nferdims),j=-2,0)
+     .					/ ndm2t3*bad_val4	 /
+	DATA	((cx_by_ss(i,j),i=3,nferdims),j=-2,0)
+     .					/ ndm2t3*.FALSE.	 /
+
+	DATA	cx_name(0)		/ 'W    ' /	!"W"hole GFDL region
+	DATA	cx_lo_ww( x_dim, 0 )	/ 130.	/,
+     .		cx_hi_ww( x_dim, 0 )	/ 290.	/,
+     .		cx_lo_ww( y_dim, 0 )	/ -28.9	/,
+     .		cx_hi_ww( y_dim, 0 )	/ +48.6	/,
+     .		cx_by_ss( x_dim, 0 )	/ .FALSE. /,
+     .		cx_by_ss( y_dim, 0 )	/ .FALSE. /,
+     .		cx_trans   ( x_dim, 0 )	/ trans_no_transform /,
+     .		cx_trans   ( y_dim, 0 )	/ trans_no_transform /,
+     .		cx_trans_arg(x_dim, 0 )	/ bad_val4	/,
+     .		cx_trans_arg(y_dim, 0 )	/ bad_val4	/,
+     .		cx_given( x_dim, 0 )	/ .TRUE.  /,
+     .		cx_given( y_dim, 0 )	/ .TRUE.  /,
+     .		cx_given( z_dim, 0 )	/ .FALSE. /,
+     .		cx_given( t_dim, 0 )	/ .FALSE. /,
+     .		cx_given( e_dim, 0 )	/ .FALSE. /,
+     .		cx_given( f_dim, 0 )	/ .FALSE. /
+
+	DATA	cx_name(-1)		/ 'T    ' /	! "T"ropical Pacific
+	DATA	cx_lo_ww( x_dim,-1 )	/ 130.	/,
+     .		cx_hi_ww( x_dim,-1 )	/ 290.	/,
+     .		cx_lo_ww( y_dim,-1 )	/ -23.5	/,
+     .		cx_hi_ww( y_dim,-1 )	/ +23.5	/,
+     .		cx_by_ss( x_dim,-1 )	/ .FALSE. /,
+     .		cx_by_ss( y_dim,-1 )	/ .FALSE. /,
+     .		cx_trans   ( x_dim,-1 )	/ trans_no_transform /,
+     .		cx_trans   ( y_dim,-1 )	/ trans_no_transform /,
+     .		cx_trans_arg(x_dim,-1 )	/ bad_val4	/,
+     .		cx_trans_arg(y_dim,-1 )	/ bad_val4	/,
+     .		cx_given( x_dim,-1 )	/ .TRUE.  /,
+     .		cx_given( y_dim,-1 )	/ .TRUE.  /,
+     .		cx_given( z_dim,-1 )	/ .FALSE. /,
+     .		cx_given( t_dim,-1 )	/ .FALSE. /,
+     .		cx_given( e_dim,-1 )	/ .FALSE. /,
+     .		cx_given( f_dim,-1 )	/ .FALSE. /
+
+	DATA	cx_name(-2)		/ 'N    '/	! "N"arrow tropical slab
+	DATA	cx_lo_ww( x_dim,-2 )	/ 130.	/,
+     .		cx_hi_ww( x_dim,-2 )	/ 290.	/,
+     .		cx_lo_ww( y_dim,-2 )	/ -9.8	/,
+     .		cx_hi_ww( y_dim,-2 )	/ +9.8	/,
+     .		cx_by_ss( x_dim,-2 )	/ .FALSE. /,
+     .		cx_by_ss( y_dim,-2 )	/ .FALSE. /,
+     .		cx_trans   ( x_dim,-2 )	/ trans_no_transform /,
+     .		cx_trans   ( y_dim,-2 )	/ trans_no_transform /,
+     .		cx_trans_arg(x_dim,-2 )	/ bad_val4	/,
+     .		cx_trans_arg(y_dim,-2 )	/ bad_val4	/,
+     .		cx_given( x_dim,-2 )	/ .TRUE.  /,
+     .		cx_given( y_dim,-2 )	/ .TRUE.  /,
+     .		cx_given( z_dim,-2 )	/ .FALSE. /,
+     .		cx_given( t_dim,-2 )	/ .FALSE. /,
+     .		cx_given( e_dim,-2 )	/ .FALSE. /,
+     .		cx_given( f_dim,-2 )	/ .FALSE. /
+
+
+	END
+
diff --git a/fer/dat/xcontrol_data.F b/fer/dat/xcontrol_data.F
new file mode 100644
index 0000000..cf2b873
--- /dev/null
+++ b/fer/dat/xcontrol_data.F
@@ -0,0 +1,56 @@
+	BLOCK DATA XCONTROL_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization for control stack (CS)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/29/87
+* V531 5/01 *sh* - added has_continuation_cmnd
+
+        IMPLICIT NONE
+	include 'xcontrol.cmn'
+
+* control stack pointer starts at stack bottom
+	DATA csp/ 0 /
+
+* for continuation lines on commands
+	DATA	has_continuation_cmnd / .FALSE. /
+
+	END
diff --git a/fer/dat/xdependency_tree_data.F b/fer/dat/xdependency_tree_data.F
new file mode 100644
index 0000000..68d1b0b
--- /dev/null
+++ b/fer/dat/xdependency_tree_data.F
@@ -0,0 +1,52 @@
+	BLOCK DATA XDEPENDENCY_TREE_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* variables needed for reporting on dependency tree of user variable defs
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V685+ *sh* 10/2013
+
+        IMPLICIT NONE
+	include	'ferret.parm'
+	include	'tmap_dims.parm'
+	include	'xdependency_tree.cmn'
+
+	DATA dependency_tree_mode / .FALSE. /
+
+	END
diff --git a/fer/dat/xdset_parms_data.F b/fer/dat/xdset_parms_data.F
new file mode 100644
index 0000000..1f872fb
--- /dev/null
+++ b/fer/dat/xdset_parms_data.F
@@ -0,0 +1,77 @@
+	BLOCK DATA XDSET_PARMS_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* parameters differentiating characteristics of individual data sets
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/5/88
+* revision 0.1 - 7/2/88 - generalized Levitus_clim --> dp_clim_air_sst
+*			- added Am_factor
+* revision 0.2 - 4/19/89- pre-initialize only the LEV air temp set.  Other
+*			  3-letter codes to be pulled from the 205 data base
+*			  when SET DATA_SET is given
+
+        IMPLICIT NONE
+	include	'ferret.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_parms.cmn'
+
+* description of dp_ variables used by COX and PHILANDER output sets for air
+* temperature sets:
+*	dp_const_air_sst	- (LOGICAL) is the airt-sst diff. a constant ?
+*		if yes (constant)
+*	dp_delta_air_sst	- (REAL) contains the airt-sst difference
+*		if no (air temp supplied by another data set)
+*	dp_clim_air_sst		- (INTEGER) points a COX or PHILANDER output
+*				  set to its corresponding air temp set
+*	dp_airt_name		- (STRING) has 3-letter code for air temp set
+*	dp_airt_dset		- (INTEER) has data set # for the air temp dset 
+
+	DATA	dp_clim_air_sst / maxdsets*unspecified_int4 /
+
+	DATA	dp_airt_name( 1 ) / 'LEV' /,
+     .		dp_airt_name( 2 ) / unspecified_name4 /,
+     .		dp_airt_name( 3 ) / unspecified_name4 /,
+     .		dp_airt_name( 4 ) / unspecified_name4 /,
+     .		dp_airt_name( 5 ) / unspecified_name4 /
+
+	DATA	dp_airt_dset / max_airt_clim * unspecified_int4 /
+
+	END
diff --git a/fer/dat/xfgrdel_data.F b/fer/dat/xfgrdel_data.F
new file mode 100644
index 0000000..d9cde8a
--- /dev/null
+++ b/fer/dat/xfgrdel_data.F
@@ -0,0 +1,103 @@
+        BLOCK DATA FGRDEL_DATA
+
+* initialization of COMMON / FGRDEL /
+        IMPLICIT NONE
+        INCLUDE 'plot_setup.parm' ! dflt_widht, dflt_height, dflt_thicken
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER totmaxcolorobjs
+        PARAMETER (totmaxcolorobjs = maxwindowobjs * maxcolorobjs)
+        INTEGER totmaxbrushobjs
+        PARAMETER (totmaxbrushobjs = maxwindowobjs * maxbrushobjs)
+        INTEGER totmaxfontobjs
+        PARAMETER (totmaxfontobjs = maxwindowobjs * maxfontobjs)
+        INTEGER totmaxpenobjs
+        PARAMETER (totmaxpenobjs = maxwindowobjs * maxpenobjs)
+        INTEGER totmaxsymbolobjs
+        PARAMETER (totmaxsymbolobjs = maxwindowobjs * maxsymbolobjs)
+
+* Window objects (bindings to a window)
+        DATA windowobjs / maxwindowobjs * nullobj /
+
+* Color objects for each window
+        DATA colorobjs / totmaxcolorobjs * nullobj /
+
+* Brush objects for each window
+        DATA brushobjs / totmaxbrushobjs * nullobj /
+
+* Font objects for each window
+        DATA fontobjs / totmaxfontobjs * nullobj /
+
+* Pen objects for each window
+        DATA penobjs / totmaxpenobjs * nullobj /
+
+* Symbol objects for each window
+        DATA symbolobjs / totmaxsymbolobjs * nullobj /
+
+* Initially no active window
+        DATA activewindow / 0 /
+
+* Initially the implicit identity transform is active
+        DATA activetransform / 0 /
+
+* Initially no active brush, pen, symbol
+        DATA activebrush / 0 /
+        DATA activepen / 0 /
+        DATA activesymbol / 0 /
+
+* The brush used if no brush is active - initialize to solid black
+        DATA lastbrushcolor / 2 /
+        DATA lastbrushstyle / 'solid' /
+        DATA lastbstylen / 5 /
+
+* Nothing has been drawn to the current view of the active window
+        DATA somethingdrawn / .FALSE. /
+
+* By default clip drawings to the current view
+        DATA cliptoview / maxwindowobjs * .TRUE. /
+
+* Default factors for normalized device coordinates.
+        DATA ndcxmax / maxwindowobjs * 1.0 /
+        DATA ndcymax / maxwindowobjs * 1.0 /
+
+* "Uninitialized" DPI values
+        DATA windowdpix / maxwindowobjs * 0.0 /
+        DATA windowdpiy / maxwindowobjs * 0.0 /
+
+* Scaling factor for line widths and symbol sizes
+        DATA thickfactor / maxwindowobjs * dflt_thicken /
+
+* Coordinate transformation data independent of windows
+        DATA viewleftfrac / maxtransforms * 0.0 /
+        DATA viewbottomfrac / maxtransforms * 0.0 /
+        DATA viewrightfrac / maxtransforms * 1.0 /
+        DATA viewtopfrac / maxtransforms * 1.0 /
+        DATA viewleftcoord / maxtransforms * 0.0 /
+        DATA viewbottomcoord / maxtransforms * 0.0 /
+        DATA viewrightcoord / maxtransforms * 1.0 /
+        DATA viewtopcoord / maxtransforms * 1.0 /
+
+* Default window sizes.
+        DATA windowwidth / maxwindowobjs * dflt_xinches /
+        DATA windowheight / maxwindowobjs * dflt_yinches /
+
+* Default engine for a new window.
+* Should not change after start-up.
+* Only reset by command-line options.
+        DATA defaultenginename / 'PipedViewerPQ' /
+
+* Transparent background for save-on-exit (-batch)?
+* Should not change after start-up.
+* Only reset by the "-transparent" command-line option.
+* Has nothing to do with "frame /transparent".
+        DATA savetransparent / .FALSE. /
+
+* Actual window values - may get reset by the user.
+        DATA enginename / maxwindowobjs * 'PipedViewerPQ' /
+        DATA antialias / maxwindowobjs * .TRUE. /
+
+* Window title assigned just before creating a window
+        DATA windowtitle / 'FERRET' /
+
+        END
+
diff --git a/fer/dat/xfr_grid_data.F b/fer/dat/xfr_grid_data.F
new file mode 100644
index 0000000..c32aab7
--- /dev/null
+++ b/fer/dat/xfr_grid_data.F
@@ -0,0 +1,52 @@
+	BLOCK DATA XFR_GRID_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize FERRET extensions to TMAP_FORMAT grid data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/13/89
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include	'xfr_grid.cmn'
+
+	DATA	grd_stk_ptr / max_grids /
+
+	END
diff --git a/fer/dat/xgfdl_error_text_data.F b/fer/dat/xgfdl_error_text_data.F
new file mode 100644
index 0000000..473fd45
--- /dev/null
+++ b/fer/dat/xgfdl_error_text_data.F
@@ -0,0 +1,309 @@
+	BLOCK DATA XERRMSG_TEXT_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* error message strings
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 -  3/31/86
+* revision 0.1 --> 3/18/87+ - added several gerrs
+* revision 1.0  -  5/14/87 - added last error and error codes
+* revision 1.1  -  9/25/87 - changed relative coords error message
+* revision 1.2  -  2/15/88 - data_set_not_set --> grid_definition 
+* revision 1.3  -  3/2/88  - contour_line --> no_range
+* revision 1.4  -  3/10/88 - k_depth --> perm_var
+* revision 1.5  -  4/6/88  - cos_innac --> descriptor
+* revision 1.6 -   8/4/88  - changed insuff memory text
+* revision 1.7 -   1/3/89  - too_many_dsets --> regrid
+* revision 1.8 -  1/12/89  - changed error texts to be compatible with
+*			     ERRMSG prefixing "ERROR:"
+* V200: 10/16/89 - added ferr_ODR_error for Panasonic laser disk
+*	  2/7/90 - changed text of unknown_arg
+*        23/9/91 - unused ferr_gks --> ferr_not_implemented
+* V230:   8/5/92 - "ignored" removed from text of ferr_too_many_args
+*        11/9/92 - text of unknown variable mentions not in data set
+* V530: *sh* 9/00 - added ferr_data_type
+* V580 *acm* 11/04 - New code ferr_nomessge for use when user-given error  
+*                    msg in coached string substitution
+* V6.2 *acm*  2/09 - Change the text of insufficent memory error to 
+*                    request exceeds memory setting
+* V6.7 *acm*  1/11 - Fix ticket 1768: undefined messages for no-such-attribute
+*                    and error in attribute caused nulls to be written to std out.
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V684 9/12 *acm*  - Add error code for file not found
+*                    (error message for font files not found)
+* V658+ *sh* 10/13 - added ferr_unknown_auxvar
+
+        IMPLICIT NONE
+	include 'errmsg.parm'	! parameter definitions
+	include 'xerrmsg_text.cmn'	! common declaration
+
+
+* last error reported
+	DATA last_error / ferr_ok /
+
+* codes for "special" errors
+	DATA special_err_code( ferr_ok        - gspecial ) / 'ok'	/,
+     .	     special_err_code( ferr_erreq     - gspecial ) / 'erreq'	/,
+     .	     special_err_code( ferr_interrupt - gspecial ) / 'interrupt'/
+
+* codes for errors that are not reported explicitly by GFDL
+	DATA noreport_err_code( ferr_TMAP_error - gnoreport ) / 'TMAP_error'/
+	DATA noreport_err_code( ferr_ODR_error  - gnoreport ) / 'ODR_error'/
+
+* codes and text for normal error messages
+	DATA err_text( ferr_insuff_memory - greport )
+     .		/ 'request exceeds memory setting'/
+	DATA report_err_code( ferr_insuff_memory - greport )
+     .		/ 'insuff_memory'/
+
+	DATA err_text( ferr_too_many_vars - greport )
+     .		/ 'too many variables to store in memory'	/
+	DATA report_err_code( ferr_too_many_vars - greport )
+     .		/ 'too_many_vars'/
+
+	DATA err_text( ferr_perm_var	  - greport )		! unused
+     .		/ 'data flagged as permanent'		/
+	DATA report_err_code( ferr_perm_var	  - greport )
+     .		/ 'perm_var' /
+
+	DATA err_text( ferr_syntax	  - greport )
+     .		/ 'command syntax'			/
+	DATA report_err_code( ferr_syntax	  - greport )
+     .		/ 'syntax' /
+
+	DATA err_text( ferr_unknown_qualifier - greport )
+     .		/ 'unknown command qualifier'			/
+	DATA report_err_code( ferr_unknown_qualifier- greport )
+     .		/ 'unknown_qualifier' /
+
+	DATA err_text( ferr_unknown_variable - greport )
+     .		/ 'variable unknown or not in data set'		/
+
+	DATA report_err_code( ferr_unknown_variable - greport )
+     .		/ 'unknown_variable' /
+
+	DATA err_text( ferr_invalid_command  - greport )
+     .		/ 'invalid command'			/
+	DATA report_err_code( ferr_invalid_command  - greport )
+     .		/ 'invalid_command' /
+
+	DATA err_text( ferr_regrid - greport )
+     .		/ 'regridding'				/
+	DATA report_err_code( ferr_regrid - greport )
+     .		/ 'regridding' /
+
+	DATA err_text( ferr_cmnd_too_complex - greport )
+     .		/ 'command too complex'				/
+	DATA report_err_code( ferr_cmnd_too_complex - greport )
+     .		/ 'cmnd_too_complex' /
+
+	DATA err_text( ferr_unknown_data_set - greport )
+     .		/ 'unknown data set'				/
+	DATA report_err_code( ferr_unknown_data_set - greport )
+     .		/ 'unknown_data_set' /
+
+	DATA err_text( ferr_too_many_args - greport )
+     .		/ 'too many arguments'/
+	DATA report_err_code( ferr_too_many_args - greport )
+     .		/ 'too_many_args' /
+
+	DATA err_text( ferr_not_implemented	- greport )
+     .		/ 'feature not implemented'			/
+	DATA report_err_code( ferr_not_implemented - greport )
+     .		/ 'not_implemented' /
+
+	DATA err_text( ferr_invalid_subcmnd - greport )
+     .		/ 'invalid subcommand'				/
+	DATA report_err_code( ferr_invalid_subcmnd - greport )
+     .		/ 'invalid_subcmnd' /
+
+	DATA err_text( ferr_relative_coord - greport )
+     .		/ 'invalid use delta region'			/
+	DATA report_err_code( ferr_relative_coord - greport )
+     .		/ 'relative_coord' /
+
+	DATA err_text( ferr_unknown_arg - greport )
+     .		/ 'unknown or invalid argument'				/
+	DATA report_err_code( ferr_unknown_arg - greport )
+     .		/ 'unknown_arg' /
+
+	DATA err_text( ferr_dim_underspec - greport )
+     .		/ 'dimensions improperly specified'		/
+	DATA report_err_code( ferr_dim_underspec - greport )
+     .		/ 'dim_underspec' /
+
+	DATA err_text( ferr_grid_definition - greport )
+     .		/ 'improper grid or axis definition'		/
+	DATA report_err_code( ferr_grid_definition- greport )
+     .		/ 'grid_definition' /
+
+	DATA err_text( ferr_internal - greport )
+     .		/ 'internal program problem'			/
+	DATA report_err_code( ferr_internal - greport )
+     .		/ 'internal' /
+
+	DATA err_text( ferr_line_too_long - greport )
+     .		/ 'line too long'				/
+	DATA report_err_code( ferr_line_too_long - greport )
+     .		/ 'line_too_long' /
+
+	DATA err_text( ferr_inconsist_plane - greport )
+     .		/ 'inconsistent sizes of data regions'		/
+	DATA report_err_code( ferr_inconsist_plane - greport )
+     .		/ 'inconsist_plane' /
+
+	DATA err_text( ferr_inconsist_grid - greport )
+     .		/ 'inconsistent data grids'			/
+	DATA report_err_code( ferr_inconsist_grid - greport )
+     .		/ 'inconsist_grid' /
+
+	DATA err_text( ferr_expr_too_complex - greport )
+     .		/ 'expression too complex'			/
+	DATA report_err_code( ferr_expr_too_complex - greport )
+     .		/ 'expr_too_complex' /
+
+	DATA err_text( ferr_stack_ovfl - greport )
+     .		/ 'stack overflow'				/
+	DATA report_err_code( ferr_stack_ovfl - greport )
+     .		/ 'stack_ovfl' /
+
+	DATA err_text( ferr_stack_undfl - greport )
+     .		/ 'stack underflow'				/
+	DATA report_err_code( ferr_stack_undfl - greport )
+     .		/ 'stack_undfl' /
+
+	DATA err_text( ferr_out_of_range - greport )
+     .		/ 'value out of legal range'			/
+	DATA report_err_code( ferr_out_of_range - greport )
+     .		/ 'out_of_range' /
+
+	DATA err_text( ferr_prog_limit - greport )
+     .		/ 'a program limit has been reached'		/
+	DATA report_err_code( ferr_prog_limit - greport )
+     .		/ 'prog_limit' /
+
+	DATA err_text( ferr_unknown_grid - greport )
+     .		/ 'unknown defining grid'			/
+	DATA report_err_code( ferr_unknown_grid - greport )
+     .		/ 'unknown_grid' /
+
+	DATA err_text( ferr_no_range - greport )
+     .		/ 'all data have same value'			/
+	DATA report_err_code( ferr_no_range - greport )
+     .		/ 'no_range' /
+
+	DATA err_text( ferr_var_not_in_set - greport )
+     .		/ 'required variable not in data set'		/
+	DATA report_err_code( ferr_var_not_in_set - greport )
+     .		/ 'var_not_in_set' /
+
+	DATA err_text( ferr_unknown_file_type - greport )
+     .		/ 'class of data set is unknown'		/
+	DATA report_err_code( ferr_unknown_file_type - greport )
+     .		/ 'unknown_file_type' /
+
+	DATA err_text( ferr_limits - greport )
+     .		/ 'illegal limits'				/
+	DATA report_err_code( ferr_limits - greport )
+     .		/ 'limits' /
+
+	DATA err_text( ferr_descriptor - greport )
+     .		/ 'in descriptor file'	/
+	DATA report_err_code( ferr_descriptor - greport )
+     .		/ 'descriptor' /
+
+	DATA err_text( ferr_bad_delta - greport )
+     .		/ 'invalid delta increment'			/
+	DATA report_err_code( ferr_bad_delta - greport )
+     .		/ 'bad_delta' /
+
+	DATA err_text( ferr_trans_nest - greport )
+     .		/ 'illegal use of transformation'		/
+	DATA report_err_code( ferr_trans_nest - greport )
+     .		/ 'trans_nest' /
+
+	DATA err_text( ferr_state_not_set - greport )
+     .		/ 'required program command has not been given'	/
+	DATA report_err_code( ferr_state_not_set - greport )
+     .		/ 'state_not_set' /
+
+	DATA err_text( ferr_unknown_command - greport )
+     .		/ 'unknown command'				/
+	DATA report_err_code( ferr_unknown_command - greport )
+     .		/ 'unknown_command' /
+
+        
+	DATA err_text( ferr_ef_error - greport )
+     .		/ ' '	/
+
+	DATA err_text( ferr_data_type - greport )
+     .		/ 'illegal data type (float,string,...) for operation'/
+	DATA report_err_code( ferr_data_type - greport )
+     .		/ 'data_type' /
+
+	DATA err_text( ferr_unknown_attribute - greport )
+     .		/ 'attribute undefined or invalid attribute name'/
+	DATA report_err_code( ferr_unknown_attribute - greport )
+     .		/ 'unknown_attribute' /
+
+	DATA err_text( ferr_not_attribute - greport )
+     .		/ 'error specifying attribute'/
+	DATA report_err_code( ferr_not_attribute - greport )
+     .		/ 'not_attribute' /
+
+	DATA err_text( ferr_aggregate_error - greport )
+     .		/ 'error defining aggregate dataset'/
+	DATA report_err_code( ferr_not_attribute - greport )
+     .		/ 'aggregate_error' /
+
+	DATA err_text( ferr_file_not_found - greport )
+     .		/ 'file undefined or not found'/
+	DATA report_err_code( ferr_aggregate_error - greport )
+     .		/ 'filefound_error' /
+
+	DATA err_text( ferr_unknown_auxvar - greport )
+     .		/ 'auxiliary variable unknown or not in data set' /
+
+	DATA err_text( ferr_nomessge - greport )
+     .		/ ' '/
+
+	DATA report_err_code( ferr_nomessge - greport )
+     .		/ 'no_message' /
+
+	END
diff --git a/fer/dat/xgfdl_masks_data.F b/fer/dat/xgfdl_masks_data.F
new file mode 100644
index 0000000..25e052b
--- /dev/null
+++ b/fer/dat/xgfdl_masks_data.F
@@ -0,0 +1,1264 @@
+	BLOCK DATA XGFDL_MASKS_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+* programmer - mark verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 02/07/86
+* Linux Port 1/97 *kob* - Added a preprocessor include for xgfdl_masks.cmn
+*			  because it needed a preprocessor.
+        IMPLICIT NONE
+	INTEGER	   im    , jm    , km   ,ijsize, i
+	PARAMETER (im=160, jm=100, km=27)
+	PARAMETER (ijsize = im*jm)
+
+* COMMON/XGFDL_MASKS...define grid variables
+
+#include "xgfdl_masks.cmn"
+
+
+* fill bottom topography masks (flat bottom ocean)
+      DATA kmt /ijsize*km/
+      DATA kmu /ijsize*km/
+
+* fill land/ocean masks
+
+      DATA (tmask(i,001),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,002),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0/
+      DATA (tmask(i,003),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0/
+      DATA (tmask(i,004),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0/
+      DATA (tmask(i,005),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0/
+      DATA (tmask(i,006),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0/
+      DATA (tmask(i,007),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0/
+      DATA (tmask(i,008),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0/
+      DATA (tmask(i,009),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0/
+      DATA (tmask(i,010),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,011),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,012),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,013),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,014),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,015),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,016),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,017),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,018),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,019),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,020),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,021),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,022),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,023),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,024),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,025),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,026),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,027),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,028),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,029),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,030),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,031),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,032),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,033),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,034),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,035),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,036),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,037),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,038),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,039),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,040),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,041),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,042),i=1,160)/
+     .0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,043),i=1,160)/
+     .0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,044),i=1,160)/
+     .0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,045),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,046),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,047),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,048),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,049),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,050),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,051),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,052),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,053),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,054),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,055),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,056),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,057),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,058),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,059),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,060),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,061),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,062),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,063),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,064),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,065),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,066),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,067),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (tmask(i,068),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,069),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,070),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,071),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,072),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,073),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,074),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,075),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,076),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,077),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,078),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,079),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,080),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,081),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,082),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,083),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,084),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,085),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,086),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,087),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,088),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,089),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,090),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,091),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,092),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,093),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,094),i=1,160)/
+     .0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,095),i=1,160)/
+     .0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,096),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,097),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,098),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,099),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (tmask(i,100),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+
+      DATA (umask(i,001),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,002),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0/
+      DATA (umask(i,003),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0/
+      DATA (umask(i,004),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0/
+      DATA (umask(i,005),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0/
+      DATA (umask(i,006),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0/
+      DATA (umask(i,007),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0/
+      DATA (umask(i,008),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0/
+      DATA (umask(i,009),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,010),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,011),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,012),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,013),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,014),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,015),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,016),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,017),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,018),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,019),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,020),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,021),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,022),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,023),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,024),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,025),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,026),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,027),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,028),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,029),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,030),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,031),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,032),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,033),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,034),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,035),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,036),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,037),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,038),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,039),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,040),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,041),i=1,160)/
+     .0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,042),i=1,160)/
+     .0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,043),i=1,160)/
+     .0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,044),i=1,160)/
+     .0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,045),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,046),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,047),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,048),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,049),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,050),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,051),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,052),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,053),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,054),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,055),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,056),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,057),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,058),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,059),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,060),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,061),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,062),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,063),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,064),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,065),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,066),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0/
+      DATA (umask(i,067),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,068),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,069),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,070),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,071),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,072),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,073),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,074),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,075),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,076),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,077),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,078),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,079),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,080),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,081),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,082),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,083),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,084),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,085),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,086),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,087),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,088),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,089),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,090),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,091),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,092),i=1,160)/
+     .0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,093),i=1,160)/
+     .0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,094),i=1,160)/
+     .0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,095),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,096),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,097),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,098),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+     .1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,099),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+      DATA (umask(i,100),i=1,160)/
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+     .0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
+
+	END
diff --git a/fer/dat/xgks_devices_data.F b/fer/dat/xgks_devices_data.F
new file mode 100644
index 0000000..3012b58
--- /dev/null
+++ b/fer/dat/xgks_devices_data.F
@@ -0,0 +1,81 @@
+	BLOCK DATA XGKS_DEVICES_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization for DEC GKS devices
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  12/6/89
+
+        IMPLICIT NONE
+	include	'xgks_devices.cmn'
+
+	DATA	gks_dev_name(1) / 'DEFAULT'    	/,
+     .		gks_dev_name(2) / 'VSII'    	/,
+     .		gks_dev_name(3) / 'PS'    	/,
+     .		gks_dev_name(4) / 'LN03P'    	/,
+     .		gks_dev_name(5) / 'TEK4107'    	/,
+     .		gks_dev_name(6) / 'TEK4014'    	/,
+     .		gks_dev_name(7) / '&&&&&&&&'   	/,
+     .		gks_dev_name(8) / '&&&&&&&&'   	/,
+     .		gks_dev_name(9) / '&&&&&&&&'   	/,
+     .		gks_dev_name(10)/ '&&&&&&&&'   	/
+
+	DATA	gks_dev_wstype(1) / -999 /,
+     .		gks_dev_wstype(2) / -999 /,
+     .		gks_dev_wstype(3) / -999 /,
+     .		gks_dev_wstype(4) / -999 /,
+     .		gks_dev_wstype(5) / -999 /,
+     .		gks_dev_wstype(6) / -999 /,
+     .		gks_dev_wstype(7) / -999 /,
+     .		gks_dev_wstype(8) / -999 /,
+     .		gks_dev_wstype(9) / -999 /,
+     .		gks_dev_wstype(10)/ -999 /
+
+	DATA	meta_dev_name(1) / 'VSII'    	/,
+     .		meta_dev_name(2) / 'PS'    	/,
+     .		meta_dev_name(3) / 'LN03P'    	/,
+     .		meta_dev_name(4) / 'TEK4107'    	/,
+     .		meta_dev_name(5) / 'TEK4014'    	/,
+     .		meta_dev_name(6) / '&&&&&&&&'   	/,
+     .		meta_dev_name(7) / '&&&&&&&&'   	/,
+     .		meta_dev_name(8) / '&&&&&&&&'   	/,
+     .		meta_dev_name(9) / '&&&&&&&&'   	/,
+     .		meta_dev_name(10)/ '&&&&&&&&'   	/
+	END
diff --git a/fer/dat/xgrid_chg_fcns_data.F b/fer/dat/xgrid_chg_fcns_data.F
new file mode 100644
index 0000000..296a60c
--- /dev/null
+++ b/fer/dat/xgrid_chg_fcns_data.F
@@ -0,0 +1,1224 @@
+	BLOCK DATA XGRID_CHG_FCNS_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* function names and descriptive information for internally-defined grid-
+* changing functions
+
+* V450 - 7/79 - minor change to text on ZAXREPLACE
+* V491 - 1/98 - changed function TEST2 so that it replaces T axis
+* V500: 1/99 added gfcn_arg_type in support of string arguments
+*       2/99 changed UNRAVEL to XSEQUENCE, YSEQUENCE, ZSEQUENCE, TSEQUENCE
+*       3/99 *kob* fixed bugs in above additions - parameter references
+*	incorrect
+*	3/99 *sh* added a numerical argument to ECHO to debug stack problem
+* V510: added SAMPLE* functions as *internal* GC functions
+* V533: *sh* 6/01 - allow some functions to take parg_type_multi
+*            7/01 - added function SPAWN  
+* V540: *sh* 10/01 - use improved data typing parameters parg_type_*
+*       *acm*11/01 - clarify the function description for ZAXREPLACE
+*	     12/01 - bug fix in arg type of SPAWN function
+* V541: *kob* 6/02 - Add STRLEN, UPCASE,DNCASE,STRINDEX, STRRINDEX
+*                        SUBSTRING, STRCAT, STRFLOAT 
+*                    internal string handling functions   
+* V550: *acm*10/02 - Correct the function description for SUBSTRING
+*        2/12 *kms* Add E and F dimensions (set to nferdims in tmap_dims.parm)
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_IMPOSE_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'grid_chg_fcns.parm'
+	include 'xgrid_chg_fcns.cmn'
+
+* internal variable declarations
+	INTEGER		i
+
+
+* XSEQUENCE(arg) - same values as input grid but unravelled into an X line
+	INTEGER		p_xunravel_arg_start, p_xunravel_num_args 
+	PARAMETER     ( p_xunravel_arg_start = 1,
+     .			p_xunravel_num_args  = 1 )
+
+	DATA gfcn_name         (p_xunravel) /'XSEQUENCE'/
+	DATA gfcn_version      (p_xunravel) / 1.0 /
+	DATA gfcn_descr        (p_xunravel) / 'unravel grid to a line in X' /
+	DATA gfcn_rtn_type     (p_xunravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_xunravel) /p_xunravel_num_args/
+	DATA gfcn_has_vari_args(p_xunravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_xunravel),i=1,nferdims)/
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal /
+	DATA (gfcn_piecemeal_ok(i,p_xunravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_xunravel) /p_xunravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_xunravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_xunravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_xunravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_xunravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_xunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_xunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_xunravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* TIMES2(arg) a.k.a. "ECHO" -- display string  --> debugging function
+* 1/98 - changed TIMES2 to test custom axis replacement of T axis
+	INTEGER		p_times2_arg_start, p_times2_num_args 
+	PARAMETER     ( p_times2_arg_start = p_xunravel_arg_start +
+     .					     p_xunravel_num_args,
+     .			p_times2_num_args  = 2 )
+
+
+	DATA gfcn_name         (p_times2) /'ECHO'/
+	DATA gfcn_version      (p_times2) / 1.0 /
+	DATA gfcn_descr        (p_times2)
+     .			/ 'echo passed string (test routine)' /
+	DATA gfcn_rtn_type     (p_times2) / pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_times2) /p_times2_num_args/
+	DATA gfcn_has_vari_args(p_times2) /.FALSE./
+
+	DATA (gfcn_axis_will_be(i,p_times2),i=1,nferdims)/
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_times2),i=1,nferdims)
+     .      / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+	DATA gfcn_arg_ptr(p_times2) /p_times2_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_times2_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_times2_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_times2_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_times2_arg_start+0)/'input text'/
+	DATA (gfcn_arg_extend_lo (i,p_times2_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_times2_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_times2_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+* ... argument 2
+	DATA gfcn_arg_name(p_times2_arg_start+1)/'NUM'/
+	DATA gfcn_arg_type(p_times2_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_times2_arg_start+1)/'anything'/
+	DATA gfcn_arg_descr(p_times2_arg_start+1)/'numerical variable'/
+	DATA (gfcn_arg_extend_lo (i,p_times2_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_times2_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_times2_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* RESHAPE(data,grid_and_start) - same values as input grid but reshaped
+*   into the grid of the 2nd arg ... starting at start point (1,1,1,1,1,1)
+	INTEGER		p_reshape_arg_start, p_reshape_num_args 
+	PARAMETER     ( p_reshape_arg_start = p_times2_arg_start +
+     .					      p_times2_num_args,
+     .			p_reshape_num_args  = 2 )
+
+	DATA gfcn_name         (p_reshape) /'RESHAPE'/
+	DATA gfcn_version      (p_reshape) / 1.0 /
+	DATA gfcn_descr        (p_reshape) / 'reshape A to grid of B' /
+	DATA gfcn_rtn_type     (p_reshape) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_reshape) /p_reshape_num_args/
+	DATA gfcn_has_vari_args(p_reshape) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_reshape),i=1,nferdims)/
+     .						pgc_axis_supplied_herein,
+     .						pgc_axis_supplied_herein,
+     .						pgc_axis_supplied_herein,
+     .						pgc_axis_supplied_herein,
+     .						pgc_axis_supplied_herein,
+     .						pgc_axis_supplied_herein /
+	DATA (gfcn_piecemeal_ok(i,p_reshape),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_reshape) /p_reshape_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_reshape_arg_start+0)/'A'/
+	DATA gfcn_arg_type(p_reshape_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_reshape_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_reshape_arg_start+0)/'data to be reshaped'/
+	DATA gfcn_arg_name(p_reshape_arg_start+1)/'B'/
+	DATA gfcn_arg_type(p_reshape_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_reshape_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_reshape_arg_start+1)/'destination grid'/
+	DATA (gfcn_arg_extend_lo (i,p_reshape_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_reshape_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+*  Note: set to TRUE despite the fact that all of the
+*     resultant axes are "pgc_axis_supplied_herein". This is to cover the
+*     special case in which an axis of the result (imposed) **happens to**
+*     match the axis of the argument. In this case TRUE means that context
+*     limits do get passed upstream.
+	DATA (gfcn_axis_implied_from(i, p_reshape_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_reshape_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+* ZAXREPLACE(var, depthoflayer, zaxis)
+*   interpolate the sigma layer onto the Z (depth) axis provided guided by
+*   the depthoflayer field provided
+	INTEGER		p_zlayer_arg_start, p_zlayer_num_args 
+	PARAMETER     ( p_zlayer_arg_start = p_reshape_arg_start +
+     .					     p_reshape_num_args,
+     .			p_zlayer_num_args  = 3 )
+
+	DATA gfcn_name         (p_zlayer) /'ZAXREPLACE'/
+	DATA gfcn_version      (p_zlayer) / 1.0 /
+	DATA gfcn_descr        (p_zlayer)(1:51) /
+     .	         'regrid V onto Z axis of ZAX based upon Z values in '/
+	DATA gfcn_descr        (p_zlayer)(52:124) /
+     .           'ZVALS using linear interpolation'/
+
+	DATA gfcn_rtn_type     (p_zlayer) / pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_zlayer) /p_zlayer_num_args/
+	DATA gfcn_has_vari_args(p_zlayer) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_zlayer),i=1,nferdims)/
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args,
+     .						pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_zlayer),i=1,nferdims)
+     .      /  .FALSE., .FALSE., .FALSE., .TRUE., .TRUE., .TRUE./
+	DATA gfcn_arg_ptr(p_zlayer) /p_zlayer_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_zlayer_arg_start+0)/'V'/
+	DATA gfcn_arg_type(p_zlayer_arg_start+0)/parg_type_float/
+	DATA gfcn_arg_units(p_zlayer_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_zlayer_arg_start+0)/
+     .		'variable on native Z axis'/
+	DATA gfcn_arg_name(p_zlayer_arg_start+1)/'ZVALS'/
+	DATA gfcn_arg_type(p_zlayer_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_zlayer_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_zlayer_arg_start+1)/
+     .	'Z-value field corresponding to data points of V'/
+	DATA gfcn_arg_name(p_zlayer_arg_start+2)/'ZAX'/
+	DATA gfcn_arg_type(p_zlayer_arg_start+2)/parg_type_float/
+	DATA gfcn_arg_units(p_zlayer_arg_start+2)/' '/
+	DATA gfcn_arg_descr(p_zlayer_arg_start+2)/
+     .		'variable with desired Z (depth) axis points'/
+	DATA (gfcn_arg_extend_lo (i,p_zlayer_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_zlayer_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_zlayer_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .FALSE., .TRUE., .TRUE., .TRUE. /
+* ... argument 2 
+	DATA (gfcn_axis_implied_from(i, p_zlayer_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .FALSE., .TRUE., .TRUE., .TRUE. /
+* ... argument 3
+	DATA (gfcn_axis_implied_from(i, p_zlayer_arg_start+2),i=1,nferdims)
+     .    / .FALSE., .FALSE., .TRUE., .FALSE., .FALSE., .FALSE. /
+
+
+* YSEQUENCE(arg) - same values as input grid but unravelled into a Y line
+	INTEGER		p_yunravel_arg_start, p_yunravel_num_args
+	PARAMETER     ( p_yunravel_arg_start = p_zlayer_arg_start +
+     .					       p_zlayer_num_args,
+     .			p_yunravel_num_args  = 1 )
+	DATA gfcn_name         (p_yunravel) /'YSEQUENCE'/
+	DATA gfcn_version      (p_yunravel) / 1.0 /
+	DATA gfcn_descr        (p_yunravel) / 'unravel grid to a line in Y' /
+	DATA gfcn_rtn_type     (p_yunravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_yunravel) /p_yunravel_num_args/
+	DATA gfcn_has_vari_args(p_yunravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_yunravel),i=1,nferdims)/
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal /
+	DATA (gfcn_piecemeal_ok(i,p_yunravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_yunravel) /p_yunravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_yunravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_yunravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_yunravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_yunravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_yunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_yunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_yunravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* ZSEQUENCE(arg) - same values as input grid but unravelled into a Z line
+	INTEGER		p_zunravel_arg_start, p_zunravel_num_args
+	PARAMETER     ( p_zunravel_arg_start = p_yunravel_arg_start +
+     .					       p_yunravel_num_args,
+     .			p_zunravel_num_args  = 1 )
+	DATA gfcn_name         (p_zunravel) /'ZSEQUENCE'/
+	DATA gfcn_version      (p_zunravel) / 1.0 /
+	DATA gfcn_descr        (p_zunravel) / 'unravel grid to a line in Z' /
+	DATA gfcn_rtn_type     (p_zunravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_zunravel) /p_zunravel_num_args/
+	DATA gfcn_has_vari_args(p_zunravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_zunravel),i=1,nferdims)/
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal /
+	DATA (gfcn_piecemeal_ok(i,p_zunravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_zunravel) /p_zunravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_zunravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_zunravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_zunravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_zunravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_zunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_zunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_zunravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* TSEQUENCE(arg) - same values as input grid but unravelled into a T line
+	INTEGER		p_tunravel_arg_start, p_tunravel_num_args
+	PARAMETER     ( p_tunravel_arg_start = p_zunravel_arg_start +
+     .					       p_zunravel_num_args,
+     .			p_tunravel_num_args  = 1 )
+	DATA gfcn_name         (p_tunravel) /'TSEQUENCE'/
+	DATA gfcn_version      (p_tunravel) / 1.0 /
+	DATA gfcn_descr        (p_tunravel) / 'unravel grid to a line in T' /
+	DATA gfcn_rtn_type     (p_tunravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_tunravel) /p_tunravel_num_args/
+	DATA gfcn_has_vari_args(p_tunravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_tunravel),i=1,nferdims)/
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal/
+	DATA (gfcn_piecemeal_ok(i,p_tunravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_tunravel) /p_tunravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_tunravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_tunravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_tunravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_tunravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_tunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_tunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_tunravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+* ESEQUENCE(arg) - same values as input grid but unravelled into a E line
+	INTEGER		p_eunravel_arg_start, p_eunravel_num_args
+	PARAMETER     ( p_eunravel_arg_start = p_tunravel_arg_start +
+     .					       p_tunravel_num_args,
+     .			p_eunravel_num_args  = 1 )
+	DATA gfcn_name         (p_eunravel) /'ESEQUENCE'/
+	DATA gfcn_version      (p_eunravel) / 1.0 /
+	DATA gfcn_descr        (p_eunravel) / 'unravel grid to a line in E' /
+	DATA gfcn_rtn_type     (p_eunravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_eunravel) /p_eunravel_num_args/
+	DATA gfcn_has_vari_args(p_eunravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_eunravel),i=1,nferdims)/
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal/
+	DATA (gfcn_piecemeal_ok(i,p_eunravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_eunravel) /p_eunravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_eunravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_eunravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_eunravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_eunravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_eunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_eunravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_eunravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* FSEQUENCE(arg) - same values as input grid but unravelled into a F line
+	INTEGER		p_funravel_arg_start, p_funravel_num_args
+	PARAMETER     ( p_funravel_arg_start = p_eunravel_arg_start +
+     .					       p_eunravel_num_args,
+     .			p_funravel_num_args  = 1 )
+	DATA gfcn_name         (p_funravel) /'FSEQUENCE'/
+	DATA gfcn_version      (p_funravel) / 1.0 /
+	DATA gfcn_descr        (p_funravel) / 'unravel grid to a line in F' /
+	DATA gfcn_rtn_type     (p_funravel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_funravel) /p_funravel_num_args/
+	DATA gfcn_has_vari_args(p_funravel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_funravel),i=1,nferdims)/
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_abstract/
+	DATA (gfcn_piecemeal_ok(i,p_funravel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_funravel) /p_funravel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_funravel_arg_start+0)/'VAR'/
+	DATA gfcn_arg_type(p_funravel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_funravel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_funravel_arg_start+0)/' '/
+	DATA (gfcn_arg_extend_lo (i,p_funravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_funravel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_funravel_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+* SAMPLEI - sample argument 1 at the X indices indicated in arg 2
+	INTEGER		p_samplei_arg_start, p_samplei_num_args 
+	PARAMETER     ( p_samplei_arg_start = p_funravel_arg_start +
+     .					      p_funravel_num_args,
+     .			p_samplei_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplei) /'SAMPLEI'/
+	DATA gfcn_version      (p_samplei) / 1.0 /
+	DATA gfcn_descr        (p_samplei)
+     .		/ 'sample a field at a list of X indices' /
+	DATA gfcn_rtn_type     (p_samplei) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplei) /p_samplei_num_args/
+	DATA gfcn_has_vari_args(p_samplei) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplei),i=1,nferdims)/
+     .					pgc_axis_is_abstract,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args /
+	DATA (gfcn_piecemeal_ok(i,p_samplei),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplei) /p_samplei_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplei_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplei_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplei_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplei_arg_start+0)
+     .			/'data to sample at list of X indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplei_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplei_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplei_arg_start+1)/'X_INDICES'/
+	DATA gfcn_arg_type(p_samplei_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplei_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplei_arg_start+1)
+     .			/'list of X indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplei_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplei_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplei_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplei_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* SAMPLEJ - sample argument 1 at the Y indices indicated in arg 2
+	INTEGER		p_samplej_arg_start, p_samplej_num_args 
+	PARAMETER     ( p_samplej_arg_start = p_samplei_arg_start +
+     .					      p_samplei_num_args,
+     .			p_samplej_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplej) /'SAMPLEJ'/
+	DATA gfcn_version      (p_samplej) / 1.0 /
+	DATA gfcn_descr        (p_samplej)
+     .		/ 'sample a field at a list of Y indices' /
+	DATA gfcn_rtn_type     (p_samplej) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplej) /p_samplej_num_args/
+	DATA gfcn_has_vari_args(p_samplej) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplej),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_is_abstract,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args /
+	DATA (gfcn_piecemeal_ok(i,p_samplej),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplej) /p_samplej_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplej_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplej_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplej_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplej_arg_start+0)
+     .			/'data to sample at list of Y indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplej_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplej_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplej_arg_start+1)/'Y_INDICES'/
+	DATA gfcn_arg_type(p_samplej_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplej_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplej_arg_start+1)
+     .			/'list of Y indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplej_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplej_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplej_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .FALSE., .TRUE., .TRUE., .TRUE., .TRUE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplej_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* SAMPLEK - sample argument 1 at the Z indices indicated in arg 2
+	INTEGER		p_samplek_arg_start, p_samplek_num_args 
+	PARAMETER     ( p_samplek_arg_start = p_samplej_arg_start +
+     .					      p_samplej_num_args,
+     .			p_samplek_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplek) /'SAMPLEK'/
+	DATA gfcn_version      (p_samplek) / 1.0 /
+	DATA gfcn_descr        (p_samplek)
+     .		/ 'sample a field at a list of Z indices' /
+	DATA gfcn_rtn_type     (p_samplek) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplek) /p_samplek_num_args/
+	DATA gfcn_has_vari_args(p_samplek) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplek),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_is_abstract,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args /
+	DATA (gfcn_piecemeal_ok(i,p_samplek),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplek) /p_samplek_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplek_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplek_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplek_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplek_arg_start+0)
+     .			/'data to sample at list of Z indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplek_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplek_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplek_arg_start+1)/'Z_INDICES'/
+	DATA gfcn_arg_type(p_samplek_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplek_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplek_arg_start+1)
+     .			/'list of Z indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplek_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplek_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplek_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .FALSE., .TRUE., .TRUE., .TRUE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplek_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* SAMPLEL - sample argument 1 at the T indices indicated in arg 2
+	INTEGER		p_samplel_arg_start, p_samplel_num_args 
+	PARAMETER     ( p_samplel_arg_start = p_samplek_arg_start +
+     .					      p_samplek_num_args, 
+     .			p_samplel_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplel) /'SAMPLEL'/
+	DATA gfcn_version      (p_samplel) / 1.0 /
+	DATA gfcn_descr        (p_samplel)
+     .		/ 'sample a field at a list of T indices' /
+	DATA gfcn_rtn_type     (p_samplel) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplel) /p_samplel_num_args/
+	DATA gfcn_has_vari_args(p_samplel) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplel),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_is_abstract,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_samplel),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplel) /p_samplel_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplel_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplel_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplel_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplel_arg_start+0)
+     .			/'data to sample at list of T indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplel_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplel_arg_start+1)/'T_INDICES'/
+	DATA gfcn_arg_type(p_samplel_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplel_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplel_arg_start+1)
+     .			/'list of T indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplel_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplel_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplel_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .FALSE., .TRUE., .TRUE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplel_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* SAMPLEM - sample argument 1 at the E indices indicated in arg 2
+	INTEGER		p_samplem_arg_start, p_samplem_num_args 
+	PARAMETER     ( p_samplem_arg_start = p_samplel_arg_start +
+     .					      p_samplel_num_args, 
+     .			p_samplem_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplem) /'SAMPLEM'/
+	DATA gfcn_version      (p_samplem) / 1.0 /
+	DATA gfcn_descr        (p_samplem)
+     .		/ 'sample a field at a list of E indices' /
+	DATA gfcn_rtn_type     (p_samplem) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplem) /p_samplem_num_args/
+	DATA gfcn_has_vari_args(p_samplem) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplem),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_is_abstract,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_samplem),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplem) /p_samplem_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplem_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplem_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplem_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplem_arg_start+0)
+     .			/'data to sample at list of E indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplem_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplem_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplem_arg_start+1)/'E_INDICES'/
+	DATA gfcn_arg_type(p_samplem_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplem_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplem_arg_start+1)
+     .			/'list of E indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplem_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplem_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplem_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .FALSE., .TRUE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplem_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+* SAMPLEN - sample argument 1 at the F indices indicated in arg 2
+	INTEGER		p_samplen_arg_start, p_samplen_num_args 
+	PARAMETER     ( p_samplen_arg_start = p_samplem_arg_start +
+     .					      p_samplem_num_args, 
+     .			p_samplen_num_args  = 2 )
+
+	DATA gfcn_name         (p_samplen) /'SAMPLEN'/
+	DATA gfcn_version      (p_samplen) / 1.0 /
+	DATA gfcn_descr        (p_samplen)
+     .		/ 'sample a field at a list of F indices' /
+	DATA gfcn_rtn_type     (p_samplen) /pfcn_rtn_arg1_type /
+	DATA gfcn_num_reqd_args(p_samplen) /p_samplen_num_args/
+	DATA gfcn_has_vari_args(p_samplen) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_samplen),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_is_abstract/
+	DATA (gfcn_piecemeal_ok(i,p_samplen),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_samplen) /p_samplen_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_samplen_arg_start+0)/'TO_BE_SAMPLED'/
+	DATA gfcn_arg_type(p_samplen_arg_start+0)/parg_type_float_or_string/
+	DATA gfcn_arg_units(p_samplen_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_samplen_arg_start+0)
+     .			/'data to sample at list of F indices supplied '/
+	DATA (gfcn_arg_extend_lo (i,p_samplen_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplen_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA gfcn_arg_name(p_samplen_arg_start+1)/'F_INDICES'/
+	DATA gfcn_arg_type(p_samplen_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_samplen_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_samplen_arg_start+1)
+     .			/'list of F indices at which to sample'/
+	DATA (gfcn_arg_extend_lo (i,p_samplen_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_samplen_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_samplen_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .FALSE. /
+* ... by argument 2?
+	DATA (gfcn_axis_implied_from(i, p_samplen_arg_start+1),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+
+
+* SPAWN("unix cmnd") - execute a Unix system command and return strings
+	INTEGER		p_spawn_arg_start, p_spawn_num_args
+	PARAMETER     ( p_spawn_arg_start = p_samplen_arg_start +
+     .					    p_samplen_num_args,
+     .			p_spawn_num_args  = 1 )
+	DATA gfcn_name         (p_spawn) /'SPAWN'/
+	DATA gfcn_version      (p_spawn) / 1.0 /
+	DATA gfcn_descr        (p_spawn) / 'execute a system command' /
+	DATA gfcn_rtn_type     (p_spawn) /pfcn_rtn_string /
+	DATA gfcn_num_reqd_args(p_spawn) /p_spawn_num_args/
+	DATA gfcn_has_vari_args(p_spawn) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_spawn),i=1,nferdims)/
+     .						pgc_axis_is_abstract,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal,
+     .						pgc_axis_is_normal/
+	DATA (gfcn_piecemeal_ok(i,p_spawn),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_spawn) /p_spawn_arg_start/
+
+* ... description of arguments
+	DATA gfcn_arg_name(p_spawn_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_spawn_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_spawn_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_spawn_arg_start+0)/'Unix command string'/
+	DATA (gfcn_arg_extend_lo (i,p_spawn_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_spawn_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_spawn_arg_start+0),i=1,nferdims)
+     .    / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+
+* STRCMP(string1, string2) - compare 2 string *arrays* as in C function
+	INTEGER		p_strcmp_arg_start, p_strcmp_num_args
+	PARAMETER     ( p_strcmp_arg_start = p_spawn_arg_start +
+     .					    p_spawn_num_args,
+     .			p_strcmp_num_args  = 2 )
+	DATA gfcn_name         (p_strcmp) /'STRCMP'/
+	DATA gfcn_version      (p_strcmp) / 1.0 /
+	DATA gfcn_descr        (p_strcmp) /
+     .	'compare strings: +, 0, or - for str1 >, =, or < str2 rspctvly' /
+	DATA gfcn_rtn_type     (p_strcmp) /pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_strcmp) /p_strcmp_num_args/
+	DATA gfcn_has_vari_args(p_strcmp) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strcmp),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strcmp),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strcmp) /p_strcmp_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strcmp_arg_start+0)/'STR1'/
+	DATA gfcn_arg_type(p_strcmp_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strcmp_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strcmp_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strcmp_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strcmp_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strcmp_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+* ... description of argument 2
+	DATA gfcn_arg_name(p_strcmp_arg_start+1)/'STR2'/
+	DATA gfcn_arg_type(p_strcmp_arg_start+1)/parg_type_string/
+	DATA gfcn_arg_units(p_strcmp_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_strcmp_arg_start+1)/'string array 2'/
+	DATA (gfcn_arg_extend_lo (i,p_strcmp_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strcmp_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_strcmp_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* STRLEN(string1) - return the length of the string
+	INTEGER		p_strlen_arg_start, p_strlen_num_args
+	PARAMETER     ( p_strlen_arg_start = p_strcmp_arg_start +
+     .					    p_strcmp_num_args,
+     .			p_strlen_num_args  = 1 )
+	DATA gfcn_name         (p_strlen) /'STRLEN'/
+	DATA gfcn_version      (p_strlen) / 1.0 /
+	DATA gfcn_descr        (p_strlen) /
+     .	'determine string length' /
+	DATA gfcn_rtn_type     (p_strlen) /pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_strlen) /p_strlen_num_args/
+	DATA gfcn_has_vari_args(p_strlen) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strlen),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strlen),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strlen) /p_strlen_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strlen_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_strlen_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strlen_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strlen_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strlen_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strlen_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strlen_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* UPCASE(string1) - return string in all upper case
+	INTEGER		p_upcase_arg_start, p_upcase_num_args
+	PARAMETER     ( p_upcase_arg_start = p_strlen_arg_start +
+     .					    p_strlen_num_args,
+     .			p_upcase_num_args  = 1 )
+	DATA gfcn_name         (p_upcase) /'UPCASE'/
+	DATA gfcn_version      (p_upcase) / 1.0 /
+	DATA gfcn_descr        (p_upcase) /
+     .	'upper case entire string' /
+	DATA gfcn_rtn_type     (p_upcase) /pfcn_rtn_string /
+	DATA gfcn_num_reqd_args(p_upcase) /p_upcase_num_args/
+	DATA gfcn_has_vari_args(p_upcase) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_upcase),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_upcase),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_upcase) /p_upcase_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_upcase_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_upcase_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_upcase_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_upcase_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_upcase_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_upcase_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_upcase_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+
+* STRINDEX(string1, substring) - find start char position of substring
+	INTEGER		p_strindex_arg_start, p_strindex_num_args
+	PARAMETER     ( p_strindex_arg_start = p_upcase_arg_start +
+     .					    p_upcase_num_args,
+     .			p_strindex_num_args  = 2 )
+	DATA gfcn_name         (p_strindex) /'STRINDEX'/
+	DATA gfcn_version      (p_strindex) / 1.0 /
+	DATA gfcn_descr        (p_strindex) /
+     .	'Return start character position of substring in string' /
+	DATA gfcn_rtn_type     (p_strindex) /pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_strindex) /p_strindex_num_args/
+	DATA gfcn_has_vari_args(p_strindex) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strindex),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strindex),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strindex) /p_strindex_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strindex_arg_start+0)/'STR1'/
+	DATA gfcn_arg_type(p_strindex_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strindex_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strindex_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strindex_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strindex_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strindex_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+* ... description of argument 2
+	DATA gfcn_arg_name(p_strindex_arg_start+1)/'SUBSTR'/
+	DATA gfcn_arg_type(p_strindex_arg_start+1)/parg_type_string/
+	DATA gfcn_arg_units(p_strindex_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_strindex_arg_start+1)/'string array 2'/
+	DATA (gfcn_arg_extend_lo (i,p_strindex_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strindex_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_strindex_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+
+* STRRINDEX(string1, substring) - find last char position of substring
+	INTEGER		p_strrindex_arg_start, p_strrindex_num_args
+	PARAMETER     ( p_strrindex_arg_start = p_strindex_arg_start +
+     .					    p_strindex_num_args,
+     .			p_strrindex_num_args  = 2 )
+	DATA gfcn_name         (p_strrindex) /'STRRINDEX'/
+	DATA gfcn_version      (p_strrindex) / 1.0 /
+	DATA gfcn_descr        (p_strrindex) /
+     .	'Return last character position of substring in string' /
+	DATA gfcn_rtn_type     (p_strrindex) /pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_strrindex) /p_strrindex_num_args/
+	DATA gfcn_has_vari_args(p_strrindex) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strrindex),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strrindex),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strrindex) /p_strrindex_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strrindex_arg_start+0)/'STR1'/
+	DATA gfcn_arg_type(p_strrindex_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strrindex_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strrindex_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strrindex_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strrindex_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strrindex_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+* ... description of argument 2
+	DATA gfcn_arg_name(p_strrindex_arg_start+1)/'SUBSTR'/
+	DATA gfcn_arg_type(p_strrindex_arg_start+1)/parg_type_string/
+	DATA gfcn_arg_units(p_strrindex_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_strrindex_arg_start+1)/'string array 2'/
+	DATA (gfcn_arg_extend_lo (i,p_strrindex_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strrindex_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_strrindex_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+
+* DNCASE(string1) - return string in all lower case
+	INTEGER		p_dncase_arg_start, p_dncase_num_args
+	PARAMETER     ( p_dncase_arg_start = p_strrindex_arg_start +
+     .					    p_strrindex_num_args,
+     .			p_dncase_num_args  = 1 )
+	DATA gfcn_name         (p_dncase) /'DNCASE'/
+	DATA gfcn_version      (p_dncase) / 1.0 /
+	DATA gfcn_descr        (p_dncase) /
+     .	'make entire string lower case' /
+	DATA gfcn_rtn_type     (p_dncase) /pfcn_rtn_string /
+	DATA gfcn_num_reqd_args(p_dncase) /p_dncase_num_args/
+	DATA gfcn_has_vari_args(p_dncase) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_dncase),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_dncase),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_dncase) /p_dncase_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_dncase_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_dncase_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_dncase_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_dncase_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_dncase_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_dncase_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_dncase_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* STRCAT(string1, string2) - concatenate 2 string *arrays* as in C function
+	INTEGER		p_strcat_arg_start, p_strcat_num_args
+	PARAMETER     ( p_strcat_arg_start = p_dncase_arg_start +
+     .					    p_dncase_num_args,
+     .			p_strcat_num_args  = 2 )
+	DATA gfcn_name         (p_strcat) /'STRCAT'/
+	DATA gfcn_version      (p_strcat) / 1.0 /
+	DATA gfcn_descr        (p_strcat) /
+     .	'concatenate two strings' /
+	DATA gfcn_rtn_type     (p_strcat) /pfcn_rtn_string /
+	DATA gfcn_num_reqd_args(p_strcat) /p_strcat_num_args/
+	DATA gfcn_has_vari_args(p_strcat) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strcat),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strcat),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strcat) /p_strcat_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strcat_arg_start+0)/'STR1'/
+	DATA gfcn_arg_type(p_strcat_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strcat_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strcat_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strcat_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strcat_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strcat_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+* ... description of argument 2
+	DATA gfcn_arg_name(p_strcat_arg_start+1)/'STR2'/
+	DATA gfcn_arg_type(p_strcat_arg_start+1)/parg_type_string/
+	DATA gfcn_arg_units(p_strcat_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_strcat_arg_start+1)/'string array 2'/
+	DATA (gfcn_arg_extend_lo (i,p_strcat_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strcat_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_strcat_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+
+* SUBSTR(string1, offset, length) - clips a substring from a string
+	INTEGER		p_substring_arg_start, p_substring_num_args
+	PARAMETER     ( p_substring_arg_start = p_strcat_arg_start +
+     .					    p_strcat_num_args,
+     .			p_substring_num_args  = 3 )
+	DATA gfcn_name         (p_substring) /'SUBSTRING'/
+	DATA gfcn_version      (p_substring) / 1.0 /
+	DATA gfcn_descr        (p_substring) /
+     .	         'Return a substring ' /
+	DATA gfcn_rtn_type     (p_substring) /pfcn_rtn_string /
+	DATA gfcn_num_reqd_args(p_substring) /p_substring_num_args/
+	DATA gfcn_has_vari_args(p_substring) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_substring),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_substring),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_substring) /p_substring_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_substring_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_substring_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_substring_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_substring_arg_start+0)/'string array'/
+	DATA (gfcn_arg_extend_lo (i,p_substring_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_substring_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_substring_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+* ... description of argument 2
+	DATA gfcn_arg_name(p_substring_arg_start+1)/'OFFSET'/
+	DATA gfcn_arg_type(p_substring_arg_start+1)/parg_type_float/
+	DATA gfcn_arg_units(p_substring_arg_start+1)/' '/
+	DATA gfcn_arg_descr(p_substring_arg_start+1)/'start position'/
+	DATA (gfcn_arg_extend_lo (i,p_substring_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_substring_arg_start+1),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 2 ?
+	DATA (gfcn_axis_implied_from(i, p_substring_arg_start+1),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* ... description of argument 3
+	DATA gfcn_arg_name(p_substring_arg_start+2)/'LENGTH'/
+	DATA gfcn_arg_type(p_substring_arg_start+2)/parg_type_float/
+	DATA gfcn_arg_units(p_substring_arg_start+2)/' '/
+	DATA gfcn_arg_descr(p_substring_arg_start+2)/'number of chars'/
+	DATA (gfcn_arg_extend_lo (i,p_substring_arg_start+2),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_substring_arg_start+2),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 3 ?
+	DATA (gfcn_axis_implied_from(i, p_substring_arg_start+2),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+* STRFLOAT(string1) - return float value of given string
+	INTEGER		p_strfloat_arg_start, p_strfloat_num_args
+	PARAMETER     ( p_strfloat_arg_start = p_substring_arg_start +
+     .					    p_substring_num_args,
+     .			p_strfloat_num_args  = 1 )
+	DATA gfcn_name         (p_strfloat) /'STRFLOAT'/
+	DATA gfcn_version      (p_strfloat) / 1.0 /
+	DATA gfcn_descr        (p_strfloat) /
+     .	'Return float value from character string' /
+	DATA gfcn_rtn_type     (p_strfloat) /pfcn_rtn_float /
+	DATA gfcn_num_reqd_args(p_strfloat) /p_strfloat_num_args/
+	DATA gfcn_has_vari_args(p_strfloat) /.FALSE./
+	DATA (gfcn_axis_will_be(i,p_strfloat),i=1,nferdims)/
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args,
+     .					pgc_axis_implied_by_args/
+	DATA (gfcn_piecemeal_ok(i,p_strfloat),i=1,nferdims)
+     .      / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
+	DATA gfcn_arg_ptr(p_strfloat) /p_strfloat_arg_start/
+
+* ... description of argument 1
+	DATA gfcn_arg_name(p_strfloat_arg_start+0)/'STR'/
+	DATA gfcn_arg_type(p_strfloat_arg_start+0)/parg_type_string/
+	DATA gfcn_arg_units(p_strfloat_arg_start+0)/' '/
+	DATA gfcn_arg_descr(p_strfloat_arg_start+0)/'string array 1'/
+	DATA (gfcn_arg_extend_lo (i,p_strfloat_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+	DATA (gfcn_arg_extend_hi (i,p_strfloat_arg_start+0),i=1,nferdims)
+     .    / 0, 0, 0, 0, 0, 0 /
+* ... merge the axes implied by argument 1 ?
+	DATA (gfcn_axis_implied_from(i, p_strfloat_arg_start+0),i=1,nferdims)
+     .    / .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE. /
+
+
+
+
+
+* internal parameters helpful for initialization
+	DATA gfcn_num_internal/p_strfloat/
+
+* template for next function ...
+	INTEGER		p_next, p_next_arg_start, p_next_num_args 
+	PARAMETER     ( p_next = p_strfloat + 1,
+     .			p_next_arg_start = p_strfloat_arg_start +
+     .					   p_strfloat_num_args,
+     .			p_next_num_args  = 1 )
+
+	END
+
diff --git a/fer/dat/xgui_data.F b/fer/dat/xgui_data.F
new file mode 100644
index 0000000..ebe9b78
--- /dev/null
+++ b/fer/dat/xgui_data.F
@@ -0,0 +1,58 @@
+	BLOCK DATA XGUI_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* variables needed for GUI interactions
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300:  6/93
+
+        IMPLICIT NONE
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xgui.cmn'
+
+	DATA pipe_open / .FALSE. /
+	DATA gui_status	/ ferr_ok /
+	DATA gui_fmt1 / '(I3, 1X, A4, 1x, A)' /
+	DATA gui_char / '^' /    ! lead in for GUI-only commands
+
+* in order to report newly created windows to the GUI:
+	DATA gui_window_reported / max_gui_windows*.FALSE. /
+
+	END
diff --git a/fer/dat/xonedim_data.F b/fer/dat/xonedim_data.F
new file mode 100644
index 0000000..bc5ae47
--- /dev/null
+++ b/fer/dat/xonedim_data.F
@@ -0,0 +1,53 @@
+	BLOCK DATA XONEDIM_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* variable declarations for COMMON/ XONEDIM /
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/17/86
+
+        IMPLICIT NONE
+	include 'gfdl.parm'
+	include 'xonedim.cmn'
+
+* lines stolen from Pacanowski's SUBROUTINE GRIDS
+      DATA DZ/10*10.E2,12.5E2,15.E2,17.5E2,20.E2,25.E2,30.E2,40.E2,
+     * 57.E2,91.E2,151.E2,242.E2,357.E2,475.E2,566.E2,3*650.E2/
+
+	END
diff --git a/fer/dat/xplot_setup_data.F b/fer/dat/xplot_setup_data.F
new file mode 100644
index 0000000..4bb973f
--- /dev/null
+++ b/fer/dat/xplot_setup_data.F
@@ -0,0 +1,63 @@
+        BLOCK DATA XPLOT_SETUP_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization of COMMON / XPLOT_SETUP /
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.1 - 9/12/88 - reduced number of defined colors to 10
+* V200: 12/21/89
+* V540: *sh* 9/01 - added xwhitelo, ywhitelo, ...
+* V63  *acm* 10/09 Changes for gfortran build
+*      *kms*  2/12 Include tmap_dims.parm for nferdims needed by xplot_setup.cmn
+* PyFr *kms*  7/13 Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin to plot_setup.parm,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale or testscale.
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'ferret.parm'
+        include 'xplot_setup.cmn'
+
+        DATA
+     .     saved_ppl_yax / .FALSE. /,
+     .     animate       / .FALSE. /,
+     .     first_frame   / .TRUE. /
+
+        END
diff --git a/fer/dat/xplot_state_data.F b/fer/dat/xplot_state_data.F
new file mode 100644
index 0000000..c36cebb
--- /dev/null
+++ b/fer/dat/xplot_state_data.F
@@ -0,0 +1,164 @@
+	BLOCK DATA XPLOT_STATE_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization for plotted output state variables
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/4/86
+* revision 1.0 - 6/28/88 - major re-write for multiple windows
+* revision 1.1 - 8/26/88 - added multiple viewports and consolidated window
+*			   sizing
+* revision 1.2 - 1/24/89 - added ppl_interrupted
+* V200: 10/29/89 - "FULL" viewport is just like others.  Default is NONE
+* V230:  11/4/92 - 4 corner viewports (ll,lr,ul,ur) with clipping ON
+* V301:  22/2/94 - changed wn_scale(1) from 1.0 to 0.7
+* V500: 6/99 *sh* - added saved time axis information
+* V540: 9/01 *sh* - added vp_by_axis
+* V63  *acm* 10/09 Changes for gfortran build
+* V54+: *acm*5/08 - added transparent (from xplot_setup)
+
+        IMPLICIT NONE
+	include	'ferret.parm'
+	include	'xplot_state.cmn'
+
+	INTEGER i
+
+* local parameter declarations:
+	INTEGER		mvp_maxm9
+	PARAMETER     ( mvp_maxm9 = max_viewport - 9 )
+
+	DATA	pplus_started	/ .FALSE. /
+	DATA	ppl_interrupted / .FALSE. /
+
+	DATA curr_seg_name / 0 /	! to be incremented for each new sgmt
+        
+        DATA no_plot_yet/.TRUE./
+
+	DATA	wn_open	  / max_windows * .FALSE. /
+	DATA	wn_active / max_windows * .FALSE. /
+
+* various pre-programmed viewport choices
+	DATA	vp_num / mvp_dflt /
+
+	DATA	vp_name ( mvp_dflt ) / 'NONE' /,	! whole window
+     .		vp_size ( mvp_dflt ) / 1.0 /,
+     .		vp_xorg ( mvp_dflt ) / 0.0 /,
+     .		vp_yorg ( mvp_dflt ) / 0.0 /,
+     .		vp_xclip( mvp_dflt ) / unspecified_val4 /,
+     .		vp_yclip( mvp_dflt ) / unspecified_val4 /,
+     .		vp_by_axis(mvp_dflt) / .FALSE. /
+
+	DATA	vp_name ( 1 ) / 'UPPER' /,	! upper half
+     .		vp_size ( 1 ) / 1.0 /,
+     .		vp_xorg ( 1 ) / 0.0 /,
+     .		vp_yorg ( 1 ) / 0.5 /,
+     .		vp_xclip( 1 ) / 1.0 /,
+     .		vp_yclip( 1 ) / 1.0 /,
+     .		vp_by_axis(1) / .FALSE. /
+
+	DATA	vp_name ( 2 ) / 'LOWER' /,	! lower half
+     .		vp_size ( 2 ) / 1.0 /,
+     .		vp_xorg ( 2 ) / 0.0 /,
+     .		vp_yorg ( 2 ) / 0.0 /,
+     .		vp_xclip( 2 ) / 1.0 /,
+     .		vp_yclip( 2 ) / 0.5 /,
+     .		vp_by_axis(2) / .FALSE. /
+
+	DATA	vp_name ( 3 ) / 'RIGHT' /,	! right half
+     .		vp_size ( 3 ) / 1.0 /,
+     .		vp_xorg ( 3 ) / 0.5 /,
+     .		vp_yorg ( 3 ) / 0.0 /,
+     .		vp_xclip( 3 ) / 1.0 /,
+     .		vp_yclip( 3 ) / 1.0 /,
+     .		vp_by_axis(3) / .FALSE. /
+
+	DATA	vp_name ( 4 ) / 'LEFT' /,	! left half
+     .		vp_size ( 4 ) / 1.0 /,
+     .		vp_xorg ( 4 ) / 0.0 /,
+     .		vp_yorg ( 4 ) / 0.0 /,
+     .		vp_xclip( 4 ) / 0.5 /,
+     .		vp_yclip( 4 ) / 1.0 /,
+     .		vp_by_axis(4) / .FALSE. /
+
+	DATA	vp_name ( 5 ) / 'LL' /,	! Lower Left
+     .		vp_size ( 5 ) / 0.5 /,
+     .		vp_xorg ( 5 ) / 0.0 /,
+     .		vp_yorg ( 5 ) / 0.0 /,
+     .		vp_xclip( 5 ) / 0.5 /,
+     .		vp_yclip( 5 ) / 0.5 /,
+     .		vp_by_axis(5) / .FALSE. /
+
+	DATA	vp_name ( 6 ) / 'LR' /,	! Lower Right
+     .		vp_size ( 6 ) / 0.5 /,
+     .		vp_xorg ( 6 ) / 0.5 /,
+     .		vp_yorg ( 6 ) / 0.0 /,
+     .		vp_xclip( 6 ) / 1.0 /,
+     .		vp_yclip( 6 ) / 0.5 /,
+     .		vp_by_axis(6) / .FALSE. /
+
+	DATA	vp_name ( 7 ) / 'UL' /,	! Upper Left
+     .		vp_size ( 7 ) / 0.5 /,
+     .		vp_xorg ( 7 ) / 0.0 /,
+     .		vp_yorg ( 7 ) / 0.5 /,
+     .		vp_xclip( 7 ) / 0.5 /,
+     .		vp_yclip( 7 ) / 1.0 /,
+     .		vp_by_axis(7) / .FALSE. /
+
+	DATA	vp_name ( 8 ) / 'UR' /,	! Upper Right
+     .		vp_size ( 8 ) / 0.5 /,
+     .		vp_xorg ( 8 ) / 0.5 /,
+     .		vp_yorg ( 8 ) / 0.5 /,
+     .		vp_xclip( 8 ) / 1.0 /,
+     .		vp_yclip( 8 ) / 1.0 /,
+     .		vp_by_axis(8) / .FALSE. /
+
+	DATA	vp_name ( 9 ) / 'FULL' /,	! FULL window
+     .		vp_size ( 9 ) / 1.0 /,
+     .		vp_xorg ( 9 ) / 0.0 /,
+     .		vp_yorg ( 9 ) / 0.0 /,
+     .		vp_xclip( 9 ) / 1.0 /,
+     .		vp_yclip( 9 ) / 1.0 /,
+     .		vp_by_axis(9) / .FALSE. /
+
+	DATA	(vp_name(i),i=10,max_viewport) /mvp_maxm9*unspecified_name4/
+
+	DATA has_time_axis/.FALSE./
+
+	DATA transparent	/ 0 /
+
+	END
diff --git a/fer/dat/xprog_state_data.F b/fer/dat/xprog_state_data.F
new file mode 100644
index 0000000..64c069d
--- /dev/null
+++ b/fer/dat/xprog_state_data.F
@@ -0,0 +1,379 @@
+	BLOCK DATA XPROG_STATE_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*
+* variable declarations for COMMON/ XPROG_STATE /
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/26/86
+* revision 0.1 - 3/18/87 - new TMAP library:
+*			   eliminated TMAP_DIMS.PARM and data_set_open
+* revision 0.2 - 5/1/87  - added FRAME and LIST output files
+* revision 0.3 - 5/19/87 - added mode_ignore_err, mode_stupid and 
+*			   err_lun = ttout_lun to take
+*			   advantage of 255 byte RECLEN in ttout_lun OPEN
+* revision 0.4 - 8/26/87 - added mode_calendar for date/time format time output
+*			   and variables for unformatted listing
+* revision 0.4 - 10/5/87 - revised list_ options and added mode_gaps_ok
+* revision 0.5 - 2/25/88 - added mode_geographical
+* revision 0.6 - 3/7/88  - added list_TMAP
+* revision 0.7 - 3/23/88 - calendar and geog modes --> long,lat,depth,time
+*			   added font_ASCII
+* revision 0.8 - 4/15/88 - added mode_state_last
+* revision 0.9 - 6/22/88 - GFDL.MGM --> FERRET.MGM
+* revision 1.0 -  7/1/88 - added logical interactive and mode segment
+* revision 1.1 -  8/2/88 - added mode wait (wait after plots  - for terminals)
+* revision 1.2 - 8/11/88 - changed default MODE VERIFY to CANCEL
+* revision 1.3 -  1/9/89 - added MODE SCREEN (how to handle missing data)
+* revision 1.4 -  2/2/89 - eliminated MODE GAPS_OK (for new TM library)
+*			 - added MODE JOURNAL
+*			 - changed MODE SCREEN to MODE REJECT
+* revision 1.5 - 4/24/89 - MODE INTERPOLATE defaults to "FALSE" to minimize
+*			   encountering its bugs !!!
+* V200:   6/8/89 - added mode_desperate
+*	11/29/89 - added mode_rpn
+*	 12/8/89 - added mode_GKS, saved_dset, saved_abstract_grid
+*	12/20/89 - added mode_xwindows
+*	  1/3/89 - added mode_metafile
+* Unix/RISC port - 2/91 - changes to logical unit numbers: standard err and out
+*                - 10/91 - mode verify to default to true
+* V230:  5/14/92 - replaced mode REMOTE_X with mode REFRESH
+*         6/9/92 - replaced list_* logicals with list_fmt_type
+*        11/9/92 - eliminated arguments from MODES GKS and META
+*        1/14/93 - meta_device --> frame_compress
+* V300:   2/3/93 - added argument FULL to MODE VERIFY
+* V300:  5/12/93 - added mode ppllist and journal_file
+*	 6/16/93 - added mode GUI
+*	25/10/93 - default state for mode refresh set to TRUE
+* V301: 26/ 1/94 - larger MODE DESPERATE argument to reflect larger memory
+*	 2/24/94 - incorporated a stack of past SET MODE states
+*	 3/14/94 - set default state of mode refresh (xwindows) to .FALSE.
+* V310:  11/4/94 - eliminated MODE REJECT (never implemented)
+* V400:  7/10/94 - added list_format for LIST/HEADING=enhanced
+*
+*        6/15/95 -*kob* added ifdef for STDERR_UNIT_SEVEN because stderr on
+*                  HP machines was 7 instead of 0
+* V420:	 4/28/96 - added initialization for IF-stack (ifstk)
+* V450:	 11/19/96 - eliminated MODE POLISH
+* V510 5/00 *sh* - added denig_x/ylim_msg_done
+* V540 11/01 *sh* - initialize last_cmnd_buff
+* V550:12/02 *acm*- new MODE LOGO and MODE LABELS
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+* v580 10/04 *acm* - add flag silent_err for SHOW VAR/XML This is set for  
+*                    SHOW VAR/XML when checking for user variables not  
+*                    relevant to the context
+* V600: *acm* 5/06 - add new MODE LINECOLORS:[arg],Flag no_plot_yet
+* V600  *acm* 6/06 - add new MODE UPCASE_OUTPUT
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V614  *acm* 10/08 - add new MODE NODATA_LAB
+* V6.2  *acm*  5/09 - new default number levels is 30 pmode_nlevels
+*                If this is changed, also change it in ppl/plot/ppldata.F
+* V6.7  *kms* 8/11 - moved one_cmnd_mode here since needed outside ferret_dispatch.F
+*       *kms*  2/12 Add pmode_ensemble_lab, pmode_forecast_lab,
+*                   mode_ensemble_lab, and mode_forecast_lab;
+*                   include tmap_dims.parm for nferdims needed by xprog_state.cmn
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+*       *acm* 4/12 Remove MODE FOURDEE, using _E, _F, _M, _N instead, throughout.
+* V6.8  acm  6/12 Instead of mode_ensemble_lab, mode_forecast_lab, use mode_6d_lab, 
+*                 which will be on by default. If canceled, the various SHOW and 
+*                 LIST commands, etc, will not list info for E,F dimensions.
+* V683  *acm* 8/12 - add new MODE SHRINK_YLAB
+* V683  *acm* 8/12 - frame file FERRET.MGM  > ferret.gif
+* PyFr  *kms* 8/12 - frame file ferret.gif -> ferret.png
+* V685  *sh* 11/13 - added allowed_err for SH VAR/TREE
+* V690  *sh* 12/13 - added mode_curvilinear, mode_sigma
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'movies.parm'
+	include 'xprog_state.cmn'
+
+* internal variable declarations:
+	INTEGER	i
+
+* for getting commands
+	DATA	prompt		/'yes? '/,
+     .		prompt_len	/ 5 	/
+
+	DATA	input_source	/ input_from_tty /,
+     .		mouse_input 	/.FALSE./,
+     .          one_cmnd_mode   /.FALSE./
+
+	DATA	last_cmnd_buff/' '/,
+     .		len_last_cmnd/1/
+
+* I/O logical unit numbers
+	DATA	ttin_lun	/ 5	/,	! Unix standard input
+     .		ttout_lun	/ 6	/,	! Unix standard output
+     .		list_lun	/ 6	/,	! same as ttout to start
+     .		jrnl_lun	/ 20	/,
+#ifdef STDERR_UNIT_SEVEN
+     .		err_lun		/ 7	/,	! HP Unix standard error
+#else
+     .		err_lun		/ 0	/,	! Unix standard error
+#endif
+     .		cmnd_lun	/ 21	/
+
+* for SET REDIRECT
+        DATA    redirect_stdout_flags  / redirect_none /,
+     .          redirect_stderr_flags  / redirect_none /
+
+* for SET MODE
+	DATA	(mode_state( pmode_diagnostic  ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_verify      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,   ! 10/91
+     .		(mode_state( pmode_interpolate ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_ignore_err  ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_stupid      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_journal     ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_long_lab    ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_lat_lab     ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_depth_lab   ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_time_lab    ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_6d_lab      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /
+	DATA	(mode_state( pmode_font_ascii  ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_segment     ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.    /,
+     .		(mode_state( pmode_wait        ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_reject      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_desperate   ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_rpn         ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_GKS         ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,	! irrelevant
+     .		(mode_state( pmode_xwindows    ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /
+	DATA	(mode_state( pmode_metafile    ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_ppllist     ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_gui        ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_logo        ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_labels      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_grat      ,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /,
+     .		(mode_state( pmode_linecolors,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_upcase_output,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_nlevels,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_nodata_lab,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.TRUE.   /,
+     .		(mode_state( pmode_shrink_ylab,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /
+     .		(mode_state( pmode_curvilinear,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /
+     .		(mode_state( pmode_sigma,i), i=1,mode_stack_size)
+     .					/ mode_stack_size*.FALSE.   /
+
+	DATA	mode_name ( pmode_diagnostic  )	/ 'DIAGNOSTIC  ' /,
+     .		mode_name ( pmode_verify      )	/ 'VERIFY      ' /,
+     .		mode_name ( pmode_interpolate )	/ 'INTERPOLATE ' /,
+     .		mode_name ( pmode_ignore_err  )	/ 'IGNORE_ERROR' /,
+     .		mode_name ( pmode_stupid      )	/ 'STUPID'	 /,
+     .		mode_name ( pmode_journal     )	/ 'JOURNAL'	 /,
+     .		mode_name ( pmode_long_lab    )	/ 'LONG_LABEL'   /,
+     .		mode_name ( pmode_lat_lab     )	/ 'LATIT_LABEL'  /,
+     .		mode_name ( pmode_depth_lab   )	/ 'DEPTH_LABEL'  /,
+     .		mode_name ( pmode_time_lab    )	/ 'CALENDAR'     /,
+     .		mode_name ( pmode_6d_lab)	/ '6D_LAB'       /,
+     .		mode_name ( pmode_font_ascii  )	/ 'ASCII_FONT'   /,
+     .		mode_name ( pmode_segment     )	/ 'SEGMENT'      /,
+     .		mode_name ( pmode_wait        )	/ 'WAIT'         /,
+     .		mode_name ( pmode_reject      )	/ pmode_unused   /,
+     .		mode_name ( pmode_desperate   )	/ 'DESPERATE'    /,
+     .		mode_name ( pmode_rpn         )	/ pmode_unused /,
+     .		mode_name ( pmode_gks         )	/ 'GKS'          /,
+     .		mode_name ( pmode_xwindows    )	/ 'REFRESH'      /,
+     .		mode_name ( pmode_metafile    )	/ 'METAFILE'     /,
+     .		mode_name ( pmode_ppllist     )	/ 'PPLLIST'      /,
+     .		mode_name ( pmode_gui         )	/ 'GUI'          /,
+     .		mode_name ( pmode_logo        )	/ 'LOGO'         /,
+     .		mode_name ( pmode_labels      )	/ 'LABELS'       /,
+     .		mode_name ( pmode_grat        )	/ 'GRATICULE'    /,
+     .		mode_name ( pmode_linecolors  )	/ 'LINECOLORS'   /,
+     .		mode_name ( pmode_upcase_output)/ 'UPCASE_OUTPUT'/,
+     .		mode_name ( pmode_nlevels     ) / 'NLEVELS'      /,
+     .		mode_name ( pmode_nodata_lab  ) / 'NODATA_LAB'   /,
+     .		mode_name ( pmode_shrink_ylab ) / 'SHRINK_YLAB'  /,
+     .		mode_name ( pmode_curvilinear ) / 'CURVILINEAR'  /,
+     .		mode_name ( pmode_sigma       ) / 'SIGMA'        /,
+     .		mode_name ( 33     ) / pmode_unused /,
+     .		mode_name ( 34     ) / pmode_unused /,
+     .		mode_name ( 35     ) / pmode_unused /,
+     .		mode_name ( 36     ) / pmode_unused /,
+     .		mode_name ( 37     ) / pmode_unused /,
+     .		mode_name ( 38     ) / pmode_unused /,
+     .		mode_name ( 39     ) / pmode_unused /,
+     .		mode_name ( 40     ) / pmode_unused /
+
+	DATA	(mode_arg  ( pmode_diagnostic  ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*99 /,
+     .		(mode_arg  ( pmode_verify      ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*1 /,
+     .		(mode_arg  ( pmode_interpolate ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_ignore_err  ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_stupid      ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_journal     ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_long_lab    ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size* 1 /, ! 1 decimal place
+     .		(mode_arg  ( pmode_lat_lab     ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size* 1 /, ! 1 decimal place
+     .		(mode_arg  ( pmode_depth_lab   ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*-4 /, ! 4 sig. digs. less 0's
+     .		(mode_arg  ( pmode_time_lab    ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*-5 /, ! dd-mmm-yyyy:hh:mm
+     .		(mode_arg  ( pmode_6d_lab     ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 / 
+	DATA	(mode_arg  ( pmode_font_ascii  ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_segment     ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_wait        ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_reject      ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_desperate   ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*320000 /,
+     .		(mode_arg  ( pmode_rpn         ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_gks         ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_xwindows    ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_metafile    ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_ppllist     ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /
+	DATA	(mode_arg  ( pmode_gui        ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_logo        ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_labels      ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_grat      ,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_linecolors,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*6 /,
+     .		(mode_arg  ( pmode_upcase_output,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_nlevels,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*30 /,
+     .		(mode_arg  ( pmode_nodata_lab,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /,
+     .		(mode_arg  ( pmode_shrink_ylab,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /
+     .		(mode_arg  ( pmode_curvilinear,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /
+     .		(mode_arg  ( pmode_sigma,i), i=1,mode_stack_size)
+     .				/ mode_stack_size*unspecified_int4 /
+
+* If the value of nlevels is changed, also change NLEV in plot/ppldata.F
+
+
+* for MODE WAIT
+	DATA	ppl_wait / 'NOWAIT' /
+
+* for LIST
+	DATA	list_format_given / .FALSE. /
+	DATA	list_format	  / '(5(1PG12.5))' /
+!	DATA	list_redirected	  / .FALSE. /   ! unused
+!	DATA	list_dsf	  / .FALSE. /	! equiv to list_fmt_type
+!	DATA	list_TMAP	  / .FALSE. /	! unused
+!	DATA	list_unformatted  / .FALSE. /   ! unused
+	DATA	list_fmt_type     / plist_default /
+	DATA	list_append	  / .FALSE. /
+	DATA	list_heading	  / .TRUE.  /
+	DATA	list_file	  / 'AUTO'	 /
+	DATA	list_outtype	  / 'DFLT'	 /
+	DATA	list_digits	  / default_output_precision /
+
+* for FRAME
+	DATA	frame_file	  / 'ferret.png' /
+        DATA    frame_compress    / 'RLE' /  ! matching pframe_hdf_runlen
+
+* other filenames
+	DATA	journal_file	  / 'ferret.jnl'  /
+	DATA	ppllist_file	  / 'ppllist.out' /
+
+* stack pointer for nested IF statements
+	DATA	ifstk		 / 0 /
+     .		if_conditional	 / .FALSE. /
+
+* for issuing messages about the denigrated status of qualifiers
+	DATA	denig_xylim_msg_done / .FALSE. /
+	DATA	denig_pen_msg_done / .FALSE. /
+
+* auto sigma and curvilinear states
+	DATA	mode_auto_curvi      /.FALSE./,
+     .		mode_auto_curvi_last /.FALSE./,
+     .		mode_auto_sigma      /.FALSE./,
+     .		mode_auto_sigma_last /.FALSE./
+
+* miscellaneous
+	DATA	saved_dset		/ unspecified_int4 /
+	DATA	saved_abstract_grid	/ unspecified_int4 /
+	DATA	xwind_node		/ ' ' /
+	DATA	mode_grat_buff		/ ' ' /
+        DATA    silent_err              / .FALSE. /  ! will set true for SHOW VAR/XML
+        DATA    allowed_err             / .FALSE. /  ! briefly set true in SHOW VAR/TREE
+        DATA    grat_on                 / .FALSE. /
+        DATA    num_linecolors          / 6 /
+
+	END
diff --git a/fer/dat/xpyvar_info_data.F b/fer/dat/xpyvar_info_data.F
new file mode 100644
index 0000000..83e20f3
--- /dev/null
+++ b/fer/dat/xpyvar_info_data.F
@@ -0,0 +1,63 @@
+      BLOCK DATA XPYVAR_INFO_DATA
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administrations (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize variables given in COMMON/XPYVAR_INFO
+*
+
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xpyvar_info.cmn'
+
+      INTEGER     max6pyvars
+      PARAMETER ( max6pyvars = 6 * maxpyvars )
+
+* tmap_dset.parm contains C-preprocessor flags
+#include "tmap_dset.parm"
+
+      DATA pyvar_code_head    / 0 /
+      DATA pyvar_ndarray_obj  / maxpyvars * 0 /
+      DATA pyvar_code         / maxpyvars * char_init128 /
+      DATA pyvar_title        / maxpyvars * char_init128 /
+      DATA pyvar_units        / maxpyvars * char_init64 /
+      DATA pyvar_missing_flag / maxpyvars * real4_init /
+      DATA pyvar_dset_number  / maxpyvars * int4_init /
+      DATA pyvar_grid_number  / maxpyvars * int4_init /
+      DATA pyvar_grid_start   / max6pyvars * int4_init /
+      DATA pyvar_grid_end     / max6pyvars * int4_init /
+
+      END
+
diff --git a/fer/dat/xrevision_data.F b/fer/dat/xrevision_data.F
new file mode 100644
index 0000000..48ba1eb
--- /dev/null
+++ b/fer/dat/xrevision_data.F
@@ -0,0 +1,120 @@
+	BLOCK DATA XREVISION_DATA
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* pre-defined program revision and name
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V314 - 9/14/94 (extracted from ferret.F)
+* V400 - 3/16/95 (at the joining with the GUI)
+* V402 - 7/95 symbols (4.01), VAR[G=var2[d=dset]], etc. ...
+*	 8/95 - The initialization of progname_mod moved to
+*		xrevision_type_data.F for auto-configuring
+* V410 - 8/95 ... just a name change so that the anonymous ftp looks good
+* V411 - 9/95 repaired memory leaks: XGKS (clear_vp.F) and HDF (whdf.c)
+* V420 - major changes
+* V430 - added IF-THEN tests and wildcards
+* V440 - 8/29/96 linked with GUI
+* V441 - 10/15/96 identical to 4.40 but Sun and OSF V4.40 went out in debug
+*		mode. This is to differentiate from them.
+* V442 - 12/06/96 *kob* - gui bug fixes and quality control checks
+* V445 - 1/14/97 *sh* - more gui bug fixes and uniform version numbering
+* V490 - 4/5/97 *sh* - still in development at this date
+* v4.92 - 1/11/98 *kob* - upped version number from 4.91 to 4.92 for 
+*                         source code release
+* V500 - 12/98 *sh* - still in development as of this date
+* V510 - 10/99 *sh*
+* V511 - 05/00 *kob*
+* V521 - *sh* minor bug fixes from V520
+* V530 - 10/00 *sh* beta 1
+* V534 - 9/01 *sh* alpha 1
+* V550 - 7/02 *sh* alpha 1
+* V551 - 2/03 *kob* beta1
+* V580 - 12/04 *acm* 
+* V581_01 8/12/05 *acm* minor revisions (not released)
+* 5.812 10/5/05  *acm* bug fixes thru now...
+* 5.813 12/13/05  *acm* fix for bug 1368
+* 5.814  2/08/06  *acm* Fixes:
+*                 further IF- parsing fixes, nested IF inside an IF clause that is not executed. 
+*                 fix to restore scale defaults in tm_close_set.F (changes many bn outputs!)
+*                 bug 1376, in labels and listings, if year is not listed because its modulo, 
+*                 remove extra spaces
+*                 bug 1077 had not been fixed for linux: handle arg-tests by QUERY as errors,
+*                 if the test fails
+*                 in NC reads, apply user-given offset to 1-D double precision variable, then 
+*                 convert to single precision
+* V6.00  4/25/06  Version 6.0
+* V6.01  9/29/06  Version 6.01
+* V6.02  1/05/07  Version 6.02
+* V6.03  5/25/07  Version 6.03
+* V6.04  7/02/07  Version 6.04
+* V6.05  7/27/07  Version 6.05
+* V6.06  8/08/07  Version 6.06 for LAS
+* V6.07  8/24/07  Version 6.07 for LAS
+* V6.08 10/12/07  Version 6.08
+* V6.10  3/25/08  Version 6.1
+* V6.11  4/02/08  Version 6.11 internal release
+* V6.12  5/20/08  Version 6.12
+* V6.13  8/28/08  Version 6.13
+* V6.13  8/28/08  Version 6.14 GFDL see bug 1586,1038
+* V6.15 11/07/08  Version 6.15 GFDL bugs 1608,1609
+* V6.16 11/20/08  Version 6.16 GFDL bugs 1421,1523,1547,1522,1577 plus gif transparency
+* V6.17  1/12/09  Version 6.17 GFDL bug  1476, bugs 1588, 1333, 1614 
+* V6.18  1/21/09  Version 6.18 fix bug with CURV_TO_RECT, allowing subsetting
+* V6.19  2/03/09  Version 6.19 fix for choosing colors and thicknesses when > 6 colors have been defined
+* V6.2   5/0/09   V6.2 release
+* V6.3   9/18/09  V6.3 release
+* V6.4   11/20/09  V6.4 release
+* V6.61   4/27/10  
+* V6.62   5/14/10  release v6.62 this week: LAS changes  
+* V6.64            BROWSE, bug fixes. Released 9/2010  
+* V6.65  10/01/10
+* V6.74   4/2011  to GFDL: double precision, netCDF4.2, fix ticket 1391 
+* V6.84  12/2012  Ribbon plots, bug fixes.
+
+        IMPLICIT NONE
+	include	'xrevision.cmn'
+
+	DATA program_name	/ 'FERRET' /
+	DATA len_program_name	/  6       /
+	DATA revision_level	/  6.9    /
+
+! Note we can put a debug title in the Ferret startup header lines
+! by putting a title into the Makefile: $(MAKE) "DEBUG_TITLE=beta" update
+!	DATA progname_mod	/ '(GUI BETA v1)' / ! ==> xrevision_type_data.F
+!	DATA len_progname_mod	/  13       /	    ! ==> xrevision_type_data.F
+	END
diff --git a/fer/dat/xtext_info_data.F b/fer/dat/xtext_info_data.F
new file mode 100644
index 0000000..ee74883
--- /dev/null
+++ b/fer/dat/xtext_info_data.F
@@ -0,0 +1,135 @@
+	BLOCK DATA XTEXT_INFO_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* pre-defined text strings
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/30/87
+* revision 0.1 - 3/18/87 - added fvar_name_code (removed from *VARIABLES)
+* revision 0.2 - 7/13/87 - added axis titles from ASCII_LIMITS
+* revision 0.3 - 2/24/88 - added AIRT and axis_orients
+* revision 0.4 - 3/18/88 - added date_labels and date_str_len
+* revision 0.5 - 4/4/88  - added unit_text
+* revision 0.6 -11/22/88 - new TM IO library took over axis_orients
+* V300:  2/3/93 - added verify_modes
+* V301:    1/94 - changed MODE VERIFY "FILES" to MODE VERIFY "DEFAULT" 
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*            2/12 *kms* Add E, F, M, N, ENSEMBLE, and FORECAST;
+*                       include tmap_dims.parm for nferdims needed by xtext_info.cmn
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include	'ferret.parm'
+	include	'xtext_info.cmn'
+
+	DATA	ww_dim_name( x_dim )	/ 'X' /,
+     .		ww_dim_name( y_dim )	/ 'Y' /,
+     .		ww_dim_name( z_dim )	/ 'Z' /,
+     .		ww_dim_name( t_dim )	/ 'T' /,
+     .		ww_dim_name( e_dim )	/ 'E' /,
+     .		ww_dim_name( f_dim )	/ 'F' /
+
+	DATA	ss_dim_name( x_dim )	/ 'I' /,
+     .		ss_dim_name( y_dim )	/ 'J' /,
+     .		ss_dim_name( z_dim )	/ 'K' /,
+     .		ss_dim_name( t_dim )	/ 'L' /,
+     .		ss_dim_name( e_dim )	/ 'M' /,
+     .		ss_dim_name( f_dim )	/ 'N' /
+
+* pre-defined file variables
+	DATA	fvar_name_code	( ptemp ) / 'TEMP'	/,
+     .		fvar_name_code	( psalt ) / 'SALT'	/,
+     .		fvar_name_code	( pu    ) / 'U'		/,
+     .		fvar_name_code	( pv    ) / 'V'		/,
+     .		fvar_name_code	( pw    ) / 'W'		/,
+     .		fvar_name_code	( ptaux ) / 'TAUX'	/,
+     .		fvar_name_code	( ptauy ) / 'TAUY'	/,
+     .		fvar_name_code	( ppsi  ) / 'PSI '	/,
+     .		fvar_name_code	( pairt ) / 'AIRT'	/
+
+* axis names used to document outputs
+	DATA	axis_title(x_dim)	/'LONGITUDE'/,
+     .		axis_title_len(x_dim)	/9/,
+     .		axis_title(y_dim)	/'LATITUDE' /,
+     .		axis_title_len(y_dim)	/8/,
+     .		axis_title(z_dim)	/'DEPTH'    /,
+     .		axis_title_len(z_dim)	/5/,
+     .		axis_title(t_dim)	/'TIME'     /,
+     .		axis_title_len(t_dim)	/4/,
+     .		axis_title(e_dim)	/'ENSEMBLE' /,
+     .		axis_title_len(e_dim)	/8/,
+     .		axis_title(f_dim)	/'FORECAST' /,
+     .		axis_title_len(f_dim)	/8/
+
+* label formatting information
+	DATA	date_labels ( 1 )	/ 'years'   /,
+     .		date_labels ( 2 )	/ 'months'  /,
+     .		date_labels ( 3 )	/ 'days'    /,
+     .		date_labels ( 4 )	/ 'hours'   /,
+     .		date_labels ( 5 )	/ 'minutes' /,
+     .		date_labels ( 6 )	/ 'seconds' /
+	DATA	date_str_len( 1 )	/  4 /,		! yyyy
+     .		date_str_len( 2 )	/  8 /,		! mmm-yyyy
+     .		date_str_len( 3 )	/ 11 /,		! dd-mmm-yyyy
+     .		date_str_len( 4 )	/ 14 /,		! dd-mmm-yyyy:hh
+     .		date_str_len( 5 )	/ 17 /,		! dd-mmm-yyyy:hh:mm
+     .		date_str_len( 6 )	/ 20 /		! dd-mmm-yyyy:hh:mm:ss
+
+* computed variable units
+	DATA	unit_text( punot_app	)/ ' ' /,		! N/A
+     .		unit_text( pudiffusion	)/ 'cm**2/sec' /,
+     .		unit_text( puheat_flux	)/ 'watt/m**2' /,
+     .		unit_text( putemp_dt	)/ 'deg. C/month' /,
+     .		unit_text( puvel_dt	)/ 'cm/sec/month' /,
+     .		unit_text( pupressure	)/ 'dynes/cm**2' /,
+     .		unit_text( pudensity	)/ 'gm/cm**3' /,
+     .		unit_text( pupres_dx	)/ 'dynes/cm**3' /,
+     .		unit_text( puppt	)/ 'ppt' /,
+     .		unit_text( puvelocity	)/ 'cm/sec' /,
+     .		unit_text( putemperature)/ 'deg. C' /
+
+* arguments for mode verify
+        DATA   verify_modes(1) / 'DEFAULT' /,
+     .         verify_modes(2) / 'ALL' /,
+     .         verify_modes(3) / 'ALWAYS' /
+
+	END
diff --git a/fer/dat/xvariables_data.F b/fer/dat/xvariables_data.F
new file mode 100644
index 0000000..3f269eb
--- /dev/null
+++ b/fer/dat/xvariables_data.F
@@ -0,0 +1,133 @@
+	BLOCK DATA XVARIABLES_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialization of COMMON / XVARIABLES /
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/31/86
+* .
+* .
+* .
+* revision 2.0 - 7/21/88 - initialize mblk_size/flink, mr_priority/protected
+* V200:  5/17/89 - eliminated _dim% --> 4D symmetry for memory resident data
+*		 - all cvar-related stuff to XCALC_VARS
+* 		 - deleted variables flagged in mr_protected and mr_del_ links
+*		 - eliminated nvar's, modified uvar's
+*		 - initialize isp
+* Ultrix/RISC port - 2/2/91 - Ultrix compiler doesnt permit variable to be
+*               defined multiple times by DATA statements
+*               Unix version requires implicit DO loops to be spelled out to
+*               avoid duplicate initialization
+* V230:  1/30/92 - Sun port: made initialization limits on mr_protected explicit
+* V312: 5/94 - array "memory" no longer a COMMON variable
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       2/12 *kms* Add E and F dimensions (set to nferdims in tmap_dims.parm)
+* V685+: 3/14 *sh* - initialize max_usable_intrp
+
+        IMPLICIT NONE
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'	! .cmn_text has an external
+!	external xgt_grid_data	! xtm_grid --> xgt  (DEC f77 3.2 not allowed)
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+	INTEGER	    max_mrm1
+	PARAMETER ( max_mrm1 = max_mrs - 1 )
+
+	INTEGER	i
+
+* dummy stored memory variable
+	DATA mr_protected	( dummy_mr ) / mr_perm_protected /
+	DATA mr_blk1		( dummy_mr ) / 1		/
+	DATA mr_nblks		( dummy_mr ) / 0		/
+	DATA mr_data_set	( dummy_mr ) / unspecified_int4	/
+	DATA mr_category	( dummy_mr ) / cat_dummy_var	/
+	DATA mr_variable	( dummy_mr ) / unspecified_int4	/
+	DATA mr_grid		( dummy_mr ) / unspecified_int4	/
+	DATA mr_bad_data	( dummy_mr ) / bad_val4		/
+	DATA (mr_lo_ww(i,dummy_mr),i=1,nferdims)/ nferdims*unspecified_val8 /
+	DATA (mr_hi_ww(i,dummy_mr),i=1,nferdims)/ nferdims*unspecified_val8 /
+	DATA (mr_trans(i,dummy_mr),i=1,nferdims)/ nferdims*trans_no_transform /
+	DATA (mr_lo_ss(dummy_mr,i),i=1,nferdims)/ nferdims*1 / ! usable dimension
+	DATA (mr_hi_ss(dummy_mr,i),i=1,nferdims)/ nferdims*1 / ! usable dimension
+
+* interp stack pointer at stack base
+	DATA isp / 1 /
+
+* interp stack pointer movable top
+	DATA max_usable_intrp / max_intrp /
+
+* bulk storage initialization
+	DATA (mblk_flink(i),i=1,pmax_mem_blks)
+     .			/ pmax_mem_blks*unspecified_int4 /
+	DATA (mblk_blink(i),i=1,pmax_mem_blks)
+     .			/ pmax_mem_blks*unspecified_int4 /
+	DATA (mblk_size (i),i=1,pmax_mem_blks)
+     .			/ pmax_mem_blks*unspecified_int4 /
+
+* memory variable table and delete priority chain initialization
+* (1/92 - made initialization limits explicit for Sun port)
+	DATA (mr_protected(i),i=1,max_mrm1)
+     .	      / max_mrm1*mr_deleted /	! top one is mr_dummy
+
+	DATA mr_del_flink(0)/ 0 /,
+     .	     mr_del_blink(0)/ 0 /,
+     .	     (mr_del_flink(i),i=1,max_mrs)/ max_mrs*unspecified_int4 /,
+     .	     (mr_del_blink(i),i=1,max_mrs)/ max_mrs*unspecified_int4 /
+
+* user-defined variables
+        DATA uvar_name_code_head / 0 /
+        DATA uvar_name_code_padding / 0 /
+        DATA uvar_name_code      /max_uvar*' '/
+        DATA uvar_num_items_head / 0 /
+        DATA uvar_num_items_padding / 0 /
+	DATA uvar_num_items	/ max_uvar*uvar_deleted /
+	DATA num_uvars_in_cmnd	/ cmnd_uvars_not_given	/
+
+	
+* Remote user-defined variables: LET/REMOTE
+	DATA uvar_remote	 /max_uvar*.FALSE./
+	DATA rvar_on_server	 /max_rvar*.FALSE./
+	DATA rvar_uvar		 /max_rvar*0/
+	DATA rvar_dset		 /max_rvar*0/
+	DATA rvar_varid		 /max_rvar*0/
+
+	END
diff --git a/fer/dat/xwindow_state_data.F b/fer/dat/xwindow_state_data.F
new file mode 100644
index 0000000..9d2fe5f
--- /dev/null
+++ b/fer/dat/xwindow_state_data.F
@@ -0,0 +1,51 @@
+         BLOCK DATA XWINDOW_STATE_DATA
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* *kob* New routine for Linux/f90 port
+
+        IMPLICIT NONE
+        include 'xwindow_state.cmn'
+
+*               ==> COMMON XWINDOW_STATE has been created **temporarily**
+*                   with the intention that it will be expanded in future
+*                   so overlays can be placed on **previously** drawn windows
+
+
+* pre-initialize to [0,1] limits just to avoid misbehavior from non-init
+         DATA  haxlo, haxhi, vaxlo, vaxhi/0.D0,1.D0,0.D0,1.D0/
+
+
+	END
diff --git a/fer/doo/LIB_NAME b/fer/doo/LIB_NAME
new file mode 100644
index 0000000..cc7a59f
--- /dev/null
+++ b/fer/doo/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libdoo.a 
diff --git a/fer/doo/Makefile b/fer/doo/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/doo/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/doo/SOURCE_FILES b/fer/doo/SOURCE_FILES
new file mode 100644
index 0000000..7627c09
--- /dev/null
+++ b/fer/doo/SOURCE_FILES
@@ -0,0 +1,96 @@
+SRCS_F = \
+asn_regrid_1_axis.F\
+asn_ptr_regrid_1_axis.F\
+ave_regrid_1_axis.F\
+binom_wt.F\
+convolve.F\
+days_from_day0.F\
+dd1step.F\
+dd2step.F\
+diag_op.F\
+do_4d_ave.F\
+do_4d_int_def.F\
+do_4d_nbd.F\
+do_4d_ngd.F\
+do_4d_string_goodbad.F\
+do_4d_string_trans.F\
+do_4d_sum.F\
+do_4d_trans.F\
+do_4d_var.F\
+do_asn_regrid.F\
+do_aux_var_regrid.F\
+do_aux_var_regrid_1d.F\
+do_aux_var_regrid_line_ave.F\
+do_aux_var_regrid_line_lin.F\
+do_ave_int.F\
+do_ave_regrid.F\
+do_average.F\
+do_deriv_bkwd.F\
+do_deriv_cntr.F\
+do_deriv_frwd.F\
+do_dist_loc.F\
+do_event.F\
+do_external_gc_fcn.F\
+do_fill_ave.F\
+do_fill_interp.F\
+do_fill_near.F\
+do_int_indef.F\
+do_int_indef_sub.F\
+do_integ_def.F\
+do_internal_gc_fcn.F\
+do_interpolate.F\
+do_lin_regrid.F\
+do_locate.F\
+do_max.F\
+do_min.F\
+do_nbad.F\
+do_nearest.F\
+do_nearest_dist_above.F\
+do_nearest_dist_below.F\
+do_nearest_index_above.F\
+do_nearest_index_below.F\
+do_nearest_regrid.F\
+do_ngood.F\
+do_points.F\
+do_run_sum.F\
+do_run_sum_sub.F\
+do_shift.F\
+do_smth_binml.F\
+do_smth_box.F\
+do_smth_hanng.F\
+do_smth_max.F\
+do_smth_median.F\
+do_smth_min.F\
+do_smth_parzn.F\
+do_smth_welch.F\
+do_stddev.F\
+do_string_goodbad.F\
+do_string_shift.F\
+do_sum.F\
+do_var_sub.F\
+do_variance.F\
+do_window_regrid.F\
+do_xact_regrid.F\
+do_xyave_regrid.F\
+do_xylin_regrid.F\
+geog_cos_factor.F\
+get_linear_coef.F\
+hanng_wt.F\
+lin_regrid_1_axis.F\
+maxsmoother.F\
+median.F\
+minsmoother.F\
+modulo_regrid.F\
+nearest_ptr_regrid_1_axis.F\
+nearest_regrid_1_axis.F\
+normalize.F\
+parzn_wt.F\
+regrid_comments.F\
+rho_unesco.F\
+theta_foff.F\
+welch_wt.F\
+window_regrid_1_axis.F\
+xact_ptr_regrid_1_axis.F\
+xact_regrid_1_axis.F\
+xyave_regrid.F\
+xylin_regrid.F 
diff --git a/fer/doo/asn_ptr_regrid_1_axis.F b/fer/doo/asn_ptr_regrid_1_axis.F
new file mode 100644
index 0000000..75e3e08
--- /dev/null
+++ b/fer/doo/asn_ptr_regrid_1_axis.F
@@ -0,0 +1,86 @@
+	SUBROUTINE ASN_PTR_REGRID_1_AXIS( cx_lims, axis, dst_lo, dst_hi,
+     .				      src, msrc, dst, mdst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a regrid by "association"  (i.e. copy the data)
+* on a pointer (string) array
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V533:  6/01 *sh*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* Calling argument declarations:
+	INTEGER cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	REAL*8  src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* Internal variable declarations:
+	INTEGER i, j, k, l, m, n, idim,
+     .          lo_lim(nferdims), hi_lim(nferdims)
+
+
+* Initialize: limits for calculation
+        DO 10 idim = 1, nferdims
+           lo_lim(idim) = cx_lo_ss(cx_lims, idim)
+           hi_lim(idim) = cx_hi_ss(cx_lims, idim)
+ 10     CONTINUE
+        lo_lim(axis) = MAX( dst_lo, mr_lo_ss(msrc,axis) )
+        hi_lim(axis) = MIN( dst_hi, mr_hi_ss(msrc,axis) )
+
+
+* Copy the data to the destination grid
+	DO 100 n = lo_lim(f_dim), hi_lim(f_dim)
+	DO 100 m = lo_lim(e_dim), hi_lim(e_dim)
+	DO 100 l = lo_lim(t_dim), hi_lim(t_dim)
+	DO 100 k = lo_lim(z_dim), hi_lim(z_dim)
+	DO 100 j = lo_lim(y_dim), hi_lim(y_dim)
+	DO 100 i = lo_lim(x_dim), hi_lim(x_dim)
+ 100	CALL COPY_C_STRING( src(i,j,k,l,m,n), dst(i,j,k,l,m,n) )
+
+	RETURN
+	END
diff --git a/fer/doo/asn_regrid_1_axis.F b/fer/doo/asn_regrid_1_axis.F
new file mode 100644
index 0000000..72fe5b4
--- /dev/null
+++ b/fer/doo/asn_regrid_1_axis.F
@@ -0,0 +1,86 @@
+	SUBROUTINE ASN_REGRID_1_AXIS( cx_lims, axis, dst_lo, dst_hi,
+     .				      src, msrc, dst, mdst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a regrid by "association"  (i.e. copy the data)
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V230:  8/22/92
+* V570:  5/ 5/04  remove VMS includes
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* Calling argument declarations:
+	INTEGER cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* Internal variable declarations:
+	INTEGER i, j, k, l, m, n, idim,
+     .          lo_lim(nferdims), hi_lim(nferdims)
+
+
+* Initialize: limits for calculation
+        DO 10 idim = 1, nferdims
+           lo_lim(idim) = cx_lo_ss(cx_lims, idim)
+           hi_lim(idim) = cx_hi_ss(cx_lims, idim)
+ 10     CONTINUE
+        lo_lim(axis) = MAX( dst_lo, mr_lo_ss(msrc,axis) )
+        hi_lim(axis) = MIN( dst_hi, mr_hi_ss(msrc,axis) )
+
+
+* Copy the data to the destination grid
+	DO 100 n = lo_lim(f_dim), hi_lim(f_dim)
+	DO 100 m = lo_lim(e_dim), hi_lim(e_dim)
+	DO 100 l = lo_lim(t_dim), hi_lim(t_dim)
+	DO 100 k = lo_lim(z_dim), hi_lim(z_dim)
+	DO 100 j = lo_lim(y_dim), hi_lim(y_dim)
+	DO 100 i = lo_lim(x_dim), hi_lim(x_dim)
+ 100	dst(i,j,k,l,m,n) = src(i,j,k,l,m,n)
+
+	RETURN
+	END
diff --git a/fer/doo/ave_regrid_1_axis.F b/fer/doo/ave_regrid_1_axis.F
new file mode 100644
index 0000000..33513b9
--- /dev/null
+++ b/fer/doo/ave_regrid_1_axis.F
@@ -0,0 +1,979 @@
+	SUBROUTINE AVE_REGRID_1_AXIS( cx_lims, axis, trans,
+     .				 dst_lox, dst_hix, dst_loy, dst_hiy,
+     .				 src, msrc, dst, mdst, ss21, src_cx,
+     .                           dst_cx, wksize )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grid, regrid to
+* 	grid dst_grid by averaging withing boxes along one axis
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+
+* 	specify the subscript bounds of src and dst within their 
+* 	respective grids.
+
+*	ss21 holds the indices of source grid boxes (on src_grid) for box
+*	limits on dst_grid.
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* note: the conversion to 4D is of the Q&D variety.  Optimization is possible
+*	by providing additional work space and pre-computing the box sizes
+*	along the X and Y axes
+
+* V312:	 6/7/94 - use TDST_WORLD for simpler, faster date conversions
+*	speed other axes, too, by not using AXIS_DISTANCE (units divide out)
+* V420: 10/95 - handles regridding by @VAR, as well
+*	 1/96 - handles @SUM and @NGD as well
+* V510: *sh* 1/00 variance of a grid box with only a single value
+*	contributing is undefined
+* v541: *acm* 3/02 In some cases the source indices include a range
+*                  outside the destination indices, so ddist < 0.  Test
+*                  for this and only have a contribution to the avg from 
+*                  portions of the source axis that overlap the dest box.
+* v552  *acm* 4/03 Use src_lo_ss and src_hi_ss for the range on the src
+*                  axis, as a more complete fix of the above bug.
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+* NOTE: -111 in the above was the value of unspecified_int4 (now -999)
+*      *kms*  2/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* v685 *acm* 06/13 Fix ticket 2070: regridding when source cell encloses 
+*                  dest cell.
+* v685 *acm*  7/13 Fix bug in F axis loop, and fix nonX directions in the
+*                  code for source cell enclosing dest cell.
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xmem_subsc.cmn'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER cx_lims, axis, trans, msrc, mdst,
+     .          dst_lox, dst_hix, dst_loy, dst_hiy , wksize
+	INTEGER ss21(wksize)
+
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .	             m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .	        dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .	             m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* local variable declarations:
+
+        LOGICAL         ok_neg111, src_encloses
+        INTEGER		dstss,srcss,src_grid,dst_grid,i,j,k,l,m,n
+	INTEGER	     	srcss_lo,srcss_hi, dstss_lo,dstss_hi, ncontrib,
+     .                  src_cx, dst_cx
+
+	REAL		ddist, bad_src, bad_dst
+	REAL*8		TM_WORLD, TDEST_WORLD, sum, distance, dev,
+     .			xsrc_min, xsrc_max, xsrc_lo, xsrc_hi,
+     .			xdst_lo, xdst_hi
+******************************************************************************
+
+* initialize
+	src_grid = mr_grid( msrc )
+	dst_grid = mr_grid( mdst )
+
+* limits for calculation
+        srcss_lo = mr_lo_ss(msrc,axis)
+        srcss_hi = mr_hi_ss(msrc,axis)
+
+* Range of subscripts might be negative, and contain the value of unspecified_int4 
+* among them.  ok_neg111 distinguishes between this and the flag unspecified_int4.
+
+        ok_neg111 = srcss_lo .LT. unspecified_int4 .AND.
+     .              srcss_hi .GT. unspecified_int4
+
+        dstss_lo = cx_lo_ss(cx_lims,axis)
+        dstss_hi = cx_hi_ss(cx_lims,axis)
+
+* flag for bad/missing data
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* determine the source grid boxes containing the destination box edges
+	CALL GET_AVE_LIMS( srcss_lo, srcss_hi, src_grid,
+     .			   dstss_lo, dstss_hi, dst_grid,
+     .			   axis, ss21 )
+
+* along X axis
+        IF ( axis .EQ. x_dim ) THEN
+           DO 190 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 190 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 190 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 190 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 190 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* loop through the each destination grid box
+	   DO 160 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(dstss,j,k,l,m,n) = bad_dst
+	         goto 160
+	      ENDIF
+
+	      xdst_lo = TM_WORLD(dstss, dst_grid, axis, box_lo_lim )
+	      xdst_hi = TM_WORLD(dstss, dst_grid, axis, box_hi_lim )
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 110 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(srcss, j, k, l, m, n) .EQ. bad_src ) GOTO 110
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi )
+
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(srcss, j, k, l, m, n)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(srcss, j, k, l, m, n)
+	            ENDIF
+                 ENDIF
+
+ 110	      CONTINUE
+
+	      IF ( trans.EQ.prgrd_good_pt ) THEN
+	         dst(dstss, j, k, l, m, n) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(dstss, j, k, l, m, n) = bad_dst
+	      ELSEIF ( trans.EQ.prgrd_sum ) THEN
+	         dst(dstss, j, k, l, m, n) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(dstss, j, k, l, m, n) = sum / distance
+		 IF (src_encloses) dst(dstss,j,k,l,m,n) = 
+     .			         src(srcss_lo,j,k,l,m,n)
+	      ENDIF
+
+
+ 160	   CONTINUE
+ 190	   CONTINUE
+
+* along Y axis
+        ELSEIF ( axis .EQ. Y_dim ) THEN
+
+           DO 290 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 290 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 290 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 290 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 290 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 260 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(i,dstss,k,l,m,n) = bad_dst
+	         goto 260
+	      ENDIF
+
+	      xdst_lo  = TM_WORLD(dstss, dst_grid, axis, box_lo_lim )
+	      xdst_hi  = TM_WORLD(dstss, dst_grid, axis, box_hi_lim )
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 210 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, srcss, k, l, m, n) .EQ. bad_src ) GOTO 210
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi)
+
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(i, srcss, k, l, m, n)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(i, srcss, k, l, m, n)
+	            ENDIF
+                 ENDIF
+
+ 210	      CONTINUE
+
+	      IF (trans.EQ.prgrd_good_pt ) THEN
+	         dst(i, dstss, k, l, m, n) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(i, dstss, k, l, m, n) = bad_dst
+	      ELSEIF (trans.EQ.prgrd_sum ) THEN
+	         dst(i, dstss, k, l, m, n) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(i, dstss, k, l, m, n) = sum / distance
+		 IF (src_encloses) dst(i,dstss,k,l,m,n) = 
+     .			         src(i,srcss_lo,k,l,m,n)
+	      ENDIF
+
+ 260	   CONTINUE
+ 290	   CONTINUE
+
+* along Z axis
+        ELSEIF ( axis .EQ. z_dim ) THEN
+
+           DO 390 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 390 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 390 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 390 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 390 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 360 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(i,j,dstss,k,m,n) = bad_dst
+	         goto 360
+	      ENDIF
+
+	      xdst_lo = TM_WORLD(dstss, dst_grid, axis, box_lo_lim )
+	      xdst_hi = TM_WORLD(dstss, dst_grid, axis, box_hi_lim )
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 310 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, srcss, l, m, n) .EQ. bad_src ) GOTO 310
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi )
+
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(i, j, srcss, l, m, n)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(i, j, srcss, l, m, n)
+	            ENDIF
+                 ENDIF
+
+ 310	      CONTINUE
+
+	      IF ( trans.EQ.prgrd_good_pt ) THEN
+	         dst(i, j, dstss, l, m, n) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(i, j, dstss, l, m, n) = bad_dst
+	      ELSEIF (trans.EQ.prgrd_sum ) THEN
+	         dst(i, j, dstss, l, m, n) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(i, j, dstss, l, m, n) = sum / distance
+		 IF (src_encloses) dst(i,j,dstss,l,m,n) = 
+     .			         src(i,j,srcss_lo,l,m,n)
+	      ENDIF
+
+ 360	   CONTINUE
+ 390	   CONTINUE
+
+* along T axis
+        ELSEIF ( axis .EQ. T_dim ) THEN
+
+           DO 490 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 490 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 490 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 490 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 490 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 460 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(i,j,k,dstss,m,n) = bad_dst
+	         goto 460
+	      ENDIF
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 410 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, srcss, m, n) .EQ. bad_src ) GOTO 410
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi)
+
+	         ddist   = xsrc_hi - xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(i, j, k, srcss, m, n)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(i, j, k, srcss, m, n)
+	            ENDIF
+	         ENDIF
+ 410	      CONTINUE
+
+	      IF ( trans.EQ.prgrd_good_pt ) THEN
+	         dst(i, j, k, dstss, m, n) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(i, j, k, dstss, m, n) = bad_dst
+	      ELSEIF (trans.EQ.prgrd_sum ) THEN
+	         dst(i, j, k, dstss, m, n) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(i, j, k, dstss, m, n) = sum / distance
+		 IF (src_encloses) dst(i,j,k,dstss,m,n) = 
+     .			         src(i,j,k,srcss_lo,m,n)
+	      ENDIF
+
+ 460	   CONTINUE
+ 490	   CONTINUE
+
+* along E axis
+        ELSEIF ( axis .EQ. e_dim ) THEN
+
+           DO 590 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 590 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 590 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 590 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 590 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 560 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(i,j,k,l,dstss,n) = bad_dst
+	         goto 560
+	      ENDIF
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 510 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, l, srcss, n) .EQ. bad_src ) GOTO 510
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi)
+
+	         ddist   = xsrc_hi - xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(i, j, k, l, srcss, n)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(i, j, k, l, srcss, n)
+	            ENDIF
+	         ENDIF
+ 510	      CONTINUE
+
+	      IF ( trans.EQ.prgrd_good_pt ) THEN
+	         dst(i, j, k, l, dstss, n) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(i, j, k, l, dstss, n) = bad_dst
+	      ELSEIF (trans.EQ.prgrd_sum ) THEN
+	         dst(i, j, k, l, dstss, n) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(i, j, k, l, dstss, n) = sum / distance
+		 IF (src_encloses) dst(i,j,k,l,dstss,n) = 
+     .			         src(i,j,k,l,srcss_lo,n)
+	      ENDIF
+
+ 560	   CONTINUE
+ 590	   CONTINUE
+
+* along F axis
+        ELSEIF ( axis .EQ. f_dim ) THEN
+
+           DO 690 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 690 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 690 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 690 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 690 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 660 dstss = dstss_lo,dstss_hi
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+*  check if requested region is out of source range
+              IF ( (srcss_lo .EQ. unspecified_int4
+     .	     .OR.  srcss_hi .EQ. unspecified_int4)
+     .       .AND. .NOT.(ok_neg111) ) THEN
+	         dst(i,j,k,l,m,dstss) = bad_dst
+	         goto 660
+	      ENDIF
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+
+* IF source box completely encloses the dest box, then srcss_lo=srcss_hi
+* and we can just stick the source point into the destination (for avg or var)
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      DO 610 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, l, m, srcss) .EQ. bad_src ) GOTO 610
+
+	         xsrc_min = TM_WORLD(srcss,src_grid,axis,box_lo_lim)
+	         xsrc_max = TM_WORLD(srcss,src_grid,axis,box_hi_lim)
+
+	        src_encloses = 
+     .               (xdst_lo.GE.xsrc_min .AND. xdst_hi.LE.xsrc_max) 
+
+	         xsrc_lo = MAX(xsrc_min,xdst_lo)
+	         xsrc_hi = MIN(xsrc_max,xdst_hi)
+
+	         ddist   = xsrc_hi - xsrc_lo
+
+* ... contribution from this source box
+                 IF (ddist .GT. 0.) THEN
+	            distance  = distance + ddist
+	            IF (trans .EQ. prgrd_sum ) THEN
+	               sum   = sum  + src(i, j, k, l, m, srcss)
+     .			         * ddist/(xsrc_max-xsrc_min)
+	            ELSEIF (trans .EQ. prgrd_good_pt ) THEN
+	               sum   = sum  + ddist/(xsrc_max-xsrc_min)
+	            ELSE	! average or variance
+	               sum   = sum  + ddist * src(i, j, k, l, m, srcss)
+	            ENDIF
+	         ENDIF
+ 610	      CONTINUE
+
+	      IF ( trans.EQ.prgrd_good_pt ) THEN
+	         dst(i, j, k, l, m, dstss) = sum
+	      ELSEIF ( distance .EQ. 0.0 ) THEN
+	         dst(i, j, k, l, m, dstss) = bad_dst
+	      ELSEIF (trans.EQ.prgrd_sum ) THEN
+	         dst(i, j, k, l, m, dstss) = sum
+	      ELSE
+* ... divide by distance to get average
+	         dst(i, j, k, l, m, dstss) = sum / distance
+		 IF (src_encloses) dst(i,j,k,l,m,dstss) = 
+     .			         src(i,j,k,l,m,srcss_lo)
+	      ENDIF
+
+ 660	   CONTINUE
+ 690	   CONTINUE
+
+* TODO: along E and F axes?
+
+        ENDIF
+
+	IF (trans .NE. prgrd_variance) RETURN
+
+**************************************************************
+**************************************************************
+**************************************************************
+* pass 2:  determine variance
+**************************************************************
+**************************************************************
+**************************************************************
+	
+* along X axis
+        IF ( axis .EQ. x_dim ) THEN
+           DO 1190 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 1190 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 1190 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 1190 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 1190 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1160 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(dstss, j, k, l, m, n) .EQ. bad_dst ) GOTO 1160
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+	      xdst_lo = TM_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TM_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1110 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(srcss, j, k, l, m, n) .EQ. bad_src ) GOTO 1110
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+ 	         IF (ddist .GT. 0.0) THEN
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(srcss, j, k, l, m, n)) -
+     .                   DBLE(dst(dstss, j, k, l, m, n))
+	           sum = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1110	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(dstss, j, k, l, m, n) = sum / distance
+	      ELSE
+	         dst(dstss, j, k, l, m, n) = bad_dst
+	      ENDIF
+
+ 1160	   CONTINUE
+ 1190	   CONTINUE
+
+* along Y axis
+        ELSEIF ( axis .EQ. Y_dim ) THEN
+
+           DO 1290 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 1290 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 1290 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 1290 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 1290 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1260 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(i, dstss, k, l, m, n) .EQ. bad_dst ) GOTO 1260
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+	      xdst_lo = TM_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TM_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1210 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, srcss, k, l, m, n) .EQ. bad_src ) GOTO 1210
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+	         IF (ddist .GT. 0.0) THEN 
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(i, srcss, k, l, m, n)) -
+     .                   DBLE(dst(i, dstss, k, l, m, n))
+	           sum   = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1210	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(i, dstss, k, l, m, n) = sum / distance
+	      ELSE
+	         dst(i, dstss, k, l, m, n) = bad_dst
+	      ENDIF
+
+ 1260	   CONTINUE
+ 1290	   CONTINUE
+
+* along Z axis
+        ELSEIF ( axis .EQ. z_dim ) THEN
+
+           DO 1390 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 1390 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 1390 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 1390 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 1390 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1360 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(i, j, dstss, l, m, n) .EQ. bad_dst ) GOTO 1360
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+	      xdst_lo = TM_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TM_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1310 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, srcss, l, m, n) .EQ. bad_src ) GOTO 1310
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi-xsrc_lo
+
+* ... contribution from this source box
+ 	         IF (ddist .GT. 0.0) THEN
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(i, j, srcss, l, m, n)) -
+     .                   DBLE(dst(i, j, dstss, l, m, n))
+	           sum = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1310	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(i, j, dstss, l, m, n) = sum / distance
+	      ELSE
+	         dst(i, j, dstss, l, m, n) = bad_dst
+	      ENDIF
+
+ 1360	   CONTINUE
+ 1390	   CONTINUE
+
+* along T axis
+        ELSEIF ( axis .EQ. T_dim ) THEN
+
+           DO 1490 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 1490 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 1490 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 1490 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 1490 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1460 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(i, j, k, dstss, m, n) .EQ. bad_dst ) GOTO 1460
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1410 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, srcss, m, n) .EQ. bad_src ) GOTO 1410
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi - xsrc_lo
+                 IF (ddist .LT. 0.) ddist = 0.
+
+* ... contribution from this source box
+ 	         IF (ddist .GT. 0.0) THEN
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(i, j, k, srcss, m, n)) -
+     .                   DBLE(dst(i, j, k, dstss, m, n))
+	           sum = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1410	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(i, j, k, dstss, m, n) = sum / distance
+	      ELSE
+	         dst(i, j, k, dstss, m, n) = bad_dst
+	      ENDIF
+
+ 1460	   CONTINUE
+ 1490	   CONTINUE
+
+* along E axis
+        ELSEIF ( axis .EQ. e_dim ) THEN
+
+           DO 1590 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 1590 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 1590 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 1590 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 1590 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1560 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(i, j, k, l, dstss, n) .EQ. bad_dst ) GOTO 1560
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1510 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, l, srcss, n) .EQ. bad_src ) GOTO 1510
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi - xsrc_lo
+                 IF (ddist .LT. 0.) ddist = 0.
+
+* ... contribution from this source box
+ 	         IF (ddist .GT. 0.0) THEN
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(i, j, k, l, srcss, n)) -
+     .                   DBLE(dst(i, j, k, l, dstss, n))
+	           sum = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1510	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(i, j, k, l, dstss, n) = sum / distance
+	      ELSE
+	         dst(i, j, k, l, dstss, n) = bad_dst
+	      ENDIF
+
+ 1560	   CONTINUE
+ 1590	   CONTINUE
+
+
+* along F axis
+        ELSEIF ( axis .EQ. f_dim ) THEN
+
+           DO 1690 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 1690 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 1690 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 1690 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 1690 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 1660 dstss = dstss_lo,dstss_hi
+
+	      IF ( dst(i, j, k, l, m, dstss) .EQ. bad_dst ) GOTO 1660
+
+	      srcss_lo = ss21(dstss-dstss_lo+1)
+	      srcss_hi = ss21(dstss-dstss_lo+2)
+
+* USE SOURCE GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS 6/94
+* initialization of TDEST_WORLD is done from GET_AVE_LIMS
+
+	      xdst_lo = TDEST_WORLD(dstss, dst_grid, axis, box_lo_lim)
+	      xdst_hi = TDEST_WORLD(dstss, dst_grid, axis, box_hi_lim)
+
+* add all partial or complete boxes of data from the source grid
+	      sum = 0.0D0
+	      distance = 0.0D0
+	      ncontrib = 0
+	      DO 1610 srcss = srcss_lo, srcss_hi
+
+* ... ignore missing source data
+	         IF ( src(i, j, k, l, m, srcss) .EQ. bad_src ) GOTO 1610
+
+	         xsrc_lo = MAX( TM_WORLD(srcss,src_grid,axis,box_lo_lim),
+     .                          xdst_lo )
+	         xsrc_hi = MIN( TM_WORLD(srcss,src_grid,axis,box_hi_lim),
+     .                          xdst_hi )
+	         ddist   = xsrc_hi - xsrc_lo
+                 IF (ddist .LT. 0.) ddist = 0.
+
+* ... contribution from this source box
+ 	         IF (ddist .GT. 0.0) THEN
+	           ncontrib = ncontrib + 1
+	           distance  = distance + ddist
+	           dev = DBLE(src(i, j, k, l, m, srcss)) -
+     .                   DBLE(dst(i, j, k, l, m, dstss))
+	           sum = sum  + ddist * dev*dev
+	         ENDIF
+
+ 1610	      CONTINUE
+
+* ... divide by weight to get variance
+	      IF (ncontrib .GT. 1) THEN
+	         dst(i, j, k, l, m, dstss) = sum / distance
+	      ELSE
+	         dst(i, j, k, l, m, dstss) = bad_dst
+	      ENDIF
+
+ 1660	   CONTINUE
+ 1690	   CONTINUE
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/binom_wt.F b/fer/doo/binom_wt.F
new file mode 100644
index 0000000..4624011
--- /dev/null
+++ b/fer/doo/binom_wt.F
@@ -0,0 +1,75 @@
+	SUBROUTINE BINOM_WT( wt, wlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create an array of binomial weights
+* by repeated convolutions with the filter [1/2,1/2]
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/6/89
+* V301: 2/94 - bug fix if wlen=1 (window of width 1)
+
+* calling argument declarations:
+        IMPLICIT NONE
+	INTEGER	wlen
+	REAL	wt(wlen+1)
+
+* internal variable declarations:
+	INTEGER i, k
+
+* zero out the array
+	DO 10 i = 1, wlen+1
+ 10	wt(i) = 0.0
+
+	IF ( wlen .GT. 1 ) THEN
+* insert [1/2,1/2]
+	   wt(wlen  ) = 0.5
+	   wt(wlen-1) = 0.5
+	ELSE
+	   wt(1) = 1.0
+	ENDIF
+	
+* repeat convolution wlen-2 times
+	DO 200 k = 1, wlen-2
+	   DO 100 i = 1, wlen
+ 100	   wt(i) = wt(i)*0.5 + wt(i+1)*0.5
+ 200	CONTINUE
+
+	RETURN
+	END	
diff --git a/fer/doo/convolve.F b/fer/doo/convolve.F
new file mode 100644
index 0000000..07afe38
--- /dev/null
+++ b/fer/doo/convolve.F
@@ -0,0 +1,384 @@
+	SUBROUTINE CONVOLVE(	idim, hlen, wt,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible
+* also: when bad data points are encountered in the component data all
+*	result data depending on it are flagged as bad, too
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/2/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN 
+* V500: bug fix *sh* & *kob* 4/99 -  add code to make sure that component
+*                                    limits are adequate
+* V550: support for subspan modulo axes -- ensure that convolution does not
+*	cross the void point
+*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, hlen, com_mr, com_cx, res_mr, res_cx
+	REAL	wt(-hlen:hlen),
+     .		com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .		     m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .		res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .		     m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER	TM_MODULO_LINE_DIM, CGRID_AXIS, 
+     .		i, j, k, l, m, n, ii,
+     .		lo_sub(nferdims), hi_sub(nferdims), lo_lim, hi_lim,
+     .		hlen1, lo_modlim, hi_modlim, nmod, nmod_prev, modlen
+	REAL	bad_com, bad_res, comp, sum
+
+* internal (convenience) equivalences
+	INTEGER lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* initialize
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+	hlen1 = hlen
+	lo_lim = cx_lo_ss(com_cx,idim)
+	hi_lim = cx_hi_ss(com_cx,idim) 
+	nmod_prev = -99999
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+
+* it his a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO( CGRID_AXIS(idim,com_cx) )
+	IF (has_mod_void) THEN
+	   modlen = TM_MODULO_LINE_DIM( CGRID_AXIS(idim,com_cx) )
+	   has_mod_void = lo_lim.LE.0 .OR. hi_lim.GE.modlen
+	ENDIF
+
+* !temp - not optimized for speed yet
+* ... though treating each axis separately is to avoid testing inside the loop
+* CONVOLVE ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	   DO 110 i = lo_s1, hi_s1
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (i.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (i-1)/modlen 
+	         ELSE
+	            nmod = i/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	      sum = 0.0
+	      DO 100 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( i+ii .GE. lo_lim
+     .          .AND. i+ii .LE. hi_lim ) THEN
+                    comp = com(i+ii,j,k,l,m,n)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 110
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 110
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 100	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 110	   CONTINUE
+
+* CONVOLVE ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 j = lo_s2, hi_s2
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (j.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (j-1)/modlen 
+	         ELSE
+	            nmod = j/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 210 i = lo_s1, hi_s1
+	      sum = 0.0
+	      DO 200 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( j+ii .GE. lo_lim
+     .          .AND. j+ii .LE. hi_lim ) THEN
+                    comp = com(i,j+ii,k,l,m,n)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 210
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 210
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 200	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 210	   CONTINUE
+
+* CONVOLVE ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 k = lo_s3, hi_s3
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (k.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (k-1)/modlen 
+	         ELSE
+	            nmod = k/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      sum = 0.0
+	      DO 300 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( k+ii .GE. lo_lim
+     .          .AND. k+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k+ii,l,m,n)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 310
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 310
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 300	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 310	   CONTINUE
+
+* CONVOLVE ALONG T AXIS
+	ELSE IF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 l = lo_s4, hi_s4
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (l.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (l-1)/modlen 
+	         ELSE
+	            nmod = l/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      sum = 0.0
+	      DO 400 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( l+ii .GE. lo_lim
+     .          .AND. l+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l+ii,m,n)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 410
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 410
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 400	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 410	   CONTINUE
+
+* CONVOLVE ALONG E AXIS
+	ELSE IF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 m = lo_s5, hi_s5
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (m.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (m-1)/modlen 
+	         ELSE
+	            nmod = m/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      sum = 0.0
+	      DO 500 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( m+ii .GE. lo_lim
+     .          .AND. m+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m+ii,n)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 510
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 510
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 500	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 510	   CONTINUE
+
+* CONVOLVE ALONG F AXIS
+	ELSE IF ( idim .EQ. f_dim ) THEN
+	   DO 610 n = lo_s6, hi_s6
+	      IF (has_mod_void) THEN
+*  ... do not allow convolution across the modulo void
+	         IF (n.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (n-1)/modlen 
+	         ELSE
+	            nmod = n/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      sum = 0.0
+	      DO 600 ii = -hlen1, hlen1
+* test limits of component data before using
+                 IF ( n+ii .GE. lo_lim
+     .          .AND. n+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m,n+ii)
+                 ELSE
+                    res(i,j,k,l,m,n) = bad_res
+                    GOTO 610
+                 ENDIF
+
+	         IF ( comp .EQ. bad_com ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	            GOTO 610
+	         ELSE
+	            sum = sum + comp*wt(ii)
+	         ENDIF
+ 600	      CONTINUE
+	      res(i,j,k,l,m,n) = sum
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/days_from_day0.F b/fer/doo/days_from_day0.F
new file mode 100644
index 0000000..7519f2d
--- /dev/null
+++ b/fer/doo/days_from_day0.F
@@ -0,0 +1,110 @@
+	REAL FUNCTION DAYS_FROM_DAY0( date0_days, year, month, day,
+     .       rdum)
+
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a relative day number since the day of date0_days where date0_days
+* is in units of days since 1-JAN-0000
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V320 11/94 - in order to implement the DAY1900 function
+*		based on tm_secs_from_bc by Mark Verschell
+* V530 12/00 *sh* - bug fix: avoid crash if month is not in [1,12]
+* V600 4/06  *acm*  return the result in rdum as well, for 64-bit build
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* calling argument declarations:
+        IMPLICIT NONE
+	REAL*8 date0_days
+	INTEGER year, month, day
+        REAL rdum
+
+* Local Definition
+	INTEGER		days_in_month(12), mnth
+	REAL*8		secs_in_day,
+     .			secs_in_year, secs_in_century, total_secs,
+     .			total_days
+
+	PARAMETER	(secs_in_day	 = 60.*60.*24.,
+     .			 secs_in_year	 = secs_in_day*365.,
+     .			 secs_in_century = secs_in_day*36524.)
+
+	DATA days_in_month /   0,  31,  59,  90, 120, 151,
+     .			     181, 212, 243, 273, 304, 334/
+
+* to avoid crash for out of bounds month
+	IF (month .GT. 12) THEN
+	   mnth = 12
+	ELSEIF (month .LT. 1) THEN
+	   mnth = 1
+	ELSE
+	   mnth = month
+	ENDIF
+
+* add lots of seconds for each century since 0 day
+	total_secs = secs_in_century * INT(year/100)
+* add a day for every 400 years (leap year at centennial)
+	total_secs = total_secs + secs_in_day*INT(year/400.+0.9975)
+* add a year for each year since turn of century
+	total_secs = total_secs + secs_in_year*MOD(year,100)
+* add a day for each leap year since centennial (except for centennial)
+	total_secs = total_secs + secs_in_day*INT((MOD(year,100)-1)/4)
+* add seconds for number of months
+	total_secs = total_secs + days_in_month(mnth)*secs_in_day
+* add 1 day worth of seconds if this is leap year and past february
+	IF (mnth .GT. 2) THEN
+	  IF (MOD(year,400) .EQ. 0) THEN
+	    total_secs = total_secs + secs_in_day
+	  ELSE
+	    IF (MOD(year,4) .EQ. 0 .AND. MOD(year,100) .NE. 0)
+     .	          total_secs = total_secs + secs_in_day
+	  ENDIF
+	ENDIF
+* add seconds for number of days
+	total_secs = total_secs + secs_in_day*(day-1)
+
+* convert to days and return result
+	total_days = total_secs/secs_in_day - date0_days
+	DAYS_FROM_DAY0 = total_days
+
+        rdum = DAYS_FROM_DAY0
+
+        RETURN
+	END
+
diff --git a/fer/doo/dd1step.F b/fer/doo/dd1step.F
new file mode 100644
index 0000000..82e9f46
--- /dev/null
+++ b/fer/doo/dd1step.F
@@ -0,0 +1,265 @@
+	SUBROUTINE DD1STEP (	idim, shf, com_lo, com_hi, box,
+     .				com, com_mr,
+     .				res, res_mr, res_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute a 1 step derivative of the component along axis idim
+* note: for a forward  derivative shf=0, and com limits are res_lo:res_hi+1
+*       for a backward derivative shf=1, and com limits are res_lo-1:res_hi
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/6/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN & com_lo/hi
+* V230: 5/6/92 - COS correction checks that J location is defined
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       2/12 *kms* Include E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+
+* calling argument declarations:
+	INTEGER	idim, shf, com_mr, com_lo, com_hi, res_mr, res_cx
+	REAL	box( com_lo:com_hi ),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	GEOG_COS_FACTOR, need_cos
+	INTEGER i, j, k, l, m, n, ii, grid,
+     .          lo_sub(nferdims), hi_sub(nferdims), axis
+	REAL	bad_com, bad_res, lo_com, hi_com, unit, cos_factor,
+     .          ybxlo, ybxhi, bx
+	REAL*8	TM_WORLD, lo_ww, hi_ww
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* initialize
+	grid    = mr_grid( res_mr )
+	axis    = grid_line( idim, grid )
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_sub(idim) = ( com_lo     ) + shf
+	hi_sub(idim) = ( com_hi - 1 ) + shf
+
+* create an array of delta H increments
+	lo_ww = TM_WORLD( lo_sub(idim)-shf, grid, idim, box_middle )
+	DO 20 ii = lo_sub(idim), hi_sub(idim)
+	   hi_ww = TM_WORLD( ii+1-shf, grid, idim, box_middle )
+	   box(ii) = hi_ww - lo_ww
+	   lo_ww = hi_ww
+ 20	CONTINUE
+
+* perform differentiation in standard units if possible
+	unit = un_convert( line_unit_code(axis) )
+	DO 30 ii = lo_sub(idim), hi_sub(idim)
+ 30	box(ii) = box(ii) * unit
+
+* DERIVATIVE ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   need_cos = GEOG_COS_FACTOR( idim, grid )
+     .                .AND. lo_s2.NE.unspecified_int4
+	   DO 110 j = lo_s2, hi_s2
+	   IF ( need_cos ) THEN
+#ifdef double_p
+	      cos_factor = COS( deg2rad *       
+     .            TM_WORLD(j, grid, y_dim, box_middle) ) 
+              ybxlo = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_lo_lim)
+              ybxhi = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_hi_lim)
+#else
+	      cos_factor = COS( deg2rad *       
+     .            SNGL( TM_WORLD(j, grid, y_dim, box_middle) ) ) 
+              ybxlo = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_hi_lim) )
+#endif
+              bx = ABS(ybxhi - ybxlo)
+	      cos_factor = ABS( SIN(ybxhi) - SIN(ybxlo) )/ bx
+	   ENDIF
+
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	      lo_com = com(lo_s1-shf,j,k,l,m,n)
+	      DO 100 i = lo_s1, hi_s1
+	         hi_com = com(i+1-shf,j,k,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(i)
+	            IF ( need_cos )
+     .                 res(i,j,k,l,m,n) = res(i,j,k,l,m,n)/cos_factor
+	         ENDIF
+	         lo_com = hi_com
+ 100	      CONTINUE
+ 110	   CONTINUE
+
+* DERIVATIVE ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+	      lo_com = com(i,lo_s2-shf,k,l,m,n)
+	      DO 200 j = lo_s2, hi_s2
+	         hi_com = com(i,j+1-shf,k,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(j)
+	         ENDIF
+	         lo_com = hi_com
+ 200	      CONTINUE
+ 210	   CONTINUE
+
+* DERIVATIVE ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      lo_com = com(i,j,lo_s3-shf,l,m,n)
+	      DO 300 k = lo_s3, hi_s3
+	         hi_com = com(i,j,k+1-shf,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(k)
+	         ENDIF
+	         lo_com = hi_com
+ 300	      CONTINUE
+ 310	   CONTINUE
+
+* DERIVATIVE ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      lo_com = com(i,j,k,lo_s4-shf,m,n)
+	      DO 400 l = lo_s4, hi_s4
+	         hi_com = com(i,j,k,l+1-shf,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(l)
+	         ENDIF
+	         lo_com = hi_com
+ 400	      CONTINUE
+ 410	   CONTINUE
+
+* DERIVATIVE ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      lo_com = com(i,j,k,l,lo_s5-shf,n)
+	      DO 500 m = lo_s5, hi_s5
+	         hi_com = com(i,j,k,l,m+1-shf,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(m)
+	         ENDIF
+	         lo_com = hi_com
+ 500	      CONTINUE
+ 510	   CONTINUE
+
+* DERIVATIVE ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      lo_com = com(i,j,k,l,m,lo_s6-shf)
+	      DO 600 n = lo_s6, hi_s6
+	         hi_com = com(i,j,k,l,m,n+1-shf)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(m)
+	         ENDIF
+	         lo_com = hi_com
+ 600	      CONTINUE
+ 610	   CONTINUE
+
+* TODO: derivative along E and F axes?
+
+* DERIVATIVE ALONG UNSUPPORTED AXIS
+	ELSE
+           STOP '**ERROR: DD1STEP on unsupported axis'
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/dd2step.F b/fer/doo/dd2step.F
new file mode 100644
index 0000000..0257838
--- /dev/null
+++ b/fer/doo/dd2step.F
@@ -0,0 +1,257 @@
+	SUBROUTINE DD2STEP ( idim, arg, com_lo, com_hi,
+     .			     com, com_mr,
+     .			     res, res_mr, res_cx,
+     .			     box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute centered derivative of component along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V230: 5/6/92 - COS correction checks that J location is defined         
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       2/12 *kms* Include E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	idim, com_lo, com_hi, com_mr, com_cx, res_mr, res_cx
+	REAL	arg,
+     .		box( com_lo:com_hi ),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	GEOG_COS_FACTOR, need_cos
+	INTEGER i, j, k, l, m, n, ii, grid,
+     .          lo_sub(nferdims), hi_sub(nferdims), axis
+	REAL	bad_com, bad_res, lo_com, hi_com, unit, cos_factor,
+     .          ybxlo, ybxhi, bx
+	REAL*8	TM_WORLD, lo_ww, hi_ww
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	grid    = mr_grid( res_mr )
+	axis    = grid_line( idim, grid )
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_sub(idim) = com_lo + 1 
+	hi_sub(idim) = com_hi - 1
+
+* create an array of delta H increments
+	DO 20 ii = lo_sub(idim), hi_sub(idim)
+	   lo_ww = TM_WORLD( ii-1, grid, idim, box_middle )
+	   hi_ww = TM_WORLD( ii+1, grid, idim, box_middle )
+	   box(ii) = hi_ww - lo_ww
+ 20	CONTINUE	   
+
+* perform differentiation in standard units if possible
+	unit = un_convert( line_unit_code(axis) )
+	DO 30 ii = lo_sub(idim), hi_sub(idim)
+ 30	box(ii) = box(ii) * unit
+
+* DERIVATIVE ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   need_cos = GEOG_COS_FACTOR( idim, grid )
+     .                .AND. lo_s2.NE.unspecified_int4
+	   DO 110 j = lo_s2, hi_s2
+	   IF ( need_cos ) THEN
+#ifdef double_p
+	      cos_factor = COS( deg2rad *       
+     .            TM_WORLD(j, grid, y_dim, box_middle) ) 
+              ybxlo = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_lo_lim)
+              ybxhi = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_hi_lim)
+#else
+	      cos_factor = COS( deg2rad *       
+     .            SNGL( TM_WORLD(j, grid, y_dim, box_middle) ) ) 
+              ybxlo = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_hi_lim) )
+#endif
+              bx = ABS(ybxhi - ybxlo)
+	      cos_factor = ABS( SIN(ybxhi) - SIN(ybxlo) )/ bx
+	   ENDIF
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	      DO 100 i = lo_s1, hi_s1
+	         lo_com = com(i-1,j,k,l,m,n)
+	         hi_com = com(i+1,j,k,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(i)
+	            IF ( need_cos )
+     .                 res(i,j,k,l,m,n) = res(i,j,k,l,m,n)/cos_factor
+	         ENDIF
+ 100	      CONTINUE
+ 110	   CONTINUE
+
+* DERIVATIVE ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+	      DO 200 j = lo_s2, hi_s2
+	         lo_com = com(i,j-1,k,l,m,n)
+	         hi_com = com(i,j+1,k,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(j)
+	         ENDIF
+ 200	      CONTINUE
+ 210	   CONTINUE
+
+* DERIVATIVE ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      DO 300 k = lo_s3, hi_s3
+	         lo_com = com(i,j,k-1,l,m,n)
+	         hi_com = com(i,j,k+1,l,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(k)
+	         ENDIF
+ 300	      CONTINUE
+ 310	   CONTINUE
+
+* DERIVATIVE ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      DO 400 l = lo_s4, hi_s4
+	         lo_com = com(i,j,k,l-1,m,n)
+	         hi_com = com(i,j,k,l+1,m,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(l)
+	         ENDIF
+ 400	      CONTINUE
+ 410	   CONTINUE
+
+* DERIVATIVE ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      DO 500 m = lo_s5, hi_s5
+	         lo_com = com(i,j,k,l,m-1,n)
+	         hi_com = com(i,j,k,l,m+1,n)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(m)
+	         ENDIF
+ 500	      CONTINUE
+ 510	   CONTINUE
+
+* DERIVATIVE ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      DO 600 n = lo_s6, hi_s6
+	         lo_com = com(i,j,k,l,m,n-1)
+	         hi_com = com(i,j,k,l,m,n+1)
+	         IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSE
+	            res(i,j,k,l,m,n) = (hi_com-lo_com) / box(n)
+	         ENDIF
+ 600	      CONTINUE
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/diag_op.F b/fer/doo/diag_op.F
new file mode 100644
index 0000000..4a58fab
--- /dev/null
+++ b/fer/doo/diag_op.F
@@ -0,0 +1,226 @@
+	SUBROUTINE DIAG_OP( doing, act_class, cx, idim )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write a diagnostic line describing the operation in progress
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V200:  6/6/89 - extracted from IS_STRIP
+* V230: 8/22/92 - document regridding transformation
+*       11/4/92 - expanded user variable name length
+* v320:   12/94 - added modulo reading as a stack operation
+*      12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	2/21/95 - added isact_reverse 
+* V420   9/8/95 - support for implicit grid allocation/deallocation
+*	  11/95 - support for context reconciliation (isact_class_reconcile)
+*	   1/96 - bug fix: implicit grid kludge use of cx for gridnum crashes
+*		- use "strip" to determine if reconcilliation axis is relevant
+* V500 *kob* 3/99- up VAR_CODE and var decls from 8 to 64 chars
+* V510 *sh* 8/99 - added isact_class_sample
+* V541 *sh*  2/02 - added isact_class_subspan_fill
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+* v552 *acm* 4/03  up VAR_TRANS to 150 characters (variables are up to 128, plus
+*                  space for the transformation specifier)
+* V64  10/09 *acm* longer string length for grid_name: limit length written to diag output
+* V680  5/12 *acm* Add dataset ID to diagnostic output
+* V680  6/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If cancelled, the 
+*                 output will not list info for E,F dimensions.
+* V690  1/14 *sh* report 3-argument var-getting operation
+
+* calling argument declarations:
+        IMPLICIT NONE
+	INTEGER	act_class, idim, cx
+	CHARACTER*(*) doing
+
+* internal variable declarations:
+	INTEGER	  TM_LENSTR1, slen, clen, ii, i, listdims
+	CHARACTER*128 VAR_CODE,  var
+	CHARACTER*150 VAR_TRANS, out_buff
+
+	include	'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+        include 'xalgebra.cmn'
+	include 'xrisc.cmn'		! 12/94 SPLIT_LIST buffer
+
+* If mode 6d_lab has been cancelled, we will list info only for 
+* the first 4 dimensions.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+
+* initialize
+! 1/96 - kludge of using cx for grid # causes this extra IF -- awful!
+	IF( act_class .NE. isact_class_impl_grid ) THEN
+	   var = VAR_CODE( cx_category(cx), cx_variable(cx) )
+           slen = TM_LENSTR1( var )
+	ENDIF
+
+* TRANSFORMATION
+* output: "VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	risc_buff = ' '
+	IF ( act_class .EQ. isact_class_trans ) THEN
+	   out_buff = VAR_TRANS(idim,cx,slen)
+	   WRITE( risc_buff, 3010 ) doing, out_buff(:slen)
+ 3010      FORMAT (1X,A5,' --> ',A)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* REGRIDDING
+	ELSEIF( act_class .EQ. isact_class_regrid ) THEN
+	   WRITE ( risc_buff, 3020 ) doing, ww_dim_name(idim),
+     .		       var(1:slen), grid_name(cx_grid(cx))(:16),
+     .                 alg_regrid_code(cx_regrid_trans(idim,cx))
+ 3020	   FORMAT (1X,A5,' regrid on ',A1,': ',A,' --> ',A,' @',A)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* SPLITTING/GATHERING
+	ELSEIF( act_class .EQ. isact_class_gather ) THEN
+	   WRITE ( risc_buff, 3030 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3030	   FORMAT
+     . (1X,A5,' gathering ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* SAMPLING (SAMPLE* functions)
+	ELSEIF( act_class .EQ. isact_class_sample ) THEN
+	   WRITE ( risc_buff, 3035 ) doing, var(1:slen),
+     .                  ss_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3035	   FORMAT
+     . (1X,A5,' sampling ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* ASSEMBLING MODULO COMPONENTS
+	ELSEIF( act_class .EQ. isact_class_modulo ) THEN
+	   WRITE ( risc_buff, 3040 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3040	   FORMAT 
+     . (1X,A5,' moduloing ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* reversed axis reads
+	ELSEIF( act_class .EQ. isact_class_reverse ) THEN
+	   WRITE ( risc_buff, 3050 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3050	   FORMAT
+     . (1X,A5,' reversing ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* implicit grid allocation/deallocation
+	ELSEIF( act_class .EQ. isact_class_impl_grid ) THEN
+* ... special case: "cx" is actually the grid number !!!
+	   DO 500 ii = 1, listdims
+	      i = grid_line(ii,cx)
+	      IF ( i .GT. 0 ) THEN
+	         WRITE (out_buff((ii-1)*10+1:ii*10),'(A)') line_name(i)(:10)
+	      ELSEIF ( i .EQ. 0 ) THEN
+	         WRITE (out_buff((ii-1)*10+1:ii*10),'(A)') 'NORMAL    '
+	      ELSE
+	         out_buff((ii-1)*10+1:ii*10) = '(invalid) '
+	      ENDIF
+ 500	   CONTINUE
+	   WRITE ( risc_buff, 3060 ) doing, grid_name(cx)(:16), 
+     .	           out_buff(:60)
+ 3060	   FORMAT (1X,A,' dynamic grid ',2A)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+	ELSEIF( act_class .EQ. isact_class_reconcile ) THEN
+	   IF ( doing .EQ. 'strip' ) THEN
+* ... idim has no meaningful value when stripping reconciliation
+	      out_buff = ' '
+	      clen = 1
+	   ELSE
+	      out_buff = ' on '//ww_dim_name(idim)//' axis'
+	      clen = 10
+	   ENDIF
+	   WRITE ( risc_buff, 3070 ) doing, out_buff(:clen),
+     .				     var(1:slen)
+ 3070	   FORMAT (1X,A5,' limits reconciliation',A,': ',A)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* subspan modulo axis void filling
+	ELSEIF( act_class .EQ. isact_class_subspan_fill ) THEN
+	   WRITE ( risc_buff, 3080 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3080	   FORMAT 
+     . (1X,A5,' modulo-void-filling ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+
+* SPLITTING/GATHERING
+	ELSEIF( act_class .EQ. isact_class_aggregate_gather ) THEN
+	   WRITE ( risc_buff, 3090 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3090	   FORMAT
+     . (1X,A5,' aggregate gathering ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+* getting arguments needed for curvilinear plotting
+	ELSEIF( act_class .EQ. isact_class_aux_plot_vars ) THEN
+	   WRITE ( risc_buff, 3100 ) doing, var(1:slen),
+     .                  ww_dim_name( idim ),
+     .			cx_lo_ss(cx,idim), cx_hi_ss(cx,idim),
+     .			cx_data_set(cx)
+ 3100	   FORMAT
+     . (1X,A5,' getting aux vars ',A,' on ',A1,' axis:',2I6,' dset:',I4)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+
+	ELSE
+	   CALL WARN( 'CORRUPTION!  unkn_act_cls' )
+
+	ENDIF
+
+	RETURN
+	END
+
+
diff --git a/fer/doo/do_4d_ave.F b/fer/doo/do_4d_ave.F
new file mode 100644
index 0000000..4e20f2e
--- /dev/null
+++ b/fer/doo/do_4d_ave.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_AVE(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V430: 7/96
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_ave,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_AVE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_4d_int_def.F b/fer/doo/do_4d_int_def.F
new file mode 100644
index 0000000..0b5f782
--- /dev/null
+++ b/fer/doo/do_4d_int_def.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_INT_DEF(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V430: 7/96
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_int_def,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_INT_DEF = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_4d_nbd.F b/fer/doo/do_4d_nbd.F
new file mode 100644
index 0000000..a17c868
--- /dev/null
+++ b/fer/doo/do_4d_nbd.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_NBD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V430: 7/96
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_bad_pt,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_NBD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_4d_ngd.F b/fer/doo/do_4d_ngd.F
new file mode 100644
index 0000000..85a6025
--- /dev/null
+++ b/fer/doo/do_4d_ngd.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_NGD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V430: 7/96
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_good_pt,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_NGD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_4d_string_goodbad.F b/fer/doo/do_4d_string_goodbad.F
new file mode 100644
index 0000000..e9fe608
--- /dev/null
+++ b/fer/doo/do_4d_string_goodbad.F
@@ -0,0 +1,224 @@
+	SUBROUTINE DO_4D_STRING_GOODBAD( trans,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx, arg )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a multi-axis transformation
+
+* multi-axis transformations are those special cases where sequential
+* application of single-axis transforms may yield improper results. For
+* example, averaging within a circular region would give inappropriate
+* results if carried out sequentially: the first axis of averaging would
+* be correct but the second axis would weight each averaged row from the
+* first axis equally, despite the fact that they represented different
+* numbers of data points.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* Compute NGD NBD for string variables.
+*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* internal variable declarations:
+	LOGICAL point, yes_ax(nferdims), no_ax(nferdims),
+     .	        at_ave, at_var, at_din, at_nbd, at_ngd
+	INTEGER idim, i, j, ir, jr, kr, lr, mr, nr,
+     .	        ic, jc, kc, lc, mc, nc, nbd, ngd,
+     .	        com_lo(nferdims), com_hi(nferdims),
+     .	        ind_lo, ind_hi
+	REAL    bad_com, bad_res
+
+* calling argument declarations:
+	INTEGER trans, com_mr, com_cx, res_mr, res_cx
+	REAL*8  com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+	REAL    arg,
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* equivalences
+	LOGICAL yes_xax, yes_yax, yes_zax,
+     .          yes_tax, yes_eax, yes_fax,
+     .          no_xax,  no_yax,  no_zax,
+     .          no_tax,  no_eax,  no_fax
+
+	INTEGER GET_C_STRING_LEN, slen, 
+     .		i_lo, j_lo, k_lo, l_lo, m_lo, n_lo,
+     .		i_hi, j_hi, k_hi, l_hi, m_hi, n_hi
+
+	EQUIVALENCE ( yes_ax(1), yes_xax ),
+     .		    ( yes_ax(2), yes_yax ),
+     .		    ( yes_ax(3), yes_zax ),
+     .		    ( yes_ax(4), yes_tax ),
+     .		    ( yes_ax(5), yes_eax ),
+     .		    ( yes_ax(6), yes_fax ),
+     .		    (  no_ax(1),  no_xax ),
+     .		    (  no_ax(2),  no_yax ),
+     .		    (  no_ax(3),  no_zax ),
+     .		    (  no_ax(4),  no_tax ),
+     .		    (  no_ax(5),  no_eax ),
+     .		    (  no_ax(6),  no_fax ),
+     .		    (  com_lo(1),  i_lo ),
+     .		    (  com_lo(2),  j_lo ),
+     .		    (  com_lo(3),  k_lo ),
+     .		    (  com_lo(4),  l_lo ),
+     .		    (  com_lo(5),  m_lo ),
+     .		    (  com_lo(6),  n_lo ),
+     .		    (  com_hi(1),  i_hi ),
+     .		    (  com_hi(2),  j_hi ),
+     .		    (  com_hi(3),  k_hi ),
+     .		    (  com_hi(4),  l_hi ),
+     .		    (  com_hi(5),  m_hi ),
+     .		    (  com_hi(6),  n_hi )
+
+* --- end of introductory code ---
+
+* initialize
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+	at_nbd = trans .EQ. trans_4d_bad_pt
+	at_ngd = trans .EQ. trans_4d_good_pt
+
+* determine the axes to be transforomed
+	DO 10 idim = 1, nferdims
+	  yes_ax(idim) = cx_trans(idim,res_cx) .EQ. trans
+	  no_ax (idim) = .NOT. yes_ax(idim)
+ 10	CONTINUE
+
+* do the transformation:  ngood, nbad only
+* Write a note about missing values of strings 
+
+	IF (at_ngd) THEN
+	   CALL WARN
+     .    ('@NGD of string variable, counting null strings as missing')
+	ELSEIF (at_nbd) THEN
+	   CALL WARN
+     .    ('@NBD of string variable, counting null strings as missing')
+	ENDIF
+
+* Note: the looping structure allows a possible mix of axis transforms
+*	to be performed in a single framework
+* ... set up default limits (com_lo, com_hi) in preparation for the inner loop
+* "r" refers to result, "c" refers to component
+
+* Set the range of loop indices for the component data on the transformed axes
+	DO 150 idim = 1, nferdims
+	  IF (yes_ax(idim)) THEN
+	    com_lo(idim) = cx_lo_ss(com_cx,idim)
+	    com_hi(idim) = cx_hi_ss(com_cx,idim)
+	  ENDIF
+ 150	CONTINUE
+
+
+* LOOP OVER THE FULL RANGE OF THE RESULT
+* ... also set up loop indices for non-transformed axes
+*     (component loop to include only the single result point on "no" axes)
+	DO 300 nr = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	IF (no_fax) THEN
+	   n_lo = nr
+	   n_hi = nr
+	ENDIF
+	DO 300 mr = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	IF (no_eax) THEN
+	   m_lo = mr
+	   m_hi = mr
+	ENDIF
+	DO 300 lr = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	IF (no_tax) THEN
+	   l_lo = lr
+	   l_hi = lr
+	ENDIF
+	DO 300 kr = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	IF (no_zax) THEN
+	  k_lo = kr
+	  k_hi = kr
+	ENDIF
+	DO 300 jr = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	IF (no_yax) THEN
+	  j_lo = jr
+	  j_hi = jr
+	ENDIF
+	DO 300 ir = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+	IF (no_xax) THEN
+	  i_lo = ir
+	  i_hi = ir
+	ENDIF
+
+* initialize the inner loop accumulators
+
+	  ngd  = 0
+	  nbd  = 0
+
+* now loop over the component data accumulating results along relevant axes
+
+	  DO 210 nc = n_lo, n_hi
+	  DO 210 mc = m_lo, m_hi
+	  DO 210 lc = l_lo, l_hi
+	  DO 210 kc = k_lo, k_hi
+	  DO 210 jc = j_lo, j_hi
+	  DO 210 ic = i_lo, i_hi
+             slen = GET_C_STRING_LEN(com(ic,jc,kc,lc,mc,nc))
+             IF ( slen .GT. 0 ) THEN
+                ngd = ngd + 1
+             ELSE
+                nbd = nbd + 1
+             ENDIF
+ 210	  CONTINUE
+
+* compute result from accumulators
+	  IF (at_ngd) THEN
+	     res(ir,jr,kr,lr,mr,nr) = ngd
+	  ELSEIF (at_nbd) THEN
+	     res(ir,jr,kr,lr,mr,nr) = nbd
+	  ENDIF
+
+ 300	CONTINUE
+
+	RETURN
+ 
+	END
+
diff --git a/fer/doo/do_4d_string_trans.F b/fer/doo/do_4d_string_trans.F
new file mode 100644
index 0000000..296fd8b
--- /dev/null
+++ b/fer/doo/do_4d_string_trans.F
@@ -0,0 +1,87 @@
+	INTEGER FUNCTION DO_4D_STRING_TRANS (	trans,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx, arg)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_STRING_GOODBAD with the appropriate transformation
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* From DO_4D_NBD
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	trans, com_mr, com_cx, res_mr, res_cx
+	REAL*8  com
+	REAL	res, arg
+
+* internal variable declarations:
+        LOGICAL at_ok
+	INTEGER	CX_DIM_LEN, idim, status
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* determine the type of transform requested
+	
+	at_ok = (trans .EQ. trans_4d_bad_pt) .OR. 
+     .          (trans .EQ. trans_4d_good_pt)
+	IF (.NOT. at_ok) GOTO 5010
+
+* pass the transform to be performed
+
+	CALL DO_4D_STRING_GOODBAD(   trans,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx, arg )
+
+	DO_4D_STRING_TRANS = ferr_ok
+
+ 5000	RETURN
+
+ 5010	DO_4D_STRING_TRANS = ferr_data_type
+        CALL ERRMSG( ferr_data_type, status, 
+     .  'Only NGD or NBD transforms allowed for string data', *5000 )
+	END
diff --git a/fer/doo/do_4d_sum.F b/fer/doo/do_4d_sum.F
new file mode 100644
index 0000000..3b2c6d2
--- /dev/null
+++ b/fer/doo/do_4d_sum.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_SUM(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* v6.66 ACM 11/10
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_sum,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_SUM = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_4d_trans.F b/fer/doo/do_4d_trans.F
new file mode 100644
index 0000000..5d81d55
--- /dev/null
+++ b/fer/doo/do_4d_trans.F
@@ -0,0 +1,478 @@
+	SUBROUTINE DO_4D_TRANS( action,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx,
+     .				boxes )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a multi-axis transformation
+
+* multi-axis transformations are those special cases where sequential
+* application of single-axis transforms may yield improper results. For
+* example, averaging within a circular region would give inappropriate
+* results if carried out sequentially: the first axis of averaging would
+* be correct but the second axis would weight each averaged row from the
+* first axis equally, despite the fact that they represented different
+* numbers of data points.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V430: 7/1/96 - based on DO_XY_AVE_INT
+* ... comments from DO_XY_AVE_INT:
+* V200:  6/5/89
+*       10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V230: 8/10/92  - results were wrong for integration within a single box
+* V430: 7/30/96 - IBM port - change yes/no_[xyzt]ax declaration from
+*	          INTEGER to LOGICAL *kob*
+* V440: 8/23/96 - added cos_factor, was not applying COS(lat) to XZ calcs
+* V450: 5/97 -  only apply COS(y) if X integration is involved and Y axis
+*		limits are valid (abstract expressions like Z[G=temp] can
+*		have a geog Y axis that is not actually used
+* 3/06 - apply Andrew*s suggested correction for XY integ., bug1348
+* 6/06 - Fix to Andrew*s correction for XY integ., bug1348
+* 4/10 - Fix #1735; For averages other than in Y direction the above fix 
+*        failed to set ybox sizes and cos correction. Still need to set these.
+* 8/10 - One further fix to #1735
+* 2/11 - One further fix to #1348: @DIN over 1 grid cell in Y
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 *acm* 7/13  Fix ticket 2083: single-y and multi-D transform
+* V685+*acm* 12/13 Bug in y boxes; only when y axis in the transf.
+
+	IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* internal variable declarations:
+	LOGICAL GEOG_COS_FACTOR, point, yes_ax(nferdims), no_ax(nferdims),
+     .		at_ave, at_var, at_din, at_nbd, at_ngd, at_sum, short_comp,
+     .		need_cos, one_y
+	INTEGER idim, i, j, ir, jr, kr, lr, mr, nr, ic, jc, kc, lc, mc, nc,
+     .		grid, nbd, ngd, com_lo(nferdims), com_hi(nferdims),
+     .		box_offset(nferdims), offset, ind_lo, ind_hi, cos_offset
+	REAL	BOX_SIZE, unit, bad_com, bad_res, box, mean, diff,
+     .		xbox, ybox, zbox, tbox, ebox, fbox,
+     .		yc, yh, yh_2, bb, ybxlo, ybxhi
+	REAL*8	TM_WORLD, dsum, bsum
+
+* calling argument declarations:
+	INTEGER	action, com_mr, com_cx, res_mr, res_cx
+	REAL    com ( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .                m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res ( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .                m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		boxes(*)
+
+* equivalences
+	LOGICAL yes_xax, yes_yax, yes_zax,
+     .          yes_tax, yes_eax, yes_fax,
+     .          no_xax,  no_yax,  no_zax,
+     .          no_tax,  no_eax,  no_fax
+
+     	INTEGER	ioffset, joffset, koffset, loffset, moffset, noffset,
+     .		i_lo, j_lo, k_lo, l_lo, m_lo, n_lo,
+     .		i_hi, j_hi, k_hi, l_hi, m_hi, n_hi
+
+	EQUIVALENCE ( yes_ax(1), yes_xax ),
+     .		    ( yes_ax(2), yes_yax ),
+     .		    ( yes_ax(3), yes_zax ),
+     .		    ( yes_ax(4), yes_tax ),
+     .		    ( yes_ax(5), yes_eax ),
+     .		    ( yes_ax(6), yes_fax ),
+     .		    (  no_ax(1),  no_xax ),
+     .		    (  no_ax(2),  no_yax ),
+     .		    (  no_ax(3),  no_zax ),
+     .		    (  no_ax(4),  no_tax ),
+     .		    (  no_ax(5),  no_eax ),
+     .		    (  no_ax(6),  no_fax ),
+     .		    ( box_offset(1), ioffset ),
+     .		    ( box_offset(2), joffset ),
+     .		    ( box_offset(3), koffset ),
+     .		    ( box_offset(4), loffset ),
+     .		    ( box_offset(5), moffset ),
+     .		    ( box_offset(6), noffset ),
+     .		    (  com_lo(1),  i_lo ),
+     .		    (  com_lo(2),  j_lo ),
+     .		    (  com_lo(3),  k_lo ),
+     .		    (  com_lo(4),  l_lo ),
+     .		    (  com_lo(5),  m_lo ),
+     .		    (  com_lo(6),  n_lo ),
+     .		    (  com_hi(1),  i_hi ),
+     .		    (  com_hi(2),  j_hi ),
+     .		    (  com_hi(3),  k_hi ),
+     .		    (  com_hi(4),  l_hi ),
+     .		    (  com_hi(5),  m_hi ),
+     .		    (  com_hi(6),  n_hi )
+
+* --- end of introductory code ---
+
+* initialize
+	grid = mr_grid( com_mr )
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+        point = .FALSE.
+	one_y = .FALSE.
+
+* determine the type of transform requested
+	at_ave = action .EQ. trans_4d_ave
+	at_var = action .EQ. trans_4d_var
+	at_din = action .EQ. trans_4d_int_def
+	at_nbd = action .EQ. trans_4d_bad_pt
+	at_ngd = action .EQ. trans_4d_good_pt
+	at_sum = action .EQ. trans_4d_sum
+	short_comp = at_ngd .OR. at_nbd	.OR. at_sum	! for speed, only
+
+* determine the axes to be transformed
+	DO 10 idim = 1, nferdims
+	  yes_ax(idim) = cx_trans(idim,res_cx) .EQ. action
+	  no_ax (idim) = .NOT.yes_ax(idim)
+ 10	CONTINUE
+
+* get and save grid box sizes (weights) just once for efficiency
+* ... save all 4 axes in one long array with offsets to find the starts
+* Note that "cx_lo_ss(com_cx,idim)" is subtracted so offsets pre-compensate
+*    for the axes starting above index = 1
+
+      IF (.NOT. short_comp) THEN  ! boxes are not needed for ngd, nbd, sum.
+	offset = 0
+	DO 90 idim = 1, nferdims
+	  IF (yes_ax(idim)) THEN
+	    box_offset(idim) = offset - cx_lo_ss(com_cx,idim) + 1 ! pre-comp'ed
+	    offset = offset + 
+     .	             cx_hi_ss(com_cx,idim)-cx_lo_ss(com_cx,idim)+1
+	  ELSE
+	    box_offset(idim) = -9999
+	  ENDIF
+ 90	CONTINUE
+! COS(latitudes) also stored in the box array (8/96)
+	cos_offset = offset - cx_lo_s2(com_cx) + 1
+
+* ... save the box sizes
+	DO 100 idim = 1, nferdims
+	  ind_lo = cx_lo_ss(com_cx,idim)
+	  ind_hi = cx_hi_ss(com_cx,idim)
+	  offset = box_offset(idim)
+	  IF (yes_ax(idim)) THEN
+            IF ( ind_lo .EQ. ind_hi ) THEN    ! 8/92
+              boxes(ind_lo+offset) = cx_hi_ww(idim,res_cx)
+     .				 - cx_lo_ww(idim,res_cx)
+              point = point  .OR.   boxes(ind_lo+offset) .EQ. 0.0
+            ELSE
+* ... partial box at lower end
+	      boxes(ind_lo+offset) = TM_WORLD(ind_lo, grid, idim, box_hi_lim)
+     .				 - cx_lo_ww(idim,res_cx)
+
+* ... complete boxes mid-axis
+	      DO 40 i = ind_lo+1, ind_hi-1
+ 40	      boxes(i+offset)  = BOX_SIZE( i, grid, idim )
+* ... partial box at upper end
+	      boxes(ind_hi+offset) = cx_hi_ww(idim,res_cx)
+     .		   - TM_WORLD(ind_hi, grid, idim, box_lo_lim)
+            ENDIF
+* ... perform integrations on standard units if possible
+            unit = 1.
+	    IF ( at_din ) THEN
+	      unit = un_convert( line_unit_code(grid_line(idim,grid)) )
+	      DO 50 i = ind_lo, ind_hi
+ 	      boxes(i+offset) = boxes(i+offset) * unit
+ 50           continue
+	    ENDIF
+	  ENDIF
+ 100	CONTINUE
+
+* impose cosine factors if latitude and longitude are involved
+* 5/97 - only use COS(y) if X integration is involved and Y axis lims are VALID
+* 3/06 - apply Andrew*s suggested correction for XY integ., bug1348
+* 6/06   fix the correction; boxes(i+offset) is in meters, so convert back to 
+*        degrees, then radians. Compute the factor, and then convert to meters.
+C See this thread:
+C http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00506.html
+C And also ticket 1348. The surface area of sphere depends only on h
+C http://mathworld.wolfram.com/Zone.html. Fix for @DIN too.
+
+	need_cos = GEOG_COS_FACTOR( y_dim,grid )
+     .		.AND. yes_xax
+     .	 	.AND. cx_lo_s2(com_cx) .NE. unspecified_int4
+        IF ( at_sum ) need_cos = .FALSE.
+        one_y = (cx_lo_ww(y_dim,res_cx) .EQ. cx_hi_ww(y_dim,res_cx))
+
+	IF ( need_cos ) THEN
+	   DO 120 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+
+C Compute the y boxes if there is a y axis; the computation may be 
+C avgs in other directions but we need the ybox size at a given y
+C The top and bottom boxes extend only to the coordinate locations,
+C (Unless there is just one grid cell in the y direction.)
+
+#ifdef double_p
+	      ybxlo = deg2rad* 
+     .                TM_WORLD(j, grid, y_dim, box_lo_lim)
+	      ybxhi = deg2rad* 
+     .                TM_WORLD(j, grid, y_dim, box_hi_lim)
+#else
+	      ybxlo = deg2rad* 
+     .                SNGL( TM_WORLD(j, grid, y_dim, box_lo_lim) )
+	      ybxhi = deg2rad* 
+     .                SNGL( TM_WORLD(j, grid, y_dim, box_hi_lim) )
+#endif
+	      IF (j .EQ. cx_lo_s2(com_cx) .AND. .NOT.one_y)
+     .                ybxlo = deg2rad* cx_lo_ww(y_dim,res_cx)
+
+	      IF (j .EQ. cx_hi_s2(com_cx) .AND. .NOT.one_y)
+     .                ybxhi = deg2rad* cx_hi_ww(y_dim,res_cx)
+
+	      boxes(j+cos_offset) = ABS( SIN(ybxhi) - SIN(ybxlo) )
+
+	      ! surface area of sphere depends only on h not on ybox
+	      IF (.NOT.at_din .AND. yes_ax(y_dim)) boxes(j+box_offset(y_dim)) = 1.  
+
+	      ! for integral need area is radius*radius* delx * h
+	      ! delx already has units that include radius of earth.
+	      IF ( at_din .AND. yes_ax(y_dim) ) then
+ 		       boxes(j+box_offset(y_dim)) =  m_radius 
+	      ENDIF
+	      ! Single-point Y axis or Y not part of the integral
+
+#ifdef double_p
+	      IF ( at_din .AND. no_ax(y_dim))
+     .           boxes(j+cos_offset) = COS( deg2rad * 
+     .             TM_WORLD(j,grid,y_dim,box_middle) )
+#else
+	      IF ( at_din .AND. no_ax(y_dim))
+     .           boxes(j+cos_offset) = COS( deg2rad * 
+     .           SNGL( TM_WORLD(j,grid,y_dim,box_middle) ) )
+#endif
+ 120       CONTINUE
+	ELSE
+	      DO 121 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+ 121	      boxes(j+cos_offset)  = 1.0
+	ENDIF
+
+      ENDIF  ! skipped computing boxes for short_comp
+
+* do the transformation: average, integration, variance, ngood, nbad, ...
+
+* Note: the looping structure allows all possible mixes of axis transforms
+*	to be performed in a single framework
+* ... set up default limits (com_lo, com_hi) in preparation for the inner loop
+* "r" refers to result, "c" refers to component
+
+* Set the range of loop indices for the component data on the transformed axes
+	DO 150 idim = 1, nferdims
+	  IF (yes_ax(idim)) THEN
+	    com_lo(idim) = cx_lo_ss(com_cx,idim)
+	    com_hi(idim) = cx_hi_ss(com_cx,idim)
+	  ENDIF
+ 150	CONTINUE
+
+* Set default box size for untransformed axes
+* (multiplying  by 1.0 to have nil effect)
+	xbox = 1.0
+	ybox = 1.0
+	zbox = 1.0
+	tbox = 1.0
+	ebox = 1.0
+	fbox = 1.0
+
+* LOOP OVER THE FULL RANGE OF THE RESULT
+* ... also set up loop indices for non-transformed axes
+*     (component loop to include only the single result point on "no" axes)
+	DO 300 nr = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	IF (no_fax) THEN
+	   n_lo = nr
+	   n_hi = nr
+	ENDIF
+	DO 300 mr = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	IF (no_eax) THEN
+	   m_lo = mr
+	   m_hi = mr
+	ENDIF
+	DO 300 lr = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	IF (no_tax) THEN
+	   l_lo = lr
+	   l_hi = lr
+	ENDIF
+	DO 300 kr = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	IF (no_zax) THEN
+	  k_lo = kr
+	  k_hi = kr
+	ENDIF
+	DO 300 jr = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	IF (no_yax) THEN
+	  j_lo = jr
+	  j_hi = jr
+	ENDIF
+	DO 300 ir = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+	IF (no_xax) THEN
+	  i_lo = ir
+	  i_hi = ir
+	ENDIF
+
+* pathological case: world coordinate range of zero along an xform axis
+
+          IF ( point ) THEN    ! 8/92
+            nc = n_lo
+            mc = m_lo
+            lc = l_lo
+            kc = k_lo
+            jc = j_lo
+            ic = i_lo
+
+	    IF (at_din) THEN
+               IF (com(ic,jc,kc,lc,mc,nc) .EQ. bad_com) THEN
+                  res(ir,jr,kr,lr,mr,nr) = bad_res
+               ELSE
+                  res(ir,jr,kr,lr,mr,nr) = 0.0
+	       ENDIF
+            ELSE
+               res(ir,jr,kr,lr,mr,nr) = bad_res
+            ENDIF
+            GOTO 300
+          ENDIF
+
+* initialize the inner loop accumulators
+	  dsum = 0.0D0	! data
+	  bsum = 0.0D0	! boxes
+	  ngd  = 0
+	  nbd  = 0
+
+* now loop over the component data accumulating results along relevant axes
+* ... two separate loops for efficiency, only -- keep @ngd and @nbd fast
+
+
+	  IF (short_comp) THEN
+
+	    DO 210 nc = n_lo, n_hi
+	    DO 210 mc = m_lo, m_hi
+	    DO 210 lc = l_lo, l_hi
+	    DO 210 kc = k_lo, k_hi
+	    DO 210 jc = j_lo, j_hi
+	    DO 210 ic = i_lo, i_hi
+
+	      IF ( com(ic,jc,kc,lc,mc,nc) .EQ. bad_com ) THEN
+	        nbd = nbd + 1
+	      ELSE
+	        ngd = ngd + 1
+		IF (at_sum) dsum = dsum + com(ic,jc,kc,lc,mc,nc)
+	      ENDIF
+
+ 210	    CONTINUE
+
+	  ELSE
+
+	    DO 220 nc = n_lo, n_hi
+	    IF (yes_fax) fbox = boxes(nc+noffset)
+	    DO 220 mc = m_lo, m_hi
+	    IF (yes_eax) ebox = boxes(mc+moffset)
+	    DO 220 lc = l_lo, l_hi
+	    IF (yes_tax) tbox = boxes(lc+loffset)
+	    DO 220 kc = k_lo, k_hi
+	    IF (yes_zax) zbox = boxes(kc+koffset)
+	    DO 220 jc = j_lo, j_hi
+	    IF (yes_yax) ybox = boxes(jc+joffset)
+	    DO 220 ic = i_lo, i_hi
+	    IF (yes_xax) xbox = boxes(ic+ioffset)
+
+	      IF ( com(ic,jc,kc,lc,mc,nc) .NE. bad_com ) THEN
+	        box = xbox * ybox * zbox * tbox * ebox * fbox
+	        IF (need_cos) box = box * boxes(jc+cos_offset)
+	        bsum = bsum + box
+	        dsum = dsum + box*com(ic,jc,kc,lc,mc,nc)
+	      ENDIF
+
+ 220	    CONTINUE
+
+! for variance calculation, only: a 2nd pass ...
+	    IF ( at_var ) THEN
+	      IF (bsum .NE. 0.0D0) THEN
+	        mean = dsum / bsum
+	        dsum = 0.0D0
+	        DO 230 nc = n_lo, n_hi
+	        IF (yes_fax) fbox = boxes(nc+noffset)
+	        DO 230 mc = m_lo, m_hi
+	        IF (yes_eax) ebox = boxes(mc+moffset)
+	        DO 230 lc = l_lo, l_hi
+	        IF (yes_tax) tbox = boxes(lc+loffset)
+	        DO 230 kc = k_lo, k_hi
+	        IF (yes_zax) zbox = boxes(kc+koffset)
+	        DO 230 jc = j_lo, j_hi
+	        IF (yes_yax) ybox = boxes(jc+joffset)
+	        DO 230 ic = i_lo, i_hi
+	        IF (yes_xax) xbox = boxes(ic+ioffset)
+
+	          IF ( com(ic,jc,kc,lc,mc,nc) .NE. bad_com ) THEN
+	            box = xbox * ybox * zbox * tbox * ebox * fbox
+	            IF (need_cos) box = box * boxes(jc+cos_offset)
+	            diff = com(ic,jc,kc,lc,mc,nc) - mean
+	            dsum = dsum + box*diff*diff
+	          ENDIF
+
+ 230	        CONTINUE
+	      ENDIF
+	    ENDIF
+
+	  ENDIF
+
+* compute result from accumulators
+	  IF (at_ngd) THEN
+	     res(ir,jr,kr,lr,mr,nr) = ngd
+	  ELSEIF (at_nbd) THEN
+	     res(ir,jr,kr,lr,mr,nr) = nbd
+	  ELSEIF (at_sum .AND. ngd.GT.0) THEN
+	     res(ir,jr,kr,lr,mr,nr) = dsum
+          ELSEIF ( bsum .EQ. 0.0D0 ) THEN
+	     res(ir,jr,kr,lr,mr,nr) = bad_res
+	  ELSEIF (at_din) THEN
+	     res(ir,jr,kr,lr,mr,nr) = dsum
+	  ELSE
+	     res(ir,jr,kr,lr,mr,nr) = dsum/bsum	! average or variance
+	  ENDIF
+
+ 300	CONTINUE
+
+	RETURN
+
+	END
+
diff --git a/fer/doo/do_4d_var.F b/fer/doo/do_4d_var.F
new file mode 100644
index 0000000..8a6059f
--- /dev/null
+++ b/fer/doo/do_4d_var.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_4D_VAR(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					boxes	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call DO_4D_TRANS with the appropriate transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V430: 7/96
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), boxes(*)
+
+* internal variable declarations:
+	INTEGER	CX_DIM_LEN
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* pass the transform to be performed
+	CALL DO_4D_TRANS(   trans_4d_var,
+     .			    com, com_mr, com_cx,
+     .			    res, res_mr, res_cx,
+     .			    boxes )
+
+	DO_4D_VAR = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_asn_regrid.F b/fer/doo/do_asn_regrid.F
new file mode 100644
index 0000000..2478e1a
--- /dev/null
+++ b/fer/doo/do_asn_regrid.F
@@ -0,0 +1,66 @@
+	SUBROUTINE DO_ASN_REGRID( cx_lims, axis, src, msrc, dst, mdst )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a regridding by "association"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  8/22/92
+* V533:  6/01 *sh* - added string regridding
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst
+	REAL	src(*), dst(*)
+
+	IF ( cx_type(cx_lims) .EQ. ptype_string ) THEN
+	   CALL ASN_PTR_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst )
+	ELSE
+	   CALL ASN_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst )
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/doo/do_aux_var_regrid.F b/fer/doo/do_aux_var_regrid.F
new file mode 100644
index 0000000..b38ab0c
--- /dev/null
+++ b/fer/doo/do_aux_var_regrid.F
@@ -0,0 +1,92 @@
+	SUBROUTINE DO_AUX_VAR_REGRID( memory, axis_list, naxis, aux_has_cell_pts,
+     .				      src,  msrc,  src_cx,
+     .				      dst,  mdst,  dst_cx,
+     .				      aux1, maux1, aux1_cx,
+     .				      aux2, maux2, aux2_cx,
+     .				      aux3, maux3, aux3_cx,
+     .				      status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a dispatch of regridding to the rountine appropriate
+! for the dimensionailty
+
+* v685 4/13 *sh*
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'errmsg.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	LOGICAL	aux_has_cell_pts
+	INTEGER	naxis, axis_list(naxis), status,
+     .		msrc, mdst, maux1, maux2, maux3,
+     .		src_cx, dst_cx, aux1_cx, aux2_cx, aux3_cx
+	REAL	memory( mem_blk_size, max_mem_blks )
+        REAL    src(*), dst(*), aux1(*), aux2(*), aux3(*)
+
+
+	IF ( naxis .EQ. 1) THEN
+* Ansley:  note that this needs to be generalized for other axes than Z
+* allocate a work arrays for a single profile of Z depths
+* nwk_dst enuf to hold a line of the destination grid
+	   IF (axis_list(1) .NE. z_dim)
+     .			CALL ERRMSG( ferr_internal, status, 'non-z aux', *5000)
+
+* do the 1D regridding using linear interpolation
+	   CALL DO_AUX_VAR_REGRID_1D(
+     .			axis_list(1), aux_has_cell_pts,
+     .			src,  msrc,  src_cx,
+     .			dst,  mdst,  dst_cx,
+     .			aux1, maux1, aux1_cx,
+     .			cx_lo_ss(src_cx,z_dim),cx_hi_ss(src_cx,z_dim),
+     .			cx_lo_ss(dst_cx,z_dim),cx_hi_ss(dst_cx,z_dim) )
+	ELSE
+*  ==> insert horizontal curvilinear regridding (naxis.EQ.2) here
+	   STOP 'do_aux_var_regrid >1d'
+	ENDIF
+
+* success
+	RETURN
+
+* error
+ 5000	RETURN
+
+	END
diff --git a/fer/doo/do_aux_var_regrid_1d.F b/fer/doo/do_aux_var_regrid_1d.F
new file mode 100644
index 0000000..dca3fab
--- /dev/null
+++ b/fer/doo/do_aux_var_regrid_1d.F
@@ -0,0 +1,275 @@
+	SUBROUTINE DO_AUX_VAR_REGRID_1D( axis, aux_has_cell_pts,
+     .				         src,  msrc, src_cx,
+     .				         dst,  mdst, dst_cx,
+     .				         pos,  mpos, pos_cx,
+     .					 kmin_src, kmax_src, 
+     .					 kmin_dst, kmax_dst ) 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a 1D regrid guided by an auxiliary variable containing coord positions
+* allow for the usual Ferret promotion of point axes to match span axes
+* where either the source data or the position field may have degenerate axes
+* (typically the position array will be degenerate in T, E and F) 
+* numerical code lifted from do_internal_gc_fcn.F, ZAXREPLACE
+* When comparing to that code
+*      dst == res
+*      src == com1
+*      pos == com2
+
+
+* v690 11/13 *sh*
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'errmsg.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	
+* calling argument declarations:
+	LOGICAL	aux_has_cell_pts
+	INTEGER	axis,
+     .		msrc, mdst, mpos, src_cx, dst_cx, pos_cx,
+     .		kmin_src, kmax_src, kmin_dst, kmax_dst
+        REAL    src( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,
+     .               m4lot:m4hit,m4loe:m4hie,m4lof:m4hif ),
+     .          dst( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,
+     .               m5lot:m5hit,m5loe:m5hie,m5lof:m5hif ),
+     .          pos( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+
+
+* internal variable declarations:
+	LOGICAL	new_aux_line, has_valid, ascending
+        INTEGER CX_DIM_LEN,
+     .          idim,
+     .          i,   j,   k,   l,   m,   n,
+     .          is,  js,  ks,  ls,  ms,  ns,
+     .          ip,  jp,  kp,  lp,  mp,  np,
+     .          si0, sj0, sk0, sl0, sm0, sn0,
+     .          pi0, pj0, pk0, pl0, pm0, pn0,
+     .          dsi, dsj, dsk, dsl, dsm, dsn,
+     .          dpi, dpj, dpk, dpl, dpm, dpn
+        INTEGER ndx_lo, wkblk, kdmax, ii, trans, klook, khiok
+        REAL    bad_src, bad_dst, bad_pos, zval, frac
+        REAL*8  TM_WORLD
+* internally declared work arrays
+	INTEGER	indices(kmin_dst:kmax_dst+1)
+	REAL	  posline(kmin_src:kmax_src),srcline(kmin_src:kmax_src),
+     .		  dstline(kmin_dst:kmax_dst),
+     .		dstcoords(kmin_dst:kmax_dst+1),coef(kmin_dst:kmax_dst+1)
+
+
+* equivalence conveniences
+* "inc" is the increments for each axis of each component
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+* "s" is the source data (src)
+* "p" is the position data (pos) 
+* "d" indicates the delta increment
+* "0" indicates the start (lo) index
+        INTEGER srcinc(nferdims), srclo(nferdims),
+     .		posinc(nferdims), poslo(nferdims)
+        EQUIVALENCE
+     .	    (srcinc(1),dsi), (srcinc(2),dsj), (srcinc(3),dsk),
+     .	    (srcinc(4),dsl), (srcinc(5),dsm), (srcinc(6),dsn),
+     .	    (posinc(1),dpi), (posinc(2),dpj), (posinc(3),dpk),
+     .	    (posinc(4),dpl), (posinc(5),dpm), (posinc(6),dpn),
+     .	    (srclo(1), si0), (srclo(2), sj0), (srclo(3), sk0),
+     .	    (srclo(4), sl0), (srclo(5), sm0), (srclo(6), sn0),
+     .	    (poslo(1), pi0), (poslo(2), pj0), (poslo(3), pk0),
+     .	    (poslo(4), pl0), (poslo(5), pm0), (poslo(6), pn0)
+
+*==========================
+
+* initialize
+* flag(s) for bad or missing values
+        bad_src = mr_bad_data( msrc )
+        bad_dst = mr_bad_data( mdst )
+        bad_pos = mr_bad_data( mpos )
+	kdmax = kmax_dst
+	trans = cx_regrid_trans(z_dim,dst_cx) !  TEMPORARY: z_dim HARD CODED!!!
+
+* compute the delta increment for each axis
+* this allows "promotion" of degenerate axes
+        DO 10 idim = 1, nferdims
+           IF ( CX_DIM_LEN(idim,src_cx) .EQ. 1 ) THEN
+              srcinc(idim) = 0
+           ELSE
+              srcinc(idim) = 1
+           ENDIF
+           IF ( CX_DIM_LEN(idim,pos_cx) .EQ. 1 ) THEN
+              posinc(idim) = 0
+           ELSE
+              posinc(idim) = 1
+           ENDIF
+ 10     CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+* NOTE: 
+        DO 20 idim = 1, nferdims
+	   srclo(idim) = cx_lo_ss(src_cx,idim) - srcinc(idim)
+	   poslo(idim) = cx_lo_ss(pos_cx,idim) - posinc(idim)
+ 20	CONTINUE
+
+* extract the list of target coordinates
+	IF (trans .EQ. pauxrgrd_linear ) THEN
+	   DO 30 k = kmin_dst, kmax_dst
+              dstcoords(k) = TM_WORLD(k,cx_grid(dst_cx),z_dim,box_middle)
+ 30	   CONTINUE
+	ELSEIF (trans .EQ. pauxrgrd_pwlave ) THEN
+	   DO 32 k = kmin_dst, kmax_dst
+              dstcoords(k) = TM_WORLD(k,cx_grid(dst_cx),z_dim,box_lo_lim)
+ 32	   CONTINUE
+	   dstcoords(kmax_dst+1) =
+     .		    TM_WORLD(kmax_dst,cx_grid(dst_cx),z_dim,box_hi_lim)
+	   kdmax = kdmax + 1
+	ELSE
+	   STOP 'do_aux_var_regrid_trns'   ! checked in AUX_REGRID_LIMS
+	ENDIF
+
+* initial code does only the Z axis, based upon "ZAXREPLACE(V,ZVALS,ZAX)"
+* of old ... regrid a sigma-coordinate-style (layered) variable, V (src), onto
+* a depth axis, ZAX, (Z axis of dst) guided by the depths in ZVALS (pos)
+
+
+* loop over the X,Y,T,E,F range of the input fields
+	new_aux_line = .TRUE.
+	is = si0
+	ip = pi0
+	DO 1000 i = mr_lo_s1(mdst), mr_hi_s1(mdst)
+	 is = is + dsi
+	 IF (dpi .NE. 0) THEN
+	   ip = ip + dpi
+	   new_aux_line = .TRUE.
+	 ENDIF
+	 js = sj0
+	 jp = pj0
+	 DO 1000 j = mr_lo_s2(mdst), mr_hi_s2(mdst)
+	  js = js + dsj
+	  IF (dpj .NE. 0) THEN
+	    jp = jp + dpj
+	    new_aux_line = .TRUE.
+	  ENDIF
+	  ls = sl0
+	  lp = pl0
+!   ... k is the axis of the EXTRACT ...
+	  DO 1000 l = mr_lo_s4(mdst), mr_hi_s4(mdst)
+	   ls = ls + dsl
+	   IF (dpl .NE. 0) THEN
+	     lp = lp + dpl
+	     new_aux_line = .TRUE.
+	   ENDIF
+	   ms = sm0
+	   mp = pm0
+	   DO 1000 m = mr_lo_s5(mdst), mr_hi_s5(mdst)
+	    ms = ms + dsm
+	    IF (dpm .NE. 0) THEN
+	      mp = mp + dpm
+	      new_aux_line = .TRUE.
+	    ENDIF
+	    ns = sn0
+	    np = pn0
+	    DO 1000 n = mr_lo_s6(mdst), mr_hi_s6(mdst)
+	     ns = ns + dsn
+	     IF (dpn .NE. 0) THEN
+	       np = np + dpn
+	       new_aux_line = .TRUE.
+	     ENDIF
+
+
+* compute on the source and destination coords only if they differ from last
+	     IF (new_aux_line) THEN
+* extract the line of source coord vals from the aux variable at this location
+	        DO 500 k = kmin_src, kmax_src
+ 500		posline(k) = pos(ip, jp, k, lp, mp, np)
+
+* for each destination point, find the source index just below this value
+* and the weight coefficient to attach to that index 
+* ... note that the indices are referenced to a starting index of 1
+	        CALL HUNT_INDICES(posline, kmin_src, kmax_src,
+     .				  bad_pos, dstcoords,
+     .				  indices, coef, kmin_dst, kdmax,
+     .				  klook, khiok, ascending )
+	        has_valid = klook .NE. unspecified_int4
+		IF (trans .EQ. pauxrgrd_pwlave ) khiok = khiok-1
+		new_aux_line = .FALSE.
+	     ENDIF
+
+	     IF (has_valid) THEN
+* extract the line of source vals 
+	        DO 600 k = kmin_src, kmax_src
+ 600	        srcline(k) = src(is, js, k, ls, ms, ns)
+
+* perform the regridding
+	        IF (trans .EQ. pauxrgrd_linear ) THEN
+* ... by linear interpolation to target cell coordinate points
+	           CALL DO_AUX_REGRID_LINE_LIN (axis,
+     .				  srcline,
+     .				  kmin_src, kmax_src,
+     .				  indices,  coef,
+     .				  kmin_dst, kmax_dst,
+     .				  klook,    khiok,
+     .				  bad_src,  bad_dst, ascending,
+     .				  dstline             )
+	        ELSEIF (trans .EQ. pauxrgrd_pwlave ) THEN
+* ... by within-target-cell averaging
+	           CALL DO_AUX_REGRID_LINE_AVE (axis,
+     .				  srcline,  posline,
+     .				  kmin_src, kmax_src,
+     .				  indices,  coef,
+     .				  kmin_dst, kmax_dst,
+     .				  klook,    khiok,
+     .				  bad_src,  bad_dst, ascending,
+     .				  dstline             )
+	        ENDIF
+
+* put the line of results into the destination array
+	        DO 900 k = klook, khiok
+ 900	        dst(i, j, k, l, m, n) = dstline(k)
+	     ENDIF
+
+ 1000	CONTINUE
+
+* successful completion.  Clean up.
+        CALL RELEASE_WORK_SPC
+        RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/doo/do_aux_var_regrid_line_ave.F b/fer/doo/do_aux_var_regrid_line_ave.F
new file mode 100644
index 0000000..f1894f1
--- /dev/null
+++ b/fer/doo/do_aux_var_regrid_line_ave.F
@@ -0,0 +1,178 @@
+	SUBROUTINE DO_AUX_REGRID_LINE_AVE ( axis,
+     .					 src_line, pos_line,
+     .					 kmin_src, kmax_src,
+     .					 ndx_dst, coef_dst,
+     .					 kmin_dst, kmax_dst,
+     .					 kdlo_ok,  kdhi_ok,
+     .					 bad_src,  bad_dst, ascending,
+     .					 dst_line    )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* regrid a single line along the regrided axis.  For each destination point
+* regrid using the weighted average of values lying entirely or partly
+* in the cell
+
+* the algorithm will weight the input values based upon viewing the
+* coordinates found in the auxiliary coordinate variable as a piecewise-linear
+* function.  For each destination grid cell the algorithm will compute the
+* integral, and divide by its length.
+
+* Thus that calculation is one of adding up the areas of a
+* series of trapezoids from the source data over a coordinate length defined
+* by the limits of each target grid cell.
+
+* For any given cell the trapezopids at the edges of the cell may be truncated,
+* as the destination cell boundaries may not lie directly on the coordinate
+* values given in the auxiliary variable.
+
+* sample expression:  temp[gz(depth)=zax]
+* variable naming convention:
+*     pos_line - position (coordinate) values (e.g. depth)
+*     src_line - values on their original grid (e.g. temp)
+*     dst_line - values regridded to target grid
+
+*  The incoming index pointers tell us the source data indices that lie
+*  at or immediatly below each target grid cell boundary.
+*  If there are N destination grid points there will be N+1
+*  cell boundaries and N+1 incoming indices, positions and coefficients. The
+*  coefficient values are non-unity, when the target cell boundary coordinate
+*  lies in between the coordinate values from the auxiliary coordinate array
+*  The sense of the coefficient is that the value at this destination location
+*  should be computed as 
+*                  interp_val = coef*src(k) + (1-coef)*src(k+1)
+* 
+* v690 11/13 *sh* - based upon DO_AUX_VAR_REGRID_LIN
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'errmsg.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	LOGICAL	ascending
+	INTEGER	axis, kmin_src,kmax_src, kmin_dst, kmax_dst, kdlo_ok, kdhi_ok,
+     .		ndx_dst (kmin_dst:kmax_dst+1)
+        REAL    src_line(kmin_src:kmax_src),
+     .		pos_line(kmin_src:kmax_src),
+     .		coef_dst(kmin_dst:kmax_dst+1),
+     .		dst_line(kmin_dst:kmax_dst),
+     .		bad_src, bad_dst
+
+* internal variable declarations:
+	LOGICAL	trunc
+        INTEGER ndx_lo, ksrc, kdst, kend, kstart, kinc1
+        REAL    area, span, width, frac, pos_lo, pos_hi, src_lo, src_hi
+
+* initialize
+	IF (ascending) THEN
+	   kinc1 = 1
+	ELSE
+	   kinc1 = -1
+	ENDIF
+
+* set up the lower bound of the first trapezoid (possibly truncated)
+ 110	ksrc   = ndx_dst (kdlo_ok)
+	pos_hi = pos_line(ksrc)
+	src_hi = src_line(ksrc)
+	frac   = coef_dst(kdlo_ok)
+	trunc  = frac .NE. 1.0
+	IF (trunc) THEN
+* make the initial truncated trapezoid behave like a full trapezoid by  
+* replacing its lower limit with the proper linear interpolation
+	   src_hi = frac*src_hi + (1-frac)*src_line(ksrc+kinc1)
+	   pos_hi = frac*pos_hi + (1-frac)*pos_line(ksrc+kinc1)
+	   trunc  = .FALSE.
+	ENDIF
+	kstart = ksrc + kinc1   ! ksrc always points to the upper index
+
+* loop over destination cells
+* each dst cell is represented by two points in the dst arrays
+*    the k   point is the index below or at the start of the cell
+*    the k+1 point is the index below or at the end   of the cell
+	DO 1000 kdst = kdlo_ok, kdhi_ok
+
+	   area = 0.0
+	   span = 0.0
+
+* set up low lim of next dest cell from high lim of preceding
+	   pos_lo = pos_hi
+	   src_lo = src_hi
+
+* loop over the full src trapezoids that contribute to current dst cell
+	   kend = ndx_dst(kdst+1)
+	   DO 500 ksrc = kstart, kend, kinc1
+
+* upper end of trapezoid in the src line
+	      pos_hi  = pos_line(ksrc)
+	      src_hi  = src_line(ksrc)
+
+* add a full trapezoid 
+	      width = pos_hi - pos_lo
+	      span  = span + width
+	      area  = area + width * 0.5*(src_hi+src_lo)
+
+* prepare for next trapezoid in the src line
+	      pos_lo = pos_hi
+	      src_lo = src_hi	    
+ 500	   CONTINUE
+
+* handle partial trapezoid at upper bound of destination cell
+	   frac = coef_dst(kdst+1)
+	   trunc = frac .NE. 1.0
+	   IF (trunc) THEN
+* add the lower part of the truncated trapezoid.
+* the upper part is handled as part of the next destination cell
+	      pos_hi = frac*pos_line(kend) + (1-frac)*pos_line(kend+kinc1)
+	      src_hi = frac*src_line(kend) + (1-frac)*src_line(kend+kinc1)
+	      width = pos_hi - pos_lo
+	      span  = span + width
+	      area  = area + width * 0.5*(src_hi+src_lo)
+	   ENDIF
+
+* store the weighted average of trapezoids contributing to dst cell
+	   dst_line(kdst) = area/span
+
+* prepare for next src trapezoid contributing to this dst
+	   kstart = kend + kinc1
+
+ 1000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/doo/do_aux_var_regrid_line_lin.F b/fer/doo/do_aux_var_regrid_line_lin.F
new file mode 100644
index 0000000..b51e7be
--- /dev/null
+++ b/fer/doo/do_aux_var_regrid_line_lin.F
@@ -0,0 +1,101 @@
+	SUBROUTINE DO_AUX_REGRID_LINE_LIN ( axis,
+     .					 src_line,
+     .					 kmin_src, kmax_src,
+     .					 indices, coef,
+     .					 kmin_dst, kmax_dst,
+     .					 kdlo_ok,  kdhi_ok,
+     .					 bad_src,  bad_dst, ascending,
+     .				         dst_line             )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* regrid a single line using linear interpolation
+* using the index pointers and coefficients provided
+
+* v690 11/13 *sh*
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'errmsg.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	LOGICAL	ascending
+	INTEGER	axis, kmin_src,kmax_src, kmin_dst, kmax_dst, kdlo_ok, kdhi_ok,
+     .		indices (kmin_dst:kmax_dst)
+        REAL    src_line(kmin_src:kmax_src),
+     .		dst_line(kmin_dst:kmax_dst),
+     .		coef    (kmin_dst:kmax_dst),
+     .		bad_src, bad_dst
+
+* internal variable declarations:
+        INTEGER ndx_lo, k, kinc1
+        REAL    frac
+
+* initialize
+	IF (ascending) THEN
+	   kinc1 = 1
+	ELSE
+	   kinc1 = -1
+	ENDIF
+
+* loop performing linear interpolations
+	DO 1000 k = kdlo_ok, kdhi_ok   ! dest Z axis
+
+	   ndx_lo = indices(k)
+	   frac   = coef(k)
+
+           IF ( frac .LT. 0.0 ) THEN
+              dst_line(k) = bad_dst
+           ELSEIF ( src_line(ndx_lo) .EQ. bad_src ) THEN
+              dst_line(k) = bad_dst
+           ELSEIF ( frac .EQ. 1.0 ) THEN
+              dst_line(k) = src_line(ndx_lo)
+           ELSEIF ( src_line(ndx_lo+1) .EQ. bad_src ) THEN
+              dst_line(k) = bad_dst
+           ELSE
+* ... interpolate data from com1 field to get result
+              dst_line(k) = 
+     .                 frac  * src_line(ndx_lo)
+     .            + (1-frac) * src_line(ndx_lo+kinc1)
+           ENDIF
+ 1000   CONTINUE
+
+	RETURN
+	END
diff --git a/fer/doo/do_ave_int.F b/fer/doo/do_ave_int.F
new file mode 100644
index 0000000..a1c9740
--- /dev/null
+++ b/fer/doo/do_ave_int.F
@@ -0,0 +1,348 @@
+	SUBROUTINE DO_AVE_INT(	action, idim, com_lo, com_hi,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx,
+     .				box )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform both averaging and integrating (definite) - since they differ only
+* by a multiplying factor
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: ????
+*      10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V230:  5/6/92 - COS correction checks that J location is defined
+*       8/10/92 - weights were wrong for integration within a single box
+*                 added "IF (point)" logic
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* internal variable declarations:
+	LOGICAL	GEOG_COS_FACTOR, need_cos, integrate, point
+	INTEGER i, j, k, l, m, n, grid, pt, lo, hi, axis
+	REAL	BOX_SIZE, unit, bad_com, bad_res, cos_factor,
+     .          ybxlo, ybxhi, bx
+	REAL*8	TM_WORLD, dsum, bsum
+
+* calling argument declarations:
+	INTEGER	action, idim, com_lo, com_hi, com_mr, com_cx, res_mr, res_cx
+	REAL    com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		box( com_lo:com_hi )
+
+* --- end of introductory code ---
+
+* initialize
+	grid = mr_grid( com_mr )
+	axis = grid_line( idim, grid )
+	pt   = cx_lo_ss( res_cx, idim )
+	lo   = com_lo
+	hi   = com_hi
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+	integrate = action .EQ. isact_integ_def
+        point = .FALSE.
+
+* get and save grid box sizes (weights) just once for efficiency
+* (end boxes may be only partially weighted)
+        IF ( lo .EQ. hi ) THEN    ! 8/92
+           box(lo) = cx_hi_ww(idim,res_cx) - cx_lo_ww(idim,res_cx)
+           point = box(lo) .EQ. 0.0
+        ELSE
+	   box(lo) = TM_WORLD(lo, grid, idim, box_hi_lim)
+     .		   - cx_lo_ww(idim,res_cx)
+	   DO 100 i = lo+1, hi-1
+ 100	   box(i)  = BOX_SIZE( i, grid, idim )
+	   box(hi) = cx_hi_ww(idim,res_cx)
+     .		   - TM_WORLD(hi, grid, idim, box_lo_lim)
+        ENDIF
+
+* perform integrations on standard units if possible
+	IF ( integrate ) THEN
+	   unit = un_convert( line_unit_code(axis) )
+	   DO 110 i = lo, hi
+ 110	   box(i) = box(i) * unit
+	ENDIF
+
+* AVERAGE/INTEGRATE
+* (is double precision summing necessary ? *sh* 6/89)
+* ALONG X AXIS
+* (note: X integration is a special case because it requires COSINE(lat) )
+	IF ( idim .EQ. x_dim ) THEN
+	   need_cos = GEOG_COS_FACTOR( idim, grid )
+     .                .AND. cx_lo_s2(com_cx).NE.unspecified_int4
+	   DO 210 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   IF ( need_cos ) THEN
+#ifdef double_p
+	      cos_factor = COS( deg2rad *       
+     .             TM_WORLD(j, grid, y_dim, box_middle) ) 
+              ybxlo = deg2rad* 
+     .             TM_WORLD(j,grid,y_dim,box_lo_lim)
+              ybxhi = deg2rad* 
+     .             TM_WORLD(j,grid,y_dim,box_hi_lim)
+#else
+	      cos_factor = COS( deg2rad *       
+     .             SNGL( TM_WORLD(j, grid, y_dim, box_middle) ) ) 
+              ybxlo = deg2rad* 
+     .             SNGL( TM_WORLD(j,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .             SNGL( TM_WORLD(j,grid,y_dim,box_hi_lim) )
+#endif
+              bx = ABS(ybxhi - ybxlo)
+	      cos_factor = ABS( SIN(ybxhi) - SIN(ybxlo) )/ bx
+	   ENDIF
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+              IF ( point ) THEN  ! 8/92
+                 IF ( com(lo,j,k,l,m,n) .EQ. bad_com ) THEN
+                    res(pt,j,k,l,m,n) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(pt,j,k,l,m,n) = 0.0
+                 ELSE
+                    res(pt,j,k,l,m,n) = com(lo,j,k,l,m,n)
+                 ENDIF
+                 GOTO 210
+              ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 200 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 200
+	         bsum = bsum + box(i)
+	         dsum = dsum + box(i)*com(i,j,k,l,m,n)
+ 200	      CONTINUE
+	      IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(pt,j,k,l,m,n) = bad_res
+	      ELSEIF (integrate) THEN
+	         IF ( need_cos ) THEN
+	            res(pt,j,k,l,m,n) = dsum * cos_factor
+	         ELSE
+	            res(pt,j,k,l,m,n) = dsum
+	         ENDIF
+	      ELSE
+	         res(pt,j,k,l,m,n) = dsum/bsum
+	      ENDIF
+ 210	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              IF ( point ) THEN   ! 8/92
+                 IF ( com(i,lo,k,l,m,n) .EQ. bad_com ) THEN
+                    res(i,pt,k,l,m,n) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(i,pt,k,l,m,n) = 0.0
+                 ELSE
+                    res(i,pt,k,l,m,n) = com(i,lo,k,l,m,n)
+                 ENDIF
+                 GOTO 310
+              ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 300 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 300
+	         bsum = bsum + box(j)
+	         dsum = dsum + box(j)*com(i,j,k,l,m,n)
+ 300	      CONTINUE
+	      IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(i,pt,k,l,m,n) = bad_res
+	      ELSEIF (integrate) THEN
+	         res(i,pt,k,l,m,n) = dsum
+	      ELSE
+	         res(i,pt,k,l,m,n) = dsum/bsum
+	      ENDIF
+ 310	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              IF ( point ) THEN    ! 8/92
+                 IF ( com(i,j,lo,l,m,n) .EQ. bad_com ) THEN
+                    res(i,j,pt,l,m,n) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(i,j,pt,l,m,n) = 0.0
+                 ELSE
+                    res(i,j,pt,l,m,n) = com(i,j,lo,l,m,n)
+                 ENDIF
+                 GOTO 410
+	      ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 400 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 400
+	         bsum = bsum + box(k)
+	         dsum = dsum + box(k)*com(i,j,k,l,m,n)
+ 400	      CONTINUE
+              IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(i,j,pt,l,m,n) = bad_res
+	      ELSEIF (integrate) THEN
+	         res(i,j,pt,l,m,n) = dsum
+	      ELSE
+	         res(i,j,pt,l,m,n) = dsum/bsum
+	      ENDIF
+ 410	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              IF ( point ) THEN
+                 IF ( com(i,j,k,lo,m,n) .EQ. bad_com ) THEN
+                    res(i,j,k,pt,m,n) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(i,j,k,pt,m,n) = 0.0
+                 ELSE
+                    res(i,j,k,pt,m,n) = com(i,j,k,lo,m,n)
+                 ENDIF
+                 GOTO 510
+              ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 500 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 500
+	         bsum = bsum + box(l)
+	         dsum = dsum + box(l)*com(i,j,k,l,m,n)
+ 500	      CONTINUE
+	      IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(i,j,k,pt,m,n) = bad_res
+	      ELSEIF (integrate) THEN
+	         res(i,j,k,pt,m,n) = dsum
+	      ELSE
+	         res(i,j,k,pt,m,n) = dsum/bsum
+	      ENDIF
+ 510	   CONTINUE
+
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 610 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              IF ( point ) THEN
+                 IF ( com(i,j,k,l,lo,n) .EQ. bad_com ) THEN
+                    res(i,j,k,pt,m,n) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(i,j,k,l,pt,n) = 0.0
+                 ELSE
+                    res(i,j,k,l,pt,n) = com(i,j,k,l,lo,n)
+                 ENDIF
+                 GOTO 610
+              ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 600 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 600
+	         bsum = bsum + box(m)
+	         dsum = dsum + box(m)*com(i,j,k,l,m,n)
+ 600	      CONTINUE
+	      IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(i,j,k,l,pt,n) = bad_res
+	      ELSEIF (integrate) THEN
+	         res(i,j,k,l,pt,n) = dsum
+	      ELSE
+	         res(i,j,k,l,pt,n) = dsum/bsum
+	      ENDIF
+ 610	   CONTINUE
+
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 710 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 710 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 710 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 710 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 710 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              IF ( point ) THEN
+                 IF ( com(i,j,k,l,m,lo) .EQ. bad_com ) THEN
+                    res(i,j,k,l,m,pt) = bad_res
+                 ELSEIF ( integrate ) THEN
+                    res(i,j,k,l,m,pt) = 0.0
+                 ELSE
+                    res(i,j,k,l,m,pt) = com(i,j,k,l,m,lo)
+                 ENDIF
+                 GOTO 710
+              ENDIF
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 700 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 700
+	         bsum = bsum + box(n)
+	         dsum = dsum + box(n)*com(i,j,k,l,m,n)
+ 700	      CONTINUE
+	      IF ( bsum .EQ. 0.0D0 ) THEN
+	         res(i,j,k,l,m,pt) = bad_res
+	      ELSEIF (integrate) THEN
+	         res(i,j,k,l,m,pt) = dsum
+	      ELSE
+	         res(i,j,k,l,m,pt) = dsum/bsum
+	      ENDIF
+ 710	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_ave_regrid.F b/fer/doo/do_ave_regrid.F
new file mode 100644
index 0000000..2fecce1
--- /dev/null
+++ b/fer/doo/do_ave_regrid.F
@@ -0,0 +1,67 @@
+	SUBROUTINE DO_AVE_REGRID( cx_lims, axis, trans,
+     .				  src, msrc, dst, mdst,
+     .				  work, src_cx, dst_cx,  itot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the area regridding routine with appropriate work array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V230:  8/22/92 - based on DO_XYAVE_REGRID
+* V552:  4/04 *acm* - bug fix.  For @AVE and related transforms @SUM, etc.
+*                     send src_lo_ss and src_hi_ss for the range on the src
+*                     axis.  
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, trans, msrc, mdst, itot, src_cx, dst_cx
+	REAL	src(*), dst(*), work(itot)
+
+	CALL AVE_REGRID_1_AXIS(   cx_lims, axis, trans,
+     .			   cx_lo_ss(cx_lims,x_dim), cx_hi_ss(cx_lims,x_dim),
+     .			   cx_lo_ss(cx_lims,y_dim), cx_hi_ss(cx_lims,y_dim),
+     .			   src, msrc, dst, mdst,
+     .			   work(1), src_cx, dst_cx, itot )
+
+	RETURN
+	END
diff --git a/fer/doo/do_average.F b/fer/doo/do_average.F
new file mode 100644
index 0000000..ffb0bbf
--- /dev/null
+++ b/fer/doo/do_average.F
@@ -0,0 +1,79 @@
+	INTEGER FUNCTION DO_AVERAGE(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* average the component grid into the result grid
+* (done by calling a single routine used for both averaging and integrating)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+* ...
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_AVE_INT( isact_average, idim,
+     .			 cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx,
+     .			 box )
+
+	DO_AVERAGE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_deriv_bkwd.F b/fer/doo/do_deriv_bkwd.F
new file mode 100644
index 0000000..a1e89cd
--- /dev/null
+++ b/fer/doo/do_deriv_bkwd.F
@@ -0,0 +1,83 @@
+	INTEGER FUNCTION DO_DERIV_BKWD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute backwards derivative of component along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/6/89
+*	10/16/89 - changes to adjustable array declarations
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, box(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	ishf		!kob 12/96
+	PARAMETER (ishf = 1)	! 1 for backwards, 0 for forwards
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* forward and backwards derivatives are identical except for a shift 
+	CALL DD1STEP (  idim, ishf,
+     .			cx_lo_ss(com_cx,idim),cx_hi_ss(com_cx,idim), box,
+     .			com, com_mr,
+     .			res, res_mr, res_cx )
+
+* always success
+	DO_DERIV_BKWD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_deriv_cntr.F b/fer/doo/do_deriv_cntr.F
new file mode 100644
index 0000000..dc1c73b
--- /dev/null
+++ b/fer/doo/do_deriv_cntr.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_DERIV_CNTR(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute centered derivative of component along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/6/89
+*	13/10/89 - use support routine DD2STEP to avoid adj. array problems
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, box(*), com(*), res(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DD2STEP (idim, arg, cx_lo_ss(com_cx,idim),cx_hi_ss(com_cx,idim),
+     .			com, com_mr,
+     .			res, res_mr, res_cx,
+     .			box	)
+
+* always success
+	DO_DERIV_CNTR = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_deriv_frwd.F b/fer/doo/do_deriv_frwd.F
new file mode 100644
index 0000000..2a3b244
--- /dev/null
+++ b/fer/doo/do_deriv_frwd.F
@@ -0,0 +1,83 @@
+	INTEGER FUNCTION DO_DERIV_FRWD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute forward derivative of component along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/6/89
+*	10/16/89 - changes to adjustable array declarations
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, box(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	ishf		!kob 12/96
+	PARAMETER (ishf = 0)	! 0 for forward, 1 for backward
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* forward and backwards derivatives are identical except for a shift 
+	CALL DD1STEP (  idim, ishf,
+     .			cx_lo_ss(com_cx,idim),cx_hi_ss(com_cx,idim), box,
+     .			com, com_mr,
+     .			res, res_mr, res_cx )
+
+* always success
+	DO_DERIV_FRWD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_dist_loc.F b/fer/doo/do_dist_loc.F
new file mode 100644
index 0000000..baaebc1
--- /dev/null
+++ b/fer/doo/do_dist_loc.F
@@ -0,0 +1,333 @@
+	INTEGER FUNCTION DO_DIST_LOC(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					buff	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* locate the indicated argument value along the indicated axis and leave
+* behind an "interpolating kernel": linear interpolating weights on the
+* points immediately before and after the located value
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  1/22/92 - new routine based on DO_FILL_AVE and DO_LOCATE
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+        LOGICAL first_pt, first_lt, crossing_found
+	INTEGER i, j, k, l, m, n, ss1,
+     .          lo_sub(nferdims), hi_sub(nferdims)
+	REAL	bad_res, com1, com2, del
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	bad_res = mr_bad_data( com_mr )
+        
+* calculation limits
+	DO 10 i = 1, nferdims
+	   lo_sub(i) = cx_lo_ss(res_cx,i)
+	   hi_sub(i) = cx_hi_ss(res_cx,i)
+ 10	CONTINUE
+
+* SEARCH ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 100 i = lo_s1, hi_s1
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 100
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 100
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = i
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = i
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(ss1,j,k,l,m,n)
+                    com2 = com(i  ,j,k,l,m,n)
+                    del = com2 - com1
+                    res(ss1,j,k,l,m,n) = (com2-arg) / del
+                    res(i  ,j,k,l,m,n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                 ENDIF
+ 100          CONTINUE
+ 110       CONTINUE
+
+* SEARCH ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 200 j = lo_s2, hi_s2
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 200
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 200
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = j
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = j
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(i,ss1,k,l,m,n)
+                    com2 = com(i,j  ,k,l,m,n)
+                    del = com2 - com1
+                    res(i,ss1,k,l,m,n) = (com2-arg) / del
+                    res(i,j  ,k,l,m,n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                ENDIF
+ 200         CONTINUE
+ 210      CONTINUE
+
+* SEARCH ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 300 k = lo_s3, hi_s3
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 300
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 300
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = k
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = k
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(i,j,ss1,l,m,n)
+                    com2 = com(i,j,k  ,l,m,n)
+                    del = com2 - com1
+                    res(i,j,ss1,l,m,n) = (com2-arg) / del
+                    res(i,j,k,  l,m,n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                ENDIF
+ 300         CONTINUE
+ 310      CONTINUE
+
+* SEARCH ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 400 l = lo_s4, hi_s4
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 400
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 400
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = l
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = l
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(i,j,k,ss1,m,n)
+                    com2 = com(i,j,k,l,  m,n)
+                    del = com2 - com1
+                    res(i,j,k,ss1,m,n) = (com2-arg) / del
+                    res(i,j,k,l,  m,n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                ENDIF
+ 400         CONTINUE
+ 410      CONTINUE
+
+* SEARCH ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 500 m = lo_s5, hi_s5
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 500
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 500
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = m
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = m
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(i,j,k,l,ss1,n)
+                    com2 = com(i,j,k,l,  m,n)
+                    del = com2 - com1
+                    res(i,j,k,l,ss1,n) = (com2-arg) / del
+                    res(i,j,k,l,  m,n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                ENDIF
+ 500         CONTINUE
+ 510      CONTINUE
+
+* SEARCH ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+              first_pt = .TRUE.
+              crossing_found = .FALSE.
+	      DO 600 n = lo_s6, hi_s6
+                 res(i,j,k,l,m,n) = bad_res
+                 IF ( crossing_found ) GOTO 600
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 600
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+                    res(i,j,k,l,m,n) = 1.0
+                    crossing_found = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                    ss1 = n
+                 ELSEIF ( first_lt .EQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... still have not crossed from GT to LT or visa versa
+                    ss1 = n
+                 ELSE
+* ... found a "crossing"
+                    com1 = com(i,j,k,l,m,ss1)
+                    com2 = com(i,j,k,l,m,  n)
+                    del = com2 - com1
+                    res(i,j,k,l,m,ss1) = (com2-arg) / del
+                    res(i,j,k,l,m,  n) = (arg-com1) / del
+                    crossing_found = .TRUE.
+                ENDIF
+ 600         CONTINUE
+ 610      CONTINUE
+
+	ENDIF
+
+* always success
+	DO_DIST_LOC = ferr_ok
+	RETURN
+
+	END
diff --git a/fer/doo/do_event.F b/fer/doo/do_event.F
new file mode 100644
index 0000000..485e734
--- /dev/null
+++ b/fer/doo/do_event.F
@@ -0,0 +1,286 @@
+	INTEGER FUNCTION DO_EVENT(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					buff	)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* the indicated argument value is regarded as an "event threshhold".
+* Any time that the component variable crosses or lands on this value
+* an "event" occurs and the output should step up by "1" to indicate it.
+* If an exact match occurs, step up ON that value.
+* If a crossing occurs, step up on the first value AFTER the crossing.  
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533:  6/01 - new routine based on DO_DIST_LOC
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* v685   5/13 *acm* Fix ticket 2054, EVNT in z direction - typo in equiv.
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+        LOGICAL first_pt, first_lt
+* *kob* 6.01 - step_val needs to be integer
+	INTEGER step_val, i, j, k, l, m, n,
+     .          lo_sub(nferdims), hi_sub(nferdims)
+	REAL	bad_com
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	bad_com = mr_bad_data( com_mr )
+        
+* calculation limits
+	DO 10 i = 1, nferdims
+	   lo_sub(i) = cx_lo_ss(res_cx,i)
+	   hi_sub(i) = cx_hi_ss(res_cx,i)
+ 10	CONTINUE
+
+* SEARCH ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 100 i = lo_s1, hi_s1
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 100          CONTINUE
+ 110       CONTINUE
+
+* SEARCH ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 200 j = lo_s2, hi_s2
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 200         CONTINUE
+ 210      CONTINUE
+
+* SEARCH ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 300 k = lo_s3, hi_s3
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 300         CONTINUE
+ 310      CONTINUE
+
+* SEARCH ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 400 l = lo_s4, hi_s4
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 400         CONTINUE
+ 410      CONTINUE
+
+* SEARCH ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 500 m = lo_s5, hi_s5
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 500         CONTINUE
+ 510      CONTINUE
+
+* SEARCH ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      step_val = 0
+              first_pt = .TRUE.
+	      DO 600 n = lo_s6, hi_s6
+                 IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+	            first_pt = .TRUE.
+                 ELSEIF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+* ... exact equality
+	            step_val = step_val + 1
+	            first_pt = .TRUE.
+                 ELSEIF ( first_pt ) THEN
+* ... first non-bad value
+                    first_pt = .FALSE.
+                    first_lt = com(i,j,k,l,m,n) .LT. arg
+                 ELSEIF ( first_lt .NEQV.
+     .                    (com(i,j,k,l,m,n) .LT. arg) ) THEN
+* ... found a "crossing"
+	            step_val = step_val + 1
+	            first_lt = .NOT. first_lt
+                 ENDIF
+		 res(i,j,k,l,m,n) = step_val
+ 600         CONTINUE
+ 610      CONTINUE
+
+	ENDIF
+
+* always success
+	DO_EVENT = ferr_ok
+	RETURN
+
+	END
diff --git a/fer/doo/do_external_gc_fcn.F b/fer/doo/do_external_gc_fcn.F
new file mode 100644
index 0000000..cde2674
--- /dev/null
+++ b/fer/doo/do_external_gc_fcn.F
@@ -0,0 +1,138 @@
+      SUBROUTINE DO_EXTERNAL_GC_FCN( memory,
+     .				fcn, num_com, com_mr, com_cx,
+     .				com1, mr1,
+     .				com2, mr2,
+     .				com3, mr3,
+     .				com4, mr4,
+     .				com5, mr5,
+     .				com6, mr6,
+     .				com7, mr7,
+     .				com8, mr8,
+     .				com9, mr9,
+     .				res, mres,
+     .                          status )
+
+* execute a grid changing function
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_IMPOSE_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+* V450:  1/97 - new, based on operate.F, but for grid changing functions
+*        7/97 - complete the ZAXREPLACE function
+*       7/25/97 - increase number of args from 4 to 9
+*               - add function PPLGRID
+* V500: 10/26/98 - *jc* add CREATE_PERMUTATION section
+*        7/99 *sh* check ststus on retun from efvn_compute
+* V510: *sh* 3/00 - bug fix: com_mr was passed instead of mr_perm to the EFs
+*                 - eliminated old code as marked by jon
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	fcn, num_com, com_mr(10), com_cx(9), status,
+     .       mr1, mr2, mr3, mr4, mr5, mr6, mr7, mr8, mr9, mres
+        REAL memory( mem_blk_size, max_mem_blks )
+	REAL com1( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .             m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .       com2( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .             m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .       com3( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,
+     .             m3lot:m3hit,m3loe:m3hie,m3lof:m3hif ),
+     .       com4( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,
+     .             m4lot:m4hit,m4loe:m4hie,m4lof:m4hif ),
+     .       com5( m5lox:m4hix,m5loy:m5hiy,m5loz:m5hiz,
+     .             m5lot:m5hit,m5loe:m5hie,m5lof:m5hif ),
+     .       com6( m6lox:m4hix,m6loy:m6hiy,m6loz:m6hiz,
+     .             m6lot:m6hit,m6loe:m6hie,m6lof:m6hif ),
+     .       com7( m7lox:m4hix,m7loy:m7hiy,m7loz:m7hiz,
+     .             m7lot:m7hit,m7loe:m7hie,m7lof:m7hif ),
+     .       com8( m8lox:m4hix,m8loy:m8hiy,m8loz:m8hiz,
+     .             m8lot:m8hit,m8loe:m8hie,m8lof:m8hif ),
+     .       com9( m9lox:m4hix,m9loy:m9hiy,m9loz:m9hiz,
+     .             m9lot:m9hit,m9loe:m9hie,m9lof:m9hif ),
+     .       res( m10lox:m10hix,m10loy:m10hiy,m10loz:m10hiz,
+     .            m10lot:m10hit,m10loe:m10hie,m10lof:m10hif )
+
+* internal variable declarations:
+        INTEGER mr_arg_offset_array(10)
+        REAL bad_flag_array(10)
+
+        INTEGER i, mr, perm(nferdims), mr_perm(9)
+
+* internal parameter declarations:
+	REAL*8          pdays_by_1900
+	PARAMETER     ( pdays_by_1900 = 59958230400.0 / 
+     .       (60.*60.*24.) )
+
+
+* initialize
+        status = ferr_ok
+
+* initialize all of the possible passed arguments just for good housekeeping
+        DO 5 i= 1, 9
+            mr_arg_offset_array(i)  = ( mr_blk1(dummy_mr)-1 )
+     .                              * mem_blk_size
+            bad_flag_array(i)  = mr_bad_data ( dummy_mr )
+ 5      CONTINUE
+
+* In order to pass arguments to the external function as continguous 
+* pieces of memory, we need to use CREATE_PERMUTATION.  
+* Otherwise, cached variables will be passed through without being 
+* pared down to the desired context.
+
+       DO 10 i=1, nferdims
+          perm(i) = i
+ 10    CONTINUE
+
+       DO 100 i=1, num_com
+
+          CALL CREATE_PERMUTATION(  memory, com_cx(i), com_mr(i),
+     .         perm, mr_perm(i), status )
+
+          IF ( status .NE. ferr_OK ) GOTO 5000
+
+          CALL NON_ARRAY_SUBSC( mr_perm, 1 )
+
+          mr_arg_offset_array(i)  = ( mr_blk1(mr_perm(i)) - 1 ) * 
+     .         mem_blk_size
+          bad_flag_array(i)  = mr_bad_data ( mr_perm(i) )
+
+ 100   CONTINUE
+
+* store the restricted limits as known by mr_perm instead of com_mr
+        CALL NON_ARRAY_SUBSC( mr_perm, num_com )
+
+        mr_arg_offset_array(10) = ( mr_blk1(mres) - 1 ) * mem_blk_size
+        bad_flag_array(10) = mr_bad_data ( mres )
+
+        call efcn_compute(fcn, num_com, com_cx, mr_perm, mres, 
+     .      bad_flag_array, mr_arg_offset_array, memory, status)
+        IF (status .NE. ferr_ok) CALL ERRMSG(ferr_ef_error, status,
+     .          'error in external function', *190)
+
+ 
+* clean temporary results from memory cache
+ 190    DO 200 i = 1, num_com
+          mr = mr_perm(i)
+          IF ( mr_protected(mr) .EQ. mr_temporary
+     .         .OR. mr_protected(mr) .EQ. mr_table_entry_only )
+     .         CALL DELETE_VARIABLE( mr )
+ 200   CONTINUE
+
+
+* error exits
+ 5000	RETURN
+	END
+
diff --git a/fer/doo/do_fill_ave.F b/fer/doo/do_fill_ave.F
new file mode 100644
index 0000000..43dd0be
--- /dev/null
+++ b/fer/doo/do_fill_ave.F
@@ -0,0 +1,410 @@
+	INTEGER FUNCTION DO_FILL_AVE(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					buff	)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill along axis idim by a running mean window
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/2/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V550 *sh* 8/2/02 - support for modulo lengths. ensure that filling 
+*		    does not operate acros the subspan modulo void point
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER	TM_MODULO_LINE_DIM, CGRID_AXIS, 
+     .		i, j, k, l, m, n, ii, cnt, haf,
+     .          lo_sub(nferdims), hi_sub(nferdims),
+     .		ii_com, lo_com, hi_com, lo_com0, hi_com0,
+     .		lo_modlim, hi_modlim, nmod, nmod_prev, modlen
+
+	REAL	bad_res, sum, comp
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	haf = arg * .5
+	bad_res = mr_bad_data( com_mr )
+	nmod_prev = -99999
+
+* compute limits within which calculation is straightforward
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_com0 = cx_lo_ss(com_cx,idim)
+	hi_com0 = cx_hi_ss(com_cx,idim)
+	lo_com = lo_com0
+	hi_com = hi_com0
+
+* it his a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO( CGRID_AXIS(idim,com_cx) )
+	IF (has_mod_void) THEN
+	   modlen = TM_MODULO_LINE_DIM( CGRID_AXIS(idim,com_cx) )
+	   has_mod_void = lo_com.LE.0 .OR. hi_com.GE.modlen
+	ENDIF
+
+* FILL ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	   DO 110 i = lo_s1, hi_s1
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(i,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 110
+	         ENDIF
+	         nmod = (i-1)/modlen 
+	         IF (i.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 110
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 100 ii = -haf, haf
+	         ii_com = i + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 100
+	         comp = com(ii_com,j,k,l,m,n)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 100	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 110	   CONTINUE
+
+* FILL ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 220 n = lo_s6, hi_s6
+	   DO 220 m = lo_s5, hi_s5
+	   DO 220 l = lo_s4, hi_s4
+	   DO 220 k = lo_s3, hi_s3
+	   DO 220 j = lo_s2, hi_s2
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(j,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 220
+	         ENDIF
+	         nmod = (j-1)/modlen 
+	         IF (j.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	   DO 210 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 210
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 200 ii = -haf, haf
+	         ii_com = j + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 200
+	         comp = com(i,ii_com,k,l,m,n)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 200	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 210	   CONTINUE
+ 220	   CONTINUE
+
+* FILL ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 320 n = lo_s6, hi_s6
+	   DO 320 m = lo_s5, hi_s5
+	   DO 320 l = lo_s4, hi_s4
+	   DO 320 k = lo_s3, hi_s3
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(k,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 320
+	         ENDIF
+	         nmod = (k-1)/modlen 
+	         IF (k.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 310
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 300 ii = -haf, haf
+	         ii_com = k + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 300
+	         comp = com(i,j,ii_com,l,m,n)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 300	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 310	   CONTINUE
+ 320	   CONTINUE
+
+* FILL ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 420 n = lo_s6, hi_s6
+	   DO 420 m = lo_s5, hi_s5
+	   DO 420 l = lo_s4, hi_s4
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(l,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 420
+	         ENDIF
+	         nmod = (l-1)/modlen 
+	         IF (l.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 410
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 400 ii = -haf, haf
+	         ii_com = l + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 400
+	         comp = com(i,j,k,ii_com,m,n)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 400	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 410	   CONTINUE
+ 420	   CONTINUE
+
+* FILL ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 520 n = lo_s6, hi_s6
+	   DO 520 m = lo_s5, hi_s5
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(m,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 520
+	         ENDIF
+	         nmod = (m-1)/modlen 
+	         IF (m.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 510
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 500 ii = -haf, haf
+	         ii_com = m + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 500
+	         comp = com(i,j,k,l,ii_com,n)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 500	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 510	   CONTINUE
+ 520	   CONTINUE
+
+* FILL ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 620 n = lo_s6, hi_s6
+*  ... do not allow filling based upon values across a subspan modulo void
+	      IF (has_mod_void) THEN
+	         IF (MOD(n,modlen) .EQ. 0) THEN
+	            res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	            GOTO 620
+	         ENDIF
+	         nmod = (n-1)/modlen 
+	         IF (n.LE.0) nmod = nmod - 1
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_com = MAX( lo_modlim, lo_com0 )
+	            hi_com = MIN( hi_modlim, hi_com0 )
+	         ENDIF
+	      ENDIF
+* ... end of subspan modulo adjustment
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	         GOTO 610
+	      ENDIF
+	      cnt = 0
+	      sum = 0.0
+	      DO 600 ii = -haf, haf
+	         ii_com = n + ii
+	         IF ( ii_com.LT.lo_com .OR. ii_com.GT.hi_com ) GOTO 600
+	         comp = com(i,j,k,l,m,ii_com)
+	         IF ( comp .NE. bad_res ) THEN
+	            cnt = cnt + 1
+	            sum = sum + comp
+	         ENDIF
+ 600	      CONTINUE
+	      IF ( cnt .GT. 0 ) THEN
+	         res(i,j,k,l,m,n) = sum / cnt
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 610	   CONTINUE
+ 620	   CONTINUE
+
+	ENDIF
+
+* always success
+	DO_FILL_AVE = ferr_ok
+	RETURN
+
+	END
+
diff --git a/fer/doo/do_fill_interp.F b/fer/doo/do_fill_interp.F
new file mode 100644
index 0000000..c16af71
--- /dev/null
+++ b/fer/doo/do_fill_interp.F
@@ -0,0 +1,653 @@
+	INTEGER FUNCTION DO_FILL_INTERP(idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					coords	)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill along axis idim by interpolating from the closest available valid pt
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  3/23/92 - based on DO_FILL_AVE
+* V301:  2/15/94 - upgrade to accomodate modulo axes
+* V402:   8/9/95 - bug fix: T=@FLN had "lo_coord = coords(k-pos0)"
+* V550 *sh* 8/2/02 - support for modulo lengths. ensure that filling 
+*		    does not operate acros the subspan modulo void point
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, coords(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO,
+     .		modulo_axis, modulo, no_lo_val, has_mod_void
+	INTEGER TM_MODULO_LINE_DIM, CGRID_AXIS,
+     .		i, j, k, l, m, n, ii, jj, kk, ll, mm, nn,
+     .          lo_sub(nferdims), hi_sub(nferdims),
+     .		lo_edge, hi_edge, pos0, edge, lo_index, hi_index,
+     .		lo_com, hi_com, line, axdim, look,
+     .		coord_lo_ss, coord_hi_ss, next_hi_ss
+	REAL	bad_res, lo_coord, hi_coord, coord, lo_val, hi_val,
+     .		axlen
+	REAL*8	TM_MODULO_AXLEN
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* local parameter declarations
+	INTEGER     no_point
+	PARAMETER ( no_point = -99999 )
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	bad_res = mr_bad_data( com_mr )
+	edge = arg
+
+* limits of the component data provided
+	lo_com = cx_lo_ss(com_cx, idim)
+	hi_com = cx_hi_ss(com_cx, idim)
+
+* is it a modulo axis with sufficient component span provided to wrap around
+	line = CGRID_AXIS(idim, com_cx)
+	IF ( line .EQ. mnormal .OR. line .EQ. munknown ) THEN
+	   modulo_axis = .FALSE.
+	ELSE
+	   axdim = TM_MODULO_LINE_DIM(line)   ! 2/02
+	   modulo_axis = line_modulo(line)
+     .		    .AND. hi_com-lo_com+1 .GE. axdim
+	ENDIF
+	IF ( modulo_axis ) axlen = TM_MODULO_AXLEN(line)
+
+* it his a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO(line)
+	IF (has_mod_void) THEN
+	   has_mod_void = lo_com.LE.0 .OR. hi_com.GE.axdim
+	ENDIF
+
+* save the desired result region
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+
+* get and save grid box coordinates just once for efficiency
+	coord_lo_ss = MAX( lo_sub(idim)-edge, lo_com )
+	coord_hi_ss = MIN( hi_sub(idim)+edge, hi_com )
+        CALL MAKE_AXIS( mr_grid(com_mr), idim,
+     .			coord_lo_ss, coord_hi_ss, coords )
+        pos0    = coord_lo_ss - 1
+
+* on action axis compute limits within which source data is accessible
+	IF ( modulo_axis ) THEN
+	   lo_edge = lo_sub(idim) - axdim	! complete axis wrap-around
+	   hi_edge = hi_sub(idim) + axdim	! complete axis wrap-around
+	ELSE
+	   lo_edge = coord_lo_ss
+	   hi_edge = coord_hi_ss
+	ENDIF
+
+* FILL ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 101 i = lo_s1, lo_edge, -1
+	      modulo = modulo_axis .AND. i.LT.coord_lo_ss
+	      IF ( modulo ) THEN
+	         look = MOD(i+axdim-coord_lo_ss,axdim) + coord_lo_ss
+	      ELSE
+	         look = i
+	      ENDIF
+              IF ( com(look,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(look,j,k,l,m,n)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+	         GOTO 102
+              ENDIF
+ 101       CONTINUE
+* ... process the requested line in X
+ 102	   DO 110 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = i
+	         lo_coord = coords(i-pos0)
+                 no_lo_val = .FALSE.
+	         GOTO 110
+	      ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+	         GOTO 110
+              ELSEIF ( next_hi_ss .LT. i ) THEN
+* ... look forward from current position for next valid point
+                 DO 104 ii = i+1, hi_edge
+	            modulo = modulo_axis .AND. ii.GT.coord_hi_ss
+	            IF ( modulo ) THEN
+	               look = MOD(ii+axdim-coord_lo_ss,axdim) + coord_lo_ss
+	            ELSE
+	               look = ii
+	            ENDIF
+                    IF ( com(look,j,k,l,m,n) .NE. bad_res ) THEN
+                       next_hi_ss = look
+                       hi_val = com(look,j,k,l,m,n)
+	               hi_index = look
+	               hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (ii/axdim)*axdim
+	                  hi_coord = hi_coord + (ii/axdim)*axlen
+	               ENDIF
+                       GOTO 108
+                    ENDIF
+ 104             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 110
+              ENDIF
+* ... fill in interpolating value
+ 108	      coord    = coords(i-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(i,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 110	   CONTINUE
+
+* FILL ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 201 j = lo_s2, lo_edge, -1
+	      modulo = modulo_axis .AND. j.LT.coord_lo_ss
+              IF ( modulo ) THEN
+                 look = MOD(j+axdim-coord_lo_ss,axdim) + coord_lo_ss
+              ELSE
+                 look = j
+              ENDIF
+              IF ( com(i,look,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,look,k,l,m,n)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+                 GOTO 202
+              ENDIF
+ 201       CONTINUE
+* ... process the requested line in Y
+ 202	   DO 210 j = lo_s2, hi_s2
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = j
+                 lo_coord = coords(j-pos0)
+                 no_lo_val = .FALSE.
+	         GOTO 210
+	      ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 210
+              ELSEIF ( next_hi_ss .LT. j ) THEN
+* ... look forward from current position for next valid point
+                 DO 204 jj = j+1, hi_edge
+                    modulo = modulo_axis .AND. jj.GT.coord_hi_ss
+                    IF ( modulo ) THEN
+		       look = MOD(jj+axdim-coord_lo_ss,axdim)+coord_lo_ss
+                    ELSE
+                       look = jj
+                    ENDIF
+                    IF ( com(i,look,k,l,m,n) .NE. bad_res ) THEN
+                       next_hi_ss = look
+                       hi_val = com(i,look,k,l,m,n)
+	               hi_index = look
+		       hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (jj/axdim)*axdim
+	                  hi_coord = hi_coord + (jj/axdim)*axlen
+	               ENDIF
+                       GOTO 208
+                    ENDIF
+ 204             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 210
+              ENDIF
+* ... fill in interpolating value
+ 208          coord    = coords(j-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(j,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 210	   CONTINUE
+
+* FILL ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 301 k = lo_s3, lo_edge, -1
+              modulo = modulo_axis .AND. k.LT.coord_lo_ss
+              IF ( modulo ) THEN
+                 look = MOD(k+axdim-coord_lo_ss,axdim) + coord_lo_ss
+              ELSE
+                 look = k
+              ENDIF
+              IF ( com(i,j,look,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,look,l,m,n)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+	         GOTO 302
+              ENDIF
+ 301       CONTINUE
+* ... process the requested line in Z
+ 302	   DO 310 k = lo_s3, hi_s3
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = k
+                 lo_coord = coords(k-pos0)
+                 no_lo_val = .FALSE.
+	         GOTO 310
+              ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 310
+              ELSEIF ( next_hi_ss .LT. k ) THEN
+* ... look forward from current position for next valid point
+                 DO 304 kk = k+1, hi_edge
+                    modulo = modulo_axis .AND. kk.GT.coord_hi_ss
+                    IF ( modulo ) THEN
+		       look = MOD(kk+axdim-coord_lo_ss,axdim) + coord_lo_ss
+                    ELSE
+                       look = kk
+                    ENDIF
+                    IF ( com(i,j,look,l,m,n) .NE. bad_res ) THEN
+                       next_hi_ss = kk
+                       hi_val = com(i,j,look,l,m,n)
+	               hi_index = look
+                       hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (kk/axdim)*axdim
+	                  hi_coord = hi_coord + (kk/axdim)*axlen
+	               ENDIF
+                       GOTO 308
+                    ENDIF
+ 304             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 310
+              ENDIF
+* ... fill in interpolating value
+ 308          coord    = coords(k-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(k,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 310	   CONTINUE
+
+* FILL ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 401 l = lo_s4, lo_edge, -1
+              modulo = modulo_axis .AND. l.LT.coord_lo_ss
+              IF ( modulo ) THEN
+                 look = MOD(l+axdim-coord_lo_ss,axdim) + coord_lo_ss
+              ELSE
+                 look = l
+              ENDIF
+              IF ( com(i,j,k,look,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,look,m,n)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+	         GOTO 402
+              ENDIF
+ 401       CONTINUE
+* ... process the requested line in T
+ 402	   DO 410 l = lo_s4, hi_s4
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = l
+                 lo_coord = coords(l-pos0)	! fixed 8/95
+                 no_lo_val = .FALSE.
+	         GOTO 410
+	      ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 410
+              ELSEIF ( next_hi_ss .LT. l ) THEN
+* ... look forward from current position for next valid point
+                 DO 404 ll = l+1, hi_edge
+                    modulo = modulo_axis .AND. ll.GT.coord_hi_ss
+                    IF ( modulo ) THEN
+		       look = MOD(ll+axdim-coord_lo_ss,axdim) + coord_lo_ss
+                    ELSE
+                       look = ll
+                    ENDIF
+                    IF ( com(i,j,k,look,m,n) .NE. bad_res ) THEN
+                       next_hi_ss = look
+                       hi_val = com(i,j,k,look,m,n)
+	               hi_index = look
+                       hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (ll/axdim)*axdim
+	                  hi_coord = hi_coord + (ll/axdim)*axlen
+	               ENDIF
+                       GOTO 408
+                    ENDIF
+ 404             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 410
+              ENDIF
+* ... fill in interpolating value
+ 408          coord    = coords(l-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(l,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 410	   CONTINUE
+
+* FILL ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 501 m = lo_s5, lo_edge, -1
+              modulo = modulo_axis .AND. n.LT.coord_lo_ss
+              IF ( modulo ) THEN
+                 look = MOD(m+axdim-coord_lo_ss,axdim) + coord_lo_ss
+              ELSE
+                 look = m
+              ENDIF
+              IF ( com(i,j,k,l,look,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,look,n)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+	         GOTO 502
+              ENDIF
+ 501       CONTINUE
+* ... process the requested line in E
+ 502	   DO 510 m = lo_s5, hi_s5
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = m
+                 lo_coord = coords(m-pos0)	! fixed 8/95
+                 no_lo_val = .FALSE.
+	         GOTO 510
+	      ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 510
+              ELSEIF ( next_hi_ss .LT. m ) THEN
+* ... look forward from current position for next valid point
+                 DO 504 mm = m+1, hi_edge
+                    modulo = modulo_axis .AND. mm.GT.coord_hi_ss
+                    IF ( modulo ) THEN
+		       look = MOD(mm+axdim-coord_lo_ss,axdim) + coord_lo_ss
+                    ELSE
+                       look = mm
+                    ENDIF
+                    IF ( com(i,j,k,l,look,n) .NE. bad_res ) THEN
+                       next_hi_ss = look
+                       hi_val = com(i,j,k,l,look,n)
+	               hi_index = look
+                       hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (mm/axdim)*axdim
+	                  hi_coord = hi_coord + (mm/axdim)*axlen
+	               ENDIF
+                       GOTO 508
+                    ENDIF
+ 504             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 510
+              ENDIF
+* ... fill in interpolating value
+ 508          coord    = coords(m-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(m,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 510	   CONTINUE
+
+* FILL ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+           no_lo_val = .TRUE.
+           next_hi_ss = no_point
+* ... find the closest off-scale low interpolation point in case we need it
+           DO 601 n = lo_s6, lo_edge, -1
+              modulo = modulo_axis .AND. n.LT.coord_lo_ss
+              IF ( modulo ) THEN
+                 look = MOD(n+axdim-coord_lo_ss,axdim) + coord_lo_ss
+              ELSE
+                 look = n
+              ENDIF
+              IF ( com(i,j,k,l,m,look) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,look)
+	         lo_index = look
+	         lo_coord = coords(look-pos0)
+	         IF ( modulo ) THEN
+	            lo_index = lo_index - axdim
+	            lo_coord = lo_coord - axlen
+	         ENDIF
+                 no_lo_val = .FALSE.
+	         GOTO 602
+              ENDIF
+ 601       CONTINUE
+* ... process the requested line in E
+ 602	   DO 610 n = lo_s6, hi_s6
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+	         lo_index = n
+                 lo_coord = coords(n-pos0)	! fixed 8/95
+                 no_lo_val = .FALSE.
+	         GOTO 610
+	      ENDIF
+* ... need to fill a point
+              IF (no_lo_val) THEN
+* ... no lower valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 610
+              ELSEIF ( next_hi_ss .LT. n ) THEN
+* ... look forward from current position for next valid point
+                 DO 604 nn = n+1, hi_edge
+                    modulo = modulo_axis .AND. nn.GT.coord_hi_ss
+                    IF ( modulo ) THEN
+		       look = MOD(nn+axdim-coord_lo_ss,axdim) + coord_lo_ss
+                    ELSE
+                       look = nn
+                    ENDIF
+                    IF ( com(i,j,k,l,m,look) .NE. bad_res ) THEN
+                       next_hi_ss = look
+                       hi_val = com(i,j,k,l,m,look)
+	               hi_index = look
+                       hi_coord = coords(next_hi_ss-pos0)
+		       IF ( modulo ) THEN
+	                  hi_index = hi_index + (nn/axdim)*axdim
+	                  hi_coord = hi_coord + (nn/axdim)*axlen
+	               ENDIF
+                       GOTO 608
+                    ENDIF
+ 604             CONTINUE
+* ... no higher valid point
+                 res(i,j,k,l,m,n) = bad_res
+                 GOTO 610
+              ENDIF
+* ... fill in interpolating value
+ 608          coord    = coords(n-pos0)
+              res(i,j,k,l,m,n) = ( hi_val*(coord-lo_coord)
+     .                         +   lo_val*(hi_coord-coord) )
+     .                         / (hi_coord - lo_coord)
+* ... bad if this interp crosses or lands on the void of a subspan modulo axis 
+	      IF (has_mod_void) THEN
+	        IF ( (lo_index/axdim .NE. hi_index/axdim)
+     .	             .OR. (MOD(n,axdim) .EQ. 0) )
+     .            res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+ 610	   CONTINUE
+
+* TODO: fill along E and F axes?
+
+* FILL ALONG UNSUPPORTED AXIS
+	ELSE
+           STOP '**ERROR: DO_FILL_INTERP on unsupported axis'
+	ENDIF
+
+* always success
+	DO_FILL_INTERP = ferr_ok
+	RETURN
+
+	END
diff --git a/fer/doo/do_fill_near.F b/fer/doo/do_fill_near.F
new file mode 100644
index 0000000..65d69e7
--- /dev/null
+++ b/fer/doo/do_fill_near.F
@@ -0,0 +1,525 @@
+	INTEGER FUNCTION DO_FILL_NEAR(  idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					buff	)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill along axis idim by duplicating the closest available valid pt
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V???:  3/23/99 - based on DO_FILL_AVE
+*         7/2/99 - changed logic so if 2 equi-distant points use the mean
+*                - corrected subscriptong bug in L axis search
+* V550 *sh* 8/02 - support for modulo lengths. ensure that filling 
+*		   does not operate acros the subspan modulo void point
+*	   11/02 - change no_point to a very negative nalue (was -1)
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* Note:  this routine could be made simpler and faster by arranging single
+*        inner loops that looped "loop=1,edge" looking at index-loop and
+*        index+loop to find the first valid point(s)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER TM_MODULO_LINE_DIM, CGRID_AXIS,
+     .		i, j, k, l, m, n, ii, jj, kk, ll, mm, nn, 
+     .          lo_sub(nferdims), hi_sub(nferdims),
+     .		lo_edge, hi_edge, lo_pos, hi_pos, edge,
+     .		npts, line
+	REAL	bad_res, lo_val, hi_val
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* local parameter declarations
+	INTEGER     no_point
+	PARAMETER ( no_point = -99999 )
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	bad_res = mr_bad_data( com_mr )
+	edge = arg
+	line = CGRID_AXIS(idim, com_cx)
+	has_mod_void = TM_ITS_SUBSPAN_MODULO(line)
+	npts = TM_MODULO_LINE_DIM(line)
+
+* compute limits within which calculation is straightforward
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_edge = MAX( lo_sub(idim)-edge, cx_lo_ss(com_cx, idim) )
+	hi_edge = MIN( hi_sub(idim)+edge, cx_hi_ss(com_cx, idim) )
+
+* FILL ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 101 i = lo_edge, lo_s1
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = i
+              ENDIF
+ 101       CONTINUE
+	   DO 110 i = lo_s1, hi_s1
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = i
+	         GOTO 110
+	      ENDIF
+* ... look forward for next valid point
+              IF ( hi_pos .LT. i ) THEN
+                 DO 104 ii = i+1, hi_edge
+                    IF ( com(ii,j,k,l,m,n) .NE. bad_res ) THEN
+                       hi_pos = ii
+                       hi_val = com(ii,j,k,l,m,n)
+                       GOTO 108
+                    ENDIF
+ 104             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 108          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (i/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (i/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+	      IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( i-lo_pos .EQ. hi_pos-i ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( i-lo_pos .LT. hi_pos-i ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(i,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 110	   CONTINUE
+
+* FILL ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 i = lo_s1, hi_s1
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 201 j = lo_edge, lo_s2
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = j
+              ENDIF
+ 201       CONTINUE
+	   DO 210 j = lo_s2, hi_s2
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = j
+	         GOTO 210
+	      ENDIF
+* ... look forward for next valid point
+              IF ( hi_pos .LT. j ) THEN
+                 DO 204 jj = j+1, hi_edge
+                    IF ( com(i,jj,k,l,m,n) .NE. bad_res ) THEN
+                       hi_pos = jj
+                       hi_val = com(i,jj,k,l,m,n)
+                       GOTO 208
+                    ENDIF
+ 204             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 208          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (j/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (j/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+             IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( j-lo_pos .EQ. hi_pos-j ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( j-lo_pos .LT. hi_pos-j ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(j,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 210	   CONTINUE
+
+* FILL ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 301 k = lo_edge, lo_s3
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = k
+              ENDIF
+ 301       CONTINUE
+	   DO 310 k = lo_s3, hi_s3
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = k
+	         GOTO 310
+              ENDIF
+* ... look forward for next valid point
+              IF ( hi_pos .LT. k ) THEN
+                 DO 304 kk = k+1, hi_edge
+                    IF ( com(i,j,kk,l,m,n) .NE. bad_res ) THEN
+                       hi_pos = kk
+                       hi_val = com(i,j,kk,l,m,n)
+                       GOTO 308
+                    ENDIF
+ 304             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 308          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (k/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (k/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+              IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( k-lo_pos .EQ. hi_pos-k ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( k-lo_pos .LT. hi_pos-k ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(k,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 310	   CONTINUE
+
+* FILL ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 401 l = lo_edge, lo_s4
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = l
+              ENDIF
+ 401       CONTINUE
+	   DO 410 l = lo_s4, hi_s4
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = l
+	         GOTO 410
+	      ENDIF
+              IF ( hi_pos .LT. l ) THEN
+* ... look forward for next valid point
+                 DO 404 ll = l+1, hi_edge
+                    IF ( com(i,j,k,ll,m,n) .NE. bad_res ) THEN
+                       hi_pos = ll
+                       hi_val = com(i,j,k,ll,m,n)
+                       GOTO 408
+                    ENDIF
+ 404             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 408          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (l/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (l/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+              IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( l-lo_pos .EQ. hi_pos-l ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( l-lo_pos .LT. hi_pos-l ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(l,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 410	   CONTINUE
+
+
+* FILL ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 501 m = lo_edge, lo_s5
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = m
+              ENDIF
+ 501       CONTINUE
+	   DO 510 m = lo_s5, hi_s5
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = m
+	         GOTO 510
+	      ENDIF
+              IF ( hi_pos .LT. m ) THEN
+* ... Look forward for next valid point
+                 DO 504 mm = m+1, hi_edge
+                    IF ( com(i,j,k,l,mm,n) .NE. bad_res ) THEN
+                       hi_pos = mm
+                       hi_val = com(i,j,k,l,mm,n)
+                       GOTO 508
+                    ENDIF
+ 504             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 508          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (m/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (m/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+              IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( m-lo_pos .EQ. hi_pos-m ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( m-lo_pos .LT. hi_pos-m ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(m,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 510	   CONTINUE
+
+* FILL ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+           lo_pos = no_point
+           hi_pos = no_point
+           DO 601 n = lo_edge, lo_s6
+              IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos =n
+              ENDIF
+ 601       CONTINUE
+	   DO 610 n = lo_s6, hi_s6
+	      IF ( com(i,j,k,l,m,n) .NE. bad_res ) THEN
+	         res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+                 lo_val = com(i,j,k,l,m,n)
+                 lo_pos = n
+	         GOTO 610
+	      ENDIF
+              IF ( hi_pos .LT. n ) THEN
+* ... Look forward for next valid point
+                 DO 604 nn = n+1, hi_edge
+                    IF ( com(i,j,k,l,m,nn) .NE. bad_res ) THEN
+                       hi_pos = nn
+                       hi_val = com(i,j,k,l,m,nn)
+                       GOTO 608
+                    ENDIF
+ 604             CONTINUE
+                 hi_pos = no_point
+              ENDIF
+* ... choose closest valid point
+ 608          IF ( has_mod_void ) THEN
+*    ... forbid crossing a subspan modulo void point
+	         IF (lo_pos.NE.no_point) THEN
+	           IF (n/npts .NE. lo_pos/npts) lo_pos=no_point
+	         ENDIF
+	         IF (hi_pos.NE.no_point) THEN
+	           IF (n/npts .NE. hi_pos/npts) hi_pos=no_point
+	         ENDIF
+	      ENDIF
+
+              IF ( lo_pos.EQ.no_point ) THEN
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = bad_res
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ELSE
+                 IF ( hi_pos.EQ.no_point ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSEIF ( n-lo_pos .EQ. hi_pos-n ) THEN
+                    res(i,j,k,l,m,n) = ( lo_val + hi_val ) /2.
+                 ELSEIF ( n-lo_pos .LT. hi_pos-n ) THEN
+                    res(i,j,k,l,m,n) = lo_val
+                 ELSE
+                    res(i,j,k,l,m,n) = hi_val
+                 ENDIF
+              ENDIF
+	      IF (has_mod_void) THEN
+	         IF (MOD(n,npts) .EQ. 0)
+     .              res(i,j,k,l,m,n) = com(i,j,k,l,m,n)
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+* always success
+	DO_FILL_NEAR = ferr_ok
+	RETURN
+
+	END
diff --git a/fer/doo/do_int_indef.F b/fer/doo/do_int_indef.F
new file mode 100644
index 0000000..bd72416
--- /dev/null
+++ b/fer/doo/do_int_indef.F
@@ -0,0 +1,77 @@
+	INTEGER FUNCTION DO_INT_INDEF(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* integrate the component along axis idim producing an "indefinite" integral
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*	10/11/89 - use DO_INT_INDEF_SUB to avoid adj. array problems
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, box(*), com(*), res(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_INT_INDEF_SUB(	idim, arg,
+     .				cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx,
+     .				box	)
+
+* always success
+	DO_INT_INDEF = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_int_indef_sub.F b/fer/doo/do_int_indef_sub.F
new file mode 100644
index 0000000..00a5199
--- /dev/null
+++ b/fer/doo/do_int_indef_sub.F
@@ -0,0 +1,265 @@
+	SUBROUTINE DO_INT_INDEF_SUB (idim, arg,
+     .					   com_lo, com_hi,
+     .					   com, com_mr, com_cx,
+     .					   res, res_mr, res_cx,
+     .					   box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* integrate the component along axis idim producing an "indefinite" integral
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:	10/11/89 - from old DO_INT_INDEF
+*	  2/7/90 - eliminated diagnostic output - duplicated in calling routine
+* V230: 5/6/92  - COS correction checks that J location is defined
+*       8/10/92 - results were wrong for integration within a single box
+* 9/09 - Apply fix to the cos factor (previous versions of the fix had not
+*        been made), bug1348
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	idim, com_lo, com_hi, com_mr, com_cx, res_mr, res_cx
+	REAL	arg,
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		box( com_lo:com_hi )
+
+* internal variable declarations:
+	LOGICAL	GEOG_COS_FACTOR, need_cos
+	INTEGER i, j, k, l, m, n, grid, lo, hi, axis,
+     .          ii, jj, kk, ll, mm, nn
+	REAL	BOX_SIZE, unit, bad_com, bad_res, cos_factor,
+     .          ybxlo, ybxhi, bx
+	REAL*8	TM_WORLD, dsum
+
+* initialize
+	grid = mr_grid( com_mr )
+	axis = grid_line( idim, grid )
+	lo   = cx_lo_ss( com_cx, idim )
+	hi   = cx_hi_ss( com_cx, idim )
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+* get and save grid box sizes (weights) just once for efficiency
+* (end boxes may be only partially weighted)
+        IF ( lo .EQ. hi ) THEN
+           box(lo) = cx_hi_ww(idim,res_cx) - cx_lo_ww(idim,res_cx)
+        ELSE
+	   box(lo) = TM_WORLD(lo, grid, idim, box_hi_lim)
+     .		   - cx_lo_ww(idim,res_cx)
+	   DO 100 i = lo+1, hi-1
+ 100	   box(i)  = BOX_SIZE( i, grid, idim )
+	   box(hi) = cx_hi_ww(idim,res_cx)
+     .		   - TM_WORLD(hi, grid, idim, box_lo_lim)
+        ENDIF
+
+* perform integrations on standard units if possible
+	unit = un_convert( line_unit_code(axis) )
+	DO 110 i = lo, hi
+ 110	box(i) = box(i) * unit
+
+* INTEGRATE
+* (is double precision summing necessary ? *sh* 6/89)
+* ALONG X AXIS
+* (note: X integration is a special case because it requires COSINE(lat) )
+	IF ( idim .EQ. x_dim ) THEN
+	   need_cos = GEOG_COS_FACTOR( idim, grid )
+     .                .AND. cx_lo_s2(com_cx).NE.unspecified_int4
+	   DO 210 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   IF ( need_cos ) THEN
+#ifdef double_p
+	      cos_factor = COS( deg2rad *       
+     .            TM_WORLD(j, grid, y_dim, box_middle) ) 
+              ybxlo = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_lo_lim)
+              ybxhi = deg2rad* 
+     .            TM_WORLD(j,grid,y_dim,box_hi_lim)
+#else
+	      cos_factor = COS( deg2rad *       
+     .            SNGL( TM_WORLD(j, grid, y_dim, box_middle) ) ) 
+              ybxlo = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .            SNGL( TM_WORLD(j,grid,y_dim,box_hi_lim) )
+#endif
+              bx = ABS(ybxhi - ybxlo)
+	      cos_factor = ABS( SIN(ybxhi) - SIN(ybxlo) )/ bx
+	   ENDIF
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	      dsum = 0.0D0
+	      DO 205 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 200 ii = i, hi
+ 200	            res(ii,j,k,l,m,n) = bad_res
+	            GOTO 210
+	         ENDIF
+	         dsum = dsum + box(i)*com(i,j,k,l,m,n)
+	         IF ( need_cos ) THEN
+	            res(i,j,k,l,m,n) = dsum * cos_factor
+	         ELSE
+	            res(i,j,k,l,m,n) = dsum
+	         ENDIF
+ 205	      CONTINUE
+ 210	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 305 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 300 jj = j, hi
+ 300	            res(i,jj,k,l,m,n) = bad_res
+	            GOTO 310
+	         ENDIF
+	         dsum = dsum + box(j)*com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 305	      CONTINUE
+ 310	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 405 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 400 kk = k, hi
+ 400	            res(i,j,kk,l,m,n) = bad_res
+	            GOTO 410
+	         ENDIF
+	         dsum = dsum + box(k)*com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 405	      CONTINUE
+ 410	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 505 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 500 ll = l, hi
+ 500	            res(i,j,k,ll,m,n) = bad_res
+	            GOTO 510
+	         ENDIF
+	         dsum = dsum + box(l)*com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 505	      CONTINUE
+ 510	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 610 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 605 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 600 mm = m, hi
+ 600	            res(i,j,k,l,mm,n) = bad_res
+	            GOTO 610
+	         ENDIF
+	         dsum = dsum + box(m)*com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 605	      CONTINUE
+ 610	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 710 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 710 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 710 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 710 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 710 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 705 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 700 nn = n, hi
+ 700	            res(i,j,k,l,m,nn) = bad_res
+	            GOTO 710
+	         ENDIF
+	         dsum = dsum + box(n)*com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 705	      CONTINUE
+ 710	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_integ_def.F b/fer/doo/do_integ_def.F
new file mode 100644
index 0000000..dc7a959
--- /dev/null
+++ b/fer/doo/do_integ_def.F
@@ -0,0 +1,80 @@
+	INTEGER FUNCTION DO_INTEG_DEF(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* integrate (producing a single number) the component grid into the result grid
+* (done by calling a single routine used for both averaging and integrating)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*	10/16/89 - changes to adjustable array declarations
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+* ...
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_AVE_INT( isact_integ_def, idim,
+     .			 cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx,
+     .			 box )
+
+	DO_INTEG_DEF = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_internal_gc_fcn.F b/fer/doo/do_internal_gc_fcn.F
new file mode 100644
index 0000000..518405c
--- /dev/null
+++ b/fer/doo/do_internal_gc_fcn.F
@@ -0,0 +1,1008 @@
+      SUBROUTINE DO_INTERNAL_GC_FCN( memory,
+     .				fcn, num_com, com_cx,
+     .				com1, mr1, pdim1, typ1,
+     .				com2, mr2, pdim2, typ2,
+     .				com3, mr3, pdim3, typ3,
+     .				com4, mr4, pdim4, typ4,
+     .				com5, mr5, pdim5, typ5,
+     .				com6, mr6, pdim6, typ6,
+     .				com7, mr7, pdim7, typ7,
+     .				com8, mr8, pdim8, typ8,
+     .				com9, mr9, pdim9, typ9,
+     .				res, mres, pdimr, typr,
+     .                          res_cx, status )
+
+* This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute a grid changing function
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_IMPOSE_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+* V450:  1/97 - new, based on operate.F, but for grid changing functions
+*        7/97 - complete the ZAXREPLACE function
+*       7/25/97 - increase number of args from 4 to 9
+*               - add function PPLGRID
+*       10/30/97 - fixed bug in UNRAVEL introduced in 7/25 changes
+*                       "m5lox" --> "m10lox", etc.
+*       11/12/97 - bug fix in ZAXREPLACE when destination field has missing
+*                       values. New routine EXTRACT_Z_AXIS
+* V491:  4/98 - fixed bugs in ZAXREPLACE: see err491_zaxreplace.jnl
+*       need to guide calculation with  cx lims rather than mr lims of args
+*       (see EXTRACT_Z_LINE) and
+*       need to recognize the missing value flags of the first arg
+* V500:  1/99 *sh* comandeered the TIMES2 function for string argument testing
+*               renamed it to ECHO
+*       2/99 changed UNRAVEL to XUNRAVEL. Added YUNRAVEL, ZUNRAVEL, TUNRAVEL
+*       3/99 - made ECHO into a 2 argument function
+* V510: 8/99 *sh* - added SAMPLE* functions (just copy arg 2 to result here --
+*               the work is done in IS_ALGEBRA and IS_SAMPLE
+* V533: *sh* 6/01 - arguments and result may be string or float
+*                 - added SPAWN function
+* V540: *sh* 12/01 - added STRCMP function
+* V541: *kob* 6/02 - Add STRLEN, UPCASE,DNCASE,STRINDEX, STRRINDEX
+*                        SUBSTRING, STRCAT, STRFLOAT 
+*                    internal string handling functions   
+* V552: *acm* 4/02 - Allow for zero-length strings in STRRINDEX fcn:
+*                    STRRINDEX ("my string", "") had caused Ferret to hang.
+* V580:10/04 *acm* Fix for bug 1037. In zaxreplace, before the loop calling 
+*                  hunt_r4, set the initial guess for ndx_lo to 1 not 0. 
+* V581  3/05 *acm* increase buffer length max_cmnd_len to 2048. 
+*       3/05 *acm& Change call to strfloat, to return bad-flag if input 
+*                  string cannot be converted to float.
+* V600  5/06 *acm* In the fix to STRRINDEX, wrong indices in com2 
+*                  CALL C_STRLEN(com2(1,i2,j2,k2,l2),ii) led to a crash
+*                  when applying STRRINDEX to a list of strings.
+* V68   1/12 *acm* call C_SUBSTR with integers for offset and length.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V68   3/12 *KMS/ACM* see 6D branch: working on string bugs. Remove overloading
+*                   of argument/return-type variable and predimensional (data size)
+*                   array parameter (pointer size to one in double-precision Ferret).
+* V68   5/12 *acm* Add ESEQUENCE, FSEQUENCE, SAMPLEM, SAMPLEN
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+        include 'grid_chg_fcns.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	fcn, num_com, com_cx(9), status,
+     .		mr1, mr2, mr3, mr4, mr5, mr6, mr7, mr8, mr9, mres,
+     .          pdim1, pdim2, pdim3, pdim4, pdim5, pdim6, pdim7,
+     .          pdim8, pdim9, pdimr,
+     .          typ1, typ2, typ3, typ4, typ5, typ6, typ7, typ8, typ9,
+     .          typr, res_cx
+        REAL	memory( mem_blk_size, max_mem_blks )
+	REAL com1( pdim1,m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .             m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .       com2( pdim2,m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .             m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .       com3( pdim3,m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,
+     .             m3lot:m3hit,m3loe:m3hie,m3lof:m3hif ),
+     .       com4( pdim4,m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,
+     .             m4lot:m4hit,m4loe:m4hie,m4lof:m4hif ),
+     .       com5( pdim5,m5lox:m4hix,m5loy:m5hiy,m5loz:m5hiz,
+     .             m5lot:m5hit,m5loe:m5hie,m5lof:m5hif ),
+     .       com6( pdim6,m6lox:m4hix,m6loy:m6hiy,m6loz:m6hiz,
+     .             m6lot:m6hit,m6loe:m6hie,m6lof:m6hif ),
+     .       com7( pdim7,m7lox:m4hix,m7loy:m7hiy,m7loz:m7hiz,
+     .             m7lot:m7hit,m7loe:m7hie,m7lof:m7hif ),
+     .       com8( pdim8,m8lox:m4hix,m8loy:m8hiy,m8loz:m8hiz,
+     .             m8lot:m8hit,m8loe:m8hie,m8lof:m8hif ),
+     .       com9( pdim9,m9lox:m4hix,m9loy:m9hiy,m9loz:m9hiz,
+     .             m9lot:m9hit,m9loe:m9hie,m9lof:m9hif ),
+     .       res( pdimr,m10lox:m10hix,m10loy:m10hiy,m10loz:m10hiz,
+     .            m10lot:m10hit,m10loe:m10hie,m10lof:m10hif )
+
+* internal variable declarations:
+	INTEGER CX_DIM_LEN,  CGRID_SIZE,
+     .		count, size, icom, idim, ii,
+     .		cx1, cx2, cx3,
+     .           i,   j,   k,   l,   m,   n,
+     .           i1,  j1,  k1,  l1,  m1,  n1,
+     .           i2,  j2,  k2,  l2,  m2,  n2,
+     .           i3,  j3,  k3,  l3,  m3,  n3,
+     .          di1, dj1, dk1, dl1, dm1, dn1,
+     .          di2, dj2, dk2, dl2, dm2, dn2,
+     .          di3, dj3, dk3, dl3, dm3, dn3,
+     .          si1, sj1, sk1, sl1, sm1, sn1,
+     .          si2, sj2, sk2, sl2, sm2, sn2,
+     .          si3, sj3, sk3, sl3, sm3, sn3,
+     .          ind(nferdims)
+        INTEGER klo, khi, ndx_lo, wkblk, ioff, ilen
+        INTEGER coded_pointer, uvar, item, start, end   ! for TIMES2
+	REAL    bad_res, bad1, bad2, bad3,
+     .          zval, frac
+        REAL*8  TM_WORLD
+        INTEGER max_cmnd_len
+        PARAMETER ( max_cmnd_len = 2048 )
+        CHARACTER GET_STRING_ELEMENT*(max_cmnd_len), buff*(max_cmnd_len)
+        INTEGER nnew, slen
+
+* equivalence conveniences
+* "inc" is the increments for each axis of each component
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+	INTEGER	inc(nferdims,3), lo(nferdims,3)
+	EQUIVALENCE
+     .      (lo(1,1), si1), (lo(2,1), sj1), (lo(3,1), sk1),
+     .      (lo(4,1), sl1), (lo(5,1), sm1), (lo(6,1), sn1),
+     .      (lo(1,2), si2), (lo(2,2), sj2), (lo(3,2), sk2),
+     .      (lo(4,2), sl2), (lo(5,2), sm2), (lo(6,2), sn2),
+     .      (lo(1,3), si3), (lo(2,3), sj3), (lo(3,3), sk3),
+     .      (lo(4,3), sl3), (lo(5,3), sm3), (lo(6,3), sn3),
+     .      (inc(1,1),di1), (inc(2,1),dj1), (inc(3,1),dk1),
+     .      (inc(4,1),dl1), (inc(5,1),dm1), (inc(6,1),dn1),
+     .      (inc(1,2),di2), (inc(2,2),dj2), (inc(3,2),dk2),
+     .      (inc(4,2),dl2), (inc(5,2),dm2), (inc(6,2),dn2),
+     .      (inc(1,3),di3), (inc(2,3),dj3), (inc(3,3),dk3),
+     .      (inc(4,3),dl3), (inc(5,3),dm3), (inc(6,3),dn3)
+
+* initialization supported for up to three arguments; need to
+* extend if a function is ever created with more than three
+        IF ( num_com .GT. 3 ) THEN
+           STOP '**ERROR: DO_INTERNAL_GC_FCN num_com > 3'
+        ENDIF
+
+* initialize commonly used variables
+        status = ferr_ok
+	cx1 = com_cx(1)
+	cx2 = com_cx(2)
+	cx3 = com_cx(3)
+
+* flag(s) for bad or missing values
+	bad1 = mr_bad_data ( mr1 )
+	bad2 = mr_bad_data ( mr2 )
+	bad3 = mr_bad_data ( mr3 )
+	bad_res = mr_bad_data( mres )
+
+* compute the delta increment for each axis of each component
+	DO 10 icom = 1, num_com
+	DO 10 idim = 1, nferdims
+	   IF ( CX_DIM_LEN(idim,com_cx(icom)) .EQ. 1 ) THEN
+	      inc(idim,icom) = 0
+	   ELSE
+	      inc(idim,icom) = 1
+	   ENDIF
+ 10	CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+* NOTE: 
+	DO 20 icom = 1, num_com
+	DO 20 idim = 1, nferdims
+ 20	lo(idim,icom) = cx_lo_ss(com_cx(icom),idim) - inc(idim,icom)
+
+* select the function
+	GOTO ( 1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,
+     .	       2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,
+     .	       3100,3200,3300,3400,3500,3600 ) fcn
+
+
+* "XSEQUENCE" - reshape/flatten the input into a line in X
+ 1100	IF (typr .EQ. pfcn_rtn_float) THEN
+          i2 = m10lox
+	  DO 1110 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1110 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1110 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1110 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1110 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1110 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,i2,m10loy,m10loz,m10lot,m10loe,m10lof)
+     .             = bad_res
+	     ELSE
+	        res(1,i2,m10loy,m10loz,m10lot,m10loe,m10lof)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     i2 = i2 + 1
+ 1110     CONTINUE
+        ELSE
+          i2 = m10lox
+	  DO 1160 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1160 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1160 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1160 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1160 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1160 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,i2,m10loy,m10loz,m10lot,m10loe,m10lof))
+	     i2 = i2 + 1
+ 1160	  CONTINUE
+        ENDIF
+	RETURN
+
+
+* "TIMES2" (a.k.a. "ECHO") - debugging function
+* ECHO the string that was passed in
+* here is how you check the variable type
+ 1200   IF (mr_category(mr1) .NE. cat_string)
+     .     WRITE (6,*) "ERROR: argument is not a string after all!"
+* here is how you decode the string
+        coded_pointer = mr_variable(mr1)
+* ... note that the uvar number and item number of the string are
+*     packed together in the coded_pointer value
+        IF ( coded_pointer .GT. 0 ) THEN
+* ... as of V5.0 should always come here
+           uvar = coded_pointer/1000
+           item = coded_pointer - 1000*uvar
+           start = uvar_item_start( item, uvar )
+           end   = uvar_item_end  ( item, uvar )
+* ... echo string
+           WRITE (6,'(1X,A)') 
+     .          'You said: '//uvar_text(uvar)(start:end)
+* ... compute result from arg 2
+**** WARNING: This assumes com2 and res dimensions start and end at the same values ****
+	   DO 1205 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	   DO 1205 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	   DO 1205 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 1205 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   DO 1205 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	   DO 1205 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      IF ( com2(1,i,j,k,l,m,n) .EQ. bad2 ) THEN
+	         res(1,i,j,k,l,m,n) = bad_res
+	      ELSE
+	         res(1,i,j,k,l,m,n) = com2(1,i,j,k,l,m,n) * 2.0
+	      ENDIF
+ 1205      CONTINUE
+        ELSE
+* ... for future grids of strings
+           STOP 'illegal string argument encoding'
+!          pointer to array of strings encoded in memory(k,blk)
+!          string = EXTRACT_FROM_STRING_GRID(memory(k,blk),i,j,k,l)
+        ENDIF
+        RETURN
+
+
+* "RESHAPE" - reshape argument 1 into the grid of arg 2. Start output
+* at the i,j,k,l,m,n point given in arg 2. It is commonly useful for taking
+* monthly data and recasting it as a 12 month Z axis by a yearly axis
+ 1300   DO 1310 idim = 1, nferdims
+ 1310	   ind(idim) = cx_lo_ss(cx1,idim)
+	size = CGRID_SIZE(cx1)
+	count = 0	! total points xferred - used to prevent grid overflow
+
+	IF (typr .EQ. pfcn_rtn_float) THEN
+
+	  DO 1350 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	  DO 1350 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 1350 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  DO 1350 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	  DO 1350 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	  DO 1350 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	     count = count + 1
+	     IF ( count .GT. size ) THEN
+	        res(1,i,j,k,l,m,n) = bad_res
+             ELSEIF ( com1(1,ind(1),ind(2),ind(3),ind(4),ind(5),ind(6))
+     .                .EQ. bad1 ) THEN
+	        res(1,i,j,k,l,m,n) = bad_res
+	     ELSE
+	        res(1,i,j,k,l,m,n) = 
+     .                com1(1,ind(1),ind(2),ind(3),ind(4),ind(5),ind(6))
+	     ENDIF
+
+* ... increment the subscripts of the input argument
+	     DO 1320 idim = 1, nferdims
+	        IF (ind(idim) .LT. cx_hi_ss(cx1,idim) ) THEN
+	           ind(idim) = ind(idim) + 1
+	           GOTO 1350
+	        ELSE
+	           ind(idim) =  cx_lo_ss(cx1,idim)
+	        ENDIF
+ 1320	     CONTINUE
+
+ 1350	  CONTINUE
+
+        ELSE
+
+	  DO 1390 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	  DO 1390 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 1390 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  DO 1390 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	  DO 1390 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	  DO 1390 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	     count = count + 1
+	     CALL COPY_C_STRING(
+     .              com1(1,ind(1),ind(2),ind(3),ind(4),ind(5),ind(6)),
+     .              res(1,i,j,k,l,m,n) )
+
+* ... increment the subscripts of the input argument
+	     DO 1360 idim = 1, nferdims
+	        IF (ind(idim) .LT. cx_hi_ss(cx1,idim) ) THEN
+	           ind(idim) = ind(idim) + 1
+	           GOTO 1390
+	        ELSE
+	           ind(idim) =  cx_lo_ss(cx1,idim)
+	        ENDIF
+ 1360	     CONTINUE
+
+ 1390	  CONTINUE
+
+        ENDIF
+	RETURN
+
+
+* "ZAXREPLACE(V,ZVALS,ZAX)" - regrid a sigma-coordinate-style (layered)
+* variable, V, onto a depth axis, ZAX, guided by the depths in ZVALS
+* ... sanity check -- V and ZVALS must match in vertical structure
+ 1400   IF ( (cx_lo_s3(cx1) .NE. cx_lo_s3(cx2))
+     . .OR.  (cx_hi_s3(cx1) .NE. cx_hi_s3(cx2)) ) CALL ERRMSG
+     .		(ferr_limits, status,
+     .		 'Z limits of data and depth fields must match', *5000)
+
+* ... allocate a work array for a single profile of Z depths
+	CALL GET_WORK_SPC( m2hiz-m2loz+1, wkblk, status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+
+* ... loop over the X,Y,T,E,F range of the input fields
+	n1 = sn1
+	n2 = sn2
+	DO 1450 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	 DO 1450 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 1450 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   j1 = sj1
+	   j2 = sj2
+	   DO 1450 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	    DO 1450 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+* ... extract the vertical profile at this I,J,L location
+             CALL EXTRACT_Z_LINE ( com2, bad2, i2, j2, l2, m2, n2,
+     .               cx_lo_s3(cx2), cx_hi_s3(cx2), 
+     .               m2lox, m2hix, m2loy, m2hiy, m2loz, m2hiz,
+     .               m2lot, m2hit, m2loe, m2hie, m2lof, m2hif,
+     .               memory(1,wkblk), klo, khi )
+
+             IF ( klo .LT. 1 ) THEN
+
+* ... no valid data in component 2 at this location
+	        DO 1405 k = mr_lo_s3(mres), mr_hi_s3(mres)
+ 1405              res(1,i,j,k,l,m,n) = bad_res
+
+             ELSE
+
+* loop over the desired output Z-axis points
+!               ndx_lo = 0    ! no guess for location of first depth
+                ndx_lo = 1    ! fixes bug where if zval equals 1st point in axis
+                              ! we got no match.
+	        DO 1410 k = mr_lo_s3(mres), mr_hi_s3(mres)
+
+* ... next Z axis value (com3) to locate
+#ifdef double_p
+                   zval = TM_WORLD(k,cx_grid(cx3),z_dim,box_middle)
+#else
+                   zval = SNGL(TM_WORLD(k,cx_grid(cx3),z_dim,box_middle))
+#endif
+* ... search the Z field (com2) for the index just below this value
+* ... note that ndx_lo is always referenced to a starting index of 1
+                   CALL HUNT_R4(memory(1,wkblk),
+     .                          klo, khi, zval, ndx_lo, frac)
+                   IF ( frac .LT. 0.0 ) THEN
+* ... no luck -- the Z axis value we seek is outside the range in com2
+                      res(1,i,j,k,l,m,n) = bad_res
+                   ELSEIF ( com1(1,i1,j1,sk1+ndx_lo,l1,m1,n1)
+     .                      .EQ. bad1 ) THEN
+                      res(1,i,j,k,l,m,n) = bad_res
+                   ELSEIF ( frac .EQ. 1.0 ) THEN                  ! exactly on point
+                      res(1,i,j,k,l,m,n) =
+     .                   com1(1,i1,j1,sk1+ndx_lo,l1,m1,n1)
+                   ELSEIF ( com1(1,i1,j1,sk1+ndx_lo+1,l1,m1,n1)
+     .                      .EQ. bad1 ) THEN
+                      res(1,i,j,k,l,m,n) = bad_res
+                   ELSE
+* ... interpolate data com1 field to get result
+                      res(1,i,j,k,l,m,n) = 
+     .                   frac  * com1(1,i1,j1,sk1+ndx_lo,  l1,m1,n1)
+     .              + (1-frac) * com1(1,i1,j1,sk1+ndx_lo+1,l1,m1,n1)
+                   ENDIF
+ 1410           CONTINUE
+
+             ENDIF
+
+ 1450	CONTINUE
+        CALL RELEASE_WORK_SPC
+        RETURN
+
+
+* "YSEQUENCE" - reshape/flatten the input into a line in Y
+ 1500	IF (typr .EQ. pfcn_rtn_float) THEN
+	  j2 = m10loy
+	  DO 1510 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1510 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1510 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1510 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1510 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1510 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,m10lox,j2,m10loz,m10lot,m10loe,m10lof)
+     .             = bad_res
+	     ELSE
+	        res(1,m10lox,j2,m10loz,m10lot,m10loe,m10lof)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     j2 = j2 + 1
+ 1510	  CONTINUE
+        ELSE
+	  j2 = m10loy
+	  DO 1560 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1560 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1560 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1560 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1560 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1560 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,m10lox,j2,m10loz,m10lot,m10loe,m10lof))
+	     j2 = j2 + 1
+ 1560	  CONTINUE
+        ENDIF
+	RETURN
+
+
+* "ZSEQUENCE" - reshape/flatten the input into a line in Z
+ 1600	IF (typr .EQ. pfcn_rtn_float) THEN
+	  k2 = m10loz
+	  DO 1610 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1610 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1610 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1610 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1610 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1610 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,m10lox,m10loy,k2,m10lot,m10loe,m10lof)
+     .             = bad_res
+	     ELSE
+	        res(1,m10lox,m10loy,k2,m10lot,m10loe,m10lof)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     k2 = k2 + 1
+ 1610	  CONTINUE
+        ELSE
+	  k2 = m10loz
+	  DO 1660 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1660 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1660 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1660 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1660 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1660 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,m10lox,m10loy,k2,m10lot,m10loe,m10lof))
+	     k2 = k2 + 1
+ 1660	  CONTINUE
+        ENDIF
+	RETURN
+
+
+* "TSEQUENCE" - reshape/flatten the input into a line in T
+ 1700	IF (typr .EQ. pfcn_rtn_float) THEN
+	  l2 = m10lot
+	  DO 1710 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1710 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1710 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1710 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1710 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1710 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,m10lox,m10loy,m10loz,l2,m10loe,m10lof)
+     .             = bad_res
+	     ELSE
+	        res(1,m10lox,m10loy,m10loz,l2,m10loe,m10lof)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     l2 = l2 + 1
+ 1710	  CONTINUE
+        ELSE
+	  l2 = m10lot
+	  DO 1760 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1760 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1760 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1760 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1760 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1760 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,m10lox,m10loy,m10loz,l2,m10loe,m10lof))
+	     l2 = l2 + 1
+ 1760	  CONTINUE
+        ENDIF
+	RETURN
+
+	
+* "ESEQUENCE" - reshape/flatten the input into a line in E
+ 1800	IF (typr .EQ. pfcn_rtn_float) THEN
+	  m2 = m10loe
+	  DO 1810 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1810 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1810 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1810 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1810 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1810 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,m10lox,m10loy,m10loz,m10lot,m2,m10lof)
+     .             = bad_res
+	     ELSE
+	        res(1,m10lox,m10loy,m10loz,m10lot,m2,m10lof)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     m2 = m2 + 1
+ 1810	  CONTINUE
+        ELSE
+	  m2 = m10loe
+	  DO 1860 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1860 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1860 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1860 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1860 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1860 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,m10lox,m10loy,m10loz,m10lot,m2,m10lof))
+	     m2 = m2 + 1
+ 1860	  CONTINUE
+        ENDIF
+	RETURN
+
+	
+* "FSEQUENCE" - reshape/flatten the input into a line in F
+ 1900	IF (typr .EQ. pfcn_rtn_float) THEN
+	  n2 = m10lof
+	  DO 1910 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1910 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1910 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1910 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1910 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1910 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     IF ( com1(1,i,j,k,l,m,n) .EQ. bad1 ) THEN
+	        res(1,m10lox,m10loy,m10loz,m10lot,m10loe,n2)
+     .             = bad_res
+	     ELSE
+	        res(1,m10lox,m10loy,m10loz,m10lot,m10loe,n2)
+     .             = com1(1,i,j,k,l,m,n)
+	     ENDIF
+	     n2 = n2 + 1
+ 1910	  CONTINUE
+        ELSE
+	  n2 = m10lof
+	  DO 1960 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+	  DO 1960 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+	  DO 1960 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+	  DO 1960 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	  DO 1960 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+	  DO 1960 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	     CALL COPY_C_STRING(com1(1,i,j,k,l,m,n),
+     .                 res(1,m10lox,m10loy,m10loz,m10lot,m10loe,n2))
+	     n2 = n2 + 1
+ 1960	  CONTINUE
+        ENDIF
+	RETURN
+
+
+* "SAMPLEI", "SAMPLEJ", "SAMPLEK", "SAMPLEL" , "SAMPLEM", "SAMPLEN"- 
+* just copy arg 2 to result
+* setup for sampling done elsewhere
+ 2000   CONTINUE        ! SAMPLEI
+ 2100   CONTINUE        ! SAMPLEJ
+ 2200   CONTINUE        ! SAMPLEK
+ 2300   CONTINUE        ! SAMPLEL
+ 2400   CONTINUE        ! SAMPLEN
+ 2500   CONTINUE        ! SAMPLEN
+	IF (typr .EQ. pfcn_rtn_float) THEN
+**** WARNING: This assumes com2 and res dimensions start and end at the same values ****
+	  DO 2510 n = cx_lo_s6(cx2), cx_hi_s6(cx2)
+	  DO 2510 m = cx_lo_s5(cx2), cx_hi_s5(cx2)
+	  DO 2510 l = cx_lo_s4(cx2), cx_hi_s4(cx2)
+	  DO 2510 k = cx_lo_s3(cx2), cx_hi_s3(cx2)
+	  DO 2510 j = cx_lo_s2(cx2), cx_hi_s2(cx2)
+	  DO 2510 i = cx_lo_s1(cx2), cx_hi_s1(cx2)
+	     IF ( com2(1,i,j,k,l,m,n) .EQ. bad2 ) THEN
+	        res(1,i,j,k,l,m,n) = bad_res
+	     ELSE
+	        res(1,i,j,k,l,m,n) = com2(1,i,j,k,l,m,n)
+	     ENDIF
+ 2510	  CONTINUE
+        ELSE
+**** WARNING: This assumes com2 and res dimensions start and end at the same values ****
+	  DO 2560 n = cx_lo_s6(cx2), cx_hi_s6(cx2)
+	  DO 2560 m = cx_lo_s5(cx2), cx_hi_s5(cx2)
+	  DO 2560 l = cx_lo_s4(cx2), cx_hi_s4(cx2)
+	  DO 2560 k = cx_lo_s3(cx2), cx_hi_s3(cx2)
+	  DO 2560 j = cx_lo_s2(cx2), cx_hi_s2(cx2)
+	  DO 2560 i = cx_lo_s1(cx2), cx_hi_s1(cx2)
+	     CALL COPY_C_STRING(com2(1,i,j,k,l,m,n),
+     .                           res(1,i,j,k,l,m,n))
+ 2560	  CONTINUE
+        ENDIF
+	RETURN
+
+
+* SPAWN function - perform a Unix system command
+ 2600	CONTINUE
+* ... get the command string to be executed
+        IF (CGRID_SIZE(cx1) .NE. 1) CALL ERRMSG(ferr_invalid_command,
+     .      status, 'SPAWN can only execute a single command', *5000)
+        buff = GET_STRING_ELEMENT(m1lox, m1hix, m1loy, m1hiy,
+     .              m1loz, m1hiz, m1lot, m1hit, m1loe, m1hie,
+     .              m1lof, m1hif,  com1, m1lox, m1loy, m1loz,
+     .              m1lot, m1loe, m1lof, max_cmnd_len, slen)
+        IF (slen .EQ. max_cmnd_len) CALL ERRMSG(ferr_invalid_command,
+     .       status, 'SPAWN command too long -- 500 char max', *5000)
+* ... execute the command and store the results
+        CALL STORE_SYS_STRINGS(buff, res_cx, mres, 1, nnew, status)
+        RETURN
+
+
+* STRCMP function
+ 2700	CONTINUE
+	n1 = sn1
+	n2 = sn2
+	DO 2750 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	 DO 2750 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 2750 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   k1 = sk1
+	   k2 = sk2
+	   DO 2750 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    k2 = k2 + dk2
+	    j1 = sj1
+	    j2 = sj2
+	    DO 2750 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     j2 = j2 + dj2
+	     i1 = si1
+	     i2 = si2
+	     DO 2750 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+	      i2 = i2 + di2
+              CALL C_STRCMP(com1(1,i1,j1,k1,l1,m1,n1),
+     .                      com2(1,i2,j2,k2,l2,m2,n2), ii)
+              res(1,i,j,k,l,m,n) = ii
+ 2750   CONTINUE
+        RETURN
+
+
+* *kob* 3/02 STRLEN function
+ 2800	CONTINUE
+	n1 = sn1
+	DO 2850 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 m1 = sm1
+	 DO 2850 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  l1 = sl1
+	  DO 2850 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   k1 = sk1
+	   DO 2850 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    j1 = sj1
+	    DO 2850 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     i1 = si1
+	     DO 2850 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+              CALL C_STRLEN(com1(1,i1,j1,k1,l1,m1,n1), ii)
+              res(1,i,j,k,l,m,n) = ii
+ 2850   CONTINUE
+        RETURN
+
+* *kob* 3/02 UPCASE function
+ 2900	CONTINUE
+	n1 = sn1
+	DO 2950 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 m1 = sm1
+	 DO 2950 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  l1 = sl1
+	  DO 2950 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   k1 = sk1
+	   DO 2950 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    j1 = sj1
+	    DO 2950 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     i1 = si1
+	     DO 2950 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+              CALL C_UPCASE(com1(1,i1,j1,k1,l1,m1,n1),
+     .                      res(1,i,j,k,l,m,n))
+ 2950   CONTINUE
+        RETURN
+
+
+* *kob* 3/02 STRINDEX function
+ 3000	CONTINUE
+	n1 = sn1
+	n2 = sn2
+	DO 3050 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	 DO 3050 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 3050 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   k1 = sk1
+	   k2 = sk2
+	   DO 3050 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    k2 = k2 + dk2
+	    j1 = sj1
+	    j2 = sj2
+	    DO 3050 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     j2 = j2 + dj2
+	     i1 = si1
+	     i2 = si2
+	     DO 3050 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+	      i2 = i2 + di2
+              CALL C_STRINDEX(com1(1,i1,j1,k1,l1,m1,n1),
+     .                        com2(1,i2,j2,k2,l2,m2,n2), ii)
+              res(1,i,j,k,l,m,n) = ii
+ 3050   CONTINUE
+        RETURN
+
+* *kob* 3/02 STRRINDEX function
+ 3100	CONTINUE
+	n1 = sn1
+	n2 = sn2
+	DO 3150 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	 DO 3150 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 3150 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   k1 = sk1
+	   k2 = sk2
+	   DO 3150 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    k2 = k2 + dk2
+	    j1 = sj1
+	    j2 = sj2
+	    DO 3150 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     j2 = j2 + dj2
+	     i1 = si1
+	     i2 = si2
+	     DO 3150 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+	      i2 = i2 + di2
+              CALL C_STRLEN(com2(1,i2,j2,k2,l2,m2,n2), ii)
+              IF (ii .LE. 0) THEN
+                 CALL C_STRLEN(com1(1,i1,j1,k1,l1,m1,n1), ii)
+                 res(1,i,j,k,l,m,n) = ii
+              ELSE
+                 CALL C_STRRINDEX(com1(1,i1,j1,k1,l1,m1,n1),
+     .                            com2(1,i2,j2,k2,l2,m2,n2), ii)
+                 res(1,i,j,k,l,m,n) = ii
+              ENDIF
+ 3150   CONTINUE
+        RETURN
+
+* *kob* 3/02 DNCASE function
+ 3200	CONTINUE
+	n1 = sn1
+	DO 3250 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 m1 = sm1
+	 DO 3250 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  l1 = sl1
+	  DO 3250 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   k1 = sk1
+	   DO 3250 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    j1 = sj1
+	    DO 3250 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     i1 = si1
+	     DO 3250 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+              CALL C_DNCASE(com1(1,i1,j1,k1,l1,m1,n1),
+     .                      res(1,i,j,k,l,m,n))
+ 3250   CONTINUE
+        RETURN
+
+ 3300	CONTINUE
+* *kob* STRCAT function 3/02
+	n1 = sn1
+	n2 = sn2
+	DO 3350 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	 DO 3350 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 3350 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   k1 = sk1
+	   k2 = sk2
+	   DO 3350 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    k2 = k2 + dk2
+	    j1 = sj1
+	    j2 = sj2
+	    DO 3350 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     j2 = j2 + dj2
+	     i1 = si1
+	     i2 = si2
+	     DO 3350 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+	      i2 = i2 + di2
+              CALL C_STRCAT(com1(1,i1,j1,k1,l1,m1,n1),
+     .                      com2(1,i2,j2,k2,l2,m2,n2),
+     .                      res(1,i,j,k,l,m,n))
+ 3350   CONTINUE
+        RETURN
+
+ 3400	CONTINUE
+* *kob* SUBSTRING function 3/02
+	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 3450 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 n3 = n3 + dn3
+	 m1 = sm1
+	 m2 = sm2
+	 m3 = sm3
+	 DO 3450 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 3450 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   l2 = l2 + dl2
+	   l3 = l3 + dl3
+	   k1 = sk1
+	   k2 = sk2
+	   k3 = sk3
+	   DO 3450 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    k2 = k2 + dk2
+	    k3 = k3 + dk3
+	    j1 = sj1
+	    j2 = sj2
+	    j3 = sj3
+	    DO 3450 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     j2 = j2 + dj2
+	     j3 = j3 + dj3
+	     i1 = si1
+	     i2 = si2
+	     i3 = si3
+	     DO 3450 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+	      i2 = i2 + di2
+	      i3 = i3 + di3
+* Convert the offset and length to integers
+              ioff = com2(1,i2,j2,k2,l2,m2,n2)
+              ilen = com3(1,i3,j3,k3,l3,m3,n3)
+              CALL C_SUBSTR(com1(1,i1,j1,k1,l1,m1,n1),
+     .                      ioff, ilen, res(1,i,j,k,l,m,n))
+ 3450   CONTINUE
+        RETURN
+
+* *kob* 5/02 STRFLOAT function
+ 3500	CONTINUE
+	n1 = sn1
+	DO 3550 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 m1 = sm1
+	 DO 3550 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  l1 = sl1
+	  DO 3550 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   l1 = l1 + dl1
+	   k1 = sk1
+	   DO 3550 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    k1 = k1 + dk1
+	    j1 = sj1
+	    DO 3550 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     j1 = j1 + dj1
+	     i1 = si1
+	     DO 3550 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	      i1 = i1 + di1
+              CALL C_STRFLOAT(com1(1,i1,j1,k1,l1,m1,n1),
+     .                        res(1,i,j,k,l,m,n), bad_res)
+ 3550   CONTINUE
+        RETURN
+
+
+* Undefined functions
+ 3600   CONTINUE
+	STOP '**ERROR: GC FUNCTION NOT IMPLEMENTED'
+
+
+* error exits
+ 5000	RETURN
+	END
diff --git a/fer/doo/do_interpolate.F b/fer/doo/do_interpolate.F
new file mode 100644
index 0000000..89dda27
--- /dev/null
+++ b/fer/doo/do_interpolate.F
@@ -0,0 +1,236 @@
+	INTEGER FUNCTION DO_INTERPOLATE( axis, arg,
+     .					 com, com_mr, com_cx,
+     .					 res, res_mr, res_cx,
+     .					 work	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* interpolate the component grid along the given axis
+* note: if requested interpolation lies beyond the first or last grid point
+*	(but within the edge grid box) then the component context will be
+*	only that single edge point (ss_lo=ss_hi).  The code below will
+*	extrapolate the end value to the box edge.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	axis, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, work(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, ss, ss_lo, ss_hi
+	REAL	bad, delta, c_lo, c_hi, z_lo, z_hi
+	REAL*8	TM_WORLD, ww, ww_lo, ww_hi
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, axis )
+
+* flags for bad/missing data
+        bad = mr_bad_data(res_mr)
+
+* bits and pieces for interpolation
+	ss    = cx_lo_ss(res_cx,axis)
+	ww    = cx_lo_ww(axis,res_cx)
+	ss_lo = cx_lo_ss(com_cx,axis)
+	ss_hi = cx_hi_ss(com_cx,axis)
+	ww_lo = TM_WORLD( ss_lo, cx_grid(com_cx), axis, box_middle )
+	ww_hi = TM_WORLD( ss_hi, cx_grid(com_cx), axis, box_middle )
+	delta = ww_hi - ww_lo
+	IF ( delta .EQ. 0.0 ) THEN
+* ... extrapolate last grid point towards end box edge
+	   c_lo = 1.0
+	   c_hi = 0.0
+	ELSE
+* ... normal interpolation
+	   c_lo    = REAL(ww_hi - ww) / delta
+	   c_hi    = 1.0 - c_lo
+	ENDIF
+
+*       I N T E R P O L A T E
+* ( separate loops for each axis )
+	IF ( axis .EQ. x_dim ) THEN
+
+	   DO 100 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 100 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 100 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 100 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 100 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+
+* source data points
+	      z_lo = com(ss_lo,j,k,l,m,n)
+	      z_hi = com(ss_hi,j,k,l,m,n)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(ss,j,k,l,m,n) = bad
+	      ELSE
+	         res(ss,j,k,l,m,n) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 100	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+
+	   DO 200 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 200 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 200 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 200 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 200 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+
+* source data points
+	      z_lo = com(i,ss_lo,k,l,m,n)
+	      z_hi = com(i,ss_hi,k,l,m,n)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(i,ss,k,l,m,n) = bad
+	      ELSE
+	         res(i,ss,k,l,m,n) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 200	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+
+	   DO 300 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 300 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 300 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 300 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 300 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+
+* source data points
+	      z_lo = com(i,j,ss_lo,l,m,n)
+	      z_hi = com(i,j,ss_hi,l,m,n)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(i,j,ss,l,m,n) = bad
+	      ELSE
+	         res(i,j,ss,l,m,n) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 300	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+
+	   DO 400 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 400 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 400 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 400 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 400 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+
+* source data points
+	      z_lo = com(i,j,k,ss_lo,m,n)
+	      z_hi = com(i,j,k,ss_hi,m,n)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(i,j,k,ss,m,n) = bad
+	      ELSE
+	         res(i,j,k,ss,m,n) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 400	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+
+	   DO 500 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 500 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 500 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 500 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 500 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+
+* source data points
+	      z_lo = com(i,j,k,l,ss_lo,n)
+	      z_hi = com(i,j,k,l,ss_hi,n)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(i,j,k,l,ss,n) = bad
+	      ELSE
+	         res(i,j,k,l,ss,n) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 500	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+
+	   DO 600 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 600 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 600 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 600 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 600 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+
+* source data points
+	      z_lo = com(i,j,k,l,m,ss_lo)
+	      z_hi = com(i,j,k,l,m,ss_hi)
+
+* interpolate
+	      IF (z_lo .EQ. bad .OR. z_hi .EQ. bad ) THEN
+	         res(i,j,k,l,m,ss) = bad
+	      ELSE
+	         res(i,j,k,l,m,ss) = c_lo*z_lo + c_hi*z_hi
+	      ENDIF
+
+ 600	   CONTINUE
+
+	ENDIF
+
+	DO_INTERPOLATE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_lin_regrid.F b/fer/doo/do_lin_regrid.F
new file mode 100644
index 0000000..d983264
--- /dev/null
+++ b/fer/doo/do_lin_regrid.F
@@ -0,0 +1,64 @@
+	SUBROUTINE DO_LIN_REGRID( cx_lims, axis, src, msrc, dst, mdst,
+     .				  work, icoef, itot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the regridding routine with appropriate work arrays
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/25/88
+* V200:  8/3/89 - 4D symmetrical version - regrid only 1 axis
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst, icoef, itot
+	REAL	src(*), dst(*), work(itot)
+
+	CALL LIN_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst,
+     .			    work(1), work(icoef) )
+
+	RETURN
+	END
diff --git a/fer/doo/do_locate.F b/fer/doo/do_locate.F
new file mode 100644
index 0000000..60ff227
--- /dev/null
+++ b/fer/doo/do_locate.F
@@ -0,0 +1,299 @@
+	INTEGER FUNCTION DO_LOCATE( idim, arg,
+     .				 com, com_mr, com_cx,
+     .				 res, res_mr, res_cx,
+     .				 buff	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the world coordinate at which the component grid equals the argument
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  1/11/90
+* V230:  1/22/92 - fixed bug of missing exact equality
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	first_pt, first_lt
+	INTEGER i, j, k, l, m, n, pt, ss1, grid
+	REAL	bad_res, ww1, ww2, del, com1, com2
+	REAL*8	TM_WORLD
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	grid = cx_grid( com_cx )
+	pt   = cx_lo_ss( res_cx, idim )
+	bad_res = mr_bad_data( res_mr )
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	      first_pt = .TRUE.
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 100
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+                    res(pt,j,k,l,m,n) = TM_WORLD(i, grid, idim, box_middle)
+	            GOTO 110
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = i
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = i
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( i,   grid, idim, box_middle )
+	            com1 = com(ss1,j,k,l,m,n)
+	            com2 = com(i  ,j,k,l,m,n)
+	            del = com2 - com1
+	            res(pt,j,k,l,m,n) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 110
+	         ENDIF
+ 100	      CONTINUE
+* ... no zero-crossing found
+	      res(pt,j,k,l,m,n) = bad_res
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      first_pt = .TRUE.
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 200
+                 IF ( com(i,j,k,l,m,n) .EQ. arg) THEN
+	            res(i,pt,k,l,m,n) = TM_WORLD( j, grid, idim, box_middle )
+	            GOTO 210
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = j
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = j
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( j,   grid, idim, box_middle )
+	            com1 = com(i,ss1,k,l,m,n)
+	            com2 = com(i,j  ,k,l,m,n)
+	            del = com2 - com1
+	            res(i,pt,k,l,m,n) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 210
+	         ENDIF
+ 200	      CONTINUE
+* ... no zero-crossing found
+	      res(i,pt,k,l,m,n) = bad_res
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      first_pt = .TRUE.
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 300
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+	            res(i,j,pt,l,m,n) = TM_WORLD ( k, grid, idim, box_middle )
+	            GOTO 310
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = k
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = k
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( k,   grid, idim, box_middle )
+	            com1 = com(i,j,ss1,l,m,n)
+	            com2 = com(i,j,k  ,l,m,n)
+	            del = com2 - com1
+	            res(i,j,pt,l,m,n) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 310
+	         ENDIF
+ 300	      CONTINUE
+* ... no zero-crossing found
+	      res(i,j,pt,l,m,n) = bad_res
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      first_pt = .TRUE.
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 400
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+	            res(i,j,k,pt,m,n) = TM_WORLD( l, grid, idim, box_middle )
+	            GOTO 410
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = l
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = l
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( l,   grid, idim, box_middle )
+	            com1 = com(i,j,k,ss1,m,n)
+	            com2 = com(i,j,k,l,  m,n)
+	            del = com2 - com1
+	            res(i,j,k,pt,m,n) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 410
+	         ENDIF
+ 400	      CONTINUE
+* ... no zero-crossing found
+	      res(i,j,k,pt,m,n) = bad_res
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      first_pt = .TRUE.
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 500
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+	            res(i,j,k,l,pt,n) = TM_WORLD( m, grid, idim, box_middle )
+	            GOTO 510
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = m
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = m
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( m,   grid, idim, box_middle )
+	            com1 = com(i,j,k,l,ss1,n)
+	            com2 = com(i,j,k,l,  m,n)
+	            del = com2 - com1
+	            res(i,j,k,l,pt,n) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 510
+	         ENDIF
+ 500	      CONTINUE
+* ... no zero-crossing found
+	      res(i,j,k,l,pt,n) = bad_res
+ 510	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      first_pt = .TRUE.
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 600
+                 IF ( com(i,j,k,l,m,n) .EQ. arg ) THEN
+	            res(i,j,k,l,m,pt) = TM_WORLD( n, grid, idim, box_middle )
+	            GOTO 610
+	         ELSEIF ( first_pt ) THEN
+	           first_pt = .FALSE.
+		   first_lt = com(i,j,k,l,m,n) .LT. arg
+	           ss1 = n
+		 ELSEIF ( first_lt .EQV. (com(i,j,k,l,m,n).LT.arg) ) THEN
+	           ss1 = n
+		 ELSE
+* ... found a "zero-crossing"
+	            ww1 = TM_WORLD ( ss1, grid, idim, box_middle )
+	            ww2 = TM_WORLD ( n,   grid, idim, box_middle )
+	            com1 = com(i,j,k,l,m,ss1)
+	            com2 = com(i,j,k,l,m,n)
+	            del = com2 - com1
+	            res(i,j,k,l,m,pt) =
+     .                 ( ww2*(arg-com1) + ww1*(com2-arg) ) / del
+	            GOTO 610
+	         ENDIF
+ 600	      CONTINUE
+* ... no zero-crossing found
+	      res(i,j,k,l,m,pt) = bad_res
+ 610	   CONTINUE
+
+	ENDIF
+
+	DO_LOCATE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_max.F b/fer/doo/do_max.F
new file mode 100644
index 0000000..279cc48
--- /dev/null
+++ b/fer/doo/do_max.F
@@ -0,0 +1,210 @@
+	INTEGER FUNCTION DO_MAX( idim, arg,
+     .				 com, com_mr, com_cx,
+     .				 res, res_mr, res_cx,
+     .				 buff	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the MAXIMUM value of the component grid along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, pt
+	REAL	bad_res, maxmum
+
+* internal parameter declaration
+	REAL		too_small
+	PARAMETER     ( too_small = -1.E33 )
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	pt   = cx_lo_ss( res_cx, idim )
+	bad_res = mr_bad_data( res_mr )
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	      maxmum = too_small
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 100
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 100	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(pt,j,k,l,m,n) = bad_res
+	      ELSE
+	         res(pt,j,k,l,m,n) = maxmum
+	      ENDIF
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      maxmum = too_small
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 200
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 200	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(i,pt,k,l,m,n) = bad_res
+	      ELSE
+	         res(i,pt,k,l,m,n) = maxmum
+	      ENDIF
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      maxmum = too_small
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 300
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 300	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(i,j,pt,l,m,n) = bad_res
+	      ELSE
+	         res(i,j,pt,l,m,n) = maxmum
+	      ENDIF
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      maxmum = too_small
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 400
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 400	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(i,j,k,pt,m,n) = bad_res
+	      ELSE
+	         res(i,j,k,pt,m,n) = maxmum
+	      ENDIF
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      maxmum = too_small
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 500
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 500	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(i,j,k,l,pt,n) = bad_res
+	      ELSE
+	         res(i,j,k,l,pt,n) = maxmum
+	      ENDIF
+ 510	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      maxmum = too_small
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 600
+	         IF ( com(i,j,k,l,m,n) .GT. maxmum )
+     .              maxmum = com(i,j,k,l,m,n)
+ 600	      CONTINUE
+	      IF ( maxmum .EQ. too_small ) THEN
+	         res(i,j,k,l,m,pt) = bad_res
+	      ELSE
+	         res(i,j,k,l,m,pt) = maxmum
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	DO_MAX = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_min.F b/fer/doo/do_min.F
new file mode 100644
index 0000000..f011920
--- /dev/null
+++ b/fer/doo/do_min.F
@@ -0,0 +1,210 @@
+	INTEGER FUNCTION DO_MIN( idim, arg,
+     .				 com, com_mr, com_cx,
+     .				 res, res_mr, res_cx,
+     .				 buff	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the minimum value of the component grid along axis idim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, pt
+	REAL	bad_res, minmum
+
+* internal parameter declaration
+	REAL		too_large
+	PARAMETER     ( too_large = 1.E33 )
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	pt   = cx_lo_ss( res_cx, idim )
+	bad_res = mr_bad_data( res_mr )
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	      minmum = too_large
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 100
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 100	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(pt,j,k,l,m,n) = bad_res
+	      ELSE
+	         res(pt,j,k,l,m,n) = minmum
+	      ENDIF
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      minmum = too_large
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 200
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 200	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(i,pt,k,l,m,n) = bad_res
+	      ELSE
+	         res(i,pt,k,l,m,n) = minmum
+	      ENDIF
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      minmum = too_large
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 300
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 300	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(i,j,pt,l,m,n) = bad_res
+	      ELSE
+	         res(i,j,pt,l,m,n) = minmum
+	      ENDIF
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      minmum = too_large
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 400
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 400	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(i,j,k,pt,m,n) = bad_res
+	      ELSE
+	         res(i,j,k,pt,m,n) = minmum
+	      ENDIF
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      minmum = too_large
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 500
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 500	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(i,j,k,l,pt,n) = bad_res
+	      ELSE
+	         res(i,j,k,l,pt,n) = minmum
+	      ENDIF
+ 510	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      minmum = too_large
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx) 
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_res ) GOTO 600
+	         IF ( com(i,j,k,l,m,n) .LT. minmum )
+     .              minmum = com(i,j,k,l,m,n)
+ 600	      CONTINUE
+	      IF ( minmum .EQ. too_large ) THEN
+	         res(i,j,k,l,m,pt) = bad_res
+	      ELSE
+	         res(i,j,k,l,m,pt) = minmum
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	DO_MIN = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_nbad.F b/fer/doo/do_nbad.F
new file mode 100644
index 0000000..5c02f46
--- /dev/null
+++ b/fer/doo/do_nbad.F
@@ -0,0 +1,77 @@
+	INTEGER FUNCTION DO_NBAD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of invalid (flagged bad) points along the given axis
+* (done by calling a single routine used for both ngood and nbad)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V2230:  3/2/92
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+* ...
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_POINTS( isact_bad_pt, idim,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NBAD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_nearest.F b/fer/doo/do_nearest.F
new file mode 100644
index 0000000..d4f2308
--- /dev/null
+++ b/fer/doo/do_nearest.F
@@ -0,0 +1,288 @@
+	SUBROUTINE DO_NEAREST(	idim, by_index, find_above,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* for each point, locate the valid point along the specified axis
+* that is nearest to the point
+
+* This function performs 4 transformations
+*       @CDA - closest distance above (world coord distance)
+*       @CDB - closest distance below (world coord distance)
+*       @CDA - closest index    above
+*       @CDA - closest index    below
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 8/97
+* v491 - *kob* 3.98 - modify loop @450 to use cx_lo/hi_s3 for k 
+*                     rather than s4 *kob*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	LOGICAL by_index, find_above
+	INTEGER	idim, action, com_mr, com_cx, res_mr, res_cx
+        REAL    com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, grid, uplim, dnlim, offlim,
+     .		delta, las_index
+	REAL	bad_com, bad_res
+	REAL*8  TM_WORLD
+
+* --- end of introductory code ---
+
+* initialize
+	grid = mr_grid( com_mr )
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+* determine axis limits along axis of transformation
+	IF ( find_above ) THEN		     ! @NRDA and @NRIA
+	  offlim = cx_hi_ss(com_cx, idim)    ! source data beyond edge
+	  uplim = cx_lo_ss(res_cx, idim)
+	  dnlim = cx_hi_ss(res_cx, idim)
+	  delta = -1
+	ELSE				     ! @NRDB and @NRIB
+	  offlim = cx_lo_ss(com_cx, idim)    ! source data beyond edge
+	  uplim = cx_hi_ss(res_cx, idim)
+	  dnlim = cx_lo_ss(res_cx, idim)
+	  delta =  1
+	ENDIF
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 150 n = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	   DO 150 m = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	   DO 150 l = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	   DO 150 k = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	   DO 150 j = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 110 i = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = i
+ 110	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 120 i = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = i
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(i-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(i,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 120	      CONTINUE
+ 150	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 250 n = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	   DO 250 m = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	   DO 250 l = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	   DO 250 k = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	   DO 250 i = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 210 j = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = j
+ 210	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 220 j = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = j
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(j-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(j,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 220	      CONTINUE
+ 250	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 350 n = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	   DO 350 m = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	   DO 350 l = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	   DO 350 j = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	   DO 350 i = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 310 k = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = k
+ 310	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 320 k = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = k
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(k-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(k,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 320	      CONTINUE
+ 350	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 450 n = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	   DO 450 m = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	   DO 450 k = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	   DO 450 j = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	   DO 450 i = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 410 l = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = l
+ 410	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 420 l = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = l
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(l-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(l,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 420	      CONTINUE
+ 450	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 550 n = cx_lo_s6(res_cx), cx_hi_s6(res_cx)
+	   DO 550 l = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	   DO 550 k = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	   DO 550 j = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	   DO 550 i = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 510 m = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = m
+ 510	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 520 m = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = m
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(m-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(m,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 520	      CONTINUE
+ 550	   CONTINUE
+ 
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 650 m = cx_lo_s5(res_cx), cx_hi_s5(res_cx)
+	   DO 650 l = cx_lo_s4(res_cx), cx_hi_s4(res_cx)
+	   DO 650 k = cx_lo_s3(res_cx), cx_hi_s3(res_cx)
+	   DO 650 j = cx_lo_s2(res_cx), cx_hi_s2(res_cx)
+	   DO 650 i = cx_lo_s1(res_cx), cx_hi_s1(res_cx)
+* ... locate first valid index off edge of requested region
+	      las_index = unspecified_int4
+	      DO 610 n = offlim, dnlim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) las_index = n
+ 610	      CONTINUE
+* ... loop through points finding distance from last valid point
+	      DO 620 n = dnlim, uplim, delta
+	         IF ( com(i,j,k,l,m,n) .NE. bad_com ) THEN
+	            las_index = n
+	            res(i,j,k,l,m,n) = 0.0
+	         ELSEIF ( las_index.EQ. unspecified_int4 ) THEN
+	            res(i,j,k,l,m,n) = bad_res
+	         ELSEIF ( by_index ) THEN
+* ... distance in index space
+	            res(i,j,k,l,m,n) = ABS(n-las_index)
+	         ELSE
+* ... distance in world coordinates
+	            res(i,j,k,l,m,n) = ABS(
+     .                    TM_WORLD(n,         grid, idim, box_middle)
+     .                  - TM_WORLD(las_index, grid, idim, box_middle) )
+	         ENDIF
+ 620	      CONTINUE
+ 650	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/doo/do_nearest_dist_above.F b/fer/doo/do_nearest_dist_above.F
new file mode 100644
index 0000000..6636965
--- /dev/null
+++ b/fer/doo/do_nearest_dist_above.F
@@ -0,0 +1,74 @@
+	INTEGER FUNCTION DO_NEAREST_DIST_ABOVE(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					dummy )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* @CDA: call DO_NEAREST appropriate for closest distance above
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 9/97
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	com(*), res(*), arg, dummy(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* request the actual transform
+* ... CALL DO_NEAREST( idim, .FALSE.<==by_index , .TRUE.<==find_above
+
+	CALL DO_NEAREST( idim, .FALSE., .TRUE.,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NEAREST_DIST_ABOVE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_nearest_dist_below.F b/fer/doo/do_nearest_dist_below.F
new file mode 100644
index 0000000..d591dfe
--- /dev/null
+++ b/fer/doo/do_nearest_dist_below.F
@@ -0,0 +1,74 @@
+	INTEGER FUNCTION DO_NEAREST_DIST_BELOW(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					dummy )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* @CDB: call DO_NEAREST appropriate for closest distance BELOW
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 9/97
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	com(*), res(*), arg, dummy(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* request the actual transform
+* ... CALL DO_NEAREST( idim, .FALSE.<==by_index , .FALSE.<==find_above
+
+	CALL DO_NEAREST( idim, .FALSE., .FALSE.,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NEAREST_DIST_BELOW = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_nearest_index_above.F b/fer/doo/do_nearest_index_above.F
new file mode 100644
index 0000000..383252b
--- /dev/null
+++ b/fer/doo/do_nearest_index_above.F
@@ -0,0 +1,75 @@
+	INTEGER FUNCTION DO_NEAREST_INDEX_ABOVE( idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					dummy )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* @CIA: call DO_NEAREST appropriate for closest index above
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 9/97
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	com(*), res(*), arg, dummy(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* request the actual transform
+* ... CALL DO_NEAREST( idim, .TRUE.<==by_index , .TRUE.<==find_above
+
+	CALL DO_NEAREST( idim, .TRUE., .TRUE.,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NEAREST_INDEX_ABOVE = ferr_ok
+
+	RETURN
+	END
+
diff --git a/fer/doo/do_nearest_index_below.F b/fer/doo/do_nearest_index_below.F
new file mode 100644
index 0000000..9bfde16
--- /dev/null
+++ b/fer/doo/do_nearest_index_below.F
@@ -0,0 +1,75 @@
+	INTEGER FUNCTION DO_NEAREST_INDEX_BELOW( idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					dummy )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* @CIB: call DO_NEAREST appropriate for closest index BELOW
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 9/97
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	com(*), res(*), arg, dummy(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* request the actual transform
+* ... CALL DO_NEAREST( idim, .TRUE.<==by_index , .FALSE.<==find_above
+
+	CALL DO_NEAREST( idim, .TRUE., .FALSE.,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NEAREST_INDEX_BELOW = ferr_ok
+
+	RETURN
+	END
+
diff --git a/fer/doo/do_nearest_regrid.F b/fer/doo/do_nearest_regrid.F
new file mode 100644
index 0000000..8329e4c
--- /dev/null
+++ b/fer/doo/do_nearest_regrid.F
@@ -0,0 +1,70 @@
+	SUBROUTINE DO_NEAREST_REGRID( 
+     .				   cx_lims, axis, src, msrc, dst, mdst,
+     .				   work, icoef, itot )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the regridding routine with appropriate work arrays
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530: 3/01 *sh* based on do_xact_regrid
+* V533: 6/01 *sh* added string regridding support
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst, icoef, itot
+	REAL	src(*), dst(*), work(itot)
+
+	IF (cx_type(cx_lims) .EQ. ptype_string ) THEN
+	   CALL NEAREST_PTR_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst, 
+     .			    work(1), work(icoef) )
+	ELSE
+	   CALL NEAREST_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst, 
+     .			    work(1), work(icoef) )
+	ENDIF
+	
+
+	RETURN
+	END
diff --git a/fer/doo/do_ngood.F b/fer/doo/do_ngood.F
new file mode 100644
index 0000000..2dcda14
--- /dev/null
+++ b/fer/doo/do_ngood.F
@@ -0,0 +1,77 @@
+	INTEGER FUNCTION DO_NGOOD(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of valid (not flagged bad) points along the given axis
+* (done by calling a single routine used for both ngood and nbad)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V2230:  3/2/92
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+* ...
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_POINTS( isact_good_pt, idim,
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx )
+
+	DO_NGOOD = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_points.F b/fer/doo/do_points.F
new file mode 100644
index 0000000..cef63b4
--- /dev/null
+++ b/fer/doo/do_points.F
@@ -0,0 +1,222 @@
+	SUBROUTINE DO_POINTS(	action, idim,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of good and number of bad points along the given axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:   2/3/92 - based on DO_AVE_INT
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* internal variable declarations:
+	LOGICAL	good_un
+	INTEGER i, j, k, l, m, n, pt, ngd, nbd
+	REAL	bad_com, bad_res
+
+* calling argument declarations:
+	INTEGER	action, idim, com_mr, com_cx, res_mr, res_cx
+	REAL    com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* --- end of introductory code ---
+
+* initialize
+        pt   = cx_lo_ss( res_cx, idim )
+	bad_com = mr_bad_data( com_mr )
+        bad_res = mr_bad_data( res_mr )
+	good_un  = action .EQ. isact_good_pt
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 100	      CONTINUE
+              IF ( good_un ) THEN
+                 res(pt,j,k,l,m,n) = ngd
+              ELSE
+                 res(pt,j,k,l,m,n) = nbd
+              ENDIF
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 200	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,pt,k,l,m,n) = ngd
+              ELSE
+                 res(i,pt,k,l,m,n) = nbd
+              ENDIF
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 300	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,pt,l,m,n) = ngd
+              ELSE
+                 res(i,j,pt,l,m,n) = nbd
+              ENDIF
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 400	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,pt,m,n) = ngd
+              ELSE
+                 res(i,j,k,pt,m,n) = nbd
+              ENDIF
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 500	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,l,pt,n) = ngd
+              ELSE
+                 res(i,j,k,l,pt,n) = nbd
+              ENDIF
+ 510	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+                    nbd = nbd + 1
+                 ELSE
+                    ngd = ngd + 1
+                 ENDIF
+ 600	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,l,m,pt) = ngd
+              ELSE
+                 res(i,j,k,l,m,pt) = nbd
+              ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_run_sum.F b/fer/doo/do_run_sum.F
new file mode 100644
index 0000000..f205820
--- /dev/null
+++ b/fer/doo/do_run_sum.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION DO_RUN_SUM(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .                                  box )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sum the component along axis idim producing a "running sum"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  1/27/92 - based on DO_INT_INDEF
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, box(*), com(*), res(*)
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* forward and backwards derivatives are identical except for a shift 
+	CALL DO_RUN_SUM_SUB(	idim, arg,
+     .				cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx )
+
+* always success
+	DO_RUN_SUM = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_run_sum_sub.F b/fer/doo/do_run_sum_sub.F
new file mode 100644
index 0000000..cd1e555
--- /dev/null
+++ b/fer/doo/do_run_sum_sub.F
@@ -0,0 +1,210 @@
+	SUBROUTINE DO_RUN_SUM_SUB (idim, arg,
+     .				   com_lo, com_hi,
+     .				   com, com_mr, com_cx,
+     .				   res, res_mr, res_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sum the component along axis idim producing a "running sum"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  1/27/92 - based on DO_INT_INDEF_SUB
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	idim, com_lo, com_hi, com_mr, com_cx, res_mr, res_cx
+	REAL	arg,
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, grid, lo, hi, axis, ii, jj, 
+     .          kk, ll, mm, nn
+	REAL	bad_com, bad_res
+	REAL*8	dsum
+
+* initialize
+	grid = mr_grid( com_mr )
+	axis = grid_line( idim, grid )
+	lo   = cx_lo_ss( com_cx, idim )
+	hi   = cx_hi_ss( com_cx, idim )
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+* SUM
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	      dsum = 0.0D0
+	      DO 205 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 200 ii = i, hi
+ 200	            res(ii,j,k,l,m,n) = bad_res
+	            GOTO 210
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 205	      CONTINUE
+ 210	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 305 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 300 jj = j, hi
+ 300	            res(i,jj,k,l,m,n) = bad_res
+	            GOTO 310
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 305	      CONTINUE
+ 310	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 405 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 400 kk = k, hi
+ 400	            res(i,j,kk,l,m,n) = bad_res
+	            GOTO 410
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 405	      CONTINUE
+ 410	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 505 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 500 ll = l, hi
+ 500	            res(i,j,k,ll,m,n) = bad_res
+	            GOTO 510
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 505	      CONTINUE
+ 510	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 610 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 605 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 600 mm = m, hi
+ 600	            res(i,j,k,l,mm,n) = bad_res
+	            GOTO 610
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 605	      CONTINUE
+ 610	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 710 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 710 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 710 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 710 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 710 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	      dsum = 0.0D0
+	      DO 705 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) THEN
+* ... reject all data after a bad point
+	            DO 700 nn = n, hi
+ 700	            res(i,j,k,l,m,nn) = bad_res
+	            GOTO 710
+	         ENDIF
+	         dsum = dsum + com(i,j,k,l,m,n)
+	         res(i,j,k,l,m,n) = dsum
+ 705	      CONTINUE
+ 710	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_shift.F b/fer/doo/do_shift.F
new file mode 100644
index 0000000..47ab864
--- /dev/null
+++ b/fer/doo/do_shift.F
@@ -0,0 +1,177 @@
+	INTEGER FUNCTION DO_SHIFT (	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wkbuf	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* shift the data from a component grid into the result grid along axis idim
+* by amount ishift
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/17/87
+* revision 0.1 - 9/9/87  - changed from subroutine to function
+* revision 0.2 - 10/4/88 - kludge fix for 1-D variables where dim1=dim2
+* V200:   6/6/89 - 4D symmetrical - major re-write
+*       10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V230:   8/3/92 - bug: if the requested region had unspecified limits then
+*                  the component is full-span so subtracting shf results in
+*                  exceeding subscript bounds
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wkbuf(*), 
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER ii, shf, i, j, k, l, m, n,
+     .          lo_sub(nferdims), hi_sub(nferdims)
+	REAL	bad_res
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	shf = INT(arg)
+	bad_res = mr_bad_data( res_mr )
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_sub(idim) = cx_lo_ss(com_cx,idim) - shf
+	hi_sub(idim) = cx_hi_ss(com_cx,idim) - shf
+        IF ( lo_sub(idim) .LT. cx_lo_ss(res_cx,idim) ) 
+     .                  lo_sub(idim) = cx_lo_ss(res_cx,idim)  ! 8/92
+        IF ( hi_sub(idim) .GT. cx_hi_ss(res_cx,idim) ) 
+     .                  hi_sub(idim) = cx_hi_ss(res_cx,idim)  ! 8/92
+
+* SHIFT ALONG X
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 100 n = lo_s6, hi_s6
+	   DO 100 m = lo_s5, hi_s5
+	   DO 100 l = lo_s4, hi_s4
+	   DO 100 k = lo_s3, hi_s3
+	   DO 100 j = lo_s2, hi_s2
+	   DO 100 i = lo_s1, hi_s1
+ 100	   res(i,j,k,l,m,n) = com(i+shf,j,k,l,m,n)
+
+* SHIFT ALONG Y
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 200 n = lo_s6, hi_s6
+	   DO 200 m = lo_s5, hi_s5
+	   DO 200 l = lo_s4, hi_s4
+	   DO 200 k = lo_s3, hi_s3
+	   DO 200 j = lo_s2, hi_s2
+	   DO 200 i = lo_s1, hi_s1
+ 200	   res(i,j,k,l,m,n) = com(i,j+shf,k,l,m,n)
+
+* SHIFT ALONG Z
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 300 n = lo_s6, hi_s6
+	   DO 300 m = lo_s5, hi_s5
+	   DO 300 l = lo_s4, hi_s4
+	   DO 300 k = lo_s3, hi_s3
+	   DO 300 j = lo_s2, hi_s2
+	   DO 300 i = lo_s1, hi_s1
+ 300	   res(i,j,k,l,m,n) = com(i,j,k+shf,l,m,n)
+
+* SHIFT ALONG T
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 400 n = lo_s6, hi_s6
+	   DO 400 m = lo_s5, hi_s5
+	   DO 400 l = lo_s4, hi_s4
+	   DO 400 k = lo_s3, hi_s3
+	   DO 400 j = lo_s2, hi_s2
+	   DO 400 i = lo_s1, hi_s1
+ 400	   res(i,j,k,l,m,n) = com(i,j,k,l+shf,m,n)
+
+* SHIFT ALONG E
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 500 n = lo_s6, hi_s6
+	   DO 500 m = lo_s5, hi_s5
+	   DO 500 l = lo_s4, hi_s4
+	   DO 500 k = lo_s3, hi_s3
+	   DO 500 j = lo_s2, hi_s2
+	   DO 500 i = lo_s1, hi_s1
+ 500	   res(i,j,k,l,m,n) = com(i,j,k,l,m+shf,n)
+
+* SHIFT ALONG F
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 600 n = lo_s6, hi_s6
+	   DO 600 m = lo_s5, hi_s5
+	   DO 600 l = lo_s4, hi_s4
+	   DO 600 k = lo_s3, hi_s3
+	   DO 600 j = lo_s2, hi_s2
+	   DO 600 i = lo_s1, hi_s1
+ 600	   res(i,j,k,l,m,n) = com(i,j,k,l,m,n+shf)
+
+	ENDIF
+
+* always successful
+	DO_SHIFT = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_smth_binml.F b/fer/doo/do_smth_binml.F
new file mode 100644
index 0000000..d4ccd54
--- /dev/null
+++ b/fer/doo/do_smth_binml.F
@@ -0,0 +1,88 @@
+	INTEGER FUNCTION DO_SMTH_BINML(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wt	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* smooth along axis idim by a running mean filter
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/2/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wt(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen, status
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+	IF ( MOD(wlen,2).EQ.0 )  CALL ERRMSG(ferr_out_of_range, status,
+     .			'binomial smoother length must be odd', *5000 )
+
+* create weights array to be convolved with data
+	CALL BINOM_WT( wt, wlen )
+
+* now convolve this along the desired axis of the grid
+	CALL CONVOLVE(	idim, wlen/2, wt,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx )
+
+* success
+	DO_SMTH_BINML = ferr_ok
+	RETURN
+
+* error
+ 5000	DO_SMTH_BINML = status
+	RETURN
+	END
diff --git a/fer/doo/do_smth_box.F b/fer/doo/do_smth_box.F
new file mode 100644
index 0000000..ae93214
--- /dev/null
+++ b/fer/doo/do_smth_box.F
@@ -0,0 +1,93 @@
+	INTEGER FUNCTION DO_SMTH_BOX(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wt	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* smooth along axis idim by a running mean filter
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/2/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wt(*), com(*), res(*)
+
+* internal variable declarations
+	LOGICAL	even
+	INTEGER	i, wlen
+	REAL	weight
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+
+* create weights array to be convolved with data
+* (with half weights on ends for even argument given)
+	weight = 1. / FLOAT(wlen)
+	even = MOD(wlen,2) .EQ. 0
+	IF (even) wlen = wlen + 1
+	DO 100 i = 1, wlen
+ 100	wt(i) = weight
+	IF ( even) THEN
+	   wt(1)    = weight * 0.5
+	   wt(wlen) = weight * 0.5
+	ENDIF
+
+* now convolve this along the desired axis of the grid
+	CALL CONVOLVE(	idim, wlen/2, wt,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx )
+
+* success
+	DO_SMTH_BOX = ferr_ok
+	RETURN
+	END
diff --git a/fer/doo/do_smth_hanng.F b/fer/doo/do_smth_hanng.F
new file mode 100644
index 0000000..77e0288
--- /dev/null
+++ b/fer/doo/do_smth_hanng.F
@@ -0,0 +1,89 @@
+	INTEGER FUNCTION DO_SMTH_HANNG(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wt	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* smooth along axis idim by a Hanning filter (window)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 8/91 - based on DO_SMTH_BINML
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wt(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen, status
+	REAL	weight
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+        IF ( MOD(wlen,2).EQ.0 )  CALL ERRMSG(ferr_out_of_range, status,
+     .                  'Hanning smoother length must be odd', *5000 )
+
+* create weights array to be convolved with data
+	CALL HANNG_WT( wt, wlen )
+
+* now convolve this along the desired axis of the grid
+	CALL CONVOLVE(	idim, wlen/2, wt,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx )
+
+* success
+	DO_SMTH_HANNG = ferr_ok
+	RETURN
+
+* error
+ 5000	DO_SMTH_HANNG = status
+	RETURN
+	END
diff --git a/fer/doo/do_smth_max.F b/fer/doo/do_smth_max.F
new file mode 100644
index 0000000..493253e
--- /dev/null
+++ b/fer/doo/do_smth_max.F
@@ -0,0 +1,79 @@
+	INTEGER FUNCTION DO_SMTH_MAX(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					work	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transform along axis idim by a running max filter, based on median one
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V622: 5/2010
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, work(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+
+* now smooth this along the desired axis of the grid
+	CALL MAXSMOOTHER( idim, wlen,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx, work )
+
+* success
+	DO_SMTH_MAX = ferr_ok
+	RETURN
+	END
+
diff --git a/fer/doo/do_smth_median.F b/fer/doo/do_smth_median.F
new file mode 100644
index 0000000..938b6fe
--- /dev/null
+++ b/fer/doo/do_smth_median.F
@@ -0,0 +1,86 @@
+	INTEGER FUNCTION DO_SMTH_MEDIAN(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					work	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transform along axis idim by a running median filter
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V613:  9/24/2008
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, work(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen, status
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+
+	IF ( MOD(wlen,2).EQ.0 )  CALL ERRMSG(ferr_out_of_range, status,
+     .			'Median smoother length must be odd', *5000 )
+
+* now smooth this along the desired axis of the grid
+	CALL MEDIAN(	idim, wlen,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx, work )
+
+* success
+	DO_SMTH_MEDIAN = ferr_ok
+	RETURN
+
+* error
+ 5000	DO_SMTH_MEDIAN = status
+	RETURN
+	END
+
diff --git a/fer/doo/do_smth_min.F b/fer/doo/do_smth_min.F
new file mode 100644
index 0000000..79554ff
--- /dev/null
+++ b/fer/doo/do_smth_min.F
@@ -0,0 +1,79 @@
+	INTEGER FUNCTION DO_SMTH_MIN(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					work	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transform along axis idim by a running min filter, based on median one
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V622: 5/2010
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, work(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+
+* now smooth this along the desired axis of the grid
+	CALL MINSMOOTHER( idim, wlen,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx, work )
+
+* success
+	DO_SMTH_MIN = ferr_ok
+	RETURN
+	END
+
diff --git a/fer/doo/do_smth_parzn.F b/fer/doo/do_smth_parzn.F
new file mode 100644
index 0000000..bb188df
--- /dev/null
+++ b/fer/doo/do_smth_parzn.F
@@ -0,0 +1,88 @@
+	INTEGER FUNCTION DO_SMTH_PARZN(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wt	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* smooth along axis idim by a Parzn filter (window)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 9/91 - based on DO_SMTH_BINML
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wt(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen, status
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+        IF ( MOD(wlen,2).EQ.0 )  CALL ERRMSG(ferr_out_of_range, status,
+     .                  'Parzen smoother length must be odd', *5000 )
+
+* create weights array to be convolved with data
+	CALL PARZN_WT( wt, wlen )
+
+* now convolve this along the desired axis of the grid
+	CALL CONVOLVE(	idim, wlen/2, wt,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx )
+
+* success
+	DO_SMTH_PARZN = ferr_ok
+	RETURN
+
+* error
+ 5000	DO_SMTH_PARZN = status
+	RETURN
+	END
diff --git a/fer/doo/do_smth_welch.F b/fer/doo/do_smth_welch.F
new file mode 100644
index 0000000..86f6077
--- /dev/null
+++ b/fer/doo/do_smth_welch.F
@@ -0,0 +1,88 @@
+	INTEGER FUNCTION DO_SMTH_WELCH(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					wt	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* smooth along axis idim by a Welch filter (window)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 9/91 - based on DO_SMTH_BINML
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, wt(*), com(*), res(*)
+
+* internal variable declarations
+	INTEGER	wlen, status
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	wlen = arg	! length of smoother
+        IF ( MOD(wlen,2).EQ.0 )  CALL ERRMSG(ferr_out_of_range, status,
+     .                  'Welch smoother length must be odd', *5000 )
+
+* create weights array to be convolved with data
+	CALL WELCH_WT( wt, wlen )
+
+* now convolve this along the desired axis of the grid
+	CALL CONVOLVE(	idim, wlen/2, wt,
+     .			com, com_mr, com_cx,
+     .			res, res_mr, res_cx )
+
+* success
+	DO_SMTH_WELCH = ferr_ok
+	RETURN
+
+* error
+ 5000	DO_SMTH_WELCH = status
+	RETURN
+	END
diff --git a/fer/doo/do_stddev.F b/fer/doo/do_stddev.F
new file mode 100755
index 0000000..0e4724d
--- /dev/null
+++ b/fer/doo/do_stddev.F
@@ -0,0 +1,80 @@
+	INTEGER FUNCTION DO_STDDEV (	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the variance of the given field along the indicated axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  3/2/92
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+	LOGICAL stddev
+
+	stddev = .TRUE.
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_VAR_SUB( idim,
+     .			 cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx,
+     .			 box, stddev )
+
+	DO_STDDEV = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_string_goodbad.F b/fer/doo/do_string_goodbad.F
new file mode 100644
index 0000000..ddfca9a
--- /dev/null
+++ b/fer/doo/do_string_goodbad.F
@@ -0,0 +1,236 @@
+	SUBROUTINE DO_STRING_GOODBAD (	idim, trans,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Count the number of "FERRET Ver. 6.14" and "bad" values in the string array data,
+* where FERRET Ver. 6.14 means length > 0
+
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, trans, com_mr, com_cx, res_mr, res_cx
+	REAL*8  com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+	REAL    res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	LOGICAL	good_un
+	INTEGER GET_C_STRING_LEN, 
+     .          ii, i, j, k, l, m, n, pt, ngd, nbd, slen
+	REAL	bad_res
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+        pt   = cx_lo_ss( res_cx, idim )
+        bad_res = mr_bad_data( res_mr )
+	good_un  = trans .EQ. trans_good_pt
+
+* Write a note about missing values of strings 
+
+        IF (good_un) THEN
+	   CALL WARN
+     .    ('@NGD of string variable, counting null strings as missing')
+        ELSE
+	   CALL WARN
+     .    ('@NBD of string variable, counting null strings as missing')
+        ENDIF
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 100	      CONTINUE
+              IF ( good_un ) THEN
+                 res(pt,j,k,l,m,n) = ngd
+              ELSE
+                 res(pt,j,k,l,m,n) = nbd
+              ENDIF
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 200	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,pt,k,l,m,n) = ngd
+              ELSE
+                 res(i,pt,k,l,m,n) = nbd
+              ENDIF
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 300	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,pt,l,m,n) = ngd
+              ELSE
+                 res(i,j,pt,l,m,n) = nbd
+              ENDIF
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 400	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,pt,m,n) = ngd
+              ELSE
+                 res(i,j,k,pt,m,n) = nbd
+              ENDIF
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 500	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,l,pt,n) = ngd
+              ELSE
+                 res(i,j,k,l,pt,n) = nbd
+              ENDIF
+ 510	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              ngd = 0
+              nbd = 0
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         slen = GET_C_STRING_LEN(com(i,j,k,l,m,n))
+		 IF ( slen .GT. 0 ) THEN
+                    ngd = ngd + 1
+                 ELSE
+                    nbd = nbd + 1
+                 ENDIF
+ 600	      CONTINUE
+              IF ( good_un ) THEN
+                 res(i,j,k,l,m,pt) = ngd
+              ELSE
+                 res(i,j,k,l,m,pt) = nbd
+              ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+* success
+	RETURN
+	END
diff --git a/fer/doo/do_string_shift.F b/fer/doo/do_string_shift.F
new file mode 100644
index 0000000..5e9f0f3
--- /dev/null
+++ b/fer/doo/do_string_shift.F
@@ -0,0 +1,162 @@
+	SUBROUTINE DO_STRING_SHIFT (	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* shift the string array data from a component grid into the result grid
+* along axis idim by amount ishift
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533: *sh* 7/01 - based upon DO_SHIFT
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg 
+	REAL*8  com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER ii, shf, i, j, k, l, m, n,
+     .          lo_sub(nferdims), hi_sub(nferdims)
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	shf = INT(arg)
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+	lo_sub(idim) = cx_lo_ss(com_cx,idim) - shf
+	hi_sub(idim) = cx_hi_ss(com_cx,idim) - shf
+        IF ( lo_sub(idim) .LT. cx_lo_ss(res_cx,idim) ) 
+     .                  lo_sub(idim) = cx_lo_ss(res_cx,idim)  ! 8/92
+        IF ( hi_sub(idim) .GT. cx_hi_ss(res_cx,idim) ) 
+     .                  hi_sub(idim) = cx_hi_ss(res_cx,idim)  ! 8/92
+
+* SHIFT ALONG X
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 100 n = lo_s6, hi_s6
+	   DO 100 m = lo_s5, hi_s5
+	   DO 100 l = lo_s4, hi_s4
+	   DO 100 k = lo_s3, hi_s3
+	   DO 100 j = lo_s2, hi_s2
+	   DO 100 i = lo_s1, hi_s1
+ 100	   CALL COPY_C_STRING( com(i+shf,j,k,l,m,n), res(i,j,k,l,m,n) )
+
+* SHIFT ALONG Y
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 200 n = lo_s6, hi_s6
+	   DO 200 m = lo_s5, hi_s5
+	   DO 200 l = lo_s4, hi_s4
+	   DO 200 k = lo_s3, hi_s3
+	   DO 200 j = lo_s2, hi_s2
+	   DO 200 i = lo_s1, hi_s1
+ 200	   CALL COPY_C_STRING( com(i,j+shf,k,l,m,n), res(i,j,k,l,m,n) )
+
+* SHIFT ALONG Z
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 300 n = lo_s6, hi_s6
+	   DO 300 m = lo_s5, hi_s5
+	   DO 300 l = lo_s4, hi_s4
+	   DO 300 k = lo_s3, hi_s3
+	   DO 300 j = lo_s2, hi_s2
+	   DO 300 i = lo_s1, hi_s1
+ 300	   CALL COPY_C_STRING( com(i,j,k+shf,l,m,n), res(i,j,k,l,m,n) )
+
+* SHIFT ALONG T
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 400 n = lo_s6, hi_s6
+	   DO 400 m = lo_s5, hi_s5
+	   DO 400 l = lo_s4, hi_s4
+	   DO 400 k = lo_s3, hi_s3
+	   DO 400 j = lo_s2, hi_s2
+	   DO 400 i = lo_s1, hi_s1
+ 400	   CALL COPY_C_STRING( com(i,j,k,l+shf,m,n), res(i,j,k,l,m,n) )
+ 
+* SHIFT ALONG E
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 500 n = lo_s6, hi_s6
+	   DO 500 m = lo_s5, hi_s5
+	   DO 500 l = lo_s4, hi_s4
+	   DO 500 k = lo_s3, hi_s3
+	   DO 500 j = lo_s2, hi_s2
+	   DO 500 i = lo_s1, hi_s1
+ 500	   CALL COPY_C_STRING( com(i,j,k,l,m+shf,n), res(i,j,k,l,m,n) )
+
+* SHIFT ALONG F
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 600 n = lo_s6, hi_s6
+	   DO 600 m = lo_s5, hi_s5
+	   DO 600 l = lo_s4, hi_s4
+	   DO 600 k = lo_s3, hi_s3
+	   DO 600 j = lo_s2, hi_s2
+	   DO 600 i = lo_s1, hi_s1
+ 600	   CALL COPY_C_STRING( com(i,j,k,l,m,n+shf), res(i,j,k,l,m,n) )
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_sum.F b/fer/doo/do_sum.F
new file mode 100644
index 0000000..d4d362e
--- /dev/null
+++ b/fer/doo/do_sum.F
@@ -0,0 +1,215 @@
+	INTEGER FUNCTION DO_SUM( idim, arg,
+     .				 com, com_mr, com_cx,
+     .				 res, res_mr, res_cx,
+     .				 buff	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute a simple sum of the data between the indicated limits
+* Boxes at the ends of the region will always be fully counted - no weighting
+* based on the fraction of the box within the region as with integrals
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V230: 12/91 - based on DO_MAX
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, buff(*),
+     .          com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+        LOGICAL all_bad
+	INTEGER i, j, k, l, m, n, pt
+	REAL	bad_com, bad_res 
+	REAL*8  sum
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+* initialize
+	pt   = cx_lo_ss( res_cx, idim )
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 110 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 110 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 110 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 110 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 100 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 100
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 100	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(pt,j,k,l,m,n) = bad_res
+	      ELSE
+	         res(pt,j,k,l,m,n) = sum
+	      ENDIF
+ 110	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 200 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 200
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 200	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(i,pt,k,l,m,n) = bad_res
+	      ELSE
+	         res(i,pt,k,l,m,n) = sum
+	      ENDIF
+ 210	   CONTINUE
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 300 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 300
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 300	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(i,j,pt,l,m,n) = bad_res
+	      ELSE
+	         res(i,j,pt,l,m,n) = sum
+	      ENDIF
+ 310	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 400 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 400
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 400	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(i,j,k,pt,m,n) = bad_res
+	      ELSE
+	         res(i,j,k,pt,m,n) = sum
+	      ENDIF
+ 410	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 500 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 500
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 500	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(i,j,k,l,pt,n) = bad_res
+	      ELSE
+	         res(i,j,k,l,pt,n) = sum
+	      ENDIF
+ 510	   CONTINUE
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+              all_bad = .TRUE.
+              sum = 0.0D0
+	      DO 600 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 600
+                 sum = sum + com(i,j,k,l,m,n)
+                 all_bad = .FALSE.
+ 600	      CONTINUE
+	      IF ( all_bad ) THEN
+	         res(i,j,k,l,m,pt) = bad_res
+	      ELSE
+	         res(i,j,k,l,m,pt) = sum
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	DO_SUM = ferr_ok
+	RETURN
+	END
+
diff --git a/fer/doo/do_var_sub.F b/fer/doo/do_var_sub.F
new file mode 100644
index 0000000..1472dd2
--- /dev/null
+++ b/fer/doo/do_var_sub.F
@@ -0,0 +1,425 @@
+	SUBROUTINE DO_VAR_SUB(	idim, com_lo, com_hi,
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx,
+     .				box, stddev )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* (what about COSINE weighting along Y axis if in XY plane ??)
+* determine the variance along the indicated axis
+* nested with DO_VARIANCE in order to ease the dimension checking of box
+
+* calculation is done in two passes to accomodate unequal weighting and
+* to increase numerical stability 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:   3/2/92
+* V420: 11/95 - converted diff and mean to DP so variance is calc in DP
+*	 2/96 - fix bug introduced in 11/95: CGRID_AXIS has wrong args
+* V664:  8/10 - implement robust method for computing variances
+* V672+: 1/12 - previous checkin had wrong indices for result. Return to 
+*               divide by n, not n+1
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+*
+* v687  3/14  *acm* Option to return standard deviation
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* internal variable declarations:
+	LOGICAL stddev
+	INTEGER CGRID_AXIS, i, j, k, l, m, n,
+     .          grid, pt, lo, hi, axis, npt
+	REAL	BOX_SIZE, bad_com, bad_res
+	REAL*8	TM_WORLD, dsum, bsum, mean, diff
+	REAL*8  x, xmean, xdelta
+
+
+* calling argument declarations:
+	INTEGER	idim, com_lo, com_hi, com_mr, com_cx, res_mr, res_cx
+	REAL    com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		box( com_lo:com_hi )
+
+* --- end of introductory code ---
+
+* initialize
+	grid = mr_grid( com_mr )
+	axis = CGRID_AXIS( idim, com_cx )
+	pt   = cx_lo_ss( res_cx, idim )
+	lo   = com_lo
+	hi   = com_hi
+	bad_com = mr_bad_data( com_mr )
+	bad_res = mr_bad_data( res_mr )
+
+* get and save grid box sizes (weights) just once for efficiency
+* (end boxes may be only partially weighted)
+	box(lo) = TM_WORLD(lo, grid, idim, box_hi_lim)
+     .		- cx_lo_ww(idim,res_cx)
+	DO 100 i = lo+1, hi-1
+ 100	box(i)  = BOX_SIZE( i, grid, idim )
+	box(hi) = cx_hi_ww(idim,res_cx)
+     .		- TM_WORLD(hi, grid, idim, box_lo_lim)
+
+* ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 210 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 210 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 210 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 210 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 210 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 200 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 200
+	         bsum = bsum + box(i)
+	         dsum = dsum + box(i)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 200	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(pt,j,k,l,m,n) = bad_res
+                 GOTO 210
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+              DO 205 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+                    npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 205          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(pt,j,k,l,m,n) = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(pt,j,k,l,m,n) = dsum / FLOAT(npt)
+	      ENDIF
+ 210	   CONTINUE
+
+* ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+
+	   DO 310 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 310 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 310 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 310 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 310 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 300 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 300
+	         bsum = bsum + box(j)
+	         dsum = dsum + box(j)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 300	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(i,pt,k,l,m,n) = bad_res
+                 GOTO 310
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+              DO 305 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+	            npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 305          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(i,pt,k,l,m,n)  = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(i,pt,k,l,m,n) = dsum / FLOAT(npt)
+	      ENDIF
+ 310	   CONTINUE
+
+
+* ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 410 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 410 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 410 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 410 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 410 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 400 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 400
+	         bsum = bsum + box(k)
+	         dsum = dsum + box(k)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 400	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(i,j,pt,l,m,n) = bad_res
+                 GOTO 410
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+	      DO 405 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+	            npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 405          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(i,j,pt,l,m,n)  = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(i,j,pt,l,m,n) = dsum / FLOAT(npt)
+	      ENDIF
+ 410	   CONTINUE
+
+* ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 510 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 510 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 510 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 510 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 510 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 500 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 500
+	         bsum = bsum + box(l)
+	         dsum = dsum + box(l)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 500	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(i,j,k,pt,m,n) = bad_res
+                 GOTO 510
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+	      DO 505 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+		    npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 505          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(i,j,k,pt,m,n)  = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(i,j,k,pt,m,n) = dsum / FLOAT(npt)
+	      ENDIF
+ 510	   CONTINUE
+
+* ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 610 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	   DO 610 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 610 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 610 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 610 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 600 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 600
+	         bsum = bsum + box(m)
+	         dsum = dsum + box(m)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 600	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(i,j,k,l,pt,n) = bad_res
+                 GOTO 610
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+	      DO 605 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+		    npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 605          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(i,j,k,l,pt,n)  = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(i,j,k,l,pt,n) = dsum / FLOAT(npt)
+	      ENDIF
+ 610	   CONTINUE
+
+* ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 710 m = cx_lo_s5(com_cx), cx_hi_s5(com_cx)
+	   DO 710 l = cx_lo_s4(com_cx), cx_hi_s4(com_cx)
+	   DO 710 k = cx_lo_s3(com_cx), cx_hi_s3(com_cx)
+	   DO 710 j = cx_lo_s2(com_cx), cx_hi_s2(com_cx)
+	   DO 710 i = cx_lo_s1(com_cx), cx_hi_s1(com_cx)
+* ... Pass #1: determine mean
+              npt = 0
+	      dsum = 0.0D0	! data
+	      bsum = 0.0D0	! boxes
+	      DO 700 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         IF ( com(i,j,k,l,m,n) .EQ. bad_com ) GOTO 700
+	         bsum = bsum + box(n)
+	         dsum = dsum + box(n)*com(i,j,k,l,m,n)
+                 npt = npt + 1
+ 700	      CONTINUE
+	      IF ( npt .LE. 1 ) THEN
+	         res(i,j,k,l,m,pt) = bad_res
+                 GOTO 710
+	      ELSE
+                 mean = dsum / bsum
+              ENDIF
+
+* ... Pass #2: determine variance or std dev
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	      npt = 0
+              xmean = 0.D0
+              dsum = 0.D0
+	      DO 705 n = cx_lo_s6(com_cx), cx_hi_s6(com_cx)
+	         x = com(i,j,k,l,m,n)
+                 IF ( x .NE. bad_com ) THEN
+		    npt = npt + 1
+		    x = x - mean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/ FLOAT(npt)
+                    dsum = dsum + xdelta*(x - xmean)  ! This expression uses the new value of mean
+                  ENDIF
+ 705          CONTINUE
+* because of checking above, npt .GT. 1
+	      IF (stddev) THEN
+                 res(i,j,k,l,m,pt) = SQRT( dsum / FLOAT(npt) )
+	      ELSE
+                 res(i,j,k,l,m,pt) = dsum / FLOAT(npt)
+	      ENDIF
+ 710	   CONTINUE
+
+	ENDIF
+
+* success
+	RETURN
+	END
diff --git a/fer/doo/do_variance.F b/fer/doo/do_variance.F
new file mode 100644
index 0000000..992ce8f
--- /dev/null
+++ b/fer/doo/do_variance.F
@@ -0,0 +1,81 @@
+	INTEGER FUNCTION DO_VARIANCE(	idim, arg,
+     .					com, com_mr, com_cx,
+     .					res, res_mr, res_cx,
+     .					box	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the variance of the given field along the indicated axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230:  3/2/92
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, com_mr, com_cx, res_mr, res_cx
+	REAL	arg, com(*), res(*), box(*)
+
+* internal variable declarations:
+	LOGICAL stddev
+
+	stddev = .FALSE.
+
+
+* diagnostic mode output: " doing --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing', isact_class_trans, res_cx, idim )
+
+	CALL DO_VAR_SUB( idim,
+     .			 cx_lo_ss(com_cx,idim), cx_hi_ss(com_cx,idim),
+     .			 com, com_mr, com_cx,
+     .			 res, res_mr, res_cx,
+     .			 box, stddev )
+
+	DO_VARIANCE = ferr_ok
+
+	RETURN
+	END
diff --git a/fer/doo/do_window_regrid.F b/fer/doo/do_window_regrid.F
new file mode 100644
index 0000000..63a5e5a
--- /dev/null
+++ b/fer/doo/do_window_regrid.F
@@ -0,0 +1,65 @@
+	SUBROUTINE DO_WINDOW_REGRID( cx_lims, axis, trans, 
+     .				    src, msrc, dst, mdst,
+     .				    work, itot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the regridding routine with appropriate work array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420:  10/95 - based on DO_AVE_REGRID
+* V510: *sh* 1/00 - 2 work arrays passed out instead of one
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, trans, msrc, mdst, itot
+	REAL	src(*), dst(*), work(2*itot)
+
+	CALL WINDOW_REGRID_1_AXIS(   cx_lims, axis, trans,
+     .			   cx_lo_ss(cx_lims,x_dim), cx_hi_ss(cx_lims,x_dim),
+     .			   cx_lo_ss(cx_lims,y_dim), cx_hi_ss(cx_lims,y_dim),
+     .			   src, msrc, dst, mdst,
+     .			   work(1), work(itot+1), itot )
+
+	RETURN
+	END
diff --git a/fer/doo/do_xact_regrid.F b/fer/doo/do_xact_regrid.F
new file mode 100644
index 0000000..a823bd6
--- /dev/null
+++ b/fer/doo/do_xact_regrid.F
@@ -0,0 +1,68 @@
+	SUBROUTINE DO_XACT_REGRID( cx_lims, axis, src, msrc, dst, mdst,
+     .				   work, icoef, itot )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the regridding routine with appropriate work arrays
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 10/97
+* V533 *sh* 6/01 - added string regridding support
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst, icoef, itot
+	REAL	src(*), dst(*), work(itot)
+
+	IF (cx_type(cx_lims) .EQ. ptype_string ) THEN
+	   CALL XACT_PTR_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst, 
+     .			    work(1), work(icoef) )
+	ELSE
+	   CALL XACT_REGRID_1_AXIS( cx_lims, axis,
+     .			    cx_lo_ss(cx_lims,axis), cx_hi_ss(cx_lims,axis),
+     .			    src, msrc, dst, mdst, 
+     .			    work(1), work(icoef) )
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/do_xyave_regrid.F b/fer/doo/do_xyave_regrid.F
new file mode 100644
index 0000000..7876c46
--- /dev/null
+++ b/fer/doo/do_xyave_regrid.F
@@ -0,0 +1,67 @@
+	SUBROUTINE DO_XYAVE_REGRID( cx_lims, src, msrc, dst, mdst,
+     .				    work, src_cx, dst_cx, iwork2, itot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the xy-area regridding routine with appropriate work arrays
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 12/1/89 - 4D symmetrical version - regrid only 1 axis
+* V552:  4/04 *acm* - bug fix.  For @AVE and related transforms @SUM, etc.
+*                     send src_lo_ss and src_hi_ss for the range on the src
+*                     axis.  
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst, iwork2, itot, src_cx, dst_cx
+	REAL	src(*), dst(*), work(itot)
+
+	CALL XYAVE_REGRID( cx_lims,
+     .			   cx_lo_ss(cx_lims,x_dim), cx_hi_ss(cx_lims,x_dim),
+     .			   cx_lo_ss(cx_lims,y_dim), cx_hi_ss(cx_lims,y_dim),
+     .			   src, msrc, dst, mdst, src_cx, dst_cx, 
+     .                     work(1), work(iwork2) )
+
+	RETURN
+	END
diff --git a/fer/doo/do_xylin_regrid.F b/fer/doo/do_xylin_regrid.F
new file mode 100644
index 0000000..45447dd
--- /dev/null
+++ b/fer/doo/do_xylin_regrid.F
@@ -0,0 +1,70 @@
+	SUBROUTINE DO_XYLIN_REGRID( cx_lims, src, msrc, dst, mdst,
+     .				    work, src_cx, dst_cx, 
+     .				    iwork2, iwork3, iwork4, iwork5, 
+     .				    itot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* call the xy-linear regridding routine with appropriate work arrays
+* 
+
+* programmer - Ansley Manke, from do_xyave_regrid.F
+* NOAA/PMEL, Seattle, WA - TMAP
+*
+* 6/22/2011
+*                    The XY linear regridding matches past Ferret behavior, 
+*                    not using bilinear regridding for now
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, mdst, iwork2, iwork3, iwork4, iwork5,
+     .          itot, src_cx, dst_cx
+	REAL	src(*), dst(*), work(itot)
+
+	CALL XYLIN_REGRID( cx_lims,
+     .			   cx_lo_ss(cx_lims,x_dim), cx_hi_ss(cx_lims,x_dim),
+     .			   cx_lo_ss(cx_lims,y_dim), cx_hi_ss(cx_lims,y_dim),
+     .			   src, msrc, dst, mdst, src_cx, dst_cx, 
+     .                     work(1), work(iwork2), work(iwork3), work(iwork4),
+     .                     work(iwork5) )
+
+	RETURN
+	END
diff --git a/fer/doo/geog_cos_factor.F b/fer/doo/geog_cos_factor.F
new file mode 100644
index 0000000..6df9323
--- /dev/null
+++ b/fer/doo/geog_cos_factor.F
@@ -0,0 +1,84 @@
+	LOGICAL FUNCTION GEOG_COS_FACTOR( idim, grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular axis of a grid represents geographical
+* locations (lat.,long., etc.) requiring COS corrections
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/25/88
+* V230:  7/23/92 - TRUE only if grid has a valid latitude axis (major rewrite)
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+        include 'xunits.cmn_text'
+        external xunits_data
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER		idim, grid
+
+* internal variable declarations:
+	INTEGER		xaxis, yaxis
+
+* check for program bug	! temp
+	IF ( grid .EQ. unspecified_int4 ) STOP 'no_grd_orient'
+
+* initialize
+	xaxis = grid_line( x_dim, grid )
+	yaxis = grid_line( y_dim, grid )
+
+* check that the X and Y axes of this grid are both degrees
+* assume the calling routine calls this only for lat or long
+*     (so the orientation of idim is not checked here)
+
+	IF ( xaxis .EQ. mnormal .OR. xaxis .EQ. munknown
+     .  .OR. yaxis .EQ. mnormal .OR. yaxis .EQ. munknown ) THEN
+	   GEOG_COS_FACTOR = .FALSE.
+	ELSE
+           GEOG_COS_FACTOR = line_unit_code(xaxis) .EQ. pun_degrees
+     .                 .AND. line_unit_code(yaxis) .EQ. pun_degrees
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/get_linear_coef.F b/fer/doo/get_linear_coef.F
new file mode 100644
index 0000000..645b4e6
--- /dev/null
+++ b/fer/doo/get_linear_coef.F
@@ -0,0 +1,115 @@
+	SUBROUTINE GET_LINEAR_COEF( src_lo, src_hi, src_grid,
+     .				    dst_lo, dst_hi, dst_grid,
+     .				    axis, ss, coef )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* for regridding axis axis from source grid to destination grid:
+* determine linear interpolation coefficients and nearest lower neighbor point 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 12/30/88
+* revision 0.1 -  1/15/89 - fixed bug in coef for xdst<xsrc
+* V200:  8/7/89 - allow exact equality case
+* V230:  8/23/92 - bug fix for non-date time axes
+* V300:   5/5/93 - coordinate comparisons in single precision
+* V312:	  6/7/94 - use TDST_WORLD* for simpler, faster date conversions
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+        IMPLICIT NONE
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER src_lo, src_hi, dst_lo, dst_hi, src_grid, dst_grid, axis
+	INTEGER ss(dst_lo:dst_hi)
+	REAL	coef (dst_lo:dst_hi)
+
+* internal variable declarations:
+	INTEGER	ISUBSCRIPT, isrc, ii, status
+	REAL*8	TM_WORLD, TDEST_WORLD, xsrc, xdst, xmin, xmax
+
+* initialize
+	IF ( axis .EQ. t_dim .OR. axis .EQ. f_dim ) THEN
+*          TDST_WORLD gives dates from the source axis as they would be
+*	   encoded on the destination axis 
+*      ==> ALL TIME/DATE CALCULATIONS ARE DONE IN THE SOURCE AXIS ENCODING
+	   CALL TDEST_WORLD_INIT ( dst_grid, src_grid, axis, status ) ! src<->dst
+	   IF ( status .NE. ferr_ok ) RETURN  ! note - status not passed !!
+	ENDIF
+	xmin = TM_WORLD( src_lo, src_grid, axis, box_middle )
+	xmax = TM_WORLD( src_hi, src_grid, axis, box_middle )
+
+* loop through points of destination axis
+	DO 100 ii = dst_lo, dst_hi
+
+* get destination grid point in question
+* if T axis, then get it encoded as per source time axis
+	   xdst = TDEST_WORLD( ii, dst_grid, axis, box_middle )
+
+	   IF ( SNGL(xdst) .LT. SNGL(xmin)
+     .     .OR. SNGL(xdst) .GT. SNGL(xmax) ) THEN  	! SNGL 5/93
+
+* ... destination point does not lie within source grid bounds
+	      coef( ii ) = bad_val4
+	      ss  ( ii ) = unspecified_int4
+
+	   ELSE
+
+	      isrc = ISUBSCRIPT( xdst, src_grid, axis, round_dn )
+	      xsrc = TM_WORLD( isrc, src_grid, axis, box_middle )
+	      IF ( SNGL(xdst) .EQ. SNGL(xsrc) ) THEN    ! SNGL 5/93
+	         ss  ( ii ) = isrc
+	         coef( ii ) = 0.0
+	      ELSEIF ( xdst .GT. xsrc ) THEN
+	         ss  ( ii ) = isrc
+	         coef( ii ) =	( xdst - xsrc ) /
+     .			( TM_WORLD(isrc+1,src_grid,axis,box_middle) - xsrc )
+	      ELSE
+	         ss  ( ii ) = isrc - 1
+	         coef( ii ) =	1.0 - ( ( xsrc - xdst ) /
+     .			( xsrc - TM_WORLD(isrc-1,src_grid,axis,box_middle) ) )
+	      ENDIF
+
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/doo/hanng_wt.F b/fer/doo/hanng_wt.F
new file mode 100644
index 0000000..c280e5f
--- /dev/null
+++ b/fer/doo/hanng_wt.F
@@ -0,0 +1,69 @@
+	SUBROUTINE HANNG_WT( wt, wlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create an array of Hanning filter weights
+
+* programmer - steve hankin and Paul Rogers
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 8/91 - based on BINOM_WT
+
+        IMPLICIT NONE
+
+* calling argument declarations:
+	INTEGER	wlen
+	REAL	wt(wlen)
+
+* internal variable declarations:
+	INTEGER i, use_len
+        REAL c
+
+* based on Numerical Recipes, W.H.Press, et. al. p.425
+* note, however, that the algorithm given includes a zero point at each end
+* of the Hanning filter -> i.e. the number of non-zero weight points is N-2
+* What is provided by FERRET will technically be a Hanning window of length N+2
+        use_len = wlen + 2
+        c = 2. * 3.1415926 / (use_len - 1)
+	DO 100 i = 1, wlen
+ 100	wt(i) = 0.5 * ( 1.0 - COS(c*i) )
+
+* normalize to 1
+        CALL NORMALIZE( wt, wlen )
+ 
+	RETURN
+	END
diff --git a/fer/doo/lin_regrid_1_axis.F b/fer/doo/lin_regrid_1_axis.F
new file mode 100644
index 0000000..281158d
--- /dev/null
+++ b/fer/doo/lin_regrid_1_axis.F
@@ -0,0 +1,428 @@
+	SUBROUTINE LIN_REGRID_1_AXIS(	cx_lims, axis, dst_lo, dst_hi,
+     .					src, msrc, dst, mdst,
+     .					ss12, coef )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grd, interpolate to
+* 	values dst on grid dst_grd.
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their respective
+* 	grids.
+
+* 	Both src and dst are assumed to be 4 dimensional structures
+*	with regridding needed along axis "axis"
+
+*	ss12 holds the indices of nearest grid nodes on src_grd for nodes
+*	on dst_grd. COEF holds the interpolation coefficients.
+
+*	The interpolation algorithm is taken from Numerical Recipes, Chapter 3,
+*	Section "Interpolation in Two or More Dimensions"
+
+* 	programmer - Jerry Davison
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+* 	written for VAX computer under VMS operating system
+* 	revision 1.0 - 5.2.88
+* V205:   8/3/89 - major re-write (regrid along 1 axis only of 4D structure)
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+* V68  *acm* 1/12  changes for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* CALLING ARGUMENT DECLARATIONS:
+	INTEGER	  cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	INTEGER   ss12(	dst_lo:dst_hi )
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		coef( dst_lo:dst_hi )
+
+* INTERNAL VARIABLE DECLARATIONS:
+        LOGICAL TM_FPEQ, OK_neg111
+	INTEGER i, j, k, l, m, n,
+     .		ss, src_lo, src_hi, src_grd, dst_grd
+	REAL	bad_src, bad_dst, z1, z2, c1, c2
+
+********************************************************************************
+
+* LIMITS FOR CALCULATION
+        src_lo = mr_lo_ss(msrc,axis)
+        src_hi = mr_hi_ss(msrc,axis)
+
+* FLAG FOR BAD/MISSING DATA
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* source and destination grids
+	src_grd = mr_grid( msrc )
+	dst_grd = mr_grid( mdst )
+
+* DETERMINE (LOWER) src_grd INDEX OF NEAREST NEIGHBORS ON src_grd AXES
+* FOR NODES ON dst_grd AXES, AND COMPUTE FRACTIONAL POSITIONS OF dst_grd
+* NODES WITH RESPECT TO src_grd.
+	CALL GET_LINEAR_COEF(	src_lo, src_hi, src_grd,
+     .				dst_lo, dst_hi, dst_grd,
+     .				axis, ss12, coef )
+
+* For a modulo longitude axis, the range of subscripts might be negative, 
+* and contain -111 among them. ok_neg111 distinguishes between this and 
+* the flag unspecified_int4.
+
+        ok_neg111 = (ss12(dst_lo) .LT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .GT. unspecified_int4) .OR.
+     .              (ss12(dst_lo) .GT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .LT. unspecified_int4) 
+
+* CONVERT THE DATA TO dst_grd
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 110 i = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(i)
+	      c2 = coef(i)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 100 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 100	         dst(i,j,k,l,m,n) = src(ss,j,k,l,m,n)
+	         GOTO 110
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 102 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 102 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 102 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 102 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 102 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 102		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 110
+	      ENDIF
+
+* regular interpolation
+	      DO 105 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	      DO 105 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	      DO 105 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	      DO 105 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	      DO 105 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* surrounding source data points
+	         z1 = src(ss  ,j,k,l,m,n)
+	         z2 = src(ss+1,j,k,l,m,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 105	      CONTINUE
+ 110	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 210 j = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(j)
+	      c2 = coef(j)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 200 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 200 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 200 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 200 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 200 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 200	         dst(i,j,k,l,m,n) = src(i,ss,k,l,m,n)
+	         GOTO 210
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 202 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 202 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 202 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 202 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 202		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 210
+	      ENDIF
+
+* regular interpolation
+	      DO 205 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	      DO 205 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	      DO 205 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	      DO 205 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	      DO 205 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* surrounding source data points
+	         z1 = src(i,ss  ,k,l,m,n)
+	         z2 = src(i,ss+1,k,l,m,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 205	      CONTINUE
+ 210	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 310 k = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(k)
+	      c2 = coef(k)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 300 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 300 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 300	         dst(i,j,k,l,m,n) = src(i,j,ss,l,m,n)
+	         GOTO 310
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 302 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 302 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 302 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 302 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 302 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 302		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 310
+	      ENDIF
+
+* regular interpolation
+	      DO 305 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	      DO 305 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	      DO 305 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	      DO 305 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	      DO 305 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* surrounding source data points
+	         z1 = src(i,j,ss  ,l,m,n)
+	         z2 = src(i,j,ss+1,l,m,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 305	      CONTINUE
+ 310	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 410 l = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(l)
+	      c2 = coef(l)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 400 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 400 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 400 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 400 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 400 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 400	         dst(i,j,k,l,m,n) = src(i,j,k,ss,m,n)
+	         GOTO 410
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 402 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 402 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 402 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 402 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 402 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 402		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 410
+	      ENDIF
+
+* regular interpolation
+	      DO 405 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	      DO 405 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	      DO 405 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	      DO 405 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	      DO 405 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* surrounding source data points
+	         z1 = src(i,j,k,ss,  m,n)
+	         z2 = src(i,j,k,ss+1,m,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 405	      CONTINUE
+ 410	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+	   DO 510 m = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(m)
+	      c2 = coef(m)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 500 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 500 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 500 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 500 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 500 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 500	         dst(i,j,k,l,m,n) = src(i,j,k,l,ss,n)
+	         GOTO 510
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 502 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 502 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 502 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 502 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 502 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 502		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 510
+	      ENDIF
+
+* regular interpolation
+	      DO 505 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	      DO 505 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	      DO 505 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	      DO 505 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	      DO 505 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* surrounding source data points
+	         z1 = src(i,j,k,l,ss  ,n)
+	         z2 = src(i,j,k,l,ss+1,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 505	      CONTINUE
+ 510	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+	   DO 610 n = dst_lo, dst_hi
+
+* interpolation coefficients
+	      ss = ss12(n)
+	      c2 = coef(n)
+	      c1 = 1.0 - c2
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1, 1.0) ) THEN
+	         DO 600 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 600 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 600 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 600 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 600 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 600	         dst(i,j,k,l,m,n) = src(i,j,k,l,m,ss)
+	         GOTO 610
+	      ELSEIF ( ss .EQ. unspecified_int4 .AND. 
+     .                 .NOT. ok_neg111 ) THEN
+* ... this should never happen in FERRET 2.00+
+	         DO 602 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 602 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 602 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 602 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 602 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 602		 dst(i,j,k,l,m,n) = bad_dst
+	         GOTO 610
+	      ENDIF
+
+* regular interpolation
+	      DO 605 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	      DO 605 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	      DO 605 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	      DO 605 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	      DO 605 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* surrounding source data points
+	         z1 = src(i,j,k,l,m,ss  )
+	         z2 = src(i,j,k,l,m,ss+1)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1*z1 + c2*z2
+	         ENDIF
+
+ 605	      CONTINUE
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/maxsmoother.F b/fer/doo/maxsmoother.F
new file mode 100644
index 0000000..0ea1a97
--- /dev/null
+++ b/fer/doo/maxsmoother.F
@@ -0,0 +1,408 @@
+	SUBROUTINE MAXSMOOTHER(	idim, wlen, 
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx, 
+     .				list )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compute the maximum of the requested length, along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible. If there is any data present in the window, the maximum
+*       is computed based on that data. maxima are computed with the data
+*       that is available in partial windows at the edges of the domain. 
+
+* programmer - ansley manke based on convolve.
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, wlen, com_mr, com_cx, res_mr, res_cx
+	REAL	com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          list(*)
+
+* internal variable declarations:
+	LOGICAL TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER	TM_MODULO_LINE_DIM, CGRID_AXIS, 
+     .		i, j, k, l, m, n, ii, ndx, lo_lim, hi_lim,
+     .          lo_sub(nferdims), hi_sub(nferdims), hlen,
+     .		lo_modlim, hi_modlim, nmod, nmod_prev, modlen
+	REAL    bad_com, bad_res, comp, cmax
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* initialize
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+	lo_lim = cx_lo_ss(com_cx,idim)
+	hi_lim = cx_hi_ss(com_cx,idim) 
+	nmod_prev = -99999
+
+	hlen = wlen/2
+	IF ( MOD(wlen,2) .EQ. 0)  hlen = (wlen+1)/2
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+
+* it this a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO( CGRID_AXIS(idim,com_cx) )
+	IF (has_mod_void) THEN
+	   modlen = TM_MODULO_LINE_DIM( CGRID_AXIS(idim,com_cx) )
+	   has_mod_void = lo_lim.LE.0 .OR. hi_lim.GE.modlen
+	ENDIF
+
+* ... though treating each axis separately is to avoid testing inside the loop
+* SMOOTH ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	   DO 110 i = lo_s1, hi_s1
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (i.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (i-1)/modlen 
+	         ELSE
+	            nmod = i/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+	      DO 100 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( i+ii .GE. lo_lim
+     .          .AND. i+ii .LE. hi_lim ) THEN
+                    comp = com(i+ii,j,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+		    cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 100	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 110
+	      ELSE
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+
+ 110	   CONTINUE
+
+* SMOOTH ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 j = lo_s2, hi_s2
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (j.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (j-1)/modlen 
+	         ELSE
+	            nmod = j/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 210 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+
+	      DO 200 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( j+ii .GE. lo_lim
+     .          .AND. j+ii .LE. hi_lim ) THEN
+                    comp = com(i,j+ii,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 200	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 210
+	      ELSE 
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+
+ 210	   CONTINUE
+
+* SMOOTH ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 k = lo_s3, hi_s3
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (k.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (k-1)/modlen 
+	         ELSE
+	            nmod = k/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	      
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+	      DO 300 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( k+ii .GE. lo_lim
+     .          .AND. k+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k+ii,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 300	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 310
+	      ELSE
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+ 310	   CONTINUE
+
+* SMOOTH ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 l = lo_s4, hi_s4
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (l.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (l-1)/modlen 
+	         ELSE
+	            nmod = l/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+	      DO 400 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( l+ii .GE. lo_lim
+     .          .AND. l+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l+ii,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 400	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 410
+	      ELSE 
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+ 410	   CONTINUE
+
+* SMOOTH ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 m = lo_s5, hi_s5
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (m.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (m-1)/modlen 
+	         ELSE
+	            nmod = m/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+	      DO 500 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( m+ii .GE. lo_lim
+     .          .AND. m+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m+ii,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 500	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 510
+	      ELSE 
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+ 510	   CONTINUE
+
+* SMOOTH ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 n = lo_s6, hi_s6
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (n.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (n-1)/modlen 
+	         ELSE
+	            nmod = n/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmax = -1. * ABS(bad_com)
+	      DO 600 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( n+ii .GE. lo_lim
+     .          .AND. n+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m,n+ii)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmax = MAX(cmax, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 600	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 610
+	      ELSE 
+                res(i,j,k,l,m,n) = cmax
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/median.F b/fer/doo/median.F
new file mode 100644
index 0000000..50e9873
--- /dev/null
+++ b/fer/doo/median.F
@@ -0,0 +1,447 @@
+	SUBROUTINE MEDIAN(	idim, wlen, 
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx, 
+     .				list )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compute the median of the requested length, along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible. If there is any data present in the window, the median
+*       is computed based on that data. Medians are computed with the data
+*       that is available in partial windows at the edges of the domain. 
+
+* programmer - ansley manke based on convolve.
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, wlen, com_mr, com_cx, res_mr, res_cx
+	REAL	com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          list(*)
+
+* internal variable declarations:
+	LOGICAL TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER	TM_MODULO_LINE_DIM, CGRID_AXIS, 
+     .		i, j, k, l, m, n, ii, ndx, lo_lim, hi_lim,
+     .          lo_sub(nferdims), hi_sub(nferdims), hlen,
+     .		lo_modlim, hi_modlim, nmod, nmod_prev, 
+     .		modlen, median_loc
+	REAL    bad_com, bad_res, comp
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* initialize
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+	lo_lim = cx_lo_ss(com_cx,idim)
+	hi_lim = cx_hi_ss(com_cx,idim) 
+	nmod_prev = -99999
+
+	hlen = wlen/2
+	median_loc = hlen
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+
+* it this a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO( CGRID_AXIS(idim,com_cx) )
+	IF (has_mod_void) THEN
+	   modlen = TM_MODULO_LINE_DIM( CGRID_AXIS(idim,com_cx) )
+	   has_mod_void = lo_lim.LE.0 .OR. hi_lim.GE.modlen
+	ENDIF
+
+* ... though treating each axis separately is to avoid testing inside the loop
+* MEDIAN ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	   DO 110 i = lo_s1, hi_s1
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (i.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (i-1)/modlen 
+	         ELSE
+	            nmod = i/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	      ndx = 1
+	      DO 100 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( i+ii .GE. lo_lim
+     .          .AND. i+ii .LE. hi_lim ) THEN
+                    comp = com(i+ii,j,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 100	      CONTINUE
+
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 110
+	      ENDIF
+
+	      IF (ndx .EQ. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 110
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 110	   CONTINUE
+
+* MEDIAN ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 j = lo_s2, hi_s2
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (j.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (j-1)/modlen 
+	         ELSE
+	            nmod = j/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 210 i = lo_s1, hi_s1
+	      ndx = 1
+	      DO 200 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( j+ii .GE. lo_lim
+     .          .AND. j+ii .LE. hi_lim ) THEN
+                    comp = com(i,j+ii,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 200	      CONTINUE
+
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 210
+	      ENDIF
+
+	      IF (ndx .EQ. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 210
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 210	   CONTINUE
+
+* MEDIAN ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 k = lo_s3, hi_s3
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (k.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (k-1)/modlen 
+	         ELSE
+	            nmod = k/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      ndx = 1
+	      DO 300 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( k+ii .GE. lo_lim
+     .          .AND. k+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k+ii,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 300	      CONTINUE
+
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 310
+	      ENDIF
+
+	      IF (ndx .LE. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 310
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 310	   CONTINUE
+
+* MEDIAN ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 l = lo_s4, hi_s4
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (l.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (l-1)/modlen 
+	         ELSE
+	            nmod = l/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      ndx = 1
+	      DO 400 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( l+ii .GE. lo_lim
+     .          .AND. l+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l+ii,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 400	      CONTINUE
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 410
+	      ENDIF
+
+	      IF (ndx .EQ. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 410
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 410	   CONTINUE
+
+* MEDIAN ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 m = lo_s5, hi_s5
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (m.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (m-1)/modlen 
+	         ELSE
+	            nmod = m/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      ndx = 1
+	      DO 500 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( m+ii .GE. lo_lim
+     .          .AND. m+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m+ii,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 500	      CONTINUE
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 510
+	      ENDIF
+
+	      IF (ndx .EQ. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 510
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 510	   CONTINUE
+
+* MEDIAN ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 n = lo_s6, hi_s6
+	      IF (has_mod_void) THEN
+*  ... do not allow computation across the modulo void
+	         IF (n.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (n-1)/modlen 
+	         ELSE
+	            nmod = n/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      ndx = 1
+	      DO 600 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( n+ii .GE. lo_lim
+     .          .AND. n+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m,n+ii)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            list(ndx) = comp
+		    ndx = ndx + 1
+	         ENDIF
+ 600	      CONTINUE
+              ndx = ndx - 1
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 610
+	      ENDIF
+
+	      IF (ndx .EQ. 1) THEN 
+                res(i,j,k,l,m,n) = list(1)
+                GOTO 610
+	      ENDIF
+              CALL HEAP2_V(list, bad_com, ndx)
+
+              median_loc = ndx/2 + 1
+	      res(i,j,k,l,m,n) = list(median_loc)
+
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/minsmoother.F b/fer/doo/minsmoother.F
new file mode 100644
index 0000000..1082170
--- /dev/null
+++ b/fer/doo/minsmoother.F
@@ -0,0 +1,406 @@
+	SUBROUTINE MINSMOOTHER(	idim, wlen, 
+     .				com, com_mr, com_cx,
+     .				res, res_mr, res_cx, 
+     .				list )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compute the minimum of the requested length, along axis idim
+* note: the component context may not be of adequate size for the full
+*	calculation.  Missing data flags will be inserted where computation is
+*	impossible. If there is any data present in the window, the minimum
+*       is computed based on that data. Minima are computed with the data
+*       that is available in partial windows at the edges of the domain. 
+
+* programmer - ansley manke based on convolve.
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, wlen, com_mr, com_cx, res_mr, res_cx
+	REAL	com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          list(*)
+
+* internal variable declarations:
+	LOGICAL TM_ITS_SUBSPAN_MODULO, has_mod_void
+	INTEGER	TM_MODULO_LINE_DIM, CGRID_AXIS, 
+     .		i, j, k, l, m, n, ii, ndx, lo_lim, hi_lim,
+     .          lo_sub(nferdims), hi_sub(nferdims), hlen,
+     .		lo_modlim, hi_modlim, nmod, nmod_prev, 
+     .		modlen
+	REAL    bad_com, bad_res, comp, cmin
+
+* internal (convenience) equivalences
+	INTEGER	lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6,
+     .          hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6
+	EQUIVALENCE (lo_s1, lo_sub(1)) , (lo_s2, lo_sub(2)),
+     .		    (lo_s3, lo_sub(3)) , (lo_s4, lo_sub(4)),
+     .		    (lo_s5, lo_sub(5)) , (lo_s6, lo_sub(6)),
+     .		    (hi_s1, hi_sub(1)) , (hi_s2, hi_sub(2)),
+     .		    (hi_s3, hi_sub(3)) , (hi_s4, hi_sub(4)),
+     .		    (hi_s5, hi_sub(5)) , (hi_s6, hi_sub(6))
+
+* initialize
+	bad_com = mr_bad_data( res_mr )
+	bad_res = mr_bad_data( com_mr )
+	lo_lim = cx_lo_ss(com_cx,idim)
+	hi_lim = cx_hi_ss(com_cx,idim) 
+	nmod_prev = -99999
+
+	hlen = wlen/2
+	IF ( MOD(wlen,2) .EQ. 0)  hlen = (wlen+1)/2
+
+* compute limits within which calculation is possible
+	DO 10 ii = 1, nferdims
+	   lo_sub(ii) = cx_lo_ss(res_cx,ii)
+	   hi_sub(ii) = cx_hi_ss(res_cx,ii)
+ 10	CONTINUE
+
+* it this a subspan modulo axis?
+	has_mod_void = TM_ITS_SUBSPAN_MODULO( CGRID_AXIS(idim,com_cx) )
+	IF (has_mod_void) THEN
+	   modlen = TM_MODULO_LINE_DIM( CGRID_AXIS(idim,com_cx) )
+	   has_mod_void = lo_lim.LE.0 .OR. hi_lim.GE.modlen
+	ENDIF
+
+* ... though treating each axis separately is to avoid testing inside the loop
+* SMOOTH ALONG X AXIS
+	IF ( idim .EQ. x_dim ) THEN
+	   DO 110 n = lo_s6, hi_s6
+	   DO 110 m = lo_s5, hi_s5
+	   DO 110 l = lo_s4, hi_s4
+	   DO 110 k = lo_s3, hi_s3
+	   DO 110 j = lo_s2, hi_s2
+	   DO 110 i = lo_s1, hi_s1
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (i.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (i-1)/modlen 
+	         ELSE
+	            nmod = i/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	      ndx = 0
+	      cmin = ABS(bad_com)
+	      DO 100 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( i+ii .GE. lo_lim
+     .          .AND. i+ii .LE. hi_lim ) THEN
+                    comp = com(i+ii,j,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+		    cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 100	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 110
+	      ELSE
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+
+ 110	   CONTINUE
+
+* SMOOTH ALONG Y AXIS
+	ELSEIF ( idim .EQ. y_dim ) THEN
+	   DO 210 n = lo_s6, hi_s6
+	   DO 210 m = lo_s5, hi_s5
+	   DO 210 l = lo_s4, hi_s4
+	   DO 210 k = lo_s3, hi_s3
+	   DO 210 j = lo_s2, hi_s2
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (j.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (j-1)/modlen 
+	         ELSE
+	            nmod = j/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 210 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmin = ABS(bad_com)
+
+	      DO 200 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( j+ii .GE. lo_lim
+     .          .AND. j+ii .LE. hi_lim ) THEN
+                    comp = com(i,j+ii,k,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 200	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 210
+	      ELSE 
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+
+ 210	   CONTINUE
+
+* SMOOTH ALONG Z AXIS
+	ELSEIF ( idim .EQ. z_dim ) THEN
+	   DO 310 n = lo_s6, hi_s6
+	   DO 310 m = lo_s5, hi_s5
+	   DO 310 l = lo_s4, hi_s4
+	   DO 310 k = lo_s3, hi_s3
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (k.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (k-1)/modlen 
+	         ELSE
+	            nmod = k/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+
+	   DO 310 j = lo_s2, hi_s2
+	   DO 310 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmin = ABS(bad_com)
+	      DO 300 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( k+ii .GE. lo_lim
+     .          .AND. k+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k+ii,l,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 300	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 310
+	      ELSE
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+ 310	   CONTINUE
+
+* SMOOTH ALONG T AXIS
+	ELSEIF ( idim .EQ. t_dim ) THEN
+	   DO 410 n = lo_s6, hi_s6
+	   DO 410 m = lo_s5, hi_s5
+	   DO 410 l = lo_s4, hi_s4
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (l.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (l-1)/modlen 
+	         ELSE
+	            nmod = l/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 410 k = lo_s3, hi_s3
+	   DO 410 j = lo_s2, hi_s2
+	   DO 410 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmin = ABS(bad_com)
+	      DO 400 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( l+ii .GE. lo_lim
+     .          .AND. l+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l+ii,m,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 400	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 410
+	      ELSE 
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+ 410	   CONTINUE
+
+* SMOOTH ALONG E AXIS
+	ELSEIF ( idim .EQ. e_dim ) THEN
+	   DO 510 n = lo_s6, hi_s6
+	   DO 510 m = lo_s5, hi_s5
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (m.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (m-1)/modlen 
+	         ELSE
+	            nmod = m/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 510 l = lo_s4, hi_s4
+	   DO 510 k = lo_s3, hi_s3
+	   DO 510 j = lo_s2, hi_s2
+	   DO 510 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmin = ABS(bad_com)
+	      DO 500 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( m+ii .GE. lo_lim
+     .          .AND. m+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m+ii,n)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 500	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 510
+	      ELSE 
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+ 510	   CONTINUE
+
+* SMOOTH ALONG F AXIS
+	ELSEIF ( idim .EQ. f_dim ) THEN
+	   DO 610 n = lo_s6, hi_s6
+	      IF (has_mod_void) THEN
+*  ... do not allow smoothing across the modulo void
+	         IF (n.GE.1) THEN  ! get # of modulos to curr index
+	            nmod = (n-1)/modlen 
+	         ELSE
+	            nmod = n/modlen - 1
+	         ENDIF
+	         IF ( nmod .NE. nmod_prev ) THEN
+	            nmod_prev = nmod
+	            lo_modlim = nmod*modlen + 1
+	            hi_modlim = (nmod+1) * modlen
+	            lo_lim = MAX( lo_modlim, cx_lo_ss(com_cx,idim) )
+	            hi_lim = MIN( hi_modlim, cx_hi_ss(com_cx,idim)  )
+	         ENDIF
+	      ENDIF
+	   DO 610 m = lo_s5, hi_s5
+	   DO 610 l = lo_s4, hi_s4
+	   DO 610 k = lo_s3, hi_s3
+	   DO 610 j = lo_s2, hi_s2
+	   DO 610 i = lo_s1, hi_s1
+	      ndx = 0
+	      cmin = ABS(bad_com)
+	      DO 600 ii = -hlen, hlen
+* test limits of component data before using
+                 IF ( n+ii .GE. lo_lim
+     .          .AND. n+ii .LE. hi_lim ) THEN
+                    comp = com(i,j,k,l,m,n+ii)
+                 ELSE
+                    comp = bad_com
+                 ENDIF
+
+	         IF ( comp .NE. bad_com ) THEN
+	            cmin = MIN(cmin, comp)
+		    ndx = ndx + 1
+	         ENDIF
+ 600	      CONTINUE
+
+	      IF (ndx .EQ. 0) THEN 
+                res(i,j,k,l,m,n) = bad_res
+                GOTO 610
+	      ELSE 
+                res(i,j,k,l,m,n) = cmin
+	      ENDIF
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/modulo_regrid.F b/fer/doo/modulo_regrid.F
new file mode 100644
index 0000000..526730f
--- /dev/null
+++ b/fer/doo/modulo_regrid.F
@@ -0,0 +1,786 @@
+	SUBROUTINE MODULO_REGRID( cx_lims, axis, trans,
+     .			src, msrc, dst, mdst, ngd, 
+     .			mngd, nbd, mnbd, ave, mave)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grid, regrid to
+* 	grid dst_grid by "modulo averaging".  Specifically, average all
+*	of the source points that fall within the modulo-replications
+*	of each destination point.
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their 
+* 	respective grids.
+
+*	ss21 holds the indices of source grid boxes (on src_grid) for box
+*	limits on dst_grid.
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V420:	 11/95
+* V450:	 1/97 - bug fix: error in nfold calculation
+* kob*   9/97 - replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in order
+*               to have access to context information - needed for negative
+*               time step processing
+* V541:	 *sh*  2/02 - support for subspan modulo axes -- dont use line_dim 
+* V561: *acm*  4/04 - (old fix got checked in, then an old version got checked in!!)
+*                     add checks on source points when computing sum of squared deviations
+*                     for MODVAR
+* V603 5/07  *acm* - added MODNBD modulo regridding statistic
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'		! for line_dim
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, trans, msrc, mdst, mngd, mnbd, mave
+
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          ngd( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,
+     .               m3lot:m3hit,m3loe:m3hie,m3lof:m3hif ),
+     .          nbd( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,
+     .               m4lot:m4hit,m4loe:m4hie,m4lof:m4hif ),
+     .          ave( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,
+     .               m5lot:m5hit,m5loe:m5hie,m5lof:m5hif )
+
+* local variable declarations:
+	INTEGER	ISUBSCR_CX, TM_MODULO_LINE_DIM,
+     .		dstss, srcss, src_grid, dst_grid,
+     .		i, j, k, l, m, n, nmod, nfold, dst_start,
+     .		srcss_lo, srcss_hi, dstss_lo, dstss_hi, status
+
+	REAL	bad_src, bad_dst, tmp
+	REAL*8	TDEST_WORLD, dstww
+
+******************************************************************************
+* initialize
+	src_grid = mr_grid( msrc )
+	dst_grid = mr_grid( mdst )
+
+* limits for calculation
+        srcss_lo = mr_lo_ss(msrc,axis)
+        srcss_hi = mr_hi_ss(msrc,axis)
+
+        dstss_lo = cx_lo_ss(cx_lims,axis)
+        dstss_hi = cx_hi_ss(cx_lims,axis)
+
+* flag for bad/missing data
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* initialize outputs to zero (ngd serves as flag for a valid calculation, too)
+        DO 10 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+        DO 10 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+        DO 10 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+        DO 10 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+        DO 10 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+        DO 10 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+	   ngd(i,j,k,l,m,n) = 0.0
+	   nbd(i,j,k,l,m,n) = 0.0
+
+	   IF ( trans .EQ. prgrd_modulo ) THEN
+	      dst(i,j,k,l,m,n) = 0.0
+	   ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	      dst(i,j,k,l,m,n) = 0.0
+	   ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	      dst(i,j,k,l,m,n) = 0.0
+	      ave(i,j,k,l,m,n) = 0.0
+	   ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	      dst(i,j,k,l,m,n) = 0.0
+	   ELSEIF ( trans .EQ. prgrd_modnbd ) THEN
+	      dst(i,j,k,l,m,n) = 0.0
+	   ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	      dst(i,j,k,l,m,n) = arbitrary_large_val4
+	   ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	      dst(i,j,k,l,m,n) = arbitrary_small_val4
+	   ENDIF
+
+ 10	CONTINUE
+
+* the modulo index length of the destination axis
+! ...	nmod = CAXIS_LEN(axis,cx_dst)	if cx_dst were known ...
+	nmod = TM_MODULO_LINE_DIM( grid_line(axis,dst_grid) )
+
+* the number of times the destination axis was folded before the first dstss_lo
+!	nfold = INT(dstss_lo/nmod) * nmod
+	nfold = INT((dstss_lo-1)/nmod) * nmod		! 1/97
+
+*****************************************
+
+* along X axis
+        IF ( axis .EQ. x_dim ) THEN
+
+* loop through the each source grid point
+	   DO 190 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims,round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 120 dstss = dst_start, dstss_hi, nmod
+                 DO 110 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 110 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 110 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 110 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 110 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(srcss,j,k,l,m,n) .EQ. bad_src ) THEN
+                    nbd(dstss,j,k,l,m,n) = nbd(dstss,j,k,l,m,n) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                  dst(dstss,j,k,l,m,n) = nbd(dstss,j,k,l,m,n)
+                    GOTO 110
+                 ENDIF
+
+* ... count this point
+	         ngd(dstss,j,k,l,m,n) = ngd(dstss,j,k,l,m,n) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(dstss,j,k,l,m,n) = dst(dstss,j,k,l,m,n) +
+     .                                     src(srcss,j,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(dstss,j,k,l,m,n) = dst(dstss,j,k,l,m,n) +
+     .                                     src(srcss,j,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(dstss,j,k,l,m,n) = ave(dstss,j,k,l,m,n) +
+     .                                     src(srcss,j,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(dstss,j,k,l,m,n) = ngd(dstss,j,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(srcss,j,k,l,m,n) .LT. dst(dstss,j,k,l,m,n))
+     .			dst(dstss,j,k,l,m,n) = src(srcss,j,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(srcss,j,k,l,m,n) .GT. dst(dstss,j,k,l,m,n))
+     .			dst(dstss,j,k,l,m,n) = src(srcss,j,k,l,m,n)
+	         ENDIF
+
+ 110	         CONTINUE
+ 120	      CONTINUE
+
+ 190	   CONTINUE
+
+* along Y axis
+        ELSEIF ( axis .EQ. Y_dim ) THEN
+
+* loop through the each source grid point
+	   DO 290 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 220 dstss = dst_start, dstss_hi, nmod
+                 DO 210 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 210 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 210 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 210 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 210 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(i,srcss,k,l,m,n) .EQ. bad_src ) THEN
+                    nbd(i,dstss,k,l,m,n) = nbd(i,dstss,k,l,m,n) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                 dst(i,dstss,k,l,m,n) = nbd(i,dstss,k,l,m,n)
+                    GOTO 210
+                 ENDIF
+
+* ... count this point
+	         ngd(i,dstss,k,l,m,n) = ngd(i,dstss,k,l,m,n) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(i,dstss,k,l,m,n) = dst(i,dstss,k,l,m,n) +
+     .                                     src(i,srcss,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(i,dstss,k,l,m,n) = dst(i,dstss,k,l,m,n) +
+     .                                     src(i,srcss,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(i,dstss,k,l,m,n) = ave(i,dstss,k,l,m,n) +
+     .                                     src(i,srcss,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(i,dstss,k,l,m,n) = ngd(i,dstss,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(i,srcss,k,l,m,n) .LT. dst(i,dstss,k,l,m,n))
+     .			dst(i,dstss,k,l,m,n) = src(i,srcss,k,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(i,srcss,k,l,m,n) .GT. dst(i,dstss,k,l,m,n))
+     .			dst(i,dstss,k,l,m,n) = src(i,srcss,k,l,m,n)
+	         ENDIF
+
+ 210	         CONTINUE
+ 220	      CONTINUE
+
+ 290	   CONTINUE
+
+* along Z axis
+        ELSEIF ( axis .EQ. z_dim ) THEN
+
+* loop through the each source grid point
+	   DO 390 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 320 dstss = dst_start, dstss_hi, nmod
+                 DO 310 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 310 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 310 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 310 k = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 310 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(i,j,srcss,l,m,n) .EQ. bad_src ) THEN
+                    nbd(i,j,dstss,l,m,n) = nbd(i,j,dstss,l,m,n) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                  dst(i,j,dstss,l,m,n) = nbd(i,j,dstss,l,m,n)
+                    GOTO 310
+                 ENDIF
+
+* ... count this point
+	         ngd(i,j,dstss,l,m,n) = ngd(i,j,dstss,l,m,n) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(i,j,dstss,l,m,n) = dst(i,j,dstss,l,m,n) +
+     .                                     src(i,j,srcss,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(i,j,dstss,l,m,n) = dst(i,j,dstss,l,m,n) +
+     .                                     src(i,j,srcss,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(i,j,dstss,l,m,n) = ave(i,j,dstss,l,m,n) +
+     .                                     src(i,j,srcss,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(i,j,dstss,l,m,n) = ngd(i,j,dstss,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(i,j,srcss,l,m,n) .LT. dst(i,j,dstss,l,m,n))
+     .			dst(i,j,dstss,l,m,n) = src(i,j,srcss,l,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(i,j,srcss,l,m,n) .GT. dst(i,j,dstss,l,m,n))
+     .			dst(i,j,dstss,l,m,n) = src(i,j,srcss,l,m,n)
+	         ENDIF
+
+ 310	         CONTINUE
+ 320	      CONTINUE
+
+ 390	   CONTINUE
+
+* along T axis
+        ELSEIF ( axis .EQ. T_dim ) THEN
+
+*   ==>   ALL TIME/DATE CALCULATIONS ARE DONE IN THE DEST AXIS ENCODING
+           CALL TDEST_WORLD_INIT ( src_grid, dst_grid, axis, status ) ! src<->dst
+           IF ( status .NE. ferr_ok ) STOP 'bogus TDEST_WORLD_INIT'
+
+* loop through the each source grid point
+	   DO 490 srcss = srcss_lo,srcss_hi
+
+* USE DESTINATION GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims,round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 420 dstss = dst_start, dstss_hi, nmod
+                 DO 410 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 410 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 410 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 410 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 410 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,srcss,m,n) .EQ. bad_src ) THEN
+                    nbd(i,j,k,dstss,m,n) = nbd(i,j,k,dstss,m,n) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                  dst(i,j,k,dstss,m,n) = nbd(i,j,k,dstss,m,n)
+                    GOTO 410
+                 ENDIF
+
+* ... count this point
+	         ngd(i,j,k,dstss,m,n) = ngd(i,j,k,dstss,m,n) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(i,j,k,dstss,m,n) = dst(i,j,k,dstss,m,n) +
+     .                                     src(i,j,k,srcss,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(i,j,k,dstss,m,n) = dst(i,j,k,dstss,m,n) +
+     .                                     src(i,j,k,srcss,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(i,j,k,dstss,m,n) = ave(i,j,k,dstss,m,n) +
+     .                                     src(i,j,k,srcss,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(i,j,k,dstss,m,n) = ngd(i,j,k,dstss,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(i,j,k,srcss,m,n) .LT. dst(i,j,k,dstss,m,n))
+     .			dst(i,j,k,dstss,m,n) = src(i,j,k,srcss,m,n)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(i,j,k,srcss,m,n) .GT. dst(i,j,k,dstss,m,n))
+     .			dst(i,j,k,dstss,m,n) = src(i,j,k,srcss,m,n)
+	         ENDIF
+
+ 410	         CONTINUE
+ 420	      CONTINUE
+
+ 490	   CONTINUE
+
+
+* along E axis
+        ELSEIF ( axis .EQ. e_dim ) THEN
+
+* loop through the each source grid point
+	   DO 590 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims,round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 520 dstss = dst_start, dstss_hi, nmod
+                 DO 510 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 510 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 510 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 510 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 510 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,l,srcss,n) .EQ. bad_src ) THEN
+                    nbd(i,j,k,l,dstss,n) = nbd(i,j,k,l,dstss,n) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                  dst(i,j,k,l,dstss,n) = nbd(i,j,k,l,dstss,n)
+                    GOTO 510
+                 ENDIF
+
+* ... count this point
+	         ngd(i,j,k,l,dstss,n) = ngd(i,j,k,l,dstss,n) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(i,j,k,l,dstss,n) = dst(i,j,k,l,dstss,n) +
+     .                                     src(i,j,k,l,srcss,n)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(i,j,k,l,dstss,n) = dst(i,j,k,l,dstss,n) +
+     .                                     src(i,j,k,l,srcss,n)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(i,j,k,l,dstss,n) = ave(i,j,k,l,dstss,n) +
+     .                                     src(i,j,k,l,srcss,n)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(i,j,k,l,dstss,n) = ngd(i,j,k,l,dstss,n)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(i,j,k,l,srcss,n) .LT. dst(i,j,k,l,dstss,n))
+     .			dst(i,j,k,l,dstss,n) = src(i,j,k,l,srcss,n)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(i,j,k,l,srcss,n) .GT. dst(i,j,k,l,dstss,n))
+     .			dst(i,j,k,l,dstss,n) = src(i,j,k,l,srcss,n)
+	         ENDIF
+
+ 510	         CONTINUE
+ 520	      CONTINUE
+
+ 590	   CONTINUE
+
+* along F axis
+        ELSEIF ( axis .EQ. F_dim ) THEN
+
+*   ==>   ALL TIME/DATE CALCULATIONS ARE DONE IN THE DEST AXIS ENCODING
+           CALL TDEST_WORLD_INIT ( src_grid, dst_grid, axis, status ) ! src<->dst
+           IF ( status .NE. ferr_ok ) STOP 'bogus TDEST_WORLD_INIT'
+
+* loop through the each source grid point
+	   DO 690 srcss = srcss_lo,srcss_hi
+
+* USE DESTINATION GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims,round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 620 dstss = dst_start, dstss_hi, nmod
+                 DO 610 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 610 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 610 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 610 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 610 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,l,m,srcss) .EQ. bad_src ) THEN
+                    nbd(i,j,k,l,m,dstss) = nbd(i,j,k,l,m,dstss) + 1.
+                    IF ( trans .EQ. prgrd_modnbd ) 
+     .                  dst(i,j,k,l,m,dstss) = nbd(i,j,k,l,m,dstss)
+                    GOTO 610
+                 ENDIF
+
+* ... count this point
+	         ngd(i,j,k,l,m,dstss) = ngd(i,j,k,l,m,dstss) + 1.
+
+	         IF ( trans .EQ. prgrd_modulo ) THEN
+	            dst(i,j,k,l,m,dstss) = dst(i,j,k,l,m,dstss) +
+     .                                     src(i,j,k,l,m,srcss)
+	         ELSEIF ( trans .EQ. prgrd_modsum ) THEN
+	            dst(i,j,k,l,m,dstss) = dst(i,j,k,l,m,dstss) +
+     .                                     src(i,j,k,l,m,srcss)
+	         ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	            ave(i,j,k,l,m,dstss) = ave(i,j,k,l,m,dstss) +
+     .                                     src(i,j,k,l,m,srcss)
+	         ELSEIF ( trans .EQ. prgrd_modngd ) THEN
+	            dst(i,j,k,l,m,dstss) = ngd(i,j,k,l,m,dstss)
+	         ELSEIF ( trans .EQ. prgrd_modmin ) THEN
+	            IF (src(i,j,k,l,m,srcss) .LT. dst(i,j,k,l,m,dstss))
+     .			dst(i,j,k,l,m,dstss) = src(i,j,k,l,m,srcss)
+	         ELSEIF ( trans .EQ. prgrd_modmax ) THEN
+	            IF (src(i,j,k,l,m,srcss) .GT. dst(i,j,k,l,m,dstss))
+     .			dst(i,j,k,l,m,dstss) = src(i,j,k,l,m,srcss)
+	         ENDIF
+
+ 610	         CONTINUE
+ 620	      CONTINUE
+
+ 690	   CONTINUE
+
+	ENDIF
+
+	IF ( trans .EQ. prgrd_modngd ) RETURN
+	IF ( trans .EQ. prgrd_modnbd ) RETURN
+
+* for all axis orientations
+* ... fill in missing values where there were zero source points
+        DO 1000 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+        DO 1000 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+        DO 1000 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+        DO 1000 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+        DO 1000 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+        DO 1000 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+	   IF ( ngd(i,j,k,l,m,n) .EQ. 0.0 ) THEN
+	      dst(i,j,k,l,m,n) = bad_dst
+	   ELSEIF ( trans .EQ. prgrd_modulo ) THEN
+	      dst(i,j,k,l,m,n) = dst(i,j,k,l,m,n) / ngd(i,j,k,l,m,n)
+	   ELSEIF ( trans .EQ. prgrd_modvar ) THEN
+	      ave(i,j,k,l,m,n) = ave(i,j,k,l,m,n) / ngd(i,j,k,l,m,n)
+	   ENDIF
+
+ 1000	CONTINUE
+
+	IF ( trans .NE. prgrd_modvar ) RETURN
+
+**********************
+
+* PASS #2 (needed only to compute variance - @MODVAR)
+* ... at this point ngd contains the number of points
+*     and ave contains the averages
+
+* along X axis
+        IF ( axis .EQ. x_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1190 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1120 dstss = dst_start, dstss_hi, nmod
+                 DO 1110 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 1110 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 1110 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 1110 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 1110 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(dstss,j,k,l,m,n) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(srcss,j,k,l,m,n) .NE. bad_src) THEN
+	               tmp = src(srcss,j,k,l,m,n)-ave(dstss,j,k,l,m,n)
+	               dst(dstss,j,k,l,m,n) = dst(dstss,j,k,l,m,n) +
+     .                                        tmp * tmp
+                    ENDIF
+	         ENDIF
+
+ 1110	         CONTINUE
+ 1120	      CONTINUE
+
+ 1190	   CONTINUE
+
+
+* along Y axis
+        ELSEIF ( axis .EQ. Y_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1290 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims,round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1220 dstss = dst_start, dstss_hi, nmod
+                 DO 1210 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 1210 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 1210 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 1210 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 1210 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(i,dstss,k,l,m,n) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(i,srcss,k,l,m,n) .NE. bad_src) THEN
+		        tmp = src(i,srcss,k,l,m,n)-ave(i,dstss,k,l,m,n)
+		        dst(i,dstss,k,l,m,n) = dst(i,dstss,k,l,m,n) +
+     .                                         tmp * tmp
+		    ENDIF
+	         ENDIF
+
+ 1210	         CONTINUE
+ 1220	      CONTINUE
+
+ 1290	   CONTINUE
+
+
+* along Z axis
+        ELSEIF ( axis .EQ. z_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1390 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1320 dstss = dst_start, dstss_hi, nmod
+                 DO 1310 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 1310 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 1310 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 1310 k = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 1310 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(i,j,dstss,l,m,n) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(i,j,srcss,l,m,n) .NE. bad_src) THEN
+		       tmp = src(i,j,srcss,l,m,n)-ave(i,j,dstss,l,m,n)
+		       dst(i,j,dstss,l,m,n) = dst(i,j,dstss,l,m,n) +
+     .                                        tmp * tmp
+		    ENDIF
+	         ENDIF
+
+ 1310	         CONTINUE
+ 1320	      CONTINUE
+
+ 1390	   CONTINUE
+
+
+* along T axis
+        ELSEIF (  axis .EQ. T_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1490 srcss = srcss_lo,srcss_hi
+
+* USE DESTINATION GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1420 dstss = dst_start, dstss_hi, nmod
+                 DO 1410 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 1410 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 1410 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 1410 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 1410 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(i,j,k,dstss,m,n) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(i,j,k,srcss,m,n) .NE. bad_src) THEN
+		       tmp = src(i,j,k,srcss,m,n)-ave(i,j,k,dstss,m,n)
+		       dst(i,j,k,dstss,m,n) = dst(i,j,k,dstss,m,n) +
+     .                                        tmp * tmp
+		    ENDIF
+	         ENDIF
+
+ 1410	         CONTINUE
+ 1420	      CONTINUE
+
+ 1490	   CONTINUE
+ 
+
+* along E axis
+        ELSEIF ( axis .EQ. e_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1590 srcss = srcss_lo,srcss_hi
+
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1520 dstss = dst_start, dstss_hi, nmod
+                 DO 1510 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+                 DO 1510 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 1510 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 1510 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 1510 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(i,j,k,l,dstss,n) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(i,j,k,l,srcss,n) .NE. bad_src) THEN
+	               tmp = src(i,j,k,l,srcss,n)-ave(i,j,k,l,dstss,n)
+	               dst(i,j,k,l,dstss,n) = dst(i,j,k,l,dstss,n) +
+     .                                        tmp * tmp
+                    ENDIF
+	         ENDIF
+
+ 1510	         CONTINUE
+ 1520	      CONTINUE
+
+ 1590	   CONTINUE
+
+* along F axis
+        ELSEIF (  axis .EQ. f_dim ) THEN
+
+* loop through the each source grid point
+	   DO 1690 srcss = srcss_lo,srcss_hi
+
+* USE DESTINATION GRID TIME/DATE ENCODINGS FOR ALL CALCULATIONS
+* what destination grid point owns this source point?
+	      dstww = TDEST_WORLD(srcss, src_grid, axis, box_middle)
+	      dstss = ISUBSCR_CX(dstww, dst_grid, axis, cx_lims, round_up)
+
+* map that index, modulo-style, to the first target destination point
+	      dst_start = MOD(dstss-1,nmod) + 1 + nfold
+	      IF (dst_start .LT. dstss_lo) dst_start = dst_start + nmod
+
+* add this contribution to all of the appropriate destination points
+	      DO 1620 dstss = dst_start, dstss_hi, nmod
+                 DO 1610 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+                 DO 1610 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+                 DO 1610 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+                 DO 1610 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+                 DO 1610 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* sum of squared deviations
+	         IF ( ngd(i,j,k,l,m,dstss) .GT. 1.0 ) THEN
+* ... must be at least 2 source points to get a variance
+		    IF (src(i,j,k,l,m,srcss) .NE. bad_src) THEN
+		       tmp = src(i,j,k,l,m,srcss)-ave(i,j,k,l,m,dstss)
+		       dst(i,j,k,l,m,dstss) = dst(i,j,k,l,m,dstss) +
+     .                                        tmp * tmp
+		    ENDIF
+	         ENDIF
+
+ 1610	         CONTINUE
+ 1620	      CONTINUE
+
+ 1690	   CONTINUE
+
+	ENDIF
+
+* for all axis orientations: divide sum of squared deviations by N-1
+        DO 2000 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+        DO 2000 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+        DO 2000 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+        DO 2000 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+        DO 2000 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+        DO 2000 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+	   IF ( ngd(i,j,k,l,m,n) .LE. 1.0 ) THEN
+	      dst(i,j,k,l,m,n) = bad_dst
+	   ELSE
+	      dst(i,j,k,l,m,n) = dst(i,j,k,l,m,n) /
+     .                           (ngd(i,j,k,l,m,n) - 1.0)
+	   ENDIF
+
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/doo/nearest_ptr_regrid_1_axis.F b/fer/doo/nearest_ptr_regrid_1_axis.F
new file mode 100644
index 0000000..bd02c9d
--- /dev/null
+++ b/fer/doo/nearest_ptr_regrid_1_axis.F
@@ -0,0 +1,305 @@
+	SUBROUTINE NEAREST_PTR_REGRID_1_AXIS(
+     .				        cx_lims, axis, dst_lo, dst_hi,
+     .					src, msrc, dst, mdst,
+     .					ss12, coef )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Regrid from the source to the destination grid using an algorithm
+*       of inserting the values into the result taken from the source
+*       axis coordinate which is nearest to the output point
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their respective
+* 	grids.
+
+* 	Both src and dst are assumed to be 4 dimensional structures
+*	with regridding needed along axis "axis"
+
+*	ss12 holds the indices of grid nodes on src_grd which surround
+*       each dst_grd point ... or unspecified_int4 if insufficient source pts
+
+*	Note: This routine is non-optimal at the low/high edges of the source
+*	axis.  It behaves like linear interpolation in that it will insert
+*	a bad result unless the source axis has a coordinate both above and
+*	below a requested destination axis point.
+
+* note that (for convenience) this routine reuses code from LIN_REGRID_1_AXIS
+* using the values of the linear coefficients computed as the test of whether
+* the source and destination grids have an eNEAREST match
+
+* NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V533: 6/01 *sh*
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* CALLING ARGUMENT DECLARATIONS:
+	INTEGER cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	INTEGER ss12( dst_lo:dst_hi )
+	REAL*8  src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+	REAL    coef( dst_lo:dst_hi )
+
+* INTERNAL VARIABLE DECLARATIONS:
+	LOGICAL	found1, ok_neg111
+	INTEGER i, j, k, l, m, n,
+     .		ss, src_lo, src_hi, src_grd, dst_grd
+	REAL	bad_src, bad_dst
+
+******************************************************************************
+
+* LIMITS FOR CALCULATION
+        src_lo = mr_lo_ss(msrc,axis)
+        src_hi = mr_hi_ss(msrc,axis)
+
+* FLAG FOR BAD/MISSING DATA
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* source and destination grids
+	src_grd = mr_grid( msrc )
+	dst_grd = mr_grid( mdst )
+
+* DETERMINE src_grd INDEX OF nearest matches on the dst_grd axis
+	CALL GET_LINEAR_COEF(	src_lo, src_hi, src_grd,
+     .				dst_lo, dst_hi, dst_grd,
+     .				axis, ss12, coef )
+
+* Range of subscripts might be negative, and contain -111 among them.
+* ok_neg111 distinguishes between this and the flag unspecified_int4.
+
+        ok_neg111 = ( ss12(dst_lo) .LT. unspecified_int4 .AND.
+     .                ss12(dst_hi) .GT. unspecified_int4 )
+
+* convert linear interp subscript points to nearest subscript pointer
+! ... determine the closer of the surrounding coefficients
+	DO 10 i = dst_lo, dst_hi
+	   IF ( ss12(i) .NE. unspecified_int4 .OR. 
+     .          (ss12(i) .EQ. unspecified_int4 .AND. ok_neg111) ) THEN
+	      IF (coef(i) .GE. 0.5) ss12(i) =  ss12(i) + 1
+	   ENDIF
+ 10	CONTINUE
+
+        IF ( .NOT. ok_neg111 ) THEN
+* ... fill upper end of subscript list with highest available source ss
+           found1 = .FALSE.
+           DO 20 i = dst_lo, dst_hi
+              IF ( ss12(i) .NE. unspecified_int4 ) THEN
+                 found1 = .TRUE.
+              ELSEIF ( found1 ) THEN
+                 ss12(i) = src_hi
+              ENDIF
+ 20        CONTINUE
+* ... fill lower end of subscript list with lowest available source ss
+           found1 = .FALSE.
+           DO 30 i = dst_hi, dst_lo, -1
+              IF ( ss12(i) .NE. unspecified_int4 ) THEN
+                 found1 = .TRUE.
+              ELSEIF ( found1 ) THEN
+                 ss12(i) = src_lo
+              ENDIF
+ 30        CONTINUE
+        ENDIF
+
+* transfer THE map-able DATA TO dst_grd
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 110 i = dst_lo, dst_hi
+
+	      ss = ss12(i)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 100 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 100		 CALL COPY_C_STRING(src(ss,j,k,l,m,n),
+     .                              dst(i, j,k,l,m,n))
+	      ELSE
+	         DO 102 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 102 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 102 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 102 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 102 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 102		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 110	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 210 j = dst_lo, dst_hi
+
+	      ss = ss12(j)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 200 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 200 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 200 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 200 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 200 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 200		 CALL COPY_C_STRING(src(i,ss,k,l,m,n),
+     .                              dst(i,j, k,l,m,n))
+	      ELSE
+	         DO 202 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 202 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 202 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 202 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 202		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 210	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 310 k = dst_lo, dst_hi
+
+	      ss = ss12(k)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 300 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 300 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 300		 CALL COPY_C_STRING(src(i,j,ss,l,m,n),
+     .                              dst(i,j,k, l,m,n))
+	      ELSE
+	         DO 302 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 302 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 302 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 302 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 302 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 302		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 310	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 410 l = dst_lo, dst_hi
+
+	      ss = ss12(l)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 400 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 400 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 400 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 400 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 400 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 400		 CALL COPY_C_STRING(src(i,j,k,ss,m,n),
+     .                              dst(i,j,k,l, m,n))
+	      ELSE
+	         DO 402 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 402 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 402 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 402 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 402 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 402		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 410	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+	   DO 510 m = dst_lo, dst_hi
+
+	      ss = ss12(m)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 500 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 500 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 500 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 500 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 500 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 500		 CALL COPY_C_STRING(src(i,j,k,l,ss,n),
+     .                              dst(i,j,k,l, m,n))
+	      ELSE
+	         DO 502 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 502 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 502 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 502 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 502 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 502		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 510	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+	   DO 610 n = dst_lo, dst_hi
+
+	      ss = ss12(n)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .          ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 600 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 600 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 600 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 600 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 600 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 600		 CALL COPY_C_STRING(src(i,j,k,m,n,ss),
+     .                              dst(i,j,k,l,m, n))
+	      ELSE
+	         DO 602 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 602 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 602 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 602 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 602 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 602		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/nearest_regrid_1_axis.F b/fer/doo/nearest_regrid_1_axis.F
new file mode 100644
index 0000000..40178e8
--- /dev/null
+++ b/fer/doo/nearest_regrid_1_axis.F
@@ -0,0 +1,342 @@
+	SUBROUTINE NEAREST_REGRID_1_AXIS(
+     .				        cx_lims, axis, dst_lo, dst_hi,
+     .					src, msrc, dst, mdst,
+     .					ss12, coef )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Regrid from the source to the destination grid using an algorithm
+*       of inserting the values into the result taken from the source
+*       axis coordinate which is nearest to the output point
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their respective
+* 	grids.
+
+* 	Both src and dst are assumed to be 4 dimensional structures
+*	with regridding needed along axis "axis"
+
+*	ss12 holds the indices of grid nodes on src_grd which surround
+*       each dst_grd point ... or unspecified_int4 if insufficient source pts
+
+*	Note: This routine is non-optimal at the low/high edges of the source
+*	axis.  It behaves like linear interpolation in that it will insert
+*	a bad result unless the source axis has a coordinate both above and
+*	below a requested destination axis point.
+
+* note that (for convenience) this routine reuses code from LIN_REGRID_1_AXIS
+* using the values of the linear coefficients computed as the test of whether
+* the source and destination grids have an eNEAREST match
+
+* NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V530: 3/01 *sh* based on xact_regrid_1_axis
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+* v671 *acm*  8/11 Fix ticket 1875: Odd behavior if source axis is short.
+*                  stems from using GET_LINEAR_COEF; linear interp of one
+*                  point to a multi-point axis doesnt make sense, but can
+*                  define the @NRST regridding.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+
+* CALLING ARGUMENT DECLARATIONS:
+	INTEGER cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	INTEGER ss12( dst_lo:dst_hi )
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          coef( dst_lo:dst_hi )
+
+* INTERNAL VARIABLE DECLARATIONS:
+	LOGICAL	found1, ok_neg111
+	INTEGER i, j, k, l, m, n, ii, status,
+     .		ss, src_lo, src_hi, src_grd, dst_grd
+	REAL	bad_src, bad_dst
+	REAL*8	TM_WORLD, TDEST_WORLD, xsrc, xdst, xmin, xmax
+
+
+
+******************************************************************************
+* LIMITS FOR CALCULATION
+        src_lo = mr_lo_ss(msrc,axis)
+        src_hi = mr_hi_ss(msrc,axis)
+
+* FLAG FOR BAD/MISSING DATA
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* source and destination grids
+	src_grd = mr_grid( msrc )
+	dst_grd = mr_grid( mdst )
+
+* DETERMINE src_grd INDEX OF nearest matches on the dst_grd axis
+	CALL GET_LINEAR_COEF(	src_lo, src_hi, src_grd,
+     .				dst_lo, dst_hi, dst_grd,
+     .				axis, ss12, coef )
+
+* Range of subscripts might be negative, and contain -111 among them.
+* ok_neg111 distinguishes between this and the flag unspecified_int4.
+
+        ok_neg111 = (ss12(dst_lo) .LT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .GT. unspecified_int4) .OR.
+     .              (ss12(dst_lo) .GT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .LT. unspecified_int4) 
+
+* convert linear interp subscript points to nearest subscript pointer
+* ... determine the closer of the surrounding coefficients
+        found1 = .FALSE.
+	DO 10 i = dst_lo, dst_hi
+	   IF ( ss12(i) .NE. unspecified_int4 .OR. 
+     .          ss12(i) .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	      IF (coef(i) .GE. 0.5) ss12(i) =  ss12(i) + 1
+	      found1 = .TRUE.
+	   ENDIF
+ 10	CONTINUE
+	
+* ... If there is just one source point, all of the data is "nearest". 
+	IF (src_lo .EQ. src_hi) THEN
+	   DO 20 i = dst_lo, dst_hi
+	      ss12(i) = src_lo
+ 20        CONTINUE
+	ENDIF
+
+* ... . See if the axes overlap - if so can define the subscripts for the transform.
+	IF (.NOT.found1) THEN
+
+* initialize
+	   IF ( axis .EQ. t_dim .OR. axis .EQ. f_dim) THEN
+*             TDST_WORLD gives dates from the source axis as they would be
+*	      encoded on the destination axis 
+*      ==>    ALL TIME/DATE CALCULATIONS ARE DONE IN THE SOURCE AXIS ENCODING
+	      CALL TDEST_WORLD_INIT ( dst_grd, src_grd, axis, status ) ! src<->dst
+	      IF ( status .NE. ferr_ok ) RETURN  ! note - status not passed !!
+   	   ENDIF
+
+           xmin = TM_WORLD( src_lo, src_grd, axis, box_middle )
+           xmax = TM_WORLD( src_hi, src_grd, axis, box_middle )
+	   DO 30 i = dst_lo, dst_hi
+	      ii = i
+              xdst = TDEST_WORLD( i, dst_grd, axis, box_middle )
+	      IF (xdst .LT. xmin) ss12(i) = src_lo
+	      IF (xdst .GT. xmax) ss12(i) = src_hi
+ 30        CONTINUE
+	ENDIF
+
+        IF ( .NOT. ok_neg111 ) THEN
+* ... fill upper end of subscript list with highest available source ss
+           found1 = .FALSE.
+           DO 40 i = dst_lo, dst_hi
+              IF ( ss12(i) .NE. unspecified_int4 ) THEN
+                 found1 = .TRUE.
+              ELSEIF ( found1 ) THEN
+                 ss12(i) = src_hi
+              ENDIF
+ 40        CONTINUE
+* ... fill lower end of subscript list with lowest available source ss
+           found1 = .FALSE.
+           DO 50 i = dst_hi, dst_lo, -1
+              IF ( ss12(i) .NE. unspecified_int4 ) THEN
+                 found1 = .TRUE.
+              ELSEIF ( found1 ) THEN
+                 ss12(i) = src_lo
+              ENDIF
+ 50        CONTINUE
+        ENDIF
+
+* transfer THE map-able DATA TO dst_grd
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 110 i = dst_lo, dst_hi
+
+	      ss = ss12(i)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 100 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 100		 dst(i,j,k,l,m,n) = src(ss,j,k,l,m,n)
+	      ELSE
+	         DO 102 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 102 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 102 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 102 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 102 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 102		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 110	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 210 j = dst_lo, dst_hi
+
+	      ss = ss12(j)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 200 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 200 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 200 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 200 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 200 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 200	         dst(i,j,k,l,m,n) = src(i,ss,k,l,m,n)
+	      ELSE
+	         DO 202 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 202 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 202 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 202 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 202		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 210	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 310 k = dst_lo, dst_hi
+
+	      ss = ss12(k)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 300 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 300 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 300	         dst(i,j,k,l,m,n) = src(i,j,ss,l,m,n)
+	      ELSE
+	         DO 302 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 302 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 302 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 302 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 302 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 302		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 310	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 410 l = dst_lo, dst_hi
+
+	      ss = ss12(l)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 400 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 400 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 400 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 400 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 400 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 400	         dst(i,j,k,l,m,n) = src(i,j,k,ss,m,n)
+	      ELSE
+	         DO 402 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 402 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 402 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 402 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 402 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 402		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 410	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+	   DO 510 m = dst_lo, dst_hi
+
+	      ss = ss12(m)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 500 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 500 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 500 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 500 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 500 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 500	         dst(i,j,k,l,m,n) = src(i,j,k,l,ss,n)
+	      ELSE
+	         DO 502 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 502 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 502 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 502 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 502 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 502		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 510	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+	   DO 610 n = dst_lo, dst_hi
+
+	      ss = ss12(n)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 600 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 600 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 600 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 600 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 600 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 600	         dst(i,j,k,l,m,n) = src(i,j,k,l,m,ss)
+	      ELSE
+	         DO 602 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 602 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 602 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 602 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 602 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 602		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 610	   CONTINUE
+
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/normalize.F b/fer/doo/normalize.F
new file mode 100644
index 0000000..8d72b16
--- /dev/null
+++ b/fer/doo/normalize.F
@@ -0,0 +1,67 @@
+	SUBROUTINE NORMALIZE( wt, wlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create an array to sum to one
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 9/91
+
+        IMPLICIT NONE
+
+* calling argument declarations:
+	INTEGER	wlen
+	REAL	wt(wlen)
+
+* internal variable declarations:
+	INTEGER i
+        REAL sum
+
+* compute initial normalization
+        sum = 0.0
+	DO 100 i = 1, wlen
+ 100	sum = sum + wt(i)
+
+
+* normalize to unity
+        DO 200 i = 1, wlen
+ 200    wt(i) = wt(i) / sum
+
+	RETURN
+	END
diff --git a/fer/doo/parzn_wt.F b/fer/doo/parzn_wt.F
new file mode 100644
index 0000000..14ba60b
--- /dev/null
+++ b/fer/doo/parzn_wt.F
@@ -0,0 +1,66 @@
+	SUBROUTINE PARZN_WT( wt, wlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create an array of Parzen filter (window) weights
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 9/91 - based on BINOM_WT
+
+        IMPLICIT NONE
+
+* calling argument declarations:
+	INTEGER	wlen
+	REAL	wt(0:wlen-1)
+
+* internal variable declarations:
+	INTEGER i
+        REAL c1, c2
+
+* based on Numerical Recipes, W.H.Press, et. al. p.425
+        c1 = (wlen + 1) / 2.
+        c2 = (wlen - 1) / 2.
+	DO 100 i = 0, wlen-1
+ 100	wt(i) = 1.0 - ABS( (i-c2)/c1 )
+
+* normalize to 1
+        CALL NORMALIZE( wt, wlen )
+
+	RETURN
+	END
diff --git a/fer/doo/regrid_comments.F b/fer/doo/regrid_comments.F
new file mode 100644
index 0000000..6bac7b6
--- /dev/null
+++ b/fer/doo/regrid_comments.F
@@ -0,0 +1,233 @@
+	CHARACTER*(*) FUNCTION REGRID_COMMENTS ( cx, mlen )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return text describing the regridding done
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:	 11/1/95 - based on VAR_TITLE_MOD code
+* V450: 1/97 - corrected problem of missing blank when no units were defined
+* V510: 4/00 *sh* - netCDF grids are now dynamic, so "(" as first character
+*		    of name is basis for not using the associated variable
+* V533: 6/01 *sh* - @XACT doesn't need a comment if for xact strides
+* V552  4/03 *acm*  up gname_from_number to 128 characters (variable names)
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+* V68  *acm* 1/12  changes for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V690 *sh* 1/14 document sigma and curvilinear aux var regridding
+
+        IMPLICIT NONE
+	include	'tmap_dims.parm'
+	include	'implicit.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER cx
+
+* internal variable declarations
+	LOGICAL add_on, stat_grid, non_atlin, lin_regrid
+	INTEGER	TM_LENSTR1, KNOWN_GRID,
+     .		var, categ, dset, mlen, maxlen, idim, std_grid, n,
+     .		axis, slen
+	CHARACTER TM_FMT*16, GNAME_FROM_NUMBER*128, VAR_CODE*128,
+     .		  ALG_TRANS_TITL*20, units*24, trans*8, mybuff*128, sep*1
+
+* initialize
+	IF ( .NOT. cx_unstand_grid(cx) ) THEN
+	   REGRID_COMMENTS = ' '
+	   mybuff = ' '
+	   RETURN
+	ENDIF
+	var     = cx_variable( cx )
+	categ   = cx_category( cx )
+	dset    = cx_data_set( cx )
+	non_atlin = .FALSE.		! assume entirely @LIN transforms
+	maxlen  = LEN( REGRID_COMMENTS )
+	IF ( maxlen .LT. 12 ) GOTO 5000
+	stat_grid =  grid_name(cx_grid(cx))(1:1) .NE. '('
+
+* starting blank unavoidable with FORTRAN strings -- removed later
+	REGRID_COMMENTS = ' '
+	mybuff = ' '
+	mlen = 1
+
+* not appending to anything
+	add_on = .FALSE.
+
+* static (named) grids are documented by name
+	IF ( stat_grid ) THEN
+	   REGRID_COMMENTS = GNAME_FROM_NUMBER(dset, cx_grid(cx), mlen)
+	   mybuff = GNAME_FROM_NUMBER(dset, cx_grid(cx), mlen)
+	   mlen = mlen + 1	! blank at end in case there's more
+* ... only go on if there are transforms to report
+	   DO 10 idim = 1, nferdims
+	     IF (cx_regrid_trans(idim,cx) .NE. prgrd_linear_interp
+     .	   .AND. cx_regrid_trans(idim,cx) .NE. prgrd_exact
+     .	   .AND. cx_regrid_trans(idim,cx) .NE. prgrd_xy_lin) THEN
+	       GOTO 50
+	     ENDIF
+ 10	   CONTINUE
+	   GOTO 900
+	ENDIF
+
+* count number of axes regridded and unusual transforms
+ 50	std_grid = KNOWN_GRID( dset, categ, var )
+* ... ... trap for internal error -- should never happen
+	IF ( std_grid .EQ. unspecified_int4 ) GOTO 5000
+	n = 0
+	DO 100 idim = 1, nferdims
+	   axis = grid_line(idim,cx_grid(cx))
+	   IF ( axis .NE. grid_line(idim,std_grid) ) THEN
+	      n = n + 1
+	      lin_regrid = ( (cx_regrid_trans(idim,cx).EQ.prgrd_linear_interp) .OR. 
+     .             (cx_regrid_trans(idim,cx).EQ.prgrd_xy_lin) )
+	      non_atlin = non_atlin
+     .	      .OR. ( .NOT. lin_regrid 
+     .		.AND. .NOT.( cx_regrid_trans(idim,cx) .EQ. prgrd_xact_pts
+     .	               .AND. line_class(axis) .EQ. pline_class_stride ) )
+	   ENDIF
+ 100	CONTINUE
+
+* generate a string like "2 deg on X at AVE" or "Y" or "T at NGD" (for 1 axis)
+*  or "Y at AVE X 5 m on Z"  or   "2 deg on X at AVE X 5 deg on Y at AVE"
+	DO 120 idim = 1, nferdims
+	   axis = grid_line(idim,cx_grid(cx))
+ 	   IF (axis .NE. grid_line(idim,std_grid) ) THEN
+* ... lead-in string
+	      IF (add_on) THEN
+	         REGRID_COMMENTS = REGRID_COMMENTS(:mlen)//', '
+	         mybuff = mybuff(:mlen)//', '
+	         mlen = MIN( maxlen, mlen+2 )
+	      ELSE
+	         add_on = .TRUE.
+	      ENDIF
+	      IF ( line_regular(axis) .AND. .NOT.stat_grid 
+     .	    .AND.  line_dim    (axis) .GT.  1               ) THEN
+* ... delta
+#ifdef double_p
+	         REGRID_COMMENTS = REGRID_COMMENTS(:mlen) //
+     .				 TM_FMT(line_delta(axis),2,8,slen)
+	         mybuff = mybuff(:mlen) //
+     .				 TM_FMT(line_delta(axis),2,8,slen)
+#else
+     	         REGRID_COMMENTS = REGRID_COMMENTS(:mlen) //
+     .				 TM_FMT(SNGL(line_delta(axis)),2,8,slen)
+	         mybuff = mybuff(:mlen) //
+     .				 TM_FMT(SNGL(line_delta(axis)),2,8,slen)
+#endif
+	         mlen = MIN( maxlen, mlen+slen )
+* ... units
+	         IF ( line_units(axis) .EQ. ' ' ) THEN
+	            units = 'delta'
+	         ELSE
+	            IF ( line_unit_code(axis) .EQ. 0 ) THEN
+	                units = line_units(axis)
+	            ELSE
+	                units = un_name(line_unit_code(axis))
+	            ENDIF
+	         ENDIF
+	         slen = TM_LENSTR1(units)
+	         REGRID_COMMENTS = REGRID_COMMENTS(:mlen) //
+     .				   ' '// units(:slen)//' '
+	         mybuff = mybuff(:mlen) //
+     .				   ' '// units(:slen)//' '
+	         mlen = MIN( maxlen, mlen+slen+2 )
+	      ENDIF
+* ... axis
+	      REGRID_COMMENTS = REGRID_COMMENTS(:mlen) // 'on '
+     .					//ww_dim_name(idim)
+	      mybuff = mybuff(:mlen) // 'on '
+     .					//ww_dim_name(idim)
+	      mlen = MIN( maxlen, mlen+4 )
+* ... @transform
+	      IF (non_atlin) THEN
+	         trans = alg_regrid_code(cx_regrid_trans(idim,cx))
+	         REGRID_COMMENTS = REGRID_COMMENTS(:mlen)//'@'//trans
+	         mybuff = mybuff(:mlen)//'@'//trans
+	         mlen = MIN(maxlen,mlen+1+TM_LENSTR1(trans) )
+	      ENDIF
+	   ENDIF
+ 120	CONTINUE
+
+* sigma and curvilinear regridding
+* if an auxiliary variable regrid then document "using DEPTH" or whatever
+ 900	IF (cx_naux(cx) .GT. 0) THEN
+	   mybuff = ' using'
+	   slen = 6
+	   sep = ' '
+	   DO idim = 1, nferdims
+	      IF (cx_aux_cat(idim,cx) .NE. unspecified_int4) THEN
+	         mybuff = mybuff(:slen) // sep //
+     .			  VAR_CODE(cx_aux_cat(idim,cx),
+     .				   cx_aux_var(idim,cx)  )
+	         slen = TM_LENSTR1(mybuff)
+	         sep = ','
+	      ENDIF
+	   ENDDO
+	   REGRID_COMMENTS = REGRID_COMMENTS(:mlen)//mybuff
+	   mlen = MIN(maxlen,mlen+slen)
+	ENDIF
+
+* signal if the string has been truncated for being too long
+	IF ( mlen .EQ. maxlen ) REGRID_COMMENTS(maxlen:maxlen) = '*'
+	IF ( mlen .EQ. maxlen ) mybuff(maxlen:maxlen) = '*'
+
+* remove silly blanks from the start and end
+	IF ( REGRID_COMMENTS(1:1) .EQ. ' ' )
+     .     REGRID_COMMENTS = REGRID_COMMENTS(2:maxlen)
+	IF ( mybuff(1:1) .EQ. ' ' )
+     .     mybuff = mybuff(2:maxlen)
+        mlen = mlen - 1
+	IF ( REGRID_COMMENTS(mlen:mlen) .EQ. ' ' ) mlen = mlen - 1
+	IF ( mybuff(mlen:mlen) .EQ. ' ' ) mlen = mlen - 1
+
+* successful completion
+	RETURN
+
+* error exit
+ 5000	CALL WARN( 'Regrid coruptn!!!' )
+	REGRID_COMMENTS = 'regridded ???'
+	RETURN
+
+	END
diff --git a/fer/doo/rho_unesco.F b/fer/doo/rho_unesco.F
new file mode 100644
index 0000000..2657ade
--- /dev/null
+++ b/fer/doo/rho_unesco.F
@@ -0,0 +1,134 @@
+        REAL FUNCTION RHO_UNESCO(salinity, temperature, pressure)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* The 1980 UNESCO International Equation of State (IES80)
+* *sh* 8/5/92 - adapted from C version supplied by John Osborne, PMEL
+
+*       This calculates rho (density kg/m^3) at salinity, 
+*	temperature, and pressure.  This will be potential density if 
+*	temperature is potential temperature.  The routine uses the high 
+*	pressure equation of state from Millero et al. 1980 and the one-
+*	atmosphere equation of state from Millero and Poisson 1981 as
+*	reported in Gill 1982.  The notation follows Millero et al. 1980
+*	and Millero and Poisson 1981.
+*	
+*	Note: the routine takes p in decibars and converts to bars for
+*	the calculations.
+*	
+* References:	Millero, F.J., et al., 1980, Deep-Sea Res., 27A, 255-264.
+*  Millero, F.J. and Alain Poisson, 1981, Deep-Sea Res., 28A, 625-629.
+*  Gill, A.E., 1982, Atmosphere-Ocean Dynamics, Academic Press, Inc., 662 pp. 
+*	
+*	Input Units:
+*			S: psu	T: deg. C	p: decibars.
+*			
+*	Output Units:
+*			rho: kg/m^3
+*			
+*	Check values:
+*			rho = 999.96675 	for S = 0,  T = 5,  p = 0
+*			rho = 1027.675465 	for S = 35, T = 5,  p = 0
+*			rho = 1062.538172 	for S = 35, T = 25, p = 10000.
+			
+* calling argument declaraions:
+
+        IMPLICIT NONE
+
+        REAL salinity, temperature, pressure
+
+* internal variable declarations:
+	REAL S, T, p, rootS
+	REAL a, b, c, d, e
+	REAL Aw, Bw, Kw
+	REAL A2, B2, C2, Kzero, K
+	REAL rhoW, rhoZero
+
+* initialize
+	S = salinity
+	T = temperature
+	p = pressure / 10.
+	rootS = SQRT (S)
+
+* rhoW is the density of pure water at temperature T.
+	rhoW = ((((6.536332e-09 * T - 1.120083e-06) * T + 1.001685e-04)
+     .		* T - 9.095290e-03) * T + 6.793952e-02) * T + 999.842594
+
+	A2 = (((5.3875e-09 * T - 8.2467e-07) * T + 7.6438e-05)
+     .		* T - 4.0899e-03) * T + 8.24493e-01
+
+	B2 = (-1.6546e-06 * T + 1.0227e-04) * T - 5.72466e-03
+
+	C2 = 4.8314e-04
+
+* rhoZero is the one-atmosphere density of seawater
+	rhoZero	= (C2 * S + B2 * rootS + A2) * S + rhoW
+
+	IF ( pressure .EQ. 0.0 ) THEN
+	   RHO_UNESCO = rhoZero
+	   RETURN
+        ENDIF
+
+	a = ((-6.1670e-05 * T + 1.09987e-02) * T - 6.03459e-01) * T
+     .		+ 54.6746
+
+	b = (-5.3009e-04 * T + 1.6483e-02) * T + 7.944e-02
+
+	c = (-1.6078e-06 * T - 1.0981e-05) * T + 2.2838e-03
+
+	d = 1.91075e-04
+
+	e = (9.1697e-10 * T + 2.0816e-08) * T - 9.9348e-07
+
+	Aw = ((-5.77905e-07 * T + 1.16092e-04) * T + 1.43713e-03) * T
+     .	       + 3.239908
+
+	Bw = (5.2787e-08 * T - 6.12293e-06) * T + 8.50935e-05
+
+* Kw is the secant bulk modulus of pure water at temperature T.
+	Kw = (((-5.155288e-05 * T + 1.360477e-02) * T - 2.327105)
+     .		* T + 148.4206) * T + 19652.21
+
+* Kzero is the secant bulk modulus of seawater at one atmosphere.
+	Kzero = (b * rootS + a) * S + Kw
+
+* K is the secant bulk modulus of seawater at (S, T, p).
+	K = ((e * p + d * rootS + c) * S + Bw * p + Aw) * p + Kzero
+
+	RHO_UNESCO = rhoZero / (1.0 - (p / K))
+
+	RETURN
+	END
diff --git a/fer/doo/theta_foff.F b/fer/doo/theta_foff.F
new file mode 100644
index 0000000..de68381
--- /dev/null
+++ b/fer/doo/theta_foff.F
@@ -0,0 +1,126 @@
+      REAL FUNCTION THETA_FOFF (S, TO, PO, PR)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+**************************
+
+C TO COMPUTE LOCAL POTENTIAL TEMPERATURE AT PF 
+C USING BRYDEN 1973 POLYNOMIAL FOR ADIABATIC LAPSE RATE
+C AND RUNGE-KUTTA 4-TH ORDER INTEGRATION ALGORITHM.
+C
+C REFERENCES:	BRYDEN,H.,1973,DEEP-SEA RES.,20,401-408
+C		FOFONOFF,N,M,1977,DEEP-SEA RES.,24,489-491
+C
+C UNITS:
+C	PRESSURE	PO	DECIBARS
+C	TEMPERATURE	TO	DEG CELSIUS (IPTS-68)
+C	SALINITY	S	(PSS-78)
+C	REFERENCE PRS	PR	DECIBARS
+C	POTENTIAL TEMP	THETA	DEG CELSIUS
+C
+C CHECKVALUE: THETA=36.89073 DEG C:  S=40(PSS-78), TO=40 DEG C,
+C		PO=10000 DECIBARS, PR=0 DECIBARS
+C
+C--FROM FOFONOFF,N.,AND R.C.MILLARD,1983,DRAFT. LJM
+
+*************************
+
+      IMPLICIT NONE
+
+* calling argument declarations:
+      REAL S, TO, PO, PR
+
+* internal variable declarations:
+      REAL ATG, T, p, h, xk, q
+
+      P = PO
+      T = TO
+      H = PR - P
+      XK = H*ATG(S,T,P) 
+      T = T + 0.5*XK
+      Q = XK
+      P = P + 0.5*H 
+      XK = H*ATG(S,T,P) 
+      T = T + 0.29289322*(XK - Q) 
+      Q = 0.58578644*XK + 0.121320344*Q 
+      XK = H*ATG(S,T,P) 
+      T = T + 1.707106781*(XK - Q)
+      Q = 3.414213562*XK - 4.121320344*Q
+      P = P + 0.5*H 
+      XK = H*ATG(S,T,P) 
+      THETA_FOFF = T + (XK - 2.0*Q)/6.0
+      RETURN
+      END 
+
+* **************************************************
+        REAL FUNCTION ATG (salinity, temperature, pressure) 
+
+*    Reference:  Bryden, H., 1973, Deep Sea Res., 20, 401-408.
+*
+*    Units:
+*
+*    	Pressure:		P			decibars
+*    	Temperature:		T			degrees Celcius
+*    	Salinity:		S			psu (IPSS-78)
+*    	Adiabatic:		ATG			deg. C/decibar
+*
+*
+*    Check value:
+*    		ATG = 3.255796E-4 C/dbar for S = 40 (psu), T = 40 deg. C, 
+*    		P = 10000 decibars.
+
+        IMPLICIT NONE
+
+* calling argument declarations:
+        REAL salinity, temperature, pressure
+
+* internal variable declarations:
+	REAL S, T, p
+
+* initialize
+	S = salinity - 35.
+	T = temperature
+	p = pressure
+
+	ATG = (((-2.1687e-16 * T + 1.8676e-14) * T - 4.6206e-13) * p
+     .	      + ((2.7759e-12 * T - 1.1351e-10) * S + ((-5.4481e-14 * T
+     .	      + 8.733e-12) * T - 6.7795e-10) * T + 1.8741e-08)) * p
+     .	      + (-4.2393e-08 * T + 1.8932e-06) * S
+     .	      + ((6.6228e-10 * T - 6.836e-08) * T + 8.5258e-06) * T
+     .	      + 3.5803e-05
+
+        RETURN
+        END
diff --git a/fer/doo/welch_wt.F b/fer/doo/welch_wt.F
new file mode 100644
index 0000000..05e6462
--- /dev/null
+++ b/fer/doo/welch_wt.F
@@ -0,0 +1,66 @@
+	SUBROUTINE WELCH_WT( wt, wlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create an array of Welch filter (window) weights
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for Unix/RISC port 9/91 - based on BINOM_WT
+
+        IMPLICIT NONE
+
+* calling argument declarations:
+	INTEGER	wlen
+	REAL	wt(0:wlen-1)
+
+* internal variable declarations:
+	INTEGER i
+        REAL c1, c2
+
+* based on Numerical Recipes, W.H.Press, et. al. p.425
+        c1 = (wlen + 1) / 2.
+        c2 = (wlen - 1) / 2.
+	DO 100 i = 0, wlen-1
+ 100	wt(i) = 1.0 - ((i-c2)/c1)**2
+
+* normalize to 1
+        CALL NORMALIZE( wt, wlen )
+
+	RETURN
+	END
diff --git a/fer/doo/window_regrid_1_axis.F b/fer/doo/window_regrid_1_axis.F
new file mode 100644
index 0000000..fbed549
--- /dev/null
+++ b/fer/doo/window_regrid_1_axis.F
@@ -0,0 +1,392 @@
+	SUBROUTINE WINDOW_REGRID_1_AXIS( cx_lims, axis, trans,
+     .				 dst_lox, dst_hix, dst_loy, dst_hiy,
+     .				 src, msrc, dst, mdst, sslo, sshi,
+     .				 wksize )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grid, regrid to
+* 	grid dst_grid within boxes along one axis
+
+*	The algorithm used for regridding is determined by "trans", the
+*	regridding transformation -- e.g. min, max, ...
+*	This routine handles only algorithms that compute using discrete
+*	(unweighted) points.  Transforms such as average and variance are
+*	handled in ave_regrid_1_axis
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their 
+* 	respective grids.
+
+*	ss21 holds the indices of source grid boxes (on src_grid) for box
+*	limits on dst_grid.
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V420: 1/96 - removed SUM and NGD from here to ave_regrid_1_axis (weighted)
+* V500: 4/99 *kob* bug fix:  fixed loops for y,z,t axis to loop
+*                            only to srcss_hi-1
+* V510: 1/00 *sh* bug fix to behavior at edges of region
+* v570 *acm* 5/04 Note: we do not need to use the ok_neg111 fix for 
+*                 when the range of subscripts might be negative, and 
+*                 contain -111 among them. Tests for unspecified_int4
+*                 are not used in this routine.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685+ 12/13 *acm* Typo in the F-axis code.
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xvariables.cmn'
+
+
+* calling argument declarations:
+	INTEGER	cx_lims, axis, msrc, trans, mdst,
+     .          dst_lox, dst_hix, dst_loy, dst_hiy , wksize
+	INTEGER	sslo(wksize), sshi(wksize)
+
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* local variable declarations:
+	INTEGER	npts, dstss, srcss, src_grid, dst_grid,
+     .          i, j, k, l, m, n
+	INTEGER	srcss_lo,srcss_hi, dstss_lo,dstss_hi,
+     .		src_lo, src_hi
+
+	REAL	accum, bad_src, bad_dst
+
+******************************************************************************
+
+* initialize
+	src_grid = mr_grid( msrc )
+	dst_grid = mr_grid( mdst )
+
+* limits for calculation
+        srcss_lo = mr_lo_ss(msrc,axis)
+        srcss_hi = mr_hi_ss(msrc,axis)
+
+        dstss_lo = cx_lo_ss(cx_lims,axis)
+        dstss_hi = cx_hi_ss(cx_lims,axis)
+
+* flag for bad/missing data
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* determine the source grid boxes containing the destination boxes
+	CALL GET_WINDOW_LIMS ( srcss_lo, srcss_hi, src_grid,
+     .			   dstss_lo, dstss_hi, dst_grid,
+     .			   axis, sslo, sshi )
+
+
+* along X axis
+        IF ( axis .EQ. x_dim ) THEN
+           DO 190 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 190 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 190 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 190 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 190 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+
+* loop through the each destination grid box
+	   DO 160 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+	      DO 110 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(srcss,j,k,l,m,n) .EQ. bad_src ) GOTO 110
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(srcss,j,k,l,m,n) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(srcss,j,k,l,m,n) )
+	         ENDIF
+	         npts = npts + 1
+ 110	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(dstss,j,k,l,m,n) = accum
+              ELSE
+                 dst(dstss,j,k,l,m,n) = bad_dst
+              ENDIF
+
+ 160	   CONTINUE
+ 190	   CONTINUE
+
+* along Y axis
+        ELSEIF ( axis .EQ. Y_dim ) THEN
+
+           DO 290 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 290 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 290 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 290 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 290 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 260 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+
+	      DO 210 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(i,srcss,k,l,m,n) .EQ. bad_src ) GOTO 210
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(i,srcss,k,l,m,n) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(i,srcss,k,l,m,n) )
+	         ENDIF
+	         npts = npts + 1
+ 210	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(i,dstss,k,l,m,n) = accum
+              ELSE
+                 dst(i,dstss,k,l,m,n) = bad_dst
+              ENDIF
+
+ 260	   CONTINUE
+ 290	   CONTINUE
+
+* along Z axis
+        ELSEIF ( axis .EQ. z_dim ) THEN
+
+           DO 390 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 390 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 390 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 390 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 390 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 360 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+
+	      DO 310 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(i,j,srcss,l,m,n) .EQ. bad_src ) GOTO 310
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(i,j,srcss,l,m,n) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(i,j,srcss,l,m,n) )
+	         ENDIF
+	         npts = npts + 1
+ 310	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(i,j,dstss,l,m,n) = accum
+              ELSE
+                 dst(i,j,dstss,l,m,n) = bad_dst
+              ENDIF
+
+ 360	   CONTINUE
+ 390	   CONTINUE
+
+* along T axis
+        ELSEIF ( axis .EQ. T_dim ) THEN
+
+           DO 490 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 490 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 490 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 490 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 490 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 460 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+
+	      DO 410 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,srcss,m,n) .EQ. bad_src ) GOTO 410
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(i,j,k,srcss,m,n) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(i,j,k,srcss,m,n) )
+	         ENDIF
+	         npts = npts + 1
+ 410	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(i,j,k,dstss,m,n) = accum
+              ELSE
+                 dst(i,j,k,dstss,m,n) = bad_dst
+              ENDIF
+
+ 460	   CONTINUE
+ 490	   CONTINUE
+
+* along E axis
+        ELSEIF ( axis .EQ. E_dim ) THEN
+
+           DO 590 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+           DO 590 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 590 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 590 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 590 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 560 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+
+	      DO 510 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,l,srcss,n) .EQ. bad_src ) GOTO 510
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(i,j,k,l,srcss,n) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(i,j,k,l,srcss,n) )
+	         ENDIF
+	         npts = npts + 1
+ 510	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(i,j,k,l,dstss,n) = accum
+              ELSE
+                 dst(i,j,k,l,dstss,n) = bad_dst
+              ENDIF
+
+ 560	   CONTINUE
+ 590	   CONTINUE
+
+
+* along F axis
+        ELSEIF ( axis .EQ. F_dim ) THEN
+
+           DO 690 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+           DO 690 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+           DO 690 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+           DO 690 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+           DO 690 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+
+* loop through the each destination grid box
+	   DO 660 dstss = dstss_lo,dstss_hi
+
+	      src_lo = sslo(dstss-dstss_lo+1)
+	      src_hi = sshi(dstss-dstss_lo+1)
+
+	      IF     ( trans .EQ. prgrd_min ) THEN
+	         accum = arbitrary_large_val4
+	      ELSEIF ( trans .EQ. prgrd_max ) THEN
+	         accum = arbitrary_small_val4
+	      ENDIF
+	      npts = 0
+
+	      DO 610 srcss = src_lo, src_hi
+
+* ... ignore missing source data
+	         IF ( src(i,j,k,l,m,srcss) .EQ. bad_src ) GOTO 610
+
+* ... contribution from this source box
+	         IF     ( trans .EQ. prgrd_min ) THEN
+	            accum = MIN( accum, src(i,j,k,l,m,srcss) )
+	         ELSEIF ( trans .EQ. prgrd_max ) THEN
+	            accum = MAX( accum, src(i,j,k,l,m,srcss) )
+	         ENDIF
+	         npts = npts + 1
+ 610	      CONTINUE
+
+              IF ( npts .GT. 0 ) THEN
+                 dst(i,j,k,l,m,dstss) = accum
+              ELSE
+                 dst(i,j,k,l,m,dstss) = bad_dst
+              ENDIF
+
+ 660	   CONTINUE
+ 690	   CONTINUE
+
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/xact_ptr_regrid_1_axis.F b/fer/doo/xact_ptr_regrid_1_axis.F
new file mode 100644
index 0000000..c5dde11
--- /dev/null
+++ b/fer/doo/xact_ptr_regrid_1_axis.F
@@ -0,0 +1,270 @@
+	SUBROUTINE XACT_PTR_REGRID_1_AXIS( cx_lims, axis, dst_lo, dst_hi,
+     .					src, msrc, dst, mdst,
+     .					ss12, coef )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Regrid from the source to the destination grid using an algorithm
+*       of inserting values into the result ONLY when the source grid has
+*       a value at exactly the same coordinate on this axis.
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their respective
+* 	grids.
+
+* 	Both src and dst are assumed to be 4 dimensional structures
+*	with regridding needed along axis "axis"
+
+*	ss12 holds the indices of grid nodes on src_grd for which there 
+*       is an exact match on dst_grd ... or unspecified_int4 if no match
+
+* note that (for convenience) this routine reuses code from LIN_REGRID_1_AXIS
+* using the values of the linear coefficients computed as the test of whether
+* the source and destination grids have an exact match
+
+* NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V533: *sh* 6/01
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* CALLING ARGUMENT DECLARATIONS:
+	INTEGER	cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	INTEGER ss12( dst_lo:dst_hi )
+	REAL*8  src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+	REAL    coef( dst_lo:dst_hi )
+
+* INTERNAL VARIABLE DECLARATIONS:
+	LOGICAL	TM_FPEQ, ok_neg111
+	INTEGER i, j, k, l, m, n,
+     .		ss, src_lo, src_hi, src_grd, dst_grd
+
+******************************************************************************
+
+* LIMITS FOR CALCULATION
+        src_lo = mr_lo_ss(msrc,axis)
+        src_hi = mr_hi_ss(msrc,axis)
+
+* source and destination grids
+	src_grd = mr_grid( msrc )
+	dst_grd = mr_grid( mdst )
+
+* DETERMINE src_grd INDEX OF exact matches on the dst_grd axis
+	CALL GET_LINEAR_COEF(	src_lo, src_hi, src_grd,
+     .				dst_lo, dst_hi, dst_grd,
+     .				axis, ss12, coef )
+	DO 10 i = dst_lo, dst_hi
+	   IF ( .NOT.TM_FPEQ(coef(i),0.0) ) ss12(i) = unspecified_int4
+ 10	CONTINUE
+
+* Range of subscripts might be negative, and contain -111 among them.
+* ok_neg111 distinguishes between this and the flag unspecified_int4.
+
+        ok_neg111 = (ss12(dst_lo) .LT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .GT. unspecified_int4) .OR.
+     .              (ss12(dst_lo) .GT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .LT. unspecified_int4) 
+
+* transfer THE map-able DATA TO dst_grd
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 110 i = dst_lo, dst_hi
+
+	      ss = ss12(i)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 100 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 100	         CALL COPY_C_STRING(src(ss,j,k,l,m,n),
+     .                              dst(i, j,k,l,m,n))
+	      ELSE
+	         DO 102 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 102 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 102 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 102 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 102 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 102		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 110	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 210 j = dst_lo, dst_hi
+
+	      ss = ss12(j)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 200 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 200 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 200 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 200 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 200 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 200	         CALL COPY_C_STRING(src(i,ss,k,l,m,n),
+     .                              dst(i,j, k,l,m,n))
+	      ELSE
+	         DO 202 n = cx_lo_s6(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 202 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 202 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 202		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 210	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 310 k = dst_lo, dst_hi
+
+	      ss = ss12(k)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 300 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 300 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 300	         CALL COPY_C_STRING(src(i,j,ss,l,m,n),
+     .                              dst(i,j,k, l,m,n))
+	      ELSE
+	         DO 302 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 302 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 302 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 302 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 302 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 302		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 310	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 410 l = dst_lo, dst_hi
+
+	      ss = ss12(l)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 400 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 400 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 400 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 400 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 400 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 400	         CALL COPY_C_STRING(src(i,j,k,ss,m,n),
+     .                              dst(i,j,k,l, m,n))
+	      ELSE
+	         DO 402 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 402 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 402 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 402 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 402 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 402		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 410	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+	   DO 510 m = dst_lo, dst_hi
+
+	      ss = ss12(m)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 500 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 500 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 500 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 500 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 500 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 500	         CALL COPY_C_STRING(src(i,j,k,l,ss,n),
+     .                              dst(i,j,k,l, m,n))
+	      ELSE
+	         DO 502 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 502 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 502 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 502 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 502 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 502		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 510	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+	   DO 610 n = dst_lo, dst_hi
+
+	      ss = ss12(n)
+
+	      IF ( ss .NE. unspecified_int4  .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 600 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 600 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 600 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 600 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 600 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 600	         CALL COPY_C_STRING(src(i,j,k,l,m,ss),
+     .                              dst(i,j,k,l,m, n))
+	      ELSE
+	         DO 602 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 602 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 602 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 602 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 602 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 602		 CALL SET_NULL_C_STRING(dst(i,j,k,l,m,n))
+	      ENDIF
+
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/doo/xact_regrid_1_axis.F b/fer/doo/xact_regrid_1_axis.F
new file mode 100644
index 0000000..b3028e5
--- /dev/null
+++ b/fer/doo/xact_regrid_1_axis.F
@@ -0,0 +1,284 @@
+	SUBROUTINE XACT_REGRID_1_AXIS(	cx_lims, axis, dst_lo, dst_hi,
+     .					src, msrc, dst, mdst,
+     .					ss12, coef )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Regrid from the source to the destination grid using an algorithm
+*       of inserting values into the result ONLY when the source grid has
+*       a value at exactly the same coordinate on this axis.
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+* 	specify the subscript bounds of src and dst within their respective
+* 	grids.
+
+* 	Both src and dst are assumed to be 4 dimensional structures
+*	with regridding needed along axis "axis"
+
+*	ss12 holds the indices of grid nodes on src_grd for which there 
+*       is an exact match on dst_grd ... or unspecified_int4 if no match
+
+* note that (for convenience) this routine reuses code from LIN_REGRID_1_AXIS
+* using the values of the linear coefficients computed as the test of whether
+* the source and destination grids have an exact match
+
+* NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+
+* V500: 10/97
+
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flag 
+*                 ok_neg111 to distinguish this case from the flag 
+*                 unspecified_int4.
+* v580 *acm* 11/04 Fix the definition of ok_neg111; if -111 is at
+*                  either end of the interval we cannot distinguish
+*                  it as a valid index from its use as the bad flag.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+
+* CALLING ARGUMENT DECLARATIONS:
+	INTEGER	cx_lims, axis, dst_lo, dst_hi, msrc, mdst
+	INTEGER ss12( dst_lo:dst_hi )
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .          coef( dst_lo:dst_hi )
+
+* INTERNAL VARIABLE DECLARATIONS:
+	LOGICAL	TM_FPEQ_SNGL, TM_DFPEQ_TOL, ok_neg111
+	INTEGER i, j, k, l, m, n,
+     .		ss, src_lo, src_hi, src_grd, dst_grd, was
+	REAL	bad_src, bad_dst
+	REAL*4  singlec, singlez, single1
+
+******************************************************************************
+
+* LIMITS FOR CALCULATION
+        src_lo = mr_lo_ss(msrc,axis)
+        src_hi = mr_hi_ss(msrc,axis)
+
+* FLAG FOR BAD/MISSING DATA
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* source and destination grids
+	src_grd = mr_grid( msrc )
+	dst_grd = mr_grid( mdst )
+
+* single-precision comparison with zero and 1.
+	singlez = 0.0  
+	single1 = 1.0  
+
+* DETERMINE src_grd INDEX OF exact matches on the dst_grd axis
+	CALL GET_LINEAR_COEF(	src_lo, src_hi, src_grd,
+     .				dst_lo, dst_hi, dst_grd,
+     .				axis, ss12, coef )
+	DO 10 i = dst_lo, dst_hi
+	   singlec = coef(i)
+	   was = ss12(i)
+	   IF ( .NOT.TM_FPEQ_SNGL(singlec,singlez) ) 
+     .				ss12(i) = unspecified_int4
+	   IF (  TM_FPEQ_SNGL(singlec,single1) ) 
+     .				ss12(i) = was
+ 10	CONTINUE
+
+* Range of subscripts might be negative, and contain -111 among them.
+* ok_neg111 distinguishes between this and the flag unspecified_int4.
+
+        ok_neg111 = (ss12(dst_lo) .LT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .GT. unspecified_int4) .OR.
+     .              (ss12(dst_lo) .GT. unspecified_int4 .AND.
+     .               ss12(dst_hi) .LT. unspecified_int4) 
+
+* transfer THE map-able DATA TO dst_grd
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 110 i = dst_lo, dst_hi
+
+	      ss = ss12(i)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 100 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 100	         dst(i,j,k,l,m,n) = src(ss,j,k,l,m,n)
+	      ELSE
+	         DO 102 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 102 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 102 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 102 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 102 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+ 102		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 110	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 210 j = dst_lo, dst_hi
+
+	      ss = ss12(j)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 200 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 200 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 200 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 200 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 200 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 200	         dst(i,j,k,l,m,n) = src(i,ss,k,l,m,n)
+	      ELSE
+	         DO 202 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 202 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 202 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 202 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 202 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 202		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 210	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 310 k = dst_lo, dst_hi
+
+	      ss = ss12(k)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 300 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 300 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 300	         dst(i,j,k,l,m,n) = src(i,j,ss,l,m,n)
+	      ELSE
+	         DO 302 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 302 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 302 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 302 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 302 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 302		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 310	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 410 l = dst_lo, dst_hi
+
+	      ss = ss12(l)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 400 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 400 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 400 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 400 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 400 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 400	         dst(i,j,k,l,m,n) = src(i,j,k,ss,m,n)
+	      ELSE
+	         DO 402 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 402 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 402 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 402 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 402 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 402		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 410	   CONTINUE
+
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+	   DO 510 m = dst_lo, dst_hi
+
+	      ss = ss12(m)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 500 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 500 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 500 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 500 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 500 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 500	         dst(i,j,k,l,m,n) = src(i,j,k,l,ss,n)
+	      ELSE
+	         DO 502 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	         DO 502 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 502 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 502 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 502 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 502		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 510	   CONTINUE
+
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+	   DO 610 n = dst_lo, dst_hi
+
+	      ss = ss12(n)
+
+	      IF ( ss .NE. unspecified_int4 .OR. 
+     .             ss .EQ. unspecified_int4 .AND. ok_neg111) THEN
+	         DO 600 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 600 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 600 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 600 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 600 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 600	         dst(i,j,k,l,m,n) = src(i,j,k,l,m,ss)
+	      ELSE
+	         DO 602 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	         DO 602 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	         DO 602 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+	         DO 602 j = cx_lo_s2(cx_lims), cx_hi_s2(cx_lims)
+	         DO 602 i = cx_lo_s1(cx_lims), cx_hi_s1(cx_lims)
+ 602		 dst(i,j,k,l,m,n) = bad_dst
+	      ENDIF
+
+ 610	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/doo/xyave_regrid.F b/fer/doo/xyave_regrid.F
new file mode 100644
index 0000000..7cf7b88
--- /dev/null
+++ b/fer/doo/xyave_regrid.F
@@ -0,0 +1,259 @@
+	SUBROUTINE XYAVE_REGRID( cx_lims,
+     .				 dst_lox, dst_hix, dst_loy, dst_hiy,
+     .				 src, msrc, dst, mdst,
+     .			         src_cx, dst_cx, i21,j21)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grid, regrid to
+* 	grid dst_grid by averaging withing boxes
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+
+* 	specify the subscript bounds of src and dst within their 
+* 	respective grids.
+
+* 	Both src and dst are assumed to be 2 dimensional structures
+* 	lying in the same plane - given by mr_DIM1 and mr_DIM2.
+
+*	I21 and J21 hold the indices of source grid boxes (on src_grid) for box
+*	limits on dst_grid.
+
+* 	programmer - Steve Hankin
+* 	NOAA/PMEL,Seattle,WA - Tropical Modeling and Analysis Program
+* 	written for VAX computer under VMS operating system
+
+* 	revision 0.0 -  1/9/89 
+* V200: 12/1/89 - 4D symmetrical version
+* note: the conversion to 4D is of the Q&D variety.  Optimization is possible
+*	by providing additional work space and pre-computing the box sizes
+*	along the X and Y axes
+* V314&V400: 9/94 - bug fix: GOTO 50 ==> GOTO 60 for missing source value
+
+* v552: *acm* 4/03 In some cases the source indices include a range
+*                  outside the destination indices, so xdist or ydist < 0. 
+*                  Test for this and only have a contribution to the avg from 
+*                  portions of the source axis that overlap the dest box.
+*                  Also, use src_lo_ss and src_hi_ss for the range on the src
+*                  axis rather than mr_lo_ss and mr_hi_ss
+* v570 *acm* 5/04 Range of subscripts might be negative, and contain 
+*                 -111 among them. Allow regridding, using the flags 
+*                 ok_negi111, ok_negj111 to distinguish this case from 
+*                 the flag unspecified_int4.
+* V600  4/06 *acm* - make refinement to cos(lat) factor as suggested by A. Wittenberg
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* 6/06 - Fix to Andrew*s correction for XY integ., bug1348
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, msrc, mdst, dst_lox, dst_hix,
+     .          dst_loy, dst_hiy, src_cx, dst_cx 
+	INTEGER	i21(dst_lox:dst_hix+1),
+     .		j21(dst_loy:dst_hiy+1)
+
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* local variable declarations:
+	LOGICAL GEOG_COS_FACTOR,
+     .          need_cos, ok_negi111, ok_negj111
+
+	INTEGER idst, isrc, jdst, jsrc, dim1, dim2,
+     .          src_grid, dst_grid, k, l, m, n,
+     .          isrc_lo, isrc_hi, jsrc_lo, jsrc_hi,
+     .          idst_lo, idst_hi, jdst_lo, jdst_hi
+
+	REAL	AXIS_DISTANCE, BOX_SIZE,
+     .          xdist, ydist, area, sum, darea, bad_src, bad_dst,
+     .          cos_fact, area_earth, ybxlo, ybxhi
+
+        REAL*8	TWORLD,
+     .          xsrc_lo, xsrc_hi, ysrc_lo, ysrc_hi,
+     .          xdst_lo, xdst_hi, ydst_lo, ydst_hi
+********************************************************************************
+
+* initialize
+
+	src_grid = mr_grid( msrc )
+	dst_grid = mr_grid( mdst )
+	dim1     = x_dim
+	dim2     = y_dim
+
+* need to include COSINE factor ?
+	need_cos = GEOG_COS_FACTOR( dim2, dst_grid )
+
+* limits for calculation
+        isrc_lo = cx_lo_ss(src_cx,dim1)
+        isrc_hi = cx_hi_ss(src_cx,dim1)
+        jsrc_lo = cx_lo_ss(src_cx,dim2)
+        jsrc_hi = cx_hi_ss(src_cx,dim2)
+
+        idst_lo = cx_lo_s1(cx_lims)
+        idst_hi = cx_hi_s1(cx_lims)
+        jdst_lo = cx_lo_s2(cx_lims)
+        jdst_hi = cx_hi_s2(cx_lims)
+
+* flag for bad/missing data
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* determine the source grid boxes containing the destination box edges
+
+	CALL GET_AVE_LIMS( isrc_lo, isrc_hi, src_grid,
+     .			   idst_lo, idst_hi, dst_grid,
+     .			   dim1, i21 )
+	CALL GET_AVE_LIMS( jsrc_lo, jsrc_hi, src_grid,
+     .			   jdst_lo, jdst_hi, dst_grid,
+     .			   dim2, j21 )
+
+    
+* Range of subscripts might be negative, and contain -111 among them.
+* ok_negi111, ok_negj111 distinguish between this and the flag unspecified_int4.
+
+        ok_negi111 = ( i21(idst_lo) .LT. unspecified_int4 .AND.
+     .                 i21(idst_hi) .GT. unspecified_int4 )
+
+        ok_negj111 = ( j21(jdst_lo) .LT. unspecified_int4 .AND.
+     .                 j21(jdst_hi) .GT. unspecified_int4 )
+
+
+* loop over Z, T, E, and F ranges of 6-D data
+	DO 100 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	DO 100 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	DO 100 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	DO 100 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+
+* loop through the each destination grid box
+	DO 60 jdst = jdst_lo,jdst_hi
+	jsrc_lo = j21(jdst)
+	jsrc_hi = j21(jdst+1)
+	ydst_lo = TWORLD(jdst, dst_grid, dim2, box_lo_lim )
+	ydst_hi = TWORLD(jdst, dst_grid, dim2, box_hi_lim )
+	DO 60 idst = idst_lo,idst_hi
+	   isrc_lo = i21(idst)
+	   isrc_hi = i21(idst+1)
+
+*  check if requested region is out of source range
+           IF ( ( (isrc_lo .EQ. unspecified_int4
+     .    .OR.     isrc_hi .EQ. unspecified_int4)
+     .            .AND. .NOT. ok_negi111 )
+     .    .OR.  ( (jsrc_lo .EQ. unspecified_int4
+     .    .OR.     jsrc_hi .EQ. unspecified_int4)
+     .            .AND. .NOT. ok_negj111 ) ) THEN
+	      dst(idst,jdst,k,l,m,n) = bad_dst
+	      goto 60
+	   ENDIF
+
+	   xdst_lo = TWORLD(idst, dst_grid, dim1, box_lo_lim )
+	   xdst_hi = TWORLD(idst, dst_grid, dim1, box_hi_lim )
+
+! m_radius in ferret.parm
+! area_earth used as a scaling factor that gets cancelled out; is it really needed?
+           area_earth = 4. * 3.141592653 * m_radius**2
+
+* add all partial or complete boxes of data from the source grid
+* 3/06 - apply Andrew*s suggested correction, bug1348
+
+	   sum  = 0.0
+	   area = 0.0
+	   DO 51 jsrc = jsrc_lo, jsrc_hi
+	   cos_fact = 1.0
+	   IF ( need_cos ) THEN
+!             cos_fact = COS(deg2rad*TWORLD(jsrc,src_grid,dim2,box_middle)) !old method!
+!             yc = TWORLD(jsrc,src_grid,dim2,box_middle)
+!             bx = BOX_SIZE( jsrc, src_grid, dim2 )
+!             yh_2 = 0.5*deg2rad * bx
+!             yc = deg2rad * yc
+!             cos_fact = COS(yc) * 2.*ABS( SIN(yh_2) )
+
+C The above are all OK if the coordinate point is in the middle of the box.
+C If the coordinate is not in the middle of the cell then it should be
+C ABS(SIN(ybxhi)-SIN(ybxlo))  
+C See this thread:
+C http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00506.html
+C And also ticket 1348.
+
+              ybxlo = deg2rad* TWORLD(jsrc,src_grid,dim2,box_lo_lim)
+              ybxhi = deg2rad* TWORLD(jsrc,src_grid,dim2,box_hi_lim)
+              cos_fact = ABS( SIN(ybxhi) - SIN(ybxlo) )
+
+	   ENDIF
+
+	   ysrc_lo = MAX( TWORLD(jsrc,src_grid,dim2,box_lo_lim), ydst_lo)
+	   ysrc_hi = MIN( TWORLD(jsrc,src_grid,dim2,box_hi_lim), ydst_hi)
+	   ydist   = AXIS_DISTANCE( ysrc_lo, ysrc_hi, dim2, src_grid )
+
+	   DO 50 isrc = isrc_lo, isrc_hi
+
+* ... ignore missing source data
+	      IF ( src(isrc,jsrc,k,l,m,n) .EQ. bad_src ) GOTO 50
+
+	      xsrc_lo = MAX( TWORLD(isrc,src_grid,dim1,box_lo_lim), xdst_lo )
+	      xsrc_hi = MIN( TWORLD(isrc,src_grid,dim1,box_hi_lim), xdst_hi )
+	      xdist   = AXIS_DISTANCE( xsrc_lo, xsrc_hi, dim1, src_grid )
+
+* ... contribution from this source box
+*     1/area_earth factor cancels out in result average
+              IF (xdist .gt. 0.  .AND.  ydist .GT. 0) THEN
+	         darea = ydist*(cos_fact*xdist) / area_earth
+	         area  = area + darea
+	         sum   = sum  + darea * src(isrc,jsrc,k,l,m,n)
+              ENDIF
+
+ 50	      CONTINUE
+ 51	   CONTINUE
+* ... divide by area to get average
+	   IF ( area .GT. 0.0 ) THEN
+	      dst(idst,jdst,k,l,m,n) = sum / area
+	   ELSE
+	      dst(idst,jdst,k,l,m,n) = bad_dst
+	   ENDIF
+
+ 60	CONTINUE
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/doo/xylin_regrid.F b/fer/doo/xylin_regrid.F
new file mode 100644
index 0000000..6d42dfa
--- /dev/null
+++ b/fer/doo/xylin_regrid.F
@@ -0,0 +1,210 @@
+	SUBROUTINE XYLIN_REGRID( cx_lims,
+     .				 dst_lox, dst_hix, dst_loy, dst_hiy,
+     .				 src, msrc, dst, mdst, src_cx, dst_cx, 
+     .			         iss12, coefi, jss12, coefj, work)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Using data values from src organized on grid src_grid, interpolate to
+* 	values dst on grid dst_grd.
+
+* 	msrc and mdst point to data structures in COMMON/XVARIABLES/ which
+
+* 	specify the subscript bounds of src and dst within their 
+* 	respective grids.
+
+* 	Both src and dst are assumed to be 2 dimensional structures
+* 	lying in the same plane - given by mr_DIM1 and mr_DIM2.
+
+*	ss12i and sst12j hold the indices of nearest grid nodes on src_grd 
+*       for nodes on dst_grd. coefi and coefj hold the interpolation coefficients.
+
+* First just replicate what Ferret has always done: first linear regrid in y then
+* in x.  Also program a bilinear regridding - this will let us do more to fill in
+* gaps in the future, but we will need to figure out how to decide what the handling
+* of missing data should be.
+
+* programmer - Ansley Manke, from xyave_regrid.F
+* NOAA/PMEL, Seattle, WA - TMAP
+*
+* 6/22/2011
+*                    The XY linear regridding matches past Ferret behavior, 
+*                    not using bilinear regridding for now
+* V68  *acm* 1/12   use TM_FPEQ for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm);
+*                   removed unused bilinear interpolation code.
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_lims, msrc, mdst, dst_lox, dst_hix,
+     .          dst_loy, dst_hiy, src_cx, dst_cx 
+	INTEGER	iss12(dst_lox:dst_hix+1), jss12(dst_loy:dst_hiy+1)
+
+	REAL    src( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .          dst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,
+     .               m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		coefi( dst_lox:dst_hix ), coefj(dst_loy:dst_hiy)
+
+* local variable declarations:
+
+        LOGICAL	TM_FPEQ
+	INTEGER	dim1, dim2, src_grid, dst_grid,
+     .          i, j, k, l, m, n, iss, jss,
+     .          isrc_lo, isrc_hi, jsrc_lo, jsrc_hi,
+     .          idst_lo ,idst_hi, jdst_lo, jdst_hi
+	REAL	bad_src, bad_dst, c1i, c1j, c2i, c2j, 
+     .          z1, z2
+        REAL work(m1lox:m1hix,dst_loy:dst_hiy)  ! srcx by dsty
+********************************************************************************
+
+* initialize
+
+* source and destination grids
+	src_grid = mr_grid( msrc )
+	dst_grid = mr_grid( mdst )
+	dim1     = x_dim
+	dim2     = y_dim
+
+* limits for calculation
+        isrc_lo = cx_lo_ss(src_cx,dim1)
+        isrc_hi = cx_hi_ss(src_cx,dim1)
+        jsrc_lo = cx_lo_ss(src_cx,dim2)
+        jsrc_hi = cx_hi_ss(src_cx,dim2)
+
+        idst_lo = cx_lo_s1(cx_lims)
+        idst_hi = cx_hi_s1(cx_lims)
+        jdst_lo = cx_lo_s2(cx_lims)
+        jdst_hi = cx_hi_s2(cx_lims)
+
+* flag for bad/missing data
+        bad_src = mr_bad_data(msrc)
+        bad_dst = mr_bad_data(mdst)
+
+* DETERMINE (LOWER) src_grd INDEX OF NEAREST NEIGHBORS ON src_grd AXES
+* FOR NODES ON dst_grd AXES, AND COMPUTE FRACTIONAL POSITIONS OF dst_grd
+* NODES WITH RESPECT TO src_grd.
+	CALL GET_LINEAR_COEF( isrc_lo, isrc_hi, src_grid,
+     .			   idst_lo, idst_hi, dst_grid,
+     .			   dim1, iss12, coefi )
+	CALL GET_LINEAR_COEF( jsrc_lo, jsrc_hi, src_grid,
+     .			   jdst_lo, jdst_hi, dst_grid,
+     .			   dim2, jss12, coefj)
+
+C LINEAR INTERPOLATION IN Y THEN X
+
+* loop over Z, T, E, and F ranges of 6-D data
+	DO 300 n = cx_lo_s6(cx_lims), cx_hi_s6(cx_lims)
+	DO 300 m = cx_lo_s5(cx_lims), cx_hi_s5(cx_lims)
+	DO 300 l = cx_lo_s4(cx_lims), cx_hi_s4(cx_lims)
+	DO 300 k = cx_lo_s3(cx_lims), cx_hi_s3(cx_lims)
+
+* first in J direction.
+
+	   DO 210 j = jdst_lo,jdst_hi
+
+* interpolation coefficients
+	      jss = jss12(j)
+	      c2j = coefj(j)
+	      c1j = 1.0 - c2j
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1j,1.) ) THEN
+	         DO 200 i = isrc_lo, isrc_hi
+ 200	            work(i,j) = src(i,jss,k,l,m,n)
+	         GOTO 210
+	      ENDIF
+
+* regular interpolation
+	      DO 205 i = isrc_lo, isrc_hi
+
+* surrounding source data points
+	         z1 = src(i,jss  ,k,l,m,n)
+	         z2 = src(i,jss+1,k,l,m,n)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    work(i,j) = bad_dst
+	         ELSE
+	            work(i,j) = c1j*z1 + c2j*z2
+	         ENDIF
+
+ 205	      CONTINUE
+ 210	   CONTINUE
+
+* Now interpolate that in the x direction.
+
+	   DO 110 i = idst_lo, idst_hi
+
+* interpolation coefficients
+	      iss = iss12(i)
+	      c2i = coefi(i)
+	      c1i = 1.0 - c2i
+
+* special case: exact overlap of source and dest points
+	      IF ( TM_FPEQ(c1i,1.) ) THEN
+	         DO 100 j = jdst_lo, jdst_hi
+ 100	         dst(i,j,k,l,m,n) = work(iss,j)
+	         GOTO 110
+	      ENDIF
+
+* regular interpolation
+	      DO 105 j = jdst_lo, jdst_hi
+
+* surrounding source data points
+	         z1 = work(iss  ,j)
+	         z2 = work(iss+1,j)
+
+* interpolate
+	         IF (z1 .EQ. bad_src .OR. z2 .EQ. bad_src ) THEN
+		    dst(i,j,k,l,m,n) = bad_dst
+	         ELSE
+	            dst(i,j,k,l,m,n) = c1i*z1 + c2i*z2
+	         ENDIF
+
+ 105	      CONTINUE
+ 110	   CONTINUE
+
+ 300	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ef_utility/Makefile b/fer/ef_utility/Makefile
new file mode 100644
index 0000000..b1b93bf
--- /dev/null
+++ b/fer/ef_utility/Makefile
@@ -0,0 +1,44 @@
+#
+# Makefile (for the FERRET/fer/ef_utility code)
+#
+# August 11 1997
+# Jonathan Callahan (with some help from Joe Sirott)
+#
+# Ansley Manke 11/99 NOTE:
+#    We DO NOT want to make the ef_utility/*.o files into a libaray.
+#    The ferret Makefile is to link these object files in the executable.
+#    Because they are only called by external functions they are not seen
+#    as unresolved references and therefore not searched for if they are
+#    in a library.
+
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+#
+# Targets
+#
+
+all:	$(OBJS)
+
+clean:
+	rm -f *.o
+
+#
+# End of Makefile
+#
diff --git a/fer/ef_utility/SOURCE_FILES b/fer/ef_utility/SOURCE_FILES
new file mode 100644
index 0000000..e0a1c91
--- /dev/null
+++ b/fer/ef_utility/SOURCE_FILES
@@ -0,0 +1,82 @@
+SRCS_F = \
+ef_bail_out.F\
+ef_get_arg_info.F\
+ef_get_arg_mem_subscripts.F\
+ef_get_arg_mem_subscripts_6d.F\
+ef_get_arg_string.F\
+ef_get_arg_subscripts.F\
+ef_get_arg_subscripts_6d.F\
+ef_get_arg_ss_extremes.F\
+ef_get_arg_ss_extremes_6d.F\
+ef_get_axis_calendar.F\
+ef_get_axis_dates.F\
+ef_get_axis_info.F\
+ef_get_axis_info_6d.F\
+ef_get_axis_modulo_len.F\
+ef_get_box_hi_lim.F\
+ef_get_box_limits.F\
+ef_get_box_lo_lim.F\
+ef_get_box_size.F\
+ef_get_coordinates.F\
+ef_get_one_arg_string.F\
+ef_get_one_val_sub.F\
+ef_get_one_val_sub_sub.F\
+ef_get_res_mem_subscripts.F\
+ef_get_res_mem_subscripts_6d.F\
+ef_get_res_subscripts.F\
+ef_get_res_subscripts_6d.F\
+ef_get_string_arg_element.F\
+ef_get_string_arg_element_6d.F\
+ef_get_string_arg_element_len.F\
+ef_get_string_arg_element_len_6d.F\
+ef_get_string_arg_elem_len_sub.F\
+ef_get_string_arg_element_sub.F\
+ef_get_string_arg_max_len.F\
+ef_get_wrk_mem_subscripts.F\
+ef_get_wrk_mem_subscripts_6d.F\
+ef_set_alt_fcn_name.F\
+ef_set_arg_desc.F\
+ef_set_arg_name.F\
+ef_set_arg_unit.F\
+ef_set_custom_axis.F\
+ef_set_freq_axis.F\
+ef_set_desc.F\
+ef_set_real_to_string.F
+
+SRCS_C = \
+ef_get_arg_type.c\
+ef_get_bad_flags.c\
+ef_get_cx_list.c\
+ef_get_mres.c\
+ef_get_mr_list.c\
+ef_get_one_val.c\
+ef_get_result_type.c\
+ef_put_string.c\
+ef_put_string_ptr.c\
+ef_set_alt_fcn_name_sub.c\
+ef_set_arg_desc_sub.c\
+ef_set_arg_name_sub.c\
+ef_set_arg_type.c\
+ef_set_arg_unit_sub.c\
+ef_set_axis_extend.c\
+ef_set_axis_influence.c\
+ef_set_axis_influence_6d.c\
+ef_set_axis_inheritance.c\
+ef_set_axis_inheritance_6d.c\
+ef_set_axis_limits.c\
+ef_set_axis_reduction.c\
+ef_set_axis_reduction_6d.c\
+ef_set_custom_axis_sub.c\
+ef_set_desc_sub.c\
+ef_set_freq_axis_sub.c\
+ef_set_has_vari_args.c\
+ef_set_num_args.c\
+ef_set_num_work_arrays.c\
+ef_set_piecemeal_ok.c\
+ef_set_piecemeal_ok_6d.c\
+ef_set_result_type.c\
+ef_set_work_array_dims.c\
+ef_set_work_array_dims_6d.c\
+ef_set_work_array_lens.c\
+ef_set_work_array_lens_6d.c\
+ef_version_test.c
diff --git a/fer/ef_utility/ef_bail_out.F b/fer/ef_utility/ef_bail_out.F
new file mode 100644
index 0000000..f403a4c
--- /dev/null
+++ b/fer/ef_utility/ef_bail_out.F
@@ -0,0 +1,93 @@
+c     
+c     ef_bail_out.F
+c        
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     Jonathan Callahan
+c     Feb 19th 1998
+c
+c *acm* 11/05 V600  -- New symbol FER_LAST_ERROR contains all the text normally
+c                       written to std out, put error text in common to save it
+c             
+c     
+c     
+
+c     
+c     This subroutine bails out of an external function with
+c     the error message passed in.
+c     
+
+      SUBROUTINE EF_BAIL_OUT(id, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xerrmsg_text.cmn'
+
+
+      INTEGER id
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+      CHARACTER*(EF_MAX_NAME_LENGTH) GCF_NAME
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library routine to see if it is external
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+
+! Put name and text, and their lengths into common for error outputs.
+      efname = GCF_NAME (id)
+      len_efname = TM_LENSTR1( efname )
+      ef_errtext = text
+      len_eftext = llen
+
+      CALL EF_ERR_BAIL_OUT( id, fhol )
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_arg_info.F b/fer/ef_utility/ef_get_arg_info.F
new file mode 100644
index 0000000..2ec9b58
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_info.F
@@ -0,0 +1,76 @@
+c*
+c* ef_get_arg_info.F
+c*
+c* Jonathan Callahan
+c* Sep 28th 1998
+c*
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This returns the name, title and dataset associated 
+c* with an argument.
+c*
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+
+      SUBROUTINE EF_GET_ARG_INFO(id, iarg, name, title, units )
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg
+      INTEGER cat, var
+
+      CHARACTER*(*) name, title, units
+      CHARACTER var_code*128, var_title*128, var_units*32
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+
+      cat = cx_category(cx_list(iarg))
+      var = cx_variable(cx_list(iarg)) 
+
+      name  = var_code(cat,var)
+      title = var_title(cx_list(iarg))
+      units = var_units(cx_list(iarg))
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_arg_mem_subscripts.F b/fer/ef_utility/ef_get_arg_mem_subscripts.F
new file mode 100644
index 0000000..b798b7f
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_mem_subscripts.F
@@ -0,0 +1,82 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the array memory limits in the common blocks for those
+* times when they cannot be retrieved directly.
+*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+      SUBROUTINE EF_GET_ARG_MEM_SUBSCRIPTS(id, arg_memlo, arg_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id, arg_memlo(4, EF_MAX_ARGS),
+     .            arg_memhi(4, EF_MAX_ARGS)
+
+* local variables
+      INTEGER ndx, adx,
+     .        arg_memlo_6d(nferdims, EF_MAX_ARGS),
+     .        arg_memhi_6d(nferdims, EF_MAX_ARGS)
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_ARG_MEM_SUBSCRIPTS_6D(id, arg_memlo_6d, arg_memhi_6d)
+
+* check E and F are unused
+      DO 110 adx = 1, EF_MAX_ARGS
+         DO 100 ndx = 5, nferdims
+            IF ( arg_memlo_6d(ndx, adx) .NE.
+     .           arg_memhi_6d(ndx, adx) ) THEN
+               WRITE (buff,50) ndx, adx
+ 50            FORMAT ('Dimension ', I1, ' of argument ', I2,
+     .            ' is used; use EF_GET_ARG_MEM_SUBSCRIPTS_6D instead')
+               CALL EF_BAIL_OUT(id, buff)
+               STOP 'EF_BAIL_OUT returned in EF_GET_ARG_MEM_SUBSCRIPTS'
+            ENDIF
+ 100     CONTINUE
+ 110  CONTINUE
+
+* copy to the 4D arrays
+      DO 210 adx = 1, EF_MAX_ARGS
+         DO 200 ndx = 1, 4
+            arg_memlo(ndx, adx) = arg_memlo_6d(ndx, adx)
+            arg_memhi(ndx, adx) = arg_memhi_6d(ndx, adx)
+ 200     CONTINUE
+ 210  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_arg_mem_subscripts_6d.F b/fer/ef_utility/ef_get_arg_mem_subscripts_6d.F
new file mode 100644
index 0000000..677d46d
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_mem_subscripts_6d.F
@@ -0,0 +1,170 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the array memory limits in the common blocks for those
+* times when they cannot be retrieved directly.
+*
+      SUBROUTINE EF_GET_ARG_MEM_SUBSCRIPTS_6D(id, arg_memlo, arg_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* argument declarations
+      INTEGER id, arg_memlo(nferdims,EF_MAX_ARGS),
+     .            arg_memhi(nferdims,EF_MAX_ARGS)
+
+* this assumes nferdims .EQ. 6 and EF_MAX_ARGS .EQ. 9
+      arg_memlo(1,1) = mem1lox
+      arg_memlo(1,2) = mem2lox
+      arg_memlo(1,3) = mem3lox
+      arg_memlo(1,4) = mem4lox
+      arg_memlo(1,5) = mem5lox
+      arg_memlo(1,6) = mem6lox
+      arg_memlo(1,7) = mem7lox
+      arg_memlo(1,8) = mem8lox
+      arg_memlo(1,9) = mem9lox
+
+      arg_memlo(2,1) = mem1loy
+      arg_memlo(2,2) = mem2loy
+      arg_memlo(2,3) = mem3loy
+      arg_memlo(2,4) = mem4loy
+      arg_memlo(2,5) = mem5loy
+      arg_memlo(2,6) = mem6loy
+      arg_memlo(2,7) = mem7loy
+      arg_memlo(2,8) = mem8loy
+      arg_memlo(2,9) = mem9loy
+
+      arg_memlo(3,1) = mem1loz
+      arg_memlo(3,2) = mem2loz
+      arg_memlo(3,3) = mem3loz
+      arg_memlo(3,4) = mem4loz
+      arg_memlo(3,5) = mem5loz
+      arg_memlo(3,6) = mem6loz
+      arg_memlo(3,7) = mem7loz
+      arg_memlo(3,8) = mem8loz
+      arg_memlo(3,9) = mem9loz
+
+      arg_memlo(4,1) = mem1lot
+      arg_memlo(4,2) = mem2lot
+      arg_memlo(4,3) = mem3lot
+      arg_memlo(4,4) = mem4lot
+      arg_memlo(4,5) = mem5lot
+      arg_memlo(4,6) = mem6lot
+      arg_memlo(4,7) = mem7lot
+      arg_memlo(4,8) = mem8lot
+      arg_memlo(4,9) = mem9lot
+
+      arg_memlo(5,1) = mem1loe
+      arg_memlo(5,2) = mem2loe
+      arg_memlo(5,3) = mem3loe
+      arg_memlo(5,4) = mem4loe
+      arg_memlo(5,5) = mem5loe
+      arg_memlo(5,6) = mem6loe
+      arg_memlo(5,7) = mem7loe
+      arg_memlo(5,8) = mem8loe
+      arg_memlo(5,9) = mem9loe
+
+      arg_memlo(6,1) = mem1lof
+      arg_memlo(6,2) = mem2lof
+      arg_memlo(6,3) = mem3lof
+      arg_memlo(6,4) = mem4lof
+      arg_memlo(6,5) = mem5lof
+      arg_memlo(6,6) = mem6lof
+      arg_memlo(6,7) = mem7lof
+      arg_memlo(6,8) = mem8lof
+      arg_memlo(6,9) = mem9lof
+
+      arg_memhi(1,1) = mem1hix
+      arg_memhi(1,2) = mem2hix
+      arg_memhi(1,3) = mem3hix
+      arg_memhi(1,4) = mem4hix
+      arg_memhi(1,5) = mem5hix
+      arg_memhi(1,6) = mem6hix
+      arg_memhi(1,7) = mem7hix
+      arg_memhi(1,8) = mem8hix
+      arg_memhi(1,9) = mem9hix
+
+      arg_memhi(2,1) = mem1hiy
+      arg_memhi(2,2) = mem2hiy
+      arg_memhi(2,3) = mem3hiy
+      arg_memhi(2,4) = mem4hiy
+      arg_memhi(2,5) = mem5hiy
+      arg_memhi(2,6) = mem6hiy
+      arg_memhi(2,7) = mem7hiy
+      arg_memhi(2,8) = mem8hiy
+      arg_memhi(2,9) = mem9hiy
+
+      arg_memhi(3,1) = mem1hiz
+      arg_memhi(3,2) = mem2hiz
+      arg_memhi(3,3) = mem3hiz
+      arg_memhi(3,4) = mem4hiz
+      arg_memhi(3,5) = mem5hiz
+      arg_memhi(3,6) = mem6hiz
+      arg_memhi(3,7) = mem7hiz
+      arg_memhi(3,8) = mem8hiz
+      arg_memhi(3,9) = mem9hiz
+
+      arg_memhi(4,1) = mem1hit
+      arg_memhi(4,2) = mem2hit
+      arg_memhi(4,3) = mem3hit
+      arg_memhi(4,4) = mem4hit
+      arg_memhi(4,5) = mem5hit
+      arg_memhi(4,6) = mem6hit
+      arg_memhi(4,7) = mem7hit
+      arg_memhi(4,8) = mem8hit
+      arg_memhi(4,9) = mem9hit
+
+      arg_memhi(5,1) = mem1hie
+      arg_memhi(5,2) = mem2hie
+      arg_memhi(5,3) = mem3hie
+      arg_memhi(5,4) = mem4hie
+      arg_memhi(5,5) = mem5hie
+      arg_memhi(5,6) = mem6hie
+      arg_memhi(5,7) = mem7hie
+      arg_memhi(5,8) = mem8hie
+      arg_memhi(5,9) = mem9hie
+
+      arg_memhi(6,1) = mem1hif
+      arg_memhi(6,2) = mem2hif
+      arg_memhi(6,3) = mem3hif
+      arg_memhi(6,4) = mem4hif
+      arg_memhi(6,5) = mem5hif
+      arg_memhi(6,6) = mem6hif
+      arg_memhi(6,7) = mem7hif
+      arg_memhi(6,8) = mem8hif
+      arg_memhi(6,9) = mem9hif
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_arg_ss_extremes.F b/fer/ef_utility/ef_get_arg_ss_extremes.F
new file mode 100644
index 0000000..643aa36
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_ss_extremes.F
@@ -0,0 +1,84 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Return the minimum and maximum subscripts for a grid.  
+c*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+      SUBROUTINE EF_GET_ARG_SS_EXTREMES(id, num_args, ss_min, ss_max)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id, num_args,
+     .        ss_min(4,EF_MAX_ARGS), 
+     .        ss_max(4,EF_MAX_ARGS)
+
+* local variables
+      INTEGER ndx, adx,
+     .        ss_min_6d(nferdims, EF_MAX_ARGS),
+     .        ss_max_6d(nferdims, EF_MAX_ARGS)
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_ARG_SS_EXTREMES_6D(id, num_args,
+     .                               ss_min_6d, ss_max_6d)
+
+* check E and F are unused
+      DO 110 adx = 1, num_args
+         DO 100 ndx = 5, nferdims
+            IF ( ss_min_6d(ndx, adx) .NE. ss_max_6d(ndx, adx) ) THEN
+               WRITE (buff,50) ndx, adx
+ 50            FORMAT ('Dimension ', I1, ' of argument ', I2,
+     .            ' is used; use EF_GET_ARG_SS_EXTREMES_6D instead')
+               CALL EF_BAIL_OUT(id, buff)
+               STOP 'EF_BAIL_OUT returned in EF_GET_ARG_SS_EXTREMES'
+            ENDIF
+ 100     CONTINUE
+ 110  CONTINUE
+
+* copy to the 4D arrays
+      DO 210 adx = 1, num_args
+         DO 200 ndx = 1, 4
+            ss_min(ndx, adx) = ss_min_6d(ndx, adx)
+            ss_max(ndx, adx) = ss_max_6d(ndx, adx)
+ 200     CONTINUE
+ 210  CONTINUE
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_arg_ss_extremes_6d.F b/fer/ef_utility/ef_get_arg_ss_extremes_6d.F
new file mode 100644
index 0000000..c9fe464
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_ss_extremes_6d.F
@@ -0,0 +1,78 @@
+c*
+c* ef_get_arg_ss_extremes_6d.F (formerly ef_get_arg_ss_extremes.F)
+c*
+c* Jonathan Callahan
+c* Mar 27th 1998
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Return the minimum and maximum subscripts for a grid.  
+c*
+*
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+
+      SUBROUTINE EF_GET_ARG_SS_EXTREMES_6D(id, num_args, ss_min, ss_max)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, num_args,
+     .        ss_min(nferdims,EF_MAX_ARGS), 
+     .        ss_max(nferdims,EF_MAX_ARGS)
+
+      INTEGER grid, idim, iarg
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+      DO 200 iarg=1,num_args
+
+         grid = cx_grid( cx_list(iarg) )
+
+         DO 100 idim=1,nferdims
+
+            CALL GRID_SUBSCRIPT_EXTREMES(ss_min(idim,iarg), 
+     .           ss_max(idim,iarg), grid, idim)
+
+ 100     CONTINUE
+ 200  CONTINUE
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_arg_string.F b/fer/ef_utility/ef_get_arg_string.F
new file mode 100644
index 0000000..2a1e81f
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_string.F
@@ -0,0 +1,134 @@
+c*
+c* ef_get_arg_string.F
+c*   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c* Jonathan Callahan
+c* Mar 17th 1999
+* V530  8/00 *sh* - shifted to new way of storing strings
+*      10/00      - allow this routine to be called during CUSTOM AXIS time
+*                      (before evaluation of variables)
+c*
+c*v540 1/02 *kob* - fix bug which used character array risc_buff to pass
+c*                  a string into tm_ctof_string when tm_ctof_string was
+c*                  expecting an integer array.  no longer need xrisc.cmn
+
+c*
+c* This returns the (single) string which was passed as an argument
+c* to the function.  
+c* It may be called during grid creation time (custom axis creation) or
+c* during evaluation time.
+c* Other routines are available to handle arrays of strings.
+c* Note that grabbing an array of string during grid creation time is more
+c* difficult (though not impossible). The EVAL_EXPR routine cannot safely be
+c* called since the stacks would get re-initialized and the {,,,} would need
+c* to be parsed
+c*
+
+      SUBROUTINE EF_GET_ARG_STRING(id, iarg, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+
+      INTEGER id, iarg
+      CHARACTER*(*) text
+
+      INTEGER   GET_OFFSET_C_STRING_LEN, 
+     .          slen, flen, cx, uv, item, start, end,
+     .          mr, mr_list(EF_MAX_ARGS)
+      INTEGER*2 int_buff(1024)
+      CHARACTER buff*64
+ 
+c The memory resident list was cached by Ferret and must be retrieved
+c to be accessible to the external function.
+      CALL EF_GET_MR_LIST(mr_list)
+      mr = mr_list(iarg)
+      
+      IF ( mr .EQ. 0 ) THEN
+* we must have been called during custom axis creation time. We'll need
+* to grab the string straight from the function definition
+* (e.g. EF("my_string") and also allow A="string"; EF(a)
+        CALL EF_GET_CX_LIST(mr_list) ! get contexts
+        cx = mr_list(iarg)
+        IF (cx_category(cx) .EQ. cat_user_var) THEN
+* ... an intermediate variable was defined as a constant string
+          uv = cx_variable(cx)
+          IF (uvar_num_items(uv)   .NE. 1
+     .   .OR. uvar_item_type(1,uv) .NE. alg_string ) GOTO 5000
+          item = 1
+        ELSEIF (cx_category(cx) .EQ. cat_string) THEN
+* ... determine the string position directly within EF call
+          uv = cx_variable(cx)/1000
+          item = cx_variable(cx) - 1000*uv
+        ELSE
+          GOTO 5000
+        ENDIF
+* remove the surrounding quotation marks
+        start = uvar_item_start( item, uv ) + 1 ! +1 to bypass quotations
+        end   = uvar_item_end  ( item, uv ) - 1
+        text = uvar_text(uv)(start:end)
+
+      ELSE
+
+c Here's how you check the variable type.
+* (this should never happen as checks against it are made previously) 
+        IF (mr_type(mr) .NE. ptype_string) GOTO 5000
+
+* get the string (up to the byte size of int_buff)
+        CALL GET_OFFSET_C_STRING(mr_c_pointer(mr), 0, int_buff, 2048)
+
+* and the string length
+        slen = GET_OFFSET_C_STRING_LEN(mr_c_pointer(mr), 0)
+        IF ( slen .GT. 2048 ) slen = 2048
+
+* copy it into the FORTRAN string
+        CALL TM_CTOF_STRNG (int_buff, text, slen)
+
+      ENDIF
+
+      RETURN
+
+* Error - bail out
+ 5000 WRITE (buff, 3000) iarg
+ 3000 FORMAT ('Argument',I3,' is not a string')
+      CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_ARG_STRING'
+
+      END
+
diff --git a/fer/ef_utility/ef_get_arg_subscripts.F b/fer/ef_utility/ef_get_arg_subscripts.F
new file mode 100644
index 0000000..4bb3c91
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_subscripts.F
@@ -0,0 +1,91 @@
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Initialize the context limits the EF will use.  
+c*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+      SUBROUTINE EF_GET_ARG_SUBSCRIPTS(id, arg_lo_ss, arg_hi_ss, 
+     .                                 arg_incr)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id,
+     .        arg_lo_ss(4,EF_MAX_ARGS+1), 
+     .        arg_hi_ss(4,EF_MAX_ARGS+1),
+     .        arg_incr (4,EF_MAX_ARGS+1)
+
+* local variables
+      INTEGER ndx, adx,
+     .        arg_lo_ss_6d(nferdims,EF_MAX_ARGS+1), 
+     .        arg_hi_ss_6d(nferdims,EF_MAX_ARGS+1),
+     .        arg_incr_6d (nferdims,EF_MAX_ARGS+1)
+      CHARACTER*128 buf
+
+* call the 6D version
+      CALL EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss_6d, arg_hi_ss_6d,
+     .                              arg_incr_6d)
+
+* check E and F are unused
+      DO 110 adx = 1, EF_MAX_ARGS
+         DO 100 ndx = 5, nferdims
+            IF ( arg_lo_ss_6d(ndx, adx) .NE.
+     .           arg_hi_ss_6d(ndx, adx) ) THEN
+               WRITE (buf,50) ndx, adx
+ 50            FORMAT ('Dimension ', I1, ' of argument ', I2,
+     .            ' is used; use EF_GET_ARG_SUBSCRIPTS_6D instead')
+               CALL EF_BAIL_OUT(id, buf)
+               STOP 'EF_BAIL_OUT returned in EF_GET_ARG_SUBSCRIPTS'
+            ENDIF
+ 100     CONTINUE
+ 110  CONTINUE
+
+* copy to the 4D arrays
+      DO 210 adx = 1, EF_MAX_ARGS
+         DO 200 ndx = 1, 4
+            arg_lo_ss(ndx, adx) = arg_lo_ss_6d(ndx, adx)
+            arg_hi_ss(ndx, adx) = arg_hi_ss_6d(ndx, adx)
+            arg_incr (ndx, adx) = arg_incr_6d (ndx, adx)
+ 200     CONTINUE
+ 210  CONTINUE
+
+      RETURN 
+      END
+
diff --git a/fer/ef_utility/ef_get_arg_subscripts_6d.F b/fer/ef_utility/ef_get_arg_subscripts_6d.F
new file mode 100644
index 0000000..0c4c6ca
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_subscripts_6d.F
@@ -0,0 +1,152 @@
+c*
+c* ef_get_arg_subscripts_6d.F (formerly ef_get_arg_subscripts.F)
+c*   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c* Jonathan Callahan
+c* Feb 19th 1998
+c*
+c*
+c* Initialize the context limits the EF will use.  
+c*
+c* V510 12/99 *sh* - cope with unspecified limits (default=full axis range)
+c*               and limits embedded inside of user variable definitions
+c*               as in LET a = sst[L=5:9]; LIST FFT(a) (info from uvar_*)
+c*      3/00 *sh* - bug fix: above logic applies only to CUSTOM axes 
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+*                  Reduced the outer dimensionality of arg_lo_ss, arg_hi_ss,
+*                  and arg_incr from EF_MAX_ARG+1 to EF_MAX_ARGS
+
+      SUBROUTINE EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss, arg_hi_ss, 
+     .                                    arg_incr)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations
+      INTEGER id, arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .            arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .            arg_incr (nferdims,EF_MAX_ARGS)
+
+
+* internal variable declarations
+      LOGICAL embedded_limits
+      INTEGER idim, iarg, num_reqd_args, cat, var
+      INTEGER cx_list(EF_MAX_ARGS), ax_src(nferdims)
+      INTEGER efcn_get_num_reqd_args
+
+      num_reqd_args = efcn_get_num_reqd_args(id)
+      CALL efcn_get_axis_will_be(id, ax_src)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+      DO 200 idim=1,nferdims
+
+         DO 100 iarg=1, num_reqd_args
+
+            IF ( cx_given(idim,cx_list(iarg)) ) THEN
+* limits are explicit in the top-level expression
+              arg_lo_ss(idim,iarg) = cx_lo_ss(cx_list(iarg), idim)
+              arg_hi_ss(idim,iarg) = cx_hi_ss(cx_list(iarg), idim)
+            ELSE
+* are there explicit limits embedded within user-var definitions?
+              cat = cx_category( cx_list(iarg) )
+              var = cx_variable( cx_list(iarg) )
+              IF ( cat .EQ. cat_user_var ) THEN
+                 embedded_limits =
+     .                 uvar_given(idim,var) .GE. uvlim_gvn_gnl
+     .           .AND. uvar_given(idim,var) .LE. uvlim_gvn_xact
+              ELSE
+                 embedded_limits = .FALSE.
+              ENDIF
+              IF ( embedded_limits ) THEN
+* ... get embedded explicit limits from the user-variable definition
+                arg_lo_ss(idim,iarg) = uvar_lo_ss(var, idim)
+                arg_hi_ss(idim,iarg) = uvar_hi_ss(var, idim)
+              ELSE
+                IF (ax_src(idim) .NE. CUSTOM) THEN
+* ... result axis inherits limits from SET REGION and command qualifiers, etc.
+* NOTE: ARG LIMITS WILL BE WRONG IF USED DURING GRID-CREATION
+*       (which should never happen ...)
+                  arg_lo_ss(idim,iarg) = cx_lo_ss(cx_list(iarg), idim)
+                  arg_hi_ss(idim,iarg) = cx_hi_ss(cx_list(iarg), idim)
+                ELSE
+* ... result axis is imposed by the EF and this arg has no explicit limits
+*     so infer the limits from the nature of the variable
+                  IF (  cat .EQ. cat_file_var ) THEN
+*    ... get limits of file variable (possibly less than full-axis)
+                    CALL VAR_SS_LIMS( idim, cx_list(iarg),
+     .                                arg_lo_ss(idim,iarg),
+     .                                arg_hi_ss(idim,iarg) )
+                  ELSE
+*    ... assume the full span of the defining axis as the default range
+                    CALL GRID_SUBSCRIPT_EXTREMES_NO_MOD(
+     .                  arg_lo_ss(idim,iarg),
+     .                  arg_hi_ss(idim,iarg),
+     .                  cx_grid(cx_list(iarg)), idim)
+                  ENDIF
+                ENDIF
+              ENDIF
+            ENDIF
+
+* fill in the delta to indicate if a range is available
+            IF (arg_lo_ss(idim,iarg) .EQ. arg_hi_ss(idim,iarg)) 
+     .           THEN
+               arg_incr(idim, iarg) = 0
+            ELSE
+               arg_incr(idim, iarg) = 1
+            ENDIF
+
+ 100     CONTINUE
+
+ 200  CONTINUE
+
+* Fill in "unused" values for the unused arguments - for checking in the 4D version
+      DO 400 iarg=num_reqd_args+1, EF_MAX_ARGS
+         DO 300 idim=1,nferdims
+            arg_lo_ss(idim, iarg) = unspecified_int4
+            arg_hi_ss(idim, iarg) = unspecified_int4
+            arg_incr (idim, iarg) = 0
+ 300     CONTINUE
+ 400  CONTINUE
+
+      RETURN 
+      END
+
diff --git a/fer/ef_utility/ef_get_arg_type.c b/fer/ef_utility/ef_get_arg_type.c
new file mode 100644
index 0000000..c20da29
--- /dev/null
+++ b/fer/ef_utility/ef_get_arg_type.c
@@ -0,0 +1,24 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/*
+ * Find an external function based on its integer ID and
+ * return the 'arg_type' information for a particular
+ * argument which tells Ferret whether an argument is a 
+ * DFTYPE or a string.
+ */
+void FORTRAN(ef_get_arg_type)(int *id_ptr, int *iarg_ptr, int *type)
+{
+   ExternalFunction *ef_ptr;
+   int index = *iarg_ptr - 1; 
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+
+   *type = ef_ptr->internals_ptr->arg_type[index];
+}
+
diff --git a/fer/ef_utility/ef_get_axis_calendar.F b/fer/ef_utility/ef_get_axis_calendar.F
new file mode 100644
index 0000000..97a67fb
--- /dev/null
+++ b/fer/ef_utility/ef_get_axis_calendar.F
@@ -0,0 +1,105 @@
+c*
+c* ef_get_axis_calendar.F
+c*
+c* Ansley Manke * 
+c* 5/2006
+c*
+c*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+c*
+c* This routine returns the calendar name, days in year, number of 
+c* months and days in each month of a time axis
+c*
+
+      SUBROUTINE EF_GET_AXIS_CALENDAR(id, iarg, calname, yrdays, 
+     .               mnths, d_in_month)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+* argument declarations
+      INTEGER id, iarg
+      INTEGER grid, axis, idim
+      CHARACTER*(*) calname
+      REAL yrdays
+      INTEGER mnths, d_in_month(*)
+
+* Internal declarations
+      INTEGER TM_GET_CALENDAR_ID, cx_list(EF_MAX_ARGS), cal_id, i
+
+* Initialize
+      yrdays = 0.
+      mnths = 0.
+      DO 100 i = 1, 12
+         d_in_month(i) = 0
+100   CONTINUE
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+
+* Get the grid and if it has a time axis get the calendar info
+
+      grid = cx_grid(cx_list(iarg))
+      idim = t_dim
+      axis = grid_line(idim, grid) 
+
+      IF (axis .EQ. munknown) THEN
+         calname = 'none'
+
+      ELSE IF (axis .EQ. mnormal) THEN
+         calname = 'none'
+
+      ELSE
+         calname  = line_cal_name(axis)
+         cal_id = TM_GET_CALENDAR_ID (calname)
+         yrdays = cals_yeardays(cal_id)      
+         mnths = cals_num_months(cal_id)
+
+         DO 110 i = 1, mnths
+           d_in_month(i) = cals_days_in_month(i,cal_id)
+110      CONTINUE
+
+      ENDIF
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_axis_dates.F b/fer/ef_utility/ef_get_axis_dates.F
new file mode 100644
index 0000000..c7e36d2
--- /dev/null
+++ b/fer/ef_utility/ef_get_axis_dates.F
@@ -0,0 +1,184 @@
+c*
+c* ef_get_axis_dates.F
+c*
+c* Ansley Manke
+c* Dec 9 1998
+c*
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This returns the date buffer associated with the 
+c* time axis of an argument.
+c*
+*  V665 *acm*/11/09 Fix ticket 1766, as in #762, if the axis is modulo
+*                   the year 0000 or 0001 returns as blank.  If not modulo
+*		    then we want to return the year correctly.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+      SUBROUTINE EF_GET_AXIS_DATES(id, iarg, tax, numtimes, datebuf )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+
+      INTEGER id, iarg, numtimes
+      REAL*8 tax(*)
+      CHARACTER*(*) datebuf(*)
+
+      INTEGER l, grid, seconds
+      PARAMETER (seconds=6)
+      REAL*8  tstep_r8, test(5)
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+      grid = CX_GRID(cx_list(iarg))
+
+      DO 100 L = 1, numtimes
+         tstep_r8 = tax(L)
+         CALL TSTEP_TO_DATE_OLD ( grid, tstep_r8, seconds, datebuf(l) )
+100   CONTINUE
+
+
+      RETURN 
+      END
+
+	SUBROUTINE TSTEP_TO_DATE_OLD ( grid, tstep, precision, date )
+*
+* Return a string giving the date for a particular timestep
+* This is done by figuring the offset from
+* 01-JAN-0000 00:00:00 in seconds, and then calculating the date.
+*
+* This is an older version of TSTEP_TO_DATE which was revised for better
+* output formatting in Ferret v6.0.  This version gives a fixed unchanging
+* format.
+*
+* Arguments:
+*	grid	 - grid containing a time axis
+*	tstep    - time step
+*	precision- precision (1 to 6 for day,mon,yr,hr,min,sec, respectively )
+*			(use ABS(precision) - neg. indicates truncate left 0s)
+*	date	 - returned string containing date in ASCII form
+*
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	CHARACTER*(*)	date
+	INTEGER		grid, precision
+	REAL*8		tstep
+*
+* Local definitions
+	LOGICAL		modulo
+	CHARACTER*20	SECS_TO_DATE, SECS_TO_DATE_OUT, buff
+	INTEGER		axis, status, prec,
+     .                  TM_GET_CALENDAR_ID, cal_id
+	REAL*8		start_secs, offset_secs, this_secs
+	REAL*8		SECS_FROM_BC
+
+!	REAL*8		start_secs, offset_secs, this_secs, prec_fact(6)
+!	DATA	prec_fact	/  31536000.,  2628000.,  86400.,  3600.,
+!     .				   60., 1./
+
+* initialize
+	prec = ABS(precision)
+
+* get the axis number
+	axis = grid_line( t_dim, grid )
+	modulo = line_modulo(axis)
+#ifdef double_p	
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   WRITE ( date, * ) (tstep)
+	   RETURN
+	ELSEIF ( line_direction(axis) .NE. 'TI' ) THEN
+	   WRITE ( date, * ) (tstep)
+	   RETURN
+	ENDIF
+#else
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   WRITE ( date, * ) SNGL(tstep)
+	   RETURN
+	ELSEIF ( line_direction(axis) .NE. 'TI' ) THEN
+	   WRITE ( date, * ) SNGL(tstep)
+	   RETURN
+	ENDIF
+#endif
+
+* get the calendar type
+
+        cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+	start_secs = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* Find the number of seconds since start of data set for this time step
+	offset_secs = tstep*line_tunit( axis )
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	this_secs = start_secs + offset_secs
+
+* round off date instead of truncating 
+* ( people do not normally view dates this way )
+!	this_secs = ( DNINT(this_secs/prec_fact(prec)) + 0.5 ) * prec_fact(prec)
+
+* Convert to date
+
+	buff = SECS_TO_DATE_OUT(this_secs, cal_id, modulo, prec)
+
+* Select the requested precision
+	IF ( prec .GT. 6 ) THEN		! full precision
+	   date = buff
+	ELSEIF ( prec .GE. 3 ) THEN	! dd-mmm-$_...
+	   date = buff( :date_str_len(prec) )
+	ELSEIF ( prec .EQ. 2 ) THEN	! mmm-$_
+	   date = buff( 4:11 )	
+	ELSE				! $_
+	   date = buff( 8:11 )	
+	ENDIF
+
+* Finished
+	RETURN
+	END
+
diff --git a/fer/ef_utility/ef_get_axis_info.F b/fer/ef_utility/ef_get_axis_info.F
new file mode 100644
index 0000000..94f3f19
--- /dev/null
+++ b/fer/ef_utility/ef_get_axis_info.F
@@ -0,0 +1,86 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This returns the name, title and units associated with
+c* each axis of an argument.
+c*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+      SUBROUTINE EF_GET_AXIS_INFO(id, iarg, name, units,
+     .                            backward, modulo, regular)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+
+* argument declarations - 4D
+      INTEGER id, iarg
+      CHARACTER*(*) name(4), units(4)
+      LOGICAL backward(4), modulo(4), regular(4)
+
+* local variables
+      CHARACTER*32  name_6d(nferdims), units_6d(nferdims)
+      LOGICAL       backward_6d(nferdims), modulo_6d(nferdims),
+     .              regular_6d(nferdims)
+      INTEGER       ndx
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_AXIS_INFO_6D(id, iarg, name_6d, units_6d,
+     .                         backward_6d, modulo_6d, regular_6d)
+
+* check E and F are unused
+      DO 100 ndx = 5, nferdims
+         IF ( (name_6d(ndx) .NE. 'unknown') .AND.
+     .        (name_6d(ndx) .NE. 'normal') ) THEN
+            WRITE (buff,50) ndx
+ 50         FORMAT ('Dimension ', I1,
+     .              ' is used; use EF_GET_AXIS_INFO_6D instead')
+            CALL EF_BAIL_OUT(id, buff)
+            STOP 'EF_BAIL_OUT returned in EF_GET_AXIS_INFO'
+         ENDIF
+ 100  CONTINUE
+
+* copy to the 4D arrays
+      DO 200 ndx = 1, 4
+         name(ndx)     = name_6d(ndx)
+         units(ndx)    = units_6d(ndx)
+         backward(ndx) = backward_6d(ndx)
+         modulo(ndx)   = modulo_6d(ndx)
+         regular(ndx)  = regular_6d(ndx)
+ 200  CONTINUE
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_axis_info_6d.F b/fer/ef_utility/ef_get_axis_info_6d.F
new file mode 100644
index 0000000..4a57767
--- /dev/null
+++ b/fer/ef_utility/ef_get_axis_info_6d.F
@@ -0,0 +1,93 @@
+c*
+c* ef_get_axis_info_6d.F (formerly ef_get_axis_info.F)
+c*
+c* Jonathan Callahan
+c* Sep 28th 1998
+c*
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This returns the name, title and units associated with
+c* each axis of an argument.
+c*
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+
+      SUBROUTINE EF_GET_AXIS_INFO_6D(id, iarg, name, units,
+     .                               backward, modulo, regular )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+
+      INTEGER id, iarg
+      INTEGER grid, axis, idim
+
+      CHARACTER*(*) name(nferdims), units(nferdims)
+      LOGICAL backward(nferdims), modulo(nferdims), regular(nferdims)
+      LOGICAL BKWD_AXIS
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+
+      grid = cx_grid(cx_list(iarg))
+
+      do 100 idim=1, nferdims
+        axis = grid_line(idim, grid) 
+        IF (axis .EQ. munknown) THEN
+          name(idim) = 'unknown'
+          units(idim) = 'none'
+        ELSE IF (axis .EQ. mnormal) THEN
+          name(idim) = 'normal'
+          units(idim) = 'none'
+        ELSE
+          name(idim)  = line_name(axis)
+          units(idim) = line_units(axis)
+          backward(idim) = BKWD_AXIS(idim, grid)
+          modulo(idim)   = line_modulo(axis)
+          regular(idim)  = line_regular(axis)
+        ENDIF
+100   CONTINUE
+
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_axis_modulo_len.F b/fer/ef_utility/ef_get_axis_modulo_len.F
new file mode 100644
index 0000000..f03819a
--- /dev/null
+++ b/fer/ef_utility/ef_get_axis_modulo_len.F
@@ -0,0 +1,77 @@
+*
+*  ef_get_axis_modulo_len.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Returns the modulo length (double precision) of the modulo axis
+* indicated, or zero if the axis is not a modulo axis.
+*
+
+      SUBROUTINE EF_GET_AXIS_MODULO_LEN(id, iarg, iaxis, modlen)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+
+*  Input arguments
+      INTEGER id, iarg, iaxis
+
+*  Output arguments
+      REAL*8 modlen
+
+*  Local vairables
+      INTEGER cx_list(EF_MAX_ARGS)
+      INTEGER grid, axis
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+      grid = cx_grid(cx_list(iarg))
+      axis = grid_line(iaxis, grid) 
+
+      IF ( (axis .EQ. munknown) .OR. (axis .EQ. mnormal) ) THEN
+         modlen = 0.0D0
+      ELSE IF ( .NOT. line_modulo(axis) ) THEN
+         modlen = 0.0D0
+      ELSE
+         modlen = line_modulo_len(axis)
+      ENDIF
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_bad_flags.c b/fer/ef_utility/ef_get_bad_flags.c
new file mode 100644
index 0000000..a1a501b
--- /dev/null
+++ b/fer/ef_utility/ef_get_bad_flags.c
@@ -0,0 +1,14 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_bad_flags)(int *id_ptr, DFTYPE bad_flag[EF_MAX_ARGS], DFTYPE *bad_flag_result)
+{
+  int i;
+
+  for (i=0; i<EF_MAX_ARGS; i++) {
+     bad_flag[i] = GLOBAL_bad_flag_ptr[i];
+  }
+  *bad_flag_result = GLOBAL_bad_flag_ptr[EF_MAX_ARGS];
+}
+
diff --git a/fer/ef_utility/ef_get_box_hi_lim.F b/fer/ef_utility/ef_get_box_hi_lim.F
new file mode 100644
index 0000000..4995442
--- /dev/null
+++ b/fer/ef_utility/ef_get_box_hi_lim.F
@@ -0,0 +1,78 @@
+c*
+c* ef_get_box_hi_lim.F
+c*
+c* Ansley Manke
+c* Jan 12th 1999
+c*Based on ef_get_coordinates.F
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This fills in the box_hi_lim of an axis in a grid.  
+c*
+c* JC_TODO: What about REAL*8 values being passed back to C
+c*
+
+      SUBROUTINE EF_GET_BOX_HI_LIM(id, iarg, idim,
+     .     ss_lo_lim, ss_hi_lim, values )
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, idim
+      INTEGER ss_lo_lim, ss_hi_lim
+      INTEGER grid, i
+
+      REAL*8  values( ss_lo_lim:ss_hi_lim )
+      REAL*8  TM_WORLD
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+*     defining grid for output data
+      grid = cx_grid( cx_list(iarg) )
+
+      DO 100 i = ss_lo_lim, ss_hi_lim
+         values( i ) = TM_WORLD( i,grid,idim,box_hi_lim )
+ 100  continue
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_box_limits.F b/fer/ef_utility/ef_get_box_limits.F
new file mode 100644
index 0000000..8765b9f
--- /dev/null
+++ b/fer/ef_utility/ef_get_box_limits.F
@@ -0,0 +1,85 @@
+c*
+c* ef_get_box_limits.F
+c*
+c* Ansley Manke
+c* Jan 12th 1999
+c*Based on ef_get_coordinates.F
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This fills in the box_limits of an axis in a grid.  
+c*
+c* JC_TODO: What about REAL*8 values being passed back to C
+c*
+
+      SUBROUTINE EF_GET_BOX_LIMITS(id, iarg, idim,
+     .     ss_lo_lim, ss_hi_lim, values_lo, values_hi )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, idim
+      INTEGER ss_lo_lim, ss_hi_lim
+      INTEGER grid, i
+
+      REAL*8  values_lo( ss_lo_lim:ss_hi_lim )
+      REAL*8  values_hi( ss_lo_lim:ss_hi_lim )
+      REAL*8  TM_WORLD
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+
+      CALL EF_GET_CX_LIST(cx_list)
+
+*     defining grid for output data
+      grid = cx_grid( cx_list(iarg) )
+
+      DO 100 i = ss_lo_lim, ss_hi_lim
+         values_lo( i ) = TM_WORLD( i,grid,idim,box_lo_lim )
+ 100  continue
+
+      DO 200 i = ss_lo_lim, ss_hi_lim
+         values_hi( i ) = TM_WORLD( i,grid,idim,box_hi_lim )
+ 200  continue
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_box_lo_lim.F b/fer/ef_utility/ef_get_box_lo_lim.F
new file mode 100644
index 0000000..768ebed
--- /dev/null
+++ b/fer/ef_utility/ef_get_box_lo_lim.F
@@ -0,0 +1,79 @@
+c*
+c* ef_get_box_lo_lim.F
+c*
+c* Ansley Manke
+c* Jan 12th 1999
+c*Based on ef_get_coordinates.F
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This fills in the box_lo_lim of an axis in a grid.  
+c*
+c* JC_TODO: What about REAL*8 values being passed back to C
+c*
+
+      SUBROUTINE EF_GET_BOX_LO_LIM(id, iarg, idim,
+     .     ss_lo_lim, ss_hi_lim, values )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, idim
+      INTEGER ss_lo_lim, ss_hi_lim
+      INTEGER grid, i
+
+      REAL*8  values( ss_lo_lim:ss_hi_lim )
+      REAL*8  TM_WORLD
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+*     defining grid for output data
+      grid = cx_grid( cx_list(iarg) )
+
+      DO 100 i = ss_lo_lim, ss_hi_lim
+         values( i ) = TM_WORLD( i,grid,idim,box_lo_lim )
+ 100  continue
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_box_size.F b/fer/ef_utility/ef_get_box_size.F
new file mode 100644
index 0000000..e430779
--- /dev/null
+++ b/fer/ef_utility/ef_get_box_size.F
@@ -0,0 +1,75 @@
+c*
+c* ef_get_box_size.F
+c*
+c* Jonathan Callahan
+c* Mar 10th 1998
+c*
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This fills in the coordinates of an axis in a grid.  
+c*
+
+      SUBROUTINE EF_GET_BOX_SIZE(id, iarg, idim,
+     .     ss_lo_lim, ss_hi_lim, values )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, idim, ss_lo_lim, ss_hi_lim
+      INTEGER grid, i
+
+      REAL    values( ss_lo_lim:ss_hi_lim )
+      REAL    BOX_SIZE
+
+      INTEGER cx_list(EF_MAX_ARGS)
+ 
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+      grid = cx_grid( cx_list(iarg) )
+
+      DO 100 i = ss_lo_lim, ss_hi_lim
+         values( i ) = BOX_SIZE( i,grid,idim )
+ 100  continue
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_coordinates.F b/fer/ef_utility/ef_get_coordinates.F
new file mode 100644
index 0000000..b1d261c
--- /dev/null
+++ b/fer/ef_utility/ef_get_coordinates.F
@@ -0,0 +1,78 @@
+c*
+c* ef_get_coordinates.F
+c*
+c* Jonathan Callahan
+c* Mar 10th 1998
+c*
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This fills in the coordinates of an axis in a grid.  
+c*
+c* JC_TODO: What about REAL*8 values being passed back to C
+c*
+
+      SUBROUTINE EF_GET_COORDINATES(id, iarg, idim,
+     .     ss_lo_lim, ss_hi_lim, values )
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+
+      INTEGER id, iarg, idim
+      INTEGER ss_lo_lim, ss_hi_lim
+      INTEGER grid, i
+
+      REAL*8  values( ss_lo_lim:ss_hi_lim )
+      REAL*8  TM_WORLD
+
+      INTEGER cx_list(EF_MAX_ARGS)
+
+c* The context list was cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_CX_LIST(cx_list)
+
+*     defining grid for output data
+      grid = cx_grid( cx_list(iarg) )
+
+      DO 100 i = ss_lo_lim, ss_hi_lim
+         values( i ) = TM_WORLD( i,grid,idim,box_middle )
+ 100  continue
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_cx_list.c b/fer/ef_utility/ef_get_cx_list.c
new file mode 100644
index 0000000..178ef73
--- /dev/null
+++ b/fer/ef_utility/ef_get_cx_list.c
@@ -0,0 +1,13 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_cx_list)(int cx_list[EF_MAX_ARGS])
+{
+  int i;
+
+  for (i=0; i<EF_MAX_ARGS; i++) {
+     cx_list[i] = GLOBAL_cx_list_ptr[i];
+  }
+}
+
diff --git a/fer/ef_utility/ef_get_mr_list.c b/fer/ef_utility/ef_get_mr_list.c
new file mode 100644
index 0000000..16dc505
--- /dev/null
+++ b/fer/ef_utility/ef_get_mr_list.c
@@ -0,0 +1,21 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_mr_list)(int mr_list[EF_MAX_ARGS])
+{
+  int i;
+
+  if (  GLOBAL_mr_list_ptr != NULL ) {
+     for (i=0; i<EF_MAX_ARGS; i++) {
+        mr_list[i] = GLOBAL_mr_list_ptr[i];
+     }
+  }
+  else {
+     for (i=0; i<EF_MAX_ARGS; i++) {
+        mr_list[i] = 0;  /* flag that mr_list is not available */
+     }
+  }
+}
+
diff --git a/fer/ef_utility/ef_get_mres.c b/fer/ef_utility/ef_get_mres.c
new file mode 100644
index 0000000..2c43cf8
--- /dev/null
+++ b/fer/ef_utility/ef_get_mres.c
@@ -0,0 +1,9 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_mres)(int *mres)
+{
+  *mres = *GLOBAL_mres_ptr;
+}
+
diff --git a/fer/ef_utility/ef_get_one_arg_string.F b/fer/ef_utility/ef_get_one_arg_string.F
new file mode 100644
index 0000000..2d4b9f3
--- /dev/null
+++ b/fer/ef_utility/ef_get_one_arg_string.F
@@ -0,0 +1,134 @@
+c*
+c* ef_get_one_arg_string.F
+c*   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c* Jonathan Callahan
+c* Mar 17th 1999
+* V530  8/00 *sh* - shifted to new way of storing strings
+*      10/00      - allow this routine to be called during CUSTOM AXIS time
+*                      (before evaluation of variables)
+c*
+c*v540 1/02 *kob* - fix bug which used character array risc_buff to pass
+c*                  a string into tm_ctof_string when tm_ctof_string was
+c*                  expecting an integer array.  no longer need xrisc.cmn
+
+c*
+c* This returns the (single) string which was passed as an argument
+c* to the function.  
+c* It may be called during grid creation time (custom axis creation) or
+c* during evaluation time.
+c* Other routines are available to handle arrays of strings.
+c* Note that grabbing an array of string during grid creation time is more
+c* difficult (though not impossible). The EVAL_EXPR routine cannot safely be
+c* called since the stacks would get re-initialized and the {,,,} would need
+c* to be parsed
+c*
+
+      SUBROUTINE EF_GET_ONE_ARG_STRING(id, iarg, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+
+      INTEGER id, iarg, mr
+      CHARACTER*(*) text
+
+      INTEGER   GET_OFFSET_C_STRING_LEN,
+     .          slen, flen, cx, uv, item, start, end
+      INTEGER   mr_list(EF_MAX_ARGS)
+      INTEGER*2 int_buff(1024)
+      CHARACTER buff*64
+ 
+c The memory resident list was cached by Ferret and must be retrieved
+c to be accessible to the external function.
+      CALL EF_GET_MR_LIST(mr_list)
+      mr = mr_list(iarg)
+      
+      IF ( mr .EQ. 0 ) THEN
+* we must have been called during custom axis creation time. We'll need
+* to grab the string straight from the function definition
+* (e.g. EF("my_string") and also allow A="string"; EF(a)
+        CALL EF_GET_CX_LIST(mr_list) ! get contexts
+        cx = mr_list(iarg)
+        IF (cx_category(cx) .EQ. cat_user_var) THEN
+* ... an intermediate variable was defined as a constant string
+          uv = cx_variable(cx)
+          IF (uvar_num_items(uv)   .NE. 1
+     .   .OR. uvar_item_type(1,uv) .NE. alg_string ) GOTO 5000
+          item = 1
+        ELSEIF (cx_category(cx) .EQ. cat_string) THEN
+* ... determine the string position directly within EF call
+          uv = cx_variable(cx)/1000
+          item = cx_variable(cx) - 1000*uv
+        ELSE
+          GOTO 5000
+        ENDIF
+* remove the surrounding quotation marks
+        start = uvar_item_start( item, uv ) + 1 ! +1 to bypass quotations
+        end   = uvar_item_end  ( item, uv ) - 1
+        text = uvar_text(uv)(start:end)
+
+      ELSE
+
+c Here's how you check the variable type.
+* (this should never happen as checks against it are made previously) 
+        IF (mr_type(mr) .NE. ptype_string) GOTO 5000
+
+* get the a string (up to the size in bytes of int_buff)
+        CALL GET_OFFSET_C_STRING(mr_c_pointer(mr), 0, int_buff, 2048)
+        
+* and the string length
+        slen = GET_OFFSET_C_STRING_LEN(mr_c_pointer(mr), 0)
+        IF ( slen .GT. 2048 ) slen = 2048
+
+* copy it into the FORTRAN string
+        CALL TM_CTOF_STRNG(int_buff, text, slen)
+
+      ENDIF
+
+      RETURN
+
+c* return a ststus word to the calling C program      
+ 5000 WRITE (buff, 3000) iarg
+ 3000 FORMAT ('Argument',I3,' is not a string')
+      CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_ONE_ARG_STRING'
+
+      END
+
diff --git a/fer/ef_utility/ef_get_one_val.c b/fer/ef_utility/ef_get_one_val.c
new file mode 100644
index 0000000..0e55b5e
--- /dev/null
+++ b/fer/ef_utility/ef_get_one_val.c
@@ -0,0 +1,9 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_one_val)(int *id_ptr, int *arg_ptr, DFTYPE *val_ptr)
+{
+  FORTRAN(ef_get_one_val_sub)(id_ptr, GLOBAL_memory_ptr, arg_ptr, val_ptr);
+}
+
diff --git a/fer/ef_utility/ef_get_one_val_sub.F b/fer/ef_utility/ef_get_one_val_sub.F
new file mode 100644
index 0000000..d8cb142
--- /dev/null
+++ b/fer/ef_utility/ef_get_one_val_sub.F
@@ -0,0 +1,114 @@
+c*
+c* ef_get_one_val_sub.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Jonathan Callahan
+c* Dec 17th 1997
+c*
+c* Revisions:
+c* *sh* 10/00 - if mr_list isn't defined (as during grid creation) then
+c* check to see if we can still return the value of a constant arg
+
+c* This subroutine is called by an external function which wishes
+c* to get the value of a 1x1x1x1 variable.
+
+c* Note that grabbing a constant array during grid creation time is more
+c* difficult (though not impossible). The EVAL_EXPR routine cannot safely be
+c* called since the stacks would get re-initialized and the {,,,} would need
+c* to be parsed
+
+
+      SUBROUTINE EF_GET_ONE_VAL_SUB(id, memory, iarg, value)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xmem_subsc.cmn'
+      INCLUDE 'EF_Util.parm'
+
+* calling argument declarations
+      REAL    value
+      INTEGER id, iarg
+      REAL    memory(mem_blk_size, max_mem_blks)
+
+* internal variable declarations
+      INTEGER mr, cx, uv, status
+      INTEGER mr_list(EF_MAX_ARGS)
+      CHARACTER*64 buff
+
+c* The following variables were cached by Ferret and must be retrieved
+c* to be accessible to the external function.
+      CALL EF_GET_MR_LIST(mr_list)
+
+      IF (mr_list(1) .GT. 0 ) THEN
+        mr = mr_list(iarg)
+        CALL EF_GET_ONE_VAL_SUB_SUB(memory(1, mr_blk1(mr)), 
+     .                              lo_ss(iarg,1), hi_ss(iarg, 1),
+     .                              lo_ss(iarg,2), hi_ss(iarg, 2),
+     .                              lo_ss(iarg,3), hi_ss(iarg, 3),
+     .                              lo_ss(iarg,4), hi_ss(iarg, 4),
+     .                              lo_ss(iarg,5), hi_ss(iarg, 5),
+     .                              lo_ss(iarg,6), hi_ss(iarg, 6),
+     .     value, status)   ! note that status is not valid as returned 10/00
+!        IF  (status .NE. ferr_ok) GOTO 5000
+
+      ELSE
+c* memory vars havnt yet been defined -- can still try to evaluate a constant
+c* Constants appear here inside a child variable
+        CALL EF_GET_CX_LIST(mr_list) ! get contexts
+        cx = mr_list(iarg)
+        IF (cx_category(cx) .NE. cat_user_var) GOTO 5000
+        uv = cx_variable(cx)
+        IF (uvar_num_items(uv)   .NE. 1
+     . .OR. uvar_item_type(1,uv) .NE. alg_constant ) GOTO 5000
+        buff = uvar_text(uv)
+        READ (buff, *, ERR=5000 ) value
+
+      ENDIF
+
+      RETURN
+
+c* return a ststus word to the calling C program      
+!5000 CALL ERRMSG(ferr_ef_error, status, ' ', *5100)
+ 5000 WRITE (buff, 3000) iarg
+ 3000 FORMAT ('Argument',I3,' must be a constant')
+      CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_ONE_VAL_SUB'
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_get_one_val_sub_sub.F b/fer/ef_utility/ef_get_one_val_sub_sub.F
new file mode 100644
index 0000000..c6bd8ce
--- /dev/null
+++ b/fer/ef_utility/ef_get_one_val_sub_sub.F
@@ -0,0 +1,59 @@
+c*
+c* ef_get_one_val_sub_sub.F
+c*
+c* Jonathan Callahan
+c* Dec 17th 1997
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c*
+c* This subroutine extracts a single value from a memory block.
+c*
+c* Currently, no checking is done.
+c*
+
+      SUBROUTINE EF_GET_ONE_VAL_SUB_SUB(data, lox, hix, loy, hiy,
+     .                    loz, hiz, lot, hit, loe, hie, lof, hif, 
+     .                    value, status)
+
+      INTEGER status, lox, hix, loy, hiy, loz, hiz,
+     .                lot, hit, loe, hie, lof, hif
+      REAL data(lox:hix, loy:hiy, loz:hiz, lot:hit, loe:hie, lof:hif)
+      REAL value
+
+      value = data(lox, loy, loz, lot, loe, lof)
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_res_mem_subscripts.F b/fer/ef_utility/ef_get_res_mem_subscripts.F
new file mode 100644
index 0000000..887948b
--- /dev/null
+++ b/fer/ef_utility/ef_get_res_mem_subscripts.F
@@ -0,0 +1,73 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the array memory limits in the common blocks for those
+* times when they cannot be retrieved directly.
+*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+      SUBROUTINE EF_GET_RES_MEM_SUBSCRIPTS(id, res_memlo, res_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+
+* argument declarations - 4D
+      INTEGER id, res_memlo(4), res_memhi(4)
+
+* local variables
+      INTEGER ndx, res_memlo_6d(nferdims), res_memhi_6d(nferdims)
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_RES_MEM_SUBSCRIPTS_6D(id, res_memlo_6d, res_memhi_6d)
+
+* check E and F are unused
+      DO 100 ndx = 5, nferdims
+         IF ( res_memlo_6d(ndx) .NE. res_memhi_6d(ndx) ) THEN
+            WRITE (buff,50) ndx
+ 50         FORMAT ('Dimension ', I1,
+     .         ' is used; use EF_GET_RES_MEM_SUBSCRIPTS_6D instead')
+            CALL EF_BAIL_OUT(id, buff)
+            STOP 'EF_BAIL_OUT returned in EF_GET_RES_MEM_SUBSCRIPTS'
+         ENDIF
+ 100  CONTINUE
+
+* copy to the 4D arrays
+      DO 200 ndx = 1, 4
+         res_memlo(ndx) = res_memlo_6d(ndx)
+         res_memhi(ndx) = res_memhi_6d(ndx)
+ 200  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_res_mem_subscripts_6d.F b/fer/ef_utility/ef_get_res_mem_subscripts_6d.F
new file mode 100644
index 0000000..754e403
--- /dev/null
+++ b/fer/ef_utility/ef_get_res_mem_subscripts_6d.F
@@ -0,0 +1,63 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the array memory limits in the common blocks for those
+* times when they cannot be retrieved directly.
+*
+      SUBROUTINE EF_GET_RES_MEM_SUBSCRIPTS_6D(id, res_memlo, res_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* argument declarations
+      INTEGER id, res_memlo(nferdims), res_memhi(nferdims)
+
+* this assumes nferdims .EQ. 6
+      res_memlo(1) = memreslox
+      res_memlo(2) = memresloy
+      res_memlo(3) = memresloz
+      res_memlo(4) = memreslot
+      res_memlo(5) = memresloe
+      res_memlo(6) = memreslof
+
+      res_memhi(1) = memreshix
+      res_memhi(2) = memreshiy
+      res_memhi(3) = memreshiz
+      res_memhi(4) = memreshit
+      res_memhi(5) = memreshie
+      res_memhi(6) = memreshif
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_res_subscripts.F b/fer/ef_utility/ef_get_res_subscripts.F
new file mode 100644
index 0000000..3fa6eee
--- /dev/null
+++ b/fer/ef_utility/ef_get_res_subscripts.F
@@ -0,0 +1,89 @@
+c*
+c* ef_get_res_subscripts.F
+c*
+c* Jonathan Callahan
+c* Apr 6th 1998
+c*
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Initialize the result context limits the EF will use.  
+c*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+      SUBROUTINE EF_GET_RES_SUBSCRIPTS(id, res_lo_ss,
+     .                                 res_hi_ss, res_incr)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+
+* argument declarations - 4D
+      INTEGER id, res_lo_ss(4), res_hi_ss(4), res_incr(4)
+
+* local variables
+      INTEGER res_lo_ss_6d(nferdims),
+     .        res_hi_ss_6d(nferdims),
+     .        res_incr_6d (nferdims)
+      INTEGER ndx
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_RES_SUBSCRIPTS_6D(id, res_lo_ss_6d, res_hi_ss_6d,
+     .                              res_incr_6d)
+
+* check E and F are unused
+      DO 100 ndx = 5, nferdims
+         IF ( res_lo_ss_6d(ndx) .NE. res_hi_ss_6d(ndx) ) THEN
+            WRITE (buff,50) ndx
+ 50         FORMAT ('Dimension ', I1,
+     .         ' is used; use EF_GET_RES_SUBSCRIPTS_6D instead')
+            CALL EF_BAIL_OUT(id, buff)
+            STOP 'EF_BAIL_OUT returned in EF_GET_RES_SUBSCRIPTS'
+         ENDIF
+ 100  CONTINUE
+
+* copy to the 4D arrays
+      DO 200 ndx = 1, 4
+         res_lo_ss(ndx) = res_lo_ss_6d(ndx)
+         res_hi_ss(ndx) = res_hi_ss_6d(ndx)
+         res_incr(ndx)  = res_incr_6d(ndx)
+ 200  CONTINUE
+
+      RETURN 
+      END
+
diff --git a/fer/ef_utility/ef_get_res_subscripts_6d.F b/fer/ef_utility/ef_get_res_subscripts_6d.F
new file mode 100644
index 0000000..94b155b
--- /dev/null
+++ b/fer/ef_utility/ef_get_res_subscripts_6d.F
@@ -0,0 +1,82 @@
+c*
+c* ef_get_res_subscripts_6d.F (formerly ef_get_res_subscripts.F)
+c*
+c* Jonathan Callahan
+c* Apr 6th 1998
+c*
+c*
+   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* Initialize the result context limits the EF will use.  
+c*
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+
+      SUBROUTINE EF_GET_RES_SUBSCRIPTS_6D(id, res_lo_ss,
+     .                                    res_hi_ss, res_incr)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id,
+     .        res_lo_ss(nferdims),
+     .        res_hi_ss(nferdims),
+     .        res_incr(nferdims)
+
+      INTEGER idim, mres
+
+c* The memory resident id for the rsult, "mres", was cached by 
+c* Ferret and must be retrieved to be accessible to the external function.
+      CALL EF_GET_MRES(mres)
+
+      DO 100 idim=1,nferdims
+
+         res_lo_ss(idim) = mr_lo_ss(mres, idim)
+         res_hi_ss(idim) = mr_hi_ss(mres, idim)
+         IF (res_lo_ss(idim) .EQ. res_hi_ss(idim)) 
+     .        THEN
+            res_incr(idim) = 0
+         ELSE
+            res_incr(idim) = 1
+         ENDIF
+
+ 100  CONTINUE
+
+      RETURN 
+      END
+
diff --git a/fer/ef_utility/ef_get_result_type.c b/fer/ef_utility/ef_get_result_type.c
new file mode 100644
index 0000000..8ed2d76
--- /dev/null
+++ b/fer/ef_utility/ef_get_result_type.c
@@ -0,0 +1,16 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_get_result_type)(int *id_ptr, int *type)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  *type = ef_ptr->internals_ptr->return_type;
+}  
+
diff --git a/fer/ef_utility/ef_get_string_arg_elem_len_sub.F b/fer/ef_utility/ef_get_string_arg_elem_len_sub.F
new file mode 100644
index 0000000..97bbd62
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_elem_len_sub.F
@@ -0,0 +1,64 @@
+      SUBROUTINE EF_GET_STRING_ARG_ELEM_LEN_SUB( lox, hix, loy, hiy,
+     .                  loz, hiz, lot, hit, loe, hie, lof, hif, arg, 
+     .                  i, j, k, l, m, n, max_line_len, slen )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* This returns an the length of an element of the string array 
+* which was passed as an argument to the function.  
+*
+* Called by ef_get_string_arg_element_len.
+*
+* Inside this subroutine arg is an array of pointers (cast as real*8),
+* and we can call GET_STRING_ELEMENT to get the length of a string element.
+*
+*  acm 12/03  from ef_get_arg_string
+*
+*       3/12 *kms* Added E and F dimensions
+
+      INTEGER i, j, k, l, m, n, 
+     .        lox, hix, loy, hiy, loz, hiz,
+     .        lot, hit, loe, hie, lof, hif,
+     .        slen, max_line_len
+      REAL*8 arg(lox:hix, loy:hiy, loz:hiz, lot:hit, loe:hie, lof:hif)
+
+      CHARACTER*512 text
+
+      CHARACTER GET_STRING_ELEMENT*512
+    
+      text = GET_STRING_ELEMENT(lox, hix, loy, hiy, loz, hiz,
+     .                          lot, hit, loe, hie, lof, hif, arg,
+     .                          i, j, k, l, m, n, max_line_len, slen)
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_element.F b/fer/ef_utility/ef_get_string_arg_element.F
new file mode 100644
index 0000000..df9b650
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_element.F
@@ -0,0 +1,84 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*
+c* This returns an element of the string array which was passed as an argument
+c* to the function and for convenience, its length.
+*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+
+      SUBROUTINE EF_GET_STRING_ARG_ELEMENT(id, iarg, arg, i, j, k, l,
+     .                                     slen, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id, iarg, slen, i, j, k, l
+      CHARACTER*(*) text
+      REAL arg(*)
+
+* local variables
+      INTEGER ndx, m, n,
+     .        arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .        arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .        arg_incr (nferdims,EF_MAX_ARGS)
+      CHARACTER*128 buff
+
+* get the dimensions so m and n can be checked and assigned
+      CALL EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss, arg_hi_ss, arg_incr)
+ 
+* make sure the E and F dimensions are not used
+      DO 100 ndx = 5, nferdims
+         IF ( arg_lo_ss(ndx, iarg) .NE.
+     .        arg_hi_ss(ndx, iarg) ) THEN
+            WRITE (buff,50) ndx, iarg
+ 50         FORMAT ('Dimension ', I1, ' of argument ', I2,
+     .         ' is used; use EF_GET_STRING_ARG_ELEMENT_6D instead')
+            CALL EF_BAIL_OUT(id, buff)
+            STOP 'EF_BAIL_OUT returned in EF_GET_STRING_ARG_ELEMENT'
+         ENDIF
+ 100  CONTINUE
+
+* call the 6D routine with the appropriate m and n
+      m = arg_lo_ss(5, iarg)
+      n = arg_lo_ss(6, iarg)
+      CALL EF_GET_STRING_ARG_ELEMENT_6D(id, iarg, arg,
+     .                   i, j, k, l, m, n, slen, text)
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_element_6d.F b/fer/ef_utility/ef_get_string_arg_element_6d.F
new file mode 100644
index 0000000..467845d
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_element_6d.F
@@ -0,0 +1,123 @@
+c*
+c* ef_get_string_arg_element_6d.F (formerly ef_get_string_arg_element.F)
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c*  acm 12/03  from ef_get_arg_string
+c*
+c*
+c* This returns an element of the string array which was passed as an argument
+c* to the function and for convenience, its length.
+*
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+
+
+      SUBROUTINE EF_GET_STRING_ARG_ELEMENT_6D(id, iarg, arg,
+     .                             i, j, k, l, m, n, slen, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, slen, i, j, k, l, m, n
+      CHARACTER*(*) text
+      REAL arg(*)
+
+      INTEGER max_line_len, mr, lox, hix, loy, hiy, loz, hiz,
+     .                          lot, hit, loe, hie, lof, hif
+      INTEGER mr_list(EF_MAX_ARGS)
+      CHARACTER buff*128
+      PARAMETER (max_line_len = 512)
+      
+      INTEGER arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .        arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .        arg_incr (nferdims,EF_MAX_ARGS)
+
+      CALL EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss, arg_hi_ss, arg_incr)
+ 
+c The memory resident list was cached by Ferret and must be retrieved
+c to be accessible to the external function.
+      CALL EF_GET_MR_LIST(mr_list)
+      mr = mr_list(iarg)
+      
+      IF ( mr .EQ. 0 ) THEN
+* we must have been called during custom axis creation time. Use
+* ef_get_one_arg_string for this.
+          buff = 
+     .   'Use ef_get_one_arg_string to get one string during init phase'
+          GOTO 5000
+
+      ELSE
+
+* Here's how you check the variable type.
+* (this should never happen as checks against it are made previously) 
+        IF (mr_type(mr) .NE. ptype_string) THEN
+           WRITE (buff,4000) iarg
+ 4000      FORMAT ('Argument',I3,' is not a string')
+           GOTO 5000
+        ENDIF
+
+        lox = arg_lo_ss(X_AXIS,iarg)
+        hix = arg_hi_ss(X_AXIS,iarg)
+        loy = arg_lo_ss(Y_AXIS,iarg)
+        hiy = arg_hi_ss(Y_AXIS,iarg)
+        loz = arg_lo_ss(Z_AXIS,iarg)
+        hiz = arg_hi_ss(Z_AXIS,iarg)
+        lot = arg_lo_ss(T_AXIS,iarg)
+        hit = arg_hi_ss(T_AXIS,iarg)
+        loe = arg_lo_ss(E_AXIS,iarg)
+        hie = arg_hi_ss(E_AXIS,iarg)
+        lof = arg_lo_ss(F_AXIS,iarg)
+        hif = arg_hi_ss(F_AXIS,iarg)
+
+* Inside ef_get_string_arg_element_sub, arg is a real*8 array of pointers, and
+* we can call GET_STRING_ELEMENT to get a string element.
+
+        CALL EF_GET_STRING_ARG_ELEMENT_SUB( lox, hix, loy, hiy,
+     .              loz, hiz, lot, hit, loe, hie, lof, hif,
+     .              arg, i, j, k, l, m, n, max_line_len, 
+     .              slen, text )
+
+      ENDIF
+
+      RETURN
+
+* return an error message     
+ 5000 CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_STRING_ARG_ELEMENT_6D'
+
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_element_len.F b/fer/ef_utility/ef_get_string_arg_element_len.F
new file mode 100644
index 0000000..36575cc
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_element_len.F
@@ -0,0 +1,81 @@
+      SUBROUTINE EF_GET_STRING_ARG_ELEMENT_LEN
+     .            (id, iarg, arg, i, j, k, l, slen)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This returns the length of the I,J,K,L-th element of the string array which 
+* was passed as an argument to the external function.
+*
+* 4D subroutine version which calls the 6D subroutine version and
+* checks the E and F dimensions are unused
+*
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id, iarg, slen, i, j, k, l
+      REAL arg(*)
+
+* local variables
+      INTEGER ndx, m, n,
+     .        arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .        arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .        arg_incr (nferdims,EF_MAX_ARGS)
+      CHARACTER*128 buff
+
+* get the dimensions so m and n can be checked and assigned
+      CALL EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss, arg_hi_ss, arg_incr)
+ 
+* make sure the E and F dimensions are not used
+      DO 100 ndx = 5, nferdims
+         IF ( arg_lo_ss(ndx, iarg) .NE.
+     .        arg_hi_ss(ndx, iarg) ) THEN
+            WRITE (buff,50) ndx, iarg
+ 50         FORMAT ('Dimension ', I1, ' of argument ', I2,
+     .        ' is used; use EF_GET_STRING_ARG_ELEMENT_LEN_6D instead')
+            CALL EF_BAIL_OUT(id, buff)
+            STOP 'EF_BAIL_OUT returned in EF_GET_STRING_ARG_ELEMENT_LEN'
+         ENDIF
+ 100  CONTINUE
+
+* call the 6D routine with the appropriate m and n
+      m = arg_lo_ss(5, iarg)
+      n = arg_lo_ss(6, iarg)
+      CALL EF_GET_STRING_ARG_ELEMENT_LEN_6D(id, iarg, arg,
+     .                       i, j, k, l, m, n, slen)
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_element_len_6d.F b/fer/ef_utility/ef_get_string_arg_element_len_6d.F
new file mode 100644
index 0000000..ff00bbc
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_element_len_6d.F
@@ -0,0 +1,117 @@
+      SUBROUTINE EF_GET_STRING_ARG_ELEMENT_LEN_6D
+     .            (id, iarg, arg, i, j, k, l, m, n, slen)
+*
+* (formerly ef_get_String_arg_element_len)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*  acm 12/03  
+*
+* This returns the length of the I,J,K,L,M,N-th element of the string array which 
+* was passed as an argument to the external function.
+*
+*       3/12 *kms* Added E and F dimensions, appended _6D to subroutine name
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, slen, i, j, k, l, m, n
+      REAL arg(*)
+
+      INTEGER max_line_len, mr, lox, hix, loy, hiy, loz, hiz,
+     .                          lot, hit, loe, hie, lof, hif
+      INTEGER mr_list(EF_MAX_ARGS)
+      CHARACTER buff*128
+      PARAMETER (max_line_len = 512)
+      
+      INTEGER arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .        arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .        arg_incr (nferdims,EF_MAX_ARGS)
+
+      CALL EF_GET_ARG_SUBSCRIPTS_6D(id, arg_lo_ss, arg_hi_ss, arg_incr)
+ 
+* The memory resident list was cached by Ferret and must be retrieved
+* to be accessible to the external function.
+
+      CALL EF_GET_MR_LIST(mr_list)
+      mr = mr_list(iarg)
+      
+      IF ( mr .EQ. 0 ) THEN
+* Don't call during custom axis creation time
+          buff = 
+     .     'Use ef_get_string_arg_element_len in the compute phase'
+          GOTO 5000
+
+* Here's how you check the variable type.
+* (this should never happen as checks against it are made previously) 
+      ELSE IF (mr_type(mr) .NE. ptype_string) THEN
+           WRITE (buff,4000) iarg
+ 4000      FORMAT ('Argument',I3,' is not a string')
+           GOTO 5000
+      ELSE
+
+           lox = arg_lo_ss(X_AXIS,iarg)
+           hix = arg_hi_ss(X_AXIS,iarg)
+           loy = arg_lo_ss(Y_AXIS,iarg)
+           hiy = arg_hi_ss(Y_AXIS,iarg)
+           loz = arg_lo_ss(Z_AXIS,iarg)
+           hiz = arg_hi_ss(Z_AXIS,iarg)
+           lot = arg_lo_ss(T_AXIS,iarg)
+           hit = arg_hi_ss(T_AXIS,iarg)
+           loe = arg_lo_ss(E_AXIS,iarg)
+           hie = arg_hi_ss(E_AXIS,iarg)
+           lof = arg_lo_ss(F_AXIS,iarg)
+           hif = arg_hi_ss(F_AXIS,iarg)
+
+
+* Inside ef_get_string_arg_elem_len_sub, arg is a real*8 array of pointers, and
+* we can call GET_STRING_ELEMENT to get the length of a string element.
+
+           CALL EF_GET_STRING_ARG_ELEM_LEN_SUB(
+     .                 lox, hix, loy, hiy, loz, hiz, lot, hit,
+     .                 loe, hie, lof, hif, arg, i, j, k, l, m, n,
+     .                 max_line_len, slen )
+
+      ENDIF
+
+      RETURN
+
+* return an error message     
+ 5000 CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_STRING_ARG_ELEMENT_LEN_6D'
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_element_sub.F b/fer/ef_utility/ef_get_string_arg_element_sub.F
new file mode 100644
index 0000000..3f4bc5f
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_element_sub.F
@@ -0,0 +1,63 @@
+* ef_get_string_arg_element_sub.F
+*
+*  acm 12/03  from ef_get_arg_string
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* This returns an element of the string array which was passed as an argument
+* to the function.  
+*
+* Inside this subroutine arg is an array of pointers (cast as real*8),
+* and we can call GET_STRING_ELEMENT to get a string element.
+*
+*       3/12 *kms* Added E and F dimensions
+
+      SUBROUTINE EF_GET_STRING_ARG_ELEMENT_SUB( lox, hix, loy, hiy,
+     .                  loz, hiz, lot, hit, loe, hie, lof, hif, arg,
+     .                  i, j, k, l, m, n, max_line_len, slen, text )
+
+      INTEGER i, j, k, l, m, n,
+     .        lox, hix, loy, hiy, loz, hiz, 
+     .        lot, hit, loe, hie, lof, hif,
+     .        slen, max_line_len
+      CHARACTER*(*) text
+      REAL*8 arg(lox:hix, loy:hiy, loz:hiz, lot:hit, loe:hie, lof:hif)
+
+      CHARACTER GET_STRING_ELEMENT*512
+
+      text = GET_STRING_ELEMENT(lox, hix, loy, hiy, loz, hiz,
+     .                          lot, hit, loe, hie, lof, hif, arg,
+     .                          i, j, k, l, m, n, max_line_len, slen)
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_string_arg_max_len.F b/fer/ef_utility/ef_get_string_arg_max_len.F
new file mode 100644
index 0000000..3227dfe
--- /dev/null
+++ b/fer/ef_utility/ef_get_string_arg_max_len.F
@@ -0,0 +1,122 @@
+      SUBROUTINE EF_GET_STRING_ARG_MAX_LEN(id, iarg, str_arg, smax)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  acm 12/03  
+*
+* This returns the maximum length of the string elements of a string array
+* which was passed as an argument to the external function.
+*
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, iarg, smax
+      REAL str_arg(*)
+
+      INTEGER max_line_len, mr, slen,
+     .        i, j, k, l, m, n, 
+     .        lox, hix, loy, hiy, loz, hiz,
+     .        lot, hit, loe, hie, lof, hif
+      INTEGER mr_list(EF_MAX_ARGS)
+      CHARACTER buff*64
+      PARAMETER (max_line_len = 512)
+      
+      INTEGER arg_lo_ss(nferdims,EF_MAX_ARGS),
+     .        arg_hi_ss(nferdims,EF_MAX_ARGS),
+     .        arg_incr (nferdims,EF_MAX_ARGS)
+
+      CALL EF_GET_ARG_SUBSCRIPTS(id, arg_lo_ss, arg_hi_ss, arg_incr)
+ 
+* The memory resident list was cached by Ferret and must be retrieved
+* to be accessible to the external function.
+
+      CALL EF_GET_MR_LIST(mr_list)
+      mr = mr_list(iarg)
+
+      IF ( mr .EQ. 0 ) THEN
+* Do not call during custom axis creation time
+          buff = 
+     .     'Use ef_get_string_arg_element_len in the compute phase'
+          GOTO 5000
+
+* Check the variable type.
+
+      ELSE IF (mr_type(mr) .NE. ptype_string) THEN
+         WRITE (buff,4000) iarg
+ 4000    FORMAT ('Argument',I3,' is not a string')
+         GOTO 5000
+      ELSE
+         lox = arg_lo_ss(X_AXIS,iarg)
+         hix = arg_hi_ss(X_AXIS,iarg)
+         loy = arg_lo_ss(Y_AXIS,iarg)
+         hiy = arg_hi_ss(Y_AXIS,iarg)
+         loz = arg_lo_ss(Z_AXIS,iarg)
+         hiz = arg_hi_ss(Z_AXIS,iarg)
+         lot = arg_lo_ss(T_AXIS,iarg)
+         hit = arg_hi_ss(T_AXIS,iarg)
+         loe = arg_lo_ss(E_AXIS,iarg)
+         hie = arg_hi_ss(E_AXIS,iarg)
+         lof = arg_lo_ss(F_AXIS,iarg)
+         hif = arg_hi_ss(F_AXIS,iarg)
+
+
+* Inside ef_get_string_arg_elem_len_sub, str_arg is an array of pointers (cast as REAL*8),
+* and we can call GET_STRING_ELEMENT to get the length of a string element. 
+
+          smax = 0
+          DO 100 n = lof, hif
+          DO 100 m = loe, hie
+          DO 100 l = lot, hit
+          DO 100 k = loz, hiz
+          DO 100 j = loy, hiy
+          DO 100 i = lox, hix
+             CALL EF_GET_STRING_ARG_ELEM_LEN_SUB(lox, hix, loy, hiy,
+     .                   loz, hiz, lot, hit, loe, hie, lof, hif,
+     .                   str_arg, i, j, k, l, m, n, max_line_len, slen)
+             smax = MAX(slen, smax)
+ 100      CONTINUE
+
+      ENDIF
+
+      RETURN
+
+* return an error message     
+ 5000 CALL EF_BAIL_OUT(id, buff)
+      STOP 'EF_BAIL_OUT returned in EF_GET_STRING_ARG_MAX_LEN'
+
+      END
diff --git a/fer/ef_utility/ef_get_wrk_mem_subscripts.F b/fer/ef_utility/ef_get_wrk_mem_subscripts.F
new file mode 100644
index 0000000..8137435
--- /dev/null
+++ b/fer/ef_utility/ef_get_wrk_mem_subscripts.F
@@ -0,0 +1,85 @@
+*
+* ef_get_wrk_mem_subscripts.F
+* 
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the work array memory limits in the common blocks
+* for those times when they cannot be retrieved directly.
+*
+* 4D subroutine version which calls the 6D subroutine version
+* and checks the E and F dimensions are unused
+*
+      SUBROUTINE EF_GET_WRK_MEM_SUBSCRIPTS(id, wrk_memlo, wrk_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+
+* argument declarations - 4D
+      INTEGER id, wrk_memlo(4,EF_MAX_WORK_ARRAYS),
+     .            wrk_memhi(4,EF_MAX_WORK_ARRAYS)
+
+* local variables
+      INTEGER ndx, wdx,
+     .        wrk_memlo_6d(nferdims, EF_MAX_WORK_ARRAYS),
+     .        wrk_memhi_6d(nferdims, EF_MAX_WORK_ARRAYS)
+      CHARACTER*128 buff
+
+* call the 6D version
+      CALL EF_GET_WRK_MEM_SUBSCRIPTS_6D(id, wrk_memlo_6d, wrk_memhi_6d)
+
+* check E and F are unused
+      DO 110 wdx = 1, EF_MAX_WORK_ARRAYS
+         DO 100 ndx = 5, nferdims
+            IF ( wrk_memlo_6d(ndx, wdx) .NE.
+     .           wrk_memhi_6d(ndx, wdx) ) THEN
+               WRITE (buff,50) ndx, wdx
+ 50            FORMAT ('Dimension ', I1, ' of work array ', I2,
+     .            ' is used; use EF_GET_WRK_MEM_SUBSCRIPTS_6D instead')
+               CALL EF_BAIL_OUT(id, buff)
+               STOP 'EF_BAIL_OUT returned in EF_GET_WRK_MEM_SUBSCRIPTS'
+            ENDIF
+ 100     CONTINUE
+ 110  CONTINUE
+
+* copy to the 4D arrays
+      DO 210 wdx = 1, EF_MAX_WORK_ARRAYS
+         DO 200 ndx = 1, 4
+            wrk_memlo(ndx, wdx) = wrk_memlo_6d(ndx, wdx)
+            wrk_memhi(ndx, wdx) = wrk_memhi_6d(ndx, wdx)
+ 200     CONTINUE
+ 210  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/ef_utility/ef_get_wrk_mem_subscripts_6d.F b/fer/ef_utility/ef_get_wrk_mem_subscripts_6d.F
new file mode 100644
index 0000000..fff11e1
--- /dev/null
+++ b/fer/ef_utility/ef_get_wrk_mem_subscripts_6d.F
@@ -0,0 +1,174 @@
+*
+* ef_get_wrk_mem_subscripts_6d.F (was ef_get_wrk_mem_subscripts.F)
+*   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the work array memory limits in the common blocks
+* for those times when they cannot be retrieved directly.
+*
+      SUBROUTINE EF_GET_WRK_MEM_SUBSCRIPTS_6D(id, wrk_memlo, wrk_memhi)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'EF_Util.parm'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* argument declarations
+      INTEGER id, wrk_memlo(nferdims,EF_MAX_WORK_ARRAYS),
+     .            wrk_memhi(nferdims,EF_MAX_WORK_ARRAYS)
+
+* this assumed EF_MAX_WORK_ARRAYS .EQ. 9
+      wrk_memlo(1,1) = wrk1lox
+      wrk_memlo(1,2) = wrk2lox
+      wrk_memlo(1,3) = wrk3lox
+      wrk_memlo(1,4) = wrk4lox
+      wrk_memlo(1,5) = wrk5lox
+      wrk_memlo(1,6) = wrk6lox
+      wrk_memlo(1,7) = wrk7lox
+      wrk_memlo(1,8) = wrk8lox
+      wrk_memlo(1,9) = wrk9lox
+
+      wrk_memlo(2,1) = wrk1loy
+      wrk_memlo(2,2) = wrk2loy
+      wrk_memlo(2,3) = wrk3loy
+      wrk_memlo(2,4) = wrk4loy
+      wrk_memlo(2,5) = wrk5loy
+      wrk_memlo(2,6) = wrk6loy
+      wrk_memlo(2,7) = wrk7loy
+      wrk_memlo(2,8) = wrk8loy
+      wrk_memlo(2,9) = wrk9loy
+
+      wrk_memlo(3,1) = wrk1loz
+      wrk_memlo(3,2) = wrk2loz
+      wrk_memlo(3,3) = wrk3loz
+      wrk_memlo(3,4) = wrk4loz
+      wrk_memlo(3,5) = wrk5loz
+      wrk_memlo(3,6) = wrk6loz
+      wrk_memlo(3,7) = wrk7loz
+      wrk_memlo(3,8) = wrk8loz
+      wrk_memlo(3,9) = wrk9loz
+
+      wrk_memlo(4,1) = wrk1lot
+      wrk_memlo(4,2) = wrk2lot
+      wrk_memlo(4,3) = wrk3lot
+      wrk_memlo(4,4) = wrk4lot
+      wrk_memlo(4,5) = wrk5lot
+      wrk_memlo(4,6) = wrk6lot
+      wrk_memlo(4,7) = wrk7lot
+      wrk_memlo(4,8) = wrk8lot
+      wrk_memlo(4,9) = wrk9lot
+
+      wrk_memlo(5,1) = wrk1loe
+      wrk_memlo(5,2) = wrk2loe
+      wrk_memlo(5,3) = wrk3loe
+      wrk_memlo(5,4) = wrk4loe
+      wrk_memlo(5,5) = wrk5loe
+      wrk_memlo(5,6) = wrk6loe
+      wrk_memlo(5,7) = wrk7loe
+      wrk_memlo(5,8) = wrk8loe
+      wrk_memlo(5,9) = wrk9loe
+
+      wrk_memlo(6,1) = wrk1lof
+      wrk_memlo(6,2) = wrk2lof
+      wrk_memlo(6,3) = wrk3lof
+      wrk_memlo(6,4) = wrk4lof
+      wrk_memlo(6,5) = wrk5lof
+      wrk_memlo(6,6) = wrk6lof
+      wrk_memlo(6,7) = wrk7lof
+      wrk_memlo(6,8) = wrk8lof
+      wrk_memlo(6,9) = wrk9lof
+
+      wrk_memhi(1,1) = wrk1hix
+      wrk_memhi(1,2) = wrk2hix
+      wrk_memhi(1,3) = wrk3hix
+      wrk_memhi(1,4) = wrk4hix
+      wrk_memhi(1,5) = wrk5hix
+      wrk_memhi(1,6) = wrk6hix
+      wrk_memhi(1,7) = wrk7hix
+      wrk_memhi(1,8) = wrk8hix
+      wrk_memhi(1,9) = wrk9hix
+
+      wrk_memhi(2,1) = wrk1hiy
+      wrk_memhi(2,2) = wrk2hiy
+      wrk_memhi(2,3) = wrk3hiy
+      wrk_memhi(2,4) = wrk4hiy
+      wrk_memhi(2,5) = wrk5hiy
+      wrk_memhi(2,6) = wrk6hiy
+      wrk_memhi(2,7) = wrk7hiy
+      wrk_memhi(2,8) = wrk8hiy
+      wrk_memhi(2,9) = wrk9hiy
+
+      wrk_memhi(3,1) = wrk1hiz
+      wrk_memhi(3,2) = wrk2hiz
+      wrk_memhi(3,3) = wrk3hiz
+      wrk_memhi(3,4) = wrk4hiz
+      wrk_memhi(3,5) = wrk5hiz
+      wrk_memhi(3,6) = wrk6hiz
+      wrk_memhi(3,7) = wrk7hiz
+      wrk_memhi(3,8) = wrk8hiz
+      wrk_memhi(3,9) = wrk9hiz
+
+      wrk_memhi(4,1) = wrk1hit
+      wrk_memhi(4,2) = wrk2hit
+      wrk_memhi(4,3) = wrk3hit
+      wrk_memhi(4,4) = wrk4hit
+      wrk_memhi(4,5) = wrk5hit
+      wrk_memhi(4,6) = wrk6hit
+      wrk_memhi(4,7) = wrk7hit
+      wrk_memhi(4,8) = wrk8hit
+      wrk_memhi(4,9) = wrk9hit
+
+      wrk_memhi(5,1) = wrk1hie
+      wrk_memhi(5,2) = wrk2hie
+      wrk_memhi(5,3) = wrk3hie
+      wrk_memhi(5,4) = wrk4hie
+      wrk_memhi(5,5) = wrk5hie
+      wrk_memhi(5,6) = wrk6hie
+      wrk_memhi(5,7) = wrk7hie
+      wrk_memhi(5,8) = wrk8hie
+      wrk_memhi(5,9) = wrk9hie
+
+      wrk_memhi(6,1) = wrk1hif
+      wrk_memhi(6,2) = wrk2hif
+      wrk_memhi(6,3) = wrk3hif
+      wrk_memhi(6,4) = wrk4hif
+      wrk_memhi(6,5) = wrk5hif
+      wrk_memhi(6,6) = wrk6hif
+      wrk_memhi(6,7) = wrk7hif
+      wrk_memhi(6,8) = wrk8hif
+      wrk_memhi(6,9) = wrk9hif
+
+      RETURN
+      END
+
diff --git a/fer/ef_utility/ef_put_string.c b/fer/ef_utility/ef_put_string.c
new file mode 100644
index 0000000..bf60ba4
--- /dev/null
+++ b/fer/ef_utility/ef_put_string.c
@@ -0,0 +1,26 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/* 
+ *  Make a copy of a string up to a given length
+ *  and assign it to the output pointer.
+ */
+void FORTRAN(ef_put_string)(char* text, int* inlen, char** out_ptr)
+{
+   int i;
+
+   if ( *out_ptr != NULL )
+      free(*out_ptr);
+
+   *out_ptr = (char *) malloc(sizeof(char) * (*inlen+1));
+   if ( *out_ptr == NULL ) {
+      abort();
+   }
+   for (i=0; i<*inlen; i++) {
+      (*out_ptr)[i] = text[i];
+   }
+   (*out_ptr)[*inlen] = '\0';    /* null-terminate the stored string */
+}
+
diff --git a/fer/ef_utility/ef_put_string_ptr.c b/fer/ef_utility/ef_put_string_ptr.c
new file mode 100644
index 0000000..0558387
--- /dev/null
+++ b/fer/ef_utility/ef_put_string_ptr.c
@@ -0,0 +1,22 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+/* 
+ *  Make a copy of a null-terminated string
+ *  and assign it to the output pointer.
+ */
+void FORTRAN(ef_put_string_ptr)(char **in_ptr, char **out_ptr)
+{
+  if ( *out_ptr != NULL )
+     free(*out_ptr);
+
+  *out_ptr = (char *) malloc(sizeof(char) * (strlen(*in_ptr)+1));
+  if ( *out_ptr == NULL ) {
+     abort();
+  }
+  strcpy(*out_ptr, *in_ptr);
+}
+
diff --git a/fer/ef_utility/ef_set_alt_fcn_name.F b/fer/ef_utility/ef_set_alt_fcn_name.F
new file mode 100644
index 0000000..6cffd19
--- /dev/null
+++ b/fer/ef_utility/ef_set_alt_fcn_name.F
@@ -0,0 +1,80 @@
+c     
+c     ef_set_alt_fcn_name.F
+c     
+c     Ansley Manke
+c     Nov 2008
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine is called by external function init routines.
+c     it sets a name for another version of a function (e.g. xcat_str 
+c     for a string version of xcat) which takes different argument types
+c     and may have a different result type. E.g. this lets the user 
+c     reference XCAT with string arguments and Ferret will run XCAT_STR
+
+      SUBROUTINE EF_SET_ALT_FCN_NAME(id, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_name_length )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library routine to see if it is external
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+      CALL EF_SET_ALT_FCN_NAME_SUB( id, fhol )
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_alt_fcn_name_sub.c b/fer/ef_utility/ef_set_alt_fcn_name_sub.c
new file mode 100644
index 0000000..a4f30d6
--- /dev/null
+++ b/fer/ef_utility/ef_set_alt_fcn_name_sub.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_alt_fcn_name_sub)(int *id_ptr, char *text)
+{
+   ExternalFunction *ef_ptr;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+   strcpy(ef_ptr->internals_ptr->alt_fcn_name, text);
+}  
+
diff --git a/fer/ef_utility/ef_set_arg_desc.F b/fer/ef_utility/ef_set_arg_desc.F
new file mode 100644
index 0000000..ba51ea0
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_desc.F
@@ -0,0 +1,78 @@
+c     
+c     ef_set_arg_desc.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine is called by code inside EF_ExternalUtil.c. It will
+c     initialize the context limits the EF will use.  
+c     
+
+      SUBROUTINE EF_SET_ARG_DESC(id, arg, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, arg
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library to set the value
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+      CALL EF_SET_ARG_DESC_SUB( id, arg, fhol )
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_arg_desc_sub.c b/fer/ef_utility/ef_set_arg_desc_sub.c
new file mode 100644
index 0000000..4e4e255
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_desc_sub.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_arg_desc_sub)(int *id_ptr, int *arg_ptr, char *text)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  strcpy(ef_ptr->internals_ptr->arg_desc[*arg_ptr-1], text);
+}  
+
diff --git a/fer/ef_utility/ef_set_arg_name.F b/fer/ef_utility/ef_set_arg_name.F
new file mode 100644
index 0000000..ad1260e
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_name.F
@@ -0,0 +1,78 @@
+c     
+c     ef_set_arg_name.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine is called by code inside EF_ExternalUtil.c. It will
+c     initialize the context limits the EF will use.  
+c     
+
+      SUBROUTINE EF_SET_ARG_NAME(id, arg, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, arg
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library to set the value
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+      CALL EF_SET_ARG_NAME_SUB( id, arg, fhol )
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_arg_name_sub.c b/fer/ef_utility/ef_set_arg_name_sub.c
new file mode 100644
index 0000000..fc40ad4
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_name_sub.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_arg_name_sub)(int *id_ptr, int *arg_ptr, char *text)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  strcpy(ef_ptr->internals_ptr->arg_name[*arg_ptr-1], text);
+}  
+
diff --git a/fer/ef_utility/ef_set_arg_type.c b/fer/ef_utility/ef_set_arg_type.c
new file mode 100644
index 0000000..b443a09
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_type.c
@@ -0,0 +1,16 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_arg_type)(int *id_ptr, int *arg, int *arg_type)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  ef_ptr->internals_ptr->arg_type[*arg-1] = *arg_type;
+}
+
diff --git a/fer/ef_utility/ef_set_arg_unit.F b/fer/ef_utility/ef_set_arg_unit.F
new file mode 100644
index 0000000..2379b19
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_unit.F
@@ -0,0 +1,78 @@
+c     
+c     ef_set_arg_unit.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine is called by code inside EF_ExternalUtil.c. It will
+c     initialize the context limits the EF will use.  
+c     
+
+      SUBROUTINE EF_SET_ARG_UNIT(id, arg, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, arg
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library to set the value
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+      CALL EF_SET_ARG_UNIT_SUB( id, arg, fhol )
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_arg_unit_sub.c b/fer/ef_utility/ef_set_arg_unit_sub.c
new file mode 100644
index 0000000..6f62000
--- /dev/null
+++ b/fer/ef_utility/ef_set_arg_unit_sub.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_arg_unit_sub)(int *id_ptr, int *arg_ptr, char *text)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort(); 
+  }
+  strcpy(ef_ptr->internals_ptr->arg_unit[*arg_ptr-1], text);
+} 
+
diff --git a/fer/ef_utility/ef_set_axis_extend.c b/fer/ef_utility/ef_set_axis_extend.c
new file mode 100644
index 0000000..3e3ef24
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_extend.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_axis_extend)(int *id_ptr, int *arg, int *axis, int *lo, int *hi)
+{
+  ExternalFunction *ef_ptr=NULL;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  ef_ptr->internals_ptr->axis_extend_lo[*arg-1][*axis-1] = *lo;
+  ef_ptr->internals_ptr->axis_extend_hi[*arg-1][*axis-1] = *hi;
+}
+
diff --git a/fer/ef_utility/ef_set_axis_influence.c b/fer/ef_utility/ef_set_axis_influence.c
new file mode 100644
index 0000000..a6684fb
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_influence.c
@@ -0,0 +1,14 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/* calls the 6D function with NO for the E and F axes */
+void FORTRAN(ef_set_axis_influence)(int *id_ptr, int *arg, int *xax, int *yax, int *zax, int *tax)
+{
+   int eax_val, fax_val;
+
+   eax_val = NO;
+   fax_val = NO;
+   FORTRAN(ef_set_axis_influence_6d)(id_ptr, arg, xax, yax, zax, tax, &eax_val, &fax_val);
+}
+
diff --git a/fer/ef_utility/ef_set_axis_influence_6d.c b/fer/ef_utility/ef_set_axis_influence_6d.c
new file mode 100644
index 0000000..891728d
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_influence_6d.c
@@ -0,0 +1,55 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_axis_influence_6d)(int *id_ptr, int *arg,
+                                       int *xax, int *yax, int *zax,
+                                       int *tax, int *eax, int *fax)
+{
+   ExternalFunction *ef_ptr;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+
+   if ( *xax != YES && *xax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown X axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *yax != YES && *yax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Y axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *zax != YES && *zax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Z axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *tax != YES && *tax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown T axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *eax != YES && *eax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown E axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *fax != YES && *fax != NO ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown F axis value passed to ef_set_axis_influence");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][0] = *xax;
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][1] = *yax;
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][2] = *zax;
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][3] = *tax;
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][4] = *eax;
+   ef_ptr->internals_ptr->axis_implied_from[*arg-1][5] = *fax;
+}
+
diff --git a/fer/ef_utility/ef_set_axis_inheritance.c b/fer/ef_utility/ef_set_axis_inheritance.c
new file mode 100644
index 0000000..df2a6da
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_inheritance.c
@@ -0,0 +1,14 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/* Calls the 6D version with NORMAL for the E and F axis */
+void FORTRAN(ef_set_axis_inheritance)(int *id_ptr, int *xax, int *yax, int *zax, int *tax)
+{
+   int eax_val, fax_val;
+
+   eax_val = NORMAL;
+   fax_val = NORMAL;
+   FORTRAN(ef_set_axis_inheritance_6d)(id_ptr, xax, yax, zax, tax, &eax_val, &fax_val);
+}
+
diff --git a/fer/ef_utility/ef_set_axis_inheritance_6d.c b/fer/ef_utility/ef_set_axis_inheritance_6d.c
new file mode 100644
index 0000000..65604b9
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_inheritance_6d.c
@@ -0,0 +1,55 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_axis_inheritance_6d)(int *id_ptr,
+                                         int *xax, int *yax, int *zax,
+                                         int *tax, int *eax, int *fax)
+{
+   ExternalFunction *ef_ptr;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+
+   if ( *xax != CUSTOM && *xax != IMPLIED_BY_ARGS && *xax != NORMAL && *xax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown X axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *yax != CUSTOM && *yax != IMPLIED_BY_ARGS && *yax != NORMAL && *yax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Y axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *zax != CUSTOM && *zax != IMPLIED_BY_ARGS && *zax != NORMAL && *zax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Z axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *tax != CUSTOM && *tax != IMPLIED_BY_ARGS && *tax != NORMAL && *tax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown T axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *eax != CUSTOM && *eax != IMPLIED_BY_ARGS && *eax != NORMAL && *eax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown E axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *fax != CUSTOM && *fax != IMPLIED_BY_ARGS && *fax != NORMAL && *fax != ABSTRACT ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown F axis value passed to ef_set_axis_inheritance");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+
+   ef_ptr->internals_ptr->axis_will_be[0] = *xax;
+   ef_ptr->internals_ptr->axis_will_be[1] = *yax;
+   ef_ptr->internals_ptr->axis_will_be[2] = *zax;
+   ef_ptr->internals_ptr->axis_will_be[3] = *tax;
+   ef_ptr->internals_ptr->axis_will_be[4] = *eax;
+   ef_ptr->internals_ptr->axis_will_be[5] = *fax;
+}
+
diff --git a/fer/ef_utility/ef_set_axis_limits.c b/fer/ef_utility/ef_set_axis_limits.c
new file mode 100644
index 0000000..273a022
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_limits.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_axis_limits)(int *id_ptr, int *axis, int *lo, int *hi)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort(); 
+  }
+  ef_ptr->internals_ptr->axis[*axis-1].ss_lo = *lo;
+  ef_ptr->internals_ptr->axis[*axis-1].ss_hi = *hi;
+}
+
diff --git a/fer/ef_utility/ef_set_axis_reduction.c b/fer/ef_utility/ef_set_axis_reduction.c
new file mode 100644
index 0000000..185d24a
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_reduction.c
@@ -0,0 +1,14 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/* Calls the 6D version with RETAINED for the E and F axes */
+void FORTRAN(ef_set_axis_reduction)(int *id_ptr, int *xax, int *yax, int *zax, int *tax)
+{
+   int eax_val, fax_val;
+
+   eax_val = RETAINED;
+   fax_val = RETAINED;
+   FORTRAN(ef_set_axis_reduction_6d)(id_ptr, xax, yax, zax, tax, &eax_val, &fax_val);
+}
+
diff --git a/fer/ef_utility/ef_set_axis_reduction_6d.c b/fer/ef_utility/ef_set_axis_reduction_6d.c
new file mode 100644
index 0000000..42d4c67
--- /dev/null
+++ b/fer/ef_utility/ef_set_axis_reduction_6d.c
@@ -0,0 +1,54 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_axis_reduction_6d)(int *id_ptr, int *xax, int *yax, int *zax,
+                                                    int *tax, int *eax, int *fax)
+{
+   ExternalFunction *ef_ptr;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort(); 
+   }
+
+   if ( *xax != RETAINED && *xax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown X axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *yax != RETAINED && *yax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Y axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *zax != RETAINED && *zax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown Z axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *tax != RETAINED && *tax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown T axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *eax != RETAINED && *eax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown E axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   if ( *fax != RETAINED && *fax != REDUCED ) {
+      FORTRAN(ef_err_bail_out)(id_ptr, "Unknown F axis value passed to ef_set_axis_reduction");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+
+   ef_ptr->internals_ptr->axis_reduction[0] = *xax;
+   ef_ptr->internals_ptr->axis_reduction[1] = *yax;
+   ef_ptr->internals_ptr->axis_reduction[2] = *zax;
+   ef_ptr->internals_ptr->axis_reduction[3] = *tax;
+   ef_ptr->internals_ptr->axis_reduction[4] = *eax;
+   ef_ptr->internals_ptr->axis_reduction[5] = *fax;
+}
+
diff --git a/fer/ef_utility/ef_set_custom_axis.F b/fer/ef_utility/ef_set_custom_axis.F
new file mode 100644
index 0000000..848b3c7
--- /dev/null
+++ b/fer/ef_utility/ef_set_custom_axis.F
@@ -0,0 +1,82 @@
+c     
+c     ef_set_custom_axis.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine allows an external function to create
+c     a custom axis.
+c     
+
+      SUBROUTINE EF_SET_CUSTOM_AXIS(id, axis, lo, hi, del,
+     .     unit, modulo)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, axis, modulo
+      REAL*8    lo, hi, del
+      CHARACTER*(*) unit
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library to set the value
+      
+      llen = TM_LENSTR1( unit )
+      CALL TM_FTOC_STRNG( unit(:llen), fhol, slen )
+      CALL EF_SET_CUSTOM_AXIS_SUB( id, axis, lo, hi, del, 
+     .     fhol, modulo )
+      
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_custom_axis_sub.c b/fer/ef_utility/ef_set_custom_axis_sub.c
new file mode 100644
index 0000000..9a571eb
--- /dev/null
+++ b/fer/ef_utility/ef_set_custom_axis_sub.c
@@ -0,0 +1,23 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_custom_axis_sub)(int *id_ptr, int *axis_ptr, DFTYPE *lo_ptr,
+                    DFTYPE *hi_ptr, DFTYPE *del_ptr, char *text, int *modulo_ptr)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+
+  strcpy(ef_ptr->internals_ptr->axis[*axis_ptr-1].unit, text);
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_lo = *lo_ptr;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_hi = *hi_ptr;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_del = *del_ptr;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].modulo = *modulo_ptr;
+}  
+
diff --git a/fer/ef_utility/ef_set_desc.F b/fer/ef_utility/ef_set_desc.F
new file mode 100644
index 0000000..4012b09
--- /dev/null
+++ b/fer/ef_utility/ef_set_desc.F
@@ -0,0 +1,78 @@
+c     
+c     ef_set_desc.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine is called by code inside EF_ExternalUtil.c. It will
+c     initialize the context limits the EF will use.  
+c     
+
+      SUBROUTINE EF_SET_DESC(id, text)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id
+      CHARACTER*(*) text
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+      INTEGER TM_LENSTR1, llen
+      
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library routine to see if it is external
+      
+      llen = TM_LENSTR1( text )
+      CALL TM_FTOC_STRNG( text(:llen), fhol, slen )
+      CALL EF_SET_DESC_SUB( id, fhol )
+      
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_desc_sub.c b/fer/ef_utility/ef_set_desc_sub.c
new file mode 100644
index 0000000..2dbdc72
--- /dev/null
+++ b/fer/ef_utility/ef_set_desc_sub.c
@@ -0,0 +1,17 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_desc_sub)(int *id_ptr, char *text)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  strcpy(ef_ptr->internals_ptr->description, text);
+}  
+
diff --git a/fer/ef_utility/ef_set_freq_axis.F b/fer/ef_utility/ef_set_freq_axis.F
new file mode 100644
index 0000000..838fcf1
--- /dev/null
+++ b/fer/ef_utility/ef_set_freq_axis.F
@@ -0,0 +1,82 @@
+c     
+c     ef_set_freq_axis.F
+c     
+c     Ansley Manke
+c     June 2003
+c     
+c     
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c     
+c     This subroutine allows an external function to create
+c     a frequency axis from the # of points and boxsize.
+c     (based on ef_set_custom_axis)
+c     
+
+      SUBROUTINE EF_SET_FREQ_AXIS(id, axis, npts, box,
+     .     unit, modulo)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER id, axis, npts, modulo
+      REAL    box
+      CHARACTER*(*) unit
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_description )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+
+      INTEGER TM_LENSTR1, llen
+
+c     true string length
+c     convert to a null-terminated Hollerith
+c     call the external functions library to set the value
+
+      llen = TM_LENSTR1( unit )
+      CALL TM_FTOC_STRNG( unit(:llen), fhol, slen )
+      CALL EF_SET_FREQ_AXIS_SUB( id, axis, npts, box, 
+     .     fhol, modulo )
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_freq_axis_sub.c b/fer/ef_utility/ef_set_freq_axis_sub.c
new file mode 100644
index 0000000..da9302e
--- /dev/null
+++ b/fer/ef_utility/ef_set_freq_axis_sub.c
@@ -0,0 +1,30 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <string.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_freq_axis_sub)(int *id_ptr, int *axis_ptr, int *npts,
+                                   DFTYPE *box, char *text, int *modulo_ptr)
+{
+  ExternalFunction *ef_ptr;
+  double lo, hi, del, nfreq, yquist;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+
+  nfreq = *npts/2;	
+  yquist = 0.5* (1./ *box);		/* Nyquist frequency */
+  lo = yquist/ nfreq;
+  hi = yquist;
+  del = lo;
+
+  strcpy(ef_ptr->internals_ptr->axis[*axis_ptr-1].unit, text);
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_lo = lo;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_hi = hi;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].ww_del = del;
+  ef_ptr->internals_ptr->axis[*axis_ptr-1].modulo = *modulo_ptr;
+}  
+
diff --git a/fer/ef_utility/ef_set_has_vari_args.c b/fer/ef_utility/ef_set_has_vari_args.c
new file mode 100644
index 0000000..e674231
--- /dev/null
+++ b/fer/ef_utility/ef_set_has_vari_args.c
@@ -0,0 +1,19 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/*
+ * Set the "variable arguments" flag for a function.
+ */
+void ef_set_has_vari_args_(int *id_ptr, int *has_vari_args)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  ef_ptr->internals_ptr->has_vari_args = *has_vari_args;
+}
+
diff --git a/fer/ef_utility/ef_set_num_args.c b/fer/ef_utility/ef_set_num_args.c
new file mode 100644
index 0000000..189fb7b
--- /dev/null
+++ b/fer/ef_utility/ef_set_num_args.c
@@ -0,0 +1,29 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "EF_Util.h"
+
+/*
+ * Set the number of args for a function.
+ */
+void FORTRAN(ef_set_num_args)(int *id_ptr, int *num_args)
+{
+   ExternalFunction *ef_ptr;
+   static char err_msg[128];
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+   if ( *num_args > EF_MAX_ARGS ) {
+      sprintf(err_msg, "Number of arguments passed to ef_set_num_args (%d) "
+                       "is greater than the maximum (%d)",
+                       *num_args, EF_MAX_ARGS);
+      FORTRAN(ef_err_bail_out)(id_ptr, err_msg);
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+   ef_ptr->internals_ptr->num_reqd_args = *num_args;
+}
+
diff --git a/fer/ef_utility/ef_set_num_work_arrays.c b/fer/ef_utility/ef_set_num_work_arrays.c
new file mode 100644
index 0000000..38ef5c0
--- /dev/null
+++ b/fer/ef_utility/ef_set_num_work_arrays.c
@@ -0,0 +1,19 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/*
+ * Set the number of work arrays requested by a function.
+ */
+void FORTRAN(ef_set_num_work_arrays)(int *id_ptr, int *num_arrays)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  ef_ptr->internals_ptr->num_work_arrays = *num_arrays;
+}
+
diff --git a/fer/ef_utility/ef_set_piecemeal_ok.c b/fer/ef_utility/ef_set_piecemeal_ok.c
new file mode 100644
index 0000000..0b70420
--- /dev/null
+++ b/fer/ef_utility/ef_set_piecemeal_ok.c
@@ -0,0 +1,14 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/* Calls the 6D function with YES for the E and F axes */
+void FORTRAN(ef_set_piecemeal_ok)(int *id_ptr, int *xax, int *yax, int *zax, int *tax)
+{
+   int eax_val, fax_val;
+
+   eax_val = YES;
+   fax_val = YES;
+   FORTRAN(ef_set_piecemeal_ok_6d)(id_ptr, xax, yax, zax, tax, &eax_val, &fax_val);
+}
+
diff --git a/fer/ef_utility/ef_set_piecemeal_ok_6d.c b/fer/ef_utility/ef_set_piecemeal_ok_6d.c
new file mode 100644
index 0000000..e3c77d6
--- /dev/null
+++ b/fer/ef_utility/ef_set_piecemeal_ok_6d.c
@@ -0,0 +1,23 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_piecemeal_ok_6d)(int *id_ptr, int *xax, int *yax, int *zax,
+                                                  int *tax, int *eax, int *fax)
+{
+   ExternalFunction *ef_ptr;
+
+   ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+   if ( ef_ptr == NULL ) {
+      abort();
+   }
+
+   ef_ptr->internals_ptr->piecemeal_ok[0] = *xax;
+   ef_ptr->internals_ptr->piecemeal_ok[1] = *yax;
+   ef_ptr->internals_ptr->piecemeal_ok[2] = *zax;
+   ef_ptr->internals_ptr->piecemeal_ok[3] = *tax;
+   ef_ptr->internals_ptr->piecemeal_ok[4] = *eax;
+   ef_ptr->internals_ptr->piecemeal_ok[5] = *fax;
+}
+
diff --git a/fer/ef_utility/ef_set_real_to_string.F b/fer/ef_utility/ef_set_real_to_string.F
new file mode 100644
index 0000000..e7d7995
--- /dev/null
+++ b/fer/ef_utility/ef_set_real_to_string.F
@@ -0,0 +1,71 @@
+c*
+c* ef_set_real_to_string.F
+c*
+c* Ansley Manke
+c* June 2002
+c*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c* This subroutine is called by an external function and formats a real
+c* number as a string.  Calls internal Ferret routine tm_fmt.
+
+
+* calling arguments:
+* val		- REAL*4 value to be converted
+* digits	- IF >0 maximum number of significant digits desired
+*	        - ELSE  maximum number of decimal places desired
+* max_len	- longest allowable length for string to be returned
+* str_len	- (returned) actual length of the string generated
+* outstring     - output string
+
+      SUBROUTINE EF_SET_REAL_TO_STRING( val, str_len, outstring )
+
+      IMPLICIT NONE
+      REAL val
+      INTEGER str_len
+      CHARACTER*(*) outstring
+
+      CHARACTER*8 TM_FMT
+
+* internal declarations
+
+      INTEGER digits, max_len
+
+      digits = 8
+      max_len = 8
+
+      outstring = TM_FMT(val, digits, max_len, str_len)
+
+      RETURN 
+      END
diff --git a/fer/ef_utility/ef_set_result_type.c b/fer/ef_utility/ef_set_result_type.c
new file mode 100644
index 0000000..6b27184
--- /dev/null
+++ b/fer/ef_utility/ef_set_result_type.c
@@ -0,0 +1,16 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+void FORTRAN(ef_set_result_type)(int *id_ptr, int *type)
+{
+  ExternalFunction *ef_ptr;
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+  ef_ptr->internals_ptr->return_type = *type;
+}  
+
diff --git a/fer/ef_utility/ef_set_work_array_dims.c b/fer/ef_utility/ef_set_work_array_dims.c
new file mode 100644
index 0000000..c8ef2f5
--- /dev/null
+++ b/fer/ef_utility/ef_set_work_array_dims.c
@@ -0,0 +1,20 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/* Calls the 6D function with 1 for the low and high dimensions of the E and F axes */
+void FORTRAN(ef_set_work_array_dims)(int *id_ptr, int *iarray, 
+                         int *xlo, int *ylo, int *zlo, int *tlo,
+                         int *xhi, int *yhi, int *zhi, int *thi)
+{
+   int elo, ehi, flo, fhi;
+
+   elo = 1;
+   ehi = 1;
+   flo = 1;
+   fhi = 1;
+   FORTRAN(ef_set_work_array_dims_6d)(id_ptr, iarray, 
+                                      xlo, ylo, zlo, tlo, &elo, &flo,
+                                      xhi, yhi, zhi, thi, &ehi, &fhi);
+}
+
diff --git a/fer/ef_utility/ef_set_work_array_dims_6d.c b/fer/ef_utility/ef_set_work_array_dims_6d.c
new file mode 100644
index 0000000..a235c79
--- /dev/null
+++ b/fer/ef_utility/ef_set_work_array_dims_6d.c
@@ -0,0 +1,35 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/*
+ * Set the requested lo and hi dimensions for a specific work array.
+ */
+void FORTRAN(ef_set_work_array_dims_6d)(int *id_ptr, int *iarray, 
+             int *xlo, int *ylo, int *zlo, int *tlo, int *elo, int *flo,
+             int *xhi, int *yhi, int *zhi, int *thi, int *ehi, int *fhi)
+{
+  ExternalFunction *ef_ptr;
+  int array_id = *iarray - 1;      /* F to C conversion */
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+
+  ef_ptr->internals_ptr->work_array_lo[array_id][0] = *xlo;
+  ef_ptr->internals_ptr->work_array_lo[array_id][1] = *ylo;
+  ef_ptr->internals_ptr->work_array_lo[array_id][2] = *zlo;
+  ef_ptr->internals_ptr->work_array_lo[array_id][3] = *tlo;
+  ef_ptr->internals_ptr->work_array_lo[array_id][4] = *elo;
+  ef_ptr->internals_ptr->work_array_lo[array_id][5] = *flo;
+
+  ef_ptr->internals_ptr->work_array_hi[array_id][0] = *xhi;
+  ef_ptr->internals_ptr->work_array_hi[array_id][1] = *yhi;
+  ef_ptr->internals_ptr->work_array_hi[array_id][2] = *zhi;
+  ef_ptr->internals_ptr->work_array_hi[array_id][3] = *thi;
+  ef_ptr->internals_ptr->work_array_hi[array_id][4] = *ehi;
+  ef_ptr->internals_ptr->work_array_hi[array_id][5] = *fhi;
+}
+
diff --git a/fer/ef_utility/ef_set_work_array_lens.c b/fer/ef_utility/ef_set_work_array_lens.c
new file mode 100644
index 0000000..349b99c
--- /dev/null
+++ b/fer/ef_utility/ef_set_work_array_lens.c
@@ -0,0 +1,20 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include "EF_Util.h"
+
+/*
+ * Set the requested size (in words) for a specific work array.
+ * Calls the 6D function with 1 for the length of the E and F axes.
+ */
+void FORTRAN(ef_set_work_array_lens)(int *id_ptr, int *iarray,
+                    int *xlen, int *ylen, int *zlen, int *tlen)
+{
+   int elen, flen;
+
+   elen = 1;
+   flen = 1;
+   FORTRAN(ef_set_work_array_lens_6d)(id_ptr, iarray,
+                                      xlen, ylen, zlen,
+                                      tlen, &elen, &flen);
+}
+
diff --git a/fer/ef_utility/ef_set_work_array_lens_6d.c b/fer/ef_utility/ef_set_work_array_lens_6d.c
new file mode 100644
index 0000000..45c1253
--- /dev/null
+++ b/fer/ef_utility/ef_set_work_array_lens_6d.c
@@ -0,0 +1,35 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include "EF_Util.h"
+
+/*
+ * Set the requested size (in words) for a specific work array.
+ */
+void FORTRAN(ef_set_work_array_lens_6d)(int *id_ptr, int *iarray,
+                                        int *xlen, int *ylen, int *zlen,
+                                        int *tlen, int *elen, int *flen)
+{
+  ExternalFunction *ef_ptr;
+  int array_id = *iarray - 1;      /* F to C conversion */
+
+  ef_ptr = ef_ptr_from_id_ptr(id_ptr);
+  if ( ef_ptr == NULL ) {
+     abort();
+  }
+
+  ef_ptr->internals_ptr->work_array_lo[array_id][0] = 1;
+  ef_ptr->internals_ptr->work_array_lo[array_id][1] = 1;
+  ef_ptr->internals_ptr->work_array_lo[array_id][2] = 1;
+  ef_ptr->internals_ptr->work_array_lo[array_id][3] = 1;
+  ef_ptr->internals_ptr->work_array_lo[array_id][4] = 1;
+  ef_ptr->internals_ptr->work_array_lo[array_id][5] = 1;
+
+  ef_ptr->internals_ptr->work_array_hi[array_id][0] = *xlen;
+  ef_ptr->internals_ptr->work_array_hi[array_id][1] = *ylen;
+  ef_ptr->internals_ptr->work_array_hi[array_id][2] = *zlen;
+  ef_ptr->internals_ptr->work_array_hi[array_id][3] = *tlen;
+  ef_ptr->internals_ptr->work_array_hi[array_id][4] = *elen;
+  ef_ptr->internals_ptr->work_array_hi[array_id][5] = *flen;
+}
+
diff --git a/fer/ef_utility/ef_version_test.c b/fer/ef_utility/ef_version_test.c
new file mode 100644
index 0000000..12d58d8
--- /dev/null
+++ b/fer/ef_utility/ef_version_test.c
@@ -0,0 +1,34 @@
+/* Make sure Python.h is included first */
+#include <Python.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "EF_Util.h"
+
+/*
+ * Test the EF version number of the Fortran EF against
+ * the EF version number of the Ferret code.
+ */
+void FORTRAN(ef_version_test)(DFTYPE *version)
+{
+   int id;
+   int int_version, ext_version;
+
+   int_version = (int) (EF_VERSION * 100.0 + 0.5);
+   ext_version = (int) (*version * 100.0 + 0.5);
+
+   if ( ext_version != int_version ) {
+      fprintf(stderr, "**ERROR version mismatch:\n"
+                      "        External version [%4.2f] does not match \n"
+                      "        Ferret version   [%4.2f].\n"
+                      "        Please upgrade either Ferret or the\n"
+                      "        External Function support files from\n"
+                      "            http://tmap.pmel.noaa.gov/Ferret/\n\n",
+                      *version, EF_VERSION);
+      /* Do not know the id, so use -1 to skip getting the function name */
+      id = -1;
+      FORTRAN(ef_err_bail_out)(&id, "External function version number mismatch");
+      /* The C function ef_err_bail_out should not return */
+      abort();
+   }
+}
+
diff --git a/fer/efi/LIB_NAME b/fer/efi/LIB_NAME
new file mode 100644
index 0000000..201f6de
--- /dev/null
+++ b/fer/efi/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libefi.a
+
diff --git a/fer/efi/Makefile b/fer/efi/Makefile
new file mode 100644
index 0000000..17789a5
--- /dev/null
+++ b/fer/efi/Makefile
@@ -0,0 +1,40 @@
+#
+#  Note that these functions must be declared in ../ccr/EF_InternalUtil.c
+#
+
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/efi/SOURCE_FILES b/fer/efi/SOURCE_FILES
new file mode 100644
index 0000000..9cfa530
--- /dev/null
+++ b/fer/efi/SOURCE_FILES
@@ -0,0 +1,187 @@
+SRCS_F = \
+ave_scat2grid_t.F\
+bin_index_wt.F\
+compressi.F\
+compressj.F\
+compressk.F\
+compressl.F\
+compressm.F\
+compressn.F\
+compressi_by.F\
+compressj_by.F\
+compressk_by.F\
+compressl_by.F\
+compressm_by.F\
+compressn_by.F\
+convolvei.F\
+convolvej.F\
+convolvek.F\
+convolvel.F\
+convolvem.F\
+convolven.F\
+copyscat.F\
+curv_range.F\
+curv_to_rect.F\
+curv_to_rect_map.F\
+day_of_year.F\
+date1900.F\
+days1900toymdhms.F\
+ecat.F\
+ecat_str.F\
+element_index.F\
+element_index_str.F\
+element_index_str_n.F\
+eof_space.F\
+eof_stat.F\
+eof_tfunc.F\
+eofsubs.F\
+eofsvd_space.F\
+eofsvd_stat.F\
+eofsvd_tfunc.F\
+ereverse.F\
+expnd_by_len.F\
+expnd_by_len_str.F\
+expndi_by.F\
+expndi_by_t.F\
+expndi_by_z.F\
+expndi_by_z_counts.F\
+expndi_id_by_z_counts.F\
+fc_isubset.F\
+fcat.F\
+fcat_str.F\
+fftsubs.F\
+ffta.F\
+fftp.F\
+fft_im.F\
+fft_inverse.F\
+fftinv_subs.F\
+fft_re.F\
+fill_xy.F\
+findhi.F\
+findlo.F\
+floatstr.F\
+flag2ddups.F\
+freverse.F\
+gausswt.F\
+gausswt_v0.F\
+heap2_str.F\
+is_element_of.F\
+is_element_of_str.F\
+is_element_of_str_n.F\
+labwid.F\
+lanczos.F\
+list_value_xml.F\
+lsl_lowpass.F\
+maxminmax.F\
+minmax.F\
+minminmax.F\
+minutes24.F\
+modscat.F\
+mrgrnk.F\
+nco_attr.F\
+nco.F\
+nobad.F\
+pickindex.F\
+pt_in_poly.F\
+rect_to_curv.F\
+sampleij.F\
+samplei_multi.F\
+samplej_multi.F\
+samplek_multi.F\
+samplel_multi.F\
+samplet_date.F\
+samplexy.F\
+samplexy_closest.F\
+samplexy_curv.F\
+samplexy_curv_avg.F\
+samplexy_curv_nrst.F\
+samplexyt.F\
+samplexyt_nrst.F\
+samplexz.F\
+sampleyz.F\
+scat2ddups.F\
+scat2grid_bin_xy.F\
+scat2grid_bin_xyt.F\
+scat2grid_nbin_xy.F\
+scat2grid_nbin_xyt.F\
+scat2gridgauss_xt.F\
+scat2gridgauss_xy.F\
+scat2gridgauss_xz.F\
+scat2gridgauss_yt.F\
+scat2gridgauss_yz.F\
+scat2gridgauss_zt.F\
+scat2gridgauss_xt_v0.F\
+scat2gridgauss_xy_v0.F\
+scat2gridgauss_xz_v0.F\
+scat2gridgauss_yt_v0.F\
+scat2gridgauss_yz_v0.F\
+scat2gridgauss_zt_v0.F\
+scat2gridlaplace_xy.F\
+scat2gridlaplace_xz.F\
+scat2gridlaplace_yz.F\
+scat2gridlaplace_xt.F\
+scat2gridlaplace_yt.F\
+scat2gridlaplace_zt.F\
+scat2grid_t.F\
+scat2grid_nobs_xy.F\
+scat2grid_nobs_xyt.F\
+scat2grid_subs.F\
+secs_to_ymdhms.F\
+sorti.F\
+sorti_str.F\
+sortj.F\
+sortj_str.F\
+sortk.F\
+sortk_str.F\
+sortl.F\
+sortl_str.F\
+sortm.F\
+sortm_str.F\
+sortn.F\
+sortn_str.F\
+str_mask.F\
+svdeof-4.F\
+tauto_cor.F\
+tax_datestring.F\
+tax_day.F\
+tax_dayfrac.F\
+tax_jday1900.F\
+tax_jday.F\
+tax_month.F\
+tax_times.F\
+tax_subs.F\
+tax_tstep.F\
+tax_units.F\
+tax_year.F\
+tax_yearfrac.F\
+tcat.F\
+tcat_str.F\
+test_opendap.F\
+transpose_xt.F\
+transpose_xy.F\
+transpose_xz.F\
+transpose_yt.F\
+transpose_yz.F\
+transpose_zt.F\
+treverse.F\
+unique_str2int.F\
+write_webrow.F\
+xauto_cor.F\
+xcat.F\
+xcat_str.F\
+xreverse.F\
+ycat.F\
+ycat_str.F\
+yreverse.F\
+zaxreplace_avg.F\
+zaxreplace_bin.F\
+zaxreplace_rev.F\
+zaxreplace_zlev.F\
+zcat.F\
+zcat_str.F\
+zreverse.F\
+zgrid_laplace.F
+SRCS_C = \
+date_decode.c\
+time_decode.c\
+us2i_compare_string_list.c
diff --git a/fer/efi/ave_scat2grid_t.F b/fer/efi/ave_scat2grid_t.F
new file mode 100644
index 0000000..171ceba
--- /dev/null
+++ b/fer/efi/ave_scat2grid_t.F
@@ -0,0 +1,402 @@
+*
+*  ave_scat2grid_t.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Sep 2004
+
+* Inputs are a set of T coordinates and a variable on an abstract axis, and an 
+* output time axis. Returns a time series which is the average of the variable, 
+* based on the number of points that fall inside of each T cell. 
+* From scat2grid_t.F
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE  ave_scat2grid_t_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Compute average of a variable in each cell of output time axis')
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, IMPLIED_BY_ARGS,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+* output grid is determined by argument 3. 
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'T coordinates of scattered input time coordinates')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VPTS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Variable at times in TPTS')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TAXIS')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'Output time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ave_scat2grid_t_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ntout, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3)
+
+* doubled in case REAL is REAL*4
+      nt2 = 2 * ntout
+
+* taxlo  output t axis box lower limits
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* taxhi  output t axis box upper limits
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* counts 
+      CALL ef_set_work_array_dims_6d(id, 3, 
+     .                                1, 1, 1, 1, 1, 1,
+     .                            ntout, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE ave_scat2grid_t_compute(id, arg_1, arg_2, arg_3,
+     .                               result, taxlo, taxhi, counts)
+
+*  arg_1  tpts  Scattered t values to be gridded.
+*  arg_2  vpts  Scattered fcn values to be gridded.
+*  arg_3  taxis to use for output
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 taxlo(wrk1lox:wrk1hix/2)
+      REAL*8 taxhi(wrk2lox:wrk2hix/2)
+      REAL counts(wrk3lox:wrk3hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss, l1
+      INTEGER ntpts, nvpts, ntgrid
+      REAL tt, vv
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulot
+      REAL*8 modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG3, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG3, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining
+*  the scattered data points may lie on any axis of the input argument.
+*  Using as flattened arrays, so consider all axes.
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+* Check that arguments 1 and 2 have the same number of values
+
+      nvpts = 0
+      DO 80 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nvpts .NE. 0 ) THEN
+               nvpts = nvpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nvpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  80  CONTINUE
+
+      IF ( nvpts .NE. ntpts ) THEN
+         errtxt = 'TPTS and VPTS have different number of values'
+         GOTO 999
+      ENDIF
+      IF ( nvpts .EQ. 0 ) THEN
+         errtxt = 'No data in TPTS and VPTS'
+         GOTO 999
+      ENDIF
+
+*  Check tax is a T axis
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG3)
+      hi_ss = arg_hi_ss(T_AXIS,ARG3)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Third argument must be a T axis'
+         GO TO 999
+      ENDIF
+      ntgrid = hi_ss - lo_ss + 1
+
+*  Get cell boundaries
+
+      CALL ef_get_box_limits(id, ARG3, T_AXIS, arg_lo_ss(T_AXIS, ARG3),
+     .                       arg_hi_ss(T_AXIS, ARG3), taxlo, taxhi)
+
+*  Compute result
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize result
+
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         result(i,j,k,l,m,n) = 0.
+      ENDDO
+
+*  Initialize counts
+
+      DO l1 = 1, ntgrid
+         counts(l1) = 0.
+      ENDDO
+
+*  Loop over input tpts
+
+      DO 700 idx = 1, ntpts
+
+         CALL pickout2(arg_1, arg_2, idx, tt, vv)
+         IF ( tt .EQ. bad_flag(ARG1) .OR. vv .EQ. bad_flag(ARG2) ) THEN
+            GOTO 700
+         ENDIF
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulot ) THEN
+            CALL modscat(taxlo(1), taxhi(ntgrid), modtlen, 1, tt)
+         ENDIF
+
+         l1 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            IF ( tt .GE. taxlo(l1) .AND. tt .LE. taxhi(l1) ) THEN
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + vv
+               counts(l1) = counts(l1) + 1.0
+*              Location found and point assigned; go to the next scatter point
+               GOTO 700
+            ENDIF
+
+            l1 = l1 + 1
+ 400     CONTINUE
+
+ 700  CONTINUE
+
+* Compute average
+
+      l1 = 1
+      DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         IF ( counts(l1) .GT. 0.0 ) THEN
+           result(i,j,k,l,m,n) = result(i,j,k,l,m,n) / counts(l1)
+         ELSE
+           result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         l1 = l1 + 1
+ 410  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/bin_index_wt.F b/fer/efi/bin_index_wt.F
new file mode 100644
index 0000000..2fe857b
--- /dev/null
+++ b/fer/efi/bin_index_wt.F
@@ -0,0 +1,221 @@
+*
+* bin_index_wt.F
+*
+* Ansley Manke
+* October 2002
+*
+* This function sorts the indicies, and gathers them into bins, along
+* with their associated weights.  Returns the weights for each bin, 
+* followed by missing-data after the last bin.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE bin_index_wt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, gathered into bins on the X axis')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id, ABSTRACT, NORMAL, NORMAL,
+     .                                    NORMAL,   NORMAL, NORMAL)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'INDEX')
+      CALL ef_set_arg_desc(id, arg, 'Bin indices: sorted, 1D on x axis')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WT')
+      CALL ef_set_arg_desc(id, arg, 'Weight for with each index')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'INDXMAX')
+      CALL ef_set_arg_desc(id, arg, 'Maximum index value')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE bin_index_wt_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_one_val(id, ARG3, size)
+
+      my_lo_l = 1
+      my_hi_l = INT(size + 1)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE bin_index_wt_compute(id, arg_1, arg_2, arg_3, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+          result(i,j,k,l,m,n) = 0.0
+  100 CONTINUE
+
+      ndx = res_lo_ss(X_AXIS)
+      DO 200 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+          IF (INT(arg_1(i1,j1,k1,l1,m1,n1)) .EQ. ndx) THEN
+              result(ndx,j,k,l,m,n) = result(ndx,j, k, l, m, n) +
+     .                                 arg_2(i1, j1,k1,l1,m1,n1)
+          ELSEIF (  INT(arg_1(i1,j1,k1,l1,m1,n1)) .GT. 0) THEN
+              ndx = INT(arg_1(i1,j1,k1,l1,m1,n1))
+              result(ndx,j,k,l,m,n) = arg_2(i1,j1,k1,l1,m1,n1)
+          ENDIF
+  200 CONTINUE
+
+      DO 300 i = ndx+1, res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+  300 CONTINUE
+      
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressi.F b/fer/efi/compressi.F
new file mode 100644
index 0000000..d30bcc3
--- /dev/null
+++ b/fer/efi/compressi.F
@@ -0,0 +1,293 @@
+*
+* compressi.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on I axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressi_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the I axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in I')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressi_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressi_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS, ARG1)
+                  DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     nsrt = 0
+                     nbad = 0
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                        IF ( arg_1(i1,j1,k1,l1,m1,n1)
+     .                               .NE. bad_flag(1) ) THEN
+                           nsrt = nsrt + 1
+                           result(nsrt,j,k,l,m,n) =
+     .                               arg_1(i1,j1,k1,l1,m1,n1)
+                        ELSE
+                           nbad = nbad + 1
+                        ENDIF
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100                 CONTINUE
+
+*
+* Compress argument, putting bad data at the end.
+*
+                     DO 150 ndx = 1, nbad
+                        nsrt = nsrt + 1
+                        result(nsrt,j,k,l,m,n) = bad_flag_result
+ 150                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressi_by.F b/fer/efi/compressi_by.F
new file mode 100644
index 0000000..c8eb377
--- /dev/null
+++ b/fer/efi/compressi_by.F
@@ -0,0 +1,305 @@
+* 
+*  compressi_by.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  Steve Hankin
+*  12/27/2000
+*   7/ 9/2004 *acm* add disclaimer text
+* 
+*  Compress argument 1 along axis I by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressi_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Compress arg1 by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on I axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compression (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressi_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_i, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_i = arg_hi_ss(X_AXIS,1) - arg_lo_ss(X_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(X_AXIS,2) - arg_lo_ss(X_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi_i ) my_hi_i = lmsk
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi_i)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressi_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, ilo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      ilo = res_lo_ss(X_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=ilo, res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  k1 = arg_lo_ss(Z_AXIS,ARG1)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                     nout = 0
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     i2 = arg_lo_ss(X_AXIS,ARG2)
+                     DO 100 i=ilo, res_hi_ss(X_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n2)
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(ilo+nout,j,k,l,m,n) =
+     .                                   bad_flag_result
+                           ELSE
+                              result(ilo+nout,j,k,l,m,n) =
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           ENDIF
+                           nout = nout + 1
+                        ENDIF
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+                        i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/compressj.F b/fer/efi/compressj.F
new file mode 100644
index 0000000..4709788
--- /dev/null
+++ b/fer/efi/compressj.F
@@ -0,0 +1,292 @@
+*
+* compressj.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on J axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressj_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the J axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT, 
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in J')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressj_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressj_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS, ARG1)
+                  DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nsrt = 0
+                     nbad = 0
+
+                     j1 = arg_lo_ss(Y_AXIS,ARG1)
+                     DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                        IF ( arg_1(i1,j1,k1,l1,m1,n1)
+     .                               .NE. bad_flag(1) ) THEN
+                           nsrt = nsrt + 1
+                           result(i,nsrt,k,l,m,n) = 
+     .                               arg_1(i1,j1,k1,l1,m1,n1)
+                        ELSE
+                           nbad = nbad + 1
+                        ENDIF
+
+                        j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 100                 CONTINUE
+      
+*
+* Compress argument, putting bad data at the end.
+*
+                     DO 150 ndx = 1, nbad
+                        nsrt = nsrt + 1
+                        result(i,nsrt,k,l,m,n) = bad_flag_result
+ 150                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressj_by.F b/fer/efi/compressj_by.F
new file mode 100644
index 0000000..923f77c
--- /dev/null
+++ b/fer/efi/compressj_by.F
@@ -0,0 +1,305 @@
+* 
+*  compressj_by.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  Steve Hankin
+*  12/27/2000
+*   7/ 9/2004 *acm* add disclaimer text
+*
+* 
+*  Compress argument 1 along axis J by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressj_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Compress arg1 by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT, 
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on J axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compression (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressj_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_j, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_j = arg_hi_ss(Y_AXIS,1) - arg_lo_ss(Y_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(Y_AXIS,2) - arg_lo_ss(Y_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi_j ) my_hi_j = lmsk
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, my_hi_j)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressj_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, jlo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      jlo = res_lo_ss(Y_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each J-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 j=jlo, res_hi_ss(Y_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  DO 200 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nout = 0
+                     j1 = arg_lo_ss(Y_AXIS,ARG1)
+                     j2 = arg_lo_ss(Y_AXIS,ARG2)
+                     DO 100 j=jlo, res_hi_ss(Y_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n1)
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(i,jlo+nout,k,l,m,n) =
+     .                                   bad_flag_result
+                           ELSE
+                              result(i,jlo+nout,k,l,m,n) =
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           END IF
+                           nout = nout + 1
+                        ENDIF
+
+                        j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                        j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/compressk.F b/fer/efi/compressk.F
new file mode 100644
index 0000000..2da1b8c
--- /dev/null
+++ b/fer/efi/compressk.F
@@ -0,0 +1,291 @@
+*
+* compressk.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on K axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressk_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the K axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in K')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressk_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(Z_AXIS,arg) - arg_lo_ss(Z_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressk_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS, ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS, ARG1)
+               DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS, ARG1)
+                  DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nsrt = 0
+                     nbad = 0
+
+                     k1 = arg_lo_ss(Z_AXIS,ARG1)
+                     DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                        IF ( arg_1(i1,j1,k1,l1,m1,n1)
+     .                               .NE. bad_flag(1) ) THEN
+                           nsrt = nsrt + 1
+                           result(i,j,nsrt,l,m,n) = 
+     .                               arg_1(i1,j1,k1,l1,m1,n1)
+                        ELSE
+                           nbad = nbad + 1
+                        ENDIF
+
+                        k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 100                 CONTINUE
+
+*
+* Compress argument, putting bad data at the end.
+*
+                     DO 150 ndx = 1, nbad
+                        nsrt = nsrt + 1
+                        result(i,j,nsrt,l,m,n) = bad_flag_result
+ 150                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressk_by.F b/fer/efi/compressk_by.F
new file mode 100644
index 0000000..4e678b5
--- /dev/null
+++ b/fer/efi/compressk_by.F
@@ -0,0 +1,309 @@
+* 
+*  compressk_by.F
+* 
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  Steve Hankin
+*  12/27/2000
+*
+*   7/ 9/2004 *acm* Bug fix: before end of loop 400 the wrong indices were 
+*                   incremented. Also add disclaimer
+* 
+*  Compress argument 1 along axis K by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressk_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Compress arg1 by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on K axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compression (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressk_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_k, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_k = arg_hi_ss(Z_AXIS,1) - arg_lo_ss(Z_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(Z_AXIS,2) - arg_lo_ss(Z_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi_k ) my_hi_k = lmsk
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, my_hi_k)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressk_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, klo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      klo = res_lo_ss(Z_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each K-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 k=klo, res_hi_ss(Z_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  DO 200 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nout = 0
+                     k1 = arg_lo_ss(Z_AXIS,ARG1)
+                     k2 = arg_lo_ss(Z_AXIS,ARG2)
+                     DO 100 k=klo, res_hi_ss(Z_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n1) 
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(i,j,klo+nout,l,m,n) = 
+     .                                   bad_flag_result
+                           ELSE
+                              result(i,j,klo+nout,l,m,n) = 
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           END IF
+                           nout = nout + 1
+                        ENDIF
+
+                        k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                        k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/compressl.F b/fer/efi/compressl.F
new file mode 100644
index 0000000..d2b5613
--- /dev/null
+++ b/fer/efi/compressl.F
@@ -0,0 +1,290 @@
+*
+* compressl.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* August 1998
+*
+* This function compresses data on L axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressl_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the L axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in L')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressl_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressl_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS, ARG1)
+            DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS, ARG1)
+               DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS, ARG1)
+                  DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nsrt = 0
+                     nbad = 0
+
+                     l1 = arg_lo_ss(T_AXIS, ARG1)
+                     DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                        IF ( arg_1(i1,j1,k1,l1,m1,n1)
+     .                               .NE. bad_flag(1) ) THEN
+                           nsrt = nsrt + 1
+                           result(i,j,k,nsrt,m,n) = 
+     .                               arg_1(i1,j1,k1,l1,m1,n1)
+                        ELSE
+                           nbad = nbad + 1
+                        ENDIF
+
+                        l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100                 CONTINUE
+
+*
+* Compress argument, putting bad data at the end.
+*
+                     DO 150 ndx = 1, nbad
+                        nsrt = nsrt + 1
+                        result(i,j,k,nsrt,m,n) = bad_flag_result
+ 150                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 300           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressl_by.F b/fer/efi/compressl_by.F
new file mode 100644
index 0000000..70572f2
--- /dev/null
+++ b/fer/efi/compressl_by.F
@@ -0,0 +1,306 @@
+* 
+*  compressl_by.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  Steve Hankin
+*  12/27/2000
+*   7/ 9/2004 *acm* add disclaimer text
+* 
+* 
+*  Compress argument 1 along axis L by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressl_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,'Compress arg1 by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on L axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compression (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressl_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi_l, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi_l = arg_hi_ss(T_AXIS,1) - arg_lo_ss(T_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(T_AXIS,2) - arg_lo_ss(T_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi_l ) my_hi_l = lmsk
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressl_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, llo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      llo = res_lo_ss(T_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each L-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=llo, res_hi_ss(T_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 400 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  DO 200 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nout = 0
+                     l1 = arg_lo_ss(T_AXIS,ARG1)
+                     l2 = arg_lo_ss(T_AXIS,ARG2)
+                     DO 100 l=llo, res_hi_ss(T_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n1) 
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(i,j,k,llo+nout,m,n) = 
+     .                                   bad_flag_result
+                           ELSE
+                              result(i,j,k,llo+nout,m,n) = 
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           ENDIF
+                           nout = nout + 1
+                        ENDIF
+
+                        l1 = l1 + arg_incr(T_AXIS,ARG1)
+                        l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/compressm.F b/fer/efi/compressm.F
new file mode 100644
index 0000000..de5456a
--- /dev/null
+++ b/fer/efi/compressm.F
@@ -0,0 +1,291 @@
+*
+* compressm.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Ansley Manke
+* May 2012
+*
+* This function compresses data on M axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressm_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the M axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in M')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressm_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(E_AXIS,arg) - arg_lo_ss(E_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, E_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressm_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         nsrt = 0
+         nbad = 0
+
+         m1 = arg_lo_ss(E_AXIS, ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) THEN
+               nsrt = nsrt + 1
+               result(i,j,k,l,nsrt,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ELSE
+               nbad = nbad + 1
+            ENDIF
+
+
+            m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500     CONTINUE
+
+* Compress argument, putting bad data at the end.
+*
+         DO 550 ndx = 1, nbad
+            nsrt = nsrt + 1
+            result(i,j,k,l,nsrt,n) = bad_flag_result
+ 550     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressm_by.F b/fer/efi/compressm_by.F
new file mode 100644
index 0000000..9b4136c
--- /dev/null
+++ b/fer/efi/compressm_by.F
@@ -0,0 +1,309 @@
+* 
+*  compressm_by.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  
+* Ansley Manke
+* May 2012
+*
+* 
+*  Compress argument 1 along axis M by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressm_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .     'Compress arg1 in M by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on M axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compressmon (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressm_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi = arg_hi_ss(E_AXIS,1) - arg_lo_ss(E_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(E_AXIS,2) - arg_lo_ss(E_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi ) my_hi = lmsk
+
+      CALL ef_set_axis_limits(id, E_AXIS, 1, my_hi)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressm_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, mlo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      mlo = res_lo_ss(E_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each M-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  k1 = arg_lo_ss(Z_AXIS,ARG1)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     i2 = arg_lo_ss(X_AXIS,ARG2)
+                     DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nout = 0
+
+                     m1 = arg_lo_ss(E_AXIS,ARG1)
+                     m2 = arg_lo_ss(E_AXIS,ARG2)
+                     DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n2)
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(i,j,k,l,mlo+nout,n) =
+     .                                   bad_flag_result
+                           ELSE
+                              result(i,j,k,l,mlo+nout,n) =
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           ENDIF
+                           nout = nout + 1
+                        ENDIF
+
+                     m1 = m1 + arg_incr(E_AXIS,ARG1)
+                     m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500                 CONTINUE
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+                        i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/compressn.F b/fer/efi/compressn.F
new file mode 100644
index 0000000..e61df42
--- /dev/null
+++ b/fer/efi/compressn.F
@@ -0,0 +1,290 @@
+*
+* compressn.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Ansley Manke
+* May 2012
+*
+* This function compresses data on N axis, ending with missing data.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  COMPRESSL(v). THE EXPRESSION
+*  	LIST/L=6:10 COMPRESSL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST COMPRESSL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH COMPRESSED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM COMPRESSING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressn_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data, compressed along the N axis: Missing ',
+     .        'points moved to the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress in N')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressn_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo_l = 1
+      my_hi_l = 1
+
+      arg = 1
+
+      my_hi_l = arg_hi_ss(F_AXIS,arg) - arg_lo_ss(F_AXIS,arg) + 1
+
+
+      CALL ef_set_axis_limits(id, F_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE compressn_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx, nsrt, nbad
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  Get subscript ranges
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         nsrt = 0
+         nbad = 0
+
+         n1 = arg_lo_ss(F_AXIS, ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) THEN
+               nsrt = nsrt + 1
+               result(i,j,k,l,m,nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+            ELSE
+               nbad = nbad + 1
+            ENDIF
+
+            n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600     CONTINUE
+
+* Compress argument, putting bad data at the end.
+*
+         DO 650 ndx = 1, nbad
+            nsrt = nsrt + 1
+            result(i,j,k,l,m,nsrt) = bad_flag_result
+ 650     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/compressn_by.F b/fer/efi/compressn_by.F
new file mode 100644
index 0000000..5b3ceaa
--- /dev/null
+++ b/fer/efi/compressn_by.F
@@ -0,0 +1,310 @@
+* 
+*  compressn_by.F
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  
+* Ansley Manke
+* May 2012
+*
+* 
+*  Compress argument 1 along axis N by the mask given in argument 2
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE compressn_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .     'Compress arg1 in N by (multi-D) mask in arg 2' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS,        ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to compress on N axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding compressnon (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE compressn_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi, lmsk
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_hi = arg_hi_ss(F_AXIS,1) - arg_lo_ss(F_AXIS,1) + 1
+
+      lmsk    = arg_hi_ss(F_AXIS,2) - arg_lo_ss(F_AXIS,2) + 1
+      IF ( lmsk .LT. my_hi ) my_hi = lmsk
+
+      CALL ef_set_axis_limits(id, F_AXIS, 1, my_hi)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE compressn_by_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER nout, nlo
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nlo = res_lo_ss(F_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each M-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 10      result(i,j,k,l,m,n) = bad_flag_result
+
+* fill in the points as specified by the mask
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  k1 = arg_lo_ss(Z_AXIS,ARG1)
+                  k2 = arg_lo_ss(Z_AXIS,ARG2)
+                  DO 200 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     i2 = arg_lo_ss(X_AXIS,ARG2)
+                     DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                     nout = 0
+
+                     n1 = arg_lo_ss(F_AXIS,ARG1)
+                     n2 = arg_lo_ss(F_AXIS,ARG2)
+                     DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                                   .NE. bad_flag(2) ) THEN
+                           IF ( arg_1(i1,j1,k1,l1,m1,n2)
+     .                                   .EQ. bad_flag(1) ) THEN
+                              result(i,j,k,l,m,nlo+nout) =
+     .                                   bad_flag_result
+                           ELSE
+                              result(i,j,k,l,m,nlo+nout) =
+     .                                   arg_1(i1,j1,k1,l1,m1,n1)
+                           ENDIF
+                           nout = nout + 1
+                        ENDIF
+
+                        n1 = n1 + arg_incr(F_AXIS,ARG1)
+                        n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600                 CONTINUE
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+                        i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 100                 CONTINUE
+
+                     k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                     k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+                     m1 = m1 + arg_incr(E_AXIS,ARG1)
+                     m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500                 CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/convolvei.F b/fer/efi/convolvei.F
new file mode 100644
index 0000000..5509440
--- /dev/null
+++ b/fer/efi/convolvei.F
@@ -0,0 +1,275 @@
+*
+* convolvei.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+* V6.2 2/2009 Fix bug 1640; treatment of missing data was incorrect.
+*     03/2012 *kms* Fix bug 1928 - do not exceed bounds with an even number of weights
+*
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the I axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvei_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve I component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in X (and perhaps Y,Z,T,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolvei_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      REAL xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i, j, k, l, m, n
+      INTEGER hlo, hhi, ii, wlen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG X AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+       
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+       
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS,ARG1)
+                  DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 ii = hlo, hhi
+
+                           IF (i1+ii .LT. arg_lo_ss(X_AXIS,ARG1)  .OR.
+     .                         i1+ii .GT. arg_hi_ss(X_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1+ii,j1,k1,l1,m1,n1)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190                  
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                    i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/convolvej.F b/fer/efi/convolvej.F
new file mode 100644
index 0000000..dd908b0
--- /dev/null
+++ b/fer/efi/convolvej.F
@@ -0,0 +1,274 @@
+*
+* convolvej.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+* V6.2 2/2009 Fix bug 1640; treatment of missing data was incorrect.
+*     03/2012 *kms* Fix bug 1928 - do not exceed bounds with an even number of weights
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the J axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvej_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve J component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in Y (and perhaps X,Z,T,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolvej_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the j-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      INTEGER i, j, k, l, m, n, jj
+      INTEGER xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER wlen, hlo, hhi
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG Y AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+       
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+       
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS,ARG1)
+                  DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 jj = hlo, hhi
+
+                           IF (j1+jj .LT. arg_lo_ss(Y_AXIS,ARG1)  .OR.
+     .                         j1+jj .GT. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1,j1+jj,k1,l1,m1,n1)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                    i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/convolvek.F b/fer/efi/convolvek.F
new file mode 100644
index 0000000..107b548
--- /dev/null
+++ b/fer/efi/convolvek.F
@@ -0,0 +1,277 @@
+*
+* convolvek.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+* V6.2 2/2009 Fix bug 1640; treatment of missing data was incorrect.
+*     03/2012 *kms* Fix bug 1928 - do not exceed bounds with an even number of weights
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the K axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvek_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve K component of variable with weight function')
+
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in Z (and perhaps X,Y,T,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolvek_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the k-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      integer i, j, k, l, m, n, kk
+      INTEGER xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER wlen, hlo, hhi
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG Z AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+       
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+       
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS,ARG1)
+                  DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 kk = hlo, hhi
+
+                           IF (k1+kk .LT. arg_lo_ss(Z_AXIS,ARG1)  .OR.
+     .                         k1+kk .GT. arg_hi_ss(Z_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1,j1,k1+kk,l1,m1,n1)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190                  
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                    i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/convolvel.F b/fer/efi/convolvel.F
new file mode 100644
index 0000000..9ab5462
--- /dev/null
+++ b/fer/efi/convolvel.F
@@ -0,0 +1,274 @@
+*
+* convolvel.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* Feb 1999
+* V6.2 2/2009 Fix bug 1640; treatment of missing data was incorrect.
+*     03/2012 *kms* Fix bug 1928 - do not exceed bounds with an even number of weights
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the L axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvel_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve L component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in T (and perhaps X,Y,Z,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolvel_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      INTEGER i, j, k, l, m, n
+      INTEGER xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER wlen, hlo, hhi, ll
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG T AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+       
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+       
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS,ARG1)
+                  DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 ll = hlo, hhi
+
+                           IF (l1+ll .LT. arg_lo_ss(T_AXIS,ARG1)  .OR.
+     .                         l1+ll .GT. arg_hi_ss(T_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1,j1,k1,l1+ll,m1,n1)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190                  
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                    i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/convolvem.F b/fer/efi/convolvem.F
new file mode 100644
index 0000000..bf81153
--- /dev/null
+++ b/fer/efi/convolvem.F
@@ -0,0 +1,273 @@
+*
+* convolvem.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* May 2012
+*
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the M axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolvem_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve M component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in X (and perhaps Y,Z,T,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolvem_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      REAL xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i, j, k, l, m, n
+      INTEGER hlo, hhi, mm, wlen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG X AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+       
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+       
+                     m1 = arg_lo_ss(E_AXIS,ARG1)
+                     DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 mm = hlo, hhi
+
+                           IF (m1+mm .LT. arg_lo_ss(E_AXIS,ARG1)  .OR.
+     .                         m1+mm .GT. arg_hi_ss(E_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1,j1,k1,l1,m1+mm,n1)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190                  
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                 m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600                 CONTINUE
+
+	          i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/convolven.F b/fer/efi/convolven.F
new file mode 100644
index 0000000..0a1f710
--- /dev/null
+++ b/fer/efi/convolven.F
@@ -0,0 +1,274 @@
+*
+* convolven.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+** Ansley Manke
+* May 2012
+*
+*
+* This external function convolves the component grid, com, with the weight 
+* function, wt  along the I axis (see Ferret routine CONVOLVE)
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE convolven_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Convolve N component of variable with weight function')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'COM')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable in X (and perhaps Y,Z,T,E,F) to convolve')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'WEIGHT')
+      CALL ef_set_arg_desc(id, arg, 'Weight function')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE convolven_compute (id, arg_1, arg_2, result )
+
+*
+*
+*  From FERRET subroutine CONVOLVE, for the i-axis.
+*
+* convolve the component grid, com, with the weight function, wt
+* along axis idim
+* note: the component context may not be of adequate size for the full
+*       calculation.  Missing data flags will be inserted where computation is
+*       impossible
+* also: when bad data points are encountered in the component data all
+*       result data depending on it are flagged as bad, too
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      REAL comp, sum, weight
+      REAL xlen, ylen, zlen, tlen, elen, flen
+      INTEGER i, j, k, l, m, n
+      INTEGER hlo, hhi, nn, wlen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+* CONVOLVE ALONG X AXIS (arg_1) using weights (arg_2)
+
+* Half the weighting function; weights from -hlen to hlen (now: hlo to hhi)
+
+      xlen = (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1) 
+      ylen = (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1) 
+      zlen = (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1) 
+      tlen = (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1) 
+      elen = (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1) 
+      flen = (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1) 
+
+      wlen = MAX(xlen, ylen, zlen, tlen, elen, flen)
+      hhi = wlen / 2
+      hlo = (-1) * hhi
+      IF ( MOD(wlen,2) .EQ. 0 ) hlo = hlo + 1
+ 
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 600 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+       
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 500 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+       
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                     n1 = arg_lo_ss(F_AXIS,ARG1)
+                     DO 700 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+                        sum = 0.0
+                        i2 = arg_lo_ss(X_AXIS,ARG2)
+                        j2 = arg_lo_ss(Y_AXIS,ARG2)
+                        k2 = arg_lo_ss(Z_AXIS,ARG2)
+                        l2 = arg_lo_ss(T_AXIS,ARG2)
+                        m2 = arg_lo_ss(E_AXIS,ARG2)
+                        n2 = arg_lo_ss(F_AXIS,ARG2)
+
+                        DO 100 nn = hlo, hhi
+
+                           IF (n1+nn .LT. arg_lo_ss(F_AXIS,ARG1)  .OR.
+     .                         n1+nn .GT. arg_hi_ss(F_AXIS,ARG1) ) THEN
+                              result(i,j,k,l,m,n) = bad_flag_result
+                              GOTO 190
+                           ELSE
+                              comp = arg_1(i1,j1,k1,l1,m1,n1+nn)
+                              IF ( comp .EQ. bad_flag(ARG1) ) THEN
+                                 result(i,j,k,l,m,n) = bad_flag_result
+                                 GOTO 190                  
+                              ENDIF
+                              weight = arg_2(i2,j2,k2,l2,m2,n2)
+                              sum = sum + comp * weight
+                           ENDIF
+
+                           i2 = i2 + arg_incr(X_AXIS,ARG2)
+                           j2 = j2 + arg_incr(Y_AXIS,ARG2)
+                           k2 = k2 + arg_incr(Z_AXIS,ARG2)
+                           l2 = l2 + arg_incr(T_AXIS,ARG2)
+                           m2 = m2 + arg_incr(E_AXIS,ARG2)
+                           n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+ 100                    CONTINUE
+                        result(i,j,k,l,m,n) = sum
+
+ 190                 n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 700                 CONTINUE
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 200              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 400        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 500     CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 600  CONTINUE
+
+
+      RETURN
+      END
diff --git a/fer/efi/copyscat.F b/fer/efi/copyscat.F
new file mode 100644
index 0000000..c9a4bf4
--- /dev/null
+++ b/fer/efi/copyscat.F
@@ -0,0 +1,89 @@
+      SUBROUTINE copyscat (ax, nax, nrng, nscat, scatm, scat1, scat2)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* ACM 11/00
+*  Called by scat2gridlaplace* gridding functions.
+*  If there is a modulo axis, mirror the points within nrng of each 
+*  end beyond the opposite end.  Modifies nscat, scatm, scat1, and scat2.
+
+*  ax		modulo axis
+*  nax		number of points in the modulo axis
+*  nrng		gridding parameter -- range of grid points used in gridding
+*  nscat	input: number of scattered points;
+*               output: updated number of points
+*  scatm	input: scattered points coordinate array in the direction of the modulo axis;
+*               output: extended coordinates
+*  scat1	input: scattered points other coordinate array;
+*               output: extended coordinates
+*  scat2	input: scattered points function values;
+*               output: extended function values
+
+      IMPLICIT NONE
+      REAL scatm(*), scat1(*), scat2(*)
+      REAL*8 ax(*)
+      INTEGER nscat, nscatout, nrng, i, nax
+      REAL ax1, axf, del, scatpt, cut, diff
+
+      ax1 = ax(1)
+      axf = ax(nax)
+      del = (ax(nax) - ax(1))/ float(nax-1)
+      cut = nrng* del
+
+      nscatout = nscat
+      DO 100 i = 1, nscat
+         scatpt = scatm(i)
+         diff = axf - scatpt
+         IF (diff .GE. 0. .AND. diff .LT. cut) THEN
+            nscatout = nscatout + 1
+c            scatm(nscatout) = ax1 - diff
+            scatm(nscatout) = ax1 + diff
+            scat1(nscatout) = scat1(i)
+            scat2(nscatout) = scat2(i)
+         ENDIF
+
+         diff = scatpt - ax1
+         IF (diff .GE. 0. .AND. diff .LT. cut) THEN
+            nscatout = nscatout + 1
+c            scatm(nscatout) = axf + diff
+            scatm(nscatout) = axf - diff
+            scat1(nscatout) = scat1(i)
+            scat2(nscatout) = scat2(i)
+         ENDIF
+
+  100 CONTINUE
+
+      nscat = nscatout
+      RETURN
+      END
+
diff --git a/fer/efi/curv_range.F b/fer/efi/curv_range.F
new file mode 100644
index 0000000..4f35975
--- /dev/null
+++ b/fer/efi/curv_range.F
@@ -0,0 +1,773 @@
+*
+* curv_range.F
+*
+* Ansley Manke
+* March 2005
+*
+* This function finds the indices of the bounding box for taking 
+* a subset of a variable defined on a curvilinear grid.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE curv_range_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CHARACTER*120 descr
+
+      WRITE (descr, 100)
+      CALL ef_set_desc(id, descr )
+
+  100 FORMAT (
+     . 'find i,j bounds for subset of a variable in curvilinear ',
+     . 'coordinates' )
+
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'LONGITUDES')
+      CALL ef_set_arg_desc(id, arg, 
+     .             '2-D longitudes of curvilinear grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'LATITUDES')
+      CALL ef_set_arg_desc(id, arg, 
+     .             '2-D latitudes of curvilinear grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'xrange_lo')
+      CALL ef_set_arg_desc(id, arg, 'Minimum of longitude range')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'xrange_hi')
+      CALL ef_set_arg_desc(id, arg, 'Maximum of longitude range')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'yrange_lo')
+      CALL ef_set_arg_desc(id, arg, 'Minimum of latitude range')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'yrange_hi')
+      CALL ef_set_arg_desc(id, arg, 'Maximum of latitude range')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'modulo flag for X coordinates')
+      CALL ef_set_arg_desc(id, arg, '1= X modulo; 0= X not modulo')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE curv_range_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, 4)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE curv_range_compute(id, arg_1, arg_2, 
+     .           arg_3, arg_4, arg_5, arg_6, arg_7, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz, 
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg, i, j, k, l, m, n
+      INTEGER ilo, ihi, jlo, jhi, nrep, irep
+      REAL small, xrange_lo, xrange_hi, yrange_lo, yrange_hi, xx, xxp, 
+     .     yy, yyp, big, xadd, xmin, xmax, xmin_field, xmax_field, 
+     .     ymin_field, ymax_field, xmod, xdiff_lo, xdiff_hi, ydiff_lo, 
+     .     ydiff_hi
+      LOGICAL xmodulo, found_range
+      CHARACTER*100 errmsg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 3
+      CALL ef_get_one_val(id, arg, xrange_lo)
+      arg = 4
+      CALL ef_get_one_val(id, arg, xrange_hi)
+      arg = 5
+      CALL ef_get_one_val(id, arg, yrange_lo)
+      arg = 6
+      CALL ef_get_one_val(id, arg, yrange_hi)
+      arg = 7
+      CALL ef_get_one_val(id, arg, xmod)
+      xmodulo = (xmod .GT. 0.)
+
+c curv_range_test
+c* Set the values to some particular ones, to see if this is the function being executed.
+c
+c      j = res_lo_ss(Y_AXIS)
+c      k = res_lo_ss(Z_AXIS)
+c      l = res_lo_ss(T_AXIS)
+c
+c      result(1,j,k,l) = 11
+c      result(2,j,k,l) = 22
+c      result(3,j,k,l) = 33
+c      result(4,j,k,l) = 44
+c      RETURN
+
+* See if the user asked for the whole range of arg_1 and arg_2 
+
+
+      big = MAX (1.e34, ABS(bad_flag(ARG1)) )
+      big = MAX (big, ABS(bad_flag(ARG2)) )
+      xmin_field = big
+      xmax_field = -1.* big
+      ymin_field = big
+      ymax_field = -1.* big
+      DO 50 n = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+      DO 50 m = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+      DO 50 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 50 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 50 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 50 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      
+         xmin_field = MIN(xmin_field, arg_1(i,j,k,l,m,n))
+         xmax_field = MAX(xmax_field, arg_1(i,j,k,l,m,n))
+         ymin_field = MIN(ymin_field, arg_2(i,j,k,l,m,n))
+         ymax_field = MAX(ymax_field, arg_2(i,j,k,l,m,n))
+
+ 50   CONTINUE
+
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+! use the range of the data field to decide how much precision 
+! to require for **requested range equals the data range**
+
+      small = 0.01* (xmax_field - xmin_field)
+      small = MIN(small, 0.01* (ymax_field - ymin_field) )
+
+      IF (small .LE. 0) THEN  ! if x or y range is 0 use the other direction
+         small = 0.01* (xmax_field - xmin_field)
+         small = MAX(small, 0.01* (ymax_field - ymin_field) )
+      ENDIF
+
+      IF (small .LE. 0) small = 1.e-4
+
+      xdiff_lo = ABS(xmin_field - xrange_lo) 
+      xdiff_hi = ABS(xmax_field - xrange_hi) 
+      ydiff_lo = ABS(ymin_field - yrange_lo) 
+      ydiff_hi = ABS(ymax_field - yrange_hi) 
+
+      IF (xdiff_lo .LT. small .AND. ydiff_lo .LT. small  .AND.
+     .    xdiff_hi .LT. small .AND. ydiff_hi .LT. small) THEN 
+         result(1,j,k,l,m,n) = arg_lo_ss(X_AXIS, ARG1)
+         result(2,j,k,l,m,n) = arg_hi_ss(X_AXIS, ARG1)
+         result(3,j,k,l,m,n) = arg_lo_ss(Y_AXIS, ARG2)
+         result(4,j,k,l,m,n) = arg_hi_ss(Y_AXIS, ARG2)
+         RETURN
+      ENDIF
+
+* Make sure the requested range at least overlaps the range of 
+* longitude coordinates
+
+      IF (xmodulo) THEN
+         DO WHILE (xrange_lo .GT. xmax_field)
+            xrange_lo = xrange_lo - 360
+            xrange_hi = xrange_hi - 360
+         ENDDO
+         DO WHILE (xrange_hi .LT. xmin_field)
+            xrange_lo = xrange_lo + 360
+            xrange_hi = xrange_hi + 360
+         ENDDO
+      ENDIF
+
+
+      IF (ydiff_lo .LT. small .AND. ydiff_hi .LT. small .AND. 
+     .     xmodulo) THEN
+         nrep = NINT((xrange_lo-xmin_field)/360.)
+         xdiff_lo = ABS(xmin_field+360.*nrep - xrange_lo)
+         nrep = NINT((xrange_hi-xmax_field)/360.)
+         xdiff_hi = ABS(xmax_field+360.*nrep - xrange_hi)
+         IF (xdiff_lo .LT. small .AND. xdiff_hi .LT. small ) THEN
+            result(1,j,k,l,m,n) = arg_lo_ss(X_AXIS, ARG1)
+            result(2,j,k,l,m,n) = arg_hi_ss(X_AXIS, ARG1)
+            result(3,j,k,l,m,n) = arg_lo_ss(Y_AXIS, ARG2)
+            result(4,j,k,l,m,n) = arg_hi_ss(Y_AXIS, ARG2)
+            RETURN
+         ENDIF
+      ENDIF
+
+* If the requested range is larger than the data, return whole range
+
+      IF (.NOT. xmodulo) THEN  
+         IF (xrange_lo.LT.xmin_field .AND. xrange_hi.GT.xmax_field .AND.
+     .       yrange_lo.LT.ymin_field .AND. yrange_hi.GT.ymax_field)THEN
+            result(1,j,k,l,m,n) = arg_lo_ss(X_AXIS, ARG1)
+            result(2,j,k,l,m,n) = arg_hi_ss(X_AXIS, ARG1)
+            result(3,j,k,l,m,n) = arg_lo_ss(Y_AXIS, ARG2)
+            result(4,j,k,l,m,n) = arg_hi_ss(Y_AXIS, ARG2)
+            RETURN
+         ENDIF
+      ELSE
+
+* If x is to be treated as modulo, use the code below to determine the indices, but
+* if the Y range is larger than the data, use the data min and/or max for y range.
+         IF (yrange_lo .LT. ymin_field) yrange_lo = ymin_field
+         IF (yrange_hi .GT. ymax_field) yrange_hi = ymax_field
+      ENDIF
+
+
+
+* Find range of I,J for which arg_1 is in xrange_lo, xrange_hi
+* and arg_2 is in yrange_lo, yrange_hi
+
+      ilo = arg_hi_ss(X_AXIS, ARG1)
+      ihi = arg_lo_ss(X_AXIS, ARG1)
+      jlo = arg_hi_ss(Y_AXIS, ARG2)
+      jhi = arg_lo_ss(y_AXIS, ARG2)
+
+      big = ABS(bad_flag(ARG1) )
+      xmin = big
+      xmax = -1.* big
+      found_range = .FALSE.
+
+      DO 100 n = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+      DO 100 m = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+      DO 100 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 100 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 100 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 100 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         xx = arg_1(i,j,k,l,m,n)
+         yy = arg_2(i,j,k,l,m,n)
+         IF ( xx .EQ. bad_flag(1) ) GOTO 5500
+         IF ( yy .EQ. bad_flag(2) ) GOTO 5500
+
+         IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .        yy .GE. yrange_lo  .AND. yy .LE. yrange_hi ) THEN
+            found_range = .TRUE.
+            ilo = MIN(i,ilo)
+            ihi = MAX(i,ihi)
+            jlo = MIN(j,jlo)
+            jhi = MAX(j,jhi)
+            xmin = MIN(xmin, xx)
+            xmax = MAX(xmin, xx)
+         ENDIF
+
+ 100  CONTINUE
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+      IF (.NOT. found_range .AND. 
+     .    xrange_lo.GE.xmin_field .AND. xrange_hi.LE.xmax_field .AND.
+     .    yrange_lo.GE.ymin_field .AND. yrange_hi.LE.ymax_field ) THEN
+     
+         ilo = arg_hi_ss(X_AXIS, ARG1)
+         ihi = arg_lo_ss(X_AXIS, ARG1)
+         jlo = arg_hi_ss(Y_AXIS, ARG2)
+         jhi = arg_lo_ss(y_AXIS, ARG2)
+
+         DO 200 n = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+         DO 200 m = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+         DO 200 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+         DO 200 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+         DO 200 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)-1
+         DO 200 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)-1
+
+            xx = arg_1(i,j,k,l,m,n)
+            xxp = arg_1(i+1,j,k,l,m,n)
+            yy = arg_2(i,j,k,l,m,n)
+            yyp = arg_2(i,j+1,k,l,m,n)
+
+            IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .           yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j+1, jhi)
+            ENDIF
+
+            IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .           xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i+1, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j, jhi)
+            ENDIF
+
+            IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .           yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+               found_range = .TRUE.
+               ilo = min(i, ilo)
+               ihi = MAX(i+1, ihi)
+               jlo = min(j, jlo)
+               jhi = MAX(j+1, jhi)
+            ENDIF
+
+ 200     CONTINUE
+      ENDIF
+
+      IF (xmodulo) THEN
+         IF (xmin .EQ. big) xmin = xmin_field
+         IF (xmax .EQ. -1.*big) xmax = xmax_field
+ 
+* Does the range found cover the requested xrange_lo,xrange_hi range?
+* If not we will need some modulo repetitions.
+
+         IF (xmin .GT. xrange_lo) THEN
+            nrep = NINT((xmin-xrange_lo)/360)
+            xadd = 0.
+            DO 380 irep = 1, nrep
+               xadd = xadd - 360.
+
+* Previous loop found no overlap of x coordinates and desired output range.
+* start over with xmax, xmin find whole range
+
+               IF (xmin .GT. xrange_hi) THEN
+                  xmin =  big 
+                  xmax = -1. * big   
+               ENDIF
+     
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 320 n = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+               DO 320 m = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+               DO 320 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+               DO 320 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+               DO 320 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               DO 320 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l,m,n) + xadd
+                  yy = arg_2(i,j,k,l,m,n)
+
+                  IF ( xx .GE. xrange_lo .AND. xx .LE. xrange_hi .AND.
+     .                 yy .GE. yrange_lo .AND. yy .GE. yrange_hi ) THEN
+                     found_range = .TRUE.
+                     ilo = MIN(i,ilo)
+                     ihi = MAX(i,ihi) 
+                     jlo = MIN(j,jlo)
+                     jhi = MAX(j,jhi) 
+                     xmin = MIN(xmin, xx)
+                     xmax = MAX(xmin, xx)
+                  ENDIF
+
+ 320           CONTINUE
+
+               IF (.NOT. found_range) THEN
+               
+                  ilo = arg_hi_ss(X_AXIS, ARG1)
+                  ihi = arg_lo_ss(X_AXIS, ARG1)
+                  jlo = arg_hi_ss(Y_AXIS, ARG2)
+                  jhi = arg_lo_ss(y_AXIS, ARG2)
+
+                  DO 340 n = arg_lo_ss(F_AXIS,ARG1), 
+     .                       arg_hi_ss(F_AXIS,ARG1)
+                  DO 340 m = arg_lo_ss(E_AXIS,ARG1), 
+     .                       arg_hi_ss(E_AXIS,ARG1)
+                  DO 340 l = arg_lo_ss(T_AXIS,ARG1), 
+     .                       arg_hi_ss(T_AXIS,ARG1)
+                  DO 340 k = arg_lo_ss(Z_AXIS,ARG1), 
+     .                       arg_hi_ss(Z_AXIS,ARG1)
+                  DO 340 j = arg_lo_ss(Y_AXIS,ARG1), 
+     .                       arg_hi_ss(Y_AXIS,ARG1)
+                  DO 340 i = arg_lo_ss(X_AXIS,ARG1), 
+     .                       arg_hi_ss(X_AXIS,ARG1)-1
+
+                     xx = arg_1(i,j,k,l,m,n) + xadd
+                     xxp = arg_1(i+1,j,k,l,m,n) + xadd
+                     yy = arg_2(i,j,k,l,m,n)
+
+                     IF ( xrange_lo .GE. xx  .AND.
+     .                    xrange_hi .LT. xxp .AND.
+     .                    yy .GE. yrange_lo  .AND.
+     .                    yy .GE. yrange_hi ) THEN
+                        found_range = .TRUE.
+                        ilo = MIN(i,ilo)
+                        ihi = MAX(i+1,ihi) 
+                        jlo = MIN(j,jlo)
+                        jhi = MAX(j,jhi) 
+                        xmin = MIN(xmin, xx)
+                        xmax = MAX(xmin, xxp)
+                     ENDIF
+
+ 340              CONTINUE
+               ENDIF
+
+               IF (xmin .EQ. big) xmin = xmin_field + xadd
+               IF (xmax .EQ. -1.*big) xmax = xmax_field + xadd
+
+ 380        CONTINUE
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+            IF (.NOT. found_range .AND. 
+     .          xrange_lo .GE. xmin_field .AND.
+     .          xrange_hi .LE. xmax_field .AND.
+     .          yrange_lo .GE. ymin_field .AND.
+     .          yrange_hi .LE. ymax_field ) THEN
+                       
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 400 n=arg_lo_ss(F_AXIS,ARG1),arg_hi_ss(F_AXIS,ARG1)
+               DO 400 m=arg_lo_ss(E_AXIS,ARG1),arg_hi_ss(E_AXIS,ARG1)
+               DO 400 l=arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+               DO 400 k=arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+               DO 400 j=arg_lo_ss(Y_AXIS,ARG1),arg_hi_ss(Y_AXIS,ARG1)-1
+               DO 400 i=arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)-1
+
+                  xx = arg_1(i,j,k,l,m,n)+xadd
+                  xxp = arg_1(i+1,j,k,l,m,n)+xadd
+                  yy = arg_2(i,j,k,l,m,n)
+                  yyp = arg_2(i,j+1,k,l,m,n)
+      
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .              yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j+1, jhi)
+                  ENDIF
+
+                  IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .                 xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j, jhi)
+                  ENDIF
+
+                  IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .                 yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                  ENDIF
+
+ 400           CONTINUE
+            ENDIF
+
+         ENDIF
+   
+         IF (xmax .LT. xrange_hi) THEN
+            nrep = NINT((xrange_hi-xmax)/360.)
+            xadd = 0.
+               DO 580 irep = 1, nrep
+               xadd = xadd + 360.
+
+* Previous loop found no overlap of x coordinates and desired output range.
+* start over with xmax, xmin find whole range
+
+               IF (xmax .LT. xrange_lo) THEN
+                  xmin =  big 
+                  xmax = -1. * big   
+               ENDIF
+
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 520 n = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+               DO 520 m = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+               DO 520 l = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+               DO 520 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+               DO 520 j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+               DO 520 i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+                  xx = arg_1(i,j,k,l,m,n) + xadd
+                  yy = arg_2(i,j,k,l,m,n)
+
+                  IF ( xx .GE. xrange_lo .AND. xx .LE. xrange_hi .AND.
+     .                 yy .GE. yrange_lo .AND. yy .GE. yrange_hi ) THEN
+                     found_range = .TRUE.
+                     ilo = MIN(i,ilo)
+                     ihi = MAX(i,ihi) 
+                     jlo = MIN(j,jlo)
+                     jhi = MAX(j,jhi) 
+                     xmin = MIN(xmin, xx)
+                     xmax = MAX(xmin, xx)
+                  ENDIF
+
+ 520           CONTINUE
+ 
+               IF (.NOT. found_range) THEN
+               
+                  ilo = arg_hi_ss(X_AXIS, ARG1)
+                  ihi = arg_lo_ss(X_AXIS, ARG1)
+                  jlo = arg_hi_ss(Y_AXIS, ARG2)
+                  jhi = arg_lo_ss(y_AXIS, ARG2)
+
+                  DO 540 n = arg_lo_ss(F_AXIS,ARG1), 
+     .                       arg_hi_ss(F_AXIS,ARG1)
+                  DO 540 m = arg_lo_ss(E_AXIS,ARG1), 
+     .                       arg_hi_ss(E_AXIS,ARG1)
+                  DO 540 l = arg_lo_ss(T_AXIS,ARG1), 
+     .                       arg_hi_ss(T_AXIS,ARG1)
+                  DO 540 k = arg_lo_ss(Z_AXIS,ARG1), 
+     .                       arg_hi_ss(Z_AXIS,ARG1)
+                  DO 540 j = arg_lo_ss(Y_AXIS,ARG1), 
+     .                       arg_hi_ss(Y_AXIS,ARG1)
+                  DO 540 i = arg_lo_ss(X_AXIS,ARG1), 
+     .                       arg_hi_ss(X_AXIS,ARG1)-1
+
+                     xx = arg_1(i,j,k,l,m,n) + xadd
+                     xxp = arg_1(i+1,j,k,l,m,n) + xadd
+                     yy = arg_2(i,j,k,l,m,n)
+                     yyp = arg_2(i,j+1,k,l,m,n)
+
+                     IF ( xrange_lo.GE.xx .AND. xrange_hi.LT.xxp.AND.
+     .                    yrange_lo.GE.yy .AND. yrange_hi.LT.yyp ) THEN
+                        found_range = .TRUE.
+                        ilo = MIN(i,ilo)
+                        ihi = MAX(i+1,ihi) 
+                        jlo = MIN(j,jlo)
+                        jhi = MAX(j,jhi) 
+                        xmin = MIN(xmin, xx)
+                        xmax = MAX(xmin, xxp)
+                     ENDIF
+
+ 540              CONTINUE
+               ENDIF
+ 
+               IF (xmin .EQ. big) xmin = xmin_field + xadd
+               IF (xmax .EQ. -1.*big) xmax = xmax_field + xadd
+
+ 580        CONTINUE
+
+
+* If no range found, is the range strictly between two adjacent points
+* in either direction?
+
+            IF (.NOT. found_range .AND.
+     .          xrange_lo .GE. xmin_field .AND.
+     .          xrange_hi .LE. xmax_field .AND.
+     .          yrange_lo .GE. ymin_field .AND. 
+     .          yrange_hi .LE. ymax_field ) THEN
+     
+               ilo = arg_hi_ss(X_AXIS, ARG1)
+               ihi = arg_lo_ss(X_AXIS, ARG1)
+               jlo = arg_hi_ss(Y_AXIS, ARG2)
+               jhi = arg_lo_ss(y_AXIS, ARG2)
+
+               DO 600 n =arg_lo_ss(F_AXIS,ARG1),arg_hi_ss(F_AXIS,ARG1)
+               DO 600 m =arg_lo_ss(E_AXIS,ARG1),arg_hi_ss(E_AXIS,ARG1)
+               DO 600 l =arg_lo_ss(T_AXIS,ARG1),arg_hi_ss(T_AXIS,ARG1)
+               DO 600 k =arg_lo_ss(Z_AXIS,ARG1),arg_hi_ss(Z_AXIS,ARG1)
+               DO 600 j =arg_lo_ss(Y_AXIS,ARG1),arg_hi_ss(Y_AXIS,ARG1)-1
+               DO 600 i =arg_lo_ss(X_AXIS,ARG1),arg_hi_ss(X_AXIS,ARG1)-1
+
+                  xx = arg_1(i,j,k,l,m,n)+xadd
+                  xxp = arg_1(i+1,j,k,l,m,n)+xadd
+                  yy = arg_2(i,j,k,l,m,n)
+                  yyp = arg_2(i,j+1,k,l,m,n)
+      
+                  IF ( xx .GE. xrange_lo  .AND. xx .LE. xrange_hi .AND.
+     .              yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j+1, jhi)
+                  ENDIF
+
+                  IF ( yy .GE. yrange_lo  .AND. yy .LE. yrange_hi .AND.
+     .                 xrange_lo .GE. xx .AND. xrange_hi .LT. xxp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     jlo = min(j, jlo)
+                     jhi = MAX(j, jhi)
+                  ENDIF
+
+                  IF ( xrange_lo .GE. xx .AND. xrange_hi .LT. xxp .AND.
+     .                 yrange_lo .GE. yy .AND. yrange_hi .LT. yyp) THEN
+                     found_range = .TRUE.
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                     ilo = min(i, ilo)
+                     ihi = MAX(i+1, ihi)
+                  ENDIF
+
+ 600           CONTINUE
+            ENDIF
+
+
+         ENDIF
+
+      ENDIF  ! xmodulo
+
+
+* Return two cells out from the computed result, one to be sure we cover
+* the entire requested range (the coords may be cell centers or bounds, and
+* a second because the mapping in curv_to_rect uses neighbors around each
+* location to compute the result.
+
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+ 700  CONTINUE
+
+      IF (found_range) THEN
+         result(1,j,k,l,m,n) = MAX(ilo-2, arg_lo_ss(X_AXIS, ARG1) )
+         result(2,j,k,l,m,n) = MIN(ihi+2, arg_hi_ss(X_AXIS, ARG1) )
+      ENDIF
+
+      IF (found_range) THEN
+         result(3,j,k,l,m,n) = MAX(jlo-2, arg_lo_ss(Y_AXIS, ARG2) )
+         result(4,j,k,l,m,n) = MIN(jhi+2, arg_hi_ss(Y_AXIS, ARG2) )
+      ENDIF
+
+      RETURN 
+
+ 5500 WRITE (errmsg, 1000) 'X', i, j
+ 1000 FORMAT (A1, 
+     . ' coordinates missing where valid value needed, at I,J=', 2i5)
+
+      CALL EF_BAIL_OUT(id, errmsg)
+
+ 5600 WRITE (errmsg, 1000) 'Y', i, j
+      CALL EF_BAIL_OUT(id, errmsg)
+
+
+      RETURN
+      END
diff --git a/fer/efi/curv_to_rect.F b/fer/efi/curv_to_rect.F
new file mode 100644
index 0000000..30f6201
--- /dev/null
+++ b/fer/efi/curv_to_rect.F
@@ -0,0 +1,350 @@
+! curv_to_rect.F
+! From Matt Harrison hinterp.F
+! to call only the spherical interpolation modules, and
+! recast in F77-compileable format.
+! ACM 3/2004
+!
+!   
+!   -- Check use of and document issue of cell bounds 
+!      vs cell centers.
+!
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+
+* acm 12/2004 Compute the sum of weights in routine apply_mapping; 
+*             sum of weights used when there is good data contributing 
+*             to the destination point.
+*             Remove use of mask_dst variable; never used.
+* acm  3/2005 The curvilinear data may be a subset.  If it was saved
+*             with SAVE/HEADING=ENHANCED, then the lo and hi subscripts
+*             in the dataset correspond to the subset, and we can use
+*             a map pre-computed using the entire dataset for this regridding.
+*             Pass the subscripts of the input curvilinear data to the 
+*             apply_mapping routine (if not a subset these are 1:max_ss).
+
+
+! In this SUBROUTINE we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE curv_to_rect_init(id)
+        
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT
+     .('Apply mapping to regrid from curvilinear to rectangular grid')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable to regrid, on curvilinear grid V(x,y,z,t,e,f)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mapping')
+      WRITE (descr, 30)
+   30 FORMAT ('mapping computed by curv_to_rect_MAP')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_init
+
+
+!
+! In this SUBROUTINE we compute the result
+!
+      SUBROUTINE curv_to_rect_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  i, j, k, l, m, n, 
+     .         i1, j1, k1, l1, m1, n1,
+     .         i2, j2, k2, l2, m2, n2,
+     .         ih, jh, num_nbrs,
+     .         nlon_src, nlat_src, nlon_dst, nlat_dst
+
+      num_nbrs = 4
+      
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+      nlon_src = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nlat_src = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      nlon_dst = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      ih = arg_hi_ss(X_AXIS,ARG1)
+      jh = arg_hi_ss(Y_AXIS,ARG1)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 40 n = res_lo_ss(F_AXIS),res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 30 m = res_lo_ss(E_AXIS),res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 20 l = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 10 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  CALL apply_mapping ( arg_1(i1,j1,k1,l1,m1,n1),
+     .                                 i1, ih, j1, jh,
+     .                                 arg_2(i2,j2,k2,l2,m2,n2),
+     .                                 arg_2(i2,j2,k2,l2+1,m2,n2),
+     .                                 arg_2(i2,j2,k2,l2+2,m2,n2),
+     .                                 result(i,j,k,l,m,n), nlon_src,
+     .                                 nlat_src, nlon_dst, nlat_dst,
+     .                                 num_nbrs, bad_flag(ARG1), 
+     .                                 bad_flag_result )
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  10           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+  20        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+  30     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  40  CONTINUE
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_compute
+
+!#######################################################################
+            
+       subroutine apply_mapping (data_in, ilo, ihi, jlo, jhi,
+     .                           wt, i_lon, j_lat, data_out, 
+     .                           nlon_src, nlat_src, nlon_dst, nlat_dst,
+     .                           num_nbrs, bad_flag_in, bad_flag_out)
+
+! This is the last set of loops from horiz_interp_sphe, applying wt
+! to the data to compute the regridded result.
+
+! acm 7/2004 Add variable COUNT to set data to missing if there is nothing added
+! to the sum in a given output grid cell.  This had been done in the original code
+! by seeing if the value is a "land" value, but it is not general enough for our
+! purposes.
+
+! acm 12/2004 Compute the sum of weights here; weights only used when there
+!             is good data contributing to the destination point.
+
+       IMPLICIT NONE
+       integer ilo, ihi, jlo, jhi
+       real data_in(ilo:ihi, jlo:jhi)     ! input field
+       real data_out(nlon_dst, nlat_dst)  ! output
+       real wt(nlon_dst, nlat_dst, num_nbrs)  
+
+       real i_lon(nlon_dst,nlat_dst,num_nbrs)
+       real j_lat(nlon_dst,nlat_dst,num_nbrs) 
+
+       real bad_flag_in, bad_flag_out
+
+       integer nlon_src, nlat_src, nlon_dst, nlat_dst, 
+     .         num_nbrs
+
+!--- some local variables ----------------------------------------
+       integer nlon_in, nlat_in, nlon_out, nlat_out, num_neighbors,
+     .               m, n, k, i, j
+       real sum
+       logical okij
+!-----------------------------------------------------------------
+
+! parameters
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+
+         nlon_in  = nlon_src
+         nlat_in  = nlat_src
+         nlon_out = nlon_dst
+         nlat_out = nlat_dst   
+         num_neighbors = num_nbrs
+
+         do m=1,nlon_out
+         do n=1,nlat_out
+
+            data_out(m,n) = 0.0
+            sum=0.0
+            do k=1, num_neighbors
+               i = i_lon(m,n,k)
+               j = j_lat(m,n,k)
+
+               okij = .TRUE.
+               IF (i .LT. ilo  .OR. i .GT. ihi) THEN
+                  okij = .FALSE.
+               ENDIF
+               IF (j .LT. jlo  .OR.  j .GT. jhi) THEN
+                  okij = .FALSE.
+               ENDIF
+
+
+               if (i.GT.0 .and. j.GT.0 .AND. okij) THEN
+                  IF (data_in(i,j) .NE. bad_flag_in ) THEN
+                     data_out(m,n) = data_out(m,n)+
+     .                                  data_in(i,j)*wt(m,n,k)
+                     sum = sum + wt(m,n,k)
+                  endif
+               else
+                  data_out(m,n) = bad_flag_out
+                  GO TO 33
+               endif
+            enddo
+
+            IF (sum .GT. epsln) THEN
+               data_out(m,n) = data_out(m,n)/sum
+            ELSE
+               data_out(m,n) = bad_flag_out
+            ENDIF
+  33        continue
+
+         enddo
+         enddo
+      
+
+         return
+       end ! subroutine horiz_interp_sphe
+      
+      
diff --git a/fer/efi/curv_to_rect_map.F b/fer/efi/curv_to_rect_map.F
new file mode 100644
index 0000000..44ecb03
--- /dev/null
+++ b/fer/efi/curv_to_rect_map.F
@@ -0,0 +1,1120 @@
+! curv_to_rect_map.F  
+! From Matt Harrison hinterp.F
+! to call only the spherical interpolation modules, and
+! recast in F77-compileable format.
+! ACM 3/2004
+!  10/8/2004  add fourth argument radius  (max_dist) so this can be
+!             set to a smaller value for fine grids or small regions.
+!
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+! acm 12/2004 Compute the sum of weights in routine apply_mapping; 
+!             sum of weights used when there is good data contributing 
+!             to the destination point.
+!             Remove use of mask_dst variable; never used.
+
+
+
+! In this SUBROUTINE we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE curv_to_rect_map_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER   id, arg
+      CHARACTER*100  descr
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      WRITE (descr, 10)
+   10 FORMAT
+     . ('Compute mapping for regridding: curvilinear to ',
+     .  'rectangular grid.')
+      CALL ef_set_desc(id, descr)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_num_work_arrays(id, 8)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT, ABSTRACT,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'lon_in')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'Source grid longitudes (2-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lat_in')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Source grid latitudes (2-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'grid_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      WRITE (descr, 20)
+   20 FORMAT ('Any variable on destination Longitude-Latitude ',
+     .        'grid, Lon and Lat')
+      CALL ef_set_arg_desc(id, arg, descr)
+     .  
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'radius')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      WRITE (descr, 30)
+   30 FORMAT ('Source points falling ',
+     .   'within radius are included in mapping to destination point')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_init
+
+* Set the limits of the abstract axes for the result.
+
+      SUBROUTINE curv_to_rect_map_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, 4)
+      CALL ef_set_axis_limits(id, T_AXIS, 1, 3)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_result_limits
+
+
+
+*
+* In this SUBROUTINE we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE curv_to_rect_map_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER array_num
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+
+      INTEGER num_nbrs, nx, ny
+
+      num_nbrs = 4
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+
+
+* Define together as one work array:
+* i_lon_j_lat(nlon_dst, nlat_dst, num_nbrs, 2)
+*  integer i_lon(nlon_dst, nlat_dst, num_nbrs) 
+*  integer j_lat(nlon_dst, nlat_dst, num_nbrs) 
+*  indices for spherical interpolation - define together as one work array
+
+      array_num = 1
+      num_nbrs = 4
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 2, 1, 1)
+
+*  Define together as one work array:
+*  real src_dist(nlon_dst, nlat_dst, num_nbrs)
+*  real map_src_dist(nlon_dst, nlat_dst, num_nbrs)
+
+      array_num = 2
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 2, 1, 1)
+
+* Define together as one work array:
+* logical found_neighbors(nlon_dst, nlat_dst)
+* logical map_found_neighbors(nlon_dst, nlat_dst)
+
+      array_num = 3
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     2, 1, 1, 1)
+
+* integer map_src_add(nlon_dst, nlat_dst, num_nbrs)
+
+      array_num = 4
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 1, 1, 1)
+
+* real wt(nlon_dst, nlat_dst, num_nbrs) 
+
+      array_num = 5
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     num_nbrs, 1, 1, 1)
+
+* Define together as one work array:
+* real src_grid_radians(nx_src, ny_src, 2, 1)
+* source grid longitudes (arg_1), translated to radians
+* source grid latitudes  (arg_2), translated to radians
+
+      array_num = 6
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG1), arg_lo_ss(Y_AXIS,ARG2),
+     .     1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG2),
+     .     2, 1, 1, 1)
+
+* real*8 dst_grid(MAX(nx_dst, ny_dst), 2, 1, 1)
+* destination rectangular grid, translated to radians
+* allocate 2* needed number of values, since this will be real*8
+
+      array_num = 7
+      nx =  arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny =  arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nx = MAX(nx,ny)
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .        1,   1, 1, 1, 1, 1,
+     .     2*nx, 2*2, 1, 1, 1, 1)
+
+* real dst_grid_radians(nx_dst, ny_dst, 2, 1)
+* destination rectangular grid, translated to radians
+
+      array_num = 8
+      nx =  arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny =  arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .      1,  1, 1, 1, 1, 1,
+     .     nx, ny, 2, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+!
+! In this SUBROUTINE we compute the result
+!
+      SUBROUTINE curv_to_rect_map_compute(id, arg_1, arg_2, arg_3,
+     .          arg_4, result, i_lon_j_lat, src_dist, 
+     .          found_neighbors, map_src_add, wt, 
+     .          src_grid_radians, dst_grid, dst_grid_radians)
+
+! Schematic:
+!    The following example illustrates a destination grid location (+) with 
+!    a (R)adius of influence (in radians) denoted by (=).  Valid source grid 
+!    locations (o) which fall within the radius of influence of the destination 
+!    point are used in the mapping. In this case, 4 valid source grid points fall
+!    within the radius of influence.   
+!
+! 
+!               o  o   o   o   o   o   o
+!                      =========
+!                     =         = 
+!               o  o = o   o   o = o   o
+!                   =        R    = 
+!                   =      +----->=
+!               o  o   o   x   x   x   x
+!                     =         =
+!                      =========
+!               o  o   o   x   x   x   x
+!
+!
+!
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Declare work arrays
+
+      INTEGER i_lon_j_lat(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .                    wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .                    wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL src_dist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      LOGICAL found_neighbors(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .                        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .                        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      INTEGER map_src_add(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .                    wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .                    wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL wt(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .        wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .        wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL src_grid_radians(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .                      wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .                      wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL*8 dst_grid(wrk7lox:wrk7hix/2, wrk7loy:wrk7hiy/2,
+     .                wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL dst_grid_radians(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .                      wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .                      wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  i, j, k, l, m, n, arg, idim, interp_method, nx, ny,
+     .         nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .         ilon(4), jlat(4)
+
+! ilon and jlat are size of num_nbrs
+
+      REAL max_dist, pi, pi180
+      LOGICAL src_modulo
+
+      pi =  4.*ATAN(1.)
+      pi180 = pi/ 180.
+
+      num_nbrs = 4
+
+!  Get max_dist as an argument and convert to radians.
+cc      max_dist = 0.17
+      arg = 4
+      CALL ef_get_one_val(id, arg, max_dist)
+      max_dist = pi180*max_dist
+
+      src_modulo = .true.  ! Do we want this? Ferret does not now deal w/ modulo curvi data
+
+!  Loop over x,y,t of the input fields
+      
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      interp_method = 3
+!      WRITE(*,*) 'Using spherical regridding !!'
+
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+      nlon_src = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nlat_src = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      nlon_dst = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+
+      IF (nlon_src .NE. nx .OR. nlat_src .NE. ny) call ef_bail_out (id, 
+     . 'argument 2 must have the same x and y dimensions as argument 1')
+
+* Tranlate input and output grid coordinates to radians.
+
+* arg_1 is lons_in
+* arg_2 is lats_in
+* src_grid_radians(nx_src, ny_src, 2, 1)
+
+      DO j = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO i = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         src_grid_radians(i,j,1,1,1,1) = 
+     .       pi180*arg_1(i,j,mem1loz,mem1lot,mem1loe,mem1lof)
+      ENDDO
+      ENDDO
+
+      DO j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         src_grid_radians(i,j,2,1,1,1) =
+     .       pi180*arg_2(i,j,mem2loz,mem2lot,mem2loe,mem2lof)
+      ENDDO
+      ENDDO
+
+      arg = 3
+      idim = 1
+
+      CALL EF_GET_COORDINATES (id, arg, idim,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3), 
+     .     dst_grid(1,1,1,1,1,1) )
+
+      arg = 3
+      idim = 2
+
+      CALL EF_GET_COORDINATES (id, arg, idim,
+     .     arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 
+     .     dst_grid(1,2,1,1,1,1) )
+
+      DO j = 1, nlat_dst
+      DO i = 1, nlon_dst
+        dst_grid_radians(i,j,1,1,1,1) = pi180* dst_grid(i,1,1,1,1,1)
+      ENDDO
+      ENDDO
+
+      DO j = 1, nlat_dst
+      DO i = 1, nlon_dst
+        dst_grid_radians(i,j,2,1,1,1) = pi180* dst_grid(j,2,1,1,1,1)
+      ENDDO
+      ENDDO
+
+      CALL horiz_interp_init_sphe(id, 
+     .        src_grid_radians(wrk6lox,wrk6loy,1,1,1,1), 
+     .        src_grid_radians(wrk6lox,wrk6loy,2,1,1,1), 
+     .        dst_grid_radians(wrk8lox,wrk8loy,1,1,1,1), 
+     .        dst_grid_radians(wrk8lox,wrk8loy,2,1,1,1),
+     .        i_lon_j_lat(wrk1lox,wrk1loy,1,1,1,1), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,1,2,1,1), 
+     .        ilon, jlat, 
+     .        src_dist(wrk2lox,wrk2loy,1,1,1,1), 
+     .        src_dist(wrk2lox,wrk2loy,1,2,1,1),
+     .        found_neighbors(wrk3lox,wrk3loy,1,1,1,1), 
+     .        map_src_add, 
+     .        found_neighbors(wrk3lox,wrk3loy,1,1,1,1), 
+     .        num_nbrs, max_dist, 
+     .        src_modulo, nlon_src, nlat_src, nlon_dst, nlat_dst)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      CALL save_mapping (src_dist, wt, 
+     .        found_neighbors(wrk3lox,wrk3loy,1,1,1,1), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,1,1,1,1), 
+     .        i_lon_j_lat(wrk1lox,wrk1loy,1,2,1,1), 
+     .        max_dist, nlon_src, nlat_src, 
+     .        nlon_dst, nlat_dst, num_nbrs, bad_flag_result,
+     .        result(i,j,k,l,m,n) )
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE curv_to_rect_map_compute
+
+      
+      subroutine horiz_interp_init_sphe(id, lon_in, lat_in, lon_out, 
+     .        lat_out, i_lon, j_lat, ilon, jlat, src_dist, map_src_dist,
+     .        found_neighbors, map_src_add, map_found_neighbors, 
+     .        num_nbrs, max_dist, src_modulo, nlon_src, nlat_src, 
+     .        nlon_dst, nlat_dst)
+      
+      integer id, nlon_src, nlat_src, nlon_dst, nlat_dst,  
+     .        num_nbrs, ilon(num_nbrs), jlat(num_nbrs), 
+     .        map_src_add(nlon_dst,nlat_dst,num_nbrs),
+     .        i_lon(nlon_dst,nlat_dst,num_nbrs),
+     .        j_lat(nlon_dst,nlat_dst,num_nbrs)
+
+      real    max_dist, 
+     .        lon_in(nlon_src, nlat_src),  lat_in(nlon_src, nlat_src), 
+     .        lon_out(nlon_dst, nlat_dst), lat_out(nlon_dst, nlat_dst),
+     .        src_dist(nlon_dst,nlat_dst,num_nbrs)
+
+      logical found_neighbors(nlon_dst,nlat_dst), src_modulo
+      
+!------local variables ---------------------------------------
+      
+      integer  i, j, n, num_neighbors, map_dst_xsize, map_dst_ysize, 
+     .         map_src_xsize, map_src_ysize, map_src_size
+      real     max_src_dist,
+     .         map_src_dist(nlon_dst,nlat_dst,num_nbrs)
+      
+      logical map_found_neighbors(nlon_dst, nlat_dst)
+
+!--------------------------------------------------------------
+      map_dst_xsize = nlon_dst
+      map_dst_ysize = nlat_dst
+      map_src_xsize = nlon_src
+      map_src_ysize = nlat_src
+      map_src_size = map_src_xsize*map_src_ysize
+      
+      num_neighbors = num_nbrs
+      max_src_dist = max_dist
+      
+!using radial_search to find the nearest points and corresponding distance.
+
+      call radial_search(id, lon_in, lat_in, lon_out, lat_out, 
+     .          map_src_add, map_src_dist, map_found_neighbors,
+     .          num_nbrs, max_dist, src_modulo, nlon_src, nlat_src,
+     .          nlon_dst, nlat_dst, map_src_size )
+      
+      do j=1,map_dst_ysize
+      do i=1,map_dst_xsize
+         do n=1,num_neighbors
+            if(map_src_add(i,j,n) .EQ. 0) then
+               jlat(n) = 0
+               ilon(n) = 0
+            else
+               jlat(n) = map_src_add(i,j,n)/map_src_xsize + 1
+               ilon(n) = map_src_add(i,j,n) - (jlat(n)-1)*map_src_xsize
+               if(ilon(n) .EQ. 0) then
+                  jlat(n) = jlat(n) - 1
+                  ilon(n) = map_src_xsize
+               endif
+            endif
+            i_lon(i,j,n) = ilon(n)
+            j_lat(i,j,n) = jlat(n)
+         enddo
+      
+      enddo
+      enddo
+      
+      do j=1,map_dst_ysize
+      do i=1,map_dst_xsize
+         do n=1,num_neighbors
+            src_dist(i,j,n) = map_src_dist(i,j,n)
+         enddo
+         found_neighbors(i,j) = map_found_neighbors(i,j)
+      enddo
+      enddo
+      
+      nlon_src = map_src_xsize
+      nlat_src = map_src_ysize
+      nlon_dst = map_dst_xsize
+      nlat_dst = map_dst_ysize
+      
+      return
+
+      end ! subroutine horiz_interp_init_sphe
+!#####################################################################
+      
+       subroutine radial_search(id, theta_src, phi_src, theta_dst, 
+     .      phi_dst, map_src_add, map_src_dist, map_found_neighbors, 
+     .      num_nbrs, max_dist, src_modulo, nlon_src, nlat_src,
+     .      nlon_dst, nlat_dst, map_src_size)
+      
+! x_dst,y_dst = destination grid lon,lat
+! x_src,y_src = source grid lon,lat
+
+
+!       theta_src = reshape(x_src,(/map_src_size/))
+!       phi_src = reshape(y_src,(/map_src_size/))
+!       theta_dst(:,:) = x_dst(:,:)
+!       phi_dst(:,:) = y_dst(:,:)      
+
+       integer id, nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs, 
+     .         map_src_add(nlon_dst,nlat_dst,num_nbrs)
+
+       real    theta_src(map_src_size), phi_src(map_src_size),  
+     .         theta_dst(nlon_dst, nlat_dst), 
+     .         phi_dst(nlon_dst, nlat_dst),
+     .         map_src_dist(nlon_dst,nlat_dst,num_nbrs), max_dist
+
+       logical map_found_neighbors(nlon_dst, nlat_dst), src_modulo
+       
+!-------local variables-----------------------------------------
+
+       integer i, j, n, bound, bound_start, bound_end, i0, j0, 
+     .         i_left, i_right, step, step_size, num_neighbors, 
+     .         map_dst_xsize, map_dst_ysize, map_src_xsize, 
+     .         map_src_ysize, map_dst_size, map_src_size
+
+       real    spherical_distance, d, nearest,res, max_src_dist, pi, 
+     .         tpi, hpi, min_theta_dst, max_theta_dst, min_phi_dst, 
+     .         max_phi_dst, min_theta_src, max_theta_src, min_phi_src,
+     .         max_phi_src, pi180
+
+       logical update_dest_neighbors, continue_search, found_neighbors,
+     .         continue_radial_search, result, src_is_modulo
+
+
+!---------------------------------------------------------------
+      
+
+! parameters
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+
+       pi = 4.*ATAN(1.)
+       tpi = 2.0*PI
+       hpi = 0.5*PI
+       
+        pi180 = pi/ 180.
+
+       map_dst_xsize = nlon_dst
+       map_dst_ysize = nlat_dst
+       map_src_xsize = nlon_src
+       map_src_ysize = nlat_src      
+       map_dst_size = map_dst_xsize*map_dst_ysize
+       map_src_size = map_src_xsize*map_src_ysize
+      
+       num_neighbors = num_nbrs
+       if (num_neighbors .LE. 0) call ef_bail_out (id, 
+     .   'num_neighbors must be > 0') 
+      
+       max_src_dist = max_dist
+       src_is_modulo = src_modulo
+      
+       do i = 1, nlon_dst
+       do j = 1, nlat_dst
+       do n = 1, num_nbrs
+          map_src_add(i,j,n) = 0
+          map_src_dist(i,j,n) = large
+       enddo
+       enddo
+       enddo
+      
+       min_theta_dst=tpi
+       max_theta_dst=0.0
+       min_phi_dst=pi
+       max_phi_dst=-pi
+       min_theta_src=tpi
+       max_theta_src=0.0
+       min_phi_src=pi
+       max_phi_src=-pi
+      
+            
+       do i = 1, nlon_dst
+       do j = 1, nlat_dst
+          if(theta_dst(i,j) .LT. 0.0) theta_dst(i,j)=theta_dst(i,j)+tpi
+          if(theta_dst(i,j) .GT. tpi) theta_dst(i,j)=theta_dst(i,j)-tpi
+          if(phi_dst(i,j) .LT. -1.* hpi) phi_dst(i,j) = -1.* hpi
+          if(phi_dst(i,j) .GT. hpi)  phi_dst(i,j) =  hpi
+       enddo
+       enddo
+       
+       do i = 1, map_src_size
+          if(theta_src(i) .LT. 0.0)  theta_src(i) = theta_src(i)+tpi
+          if(theta_src(i) .GT. tpi)  theta_src(i) = theta_src(i)-tpi
+          if(phi_src(i) .LT. -1.* hpi) phi_src(i) = -1.* hpi
+          if(phi_src(i) .GT. hpi)  phi_src(i) =  hpi
+       enddo
+
+       do j=1,map_dst_ysize
+       do i=1,map_dst_xsize
+          min_theta_dst = min(min_theta_dst,theta_dst(i,j))
+          max_theta_dst = max(max_theta_dst,theta_dst(i,j))
+          min_phi_dst = min(min_phi_dst,phi_dst(i,j))
+          max_phi_dst = max(max_phi_dst,phi_dst(i,j))
+       enddo
+       enddo
+      
+       do i=1,map_src_size
+          min_theta_src = min(min_theta_src,theta_src(i))
+          max_theta_src = max(max_theta_src,theta_src(i))
+          min_phi_src = min(min_phi_src,phi_src(i))
+          max_phi_src = max(max_phi_src,phi_src(i))
+       enddo
+      
+!  Note: do comparisons like these with a TM_FPEQ 
+
+c       if (min_phi_dst .LT. min_phi_src) print *, 
+c     .    '=> WARNING:  latitute of dest grid exceeds src: src, dest',
+c     .    min_phi_src, min_phi_dst, ' degrees src, dest:', 
+c     .    min_phi_src/pi180, min_phi_dst/pi180
+c       if (max_phi_dst .GT. max_phi_src) print *, 
+c     .    '=> WARNING:  latitute of dest grid exceeds src: src, dest',
+c     .    max_phi_src, max_phi_dst, ' degrees src, dest:', 
+c     .    max_phi_src/pi180, max_phi_dst/pi180
+c       if (min_theta_dst .LT. min_theta_src) print *, 
+c     .    '=> WARNING : longitude of dest grid exceeds src: src, dest',
+c     .    min_theta_src, min_theta_dst, ' degrees src, dest:', 
+c     .    min_theta_src/pi180, min_theta_dst/pi180
+c       if (max_theta_dst .GT. max_theta_src) print *, 
+c     .    '=> WARNING : longitude of dest grid exceeds src: src, dest',
+c     .    max_theta_src, max_theta_dst, ' degrees src, dest:', 
+c     .    max_theta_src/pi180, max_theta_dst/pi180
+      
+       do j=1,map_dst_ysize
+       do i=1,map_dst_xsize
+          found_neighbors=.false.
+          continue_search=.true.
+          step = 1
+          step_size = 1
+          nearest = 1.e3
+          do while (continue_search .and. step_size .GT. 0)
+             do while (step .LE. map_src_size .and. continue_search)
+! count land points as nearest neighbors
+                d = spherical_distance (theta_dst(i,j), phi_dst(i,j), 
+     .                                 theta_src(step),phi_src(step))
+                if (d .LE. max_src_dist) then
+                   found_neighbors = update_dest_neighbors(
+     .                    i, j, map_src_add, map_src_dist, 
+     .                    step, d, max_src_dist, 
+     .                    nlon_dst, nlat_dst, num_nbrs)
+                   if (found_neighbors) then
+                      n = 0
+                      i0 = mod(step,map_src_xsize)
+                      if (i0 .EQ. 0) i0 = map_src_xsize
+                      res = float(step)/float(map_src_xsize)
+!                     j0 = ceiling(res)
+                      j0 = -1.*INT(-1.*res)
+                      continue_radial_search = .true.
+                      do while (continue_radial_search)
+                         n = n+1 ! radial counter
+! left boundary 
+                         i_left = i0-n
+                         if (i_left .LE. 0) then
+                            if (src_is_modulo) then
+                               i_left = map_src_xsize + i_left
+                            else
+                               i_left = 1
+                            endif
+                         endif
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                  + i_left
+                         bound_end = min(j0+n-1,map_src_ysize-1)*
+     .                                   map_src_xsize + i_left
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         bound = bound_start
+                         continue_radial_search = .false.
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                            phi_dst(i,j), theta_src(bound), 
+     .                            phi_src(bound))
+                            result = update_dest_neighbors(
+     .                        i, j, map_src_add, map_src_dist, 
+     .                        bound, d, max_src_dist,
+     .                        nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + map_src_xsize
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! right boundary 
+                         i_right = i0+n
+                         if (i_right .GT. map_src_xsize) then
+                            if (src_is_modulo) then
+                               i_right = i_right - map_src_xsize
+                            else
+                               i_right = map_src_xsize
+                            endif
+                         endif
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                + i_right
+                         bound_end = min(j0+n-1,map_src_ysize-1)*
+     .                                 map_src_xsize + i_right
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                          phi_dst(i,j),
+     .                          theta_src(bound),phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + map_src_xsize
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! bottom boundary 
+                         bound_start = max(j0-n-1,0)*map_src_xsize 
+     .                                + i_left 
+                         bound_end =  max(j0-n-1,0)*map_src_xsize  
+     .                                + i_right 
+                         if (bound_start .GT. bound_end) then
+                            bound_start = max(j0-n-1,0)*map_src_xsize+1
+                            bound_end = max(j0-n,1)*map_src_xsize
+                         endif
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                          phi_dst(i,j),theta_src(bound),
+     .                          phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + 1
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+! top boundary 
+                         bound_start = min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + i_left
+                         bound_end =  min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + i_right
+                         if (bound_start .GT. bound_end) then
+                            bound_start = min(j0+n-1,map_src_ysize-1)*
+     .                          map_src_xsize + 1
+                            bound_end = min(j0+n,map_src_ysize-1)*
+     .                          map_src_xsize
+                         endif
+                         bound = bound_start
+                         if (bound_end .GT. map_src_size) 
+     .                      call ef_bail_out(id, 'array size error')
+                         do while (bound .LE. bound_end)
+                            d = spherical_distance (theta_dst(i,j),
+     .                            phi_dst(i,j), theta_src(bound),
+     .                            phi_src(bound))
+                            result = update_dest_neighbors(
+     .                          i, j, map_src_add, map_src_dist, 
+     .                          bound, d, max_src_dist,
+     .                          nlon_dst, nlat_dst, num_nbrs)
+                            bound = bound + 1
+                            if (result) continue_radial_search = .true.
+                            if (result) found_neighbors = .true.
+                         enddo
+                      enddo
+                      continue_search = .false. ! stop looking
+                   endif
+                endif
+                step=step+step_size
+             enddo ! search loop
+             step = 1
+             step_size = step_size/2
+          enddo
+          map_found_neighbors(i,j) = found_neighbors
+       enddo 
+       enddo
+      
+     .                                
+      return
+      
+      end !  subroutine radial_search
+      
+!#####################################################################
+
+      real function spherical_distance(theta1,phi1,theta2,phi2)
+
+* Argument definitions
+      real theta1, phi1, theta2, phi2
+
+* local variable definitions
+      real r1(3), r2(3), cross(3), s, dot, ang, pi
+
+! parameters
+      real epsln
+cc      parameter (epsln=1.e-10)
+      parameter (epsln=4.e-7)
+
+! this is a simple, enough way to calculate distance on the sphere
+! first, construct cartesian vectors r1 and r2
+! then calculate the cross-product which is proportional to the area
+! between the 2 vectors.  The angular distance is arcsin of the 
+! distancealong the sphere
+!
+! theta is longitude and phi is latitude
+!
+
+      pi =  4.*ATAN(1.)
+
+      r1(1) = cos(theta1)*cos(phi1)
+      r1(2)=sin(theta1)*cos(phi1)
+      r1(3)=sin(phi1)
+
+      r2(1) = cos(theta2)*cos(phi2)
+      r2(2)=sin(theta2)*cos(phi2)
+      r2(3)=sin(phi2)
+
+      cross(1) = r1(2)*r2(3)-r1(3)*r2(2)
+      cross(2) = r1(3)*r2(1)-r1(1)*r2(3)
+      cross(3) = r1(1)*r2(2)-r1(2)*r2(1)
+
+      s = sqrt(cross(1)**2.+cross(2)**2.+cross(3)**2.)
+
+      s = min(s,1.0-epsln)
+
+      dot = r1(1)*r2(1) + r1(2)*r2(2) + r1(3)*r2(3)
+
+      if (dot .GT. 0) then
+          ang = asin(s)
+      else if (dot .LT. 0) then
+          ang = pi - asin(s)
+      else
+          ang = pi/2.
+      endif
+      
+      spherical_distance = abs(ang) ! in radians
+      
+      return
+      
+      end ! function spherical_distance
+
+!#####################################################################
+      logical function update_dest_neighbors(i, j, map_src_add, 
+     .             map_src_dist, src_add, d, max_src_dist, nx, ny, nn)
+ 
+* Argument definitions
+       integer i, j, nx, ny, nn, map_src_add(nx, ny, nn), src_add
+       real map_src_dist(nx, ny, nn), d, max_src_dist
+
+* local variables
+      integer n,m, num_neighbors
+
+      update_dest_neighbors = .false.
+      num_neighbors = nn
+
+! if (d .le. max_src_dist) then
+!    NLOOP : do n=1,num_neighbors
+!       DIST_CHK : if (d .lt. map_src_dist(n)) then
+!          if (n > 1 .and. src_add == map_src_add(n-1)) exit NLOOP
+!          do m=num_neighbors,n+1,-1
+!             map_src_add(m) = map_src_add(m-1)
+!             map_src_dist(m) = map_src_dist(m-1)
+!          enddo
+!          map_src_add(n) = src_add
+!          map_src_dist(n) = d
+!          update_dest_neighbors = .true.
+!          exit NLOOP ! n loop
+!       endif DIST_CHK
+!   end do NLOOP
+! endif
+
+      if (d .le. max_src_dist) then
+         do n=1,num_neighbors 
+            if (d .lt. map_src_dist(i,j,n)) then 
+cc               if (n .GT. 1 .and. src_add .NE. map_src_add(i,j,n-1)) 
+ccc               if (n .GT. 1 .and. src_add .EQ. map_src_add(i,j,n-1)) 
+ccc     .             GOTO 100
+               do m=num_neighbors,n+1,-1
+                  map_src_add(i,j,m) = map_src_add(i,j,m-1)
+                  map_src_dist(i,j,m) = map_src_dist(i,j,m-1)
+               enddo
+               map_src_add(i,j,n) = src_add
+               map_src_dist(i,j,n) = d
+               update_dest_neighbors = .true.
+               goto 100
+            endif 
+         end do 
+  100    continue
+
+      endif
+
+      return
+      end ! function update_dest_neighbors
+
+
+
+!#######################################################################
+            
+       subroutine save_mapping (src_dist, wt, 
+     .      found_neighbors, i_lon, j_lat, max_src_dist,  
+     .      nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs,
+     .      bad_flag_result, result)
+
+! compute wt, i_lon, and j_lat and save in the result.
+! result(nlon_dst,nlat_dst,num_nbrs,3)  where num_nbrs = 4 and
+! 
+!   result(m,n,k,1) = wt(m,n,k)
+!   result(m,n,k,2) = i_lon(m,n,k)
+!   result(m,n,k,3) = j_lat(m,n,k)
+
+! acm 12/2004 Compute the sum of weights in apply_mapping in function 
+!             curv_to_rect; weights only used when there is good data 
+!             contributing to the destination grid cell.
+
+       integer nlon_src, nlat_src, nlon_dst, nlat_dst, num_nbrs
+
+       real src_dist(nlon_dst, nlat_dst, num_nbrs)
+       real wt(nlon_dst, nlat_dst, num_nbrs)  
+       real max_src_dist, bad_flag_result
+
+       integer i_lon(nlon_dst,nlat_dst,num_nbrs)
+       integer j_lat(nlon_dst,nlat_dst,num_nbrs) 
+
+!  Result contains wts, neighbors, for applying the regridding
+       real result(nlon_dst, nlat_dst, num_nbrs, 3)  
+
+       logical found_neighbors(nlon_dst,nlat_dst)
+
+!--- some local variables ----------------------------------------
+       integer nlon_in, nlat_in, nlon_out, nlat_out, num_neighbors,
+     .               m, n, k, i1, i2, j1, j2
+!-----------------------------------------------------------------
+      
+      real epsln, large
+cc      parameter (epsln=1.e-10, large=1.e20)
+      parameter (epsln=4.e-7, large=1.e20)
+      
+         nlon_in  = nlon_src
+         nlat_in  = nlat_src
+         nlon_out = nlon_dst
+         nlat_out = nlat_dst   
+         num_neighbors = num_nbrs
+
+!first calculate destination weight
+      
+         do m=1,nlon_out
+         do n=1,nlat_out
+
+! neighbors are sorted nearest to farthest
+! check nearest to see if it is a land point
+
+            i1 = i_lon(m,n,1)
+            j1 = j_lat(m,n,1)
+      
+            if(num_neighbors .gt. 1 ) then
+               i2 = i_lon(m,n,2)
+               j2 = j_lat(m,n,2)
+            endif
+      
+            do k=1, num_neighbors
+              if (src_dist(m,n,k) .LE. epsln) then
+                 wt(m,n,k) = large
+              else if(src_dist(m,n,k) .LE. max_src_dist ) then
+                 wt(m,n,k) = 1.0/src_dist(m,n,k)
+              else
+                 wt(m,n,k) = 0.0
+              endif
+           enddo
+
+         enddo
+         enddo
+      
+! Save wt, i_lon, j_lat for this curvi/rect grid pair.
+
+         do m=1,nlon_out
+         do n=1,nlat_out
+            do k=1, num_neighbors
+               result(m,n,k,1) = wt(m,n,k)
+               result(m,n,k,2) = i_lon(m,n,k)
+               result(m,n,k,3) = j_lat(m,n,k)
+            enddo
+         enddo
+         enddo
+      
+         return
+       end ! subroutine save_mapping
diff --git a/fer/efi/date1900.F b/fer/efi/date1900.F
new file mode 100644
index 0000000..dd1d9c1
--- /dev/null
+++ b/fer/efi/date1900.F
@@ -0,0 +1,216 @@
+*
+* date1900.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Dac, 2000
+*  5/2007 *acm* Fixing bug 1510. Return the result from date_decode as
+*               an argument rather than a return from function; under
+*               64-bit the return always yielded 0.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE date1900_init (id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert a date into Julian days since 1-Jan-1900' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name (id, arg, 'formatted date')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'dd-MMM-yy or dd-MMM-yyyy  (e.g. "20-Dec-00")')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE date1900_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE date1900_compute (id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+        INTEGER slen
+        CHARACTER str_date*12
+        REAL res
+        INTEGER TM_LENSTR1
+
+        CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+        CALL ef_get_arg_string(id, 1, str_date)
+
+* make it a null-terminated string
+        slen = MIN(TM_LENSTR1(str_date)+1,12)
+        str_date(slen:slen) = CHAR(0)
+
+        CALL DATE_DECODE(str_date, res)
+        IF ( res .EQ. -1E34 ) THEN
+          result(memreslox, memresloy, memresloz,
+     .           memreslot, memresloe, memreslof) = bad_flag_result
+        ELSE
+          result(memreslox, memresloy, memresloz,
+     .           memreslot, memresloe, memreslof) = res
+        ENDIF
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/date_decode.c b/fer/efi/date_decode.c
new file mode 100644
index 0000000..4b06faa
--- /dev/null
+++ b/fer/efi/date_decode.c
@@ -0,0 +1,117 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL
+,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+/*
+  Code to perform decoding of formatted dates and times
+  called by date1900.F
+  8/2006 *acm* add dummy 5th argument to days_from_day0,
+               needed by ez_delimited_read for 64-big build.
+  5/2007 *acm* Fixing bug 1510.  Return the result as an argument rather
+               than a return from function; under 64-bit the return
+			   always yielded 0.
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferret.h.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "ferret.h"
+
+
+DFTYPE FORTRAN(days_from_day0) (double* days_1900, int* iyr, int* imon,
+                               int* iday, DFTYPE* rdum);
+void FORTRAN(date_decode) (char *strdate, DFTYPE *rdum);
+
+
+
+void FORTRAN(date_decode) (char *strdate, DFTYPE *res)
+{
+
+  int id,im,iy, ok;
+  char str3[4],str1[2];
+  char months[13][4] = {"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
+  DFTYPE rdum, adate;
+  double days_1900 = 59958230400.0 / (60.*60.*24.);
+
+  if (sscanf(strdate,"%d/%d/%d%1s",&im,&id,&iy,str1) == 3)
+    /* date as mm/dd/yy */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strdate,"%d-%d-%d%1s",&iy,&im,&id,str1) == 3)
+    /* date as yyyy-mm-dd */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strdate,"%d-%3s-%d%1s",&id,str3,&iy,str1) == 3)
+    /* date as dd-MMM-yy or dd-MMM-yyyy*/
+    {
+      /* 2 digit year */
+      if (iy < 30)   /* will break after 2029 or before 1930 */
+	iy += 2000;
+      else if (iy<100)
+	iy += 1900;
+      
+      /* translate month name */
+      ok = 0;
+      for (im=0; im<12; im++)
+	{
+	  if (strcasecmp(str3,months[im])==0)
+	    {
+	      im++;
+	      ok = 1;
+	      break;
+	    }
+	}
+    }
+  else
+    {
+      ok = 0;
+    }    
+
+  if (ok) {
+    adate = days_from_day0_(&days_1900,&iy,&im,&id,&rdum); 
+    *res = rdum;
+  }
+  else
+    *res = -1.e34;
+
+}
+
diff --git a/fer/efi/day_of_year.F b/fer/efi/day_of_year.F
new file mode 100644
index 0000000..87f500c
--- /dev/null
+++ b/fer/efi/day_of_year.F
@@ -0,0 +1,78 @@
+      subroutine day_of_year(amo, ada, ayr, status, err_msg)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C  ACM 
+C  Find sequential day of the year corresponding to month, day, year. 
+C  Return sequential day in variable ada.
+C  4/2001  *ACM* add error message
+C   3/12   *kms* remove leap day from appropriate century years
+
+      REAL daymo(12)           ! Number of days in each month
+      DATA daymo/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
+      REAL amo, ada, ayr
+      INTEGER iyr, imo, i, status
+      CHARACTER*(*) err_msg
+
+      status = 0
+      iyr = ayr
+      IF ( (MOD(iyr, 400) .EQ. 0) .OR.
+     .     ( (MOD(iyr, 4) .EQ. 0) .AND. 
+     .       (MOD(iyr, 100) .NE. 0) ) ) THEN
+         daymo(2) = 29
+      ENDIF
+
+      imo = amo
+      IF (imo .LT. 1  .OR.  imo .GT. 12) THEN
+         WRITE (err_msg,*) 'Month less than 1 or greater than 12', imo
+         GO TO 1000
+      ENDIF
+
+      IF (ada .LT. 0  .OR. ada .GT. daymo(imo)) THEN
+         WRITE (err_msg,10) ada, imo
+   10    FORMAT ('Day ', F4.0, ' out of range for month', I3)
+         GO TO 1000
+      ENDIF
+
+      DO 100 i = 1, imo-1
+         ada = ada + daymo(i)
+  100 CONTINUE
+
+      daymo(2) = 28  ! value otherwise incorrectly saved
+      RETURN
+
+1000  status = 1
+      daymo(2) = 28  
+      RETURN
+      END
diff --git a/fer/efi/days1900toymdhms.F b/fer/efi/days1900toymdhms.F
new file mode 100644
index 0000000..921d7b9
--- /dev/null
+++ b/fer/efi/days1900toymdhms.F
@@ -0,0 +1,253 @@
+*
+* days1900toymdhms.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Jan, 2001
+*
+* 12/12/02 *acm* bug fix: define the REAL*8 parameter  psecsto1900 using a 
+*                double precision constant .D0; the constant lost precision
+*                under linux.
+
+* This function converts a Julian day from 1-jan-1900 to a trio of 3 values
+* on the Z axis: year, month, day
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE days1900toymdhms_init (id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert Julian day to values y,m,d,h,m,s on k=1,...,6' )
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 0)
+
+
+      arg = 1
+      CALL ef_set_arg_name (id, arg, 'day1900')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Julian day counted from 1-jan-1900')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE days1900toymdhms_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+* 3 output values: year, month, day 
+        CALL EF_SET_AXIS_LIMITS(id, Z_AXIS, 1, 6)
+        
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE days1900toymdhms_compute (id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+        INTEGER i, j, k, l, m, n, k1, yr, mon, day, hr, min
+        REAL sec
+        REAL*8 num_secs
+
+        REAL*8  psecsto1900  ! seconds from 1-jan-0000 to 1-jan-1900
+        PARAMETER ( psecsto1900 = 59958230400.D0 )
+
+* get the subscripting limits and flags
+        CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+        CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+        CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure that we were not passes a span along the Z axis
+        IF (arg_lo_ss(Z_AXIS,1) .NE.  arg_hi_ss(Z_AXIS,1)) CALL
+     .          EF_BAIL_OUT(id, 'Cannot handle a Z range on argument') 
+
+* loop over all of the input values
+* assumes input and result array dimension limits are the same
+        k1 = arg_lo_ss(Z_AXIS,1)
+        DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+          DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+              DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF ( arg_1(i,j,k1,l,m,n) .EQ. bad_flag(1) ) THEN
+
+                    DO 90 k = 1, 6
+ 90                 result(i,j,k,l,m,n) = bad_flag_result
+
+                  ELSE
+
+                    num_secs = 24.D0*60.D0*60.D0 * arg_1(i,j,k1,l,m,n)
+     .                       + psecsto1900
+                    CALL SECS_TO_YMDHMS( num_secs,
+     .                                   yr, mon, day, hr, min, sec )
+                    result(i,j,1,l,m,n) = FLOAT(yr)
+                    result(i,j,2,l,m,n) = FLOAT(mon)
+                    result(i,j,3,l,m,n) = FLOAT(day)
+                    result(i,j,4,l,m,n) = FLOAT(hr)
+                    result(i,j,5,l,m,n) = FLOAT(min)
+                    result(i,j,6,l,m,n) = sec
+
+                 END IF
+
+ 100           CONTINUE
+ 200         CONTINUE
+ 400       CONTINUE
+ 500     CONTINUE
+ 600   CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/ecat.F b/fer/efi/ecat.F
new file mode 100644
index 0000000..02a7469
--- /dev/null
+++ b/fer/efi/ecat.F
@@ -0,0 +1,270 @@
+*
+* ecat.F
+*
+* Ansley Manke
+* May 2012
+*
+* This function returns the T values of the two variables,
+* concatenated into one long list on an abstract t axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ecat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the E values of two variables into one ',
+     .        'list on an abstract E axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'ECAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ecat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nm
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nm = (arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, E_AXIS, 1, nm)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ecat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+
+* concatenate in E - dont restart count of index M
+
+      DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 510  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/ecat_str.F b/fer/efi/ecat_str.F
new file mode 100644
index 0000000..79fd5fd
--- /dev/null
+++ b/fer/efi/ecat_str.F
@@ -0,0 +1,272 @@
+*
+* ecat_str.F
+*
+* Ansley Manke
+* May 2012
+
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract E axis. Other
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE ecat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* *********************************************************************S*
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the E values of two string variables ',
+     .        'into one list on an abstract E axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .                                ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE ecat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nm
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nm = (arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, E_AXIS, 1, nm)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ecat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+* concatenate in E - dont restart count of index M
+
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 510  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/element_index.F b/fer/efi/element_index.F
new file mode 100644
index 0000000..f355b36
--- /dev/null
+++ b/fer/efi/element_index.F
@@ -0,0 +1,215 @@
+*
+* element_index.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+*
+*   3/12 *kms* Give index into unraveled arg_2
+*              instead of just I index of arg_2
+*              (and add E and F dimensions)
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE element_index_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Return index value in ARG2 for each point in ARG1')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'Variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'list of indices')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE element_index_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ndx
+      INTEGER i, j, k, l, m, n
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for values matching arg2
+C  Assumes result and arg_1 have same array dimension limits
+
+      DO 300 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 300 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 300 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 300 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         ndx = 1
+         DO 100 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+         DO 100 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+         DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+         DO 100 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+         DO 100 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+         DO 100 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            IF ( arg_1(i,j,k,l,m,n) .NE. bad_flag(1) .AND.
+     .           arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(2) .AND.
+     .           arg_1(i,j,k,l,m,n) .EQ. arg_2(i2,j2,k2,l2,m2,n2) ) THEN
+               result(i,j,k,l,m,n) = ndx
+               GOTO 200
+            ENDIF
+            ndx = ndx + 1
+ 100     CONTINUE
+
+C        If we got here it was not found
+         result(i,j,k,l,m,n) = bad_flag_result
+
+ 200     CONTINUE
+
+ 300  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/element_index_str.F b/fer/efi/element_index_str.F
new file mode 100644
index 0000000..22eb4aa
--- /dev/null
+++ b/fer/efi/element_index_str.F
@@ -0,0 +1,241 @@
+*
+* element_index_str_n.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+*
+*   3/12 *kms* Give index into unraveled arg_2 instead of just I index of arg_2;
+*              increased max string length compared from 20 to 128;
+*              add check for string lengths .GT. 0;
+*              and add E and F dimensions
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE element_index_str_n_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT (
+     .'Return index value in ARG2 for each string in ARG1 ',
+     .'(case sensitive matching)')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'string data to mask')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'STRINGS')
+      CALL ef_set_arg_desc(id, arg, 'list of strings to match')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE element_index_str_n_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER arg, ndx
+      INTEGER i, j, k, l, m, n
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER slen1, slen2
+      CHARACTER text1*128, text2*128
+
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+C  Assumes result and arg_1 have same array dimension limits
+
+      DO 300 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 300 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 300 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 300 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         arg = 1
+         CALL ef_get_string_arg_element_6d(id, arg, arg_1, 
+     .                      i, j, k, l, m, n, slen1, text1)
+ 
+         ndx = 1
+         DO 100 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+         DO 100 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+         DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+         DO 100 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+         DO 100 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+         DO 100 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            arg = 2
+            CALL ef_get_string_arg_element_6d(id, arg, arg_2, 
+     .                         i2, j2, k2, l2, m2, n2, slen2, text2)
+            IF ( slen1 .GT. 0 .AND.
+     .           slen2 .GT. 0 .AND.
+     .           slen1 .EQ. slen2 ) THEN
+              IF ( text1(:slen1) .EQ. text2(:slen2) ) THEN
+                 result(i,j,k,l,m,n) = ndx
+                 GOTO 200
+              ENDIF
+            ENDIF
+            ndx = ndx + 1
+ 100     CONTINUE
+
+C        If we got here it was not found
+         result(i,j,k,l,m,n) = bad_flag_result
+
+ 200     CONTINUE
+
+ 300  CONTINUE
+ 
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/fer/efi/element_index_str_n.F b/fer/efi/element_index_str_n.F
new file mode 100644
index 0000000..a05ac1f
--- /dev/null
+++ b/fer/efi/element_index_str_n.F
@@ -0,0 +1,242 @@
+*
+* element_index_str.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+*
+*   3/12 *kms* Give index into unraveled arg_2 instead of just I index of arg_2;
+*              increased max string length compared from 20 to 128;
+*              add check for string lengths .GT. 0;
+*              and add E and F dimensions
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE element_index_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT (
+     .'Return index value in ARG2 for each string in ARG1 ',
+     .'(case insensitive matching)')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'string data to mask')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'STRINGS')
+      CALL ef_set_arg_desc(id, arg, 'list of strings to match')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE element_index_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER arg, ndx
+      INTEGER i, j, k, l, m, n
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER slen1, slen2
+      INTEGER STR_UPCASE, status
+      CHARACTER text1*128, text2*128
+      CHARACTER text1up*128, text2up*128
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+C  Assumes result and arg_1 have same array dimension limits
+
+      DO 300 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 300 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 300 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 300 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         arg = 1
+         CALL ef_get_string_arg_element_6d(id, arg, arg_1, 
+     .                      i, j, k, l, m, n, slen1, text1)
+
+         ndx = 1
+         DO 100 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+         DO 100 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+         DO 100 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+         DO 100 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+         DO 100 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+         DO 100 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            arg = 2
+            CALL ef_get_string_arg_element_6d(id, arg, arg_2, 
+     .                         i2, j2, k2, l2, m2, n2, slen2, text2)
+            IF ( slen1 .GT. 0 .AND.
+     .           slen2 .GT. 0 .AND.
+     .           slen1 .EQ. slen2 ) THEN
+               status = STR_UPCASE(text1up,text1)
+               status = STR_UPCASE(text2up,text2)
+               IF ( text1up(:slen1) .EQ. text2up(:slen2) ) THEN
+                  result(i,j,k,l,m,n) = ndx
+                  GO TO 200
+               ENDIF
+            ENDIF
+            ndx = ndx + 1
+ 100     CONTINUE
+
+C        If we got here it was not found
+         result(i,j,k,l,m,n) = bad_flag_result
+
+ 200     CONTINUE
+
+ 300  CONTINUE
+ 
+      RETURN
+      END
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/fer/efi/eof_space.F b/fer/efi/eof_space.F
new file mode 100644
index 0000000..0836876
--- /dev/null
+++ b/fer/efi/eof_space.F
@@ -0,0 +1,633 @@
+*
+*  eof_space.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Sep 1998
+* Aug 2000 change fcn description; argument can be fcn of Z as well as x,y,t
+* May 2001 Use simpler solver EOFIN when frac_timeser = 1.
+*
+* Jul 2001 Move to statically linked code in fer/efi. 
+* Jul 2001 Move count_eof and pack_eof to file eofsubs.f, rename solve_eof
+*          to solve_eof_space.
+*          Make the function work w/ data having multiple depths: compute
+*          EOF solution for each depth.
+* Aug 2001 move to fer/efi directory, to be statically linked to Ferret.  
+*	   Change INCLUDE statements to remove directory spec.  
+* Feb 2003 Add a test that NEOF <= max_neof, which is dictated by work
+*          arrays in the solvers in TRIDIN in eofsubs.F
+* Jun 2003 Workspace arrays need to be initialized for each vertical level.
+* Sep 2005 Remove the max_eof test; make all workspace be allocated as 
+*          external function work arrays.
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field.  Based on programs (coadseof.f, etc.) by Dai McClurg and 
+* Ansley Manke and calls Billy Kessler's method for finding EOFs  of NON-gappy 
+* time series EOFIN, or optionally his implementation of Chelton's '82 method 
+* for finding EOFs of gappy time series.
+*
+* Return Spatial EOF's
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eof_space_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+c      CALL ef_set_desc(id, 'Compute EOF spacial fields from XYT field')
+      CALL ef_set_desc(id, 'Function NOT AVAILABLE in this Ferret version')
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .                     'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'frac_timeser')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     . 'Use only those time series with this fraction valid data')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eof_space_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eof_space_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /EOFXYSTOR/ mx
+      INTEGER mx1, my1, mt1, mx, mxmt, mxmx
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx * mx + 10
+
+*  val
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  taf
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  pct
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  vec
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  c
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  ddat_1d
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  isave_jsave
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+*  ok
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+*  eofwork
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,  1, 1, 1, 1, 1,
+     .                               mx, 10, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE  eof_space_compute(id, arg_1, arg_2, result, 
+     .       val, taf, pct, vec, c, ddat_1d, isave_jsave, ok, eofwork)
+
+*  arg_1  variable, function of (x,y,t)
+*  result NX*NY eigenvectors
+
+*  Work arrays:
+*  val, taf, pct, vec, c, ddat_1d, isave_jsave, ok
+
+*  val(neof)	eigenvalues (Lambda)
+*  result == vec(neof,neof) eigenvectors (Lambda*U). Same units as data.
+*  taf(neof,nt)	time amplitude functions (V). Dimensionless.
+*  pct(neof)	% variance represented by each EOF.
+*  c(neof,neof)	work space for cov matrix (garbage output)
+*  isave_jsave  save the locations of the data in the x-y plane
+*  eofwork	used by QRSYM and other solver routines; replaces
+*		original ALPHA, BETA, BB, and P arrays.
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      COMMON /EOFXYSTOR/ mx
+      INTEGER mx
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+      REAL val(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL taf(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .         wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .         wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL pct(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .         wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .         wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL vec(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .         wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .         wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL c(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .       wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .       wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL ddat_1d(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .             wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .             wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL ok(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+      
+      WRITE (err_msg,*)
+     .  'Function EOF_SPACE not available in this version of Ferret. Use EOFSVD_SPACE'
+      CALL ef_bail_out (id, err_msg)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+*  Get time percent parameter.
+
+      frac_timeser = arg_2(arg_lo_ss(X_AXIS,ARG2), 
+     .                     arg_lo_ss(Y_AXIS,ARG2),
+     .                     arg_lo_ss(Z_AXIS,ARG2), 
+     .                     arg_lo_ss(T_AXIS,ARG2),
+     .                     arg_lo_ss(E_AXIS,ARG2),
+     .                     arg_lo_ss(F_AXIS,ARG2))
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            val(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            vec(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            c(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            ddat_1d(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            eofwork(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+
+*  Find the number of eofs to solve for.
+*  neof = number of (x,y) points with frac_timeser good data.  
+*  Set OK to mark where they are.   (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) then
+            GOTO 5010
+         ENDIF
+
+*  Put the data into the array ddat_1d(neof,nt) 
+
+         CALL pack_ef (arg_1, ddat_1d, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eof_space (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag(ARG1), bad_flag_result,
+     .            frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) GOTO 5020
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eof_space (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag_dat, bad_flag_result, 
+     .            frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nt, k, m, n
+      REAL ddat_1d(neof,nt)
+      REAL val(*)
+      REAL vec(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL c(neof, neof)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER ier
+
+* local variables
+      INTEGER i, j, l, mm, nn, is, js
+
+      IF (frac_timeser .LT. 1.) THEN
+         CALL EOFIN_CHEL_GAP (ddat_1d, neof, nt, val, vec, taf, pct, c, 
+     .            eofwork, bad_flag_dat, bad_flag_result, err_msg, ier)
+         IF (ier .NE. 0) RETURN
+      ELSE
+         CALL EOFIN(ddat_1d, neof, nt, val, vec, taf, pct, c, eofwork)
+      ENDIF
+
+*  Result is the eigenvectors.
+
+      DO 130 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 120 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  110       CONTINUE
+  120    CONTINUE
+  130 CONTINUE
+
+      DO 220 nn = 1, neof
+         DO 210 mm = 1, neof
+            IF (res_lo_ss(X_AXIS) .EQ. ef_unspecified_int4) THEN
+               is = ef_unspecified_int4
+            ELSE
+               is = res_lo_ss(X_AXIS) + isave_jsave(mm,1,1,1,1,1) - 1
+            ENDIF
+
+            IF (res_lo_ss(Y_AXIS) .EQ. ef_unspecified_int4) THEN
+               js = ef_unspecified_int4
+            ELSE
+               js = res_lo_ss(Y_AXIS) + isave_jsave(mm,2,1,1,1,1) - 1
+            ENDIF
+
+            result(is,js,k,nn,m,n) = vec(mm,nn)
+
+  210    CONTINUE
+  220 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eof_stat.F b/fer/efi/eof_stat.F
new file mode 100644
index 0000000..5f5c220
--- /dev/null
+++ b/fer/efi/eof_stat.F
@@ -0,0 +1,652 @@
+*
+*  eof_stat.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 1999
+* Aug 2000 change fcn description; argument can be fcn of Z as well as x,y,t
+* May 2001 change to simpler solver EOFIN  (time series all need to be filled
+*
+* Jul 2001 Move to statically linked code in fer/efi. 
+* Jul 2001 move count_eof and pack_eof to file eofsubs.f, rename solve_eof
+*          to solve_eof_stat.
+*          Make the function work w/ data having multiple depths: compute
+*          EOF solution for each depth.
+* Aug 2001 move to fer/efi directory, to be statically linked to Ferret.  
+*	   Change INCLUDE statements to remove directory spec.
+* Feb 2003 Add a test that NEOF <= max_neof, which is dictated by work
+*          arrays in the solvers in TRIDIN in eofsubs.F
+* Jun 2003 Workspace arrays need to be initialized for each vertical level.
+* Sep 2005 Remove the max_eof test; make all workspace be allocated as 
+*          external function work arrays.
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field.  Based on programs (coadseof.f, etc.) by Dai McClurg and 
+* Ansley Manke and calls Billy Kessler's method for finding EOFs  of NON-gappy 
+* time series EOFIN, or optionally his implementation of Chelton's '82 method 
+* for finding EOFs of gappy time series.
+*
+* Return statistics: number of eof's computed, percent variance explained
+* by each EOF, and the eigenvalue for each EOF.
+* x-axis is abstract length nx*ny; listing the statistics for each EOF.
+* y-axis is length 3: 
+*    1st is the # of eof's computed
+*    2nd is the Pct variation for each eof
+*    3rd is the eigenvalue for each eof.
+*
+*
+* In this SUBROUTINE we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eof_stat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 fcn_desc
+
+c   10 FORMAT ('EOF statistics from XYT field. j=1:#EOFs, ',
+c     .        'j=2:%variation, j=3:eigenvalues' )
+c      WRITE (fcn_desc, 10) 
+c      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_desc(id, 'Function NOT AVAILABLE in this Ferret version')
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'frac_timeser')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     . 'Use only those time series with this fraction valid data.')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eof_stat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eof_stat_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays,  X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /eof_statSTOR/ mx
+      INTEGER mx1, my1, mt1, mx, mxmt, mxmx
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx* mx + 10
+
+*  val
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  taf
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  pct
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  vec
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  c
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  ddat_1d
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  isave_jsave
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+*  ok
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+*  eofwork
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,  1, 1, 1, 1, 1,
+     .                               mx, 10, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE  eof_stat_compute(id, arg_1, arg_2, result, 
+     .       val, taf, pct, vec, c, ddat_1d, isave_jsave, ok, eofwork)
+
+*  arg_1  variable, function of (x,y,t)
+
+*  result(i, 1,. ,. )    # eigenfunctions.
+*  result(i, 2,. ,. )    pct variation for eigenfuncton i.
+*  result(i, 3,. ,. )    eigenvalue for eigenfuncton i.
+
+*  Work arrays:
+*  val, taf, pct, vec, c, ddat_1d, isave_jsave, ok
+*  val(neof)	eigenvalues (Lambda)
+*  taf(neof,nt)	time amplitude functions (V). Dimensionless.
+*  pct(neof)	% variance represented by each EOF.
+*  c(neof,neof)	work space for cov matrix (garbage output)
+*  isave_jsave  save the locations of the data in the x-y plane
+*  eofwork	used by QRSYM and other solver routines; replaces
+*		original ALPHA, BETA, BB, and P arrays.
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      COMMON /eof_statSTOR/ mx
+      INTEGER mx
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+      REAL val(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL taf(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .         wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .         wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL pct(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .         wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .         wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL vec(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .         wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .         wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL c(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .       wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .       wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL ddat_1d(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .             wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .             wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL ok(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, max_neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+      
+      WRITE (err_msg,*)
+     .  'Function EOF_STAT not available in this version of Ferret. Use EOFSVD_STAT'
+      CALL ef_bail_out (id, err_msg)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+*  Get time percent parameter.
+
+      frac_timeser = arg_2(arg_lo_ss(X_AXIS,ARG2), 
+     .                     arg_lo_ss(Y_AXIS,ARG2),
+     .                     arg_lo_ss(Z_AXIS,ARG2), 
+     .                     arg_lo_ss(T_AXIS,ARG2),
+     .                     arg_lo_ss(E_AXIS,ARG2),
+     .                     arg_lo_ss(F_AXIS,ARG2))
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            val(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            vec(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            c(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            ddat_1d(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            eofwork(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+*  Find the number of eofs to solve for.
+*  neof = number of (x,y) points with frac_timeser  good data.  
+*  Set OK to mark where they are.  (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), frac_timeser, err_msg, ier)
+         IF (ier .ne. 0) then
+            GOTO 5010
+         ENDIF
+
+*  Put the data into the array ddat_1d(neof,nt) 
+
+         CALL pack_ef (arg_1, ddat_1d, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eof_stat (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag(ARG1), bad_flag_result,
+     .            frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) GOTO 5020
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eof_stat (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag_dat, bad_flag_result, 
+     .            frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nt, k, m, n
+      REAL ddat_1d(neof,nt)
+      REAL val(*)
+      REAL vec(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL c(neof, neof)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER ier
+
+* local variables
+      INTEGER i, j, l
+
+      IF (frac_timeser .LT. 1.) THEN
+         CALL EOFIN_CHEL_GAP (ddat_1d, neof, nt, val, vec, taf, pct, c, 
+     .            eofwork, bad_flag_dat, bad_flag_result, err_msg, ier)
+         IF (ier .NE. 0) RETURN
+      ELSE
+         CALL EOFIN(ddat_1d, neof, nt, val, vec, taf, pct, c, eofwork)
+      ENDIF
+
+*  Result for j = 1 is the # eigenfunctions.
+
+      j =  res_lo_ss(Y_AXIS)
+      DO 130 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            result(i,j,k,l,m,n) = neof
+  110    CONTINUE
+  130 CONTINUE
+
+*  Result for j = 2 is the percent variation explained by the eigenfunctions
+
+      j =  j + res_incr(Y_AXIS)
+      DO 230 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 210 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = pct(i)
+  210    CONTINUE
+  230 CONTINUE
+
+*  Result for j = 3 is the eigenvalue for each eigenfunction
+
+      j =  j + res_incr(Y_AXIS)
+      DO 330 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 310 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = val(i)
+  310    CONTINUE
+  330 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eof_tfunc.F b/fer/efi/eof_tfunc.F
new file mode 100644
index 0000000..5a60283
--- /dev/null
+++ b/fer/efi/eof_tfunc.F
@@ -0,0 +1,623 @@
+*
+*  eof_tfunc.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Sep 1998
+* Aug 2000 change fcn description; argument can be fcn of Z as well as x,y,t
+* May 2001 Use simpler solver EOFIN when frac_timeser = 1.
+* Jul 2001 Move to statically linked code in fer/efi.
+* Jul 2001 move count_eof and pack_eof to file eofsubs.f, rename solve_eof
+*          to solve_eof_tfunc.
+*          Make the function work w/ data having multiple depths: compute
+*          EOF solution for each depth.
+* Aug 2001 move to fer/efi directory, to be statically linked to Ferret.  
+*	   Change INCLUDE statements to remove directory spec.
+* Feb 2003 Add a test that NEOF <= max_neof, which is dictated by work
+*          arrays in the solvers in TRIDIN in eofsubs.F
+* Jun 2003 Workspace arrays need to be initialized for each vertical level.
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field.  Based on programs (coadseof.f, etc.) by Dai McClurg and 
+* Ansley Manke and calls Billy Kessler's method for finding EOFs  of NON-gappy 
+* time series EOFIN, or optionally his implementation of Chelton's '82 method 
+* for finding EOFs of gappy time series.
+*
+* Return time amplitude functions.
+*
+*
+* In this SUBROUTINE we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eof_tfunc_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+c      CALL ef_set_desc(id,
+c     .   'Compute EOF time functions from XYT field.')
+      CALL ef_set_desc(id, 'Function NOT AVAILABLE in this Ferret version')
+
+      CALL ef_set_num_args(id, 2)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .                     'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'frac_timeser')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     . 'Use only those time series with this fraction valid data')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eof_tfunc_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eof_tfunc_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /eof_tfuncSTOR/ mx
+      INTEGER mx1, my1, mt1, mxmt, mxmx, mx
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx * mx + 10
+
+*  val
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  taf
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  pct
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*  vec
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  c
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmx, 1, 1, 1, 1, 1)
+
+*  ddat_1d
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  isave_jsave
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+*  ok
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+*  eofwork
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,  1, 1, 1, 1, 1,
+     .                               mx, 10, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE  eof_tfunc_compute(id, arg_1, arg_2, result, 
+     .       val, taf, pct, vec, c, ddat_1d, isave_jsave, ok, eofwork)
+
+*  arg_1  variable, function of (x,y,t)
+*  result neof*NT time amplitude functions
+
+*  Work arrays:
+*  val, taf, pct, vec, c, ddat_1d, isave_jsave, ok
+
+*  val(neof)	eigenvalues (Lambda)
+*  result == vec(neof,neof) eigenvectors (Lambda*U). Same units as data.
+*  taf(neof,nt)	time amplitude functions (V). Dimensionless.
+*  pct(neof)	% variance represented by each EOF.
+*  c(neof,neof)	work space for cov matrix (garbage output)
+*  isave_jsave  save the locations of the data in the x-y plane
+*  eofwork	used by QRSYM and other solver routines; replaces
+*		original ALPHA, BETA, BB, and P arrays.
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      COMMON /eof_tfuncSTOR/ mx
+      INTEGER mx
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+      REAL val(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL taf(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .         wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .         wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL pct(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .         wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .         wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL vec(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .         wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .         wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL c(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .       wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .       wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL ddat_1d(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .             wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .             wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL ok(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+
+
+      WRITE (err_msg,*)
+     .  'Function EOF_TFUNC not available in this version of Ferret. Use EOFSVD_TFUNC'
+      CALL ef_bail_out (id, err_msg)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+*  Get time percent parameter.
+
+      frac_timeser = arg_2(arg_lo_ss(X_AXIS,ARG2), 
+     .                     arg_lo_ss(Y_AXIS,ARG2),
+     .                     arg_lo_ss(Z_AXIS,ARG2), 
+     .                     arg_lo_ss(T_AXIS,ARG2),
+     .                     arg_lo_ss(E_AXIS,ARG2),
+     .                     arg_lo_ss(F_AXIS,ARG2))
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            val(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            vec(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            c(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            ddat_1d(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            eofwork(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+*  Find the number of EOFS to solve for.
+*  neof = number of (x,y) points with frac_timeser good data.  
+*  Set OK to mark where they are.  (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) then
+            GOTO 5010
+         ENDIF
+
+*  Put the data into the array ddat_1d(neof,nt) 
+
+         CALL pack_ef (arg_1, ddat_1d, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eof_tfunc (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag(ARG1), bad_flag_result,
+     .            frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) GOTO 5020
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eof_tfunc (ddat_1d, neof, nt, k, m, n, val, vec, 
+     .            taf, pct, c, result, isave_jsave, eofwork, res_lo_ss,
+     .            res_hi_ss, res_incr, bad_flag_dat, bad_flag_result, 
+     .            frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nt, k, m, n
+      REAL ddat_1d(neof,nt)
+      REAL val(*)
+      REAL vec(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL c(neof, neof)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .             wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .             wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER ier
+
+* local variables
+      INTEGER i, j, l, cnt
+
+      IF (frac_timeser .LT. 1.) THEN
+         CALL EOFIN_CHEL_GAP (ddat_1d, neof, nt, val, vec, taf, pct, c, 
+     .            eofwork, bad_flag_dat, bad_flag_result, err_msg, ier)
+         IF (ier .NE. 0) RETURN
+      ELSE
+         CALL EOFIN(ddat_1d, neof, nt, val, vec, taf, pct, c, eofwork)
+      ENDIF
+
+*  Result is the time functions. 
+
+      j = res_lo_ss(Y_AXIS)
+      DO 120 i = 1, neof
+         cnt = 1
+         DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = taf(i,cnt)
+            cnt = cnt + 1
+  110    CONTINUE
+  120 CONTINUE
+
+      DO 220 i = neof+1, res_hi_ss(X_AXIS)
+         DO 210 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = bad_flag_result
+  210    CONTINUE
+  220 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eofsubs.F b/fer/efi/eofsubs.F
new file mode 100644
index 0000000..3d51d5b
--- /dev/null
+++ b/fer/efi/eofsubs.F
@@ -0,0 +1,1012 @@
+C eofsubs.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+C  EOF code from Billy Kessler.  For cases where time series do not
+C  have any gaps.  Implemented 7/2001
+C
+C  At end are routines count_eof and pack_eof written with Dai McClurg
+C  to count the good timeseries and pack the X,Y,T  array into an neof by T
+C  array.
+C
+C
+C  Ansley Manke       Change dimension statements for arguments to be (*) or
+C                     (NX,*), etc.  The work arrays in the calling functions
+C                     have extra space to accomodate I = 1,N... BB(I+1) in 
+C                     QRSYM, for example.
+C
+C                     Declare all variables.
+C
+C Aug 2001 move to fer/efi directory, EPFs to be statically linked to Ferret.  
+C	   Change INCLUDE statements to remove directory spec.
+C
+
+C v5.41 *kob* 6/02 - remove unneeded ferret_cmn from INCLUDE lines - 
+C                    cygwin does not like them for some reason
+C
+c Date: Thu, 18 Jan 2001 16:44:10 -0800 (PST)
+c From: kessler at pmel.noaa.gov (Billy Kessler)
+c Subject: more EOF code (reverse time and space)
+c 
+c The attached code (one file) contains the following subroutines:
+c 
+c First set are three different front ends that call the
+c routines at bottom that do the work:
+c 
+c EOFIN         ! for usual EOFs (more times than locations)
+c EOFIN2	! EOFs when there are more locations than times
+c EOFIN3C	! routine that allows weighting the data (probably 
+c	           get rid of this one for ferret)
+c
+c These are the black-box routines that do the actual work
+c 
+c FRACVAR	! find percent variance at each point
+c QRSYM		! call all the other routines in turn
+c HOUSEH	! Householder tridiagonalization of matrix
+c QRSTD		! find eigenvalues of tridiagonal matrix
+c TRIDIN	! find eigenvectors of tridiagonal matrix
+c BACKS		! does something
+c 
+c * Actually, either EOFIN or EOFIN2 produces exactly the same
+c result (but see note 1). These two routines do not care about 
+c zero eigenvalues, so there is really no restriction at all on 
+c their use. However, EOFIN2 will be faster if there are more 
+c locations than times. So a possible choice for this whole mess 
+c would be just to use EOFIN for all cases (except for gappy time 
+c series). That might be the most straightforward thing to do,
+c even if it is not the most elegant code.
+c 
+c Notes: 
+c 
+c Note 1: The eigenvalues out of EOFIN2 differ from those of EOFIN
+c by the factor (NT/NX). THis is due to the fact that there are NT 
+c non-zero eigenvalues produced by EOFIN2 (since it assumes that NT<NX), 
+c while there are NX produced by EOFIN. However, I have scaled the 
+c EOFs and PCs to be identical. This should not matter to anyone.
+c 
+c Note 3: Differences between the outputs of these three occur for
+c the higher eigenvalues/vectors, as the values of the eigenvalues
+c come down towards the computational noise and slight differences
+c in cutoff values hardwired into the routines. These are iterative
+c search routines and I have not tried to make the cutoffs (when the
+c routine decides it has found a value) consistent. This should not 
+c matter for geophysical work.
+c 
+c Note 4: Odd results can occur in SVDEOF for input fields that do
+c not have NX degrees of freedom. I spent an embarrassingly long
+c amount of time this afternoon "debugging" a test program that I
+c was feeding a simple idealized (product of sinusoids) field. The
+c field could be represented in only a handful of eigenvectors, but
+c SVDEOF cranked off NX of them, and the higher eigenvalues were
+c pure noise. Some of them were large though, and overwhelmed the
+c others. So if you are making up test fields, use the RANDU 
+c function to add sufficient noise to "use up" all the eigenvectors.
+c This will not be a problem for geophysical fields, which always
+c have sufficient noise. For some reason EOFIN and EOFIN2 do not
+c appear to have this problem.
+c 
+c Note 5: I wrote this code in 1982-83, with Nancy Soreide (then a 
+c programmer for Stan Hayes) holding my hand. It was the first thing
+c I did as a graduate student.
+c 
+c Billy
+
+C-------------------------------------------------------------------------------
+C	EOFSUB_2.FOR MODIFIES TRIDIN TO PASS OVERFLOW. SEE NEAR END OF TRIDIN.
+C	ALSO MODIFIES QRSYM TO NOTE PROGRESS TO 6.
+C-------------------------------------------------------------------------------
+
+C.................EOFIN.FOR is a front end to the EOF subroutines which follow.
+C.................Arrangement of output:
+C					  VEC(position,EOF#)
+C					  TAF(EOF#,time)
+
+c	Variables:
+c	data(nx,nt)	I/O	original data		Returned demeaned
+c	nx		I	number of spatial locations
+c	nt		I	number of time realizations
+c	val(nx)		O	eigenvalues (Lambda)
+c	vec(nx,nx)	O	eigenvectors (Lambda*U). Same units as data.
+c	taf(nx,nt)	O	time amplitude functions (V). Dimensionless.
+c	pct(nx)		O	% variance represented by each EOF.
+		
+	SUBROUTINE EOFIN(DATA,NX,NT,VAL,VEC,TAF,PCT,C,eofwork)
+
+        IMPLICIT NONE
+
+C  Calling argument declarations.
+
+        INTEGER   NX, NT
+	REAL      DATA(NX,*),PCT(*),VAL(*),VEC(NX,*),TAF(NX,*),C(NX,*)
+	REAL eofwork(*)
+
+C  Internal declarations
+
+	INTEGER I, J, I1, I2, IE, IS
+	REAL TVAR, RNT
+C---------------------------------------------------------------------
+C.................Find mean, demean DATA.
+C.................Note PCT is used first as a dummy to save the mean.
+	RNT = NT
+	DO 100 I=1,NX
+	PCT(I)=0.0
+	DO 110 J=1,NT
+110	PCT(I)=PCT(I)+DATA(I,J)/RNT
+	DO 120 J=1,NT
+120	DATA(I,J)=DATA(I,J)-PCT(I)
+100	CONTINUE
+C--------------------------------------------------------------------
+C.................Form the mean product matrix.
+	DO 210 I1=1,NX
+	DO 211 I2=1,NX
+
+	DO 200 J=1,NT
+200	C(I1,I2) = C(I1,I2) + DATA(I1,J) * DATA(I2,J)
+
+	C(I1,I2) = C(I1,I2)/ RNT
+
+211	CONTINUE
+210	CONTINUE
+C------------------------------------------------------------------------
+C.................Call the subroutines which do the work.
+
+	CALL QRSYM(C,NX,VAL,VEC, eofwork)
+
+C.................VEC(IS,IE) is arranged so that IS indexes the space
+C.................dimension of each eigenvector and IE the EOF number.
+C------------------------------------------------------------------------
+C.................Find the percentage of total variance accounted for by
+C.................each eigenvector.
+	TVAR=0.0
+	DO 220 I=1,NX
+220	TVAR=TVAR+VAL(I)
+	DO 221 I=1,NX
+221	PCT(I)=100.*ABS(VAL(I)/TVAR)
+C------------------------------------------------------------------------
+C.................Renormalize EOFs.
+C.................Thus EOFs have units of data, while time amplitude functions
+C.................are dimensionless.
+C.................Thus the sum of the squares of a given EOF = eigenvalue.
+C.................And the mean of a given TAF = 1.
+C-------------------------------------------------------------------------
+C.................First compute the time amplitude function from the data.
+C.................Renormalize each TAF by dividing by SQRT of its eigenvalue.
+
+	DO 350 J=1,NT			! loop over time
+	DO 360 IE=1,NX			! loop over EOF numbers
+
+	TAF(IE,J)=0.0
+
+	DO 370 IS=1,NX
+370	TAF(IE,J) = TAF(IE,J) + VEC(IS,IE)*DATA(IS,J)/SQRT(ABS(VAL(IE)))
+
+360	CONTINUE
+350	CONTINUE
+
+C.................Renormalize each EOF by the SQRT of its eigenvalue.
+
+	DO 300 IE=1,NX			! loop over EOF numbers
+	DO 310 IS=1,NX
+310	VEC(IS,IE) = VEC(IS,IE)*SQRT(ABS(VAL(IE)))
+300	CONTINUE
+C----------------------------------------------------------------------
+	RETURN
+	END
+		
+
+C************************************************************************
+
+
+c -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+C  eofin_chel_gap from Billy Kessler.  
+C  Ansley Manke 9/98  Change to have the bad-data flag "realbad" an argument
+C                     and to test for .GT. realbad rather than .LT.
+C                     Add argument pct_cutoff for where to stop the computations
+C                     that normalize eigenvectors and compute time functions,
+C                     and returning nout = number of functions to output.
+C  Ansley Manke 8/99  Change dimension statements for arguments to be (*) or
+C                     (NX,*), etc.  The work arrays in the calling functions
+C                     now have extra space to accomodate I = 1,N... BB(I+1) in 
+C                     QRSYM, for example.
+C  Ansley Manke 10/00 Change bad-data flag "realbad"  to bad_flag_dat
+C                     and a separate flag for bad_flag_result, the bad-data
+C                     flag for the result.
+C  Ansley Manke 1/01  declare all variables.
+C
+C  Ansley Manke 5/01  remove pct_cutoff as a parameter
+C 
+C  Ansley Manke 9/05  Make all workspace be allocated as external function work 
+C                     arrays. Arrays in TRIDIN passed in rather than declared.
+C  Ansley Manke 7/12  Changes for solving EOF's in double precision.
+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+c
+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+c
+c	eof_gap_sub4.f 
+c	implements Chelton's '82 method for finding EOFs of gappy time series.
+c	4 fixes a few imprecisions in earlier versions:
+c		1) sets negative eigenvalues to eps = 1/10th smallest EV
+c		2) blanks TAF if ALL data missing at a given time realization.
+c	If no gaps, reduces to ordinary EOFs (but computationally wasteful).
+c	Requires eigenvalue finder SUBROUTINEs in eofsub_2.for.
+c	Gaps assumed to be marked by values = 1.e34.
+c***************************************************************************
+
+C..........SUBROUTINE EOFIN_CHEL_GAP 
+c..........is a front end to the EOF SUBROUTINEs in eofsub_2.for.
+
+
+c	Variables:
+c	data(nx,nt)	I/O	original data.	Returned demeaned.
+c	nx		I	number of spatial locations
+c	nt		I	number of time realizations
+c	val(nx)		O	eigenvalues (Lambda)
+c	vec(nx,nx)	O	eigenvectors (Lambda*U). Same units as data.
+c	taf(nx,nt)	O	time amplitude functions (V). Dimensionless.
+c	pct(nx)		O	% variance represented by each EOF.
+c	c(nx,nx)	O	work space for cov matrix (garbage output)
+
+C..........Arrangement of output:
+C					  VEC(position,EOF#)
+C					  TAF(EOF#,time)
+		
+C---------------------------------------------------------------------
+      SUBROUTINE EOFIN_CHEL_GAP (DATA,NX,NT,VAL,VEC,TAF,PCT,C, 
+     +      eofwork, bad_flag_dat, bad_flag_result, err_msg, ier)
+
+        IMPLICIT NONE
+
+        INTEGER nx
+	REAL DATA(NX,*), PCT(*), VAL(*), VEC(NX,*),
+     +            TAF(NX,*), C(NX,*)
+
+      CHARACTER*(*) err_msg
+
+      INTEGER nt, ier, ix, i2, it, i, j, i1, ie, npr,
+     .        ic, is
+      REAL ct, eps, sumljgji, beta, tvar
+
+      REAL eofwork(*)
+      REAL bad_flag_dat, bad_flag_result
+
+C---------------------------------------------------------------------
+c.............initializations.
+
+        ier = 0
+	do 50 ix=1,nx
+	val(ix)=0.
+	pct(ix)=0.
+	do 51 i2=1,nx
+	vec(ix,i2)=0.
+51	c(ix,i2)=0.
+	do 52 it=1,nt
+52	taf(ix,it)=0.
+50	continue
+C---------------------------------------------------------------------
+C.................Find mean, demean DATA.
+C.................Note PCT is used first as a dummy to save the mean.
+	DO 100 I=1,NX
+	ct=0.
+	DO 110 J=1,NT
+	if (data(i,j).GT.bad_flag_dat) then
+		PCT(I)=PCT(I)+DATA(I,J)
+		ct=ct+1.
+	endif
+110	continue
+	if (ct.gt.0.) then
+		pct(i)=pct(i)/ct
+	else
+	   write(err_msg,*) ' EOFIN_CHEL_GAP found the time series',
+     .                     ' at ix=',i,' with no values.'
+           ier = 1
+	   return
+	endif
+	DO 120 J=1,NT
+	if (data(i,j).GT.bad_flag_dat) then
+		DATA(I,J)=DATA(I,J)-PCT(I)
+	endif
+120	continue
+100	CONTINUE
+C--------------------------------------------------------------------
+C.................Form the mean product matrix.
+	DO 210 I1=1,NX
+	DO 210 I2=1,NX
+
+	ct=0.
+	DO 200 J=1,NT
+	if (data(i1,j).GT.bad_flag_dat .and. data(i2,j).GT.bad_flag_dat) then
+		ct=ct+1.
+		C(I1,I2) = C(I1,I2) + DATA(I1,J) * DATA(I2,J)
+	endif
+200	continue
+
+	if (ct.gt.0.) then
+		c(i1,i2)=c(i1,i2)/ct
+	else
+           write(err_msg,*) ' EOFIN_CHEL_GAP found no overlapping',
+     .       ' values in two time series at EOF-1D-coordinates ', 
+     .       i1,i2, ' Will be a zero in covariance matrix'
+           ier = 1
+           return
+	endif
+
+210	CONTINUE
+C------------------------------------------------------------------------
+C.................Call the subroutines which do the work.
+
+	CALL QRSYM(C,NX,VAL,VEC, eofwork) 
+
+C.................VEC(IS,IE) is arranged so that IS indexes the space
+C.................dimension of each eigenvector and IE the EOF number.
+C------------------------------------------------------------------------
+c...................check for negative eigenvalues, set to eps.
+	do 250 ie=1,nx
+250	if (val(ie).lt.0.) GOTO 251
+	GOTO 252
+
+251	continue
+cc 251	write(6,*) 'Found a negative eigenvalue. EV#',ie,
+cc     .        ' Further checking ...'
+cc 251	write(6,*) 'Found a negative eigenvalue. Further checking ...'
+
+	eps=1.e20
+	do 255 ie=1,nx
+255	if (abs(val(ie)).lt.eps) eps=abs(val(ie))
+	eps=eps/10.
+cc	write(6,*) 'Setting epsilon to',eps
+cc	write(6,*) '= 1/10th of the smallest eigenvalue'
+	do 256 ie=1,nx
+	if (val(ie).lt.0.) then
+cc		write(6,*) 'Setting EV #',ie,' =',val(ie),
+cc     .					' to epsilon (=',eps,')'
+		val(ie)=eps
+	endif
+256	continue
+252	continue
+
+C----------------------------------------------------------------------
+C !ACM  Array pctis used as a dummy array below, and we will compute it 
+C       again before returning.
+C.................Find the percentage of total variance accounted for by
+C.................each eigenvector.
+c.................Place this at the end to be able to use pct as dummy
+c.................for counting missing data in TAF calculation.
+	TVAR=0.0
+	DO 1220 I=1,NX
+1220	TVAR=TVAR+VAL(I)
+	DO 1221 I=1,NX
+	PCT(I)=100.*ABS(VAL(I)/TVAR)
+c 1221	IF (PCT(I) .GE. pct_cutoff) NX_compute = I
+1221	CONTINUE
+
+C------------------------------------------------------------------------
+C.................Renormalize EOFs.
+C.................Thus EOFs have units of data, while time amplitude functions
+C.................are dimensionless.
+C.................Thus the sum of the values of a given EOF = SQRT(eigenvalue).
+C.................And the mean of a given TAF = 1.
+C-------------------------------------------------------------------------
+C.................First compute the time amplitude function from the data.
+C.................Renormalize each TAF by dividing by SQRT of its eigenvalue.
+
+c...........................loop over time
+
+c        nout = NX
+	DO 350 J=1,NT
+	npr = nt/ 10 
+        if (nt .gt. 100) npr = (npr/ 10) * 10     
+
+c............find out if any gaps exist at this time.
+c............use ic to count them and pct(nx) to keep track of where they are.
+	ic=0
+	do 400 is=1,nx
+	if (data(is,j).GT.bad_flag_dat) then
+		ic=ic+1
+		pct(is)=0.
+	else
+		pct(is)=1.
+	endif
+400	continue
+
+c..............if no blanks at this time, compute TAF as usual.
+	if (ic.eq.nx) then
+c................................loop over EOF numbers, then over space.
+		DO 360 IE=1,NX
+
+		DO 370 IS=1,NX
+370		TAF(IE,J) = TAF(IE,J) + 
+     .			    VEC(IS,IE)*DATA(IS,J)
+360		CONTINUE
+	elseif (ic.eq.0) then
+c..............If there are NO data values at time j, then blank the TAF.
+		do 450 ie=1,nx
+450		taf(ie,j)=bad_flag_result
+	else
+c.............If there are some blanks, then use Chelton's estimate Beta_i(t).
+c.............Now use c(nx,nx) as dummy to keep Chelton's Gamma_ji.
+c.............Fill c(i,j), where i and j are both EOF #s. 
+c.............Sum over MISSING data points only.
+
+		do 410 i1=1,NX
+		do 410 i2=1,nx
+		   c(i1,i2)=0.
+		   do 415 ix=1,nx
+415		   if (pct(ix).eq.1)
+     .			c(i1,i2)=c(i1,i2)+vec(ix,i1)*vec(ix,i2)
+410		continue
+
+c..................Loop over EOF numbers.
+		do 420 ie=1,NX
+
+c......................Find Beta_i(t) from Gamma_ij.
+c......................Also need the sum of Lambda_j*Gamma_ji**2 over all j.ne.i
+
+c.......................loop 430 sums over space.
+		   sumljgji=0.
+                   do 430 i2=1,nx
+430                if (i2.ne.ie) sumljgji=sumljgji+val(i2)*c(i2,ie)**2
+c
+c  Billy said to replace the loop below with the one above. This is the
+c    problem that Mick spotted. 
+c
+c		   do 430 i2=1,nx
+c		   if (i2.eq.ie) GOTO 431
+c 430		   sumljgji=sumljgji+val(i2)*c(i2,ie)**2
+c
+431		   continue
+
+c.....................find beta.
+		   beta = ( (1.-c(ie,ie)) * val(ie) ) / 
+     .			 ( val(ie) * (1.-c(ie,ie))**2 + sumljgji )
+
+c...................Now find TAF. Summation in space over existing points only.
+		   do 440 is=1,nx
+440			if (pct(is).eq.0.) taf(ie,j) = taf(ie,j) + 
+     .			   	beta * vec(is,ie) * data(is,j)
+
+420		continue
+
+
+	endif
+		
+350	CONTINUE
+
+C-------------------------------------------------------------------------
+C.................Renormalize each EOF by the SQRT of its eigenvalue.
+c.................loop over EOF numbers, then over space.
+
+	DO 300 IE=1,NX
+	do 315 j=1,nt
+
+315	if (taf(ie,j) .GT. bad_flag_dat) taf(ie,j)=taf(ie,j)/sqrt(val(ie))
+	DO 316 IS=1,NX
+316	VEC(IS,IE) = VEC(IS,IE)*SQRT(VAL(IE))
+300	CONTINUE
+C----------------------------------------------------------------------
+C.................Find the percentage of total variance accounted for by
+C.................each eigenvector.
+c.................Place this at the end to be able to use pct as dummy
+c.................for counting missing data in TAF calculation.
+	TVAR=0.0
+	DO 220 I=1,NX
+220	TVAR=TVAR+VAL(I)
+	DO 221 I=1,NX
+221	PCT(I)=100.*ABS(VAL(I)/TVAR)
+C------------------------------------------------------------------------
+	RETURN
+	END
+
+C************************************************************************
+      SUBROUTINE QRSYM (A,N,E,X, eofwork)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER N
+      REAL A(N,*),E(*),X(N,*)
+
+* No need to declare Z,T,E,F dimensions since they are not used
+* and Fortran arrays are column major
+      REAL eofwork(wrk9lox:wrk9hix, wrk9loy:wrk9hiy)
+
+*  
+* 5/99 ACM  Use a work array eofwork rather than explicitly dimensioned
+*           arrays ALPHA, BETA, BB, and P (originally declared in HOUSEH)
+c      DIMENSION ALPHA(4000),BETA(4000),BB(4000)
+
+      INTEGER nb
+      REAL rnorm, eps
+      REAL macheps
+
+      nb=n
+
+* Set macheps once and pass into QRSTD where its used as ETA
+* and into TRIDIN.
+* Assign 2**(-48) to a variable so it is the correct size REAL
+* (should this be different under double-precision?)
+      macheps = 2.**(-48)
+
+      CALL HOUSEH(A,N,eofwork(1,1),eofwork(1,2),NB,
+     .            eofwork(1,4))
+
+      CALL QRSTD (eofwork(1,1),eofwork(1,2),N,E,
+     .            eofwork(1,3),RNORM,MACHEPS, EPS)
+
+      CALL TRIDIN(eofwork(1,1),eofwork(1,2),N,E,RNORM,
+     .            N,macheps,X,NB,eofwork(1,5),eofwork(1,6),
+     .            eofwork(1,7),eofwork(1,8),eofwork(1,9),
+     .            eofwork(1,10) )
+
+      CALL BACKS(eofwork(1,2),A,N,X,N,EPS,NB)
+
+      RETURN
+      END
+
+
+C**********************************************************************
+
+      SUBROUTINE HOUSEH (G,N,A,B,NB, p)
+
+c  7/2002 ACM  Make the sums etc for calculating the matrix inverse
+c              double precision.
+
+      INTEGER NB
+      REAL G(NB,*),A(*),B(*)
+
+c      DIMENSION P(2000)
+      REAL P(*)
+
+      INTEGER n, n2, k, k1, i, j, i1
+      REAL*8 sum, sigma, absb, alpha, beta, gamma, t
+
+      N2=N-2
+      IF(N2)45,44,2
+    2 DO 43 K=1,N2
+      A(K)=G(K,K)
+      SUM=0
+      K1=K+1
+      DO 8 I=K1,N
+    8 SUM=SUM+G(I,K)**2
+      SIGMA=SUM
+      ABSB=SQRT(SIGMA)
+      ALPHA=G(K+1,K)
+      BETA=-ABSB
+      IF(ALPHA)15,16,16
+   15 BETA=ABSB
+   16 B(K)=BETA
+      IF(SIGMA)18,43,18
+   18 GAMMA=1/(SIGMA-ALPHA*BETA)
+      G(K+1,K)=ALPHA-BETA		! change C so now not Mean Prod Matrix
+      DO 27 I=K1,N
+      SUM=0
+      DO 23 J=K1,I
+   23 SUM=SUM+G(I,J)*G(J,K)
+      IF(I.EQ.N)GO TO 27
+      I1=I+1
+      DO 26 J=I1,N
+   26 SUM=SUM+G(J,I)*G(J,K)
+   27 P(I)=GAMMA*SUM
+      SUM=0
+      DO 30 I=K1,N
+   30 SUM=SUM+G(I,K)*P(I)
+      T=0.5*GAMMA*SUM
+      DO 32 I=K1,N
+   32 P(I)=P(I)-T*G(I,K)
+      DO 35 I=K1,N
+      DO 35 J=K1,I
+   35 G(I,J)=G(I,J)-G(I,K)*P(J)-P(I)*G(J,K)
+   43 CONTINUE
+   44 A(N-1)=G(N-1,N-1)
+      B(N-1)=G(N,N-1)
+   45 A(N)=G(N,N)
+      B(N)=0.0
+      RETURN
+      END
+
+C************************************************************************
+
+      SUBROUTINE QRSTD (ALPHA,BETA,N,E,BB,RNORM,ETA,EPS)
+      REAL ALPHA(*),BETA(*),E(*),BB(*)
+
+      INTEGER n, i, k, m, n1, i1, j
+      REAL eta, delta, t, r, w, c, s, shift, g, p, ek1, rnorm, eps
+
+
+C W.KAHAN AND J.VARAH, TWO WORKING ALGORITHMS FOR THE EIGENVALUES OF A
+C SYMMETRIC TRIDIAGONAL MATRIX. TECHNICAL REPORT NO. CS43, AUGUST 11,
+C 1966. COMP.SC.DEPT. STANFORD UNIVERSITY.
+
+      DO 2 I=1,N
+      E(I)=ALPHA(I)
+      BB(I+1)=BETA(I)**2
+    2 continue
+      BB(1)=0.0
+      BB(N+1)=0.0
+C INFINITY NORM OF TRIDIAGONAL MATRIX
+      RNORM=0.0
+      DO 5 I=1,N
+    5 RNORM=AMAX1(RNORM,SQRT(BB(I))+ABS(E(I))+SQRT(BB(I+1)))
+C ETA = RELATIVE MACHINE PRECISION
+      DELTA=ETA*RNORM
+      EPS=DELTA**2
+      IF (EPS.EQ.0) RETURN
+      K=N
+    6 M=K
+      IF(M.LE.0)GO TO 56
+    8 K=K-1
+      IF(BB(K+1).GE.EPS)GO TO 8
+C NEXT
+      IF(K.NE.M-1)GO TO 13
+      BB(K+1)=0.0
+      GO TO 6
+C TWOBY2
+   13 T=E(M)-E(M-1)
+      R=BB(M)
+      IF(K.GE.M-2)GO TO 22
+      W=BB(M-1)
+      C=T**2
+      S=R/(C+W)
+      IF(S*(W+S*C).GE.EPS)GO TO 22
+      M=M-1
+      BB(M+1)=0.0
+      GO TO 13
+C END NEGLIGIBLE BB
+   22 IF(ABS(T).GE.DELTA)GO TO 25
+      S=SQRT(R)
+      GO TO 28
+   25 W=2.0/T
+      S=W*R/(SQRT(W**2*R+1.0)+1.0)
+   28 IF(K.NE.M-2)GO TO 33
+      E(M)=E(M)+S
+      E(M-1)=E(M-1)-S
+      BB(K+1)=0.0
+      GO TO 6
+C DO A QR STEP ON ROWS AND COLUMNS K+1 THROUGH M
+   33 SHIFT=E(M)+S
+      IF(ABS(T).GE.DELTA)GO TO 37
+      W=E(M-1)-S
+      IF(ABS(W).LT.ABS(SHIFT))SHIFT=W
+   37 S=0.0
+      G=E(K+1)-SHIFT
+      C=1.0
+      GO TO 45
+C LOOP
+   40 C=P/T
+      S=W/T
+      W=G
+      EK1=E(K+1)
+      G=C*(EK1-SHIFT)-S*W
+      E(K)=(W-G)+EK1
+C ENTRY
+   45 IF(ABS(G).GE.DELTA)GO TO 48
+      IF(G.GE.0.0)GO TO 47
+      G=G-C*DELTA
+      GO TO 48
+   47 G=G+C*DELTA
+   48 P=G**2/C
+      K=K+1
+      W=BB(K+1)
+      T=W+P
+      BB(K)=S*T
+   50 IF(K.LT.M)GO TO 40
+      E(K)=G+SHIFT
+      GO TO 6
+C SORT
+   56 IF(N.EQ.1)RETURN
+      N1=N-1
+      DO 70 I=1,N1
+      K=I
+      T=E(I)
+      I1=I+1
+      DO 62 J=I1,N
+      IF(E(J).LE.T)GO TO 62
+      T=E(J)
+      K=J
+   62 CONTINUE
+      IF(I.EQ.K)GO TO 70
+      E(K)=E(I)
+      E(I)=T
+   70 CONTINUE
+      RETURN
+      END
+
+C*************************************************************************
+
+      SUBROUTINE TRIDIN (C,B,N,W,NORM,M1,MACHEPS,Z,NB,M,P,Q,R,INT,X)
+
+      INTEGER nb, nminus1, ii
+      REAL C(*),B(*),W(*),Z(NB,*),
+     .     M(*),P(*),Q(*),R(*),INT(*),X(*)
+
+C J.H.WILKINSON, CALCULATION OF THE EIGENVECTORS OF A SYMMETRIC
+C TRIDIAGONAL MATRIX BY INVERSE ITERATION. NUMERISCHE MATHEMATIK 4,
+C 368-376 (1962)
+
+* 9/05 ACM  Use a work array eofwork rather than explicitly dimensioned
+*           arrays M, P, Q, R, INT, and X
+
+c      REAL M(4000),P(4000),Q(4000),R(4000),INT(4000),X(4002)
+
+      INTEGER N,M1
+      REAL NORM,MACHEPS
+
+      INTEGER I,J
+c      REAL BI,BI1,Z1,LAMBDA,U,S,V,H,EPS,ETA
+      REAL BI,BI1,LAMBDA,U,V,H,EPS,ETA,BIG,BIGGER
+
+
+* In single-precision these were 1.e10 and 1.e20
+* Determined by trial and error.
+	
+#ifdef double_p
+      big = 1.E20
+      bigger = 1.E30
+#else
+      big = 1.E10
+      bigger = 1.E20
+#endif
+
+      IF (N-1)10,20,30
+   20 Z(1,1)=1.
+   10 RETURN
+   30 CONTINUE
+      LAMBDA=NORM
+      EPS=MACHEPS*NORM
+      DO 90 J=1,M1
+      LAMBDA=LAMBDA-EPS
+      IF(W(J).LT.LAMBDA)LAMBDA=W(J)
+      U=C(1)-LAMBDA
+      V=B(1)
+      IF(V.EQ.0)V=EPS
+      NMINUS1=N-1
+      DO 60 I=1,NMINUS1
+      BI=B(I)
+      IF(BI.EQ.0)BI=EPS
+      BI1=B(I+1)
+      IF(BI1.EQ.0)BI1=EPS
+      IF(ABS(BI).LT.ABS(U))GO TO 50
+      M(I+1)=U/BI
+      IF((M(I+1).EQ.0).AND.(BI.LE.EPS))M(I+1)=1
+      P(I)=BI
+      Q(I)=C(I+1)-LAMBDA
+      R(I)=BI1
+      U=V-M(I+1)*Q(I)
+      V=-M(I+1)*R(I)
+      INT(I+1)=+1
+      GO TO 60
+   50 M(I+1)=BI/U
+      P(I)=U
+      Q(I)=V
+       R(I)=0
+      U=C(I+1)-LAMBDA-M(I+1)*V
+      V=BI1
+      INT(I+1)=-1
+   60 CONTINUE
+      P(N)=U
+      Q(N)=0
+      R(N)=0
+      X(N+1)=0
+      X(N+2)=0
+      H=0
+      ETA=1.0/N
+      DO 67 II=1,N
+      I=N-II+1
+      U=ETA-Q(I)*X(I+1)-R(I)*X(I+2)
+      IF(P(I).NE.0)GO TO 65
+      X(I)=U/EPS
+      GO TO 66
+   65 X(I)=U/P(I)
+   66 H=H+ABS(X(I))
+   67 CONTINUE
+      DO 68 I=1,N
+   68 X(I)=X(I)/H
+      DO 75 I=2,N
+      IF(INT(I).LE.0)GO TO 70
+      U=X(I-1)
+      X(I-1)=X(I)
+      X(I)=U-M(I)*X(I-1)
+      GO TO 75
+   70 X(I)=X(I)-M(I)*X(I-1)
+   75 CONTINUE
+      H=0
+      DO 82 II=1,N
+      I=N-II+1
+      U=X(I)-Q(I)*X(I+1)-R(I)*X(I+2)
+      IF(P(I).NE.0)GO TO 80
+      X(I)=U/EPS
+      GO TO 81
+   80 X(I)=U/P(I)
+C   81 H=H+X(I)**2
+ 81   IF (X(I).GT.BIG) THEN
+        H=BIGGER
+      ELSE
+        H=H+X(I)**2
+      ENDIF
+   82 CONTINUE
+      H=SQRT(H)
+C STORE VECTORS AS COLUMNS
+      DO 85 I=1,N
+   85 Z(I,J)=X(I)/H
+   90 CONTINUE
+      RETURN
+      END
+
+C**********************************************************************
+
+      SUBROUTINE BACKS (BETA,A,N,X,M1,EPS,NB)
+      INTEGER n, nb, m1 
+      REAL BETA(*), A(NB,*), X(NB,*), EPS
+
+      INTEGER j, kk, k, k1, i
+      REAL s
+
+
+C BACKTRANSFORMATION
+
+   73 IF (N.LE.2)RETURN
+      DO 90 J=1,M1
+      DO 85 KK=3,N
+      K=N-KK+1
+   76 IF (ABS(BETA(K)).LE.EPS) GO TO 85
+      S=0.0
+      K1=K+1
+      DO 75 I=K1,N
+   75 S=S+A(I,K)*X(I,J)
+      S=S/(BETA(K)*A(K1,K))
+      DO 80 I=K1,N
+   80 X(I,J)=X(I,J)+S*A(I,K)
+   85 CONTINUE
+   90 CONTINUE
+
+      RETURN
+      END
+
+************************************************************************
+
+      SUBROUTINE count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                       arg_lo_ss, arg_hi_ss, arg_incr, mx, 
+     .                       flag, frac_timeser, err_msg, ier)
+
+*  Find number of time series with valid data.  This will be neof.
+*  Set array OK to mark which (x,y) have some good data.
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nx, ny, nt, k1, m1, n1, mx, ier
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL ok(nx,ny)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      REAL flag, frac_timeser
+      CHARACTER*(*) err_msg
+
+* local variables
+      INTEGER i, j, i1, j1, l1
+      REAL a_nt
+
+*  Set array ok = 1 if frac_timeser fraction of valid data exists at the point.
+
+      a_nt = float(nt)
+
+      neof = 0
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 30 j = 1, ny
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 20 i = 1, nx
+
+            ok(i,j) = 0.
+            DO 10 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+               IF (arg_1(i1,j1,k1,l1,m1,n1) .ne. flag) then
+                  ok(i,j) = ok(i,j) + 1.
+               endif
+  10        CONTINUE
+            ok(i,j) = ok(i,j) / a_nt
+            IF (ok(i,j) .GE. frac_timeser) neof = neof + 1 
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1) 
+  20     CONTINUE
+         j1 = j1 + arg_incr(Y_AXIS,ARG1) 
+  30  CONTINUE
+
+      ier = 0
+      IF (neof .gt. mx) then
+        WRITE(err_msg,*) 'Increase parameter mx in eof.F ',
+     .                   'Set mx at least', neof
+        ier = 1
+        RETURN
+      ENDIF
+
+      RETURN
+      END
+
+************************************************************************
+
+      SUBROUTINE pack_ef (arg_1, ddat_1d, isave_jsave, neof,  
+     .                    ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  put arg_1(x,y,t) into one list ddat_1d(neof,nt)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER neof, nx, ny, nt, k1, m1, n1
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL ddat_1d(neof,nt)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .                 wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .                 wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL ok(nx,ny)
+      REAL frac_timeser
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      INTEGER i, j, l, i1, j1, l1
+      INTEGER ipack
+
+      ipack = 0
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 130 j = 1, ny
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 120 i = 1, nx
+            IF (ok(i,j) .GE. frac_timeser) THEN
+               ipack = ipack + 1
+ 
+               isave_jsave(ipack,1,1,1,1,1) = i
+               isave_jsave(ipack,2,1,1,1,1) = j
+ 
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 110 l = 1, nt
+                  ddat_1d(ipack, l) = arg_1(i1,j1,k1,l1,m1,n1)
+                  l1 = l1 + arg_incr(T_AXIS,ARG1) 
+ 110           CONTINUE
+
+             ENDIF
+             i1 = i1 + arg_incr(X_AXIS,ARG1) 
+ 120     CONTINUE
+         j1 = j1 + arg_incr(Y_AXIS,ARG1) 
+ 130  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eofsvd_space.F b/fer/efi/eofsvd_space.F
new file mode 100644
index 0000000..abbd921
--- /dev/null
+++ b/fer/efi/eofsvd_space.F
@@ -0,0 +1,588 @@
+*
+*  eofsvd_space.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2012
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field. Calls Billy Kessler's svdeof code
+*
+* Return Spatial EOF's
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eofsvd_space_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id, 'Return SVD EOF spacial fields from XYT field')
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .                     'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eofsvd_space_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eofsvd_space_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /EOFXYSTOR/ mx
+      INTEGER mx1, my1, mt1, mx, mxmt, mxmx, mwrk, mwrk2
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx * mx + 10
+      mwrk = mxmt/2
+      mwrk2 = MIN(mx, mt1)
+
+*  taf (pack data into this eof by t array, returned as taf)
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  ok
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+* workspace
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk, 1, 1, 1, 1, 1)
+
+* W(NX) eigenvalues of decomposition
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+* V(NX,NX) EOFs in columns (V(space,neof))
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mxmx, 2, 1, 1, 1, 1)
+
+* PCT(NX) % variance represented by each EOF
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*                                                            
+*  isave_jsave
+*  Make this work array 7, so that pack_ef from eofsubs can be used
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+* work2
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+
+* work3
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+
+*								       ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE  eofsvd_space_compute(id, arg_1, result, 
+     .    taf, ok, workspace, w, v, pct, isave_jsave, work2, work3)
+
+*  arg_1  variable, function of (x,y,t)
+*  result NX*NY eigenvectors
+
+*  Work arrays (there are some internal hard-coded arrays, should be 
+*  done by external-functions work arrays).
+*  taf, ok, isave_jsave, w, v, pct
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      COMMON /EOFXYSTOR/ mx
+      INTEGER mx
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+      REAL taf(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL ok(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .        wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .        wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL workspace(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL w(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .        wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .        wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL v(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .        wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .        wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL pct(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .        wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .        wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .        wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .        wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL work2(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL work3(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .        wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .        wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      frac_timeser = 1.
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            workspace(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            w(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            v(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            work2(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            work3(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+*  Find the number of eofs to solve for. Require that a location has
+*  all time points present or it is skipped.
+*  neof = number of (x,y) points with all good data.  
+*  Set OK to mark where they are. (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) then
+            GOTO 5010
+         ENDIF
+	 IF (neof .EQ. 0) THEN
+	    err_msg = 'There are no spatial locations having complete time series.'
+	    GOTO 5010
+	 ENDIF
+
+*  Put the data into the array taf(neof,nt). Input to solver routine,
+*  returned as taf.
+
+         CALL pack_ef (arg_1, taf, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eofsvd_space (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3, 
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag(ARG1),
+     .            bad_flag_result, frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) GOTO 5020
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 IF (ier .EQ. -1) THEN
+         err_msg = 'SVDEOF. No convergence in 60 iterations.'
+      ENDIF
+      WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eofsvd_space (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3, 
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag_dat,
+     .            bad_flag_result, frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nt, k, m, n
+      REAL w(*)
+      REAL v(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL workspace(*), work2(*), work3(*)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .        wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .        wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER ier
+
+* local variables
+      INTEGER i, j, l, mm, nn, is, js
+
+      CALL DO_SVD_EOF (taf, neof, nt, w, v, pct, workspace, 
+     .                 work2, work3, ier)
+      IF (ier .NE. 0) RETURN
+
+*  Result is the eigenvectors.
+
+      DO 130 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 120 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  110       CONTINUE
+  120    CONTINUE
+  130 CONTINUE
+
+      DO 220 nn = 1, neof
+         DO 210 mm = 1, neof
+            IF (res_lo_ss(X_AXIS) .EQ. ef_unspecified_int4) THEN
+               is = ef_unspecified_int4
+            ELSE
+               is = res_lo_ss(X_AXIS) + isave_jsave(mm,1,1,1,1,1) - 1
+            ENDIF
+
+            IF (res_lo_ss(Y_AXIS) .EQ. ef_unspecified_int4) THEN
+               js = ef_unspecified_int4
+            ELSE
+               js = res_lo_ss(Y_AXIS) + isave_jsave(mm,2,1,1,1,1) - 1
+            ENDIF
+
+            result(is,js,k,nn,m,n) = v(mm,nn)
+
+  210    CONTINUE
+  220 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eofsvd_stat.F b/fer/efi/eofsvd_stat.F
new file mode 100644
index 0000000..382e8b6
--- /dev/null
+++ b/fer/efi/eofsvd_stat.F
@@ -0,0 +1,612 @@
+*
+*  eofsvd_stat.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Ansley Manke
+* July 2012
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field. Calls Billy Kessler's svdeof code
+*
+* Return statistics: number of eof's computed, percent variance explained
+* by each EOF, and the eigenvalue for each EOF.
+* x-axis is abstract length nx*ny; listing the statistics for each EOF.
+* y-axis is length 3: 
+*    1st is the # of eof's computed
+*    2nd is the Pct variation for each eof
+*    3rd is the eigenvalue for each eof.
+*
+*
+* In this SUBROUTINE we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eofsvd_stat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 fcn_desc
+
+   10 FORMAT ('SVD EOF statistics from XYT field. j=1:#EOFs, ',
+     .        'j=2:%variation, j=3:eigenvalues' )
+
+      WRITE (fcn_desc, 10) 
+
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, YES, YES)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eofsvd_stat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eofsvd_stat_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /eof_statSTOR/ mx
+      INTEGER mx1, my1, mt1, mx, mxmt, mxmx, mwrk, mwrk2
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx * mx + 10
+      mwrk = mxmt/2
+      mwrk2 = MIN(mx, mt1)
+
+*  taf (pack data into this eof by t array, returned as taf)
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  ok
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+* workspace
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk, 1, 1, 1, 1, 1)
+
+* W(NX) eigenvalues of decomposition
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+* V(NX,NX) EOFs in columns (V(space,neof))
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mxmx, 2, 1, 1, 1, 1)
+
+* PCT(NX) % variance represented by each EOF
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*                                                            
+*  isave_jsave
+*  Make this work array 7, so that pack_ef from eofsubs can be used
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+* work2
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+
+* work3
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE eofsvd_stat_compute(id, arg_1, result, 
+     .    taf, ok, workspace, w, v, pct, isave_jsave, work2, work3)
+
+*  arg_1  variable, function of (x,y,t)
+
+*  result(i, 1,. ,. )    # eigenfunctions.
+*  result(i, 2,. ,. )    pct variation for eigenfuncton i.
+*  result(i, 3,. ,. )    eigenvalue for eigenfuncton i.
+
+*  Work arrays (there are some internal hard-coded arrays, should be 
+*  done by external-functions work arrays).
+*  taf, ok, isave_jsave, w, v, pct
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      COMMON /eof_statSTOR/ mx
+      INTEGER mx
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+      REAL taf(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL ok(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .        wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .        wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL workspace(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL w(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .        wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .        wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL v(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .        wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .        wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL pct(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .        wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .        wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .        wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .        wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL work2(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL work3(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .        wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .        wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, max_neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      frac_timeser = 1.
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            workspace(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            w(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            v(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            work2(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            work3(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+*  Find the number of eofs to solve for. Require that a location has
+*  all time points present or it is skipped.
+*  neof = number of (x,y) points with frac_timeser good data.  
+*  Set OK to mark where they are.   (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), 1., err_msg, ier)
+         IF (ier .NE. 0) then
+            GOTO 5010
+         ENDIF
+	 IF (neof .EQ. 0) THEN
+	    err_msg = 'There are no spatial locations having complete time series.'
+	    GOTO 5010
+	 ENDIF
+
+*  Put the data into the array taf(neof,nt). Input to solver routine,
+*  returned as taf.
+
+         CALL pack_ef (arg_1, taf, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eofsvd_stat (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3, 
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag(ARG1),
+     .            bad_flag_result, frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) GOTO 5020
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 IF (ier .EQ. -1) THEN
+         err_msg = 'SVDEOF. No convergence in 60 iterations.'
+      ENDIF
+      WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eofsvd_stat  (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3, 
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag_dat,
+     .            bad_flag_result, frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+* arguments
+      INTEGER neof, nt, k, m, n
+      REAL w(*)
+      REAL v(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL workspace(*), work2(*), work3(*)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER ier
+
+* local variables
+      INTEGER i, j, l
+
+      CALL DO_SVD_EOF (taf, neof, nt, w, v, pct, workspace, 
+     .                 work2, work3, ier)
+      IF (ier .NE. 0) RETURN
+
+*  Result for j = 1 is the # eigenfunctions.
+
+      j =  res_lo_ss(Y_AXIS)
+      DO 130 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            result(i,j,k,l,m,n) = neof
+  110    CONTINUE
+  130 CONTINUE
+
+*  Result for j = 2 is the percent variation explained by the eigenfunctions
+
+      j =  j + res_incr(Y_AXIS)
+      DO 230 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 210 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = pct(i)* 100.
+  210    CONTINUE
+  230 CONTINUE
+
+*  Result for j = 3 is the eigenvalue for each eigenfunction
+
+      j =  j + res_incr(Y_AXIS)
+      DO 330 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         DO 310 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = w(i)
+  310    CONTINUE
+  330 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/eofsvd_tfunc.F b/fer/efi/eofsvd_tfunc.F
new file mode 100644
index 0000000..7ad31fa
--- /dev/null
+++ b/fer/efi/eofsvd_tfunc.F
@@ -0,0 +1,580 @@
+*
+*  eofsvd_tfunc.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2012
+*
+* Compute EOF/s and time amplitude funcions from a 2-d field, or for each level 
+* of a 3-D field. Calls Billy Kessler's svdeof code
+*
+* Return time amplitude functions.
+*
+*
+* In this SUBROUTINE we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE eofsvd_tfunc_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      CALL ef_set_desc(id,
+     .   'Return SVD EOF time functions from XYT field.')
+
+      CALL ef_set_num_args(id, 1)
+
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      CALL ef_set_num_work_arrays(id, 9)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .                     'Variable in x,y,t; may be fcn of z,e,f')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE eofsvd_tfunc_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+
+      INTEGER nx, ny
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx * ny
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE eofsvd_tfunc_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      COMMON /eof_tfuncSTOR/ mx
+      INTEGER mx1, my1, mt1, mx, mxmt, mxmx, mwrk, mwrk2
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      mt1 = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mx = mx1 * my1 + 10
+      mxmt = mx * mt1 + 10
+      mxmx = mx * mx + 10
+      mwrk = mxmt/2
+      mwrk2 = MIN(mx, mt1)
+
+*  taf (pack data into this eof by t array, returned as taf)
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mxmt, 1, 1, 1, 1, 1)
+
+*  ok
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+* workspace
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk, 1, 1, 1, 1, 1)
+
+* W(NX) eigenvalues of decomposition
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+* V(NX,NX) EOFs in columns (V(space,neof))
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mxmx, 2, 1, 1, 1, 1)
+
+* PCT(NX) % variance represented by each EOF
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 1, 1, 1, 1, 1)
+
+*                                                            
+*  isave_jsave
+*  Make this work array 7, so that pack_ef from eofsubs can be used
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mx, 2, 1, 1, 1, 1)
+
+* work2
+      iwork = 8
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+
+* work3
+      iwork = 9
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mwrk2, 1, 1, 1, 1, 1)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this SUBROUTINE we compute the result
+*
+
+      SUBROUTINE  eofsvd_tfunc_compute(id, arg_1, result, 
+     .    taf, ok, workspace, w, v, pct, isave_jsave, work2, work3)
+
+*  arg_1  variable, function of (x,y,t)
+*  result neof*NT time amplitude functions
+
+*  Work arrays (there are some internal hard-coded arrays, should be 
+*  done by external-functions work arrays).
+*  taf, ok, isave_jsave, w, v, pct
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      COMMON /eof_tfuncSTOR/ mx
+      INTEGER mx
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+*  Dimension the work arrays.
+
+
+      REAL taf(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL ok(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .        wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .        wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL workspace(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL w(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .        wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .        wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL v(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .        wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .        wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL pct(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .        wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .        wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      REAL isave_jsave(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .        wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .        wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      REAL work2(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .        wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .        wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+      REAL work3(wrk9lox:wrk9hix, wrk9loy:wrk9hiy,
+     .        wrk9loz:wrk9hiz, wrk9lot:wrk9hit,
+     .        wrk9loe:wrk9hie, wrk9lof:wrk9hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER neof, ier
+      CHARACTER*255 err_msg, err_out
+
+      INTEGER nx, ny, nt, k, m, n, k1, m1, n1,
+     .        iw, jw, kw, lw, mw, nw
+      REAL frac_timeser
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  get array sizes
+
+      nx = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      ny = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      frac_timeser = 1.
+
+*  Compute EOF for each depth, ensemble, forecast
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 300 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize work arrays.
+
+         DO 701 nw = wrk1lof,wrk1hif
+         DO 701 mw = wrk1loe,wrk1hie
+         DO 701 lw = wrk1lot,wrk1hit
+         DO 701 kw = wrk1loz,wrk1hiz 
+         DO 701 jw = wrk1loy,wrk1hiy
+         DO 701 iw = wrk1lox,wrk1hix
+            taf(iw,jw,kw,lw,mw,nw) = 0.
+  701    CONTINUE
+
+         DO 702 nw = wrk2lof,wrk2hif
+         DO 702 mw = wrk2loe,wrk2hie
+         DO 702 lw = wrk2lot,wrk2hit
+         DO 702 kw = wrk2loz,wrk2hiz 
+         DO 702 jw = wrk2loy,wrk2hiy
+         DO 702 iw = wrk2lox,wrk2hix
+            ok(iw,jw,kw,lw,mw,nw) = 0.
+  702    CONTINUE
+
+         DO 703 nw = wrk3lof,wrk3hif
+         DO 703 mw = wrk3loe,wrk3hie
+         DO 703 lw = wrk3lot,wrk3hit
+         DO 703 kw = wrk3loz,wrk3hiz 
+         DO 703 jw = wrk3loy,wrk3hiy
+         DO 703 iw = wrk3lox,wrk3hix
+            workspace(iw,jw,kw,lw,mw,nw) = 0.
+  703    CONTINUE
+
+         DO 704 nw = wrk4lof,wrk4hif
+         DO 704 mw = wrk4loe,wrk4hie
+         DO 704 lw = wrk4lot,wrk4hit
+         DO 704 kw = wrk4loz,wrk4hiz 
+         DO 704 jw = wrk4loy,wrk4hiy
+         DO 704 iw = wrk4lox,wrk4hix
+            w(iw,jw,kw,lw,mw,nw) = 0.
+  704    CONTINUE
+
+         DO 705 nw = wrk5lof,wrk5hif
+         DO 705 mw = wrk5loe,wrk5hie
+         DO 705 lw = wrk5lot,wrk5hit
+         DO 705 kw = wrk5loz,wrk5hiz 
+         DO 705 jw = wrk5loy,wrk5hiy
+         DO 705 iw = wrk5lox,wrk5hix
+            v(iw,jw,kw,lw,mw,nw) = 0.
+  705    CONTINUE
+
+         DO 706 nw = wrk6lof,wrk6hif
+         DO 706 mw = wrk6loe,wrk6hie
+         DO 706 lw = wrk6lot,wrk6hit
+         DO 706 kw = wrk6loz,wrk6hiz 
+         DO 706 jw = wrk6loy,wrk6hiy
+         DO 706 iw = wrk6lox,wrk6hix
+            pct(iw,jw,kw,lw,mw,nw) = 0.
+  706    CONTINUE
+
+         DO 707 nw = wrk7lof,wrk7hif
+         DO 707 mw = wrk7loe,wrk7hie
+         DO 707 lw = wrk7lot,wrk7hit
+         DO 707 kw = wrk7loz,wrk7hiz 
+         DO 707 jw = wrk7loy,wrk7hiy
+         DO 707 iw = wrk7lox,wrk7hix
+            isave_jsave(iw,jw,kw,lw,mw,nw) = 0.
+  707    CONTINUE
+
+         DO 708 nw = wrk8lof,wrk8hif
+         DO 708 mw = wrk8loe,wrk8hie
+         DO 708 lw = wrk8lot,wrk8hit
+         DO 708 kw = wrk8loz,wrk8hiz 
+         DO 708 jw = wrk8loy,wrk8hiy
+         DO 708 iw = wrk8lox,wrk8hix
+            work2(iw,jw,kw,lw,mw,nw) = 0.
+  708    CONTINUE
+
+         DO 709 nw = wrk9lof,wrk9hif
+         DO 709 mw = wrk9loe,wrk9hie
+         DO 709 lw = wrk9lot,wrk9hit
+         DO 709 kw = wrk9loz,wrk9hiz 
+         DO 709 jw = wrk9loy,wrk9hiy
+         DO 709 iw = wrk9lox,wrk9hix
+            work3(iw,jw,kw,lw,mw,nw) = 0.
+  709    CONTINUE
+
+*  Find the number of eofs to solve for. Require that a location has
+*  all time points present or it is skipped.
+*  neof = number of (x,y) points with all good data.  
+*  Set OK to mark where they are. (note this also allows for 
+*  working around continental boundaries or other areas where 
+*  entire time series are missing)
+
+         CALL count_neof (arg_1, neof, ok, nx, ny, nt, k1, m1, n1,
+     .                    arg_lo_ss, arg_hi_ss, arg_incr, mx,
+     .                    bad_flag(ARG1), frac_timeser, err_msg, ier)
+         IF (ier .NE. 0) then
+            GOTO 5010
+         ENDIF
+	 IF (neof .EQ. 0) THEN
+	    err_msg = 'There are no spatial locations having complete time series.'
+	    GOTO 5010
+	 ENDIF
+
+*  Put the data into the array taf(neof,nt). Input to solver routine,
+*  returned as taf.
+
+         CALL pack_ef (arg_1, taf, isave_jsave, neof,  
+     .                 ok, frac_timeser, nx, ny, nt, k1, m1, n1,
+     .                 arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Solve for the EOF's: eigenvectors, time functions, percent variance explained.
+
+         CALL solve_eofsvd_tfunc (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3, 
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag(ARG1),
+     .            bad_flag_result, frac_timeser, err_msg, ier)
+
+         IF (ier .NE. 0) GOTO 5020
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+  100 CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+  200 CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+  300 CONTINUE
+
+      RETURN
+
+ 5010 CALL ef_bail_out (id, err_msg)
+      RETURN
+
+ 5020 IF (ier .EQ. -1) THEN
+         err_msg = 'SVDEOF. No convergence in 60 iterations.'
+      ENDIF
+      WRITE (err_out, 5500) k, m, n, err_msg 
+ 5500 FORMAT ('k,m,n=', 3I3, A250)
+      CALL ef_bail_out (id, err_out)
+      RETURN
+
+      END
+
+***********************************************************************
+
+      SUBROUTINE solve_eofsvd_tfunc (taf, neof, nt, k, m, n, result, 
+     .            isave_jsave, w, v, pct, workspace, work2, work3,
+     .            res_lo_ss, res_hi_ss, res_incr, bad_flag_dat, 
+     .            bad_flag_result,frac_timeser, err_msg, ier)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER neof, nt, k, m, n
+      REAL w(*)
+      REAL v(neof, neof)
+      REAL taf(neof, nt)
+      REAL pct(*)
+      REAL workspace(*), work2(*), work3(*)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+      REAL isave_jsave(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .        wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .        wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      REAL bad_flag_dat, bad_flag_result, frac_timeser
+      CHARACTER*(*) err_msg
+      INTEGER cnt, ier
+
+* local variables
+      INTEGER i, j, l, mm, nn, is, js
+
+      CALL DO_SVD_EOF (taf, neof, nt, w, v, pct, workspace, 
+     .                 work2, work3, ier)
+      IF (ier .NE. 0) RETURN
+
+*  Result is the time functions. 
+
+      j = res_lo_ss(Y_AXIS)
+      DO 120 i = 1, neof
+         cnt = 1
+         DO 110 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = taf(i,cnt)
+            cnt = cnt + 1
+  110    CONTINUE
+  120 CONTINUE
+
+      DO 220 i = neof+1, res_hi_ss(X_AXIS)
+         DO 210 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            result(i,j,k,l,m,n) = bad_flag_result
+  210    CONTINUE
+  220 CONTINUE
+
+      RETURN
+      END
diff --git a/fer/efi/ereverse.F b/fer/efi/ereverse.F
new file mode 100644
index 0000000..678adef
--- /dev/null
+++ b/fer/efi/ereverse.F
@@ -0,0 +1,206 @@
+*
+* ereverse.F
+*
+* Ansley Manke
+* May 2012
+*
+* This function returns the E values of the input variables,
+* reversed and on an abstract E axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE ereverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in E direction on an abstract E axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the E axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE ereverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nm
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nm = arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, E_AXIS, 1, nm)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ereverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_hi_ss(E_AXIS,ARG1), arg_lo_ss(E_AXIS,ARG1), -1
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/expnd_by_len.F b/fer/efi/expnd_by_len.F
new file mode 100644
index 0000000..a82a5e0
--- /dev/null
+++ b/fer/efi/expnd_by_len.F
@@ -0,0 +1,249 @@
+*
+* expnd_by_len.F
+*
+* Ansley Manke 12/2011
+*
+* This function takes a variable and a set of lengths
+* and returns the variable with element 1 repeated len1 times,
+* then element 2 repeated len2 times, etc.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expnd_by_len_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 
+     . 'Returns a variable expanded by the lengths given in arg 2' )
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id, ABSTRACT, NORMAL, 
+     .     NORMAL, NORMAL, NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'var')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'1D variable to expand')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'len')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'lengths to expand each element of argument 1')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nx')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'length of result (sum of lengths in arg 2)')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE expnd_by_len_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE expnd_by_len_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .           mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit, 
+     .           mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit, 
+     .           mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshiz, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      INTEGER arg_lo_ss(6,1:EF_MAX_ARGS), arg_hi_ss(6,1:EF_MAX_ARGS),
+     .     arg_incr(6,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l,m,n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER count, indx
+      CHARACTER*100 errtxt
+      REAL val
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check that the lists are 1D
+
+      errtxt = 'Argument 1 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      DO i = Y_AXIS, F_AXIS
+         m = arg_hi_ss(i,ARG1) - arg_lo_ss(i,ARG1) + 1 
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+
+      errtxt = 'Argument 2 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      DO i = Y_AXIS, F_AXIS
+         m = arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) + 1
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+      
+* Put the requested features into the result
+
+      i2=arg_lo_ss(X_AXIS,ARG2)
+      j2=arg_lo_ss(Y_AXIS,ARG2)
+      k2=arg_lo_ss(Z_AXIS,ARG2)
+      l2=arg_lo_ss(T_AXIS,ARG2)
+      m2=arg_lo_ss(E_AXIS,ARG2)
+      n2=arg_lo_ss(F_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 200 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+      DO 200 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+      DO 200 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 200 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         IF ( arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(2) ) THEN
+
+            val = arg_1(i1,j1,k1,l1,m1,n1)
+	    IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(1) ) 
+     .	       val = bad_flag_result
+
+            count = INT(arg_2(i2,j2,k2,l2,m2,n2))    ! number to replicate
+
+            DO 100 indx = 1, count
+               result(i,j,k,l,m,n) = val
+               i = i + 1
+ 100        CONTINUE
+
+         ENDIF  ! arg_2 bad
+
+      i2 = i2 + arg_incr(X_AXIS,ARG2)
+      j2 = j2 + arg_incr(Y_AXIS,ARG2)
+      k2 = k2 + arg_incr(Z_AXIS,ARG2)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+      m2 = m2 + arg_incr(E_AXIS,ARG2)
+      n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 200  CONTINUE
+
+ 300  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/fer/efi/expnd_by_len_str.F b/fer/efi/expnd_by_len_str.F
new file mode 100644
index 0000000..ff999b9
--- /dev/null
+++ b/fer/efi/expnd_by_len_str.F
@@ -0,0 +1,261 @@
+*
+* expnd_by_len_str.F
+*
+* Ansley Manke 08/2013
+*
+* This function takes a string variable and a set of lengths
+* and returns the variable with element 1 repeated len1 times,
+* then element 2 repeated len2 times, etc.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expnd_by_len_str_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 
+     . 'Returns a variable expanded by the lengths given in arg 2' )
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id, ABSTRACT, NORMAL, 
+     .     NORMAL, NORMAL, NORMAL, NORMAL)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'var')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'1D variable to expand')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'len')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'lengths to expand each element of argument 1')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nx')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'length of result (sum of lengths in arg 2)')
+      CALL ef_set_axis_influence_6d(id, arg, NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE expnd_by_len_str_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE expnd_by_len_str_compute(id, arg_1, arg_2, arg_3, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .           mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit, 
+     .           mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit, 
+     .           mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL result(strdf, 
+     .            memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshiz, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      INTEGER arg_lo_ss(6,1:EF_MAX_ARGS), arg_hi_ss(6,1:EF_MAX_ARGS),
+     .     arg_incr(6,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l,m,n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER count, indx, slen
+      CHARACTER*100 errtxt
+      CHARACTER*2048 buff
+      REAL expnd_by_len_str
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check that the lists are 1D
+
+      errtxt = 'Argument 1 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      DO i = Y_AXIS, F_AXIS
+         m = arg_hi_ss(i,ARG1) - arg_lo_ss(i,ARG1) + 1 
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+
+      errtxt = 'Argument 2 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      DO i = Y_AXIS, F_AXIS
+         m = arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) + 1
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+      
+* Put the requested features into the result
+
+      i2=arg_lo_ss(X_AXIS,ARG2)
+      j2=arg_lo_ss(Y_AXIS,ARG2)
+      k2=arg_lo_ss(Z_AXIS,ARG2)
+      l2=arg_lo_ss(T_AXIS,ARG2)
+      m2=arg_lo_ss(E_AXIS,ARG2)
+      n2=arg_lo_ss(F_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 200 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+      DO 200 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+      DO 200 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 200 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 200 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         IF ( arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(2) ) THEN
+	    
+            CALL ef_get_string_arg_element_6d(id, ARG1, arg_1, 
+     .                      i1,j1,k1,l1,m1,n1, slen, buff)
+
+            count = INT(arg_2(i2,j2,k2,l2,m2,n2))    ! number to replicate
+
+            DO 100 indx = 1, count
+               CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+               i = i + 1
+ 100        CONTINUE
+
+         ENDIF  ! arg_2 bad
+
+      i2 = i2 + arg_incr(X_AXIS,ARG2)
+      j2 = j2 + arg_incr(Y_AXIS,ARG2)
+      k2 = k2 + arg_incr(Z_AXIS,ARG2)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+      m2 = m2 + arg_incr(E_AXIS,ARG2)
+      n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 200  CONTINUE
+
+ 300  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/fer/efi/expndi_by.F b/fer/efi/expndi_by.F
new file mode 100644
index 0000000..455a90e
--- /dev/null
+++ b/fer/efi/expndi_by.F
@@ -0,0 +1,278 @@
+* 
+*  expndi_by.F
+* 
+*  Steve Hankin
+*  1/16/2001
+*  ACM v6.85 3/2013 Fix handling of bad-flags coming in on Arg 1
+* 
+*  Expand argument 1 by inserting a gap before each valid point in 
+* argument 2 along axis I
+*  Argument 2 may be multidimensional
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .       'Expand arg1 by inserting gaps before valid pts of arg 2' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to gap-expand on I axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'valid/bad points guiding gap insertions (multi-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'outsize')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+      CALL ef_get_one_val(id, ARG3, size)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_compute(id, arg_1, arg_2, arg_3, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER imax
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      imax = res_hi_ss(X_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+ 10   CONTINUE
+
+* fill in the points as specified by the mask
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               k2 = arg_lo_ss(Z_AXIS,ARG2)
+               DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  j1 = arg_lo_ss(Y_AXIS,ARG1)
+                  j2 = arg_lo_ss(Y_AXIS,ARG2)
+                  DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                     i1 = arg_lo_ss(X_AXIS,ARG1)
+                     i  = res_lo_ss(X_AXIS)
+                     DO 100 i2 = arg_lo_ss(X_AXIS,ARG2),
+     .                           arg_hi_ss(X_AXIS,ARG2)
+
+                        IF ( arg_2(i2,j2,k2,l2,m2,n2)
+     .                       .NE. bad_flag(2) ) THEN
+*                          Insert a gap
+                           IF (i .GT. imax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 3 size too small')
+                           result(i,j,k,l,m,n) = bad_flag_result
+                           i = i + 1
+                        ENDIF
+                        IF (i .GT. imax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 3 size too small')
+                        IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) 
+     .                    result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1) 
+
+                        i1 = i1 + arg_incr(X_AXIS,ARG1)
+                        i = i + 1
+ 100                 CONTINUE
+
+                     j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                     j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 200              CONTINUE
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+                  k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/expndi_by_t.F b/fer/efi/expndi_by_t.F
new file mode 100644
index 0000000..6572a11
--- /dev/null
+++ b/fer/efi/expndi_by_t.F
@@ -0,0 +1,306 @@
+* 
+*  expndi_by_t.F
+* 
+*  Steve Hankin
+*  2/22/2001
+*  ACM v6.85 3/2013 Fix handling of bad-flags coming in on Arg 1
+* 
+*  Expand argument 1 by createing a 2D XT structure from it with the 
+* separation between T columns given by the location of non-missing values in
+* argument 2. Thus the T columns created are "ragged"
+* Typical use is that arg 1 is a collection of vertical casts appended end-
+* to-end and that arg 2 flags the start of each cast
+
+*  Args 3 and 4 are constants -- the size of the X and T axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_t_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XT grid. (Typ. to split T-profiles)' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'each valid point starts a new T column')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'n_profiles')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'L size of result (constant)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_t_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+* output X axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+
+* output T axis size
+      CALL ef_get_one_val(id, ARG4, size)
+      CALL ef_set_axis_limits(id, T_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_t_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                               result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER j1, k1, l1, m1, n1
+      INTEGER j2, k2, l2, m2, n2
+      INTEGER imax, lmax, iout, lout
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* make sure inputs are conformable
+      IF ( (arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2))
+     . .OR.(arg_hi_ss(X_AXIS,ARG1) .NE. arg_hi_ss(X_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'X limits of args 1 and 2 mismatched')
+      IF ( (arg_lo_ss(T_AXIS,ARG1) .NE. arg_hi_ss(T_AXIS,ARG1))
+     . .OR.(arg_lo_ss(T_AXIS,ARG2) .NE. arg_hi_ss(T_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'T size of args 1 and 2 must be 1')
+
+* limits on output arrays
+      imax = res_hi_ss(X_AXIS)
+      lmax = res_hi_ss(T_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+ 10   CONTINUE
+
+* fill in the points as specified by the mask
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  iout = res_lo_ss(X_AXIS)
+                  lout = res_lo_ss(T_AXIS)
+                  IF ( arg_2(arg_lo_ss(X_AXIS,ARG2),j2,k2,l2,m2,n2)
+     .                 .NE. bad_flag(2) ) THEN
+                     iout = iout - 1  ! will immediately increment
+                  ELSE
+                     lout = lout - 1  ! will immediately increment
+                  ENDIF
+                  DO 100 i = arg_lo_ss(X_AXIS,ARG1),
+     .                       arg_hi_ss(X_AXIS,ARG1)
+
+                     IF ( arg_2(i,j2,k2,l2,m2,n2)
+     .                    .EQ. bad_flag(2) ) THEN
+*    ... add another element to this T column
+                        IF (lout .GE. lmax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 4 size too small')
+                           lout = lout + 1
+                        ELSE
+*    ... start a new T column
+                           IF (iout .GE. imax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 3 size too small')
+                           iout = iout + 1
+                           lout = res_lo_ss(T_AXIS)
+                        ENDIF
+			IF (arg_1(i,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) 
+     .                    result(iout,j,k,lout,m,n)
+     .                        = arg_1(i,j1,k1,l1,m1,n1)
+ 100              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 200           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/expndi_by_z.F b/fer/efi/expndi_by_z.F
new file mode 100644
index 0000000..c8737b2
--- /dev/null
+++ b/fer/efi/expndi_by_z.F
@@ -0,0 +1,306 @@
+* 
+*  expndi_by_z.F
+* 
+*  Steve Hankin
+*  2/22/2001
+*  ACM v6.85 3/2013 Fix handling of bad-flags coming in on Arg 1
+* 
+*  Expand argument 1 by createing a 2D XZ structure from it with the 
+* separation between Z columns given by the location of non-missing values in
+* argument 2. Thus the Z columns created are "ragged"
+* Typical use is that arg 1 is a collection of vertical casts appended end-
+* to-end and that arg 2 flags the start of each cast
+
+*  Args 3 and 4 are constants -- the size of the X and Z axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_z_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XZ grid. (Typ. to split Z-profiles)' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'mask')
+      CALL ef_set_arg_desc(id, arg,
+     .          'each valid point starts a new Z column')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'n_profiles')
+      CALL ef_set_arg_desc(id, arg,
+     .          'I size of result (constant)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_z_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+
+* output X axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, X_AXIS, 1, INT(ABS(size)))
+
+* output Z axis size
+      CALL ef_get_one_val(id, ARG4, size)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, INT(ABS(size)))
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_z_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                               result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER j1, k1, l1, m1, n1
+      INTEGER j2, k2, l2, m2, n2
+      INTEGER imax, kmax, iout, kout
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* make sure inputs are conformable
+      IF ( (arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2))
+     . .OR.(arg_hi_ss(X_AXIS,ARG1) .NE. arg_hi_ss(X_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'X limits of args 1 and 2 mismatched')
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1))
+     . .OR.(arg_lo_ss(Z_AXIS,ARG2) .NE. arg_hi_ss(Z_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of args 1 and 2 must be 1')
+
+* limits on output arrays
+      imax = res_hi_ss(X_AXIS)
+      kmax = res_hi_ss(Z_AXIS)
+
+* pre-fill the entire output result with missing value flags
+*  (since each I-sequence in mask may have different number of valid pts)
+      DO 10 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 10 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 10 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 10 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 10 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 10 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+ 10   CONTINUE
+
+* fill in the points as specified by the mask
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  iout = res_lo_ss(X_AXIS)
+                  kout = res_lo_ss(Z_AXIS)
+                  IF ( arg_2(arg_lo_ss(X_AXIS,ARG2),j2,k2,l2,m2,n2)
+     .                 .NE. bad_flag(2) ) THEN
+                     iout = iout - 1  ! will immediately increment
+                  ELSE
+                     kout = kout - 1  ! will immediately increment
+                  ENDIF
+                  DO 100 i = arg_lo_ss(X_AXIS,ARG1),
+     .                       arg_hi_ss(X_AXIS,ARG1)
+                     IF ( arg_2(i,j2,k2,l2,m2,n2)
+     .                    .EQ. bad_flag(2) ) THEN
+*    ... add another element to this Z column
+                        IF (kout .GE. kmax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 4 size too small')
+                        kout = kout + 1
+                     ELSE
+*    ... start a new Z column
+                        IF (iout .GE. imax) CALL EF_BAIL_OUT(id,
+     .                                          'Arg 3 size too small')
+                        iout = iout + 1
+                        kout = res_lo_ss(Z_AXIS)
+                     ENDIF
+                     IF ( arg_1(i,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) 
+     .                 result(iout,j,kout,l,m,n)
+     .                     = arg_1(i,j1,k1,l1,m1,n1)
+ 100              CONTINUE
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 200           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500     CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/expndi_by_z_counts.F b/fer/efi/expndi_by_z_counts.F
new file mode 100644
index 0000000..6c5b22d
--- /dev/null
+++ b/fer/efi/expndi_by_z_counts.F
@@ -0,0 +1,272 @@
+* 
+*  expndi_by_z_counts.F
+* 
+*  Ansley Manke (from expndi_by_z)
+*  8/24/2011
+* 
+* Expand argument 1 by creating a 2D XZ structure from it with the 
+* separation between Z columns given by the lengths specified in 
+* argument 2. Argument 2 is a list of length N, where N is the number of 
+* Z columns to create, and each item in the list is the length of that 
+* column (the length of the cruise or profile). Thus the Z columns created 
+* are "ragged" Typical use is that arg 1 is a collection of vertical casts 
+* appended end-to-end and that arg 2 is the number of values in each cast.
+* The sum of the values in arg 2 is the length of argument 1. 
+
+*  Args 3 and 4 are constants -- the size of the X and Z axes, respectively
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_by_z_counts_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Expand arg1 on I into an XZ grid. (Typ. to split Z-profiles)' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'dat')
+      CALL ef_set_arg_desc(id, arg, 'variable to expand on I axis')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'counts')
+      CALL ef_set_arg_desc(id, arg,
+     .          'count of values in each profile')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'max_profile_len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_by_z_counts_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+      integer nx, arg
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+* output X axis size
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      arg = 2
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+* output Z axis size
+      CALL ef_get_one_val(id, ARG3, size)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, INT(ABS(size)))
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_by_z_counts_compute(id, arg_1, arg_2, arg_3, 
+     .                               result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy,
+     .     mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER imax,kmax, iout, kout, isum
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* limits on output arrays
+        imax = res_hi_ss(X_AXIS)
+        kmax = res_hi_ss(Z_AXIS)
+
+* make sure input 2 is a list of length nprofile
+      IF (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 .NE. imax)
+     .       CALL EF_BAIL_OUT(id, 'Arg 2 must be of length given in arg3')
+
+* args 1 and 2 must not depend on z
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1))
+     . .OR.(arg_lo_ss(Z_AXIS,ARG2) .NE. arg_hi_ss(Z_AXIS,ARG2)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of args 1 and 2 must be 1')
+
+* sum of counts in arg 2 must be length of x-dimension of arg1
+
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      L2 = arg_lo_ss(T_AXIS,ARG2)
+      do 20 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      do 20 L2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+         isum = 0
+         DO 10 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            IF  (arg_2(i2,j2,k2,l2) .EQ. bad_flag(ARG2) .OR. 
+     .           INT(arg_2(i2,j2,k2,l2)) .LT. 0)
+     .          CALL EF_BAIL_OUT(id, 'elements of arg 2 are counts GE zero')
+            isum = isum + INT(arg_2(i2,j2,k2,l2))
+ 10   CONTINUE
+         IF (isum .NE. (arg_hi_ss(X_AXIS,ARG1)-arg_lo_ss(X_AXIS,ARG1)+1) )
+     .       CALL EF_BAIL_OUT(id, 
+     .         'arg 2 values must sum to x-dimension length of of arg1 ')
+ 20   CONTINUE
+
+* pre-fill the entire output result with missing value flags
+*  (since length of each profile may have different number of pts)
+      DO 60 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 50 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 40 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 30 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 30            result(i,j,k,l) = bad_flag_result
+ 40         CONTINUE
+ 50      CONTINUE
+ 60   CONTINUE
+
+* fill in the points as specified by the counts
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+	    i1 = 1
+            DO 200 iout=arg_lo_ss(X_AXIS,ARG2),arg_hi_ss(X_AXIS,ARG2)
+               DO 100 kout = 1, arg_2(iout,j2,k2,l2)
+                  result(iout,j,kout,l) = arg_1(i1,j1,k1,l1)
+                  i1 = i1 + 1
+ 100           CONTINUE
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/expndi_id_by_z_counts.F b/fer/efi/expndi_id_by_z_counts.F
new file mode 100644
index 0000000..b55cfc8
--- /dev/null
+++ b/fer/efi/expndi_id_by_z_counts.F
@@ -0,0 +1,238 @@
+* 
+*  expndi_id_by_z_counts.F
+* 
+*  Ansley Manke (from expndi_by_z)
+*  8/24/2011
+* 
+* Create a variable with profile ID, where argument 1 is the length
+* of the variable to be put into an XZ structure from it with the 
+* Z length specified by column 2.  This creates an "ID" variable to
+* go along with the XZ variable defined by expndi_by_z_counts.
+ 
+*  In this subroutine we provide information about
+*  the function.  The user configurable information 
+*  consists of the following:
+* 
+*  descr              Text description of the function
+* 
+*  num_args           Required number of arguments
+* 
+*  axis_inheritance   Type of axis for the result
+*                        ( CUSTOM, IMPLIED_BY_Z_ARGS, NORMAL, ABSTRACT )
+*                        CUSTOM          - user defined axis
+*                        IMPLIED_BY_Z_ARGS - same axis as the incoming argument
+*                        NORMAL          - the result is normal to this axis
+*                        ABSTRACT        - an axis which only has index values
+* 
+*  piecemeal_ok       For memory optimization:
+*                        axes where calculation may be performed piecemeal
+*                        ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE expndi_id_by_z_counts_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Create 2D list, ID by profile-length on an XZ grid.' )
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'counts')
+      CALL ef_set_arg_desc(id, arg,
+     .          'count of values in each profile')
+      CALL ef_set_axis_influence(id, arg, NO, YES, NO, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'max profile len')
+      CALL ef_set_arg_desc(id, arg,
+     .          'K size of result (constant)')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE expndi_id_by_z_counts_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      REAL size
+      integer arg, nx, nz
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the arguments.
+*
+* output X axis size
+* output Z axis size
+
+* Length of x
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+* Length of z 
+      CALL ef_get_one_val(id, ARG2, size)
+      nz = INT(size)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, nz)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+* 
+*  In this subroutine we compute the result
+* 
+      SUBROUTINE expndi_id_by_z_counts_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy,
+     .	   mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy,
+     .     mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER iout, kout, isum
+      REAL size, xlen, zlen
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Length of x*z 
+
+      xlen = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      zlen = res_hi_ss(Z_AXIS) - res_lo_ss(Z_AXIS) + 1
+
+* arg 1 must not depend on z
+      IF ( (arg_lo_ss(Z_AXIS,ARG1) .NE. arg_hi_ss(Z_AXIS,ARG1)) ) CALL
+     .           EF_BAIL_OUT(id, 'Z size of arg 1 must be 1')
+
+* pre-fill the entire output result with missing value flags
+*  (since length of each profile may have different number of pts)
+      DO 60 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO 50 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO 40 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               DO 30 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+ 30            result(i,j,k,l) = bad_flag_result
+ 40         CONTINUE
+ 50      CONTINUE
+ 60   CONTINUE
+
+* fill in the points as specified by the counts
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 300 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+	    i1 = 1
+            DO 200 iout = 1, xlen
+               DO 100 kout = 1, arg_1(iout,j1,k1,l1)
+                  result(iout,j,kout,l) = iout
+                  i1 = i1 + 1
+ 100           CONTINUE
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+      
+         
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/fc_isubset.F b/fer/efi/fc_isubset.F
new file mode 100644
index 0000000..61c78e4
--- /dev/null
+++ b/fer/efi/fc_isubset.F
@@ -0,0 +1,289 @@
+*
+* fc_isubset.F
+*
+* Ansley Manke 11/28/2011
+* See ticket 1897
+*
+* This function returns a subset of data given start indices and
+* sizes of features in a 1D array.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fc_isubset_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Returns a subset of a feature collection' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance(id, CUSTOM, NORMAL, NORMAL, NORMAL)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'index_list')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'starting indices of features of interest')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lengths')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'lengths of the features of interest')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'nx')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .      'length of result (sum of lengths in arg 2)')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'FullData')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'input data: 1D list from which to select features')
+      CALL ef_set_axis_influence(id, arg, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+      SUBROUTINE fc_isubset_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      call ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fc_isubset_custom_axes(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Get the size of the output axis from arg 3
+
+      INTEGER nx, iarg
+      REAL val
+
+      iarg = 3
+      CALL ef_get_one_val(id, iarg, val)
+      nx = INT(val)
+
+      CALL ef_set_custom_axis (id, X_AXIS, 1., val, 1., 'X', NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fc_isubset_compute(id, arg_1, arg_2, arg_3, arg_4, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+	  INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, 
+     .           mem3loz:mem3hiz, mem3lot:mem3hit)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, 
+     .           mem4loz:mem4hiz, mem4lot:mem4hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,1:EF_MAX_ARGS), arg_hi_ss(4,1:EF_MAX_ARGS),
+     .     arg_incr(4,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2, l2
+      INTEGER i4, j4, k4, l4
+      INTEGER m, n, count
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+* check that the lists are 1D
+
+      errtxt = 'Argument 1 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG1) - arg_lo_ss(i,ARG1) + 1 
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+
+      errtxt = 'Argument 2 must be a 1D list'
+      n = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      DO i = Y_AXIS, T_AXIS
+         m = arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) + 1
+         IF (n.GT.1 .AND. m.GT.1) GOTO 9000
+         n = MAX(n,m)
+      ENDDO
+      
+* Put the requested features into the result
+
+      i2=arg_lo_ss(X_AXIS,ARG2)
+      j2=arg_lo_ss(Y_AXIS,ARG2)
+      k2=arg_lo_ss(Z_AXIS,ARG2)
+      l2=arg_lo_ss(T_AXIS,ARG2)
+
+      i = res_lo_ss(X_AXIS)
+
+      DO 500 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+      DO 500 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 500 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 500 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+         IF ( arg_1(i1,j1,k1,l1) .EQ. bad_flag(1) ) GOTO 600  ! done
+         IF ( arg_2(i2,j2,k2,l2) .EQ. bad_flag(2) ) GOTO 600
+
+	 i4 = INT(arg_1(i1,j1,k1,l1))     ! start index
+         count = INT(arg_2(i2,j2,k2,l2))  ! number to put
+
+         l4 = arg_lo_ss(T_AXIS,ARG4)
+         DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+	    k4 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               j4 = res_lo_ss(Y_AXIS)
+	       DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  DO 100 n = 1, count
+                     result(i,j,k,l) = arg_4(i4,j4,k4,l4)
+                     i4 = i4 + 1
+                     i = i + 1
+ 100              CONTINUE
+ 
+                  j4 = j4 + arg_incr(Y_AXIS,ARG4)
+ 200           CONTINUE
+               k4 = k4 + arg_incr(Z_AXIS,ARG4)
+ 300        CONTINUE
+
+            l4 = l4 + arg_incr(T_AXIS,ARG4)
+ 400     CONTINUE
+
+      i2 = i2 + arg_incr(X_AXIS,ARG2)
+      j2 = j2 + arg_incr(Y_AXIS,ARG2)
+      k2 = k2 + arg_incr(Z_AXIS,ARG2)
+      l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 500  CONTINUE
+
+ 600  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/fer/efi/fcat.F b/fer/efi/fcat.F
new file mode 100644
index 0000000..c2a18e2
--- /dev/null
+++ b/fer/efi/fcat.F
@@ -0,0 +1,270 @@
+*
+* fcat.F
+*
+* Ansley Manke
+* May 2012
+*
+* This function returns the T values of the two variables,
+* concatenated into one long list on an abstract t axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fcat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the F values of two variables into one ',
+     .        'list on an abstract F axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'FCAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fcat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nm
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nm = (arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, F_AXIS, 1, nm)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fcat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+
+* concatenate in F - dont restart count of index N
+
+      DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/fcat_str.F b/fer/efi/fcat_str.F
new file mode 100644
index 0000000..2ba0431
--- /dev/null
+++ b/fer/efi/fcat_str.F
@@ -0,0 +1,273 @@
+*
+* fcat_str.F
+*
+* Ansley Manke
+* May 2012
+
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract F axis. Other
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE fcat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* *********************************************************************S*
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the F values of two string variables ',
+     .        'into one list on an abstract F axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE fcat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nm
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nm = (arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, F_AXIS, 1, nm)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fcat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+
+* concatenate in F - dont restart count of index N
+
+      DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 610  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/fft_im.F b/fer/efi/fft_im.F
new file mode 100644
index 0000000..aae8752
--- /dev/null
+++ b/fer/efi/fft_im.F
@@ -0,0 +1,471 @@
+*------------------------------fft_im.F--------------------------------
+* fft_im.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+*
+* This function returns the imaginary part of the FFT transform. The result 
+* time axis is a custom axis in period 1./time  The time axis must be regular.
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_im_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Computes imaginary part of fft transform' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, CUSTOM,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable with regular time axis.')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_im_custom_axes(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER arg, nd
+      CHARACTER outunits*32
+      REAL boxsize(1)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      arg = 1
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info_6d(id, arg, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .                     arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_im_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_im_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+
+* a
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_im_compute(id, arg_1, result, a, b, wft, ts)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy, wrk1loz:wrk1hiz,
+     .       wrk1lot:wrk1hit, wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy, wrk2loz:wrk2hiz,
+     .       wrk2lot:wrk2hit, wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy, wrk3loz:wrk3hiz,
+     .         wrk3lot:wrk3hit, wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz,
+     .        wrk4lot:wrk4hit, wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      INTEGER arg, nd, nf
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*128 err_msg
+
+   40 FORMAT ('FFT_IM encountered missing data at (i,j,k,l,m,n)', 6I5)
+   50 FORMAT ('FFT_IM encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info_6d(id, 1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF (.NOT. regular(T_AXIS)) THEN
+         WRITE (err_msg, *) 'Time axis must be a regular axis'
+         GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple error message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = 1, nd
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1)) THEN
+                     IF ( i1 .EQ. ef_unspecified_int4 .AND.
+     .                    j1 .EQ. ef_unspecified_int4 .AND.
+     .                    k1 .EQ. ef_unspecified_int4 .AND.
+     .                    m1 .EQ. ef_unspecified_int4 .AND.
+     .                    n1 .EQ. ef_unspecified_int4 ) THEN
+                        WRITE (err_msg, 50) l
+                     ELSE
+                        WRITE (err_msg, 40) i1,j1,k1,l,m1,n1
+                     ENDIF
+                     GO TO 999 
+                  ENDIF
+                  ts(l,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l,m,n) = b(l,1,1,1,1,1)
+ 410           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/fft_inverse.F b/fer/efi/fft_inverse.F
new file mode 100644
index 0000000..c4d4281
--- /dev/null
+++ b/fer/efi/fft_inverse.F
@@ -0,0 +1,418 @@
+*------------------------------fft_inverse.F---------------------------
+
+* fft_inverse.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* November 2001
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+*
+* This function computes inverse fft transform spectrum for each A,B,
+* where these are the real and imaginary part of the FFT coefficients.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_inverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Computes inverse fft time series')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Real part of FFT coefficients')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .                 'Imaginary part of FFT coefficients')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_inverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*  Use utility functions to get context information about the argument.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nfreq = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      ntime = nfreq* 2
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, ntime)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_inverse_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 4.* 2.5* mtdat + 15
+
+* a
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_inverse_compute(id, arg_1, arg_2, result, 
+     .                               a, b, wft, ts)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy, wrk1loz:wrk1hiz,
+     .       wrk1lot:wrk1hit, wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy, wrk2loz:wrk2hiz,
+     .       wrk2lot:wrk2hit, wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy, wrk3loz:wrk3hiz,
+     .         wrk3lot:wrk3hit, wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz,
+     .        wrk4lot:wrk4hit, wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg, ntime, nfreq
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*128 err_msg
+
+   40 FORMAT ('FFT_INVERSE encountered missing data at (i,j,k,l,m,n)',
+     .        6I5)
+   50 FORMAT ('FFT_INVERSE encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of freq points.
+
+      arg = 1
+      nfreq = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      ntime = nfreq* 2
+
+*  Check that arg1 and arg2 have the same axes.
+
+      IF ( arg_lo_ss(X_AXIS,ARG1) .NE. arg_lo_ss(X_AXIS,ARG2) ) THEN
+         err_msg = 'X Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+      IF ( arg_lo_ss(Y_AXIS,ARG1) .NE. arg_lo_ss(Y_AXIS,ARG2)  ) THEN
+         err_msg = 'Y Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+      IF ( arg_lo_ss(Z_AXIS,ARG1) .NE. arg_lo_ss(Z_AXIS,ARG2) ) THEN
+         err_msg = 'Z Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+      IF ( arg_lo_ss(T_AXIS,ARG1) .NE. arg_lo_ss(T_AXIS,ARG2)  ) THEN
+         err_msg = 'T Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+      IF ( arg_lo_ss(E_AXIS,ARG1) .NE. arg_lo_ss(E_AXIS,ARG2)  ) THEN
+         err_msg = 'E Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+      IF ( arg_lo_ss(F_AXIS,ARG1) .NE. arg_lo_ss(F_AXIS,ARG2)  ) THEN
+         err_msg = 'F Axes of A and B coefficients must agree'
+         GOTO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ntime and trig functions.
+
+      CALL rffti (ntime, wft)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Calculate the inverse FFT for each series which have no missing data.
+* Make a simple error message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = 1, nfreq
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) .OR.
+     .                arg_2(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG2)) THEN
+                     IF ( i1 .EQ. ef_unspecified_int4 .AND.
+     .                    j1 .EQ. ef_unspecified_int4 .AND.
+     .                    k1 .EQ. ef_unspecified_int4 .AND.
+     .                    m1 .EQ. ef_unspecified_int4 .AND.
+     .                    n1 .EQ. ef_unspecified_int4 ) THEN
+                        WRITE (err_msg, 50) l
+                     ELSE
+                        WRITE (err_msg, 40) i1,j1,k1,l,m1,n1
+                     ENDIF
+                     GO TO 999 
+                  ENDIF
+                  A(l,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+                  B(l,1,1,1,1,1) = arg_2(i1,j1,k1,l1,m1,n1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               CALL FFTINV (ntime, ts, a, b, wft)
+
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l,m,n) = ts(l,1,1,1,1,1)
+ 410           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/fft_re.F b/fer/efi/fft_re.F
new file mode 100644
index 0000000..3ad6563
--- /dev/null
+++ b/fer/efi/fft_re.F
@@ -0,0 +1,471 @@
+*------------------------------fft_re.F--------------------------------
+*
+* fft_re.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+* This function returns the real part of the FFT transform. The result time
+* axis is a custom axis in period 1./time  The time axis must be regular.
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fft_re_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Computes real part of fft transform' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, CUSTOM,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable with regular time axis.')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fft_re_custom_axes(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER arg, nd
+      CHARACTER outunits*32
+      REAL boxsize(1)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      arg = 1
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info_6d(id, arg, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .                     arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2	
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fft_re_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fft_re_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+
+* a
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fft_re_compute(id, arg_1, result, a, b, wft, ts)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy, wrk1loz:wrk1hiz,
+     .       wrk1lot:wrk1hit, wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy, wrk2loz:wrk2hiz,
+     .       wrk2lot:wrk2hit, wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy, wrk3loz:wrk3hiz,
+     .         wrk3lot:wrk3hit, wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz,
+     .        wrk4lot:wrk4hit, wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      INTEGER arg, nd, nf
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*128 err_msg
+
+   40 FORMAT ('FFT_RE encountered missing data at (i,j,k,l,m,n)', 6I5)
+   50 FORMAT ('FFT_RE encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info_6d(id, 1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF (.NOT. regular(T_AXIS)) THEN
+         WRITE (err_msg, *) 'Time axis must be a regular axis'
+         GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple error message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = 1, nd
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1)) THEN
+                     IF ( i1 .EQ. ef_unspecified_int4 .AND.
+     .                    j1 .EQ. ef_unspecified_int4 .AND.
+     .                    k1 .EQ. ef_unspecified_int4 .AND.
+     .                    m1 .EQ. ef_unspecified_int4 .AND.
+     .                    n1 .EQ. ef_unspecified_int4 ) THEN
+                        WRITE (err_msg, 50) l
+                     ELSE
+                        WRITE (err_msg, 40) i1,j1,k1,l,m1,n1
+                     ENDIF
+                     GO TO 999 
+                  ENDIF
+                  ts(l,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   result(i,j,k,l,m,n) = a(l,1,1,1,1,1)
+ 410           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/ffta.F b/fer/efi/ffta.F
new file mode 100644
index 0000000..06ae423
--- /dev/null
+++ b/fer/efi/ffta.F
@@ -0,0 +1,493 @@
+*
+* ffta.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+*
+* This function computes fft amplitude spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET ssffta = ffta(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. ffta(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ffta_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*110 arg_desc, fcn_desc
+
+      WRITE (fcn_desc, 20)
+      CALL ef_set_desc(id, fcn_desc)
+   20 FORMAT ( 'Computes fft amplitude spectra, ',
+     .         'normalized by 1/N' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, CUSTOM,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .        'explicitly e.g. ffta(var[l=1,120])')
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE ffta_custom_axes(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER arg, nd
+      CHARACTER outunits*32
+      REAL boxsize(1)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      
+      arg = 1
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info_6d(id, arg, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .                     arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE ffta_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE ffta_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ffta_compute(id, arg_1, result, a, b, wft, ts)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy, wrk1loz:wrk1hiz,
+     .       wrk1lot:wrk1hit, wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy, wrk2loz:wrk2hiz,
+     .       wrk2lot:wrk2hit, wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy, wrk3loz:wrk3hiz,
+     .         wrk3lot:wrk3hit, wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz,
+     .        wrk4lot:wrk4hit, wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      REAL aa, bb
+      INTEGER arg, nd, nf
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*128 err_msg
+
+   40 FORMAT ('FFTA encountered missing data at (i,j,k,l,m,n)', 6I5)
+   50 FORMAT ('FFTA encountered missing data at L=', I5)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info_6d(id, 1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF (.NOT. regular(T_AXIS)) THEN
+         WRITE (err_msg, *) 'Time axis must be a regular axis'
+         GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple error message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = 1, nd
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1)) THEN
+                     IF ( i1 .EQ. ef_unspecified_int4 .AND.
+     .                    j1 .EQ. ef_unspecified_int4 .AND.
+     .                    k1 .EQ. ef_unspecified_int4 .AND.
+     .                    m1 .EQ. ef_unspecified_int4 .AND.
+     .                    n1 .EQ. ef_unspecified_int4 ) THEN
+                        WRITE (err_msg, 50) l
+                     ELSE
+                        WRITE (err_msg, 40) i1,j1,k1,l,m1,n1
+                     ENDIF
+                     GO TO 999 
+                  ENDIF
+                  ts(l,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1,1,1)
+                   bb = b(l,1,1,1,1,1)
+                   result(i,j,k,l,m,n) = SQRT(aa*aa + bb*bb)
+ 410           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/fftinv_subs.F b/fer/efi/fftinv_subs.F
new file mode 100644
index 0000000..d686b1c
--- /dev/null
+++ b/fer/efi/fftinv_subs.F
@@ -0,0 +1,523 @@
+
+      SUBROUTINE FFTINV (ND, X, a, b, WFT)
+      real X(*), WFT(*)
+      real a(*), b(*)
+      integer nd, nf, i, j
+
+C  From snsr, by Jim Larsen, PMEL 
+C  Ansley Manke: 11/2001 Change to undo scaling in FOUR_RE
+c   calls NCAR FFT code
+
+c   Calls:  RFFTB
+
+      NF = ND/ 2 
+
+      X(1) = 0.0
+      X(2) = a(1)
+
+      DO I = 1, NF-1 
+        J = 2* i
+        X(J)   = 0.5* a(i) 
+        X(J+1) = -0.5* b(i) 
+      ENDDO
+
+      X(ND) = a(nf)
+
+      CALL RFFTB (ND, X, WFT) 
+
+      RETURN 
+      END
+
+C     SUBROUTINE RFFTB(N,R,WSAVE)                                               
+C                                                                               
+C     SUBROUTINE RFFTB COMPUTES THE REAL PERODIC SEQUENCE FROM ITS              
+C     FOURIER COEFFICIENTS (FOURIER SYNTHESIS). THE TRANSFORM IS DEFINED        
+C     BELOW AT OUTPUT PARAMETER R.                                              
+C                                                                               
+C     INPUT PARAMETERS                                                          
+C                                                                               
+C     N       THE LENGTH OF THE ARRAY R TO BE TRANSFORMED.  THE METHOD          
+C             IS MOST EFFICIENT WHEN N IS A PRODUCT OF SMALL PRIMES.            
+C             N MAY CHANGE SO LONG AS DIFFERENT WORK ARRAYS ARE PROVIDED        
+C                                                                               
+C     R       A REAL ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE              
+C             TO BE TRANSFORMED                                                 
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             IN THE PROGRAM THAT CALLS RFFTB. THE WSAVE ARRAY MUST BE          
+C             INITIALIZED BY CALLING SUBROUTINE RFFTI(N,WSAVE) AND A            
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT             
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE               
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT           
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.                 
+C             THE SAME WSAVE ARRAY CAN BE USED BY RFFTF AND RFFTB.              
+C                                                                               
+C                                                                               
+C     OUTPUT PARAMETERS                                                         
+C                                                                               
+C     R       FOR N EVEN AND FOR I = 1,...,N                                    
+C                                                                               
+C                  R(I) = R(1)+(-1)**(I-1)*R(N)                                 
+C                                                                               
+C                       PLUS THE SUM FROM K=2 TO K=N/2 OF                       
+C                                                                               
+C                        2.*R(2*K-2)*COS((K-1)*(I-1)*2*PI/N)                    
+C                                                                               
+C                       -2.*R(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)                    
+C                                                                               
+C             FOR N ODD AND FOR I = 1,...,N                                     
+C                                                                               
+C                  R(I) = R(1) PLUS THE SUM FROM K=2 TO K=(N+1)/2 OF            
+C                                                                               
+C                       2.*R(2*K-2)*COS((K-1)*(I-1)*2*PI/N)                     
+C                                                                               
+C                      -2.*R(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)                     
+C                                                                               
+C      *****  NOTE                                                              
+C                  THIS TRANSFORM IS UNNORMALIZED SINCE A CALL OF RFFTF         
+C                  FOLLOWED BY A CALL OF RFFTB WILL MULTIPLY THE INPUT          
+C                  SEQUENCE BY N.                                               
+C                                                                               
+C     WSAVE   CONTAINS RESULTS WHICH MUST NOT BE DESTROYED BETWEEN              
+C             CALLS OF RFFTB OR RFFTF.                                          
+C                                                                               
+C                                                                               
+      SUBROUTINE RFFTB (N,R,WSAVE)                                              
+      INTEGER N
+      REAL       R(*)       ,WSAVE(*)     
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTB1 (N,R,WSAVE,WSAVE(N+1),WSAVE(2*N+1))                           
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTB1 (N,C,CH,WA,IFAC)                                        
+      INTEGER N, NF, NA, L1, IW, K1, IP, L2, IDO, IDL1, I, IX2, IX3, IX4
+      REAL       CH(*)      ,C(*)       ,WA(*)      ,IFAC(*)   
+      NF = IFAC(2)                                                              
+      NA = 0                                                                    
+      L1 = 1                                                                    
+      IW = 1                                                                    
+      DO 116 K1=1,NF                                                            
+         IP = IFAC(K1+2)                                                        
+         L2 = IP*L1                                                             
+         IDO = N/L2                                                             
+         IDL1 = IDO*L1                                                          
+         IF (IP .NE. 4) GO TO 103                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IF (NA .NE. 0) GO TO 101                                               
+         CALL RADB4 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 102                                                              
+  101    CALL RADB4 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3))                        
+  102    NA = 1-NA                                                              
+         GO TO 115                                                              
+  103    IF (IP .NE. 2) GO TO 106                                               
+         IF (NA .NE. 0) GO TO 104                                               
+         CALL RADB2 (IDO,L1,C,CH,WA(IW))                                        
+         GO TO 105                                                              
+  104    CALL RADB2 (IDO,L1,CH,C,WA(IW))                                        
+  105    NA = 1-NA                                                              
+         GO TO 115                                                              
+  106    IF (IP .NE. 3) GO TO 109                                               
+         IX2 = IW+IDO                                                           
+         IF (NA .NE. 0) GO TO 107                                               
+         CALL RADB3 (IDO,L1,C,CH,WA(IW),WA(IX2))                                
+         GO TO 108                                                              
+  107    CALL RADB3 (IDO,L1,CH,C,WA(IW),WA(IX2))                                
+  108    NA = 1-NA                                                              
+         GO TO 115                                                              
+  109    IF (IP .NE. 5) GO TO 112                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IX4 = IX3+IDO                                                          
+         IF (NA .NE. 0) GO TO 110                                               
+         CALL RADB5 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 111                                                              
+  110    CALL RADB5 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+  111    NA = 1-NA                                                              
+         GO TO 115                                                              
+  112    IF (NA .NE. 0) GO TO 113                                               
+         CALL RADBG (IDO,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))                         
+         GO TO 114                                                              
+  113    CALL RADBG (IDO,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))                        
+  114    IF (IDO .EQ. 1) NA = 1-NA                                              
+  115    L1 = L2                                                                
+         IW = IW+(IP-1)*IDO                                                     
+  116 CONTINUE                                                                  
+      IF (NA .EQ. 0) RETURN                                                     
+      DO 117 I=1,N                                                              
+         C(I) = CH(I)                                                           
+  117 CONTINUE                                                                  
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADB2 (IDO,L1,CC,CH,WA1)                                       
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,2,L1)           ,CH(IDO,L1,2)           ,          
+     1                WA1(*)          
+      REAL TR2, TI2
+      DO 101 K=1,L1                                                             
+         CH(1,K,1) = CC(1,1,K)+CC(IDO,2,K)                                      
+         CH(1,K,2) = CC(1,1,K)-CC(IDO,2,K)                                      
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            CH(I-1,K,1) = CC(I-1,1,K)+CC(IC-1,2,K)                              
+            TR2 = CC(I-1,1,K)-CC(IC-1,2,K)                                      
+            CH(I,K,1) = CC(I,1,K)-CC(IC,2,K)                                    
+            TI2 = CC(I,1,K)+CC(IC,2,K)                                          
+            CH(I-1,K,2) = WA1(I-2)*TR2-WA1(I-1)*TI2                             
+            CH(I,K,2) = WA1(I-2)*TI2+WA1(I-1)*TR2                               
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 DO 106 K=1,L1                                                             
+         CH(IDO,K,1) = CC(IDO,1,K)+CC(IDO,1,K)                                  
+         CH(IDO,K,2) = -(CC(1,2,K)+CC(1,2,K))                                   
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADB3 (IDO,L1,CC,CH,WA1,WA2)                                   
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,3,L1)           ,CH(IDO,L1,3)           ,          
+     1                WA1(*)     ,WA2(*)  
+      REAL TAUI, TAUR
+      REAL TR2, TI2, CR2, CI2, CR3, CI3, DR2, DI2, DI3, DR3
+      DATA TAUR,TAUI /-.5,.866025403784439/                                     
+      DO 101 K=1,L1                                                             
+         TR2 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         CR2 = CC(1,1,K)+TAUR*TR2                                               
+         CH(1,K,1) = CC(1,1,K)+TR2                                              
+         CI3 = TAUI*(CC(1,3,K)+CC(1,3,K))                                       
+         CH(1,K,2) = CR2-CI3                                                    
+         CH(1,K,3) = CR2+CI3                                                    
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TR2 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            CR2 = CC(I-1,1,K)+TAUR*TR2                                          
+            CH(I-1,K,1) = CC(I-1,1,K)+TR2                                       
+            TI2 = CC(I,3,K)-CC(IC,2,K)                                          
+            CI2 = CC(I,1,K)+TAUR*TI2                                            
+            CH(I,K,1) = CC(I,1,K)+TI2                                           
+            CR3 = TAUI*(CC(I-1,3,K)-CC(IC-1,2,K))                               
+            CI3 = TAUI*(CC(I,3,K)+CC(IC,2,K))                                   
+            DR2 = CR2-CI3                                                       
+            DR3 = CR2+CI3                                                       
+            DI2 = CI2+CR3                                                       
+            DI3 = CI2-CR3                                                       
+            CH(I-1,K,2) = WA1(I-2)*DR2-WA1(I-1)*DI2                             
+            CH(I,K,2) = WA1(I-2)*DI2+WA1(I-1)*DR2                               
+            CH(I-1,K,3) = WA2(I-2)*DR3-WA2(I-1)*DI3                             
+            CH(I,K,3) = WA2(I-2)*DI3+WA2(I-1)*DR3                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END    
+                                                 
+      SUBROUTINE RADBG (IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)                      
+      INTEGER IDO, IP, L1, IDL1, J, IC, L, LC
+      INTEGER IDP2, NBD, IPP2, IPPH, K, I, JC, J2, IK, IS, IDIJ
+      REAL            CH(IDO,L1,IP)          ,CC(IDO,IP,L1)          ,          
+     1                C1(IDO,L1,IP)          ,C2(IDL1,IP),                      
+     2                CH2(IDL1,IP)           ,WA(*)    
+      REAL PIMACH
+      REAL TPI, ARG, DCP, DSP , AR1, AI1, AR2, AR2H, DS2, DC2, DUM
+      REAL AR1H, AI2
+
+
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARG = TPI/FLOAT(IP)                                                       
+      DCP = COS(ARG)                                                            
+      DSP = SIN(ARG)                                                            
+      IDP2 = IDO+2                                                              
+      NBD = (IDO-1)/2                                                           
+      IPP2 = IP+2                                                               
+      IPPH = (IP+1)/2                                                           
+      IF (IDO .LT. L1) GO TO 103                                                
+      DO 102 K=1,L1                                                             
+         DO 101 I=1,IDO                                                         
+            CH(I,K,1) = CC(I,1,K)                                               
+  101    CONTINUE                                                               
+  102 CONTINUE                                                                  
+      GO TO 106                                                                 
+  103 DO 105 I=1,IDO                                                            
+         DO 104 K=1,L1                                                          
+            CH(I,K,1) = CC(I,1,K)                                               
+  104    CONTINUE                                                               
+  105 CONTINUE                                                                  
+  106 DO 108 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 107 K=1,L1                                                          
+            CH(1,K,J) = CC(IDO,J2-2,K)+CC(IDO,J2-2,K)                           
+            CH(1,K,JC) = CC(1,J2-1,K)+CC(1,J2-1,K)                              
+  107    CONTINUE                                                               
+  108 CONTINUE                                                                  
+      IF (IDO .EQ. 1) GO TO 116                                                 
+      IF (NBD .LT. L1) GO TO 112                                                
+      DO 111 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 110 K=1,L1                                                          
+            DO 109 I=3,IDO,2                                                    
+               IC = IDP2-I                                                      
+               CH(I-1,K,J) = CC(I-1,2*J-1,K)+CC(IC-1,2*J-2,K)                   
+               CH(I-1,K,JC) = CC(I-1,2*J-1,K)-CC(IC-1,2*J-2,K)                  
+               CH(I,K,J) = CC(I,2*J-1,K)-CC(IC,2*J-2,K)                         
+               CH(I,K,JC) = CC(I,2*J-1,K)+CC(IC,2*J-2,K)                        
+  109       CONTINUE                                                            
+  110    CONTINUE                                                               
+  111 CONTINUE                                                                  
+      GO TO 116                                                                 
+  112 DO 115 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 114 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DO 113 K=1,L1                                                       
+               CH(I-1,K,J) = CC(I-1,2*J-1,K)+CC(IC-1,2*J-2,K)                   
+               CH(I-1,K,JC) = CC(I-1,2*J-1,K)-CC(IC-1,2*J-2,K)                  
+               CH(I,K,J) = CC(I,2*J-1,K)-CC(IC,2*J-2,K)                         
+               CH(I,K,JC) = CC(I,2*J-1,K)+CC(IC,2*J-2,K)                        
+  113       CONTINUE                                                            
+  114    CONTINUE                                                               
+  115 CONTINUE                                                                  
+  116 AR1 = 1.                                                                  
+      AI1 = 0.                                                                  
+      DO 120 L=2,IPPH                                                           
+         LC = IPP2-L                                                            
+         AR1H = DCP*AR1-DSP*AI1                                                 
+         AI1 = DCP*AI1+DSP*AR1                                                  
+         AR1 = AR1H                                                             
+         DO 117 IK=1,IDL1                                                       
+            C2(IK,L) = CH2(IK,1)+AR1*CH2(IK,2)                                  
+            C2(IK,LC) = AI1*CH2(IK,IP)                                          
+  117    CONTINUE                                                               
+         DC2 = AR1                                                              
+         DS2 = AI1                                                              
+         AR2 = AR1                                                              
+         AI2 = AI1                                                              
+         DO 119 J=3,IPPH                                                        
+            JC = IPP2-J                                                         
+            AR2H = DC2*AR2-DS2*AI2                                              
+            AI2 = DC2*AI2+DS2*AR2                                               
+            AR2 = AR2H                                                          
+            DO 118 IK=1,IDL1                                                    
+               C2(IK,L) = C2(IK,L)+AR2*CH2(IK,J)                                
+               C2(IK,LC) = C2(IK,LC)+AI2*CH2(IK,JC)                             
+  118       CONTINUE                                                            
+  119    CONTINUE                                                               
+  120 CONTINUE                                                                  
+      DO 122 J=2,IPPH                                                           
+         DO 121 IK=1,IDL1                                                       
+            CH2(IK,1) = CH2(IK,1)+CH2(IK,J)                                     
+  121    CONTINUE                                                               
+  122 CONTINUE                                                                  
+      DO 124 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 123 K=1,L1                                                          
+            CH(1,K,J) = C1(1,K,J)-C1(1,K,JC)                                    
+            CH(1,K,JC) = C1(1,K,J)+C1(1,K,JC)                                   
+  123    CONTINUE                                                               
+  124 CONTINUE                                                                  
+      IF (IDO .EQ. 1) GO TO 132                                                 
+      IF (NBD .LT. L1) GO TO 128                                                
+      DO 127 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 126 K=1,L1                                                          
+            DO 125 I=3,IDO,2                                                    
+               CH(I-1,K,J) = C1(I-1,K,J)-C1(I,K,JC)                             
+               CH(I-1,K,JC) = C1(I-1,K,J)+C1(I,K,JC)                            
+               CH(I,K,J) = C1(I,K,J)+C1(I-1,K,JC)                               
+               CH(I,K,JC) = C1(I,K,J)-C1(I-1,K,JC)                              
+  125       CONTINUE                                                            
+  126    CONTINUE                                                               
+  127 CONTINUE                                                                  
+      GO TO 132                                                                 
+  128 DO 131 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 130 I=3,IDO,2                                                       
+            DO 129 K=1,L1                                                       
+               CH(I-1,K,J) = C1(I-1,K,J)-C1(I,K,JC)                             
+               CH(I-1,K,JC) = C1(I-1,K,J)+C1(I,K,JC)                            
+               CH(I,K,J) = C1(I,K,J)+C1(I-1,K,JC)                               
+               CH(I,K,JC) = C1(I,K,J)-C1(I-1,K,JC)                              
+  129       CONTINUE                                                            
+  130    CONTINUE                                                               
+  131 CONTINUE                                                                  
+  132 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      DO 133 IK=1,IDL1                                                          
+         C2(IK,1) = CH2(IK,1)                                                   
+  133 CONTINUE                                                                  
+      DO 135 J=2,IP                                                             
+         DO 134 K=1,L1                                                          
+            C1(1,K,J) = CH(1,K,J)                                               
+  134    CONTINUE                                                               
+  135 CONTINUE                                                                  
+      IF (NBD .GT. L1) GO TO 139                                                
+      IS = -IDO                                                                 
+      DO 138 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         IDIJ = IS                                                              
+         DO 137 I=3,IDO,2                                                       
+            IDIJ = IDIJ+2                                                       
+            DO 136 K=1,L1                                                       
+               C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J)          
+               C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J)            
+  136       CONTINUE                                                            
+  137    CONTINUE                                                               
+  138 CONTINUE                                                                  
+      GO TO 143                                                                 
+  139 IS = -IDO                                                                 
+      DO 142 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         DO 141 K=1,L1                                                          
+            IDIJ = IS                                                           
+            DO 140 I=3,IDO,2                                                    
+               IDIJ = IDIJ+2                                                    
+               C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J)          
+               C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J)            
+  140       CONTINUE                                                            
+  141    CONTINUE                                                               
+  142 CONTINUE                                                                  
+  143 RETURN                                                                    
+      END                                                                       
+
+                                                               
+      SUBROUTINE RADB4 (IDO,L1,CC,CH,WA1,WA2,WA3)                               
+      INTEGER IDO, L1, K, I, IDP2, IC
+      REAL       CC(IDO,4,L1)           ,CH(IDO,L1,4)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)      
+      REAL SQRT2
+      REAL TR1, TR2, TR3, TR4, TI1, TI2, TI3, TI4
+      REAL CR2, CR3, CR4, CI2, CI3, CI4
+      DATA SQRT2 /1.414213562373095/                                            
+      DO 101 K=1,L1                                                             
+         TR1 = CC(1,1,K)-CC(IDO,4,K)                                            
+         TR2 = CC(1,1,K)+CC(IDO,4,K)                                            
+         TR3 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         TR4 = CC(1,3,K)+CC(1,3,K)                                              
+         CH(1,K,1) = TR2+TR3                                                    
+         CH(1,K,2) = TR1-TR4                                                    
+         CH(1,K,3) = TR2-TR3                                                    
+         CH(1,K,4) = TR1+TR4                                                    
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TI1 = CC(I,1,K)+CC(IC,4,K)                                          
+            TI2 = CC(I,1,K)-CC(IC,4,K)                                          
+            TI3 = CC(I,3,K)-CC(IC,2,K)                                          
+            TR4 = CC(I,3,K)+CC(IC,2,K)                                          
+            TR1 = CC(I-1,1,K)-CC(IC-1,4,K)                                      
+            TR2 = CC(I-1,1,K)+CC(IC-1,4,K)                                      
+            TI4 = CC(I-1,3,K)-CC(IC-1,2,K)                                      
+            TR3 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            CH(I-1,K,1) = TR2+TR3                                               
+            CR3 = TR2-TR3                                                       
+            CH(I,K,1) = TI2+TI3                                                 
+            CI3 = TI2-TI3                                                       
+            CR2 = TR1-TR4                                                       
+            CR4 = TR1+TR4                                                       
+            CI2 = TI1+TI4                                                       
+            CI4 = TI1-TI4                                                       
+            CH(I-1,K,2) = WA1(I-2)*CR2-WA1(I-1)*CI2                             
+            CH(I,K,2) = WA1(I-2)*CI2+WA1(I-1)*CR2                               
+            CH(I-1,K,3) = WA2(I-2)*CR3-WA2(I-1)*CI3                             
+            CH(I,K,3) = WA2(I-2)*CI3+WA2(I-1)*CR3                               
+            CH(I-1,K,4) = WA3(I-2)*CR4-WA3(I-1)*CI4                             
+            CH(I,K,4) = WA3(I-2)*CI4+WA3(I-1)*CR4                               
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 CONTINUE                                                                  
+      DO 106 K=1,L1                                                             
+         TI1 = CC(1,2,K)+CC(1,4,K)                                              
+         TI2 = CC(1,4,K)-CC(1,2,K)                                              
+         TR1 = CC(IDO,1,K)-CC(IDO,3,K)                                          
+         TR2 = CC(IDO,1,K)+CC(IDO,3,K)                                          
+         CH(IDO,K,1) = TR2+TR2                                                  
+         CH(IDO,K,2) = SQRT2*(TR1-TI1)                                          
+         CH(IDO,K,3) = TI2+TI2                                                  
+         CH(IDO,K,4) = -SQRT2*(TR1+TI1)                                         
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                             
+                                                    
+      SUBROUTINE RADB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4)                           
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,5,L1)           ,CH(IDO,L1,5)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)     ,WA4(*)     
+      REAL TR2, TR3, TR4, TR5, TI2, TI3, TI4, TI5
+      REAL CR2, CR3, CR4, CR5, CI2, CI3, CI4, CI5
+      REAL DR2, DR3, DR4, DR5, DI2, DI3, DI4, DI5
+
+      REAL TR11,TI11,TR12,TI12
+      DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154,              
+     1-.809016994374947,.587785252292473/       
+     
+      DO 101 K=1,L1                                                             
+         TI5 = CC(1,3,K)+CC(1,3,K)                                              
+         TI4 = CC(1,5,K)+CC(1,5,K)                                              
+         TR2 = CC(IDO,2,K)+CC(IDO,2,K)                                          
+         TR3 = CC(IDO,4,K)+CC(IDO,4,K)                                          
+         CH(1,K,1) = CC(1,1,K)+TR2+TR3                                          
+         CR2 = CC(1,1,K)+TR11*TR2+TR12*TR3                                      
+         CR3 = CC(1,1,K)+TR12*TR2+TR11*TR3                                      
+         CI5 = TI11*TI5+TI12*TI4                                                
+         CI4 = TI12*TI5-TI11*TI4                                                
+         CH(1,K,2) = CR2-CI5                                                    
+         CH(1,K,3) = CR3-CI4                                                    
+         CH(1,K,4) = CR3+CI4                                                    
+         CH(1,K,5) = CR2+CI5                                                    
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TI5 = CC(I,3,K)+CC(IC,2,K)                                          
+            TI2 = CC(I,3,K)-CC(IC,2,K)                                          
+            TI4 = CC(I,5,K)+CC(IC,4,K)                                          
+            TI3 = CC(I,5,K)-CC(IC,4,K)                                          
+            TR5 = CC(I-1,3,K)-CC(IC-1,2,K)                                      
+            TR2 = CC(I-1,3,K)+CC(IC-1,2,K)                                      
+            TR4 = CC(I-1,5,K)-CC(IC-1,4,K)                                      
+            TR3 = CC(I-1,5,K)+CC(IC-1,4,K)                                      
+            CH(I-1,K,1) = CC(I-1,1,K)+TR2+TR3                                   
+            CH(I,K,1) = CC(I,1,K)+TI2+TI3                                       
+            CR2 = CC(I-1,1,K)+TR11*TR2+TR12*TR3                                 
+            CI2 = CC(I,1,K)+TR11*TI2+TR12*TI3                                   
+            CR3 = CC(I-1,1,K)+TR12*TR2+TR11*TR3                                 
+            CI3 = CC(I,1,K)+TR12*TI2+TR11*TI3                                   
+            CR5 = TI11*TR5+TI12*TR4                                             
+            CI5 = TI11*TI5+TI12*TI4                                             
+            CR4 = TI12*TR5-TI11*TR4                                             
+            CI4 = TI12*TI5-TI11*TI4                                             
+            DR3 = CR3-CI4                                                       
+            DR4 = CR3+CI4                                                       
+            DI3 = CI3+CR4                                                       
+            DI4 = CI3-CR4                                                       
+            DR5 = CR2+CI5                                                       
+            DR2 = CR2-CI5                                                       
+            DI5 = CI2-CR5                                                       
+            DI2 = CI2+CR5                                                       
+            CH(I-1,K,2) = WA1(I-2)*DR2-WA1(I-1)*DI2                             
+            CH(I,K,2) = WA1(I-2)*DI2+WA1(I-1)*DR2                               
+            CH(I-1,K,3) = WA2(I-2)*DR3-WA2(I-1)*DI3                             
+            CH(I,K,3) = WA2(I-2)*DI3+WA2(I-1)*DR3                               
+            CH(I-1,K,4) = WA3(I-2)*DR4-WA3(I-1)*DI4                             
+            CH(I,K,4) = WA3(I-2)*DI4+WA3(I-1)*DR4                               
+            CH(I-1,K,5) = WA4(I-2)*DR5-WA4(I-1)*DI5                             
+            CH(I,K,5) = WA4(I-2)*DI5+WA4(I-1)*DR5                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                  
diff --git a/fer/efi/fftp.F b/fer/efi/fftp.F
new file mode 100644
index 0000000..0bce1f7
--- /dev/null
+++ b/fer/efi/fftp.F
@@ -0,0 +1,490 @@
+*
+* fftp.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Dec 1998
+*
+* v5.50  *acm* 10/02 Simplify the error message for missing data when the 
+*                    input is a simple 1-D time series.
+* V5.53  *acm*  6/03 Correct the frequency axis:  why was there a factor of
+*                     1.001 in freqn = 1.001*yquist?
+*
+* This function computes fft phase spectrum for each time series.  Result
+* time axis is a custom axis in period 1./time  The input variable must have
+* the time axis specified explicitly in the function call e.g. 
+*    LET sstp = fftp(ssttim[l=1:492])
+* and the time axis must be regular.
+
+*  Note current limitations as of 1-Jan-2000
+*   - Will have a utility to get the length of the input time axis at the
+*     point when the custom freq axis is set up, to use in computing the
+*     length of the frequency axis.  Currently need to specify explicitly, 
+*     in the function call e.g. fftp(sst[l=1:400]).
+
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*       LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*       LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE fftp_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*110 arg_desc
+
+      CALL ef_set_desc(id, 'Computes fft phase' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, CUSTOM,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      WRITE (arg_desc, 10) 
+   10 FORMAT ('Variable with regular time axis. Specify time ', 
+     .        'explicitly e.g. fftp(var[l=1,120])')
+      CALL ef_set_arg_desc(id, arg, arg_desc)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE fftp_custom_axes(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                      
+*
+*     Use utility functions to get grid information about the 
+*     argument; use this info to determine the custom axis lo/hi/del 
+
+      INTEGER nfreq_lo_l, nfreq_hi_l
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER arg, nd
+      CHARACTER outunits*32
+      REAL boxsize(1)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      arg = 1
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_get_axis_info_6d(id, arg, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .                     arg_lo_ss(T_AXIS,arg), boxsize)
+
+      IF ( arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) .EQ. 0 ) THEN
+         nfreq_lo_l = 1
+         nfreq_hi_l = 2
+      ELSE
+         nfreq_lo_l = arg_lo_ss(T_AXIS,arg)
+         nfreq_hi_l = arg_hi_ss(T_AXIS,arg)
+      ENDIF
+
+      nd = abs(nfreq_hi_l - nfreq_lo_l) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+c      nfreq = nd/2
+c      yquist = 1./(2.*boxsize(1))		! Nyquist frequency
+c
+c      freq1 = 1.* yquist/ float(nfreq)
+c!      freqn = 1.001*yquist  !  WHY THE 1.001???
+c      freqn = yquist
+c
+cC  Set label for the frequency axis CYC/units.
+c
+c      outunits = 'CYC/' // ax_units(T_AXIS)
+c
+c      CALL ef_set_custom_axis (id, T_AXIS, freq1, freqn, freq1, 
+c     .                         outunits, NO)
+
+
+C Use ef_set_freq_axis (if we could let freq1, freqn be double precision
+C in the ef_set_custom_axis call, that would be equivalent.)
+C
+C  Set label for the frequency axis CYC/units.
+
+      outunits = 'CYC/' // ax_units(T_AXIS)
+
+      CALL ef_set_freq_axis (id, T_AXIS, nd, boxsize(1), outunits, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE fftp_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ntime, nfreq
+      INTEGER arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      arg = 1
+      ntime = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+C  The FFT code returns frequencies W(k) for k=1 to N/2, with N/2 rounded down
+
+      nfreq = ntime/ 2
+      if (ntime .ne. nfreq*2) nfreq = (ntime+1)/2 ! see FFTPACK comments in rfftf
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nfreq)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE fftp_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays,  X/Y/Z/T dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mtwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      mtwork = 2.5* mtdat + 15
+  
+* a
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* b
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* wft
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                           mtwork, 1, 1, 1, 1, 1)
+
+* ts
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fftp_compute(id, arg_1, result, a, b, wft, ts)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL a(wrk1lox:wrk1hix, wrk1loy:wrk1hiy, wrk1loz:wrk1hiz,
+     .       wrk1lot:wrk1hit, wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL b(wrk2lox:wrk2hix, wrk2loy:wrk2hiy, wrk2loz:wrk2hiz,
+     .       wrk2lot:wrk2hit, wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL wft(wrk3lox:wrk3hix, wrk3loy:wrk3hiy, wrk3loz:wrk3hiz,
+     .         wrk3lot:wrk3hit, wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL ts(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz,
+     .        wrk4lot:wrk4hit, wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      REAL aa, bb,  rad
+      INTEGER arg, nd, nf
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*128 err_msg
+
+   40 FORMAT ('FFTP encountered missing data at (i,j,k,l,m,n)', 6I5)
+   50 FORMAT ('FFTP encountered missing data at L=', I5)
+
+      rad = 180.0 / 3.141592653589793
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  number of time points.
+
+      arg = 1
+      nd = (arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1)
+      nf = nd/ 2
+
+*  Check that the time axis is regular.
+
+      CALL ef_get_axis_info_6d(id, 1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF (.NOT. regular(T_AXIS)) THEN
+         WRITE (err_msg, *) 'Time axis must be a regular axis'
+         GO TO 999
+      ENDIF
+
+*  Set WFT for fft; prime factorization of ND and trig functions.
+
+      CALL rffti (nd, wft)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Calculate the FFT for each time series which have no missing data.
+* Make a simple error message if we have a 1-D input time series.
+
+               l1 =arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = 1, nd
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1)) THEN
+                     IF ( i1 .EQ. ef_unspecified_int4 .AND.
+     .                    j1 .EQ. ef_unspecified_int4 .AND.
+     .                    k1 .EQ. ef_unspecified_int4 .AND.
+     .                    m1 .EQ. ef_unspecified_int4 .AND.
+     .                    n1 .EQ. ef_unspecified_int4 ) THEN
+                        WRITE (err_msg, 50) l
+                     ELSE
+                        WRITE (err_msg, 40) i1,j1,k1,l,m1,n1
+                     ENDIF
+                     GO TO 999 
+                  ENDIF
+                  ts(l,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               CALL four_re (nd, ts, a, b, wft)
+
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+                   aa = a(l,1,1,1,1,1)
+                   bb = b(l,1,1,1,1,1)
+                   result(i,j,k,l,m,n) = rad * ATAN2(-1.*bb, aa)
+ 410           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/fftsubs.F b/fer/efi/fftsubs.F
new file mode 100644
index 0000000..d4d7730
--- /dev/null
+++ b/fer/efi/fftsubs.F
@@ -0,0 +1,671 @@
+*  fftsubs.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+*   computation routines for FFT functions
+
+      SUBROUTINE four_re (nd, x, a, b, wft)
+      INTEGER nd, nf, i, j
+      REAL x(*), wft(*) 
+      REAL a(*), b(*), xn
+
+c   uses NCAR FFTPACK code
+
+C  Ansley Manke 1/2000 NOAA/PMEL   Return A, B real arrays with Fourier coefficients.
+C  Uses notes by Ned Cokelet 1/2000 on Swartztrauber FFTPACK code.
+
+c   Calls: RFFTF
+
+
+C  NF = number of frequencies, half the number of times.
+C  The code returns frequencies W(i) for i=0 to ND/2, with ND/2 rounded down.
+C  We do not return a(0) = R1/ND
+C  We return a(i) and b(i) for i=1,... ND/2  
+
+      nf = nd/ 2
+
+      CALL rfftf (nd, x, wft) 
+
+C  Normalizing factor of 1./N
+
+c      xn = 1.0
+      xn = 1.0/ REAL(nd)
+
+c   Save FFT coefficients in arrays a and b.
+      
+      j = 0
+      DO i = 1, nf-1
+        j = 2* i
+        a(i) =  2.* xn* x(j)
+        b(i) = -2.* xn* x(j+1) 
+      ENDDO
+
+C  Set a(nf) and b(nf) when nd is even/odd.
+
+      IF (nf*2 .eq. nd) THEN		! even ND
+         a(nf) = xn* x(nd)
+         b(nf) = 0.
+      ELSE				! odd ND
+         a(nf) = 2.* xn* x(nd-1)
+         b(nf) = -2.* xn* x(nd)
+      ENDIF
+
+      RETURN 
+      END
+
+                                                                 
+C     SUBROUTINE RFFTF(N,R,WSAVE)                                               
+C                                                                               
+C     SUBROUTINE RFFTF COMPUTES THE FOURIER COEFFICIENTS OF A REAL              
+C     PERODIC SEQUENCE (FOURIER ANALYSIS). THE TRANSFORM IS DEFINED             
+C     BELOW AT OUTPUT PARAMETER R.                                              
+C                                                                               
+C     INPUT PARAMETERS                                                          
+C                                                                               
+C     N       THE LENGTH OF THE ARRAY R TO BE TRANSFORMED.  THE METHOD          
+C             IS MOST EFFICIENT WHEN N IS A PRODUCT OF SMALL PRIMES.            
+C             N MAY CHANGE SO LONG AS DIFFERENT WORK ARRAYS ARE PROVIDED        
+C                                                                               
+C     R       A REAL ARRAY OF LENGTH N WHICH CONTAINS THE SEQUENCE              
+C             TO BE TRANSFORMED                                                 
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             IN THE PROGRAM THAT CALLS RFFTF. THE WSAVE ARRAY MUST BE          
+C             INITIALIZED BY CALLING SUBROUTINE RFFTI(N,WSAVE) AND A            
+C             DIFFERENT WSAVE ARRAY MUST BE USED FOR EACH DIFFERENT             
+C             VALUE OF N. THIS INITIALIZATION DOES NOT HAVE TO BE               
+C             REPEATED SO LONG AS N REMAINS UNCHANGED THUS SUBSEQUENT           
+C             TRANSFORMS CAN BE OBTAINED FASTER THAN THE FIRST.                 
+C             THE SAME WSAVE ARRAY CAN BE USED BY RFFTF AND RFFTB.              
+C                                                                               
+C                                                                               
+C     OUTPUT PARAMETERS                                                         
+C                                                                               
+C     R       R(1) = THE SUM FROM I=1 TO I=N OF R(I)                            
+C                                                                               
+C             IF N IS EVEN SET L =N/2   , IF N IS ODD SET L = (N+1)/2           
+C                                                                               
+C               THEN FOR K = 2,...,L                                            
+C                                                                               
+C                  R(2*K-2) = THE SUM FROM I = 1 TO I = N OF                    
+C                                                                               
+C                       R(I)*COS((K-1)*(I-1)*2*PI/N)                            
+C                                                                               
+C                  R(2*K-1) = THE SUM FROM I = 1 TO I = N OF                    
+C                                                                               
+C                      -R(I)*SIN((K-1)*(I-1)*2*PI/N)                            
+C                                                                               
+C             IF N IS EVEN                                                      
+C                                                                               
+C                  R(N) = THE SUM FROM I = 1 TO I = N OF                        
+C                                                                               
+C                       (-1)**(I-1)*R(I)                                        
+C                                                                               
+C      *****  NOTE                                                              
+C                  THIS TRANSFORM IS UNNORMALIZED SINCE A CALL OF RFFTF         
+C                  FOLLOWED BY A CALL OF RFFTB WILL MULTIPLY THE INPUT          
+C                  SEQUENCE BY N.                                               
+C                                                                               
+C     WSAVE   CONTAINS RESULTS WHICH MUST NOT BE DESTROYED BETWEEN              
+C             CALLS OF RFFTF OR RFFTB.                                          
+C                                                                               
+      SUBROUTINE RFFTF (N,R,WSAVE)                                              
+      INTEGER N
+      REAL       R(*)       ,WSAVE(*)             
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTF1 (N,R,WSAVE,WSAVE(N+1),WSAVE(2*N+1))                           
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTF1 (N,C,CH,WA,IFAC)                                        
+      INTEGER N, NF, NA, L2, IW, K1, KH, IP, L1, IDO, IDL1, IX2, IX3
+      INTEGER I, IX4
+      REAL       CH(*)      ,C(*)       ,WA(*)      ,IFAC(*)   
+      NF = IFAC(2)                                                              
+      NA = 1                                                                    
+      L2 = N                                                                    
+      IW = N                                                                    
+      DO 111 K1=1,NF                                                            
+         KH = NF-K1                                                             
+         IP = IFAC(KH+3)                                                        
+         L1 = L2/IP                                                             
+         IDO = N/L2                                                             
+         IDL1 = IDO*L1                                                          
+         IW = IW-(IP-1)*IDO                                                     
+         NA = 1-NA                                                              
+         IF (IP .NE. 4) GO TO 102                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IF (NA .NE. 0) GO TO 101                                               
+         CALL RADF4 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 110                                                              
+  101    CALL RADF4 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3))                        
+         GO TO 110                                                              
+  102    IF (IP .NE. 2) GO TO 104                                               
+         IF (NA .NE. 0) GO TO 103                                               
+         CALL RADF2 (IDO,L1,C,CH,WA(IW))                                        
+         GO TO 110                                                              
+  103    CALL RADF2 (IDO,L1,CH,C,WA(IW))                                        
+         GO TO 110                                                              
+  104    IF (IP .NE. 3) GO TO 106                                               
+         IX2 = IW+IDO                                                           
+         IF (NA .NE. 0) GO TO 105                                               
+         CALL RADF3 (IDO,L1,C,CH,WA(IW),WA(IX2))                                
+         GO TO 110                                                              
+  105    CALL RADF3 (IDO,L1,CH,C,WA(IW),WA(IX2))                                
+         GO TO 110                                                              
+  106    IF (IP .NE. 5) GO TO 108                                               
+         IX2 = IW+IDO                                                           
+         IX3 = IX2+IDO                                                          
+         IX4 = IX3+IDO                                                          
+         IF (NA .NE. 0) GO TO 107                                               
+         CALL RADF5 (IDO,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 110                                                              
+  107    CALL RADF5 (IDO,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))                
+         GO TO 110                                                              
+  108    IF (IDO .EQ. 1) NA = 1-NA                                              
+         IF (NA .NE. 0) GO TO 109                                               
+         CALL RADFG (IDO,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))                         
+         NA = 1                                                                 
+         GO TO 110                                                              
+  109    CALL RADFG (IDO,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))                        
+         NA = 0                                                                 
+  110    L2 = L1                                                                
+  111 CONTINUE                                                                  
+      IF (NA .EQ. 1) RETURN                                                     
+      DO 112 I=1,N                                                              
+         C(I) = CH(I)                                                           
+  112 CONTINUE                                                                  
+      RETURN                                                                    
+      END                         
+                                                                    
+C     SUBROUTINE RFFTI(N,WSAVE)                                                 
+C                                                                               
+C     SUBROUTINE RFFTI INITIALIZES THE ARRAY WSAVE WHICH IS USED IN             
+C     BOTH RFFTF AND RFFTB. THE PRIME FACTORIZATION OF N TOGETHER WITH          
+C     A TABULATION OF THE TRIGONOMETRIC FUNCTIONS ARE COMPUTED AND              
+C     STORED IN WSAVE.                                                          
+C                                                                               
+C     INPUT PARAMETER                                                           
+C                                                                               
+C     N       THE LENGTH OF THE SEQUENCE TO BE TRANSFORMED.                     
+C                                                                               
+C     OUTPUT PARAMETER                                                          
+C                                                                               
+C     WSAVE   A WORK ARRAY WHICH MUST BE DIMENSIONED AT LEAST 2*N+15.           
+C             THE SAME WORK ARRAY CAN BE USED FOR BOTH RFFTF AND RFFTB          
+C             AS LONG AS N REMAINS UNCHANGED. DIFFERENT WSAVE ARRAYS            
+C             ARE REQUIRED FOR DIFFERENT VALUES OF N. THE CONTENTS OF           
+C             WSAVE MUST NOT BE CHANGED BETWEEN CALLS OF RFFTF OR RFFTB.        
+C                                                                               
+      SUBROUTINE RFFTI (N,WSAVE)      
+      INTEGER N
+      REAL       WSAVE(*)                                                  
+C                                                                               
+      IF (N .EQ. 1) RETURN                                                      
+      CALL RFFTI1 (N,WSAVE(N+1),WSAVE(2*N+1))                                   
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RFFTI1 (N,WA,IFAC)                                             
+      INTEGER N, NL, NF, J, NTRY, NR, NQ, IB, I, IS, L1, NFM1, K1
+      INTEGER IP, LD, IDO, IPM, II, L2
+      REAL       WA(*)      ,IFAC(*)    ,NTRYH(4)         
+      REAL TPI, ARGH, ARGLD, FI, ARG, DUM
+      REAL PIMACH
+      DATA NTRYH(1),NTRYH(2),NTRYH(3),NTRYH(4)/4,2,3,5/                         
+      NL = N                                                                    
+      NF = 0                                                                    
+      J = 0                                                                     
+  101 J = J+1                                                                   
+      IF (J-4) 102,102,103                                                      
+  102 NTRY = NTRYH(J)                                                           
+      GO TO 104                                                                 
+  103 NTRY = NTRY+2                                                             
+  104 NQ = NL/NTRY                                                              
+      NR = NL-NTRY*NQ                                                           
+      IF (NR) 101,105,101                                                       
+  105 NF = NF+1                                                                 
+      IFAC(NF+2) = NTRY                                                         
+      NL = NQ                                                                   
+      IF (NTRY .NE. 2) GO TO 107                                                
+      IF (NF .EQ. 1) GO TO 107                                                  
+      DO 106 I=2,NF                                                             
+         IB = NF-I+2                                                            
+         IFAC(IB+2) = IFAC(IB+1)                                                
+  106 CONTINUE                                                                  
+      IFAC(3) = 2                                                               
+  107 IF (NL .NE. 1) GO TO 104                                                  
+      IFAC(1) = N                                                               
+      IFAC(2) = NF                                                              
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARGH = TPI/FLOAT(N)                                                       
+      IS = 0                                                                    
+      NFM1 = NF-1                                                               
+      L1 = 1                                                                    
+      IF (NFM1 .EQ. 0) RETURN                                                   
+      DO 110 K1=1,NFM1                                                          
+         IP = IFAC(K1+2)                                                        
+         LD = 0                                                                 
+         L2 = L1*IP                                                             
+         IDO = N/L2                                                             
+         IPM = IP-1                                                             
+         DO 109 J=1,IPM                                                         
+            LD = LD+L1                                                          
+            I = IS                                                              
+            ARGLD = FLOAT(LD)*ARGH                                              
+            FI = 0.                                                             
+            DO 108 II=3,IDO,2                                                   
+               I = I+2                                                          
+               FI = FI+1.                                                       
+               ARG = FI*ARGLD                                                   
+               WA(I-1) = COS(ARG)                                               
+               WA(I) = SIN(ARG)                                                 
+  108       CONTINUE                                                            
+            IS = IS+IDO                                                         
+  109    CONTINUE                                                               
+         L1 = L2                                                                
+  110 CONTINUE                                                                  
+      RETURN                                                                    
+      END
+   
+      
+      REAL FUNCTION PIMACH (DUM)                      
+C     PI=3.1415926535897932384626433832795028841971693993751058209749446        
+C                            
+      REAL DUM
+      PIMACH = 4.*ATAN(1.0)                                                     
+      RETURN                                                                    
+      END    
+                                                                            
+      SUBROUTINE RADFG (IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)                      
+      INTEGER IDO, IP, L1, IDL1, IPPH, IPP2, IDP2, NBD, IK, J, K, IS
+      INTEGER IDIJ, I, JC, L, LC, J2, IC
+      REAL       CH(IDO,L1,IP)          ,CC(IDO,IP,L1)          ,          
+     1                C1(IDO,L1,IP)          ,C2(IDL1,IP),                      
+     2                CH2(IDL1,IP)           ,WA(*)
+
+      REAL TPI, DUM, ARG, DCP, DSP, AR1, AI1, AR1H, DC2, DS2, AR2, AI2
+      REAL AR2H
+      REAL PIMACH
+      TPI = 2.0*PIMACH(DUM)                                                     
+      ARG = TPI/FLOAT(IP)                                                       
+      DCP = COS(ARG)                                                            
+      DSP = SIN(ARG)                                                            
+      IPPH = (IP+1)/2                                                           
+      IPP2 = IP+2                                                               
+      IDP2 = IDO+2                                                              
+      NBD = (IDO-1)/2                                                           
+      IF (IDO .EQ. 1) GO TO 119                                                 
+      DO 101 IK=1,IDL1                                                          
+         CH2(IK,1) = C2(IK,1)                                                   
+  101 CONTINUE                                                                  
+      DO 103 J=2,IP                                                             
+         DO 102 K=1,L1                                                          
+            CH(1,K,J) = C1(1,K,J)                                               
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      IF (NBD .GT. L1) GO TO 107                                                
+      IS = -IDO                                                                 
+      DO 106 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         IDIJ = IS                                                              
+         DO 105 I=3,IDO,2                                                       
+            IDIJ = IDIJ+2                                                       
+            DO 104 K=1,L1                                                       
+               CH(I-1,K,J) = WA(IDIJ-1)*C1(I-1,K,J)+WA(IDIJ)*C1(I,K,J)          
+               CH(I,K,J) = WA(IDIJ-1)*C1(I,K,J)-WA(IDIJ)*C1(I-1,K,J)            
+  104       CONTINUE                                                            
+  105    CONTINUE                                                               
+  106 CONTINUE                                                                  
+      GO TO 111                                                                 
+  107 IS = -IDO                                                                 
+      DO 110 J=2,IP                                                             
+         IS = IS+IDO                                                            
+         DO 109 K=1,L1                                                          
+            IDIJ = IS                                                           
+            DO 108 I=3,IDO,2                                                    
+               IDIJ = IDIJ+2                                                    
+               CH(I-1,K,J) = WA(IDIJ-1)*C1(I-1,K,J)+WA(IDIJ)*C1(I,K,J)          
+               CH(I,K,J) = WA(IDIJ-1)*C1(I,K,J)-WA(IDIJ)*C1(I-1,K,J)            
+  108       CONTINUE                                                            
+  109    CONTINUE                                                               
+  110 CONTINUE                                                                  
+  111 IF (NBD .LT. L1) GO TO 115                                                
+      DO 114 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 113 K=1,L1                                                          
+            DO 112 I=3,IDO,2                                                    
+               C1(I-1,K,J) = CH(I-1,K,J)+CH(I-1,K,JC)                           
+               C1(I-1,K,JC) = CH(I,K,J)-CH(I,K,JC)                              
+               C1(I,K,J) = CH(I,K,J)+CH(I,K,JC)                                 
+               C1(I,K,JC) = CH(I-1,K,JC)-CH(I-1,K,J)                            
+  112       CONTINUE                                                            
+  113    CONTINUE                                                               
+  114 CONTINUE                                                                  
+      GO TO 121                                                                 
+  115 DO 118 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 117 I=3,IDO,2                                                       
+            DO 116 K=1,L1                                                       
+               C1(I-1,K,J) = CH(I-1,K,J)+CH(I-1,K,JC)                           
+               C1(I-1,K,JC) = CH(I,K,J)-CH(I,K,JC)                              
+               C1(I,K,J) = CH(I,K,J)+CH(I,K,JC)                                 
+               C1(I,K,JC) = CH(I-1,K,JC)-CH(I-1,K,J)                            
+  116       CONTINUE                                                            
+  117    CONTINUE                                                               
+  118 CONTINUE                                                                  
+      GO TO 121                                                                 
+  119 DO 120 IK=1,IDL1                                                          
+         C2(IK,1) = CH2(IK,1)                                                   
+  120 CONTINUE                                                                  
+  121 DO 123 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         DO 122 K=1,L1                                                          
+            C1(1,K,J) = CH(1,K,J)+CH(1,K,JC)                                    
+            C1(1,K,JC) = CH(1,K,JC)-CH(1,K,J)                                   
+  122    CONTINUE                                                               
+  123 CONTINUE                                                                  
+C                                                                               
+      AR1 = 1.                                                                  
+      AI1 = 0.                                                                  
+      DO 127 L=2,IPPH                                                           
+         LC = IPP2-L                                                            
+         AR1H = DCP*AR1-DSP*AI1                                                 
+         AI1 = DCP*AI1+DSP*AR1                                                  
+         AR1 = AR1H                                                             
+         DO 124 IK=1,IDL1                                                       
+            CH2(IK,L) = C2(IK,1)+AR1*C2(IK,2)                                   
+            CH2(IK,LC) = AI1*C2(IK,IP)                                          
+  124    CONTINUE                                                               
+         DC2 = AR1                                                              
+         DS2 = AI1                                                              
+         AR2 = AR1                                                              
+         AI2 = AI1                                                              
+         DO 126 J=3,IPPH                                                        
+            JC = IPP2-J                                                         
+            AR2H = DC2*AR2-DS2*AI2                                              
+            AI2 = DC2*AI2+DS2*AR2                                               
+            AR2 = AR2H                                                          
+            DO 125 IK=1,IDL1                                                    
+               CH2(IK,L) = CH2(IK,L)+AR2*C2(IK,J)                               
+               CH2(IK,LC) = CH2(IK,LC)+AI2*C2(IK,JC)                            
+  125       CONTINUE                                                            
+  126    CONTINUE                                                               
+  127 CONTINUE                                                                  
+      DO 129 J=2,IPPH                                                           
+         DO 128 IK=1,IDL1                                                       
+            CH2(IK,1) = CH2(IK,1)+C2(IK,J)                                      
+  128    CONTINUE                                                               
+  129 CONTINUE                                                                  
+C                                                                               
+      IF (IDO .LT. L1) GO TO 132                                                
+      DO 131 K=1,L1                                                             
+         DO 130 I=1,IDO                                                         
+            CC(I,1,K) = CH(I,K,1)                                               
+  130    CONTINUE                                                               
+  131 CONTINUE                                                                  
+      GO TO 135                                                                 
+  132 DO 134 I=1,IDO                                                            
+         DO 133 K=1,L1                                                          
+            CC(I,1,K) = CH(I,K,1)                                               
+  133    CONTINUE                                                               
+  134 CONTINUE                                                                  
+  135 DO 137 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 136 K=1,L1                                                          
+            CC(IDO,J2-2,K) = CH(1,K,J)                                          
+            CC(1,J2-1,K) = CH(1,K,JC)                                           
+  136    CONTINUE                                                               
+  137 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IF (NBD .LT. L1) GO TO 141                                                
+      DO 140 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 139 K=1,L1                                                          
+            DO 138 I=3,IDO,2                                                    
+               IC = IDP2-I                                                      
+               CC(I-1,J2-1,K) = CH(I-1,K,J)+CH(I-1,K,JC)                        
+               CC(IC-1,J2-2,K) = CH(I-1,K,J)-CH(I-1,K,JC)                       
+               CC(I,J2-1,K) = CH(I,K,J)+CH(I,K,JC)                              
+               CC(IC,J2-2,K) = CH(I,K,JC)-CH(I,K,J)                             
+  138       CONTINUE                                                            
+  139    CONTINUE                                                               
+  140 CONTINUE                                                                  
+      RETURN                                                                    
+  141 DO 144 J=2,IPPH                                                           
+         JC = IPP2-J                                                            
+         J2 = J+J                                                               
+         DO 143 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DO 142 K=1,L1                                                       
+               CC(I-1,J2-1,K) = CH(I-1,K,J)+CH(I-1,K,JC)                        
+               CC(IC-1,J2-2,K) = CH(I-1,K,J)-CH(I-1,K,JC)                       
+               CC(I,J2-1,K) = CH(I,K,J)+CH(I,K,JC)                              
+               CC(IC,J2-2,K) = CH(I,K,JC)-CH(I,K,J)                             
+  142       CONTINUE                                                            
+  143    CONTINUE                                                               
+  144 CONTINUE                                                                  
+      RETURN                                                                    
+      END                         
+                                                                       
+      SUBROUTINE RADF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4)                           
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,L1,5)           ,CH(IDO,5,L1)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)     ,WA4(*)    
+      REAL CR2, CR3, CR4, CR5, CI2, CI3, CI4, CI5
+      REAL TR2, TR3, TR4, TR5, TI2, TI3, TI4, TI5
+      REAL DR2, DR3, DR4, DR5, DI2, DI3, DI4, DI5
+      REAL TR11, TI11, TR12, TI12
+      DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154,              
+     1-.809016994374947,.587785252292473/                                       
+      DO 101 K=1,L1                                                             
+         CR2 = CC(1,K,5)+CC(1,K,2)                                              
+         CI5 = CC(1,K,5)-CC(1,K,2)                                              
+         CR3 = CC(1,K,4)+CC(1,K,3)                                              
+         CI4 = CC(1,K,4)-CC(1,K,3)                                              
+         CH(1,1,K) = CC(1,K,1)+CR2+CR3                                          
+         CH(IDO,2,K) = CC(1,K,1)+TR11*CR2+TR12*CR3                              
+         CH(1,3,K) = TI11*CI5+TI12*CI4                                          
+         CH(IDO,4,K) = CC(1,K,1)+TR12*CR2+TR11*CR3                              
+         CH(1,5,K) = TI12*CI5-TI11*CI4                                          
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            DI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            DR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            DI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            DR4 = WA3(I-2)*CC(I-1,K,4)+WA3(I-1)*CC(I,K,4)                       
+            DI4 = WA3(I-2)*CC(I,K,4)-WA3(I-1)*CC(I-1,K,4)                       
+            DR5 = WA4(I-2)*CC(I-1,K,5)+WA4(I-1)*CC(I,K,5)                       
+            DI5 = WA4(I-2)*CC(I,K,5)-WA4(I-1)*CC(I-1,K,5)                       
+            CR2 = DR2+DR5                                                       
+            CI5 = DR5-DR2                                                       
+            CR5 = DI2-DI5                                                       
+            CI2 = DI2+DI5                                                       
+            CR3 = DR3+DR4                                                       
+            CI4 = DR4-DR3                                                       
+            CR4 = DI3-DI4                                                       
+            CI3 = DI3+DI4                                                       
+            CH(I-1,1,K) = CC(I-1,K,1)+CR2+CR3                                   
+            CH(I,1,K) = CC(I,K,1)+CI2+CI3                                       
+            TR2 = CC(I-1,K,1)+TR11*CR2+TR12*CR3                                 
+            TI2 = CC(I,K,1)+TR11*CI2+TR12*CI3                                   
+            TR3 = CC(I-1,K,1)+TR12*CR2+TR11*CR3                                 
+            TI3 = CC(I,K,1)+TR12*CI2+TR11*CI3                                   
+            TR5 = TI11*CR5+TI12*CR4                                             
+            TI5 = TI11*CI5+TI12*CI4                                             
+            TR4 = TI12*CR5-TI11*CR4                                             
+            TI4 = TI12*CI5-TI11*CI4                                             
+            CH(I-1,3,K) = TR2+TR5                                               
+            CH(IC-1,2,K) = TR2-TR5                                              
+            CH(I,3,K) = TI2+TI5                                                 
+            CH(IC,2,K) = TI5-TI2                                                
+            CH(I-1,5,K) = TR3+TR4                                               
+            CH(IC-1,4,K) = TR3-TR4                                              
+            CH(I,5,K) = TI3+TI4                                                 
+            CH(IC,4,K) = TI4-TI3                                                
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                           
+                                                                  
+      SUBROUTINE RADF2 (IDO,L1,CC,CH,WA1)                                       
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CH(IDO,2,L1)           ,CC(IDO,L1,2)           ,          
+     1                WA1(*)           
+      REAL TR2, TI2
+      DO 101 K=1,L1                                                             
+         CH(1,1,K) = CC(1,K,1)+CC(1,K,2)                                        
+         CH(IDO,2,K) = CC(1,K,1)-CC(1,K,2)                                      
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            TR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            TI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            CH(I,1,K) = CC(I,K,1)+TI2                                           
+            CH(IC,2,K) = TI2-CC(I,K,1)                                          
+            CH(I-1,1,K) = CC(I-1,K,1)+TR2                                       
+            CH(IC-1,2,K) = CC(I-1,K,1)-TR2                                      
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 DO 106 K=1,L1                                                             
+         CH(1,2,K) = -CC(IDO,K,2)                                               
+         CH(IDO,1,K) = CC(IDO,K,1)                                              
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END      
+                                                                       
+      SUBROUTINE RADF3 (IDO,L1,CC,CH,WA1,WA2)                                   
+      INTEGER IDO, L1, I, IC, K, IDP2
+      REAL       CH(IDO,3,L1)           ,CC(IDO,L1,3)           ,          
+     1                WA1(*)     ,WA2(*)     
+      REAL TAUR, TAUI, CR2, DR2, DI2, DR3, DI3, CI2, TR2, TI2, TR3, TI3
+      DATA TAUR,TAUI /-.5,.866025403784439/                                     
+      DO 101 K=1,L1                                                             
+         CR2 = CC(1,K,2)+CC(1,K,3)                                              
+         CH(1,1,K) = CC(1,K,1)+CR2                                              
+         CH(1,3,K) = TAUI*(CC(1,K,3)-CC(1,K,2))                                 
+         CH(IDO,2,K) = CC(1,K,1)+TAUR*CR2                                       
+  101 CONTINUE                                                                  
+      IF (IDO .EQ. 1) RETURN                                                    
+      IDP2 = IDO+2                                                              
+      DO 103 K=1,L1                                                             
+         DO 102 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            DR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            DI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            DR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            DI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            CR2 = DR2+DR3                                                       
+            CI2 = DI2+DI3                                                       
+            CH(I-1,1,K) = CC(I-1,K,1)+CR2                                       
+            CH(I,1,K) = CC(I,K,1)+CI2                                           
+            TR2 = CC(I-1,K,1)+TAUR*CR2                                          
+            TI2 = CC(I,K,1)+TAUR*CI2                                            
+            TR3 = TAUI*(DI2-DI3)                                                
+            TI3 = TAUI*(DR3-DR2)                                                
+            CH(I-1,3,K) = TR2+TR3                                               
+            CH(IC-1,2,K) = TR2-TR3                                              
+            CH(I,3,K) = TI2+TI3                                                 
+            CH(IC,2,K) = TI3-TI2                                                
+  102    CONTINUE                                                               
+  103 CONTINUE                                                                  
+      RETURN                                                                    
+      END                                                                       
+      SUBROUTINE RADF4 (IDO,L1,CC,CH,WA1,WA2,WA3)                               
+      INTEGER IDO, L1, K, IDP2, I, IC
+      REAL       CC(IDO,L1,4)           ,CH(IDO,4,L1)           ,          
+     1                WA1(*)     ,WA2(*)     ,WA3(*)  
+      REAL HSQT2
+      REAL CR2, CR3, CR4, CI2, CI3, CI4
+      REAL TR1, TR2, TR3, TR4, TI1, TI2, TI3, TI4
+      DATA HSQT2 /.7071067811865475/                                            
+      DO 101 K=1,L1                                                             
+         TR1 = CC(1,K,2)+CC(1,K,4)                                              
+         TR2 = CC(1,K,1)+CC(1,K,3)                                              
+         CH(1,1,K) = TR1+TR2                                                    
+         CH(IDO,4,K) = TR2-TR1                                                  
+         CH(IDO,2,K) = CC(1,K,1)-CC(1,K,3)                                      
+         CH(1,3,K) = CC(1,K,4)-CC(1,K,2)                                        
+  101 CONTINUE                                                                  
+      IF (IDO-2) 107,105,102                                                    
+  102 IDP2 = IDO+2                                                              
+      DO 104 K=1,L1                                                             
+         DO 103 I=3,IDO,2                                                       
+            IC = IDP2-I                                                         
+            CR2 = WA1(I-2)*CC(I-1,K,2)+WA1(I-1)*CC(I,K,2)                       
+            CI2 = WA1(I-2)*CC(I,K,2)-WA1(I-1)*CC(I-1,K,2)                       
+            CR3 = WA2(I-2)*CC(I-1,K,3)+WA2(I-1)*CC(I,K,3)                       
+            CI3 = WA2(I-2)*CC(I,K,3)-WA2(I-1)*CC(I-1,K,3)                       
+            CR4 = WA3(I-2)*CC(I-1,K,4)+WA3(I-1)*CC(I,K,4)                       
+            CI4 = WA3(I-2)*CC(I,K,4)-WA3(I-1)*CC(I-1,K,4)                       
+            TR1 = CR2+CR4                                                       
+            TR4 = CR4-CR2                                                       
+            TI1 = CI2+CI4                                                       
+            TI4 = CI2-CI4                                                       
+            TI2 = CC(I,K,1)+CI3                                                 
+            TI3 = CC(I,K,1)-CI3                                                 
+            TR2 = CC(I-1,K,1)+CR3                                               
+            TR3 = CC(I-1,K,1)-CR3                                               
+            CH(I-1,1,K) = TR1+TR2                                               
+            CH(IC-1,4,K) = TR2-TR1                                              
+            CH(I,1,K) = TI1+TI2                                                 
+            CH(IC,4,K) = TI1-TI2                                                
+            CH(I-1,3,K) = TI4+TR3                                               
+            CH(IC-1,2,K) = TR3-TI4                                              
+            CH(I,3,K) = TR4+TI3                                                 
+            CH(IC,2,K) = TR4-TI3                                                
+  103    CONTINUE                                                               
+  104 CONTINUE                                                                  
+      IF (MOD(IDO,2) .EQ. 1) RETURN                                             
+  105 CONTINUE                                                                  
+      DO 106 K=1,L1                                                             
+         TI1 = -HSQT2*(CC(IDO,K,2)+CC(IDO,K,4))                                 
+         TR1 = HSQT2*(CC(IDO,K,2)-CC(IDO,K,4))                                  
+         CH(IDO,1,K) = TR1+CC(IDO,K,1)                                          
+         CH(IDO,3,K) = CC(IDO,K,1)-TR1                                          
+         CH(1,2,K) = TI1-CC(IDO,K,3)                                            
+         CH(1,4,K) = TI1+CC(IDO,K,3)                                            
+  106 CONTINUE                                                                  
+  107 RETURN                                                                    
+      END                   
diff --git a/fer/efi/fill_xy.F b/fer/efi/fill_xy.F
new file mode 100644
index 0000000..26b9180
--- /dev/null
+++ b/fer/efi/fill_xy.F
@@ -0,0 +1,283 @@
+* fill_xy.F
+*
+* Martin Schmidt
+* Sept. 2001
+*
+* This function fill missing values by averaging over the neigbourhood
+*
+* *acm*  v6.8 6/19/2012 fix bug in loop 102, setting bad flags
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE fill_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'fills missing values with average nearest neighbour values' )
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DATA')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'this arg is filled')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     &     'mask (1 -> fill, missing -> do not fill)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'N')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'the maximum number of fill-passes')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE fill_xy_compute(id, arg_1, arg_2, arg_3, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL work_old(mem1lox:mem1hix, mem1loy:mem1hiy)
+      REAL work_new(mem1lox:mem1hix, mem1loy:mem1hiy)
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      integer iavr, is, js, icl, icr, jcl, jcu
+      integer npass, npassmax
+      real    tavr
+      logical ready, not_land
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            ready = .false.
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  work_new(i1,j1) = arg_1(i1,j1,k1,l1,m1,n1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+               enddo
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            enddo
+            npass = 0
+            i3 = arg_lo_ss(X_AXIS,ARG3)
+            j3 = arg_lo_ss(Y_AXIS,ARG3)
+            npassmax = arg_3(i3,j3,k3,l3,m3,n3)
+            do while (.not.ready)
+               ready = .true.
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                     work_old(i1,j1) =work_new(i1,j1)
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  enddo
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               enddo
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               j2 = arg_lo_ss(Y_AXIS,ARG2)
+               DO 201 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  i2 = arg_lo_ss(X_AXIS,ARG2)
+                  DO 101 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                     if ( arg_2(i2,j2,k2,l2,m2,n2) .ne. bad_flag(2)
+     &                    .and. work_old(i1,j1) .eq. bad_flag(1) ) then
+                        tavr= 0.
+                        iavr= 0
+                        icl = max0(mem1lox,i1-1)
+                        icr = min0(mem1hix,i1+1)
+                        jcl = max0(mem1loy,j1-1)
+                        jcu = min0(mem1hiy,j1+1)
+                        do is=icl, icr
+                           do js=jcl, jcu
+                              if(work_old(is,js).ne.bad_flag(1)) then
+                                 tavr=tavr+work_old(is,js)
+                                 iavr=iavr+1
+                              endif
+                           enddo
+                        enddo
+! If valid surrounding points have been found, replace the missing value
+! with the average over the neigbouring points
+! Since something has changed, a new pass is required -> ready = .false.
+                        if (iavr.ne.0) then
+                           if (iavr.eq.1) then
+! If the only found point is at the corner, an ill posed
+! cellular automaton has to be avoided
+                              if (work_old(icl,jcu).eq.bad_flag(1).and.
+     &                            work_old(icr,jcu).eq.bad_flag(1).and.
+     &                            work_old(icr,jcl).eq.bad_flag(1).and.
+     &                            work_old(icl,jcl).eq.bad_flag(1)) then
+                                 work_new(i1,j1)=tavr/iavr
+                                 ready = .false.
+                              endif
+                           else
+                              work_new(i1,j1)=tavr/iavr
+                              ready = .false.
+                           endif
+                        endif
+                     endif
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+                     i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 101              CONTINUE
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+                  j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 201           CONTINUE
+               npass = npass + 1
+               if (npass.eq.npassmax) ready = .true.
+            enddo
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 202 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 102 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+                  IF (work_new(i1,j1) .NE. bad_flag(1)) THEN
+                     result(i,j,k,l,m,n) = work_new(i1,j1)
+                  ELSE
+                     result(i,j,k,l,m,n) = bad_flag_result
+                  ENDIF
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 102           CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 202        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 400  CONTINUE
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+ 500  CONTINUE
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+ 600  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/findhi.F b/fer/efi/findhi.F
new file mode 100644
index 0000000..5d16f5f
--- /dev/null
+++ b/fer/efi/findhi.F
@@ -0,0 +1,384 @@
+*
+* findhi.F
+*
+* Ansley Manke
+* July 02, 2001
+*
+* This function locates local extrema, returning "highs".
+*
+* 1/21/01 change order of axes: result is on X axis, J index
+*         gives component of result (x,y,z)
+*         And change arguments 2 and 3 to RANGE rather than # Grid cells
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE findhi_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('Find local maxima of var, return',
+     .        ' HIGHS on X axis. j=1 xpos,j=2 ypos,j=3 HI value')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'var in X,Y; optionally Z,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Find local maxima in neighborhood +- XRANGE, data units')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Find local maxmia in neighborhood +- YRANGE, data units')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE findhi_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi, nx, ny, arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the argument.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      my_hi = nx * ny   ! an absolute upper bound
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE findhi_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER mx1, my1, mxy, mydim
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+      mydim = 3
+      mxy = mx1 * my1
+
+*  xyfield
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+*  zmaxlist
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mydim, mxy, 1, 1, 1, 1)
+
+*  xax
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            2*mx1, 1, 1, 1, 1, 1)
+
+*  yax
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            2*my1, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE findhi_compute(id, arg_1, arg_2, arg_3, result, 
+     .                          xyfield, zmaxlist, xax, yax)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL xyfield(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .             wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .             wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL zmaxlist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL*8 xax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .           wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .           wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL*8 yax(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy,
+     .           wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .           wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n,
+     .        i1, j1, k1, l1, m1, n1,
+     .        arg, nx, ny, nzmax, ip, jp,
+     .        neigh_x, neigh_y
+      REAL    dx, dy, xrange, yrange
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Get the axis coordinates
+      arg = 1
+      CALL ef_get_coordinates(id, arg, X_AXIS, arg_lo_ss(X_AXIS,arg),
+     .                        arg_hi_ss(X_AXIS,arg), xax)
+      CALL ef_get_coordinates(id, arg, Y_AXIS, arg_lo_ss(Y_AXIS,arg),
+     .                        arg_hi_ss(Y_AXIS,arg), yax)
+
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      dx = xax(2,1,1,1,1,1) - xax(1,1,1,1,1,1)
+      dy = yax(2,1,1,1,1,1) - yax(1,1,1,1,1,1)
+
+*  Get the parameters neigh_x, neigh_y, to determine the region in which relative 
+*  mins are found: 
+C A RELATIVE MINIMUM (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) 
+C POINT WITHIN A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED 
+C HERE IS + OR - neigh_x IN THE X DIRECTION AND + OR - neigh_y IN THE Y 
+C DIRECTION
+
+      CALL ef_get_one_val (id, ARG2, xrange)
+      neigh_x = MAX(1, INT (xrange/dx))
+      CALL ef_get_one_val (id, ARG3, yrange)
+      neigh_y = MAX(1, INT (yrange/dy))
+
+*  For each level and each time, call maxminmax to get the maxima.
+*  Determine the coordinates of the max''s and put with the max value
+*  into the result
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 200 j = 1, ny
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = 1, nx
+                  xyfield(i,j,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+  100          CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+  200       CONTINUE
+
+            CALL MAXMINMAX (xyfield, nx, nx, ny, neigh_x, neigh_y, 
+     .                      bad_flag(ARG1), zmaxlist, nzmax)
+
+C  result(i,1,k,l,m,n) = X index of max
+C  result(i,2,k,l,m,n) = Y index of max
+C  result(i,3,k,l,m,n) = z value at max
+
+            DO 210 i = 1, nzmax
+               ip = INT(zmaxlist(1,i,1,1,1,1))
+               jp = INT(zmaxlist(2,i,1,1,1,1))
+               result(i,1,k,l,m,n) = xax(ip,1,1,1,1,1)
+               result(i,2,k,l,m,n) = yax(jp,1,1,1,1,1)
+               result(i,3,k,l,m,n) = zmaxlist(3,i,1,1,1,1)
+ 210        CONTINUE
+
+C  Fill end of result with missing-data flags
+
+            DO 230 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               DO 220 i = nzmax+1, res_hi_ss(X_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 220           CONTINUE
+ 230        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/findlo.F b/fer/efi/findlo.F
new file mode 100644
index 0000000..0cce66b
--- /dev/null
+++ b/fer/efi/findlo.F
@@ -0,0 +1,384 @@
+*
+* findlo.F
+*
+* Ansley Manke
+* July 02, 2001
+*
+* This function locates local extrema, returning "lows".
+*
+* 1/21/01 change order of axes: pts listed on X axis, J index
+*         gives component of result (x,y,z)
+*         And change arguments 2 and 3 to RANGE rather than # Grid cells
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE findlo_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('Find local minima of var, return',
+     .       ' LOWS on X axis. j=1 xpos,j=2 ypos,j=3 LO value')
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'var in X,Y; optionally Z,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Find local minima in neighborhood +- XRANGE, data units')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YRANGE')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .     'Find local minima in neighborhood +- YRANGE, data units')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE findlo_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_hi, nx, ny, arg
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*
+*     Use utility functions to get context information about the argument.
+*
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, 3)
+
+      arg = 1
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      my_hi = nx * ny   ! an absolute upper bound
+      CALL ef_set_axis_limits(id, X_AXIS, 1, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE findlo_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER mx1, my1, mxy, mydim
+
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mx1 = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      my1 = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+      mydim = 3
+      mxy = mx1 * my1
+
+*  xyfield
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                              mx1, my1, 1, 1, 1, 1)
+
+*  zminlist
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mydim, mxy, 1, 1, 1, 1)
+
+*  xax
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            2*mx1, 1, 1, 1, 1, 1)
+
+*  yax
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            2*my1, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE findlo_compute(id, arg_1, arg_2, arg_3, result, 
+     .                          xyfield, zminlist, xax, yax)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL xyfield(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .             wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .             wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL zminlist(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL*8 xax(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .           wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .           wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL*8 yax(wrk4lox:wrk4hix/2, wrk4loy:wrk4hiy,
+     .           wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .           wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n,
+     .        i1, j1, k1, l1, m1, n1,
+     .        arg, nx, ny, nzmin, ip, jp, 
+     .        neigh_x, neigh_y
+      REAL    dx, dy, xrange, yrange
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Get the axis coordinates
+      arg = 1
+      CALL ef_get_coordinates(id, arg, X_AXIS, arg_lo_ss(X_AXIS,arg),
+     .                        arg_hi_ss(X_AXIS,arg), xax)
+      CALL ef_get_coordinates(id, arg, Y_AXIS, arg_lo_ss(Y_AXIS,arg),
+     .                        arg_hi_ss(Y_AXIS,arg), yax)
+
+      nx = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+      ny = arg_hi_ss(Y_AXIS,arg) - arg_lo_ss(Y_AXIS,arg) + 1
+
+      dx = xax(2,1,1,1,1,1) - xax(1,1,1,1,1,1)
+      dy = yax(2,1,1,1,1,1) - yax(1,1,1,1,1,1)
+
+*  Get the parameters neigh_x, neigh_y, to determine the region in which relative 
+*  mins are found: 
+C A RELATIVE MINIMUM (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) 
+C POINT WITHIN A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED 
+C HERE IS + OR - neigh_x IN THE X DIRECTION AND + OR - neigh_y IN THE Y 
+C DIRECTION
+
+      CALL ef_get_one_val (id, ARG2, xrange)
+      neigh_x = MAX(1, INT (xrange/dx))
+      CALL ef_get_one_val (id, ARG3, yrange)
+      neigh_y = MAX(1, INT (yrange/dy))
+
+*  For each level and each time, call minminmax to get the minima.
+*  Determine the coordinates of the min''s and put with the min value
+*  into the result
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 200 j = 1, ny
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = 1, nx
+                  xyfield(i,j,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+  100          CONTINUE
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+  200       CONTINUE
+
+            CALL MINMINMAX (xyfield, nx, nx, ny, neigh_x, neigh_y, 
+     .                      bad_flag(ARG1), zminlist, nzmin)
+
+C  result(i,1,k,l,m,n) = X index of max
+C  result(i,2,k,l,m,n) = Y index of max
+C  result(i,3,k,l,m,n) = z value at max
+
+            DO 210 i = 1, nzmin
+               ip = INT(zminlist(1,i,1,1,1,1))
+               jp = INT(zminlist(2,i,1,1,1,1))
+               result(i,1,k,l,m,n) = xax(ip,1,1,1,1,1)
+               result(i,2,k,l,m,n) = yax(jp,1,1,1,1,1)
+               result(i,3,k,l,m,n) = zminlist(3,i,1,1,1,1)
+ 210        CONTINUE
+
+C  Fill end of result with missing-data flags
+
+            DO 230 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               DO 220 i = nzmin+1, res_hi_ss(X_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 220           CONTINUE
+ 230        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/flag2ddups.F b/fer/efi/flag2ddups.F
new file mode 100644
index 0000000..e7e0bca
--- /dev/null
+++ b/fer/efi/flag2ddups.F
@@ -0,0 +1,92 @@
+	SUBROUTINE FLAG2DDUPS( n, x, y, epsx, epsy, dup, seq )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Locate the duplicate coordinate pairs in a list of coordinates
+* Will be regarded as duplicate if X lies within espx distance and ditto y
+* The array "dup" will contain the number of duplicate "mates" for any
+*   given coordinate (i.e. 0 if no matches)
+* The array "seq" will contain the sequence number 0,1,2,... of the mates 
+
+* V530 *sh* 2/01
+
+        IMPLICIT NONE
+
+* Argument declarations
+	INTEGER	n
+	REAL	epsx, epsy, x(n), y(n), dup(n), seq(n)
+
+* Internal variable declarations
+        INTEGER ii, jj, ndup
+        REAL xtarget, ytarget
+
+* initialize
+        DO ii = 1, n
+          dup(ii) = 0
+          seq(ii) = 0
+        END DO
+
+* find and label duplicates
+        DO ii = 1, n
+           
+* locate a unique coordinate
+           IF (dup(ii) .EQ. 0 ) THEN
+             xtarget = x(ii)
+             ytarget = y(ii)
+
+* mark sequence numbers for duplicates of this target
+             ndup = 0
+             DO jj = ii+1, n
+               IF (dup(jj) .EQ. 0 ) THEN
+                  IF ( (ABS(xtarget-x(jj)) .LE. epsx)
+     .           .AND. (ABS(ytarget-y(jj)) .LE. epsy) ) THEN
+                    ndup = ndup + 1
+                    seq(jj) = ndup
+                  ENDIF
+               ENDIF
+             END DO
+
+* mark number of duplicates found on each member of duplicate group
+             dup(ii) = ndup
+             IF (ndup .GT. 0) THEN
+               DO jj = ii+1, n
+                 IF ( (dup(jj).EQ.0)
+     .          .AND. (seq(jj).GT.0) ) dup(jj) = ndup 
+               END DO
+             ENDIF
+
+           ENDIF
+        END DO
+
+	RETURN
+	END
diff --git a/fer/efi/floatstr.F b/fer/efi/floatstr.F
new file mode 100644
index 0000000..e6e2704
--- /dev/null
+++ b/fer/efi/floatstr.F
@@ -0,0 +1,199 @@
+*
+* floatstr.F
+*
+* Ansley Manke 11/10
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* Returns float converted to strings according to format given. 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, floatstr )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+      SUBROUTINE floatstr_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .'Returns float converted to strings according to format specified')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,  
+     .     'Floating-point variable to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*     Set data type as string
+      arg = 2
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name(id, arg, 'FMT')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,  
+     .     'Fortran format, in parentheses, e.g. "(F5.1)"')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE floatstr_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf,
+     .            memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      REAL    fval
+      INTEGER TM_LENSTR1, slen
+      CHARACTER*32 fstring, fformat
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*     Get the Fortran Format (string)
+      i = arg_lo_ss (X_AXIS, ARG2)
+      j = arg_lo_ss (Y_AXIS, ARG2)
+      k = arg_lo_ss (Z_AXIS, ARG2)
+      l = arg_lo_ss (T_AXIS, ARG2)
+      m = arg_lo_ss (E_AXIS, ARG2)
+      n = arg_lo_ss (F_AXIS, ARG2)
+      CALL ef_get_string_arg_element_6d(id, ARG2, arg_2,
+     .                   i, j, k, l, m, n, slen, fformat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         fval = arg_1(i1,j1,k1,l1,m1,n1)
+         IF ( fval .NE. bad_flag(ARG1) ) THEN
+
+C     Write the string using the format, and put it in the result.
+            WRITE (fstring, fformat) fval
+            slen = TM_LENSTR1(fstring)
+            CALL EF_PUT_STRING(fstring, slen, result(1,i,j,k,l,m,n))
+
+         ELSE
+
+            fstring = ''
+            slen = 0
+            CALL EF_PUT_STRING (fstring, slen, result(1,i,j,k,l,m,n))
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/freverse.F b/fer/efi/freverse.F
new file mode 100644
index 0000000..178fe18
--- /dev/null
+++ b/fer/efi/freverse.F
@@ -0,0 +1,206 @@
+*
+* freverse.F
+*
+* Ansley Manke
+* May 2012
+*
+* This function returns the F values of the input variables,
+* reversed and on an abstract F axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE freverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in F direction on an abstract F axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the F axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE freverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nn
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nn = arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, F_AXIS, 1, nn)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE freverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_hi_ss(F_AXIS,ARG1), arg_lo_ss(F_AXIS,ARG1), -1
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/gausswt.F b/fer/efi/gausswt.F
new file mode 100644
index 0000000..f2a48f3
--- /dev/null
+++ b/fer/efi/gausswt.F
@@ -0,0 +1,139 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+C  Gausswt software From Billy Kessler, PMEL, Seattle WA  25-Aug-1998
+
+C  !ACM Modified to pass nxaxis, NAY dimensions of grid and wate.
+C   and to deal with nx, ny, or nm = 1.  Also to send cutoff as a parameter.
+
+C  May 26, 2000  Don't send cutoff, but xsc, ysc as parameters.
+C  June 7, 2000  Send xsc, ysc, xcutoff, ycutoff as parameters
+
+c.............subroutines to do gaussian-weighted mapping onto grids.
+
+c.......3sep97: rewritten to give each nested loop a separate loop number.
+c		otherwise "if (delx.gt.xcut) go to 100" does not work right!
+c************************************************************************
+c............sub gausswt forms the weight sums inside loop over all data.
+c............--->>> 3-d mapping (x,y,t)
+c............--->>> allows wraparound year (flagged by arg iwflag)
+c............method is to call this sub for each data value
+c............  sub loops on grid locations, maps each irregular data point to
+c............  all possible gridpts, weighting by 3-d distance from gridpt.
+c............  all calcs done in gridbox units
+c............xx/x1/xf/xsc all in same units
+c............yy/y1/yf/ysc all in same units
+c............tt/t1/tf/tsc all in same units (but nm can be anything)
+c............   note that, ie, t1 is the center of gridbox 1. So if dates
+c............   are in months, Jan 15=1, Dec 15=12, and Jan 1=0.5, Dec 31=12.5.
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	val=data value at this (xx,yy,tt)
+c  o	grid(nx,ny,nm)=sum of weighted values
+c  o	wate(nx,ny,nm)=sum of weights
+c  i	nx,ny,nm=size of grids
+c  i	x1,y1,t1=west/south/date edge of grid (center of 1st box in data units)
+c  i	xf,yf,tf=east/north/date edge of grid (center of final box)
+c  i	xsc,ysc,tsc=mapping scales (data units)
+c  i	iwflag=1 for time wrapping; 0 for no wrapping
+c--------------------------------------------------------------------------
+
+	subroutine gausswt2 (xx,yy,tt,val,grid,wate,nx,ny,nm,
+     .             x1,y1,t1,xf,yf,tf,xsc,ysc,tsc,cutoff,iwflag,nax,nay)
+
+C ACM 6/2000 Version of gausswt with two cutoff parameters.
+c acm 8/2005 there is just one cutoff parameter
+c V62 *ACM* 2/2009 Change the use of cutoff to exclude points from
+c            calculation based on weights so that the exclusing 
+c            is an ellipse not a box.
+ 
+	integer nx, ny, nm, iwflag, nax, nay, i, j, m
+	real grid(nax,nay,*), wate(nax,nay,*)
+	real xx, yy, tt, val, x1, y1, t1, xf, yf, tf, xsc, ysc, tsc
+	real cutoff
+        real dx, dy, dt, xxg, yyg, ttg, xcut, ycut, tcut
+	real xgp, delx, ygp, dely, tgp, delt, xgas, ygas, tgas, expn
+	real weight_min
+
+	dx=1.
+	dy=1. 
+	dt=1.
+	if (nx .gt. 1) dx=(xf-x1)/real(nx-1)  ! gridbox sizes in data units
+	if (ny .gt. 1) dy=(yf-y1)/real(ny-1) 
+	if (nm .gt. 1) dt=(tf-t1)/real(nm-1)
+
+	xxg=(xx-x1)/dx+1.		  ! grid values of data location
+	yyg=(yy-y1)/dy+1.
+	ttg=(tt-t1)/dt+1.
+
+c	cutoff=2.			  ! cutoff limits search (min wt=e**-4)
+	xcut=cutoff*xsc/dx		  ! cutoffs scaled to grid units
+	ycut=cutoff*ysc/dy		  ! look only cutoff* the scale width
+	tcut=cutoff*tsc/dt		  !   from the gridbox center
+
+	weight_min = exp(-cutoff-cutoff)
+	IF (nm .GT. 1) weight_min = exp(-cutoff-cutoff-cutoff)
+
+	do 100 i=1,nx			! loop on x gridpoints
+	xgp=real(i)			! center of gridbox
+	delx=abs(xgp-xxg)		! distance of data pt from grid ctr
+	if (delx.gt.xcut) go to 100	! only do nearby points
+	xgas=(delx*dx/xsc)**2		! make gaussian exponent
+
+	do 101 j=1,ny			! loop on y gridpoints, same procedure
+	ygp=real(j)		
+	dely=abs(ygp-yyg)
+	if (dely.gt.ycut) go to 101
+
+	ygas=(dely*dy/ysc)**2		! make gaussian exponent
+
+	do 102 m=1,nm			! loop on t gridpoints, same procedure
+	tgp=real(m)
+	delt=abs(tgp-ttg)
+	if (delt.gt.tcut .and. iwflag.eq.1) 
+     .    delt=abs(delt-real(nm))	! allow flagged time wrapping
+	if (delt.gt.tcut) go to 102
+
+	tgas=(delt*dt/tsc)**2		! make gaussian exponent
+	expn=exp(-xgas-ygas-tgas)	! the gaussian weight
+	IF (expn .GE. weight_min) THEN
+           wate(i,j,m)=wate(i,j,m)+expn		! sum the weights
+	   grid(i,j,m)=grid(i,j,m)+val*expn	! sum the weighted values
+	ENDIF
+
+102	continue
+101	continue
+100	continue
+
+	return
+	end
diff --git a/fer/efi/gausswt_v0.F b/fer/efi/gausswt_v0.F
new file mode 100644
index 0000000..2b4674b
--- /dev/null
+++ b/fer/efi/gausswt_v0.F
@@ -0,0 +1,132 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C  Gausswt software From Billy Kessler, PMEL, Seattle WA  25-Aug-1998
+
+C  !ACM Modified to pass nxaxis, NAY dimensions of grid and wate.
+C   and to deal with nx, nz, or nm = 1.  Also to send cutoff as a parameter.
+
+C  May 26, 2000  Don't send cutoff, but xsc, ysc as parameters.
+C  June 7, 2000  Send xsc, ysc, xcutoff, ycutoff as parameters
+C  June 7, 2000  Send xsc, ysc, xcutoff, ycutoff as parameters
+
+c.............subroutines to do gaussian-weighted mapping onto grids.
+
+c.......3sep97: rewritten to give each nested loop a separate loop number.
+c		otherwise "if (delx.gt.xcut) go to 100" does not work right!
+c************************************************************************
+c............sub gausswt forms the weight sums inside loop over all data.
+c............--->>> 3-d mapping (x,y,t)
+c............--->>> allows wraparound year (flagged by arg iwflag)
+c............method is to call this sub for each data value
+c............  sub loops on grid locations, maps each irregular data point to
+c............  all possible gridpts, weighting by 3-d distance from gridpt.
+c............  all calcs done in gridbox units
+c............xx/x1/xf/xsc all in same units
+c............yy/y1/yf/ysc all in same units
+c............tt/t1/tf/tsc all in same units (but nm can be anzthing)
+c............   note that, ie, t1 is the center of gridbox 1. So if dates
+c............   are in months, Jan 15=1, Dec 15=12, and Jan 1=0.5, Dec 31=12.5.
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	val=data value at this (xx,yy,tt)
+c  o	grid(nx,nz,nm)=sum of weighted values
+c  o	wate(nx,nz,nm)=sum of weights
+c  i	nx,nz,nm=size of grids
+c  i	x1,y1,t1=west/south/date edge of grid (center of 1st box in data units)
+c  i	xf,yf,tf=east/north/date edge of grid (center of final box)
+c  i	xsc,ysc,tsc=mapping scales (data units)
+c  i	iwflag=1 for time wrapping; 0 for no wrapping
+c--------------------------------------------------------------------------
+
+	subroutine gausswt2_v0 (xx,yy,tt,val,grid,wate,nx,nz,nm,x1,y1,t1,
+     .             xf,yf,tf,xsc,ysc,tsc,cutoff,iwflag,nax,nay)
+
+C ACM 6/2000 Version of gausswt with two cutoff parameters.
+c acm 8/2005 there is just one cutoff parameter
+c V62 *ACM* 2/2009 Keep this original version with the treatment of the
+c            cutoff parameter, for backwards compatibility.
+ 
+	integer nx, nz, nm, iwflag, nax, nay, i, j, m
+	real grid(nax,nay,*), wate(nax,nay,*)
+	real xx, yy, tt, val, x1, y1, t1, xf, yf, tf, xsc, ysc, tsc
+	real cutoff
+        real dx, dy, dt, xxg, yyg, ttg, xcut, ycut, tcut
+	real xgp, delx, ygp, dely, tgp, delt, xgas, ygas, tgas, expn
+
+	dx=1.
+	dy=1. 
+	dt=1.
+	if (nx .gt. 1) dx=(xf-x1)/real(nx-1)  ! gridbox sizes in data units
+	if (nz .gt. 1) dy=(yf-y1)/real(nz-1) 
+	if (nm .gt. 1) dt=(tf-t1)/real(nm-1)
+
+	xxg=(xx-x1)/dx+1.		  ! grid values of data location
+	yyg=(yy-y1)/dy+1.
+	ttg=(tt-t1)/dt+1.
+
+c	cutoff=2.			  ! cutoff limits search (min wt=e**-4)
+	xcut=cutoff*xsc/dx		  ! cutoffs scaled to grid units
+	ycut=cutoff*ysc/dy		  ! look only cutoff* the scale width
+	tcut=cutoff*tsc/dt		  !   from the gridbox center
+
+	do 100 i=1,nx			  ! loop on x gridpoints
+	xgp=real(i)			  ! center of gridbox
+	delx=abs(xgp-xxg)		  ! distance of data pt from grid ctr
+	if (delx.gt.xcut) go to 100  	  ! only do nearby points
+
+	do 101 j=1,nz			  ! loop on y gridpoints, same procedure
+	ygp=real(j)		
+	dely=abs(ygp-yyg)
+	if (dely.gt.ycut) go to 101
+
+	do 102 m=1,nm			  ! loop on t gridpoints, same procedure
+	tgp=real(m)
+	delt=abs(tgp-ttg)
+	if (delt.gt.tcut .and. iwflag.eq.1) 
+     .		delt=abs(delt-real(nm)) 	! allow flagged time wrapping
+	if (delt.gt.tcut) go to 102
+
+	xgas=(delx*dx/xsc)**2		  	! make gaussian exponents
+	ygas=(dely*dy/ysc)**2
+	tgas=(delt*dt/tsc)**2
+	expn=exp(-xgas-ygas-tgas)		! make the gaussian weight
+	wate(i,j,m)=wate(i,j,m)+expn		! sum the weights
+	grid(i,j,m)=grid(i,j,m)+val*expn	! sum the weighted values
+
+102	continue
+101	continue
+100	continue
+
+	return
+	end
diff --git a/fer/efi/heap2_str.F b/fer/efi/heap2_str.F
new file mode 100644
index 0000000..9d2d77c
--- /dev/null
+++ b/fer/efi/heap2_str.F
@@ -0,0 +1,58 @@
+      SUBROUTINE HEAP2_STR (RA, IB, N)
+
+C  Ansley Manke
+C  From Numerical Recipes, Heapsort subroutine SORT2
+
+      INTEGER N
+      CHARACTER*512 RA(*), RRA, RRB
+
+      INTEGER L, IR, J, I, NGD
+      REAL IB(*), IIB
+
+* From SHELLR
+
+      L = N/2 + 1
+      IR = N
+
+   10 CONTINUE
+         IF (L .GT. 1) THEN
+            L = L - 1
+            RRA = RA(L)
+            IIB = IB(L)
+         ELSE
+            RRA = RA(IR)
+            IIB = IB(IR) 
+            RA(IR) = RA(1)
+            IB(IR) = IB(1)
+            IR = IR - 1
+            IF (IR .LE. 1) THEN	! *acm* Num Recipes has .EQ. here,
+				!       but this fails in the case where	
+				!       the loop starts with L=1
+               RA(1) = RRA
+               IB(1) = IIB
+               RETURN
+            ENDIF
+          ENDIF
+
+          I = L
+          J = L + L
+   20     IF (J .LE. IR) THEN
+             IF (J .LT. IR) THEN
+                IF (RA(J) .LT. RA(J+1)) J = J + 1
+             ENDIF
+             IF (RRA .LT. RA(J)) THEN
+                RA(I) = RA(J)
+                IB(I) = IB(J)
+                I = J
+                J = J + J
+             ELSE
+                J = IR + 1
+             ENDIF
+             GO TO 20
+          ENDIF
+
+          RA(I) = RRA
+          IB(I) = IIB
+      GO TO 10
+
+      END
diff --git a/fer/efi/is_element_of.F b/fer/efi/is_element_of.F
new file mode 100644
index 0000000..928ae08
--- /dev/null
+++ b/fer/efi/is_element_of.F
@@ -0,0 +1,261 @@
+*
+* is_element_of.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* March 2003
+*
+*  Return logical value (integer 1 or 0); If argument 1 takes on any of 
+*  the values of the second argument, return 1, else 0.
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE is_element_of_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns 1 if first argument contains any of the ',
+     .        'values in argument 2, else 0')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'data to test')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'values to search for')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE is_element_of_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+*
+
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE is_element_of_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for values matching arg2
+
+C  Returns a single value, so no incrementing result indices
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 100 n1=arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS, ARG1)
+      DO 100 m1=arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS, ARG1)
+      DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS, ARG1)
+      DO 100 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS, ARG1)
+      DO 100 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS, ARG1)
+      DO 100 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) THEN
+
+            DO 200 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS, ARG2)
+            DO 200 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS, ARG2)
+            DO 200 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+            DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+            DO 200 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+            DO 200 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+
+               IF ( arg_2(i2,j2,k2,l2,m2,n1) .NE. bad_flag(2) ) THEN
+
+                  IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ.
+     .                 arg_2(i2,j2,k2,l2,m2,n2) ) THEN
+C A match was found; done
+                     result(i,j,k,l,m,n) = 1.
+                     RETURN
+                  ENDIF
+
+               ENDIF
+
+ 200        CONTINUE
+
+         ENDIF
+
+ 100  CONTINUE
+
+C No match found
+      result(i,j,k,l,m,n) = 0.
+      RETURN
+
+      END
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/fer/efi/is_element_of_str.F b/fer/efi/is_element_of_str.F
new file mode 100644
index 0000000..81e01db
--- /dev/null
+++ b/fer/efi/is_element_of_str.F
@@ -0,0 +1,282 @@
+*
+* is_element_of_str.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* August 2005
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*  For string arguments, 
+*  Return logical value (integer 1 or 0); If argument 1 takes on any of 
+*  the values of the second argument, return 1, else 0.
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE is_element_of_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns 1 if first argument contains any of the ',
+     .        'values in 2nd argument (case sensitive), else 0')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'string')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'strings to search')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE is_element_of_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE is_element_of_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER arg
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER slen1, slen2
+      CHARACTER text1*128, text2*128
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+
+C  Returns a single value, so no incrementing result indices
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      DO 100 n1=arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS, ARG1)
+      DO 100 m1=arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS, ARG1)
+      DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS, ARG1)
+      DO 100 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS, ARG1)
+      DO 100 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS, ARG1)
+      DO 100 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+
+         arg = 1
+         CALL ef_get_string_arg_element_6d(id, arg, arg_1, 
+     .                      i1, j1, k1, l1, m1, n1, slen1, text1)
+
+         IF ( slen1 .GT. 0 ) THEN
+
+            DO 200 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS, ARG2)
+            DO 200 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS, ARG2)
+            DO 200 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+            DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+            DO 200 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+            DO 200 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+
+               arg = 2
+               CALL ef_get_string_arg_element_6d(id, arg, arg_2, 
+     .                            i2, j2, k2, l2, m2, n2, slen2, text2)
+
+               IF ( slen1 .EQ. slen2 ) THEN
+
+                  IF ( text1(:slen1) .EQ. text2(:slen2) ) THEN
+C Found a match
+                     result(i,j,k,l,m,n) = 1.
+                     RETURN
+                  ENDIF
+
+               ENDIF
+
+ 200        CONTINUE
+
+         ENDIF
+
+ 100  CONTINUE
+
+C No match found
+      result(i,j,k,l,m,n) = 0.
+      RETURN
+
+      END
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/fer/efi/is_element_of_str_n.F b/fer/efi/is_element_of_str_n.F
new file mode 100644
index 0000000..2187fa3
--- /dev/null
+++ b/fer/efi/is_element_of_str_n.F
@@ -0,0 +1,294 @@
+*
+* is_element_of_str_n.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* August 2005
+*
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*  For string arguments, 
+*  Return logical value (integer 1 or 0); If argument 1 takes on any of 
+*  the values of the second argument, return 1, else 0.
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE is_element_of_str_n_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns 1 if 1st arg contains any of the ',
+     .        'values in 2nd arg, 2 if case-insensitve match, else 0')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'string')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VALUES')
+      CALL ef_set_arg_desc(id, arg, 'strings to search')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE is_element_of_str_n_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE is_element_of_str_n_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER slen1, slen2
+      INTEGER STR_UPCASE, status
+      CHARACTER text1*128, text2*128
+      CHARACTER text1up*128, text2up*128
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Check for strings matching arg2
+
+C  Returns a single value, so no incrementing result indices
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+C Initialize to no match since case-insensitive match does not immediately return
+      result(i,j,k,l,m,n) = 0.
+
+      DO 100 n1=arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS, ARG1)
+      DO 100 m1=arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS, ARG1)
+      DO 100 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS, ARG1)
+      DO 100 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS, ARG1)
+      DO 100 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS, ARG1)
+      DO 100 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+
+         arg = 1
+         CALL ef_get_string_arg_element_6d(id, arg, arg_1, 
+     .                      i1, j1, k1, l1, m1, n1, slen1, text1)
+
+         IF ( slen1 .GT. 0 ) THEN
+
+            status = STR_UPCASE(text1up,text1)
+
+            DO 200 n2=arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS, ARG2)
+            DO 200 m2=arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS, ARG2)
+            DO 200 l2=arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS, ARG2)
+            DO 200 k2=arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS, ARG2)
+            DO 200 j2=arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS, ARG2)
+            DO 200 i2=arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS, ARG2)
+
+               arg = 2
+               CALL ef_get_string_arg_element_6d(id, arg, arg_2, 
+     .                            i2, j2, k2, l2, m2, n2, slen2, text2)
+
+               IF ( slen1 .EQ. slen2 ) THEN
+
+                  IF ( text1(:slen1) .EQ. text2(:slen2) ) THEN
+C Found an exact match; done
+                     result(i,j,k,l,m,n) = 1.
+                     RETURN
+                  ENDIF
+                  status = STR_UPCASE(text2up,text2)
+                  IF ( text1up(:slen1) .EQ. text2up(:slen2) ) THEN
+C Case-insensitive match found; mark it but continue searching for an exact match
+                     result(i,j,k,l,m,n) = 2.
+                  ENDIF
+
+               ENDIF
+
+ 200        CONTINUE
+
+         ENDIF
+
+ 100  CONTINUE
+
+C Either no match or case-insensitive match found; already marked appropriately
+      RETURN
+
+      END
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
diff --git a/fer/efi/labwid.F b/fer/efi/labwid.F
new file mode 100644
index 0000000..1d1facd
--- /dev/null
+++ b/fer/efi/labwid.F
@@ -0,0 +1,211 @@
+*
+* labwid.F
+*
+* Ansley Manke
+* March 1, 2005
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* Get the width of a label in plot inches.
+*
+* This function calls the PPLUS routine SYMWID.  It is not an external 
+* function, will be linked internally; but it is convenient to implement
+* it as an external function.
+
+
+      SUBROUTINE labwid_init(id)
+
+* Define arguments and result
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Return string width in PLOT inches' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'strng, including font')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, string_arg)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'HT')
+      CALL ef_set_arg_desc(id, arg, 'Size of character')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      RETURN 
+      END
+
+
+* Define abstract output axis: 1 value
+
+      SUBROUTINE labwid_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+      RETURN 
+      END
+
+
+*
+* Compute the result
+*
+      SUBROUTINE labwid_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      INTEGER arg, i, j, k, l, m, n
+      REAL    LABEL_WIDTH, height
+      CHARACTER*1024 strng
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+
+      arg = 1
+      CALL ef_get_arg_string(id, arg, strng)
+      arg = 2
+      CALL ef_get_one_val(id, arg, height)
+
+* Compute the result.
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      result(i,j,k,l,m,n) = LABEL_WIDTH(height, strng)
+
+      RETURN 
+      END
+
+
+      REAL FUNCTION LABEL_WIDTH(height,strng)
+
+      IMPLICIT NONE
+      CHARACTER*(*) strng
+      REAL height
+
+      INCLUDE 'xrisc.cmn'
+
+      INTEGER n, lnbeg(500), lnend(500), numlines,
+     .        npen, nfont, npnew, nfnew, nchr
+      REAL*4 SYMWID, ht, ss, xmn
+      CHARACTER*3 fontprefix, penprefix, newfont, newpen
+
+      CALL TM_BREAK_LINES (strng, lnbeg, lnend, numlines)
+      nfont = 0
+      npen = 0
+      fontprefix = ""
+      penprefix = ""
+
+      ss = 0.
+      ht = height
+
+      DO 40 n = 1, numlines
+         CALL getlabfonts (strng, lnbeg, lnend, n, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+         risc_buff = strng(lnbeg(n):lnend(n))
+         xmn = SYMWID(ht,nchr+npen+nfont,
+     .           penprefix(1:npen)//fontprefix(1:nfont)//
+     .           risc_buff)
+
+         ss = MAX(xmn, ss)
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+         IF (npnew.GT.0) THEN
+            penprefix(1:npnew) = newpen(1:npnew)
+            npen = npnew
+         ENDIF
+         IF (nfnew.GT.0) THEN
+            fontprefix(1:npnew) = newfont(1:npnew)
+            nfont = npnew
+         ENDIF
+  40  CONTINUE
+
+      LABEL_WIDTH = ss
+
+      RETURN
+      END
+
diff --git a/fer/efi/lanczos.F b/fer/efi/lanczos.F
new file mode 100644
index 0000000..94ab7cc
--- /dev/null
+++ b/fer/efi/lanczos.F
@@ -0,0 +1,345 @@
+!
+! lanczos.F90
+!
+! Bill Ivor Gustafson, ivor at ucdavis.edu
+! 29-oct-1999
+!
+! This function bandpass filters the input data in time 
+! using a Lanczos filter.  For details see:
+!   Duchon, C. E., 1979: Lanczos filtering in one and two dimensions.
+!        J. of App. Met., 18, 1016-1022.
+!
+! lanczos function from Brett McDaniel was in 
+! Fortran 90.  Translated to f77 by Ansley Manke, PMEL  6/25/04
+!   -change include files
+!   -allocate weight array with a lanczos_init function
+!   -change cycle and exit statements in loop 100 of 
+!    compute function to GOTO's
+!
+! In this subroutine we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE lanczos_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+! **********************************************************************
+!                                            USER CONFIGURABLE PORTION |
+!                                                                      |
+!                                                                      V
+
+      CALL ef_set_desc(id, 
+     .      'Bandpass filters data in time using a Lanczos filter' )
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .      'Data to be filtered in time (may also vary in x,y,z,e,f)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'F1')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,'Low frequency cutoff')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F2')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,'High frequency cutoff')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'N')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,'Number of weights (must be odd)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+!                                                                      ^
+!                                                                      |
+!                                            USER CONFIGURABLE PORTION |
+! **********************************************************************
+
+      RETURN 
+      END  ! SUBROUTINE lanczos_init
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE lanczos_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER array_num, arg, nn
+      REAL val
+
+      arg = 4
+      CALL ef_get_one_val(id, arg, val)  
+
+      nn = val
+      array_num = 1
+
+! dimensions for weight array: nn = arg4
+
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                0, 0, 0, 0, 0, 0, 
+     .                               nn, 0, 0, 0, 0, 0)
+
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END ! SUBROUTINE lanczos_work_size
+
+
+
+      SUBROUTINE lanczos_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .                           result, weight)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL weight(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .            wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .            wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+! **********************************************************************
+!                                            USER CONFIGURABLE PORTION |
+!                                                                      |
+!                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER mm, nn
+      REAL aa, bb, da, f1, f2, pi, pik, sigma
+
+      pi  = acos(-1.)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+! Get the counter values to cycle through, nw=2*nn+1...
+      i = arg_lo_ss(X_AXIS,ARG4)
+      j = arg_lo_ss(Y_AXIS,ARG4)
+      k = arg_lo_ss(Z_AXIS,ARG4)
+      l = arg_lo_ss(T_AXIS,ARG4)
+      m = arg_lo_ss(E_AXIS,ARG4)
+      n = arg_lo_ss(F_AXIS,ARG4)
+      if( mod(int(arg_4(i,j,k,l,m,n)),2) .EQ. 0 ) then
+         CALL EF_BAIL_OUT(id,'The number of weights must be odd.')
+      else
+         nn = ( arg_4(i,j,k,l,m,n)-1 )/2
+      endif
+
+! Calculate the weights...
+
+      i  = arg_lo_ss(X_AXIS,ARG2)
+      j  = arg_lo_ss(Y_AXIS,ARG2)
+      k  = arg_lo_ss(Z_AXIS,ARG2)
+      l  = arg_lo_ss(T_AXIS,ARG2)
+      m  = arg_lo_ss(E_AXIS,ARG2)
+      n  = arg_lo_ss(F_AXIS,ARG2)
+      f1 = arg_2(i,j,k,l,m,n)
+
+      i  = arg_lo_ss(X_AXIS,ARG3)
+      j  = arg_lo_ss(Y_AXIS,ARG3)
+      k  = arg_lo_ss(Z_AXIS,ARG3)
+      l  = arg_lo_ss(T_AXIS,ARG3)
+      m  = arg_lo_ss(E_AXIS,ARG3)
+      n  = arg_lo_ss(F_AXIS,ARG3)
+      f2 = arg_3(i,j,k,l,m,n)
+
+      weight(0,0,0,0,0,0)  = 2.*(f2-f1)
+      do k = 1,nn
+         pik   = pi*k
+         aa    = pik/nn
+         sigma = sin(aa)/aa
+         aa    = 2.*pik*f1
+         bb    = 2.*pik*f2
+         weight(k,0,0,0,0,0) = ( sin(bb)/pik - sin(aa)/pik )*sigma
+      end do
+
+! For testing, calculate the response function...
+c      da = .0005
+c      aa = 0.0
+c      do while( aa .LT. .5 )
+c         bb = 0.
+c         do i = 1,nn
+c            bb = bb + weight(i,0,0,0)*cos(2.*pi*aa*float(i))
+c         end do
+c         bb = weight(0,0,0,0) + 2.*bb
+c         write(11,*) aa,bb
+c         aa = aa+da
+c      end do
+
+      if( res_hi_ss(T_AXIS) - res_lo_ss(T_AXIS) .LT. 2*nn ) then
+         CALL EF_BAIL_OUT(id, 
+     .     'Too many weights exist for the number of times present.')
+      endif
+
+! Apply the weights to the data...
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            do l=res_lo_ss(T_AXIS),res_lo_ss(T_AXIS)+nn-1
+               result(i,j,k,l,m,n) = bad_flag_result
+            end do
+            do l=res_hi_ss(T_AXIS)-nn+1,res_hi_ss(T_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+            end do
+
+* Assumes result and arg_1 has same T axis dimension limits
+            DO 400 l=res_lo_ss(T_AXIS)+nn, res_hi_ss(T_AXIS)-nn
+
+               IF ( arg_1(i1,j1,k1,l,m1,n1) .EQ. bad_flag(1) ) then
+                  result(i,j,k,l,m,n) = bad_flag_result
+                  GOTO 400
+               ENDIF
+               result(i,j,k,l,m,n) = weight(0,0,0,0,0,0) *
+     .                               arg_1(i1,j1,k1,l,m1,n1)
+
+               do mm = 1,nn
+                  IF (arg_1(i1,j1,k1,l-mm,m1,n1) .EQ. bad_flag(1) .OR.
+     .                arg_1(i1,j1,k1,l+mm,m1,n1) .EQ. bad_flag(1)) THEN
+                     result(i,j,k,l,m,n) = bad_flag_result
+                     GOTO 400
+                  ENDIF
+                  result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + 
+     .                                  weight(mm,0,0,0,0,0) * 
+     .                                  ( arg_1(i1,j1,k1,l-mm,m1,n1) +
+     .                                    arg_1(i1,j1,k1,l+mm,m1,n1) )
+               end do
+
+ 400        CONTINUE
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200  CONTINUE
+
+      k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+      m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+      n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+!                                                                      ^
+!                                                                      |
+!                                            USER CONFIGURABLE PORTION |
+! **********************************************************************
+
+      RETURN 
+      END ! SUBROUTINE lanczos_compute
+
diff --git a/fer/efi/list_value_xml.F b/fer/efi/list_value_xml.F
new file mode 100644
index 0000000..44f3ba3
--- /dev/null
+++ b/fer/efi/list_value_xml.F
@@ -0,0 +1,324 @@
+*
+* list_value_xml.F
+*
+* Ansley Manke
+* May 24, 2011
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function writes a string value to an xml string, and with a given tag 
+* and option to enclose it in CDATA escape. e.g.
+*
+*		<label><![CDATA[Z (m):]]></label>
+*		<value><![CDATA[0]]></value>
+*
+* it then lists the string to the named file.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE list_value_xml_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*120 fcn_descr
+
+      WRITE (fcn_descr,100) 
+      CALL ef_set_desc(id, fcn_descr)
+  100 FORMAT('write a string in xml format with specified ',
+     .       'tag and optional CDATA escape sequence')
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'tag')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'tag to open and close with')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'value')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'single string value to write')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'cdata_flag')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 
+     .'enter 1 to request CDATA escape, 0 otherwise')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'outputfile')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'the filename to write to')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE list_value_xml_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg, my_lo, my_hi
+
+      arg = 1
+      my_lo = 1
+      my_hi = 1
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE list_value_xml_compute(id, arg_1, arg_2, arg_3, 
+     .           arg_4, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(strdf,
+     .           mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER TM_LENSTR1, vlen, tlen, slen, flen, iunit
+      CHARACTER*2048 outstring, first, second, third
+      CHARACTER*2048 outfile
+      CHARACTER*50 tag
+      CHARACTER*2048 value
+      CHARACTER*100 errtxt
+      INTEGER cdata_flag
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = arg_lo_ss(X_AXIS,ARG1)
+      j = arg_lo_ss(Y_AXIS,ARG1)
+      k = arg_lo_ss(Z_AXIS,ARG1)
+      l = arg_lo_ss(T_AXIS,ARG1)
+      m = arg_lo_ss(E_AXIS,ARG1)
+      n = arg_lo_ss(F_AXIS,ARG1)
+*     Get the tag (string)
+      CALL ef_get_string_arg_element_6d(id, ARG1, arg_1,
+     .                                  i,j,k,l,m,n,tlen,tag)
+
+      i = arg_lo_ss(X_AXIS,ARG2)
+      j = arg_lo_ss(Y_AXIS,ARG2)
+      k = arg_lo_ss(Z_AXIS,ARG2)
+      l = arg_lo_ss(T_AXIS,ARG2)
+      m = arg_lo_ss(E_AXIS,ARG2)
+      n = arg_lo_ss(F_AXIS,ARG2)
+*     Get the value (string)
+      CALL ef_get_string_arg_element_6d(id, ARG2, arg_2,
+     .                                  i,j,k,l,m,n,vlen,value)
+
+      i = arg_lo_ss(X_AXIS,ARG3)
+      j = arg_lo_ss(Y_AXIS,ARG3)
+      k = arg_lo_ss(Z_AXIS,ARG3)
+      l = arg_lo_ss(T_AXIS,ARG3)
+      m = arg_lo_ss(E_AXIS,ARG3)
+      n = arg_lo_ss(F_AXIS,ARG3)
+      cdata_flag = INT(arg_3(i,j,k,l,m,n))
+
+
+      i = arg_lo_ss(X_AXIS,ARG4)
+      j = arg_lo_ss(Y_AXIS,ARG4)
+      k = arg_lo_ss(Z_AXIS,ARG4)
+      l = arg_lo_ss(T_AXIS,ARG4)
+      m = arg_lo_ss(E_AXIS,ARG4)
+      n = arg_lo_ss(F_AXIS,ARG4)
+*     Get the filename (string)
+      CALL ef_get_string_arg_element_6d(id, ARG4, arg_4,
+     .                                  i,j,k,l,m,n,flen,outfile)
+
+*		<value><![CDATA[0]]></value>
+*		<value>0</value>
+
+1000  FORMAT('<',a, '><![CDATA[')
+1010  FORMAT(a, ']]></', a, '>')
+1020  FORMAT(a, '>')
+1030  FORMAT('<',a, '>')
+1040  FORMAT(a, '</')
+1050  FORMAT(a, '>')
+1060  FORMAT(a)
+
+      IF (cdata_flag .EQ. 1) THEN
+         write (first,  1000) tag(1:tlen)
+         write (second, 1010) value(1:vlen)
+         write (third , 1020) tag(1:tlen)
+	 tlen = TM_LENSTR1(first)
+	 vlen = TM_LENSTR1(second)
+	 slen = TM_LENSTR1(third)
+         outstring = first(1:tlen)//second(1:vlen)//third(1:slen)
+      ELSE
+         write (first,  1030) tag(1:tlen)
+         write (second, 1040) value(1:vlen)
+         write (third , 1050) tag(1:tlen)
+	 tlen = TM_LENSTR1(first)
+	 vlen = TM_LENSTR1(second)
+	 slen = TM_LENSTR1(third)
+         outstring = first(1:tlen)//second(1:vlen)//third(1:slen)
+      ENDIF
+      vlen = TM_LENSTR1(outstring)
+
+      iunit = 19
+      OPEN( UNIT        = iunit,
+     .      FILE        = outfile(1:flen),
+     .      FORM        = 'FORMATTED',
+     .      ACCESS      = 'APPEND',
+     .      ERR         = 5010 )
+
+      WRITE (iunit, 1060) outstring(1:vlen)
+      CLOSE (iunit, ERR = 5020 )
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+      result(i,j,k,l,m,n) = 1
+
+      RETURN
+
+ 5010 CONTINUE
+      WRITE(errtxt,*) 'Error opening file ', outfile(1:flen)
+      CALL EF_BAIL_OUT(id, errtxt)
+ 5020 CONTINUE
+      WRITE(errtxt,*) 'Error closing file ', outfile(1:flen)
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/lsl_lowpass.F b/fer/efi/lsl_lowpass.F
new file mode 100644
index 0000000..7c74511
--- /dev/null
+++ b/fer/efi/lsl_lowpass.F
@@ -0,0 +1,471 @@
+*
+* lsl_lowpass.F
+*
+* LSL-low_pass_filter from Ned Cokelet.
+*  Ansley Manke
+*  Dec 6 1999
+*
+* Returns the argument filtered with Least Squares Lanzcos filter in time.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE lsl_lowpass_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 label
+
+      WRITE (label, 10) 
+   10 FORMAT ( 'Returns Least Squares Lanzcos filter of ',
+     .         'equally-spaced time series' )
+      CALL ef_set_desc(id,label)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'data to be filtered')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'cutoff_period')
+      CALL ef_set_arg_desc(id, arg, 
+     .        'period at which filter attains 1/2 amplitude. <=N')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'filter_span')
+      CALL ef_set_arg_desc(id, arg, 
+     . 'number of input data points used in each filtered output point')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE lsl_lowpass_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mt
+      INTEGER iwork
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+*  x -- input time series
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mt, 1, 1, 1, 1, 1)
+
+*  y -- output time series
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mt, 1, 1, 1, 1, 1)
+
+*  h -- work array for subroutine LSL_low_pass_filter
+
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               mt, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE lsl_lowpass_compute(id, arg_1, arg_2, arg_3, result, 
+     .                               x, y, h)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL x(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .       wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .       wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL y(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .       wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .       wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL h(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .       wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .       wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER nn, nt
+      INTEGER filter_span
+      REAL cutoff_period
+      CHARACTER*255 err_msg
+
+
+*  Get argument and result subscripts and bad-data flags.
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Get cutoff parameter.
+
+      i = arg_lo_ss(X_AXIS,ARG2)
+      j = arg_lo_ss(Y_AXIS,ARG2)
+      k = arg_lo_ss(Z_AXIS,ARG2)
+      l = arg_lo_ss(T_AXIS,ARG2)
+      m = arg_lo_ss(E_AXIS,ARG2)
+      n = arg_lo_ss(F_AXIS,ARG2)
+      cutoff_period = arg_2(i,j,k,l,m,n)
+
+*  Get time percent parameter.
+
+      i = arg_lo_ss(X_AXIS,ARG3)
+      j = arg_lo_ss(Y_AXIS,ARG3)
+      k = arg_lo_ss(Z_AXIS,ARG3)
+      l = arg_lo_ss(T_AXIS,ARG3)
+      m = arg_lo_ss(E_AXIS,ARG3)
+      n = arg_lo_ss(F_AXIS,ARG3)
+      filter_span = arg_3(i,j,k,l,m,n)
+
+*  Get N = length of time series.
+
+      nt = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+      IF (filter_span .GT. nt) THEN
+         WRITE (err_msg, 10)
+   10    FORMAT('LSL_FILTER: The filter span must be less than or ', 
+     .             'equal to the number of points')
+         GOTO 999
+      ENDIF
+ 
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Compute the filtered time series.
+
+               nn = 1
+               DO 400 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+                  x(nn,1,1,1,1,1) = arg_1(i1,j1,k1,l1,m1,n1)
+                  nn = nn + 1
+ 400           CONTINUE
+
+               CALL LSL_low_pass_filter (x, nt, cutoff_period, 
+     .                           bad_flag(ARG1), filter_span, h, y)
+
+*  Put the filtred series in result
+
+               nn = 1
+               DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+                  IF ( y(nn,1,1,1,1,1) .NE. bad_flag(ARG1) ) THEN
+                     result(i,j,k,l,m,n) = y(nn,1,1,1,1,1)
+                  ELSE
+                     result(i,j,k,l,m,n) = bad_flag_result
+                  ENDIF
+                  nn = nn + 1
+ 410           CONTINUE
+
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+      subroutine LSL_low_pass_filter( 
+     1  x, N, cutoff_period, missing_value, filter_span, h, y )
+c
+c Least Squares Lanczos (LSL) low-pass filter:  This subroutine 
+c low-pass filters an equally spaced time series using least-squares 
+c approximation to the ideal low-pass filter of Bloomfield with Lanczos 
+c convergence factors.  It is very similar to subroutine LOPASS in 
+c Chapter 6, p. 149, of
+c 
+c Bloomfield, P., 1976, Fourier Analysis of Time Series: An 
+c    Introduction, John Wiley & Sons, New York, 258 pp.
+c
+c The main difference is that the present routine takes account of
+c missing values in the input time series.
+c
+c Inputs:
+c
+c x(N) = a real array of equally spaced points to low-pass filter
+c N    = the number of points in x
+c cutoff_period = the cutoff period (the period at which the filter
+c                 attains 1/2 amplitude or 1/4 "energy") measured in
+c                 units of delta t.  The cutoff_period must be less than
+c                 or equal to N.
+c filter_span = the number of input data points used in each filtered
+c               output point.  A wide filter gives a narrow frequency
+c               response transition band, but leads to ringing near
+c               data discontinuities and loss of filtered values at the
+c               end points and surrounding missing values.  A narrow
+c               filter reduces ringing and output data loss, but gives
+c               a wider frequency transition width, i.e. it falls off
+c               less rapidly at freqs. higher than the cutoff.
+c               The filter transition region lies in the period range
+c               between N*cutoff_period/(N + cutoff_period) and 
+c               N*cutoff_period/(N - cutoff_period). 
+c missing_value = the missing value flag that signals to exclude flagged
+c                 values from the computation.
+c Outputs:
+c
+c filter_span = the filter span should be an odd integer.  It is set to 
+c               the next lower odd number if the input is even.
+c y(N)        = the output array of filtered values.  Values near the
+c               ends and near gaps are filled with the missing value
+c               flag.
+c
+c Note on tidal filtering:  For hourly time series containing tidal
+c signals, some investigators use this filter with a 35-hour cutoff period
+c and a filter span of xxx hours to remove at least 99.5 % of the energy for
+c periods less than 25 hours.
+c
+c Adapted from Bloomfield by E. D. Cokelet, NOAA/PMEL, 3 Dec 1999    
+c
+c        1         2         3         4         5         6         7
+c23456789012345678901234567890123456789012345678901234567890123456789012
+c
+
+c acm  explicitly define and type all variables
+      integer n, i, j, ib, ie
+      real cutoff_period, missing_value
+      real*8 pi, omega_c, h0, con, summ, temp, x1, x2, d1, d2
+
+      integer filter_span, half_span
+      real x(*), h(*), y(*)
+
+c      d(z) = sin(z)/z      ! define statement function  (doesnt work on osf)
+
+      pi = 4.*atan(1.d0)
+
+c Make sure filter span is odd
+c
+      half_span = int( (filter_span - 1) / 2 )
+      filter_span = 2*half_span + 1
+c
+c
+c Calculate the filter weights and normalize them
+c
+      omega_c = 2 * pi / cutoff_period
+c
+      h0 = omega_c / pi
+      con = 2.*pi/float(filter_span)
+      summ = h0
+      do 10 i = 1, half_span
+         d1 = sin(float(i)*omega_c)/ (float(i)*omega_c)
+         d2 = sin(float(i)*con)/ (float(i)*con)
+c         h(i) = h0 * d( float(i)*omega_c ) * d( float(i)*con )
+         h(i) = h0 * d1 * d2
+         summ = summ + 2. * h(i)
+ 10   continue
+c
+      h0 = h0/summ
+      do 20 i = 1, half_span
+         h(i) = h(i) / summ
+ 20   continue
+c
+c
+c Put missing_value in the first and last half_span elements to
+c account for end effects
+c
+      do 30 i =1, half_span
+         y(i) = missing_value
+         j = N - i + 1
+         y(j) = missing_value
+ 30   continue
+c
+c
+c Filter by convolving.  
+c To account for gaps in the time series, set to missing any filtered
+c values that would require missing values to compute them.
+c
+      ib = half_span + 1
+      ie = N - half_span
+c
+      do 50 i = ib, ie
+         if (x(i) .eq. missing_value) then
+            temp = missing_value
+            go to 45
+         end if
+         temp = h0 * x(i)
+         do 40 j = 1, half_span
+   	    x1 = x(i - j)
+   	    x2 = x(i + j)
+   	    if ( ( x1 .eq. missing_value ) .or. 
+     1          ( x2 .eq. missing_value ) ) then
+   		temp = missing_value
+   		go to 45
+   	    end if
+	    temp = temp + h(j) * ( x1 + x2 )
+ 40      continue
+ 45      continue
+         y(i) = temp
+
+ 50   continue
+c
+      return
+      end
+
+c      real*8 function d(z)
+c
+cc      d(z) = sin(z)/z      ! define statement function  (doesnt work on osf)
+c
+c      real z
+c      d = sin(z)/ z
+c
+c      return
+c      end
diff --git a/fer/efi/maxminmax.F b/fer/efi/maxminmax.F
new file mode 100644
index 0000000..e09cd25
--- /dev/null
+++ b/fer/efi/maxminmax.F
@@ -0,0 +1,199 @@
+
+      SUBROUTINE maxMINMAX  (Z, L, MM, NN, neigh_x, neigh_y, badz, 
+     .                      zmaxlist, nzmax)
+C
+C  based on NCAR routine MINMAX, return maxima
+C  From the NCAR graphics library at http://ngwww.ucar.edu version 4.2
+C  Modified by Ansley Manke to regurn only the maxima for subroutine findhi.F
+C
+C-------------------------------------------------------------
+C	$Id: maxminmax.F 9377 2006-04-05 16:34:02Z ansley $
+C                                                                      
+C                Copyright (C)  2000
+C        University Corporation for Atmospheric Research
+C                All Rights Reserved
+C
+C This file is free software; you can redistribute it and/or modify
+C it under the terms of the GNU General Public License as published
+C by the Free Software Foundation; either version 2 of the License, or
+C (at your option) any later version.
+C
+C This software is distributed in the hope that it will be useful, but
+C WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+C General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with this software; if not, write to the Free Software
+C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+C USA.
+C-------------------------------------------------------------
+
+CC THIS ROUTINE FINDS RELATIVE MINIMUMS AND MAXIMUMS.  A RELATIVE MINIMUM
+C (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) POINT WITHIN
+C A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED HERE
+C IS + OR - MN IN THE X DIRECTION AND + OR - NM IN THE Y DIRECTION.
+C
+C ORIGINATOR       DAVID KENNISON
+
+C  Ansley Manke changes for Ferret 7/01
+C	- remove sections that put label on plot
+C	- use "bad value" rather than SPECIAL VALUE, SPVAL
+C	- remove references to IOFFP, JOFFDT
+c	- new code and my comments in lowercase
+c	- return maxes.  For n = 1, nzmax:
+c	    zmaxlist(1,n) = i index of zmax point
+c	    zmaxlist(2,n) = j index of zmax point
+c	    zmaxlist(3,n) = z value at zmax point
+C
+      integer	L, MM, NN, m, n, nm1, mm1, jp, im, mn, ip, is, it, ii,
+     .		js, nm, jt, jk, ik, nzmax, neigh_x, neigh_y
+
+      real	Z(L,NN), aa, an, badz, zmaxlist(3,*)
+C
+      M = MM
+      N = NN
+
+c      MN = min(2,MAX(2,IFIX(FLOAT(M)/8.)))
+c      NM = min(2,MAX(2,IFIX(FLOAT(N)/8.)))
+
+      MN = neigh_x
+      NM = neigh_y
+
+      nzmax = 0
+C
+      NM1 = N-1
+      MM1 = M-1
+C
+C LINE LOOP FOLLOWS - THE COMPLETE TWO-DIMENSIONAL TEST FOR A MINIMUM OR
+C MAXIMUM OF THE FIELD IS ONLY PERFORMED FOR POINTS WHICH ARE MINIMA OR
+C MAXIMA ALONG SOME LINE - FINDING THESE CANDIDATES IS MADE EFFICIENT BY
+C USING A COUNT OF CONSECUTIVE INCREASES OR DECREASES OF THE FUNCTION
+C ALONG THE LINE
+C
+      DO 127 JP=2,NM1
+C
+         IM = MN-1
+         IP = -1
+         GO TO 126
+C
+C CONTROL RETURNS TO STATEMENT 10 AS LONG AS THE FUNCTION IS INCREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MAXIMUM
+C
+  101    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 104
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 102,103,104
+  102    IM = IM+1
+         GO TO 101
+  103    IM = 0
+         GO TO 101
+C
+C FUNCTION DECREASED - TEST FOR MAXIMUM ON LINE
+C
+  104    IF (IM .GE. MN) GO TO 106
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 106
+         DO 105 II=IS,IT
+            IF (AA .LE. Z(II,JP)) GO TO 112
+  105    CONTINUE
+  106    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 109
+         DO 108 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 107
+            IP = II-1
+            GO TO 125
+  107       IF (AA .LE. Z(II,JP)) GO TO 112
+  108    CONTINUE
+C
+C WE HAVE MAXIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MAXIMUM OF FIELD
+C
+  109    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 111 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 111
+            DO 110 IK=IS,IT
+               IF (Z(IK,JK).GE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 112
+  110       CONTINUE
+  111    CONTINUE
+
+	 nzmax = nzmax + 1
+	 zmaxlist(1,nzmax) = float(ip)
+	 zmaxlist(2,nzmax) = float(jp)
+	 zmaxlist(3,nzmax) = z(ip,jp)
+
+  112    IM = 1
+         IF (IP-MM1) 113,127,127
+C
+C CONTROL RETURNS TO STATEMENT 20 AS LONG AS THE FUNCTION IS DECREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MINIMUM
+C
+  113    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 116
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 116,115,114
+  114    IM = IM+1
+         GO TO 113
+  115    IM = 0
+         GO TO 113
+C
+C FUNCTION INCREASED - TEST FOR MINIMUM ON LINE
+C
+  116    IF (IM .GE. MN) GO TO 118
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 118
+         DO 117 II=IS,IT
+            IF (AA .GE. Z(II,JP)) GO TO 124
+  117    CONTINUE
+  118    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 121
+         DO 120 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 119
+            IP = II-1
+            GO TO 125
+  119       IF (AA .GE. Z(II,JP)) GO TO 124
+  120    CONTINUE
+C
+C WE HAVE MINIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MINIMUM OF FIELD
+C
+  121    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 123 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 123
+            DO 122 IK=IS,IT
+               IF (Z(IK,JK).LE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 124
+  122       CONTINUE
+  123    CONTINUE
+C
+  124    IM = 1
+         IF (IP-MM1) 101,127,127
+C
+C SKIP SPECIAL VALUES ON LINE
+C
+  125    IM = 0
+  126    IP = IP+1
+         IF (IP .GE. MM1) GO TO 127
+         IF (Z(IP+1,JP).EQ.badz) GO TO 125
+         IM = IM+1
+         IF (IM .LE. MN) GO TO 126
+         IM = 1
+         AN = Z(IP+1,JP)
+         IF (Z(IP,JP)-AN) 101,103,113
+C
+  127 CONTINUE
+C
+      RETURN
+
+      END
diff --git a/fer/efi/minmax.F b/fer/efi/minmax.F
new file mode 100644
index 0000000..b98c6fa
--- /dev/null
+++ b/fer/efi/minmax.F
@@ -0,0 +1,192 @@
+*
+* minmax.F
+*
+* Ansley Manke
+* May 2009
+*
+* This function returns the min and max of a variable
+* Faster than individually computing the min and max
+* or running the STAT command.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE minmax_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     . 'Returns min and max of a var. result[i=1]=min,result[i=1]=max' )
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE minmax_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, 2)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE minmax_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      REAL amin, amax
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      amin = MAX( ABS(bad_flag(1)), 1.0E34 )
+      amax = -1.0 * amin
+
+      DO 100 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+      DO 100 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+      DO 100 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+      DO 100 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+      DO 100 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1) ) THEN
+            amin = MIN(amin, arg_1(i1,j1,k1,l1,m1,n1) )
+            amax = MAX(amax, arg_1(i1,j1,k1,l1,m1,n1) )
+         END IF
+
+ 100  CONTINUE
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+      result(i,j,k,l,m,n) = amin
+      result(i+1,j,k,l,m,n) = amax
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/minminmax.F b/fer/efi/minminmax.F
new file mode 100644
index 0000000..47c0737
--- /dev/null
+++ b/fer/efi/minminmax.F
@@ -0,0 +1,196 @@
+      SUBROUTINE minMINMAX (Z, L, MM, NN, neigh_x, neigh_y, badz, 
+     .                      zminlist, nzmin)
+C
+C  based on NCAR routine MINMAX, return minima
+C  From the NCAR graphics library at http://ngwww.ucar.edu version 4.2
+C  Modified by Ansley Manke to regurn only the minima for subroutine findlo.F
+C-------------------------------------------------------------
+C	$Id: minminmax.F 11665 2011-01-06 20:18:22Z ksmith $
+C                                                                      
+C                Copyright (C)  2000
+C        University Corporation for Atmospheric Research
+C                All Rights Reserved
+C
+C This file is free software; you can redistribute it and/or modify
+C it under the terms of the GNU General Public License as published
+C by the Free Software Foundation; either version 2 of the License, or
+C (at your option) any later version.
+C
+C This software is distributed in the hope that it will be useful, but
+C WITHOUT ANY WARRANTY; without even the implied warranty of
+C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+C General Public License for more details.
+C
+C You should have received a copy of the GNU General Public License
+C along with this software; if not, write to the Free Software
+C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+C USA.
+C-------------------------------------------------------------
+
+C THIS ROUTINE FINDS RELATIVE MINIMUMS AND MAXIMUMS.  A RELATIVE MINIMUM
+C (OR MAXIMUM) IS DEFINED TO BE THE LOWEST (OR HIGHEST) POINT WITHIN
+C A CERTAIN NEIGHBORHOOD OF THE POINT.  THE NEIGHBORHOOD USED HERE
+C IS + OR - MN IN THE X DIRECTION AND + OR - NM IN THE Y DIRECTION.
+C
+C ORIGINATOR       DAVID KENNISON
+
+C  Ansley Manke changes for Ferret 7/01
+C	- remove sections that put label on plot
+C	- use "bad value" rather than SPECIAL VALUE, SPVAL
+C	- remove references to IOFFP, JOFFDT
+c	- new code and my comments in lowercase
+c	- return mins.  For n = 1, nzmin:
+c	    zminlist(1,n) = i index of zmin point
+c	    zminlist(2,n) = j index of zmin point
+c	    zminlist(3,n) = z value at zmin point
+C
+      integer	L, MM, NN, m, n, nm1, mm1, jp, im, mn, ip, is, it, ii, 
+     .		js, nm, jt, jk, ik, nzmin, neigh_x, neigh_y
+      real	Z(L,NN), aa, an, badz, zminlist(3,*)
+C
+      M = MM
+      N = NN
+
+c      MN = min(2,MAX(2,IFIX(FLOAT(M)/8.)))
+c      NM = min(2,MAX(2,IFIX(FLOAT(N)/8.)))
+
+      MN = neigh_x
+      NM = neigh_y
+
+      nzmin = 0
+C
+      NM1 = N-1
+      MM1 = M-1
+C
+C LINE LOOP FOLLOWS - THE COMPLETE TWO-DIMENSIONAL TEST FOR A MINIMUM OR
+C MAXIMUM OF THE FIELD IS ONLY PERFORMED FOR POINTS WHICH ARE MINIMA OR
+C MAXIMA ALONG SOME LINE - FINDING THESE CANDIDATES IS MADE EFFICIENT BY
+C USING A COUNT OF CONSECUTIVE INCREASES OR DECREASES OF THE FUNCTION
+C ALONG THE LINE
+C
+      DO 127 JP=2,NM1
+C
+         IM = MN-1
+         IP = -1
+         GO TO 126
+C
+C CONTROL RETURNS TO STATEMENT 10 AS LONG AS THE FUNCTION IS INCREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MAXIMUM
+C
+  101    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 104
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 102,103,104
+  102    IM = IM+1
+         GO TO 101
+  103    IM = 0
+         GO TO 101
+C
+C FUNCTION DECREASED - TEST FOR MAXIMUM ON LINE
+C
+  104    IF (IM .GE. MN) GO TO 106
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 106
+         DO 105 II=IS,IT
+            IF (AA .LE. Z(II,JP)) GO TO 112
+  105    CONTINUE
+  106    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 109
+         DO 108 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 107
+            IP = II-1
+            GO TO 125
+  107       IF (AA .LE. Z(II,JP)) GO TO 112
+  108    CONTINUE
+C
+C WE HAVE MAXIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MAXIMUM OF FIELD
+C
+  109    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 111 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 111
+            DO 110 IK=IS,IT
+               IF (Z(IK,JK).GE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 112
+  110       CONTINUE
+  111    CONTINUE
+
+  112    IM = 1
+         IF (IP-MM1) 113,127,127
+C
+C CONTROL RETURNS TO STATEMENT 20 AS LONG AS THE FUNCTION IS DECREASING
+C ALONG THE LINE - WE SEEK A POSSIBLE MINIMUM
+C
+  113    IP = IP+1
+         AA = AN
+         IF (IP .EQ. MM1) GO TO 116
+         AN = Z(IP+1,JP)
+         IF (AN.EQ.badz) GO TO 125
+         IF (AA-AN) 116,115,114
+  114    IM = IM+1
+         GO TO 113
+  115    IM = 0
+         GO TO 113
+C
+C FUNCTION INCREASED - TEST FOR MINIMUM ON LINE
+C
+  116    IF (IM .GE. MN) GO TO 118
+         IS = max(1,IP-MN)
+         IT = IP-IM-1
+         IF (IS .GT. IT) GO TO 118
+         DO 117 II=IS,IT
+            IF (AA .GE. Z(II,JP)) GO TO 124
+  117    CONTINUE
+  118    IS = IP+2
+         IT = min(M,IP+MN)
+         IF (IS .GT. IT) GO TO 121
+         DO 120 II=IS,IT
+            IF (Z(II,JP).NE.badz) GO TO 119
+            IP = II-1
+            GO TO 125
+  119       IF (AA .GE. Z(II,JP)) GO TO 124
+  120    CONTINUE
+C
+C WE HAVE MINIMUM ON LINE - DO TWO-DIMENSIONAL TEST FOR MINIMUM OF FIELD
+C
+  121    JS = max(1,JP-NM)
+         JT = min(N,JP+NM)
+         IS = max(1,IP-MN)
+         IT = min(M,IP+MN)
+         DO 123 JK=JS,JT
+            IF (JK .EQ. JP) GO TO 123
+            DO 122 IK=IS,IT
+               IF (Z(IK,JK).LE.AA .OR. (Z(IK,JK).EQ.badz)) GO TO 124
+  122       CONTINUE
+  123    CONTINUE
+
+	 nzmin = nzmin + 1
+	 zminlist(1,nzmin) = float(ip)
+	 zminlist(2,nzmin) = float(jp)
+	 zminlist(3,nzmin) = z(ip,jp)
+C
+  124    IM = 1
+         IF (IP-MM1) 101,127,127
+C
+C SKIP SPECIAL VALUES ON LINE
+C
+  125    IM = 0
+  126    IP = IP+1
+         IF (IP .GE. MM1) GO TO 127
+         IF (Z(IP+1,JP).EQ.badz) GO TO 125
+         IM = IM+1
+         IF (IM .LE. MN) GO TO 126
+         IM = 1
+         AN = Z(IP+1,JP)
+         IF (Z(IP,JP)-AN) 101,103,113
+C
+  127 CONTINUE
+C
+      RETURN
+
+      END
diff --git a/fer/efi/minutes24.F b/fer/efi/minutes24.F
new file mode 100644
index 0000000..63d8cdd
--- /dev/null
+++ b/fer/efi/minutes24.F
@@ -0,0 +1,216 @@
+*
+* minutes24.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Steve Hankin
+* Dac, 2000
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE minutes24_init (id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc (id,
+     .   'Convert a formatted time of day into minutes since 00:00' )
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 0)
+
+      arg = 1
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_name(id, arg, 'formatted time')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'hh:mm or hh:mm:ss.s  (e.g. "12:24:13")')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE minutes24_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE minutes24_compute (id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL TIME_DECODE
+      INTEGER TM_LENSTR1
+      INTEGER slen
+      CHARACTER str_time*12
+      REAL res
+      INTEGER i, j, k, l, m, n
+
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* get the argument string
+      CALL ef_get_arg_string(id, 1, str_time)
+* make it a null-terminated string
+      slen = MIN(TM_LENSTR1(str_time)+1,12)
+      str_time(slen:slen) = CHAR(0)
+* convert to number of minutes since 00:00
+      res = TIME_DECODE(str_time)
+
+* assign the result
+      i = memreslox
+      j = memresloy
+      k = memresloz
+      l = memreslot
+      m = memresloe
+      n = memreslof
+      IF ( res .EQ. -1E34 ) THEN
+         result(i,j,k,l,m,n) = bad_flag_result
+      ELSE
+         result(i,j,k,l,m,n) = res
+      ENDIF
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN 
+      END
+
diff --git a/fer/efi/modscat.F b/fer/efi/modscat.F
new file mode 100644
index 0000000..8dfdf45
--- /dev/null
+++ b/fer/efi/modscat.F
@@ -0,0 +1,85 @@
+      SUBROUTINE modscat(axmin, axmax, axmod, nscat, scatm)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+* ACM 11/00
+*  Called by scat2grid* gridding functions.
+*  If there is a modulo axis, apply modulo-ness to the coordinates in that 
+*  direction of the scattered points.
+*
+* *kms* 4/2012 Modified to pass the min, max, and modulo for the axis
+*              If axmin and axmax are same location after modulo, axmax
+*              values will be returned as axmin.
+*
+*  axmin        minimum value for the modulo axis
+*  axmax        maximum value for the modulo axis
+*  axmod        modulo length for the modulo axis
+*  nscat        number of scattered points
+*  scatm        input: scattered points coordinate array for the modulo axis
+*               output: updated coordinates in the modulo range (if possible)
+
+*  Input arguments
+      REAL*8 axmin, axmax, axmod
+      INTEGER nscat
+
+*  Input/output arguments
+      REAL scatm(*)
+
+*  Local variables
+      INTEGER idx
+      REAL*8 val
+
+* Check this is a valid modulo axis
+      IF ( (axmin .GE. axmax) .OR. (axmod .LE. 0.0D0) ) THEN
+         RETURN
+      ENDIF
+
+* Convert values
+      DO 100 idx = 1, nscat
+*        Do the conversion in double precision
+         val = scatm(idx)
+         DO WHILE ( val .GE. axmax )
+            val = val - axmod
+         ENDDO
+         DO WHILE ( val .LT. axmin )
+            val = val + axmod
+         ENDDO
+*        Save the new value if in range
+         IF ( (val .GE. axmin) .AND. (val .LE. axmax) ) THEN
+            scatm(idx) = val
+         ENDIF
+  100 CONTINUE
+
+      RETURN
+      END
+
diff --git a/fer/efi/mrgrnk.F b/fer/efi/mrgrnk.F
new file mode 100644
index 0000000..a8cc3b8
--- /dev/null
+++ b/fer/efi/mrgrnk.F
@@ -0,0 +1,251 @@
+      Subroutine MRGRNK (XVALT, IRNGT, JWRKT, NVAL)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+* 
+
+!  From http://www.fortran-2000.com/rank/index.html#1.1  
+! ACM conversion to f77
+! __________________________________________________________
+!   MRGRNK = Merge-sort ranking of an array
+!   For performance reasons, the first 2 passes are taken
+!   out of the standard loop, and use dedicated coding.
+! __________________________________________________________
+      Real XVALT(*)
+      Integer IRNGT(*)
+! __________________________________________________________
+      Integer  JWRKT(*)	! same size as IRNGT
+      Integer  LMTNA, LMTNC, IRNG1, IRNG2
+      Integer  NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
+      Real XVALA, XVALB
+
+      INTEGER ii, indx
+!
+
+      IF (NVAL .EQ. 0) THEN
+         Return
+      ELSE IF (nval .EQ. 1) THEN
+         IRNGT (1) = 1
+         Return
+      ENDIF
+!
+!  Fill-in the index array, creating ordered couples
+!
+      Do IIND = 2, NVAL, 2
+         If (XVALT(IIND-1) .LE. XVALT(IIND)) Then
+            IRNGT (IIND-1) = IIND - 1
+            IRNGT (IIND) = IIND
+         Else
+            IRNGT (IIND-1) = IIND
+            IRNGT (IIND) = IIND - 1
+         End If
+      End Do
+      If (Mod(NVAL, 2) .NE. 0) Then
+         IRNGT (NVAL) = NVAL
+      End If
+!
+!  We will now have ordered subsets A - B - A - B - ...
+!  and merge A and B couples into     C   -   C   - ...
+!
+      LMTNA = 2
+      LMTNC = 4
+!
+!  First iteration. The length of the ordered subsets goes from 2 to 4
+!
+      Do WHILE (.TRUE.)
+         If (NVAL .LE. 2) GO TO 3000
+!
+!   Loop on merges of A and B into C
+!
+         Do IWRKD = 0, NVAL - 1, 4
+            If ((IWRKD+4) .GT. NVAL) Then
+               If ((IWRKD+2) .GE. NVAL) GO TO 2000
+!
+!   1 2 3
+!
+               If (XVALT(IRNGT(IWRKD+2)) .LE. XVALT(IRNGT(IWRKD+3))) 
+     .             GO TO 2000
+!
+!   1 3 2
+!
+               If (XVALT(IRNGT(IWRKD+1)) .LE. XVALT(IRNGT(IWRKD+3)))Then
+                  IRNG2 = IRNGT (IWRKD+2)
+                  IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
+                  IRNGT (IWRKD+3) = IRNG2
+!
+!   3 1 2
+!
+               Else
+                  IRNG1 = IRNGT (IWRKD+1)
+                  IRNGT (IWRKD+1) = IRNGT (IWRKD+3)
+                  IRNGT (IWRKD+3) = IRNGT (IWRKD+2)
+                  IRNGT (IWRKD+2) = IRNG1
+               End If
+               GO TO 2000
+            End If
+!
+!   1 2 3 4
+!
+
+            If (XVALT(IRNGT(IWRKD+2)) .LE. XVALT(IRNGT(IWRKD+3))) 
+     .            GO TO 1000
+!
+!   1 3 x x
+!
+            If (XVALT(IRNGT(IWRKD+1)) .LE. XVALT(IRNGT(IWRKD+3))) Then
+               IRNG2 = IRNGT (IWRKD+2)
+               IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
+               If (XVALT(IRNG2) .LE. XVALT(IRNGT(IWRKD+4))) Then
+!   1 3 2 4
+                  IRNGT (IWRKD+3) = IRNG2
+               Else
+!   1 3 4 2
+                  IRNGT (IWRKD+3) = IRNGT (IWRKD+4)
+                  IRNGT (IWRKD+4) = IRNG2
+               End If
+!
+!   3 x x x
+!
+            Else
+               IRNG1 = IRNGT (IWRKD+1)
+               IRNG2 = IRNGT (IWRKD+2)
+               IRNGT (IWRKD+1) = IRNGT (IWRKD+3)
+               If (XVALT(IRNG1) .LE. XVALT(IRNGT(IWRKD+4))) Then
+                  IRNGT (IWRKD+2) = IRNG1
+                  If (XVALT(IRNG2) .LE. XVALT(IRNGT(IWRKD+4))) Then
+!   3 1 2 4
+                     IRNGT (IWRKD+3) = IRNG2
+                  Else
+!   3 1 4 2
+                     IRNGT (IWRKD+3) = IRNGT (IWRKD+4)
+                     IRNGT (IWRKD+4) = IRNG2
+                  End If
+               Else
+!   3 4 1 2
+                  IRNGT (IWRKD+2) = IRNGT (IWRKD+4)
+                  IRNGT (IWRKD+3) = IRNG1
+                  IRNGT (IWRKD+4) = IRNG2
+               End If
+            End If
+ 1000       CONTINUE
+         End Do
+ 2000    CONTINUE
+!
+!  The Cs become As and Bs
+!
+         LMTNA = 4
+         GO TO 3000
+      End Do
+ 3000 CONTINUE
+
+!
+!  Iteration loop. Each time, the length of the ordered subsets
+!  is doubled.
+!
+      Do WHILE (.TRUE.)
+         If (LMTNA .GE. NVAL) GO TO 6000
+         IWRKF = 0
+         LMTNC = 2 * LMTNC
+!
+!   Loop on merges of A and B into C
+!
+         Do WHILE (.TRUE.)
+ 7000       CONTINUE
+            IWRK = IWRKF
+            IWRKD = IWRKF + 1
+            JINDA = IWRKF + LMTNA
+            IWRKF = IWRKF + LMTNC
+            If (IWRKF .GE. NVAL) Then
+               If (JINDA .GE. NVAL) GO TO 5000
+               IWRKF = NVAL
+            End If
+            IINDA = 1
+            IINDB = JINDA + 1
+!
+!   Shortcut for the case when the max of A is smaller
+!   than the min of B. This line may be activated when the
+!   initial set is already close to sorted.
+!
+!          IF (XVALT(IRNGT(JINDA)) .LE. XVALT(IRNGT(IINDB))) GO TO 7000
+!
+!  One steps in the C subset, that we build in the final rank array
+!
+!  Make a copy of the rank array for the merge iteration
+!
+            indx = iwrkd
+            DO ii = 1, lmtna
+              JWRKT (ii) = IRNGT (indx)
+              indx = indx + 1
+            ENDDO
+!
+            XVALA = XVALT (JWRKT(IINDA))
+            XVALB = XVALT (IRNGT(IINDB))
+!
+            Do WHILE (.TRUE.)
+               IWRK = IWRK + 1
+!
+!  We still have unprocessed values in both A and B
+!
+               If (XVALA .GT. XVALB) Then
+                  IRNGT (IWRK) = IRNGT (IINDB)
+                  IINDB = IINDB + 1
+                  If (IINDB .GT. IWRKF) Then
+!  Only A still with unprocessed values
+                     indx = iinda
+                     DO ii = IWRK+1, IWRKF
+                        IRNGT (ii) = JWRKT (indx)
+                        indx = indx + 1
+                     ENDDO
+
+                     GO TO 4000
+                  End If
+                  XVALB = XVALT (IRNGT(IINDB))
+               Else
+                  IRNGT (IWRK) = JWRKT (IINDA)
+                  IINDA = IINDA + 1
+                  If (IINDA .GT. LMTNA) GO TO 4000 ! Only B still with unprocessed values
+                  XVALA = XVALT (JWRKT(IINDA))
+               End If
+!
+            End Do
+ 4000       CONTINUE
+         End Do
+ 5000    CONTINUE
+!
+!  The Cs become As and Bs
+!
+         LMTNA = 2 * LMTNA
+      End Do
+ 6000 CONTINUE
+!
+      Return
+      End	!Subroutine MRGRNK
diff --git a/fer/efi/nco.F b/fer/efi/nco.F
new file mode 100644
index 0000000..d99b83f
--- /dev/null
+++ b/fer/efi/nco.F
@@ -0,0 +1,153 @@
+*
+* nco.F
+*
+* Ansley Manke
+* March 1, 2005
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V685 *acm* 5/13  If the user has sent -A (append) then don't send 
+*                  -O (override) to nco.
+*
+* This function spawns any NCO call, with the first argument being the
+* NCO function name, and the second one long string which is the argument 
+* to nco including file names and actions.
+*
+* 
+      SUBROUTINE nco_init(id)
+
+* Define arguments and result
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 'Call an NCO utility' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'operator')
+      CALL ef_set_arg_desc(id, arg, 'name of operator')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'arguments')
+      CALL ef_set_arg_desc(id, arg, 'one string with all arguments')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      RETURN 
+      END
+
+* Define abstract output axis: 1 value
+
+      SUBROUTINE nco_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+      RETURN 
+      END
+
+*
+* Compute the result
+*
+      SUBROUTINE nco_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      LOGICAL TM_HAS_STRING
+      INTEGER TM_LENSTR
+
+      INTEGER arg, alen, slen
+      INTEGER i, j, k, l, m, n
+      CHARACTER*2048 argstring, buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 1
+      CALL ef_get_arg_string(id, arg, argstring)
+      alen = TM_LENSTR(argstring)
+      buff = argstring(1:alen)
+      slen = alen
+
+      arg = 2
+      CALL ef_get_arg_string(id, arg, argstring)
+      alen = TM_LENSTR(argstring)
+
+      IF ( TM_HAS_STRING(argstring, '-A') ) THEN 
+         buff = buff(1:slen)//' -h '
+         slen = slen + 5
+      ELSE
+         buff = buff(1:slen)//' -O -h '
+         slen = slen + 7
+      ENDIF
+
+      buff = buff(1:slen)//argstring(1:alen)
+      slen = slen + alen 
+
+* Spawn the command 
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+      result(i,j,k,l,m,n) = bad_flag_result
+
+      CALL system( buff(1:slen) )
+
+      result(i,j,k,l,m,n) = 1
+
+      RETURN 
+      END
diff --git a/fer/efi/nco_attr.F b/fer/efi/nco_attr.F
new file mode 100644
index 0000000..1823003
--- /dev/null
+++ b/fer/efi/nco_attr.F
@@ -0,0 +1,344 @@
+*
+* nco_attr.F
+*
+* Ansley Manke
+* March 1, 2005
+* V62  6/08 *acm* Increase attribute buffer size to 2048
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function spawns a netCDF edit call, ncatted to edit 
+* an attribute (e.g. new attribute, edit or delete atttibute,
+* or add lines to the global history attribute)
+*
+* 
+*  Notes: 
+* 1) our ncatted does not have the i data type.  It returns the messages
+* 
+* > ncatted -O -h -a missing_value,A,o,i,3 x.nc 
+* ncatted: ERROR 'i' is not a supported netCDF data type
+* ncatted: HINT: Valid data types are 'c' = char, 'f' = float, 'd' = double, 's' = short, 'l' = long, 'b' = byte
+
+* 2) errors from ncatted do not stop the function from returning normally.
+
+      SUBROUTINE nco_attr_init(id)
+
+* Define arguments and result
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_set_desc(id, 
+     .  'Call ncatted to edit attributes in a netCDF file' )
+      CALL ef_set_num_args(id, 6)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'FileName')
+      CALL ef_set_arg_desc(id, arg, 'netCDF file name')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'VariableName')
+      CALL ef_set_arg_desc(id, arg, 'Variable name (or global)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'AttributeName')
+      CALL ef_set_arg_desc(id, arg, 'Attribute to change')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'AttType')
+      CALL ef_set_arg_desc(id, arg, 'Attribute type')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'Mode')
+      CALL ef_set_arg_desc(id, arg, 'o=edit, a=append, d=delete')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'AttributeValue')
+      CALL ef_set_arg_desc(id, arg, 'new value of attribute')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+      RETURN 
+      END
+
+* Define abstract output axis: 1 value
+
+      SUBROUTINE nco_attr_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER ivalue
+
+      ivalue = 1
+      CALL ef_set_axis_limits(id, X_AXIS, ivalue, ivalue)
+
+      RETURN 
+      END
+
+*
+* Compute the result
+*
+      SUBROUTINE nco_attr_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .           arg_5, arg_6, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf,
+     .           mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(strdf,
+     .           mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(strdf,
+     .           mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(strdf,
+     .           mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(strdf,
+     .           mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      INTEGER TM_LENSTR, TM_LENSTR1
+      INTEGER arg, blen, slen
+      INTEGER i, j, k, l, m, n
+      REAL attval, val
+      REAL*8 dattval
+      INTEGER*2 isattval 
+      INTEGER iattval
+      CHARACTER*1 battval
+      CHARACTER*1 mode, atttype
+      CHARACTER*3 atttype_in
+      CHARACTER*1024 filename
+      CHARACTER*254 variablename, attributename, errmsg
+      CHARACTER*2048 buff, attributevalue
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 1
+      CALL ef_get_arg_string(id, arg, filename)
+      arg = 2
+      CALL ef_get_arg_string(id, arg, variablename)
+      arg = 3
+      CALL ef_get_arg_string(id, arg, attributename)
+      arg = 4
+      CALL ef_get_arg_string(id, arg, atttype_in)
+      arg = 5
+      CALL ef_get_arg_string(id, arg, mode)
+      arg = 6
+      CALL ef_get_arg_string(id, arg, attributevalue)
+
+      IF (TM_LENSTR(atttype_in) .GT. 1) THEN
+         CALL EF_BAIL_OUT(id, 
+     .       'Attribute type must be f, d, i, l, s, c, or b')
+      ELSE
+         atttype = atttype_in(1:1)
+      ENDIF
+
+      IF ( atttype .EQ. 'i' .OR. atttype .EQ. 'l' .OR.
+     .     atttype .EQ. 'I' .OR. atttype .EQ. 'L') atttype = 'l'
+
+* Check for valid values of mode
+
+      IF (mode .EQ. 'o' .OR. mode .EQ. 'O') THEN
+         mode = 'o'
+      ELSE IF (mode .EQ. 'a' .OR. mode .EQ. 'A') THEN
+         mode = 'a'
+      ELSE IF (mode .EQ. 'd' .OR. mode .EQ. 'D') THEN
+         mode = 'd'
+      ELSE
+         CALL EF_BAIL_OUT(id, 'Mode must be o, a, or d')
+      ENDIF
+
+* Build the string for the ncatted command
+* ncatted -O -h att_nm,var_nm,mode,att_type,att_val filename
+* Mode will always be o for overwrite
+
+      buff = 'ncatted -O -h -a '
+      blen = 17
+
+      slen = TM_LENSTR(attributename)
+      buff = buff(1:blen)//attributename(1:slen)//','
+      blen = blen + slen + 1
+
+      slen = TM_LENSTR(variablename)
+      buff = buff(1:blen)//variablename(1:slen)//','//mode(1:1)//','
+      blen = blen + slen + 3
+
+      slen = TM_LENSTR(atttype)
+      buff = buff(1:blen)//atttype(1:slen)//','
+      blen = blen + slen + 1
+
+! ncatted -O -h -a cartesian_axis,LAT,o,c,"Z" x.nc
+
+* Read the attribute value based on its type.
+* See documentation at the end of this file for attribute types.
+
+      IF (atttype .EQ. 'f' .OR. atttype .EQ. 'F') THEN
+         READ (attributevalue,*,err=501) attval
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'd' .OR. atttype .EQ. 'D') THEN
+         READ (attributevalue,*,err=502) dattval
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'i' .OR. atttype .EQ. 'l' .OR.
+     .         atttype .EQ. 'I' .OR. atttype .EQ. 'L') THEN
+         READ (attributevalue,*,err=503) iattval
+         READ (attributevalue,*,err=503) attval
+         val = iattval
+         IF (val .NE. attval) GOTO 503
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 's' .OR. atttype .EQ. 'S') THEN
+         READ (attributevalue,*,err=504) isattval
+         WRITE (attributevalue,*) isattval
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE IF (atttype .EQ. 'c' .OR. atttype .EQ. 'C') THEN
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//'"'//attributevalue(1:slen)//'"'
+         blen = blen + slen + 3
+
+      ELSE IF (atttype .EQ. 'b' .OR. atttype .EQ. 'B') THEN
+         READ (attributevalue,*,err=505) battval
+         slen = TM_LENSTR(attributevalue)
+         buff = buff(1:blen)//attributevalue(1:slen)
+         blen = blen + slen
+
+      ELSE
+         CALL EF_BAIL_OUT(id, 
+     .       'Attribute type must be f, d, i, s, c, or b')
+      ENDIF
+
+* Append the file name
+
+      slen = TM_LENSTR(filename)
+      buff = buff(1:blen)//' '//filename(1:slen)
+      blen = blen + slen + 1
+
+* Spawn the command 
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+      result(i,j,k,l,m,n) = bad_flag_result
+
+      CALL system( buff(1:blen) )
+
+      result(i,j,k,l,m,n) = 1
+      RETURN 
+
+501   slen = TM_LENSTR1(attributevalue)
+      errmsg = 'Error reading attribute value as floating-point '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+502   slen = TM_LENSTR1(attributevalue)
+      errmsg = 'Error reading attribute value as double-precision '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+503   slen = TM_LENSTR1(attributevalue)
+      errmsg = 'Error reading attribute value as an integer '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+504   slen = TM_LENSTR1(attributevalue)
+      errmsg = 'Error reading attribute value as a short integer '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+505   slen = TM_LENSTR1(attributevalue)
+      errmsg = 'Error reading attribute value as a byte '
+     .         //attributevalue(1:slen)
+      CALL EF_BAIL_OUT(id, errmsg)
+
+      END
+
+* ncatted documentation: here are the attribute types      
+* f    Float. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_FLOAT.
+* d    Double. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_DOUBLE.
+* i    Integer. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_INT.
+* l    Long. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_LONG.
+* s    Short. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_SHORT.
+* c    Char. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_CHAR.
+* b    Byte. Value(s) specified in att_val will be stored as netCDF intrinsic type NC_BYTE. 
+* 
+* 3.1 netCDF external data types
+* 
+* The external types supported by the netCDF interface are:
+* 
+* char    8-bit characters intended for representing text.
+* byte    8-bit signed or unsigned integers (see discussion below).
+* short  16-bit signed integers.
+* int    32-bit signed integers.
+* float  real 32-bit IEEE floating-point.
+* double 64-bit IEEE floating-point. 
diff --git a/fer/efi/nobad.F b/fer/efi/nobad.F
new file mode 100644
index 0000000..83a1e01
--- /dev/null
+++ b/fer/efi/nobad.F
@@ -0,0 +1,68 @@
+
+      SUBROUTINE nobad (xin, yin, zin, badz, nscat, xscat, yscat, zscat)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  Ansley Manke 5/99
+*  Called by scat2gridlaplace* gridding functions.
+*  If there is a missing value routine zgrid does not grid the data in 
+*  a zone around that point, even if there are other nearby good data 
+*  points.  Remove missing/bad data from the input (x,y,zscat) points.
+*
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+*
+
+      REAL xin(*), yin(*), zin(*), badz
+      REAL xscat(*), yscat(*), zscat(*)
+      INTEGER nscat, ngood, i
+      REAL*8 badcompare
+      REAL*8 eps
+      PARAMETER ( eps = 4.0D-7 )
+
+      ngood = 0
+      badcompare = eps * abs(badz)
+      IF ( badcompare < eps ) badcompare = eps
+
+      DO 100 i = 1, nscat
+         IF ( abs(zin(i) - badz) .GT. badcompare ) THEN
+            ngood = ngood + 1
+            xscat(ngood) = xin(i)
+            yscat(ngood) = yin(i)
+            zscat(ngood) = zin(i)
+         ENDIF
+  100 CONTINUE
+
+      nscat = ngood
+
+      RETURN
+      END
diff --git a/fer/efi/pickindex.F b/fer/efi/pickindex.F
new file mode 100644
index 0000000..459b5a0
--- /dev/null
+++ b/fer/efi/pickindex.F
@@ -0,0 +1,48 @@
+      SUBROUTINE pickindex(arr, iindex, aorder)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C  Ansley Manke 1/99
+
+*  Called by external functions samplei, samplej, samplek, samplel.
+*  Get the index to sample, whichever axis of arg_1 it is on.  Collapse
+*  array arr to one dimension and return the i'th point.
+
+      real arr(*), aorder
+      integer iindex
+
+      aorder = arr(iindex)
+
+      return
+      end
diff --git a/fer/efi/pt_in_poly.F b/fer/efi/pt_in_poly.F
new file mode 100644
index 0000000..9e19fde
--- /dev/null
+++ b/fer/efi/pt_in_poly.F
@@ -0,0 +1,566 @@
+*
+* pt_in_poly.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+** Ansley Manke
+* January 2008
+*
+* This function implements the pnpoly code from W. Randolph Franklin found
+* in his web pages. The exact code from these web pages is preserved at the end of
+* this file; changes to it are the responsibility of Ferret program developers.
+
+* Copyright (c) 1970-2003, Wm. Randolph Franklin
+*
+* Permission is hereby granted, free of charge, to any person obtaining a 
+* copy of this software and associated documentation files (the "Software"), 
+* to deal in the Software without restriction, including without limitation 
+* the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+* and/or sell copies of the Software, and to permit persons to whom the 
+* Software is furnished to do so, subject to the following conditions:
+
+*  1. Redistributions of source code must retain the above copyright notice, 
+* this list of conditions and the following disclaimers.
+*   2. Redistributions in binary form must reproduce the above copyright 
+* notice in the documentation and/or other materials provided with the 
+* distribution.
+*   3. The name of W. Randolph Franklin may not be used to endorse or 
+* promote products derived from this Software without specific prior 
+* written permission. 
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
+* IN THE SOFTWARE. 
+*
+C W. Randolph Franklin
+C http://www.ecse.rpi.edu/Homepages/wrf/pmwiki/
+C http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#The%20C%20Code
+C http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#Fortran%20Code%20for%20the%20Point%20in%20Polygon%20Test
+
+C  RETURNS:
+C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+
+***********************************************************************
+*  Initialize the function
+
+      SUBROUTINE pt_in_poly_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     . ('Return -1 outside, 0 if on edge, 1 if inside polygon')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Variable on the XY grid and region to be tested')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XVERT')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'X-coordinates of vertices of polygon')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YVERT')
+      CALL ef_set_arg_desc(id, arg, 
+     .   'Y-coordinates of vertices of polygon')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      RETURN 
+      END
+
+***********************************************************************
+
+* Request an amount of storage to be supplied by Ferret and passed
+* as additional arguments.
+
+      SUBROUTINE pt_in_poly_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+
+      INTEGER array_num, nx, ny, nv
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* These are going to be a double precision array, to contain axis 
+* coordinates so allocate 2* the size of the axes
+
+      nx = 2*( arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1 )
+      ny = 2*( arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1 )
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               nx, 1, 1, 1, 1, 1)
+
+      array_num = 2
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               ny, 1, 1, 1, 1, 1)
+
+* Set two arrays the size of the number of vertices.
+
+      nv = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 
+      nv = MAX(nv, arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1 )
+
+      array_num = 3
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               nv, 1, 1, 1, 1, 1)
+
+      array_num = 4
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               nv, 1, 1, 1, 1, 1)
+
+      RETURN 
+      END
+
+* **********************************************************************
+
+      SUBROUTINE pt_in_poly_compute (id, arg_1, arg_2, arg_3, result, 
+     .   xcoords, ycoords, workx, worky)
+C 
+C REMARKS 
+C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+C   OPTIONALLY BE INCREASED BY 1. 
+C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+C   
+C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+C   NONE 
+C 
+C METHOD 
+C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+C   POINT IS INSIDE OF THE POLYGON. 
+C 
+C .................................................................. 
+C 
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL*8 xcoords(wrk1lox:wrk1hix)
+      REAL*8 ycoords(wrk2lox:wrk2hix)
+      REAL workx(wrk3lox:wrk3hix)
+      REAL worky(wrk4lox:wrk4hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, ii, jj, iarg, inout, nv
+      REAL xvmin, xvmax, yvmin, yvmax, px, py
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* Get the x and y coordinates of the input variable
+
+      iarg = 1
+      CALL ef_get_coordinates (id, iarg, X_AXIS, 
+     .       arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xcoords)
+      CALL ef_get_coordinates (id, iarg, Y_AXIS, 
+     .       arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), ycoords)
+
+! Size of the list of polygon vertices
+
+      nv = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1 
+      nv = MAX(nv, arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1 )
+      nv = MAX(nv, arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1 )
+
+* Get the bounding box around the polygon. Do not check points if they are
+* outside this bounding box
+ 
+      xvmin = ABS( bad_flag(ARG3) )
+      xvmax = -1*xvmin
+      yvmin = ABS( bad_flag(ARG4) )
+      yvmax = -1*yvmin
+
+      CALL POLY_BOUND_BOX(arg_2, arg_3, nv, xvmin, xvmax, yvmin, yvmax)
+
+* Loop over all points, checking if they are inside or outside the polygon.
+
+      n = res_lo_ss(F_AXIS)
+      m = res_lo_ss(E_AXIS)
+      l = res_lo_ss(T_AXIS)
+      k = res_lo_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         py = ycoords(j1)
+
+         i1 = arg_lo_ss(X_AXIS,ARG1)
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            px = xcoords(i1) 
+
+            IF (px .GE. xvmin .AND. px .LE. xvmax .AND.
+     .          py .GE. yvmin .AND. py .LE. yvmax ) THEN
+               CALL PNPOLY (px, py, arg_2, arg_3, nv, 
+     .                      workx, worky, inout )
+               result(i,j,k,l,m,n)= FLOAT(inout)
+            ELSE
+               result(i,j,k,l,m,n) = -1
+            ENDIF
+
+            i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200  CONTINUE
+
+      RETURN 
+      END
+
+
+
+
+C .................................................................. 
+
+      SUBROUTINE POLY_BOUND_BOX (xv, yv, nv, xvmin, xvmax, yvmin, yvmax)
+
+* Get the bounding box around the polygon. min and max variables
+* have been initialized.
+
+      REAL xv(*), yv(*), xvmin, xvmax, yvmin, yvmax
+      INTEGER nv
+      INTEGER i
+
+      DO 50 i = 1, nv
+         xvmin = MIN(xvmin, xv(i))
+         xvmax = MAX(xvmax, xv(i))
+         yvmin = MIN(yvmin, yv(i))
+         yvmax = MAX(yvmax, yv(i))
+  50  CONTINUE
+
+      RETURN
+      END
+
+
+C .................................................................. 
+C 
+C SUBROUTINE PNPOLY 
+C 
+C PURPOSE 
+C   TO DETERMINE WHETHER A POINT IS INSIDE A POLYGON 
+C 
+C USAGE 
+C   CALL PNPOLY (PX, PY, XX, YY, N, workx, worky, INOUT ) 
+C 
+C DESCRIPTION OF THE PARAMETERS 
+C   PX    - X-COORDINATE OF POINT IN QUESTION. 
+C   PY    - Y-COORDINATE OF POINT IN QUESTION. 
+C   XX    - N LONG VECTOR CONTAINING X-COORDINATES OF 
+C           VERTICES OF POLYGON. 
+C   YY    - N LONG VECTOR CONTAING Y-COORDINATES OF 
+C           VERTICES OF POLYGON. 
+C   N     - NUMBER OF VERTICES IN THE POLYGON. 
+C   workx - work array
+C   worky - work array
+C   INOUT - THE SIGNAL RETURNED: 
+C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+C 
+C REMARKS 
+C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+C   OPTIONALLY BE INCREASED BY 1. 
+C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+C   
+C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+C   NONE 
+C 
+C METHOD 
+C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+C   POINT IS INSIDE OF THE POLYGON. 
+C 
+C .................................................................. 
+C 
+      SUBROUTINE PNPOLY(PX,PY,XX,YY,N,X,Y,INOUT) 
+      REAL PX,PY,X(*),Y(*),XX(*),YY(*) 
+      INTEGER N, INOUT
+
+      LOGICAL TM_FPEQ, MX,MY,NX,NY, b
+      INTEGER I, J, INOUT1, INOUT2
+      INOUT1 = 0
+      INOUT2 = 0
+
+* Change the original to see if X(J)=Y(J)=0. This loop finds matches 
+* for points on the left-hand edges 
+
+    6 DO 1 I=1,N 
+      X(I)=XX(I)-PX 
+    1 Y(I)=YY(I)-PY 
+      INOUT1=-1 
+      DO 2 I=1,N 
+      J=1+MOD(I,N) 
+      MX=X(I).GE.0.0 
+      NX=X(J).GE.0.0 
+      MY=Y(I).GE.0.0 
+      NY=Y(J).GE.0.0 
+
+      IF (TM_FPEQ(X(J),0.) .AND. TM_FPEQ(Y(J),0.)) GOTO 4
+
+      IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 2 
+      IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 3 
+      INOUT1=-INOUT1 
+      GO TO 2
+    3 CONTINUE
+      IF ( TM_FPEQ(X(J),Y(J)) ) THEN
+         IF(TM_FPEQ((Y(I)*X(J)-X(I)*Y(J)),0.)) THEN  
+            INOUT1 = 0
+            INOUT2 = 0
+            GOTO 50
+         ENDIF
+      ENDIF
+      IF( TM_FPEQ((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I)), 0.) ) GOTO 4
+      IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 2,4,5 
+    4 INOUT1 = 0
+      INOUT2 = 0
+      GOTO 50
+    5 INOUT1=-INOUT1 
+    2 CONTINUE 
+
+* Now do the same with the order of subtraction reversed when 
+* computing arrays X(I) and Y(I). This finds matches for points 
+* on the right-hand edges.
+
+      DO 11 I=1,N 
+      X(I)=PX-XX(I)
+   11 Y(I)=PY-YY(I) 
+      INOUT2=-1 
+      DO 12 I=1,N 
+      J=1+MOD(I,N) 
+      MX=X(I).GE.0.0 
+      NX=X(J).GE.0.0 
+      MY=Y(I).GE.0.0 
+      NY=Y(J).GE.0.0 
+
+      IF (TM_FPEQ(X(J),0.) .AND. TM_FPEQ(Y(J),0.)) GOTO 14
+
+      IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 12 
+      IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 13 
+      INOUT2=-INOUT2 
+      GO TO 12
+   13 CONTINUE
+      IF ( TM_FPEQ(X(J),Y(J)) ) THEN
+         IF(TM_FPEQ(Y(I)*X(J)-X(I)*Y(J), 0.)) THEN  
+            INOUT1 = 0
+            INOUT2 = 0
+            GOTO 50
+         ENDIF
+      ENDIF
+      IF( TM_FPEQ((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I)), 0.) ) GOTO 14
+      IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 12,14,15 
+   14 INOUT1 = 0
+      INOUT2 = 0
+      GOTO 50
+   15 INOUT2=-INOUT2 
+   12 CONTINUE 
+
+* Combine the results: -1 outside the polygon, 0 
+* on the edges or vertices, 1 inside the polygon.
+
+   50 CONTINUE
+      INOUT = (INOUT2 + INOUT1)/2
+      RETURN
+
+      END 
+
+*** ORIG  C >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+*** ORIG  C Here is the exact code from W. Randolph Franklin pages.
+*** ORIG  C Fortran Code for the Point in Polygon Test
+*** ORIG  
+*** ORIG  C>>>PNP1 
+*** ORIG  C 
+*** ORIG  C .................................................................. 
+*** ORIG  C 
+*** ORIG  C SUBROUTINE PNPOLY 
+*** ORIG  C 
+*** ORIG  C PURPOSE 
+*** ORIG  C   TO DETERMINE WHETHER A POINT IS INSIDE A POLYGON 
+*** ORIG  C 
+*** ORIG  C USAGE 
+*** ORIG  C   CALL PNPOLY (PX, PY, XX, YY, N, INOUT ) 
+*** ORIG  C 
+*** ORIG  C DESCRIPTION OF THE PARAMETERS 
+*** ORIG  C   PX    - X-COORDINATE OF POINT IN QUESTION. 
+*** ORIG  C   PY    - Y-COORDINATE OF POINT IN QUESTION. 
+*** ORIG  C   XX    - N LONG VECTOR CONTAINING X-COORDINATES OF 
+*** ORIG  C           VERTICES OF POLYGON. 
+*** ORIG  C   YY    - N LONG VECTOR CONTAING Y-COORDINATES OF 
+*** ORIG  C           VERTICES OF POLYGON. 
+*** ORIG  C   N     -  NUMBER OF VERTICES IN THE POLYGON. 
+*** ORIG  C   INOUT - THE SIGNAL RETURNED: 
+*** ORIG  C           -1 IF THE POINT IS OUTSIDE OF THE POLYGON, 
+*** ORIG  C            0 IF THE POINT IS ON AN EDGE OR AT A VERTEX, 
+*** ORIG  C            1 IF THE POINT IS INSIDE OF THE POLYGON. 
+*** ORIG  C 
+*** ORIG  C REMARKS 
+*** ORIG  C   THE VERTICES MAY BE LISTED CLOCKWISE OR ANTICLOCKWISE. 
+*** ORIG  C   THE FIRST MAY OPTIONALLY BE REPEATED, IF SO N MAY 
+*** ORIG  C   OPTIONALLY BE INCREASED BY 1. 
+*** ORIG  C   THE INPUT POLYGON MAY BE A COMPOUND POLYGON CONSISTING 
+*** ORIG  C   OF SEVERAL SEPARATE SUBPOLYGONS. IF SO, THE FIRST VERTEX 
+*** ORIG  C   OF EACH SUBPOLYGON MUST BE REPEATED, AND WHEN CALCULATING 
+*** ORIG  C   N, THESE FIRST VERTICES MUST BE COUNTED TWICE. 
+*** ORIG  C   INOUT IS THE ONLY PARAMETER WHOSE VALUE IS CHANGED. 
+*** ORIG  C   THE SIZE OF THE ARRAYS MUST BE INCREASED IF N > MAXDIM 
+*** ORIG  C   WRITTEN BY RANDOLPH FRANKLIN, UNIVERSITY OF OTTAWA, 7/70. 
+*** ORIG  C   
+*** ORIG  C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED 
+*** ORIG  C   NONE 
+*** ORIG  C 
+*** ORIG  C METHOD 
+*** ORIG  C   A VERTICAL LINE IS DRAWN THRU THE POINT IN QUESTION. IF IT 
+*** ORIG  C   CROSSES THE POLYGON AN ODD NUMBER OF TIMES, THEN THE 
+*** ORIG  C   POINT IS INSIDE OF THE POLYGON. 
+*** ORIG  C 
+*** ORIG  C .................................................................. 
+*** ORIG  C 
+*** ORIG        SUBROUTINE PNPOLY(PX,PY,XX,YY,N,INOUT) 
+*** ORIG        REAL X(200),Y(200),XX(N),YY(N) 
+*** ORIG        LOGICAL MX,MY,NX,NY 
+*** ORIG        INTEGER O 
+*** ORIG  
+*** ORIG  C OUTPUT UNIT FOR PRINTED MESSAGES 
+*** ORIG        DATA O/6/ 
+*** ORIG        MAXDIM=200 
+*** ORIG        IF(N.LE.MAXDIM)GO TO 6 
+*** ORIG        WRITE(O,7)  
+*** ORIG      7 FORMAT('0WARNING:',I5,' TOO GREAT FOR THIS VERSION OF pt_in_poly. 
+*** ORIG       1 RESULTS INVALID')
+*** ORIG        RETURN
+*** ORIG      6 DO 1 I=1,N 
+*** ORIG        X(I)=XX(I)-PX 
+*** ORIG      1 Y(I)=YY(I)-PY 
+*** ORIG        INOUT=-1 
+*** ORIG        DO 2 I=1,N 
+*** ORIG        J=1+MOD(I,N) 
+*** ORIG        MX=X(I).GE.0.0 
+*** ORIG        NX=X(J).GE.0.0 
+*** ORIG        MY=Y(I).GE.0.0 
+*** ORIG        NY=Y(J).GE.0.0 
+*** ORIG        IF(.NOT.((MY.OR.NY).AND.(MX.OR.NX)).OR.(MX.AND.NX)) GO TO 2 
+*** ORIG        IF(.NOT.(MY.AND.NY.AND.(MX.OR.NX).AND..NOT.(MX.AND.NX))) GO TO 3 
+*** ORIG        INOUT=-INOUT 
+*** ORIG        GO TO 2
+*** ORIG      3 IF((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) 2,4,5 
+*** ORIG      4 INOUT=0   
+*** ORIG        RETURN 
+*** ORIG      5 INOUT=-INOUT 
+*** ORIG      2 CONTINUE 
+*** ORIG        RETURN 
+*** ORIG        END 
diff --git a/fer/efi/rect_to_curv.F b/fer/efi/rect_to_curv.F
new file mode 100644
index 0000000..281421b
--- /dev/null
+++ b/fer/efi/rect_to_curv.F
@@ -0,0 +1,1048 @@
+! rect_to_curv.F
+! 
+! renamed from hinterp_bilinear.F  
+! From Matt Harrison hinterp.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+! to CALL only the bilinear interpolation modules, and
+! recast in F77-compileable code.
+! ACM 3/2004
+!
+! mjh at gfdl.gov
+! 2/20/2003
+!  
+! 11/19/2007 fix bug 1553 looping over k,l
+! 
+! In this subroutine we provide information about
+! the function.  The user configurable information 
+! consists of the following:
+!
+! descr              Text description of the function
+!
+! num_args           Required number of arguments
+!
+! axis_inheritance   Type of axis for the result
+!                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+!                       CUSTOM          - user defined axis
+!                       IMPLIED_BY_ARGS - same axis as the incoming argument
+!                       NORMAL          - the result is normal to this axis
+!                       ABSTRACT        - an axis which only has index values
+!
+! piecemeal_ok       For memory optimization:
+!                       axes where calculation may be performed piecemeal
+!                       ( YES, NO )
+! 
+!
+! For each argument we provide the following information:
+!
+! name               Text name for an argument
+!
+! unit               Text units for an argument
+!
+! desc               Text description of an argument
+!
+! axis_influence     Are this argument's axes the same as the result grid?
+!                       ( YES, NO )
+!
+! axis_extend       How much does Ferret need to extend arg limits relative to result 
+!
+
+
+      SUBROUTINE rect_to_curv_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER   id, arg
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      CHARACTER*100  descr
+
+      CALL ef_set_desc(id,
+     .  'Regrid from rectangular to curvilinear grid')
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_num_work_arrays(id, 8)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     ,  'variable V(x,y,z,t,e,f) on rectilinear grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'lon_bounds_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Destination curvilinear grid longitude bounds(2-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'lat_bounds_out')
+      CALL ef_set_arg_unit(id, arg, 'degrees')
+      CALL ef_set_arg_desc(id, arg, 
+     .  'Destination curvilinear grid latitude bounds(2-D)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'missing_allowed')
+      WRITE (descr, 20)
+   20 FORMAT ('number of missing values allowed in four ',
+     .        'surrounding source cells: 0 to 3')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!***********************************************************************
+
+      RETURN 
+      END  ! subroutine rect_to_curv_init
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE rect_to_curv_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER array_num, nx, ny
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*   real wti(nlon_dst,nlat_dst,2)      
+*   weights for bilinear interpolation 
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 2, 1, 1, 1)
+     
+*  real wtj(nlon_dst,nlat_dst,2)      
+*  weights for bilinear interpolation 
+
+      array_num = 2
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 2, 1, 1, 1)
+
+*  real*8 in_lon_lat(max(nlat_src+1, nlon_src+1), 2) 
+*  edges of x,y input axes, will be declared real*8
+      array_num = 3
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 2
+      nx = MAX(nx,ny)
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             2*nx, 4, 1, 1, 1, 1)
+
+*  real rad_lon_lat(max(nlat_src+1, nlon_src+1), 2) 
+*  edges of input axes, will be declared real, converted to radians
+
+      array_num = 4
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               nx, 2, 1, 1, 1, 1)
+
+*  real out_lon(nlon_dst, nlat_dst)  
+*  edges of output longitude grid, will be converted to radians
+
+      array_num = 5
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1,  1, 1, 1, 1, 1,
+     .                               nx, ny, 1, 1, 1, 1)
+
+*  real out_lat(nlon_dst, nlat_dst)      
+*  edges of output latitude grid, will be converted to radians
+
+      array_num = 6
+      nx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                                1,  1, 1, 1, 1, 1,
+     .                               nx, ny, 1, 1, 1, 1)
+
+*  integer i_lon(nlon_dst,nlat_dst,2) 
+* indices for bilinear interpolation 
+* These will be declared integer inside the compute routine
+
+      array_num = 7
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 2, 1, 1, 1)
+
+*  integer j_lat(nlon_dst,nlat_dst,2) 
+*  indices for bilinear interpolation 
+*  These will be declared integer inside the compute routine
+
+      array_num = 8
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .     arg_lo_ss(X_AXIS,ARG3), arg_lo_ss(Y_AXIS,ARG3), 1, 1, 1, 1,
+     .     arg_hi_ss(X_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3), 2, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+!
+! In this subroutine we compute the result
+!
+      SUBROUTINE rect_to_curv_compute(id, arg_1, arg_2, arg_3, 
+     .          arg_4, result, wti, wtj, in_lon_lat,
+     .          rad_lon_lat, out_lon, out_lat, i_lon, j_lat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL wti(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .         wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .         wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL wtj(wrk2lox:wrk2hix, wrk2loy:wrk2hiy,
+     .         wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .         wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL*8 in_lon_lat(wrk3lox:wrk3hix/2, wrk3loy:wrk3hiy,
+     .                  wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .                  wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL rad_lon_lat(wrk4lox:wrk4hix, wrk4loy:wrk4hiy,
+     .                 wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .                 wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL out_lon(wrk5lox:wrk5hix, wrk5loy:wrk5hiy,
+     .             wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .             wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL out_lat(wrk6lox:wrk6hix, wrk6loy:wrk6hiy,
+     .             wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .             wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+      INTEGER i_lon(wrk7lox:wrk7hix, wrk7loy:wrk7hiy,
+     .              wrk7loz:wrk7hiz, wrk7lot:wrk7hit,
+     .              wrk7loe:wrk7hie, wrk7lof:wrk7hif)
+      INTEGER j_lat(wrk8lox:wrk8hix, wrk8loy:wrk8hiy,
+     .              wrk8loz:wrk8hiz, wrk8lot:wrk8hit,
+     .              wrk8loe:wrk8hie, wrk8lof:wrk8hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+!**********************************************************************
+!                                           USER CONFIGURABLE PORTION |
+!                                                                     |
+!                                                                     V
+
+      INTEGER  idim, i, j, k, l, m, n, verbose
+      INTEGER  i1, j1, k1, l1, m1, n1, nx, ny,
+     .         nlon_src, nlat_src, nlon_dst, nlat_dst
+      REAL missing_permit, pi, pi180
+      CHARACTER*16 axname(6), ax_units(6) 
+      LOGICAL back(6), modulo(6), reg(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id,bad_flag,bad_flag_result)
+
+! Get edges of coordinate boxes on input axes.  Convert to radians.
+
+      pi =  4.*ATAN(1.)
+      pi180 = pi/ 180.
+
+      CALL ef_get_box_limits(id, ARG1, X_AXIS,
+     .                       arg_lo_ss(X_AXIS, ARG1), 
+     .                       arg_hi_ss(X_AXIS, ARG1), 
+     .                       in_lon_lat(1,1,1,1,1,1),
+     .                       in_lon_lat(1,3,1,1,1,1))
+
+! last box upper limit
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      in_lon_lat(nx+1,1,1,1,1,1) = in_lon_lat(nx,3,1,1,1,1)
+
+c      idim = 1
+c      CALL EF_GET_COORDINATES (id, arg, idim,
+c     .     arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)+1, 
+c     .     in_lon_lat(1,1,1,1) )
+
+! Transform degrees to radians
+
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2
+      DO i = 1, nx
+        rad_lon_lat(i,1,1,1,1,1) = pi180 * in_lon_lat(i,1,1,1,1,1)
+      ENDDO
+
+      CALL ef_get_box_limits(id, ARG1, Y_AXIS,
+     .                       arg_lo_ss(Y_AXIS, ARG1), 
+     .                       arg_hi_ss(Y_AXIS, ARG1), 
+     .                       in_lon_lat(1,2,1,1,1,1),
+     .                       in_lon_lat(1,4,1,1,1,1))
+
+! last box upper limit
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      in_lon_lat(ny+1,2,1,1,1,1) = in_lon_lat(ny,4,1,1,1,1)
+
+c      idim = 2
+c      CALL EF_GET_COORDINATES (id, arg, idim,
+c     .     arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)+1, 
+c     .     in_lon_lat(1,2,1,1) )
+
+! Transform degrees to radians
+
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 2
+      DO i = 1, ny
+        rad_lon_lat(i,2,1,1,1,1) = pi180 * in_lon_lat(i,2,1,1,1,1)
+      ENDDO
+
+      n = arg_lo_ss(F_AXIS,ARG2)
+      m = arg_lo_ss(E_AXIS,ARG2)
+      l = arg_lo_ss(T_AXIS,ARG2)
+      k = arg_lo_ss(Z_AXIS,ARG2)
+      DO j = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+         DO i = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+            out_lon(i,j,1,1,1,1) = pi180 * arg_2(i,j,k,l,m,n)
+         ENDDO
+      ENDDO
+
+      n = arg_lo_ss(F_AXIS,ARG3)
+      m = arg_lo_ss(E_AXIS,ARG3)
+      l = arg_lo_ss(T_AXIS,ARG3)
+      k = arg_lo_ss(Z_AXIS,ARG3)
+      DO j = arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3)
+         DO i = arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+            out_lat(i,j,1,1,1,1) = pi180 * arg_3(i,j,k,l,m,n)
+         ENDDO
+      ENDDO
+
+      CALL ef_get_axis_info_6d(id,ARG1,axname,ax_units,back,modulo,reg)
+
+! Number of missing cells to allow (0 to 3)
+
+      CALL ef_get_one_val (id, ARG4, missing_permit)
+      IF (missing_permit .LT. 0 .OR. missing_permit .GT. 3) 
+     .    CALL ef_bail_out (id, 'argument 6 must be between 0 and 3')
+
+! nlon_src and nlat_src without the extra element for upper grid box (why?)
+
+      nlon_src = nx-1
+      nlat_src = ny-1
+      nlon_dst = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nlat_dst = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+
+      verbose = 0
+      CALL horiz_interp_init_bili (id, wti, wtj, i_lon, j_lat,
+     .           nlon_src, nlat_src, nlon_dst, nlat_dst,
+     .           rad_lon_lat(1,1,1,1,1,1), rad_lon_lat(1,2,1,1,1,1),
+     .           out_lon, out_lat, verbose, modulo(1) )
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO n = res_lo_ss(F_AXIS),res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO m = res_lo_ss(E_AXIS),res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO l = res_lo_ss(T_AXIS),res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            CALL horiz_interp_bili ( wti, wtj, i_lon, j_lat,
+     .                 nlon_src, nlat_src, nlon_dst, nlat_dst,
+     .                 arg_1(i1,j1,k1,l1,m1,n1), result(i,j,k,l,m,n),
+     .                 verbose, bad_flag(ARG1), bad_flag_result,
+     .                 missing_permit)
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+         ENDDO
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+      ENDDO
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+      ENDDO
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+      ENDDO
+
+!                                                                     ^
+!                                                                     |
+!                                           USER CONFIGURABLE PORTION |
+!**********************************************************************
+
+      RETURN 
+      END  ! subroutine rect_to_curv_compute
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+*    horiz_interp_init_bili
+
+! From module hinterp_subs_mod
+
+
+! <CONTACT EMAIL='bw at gfdl.noaa.gov'>
+!   Bruce Wyman
+! </CONTACT>
+
+! <HISTORY SRC='http://www.gfdl.noaa.gov/fms-cgi-bin/cvsweb.cgi/FMS/'/>
+
+! <OVERVIEW>
+!   Performs spatial interpolation between grids.
+! </OVERVIEW>
+
+! <DESCRIPTION>
+!     This module can interpolate data from rectangular/tripolar grid
+!     to rectangular/tripolar grid. Three interpolation schems are used here.
+!     when the source grid is tripolar grid, inverse of square distance weighted
+!     scheme (spherical regrid) is used. When the source grid is rectangular 
+!     longitude/latitude grid, any one of following three schemes can be applied: 
+!     conservation scheme that conserves the area-weighed integral of the input field, 
+!     bilinear interpolation that use the surround four source grid to interpolate onto
+!     the destination grid, spherical regrid that use thes inverse of square distance
+!     as weight. User can choose the interpolation method in the horiz_interp_init.
+!     when the source grid is rectangular grid (1D), the default method is conserve
+!     scheme. When the source grid is tripolar grid (2D), spherical regrid is the 
+!     default algorithm and no other scheme can be applied. 
+
+!     There is an optional mask field for missing input data.
+!     An optional output mask field may be used in conjunction with
+!     the input mask to show where output data exists.
+! </DESCRIPTION>
+
+!-----------------------------------------------------------------------
+!
+!        Performs spatial interpolation between grids.
+!
+!-----------------------------------------------------------------------
+
+      
+
+
+!---- interfaces ----
+
+
+
+! <INTERFACE NAME='horiz_interp_init'>
+!   <OVERVIEW>
+!      Allocates space and initializes a derived-type variable
+!      that contains pre-computed interpolation indices and weights.
+!   </OVERVIEW>
+!   <DESCRIPTION>
+!      Allocates space and initializes a derived-type variable
+!      that contains pre-computed interpolation indices and weights
+!      for improved performance of multiple interpolations between
+!      the same grids. This routine does not need to be called if you
+!      are doing a single grid-to-grid interpolation.
+!   </DESCRIPTION>
+!   <IN NAME='lon_in' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians'>
+!      Longitude (in radians) for source data grid. when lon_in is 1D, it is the longitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lon_in is 2D, there are two cases: one is the longitude edges stored as
+!      pairs for each grid box (when interp_method is 1(conservative)), the other is the longitude
+!      of the center of each grid box. 
+!   </IN>
+!   <IN NAME='lat_in' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians'>
+!      Latitude (in radians) for source data grid. when lat_in is 1D, it is the latitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lat_in is 2D, it is the longitude of the center of each grid box.
+!      When interp_method is 1(conservative) or 2(bilinear), lon_in should be 1D.
+!   </IN>
+!   <IN NAME='lon_out' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians' >
+!      Longitude (in radians) for source data grid. when lon_in is 1D, it is the longitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lon_in is 2D, there are two cases: one is the longitude edges stored as
+!      pairs for each grid box (when interp_method is 1), the other is the longitude
+!      of the center of each grid box (when interp_method is 2). 
+!   </IN>
+!   <IN NAME='lat_out' TYPE='real' DIM='dimension(:), dimension(:,:)' UNITS='radians' >
+!      Latitude (in radians) for source data grid. when lat_in is 1D, it is the latitude
+!      edges and its value are for adjacent grid boxes and must increase 
+!      in value. When lat_in is 2D, there are two cases: one is the latitude edges stored as
+!      pairs for each grid box (when interp_method is 1), the other is the latitude
+!      of the center of each grid box (when interp_method is 2).
+!   </IN>
+!   <IN NAME='verbose' TYPE='integer'>
+!      Integer flag that controls the amount of printed output.
+!      verbose = 0, no output; = 1, min,max,means; = 2, still more
+!   </IN>
+!   <IN NAME='interp_method' TYPE='integer'> 
+!      interpolation method, = 1, using conservation scheme,
+!      = 2, using bilinear interpolation, = SPHERICA(3),using spherical regrid.
+!      when source grid is 1d, default value is CONSERVE; when source grid is 2d,
+!      default value is 'SPHERICA'.
+!   </IN>
+!   <IN NAME = 'src_modulo' >
+!      Indicate the source data grid is cyclic or not.
+!   </IN>
+!   <OUT NAME='Interp' >
+!      A derived-type variable containing indices and weights used for subsequent 
+!      interpolations. To reinitialize this variable for a different grid-to-grid 
+!      interpolation you must first use the 'horiz_interp_end' interface.
+!   </OUT>
+
+
+! </INTERFACE>
+
+
+C      real wti(nlon_dst,nlon_dst,2)      !weights for bilinear interpolation 
+C      real wtj(nlat_dst,nlat_dst,2)
+C      integer i_lon(nlon_dst,nlon_dst,2) !indices for bilinear interpolation 
+C      integer j_lat(nlat_dst,nlat_dst,2)
+C      integer nlon_src, nlat_src         !size of source grid
+C      integer nlon_dst, nlat_dst         !size of destination grid
+C      integer interp_method              !interpolation method.
+                                         !  =1, conservative scheme
+                                         !  =2, bilinear interpolation
+                                         !  =3, spherical regrid
+
+
+C Interp list:
+C wti, wtj, i_lon, j_lat, nlon_src, nlat_src, nlon_dst, nlat_dst
+
+C Interp allocation from subroutine horiz_interp_init_bili 
+
+      subroutine horiz_interp_init_bili (id, wti, wtj, i_lon, j_lat,  
+     .                 nlon_src, nlat_src, nlon_dst, nlat_dst, lon_in,
+     .                 lat_in, lon_out, lat_out, verbose, src_modulo )
+
+!-----------------------------------------------------------------------
+C inputs
+C  From type horiz_interp_type, variable Interp
+
+
+      real wti(nlon_dst,nlat_dst,2)      !weights for bilinear interpolation 
+      real wtj(nlon_dst,nlat_dst,2)
+      integer i_lon(nlon_dst,nlat_dst,2) !indices for bilinear interpolation 
+      integer j_lat(nlon_dst,nlat_dst,2)
+      integer nlon_src, nlat_src         !size of source grid
+      integer nlon_dst, nlat_dst         !size of destination grid
+
+C Other inputs
+
+      real lon_in(*) , lat_in(*)
+      real lon_out(nlon_dst,nlat_dst), lat_out(nlon_dst,nlat_dst)
+      integer id, verbose
+      logical src_modulo
+!-----------------------------------------------------------------------
+C  Other declarations
+
+      integer INDP, nlon_in, nlat_in, nlon_out, nlat_out, n, m,
+     .   i, j, ie, is, je, js, istart, jstart, iend, jend, 
+     .   ln_err, lt_err, na, warns
+      real wtw, wte, wts, wtn, lon, lat, pi, tpi, hpi,      
+     .   glt_min, glt_max, gln_min, gln_max, min_lon, max_lon
+
+! parameters
+      real epsln, large
+      integer stdout 
+      parameter (epsln=1.e-10, large=1.e20, stdout = 6)
+
+      pi  =  3.14159265358979323846 
+      hpi = 0.5*pi
+      tpi = 4.0*hpi
+      glt_min = hpi
+      glt_max = -hpi
+      gln_min = tpi
+      gln_max = -tpi
+      min_lon = 0.0
+      max_lon = tpi
+      ln_err = 0
+      lt_err = 0
+
+      warns = verbose
+
+      nlon_in = nlon_src  
+      nlat_in = nlat_src
+      nlon_out = nlon_dst
+      nlat_out = nlat_dst
+
+      if(lon_in(nlon_in) - lon_in(1) .gt. tpi + epsln) 
+     . call ef_bail_out (id, 
+     . 'The range of source grid longitude may be no larger than tpi')
+
+      if(lon_in(1) .lt. 0.0) then
+        min_lon = lon_in(1)
+        max_lon = lon_in(nlon_in)
+      endif
+
+!     find longitude points of data within interval [-360., 360.]
+      istart = 1
+      do i=2,nlon_in
+        if (lon_in(i-1) .lt. -tpi .and. lon_in(i) .ge. -tpi) istart = i
+      enddo 
+      iend = nlon_in
+      do i=2,nlon_in
+        if (lon_in(i-1) .lt. tpi  .and. lon_in(i) .ge. tpi) iend = i
+      enddo
+
+!     find latitude points of data within interval [-90., 90.]
+      jstart = 1
+      do j=2,nlat_in
+        if (lat_in(j-1) .lt. -1.0 * hpi .and. 
+     .      lat_in(j  ) .ge. -1.0 * hpi) jstart = j
+      enddo 
+      jend = nlat_in
+      do j=2,nlat_in
+        if (lat_in(j-1) .lt. hpi .and. lat_in(j) .ge.hpi ) jend = j
+      enddo
+
+      do n = 1, nlat_out
+      do m = 1, nlon_out
+        lon = lon_out(m,n)
+        lat = lat_out(m,n)
+
+        if(lon .lt. min_lon) then
+         lon = lon + tpi
+        else if(lon .gt. max_lon) then
+         lon = lon - tpi
+        endif
+! when the input grid is in not cyclic, the output grid should located inside
+! the input grid
+      if(.not. src_modulo) then
+        if((lon .lt. lon_in(1)) .or. (lon .gt. lon_in(nlon_in))) 
+     .   call ef_bail_out(id, 
+     .'input grid not modulo, output grid must be inside input grid')
+
+
+      endif
+
+      glt_min = min(lat,glt_min)
+      glt_max = max(lat,glt_max)
+      gln_min = min(lon,gln_min)
+      gln_max = max(lon,gln_max)
+
+      na = iend - istart + 1
+      is = INDP(lon, lon_in(istart), na ) + istart - 1
+      if( lon_in(is) .gt. lon ) is = max(is - 1,istart)
+      if( lon_in(is) .eq. lon .and. is .eq. nlon_in) 
+     .      is = max(is - 1,istart)
+      ie = min(is+1,iend)
+      if(lon_in(is) .ne. lon_in(ie) .and. lon_in(is) .le. lon) then
+        wtw = ( lon_in(ie) - lon) / (lon_in(ie) - lon_in(is) )
+      else
+! east or west of the last data value. this could be because a
+! cyclic condition is needed or the dataset is too small. 
+        ln_err = 1
+        ie = istart
+        is = iend
+        if (lon_in(ie) .ge. lon ) then
+           wtw = (lon_in(ie) -lon)/(lon_in(ie)-lon_in(is)+tpi+epsln)
+        else
+          wtw = (lon_in(ie) -lon+tpi+epsln)/
+     .          (lon_in(ie)-lon_in(is)+tpi+epsln)
+        endif   
+      endif
+      wte = 1. - wtw
+
+      na = jend - jstart + 1
+      js = INDP(lat, lat_in(jstart), na ) + jstart - 1
+
+      if( lat_in(js) .gt. lat ) js = max(js - 1, jstart)
+      if( lat_in(js) .eq. lat .and. js .eq. jend) 
+     .     js = max(js - 1, jstart)
+      je = min(js + 1, jend)
+
+      if ( lat_in(js) .ne. lat_in(je) .and. lat_in(js) .le. lat) then
+        wts = ( lat_in(je) - lat )/(lat_in(je)-lat_in(js))
+      else
+!     north or south of the last data value. this could be because a
+!     pole is not included in the data set or the dataset is too small.
+!     in either case extrapolate north or south
+         lt_err = 1
+         wts = 1.
+      endif
+
+      wtn = 1. - wts
+      
+            i_lon (m,n,1) = is
+            i_lon (m,n,2) = ie
+            j_lat (m,n,1) = js
+            j_lat (m,n,2) = je
+            wti   (m,n,1) = wtw
+            wti   (m,n,2) = wte
+            wtj   (m,n,1) = wts
+            wtj   (m,n,2) = wtn
+      
+      enddo
+      enddo
+      if (ln_err .eq. 1 .and. warns .GT. 0) then
+        write (stdout,'(/,(1x,a))') 
+     . '==> Warning: the geographic data set does not extend far   ', 
+     . '             enough east or west - a cyclic boundary       ', 
+     . '             condition was applied. check if appropriate   '
+         write (stdout,'(/,(1x,a,2f8.4))') 
+     . '    data required between longitudes:', gln_min, gln_max,     
+     . '    data set is between longitudes:', 
+     .   lon_in(istart), lon_in(iend)
+         warns = warns - 1
+       endif
+!
+       if (lt_err .eq. 1 .and. warns .GT. 0) then
+         write (stdout,'(/,(1x,a))')
+     . '==> Warning: the geographic data set does not extend far   ',
+     . '             enough north or south - extrapolation from    ',
+     . '             the nearest data was applied. this may create ',
+     . '             artificial gradients near a geographic pole   ' 
+         write (stdout,'(/,(1x,a,2f8.4))')
+     . '    data required between latitudes:', glt_min, glt_max,
+     . '      data set is between latitudes:', 
+     .   lat_in(jstart), lat_in(jend)
+         warns = warns - 1
+       endif
+
+       return
+
+      end ! subroutine horiz_interp_init_bili
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+      subroutine horiz_interp_bili ( wti, wtj, i_lon, j_lat,  
+     .                    nlon_src, nlat_src, nlon_dst, nlat_dst, 
+     .                    data_in, data_out, verbose, missing_value,
+     .                    missing_result, missing_permit)
+!-----------------------------------------------------------------------
+
+
+!-----------------------------------------------------------------------
+C  From type horiz_interp_type, variable Interp
+
+      real wti(nlon_dst,nlat_dst,2)      !weights for bilinear interpolation 
+      real wtj(nlon_dst,nlat_dst,2)
+      integer i_lon(nlon_dst,nlat_dst,2) !indices for bilinear interpolation 
+      integer j_lat(nlon_dst,nlat_dst,2)
+      integer nlon_src, nlat_src         !size of source grid
+      integer nlon_dst, nlat_dst         !size of destination grid
+
+      real data_in(nlon_src, nlat_src)   ! input
+      real data_out(nlon_dst, nlat_dst)  ! output
+      integer verbose
+      real missing_value                 ! missing flag of input
+      real missing_result                ! missing flag for result
+      real missing_permit                ! Number of missing cells to allow
+!-----------------------------------------------------------------------
+      integer nlon_in, nlat_in, nlon_out, nlat_out, n, m,
+     .            is, ie, js, je, iverbose, num_missing, 
+     .            miss_in, miss_out
+      real  dwtsum, wtsum, min_in, max_in, avg_in, 
+     .            min_out, max_out, avg_out, wtw, wte, wts, wtn
+      real data(4)
+
+! parameters
+      real epsln, large
+      parameter (epsln=1.e-10, large=1.e20)
+
+      nlon_in  = nlon_src
+      nlat_in  = nlat_src
+      nlon_out = nlon_dst
+      nlat_out = nlat_dst
+
+      iverbose = verbose
+
+      do n = 1, nlat_out
+      do m = 1, nlon_out
+      data_out(m,n) = 0.0
+
+      is = i_lon (m,n,1) 
+      ie = i_lon (m,n,2)
+      js = j_lat (m,n,1)
+      je = j_lat (m,n,2)
+      wtw = wti(m,n,1)
+      wte = wti(m,n,2)
+      wts = wtj(m,n,1)
+      wtn = wtj(m,n,2)
+      data(1) = data_in(is,js)
+      data(2) = data_in(ie,js)
+      data(3) = data_in(ie,je)
+      data(4) = data_in(is,je)
+
+      call data_sum_bilinear ( data, wtw,wte, wts,wtn, dwtsum, wtsum, 
+     .   num_missing, missing_value)
+
+      if (num_missing .gt. missing_permit .or. wtsum .lt. epsln) then
+        data_out(m,n) = missing_result
+      else
+        data_out(m,n) = dwtsum/wtsum
+      endif
+      enddo
+      enddo
+
+!***********************************************************************
+! compute statistics: minimum, maximum, and mean
+!-----------------------------------------------------------------------
+
+!!      if (iverbose .GT. 0) then
+!!
+!!! compute statistics of input data
+!!
+!!       call stats_type2 (data_in, min_in, max_in, avg_in, 
+!!   .           miss_in, missing_value)
+!!
+!!! compute statistics of output data
+!!       call stats_type2 (data_out, min_out, max_out, avg_out, 
+!!   .          miss_out, missing_value)
+!!
+!!!---- output statistics ----
+!!! root_pe have the information of global mean, min and max
+!!
+!!       write (*,900)
+!!       write (*,901)  min_in ,max_in, avg_in
+!!         write (*,903)  miss_in
+!!         write (*,902)  min_out,max_out,avg_out
+!!         write (*,903)  miss_out
+!! 900     format (/,1x,10('-'),' output from horiz_interp ',10('-'))
+!! 901     format ('  input:  min=',f16.9,'  max=',f16.9,'  avg=',f22.15)
+!! 902     format (' output:  min=',f16.9,'  max=',f16.9,'  avg=',f22.15)
+!! 903     format ('          number of missing points = ',i6)
+!!
+!!      endif
+
+
+      return
+
+      end ! subroutine horiz_interp_bili
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+       integer function INDP (value, array, ia)
+       real array(*)
+       real value
+       integer ia
+!
+!=======================================================================
+!
+!     INDP = index of nearest data point within "array" corresponding to
+!            "value".
+
+!     inputs:
+!     value  = arbitrary data...same units as elements in "array"
+!     array  = array of data points  (must be monotonically increasing)
+
+!     output:
+!     INDP =  index of nearest data point to "value"
+!             if "value" is outside the domain of "array" then INDP = 1
+!             or "ia" depending on whether array(1) or array(ia) is
+!             closest to "value"
+!=======================================================================
+!
+       integer i
+       logical keep_going
+!
+       do i=2,ia
+         if (array(i) .lt. array(i-1)) then
+         write (6,*) 
+     .   ' => Error: array must be monotonically increasing in "INDP"', 
+     .   '          when searching for nearest element to value=',value
+         write (6,*) '           array(i) < array(i-1) for i=',i 
+         write (6,*) '           array(i) for i=1..ia follows:'
+         stop
+        endif
+      enddo
+      if (value .lt. array(1) .or. value .gt. array(ia)) then
+        if (value .lt. array(1))  INDP = 1
+        if (value .gt. array(ia)) INDP = ia
+      else
+        i=1
+        keep_going = .true.
+        do while (i .le. ia .and. keep_going)
+          i = i+1
+          if (value .le. array(i)) then
+            INDP = i
+            if (array(i)-value .gt. value-array(i-1)) INDP = i-1
+            keep_going = .false.
+          endif
+        enddo
+      endif
+      return
+      end ! function INDP
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+      subroutine data_sum_bilinear ( data, wtw, wte, wts, wtn, 
+     .                               dwtsum, wtsum, num_missing,
+     .                               missing_value  )
+
+!  sums up the data and weights for a single output grid box
+!-----------------------------------------------------------------------
+      real data(*)
+      real wtw, wte, wts, wtn
+      real dwtsum, wtsum
+      integer num_missing
+      real missing_value
+
+!  dwtsum = sum(data*wt*mask)
+!  wtsum  = sum(wt*mask)
+
+      integer i
+      real wt1, wt2
+!-----------------------------------------------------------------------
+
+
+      num_missing = 0
+      dwtsum = 0.0
+      wtsum  = 0.0
+
+      do i = 1,4
+      if(data(i) .eq. missing_value) then
+         num_missing = num_missing + 1
+      else
+         if (i .eq. 1) then
+            wt1= wtw
+            wt2 = wts
+         else if (i .eq. 2) then
+            wt1= wte
+            wt2 = wts
+         else if (i .eq. 3) then
+            wt1= wte
+            wt2 = wtn
+         else if (i  .eq. 4) then
+            wt1= wtw 
+            wt2 = wtn
+         endif
+
+         dwtsum = dwtsum + data(i) * wt1 * wt2
+         wtsum  = wtsum + wt1 * wt2
+      endif
+      enddo
+
+      return
+      end ! subroutine data_sum_bilinear
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+!---This statistics is for bilinear interpolation and spherical regrid.
+
+!!      subroutine stats_type2 ( dat, low, high, avg, miss, missing_value,
+!!     .  nlon, nlat)
+!!
+!!      real dat(nlon,nlat)
+!!      real low, high, avg  ! output
+!!      integer miss         ! output
+!!      real  missing_value  ! input
+!!      integer nlon, nlat   ! input
+!!
+!!
+!!      real dsum, npts
+!!      integer n, m
+!!
+!!      dsum = 0.0
+!!      miss = 0
+!!      npts = 0
+!!
+!!      do n = 1, nlat
+!!      do m = 1, nlon
+!!      IF (dat(m,n) .NE. missing_value) THEN
+!!         npts = npts + 1
+!!         low = MIN( low, dat(m,n) )
+!!         high = MAX (high, dat(m,n) )
+!!         dsum = dsum + dat(m,n)
+!!      ELSE
+!!         miss = miss + 1
+!!      ENDIF
+!!      ENDDO
+!!      ENDDO
+!!
+!!      if(npts .EQ. 0) then
+!!         avg = missing_value
+!!      else
+!!         avg = dsum/real(npts)
+!!      endif
+!!   
+!!      return
+!!
+!!      end  ! subroutine stats_type2
+
+
+* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/fer/efi/samplei_multi.F b/fer/efi/samplei_multi.F
new file mode 100644
index 0000000..569f86e
--- /dev/null
+++ b/fer/efi/samplei_multi.F
@@ -0,0 +1,259 @@
+*
+* samplei_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the I axis using a set of indices
+* which may be different for the j,k,L dimensions.
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplei_multi_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to I indices which ',
+     . 'may vary in JKL')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, ABSTRACT, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'I_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'indices upon which to sample')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using I indices')
+      CALL ef_set_axis_influence(id, arg, NO, YES, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplei_multi_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nx
+      IF (arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplei_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+     .     
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .      memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER j2, k2, l2
+      INTEGER iorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                i1 = arg_lo_ss(X_AXIS,ARG1)
+                DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                   aorder = arg_1(i1,j1,k1,l1)
+                   IF (i1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, i, aorder)
+                   iorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (iorder .LT. arg_lo_ss(X_AXIS,ARG2)  .OR.
+     .                   iorder .GT. arg_hi_ss(X_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(iorder,j2,k2,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(iorder,j2,k2,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(iorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(X_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(X_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of I indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL ef_bail_out(id, errtxt)
+
+      RETURN
+      END
+
diff --git a/fer/efi/sampleij.F b/fer/efi/sampleij.F
new file mode 100644
index 0000000..74c084d
--- /dev/null
+++ b/fer/efi/sampleij.F
@@ -0,0 +1,442 @@
+*
+* sampleij.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Ansley Manke
+* APR 1999
+*
+* This function samples 4-d data on the x and y axes indicated by args 2 and 3
+* 4/5/99  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+* 4/9/09  The function never tested for the bad-flag of the input variable.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sampleij_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     .  ('Returns data sampled at a subset of its ',
+     .   'grid points, defined by (XPTS, YPTS)')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X indices of grid points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y indices of grid points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE sampleij_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sampleij_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER mxl, myl, mxh, myh
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+      mxh = arg_hi_ss(X_AXIS,ARG1) * 2
+      myh = arg_hi_ss(Y_AXIS,ARG1) * 2
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sampleij_compute(id, arg_1, arg_2, arg_3, result, 
+     .       xaxdat, yaxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL*8 xaxdat(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .              wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .              wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL*8 yaxdat(wrk2lox:wrk2hix/2, wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      LOGICAL TM_FPEQ
+
+      INTEGER i,  j,  k,  l,  m,  n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER imatch, jmatch
+      REAL xgrid, ygrid, a
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      IF ((arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2)) .GT. 0  .OR.
+     .    (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2)) .GT. 0  .OR.
+     .    (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2)) .GT. 0  .OR.
+     .    (arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2)) .GT. 0  .OR.
+     .    (arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2)) .GT. 0) THEN
+         WRITE (err_msg, 10)
+         GO TO 999
+      ENDIF
+
+      IF ((arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3)) .GT. 0  .OR.
+     .    (arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3)) .GT. 0  .OR.
+     .    (arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3)) .GT. 0  .OR.
+     .    (arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3)) .GT. 0  .OR.
+     .    (arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3)) .GT. 0) THEN
+         WRITE (err_msg, 20)
+         GO TO 999
+      ENDIF
+
+   10 FORMAT ('SAMPLEIJ expects Argument 2 to be a list of X ',
+     .       'coordinates whose ''grid'' consists of an X axis only')
+   20 FORMAT ('SAMPLEIJ expects Argument 3 to be a list of Y ',
+     .       'coordinates whose ''grid'' consists of an X axis only')
+         
+
+*  Get x and y coordinates of the data array.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS, 
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS, 
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+*  For each (xpt,ypt) pair, search the data array arg_1 and match its (x,y)
+*  coordinates.  Keep the result in result(i_point,_,k,l,m,n) for all 
+*  k,l,m,n in the data array.
+
+      j = res_lo_ss(Y_AXIS)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         imatch = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         IF ( arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(ARG2) .AND.
+     .        arg_3(i3,j3,k3,l3,m3,n3) .NE. bad_flag(ARG3) ) THEN
+
+            DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1) 
+               xgrid = xaxdat(i1,1,1,1,1,1)
+               IF ( TM_FPEQ(xgrid, arg_2(i2,j2,k2,l2,m2,n2)) )
+     .            imatch = i1
+  110       CONTINUE
+
+            DO 120 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1) 
+               ygrid = yaxdat(j1,1,1,1,1,1)
+               IF ( TM_FPEQ(ygrid, arg_3(i3,j3,k3,l3,m3,n3)) )
+     .            jmatch = j1
+  120       CONTINUE
+
+         ENDIF
+
+         IF ( (imatch .NE. ef_unspecified_int4) .AND.
+     .        (jmatch .NE. ef_unspecified_int4) ) THEN
+
+            n1 = arg_lo_ss(F_AXIS,ARG1)
+            DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            m1 = arg_lo_ss(E_AXIS,ARG1)
+            DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  a = arg_1(imatch,jmatch,k1,l1,m1,n1)
+                  IF ( a .NE. bad_flag(ARG1) ) THEN
+                     result(i,j,k,l,m,n) = 
+     .                     arg_1(imatch,jmatch,k1,l1,m1,n1)
+                  ELSE
+                     result(i,j,k,l,m,n) = bad_flag_result
+                  ENDIF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400        CONTINUE
+
+               m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500        CONTINUE
+
+               n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600        CONTINUE
+
+         ELSE
+
+*  Data coordinates do not match (xpts,ypts) coordinates
+
+            n1 = arg_lo_ss(F_AXIS,ARG1)
+            DO 650 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            m1 = arg_lo_ss(E_AXIS,ARG1)
+            DO 550 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 450 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 350 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 350           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 450        CONTINUE
+
+               m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 550        CONTINUE
+
+               n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 650        CONTINUE
+
+         ENDIF
+
+
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplej_multi.F b/fer/efi/samplej_multi.F
new file mode 100644
index 0000000..85b5bdf
--- /dev/null
+++ b/fer/efi/samplej_multi.F
@@ -0,0 +1,256 @@
+*
+* samplej_multi.F
+*
+* Ansley Manke
+* May 1998
+*
+* This function samples data along the J axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplej_multi_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to J indices which ',
+     . 'may vary in IKL')
+      CALL ef_set_desc(id, fcn_desc)
+
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     ABSTRACT, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'J_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using J indices')
+      CALL ef_set_axis_influence(id, arg, YES, NO, YES, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplej_multi_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = ny
+      IF (arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplej_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, k2, l2
+      INTEGER jorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                   aorder = arg_1(i1,j1,k1,l1)
+                   IF (j1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, j, aorder)
+                  jorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (jorder .LT. arg_lo_ss(Y_AXIS,ARG2)  .OR.
+     .                   jorder .GT. arg_hi_ss(Y_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,jorder,k2,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,jorder,k2,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      RETURN 
+
+999   CONTINUE
+      aindex(1) = LEFINT(jorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(Y_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(Y_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of J indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
diff --git a/fer/efi/samplek_multi.F b/fer/efi/samplek_multi.F
new file mode 100644
index 0000000..92bdc33
--- /dev/null
+++ b/fer/efi/samplek_multi.F
@@ -0,0 +1,258 @@
+*
+* samplek_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the K axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplek_multi_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to K indices which ',
+     . 'may vary in IJL')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, ABSTRACT, IMPLIED_BY_ARGS)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'K_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using K indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, NO, YES)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplek_multi_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+      my_lo_l = 1
+      my_hi_l = nz
+      IF (arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) .EQ. 0)
+     .    my_hi_l = max(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplek_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .     mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id, i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, l2
+      INTEGER korder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3) 
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            l2 = arg_lo_ss(T_AXIS,ARG2)
+            DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                  aorder = arg_1(i1,j1,k1,l1)
+                  IF (k1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, k, aorder)
+                  korder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (korder .LT. arg_lo_ss(Z_AXIS,ARG2)  .OR.
+     .                   korder .GT. arg_hi_ss(Z_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,j2,korder,l2) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,j2,korder,l2)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 100           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+               l2 = l2 + arg_incr(T_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(korder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(Z_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(Z_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of Z indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL ef_bail_out(id, errtxt)
+      RETURN
+      END
diff --git a/fer/efi/samplel_multi.F b/fer/efi/samplel_multi.F
new file mode 100644
index 0000000..c7beb05
--- /dev/null
+++ b/fer/efi/samplel_multi.F
@@ -0,0 +1,263 @@
+*
+* samplel_multi.F
+*
+* Ansley Manke
+* Dec 1998
+*
+* This function samples data along the L axis using a set of indices
+* 4/5/99  Ansley Manke 
+*         Indices may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplel_multi_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+      CHARACTER*100 fcn_desc
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled according to L indices which ',
+     . 'may vary in IJK')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance(id, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, ABSTRACT)
+
+      CALL ef_set_piecemeal_ok(id, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'L_INDICES')
+      CALL ef_set_arg_desc(id, arg, 'ordered indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample using L indices')
+      CALL ef_set_axis_influence(id, arg, YES, YES, YES, NO)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplel_multi_result_limits(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt
+
+*     Use utility functions to get context information about the 
+*     1st argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+*  If there is a list of indices along the T-axis of ARG1, use the
+*  argument subscripts for the abstract axis limits.
+
+      my_lo_l = 1
+      my_hi_l = nt
+
+      IF (arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) .EQ. 0) 
+     .    my_hi_l = MAX(nx,ny,nz,nt)
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplel_multi_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .      mem1lot:mem1hit)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .     mem2lot:mem2hit)
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .     memresloz:memreshiz, memreslot:memreshit)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(4), res_hi_ss(4), res_incr(4)
+      INTEGER arg_lo_ss(4,EF_MAX_ARGS), arg_hi_ss(4,EF_MAX_ARGS),
+     .     arg_incr(4,EF_MAX_ARGS)
+
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER id
+      INTEGER i, j, k, l
+      INTEGER i1, j1, k1, l1
+      INTEGER i2, j2, k2
+      INTEGER lorder
+      REAL aorder
+
+      INTEGER nlen(3), unspecified_int4
+      CHARACTER*8 lefint, aindex(3)
+      CHARACTER*100 errtxt
+
+      unspecified_int4 = -111
+
+      CALL ef_get_res_subscripts(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      i2 = arg_lo_ss(X_AXIS, ARG2)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         j2 = arg_lo_ss(Y_AXIS,ARG2)
+         DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            k2 = arg_lo_ss(Z_AXIS,ARG2)
+            DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  Get the index to sample, whichever axis of arg_1 it is on.
+
+                  aorder = arg_1(i1,j1,k1,l1)
+                  IF (l1 .EQ. unspecified_int4) 
+     .                  CALL pickindex(arg_1, l, aorder)
+                  lorder = aorder
+
+*  Check that we do have an index of ARG_2; set the result
+
+                  IF (aorder .EQ. bad_flag(ARG1)) THEN
+                     result(i,j,k,l) = bad_flag_result
+                  ELSE
+
+                     IF (lorder .LT. arg_lo_ss(T_AXIS,ARG2)  .OR.
+     .                   lorder .GT. arg_hi_ss(T_AXIS,ARG2) ) THEN
+                        GO TO 999
+                     ELSE
+
+                        IF (arg_2(i2,j2,k2,lorder) .EQ. bad_flag(ARG2))
+     .                   THEN
+                           result(i,j,k,l) = bad_flag_result
+                        ELSE
+                           result(i,j,k,l) = arg_2(i2,j2,k2,lorder)
+ 
+                        END IF
+                     END IF
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 100           CONTINUE
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+               k2 = k2 + arg_incr(Z_AXIS,ARG2)
+ 200        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+            j2 = j2 + arg_incr(Y_AXIS,ARG2)
+ 300     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+ 400  CONTINUE
+
+      RETURN 
+
+999   CONTINUE
+
+      aindex(1) = LEFINT(lorder,nlen(1))
+      aindex(2) = LEFINT(arg_lo_ss(T_AXIS,ARG2),nlen(2))
+      aindex(3) = LEFINT(arg_hi_ss(T_AXIS,ARG2),nlen(3))
+
+      WRITE (errtxt,*) 'Sampling index ', aindex(1)(1:nlen(1)), 
+     . ' in ARG1 is outside the range of L indices for ARG2 (', 
+     .  aindex(2)(1:nlen(2)), ':', aindex(3)(1:nlen(3)), ')'
+
+      CALL EF_BAIL_OUT(id, errtxt)
+
+      RETURN
+      END
+
diff --git a/fer/efi/samplet_date.F b/fer/efi/samplet_date.F
new file mode 100644
index 0000000..5e45d38
--- /dev/null
+++ b/fer/efi/samplet_date.F
@@ -0,0 +1,569 @@
+*
+* samplet_date.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This function samples data along the L axis at a set of times: 
+* yr,mo,da,hr,min,sec
+
+* 5/20/99  Ansley Manke 
+*         Times may be oriented along any axis; 
+*         Result is abstract on the sampled axis.
+* 3/1/00  ACM fixed bug in definition of the work array datebuf
+* 7/2000  ACM inherit axes only from the data variable, not dates!
+* 4/2001  *ACM* add error message
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplet_date_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT 
+     .  ('Returns data sampled by interpolating ',
+     .   'to a set of times')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'data to sample at set of times')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YR')
+      CALL ef_set_arg_desc(id, arg, 'Year(s) yyyy')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'MO')
+      CALL ef_set_arg_desc(id, arg, 'Month(s), integer mm')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'DAY')
+      CALL ef_set_arg_desc(id, arg, 'Day(s) of month dd')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'HR')
+      CALL ef_set_arg_desc(id, arg, 'Hour(s) hh')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'MIN')
+      CALL ef_set_arg_desc(id, arg, 'Minute(s) mm')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'SEC')
+      CALL ef_set_arg_desc(id, arg, 'Second(s) ss')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplet_date_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_l, my_hi_l
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     2nd argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      nf = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+
+*  Use the subscripts for ARG2 for the abstract axis limits; could be on any axis
+
+      my_lo_l = 1
+      my_hi_l = MAX(nx,ny,nz,nt,ne,nf)
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_l, my_hi_l)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplet_date_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mtdat, mt2, mt20
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+*  Use utility functions to get context information about the 1st
+*  argument, to set the work arrays for the input argument time axis..
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      mt2 = mtdat* 2	! real*8  takes twice what a real*4 does
+      mt20 = mtdat* 20	! character*20: character*1 takes 1 byte
+
+*  taxdat (real*8)
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mt2, 1, 1, 1, 1, 1)
+
+*  datebuf (character*20)
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mt20, 1, 1, 1, 1, 1)
+
+*  date_axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .           arg_lo_ss(T_AXIS,ARG1), 1, 1, 1, 1, 1,
+     .           arg_hi_ss(T_AXIS,ARG1), 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplet_date_compute(id, arg_1, arg_2, arg_3,
+     .                             arg_4, arg_5, arg_6, arg_7, result,
+     .                            taxdat, datebuf, date_axis)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz, 
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz, 
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL*8 taxdat(wrk1lox:wrk1hix/2, wrk1loy:wrk1hiy,
+     .              wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .              wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      CHARACTER*20 datebuf(wrk2lox:wrk2hix/20, wrk2loy:wrk2hiy,
+     .                     wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .                     wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL date_axis(wrk3lox:wrk3hix, wrk3loy:wrk3hiy,
+     .               wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .               wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER iarg
+      INTEGER i, j, k, l, m, n
+      INTEGER arg
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER i5, j5, k5, l5, m5, n5
+      INTEGER i6, j6, k6, l6, m6, n6
+      INTEGER i7, j7, k7, l7, m7, n7
+      INTEGER mnth, numtimes
+      INTEGER lbot, ltop, status
+      REAL ayr, amo, ada, ahr, amn, asc
+      REAL byr, bmo, bda, bhr, bmn, bsc
+      REAL tbot, ttop, timepoint, frac
+
+      CHARACTER*100 errtxt
+
+      CHARACTER*3 months(12), cmon
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .            'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+  20  FORMAT (f2.0, 1x, a3, 1x, f4.0, 3(1x,f2.0))
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      iarg = 1
+      CALL ef_get_coordinates (id, ARG1, T_AXIS, 
+     .       arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+
+      numtimes = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      CALL ef_get_axis_dates (id, ARG1, taxdat, numtimes, datebuf)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 60 l = 1, numtimes
+         READ (datebuf(l,1,1,1,1,1), 20, err=900) bda, cmon, byr,
+     .                                            bhr, bmn, bsc
+         bmo = 0
+         DO 40 mnth = 1, 12
+            IF ( cmon .eq. months(mnth) ) bmo = mnth
+   40    CONTINUE
+         CALL day_of_year(bmo, bda, byr, status, errtxt)
+         IF (status .NE. 0) GO TO 1000
+         bmn = bmn + bsc/ 60.
+         bhr = bhr + bmn/ 60.
+         bda = bda + bhr/ 24.
+         date_axis(l1,1,1,1,1,1) = byr + bda / 365.2425
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+   60 CONTINUE
+
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      l6 = arg_lo_ss(T_AXIS,ARG6)
+      l7 = arg_lo_ss(T_AXIS,ARG7)
+      DO  400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*  Get the time to sample, whichever axis of arg_2 thru arg_7 it is on.
+
+         CALL pickindex(arg_2, l, ayr)
+         CALL pickindex(arg_3, l, amo)
+         CALL pickindex(arg_4, l, ada)
+         CALL pickindex(arg_5, l, ahr)
+         CALL pickindex(arg_6, l, amn)
+         CALL pickindex(arg_7, l, asc)
+
+*  Check that we do have a valid time.
+
+         lbot = 0
+         IF (ayr .NE. bad_flag(ARG2) .AND. 
+     .       amo .NE. bad_flag(arg3) .AND. 
+     .       ada .NE. bad_flag(arg4) .AND. 
+     .       ahr .NE. bad_flag(arg5) .AND. 
+     .       amn .NE. bad_flag(arg6) .AND. 
+     .       asc .NE. bad_flag(arg7) ) THEN
+
+            CALL day_of_year(amo, ada, ayr, status, errtxt)
+            IF (status .NE. 0) GO TO 1000
+
+            amn = amn + asc/ 60.
+            ahr = ahr + amn/ 60.
+            ada = ada + ahr/ 24.
+            timepoint = ayr + ada / 365.2425
+
+*  Search the 1st argument for the points before and after the requested time,
+*  interpolate to set the result.
+
+            DO 80 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+               IF (timepoint .GE. date_axis(l1,1,1,1,1,1)) lbot = l1
+   80       CONTINUE
+            ltop = lbot + 1
+
+            IF (lbot .GE. arg_lo_ss(T_AXIS,ARG1)  .AND. 
+     .          ltop .LE. arg_hi_ss(T_AXIS,ARG1)) THEN
+
+               tbot = date_axis(lbot,1,1,1,1,1)
+               ttop = date_axis(ltop,1,1,1,1,1)
+               frac = (timepoint - tbot) / (ttop - tbot)
+            ENDIF
+
+         ENDIF
+
+*  Loop over all space and interpolate.
+  
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         n2 = arg_lo_ss(F_AXIS,ARG2)
+         n3 = arg_lo_ss(F_AXIS,ARG3)
+         n4 = arg_lo_ss(F_AXIS,ARG4)
+         n5 = arg_lo_ss(F_AXIS,ARG5)
+         n6 = arg_lo_ss(F_AXIS,ARG6)
+         n7 = arg_lo_ss(F_AXIS,ARG7)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         m2 = arg_lo_ss(E_AXIS,ARG2)
+         m3 = arg_lo_ss(E_AXIS,ARG3)
+         m4 = arg_lo_ss(E_AXIS,ARG4)
+         m5 = arg_lo_ss(E_AXIS,ARG5)
+         m6 = arg_lo_ss(E_AXIS,ARG6)
+         m7 = arg_lo_ss(E_AXIS,ARG7)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         k2 = arg_lo_ss(Z_AXIS,ARG2)
+         k3 = arg_lo_ss(Z_AXIS,ARG3)
+         k4 = arg_lo_ss(Z_AXIS,ARG4)
+         k5 = arg_lo_ss(Z_AXIS,ARG5)
+         k6 = arg_lo_ss(Z_AXIS,ARG6)
+         k7 = arg_lo_ss(Z_AXIS,ARG7)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            j2 = arg_lo_ss(Y_AXIS,ARG2)
+            j3 = arg_lo_ss(Y_AXIS,ARG3)
+            j4 = arg_lo_ss(Y_AXIS,ARG4)
+            j5 = arg_lo_ss(Y_AXIS,ARG5)
+            j6 = arg_lo_ss(Y_AXIS,ARG6)
+            j7 = arg_lo_ss(Y_AXIS,ARG7)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               i1 = arg_lo_ss(X_AXIS, ARG1)
+               i2 = arg_lo_ss(X_AXIS, ARG2)
+               i3 = arg_lo_ss(X_AXIS, ARG3)
+               i4 = arg_lo_ss(X_AXIS, ARG4)
+               i5 = arg_lo_ss(X_AXIS, ARG5)
+               i6 = arg_lo_ss(X_AXIS, ARG6)
+               i7 = arg_lo_ss(X_AXIS, ARG7)
+               DO  100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+                  IF ( lbot .GE. arg_lo_ss(T_AXIS,ARG1) .AND. 
+     .                 ltop .LE. arg_hi_ss(T_AXIS,ARG1) ) THEN
+                     IF ( arg_1(i1,j1,k1,lbot,m1,n1) 
+     .                          .NE. bad_flag(ARG1)     .AND.
+     .                    arg_1(i1,j1,k1,ltop,m1,n1)
+     .                          .NE. bad_flag(ARG1) )     THEN
+                        result(i,j,k,l,m,n) = 
+     .                        arg_1(i1,j1,k1,lbot,m1,n1) + 
+     .                        frac * ( arg_1(i1,j1,k1,ltop,m1,n1) -
+     .                                 arg_1(i1,j1,k1,lbot,m1,n1)  )
+                     ELSE
+                        result(i,j,k,l,m,n) = bad_flag_result
+                     ENDIF
+                  ELSE
+                     result(i,j,k,l,m,n) = bad_flag_result
+                  ENDIF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  i2 = i2 + arg_incr(X_AXIS,ARG2)
+                  i3 = i3 + arg_incr(X_AXIS,ARG3)
+                  i4 = i4 + arg_incr(X_AXIS,ARG4)
+                  i5 = i5 + arg_incr(X_AXIS,ARG5)
+                  i6 = i6 + arg_incr(X_AXIS,ARG6)
+                  i7 = i7 + arg_incr(X_AXIS,ARG7)
+  100          CONTINUE
+
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+               j2 = j2 + arg_incr(Y_AXIS,ARG2)
+               j3 = j3 + arg_incr(Y_AXIS,ARG3)
+               j4 = j4 + arg_incr(Y_AXIS,ARG4)
+               j5 = j5 + arg_incr(Y_AXIS,ARG5)
+               j6 = j6 + arg_incr(Y_AXIS,ARG6)
+               j7 = j7 + arg_incr(Y_AXIS,ARG7)
+  200       CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+            k2 = k2 + arg_incr(Z_AXIS,ARG2)
+            k3 = k3 + arg_incr(Z_AXIS,ARG3)
+            k4 = k4 + arg_incr(Z_AXIS,ARG4)
+            k5 = k5 + arg_incr(Z_AXIS,ARG5)
+            k6 = k6 + arg_incr(Z_AXIS,ARG6)
+            k7 = k7 + arg_incr(Z_AXIS,ARG7)
+  300    CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+            m2 = m2 + arg_incr(E_AXIS,ARG2)
+            m3 = m3 + arg_incr(E_AXIS,ARG3)
+            m4 = m4 + arg_incr(E_AXIS,ARG4)
+            m5 = m5 + arg_incr(E_AXIS,ARG5)
+            m6 = m6 + arg_incr(E_AXIS,ARG6)
+            m7 = m7 + arg_incr(E_AXIS,ARG7)
+  500    CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+            n2 = n2 + arg_incr(F_AXIS,ARG2)
+            n3 = n3 + arg_incr(F_AXIS,ARG3)
+            n4 = n4 + arg_incr(F_AXIS,ARG4)
+            n5 = n5 + arg_incr(F_AXIS,ARG5)
+            n6 = n6 + arg_incr(F_AXIS,ARG6)
+            n7 = n7 + arg_incr(F_AXIS,ARG7)
+  600    CONTINUE
+
+* End of loop over all space; go on to next specified time
+
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         l6 = l6 + arg_incr(T_AXIS,ARG6)
+         l7 = l7 + arg_incr(T_AXIS,ARG7)
+  400 CONTINUE
+
+      RETURN 
+
+  900 WRITE (errtxt,*) 'error reading date buffer ', 
+     .                 l, datebuf(l1,1,1,1,1,1)
+ 1000 CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+      END
diff --git a/fer/efi/samplexy.F b/fer/efi/samplexy.F
new file mode 100644
index 0000000..57936e4
--- /dev/null
+++ b/fer/efi/samplexy.F
@@ -0,0 +1,753 @@
+*
+* samplexy.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*  -------------------------------------------------------------------
+*  Replace samplexy_compute subroutine with the one sent by Bernadette Fritzsch 
+*  Subject: samplexy.F
+*  Date: Thu, 22 Jun 2000 11:07:25 +0200 (MET DST)
+*  From: Bernadette Fritzsch <fritzsch at AWI-Bremerhaven.DE>
+*  To: hankin at pmel.noaa.gov
+*  
+*  Hallo Steve,
+*  
+*  the external function samplexy was first only for the case that all points
+*  match the original axes. Now there is a version of samplexy, that interpolate
+*  the values between the points, what is more general. But in some cases it
+*  fails, when the point matches the axis but one of the neighbour point has bad values.
+*  
+*  Here are some modification of the code. To avoid to much if-then-else-endif
+*  constructs i modify the variable itop and jtop in the case of matching.
+*  In this case no interpolation is done but the condition if all numbers are 
+*  not bad values is fullfilled.
+*  
+*  I attach my version of subroutine samplexy_compute. Modifications are marked
+*  as coloured.
+*  
+*  There is another problem where i did not find a solution.
+*  What about the case when axis is set modulo?
+*  
+*  -- Bernadette
+*  -------------------------------------------------------------------
+*
+* This function samples 4-d data on the x and y axes indicated by args 2 and 3
+* 9/10/99  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+*
+* 1/13/2000 acm -- fix so that xpts and/or ypts can be on any axis.
+* 3/ 1/2000 ACM -- fix bug in the definition of the work arrays
+* 6/ 8/2000 ACM -- fix bug in incrementing k2, k3, l2, l3
+*
+* 7/2000  acm -- merge Bernadettes and increment fix into this version
+* 5/2001  acm -- allow modulo axes
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+*  2/2001 acm -- check that modulo axes are also regular, and fix delmodx
+*  2/2002 acm -- check xpt and ypt (x and y points to sample) that values arent missing.
+* 11/2005 acm -- Allow use of this on any X axis, not just regular ones 
+*                (see bug report 1358)
+*  1/2014 acm -- Fix ticket 2137: use correct indices when computing dx, dy.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .        'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mxh, myh, mxl, myl
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  xboxlo
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  xboxhi
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yboxlo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  yboxhi
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE samplexy_compute(id, arg_1, arg_2, arg_3, result,
+     .                xaxdat, yaxdat, xboxlo, xboxhi, yboxlo, yboxhi)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .              wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .              wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+      REAL*8 xboxlo(wrk3lox:wrk3lox+(wrk3hix-wrk3lox)/2,wrk3loy:wrk3hiy,
+     .              wrk3loz:wrk3hiz, wrk3lot:wrk3hit,
+     .              wrk3loe:wrk3hie, wrk3lof:wrk3hif)
+      REAL*8 xboxhi(wrk4lox:wrk4lox+(wrk4hix-wrk4lox)/2,wrk4loy:wrk4hiy,
+     .              wrk4loz:wrk4hiz, wrk4lot:wrk4hit,
+     .              wrk4loe:wrk4hie, wrk4lof:wrk4hif)
+      REAL*8 yboxlo(wrk5lox:wrk5lox+(wrk5hix-wrk5lox)/2,wrk5loy:wrk5hiy,
+     .              wrk5loz:wrk5hiz, wrk5lot:wrk5hit,
+     .              wrk5loe:wrk5hie, wrk5lof:wrk5hif)
+      REAL*8 yboxhi(wrk6lox:wrk6lox+(wrk6hix-wrk6lox)/2,wrk6loy:wrk6hiy,
+     .              wrk6loz:wrk6hiz, wrk6lot:wrk6hit,
+     .              wrk6loe:wrk6hie, wrk6lof:wrk6hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER STR_UPCASE
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER ndimx, ndimy
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ic, imatch, jmatch
+      INTEGER ibot, itop, jbot, jtop, xflag
+      INTEGER ilo, ihi, jlo, jhi
+      LOGICAL ok, full_span
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, ybot, ytop
+      REAL xfrac, yfrac
+      REAL dx, dxlo, dxhi, dy, dylo, dyhi, delmodx, xpt, ypt
+      CHARACTER err_msg*255, test_str*16
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = max(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nye = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      ny = max(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ndimx = 0
+      ndimy = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF (arg_hi_ss(i,ARG2) - arg_lo_ss(i,ARG2) .GT.0) 
+     .       ndimx = ndimx + 1
+         IF (arg_hi_ss(i,ARG3) - arg_lo_ss(i,ARG3) .GT.0) 
+     .       ndimy = ndimy + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. ny) .OR. (ndimx .GT. 1) .OR. (ndimy .GT.1) ) THEN
+         err_msg = 
+     .  'Arguments 2 and 3 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+
+*  Get x and y coordinates of the data to be sampled.
+
+      ilo = arg_lo_ss(X_AXIS,ARG1)
+      ihi = arg_hi_ss(X_AXIS,ARG1)
+      jlo = arg_lo_ss(Y_AXIS,ARG1)
+      jhi = arg_hi_ss(Y_AXIS,ARG1)
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS, ilo, ihi, xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS, jlo, jhi, yaxdat)
+
+*  Check to see if input x axis is modulo, and if axes are regular.
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF ( regular(1) ) THEN
+         dx = xaxdat(ilo+1,1,1,1,1,1) - xaxdat(ilo,1,1,1,1,1)
+         dxlo = dx/2.
+         dxhi = dx/2.
+      ELSE
+         CALL ef_get_box_limits(id, ARG1, X_AXIS, ilo, ihi,
+     .                          xboxlo, xboxhi)
+         dxlo = (xboxlo(ilo+1,1,1,1,1,1) - xboxlo(ilo,1,1,1,1,1) ) / 2.
+         dxhi = (xboxhi(ihi,1,1,1,1,1) - xboxhi(ihi-1,1,1,1,1,1) ) / 2.
+      ENDIF
+
+      IF ( regular(2) ) THEN
+         dy = yaxdat(jlo+1,1,1,1,1,1) - yaxdat(jlo,1,1,1,1,1)
+         dylo = dy/2.
+         dyhi = dy/2.
+      ELSE
+         CALL ef_get_box_limits(id, ARG1, Y_AXIS, jlo, jhi,
+     .                          yboxlo, yboxhi)
+         dylo = (yboxlo(jlo+1,1,1,1,1,1) - yboxlo(jlo,1,1,1,1,1) )/ 2.
+         dyhi = (yboxhi(jhi,1,1,1,1,1) - yboxlo(jhi-1,1,1,1,1,1) )/ 2.
+      ENDIF
+      
+* Check to see if input x,y axis is modulo. If its a longitude 
+* axis, check for full-span
+
+      IF ( modulo(1) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(1))
+         ok = (test_str(1:3) .EQ. 'DEG') 
+         dx = xaxdat(ilo+1,1,1,1,1,1) - xaxdat(ilo,1,1,1,1,1)
+         delmodx = (xaxdat(ihi,1,1,1,1,1) + dxhi) -
+     .             (xaxdat(ilo,1,1,1,1,1) - dxlo)
+         IF ( .NOT. regular(1) )
+     .      delmodx = xboxhi(ihi,1,1,1,1,1) - xboxlo(ilo,1,1,1,1,1)
+         IF ( ok ) THEN 
+            full_span = (delmodx .GT. 360.-dx)
+            delmodx = 360.
+         ELSE
+            full_span = .TRUE.
+         ENDIF
+      ENDIF
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+*  For each (xpt,ypt) pair, search the data array 
+*   arg_1 for the nearest higher (x,y) grid coordinates.  Interpolate 
+*   in 2 directions for the result.
+
+* Y-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         ypt = arg_3(i3,j3,k3,l3,m3,n3)
+         IF (xpt .EQ. bad_flag(ARG2) .OR. ypt .EQ. bad_flag(ARG3)) THEN
+            DO 80 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 80 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 80 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 80 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   80       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+* Flag for outside of a modulo axis
+         xflag = 0
+
+* Check if xpt is in the x-axis range.
+         ibot = ef_unspecified_int4
+         itop = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+*  Locate the X point within the range of modulo X axis 
+*  If we have the whole span, then use the point at the other
+*  end to handle points within a half-grid cell of the edge.
+
+         IF ( modulo(1) .AND. full_span ) THEN
+            IF ( xpt .GE. xaxdat(ihi,1,1,1,1,1) .AND.
+     .           xpt .LE. xaxdat(ihi,1,1,1,1,1) + dxhi ) THEN
+               ibot = ihi
+               xflag = 1
+            ELSE IF ( xpt .GE. xaxdat(ihi,1,1,1,1,1) ) THEN
+               DO WHILE ( xpt .GE. xaxdat(ihi,1,1,1,1,1) ) 
+                  xpt = xpt - delmodx
+               ENDDO
+            ENDIF
+
+            IF ( xpt .LT. xaxdat(ilo,1,1,1,1,1) .AND.
+     .           xpt .GE. xaxdat(ilo,1,1,1,1,1) - dxlo ) THEN
+               itop = ilo
+               xflag = -1
+            ELSE IF ( xpt .LT. xaxdat(ilo,1,1,1,1,1) ) THEN
+               DO WHILE (xpt .LT. xaxdat(ilo,1,1,1,1,1) )
+                  xpt = xpt + delmodx
+               ENDDO
+            ENDIF
+         ENDIF
+
+
+         DO 120 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xpt, xaxdat(i1,1,1,1,1,1)) ) THEN
+               imatch = i1
+               GOTO 130
+            ELSE IF ( i1  .EQ. arg_lo_ss(X_AXIS,ARG1)     .AND.
+     .                xpt .LT. xaxdat(i1,1,1,1,1,1)       .AND.
+     .                xpt .GT. xaxdat(i1,1,1,1,1,1)-dxhi  .AND.
+     .               .NOT. modulo(1) ) THEN
+               ibot = i1
+            ELSE IF ( xpt .GE. xaxdat(i1,1,1,1,1,1) ) THEN
+               ibot = i1
+            ENDIF
+  120    CONTINUE
+
+         IF ( .NOT. modulo(1) ) THEN
+            IF ( xpt .GT. xaxdat(ihi,1,1,1,1,1) .AND.
+     .           xpt .LT. xaxdat(ihi,1,1,1,1,1) + dxhi ) THEN
+               ibot = ihi
+            ELSE IF ( xpt .GT. xaxdat(ihi,1,1,1,1,1) ) THEN
+               ibot = ef_unspecified_int4   ! ARG_2 XPT outside of range 
+            ENDIF
+         ENDIF
+
+  130    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+            ibot = imatch
+            itop = imatch
+         ELSE IF ( ibot .NE. ef_unspecified_int4 ) THEN
+            itop = ibot + 1
+            IF ( itop .GT. ihi ) itop = ihi
+         ENDIF
+
+* If the data is at the very top or bottom of the modulo x axis, get the
+* point from the other end.
+
+         IF ( xflag .EQ. 1 ) THEN
+            ibot = ihi
+            itop = ilo
+         ENDIF
+         IF ( xflag .EQ. -1 ) THEN
+            itop = ilo
+            ibot = ihi
+         ENDIF
+
+         IF ( ibot .EQ. ef_unspecified_int4 ) THEN
+*           Coordinate outside the grid
+            DO 140 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 140 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 140 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 140 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  140       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+cbf      analogously in y direction
+
+* Check if ypt is in the y-axis range.
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         DO 220 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(ypt, yaxdat(j1,1,1,1,1,1)) ) THEN
+               jmatch = j1
+               GOTO 230
+            ELSE IF ( j1  .EQ. arg_lo_ss(Y_AXIS,ARG1) .AND.
+     .                ypt .LT. yaxdat(j1,1,1,1,1,1)   .AND. 
+     .                ypt .GT. yaxdat(j1,1,1,1,1,1) - dylo ) THEN
+               jbot = j1
+            ELSE IF ( ypt .GE. yaxdat(j1,1,1,1,1,1) ) THEN
+               jbot = j1
+            ENDIF
+  220    CONTINUE
+
+         IF ( ypt .GT. yaxdat(jhi,1,1,1,1,1) .AND.
+     .        ypt .LT. yaxdat(jhi,1,1,1,1,1) + dyhi ) THEN
+            jbot = jhi
+         ELSE IF ( ypt .GT. yaxdat(jhi,1,1,1,1,1) ) THEN
+            jbot = ef_unspecified_int4      ! ARG_3 YPT outside of range 
+         ENDIF
+
+  230    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+            jbot = jmatch
+            jtop = jmatch
+         ELSE IF ( jbot .NE. ef_unspecified_int4 ) THEN
+            jtop = jbot + 1
+            if ( jtop .GT. jhi ) jtop = jhi
+         ENDIF
+
+         IF ( jbot .EQ. ef_unspecified_int4 ) THEN
+*           Coordinate outside the grid
+            DO 240 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 240 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 240 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 240 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  240       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+
+         xbot = xaxdat(ibot,1,1,1,1,1)
+         xtop = xaxdat(itop,1,1,1,1,1)
+         IF ( xtop .LT. xbot ) THEN
+            IF ( .NOT. regular(1) )
+     .         dx = ( xboxlo(ibot+1,1,1,1,1,1) - 
+     .                xboxlo(ibot,  1,1,1,1,1) ) / 2.0
+            IF ( xflag .EQ. 1 ) THEN
+               xtop = xbot + dx
+            ELSE IF ( xflag .EQ. -1 ) THEN
+               xbot = xtop - dx
+            ENDIF
+         ENDIF
+         IF ( ibot .NE. itop )
+     .      xfrac = (xpt - xbot) / (xtop - xbot)
+
+         ybot = yaxdat(jbot,1,1,1,1,1)
+         ytop = yaxdat(jtop,1,1,1,1,1)
+         IF ( jbot .NE. jtop )
+     .      yfrac = (ypt - ybot) / (ytop - ybot)
+
+* Loop through the Z/T/E/F axes, assigning results for this coordinate pair
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  First interpolate in x, getting values of the fcn at (x,jbot) and (x,jtop)
+               fbb = arg_1(ibot,jbot,k1,l1,m1,n1)
+               ftb = arg_1(itop,jbot,k1,l1,m1,n1)
+               fbt = arg_1(ibot,jtop,k1,l1,m1,n1)
+               ftt = arg_1(itop,jtop,k1,l1,m1,n1)
+
+               IF ( fbb .NE. bad_flag(ARG1)  .AND.
+     .              ftb .NE. bad_flag(ARG1)  .AND.
+     .              fbt .NE. bad_flag(ARG1)  .AND.
+     .              ftt .NE. bad_flag(ARG1) ) THEN
+
+cbf               for matching x-axis no interpolation is need
+                  IF ( ibot .EQ. itop ) THEN
+                     fxbot = fbb
+                     fxtop = fbt
+                  ELSE
+                     fxbot = fbb + xfrac * (ftb - fbb)
+                     fxtop = fbt + xfrac * (ftt - fbt)
+                  ENDIF
+
+*  Now interpolate in y, getting value at (x,y)
+
+cbf               for matching y-axis no interpolation is need
+                  IF ( jbot .EQ. jtop ) THEN
+                     result(i,j,k,l,m,n) = fxbot
+                  ELSE
+                     result(i,j,k,l,m,n) = fxbot +
+     .                                     yfrac * (fxtop - fxbot)
+                  ENDIF
+
+               ELSE
+
+*                 one of the components was missing
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ENDIF
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400     CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2 and one of the ARG3 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexy_closest.F b/fer/efi/samplexy_closest.F
new file mode 100644
index 0000000..5dabee0
--- /dev/null
+++ b/fer/efi/samplexy_closest.F
@@ -0,0 +1,594 @@
+*
+* samplexy_closest.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*
+*   Version of samplexy to get data at the nearest grid point rather
+*   than doing interpolation.
+*
+* This function samples 4-d data on the x and y axes indicated by args 2 and 3
+* 9/10/99  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+*
+* 1/13/2000 acm -- fix so that xpts and/or ypts can be on any axis.
+* 3/ 1/2000 ACM -- fix bug in the definition of the work arrays
+* 6/ 8/2000 ACM -- fix bug in incrementing k2, k3, l2, l3
+*
+* 7/2000  acm -- merge Bernadettes and increment fix into this version
+* 5/2001  acm -- allow modulo axes
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+* 10/2001 acm -- check that jtop (box top) is within range of ARG1 y axis.
+*  2/2001 acm -- check that modulo axes are also regular, and fix delmodx, delmody
+*  2/2002 acm -- check xpt and ypt (x and y points to sample) that values arent missing.
+*
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_closest_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .        'using nearest grid intersection')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_closest_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     2nd argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_closest_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER mxh, myh, mxl, myl
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1)  - arg_lo_ss(Y_AXIS,ARG1) + 1)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexy_closest_compute(id, arg_1, arg_2, arg_3,
+     .        result, xaxdat, yaxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2,wrk1loy:wrk1hiy,
+     .              wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .              wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2,wrk2loy:wrk2hiy,
+     .              wrk2loz:wrk2hiz, wrk2lot:wrk2hit,
+     .              wrk2loe:wrk2hie, wrk2lof:wrk2hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER ndimx, ndimy
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER imatch, jmatch
+      INTEGER ibot, jbot
+      REAL xbot, xtop, ybot, ytop
+      REAL x_to_xbot, x_to_xtop, y_to_ybot, y_to_ytop
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+      INTEGER xlo, xhi, ylo, yhi
+      REAL dx, dy, delmodx, delmody, xpt, ypt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = max(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nye = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      ny = max(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ndimx = 0
+      ndimy = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) )
+     .      ndimx = ndimx + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) ) 
+     .      ndimy = ndimy + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. ny) .OR. (ndimx .GT. 1) .OR. (ndimy .GT. 1) ) THEN
+         err_msg =
+     .  'Arguments 2 and 3 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+
+*  Get x and y coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+
+*  Check to see if input x,y  axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         IF (.NOT. regular(1)) THEN
+            err_msg = 'cannot handle MODULO axis that is not regular'
+            GO TO 999
+         ELSE
+            dx = xaxdat(xlo+1,1,1,1,1,1) - xaxdat(xlo,1,1,1,1,1)
+            delmodx = xaxdat(xhi,1,1,1,1,1) - xaxdat(xlo,1,1,1,1,1) + dx
+         ENDIF
+      ENDIF
+      IF ( modulo(2) ) THEN
+         IF (.NOT. regular(2)) THEN
+            err_msg = 'cannot handle MODULO axis that is not regular'
+            GO TO 999
+         ELSE
+            dy = yaxdat(ylo+1,1,1,1,1,1) - yaxdat(ylo,1,1,1,1,1)
+            delmody = yaxdat(yhi,1,1,1,1,1) - yaxdat(ylo,1,1,1,1,1) + dy
+         ENDIF
+      ENDIF
+
+*  For each (xpt,ypt) pair, search the data array 
+*   arg_1 for the nearest higher (x,y) grid coordinates.  Find the 
+*   nearest in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+* Y-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         ypt = arg_3(i3,j3,k3,l3,m3,n3)
+         IF (xpt .EQ. bad_flag(ARG2) .OR. ypt .EQ. bad_flag(ARG3)) THEN
+            DO 80 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 80 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 80 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 80 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  80        CONTINUE
+*           Go to the next coordinates pair
+            GOTO 690
+         ENDIF
+
+         IF ( modulo(1) ) THEN
+* Relocate the X point within the range of modulo X axis 
+            DO WHILE ( xpt .GE. xaxdat(xhi,1,1,1,1,1) ) 
+               xpt = xpt - delmodx
+            ENDDO
+            DO WHILE (xpt .LT. xaxdat(xlo,1,1,1,1,1) )
+               xpt = xpt + delmodx
+            ENDDO
+         ENDIF
+
+         ibot = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+
+* Check if xpt exceeds the X-axis range.
+         i1 = arg_hi_ss(X_AXIS,ARG1)
+         IF ( TM_FPEQ(xaxdat(i1,1,1,1,1,1), xpt) ) THEN
+            imatch = i1
+            GOTO 120
+         ELSE IF ( xpt .GT. xaxdat(i1,1,1,1,1,1) ) THEN
+            GOTO 120
+         ENDIF
+
+* Find xpt in the X-axis range.
+         DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xaxdat(i1,1,1,1,1,1), xpt) ) THEN
+               imatch = i1
+               GOTO 120
+            ELSE IF ( xpt .GT. xaxdat(i1,1,1,1,1,1) ) THEN
+               ibot = i1
+            ENDIF
+  110    CONTINUE
+
+  120    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+cbf         matching the next neighbour is not of interest
+            i1 = imatch
+         ELSE IF ( ibot .EQ. ef_unspecified_int4 ) THEN
+* xpt not in the the X-axis range
+            i1 = ef_unspecified_int4
+         ELSE
+* ibot will be less than arg_hi_ss(X_AXIS,ARG1) because of earlier check
+            xbot = xaxdat(ibot,  1,1,1,1,1)
+            xtop = xaxdat(ibot+1,1,1,1,1,1)
+            x_to_xbot = ABS(xpt - xbot)
+            x_to_xtop = ABS(xpt - xtop)
+            IF (x_to_xbot .LE. x_to_xtop) THEN
+               i1 = ibot
+            ELSE
+               i1 = ibot+1
+            ENDIF
+         ENDIF
+
+cbf      analogously in y direction
+
+         IF ( modulo(2) ) THEN
+* Relocate the Y point within the range of modulo Y axis 
+            DO WHILE ( ypt .GE. yaxdat(yhi,1,1,1,1,1) ) 
+               ypt = ypt - delmody
+            ENDDO
+            DO WHILE (ypt .LT. yaxdat(ylo,1,1,1,1,1) )
+               ypt = ypt + delmody
+            ENDDO
+         ENDIF
+
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+* Check if ypt exceeds the Y-axis range.
+         j1 = arg_hi_ss(Y_AXIS,ARG1)
+         IF ( TM_FPEQ(yaxdat(j1,1,1,1,1,1), ypt) ) THEN
+            jmatch = j1
+            GOTO 220
+         ELSE IF ( ypt .GT. yaxdat(j1,1,1,1,1,1) ) THEN
+            GOTO 220
+         ENDIF
+
+* Find ypt in the Y-axis range.
+         DO 210 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(yaxdat(j1,1,1,1,1,1), ypt) ) THEN
+               jmatch = j1
+               GOTO 220
+            ELSE IF ( ypt .GT. yaxdat(j1,1,1,1,1,1) ) THEN
+               jbot = j1
+            ENDIF
+  210    CONTINUE
+
+  220    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+cbf         matching the next neighbour is not of interest
+            j1 = jmatch
+         ELSE IF ( jbot .EQ. ef_unspecified_int4 ) THEN
+* ypt not in the the Y-axis range
+            j1 = ef_unspecified_int4
+         ELSE
+* jbot will be less than arg_hi_ss(Y_AXIS,ARG1) because of earlier check
+            ybot = yaxdat(jbot,  1,1,1,1,1)
+            ytop = yaxdat(jbot+1,1,1,1,1,1)
+            y_to_ybot = abs(ypt - ybot)
+            y_to_ytop = abs(ypt - ytop)
+            IF (y_to_ybot .LE. y_to_ytop) THEN
+               j1 = jbot
+            ELSE
+               j1 = jbot+1
+            ENDIF
+         ENDIF
+
+* Loop through the Z/T/E/F axes, assigning results for this coordinate pair
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( i1 .EQ. ef_unspecified_int4  .OR.  
+     .              j1 .EQ. ef_unspecified_int4 ) THEN
+*                 coordinates specified are outside the grid
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE IF ( arg_1(i1,j1,k1,l1,m1,n1) 
+     .                         .EQ. bad_flag(ARG1) ) THEN
+*                 closest grid point has an undefined value
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+               ENDIF
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400     CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2 and one of the ARG3 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexy_curv.F b/fer/efi/samplexy_curv.F
new file mode 100644
index 0000000..d979bad
--- /dev/null
+++ b/fer/efi/samplexy_curv.F
@@ -0,0 +1,605 @@
+*
+* samplexy_curv.F
+*
+* Ansley Manke
+* 4/03 
+* ???  Note: does not currently deal with modulo data  ???
+* 1/06 Remove calls to SIGN to compile with f90 on IRIX.
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .        'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     fourth argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+      ne = arg_hi_ss(E_AXIS, ARG4) - arg_lo_ss(E_AXIS, ARG4) + 1
+      nf = arg_hi_ss(F_AXIS, ARG4) - arg_lo_ss(F_AXIS, ARG4) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER nx, ny
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            nx*ny, 2, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexy_curv_compute(id, arg_1, arg_2, arg_3, arg_4, 
+     .                                 arg_5, result, xlocations)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL xlocations(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .                wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER i5, j5, k5, l5, m5, n5
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      LOGICAL need_modulo
+      REAL ylocations(2)
+      REAL xpt, ypt, ydiff, yd, add_xcoord, xadd, xcoord
+      REAL xptmin, xptmax, xcoordmin, xcoordmax
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, ybot, ytop
+      REAL xfrac, yfrac
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      IF ( (nx1 .NE. nx2) .OR. (nx1 .NE. nx3) .OR.
+     .     (ny1 .NE. ny2) .OR. (ny1 .NE. ny3) ) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+      IF ( (arg_hi_ss(Z_AXIS,ARG2) .GT. arg_lo_ss(Z_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG2) .GT. arg_lo_ss(T_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG2) .GT. arg_lo_ss(E_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG2) .GT. arg_lo_ss(F_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(Z_AXIS,ARG3) .GT. arg_lo_ss(Z_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG3) .GT. arg_lo_ss(T_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG3) .GT. arg_lo_ss(E_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG3) .GT. arg_lo_ss(F_AXIS,ARG3)) ) THEN
+         err_msg ='Arguments 2 and 3 must be defined only on X and Y'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      nye = arg_hi_ss(E_AXIS,ARG5) - arg_lo_ss(E_AXIS,ARG5) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG5) - arg_lo_ss(F_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ndimx = 0
+      ndimy = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) ) ndimx=ndimx + 1
+         IF ( arg_hi_ss(i,ARG5) .GT. arg_lo_ss(i,ARG5) ) ndimy=ndimy + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. ny) .OR. (ndimx .GT. 1) .OR. (ndimy .GT.1) ) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+      
+* Initialize result
+
+      DO 15 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 15 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 15 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 15 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 15 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 15 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+  15  CONTINUE
+
+* Get range of arg_2, longitude coordinates, and arg_4, xpts to sample.
+* is modulo-ing needed?  Also checking for bad values.
+
+*     Z/T/E/F axes of arg_2 are normal or singleton
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      xcoordmin = ABS(bad_flag(ARG2))
+      xcoordmax = -1. * xcoordmin
+
+      DO 20 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 20 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         IF (arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(ARG2)) THEN
+            xcoordmin = MIN(arg_2(i2,j2,k2,l2,m2,n2), xcoordmin)
+            xcoordmax = MAX(arg_2(i2,j2,k2,l2,m2,n2), xcoordmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, curvilinear X coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   20 CONTINUE
+
+      xptmin = ABS(bad_flag(ARG4))
+      xptmax = -1.* xptmin
+
+      DO 40 n4 = arg_lo_ss(F_AXIS,ARG4), arg_hi_ss(F_AXIS,ARG4)
+      DO 40 m4 = arg_lo_ss(E_AXIS,ARG4), arg_hi_ss(E_AXIS,ARG4)
+      DO 40 l4 = arg_lo_ss(T_AXIS,ARG4), arg_hi_ss(T_AXIS,ARG4)
+      DO 40 k4 = arg_lo_ss(Z_AXIS,ARG4), arg_hi_ss(Z_AXIS,ARG4)
+      DO 40 j4 = arg_lo_ss(Y_AXIS,ARG4), arg_hi_ss(Y_AXIS,ARG4)
+      DO 40 i4 = arg_lo_ss(X_AXIS,ARG4), arg_hi_ss(X_AXIS,ARG4)
+         IF (arg_4(i4,j4,k4,l4,m4,n4) .NE. bad_flag(ARG4)) THEN
+            xptmin = MIN(arg_4(i4,j4,k4,l4,m4,n4), xptmin)
+            xptmax = MAX(arg_4(i4,j4,k4,l4,m4,n4), xptmax)
+         ELSE
+            err_msg =
+     .      'Arg 4, sample X points, contains missing values'
+            GOTO 999
+         ENDIF
+   40 CONTINUE
+
+      IF (xptmin .LT. xcoordmin) THEN
+         need_modulo = .TRUE.
+         add_xcoord = -360.
+      ENDIF
+      IF (xptmax .GT. xcoordmax) THEN
+         need_modulo = .TRUE.
+         add_xcoord = 360.
+      ENDIF
+
+* Check once for bad values so we do not have to worry about this issue
+
+*     Z/T/E/F axes of arg_3 are normal or singleton
+      n3 = arg_lo_ss(F_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG2)
+      k3 = arg_lo_ss(Z_AXIS,ARG2)
+
+      DO 30 j3 = arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3)
+      DO 30 i3 = arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+         IF (arg_3(i3,j3,k3,l3,m3,n3) .EQ. bad_flag(ARG3)) THEN
+            err_msg =
+     .      'Arg 3, curvilinear Y coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   30 CONTINUE
+
+      DO 50 n5 = arg_lo_ss(F_AXIS,ARG5), arg_hi_ss(F_AXIS,ARG5)
+      DO 50 m5 = arg_lo_ss(E_AXIS,ARG5), arg_hi_ss(E_AXIS,ARG5)
+      DO 50 l5 = arg_lo_ss(T_AXIS,ARG5), arg_hi_ss(T_AXIS,ARG5)
+      DO 50 k5 = arg_lo_ss(Z_AXIS,ARG5), arg_hi_ss(Z_AXIS,ARG5)
+      DO 50 j5 = arg_lo_ss(Y_AXIS,ARG5), arg_hi_ss(Y_AXIS,ARG5)
+      DO 50 i5 = arg_lo_ss(X_AXIS,ARG5), arg_hi_ss(X_AXIS,ARG5)
+         IF (arg_5(i5,j5,k5,l5,m5,n5) .EQ. bad_flag(ARG5)) THEN
+            err_msg =
+     .      'Arg 5, sample Y points, contains missing values'
+            GOTO 999
+         ENDIF
+   50 CONTINUE
+
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      m5 = arg_lo_ss(E_AXIS,ARG5)
+      n5 = arg_lo_ss(F_AXIS,ARG5)
+
+* Y-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+         xadd = 0.
+         xpt = arg_4(i4,j4,k4,l4,m4,n4)
+         IF (need_modulo .AND. 
+     .       ((xpt .LT. xcoordmin) .OR.(xpt .GT. xcoordmax)) )
+     .      xadd = add_xcoord
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+c               icross = SIGN(1, (xpt - xcoord) )
+            icross = 1
+            IF ((xpt - xcoord) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+               xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+
+c               iloc = SIGN(1, (xpt-xcoord) )
+               iloc = 1
+               IF ((xpt-xcoord) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1,1,1) =
+     .                       MAX(i2-1,arg_lo_ss(X_AXIS,ARG2))
+                  xlocations(nloc,2,1,1,1,1) = j2
+c                  icross = SIGN(1, (xpt - xcoord) )
+                  icross = 1
+                  IF ((xpt - xcoord) .LT. 0.) icross = -1
+               ENDIF
+  100       CONTINUE
+
+  200    CONTINUE
+
+* Which of those locations is nearest ypt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5,m5,n5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         DO 250 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1,1,1)
+            j3 = xlocations(iloc,2,1,1,1,1)
+
+            yd = ABS(ypt - arg_3(i3,j3,k3,l3,m3,n3))
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  250    CONTINUE
+
+         ibot = xlocations(ptloc,1,1,1,1,1)
+         jbot = xlocations(ptloc,2,1,1,1,1)
+         IF (ibot .EQ. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+         IF (jbot .EQ. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+         itop = ibot + 1
+         jtop = jbot + 1
+
+         IF ( ibot .GE. arg_lo_ss(X_AXIS,ARG1) .AND.
+     .        itop .LE. arg_hi_ss(X_AXIS,ARG1) .AND.
+     .        jbot .GE. arg_lo_ss(Y_AXIS,ARG1) .AND.
+     .        jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+
+            xbot = arg_2(ibot,jbot,k2,l2,m2,n2) + xadd
+            xtop = arg_2(itop,jbot,k2,l2,m2,n2) + xadd
+            xfrac = (xpt - xbot) / (xtop - xbot)
+
+            ybot = arg_3(ibot,jbot,k3,l3,m3,n3)
+            ytop = arg_3(ibot,jtop,k3,l3,m3,n3)
+            yfrac = (ypt - ybot) / (ytop - ybot)
+
+            n1 = arg_lo_ss(F_AXIS,ARG1)
+            DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            m1 = arg_lo_ss(E_AXIS,ARG1)
+            DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  fbb = arg_1(ibot,jbot,k1,l1,m1,n1)
+                  ftb = arg_1(itop,jbot,k1,l1,m1,n1)
+                  fbt = arg_1(ibot,jtop,k1,l1,m1,n1)
+                  ftt = arg_1(itop,jtop,k1,l1,m1,n1)
+
+                  IF ( fbb .NE. bad_flag(ARG1)  .AND.
+     .                 ftb .NE. bad_flag(ARG1)  .AND.
+     .                 fbt .NE. bad_flag(ARG1)  .AND.
+     .                 ftt .NE. bad_flag(ARG1) ) THEN
+
+*  First interpolate in x, getting values of the fcn at (x,jbot)  and (x,jtop)
+                     fxbot = fbb + xfrac * (ftb - fbb)
+                     fxtop = fbt + xfrac * (ftt - fbt)
+
+*  Now interpolate in y, getting value at (x,y)
+                     result(i,j,k,l,m,n) = fxbot + yfrac*(fxtop-fxbot)
+                  ENDIF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400        CONTINUE
+
+               m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500        CONTINUE
+
+               n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600        CONTINUE
+
+         ENDIF  ! IF (ibot .GE. ...  .AND. itop .LE.  ...
+
+* Only one of the ARG4 and one of the ARG5 actually increments
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         m5 = m5 + arg_incr(E_AXIS,ARG5)
+         n5 = n5 + arg_incr(F_AXIS,ARG5)
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexy_curv_avg.F b/fer/efi/samplexy_curv_avg.F
new file mode 100644
index 0000000..480e6e7
--- /dev/null
+++ b/fer/efi/samplexy_curv_avg.F
@@ -0,0 +1,609 @@
+*
+* samplexy_curv_avg.F
+*
+* Ansley Manke
+* 4/03 
+* ???  Note: does not currently deal with modulo data  ???
+* 1/06 Remove calls to SIGN to compile with f90 on IRIX.
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_avg_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y) points, ',
+     .        'using unweighted averaging')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_avg_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     fourth argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+      ne = arg_hi_ss(E_AXIS, ARG4) - arg_lo_ss(E_AXIS, ARG4) + 1
+      nf = arg_hi_ss(F_AXIS, ARG4) - arg_lo_ss(F_AXIS, ARG4) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_avg_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER nx, ny
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            nx*ny, 2, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexy_curv_avg_compute(id, arg_1, arg_2, arg_3,
+     .                             arg_4, arg_5, result, xlocations)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL xlocations(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .                wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER i5, j5, k5, l5, m5, n5
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      LOGICAL need_modulo
+      REAL ylocations(2)
+      REAL xpt, ypt, ydiff, yd
+      REAL xptmin, xptmax, xcoordmin, xcoordmax
+      REAL fbb, ftb, fbt, ftt
+      REAL sum, count
+      REAL add_xcoord, xadd, xcoord
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      IF ( (nx1 .NE. nx2) .OR. (nx1 .NE. nx3) .OR.
+     .     (ny1 .NE. ny2) .OR. (ny1 .NE. ny3) ) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+      IF ( (arg_hi_ss(Z_AXIS,ARG2) .GT. arg_lo_ss(Z_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG2) .GT. arg_lo_ss(T_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG2) .GT. arg_lo_ss(E_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG2) .GT. arg_lo_ss(F_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(Z_AXIS,ARG3) .GT. arg_lo_ss(Z_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG3) .GT. arg_lo_ss(T_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG3) .GT. arg_lo_ss(E_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG3) .GT. arg_lo_ss(F_AXIS,ARG3)) ) THEN
+         err_msg ='Arguments 2 and 3 must be defined only on X and Y'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      nye = arg_hi_ss(E_AXIS,ARG5) - arg_lo_ss(E_AXIS,ARG5) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG5) - arg_lo_ss(F_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ndimx = 0
+      ndimy = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) ) ndimx=ndimx + 1
+         IF ( arg_hi_ss(i,ARG5) .GT. arg_lo_ss(i,ARG5) ) ndimy=ndimy + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. ny) .OR. (ndimx .GT. 1) .OR. (ndimy .GT.1) ) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+      
+* Initialize result
+
+      DO 15 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 15 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 15 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 15 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 15 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 15 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+  15  CONTINUE
+
+* Get range of arg_2, longitude coordinates, and arg_4, xpts to sample.
+* is modulo-ing needed?  Also checking for bad values.
+
+*     Z/T/E/F axes of arg_2 are normal or singleton
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      xcoordmin = ABS(bad_flag(ARG2))
+      xcoordmax = -1. * xcoordmin
+
+      DO 20 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 20 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         IF (arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(ARG2)) THEN
+            xcoordmin = MIN(arg_2(i2,j2,k2,l2,m2,n2), xcoordmin)
+            xcoordmax = MAX(arg_2(i2,j2,k2,l2,m2,n2), xcoordmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, curvilinear X coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   20 CONTINUE
+
+      xptmin = ABS(bad_flag(ARG4))
+      xptmax = -1.* xptmin
+
+      DO 40 n4 = arg_lo_ss(F_AXIS,ARG4), arg_hi_ss(F_AXIS,ARG4)
+      DO 40 m4 = arg_lo_ss(E_AXIS,ARG4), arg_hi_ss(E_AXIS,ARG4)
+      DO 40 l4 = arg_lo_ss(T_AXIS,ARG4), arg_hi_ss(T_AXIS,ARG4)
+      DO 40 k4 = arg_lo_ss(Z_AXIS,ARG4), arg_hi_ss(Z_AXIS,ARG4)
+      DO 40 j4 = arg_lo_ss(Y_AXIS,ARG4), arg_hi_ss(Y_AXIS,ARG4)
+      DO 40 i4 = arg_lo_ss(X_AXIS,ARG4), arg_hi_ss(X_AXIS,ARG4)
+         IF (arg_4(i4,j4,k4,l4,m4,n4) .NE. bad_flag(ARG4)) THEN
+            xptmin = MIN(arg_4(i4,j4,k4,l4,m4,n4), xptmin)
+            xptmax = MAX(arg_4(i4,j4,k4,l4,m4,n4), xptmax)
+         ELSE
+            err_msg =
+     .      'Arg 4, sample X points, contains missing values'
+            GOTO 999
+         ENDIF
+   40 CONTINUE
+
+      IF (xptmin .LT. xcoordmin) THEN
+         need_modulo = .TRUE.
+         add_xcoord = -360.
+      ENDIF
+      IF (xptmax .GT. xcoordmax) THEN
+         need_modulo = .TRUE.
+         add_xcoord = 360.
+      ENDIF
+
+* Check once for bad values so we do not have to worry about this issue
+
+*     Z/T/E/F axes of arg_3 are normal or singleton
+      n3 = arg_lo_ss(F_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG2)
+      k3 = arg_lo_ss(Z_AXIS,ARG2)
+
+      DO 30 j3 = arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3)
+      DO 30 i3 = arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+         IF (arg_3(i3,j3,k3,l3,m3,n3) .EQ. bad_flag(ARG3)) THEN
+            err_msg =
+     .      'Arg 3, curvilinear Y coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   30 CONTINUE
+
+      DO 50 n5 = arg_lo_ss(F_AXIS,ARG5), arg_hi_ss(F_AXIS,ARG5)
+      DO 50 m5 = arg_lo_ss(E_AXIS,ARG5), arg_hi_ss(E_AXIS,ARG5)
+      DO 50 l5 = arg_lo_ss(T_AXIS,ARG5), arg_hi_ss(T_AXIS,ARG5)
+      DO 50 k5 = arg_lo_ss(Z_AXIS,ARG5), arg_hi_ss(Z_AXIS,ARG5)
+      DO 50 j5 = arg_lo_ss(Y_AXIS,ARG5), arg_hi_ss(Y_AXIS,ARG5)
+      DO 50 i5 = arg_lo_ss(X_AXIS,ARG5), arg_hi_ss(X_AXIS,ARG5)
+         IF (arg_5(i5,j5,k5,l5,m5,n5) .EQ. bad_flag(ARG5)) THEN
+            err_msg =
+     .      'Arg 5, sample Y points, contains missing values'
+            GOTO 999
+         ENDIF
+   50 CONTINUE
+
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      m5 = arg_lo_ss(E_AXIS,ARG5)
+      n5 = arg_lo_ss(F_AXIS,ARG5)
+
+* Y-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+         xadd = 0.
+         xpt = arg_4(i4,j4,k4,l4,m4,n4)
+         IF (need_modulo .AND. 
+     .       ((xpt .LT. xcoordmin) .OR.(xpt .GT. xcoordmax)) )
+     .      xadd = add_xcoord
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+c               icross = SIGN(1, (xpt - xcoord) )
+            icross = 1
+            IF ((xpt - xcoord) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+               xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+
+c               iloc = SIGN(1, (xpt-xcoord) )
+               iloc = 1
+               IF ((xpt-xcoord) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1,1,1) =
+     .                       MAX(i2-1,arg_lo_ss(X_AXIS,ARG2))
+                  xlocations(nloc,2,1,1,1,1) = j2
+c                  icross = SIGN(1, (xpt - xcoord) )
+                  icross = 1
+                  IF ((xpt - xcoord) .LT. 0.) icross = -1
+               ENDIF
+  100       CONTINUE
+
+  200    CONTINUE
+
+* Which of those locations is nearest ypt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5,m5,n5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         DO 250 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1,1,1)
+            j3 = xlocations(iloc,2,1,1,1,1)
+
+            yd = ABS(ypt - arg_3(i3,j3,k3,l3,m3,n3))
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  250    CONTINUE
+
+         ibot = xlocations(ptloc,1,1,1,1,1)
+         jbot = xlocations(ptloc,2,1,1,1,1)
+         IF (ibot .EQ. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+         IF (jbot .EQ. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+         itop = ibot + 1
+         jtop = jbot + 1
+
+         IF ( ibot .GE. arg_lo_ss(X_AXIS,ARG1) .AND.
+     .        itop .LE. arg_hi_ss(X_AXIS,ARG1) .AND.
+     .        jbot .GE. arg_lo_ss(Y_AXIS,ARG1) .AND.
+     .        jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+
+            n1 = arg_lo_ss(F_AXIS,ARG1)
+            DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            m1 = arg_lo_ss(E_AXIS,ARG1)
+            DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  fbb = arg_1(ibot,jbot,k1,l1,m1,n1)
+                  ftb = arg_1(itop,jbot,k1,l1,m1,n1)
+                  fbt = arg_1(ibot,jtop,k1,l1,m1,n1)
+                  ftt = arg_1(itop,jtop,k1,l1,m1,n1)
+
+                  count = 0.
+                  sum = 0.
+                  IF (fbb .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + fbb
+                  ENDIF
+                  IF (ftb .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + ftb
+                  ENDIF
+                  IF (fbt .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + fbt
+                  ENDIF
+                  IF (ftt .NE. bad_flag(ARG1)) THEN
+                     count = count + 1.
+                     sum = sum + ftt
+                  ENDIF
+
+*  If any data present, set the value at (x,y)
+*  If not, bad_flag_result already has been assigned
+                  IF (count .GT. 0.) THEN
+                     result(i,j,k,l,m,n) = sum/count
+                  ENDIF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400        CONTINUE
+
+               m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500        CONTINUE
+
+               n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600        CONTINUE
+
+         ENDIF  ! IF (ibot .GE. ...  .AND. itop .LE.  ...
+
+* Only one of the ARG4 and one of the ARG5 actually increments
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         m5 = m5 + arg_incr(E_AXIS,ARG5)
+         n5 = n5 + arg_incr(F_AXIS,ARG5)
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexy_curv_nrst.F b/fer/efi/samplexy_curv_nrst.F
new file mode 100644
index 0000000..01a3211
--- /dev/null
+++ b/fer/efi/samplexy_curv_nrst.F
@@ -0,0 +1,615 @@
+*
+* samplexy_curv_nrst.F
+*
+* Ansley Manke
+* 4/07
+
+* This function samples 4-d curvlinear data on the x and y axes 
+* indicated by args 4 and 5, returning nearest location.
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexy_curv_nrst_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data at a set of (X,Y) points, ',
+     .        'from nearest loc on XY curvilinear grid')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'DAT_LON')
+      CALL ef_set_arg_desc(id, arg, 'longitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'DAT_LAT')
+      CALL ef_set_arg_desc(id, arg, 'latitudes of input variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexy_curv_nrst_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     fourth argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG4) - arg_lo_ss(X_AXIS, ARG4) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG4) - arg_lo_ss(Y_AXIS, ARG4) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG4) - arg_lo_ss(Z_AXIS, ARG4) + 1
+      nt = arg_hi_ss(T_AXIS, ARG4) - arg_lo_ss(T_AXIS, ARG4) + 1
+      ne = arg_hi_ss(E_AXIS, ARG4) - arg_lo_ss(E_AXIS, ARG4) + 1
+      nf = arg_hi_ss(F_AXIS, ARG4) - arg_lo_ss(F_AXIS, ARG4) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexy_curv_nrst_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER nx, ny
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  workspace for saving locations of xpt in arg2 array.
+
+      nx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) 
+      ny = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) 
+
+*  xlocations
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            nx*ny, 2, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexy_curv_nrst_compute(id, arg_1, arg_2, arg_3, 
+     .                              arg_4, arg_5, result, xlocations)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+      REAL xlocations(wrk1lox:wrk1hix, wrk1loy:wrk1hiy,
+     .                wrk1loz:wrk1hiz, wrk1lot:wrk1hit,
+     .                wrk1loe:wrk1hie, wrk1lof:wrk1hif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER ndimx, ndimy
+      INTEGER nx1, nx2, nx3, ny1, ny2, ny3
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER i5, j5, k5, l5, m5, n5
+      INTEGER ibot, itop, jbot, jtop
+      INTEGER nloc, iloc, ptloc, icross
+      INTEGER ii, jj
+      LOGICAL need_modulo
+      REAL ylocations(2)
+      REAL xpt, ypt, ydiff, yd
+      REAL xptmin, xptmax, xcoordmin, xcoordmax
+      REAL add_xcoord, xadd, xcoord, sqdd
+      REAL xval, yval, sqdmin
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Check that first 3 args are on the same grid.
+
+      nx1 = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+      nx2 = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nx3 = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      ny1 = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+      ny2 = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      ny3 = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      IF ( (nx1 .NE. nx2) .OR. (nx1 .NE. nx3) .OR.
+     .     (ny1 .NE. ny2) .OR. (ny1 .NE. ny3) ) THEN
+         err_msg ='Arguments 1, 2, and 3 must have the same XY grid'
+         GO TO 999
+      ENDIF
+
+      IF ( (arg_hi_ss(Z_AXIS,ARG2) .GT. arg_lo_ss(Z_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG2) .GT. arg_lo_ss(T_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG2) .GT. arg_lo_ss(E_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG2) .GT. arg_lo_ss(F_AXIS,ARG2)) .OR.
+     .     (arg_hi_ss(Z_AXIS,ARG3) .GT. arg_lo_ss(Z_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(T_AXIS,ARG3) .GT. arg_lo_ss(T_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(E_AXIS,ARG3) .GT. arg_lo_ss(E_AXIS,ARG3)) .OR.
+     .     (arg_hi_ss(F_AXIS,ARG3) .GT. arg_lo_ss(F_AXIS,ARG3)) ) THEN
+         err_msg ='Arguments 2 and 3 must be defined only on X and Y'
+         GO TO 999
+      ENDIF
+
+C Check that sample x and y are simple lists of points - same length
+
+      nxx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nx = max(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5) + 1
+      nye = arg_hi_ss(E_AXIS,ARG5) - arg_lo_ss(E_AXIS,ARG5) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG5) - arg_lo_ss(F_AXIS,ARG5) + 1
+      ny = max(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ndimx = 0
+      ndimy = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) ) ndimx=ndimx + 1
+         IF ( arg_hi_ss(i,ARG5) .GT. arg_lo_ss(i,ARG5) ) ndimy=ndimy + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. ny) .OR. (ndimx .GT. 1) .OR. (ndimy .GT.1) ) THEN
+         err_msg = 
+     .  'Arguments 4 and 5 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+      
+* Initialize result
+
+      DO 15 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 15 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 15 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      DO 15 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+      DO 15 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 15 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+         result(i,j,k,l,m,n) = bad_flag_result
+  15  CONTINUE
+
+* Get range of arg_2, longitude coordinates, and arg_4, xpts to sample.
+* is modulo-ing needed?  Also checking for bad values.
+
+*     Z/T/E/F axes of arg_2 are normal or singleton
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+
+      xcoordmin = ABS(bad_flag(ARG2))
+      xcoordmax = -1. * xcoordmin
+
+      DO 20 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+      DO 20 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+         IF (arg_2(i2,j2,k2,l2,m2,n2) .NE. bad_flag(ARG2)) THEN
+            xcoordmin = MIN(arg_2(i2,j2,k2,l2,m2,n2), xcoordmin)
+            xcoordmax = MAX(arg_2(i2,j2,k2,l2,m2,n2), xcoordmax)
+         ELSE
+            err_msg =
+     .      'Arg 2, curvilinear X coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   20 CONTINUE
+
+      xptmin = ABS(bad_flag(ARG4))
+      xptmax = -1.* xptmin
+
+      DO 40 n4 = arg_lo_ss(F_AXIS,ARG4), arg_hi_ss(F_AXIS,ARG4)
+      DO 40 m4 = arg_lo_ss(E_AXIS,ARG4), arg_hi_ss(E_AXIS,ARG4)
+      DO 40 l4 = arg_lo_ss(T_AXIS,ARG4), arg_hi_ss(T_AXIS,ARG4)
+      DO 40 k4 = arg_lo_ss(Z_AXIS,ARG4), arg_hi_ss(Z_AXIS,ARG4)
+      DO 40 j4 = arg_lo_ss(Y_AXIS,ARG4), arg_hi_ss(Y_AXIS,ARG4)
+      DO 40 i4 = arg_lo_ss(X_AXIS,ARG4), arg_hi_ss(X_AXIS,ARG4)
+         IF (arg_4(i4,j4,k4,l4,m4,n4) .NE. bad_flag(ARG4)) THEN
+            xptmin = MIN(arg_4(i4,j4,k4,l4,m4,n4), xptmin)
+            xptmax = MAX(arg_4(i4,j4,k4,l4,m4,n4), xptmax)
+         ELSE
+            err_msg =
+     .      'Arg 4, sample X points, contains missing values'
+            GOTO 999
+         ENDIF
+   40 CONTINUE
+
+      IF (xptmin .LT. xcoordmin) THEN
+         need_modulo = .TRUE.
+         add_xcoord = -360.
+      ENDIF
+      IF (xptmax .GT. xcoordmax) THEN
+         need_modulo = .TRUE.
+         add_xcoord = 360.
+      ENDIF
+ 
+* Check once for bad values so we do not have to worry about this issue
+
+*     Z/T/E/F axes of arg_3 are normal or singleton
+      n3 = arg_lo_ss(F_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG2)
+      k3 = arg_lo_ss(Z_AXIS,ARG2)
+
+      DO 30 j3 = arg_lo_ss(Y_AXIS,ARG3), arg_hi_ss(Y_AXIS,ARG3)
+      DO 30 i3 = arg_lo_ss(X_AXIS,ARG3), arg_hi_ss(X_AXIS,ARG3)
+         IF (arg_3(i3,j3,k3,l3,m3,n3) .EQ. bad_flag(ARG3)) THEN
+            err_msg =
+     .      'Arg 3, curvilinear Y coordinates, contains missing values'
+            GOTO 999
+         ENDIF
+   30 CONTINUE
+
+      DO 50 n5 = arg_lo_ss(F_AXIS,ARG5), arg_hi_ss(F_AXIS,ARG5)
+      DO 50 m5 = arg_lo_ss(E_AXIS,ARG5), arg_hi_ss(E_AXIS,ARG5)
+      DO 50 l5 = arg_lo_ss(T_AXIS,ARG5), arg_hi_ss(T_AXIS,ARG5)
+      DO 50 k5 = arg_lo_ss(Z_AXIS,ARG5), arg_hi_ss(Z_AXIS,ARG5)
+      DO 50 j5 = arg_lo_ss(Y_AXIS,ARG5), arg_hi_ss(Y_AXIS,ARG5)
+      DO 50 i5 = arg_lo_ss(X_AXIS,ARG5), arg_hi_ss(X_AXIS,ARG5)
+         IF (arg_5(i5,j5,k5,l5,m5,n5) .EQ. bad_flag(ARG5)) THEN
+            err_msg =
+     .      'Arg 5, sample Y points, contains missing values'
+            GOTO 999
+         ENDIF
+   50 CONTINUE
+
+*  For each (xpt,ypt) pair, search the data arrays arg2,arg3
+*  for the nearest higher (x,y) lat-lon coordinates.  Interpolate 
+*  arg_1 in 2 directions for the result.
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+      i5 = arg_lo_ss(X_AXIS,ARG5)
+      j5 = arg_lo_ss(Y_AXIS,ARG5)
+      k5 = arg_lo_ss(Z_AXIS,ARG5)
+      l5 = arg_lo_ss(T_AXIS,ARG5)
+      m5 = arg_lo_ss(E_AXIS,ARG5)
+      n5 = arg_lo_ss(F_AXIS,ARG5)
+
+* Y-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Find all locations of xpt in arg_2, longitudes of data
+
+         xadd = 0.
+         xpt = arg_4(i4,j4,k4,l4,m4,n4)
+         IF (need_modulo .AND. 
+     .       ((xpt .LT. xcoordmin) .OR.(xpt .GT. xcoordmax)) )
+     .      xadd = add_xcoord
+
+         nloc = 0
+
+         DO 200 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+            i2 = arg_lo_ss(X_AXIS,ARG2)
+            xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+            icross = 1
+            IF ((xpt - xcoord) .LT. 0.) icross = -1
+
+            DO 100 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+               xcoord = arg_2(i2,j2,k2,l2,m2,n2) + xadd
+
+               iloc = 1
+               IF ((xpt-xcoord) .LT. 0. ) iloc = -1
+
+               IF (icross .NE. iloc)THEN
+                  nloc = nloc + 1
+                  xlocations(nloc,1,1,1,1,1) =
+     .                       MAX(i2-1,arg_lo_ss(X_AXIS,ARG2))
+                  xlocations(nloc,2,1,1,1,1) = j2
+                  icross = 1
+                  IF ((xpt - xcoord) .LT. 0.) icross = -1
+               ENDIF
+  100       CONTINUE
+
+  200    CONTINUE
+
+* Which of those locations is nearest ypt in arg_3, latitudes of data?
+
+         ypt = arg_5(i5,j5,k5,l5,m5,n5)
+         ydiff = ABS(bad_flag_result)
+         ptloc = 1
+
+         DO 250 iloc = 1, nloc
+            i3 = xlocations(iloc,1,1,1,1,1)
+            j3 = xlocations(iloc,2,1,1,1,1)
+
+            yd = ABS(ypt - arg_3(i3,j3,k3,l3,m3,n3))
+            IF ( yd .LT. ydiff ) THEN
+               ylocations(1) = i3
+               ylocations(2) = j3
+               ydiff = yd
+               ptloc = iloc
+            ENDIF
+  250    CONTINUE
+
+         ibot = xlocations(ptloc,1,1,1,1,1)
+         jbot = xlocations(ptloc,2,1,1,1,1)
+         IF (ibot .EQ. arg_hi_ss(X_AXIS,ARG1) ) ibot = ibot - 1
+         IF (jbot .EQ. arg_hi_ss(Y_AXIS,ARG1) ) jbot = jbot - 1
+
+         itop = ibot + 1
+         jtop = jbot + 1
+
+*  Return the function value closest to the xy value
+*  (pretends same units for X and Y - no latitude correction)
+
+         IF ( ibot .GE. arg_lo_ss(X_AXIS,ARG1) .AND.
+     .        itop .LE. arg_hi_ss(X_AXIS,ARG1) .AND.
+     .        jbot .GE. arg_lo_ss(Y_AXIS,ARG1) .AND.
+     .        jtop .LE. arg_hi_ss(Y_AXIS,ARG1) ) THEN
+
+            xval = arg_2(ibot,jbot,k2,l2,m2,n2) + xadd
+            yval = arg_3(ibot,jbot,k3,l3,m3,n3)
+            sqdmin = (xpt - xval)**2 + (ypt - yval)**2
+            ii = ibot
+            jj = jbot
+
+            xval = arg_2(itop,jbot,k2,l2,m2,n2) + xadd
+            yval = arg_3(itop,jbot,k3,l3,m3,n3)
+            sqdd = (xpt - xval)**2 + (ypt - yval)**2
+            IF (sqdd .LT. sqdmin) THEN
+               ii = itop
+               jj = jbot
+               sqdmin = sqdd
+            ENDIF
+
+            xval = arg_2(ibot,jtop,k2,l2,m2,n2) + xadd
+            yval = arg_3(ibot,jtop,k3,l3,m3,n3)
+            sqdd = (xpt - xval)**2 + (ypt - yval)**2
+            IF (sqdd .LT. sqdmin) THEN
+               ii = ibot
+               jj = jtop
+               sqdmin = sqdd
+            ENDIF
+
+            xval = arg_2(itop,jtop,k2,l2,m2,n2) + xadd
+            yval = arg_3(itop,jtop,k3,l3,m3,n3)
+            sqdd = (xpt - xval)**2 + (ypt - yval)**2
+            IF (sqdd .LT. sqdmin) THEN
+               ii = itop
+               jj = jtop
+               sqdmin = sqdd
+            ENDIF
+
+            n1 = arg_lo_ss(F_AXIS,ARG1)
+            DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+            m1 = arg_lo_ss(E_AXIS,ARG1)
+            DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            l1 = arg_lo_ss(T_AXIS,ARG1)
+            DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+               k1 = arg_lo_ss(Z_AXIS,ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF ( arg_1(ii,jj,k1,l1,m1,n1)
+     .                       .NE. bad_flag(ARG1) ) THEN
+                     result(i,j,k,l,m,n) = arg_1(ii,jj,k1,l1,m1,n1)
+                  ENDIF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+               l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400        CONTINUE
+
+               m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500        CONTINUE
+
+               n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600        CONTINUE
+
+         ENDIF  ! IF (ibot .GE. ...  .AND. itop .LE.  ...
+
+* Only one of the ARG4 and one of the ARG5 actually increments
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+
+         i5 = i5 + arg_incr(X_AXIS,ARG5)
+         j5 = j5 + arg_incr(Y_AXIS,ARG5)
+         k5 = k5 + arg_incr(Z_AXIS,ARG5)
+         l5 = l5 + arg_incr(T_AXIS,ARG5)
+         m5 = m5 + arg_incr(E_AXIS,ARG5)
+         n5 = n5 + arg_incr(F_AXIS,ARG5)
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexyt.F b/fer/efi/samplexyt.F
new file mode 100644
index 0000000..a295ff4
--- /dev/null
+++ b/fer/efi/samplexyt.F
@@ -0,0 +1,755 @@
+*
+* samplexyt.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*  -------------------------------------------------------------------
+*
+* This function samples 4-d data at the x, y, t locations indicated by 
+* args 2, 3,4
+* 1/18/08  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y and t axes,
+*         and keeps the z axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexyt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y,T) points, ',
+     .        'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 5)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 'T values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexyt_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexyt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mxh, myh, mth, mxl, myl, mtl
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* Allocate double the length of the axes for REAL*8 work arrays.
+* For x and t axes allow yet one more point for handling modulo axes
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mtl = arg_lo_ss(T_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mth = mtl + 
+     .     2* (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 2)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  taxdat
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdatlo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdathi
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexyt_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .         result, xaxdat, yaxdat, taxdat, taxdatlo, taxdathi)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2)
+      REAL*8 taxdat(wrk3lox:wrk3lox+(wrk3hix-wrk3lox)/2)
+      REAL*8 taxdatlo(wrk4lox:wrk4lox+(wrk4hix-wrk4lox)/2)
+      REAL*8 taxdathi(wrk5lox:wrk5lox+(wrk5hix-wrk5lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER STR_UPCASE
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER nt, ntx, nty, ntz, ntt, nte, ntf
+      INTEGER ndimx, ndimy, ndimt
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER ic, imatch, jmatch, lmatch
+      INTEGER ibot, itop, jbot, jtop, lbot, ltop
+      INTEGER xlo, xhi, ylo, yhi, tlo, thi
+      LOGICAL ok
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt, aa, bb
+      REAL xbot, xtop, ybot, ytop, tbot, ttop
+      REAL xfrac, yfrac, tfrac_lo, tfrac_hi
+      REAL dx, dt, delmodx, delmodt, xpt, ypt, tpt
+      CHARACTER err_msg*255, test_str*16
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = MAX(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nye = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      ny = MAX(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ntx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nty = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      ntz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      ntt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nte = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      ntf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nt = MAX(ntx, nty, ntz, ntt, nte, ntf)
+
+      ndimx = 0
+      ndimy = 0
+      ndimt = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) )
+     .       ndimx = ndimx + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) )
+     .       ndimy = ndimy + 1
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) )
+     .       ndimt = ndimt + 1
+   10 CONTINUE
+
+      IF ((nx .NE. ny) .OR. (nx .NE. nt) .OR. 
+     .    (ndimx .GT. 1) .OR. (ndimy .GT. 1) .OR. (ndimt .GT. 1)) THEN
+         WRITE (err_msg, 20)
+         GO TO 999
+      ENDIF
+
+   20 FORMAT('Arguments 2, 3, and 4 must be 1-dimensional ',
+     .       'lists of equal length')
+
+*  Get x, y, t coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+      CALL ef_get_coordinates(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+      CALL ef_get_box_lo_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdatlo)
+      CALL ef_get_box_hi_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdathi)
+
+*  Check to see if input x axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      tlo = arg_lo_ss(T_AXIS,ARG1)
+      thi = arg_hi_ss(T_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(1))
+         ok = (test_str(1:3) .EQ. 'DEG' .OR. regular(1))
+         IF ( .NOT. ok ) THEN
+            err_msg = 'cannot handle MODULO X axis that is not regular'
+            GO TO 999
+         ENDIF
+         dx = xaxdat(xlo+1) - xaxdat(xlo)
+         delmodx = 360.
+         xaxdat(xhi+1) = xaxdat(xlo)
+      ENDIF
+      IF ( modulo(4) ) THEN
+         IF ( .NOT. regular(4) ) THEN
+            err_msg = 'cannot handle MODULO T axis that is not regular'
+            GO TO 999
+         ENDIF
+         dt = taxdathi(tlo) - taxdatlo(tlo)
+         delmodt = taxdat(thi) - taxdat(tlo) + dt
+         taxdat(thi+1) = taxdat(tlo)
+      ENDIF
+
+*  For each (xpt,ypt,tpt) triple, 
+*  1) search the time coordinates of arg 1 for the nearest Time match
+*  2) search the data array arg_1 for the nearest higher (x,y) grid 
+*     coordinates.  Interpolate in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+* Y-axis and T-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         ypt = arg_3(i3,j3,k3,l3,m3,n3)
+         tpt = arg_4(i4,j4,k4,l4,m4,n4)
+
+         IF ( xpt .EQ. bad_flag(ARG2) .OR.
+     .        ypt .EQ. bad_flag(ARG3) .OR.
+     .        tpt .EQ. bad_flag(ARG4) ) THEN
+            DO 30 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 30 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 30 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   30       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+* Try to get tpt in range if the T-axis is modulo
+         IF ( modulo(4) ) THEN
+            DO WHILE ( tpt .GE. taxdathi(thi) ) 
+               tpt = tpt - delmodt
+            ENDDO
+            DO WHILE ( tpt .LT. taxdatlo(tlo) )
+               tpt = tpt + delmodt
+            ENDDO
+         ENDIF
+
+* Check if tpt is in the T-axis range.
+         lbot = ef_unspecified_int4
+         lmatch = ef_unspecified_int4
+         DO 410 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+            IF ( TM_FPEQ(tpt, taxdat(l1)) ) THEN
+               lmatch = l1
+               GOTO 420
+            ELSE IF ( tpt .GE. taxdatlo(l1) ) THEN
+               lbot = l1
+            ENDIF
+  410    CONTINUE
+
+* Check that tpt is not beyond the upper end of the T-axis range.
+         IF ( tpt .GT. taxdathi(thi) ) THEN
+            IF ( .NOT. modulo(4) )
+     .         lbot = ef_unspecified_int4
+         ENDIF
+
+  420    IF ( lmatch .NE. ef_unspecified_int4 ) THEN
+            lbot = lmatch
+            ltop = lmatch
+         ELSE IF ( lbot .NE. ef_unspecified_int4 ) THEN
+*           using cell bounds taxdatlo, taxdathi
+            ltop = lbot
+         ELSE
+*           tpt outside the grid
+            DO 430 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 430 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 430 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  430       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         tbot = taxdatlo(lbot)
+         ttop = taxdathi(ltop)
+
+         IF ( modulo(4) .AND. (ttop .LT. tbot) ) THEN
+            lbot = thi
+            ltop = tlo
+            tbot = tbot - delmodt
+            IF ( tpt .GT. ttop )
+     .         tpt = tpt - delmodt
+         ENDIF
+         IF ( ttop .EQ. tbot ) THEN 
+            tfrac_lo = 1.
+         ELSE
+            tfrac_lo = (ttop - tpt) / (ttop - tbot)
+         ENDIF
+         tfrac_hi = 1. - tfrac_lo
+ 
+* Try to get xpt in range if the X-axis is modulo
+         IF ( modulo(1) ) THEN
+            DO WHILE ( xpt .GE. xaxdat(xhi) ) 
+               xpt = xpt - delmodx
+            ENDDO
+            DO WHILE ( xpt .LT. xaxdat(xlo) )
+               xpt = xpt + delmodx
+            ENDDO
+         ENDIF
+
+* Check if xpt is in the X-axis range.
+         ibot = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+
+         DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xpt, xaxdat(i1)) ) THEN
+               imatch = i1
+               GOTO 120
+            ELSE IF ( xpt .GT. xaxdat(i1) ) THEN
+               ibot = i1
+            ENDIF
+  110    CONTINUE
+
+* Check that xpt is not beyond the upper end of the X-axis range.
+         IF ( xpt .GT. xaxdat(xhi) ) THEN
+            IF ( .NOT. modulo(1) ) 
+     .         ibot = ef_unspecified_int4
+         ENDIF
+
+  120    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+            ibot = imatch
+            itop = imatch
+         ELSE IF ( ibot .NE. ef_unspecified_int4 ) THEN
+* If modulo(1) then there is an extra xaxdat so itop is in range
+            itop = ibot + 1
+         ELSE
+*           xpt outside the grid
+            DO 130 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 130 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 130 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  130       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         xbot = xaxdat(ibot)
+         xtop = xaxdat(itop)
+         IF ( modulo(1) .AND. (xtop .LT. xbot) ) THEN
+            ibot = xhi
+            itop = xlo
+            xbot = xbot - delmodx
+            IF (xpt .GT. xtop)
+     .         xpt = xpt - delmodx
+         ENDIF
+         IF ( xtop .EQ. xbot ) THEN 
+            xfrac = 0.
+         ELSE
+            xfrac = (xpt - xbot) / (xtop - xbot)
+         ENDIF
+
+* Check if ypt is in the Y-axis range.
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         DO 210 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(ypt, yaxdat(j1)) ) THEN
+               jmatch = j1
+               GOTO 220
+            ELSE IF ( ypt .GT. yaxdat(j1) ) THEN
+               jbot = j1
+            ENDIF
+  210    CONTINUE
+
+* Check that ypt is not beyond the upper end of the Y-axis range.
+         IF ( ypt .GT. yaxdat(yhi) ) THEN
+             jbot = ef_unspecified_int4
+         ENDIF
+
+  220    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+            jbot = jmatch
+            jtop = jmatch
+         ELSE IF ( jbot .NE. ef_unspecified_int4) THEN
+            jtop = jbot + 1
+         ELSE
+*           ypt outside the grid
+            DO 230 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 230 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 230 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  230       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         ybot = yaxdat(jbot)
+         ytop = yaxdat(jtop)
+         IF ( ytop .EQ. ybot ) THEN 
+            yfrac = 0.
+         ELSE
+            yfrac = (ypt - ybot) / (ytop - ybot)
+         ENDIF
+
+* Loop through the Z/E/F axes, assigning results for this coordinate pair
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( arg_1(ibot,jbot,k1,lbot,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(ibot,jbot,k1,ltop,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(ibot,jtop,k1,lbot,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(ibot,jtop,k1,ltop,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(itop,jbot,k1,lbot,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(itop,jbot,k1,ltop,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(itop,jtop,k1,lbot,m1,n1)
+     .                         .NE. bad_flag(ARG1) .AND.
+     .              arg_1(itop,jtop,k1,ltop,m1,n1)
+     .                         .NE. bad_flag(ARG1) ) THEN
+
+* First T-axis interpolation
+                  aa = arg_1(ibot,jbot,k1,lbot,m1,n1)
+                  bb = arg_1(ibot,jbot,k1,ltop,m1,n1)
+                  fbb = aa * tfrac_lo + bb * tfrac_hi
+
+                  aa = arg_1(itop,jbot,k1,lbot,m1,n1)
+                  bb = arg_1(itop,jbot,k1,ltop,m1,n1)
+                  ftb = aa * tfrac_lo + bb * tfrac_hi
+
+                  aa = arg_1(ibot,jtop,k1,lbot,m1,n1)
+                  bb = arg_1(ibot,jtop,k1,ltop,m1,n1)
+                  fbt = aa * tfrac_lo + bb * tfrac_hi
+
+                  aa = arg_1(itop,jtop,k1,lbot,m1,n1)
+                  bb = arg_1(itop,jtop,k1,ltop,m1,n1)
+                  ftt = aa * tfrac_lo + bb * tfrac_hi
+
+* Next X axis interpolation
+                  fxbot = fbb + xfrac * (ftb - fbb)
+                  fxtop = fbt + xfrac * (ftt - fbt)
+
+* Now Y-axis interpolation
+                  result(i,j,k,l,m,n) = fxbot + yfrac *
+     .                                  (fxtop - fxbot)
+
+               ELSE
+
+*                  some component is undefined
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ENDIF
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2, one of the ARG3, and one of ARG4 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+  700 CONTINUE
+
+      RETURN
+
+  999 CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexyt_nrst.F b/fer/efi/samplexyt_nrst.F
new file mode 100644
index 0000000..3786704
--- /dev/null
+++ b/fer/efi/samplexyt_nrst.F
@@ -0,0 +1,721 @@
+*
+* samplexyt_nrst.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+*  -------------------------------------------------------------------
+*
+* This function samples 4-d data at the x, y, t locations indicated by 
+* args 2, 3,4
+* 1/18/08  Ansley Manke 
+*         Result is abstract on the x axis, normal on the y and t axes,
+*         and keeps the z axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexyt_nrst_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Y,T) points, ',
+     .        'using nearest grid intersection')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        NORMAL,
+     .                                IMPLIED_BY_ARGS, NORMAL,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 5)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg, 'T values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexyt_nrst_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+      INTEGER nx, ny, nz, nt, ne, nf
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = max(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexyt_nrst_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER mxh, myh, mth, mxl, myl, mtl
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+* Allocate double the length of the axes for REAL*8 work arrays.
+* For x and t axes allow yet one more point for handling modulo axes
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mtl = arg_lo_ss(T_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 2)
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mth = mtl + 
+     .     2* (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 2)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  taxdat
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdatlo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*  taxdathi
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexyt_nrst_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .         result, xaxdat, yaxdat, taxdat, taxdatlo, taxdathi)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz, 
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz, 
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+      REAL*8 yaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2)
+      REAL*8 taxdat(wrk3lox:wrk3lox+(wrk3hix-wrk3lox)/2)
+      REAL*8 taxdatlo(wrk4lox:wrk4lox+(wrk4hix-wrk4lox)/2)
+      REAL*8 taxdathi(wrk5lox:wrk5lox+(wrk5hix-wrk5lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER STR_UPCASE
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER nt, ntx, nty, ntz, ntt, nte, ntf
+      INTEGER ndimx, ndimy, ndimt
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER i4, j4, k4, l4, m4, n4
+      INTEGER ic, imatch, jmatch, lmatch
+      INTEGER ibot, itop, jbot, jtop, lbot, ltop
+      INTEGER xlo, xhi, ylo, yhi, tlo, thi
+      LOGICAL ok
+
+      REAL xbot, xtop, ybot, ytop, tbot, ttop
+      REAL x_to_xbot, x_to_xtop, y_to_ybot, y_to_ytop, t_to_tbot, t_to_ttop
+      REAL dx, dt, delmodx, delmodt, xpt, ypt, tpt
+      CHARACTER err_msg*255, test_str*16
+
+C  variables for checking axis characteristics (modulo axes)
+
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = MAX(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nyx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nye = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      ny = MAX(nyx, nyy, nyz, nyt, nye, nyf)
+
+      ntx = arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4) + 1
+      nty = arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4) + 1
+      ntz = arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4) + 1
+      ntt = arg_hi_ss(T_AXIS,ARG4) - arg_lo_ss(T_AXIS,ARG4) + 1
+      nte = arg_hi_ss(E_AXIS,ARG4) - arg_lo_ss(E_AXIS,ARG4) + 1
+      ntf = arg_hi_ss(F_AXIS,ARG4) - arg_lo_ss(F_AXIS,ARG4) + 1
+      nt = MAX(ntx, nty, ntz, ntt, nte, ntf)
+
+      ndimx = 0
+      ndimy = 0
+      ndimt = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) )
+     .       ndimx = ndimx + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) )
+     .       ndimy = ndimy + 1
+         IF ( arg_hi_ss(i,ARG4) .GT. arg_lo_ss(i,ARG4) )
+     .       ndimt = ndimt + 1
+   10 CONTINUE
+
+      IF ((nx .NE. ny) .OR. (nx .NE. nt) .OR. 
+     .    (ndimx .GT. 1) .OR. (ndimy .GT. 1) .OR. (ndimt .GT. 1)) THEN
+         WRITE (err_msg, 20)
+         GO TO 999
+      ENDIF
+
+   20 FORMAT('Arguments 2, 3, and 4 must be 1-dimensional ',
+     .       'lists of equal length')
+
+*  Get x, y, t coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+      CALL ef_get_coordinates(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+      CALL ef_get_box_lo_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdatlo)
+      CALL ef_get_box_hi_lim(id, ARG1, T_AXIS,
+     .   arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdathi)
+
+*  Check to see if input x axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      tlo = arg_lo_ss(T_AXIS,ARG1)
+      thi = arg_hi_ss(T_AXIS,ARG1)
+
+      IF ( modulo(1) ) THEN
+         ic = STR_UPCASE (test_str, ax_units(1))
+         ok = (test_str(1:3) .EQ. 'DEG' .OR. regular(1))
+         IF ( .NOT. ok ) THEN
+            err_msg = 'cannot handle MODULO X axis that is not regular'
+            GO TO 999
+         ENDIF
+         dx = xaxdat(xlo+1) - xaxdat(xlo)
+         delmodx = 360.
+         xaxdat(xhi+1) = xaxdat(xlo)
+      ENDIF
+      IF ( modulo(4) ) THEN
+         IF ( .NOT. regular(4) ) THEN
+            err_msg = 'cannot handle MODULO T axis that is not regular'
+            GO TO 999
+         ENDIF
+         dt = taxdathi(tlo) - taxdatlo(tlo)
+         delmodt = taxdat(thi) - taxdat(tlo) + dt
+         taxdat(thi+1) = taxdat(tlo)
+      ENDIF
+
+*  For each (xpt,ypt,tpt) triple, 
+*  1) search the time coordinates of arg 1 for the nearest Time match
+*  2) search the data array arg_1 for the nearest higher (x,y) grid 
+*     coordinates.  Interpolate in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+      i4 = arg_lo_ss(X_AXIS,ARG4)
+      j4 = arg_lo_ss(Y_AXIS,ARG4)
+      k4 = arg_lo_ss(Z_AXIS,ARG4)
+      l4 = arg_lo_ss(T_AXIS,ARG4)
+      m4 = arg_lo_ss(E_AXIS,ARG4)
+      n4 = arg_lo_ss(F_AXIS,ARG4)
+
+* Y-axis and T-axis is normal to the result
+      j = res_lo_ss(Y_AXIS)
+      l = res_lo_ss(T_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         ypt = arg_3(i3,j3,k3,l3,m3,n3)
+         tpt = arg_4(i4,j4,k4,l4,m4,n4)
+
+         IF ( xpt .EQ. bad_flag(ARG2) .OR.
+     .        ypt .EQ. bad_flag(ARG3) .OR.
+     .        tpt .EQ. bad_flag(ARG4) ) THEN
+            DO 30 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 30 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 30 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   30       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+* Try to get tpt in range if the T-axis is modulo
+         IF ( modulo(4) ) THEN
+            DO WHILE ( tpt .GE. taxdathi(thi) ) 
+               tpt = tpt - delmodt
+            ENDDO
+            DO WHILE ( tpt .LT. taxdatlo(tlo) )
+               tpt = tpt + delmodt
+            ENDDO
+         ENDIF
+
+* Check if tpt is in the T-axis range.
+         lbot = ef_unspecified_int4
+         lmatch = ef_unspecified_int4
+         DO 410 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+            IF ( TM_FPEQ(tpt, taxdat(l1)) ) THEN
+               lmatch = l1
+               GOTO 420
+            ELSE IF ( tpt .GE. taxdatlo(l1) ) THEN
+               lbot = l1
+            ENDIF
+  410    CONTINUE
+
+* Check that tpt is not beyond the upper end of the T-axis range.
+         IF ( tpt .GT. taxdathi(thi) ) THEN
+            IF ( .NOT. modulo(4) )
+     .         lbot = ef_unspecified_int4
+         ENDIF
+
+  420    IF ( lmatch .NE. ef_unspecified_int4 ) THEN
+            lbot = lmatch
+            ltop = lmatch
+         ELSE IF ( lbot .NE. ef_unspecified_int4 ) THEN
+*           using cell bounds taxdatlo, taxdathi
+            ltop = lbot
+         ELSE
+*           tpt outside the grid
+            DO 430 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 430 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 430 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  430       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         tbot = taxdatlo(lbot)
+         ttop = taxdathi(ltop)
+
+         IF ( modulo(4) .AND. (ttop .LT. tbot) ) THEN
+            lbot = thi
+            ltop = tlo
+            tbot = tbot - delmodt
+            IF ( tpt .GT. ttop )
+     .         tpt = tpt - delmodt
+         ENDIF
+
+         t_to_tbot = ABS(tpt - tbot)
+         t_to_ttop = ABS(tpt - ttop)
+         IF (t_to_tbot .LE. t_to_ttop) THEN
+            l1 = lbot
+         ELSE
+            l1 = lbot+1
+         ENDIF
+ 
+* Try to get xpt in range if the X-axis is modulo
+         IF ( modulo(1) ) THEN
+            DO WHILE ( xpt .GE. xaxdat(xhi) ) 
+               xpt = xpt - delmodx
+            ENDDO
+            DO WHILE ( xpt .LT. xaxdat(xlo) )
+               xpt = xpt + delmodx
+            ENDDO
+         ENDIF
+
+* Check if xpt is in the X-axis range.
+         ibot = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+
+         DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xpt, xaxdat(i1)) ) THEN
+               imatch = i1
+               GOTO 120
+            ELSE IF ( xpt .GT. xaxdat(i1) ) THEN
+               ibot = i1
+            ENDIF
+  110    CONTINUE
+
+* Check that xpt is not beyond the upper end of the X-axis range.
+         IF ( xpt .GT. xaxdat(xhi) ) THEN
+            IF ( .NOT. modulo(1) ) 
+     .         ibot = ef_unspecified_int4
+         ENDIF
+
+  120    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+            ibot = imatch
+            itop = imatch
+         ELSE IF ( ibot .NE. ef_unspecified_int4 ) THEN
+* If modulo(1) then there is an extra xaxdat so itop is in range
+            itop = ibot + 1
+         ELSE
+*           xpt outside the grid
+            DO 130 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 130 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 130 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  130       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         xbot = xaxdat(ibot)
+         xtop = xaxdat(itop)
+         IF ( modulo(1) .AND. (xtop .LT. xbot) ) THEN
+            ibot = xhi
+            itop = xlo
+            xbot = xbot - delmodx
+            IF (xpt .GT. xtop)
+     .         xpt = xpt - delmodx
+         ENDIF
+         x_to_xbot = ABS(xpt - xbot)
+         x_to_xtop = ABS(xpt - xtop)
+         IF (x_to_xbot .LE. x_to_xtop) THEN
+            i1 = ibot
+         ELSE
+            i1 = ibot+1
+         ENDIF
+
+
+* Check if ypt is in the Y-axis range.
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         DO 210 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(ypt, yaxdat(j1)) ) THEN
+               jmatch = j1
+               GOTO 220
+            ELSE IF ( ypt .GT. yaxdat(j1) ) THEN
+               jbot = j1
+            ENDIF
+  210    CONTINUE
+
+* Check that ypt is not beyond the upper end of the Y-axis range.
+         IF ( ypt .GT. yaxdat(yhi) ) THEN
+             jbot = ef_unspecified_int4
+         ENDIF
+
+  220    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+            jbot = jmatch
+            jtop = jmatch
+         ELSE IF ( jbot .NE. ef_unspecified_int4) THEN
+            jtop = jbot + 1
+         ELSE
+*           ypt outside the grid
+            DO 230 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 230 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 230 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  230       CONTINUE
+*           Go to the next triplet of coordinates
+            GOTO 690
+         ENDIF
+
+         ybot = yaxdat(jbot)
+         ytop = yaxdat(jtop)
+         y_to_ybot = ABS(ypt - ybot)
+         y_to_ytop = ABS(ypt - ytop)
+         IF (y_to_ybot .LE. y_to_ytop) THEN
+            j1 = jbot
+         ELSE
+            j1 = jbot+1
+         ENDIF
+
+* Loop through the Z/E/F axes, assigning results for this coordinate pair
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+            k1 = arg_lo_ss(Z_AXIS,ARG1)
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( i1 .EQ. ef_unspecified_int4 .OR.
+     .              j1 .EQ. ef_unspecified_int4 .OR.
+     .              l1 .EQ. ef_unspecified_int4) THEN 
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+	          result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+               ENDIF
+
+               k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300        CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2, one of the ARG3, and one of ARG4 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+
+         i4 = i4 + arg_incr(X_AXIS,ARG4)
+         j4 = j4 + arg_incr(Y_AXIS,ARG4)
+         k4 = k4 + arg_incr(Z_AXIS,ARG4)
+         l4 = l4 + arg_incr(T_AXIS,ARG4)
+         m4 = m4 + arg_incr(E_AXIS,ARG4)
+         n4 = n4 + arg_incr(F_AXIS,ARG4)
+  700 CONTINUE
+
+      RETURN
+
+  999 CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/samplexz.F b/fer/efi/samplexz.F
new file mode 100644
index 0000000..3eb7325
--- /dev/null
+++ b/fer/efi/samplexz.F
@@ -0,0 +1,587 @@
+*
+* samplexz.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that INCLUDE 's this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke  from samplexy  5/15/01
+* 11-Jan-06 *acm* declare xlo, xhi, zlo, zhi  as integer not real
+*
+* This function samples 4-d data on the x and z axes indicated by args 2 and 3
+*         Result is abstract on the x axis, normal on the y axis,
+*         and keeps the z and t axes of the input 4-d data.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE samplexz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (X,Z) points, ',
+     .        'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                NORMAL,          IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg, 'X values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg, 'Z values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE samplexz_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx, ny, nz, nt, ne, nf
+      INTEGER my_lo, my_hi
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = MAX(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE samplexz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mxh, mzh, mxl, mzl
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      mxl = arg_lo_ss(X_AXIS,ARG1)
+      mzl = arg_lo_ss(Z_AXIS,ARG1)
+
+      mxh = mxl + 
+     .     2* (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1)
+      mzh = mzl + 
+     .     2* (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1)
+
+*  xaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mxl, 1, 1, 1, 1, 1,
+     .                              mxh, 1, 1, 1, 1, 1)
+
+*  zaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              mzl, 1, 1, 1, 1, 1,
+     .                              mzh, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE samplexz_compute(id, arg_1, arg_2, arg_3, result,
+     .                            xaxdat, zaxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 xaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+      REAL*8 zaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      LOGICAL TM_FPEQ
+
+      INTEGER nx, nxx, nxy, nxz, nxt, nxe, nxf
+      INTEGER nz, nzx, nzy, nzz, nzt, nze, nzf
+      INTEGER ndimx, ndimz
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER imatch, kmatch
+      INTEGER ibot, itop, kbot, ktop
+      INTEGER xlo, xhi, zlo, zhi
+      REAL fxbot, fxtop, fbb, ftb, fbt, ftt
+      REAL xbot, xtop, zbot, ztop
+      REAL xfrac, zfrac
+      REAL delmodx, delmodz, xpt, zpt
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Validate argument dimensions
+      nxx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nxy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nxz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nxt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nxe = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nxf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      nx = MAX(nxx, nxy, nxz, nxt, nxe, nxf)
+
+      nzx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nzy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nzz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nzt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nze = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nzf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      nz = MAX(nzx, nzy, nzz, nzt, nze, nzf)
+
+      ndimx = 0
+      ndimz = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) ) 
+     .      ndimx = ndimx + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) ) 
+     .      ndimz= ndimz + 1
+   10 CONTINUE
+
+      IF ( (nx .NE. nz) .OR. (ndimx .GT. 1) .OR. (ndimz .GT.1) ) THEN
+         err_msg = 
+     .  'Arguments 2 and 3 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+
+*  Get x and z coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, X_AXIS,
+     .   arg_lo_ss(X_AXIS, ARG1), arg_hi_ss(X_AXIS, ARG1), xaxdat)
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxdat)
+
+*  Check to see if input x or z axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      xlo = arg_lo_ss(X_AXIS,ARG1)
+      xhi = arg_hi_ss(X_AXIS,ARG1)
+      zlo = arg_lo_ss(Z_AXIS,ARG1)
+      zhi = arg_hi_ss(Z_AXIS,ARG1)
+
+* Is this enough? (see samplexy and samplexyt)
+      IF ( modulo(X_AXIS) ) THEN
+         delmodx = xaxdat(xhi) - xaxdat(xlo)
+      ENDIF
+      IF ( modulo(Z_AXIS) ) THEN
+         delmodz = zaxdat(zhi) - zaxdat(zlo)
+      ENDIF
+
+*  For each (xpt,zpt) pair, search the data array 
+*   arg_1 for the nearest higher (x,z) grid coordinates.  Interpolate 
+*   in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+* Z-axis is normal to the results
+      k = res_lo_ss(Z_AXIS)
+
+      DO 700 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         xpt = arg_2(i2,j2,k2,l2,m2,n2)
+         zpt = arg_3(i3,j3,k3,l3,m3,n3)
+
+         IF ( xpt .EQ. bad_flag(ARG2) .OR.
+     .        zpt .EQ. bad_flag(ARG3) ) THEN
+            DO 30 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 30 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 30 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 30 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   30       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+* Try to get xpt in range if the X-axis is modulo
+         IF ( modulo(X_AXIS) ) THEN
+            DO WHILE ( xpt .GE. xaxdat(xhi) ) 
+               xpt = xpt - delmodx
+            ENDDO
+            DO WHILE ( xpt .LT. xaxdat(xlo) )
+               xpt = xpt + delmodx
+            ENDDO
+         ENDIF
+
+* Check if xpt is in the X-axis range.
+         ibot = ef_unspecified_int4
+         imatch = ef_unspecified_int4
+
+         DO 110 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+            IF ( TM_FPEQ(xpt, xaxdat(i1)) ) THEN
+               imatch = i1
+               GOTO 120
+            ELSE IF ( xpt .GT. xaxdat(i1) ) THEN
+               ibot = i1
+            ENDIF
+  110    CONTINUE
+
+* Check that xpt is not beyond the upper end of the X-axis range.
+         IF ( xpt .GT. xaxdat(xhi) ) THEN
+            ibot = ef_unspecified_int4
+         ENDIF
+
+  120    IF ( imatch .NE. ef_unspecified_int4 ) THEN
+            ibot = imatch
+            itop = imatch
+         ELSE IF ( ibot .NE. ef_unspecified_int4 ) THEN
+            itop = ibot + 1
+         ELSE
+*           xpt outside the grid
+            DO 130 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 130 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 130 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 130 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  130       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+         xbot = xaxdat(ibot)
+         xtop = xaxdat(itop)
+         IF ( xtop .EQ. xbot ) THEN 
+            xfrac = 0.
+         ELSE
+            xfrac = (xpt - xbot) / (xtop - xbot)
+         ENDIF
+
+* Try to get zpt in range if the Z-axis is modulo
+         IF ( modulo(Z_AXIS) ) THEN
+            DO WHILE ( zpt .GE. zaxdat(zhi) ) 
+               zpt = zpt - delmodz
+            ENDDO
+            DO WHILE ( zpt .LT. zaxdat(zlo) )
+               zpt = zpt + delmodz
+            ENDDO
+         ENDIF
+
+* Check if zpt is in the Z-axis range.
+         kbot = ef_unspecified_int4
+         kmatch = ef_unspecified_int4
+
+         DO 310 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+            IF ( TM_FPEQ(zpt, zaxdat(k1)) ) THEN
+               kmatch = k1
+               GOTO 320
+            ELSE IF ( zpt .GT. zaxdat(k1) ) THEN
+               kbot = k1
+            ENDIF
+  310    CONTINUE
+
+* Check that zpt is not beyond the upper end of the Z-axis range.
+         IF ( zpt .GT. zaxdat(zhi) ) THEN
+            kbot = ef_unspecified_int4
+         ENDIF
+
+  320    IF ( kmatch .NE. ef_unspecified_int4 ) THEN
+            kbot = kmatch
+            ktop = kmatch
+         ELSE IF ( kbot .NE. ef_unspecified_int4 ) THEN
+            ktop = kbot + 1
+         ELSE
+*           zpt outside the grid
+            DO 330 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 330 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 330 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 330 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  330       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+         zbot = zaxdat(kbot)
+         ztop = zaxdat(ktop)
+         IF ( ztop .EQ. zbot ) THEN 
+            zfrac = 0.
+         ELSE
+            zfrac = (zpt - zbot) / (ztop - zbot)
+         ENDIF
+
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  First interpolate in x, getting values of the fcn at (x,kbot) and (x,ktop)
+               fbb = arg_1(ibot,j1,kbot,l1,m1,n1)
+               ftb = arg_1(itop,j1,kbot,l1,m1,n1)
+               fbt = arg_1(ibot,j1,ktop,l1,m1,n1)
+               ftt = arg_1(itop,j1,ktop,l1,m1,n1)
+
+               IF ( fbb .NE. bad_flag(ARG1)  .AND.
+     .              ftb .NE. bad_flag(ARG1)  .AND.
+     .              fbt .NE. bad_flag(ARG1)  .AND.
+     .              ftt .NE. bad_flag(ARG1) ) THEN
+
+                  fxbot = fbb + xfrac * (ftb - fbb)
+                  fxtop = fbt + xfrac * (ftt - fbt)
+
+*  Now interpolate in z, getting value at (x,z)
+                  result(i,j,k,l,m,n) = fxbot + zfrac * (fxtop - fxbot)
+
+               ELSE
+
+*                 Some component was undefined
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ENDIF
+
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400     CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2 and one of ARG3 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/sampleyz.F b/fer/efi/sampleyz.F
new file mode 100644
index 0000000..d584a72
--- /dev/null
+++ b/fer/efi/sampleyz.F
@@ -0,0 +1,591 @@
+*
+* sampleyz.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* From samplexy.F
+* Wednesday, May 02, 2001
+* 11-Jan-06 *acm* declare ylo, yhi, zlo, zhi as integer not real
+*
+* V68   3/12 Fix arg description.
+
+* This function samples 4-d data at y and z pts indicated by args 2 and 3
+* 
+*         Result is abstract on the Y axis, normal on the z axis,
+*         and keeps the x and t axes of the input 4-d data.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sampleyz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns data sampled at a set of (Y,Z) points, ',
+     .        'using linear interpolation')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                NORMAL,          IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT_TO_SAMPLE')
+      CALL ef_set_arg_desc(id, arg, 'variable (x,y,z,t,e,f) to sample')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg, 'Y values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg, 'Z values of sample points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* loss               lo subscript for an axis
+*
+* hiss               hi subscript for an axis
+*
+
+      SUBROUTINE sampleyz_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx, ny, nz, nt, ne, nf
+      INTEGER my_lo, my_hi
+
+*     Use utility functions to get context information about the 
+*     second argument, to set the abstract axis lo and hi indices.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG2) - arg_lo_ss(X_AXIS, ARG2) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG2) - arg_lo_ss(Y_AXIS, ARG2) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG2) - arg_lo_ss(Z_AXIS, ARG2) + 1
+      nt = arg_hi_ss(T_AXIS, ARG2) - arg_lo_ss(T_AXIS, ARG2) + 1
+      ne = arg_hi_ss(E_AXIS, ARG2) - arg_lo_ss(E_AXIS, ARG2) + 1
+      nf = arg_hi_ss(F_AXIS, ARG2) - arg_lo_ss(F_AXIS, ARG2) + 1
+
+      my_lo = 1
+      my_hi = MAX(nx,ny,nz,nt,ne,nf)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sampleyz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER myl, myh, mzl, mzh
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work arrays.
+
+      myl = arg_lo_ss(Y_AXIS,ARG1)
+      mzl = arg_lo_ss(Z_AXIS,ARG1)
+
+      myh = myl + 
+     .     2* (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1)
+      mzh = mzl + 
+     .     2* (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1)
+
+*  yaxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              myl, 1, 1, 1, 1, 1,
+     .                              myh, 1, 1, 1, 1, 1)
+
+*  zaxdat
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                              mzl, 1, 1, 1, 1, 1,
+     .                              mzh, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sampleyz_compute(id, arg_1, arg_2, arg_3, result,
+     .                            yaxdat, zaxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz, 
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 yaxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+      REAL*8 zaxdat(wrk2lox:wrk2lox+(wrk2hix-wrk2lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      LOGICAL TM_FPEQ
+
+      INTEGER ny, nyx, nyy, nyz, nyt, nye, nyf
+      INTEGER nz, nzx, nzy, nzz, nzt, nze, nzf
+      INTEGER ndimy, ndimz
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER jmatch, kmatch
+      INTEGER jbot, jtop, kbot, ktop
+      INTEGER ylo, yhi, zlo, zhi
+      REAL fybot, fytop, fbb, ftb, fbt, ftt
+      REAL ybot, ytop, zbot, ztop
+      REAL yfrac, zfrac
+      REAL delmody, delmodz, ypt, zpt
+      CHARACTER*255 err_msg
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C Validate argument dimensions
+      nyx = arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1
+      nyy = arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1
+      nyz = arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1
+      nyt = arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1
+      nye = arg_hi_ss(E_AXIS,ARG2) - arg_lo_ss(E_AXIS,ARG2) + 1
+      nyf = arg_hi_ss(F_AXIS,ARG2) - arg_lo_ss(F_AXIS,ARG2) + 1
+      ny = MAX(nyx, nyy, nyz, nyt, nye, nyf)
+
+      nzx = arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3) + 1
+      nzy = arg_hi_ss(Y_AXIS,ARG3) - arg_lo_ss(Y_AXIS,ARG3) + 1
+      nzz = arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3) + 1
+      nzt = arg_hi_ss(T_AXIS,ARG3) - arg_lo_ss(T_AXIS,ARG3) + 1
+      nze = arg_hi_ss(E_AXIS,ARG3) - arg_lo_ss(E_AXIS,ARG3) + 1
+      nzf = arg_hi_ss(F_AXIS,ARG3) - arg_lo_ss(F_AXIS,ARG3) + 1
+      nz = MAX(nzx, nzy, nzz, nzt, nze, nzf)
+
+      ndimy = 0
+      ndimz = 0
+      DO 10 i = X_AXIS,F_AXIS
+         IF ( arg_hi_ss(i,ARG2) .GT. arg_lo_ss(i,ARG2) ) 
+     .      ndimy = ndimy + 1
+         IF ( arg_hi_ss(i,ARG3) .GT. arg_lo_ss(i,ARG3) ) 
+     .      ndimz= ndimz + 1
+   10 CONTINUE
+
+      IF ( (ny .NE. nz) .OR. (ndimy .GT. 1) .OR. (ndimz .GT.1) ) THEN
+         err_msg =
+     .  'Arguments 2 and 3 must be 1-dimensional lists of equal length'
+         GO TO 999
+      ENDIF
+
+*  Get y and z coordinates of the data to be sampled.
+
+      CALL ef_get_coordinates(id, ARG1, Y_AXIS,
+     .   arg_lo_ss(Y_AXIS, ARG1), arg_hi_ss(Y_AXIS, ARG1), yaxdat)
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .   arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxdat)
+
+*  Check to see if input y or z axis is modulo
+
+      CALL ef_get_axis_info_6d(id, ARG1, ax_name, ax_units,
+     .                         backward, modulo, regular)
+
+      ylo = arg_lo_ss(Y_AXIS,ARG1)
+      yhi = arg_hi_ss(Y_AXIS,ARG1)
+      zlo = arg_lo_ss(Z_AXIS,ARG1)
+      zhi = arg_hi_ss(Z_AXIS,ARG1)
+
+* Is this enough? (see samplexy and samplexyt)
+      IF ( modulo(Y_AXIS) ) THEN
+         delmody = yaxdat(yhi) - yaxdat(ylo)
+      ENDIF
+      IF ( modulo(Z_AXIS) ) THEN
+         delmodz = zaxdat(zhi) - zaxdat(zlo)
+      ENDIF
+
+*  For each (ypt,zpt) pair, search the data array 
+*   arg_1 for the nearest higher (y,z) grid coordinates.  Interpolate 
+*   in 2 directions for the result.
+
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      k2 = arg_lo_ss(Z_AXIS,ARG2)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+
+* Z-axis is normal to the results
+      k = res_lo_ss(Z_AXIS)
+
+      DO 700 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         ypt = arg_2(i2,j2,k2,l2,m2,n2)
+         zpt = arg_3(i3,j3,k3,l3,m3,n3)
+
+         IF ( ypt .EQ. bad_flag(ARG2) .OR.
+     .        zpt .EQ. bad_flag(ARG3) ) THEN
+            DO 30 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 30 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 30 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 30 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+   30       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+* Try to get ypt in range if the Y-axis is modulo
+         IF ( modulo(Y_AXIS) ) THEN
+            DO WHILE ( ypt .GE. yaxdat(yhi) ) 
+               ypt = ypt - delmody
+            ENDDO
+            DO WHILE ( ypt .LT. yaxdat(ylo) )
+               ypt = ypt + delmody
+            ENDDO
+         ENDIF
+
+* Check if ypt is in the Y-axis range.
+         jbot = ef_unspecified_int4
+         jmatch = ef_unspecified_int4
+
+         DO 210 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+            IF ( TM_FPEQ(ypt, yaxdat(j1)) ) THEN
+               jmatch = j1
+               GOTO 220
+            ELSE IF ( ypt .GT. yaxdat(j1) ) THEN
+               jbot = j1
+            ENDIF
+  210    CONTINUE
+
+* Check that ypt is not beyond the upper end of the Y-axis range.
+         IF ( ypt .GT. yaxdat(yhi) ) THEN
+            jbot = ef_unspecified_int4
+         ENDIF
+
+  220    IF ( jmatch .NE. ef_unspecified_int4 ) THEN
+            jbot = jmatch
+            jtop = jmatch
+         ELSE IF ( jbot .NE. ef_unspecified_int4 ) THEN
+            jtop = jbot + 1
+         ELSE
+*           ypt outside the grid
+            DO 230 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 230 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 230 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 230 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  230       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+         ybot = yaxdat(jbot)
+         ytop = yaxdat(jtop)
+         IF ( ytop .EQ. ybot ) THEN 
+            yfrac = 0.
+         ELSE
+            yfrac = (ypt - ybot) / (ytop - ybot)
+         ENDIF
+
+* Try to get zpt in range if the Z-axis is modulo
+         IF ( modulo(Z_AXIS) ) THEN
+            DO WHILE ( zpt .GE. zaxdat(zhi) ) 
+               zpt = zpt - delmodz
+            ENDDO
+            DO WHILE ( zpt .LT. zaxdat(zlo) )
+               zpt = zpt + delmodz
+            ENDDO
+         ENDIF
+
+* Check if zpt is in the Z-axis range.
+         kbot = ef_unspecified_int4
+         kmatch = ef_unspecified_int4
+
+         DO 310 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+            IF ( TM_FPEQ(zpt, zaxdat(k1)) ) THEN
+               kmatch = k1
+               GOTO 320
+            ELSE IF ( zpt .GT. zaxdat(k1) ) THEN
+               kbot = k1
+            ENDIF
+  310    CONTINUE
+
+* Check that zpt is not beyond the upper end of the Z-axis range.
+         IF ( zpt .GT. zaxdat(zhi) ) THEN
+            kbot = ef_unspecified_int4
+         ENDIF
+
+  320    IF ( kmatch .NE. ef_unspecified_int4 ) THEN
+            kbot = kmatch
+            ktop = kmatch
+         ELSE IF ( kbot .NE. ef_unspecified_int4 ) THEN
+            ktop = kbot + 1
+         ELSE
+*           zpt outside the grid
+            DO 330 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+            DO 330 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+            DO 330 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            DO 330 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = bad_flag_result
+  330       CONTINUE
+*           Go to the next pair of coordinates
+            GOTO 690
+         ENDIF
+
+         zbot = zaxdat(kbot)
+         ztop = zaxdat(ktop)
+         IF ( ztop .EQ. zbot ) THEN 
+            zfrac = 0.
+         ELSE
+            zfrac = (zpt - zbot) / (ztop - zbot)
+         ENDIF
+
+         n1 = arg_lo_ss(F_AXIS,ARG1)
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+         m1 = arg_lo_ss(E_AXIS,ARG1)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+         l1 = arg_lo_ss(T_AXIS,ARG1)
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  First interpolate in y, getting values of the fcn at (y,kbot) and (y,ktop)
+               fbb = arg_1(i1,jbot,kbot,l1,m1,n1)
+               ftb = arg_1(i1,jtop,kbot,l1,m1,n1)
+               fbt = arg_1(i1,jbot,ktop,l1,m1,n1)
+               ftt = arg_1(i1,jtop,ktop,l1,m1,n1)
+
+               IF ( fbb .NE. bad_flag(ARG1)  .AND.
+     .              ftb .NE. bad_flag(ARG1)  .AND.
+     .              fbt .NE. bad_flag(ARG1)  .AND.
+     .              ftt .NE. bad_flag(ARG1) ) THEN
+
+                  fybot = fbb + yfrac * (ftb - fbb)
+                  fytop = fbt + yfrac * (ftt - fbt)
+
+*  Now interpolate in z, getting value at (y,z)
+                  result(i,j,k,l,m,n) = fybot + zfrac * (fytop - fybot)
+
+               ELSE
+
+*                 Some component was undefined
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ENDIF
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400     CONTINUE
+
+            m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500     CONTINUE
+
+            n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600     CONTINUE
+
+* Only one of the ARG2 and one of ARG3 actually increments
+ 690     i2 = i2 + arg_incr(X_AXIS,ARG2)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         k2 = k2 + arg_incr(Z_AXIS,ARG2)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+      END
diff --git a/fer/efi/scat2ddups.F b/fer/efi/scat2ddups.F
new file mode 100644
index 0000000..f2d2113
--- /dev/null
+++ b/fer/efi/scat2ddups.F
@@ -0,0 +1,271 @@
+*
+* scat2ddups.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Steve Hankin
+* Jan, 2001
+
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2ddups_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Flag non-unique points. '
+     .            // 'L=1 - # dups of this pt, L=2 - index of dup pt')
+
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name (id, arg, 'coord 1')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Coordinate 1 (normally longitude)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name (id, arg, 'coord 2')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Coordinate 2 (normally latitude)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name (id, arg, 'epsilon 1')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Two coord 1s within epsilon 1 considered duplicates')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name (id, arg, 'epsilon 2')
+      CALL ef_set_arg_unit(id, arg, 'none')
+      CALL ef_set_arg_desc(id, arg,
+     .         'Two coord 2s within epsilon 2 considered duplicates')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE scat2ddups_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+        CALL EF_SET_AXIS_LIMITS(id, T_AXIS, 1, 2)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2ddups_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                              result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+* Arguements 3 and 4 are single floating-point values
+      REAL arg_3, arg_4
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER ii, size1, size2
+
+* get the subscripting limits and flags
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure that we were not passed a span along the T axis
+      IF ( (arg_lo_ss(T_AXIS,ARG1) .NE. arg_hi_ss(T_AXIS,ARG1)) .OR.
+     .     (arg_lo_ss(T_AXIS,ARG2) .NE. arg_hi_ss(T_AXIS,ARG2)) ) THEN
+         CALL EF_BAIL_OUT(id, 'Cannot handle a T range on argument')
+         STOP 'EF_BAIL_OUT returned'
+      ENDIF
+
+* ensure that the sizes of the inputs match
+      size1 = 1
+      size2 = 1
+      DO ii = X_AXIS,F_AXIS
+         size1 = size1 * (arg_hi_ss(ii,ARG1) - arg_lo_ss(ii,ARG1) + 1)
+         size2 = size2 * (arg_hi_ss(ii,ARG2) - arg_lo_ss(ii,ARG2) + 1)
+      END DO
+      IF ( size1 .NE. size2 ) THEN
+         CALL EF_BAIL_OUT(id, 'Coordinate arrays are not conformable')
+         STOP 'EF_BAIL_OUT returned'
+      ENDIF
+
+* ensure that the epsilon values make sense
+      IF ( arg_3 .LT. 0.0 .OR. arg_4 .LT. 0.0 ) THEN
+         CALL EF_BAIL_OUT(id, 'Negative epsilon value')
+         STOP 'EF_BAIL_OUT returned'
+      ENDIF
+
+* flag the duplicates
+      CALL FLAG2DDUPS( size1,
+     .                 arg_1(arg_lo_ss(X_AXIS,ARG1),
+     .                       arg_lo_ss(Y_AXIS,ARG1),
+     .                       arg_lo_ss(Z_AXIS,ARG1),
+     .                       arg_lo_ss(T_AXIS,ARG1),
+     .                       arg_lo_ss(E_AXIS,ARG1),
+     .                       arg_lo_ss(F_AXIS,ARG1)),
+     .                 arg_2(arg_lo_ss(X_AXIS,ARG2),
+     .                       arg_lo_ss(Y_AXIS,ARG2),
+     .                       arg_lo_ss(Z_AXIS,ARG2),
+     .                       arg_lo_ss(T_AXIS,ARG2),
+     .                       arg_lo_ss(E_AXIS,ARG2),
+     .                       arg_lo_ss(F_AXIS,ARG2)),
+     .                 arg_3,
+     .                 arg_4,
+     .                 result(memreslox, memresloy, memresloz,
+     .                                1, memresloe, memreslof),
+     .                 result(memreslox, memresloy, memresloz,
+     .                                2, memresloe, memreslof) )
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_bin_xy.F b/fer/efi/scat2grid_bin_xy.F
new file mode 100644
index 0000000..6236a0e
--- /dev/null
+++ b/fer/efi/scat2grid_bin_xy.F
@@ -0,0 +1,496 @@
+*
+*  scat2grid_bin_xy
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* February 1, 2008
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_bin_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Put scattered data into XY grid by binning')
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 5)
+
+* Output grid is determined by arguments 4 and 5, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_bin_xy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* counts
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_bin_xy_compute(id, arg_1, arg_2, arg_3,
+     .                          arg_4, arg_5, result, xaxlo, xaxhi,
+     .                          yaxlo, yaxhi, counts)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y triples to be gridded.
+*  arg_3  variable, /
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2)
+      REAL counts(wrk5lox:wrk5hix, wrk5loy:wrk5hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1
+      INTEGER lo_ss, hi_ss
+      INTEGER nxpts, nypts, nscat
+      INTEGER idx, nx, ny
+      REAL xx, yy, ff
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if the output X axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+*  Check to see if the output Y axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      nscat = 0
+      DO 80 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG3)
+         hi_ss = arg_hi_ss(idx,ARG3)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nscat .NE. 0 ) THEN
+               nscat = nscat * (hi_ss - lo_ss + 1)
+            ELSE
+               nscat = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  80  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. nscat ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' F()  ', nxpts, nscat
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nscat .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y points'
+         GOTO 999
+      ENDIF
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GOTO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GOTO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_box_limits(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                       arg_hi_ss(X_AXIS, ARG4), xaxlo, xaxhi)
+
+      CALL ef_get_box_limits(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                       arg_hi_ss(Y_AXIS, ARG5), yaxlo, yaxhi)
+
+*  Compute result
+
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize result.
+
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            result(i,j,k,l,m,n) = 0.0
+         ENDDO
+      ENDDO
+
+*  Initialize counts.
+
+      DO j1 = 1, ny
+         DO i1 = 1, nx
+            counts(i1,j1) = 0.0
+         ENDDO
+      ENDDO
+
+*  Loop over x and y, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z,T,E or F axis of ARG1
+*  and ARG2, sending them to a subroutine collapses the extra dimensions
+*  so the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout3(arg_1, arg_2, arg_3, idx, xx, yy, ff)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) .OR.
+     .        ff .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xaxlo(1), xaxhi(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yaxlo(1), yaxhi(ny), modylen, 1, yy)
+         ENDIF
+
+*  Put fcn into result variable.
+
+         j1 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            IF ( yy .GE. yaxlo(j1) .AND. yy .LE. yaxhi(j1) ) THEN
+
+         i1 = 1
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            IF ( xx .GE. xaxlo(i1) .AND. xx .LE. xaxhi(i1) ) THEN
+
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + ff
+               counts(i1,j1) = counts(i1,j1) + 1.0
+*              Location found and point assigned; go to the next scatter point
+               GOTO 700
+
+            ENDIF
+            i1 = i1 + 1
+ 100     CONTINUE
+
+            ENDIF
+            j1 = j1 + 1
+ 200     CONTINUE
+
+ 700  CONTINUE
+
+* Compute result, average in each bin.
+
+      j1 = 1
+      DO 210 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = 1
+      DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         IF ( counts(i1,j1) .GT. 0.0 ) THEN
+            result(i,j,k,l,m,n) = result(i,j,k,l,m,n) / counts(i1,j1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + 1
+ 110  CONTINUE
+
+         j1 = j1 + 1
+ 210  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_bin_xyt.F b/fer/efi/scat2grid_bin_xyt.F
new file mode 100644
index 0000000..2d0c879
--- /dev/null
+++ b/fer/efi/scat2grid_bin_xyt.F
@@ -0,0 +1,590 @@
+*
+*  scat2grid_bin_xyt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* April 2010
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_bin_xyt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Put scattered data into XYT grid by binning')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x, y, and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of the output grid, ' //
+     .        'with same units and origin as TPTS')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_bin_xyt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* taxhi  output t axis
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* counts
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1,     1,     1, 1, 1, 1,
+     .                            nxout, nyout, ntout, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_bin_xyt_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, result,
+     .                           xaxlo, xaxhi, yaxlo, yaxhi,
+     .                           taxlo, taxhi, counts)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  variable, /
+*  arg_5  xaxis of new grid
+*  arg_6  yaxis of new grid
+*  arg_7  taxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2)
+      REAL counts(wrk7lox:wrk7hix, wrk7loy:wrk7hiy, wrk7loz:wrk7hiz)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1
+      INTEGER lo_ss, hi_ss
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER idx, nx, ny, nt
+      REAL xx, yy, tt, ff
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy, modulot
+      REAL*8 modxlen, modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if the output X-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, X_AXIS, modxlen)
+      ENDIF
+
+*  Check to see if the output Y-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG6, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG6, Y_AXIS, modylen)
+      ENDIF
+
+*  Check to see if the output T-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG7, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG7, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG3)
+         hi_ss = arg_hi_ss(idx,ARG3)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      nscat = 0
+      DO 80 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG4)
+         hi_ss = arg_hi_ss(idx,ARG4)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nscat .NE. 0 ) THEN
+               nscat = nscat * (hi_ss - lo_ss + 1)
+            ELSE
+               nscat = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  80  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' TPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. nscat ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' F()  ', nxpts, nscat
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nscat .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y, t points'
+         GOTO 999
+      ENDIF
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG5)
+      hi_ss = arg_hi_ss(X_AXIS,ARG5)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be an X axis'
+         GOTO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG6)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG6)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Sixth argument must be a Y axis'
+         GOTO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG7)
+      hi_ss = arg_hi_ss(T_AXIS,ARG7)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Seventh argument must be a T axis'
+         GOTO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS, arg_lo_ss(X_AXIS, ARG5),
+     .                       arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS, arg_lo_ss(Y_AXIS, ARG6),
+     .                       arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS, arg_lo_ss(T_AXIS, ARG7),
+     .                       arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+
+*  Compute result
+
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize result.
+
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = 0.0
+            ENDDO
+         ENDDO
+      ENDDO
+
+*  Initialize counts.
+
+      DO l1 = 1, nt
+         DO j1 = 1, ny
+            DO i1 = 1, nx
+               counts(i1,j1,l1) = 0.0
+            ENDDO
+         ENDDO
+      ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z,T,E or F axis of ARG1
+*  and ARG2, sending them to a subroutine collapses the extra dimensions
+*  so the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout4(arg_1, arg_2, arg_3, arg_4, idx, xx, yy, tt, ff)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) .OR.
+     .        tt .EQ. bad_flag(ARG3) .OR. 
+     .        ff .EQ. bad_flag(ARG4) ) GOTO 700
+
+*  If output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xaxlo(1), xaxhi(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yaxlo(1), yaxhi(ny), modylen, 1, yy)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(taxlo(1), taxhi(nt), modtlen, 1, tt)
+         ENDIF
+
+*  Put fcn into result variable.
+
+         l1 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            IF ( tt .GE. taxlo(l1) .AND. tt .LE. taxhi(l1) ) THEN
+
+         j1 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            IF ( yy .GE. yaxlo(j1) .AND. yy .LE. yaxhi(j1) ) THEN
+
+         i1 = 1
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            IF ( xx .GE. xaxlo(i1) .AND. xx .LE. xaxhi(i1) ) THEN
+
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + ff
+               counts(i1,j1,l1) = counts(i1,j1,l1) + 1.0
+*              Location found and point assigned; go to the next scatter point
+               GOTO 700
+
+            ENDIF
+            i1 = i1 + 1
+ 100     CONTINUE
+
+            ENDIF
+            j1 = j1 + 1
+ 200     CONTINUE
+
+            ENDIF
+            l1 = l1 + 1
+ 400     CONTINUE
+
+ 700  CONTINUE
+
+* Compute result, average in each bin.
+
+      l1 = 1
+      DO 410 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j1 = 1
+      DO 210 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = 1
+      DO 110 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         IF ( counts(i1,j1,l1) .GT. 0.0 ) THEN
+            result(i,j,k,l,m,n) = result(i,j,k,l,m,n) / counts(i1,j1,l1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + 1
+ 110  CONTINUE
+
+         j1 = j1 + 1
+ 210  CONTINUE
+
+         l1 = l1 + 1
+ 410  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_nbin_xy.F b/fer/efi/scat2grid_nbin_xy.F
new file mode 100644
index 0000000..e26b648
--- /dev/null
+++ b/fer/efi/scat2grid_nbin_xy.F
@@ -0,0 +1,461 @@
+*
+*  scat2grid_nbin_xy
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* February 1, 2008
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_nbin_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Count observations when putting ' //
+     .                     'scattered data into XY grid by binning')
+      CALL ef_set_num_args(id, 5)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* Output grid is determined by arguments 4 and 5, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered input XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_nbin_xy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_nbin_xy_compute(id, arg_1, arg_2, arg_3,
+     .                          arg_4, arg_5, result, xaxlo, xaxhi,
+     .                          yaxlo, yaxhi)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y triples to be gridded.
+*  arg_3  variable, /
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1
+      INTEGER lo_ss, hi_ss
+      INTEGER nxpts, nypts, nscat
+      INTEGER idx, nx, ny
+      REAL xx, yy, ff
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if the output X axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+*  Check to see if the output Y axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      nscat = 0
+      DO 80 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG3)
+         hi_ss = arg_hi_ss(idx,ARG3)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nscat .NE. 0 ) THEN
+               nscat = nscat * (hi_ss - lo_ss + 1)
+            ELSE
+               nscat = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  80  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. nscat ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' F()  ', nxpts, nscat
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nscat .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y points'
+         GOTO 999
+      ENDIF
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GOTO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GOTO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_box_limits(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                       arg_hi_ss(X_AXIS, ARG4), xaxlo, xaxhi)
+
+      CALL ef_get_box_limits(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                       arg_hi_ss(Y_AXIS, ARG5), yaxlo, yaxhi)
+
+*  Compute result
+
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize result.
+
+      DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            result(i,j,k,l,m,n) = 0.0
+         ENDDO
+      ENDDO
+
+*  Loop over x and y, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z,T,E or F axis of ARG1
+*  and ARG2, sending them to a subroutine collapses the extra dimensions
+*  so the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout3(arg_1, arg_2, arg_3, idx, xx, yy, ff)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) .OR.
+     .        ff .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xaxlo(1), xaxhi(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yaxlo(1), yaxhi(ny), modylen, 1, yy)
+         ENDIF
+
+*  Put fcn into result variable.
+
+         j1 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            IF ( yy .GE. yaxlo(j1) .AND. yy .LE. yaxhi(j1) ) THEN
+
+         i1 = 1
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            IF ( xx .GE. xaxlo(i1) .AND. xx .LE. xaxhi(i1) ) THEN
+
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + 1.0
+*  Location found and point assigned; go to the next scatter point
+               GOTO 700
+
+            ENDIF
+            i1 = i1 + 1
+ 100     CONTINUE
+
+            ENDIF
+            j1 = j1 + 1
+ 200     CONTINUE
+
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_nbin_xyt.F b/fer/efi/scat2grid_nbin_xyt.F
new file mode 100644
index 0000000..c6ef565
--- /dev/null
+++ b/fer/efi/scat2grid_nbin_xyt.F
@@ -0,0 +1,546 @@
+*
+*  scat2grid_nbin_xyt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* April 2010
+* Ferret V665 10/2010 Change loop structure to make this more efficient.
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_nbin_xyt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Count observations when putting ' //
+     .                     'scattered data into XYT grid by binning')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 6)
+
+* Output grid is determined by arguments 5, 6, and 7, the result's x, y, and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of the output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of the output grid, ' //
+     .        'with same units and origin as TPTS')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_nbin_xyt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG5) - arg_lo_ss(X_AXIS,ARG5)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG6) - arg_lo_ss(Y_AXIS,ARG6)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG7) - arg_lo_ss(T_AXIS,ARG7)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* xaxlo  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* xaxhi  output x axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yaxlo  output y axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* yaxhi  output y axis
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* taxlo  output t axis
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* taxhi  output t axis
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_nbin_xyt_compute(id, arg_1, arg_2, arg_3,
+     .                        arg_4, arg_5, arg_6, arg_7, result,
+     .                        xaxlo, xaxhi, yaxlo, yaxhi, taxlo, taxhi)
+
+*  arg_1  xpts  \
+*  arg_2  ypts  / Scattered x,y,t triples to be gridded.
+*  arg_3  tpts /
+*  arg_4  variable, /
+*  arg_5  xaxis of new grid
+*  arg_6  yaxis of new grid
+*  arg_7  taxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xaxlo(wrk1lox:wrk1hix/2)
+      REAL*8 xaxhi(wrk2lox:wrk2hix/2)
+      REAL*8 yaxlo(wrk3lox:wrk3hix/2)
+      REAL*8 yaxhi(wrk4lox:wrk4hix/2)
+      REAL*8 taxlo(wrk5lox:wrk5hix/2)
+      REAL*8 taxhi(wrk6lox:wrk6hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1
+      INTEGER lo_ss, hi_ss
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER idx, nx, ny, nt
+      REAL xx, yy, tt, ff
+      CHARACTER*250 errtxt
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy, modulot
+      REAL*8 modxlen, modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if the output X-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, X_AXIS, modxlen)
+      ENDIF
+
+*  Check to see if the output Y-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG6, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG6, Y_AXIS, modylen)
+      ENDIF
+
+*  Check to see if the output T-axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG7, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG7, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG3)
+         hi_ss = arg_hi_ss(idx,ARG3)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      nscat = 0
+      DO 80 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG4)
+         hi_ss = arg_hi_ss(idx,ARG4)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nscat .NE. 0 ) THEN
+               nscat = nscat * (hi_ss - lo_ss + 1)
+            ELSE
+               nscat = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  80  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' TPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. nscat ) THEN
+         WRITE (errtxt, 90) ' XPTS,', ' F()  ', nxpts, nscat
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nscat .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y, t points'
+         GOTO 999
+      ENDIF
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG5)
+      hi_ss = arg_hi_ss(X_AXIS,ARG5)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be an X axis'
+         GOTO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG6)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG6)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Sixth argument must be a Y axis'
+         GOTO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG7)
+      hi_ss = arg_hi_ss(T_AXIS,ARG7)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Seventh argument must be a T axis'
+         GOTO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL EF_GET_BOX_LIMITS(id, ARG5, X_AXIS, arg_lo_ss(X_AXIS, ARG5),
+     .                       arg_hi_ss(X_AXIS, ARG5), xaxlo, xaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG6, Y_AXIS, arg_lo_ss(Y_AXIS, ARG6),
+     .                       arg_hi_ss(Y_AXIS, ARG6), yaxlo, yaxhi)
+
+      CALL EF_GET_BOX_LIMITS(id, ARG7, T_AXIS, arg_lo_ss(T_AXIS, ARG7),
+     .                       arg_hi_ss(T_AXIS, ARG7), taxlo, taxhi)
+
+*  Compute result
+
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize result.
+
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         DO j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            DO i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+               result(i,j,k,l,m,n) = 0.0
+            ENDDO
+         ENDDO
+      ENDDO
+
+*  Loop over x,y,t, placing the function values in the appropriate slots
+*  in the grid. xpts and ypts may be on the X,Y,Z,T,E or F axis of ARG1
+*  and ARG2, sending them to a subroutine collapses the extra dimensions
+*  so the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout4(arg_1, arg_2, arg_3, arg_4, idx, xx, yy, tt, ff)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) .OR.
+     .        tt .EQ. bad_flag(ARG3) .OR.
+     .        ff .EQ. bad_flag(ARG4) ) GOTO 700
+
+*  If output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xaxlo(1), xaxhi(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yaxlo(1), yaxhi(ny), modylen, 1, yy)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(taxlo(1), taxhi(nt), modtlen, 1, tt)
+         ENDIF
+
+*  Put fcn into result variable.
+
+         l1 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+            IF ( tt .GE. taxlo(l1) .AND. tt .LE. taxhi(l1) ) THEN
+
+         j1 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+            IF ( yy .GE. yaxlo(j1) .AND. yy .LE. yaxhi(j1) ) THEN
+
+         i1 = 1
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+            IF ( xx .GE. xaxlo(i1) .AND. xx .LE. xaxhi(i1) ) THEN
+
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + 1.0
+*  Location found and point assigned; go to the next scatter point
+               GOTO 700
+
+            ENDIF
+            i1 = i1 + 1
+ 100     CONTINUE
+
+            ENDIF
+            j1 = j1 + 1
+ 200     CONTINUE
+
+            ENDIF
+            l1 = l1 + 1
+ 400     CONTINUE
+
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_nobs_xy.F b/fer/efi/scat2grid_nobs_xy.F
new file mode 100644
index 0000000..782a0e8
--- /dev/null
+++ b/fer/efi/scat2grid_nobs_xy.F
@@ -0,0 +1,481 @@
+*
+*  scat2grid_nobs_xy
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* February 9, 2005 from scat2gridgauss_xy
+
+* Returns # observations in each grid cell when a variable is interpolated
+* onto an equally-spaced X-Y grid.  Input is scattered locations xpts, ypts
+* and the desired result grid. Output is # observations in each grid cell
+* when data is gridded in x and y.  Calls routine "nobs" based on Billy
+* Kessler's gaussmap-subs.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_nobs_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Count observations when gridding scattered ' //
+     .        'data to XY grid using Gaussian function')
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+* Output grid is determined by arguments 3 and 4, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_nobs_xy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG3) - arg_lo_ss(X_AXIS,ARG3)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* obs  work array - counts of observations
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_nobs_xy_compute(id, arg_1, arg_2, arg_3,
+     .                                  arg_4, result, xax, yax, obs)
+
+*  arg_1  xpts  \  Scattered x,y pairs to be gridded.
+*  arg_2  ypts  /
+*  arg_3  xaxis of new grid
+*  arg_4  yaxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 yax(wrk2lox:wrk2hix/2)
+      REAL obs(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nypts, nscat
+      INTEGER nx, ny
+      INTEGER i1, j1
+      REAL x1, y1, xf, yf
+      REAL xx, yy
+      REAL dx, dy, xxbeg, xxend, yybeg, yyend
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG3, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG3, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nxpts .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y points'
+         GOTO 999
+      ENDIF
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG3)
+      hi_ss = arg_hi_ss(X_AXIS,ARG3)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Third argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG3, X_AXIS, arg_lo_ss(X_AXIS, ARG3),
+     .                        arg_hi_ss(X_AXIS, ARG3), xax)
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+*  Set start, end, and delta for output axes.
+
+      x1 = xax(1)
+      y1 = yax(1)
+
+      xf = xax(nx)
+      yf = yax(ny)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF ( nx .GT. 1 ) dx = (xf-x1) / REAL(nx-1)
+      dy = yf - y1
+      IF ( ny .GT. 1 ) dy = (yf-y1) / REAL(ny-1)
+
+*  Compute result
+
+*  Initialize counts.
+
+      DO j = 1, ny
+         DO i = 1, nx
+            obs(i,j) = 0.
+         ENDDO
+      ENDDO
+
+*  Loop over x and y, compute the number of observations for the gaussian-weighted
+*  mapping onto the grid.  Lat and longitude may be on the X,Y,Z,T,E, or F axis of
+*  ARG1 and ARG2, sending them to a subroutine collapses the extra dimensions so
+*  the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout2(arg_1, arg_2, idx, xx, yy)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+         ENDIF
+
+         CALL nobs(xx, yy, nx, ny, x1, y1, dx, dy, xf, yf, obs)
+
+C ACM modulo 11/9/00  Put points within dx or dy of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+         IF ( modulox ) THEN
+            IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. dx) ) THEN
+               xxend = xf + (xx-x1)
+               CALL nobs(xxend, yy, nx, ny, x1, y1, dx, dy, xf, yf, obs)
+            ENDIF
+
+            IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. dx) ) THEN
+               xxbeg = x1 - (xf-xx)
+               CALL nobs(xxbeg, yy, nx, ny, x1, y1, dx, dy, xf, yf, obs)
+            ENDIF
+         ENDIF
+
+         IF ( moduloy ) THEN
+            IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. dy) ) THEN
+               yyend = yf + (yy-y1)
+               CALL nobs(xx, yyend, nx, ny, x1, y1, dx, dy, xf, yf, obs)
+            ENDIF
+
+            IF ( (yf-yy .LT. 0.) .AND. (yf-yy .LT. dy) ) THEN
+               yybeg = y1 - (yf-yy)
+               CALL nobs(xx, yybeg, nx, ny, x1, y1, dx, dy, xf, yf, obs)
+            ENDIF
+         ENDIF
+
+ 700  CONTINUE
+
+*  Put gridded fcn into result variable.
+*  The result is normal to the Z, T, E, and F axes
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      j1 = 1
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+         i1 = 1
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            result(i,j,k,l,m,n) = obs(i1,j1)
+
+            i1 = i1 + 1
+ 100     CONTINUE
+
+         j1 = j1 + 1
+ 200  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_nobs_xyt.F b/fer/efi/scat2grid_nobs_xyt.F
new file mode 100644
index 0000000..63aa414
--- /dev/null
+++ b/fer/efi/scat2grid_nobs_xyt.F
@@ -0,0 +1,586 @@
+*
+*  scat2grid_nobs_xyt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 2008  from scat2grid_nobs_xy
+
+* Returns # observations in each grid cell when a variable is interpolated
+* onto an equally-spaced X-Y-T grid.  Input is scattered locations xpts, ypts, tpts
+* and the desired result grid.  Output is # observations in each grid cell
+* when data is gridded in x and y. The time axis must have the same units and origin
+* as the scattered time points. Calls routine "nobs" based on Billy
+* Kessler's gaussmap-subs.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_nobs_xyt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Count observations when gridding scattered ' //
+     .        'data to XYT grid using Gaussian function')
+      CALL ef_set_num_args(id, 6)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                NORMAL,          IMPLIED_BY_ARGS,
+     .                                NORMAL,          NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* Output grid is determined by arguments 4, 5, 6, the result's x, y, t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XYT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid, ' //
+     .        'with same units and origin as TPTS')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_nobs_xyt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, ntout, nx2, ny2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG6) - arg_lo_ss(T_AXIS,ARG6)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* obs  work array - counts of observations
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1,     1, 1, 1, 1,
+     .                            nxout, nyout, ntout, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE  scat2grid_nobs_xyt_compute(id, arg_1, arg_2, arg_3,
+     .                                    arg_4, arg_5, arg_6, result,
+     .                                    xax, yax, tax, obs)
+
+*  arg_1  xpts  \
+*  arg_2  ypts   | Scattered x,y,t triplets to be gridded.
+*  arg_2  tpts  /
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+*  arg_6  taxis of new grid
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 yax(wrk2lox:wrk2hix/2)
+      REAL*8 tax(wrk3lox:wrk3hix/2)
+      REAL obs(wrk4lox:wrk4hix, wrk4loy:wrk4hiy, wrk4loz:wrk4hiz)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i1, j1, l1
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL dx, dy, dt, xxbeg, xxend, yybeg, yyend, ttbeg, ttend
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy, modulot
+      REAL*8 modxlen, modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG6, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG6, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG3)
+         hi_ss = arg_hi_ss(idx,ARG3)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' TPTS ', nxpts, ntpts
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+      IF ( nxpts .LE. 0 ) THEN
+         errtxt = 'No data in scattered x, y, t points'
+         GOTO 999
+      ENDIF
+
+      nscat = nxpts
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG6)
+      hi_ss = arg_hi_ss(T_AXIS,ARG6)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Sixth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                        arg_hi_ss(Y_AXIS, ARG5), yax)
+
+      CALL ef_get_coordinates(id, ARG6, T_AXIS, arg_lo_ss(T_AXIS, ARG6),
+     .                        arg_hi_ss(T_AXIS, ARG6), tax)
+
+*  Set start, end, and delta for output axes.
+
+      x1 = xax(1)
+      y1 = yax(1)
+      t1 = tax(1)
+
+      xf = xax(nx)
+      yf = yax(ny)
+      tf = tax(nt)
+
+*  Gridbox sizes in data units
+      dx = xf - x1
+      IF ( nx .GT. 1 ) dx = (xf-x1) / REAL(nx-1)
+      dy = yf - y1
+      IF ( ny .GT. 1 ) dy = (yf-y1) / REAL(ny-1)
+      dt = tf - t1
+      IF ( nt .GT. 1 ) dt = (tf-t1) / REAL(nt-1)
+
+*  Compute result
+
+*  Initialize counts.
+
+      DO l = 1, nt
+         DO j = 1, ny
+            DO i = 1, nx
+               obs(i,j,l) = 0.
+            ENDDO
+         ENDDO
+      ENDDO
+
+*  Loop over x, y, and t, compute the number of observations for the gaussian-
+*  weighted mapping onto the grid.  Lat, lon, and time may be on the X,Y,Z,T,E,
+*  or F axis of ARG1 and ARG2, sending them to a subroutine collapses the extra
+*  dimensions so the value can be found.
+
+      DO 700 idx = 1, nscat
+
+         CALL pickout3(arg_1, arg_2, arg_3, idx, xx, yy, tt)
+         IF ( xx .EQ. bad_flag(ARG1) .OR.
+     .        yy .EQ. bad_flag(ARG2) .OR.
+     .        tt .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulox ) THEN
+            CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+         ENDIF
+
+         CALL nobsxyt(xx, yy, tt, nx, ny, nt, x1, y1, t1,
+     .                dx, dy, dt, xf, yf, tf, obs)
+
+*  Put points within dx or dy  or dt of the end just beyond the
+*  other end, and use in the gridding computation.
+
+         IF ( modulox ) THEN
+            IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. dx) ) THEN
+               xxend = xf + (xx-x1)
+               CALL nobsxyt(xxend, yy, tt, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+
+            IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. dx) ) THEN
+               xxbeg = x1 - (xf-xx)
+               CALL nobsxyt(xxbeg, yy, tt, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+         ENDIF
+
+         IF ( moduloy ) THEN
+            IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. dy) ) THEN
+               yyend = yf + (yy-y1)
+               CALL nobsxyt(xx, yyend, tt, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+
+            IF ( (yf-yy .LT. 0.) .AND. (yf-yy .LT. dy) ) THEN
+               yybeg = y1 - (yf-yy)
+               CALL nobsxyt(xx, yybeg, tt, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+         ENDIF
+
+         IF ( modulot ) THEN
+            IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. dt) ) THEN
+               ttend = tf + (tt-t1)
+               CALL nobsxyt(xx, yy, ttend, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+
+            IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. dt) ) THEN
+               ttbeg = t1 - (tf-tt)
+               CALL nobsxyt(xx, yy, ttbeg, nx, ny, nt, x1, y1, t1,
+     .                      dx, dy, dt, xf, yf, tf, obs)
+            ENDIF
+         ENDIF
+
+ 700  CONTINUE
+
+*  Put gridded fcn into result variable.
+*  The result is normal to the Z, E, and F axes
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      l1 = 1
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               result(i,j,k,l,m,n) = obs(i1,j1,l1)
+
+               i1 = i1 + 1
+ 100        CONTINUE
+
+            j1 = j1 + 1
+ 200     CONTINUE
+
+         l1 = l1 + 1
+ 400  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_subs.F b/fer/efi/scat2grid_subs.F
new file mode 100644
index 0000000..d2de6f3
--- /dev/null
+++ b/fer/efi/scat2grid_subs.F
@@ -0,0 +1,210 @@
+* scat2grid_subs:  Subroutines called by the scat2grid functions.
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+      SUBROUTINE pickout1 (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the ave_scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
+
+
+      SUBROUTINE pickout2 (alon, alat, n, xx, yy)
+
+
+*  ACM 3/2000
+*  Called from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon and lat)
+
+      REAL alon(*), alat(*)
+      REAL xx, yy
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+
+      RETURN
+      END
+
+      SUBROUTINE pickout3 (alon, alat, atimes, n, xx, yy, tt)
+
+*  CALLed from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon,lat,time or lon,lat,depth)
+
+      REAL alon(*), alat(*), atimes(*)
+      REAL xx, yy, tt
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+
+      RETURN
+      END
+
+      SUBROUTINE pickout4 (alon, alat, atimes, vals, n, xx, yy, tt, vv)
+
+*  Called from the scatter*  gridding functins.
+*  Pick out nth item from alon and alat, which are really 4-dimensioned arrays
+*  with normal axes on three of the four axes.
+*  (can be any variables, typically lon,lat,time,value or lon,lat,depth,time, etc)
+
+      REAL alon(*), alat(*), atimes(*), vals(*)
+      REAL xx, yy, tt, vv
+      INTEGER n
+
+      xx = alon(n)
+      yy = alat(n)
+      tt = atimes(n)
+      vv = vals(n)
+
+      RETURN
+      END
+
+c************************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy=x/y location of data pt (data units)
+c  i	nx,ny=size of grids
+c  i	x1,y1=west/south edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny) number of obs in each (x,y) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobs (xx, yy, nx, ny, x1, y1, dx, dy, 
+     .			 xf, yf, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny
+	REAL xx, yy, dx, dy, x1, y1, xf, yf, obs(nx,ny)
+
+* Local variable declarations
+
+        REAL xxg, yyg
+        INTEGER ig, jg
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+
+c.................save the number of obs in each (x,y) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny)
+     .		obs(ig,jg) = obs(ig,jg)+1.
+
+	RETURN
+	END
+
+
+
+c************************************************************************
+c...NOBS.....Based on gausswt, return only the # of obs in (x,y) gridbox
+c............method is to call this sub for each data value
+c............all calcs done in gridbox units
+c............xx/x1/xf all in same units
+c............yy/y1/yf all in same units
+
+c  i	xx,yy,tt=x/y/t location of data pt (data units)
+c  i	nx,ny,nt=size of grids
+c  i	x1,y1,L1=west/south/earliest edge of grid (center of 1st box in data units)
+c  o 	obs(nx,ny,nt) number of obs in each (x,y,t) gridbox
+c--------------------------------------------------------------------------
+
+	SUBROUTINE nobsxyt (xx, yy, tt, nx, ny, nt, x1, y1, t1, 
+     .                 dx, dy, dt, xf, yf, tf, obs)
+
+
+* Argument declarations
+
+        INTEGER nx, ny, nt
+	REAL xx, yy, tt, x1, y1, t1, dx, dy, dt, xf, 
+     .       yf, tf, obs(nx,ny,nt)
+
+* Local variable declarations
+
+        REAL xxg, yyg, ttg
+        INTEGER ig, jg, Lg ! !!!!!!!!!!!!!!!!!!!!!!!! adding t dimension throughtout
+
+	xxg = (xx-x1)/ dx + 1.		  ! grid values of data location
+	yyg = (yy-y1)/ dy + 1.
+	ttg = (tt-t1)/ dt + 1.
+
+c.................save the number of obs in each (x,y,t) gridbox
+	ig = NINT(xxg)
+	jg = NINT(yyg)
+	Lg = NINT(ttg)
+	IF (ig.GE.1 .AND. ig.LE.nx .AND. jg.GE.1 .AND. jg.LE.ny .AND.
+     .      Lg.GE.1 .AND. Lg.LE.nt   )
+     .		obs(ig,jg,Lg) = obs(ig,jg,Lg)+1.
+
+	RETURN
+	END
+
+
+      SUBROUTINE pickout (atim, n, val)
+
+
+*  ACM 5/2003
+*  Called from the ave_scat2grid_t function.
+*  Pick out nth item from atim, which is really 4-D 
+*  with normal axes on three of the four axes.
+
+      REAL atim(*)
+      REAL val
+      INTEGER n
+
+      val = atim(n)
+
+      RETURN
+      END
diff --git a/fer/efi/scat2grid_t.F b/fer/efi/scat2grid_t.F
new file mode 100644
index 0000000..e91d91e
--- /dev/null
+++ b/fer/efi/scat2grid_t.F
@@ -0,0 +1,345 @@
+*
+*  scat2grid_t
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* May 2003
+* 11-Jul-2003  Clean up section where we get box limits
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* Input is a set of T coordinates on an abstract axis, and an output time axis.
+* Returns a time series which is the number of points that fall inside of each T cell.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2grid_t_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Count number of t points in each cell of output axis')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, IMPLIED_BY_ARGS,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+* output grid is determined by argument 2.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered input time coordinates')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TAXIS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Output time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2grid_t_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ntout, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2)
+
+* doubled in case REAL is REAL*4
+      nt2 = 2 * ntout
+
+* taxlo  output t axis box lower limits
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* taxhi  output t axis box upper limits
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2grid_t_compute(id, arg_1, arg_2,
+     .                               result, taxlo, taxhi)
+
+*  arg_1  tpts  Scattered t values to be gridded.
+*  arg_2  taxis T axis to use for output
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 taxlo(wrk1lox:wrk1hix/2)
+      REAL*8 taxhi(wrk2lox:wrk2hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss, l1
+      INTEGER ntpts, ntgrid
+      REAL tt
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulot
+      REAL*8 modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axis is modulo (does not need to be regular)
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units, 
+     .                         backward, mdulo, regular)
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG2, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining
+*  the scattered data points may lie on any axis of the input argument.
+*  Using as flattened arrays, so consider all axes.
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( ntpts .EQ. 0 ) THEN
+         errtxt = 'No data in TPTS'
+         GOTO 999
+      ENDIF
+
+*  Check tax is a T axis
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG2)
+      hi_ss = arg_hi_ss(T_AXIS,ARG2)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Second argument must be a T axis'
+         GO TO 999
+      ENDIF
+      ntgrid = hi_ss - lo_ss + 1
+
+C  Get cell boundaries
+
+      CALL ef_get_box_limits(id, ARG2, T_AXIS, arg_lo_ss(T_AXIS, ARG2),
+     .                       arg_hi_ss(T_AXIS, ARG2), taxlo, taxhi)
+
+*  Compute result
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*  Initialize counts
+
+      DO l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+         result(i,j,k,l,m,n) = 0.
+      ENDDO
+
+*  Loop over input tpts
+
+      DO 700 idx = 1, ntpts
+
+         CALL pickout(arg_1, idx, tt)
+         IF ( tt .EQ. bad_flag(ARG1) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+         IF ( modulot ) THEN
+            CALL modscat(taxlo(1), taxhi(ntgrid), modtlen, 1, tt)
+         ENDIF
+
+         l1 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+            IF ( tt .GE. taxlo(l1) .AND. tt .LE. taxhi(l1) ) THEN
+               result(i,j,k,l,m,n) = result(i,j,k,l,m,n) + 1.
+*              Location found and point assigned; go to the next scatter point
+               GOTO 700
+            ENDIF
+
+            l1 = l1 + 1
+  400    CONTINUE
+
+ 700  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xt.F b/fer/efi/scat2gridgauss_xt.F
new file mode 100644
index 0000000..e4d1c0f
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xt.F
@@ -0,0 +1,660 @@
+*
+*  scat2gridgauss_xt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+
+* Returns variable interpolated onto an equally-spaced X-T grid.
+* Input is scattered triples: (x, t, variable) , f may be function of y, z, e, f
+* Output is gridded data in x, t.  Calls routine "gausswt2".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to an XT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XT grid is determined by arguments 4 and 5, the result's x and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XT locations. ' //
+     .        'May also be fcn of Y,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, ntout, nx2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nt2 = ntout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xt_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, tax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  tpts  > Scattered x,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of y, z, e, f
+*  arg_4  xaxis of new grid
+*  arg_5  taxis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, ntpts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, tlo, thi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dt, xcut, tcut, xxbeg, xxend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, modulot
+      REAL*8 modxlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' TPTS ', nxpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both X and T axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(T) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, t points.  ' //
+     .            'F() data values must be defined on X or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      t1 = tax(1)
+
+      xf = xax(nx)
+      tf = tax(nt)
+
+*  Y parameters for subroutine gausswt.  Calling with 1 y value.
+
+      ny = 1
+      yy = 1.
+      y1 = 1.
+      yf = 1.
+      ysc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO i3 = 1, nx
+               grid(i3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO i3 = 1, nx
+               wate(i3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, tt)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               l3 = tlo
+            ELSE
+               i3 = xlo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2(xx, tt, yy, val, grid, wate, nx,
+     .                    nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                    tsc, ysc, cutoff, iwflag, nx, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2(xxend, tt, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2(xxbeg, tt, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2(xx, ttend, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = y1 - (yf-tt)
+                  CALL gausswt2(xx, ttbeg, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,l3) / wate(i3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xt_v0.F b/fer/efi/scat2gridgauss_xt_v0.F
new file mode 100644
index 0000000..6c014db
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xt_v0.F
@@ -0,0 +1,662 @@
+*
+*  scat2gridgauss_xt_v0
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+
+* Returns variable interpolated onto an equally-spaced X-T grid.
+* Input is scattered triples: (x, t, variable) , f may be function of y, z, e, f
+* Output is gridded data in x, t.  Calls routine "gausswt2_v0".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xt_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to an XT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XT grid is determined by arguments 4 and 5, the result's x and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XT locations. ' //
+     .        'May also be fcn of Y,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xt_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, ntout, nx2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nt2 = ntout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xt_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, tax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  tpts  > Scattered x,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of y, z, e, f
+*  arg_4  xaxis of new grid
+*  arg_5  taxis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, ntpts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, tlo, thi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dt, xcut, tcut, xxbeg, xxend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, modulot
+      REAL*8 modxlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' TPTS ', nxpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both X and T axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(T) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, t points.  ' //
+     .            'F() data values must be defined on X or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      t1 = tax(1)
+
+      xf = xax(nx)
+      tf = tax(nt)
+
+*  Y parameters for subroutine gausswt.  Calling with 1 y value.
+
+      ny = 1
+      yy = 1.
+      y1 = 1.
+      yf = 1.
+      ysc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO i3 = 1, nx
+               grid(i3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO i3 = 1, nx
+               wate(i3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, tt)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               l3 = tlo
+            ELSE
+               i3 = xlo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2_v0(xx, tt, yy, val, grid, wate, nx,
+     .                    nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                    tsc, ysc, cutoff, iwflag, nx, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2_v0(xxend, tt, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2_v0(xxbeg, tt, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2_v0(xx, ttend, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = y1 - (yf-tt)
+                  CALL gausswt2_v0(xx, ttbeg, yy, val, grid, wate, nx,
+     .                          nt, ny, x1, t1, y1, xf, tf, yf, xsc,
+     .                          tsc, ysc, cutoff, iwflag, nx, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,l3) / wate(i3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xy.F b/fer/efi/scat2gridgauss_xy.F
new file mode 100644
index 0000000..009ffde
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xy.F
@@ -0,0 +1,679 @@
+*
+*  scat2gridgauss_xy
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  y and z radius of influence,
+*               and cutoff.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*              X and Y scattered points are 1-D lists on any axis.
+*
+*    5/2001    Let variable,  be a function of Z and/or T
+* v5.41 5/02   Fix bug (typo); Gridding to modulo X axis wasnt done.
+
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (x, y, variable) , f may be function of time, z
+* Output is gridded data in x, y and time.  Calls routine "gausswt2".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to an XY grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XY grid is determined by arguments 4 and 5, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XY locations. ' //
+     .        'May also be fcn of Z,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xy_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, yax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  ypts  > Scattered x,y,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of z, t, e, f
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   yscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 yax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nypts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, ylo, yhi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dy, xcut, ycut, xxbeg, xxend, yybeg, yyend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (yhi .GT. ylo) ) THEN
+         errtxt = 'F() data values defined on both X and Y axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Y) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (ylo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, y points.  ' //
+     .            'F() data values must be defined on X or Y axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                        arg_hi_ss(Y_AXIS, ARG5), yax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      y1 = yax(1)
+
+      xf = xax(nx)
+      yf = yax(ny)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      ysc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Z, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO j3 = 1, ny
+            DO i3 = 1, nx
+               grid(i3,j3) = 0.
+            ENDDO
+         ENDDO
+
+         DO j3 = 1, ny
+            DO i3 = 1, nx
+               wate(i3,j3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and y, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, yy)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               j3 = ylo
+            ELSE
+               i3 = xlo
+               j3 = ylo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            yy .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( moduloy ) THEN
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+
+            CALL gausswt2(xx, yy, tt, val, grid, wate, nx,
+     .                    ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                    ysc, tsc, cutoff, iwflag, nx, ny)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2(xxend, yy, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2(xxbeg, yy, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+            ENDIF
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2(xx, yyend, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+
+               IF ( (yf-yy .LT. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2(xx, yybeg, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         j3 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,j3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,j3) / wate(i3,j3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            j3 = j3 + 1
+ 200     CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xy_v0.F b/fer/efi/scat2gridgauss_xy_v0.F
new file mode 100644
index 0000000..b660456
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xy_v0.F
@@ -0,0 +1,681 @@
+*
+*  scat2gridgauss_xy_v0
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  y and z radius of influence,
+*               and cutoff.
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*              X and Y scattered points are 1-D lists on any axis.
+*
+*    5/2001    Let variable,  be a function of Z and/or T
+* v5.41 5/02   Fix bug (typo); Gridding to modulo X axis wasnt done.
+
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (x, y, variable) , f may be function of time, z
+* Output is gridded data in x, y and time.  Calls routine "gausswt2_v0".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xy_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to an XY grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XY grid is determined by arguments 4 and 5, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XY locations. ' //
+     .        'May also be fcn of Z,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xy_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xy_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, yax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  ypts  > Scattered x,y,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of z, t, e, f
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   yscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 yax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nypts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, ylo, yhi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dy, xcut, ycut, xxbeg, xxend, yybeg, yyend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (yhi .GT. ylo) ) THEN
+         errtxt = 'F() data values defined on both X and Y axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Y) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (ylo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, y points.  ' //
+     .            'F() data values must be defined on X or Y axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                        arg_hi_ss(Y_AXIS, ARG5), yax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      y1 = yax(1)
+
+      xf = xax(nx)
+      yf = yax(ny)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      ysc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Z, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO j3 = 1, ny
+            DO i3 = 1, nx
+               grid(i3,j3) = 0.
+            ENDDO
+         ENDDO
+
+         DO j3 = 1, ny
+            DO i3 = 1, nx
+               wate(i3,j3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and y, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, yy)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               j3 = ylo
+            ELSE
+               i3 = xlo
+               j3 = ylo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            yy .EQ. bad_flag(ARG2) .AND.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( moduloy ) THEN
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+
+            CALL gausswt2_v0(xx, yy, tt, val, grid, wate, nx,
+     .                    ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                    ysc, tsc, cutoff, iwflag, nx, ny)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2_v0(xxend, yy, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2_v0(xxbeg, yy, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+            ENDIF
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2_v0(xx, yyend, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+
+               IF ( (yf-yy .LT. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2_v0(xx, yybeg, tt, val, grid, wate, nx,
+     .                          ny, nt, x1, y1, t1, xf, yf, tf, xsc,
+     .                          ysc, tsc, cutoff, iwflag, nx, ny)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         j3 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,j3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,j3) / wate(i3,j3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            j3 = j3 + 1
+ 200     CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xz.F b/fer/efi/scat2gridgauss_xz.F
new file mode 100644
index 0000000..1d183d5
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xz.F
@@ -0,0 +1,678 @@
+*
+*  scat2gridgauss_xz
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  x and z radius of influence,
+*               and cutoff.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*
+*    5/2001    Let variable,  be a function of Y and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (x, z, variable, ); may be functions of y and/or time.
+* Output is gridded data in x, y, z, and time.  Calls routine "gausswt2".
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to an XZ grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XZ grid is determined by arguments 4 and 5, the result's x and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XZ locations. ' //
+     .        'May also be fcn of Y,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nzout, nx2, nz2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nz2 = nzout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nzout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nzout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xz_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, zax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  zpts  > Scattered x,z,variable,  triples to be gridded.
+*  arg_3  variable, /    Can be fcn of y,t,e,f
+*  arg_4  X axis of new grid
+*  arg_5  Z axis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   zscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nzpts, nscat
+      INTEGER nx, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, zlo, zhi
+      REAL x1, z1, t1, xf, zf, tf
+      REAL xx, zz, tt
+      REAL xsc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dz, xcut, zcut, xxbeg, xxend, zzbeg, zzend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloz
+      REAL*8 modxlen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nxpts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' ZPTS ', nxpts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both X and Z axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Z) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, z points.  ' //
+     .            'F() data values must be defined on X or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      z1 = zax(1)
+
+      xf = xax(nx)
+      zf = zax(nz)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      zsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO k3 = 1, nz
+            DO i3 = 1, nx
+               grid(i3,k3) = 0.
+            ENDDO
+         ENDDO
+
+         DO k3 = 1, nz
+            DO i3 = 1, nx
+               wate(i3,k3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and z, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, zz)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               k3 = zlo
+            ELSE
+               i3 = xlo
+               k3 = zlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            zz .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( moduloz ) THEN
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+
+            CALL gausswt2(xx, zz, tt, val, grid, wate, nx,
+     .                    nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                    zsc, tsc, cutoff, iwflag, nx, nz)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2(xxend, zz, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2(xxbeg, zz, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+            ENDIF
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2(xx, zzend, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+
+               IF ( (zf-zz .LT. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2(xx, zzbeg, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,k3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,k3) / wate(i3,k3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            k3 = k3 + 1
+ 300     CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_xz_v0.F b/fer/efi/scat2gridgauss_xz_v0.F
new file mode 100644
index 0000000..9627345
--- /dev/null
+++ b/fer/efi/scat2gridgauss_xz_v0.F
@@ -0,0 +1,680 @@
+*
+*  scat2gridgauss_xz_v0
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  x and z radius of influence,
+*               and cutoff.
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*
+*    5/2001    Let variable,  be a function of Y and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (x, z, variable, ); may be functions of y and/or time.
+* Output is gridded data in x, y, z, and time.  Calls routine "gausswt2_v0".
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_xz_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to an XZ grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* XZ grid is determined by arguments 4 and 5, the result's x and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XZ locations. ' //
+     .        'May also be fcn of Y,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'XSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in X direction, in data units (e.g. km or lon)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_xz_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nzout, nx2, nz2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nz2 = nzout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nzout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nzout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_xz_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, xax, zax, grid, wate)
+
+*  arg_1  xpts \
+*  arg_2  zpts  > Scattered x,z,variable,  triples to be gridded.
+*  arg_3  variable, /    Can be fcn of y,t,e,f
+*  arg_4  X axis of new grid
+*  arg_5  Z axis of new grid
+*  arg_6  interpolation parameter   xscale
+*  arg_7  interpolation parameter   zscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nzpts, nscat
+      INTEGER nx, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, zlo, zhi
+      REAL x1, z1, t1, xf, zf, tf
+      REAL xx, zz, tt
+      REAL xsc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dx, dz, xcut, zcut, xxbeg, xxend, zzbeg, zzend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloz
+      REAL*8 modxlen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nxpts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' ZPTS ', nxpts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both X and Z axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         nscat = xhi - xlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Z) ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nxpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, z points.  ' //
+     .            'F() data values must be defined on X or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and end for output axes.
+
+      x1 = xax(1)
+      z1 = zax(1)
+
+      xf = xax(nx)
+      zf = zax(nz)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      xsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( xsc .LE. 0. ) THEN
+         errtxt = 'X mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      zsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO k3 = 1, nz
+            DO i3 = 1, nx
+               grid(i3,k3) = 0.
+            ENDDO
+         ENDDO
+
+         DO k3 = 1, nz
+            DO i3 = 1, nx
+               wate(i3,k3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over x and z, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, xx, zz)
+            IF ( xhi .GT. xlo ) THEN
+               i3 = xlo + idx - 1
+               k3 = zlo
+            ELSE
+               i3 = xlo
+               k3 = zlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  xx .EQ. bad_flag(ARG1) .OR.
+     .            zz .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( modulox ) THEN
+               CALL modscat(xax(1), xax(nx), modxlen, 1, xx)
+            ENDIF
+            IF ( moduloz ) THEN
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+
+            CALL gausswt2_v0(xx, zz, tt, val, grid, wate, nx,
+     .                    nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                    zsc, tsc, cutoff, iwflag, nx, nz)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( modulox ) THEN
+               dx = xf - x1
+               IF (nx .GT. 1) dx = (xf-x1)/real(nx-1)  ! gridbox size in data units
+               xcut = cutoff*xsc/dx                    ! cutoff scaled to grid units
+
+               IF ( (xx-x1 .GE. 0.) .AND. (xx-x1 .LT. xcut) ) THEN
+                  xxend = xf + (xx-x1)
+                  CALL gausswt2_v0(xxend, zz, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+
+               IF ( (xf-xx .GE. 0.) .AND. (xf-xx .LT. xcut) ) THEN
+                  xxbeg = x1 - (xf-xx)
+                  CALL gausswt2_v0(xxbeg, zz, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+            ENDIF
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2_v0(xx, zzend, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+
+               IF ( (zf-zz .LT. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2_v0(xx, zzbeg, tt, val, grid, wate, nx,
+     .                          nz, nt, x1, z1, t1, xf, zf, tf, xsc,
+     .                          zsc, tsc, cutoff, iwflag, nx, nz)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( wate(i3,k3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(i3,k3) / wate(i3,k3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               i3 = i3 + 1
+ 100        CONTINUE
+
+            k3 = k3 + 1
+ 300     CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_yt.F b/fer/efi/scat2gridgauss_yt.F
new file mode 100644
index 0000000..090fde1
--- /dev/null
+++ b/fer/efi/scat2gridgauss_yt.F
@@ -0,0 +1,660 @@
+*
+*  scat2gridgauss_yt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+
+* Returns variable interpolated onto an equally-spaced Y-T grid.
+* Input is scattered triples: (y, t, variable) , f may be function of x, z, e, f
+* Output is gridded data in y, t.  Calls routine "gausswt2".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_yt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to a YT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* YT grid is determined by arguments 4 and 5, the result's y and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YT locations. ' //
+     .        'May also be fcn of X,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_yt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, ntout, ny2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_yt_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, yax, tax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  tpts  > Scattered y,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of x,z,e,f
+*  arg_4  yaxis of output grid
+*  arg_5  taxis of output grid
+*  arg_6  interpolation parameter   yscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, tlo, thi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dy, dt, ycut, tcut, yybeg, yyend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, modulot
+      REAL*8 modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or f axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nypts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' TPTS ', nypts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Y and T axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(T) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, t points.  ' //
+     .            'F() data values must be defined on Y or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      y1 = yax(1)
+      t1 = tax(1)
+
+      yf = yax(ny)
+      tf = tax(nt)
+
+*  X parameters for subroutine gausswt.  Calling with 1 x value
+
+      nx = 1
+      xx = 1.
+      x1 = 1.
+      xf = 1.
+      xsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      ysc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( ysc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO j3 = 1, ny
+               grid(j3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO j3 = 1, ny
+               wate(j3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over y and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, yy, tt)
+            IF ( yhi .GT. ylo ) THEN
+               j3 = ylo + idx - 1
+               l3 = tlo
+            ELSE
+               j3 = ylo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  yy .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloy ) THEN
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2(yy, tt, xx, val, grid, wate, ny,
+     .                    nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                    tsc, xsc, cutoff, iwflag, ny, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2(yyend, tt, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, ysc, cutoff, iwflag, ny, nt)
+               ENDIF
+
+               IF ( (yf-yy .GE. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2(yybeg, tt, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2(yy, ttend, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = y1 - (yf-tt)
+                  CALL gausswt2(yy, ttbeg, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( wate(j3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(j3,l3) / wate(j3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               j3 = j3 + 1
+ 200        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_yt_v0.F b/fer/efi/scat2gridgauss_yt_v0.F
new file mode 100644
index 0000000..1ecdf5b
--- /dev/null
+++ b/fer/efi/scat2gridgauss_yt_v0.F
@@ -0,0 +1,662 @@
+*
+*  scat2gridgauss_yt_v0
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+
+* Returns variable interpolated onto an equally-spaced Y-T grid.
+* Input is scattered triples: (y, t, variable) , f may be function of x, z, e, f
+* Output is gridded data in y, t.  Calls routine "gausswt2_v0".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_yt_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to a YT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* YT grid is determined by arguments 4 and 5, the result's y and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YT locations. ' //
+     .        'May also be fcn of X,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_yt_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, ntout, ny2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_yt_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, yax, tax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  tpts  > Scattered y,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of x,z,e,f
+*  arg_4  yaxis of output grid
+*  arg_5  taxis of output grid
+*  arg_6  interpolation parameter   yscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, ntpts, nscat
+      INTEGER nx, ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, tlo, thi
+      REAL x1, y1, t1, xf, yf, tf
+      REAL xx, yy, tt
+      REAL xsc, ysc, tsc
+      REAL cutoff
+      REAL val
+      REAL dy, dt, ycut, tcut, yybeg, yyend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, modulot
+      REAL*8 modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or f axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nypts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' TPTS ', nypts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Y and T axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(T) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, t points.  ' //
+     .            'F() data values must be defined on Y or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      y1 = yax(1)
+      t1 = tax(1)
+
+      yf = yax(ny)
+      tf = tax(nt)
+
+*  X parameters for subroutine gausswt.  Calling with 1 x value
+
+      nx = 1
+      xx = 1.
+      x1 = 1.
+      xf = 1.
+      xsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      ysc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( ysc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO j3 = 1, ny
+               grid(j3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO j3 = 1, ny
+               wate(j3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over y and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, yy, tt)
+            IF ( yhi .GT. ylo ) THEN
+               j3 = ylo + idx - 1
+               l3 = tlo
+            ELSE
+               j3 = ylo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  yy .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloy ) THEN
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2_v0(yy, tt, xx, val, grid, wate, ny,
+     .                    nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                    tsc, xsc, cutoff, iwflag, ny, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2_v0(yyend, tt, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, ysc, cutoff, iwflag, ny, nt)
+               ENDIF
+
+               IF ( (yf-yy .GE. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2_v0(yybeg, tt, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2_v0(yy, ttend, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = y1 - (yf-tt)
+                  CALL gausswt2_v0(yy, ttbeg, xx, val, grid, wate, ny,
+     .                          nt, nx, y1, t1, x1, yf, tf, xf, ysc,
+     .                          tsc, xsc, cutoff, iwflag, ny, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( wate(j3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(j3,l3) / wate(j3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               j3 = j3 + 1
+ 200        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+ 300  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_yz.F b/fer/efi/scat2gridgauss_yz.F
new file mode 100644
index 0000000..02d0ad3
--- /dev/null
+++ b/fer/efi/scat2gridgauss_yz.F
@@ -0,0 +1,677 @@
+*
+*  scat2gridgauss_yz
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  y and z radius of influence,
+*               and cutoff.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*
+*    5/2001    Let variable,  be a function of X and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (y, z, variable) , may be functions of x and/or time.
+* Output is gridded data in x, y, z, and time.  Calls routine "gausswt2".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_yz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to a YZ grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* YZ grid is determined by arguments 4 and 5, the result's x and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YZ locations. ' //
+     .        'May also be fcn of X,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_yz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, nzout, ny2, nz2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nz2 = nzout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, nzout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, nzout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_yz_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, yax, zax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  zpts  > Scattered y,z,variable,  triples to be gridded.
+*  arg_3  variable, /    F can be fcn of x,t,e,f
+*  arg_4  yaxis of new grid
+*  arg_5  zaxis of new grid
+*  arg_6  interpolation parameter   yscale
+*  arg_7  interpolation parameter   zscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, nzpts, nscat
+      INTEGER ny, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, zlo, zhi
+      REAL y1, z1, t1, yf, zf, tf
+      REAL yy, zz, tt
+      REAL ysc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dy, dz, ycut, zcut, yybeg, yyend, zzbeg, zzend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, moduloz
+      REAL*8 modylen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nypts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' ZPTS ', nypts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both Y and Z axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Z) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, z points.  ' //
+     .            'F() data values must be defined on Y or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and end for output axes.
+
+      y1 = yax(1)
+      z1 = zax(1)
+
+      yf = yax(ny)
+      zf = zax(nz)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      ysc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( ysc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      zsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO k3 = 1, nz
+            DO j3 = 1, ny
+               grid(j3,k3) = 0.
+            ENDDO
+         ENDDO
+
+         DO k3 = 1, nz
+            DO j3 = 1, ny
+               wate(j3,k3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over y and z, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, yy, zz)
+            IF ( yhi .GT. ylo ) THEN
+               j3 = ylo + idx - 1
+               k3 = zlo
+            ELSE
+               j3 = ylo
+               k3 = zlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  yy .EQ. bad_flag(ARG1) .OR.
+     .            zz .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloy ) THEN 
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+            IF ( moduloz ) THEN 
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+
+            CALL gausswt2(yy, zz, tt, val, grid, wate, ny,
+     .                    nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                    zsc, tsc, cutoff, iwflag, ny, nz)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2(yyend, zz, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+
+               IF ( (yf-yy .GE. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2(yybeg, zz, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+            ENDIF
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2(yy, zzend, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+
+               IF ( (zf-zz .LT. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2(yy, zzbeg, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( wate(j3,k3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(j3,k3) / wate(j3,k3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               j3 = j3 + 1
+ 200        CONTINUE
+
+            k3 = k3 + 1
+ 300     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_yz_v0.F b/fer/efi/scat2gridgauss_yz_v0.F
new file mode 100644
index 0000000..a02b1e9
--- /dev/null
+++ b/fer/efi/scat2gridgauss_yz_v0.F
@@ -0,0 +1,679 @@
+*
+*  scat2gridgauss_yz_v0
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* Ansley Manke
+* July 28 1998
+*  revised 2/00 to use work arrays
+* June 2000 ACM pass 4 gridding arguments:  y and z radius of influence,
+*               and cutoff.
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*
+*    5/2001    Let variable,  be a function of X and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (y, z, variable) , may be functions of x and/or time.
+* Output is gridded data in x, y, z, and time.  Calls routine "gausswt2_v0".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_yz_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to a YZ grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* YZ grid is determined by arguments 4 and 5, the result's x and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YZ locations. ' //
+     .        'May also be fcn of X,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'YSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in Y direction, in data units (e.g. km or lat)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_yz_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, nzout, ny2, nz2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nz2 = nzout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, nzout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, nzout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_yz_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, yax, zax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  zpts  > Scattered y,z,variable,  triples to be gridded.
+*  arg_3  variable, /    F can be fcn of x,t,e,f
+*  arg_4  yaxis of new grid
+*  arg_5  zaxis of new grid
+*  arg_6  interpolation parameter   yscale
+*  arg_7  interpolation parameter   zscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, nzpts, nscat
+      INTEGER ny, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, zlo, zhi
+      REAL y1, z1, t1, yf, zf, tf
+      REAL yy, zz, tt
+      REAL ysc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dy, dz, ycut, zcut, yybeg, yyend, zzbeg, zzend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, moduloz
+      REAL*8 modylen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nypts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' ZPTS ', nypts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both Y and Z axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         nscat = yhi - ylo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Z) ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nypts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, z points.  ' //
+     .            'F() data values must be defined on Y or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and end for output axes.
+
+      y1 = yax(1)
+      z1 = zax(1)
+
+      yf = yax(ny)
+      zf = zax(nz)
+
+*  Time parameters for subroutine gausswt.  Calling with 1 time.
+
+      nt = 1
+      tt = 1.
+      t1 = 1.
+      tf = 1.
+      tsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      ysc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( ysc .LE. 0. ) THEN
+         errtxt = 'Y mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      zsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO k3 = 1, nz
+            DO j3 = 1, ny
+               grid(j3,k3) = 0.
+            ENDDO
+         ENDDO
+
+         DO k3 = 1, nz
+            DO j3 = 1, ny
+               wate(j3,k3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over y and z, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, yy, zz)
+            IF ( yhi .GT. ylo ) THEN
+               j3 = ylo + idx - 1
+               k3 = zlo
+            ELSE
+               j3 = ylo
+               k3 = zlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  yy .EQ. bad_flag(ARG1) .OR.
+     .            zz .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloy ) THEN
+               CALL modscat(yax(1), yax(ny), modylen, 1, yy)
+            ENDIF
+            IF ( moduloz ) THEN
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+
+            CALL gausswt2_v0(yy, zz, tt, val, grid, wate, ny,
+     .                    nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                    zsc, tsc, cutoff, iwflag, ny, nz)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloy ) THEN
+               dy = yf - y1
+               IF (ny .GT. 1) dy = (yf-y1)/real(ny-1)  ! gridbox size in data units
+               ycut = cutoff*ysc/dy                    ! cutoff scaled to grid units
+
+               IF ( (yy-y1 .GE. 0.) .AND. (yy-y1 .LT. ycut) ) THEN
+                  yyend = yf + (yy-y1)
+                  CALL gausswt2_v0(yyend, zz, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+
+               IF ( (yf-yy .GE. 0.) .AND. (yf-yy .LT. ycut) ) THEN
+                  yybeg = y1 - (yf-yy)
+                  CALL gausswt2_v0(yybeg, zz, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+            ENDIF
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2_v0(yy, zzend, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+
+               IF ( (zf-zz .LT. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2_v0(yy, zzbeg, tt, val, grid, wate, ny,
+     .                          nz, nt, y1, z1, t1, yf, zf, tf, ysc,
+     .                          zsc, tsc, cutoff, iwflag, ny, nz)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( wate(j3,k3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(j3,k3) / wate(j3,k3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               j3 = j3 + 1
+ 200        CONTINUE
+
+            k3 = k3 + 1
+ 300     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_zt.F b/fer/efi/scat2gridgauss_zt.F
new file mode 100644
index 0000000..d9f6668
--- /dev/null
+++ b/fer/efi/scat2gridgauss_zt.F
@@ -0,0 +1,660 @@
+*
+*  scat2gridgauss_zt
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+
+* Returns variable interpolated onto an equally-spaced Z-T grid.
+* Input is scattered triples: (z, t, variable) , f may be function of x, y, e, f
+* Output is gridded data in z, t.  Calls routine "gausswt2".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_zt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian weighting to grid ' //
+     .                     'scattered data to a ZT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* ZT grid is determined by arguments 4 and 5, the result's z and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered ZT locations. ' //
+     .        'May also be fcn of X,Y,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_zt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nzout, ntout, nz2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nz2 = nzout * 2
+      nt2 = ntout * 2
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nzout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nzout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_zt_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, zax, tax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  tpts  > Scattered z,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of x,y,e,f
+*  arg_4  z axis of output grid
+*  arg_5  t axis of output grid
+*  arg_6  interpolation parameter   zscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 zax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nzpts, ntpts, nscat
+      INTEGER nx, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER zlo, zhi, tlo, thi
+      REAL x1, z1, t1, xf, zf, tf
+      REAL xx, zz, tt
+      REAL xsc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dz, dt, zcut, tcut, zzbeg, zzend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloz, modulot
+      REAL*8 modzlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Z_AXIS, modzlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nzpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' ZPTS,', ' TPTS ', nzpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (zhi .GT. zlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Z and T axis'
+         GOTO 999
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(Z) ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(T) ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (zlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F()  ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered z, t points.  ' //
+     .            'F() data values must be defined on Z or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG4)
+*  Check that zax is a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Z_AXIS, arg_lo_ss(Z_AXIS, ARG4),
+     .                        arg_hi_ss(Z_AXIS, ARG4), zax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      z1 = zax(1)
+      t1 = tax(1)
+
+      zf = zax(nz)
+      tf = tax(nt)
+
+*  X parameters for subroutine gausswt.  Calling with 1 x value
+
+      nx = 1
+      xx = 1.
+      x1 = 1.
+      xf = 1.
+      xsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      zsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( zsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Y, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO k3 = 1, nz
+               grid(k3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO k3 = 1, nz
+               wate(k3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over z and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E, or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, zz, tt)
+            IF ( zhi .GT. zlo ) THEN
+               k3 = zlo + idx - 1
+               l3 = tlo
+            ELSE
+               k3 = zlo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  zz .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloz ) THEN
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2(zz, tt, xx, val, grid, wate, nz,
+     .                    nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                    tsc, xsc, cutoff, iwflag, nz, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2(zzend, tt, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+
+               IF ( (zf-zz .GE. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2(zzbeg, tt, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2(zz, ttend, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = z1 - (zf-tt)
+                  CALL gausswt2(zz, ttbeg, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            k3 = 1
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( wate(k3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(k3,l3) / wate(k3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               k3 = k3 + 1
+ 300        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridgauss_zt_v0.F b/fer/efi/scat2gridgauss_zt_v0.F
new file mode 100644
index 0000000..f95de08
--- /dev/null
+++ b/fer/efi/scat2gridgauss_zt_v0.F
@@ -0,0 +1,662 @@
+*
+*  scat2gridgauss_zt_v0
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* Nov 7, 2002 from scat2gridgauss_xy
+c V62 *ACM* 2/2009 Call gausswt2_v0, with the original treatment of the
+c            cutoff parameter, for backwards compatibility.
+
+* Returns variable interpolated onto an equally-spaced Z-T grid.
+* Input is scattered triples: (z, t, variable) , f may be function of x, y, e, f
+* Output is gridded data in z, t.  Calls routine "gausswt2_v0".
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE  scat2gridgauss_zt_v0_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Gaussian v0 weighting to grid ' //
+     .                     'scattered data to a ZT grid.')
+      CALL ef_set_num_args(id, 9)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 4)
+
+* ZT grid is determined by arguments 4 and 5, the result's z and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered ZT locations. ' //
+     .        'May also be fcn of X,Y,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'ZSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .    'Mapping scale in Z direction, in data units (e.g. m or km)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'TSCALE')
+      CALL ef_set_arg_desc(id, arg,
+     .  'Mapping scale in T direction, in data units (e.g. hrs, days)')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 8
+      CALL ef_set_arg_name(id, arg, 'CUTOFF')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Weight cutoff: use pts within cutoff*scale')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 9
+      CALL ef_set_arg_name(id, arg, '0')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Not used; included for backwards compatibility')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridgauss_zt_v0_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nzout, ntout, nz2, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nz2 = nzout * 2
+      nt2 = ntout * 2
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* grid  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nzout, ntout, 1, 1, 1, 1)
+
+* wate - weights.
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nzout, ntout, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+
+      SUBROUTINE scat2gridgauss_zt_v0_compute(id, arg_1, arg_2, arg_3,
+     .                           arg_4, arg_5, arg_6, arg_7, arg_8,
+     .                           arg_9, result, zax, tax, grid, wate)
+
+*  arg_1  ypts \
+*  arg_2  tpts  > Scattered z,t,variable,  triples to be gridded.
+*  arg_3  variable, /    variable, can be fcn of x,y,e,f
+*  arg_4  z axis of output grid
+*  arg_5  t axis of output grid
+*  arg_6  interpolation parameter   zscale
+*  arg_7  interpolation parameter   tscale
+*  arg_8  interpolation parameter   cutoff
+*  arg_9  not used
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+      REAL arg_8(mem8lox:mem8hix, mem8loy:mem8hiy, mem8loz:mem8hiz,
+     .           mem8lot:mem8hit, mem8loe:mem8hie, mem8lof:mem8hif)
+      REAL arg_9(mem9lox:mem9hix, mem9loy:mem9hiy, mem9loz:mem9hiz,
+     .           mem9lot:mem9hit, mem9loe:mem9hie, mem9lof:mem9hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 zax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL grid(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL wate(wrk4lox:wrk4hix, wrk4loy:wrk4hiy)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nzpts, ntpts, nscat
+      INTEGER nx, nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER zlo, zhi, tlo, thi
+      REAL x1, z1, t1, xf, zf, tf
+      REAL xx, zz, tt
+      REAL xsc, zsc, tsc
+      REAL cutoff
+      REAL val
+      REAL dz, dt, zcut, tcut, zzbeg, zzend, ttbeg, ttend
+      INTEGER iwflag
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloz, modulot
+      REAL*8 modzlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Z_AXIS, modzlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nzpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' ZPTS,', ' TPTS ', nzpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (zhi .GT. zlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Z and T axis'
+         GOTO 999
+      ELSE IF ( zhi .GT. zlo ) THEN
+         nscat = zhi - zlo + 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(Z) ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         nscat = thi - tlo + 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(T) ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE IF ( (zlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         nscat = 1
+         IF ( nzpts .NE. nscat ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F()  ', nzpts, nscat
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered z, t points.  ' //
+     .            'F() data values must be defined on Z or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG4)
+*  Check that zax is a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Z_AXIS, arg_lo_ss(Z_AXIS, ARG4),
+     .                        arg_hi_ss(Z_AXIS, ARG4), zax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and end for output axes.
+
+      z1 = zax(1)
+      t1 = tax(1)
+
+      zf = zax(nz)
+      tf = tax(nt)
+
+*  X parameters for subroutine gausswt.  Calling with 1 x value
+
+      nx = 1
+      xx = 1.
+      x1 = 1.
+      xf = 1.
+      xsc = 1.
+
+*  iwflag=1 for time wrapping; 0 for no wrapping
+
+      iwflag = 0
+
+*  Get interpolation parameters: mapping scales (data units)
+
+      zsc = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( zsc .LE. 0. ) THEN
+         errtxt = 'Z mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+      tsc = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .            arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .            arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( tsc .LE. 0. ) THEN
+         errtxt = 'T mapping scale parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  And cutoff parameter:
+
+      cutoff = arg_8(arg_lo_ss(X_AXIS,ARG8), arg_lo_ss(Y_AXIS,ARG8),
+     .               arg_lo_ss(Z_AXIS,ARG8), arg_lo_ss(T_AXIS,ARG8),
+     .               arg_lo_ss(E_AXIS,ARG8), arg_lo_ss(F_AXIS,ARG8))
+
+      IF ( cutoff .LE. 0. ) THEN
+         errtxt = 'Cutoff parameter must be positive'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Y, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  Initialize sums of values and weights.
+
+         DO l3 = 1, nt
+            DO k3 = 1, nz
+               grid(k3,l3) = 0.
+            ENDDO
+         ENDDO
+
+         DO l3 = 1, nt
+            DO k3 = 1, nz
+               wate(k3,l3) = 0.
+            ENDDO
+         ENDDO
+
+*  Loop over z and t, compute the weighted sums for gaussian-weighted mapping
+*  onto the grid.  Args 1-2 may be on the X,Y,Z,T,E, or F axis of ARG1 and
+*  ARG2, sending them to a subroutine collapses the extra dimensions so the
+*  value can be found.
+
+         DO 700 idx = 1, nscat
+
+            CALL pickout2(arg_1, arg_2, idx, zz, tt)
+            IF ( zhi .GT. zlo ) THEN
+               k3 = zlo + idx - 1
+               l3 = tlo
+            ELSE
+               k3 = zlo
+               l3 = tlo + idx - 1
+            ENDIF
+            val = arg_3(i3,j3,k3,l3,m3,n3)
+
+            IF (  zz .EQ. bad_flag(ARG1) .OR.
+     .            tt .EQ. bad_flag(ARG2) .OR.
+     .           val .EQ. bad_flag(ARG3) ) GOTO 700
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered point.
+            IF ( moduloz ) THEN
+               CALL modscat(zax(1), zax(nz), modzlen, 1, zz)
+            ENDIF
+            IF ( modulot ) THEN
+               CALL modscat(tax(1), tax(nt), modtlen, 1, tt)
+            ENDIF
+
+            CALL gausswt2_v0(zz, tt, xx, val, grid, wate, nz,
+     .                    nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                    tsc, xsc, cutoff, iwflag, nz, nt)
+
+C ACM modulo 11/9/00  Put points within cutoff of the end just beyond the
+C                     other end, and use in the gridding computation.
+
+            IF ( moduloz ) THEN
+               dz = zf - z1
+               IF (nz .GT. 1) dz = (zf-z1)/real(nz-1)  ! gridbox size in data units
+               zcut = cutoff*zsc/dz                    ! cutoff scaled to grid units
+
+               IF ( (zz-z1 .GE. 0.) .AND. (zz-z1 .LT. zcut) ) THEN
+                  zzend = zf + (zz-z1)
+                  CALL gausswt2_v0(zzend, tt, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+
+               IF ( (zf-zz .GE. 0.) .AND. (zf-zz .LT. zcut) ) THEN
+                  zzbeg = z1 - (zf-zz)
+                  CALL gausswt2_v0(zzbeg, tt, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+            ENDIF
+
+            IF ( modulot ) THEN
+               dt = tf - t1
+               IF (nt .GT. 1) dt = (tf-t1)/real(nt-1)  ! gridbox size in data units
+               tcut = cutoff*tsc/dt                    ! cutoff scaled to grid units
+
+               IF ( (tt-t1 .GE. 0.) .AND. (tt-t1 .LT. tcut) ) THEN
+                  ttend = tf + (tt-t1)
+                  CALL gausswt2_v0(zz, ttend, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+
+               IF ( (tf-tt .LT. 0.) .AND. (tf-tt .LT. tcut) ) THEN
+                  ttbeg = z1 - (zf-tt)
+                  CALL gausswt2_v0(zz, ttbeg, xx, val, grid, wate, nz,
+     .                          nt, nx, z1, t1, x1, zf, tf, xf, zsc,
+     .                          tsc, xsc, cutoff, iwflag, nz, nt)
+               ENDIF
+            ENDIF
+
+ 700     CONTINUE
+
+*  Put gridded fcn into result variable, dividing by summed weights. (as in
+*  gaussfin, but indices needn't start at 1)
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            k3 = 1
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( wate(k3,l3) .GT. 0. ) THEN
+                  result(i,j,k,l,m,n) = grid(k3,l3) / wate(k3,l3)
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+
+               k3 = k3 + 1
+ 300        CONTINUE
+
+            l3 = l3 + 1
+ 400     CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/scat2gridlaplace_xt.F b/fer/efi/scat2gridlaplace_xt.F
new file mode 100644
index 0000000..f60999d
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_xt.F
@@ -0,0 +1,759 @@
+*
+*  scat2gridlaplace_xt
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced X-T grid.
+* Input is scattered triples: (x, t, variable) , may be functions of Y,Z,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_xt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to an XT grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* XT grid is determined by arguments 4 and 5, the result's x and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered XT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XT locations. ' //
+     .        'May also be fcn of Y,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_xt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, ntout, nx2, nt2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nt2 = ntout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, ntout, 1, 1, 1, 1)
+
+* xscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* tscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_xt_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            xax, tax, zgridded, xscat, tscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  xpts \
+*  arg_2  tpts  > scattered x,t,variable,  triples to be gridded. F can be fcn of y,z,e,f
+*  arg_3  variable, /
+*  arg_4  xaxis of new grid
+*  arg_5  taxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL xscat(wrk4lox:wrk4hix)
+      REAL tscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, ntpts, npts, nscat
+      INTEGER nx, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, tlo, thi
+      INTEGER nrng
+      REAL x1, t1, dx, dt
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, modulot
+      REAL*8 modxlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nxpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' TPTS ', nxpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both X and T axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         npts = xhi - xlo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         npts = thi - tlo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(T) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, t points.  ' //
+     .            'F() data values must be defined on X or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and delta for output axes.
+
+      x1 = xax(1)
+      t1 = tax(1)
+
+      IF ( nx .GT. 1 ) THEN
+         dx = xax(2) - xax(1)
+      ELSE
+         errtxt = 'More than one output X coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( nt .GT. 1 ) THEN
+         dt = tax(2) - tax(1)
+      ELSE
+         errtxt = 'More than one output T coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (x,t,f) points.
+*  Assigns xscat, tscat, fscat, and nscat.
+
+         CALL nobadxt(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, xlo, xhi, j3, k3, tlo, thi, m3, n3,
+     .                xscat, tscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( modulox ) THEN
+            CALL modscat(xax(1), xax(nx), modxlen, nscat, xscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(tax(1), tax(nt), modtlen, nscat, tscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends xscat, tscat,
+*  fscat, and updates nscat to the new count.
+         IF ( modulox ) THEN
+            CALL copyscat(xax, nx, nrng, nscat, xscat, tscat, fscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL copyscat(tax, nt, nrng, nscat, tscat, xscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO l3 = 1, nt
+            DO i3 = 1, nx
+               zgridded(i3,l3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, nx, nt, nx, nt, x1, t1,
+     .      dx, dt, xscat, tscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( zgridded(i3,l3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(i3,l3)
+               ENDIF
+
+               i3 = i3 + 1
+  100       CONTINUE
+
+            l3 = l3 + 1
+  400    CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+  200 CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+  300 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadxt(xin, tin, fin, badx, badt, badf,
+     .                   npts, xlo, xhi, j3, k3, tlo, thi, m3, n3,
+     .                   xscat, tscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of y and z
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL xin(*), tin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL badx, badt, badf
+      INTEGER npts, xlo, xhi, j3, k3, tlo, thi, m3, n3
+
+*  Output arguments
+      REAL xscat(*), tscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, i3, l3
+
+      nscat = 0
+
+      IF ( xhi .GT. xlo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 100
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 100
+            i3 = xlo + idx - 1
+            l3 = tlo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 200
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 200
+            i3 = xlo
+            l3 = tlo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/scat2gridlaplace_xy.F b/fer/efi/scat2gridlaplace_xy.F
new file mode 100644
index 0000000..a79a0d1
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_xy.F
@@ -0,0 +1,758 @@
+*
+*  scat2gridlaplace_xy
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced X-Y grid.
+* Input is scattered triples: (x, y, variable), may be functions of Z,T,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to an XY grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* XY grid is determined by arguments 4 and 5, the result's x and y axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered XY locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XY locations. ' //
+     .        'May also be fcn of Z,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_xy_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nyout, nx2, ny2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG5) - arg_lo_ss(Y_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      ny2 = nyout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nyout, 1, 1, 1, 1)
+
+* xscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* yscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_xy_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            xax, yax, zgridded, xscat, yscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  xpts \
+*  arg_2  ypts  > scattered x,y,variable,  triples to be gridded. F can be fcn of z,t,e,f
+*  arg_3  variable, /
+*  arg_4  xaxis of new grid
+*  arg_5  yaxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 yax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL xscat(wrk4lox:wrk4hix)
+      REAL yscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nypts, npts, nscat
+      INTEGER nx, ny
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, ylo, yhi
+      INTEGER nrng
+      REAL x1, y1, dx, dy
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloy
+      REAL*8 modxlen, modylen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Y_AXIS, modylen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      IF ( nxpts .NE. nypts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' YPTS ', nxpts, nypts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (yhi .GT. ylo) ) THEN
+         errtxt = 'F() data values defined on both X and Y axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         npts = xhi - xlo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( yhi .GT. ylo ) THEN
+         npts = yhi - ylo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Y) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (ylo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, y points.  ' //
+     .            'F() data values must be defined on X or Y axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG5)
+*  Check that yax a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Y_AXIS, arg_lo_ss(Y_AXIS, ARG5),
+     .                        arg_hi_ss(Y_AXIS, ARG5), yax)
+
+*  Set start and delta for output axes.
+
+      x1 = xax(1)
+      y1 = yax(1)
+
+      IF ( nx .GT. 1 ) THEN
+         dx = xax(2) - xax(1)
+      ELSE
+         errtxt = 'More than one output X coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( ny .GT. 1 ) THEN
+         dy = yax(2) - yax(1)
+      ELSE
+         errtxt = 'More than one output Y coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Z, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (x,y,f) points.
+*  Assigns xscat, yscat, fscat, and nscat.
+
+         CALL nobadxy(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, xlo, xhi, ylo, yhi, k3, l3, m3, n3,
+     .                xscat, yscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( modulox ) THEN
+            CALL modscat(xax(1), xax(nx), modxlen, nscat, xscat)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL modscat(yax(1), yax(ny), modylen, nscat, yscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends xscat, yscat,
+*  fscat, and updates nscat to the new count.
+         IF ( modulox ) THEN
+            CALL copyscat(xax, nx, nrng, nscat, xscat, yscat, fscat)
+         ENDIF
+         IF ( moduloy ) THEN
+            CALL copyscat(yax, ny, nrng, nscat, yscat, xscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO j3 = 1, ny
+            DO i3 = 1, nx
+               zgridded(i3,j3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, nx, ny, nx, ny, x1, y1,
+     .      dx, dy, xscat, yscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         j3 = 1
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( zgridded(i3,j3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(i3,j3)
+               ENDIF
+
+               i3 = i3 + 1
+  100       CONTINUE
+
+            j3 = j3 + 1
+  200    CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+  300 CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+  400 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadxy(xin, yin, fin, badx, bady, badf,
+     .                   npts, xlo, xhi, ylo, yhi, k3, l3, m3, n3,
+     .                   xscat, yscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of z and t
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL xin(*), yin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL badx, bady, badf
+      INTEGER npts, xlo, xhi, ylo, yhi, k3, l3, m3, n3
+
+*  Output arguments
+      REAL xscat(*), yscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, i3, j3
+
+      nscat = 0
+
+      IF ( xhi .GT. xlo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 100
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 100
+            i3 = xlo + idx - 1
+            j3 = ylo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            yscat(nscat) = yin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 200
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 200
+            i3 = xlo
+            j3 = ylo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            yscat(nscat) = yin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/scat2gridlaplace_xz.F b/fer/efi/scat2gridlaplace_xz.F
new file mode 100644
index 0000000..a637314
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_xz.F
@@ -0,0 +1,759 @@
+*
+*  scat2gridlaplace_xz
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced X-Z grid.
+* Input is scattered triples: (x, z, variable, ); may be functions of Y,T,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_xz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to an XZ grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* XZ grid is determined by arguments 4 and 5, the result's x and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'XPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered XZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered XZ locations. ' //
+     .        'May also be fcn of Y,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'XAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'X axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_xz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nxout, nzout, nx2, nz2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nxout = 1 + arg_hi_ss(X_AXIS,ARG4) - arg_lo_ss(X_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      nx2 = nxout * 2
+      nz2 = nzout * 2
+
+* xax  output x axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nx2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nxout, nzout, 1, 1, 1, 1)
+
+* xscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_xz_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            xax, zax, zgridded, xscat, zscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  xpts \
+*  arg_2  zpts  > scattered x,z,variable,  triples to be gridded. F can be fcn of y,t,e,f
+*  arg_3  variable, /
+*  arg_4  xaxis of new grid
+*  arg_5  zaxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 xax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL xscat(wrk4lox:wrk4hix)
+      REAL zscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nxpts, nzpts, npts, nscat
+      INTEGER nx, nz
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER xlo, xhi, zlo, zhi
+      INTEGER nrng
+      REAL x1, z1, dx, dz
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL modulox, moduloz
+      REAL*8 modxlen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(X_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulox = mdulo(X_AXIS)
+      IF ( modulox ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, X_AXIS, modxlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nxpts = 0
+      DO 10 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nxpts .NE. 0 ) THEN
+               nxpts = nxpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nxpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  10  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nxpts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' XPTS,', ' ZPTS ', nxpts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      xlo = arg_lo_ss(X_AXIS,ARG3)
+      xhi = arg_hi_ss(X_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (xhi .GT. xlo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both X and Z axis'
+         GOTO 999
+      ELSE IF ( xhi .GT. xlo ) THEN
+         npts = xhi - xlo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(X) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         npts = zhi - zlo + 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F(Z) ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (xlo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nxpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' XPTS,', ' F()  ', nxpts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered x, z points.  ' //
+     .            'F() data values must be defined on X or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(X_AXIS,ARG4)
+      hi_ss = arg_hi_ss(X_AXIS,ARG4)
+*  Check that xax is an X axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be an X axis'
+         GO TO 999
+      ENDIF
+      nx = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, X_AXIS, arg_lo_ss(X_AXIS, ARG4),
+     .                        arg_hi_ss(X_AXIS, ARG4), xax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and delta for output axes.
+
+      x1 = xax(1)
+      z1 = zax(1)
+
+      IF ( nx .GT. 1 ) THEN
+         dx = xax(2) - xax(1)
+      ELSE
+         errtxt = 'More than one output X coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( nz .GT. 1 ) THEN
+         dz = zax(2) - zax(1)
+      ELSE
+         errtxt = 'More than one output Z coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each Y, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (x,z,f) points.
+*  Assigns xscat, zscat, fscat, and nscat.
+
+         CALL nobadxz(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, xlo, xhi, j3, zlo, zhi, l3, m3, n3,
+     .                xscat, zscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( modulox ) THEN
+            CALL modscat(xax(1), xax(nx), modxlen, nscat, xscat)
+         ENDIF
+         IF ( moduloz ) THEN
+            CALL modscat(zax(1), zax(nz), modzlen, nscat, zscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends xscat, zscat,
+*  fscat, and updates nscat to the new count.
+         IF ( modulox ) THEN
+            CALL copyscat(xax, nx, nrng, nscat, xscat, zscat, fscat)
+         ENDIF
+         IF ( moduloz ) THEN
+            CALL copyscat(zax, nz, nrng, nscat, zscat, xscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO k3 = 1, nz
+            DO i3 = 1, nx
+               zgridded(i3,k3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, nx, nz, nx, nz, x1, z1,
+     .      dx, dz, xscat, zscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            i3 = 1
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               IF ( zgridded(i3,k3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(i3,k3)
+               ENDIF
+
+               i3 = i3 + 1
+  100       CONTINUE
+
+            k3 = k3 + 1
+  300    CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+  200 CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+  400 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadxz(xin, zin, fin, badx, badz, badf,
+     .                   npts, xlo, xhi, j3, zlo, zhi, l3, m3, n3,
+     .                   xscat, zscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of y and t
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL xin(*), zin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL badx, badz, badf
+      INTEGER npts, xlo, xhi, j3, zlo, zhi, l3, m3, n3
+
+*  Output arguments
+      REAL xscat(*), zscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, i3, k3
+
+      nscat = 0
+
+      IF ( xhi .GT. xlo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 100
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 100
+            i3 = xlo + idx - 1
+            k3 = zlo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            zscat(nscat) = zin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(xin(idx), badx) ) GOTO 200
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 200
+            i3 = xlo
+            k3 = zlo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            xscat(nscat) = xin(idx)
+            zscat(nscat) = zin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/scat2gridlaplace_yt.F b/fer/efi/scat2gridlaplace_yt.F
new file mode 100644
index 0000000..0eb74e3
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_yt.F
@@ -0,0 +1,759 @@
+*
+*  scat2gridlaplace_yt
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced Y-T grid.
+* Input is scattered triples: (y, t, variable) , may be functions of X,Z,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_yt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to a YT grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* YT grid is determined by arguments 4 and 5, the result's y and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered YT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YT locations. ' //
+     .        'May also be fcn of X,Z,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_yt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, ntout, ny2, nt2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nt2 = ntout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, ntout, 1, 1, 1, 1)
+
+* xscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* tscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_yt_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            yax, tax, zgridded, yscat, tscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  ypts \
+*  arg_2  tpts  > scattered y,t,variable,  triples to be gridded. F can be fcn of x,z,e,f
+*  arg_3  variable, /
+*  arg_4  yaxis of new grid
+*  arg_5  taxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL yscat(wrk4lox:wrk4hix)
+      REAL tscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, ntpts, npts, nscat
+      INTEGER ny, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, tlo, thi
+      INTEGER nrng
+      REAL y1, t1, dy, dt
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, modulot
+      REAL*8 modylen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      modulot = mdulo(T_AXIS)
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nypts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' TPTS ', nypts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Y and T axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         npts = yhi - ylo + 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         npts = thi - tlo + 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(T) ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, t points.  ' //
+     .            'F() data values must be defined on Y or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and delta for output axes.
+
+      y1 = yax(1)
+      t1 = tax(1)
+
+      IF ( ny .GT. 1 ) THEN
+         dy = yax(2) - yax(1)
+      ELSE
+         errtxt = 'More than one output Y coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( nt .GT. 1 ) THEN
+         dt = tax(2) - tax(1)
+      ELSE
+         errtxt = 'More than one output T coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Z, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k3 = arg_lo_ss(Z_AXIS,ARG3)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (y,t,f) points.
+*  Assigns yscat, tscat, fscat, and nscat.
+
+         CALL nobadyt(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, i3, ylo, yhi, k3, tlo, thi, m3, n3,
+     .                yscat, tscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( moduloy ) THEN
+            CALL modscat(yax(1), yax(ny), modylen, nscat, yscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(tax(1), tax(nt), modtlen, nscat, tscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends yscat, tscat,
+*  fscat, and updates nscat to the new count.
+         IF ( moduloy ) THEN
+            CALL copyscat(yax, ny, nrng, nscat, yscat, tscat, fscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL copyscat(tax, nt, nrng, nscat, tscat, yscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO l3 = 1, nt
+            DO j3 = 1, ny
+               zgridded(j3,l3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, ny, nt, ny, nt, y1, t1,
+     .      dy, dt, yscat, tscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( zgridded(j3,l3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(j3,l3)
+               ENDIF
+
+               j3 = j3 + 1
+  200       CONTINUE
+
+            l3 = l3 + 1
+  400    CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+  100 CONTINUE
+
+         k3 = k3 + arg_incr(Z_AXIS,ARG3)
+  300 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadyt(yin, tin, fin, bady, badt, badf,
+     .                   npts, i3, ylo, yhi, k3, tlo, thi, m3, n3,
+     .                   yscat, tscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of x and z
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL yin(*), tin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL bady, badt, badf
+      INTEGER npts, i3, ylo, yhi, k3, tlo, thi, m3, n3
+
+*  Output arguments
+      REAL yscat(*), tscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, j3, l3
+
+      nscat = 0
+
+      IF ( yhi .GT. ylo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 100
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 100
+            j3 = ylo + idx - 1
+            l3 = tlo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            yscat(nscat) = yin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 200
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 200
+            j3 = ylo
+            l3 = tlo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            yscat(nscat) = yin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/scat2gridlaplace_yz.F b/fer/efi/scat2gridlaplace_yz.F
new file mode 100644
index 0000000..2e8fd2c
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_yz.F
@@ -0,0 +1,759 @@
+*
+*  scat2gridlaplace_yz
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced Y-Z grid.
+* Input is scattered triples: (y, z, variable) , may be functions of X,T,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_yz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to a YZ grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* YZ grid is determined by arguments 4 and 5, the result's y and z axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'YPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered YZ locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered YZ locations. ' //
+     .        'May also be fcn of X,T,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, YES, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'YAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Y axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_yz_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nyout, nzout, ny2, nz2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nyout = 1 + arg_hi_ss(Y_AXIS,ARG4) - arg_lo_ss(Y_AXIS,ARG4)
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG5) - arg_lo_ss(Z_AXIS,ARG5)
+
+      ny2 = nyout * 2
+      nz2 = nzout * 2
+
+* yax  output y axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              ny2, 1, 1, 1, 1, 1)
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nyout, nzout, 1, 1, 1, 1)
+
+* yscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_yz_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            yax, zax, zgridded, yscat, zscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  ypts \
+*  arg_2  zpts  > scattered y,z,variable,  triples to be gridded. F can be fcn of x,t,e,f
+*  arg_3  variable, /
+*  arg_4  yaxis of new grid
+*  arg_5  zaxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 yax(wrk1lox:wrk1hix/2)
+      REAL*8 zax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL yscat(wrk4lox:wrk4hix)
+      REAL zscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nypts, nzpts, npts, nscat
+      INTEGER ny, nz
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER ylo, yhi, zlo, zhi
+      INTEGER nrng
+      REAL y1, z1, dy, dz
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloy, moduloz
+      REAL*8 modylen, modzlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Y_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloy = mdulo(Y_AXIS)
+      IF ( moduloy ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Y_AXIS, modylen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, Z_AXIS, modzlen)
+      ENDIF
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nypts = 0
+      DO 20 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nypts .NE. 0 ) THEN
+               nypts = nypts * (hi_ss - lo_ss + 1)
+            ELSE
+               nypts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  20  CONTINUE
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      IF ( nypts .NE. nzpts ) THEN
+         WRITE (errtxt,90) ' YPTS,', ' ZPTS ', nypts, nzpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      ylo = arg_lo_ss(Y_AXIS,ARG3)
+      yhi = arg_hi_ss(Y_AXIS,ARG3)
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+
+      IF ( (yhi .GT. ylo) .AND. (zhi .GT. zlo) ) THEN
+         errtxt = 'F() data values defined on both Y and Z axis'
+         GOTO 999
+      ELSE IF ( yhi .GT. ylo ) THEN
+         npts = yhi - ylo + 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Y) ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( zhi .GT. zlo ) THEN
+         npts = zhi - zlo + 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F(Z) ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (ylo .NE. ef_unspecified_int4) .OR.
+     .          (zlo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nypts .NE. npts ) THEN
+            WRITE (errtxt,90) ' YPTS,', ' F()  ', nypts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered y, z points.  ' //
+     .            'F() data values must be defined on Y or Z axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Y_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Y_AXIS,ARG4)
+*  Check that yax is a Y axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Y axis'
+         GO TO 999
+      ENDIF
+      ny = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG5)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG5)
+*  Check that zax a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Y_AXIS, arg_lo_ss(Y_AXIS, ARG4),
+     .                        arg_hi_ss(Y_AXIS, ARG4), yax)
+
+      CALL ef_get_coordinates(id, ARG5, Z_AXIS, arg_lo_ss(Z_AXIS, ARG5),
+     .                        arg_hi_ss(Z_AXIS, ARG5), zax)
+
+*  Set start and delta for output axes.
+
+      y1 = yax(1)
+      z1 = zax(1)
+
+      IF ( ny .GT. 1 ) THEN
+         dy = yax(2) - yax(1)
+      ELSE
+         errtxt = 'More than one output Y coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( nz .GT. 1 ) THEN
+         dz = zax(2) - zax(1)
+      ELSE
+         errtxt = 'More than one output Z coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, T, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (y,z,f) points.
+*  Assigns yscat, zscat, fscat, and nscat.
+
+         CALL nobadyz(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, i3, ylo, yhi, zlo, zhi, l3, m3, n3,
+     .                yscat, zscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( moduloy ) THEN
+            CALL modscat(yax(1), yax(ny), modylen, nscat, yscat)
+         ENDIF
+         IF ( moduloz ) THEN
+            CALL modscat(zax(1), zax(nz), modzlen, nscat, zscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends yscat, zscat,
+*  fscat, and updates nscat to the new count.
+         IF ( moduloy ) THEN
+            CALL copyscat(yax, ny, nrng, nscat, yscat, zscat, fscat)
+         ENDIF
+         IF ( moduloz ) THEN
+            CALL copyscat(zax, nz, nrng, nscat, zscat, yscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO k3 = 1, nz
+            DO j3 = 1, ny
+               zgridded(j3,k3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, ny, nz, ny, nz, y1, z1,
+     .      dy, dz, yscat, zscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         k3 = 1
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j3 = 1
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               IF ( zgridded(j3,k3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(j3,k3)
+               ENDIF
+
+               j3 = j3 + 1
+  200       CONTINUE
+
+            k3 = k3 + 1
+  300    CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+  100 CONTINUE
+
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+  400 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadyz(yin, zin, fin, bady, badz, badf,
+     .                   npts, i3, ylo, yhi, zlo, zhi, l3, m3, n3,
+     .                   yscat, zscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of x and t
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL yin(*), zin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL bady, badz, badf
+      INTEGER npts, i3, ylo, yhi, zlo, zhi, l3, m3, n3
+
+*  Output arguments
+      REAL yscat(*), zscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, j3, k3
+
+      nscat = 0
+
+      IF ( yhi .GT. ylo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 100
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 100
+            j3 = ylo + idx - 1
+            k3 = zlo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            yscat(nscat) = yin(idx)
+            zscat(nscat) = zin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(yin(idx), bady) ) GOTO 200
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 200
+            j3 = ylo
+            k3 = zlo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            yscat(nscat) = yin(idx)
+            zscat(nscat) = zin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/scat2gridlaplace_zt.F b/fer/efi/scat2gridlaplace_zt.F
new file mode 100644
index 0000000..62fcde3
--- /dev/null
+++ b/fer/efi/scat2gridlaplace_zt.F
@@ -0,0 +1,759 @@
+*
+*  scat2gridlaplace_zt
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+* Ansley Manke
+* July 28 1998
+*
+* Returns variable interpolated onto an equally-spaced Z-T grid.
+* Input is scattered triples: (z, t, variable) , may be functions of X,Y,E,F.
+* Output is gridded data in X,Y,Z,T,E,F.  Calls routine "zgrid_laplace".
+*
+* Nov 13, 2000 1) Allow modulo axes: if modulo take points from other end
+*                 to use in gridding each end
+*              2) Check that the scattered points are listed on the I,J,or
+*                 K axis only, as they may be functions of time.
+*  (12/1/2000) 3) If the destination axis is modulo, treat the scattered
+*                 points as modulo too.
+*
+*   12/7/2000  Add error checking on gridding parameters
+*    5/2001    Let variable,  be a function of Z and/or T
+*
+*  11/12/2002  Remove option 2) above: the spatial location of the scattered points
+*              is a 1-D list.
+*   2/ 9/2005  When we fixed the argument limit machinery this fcn
+*              breaks if the output axes are limited by some context.
+*              use ef_set_axis_extend to force the regridding to be
+*              done on the unrestricted output grid.
+*  8/26/2008   The functions call zgrid from the PPLUS code. This function has
+*              some hard-wired workspace limited to 50K points. Instead allocate
+*              work arrays here and pass them to zgrid_laplace in this directory
+*              with no changes other than the work array declarations.
+*
+*  *kms* 4/2012 Removed extending result grid axes with ef_unspecified_int4: 
+*               this appears to destroy the axes of the result grid as demonstrated
+*               by the listing in bn_scat2grid_test.jnl.  Now it is up to the
+*               the user to give (not truncate) the result grid axes:
+*      let sgrid = scat2gridlaplace_xy(xpts, ypts, variable, x[gx=xax5], y[gy=yax5], 5., 5)
+*      load sgrid  ! <--- without this, the following uses a 1-element Y axis
+*      list/x=4:5/y=1 sgrid
+
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE scat2gridlaplace_zt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'Use Laplace weighting to grid ' //
+     .                     'scattered data to a ZT grid.')
+      CALL ef_set_num_args(id, 7)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 8)
+
+* ZT grid is determined by arguments 4 and 5, the result's z and t axes.
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ZPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'TPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T coordinates of scattered ZT locations')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'F')
+      CALL ef_set_arg_desc(id, arg,
+     .        'variable at scattered ZT locations. ' //
+     .        'May also be fcn of X,Y,E,F')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, YES, YES)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'ZAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Z axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+      arg = 5
+      CALL ef_set_arg_name(id, arg, 'TAXPTS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'T axis coordinates of a regular output grid')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, YES, NO, NO)
+
+      arg = 6
+      CALL ef_set_arg_name(id, arg, 'KAY')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Laplace/spline mixing parameter KAY; ' //
+     .        '0.0=pure Laplace; inf=pure spline')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 7
+      CALL ef_set_arg_name(id, arg, 'NRNG')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Effect parameter NRNG; grid vals ' //
+     .        'undef if > NRNG grid steps from pts')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE scat2gridlaplace_zt_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nzout, ntout, nz2, nt2
+      INTEGER nxin, nyin, nzin, ntin, nein, nfin, nin
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nxin = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+      nyin = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+      nzin = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+      ntin = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+      nein = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+      nfin = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+      nin = MAX(nxin,nyin,nzin,ntin,nein,nfin)
+*  If modulo axis, the scatter arrays are extended for values
+*  within nrng of the cut-point.  Worst case: everything gets
+*  duplicated at both ends; thus three times the points for
+*  each modulo axis.
+      nin = 9 * nin
+
+      nzout = 1 + arg_hi_ss(Z_AXIS,ARG4) - arg_lo_ss(Z_AXIS,ARG4)
+      ntout = 1 + arg_hi_ss(T_AXIS,ARG5) - arg_lo_ss(T_AXIS,ARG5)
+
+      nz2 = nzout * 2
+      nt2 = ntout * 2
+
+* zax  output z axis
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nz2, 1, 1, 1, 1, 1)
+
+* tax  output t axis
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+* zgridded  work array - gridded data.
+      CALL ef_set_work_array_dims_6d(id, 3,
+     .                                1,     1, 1, 1, 1, 1,
+     .                            nzout, ntout, 1, 1, 1, 1)
+
+* zscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 4,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* tscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 5,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* fscat - scattered points with gaps removed and extended for modulo
+      CALL ef_set_work_array_dims_6d(id, 6,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array zpij
+      CALL ef_set_work_array_dims_6d(id, 7,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+* zgrid_laplace work array knxt
+      CALL ef_set_work_array_dims_6d(id, 8,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              nin, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE scat2gridlaplace_zt_compute(id, arg_1, arg_2, arg_3,
+     .                            arg_4, arg_5, arg_6, arg_7, result,
+     .                            zax, tax, zgridded, zscat, tscat,
+     .                            fscat, zpij, knxt)
+
+*  arg_1  zpts \
+*  arg_2  tpts  > scattered z,t,variable,  triples to be gridded. F can be fcn of x,y,e,f
+*  arg_3  variable, /
+*  arg_4  zaxis of new grid
+*  arg_5  taxis of new grid
+*  arg_6  interpolation parameter   kay
+*  arg_7  interpolation parameter   nrng
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(mem4lox:mem4hix, mem4loy:mem4hiy, mem4loz:mem4hiz,
+     .           mem4lot:mem4hit, mem4loe:mem4hie, mem4lof:mem4hif)
+      REAL arg_5(mem5lox:mem5hix, mem5loy:mem5hiy, mem5loz:mem5hiz,
+     .           mem5lot:mem5hit, mem5loe:mem5hie, mem5lof:mem5hif)
+      REAL arg_6(mem6lox:mem6hix, mem6loy:mem6hiy, mem6loz:mem6hiz,
+     .           mem6lot:mem6hit, mem6loe:mem6hie, mem6lof:mem6hif)
+      REAL arg_7(mem7lox:mem7hix, mem7loy:mem7hiy, mem7loz:mem7hiz,
+     .           mem7lot:mem7hit, mem7loe:mem7hie, mem7lof:mem7hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the unused final dimensions in the work arrays since
+* Fortran is column major
+      REAL*8 zax(wrk1lox:wrk1hix/2)
+      REAL*8 tax(wrk2lox:wrk2hix/2)
+      REAL zgridded(wrk3lox:wrk3hix, wrk3loy:wrk3hiy)
+      REAL zscat(wrk4lox:wrk4hix)
+      REAL tscat(wrk5lox:wrk5hix)
+      REAL fscat(wrk6lox:wrk6hix)
+      REAL zpij(wrk7lox:wrk7hix)
+      REAL knxt(wrk8lox:wrk8hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+************************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL zgridbad
+      PARAMETER (zgridbad = 1.e+35)  ! missing-data flag used by zgrid_laplace
+
+      INTEGER i, j, k, l, m, n
+      INTEGER idx, lo_ss, hi_ss
+      INTEGER nzpts, ntpts, npts, nscat
+      INTEGER nz, nt
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER zlo, zhi, tlo, thi
+      INTEGER nrng
+      REAL z1, t1, dz, dt
+      REAL kay
+      CHARACTER*250 errtxt
+
+C  variables for checking axis characteristics (modulo, regular)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), mdulo(6), regular(6)
+      LOGICAL moduloz, modulot
+      REAL*8 modzlen, modtlen
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*  Check to see if output axes are regular, and get modulo characteristics
+      CALL ef_get_axis_info_6d(id, ARG4, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(Z_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      moduloz = mdulo(Z_AXIS)
+      IF ( moduloz ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG4, Z_AXIS, modzlen)
+      ENDIF
+
+      CALL ef_get_axis_info_6d(id, ARG5, ax_name, ax_units,
+     .                         backward, mdulo, regular)
+      IF ( .NOT. regular(T_AXIS) ) THEN
+         errtxt = 'Output axes must be REGULARLY spaced'
+         GOTO 999
+      ENDIF
+      IF ( modulot ) THEN
+         CALL ef_get_axis_modulo_len(id, ARG5, T_AXIS, modtlen)
+      ENDIF
+      modulot = mdulo(T_AXIS)
+
+*  Find number of points in scattered input points.  1-D arrays defining the
+*  scattered data points may lie on the X, Y, Z, T, E, or F axis of the input
+*  arguments.
+*  Using as flattened arrays, so consider all axes.
+
+      nzpts = 0
+      DO 30 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG1)
+         hi_ss = arg_hi_ss(idx,ARG1)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( nzpts .NE. 0 ) THEN
+               nzpts = nzpts * (hi_ss - lo_ss + 1)
+            ELSE
+               nzpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  30  CONTINUE
+
+      ntpts = 0
+      DO 40 idx = X_AXIS, F_AXIS
+         lo_ss = arg_lo_ss(idx,ARG2)
+         hi_ss = arg_hi_ss(idx,ARG2)
+         IF ( lo_ss .NE. ef_unspecified_int4 ) THEN
+            IF ( ntpts .NE. 0 ) THEN
+               ntpts = ntpts * (hi_ss - lo_ss + 1)
+            ELSE
+               ntpts = hi_ss - lo_ss + 1
+            ENDIF
+         ENDIF
+  40  CONTINUE
+
+      IF ( nzpts .NE. ntpts ) THEN
+         WRITE (errtxt,90) ' ZPTS,', ' TPTS ', nzpts, ntpts
+         GOTO 999
+      ENDIF
+
+* Verify the number of values given in ARG3 makes sense
+      zlo = arg_lo_ss(Z_AXIS,ARG3)
+      zhi = arg_hi_ss(Z_AXIS,ARG3)
+      tlo = arg_lo_ss(T_AXIS,ARG3)
+      thi = arg_hi_ss(T_AXIS,ARG3)
+
+      IF ( (zhi .GT. zlo) .AND. (thi .GT. tlo) ) THEN
+         errtxt = 'F() data values defined on both Z and T axis'
+         GOTO 999
+      ELSE IF ( zhi .GT. zlo ) THEN
+         npts = zhi - zlo + 1
+         IF ( nzpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(Z) ', nzpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( thi .GT. tlo ) THEN
+         npts = thi - tlo + 1
+         IF ( nzpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F(T) ', nzpts, npts
+            GOTO 999
+         ENDIF
+      ELSE IF ( (zlo .NE. ef_unspecified_int4) .OR.
+     .          (tlo .NE. ef_unspecified_int4) ) THEN
+         npts = 1
+         IF ( nzpts .NE. npts ) THEN
+            WRITE (errtxt,90) ' ZPTS,', ' F()  ', nzpts, npts
+            GOTO 999
+         ENDIF
+      ELSE
+         errtxt = 'No data in scattered z, t points.  ' //
+     .            'F() data values must be defined on Z or T axis.'
+         GOTO 999
+      ENDIF
+  90  FORMAT('Input scattered', 2A6, 'have different # of points', 2I8)
+
+*  Compute number of points in output axes.
+
+      lo_ss = arg_lo_ss(Z_AXIS,ARG4)
+      hi_ss = arg_hi_ss(Z_AXIS,ARG4)
+*  Check that zax is a Z axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fourth argument must be a Z axis'
+         GO TO 999
+      ENDIF
+      nz = hi_ss - lo_ss + 1
+
+      lo_ss = arg_lo_ss(T_AXIS,ARG5)
+      hi_ss = arg_hi_ss(T_AXIS,ARG5)
+*  Check that tax a T axis
+      IF ( lo_ss .EQ. ef_unspecified_int4 ) THEN
+         errtxt = 'Fifth argument must be a T axis'
+         GO TO 999
+      ENDIF
+      nt = hi_ss - lo_ss + 1
+
+C  Get coordinates of output axes.
+
+      CALL ef_get_coordinates(id, ARG4, Z_AXIS, arg_lo_ss(Z_AXIS, ARG4),
+     .                        arg_hi_ss(Z_AXIS, ARG4), zax)
+
+      CALL ef_get_coordinates(id, ARG5, T_AXIS, arg_lo_ss(T_AXIS, ARG5),
+     .                        arg_hi_ss(T_AXIS, ARG5), tax)
+
+*  Set start and delta for output axes.
+
+      z1 = zax(1)
+      t1 = tax(1)
+
+      IF ( nz .GT. 1 ) THEN
+         dz = zax(2) - zax(1)
+      ELSE
+         errtxt = 'More than one output Z coordinate required'
+         GOTO 999
+      ENDIF
+      IF ( nt .GT. 1 ) THEN
+         dt = tax(2) - tax(1)
+      ELSE
+         errtxt = 'More than one output T coordinate required'
+         GOTO 999
+      ENDIF
+
+*  Get interpolation parameters.
+
+      kay = arg_6(arg_lo_ss(X_AXIS,ARG6), arg_lo_ss(Y_AXIS,ARG6),
+     .            arg_lo_ss(Z_AXIS,ARG6), arg_lo_ss(T_AXIS,ARG6),
+     .            arg_lo_ss(E_AXIS,ARG6), arg_lo_ss(F_AXIS,ARG6))
+      IF ( kay .LT. 0. ) THEN
+         errtxt = 'Gridding parameter KAY must be nonnegative'
+         GOTO 999
+      ENDIF
+
+      nrng = arg_7(arg_lo_ss(X_AXIS,ARG7), arg_lo_ss(Y_AXIS,ARG7),
+     .             arg_lo_ss(Z_AXIS,ARG7), arg_lo_ss(T_AXIS,ARG7),
+     .             arg_lo_ss(E_AXIS,ARG7), arg_lo_ss(F_AXIS,ARG7))
+      IF ( nrng .LE. 0 ) THEN
+         errtxt = 'Gridding parameter NRNG must be a positive integer'
+         GOTO 999
+      ENDIF
+
+*  Compute result at each X, Y, E, F
+
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*  If there is a missing value routine zgrid does not grid the data in
+*  a zone around that point, even if there are other nearby good data
+*  points.  Remove missing/bad data from the input (z,t,f) points.
+*  Assigns zscat, tscat, fscat, and nscat.
+
+         CALL nobadzt(arg_1, arg_2, arg_3,
+     .                bad_flag(ARG1), bad_flag(ARG2), bad_flag(ARG3),
+     .                npts, i3, j3, zlo, zhi, tlo, thi, m3, n3,
+     .                zscat, tscat, fscat, nscat)
+
+*  If an output axis is modulo, apply modulo adjustment to that coordinate
+*  of the scattered points.
+         IF ( moduloz ) THEN
+            CALL modscat(zax(1), zax(nz), modzlen, nscat, zscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL modscat(tax(1), tax(nt), modtlen, nscat, tscat)
+         ENDIF
+
+*  If an output axis is modulo, mirror the scattered points within NRNG
+*  of each end to the other end of the region.  Extends zscat, tscat,
+*  fscat, and updates nscat to the new count.
+         IF ( moduloz ) THEN
+            CALL copyscat(zax, nz, nrng, nscat, zscat, tscat, fscat)
+         ENDIF
+         IF ( modulot ) THEN
+            CALL copyscat(tax, nt, nrng, nscat, tscat, zscat, fscat)
+         ENDIF
+
+*  Initialize zgridded to all zeros
+
+         DO l3 = 1, nt
+            DO k3 = 1, nz
+               zgridded(k3,l3) = 0.0
+            ENDDO
+         ENDDO
+
+*  Grid the data.
+
+         CALL zgrid_laplace(zgridded, nz, nt, nz, nt, z1, t1,
+     .      dz, dt, zscat, tscat, fscat, zpij, knxt, nscat, kay, nrng)
+
+*  Put zgridded into result variable.  Use "bad_flag_result" rather than
+*  "zgridbad" to mark bad data.
+
+         l3 = 1
+         DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+            k3 = 1
+            DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+               IF ( zgridded(k3,l3) .EQ. zgridbad ) THEN
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ELSE
+                  result(i,j,k,l,m,n) = zgridded(k3,l3)
+               ENDIF
+
+               k3 = k3 + 1
+  300       CONTINUE
+
+            l3 = l3 + 1
+  400    CONTINUE
+
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+  100 CONTINUE
+
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+  200 CONTINUE
+
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+  500 CONTINUE
+
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+  600 CONTINUE
+
+      RETURN
+
+  999 CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+************************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE nobadzt(zin, tin, fin, badz, badt, badf,
+     .                   npts, i3, j3, zlo, zhi, tlo, thi, m3, n3,
+     .                   zscat, tscat, fscat, nscat)
+
+* ACM 11/00 change so not exact comparison: wasnt catching all bad values.
+* ACM  5/01 properly deal with f-scattered points which may be fcns of x and y
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      LOGICAL TM_FPEQ
+
+*  Input arguments
+      REAL zin(*), tin(*)
+      REAL fin(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .         mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL badz, badt, badf
+      INTEGER npts, i3, j3, zlo, zhi, tlo, thi, m3, n3
+
+*  Output arguments
+      REAL zscat(*), tscat(*), fscat(*)
+      INTEGER nscat
+
+*  Local variables
+      INTEGER idx, k3, l3
+
+      nscat = 0
+
+      IF ( zhi .GT. zlo ) THEN
+
+         DO 100 idx = 1, npts
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 100
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 100
+            k3 = zlo + idx - 1
+            l3 = tlo
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 100
+            nscat = nscat + 1
+            zscat(nscat) = zin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  100    CONTINUE
+
+      ELSE
+
+         DO 200 idx = 1, nscat
+            IF ( TM_FPEQ(zin(idx), badz) ) GOTO 200
+            IF ( TM_FPEQ(tin(idx), badt) ) GOTO 200
+            k3 = zlo
+            l3 = tlo + idx - 1
+            IF ( TM_FPEQ(fin(i3,j3,k3,l3,m3,n3), badf) ) GOTO 200
+            nscat = nscat + 1
+            zscat(nscat) = zin(idx)
+            tscat(nscat) = tin(idx)
+            fscat(nscat) = fin(i3,j3,k3,l3,m3,n3)
+  200    CONTINUE
+
+      ENDIF
+
+      RETURN
+      END
+
+
+C**
+C**  Comments from routine ZGRID used in the PLOT+ graphics package; 
+C**  the code is part of Ferret which calls PLOT+
+C**
+C**	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+C**     1	xp,yp,zp,n,cay,nrng) 
+C** 
+C**    @(#)zgrid	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
diff --git a/fer/efi/secs_to_ymdhms.F b/fer/efi/secs_to_ymdhms.F
new file mode 100644
index 0000000..2b146e9
--- /dev/null
+++ b/fer/efi/secs_to_ymdhms.F
@@ -0,0 +1,154 @@
+	SUBROUTINE SECS_TO_YMDHMS ( num_secs,
+     .				    yr, mon, day, hr, min, sec )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Will break secs since 01-JAN-0000 00:00:00 into separate yr,mo,day,hr,min,sec
+* fields
+
+* V530 *sh* 1/02 - based upon tm_secs_to_date.F
+* V6.31 *acm* 11/09 Simplify the logic which decides what month/day it is
+*             as is already done in tm_secs_to_date.
+
+* Argument declarations
+	INTEGER	yr, mon, day, hr, min
+	REAL	sec
+	REAL*8	num_secs
+	
+*
+* Local Definition
+	INTEGER		month_by_day(365), leapadj, cent_cnt,
+     .			year_cnt, cent4_cnt, year4_cnt, tot_days,
+     .			tmp_days, days_before_month(12), ge59
+	REAL*8		secs_in_minute, secs_in_hour, secs_in_day,
+     .			secs_in_year, secs_in_4years, secs_in_cent,
+     .			secs_in_4cents, total_secs
+
+	PARAMETER	(secs_in_minute	 = 60.,
+     .			 secs_in_hour	 = secs_in_minute*60.,
+     .			 secs_in_day	 = secs_in_hour*24.,
+     .			 secs_in_year	 = secs_in_day*365.,
+     .			 secs_in_4years	 = secs_in_day*(3*365.+366.),
+     .			 secs_in_cent    = secs_in_day*(76*365.+24*366.),
+     .			 secs_in_4cents  = 4*secs_in_cent+secs_in_day)
+
+	DATA month_by_day /31*01, 28*02, 31*03, 30*04, 31*05, 30*06,
+     .			   31*07, 31*08, 30*09, 31*10, 30*11, 31*12/
+	DATA days_before_month	/   0,  31,  59,  90, 120, 151,
+     .				  181, 212, 243, 273, 304, 334/
+
+* trap invalid input
+	IF ( num_secs .LT. 0 ) THEN
+	   yr = 0
+	   mon = 1
+	   day = 1
+	   hr = 0
+	   min = 0
+	   sec = 0.0
+	   RETURN
+	ENDIF
+
+* Initialize
+	total_secs = num_secs
+
+* Subtract year 0 off (it's a leap year)
+	total_secs = total_secs - secs_in_year - secs_in_day
+
+* make sure we aren't working in year 0
+	IF (total_secs .GE. 0) THEN
+
+* Decide which century it is
+	  cent4_cnt = INT(total_secs/secs_in_4cents)
+	  total_secs = total_secs - cent4_cnt*secs_in_4cents
+	  cent_cnt = INT(total_secs/secs_in_cent)
+* Dec 31 on leap century test (years 400,800,1200...)
+	  IF (cent_cnt .EQ. 4                         .AND.
+     .	      total_secs .GE. cent4_cnt-secs_in_day)   cent_cnt = 3
+	  total_secs = total_secs - cent_cnt*secs_in_cent
+	  yr = 400*cent4_cnt + 100*cent_cnt
+
+* Decide what year it is exactly (1 year for year 0)
+	  year4_cnt = INT(total_secs/secs_in_4years)
+	  total_secs = total_secs - year4_cnt*secs_in_4years
+	  year_cnt = INT(total_secs/secs_in_year)
+* Dec 31 on leap year test (years 0,4,8,12...)
+	  IF (year_cnt .EQ. 4                         .AND.
+     .	      total_secs .GE. secs_in_4years-secs_in_day)   year_cnt = 3
+	  total_secs = total_secs - year_cnt*secs_in_year
+	  yr = yr + 4*year4_cnt + year_cnt + 1
+
+	ELSE
+* Year 0 stuff
+	  yr = 0
+	  total_secs = total_secs + secs_in_year + secs_in_day
+	ENDIF
+
+* Is this a leap year? (every 4th century is, otherwise century isn't)
+	leapadj = 0
+	IF (MOD(yr,400) .EQ. 0) THEN
+	  leapadj = 1
+	ELSE IF (MOD(yr,4) .EQ. 0 .AND. MOD(yr,100) .NE. 0) THEN
+	  leapadj = 1
+	ENDIF
+
+* How many days into year is this
+	tot_days = INT(total_secs/secs_in_day)
+	total_secs = total_secs - tot_days*secs_in_day
+
+* Decide what month/day it is
+
+	ge59 = 0
+	IF (tot_days .GE. 59) ge59 = 1
+	tmp_days = tot_days - leapadj* ge59
+
+	IF (tmp_days .LT. 0) STOP 'negative subscript in TM_SECS_TO_DATE'
+	mon = month_by_day(tmp_days+1)
+
+	leapadj = INT(mon/12. +.75)*leapadj
+	day = tot_days - (days_before_month(mon)+leapadj) + 1
+
+* Calculate number of hours
+	hr = INT(total_secs/secs_in_hour)
+* Subtract seconds for number of hours
+	total_secs = total_secs - secs_in_hour*(hr)
+* Calculate number of minutes
+	min = INT(total_secs/secs_in_minute)
+* Subtract seconds for number of minutes
+	total_secs = total_secs - secs_in_minute*(min)
+* Calculate number of seconds
+	sec = total_secs
+
+* finished
+9990	RETURN
+	END
diff --git a/fer/efi/sorti.F b/fer/efi/sorti.F
new file mode 100644
index 0000000..d0dab4e
--- /dev/null
+++ b/fer/efi/sorti.F
@@ -0,0 +1,352 @@
+*
+* sorti.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 1998
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function sorts data on x axis in increasing order.
+* Returns index of sorted values.  
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*  	LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sorti_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the I axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)
+
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'SORTI_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in I')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sorti_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sorti_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mxdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mxdat = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mxdat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mxdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sorti_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, ii
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS, ARG1)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               nsrt = 0
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = i1
+                  END IF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx, 
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               i = res_lo_ss(X_AXIS)
+               DO 120 ii = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(ii)
+                  i = i + 1
+ 120           CONTINUE
+
+               DO 140 i = res_lo_ss(X_AXIS)+nsrt, res_hi_ss(X_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 140           CONTINUE
+
+               j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sorti_str.F b/fer/efi/sorti_str.F
new file mode 100644
index 0000000..266368a
--- /dev/null
+++ b/fer/efi/sorti_str.F
@@ -0,0 +1,359 @@
+*
+* sorti_str.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Nov 2008
+* V6.2 *acm* SORTI for strings
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function sorts data on x axis in increasing order.
+* Returns index of sorted values.  
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sorti_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortl_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortl_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sorti_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the I axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in I')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sorti_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sorti_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mxdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mxdat = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mxdat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mxdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sorti_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, ii
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS, ARG1)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+               nsrt = 0
+
+               i1 = arg_lo_ss(X_AXIS, ARG1)
+               DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = i1
+                  ENDIF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               i = res_lo_ss(X_AXIS)
+               DO 120 ii = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(ii)
+                  i = i + 1
+ 120           CONTINUE
+
+               DO 140 i = res_lo_ss(X_AXIS)+nsrt, res_hi_ss(X_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 140           CONTINUE
+
+               j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortj.F b/fer/efi/sortj.F
new file mode 100644
index 0000000..5848b57
--- /dev/null
+++ b/fer/efi/sortj.F
@@ -0,0 +1,356 @@
+*
+* sortj.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 1998
+* ACM 1/3/2001  implement with merge rank translated from f90, originally from 
+*   http://www.fortran-2000.com/rank/index.html#1.1
+*
+* V5.4  12/11/2001  typo in argument description for DAT
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function sorts data on Y axis in increasing order.  
+* Returns index of sorted values.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*  	LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortj_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the J axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)
+
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'SORTJ_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in J')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortj_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortj_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mydat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mydat = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mydat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mydat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortj_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, jj
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               nsrt = 0
+
+               j1 = arg_lo_ss(Y_AXIS,ARG1)
+               DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = j1
+                  END IF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx, 
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               j = res_lo_ss(Y_AXIS)
+               DO 220 jj = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(jj)
+                  j = j + 1
+ 220           CONTINUE
+
+               DO 240 j = res_lo_ss(Y_AXIS)+nsrt, res_hi_ss(Y_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 240           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortj_str.F b/fer/efi/sortj_str.F
new file mode 100644
index 0000000..39be9cc
--- /dev/null
+++ b/fer/efi/sortj_str.F
@@ -0,0 +1,358 @@
+*
+* sortj_str.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* V6.2 *acm* SORTI for strings
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function sorts data on Y axis in increasing order.  
+* Returns index of sorted values.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortj_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortl_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortj_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortj_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the J axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in J')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortj_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortj_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mydat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mydat = 1 + arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mydat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mydat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortj_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, jj
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS, ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               nsrt = 0
+
+               j1 = arg_lo_ss(Y_AXIS, ARG1)
+               DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = j1
+                  ENDIF
+
+                  j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               j = res_lo_ss(Y_AXIS)
+               DO 220 jj = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(jj)
+                  j = j + 1
+ 220           CONTINUE
+
+               DO 240 j = res_lo_ss(Y_AXIS)+nsrt, res_hi_ss(Y_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 240           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortk.F b/fer/efi/sortk.F
new file mode 100644
index 0000000..de01a96
--- /dev/null
+++ b/fer/efi/sortk.F
@@ -0,0 +1,354 @@
+*
+* sortk.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 1988
+* ACM 1/3/2001  implement with merge rank translated from f90, originally from 
+*   http://www.fortran-2000.com/rank/index.html#1.1
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function sorts data on the z axis in increasing order.
+* Returns index of sorted values. 
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  SORTL(v). THE EXPRESSION
+*  	LIST/L=6:10 SORTL(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST SORTL(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortk_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the K axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)
+
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'SORTK_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in K')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortk_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortk_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mzdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mzdat = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mzdat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mzdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortk_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, kk
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = k1
+                  END IF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx,
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               k = res_lo_ss(Z_AXIS)
+               DO 320 kk = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(kk)
+                  k = k + 1
+ 320           CONTINUE
+
+               DO 340 k = res_lo_ss(Z_AXIS)+nsrt, res_hi_ss(Z_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 340           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortk_str.F b/fer/efi/sortk_str.F
new file mode 100644
index 0000000..4e0c0a9
--- /dev/null
+++ b/fer/efi/sortk_str.F
@@ -0,0 +1,359 @@
+*
+* sortk_str.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Nov 2008
+* V6.2 *acm* SORTI for strings
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function sorts data on the z axis in increasing order.
+* Returns index of sorted values. 
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortk_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortl_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortk_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortk_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the K axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in K')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortk_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortk_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mzdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mzdat = 1 + arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mzdat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2, 
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mzdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortk_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, kk
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               k1 = arg_lo_ss(Z_AXIS, ARG1)
+               DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = k1
+                  ENDIF
+
+                  k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               k = res_lo_ss(Z_AXIS)
+               DO 320 kk = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(kk)
+                  k = k + 1
+ 320           CONTINUE
+
+               DO 340 k = res_lo_ss(Z_AXIS)+nsrt, res_hi_ss(Z_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 340           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortl.F b/fer/efi/sortl.F
new file mode 100644
index 0000000..65cbba0
--- /dev/null
+++ b/fer/efi/sortl.F
@@ -0,0 +1,353 @@
+*
+* sortl.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 1998
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function sorts data on T axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortl(v). THE EXPRESSION
+*  	LIST/L=6:10 sortl(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortl(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortl_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the L axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)  
+      
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'SORTL_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in L')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortl_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortl_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mtdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortl_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, ll
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               l1 = arg_lo_ss(T_AXIS, ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = l1
+                  END IF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx, 
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               l = res_lo_ss(T_AXIS)
+               DO 420 ll = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(ll)
+                  l = l + 1
+ 420           CONTINUE
+
+               DO 440 l = res_lo_ss(T_AXIS)+nsrt, res_hi_ss(T_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 440           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortl_str.F b/fer/efi/sortl_str.F
new file mode 100644
index 0000000..92dc806
--- /dev/null
+++ b/fer/efi/sortl_str.F
@@ -0,0 +1,361 @@
+*
+* sortl_str.F
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* April 1998
+
+* V6.2 *acm* SORTL for strings
+*
+* This function sorts data on T axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortl_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortl_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortl_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortl_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the L axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)  
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in L')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortl_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortl_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mtdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mtdat = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mtdat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mtdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortl_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, ll
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+ 
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               l1 = arg_lo_ss(T_AXIS, ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = l1
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               l = res_lo_ss(T_AXIS)
+               DO 420 ll = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(ll)
+                  l = l + 1
+ 420           CONTINUE
+
+               DO 440 l = res_lo_ss(T_AXIS)+nsrt, res_hi_ss(T_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 440           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortm.F b/fer/efi/sortm.F
new file mode 100644
index 0000000..f547bd4
--- /dev/null
+++ b/fer/efi/sortm.F
@@ -0,0 +1,348 @@
+*
+* sortm.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* May 2012
+
+* This function sorts data on E axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortm(v). THE EXPRESSION
+*  	LIST/L=6:10 sortm(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortm(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortm_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the M axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)  
+      
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'sortm_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in M')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortm_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, E_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortm_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mdat = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mdat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortm_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, mm
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+      
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               m1 = arg_lo_ss(E_AXIS, ARG1)
+               DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = m1
+                  END IF
+
+                  m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx, 
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               m = res_lo_ss(E_AXIS)
+               DO 520 mm = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(mm)
+                  m = m + 1
+ 520           CONTINUE
+
+               DO 540 m = res_lo_ss(E_AXIS)+nsrt, res_hi_ss(E_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 540           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortm_str.F b/fer/efi/sortm_str.F
new file mode 100644
index 0000000..961e6ba
--- /dev/null
+++ b/fer/efi/sortm_str.F
@@ -0,0 +1,360 @@
+*
+* sorte_str.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* May 2012
+
+*  SORTM for strings
+*
+* This function sorts data on E axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortm_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortm_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortm_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortm_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the M axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)  
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in L')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, NO, YES)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortm_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, E_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortm_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mdat = 1 + arg_hi_ss(E_AXIS,ARG1) - arg_lo_ss(E_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                             mdat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortm_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, mm
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+ 
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               m1 = arg_lo_ss(E_AXIS, ARG1)
+               DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = m1
+                  ENDIF
+
+                  m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               m = res_lo_ss(E_AXIS)
+               DO 520 mm = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(mm)
+                  m = m + 1
+ 520           CONTINUE
+
+               DO 540 m = res_lo_ss(E_AXIS)+nsrt, res_hi_ss(E_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 540           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortn.F b/fer/efi/sortn.F
new file mode 100644
index 0000000..e10e93a
--- /dev/null
+++ b/fer/efi/sortn.F
@@ -0,0 +1,348 @@
+*
+* sortn.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* May 2012
+*
+* This function sorts data on T axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortn(v). THE EXPRESSION
+*  	LIST/L=6:10 sortn(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortn(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortn_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of data, sorted ',
+     .        'on the N axis in increasing order')
+      CALL ef_set_desc(id, fcn_desc)  
+      
+* Tell Ferret to run the following instead, if the argument is a string.
+      CALL ef_set_alt_fcn_name(id, 'sortn_STR')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'DAT')
+      CALL ef_set_arg_desc(id, arg, 'variable to sort in N')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortn_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, F_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortn_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mdat = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+
+* sort_dat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mdat, 1, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                            mdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortn_compute(id, arg_1, result, sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL sort_dat (wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, nn
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               n1 = arg_lo_ss(F_AXIS, ARG1)
+               DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+                  IF (arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(1)) THEN
+                     nsrt = nsrt + 1
+                     sort_dat(nsrt) = arg_1(i1,j1,k1,l1,m1,n1)
+                     sort_indx(nsrt) = n1
+                  END IF
+
+                  n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600           CONTINUE
+
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2 (sort_dat, sort_indx, 
+     .                                      bad_flag(arg1), nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               n = res_lo_ss(F_AXIS)
+               DO 620 nn = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(nn)
+                  n = n + 1
+ 620           CONTINUE
+
+               DO 640 n = res_lo_ss(F_AXIS)+nsrt, res_hi_ss(F_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 640           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/sortn_str.F b/fer/efi/sortn_str.F
new file mode 100644
index 0000000..28805db
--- /dev/null
+++ b/fer/efi/sortn_str.F
@@ -0,0 +1,360 @@
+*
+* sortn_str.F
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* May 2012
+*
+* This function sorts data on T axis in increasing order.  
+* Returns index of sorted values.  The indices of any missing
+* data are listed first.
+*
+*  NOTE:
+*  IT IS GENERALLY ADVISABLE TO INCLUDE EXPLICIT LIMITS WHEN WORKING WITH
+*  FUNCTIONS THAT REPLACE AXES. FOR EXAMPLE, THE CONSIDER THE FUNCTION
+*  sortn_str(v). THE EXPRESSION
+*  	LIST/L=6:10 sortn_str(v)
+*  IS NOT EQUIVALENT TO
+*  	LIST sortn_str(v[L=6:10])
+*  THE FORMER WILL LIST THE 6TH THROUGH 10TH SORTED INDICES FROM THE ENTIRE
+*  L RANGE OF VARIABLE V. THE LATTER WILL LIST ALL OF THE INDICES THAT
+*  RESULT FROM SORTING v[L=6:10].
+*  
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE sortn_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*120 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT ('Returns indices of string data, sorted on the N axis ',
+     .        'in increasing order, null strings at the end')
+      CALL ef_set_desc(id, fcn_desc)  
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STR')
+      CALL ef_set_arg_desc(id, arg, 'String variable to sort in N')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, NO)
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE sortn_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo, my_hi
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      my_lo = 1
+      my_hi = arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, F_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE sortn_str_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mdat
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      mdat = 1 + arg_hi_ss(F_AXIS,ARG1) - arg_lo_ss(F_AXIS,ARG1)
+
+* sort_dat (256 * 4 bytes = 1024 byte string, but only use first 512 for safety sake)
+      CALL ef_set_work_array_dims_6d(id,   1,
+     .                                1,   1, 1, 1, 1, 1,
+     .                            mdat, 256, 1, 1, 1, 1)
+
+* sort_indx
+      CALL ef_set_work_array_dims_6d(id, 2,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             mdat, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE sortn_str_compute(id, arg_1, result,
+     .                             sort_dat, sort_indx)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      CHARACTER*512 sort_dat(wrk1lox:wrk1hix)
+      REAL sort_indx(wrk2lox:wrk2hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER nsrt, slen, nn
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+ 
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS, ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS, ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+               nsrt = 0
+
+               n1 = arg_lo_ss(F_AXIS, ARG1)
+               DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+                  nsrt = nsrt + 1
+                  CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                    i1, j1, k1, l1, m1, n1, slen, sort_dat(nsrt))
+                  IF (slen .LE. 0) THEN
+                     nsrt = nsrt - 1
+                  ELSE
+                     sort_indx(nsrt) = n1
+                  ENDIF
+
+                  n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600           CONTINUE
+*
+* Sort based on sort_dat.  sort_indx goes along for the ride,
+* elements moved when elements of sort_dat moved.
+*
+               IF (nsrt .GT. 1) CALL HEAP2_STR (sort_dat, 
+     .                                   sort_indx, nsrt)
+
+* Put sorted indices in the array first, then bad flags.
+
+               n = res_lo_ss(F_AXIS)
+               DO 620 nn = 1, nsrt
+                  result(i,j,k,l,m,n) = sort_indx(nn)
+                  n = n + 1
+ 620           CONTINUE
+
+               DO 640 n = res_lo_ss(F_AXIS)+nsrt, res_hi_ss(F_AXIS)
+                  result(i,j,k,l,m,n) = bad_flag_result
+ 640           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/str_mask.F b/fer/efi/str_mask.F
new file mode 100644
index 0000000..4532f60
--- /dev/null
+++ b/fer/efi/str_mask.F
@@ -0,0 +1,175 @@
+*
+* str_mask.F
+*
+* Ansley Manke 08/2013
+*
+* This function takes a string variable and mask on the same axis.
+* and returns the variable containing the strings where the mask is
+* a valid value and a null string where the mask is bad-value
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE str_mask_init(id)
+
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+      CALL ef_version_test(ef_version)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 
+     . 'Returns a variable expanded by the lengths given in arg 2' )
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, 
+     .     IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'STRING')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg,'string variable to mask')
+      CALL ef_set_axis_influence_6d(id, arg, YES, YES, YES, YES, YES, YES)
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'MASK')
+      CALL ef_set_arg_unit(id, arg, ' ')
+
+      CALL ef_set_arg_desc(id, arg, 
+     .     'valid value where string is to be returned')
+      CALL ef_set_axis_influence_6d(id, arg, YES, YES, YES, YES, YES, YES)
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE str_mask_compute(id, arg_1, arg_2, result)
+
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+
+      INTEGER id
+
+      REAL bad_flag(1:EF_MAX_ARGS), bad_flag_result
+      REAL arg_1(strdf,
+     .           mem1lox:mem1hix, mem1loy:mem1hiy, 
+     .           mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .           mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, 
+     .           mem2loz:mem2hiz, mem2lot:mem2hit, 
+     .           mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL result(strdf, 
+     .            memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshiz, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable's axes. 
+
+      INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
+      INTEGER arg_lo_ss(6,1:EF_MAX_ARGS), arg_hi_ss(6,1:EF_MAX_ARGS),
+     .     arg_incr(6,1:EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i,j,k,l,m,n
+      INTEGER slen
+      CHARACTER*100 errtxt
+      CHARACTER*2048 buff
+      CHARACTER*1  null
+      REAL str_mask
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+      
+      null = ''
+
+* Put the requested features into the result
+
+      DO 200 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+      DO 200 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+      DO 200 l = res_lo_ss(Z_AXIS), res_hi_ss(T_AXIS)
+      DO 200 k = res_lo_ss(T_AXIS), res_hi_ss(Z_AXIS)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+      DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+	 IF ( arg_2(i,j,k,l,m,n) .NE. bad_flag(2) ) THEN
+            CALL ef_get_string_arg_element_6d(id, ARG1, arg_1, 
+     .                      i,j,k,l,m,n, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+	 ELSE
+            CALL EF_PUT_STRING(null, 1, result(1,i,j,k,l,m,n))
+         ENDIF  ! arg_2 good
+
+ 200  CONTINUE
+
+ 300  CONTINUE
+      
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+ 9000 CALL EF_BAIL_OUT(id, errtxt)
+      END
diff --git a/fer/efi/svdeof-4.F b/fer/efi/svdeof-4.F
new file mode 100644
index 0000000..24255a6
--- /dev/null
+++ b/fer/efi/svdeof-4.F
@@ -0,0 +1,770 @@
+c..........svdeof-4.f: Do EOFs with either NX > NT or NT > NX
+
+c   User description:
+c..........Subroutine finds "traditionally-scaled" EOFs using SVD routine.
+c.........."Traditionally-scaled" means that the units of the EOFs are the
+c..........  units of the variable, while the TAFs are dimensionless.
+c..........Routine is based on Numerical Recipes routine svdcmp.f.
+c..........Result of EOF decomposition is that a function f(x,t) of space and  
+c..........  time is decomposed into a sum of products: f(x,t) = SUM[v(x)*a(t)].
+c..........The v(x) are referred to as the EOFs, or eigenvectors, while the
+c..........  a(t) are the "Time Amplitude Functions" (TAFs) (Also called
+c..........  "Principal Components") 
+c..........The number of terms in the sum (number of non-zero EOFs)  
+c..........  is the minimum of (# of locations,# of times). 
+
+c..........Much CPU is saved by choosing to do the EOFs according to which of
+c..........NX,NT is larger, since the number of nonzero eigenvalues is min(NX,NT).
+c..........The routine can be called with any (NX,NT) (makes the choice automatically)
+
+c---------------------------------------------------------------------------
+c.....Use: call the front-end routine DO_SVD_EOF with the following arguments:
+
+c    A(NX,NT)	I/O	data set to be decomposed => returned as TAFs(neof,time)
+c    NX			I	# of spatial locations in data set A
+c    NT			I	# of time realizations in data set A
+c    W(NX)	O	eigenvalues of decomposition
+c    V(NX,NX)	O	EOFs in columns (V(space,neof))
+c    PCT(NX)	O	% variance represented by each EOF
+
+c   Notes:
+c..........In the "standard" form, NT.ge.NX (more times than locations),
+c..........there are NX non-zero EOFs and the output arrays are full.
+c..........In the reversed form, NT.lt.NX (more locations than times),
+c..........there are only NT non-zero EOFs (remaining values are zero).
+
+c...>>>>....Data input matrix A is destroyed on output (overwritten with TAFs).
+c...>>>>....Writes error messages to unit 6.
+c...>>>>....There are 2 hardwired values in these routines:
+c			IWRK=200000, declared in DO_SVD_EOF for use in sub MATRIXTRANS
+c				IWRK must be at least (NX+NT)/2 (array MOVE(IWRK)).
+c			NMAX=100000, declared in SVDEOF (workspace vectors RV1 and INDX)
+c				NMAX is the maximum size of the smaller of (NX,NT)
+
+c...........Included subroutines, called by DO_SVD_EOF (no external routines required)
+c			FIX_V (rearranges array V in the case of reversed EOFs) (comments at fix_v)
+c			SCALING (does "traditional scaling")
+c			DEMEAN (demeans input data)
+c			SVDEOF (modified Numerical Recipes routine SVDCMP)
+c			INDEXX (NR routine to sort eigenvalues to size order)
+c			MATRIXTRANS (matrix transpose routine from U.Kent, UK)
+c			SWITCH_A_V (switches (back) the roles of A and V if reversed EOFS)
+
+c   History:
+c...........Based on Numerical Recipes subroutine svdcmp.
+c...........Aug 1992: svdeof-1.f: svdcmp2 modified to transpose input array A 
+c...........  to usual form: A(N,M), where N is space and M is time. M.ge.N.
+c...........May 1998: Sorting EOFs by size of eigenvalue (svdeof-2.f).
+c...........Jun 1006: svdeof-4.f handles either NX>NT or NT>NX
+c...........Everything beyond svdcmp programmed by Billy Kessler (NOAA/PMEL)
+
+c ......... 7/2012 ACM Implement as Ferret external function. Workspace is allocated
+c ......... and sent in to the function. A status flag is returned.
+
+c*********************************************************************
+
+c.......Front-end subroutine to choose which way to do the EOFs, based on size of M and N.
+c.......DO_SVD_EOF is called from the main program, and calls SVDEOF to do the work.
+
+c..........It is assumed that the input data is A(space,time) (NX,NT).
+
+	SUBROUTINE DO_SVD_EOF (A, NX, NT, w, v, pct, move, work2, work3, ier)
+        IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+c...................................maximum size of (m+n)/2.
+cc	PARAMETER (iwrk=200000)		! HARDWIRING
+	INTEGER ier
+
+c...........it is ok to use NX for dim(W,V,PCT) because that is really NEOF
+c...........which is the minimum of (NX,NT)
+	real A(NX,NT),W(NX),V(NX,NX),pct(NX), work2(*), work3(*)
+
+c......................................internal arrays.
+	integer move(*)
+	INTEGER iwrk
+	iwrk = (nx+nt)/2
+
+c-----------------------------------------------------------------------
+c........check that enough space is provided in hardwired array (iwrk)
+cc	if ((nx+nt)/2.gt.iwrk) then
+cc	   	write(6,*) '(nx+nt)/2.gt.',iwrk,' in routine DO_SVD_EOF. Error. Returning.'
+cc	   	return
+cc	endif
+	
+c.................demean data array A. (Do first to handle either transpose)
+c.................now do by subroutine to allow A to be A(NX*NT).
+	call demean (a, nx, nt)
+	
+c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
+c........IF-block to work with either usual or reversed EOFs
+
+c........find out whether NX or NT is smaller
+	if (nt.ge.nx) then		! more times than locations = usual EOFs
+
+		call svdeof(a, nt, nx, w, v, pct, work2, work3, ier)		! do the work
+		IF (ier .NE. 0) RETURN
+
+c...........NEOF=NX nonzero EOFs 
+c...........EOFs in V(NX,NEOF)   NX = NEOF
+c...........TAFs in A(NEOF,NT)   NT > NEOF
+
+c...........do the "traditional scaling"
+		call scaling(a, nx, nt, w, v, pct, nx)
+		
+	else					! more locations than times. Must reverse order
+
+c..........transpose the input data array A(NX,NT)
+c..........after transpose, A is used as A(NT,NX)=(time,space)
+c..........(but this can only be done in a sub call where A is just an address)
+		call MATRIXTRANS(a,nx,nt,nt*nx,move,iwrk,iok)	
+
+c............now call the SVD calculation with transposed data array A
+		call svdeof(a, nx, nt, w, v, pct, work2, work3, ier)
+		IF (ier .NE. 0) RETURN
+		
+c......There are NEOF=NT nonzero EOFs (note NT < NX). 
+
+c......The EOFs are in A(NEOF=NT,NX) which is filled. 
+c......It must be transposed to be in the same order as the usual case
+c......(but note it is not square as are the usual EOFs stored in V(NX,NX))
+		call MATRIXTRANS(a,nt,nx,nt*nx,move,iwrk,iok)
+
+c......The output of SVDEOF makes use of W(NT), PCT(NT) and V(NT,NT).
+c......W and PCT are OK as is, since they are 1-d vectors, but the
+c......needed elements of V are stored as a sequence of length NT*NT, 
+c......(NT TAFs in sequence, followed by zeroes), stored in an actual 
+c......array V(NX,NX) (recall NX > NT).
+c......Fix V in a subroutine: 
+c......Place each TAF running down sequential columns of V(NX,NX).
+c......When this is done, the TAFs take up an NT by NT square in the 
+c......upper left corner of the larger array V(NX,NX).
+		call fix_v(v,nt,nx)
+				
+c......Transpose V to get the usual order, but note the zeroes. 
+c......Must give the complete size of V to the transpose routine.
+		call MATRIXTRANS(v,nx,nx,nx*nx,move,iwrk,iok)
+
+c......Note reversal of position of A and V in this call.
+		call scaling(v, nx, nt, w, a, pct, nt)
+		
+c......Switch the EOFs and TAFs to V and A, respectively.
+c......Also clean up by zeroing out the unused parts (also W and PCT).
+		call switch_a_v(a,v,w,pct,nx,nt)
+				
+	endif
+	
+	return
+	end
+	
+c*********************************************************************
+c.....subroutine to switch (back) the roles of A and V in the case of reversed EOFS.
+c.....The result is that the EOFs are in the columns of V, and the TAFs in the rows of A.
+c.....This works because NT < NX. The original array V(NX,NX) only contains the
+c.....TAFS in a square (NT,NT) in its upper left corner, so there is at least one
+c.....free column at the right side of V, for work space.
+
+c.....Also clean up by zeroing out the unused parts (including W and PCT)
+
+c.....Method:
+c	1) move the last (n=NEOF=NT) column of A to the last column (NX) of V
+c	2) move the final element of each TAF from V(n,NT) to A(n,NT)
+c	3) repeat (1) and (2) with the second-last column and second-last elements
+c	   continue the above operations NT times
+c	4) shift the rows of V (EOFs) over to the left side of V
+
+	subroutine switch_a_v(a,v,w,pct,nx,nt)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+
+	real a(nx,nt), v(nx,nx)
+	real w(nx), pct(nx)
+	
+c......move the elements to the other array
+	do 10 n=1,nt	! column number (nt-n+1 or nx-n+1)
+	do 11 i=1,nx	! row number
+11	v(i,nx-n+1)=a(i,nt-n+1)
+	do 12 l=1,nt   ! row number in both (shift to same position in other array)
+12	a(nt-l+1,nt-n+1)=v(nt-l+1,nt-n+1)
+10	continue
+
+c.....shift the EOFs to the first columns of V
+c.....the first one is in column (NX-NT+1)
+	do 20 i=1,nx
+	do 21 n=1,nt
+21	v(i,n)=v(i,n+nx-nt)
+20	continue
+
+c.....clean up by zeroing out the bottom of A and right side of V
+	do 30 i=1,nx
+	do 31 n=nt+1,nx
+31	v(i,n)=0.
+30	continue
+
+	do 40 n=nt+1,nx
+	do 41 l=1,nt
+41	a(n,l)=0.
+40	continue
+
+c.......while we're here, clean up W and PCT
+	do 50 l=nt+1,nx
+	w(l)=0.
+50	pct(l)=0.
+
+	return
+	end
+c*********************************************************************
+c......output of SVDEOF has W(NT), PCT(NT) and V(NT,NT). 
+c......W and PCT are OK as is, since they are 1-d vectors, 
+c......but V is really a vector of length NT*NT, (TAFs in sequence, then zeroes),
+c......stored in an actual array V(NX,NX) (note NX > NT)
+c......Fix V here: Make first NT indices of each of the first NT columns a TAF
+c......This might leave some stray leftovers, but it should be ok (?)
+
+	subroutine fix_v(v,nt,nx)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+	
+	real v(nx*nx)		! true size of V
+	
+	do 10 i=2,nt	! leave the first NT of em alone
+	do 11 j=1,nt
+	ij=(i-1)*nt+j	! position of TAF(neof i,time j)
+	ij2=(i-1)*nx+j	! position where each column is NX long
+11	v(ij2)=v(ij)
+10	continue
+
+	return
+	end
+c*********************************************************************
+c..........."Traditional scaling"
+c...........Section add by BK. 24 Aug 1992.
+c...........Scale as my usual EOFs.
+c...........Changes made here: 
+c            1) Eigenvalues (vector W) output as W**2/M.
+c			 2) EOFs (array V) output as V*W/sqrt(J).
+c			 3) TAFs (array A) output as A*sqrt(J)
+c.................Also find percent variance.
+
+c.........23 Jun 2006: add an argument for the number of EOFs found.
+c.........Need this to deal with reversed EOFs (which have only NT < NX EOFs),
+c.........But still want to call with the same declared array sizes.
+c.........Otherwise have array overflow problems (in V).
+
+	subroutine scaling (a, n, m, w, v, pct, neof)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+	
+c	real A(n,m),W(n),V(n,n),pct(n)
+	real A(n,m),W(neof),V(n,neof),pct(neof)
+
+	rim=real(m)
+	sqm=sqrt(rim)
+
+	do 100 ix=1,n
+	do 100 ieof=1,neof
+100	v(ix,ieof)=v(ix,ieof)*w(ieof)/sqm
+
+	totvar=0.
+	do 101 ieof=1,neof
+	w(ieof)=w(ieof)**2/rim
+101	totvar=totvar+w(ieof)
+
+	do 103 ieof=1,neof
+103	pct(ieof)=w(ieof)/totvar
+
+	do 102 ieof=1,neof
+	do 102 it=1,m
+102	a(ieof,it)=a(ieof,it)*sqm
+
+	return
+	end
+
+c*********************************************************************
+c.......demean A in time. Returned demeaned.
+
+	subroutine demean (a, nx, nt)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+	
+	real a(nx,nt)
+	
+	do 150 i=1,nx
+	av=0.
+	do 151 j=1,nt
+151	av=av+a(i,j)/real(nt)
+	do 152 j=1,nt
+152	a(i,j)=a(i,j)-av
+150	continue
+
+	return
+	end
+
+c*********************************************************************
+c........modified Numerical Recipes subroutine SVDCMP
+c........subroutine now does no scaling (handles either transposition)
+c........=> demeaning must have been done previously
+
+      SUBROUTINE SVDEOF (A, M, N, W, V, pct, RV1, indx, ier)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+
+c......................................maximum number of spatial locations.
+cc      PARAMETER (NMAX=100000)		! HARDWIRED
+c......................................arrays passed from main program.
+      real A(N,M),W(N),V(N,N),pct(n)
+      dimension RV1(*), indx(*)
+      integer ier
+
+	ier = 0  ! success
+c-------------------------------------------------------------------------
+c...............Section add by BK. 24 Aug 1992.
+cc	write(6,*) ' Enter subroutine SVDEOF-3'
+c...............check maximum size.
+cc	if (n.gt.nmax) then
+cc	   write(6,*) 'N.ge.',nmax,' in routine SVDEOF. Error. Returning.'
+cc	   return
+cc	endif
+c...............check that M.ge.N.
+cc	if (m.lt.n) then
+cc	   write(6,*) 'M=',m,' .lt. N=',n,'. SVDEOF Error. Returning.'
+cc	   return
+cc	endif
+	
+c-------------------------------------------------------------------------
+      G=0.0
+      SCALE=0.0
+      ANORM=0.0
+      DO 25 I=1,N
+        L=I+1
+        RV1(I)=SCALE*G
+        G=0.0
+        S=0.0
+        SCALE=0.0
+        IF (I.LE.M) THEN
+          DO 11 K=I,M
+            SCALE=SCALE+ABS(A(i,k))
+11        CONTINUE
+          IF (SCALE.NE.0.0) THEN
+            DO 12 K=I,M
+              A(i,k)=A(i,k)/SCALE
+              S=S+A(i,k)*A(i,k)
+12          CONTINUE
+            F=A(I,I)
+            G=-SIGN(SQRT(S),F)
+            H=F*G-S
+            A(I,I)=F-G
+            IF (I.NE.N) THEN
+              DO 15 J=L,N
+                S=0.0
+                DO 13 K=I,M
+                  S=S+A(i,k)*A(j,k)
+13              CONTINUE
+                F=S/H
+                DO 14 K=I,M
+                  A(j,k)=A(j,k)+F*A(i,k)
+14              CONTINUE
+15            CONTINUE
+            ENDIF
+            DO 16 K= I,M
+              A(i,k)=SCALE*A(i,k)
+16          CONTINUE
+          ENDIF
+        ENDIF
+        W(I)=SCALE *G
+        G=0.0
+        S=0.0
+        SCALE=0.0
+        IF ((I.LE.M).AND.(I.NE.N)) THEN
+          DO 17 K=L,N
+            SCALE=SCALE+ABS(A(k,i))
+17        CONTINUE
+          IF (SCALE.NE.0.0) THEN
+            DO 18 K=L,N
+              A(k,i)=A(k,i)/SCALE
+              S=S+A(k,i)*A(k,i)
+18          CONTINUE
+            F=A(l,i)
+            G=-SIGN(SQRT(S),F)
+            H=F*G-S
+            A(l,i)=F-G
+            DO 19 K=L,N
+              RV1(K)=A(k,i)/H
+19          CONTINUE
+            IF (I.NE.M) THEN
+              DO 23 J=L,M
+                S=0.0
+                DO 21 K=L,N
+                  S=S+A(k,j)*A(k,i)
+21              CONTINUE
+                DO 22 K=L,N
+                  A(k,j)=A(k,j)+S*RV1(K)
+22              CONTINUE
+23            CONTINUE
+            ENDIF
+            DO 24 K=L,N
+              A(k,i)=SCALE*A(k,i)
+24          CONTINUE
+          ENDIF
+        ENDIF
+        ANORM=MAX(ANORM,(ABS(W(I))+ABS(RV1(I))))
+25    CONTINUE
+      DO 32 I=N,1,-1
+        IF (I.LT.N) THEN
+          IF (G.NE.0.0) THEN
+            DO 26 J=L,N
+              V(J,I)=(A(j,i)/A(l,i))/G
+26          CONTINUE
+            DO 29 J=L,N
+              S=0.0
+              DO 27 K=L,N
+                S=S+A(k,i)*V(K,J)
+27            CONTINUE
+              DO 28 K=L,N
+                V(K,J)=V(K,J)+S*V(K,I)
+28            CONTINUE
+29          CONTINUE
+          ENDIF
+          DO 31 J=L,N
+            V(I,J)=0.0
+            V(J,I)=0.0
+31        CONTINUE
+        ENDIF
+        V(I,I)=1.0
+        G=RV1(I)
+        L=I
+32    CONTINUE
+      DO 39 I=N,1,-1
+        L=I+1
+        G=W(I)
+        IF (I.LT.N) THEN
+          DO 33 J=L,N
+            A(j,i)=0.0
+33        CONTINUE
+        ENDIF
+        IF (G.NE.0.0) THEN
+          G=1.0/G
+          IF (I.NE.N) THEN
+            DO 36 J=L,N
+              S=0.0
+              DO 34 K=L,M
+                S=S+A(i,k)*A(j,k)
+34            CONTINUE
+              F=(S/A(I,I))*G
+              DO 35 K=I,M
+                A(j,k)=A(j,k)+F*A(i,k)
+35            CONTINUE
+36          CONTINUE
+          ENDIF
+          DO 37 J=I,M
+            A(i,j)=A(i,j)*G
+37        CONTINUE
+        ELSE
+          DO 38 J= I,M
+            A(i,j)=0.0
+38        CONTINUE
+        ENDIF
+        A(I,I)=A(I,I)+1.0
+39    CONTINUE
+      DO 49 K=N,1,-1
+        DO 48 ITS=1,30
+          DO 41 L=K,1,-1
+            NM=L-1
+            IF ((ABS(RV1(L))+ANORM).EQ.ANORM)  GO TO 2
+            IF ((ABS(W(NM))+ANORM).EQ.ANORM)  GO TO 1
+41        CONTINUE
+1         C=0.0
+          S=1.0
+          DO 43 I=L,K
+            F=S*RV1(I)
+            IF ((ABS(F)+ANORM).NE.ANORM) THEN
+              G=W(I)
+              H=SQRT(F*F+G*G)
+              W(I)=H
+              H=1.0/H
+              C= (G*H)
+              S=-(F*H)
+              DO 42 J=1,M
+                Y=A(nm,j)
+                Z=A(i,j)
+                A(nm,j)=(Y*C)+(Z*S)
+                A(i,j)=-(Y*S)+(Z*C)
+42            CONTINUE
+            ENDIF
+43        CONTINUE
+2         Z=W(K)
+          IF (L.EQ.K) THEN
+            IF (Z.LT.0.0) THEN
+              W(K)=-Z
+              DO 44 J=1,N
+                V(J,K)=-V(J,K)
+44            CONTINUE
+            ENDIF
+            GO TO 3
+          ENDIF
+          IF (ITS.EQ.60) then
+	        ier = -1
+cc		write(6,*) 'SVDEOF. No convergence in 60 iterations.'
+cc		write(6,*) 'Returning with no EOFs found......'
+		return
+	  endif
+          X=W(L)
+          NM=K-1
+          Y=W(NM)
+          G=RV1(NM)
+          H=RV1(K)
+          F=((Y-Z)*(Y+Z)+(G-H)*(G+H))/(2.0*H*Y)
+          G=SQRT(F*F+1.0)
+          F=((X-Z)*(X+Z)+H*((Y/(F+SIGN(G,F)))-H))/X
+          C=1.0
+          S=1.0
+          DO 47 J=L,NM
+            I=J+1
+            G=RV1(I)
+            Y=W(I)
+            H=S*G
+            G=C*G
+            Z=SQRT(F*F+H*H)
+            RV1(J)=Z
+            C=F/Z
+            S=H/Z
+            F= (X*C)+(G*S)
+            G=-(X*S)+(G*C)
+            H=Y*S
+            Y=Y*C
+            DO 45 NM=1,N
+              X=V(NM,J)
+              Z=V(NM,I)
+              V(NM,J)= (X*C)+(Z*S)
+              V(NM,I)=-(X*S)+(Z*C)
+45          CONTINUE
+            Z=SQRT(F*F+H*H)
+            W(J)=Z
+            IF (Z.NE.0.0) THEN
+              Z=1.0/Z
+              C=F*Z
+              S=H*Z
+            ENDIF
+            F= (C*G)+(S*Y)
+            X=-(S*G)+(C*Y)
+            DO 46 NM=1,M
+              Y=A(j,nm)
+              Z=A(i,nm)
+              A(j,nm)= (Y*C)+(Z*S)
+              A(i,nm)=-(Y*S)+(Z*C)
+46          CONTINUE
+47        CONTINUE
+          RV1(L)=0.0
+          RV1(K)=F
+          W(K)=X
+48      CONTINUE
+3       CONTINUE
+49    CONTINUE
+c-----------------------------------------------------------------------
+c....now do scaling in sub SCALING (allows SVDEOF to handle either transposition)
+c-----------------------------------------------------------------------
+c...............make sure that eigenvalues are arranged in size order.
+c...............if not, rearrange. Check first, may not need it.
+	do 200 ieof=2,n
+200	if (w(ieof).gt.w(ieof-1)) go to 201
+	go to 299
+
+c...............Since both the v's and a's must be rearranged, use
+c...............the NR subroutine indexx to make a rank table, then
+c...............rearrange in this program by hand.
+201     continue
+cc201	9(6,*) ' SVDEOF calling sub INDEXX to sort eigenvalues.'
+	call indexx (n,w,indx)
+
+c...............Now rearrange using index table INDX. Use RV1 as dummy.
+c...............Note that table is in ASCENDING order 
+c...............(W(INDX(1)) is smallest, W(INDX(N)) is largest).
+	do 220 ieof=1,n
+220	rv1(ieof)=w(ieof)
+	do 221 ieof=1,n
+221	w(ieof)=rv1(indx(n-ieof+1))
+
+	do 222 ieof=1,n
+222	rv1(ieof)=pct(ieof)
+	do 223 ieof=1,n
+223	pct(ieof)=rv1(indx(n-ieof+1))
+
+c.............for V and A (2-D arrays), must rearrange each row/col separately.
+	do 230 ix=1,n
+	do 231 ieof=1,n
+231	rv1(ieof)=v(ix,ieof)
+	do 232 ieof=1,n
+232	v(ix,ieof)=rv1(indx(n-ieof+1))
+230	continue
+
+	do 240 it=1,m
+	do 241 ieof=1,n
+241	rv1(ieof)=a(ieof,it)
+	do 242 ieof=1,n
+242	a(ieof,it)=rv1(indx(n-ieof+1))
+240	continue
+c-----------------------------------------------------------------------
+299   continue
+cc	write(6,*) ' Finished subroutine SVDEOF'
+      RETURN
+      END
+
+c***********************************************************************
+
+c...............another NR subroutine.
+c...............Makes an index table INDX(N), such that ARRIN(INDX(J))
+c					is in ascending order for J=1,2,...,N. 
+c...............The inputs N and ARRIN are not changed.
+c...............Method is heapsort.
+
+      SUBROUTINE INDEXX(N,ARRIN,INDX)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+
+      DIMENSION ARRIN(N),INDX(N)
+
+      DO 11 J=1,N
+        INDX(J)=J
+11    CONTINUE
+      L=N/2+1
+      IR=N
+10    CONTINUE
+        IF(L.GT.1)THEN
+          L=L-1
+          INDXT=INDX(L)
+          Q=ARRIN(INDXT)
+        ELSE
+          INDXT=INDX(IR)
+          Q=ARRIN(INDXT)
+          INDX(IR)=INDX(1)
+          IR=IR-1
+          IF(IR.EQ.1)THEN
+            INDX(1)=INDXT
+            RETURN
+          ENDIF
+        ENDIF
+        I=L
+        J=L+L
+20      IF(J.LE.IR)THEN
+          IF(J.LT.IR)THEN
+            IF(ARRIN(INDX(J)).LT.ARRIN(INDX(J+1)))J=J+1
+          ENDIF
+          IF(Q.LT.ARRIN(INDX(J)))THEN
+            INDX(I)=INDX(J)
+            I=J
+            J=J+J
+          ELSE
+            J=IR+1
+          ENDIF
+        GO TO 20
+        ENDIF
+        INDX(I)=INDXT
+      GO TO 10
+      END
+
+c***********************************************************************
+
+c...............subroutine to transpose matrices
+c...............from http://www.netlib.org/toms/513
+
+      SUBROUTINE MATRIXTRANS(A, M, N, MN, MOVE, IWRK, IOK)
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+C *****
+C  ALGORITHM 380 - REVISED
+C *****
+C  A IS A ONE-DIMENSIONAL ARRAY OF LENGTH MN=M*N, WHICH
+C  CONTAINS THE MXN MATRIX TO BE TRANSPOSED (STORED
+C  COLUMWISE). MOVE IS A ONE-DIMENSIONAL ARRAY OF LENGTH IWRK
+C  USED TO STORE INFORMATION TO SPEED UP THE PROCESS.  THE
+C  VALUE IWRK=(M+N)/2 IS RECOMMENDED. IOK INDICATES THE
+C  SUCCESS OR FAILURE OF THE ROUTINE.
+C  NORMAL RETURN  IOK=0
+C  ERRORS         IOK=-1 ,MN NOT EQUAL TO M*N
+C                 IOK=-2 ,IWRK NEGATIVE OR ZERO
+C                 IOK.GT.0, (SHOULD NEVER OCCUR),IN THIS CASE
+C  WE SET IOK EQUAL TO THE FINAL VALUE OF I WHEN THE SEARCH
+C  IS COMPLETED BUT SOME LOOPS HAVE NOT BEEN MOVED
+C  NOTE * MOVE(I) WILL STAY ZERO FOR FIXED POINTS
+      DIMENSION A(MN), MOVE(*)
+C CHECK ARGUMENTS AND INITIALIZE.
+      IF (M.LT.2 .OR. N.LT.2) GO TO 120
+      IF (MN.NE.M*N) GO TO 180
+      IF (IWRK.LT.1) GO TO 190
+      IF (M.EQ.N) GO TO 130
+      NCOUNT = 2
+      K = MN - 1
+      DO 10 I=1,IWRK
+        MOVE(I) = 0
+   10 CONTINUE
+      IF (M.LT.3 .OR. N.LT.3) GO TO 30
+C CALCULATE THE NUMBER OF FIXED POINTS, EUCLIDS ALGORITHM
+C FOR GCD(M-1,N-1).
+      IR2 = M - 1
+      IR1 = N - 1
+   20 IR0 = MOD(IR2,IR1)
+      IR2 = IR1
+      IR1 = IR0
+      IF (IR0.NE.0) GO TO 20
+      NCOUNT = NCOUNT + IR2 - 1
+C SET INITIAL VALUES FOR SEARCH
+   30 I = 1
+      IM = M
+C AT LEAST ONE LOOP MUST BE RE-ARRANGED
+      GO TO 80
+C SEARCH FOR LOOPS TO REARRANGE
+   40 MAX = K - I
+      I = I + 1
+      IF (I.GT.MAX) GO TO 160
+      IM = IM + M
+      IF (IM.GT.K) IM = IM - K
+      I2 = IM
+      IF (I.EQ.I2) GO TO 40
+      IF (I.GT.IWRK) GO TO 60
+      IF (MOVE(I).EQ.0) GO TO 80
+      GO TO 40
+   50 I2 = M*I1 - K*(I1/N)
+   60 IF (I2.LE.I .OR. I2.GE.MAX) GO TO 70
+      I1 = I2
+      GO TO 50
+   70 IF (I2.NE.I) GO TO 40
+C REARRANGE THE ELEMENTS OF A LOOP AND ITS COMPANION LOOP
+   80 I1 = I
+      KMI = K - I
+      B = A(I1+1)
+      I1C = KMI
+      C = A(I1C+1)
+   90 I2 = M*I1 - K*(I1/N)
+      I2C = K - I2
+      IF (I1.LE.IWRK) MOVE(I1) = 2
+      IF (I1C.LE.IWRK) MOVE(I1C) = 2
+      NCOUNT = NCOUNT + 2
+      IF (I2.EQ.I) GO TO 110
+      IF (I2.EQ.KMI) GO TO 100
+      A(I1+1) = A(I2+1)
+      A(I1C+1) = A(I2C+1)
+      I1 = I2
+      I1C = I2C
+      GO TO 90
+C FINAL STORE AND TEST FOR FINISHED
+  100 D = B
+      B = C
+      C = D
+  110 A(I1+1) = B
+      A(I1C+1) = C
+      IF (NCOUNT.LT.MN) GO TO 40
+C NORMAL RETURN
+  120 IOK = 0
+      RETURN
+C IF MATRIX IS SQUARE,EXCHANGE ELEMENTS A(I,J) AND A(J,I).
+  130 N1 = N - 1
+      DO 150 I=1,N1
+        J1 = I + 1
+        DO 140 J=J1,N
+          I1 = I + (J-1)*N
+          I2 = J + (I-1)*M
+          B = A(I1)
+          A(I1) = A(I2)
+          A(I2) = B
+  140   CONTINUE
+  150 CONTINUE
+      GO TO 120
+C ERROR RETURNS.
+  160 IOK = I
+  170 RETURN
+  180 IOK = -1
+      GO TO 170
+  190 IOK = -2
+      GO TO 170
+      END
diff --git a/fer/efi/tauto_cor.F b/fer/efi/tauto_cor.F
new file mode 100644
index 0000000..d5a1a99
--- /dev/null
+++ b/fer/efi/tauto_cor.F
@@ -0,0 +1,398 @@
+*
+* tauto_cor.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 1999
+*  Update to use abstract axis 1-feb-2000
+*  acm 11/2001 bug fix: check both arg_1(...l1+lm) and arg_1(...l1) for bad flag
+*
+* This function computes the autocorrelation for a x series.  
+*  Autocorelation formula computed directly for lags of 0, 1, ..., N-1
+*  Return on an abstract T axis.
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE tauto_cor_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Compute autocorrelation of series, lags of 0, ..., N-1')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'T-series variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE tauto_cor_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER lo_ss, hi_ss
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+C  Autocorrelation returns correlations for lags of 0 to N-1.
+      lo_ss = 1
+      hi_ss = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, T_AXIS, lo_ss, hi_ss)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tauto_cor_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER npts, irr
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      npts = 1 + arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1)
+
+* partial means  pmean
+      irr = 1
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+* partial variances  pvar
+      irr = 2
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+* box sizes BOX
+      irr = 3
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tauto_cor_compute(id, arg_1, result,
+     .                             pmean, pvar, box)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL pmean(wrk1lox:wrk1hix)
+      REAL pvar (wrk2lox:wrk2hix)
+      REAL box  (wrk3lox:wrk3hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL psum, diff, diff2
+      REAL dsum, bsize
+      INTEGER lr, lm, ls
+      INTEGER nd, arg
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 1
+      CALL ef_get_box_size(id, arg, T_AXIS, arg_lo_ss(T_AXIS,arg), 
+     .                     arg_hi_ss(T_AXIS,arg), box)
+
+      nd = arg_hi_ss(T_AXIS,arg) - arg_lo_ss(T_AXIS,arg) + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*
+* Calculate the autocorrelation 
+*  First step is to compute the partial means [1/(n-i)]* sum[m=1,n-i]dat(m+i)
+
+               DO 420 l = 1, nd
+                  psum = 0.
+                  dsum = 0.
+                  lm = l-1
+                  l1 = arg_lo_ss(T_AXIS,ARG1)
+                  DO 410 ls = 1, nd-lm 
+                     IF ( arg_1(i1,j1,k1,l1+lm,m1,n1)
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = box(ls+lm)
+                        psum = psum + bsize*arg_1(i1,j1,k1,l1+lm,m1,n1)
+                        dsum = dsum + bsize
+                     ENDIF
+                     l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 410              CONTINUE
+                  IF ( dsum .GT. 0. ) pmean(l) = psum / dsum
+ 420           CONTINUE
+
+*  Compute the partial variances RMS[dat(m+l) - pmean(l)]
+*  Don't divide by dsum; the denominators cancel when the autocorrelation
+*  is computed below.
+
+               DO 460 l = 1, nd
+                  psum = 0.
+                  dsum = 0.
+                  lm = l-1
+                  l1 = arg_lo_ss(T_AXIS,ARG1)
+                  DO 450 ls = 1, nd-lm 
+                     IF ( arg_1(i1,j1,k1,l1+lm,m1,n1)
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = box(ls+lm)
+                        diff = arg_1(i1,j1,k1,l1+lm,m1,n1) - pmean(l)
+                        psum = psum + bsize * diff * diff
+                        dsum = dsum + bsize
+                     ENDIF
+                     l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 450              CONTINUE
+                  IF ( dsum .GT. 0. ) THEN
+                     pvar(l) = sqrt(psum)
+                  ELSE
+                     pvar(l) = 0.
+                  ENDIF
+ 460           CONTINUE
+
+*  Compute the autocorrelation for lag l=0,1,2,...,ND-1
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               lr = res_lo_ss(T_AXIS)
+               DO 480 l = 1, nd
+
+                  psum = 0.
+                  dsum = 0.
+                  lm = l-1
+                  l1 = arg_lo_ss(T_AXIS,ARG1)
+                  DO 470 ls = 1, nd-lm 
+                     IF ( arg_1(i1,j1,k1,l1+lm,m1,n1)
+     .                    .NE. bad_flag(ARG1) .AND.
+     .                    arg_1(i1,j1,k1,l1,   m1,n1)
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = (box(ls+lm) + box(ls)) / 2.
+                        diff  = arg_1(i1,j1,k1,l1+lm,m1,n1) - pmean(l)
+                        diff2 = arg_1(i1,j1,k1,l1,   m1,n1) - pmean(1) ! one, not ell
+                        psum = psum + bsize * diff * diff2
+                        dsum = dsum + box(ls+lm) * box(ls)
+                     ENDIF
+                     l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 470              CONTINUE
+
+                  IF ( pvar(1) .NE. 0.   .AND.  
+     .                 pvar(l) .NE. 0.   .AND. 
+     .                 psum    .NE. 0. ) THEN
+                     result(i,j,k,lr,m,n) = psum / (pvar(1) * pvar(l))
+                  ELSE
+                     result(i,j,k,lr,m,n) = bad_flag_result
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+                  lr = lr + res_incr(T_AXIS)
+ 480           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/tax_datestring.F b/fer/efi/tax_datestring.F
new file mode 100644
index 0000000..60700b1
--- /dev/null
+++ b/fer/efi/tax_datestring.F
@@ -0,0 +1,359 @@
+*
+* tax_datestring.F
+*
+* Jing Y. Li 
+* May 2006
+* 18-may-2006 ACM change to compare only the first 3 characters of the precision string.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* Returns string of dates 
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, tax_datestring )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+
+
+      SUBROUTINE tax_datestring_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns date string for time axis coordinate values' )
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*     Set data type as string
+      arg = 3
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_name(id, arg, 'C')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'output precision')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_datestring_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_datestring_compute(id, arg_1, arg_2, arg_3, 
+     .                                  result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(strdf, mem3lox:mem3hix, mem3loy:mem3hiy,
+     .                  mem3loz:mem3hiz, mem3lot:mem3hit,
+     .                  mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy, 
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i3, j3, k3, l3, m3, n3
+      INTEGER slen
+      CHARACTER*20 datestring
+      CHARACTER*3 precistring
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+*     Get the precision for output (string)
+      i3 = arg_lo_ss(X_AXIS, ARG3)
+      j3 = arg_lo_ss(Y_AXIS, ARG3)
+      k3 = arg_lo_ss(Z_AXIS, ARG3)
+      l3 = arg_lo_ss(T_AXIS, ARG3)
+      m3 = arg_lo_ss(E_AXIS, ARG3)
+      n3 = arg_lo_ss(F_AXIS, ARG3)
+      CALL ef_get_string_arg_element_6d(id, ARG3, arg_3,
+     .                       i3, j3, k3, l3, m3, n3, slen, precistring)
+      CALL LOWER_CASE(precistring)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1) 
+                  ddate = ddate  
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate,
+     .                                      1, datestring)
+
+*     Assign the appropriate substring to the result.
+                     IF ( .NOT. tmodulo ) THEN
+                        IF ( precistring .EQ. 'sec' ) THEN
+                           slen = 20
+                           CALL EF_PUT_STRING(datestring, slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'min' ) THEN
+                           slen = 17
+                           CALL EF_PUT_STRING(datestring(1:17), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'hou' ) THEN
+                           slen = 14
+                           CALL EF_PUT_STRING(datestring(1:14), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'day' ) THEN
+                           slen = 11
+                           CALL EF_PUT_STRING(datestring(1:11), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'mon' ) THEN
+                           slen = 8
+                           CALL EF_PUT_STRING(datestring(4:11), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'yea' ) THEN
+                           slen = 4
+                           CALL EF_PUT_STRING(datestring(8:11), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE
+                           slen = 20
+                           CALL EF_PUT_STRING (datestring, slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ENDIF
+
+                     ELSE  ! modulo time axis.  Datestring looks like 15-FEB 02:54:36
+
+                        IF ( precistring .EQ. 'sec' ) THEN
+                           slen = 15
+                           CALL EF_PUT_STRING(datestring(1:15), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'min' ) THEN
+                           slen = 12
+                           CALL EF_PUT_STRING(datestring(1:12), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'hou' ) THEN
+                           slen = 9
+                           CALL EF_PUT_STRING(datestring(1:9), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'day' ) THEN
+                           slen = 6
+                           CALL EF_PUT_STRING(datestring(1:6), slen, 
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'mon' ) THEN
+                           slen = 3
+                           CALL EF_PUT_STRING(datestring(4:6), slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE IF ( precistring .EQ. 'yea' ) THEN
+                           datestring = '...'
+                           slen = 3
+                           CALL EF_PUT_STRING(datestring, slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ELSE
+                           slen = 15
+                           CALL EF_PUT_STRING(datestring, slen,
+     .                                        result(1,i,j,k,l,m,n))
+                        ENDIF
+
+                     ENDIF  ! Modulo time
+
+                  ELSE  ! ddate .NE. bad_flag(ARG1)
+
+                     datestring = '...'
+                     slen = 3
+                     CALL EF_PUT_STRING(datestring, slen,
+     .                                  result(1,i,j,k,l,m,n))
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      END
diff --git a/fer/efi/tax_day.F b/fer/efi/tax_day.F
new file mode 100644
index 0000000..a727fc5
--- /dev/null
+++ b/fer/efi/tax_day.F
@@ -0,0 +1,287 @@
+*
+* tax_day.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns day specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_day_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns days of month of time axis coordinate values' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_day_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_day_compute(id, arg_1, arg_2, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i,j,k,l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+                  
+                     IF ( .NOT. tmodulo ) THEN
+*                       datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                        READ (datebuf,420,err=900) day_of_mon, cmon, iyear
+  420                   FORMAT (i2, 1x, a3, 1x, i4) 
+                     ELSE
+*                       modulo: datebuf is in form "DD-MON HH:MM:SS". Read date.
+                        READ (datebuf,430,err=900) day_of_mon, cmon
+  430                   FORMAT (i2, 1x, a3) 
+                     ENDIF
+                     result(i,j,k,l,m,n) = day_of_mon 
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 900  WRITE (err_msg,*) 
+     .  'Error assigning dates/times to timestamp for tax_day ',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_dayfrac.F b/fer/efi/tax_dayfrac.F
new file mode 100644
index 0000000..30edfa1
--- /dev/null
+++ b/fer/efi/tax_dayfrac.F
@@ -0,0 +1,289 @@
+*
+* tax_dayfrac.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns day fraction ([0,1]) specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_dayfrac_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .       'Returns fraction of day of time axis coordinate values' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_dayfrac_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_dayfrac_compute(id, arg_1, arg_2, result, taxdat) 
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      INTEGER ihour, iminute, isec
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+              first = .TRUE.
+
+              l1 = arg_lo_ss(T_AXIS,ARG1)
+              DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+
+                     IF ( .NOT. tmodulo ) THEN
+*                       datebuf is in form "DD-MON-YEAR HH:MM:SS". Read time.
+                        READ (datebuf,420,err=900) ihour, iminute, isec
+ 420                    FORMAT (11x, 3(1x,i2))
+                     ELSE 
+*                       modulo: datebuf is in form "DD-MON HH:MM:SS". Read time.
+                        READ (datebuf,430,err=900) ihour, iminute, isec
+ 430                    FORMAT (6x, 3(1x,i2))
+                     ENDIF
+                     result(i,j,k,l,m,n) = ( (isec / 60. + iminute) / 60.
+     .                                        + ihour ) / 24.
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_dayfrac',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+ 
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_jday.F b/fer/efi/tax_jday.F
new file mode 100644
index 0000000..34e808c
--- /dev/null
+++ b/fer/efi/tax_jday.F
@@ -0,0 +1,291 @@
+*
+* tax_jday.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns day of current year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_jday_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns days of year of time axis coordinate values')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_jday_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_jday_compute(id, arg_1, arg_2, result, taxdat) 
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon, day_of_year, days_this_year
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+                  
+                     IF ( .NOT. tmodulo ) THEN
+*                       datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                        READ (datebuf,420,err=900) day_of_mon, cmon, iyear
+ 420                    FORMAT (i2, 1x, a3, 1x, i4) 
+                     ELSE
+*                       modulo: Datebuf is in form "DD-MON HH:MM:SS". Read date.
+                        READ (datebuf,430,err=900) day_of_mon, cmon
+ 430                    FORMAT (i2, 1x, a3) 
+                        iyear = 1901  ! nominally non-leap year 
+                     ENDIF
+
+                     CALL JULIAN_DAY_OF_YEAR(cmon, day_of_mon, iyear,
+     .                                  day_of_year, days_this_year)
+                     result(i,j,k,l,m,n) = day_of_year 
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_jday',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_jday1900.F b/fer/efi/tax_jday1900.F
new file mode 100644
index 0000000..cadf019
--- /dev/null
+++ b/fer/efi/tax_jday1900.F
@@ -0,0 +1,287 @@
+*
+* tax_jday1900.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns day of current year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+*
+* 2006-05-12 add code to handle years before 1900
+
+      SUBROUTINE tax_jday1900_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns days since 1900 of time axis coordinate values')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_jday1900_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_jday1900_compute(id, arg_1, arg_2, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon, day_since_1900
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF ( modulo(T_AXIS) ) THEN
+         WRITE (err_msg, *) 'Function not valid for modulo time axis'
+         GO TO 999
+      ENDIF
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+
+*                    datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                     READ (datebuf, 420, err=900)  day_of_mon, cmon, iyear
+ 420                 FORMAT (i2, 1x, a3, 1x, i4) 
+
+                     CALL JULIAN_DAY_OF_YEAR1900(cmon, day_of_mon, iyear, 
+     .                                           day_since_1900)
+                     result(i,j,k,l,m,n) = day_since_1900 
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_jday1900',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_month.F b/fer/efi/tax_month.F
new file mode 100644
index 0000000..f3ae201
--- /dev/null
+++ b/fer/efi/tax_month.F
@@ -0,0 +1,302 @@
+*
+* taxmonth.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns month specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_month_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns months of time axis coordinate values')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_month_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_month_compute(id, arg_1, arg_2, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, imon, day_of_mon, mm
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+      CHARACTER*3 months(12)
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+                  
+                     IF ( .NOT. tmodulo ) THEN
+*                       datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                        READ (datebuf,420,err=900) day_of_mon, cmon, iyear
+ 420                    FORMAT (i2, 1x, a3, 1x, i4) 
+                     ELSE
+*                       modulo: Datebuf is in form "DD-MON HH:MM:SS". Read date.
+                        READ (datebuf,430,err=900) day_of_mon, cmon
+ 430                    FORMAT (i2, 1x, a3) 
+                     ENDIF
+
+                     DO 440 imon = 1, 12
+                        IF ( cmon .EQ. months(imon) ) THEN
+                           result(i,j,k,l,m,n) = imon 
+                           GOTO 450
+                        ENDIF
+ 440                 CONTINUE  
+
+*                    month not matched
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+ 450                 CONTINUE  
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_month',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_subs.F b/fer/efi/tax_subs.F
new file mode 100644
index 0000000..cd6871c
--- /dev/null
+++ b/fer/efi/tax_subs.F
@@ -0,0 +1,264 @@
+* 
+*  Subroutines for TAX_* functions
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without anx fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and anx derivative works thereof, and
+*  its supporting documentation for anx purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in anx publications that result from
+*  the use of this software or in anx product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in anx advertising or publicity to endorse or promote anx products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with anx support, consulting,
+*  training or assistance of anx kind with regard to the use, operation
+*  and performance of this software nor to provide the user with anx
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND Anx EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR Anx SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR Anx DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+****************************************************************
+*
+* V6.2 ACM 2/12/2008  Fix bug 1629 in JULIAN_DAY_OF_YEAR. Always
+*          set ndaymo(2) to either 28 or 29. It does not get reset
+*          by the DATA statement on re-entry to the routine.
+
+      SUBROUTINE LOWER_CASE(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Converts a string to lowercase.
+*
+      EXTERNAL LENGTH_OF_TEXT
+      INTEGER  LENGTH_OF_TEXT
+      CHARACTER*1 LETTER
+      INTEGER ISHIFT,I
+      ISHIFT=ICHAR('a')-ICHAR('A')
+      DO 10 I=1,LENGTH_OF_TEXT(TEXT)
+        LETTER=TEXT(I:I)
+        IF('A'.LE.LETTER.AND.LETTER.LE.'Z') THEN
+          TEXT(I:I)=CHAR(ICHAR(LETTER)+ISHIFT)
+        END IF
+   10 CONTINUE
+      RETURN
+      END
+
+***************************************************************
+*
+      INTEGER FUNCTION LENGTH_OF_TEXT(TEXT)
+      CHARACTER*(*) TEXT
+*
+*     Computes the length of a string without trailing blanks.
+*
+      INTEGER I
+
+      DO 1 I=LEN(TEXT),1,-1
+        IF(TEXT(I:I).NE.' ') THEN
+          GO TO 2
+        END IF
+    1 CONTINUE
+      I=1
+    2 CONTINUE
+      LENGTH_OF_TEXT=I
+
+      RETURN
+      END
+
+
+************************************************************************      
+*     This subroutine returns day number of current year and the total 
+*     number of days of current year.
+      SUBROUTINE JULIAN_DAY_OF_YEAR(cmon, day_of_mon, iyear, day_of_year, 
+     .           days_this_year)
+
+*     Convert day of month to day of year
+
+      INTEGER i, iyear
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, ndaymo(12)
+      INTEGER days_this_year
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      imon = 0
+      DO 100 i=1,12
+          IF(cmon .EQ. months(i)) imon = i 
+ 100  CONTINUE
+
+*     Check if it is a leap year
+* (Fixing bug 1639, need ELSE ndaymo(2) = 28; the data statement 
+* above does NOT reset the value to 28 next time we enter this routine!!  
+
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0)) 
+     .     .OR.
+     .     (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE 
+          ndaymo(2) = 28
+      END IF
+
+*     Compute day number within current year
+      day_of_year = day_of_mon
+      DO 200 i =1, imon -1
+          day_of_year = day_of_year + ndaymo(i) 
+ 200  CONTINUE
+
+*     Compute total days of current year
+      days_this_year = 0
+      DO 300 i =1, 12 
+          days_this_year = days_this_year + ndaymo(i)
+ 300  CONTINUE
+
+      RETURN
+      END
+
+* **********************************************************************
+
+*     Convert day of month to day since 1900
+*     Returns -1 if the year is before 1900
+
+      SUBROUTINE JULIAN_DAY_OF_YEAR1900(cmon, day_of_mon, iyear,
+     .   day_since_1900)
+
+      INTEGER i, j, iyear
+      INTEGER yrstart,yrend
+      LOGICAL isafter1900
+      CHARACTER*3 cmon
+      CHARACTER*3 months(12)
+      INTEGER day_of_mon, day_of_year, imon, day_since_1900, ndaymo(12)
+
+      DATA months/'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL',
+     .            'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      imon = 0
+      DO 100 i=1,12
+          IF(cmon .EQ. months(i)) imon = i 
+ 100  CONTINUE
+
+      yrstart = 1900
+      yrend = iyear-1
+      isafter1900 = .TRUE. 
+      day_since_1900 = -1
+
+      IF(iyear .LT. 1900) THEN
+          yrstart = iyear+1
+          yrend = 1899
+          isafter1900 = .FALSE.          
+          day_since_1900 = 0
+      ENDIF
+
+*     Total days between yrstart and yrend
+      DO 200 i = yrstart, yrend
+
+*     Check if it is a leap year
+          IF ( ((mod(i,4) .EQ. 0) .AND. (mod(i,100) .NE. 0))
+     .     .OR.
+     .     (mod(i, 400) .EQ. 0)) THEN
+              ndaymo(2) = 29
+          ELSE
+              ndaymo(2) = 28
+          ENDIF
+ 
+          day_since_1900 = day_since_1900 + 
+     .                    (ndaymo(2) + 7*31 + 4*30)
+
+ 200  CONTINUE
+
+*     Add days of current year
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0))
+     .     .OR.
+     .     (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+      IF(isafter1900) THEN
+*     Year after 1900
+          day_of_year = day_of_mon
+          DO 300 j =1, imon -1
+              day_of_year = day_of_year + ndaymo(j)
+ 300      CONTINUE
+       
+          day_since_1900 = day_since_1900 + day_of_year
+      ELSE
+*     Year before 1900
+          day_of_year = day_of_mon
+          DO 400 j =1, imon -1
+              day_of_year = day_of_year + ndaymo(j)
+ 400      CONTINUE
+
+          day_since_1900 = -1*(day_since_1900 + 
+     .                     ndaymo(2) + 7*31 + 4*30- day_of_year+1)
+
+      ENDIF
+
+      RETURN
+      END
+*                                                                      ^
+*                                                                      |
+*                                                                      |
+* **********************************************************************
+
+
+      SUBROUTINE tax_format_message (L1, err_msg)
+C   Create a message saying arg1 values at index are duplicate
+
+      INTEGER L1
+      CHARACTER*(*) err_msg
+      
+      REAL v1, v2
+      INTEGER n1, n2
+      CHARACTER TM_FMT*15, buff1*15, buff2*15
+
+      v1 = L1-1
+      v2 = L1
+      buff1 = TM_FMT(v1, 10,12, n1) 
+      buff2 = TM_FMT(v2, 10, 10, n2) 
+      
+      IF (n1 .GE. 14 .OR. n2 .GE. 14) THEN
+         WRITE (err_msg, 1014) L1-1, L1
+      ELSEIF (n1 .GE. 12 .OR. n2 .GE. 12) THEN
+         WRITE (err_msg, 1012) L1-1, L1
+      ELSEIF (n1 .GE. 10 .OR. n2 .GE. 10) THEN
+         WRITE (err_msg, 1010) L1-1, L1
+      ELSEIF (n1 .GE. 8 .OR. n2 .GE. 8) THEN
+         WRITE (err_msg, 1008) L1-1, L1
+      ELSE
+         WRITE (err_msg, 1000) buff1(1:n1), buff2(1:n1)
+      ENDIF
+
+1000  FORMAT ('Duplicate times in ARG1, may arise from double- to single- ',
+     .          'precision conversion. At indices ', A, ',', A)
+1014  FORMAT ('Duplicate times in ARG1, may arise from double- to single- ',
+     .          'precision conversion. At indices ', 2i16)
+1012  FORMAT ('Duplicate times in ARG1, may arise from double- to single- ',
+     .          'precision conversion. At indices ', 2i14)
+1010  FORMAT ('Duplicate times in ARG1, may arise from double- to single- ',
+     .          'precision conversion. At indices ', 2i12)
+1008  FORMAT ('Duplicate times in ARG1, may arise from double- to single- ',
+     .          'precision conversion. At indices ', 2i10)
+
+      RETURN
+      END
diff --git a/fer/efi/tax_times.F b/fer/efi/tax_times.F
new file mode 100644
index 0000000..84f2bdf
--- /dev/null
+++ b/fer/efi/tax_times.F
@@ -0,0 +1,190 @@
+*
+* tax_times.F
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* axis_reduction     Are the result axes 'reduced' with respect to the 
+*                    argument axes from which they are inherited?
+*                       ( RETAINED, REDUCED ) 
+*                       RETAINED        - result axis has same extent as argument axis
+*                       REDUCED         - result axis is reduced to a point
+*                >>> The axis_reduction defaults to RETAINED and only needs
+*                >>> to be applied when the result is reduced to a point but
+*                >>> SET REGION information should still be applied to the
+*                >>> external function arguments. (e.g. a function returning a status flag)
+*                >>> In such a case the result axes should be IMPLIED_BY_ARGS
+*                >>> and REDUCED.  (as opposed to NORMAL and RETAINED)
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_times_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'returns percent good (x,y,z) data at each (t,e,f) step')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_axis_reduction_6d(id, REDUCED,  REDUCED,  REDUCED,
+     .                                  RETAINED, RETAINED, RETAINED)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'data to be checked')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_times_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER good, total
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+*
+* Note that we are looping on the argument subscripts rather than
+* the result subscripts. (Looping on result subscripts is the normal 
+* way).  That is because the result has axes which are normal and the
+* loop count on those normal axes will be one.
+*
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+ 
+      m = res_lo_ss(T_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+ 
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+ 
+         good = 0
+         total = 0
+
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+ 
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+               good = good + 1
+            ENDIF
+            total = total + 1
+ 
+ 100     CONTINUE
+ 200     CONTINUE
+ 300     CONTINUE
+ 
+         i = res_lo_ss(X_AXIS)
+         j = res_lo_ss(Y_AXIS)
+         k = res_lo_ss(Z_AXIS)
+         IF ( total .GT. 0. ) THEN
+            result(i,j,k,l,m,n) = (good * 100.0) / total
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/tax_tstep.F b/fer/efi/tax_tstep.F
new file mode 100644
index 0000000..bbfe18a
--- /dev/null
+++ b/fer/efi/tax_tstep.F
@@ -0,0 +1,662 @@
+*
+* tax_tsetp.F
+*
+* Jing Y. Li 
+* May 31 2006
+* Finished March 24, 2009, ACM
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns time step values
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE tax_tstep_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns time step values based on the new time origin')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type(id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'desired time origin')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_tstep_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mth, mtl
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the axes for REAL*8 work array.
+      mtl = arg_lo_ss(T_AXIS,ARG1)
+      mth = mtl + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1)
+
+*  taxdat
+      CALL ef_set_work_array_dims_6d(id, 1,
+     .                              mtl, 1, 1, 1, 1, 1,
+     .                              mth, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_tstep_compute(id, arg_1, arg_2, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER STR_SAME
+      CHARACTER*20 datebuf
+      CHARACTER*20 instring, t0string
+      INTEGER slen
+      REAL*8 ddate
+      CHARACTER*16 axname(6), axunits(6)
+      LOGICAL bkw1(6), mod1(6), reg1(6)
+      CHARACTER*16 tunit
+      REAL timesincet0
+      INTEGER i, j, k, l, m, n
+      INTEGER l1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG1, T_AXIS,
+     .        arg_lo_ss(T_AXIS, ARG1), arg_hi_ss(T_AXIS, ARG1), taxdat)
+
+*     Get the new time origin (t0) string
+      i = arg_lo_ss(X_AXIS, ARG2)
+      j = arg_lo_ss(Y_AXIS, ARG2)
+      k = arg_lo_ss(Z_AXIS, ARG2)
+      l = arg_lo_ss(T_AXIS, ARG2)
+      m = arg_lo_ss(E_AXIS, ARG2)
+      n = arg_lo_ss(F_AXIS, ARG2)
+      CALL ef_get_string_arg_element_6d(id, ARG2, arg_2,
+     .                       i, j, k, l, m, n, slen, instring)
+
+* Allow them to input the date w/o a leading 0 so that either
+* 1-jan-2000 or 01-jan-0000 is ok
+
+      IF ( STR_SAME(instring(2:2), '-') .EQ. 0 ) THEN
+         WRITE (t0string, 20) instring
+  20     FORMAT ('0', a19)
+      ELSE
+         t0string = instring
+      ENDIF
+
+*     Get time axis unit
+      CALL ef_get_axis_info_6d(id, ARG1, axname, axunits,
+     .                         bkw1, mod1, reg1)
+      tunit = axunits(T_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+*        Get the time axis value for this step
+         ddate = taxdat(l1)
+*        Get the date string corresponding to time ddate
+         CALL ef_get_axis_dates(id, ARG1, ddate, 1, datebuf)
+*        Convert to time from the new origin
+         CALL time_since_t0(t0string, datebuf, tunit, timesincet0)
+
+*        Assign this time from the new origin to the results
+         DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+         DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+         DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+            result(i,j,k,l,m,n) = timesincet0
+
+ 100     CONTINUE
+ 200     CONTINUE
+ 300     CONTINUE
+ 500     CONTINUE
+ 600     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*********************************************************************
+*
+*     Compute the time since desired t0
+*
+*********************************************************************
+      SUBROUTINE time_since_t0(t0string, datebuf, tunit, timesincet0)
+      
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*16 tunit
+      REAL timesincet0
+
+      INTEGER secondsincet0, minutesincet0, hoursincet0
+      INTEGER daysincet0, monthsincet0, yearsincet0
+
+      CALL LOWER_CASE(tunit)
+
+*     Compute time since t0, check time axis unit
+      IF( tunit(1:3) .EQ. 'sec') THEN
+          CALL second_since_t0(t0string, datebuf, secondsincet0)
+          timesincet0 = secondsincet0
+      ELSE IF(tunit(1:3) .EQ. 'min') THEN
+          CALL minute_since_t0(t0string, datebuf, minutesincet0)
+          timesincet0 = minutesincet0
+      ELSE IF(tunit(1:3) .EQ. 'hou') THEN
+          CALL hour_since_t0(t0string, datebuf, hoursincet0)
+          timesincet0 = hoursincet0
+      ELSE IF(tunit(1:3) .EQ. 'day') THEN
+          CALL day_since_t0(t0string, datebuf, daysincet0)
+          timesincet0 = daysincet0
+      ELSE IF(tunit(1:3) .EQ. 'mon') THEN
+          CALL month_since_t0(t0string, datebuf, monthsincet0)
+          timesincet0 = monthsincet0
+      ELSE IF(tunit(1:3) .EQ. 'yea') THEN
+          CALL year_since_t0(t0string, datebuf, yearsincet0)
+          timesincet0 = yearsincet0
+      ELSE 
+          timesincet0=0.
+      ENDIF
+
+      RETURN
+      END
+
+*******************************************************************
+*     Compute second since t0
+*******************************************************************
+      SUBROUTINE second_since_t0(t0string, datebuf, secondsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+      INTEGER minutesincet0, secondsincet0
+
+      INTEGER isecond, t0second, t0hour
+
+      t0hour = 0
+
+      CALL minute_since_t0(t0string, datebuf, minutesincet0)
+      secondsincet0 = 60*minutesincet0
+
+*     Get t0's minute
+      READ (t0string, 110, err=800) t0second
+
+*     Get current minute
+      READ (datebuf, 110, err=900) isecond
+
+ 110  FORMAT (18x, i2)
+
+*     Adjust minutes of current date
+      secondsincet0 = secondsincet0 - (60-isecond)
+
+*     Adjust minutes of t0
+      secondsincet0 = secondsincet0 + (60 - t0second)
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+
+*******************************************************************
+*     Compute minutes since t0
+*******************************************************************
+      SUBROUTINE minute_since_t0(t0string, datebuf, minutesincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+      INTEGER minutesincet0, hoursincet0
+
+      INTEGER iminute, t0minute, t0hour
+
+      t0hour = 0
+
+      CALL hour_since_t0(t0string, datebuf, hoursincet0)
+      minutesincet0 = 60*hoursincet0
+
+*     Get t0's minute
+      READ (t0string, 110, err=800) t0minute
+
+*     Get current minute
+      READ (datebuf, 110, err=900) iminute
+
+ 110  FORMAT (15x, i2, 3x)
+
+*     Adjust minutes of current date
+      minutesincet0 = minutesincet0 - (60-iminute)
+
+*     Adjust minutes of t0
+      minutesincet0 = minutesincet0 + (60 - t0minute)
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute hours since t0
+*******************************************************************
+      SUBROUTINE hour_since_t0(t0string, datebuf, hoursincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+
+      INTEGER hoursincet0, daysincet0
+       
+      INTEGER ihour, t0hour      
+
+      t0hour = 0
+
+      CALL day_since_t0(t0string, datebuf, daysincet0)
+      hoursincet0 = 24*daysincet0
+
+*     Get t0's hour
+      READ (t0string, 110, err=800) t0hour
+
+*     Get current hour
+      READ (datebuf, 110, err=900) ihour
+
+ 110  FORMAT (12x, i2, 6x)
+
+*     Adjust hours of current date
+      hoursincet0 = hoursincet0 - (24-ihour)
+
+*     Adjust hours of t0
+      hoursincet0 = hoursincet0 + (24 - t0hour)
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for t0 date in tax_tstep',
+     .  datebuf
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+*******************************************************************
+*     Compute the days since t0
+*     Assume that t0 is before the current year
+*******************************************************************
+      SUBROUTINE day_since_t0(t0string, datebuf, daysincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+
+      INTEGER daysincet0
+
+      INTEGER t0day, t0year
+      CHARACTER*3 t0mon
+
+      INTEGER dayofmon, iyear 
+      CHARACTER*3 cmon
+
+      CHARACTER*3 months(12)
+      INTEGER it0mon, imon
+      INTEGER i, j, m
+      INTEGER yrstart,yrend
+      INTEGER dayofyear, ndaymo(12)
+
+      DATA ndaymo/31,28,31,30,31,30,31,31,30,31,30,31/
+
+      DATA months/'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
+     .            'aug', 'sep', 'oct', 'nov', 'dec'/
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0day, t0mon, t0year
+      
+*     Get current date
+      READ (datebuf, 110, err=900) dayofmon, cmon, iyear
+   
+ 110  FORMAT (i2, 1x, a3, 1x, i4)
+
+      CALL LOWER_CASE(t0mon)
+      CALL LOWER_CASE(cmon)
+
+*     Convert a month from string to number
+      DO 50 m=1,12
+          IF (t0mon .EQ. months(m)) it0mon=m
+          IF (cmon .EQ. months(m)) imon=m
+ 50   CONTINUE
+
+      yrstart = t0year
+      yrend = iyear-1
+      daysincet0 = 0
+
+*     Total days between yrstart and yrend
+      DO 200 i = yrstart, yrend
+
+*     Check if it is a leap year
+          IF ( ((mod(i,4) .EQ. 0) .AND. (mod(i,100) .NE. 0))
+     .       .OR.
+     .       (mod(i, 400) .EQ. 0)) THEN
+                ndaymo(2) = 29
+          ELSE
+                ndaymo(2) = 28
+          ENDIF
+
+          daysincet0 = daysincet0 + (ndaymo(2) + 7*31 + 4*30)
+
+ 200  CONTINUE
+
+*     ***************************
+*     Adjust days of current year
+*     ***************************
+      IF ( ((mod(iyear,4) .EQ. 0) .AND. (mod(iyear,100) .NE. 0))
+     .       .OR.
+     .       (mod(iyear, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+*     Compute day of current year
+      dayofyear = dayofmon
+      DO 300 j =1, imon -1
+          dayofyear = dayofyear + ndaymo(j)
+ 300  CONTINUE
+
+*     Add days of current year 
+          daysincet0 = daysincet0 + dayofyear
+
+*     *****************************
+*     Adjust days in the year of t0
+*     *****************************
+      IF ( ((mod(t0year,4) .EQ. 0) .AND. (mod(t0year,100) .NE. 0))
+     .       .OR.
+     .       (mod(t0year, 400) .EQ. 0)) THEN
+          ndaymo(2) = 29
+      ELSE
+          ndaymo(2) = 28
+      ENDIF
+
+*     Compute day of current year
+      dayofyear = t0day
+      DO 400 j =1, it0mon -1
+          dayofyear = dayofyear + ndaymo(j)
+ 400  CONTINUE
+
+*     Subtract days of year t0
+      daysincet0 = daysincet0 - dayofyear
+
+      RETURN
+
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for timr origin in tax_tstep',
+     .  t0string
+      RETURN
+
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute month since t0
+*******************************************************************
+      SUBROUTINE month_since_t0(t0string, datebuf, monthsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+      INTEGER monthsincet0
+      CHARACTER*3 t0mon, cmon
+      CHARACTER*3 months(12)
+      INTEGER iyear, t0year, it0mon, imon
+      INTEGER m
+
+      DATA months/'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
+     .            'aug', 'sep', 'oct', 'nov', 'dec'/
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0mon, t0year
+*     Get current date
+      READ (datebuf, 110, err=900) cmon, iyear
+
+ 110  FORMAT (3x, a3, 1x, i4)
+
+      CALL LOWER_CASE(t0mon)
+      CALL LOWER_CASE(cmon)
+*     Convert a month from string to number
+      DO 50 m=1,12
+          IF (t0mon .EQ. months(m)) it0mon=m
+          IF (cmon .EQ. months(m)) imon=m
+ 50   CONTINUE
+
+      monthsincet0= (12-it0mon) + (iyear-t0year-1)*12 + imon
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for time origin in tax_tstep: ',
+     .  t0string
+      RETURN
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep: ',
+     .  datebuf
+      RETURN
+
+      END
+
+*******************************************************************
+*     Compute year since t0
+*******************************************************************
+      SUBROUTINE year_since_t0(t0string, datebuf, yearsincet0)
+
+      CHARACTER*20 t0string, datebuf
+      CHARACTER*80 err_msg
+      INTEGER yearsincet0
+      INTEGER iyear, t0year
+
+*     Get t0's year, month, and day
+      READ (t0string, 110, err=800) t0year
+*     Get current date
+      READ (datebuf, 110, err=900) iyear
+ 110  FORMAT (7x, i4)
+
+      yearsincet0 = iyear - t0year 
+
+      RETURN
+*-------------
+ 800  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for time origin in tax_tstep: ',
+     .  t0string
+      RETURN
+*-------------
+ 900  CONTINUE
+      WRITE (err_msg,*)
+     .  'Error assigning dates/times for current date in tax_tstep: ',
+     .  datebuf
+      RETURN
+
+      END
+
diff --git a/fer/efi/tax_units.F b/fer/efi/tax_units.F
new file mode 100644
index 0000000..72b5257
--- /dev/null
+++ b/fer/efi/tax_units.F
@@ -0,0 +1,159 @@
+*
+* tax_units.F
+*
+* Jing Y. Li 
+* May 4th 2006
+*
+* This function returns the time axis unit value in seconds.
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+* 2006-05-11 It only works with the unit naming convention in xunits_data.F
+
+      SUBROUTINE tax_units_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .     'Returns units of time axis coordinate values, in seconds')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL,
+     .                                NORMAL, NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_units_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+      INCLUDE 'xunits.cmn_text'
+      EXTERNAL xunits_data
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+      INTEGER i, j, k, l, m, n
+      INTEGER iun
+      CHARACTER*16 axname(6), axunits(6)
+      LOGICAL bkw1(6), mod1(6), reg1(6)
+      CHARACTER*255 err_msg
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+*     Get axis information
+      CALL ef_get_axis_info_6d(id, ARG1, axname, axunits,
+     .                         bkw1, mod1, reg1)
+      CALL LOWER_CASE(axunits(T_AXIS))
+      DO 20 iun = pun_1st_time, pun_last_time 
+         IF ( (un_name(iun)      .EQ. axunits(T_AXIS))      .OR.
+     .        (un_name(iun)(1:2) .EQ. axunits(T_AXIS)(1:2)) .OR.
+     .        ( (un_name(iun)    .EQ. 'yr')   .AND.
+     .          (axunits(T_AXIS) .EQ. 'year')      )        ) THEN
+            result(i,j,k,l,m,n) = un_convert(iun) 
+            RETURN
+         ENDIF
+  20  CONTINUE
+
+      WRITE(err_msg,*) 'Unrecognized time axis unit ', axunits(T_AXIS)
+      CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_year.F b/fer/efi/tax_year.F
new file mode 100644
index 0000000..d59b605
--- /dev/null
+++ b/fer/efi/tax_year.F
@@ -0,0 +1,284 @@
+*
+* tax_year.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+
+*
+* This function returns year specified by the first argument (variable 
+* containing time values) from the second argument (variable from which time 
+* encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE tax_year_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns years of time axis coordinate values' )
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_year_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_year_compute(id, arg_1, arg_2, result, taxdat)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6)
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      IF ( modulo(T_AXIS) ) THEN
+         WRITE (err_msg, *) 'Function not valid for modulo time axis'
+         GO TO 999
+      ENDIF
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+
+*                    datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                     READ (datebuf,420,err=900) day_of_mon, cmon, iyear
+ 420                 FORMAT (i2, 1x, a3, 1x, i4) 
+                     result(i,j,k,l,m,n) = iyear
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_year',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tax_yearfrac.F b/fer/efi/tax_yearfrac.F
new file mode 100644
index 0000000..096b1b7
--- /dev/null
+++ b/fer/efi/tax_yearfrac.F
@@ -0,0 +1,292 @@
+*
+* tax_yearfrac.F
+*
+* Jing Y. Li 
+* May 4th 2006
+* 27-Feb-2013 ACM  Fix ticket 2043: remove old code for handling single-
+*                  precision values coming in from argument 1
+*
+* This function returns fraction of year specified by the first argument 
+* (variable containing time values) from the second argument (variable from 
+* which time encoding will be inferred).
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tax_yearfrac_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Returns fraction of year of time axis coordinate values')
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'time steps to convert')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'variable with reference time axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE tax_yearfrac_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work array X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER array_num, nt1, nt2
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the length of the T axis of ARG2 for REAL*8 work array.
+      nt1 = arg_lo_ss(T_AXIS,ARG2)
+      nt2 = nt1 + 
+     .        2 * (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      array_num = 1
+      CALL ef_set_work_array_dims_6d(id, array_num,
+     .                              nt1, 1, 1, 1, 1, 1,
+     .                              nt2, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tax_yearfrac_compute(id, arg_1, arg_2, result, taxdat) 
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 taxdat(wrk1lox:wrk1lox+(wrk1hix-wrk1lox)/2)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*20 datebuf
+      INTEGER iyear, day_of_mon, day_of_year, days_this_year
+      CHARACTER*3 cmon
+      INTEGER L2, LL
+      LOGICAL TM_FPEQ, first
+      CHARACTER*255 err_msg
+      REAL*8 ddate, d1, d2
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+*  variables for checking axis characteristics (modulo axes)
+      CHARACTER ax_name(6)*16, ax_units(6)*16
+      LOGICAL backward(6), modulo(6), regular(6), tmodulo
+
+*  Check to see if time axis of arg 2 is modulo
+      CALL ef_get_axis_info_6d(id, ARG2, ax_name, ax_units,
+     .                         backward, modulo, regular)
+      tmodulo = modulo(T_AXIS)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, T_AXIS,
+     .        arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2), taxdat)
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+         j1 = arg_lo_ss(Y_AXIS,ARG1)
+         DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+            i1 = arg_lo_ss(X_AXIS,ARG1)
+            DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+               first = .TRUE.
+
+               l1 = arg_lo_ss(T_AXIS,ARG1)
+               DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+                  ddate = arg_1(i1,j1,k1,l1,m1,n1)
+                  IF ( ddate .NE. bad_flag(ARG1) ) THEN
+
+*     Get the date string corresponding to time ddate for the variable ARG2
+                     CALL EF_GET_AXIS_DATES(id, ARG2, ddate, 1, datebuf)
+                  
+                     IF ( .NOT. tmodulo ) THEN
+*                       datebuf is in form "DD-MON-YEAR HH:MM:SS". Read date.
+                        READ (datebuf,420,err=900) day_of_mon, cmon, iyear
+ 420                    FORMAT (i2, 1x, a3, 1x, i4) 
+                     ELSE
+*                       modulo: Datebuf is in form "DD-MON HH:MM:SS". Read date.
+                        READ (datebuf,430,err=900) day_of_mon, cmon
+ 430                    FORMAT (i2, 1x, a3) 
+                        iyear = 1901  ! nominally non-leap year 
+                     ENDIF
+
+                     CALL JULIAN_DAY_OF_YEAR(cmon, day_of_mon, iyear,
+     .                                  day_of_year, days_this_year)
+                     result(i,j,k,l,m,n) = REAL(day_of_year) /
+     .                                     REAL(days_this_year) 
+
+                  ELSE
+
+                     result(i,j,k,l,m,n) = bad_flag_result
+
+                  ENDIF 
+
+                  l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400           CONTINUE
+
+               i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 100        CONTINUE
+
+            j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200     CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 900  WRITE (err_msg,*)
+     .  'Error assigning dates/times to timestamp for tax_yearfrac',
+     .  datebuf
+ 999  CALL ef_bail_out (id, err_msg)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/tcat.F b/fer/efi/tcat.F
new file mode 100644
index 0000000..7eee7b1
--- /dev/null
+++ b/fer/efi/tcat.F
@@ -0,0 +1,275 @@
+*
+* tcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function returns the T values of the two variables,
+* concatenated into one long list on an abstract t axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE tcat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the T values of two variables into one ',
+     .        'list on an abstract T axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'TCAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE tcat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1) +  
+     .     (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      call ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tcat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz, 
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+* concatenate in T - dont restart count of index L
+
+      DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 410  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/tcat_str.F b/fer/efi/tcat_str.F
new file mode 100644
index 0000000..7077a5e
--- /dev/null
+++ b/fer/efi/tcat_str.F
@@ -0,0 +1,273 @@
+*
+* tcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract T axis. Other
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE tcat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* *********************************************************************S*
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the T values of two string variables ',
+     .        'into one list on an abstract T axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE tcat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = (arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(T_AXIS,ARG2) - arg_lo_ss(T_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE tcat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+* concatenate in T - dont restart count of index L
+
+      DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 410  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/test_opendap.F b/fer/efi/test_opendap.F
new file mode 100644
index 0000000..9df1ff6
--- /dev/null
+++ b/fer/efi/test_opendap.F
@@ -0,0 +1,264 @@
+*
+* test_opendap.F
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 2005
+*
+*  Return index value in LIST for each grids point in V, or a
+*  missing value wherever there is no match)
+
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE test_opendap_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CALL ef_set_desc(id,
+     ,  'Returns the status flag from attempt to open an OPeNDAP file')
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'url')
+      CALL ef_set_arg_desc(id, arg, 'OPeNDAP URL to test')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE test_opendap_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx, my_lo, my_hi
+
+*     Set the abstract X axis.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+
+      my_lo = 1
+      my_hi = nx
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo, my_hi)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE test_opendap_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+#ifdef usingDODSf2cUnderscore 
+      INTEGER NF_OPEN_
+      CHARACTER*1024 NF_STRERROR_
+#else
+      INTEGER NF_OPEN
+      CHARACTER*1024 NF_STRERROR
+#endif 
+      EXTERNAL NCCLOS
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER istatus, slen, cdfid
+      CHARACTER*2048 filename
+      CHARACTER*1024 errbuff
+      INTEGER nf_nowrite
+      PARAMETER (nf_nowrite = 0)
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS, ARG1)
+         CALL ef_get_string_arg_element_6d(id, ARG1, arg_1, 
+     .                          i1, j1, k1, l1, m1, n1, slen, filename)
+
+#ifdef usingDODSf2cUnderscore 
+
+           istatus = NF_OPEN_(filename, NF_NOWRITE, cdfid) 
+           IF ( istatus .NE. 0 ) errbuff = NF_STRERROR_(istatus)
+* close the netCDF file
+           IF ( istatus .EQ. 0 ) CALL NCCLOS(cdfid, istatus)
+
+#else
+
+           istatus = NF_OPEN(filename, NF_NOWRITE, cdfid) 
+           IF ( istatus .NE. 0 ) errbuff = NF_STRERROR(istatus)
+* close the netCDF file
+           IF ( istatus .EQ. 0 ) CALL NCCLOS(cdfid, istatus)
+
+#endif 
+
+           result(i,j,k,l,m,n) = istatus
+
+         i = i + 1
+ 100  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/time_decode.c b/fer/efi/time_decode.c
new file mode 100644
index 0000000..ca3b6da
--- /dev/null
+++ b/fer/efi/time_decode.c
@@ -0,0 +1,81 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL
+,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+/*
+  Code to perform decoding of formatted dates and times
+ */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferret.h.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "ferret.h"
+
+DFTYPE FORTRAN(time_decode) (char *strtime)
+{
+
+  int ih,im, ok;
+  double ss;  /* pointer to double expected by %lf in sscanf */
+  char str1[2];
+
+  if (sscanf(strtime,"%d:%d:%lf%1s",&ih,&im,&ss,str1) == 3)
+    /* time as hh:mm:ss.s */
+    {
+      ok = 1;
+    }
+  else if (sscanf(strtime,"%d:%d%1s",&ih,&im,str1) == 2)
+    /* time as hh:mm */
+    {
+      ss = 0.0;
+      ok = 1;
+    }
+  else
+    {
+      ok = 0;
+    }    
+
+  if (ok)
+    return  im + 60.*ih + ss/60.;
+  else
+    return -1.e34;
+
+}
+
diff --git a/fer/efi/transpose_xt.F b/fer/efi/transpose_xt.F
new file mode 100644
index 0000000..076545f
--- /dev/null
+++ b/fer/efi/transpose_xt.F
@@ -0,0 +1,236 @@
+*
+* transpose_xt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the X and T axes swiched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes X and T axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable to transpose in X and T')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xt_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_x, my_hi_x, my_lo_t, my_hi_t, nx, nt
+
+*     Set the abstract X and T axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_x = 1
+      my_hi_x = nt
+      my_lo_t = 1
+      my_hi_t = nx
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_x, my_hi_x)
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_t, my_hi_t)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xt_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF ( (arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/transpose_xy.F b/fer/efi/transpose_xy.F
new file mode 100644
index 0000000..c08da2a
--- /dev/null
+++ b/fer/efi/transpose_xy.F
@@ -0,0 +1,236 @@
+*
+* transpose_xy.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the X and Y axes switched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xy_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes x and y axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable to transpose in X and Y')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xy_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_x, my_hi_x, my_lo_y, my_hi_y, nx, ny
+
+*     Set the abstract X and Y axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_x = 1
+      my_hi_x = ny
+      my_lo_y = 1
+      my_hi_y = nx
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_x, my_hi_x)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_y, my_hi_y)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xy_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF ( (arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/transpose_xz.F b/fer/efi/transpose_xz.F
new file mode 100644
index 0000000..e910487
--- /dev/null
+++ b/fer/efi/transpose_xz.F
@@ -0,0 +1,236 @@
+*
+* transpose_xz.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the X and Z axes switched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_xz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes x and z axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable to transpose in X and Z')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_xz_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_x, my_hi_x, my_lo_z, my_hi_z, nx, nz
+
+*     Set the abstract X and Z axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS, ARG1) - arg_lo_ss(X_AXIS, ARG1) + 1
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_x = 1
+      my_hi_x = nz
+      my_lo_z = 1
+      my_hi_z = nx
+
+      CALL ef_set_axis_limits(id, X_AXIS, my_lo_x, my_hi_x)
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_z, my_hi_z)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_xz_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF  ( (arg_lo_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .      (arg_hi_ss(X_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'X axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS) 
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/transpose_yt.F b/fer/efi/transpose_yt.F
new file mode 100644
index 0000000..c9c18ea
--- /dev/null
+++ b/fer/efi/transpose_yt.F
@@ -0,0 +1,236 @@
+*
+* transpose_yt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the Y and T axes switched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_yt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes Y and T axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable to transpose in Y and T')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_yt_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_t, my_hi_t, my_lo_y, my_hi_y, nt, ny
+
+*     Set the abstract T and Y axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_t = 1
+      my_hi_t = ny
+      my_lo_y = 1
+      my_hi_y = nt
+
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_t, my_hi_t)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_y, my_hi_y)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_yt_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF ( (arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/transpose_yz.F b/fer/efi/transpose_yz.F
new file mode 100644
index 0000000..956af92
--- /dev/null
+++ b/fer/efi/transpose_yz.F
@@ -0,0 +1,236 @@
+*
+* transpose_yz.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the Y and Z axes switched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_yz_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes Y and Z axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable transposed in Y and Z')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_yz_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_z, my_hi_z, my_lo_y, my_hi_y, nz, ny
+
+*     Set the abstract Z and Y axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      ny = arg_hi_ss(Y_AXIS, ARG1) - arg_lo_ss(Y_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_z = 1
+      my_hi_z = ny
+      my_lo_y = 1
+      my_hi_y = nz
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_z, my_hi_z)
+      CALL ef_set_axis_limits(id, Y_AXIS, my_lo_y, my_hi_y)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_yz_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Y_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Y axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF ( (arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS) 
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/transpose_zt.F b/fer/efi/transpose_zt.F
new file mode 100644
index 0000000..830593d
--- /dev/null
+++ b/fer/efi/transpose_zt.F
@@ -0,0 +1,236 @@
+*
+* transpose_zt.F
+*
+* 
+* 
+*
+* This function sets the second argument to be equal
+* to the first one with the Z and T axes switched.
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE transpose_zt_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id, 'transposes Z and T axes of given variable')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'VAR')
+      CALL ef_set_arg_desc(id, arg, 'variable to transpose in Z and T')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE transpose_zt_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER my_lo_z, my_hi_z, my_lo_t, my_hi_t, nz, nt
+
+*     Set the abstract Z and T axes.
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS, ARG1) - arg_lo_ss(Z_AXIS, ARG1) + 1
+      nt = arg_hi_ss(T_AXIS, ARG1) - arg_lo_ss(T_AXIS, ARG1) + 1
+
+*     The below has the effect of translating any sub-matrix so that
+*     the indices will always begin at 1 as expected for an abstract axis.
+
+      my_lo_z = 1
+      my_hi_z = nt
+      my_lo_t = 1
+      my_hi_t = nz
+
+      CALL ef_set_axis_limits(id, Z_AXIS, my_lo_z, my_hi_z)
+      CALL ef_set_axis_limits(id, T_AXIS, my_lo_t, my_hi_t)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE transpose_zt_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      CHARACTER*100 errtxt
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+* check to make sure both axis have points to transpose
+      IF ( (arg_lo_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(T_AXIS, ARG1) .EQ. ef_unspecified_int4)) THEN
+         WRITE(errtxt,*) 'T axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+      IF ( (arg_lo_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) .OR. 
+     .     (arg_hi_ss(Z_AXIS, ARG1) .EQ. ef_unspecified_int4) ) THEN
+         WRITE(errtxt,*) 'Z axis cannot be a normal axis'
+         GOTO 999
+      ENDIF
+
+      n1 = arg_lo_ss(F_AXIS, ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS, ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS, ARG1)
+      DO 400 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS) 
+
+      k1 = arg_lo_ss(Z_AXIS, ARG1)
+      DO 300 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS) 
+
+      j1 = arg_lo_ss(Y_AXIS, ARG1)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS, ARG1)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ELSE
+            result(i,j,k,l,m,n) = bad_flag_result
+         ENDIF
+
+         i1 = i1 + arg_incr(X_AXIS, ARG1)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS, ARG1)
+ 200  CONTINUE
+
+         k1 = k1 + arg_incr(Z_AXIS, ARG1)
+ 300  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS, ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS, ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS, ARG1)
+ 600  CONTINUE
+
+      RETURN 
+
+ 999  CALL EF_BAIL_OUT(id, errtxt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/treverse.F b/fer/efi/treverse.F
new file mode 100644
index 0000000..5457d20
--- /dev/null
+++ b/fer/efi/treverse.F
@@ -0,0 +1,206 @@
+*
+* treverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the T values of the input variables,
+* reversed and on an abstract T axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE treverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in T direction on an abstract T axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the T axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, NO, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE treverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nt
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nt = arg_hi_ss(T_AXIS,ARG1) - arg_lo_ss(T_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, T_AXIS, 1, nt)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE treverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_hi_ss(T_AXIS,ARG1), arg_lo_ss(T_AXIS,ARG1), -1
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/unique_str2int.F b/fer/efi/unique_str2int.F
new file mode 100644
index 0000000..81acc90
--- /dev/null
+++ b/fer/efi/unique_str2int.F
@@ -0,0 +1,237 @@
+*
+* unique_str2int.F
+*
+* Ansley Manke
+* July 2009
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns an ID number for each unique
+* string in the input array of strings.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE unique_str2int_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Returns an ID number for each unique string',
+     .        'in the input array of strings (case sensitive)')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Array of Strings')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+* In this subroutine we compute the result
+*
+      SUBROUTINE unique_str2int_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit, 
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+* Routine US2I_COMPARE_STRING_LIST creates and maintains a 
+* list of unique names and their sequence numbers.
+*
+* Future calls to this function will return the same indices for strings
+* given in this call because the above functions maintains a static list
+* of strings which is initialized once and never released.
+
+      INTEGER flen
+      PARAMETER (flen=512)
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER b1len, status, isame, icmp, ifirst, istr
+      CHARACTER*512 buff1
+      REAL result_last
+      INTEGER*1 fhol(flen), hol_last(flen)      ! c-type Hollerith string buffer
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      ifirst = 1
+
+* These loops are intentionally left in un-optimal order since
+* contiguous identical strings are most likely at a location
+* through all time/ensemble/forecast periods.
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                          i1, j1, k1, l1, m1, n1, b1len, buff1)
+
+         CALL TM_FTOC_STRNG(buff1(1:b1len), fhol, flen)
+         isame = 0
+         IF ( ifirst .EQ. 0 ) THEN
+*           hol_last is assigned from the last search, so first
+*           check the common case of contiguous identical strings
+            CALL US2I_STR_CMP(fhol, hol_last, icmp)
+            IF ( icmp .EQ. 0 ) THEN
+               result(i,j,k,l,m,n) = result_last
+               isame = 1
+            ENDIF
+         ENDIF
+         IF ( isame .EQ. 0 ) THEN
+*           Search for the string in the whole list
+*           (initializing the list if needed)
+            CALL US2I_COMPARE_STRING_LIST(fhol, istr)
+            IF ( istr .EQ. 0 ) THEN
+               buff1 = 'Problems initializing the list of strings'
+               GOTO 999
+            ENDIF
+            result(i,j,k,l,m,n) = FLOAT(istr)
+*           Copy the string and the result for the next compare
+            DO istr = 1, b1len
+               hol_last(istr) = fhol(istr)
+            ENDDO
+            result_last = result(i,j,k,l,m,n)
+            ifirst = 0
+         ENDIF
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+      RETURN
+
+ 999  CALL EF_BAIL_OUT(id, buff1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/us2i_compare_string_list.c b/fer/efi/us2i_compare_string_list.c
new file mode 100644
index 0000000..8b8bab5
--- /dev/null
+++ b/fer/efi/us2i_compare_string_list.c
@@ -0,0 +1,180 @@
+
+
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granteHd the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+/* us2i_compare_string_list.c
+ *
+ * Ansley Manke
+ * Uses list-handling library to create a list of unique names for the
+ * function unique_str2int
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <string.h>
+#include "list.h"  /* locally added list library */
+
+/* max length of a path */
+#define MAX_NAME 512
+
+/* define structure used locally */
+typedef struct  {
+    char astring[MAX_NAME];
+    int seq;
+} strngs;
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+/* .... Functions called by Fortran .... */
+void FORTRAN(us2i_compare_string_list)(char *, int *);
+void FORTRAN(us2i_str_cmp)(char *, char *, int *);
+
+/* .... Static Variables ............... */
+static LIST *GLOBAL_unique_us2i_List;
+static int us2i_list_initialized = 0;
+
+/* .... Functions called internally .... */
+static int add_us2i_string(char *);
+static int ListTraverse_FoundString( char *, char * );
+
+
+/* ----
+ * Deallocate GLOBAL_unique_us2i_List
+ *
+ *
+ * int FORTRAN(end_us2i_list)
+ * {
+ *    list_free(GLOBAL_unique_us2i_List, LIST_DEALLOC);
+ *    us2i_list_initialized = 0;
+ * }
+ */
+
+
+/* ----
+ * Call C strcmp function.
+ */
+void FORTRAN(us2i_str_cmp)(char *str1, char *str2, int *ival)
+{
+   *ival = strcmp(str1, str2);
+}
+
+
+/* ----
+ * Find a string in the list, initializing the list if this is the
+ * first search. If the string is not in the list, add it to the list.
+ * Return the sequence number of the string in the (resulting) list.
+ * If an error occurs, a sequence number of zero is assigned.
+ */
+void FORTRAN(us2i_compare_string_list)(char* compare_string, int *str_seq)
+{
+   strngs *str_ptr;
+   int status;
+
+   if ( ! us2i_list_initialized ) {
+      /*
+       * no list yet; initialize the list and add the string to it;
+       * send back the new sequence number of this string
+       */
+      *str_seq = add_us2i_string(compare_string);
+      return;
+   }
+
+   /* check the existing list for this string */
+   status = list_traverse(GLOBAL_unique_us2i_List, compare_string, 
+                          ListTraverse_FoundString, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+   if ( status != LIST_OK ) {
+      /* string not found; add it to the list and send back the new sequence number */
+      *str_seq = add_us2i_string(compare_string); 
+      return;
+   }
+
+   /* String found; get and send back its sequence number in the list */
+   str_ptr = (strngs *) list_curr(GLOBAL_unique_us2i_List); 
+   *str_seq = str_ptr->seq;
+}
+
+
+/* ----
+ * Add a string to GLOBAL_unique_us2i_List, initializing the list if necessary.
+ * Returns the sequence number of this new string, or 0 if an error occurs.
+ */
+static int add_us2i_string(char addstring[])
+{
+   strngs this_string;
+   int isize;
+   int iseq;
+
+   /* Create the list if required */
+   if ( ! us2i_list_initialized ) {
+      GLOBAL_unique_us2i_List = list_init();
+      if ( GLOBAL_unique_us2i_List == NULL ) {
+         fprintf(stderr, "ERROR: unique_str2int: Unable to initialize GLOBAL_unique_us2i_List.\n");
+         return 0;
+      }
+      us2i_list_initialized = 1;
+   }
+
+   /* Add to global linked list*/ 
+   isize = list_size(GLOBAL_unique_us2i_List);
+   iseq = 1 + isize;
+
+   this_string.seq = iseq;
+   strcpy(this_string.astring, addstring);
+
+   list_insert_after(GLOBAL_unique_us2i_List, (char *) &this_string, sizeof(this_string));
+
+   return iseq;
+}
+
+
+/* ---- 
+ * See if the incoming string matches the string in the list at curr.
+ * Case sensitive.
+ */
+static int ListTraverse_FoundString(char *data, char *curr)
+{
+   strngs *str_ptr = (strngs *) curr; 
+
+   if ( strcmp(data, str_ptr->astring) == 0 ) {
+      return 0; /* found match */
+   }
+   return 1;
+}
+
diff --git a/fer/efi/write_webrow.F b/fer/efi/write_webrow.F
new file mode 100644
index 0000000..62ea92d
--- /dev/null
+++ b/fer/efi/write_webrow.F
@@ -0,0 +1,310 @@
+*
+* write_webrow.F
+*
+* Ansley Manke
+* April 2009
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function writes a special webrowset file for LAS
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE write_webrow_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Write a webrowset file with cruise numbers and IDs')
+      CALL ef_set_num_args(id, 4)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT, NORMAL,
+     .                                NORMAL,   NORMAL,
+     .                                NORMAL,   NORMAL)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'id')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise IDs (string) on X axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'name')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Cruise name (string) on X axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'Cruise_Mask')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg,
+     .                'Mask on X axis; =1 at start of each cruise')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 4
+      CALL ef_set_arg_name(id, arg, 'filename')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Filename to write')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+      SUBROUTINE write_webrow_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE write_webrow_compute(id, arg_1, arg_2, arg_3, arg_4,
+     .                                result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(       mem3lox:mem3hix, mem3loy:mem3hiy,
+     .                  mem3loz:mem3hiz, mem3lot:mem3hit,
+     .                  mem3loe:mem3hie, mem3lof:mem3hif)
+      REAL arg_4(strdf, mem4lox:mem4hix, mem4loy:mem4hiy,
+     .                  mem4loz:mem4hiz, mem4lot:mem4hit,
+     .                  mem4loe:mem4hie, mem4lof:mem4hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER slen, blen, iunit, icruise, nd
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 fname
+      CHARACTER*100 errtxt
+      CHARACTER*512 buff, buff_cname
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+C  Get file name
+
+      CALL ef_get_arg_string(id, ARG4, fname)
+
+      iunit = 19
+
+       OPEN( UNIT        = iunit,
+     .       FILE        = fname,
+     .       FORM        = 'FORMATTED',
+     .       ACCESS      = 'SEQUENTIAL',
+     .       STATUS      = 'REPLACE',
+     .       ERR         = 5010 )
+
+* Write webrowset header.
+
+      buff = "<?xml version='1.0'?>"
+      slen = 21
+      WRITE (iunit, 1000) buff(1:slen)
+ 1000 FORMAT(A)
+
+c      buff = "<webRowSet xmlns='http://java.sun.com/xml/ns/jdbc' " //
+c     .       "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+c      slen = 104
+c      WRITE (iunit, 1000) buff(1:slen)
+c
+c      buff = "xsi:schemaLocation='http://java.sun.com/xml/ns/jdbc " //
+c     .       "http://java.sun.com/xml/ns/jdbc/webrowset.xsd'>"
+c      slen = 99
+c      WRITE (iunit, 1000) buff(1:slen)
+      
+      buff = "<webRowSet>"
+      slen = 99
+      WRITE (iunit, 1000) buff(1:slen)
+
+      WRITE (iunit, *) '<data>'
+
+* Write cruise ids and numbers to the webrowset file...
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      k1 = arg_lo_ss(Z_AXIS,ARG1)
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+
+* If the cruise_name is different from the cruise_id,
+* write the cruise_name in parentheses after the ID.
+
+      icruise = 0
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+         IF ( arg_3(i1,j1,k1,l1,m1,n1) .NE. bad_flag(ARG3) ) THEN
+            icruise = icruise + 1 
+            IF ( icruise .LT. 10 ) THEN
+               WRITE (iunit, 1010) icruise
+            ELSE IF ( icruise .LT. 100 ) THEN
+               WRITE (iunit, 1020) icruise
+            ELSE IF ( icruise .LT. 1000 ) THEN
+               WRITE (iunit, 1030) icruise
+            ELSE
+               WRITE (iunit, 1040) icruise
+            ENDIF
+
+ 1010       FORMAT('<currentRow>'/'<columnValue>'/I1/'</columnValue>')
+ 1020       FORMAT('<currentRow>'/'<columnValue>'/I2/'</columnValue>')
+ 1030       FORMAT('<currentRow>'/'<columnValue>'/I3/'</columnValue>')
+ 1040       FORMAT('<currentRow>'/'<columnValue>'/I4/'</columnValue>')
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                         i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                         i1, j1, k1, l1, m1, n1, blen, buff_cname)
+            IF ( slen .EQ. blen ) THEN
+               IF ( buff(:slen) .EQ. buff_cname(:slen) ) blen = 0
+            ENDIF
+            IF ( blen .GT. 0 ) THEN
+               buff(slen+1:slen+2) = ' ('
+               slen = slen + 2
+               buff(slen+1:slen+blen) = buff_cname(:blen)
+               slen = slen + blen
+               buff(slen+1:slen+1) = ')'
+               slen = slen + 1
+            ENDIF
+
+            WRITE (iunit, 1090) buff(1:slen)
+ 1090       FORMAT('<columnValue>'/A/'</columnValue>'/'</currentRow>')
+         ENDIF
+  100 CONTINUE
+
+
+* Write closing tag.
+      WRITE (iunit, 1110) 
+ 1110 FORMAT ('</data>'/'</webRowSet>')
+
+      CLOSE (iunit, ERR = 5020)
+      i = res_lo_ss(X_AXIS)
+      j = res_lo_ss(Y_AXIS)
+      k = res_lo_ss(Z_AXIS)
+      l = res_lo_ss(T_AXIS)
+      m = res_lo_ss(E_AXIS)
+      n = res_lo_ss(F_AXIS)
+      result(i,j,k,l,m,n) = 1.
+
+      RETURN 
+
+ 5010 CONTINUE
+      WRITE(errtxt,*) 'Error opening file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+ 5020 CONTINUE
+      WRITE(errtxt,*) 'Error closing file ', fname
+      CALL EF_BAIL_OUT(id, errtxt)
+      RETURN
+
+      END
diff --git a/fer/efi/xauto_cor.F b/fer/efi/xauto_cor.F
new file mode 100644
index 0000000..cacac64
--- /dev/null
+++ b/fer/efi/xauto_cor.F
@@ -0,0 +1,398 @@
+*
+* xauto_cor.F
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* July 1999
+*  Update to use abstract axis 1-feb-2000
+*  acm 11/2001 bug fix: check both arg_1(i1+im...) and arg_1(i1...) for bad flag
+
+* This function computes the autocorrelation for a x series.  
+*  Autocorelation formula computed directly for lags of 0, 1, ..., N-1
+*  Return on an abstract X axis.
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+      SUBROUTINE xauto_cor_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .        'Compute autocorrelation of series, lags of 0, ..., N-1')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 3)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_desc(id, arg, 'X-series variable')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN 
+      END
+
+
+*
+* In this subroutine we provide information about the lo and hi
+* limits associated with each abstract or custom axis.   The user 
+* configurable information consists of the following:
+*
+* lo_ss               lo subscript for an axis
+*
+* hi_ss               hi subscript for an axis
+*
+
+      SUBROUTINE xauto_cor_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER lo_ss, hi_ss
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+C  Autocorrelation returns correlations for lags of 0 to N-1.
+      lo_ss = 1
+      hi_ss = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, lo_ss, hi_ss)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE xauto_cor_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+* 
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER npts, irr
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      npts = 1 + arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1)
+  
+* partial means  pmean
+      irr = 1
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+* partial variances  pvar
+      irr = 2
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+* box sizes BOX
+      irr = 3
+      CALL ef_set_work_array_dims_6d(id, irr,
+     .                                1, 1, 1, 1, 1, 1,
+     .                             npts, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xauto_cor_compute(id, arg_1, result,
+     .                             pmean, pvar, box)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz, 
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy, 
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL pmean(wrk1lox:wrk1hix)
+      REAL pvar (wrk2lox:wrk2hix)
+      REAL box  (wrk3lox:wrk3hix)
+
+* After initialization, the 'res_' arrays contain indexing information 
+* for the result axes.  The 'arg_' arrays will contain the indexing 
+* information for each variable''s axes. 
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      REAL psum, diff, diff2
+      REAL dsum, bsize
+      INTEGER ir, im, is
+      INTEGER nd, arg
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      arg = 1
+      CALL ef_get_box_size(id, arg, X_AXIS, arg_lo_ss(X_AXIS,arg), 
+     .                     arg_hi_ss(X_AXIS,arg), box)
+
+      nd = arg_hi_ss(X_AXIS,arg) - arg_lo_ss(X_AXIS,arg) + 1
+
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+         k1 = arg_lo_ss(Z_AXIS,ARG1)
+         DO 300 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            j1 = arg_lo_ss(Y_AXIS,ARG1)
+            DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+*
+* Calculate the autocorrelation 
+*  First step is to compute the partial means [1/(n-i)]* sum[m=1,n-i]dat(m+i)
+
+               DO 120 i = 1, nd
+                  psum = 0.
+                  dsum = 0.
+                  im = i-1
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO 110 is = 1, nd-im 
+                     IF ( arg_1(i1+im,j1,k1,l1,m1,n1)
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = box(is+im)
+                        psum = psum + bsize*arg_1(i1+im,j1,k1,l1,m1,n1)
+                        dsum = dsum + bsize
+                     ENDIF
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 110              CONTINUE
+                  IF ( dsum .GT. 0. ) pmean(i) = psum / dsum
+ 120           CONTINUE
+
+*  Compute the partial variances RMS[dat(m+i) - pmean(i)]
+*  Don't divide by dsum; the denominators cancel when the autocorrelation
+*  is computed below.
+
+               DO 160 i = 1, nd
+                  psum = 0.
+                  dsum = 0.
+                  im = i-1
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO 150 is = 1, nd-im 
+                     IF ( arg_1(i1+im,j1,k1,l1,m1,n1)
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = box(is+im)
+                        diff = arg_1(i1+im,j1,k1,l1,m1,n1) - pmean(i)
+                        psum = psum + bsize * diff * diff
+                        dsum = dsum + bsize
+                     ENDIF
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 150              CONTINUE
+                  IF ( dsum .GT. 0. ) THEN
+                     pvar(i) = sqrt(psum)
+                  ELSE
+                     pvar(i) = 0.
+                  ENDIF
+ 160           CONTINUE
+
+*  Compute the autocorrelation for lag l=0,1,2,...,ND-1
+
+               i1 = arg_lo_ss(X_AXIS,ARG1)
+               ir = res_lo_ss(X_AXIS)
+               DO 180 i = 1, nd
+
+                  psum = 0.
+                  dsum = 0.
+                  im = i-1
+                  i1 = arg_lo_ss(X_AXIS,ARG1)
+                  DO 170 is = 1, nd-im 
+                     IF ( arg_1(i1+im,j1,k1,l1,m1,n1)
+     .                    .NE. bad_flag(ARG1) .AND.
+     .                    arg_1(i1,   j1,k1,l1,m1,n1)    
+     .                    .NE. bad_flag(ARG1) ) THEN
+                        bsize = (box(is+im) + box(is)) / 2.
+                        diff  = arg_1(i1+im,j1,k1,l1,m1,n1) - pmean(i)
+                        diff2 = arg_1(i1,   j1,k1,l1,m1,n1) - pmean(1)
+                        psum = psum + bsize * diff * diff2
+                        dsum = dsum + box(is+im) * box(m)
+                     ENDIF
+                     i1 = i1 + arg_incr(X_AXIS,ARG1)
+ 170              CONTINUE
+
+                  IF ( pvar(1) .NE. 0.   .AND.  
+     .                 pvar(i) .NE. 0.   .AND. 
+     .                 psum    .NE. 0. ) THEN
+                     result(ir,j,k,l,m,n) = psum / (pvar(1) * pvar(i))
+                  ELSE
+                     result(ir,j,k,l,m,n) = bad_flag_result
+                  ENDIF
+
+                  i1 = i1 + arg_incr(X_AXIS,ARG1)
+                  ir = ir + res_incr(X_AXIS)
+ 180           CONTINUE
+
+               j1 = j1 + arg_incr(Y_AXIS,ARG1)
+ 200        CONTINUE
+
+            k1 = k1 + arg_incr(Z_AXIS,ARG1)
+ 300     CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN 
+      END
diff --git a/fer/efi/xcat.F b/fer/efi/xcat.F
new file mode 100644
index 0000000..5b6970c
--- /dev/null
+++ b/fer/efi/xcat.F
@@ -0,0 +1,274 @@
+*
+* xcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function returns the X values of the two variables,
+* concatenated into one long list on an abstract x axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE xcat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the X values of two variables into one ',
+     .        'list on an abstract X axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'XCAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE xcat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xcat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+* concatenate in X - dont restart count of index I
+
+      DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 110  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/xcat_str.F b/fer/efi/xcat_str.F
new file mode 100644
index 0000000..d1a4cb7
--- /dev/null
+++ b/fer/efi/xcat_str.F
@@ -0,0 +1,273 @@
+*
+* xcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns the X values of the two variables,
+* concatenated into one long list on an abstract x axis. Other
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE xcat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the X values of two string variables ',
+     .        'into one list on an abstract X axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE xcat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = (arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(X_AXIS,ARG2) - arg_lo_ss(X_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xcat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+* concatenate in X - dont restart count of index I
+
+      DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         i = i + res_incr(X_AXIS)
+ 110  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/xreverse.F b/fer/efi/xreverse.F
new file mode 100644
index 0000000..19836d9
--- /dev/null
+++ b/fer/efi/xreverse.F
@@ -0,0 +1,206 @@
+*
+* xreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the X values of the input variables,
+* reversed and on an abstract x axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+*
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE xreverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in X direction on an abstract X axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the X axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, YES, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE xreverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nx
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nx = arg_hi_ss(X_AXIS,ARG1) - arg_lo_ss(X_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, X_AXIS, 1, nx)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE xreverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_hi_ss(X_AXIS,ARG1), arg_lo_ss(X_AXIS,ARG1), -1
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/ycat.F b/fer/efi/ycat.F
new file mode 100644
index 0000000..cd415b9
--- /dev/null
+++ b/fer/efi/ycat.F
@@ -0,0 +1,275 @@
+*
+* ycat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+* This function returns the Y values of the two variables,
+* concatenated into one long list on an abstract Y axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result
+*
+
+
+      SUBROUTINE ycat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the Y values of two variables into one ',
+     .        'list on an abstract Y axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'YCAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE ycat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ycat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n2) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+* concatenate in Y - dont restart count of index J
+
+      DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 210  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/ycat_str.F b/fer/efi/ycat_str.F
new file mode 100644
index 0000000..986171c
--- /dev/null
+++ b/fer/efi/ycat_str.F
@@ -0,0 +1,274 @@
+*
+* ycat_str.F
+*
+* Ansley Manke
+* Nov 2008
+*
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract y axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE ycat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the Y values of two string variables ',
+     .        'into one list on an abstract Y axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE ycat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = (arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(Y_AXIS,ARG2) - arg_lo_ss(Y_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE ycat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 300     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+* concatenate in Y - dont restart count of index J
+
+      DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         k = res_lo_ss(Z_AXIS)
+         DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            k = k + res_incr(Z_AXIS)
+ 310     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 210  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/yreverse.F b/fer/efi/yreverse.F
new file mode 100644
index 0000000..a582b25
--- /dev/null
+++ b/fer/efi/yreverse.F
@@ -0,0 +1,206 @@
+*
+* yreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the Y values of the input variables,
+* reversed and on an abstract Y axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE yreverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in Y direction on an abstract Y axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, ABSTRACT,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the Y axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, NO, YES, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE yreverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER ny
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      ny = arg_hi_ss(Y_AXIS,ARG1) - arg_lo_ss(Y_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Y_AXIS, 1, ny)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE yreverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_hi_ss(Y_AXIS,ARG1), arg_lo_ss(Y_AXIS,ARG1), -1
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zaxreplace_avg.F b/fer/efi/zaxreplace_avg.F
new file mode 100644
index 0000000..f44152a
--- /dev/null
+++ b/fer/efi/zaxreplace_avg.F
@@ -0,0 +1,496 @@
+*
+* zaxreplace_avg.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1998
+* 11/2001  clarify function description
+*  7/2003  Bug fix; last source point wasnt associated with a dest box
+*          when the destination axis continues beyond the source range
+* 12/2007  Bug 1557 fix: the function already worked for second argument 
+*          varying in xyt. But gaps not treated correctly: for each k, we 
+*          start next k average with remaining weighted part of the last box
+*          When missing data encountered, use this remaining part, then zero
+*          out the variables that held it.
+*
+*
+* Replace Z axis, using weighted averaging over bins
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_avg_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .       'using weighted average')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable on native Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable with desired Z (depth) axis points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_avg_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mz2, mz3
+      INTEGER iwork
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+      mz2 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2))
+      mz2 = 2 * mz2
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+      mz3 = 2 * mz3
+
+*  zaxsrc
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz2, 1, 1, 1, 1, 1)
+
+*  sbox_lo_lim
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz2, 1, 1, 1, 1, 1)
+
+*  sbox_hi_lim
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz2, 1, 1, 1, 1, 1)
+
+*  sbox_lo_new
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz2, 1, 1, 1, 1, 1)
+
+*  sbox_hi_new
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz2, 1, 1, 1, 1, 1)
+
+*  dbox_lo_lim
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*  dbox_hi_lim
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_avg_compute(id, arg_1, arg_2, arg_3,
+     .                                  result, zaxsrc,
+     .                                  sbox_lo_lim, sbox_hi_lim,
+     .                                  sbox_lo_new, sbox_hi_new,
+     .                                  dbox_lo_lim, dbox_hi_lim)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 zaxsrc     (wrk1lox:wrk1hix/2)
+      REAL*8 sbox_lo_lim(wrk2lox:wrk2hix/2)
+      REAL*8 sbox_hi_lim(wrk3lox:wrk3hix/2)
+      REAL*8 sbox_lo_new(wrk4lox:wrk4hix/2)
+      REAL*8 sbox_hi_new(wrk5lox:wrk5hix/2)
+      REAL*8 dbox_lo_lim(wrk6lox:wrk6hix/2)
+      REAL*8 dbox_hi_lim(wrk7lox:wrk7hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1, m1, n1
+      INTEGER i2, j2, l2, m2, n2
+      INTEGER i3, j3, l3, m3, n3
+      INTEGER nbox, nsrc
+      INTEGER nsrc_lo, nsrc_hi
+      REAL frac, xsrc_min, xsrc_max, xsrc_lo, xsrc_hi, xsrcdiff
+      REAL wtd, arg1_val, arg1_val_last, wtd_last
+      REAL*8 sum, wtdsum
+      REAL dbox_lo, dbox_hi
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG2, Z_AXIS,
+     .        arg_lo_ss(Z_AXIS, ARG2), arg_hi_ss(Z_AXIS, ARG2), zaxsrc)
+
+      CALL ef_get_box_limits(id, ARG2, Z_AXIS, arg_lo_ss(Z_AXIS, ARG2),
+     .        arg_hi_ss(Z_AXIS, ARG2), sbox_lo_lim, sbox_hi_lim)
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3),
+     .        arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+*
+*  Loop over x,y,t,e,f of the input fields
+*
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+*
+
+*  Translate the source boxes to the new axis units.
+
+         DO 310 k = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+*  Find the point on the source axis just below the box limit.  Interpolate
+*  to get the box limit in new units.
+            nbox = 1
+            DO WHILE ( zaxsrc(nbox) .LT. sbox_lo_lim(k) )
+               nbox = nbox + 1
+            ENDDO
+            IF ( nbox .EQ. 1 ) THEN
+               sbox_lo_new(k) = arg_2(i2,j2,nbox,l2,m2,n2)
+            ELSE
+               frac = ( sbox_lo_lim(k) - zaxsrc(nbox-1) ) /
+     .                ( zaxsrc(nbox)   - zaxsrc(nbox-1) )
+               sbox_lo_new(k) = arg_2(i2,j2,nbox-1,l2,m2,n2) +
+     .                          frac * ( arg_2(i2,j2,nbox,  l2,m2,n2) -
+     .                                   arg_2(i2,j2,nbox-1,l2,m2,n2) )
+            ENDIF
+
+            nbox = 1
+            DO WHILE ( zaxsrc(nbox) .LT. sbox_hi_lim(k) .AND.
+     .                 nbox .LT. arg_hi_ss(Z_AXIS,ARG1) )
+               nbox = nbox + 1
+            ENDDO
+            IF ( nbox .EQ. 1 ) THEN
+               sbox_hi_new(k) = arg_2(i2,j2,nbox,l2,m2,n2)
+            ELSE
+               frac = ( sbox_hi_lim(k) - zaxsrc(nbox-1) ) /
+     .                ( zaxsrc(nbox)   - zaxsrc(nbox-1) )
+               sbox_hi_new(k) = arg_2(i2,j2,nbox-1,l2,m2,n2) +
+     .                          frac * ( arg_2(i2,j2,nbox,  l2,m2,n2) -
+     .                                   arg_2(i2,j2,nbox-1,l2,m2,n2) )
+            ENDIF
+
+  310    CONTINUE
+
+* For each z line accumulate weighted source points and weights to get
+* the average value.   Loop through the each destination grid box.
+
+         sum = 0.
+         wtdsum = 0.
+         DO 390 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+            nsrc_lo = 1
+            DO WHILE ( sbox_lo_new(nsrc_lo) .LT. dbox_lo_lim(k) )
+               nsrc_lo = nsrc_lo + 1
+               IF ( nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG2) ) GO TO 320
+            ENDDO
+  320       CONTINUE
+
+*  Find any portion of the source box lying in the destination box.
+            nsrc_hi = 1
+            DO WHILE ( sbox_lo_new(nsrc_hi) .LE. dbox_hi_lim(k) )
+               nsrc_hi = nsrc_hi + 1
+               IF ( nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG2) ) GO TO 330
+            ENDDO
+  330       CONTINUE
+            nsrc_hi = nsrc_hi - 1
+
+            IF ( nsrc_hi .LT. nsrc_lo ) THEN
+*  No source boxes within this destination box.
+               IF ( wtdsum .NE. 0. ) THEN
+                  result(i,j,k,l,m,n) = sum / wtdsum
+                  sum = 0.
+                  wtdsum = 0.
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+*  Done with this Z result; go to the next one
+               GOTO 390
+            ENDIF
+
+            DO 340 nsrc = nsrc_lo, nsrc_hi
+
+*  Get fraction of this source box lying within the destination box.
+               xsrc_min = sbox_lo_new(nsrc)
+               xsrc_max = sbox_hi_new(nsrc)
+
+               dbox_hi = dbox_hi_lim(k)
+               dbox_lo = dbox_lo_lim(k)
+
+               xsrc_lo = MAX(xsrc_min, dbox_lo)
+               xsrc_hi = MIN(xsrc_max, dbox_hi)
+
+               xsrcdiff = xsrc_max - xsrc_min
+               wtd = 0.
+               IF ( xsrcdiff .NE. 0. )
+     .            wtd = (xsrc_hi - xsrc_lo) / xsrcdiff
+               arg1_val = arg_1(i1,j1,nsrc,l1,m1,n1)
+               IF ( arg1_val .NE. bad_flag(ARG1) ) THEN
+                  sum  = sum + wtd * arg1_val
+                  wtdsum = wtdsum + wtd
+                  arg1_val_last = arg1_val
+                  wtd_last = wtd
+               ENDIF
+
+  340       CONTINUE
+
+            IF ( wtdsum .NE. 0. ) THEN
+
+* If we had any good data, calculate the average.
+               result(i,j,k,l,m,n) = sum / wtdsum
+
+*  Start next average with remaining weighted part of the last box
+*  which was not within the destination box.
+               sum = (1.- wtd_last) * arg1_val_last
+               wtdsum = 1. - wtd_last
+
+            ELSE
+
+               result(i,j,k,l,m,n) = bad_flag_result
+               sum = 0.
+               wtdsum = 0.
+
+            ENDIF
+
+ 390     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zaxreplace_bin.F b/fer/efi/zaxreplace_bin.F
new file mode 100644
index 0000000..ae47fae
--- /dev/null
+++ b/fer/efi/zaxreplace_bin.F
@@ -0,0 +1,377 @@
+*
+* zaxreplace_bin.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1999
+* 11/2001  clarify function description
+*  7/2003  fix bug in finding the source points in this destination box
+
+* Replace Z axis, using unweighted averaging over bins.
+* Find the source points within each destination box, average them.
+
+* Points that match a destination box edge are arbitrarily put in the
+* box whose lower bound they match, e.g. 500 is put in the500-600 box 
+* not the 400-500 box. 
+*
+
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_bin_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .       'using unweighted average')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 2)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable on native Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable with desired Z (depth) axis points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_bin_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mz3
+      INTEGER iwork
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+      mz3 = 2 * mz3
+
+*  dbox_lo_lim
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*  dbox_hi_lim
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_bin_compute(id, arg_1, arg_2, arg_3,
+     .                          result, dbox_lo_lim, dbox_hi_lim)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 dbox_lo_lim(wrk1lox:wrk1hix/2)
+      REAL*8 dbox_hi_lim(wrk2lox:wrk2hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1, m1, n1
+      INTEGER i2, j2, l2, m2, n2
+      INTEGER i3, j3, l3, m3, n3
+      INTEGER nsrc, nsrc_lo, nsrc_hi
+      REAL*8 sum
+      REAL count, arg1_val
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3),
+     .        arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+*
+*  Loop over x,y,t,e,f of the input fields
+*
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+*
+
+* For each z line accumulate unweighted source points to get
+* the average value.   Loop through the each destination grid box.
+
+         DO 390 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+            nsrc_lo = 1
+            DO WHILE ( arg_2(i2,j2,nsrc_lo,l2,m2,n2)
+     .                 .LT. dbox_lo_lim(k) )
+               nsrc_lo = nsrc_lo + 1
+               IF ( nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG2) ) GO TO 310
+            ENDDO
+  310       CONTINUE
+
+*  Find any portion of the source box lying in the destination box.
+            nsrc_hi = 1
+            DO WHILE ( arg_2(i2,j2,nsrc_hi,l2,m2,n2)
+     .                 .LT. dbox_hi_lim(k) )
+               nsrc_hi = nsrc_hi + 1
+               IF ( nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG2) ) GO TO 320
+            ENDDO
+  320       CONTINUE
+            nsrc_hi = nsrc_hi - 1
+
+            IF ( nsrc_hi .LT. nsrc_lo ) THEN
+*  No source points within this destination box.
+               result(i,j,k,l,m,n) = bad_flag_result
+*  Done with this Z result; go to the next one
+               GO TO 390
+            ENDIF
+
+*  Average function values lying within the destination box.
+            sum = 0.
+            count = 0.
+            DO 330 nsrc = nsrc_lo, nsrc_hi
+               arg1_val = arg_1(i1,j1,nsrc,l1,m1,n1)
+               IF ( arg1_val .NE. bad_flag(ARG1) ) THEN
+                  sum = sum  + arg1_val
+                  count = count + 1.
+               ENDIF
+  330       CONTINUE
+
+* If we had any good data, calculate the average.
+            IF ( count .NE. 0. ) THEN
+               result(i,j,k,l,m,n) = sum / count
+            ELSE
+               result(i,j,k,l,m,n) = bad_flag_result
+            ENDIF
+
+ 390     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zaxreplace_rev.F b/fer/efi/zaxreplace_rev.F
new file mode 100644
index 0000000..00fadfc
--- /dev/null
+++ b/fer/efi/zaxreplace_rev.F
@@ -0,0 +1,492 @@
+*
+* zaxreplace_rev.F
+! version of zaxreplace_avg, with order of arguments 1 and 2 reversed
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* Oct 1998
+* 11/2001  clarify function description
+*  7/2003  Bug fix; last source point wasnt associated with a dest box
+*          when the destination axis continues beyond the source range
+*
+*
+* Replace Z axis, using weighted averaging over bins
+*
+
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_rev_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 fcn_desc
+
+      WRITE (fcn_desc, 10)
+   10 FORMAT('regrid V onto Z axis of ZAX based on Z values in ZVALS ',
+     .       'using weighted average')
+      CALL ef_set_desc(id, fcn_desc)
+
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_has_vari_args(id, NO)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_num_work_arrays(id, 7)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'ZVALS')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Destination Z axis values as a fcn of source Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable on native Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable with desired Z (depth) axis points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_rev_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER mz1, mz3
+      INTEGER iwork
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+*  Allocate double the dimension of the input arguments for work arrays
+*  which will be REAL*8
+      mz1 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1))
+      mz1 = 2 * mz1
+      mz3 = 1 + ABS(arg_hi_ss(Z_AXIS,ARG3) - arg_lo_ss(Z_AXIS,ARG3))
+      mz3 = 2 * mz3
+
+*  zaxsrc
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz1, 1, 1, 1, 1, 1)
+
+*  sbox_lo_lim
+      iwork = 2
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz1, 1, 1, 1, 1, 1)
+
+*  sbox_hi_lim
+      iwork = 3
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz1, 1, 1, 1, 1, 1)
+
+*  sbox_lo_new
+      iwork = 4
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz1, 1, 1, 1, 1, 1)
+
+*  sbox_hi_new
+      iwork = 5
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz1, 1, 1, 1, 1, 1)
+
+*  dbox_lo_lim
+      iwork = 6
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*  dbox_hi_lim
+      iwork = 7
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                              mz3, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_rev_compute(id, arg_1, arg_2, arg_3,
+     .                                  result, zaxsrc,
+     .                                  sbox_lo_lim, sbox_hi_lim,
+     .                                  sbox_lo_new, sbox_hi_new,
+     .                                  dbox_lo_lim, dbox_hi_lim)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL*8 zaxsrc     (wrk1lox:wrk1hix/2)
+      REAL*8 sbox_lo_lim(wrk2lox:wrk2hix/2)
+      REAL*8 sbox_hi_lim(wrk3lox:wrk3hix/2)
+      REAL*8 sbox_lo_new(wrk4lox:wrk4hix/2)
+      REAL*8 sbox_hi_new(wrk5lox:wrk5hix/2)
+      REAL*8 dbox_lo_lim(wrk6lox:wrk6hix/2)
+      REAL*8 dbox_hi_lim(wrk7lox:wrk7hix/2)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1, m1, n1
+      INTEGER i2, j2, l2, m2, n2
+      INTEGER i3, j3, l3, m3, n3
+      INTEGER nbox, nsrc
+      INTEGER nsrc_lo, nsrc_hi
+      REAL frac, xsrc_min, xsrc_max, xsrc_lo, xsrc_hi, xsrcdiff
+      REAL wtd, arg2_val, arg2_val_last, wtd_last
+      REAL*8 sum, wtdsum
+      REAL dbox_lo, dbox_hi
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      CALL ef_get_coordinates(id, ARG1, Z_AXIS,
+     .        arg_lo_ss(Z_AXIS, ARG1), arg_hi_ss(Z_AXIS, ARG1), zaxsrc)
+
+      CALL ef_get_box_limits(id, ARG1, Z_AXIS, arg_lo_ss(Z_AXIS, ARG1),
+     .        arg_hi_ss(Z_AXIS, ARG1), sbox_lo_lim, sbox_hi_lim)
+
+      CALL ef_get_box_limits(id, ARG3, Z_AXIS, arg_lo_ss(Z_AXIS, ARG3),
+     .        arg_hi_ss(Z_AXIS, ARG3), dbox_lo_lim, dbox_hi_lim)
+
+*
+*  Loop over x,y,t,e,f of the input fields
+*
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+*
+* -ACM- Note: need to think about backwards and forwards z axes: ht vs depth ?
+*
+
+*  Translate the source boxes to the new axis units.
+
+         DO 310 k = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+*  Find the point on the source axis just below the box limit.  Interpolate
+*  to get the box limit in new units.
+            nbox = 1
+            DO WHILE ( zaxsrc(nbox) .LT. sbox_lo_lim(k) )
+               nbox = nbox + 1
+            ENDDO
+            IF ( nbox .EQ. 1 ) THEN
+               sbox_lo_new(k) = arg_1(i1,j1,nbox,l1,m1,n1)
+            ELSE
+               frac = ( sbox_lo_lim(k) - zaxsrc(nbox-1) ) /
+     .                ( zaxsrc(nbox)   - zaxsrc(nbox-1) )
+               sbox_lo_new(k) = arg_1(i1,j1,nbox-1,l1,m1,n1) +
+     .                          frac * ( arg_1(i1,j1,nbox,  l1,m1,n1) -
+     .                                   arg_1(i1,j1,nbox-1,l1,m1,n1) )
+            ENDIF
+
+            nbox = 1
+            DO WHILE ( zaxsrc(nbox) .LT. sbox_hi_lim(k) .AND.
+     .                 nbox .LT. arg_hi_ss(Z_AXIS,ARG2) )
+               nbox = nbox + 1
+            ENDDO
+            IF ( nbox .EQ. 1 ) THEN
+               sbox_hi_new(k) = arg_1(i1,j1,nbox,l1,m1,n1)
+            ELSE
+               frac = ( sbox_hi_lim(k) - zaxsrc(nbox-1) ) /
+     .                ( zaxsrc(nbox)   - zaxsrc(nbox-1) )
+               sbox_hi_new(k) = arg_1(i1,j1,nbox-1,l1,m1,n1) +
+     .                          frac * ( arg_1(i1,j1,nbox,  l1,m1,n1) -
+     .                                   arg_1(i1,j1,nbox-1,l1,m1,n1) )
+            ENDIF
+
+  310    CONTINUE
+
+* For each z line accumulate weighted source points and weights to get
+* the average value.   Loop through the each destination grid box.
+
+         sum = 0.
+         wtdsum = 0.
+         DO 390 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+*  Find the first and last source point in this destination box
+            nsrc_lo = 1
+            DO WHILE ( sbox_lo_new(nsrc_lo) .LT. dbox_lo_lim(k) )
+               nsrc_lo = nsrc_lo + 1
+               IF ( nsrc_lo .GT. arg_hi_ss(Z_AXIS, ARG1) ) GO TO 320
+            ENDDO
+  320       CONTINUE
+
+*  Find any portion of the source box lying in the destination box.
+            nsrc_hi = 1
+            DO WHILE ( sbox_lo_new(nsrc_hi) .LE. dbox_hi_lim(k) )
+               nsrc_hi = nsrc_hi + 1
+               IF ( nsrc_hi .GT. arg_hi_ss(Z_AXIS, ARG1) ) GO TO 330
+            ENDDO
+  330       CONTINUE
+            nsrc_hi = nsrc_hi - 1
+
+            IF ( nsrc_hi .LT. nsrc_lo ) THEN
+*  No source boxes within this destination box.
+               IF ( wtdsum .NE. 0. ) THEN
+                  result(i,j,k,l,m,n) = sum / wtdsum
+                  sum = 0.
+                  wtdsum = 0.
+               ELSE
+                  result(i,j,k,l,m,n) = bad_flag_result
+               ENDIF
+*  Done with this Z result; go to the next one
+               GOTO 390
+            ENDIF
+
+            DO 340 nsrc = nsrc_lo, nsrc_hi
+
+*  Get fraction of this source box lying within the destination box.
+               xsrc_min = sbox_lo_new(nsrc)
+               xsrc_max = sbox_hi_new(nsrc)
+
+               dbox_hi = dbox_hi_lim(k)
+               dbox_lo = dbox_lo_lim(k)
+
+               xsrc_lo = MAX(xsrc_min, dbox_lo)
+               xsrc_hi = MIN(xsrc_max, dbox_hi)
+
+               xsrcdiff = xsrc_max - xsrc_min
+               wtd = 0.
+               IF ( xsrcdiff .NE. 0. )
+     .            wtd = (xsrc_hi - xsrc_lo) / xsrcdiff
+               arg2_val = arg_2(i2,j2,nsrc,l2,m2,n2)
+               IF ( arg2_val .NE. bad_flag(ARG2) ) THEN
+                  sum  = sum + wtd * arg2_val
+                  wtdsum = wtdsum + wtd
+                  arg2_val_last = arg2_val
+                  wtd_last = wtd
+               ENDIF
+
+  340       CONTINUE
+
+            IF ( wtdsum .NE. 0. ) THEN
+
+* If we had any good data, calculate the average.
+               result(i,j,k,l,m,n) = sum / wtdsum
+
+*  Start next average with remaining weighted part of the last box
+*  which was not within the destination box.
+               sum = (1.- wtd_last) * arg2_val_last
+               wtdsum = 1. - wtd_last
+
+            ELSE
+
+               result(i,j,k,l,m,n) = bad_flag_result
+               sum = 0.
+               wtdsum = 0.
+
+            ENDIF
+
+ 390     CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zaxreplace_zlev.F b/fer/efi/zaxreplace_zlev.F
new file mode 100644
index 0000000..f1d0e16
--- /dev/null
+++ b/fer/efi/zaxreplace_zlev.F
@@ -0,0 +1,378 @@
+*
+* zaxreplace_zlev.F
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Ansley Manke
+* august 2004
+* V580:10/04 *acm* Fix for bug 1037. Before the loop calling hunt_r4,
+*                  set the initial guess for nsrc_lo to 1 not 0.  
+*       4/06 *acm* as an external function this file included hunt_r4
+*                  from the Ferret code. Linking this statically, no need
+*                  for this any more.*
+*
+*
+* Replace Z axis, where input Z axis is layer and 
+* second argument is layer thickness
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument's axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zaxreplace_zlev_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      CHARACTER*100 descr
+
+      CALL ef_set_desc(id,
+     .        'regrid V onto Z axis of ZAX based on layer thickness')
+      CALL ef_set_num_args(id, 3)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_num_work_arrays(id, 1)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'V')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable on native Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'THICKNESS')
+      WRITE (descr, 20)
+   20 FORMAT ('Thickness corresponding to input Z axis layers ',
+     .        'in units of output Z axis')
+      CALL ef_set_arg_desc(id, arg, descr)
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, NO, NO, NO, NO)
+
+      arg = 3
+      CALL ef_set_arg_name(id, arg, 'ZAX')
+      CALL ef_set_arg_desc(id, arg,
+     .        'Variable with desired Z (depth) axis points')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              NO, NO, YES, NO, NO, NO)
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we request an amount of storage to be supplied
+* by Ferret and passed as an additional argument.
+*
+      SUBROUTINE zaxreplace_zlev_work_size(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+*
+* Set the work arrays, X/Y/Z/T/E/F dimensions
+*
+* ef_set_work_array_dims_6d(id, array #,
+*                           xlo, ylo, zlo, tlo, elo, flo,
+*                           xhi, yhi, zhi, thi, ehi, fhi)
+*
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nz
+      INTEGER iwork
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = 1 + ABS(arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2))
+
+*  zdepth
+      iwork = 1
+      CALL ef_set_work_array_dims_6d(id, iwork,
+     .                                1, 1, 1, 1, 1, 1,
+     .                               nz, 1, 1, 1, 1, 1)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zaxreplace_zlev_compute(id, arg_1, arg_2, arg_3,
+     .                                   result, zdepth)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+      REAL arg_3(mem3lox:mem3hix, mem3loy:mem3hiy, mem3loz:mem3hiz,
+     .           mem3lot:mem3hit, mem3loe:mem3hie, mem3lof:mem3hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* Ignore the Y/Z/T/E/F dimensions in the work arrays since
+* they are not used and Fortran is column major
+      REAL zdepth(wrk1lox:wrk1hix)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+***********************************************************************
+*                                           USER CONFIGURABLE PORTION |
+*                                                                     |
+*                                                                     V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, l1, m1, n1
+      INTEGER i2, j2, l2, m2, n2
+      INTEGER i3, j3, l3, m3, n3
+      INTEGER nsrc_lo, klo, khi
+      REAL sum, lasthalf, frac, zval, zmin, zmax
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      klo = arg_lo_ss(Z_AXIS, ARG2)
+      khi = arg_hi_ss(Z_AXIS, ARG2)
+
+*
+*  Loop over x,y,t,e,f of the input fields
+*
+      n1 = arg_lo_ss(F_AXIS,ARG1)
+      n2 = arg_lo_ss(F_AXIS,ARG2)
+      n3 = arg_lo_ss(F_AXIS,ARG3)
+      DO 600 n = res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
+
+      m1 = arg_lo_ss(E_AXIS,ARG1)
+      m2 = arg_lo_ss(E_AXIS,ARG2)
+      m3 = arg_lo_ss(E_AXIS,ARG3)
+      DO 500 m = res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
+
+      l1 = arg_lo_ss(T_AXIS,ARG1)
+      l2 = arg_lo_ss(T_AXIS,ARG2)
+      l3 = arg_lo_ss(T_AXIS,ARG3)
+      DO 400 l = res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
+
+      j1 = arg_lo_ss(Y_AXIS,ARG1)
+      j2 = arg_lo_ss(Y_AXIS,ARG2)
+      j3 = arg_lo_ss(Y_AXIS,ARG3)
+      DO 200 j = res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
+
+      i1 = arg_lo_ss(X_AXIS,ARG1)
+      i2 = arg_lo_ss(X_AXIS,ARG2)
+      i3 = arg_lo_ss(X_AXIS,ARG3)
+      DO 100 i = res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
+
+* Compute depths at this location and time. Depth coordinate is at
+* half of the current grid cell, plus half of the previous grid cell.
+         sum = 0.0
+         lasthalf = 0.0
+         DO 310 k = klo, khi
+            IF ( arg_2(i2,j2,k,l2,m2,n2) .NE. bad_flag(ARG2) ) THEN
+               sum = sum + lasthalf + 0.5 * arg_2(i2,j2,k,l2,m2,n2)
+               lasthalf = 0.5 * arg_2(i2,j2,k,l2,m2,n2)
+            ENDIF
+* If there are any layer thickness, fill the end of the array with
+* the sum of thicknesses up to the deepest.
+            zdepth(k) = sum
+  310    CONTINUE
+
+         zmin = zdepth(klo)
+         zmax = zdepth(khi)
+
+* For each z line interpolate.
+*        set to one instead of zero
+*        fixes bug where we got no match if zval equals first point in axis
+         nsrc_lo = 1
+
+         DO 390 k = res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
+
+            IF ( sum .EQ. 0.0 ) THEN
+
+               result(i,j,k,l,m,n) = bad_flag_result
+
+            ELSE
+
+* ... next Z axis value (arg3) to locate
+               zval = arg_3(i3,j3,k,l3,m,n3)
+
+* ... search the Z field (arg_2) for the index just below this value
+* ... note that nsrc_lo is always referenced to a starting index of 1
+               IF ( (zval .LT. zmin) .OR. (zval .GT. zmax) ) THEN
+                  frac = -999.0
+               ELSE
+                  CALL HUNT_R4 (zdepth,1,khi,zval,nsrc_lo,frac)
+               ENDIF
+
+* ... interpolate data arg_1 field to get result
+               IF ( frac .LT. 0.0 ) THEN
+
+* ... no luck -- the Z axis value we seek is outside the range in com2
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ELSEIF ( arg_1(i1,j1,nsrc_lo,l1,m1,n1)
+     .                              .EQ. bad_flag(ARG1) ) THEN
+
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ELSEIF ( frac .EQ. 1.0 ) THEN         ! exactly on point
+
+                  result(i,j,k,l,m,n) = arg_1(i1,j1,nsrc_lo,l1,m1,n1)
+
+               ELSEIF ( arg_1(i1,j1,nsrc_lo+1,l1,m1,n1)
+     .                              .EQ. bad_flag(ARG1) ) THEN
+
+                  result(i,j,k,l,m,n) = bad_flag_result
+
+               ELSE
+
+                  result(i,j,k,l,m,n) =
+     .                        frac  * arg_1(i1,j1,nsrc_lo,  l1,m1,n1) +
+     .                  (1. - frac) * arg_1(i1,j1,nsrc_lo+1,l1,m1,n1)
+
+               ENDIF
+
+            ENDIF  ! IF ( sum .EQ. 0.0 ) THEN
+ 390        CONTINUE
+
+         i1 = i1 + arg_incr(X_AXIS,ARG1)
+         i2 = i2 + arg_incr(X_AXIS,ARG2)
+         i3 = i3 + arg_incr(X_AXIS,ARG3)
+ 100  CONTINUE
+
+         j1 = j1 + arg_incr(Y_AXIS,ARG1)
+         j2 = j2 + arg_incr(Y_AXIS,ARG2)
+         j3 = j3 + arg_incr(Y_AXIS,ARG3)
+ 200  CONTINUE
+
+         l1 = l1 + arg_incr(T_AXIS,ARG1)
+         l2 = l2 + arg_incr(T_AXIS,ARG2)
+         l3 = l3 + arg_incr(T_AXIS,ARG3)
+ 400  CONTINUE
+
+         m1 = m1 + arg_incr(E_AXIS,ARG1)
+         m2 = m2 + arg_incr(E_AXIS,ARG2)
+         m3 = m3 + arg_incr(E_AXIS,ARG3)
+ 500  CONTINUE
+
+         n1 = n1 + arg_incr(F_AXIS,ARG1)
+         n2 = n2 + arg_incr(F_AXIS,ARG2)
+         n3 = n3 + arg_incr(F_AXIS,ARG3)
+ 600  CONTINUE
+
+*                                                                     ^
+*                                                                     |
+*                                           USER CONFIGURABLE PORTION |
+***********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zcat.F b/fer/efi/zcat.F
new file mode 100644
index 0000000..4db9736
--- /dev/null
+++ b/fer/efi/zcat.F
@@ -0,0 +1,276 @@
+*
+* zcat.F
+*
+* Ansley Manke
+* Sep 15 2004
+* 4/2006 fix ordering of loops: axis of concatenation must be outermost loop
+* V6.2 *acm* 11/08 New function ef_set_alt_fcn_name to set get the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. E.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+*
+
+* This function returns the Z values of the two variables,
+* concatenated into one long list on an abstract Z axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zcat_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the Z values of two variables into one ',
+     .        'list on an abstract Z axis')
+      CALL ef_set_desc(id, descrip)
+
+* Tell Ferret to run the following instead, if the arguments are strings.
+      CALL ef_set_alt_fcn_name(id, 'ZCAT_STR')
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE zcat_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zcat_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(mem2lox:mem2hix, mem2loy:mem2hiy, mem2loz:mem2hiz,
+     .           mem2lot:mem2hit, mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+* concatenate in Z - dont restart count of index K
+
+      DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(T_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            IF ( arg_2(i2,j2,k2,l2,m2,n2) .EQ. bad_flag(ARG2) ) THEN
+               result(i,j,k,l,m,n) = bad_flag_result
+            ELSE
+               result(i,j,k,l,m,n) = arg_2(i2,j2,k2,l2,m2,n2)
+            ENDIF
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 310  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zcat_str.F b/fer/efi/zcat_str.F
new file mode 100644
index 0000000..18041f5
--- /dev/null
+++ b/fer/efi/zcat_str.F
@@ -0,0 +1,273 @@
+*
+* zcat_str.F
+*
+* Ansley Manke
+* Nov 2008
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*
+* This function returns the values of the two variables,
+* concatenated into one long list on an abstract Z axis. Other 
+* axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zcat_str_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CHARACTER*100 descrip
+
+      WRITE (descrip, 100)
+  100 FORMAT ('Concatenates the Z values of two string variables ',
+     .        'into one list on an abstract Z axis')
+      CALL ef_set_desc(id, descrip)
+
+      CALL ef_set_num_args(id, 2)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+      CALL ef_set_result_type(id, STRING_RETURN)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'First variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+      arg = 2
+      CALL ef_set_arg_name(id, arg, 'B')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_type (id, arg, STRING_ARG)
+      CALL ef_set_arg_desc(id, arg, 'Second variable to concatenate')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE zcat_str_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = (arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1) +
+     .     (arg_hi_ss(Z_AXIS,ARG2) - arg_lo_ss(Z_AXIS,ARG2) + 1)
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zcat_str_compute(id, arg_1, arg_2, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER strdf
+#ifdef double_p
+      PARAMETER (strdf = 1)
+#else
+      PARAMETER (strdf = 2)
+#endif
+
+      INTEGER id
+
+      REAL arg_1(strdf, mem1lox:mem1hix, mem1loy:mem1hiy,
+     .                  mem1loz:mem1hiz, mem1lot:mem1hit,
+     .                  mem1loe:mem1hie, mem1lof:mem1hif)
+      REAL arg_2(strdf, mem2lox:mem2hix, mem2loy:mem2hiy,
+     .                  mem2loz:mem2hiz, mem2lot:mem2hit,
+     .                  mem2loe:mem2hie, mem2lof:mem2hif)
+
+      REAL result(strdf, memreslox:memreshix, memresloy:memreshiy,
+     .                   memresloz:memreshiz, memreslot:memreshit,
+     .                   memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n, slen
+      INTEGER i1, j1, k1, l1, m1, n1
+      INTEGER i2, j2, k2, l2, m2, n2
+      CHARACTER*512 buff
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
+
+         n = res_lo_ss(F_AXIS)
+         DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+         m = res_lo_ss(E_AXIS)
+         DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+         l = res_lo_ss(T_AXIS)
+         DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+         i = res_lo_ss(X_AXIS)
+         DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG1, arg_1,
+     .                             i1, j1, k1, l1, m1, n1, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 100     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 200     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 400     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 500     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 600     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+* concatenate in Z - dont restart count of index K
+
+      DO 310 k2 = arg_lo_ss(Z_AXIS,ARG2), arg_hi_ss(Z_AXIS,ARG2)
+
+         n = res_lo_ss(F_AXIS)
+         DO 610 n2 = arg_lo_ss(F_AXIS,ARG2), arg_hi_ss(F_AXIS,ARG2)
+
+         m = res_lo_ss(E_AXIS)
+         DO 510 m2 = arg_lo_ss(E_AXIS,ARG2), arg_hi_ss(E_AXIS,ARG2)
+
+         l = res_lo_ss(T_AXIS)
+         DO 410 l2 = arg_lo_ss(T_AXIS,ARG2), arg_hi_ss(T_AXIS,ARG2)
+
+         j = res_lo_ss(Y_AXIS)
+         DO 210 j2 = arg_lo_ss(Y_AXIS,ARG2), arg_hi_ss(Y_AXIS,ARG2)
+
+         i = res_lo_ss(X_AXIS)
+         DO 110 i2 = arg_lo_ss(X_AXIS,ARG2), arg_hi_ss(X_AXIS,ARG2)
+
+            CALL EF_GET_STRING_ARG_ELEMENT_6D(id, ARG2, arg_2,
+     .                             i2, j2, k2, l2, m2, n2, slen, buff)
+            CALL EF_PUT_STRING(buff, slen, result(1,i,j,k,l,m,n))
+
+            i = i + res_incr(X_AXIS)
+ 110     CONTINUE
+
+            j = j + res_incr(Y_AXIS)
+ 210     CONTINUE
+
+            l = l + res_incr(T_AXIS)
+ 410     CONTINUE
+
+            m = m + res_incr(E_AXIS)
+ 510     CONTINUE
+
+            n = n + res_incr(F_AXIS)
+ 610     CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 310  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efi/zgrid_laplace.F b/fer/efi/zgrid_laplace.F
new file mode 100644
index 0000000..7be8d1c
--- /dev/null
+++ b/fer/efi/zgrid_laplace.F
@@ -0,0 +1,421 @@
+	subroutine zgrid_laplace(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+     1	xp,yp,zp,zpij,knxt,n,cay,nrng) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)zgrid.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
+c  8/26/2008   This is exactly zgrid from the PPLUS code. This function has
+c              some hard-wired workspace limited to 50K points. For the external
+c              functions scat2gridlplace*, instead allocate work arrays in the 
+c              external functions and pass them to zgrid_laplace.F
+c
+c*******************************************************************************
+c 
+c	vax/vms
+c
+	IMPLICIT REAL(A-H, O-Z), INTEGER(I-N)
+	real z(nxsize,nysize),xp(n),yp(n),zp(n),zpij(n)
+        integer knxt(n)
+c
+c	end vax/vms
+c
+c	rsx-11m
+c
+c	virtual z(nxsize,nysize),xp(n),yp(n),zp(n),zpij(10000),knxt(10000)
+c
+c	end rsx-11m
+c
+	dimension imnew(1000),kksav(500)
+ 
+	itmax=100 
+	eps=.002 
+	big=.9e35 
+c 
+c     get zbase which will make all zp values positive by 20*(zmax-zmin) 
+c*******************************************************************************
+c 
+c**   grh modification
+	zmin=big
+	zmax=-big
+	do 20 k=1,n 
+	if(zp(k).ge.1e35)goto 20
+c**
+	if(zp(k)-zmax)14,14,12 
+12	zmax=zp(k) 
+14	if(zp(k)-zmin)16,20,20 
+16	zmin=zp(k) 
+20	continue 
+	zrange=zmax-zmin 
+	zbase=zrange*20.-zmin 
+	hrange=amin1(dx*(nx-1) , dy*(ny-1)) 
+	derzm=2.*zrange/hrange 
+c 
+c     set pointer array knxt 
+c*******************************************************************************
+c 
+	do 60 kk=1,n 
+	k=1+n-kk 
+        IF (k .le. 51514) then
+          nothing = 0
+        endif
+	knxt(k)=0 
+	i= (xp(k)-x1)/dx + 1.5 
+	if(i*(nx+1-i))60,60,35 
+35	j= (yp(k)-y1)/dy + 1.5 
+	if(j*(ny+1-j))60,60,40 
+40	if(z(i,j)-big)45,60,60 
+45	knxt(k)=n+1 
+	if(z(i,j))55,55,50 
+50	knxt(k)= z(i,j)+.5 
+55	z(i,j)=k 
+60	continue 
+c 
+c     affix each data point zp to its nearby grid point.  take avg zp if 
+c     more than one zp nearby the grid point. add zbase and complement. 
+	do 80 k=1,n 
+	if(knxt(k))80,80,65 
+65	npt=0 
+c**   grh modification
+	imask=0
+c**
+	zsum=0. 
+	i= (xp(k)-x1)/dx + 1.5 
+	j =(yp(k)-y1)/dy + 1.5 
+	kk=k 
+70	npt=npt+1 
+c**   grh modification
+	kksav(npt)=kk
+	if(zp(kk).gt.big)imask=1
+c**
+	zsum=zsum+ zp(kk) 
+	knxt(kk)=-knxt(kk) 
+	kk = -knxt(kk) 
+	if(kk-n)70,70,75 
+c**	grh modification
+75	if(imask.eq.0)then
+	z(i,j) = -zsum/npt-zbase 
+	else
+	z(i,j) = 1.e35
+	do 76 i=1,npt
+76	knxt(kksav(i))=0
+	endif
+c**
+80	continue 
+c 
+c     initially set each unset grid point to value of nearest known pt. 
+c*******************************************************************************
+c 
+	do 110 i=1,nx 
+	do 110 j=1,ny 
+	if(z(i,j))110,100,110 
+100	z(i,j) = -1.e35 
+110	continue 
+	do 199 iter=1,nrng 
+	nnew=0 
+	do 197 i=1,nx 
+	do 197 j=1,ny 
+	if(z(i,j)+big)152,192,192 
+152	if(j-1)162,162,153 
+153	if(jmnew)154,154,162 
+154	zijn=abs(z(i,j-1)) 
+	if(zijn-big)195,162,162 
+162	if(i-1)172,172,163 
+163	if(imnew(j))164,164,172 
+164	zijn=abs(z(i-1,j)) 
+	if(zijn-big)195,172,172 
+172	if(j-ny)173,182,182 
+173	zijn=abs(z(i,j+1)) 
+	if(zijn-big)195,182,182 
+182	if(i-nx)183,192,192 
+183	zijn=abs(z(i+1,j)) 
+	if(zijn-big)195,192,192 
+192	imnew(j)=0 
+	jmnew=0 
+	go to 197 
+195	imnew(j)=1 
+	jmnew=1 
+	z(i,j)=zijn 
+	nnew=nnew+1 
+197	continue 
+	if(nnew)200,200,199 
+199	continue 
+200	continue 
+	do 202 i=1,nx 
+	do 202 j=1,ny 
+	abz=abs(z(i,j)) 
+	if(abz-big)202,201,201 
+201	z(i,j)=abz 
+202	continue 
+c 
+c     improve the non-data points by applying point over-relaxation 
+c     using the laplace-spline equation  (carres method is used) 
+c*******************************************************************************
+c 
+	dzrmsp=zrange 
+	relax=1.0 
+	do 4000 iter=1,itmax 
+	dzrms=0. 
+	dzmax=0. 
+	npg =0 
+	do 2000 i=1,nx 
+	do 2000 j=1,ny 
+	z00=z(i,j) 
+	if(z00-big)205,2000,2000 
+205	if(z00)2000,208,208 
+208	wgt=0. 
+	zsum=0. 
+c 
+	im=0 
+	if(i-1)570,570,510 
+510	zim=abs(z(i-1,j)) 
+	if(zim-big)530,570,570 
+530	im=1 
+	wgt=wgt+1. 
+	zsum=zsum+zim 
+	if(i-2)570,570,540 
+540	zimm=abs(z(i-2,j)) 
+	if(zimm-big)560,570,570 
+560	wgt=wgt+cay 
+	zsum=zsum-cay*(zimm-2.*zim) 
+570	if(nx-i)700,700,580 
+580	zip=abs(z(i+1,j)) 
+	if(zip-big)600,700,700 
+600	wgt=wgt+1. 
+	zsum=zsum+zip 
+	if(im)620,620,610 
+610	wgt=wgt+4.*cay 
+	zsum=zsum+2.*cay*(zim+zip) 
+620	if(nx-1-i)700,700,630 
+630	zipp=abs(z(i+2,j)) 
+	if(zipp-big)650,700,700 
+650	wgt=wgt+cay 
+	zsum=zsum-cay*(zipp-2.*zip) 
+700	continue 
+c 
+	jm=0 
+	if(j-1)1570,1570,1510 
+1510	zjm=abs(z(i,j-1)) 
+	if(zjm-big)1530,1570,1570 
+1530	jm=1 
+	wgt=wgt+1. 
+	zsum=zsum+zjm 
+	if(j-2)1570,1570,1540 
+1540	zjmm=abs(z(i,j-2)) 
+	if(zjmm-big)1560,1570,1570 
+1560	wgt=wgt+cay 
+	zsum=zsum-cay*(zjmm-2.*zjm) 
+1570	if(ny-j)1700,1700,1580 
+1580	zjp=abs(z(i,j+1)) 
+	if(zjp-big)1600,1700,1700 
+1600	wgt=wgt+1. 
+	zsum=zsum+zjp 
+	if(jm)1620,1620,1610 
+1610	wgt=wgt+4.*cay 
+	zsum=zsum+2.*cay*(zjm+zjp) 
+1620	if(ny-1-j)1700,1700,1630 
+1630	zjpp=abs(z(i,j+2)) 
+	if(zjpp-big)1650,1700,1700 
+1650	wgt=wgt+cay 
+	zsum=zsum-cay*(zjpp-2.*zjp) 
+1700	continue 
+c 
+	dz=zsum/wgt-z00 
+	npg=npg+1 
+	dzrms=dzrms+dz*dz 
+	dzmax=amax1(abs(dz),dzmax) 
+	z(i,j)=z00+dz*relax 
+2000	continue 
+c 
+c 
+c     shift data points zp progressively back to their proper places as 
+c     the shape of surface z becomes evident. 
+c*******************************************************************************
+c 
+	if(iter-(iter/10)*10) 3600,3020,3600 
+3020	do 3400 k=1,n 
+	knxt(k) =iabs(knxt(k)) 
+	if(knxt(k))3400,3400,3030 
+3030	x=(xp(k)-x1)/dx 
+	i=x+1.5 
+	x= x+1.-i 
+	y=(yp(k)-y1)/dy 
+	j=y+1.5 
+	y=y+1.-j 
+	zpxy = zp(k)+zbase 
+	z00 = abs(z(i,j)) 
+c 
+	zw=1.e35 
+	if(i-1)3120,3120,3110 
+3110	zw = abs(z(i-1,j)) 
+3120	ze=1.e35 
+	if(i-nx)3130,3140,3140 
+3130	ze = abs(z(i+1,j)) 
+3140	if(ze-big)3160,3150,3150 
+3150	if(zw-big)3180,3170,3170 
+3160	if(zw-big)3200,3190,3190 
+3170	ze=z00 
+	zw=z00 
+	go to 3200 
+3180	ze=2.*z00-zw 
+	go to 3200 
+3190	zw = 2.*z00-ze 
+c 
+3200	zs=1.e35 
+	if(j-1)3220,3220,3210 
+3210	zs = abs(z(i,j-1)) 
+3220  	zn= 1.e35 
+	if(j-ny)3230,3240,3240 
+3230	zn = abs(z(i,j+1)) 
+3240	if(zn-big)3260,3250,3250 
+3250	if(zs-big)3280,3270,3270 
+3260	if(zs-big)3300,3290,3290 
+3270	zn= z00 
+	zs= z00 
+	go to 3300 
+3280	zn = 2.*z00-zs 
+	go to 3300 
+3290	zs = 2.*z00-zn 
+c 
+3300	a=(ze-zw)*.5 
+	b=(zn-zs)*.5 
+	c=(ze+zw)*.5-z00 
+	d=(zn+zs)*.5-z00 
+	zxy=z00+a*x+b*y+c*x*x+d*y*y 
+	delz=z00-zxy 
+	delzm=derzm*(abs(x)*dx+abs(y)*dy)*.80 
+	if(delz-delzm)3355,3355,3350 
+3350	delz=delzm 
+3355	if(delz+delzm)3360,3365,3365 
+3360	delz=-delzm 
+3365	zpij(k)=zpxy+delz 
+3400	continue 
+c 
+	do 3500 k=1,n 
+	if(knxt(k))3500,3500,3410 
+3410	npt=0 
+	zsum = 0. 
+	i= (xp(k)-x1)/dx + 1.5 
+	j= (yp(k)-y1)/dy + 1.5 
+	kk = k 
+3420	npt = npt+1 
+	zsum = zsum + zpij(kk) 
+	knxt(kk)= -knxt(kk) 
+	kk = -knxt(kk) 
+	if(kk-n)3420,3420,3430 
+3430	z(i,j) =  -zsum/npt 
+3500	continue 
+3600	continue 
+c 
+c     test for convergence 
+c*******************************************************************************
+c 
+	if(npg.eq.0)goto 4010
+	dzrms=sqrt(dzrms/npg) 
+	root =dzrms/dzrmsp 
+	dzrmsp=dzrms 
+	dzmaxf=dzmax/zrange 
+	if(iter-(iter/10)*10-2)3715,3710,3715 
+3710	dzrms8 = dzrms 
+3715	if(iter-(iter/10)*10)4000,3720,4000 
+3720	root = sqrt(sqrt(sqrt(dzrms/dzrms8))) 
+	if(root-.9999)3730,4000,4000 
+3730	if(dzmaxf/(1.-root)-eps)4010,4010,3740 
+c 
+c     improve the relaxation factor. 
+c*******************************************************************************
+c 
+3740	if((iter-20)*(iter-40)*(iter-60))4000,3750,4000 
+3750	if(relax-1.-root)3760,4000,4000 
+3760	tpy =(root+relax-1.)/relax 
+	rootgs = tpy*tpy/root 
+	relaxn= 2./(1.+sqrt(1.-rootgs)) 
+	if(iter-60)3780,3785,3780 
+3780	relaxn= relaxn-.25*(2.-relaxn) 
+3785	relax = amax1(relax,relaxn) 
+4000	continue 
+4010	continue 
+c 
+c     remove zbase from array z and return. 
+c 
+	do 4500 i=1,nx 
+	do 4500 j=1,ny 
+	if(z(i,j)-big)4400,4500,4500 
+4400	z(i,j)=abs(z(i,j))-zbase 
+4500	continue 
+	return 
+	end 
diff --git a/fer/efi/zreverse.F b/fer/efi/zreverse.F
new file mode 100644
index 0000000..a4190c2
--- /dev/null
+++ b/fer/efi/zreverse.F
@@ -0,0 +1,206 @@
+*
+* zreverse.F
+*
+* Ansley Manke
+* Sep 15 2004
+*
+* This function returns the Z values of the input variables,
+* reversed and on an abstract Z axis. Other axes are unchanged.
+*
+*
+* In this subroutine we provide information about
+* the function.  The user configurable information 
+* consists of the following:
+*
+* descr              Text description of the function
+*
+* num_args           Required number of arguments
+*
+* axis_inheritance   Type of axis for the result
+*                       ( CUSTOM, IMPLIED_BY_ARGS, NORMAL, ABSTRACT )
+*                       CUSTOM          - user defined axis
+*                       IMPLIED_BY_ARGS - same axis as the incoming argument
+*                       NORMAL          - the result is normal to this axis
+*                       ABSTRACT        - an axis which only has index values
+*
+* piecemeal_ok       For memory optimization:
+*                       axes where calculation may be performed piecemeal
+*                       ( YES, NO )
+* 
+*
+* For each argument we provide the following information:
+*
+* name               Text name for an argument
+*
+* unit               Text units for an argument
+*
+* desc               Text description of an argument
+*
+* axis_influence     Are this argument''s axes the same as the result grid?
+*                       ( YES, NO )
+*
+* axis_extend       How much does Ferret need to extend arg limits relative to result 
+*
+
+
+      SUBROUTINE zreverse_init(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, arg
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      CALL ef_set_desc(id,
+     .  'Returns values reversed in Z direction on an abstract Z axis')
+      CALL ef_set_num_args(id, 1)
+      CALL ef_set_axis_inheritance_6d(id,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
+     .                                ABSTRACT,        IMPLIED_BY_ARGS,
+     .                                IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
+      CALL ef_set_piecemeal_ok_6d(id, NO, NO, NO, NO, NO, NO)
+
+      arg = 1
+      CALL ef_set_arg_name(id, arg, 'A')
+      CALL ef_set_arg_unit(id, arg, ' ')
+      CALL ef_set_arg_desc(id, arg, 'Variable to reverse the Z axis')
+      CALL ef_set_axis_influence_6d(id, arg,
+     .                              YES, YES, NO, YES, YES, YES)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+      SUBROUTINE zreverse_result_limits(id)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+      INTEGER nz
+
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+
+      nz = arg_hi_ss(Z_AXIS,ARG1) - arg_lo_ss(Z_AXIS,ARG1) + 1
+
+      CALL ef_set_axis_limits(id, Z_AXIS, 1, nz)
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
+
+
+*
+* In this subroutine we compute the result
+*
+      SUBROUTINE zreverse_compute(id, arg_1, result)
+
+      IMPLICIT NONE
+      INCLUDE 'EF_Util.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER id
+
+      REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
+     .           mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
+
+      REAL result(memreslox:memreshix, memresloy:memreshiy,
+     .            memresloz:memreshiz, memreslot:memreshit,
+     .            memresloe:memreshie, memreslof:memreshif)
+
+* After initialization, the 'res_' arrays contain indexing information
+* for the result axes.  The 'arg_' arrays will contain the indexing
+* information for each variable''s axes.
+
+      INTEGER res_lo_ss(6),
+     .        res_hi_ss(6),
+     .        res_incr (6)
+      INTEGER arg_lo_ss(6,EF_MAX_ARGS),
+     .        arg_hi_ss(6,EF_MAX_ARGS),
+     .        arg_incr (6,EF_MAX_ARGS)
+
+      REAL bad_flag(EF_MAX_ARGS), bad_flag_result
+
+* **********************************************************************
+*                                            USER CONFIGURABLE PORTION |
+*                                                                      |
+*                                                                      V
+
+      INTEGER i, j, k, l, m, n
+      INTEGER i1, j1, k1, l1, m1, n1
+
+      CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
+      CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
+      CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
+
+      n = res_lo_ss(F_AXIS)
+      DO 600 n1 = arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
+
+      m = res_lo_ss(E_AXIS)
+      DO 500 m1 = arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
+
+      l = res_lo_ss(T_AXIS)
+      DO 400 l1 = arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
+
+      k = res_lo_ss(Z_AXIS)
+      DO 300 k1 = arg_hi_ss(Z_AXIS,ARG1), arg_lo_ss(Z_AXIS,ARG1), -1
+
+      j = res_lo_ss(Y_AXIS)
+      DO 200 j1 = arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
+
+      i = res_lo_ss(X_AXIS)
+      DO 100 i1 = arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
+
+         IF ( arg_1(i1,j1,k1,l1,m1,n1) .EQ. bad_flag(ARG1) ) THEN
+            result(i,j,k,l,m,n) = bad_flag_result
+         ELSE
+            result(i,j,k,l,m,n) = arg_1(i1,j1,k1,l1,m1,n1)
+         ENDIF
+
+         i = i + res_incr(X_AXIS)
+ 100  CONTINUE
+
+         j = j + res_incr(Y_AXIS)
+ 200  CONTINUE
+
+         k = k + res_incr(Z_AXIS)
+ 300  CONTINUE
+
+         l = l + res_incr(T_AXIS)
+ 400  CONTINUE
+
+         m = m + res_incr(E_AXIS)
+ 500  CONTINUE
+
+         n = n + res_incr(F_AXIS)
+ 600  CONTINUE
+
+*                                                                      ^
+*                                                                      |
+*                                            USER CONFIGURABLE PORTION |
+* **********************************************************************
+
+      RETURN
+      END
diff --git a/fer/efn/LIB_NAME b/fer/efn/LIB_NAME
new file mode 100644
index 0000000..6763da2
--- /dev/null
+++ b/fer/efn/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libefn.a 
+
diff --git a/fer/efn/Makefile b/fer/efn/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/efn/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/efn/SOURCE_FILES b/fer/efn/SOURCE_FILES
new file mode 100644
index 0000000..8c7138e
--- /dev/null
+++ b/fer/efn/SOURCE_FILES
@@ -0,0 +1,5 @@
+SRCS_F = \
+efcn_copy_array_dims.F\
+efcn_get_custom_axis.F\
+efcn_get_workspace_addr.F \
+efcn_set_work_array_dims.F
diff --git a/fer/efn/efcn_copy_array_dims.F b/fer/efn/efcn_copy_array_dims.F
new file mode 100644
index 0000000..23d2204
--- /dev/null
+++ b/fer/efn/efcn_copy_array_dims.F
@@ -0,0 +1,161 @@
+c     
+c     efcn_copy_array_dims.F
+c     
+c     Jonathan Callahan
+c     Sep 22nd 1998
+c     
+
+c     
+c     This subroutine is called by efcn_compute_ inside EF_ExternalUtil.c. 
+c     It copies all of the dimensioning information from xmem_subsc.cmn to
+c     the equivalent slots in ef_mem_subsc.cmn.
+c     
+
+      SUBROUTINE EFCN_COPY_ARRAY_DIMS
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xmem_subsc.cmn'
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      mem1lox = m1lox
+      mem1loy = m1loy
+      mem1loz = m1loz
+      mem1lot = m1lot
+      mem1loe = m1loe
+      mem1lof = m1lof
+
+      mem1hix = m1hix
+      mem1hiy = m1hiy
+      mem1hiz = m1hiz
+      mem1hit = m1hit
+      mem1hie = m1hie
+      mem1hif = m1hif
+
+      mem2lox = m2lox
+      mem2loy = m2loy
+      mem2loz = m2loz
+      mem2lot = m2lot
+      mem2loe = m2loe
+      mem2lof = m2lof
+
+      mem2hix = m2hix
+      mem2hiy = m2hiy
+      mem2hiz = m2hiz
+      mem2hit = m2hit
+      mem2hie = m2hie
+      mem2hif = m2hif
+
+      mem3lox = m3lox
+      mem3loy = m3loy
+      mem3loz = m3loz
+      mem3lot = m3lot
+      mem3loe = m3loe
+      mem3lof = m3lof
+
+      mem3hix = m3hix
+      mem3hiy = m3hiy
+      mem3hiz = m3hiz
+      mem3hit = m3hit
+      mem3hie = m3hie
+      mem3hif = m3hif
+
+      mem4lox = m4lox
+      mem4loy = m4loy
+      mem4loz = m4loz
+      mem4lot = m4lot
+      mem4loe = m4loe
+      mem4lof = m4lof
+
+      mem4hix = m4hix
+      mem4hiy = m4hiy
+      mem4hiz = m4hiz
+      mem4hit = m4hit
+      mem4hie = m4hie
+      mem4hif = m4hif
+
+      mem5lox = m5lox
+      mem5loy = m5loy
+      mem5loz = m5loz
+      mem5lot = m5lot
+      mem5loe = m5loe
+      mem5lof = m5lof
+
+      mem5hix = m5hix
+      mem5hiy = m5hiy
+      mem5hiz = m5hiz
+      mem5hit = m5hit
+      mem5hie = m5hie
+      mem5hif = m5hif
+
+      mem6lox = m6lox
+      mem6loy = m6loy
+      mem6loz = m6loz
+      mem6lot = m6lot
+      mem6loe = m6loe
+      mem6lof = m6lof
+
+      mem6hix = m6hix
+      mem6hiy = m6hiy
+      mem6hiz = m6hiz
+      mem6hit = m6hit
+      mem6hie = m6hie
+      mem6hif = m6hif
+
+      mem7lox = m7lox
+      mem7loy = m7loy
+      mem7loz = m7loz
+      mem7lot = m7lot
+      mem7loe = m7loe
+      mem7lof = m7lof
+
+      mem7hix = m7hix
+      mem7hiy = m7hiy
+      mem7hiz = m7hiz
+      mem7hit = m7hit
+      mem7hie = m7hie
+      mem7hif = m7hif
+
+      mem8lox = m8lox
+      mem8loy = m8loy
+      mem8loz = m8loz
+      mem8lot = m8lot
+      mem8loe = m8loe
+      mem8lof = m8lof
+
+      mem8hix = m8hix
+      mem8hiy = m8hiy
+      mem8hiz = m8hiz
+      mem8hit = m8hit
+      mem8hie = m8hie
+      mem8hif = m8hif
+
+      mem9lox = m9lox
+      mem9loy = m9loy
+      mem9loz = m9loz
+      mem9lot = m9lot
+      mem9loe = m9loe
+      mem9lof = m9lof
+
+      mem9hix = m9hix
+      mem9hiy = m9hiy
+      mem9hiz = m9hiz
+      mem9hit = m9hit
+      mem9hie = m9hie
+      mem9hif = m9hif
+
+      memreslox = m10lox
+      memresloy = m10loy
+      memresloz = m10loz
+      memreslot = m10lot
+      memresloe = m10loe
+      memreslof = m10lof
+
+      memreshix = m10hix
+      memreshiy = m10hiy
+      memreshiz = m10hiz
+      memreshit = m10hit
+      memreshie = m10hie
+      memreshif = m10hif
+
+      RETURN 
+      END
diff --git a/fer/efn/efcn_get_custom_axis.F b/fer/efn/efcn_get_custom_axis.F
new file mode 100644
index 0000000..d193854
--- /dev/null
+++ b/fer/efn/efcn_get_custom_axis.F
@@ -0,0 +1,56 @@
+c     
+c     efcn_get_custom_axis.F
+c     
+c     Jonathan Callahan
+c     Feb 19th 1998
+c     
+c     
+
+c     
+c     This subroutine allows an external function to create
+c     a custom axis.
+c     
+
+      SUBROUTINE EFCN_GET_CUSTOM_AXIS(id, axis, dlo, dhi, ddel,
+     .     unit, modulo_logical)
+
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.cmn'
+
+      INTEGER id, axis, modulo
+cc      REAL    lo, hi, del
+      REAL*8  dlo, dhi, ddel
+      CHARACTER*(*) unit
+      LOGICAL modulo_logical
+
+c     internal parameter declarations:
+      INTEGER      slen
+      PARAMETER  ( slen = ef_max_name_length )
+
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else 
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+      
+c     call the external functions library to get the value
+      
+      call efcn_get_custom_axis_sub( id, axis, dlo, dhi, ddel, 
+     .     fhol, modulo )
+      
+      modulo_logical = .FALSE.
+      IF ( modulo .EQ. 1 ) THEN
+         modulo_logical = .TRUE.
+      ENDIF
+
+c     convert to a Fortran string
+      call TM_CTOF_STRNG( fhol, unit, slen)
+
+c     convert to double
+cc      dlo = lo
+cc      dhi = hi
+cc      ddel = del
+      
+      RETURN 
+      END
diff --git a/fer/efn/efcn_get_workspace_addr.F b/fer/efn/efcn_get_workspace_addr.F
new file mode 100644
index 0000000..0d7bd5a
--- /dev/null
+++ b/fer/efn/efcn_get_workspace_addr.F
@@ -0,0 +1,29 @@
+c     
+c     efcn_get_workspace_addr.F
+c     
+c     Jonathan Callahan
+c     September 1998
+c     
+
+c     
+c     This subroutine is called by efcn_compute_ inside EF_ExternalUtil.c. 
+c     When workspace is requested by an external function it is created 
+c     inside of efcn_compute_ but efcn_compute_ doesn't know how to access
+c     variuos Ferret common areas.  (And I don't want to bother with
+c     the C/Fortran column major/row major stuff).  This subroutine accesses
+c     the common areas and passes back the appropriate address to efcn_compute_.
+c     
+
+      SUBROUTINE EFCN_GET_WORKSPACE_ADDR(memory, work_blk, workspace)
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xvariables.cmn'
+
+      INTEGER work_blk
+      REAL memory( mem_blk_size, max_mem_blks ), workspace
+
+      workspace = memory(work_blk, 1)
+
+      RETURN 
+      END
diff --git a/fer/efn/efcn_set_work_array_dims.F b/fer/efn/efcn_set_work_array_dims.F
new file mode 100644
index 0000000..94764c2
--- /dev/null
+++ b/fer/efn/efcn_set_work_array_dims.F
@@ -0,0 +1,206 @@
+c     
+c     efcn_set_work_array_dims.F
+c     
+c     Jonathan Callahan
+c     Sep 22nd 1998
+c     
+
+c     
+c     This subroutine is called by efcn_compute_ inside EF_ExternalUtil.c. 
+c     It sets all of the dimensioning information for the work spaces in 
+c     ef_mem_subsc.cmn.
+c     
+
+      SUBROUTINE EFCN_SET_WORK_ARRAY_DIMS(iarray, xlo, ylo, zlo, tlo,
+     .           elo, flo, xhi, yhi, zhi, thi, ehi, fhi)
+
+      INCLUDE 'EF_mem_subsc.cmn'
+
+      INTEGER iarray, xlo, ylo, zlo, tlo, elo, flo,
+     .                xhi, yhi, zhi, thi, ehi, fhi
+
+      IF (iarray .EQ. 1) THEN
+         wrk1lox = xlo
+         wrk1loy = ylo
+         wrk1loz = zlo
+         wrk1lot = tlo
+         wrk1loe = elo
+         wrk1lof = flo
+
+         wrk1hix = xhi
+         wrk1hiy = yhi
+         wrk1hiz = zhi
+         wrk1hit = thi
+         wrk1hie = ehi
+         wrk1hif = fhi
+
+      ELSE IF (iarray .EQ. 2) THEN
+         wrk2lox = xlo
+         wrk2loy = ylo
+         wrk2loz = zlo
+         wrk2lot = tlo
+         wrk2loe = elo
+         wrk2lof = flo
+
+         wrk2hix = xhi
+         wrk2hiy = yhi
+         wrk2hiz = zhi
+         wrk2hit = thi
+         wrk2hie = ehi
+         wrk2hif = fhi
+
+      ELSE IF (iarray .EQ. 3) THEN
+         wrk3lox = xlo
+         wrk3loy = ylo
+         wrk3loz = zlo
+         wrk3lot = tlo
+         wrk3loe = elo
+         wrk3lof = flo
+
+         wrk3hix = xhi
+         wrk3hiy = yhi
+         wrk3hiz = zhi
+         wrk3hit = thi
+         wrk3hie = ehi
+         wrk3hif = fhi
+
+      ELSE IF (iarray .EQ. 4) THEN
+         wrk4lox = xlo
+         wrk4loy = ylo
+         wrk4loz = zlo
+         wrk4lot = tlo
+         wrk4loe = elo
+         wrk4lof = flo
+
+         wrk4hix = xhi
+         wrk4hiy = yhi
+         wrk4hiz = zhi
+         wrk4hit = thi
+         wrk4hie = ehi
+         wrk4hif = fhi
+
+      ELSE IF (iarray .EQ. 5) THEN
+         wrk5lox = xlo
+         wrk5loy = ylo
+         wrk5loz = zlo
+         wrk5lot = tlo
+         wrk5loe = elo
+         wrk5lof = flo
+
+         wrk5hix = xhi
+         wrk5hiy = yhi
+         wrk5hiz = zhi
+         wrk5hit = thi
+         wrk5hie = ehi
+         wrk5hif = fhi
+
+      ELSE IF (iarray .EQ. 6) THEN
+         wrk6lox = xlo
+         wrk6loy = ylo
+         wrk6loz = zlo
+         wrk6lot = tlo
+         wrk6loe = elo
+         wrk6lof = flo
+
+         wrk6hix = xhi
+         wrk6hiy = yhi
+         wrk6hiz = zhi
+         wrk6hit = thi
+         wrk6hie = ehi
+         wrk6hif = fhi
+
+      ELSE IF (iarray .EQ. 7) THEN
+         wrk7lox = xlo
+         wrk7loy = ylo
+         wrk7loz = zlo
+         wrk7lot = tlo
+         wrk7loe = elo
+         wrk7lof = flo
+
+         wrk7hix = xhi
+         wrk7hiy = yhi
+         wrk7hiz = zhi
+         wrk7hit = thi
+         wrk7hie = ehi
+         wrk7hif = fhi
+
+      ELSE IF (iarray .EQ. 8) THEN
+         wrk8lox = xlo
+         wrk8loy = ylo
+         wrk8loz = zlo
+         wrk8lot = tlo
+         wrk8loe = elo
+         wrk8lof = flo
+
+         wrk8hix = xhi
+         wrk8hiy = yhi
+         wrk8hiz = zhi
+         wrk8hit = thi
+         wrk8hie = ehi
+         wrk8hif = fhi
+
+      ELSE IF (iarray .EQ. 9) THEN
+         wrk9lox = xlo
+         wrk9loy = ylo
+         wrk9loz = zlo
+         wrk9lot = tlo
+         wrk9loe = elo
+         wrk9lof = flo
+
+         wrk9hix = xhi
+         wrk9hiy = yhi
+         wrk9hiz = zhi
+         wrk9hit = thi
+         wrk9hie = ehi
+         wrk9hif = fhi
+
+      ELSE IF (iarray .EQ. 10) THEN
+         wrk10lox = xlo
+         wrk10loy = ylo
+         wrk10loz = zlo
+         wrk10lot = tlo
+         wrk10loe = elo
+         wrk10lof = flo
+
+         wrk10hix = xhi
+         wrk10hiy = yhi
+         wrk10hiz = zhi
+         wrk10hit = thi
+         wrk10hie = ehi
+         wrk10hif = fhi
+
+      ELSE IF (iarray .EQ. 11) THEN
+         wrk11lox = xlo
+         wrk11loy = ylo
+         wrk11loz = zlo
+         wrk11lot = tlo
+         wrk11loe = elo
+         wrk11lof = flo
+
+         wrk11hix = xhi
+         wrk11hiy = yhi
+         wrk11hiz = zhi
+         wrk11hit = thi
+         wrk11hie = ehi
+         wrk11hif = fhi
+
+      ELSE IF (iarray .EQ. 12) THEN
+         wrk12lox = xlo
+         wrk12loy = ylo
+         wrk12loz = zlo
+         wrk12lot = tlo
+         wrk12loe = elo
+         wrk12lof = flo
+
+         wrk12hix = xhi
+         wrk12hiy = yhi
+         wrk12hiz = zhi
+         wrk12hit = thi
+         wrk12hie = ehi
+         wrk12hif = fhi
+
+      END IF
+
+
+      RETURN 
+      END
diff --git a/fer/fmt/LIB_NAME b/fer/fmt/LIB_NAME
new file mode 100644
index 0000000..ed1aa7f
--- /dev/null
+++ b/fer/fmt/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libfmt.a 
diff --git a/fer/fmt/Makefile b/fer/fmt/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/fmt/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/fmt/SOURCE_FILES b/fer/fmt/SOURCE_FILES
new file mode 100644
index 0000000..fd7ca42
--- /dev/null
+++ b/fer/fmt/SOURCE_FILES
@@ -0,0 +1,39 @@
+SRCS_F = \
+alg_regrid_trans_titl.F\
+alg_trans_titl.F\
+ascii_limits.F\
+ax_title.F\
+clean_coord_string.F\
+compound_title.F\
+cx_dim_str.F\
+cx_size_str.F\
+date_prec.F\
+field_width.F\
+full_uvar_name.F\
+full_uvar_name_xml.F\
+full_var_title.F\
+geog_label.F\
+get_dset_name.F\
+get_dset_title.F\
+get_prec_digits.F\
+get_nc_offset.F\
+get_nc_scale.F\
+get_short_dset_name.F\
+get_sig_digits.F\
+get_user_offset.F\
+get_user_scale.F\
+lefint.F\
+left_just.F\
+left_real.F\
+lohi_string.F\
+lohi_world.F\
+paren_surround.F\
+replace_deq.F\
+row_coord_fmt.F\
+sanitary_var_code.F\
+translate_to_world.F\
+var_data_fmt.F\
+var_title.F\
+var_title_mod.F\
+var_trans.F\
+var_units.F 
diff --git a/fer/fmt/alg_regrid_trans_titl.F b/fer/fmt/alg_regrid_trans_titl.F
new file mode 100644
index 0000000..f325868
--- /dev/null
+++ b/fer/fmt/alg_regrid_trans_titl.F
@@ -0,0 +1,59 @@
+	CHARACTER*20 FUNCTION ALG_REGRID_TRANS_TITL( trans, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the title of the given regridding transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V690 *sh* 1/14 - to supput auxiliary variable regridding
+
+* calling argument declarations:
+	INTEGER	trans, cx
+
+* internal variable declarations:
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xalgebra.cmn'
+!	include 'xcontext.cmn'
+
+
+	ALG_REGRID_TRANS_TITL = alg_regrid_title(trans)
+	RETURN
+	END
diff --git a/fer/fmt/alg_trans_titl.F b/fer/fmt/alg_trans_titl.F
new file mode 100644
index 0000000..e2875a6
--- /dev/null
+++ b/fer/fmt/alg_trans_titl.F
@@ -0,0 +1,89 @@
+	CHARACTER*20 FUNCTION ALG_TRANS_TITL( trans, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the title of the given transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 4/28/87
+* V430: 7/96 if a 4D transformation then pre-pend the axes involved
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER	trans, cx
+
+* internal variable declarations:
+	INTEGER	i, i4d, ndim, tcode
+	CHARACTER prefix*5
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xalgebra.cmn'
+	include 'xcontext.cmn'
+
+* identify the code from known codes
+	DO 100 tcode = 1, num_transforms
+	   IF ( trans .EQ. alg_trans_num(tcode) )	GOTO 200
+ 100	CONTINUE
+
+* unknown code
+	ALG_TRANS_TITL = '???'
+	RETURN
+
+* is this a 4D transformation? If so, include axis prefix to the transformation
+ 200	DO 250 i4d = 1, num_4d_trans
+	   IF ( trans .EQ. alg_4d_trans(i4d) ) THEN
+	      prefix = ' '
+	      ndim = 0
+	      DO 240 i = 1, 4
+	         IF (cx_trans(i,cx) .EQ. trans) THEN
+	            ndim = ndim + 1
+	            prefix = prefix(:ndim)//ww_dim_name(i)
+	         ENDIF
+ 240	      CONTINUE
+	      ALG_TRANS_TITL = prefix(2:ndim+1)//alg_trans_title(tcode)(3:)
+	      RETURN
+	   ENDIF
+ 250	CONTINUE	
+
+* not a 4D transform -- simply return the text
+	ALG_TRANS_TITL = alg_trans_title(tcode)
+	RETURN
+	END
diff --git a/fer/fmt/ascii_limits.F b/fer/fmt/ascii_limits.F
new file mode 100644
index 0000000..fc57119
--- /dev/null
+++ b/fer/fmt/ascii_limits.F
@@ -0,0 +1,143 @@
+	SUBROUTINE ASCII_LIMITS ( cx, idim, string, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* produce a formatted string representing the space or time limits along the
+* specified axes within the specified context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/1/86
+* revision 0.1 - 1/9/87  - added trans_integrated
+* revision 0.2 - 4/28/87 - automated transformation comment using ALG_TRANS_TITL
+* revision 0.3 - 7/13/87 - removed axis_titles - squeezed out unnedded blanks
+* revision 0.4 - 9/10/87 - added "using nnn pts" for transformations w/ args
+* revision 0.5 - 9/26/87 - using routine LOHI_WORLD
+* revision 0.6 - 10/23/87- "using"-->"by" and nnn reduced to minimum digits
+* revision 0.7 - 3/25/88 - increased LOHI_WORLD size for date/time strings
+* V200:  1/12/90 - "of nnn" text string non-integer transform args
+* V430:  7/96 - pass cx to ALG_TRANS_TITL so it can document 4D transformations
+* v530  *acm* 3/01 - Show calendar name for alternative calendar types.
+* v570  *acm* 5/04 - When showing calendar, need  cal_id .LE. max_calendars, not .LT.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* v687  *acm* 3/14 Fix ticket 2149: TM_GET_CAL gets the calendar label from the T axis.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xalgebra.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* calling argument declarations:
+	INTEGER		cx, idim, slen
+	CHARACTER*(*)	string
+
+* local parameter declarations:
+	LOGICAL		full_precision
+	PARAMETER     ( full_precision = .TRUE. )
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR, TM_GET_CALENDAR_ID, 
+     .			max_len, len_trans, llen, trans, i,
+     .			grid, cal_id, len_cal
+	CHARACTER	ALG_TRANS_TITL*20, LOHI_WORLD*44, LEFINT*4, 
+     .			TM_FMT*10, TM_GET_CAL*32, TM_GET_F_CAL*32,
+     .			trans_title*40, cal_name*32
+	REAL		trans_arg
+
+* initialize
+	max_len	= LEN(string)
+	trans     = cx_trans( idim, cx )
+	trans_arg = cx_trans_arg( idim, cx )
+
+* not an applicable dimension ?
+	IF ( cx_lo_ww( idim, cx ) .EQ. unspecified_val8 ) THEN
+	   string     = ' N/A'
+	   slen = 4
+	   RETURN
+	ENDIF
+
+* put in lower/upper world coordinates
+	string = LOHI_WORLD( idim, cx, ' to ', full_precision, slen )
+	
+* transformation requiring comment ?
+	IF ( trans .NE. trans_no_transform ) THEN
+	   trans_title = ALG_TRANS_TITL( trans, cx )
+	   len_trans   = TM_LENSTR( trans_title )
+	   IF ( trans_arg .NE. bad_val4 ) THEN
+	      DO 100 i = 1, num_transforms
+ 100	      IF ( trans .EQ. alg_trans_num(i) ) GOTO 200
+	      STOP 'ASCII_LIMITS'
+ 200	      IF ( alg_trans_its_int(i) ) THEN
+* ... add "by nnn pts" squeezing "nnn" to minimum digits
+	         trans_title = trans_title(:len_trans)//' by '//
+     .			       LEFINT( INT(trans_arg), llen )
+	         len_trans = len_trans + 4 + llen
+	         trans_title = trans_title(1:len_trans)//' pts'
+	         len_trans = len_trans + 4
+	      ELSE
+* ... add "of nnn " in a nice format
+	         trans_title = trans_title(:len_trans)//' of '//
+     .			       TM_FMT( trans_arg, 4, 10, llen )
+	         len_trans = len_trans + 4 + llen
+	      ENDIF
+	   ENDIF
+	   string = string(1:slen)//' ('//trans_title(:len_trans)//')'	
+	   slen = MIN( max_len, slen+len_trans+3 )
+	ENDIF
+
+* calendar name requiring comment ?
+
+	IF ((idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. 
+     .      cx_lo_ww( idim, cx ) .NE. unspecified_val8 ) THEN
+
+	   grid = cx_grid(cx)
+	   IF (idim.EQ.t_dim) cal_name = TM_GET_CAL (grid)
+	   IF (idim.EQ.f_dim) cal_name = TM_GET_F_CAL (grid)
+	   cal_id = TM_GET_CALENDAR_ID (cal_name)
+	   IF (cal_id .GT. gregorian .AND. cal_id .LE. max_calendars) THEN
+	      len_cal = TM_LENSTR(cal_name)
+	      string =  string(1:slen)//' '//cal_name(:len_cal)
+	      slen = MIN( max_len, slen+len_cal+1 )
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/ax_title.F b/fer/fmt/ax_title.F
new file mode 100644
index 0000000..d9d7830
--- /dev/null
+++ b/fer/fmt/ax_title.F
@@ -0,0 +1,102 @@
+ 	CHARACTER*(*) FUNCTION AX_TITLE( idim, grid, len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* produce a title string with units suitable for an axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 8/25/88
+* V320: 12/19/94 - recognize millibars and decibars as special axes
+*		(kludge: use "m" for meters instead of exact unit string.
+*			This because of "METERS" in the old grid files around.)
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, grid, len
+	LOGICAL	GEOG_LABEL
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, i, line, ulen
+	CHARACTER*16 unit_name
+
+* check for program bug	! temp
+	IF ( grid .EQ. unspecified_int4 ) STOP 'no_grd_orient'
+
+	line = grid_line( idim, grid )
+
+	IF ( GEOG_LABEL( idim, grid ) ) THEN
+	   AX_TITLE = axis_title( idim )
+	   len = axis_title_len( idim )
+! special options for vertical axes - 12/19/94
+	   IF ( idim .EQ. z_dim ) THEN
+	      IF ( line_unit_code(line) .EQ. pun_millibars 
+     .        .OR. line_direction( line ) .EQ. 'DU'     ) THEN
+	         AX_TITLE = "HEIGHT"
+	         len = 6
+	      ENDIF
+	      IF ( line_unit_code(line) .EQ. pun_meters ) THEN
+	         unit_name = 'm'		! kludge for "METERS"
+	      ELSE
+	         unit_name = line_units(line)
+	      ENDIF
+	      ulen = TM_LENSTR1( unit_name )
+	      AX_TITLE = AX_TITLE(1:len)//' ('//unit_name(:ulen)//')'
+	      len = len + 3 + ulen
+	   ENDIF	      
+
+	ELSE
+	   AX_TITLE = ww_dim_name( idim )
+	   len = 1
+	   IF ( line .NE. mnormal .AND. line .NE. munknown ) THEN
+	      IF ( line_units(line) .NE. ' ' ) THEN
+	         ulen = TM_LENSTR1( line_units(line) )
+	         AX_TITLE = AX_TITLE(1:1)//' ('//line_units(line)(:ulen)//')'
+	         len = 4 + ulen
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/clean_coord_string.F b/fer/fmt/clean_coord_string.F
new file mode 100644
index 0000000..b4a59ee
--- /dev/null
+++ b/fer/fmt/clean_coord_string.F
@@ -0,0 +1,94 @@
+	SUBROUTINE CLEAN_COORD_STRING ( idim, string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* replace the blank in "dd-mmm-yyyy hh:mm:ss" with a colon
+* axe the time field from climatological dates: "dd-mmm      hh:mm" -> "dd-mmm"
+* replace 19E(379) with the unambiguous 379E
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V300:  8/27/93
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER idim
+	CHARACTER*(*) string
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR1, i, i0, slen
+
+	IF ( idim.EQ.y_dim .OR. idim.EQ.z_dim ) RETURN
+
+	slen = TM_LENSTR1( string )
+
+	IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+* FIX TIMES
+	   IF ( slen .LE. 11 ) RETURN   	! date, only - no time
+	   IF ( string(3:3) .NE. '-' ) RETURN	! not a date string
+
+	   IF ( string(9:9) .EQ. ' ' ) THEN
+* wipe out time on climatological dates
+	      DO 100 i = 7, slen
+	        string(i:i) = ' '
+ 100	      CONTINUE
+	   ELSE
+	     string(12:12) = ':'
+	   ENDIF
+
+	ELSE
+* FIX LONGITUDES
+	   i0 = INDEX( string, '(' )      ! e.g."19E(379)"
+	   IF ( i0 .GT. 0 ) THEN
+	      DO 200 i = i0+1, slen-1     ! --> "379(379)"
+ 200	      string(i-i0:i-i0) = string(i:i)
+	      DO 210 i = slen-i0, slen    ! --> "379     "
+ 210	      string(i:i) = ' '
+	      slen = slen-i0
+	      string(slen:slen) = 'E'     ! --> "379E"
+	   ENDIF
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/compound_title.F b/fer/fmt/compound_title.F
new file mode 100644
index 0000000..1668098
--- /dev/null
+++ b/fer/fmt/compound_title.F
@@ -0,0 +1,82 @@
+	CHARACTER*(*) FUNCTION COMPOUND_TITLE( cx_list, ncx, tlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a full title for a plot 
+* - possibly with more than one variable documented
+
+* support routines:
+*	VAR_TITLE	   - gets gets a simple title string for variable
+*			     eg. "TEMPERATURE"
+*	VAR_UNITS	   - gets a string with the units for this variable
+*	VAR_TITLE_MOD	   - gets a modification to the title string, if any
+*			     eg. "( averaged in X )"
+*	FULL_VAR_TITLE	   - VAR_TITLE//VAR_UNITS//VAR_TITLE_MOD with parens
+*			     eg. "TEMPERATURE ( averaged in X )"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   1/4/89 - from COMPOUND_PLOT_TITLE: major re-write without colors
+
+* calling argument declarations:
+	INTEGER	ncx, cx_list(ncx), tlen
+
+* internal variable declarations:
+	CHARACTER*200	FULL_VAR_TITLE
+	INTEGER		slen, maxlen, i
+
+	include 'ferret.parm'
+
+* maximum title length
+	maxlen = LEN( COMPOUND_TITLE )
+
+* initialize to the first variable context
+	COMPOUND_TITLE = FULL_VAR_TITLE( cx_list(1), tlen )
+
+* add any remaining variables separated by commas
+	DO 100 i = 2, ncx
+	   COMPOUND_TITLE = COMPOUND_TITLE(:tlen)//' , '//
+     .			    FULL_VAR_TITLE( cx_list(i), slen )
+	   tlen = MIN( maxlen, tlen+slen+3 )
+ 100	CONTINUE
+
+* in case it was too long give an indication
+	IF ( tlen .EQ. maxlen ) COMPOUND_TITLE(tlen:tlen) = '*'
+
+	RETURN
+	END
diff --git a/fer/fmt/cx_dim_str.F b/fer/fmt/cx_dim_str.F
new file mode 100644
index 0000000..2b47e5a
--- /dev/null
+++ b/fer/fmt/cx_dim_str.F
@@ -0,0 +1,134 @@
+	CHARACTER*(*) FUNCTION CX_DIM_STR( idim,cx,to_word,full_prec,slen )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string describing the region and transformation along an axis
+* for example: X=160E:140W at SBX:5
+* the argument full_prec ("full precision") indicates number of decimals for
+* world coordinates (see LOHI_WORLD) or skip/not skip leading integer 0's
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/26/87
+* V200:  5/19/89 - re-ordered _ss args
+*		 - changed LEFINT from *4 to *8
+*		 - allowed leading zeros as needed by size of cx_hi_ss
+* V230:  6/22/92 - if ss limits are unspec. then use world limits regardless
+*                  of cx_by_ss (needed for CDF_LIST documentation)
+*        8/18/92 - eliminated string(1:) notation for MAC compatibility
+* V533:  6/01 - allow for the possibility of negative subscripts
+* V600:  1/06 *acm*  prevent values of LOG10(0.0) 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	LOGICAL	full_prec
+	INTEGER	idim, cx, slen
+	CHARACTER*(*) to_word
+
+* local variable declarations:
+	CHARACTER LOHI_WORLD*44
+	INTEGER TM_LENSTR, llen, ndigits, cx_dim_str_len
+	CHARACTER ALG_TRANS_CODE*3, ARG_STRING*12, LEFINT*8, buff*8
+
+* initialize - put in "=" and blank out string
+        cx_dim_str_len = LEN( CX_DIM_STR )
+	CX_DIM_STR = '*='
+
+* create "lo_limit" or "lo:hi" in subscript or world coords
+
+* SUBSCRIPT NOTATION (I,J,K or L)
+* ( added ".AND. cx_lo_ss(cx,idim) ..." 6/22 *sh*)
+	IF ( cx_by_ss( idim, cx )
+     . .AND. cx_lo_ss(cx,idim) .NE. unspecified_int4 ) THEN
+	   CX_DIM_STR(1:1) = ss_dim_name( idim ) 
+* lo limit
+	   IF ( full_prec ) THEN
+* ... only the minimum number of digits needed - maximum readability
+	      CX_DIM_STR(3:cx_dim_str_len) =
+     .                               LEFINT( cx_lo_ss(cx,idim), slen )
+	      slen = slen + 2
+	   ELSE
+* ... uses leading zeros to ensure filenames generated automatically will colate
+	      CX_DIM_STR(3:cx_dim_str_len) = '0000000000000000'
+              IF (REAL(ABS(cx_hi_ss(cx,idim))) .NE. 0.) THEN
+	         ndigits = LOG10( REAL(ABS(cx_hi_ss(cx,idim))) ) + 1.00001
+              ELSE
+	         ndigits = 1.00001
+              ENDIF
+	      IF ( cx_hi_ss(cx,idim) .LT. 0 ) ndigits = ndigits + 1
+	      slen = 2 + ndigits	! right-most character
+	      buff = LEFINT( cx_lo_ss(cx,idim), llen )
+	      CX_DIM_STR(slen-llen+1:slen)=buff(:llen)
+	   ENDIF
+* hi limit - similar logic
+	   IF ( cx_hi_ss(cx,idim) .NE. cx_lo_ss(cx,idim) ) THEN
+	      slen = slen + 1
+	      CX_DIM_STR(slen:slen) = ':'	
+	      IF ( full_prec ) THEN
+	         CX_DIM_STR(slen+1:cx_dim_str_len) =
+     .                LEFINT(cx_hi_ss(cx,idim), llen)
+	         slen = slen + 1 + llen
+	      ELSE
+	         buff = LEFINT( cx_hi_ss(cx,idim), llen )
+	         slen = slen + ndigits
+	         CX_DIM_STR(slen-llen+1:slen)=buff(:llen)
+	      ENDIF
+	   ENDIF
+	   IF ( .NOT.full_prec ) CX_DIM_STR(slen+1:cx_dim_str_len)= ' '
+
+* WORLD COORDINATE NOTATION
+	ELSE
+	   CX_DIM_STR(1:1) = ww_dim_name( idim )
+	   CX_DIM_STR(3:cx_dim_str_len)  =
+     .                 LOHI_WORLD( idim, cx, ':', full_prec, slen )
+	   slen = slen + 2
+	ENDIF
+
+* transformation, if any ... "@ttt:n"
+	IF ( cx_trans( idim, cx ) .NE. trans_no_transform ) THEN
+	   CX_DIM_STR = CX_DIM_STR(1:slen) // '@' //
+     .				ALG_TRANS_CODE( cx_trans( idim, cx )) //
+     .				ARG_STRING( cx_trans_arg( idim, cx ))
+	   slen = TM_LENSTR( CX_DIM_STR )
+	ENDIF
+	
+	RETURN
+	END
diff --git a/fer/fmt/cx_size_str.F b/fer/fmt/cx_size_str.F
new file mode 100644
index 0000000..9373e1b
--- /dev/null
+++ b/fer/fmt/cx_size_str.F
@@ -0,0 +1,73 @@
+	CHARACTER*(*) FUNCTION CX_SIZE_STR( cx,listdims,slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string describing the size of a 4D or 6D region
+* for example: 160*100*27*12
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  8/28/92
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commands will not list info for E,F dimensions.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	cx, listdims, slen
+
+* local variable declarations:
+	INTEGER CX_DIM_LEN, TM_LENSTR, idim, axlen, llen
+	CHARACTER LEFINT*8
+
+* initialize with the X axis
+        axlen = CX_DIM_LEN ( x_dim, cx )
+	CX_SIZE_STR = LEFINT( axlen, slen )
+
+* loop through the other dimensions
+        DO 100 idim = 2, listdims
+           axlen = CX_DIM_LEN ( idim, cx )
+           CX_SIZE_STR = CX_SIZE_STR(1:slen)//'*'//LEFINT( axlen, llen )
+           slen = TM_LENSTR( CX_SIZE_STR )
+ 100    CONTINUE
+
+	RETURN
+	END
diff --git a/fer/fmt/date_prec.F b/fer/fmt/date_prec.F
new file mode 100644
index 0000000..9c70e4b
--- /dev/null
+++ b/fer/fmt/date_prec.F
@@ -0,0 +1,82 @@
+	INTEGER FUNCTION DATE_PREC( grid, idim, dt )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the precision level needed for a date string to resolve "dt"
+* in units appropriate for the given grid time axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/18/88
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	REAL	dt
+
+* internal variable declarations:
+	INTEGER	i
+	REAL	convert(5), delta
+	DATA	convert(1)/ 60. /,	! sec --> min
+     .		convert(2)/ 60. /,	! min --> hour
+     .		convert(3)/ 24. /,	! hr  --> day
+     .		convert(4)/ 30. /,	! day --> mon
+     .		convert(5)/ 12. /	! mon --> year
+
+* get the dt interval expressed in seconds
+	delta = dt * line_tunit( grid_line(idim,grid) )
+
+* see how big it is
+	DO 100 i = 1, 5
+	   delta = delta / convert(i)
+	   IF ( delta .LT. 1.0 ) THEN
+	      DATE_PREC = 7-i
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* very big ! use years, only to label
+	DATE_PREC = 1
+	RETURN
+	END
diff --git a/fer/fmt/field_width.F b/fer/fmt/field_width.F
new file mode 100644
index 0000000..16cef21
--- /dev/null
+++ b/fer/fmt/field_width.F
@@ -0,0 +1,112 @@
+	INTEGER FUNCTION FIELD_WIDTH( val, grid, idim, ndec, numbers )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the width of field needed to write out value "val" in a formatting
+* style appropriate to axis "idim" of grid "grid" with ndec decimal points
+* also return the number of characters needed exclusive of the extra formatting
+* ("numbers")
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/18/88
+* 10/2/95 - bug fix:  date string was using ndec instead of ABS(dec) for
+*			determining field width
+* V600  1/06 *acm*  prevent values of LOG10(0.0) 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER	grid, idim, ndec, numbers
+	REAL*8	val
+
+* internal variable declarations:
+	LOGICAL	GEOG_LABEL, fancy
+	INTEGER	decim, left
+	REAL	fval
+
+* initialize
+	fancy = GEOG_LABEL( idim, grid )	! special axis formatting
+	decim = ABS( ndec )
+	IF ( decim .GT. 0 ) decim = decim + 1	! allow room for decimal pt.
+	fval = val
+
+* get actual numerical value to format if different from given
+	IF ( fancy ) THEN
+	   IF (idim.EQ.t_dim .OR. idim.EQ.f_dim) THEN
+	      FIELD_WIDTH = date_str_len( MAX( 1, MIN(6,ABS(ndec)) ) )	! 10/95
+	      RETURN
+	   ELSEIF ( idim .EQ. x_dim .AND. fval .GT. 180.0 ) THEN
+	      fval = 360. - val
+	   ELSEIF ( idim .EQ. y_dim .AND. fval .LT. 0.0   ) THEN	
+	      fval = -fval
+	   ENDIF
+	ENDIF
+
+* digits to left of decimal
+	IF ( ABS(fval) .LT. 10.0 ) THEN
+	   left = 1
+	ELSE
+	   left = LOG10( ABS(fval) ) + 1
+           IF (fval .EQ. 0) left = 1
+	ENDIF
+	IF ( fval .LT. 0.0 ) left = left + 1	! minus sign
+
+* numeric field width
+	numbers = left + decim
+
+* total field width
+	IF ( fancy ) THEN
+	   IF ( idim .EQ. x_dim .AND. fval .EQ. 180.0
+     .	       .OR. idim .EQ. y_dim .AND. fval .EQ. 0.0	  ) THEN
+	      FIELD_WIDTH = numbers
+	   ELSE
+	      FIELD_WIDTH = numbers + 1	! "E","N", etc. 
+	   ENDIF
+
+	ELSE
+	   FIELD_WIDTH = numbers
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/full_uvar_name.F b/fer/fmt/full_uvar_name.F
new file mode 100644
index 0000000..0e5a895
--- /dev/null
+++ b/fer/fmt/full_uvar_name.F
@@ -0,0 +1,81 @@
+	CHARACTER*(*) FUNCTION FULL_UVAR_NAME(uvar, len)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* append to the given user variable name the data set information
+*	var[D=dset_name]
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V402:
+* V420:  4/96 - document "(/D default)" on pdset_irrelevant variables
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER	uvar
+
+* local variable declarations:
+	INTEGER TM_LENSTR1, len, len2
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* variable name and definition
+*	len = TM_LENSTR1(uvar_name_code(uvar))
+        CALL string_array_get_strlen1(uvar_name_code_head,uvar,len)
+	FULL_UVAR_NAME = uvar_name_code(uvar)(:len)
+	IF (uvar_dset(uvar) .GT. pdset_irrelevant) THEN
+	   len2 = TM_LENSTR1(ds_name(uvar_dset(uvar)))
+	   FULL_UVAR_NAME = FULL_UVAR_NAME(:len)//'[D='//
+     .			ds_name(uvar_dset(uvar))(:len2)//']'
+	   len = len + len2 + 4
+	ELSEIF (uvar_dset(uvar) .EQ. pdset_irrelevant) THEN
+	   FULL_UVAR_NAME = FULL_UVAR_NAME(:len)//' (/D default)'
+	   len = len + 13
+	ENDIF
+	IF (uvar_remote(uvar)) THEN
+	   FULL_UVAR_NAME = FULL_UVAR_NAME(:len)//' (/REMOTE)'
+	   len = len + 10
+	ENDIF
+
+	RETURN
+	END
+
+
diff --git a/fer/fmt/full_uvar_name_xml.F b/fer/fmt/full_uvar_name_xml.F
new file mode 100644
index 0000000..bd165c9
--- /dev/null
+++ b/fer/fmt/full_uvar_name_xml.F
@@ -0,0 +1,77 @@
+	CHARACTER*(*) FUNCTION FULL_UVAR_NAME_XML(uvar, len)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* append to the given user variable name the data set information
+*	var[D=dset_name]  
+* For xml output give the full URL.
+
+* programmer - Ansley Manke
+*             from FULL_UVAR_NAME
+
+* V 6.66
+
+* calling argument declarations:
+	INTEGER	uvar
+
+* local variable declarations:
+	INTEGER TM_LENSTR1, len, len2
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* variable name and definition
+*	len = TM_LENSTR1(uvar_name_code(uvar))
+        CALL string_array_get_strlen1(uvar_name_code_head,uvar,len)
+	FULL_UVAR_NAME_XML = uvar_name_code(uvar)(:len)
+	IF (uvar_dset(uvar) .GT. pdset_irrelevant) THEN
+	   len2 = TM_LENSTR1(ds_des_name(uvar_dset(uvar)))
+	   FULL_UVAR_NAME_XML = FULL_UVAR_NAME_XML(:len)//'[D='//
+     .			ds_des_name(uvar_dset(uvar))(:len2)//']'
+	   len = len + len2 + 4
+	ELSEIF (uvar_dset(uvar) .EQ. pdset_irrelevant) THEN
+	   FULL_UVAR_NAME_XML = FULL_UVAR_NAME_XML(:len)//
+     .			' (/D default)'
+	   len = len + 13
+	ENDIF
+
+	RETURN
+	END
+
+
diff --git a/fer/fmt/full_var_title.F b/fer/fmt/full_var_title.F
new file mode 100644
index 0000000..e73266f
--- /dev/null
+++ b/fer/fmt/full_var_title.F
@@ -0,0 +1,86 @@
+	CHARACTER*(*) FUNCTION FULL_VAR_TITLE( cx, tlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a title for a memory variable including:
+* i)   the variable's title, 
+* ii)  modifications to the title ( either mods given as a part of the name or
+*      remarks about transformations performed on the variable )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/12/87
+* revision 0.1 - 8/29/87 - added parend around title mod
+* revision 0.2 - 4/11/88 - added units
+* V200:   1/3/89 - mr --> cx
+* V500: *kob* 3/99 - up VAR_UNITS from 32 to 64 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+
+* calling argument declarations:
+	INTEGER	cx, tlen
+
+* internal variable declarations:
+	CHARACTER*200	VAR_TITLE, VAR_TITLE_MOD, PAREN_SURROUND
+	CHARACTER	VAR_UNITS*64
+	INTEGER		TM_LENSTR1, maxlen, slen
+
+	include 'ferret.parm'
+
+* initialize
+	maxlen	= LEN( FULL_VAR_TITLE )
+
+* title
+	FULL_VAR_TITLE = VAR_TITLE( cx )
+	tlen	       = TM_LENSTR1( FULL_VAR_TITLE )
+
+* units
+	FULL_VAR_TITLE = FULL_VAR_TITLE(:tlen) // ' ' //
+     .		PAREN_SURROUND( VAR_UNITS(cx), slen )
+	tlen = MIN( maxlen, tlen+1+slen)
+
+* mods to title
+	FULL_VAR_TITLE = FULL_VAR_TITLE(:tlen) //
+     .		PAREN_SURROUND( VAR_TITLE_MOD(cx), slen )
+
+* if it wont fit indicate that with a "*" at the end
+	tlen = MIN( maxlen, tlen+slen )
+	IF ( tlen .EQ. maxlen ) FULL_VAR_TITLE(maxlen:maxlen) = '*'
+
+	RETURN
+	END
diff --git a/fer/fmt/geog_label.F b/fer/fmt/geog_label.F
new file mode 100644
index 0000000..2303990
--- /dev/null
+++ b/fer/fmt/geog_label.F
@@ -0,0 +1,119 @@
+	LOGICAL FUNCTION GEOG_LABEL( idim, grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular axis of a grid represents geographical
+* locations (lat.,long., etc.) requiring special label formatting
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/25/88
+* V230: 4/92 *sh*  only return .TRUE. for time axis if t0_date is valid
+*       7/92 - use TM_DATE_OK for this
+*            - vertical axis requires meters units AND UD orientation
+* V320: 12/19/94 - recognize millibars and decibars as special axes
+* v491: 2/23/98 *kob* - add check for undefined axis which can cause
+*                       a crash if REPEAT command doesn't have fully 
+*                       mature context to work with.
+* V530: *acm* 12/00 alternative calendar types; cal_id
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  Allow for F to be a time axis.
+
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+        include 'tmap_errors.parm'
+	external xgt_grid_data
+        include 'xunits.cmn_text'
+        external xunits_data
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER		idim, grid
+
+* internal variable declarations:
+        LOGICAL         TM_DATE_OK
+	INTEGER		TM_GET_CALENDAR_ID, cal_id, i, line
+	CHARACTER*2	line_code
+
+* check for program bug	! temp
+	IF ( grid .EQ. unspecified_int4 ) STOP 'no_grd_orient'
+
+* see if labeling modes are disabled, first
+	IF ( .NOT.ax_fmt(idim) ) THEN
+	   GEOG_LABEL = .FALSE.
+           RETURN
+	ENDIF
+
+* initialize
+	line = grid_line( idim, grid )
+* 2/98 *kob* add check for undefined axis 
+	IF ( line .EQ. mnormal .OR. line .EQ. munknown 
+     .         .OR. line .EQ. unspecified_int4) THEN
+	   GEOG_LABEL = .FALSE.
+	   RETURN
+	ELSE
+	   line_code = line_direction( line )
+	ENDIF
+
+* the use of line_direction is kludgy
+* (it combines orientation, reversal, and formatting in an inadequate way)
+        IF ( idim .LE. 2 ) THEN
+           GEOG_LABEL = line_code .EQ. axis_orients(idim)
+        ELSEIF ( idim .EQ. z_dim ) THEN
+* for Z also insist on units of m because DU/UD is used to indicate reversal
+           GEOG_LABEL =((line_code .EQ. 'UD'
+     .            .AND. line_unit_code(line) .EQ. pun_meters)
+     .    .OR.		(line_code .EQ. 'UD'
+     .		   .AND. line_unit_code(line) .EQ. pun_millibars)
+     .    .OR.		(line_code .EQ. 'UD'
+     .		   .AND. line_unit_code(line) .EQ. pun_decibars) )
+        ELSE
+*  4/92 addition:  check for valid time axis T0
+
+*  1/01 addition: cal_id
+           cal_id = TM_GET_CALENDAR_ID (line_cal_name(line))
+           GEOG_LABEL = (line_code.EQ.'TI' .OR. line_code.EQ.'FI')
+     .            .AND. TM_DATE_OK( line_t0(line), cal_id )
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_dset_name.F b/fer/fmt/get_dset_name.F
new file mode 100644
index 0000000..da8493e
--- /dev/null
+++ b/fer/fmt/get_dset_name.F
@@ -0,0 +1,88 @@
+	SUBROUTINE GET_DSET_NAME( dset_num, name, len_text )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the name of the given data set if that is meaningful
+* else get a string describing the nature of the name 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200	  1/4/89 - from GET_1_DSET_NAME: 
+*		 - eliminated the possibility of multiple data set variables
+* Unix/RISC port 5/91 *sh*: use ds_des_name; right justify long data set paths
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		dset_num, len_text
+	CHARACTER*(*)	name
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR1, len_name
+
+* initialize
+	len_name  = LEN( name )
+
+* consider the options
+* 11/02 *kob* Also need to make sure that dset_num isn't undefined
+	IF     ( dset_num .EQ. pdset_irrelevant	.OR. 
+     .              dset_num .EQ. unspecified_int4)	THEN	! no name
+	   name(1:len_name) = 'N/A'
+	   len_text = 3
+
+	ELSE
+	   len_text = TM_LENSTR1( ds_des_name( dset_num ) )
+           IF ( len_text .GT. len_name ) THEN
+* ... too long to fit
+              name = ds_des_name(dset_num)(len_text-len_name+1:)
+              len_text = len_name
+           ELSE
+              name = ds_des_name( dset_num )
+           ENDIF
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_dset_title.F b/fer/fmt/get_dset_title.F
new file mode 100644
index 0000000..07b9a0e
--- /dev/null
+++ b/fer/fmt/get_dset_title.F
@@ -0,0 +1,68 @@
+	SUBROUTINE GET_DSET_TITLE( dset, title, len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the title of the given data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 12/19/89 - simplified from GET_1_DSET_TITLE
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*                         because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		dset, len, TM_LENSTR1
+	CHARACTER*(*)	title
+
+	   IF ( dset .EQ. pdset_irrelevant ) THEN
+	      title = ' '
+	      len = 1
+	   ELSE
+* ... title line from descriptor file
+	      title = ds_title( dset )
+	      len   = TM_LENSTR1( title )
+	   ENDIF
+	RETURN
+	END
diff --git a/fer/fmt/get_nc_offset.F b/fer/fmt/get_nc_offset.F
new file mode 100644
index 0000000..bd17450
--- /dev/null
+++ b/fer/fmt/get_nc_offset.F
@@ -0,0 +1,61 @@
+	SUBROUTINE GET_NC_OFFSET( cx, offset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the add_offset NetCDF file attribute for the given variable
+* 
+* V5.52 *ACM* 4/24/03
+
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xdset_info.cd_equiv'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+	INTEGER cx
+	REAL    offset
+
+	IF     ( cx_category( cx ) .EQ. cat_file_var ) THEN
+	   offset = cd_add_offset( cx_variable( cx ) )
+	ELSE
+	   offset = 0.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_nc_scale.F b/fer/fmt/get_nc_scale.F
new file mode 100644
index 0000000..4580c58
--- /dev/null
+++ b/fer/fmt/get_nc_scale.F
@@ -0,0 +1,62 @@
+	SUBROUTINE GET_NC_SCALE( cx, scalefac )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the scalefactor NetCDF file attribute for the given variable
+* 
+* V5.52 *ACM* 4/24/03
+
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xdset_info.cd_equiv'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+	INTEGER cx
+	REAL scalefac
+
+
+	IF     ( cx_category( cx ) .EQ. cat_file_var ) THEN
+	   scalefac = cd_scale_factor( cx_variable( cx ) )
+	ELSE
+	   scalefac = 1.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_prec_digits.F b/fer/fmt/get_prec_digits.F
new file mode 100644
index 0000000..37f2b47
--- /dev/null
+++ b/fer/fmt/get_prec_digits.F
@@ -0,0 +1,102 @@
+	SUBROUTINE GET_PREC_DIGITS( lo_val, hi_val, small_val, places, right )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of characters and the number of decimal places needed
+* to represent the range of data from lo_val to hi_val with precision small_val
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/18/87
+* revision 0.1 - 7/21/88  - eliminated LOG(0) error in big_10 calculation
+* V580 *acm* 12/04 Fix bug 1129; formatting axis for small lon/lat ranges
+*                  Note this changes some LIST output by removing a space.
+* V600:  1/06 *acm*  prevent values of LOG10(0.0) if small_val = 0 
+
+
+* calling argument declarations:
+	INTEGER		places, right
+	REAL		small_val
+	REAL*8		lo_val, hi_val
+
+* internal variable declarations:
+	INTEGER		big_10, left
+	REAL		big
+
+*  left	 - number of digits needed left of decimal
+*  right - number of digits needed right of decimal
+
+* decimal places to resolve small_val
+	IF ( small_val .GE. 1.0 ) THEN
+	   right = 0
+	ELSE IF (small_val .EQ. 0.) THEN
+           right = 1
+        ELSE
+	   right = 1 - INT( LOG10(small_val) )
+
+* Change the rounding; if small_val is exactly a power of 10, 
+* computtation just abvoe is incorrect. Say if small_val is 0.01, 
+* then the computation of right says that 3 digits to the right 
+* needed; should be 2.
+           IF (INT( LOG10(small_val) ) .EQ. LOG10(small_val) )
+     .        right = right - 1
+	ENDIF
+
+* integer places to represent the largest label
+	big = MAX( ABS(hi_val), ABS(lo_val) )
+	IF ( big .EQ. 0 ) THEN
+	   left = 1
+	ELSE
+	   big_10  = INT( LOG10( 1.01*big ) )
+	   IF ( big_10 .GT. 0 ) THEN
+	      left = big_10 + 1
+	   ELSE
+	      left = 1			! 0.xxx
+	   ENDIF
+	   IF ( lo_val .LT. 0 ) left = left + 1	! minus sign
+	ENDIF
+
+* total places
+	IF ( right .EQ. 0 ) THEN
+	   places = left		! xxxx
+	ELSE
+	   places = left + 1 + right	! xx.xxx
+	ENDIF
+
+	RETURN
+      END
diff --git a/fer/fmt/get_short_dset_name.F b/fer/fmt/get_short_dset_name.F
new file mode 100644
index 0000000..04881f1
--- /dev/null
+++ b/fer/fmt/get_short_dset_name.F
@@ -0,0 +1,105 @@
+	SUBROUTINE GET_SHORT_DSET_NAME( dset, name, len_text )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the name, only - not the full path) of the given data set
+* if that is meaningful
+* else get a string describing the nature of the name 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* Unix/RISC port 5/2/91 *sh*: based on GET_DSET_NAME
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V510: *sh* 3/00 - IRI Web server trap - if "dods" is the dset name then
+*		give long version 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		dset, len_text
+	CHARACTER*(*)	name
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR1, max_len_out, i1, slash
+
+* internal parameter declarations
+	INTEGER arb_outmax
+	PARAMETER (arb_outmax = 40)	! limit DODS output len
+
+* initialize
+	max_len_out  = LEN( name )
+
+* consider the options
+	IF     ( dset .EQ. pdset_irrelevant	)	THEN	! no name
+	   name  = 'N/A'
+	   len_text = 3
+
+	ELSE
+	   len_text = TM_LENSTR1( ds_name( dset ) )
+           IF ( len_text .GT. max_len_out ) THEN
+* ... too long to fit
+              name = ds_name(dset)(len_text-max_len_out+1:)
+              len_text = max_len_out
+	   ELSEIF ( ds_name(dset) .EQ. 'dods'
+     .	    .AND.   ds_des_name(dset)(1:7) .EQ. 'http://' ) THEN
+	      len_text = TM_LENSTR1(ds_des_name(dset))
+* ... find start of IRI name as in "http://ip.address/directory/name/dods"
+	      slash = INDEX(ds_des_name(dset)(8:),'/')
+	      slash = 8 + slash + INDEX(ds_des_name(dset)(8+slash:),'/')
+	      IF (slash .GT. 0 ) THEN
+	         i1 = slash + 1
+	      ELSE
+	         i1 = MAX(1,len_text-max_len_out+1)
+	         i1 = MIN(i1,arb_outmax)
+	      ENDIF
+              name = ds_des_name(dset)(i1:len_text)
+              len_text = len_text - i1 + 1
+           ELSE
+              name = ds_name( dset )
+           ENDIF
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_sig_digits.F b/fer/fmt/get_sig_digits.F
new file mode 100644
index 0000000..2698d2e
--- /dev/null
+++ b/fer/fmt/get_sig_digits.F
@@ -0,0 +1,67 @@
+	SUBROUTINE GET_SIG_DIGITS ( value, nsig_digits, nleft, nright )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine how many digits are needed left and right of decimal point to
+* represent "value" with nsig_digits significant digits
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/2/86
+
+* calling argument declarations:
+	INTEGER	nsig_digits, nleft, nright
+	REAL	value
+
+* internal variable declarations:
+	REAL	point
+	INTEGER	ipoint
+
+	IF ( value .EQ. 0.0 ) THEN
+	   point = -0.1					! like value = 0.1
+	ELSE
+	   point  = LOG10( ABS(value) )
+	ENDIF
+	IF ( point .LT. 0.0 ) point = point - 1.0	! to round down
+	ipoint = INT( point ) + 1
+
+	nleft  = MAX( 0, ipoint )
+	nright = MAX( 0, nsig_digits-ipoint )
+
+	RETURN
+	END
diff --git a/fer/fmt/get_user_offset.F b/fer/fmt/get_user_offset.F
new file mode 100644
index 0000000..0e373ed
--- /dev/null
+++ b/fer/fmt/get_user_offset.F
@@ -0,0 +1,60 @@
+	SUBROUTINE GET_USER_OFFSET( cx, useroff )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the useroff set by a SET VAR/useroff=  command for the given variable
+* 
+* V5.52 *ACM* 4/24/03
+
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+	INTEGER cx
+	REAL    useroff
+
+	IF     ( cx_category( cx ) .EQ. cat_file_var ) THEN
+	   useroff = ds_var_off( cx_variable( cx ) )
+	ELSE
+	   useroff = 0.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/get_user_scale.F b/fer/fmt/get_user_scale.F
new file mode 100644
index 0000000..f0d62c3
--- /dev/null
+++ b/fer/fmt/get_user_scale.F
@@ -0,0 +1,61 @@
+	SUBROUTINE GET_USER_SCALE( cx, userfac )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the scale factor set by a SET VAR/SCALE=  command for the given variable
+* 
+* V5.52 *ACM* 4/24/03
+
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+	INTEGER cx
+	REAL userfac
+
+
+	IF     ( cx_category( cx ) .EQ. cat_file_var ) THEN
+	   userfac = ds_var_scale( cx_variable( cx ) )
+	ELSE
+	   userfac = 1.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/lefint.F b/fer/fmt/lefint.F
new file mode 100644
index 0000000..3b5d17a
--- /dev/null
+++ b/fer/fmt/lefint.F
@@ -0,0 +1,76 @@
+	CHARACTER*(*) FUNCTION LEFINT( ival, llen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a left-justified integer string from ival
+* typical usage:
+* i) declare length of function in calling routine 
+*	eg. CHARACTER*8 LEFINT
+* ii) use as a character variable
+*	eg. WRITE( 20,'(1X,A)') LEFINT( j )
+
+* note: no error checking is done to see that ival will fit into the declared
+*	field width of LEFINT.  The integer will be truncated on the right
+*	if the field is too small resulting in erroneous output.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written in transportable FORTRAN 77
+
+* revision 0.0 - 6/30/87
+* revision 0.1 - 9/28/87 - added llen
+
+* calling argument declarations:
+	INTEGER	ival, llen
+
+* internal variable declarations:
+	CHARACTER*16 buff16
+	INTEGER	     first
+
+* create right-justified string of up to 16 digits
+	WRITE ( buff16, '(I16)' ) ival
+
+* find left-most non-blank
+	DO 100 first = 1, 15
+	   IF ( buff16(first:first) .NE. ' ' ) GOTO 200
+ 100	CONTINUE
+	first = 16
+
+* insert left-justified string
+ 200	LEFINT = buff16(first:16)
+	llen   = 17 - first
+	RETURN
+	END
diff --git a/fer/fmt/left_just.F b/fer/fmt/left_just.F
new file mode 100644
index 0000000..15fae94
--- /dev/null
+++ b/fer/fmt/left_just.F
@@ -0,0 +1,85 @@
+	SUBROUTINE LEFT_JUST( source, dest, tlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* left justify a source string into a dest blank-filling the remainder
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written in transportable FORTRAN 77
+
+* revision 0.0 - 7/13/87
+* revision 0.1 - 8/21/88 - returned length is measured to last non-blank
+* V510 *sh* 3/00 - skip leading tabs as well as blanks
+* 1/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use and octal initialization instead
+
+
+* calling argument declarations:
+	CHARACTER*(*) source, dest
+	INTEGER	tlen
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, slen, dlen, first
+
+* internal parameter declarations
+	CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* how long are the strings ?
+	slen = LEN( source )
+	dlen = LEN( dest   )
+
+* find left-most non-blank
+	DO 100 first = 1, slen
+	   IF ( source(first:first) .NE. ' '
+     .	  .AND. source(first:first) .NE. tab ) GOTO 200
+ 100	CONTINUE
+	first = slen
+
+* insert left-justified string
+ 200	dest = source( first:slen )
+
+* measure its length
+	tlen = TM_LENSTR1( dest )
+
+	RETURN
+
+	END
diff --git a/fer/fmt/left_real.F b/fer/fmt/left_real.F
new file mode 100644
index 0000000..e4102da
--- /dev/null
+++ b/fer/fmt/left_real.F
@@ -0,0 +1,84 @@
+	CHARACTER*(*) FUNCTION LEFT_REAL( val, fmt, len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a left-justified real string from val with format fmt
+* typical usage:
+* i) declare length of function in calling routine 
+*	eg. CHARACTER*8 LEFT_REAL
+* ii) use as a character variable
+*	eg. WRITE( 20,'(1X,A)') LEFT_REAL( x, 2, len )
+
+* note: if value cannot fit within field '****' will be inserted
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written in transportable FORTRAN 77
+
+* revision 0.0 - 7/13/87 modeled after LEFINT rev. 0.0
+
+* calling argument declarations:
+	REAL	val
+	CHARACTER*(*) fmt
+	INTEGER	len
+
+* internal variable declarations:
+	CHARACTER*16 buff16
+	INTEGER	     first
+
+* create right-justified string of up to 16 digits
+	WRITE ( buff16, fmt ) val
+
+* find left-most non-blank
+	DO 100 first = 1, 15
+	   IF ( buff16(first:first) .NE. ' ' ) GOTO 200
+ 100	CONTINUE
+	first = 16
+
+* insert left-justified string
+ 200	LEFT_REAL = buff16(first:16)
+
+* measure its length
+	DO 300 len = 0, 15
+	   IF ( LEFT_REAL( len+1:len+1 ) .EQ. ' ' ) RETURN
+ 300	CONTINUE
+
+* error - didn't fit
+	LEFT_REAL = '****'
+	len = 4
+	RETURN
+
+	END
diff --git a/fer/fmt/lohi_string.F b/fer/fmt/lohi_string.F
new file mode 100644
index 0000000..b15fa12
--- /dev/null
+++ b/fer/fmt/lohi_string.F
@@ -0,0 +1,87 @@
+	CHARACTER*(*) FUNCTION LOHI_STRING( lo,hi,idim,grid,
+     .                                      to_word,ndec,slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string describing a world coordinate range
+* for example: 160E:140W or 10m (if lo depth = hi)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  1/10/89 - extracted from LOHI_WORLD 0.3
+* V200:  2/27/90 - allowed unspecified limits as "???"
+* V230:  2/10/92 - SUN port: must use a temporary string, strbuf, instead of
+*                  routine name LOHI_STRING internally.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'ferret.parm'
+
+* calling argument declarations
+	INTEGER	idim, grid, ndec, slen
+	CHARACTER*(*) to_word
+	REAL*8	lo, hi
+
+* internal variable declarations:
+	INTEGER	sub_len, full_len
+        CHARACTER*80 strbuf       ! needed for SUN FORTRAN
+
+* initialize
+	full_len = LEN( LOHI_STRING )
+	strbuf = ' '
+
+* always put in lower limit
+	IF ( lo .NE. unspecified_val8 ) THEN
+	   CALL TRANSLATE_TO_WORLD( lo, idim, grid, ndec, strbuf )
+	ELSE
+	   strbuf = '???'
+	ENDIF
+	CALL LEFT_JUST( strbuf, strbuf, slen )
+
+* put in upper limit if different from lower
+	IF ( hi .NE. lo ) THEN
+	   strbuf = strbuf(:slen) // to_word	! either " to " or ":"
+	   slen = MIN( full_len, slen + LEN(to_word) + 1 )
+	   CALL TRANSLATE_TO_WORLD( hi, idim, grid, ndec, strbuf(slen:) )
+	   CALL LEFT_JUST( strbuf(slen:), strbuf(slen:), sub_len )
+           slen = MIN( full_len, slen + sub_len - 1 )
+	ENDIF
+	
+        LOHI_STRING = strbuf
+
+	RETURN
+	END
diff --git a/fer/fmt/lohi_world.F b/fer/fmt/lohi_world.F
new file mode 100644
index 0000000..440823a
--- /dev/null
+++ b/fer/fmt/lohi_world.F
@@ -0,0 +1,142 @@
+	CHARACTER*(*) FUNCTION LOHI_WORLD( idim,cx,to_word,full_prec,slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string describing the world coordinate boundaries along an axis
+* for example: 160E:140W or 10m (if lo depth = hi)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/26/87
+* revision 0.1 - 2/25/88 - changed TRANSLATE_TO_WORLD call to allow non-lat/long
+*			   formatting.
+* revision 0.2 - 3/25/88 - number of decimals set in SET MODE command
+*			   and possibly reverse ordering of time limits since
+*			   stored times may be tsteps (for a particular T axis)
+*			   or -1*(secs_from_BC)  (independent of partic. axis)
+* revision 0.3 - 8/12/88 - negative times not converted to time steps
+* revision 1.0 -  1/10/89- split off actual string creation into LOHI_STRING
+* V200:  5/19/89 - 4D symmetrical - point limits have ww coords at box edges 
+*	 3/22/90 - for cx.LE.cx_last use last successful grid
+*	 9/11/90 - corrected bug: IF test treated cx_buff as a stored region
+* V300:   2/3/93 - the 9/11/90 bug fix prevents the default region for being
+*                  formatted
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V690 *sh* 1/14 - added kludge to display limits from aux var regrid by avg
+*	e.g. gz(depth)=0:100 at ave
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'		! added 3/90
+	include 'xfr_grid.cmn'		! added 3/90
+
+
+* calling argument declarations
+	LOGICAL	full_prec
+	INTEGER	idim, cx, slen
+	CHARACTER*(*) to_word
+
+* internal variable declarations:
+	LOGICAL	aux_span_compress
+	INTEGER	sub_len, ndec, grid, status, cx_try
+	REAL*8	TM_WORLD, bc_to_t0, lo, hi, temp
+	CHARACTER*40	LOHI_STRING
+
+* initialize
+	IF (cx .GE. 1) THEN
+	   aux_span_compress = cx_unstand_grid(cx)
+     .			 .AND. cx_regrid_trans(idim,cx) .EQ. pauxrgrd_pwlave
+	ELSE
+	   aux_span_compress = .FALSE.
+	ENDIF
+
+* grid number is used to determine formatting option
+* ( cx<0 for stored (named) regions )  (cx=cx_last for default region)
+* 2/93 - treat cx_last like stored regions
+* 2/93 - expanded the logic for finding **some** grid to use when their
+*        isn't one - search up the context stack
+        IF ( cx .LE. 0 .OR. cx .EQ. cx_last ) THEN
+           cx_try = is_cx( 1 )
+           IF ( cx_try.EQ.0 .OR. cx_try.EQ.unspecified_int4 ) THEN
+              grid = unspecified_int4
+           ELSE
+              grid = cx_grid( cx_try )
+           ENDIF
+* ... desperation search added 2/3/93
+* don't know why is_cx(1) isn'r reliable (havn't checked)
+           IF ( grid .EQ. unspecified_int4 ) THEN
+              DO 100 cx_try = cx_cmnd+1, cx_cmnd+5   ! arbitrary limit
+                 grid = cx_grid( cx_try )
+                 IF ( grid.NE.0 .AND. grid.NE.unspecified_int4) GOTO 200
+ 100          CONTINUE
+           ENDIF
+        ELSE
+           grid = cx_grid( cx )
+        ENDIF
+	IF ( grid .EQ. unspecified_int4 ) grid = mgrid_abstract
+
+* is this just a single grid box with the world coord bod edges given ?
+* 1/14: for gz(depth)=0:100 at ave we have a valid single point target axis
+* on which we want to document the axis limits (in cx_lo/hi_ww), rather
+* than the point coordinate.  Look at cx_regrid_trans to decide.
+ 200    IF ( cx_lo_ss(cx,idim) .NE. unspecified_int4
+     .	.AND.cx_lo_ss(cx,idim) .EQ. cx_hi_ss(cx,idim) 
+     .	.AND. .NOT.aux_span_compress				) THEN
+	   lo = TM_WORLD( cx_lo_ss(cx,idim),grid, idim, box_middle )
+	   hi = lo
+	ELSE
+	   lo = cx_lo_ww( idim, cx )
+	   hi = cx_hi_ww( idim, cx )
+	ENDIF
+
+* determine precision level for output string
+	IF ( full_prec ) THEN
+	   ndec = ax_dec_pt( idim )
+	ELSE
+	   ndec = 0
+	ENDIF
+
+* create the string
+	LOHI_WORLD = LOHI_STRING( lo,hi,idim,grid,to_word,ndec,slen )
+	
+	RETURN
+	END
diff --git a/fer/fmt/paren_surround.F b/fer/fmt/paren_surround.F
new file mode 100644
index 0000000..ed6dffc
--- /dev/null
+++ b/fer/fmt/paren_surround.F
@@ -0,0 +1,65 @@
+	CHARACTER*(*) FUNCTION PAREN_SURROUND( string, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the given string with enclosing parens around it and its length
+* if the given string is blank then return a blank string
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/11/88
+
+* calling argument declarations
+	INTEGER		slen
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	INTEGER		TM_LENSTR1
+
+	IF ( string .EQ. ' ' ) THEN
+	   PAREN_SURROUND = ' '
+	   slen = 0
+
+	ELSE
+	   slen = TM_LENSTR1( string )
+	   PAREN_SURROUND = '(' // string(:slen) // ')'
+	   slen = slen + 2
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/fmt/replace_deq.F b/fer/fmt/replace_deq.F
new file mode 100644
index 0000000..72d05ee
--- /dev/null
+++ b/fer/fmt/replace_deq.F
@@ -0,0 +1,146 @@
+	CHARACTER*(*) FUNCTION REPLACE_DEQ ( orig )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* replace "D
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  3/3/92
+* V300:  bug fix: check if expanded length is within allowable limits
+* V314: 8/22/94 *kob* IBM port - needed to add ifdef MANDATORY_FORMAT_WIDTH for
+*				 I format descriptor
+* V420: 10/5/95 - bug detected in syntax var2[d=1]- VAR1[d=2,G=[VAR2[D=1]]
+*		- actual bug was that i1 is improperly set in branches to 10
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+
+* calling argument declarations
+	CHARACTER*(*) orig
+
+* internal variable declarations
+	INTEGER TM_LENSTR1, i, i0, i1, i2, i3, eqpos, inlen, outlen,
+     .       dset, nlen, maxlen
+
+        CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* initialize
+        i0 = 1
+!	i1 = 1
+        eqpos = 0
+	inlen = LEN(orig)
+        outlen = 0
+	maxlen = LEN( REPLACE_DEQ )    ! 3/93
+        REPLACE_DEQ = ' '
+
+* search for next D=
+ 10     i1 = eqpos + 1			! 10/5: was "i1 = i1 + eqpos"
+ 11     eqpos = INDEX(orig(i1:), '=')
+        IF ( eqpos .EQ. 0 ) GOTO 500
+        eqpos = eqpos + i1 - 1
+        DO 100 i = eqpos-1, i1, -1
+           IF ( orig(i:i) .NE.' '
+     .    .AND. orig(i:i) .NE.tab ) GOTO 110
+ 100    CONTINUE
+        GOTO 500   ! blank is final character ??
+
+* is it a "d" ?
+ 110    IF (orig(i:i).NE.'D' .AND. orig(i:i).NE.'d') GOTO 10
+
+* make sure it's a "D" by itself instead of the end of another word
+       IF ( orig(i-1:i-1).NE.' '
+     . .AND. orig(i-1:i-1).NE.tab
+     . .AND. orig(i-1:i-1).NE.'['
+     . .AND. orig(i-1:i-1).NE.','
+     . .AND. orig(i-1:i-1).NE.'/' ) GOTO 10
+
+* got a "D=".  Is it followed by a number ?
+        DO 200 i2 = eqpos+1, inlen
+           IF ( orig(i2:i2) .NE.' '
+     .    .AND. orig(i2:i2) .NE.tab ) GOTO 210
+ 200    CONTINUE
+        GOTO 500   ! "=" is final character ??
+
+* if it's "D=name" instead of "D=#" then ignore it
+ 210    IF ( orig(i2:i2).LT."1" .OR. orig(i2:i2).GT."9" ) GOTO 10
+
+* get the data set number
+        DO 300 i3 = i2+1, inlen
+           IF ( orig(i3:i3).LT."0" .OR. orig(i3:i3).GT."9" ) GOTO 310
+ 300    CONTINUE
+        GOTO 500   ! digit is final character ??
+ 310    i3 = i3 - 1
+#ifdef MANDATORY_FORMAT_WIDTHS
+        READ (orig(i2:i3),*,ERR=5000) dset
+#else
+        READ (orig(i2:i3),'(I)',ERR=5000) dset
+#endif
+        IF (dset.LT.1 .OR. dset.GT.maxdsets) GOTO 10    ! error if so
+
+* replace D=# with D=name
+        nlen = TM_LENSTR1(ds_name(dset))
+        IF ( outlen .EQ. 0 ) THEN
+           REPLACE_DEQ = orig(:eqpos)//ds_name(dset)(:nlen)
+        ELSE
+           REPLACE_DEQ = REPLACE_DEQ(:outlen)
+     .               //orig(i0:eqpos)//ds_name(dset)(:nlen)
+        ENDIF
+        outlen = MIN( maxlen, outlen+eqpos-i0+1+nlen )   ! 3/93
+        i1 = i3 + 1  ! skip over the dset # characters
+        i0 = i1
+        GOTO 11 
+
+* tag on whatever is left over
+ 500    IF ( outlen .EQ. 0 ) THEN
+           REPLACE_DEQ = orig
+        ELSE
+           REPLACE_DEQ = REPLACE_DEQ(:outlen)//orig(i0:inlen)
+        ENDIF
+
+ 5000   RETURN
+	END
diff --git a/fer/fmt/row_coord_fmt.F b/fer/fmt/row_coord_fmt.F
new file mode 100644
index 0000000..ada8a92
--- /dev/null
+++ b/fer/fmt/row_coord_fmt.F
@@ -0,0 +1,120 @@
+	SUBROUTINE ROW_COORD_FMT( idim, cx, lo_ss, hi_ss, del_ss,
+     .				  fmt, decimal, row_ww, cleft )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* prepare a format suitable to label the subscripts and world coords at the
+* left edge of each row of data.  The style will be (e.g.)
+* "1.17N / 49:  26.31  26.06  26.01  26.04  26.14"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V200:   7/9/90 - extracted from LIST_CMND_DATA
+* V313:  31/10/94 - commas are mandatory in FORMAT statement on IBM/AIX
+*		    changed format 3000 for all cases
+* V540:  11/01 - allow for the possibility of non-positive (modulo) subscripts 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER idim, cx, lo_ss, hi_ss, del_ss, decimal, row_ww, cleft
+	CHARACTER*(*) fmt
+
+* local variable declarations:
+	LOGICAL	GEOG_LABEL, date_str
+	INTEGER DATE_PREC, FIELD_WIDTH,
+     .		grid, j, places, row_ss, row_ss_lo, numbers
+	REAL	BOX_SIZE, small
+	REAL*8	TM_WORLD
+
+* initialize
+	row_ww = 1			! fallback ...
+	IF ( cx .LE. 0 ) GOTO 500	! fallback format is "I / nnn:"
+	grid = cx_grid( cx )
+
+* how large is the smallest "delta" world coordinate to represent ?
+	small = +1.E33
+	DO 100 j = lo_ss, hi_ss, del_ss
+	   small = MIN( small, BOX_SIZE( j, grid, idim ) )
+ 100	CONTINUE	      
+
+* what precision is needed to represent this delta and world range ?
+	date_str = (idim .EQ. t_dim .OR. idim .EQ. f_dim) .AND.
+     .		     GEOG_LABEL(idim,grid) 
+	IF ( date_str ) THEN
+	   decimal = DATE_PREC( grid, idim, small )
+	ELSE
+	   CALL GET_PREC_DIGITS(	cx_lo_ww(idim,cx),
+     .					cx_hi_ww(idim,cx),
+     .					small, places, decimal )
+	ENDIF
+	decimal = decimal + 1		! add 1 more, arbitrarily
+
+* how many columns to fit the largest world coordinate ?
+	row_ww = 0
+	DO 200 j = lo_ss, hi_ss, del_ss
+	   row_ww = MAX ( row_ww, FIELD_WIDTH
+     .				  ( TM_WORLD(j,grid,idim,box_middle),
+     .				    grid, idim, decimal, numbers ) )
+ 200	CONTINUE
+
+* how many digits in the largest subscript ?
+ 500	IF ( hi_ss .NE. 0 ) THEN 
+	  row_ss     = INT( LOG10(REAL(ABS(hi_ss))) ) + 1
+	  IF (hi_ss .LT. 0) row_ss    = row_ss    + 1
+	ELSE
+	  row_ss   = 2
+	ENDIF
+	IF ( lo_ss .NE. 0 ) THEN 
+	  row_ss_lo  = INT( LOG10(REAL(ABS(lo_ss))) ) + 1
+	  IF (lo_ss .LT. 0) row_ss_lo = row_ss_lo + 1
+	ELSE
+	  row_ss_lo = 2
+	ENDIF
+	IF (row_ss_lo .GT. row_ss) row_ss = row_ss_lo
+
+	WRITE ( fmt, 3000 ) row_ss + 1	! blank before digits
+! 3000	FORMAT ( '('' /''I',I1,''':'')' ) 	! pre-AIX
+ 3000	FORMAT ( '('' /'',I',I1,',',''':'')' )	! typical: (' /',I3,':') 
+
+* total columns needed at left
+	cleft = row_ww + 4 + row_ss		! "$ / ss:"
+
+	RETURN
+	END
diff --git a/fer/fmt/sanitary_var_code.F b/fer/fmt/sanitary_var_code.F
new file mode 100644
index 0000000..f2c40ba
--- /dev/null
+++ b/fer/fmt/sanitary_var_code.F
@@ -0,0 +1,74 @@
+	CHARACTER*(*) FUNCTION SANITARY_VAR_CODE ( category, variable )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return name code for variable that is "sanitary" in the sense that it can
+* be used as a part of a filename
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  12/4/89 - created to make more honest VAR_CODE for other purposes
+* V230:  11/4/92 - expanded user variable name length
+* V500 *kob* 3/99- up VAR_CODE and vcode decl's from 8 to 64 chars
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER category, variable
+
+* internal variable declarations:
+	INTEGER		HASH_NAME
+	CHARACTER	VAR_CODE*128, vcode*128
+
+* get basic variable code
+	vcode = VAR_CODE( category, variable )
+
+* sanitize it
+	IF ( INDEX(vcode,'#') .GT. 0 ) WRITE( vcode, 3000 ) 'E', 
+     .				HASH_NAME( uvar_text( variable ), 999 )
+ 3000	FORMAT(A1,I3.3,4X)
+
+* done
+	SANITARY_VAR_CODE = vcode
+
+	RETURN
+	END
diff --git a/fer/fmt/translate_to_world.F b/fer/fmt/translate_to_world.F
new file mode 100644
index 0000000..bde6d1f
--- /dev/null
+++ b/fer/fmt/translate_to_world.F
@@ -0,0 +1,196 @@
+	SUBROUTINE TRANSLATE_TO_WORLD ( val, idim, grid, ndec, string )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a coordinate value to a string using appropriate lat/long/depth/time
+* format.  String will be left justified within the given field width.  Number
+* of decimal places of precision is specified by the argument ndec
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 7/17/86
+* revision 0.1 - 7/14/87 - allowed field widths of 3 digits
+* revision 1.0 - 2/25/88 - added option for non-fancy coordinates
+* revision 2.0 -  4/1/88 - incorporated time/date strings and FIELD_WIDTH
+*			   and ndec<0 indicating to use significant
+*			   digits instead of decimal places
+* revision 2.1 - 4/13/88 - added MOD calculation to longitude
+* revision 2.2 - 1/12/89 - declate TM_SECS_TO_DATE exactly *20
+* revision 2.3 - 2/16/89 - TM_SECS_TO_DATE --> SECS_TO_DATE
+* V200:  1/10/89 - kludge to restrict degrees to precision .001 avoid ".000001N"
+* Unix/RISC port 11/91  *sh*: check for unspecified_val8 value, exit after '*'
+* V230:  7/20/92 - check T0 before assuming that times can be formatted
+*        7/23/92 - for modulo longitude calculations include numerical value
+*                  in parentheses
+* V300:   2/3/93 - bug fix negative times (dates) - should be always "fancy"
+* V320: 12/20/94 - do not label "m" on Z axis -- in order to support the
+*		   meteorology community with millibars, etc.
+*	 1/27/95 - correct the longitude formatting of negative longitudes
+* V530: *acm* 12/00 alternative calendar types; cal_id
+* V533: *sh* 7/01 - bug fix: negative time steps still formatted as seconds
+*		    since BC.  A leftover from an Oct. 1997 change by K.O.
+*	            omitted from this documentation block
+* V580 *acm* 10/01  modify the kludge to restrict degrees to precision 0.001
+*                   If the calling sequence asks for more precision, allow it.
+* V581 *acm*  3/05  axis-independent time coordinates are calculated with default 
+*                   calendar, so do not get cal_id when converting to date string
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'errmsg.parm'
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		idim, ndec, grid, line
+	CHARACTER*(*)	string
+	REAL*8		val
+
+* internal variable declarations:
+	CHARACTER	SECS_TO_DATE*20, TM_FMT*24, code*1, xtra*16
+	INTEGER		FIELD_WIDTH, TM_GET_CALENDAR_ID, min_width, width, 
+     .                  decim, numbers, n2, cal_id, iv
+	LOGICAL		GEOG_LABEL, fancy, use_sig_fig,
+     .                  modulo
+	REAL		val4, val4_orig, v2
+
+* valid inputs ?  (bug fix 11/91)
+        IF ( val .EQ. unspecified_val8 ) THEN
+           string = '*'
+           RETURN
+        ENDIF
+
+* initialize
+        modulo     = .FALSE.
+	width	   = MIN( 24, LEN(string) )
+	use_sig_fig = ndec .LT. 0			! use TM_FMT
+	decim	   = ABS(ndec)
+	val4	   = val
+        val4_orig  = val4
+	code	   = ' '
+	fancy	   = GEOG_LABEL( idim, grid )
+
+! Note (2/3/93): GEOG_LABEL contains the removed logic
+
+* adjust precision to fit into field if necessary
+100	min_width = FIELD_WIDTH( val, grid, idim, decim, numbers )
+	IF ( width .LT. min_width ) THEN
+	   IF ( decim .EQ. 0 ) THEN
+	      string = '*'		! too narrow to format
+              RETURN                    ! bug fix 11/91
+	   ELSE
+	      decim = decim - 1
+	      GOTO 100
+	   ENDIF
+	ENDIF
+
+* is it a fancy (lat/long/depth/time) position ?
+	IF ( fancy ) THEN
+
+	   IF ( idim .EQ. x_dim ) THEN
+* x - longitude E/W
+* ... restrict degrees to a precision of .001
+c (The following doesnt always compute the correct value in double precision
+c on 32-bit linux (.145 comes back as .146). Use NINT instead.)
+c	      IF (ndec .LE. 3) val4 = INT(val4 * 1000.D0)/1000.D0
+	      IF (ndec .LE. 3) val4 = NINT(val4 * 1000.D0)/1000.D0
+	      val4 = MOD( val4, 360. )
+	      IF ( val4 .LT. 0.0 ) val4 = val4 + 360.	! 1/27
+              modulo = val4 .NE. val4_orig
+	      IF     ( val4 .LE. 180.0 ) THEN
+	         code    = 'E'			! degE
+	      ELSEIF ( val4 .GT. 180.0 ) THEN
+	         val4 = 360. - val4
+	         code    = 'W'			! degW
+	      ENDIF
+
+	   ELSEIF ( idim .EQ. y_dim ) THEN
+* y - latitude N/S
+* ... restrict degrees to a precision of .001
+c (The following doesnt always compute the correct value in double precision
+c on 32-bit linux (.145 comes back as .146). Use NINT instead.)
+c	      IF (ndec .LE. 3) val4 = INT(val4 * 1000.D0)/1000.D0
+	      IF (ndec .LE. 3) val4 = NINT(val4 * 1000.D0)/1000.D0
+ 	      IF     ( val4 .LT. 0.0 ) THEN
+	         val4 = -val4
+	         code    = 'S'			! degS
+	      ELSEIF ( val4 .GT. 0.0 ) THEN
+	         code    = 'N'			! degN
+	      ENDIF
+
+	   ELSEIF ( idim .EQ. z_dim ) THEN
+* z - depth in meters
+!	      code = 'm'				! meters
+	      code = ' '		! 12/94 change
+
+	   ELSE
+* t - create date/time string and exit
+*  ( negative times are used in stored regions as axis-independent dates )
+              IF ( val .LT. -47335449600D0 ) THEN
+! HACK! negatives time steps are formatted as valid times unless they
+! would be negative seconds from BC for dates later than 1-jan-1500
+                 line       = grid_line( idim, grid )
+!                 cal_id = TM_GET_CALENDAR_ID ( line_cal_name(line))
+                 cal_id = 1  ! axis-independent dates were calculated with dflt calendar
+                 string = SECS_TO_DATE( -val, cal_id )
+              ELSE
+                 CALL TSTEP_TO_DATE( grid, idim, val, decim, string )
+              ENDIF
+	      RETURN
+	   ENDIF
+	ENDIF
+
+* create all strings except date/time here
+	IF ( use_sig_fig ) THEN
+	   string = TM_FMT( val4, decim, width, numbers )
+	ELSE
+	   string = TM_FMT( val4, -decim, width, numbers )
+	ENDIF
+	string = string(:numbers)//code
+
+* add parenthetical remark if modulo translation has occurred
+        IF ( modulo ) THEN
+	   IF ( use_sig_fig ) THEN
+              xtra =  TM_FMT( val4_orig, decim, width, n2 )
+	   ELSE
+              xtra =  TM_FMT( val4_orig, -decim, width, n2 )
+	   ENDIF
+           IF ( LEN(string) .GE. numbers+n2+3 ) 
+     .                string = string(:numbers+1)//'('//xtra(:n2)//')'
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/var_data_fmt.F b/fer/fmt/var_data_fmt.F
new file mode 100644
index 0000000..91415e5
--- /dev/null
+++ b/fer/fmt/var_data_fmt.F
@@ -0,0 +1,79 @@
+	SUBROUTINE VAR_DATA_FMT( nleft, nright, rqst_digits, min_width,
+     .				 width, good_fmt, bad_fmt )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* prepare a format suitable to write out gridded data in a minimum width that
+* provides the requested precision.  May use E or F format, depending on size
+* "min_width" prevents the field from being less than xxx columns
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:   7/9/90 - extracted from LIST_CMND_DATA
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER nleft, nright, rqst_digits, min_width,
+     .		width
+	CHARACTER*(*) good_fmt, bad_fmt
+
+* local variable declarations:
+	INTEGER	F_size, E_size
+
+* use F or E format for good data - whichever is smaller
+	F_size = nleft + nright + 3	! _.     and extra spc --> 3
+	E_size = rqst_digits + 7		! -.E-xx and extra spc --> 7
+	IF ( F_size .LT. E_size ) THEN
+	   width = MAX( F_size, min_width )
+	   WRITE ( good_fmt, 3000 ) 'F', width, nright
+	ELSE
+	   width  = MAX( E_size, min_width )
+	   WRITE ( good_fmt, 3000 ) '1PE', width, rqst_digits-1
+	ENDIF
+
+* string format for bad data
+	WRITE ( bad_fmt, 3002 ) width
+* . . . to create ...FORMAT (Fxx.yy) and FORMAT (Axx)
+
+ 3000	FORMAT ( '(',A,I2,'.',I2,')' )	
+ 3002	FORMAT ( '(A',I2,')' )	
+
+	RETURN
+	END
diff --git a/fer/fmt/var_title.F b/fer/fmt/var_title.F
new file mode 100644
index 0000000..9c9b0f9
--- /dev/null
+++ b/fer/fmt/var_title.F
@@ -0,0 +1,218 @@
+	CHARACTER*(*) FUNCTION VAR_TITLE ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return title for variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/4/86
+* revision 1.0 - 1/6/87 - expression text found between commas for cat_expr_var
+* revision 1.1 - 3/4/87 - semi-user vars added, expr disabled
+* revision 1.2 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 2.0 - 5/11/87 - called with mr, only
+* revision 2.1 - 3/10/88 - allowed for blank file variable titles,
+*			   added cat_named_var
+* V200:  6/20/89 - eliminated "named" variables
+*		 - added user-defined variable titles
+*	  1/3/90 - mr --> cx
+*	 1/12/90 - allow unit changes by transforms
+* V230:  3/3/92  - replace "D=#" with "D=name" in title
+*       11/4/92 - expanded user variable name length
+* V420: variable units may be modified by regrid transforms of the variable
+* V500: 12/98 *sh* - added cat_const_var ... of the form "{1,3,5}"
+* V500 *kob* 3/99- up VAR_CODE to 64 chars
+* V530  8/00 *sh8 - added support for cat_string
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+* v553 *kob* 9/03- need to add buff, slen for assignment of VAR_TITLE - 
+*                  g77 bug would cause crash when trying to prepend chars
+*                  onto CHAR function variable 
+* v554 *acm* 1/04 - add variable category cat_counter_var
+* V600 8/05 *acm* - Add variable type attrib_val for definitions of the form
+*                   varname.attname
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V601 10/06 *acm* fix bug 1442. plot and listing titles should show the 
+*                  variable title, or if no title, the variable name.
+
+        include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+        include 'xpyvar_info.cmn'
+        include 'errmsg.parm'
+
+* calling argument declarations
+	INTEGER	cx
+
+* internal variable declarations
+	LOGICAL 	UNIT_CHG_AX, NC_GET_ATTRIB, got_it
+	INTEGER 	TM_LENSTR1, cat, var, idim, tlen, llen, trans,
+     .			uvar, item, start, end, slen, dset, varid,
+     .                  attlen, attoutflag, status
+        REAL            vals
+	CHARACTER	AX_TITLE*32, VAR_CODE*128, SANITARY_VAR_CODE*128, 
+     .                  TM_FMT*10, REPLACE_DEQ*180,   ! .GT. uvar_text_len
+     .                  buff1*32, buff2*10, buff*2048, varname*128
+
+* initialize
+	var = cx_variable( cx )
+	cat = cx_category( cx )
+
+	IF     ( cat .EQ. cat_file_var .OR. 
+     .		 cat .EQ. cat_aggregate_var) THEN
+
+	   IF ( ds_var_title( var )(1:1) .NE. ' ' ) THEN
+	      var_title = ds_var_title( var )
+	   ELSE
+              dset = cx_data_set(cx)
+              IF (dset .NE. pdset_irrelevant .AND. 
+     .            dset .NE. unspecified_int4) THEN
+! is it in the linked-list for dset. If so get attr info, including original 
+                 varname = SANITARY_VAR_CODE( cat, var )
+                 CALL CD_GET_VAR_ID (dset, varname, varid, status)
+                 got_it = status .EQ. ferr_ok .AND.
+     .              NC_GET_ATTRIB (dset, varid, 'long_name',
+     .             .TRUE., varname, 2048, attlen, attoutflag,
+     .             buff, vals)
+                 var_title = buff
+                 IF (var_title .EQ. ' ') var_title = varname
+              ELSE
+                 var_title = VAR_CODE( cat, var )
+!	         var_title = '"'//var_title(:TM_LENSTR1(var_title))//'"'
+              ENDIF
+	   ENDIF
+
+        ELSEIF ( cat .EQ. cat_pystat_var ) THEN
+
+           IF ( pyvar_title( var ) .EQ. ' ' ) THEN
+              var_title = VAR_CODE( cat, var )
+           ELSE
+              var_title = pyvar_title( var )
+           ENDIF
+
+	ELSEIF ( cat .EQ. cat_calc_var ) THEN
+
+	   var_title = cvar_primary_name( var )
+
+	ELSEIF ( cat .EQ. cat_user_var  ) THEN
+
+	   IF ( uvar_title( var ) .EQ. ' ' ) THEN
+	      var_title = REPLACE_DEQ(
+     .             uvar_text(var)(:TM_LENSTR1(uvar_text(var)) ))
+	   ELSE
+	      var_title = uvar_title( var )
+	   ENDIF
+
+
+	ELSEIF ( cat .EQ. cat_attrib_val  ) THEN
+
+	   uvar = cx_variable(cx)
+	   var_title = uvar_text(uvar)
+
+	   IF ( uvar_title( uvar ) .EQ. ' ' ) THEN
+	      var_title = REPLACE_DEQ(
+     .             uvar_text(uvar)(:TM_LENSTR1(uvar_text(uvar)) ))
+	   ENDIF
+
+	ELSEIF ( cat .EQ. cat_pseudo_var ) THEN
+
+	   var_title = alg_pvar(var)
+
+	ELSEIF ( cat .EQ. cat_dummy_var ) THEN
+
+	   var_title = 'dummy'
+
+	ELSEIF ( cat .EQ. cat_temp_var ) THEN
+
+	   var_title = 'temp var'
+
+	ELSEIF ( cat .EQ. cat_constant ) THEN
+
+	   var_title = 'constant'
+
+	ELSEIF ( cat .EQ. cat_const_var ) THEN
+
+	   uvar = cx_variable(cx)/1000
+           item = cx_variable(cx) - 1000*uvar
+           start = uvar_item_start( item, uvar )
+           end   = uvar_item_end  ( item, uvar )
+	   var_title = uvar_text(uvar)(start:end)
+
+	ELSEIF ( cat .EQ. cat_string ) THEN
+
+* determine the string to be stored
+           uvar = cx_variable(cx)/1000
+           item = cx_variable(cx) - 1000*uvar
+           start = uvar_item_start( item, uvar )
+           end   = uvar_item_end  ( item, uvar )
+	   var_title = uvar_text(uvar)(start:end)
+
+	ELSEIF ( cat .EQ. cat_counter_var ) THEN
+
+	   var_title = 'counter'
+
+	ELSE
+
+	   var_title = 'bad_cat'
+
+	ENDIF
+
+* some transformations change the title
+	IF ( UNIT_CHG_AX(cx,idim, trans) ) THEN
+	   IF ( trans .EQ. punit_mod_loc ) THEN
+	      buff1 = AX_TITLE( idim, cx_grid(cx), tlen )
+	      buff2 = TM_FMT( cx_trans_arg(idim,cx), 4, 10, llen )
+	      VAR_TITLE = buff1(:tlen)//' of '//buff2(:llen)//' in '//
+     .		          VAR_TITLE
+	   ELSEIF ( trans .EQ. punit_mod_variance ) THEN
+	      buff = VAR_TITLE
+	      slen = TM_LENSTR1(buff)		
+	      VAR_TITLE = 'Variance of '//buff(:slen)
+	   ELSEIF ( trans .EQ. punit_mod_npoints ) THEN
+	      CONTINUE		! units take care of this
+	   ENDIF	      
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/var_title_mod.F b/fer/fmt/var_title_mod.F
new file mode 100644
index 0000000..9162cc0
--- /dev/null
+++ b/fer/fmt/var_title_mod.F
@@ -0,0 +1,307 @@
+	CHARACTER*(*) FUNCTION VAR_TITLE_MOD ( cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return title modifications ( including in-plane transformations) for variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/28/87
+* revision 0.1 - 6/25/87 - special remarks added to some derivatives
+* revision 0.2 - 8/29/87 - special remarks added only if DT is known
+*			   eliminated enclosing parens / "-" between remarks
+* revision 0.3 - 9/10/87 - added "using nnn pts" for transforms
+*			   and ds_var_modification --> ds_var_titl_mod
+* revision 0.31- 10/23/87- "using" --> "by"
+* revision 0.4 - 4/4/88  - added remarks about data-set-dependent calculations
+* revision 0.4 - 5/5/88  - modified remarks to include QDF and QDFZ
+* revision 0.5 - 7/2/88  - remarks about Am and multiple clim. airt fields for
+*			   QFLX
+* revision 0.6 - 7/25/88 - added regriding
+* revision 0.7 - 1/4/89  - added regridding transformations
+* V200:  6/2/89 - interchanged order of lo/hi_ss arguments
+*		- check in-plane-ness for transforms to display
+*	 1/3/89 - mr --> cx
+* V230:  1/27/92 - added special string for @WEQ
+*        8/18/92 - eliminated string(1:) notation for MAC compatibility
+*        8/23/92 - changes to accomodate regridding transforms
+* V420:	 9/25/95 - use REGRID_COMMENTS
+* V430:  7/96 - pass cx to ALG_TRANS_TITL so it can document 4D transformations
+* V455:  9/97 - modify labeling of xforms @CIA,CIB,CDA,CDB to avoid "by n pts"
+* V491:  3/98 - crash due to boolean operator precedence error
+* V530:  8/00 *sh* - added support for cat_string
+* V533:  6/01 *sh* - added transformation @EVNT
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'instance_table.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include	'xtext_info.cmn'
+	include	'xdset_parms.cmn'
+
+* calling argument declarations
+	INTEGER cx
+
+* internal variable declarations
+	LOGICAL	add_on, all_q, vcalc 
+	INTEGER	TM_LENSTR, TM_LENSTR1, CX_DIM_LEN,
+     .		var, categ, dset, cairt, cairt_dset,
+     .		mlen, t_len, maxlen, idim, trans, slen, k_lo
+	CHARACTER ALG_TRANS_TITL*20, TM_FMT*20,
+     .		REGRID_COMMENTS*64,
+     .          trans_title*40, buffer*24
+
+* initialize
+	var     = cx_variable( cx )
+	categ   = cx_category( cx )
+	dset    = cx_data_set( cx )
+	maxlen  = LEN( VAR_TITLE_MOD )
+
+* begin with stored title modification string
+	IF     ( categ .EQ. cat_file_var ) THEN
+	   var_title_mod = ds_var_titl_mod( var )
+	ELSE
+	   var_title_mod = ' '
+	ENDIF
+	IF ( categ .EQ. cat_string ) RETURN
+
+* length so far
+	mlen = TM_LENSTR( var_title_mod )
+	add_on = mlen .GT. 0
+	mlen = MAX( 1, mlen )		! avoid zero len string errors
+
+* add remark about accuracy of d/dT derivative
+	trans = cx_trans( t_dim, cx )
+	IF ( trans .EQ. trans_no_transform 
+     . .AND. cx_trans_arg(t_dim,cx) .NE. bad_val4
+     . .AND. categ .EQ. cat_calc_var
+     . .AND. ( var .EQ. pubps  .OR.  var .EQ. pvbps
+     .		.OR.  (pdudt.LE. var .AND. var.LE.pdtdt) ) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	   IF ( cx_trans_arg(t_dim,cx) .EQ. bad_val4 ) THEN
+	      var_title_mod = var_title_mod(:mlen) //'irregular dt'
+	      mlen = MIN( maxlen, mlen+12 )
+	   ELSE
+	      var_title_mod = var_title_mod(:mlen) //
+     .			     'dt='//TM_FMT( cx_trans_arg(t_dim,cx), 4, 8, slen )
+	      mlen = MIN( maxlen, mlen+3+slen )
+	   ENDIF
+	ENDIF
+
+	trans = cx_trans( f_dim, cx )
+	IF ( trans .EQ. trans_no_transform 
+     . .AND. cx_trans_arg(f_dim,cx) .NE. bad_val4
+     . .AND. categ .EQ. cat_calc_var
+     . .AND. ( var .EQ. pubps  .OR.  var .EQ. pvbps
+     .		.OR.  (pdudt.LE. var .AND. var.LE.pdtdt) ) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	   IF ( cx_trans_arg(f_dim,cx) .EQ. bad_val4 ) THEN
+	      var_title_mod = var_title_mod(:mlen) //'irregular dt'
+	      mlen = MIN( maxlen, mlen+12 )
+	   ELSE
+	      var_title_mod = var_title_mod(:mlen) //
+     .			     'dt='//TM_FMT( cx_trans_arg(f_dim,cx), 4, 8, slen )
+	      mlen = MIN( maxlen, mlen+3+slen )
+	   ENDIF
+	ENDIF
+
+* some variables need all the comments about surface heat flux
+* namely: QFLX and (QDF or QDFZ) at the surface
+	k_lo     = cx_lo_ss( cx, z_dim ) 
+	vcalc = categ .EQ. cat_calc_var
+	all_q = vcalc .AND. ( var.EQ.pqflx	.OR.
+     .		  ( (var.EQ.pqdfz .OR. var.EQ.pqdf) .AND. k_lo.EQ.1 ) )
+
+* add remark about clim. air T vs. const. air/sea temperature difference
+	IF ( all_q .OR. 
+     .	     ( vcalc .AND.  ( var.EQ.pqsen .OR. var.EQ.pqeva
+     .			.OR.  var.EQ.pair  .OR. var.EQ.pcair ) ) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	   IF ( .NOT.dp_const_air_sst(dset) .OR. var .EQ. pcair ) THEN
+	      cairt = dp_clim_air_sst( dset )		! cairt used in calcs
+	      cairt_dset = dp_airt_dset( cairt )	! dset containing cairt
+* ... base remark on experiment number to ensure that neither file names,
+*     logicals, nor descriptors can point to wrong climatological data
+	      var_title_mod = var_title_mod(:mlen) // ds_expnum( cairt_dset )
+     .			      // ' air T'	
+	      mlen = MIN( maxlen, mlen+10 )
+	   ELSE
+* ... constant air sst difference
+	      var_title_mod = var_title_mod(:mlen) // 'air/sst dT=' //
+     .		TM_FMT( dp_delta_air_sst(dset), 4, 8, slen )
+	      mlen = MIN( maxlen, mlen+11+slen )
+	   ENDIF
+	ENDIF
+
+* add remark about minimum wind used
+	IF ( all_q .OR. 
+     .	     ( vcalc .AND. (var.EQ.pqsen .OR. var.EQ.pqeva) ) ) THEN
+	   var_title_mod = var_title_mod(:mlen) // ';min. wind=' //
+     .		TM_FMT( dp_min_wind(dset), 4, 8, slen )
+	   mlen = MIN( maxlen, mlen+11+slen )
+	ENDIF
+
+* add remark about the surface radiation calculation
+	IF ( all_q .OR. ( vcalc .AND. var.EQ.pqrad ) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	   IF ( dp_phil_qflux(dset) ) THEN
+	      var_title_mod = var_title_mod(:mlen) // 'Phil/Sieg Q flux'
+	      mlen = MIN( maxlen, mlen+14 )
+	   ELSEIF ( dp_ramp1_qflux(dset) ) THEN
+	      var_title_mod = var_title_mod(:mlen) // 'single heat ramp'
+	      mlen = MIN( maxlen, mlen+16 )
+	   ELSEIF ( dp_ramp2_qflux(dset) ) THEN
+	      var_title_mod = var_title_mod(:mlen) // 'double heat ramp'
+	      mlen = MIN( maxlen, mlen+16 )
+	   ENDIF
+	ENDIF
+
+* add remark about momentum diffusion coefficient
+* add second pair of parens around second conditional statement below 
+*     *kob* 4/14/98
+	IF ( vcalc .AND. ((var.EQ.pudfh) .OR. (var.EQ.pvdfh)) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	      buffer = 	      TM_FMT( dp_Am_factor(dset), 3, 5, slen )
+	      var_title_mod = var_title_mod(:mlen)//
+     .			      'Am=' // buffer(:slen)
+	      mlen = MIN( maxlen, mlen+3+slen )
+	ENDIF
+
+* add axis name to pseudo variables
+	IF ( categ .EQ. cat_pseudo_var ) THEN
+	   idim = MOD( var-1, 6 ) + 1
+	   var_title_mod = 'axis '//line_name(grid_line(idim, cx_grid(cx)))
+	ENDIF
+
+* add remarks about in-plane transformations
+	DO 100 idim = 1, nferdims
+	   trans = cx_trans( idim, cx )
+	   IF ( trans .NE. trans_no_transform
+     .	  .AND. trans .LT. trans_compress_code 
+     .	  .AND. CX_DIM_LEN(idim,cx) .GT. 1 ) THEN
+	      IF ( add_on ) THEN
+	         var_title_mod = var_title_mod(:mlen) //' - '
+	         mlen = MIN( maxlen, mlen + 3 )
+	      ELSE
+	         add_on = .TRUE.
+	      ENDIF
+	      trans_title = ALG_TRANS_TITL( trans, cx )
+	      t_len = TM_LENSTR1( trans_title )
+	      IF ( cx_trans( idim, cx ) .EQ. trans_wgted_eq ) THEN
+                 trans_title = trans_title(:t_len)//' of '//
+     .                TM_FMT( cx_trans_arg(idim,cx), 4, 12, slen )
+                 t_len = t_len + 4 + slen
+	      ELSEIF ( cx_trans( idim, cx ) .EQ. trans_event_mask ) THEN
+                 trans_title = trans_title(:t_len)//' at '//
+     .                TM_FMT( cx_trans_arg(idim,cx), 4, 12, slen )
+                 t_len = t_len + 4 + slen
+	      ELSEIF ( cx_trans_arg( idim, cx ) .NE. bad_val4 ) THEN
+	         IF ( trans .GE. trans_nrst_dist_abv
+     .        .AND.   trans .LE. trans_nrst_indx_blw ) GOTO 95	!9/97 @CIA trap
+* ... add "by nnn pts"
+	         trans_title = trans_title(:t_len)//' by '//
+     .			TM_FMT( cx_trans_arg(idim,cx), 4, 8, slen )
+	         t_len = t_len + 4 + slen
+	         trans_title = trans_title(:t_len)//' pts'
+	         t_len = t_len + 4
+	      ENDIF
+ 95	      var_title_mod = var_title_mod(:mlen) // trans_title(:t_len) //
+     .		' on ' // ww_dim_name( idim )
+	      mlen = MIN( maxlen, mlen+t_len+5 )
+	   ENDIF
+ 100	CONTINUE
+
+* re-gridded ?
+	IF ( cx_unstand_grid(cx) ) THEN
+	   IF ( add_on ) THEN
+	      var_title_mod = var_title_mod(:mlen) //' - '
+	      mlen = MIN( maxlen, mlen + 3 )
+	   ELSE
+	      add_on = .TRUE.
+	   ENDIF
+	   var_title_mod =  var_title_mod(:mlen)//'regrid: '//
+     .			REGRID_COMMENTS(cx, slen)
+	   mlen = MIN( maxlen, mlen + 8 + slen )
+	ENDIF
+
+* signal if the string has been truncated for being too long
+	IF ( mlen .EQ. maxlen ) VAR_TITLE_MOD(maxlen:maxlen) = '*'
+
+* clean up
+	IF ( VAR_TITLE_MOD .EQ. ' ' ) THEN
+	   RETURN
+
+* ... complication from avoiding zero length strings above
+	ELSEIF ( VAR_TITLE_MOD(1:1) .EQ. ' ' ) THEN
+	   VAR_TITLE_MOD = VAR_TITLE_MOD(2:maxlen)
+	   mlen = mlen - 1
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/fmt/var_trans.F b/fer/fmt/var_trans.F
new file mode 100644
index 0000000..43f0b01
--- /dev/null
+++ b/fer/fmt/var_trans.F
@@ -0,0 +1,81 @@
+	CHARACTER*(*) FUNCTION VAR_TRANS( idim, cx, out_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form NAME[Z
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/21/89 - extracted from DIAG_OP
+* V230:  11/4/92 - expanded user variable name length
+* V500 *kob* 3/99- up VAR_CODE and local variable var to 64 chars
+* V552 *acm* 4/03- up VAR_CODE decl from 64 to 128 chars
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER	idim, cx, out_len
+
+* internal variable declarations:
+	INTEGER	  TM_LENSTR1, slen, vlen
+	CHARACTER VAR_CODE*128, CX_DIM_STR*48,
+     .            var*128, out_buff*80, dim_str*48
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+
+* internal parameter declarations:
+	LOGICAL     full_precision
+	PARAMETER ( full_precision = .TRUE. )
+
+* initialize
+	var = VAR_CODE( cx_category(cx), cx_variable(cx) )
+        vlen = TM_LENSTR1( var )
+
+* TRANSFORMATION
+* "VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	dim_str = CX_DIM_STR( idim, cx, ':',  full_precision, slen )
+	WRITE (out_buff,3000) var(:vlen), dim_str(:slen), cx_data_set(cx)
+	CALL TM_PACK_STRING( out_buff, out_buff, 1, 80, out_len )
+
+ 3000	FORMAT (A,'[',A,',D=',I3,']')
+
+	VAR_TRANS = out_buff
+
+	RETURN
+	END
diff --git a/fer/fmt/var_units.F b/fer/fmt/var_units.F
new file mode 100644
index 0000000..3b79c3f
--- /dev/null
+++ b/fer/fmt/var_units.F
@@ -0,0 +1,134 @@
+
+	CHARACTER*(*) FUNCTION VAR_UNITS( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return units text string for variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/4/88
+* V200:  6/20/89 - eliminated "named" variables
+*	  1/3/90 - mr --> cx
+*	 1/12/90 - allow unit changes by transforms
+*       10/22/92 - added units on uvars
+* V420: variable units may be modified by regrid transforms of the variable
+* V500: 12/98 *sh* - added cat_const_var ... of the form "{1,3,5}"
+* V530  8/00 *sh* - added support for cat_string
+* v553 *kob* 9/03- need to add buff, slen for assignment of VAR_UNITS - 
+*                  g77 bug would cause crash when trying to prepend chars
+*                  onto CHAR function variable 
+* v554 *acm* 1/04 - add variable category cat_counter_var
+* V600 *acm* 3/06 - add variable category cat_attrib_val
+
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xtext_info.cmn'
+	include	'xcontext.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xvariables.cmn'
+	include	'xpyvar_info.cmn'
+
+* calling argument declarations
+	INTEGER	cx
+
+* internal variable declarations
+	LOGICAL UNIT_CHG_AX
+	INTEGER	TM_LENSTR1, slen, category, variable, idim, axis, trans
+	CHARACTER*2048 buff
+
+* initialize
+	category = cx_category( cx )
+	variable = cx_variable( cx )
+
+* select units by category of variable
+	IF     ( category .EQ. cat_file_var .OR. 
+     .		 category .EQ. cat_aggregate_var) THEN
+
+	   VAR_UNITS = ds_var_units( variable )
+
+        ELSEIF ( category .EQ. cat_pystat_var ) THEN
+
+           VAR_UNITS = pyvar_units( variable )
+
+	ELSEIF ( category .EQ. cat_calc_var ) THEN
+
+	   VAR_UNITS = unit_text( cvar_unit_code(variable) )
+
+	ELSEIF ( category .EQ. cat_user_var ) THEN
+
+	   VAR_UNITS = uvar_units( variable )
+
+	ELSEIF ( category .EQ. cat_pseudo_var 
+     .	   .OR.  category .EQ. cat_constant
+     .	   .OR.  category .EQ. cat_string
+     .	   .OR.  category .EQ. cat_const_var
+     .	   .OR.  category .EQ. cat_counter_var
+     .	   .OR.  category .EQ. cat_attrib_val ) THEN
+
+	   VAR_UNITS = ' '
+
+	ELSE
+
+	   VAR_UNITS = 'unit_err'
+
+	ENDIF
+
+* certain transformations change the units
+	IF ( UNIT_CHG_AX( cx, idim, trans ) ) THEN
+	   IF ( trans .EQ. punit_mod_loc ) THEN
+	      axis = grid_line( idim, cx_grid(cx) )
+	      VAR_UNITS = line_units( axis )
+	   ELSEIF ( trans .EQ. punit_mod_variance ) THEN
+	      IF ( VAR_UNITS .NE. ' ' ) THEN
+	         slen = TM_LENSTR1(VAR_UNITS)
+		 buff = VAR_UNITS
+	         VAR_UNITS = '('//buff(:slen) // ')^2'
+	      ENDIF
+	   ELSEIF ( trans .EQ. punit_mod_npoints ) THEN
+	      VAR_UNITS = '# of points'
+	   ENDIF	      
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/gnl/LIB_NAME b/fer/gnl/LIB_NAME
new file mode 100644
index 0000000..2f6c6c7
--- /dev/null
+++ b/fer/gnl/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libgnl.a 
diff --git a/fer/gnl/Makefile b/fer/gnl/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/gnl/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/gnl/SOURCE_FILES b/fer/gnl/SOURCE_FILES
new file mode 100644
index 0000000..1f75d77
--- /dev/null
+++ b/fer/gnl/SOURCE_FILES
@@ -0,0 +1,118 @@
+SRCS_F = \
+add_attribute.F\
+alias_command.F\
+alias_id.F\
+all_1_arg.F\
+arg_string.F\
+atom_pos.F\
+auto_filename.F\
+cancel_data_set.F\
+cdf_list.F\
+cdf_list_global_atts.F\
+check_format.F\
+check_memory.F\
+check_member_sets.F\
+cleanup_last_cmnd.F\
+coached_str_sub.F\
+create_agg_axis.F\
+create_agg_dset.F\
+cs_command.F\
+cs_semicolon.F\
+ctrl_c.F\
+define_aggregate_grid.F\
+define_special_grids.F\
+delete_one_line.F\
+do_query.F\
+dollar_arg.F\
+dollar_command.F\
+edit_attribute.F\
+equal_format.F\
+equal_permute.F\
+equal_str_lc.F\
+equal_string.F\
+equal_type.F\
+equal_val.F\
+equal_val_int.F\
+errmsg.F\
+escape_for_xml.F\
+finalize.F\
+float2string_for_xml.F\
+get_dataset_name.F\
+get_fer_command.F\
+get_fvars_list_by_attname_and_val.F\
+get_context_mods.F\
+get_input_varname.F\
+get_mode_arg.F\
+get_ppl_memory_size.F\
+get_scriptfile_name.F\
+get_uvars_list_by_attname_and_val.F\
+init_aggregate_dset.F\
+init_journal.F\
+init_memory.F\
+initialize.F\
+isit_coord_var.F\
+line_facts.F\
+line_facts_xml.F\
+list_cmnd_data.F\
+list_multi.F\
+list_multi_sub.F\
+mouse_command.F\
+name_equal_string.F\
+name_equal_string_lc.F\
+name_equal_string_vatt.F\
+netcdf4_cancel_settings.F\
+netcdf4_list_settings.F\
+netcdf4_set_list_settings.F\
+netcdf4_show_list_settings.F\
+no_journal.F\
+parse_comma_list.F\
+parse_command.F\
+pop_cs.F\
+process_if.F\
+proclaim.F\
+proclaim_c.F\
+redefine_ax_att.F\
+repl_exprns.F\
+reset_axis.F\
+reset_ax_att.F\
+save_ppl_memory_size.F\
+save_scriptfile_name.F\
+set_var.F\
+show_1_dsvar.F\
+show_1_function.F\
+show_1_mr.F\
+show_1_pyvar.F\
+show_1_uvar.F\
+show_1_uvar_xml.F\
+show_attribute.F\
+show_data.F\
+show_data_files.F\
+show_data_set_attrs.F\
+show_data_set_params.F\
+show_data_set_vars.F\
+show_data_set_vars_xml.F\
+show_data_set_xml.F\
+show_diag_vars.F\
+show_dim_xml.F\
+show_dyn_grids.F\
+show_grid.F\
+show_grid_xml.F\
+show_grid_string_xml.F\
+show_line.F\
+show_line_xml.F\
+show_line_coords.F\
+show_mem_vars.F\
+show_region.F\
+show_regrid_transforms.F\
+show_transforms.F\
+special_symbol.F\
+symbol_command.F\
+translate_lat_long.F\
+translate_limit.F\
+turnoff_verify.F\
+var_stat.F\
+version_only.F\
+warn.F\
+warn_occasionally.F\
+write_dods_fmt.F \
+write_multi.F 
diff --git a/fer/gnl/add_attribute.F b/fer/gnl/add_attribute.F
new file mode 100644
index 0000000..a03bdf5
--- /dev/null
+++ b/fer/gnl/add_attribute.F
@@ -0,0 +1,187 @@
+
+
+      SUBROUTINE ADD_ATTRIBUTE( grid_data, mr, varattname, dset, 
+     .         attype_spec, attoutflag, new_att, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*  add a new attribute to a variable
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* 9/2005
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+
+      include 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'netcdf.inc'
+
+* local parameter declarations:
+      INTEGER  max_line_len
+      PARAMETER ( max_line_len = 2048 )
+
+* calling argument declarations:
+
+      LOGICAL new_att
+      INTEGER mr, attype_spec, dset, attoutflag, status
+      REAL grid_data(mr_lo_ss(mr,1):mr_hi_ss(mr,1),
+     .               mr_lo_ss(mr,2):mr_hi_ss(mr,2),
+     .               mr_lo_ss(mr,3):mr_hi_ss(mr,3),
+     .               mr_lo_ss(mr,4):mr_hi_ss(mr,4),
+     .               mr_lo_ss(mr,5):mr_hi_ss(mr,5),
+     .               mr_lo_ss(mr,6):mr_hi_ss(mr,6))
+      CHARACTER*(*) varattname
+
+* local variable declarations: 
+      
+      LOGICAL valid, do_err
+      INTEGER MR_DIM_LEN, TM_LENSTR1, varid, idim, ndims, attlen,
+     .        attype, span, lo(nferdims), hi(nferdims), del(nferdims), slen, vlen
+      REAL dummy
+      CHARACTER GET_STRING_ELEMENT*2048, TM_FMT*2048, attbuff*2048, 
+     .          varname*512, attname*128
+
+      vlen = TM_LENSTR1(varattname)  
+      new_att = .TRUE.
+
+! Check that the expresssion is 1-D and if it is a string, just 1 value.
+
+      ndims = 0
+      attlen = 0
+      DO 30 idim = 1, nferdims
+         span = MR_DIM_LEN(idim, mr )
+         valid = mr_lo_ss( mr,idim ) .NE. unspecified_int4
+         IF (span .GT. 0 .AND. valid ) ndims = ndims + 1
+         attlen = MAX(attlen, span)
+ 30   CONTINUE
+
+* * * * * DETERMINE INDEX LIMITS * * *
+      DO 40 idim = 1, nferdims
+         lo(idim) = mr_lo_ss( mr, idim )
+         hi(idim) = mr_hi_ss( mr, idim )
+         del(idim)= 1
+ 40   CONTINUE
+
+      IF (ndims .LT. 0 .OR. ndims .GT. 1) GOTO 5100
+
+* Reconcile data types for the attribute. If requested to add a float attribute
+* but the expression is a string, it is an error.  If a string was requested,
+* we can convert a numeric value to string below.
+
+      IF (attype_spec .EQ. ptype_float  .AND. 
+     .    mr_type(mr) .NE. ptype_float) GOTO 5300
+
+      attype = NCFLOAT
+      IF (mr_type(mr) .EQ. ptype_string .OR.
+     .    attype_spec .EQ. ptype_string ) attype = NCCHAR
+
+* See if the attribute already exists for the variable. (If it does
+* then one can use SET ATT). The flag do_err is false so no error message 
+* is issued in break_varattname if attr does not exist.
+
+      do_err = .FALSE.
+      CALL BREAK_VARATTNAME ( varattname, dset, varname, 
+     .              attname, varid, do_err, status )
+
+      IF (status .NE. ferr_ok) THEN
+         IF (attype .EQ. NCCHAR ) THEN
+
+* Requested string but provided a numeric expression.
+* Use first value of expression.
+
+            IF (mr_type(mr) .NE. ptype_string) THEN
+               attbuff = TM_FMT( 
+     .             grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6)),
+     .             8, 40, slen)
+               IF (attlen .GT. 1) THEN 
+                  CALL WARN ('Requested string attribute using a ',
+     .            'numeric expression. Using first value and ',
+     .            'converting to string')
+                  attlen = 1
+               ENDIF
+
+            ELSE
+               IF (attlen .GT. 1) GOTO 5200
+               attbuff = GET_STRING_ELEMENT(
+     .           lo(1), hi(1), lo(2), hi(2), lo(3), hi(3), 
+     .	         lo(4), hi(4), lo(5), hi(5), lo(6), hi(6),
+     .           grid_data, lo(1), lo(2), lo(3), lo(4), lo(5), lo(6),
+     .	         max_line_len, slen)
+
+               dummy = 1.
+               attlen = TM_LENSTR1(attbuff)    
+
+            ENDIF
+            CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, attlen, 
+     .         attoutflag, attbuff, dummy, status)  
+
+         ELSE 
+            attype = NCFLOAT
+            CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, attlen, 
+     .         attoutflag, attbuff, 
+     .         grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6)), status)      
+         ENDIF
+
+!  If attribute already exists, error
+
+      ELSE
+c         GOTO 5400
+         new_att = .FALSE.
+      ENDIF
+
+ 5000 RETURN
+ 5100 attbuff = varattname(:vlen)
+      CALL ERRMSG( ferr_syntax, status,
+     .  'attribute values must be 1 dimensional: '//
+     .   attbuff(:vlen),*5000 )
+
+ 5200 attbuff = varattname(:vlen)
+      CALL ERRMSG( ferr_syntax, status,
+     .  'String attribute may contain just one string: '//
+     .  attbuff(:vlen),*5000 )
+
+ 5300 attbuff = varattname(:vlen)
+      CALL ERRMSG( ferr_syntax, status,
+     .  'Attribute type does not match expression: '//
+     .   attbuff(:vlen),*5000)
+
+ 5400 attbuff = varattname(:vlen)
+      CALL ERRMSG( ferr_syntax, status,
+     .  'Attribute already exists: '//attbuff(:vlen)//
+     .  ' Use SET ATTRIBUTE to change an attribute',*5000)
+
+      END
diff --git a/fer/gnl/alias_command.F b/fer/gnl/alias_command.F
new file mode 100644
index 0000000..b744fe9
--- /dev/null
+++ b/fer/gnl/alias_command.F
@@ -0,0 +1,124 @@
+	SUBROUTINE ALIAS_COMMAND( buffer, clen, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if an alias was used to abbreviate the command and replace with
+* the full string if so
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  2/8/90
+* V230:  1/27/92 - added QUIT, DATA, and REGION
+*           2/92 - improved logic to permit aliases of less than 4 chars
+*         6/8/92 - upper bound of aliases changed to reflext DEFINE ALIAS
+*        6/19/92 - alias names 8 characters
+*        7/29/92 - uses ALIAS_ID
+* V300: take abnormal return if alias substitution occurs
+* V313: *sh* AIX port.  logic for replacing buffer doesn't work
+* v4.5: 8/97 *kob* AIX bug fix - added check for cpos to locate tabs in
+*                           command line
+*     :10/97 *kob* Check to see if alen = clen. if so set buffer to the 
+*                  alias.  new version of DEC fortran caught the error in
+*                  the string concatenation.
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+* *sh* 11/2013 - allow an "=" as the end of an alias, soo "vtree=all" becomes legal
+
+
+* calling argument declarations:
+	INTEGER	  clen
+	CHARACTER buffer*(*)
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, ALIAS_ID, 
+     .          alen, true_len, i, spos, bpos, cpos, epos
+
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+	include 'ferret.parm'
+	include 'xcommand.cmn'
+
+#ifdef AIX_XLF
+	include 'xrisc.cmn'
+#endif
+
+* what is the alias command name length - terminated by "/" or " " (or tab or "=")
+        alen = 8
+        spos = INDEX(buffer(:alen),'/')
+        bpos = INDEX(buffer(:alen),' ') 
+* 8/97 check for tab - it can be end of alias
+	cpos = INDEX(buffer(:alen),tab)
+	IF ( cpos .EQ. 0 ) cpos = clen + 1
+	IF ( bpos .EQ. 0 ) bpos = clen + 1
+	bpos = MIN( cpos, bpos )
+* 11/13 similar check for "="
+	epos = INDEX(buffer(:alen),'=')
+	IF ( epos .EQ. 0 ) epos = clen + 1
+	bpos = MIN( epos, bpos )
+        IF ( spos .NE. 0 ) alen = spos - 1
+        alen = MIN( alen, bpos - 1 )
+        
+* identify the alias
+        i = ALIAS_ID( buffer(:alen) ) 
+
+* substitute alias text if appropriate
+        IF ( i .NE. unspecified_int4 ) THEN
+	   true_len = TM_LENSTR1( alias(i) )
+* 10/97 *kob* added check to see if passed in length is same as alias lenght
+	   IF (alen .EQ. clen) THEN
+	      buffer = alias(i)
+	   ELSE
+#ifdef AIX_XLF
+	      risc_buff = buffer(alen+1:clen)
+	      buffer = alias(i)(:true_len)//risc_buff(:clen-alen)
+#else
+	      buffer = alias(i)(:true_len)//buffer(alen+1:clen)
+#endif
+	   ENDIF
+	   clen = clen + ( true_len - alen )	   
+	   RETURN 1    ! abnormal return if substitution
+	ENDIF
+
+* no substitution
+	RETURN
+	END
diff --git a/fer/gnl/alias_id.F b/fer/gnl/alias_id.F
new file mode 100644
index 0000000..6458365
--- /dev/null
+++ b/fer/gnl/alias_id.F
@@ -0,0 +1,80 @@
+	INTEGER FUNCTION ALIAS_ID( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the given string as an alias - retunr unspecified_int4 if not
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  7/29/92 - from ALIAS_COMMAND
+* V320:  8/18/94 - *KOB* IBM port - changed declaration of MATCH4 from	
+*				    integer to logical
+* V603   5/07    - *acm* Just return if the test string is length 0.
+* V685+ 12/13    - *acm* bounds checking; return if len(string) is 0.
+
+* calling argument declarations:
+	CHARACTER string*(*)
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, TM_LENSTR, alen, i,
+     .          len_test, len_mchars
+	LOGICAL	MATCH4
+
+	include 'ferret.parm'
+	include 'xcommand.cmn'
+
+* length of test string
+	IF (LEN(string) .EQ. 0) GOTO 200
+
+        alen = TM_LENSTR1( string )
+        len_test = TM_LENSTR(string(:alen))
+        IF (len_test .EQ. 0) GOTO 200
+* against possible aliases
+	DO 100 i = 1, total_num_alias
+           IF ( alias(i) .EQ. unspecified_name4 ) GOTO 100
+           len_mchars = TM_LENSTR(alias_name(i)(:4))
+	   IF ( MATCH4(string(:alen),len_test,
+     .          alias_name(i),len_mchars) ) THEN
+              ALIAS_ID = i
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* no match
+ 200    ALIAS_ID = unspecified_int4
+	RETURN
+	END
diff --git a/fer/gnl/all_1_arg.F b/fer/gnl/all_1_arg.F
new file mode 100644
index 0000000..254c833
--- /dev/null
+++ b/fer/gnl/all_1_arg.F
@@ -0,0 +1,81 @@
+	SUBROUTINE ALL_1_ARG
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* treat all the arguments identified by PARSE_COMMAND as a single argument
+* example cases that this has to address:
+*	message "hello world" 
+*	message "hello" "world"
+*	message " "hello" "world" "     - unclear what to do ...
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V300: 4/22/93
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+
+* internal variable declarations:
+	INTEGER i
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xprog_state.cmn'
+
+* reset the command common to look like a single big argument
+
+	IF ( num_args .GT. 1 ) THEN
+
+	   arg_end(1) = arg_end(num_args)
+
+* protect against lost " from start of:  message "hello" "world"
+	   i = arg_start(1) - 1
+	   IF ( cmnd_buff(i:i) .EQ. '"' ) arg_start(1) = i
+
+* protect against lost " from end of:  message "hello" "world"
+	   i = arg_end(1) + 1
+	   IF ( i .LE. len_cmnd ) THEN
+	      IF ( cmnd_buff(i:i) .EQ. '"' ) arg_end(1) = i
+	   ENDIF
+
+	   num_args = 1
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/gnl/arg_string.F b/fer/gnl/arg_string.F
new file mode 100644
index 0000000..af4f243
--- /dev/null
+++ b/fer/gnl/arg_string.F
@@ -0,0 +1,83 @@
+	CHARACTER*(*) FUNCTION ARG_STRING( val )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a text string representing the value "val"
+* if val is unspecified (bad_val4) then return blank, else start with a colon
+* if val is integer then format it as such
+* declare length of ARG_STRING in calling program to be at least 11
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/21/87
+* V230: 8/18/92 - eliminated string(1:) notation for MAC compatibility
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	REAL val
+
+* internal variable declarations:
+	INTEGER	  i, llen, arg_string_len
+	CHARACTER LEFINT*4
+
+* initialiaze
+        arg_string_len = LEN( ARG_STRING )
+
+	IF ( val .EQ. bad_val4 ) THEN
+	   ARG_STRING = ' '
+
+	ELSE
+	   ARG_STRING(1:1) = ':'
+* ... truncate to integer if possible
+	   IF ( ABS(val) .LT. 10000 ) THEN
+	      i = INT( val )
+	   ELSE
+	      i = 0
+	   ENDIF
+* ... use left justified I format if appropriate
+	   IF ( FLOAT( i ) .EQ. val ) THEN
+	      ARG_STRING(2:arg_string_len) = LEFINT( i, llen )
+	   ELSE
+	      WRITE ( ARG_STRING(2:arg_string_len), '(1PG10.4)' ) val
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/gnl/atom_pos.F b/fer/gnl/atom_pos.F
new file mode 100644
index 0000000..00d568d
--- /dev/null
+++ b/fer/gnl/atom_pos.F
@@ -0,0 +1,93 @@
+	INTEGER FUNCTION ATOM_POS ( string, atom )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the position of the atom within the string
+* if the atom is the last character in the string this represents an error
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/23/86
+* revision 0.1 - 3/23/88  - bypass embedded quotated strings during search
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+	CHARACTER*1	atom
+
+* internal variable declarations:
+	INTEGER		pos, slen
+
+* initialize
+	slen = LEN( string )
+	pos  = 1
+
+* loop top
+ 100	CONTINUE
+
+* quotated string ?
+	IF ( string(pos:pos) .EQ. '"' ) THEN
+	   DO 110 pos = pos+1, slen
+	      IF ( string(pos:pos) .EQ. '"' ) GOTO 200
+ 110	   CONTINUE
+* ... unclosed quotation mark - flag it as a syntax error
+	   ATOM_POS = atom_illegal_pos
+	   RETURN
+
+* found it ?
+	ELSEIF ( string(pos:pos) .EQ. atom ) THEN
+	   IF ( pos .EQ. slen ) THEN
+	      ATOM_POS = atom_illegal_pos
+	   ELSE
+	      ATOM_POS = pos
+	   ENDIF
+	   RETURN
+	ENDIF
+
+* keep on looking ?
+ 200	IF ( pos .LT. slen ) THEN
+	   pos = pos + 1
+	   GOTO 100
+	ENDIF
+
+* no joy
+	ATOM_POS = atom_not_found
+	RETURN
+	END
diff --git a/fer/gnl/auto_filename.F b/fer/gnl/auto_filename.F
new file mode 100644
index 0000000..120b2ee
--- /dev/null
+++ b/fer/gnl/auto_filename.F
@@ -0,0 +1,169 @@
+	CHARACTER*(*) FUNCTION AUTO_FILENAME( coding, cx, mr, flen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string describing the data set, region, transformations and variable
+* that is suitable for a filename for listed output
+
+* format is Wdddddddvvvv.iiiiijjjjjkkkkklllllmmmmmnnnnn
+* where ddddd is the data set id
+* 	vvvv identifies the variable or expression
+* and	iiiii,jjjjj,kkkkk,lllll,mmmmm,nnnnn identify the axis regions and transformations
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/26/87
+* revision 0.1 - 3/10/88 - eliminated HASH_NAME (moved to VAR_CODE)
+* revision 0.2 - 6/27/88 - "coding" received in CALL instead of XPROG_STATE.CMN
+* V200:  5/19/89 - 4D symmetrical
+*	12/19/89 - eliminated the possibility of multiple data set variables
+* Unix/RISC port - 9/91 - GET_DSET_NAME --> GET_SHORT_DSET_NAME (no path)
+* SUN port - cleaned up the calculation of flen using risc_buff
+* V230:  6/9/92 - distinct requirements for netCDF: "F" leadin character and
+*                 extension ".cdf"
+*               - also added protections against name overflowing buffer
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xtext_info.cmn'
+	include 'xprog_state.cmn'
+        include 'xrisc.cmn'
+
+* calling argument declarations
+	CHARACTER*(*)	coding
+	INTEGER		cx, mr, flen
+
+* local parameter declarations:
+	LOGICAL    no_decims
+	PARAMETER( no_decims = .FALSE. )
+
+* local variable declarations:
+	LOGICAL	  include_dset, include_vcode, include_axis(nferdims)
+	CHARACTER LOHI_WORLD*24, LEGAL_CHARS*24, CX_DIM_STR*24,
+     .		  LEFINT*4, SANITARY_VAR_CODE*4
+	INTEGER TM_LENSTR,
+     .		slen, leg_len, dset, idim, minus, mp
+	
+* determine special mods requested via "AUTO-q" where "q" is X,Y,Z,T,I,J,K,L,D,V
+	minus = INDEX( coding, '-' )
+	IF ( minus .EQ. 0 ) THEN
+	   include_dset  = .TRUE.
+	   include_vcode = .TRUE.
+	   DO 10 idim = 1, nferdims
+ 10	   include_axis( idim ) = .TRUE.
+	ELSE
+	   mp = minus + 1
+	   include_dset  = INDEX(coding(mp:), 'D' ) .EQ. 0
+	   include_vcode = INDEX(coding(mp:), 'V' ) .EQ. 0
+	   DO 20 idim = 1, nferdims
+	   include_axis( idim ) = 
+     .			INDEX(coding(mp:), ww_dim_name(idim) ) .EQ. 0
+     .		  .AND. INDEX(coding(mp:), ss_dim_name(idim) ) .EQ. 0
+ 20	   CONTINUE
+	ENDIF
+
+* don't include information on axes that are irrelevant
+	DO 30 idim = 1, nferdims
+	  IF ( cx_lo_ww(idim,cx) .EQ. unspecified_val8 )
+     .						include_axis(idim) = .FALSE.
+ 30	CONTINUE
+
+* special lead-in characters (so DIR listings are neat)
+        IF ( list_fmt_type .EQ. plist_unformatted ) THEN
+           risc_buff = 'UNF'
+           flen = 3
+        ELSEIF ( list_fmt_type .EQ. plist_epic ) THEN
+           risc_buff = 'EP'
+           flen = 2
+        ELSEIF ( list_fmt_type .EQ. plist_gt ) THEN
+           risc_buff = 'GT'
+           flen = 2
+        ELSEIF ( list_fmt_type .EQ. plist_CDF ) THEN
+           risc_buff = 'F'
+           flen = 1
+        ELSE
+           risc_buff = 'W'
+	   flen = 1
+        ENDIF
+
+* data set name or "nnnsets"
+	IF ( include_dset ) THEN
+	   dset = cx_data_set( cx )
+	   IF ( dset .NE. pdset_irrelevant ) THEN
+	      CALL GET_SHORT_DSET_NAME( dset, risc_buff(flen+1:), slen )
+	      flen = flen + slen
+	   ENDIF
+	ENDIF
+
+* variable code or Ennn ( random hashed number to represent the expression )
+	IF ( include_vcode ) THEN
+           risc_buff( flen+1:flen+4 ) = SANITARY_VAR_CODE
+     .                          ( mr_category(mr), mr_variable(mr) )
+	   flen = TM_LENSTR( risc_buff(:flen+4) )
+	ENDIF
+
+* netCDF filenames replace the elaborate AUTOFILENAME extension with ".cdf"
+        IF ( list_fmt_type .EQ. plist_CDF ) THEN
+           risc_buff = risc_buff(:flen) // '.cdf'
+           flen = flen + 4
+        ELSE
+* non-netCDF filenames:
+* point to separate name from extension
+	   flen = flen + 1
+	   risc_buff( flen:flen ) = '.'
+
+* all relevant axis limits
+	   DO 100 idim = 1, nferdims
+	      IF ( include_axis( idim ) 
+     .	  .   AND. cx_lo_ss( cx, idim ) .NE. unspecified_int4 ) THEN
+	         risc_buff( flen+1:) = LEGAL_CHARS(
+     .		   CX_DIM_STR(idim,cx,':',no_decims,slen), leg_len )
+	         flen = flen + leg_len
+	      ENDIF
+ 100	   CONTINUE
+        ENDIF
+
+* pass result back - overwrite garbage from "LEGAL_CHARS" with blanks
+        risc_buff(flen+1:) = ' '
+	AUTO_FILENAME = risc_buff
+
+	RETURN
+	END
diff --git a/fer/gnl/cancel_data_set.F b/fer/gnl/cancel_data_set.F
new file mode 100644
index 0000000..861f6e7
--- /dev/null
+++ b/fer/gnl/cancel_data_set.F
@@ -0,0 +1,223 @@
+	SUBROUTINE CANCEL_DATA_SET( iset, is_all, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* close and delete all dependening on a data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:	10/20/89 - extracted from XEQ_CANCEL with enhancements to accept /ALL
+*		   and data set names
+*	 12/8/89 - if saved_dset is cancelled then indicate that
+* Unix/RISC port 8/91 *sh*
+*     bug fix: calling var, iset, was used as an internal loop index
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V533: *sh* 6/01 - close set after deletions to avoid "%%" diagnostics
+* V685 *acm* 4/13 - If its a member of an aggregation, also close the aggregation.
+*                   Pass in whether this was "all", if so dont issue the
+*                   note for canceling a member dataset
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xdset_parms.cmn'
+	include 'xprog_state.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xrisc.cmn'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	LOGICAL is_all
+	INTEGER	iset, status
+
+* local variable declarations:
+	LOGICAL hidden
+	INTEGER TM_LENSTR1
+	INTEGER	iclim, iclim_user, i, nmemb, imemb, membset, 
+     .          mlen, slen1, slen2, cset, close_it, nv, igrid, 
+     .          ens_line, agg_dim, iens
+	CHARACTER*20 agg_msg
+	CHARACTER*8 TM_FMT, set1, set2
+
+* Recursive loop. If canceling a dset that is a member of an ensemble 
+* or ensembles, we will come back here and cancel the ensemble set too.
+
+	iens = 1
+	cset = iset
+
+100	CONTINUE
+
+	IF (cset .EQ. 0) GOTO 300
+
+* Will want to cancel the ensemble axis
+	ens_line = 0
+	IF (ds_type(cset) .EQ. 'ENS') THEN
+	   agg_dim = 5
+	   DO 10 nv = 1, maxvars
+ 	      IF (ds_var_setnum(nv) .EQ. cset) THEN
+	          igrid = ds_grid_number(nv)
+		  ens_line = grid_line(agg_dim, igrid)
+		  GOTO 15  ! only 1 ensemble axis per ens. dataset
+	      ENDIF
+   10	   CONTINUE
+   15	   CONTINUE
+   
+	ENDIF
+
+* purge and delete any cat_pystat_var variables associated with this dataset
+        CALL DELETE_PYSTAT_DSET_VARS( iset )
+
+* delete any memory variables from this data set
+* ( necessary because their pointers will lead to incorrect data set 
+*   information and possibly misleading output )
+	CALL ERASE_DSET( cset )
+
+* delete all user defined data from memory for similar reasons
+* (note: this is unnecessarily strict - could be refined in the future)
+	CALL PURGE_ALL_UVARS
+	
+* If canceling an aggregation then reset the hidden setting to the 
+* default for member datasets.  Check on ens_line finds cases where
+* an ensemeble datset was created but has no variables.
+
+	IF (ds_type(cset).EQ.'ENS' .AND. ens_line.GT.0) THEN
+
+* Get number of aggregation members
+	   CALL CD_GET_AGG_DSET_INFO (cset, nmemb, status)
+
+* Look through the aggregation members.
+
+	   hidden = .FALSE.
+	   DO 20 imemb = 1, nmemb
+	      CALL CD_GET_AGG_DSET_MEMBER (cset, imemb, membset, status)
+	      IF (status .NE. ferr_ok) GOTO 20
+	      IF (ds_hide(membset)) hidden = .TRUE.
+	      ds_hide(membset) = .FALSE.
+  20	   CONTINUE
+  
+	   IF (hidden) THEN
+	     risc_buff = 
+     .	   'Cancel aggregate dataset. Un-hiding hidden member datasets'
+	     CALL WARN(risc_buff)
+	   ENDIF
+
+	ENDIF
+
+* close and cancel the data set
+	CALL TM_CLOSE_SET( cset, status )
+	IF ( status .NE. merr_ok ) RETURN
+
+* Cancel the ensemble axis
+	IF ( ens_line .NE. 0) CALL DELETE_ONE_LINE (ens_line, status)
+
+* Was the original dataset to close a member of an aggregation?  If so cancel 
+* the aggregation set. If we implement other aggregations, set agg_msg depending 
+* on the ds_type direction.
+
+	cset = iset
+	close_it = 0
+	DO 50 i = iens, maxdsets
+	   IF (ds_type(i) .EQ. 'ENS') THEN
+	      agg_msg = 'ensemble'
+	      mlen = TM_LENSTR1(agg_msg)
+
+* Get number of aggregation members
+	      CALL CD_GET_AGG_DSET_INFO (i, nmemb, status)
+
+* Look through the aggregation members.
+
+	      DO 40 imemb = 1, nmemb
+	         CALL CD_GET_AGG_DSET_MEMBER (i, imemb, membset, status)
+		 IF (status .NE. ferr_ok) GOTO 40
+
+* Was cset a member of this aggregation? If so close the aggregation
+
+		 IF (imemb .EQ. cset) THEN 
+		    set1 = TM_FMT (float(cset), 8, 8, slen1)
+		    set2 = TM_FMT (float(i), 8, 8, slen2)
+
+		    IF (.NOT. is_all) THEN
+		       WRITE (risc_buff, 1000) set1(:slen1), agg_msg(:mlen), 
+     .                     agg_msg(:mlen),set2(:slen2)
+		       CALL WARN(risc_buff)
+		    ENDIF
+		    
+* ! Found a match. Go close this aggregation set
+		    close_it = i
+		    cset = i
+		    iens = i+1
+		    GOTO 60 
+
+		 ENDIF
+  40	      CONTINUE
+	   ENDIF
+  50	CONTINUE
+  60	CONTINUE
+  
+	IF (close_it .GT. 0) GOTO 100
+
+ 1000	FORMAT ('Dataset ', A,' was a member of an ', A,'. Canceling ',
+     .        A,', dataset ', A)
+
+  300	CONTINUE
+
+* no longer the saved data set ?
+	IF ( iset .EQ. saved_dset ) saved_dset = unspecified_int4
+
+* was this a climatological air temp field ?
+	DO 400 iclim = 1, max_airt_clim
+ 	   IF ( dp_airt_dset(iclim) .EQ. iset ) THEN
+	      dp_airt_dset(iclim) = unspecified_int4
+	      GOTO 500
+	   ENDIF
+ 400	CONTINUE
+* ... no - we're done
+	RETURN
+
+* ... yes - delete any variables that may have used it
+*     ( a precaution against mixed up clim. data sets )
+ 500	DO 600 iclim_user = 1, maxdsets
+	   IF ( dp_clim_air_sst(iclim_user) .EQ. iclim )
+     .                                   CALL ERASE_DSET( iset )
+ 600	CONTINUE
+
+        RETURN
+	END
diff --git a/fer/gnl/cdf_list.F b/fer/gnl/cdf_list.F
new file mode 100644
index 0000000..31d67bf
--- /dev/null
+++ b/fer/gnl/cdf_list.F
@@ -0,0 +1,1219 @@
+	SUBROUTINE CDF_LIST ( memory, fname, append, crecdim, nvars,
+     .			      mr_list, cx_list, title, enhead, mode,
+     .			      clobber, edges_flag, do_bounds, 
+     .			      keepax_flag, out_type, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write the indicated list of variables out in netCDF format
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  6/92
+*       8/18/92 - added "_FillValue" attribute to pre-fill missing gaps      
+*       11/4/92 - expanded user variable name length
+* V320: 5/94 - array "memory" as a calling argument
+*       8/94 - added qualifiers /ILIMITS=, /JLIMITS, etc.
+*	11/94 - output "title" and "long_name_mod" in addition to global
+*		and variable "history" attributes ("history" ignored on input)
+*	 1/95 - bug introduced 8/94: error branch to 5300 causes crash 
+*     1/25/95 - added argument "enhead" for enhanced heading control
+* V411: 9/95 - corrected wrong type declaration of ISUBSCRIPT (discovered
+*		only on IBM port)
+* V450: 11/96 - added argument clobber to allow deletion of file
+*		added argument "mode" and code to support NetCDF cache suitable
+*		for DODS. Since DODS communications are stateless a cached
+*		version of a remote file which contains all of the metadata
+*		and coordinates is sufficient to prepare Ferret to read
+*		remote DODS data. Only ncopn need be called then on the
+*		remote file.
+* Linux Port - 6/97 - reorder if def logic when setting cd_data_type to 
+*                     BYTE or INTEGER*1
+*		    - create equivalences so that all CD_WRITEVAL calls have
+*			the same arg daat types
+* kob*   9/97 - replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in order
+*               to have access to context information - needed for negative
+*               time step processing
+* V500 *kob* 3/99- up SANITARY_VAR_CODE and local variable varcode to 64 chars
+*             and VAR_UNITS to 64
+* V512; *sh* 7/00 - allow SAVE/ILIMITS=n:n (no range) - new arg to EQUAL_RANGE
+* V530; *sh* 12/00 - defer writing of axis coordinates and variable data values
+*		to a single consolidated point at the end -- to alleviate
+*		performance problems due to switching netCDF modes
+* V530 *acm* 3/01 pass calendar ID to EQUAL_RANGE
+*            4/16/01 properly declare TM_GET_CALENDAR_ID as integer
+* V533 *sh* 6/01 - added support for netCDF output string variables
+* V600 *acm* 8/05 - Allow more digits in xrevision number
+* V552 *acm* 4/03- up SANITARY_VAR_CODE and local variable varcode to 128 chars
+* V600 *acm* 6/06  Attribute control; get information for output from  
+*                  linked-list structure.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V601 10/06 *acm* Fix bug, bug 1454 if the user has set title or units, the users
+*                  value is written, previously had always only got these from the
+*                  attribute structure, so the new values were not saved.
+* V601 10/06 *acm* Fix bug 1460; for value of string attributes, buff is 2048, 
+*                  so set buff_size to match. Also, when looping through attributes
+*                  (DO 200 loop) only get attribute values from the linked list structure
+*                  if they are to be written to the output file.
+* V601 10/06 *acm* fix bug 1451, cd_write_var needs the value of mode_upcase_output.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V604  7/07 *acm* Fix bug 1520, if a var has only a _FillValue attribute, and not a 
+*                  missing_value one, then neither was written to the output file.
+*                  Both should be written.
+* V612 8/08  *acm* Fix bug 1587: so that correct bounds are written for axes of a 
+*                  user-defined variable, send the dataset number of the underlying 
+*                  dataset to cd_write_var
+* V62  *acm*  2/09 - Fix bug 1634: allow SAVE/KEEP_AXISNAMES so that child axis names
+*                    arent written. They can get too long for OPeNDAP library calls
+* V62  *acm*  3/09 - Allow for CANCEL ATT/OUTPUT var.missing_flag and var._FillValue
+*                   the special code for these made it impossible to turn off writing
+*                   these attributes.
+* V641 *acm*  1/10 -Fix bug 1715: packing data on output (bug is in ordering of args
+*                   in call to NC_GET_ATTRIB for add_offset, also fix up the output 
+*                   missing and FillValue flags which werent correct.)
+* V65  *acm*  1/10  Data from some datasets get a mismatch between _FillValue and 
+*                   data on output. Fix this.
+*       *acm* 3/12  Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12  The record axis must be the last (slowest varying) axis. If a 
+*                   time axis is written, and an E or F axis is written, then write 
+*                   in /RIGID mode, with no record axis.
+* V680  5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V683  8/12 *acm*  New SET LIST/OUTTYPE and SAVE/OUTTYPE 
+* V683 12/12 *acm*  Fix ticket 2004: appending data when writing packed variable
+* V685 *acm*  3/13  List the full path or url in the history att for variable.
+* V685 6/13 *acm* new qualifier SAVE/NOBOUNDS
+* V685 6/13 *acm* Dont add SAVE/NOCOORDS
+* v685 6/13 *acm*  bug 2081. For string vars, if the len comes back as 0 the variable contains 
+*                  just null strings. Set maxstrlen to 1, else we can't define the variable.
+* V686 12/13*acm* For string variables from datasets, keep the string-dimension name and length
+*                 from the original dataset on output.
+* V686 1/14 *acm* Fix ticket 2136: Appending a string variable to a dataset.
+* V687 3/14 *acm* Correct the writing of missing and fill attributes when writing a scaled
+*                 user-defined variable.	
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+#include "netcdf.inc"
+        include 'tmap_errors.parm'
+        include 'cd_lib.parm'
+        include 'cdf_tmap.parm'
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	include 'xdset_info.cmn_text'	! for DODS caching
+	include 'xdset_info.cd_equiv'	! for DODS caching
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xrevision.cmn'
+	include 'xtoday.cmn'
+	include 'xinterrupt.cmn'
+        include 'netcdf4_settings.cmn'
+
+* calling argument declarations:
+        LOGICAL         append, enhead, clobber
+	INTEGER		nvars, mr_list(nvars), cx_list(nvars), mode,
+     .			edges_flag, keepax_flag, do_bounds, status
+	REAL		memory( mem_blk_size, max_mem_blks )
+        CHARACTER*(*)   fname, title, out_type
+        CHARACTER*1     crecdim
+
+* internal variable declarations:
+        LOGICAL         TM_LEGAL_NAME, MATCH_NAME,
+     .			itsa_uvar, need_doc, new, formatted, flushed,
+     .			itsa_string, output_units, output_title,
+     .                  output_history, get_ds
+	INTEGER		TM_LENSTR1, ISUBSCR_CX, GET_MAX_C_STRING_LEN,
+     .			MGRID_SIZE, STR_SAME, 
+     .			cx, mr, dset, grid, cdfid, ivar, nready,
+     .                  lbuff, cdfstat, idim, i, loc, errloc,
+     .                  recdim, cat, var, cat1, var1, iaxis,
+     .			final_status, type, maxstrlen, 
+     .			write_lo(nferdims), write_hi(nferdims), 
+     .			make_lo(nferdims), make_hi(nferdims),
+     .                  dset_last, dset_num, attid, len
+
+* *kob* 3/99- up SANITARY_VAR_CODE and local variable varcode to 64 chars
+*             and VAR_UNITS to 64
+* V552 *acm* 4/03- up SANITARY_VAR_CODE and local variable varcode to 128 chars
+
+	CHARACTER	SANITARY_VAR_CODE*128, VAR_TITLE*140,
+     .                  VAR_TITLE_MOD*140, VAR_UNITS*64, CX_DIM_STR*48,
+     .                  TM_FMT*12,
+     .                  varcode*128, varname*128, buff*2048, revnum*12, 
+     .                  c1*1, aname*128, short*128
+
+	REAL*8		user_lo, user_hi, delta, loest_ww, hiest_ww,
+     .                  miss_in, fill_in, r_scale, r_off
+
+* local parameter declarations:
+        LOGICAL    already_warned
+	DATA    already_warned       / .FALSE. /
+
+* For error messages
+      CHARACTER*9 typnam(6)
+      DATA typnam/'NC_BYTE', 'NC_CHAR', 'NC_SHORT', 'NC_INT', 
+     .            'NC_FLOAT', 'NC_DOUBLE'/
+
+* special equivalence (not in tmap_format/xdset_info.cd_equiv because 
+* "BYTE" isnt supported on DECstation)
+* reorder loop logic because linux cpp didnt like it *kob* 10/96
+
+#   ifdef sun
+      BYTE cd_data_type(maxvars)
+#   else
+      INTEGER*1 cd_data_type(maxvars)
+#   endif
+
+	EQUIVALENCE ( ds_precision, cd_data_type )
+
+* internal equivalence so to match data types for F90
+#   ifdef sun
+      BYTE ibuff1
+#   else
+      INTEGER*1 ibuff1
+#   endif
+
+	REAL*4		rbuff4
+	REAL		vals(100), bad
+        REAL*8          dvals(100), scalefac, addoff
+	INTEGER*4	ibuff4
+	EQUIVALENCE (rbuff4, ibuff4), (rbuff4, ibuff1)
+
+* local parameter declarations
+
+        INTEGER         TM_GET_CALENDAR_ID, 
+     .                  buff_size, sslimits0, 
+     .			wwlimits0, cal_id, tax, varid, vartype, nvdims, 
+     .                  nvatts, vdims(8), iatt, slen, alen, istat, 
+     .                  attype, attlen, attoutflag, all_outflag,
+     .                  outtype, no_missing_flag, no_fill_flag, 
+     .                  varoutflag
+        LOGICAL         NC_GET_ATTRIB, NC_GET_ATTRIB_DP, 
+     .                  full_precision, DODS_cache, range_not_rqd,
+     .                  got_it, got_title, got_units, got_history,
+     .                  got_missing, got_fill, do_warn, coordvar
+
+        PARAMETER     ( buff_size = 2048,
+     .			sslimits0 = 1+23-1,
+     .			wwlimits0 = 1+29-1,
+     .                  full_precision = .TRUE.,
+     .			range_not_rqd = .FALSE. )
+	CHARACTER	cal_name*32 , attname*128, buff1*128, buff2*128
+
+* initialize
+	 ivar = 1  ! just house-keeping -- make sure all is init'ed
+	 flushed = .FALSE. ! on error, whether OK variables were written
+	 final_status = ferr_ok  ! innocent unless proven guilty
+	 DODS_cache = mode .EQ. pcdf_mode_cache
+         do_warn = .TRUE.
+	 got_missing = .FALSE.
+	 got_fill = .FALSE.
+
+         CALL CD_DEFER_COORD_WRITE(0,0,0,0,0,pcd_defer_init)
+
+* open/create the file
+         CALL CD_OPEN_OUT( fname, append, cdfid, clobber, 
+     .                     netcdf4_type, status )
+         IF ( status .NE. merr_ok ) GOTO 5400
+
+* update history attribute in the file
+        revnum = TM_FMT(revision_level, 5, 12, slen)
+
+        CALL CD_STAMP_OUT( append, cdfid,
+     .       program_name(:len_program_name)//' V'//revnum(:slen)//' '//
+     .       progname_mod(:len_progname_mod)//' '//today_date, status )
+        IF ( status .NE. merr_ok ) GOTO 5800
+
+* update Conventions attribute in the file
+        buff1 = 'CF-1.0'
+
+        CALL CD_CONVENTIONS_OUT( append, cdfid, buff1, status )
+        IF ( status .NE. merr_ok ) GOTO 5800
+
+* optional title for data set
+	IF ( title .NE. ' ' ) THEN
+	   CALL CD_WRITE_ATTRIB(cdfid, pcdf_global, 'title',
+     .			title(:TM_LENSTR1(title)), .FALSE., status )
+           IF ( status .NE. merr_ok ) GOTO 5800
+	ENDIF
+
+* DODS URL saved as a global attribute (11/96)
+	IF ( DODS_cache ) THEN
+! note that routine CDF_PREP_CACHE is assumore med to have checked the validity
+!      of the data set as a DODS data set
+           dset = cx_data_set(cx_list(1))
+	   CALL CD_WRITE_ATTRIB(cdfid, pcdf_global, 'DODS_URL',
+     .			ds_des_name(dset), .FALSE., status )
+           IF ( status .NE. merr_ok ) GOTO 5800
+	ENDIF
+
+* Other global attributes, if they have been marked for output.
+* Mark global attrs for output with SET ATT/OUT=ALL .
+
+        varid = 0      
+	cx  = cx_list(1)
+        dset = cx_data_set( cx )
+        IF (dset .GE. 1) THEN
+          IF (ds_type(dset) .EQ. 'CDF' .OR. ds_type(dset) .EQ. ' MC' 
+     .        .OR. ds_type(dset) .EQ. 'ENS')
+     .       CALL CDF_LIST_GLOBAL_ATTS (dset, cdfid, status)
+        ENDIF
+        dset_last = dset
+        scalefac = 1.
+        addoff = 0.
+
+*  Loop to create all of the variables and their metadata
+*  (defer writing of binary data until end) 
+*
+       DO 100 ivar = 1, nvars
+	   cx  = cx_list(ivar)
+	   mr  = mr_list(ivar)
+	   grid	= cx_grid( cx )
+           dset = cx_data_set( cx )
+           IF (dset_last .NE. dset) THEN
+              IF (dset .GE. 1) THEN
+                 IF (ds_type(dset) .EQ. 'CDF' .OR. 
+     .               ds_type(dset) .EQ. ' MC' .OR. 
+     .               ds_type(dset) .EQ. 'ENS')
+     .          CALL CDF_LIST_GLOBAL_ATTS (dset, cdfid, status)
+              ENDIF
+              dset_last = dset
+           ENDIF
+           cat = cx_category(cx)
+           var = cx_variable(cx)
+           varcode = SANITARY_VAR_CODE( cat, var )
+           got_title = .FALSE.
+           got_units = .FALSE.
+           got_history = .FALSE.
+           output_title = .FALSE.
+           output_title = .TRUE.  ! output the var long_name by default
+           output_units = .FALSE.
+           output_history = .TRUE.
+	   itsa_string = cx_type(cx) .EQ. ptype_string
+
+* is it in the linked-list for dset. If so get attr info, including original 
+* upper/lowercase form of the name. If mode upcase_output is set, then upcase 
+* the variable name.
+ 
+* For user-defined variables, with double-precision Ferret, write as double-precision
+* unless the user has requested otherwise.
+
+           itsa_uvar = cat .EQ. cat_user_var
+           IF (itsa_uvar .OR. dset .EQ. pdset_irrelevant) dset = -1
+           CALL CD_GET_VAR_ID (dset, varcode, varid, status)
+
+           vartype = 0
+           outtype = 0
+
+           IF (status .EQ. ferr_ok) THEN
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, nvdims, 
+     .            vdims, nvatts, coordvar, all_outflag, status)
+              varcode = varname
+              IF (mode_upcase_output) CALL STR_UPCASE( varcode, varname)
+              IF (dset .EQ. -1) THEN  !for user vars type not known in attrib structure
+                 vartype = 6  ! netcdf nf_double
+                 IF (itsa_string) vartype = 2
+              ENDIF
+              outtype = vartype
+
+* If there is an OUTTYPE attribute, that came from a SET VAR/OUTTYPE.
+* It will be superceded by a SET LIST/OUTTYPE or a SAVE/OUTTYPE setting,
+* applied just below.
+	      CALL CD_GET_VAR_OUTTYPE (dset, varid, outtype, status)
+
+* If its just an expression it doesnt have a varid in the attribute structure
+* for user-vars. Still set the output type.
+
+           ELSE
+              vartype = 6  ! netcdf nf_double
+              IF (itsa_string) vartype = 2
+           ENDIF
+   
+	   IF (outtype .EQ. 0) outtype = vartype
+
+* Setting made with SAVE/OUTTYPE or SET LIST/OUTTYPE
+* SAVE/OUTTYPE takes precedence over a SET LIST/OUTTYPE
+* out_type comes in from a SAVE/OUTTYPE  Use it if its not DFLT
+* list_outtype is from SET LIST/OUTTYPE  IF out_type is DFLT, use list_outtype
+
+	   IF ( out_type(1:3) .EQ. 'DFL') out_type = list_outtype
+
+	   IF (out_type(1:3) .EQ. 'DOU') outtype = nf_double
+	   IF (out_type(1:3) .EQ. 'FLO') outtype = nf_float
+	   IF (out_type(1:3) .EQ. 'INT') outtype = nf_int
+	   IF (out_type(1:3) .EQ. 'SHO') outtype = nf_short
+	   IF (out_type(1:3) .EQ. 'BYT') outtype = nf_byte
+
+* When the user requests higher precision output from a lower precision file 
+* variable, e.g. converting FLOAT to DOUBLE, write an attribute explaining 
+* that it contains data converted in this way.
+
+	   IF (dset .GT. 0 .AND. outtype.GT.vartype) THEN
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, 
+     .                  nvdims, vdims, nvatts, coordvar, varoutflag, 
+     .                  status) 
+
+              attname = 'Ferret_Precision_Note'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+	      IF (status.EQ.ferr_ok) 
+     .             CALL CD_DELETE_ATTRIBUTE(dset, varid, attname, status)
+	      slen = TM_LENSTR1(typnam(vartype))
+              alen = TM_LENSTR1(typnam(outtype))
+              CALL CD_PUT_NEW_ATTR (dset, varid, 
+     .              attname, 2, 61, 1, 
+     .              'This variable written using Ferret was converted from '//
+     .              typnam(vartype)(4:slen)//' to '//
+     .              typnam(outtype)(4:alen), 1., status )
+              IF (status .NE. ferr_ok) GOTO 5990
+
+	   ENDIF
+
+           IF ( cat .EQ. cat_pseudo_var )THEN
+	      varcode = varcode(:TM_LENSTR1(varcode))//"_"
+	      IF (varcode(1:1) .EQ. "_") varcode = varcode(2:TM_LENSTR1(varcode))
+	   ENDIF
+
+	   tax = grid_line(t_dim,grid)
+           cal_name = line_cal_name(tax)
+           cal_id = TM_GET_CALENDAR_ID ( cal_name )
+
+* allowed name?
+	   IF (cat .NE. cat_file_var) THEN
+              IF ( .NOT.TM_LEGAL_NAME(varcode) ) GOTO 5200
+              CALL FIND_VAR_NAME ( pdset_irrelevant, varcode, cat1, var1 )
+              IF (  var1 .NE. munknown_var_name
+     .      .AND. cat1 .EQ. cat_pseudo_var    ) GOTO 5200
+           ENDIF
+
+* if a string variable, then find max len
+* If the len comes back as 0 the variable contains just null strings.
+* Set maxstrlen to 1, else we cant define the variable.
+	   IF (itsa_string) THEN
+	      maxstrlen = GET_MAX_C_STRING_LEN(
+     .				   mr_c_pointer(mr), MGRID_SIZE(mr))
+	      IF (maxstrlen .LE. 0) maxstrlen = 1
+	   ELSE
+	      maxstrlen = 0
+	   ENDIF
+
+* get slab limits to use for writing the values of this variable
+           DO 50 idim = 1, nferdims
+* ... limits within which to write variable data
+              write_lo(idim) = cx_lo_ss(cx,idim)
+              write_hi(idim) = cx_hi_ss(cx,idim)
+* get slab limits to use for creating this NetCDF variable
+* (elaborate checking if user manually specifies creation limits)
+* ... limits within which to create NetCDF variable
+              make_lo(idim)  = write_lo(idim)
+              make_hi(idim)  = write_hi(idim)
+	      IF ( make_lo(idim) .NE. unspecified_int4 ) THEN
+	         iaxis = grid_line(idim,grid)
+* ... creation limits manually specified by world coordinates?
+	         loc = qual_given(wwlimits0+idim)
+                 IF ( loc .GT. 0 ) THEN
+		    errloc = loc
+	            CALL EQUAL_RANGE_T(
+     .			cmnd_buff(qual_start(loc):qual_end(loc)), idim,
+     .                  grid, user_lo, user_hi, delta, cal_id, status )
+                    IF ( status .NE. ferr_OK ) GOTO 5800
+	            CALL GRID_WORLD_EXTREMES( loest_ww, hiest_ww,
+     .			grid, idim )
+	            IF ( .NOT.line_modulo(iaxis) 
+     .		   .AND. ( user_lo .LT. loest_ww
+     .		      .OR. user_hi .GT. hiest_ww ) ) GOTO 5300
+	            make_lo(idim) = ISUBSCR_CX
+     .			( user_lo, grid, idim, cx, round_up )
+	            make_hi(idim) = ISUBSCR_CX 
+     .			( user_hi, grid, idim, cx, round_dn )
+	            IF ( .NOT.line_modulo(iaxis)  
+     .		   .AND. ( make_hi(idim) .GT. line_dim(iaxis)
+     .	              .OR. make_lo(idim) .LT. 1 )	   )	GOTO 5300
+	            IF ( make_lo(idim) .GT. write_lo(idim)
+     .		    .OR. make_hi(idim) .LT. write_hi(idim) ) 	GOTO 5310
+	         ENDIF
+* ... creation limits manually specified by subscript?
+	         loc = qual_given(sslimits0+idim)
+                 IF ( loc .GT. 0 ) THEN
+		    errloc = loc
+	            CALL EQUAL_RANGE(
+     .			cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                  idim, user_lo, user_hi, delta, formatted,
+     .			range_not_rqd, cal_id, status )
+                    IF ( status .NE. ferr_OK ) GOTO 5990
+	            make_lo(idim) = user_lo
+	            make_hi(idim) = user_hi
+	            IF ( .NOT.line_modulo(iaxis) 
+     .	           .AND. ( make_hi(idim) .GT. line_dim(iaxis)
+     .	              .OR. make_lo(idim) .LT. 1 )	      ) GOTO 5300
+	            IF ( make_lo(idim) .GT. write_lo(idim)
+     .		    .OR. make_hi(idim) .LT. write_hi(idim) ) 	GOTO 5310
+	         ENDIF
+	      ENDIF
+
+* ... if a time axis is written, and an E or F axis is written,
+*     then write in /RIGID mode, with no record axis.
+	      IF (idim .GT. t_dim .AND.
+     .	          make_lo(t_dim) .NE. unspecified_int4 .AND.
+     .	          make_lo(idim) .NE. unspecified_int4) THEN
+                 crecdim = 'N'
+		 IF (.NOT.already_warned) CALL WARN (
+     .	          'Saving E or F axis with time axis uses /RIGID in time')
+                 already_warned = .TRUE.
+	      ENDIF
+
+ 50        CONTINUE
+
+* determine the netCDF "record dimension" to use
+           IF ( write_lo(t_dim) .EQ. unspecified_int4 ) THEN
+              recdim = 0
+           ELSEIF ( crecdim .EQ. 'T' ) THEN
+              recdim = t_dim
+           ELSE
+              recdim = 0
+           ENDIF
+
+* convert the data type into netCDF parameter value
+           IF (DODS_cache .AND. cx_type(cx).EQ.unspecified_int4) THEN
+	      cx_type(cx) = nf_double
+	   ENDIF
+
+	   IF (cx_type(cx) .EQ. ptype_float) THEN
+	      type = nf_float
+	   ELSEIF  (cx_type(cx) .EQ. ptype_string) THEN
+	      type = nf_char
+	   ELSEIF  (cx_type(cx) .EQ. ptype_double) THEN
+	      type = nf_double
+	   ELSEIF  (cx_type(cx) .EQ. ptype_int4) THEN
+	      type = nf_int
+	   ELSEIF  (cx_type(cx) .EQ. ptype_int2) THEN
+	      type = nf_short
+	   ELSEIF  (cx_type(cx) .EQ. ptype_int1) THEN
+	      type = nf_byte
+	   ELSE
+	      CALL WARN('Internal err: unknown data type')
+	      type = nf_float
+	   ENDIF
+           IF (type .NE. 0 .AND. varid .GT. 0) type = outtype
+           IF (dset .EQ. -1) type = outtype
+           IF (type .EQ. 0) outtype = vartype
+
+* create the variable and its grid (coordinate output gets deferred)
+
+* If this is a user var the axes are based on the defining dset (if any).
+           dset_num = dset
+           IF (dset.EQ.-1 .AND. cx_data_set( cx ).GT.0)
+     .        dset_num = cx_data_set( cx )  
+
+           IF (type .EQ. NF_CHAR) THEN
+	     buff2 = ""
+             IF (dset_num .GE. 1 .AND.(.NOT.itsa_uvar)) THEN
+                CALL CD_GET_DS_DIMS (dset_num, vdims(1), buff2, len, status)
+                IF (maxstrlen .LE. len) maxstrlen = len
+             ENDIF
+           ENDIF
+
+           CALL CD_MAKE_VAR( cdfid, dset_num, varcode, type, maxstrlen,
+     .               grid, make_lo, make_hi, recdim, enhead, new, 
+     .               edges_flag, do_bounds, mode_upcase_output, 
+     .               keepax_flag, netcdf4_type, xchunk_size, 
+     .               ychunk_size, zchunk_size, tchunk_size, 
+     .               deflate_lev, shuffle_flag, endian_code, buff2,
+     .               status )
+
+           IF ( status .NE. merr_ok ) GOTO 5800
+
+	   
+* If the variable is to be written scaled, set the scale and offset
+*  values that will be written as attributes and sent to CD_WRITE_VAR. 
+
+
+           IF (varid .GT. 0) THEN
+	      
+              scalefac = 1.
+              attname = 'scale_factor'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                  istat)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                  varid, attid, aname, attype, attlen, attoutflag, 
+     .                  istat )
+
+              IF (istat .EQ. ferr_ok .AND. attoutflag.EQ.1) THEN
+                 IF (attype .EQ. nf_double) THEN
+                    got_it = NC_GET_ATTRIB_DP (dset, varid,
+     .                  aname, do_warn, varcode, attlen, 
+     .                  attoutflag, dvals)
+                    scalefac = dvals(1)
+
+                 ELSE
+                    got_it = NC_GET_ATTRIB (dset, varid, aname,
+     .                  do_warn, varcode, buff_size, attlen, 
+     .                  attoutflag, buff, vals)
+                    scalefac = vals(1)
+                 ENDIF
+              ENDIF
+
+              addoff = 0.
+              attname = 'add_offset'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                  istat)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                  varid, attid, aname, attype, attlen, attoutflag, 
+     .                  istat )
+
+              IF (istat .EQ. ferr_ok .AND. attoutflag.EQ.1) THEN
+                 IF (attype .EQ. nf_double) THEN
+                    got_it = NC_GET_ATTRIB_DP (dset, varid,
+     .                  aname, do_warn, varcode, attlen, 
+     .                  attoutflag, dvals)
+                    addoff = dvals(1)
+
+                 ELSE
+                    got_it = NC_GET_ATTRIB (dset, varid, aname,
+     .                  do_warn, varcode, buff_size, attlen, 
+     .                  attoutflag, buff, vals)
+                    addoff = vals(1)
+                 ENDIF
+              ENDIF
+
+           ENDIF  ! setting scalefac and addoff
+
+
+* if its a newly-created variable write attributes
+           IF ( new  .AND. all_outflag .GT. 0) THEN
+
+* Write missing value and fill flag here; if writing the scale and
+* offset attributes, then un-scale the missing and fill flags, using
+* potentially double precision scale and offset from the linked-list
+* structure.
+
+              IF (varid .GT. 0) THEN
+
+* Output the bad flag used by Ferret (and _FillValue which has been made  
+* the same as missing_flag)
+
+                 bad = mr_bad_data(mr)
+                 dvals(1) = bad
+                 attlen = 1
+
+* Get attype for missing flag
+
+                 istat = ferr_ok
+                 attoutflag = 0
+                 no_missing_flag = 1
+                 no_fill_flag = 0  ! Write _fillValue unless specifically told not to
+                 attname = 'missing_value'
+                 CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                  istat)
+                 IF (attid .GT. 0) THEN
+                    no_missing_flag = 0
+                    CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .                attid, aname, attype, attlen, attoutflag, istat )
+                    IF (attoutflag .EQ. 0) no_missing_flag = 1
+		    IF (attoutflag .NE. 0) got_it = NC_GET_ATTRIB_DP 
+     .                (dset, varid, attname, do_warn, varcode, attlen, 
+     .                attoutflag, miss_in)
+     
+		    IF (dset .EQ. -1) THEN
+		       r_scale = 1./scalefac
+		       r_off = -1.*addoff* r_scale
+		       miss_in = miss_in* r_scale + r_off
+		    ENDIF
+                 ELSE
+                   attname = '_FillValue'
+                   CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                  istat)
+                   IF (attid .GT. 0) THEN
+                      no_fill_flag = 0
+                      CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .                attid, aname, attype, attlen, attoutflag, istat )
+                      IF (attoutflag .EQ. 0) no_fill_flag = 1
+                   ENDIF
+                 ENDIF
+		 IF (no_missing_flag .EQ. 1) THEN
+		   attname = '_FillValue'
+                   CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                  istat)
+                   IF (attid .GT. 0) 
+     .                CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .                attid, aname, attype, attlen, attoutflag, istat )
+                    IF (attoutflag .EQ. 0) no_fill_flag = 1
+                 ENDIF
+
+* If the data is numeric, see if the missing flag needs to be rescaled, 
+* or converted to the output type
+
+                 IF (istat .EQ. ferr_ok .AND. outtype .NE. nf_char) THEN
+
+* If un-scaling on output, will also un-scale the missing flag.
+                    IF (scalefac .NE. 1.D0  .OR. addoff .NE. 0.D0) THEN
+                       dvals(1) = miss_in
+                       vals(1) = dvals(1)
+
+* Otherwise convert missing flag to requested output type for the variable
+                    ELSE
+                       IF (attype .NE. outtype .AND. istat .EQ. ferr_ok)  THEN
+                          alen = TM_LENSTR1(typnam(attype))
+                          slen = TM_LENSTR1(typnam(outtype))
+                          IF (dset .GT. 0) CALL WARN (
+     .                      'Converting data type of missing_value '//
+     .                       typnam(attype)(1:alen)//
+     .                      ' to match output type of variable '//
+     .                      typnam(outtype)(1:slen) )
+                       ENDIF
+                    ENDIF
+                    attype = outtype
+   
+                    IF (attoutflag .EQ. 1) THEN
+                       IF (no_missing_flag.EQ.0) THEN
+		          CALL CD_WRITE_ATTVAL_DP(
+     .                    cdfid, varcode, 'missing_value', dvals, attlen, 
+     .                    attype, status )
+                          IF (status .NE. ferr_ok) GOTO 5400
+			  got_missing = .TRUE.
+
+			  IF (dset .EQ. -1) THEN 
+		             CALL CD_WRITE_ATTVAL_DP(
+     .                       cdfid, varcode, '_FillValue', dvals, attlen, 
+     .                       attype, status )
+                             IF (status .NE. ferr_ok) GOTO 5400
+			     got_fill = .TRUE.
+			  ENDIF
+                       ENDIF
+
+		       IF (.NOT.got_fill .AND. (scalefac.NE.1.D0  .OR. addoff.NE.0.D0) )THEN
+		       attname = '_FillValue'
+		       CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .                     istat)
+                       IF (attid .GT. 0) 
+     .                    CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .                   attid, aname, attype, attlen, attoutflag, istat )
+                          IF (attoutflag .EQ. 0) no_fill_flag = 1
+		       IF (attoutflag .NE. 0) got_it = NC_GET_ATTRIB_DP 
+     .                     (dset, varid, attname, do_warn, varcode, attlen, 
+     .                     attoutflag, fill_in)
+                          dvals(1) = fill_in
+                          vals(1) = dvals(1)
+                          attype = outtype
+		       ENDIF
+                       IF (no_fill_flag.EQ.0) THEN
+		          CALL CD_WRITE_ATTVAL_DP(
+     .                     cdfid, varcode, '_FillValue', dvals, attlen, 
+     .                     attype, status )
+		          got_fill = .TRUE.
+                       ENDIF
+
+                    ENDIF
+                 ENDIF ! istat 
+
+
+* Get varcode into original upper/lowercase form. If mode upcase_output is set, 
+* then upcase the variable name.
+
+                 CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, 
+     .                   nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                   status) 
+                 varcode = varname
+                 IF (mode_upcase_output) CALL STR_UPCASE( varcode, 
+     .                 varname)
+
+                 DO 200 iatt = 1, nvatts
+                    CALL CD_GET_VAR_ATT_NAME( dset, varid, iatt, 
+     .                                        attname, status)
+                    CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .                   iatt, attname, attype, attlen, attoutflag, istat )
+                         
+                    slen = TM_LENSTR1(attname)
+                    IF ( MATCH_NAME (attname,  slen,
+     .                               'MISSING_VALUE', 13 ) .OR. 
+     .                   MATCH_NAME (attname,  slen,
+     .                               '_FILLVALUE', 10 ) ) THEN
+                       slen = 0   ! done already
+
+                    ELSE IF ( MATCH_NAME (attname,  slen,
+     .                               'SCALE_FACTOR', 12 ) .OR. 
+     .                   MATCH_NAME (attname,  slen,
+     .                               'ADD_OFFSET', 10 ) ) THEN
+                       got_it = NC_GET_ATTRIB_DP (dset, varid, attname,
+     .                    do_warn, varcode, attlen, attoutflag, dvals)
+                       IF (attoutflag  .EQ. 1) 
+     .                    CALL CD_WRITE_ATTVAL_DP (cdfid, varcode,
+     .                          attname, dvals, attlen, attype, status )
+                          IF (status .NE. ferr_ok) GOTO 5400
+                    ELSE
+
+                       attype = 0
+                       attlen = 0
+                       CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt,
+     .                    aname, attype, attlen, attoutflag, istat )
+     
+                       IF (attype .NE. nf_char .AND.
+     .                     attlen .GT. 100) THEN
+                          attlen = 100
+                          alen = TM_LENSTR1(aname)
+                          CALL WARN 
+     .                ('writing only first 100 elements of attribute'//
+     .                  aname(1:alen))
+                       ENDIF
+
+                       IF (attype .EQ. nf_char .AND. attoutflag.EQ.1) THEN
+                          got_it = NC_GET_ATTRIB ( dset, varid, aname, 
+     .                       do_warn, varcode, buff_size, attlen,
+     .                       attoutflag, buff, vals)
+                          lbuff = TM_LENSTR1(buff)
+                          CALL CD_WRITE_ATTRIB(cdfid, varcode,
+     .                         attname, buff(:lbuff), .FALSE., status )
+                       ELSE IF (attoutflag.EQ.1) THEN
+                          got_it = NC_GET_ATTRIB ( dset, varid, aname, 
+     .                       do_warn, varcode, buff_size, attlen,
+     .                       attoutflag, buff, vals)
+                          CALL CD_WRITE_ATTVAL_DP (cdfid, varcode,
+     .                          attname, vals, attlen, attype, status )
+                          IF (status .NE. ferr_ok) GOTO 5400
+
+                       ENDIF
+
+                       IF (MATCH_NAME (attname,  slen,
+     .                           'LONG_NAME', 9 )) THEN
+                          got_title = .TRUE.
+                          output_title = (attoutflag.EQ.1)
+                       ENDIF
+
+                       IF (MATCH_NAME (attname,  slen,
+     .                           'UNITS', 5 )) THEN
+                          got_units = .TRUE.
+                          output_units = (attoutflag.EQ.1)
+                       ENDIF
+
+                       IF (MATCH_NAME (attname,  slen,
+     .                           'HISTORY',  7 )) THEN
+                          got_history = .TRUE.
+                          output_history = (attoutflag.EQ.1)
+                       ENDIF
+
+                       IF (MATCH_NAME (attname,  slen,
+     .                           'SCALE_FACTOR', 12 )) THEN
+                          got_it = NC_GET_ATTRIB ( dset, varid, attname, 
+     .                       do_warn, varcode, buff_size, attlen,
+     .                       attoutflag, buff, vals)
+                       ENDIF
+
+                       IF (MATCH_NAME (attname,  slen,
+     .                           'ADD_OFFSET', 10 )) THEN
+                          got_it = NC_GET_ATTRIB ( dset, varid, attname, 
+     .                       do_warn, varcode, buff_size, attlen,
+     .                       attoutflag, buff, vals)
+                       ENDIF
+
+                    ENDIF
+
+ 200             CONTINUE
+! done getting attributes from linked-list structure
+
+* If its just an expression, write missing_value and _FillValue
+* attributes with default Ferret values.
+
+              ELSE ! varid GT 0
+
+		 attname = 'missing_value'
+		 vals(1) = bad_val4
+		 attlen = 1
+		 attype = outtype
+		 CALL CD_WRITE_ATTVAL_DP(cdfid, varcode,
+     .                          attname, vals, attlen, attype, status )
+		 got_missing = .TRUE.
+		 attname = '_FillValue'
+		 vals(1) = bad_val4
+		 attlen = 1
+		 attype = outtype
+		 CALL CD_WRITE_ATTVAL_DP(cdfid, varcode,
+     .                          attname, vals, attlen, attype, status )
+		 got_fill = .TRUE.
+
+              ENDIF ! varid GT 0
+
+* variable title
+* May already have this from Ferret variables from attribute structure, or if there
+* is no long_name attribute, get it by means of VAR_TITLE.
+
+              IF (.NOT. got_title) THEN
+                 buff = VAR_TITLE( cx ) !!
+                 lbuff = TM_LENSTR1( buff )
+
+                 IF ( buff .NE. ' ' .AND. all_outflag .NE. 0 .AND.
+     .                output_title ) THEN
+                    CALL CD_WRITE_ATTRIB(cdfid, varcode, 'long_name',
+     .                              buff(:lbuff), .FALSE., status )
+                    IF ( status .NE. merr_ok ) GOTO 5800
+                    got_title = .TRUE.
+                 ENDIF
+
+              ENDIF
+
+* modifier to variable title
+* ..."compressing" transforms and limits not given in definitions
+	      buff = ' '
+	      lbuff = 1
+              DO 60 idim = 1, nferdims
+                 need_doc =  cx_trans(idim,cx) .GT. trans_compress_code
+                 IF ( itsa_uvar ) need_doc = need_doc
+     .                    .OR. uvar_given(idim,var) .GT. uvlim_needed
+                 IF ( need_doc ) THEN
+                    IF ( lbuff .GT. 1 ) THEN      ! append a comma ?
+                       buff = buff(:lbuff)//', '
+                       lbuff = MIN( 140, lbuff+2)
+                    ENDIF
+                    buff = buff(:lbuff)//
+     .                     CX_DIM_STR(idim, cx, ':',full_precision,i)
+                    lbuff = TM_LENSTR1( buff )
+                 ENDIF
+ 60           CONTINUE
+* ...other variable modifiers
+              c1 = VAR_TITLE_MOD( cx )
+              IF ( c1 .NE. ' ' ) THEN
+                 IF ( lbuff .GT. 1 ) THEN
+                    buff = buff(:lbuff)//', '
+                    lbuff = MIN( 140, lbuff+2)
+                 ENDIF
+                 buff = buff(:lbuff)//VAR_TITLE_MOD( cx )
+                 lbuff = TM_LENSTR1( buff )
+              ENDIF
+
+* ... write it to the file
+              IF ( lbuff .GE. 2 .AND. all_outflag .NE. 0) THEN
+
+* ..... unless the user has created a long_name_mod attribute, or asked that writing
+*       it be turned off. See if long_name_mod attribute has been created.
+
+                 attoutflag = 1
+                 slen = TM_LENSTR1(varcode)
+                 buff2 = varcode(1:slen)//'.long_name_mod'
+                 IF (varid .GT. 0) THEN
+                    CALL BREAK_VARATTNAME (buff2, dset, 
+     .               buff1, attname, varid, .FALSE., status)
+
+                    IF (status .EQ. ferr_ok) THEN
+
+                       CALL CD_GET_VAR_ATT_ID (dset, varid,
+     .                     'long_name_mod', attid, istat)
+                       IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                     varid, attid, aname, attype, attlen, 
+     .                     attoutflag, istat )
+
+                       IF (attoutflag .EQ. 1) got_it = NC_GET_ATTRIB 
+     .                     ( dset, varid, attname, .FALSE., varcode, 
+     .                      buff_size, attlen, attoutflag, 
+     .                      buff(2:), vals)
+                       lbuff = TM_LENSTR1( buff )
+                    ENDIF
+                 ENDIF
+                 status = ferr_ok
+
+                 IF (all_outflag .NE. 0 .AND. attoutflag .NE. 0)
+     .              CALL CD_WRITE_ATTRIB(cdfid, varcode, 'long_name_mod',  
+     .                buff(2:lbuff), .FALSE., status )
+
+                 IF ( status .NE. merr_ok ) GOTO 5800
+              ENDIF
+
+* data set of origin
+              IF ( dset .NE. pdset_irrelevant .AND. dset.NE.-1) THEN
+       
+* ..... unless the user has created a history attribute, or asked that writing
+*       it be turned off. See if there is a history attribute.
+*       If the history attribute is just "from dsetname", or is not present,
+*       then write the dataset and its path or URL.
+
+                 attoutflag = 1
+                 IF (varid .GT. 0) THEN
+                    slen = TM_LENSTR1(varcode)
+                    buff2 = varcode(1:slen)//'.history'
+                    CALL BREAK_VARATTNAME (buff2, dset, buff1, attname,
+     .                   varid, .FALSE., status)
+
+                    IF (status .EQ. ferr_ok) THEN
+                       CALL CD_GET_VAR_ATT_ID (dset, varid, 'history', 
+     .                     attid, istat)
+                       IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                     varid, attid, aname, attype, attlen, 
+     .                     attoutflag, istat )
+
+                       IF (attoutflag .EQ. 1) got_it = NC_GET_ATTRIB (
+     .		  	     dset, varid, attname, .FALSE., varcode,
+     .		  	     buff_size, attlen, attoutflag, 
+     .                       buff, vals)
+                       lbuff = TM_LENSTR1( buff )
+                       IF (buff .EQ. ' ') THEN
+                          buff = 'From '
+                          CALL GET_DSET_NAME( dset, buff(6:), lbuff )
+			  IF (buff(6:7) .EQ. './') 
+     .                      CALL GET_SHORT_DSET_NAME( dset, buff(6:), lbuff )
+                          lbuff = TM_LENSTR1( buff )
+                       ELSE
+		          get_ds = .FALSE.
+		          IF (STR_SAME(buff(1:5), 'From ') .EQ. 0) THEN
+			    CALL GET_SHORT_DSET_NAME( dset, short, lbuff )
+			    IF (STR_SAME(buff(6:attlen), short) .EQ. 0) 
+     .                        get_ds = .TRUE.
+                          ENDIF
+                       ENDIF
+                    ENDIF
+
+                    IF (status .NE. ferr_ok .OR. get_ds) THEN 
+                       buff = 'From '
+                       CALL GET_DSET_NAME( dset, buff(6:), lbuff )
+		       IF (buff(6:7) .EQ. './') 
+     .                     CALL GET_SHORT_DSET_NAME( dset, buff(6:), lbuff )
+                       lbuff = TM_LENSTR1( buff )
+                    ENDIF
+                 
+                 ELSE
+                    buff = 'From '
+                    CALL GET_DSET_NAME( cx_data_set(cx), buff(6:), lbuff)
+                    IF (buff(6:7) .EQ. './') CALL GET_SHORT_DSET_NAME
+     .                  ( cx_data_set(cx), buff(6:), lbuff )
+                    lbuff = TM_LENSTR1( buff )
+                 ENDIF ! varid .gt. 0
+
+
+                 status = ferr_ok
+
+                 IF (all_outflag .NE. 0 .AND. attoutflag .NE. 0) THEN
+                    lbuff = TM_LENSTR1( buff )
+                    CALL CD_WRITE_ATTRIB(cdfid, varcode, 'history', 
+     .                              buff(:lbuff), .FALSE., status )
+                 ENDIF
+                 IF ( status .NE. merr_ok ) GOTO 5800
+
+              ELSEIF ( cx_data_set(cx) .NE. pdset_irrelevant .AND.
+     .                 cx_data_set(cx) .NE. -1) THEN
+
+* Write history attribute containing the data set of origin for user variable, 
+* if the user has not created a history attribute for the variable.
+
+                 IF (.NOT. got_history .AND. all_outflag .NE. 0 .AND. 
+     .             output_history ) THEN
+
+                    attoutflag = 1
+                    buff = 'From '
+                    CALL GET_DSET_NAME(cx_data_set(cx), buff(6:), lbuff)
+                    IF (buff(6:7) .EQ. './') CALL GET_SHORT_DSET_NAME
+     .                  ( cx_data_set(cx), buff(6:), lbuff )
+                    lbuff = TM_LENSTR1( buff )
+                    status = ferr_ok
+
+                    IF (all_outflag .NE. 0 .AND. attoutflag .NE. 0)
+     .                 CALL CD_WRITE_ATTRIB(cdfid, varcode, 'history', 
+     .                              buff(:lbuff), .FALSE., status )
+                    IF ( status .NE. merr_ok ) GOTO 5800
+                 ENDIF
+              ENDIF
+
+* units
+              buff = VAR_UNITS( cx )
+              lbuff = TM_LENSTR1( buff )
+
+              IF ( buff .NE. ' ' .AND. all_outflag .NE. 0 .AND. 
+     .             output_units ) THEN
+                 CALL CD_WRITE_ATTRIB(cdfid, varcode, 'units',
+     .                              buff(:lbuff), .FALSE., status )
+                 IF ( status .NE. merr_ok ) GOTO 5800
+              ENDIF
+
+* NetCDF variable IDs - additional information needed for DODS caching (11/96)
+	      IF ( DODS_cache ) THEN
+	         ibuff4 = cd_varid(var)		! for F90 data type checks
+	         CALL CD_WRITE_ATTVAL(cdfid, varcode,
+     .                     'netcdf_var_id',rbuff4, 1, nf_int, status )
+                 IF ( status .NE. merr_ok ) GOTO 5800
+	         ibuff1 = cd_data_type(var)	! for F90 data type checks
+	         CALL CD_WRITE_ATTVAL(cdfid, varcode,
+     .                  'netcdf_data_type', rbuff4, 1, nf_byte, status )
+                 IF ( status .NE. merr_ok ) GOTO 5800
+	      ENDIF
+
+           ENDIF
+
+* Write attributes for psuedo-variables
+           IF (cat .EQ. cat_pseudo_var) THEN  
+
+              IF (.NOT.got_missing) THEN
+ 	         CALL CD_WRITE_ATTVAL_DP(cdfid, varcode,
+     .          'missing_value', bad, 1, type, status )
+                 IF ( status .NE. merr_ok ) GOTO 5800
+              ENDIF
+
+              IF (.NOT.got_fill) THEN
+                 CALL CD_WRITE_ATTVAL_DP(cdfid, varcode,
+     .          '_FillValue', bad, 1, type, status )
+                IF ( status .NE. merr_ok ) GOTO 5800
+	      ENDIF
+
+              buff = VAR_TITLE( cx )
+              lbuff = TM_LENSTR1( buff )
+                 CALL CD_WRITE_ATTRIB(cdfid, varcode, 'long_name',
+     .                              buff(:lbuff), .FALSE., status )
+              IF ( status .NE. merr_ok ) GOTO 5800
+
+* ...other variable modifiers
+              c1 = VAR_TITLE_MOD( cx )
+              IF ( c1 .NE. ' ' ) THEN
+                 IF ( lbuff .GT. 1 ) THEN
+                    buff = buff(:lbuff)//', '
+                    lbuff = MIN( 140, lbuff+2)
+                 ENDIF
+                 buff = buff(:lbuff)//VAR_TITLE_MOD( cx )
+                 lbuff = TM_LENSTR1( buff )
+              ENDIF
+* ... write it to the file
+              IF ( lbuff .GE. 2 ) THEN
+                 CALL CD_WRITE_ATTRIB( cdfid, varcode, 'long_name_mod', 
+     .                              buff(2:lbuff), .FALSE., status )
+                 IF ( status .NE. merr_ok ) GOTO 5800
+              ENDIF
+           ENDIF  ! pseudo-variables
+
+ 100    CONTINUE
+	nready = nvars
+
+*****
+* Finally, write all of the coordinates and data values -- in netCDF DATA mode
+* Note that this block of code is also executed following an error to
+* ensure that all deferred coordinates and "ready" variables are flushed
+ 400	flushed = .TRUE.	! errors from here to exit may leave corrupted file
+*
+* write the deferred coordinates
+*
+	CALL CD_WRITE_DEFER_COORD( cdfid, status )
+	IF ( status .NE. merr_OK ) GOTO 5800
+*
+* write the variables
+*
+        DO 500 ivar = 1, nready
+	   cx  = cx_list(ivar)
+	   mr  = mr_list(ivar)
+	   grid	= cx_grid( cx )
+           dset = cx_data_set( cx )
+           cat = cx_category(cx)
+           var = cx_variable(cx)
+           varcode = SANITARY_VAR_CODE( cat, var )
+
+           itsa_uvar = cat .EQ. cat_user_var
+           CALL CD_GET_VAR_ID (dset, varcode, varid, status)  ! is it in the linked-list for dset
+           IF (status .NE. ferr_ok .AND. itsa_uvar ) THEN
+              dset = -1    ! is it a user var based on a var in dset
+              CALL CD_GET_VAR_ID (dset, varcode, varid, status) 
+           ENDIF
+
+* Get varcode into original upper/lowercase form. If mode upcase_output is set, 
+* then upcase the variable name.
+
+           IF (status .EQ. ferr_ok) THEN
+              CALL CD_GET_VAR_INFO (dset, 
+     .                  varid, varname, vartype,  nvdims, vdims,
+     .                  nvatts, coordvar, all_outflag, status) 
+              varcode = varname
+              IF (mode_upcase_output) CALL STR_UPCASE( varcode, varname)
+           ENDIF
+     
+           IF ( cat .EQ. cat_pseudo_var )THEN
+	      varcode = varcode(:TM_LENSTR1(varcode))//"_"
+	      IF (varcode(1:1) .EQ. "_") varcode = varcode(2:TM_LENSTR1(varcode))
+	   ENDIF
+
+* get slab limits to use for writing the values of this variable
+           DO 450 idim = 1, nferdims
+              write_lo(idim) = cx_lo_ss(cx,idim)
+              write_hi(idim) = cx_hi_ss(cx,idim)
+ 450        CONTINUE
+
+* check for interrupts - dont check again until entire variable is written
+           IF (interrupted) CALL ERRMSG(ferr_interrupt,status,' ',*5800)
+
+* write the data for this variable
+
+           CALL CD_WRITE_VAR ( memory, cdfid, dset_num, varcode, grid, 
+     .                        write_lo, write_hi, memory(1,mr_blk1(mr)), 
+     .                        edges_flag, do_bounds, scalefac, addoff, 
+     .                        bad, mode_upcase_output, keepax_flag, status )
+           IF ( status .NE. merr_ok ) GOTO 5800
+ 500	CONTINUE
+
+* close the file
+        CALL NCCLOS(cdfid, cdfstat)
+        IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CDF_LIST', unspecified_int4,
+     .     no_varid, 'could not close CDF output file: ',
+     .     fname, *5990 )
+
+
+* final completion -- maybe after an error
+	status = final_status
+	RETURN
+
+* error exit(s)
+ 5200    CALL ERRMSG ( ferr_syntax, status,
+     .                 'illegal output variable name: '//varcode,
+     .                 *5210 )
+
+ 5210    CALL TM_NOTE(
+     .    'Name must use letters and digits beginning with a letter',
+     .                 err_lun )
+         CALL TM_NOTE( 'X,Y,Z,Y,I,J,K,L,XBOX,... are reserved names',
+     .                 err_lun )
+         CALL TM_NOTE( 'Use the LET command to define a legal name',
+     .                 err_lun )
+         GOTO 5800
+
+ 5300    CALL ERRMSG ( ferr_invalid_command, status,
+     .                 'Exceeds grid limits: '//
+     .			cmnd_buff(qual_start(errloc):qual_end(errloc))
+     .			//pCR//'Variable: '//varcode, *5800 )
+
+ 5310    CALL ERRMSG ( ferr_invalid_command, status,
+     .                 'Does not encompass data to be written: '//
+     .			cmnd_buff(qual_start(errloc):qual_end(errloc))
+     .			//pCR//'Variable: '//varcode, *5800 )
+
+ 5400    CALL ERRMSG ( ferr_TMAP_error, status, ' ', *5990 )
+
+ 5800   CALL ERRMSG ( ferr_TMAP_error, final_status, ' ', *5810 )
+ 5810	nready = ivar - 1
+	IF (.NOT.flushed) GOTO 400 ! yea ... a bit of spagetti code ... 
+	CALL NCCLOS(cdfid, cdfstat)
+ 5990   RETURN
+	END
+
diff --git a/fer/gnl/cdf_list_global_atts.F b/fer/gnl/cdf_list_global_atts.F
new file mode 100644
index 0000000..3911248
--- /dev/null
+++ b/fer/gnl/cdf_list_global_atts.F
@@ -0,0 +1,103 @@
+	SUBROUTINE CDF_LIST_GLOBAL_ATTS ( dset, cdfid, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* Write global attributes to netcdf file
+
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V600  6/06 *acm* - additional declarations found by Solaris compiler
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+#include "netcdf.inc"
+        include 'cd_lib.parm'
+        include 'ferret.parm'
+
+
+* calling argument declarations:
+        INTEGER dset, cdfid, status
+        
+* internal variable declarations:
+        LOGICAL MATCH_NAME, NC_GET_ATTRIB, coordvar, do_warn, got_it
+        INTEGER TM_LENSTR1, varid, vartype, nvdims, vdims(8), nvatts, 
+     .          all_outflag, iatt, slen, attype, attlen, attoutflag,
+     .          bufflen
+	REAL	vals(100)
+        CHARACTER*128 varname, attname, aname
+        CHARACTER*2048 buff
+
+        bufflen = 2048
+        varid = 0
+        do_warn = .TRUE.
+
+* Get global attributes from dset and if they have been marked for output,
+* write to the file cdfid
+
+        CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, nvdims, 
+     .            vdims, nvatts, coordvar, all_outflag, status) 
+
+        DO 80 iatt = 1, nvatts
+           CALL CD_GET_VAR_ATT_NAME( dset, varid, iatt, attname, status)
+           slen = TM_LENSTR1(attname)
+
+           IF ( MATCH_NAME (attname,  slen, 'HISTORY', 7 ) .OR. 
+     .          MATCH_NAME (attname,  slen, 'TITLE', 5 ) .OR. 
+     .          MATCH_NAME (attname,  slen, 'CONVENTIONS', 11 ) ) THEN
+              slen = 0   ! done elsewhere
+           ELSE
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, aname, 
+     .                  attype, attlen, attoutflag, status )
+
+              IF (attoutflag .EQ. 0) GOTO 80
+              IF (attlen .GT. 100 .AND. attype .NE. ptype_char) 
+     .            attlen = 100
+              got_it = NC_GET_ATTRIB ( dset, varid, aname, do_warn, 
+     .           varname, bufflen, attlen, attoutflag, buff, vals)
+
+              IF (attype .EQ. NCCHAR .AND. attoutflag.EQ.1) THEN
+                 slen = TM_LENSTR1(buff)
+                 CALL CD_WRITE_ATTRIB(cdfid, pcdf_global,
+     .              aname, buff(:slen), .FALSE., status )
+              ELSE IF (attoutflag.EQ.1) THEN
+                 CALL CD_WRITE_ATTVAL(cdfid, pcdf_global,
+     .              aname, vals, attlen, attype, status )
+
+              ENDIF
+           ENDIF
+
+ 80     CONTINUE
+
+        RETURN
+        END
diff --git a/fer/gnl/check_format.F b/fer/gnl/check_format.F
new file mode 100644
index 0000000..6a41909
--- /dev/null
+++ b/fer/gnl/check_format.F
@@ -0,0 +1,94 @@
+	SUBROUTINE CHECK_FORMAT( string, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Check a FORTRAN FORMAT string for superficial syntax errors
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V301 1/94 - extracted from EQUAL_FORMAT
+* V320 8/94 *kob* -IBM port - had to use risc buff for string concats
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER*(*)	string
+
+* internal variable declarations
+        LOGICAL TM_DIGIT
+	INTEGER	left_paren, right_paren, integer_form
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+!	include 'xprog_state.cmn'
+#ifdef NO_PASSED_CONCAT
+	include 'xrisc.cmn'
+#endif
+
+* check out user-specified format
+	left_paren  = INDEX( string, '(' )
+	right_paren = INDEX( string, ')' )
+	IF ( left_paren .EQ. 0 
+     .	.OR. left_paren .GE. right_paren ) GOTO 5040
+	integer_form = MAX( INDEX( string, 'I' ),
+     .		            INDEX( string, 'i' ) )
+	IF ( integer_form .NE. 0 ) THEN
+           IF ( TM_DIGIT(string(integer_form:)) )GOTO 5050
+        ENDIF
+
+* success
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+#ifdef NO_PASSED_CONCAT	
+ 5040   risc_buff = string
+	CALL ERRMSG( ferr_syntax, status,
+     .			'unknown format or format need parenthesis: '//pCR//
+     .			risc_buff, *5000 )
+ 5050   risc_buff = string
+	CALL ERRMSG( ferr_syntax, status,
+     .			'floating pt. formats only:'//risc_buff, *5000 )
+#else
+ 5040	CALL ERRMSG( ferr_syntax, status,
+     .			'unknown format or format need parenthesis: '//pCR//
+     .			string, *5000 )
+ 5050	CALL ERRMSG( ferr_syntax, status,
+     .			'floating pt. formats only:'//string, *5000 )
+#endif
+	END
diff --git a/fer/gnl/check_member_sets.F b/fer/gnl/check_member_sets.F
new file mode 100644
index 0000000..f3dcba9
--- /dev/null
+++ b/fer/gnl/check_member_sets.F
@@ -0,0 +1,158 @@
+	SUBROUTINE CHECK_MEMBER_SETS (nsets, member_sets, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xprog_state.cmn'
+	include 'xtm_grid.cmn_text'  
+	include 'errmsg.parm'
+	include 'netcdf.inc'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xfr_grid.cmn'
+	include 'xdiag_ctrl.cmn_text'
+
+* calling argument declarations:
+	INTEGER nsets, member_sets(*), status
+
+* local variable declarations:
+	LOGICAL TM_DIGIT, tregular, use_strict
+	INTEGER TM_LENSTR, item, ich, buff_len, dset, iset, perm(nferdims)
+	CHARACTER buff1*512
+
+	DO 100 iset = 1, maxdsets
+	   member_sets(iset) = unspecified_int4
+  100	CONTINUE
+
+	DO 110 item = 1, nferdims
+	   perm(item) = unspecified_int4
+  110	CONTINUE
+
+* Check on the aggregate-member datasets. (code taken from xeq_set)
+* Open them if they're not already open.
+
+	tregular = .FALSE.
+	use_strict = .FALSE.
+
+	nsets = 0
+	DO 760 item = 1, num_items
+
+           CALL EQUAL_STR_LC(
+     .                   cmnd_buff(item_start(item):item_end(item)),
+     .                   buff1, status ) 
+	   IF (status .NE. ferr_ok)
+     .        buff1 = cmnd_buff(item_start(item):item_end(item))
+	   IF (TM_LENSTR(buff1) .EQ. 0)
+     .        buff1 = cmnd_buff(item_start(item):item_end(item))
+
+* check to see if data set was referred to by number
+* 9/95 - replaced "*" with "(I)" read from separate buffer
+	   IF ( TM_DIGIT(buff1) ) THEN
+
+	      buff_len = TM_LENSTR(buff1)
+              DO 730 ich = 1, buff_len
+		IF ( .NOT. TM_DIGIT(buff1(ich:ich))) GOTO 740
+ 730	      CONTINUE
+	      READ (buff1,*) dset
+#ifdef MANDATORY_FORMAT_WIDTHS
+	      READ (buff1,*,ERR=740) dset
+#else
+	      READ (buff1,'(I)',ERR=740) dset
+#endif
+* ... check for valid number given
+	      IF   ( dset .LT. 1
+     .	      .OR.   dset .GT. maxdsets )		GOTO 5200
+	      IF ( ds_name( dset ) .EQ. char_init1024) GOTO 5200
+	      IF ( ds_type( dset ) .EQ. 'ENS')	GOTO 5200
+	      GOTO 750
+	   ENDIF
+
+* no! it wasn't given by number so open the data set
+ 740       ds_dset_type = 'CDF'   ! used and cleared in tm_init_dset
+
+* initialize a TMAP-supported data set
+ 	   CALL TM_INIT_DSET( buff1,
+     .			      perm, dset, tregular, use_strict, status )
+	   
+           IF ( status .NE. merr_no_action ) THEN  ! merr_no_action = already init'ed
+	      IF ( status .NE. ferr_ok ) GOTO 5300 ! error in file or url
+
+* interpret special parameters in the descriptor
+	      CALL GET_DSET_PARMS( dset, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5300
+
+* determine relative access speeds along each axis
+	      CALL GET_AXIS_SPEED( dset )
+
+* build completed ( with time axis ) grids for computable variables
+	      CALL MAKE_CVAR_GRIDS( dset, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5300
+
+	   ENDIF
+
+ 750	   CONTINUE
+	   nsets = nsets + 1
+	   member_sets(nsets) = dset
+
+ 760	CONTINUE
+
+	status = ferr_ok
+
+ 5000   RETURN	
+
+* Errors: too-many datasets open so aggregate dataset can't be opened,
+* or error on a member dataset. 
+* ?? If some member datasets were opened, close them??)
+* Return no-dataset-number.
+
+ 9950	dset = unspecified_int4
+	status = ferr_TMAP_error
+	GOTO 5000
+
+ 5200	CALL ERRMSG( ferr_unknown_data_set, status,
+     .		'dset '//cmnd_buff( item_start(item):item_end(item) )
+     .		//' unknown or is already an aggregate dataset', *9950 )
+ 5300	CALL ERRMSG( ferr_TMAP_error, status, ' ', *9950 )
+
+	END
diff --git a/fer/gnl/check_memory.F b/fer/gnl/check_memory.F
new file mode 100644
index 0000000..4928856
--- /dev/null
+++ b/fer/gnl/check_memory.F
@@ -0,0 +1,260 @@
+
+
+	SUBROUTINE CHECK_MEMORY ( lun )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* diagnostic report on memory usage and integrity check
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/20/88
+* revision 0.1 - 8/15/88 - max_mrs --> max_mr_avail
+* V200:  6/9/89 - deleted variables flagged in mr_protected
+*		- deletable variables in mr_del_*
+*		- slight reformatting of output
+*	 5/3/90 - include temporary vars in del_link chain check
+* V313:8/18/94 *kob* IBM Port - format statement 3310 was missing a comma
+* V320:8/11/94 - allow bigger output field for (resizable) mem_blk_size
+*     12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*		==>  extensive changes!!
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V510: 10/99 *sh* - make checks on 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	lun
+
+* internal variable declarations:
+	INTEGER	mv, mb, mvfree, mvused, mbfree, mbused, mbmax,
+     .		nmvlost, nmblost, n, pile, last, size, test_next,
+     .		navail, nperm, mbperm, ntemp, ndel, slen, nn
+	CHARACTER LEFINT*8, buff*40, b12*12
+	PARAMETER (b12 = '            ')    !kob 12/96
+* check available bulk memory
+	n      = 0	! number of contiguous regions
+	mbfree = 0	! number of free blocks
+	mbmax  = 0	! biggest contiguous region
+	mb = mblk_flink( 0 )
+ 100	IF ( mb .NE. 0 ) THEN
+	   n      = n + 1
+	   size   = mblk_size( mb ) 
+	   mbmax  = MAX( mbmax, size )
+	   mbfree = mbfree + size
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+* ... no gaps should exist between sized regions - both free and used are sized
+	   test_next = mb + size
+	   IF ( test_next .EQ. max_mem_blks + 1 ) THEN
+	      CONTINUE
+	   ELSEIF ( test_next .GT. max_mem_blks + 1 
+     .     .OR.     mblk_size(test_next) .EQ. unspecified_int4 ) THEN
+	      CALL WARN('***** improper region size: '//LEFINT(mb,slen) )
+	   ENDIF
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	   mb = mblk_flink( mb )
+	   GOTO 100
+	ENDIF	   
+	CALL SPLIT_LIST( pttmode_explct, lun, 
+     .			 b12//'total memory table slots: '//
+     .			 LEFINT(max_mr_avail,slen), 0 )
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'total memory blocks: '//
+     .			 LEFINT(max_mem_blks,slen), 0 )
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'memory block size: '//
+     .			 LEFINT( mem_blk_size,slen), 0 )
+	CALL SPLIT_LIST( pttmode_explct, lun,' ', 1 )		! <CR>
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'number of free memory blocks: '//
+     .			 LEFINT(mbfree,slen), 0 )
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'largest free region: '//
+     .			 LEFINT(mbmax,slen), 0 )
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'number of free regions: '//
+     .			 LEFINT(n,slen), 0 )
+
+* check slots in memory variable table
+* ... free table slots
+	mvfree = 0
+	mv     = mv_flink( 0 )	! base pointer for free slots
+ 200	IF ( mv .NE. 0 ) THEN
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+	   IF ( mr_protected(mv) .NE. mr_deleted ) CALL WARN
+     .			('CORRUPTION! improperly deleted: '
+     .						//LEFINT(mv,slen) )
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+	   mvfree = mvfree + 1
+	   mv = mv_flink( mv )
+	   GOTO 200
+	ENDIF
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'free memory table slots: '//
+     .			 LEFINT(mvfree,slen), 0 )
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+* check all the variables in all the hash piles
+	mvused = 0
+	mbused = 0
+	DO 310 pile = 1, pmv_npiles
+	   last = -pile
+	   mv = mv_flink( last )	! base pointer for slots in this hash #
+ 300	   IF ( mv .GT. 0 ) THEN
+	      IF ( mr_protected(mv) .EQ. mr_deleted
+     .	      .OR. mr_protected(mv) .EQ. mr_in_progress
+     .	      .OR. mr_nblks    (mv) .NE. mblk_size( mr_blk1(mv) )
+     .	      .OR. mv_blink(mv) .NE. last ) 	CALL WARN
+     .			('CORRUPTION! improperly cataloged: '
+     .						//LEFINT(mv,slen) )
+	      mvused = mvused + 1
+	      mbused = mbused + mr_nblks(mv)
+	      last   = mv
+	      mv     = mv_flink(mv)
+	      GOTO 300
+	   ENDIF
+ 310	CONTINUE
+
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+* check non-cached variables (10/99)
+	nn = 0
+	last = pmv_nocache_pile
+	mv = mv_flink( last )	! base pointer for slots in this hash #
+ 350	IF ( mv .GT. 0 ) THEN
+	   IF ( mr_protected(mv) .EQ. mr_deleted
+     .	   .OR. mr_protected(mv) .EQ. mr_in_progress
+     .	   .OR. mr_nblks    (mv) .NE. mblk_size( mr_blk1(mv) )
+     .	   .OR. mv_blink(mv) .NE. last ) 	CALL WARN
+     .			('CORRUPTION! uncached variable error: '
+     .						//LEFINT(mv,slen) )
+	   nn = nn + 1
+	   mvused = mvused + 1
+	   mbused = mbused + mr_nblks(mv)
+	   last   = mv
+	   mv     = mv_flink(mv)
+	   GOTO 350
+	ENDIF
+	CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'number of UN-CACHED variables: '//
+     .			 LEFINT(nn,slen), 0 )
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+* check working storage (10/99)
+	nn = 0
+	last = pmv_work_var_pile
+	mv = mv_flink( last )	! base pointer for slots in this hash #
+ 360	IF ( mv .GT. 0 ) THEN
+	   nn = nn + 1
+	   mvused = mvused + 1
+	   mbused = mbused + mr_nblks(mv)
+	   last   = mv
+	   mv     = mv_flink(mv)
+	   GOTO 360
+	ENDIF
+	IF ( nn .GT. 0 ) CALL WARN
+     .			('CORRUPTION! unfreed work arrays: '
+     .						//LEFINT(nn,slen) )
+
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * *
+* make sure no table slots or memory blocks have been lost
+	nmvlost = max_mr_avail - ( mvfree+mvused )
+	nmblost = max_mem_blks   - ( mbfree+mbused )
+	IF ( nmvlost .NE. 0 ) CALL WARN
+     .			('CORRUPTION! lost table slots: '
+     .						//LEFINT(nmvlost,slen) )
+	IF ( nmblost .NE. 0 ) CALL WARN
+     .			('CORRUPTION! lost memory blocks: '
+     .						//LEFINT(nmblost,slen) )
+
+* * * * integrity check * * * * * * * * * * * * * * * * * * * * *
+* variable deletion priority chain
+	navail = 0
+	mv = mr_del_flink(0)
+ 400	IF ( mv .NE. 0 ) THEN
+	   navail = navail + 1
+	   IF ( mr_protected(mv) .NE. mr_not_protected ) CALL WARN
+     .			('CORRUPTION! Protected variables deleted')
+	   mv = mr_del_flink(mv)
+	   GOTO 400
+	ENDIF
+	ndel   = 0
+	nperm  = 0
+	mbperm = 0
+	ntemp  = 0
+	DO 410 mv = 1, max_mr_avail
+	   IF ( mr_protected(mv) .EQ. mr_perm_protected ) THEN
+	      nperm  = nperm  + 1
+	      mbperm = mbperm + mr_nblks(mv)
+	   ELSEIF ( mr_protected(mv) .EQ. mr_deleted ) THEN
+	      ndel = ndel + 1
+	   ELSEIF ( mr_protected(mv) .EQ. mr_temporary ) THEN
+	      ntemp = ntemp + 1
+	   ENDIF
+ 410	CONTINUE
+	IF ( nperm .GT. 0 ) THEN
+	   CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'number of /PERMANENT variables: '//
+     .			 LEFINT(nperm,slen), 0 )
+	   CALL SPLIT_LIST( pttmode_explct, lun,
+     .			 b12//'number of blocks used /PERM: '//
+     .			 LEFINT(mbperm,slen), 0 )
+	ENDIF
+	nmvlost = max_mr_avail - (navail+nperm+ndel+ntemp)
+	IF ( nmvlost .NE. 0 ) CALL WARN
+     .		( 'CORRUPTION! Protected vars unaccountable: '
+     .				//LEFINT(nmvlost,slen) )
+	n = ndel - mvfree
+	IF ( n .NE. 0 ) CALL WARN
+     .		( 'CORRUPTION! Deleted vars unaccountable: '
+     .				//LEFINT(nmvlost,slen) )
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	RETURN
+	END
+
+
diff --git a/fer/gnl/cleanup_last_cmnd.F b/fer/gnl/cleanup_last_cmnd.F
new file mode 100644
index 0000000..3c51fdc
--- /dev/null
+++ b/fer/gnl/cleanup_last_cmnd.F
@@ -0,0 +1,81 @@
+	SUBROUTINE CLEANUP_LAST_CMND( control_stack_level )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* clean up the mess left by the previous command - esp. preparing a buffer
+* of messages for the calling program, if any
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V312:  5/19/94 - with code extracted from GET_COMMAND
+* V320:  11/94   - dont process error message buffer -- done in ferret_dispatch
+* V531:  4/01 *sh* - cleanup incomplete continuation lines
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations: (none)
+	INTEGER	control_stack_level
+
+* internal variable declarations:
+	INTEGER status
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xcontrol.cmn'
+	include 'xinterrupt.cmn'
+	include 'xgui.cmn'
+
+* re-store ^C interrupt handler following interrupt
+ 10	IF ( interrupted ) CALL ERRMSG
+     .				( ferr_interrupt, status, ' ', *10 )
+	ppl_interrupted = .FALSE.	! for interrupt of PPLUS
+
+* send the state of the control stack back to the caller
+* (zero is command line level)
+	control_stack_level = csp
+
+* this needed for logic in ferret_dispatch
+	cmnd_buff = ' '
+
+* this in case there was a half completed command entry
+	has_continuation_cmnd = .FALSE.
+
+	RETURN
+	END
diff --git a/fer/gnl/coached_str_sub.F b/fer/gnl/coached_str_sub.F
new file mode 100644
index 0000000..52042ff
--- /dev/null
+++ b/fer/gnl/coached_str_sub.F
@@ -0,0 +1,305 @@
+
+	SUBROUTINE COACHED_STR_SUB( sym_name, 
+     .		in_str, coaching, out_str, len_out, status ) 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* replace the input string with the text implied in the coaching
+* possibly displaying an error string
+
+* if the input string is blank and no default then report error
+* if error text was supplied with coaching use it for error message
+
+* coaching may include:
+*	"default"	- default string if arg n doesn't exist
+*	">default"	- default string if arg n doesn't match any options
+*	"<errmsg"	- error   string 
+*	"|option"     - an acceptable value for argument n
+*	"|option>opt_replace"     - an acceptable value and replacement text
+*  note that "*" will match any option so "|*>whatever" will substitute
+*       "whatever" for anything
+
+* USAGE EXAMPLES:
+*		      "my_default_file|file1|file2"
+* ... allow only instrings "file1", "file2", or blank which gets default
+
+*		 or   "|file1|file2<This is not a valid file"
+* ... allow only instrings "file1", "file2" - else an error message
+
+*		 or   "|1>file1|2>file2<You must enter 1 or 2"
+* ... allow only instrings "1" or "2" with replacement text for each
+
+* STAR:		 or   "|file1>snoopy|file2>linus|*"
+* ... allow any instring with replacement text for "file1" and "file2"
+* STAR:		 or   "|file1>snoopy|file2>linus|*>no_match_file"
+* ... gives replacement text for "file1" and "file2". Any other
+* 	instring gets replaced by "no_match_file"
+* Note: "*" effectively matches any instring given 
+
+
+* table of behavior of ">default" vs "default":
+*		no argument given	argument doesn't match options
+*		-----------------	------------------------------
+*    default  |   return default		error
+*   >default  |	  return default 	   return default 
+
+* not yet implemented:
+*	$<		- input from stdin
+*	$<!		- input from stdin - reprompted if not acceptable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420	2/29/96	- extracted from dollar_command for shared use by symbols
+*
+* 1/03 *kob* - need to accomodate g77 and it's inability to arbitrarily concatenate
+* V580 *acm* 11/04 when command contains some error text, and an error condition
+*                  is found, issue an error rather than just a note. (bug 1077)
+* V500 *acm*  1/05 Fix the above within the ifdef NO_PASSED_CONCAT too
+
+* calling argument declarations:
+	LOGICAL   err_subst
+	INTEGER	  len_out, status
+	CHARACTER sym_name*(*), in_str*(*), coaching*(*), out_str*(*)
+
+* internal variable declarations:
+* d default string
+* e error string
+* o options string
+* r replacement strings
+
+	LOGICAL errtxt, default, options, opt_replace,
+     .		def_replace, opt_failed
+	INTEGER	STR_CASE_BLIND_COMPARE, TM_LENSTR1,
+     .		iptr, len_in, vax_code, errstat,
+     .		dstart, ostart, estart, dend, oend, eend, ostart1, oend1,
+     .		rstart, rend, right_star
+#ifdef NO_PASSED_CONCAT
+* Additional temp character buffer needed for concatenating error messages
+*    required by g77 *kob* 1/03
+
+	CHARACTER tmp_buff*2048
+#endif
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xrisc.cmn'
+
+* initialize
+	status = ferr_ok
+	err_subst = .FALSE.
+	dstart = 1
+	iptr = TM_LENSTR1(coaching)
+	errtxt = .FALSE.
+	options = .FALSE.
+	default = .FALSE.
+	opt_replace = .FALSE.
+	def_replace = .FALSE.
+	opt_failed  = .FALSE.
+	IF ( in_str .EQ. ' ' ) THEN
+	   len_in = 0
+	ELSE
+	   len_in = TM_LENSTR1(in_str)
+	ENDIF
+	len_out = len_in
+
+* error string provided?
+	estart = INDEX( coaching, '<' )
+	errtxt = estart .GT. 0
+	estart = estart + 1     ! right after "<"
+	eend = iptr
+	IF ( estart .GT. eend ) GOTO 5400
+	IF ( errtxt ) THEN
+	   dend = estart - 2
+	   errstat = ferr_silent
+	ELSE
+	   dend = iptr
+	   errstat = ferr_invalid_command
+	ENDIF
+	
+* options provided?
+	ostart = INDEX(coaching, '|')
+	options = ostart .GT. 0
+	ostart = ostart + dstart    ! right after first "|"
+	IF ( errtxt ) THEN
+	   oend = estart - 2
+	ELSE
+	   oend = iptr
+	ENDIF
+
+* default text provided?
+	IF ( options ) THEN
+	   default = ostart .GT. dstart+1
+	   dend = ostart - 2
+	ELSEIF ( errtxt ) THEN
+	   IF ( estart .GT. dstart+1 ) GOTO 5500  ! error text AND default?
+	   default = .FALSE.
+	ELSE
+	   default = .TRUE.
+	ENDIF
+* ... use the default if the given argument doesn't match any of the options?
+	IF ( default .AND. options ) THEN
+	   def_replace = coaching(1:1) .EQ. '>'
+	   IF ( def_replace ) dstart = 2
+	   IF ( dstart .GT. dend ) GOTO 5400
+	   default = .NOT.def_replace
+	ENDIF
+
+* loop: compare the instring text provided with the allowable options  
+	IF ( options .AND. len_out.GT.0 ) THEN
+	   ostart1 = ostart
+ 200	   oend1 = INDEX( coaching(ostart1:oend), '|' )
+	   IF ( oend1 .EQ. 0 ) THEN
+	      oend1 = oend
+	   ELSE
+	      oend1 = ostart1 + oend1 - 2
+	   ENDIF
+* ... was replacement text provided ?
+	   rend = oend1
+ 	   rstart = INDEX( coaching(ostart1:oend1), '>' )
+	   opt_replace = rstart .GT. 0
+	   IF ( opt_replace ) THEN
+	      rstart = ostart1 + rstart
+	      oend1 = rstart - 2
+	      IF ( rstart .GT. rend ) GOTO 5400	
+	   ENDIF
+	   IF ( ostart1 .GT. oend1 ) GOTO 5400
+* ... if this option is "*" it matches anything   (2/94)
+	   IF ( coaching(ostart1:oend1) .EQ. '*' ) GOTO 400
+* ... does the GO argument provided match this option ?
+	   vax_code = STR_CASE_BLIND_COMPARE( coaching(ostart1:oend1),
+     .	                                      in_str(:len_out) )
+	   IF ( vax_code .EQ. vms_str_success ) THEN
+	      GOTO 400          ! we got a match
+	   ELSEIF ( rend+1 .LT. oend ) THEN
+	      ostart1 = rend + 2
+	      GOTO 200		! text didnt match - check next option
+	   ELSE
+	      len_out = 0        ! the argument text given was unacceptable
+	      opt_replace = .FALSE.
+	      opt_failed  = .TRUE.
+	   ENDIF
+	ENDIF
+
+* if no argument text is provided then use alternative
+ 400	IF ( opt_replace ) THEN
+* ... replace the given argument with the option replacement text provided
+
+* ... 3/95 allow "*" on the right hand side replacement text  e.g. $5%|*>"*"%
+	   right_star = INDEX(coaching(rstart:rend),'*')
+	   IF ( right_star .GT. 0 ) THEN
+* --- start of star substitution
+	      IF ( len_in + rend-rstart .GT. 255 ) GOTO 5100
+* ... text preceding the "*"
+	      IF ( right_star .GT. 1 ) THEN
+	         out_str = coaching(rstart:rstart+right_star-1)	         
+	         len_out = right_star
+	      ELSE
+	         len_out = 1
+	      ENDIF
+* ... replacement text of "*", itself
+	      out_str(len_out:) = in_str
+	      len_out = len_out + len_in - 1
+* ... text following the "*"
+	      IF ( rstart+right_star-1 .LT. rend ) out_str(len_out+1:) =
+     .			coaching(rstart+right_star:rend)	         
+	      len_out = len_in + rend-rstart
+* --- end of star substitution
+	   ELSE
+* ... no star involved -- a simple substitution ...
+	      out_str = coaching(rstart:rend)
+	      len_out = rend - rstart + 1	
+	   ENDIF
+	ELSEIF ( len_out.EQ.0
+     .    .AND. (.NOT.opt_failed .AND. default
+     .           .OR. opt_failed .AND. def_replace) ) THEN 
+* ... replace the given argument with the default replacement text provided
+	   out_str = coaching(dstart:dend)
+	   len_out = dend - dstart + 1
+	ELSEIF ( len_out.EQ.0 ) THEN
+* ... nothing worked - we have a substitution error
+	   GOTO 5200
+	ELSE
+* ... the input text will do just fine as-is
+	   out_str = in_str
+	   RETURN
+	ENDIF
+
+* success
+	RETURN
+
+* error exits
+ 5000   RETURN
+ 5100   CALL ERRMSG( ferr_invalid_command, status,
+     .       'command argument strings are too long', *5000)
+ 5200	risc_buff = sym_name
+	CALL ERRMSG( errstat, status,
+     .       'Valid value needed for '//risc_buff, *5900)
+ 5400	risc_buff = coaching
+	CALL ERRMSG( ferr_syntax, status,
+     .       'empty text string provided with ">": '//risc_buff, *5000 )
+ 5500	risc_buff = coaching
+	CALL ERRMSG( ferr_syntax, status,
+     .       'both default and error strings given: '//risc_buff, *5000 )
+
+* display the supplied error string or list the allowed options
+#ifdef NO_PASSED_CONCAT
+ 5900   risc_buff = coaching(ostart:oend)
+	tmp_buff = sym_name
+	IF ( errtxt ) THEN
+	   CALL ERRMSG( ferr_nomessge, status,
+     .       coaching(estart:eend), *5000)
+!	   CALL WARN( coaching(estart:eend) )
+	ELSEIF ( options ) THEN
+	   CALL WARN
+     .	('Valid '//tmp_buff(:TM_LENSTR1(tmp_buff))//' choices are: '//risc_buff)
+	ENDIF
+	GOTO 5000
+#else
+ 5900	IF ( errtxt ) THEN
+	   CALL ERRMSG( ferr_nomessge, status,
+     .       coaching(estart:eend), *5000)
+!	   CALL WARN( coaching(estart:eend) )
+	ELSEIF ( options ) THEN
+	   CALL WARN
+     .	('Valid '//sym_name//' choices are: '
+     .					//coaching(ostart:oend))
+	ENDIF
+	GOTO 5000
+#endif
+
+	END
diff --git a/fer/gnl/create_agg_axis.F b/fer/gnl/create_agg_axis.F
new file mode 100644
index 0000000..7f5b5c9
--- /dev/null
+++ b/fer/gnl/create_agg_axis.F
@@ -0,0 +1,102 @@
+	SUBROUTINE CREATE_AGG_AXIS (len, line_dir, iline, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Define an axis for the aggregation direction (Ensemble, for now). If more
+* than one ensemble axis is defined, make the names unique.
+
+      IMPLICIT NONE
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+        include 'xprog_state.cmn'
+	include 'xtm_grid.cmn_text'  
+	include 'errmsg.parm'
+	
+* calling argument declarations:
+	INTEGER	len, line_dir, iline, status
+
+* local variable declarations:
+	INTEGER ALLO_MANAGED_AXIS
+	CHARACTER*64 ename
+
+* create the ensemble axis
+
+	status = ALLO_MANAGED_AXIS (iline )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* save the line in memory - but don't catalog its name
+	CALL TM_NEW_LINE_NAME ( 'ENSEMBLE', ename )
+
+	line_name     ( iline ) = ename
+	line_name_orig( iline ) = ename
+	line_start    ( iline ) = 1.0D0
+	line_delta    ( iline ) = 1.0D0
+	line_dim      ( iline ) = len
+	line_regular  ( iline ) = .TRUE.
+	line_modulo   ( iline ) = .FALSE.
+	line_units    ( iline ) = ' '
+	line_unit_code( iline ) = 0			! unknown units
+	line_shift_origin( iline ) = .FALSE.
+
+	line_direction( iline ) = 'NA'
+	IF (line_dir .EQ. x_dim) THEN
+	   line_direction( iline ) = 'WE'
+	   line_name     ( iline ) = 'LONGUITUDE'
+	ELSEIF (line_dir .EQ. y_dim) THEN
+	   line_direction( iline ) = 'SN'
+	   line_name     ( iline ) = 'LATITUDE'
+	ELSEIF (line_dir .EQ. z_dim) THEN
+	   line_direction( iline ) = 'UD'
+	   line_name     ( iline ) = 'DEPTH'
+	ELSEIF (line_dir .EQ. t_dim) THEN
+	   line_direction( iline ) = 'TI'
+	   line_name     ( iline ) = 'TIME'
+	ELSEIF (line_dir .EQ. e_dim) THEN
+	   line_direction( iline ) = 'EE'
+	   line_name     ( iline ) = 'ENSEMBLE'
+	ELSEIF (line_dir .EQ. f_dim) THEN
+	   line_direction( iline ) = 'FI'
+	   line_name     ( iline ) = 'FORECAST'
+	ENDIF
+	line_name_orig( iline ) = line_name ( iline )
+	
+ 5000   RETURN	
+ 5300   status = ferr_TMAP_error
+	RETURN
+
+	END
diff --git a/fer/gnl/create_agg_dset.F b/fer/gnl/create_agg_dset.F
new file mode 100644
index 0000000..2de0c90
--- /dev/null
+++ b/fer/gnl/create_agg_dset.F
@@ -0,0 +1,92 @@
+	SUBROUTINE CREATE_AGG_DSET (agg_dset, dname, dtitle, 
+     .               nsets, agg_dim, iline, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+      IMPLICIT NONE
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+        include 'xprog_state.cmn'
+	include 'xtm_grid.cmn_text'  
+	include 'errmsg.parm'
+	include 'netcdf.inc'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	dname, dtitle
+	INTEGER		agg_dset, nsets, agg_dim, iline, status
+
+* local variable declarations:
+	INTEGER TM_LENSTR, TM_LENSTR1, ALLO_MANAGED_AXIS,
+     .		type, coordvar, varid, big_cx
+	REAL	bad_flag
+
+	CALL CD_INIT_AGG_DSET (agg_dset, dname, status)
+
+	IF (status .NE. ferr_ok) GOTO 5300 
+
+* Set the dataset type and title (can add other directions)
+	IF (agg_dim .EQ. e_dim ) ds_type(agg_dset) = 'ENS'
+
+	ds_name(agg_dset) = dname
+	ds_des_name(agg_dset) = dname
+
+	IF (dtitle(1:2).EQ.char_init .OR. TM_LENSTR(dtitle).EQ.0) THEN
+	   ds_title(agg_dset) = cmnd_buff(item_start(1):item_end(num_items))
+	ELSE
+	   ds_title(agg_dset) = dtitle(:TM_LENSTR1(dname))
+	ENDIF
+
+* create the aggregate axis
+
+	CALL CREATE_AGG_AXIS (nsets, agg_dim, iline, status)
+	IF (status .NE. ferr_ok) GOTO 5300 
+
+	RETURN
+	
+ 5000   RETURN	
+ 5300   status = ferr_TMAP_error
+	RETURN
+
+	END
diff --git a/fer/gnl/cs_command.F b/fer/gnl/cs_command.F
new file mode 100644
index 0000000..ce1bc1b
--- /dev/null
+++ b/fer/gnl/cs_command.F
@@ -0,0 +1,246 @@
+        SUBROUTINE CS_COMMAND( cmnd_line, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is called to get the next command when the program is under
+* "internal" control (one command executing another)
+* its function is to return the next command to execute or to flag that the
+* internal level controlling the program has completed
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 4/29/87
+* revision 0.1 - 4/12/88 - allowed negative delta for time axis
+* v300: 1/2/93 - incorporated cmnd_semicolon
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420:  4/25/96 - added IF command
+*
+* 1/98 sh&kob
+* "KNOWN BUG: The proper formatting of the REPEAT limit requires a 
+*              knowledge of the grid of the result(see lohi_string.F). 
+*              Since the grid is not determined until the first repeat 
+*              loop is executed the formatting of the first loop may be
+*              incorrect. Fixing this would require that a new set of 
+*              world coordinate formatting routines be developed that 
+*              do not depend on the grid. This seemed too much trouble 
+*              given the small consequeunces."
+
+* V510 *sh* 3/00 - interrupts need to be processed in here!!
+*                  [IN FACT THIS TURNS OUT TO BE IRRELEVANT ... ]
+* v522 *kob* 12/00 - add xplot_setup common file to check to see if we
+*                    are animating
+* v540 *kob* 1/02 - fix bug in which last animation plot wasn't being
+*                   flushed to the screen
+* v541 *kob* 8/02 - for animating, check for Xserver backingstore and
+*                   don't animate if it's not set
+* V554 1/04 *acm* - add cs_repeatname for named /RANGE loop control
+* V600 5/06 *acm* - the call to new_gks_window needs window_title.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+        CHARACTER*(*)   cmnd_line
+* RETURN 1 - used when no command can be supplied
+
+* internal variable declarations:
+        INTEGER prev, status, limit, i, nparen
+        CHARACTER CX_DIM_STR*40
+        INTEGER  TM_LENSTR1, slen
+        CHARACTER*10 TM_FMT, out_buff
+        REAL    val
+        LOGICAL range
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+        include 'xrisc.cmn'
+        include 'xinterrupt.cmn'
+        include 'xplot_setup.cmn'
+        include 'xplot_state.cmn'
+        include 'GKSCM1.INC'            ! with gks common
+	include 'xtoday.cmn'		! with window_title
+
+        IF ( interrupted ) THEN
+
+* *kob* if we are animating, stop
+           IF ( animate ) THEN
+              animate = .FALSE.
+              first_frame = .TRUE.
+           ENDIF
+           CALL ERRMSG( ferr_interrupt,status,' ', *1000 )
+
+        ELSEIF ( cs_cmnd_num( csp ) .EQ. cmnd_repeat ) THEN
+
+***** REPEAT loop *******
+* done yet ?
+           range = .FALSE.
+           IF ( (cs_limit(csp)-cs_phase(csp))*cs_delta(csp)
+     .          .LT. 0.0 ) THEN
+* ... yes
+              IF ( animate .AND. (wsid .GT. 0) ) THEN
+*                make sure the latest image is displayed
+                 IF ( wn_open(wsid) ) THEN
+                    CALL FGD_GUWK(wsid, 0)
+                 ENDIF
+              ENDIF
+* *kob* check to see if we need to keep looping through animation
+              IF ( cs_loop(csp) .GT.1 ) THEN 
+                 cs_phase( csp ) = cs_start( csp ) 
+                 cs_loop( csp ) = cs_loop( csp) - 1 
+                 cmnd_line = cs_text( csp ) 
+                 CALL CS_SET_CONTEXT 
+                 RETURN 1
+              ELSE
+* *kob* repeat loop done so we are done animating.
+                 IF ( animate ) THEN
+                    animate = .FALSE.
+                    first_frame = .TRUE.
+                 ENDIF
+                 CALL POP_CS
+                 RETURN 1
+              ENDIF
+           ELSE
+*       ... no - get the next command
+              IF ( animate ) THEN
+*                make sure the latest image is displayed
+                 IF ( wsid .GT. 0 ) THEN
+                    IF ( wn_open(wsid) ) THEN
+                       CALL FGD_GUWK(wsid, 0)
+                    ENDIF
+                 ENDIF
+*                check if we are past commands for the first frame
+                 IF ( first_frame ) THEN
+                    IF ( ( (cs_phase(csp) - cs_start(csp))
+     .                         * cs_delta(csp) .GT. 0.0 ) ) THEN
+                       first_frame = .FALSE.
+                    ENDIF
+                 ENDIF
+              ENDIF
+              cmnd_line = cs_text( csp )
+* ... set up the default context to evaluate the command
+              range = (cs_repeatname( csp ) .NE. unspecified_name4)
+              IF (.NOT. range) THEN
+                 CALL CS_SET_CONTEXT
+              ELSE
+                 val = cs_phase( csp )
+                 out_buff = TM_FMT(val,10,10,len_rbuff)
+              ENDIF
+
+* ... prepare for next time around
+              cs_phase( csp ) = cs_phase( csp ) + cs_delta( csp )
+           ENDIF
+
+* ... echo the progress so the operator can monitor
+           IF ( mode_verify ) THEN
+              IF (.NOT. range) THEN
+                 risc_buff = CX_DIM_STR( cs_axis(csp), cx_last, ':',
+     .                                   .TRUE., len_rbuff )
+              ELSE
+                 slen = TM_LENSTR1(cs_repeatname(csp))
+                 risc_buff = cs_repeatname(csp)(1:slen)//':'//out_buff(1:len_rbuff)
+                 len_rbuff = TM_LENSTR1(risc_buff)
+              ENDIF
+
+              CALL SPLIT_LIST(pttmode_ops, ttout_lun, '!-> REPEAT: '
+     .                           //risc_buff(1:len_rbuff), 12+len_rbuff)
+           ENDIF
+
+        ELSEIF ( cs_cmnd_num(csp) .EQ. cmnd_semicolon ) THEN
+
+***** semicolon-separated command group
+* initialize the extracting of a single command
+           prev  = cs_phase(csp)
+           limit = cs_limit(csp)
+
+* done yet?
+           IF ( prev .GE. limit ) THEN
+* ... yes
+              CALL POP_CS
+              RETURN 1
+
+           ELSE
+* ... no - get the next command (find semicolon NOT enclosed in parens)
+              nparen = 0
+              DO 100 i = prev+1, limit
+                 IF ( cs_text(csp)(i:i) .EQ. '(' ) THEN
+                    nparen = nparen + 1
+                 ELSEIF ( cs_text(csp)(i:i) .EQ. ')' ) THEN
+                    nparen = nparen - 1
+                 ELSEIF ( cs_text(csp)(i:i) .EQ. ';' ) THEN
+* ... found another semicolon-terminated command in group
+                    IF ( nparen .EQ. 0 ) THEN
+                       cmnd_line = cs_text(csp)(prev+1:i-1)
+                       cs_phase(csp) = i
+                       GOTO 1000
+                    ENDIF
+                 ENDIF
+ 100          CONTINUE
+* ... last command in buffer
+              cmnd_line = cs_text(csp)(prev+1:limit)
+              cs_phase(csp) = limit
+                   
+           ENDIF
+
+* ****** conditional "IF" command
+
+        ELSEIF ( cs_cmnd_num(csp) .EQ. cmnd_if ) THEN
+
+* already done?
+           IF (cs_phase(csp) .GT. 0 ) THEN
+
+* ... yes get outta here
+              CALL POP_CS
+              RETURN 1
+           ELSE
+
+* ... no - get the next command
+              cmnd_line = cs_text( csp )
+              cs_phase(csp) = 1         ! signal to POP after this command
+
+           ENDIF
+
+* ***** unrecognized command in control of stack
+
+        ELSE
+           CALL ERRMSG( ferr_internal, status, 'command stack', *1000 )
+        ENDIF
+
+ 1000   RETURN
+        END
diff --git a/fer/gnl/cs_semicolon.F b/fer/gnl/cs_semicolon.F
new file mode 100644
index 0000000..c024ca0
--- /dev/null
+++ b/fer/gnl/cs_semicolon.F
@@ -0,0 +1,84 @@
+
+
+	SUBROUTINE CS_SEMICOLON( cmnd_line, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is called to save a group of commands separated by semicolons
+* and bump the FERRET "control stack" to place that group of commands in
+* control
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V3.00 - 2/1/93
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	CHARACTER*(*)	cmnd_line
+* RETURN 1 - always taken
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, status
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xcontrol.cmn'
+
+* allocate next spot on the control stack
+* ... but leave the stack in place in case of errors in this routine
+	CALL STACK_PTR_UP( csp, cs_max, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* load the command group
+	cs_text (csp) = cmnd_line
+        cs_phase(csp) = 0    ! points before the first character
+        cs_limit(csp) = TM_LENSTR1( cmnd_line )
+
+* and tell 'em who owns this level
+	cs_cmnd_num( csp ) = cmnd_semicolon
+
+* tell 'em we've taken over and start workin'
+	cs_in_control = .TRUE.
+	input_source  = input_from_cs
+	RETURN 1
+
+* error exit
+* ... control stack pointer, CSP, corrected in ERRMSG
+ 5000	RETURN
+	END
diff --git a/fer/gnl/ctrl_c.F b/fer/gnl/ctrl_c.F
new file mode 100644
index 0000000..9830e90
--- /dev/null
+++ b/fer/gnl/ctrl_c.F
@@ -0,0 +1,144 @@
+	SUBROUTINE SET_CTRL_C (CTRLC_AST)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* turn on facility to trap keyboard interrupts
+* the interrupt handler defined here simply sets the common variable
+* "interrupted" to .TRUE.
+
+* on VMS:
+* queue a VMS "asynchronous system trap" to catch user interrupts via ^C
+* note that this routine must be called again following each interrupt
+* this code is based on page 8-47 of Guide to Programming on VAX/VMS (Fortran)
+
+* on Unix:
+* use routine "SIGNAL" to define the interrupt handler
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/27/87 SH based on QINTERRUPT from program PRNT 8/2/85
+* Unix/RISC port 3/18/91
+
+* V313 - 11/1/94 - AIX port: use "SIGNAL_" instead of "SIGNAL" and
+*		must reset signal handler after every use
+
+* v4.20	- 1/30/96 - modified ifdef logic for determining call to
+*		    signal handler.  Turns out solaris also needs
+*		    to call the signal handler each time.  *kob*
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line. Used DATA rather than PARAMETER
+*		statement because variable modified later in routine
+*	      - put a ! in front of "D" for disabled lines
+* 1/03 *kob* - g77 port - g77 needs to call SIGNAL with only two arguments
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* argument: CTRLC_AST
+*	name of routine to be called if operator hits ^C
+*	(or call with argument %VAL(0) to return to normal VMS ^C processing)
+
+* include the following lines in the routine requiring ^C interrupts:
+*	INCLUDE 'XINTERRUPT.CMN'
+*
+*	IF ( interrupt ) THEN ...
+
+	EXTERNAL	CTRLC_AST
+	LOGICAL		first_call
+        DATA	 	first_call/.TRUE./    !kob 12/96
+
+#if defined AIX_XLF 
+      INTEGER SIGNAL_, old_handler, sigint
+#else
+      INTEGER SIGNAL, old_handler, sigint
+#endif
+* (see unix man signal or the include file < signal.h >)
+      PARAMETER ( sigint = 2 )
+
+      include 'xinterrupt.cmn'
+
+
+*set up new defines *kob* 1/96
+#ifdef AIX_XLF 
+# define call_handler_each_time
+#endif
+#ifdef solaris
+# define call_handler_each_time
+#endif
+
+! "D" lines to disable disabled
+!D     GOTO 888
+* use newly named condition tests *kob* 1/96
+#ifdef call_handler_each_time
+#  ifdef NEED_SIGNAL_UNDERSCORE
+      old_handler = SIGNAL_( 2, CTRLC_AST, -1 )    ! on AIX call every time
+#  elif defined G77_SIGNAL
+      old_handler = SIGNAL( 2, CTRLC_AST)    !! on solaris call every time
+#  else
+      old_handler = SIGNAL( 2, CTRLC_AST, -1 )    ! on solaris call every time
+
+#  endif
+#else
+#  ifdef NEED_SIGNAL_UNDERSCORE
+      IF (first_call) old_handler = SIGNAL_( 2, CTRLC_AST, -1 )
+#  elif defined G77_SIGNAL
+      old_handler = SIGNAL( 2, CTRLC_AST)    
+#  else 
+      IF (first_call) old_handler = SIGNAL( 2, CTRLC_AST, -1 )
+#  endif	
+#endif
+!D 888 CONTINUE
+
+* ************************ ALL SYSTEMS ************************
+* system is ready - set flag to indicate no interrupt yet
+	INTERRUPTED = .FALSE.
+        first_call = .FALSE.
+
+	RETURN
+	END
+
+***********************************************************
+
+	SUBROUTINE CTRLC_AST
+
+* this routine is called when ^C is entered if AST is queued
+
+	include 'xinterrupt.cmn'	! COMMON/XINTERRUPT/
+
+	interrupted = .TRUE.
+
+	RETURN
+	END	
diff --git a/fer/gnl/define_aggregate_grid.F b/fer/gnl/define_aggregate_grid.F
new file mode 100644
index 0000000..06e0fc6
--- /dev/null
+++ b/fer/gnl/define_aggregate_grid.F
@@ -0,0 +1,169 @@
+	SUBROUTINE DEFINE_AGGREGATE_GRID (agg_dset, nvars, vname,
+     .      fvar, iline, grid, agg_dim, member_sets, nsets)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Define ensemble axis and grid using that axis. For uvars, grid is 
+* set to unspecified_int4 when calling this. Will defer the grid check for later.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+      IMPLICIT NONE
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+        include 'xprog_state.cmn'
+	include 'xtm_grid.cmn_text'  
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xfr_grid.cmn'
+	include 'interp_stack.parm'
+	include 'netcdf.inc'
+
+* calling argument declarations:
+	INTEGER agg_dset, nvars, fvar, iline, grid,
+     .		agg_dim, member_sets(*), nsets
+	CHARACTER*(*) vname
+
+* local variable declarations:
+	LOGICAL	its_dynamic, itsa_uvar
+	INTEGER STR_SAME,
+     .		big_cx, igrid, idim, gnum, nv, type, 
+     .		ii, iset, slen, vtype, status
+
+* Just for testing, get info back from the attribute-handling structure
+	CHARACTER varname*128, name*128
+	INTEGER vartype, nvdims, vdims(8), nvatts, all_outflag, varid
+	LOGICAL coordvar
+
+* Define aggregate grid
+
+      igrid = unspecified_int4
+      IF (grid .NE. unspecified_int4) THEN
+         igrid = 0
+         CALL TM_NEXT_TMP_GRID (igrid, 710)
+  710    CALL TM_ALLO_TMP_GRID (igrid, status)
+         IF (status .NE. ferr_ok) GOTO 5000
+
+         DO 700 idim = 1, nferdims
+            grid_line(idim, igrid) = grid_line(idim,grid)
+  700    CONTINUE
+         grid_line(agg_dim, igrid) = iline
+         
+* Make up a unique grid name for aggregate grid
+           IF (agg_dim .EQ. 5) grid_name(igrid) = 'GEN'
+           IF (agg_dim .EQ. 6) grid_name(igrid) = 'GFN'
+           CALL TM_NEW_GRID_NAME( grid_name(igrid), name )
+           grid_name(igrid) = name
+
+	   gnum = igrid
+      ENDIF
+
+* ds_var slot, fill with aggregate variable in aggregate dataset.
+
+      itsa_uvar = .FALSE.
+      DO 720 nv = 1, maxvars
+	      IF ( STR_SAME(ds_var_code(nv),char_init) .EQ. 0 ) GOTO 725
+ 720	CONTINUE
+ 725	ds_var_setnum(nv)   = agg_dset
+	CALL string_array_modify(ds_var_code_head, nv, 
+     .         ds_var_code(fvar), LEN(ds_var_code(fvar)))
+	ds_var_title(nv)    = ds_var_title(fvar)
+	IF ( ds_var_title(nv) .EQ. char_init128) 
+     .       ds_var_title(nv)  = varname
+	ds_var_titl_mod(nv) = ds_var_titl_mod(fvar)
+	ds_var_units(nv)    = ds_var_units(fvar)
+	ds_var_type(nv)     = ds_var_type(fvar)
+	ds_missing_flag(nv) = bad_val4
+	ds_bad_flag(nv)     = bad_val4
+	cd_scale_factor(nv) = 1.
+	cd_add_offset(nv)   = 0.
+	cd_scaled(nv)       = .FALSE.
+
+	IF (grid .NE. unspecified_int4) THEN
+	   DO 730 idim = 1, nferdims
+	      ds_grid_start(idim,nv)= ds_grid_start(idim,fvar)
+	      ds_grid_end(idim,nv)  = ds_grid_end(idim,fvar)
+	      ds_ordering(idim,nv)  = ds_ordering(idim,fvar)
+ 730	   CONTINUE
+	   ds_ordering(agg_dim,nv) = agg_dim
+	   ds_grid_start(agg_dim,nv) = 1
+	   ds_grid_end(agg_dim,nv) = nsets
+	   ds_grid_number(nv) = gnum
+	ENDIF
+
+* Type should be NCFLOAT or NCCHAR
+	IF (ds_var_type(nv) .EQ. ptype_string) THEN
+	   type = NCCHAR
+	ELSE
+	   type = NCFLOAT
+	ENDIF
+      
+	CALL CD_ADD_VAR( agg_dset, vname, nvars, 
+     .         ds_var_title(nv), ds_var_units(nv), type, 
+     .         .FALSE., ds_bad_flag(nv), status)
+
+* Add aggregate-grid info to the lists in aggregate datset and aggregate-grid list.
+* Mark user-variables with a grid number of -999
+
+	DO 750 ii = 1, nsets
+	   iset = member_sets(ii)
+	   DO 740 nv = 1, maxvars
+	      IF ( (ds_var_setnum(nv) .EQ. iset) .AND. 
+     .             (STR_SAME(ds_var_code(nv), vname) .EQ. 0) ) THEN
+	         igrid = ds_grid_number(nv)
+		 vtype = 1 ! file var
+	         CALL CD_ADD_AGG_VAR_INFO (agg_dset, vname, ii, vtype, 
+     .             iset, igrid, iline, nv, status)
+	      ENDIF
+	      IF ( (uvar_dset(nv) .EQ. iset) .AND. 
+     .             (STR_SAME(uvar_name_code(nv), vname) .EQ. 0) ) THEN
+	         igrid = unspecified_int4
+		 vtype = 3 ! user var
+	         CALL CD_ADD_AGG_VAR_INFO (agg_dset, vname, ii, vtype, 
+     .             iset, igrid, iline, nv, status)
+	      ENDIF
+ 740	   CONTINUE
+ 750	CONTINUE
+
+ 5000	RETURN
+     
+	END
diff --git a/fer/gnl/define_special_grids.F b/fer/gnl/define_special_grids.F
new file mode 100644
index 0000000..0c961b4
--- /dev/null
+++ b/fer/gnl/define_special_grids.F
@@ -0,0 +1,255 @@
+	SUBROUTINE DEFINE_SPECIAL_GRIDS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* define "pre_defined" grids not set up by TMAP_FORMAT COMMON
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*
+* V200:  6/22/89
+*	10/23/89 - added ez_dflt
+* V300: 6/93 - lengthened axis EZ x10 so that accidental truncations were rarer
+* V500: 12/98 - added XABSTRACT, YABSTRACT, ZABSTRACT, and TABSTRACT
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+* V62 *acm*  2/09 - Save original upper/lowercase spelling of axis names 
+*                   in line_name_orig for CANCEL MODE UPCASE
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V685 *acm*  6/13 Increase nominal length of abstract axis
+
+	include	'tmap_dims.parm'
+	include	'tmap_errors.parm'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xfr_grid.cmn'
+
+* local variable declarations:
+	INTEGER	TM_FIND_LINE_SLOT, TM_FIND_GRID_SLOT,
+     .		iline, igrid, idim, iline_abstract, status
+
+* "ABSTRACT" axis
+* find a space to catalog it
+	status = TM_FIND_LINE_SLOT( iline )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* save the line in memory - but don't catalog its name
+	line_name     ( iline ) = 'ABSTRACT'
+	line_name_orig( iline ) = 'ABSTRACT'
+	line_start    ( iline ) = 1.0D0
+	line_delta    ( iline ) = 1.0D0
+	line_dim      ( iline ) = 99999999
+	line_regular  ( iline ) = .TRUE.
+	line_modulo   ( iline ) = .FALSE.
+	line_units    ( iline ) = ' '
+	line_unit_code( iline ) = 0	! unknown units
+	line_t0       ( iline ) = ' '
+	line_shift_origin( iline ) = .FALSE.
+	line_subsc1   ( iline ) = unspecified_int4	! since regular
+	line_direction( iline ) = 'NA'
+	iline_abstract = iline
+
+* "ABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with nferdims abstract axes
+	DO 100 idim = 1, nferdims
+	   grid_line    (idim, igrid) = iline_abstract
+           grid_out_prod(idim, igrid) = .TRUE.
+ 100	CONTINUE	
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'ABSTRACT'
+
+* save pointer to grid
+	mgrid_abstract = igrid
+
+
+* "EZ" axis
+* find a space to catalog it
+	status = TM_FIND_LINE_SLOT( iline )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* save the line in memory - but don't catalog its name
+	line_name     ( iline ) = 'EZ'
+	line_name_orig( iline ) = 'EZ'
+	line_start    ( iline ) = 1.0D0
+	line_delta    ( iline ) = 1.0D0
+	line_dim      ( iline ) = 20480
+	line_regular  ( iline ) = .TRUE.
+	line_modulo   ( iline ) = .FALSE.
+	line_units    ( iline ) = ' '
+	line_unit_code( iline ) = 0	! unknown units
+	line_t0       ( iline ) = ' '
+	line_shift_origin( iline ) = .FALSE.
+	line_subsc1   ( iline ) = unspecified_int4	! since regular
+	line_direction( iline ) = 'NA'
+
+* "EZ" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 axis, only
+	DO 200 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 200	CONTINUE	
+	grid_line    (1, igrid) = iline    
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'EZ'
+
+* save pointer to grid
+	mgrid_ez_dflt = igrid
+
+
+* "XABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 300 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 300	CONTINUE
+	grid_line(x_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'XABSTRACT'
+
+* save pointer to grid
+	mgrid_xabstract = igrid
+
+* "YABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 400 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 400	CONTINUE
+	grid_line(y_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'YABSTRACT'
+
+* save pointer to grid
+	mgrid_yabstract = igrid
+
+
+* "ZABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 500 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 500	CONTINUE
+	grid_line(z_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'ZABSTRACT'
+
+* save pointer to grid
+	mgrid_zabstract = igrid
+
+* "TABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 600 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 600	CONTINUE
+	grid_line(t_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'TABSTRACT'
+
+* save pointer to grid
+	mgrid_tabstract = igrid
+
+
+
+* "EABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 700 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 700	CONTINUE
+	grid_line(e_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'EABSTRACT'
+
+* save pointer to grid
+	mgrid_eabstract = igrid
+
+
+
+* "FABSTRACT" grid
+* find a space to catalog it
+	status = TM_FIND_GRID_SLOT( igrid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* make grid with 1 abstract axis
+	DO 800 idim = 1, nferdims
+	   grid_line    (idim, igrid) = mnormal
+           grid_out_prod(idim, igrid) = .TRUE.
+ 800	CONTINUE
+	grid_line(f_dim, igrid) = iline_abstract
+	grid_rotation( igrid ) = 0.0
+	grid_name    ( igrid ) = 'FABSTRACT'
+
+* save pointer to grid
+	mgrid_fabstract = igrid
+
+
+
+	RETURN
+
+ 5000	STOP 'DFN_SPC_GRD'
+	END
diff --git a/fer/gnl/delete_one_line.F b/fer/gnl/delete_one_line.F
new file mode 100644
index 0000000..6546a8d
--- /dev/null
+++ b/fer/gnl/delete_one_line.F
@@ -0,0 +1,92 @@
+
+	SUBROUTINE DELETE_ONE_LINE (axis, status)
+	
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* Delete a single axis (from xeq_cancel)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+        include 'xtm_grid.cmn_text'
+
+	INTEGER axis, slen, status
+	CHARACTER*10 TM_FMT, buff
+	REAL	raxis
+
+	INTEGER TM_GET_GRID_OF_LINE, TM_GET_LINENUM, 
+     .		grid, num_protected_axes
+
+	raxis = axis
+	buff = TM_FMT(raxis, 6, 10, slen)
+	num_protected_axes = TM_GET_LINENUM( 'EZ' )  ! top protected axis
+
+	IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+	IF ( axis .LE. num_protected_axes ) GOTO 6212
+	line_keep_flag(axis) = .FALSE.  ! see tm_garb_col_grids.F
+	IF (line_use_cnt(axis) .LE. 0) THEN
+	   IF ( axis .LE. max_lines ) THEN
+	      IF ( axis .LE. max_lines ) THEN
+	         IF (.NOT. line_regular(axis))
+     .                CALL PACK_LINE_STORAGE(axis)
+	         line_name(axis) = char_init16
+	      ELSE
+	         CALL TM_DEALLO_DYN_LINE(axis)
+	      ENDIF
+	   ENDIF
+	ELSE
+*     ... cannot delete - in use.  Locate the grid that is using it.
+	   grid = TM_GET_GRID_OF_LINE( axis )
+	   CALL WARN( 'Not deleted: '//line_name(axis))
+	   IF ( grid .NE. unspecified_int4 ) THEN
+	      CALL WARN( 
+     .		'Axis is in use by grid '//grid_name(grid))
+	   ELSE
+	      CALL ERRMSG(ferr_internal, status,
+     .				'axis use count err', *5000)
+	   ENDIF
+	ENDIF
+
+ 5000	CONTINUE
+	RETURN
+
+ 6210	CALL ERRMSG( ferr_invalid_command, status, 'unknown axis: '//
+     .		     buff(:slen), *5000 )
+ 6212	CALL ERRMSG( ferr_invalid_command, status, 'protected axis: '//
+     .		     buff(:slen), *5000 )
+
+	END
diff --git a/fer/gnl/do_query.F b/fer/gnl/do_query.F
new file mode 100644
index 0000000..e793085
--- /dev/null
+++ b/fer/gnl/do_query.F
@@ -0,0 +1,645 @@
+   	SUBROUTINE DO_QUERY( chout, fmt, query, tag, status ) 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* respond to the specific QUERY command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* for FERRET V300: 6/16/93
+* V314: 8/19/94 *kob* IBM port - Modified format statements, added 
+*				 ifdef MANDATORY_FORMAT_WIDTHS for I format
+*			         descriptor 
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420: 11/95 - bug in QUERY GRID if grid unknown:  LET A = I; QUERY GRID 1 A
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* kob*   9/97 - replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in order
+*               to have access to context information - needed for negative
+*               time step processing
+* V5.3  1/01 *acm* cal_id for alternative calendar types: call to TM_DATE_OK
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+#        include "tmap_dset.parm"
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+        include 'xalt_messages.cmn_text'
+        external xalt_messages_data
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xprog_state.cmn'
+	include 'xcommand.cmn'
+	include 'xtext_info.cmn'
+	include 'xcontext.cmn'
+	include 'xalgebra.cmn'
+	include 'xgui.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations
+	INTEGER chout, query, status
+	CHARACTER*(*) fmt, tag
+
+* local variable declarations:
+	LOGICAL TM_DATE_OK, done, formatted, ww_given
+	INTEGER	TM_LENSTR1, FIND_DSET_NUMBER, IGRID, TM_GET_LINENUM,
+     .		STR_CASE_BLIND_COMPARE, TM_GET_GRIDNUM, ISUBSCR_CX,
+     .		i, n, dim, dset, cat, var, axis, grid, reg, modulo,
+     .		calendar, dummy, istat, slen, ds_var_len
+	INTEGER TM_GET_CALENDAR_ID, cal_id
+
+
+	REAL*8	TWORLD, TM_WORLD, lo, hi, delta
+	CHARACTER TM_FMT*16, buff1*32, buff2*32
+
+* initialize
+	status = ferr_ok
+	risc_buff = ' '
+	IF ( query .GT. max_queries ) THEN
+	   status = ferr_invalid_command
+	   RETURN
+	ENDIF
+
+* respond to the appropriate query
+	GOTO ( 100, 200, 300, 400, 500, 600, 700, 800, 900,1000,
+     .	      1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,
+     .	      2100,2200,2300,2400,2500,2600,2700,2800,2900,3000 ) query
+	
+* STATUS
+* error status of last command
+ 100	CONTINUE
+	   IF ( gui_status .EQ. ferr_ok ) THEN
+	      WRITE (risc_buff, fmt ) 0, queries(query), tag
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+
+	   ELSE
+	      WRITE (risc_buff, fmt ) 1, queries(query), tag
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	      risc_buff = ' '
+	      WRITE (risc_buff, '(I4)') gui_status
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   ENDIF
+	   gui_status = ferr_ok   ! clear it
+	GOTO 4999
+
+* MESSAGE
+* messages from last command
+ 200	CONTINUE
+	   WRITE (risc_buff, fmt ) alt_nlines, queries(query), tag
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   DO 210 i = 1, alt_nlines
+	      risc_buff = ' '
+ 	      WRITE (risc_buff,'(A)') alt_text(i)(1:TM_LENSTR1(alt_text(i)))
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+ 210	   CONTINUE
+	   alt_nlines = 0   ! clear messages
+	GOTO 4999
+
+* DSET
+* list of open data sets
+ 300	CONTINUE
+*   ... count data sets
+ 	   n = 0
+	   DO 310 i = 1,  maxdsets
+ 310	   IF ( ds_name(i) .NE. char_init1024) n = n + 1
+*   ... list 'em
+	   WRITE (risc_buff, fmt ) n, queries(query), tag
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   DO 320 i = 1,  maxdsets
+	      IF (ds_name(i).NE.char_init1024) THEN
+	         WRITE (risc_buff,'(A)')
+     .			ds_name(i)(1:TM_LENSTR1(ds_name(i)))
+	         CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	         risc_buff = ' '
+	      ENDIF
+ 320	   CONTINUE
+	GOTO 4999
+
+* VARIABLE dset
+* list variables in data set
+ 400	CONTINUE
+	IF ( num_args .NE. 2 ) GOTO 5040
+* ... identify the data set
+	dset = FIND_DSET_NUMBER( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( dset .EQ. unspecified_int4 ) GOTO 5910
+* ... pass1 to count variables in data set
+	n = 0
+	DO 410 var = 1, maxvars
+	   IF ( ds_var_setnum(var) .NE. dset ) GOTO 410
+	   IF ( ds_var_code(var) .EQ. '-' ) GOTO 410
+	   n = n + 1
+ 410	CONTINUE
+	WRITE (risc_buff, fmt ) n, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+* ... pass 2 to output variable names
+	DO 420 var = 1, maxvars
+           IF ( ds_var_setnum(var) .NE. dset ) GOTO 420
+           IF ( ds_var_code(var) .EQ. '-' ) GOTO 420
+*           WRITE (risc_buff,'(A)')
+*     .			ds_var_code(var)(1:TM_LENSTR1(ds_var_code(var)))
+           CALL string_array_get_strlen1(ds_var_code_head, var, ds_var_len)
+           WRITE (risc_buff,'(A)')
+     .			ds_var_code(var)(1:ds_var_len)
+
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   risc_buff = ' '
+ 420    CONTINUE
+	GOTO 4999
+
+* GRID dset variable
+* n-axis description of grid for given variable
+* 5 records back: grid name and axis names with flags
+ 500	CONTINUE
+	IF ( num_args .NE. 3 ) GOTO 5050
+* ... identify the data set, then variable, then its grid
+	dset = FIND_DSET_NUMBER( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( dset .EQ. unspecified_int4 ) GOTO 5910
+	CALL FIND_VAR_NAME( dset, cmnd_buff(arg_start(3):arg_end(3)),
+     .	                    cat, var )
+	IF ( var .EQ. munknown_var_name ) GOTO 5920
+	grid = IGRID ( dset, cat, var, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( grid .EQ. unspecified_int4 ) GOTO 5925
+	WRITE (risc_buff, fmt ) 5, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+	WRITE (risc_buff, '(A)')
+     .			grid_name(grid)(1:TM_LENSTR1(grid_name(grid)))
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+* ... return the names of the axes and an inner/outer flag
+	DO 510 dim = 1, nferdims
+	   axis = grid_line( dim, grid )
+	   IF ( axis .EQ. munknown ) THEN
+	      CALL SPLIT_LIST(pttmode_explct, chout, 'UNKNOWN O', 9)
+	   ELSEIF( axis .EQ. mnormal ) THEN
+	      CALL SPLIT_LIST(pttmode_explct, chout, 'NORMAL O', 8)
+	   ELSE
+	      CALL SPLIT_LIST(pttmode_explct, chout,
+     .					line_name(axis)//' O', 0)
+	   ENDIF
+ 510    CONTINUE
+	GOTO 4999
+
+* AXIS  axname
+* axis description: "npts reg modulo calendar lo_value delta unit_code units"
+ 600	CONTINUE
+	IF ( num_args .NE. 2 ) GOTO 5060
+	axis = TM_GET_LINENUM( cmnd_buff(arg_start(2):arg_end(2)) )
+ 610	IF ( axis .EQ. unspecified_int4 ) GOTO 5930
+	GOTO 5000  ! not available yet
+
+* COORDS axis
+* coordinates of (irregular) axis
+ 700	CONTINUE
+	GOTO 5000
+
+* TRANS  *************
+* list of transforms
+ 800	CONTINUE
+* ... count the number of transforms
+	n = 0
+	DO 810 i = 4, num_transforms
+	   IF ( i .EQ. 11 .OR. i .EQ. 12 
+     .	   .OR. alg_trans_num( i ) .EQ. unspecified_int4 ) GOTO 810
+	   n = n + 1	
+ 810	CONTINUE
+	WRITE (risc_buff, fmt ) n, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+* ... each transform: XXX dflt_arg_or_* Compress_or_Span  "title"
+	DO 820 i = 4, num_transforms
+	   IF ( i .EQ. 11 .OR. i .EQ. 12 
+     .	   .OR. alg_trans_num( i ) .EQ. unspecified_int4 ) GOTO 820
+	   risc_buff = ' '
+	   IF ( alg_trans_has_arg(i) ) THEN
+	      buff1 = TM_FMT( alg_trans_dflt_arg(i), 3, 5, slen ) 
+	      IF ( .NOT.alg_trans_its_int(i)
+     .	     .AND. INDEX(buff1,'.') .EQ. 0  ) THEN
+	         buff1 = buff1(:slen)//".0"
+	         slen = slen + 2
+	      ENDIF	
+	   ELSE
+	      buff1 = '*'
+	   ENDIF
+	   IF ( alg_trans_num(i) .GT. trans_compress_code ) THEN
+	      buff2 = 'C'   ! compresses range of data
+	   ELSE
+	      buff2 = 'S'   ! span of data preserved
+	   ENDIF
+	   WRITE (risc_buff, 3800 )
+     .			alg_trans_text(i) ,
+     .			buff1(:TM_LENSTR1(buff1)),
+     .			buff2,
+     .			alg_trans_title(i)(:TM_LENSTR1(alg_trans_title(i)))
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+ 820	CONTINUE
+ 3800	FORMAT(A3,1X,A,1X,A1,' "',A,'"')
+	GOTO 4999
+
+* TRNARG (trans) ****will not be used!!*************
+* argument description for given transform
+ 900	CONTINUE
+* LVARS  *************
+* list of LET-defined variables
+ 1000	CONTINUE
+* DVARS (dset) *************
+* list of LET-defined variables defined for data set
+ 1100	CONTINUE
+* VBACKGROUND  (dset variable) *************
+* background info about this variable
+ 1200	CONTINUE
+	GOTO 5000
+* DBACKGROUND (dset) *************
+* background info about this data set
+ 1300	CONTINUE
+	GOTO 5000
+* WINDOWS  *************
+* list of open windows
+ 1400	CONTINUE
+	GOTO 5000
+* WCURRENT  *************
+* name of current window
+ 1500	CONTINUE
+	GOTO 5000
+* VPORTS  *************
+* list of defined viewports
+ 1600	CONTINUE
+	GOTO 5000
+* VCURRENT  *************
+* name of current viewport
+ 1700	CONTINUE
+	GOTO 5000
+* VIEW  (vport) *************
+* definition of indicated viewport
+ 1800	CONTINUE
+	GOTO 5000
+
+* DCURRENT
+* name of current data set
+ 1900	CONTINUE
+	done = .FALSE.
+	DO 1910 dset = 1, maxdsets
+           IF ( ds_name(dset) .EQ. char_init1024) GOTO 1910
+	   IF ( dset .EQ. cx_data_set(cx_last) ) THEN
+	      WRITE (risc_buff, fmt ) 1, queries(query), tag
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	      risc_buff = ' '
+	      WRITE (risc_buff, '(A)' )
+     .			ds_name(dset)(1:TM_LENSTR1(ds_name(dset)))
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	      risc_buff = ' '
+	      done = .TRUE.
+	   ENDIF
+ 1910	CONTINUE
+	IF ( .NOT.done ) THEN
+	   WRITE (risc_buff, fmt ) 0, queries(query), tag
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	ENDIF
+	GOTO 4999
+
+* SPAN  dset variable
+* return nferdims+1 records:
+* 1 - the grid name for this variable
+* 2-n the subssript, world coords, and world text limits along each axis
+ 2000	CONTINUE
+	IF ( num_args .NE. 3 ) GOTO 5050
+* ... identify the data set, then variable, then its grid
+	dset = FIND_DSET_NUMBER( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( dset .EQ. unspecified_int4 ) GOTO 5910
+	CALL FIND_VAR_NAME( dset, cmnd_buff(arg_start(3):arg_end(3)),
+     .	                    cat, var )
+	IF ( var .EQ. munknown_var_name ) GOTO 5920
+	IF ( cat .NE. cat_file_var ) GOTO 5000
+	grid = IGRID ( dset, cat, var, status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+	WRITE (risc_buff, fmt ) 5, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+* ... return the grid name
+	WRITE (risc_buff, '(A)' ) grid_name(grid)
+     .	                          (1:TM_LENSTR1(grid_name(grid)))
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+* ... return the subscript span along each axis
+	DO 2010 dim = 1, nferdims
+	   axis = grid_line( dim, grid )
+	   IF ( axis .EQ. munknown
+     .     .OR. axis .EQ. mnormal ) THEN
+	      WRITE (risc_buff,3200) -111, -111, 0.D0, 0.D0, '*', '*'
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   ELSE
+	      lo = TM_WORLD(ds_grid_start(dim,var), grid, dim, box_middle)
+	      hi = TM_WORLD(ds_grid_end  (dim,var), grid, dim, box_middle)
+	      CALL TRANSLATE_TO_WORLD( lo,dim,grid,ax_dec_pt(dim),buff1 )
+	      CALL TRANSLATE_TO_WORLD( hi,dim,grid,ax_dec_pt(dim),buff2 )
+	      CALL CLEAN_COORD_STRING(dim, buff1(1:TM_LENSTR1(buff1)))
+	      CALL CLEAN_COORD_STRING(dim, buff2(1:TM_LENSTR1(buff2)))
+              WRITE (risc_buff,3200) ds_grid_start(dim,var),
+     .				 ds_grid_end  (dim,var),
+     .				 lo, hi,
+     .				 buff1(1:TM_LENSTR1(buff1)),
+     .				 buff2(1:TM_LENSTR1(buff2))
+	      CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   ENDIF
+	   risc_buff = ' '
+ 2010    CONTINUE
+ 3200	FORMAT(2I6,2(1PG14.5),2(1x,A))
+	GOTO 4999
+
+* GAXIS grid orientation    (like AXIS but different args)
+ 2100	CONTINUE
+	IF ( num_args .NE. 3 ) GOTO 5210
+	grid = TM_GET_GRIDNUM( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( grid .EQ. unspecified_int4 ) GOTO 5930
+	DO 2110 dim = 1, nferdims
+	  istat = STR_CASE_BLIND_COMPARE( ww_dim_name(dim),
+     .				cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) GOTO 2120
+ 2110	CONTINUE
+	GOTO 5210
+ 2120	axis = grid_line( dim, grid )
+	WRITE (risc_buff, fmt ) 1, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+	IF ( axis .EQ. munknown
+     .  .OR. axis .EQ. mnormal ) THEN
+	   n = 0
+	   lo = 0.D0
+	   hi = 0.D0
+	   delta = 0.D0
+	   reg = 0
+	   modulo = 0
+	   calendar = 0
+	ELSE
+	   n = line_dim(axis)
+	   lo = TWORLD(1, grid, dim, box_middle)
+	   hi = TWORLD(n, grid, dim, box_middle)
+	   delta = (hi-lo)/(n-1)
+	   IF ( line_regular(axis) ) THEN
+	      reg = 1
+	   ELSE
+	      reg = 0
+	   ENDIF
+	   IF ( line_modulo( axis ) ) THEN	
+	      modulo = 1
+	   ELSE
+	      modulo = 0
+	   ENDIF
+           cal_id = TM_GET_CALENDAR_ID (line_cal_name(axis) )
+	   IF ( TM_DATE_OK( line_t0(axis), cal_id)  ) THEN
+	      calendar = 1
+	   ELSE
+	      calendar = 0
+	   ENDIF
+	ENDIF
+	WRITE (risc_buff, 3060 ) n, reg, modulo, calendar,
+     .			      lo, delta,
+     .			      line_unit_code(axis),
+     .			      line_units(axis)(1:TM_LENSTR1(line_units(axis)))
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	GOTO 4999
+ 3060	FORMAT(I6,3I2,2(1PG14.5),I4,2X,A)
+
+* GCOORDS grid orientation    (like COORDS but different args)
+ 2200	CONTINUE
+	IF ( num_args .NE. 3 ) GOTO 5220
+	grid = TM_GET_GRIDNUM( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( grid .EQ. unspecified_int4 ) GOTO 5930
+	DO 2210 dim = 1, nferdims
+	  istat = STR_CASE_BLIND_COMPARE( ww_dim_name(dim),
+     .					 cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) GOTO 2220
+ 2210	CONTINUE
+	GOTO 5220
+ 2220	CALL GRID_SUBSCRIPT_EXTREMES( dummy, n, grid, dim )
+	WRITE (risc_buff, fmt ) n+1, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+* for each record write the coordinate and the lower box bound
+	DO 2230 i = 1, n
+	   WRITE (risc_buff, '(2(1PG14.5))' ) TWORLD(i, grid, dim, box_middle),
+     .				   TWORLD(i, grid, dim, box_lo_lim)
+	   CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	   risc_buff = ' '
+ 2230	CONTINUE
+	WRITE (risc_buff, '(2(1PG14.5))' ) -999.D0, TWORLD(n, grid, 
+     .                             dim, box_hi_lim)
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+	GOTO 4999
+
+* SSPOINT grid orientation delta_index index
+* given an index or a world coordinate return an index value
+* that is offset by an index change delta_index
+* The "orientation" parameter should match the "coordinate" wrt index or ww
+ 2300	CONTINUE
+	IF ( num_args .NE. 5 ) GOTO 5230
+	grid = TM_GET_GRIDNUM( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( grid .EQ. unspecified_int4 ) GOTO 5930
+	DO 2310 dim = 1, nferdims ! match orientation against X,Y,Z,T,E,F
+	  istat = STR_CASE_BLIND_COMPARE( ww_dim_name(dim),
+     .				cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) THEN
+	     ww_given = .TRUE.
+	     GOTO 2320
+	  ENDIF
+ 2310	CONTINUE
+	DO 2315 dim = 1, nferdims ! match orientation against I,J,K,L,M,N
+	  istat = STR_CASE_BLIND_COMPARE( ss_dim_name(dim),
+     .				cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) THEN
+	     ww_given = .FALSE.
+             GOTO 2320
+          ENDIF
+ 2315	CONTINUE
+	GOTO 5230
+#ifdef MANDATORY_FORMAT_WIDTHS
+* no fixed field width works but "*" may cause problems too
+* such as "Y" being an unacceptable integer
+ 2320	READ (cmnd_buff(arg_start(4):arg_end(4)), *,ERR=5304) n ! delta
+#else
+ 2320	READ (cmnd_buff(arg_start(4):arg_end(4)), '(I)',ERR=5304) n ! delta
+#endif
+	IF ( ww_given ) THEN
+	   axis = grid_line(t_dim, grid)
+	   cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+ 	   CALL TRANSLATE_LIMIT( cmnd_buff(arg_start(5):arg_end(5)),
+     .		           dim, .FALSE., lo, formatted, cal_id, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5315
+	   i = ISUBSCR_CX( lo, grid, dim, cx_last, round_dn )
+	ELSE
+#ifdef MANDATORY_FORMAT_WIDTHS
+* no fixed field width works but "*" may cause problems too
+* such as "Y" being an unacceptable integer
+	   READ (cmnd_buff(arg_start(5):arg_end(5)), *,ERR=5305) i
+#else
+	   READ (cmnd_buff(arg_start(5):arg_end(5)), '(I)',ERR=5305) i
+#endif
+	ENDIF
+	i = MAX( i+n, 1 )
+	WRITE (risc_buff, fmt ) 1, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+	WRITE (risc_buff, '(I6)' ) i
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	GOTO 4999
+
+* WWPOINT grid orientation delta_index coordinate
+* given a index or a world coordinate return both a formatted string
+* for a world coordinate and a numerical value that are offset by an
+* index change delta_index
+* The "orientation" parameter should match the "coordinate" wrt index or ww
+ 2400	CONTINUE
+	IF ( num_args .NE. 5 ) GOTO 5240
+	grid = TM_GET_GRIDNUM( cmnd_buff(arg_start(2):arg_end(2)) )
+	IF ( grid .EQ. unspecified_int4 ) GOTO 5930
+	DO 2410 dim = 1, nferdims   ! match orientation against X,Y,Z,T
+	  istat = STR_CASE_BLIND_COMPARE( ww_dim_name(dim),
+     .				cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) THEN
+	      ww_given = .TRUE.
+	      GOTO 2420
+	  ENDIF
+ 2410	CONTINUE
+	DO 2415 dim = 1, nferdims     ! match orientation against I,J,K,L,M,N
+	  istat = STR_CASE_BLIND_COMPARE( ss_dim_name(dim),
+     .				cmnd_buff(arg_start(3):arg_end(3)) )
+	  IF ( istat .EQ. vms_str_success ) THEN
+	      ww_given = .FALSE.
+	      GOTO 2420
+	  ENDIF
+ 2415	CONTINUE
+	GOTO 5240
+#ifdef MANDATORY_FORMAT_WIDTHS
+* no fixed field width works but "*" may cause problems too
+* such as "Y" being an unacceptable integer
+ 2420	READ (cmnd_buff(arg_start(4):arg_end(4)), *,ERR=5304) n ! delta
+#else
+ 2420	READ (cmnd_buff(arg_start(4):arg_end(4)), '(I)',ERR=5304) n ! delta
+#endif
+	IF ( ww_given ) THEN
+	   axis = grid_line(t_dim, grid)
+	   cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+ 	   CALL TRANSLATE_LIMIT( cmnd_buff(arg_start(5):arg_end(5)),
+     .		           dim, .FALSE., lo, formatted, cal_id, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5315
+	   i = ISUBSCR_CX( lo, grid, dim, cx_last, round_dn )
+	ELSE
+#ifdef MANDATORY_FORMAT_WIDTHS
+* no fixed field width works but "*" may cause problems too
+* such as "Y" being an unacceptable integer
+	   READ (cmnd_buff(arg_start(5):arg_end(5)), *,ERR=5305) i
+#else
+	   READ (cmnd_buff(arg_start(5):arg_end(5)), '(I)',ERR=5305) i
+#endif	
+	ENDIF
+	i = MAX(i+n, 1)
+	lo = TM_WORLD( i, grid, dim, box_middle )
+	CALL TRANSLATE_TO_WORLD( lo,dim,grid,ax_dec_pt(dim),buff1 )
+	CALL CLEAN_COORD_STRING( dim, buff1(1:TM_LENSTR1(buff1)) )
+	WRITE (risc_buff, fmt ) 1, queries(query), tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	risc_buff = ' '
+	WRITE (risc_buff, '(A,1X,1PG14.5)' ) buff1( 1:TM_LENSTR1(buff1) ), lo
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+	GOTO 4999
+
+* ****  *************
+ 2500	CONTINUE
+	GOTO 5000
+* ****  *************
+ 2600	CONTINUE
+	GOTO 5000
+* ****  *************
+ 2700	CONTINUE
+	GOTO 5000
+* ****  *************
+ 2800	CONTINUE
+	GOTO 5000
+* ****  *************
+ 2900	CONTINUE
+	GOTO 5000
+* ****  *************
+ 3000	CONTINUE
+	GOTO 5000
+
+
+* successful completion
+ 4999	RETURN
+
+* error exits
+ 5000	WRITE (risc_buff, fmt ) 0, "*ERR", tag
+	CALL SPLIT_LIST(pttmode_explct, chout, risc_buff, 0)
+ 	RETURN
+ 5040	CALL ERRMSG( ferr_invalid_command, status,
+     .		     "QUERY VARIABLES needs data set as argument", *5000)
+ 5050	CALL ERRMSG( ferr_invalid_command, status,
+     .		     "this QUERY needs data set and variable as argument",
+     .		     *5000)
+ 5060	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'QUERY AXIS needs axis name as argument', *5000)
+ 5210	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'usage: QUERY GAXIS grid_name X_Y_Z_T_EorF', *5000)
+ 5220	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'usage: QUERY GCOORDS grid_name X_Y_Z_T_EorF', *5000)
+ 5230	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'usage: QUERY SSPOINT grid_name X_Y_Z_T_EorF delta index'
+     .	             , *5000)
+ 5240	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'usage: QUERY WWPOINT grid_name X_Y_Z_T_EorF delta coord'
+     .	             , *5000)
+ 5304	CALL ERRMSG( ferr_erreq, status,
+     .		     cmnd_buff(arg_start(4):arg_end(4)), *5000 )
+ 5305	CALL ERRMSG( ferr_erreq, status,
+     .		     cmnd_buff(arg_start(5):arg_end(5)), *5000 )
+ 5315	CALL ERRMSG( ferr_syntax, status,
+     .		     cmnd_buff(arg_start(5):arg_end(5)), *5000 )
+ 5910	CALL ERRMSG( ferr_unknown_data_set, status,
+     .		     cmnd_buff(arg_start(2):arg_end(2)), *5000)
+ 5920	CALL ERRMSG( ferr_unknown_variable, status,
+     .		     cmnd_buff(arg_start(3):arg_end(3)), *5000)
+ 5925	CALL ERRMSG( ferr_unknown_grid, status,
+     .		     cmnd_buff(arg_start(3):arg_end(3)), *5000)
+ 5930	CALL ERRMSG( ferr_unknown_arg, status,
+     .		     cmnd_buff(arg_start(2):arg_end(2)), *5000)
+	END
+
diff --git a/fer/gnl/dollar_arg.F b/fer/gnl/dollar_arg.F
new file mode 100644
index 0000000..9effc97
--- /dev/null
+++ b/fer/gnl/dollar_arg.F
@@ -0,0 +1,186 @@
+	SUBROUTINE DOLLAR_ARG( carg, goline, arg, lenarg, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* locate and return the indicated argument for this GO file
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V300: 4/21/93
+* V420:  avoid breaking apart "[]" as at the comma in "var[x=1,y=2]"
+* V510: 3/00 *sh* - allow backslash escapes to protect quotations
+* V531 *sh* 4/01 - allow 2-digit argument numbers and enclosing parens
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+* 11/04*acm* - fix bug 485: $0 should return the name of the script -
+*                           IF (karg.LE.0 .OR. karg.GE.100) should be IF(karg.LT.0 ...
+
+
+* calling argument declarations:
+	INTEGER	  lenarg, status
+	CHARACTER carg*2, goline*(*), arg*(*)
+
+* internal variable declarations:
+	LOGICAL quote, found_comma, bslash
+	INTEGER	TM_LENSTR1,lengo, iarg, goptr, start, end, karg,
+     .		open_paren, open_brkt
+	CHARACTER c1*1
+
+* internal parameter declarations
+	CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	status = ferr_ok
+	goptr = 0
+	lengo = TM_LENSTR1( goline )
+	found_comma = .FALSE.
+
+* which argument has been requested?
+	IF ( carg .EQ. ' *' ) THEN
+	   karg = 1               ! locate start of arg #1
+	ELSEIF ( carg .EQ. ' <' ) THEN
+	   GOTO 5100     ! implement later
+	ELSE
+	   READ ( carg, '(I2)', ERR=5100 ) karg
+	   IF (karg.LT.0 .OR. karg.GE.100) GOTO 5100  
+	ENDIF
+
+* locate the start and end of argument number karg
+	DO 500 iarg = 0, karg
+
+* skip blanks and up to one comma that precede the argument
+	   DO 100 start = goptr+1, lengo
+	      c1 = goline(start:start)
+	      IF ( c1 .EQ. ',' ) THEN
+	         IF ( found_comma ) THEN
+	            end = start-1
+	            goptr = start    ! (start-1 hangs on double comma)
+	            GOTO 500
+	         ENDIF
+	         found_comma = .TRUE.
+	      ELSEIF ( c1.NE.' ' .AND. c1.NE.tab ) THEN
+	         GOTO 110
+	      ENDIF
+ 100	   CONTINUE
+* no more arguments in go line
+	   lenarg = 0
+	   arg = ' '
+	   RETURN
+
+* locate the end of the argument
+* ignore commas inside of parentheses to protect "/LEV=(lo,hi,delta)"
+* 10/95 ignore commas inside of sqr brackets to protect "VAR[x=1,y=2]"
+ 110	   quote = .FALSE.
+	   bslash = .FALSE.
+	   open_paren = 0
+	   open_brkt  = 0
+	   DO 200 goptr = start, lengo
+	      c1 = goline(goptr:goptr)
+	      IF (bslash) THEN
+	         GOTO 190	! bypass looking at this character
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+              ELSEIF (c1 .EQ. '\' ) THEN
+#else
+              ELSEIF (c1 .EQ. '\\') THEN
+#endif
+	         bslash=.TRUE.  ! bypass looking at next character
+	         GOTO 200
+	      ELSEIF ( c1 .EQ. '"' ) THEN
+	         quote = .NOT.quote
+	      ELSEIF ( quote ) THEN
+	         CONTINUE           ! skip over quoted text
+	      ELSEIF ( c1 .EQ. '(' ) THEN
+	         open_paren = open_paren + 1
+	      ELSEIF ( c1 .EQ. ')' ) THEN
+	         IF (open_paren.GT.0) open_paren = open_paren - 1
+	      ELSEIF ( c1 .EQ. '[' ) THEN
+	         open_brkt  = open_brkt  + 1
+	      ELSEIF ( c1 .EQ. ']' ) THEN
+	          IF (open_paren.GT.0) open_brkt  = open_brkt  - 1
+	      ELSEIF ( c1 .EQ. ',' ) THEN
+	         IF ( open_paren.EQ.0 .AND. open_brkt.EQ.0 ) THEN
+	            found_comma = .TRUE.
+	            end = goptr - 1
+	            GOTO 500	     
+	         ENDIF
+	      ELSEIF (c1.EQ.' ' .OR. c1.EQ.tab ) THEN
+	         end = goptr - 1
+	         GOTO 500
+	      ENDIF
+ 190	      bslash = .FALSE.
+ 200	   CONTINUE
+	   end = lengo     ! end of buffer is end of arg
+
+ 500	CONTINUE
+
+* return the requested argument string
+	IF ( carg .EQ. ' *' .AND. end .NE. lengo ) THEN
+	   end = lengo
+	ELSEIF ( goline(start:start) .EQ. '"'
+     .     .AND. goline(end:end)     .EQ. '"' ) THEN
+* ... do not pass enclosing quotation marks
+	   start = start+1
+	   end = end - 1
+	ENDIF
+	IF ( start .GT. end ) THEN   ! beware empty quotes
+              arg = ' '
+              lenarg = 0
+	ELSE
+	   arg = goline(start:end)
+!	   lenarg = end - start + 1
+* ... remove one level of backslash escapes from the arg
+	   CALL DE_ESCAPE_STRING(arg, lenarg)
+	ENDIF
+
+* a set of empty quotes is regarded as a place-holder for the default
+	IF ( arg .EQ. ' ' ) lenarg = 0
+
+* done
+ 	RETURN
+
+* error exits
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .		     'illegal GO command argument: $'//carg, *5000 )
+	END
diff --git a/fer/gnl/dollar_command.F b/fer/gnl/dollar_command.F
new file mode 100644
index 0000000..c047413
--- /dev/null
+++ b/fer/gnl/dollar_command.F
@@ -0,0 +1,267 @@
+	SUBROUTINE DOLLAR_COMMAND( cmnd,lencmnd,goline,did_sub,status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* parse the command line replacing "dollar" arguments in GO files
+* with the appropriate strings
+
+* formats supported:
+*	$n 		- argument n (1 through max)
+*	$0		- name of Go file
+*	$*		- all arguments, 1 through max
+*       ($nn)	        - to allow 2-digit argument numbers
+* these may be followed by the coached string substitution options
+* described in coached_str_sub.F
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300: 4/21/93
+*       5/28/93 - ignore $'s that aren't followed by digits or special chars
+* V301: 2/15/94 - allow "*" as a choice that matches all args
+* V320 8/94 *kob* - IBM port - had to use risc buff for string concats
+*      11/94 *sh* - IBM port - one more application of risc buff at line 500
+*     3/2/95 *sh* - allow "*" to appear in the RIGHT hand side of the
+*		    substitution string
+*     3/24/95  - fix bug introduced 3/2 
+* V420	2/29/96	- detach the "coaching" code into a separate routine so it
+*		can be used in symbol substitution as well
+* V510: 3/00 *sh* bug fix - in the syntax "$1" the final " caused iptr mis-set
+* V531: 4/01 *sh* - allow 2-digit argument numbers
+*		  - increased argument buffers 255 -> 511
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use character constant instead
+*            - Need to use risc_buff for arbitrary concatenations
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	LOGICAL   did_sub
+	INTEGER	  lencmnd, status
+	CHARACTER cmnd*(*), goline*(*)
+
+* internal variable declarations:
+* d default string
+* e error string
+* o options string
+* r replacement strings
+
+	LOGICAL coaching, in_squote, has_parens
+	INTEGER	TM_LENSTR1,
+     .		lenbuff, iptr, dollar, lenarg, nexchar, idig
+        CHARACTER arg*511, passed_arg*511, c1*1, carg*2
+
+* local parameter declarations
+        CHARACTER*1     sing_quote
+        CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+        PARAMETER     ( sing_quote = o'047' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+        PARAMETER     ( sing_quote = CHAR(39) )
+#endif
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xrisc.cmn'
+
+* initialize
+	nexchar = 1
+	did_sub = .FALSE.
+	status = ferr_ok
+        lenbuff = LEN( cmnd )
+	in_squote = .FALSE.
+
+* init for next dollar arg
+ 10	coaching = .FALSE.
+	in_squote = .FALSE.
+
+* locate the next dollar sign  (ignore "$" as last character in command)
+	DO 50 dollar = nexchar, lencmnd-1
+	   c1 = cmnd(dollar:dollar)
+	   IF ( c1 .EQ. sing_quote ) THEN
+	      in_squote = .NOT.in_squote
+	   ELSEIF ( in_squote ) THEN
+	      CONTINUE                     ! to protect PLOT+ 'PPL$WIDTH', etc.
+	   ELSEIF ( c1 .EQ. '$' ) THEN     ! 5/93 ignore if wrong carg
+	      carg = cmnd(dollar+1:dollar+1)
+	      IF ( carg .EQ. '*'
+     .        .OR. carg .EQ. '<'
+     .	      .OR. (carg.GE.'0' .AND. carg.LE.'9') ) GOTO 60
+	   ENDIF
+ 50	CONTINUE
+
+* done - no more dollar signs (could check in_squote for syntax error ...)
+	RETURN
+
+* found a significant "$"
+ 60	CONTINUE
+
+* note: multiple digit argument number must be enclosed in parentheses.
+* this because $15 might legitimately be "$1" prepended to "5"
+
+* is this a paren-surrounded argument number?
+* Note: the parsing actually gets done twice ... this is an add-on hack!
+* check syntax: ($nn%stuff%)
+	has_parens = .FALSE.
+	IF (dollar .GT. 1) THEN
+	   IF (cmnd(dollar-1:dollar-1) .NE. '(') GOTO 65
+	   IF (carg.LT.'0' .OR. carg.GT.'9') GOTO 65
+	   iptr = dollar+2
+	   IF (iptr .GT. lencmnd) GOTO 65
+	   c1 = cmnd(iptr:iptr)
+	   IF (c1.GE.'0' .AND. c1.LE.'9') iptr = iptr + 1
+	   IF (iptr .GT. lencmnd) GOTO 65
+	   c1 = cmnd(iptr:iptr)
+           coaching = c1.GE.'!' .AND. c1.LE.'&'
+	   IF (coaching) THEN
+             DO 62 iptr = iptr+1, lencmnd
+                 IF ( cmnd(iptr:iptr) .EQ. c1 ) GOTO 64
+ 62	      CONTINUE
+              GOTO 65       ! unterminated option string - red herring?
+ 64	      iptr = iptr + 1
+	      IF (iptr .GT. lencmnd) GOTO 65
+	      c1 = cmnd(iptr:iptr)
+	   ENDIF
+	   IF (c1 .NE. ')') GOTO 65
+	   has_parens = .TRUE.
+	ENDIF
+ 65	CONTINUE
+
+* find a second digit, if any
+	nexchar = dollar + 2
+	IF (carg.GE.'0' .AND. carg.LE.'9'
+     .	.AND. lencmnd .GT. dollar+1 ) THEN
+	   DO 70 iptr = dollar+2, lencmnd
+	     IF (cmnd(iptr:iptr).LT.'0'.OR.cmnd(iptr:iptr).GT.'9') GOTO 72
+ 70	   CONTINUE
+ 72	   carg = ' '
+	   idig = iptr-dollar-1
+	   IF ( idig.GT.2 ) GOTO 5150
+	   carg(dollar-iptr+4:2) = cmnd(dollar+1:iptr-1) ! right justify
+	   nexchar = iptr  ! next character after digits (changes later)
+	ELSE
+	   idig = 1
+	   c1 = carg(1:1)
+	   carg = ' '
+	   carg(2:2) = c1  ! right justify
+	ENDIF
+
+	IF (has_parens) THEN
+	   dollar = dollar - 1 ! text to replace starts at "("
+	ENDIF
+
+* is there a coaching string following  "$x" ?  (e.g. $1"default string")
+        coaching = nexchar+1 .LE. lencmnd
+        IF ( coaching ) THEN
+           c1 = cmnd(nexchar:nexchar)
+           coaching = c1.GE.'!' .AND. c1.LE.'&'
+        ENDIF
+
+* locate the matching terminator of the coaching string
+        IF ( coaching ) THEN
+           DO 100 iptr = nexchar+1, lencmnd
+              IF ( cmnd(iptr:iptr) .EQ. c1 ) GOTO 200
+ 100       CONTINUE
+           coaching = .FALSE.       ! unterminated option string - red herring?
+        ENDIF
+
+* get the argument given on the command line
+ 200    CALL DOLLAR_ARG( carg, goline, arg, lenarg, status )
+        IF ( status .NE. ferr_ok ) RETURN
+	passed_arg = arg	! a copy used for fancy editing 3/2
+
+* modify the argument if coaching was provided
+	IF ( coaching ) THEN
+	   IF (nexchar+1 .GT. iptr-1) GOTO 5400
+	   CALL COACHED_STR_SUB('argument $'//carg(3-idig:), passed_arg,
+     .		cmnd(nexchar+1:iptr-1), arg, lenarg, status ) 
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   nexchar = iptr+1   ! after termination of coaching
+	ELSEIF ( arg .EQ. " " ) THEN
+	   GOTO 5500
+	ENDIF
+
+* move past closinging paren
+	IF (has_parens) THEN
+	   DO 210 iptr = nexchar, lencmnd
+	      IF ( cmnd(iptr:iptr) .EQ. ')' ) THEN
+	        nexchar = iptr + 1
+	        GOTO 300
+	      ELSEIF ( cmnd(iptr:iptr) .NE. ' '
+     .	       .AND.   cmnd(iptr:iptr) .NE. tab ) THEN
+	        GOTO 5300   ! should never arrive here
+	      ENDIF
+ 210	   CONTINUE
+	   GOTO 5300
+	ENDIF
+
+* replace "$n..." with argument text or coached alternative
+ 300	IF ( (dollar-1)+lenarg+(lencmnd-nexchar-1) .GT. lenbuff ) THEN
+           GOTO 5100
+        ELSE
+	   iptr = lencmnd ! temporary buffer
+	   risc_buff = cmnd(nexchar:)
+           cmnd(dollar:) = arg(1:lenarg) // risc_buff
+           lencmnd = (dollar-1) + lenarg + (lencmnd-nexchar+1)   ! new length
+	   nexchar = nexchar + (lencmnd-iptr) ! shift by increase of cmnd len
+        ENDIF
+
+* go back for the next argument
+        did_sub = .TRUE.
+        GOTO 10
+
+* error exits
+ 5000   RETURN
+ 5100   CALL ERRMSG( ferr_invalid_command, status,
+     .       'command argument strings are too long', *5000)
+ 5150	risc_buff = cmnd(dollar:iptr)
+	CALL ERRMSG( ferr_syntax, status,
+     .       'arg number not in 1-99 range: '//risc_buff, *5000 )
+ 5300   risc_buff = cmnd(dollar:iptr)
+	CALL ERRMSG( ferr_syntax, status,
+     .       'missing closing paren: '//risc_buff, *5000 )
+ 5400   risc_buff = cmnd(dollar:iptr)
+	CALL ERRMSG( ferr_syntax, status,
+     .       'empty argument replacement string: '//risc_buff,
+     .		 *5000 )
+ 5500   risc_buff = goline
+	CALL ERRMSG( ferr_invalid_command, status,
+     .       'Value needed for argument '//carg(3-idig:)//' in command'//
+     .        pCR//'GO '//risc_buff(:TM_LENSTR1(goline)), *5000)
+
+	END
+
+
diff --git a/fer/gnl/edit_attribute.F b/fer/gnl/edit_attribute.F
new file mode 100644
index 0000000..f96c0c4
--- /dev/null
+++ b/fer/gnl/edit_attribute.F
@@ -0,0 +1,560 @@
+
+
+      SUBROUTINE EDIT_ATTRIBUTE( grid_data, mr, varattname, dset, 
+     .         attype_spec, att_quiet, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*  Change an attribute for a variable: can change value(s), and/or type
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* 9/2005
+* 3/2006 Allow commands equivalent to SET AXIS/modulo/depth/units etc.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V64  10/09 *acm* longer string length for grid_name
+
+	include 'tmap_dims.parm'
+*TMAP_DSET.PARM
+*
+* parameters used in "TMAP-formatted" data sets
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 0.01 - 11/21/88 - Changed variable initialization to char_initXX
+* revision 0.02 - 3/99 - *kob* added char_init64
+* revision 0.03 - 4/99 - *kob* added char_init256
+* V500 - 7/99 *sh* ==> changed char_init to "%%" so that all of the
+*			char_init*N are effectively the same definition
+* V581 - 3/05 *acm* add char_init_1024
+* V68    1/12 *acm* Real variables should be declared REAL (conversion to double prec.)
+*        3/12 *acm* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680   5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+* v686 *acm*  1/14 Fix ticket 2127: dont check file type if the variable not a file variable.
+* v687 *acm*  3/14 Fix ticket 2161: editing long_name or units of var in ascii files
+
+* codes for data sets
+	INTEGER		set_not_open,set_open,file_not_open
+	PARAMETER      (set_not_open = -9)	! shows available set storage
+	PARAMETER      (set_open = -19)		! shows available set storage
+	PARAMETER      (file_not_open = -7)	! shows data file not open
+
+* codes for end of namelist blocks
+	CHARACTER*4	end_of_aux
+	CHARACTER*8	end_of_variables
+	CHARACTER*40	end_of_stepfiles, end_of_varfiles
+	CHARACTER*60	end_of_grids
+	PARAMETER	(end_of_variables = '**END OF VARS**')
+	PARAMETER	(end_of_aux = '**END OF AUX**')
+	PARAMETER	(end_of_stepfiles = '**END OF STEPFILES**')
+	PARAMETER	(end_of_varfiles = '**END OF VARFILES**')
+	PARAMETER	(end_of_grids = '**END OF GRIDS**')
+
+* codes for common block initialization
+	CHARACTER*80	char_init
+	CHARACTER*20	sevens
+	CHARACTER	char_init01*01, char_init02*02, char_init04*04,
+     .			char_init08*08,	char_init12*12, char_init16*16,
+     .			char_init20*20,	char_init23*23, char_init24*24,
+     .			char_init30*30, char_init40*40, char_init60*60,
+     .			char_init64*64, char_init80*80, char_init128*128,
+     .                  char_init256*256, char_init512*512, 
+     .                  char_init1024*1024
+	INTEGER*2	int2_init
+	INTEGER*4	int4_init
+	REAL		real4_init
+	REAL*8		real8_init
+	PARAMETER	(sevens = '77777777777777777777')
+! changed this definition because use of char_init and char_initN was
+! inconsistent in the code. This way makes all the definitions the same
+! (except char_init01)
+!	PARAMETER	(char_init = sevens//sevens//sevens//sevens)
+	PARAMETER	(char_init = '%%')
+	PARAMETER	(char_init01 = char_init)
+	PARAMETER	(char_init02 = char_init)
+	PARAMETER	(char_init04 = char_init)
+	PARAMETER	(char_init08 = char_init)
+	PARAMETER	(char_init12 = char_init)
+	PARAMETER	(char_init16 = char_init)
+	PARAMETER	(char_init20 = char_init)
+	PARAMETER	(char_init23 = char_init)
+	PARAMETER	(char_init24 = char_init)
+	PARAMETER	(char_init30 = char_init)
+	PARAMETER	(char_init40 = char_init)
+	PARAMETER	(char_init60 = char_init)
+	PARAMETER	(char_init64 = char_init)
+	PARAMETER	(char_init80 = char_init)
+	PARAMETER	(char_init128= char_init)
+	PARAMETER	(char_init256= char_init)
+	PARAMETER	(char_init512= char_init)
+	PARAMETER	(char_init1024= char_init)
+	PARAMETER	(int2_init = -7777)
+	PARAMETER	(int4_init = -7777)
+	PARAMETER	(real4_init = -7.77E-07)
+	PARAMETER	(real8_init = -7.77E-07)
+	
+* record length parameters
+	INTEGER		default_reclen,max_reclen,max_tapereclen
+	PARAMETER      (default_reclen = 162,	! for GFDL Phil/Seig output
+     .			max_reclen = 4095,	! VMS restriction
+     .			max_tapereclen = 2499)	! VMS restriction
+
+* bad/missing data indicators
+	REAL		bad_r4
+	REAL*8		bad_r8
+	PARAMETER	(bad_r4 = -1.E34 , bad_r8 = -1.E34)
+
+* zero representations
+	INTEGER*1		i1zero
+	INTEGER		i4zero
+	PARAMETER	(i1zero = 0, i4zero = 0)
+
+* file format codes
+	INTEGER		GFDL_3D,pacific_grids,model_output
+	CHARACTER*2	grids_at_times,time_series
+	CHARACTER*4	pds_type_gt,pds_type_ts,pds_type_ez
+	INTEGER*1		regular,irregular
+	PARAMETER	(grids_at_times = 'GT',
+     .			 time_series = 'TS',
+     .			 model_output = 1,
+     .			 GFDL_3D = 1,
+     .			 pacific_grids = 1,
+     .			 regular = 1,
+     .			 irregular = 2,
+     .			 pds_type_gt = '  GT',
+     .			 pds_type_ts = '  TS',
+     .			 pds_type_ez = '  EZ' )
+
+* codes for heading records
+	INTEGER		plogo,ptitl,pform,pback,pmess,psumm,pvari,
+     .			pgrid,pcomm,pindx,pxtra,nbefore_vari
+	PARAMETER      (plogo = 1,
+     .			ptitl = 2,
+     .			pform = 3,
+     .			pback = 4,
+     .			pmess = 5,
+     .			psumm = 6,
+     .			pvari = 7,
+     .			pcomm = 8,
+     .			pgrid = 9,
+     .			pindx = 10,
+     .			pxtra = 11)
+	PARAMETER	(nbefore_vari = 6)	! records preceeding VARI recs
+
+* codes for variables
+	INTEGER		ptemp,psalt,pu,pv,pw,ptaux,ptauy,ppsi,pairt,
+     .			ptstar_s, ptstar_n, psstar_s, psstar_n
+	PARAMETER      (ptemp = 1,
+     .			psalt = 2,
+     .			pu    = 3,
+     .			pv    = 4,
+     .			pw    = 5,
+     .			ptaux = 6,
+     .			ptauy = 7,
+     .			ppsi  = 8,
+     .			pairt = 9,
+     .			ptstar_s = 10,
+     .			ptstar_n = 11,
+     .			psstar_s = 12,
+     .			psstar_n = 13 )
+
+* codes for standard grids and "No defining grid error"
+	INTEGER		pps1dxt,pps1dyt,pps1dzb,pps3dtemp,pps3duv,
+     .			pps3dw,	pps1dxv,pps1dyv,pps1dz, pps2dtemp,
+     .			pps2duv
+	INTEGER		no_grid_err
+	PARAMETER      (pps1dxt   = 1,
+     .			pps1dyt   = 2,
+     .			pps1dzb   = 3,
+     .			pps1dxv   = 4,
+     .			pps1dyv   = 5,
+     .			pps1dz    = 6,
+     .			pps3dtemp = 7,
+     .			pps3duv   = 8,
+     .			pps3dw    = 9,
+     .			pps2dtemp = 10,
+     .			pps2duv   = 11)
+	PARAMETER      (no_grid_err = -1)
+
+* codes used at time steps
+	CHARACTER*4	step_code
+	INTEGER		nintro_recs
+	PARAMETER	(nintro_recs = 1 , step_code = 'STEP')
+
+* codes used for time<->date conversion
+	INTEGER		to_year, to_month, to_day, to_hour, to_minute,
+     .			to_second, full_prec
+	PARAMETER	(to_year	= 6,
+     .			 to_month	= 5,
+     .			 to_day		= 4,
+     .			 to_hour	= 3,
+     .			 to_minute	= 2,
+     .			 to_second	= 1,
+     .			 full_prec	= 2)
+
+* codes for auxiliary data sets
+	INTEGER		main_set
+	PARAMETER	(main_set	= 0)
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+        include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+	include 'xpyvar_info.cmn'
+      INCLUDE 'netcdf.inc'
+
+* local parameter declarations:
+      INTEGER  max_line_len
+      PARAMETER ( max_line_len = 2048 )
+
+
+* calling argument declarations:
+
+      LOGICAL att_quiet
+      INTEGER mr, attype_spec, dset, status
+      REAL grid_data(mr_lo_ss(mr,1):mr_hi_ss(mr,1),
+     .               mr_lo_ss(mr,2):mr_hi_ss(mr,2),
+     .               mr_lo_ss(mr,3):mr_hi_ss(mr,3),
+     .               mr_lo_ss(mr,4):mr_hi_ss(mr,4),
+     .               mr_lo_ss(mr,5):mr_hi_ss(mr,5),
+     .               mr_lo_ss(mr,6):mr_hi_ss(mr,6))
+      CHARACTER*(*) varattname
+
+* local variable declarations: 
+      
+      LOGICAL TM_HAS_STRING, 
+     .        valid, do_err, coordvar, have_mods, ez, ncfile
+      INTEGER MR_DIM_LEN, TM_LENSTR1, STR_SAME, varid, idim, ndims,
+     .        attlen, attype, span, lo(nferdims), hi(nferdims), del(nferdims), slen, vlen, 
+     .        attlen_old, attype_old, attoutflag, vartype, nvdims,
+     .        nvatts, vdims(8), all_outflag, cat, var, tmap_status,
+     .        grid, mod_cx, attid
+      REAL dummy, bad, scalefac, offset
+      CHARACTER GET_STRING_ELEMENT*2048, TM_FMT*2048, attbuff*2048, 
+     .          errbuff*256, varname*512, attname*128, aname*128
+
+      CHARACTER	grid_name*64, title*128, units*64, newname*128
+
+! Check that the expresssion is 1-D and if it is a string, just 1 value.
+
+      ndims = 0
+      attlen = 0
+      DO 30 idim = 1, nferdims
+         span = MR_DIM_LEN(idim, mr )
+         valid = mr_lo_ss( mr,idim ) .NE. unspecified_int4
+         IF (span .GT. 0 .AND. valid ) ndims = ndims + 1
+         attlen = MAX(attlen, span)
+ 30   CONTINUE
+
+* * * * * DETERMINE INDEX LIMITS * * *
+      DO 40 idim = 1, nferdims
+         lo(idim) = mr_lo_ss( mr, idim )
+         hi(idim) = mr_hi_ss( mr, idim )
+         del(idim)= 1
+ 40   CONTINUE
+
+      IF (ndims .LT. 0 .OR. ndims .GT. 1) GOTO 5100
+
+* Reconcile data types for the attribute. If requested a float attribute
+* but the expression is a string, it is an error.  If a string was requested,
+* we can convert a numeric value to string below.
+
+      IF (attype_spec .EQ. ptype_float  .AND. 
+     .    mr_type(mr) .NE. ptype_float) GOTO 5300
+
+      attype = NCFLOAT
+      IF (mr_type(mr) .EQ. ptype_string .OR.
+     .    attype_spec .EQ. ptype_string ) attype = NCCHAR
+
+* See if the attribute already exists for the variable.
+
+      do_err = .TRUE.
+      CALL BREAK_VARATTNAME ( varattname, dset, varname, 
+     .              attname, varid, do_err, status )
+      IF (status .NE. ferr_ok) GOTO 5400
+
+      CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, nvdims, 
+     .            vdims, nvatts, coordvar, all_outflag, status)
+
+      IF (coordvar) THEN
+
+* Do not allow user to change the direction of an axis.
+
+        IF (STR_SAME(attname, 'AXIS')           .EQ. 0  .OR.
+     .      STR_SAME(attname, 'CARTESIAN_AXIS') .EQ. 0) THEN
+     
+            vlen = TM_LENSTR1(varname)
+            slen = TM_LENSTR1(attname)
+            GOTO 5600
+        ENDIF
+
+      ENDIF
+
+!  If attribute already exists, change it.
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             aname, attype_old, attlen_old, attoutflag, status )
+
+      errbuff = varattname
+      IF (attype .EQ. NCCHAR ) THEN
+
+         IF (mr_type(mr) .NE. ptype_string) THEN
+            attbuff = TM_FMT(
+     .                grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6)),
+     .                8, 40, slen)
+            IF (attlen .GT. 1) THEN 
+               CALL WARN ('Requested string attribute using a '//
+     .                    'numeric expression. Using first value and '//
+     .                    'converting to string')
+               attlen = 1
+            ENDIF
+
+         ELSE
+            IF (attlen .GT. 1) GOTO 5200
+            attbuff = GET_STRING_ELEMENT(
+     .              lo(1), hi(1), lo(2), hi(2),
+     .	            lo(3), hi(3), lo(4), hi(4), 
+     .	            lo(5), hi(5), lo(6), hi(6), 
+     .              grid_data, lo(1), lo(2), lo(3),
+     .              lo(4), lo(5), lo(6), 
+     .              max_line_len, slen)
+
+            dummy = 1.
+            attlen = TM_LENSTR1(attbuff)    
+         ENDIF
+
+         vlen = TM_LENSTR1(errbuff)
+         IF (attype .NE. attype_old .AND. (.NOT.att_quiet)) 
+     .         CALL WARN ('Changing the type of attribute '//
+     .         errbuff(:vlen))
+         IF (.NOT.att_quiet) CALL WARN ('Changing the value of attribute '//
+     .         errbuff(:vlen))
+
+         CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .         attbuff, dummy, status)
+
+      ELSE 
+         attype = NCFLOAT
+         vlen = TM_LENSTR1(errbuff)
+         IF (attype .NE. attype_old .AND. (.NOT.att_quiet)) 
+     .         CALL WARN ('Changing the type of attribute '//
+     .         errbuff(:vlen))
+         IF (.NOT.att_quiet) CALL WARN ('Changing the value of attribute '//
+     .         errbuff(:vlen))
+
+         IF (attlen .NE. attlen_old .AND. attype .EQ. attype_old .AND. (.NOT.att_quiet)) 
+     .         CALL WARN ('Changing the length  of attribute '//
+     .         errbuff(:vlen))
+
+         CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .         attbuff, grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6)), 
+     .	       status)  
+
+      ENDIF
+
+* For coordinate variables, change attributes as in SET AXIS command.
+
+      IF (coordvar) THEN
+         IF (STR_SAME(attname, 'modulo')      .EQ. 0  .OR.
+     .       STR_SAME(attname, 'depth')       .EQ. 0  .OR.
+     .       STR_SAME(attname, 'positive')    .EQ. 0  .OR.
+     .       STR_SAME(attname, 'calendar')    .EQ. 0  .OR.
+     .       STR_SAME(attname, 'time_origin') .EQ. 0  .OR.
+     .       STR_SAME(attname, 'units')       .EQ. 0) THEN
+
+! input varname may differ from name in linked-list structure by a digit (see isit_coord_var)
+           CALL GET_INPUT_VARNAME (varattname, varname)  
+           CALL RESET_AXIS (dset, varid, varname, attname, attbuff,
+     .         grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6)), status)  
+        ENDIF
+      ENDIF
+
+* Replace information in Ferret variables as in SET VAR
+
+	grid = int4_init
+	bad = real4_init
+	scalefac = real4_init
+	offset = real4_init
+        have_mods = .FALSE.
+        ncfile = .FALSE.
+        ez = .FALSE.
+	newname = char_init128
+	title = char_init128
+	units = char_init64
+	grid_name = char_init16
+
+     	IF ( STR_SAME(attname, 'scale_factor') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           scalefac = grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6))
+        ENDIF
+
+     	IF ( STR_SAME(attname, 'add_offset') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           offset = grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6))
+        ENDIF
+
+     	IF ( STR_SAME(attname, 'long_name') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           title = attbuff
+        ENDIF
+
+     	IF ( STR_SAME(attname, 'units') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           units = attbuff
+        ENDIF
+
+     	IF ( STR_SAME(attname, 'missing_value') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           bad = grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6))
+        ENDIF
+     
+     	IF ( STR_SAME(attname, '_FillValue') .EQ. 0 ) THEN
+           have_mods = .TRUE.
+           bad = grid_data(lo(1),lo(2),lo(3),lo(4),lo(5),lo(6))
+        ENDIF
+
+* Get var and cat
+	CALL PARSE_NAM_DSET( varname, cx_last, dset,
+     .			     cat, var, mod_cx, status )
+
+        IF (var .EQ. munknown_var_name)  GOTO 5000
+
+	IF ( cat .EQ. cat_file_var ) ez = ds_type(dset) .EQ. pds_type_ez
+
+	IF (dset .GT. 0) ncfile = (TM_HAS_STRING(ds_type(dset), 'CDF') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'MC') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'ENS') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'GT')  )
+
+* note on EZ vars:
+* modifying the variable info invalidates data in memory
+*        the purging of memory variables below is unnecessarily strict in both
+*	 the uvar and fvar cases.  FVAR's can be modified in memory to change
+*	 mr_grid, units, etc.  They need to be deleted only if they were on 
+* 	 non-standard grids or units.  The UVAR's need to be purged only if
+*	 they depend on the FVAR being changed)
+	IF ( ez ) THEN
+	   IF ( have_mods ) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+	      CALL EZ_MOD_VARS( dset,var,varid,
+     .			        newname,title,units,grid,bad,tmap_status )
+	      IF ( tmap_status .NE. merr_ok ) THEN
+	         status = ferr_TMAP_error
+	         RETURN
+	      ENDIF
+	   ENDIF
+	ELSEIF ( cat .EQ. cat_file_var ) THEN
+* ... other file variables (10/95)
+
+	   IF ( bad  .NE. real4_init  ) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+	      ds_missing_flag(var) = ds_bad_flag(var)
+	      ds_bad_flag    (var) = bad
+	   ENDIF
+
+	   IF ( units .NE. char_init16 ) ds_var_units( var ) = units
+	   IF ( title .NE. char_init80 ) ds_var_title( var ) = title
+
+           IF ((scalefac .NE. real4_init) .AND. ncfile) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+              ds_var_scale(var) = scalefac
+              ds_var_scaleit(var)       = .TRUE.
+           ENDIF
+           IF ((offset .NE. real4_init) .AND. ncfile) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+              ds_var_off(var)   = offset
+              ds_var_scaleit(var)       = .TRUE.
+           ENDIF
+
+        ELSEIF ( cat .EQ. cat_pystat_var ) THEN
+
+           IF ( units .NE. char_init16 ) pyvar_units( var )  = units
+           IF ( title .NE. char_init80 ) pyvar_title( var )  = title
+           IF ( bad  .NE. real4_init  ) THEN
+              CALL PURGE_ALL_UVARS       ! delete (possibly dependent) uvars
+              pyvar_missing_flag(var) = bad
+           ENDIF
+
+	ELSE
+* ... user-defined var
+
+	   IF ( units .NE. char_init16 ) uvar_units( var )  = units
+	   IF ( title .NE. char_init80 ) uvar_title( var )  = title
+	   IF ( bad  .NE. real4_init  ) THEN
+	      CALL PURGE_ALL_UVARS	 ! delete invalidated uvars
+	      uvar_bad_data(var) = bad
+	   ENDIF
+
+	ENDIF
+
+* successful completion
+	status = ferr_ok
+
+
+
+
+ 5000 RETURN
+ 5100 CALL ERRMSG( ferr_invalid_command, status,
+     . 'attribute values must be 1 dimensional: '//
+     . errbuff(:vlen),*5000 )
+
+ 5200 CALL ERRMSG( ferr_invalid_command, status,
+     .  'String attribute may contain just one string: '//
+     .  errbuff(:vlen),*5000 )
+
+ 5300 CALL ERRMSG( ferr_invalid_command, status,
+     .  'Attribute type does not match expression: '//
+     .  errbuff(:vlen),*5000 )
+
+ 5400 errbuff = varattname
+      CALL ERRMSG( ferr_invalid_command, status,
+     .  'Attribute does not exist: '//errbuff(:vlen),*5000)
+
+ 5500 CALL ERRMSG( ferr_invalid_command, status,
+     .  'To change "'// attname(:slen)//
+     .  '" for coordinate variable, use SET AXIS instead',*5000)
+
+ 5600 CALL ERRMSG( ferr_invalid_command, status,
+     .  'Cannot change attribute for direction of axis.',*5000)
+
+      END
diff --git a/fer/gnl/equal_format.F b/fer/gnl/equal_format.F
new file mode 100644
index 0000000..b732a0d
--- /dev/null
+++ b/fer/gnl/equal_format.F
@@ -0,0 +1,125 @@
+	SUBROUTINE EQUAL_FORMAT( string, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "FORMAT=xxxx" determine the listing format and
+* save the information in COMMON
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:   9/1/89
+*	 10/1/90 - "BIBO" --> "EPIC"
+* V230:  6/92 - use common variable list_fmt_type
+*       10/92 - improve test for I format by checking for digit following "i"
+*       11/92 - get lower case format
+* V301:  1/94 - extracted code into CHECK_FORMAT
+* V320: 12/94 - added /FORMAT=STREAM
+* V420:  9/95 - added /FORMAT=COMMA-DELIMITED and /FORMAT=TAB-DELIMITED
+* V450: 11/96 - added /FORMAT=CACHE for DODS caching
+* V554   9/03 *acm* - add output in /DODS binary format
+* V602 *jli* 8/06 - add plist_xml
+* V602 *acm* 1/07 - use risc_buff rather than local variable buff, for solution to bug 1482
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*                  Do not use GT format
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	INTEGER	STR_UPCASE, vax_code
+	CHARACTER upcase3*3
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+        include 'xrisc.cmn'
+
+* SET LIST/FORMAT=(FORTRAN_FORMAT),'UNFORMATTED','EPIC','TMAP','GT','STREAM', 'DODS'
+
+* remove old specs
+	list_format_given = .FALSE.
+
+        CALL EQUAL_STR_LC( string, risc_buff, status )   ! lower case 11/92
+        IF ( status .NE. ferr_ok ) RETURN
+	IF ( risc_buff .NE. ' ' ) list_format = risc_buff
+
+* special interpretations
+        vax_code = STR_UPCASE( upcase3, list_format(1:3) )
+        IF (     upcase3 .EQ. 'UNF' ) THEN
+           list_fmt_type = plist_unformatted
+        ELSEIF ( upcase3 .EQ. 'EPI' ) THEN
+           list_fmt_type = plist_epic
+        ELSEIF ( upcase3 .EQ. 'TMA' ) THEN
+           GOTO 5010
+        ELSEIF ( upcase3 .EQ. 'GT' ) THEN
+           GOTO 5010
+        ELSEIF ( upcase3 .EQ. 'CDF' ) THEN
+           list_fmt_type = plist_cdf
+        ELSEIF ( upcase3 .EQ. 'STR' ) THEN
+           list_fmt_type = plist_stream
+        ELSEIF ( upcase3 .EQ. 'COM' ) THEN
+           list_fmt_type = plist_comma_del
+        ELSEIF ( upcase3 .EQ. 'TAB' ) THEN
+           list_fmt_type = plist_tab_del
+        ELSEIF ( upcase3 .EQ. 'CAC' ) THEN
+           list_fmt_type = plist_cdf_cache
+        ELSEIF ( upcase3 .EQ. 'DOD' ) THEN
+           list_fmt_type = plist_dods
+        ELSEIF ( upcase3 .EQ. 'XML' ) THEN
+           list_fmt_type = plist_xml
+        ELSE
+
+* ... check out user-specified format
+	   CALL CHECK_FORMAT( list_format, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   list_format_given = .TRUE.
+           list_fmt_type = plist_formatted
+	ENDIF
+
+* success
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+ 5010   CALL ERRMSG( ferr_invalid_subcmnd, status,
+     .          'File type no longer supported '//upcase3, *5000 )
+
+	END
diff --git a/fer/gnl/equal_permute.F b/fer/gnl/equal_permute.F
new file mode 100644
index 0000000..6137338
--- /dev/null
+++ b/fer/gnl/equal_permute.F
@@ -0,0 +1,154 @@
+
+
+	SUBROUTINE EQUAL_PERMUTE(string,fill,v_ok,neg_ok,perm,status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "perm=XYZTEF", return array perm with the ordering
+* expressed as integers
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   9/1/89
+* V230: 4/92 (SUN port) - bug fix on loop: "fill in any missing dimensions"
+*
+* 7/15/98 *js* Added support for "XYZTV" permutations. 
+*    5/99 *sh* Added booleans "fill" argument to control if permutation array
+*	       is filled, var_ok arg to determine if "V" is allowable, and
+*	       neg_ok for acceptable minus signs
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+      IMPLICIT NONE
+
+* includes
+      include 'tmap_dims.parm'
+
+* calling argument declarations
+	LOGICAL		fill, v_ok, neg_ok
+	INTEGER		perm(*), status
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	INTEGER	TM_LENSTR1, STR_UPCASE, equal_pos, slen, pos, vax_code,
+     .		idim, ndim, i, j, rev, pmax
+	CHARACTER*1	ax
+
+* internal parameter declarations:
+	CHARACTER*1	tab
+
+
+
+	PARAMETER     ( tab = CHAR(9))
+
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xtext_info.cmn'
+
+* initialize
+	slen	  = TM_LENSTR1( string )
+	equal_pos = INDEX( string, '=' )
+	IF ( equal_pos .EQ. 0 .OR. equal_pos .EQ. slen ) GOTO 5100
+	IF (v_ok) THEN
+	   pmax = nferdims+1
+	ELSE
+	   pmax = nferdims
+	ENDIF
+
+* skip blanks and tabs
+	DO  pos = equal_pos+1, slen
+	   IF ( string(pos:pos) .NE. ' '
+     .	  .AND. string(pos:pos) .NE. tab ) GOTO 100
+	END DO
+	GOTO 5100
+
+* remove quotation marks
+ 100       IF ( string(pos:pos)   .EQ. '"' ) pos  = pos + 1
+           IF ( string(slen:slen) .EQ. '"' ) slen = slen - 1
+
+* decode permutation string
+	ndim = 0
+	rev = 1	 ! reversed axis ?
+	DO 250 pos = pos, slen
+	   vax_code = STR_UPCASE( ax, string(pos:pos) )
+	   IF ( v_ok .AND. ax .EQ. 'V') THEN   ! Variable name permutation
+	      ndim = ndim + 1
+	      perm(ndim) = nferdims+1
+	   ELSEIF ( neg_ok .AND. ax .EQ. '-' ) THEN
+	      rev = -1
+	   ELSE
+	      DO 220 idim = 1, nferdims
+	         IF ( ax .EQ. ss_dim_name(idim)
+     .	         .OR. ax .EQ. ww_dim_name(idim) ) THEN
+	            IF (ndim .EQ. pmax) GOTO 5100
+*   ... check for duplicates
+	            DO 210 i = 1, ndim
+ 210		    IF ( idim .EQ. ABS(perm(i)) ) GOTO 5100
+*  ... save the axis
+	            ndim = ndim + 1
+	            perm(ndim) = idim * rev
+	            rev = 1
+	            GOTO 250
+	         ENDIF
+ 220	      CONTINUE
+	      GOTO 5100
+	   ENDIF
+ 250	CONTINUE
+
+* fill in any missing dimensions (e.g. "perm=YX" is interpreted as YXZT)
+	IF (fill) THEN
+	  DO 350 j = ndim+1, nferdims+1
+	     DO 320 idim = 1, nferdims+1
+	        DO 310 i = 1, j-1   ! slots already set (4/92 bug fix)
+ 310	        IF ( idim .EQ. ABS(perm(i)) ) GOTO 320
+	        perm(j) = idim
+	        GOTO 350
+ 320	     CONTINUE
+ 350	  CONTINUE
+	ENDIF
+
+* success
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, string, *5000 )
+	END
diff --git a/fer/gnl/equal_str_lc.F b/fer/gnl/equal_str_lc.F
new file mode 100644
index 0000000..76240b7
--- /dev/null
+++ b/fer/gnl/equal_str_lc.F
@@ -0,0 +1,94 @@
+	SUBROUTINE EQUAL_STR_LC( string, val, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the "value" string
+* if the string is simply "name" then return ' ' (blank)
+* this version preserves the upper/lower case of the string
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: revision 0.0 - 3/12/91 - for Unix/RISC port - based on EQUAL_SRING
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER*(*)	string, val
+
+* internal variable declarations
+	INTEGER	TM_LENSTR1, equal_pos, slen, strt
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	slen	  = TM_LENSTR1( string )
+	equal_pos = INDEX( string, '=' )
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   val = ' '				! "name", alone
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+
+	ELSE
+
+* find first non-blank
+	   DO 100 strt = equal_pos+1, slen
+ 100	   IF ( string(strt:strt) .NE. ' ' ) GOTO 110
+	   STOP '=_str'		! cannot occur
+
+* remove quotation marks
+ 110	   IF ( string(strt:strt) .EQ. '"' ) strt = strt + 1
+	   IF ( string(slen:slen) .EQ. '"' ) slen = slen - 1
+
+	   IF ( strt .GT. slen ) THEN
+	      val = ' '
+	   ELSE
+              val = string(strt:slen)
+	   ENDIF
+
+	ENDIF
+
+* success
+	status = ferr_ok
+ 1000	RETURN
+
+* syntax error
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *1000 )
+	END
diff --git a/fer/gnl/equal_string.F b/fer/gnl/equal_string.F
new file mode 100644
index 0000000..8518f1b
--- /dev/null
+++ b/fer/gnl/equal_string.F
@@ -0,0 +1,96 @@
+	SUBROUTINE EQUAL_STRING( string, val, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the "value" string
+* if the string is simply "name" then return ' ' (blank)
+* change the string to upper case
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/27/88 - based on EQUAL_VAL
+* V200:   7/7/89 -  remove leading blanks, process quotation marks
+*	  9/22/89 - fixed bug for NAME="" (close quotes)
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER*(*)	string, val
+
+* internal variable declarations
+	INTEGER	TM_LENSTR1, STR_UPCASE, equal_pos, slen, strt, vax_code
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	slen	  = TM_LENSTR1( string )
+	equal_pos = INDEX( string, '=' )
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   val = ' '				! "name", alone
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+
+	ELSE
+
+* find first non-blank
+	   DO 100 strt = equal_pos+1, slen
+ 100	   IF ( string(strt:strt) .NE. ' ' ) GOTO 110
+	   STOP '=_str'		! cannot occur
+
+* remove quotation marks
+ 110	   IF ( string(strt:strt) .EQ. '"' ) strt = strt + 1
+	   IF ( string(slen:slen) .EQ. '"' ) slen = slen - 1
+
+	   IF ( strt .GT. slen ) THEN
+	      val = ' '
+	   ELSE
+	     vax_code = STR_UPCASE( val, string(strt:slen) )
+	   ENDIF
+
+	ENDIF
+
+* success
+	status = ferr_ok
+ 1000	RETURN
+
+* syntax error
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *1000 )
+	END
diff --git a/fer/gnl/equal_type.F b/fer/gnl/equal_type.F
new file mode 100644
index 0000000..82e9ab2
--- /dev/null
+++ b/fer/gnl/equal_type.F
@@ -0,0 +1,137 @@
+	SUBROUTINE EQUAL_TYPE( string, max_fields, nfields,
+     .			       field_type, wk_start, wk_end, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "TYPE=type1, type2, ..." determine the
+* number of fields and their data types
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530: 10/00 - for delimited reads
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		status
+	INTEGER		max_fields, nfields
+	INTEGER		field_type(max_fields),
+     .			wk_start(max_fields), wk_end(max_fields)
+	CHARACTER*(*)	string
+
+* internal parameter declarations
+	INTEGER	maxtypes
+	PARAMETER (maxtypes = 8)
+
+* internal variable declarations
+	LOGICAL	MATCH4
+	INTEGER	TM_LENSTR1, TM_LENSTR, iif, iit, equal_pos, slen,
+     .          len_test, len_mchars
+	CHARACTER*9 ftypes(maxtypes)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+
+* order of entries must match delimitedRead.h
+	DATA ftypes(1)/'-'/,
+     .	     ftypes(2)/'NUMERIC'/,
+     .       ftypes(3)/'CHARACTER'/,
+     .       ftypes(4)/'LATITUDE'/,
+     .       ftypes(5)/'LONGITUDE'/,
+     .       ftypes(6)/'DATE'/,
+     .       ftypes(7)/'EURODATE'/,
+     .       ftypes(8)/'TIME'/
+
+
+* initialize
+	slen      = TM_LENSTR1( string )
+	equal_pos = INDEX( string, '=' )
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   nfields = 1
+	   field_type(1) = 2  ! numeric as default for content-free /TYPE
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN
+	  GOTO 5000                            ! "name ="
+
+	ELSE
+
+* parse the comma separated list into fields
+	  CALL PARSE_COMMA_LIST ( string,
+     .                            equal_pos+1,
+     .                            slen,
+     .                            max_fields,
+     .                            nfields,
+     .                            wk_start,
+     .                            wk_end,
+     .                            status          )
+	  IF ( status .NE. ferr_ok ) GOTO 5000
+
+* identify each field
+	  DO 200 iif = 1, nfields
+            len_test = TM_LENSTR(string(wk_start(iif):wk_end(iif)))
+	    DO 100 iit = 1, maxtypes
+              len_mchars = TM_LENSTR(ftypes(iit)(:4))
+	      IF (MATCH4(string(wk_start(iif):wk_end(iif)),len_test,
+     .			 ftypes(iit),len_mchars)) THEN
+	        field_type(iif) = iit 
+	        GOTO 200
+	      ENDIF
+ 100	    CONTINUE
+	    GOTO 5100
+ 200	  CONTINUE
+	ENDIF
+
+* success
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+
+ 5100	CALL ERRMSG(ferr_invalid_command, status, 'unknown data type',
+     .		    string(wk_start(iif):wk_end(iif)), *5110)
+ 5110	risc_buff = ftypes(2)
+	iif = 7
+	DO 5120 iit = 3, maxtypes
+	  risc_buff(iif:) = ','//ftypes(iit)
+	  iif = iif + 1 + TM_LENSTR1(ftypes(iit))
+ 5120	CONTINUE
+	CALL WARN('Valid types are: '//risc_buff(:iif))
+	GOTO 5000
+
+	END
diff --git a/fer/gnl/equal_val.F b/fer/gnl/equal_val.F
new file mode 100644
index 0000000..125655b
--- /dev/null
+++ b/fer/gnl/equal_val.F
@@ -0,0 +1,97 @@
+	SUBROUTINE EQUAL_VAL( string, val, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the value
+* if the string is simply "name" then return unspecified value
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/14/88
+* revision 0.1 -  9/8/88 - explicit check for digit so words beginning with T
+*			   aren't treated as .TRUE. by VAX Fortran 
+* V420: 10/95 - need to buffer "READ(*)" for AIX bort
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER		status
+	REAL		val
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		TM_DIGIT
+	INTEGER 	equal_pos, slen
+#ifdef AIX_XLF
+	CHARACTER	buff*64
+#endif
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	slen	  = LEN( string )
+	equal_pos = INDEX( string, '=' )
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   val = unspecified_val4		! "name", alone
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+
+	ELSEIF ( string(equal_pos+1:) .EQ. ' ' ) THEN
+	   GOTO 5000				! "name =    "
+
+	ELSEIF ( .NOT.TM_DIGIT(string(equal_pos+1:)) ) THEN
+	   GOTO 5000				! "name = text"
+
+	ELSE
+#ifdef AIX_XLF
+	   buff = string(equal_pos+1:)
+	   READ ( buff, *, ERR=5000 ) val
+#else
+	   READ ( string(equal_pos+1:), *, ERR=5000 ) val
+#endif
+	ENDIF
+
+* success
+	status = ferr_ok
+ 1000	RETURN
+
+* syntax error
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *1000 )
+	END
diff --git a/fer/gnl/equal_val_int.F b/fer/gnl/equal_val_int.F
new file mode 100644
index 0000000..996a820
--- /dev/null
+++ b/fer/gnl/equal_val_int.F
@@ -0,0 +1,92 @@
+	SUBROUTINE EQUAL_VAL_INT( string, ival, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the value as an integer
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* based on equal_val for real numbers
+*
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+
+* calling argument declarations
+	INTEGER		status, ival
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		TM_DIGIT
+	INTEGER 	equal_pos, slen
+#ifdef AIX_XLF
+	CHARACTER	buff*64
+#endif
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	slen	  = LEN( string )
+	equal_pos = INDEX( string, '=' )
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   ival = unspecified_int4
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+
+	ELSEIF ( string(equal_pos+1:) .EQ. ' ' ) THEN
+	   GOTO 5000				! "name =    "
+
+	ELSEIF ( .NOT.TM_DIGIT(string(equal_pos+1:)) ) THEN
+	   GOTO 5000				! "name = text"
+
+	ELSE
+#ifdef AIX_XLF
+	   buff = string(equal_pos+1:)
+	   READ ( buff, *, ERR=5000 ) ival
+#else
+	   READ ( string(equal_pos+1:), *, ERR=5000 ) ival
+#endif
+	ENDIF
+
+* success
+	status = ferr_ok
+ 1000	RETURN
+
+* syntax error
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *1000 )
+	END
diff --git a/fer/gnl/errmsg.F b/fer/gnl/errmsg.F
new file mode 100644
index 0000000..2f53e08
--- /dev/null
+++ b/fer/gnl/errmsg.F
@@ -0,0 +1,307 @@
+	SUBROUTINE ERRMSG ( status_in, status_out, err_string, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display explanatory message of error, transfer error code to output variable,
+* and always take alternate return to serve as error branch in
+* calling program
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/31/86 - heavily based on TM_ERRMSG
+* revision 0.1 -  4/2/86 - changed FORMAT for ERR = messages
+* revision 0.2 - 4/29/87 - depending on mode_ignore_err possibly return
+*			   control of program to interactive mode
+* revision 0.3 - 5/14/87 - saves "last_error"
+* revision 0.4 - 11/30/87- handles interrupts
+* revision 0.5 - 1/12/89 - prefix error messages with "**ERROR:"
+*			 - eliminated non-standard "_" format
+* V200:  6/21/89 - check to see if "HELP CUE" is requested
+*	11/14/89 - special processing of Panasonic "ODR" errors
+*	11/27/89 - multiple line messages
+* Unix/RISC port - 1/91 - cant use "//" with CHAR*(*) variable
+*			- different processing of ferr_erreq
+*                 11/91 - "HELP" cues only relevant on VMS
+* V230:  7/21/92 - improved formatting of Unix system messages using PERROR arg
+*        11/4/92 - trim line end blanks from first line of message
+*         2/3/93 - display command line if control stack is "up"
+* V300:  4/30/93 - added ferr_silent (for GO arguments with own error text)
+*	 7/93 - added changes for GUI-based control
+* V301:	11/93 - the SUN f77 also has a bug with "//" on char*(*) variables.
+*		It doesn't show up as a compiler error message - instead it
+*		causes "RETURN 1" to do a normal return
+* V320: 2/28/95 - SPLIT_GUI_MESSAGE --> TM_SPLIT_MESSAGE
+* V420: 4/28/96 - close out all open IF blocks on error
+* 12/96 - LINUX Port - *kob*
+*		     - had to insert a "!" in column 1 of a purely comment line
+*		     - had to remove a single quote from comment line - 
+*			compiler did not like it...
+*		      - added ifdef to use linux perror c routine rather than
+*			fortran perror.  3.11.97
+* *kob* 1/00 - v5.30 - add xplot_setup for animate logical.  if ctrl-c
+*                      interrupt during animation, clean things up
+* arguments:
+*	status	- error code from calling program
+*	status_out	- error code (echoed) back to calling program
+*	err_string	- error text supplied from calling program - typically
+*				a filename or variable name
+* *acm 1/02  -v5.41  -- Check for mode ignore_error before closing out all open 
+*                       IF blocks on error  (at label 1000)
+* *acm* 10/04 v5.80  -- Check flag silent_err. This is set for SHO VAR/XML when
+*                       checking for user variables not relevant to the context
+* *acm* 10/04 v5.80  -- New code ferr_nomessge for use when user-given error msg 
+*                       in coached string substitution
+* *acm* 11/05 V600   -- New symbol FER_LAST_ERROR contains all the text normally
+*                       written to std out. 
+* *acm*  5/06 V600   -- Concatenate multiple lines for FER_LAST_ERROR with backslash.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* *sh* 11/13 V685    -- if allowed_err, then quickly exit
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xcontrol.cmn'
+	include 'xerrmsg_text.cmn'
+        include 'xrisc.cmn'
+        include 'xgui.cmn'
+	include 'xplot_setup.cmn'
+
+
+* ^C handling routine
+	EXTERNAL CTRLC_AST
+
+* calling argument declarations:
+	INTEGER		status_in,status_out
+	CHARACTER*(*)	err_string
+
+* internal variable declarations:
+	LOGICAL 	help_cue, multiline
+	INTEGER		TM_LENSTR1, len_text, len_string, status,
+     .			cr_pos, ier, ist, len_symbuf
+        CHARACTER*1028  symbuf  ! for symbol FER_LAST_ERROR
+
+* see if "HELP CUE" was requested
+	help_cue = status_in .GT. ghelp_cue
+	IF ( help_cue ) THEN
+	   status = status_in - ghelp_cue
+	ELSE
+	   status = status_in
+	ENDIF
+
+* initialize
+	last_error = status			! save it for "HELP"
+	status_out = status			! transfer error code to output
+	IF (allowed_err) GOTO 500		! error condition ignored
+	gui_status = status
+
+* initialize string for symbol FER_LAST_ERROR
+
+         symbuf = ' '
+         len_symbuf = 1
+
+         risc_buff = err_string     ! DEC f772.1 cannot use // with char*(*)
+
+* display error message 
+	IF ( status .GT. greport .AND. (.NOT.silent_err) ) THEN
+	   len_text = TM_LENSTR1( err_text(status - greport) ) 
+	   IF ( err_string .EQ. ' ' ) THEN
+	      CALL TM_SPLIT_MESSAGE( err_lun, ' **ERROR: '//
+     .				err_text(status-greport)(:len_text) )
+     
+              symbuf(len_symbuf:) = ' **ERROR: '//
+     .				err_text(status-greport)(:len_text)
+              len_symbuf = len_symbuf + len_text + 10
+
+	   ELSE
+* ... multiple lines ?
+	      cr_pos = INDEX( err_string, pCR )
+	      multiline = cr_pos .NE. 0
+	      IF ( multiline ) THEN
+	         len_string = TM_LENSTR1( err_string(:cr_pos-1) )  ! 11/92 mod
+	      ELSE
+	         len_string = TM_LENSTR1( err_string )
+	      ENDIF
+
+              IF (err_text(status-greport) .EQ. ' ') THEN
+ 	         CALL TM_SPLIT_MESSAGE( err_lun, ' **ERROR: '//
+     .			        risc_buff(:len_string) )
+!     .				': '//err_string(:len_string) )  !11/93 SUN bug
+
+                 symbuf(len_symbuf:) = ' **ERROR: '//
+     .			        risc_buff(:len_string) 
+                 len_symbuf = len_symbuf + len_string + 10
+
+              ELSE
+                 ier = status
+                 ier = greport
+                 ier = status - greport
+                 len_text = TM_LENSTR1(err_text(status-greport))
+	         CALL TM_SPLIT_MESSAGE( err_lun, ' **ERROR: '//
+     .				err_text(status-greport)(:len_text)//
+     .				': '//risc_buff(:len_string) )
+!     .				': '//err_string(:len_string) )  !11/93 SUN bug
+
+                 symbuf(len_symbuf:) =' **ERROR: '//
+     .				err_text(status-greport)(:len_text)//
+     .				': '//risc_buff(:len_string) 
+                 len_symbuf = len_symbuf + len_text + len_string + 13
+
+              ENDIF
+    
+	      IF ( multiline ) THEN
+                 CALL WRITE_MULTI(err_lun, err_string(cr_pos+1:))
+                 symbuf(len_symbuf:len_symbuf) = '\\'
+                 symbuf(len_symbuf+1:) = err_string(cr_pos+1:)
+                 len_string = TM_LENSTR1(err_string(cr_pos+1:))
+                 len_symbuf = len_symbuf + len_string + 2
+                 DO WHILE (INDEX( symbuf, pCR ) .GT. 0)
+                   cr_pos = INDEX( symbuf, pCR )
+                   symbuf(cr_pos:cr_pos) = '\\'
+                 ENDDO
+              ENDIF
+
+	   ENDIF
+ 3000	   FORMAT (' **ERROR: ',3A)
+
+	ELSEIF ( status .EQ. ferr_ODR_error ) THEN
+	   len_string = TM_LENSTR1( err_string )
+	   WRITE (err_lun,3100) err_string(:len_string)
+
+           symbuf(len_symbuf:) =err_string(:len_string)
+           len_symbuf = len_symbuf + len_string + 1
+
+ 3100	   FORMAT (' **Panasonic error: ',A)
+
+* error requiring no message ?
+	ELSEIF ( status .GT. gnoreport ) THEN
+	   GOTO 1000
+
+* error message from ERR= branch ?
+	ELSEIF ( status .EQ. ferr_erreq ) THEN
+
+	   len_string = TM_LENSTR1( risc_buff )
+#ifdef F90_SYSTEM_ERROR_CALLS
+	   call linux_perror('**ERROR: '//risc_buff(:len_string) )
+#else
+           CALL PERROR( '**ERROR: '//risc_buff(:len_string) )
+#endif
+
+* interrupt processing ? Re-store ^C interrupt handler
+	ELSEIF ( status .EQ. ferr_interrupt ) THEN
+	   CALL TM_SPLIT_MESSAGE( ttout_lun, '** INTERRUPTED! **')
+	   CALL SET_CTRL_C( CTRLC_AST )
+* *kob*	if animating during an interrupt, lets clean up
+	   IF ( animate ) THEN
+	      animate = .FALSE.
+	      first_frame = .TRUE.
+	   ENDIF
+	ELSEIF ( status .EQ. ferr_interrupt ) THEN
+* silent error code ?
+	ELSEIF ( status .EQ. ferr_silent ) THEN
+	   CONTINUE        ! quietly!
+
+	ELSE
+* unrecognized error code ?
+	   CALL TM_SPLIT_MESSAGE( err_lun, 'unknown error code:')              
+           symbuf(len_symbuf:) = 'unknown error code:'
+           len_symbuf = len_symbuf + 19
+
+	END IF
+
+* close out all open IF blocks on error (4/96)
+* but only if we're not ignoring errors (4/02)
+ 1000	IF ( .NOT.mode_ignore_err) then
+           ifstk = 0
+	   if_conditional = .FALSE.
+        ENDIF
+
+* if program was under internal control ( from the control stack ) this error
+* indicates that control is to be returned to the operator
+	IF ( cs_in_control ) THEN
+* ... display the offending command
+	   IF (status.NE.ferr_silent) CALL TM_SPLIT_MESSAGE( err_lun,
+     .					cmnd_buff(1:len_cmnd) )
+           IF ( status.EQ.ferr_interrupt
+     .    .OR. .NOT.mode_ignore_err    ) THEN
+* ... collapse the control stack back to simple operator control
+ 1100	      IF ( csp .GT. 0 ) THEN
+	         CALL POP_CS
+	         GOTO 1100
+	      ENDIF
+* ... inform the operator.  If running in -script mode, exit from Ferret.
+	      CALL TM_SPLIT_MESSAGE( err_lun,
+     .   'Command file, command group, or REPEAT execution aborted')
+              IF (its_script) THEN
+	         CALL TM_SPLIT_MESSAGE( err_lun, 'ERROR RUNNING SCRIPT')
+	         status = 1
+		 CALL EXIT(status)
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* prompt with Help cue ?
+* HELP command doesnt function on Unix systems
+
+* Generate symbol containing the whole error message
+
+* was there an external function error
+         IF ( len_eftext .GT. 0) THEN
+            symbuf(len_symbuf:) = '. Bailing out of external function '
+     .         //efname(:len_efname)//'\\'
+            len_symbuf = len_symbuf + len_efname + 36
+            symbuf(len_symbuf:) = ef_errtext(:len_eftext)
+            len_symbuf = len_symbuf + len_eftext
+         ENDIF
+
+* TMAP_error was saved in FER_LAST_ERROR already. Otherwise save
+* the string in the symbol
+
+         IF (status_in .NE. ferr_TMAP_error) THEN
+            ier = 0
+            ist = 0
+            CALL SETSYM ('FER_LAST_ERROR '//symbuf, 14+len_symbuf, 
+     .                 ier, ist)
+
+         ENDIF
+
+         len_eftext = 0
+
+* take alternate RETURN always
+  500	RETURN 1
+
+	END
diff --git a/fer/gnl/escape_for_xml.F b/fer/gnl/escape_for_xml.F
new file mode 100644
index 0000000..03ef684
--- /dev/null
+++ b/fer/gnl/escape_for_xml.F
@@ -0,0 +1,110 @@
+      SUBROUTINE escape_for_xml(string, outstring, slen)
+      
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* When writing xml, the string inside the tags may not contain > < or &.
+* Replace these characters in the input string with the appropriate 
+* replacement string, as outlined here:
+*
+* http://www.w3.org/TR/REC-xml/
+* The ampersand character (&) and the left angle bracket (<) MUST NOT 
+* appear in their literal form, except when used as markup delimiters, 
+* or within a comment, a processing instruction, or a CDATA section. If 
+* they are needed elsewhere, they MUST be escaped using either numeric 
+* character references or the strings " & " and " < " respectively. 
+* The right angle bracket (>) may be represented using the string " > ", 
+* and MUST, for compatibility, be escaped using either " > " or a character 
+* reference when it appears in the string " ]]>> " in content, when that string 
+* is not marking the end of a CDATA section. 
+
+* V631 11/09 *acm* 
+
+* calling argument declaration
+      CHARACTER*(*) string, outstring 
+      INTEGER slen 
+
+* Local declarations
+      INTEGER TM_LENSTR1, i, nchar, lenrepl(3), blen, loc
+      CHARACTER*1 rchar(3)
+      CHARACTER*6 repl(3)
+      
+      DATA rchar(1)  /'<'/
+      DATA rchar(2)  /'>'/
+      DATA rchar(3)  /'&'/
+      DATA repl(1)  /'<'/
+      DATA repl(2)  /'>'/
+      DATA repl(3)  /'&'/
+
+      DATA lenrepl/4,4,5/
+
+      nchar = 3 
+      slen = TM_LENSTR1(string)
+      loc = 1
+
+      outstring(1:1) = string(loc:loc)
+      blen = 1
+
+      DO 90 i = 1, nchar
+         IF (string(loc:loc) .EQ. rchar(i)) THEN
+            outstring = repl(i)
+            blen = lenrepl(i)
+         ENDIF
+  90     CONTINUE
+
+      loc = loc + 1
+
+      DO WHILE (loc .LE. slen)
+         DO 100 i = 1, nchar
+            IF (string(loc:loc) .EQ. rchar(i)) THEN
+               outstring = outstring(1:blen)//repl(i)
+               blen = blen + lenrepl(i)
+               GOTO 200
+            ENDIF
+  100    CONTINUE
+
+*  Not replaced, just keep the orig. character
+
+         outstring = outstring(1:blen)//string(loc:loc)
+         blen = blen + 1
+
+  200    CONTINUE
+
+         loc = loc + 1
+
+      ENDDO
+
+      slen = blen
+      
+      RETURN
+      END
+
diff --git a/fer/gnl/finalize.F b/fer/gnl/finalize.F
new file mode 100644
index 0000000..fdfb9c9
--- /dev/null
+++ b/fer/gnl/finalize.F
@@ -0,0 +1,78 @@
+
+
+	SUBROUTINE FINALIZE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* prepare for shutdown of ferret
+*
+*     *kms* 11/10 - added cat_pystat_var string_array_clear
+*                   cleared out VMS-specific includes
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+        include 'tmap_errors.parm'  ! error codes
+	include 'tmap_dims.parm'
+	include 'xio.cmn_text'
+        include 'xdset_info.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'gfdl_vms.parm'
+	include	'errmsg.parm'
+	include	'gfdl.parm'			! from phil/sieg
+	include	'xonedim.cmn'		! from phil.sieg
+	include 'xprog_state.cmn'
+        include 'xalgebra.cmn'
+	include 'xvariables.cmn'
+	include 'xtoday.cmn'
+        include 'xpyvar_info.cmn'
+
+        CALL string_array_clear(alg_pvar_head)
+
+        CALL string_array_clear(countervar_name_head)
+
+        CALL string_array_clear(uvar_name_code_head)
+ 
+        CALL string_array_clear(ds_var_code_head)
+
+        CALL string_array_clear(pyvar_code_head)
+
+        CALL deleted_list_clear(uvar_num_items_head)
+
+	RETURN
+
+	END
+
diff --git a/fer/gnl/float2string_for_xml.F b/fer/gnl/float2string_for_xml.F
new file mode 100644
index 0000000..49d1f2a
--- /dev/null
+++ b/fer/gnl/float2string_for_xml.F
@@ -0,0 +1,91 @@
+	SUBROUTINE FLOAT2STRING_FOR_XML (val, attype, strng, slen)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Write a floating-point value accurately to a string for XML output
+*  Input is double precision floating-point number and the attribute
+*  type that it had in the original dataset.
+*  Return the string and string length
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 27-Jun-2013
+
+        include 'netcdf.inc'
+
+* Argument declarations	
+	REAL val
+	CHARACTER*(*) strng
+	INTEGER attype, slen
+
+* Internal declarations
+	LOGICAL TM_FPEQ
+	CHARACTER TM_FMT*16
+	INTEGER TM_LENSTR, ival
+	REAL test_val
+  
+  888	FORMAT(i16.0)
+
+* Convert using TM_FMT
+
+	strng = TM_FMT(val, 7,16,slen)
+
+	IF (attype .EQ. nf_float .OR. attype .EQ. nf_double) THEN
+	   slen = TM_LENSTR(strng)
+	ELSE
+
+* Check. Does the string correctly capture the value?
+
+	   READ (strng, *) test_val
+	   IF ( .NOT. TM_FPEQ (test_val, val) ) THEN
+
+* Try with more digits
+	      strng = TM_FMT(val, 9,16,slen)
+	      READ (strng, *) test_val
+
+* Still does not match. Write unformatted value. If it is
+* known to be an integer, use a long integer format.
+
+	      IF ( .NOT. TM_FPEQ (test_val, val) ) THEN
+	         WRITE (strng, *) val
+	         ival = val
+	         IF (attype .EQ. nf_int) WRITE (strng, 888) ival
+	      ENDIF
+
+	      slen = TM_LENSTR(strng)
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/gnl/get_context_mods.F b/fer/gnl/get_context_mods.F
new file mode 100644
index 0000000..9e752cf
--- /dev/null
+++ b/fer/gnl/get_context_mods.F
@@ -0,0 +1,1208 @@
+	SUBROUTINE GET_CONTEXT_MODS
+     .		      ( dflt_cx,
+     .			text_buff,
+     .			mods_cx,
+     .			max_list_len,
+     .			list_len,
+     .			it_start,
+     .			it_end,
+     .			report_unknown,
+     .			status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* interpret a list of coordinate limit specifiers and other special qualifiers
+* and put the interpreted list of modifications into the buffer mods_cx
+* note: no initialization is done except on those dimensions that are modified
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/25/86
+* revision 1.0 - 3/2/87  - changed to "/n=lo:hi at XXX" syntax
+* revision 1.1 - 3/20/87 - changes for new TMAP library
+* revision 1.2 - 4/28/87 - allowed X=@NUL syntax and "relative" notation
+* revision 1.3 - 6/25/87 - if x=@AVE and y=@AVE then do AAV ("area average")
+*			 - also corrected bug for qualifiers with first letter
+*			   of x,y,z,t,i,j,k,l,d or g
+* revision 1.4 - 8/18/87 - added decoding of transformation argument and special
+*			   check that @SHF is applied only to subscripts
+* revision 1.5 - 8/29/87 - added GFDL_VMS.PARM
+* revision 1.6 - 9/14/87  - oddness check for @SBX
+*			    and reverse order of lo>hi instead of error
+*			    and /X with no position is ignored
+* revision 1.7 - 9/23/87  - allow 4 character region names from cx_name
+* revision 1.8 - 3/3/88   - forbid @SHF with world coords to avoid loosing
+*			    transformation in FINISH_1_CONTEXT_MO*
+* revision 1.9 - 3/23/88  - added processing of date/time strings
+* revision 2.0 - 7/25/88  - added /G= decoding (requiring dflt_cx)
+*			    and /D=dset_name (instead of number)
+* revision 2.1 - 9/28/88  - bug fix: re-ordering date string test wrong
+* revision 2.2 -11/22/88  - new io library FIND_GRID_NUMBER -->TM_GET_GRIDNUM
+* revision 2.3 - 1/4/89   - added regridding transformations
+*			  - corrected bugs in VAR[Q=xxx] (Q syntax) and @FAV
+* revision 2.4 - 3/14/89  - distinguish between X=160E:160W and X=160W:160E
+*			    using "formatted" flag in TRANSLATE_LIMIT
+* revision 2.5 - 4/24/89  - bug fix:  iend --> namelen
+* V200:  6/28/89 - eliminated %%_relative, added grid_needs_dset
+*	10/20/89 - check for x=lo::hi (colon2_pos error)
+*	 2/16/90 - more detailed error reporting
+* Unix/RISC port - 1/91 - cant use "//" with CHAR*(*) variable
+*                - 8/91 added Hanning,Partzen and Welch smoothers to err msg
+* V230: 1/21/92 - coach user to use SHOW TRANSFORMS for transform errors
+*       8/10/92 - allow multiple specifications of same axis eg u[@zlim,z=@trn]
+*       8/22/92 - incorporated GX=grid at trn regridding notation (major chges)
+*               - fixed improper error messages using risc_buff
+*               - do not impose area average regridding h--> GET_CONTEXT_GRID
+*               - trap G=pseudo-var error
+* V320:12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V400: 3/20/95 - ignore any region info that contains grave accents.  This
+*		  is because this routine is called **during** the process
+*		  of evaluating the grave accent expressions.
+* V402: 7/95	- Allow nested [] of the form vname1[G=vname2[D=dset]]
+* V420: 9/95	- Support for implicit grid (e.g. var[gx=axis_name]
+*	    Note: This change also altered slightly the interpretation of the
+*		  regridding qualifiers.  "gx=salt" now means to pull only
+*		  the X axis from the variable SALT --> an implicit grid
+* 	(IBM/AIX port of V411): 10/5/95 - buffer "READ(var,*"
+*	1/9/96  - (for modulo regridding) decode regrid transform names
+*		  in excess of 3 characters
+*	2/13/96 - allow GX=lo:hi:delta equivalent to X=lo:hi:delta
+*	2/23/96 - fix bugs left in check added 8/10/92 that miscode
+*		   [Y=@DDF,J=1] --> added "set_implicitly" in addition to
+*		   already existing "first_time"
+* V430:  7/1/96 - incorporate 4D transformations: AVE, VAR, DIN, NDG, NBD
+*	7/10/96 - allow axes of unknown orientation to be used in a GX=axis
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V450:  7/17/97 - GX=grid_name does not generate X-only regridding
+*       8/97 - *kob* - set cx_calendar to show whether a time was entered
+*                      as a date string.
+*                    - also check cx_calender rather than fmat_lo or fmat_hi
+* V491:  3/2/98 *sh* - increased length of "name" to accomodate
+*                    e.g. gt="1-jan-1990:12:00":"15-jan-1990:12:00":120
+*                    and allow special check for leading quotation mark
+* V510: 8/99 *sh* - allow g=uvar and return encoded char pos of uvar
+*	12/99 *sh* - save info about formatting of inputs in cx_formatted
+*	12/99 *sh* - added ugly hack to allow multiple axes as in "GXY=gg"
+*	12/99 *sh* bug fix: g=user_var failed if user_var was pure abstract
+*	3/00  *sh* - remove old trap for mixed dates and time steps
+*	4/00  *sh* - since netCDF uses dynamic grids now, DEALLOC will
+*		     deallocate axes within implicit grids. Accomodate that.
+* V520: 6/00 *sh* bug fix: cx_grid_needs_dset is not set correctly when the
+*		           syntax is X[Gx=var[D=dset]]
+* V530: 3/01 *acm* - Pass calendar ID, if available, to TRANSLATE_LIMIT
+* V532 5/01 *sh*: minor bug fix: detect extra colon in "i=1:5:2:"
+* V533:6/01 *sh* bug fix: cx_grid_needs_dset is not set correctly when the
+*			  g=var and var is a uvar with self-contained dset 
+*
+* *kob* 2/03 - replace call to intrinsic func CHAR with its octal
+*              constant equivalent - needed for g77 port
+* V552 3/03 *acm* - variable "name" may be the name of a dataset, 
+*                    increase its length from 48 to 512 characters.
+* V552 5/03 *acm* - bug fixes for parsing mulit-axis regrids, when uvar is
+*                   not loaded [gxy=var]  and [gxy=var[d=dset]]
+* v554 11/03*acm* - changing a comment, only. 
+* v5.80 *acm* 11/04 use cx_cal_id to store the calendar used when
+*                   computing world coordinates.
+* v6.12 *acm*  7/08 Fix bug 1585: allow for alternative calendars. See if 
+*                   there is a calendar definition for the grid and axis, 
+*                   and set the calendar ID before translating the date string 
+*                   to an axis coordinate.
+* V6.8  *acm* 3/12 remove block that checks for qual_given(slash_T0). Neither 
+*                  slash_t0 nor orient are defined here.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V6.90 *sh* 12/13 support for auxiliary regridding variables:
+*                  temp[gz(depth)=zax at ave]
+*		   including special interpretation of gz(depth)=100 (a point)
+*		   ensure that the same axis region isn't set twice (line 200)
+*		   Detect 'sigma' and 'curvi' automation flags
+*	           Note that errors will be silent in dependency_tree_mode
+*		   Set cx_g_eq_regrid logical (used to be local "regrid_dims")
+
+* specifiers may give coordinate in subscript units (/I,/J,/K,/L) or
+* may give coordinate in "world" units (/X,/Y,/Z,/T)
+* the specifiers may be of any of the following forms:
+*	/q=val			specifies a single value
+*	/q=val_1:val_2		specifies a range of values
+*	/q=val_1:val_2:val_inc	specifies a range and an increment
+*	/q=val_1:val_2 at XXX	specifies a range with a transformation XXX
+*	/q=@XXX			specifies a transformation XXX, only
+
+* this routine also handles the items modifying a var name in square brackets
+*        D=dset_or_var
+*        Gxyzt = var_grid_or_axis at XXXX
+*  ... and added v6.85:
+*	 Gxyzt(varx,vary,...)=var_grid_or_axis at XXXX ! regrid with aux vars
+
+
+* logical arguments:
+*	report_unknown 	  if .TRUE. then unknown specifiers are errors
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	include	'xtm_grid.cmn_text'
+	external xdset_info_data
+	include 'errmsg.parm'	
+	include 'ferret.parm'	
+	include 'gfdl_vms.parm'	
+	include 'interp_stack.parm'
+	include 'xalgebra.cmn'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xtext_info.cmn'
+	include 'xdependency_tree.cmn'
+	include 'xrisc.cmn'		! for RISC/FORTRAN
+
+* calling arguments:
+	CHARACTER*(*)	text_buff
+	INTEGER		mods_cx, status, max_list_len, list_len, ict,
+     .			dflt_cx, it_start(max_list_len), it_end(max_list_len)
+	LOGICAL		report_unknown
+
+* internal variables:
+	LOGICAL		INVALID_R8_TO_I4, TM_DIGIT, MATCH4,
+     .			atsin, colon, colon2, atcolon, first_time(nferdims),
+     .			morph_gx_to_x(nferdims), set_implicitly(nferdims),
+     .			fmat_lo, fmat_hi, logical_dummy, single_char,
+     .			has_g_eq_unkn_uvar, gdset_included, has_auxvar
+	INTEGER		ATOM_POS, STR_CASE_BLIND_COMPARE, STR_UPCASE,
+     .			TM_GET_GRIDNUM, KNOWN_GRID, FIND_DSET_NUMBER,
+     .			REGION_NUMBER, TM_GET_LINENUM, TM_AXIS_DIRECTION,
+     .			TM_LENSTR1,
+     .			equal_pos, colon_pos, atsin_pos, atcolon_pos, grid,
+     .			suborval, lo_start, lo_end, namlen, rgdim,
+     .			hi_start, hi_end, item, idim, del_start, del_end,
+     .			colon2_pos, vax_code, istart, iend, itrans,
+     .			dset, variable, category, name_end, next_char, i,
+     .			impl_grid, axis, other, naxes, aux_arg_namlen,
+     .			aux_lparen_pos, aux_rparen_pos, aux_arg_count,
+     .			iqual,this_dim
+	CHARACTER*(1)	UPPER_CASE, region_qual(nferdims,2),
+     .			letter, letter2
+	CHARACTER	name*512, comment*12, transnam*6, buff*32, 
+     .                  cal_name*32, letters*3
+	REAL*8		temp
+	INTEGER		dstart, dend, lbrac, state, gdset, itest, nend, ii
+
+
+* internal parameter declarations:
+	CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+	INTEGER		looking_for_D, looking_for_eq, looking_for_name,
+     .			done_looking, cal_id, TM_GET_CALENDAR_ID
+	PARAMETER     ( looking_for_D = 1,
+     .			looking_for_eq = 2,
+     .			looking_for_name = 3,
+     .			done_looking = 9)
+
+	DATA (region_qual(idim,1),idim=1,nferdims) / 'I','J','K','L','M','N' /,
+     .       (region_qual(idim,2),idim=1,nferdims) / 'X','Y','Z','T','E','F' /
+!     .       other_qual(1) / 'D' /,	! /DATA_SET=
+!     .       other_qual(2) / 'G' /	! /GRID=
+!     .       other_qual(3) / 'S' /	! var[z=100,SIGMA]
+!     .       other_qual(4) / 'C' /	! var[x=140e,Y=0,CURVILINEAR]
+
+* local parameter declarations (as in xeq_define)
+	INTEGER	    slash_calendar
+	PARAMETER ( slash_calendar = 1 + 15)
+
+* initialize
+	dset = cx_data_set( dflt_cx)
+        axis = unspecified_int4
+        grid = unspecified_int4
+        DO 10 idim = 1, nferdims
+	   morph_gx_to_x(idim)  = .FALSE.
+	   set_implicitly(idim) = .FALSE.
+	   cx_g_eq_regrid(idim) = .FALSE.
+	   first_time(idim)     = .TRUE.
+ 10	CONTINUE
+	has_g_eq_unkn_uvar = .FALSE.
+
+* check in advance for the use of pre-specified ("/@") limits and D=
+* (the results of D= may be relevant in G=var)
+	DO 50 item = 1, list_len
+	   istart = it_start(item)
+	   iend   = it_end  (item)
+	   risc_buff  = text_buff(istart:iend)		! for RISC/FORTRAN
+	   len_rbuff  = MIN(size_rbuff, iend-istart+1)	! for RISC/FORTRAN
+	   letter = text_buff(istart:istart)
+	   IF (letter .EQ. '@') THEN
+	      IF ( iend .EQ. istart ) GOTO 5015
+* ... pre-specified limit has been requested
+	      ict = REGION_NUMBER( text_buff( istart+1:iend) )
+	      IF ( ict .EQ. unspecified_int4 ) GOTO 5100
+* ... set predefined context limits as defaults
+ 20	      DO 30 idim = 1, nferdims
+	         IF ( cx_given( idim, ict ) ) THEN
+	            cx_lo_ss ( mods_cx, idim ) = cx_lo_ss ( ict, idim )
+	            cx_hi_ss ( mods_cx, idim ) = cx_hi_ss ( ict, idim )
+	            cx_lo_ww ( idim, mods_cx ) = cx_lo_ww ( idim, ict )
+	            cx_hi_ww ( idim, mods_cx ) = cx_hi_ww ( idim, ict )
+* kob 9/97 - set cx_calendar as well
+		    IF (idim .EQ. t_dim .OR. idim .EQ. f_dim) 
+     .                 cx_calendar(mods_cx) = cx_calendar(ict)
+	            cx_trans ( idim, mods_cx ) = cx_trans   ( idim, ict )
+	            cx_trans_arg(idim, mods_cx ) = cx_trans_arg(idim, ict )
+	            cx_by_ss ( idim, mods_cx ) = cx_by_ss( idim, ict )
+	            cx_given ( idim, mods_cx ) = cx_given( idim, ict )
+!                    first_time(idim) = .FALSE.	! pre 2/23/96
+                    set_implicitly(idim) = .TRUE.
+	         ENDIF
+ 30	      CONTINUE
+	   ELSEIF (letter.EQ.'d' .OR. letter.EQ.'D' ) THEN
+	      IF ( iend .EQ. istart ) GOTO 5015
+* make sure it isn't some other qualifier that begins with "d"
+!	      IF ( iend .GT. istart ) THEN
+	         IF (  text_buff( istart+1:istart+1 ) .NE. ' '
+     .	         .AND. text_buff( istart+1:istart+1 ) .NE. '='
+     .	         .AND. text_buff( istart+1:istart+1 ) .NE. tab ) GOTO 50
+!	      ENDIF
+* ... D=data_set given
+	      equal_pos = ATOM_POS( text_buff(istart:iend), '=' )
+	      IF ( equal_pos .EQ. atom_not_found
+     .	      .OR. equal_pos .EQ. atom_illegal_pos ) GOTO 5110
+	      equal_pos = equal_pos + istart - 1
+	      name = text_buff(equal_pos+1:iend)
+	      namlen = iend-equal_pos
+	      dset = FIND_DSET_NUMBER( name )
+	      IF ( dset .EQ. unspecified_int4 ) GOTO 5040
+	      cx_data_set( mods_cx ) = dset
+	      cx_dset_gvn( mods_cx ) = .TRUE.
+	   ENDIF
+ 50	CONTINUE
+
+* Get calendar type from the command line
+
+        cal_name = 'GREGORIAN'		! default
+        name = " "
+        cal_id = TM_GET_CALENDAR_ID (cal_name)
+	iqual = qual_given( slash_calendar )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      cal_name, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+           name = cal_name
+	ENDIF
+
+* 9/01 CF conventions have adopted the name 360_day for a 360-day year.
+
+	IF (name .EQ. '360') cal_name = '360_DAY' 
+	IF (name .EQ. 'D360') cal_name = '360_DAY' 
+	IF (name .EQ. 'STANDARD') cal_name = 'GREGORIAN' 
+	IF (name(1:6) .EQ. 'COMMON') cal_name = 'NOLEAP' 
+	IF (name(1:6) .EQ. '365_DA') cal_name = 'NOLEAP' 
+	IF (name(1:6) .EQ. '366_DA') cal_name = 'ALL_LEAP' 
+	cal_id = TM_GET_CALENDAR_ID (cal_name)
+
+* loop through list of other ( non /@ ) items provided
+	DO 500 item = 1, list_len
+	   istart = it_start( item )
+	   iend   = it_end  ( item )
+	   risc_buff  = text_buff(istart:iend)		! 8/92
+	   len_rbuff  = MIN(size_rbuff, iend-istart+1)	! 8/92
+	   letter = UPPER_CASE(text_buff(istart:istart))! 8/92
+	   has_auxvar = .FALSE.				! 12/13
+
+* ignore any region information that contains grave accents
+	   IF ( INDEX(risc_buff,'`') .GT. 0 ) GOTO 500
+
+* identify 'SIGMA' and 'CURVI' qualifiers
+	   IF (MATCH4(risc_buff,len_rbuff,
+     .			  'SIGM',   4          ) ) THEN
+	      cx_aux_given(z_dim,mods_cx) = .TRUE.
+	      GOTO 500
+	   ELSEIF (MATCH4(risc_buff,len_rbuff,
+     .			  'CURV',   4          ) ) THEN
+	      cx_aux_given(x_dim,mods_cx) = .TRUE.
+	      cx_aux_given(y_dim,mods_cx) = .TRUE.
+	      GOTO 500
+	   ENDIF
+
+* all other valid specifiers are single characters or double character
+* regrid specifiers of the form G*, when * is I,J,K,L,M,N,X,Y,Z,T,E or F.
+* Is this ?
+	   IF ( iend .GT. istart ) THEN
+              letter2 = text_buff(istart+1:istart+1) ! 8/92
+	      IF (  letter2 .EQ. ' '
+     .	       .OR. letter2 .EQ. '='
+     .	       .OR. letter2 .EQ. tab ) THEN
+* ... is it a region specifier (single character) ?
+                 single_char = .TRUE.
+	         naxes = 1
+                 DO 54 suborval = 1,2
+	         DO 54 idim     = 1,nferdims
+	            IF ( letter.EQ.region_qual(idim,suborval) ) GOTO 200
+ 54              CONTINUE
+                 GOTO 100     ! not a region specifier
+              ELSE                                    ! 8/92
+                 single_char = .FALSE.
+                 letter2 = UPPER_CASE(letter2)
+                 DO 60 suborval = 1,2
+	         DO 60 idim     = 1,nferdims
+	            IF ( letter2.EQ.region_qual(idim,suborval) ) GOTO 100
+ 60 	         CONTINUE
+                 GOTO 190   ! ... not a recognized qualifier
+              ENDIF
+	   ENDIF
+
+* maybe its /D= (data_set) or /G= (grid#)
+ 100	   IF ( letter.EQ.'D' ) GOTO 500 ! already done
+	   IF ( letter.NE.'G' ) GOTO 190
+
+* only a single regridding specifier is allowed if auxvar regridding is used
+	   IF (cx_unstand_grid(mods_cx) .AND. cx_naux(mods_cx).NE. 0) THEN
+	      name = 'only a single regrid allowed when using'
+	      GOTO 5300
+	   ENDIF  
+
+* G= or G*= non-standard grid specifier ...
+* full format is (e.g.) GX=SALT at AVE (atsin and beyond optional)
+* (7/95) or may also include data set for grid as in G=vname[D=dset]
+* (3/13) or may also have aux vars as in Gxy(curvx,curvy)=vname[D=dset]@ave
+	   equal_pos = ATOM_POS( text_buff(istart:iend), '=' )
+	   IF ( equal_pos .EQ. atom_not_found
+     .	   .OR. equal_pos .EQ. atom_illegal_pos ) GOTO 5020
+	   equal_pos = equal_pos + istart - 1
+	   name = text_buff(equal_pos+1:iend)
+	   namlen = iend-equal_pos
+	   atsin_pos = ATOM_POS( name, '@' )
+	   comment = '@ttt syntax'			! ... for error message
+	   IF ( atsin_pos .EQ. atom_illegal_pos ) GOTO 5020	   
+	   atsin = atsin_pos .NE. atom_not_found
+!           IF (.NOT.(single_char.OR.atsin)) GOTO 5026 !8/92 GX=TEMP forbidden
+	   IF ( atsin ) THEN
+	      name_end = atsin_pos - 1
+	   ELSE
+	      name_end = namlen
+	   ENDIF
+	   nend = name_end
+
+* allow multiple axes at once as in "GXY=ggg" (12/99 hack)
+* ... or "GXY(curvx,curvy)=ggg"  (3/13)
+	   IF (.NOT.single_char) THEN
+* count the number of axis specifiers and identify them
+	      DO 102 i = istart+1, equal_pos
+                 letter2 = text_buff(i:i)
+		 IF (  letter2 .EQ. ' '
+     .	          .OR. letter2 .EQ. '='
+     .            .OR. letter2 .EQ. '('
+     .	          .OR. letter2 .EQ. tab ) THEN
+	            GOTO 103
+	         ELSE
+*   .... identify the axis that is being regridded
+                    DO suborval = 1,2
+	            DO idim     = 1,nferdims
+	               IF ( letter2.EQ.region_qual(idim,suborval) ) THEN
+	                  IF (cx_g_eq_regrid(idim)) THEN
+	                     name = 'auxiliary axis named more than once in'
+	                     GOTO 5300
+	                  ELSE
+	                     cx_g_eq_regrid(idim) = .TRUE.
+	                     GOTO 102
+	                  ENDIF
+	               ENDIF
+		    ENDDO
+	            ENDDO
+	            GOTO 5400    ! logic corruption -- should never happen
+	         ENDIF
+ 102          CONTINUE
+	      GOTO 5400          ! logic corruption -- should never happen
+ 103	      naxes = i - istart - 1
+c	      next_char = istart + naxes - 1
+	      next_char = istart
+	      has_auxvar = letter2 .EQ. '('
+	      this_dim = idim  ! 1/2014 hack cuz idim isn't reliable
+	   ENDIF
+
+* if auxiliary regridding variables have been given, parse em here
+	   IF (has_auxvar) THEN
+* ... first check for valid usage
+	     IF (naxes .GT. 1) THEN
+		name =
+     .		'this Ferret version doesnt support multi aux regrid args' 
+	        GOTO 5300
+	     ENDIF
+	     IF (idim .NE. z_dim) THEN
+		name =
+     .		'only the Z axis can be used in' 
+	        GOTO 5300
+	     ENDIF
+
+	     aux_lparen_pos = i
+	     aux_rparen_pos = INDEX(text_buff(i:equal_pos), ')' )
+	     IF (aux_rparen_pos .EQ. 0) THEN
+	        name = 'unpaired parentheses in'
+	        GOTO 5300
+	     ELSEIF (aux_rparen_pos .LT. 3) THEN
+	        name = 'empty parentheses in'
+	        GOTO 5300
+	     ENDIF
+	     aux_rparen_pos = aux_rparen_pos + i - 1
+* ... infer the aux argument count in the parens from the number of commas
+	     aux_arg_count = 1
+	     aux_arg_namlen = 0
+*    ... argument order must match collating order of axes as in gyx(argx,argy)=
+	     DO rgdim = 1, nferdims
+	         IF (cx_g_eq_regrid(rgdim)) GOTO 704   ! too lazy to renumber
+	     ENDDO
+	     GOTO 5400   ! can never get here
+ 704	     cx_aux_arg_start(rgdim, mods_cx) = i+1
+	     cx_aux_arg_end  (rgdim, mods_cx) = i
+	     cx_aux_stat     (rgdim, mods_cx) = paux_stat_used
+	     DO 104 i = aux_lparen_pos+1, aux_rparen_pos-1
+	        IF (text_buff(i:i) .EQ. ' ') GOTO 104
+	        IF (text_buff(i:i) .NE. ',') THEN
+*    ... add one character to the name length
+	          aux_arg_namlen = aux_arg_namlen + 1
+	          cx_aux_arg_end(rgdim,mods_cx) =
+     .				cx_aux_arg_end(rgdim,mods_cx) + 1
+	        ELSE
+*    ... start of a new argument name
+	          IF (aux_arg_namlen .EQ. 0) THEN
+	            name = 'missing auxiliary variable name in'
+	            GOTO 5300
+	          ENDIF
+	          aux_arg_count = aux_arg_count + 1
+*    ... match this arg to its axis from the "gxy" syntax
+	          DO rgdim = rgdim+1, nferdims
+	             IF (cx_g_eq_regrid(rgdim)) THEN
+	                cx_aux_arg_start(rgdim, mods_cx) = i
+	                GOTO 104
+	             ENDIF
+	          ENDDO
+*    ... there are more arguments than there were axes named in "gxy"
+	          name = 'no. of auxliary variables must match no. of axes in'
+	          GOTO 5300
+	        ENDIF
+ 104	     CONTINUE
+	     IF (aux_arg_namlen .EQ. 0) THEN
+	        name = 'missing auxiliary variable name in'
+	        GOTO 5300
+	     ELSEIF (aux_arg_count .NE. naxes) THEN
+	        name = 'no. of auxliary variables must match no. of axes in'
+	        GOTO 5300
+	     ENDIF
+	     cx_naux(mods_cx) = naxes
+	   ENDIF
+
+* initialize for next axis as in "GXY="
+ 105	   IF (.NOT.single_char) THEN
+	      next_char = next_char + 1
+	      IF ( next_char-istart .GT. naxes ) GOTO 500
+              letter2 = UPPER_CASE( text_buff(next_char:next_char) )
+              DO 107 suborval = 1,2
+	      DO 107 idim     = 1,nferdims
+	         IF ( letter2.EQ.region_qual(idim,suborval) ) GOTO 109
+ 107	      CONTINUE
+              GOTO 190   ! ... not a recognized qualifier
+ 109	      CONTINUE
+	   ENDIF
+
+* decipher the grid name (or variable name) (or axis name - 9/95)
+*11111111111
+           IF ( name_end .GT. 0 ) THEN
+* ... first see if grid has been given as a LOW:HI:DELTA  2/96
+*	Note: this trap is a kludge -- it is a hack to allow GX=lo:hi:delta
+*	      equivalent to X=lo:hi:delta because it is natural for users
+*	      to confuse these two
+*       3/98: for T axis with GT="1-JAN-1990" first character may be a quote
+	      i = 1		                                     ! 3/98
+	      IF ((idim.EQ.t_dim .OR. idim.EQ.f_dim)  .AND. name(1:1) .EQ. '"') i = 2    ! 3/98
+	      IF ( TM_DIGIT(name(i:i)) .AND. .NOT.single_char ) THEN
+	         IF (.NOT.first_time(idim) ) GOTO 5200
+	         IF (naxes .GT. 1) GOTO 5205	! cannot say GXY=lo:hi:delta
+	         morph_gx_to_x(idim) = .TRUE.
+* 1/2014
+* ... treat gx=lo:hi:delta at ave as an implicit ax regrid like x=lo:hi:delta at ave
+*     similarly treat gz(depth)=0:100:10 as an implicit axis
+*     and also gz(depth)=100 as a single point axis
+*     but gz(depth)=0:100 at ave is a special case where we need to parse the
+*     ""@ave" as a regridding transform, before we can behave like x=lo:hi:del
+	         this_dim = idim   ! 1/2014 hack cuz idim isn't reliable
+	         IF (.NOT.(has_auxvar.AND.atsin)) THEN
+	            GOTO 201
+	         ELSE
+	            GOTO 170
+	         ENDIF
+	      ENDIF
+* ... see if grid has been given by grid name
+              grid = TM_GET_GRIDNUM( name(:name_end) )
+*22222222222222
+* ... logic for implicit grids added here 7/97
+	      IF ( grid .NE. unspecified_int4 ) THEN
+	         IF ( single_char ) THEN	! g=grid_name
+	            IF ( cx_grid(mods_cx) .NE. unspecified_int4
+     .	           .AND. cx_grid(mods_cx) .NE. grid ) GOTO 5022
+ 	            cx_grid( mods_cx ) = grid
+	         ELSE
+	            IF (.NOT.cx_has_impl_grid(mods_cx)) THEN
+	               CALL ALLO_GRID_TO_CX(mods_cx,impl_grid,status)
+	               IF ( status .NE. ferr_ok ) GOTO 5000
+	            ENDIF
+	            grid_line(idim,impl_grid) = grid_line(idim,grid)
+		 ENDIF
+	         cx_unstand_grid(mods_cx) = .TRUE.
+*22222222222222
+	      ELSE
+* ... no ... then maybe it's a variable name (or an axis name -- 9/95)
+* 	     if "[D=dset]" is not given then assume it is in the default dset
+* note: as of FERRET 2.3 g=user_var is still forbidden.  This restriction can
+*	be lifted by adding code in IS_USER_VAR to inspect for simultaneous
+*	cx_unstand_dset and cx_data_set=unspecified after determining variable
+*	or pseudo-variable context.  A new hi_cx has to be set up for the g=
+*	user variable and then RETURN to get that component
+*    7/95: allow embedded data set info "vname[D=dset]"
+*    5/03: bug fix: [gxy=var[d=dset]] failed because name_end was reset in this
+*                   section, but is needed when we go back for next axis: use nend
+
+	         lbrac = INDEX(name(:name_end),"[")
+*33333333333333333
+	         IF (lbrac .GT. 0) THEN
+* ... find closing right bracket		
+	            IF ( lbrac .EQ. name_end ) GOTO 5056
+	            dend = INDEX(name(lbrac+1:name_end),"]")
+	            IF ( dend .EQ. 0 ) GOTO 5056
+	            nend = lbrac-1		! variable name end
+	            dend   = dend + lbrac - 1	! embedded data set name end
+* ... parse "[D=dset]"
+	            state = looking_for_D
+	            DO 112 i = lbrac+1,dend
+	               IF ( name(i:i) .EQ. ' '
+     .		       .OR. name(i:i) .EQ. tab ) THEN
+	                  CONTINUE
+	               ELSEIF ( state .EQ. looking_for_D ) THEN
+	                  IF ( name(i:i) .EQ. 'd'
+     .		          .OR. name(i:i) .EQ. 'D' ) THEN
+	                     state = looking_for_eq
+	                  ELSE
+	                     GOTO 5056
+	                  ENDIF
+	               ELSEIF ( state .EQ. looking_for_eq ) THEN
+	                  IF ( name(i:i) .EQ. '=' ) THEN
+	                     state = looking_for_name
+	                  ELSE
+	                     GOTO 5056
+	                  ENDIF
+	               ELSE	! 1st non-white character after the "=" 
+	                  dstart = i
+	                  state = done_looking
+	                  GOTO 114
+	               ENDIF
+ 112	            CONTINUE
+ 114	            IF ( state .NE. done_looking ) GOTO 5056
+
+* What if it's x[d=1,i=1:3]  ?  dend is pointing at the last bracket.
+		    ii = dend
+	            DO 113 i = dstart+1,dend
+		       IF ( name(i:i) .EQ. ',' ) THEN
+		          ii = i-1
+			  GOTO 115
+		       ENDIF
+ 113	            CONTINUE
+ 115		    CONTINUE
+		    dend = ii
+
+	            gdset = FIND_DSET_NUMBER( name(dstart:dend) )
+	            gdset_included = .TRUE.
+*33333333333333333
+	         ELSE
+	            gdset = dset
+	            gdset_included = .FALSE.
+*33333333333333333
+	         ENDIF
+* ... end of 7/95 additions
+* ... which variable (from which to borrow grid)?
+	         CALL FIND_VAR_NAME( gdset, name(:nend),
+     .                               category, variable )
+	         IF ( category .EQ. cat_pseudo_var ) GOTO 5055
+*33333333333333333
+	         IF ( variable .NE. munknown_var_name ) THEN
+	            grid = KNOWN_GRID(gdset,category,variable)
+		    cx_grid_needs_dset = .NOT.cx_dset_gvn( mods_cx )
+* ... 6/00 bug fix for syntax X[gx=var[d=dset]] -- look for [d=...]
+	            IF ( cx_grid_needs_dset )  cx_grid_needs_dset
+     .					       = .NOT.gdset_included
+* ... 6/01 bug fix for grid from uvar with self-contained data set 
+	            IF (cx_grid_needs_dset .AND. category.EQ.cat_user_var)
+     .			cx_grid_needs_dset = uvar_need_dset(variable)
+* ... 8/99 -- allow G=uvar where uvar may be unknown at this point
+		    IF ( grid     .EQ. unspecified_int4
+     .		   .AND. category .EQ. cat_user_var ) THEN	! g=??uvar??
+	              IF (cx_grid(mods_cx) .NE. unspecified_int4 .AND.
+     .                  naxes .GT. 1) THEN
+
+* ... 3/03 -- Have we already encoded start/end limits of the uvar name on a  
+*             previous reference to the same uvar?  Needed for [gxy=uvar]
+
+                         itest = unspecified_int4 - (equal_pos+1 + 2000*iend)
+                         IF (cx_grid(mods_cx) .NE. itest ) GOTO 5022
+                      ENDIF
+
+		      has_g_eq_unkn_uvar = .TRUE.
+*       HACK!: encode the start/end limits of the uvar name into the grid !!!
+		      cx_grid(mods_cx) = unspecified_int4
+     .				 - (equal_pos+1 + 2000*iend)
+		      IF (cx_has_impl_grid(mods_cx)) THEN
+*       A any previous gx= info becomes irrelevant
+	                 CALL INIT_GRID( cx_impl_grid(mods_cx),
+     .		                        '(implicit)', unspecified_int4 )
+		         cx_has_impl_grid(mods_cx) = .FALSE.
+			 cx_impl_grid(mods_cx) = unspecified_int4
+		         CALL DEALLO_GRID(status)
+			 IF (status .NE. ferr_ok) CALL ERRMSG
+     .				( ferr_internal, status, 'g=uvar', *5000) 
+	              ENDIF
+* ... end of 8/99
+	            ELSEIF ( single_char ) THEN	! g=name
+	               IF ( cx_grid(mods_cx) .NE. unspecified_int4
+     .	              .AND. cx_grid(mods_cx) .NE. grid ) GOTO 5022
+ 	               cx_grid( mods_cx ) = grid
+	            ELSEIF (.NOT.has_g_eq_unkn_uvar) THEN
+	               IF (.NOT.cx_has_impl_grid(mods_cx)) THEN
+	                  CALL ALLO_GRID_TO_CX(mods_cx,impl_grid,status)
+	                  IF ( status .NE. ferr_ok ) GOTO 5000
+	               ENDIF
+	               grid_line(idim,impl_grid) = grid_line(idim,grid)
+	            ENDIF
+*33333333333333333
+	         ELSEIF ( single_char ) THEN
+	            GOTO 5050		! (G=axis_name not allowed)
+*33333333333333333
+	         ELSE
+* ... as a last resort maybe it is an axis name (9/95)
+c	            axis = TM_GET_LINENUM( name(:nend) )
+	            axis = TM_GET_LINENUM( name(:name_end) )
+		    IF ( axis .EQ. unspecified_int4 ) THEN
+	               GOTO 5050	! final defeat
+	            ELSEIF ( TM_AXIS_DIRECTION(axis) .NE. idim
+     .		       .AND. TM_AXIS_DIRECTION(axis) .NE. 0 ) THEN	! 7/96
+	               GOTO 5052
+	            ELSEIF (.NOT.has_g_eq_unkn_uvar) THEN
+	               IF (.NOT.cx_has_impl_grid(mods_cx) ) THEN
+	                  CALL ALLO_GRID_TO_CX(mods_cx,impl_grid,status)
+	                  IF ( status .NE. ferr_ok ) GOTO 5000
+	               ENDIF
+	               grid_line(idim,impl_grid) = axis
+	            ENDIF
+*33333333333333333
+	         ENDIF
+	         cx_unstand_grid(mods_cx) = .TRUE.
+*22222222222222
+	      ENDIF
+*11111111111
+           ENDIF
+* ... explicit transformations given ?
+ 170	   IF ( atsin ) THEN
+	      IF ( namlen-atsin_pos .LT. 3 ) GOTO 5020		! 3+ char trans
+	      transnam = ' '
+ 	      vax_code = STR_UPCASE(transnam,name(atsin_pos+1:namlen))
+	      IF (cx_naux(mods_cx) .EQ. 0) THEN
+* ... identify the ordinary regridding transformation
+	         DO 180 itrans = 1, max_regrid_trans
+	            IF ( transnam .EQ. alg_regrid_code( itrans ) ) GOTO 182
+ 180		 CONTINUE
+	      ELSE
+* ... identify the auxiliary variable regridding transformation
+	         DO 181 itrans = max_regrid_trans+1, max_auxregrid_trans
+		    IF ( transnam .EQ. alg_regrid_code( itrans ) ) GOTO 182
+ 181		 CONTINUE
+	      ENDIF
+	      comment = '?? transform'
+	      GOTO 5020			! unknown regrid transform
+* ... trap (temporary?) for use of "@AVE" on auxiliary regridding
+ 182	      IF (itrans .EQ. pauxrgrd_average) THEN
+	         CALL WARN_OCCASIONALLY(
+     .		   'Box-averaging not available for auxiliary variable '//
+     .		   'regridding.'//pCR//
+     .		   '           Using @PLAVE instead, '//
+     .		   'e.g. gz(depth)=0:100 at plave', 10, 101)
+	         itrans = pauxrgrd_pwlave
+	      ENDIF
+              IF ( single_char ) THEN   ! apply transform to all axes
+                 DO 184 idim = 1, nferdims
+ 184             IF ( cx_regrid_trans(idim,mods_cx)
+     .           .EQ. unspecified_int4 ) cx_regrid_trans(idim,mods_cx)
+     .                                 = itrans
+              ELSE                      ! apply transform to specified axis
+                 cx_regrid_trans( idim, mods_cx ) = itrans
+              ENDIF
+!              cx_unstand_grid( mods_cx ) = .TRUE.
+	   ENDIF
+! this 201 branch is a hack to allow the syntax "gz(depth)=lo:hi at ave" to
+!     use the preceding code to read the transformation
+	   IF ( has_auxvar ) THEN
+	      IF (morph_gx_to_x(this_dim) ) GOTO 201 ! 1/2014
+	   ENDIF
+	   IF (.NOT.single_char) GOTO 105	! back for another axis
+	   GOTO 500
+
+* can't identify it
+ 190 	IF ( text_buff(istart:istart)
+     .		.EQ. '@') GOTO 500	! "/@anything" already processed
+	IF ( report_unknown ) THEN
+	   GOTO 5010			! unknown specifier is error
+	ELSE
+	   GOTO 500			! ignore unknown specifier
+	ENDIF
+
+* trap attempts to define the same axis region twice
+ 200	IF (.NOT.first_time(idim)) GOTO 5220
+	IF ( morph_gx_to_x(idim) ) GOTO 5200
+
+* specified by value or subscript ?
+ 201	cx_by_ss( idim, mods_cx ) = suborval .EQ. 1
+
+* syntax check: look for "=", ":" and "@"
+* ... "="
+	equal_pos = ATOM_POS( text_buff(istart:iend), '=' )
+	IF ( equal_pos .EQ. atom_not_found   ) GOTO 500	 ! ignore "/Q" w/out "="
+	IF ( equal_pos .EQ. atom_illegal_pos ) GOTO 5010
+	equal_pos = equal_pos + istart - 1
+
+* ... find first non-blank following "="
+	DO 250 lo_start = equal_pos+1, iend
+	   IF ( text_buff(lo_start:lo_start) .NE. ' '
+     .	  .AND. text_buff(lo_start:lo_start) .NE. tab ) GOTO 260
+ 250	CONTINUE
+	GOTO 5010		! just "X=" and nothing more
+
+* ... "@"
+ 260	atsin_pos = ATOM_POS( text_buff(istart:iend), '@' )
+	IF ( atsin_pos .EQ. atom_illegal_pos ) GOTO 5130
+	atsin	  = atsin_pos .NE. atom_not_found
+	atsin_pos = atsin_pos + istart - 1
+	IF ( atsin_pos + 3 .GT. iend ) GOTO 5130
+	IF ( atsin ) THEN
+	   del_end = atsin_pos - 1
+	ELSE
+	   del_end = iend
+	ENDIF
+
+* ... ":"
+	colon_pos = ATOM_POS( text_buff( istart:del_end ), ':' )
+	IF ( colon_pos .EQ. atom_illegal_pos ) GOTO 5140
+	colon  = colon_pos .NE. atom_not_found
+	IF ( colon ) THEN
+	   colon_pos = colon_pos + istart - 1
+	   lo_end	 = colon_pos - 1
+	ELSE
+	   colon2	 = .FALSE.
+	   lo_end	 = del_end
+	ENDIF
+
+*  ... second ":"
+	IF ( colon ) THEN
+	   colon2_pos = ATOM_POS(text_buff( colon_pos+1:del_end ), ':' )
+	   IF ( colon2_pos .EQ. atom_illegal_pos
+     .	   .OR. colon2_pos .EQ. 1		 ) GOTO 5150
+	   colon2 = colon2_pos .NE. atom_not_found
+	   IF ( colon2 ) THEN
+	      colon2_pos = colon2_pos + colon_pos
+	      hi_end     = colon2_pos - 1
+	     IF (INDEX(text_buff(colon2_pos+1:del_end),':').GT.0)
+     .							GOTO 5150
+	   ELSE
+	      hi_end     = del_end
+	   ENDIF
+	   hi_start	 = colon_pos + 1
+	   del_start	 = colon2_pos + 1
+	ENDIF
+
+*  ... GX=lo:hi is legal ONLY with a delta supplied
+	IF ( morph_gx_to_x(idim) ) THEN
+	    IF ( has_auxvar ) THEN
+*         GZ(depth)=pt and gz(depth)=lo:hi at plave are allowed.
+*         GZ(depth)=lo:hi is not allowed
+             IF (colon .AND. .NOT.colon2 .AND. .NOT.atsin) GOTO 5210
+	    ELSE
+	      IF (.NOT.colon2)				   GOTO 5210
+	    ENDIF
+	ENDIF
+
+* ... ":" following @ (as in @SHF:-1) ?
+	IF ( atsin ) THEN
+	   atcolon_pos = ATOM_POS( text_buff(atsin_pos+1:iend), ':' )
+	   IF ( atcolon_pos .EQ. atom_illegal_pos ) GOTO 5160
+	   atcolon = atcolon_pos .NE. atom_not_found
+	   IF ( atcolon ) atcolon_pos = atcolon_pos + atsin_pos
+	ELSE
+	   atcolon = .FALSE.
+	ENDIF
+
+* make allowances for quotation marks here and there (kludge!)
+* watch for empty strings! (10/95)
+	IF ( text_buff(lo_start:lo_start) .EQ. '"' ) lo_start = lo_start + 1
+	IF ( text_buff(lo_end  :lo_end  ) .EQ. '"' ) lo_end   = lo_end   - 1
+	IF ( colon ) THEN
+	   IF ( text_buff(hi_start:hi_start) .EQ. '"' ) hi_start = hi_start + 1
+	   IF ( text_buff(hi_end  :hi_end  ) .EQ. '"' ) hi_end   = hi_end   - 1
+	   IF ( hi_start .GT. hi_end ) GOTO 5165
+	ENDIF
+	IF ( colon2 ) THEN
+	   IF (text_buff(del_start:del_start) .EQ. '"') del_start = del_start+1
+	   IF (text_buff(del_end  :del_end  ) .EQ. '"') del_end   = del_end  -1
+	   IF ( del_start .GT. del_end ) GOTO 5165
+	ENDIF
+
+* two specifications of region in same block of region info?
+        IF ( .NOT.first_time(idim) ) THEN  ! 2/23/92
+	   GOTO 5220
+        ELSEIF ( .NOT.set_implicitly(idim) ) THEN  ! 8/92 modified 2/23/92
+* ... initialize this dimension if it's the first reference to it
+	   cx_given ( idim, mods_cx ) = .TRUE.
+	   cx_delta ( idim, mods_cx ) =  unspecified_val8
+        ENDIF
+
+*  See if we can find out the calendar, if grid/axis is known
+        IF (cal_id .EQ. 0) THEN
+           IF (grid .EQ. unspecified_int4  .AND.  
+     .	       axis .EQ. unspecified_int4)  THEN 
+              cal_id = 1
+	   ELSE
+	      IF (axis .EQ. unspecified_int4) axis = grid_line(t_dim, grid)
+	      cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+	   ENDIF
+	ENDIF
+
+* is there a first value given ?
+	IF ( lo_start .GT. lo_end ) THEN
+	   fmat_lo = .FALSE.
+	ELSE
+	   CALL TRANSLATE_LIMIT
+     .		      ( text_buff(lo_start:lo_end), idim,
+     .			cx_by_ss( idim, mods_cx ),
+     .			cx_lo_ww ( idim, mods_cx ),
+     .			fmat_lo, cal_id, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+
+* ACM 11/04 save calendar used to compute world coordinates
+           IF (idim .EQ. t_dim .OR. idim .EQ. f_dim) cx_cal_id(mods_cx) = cal_id
+
+* kob 8/97 - set cx_calender to true/false depending on whether date is
+*            a formated string or not
+	   IF (idim .EQ. t_dim .OR. idim .EQ. f_dim) cx_calendar(mods_cx) = fmat_lo
+	ENDIF
+
+* is there a second value given ?
+	IF ( colon ) THEN
+	   CALL TRANSLATE_LIMIT
+     .		      ( text_buff(hi_start:hi_end), idim,
+     .			cx_by_ss( idim, mods_cx ),
+     .			cx_hi_ww ( idim, mods_cx ),
+     .			fmat_hi, cal_id, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+* ... formatted longitudes: add 360 degrees if necessary
+	   IF ( idim .EQ. x_dim
+     .	 .AND.  ( fmat_hi .OR. fmat_lo )
+     .   .AND.  cx_hi_ww(idim,mods_cx) .LE. 
+     .				cx_lo_ww(idim,mods_cx) ) THEN
+	      IF ( cx_hi_ww(idim,mods_cx) .LE. 
+     .				cx_lo_ww(idim,mods_cx) - 360.D0 ) THEN
+	         GOTO 5030
+	      ELSE
+	         cx_hi_ww(idim,mods_cx)
+     .			 = cx_hi_ww( idim, mods_cx ) + 360.D0
+	      ENDIF
+	   ENDIF
+!	ELSEIF ( first_time(idim) ) THEN   ! 8/92 ELSE --> ELSEIF
+	ELSEIF ( lo_start .LE. lo_end ) THEN ! replaced 8/92 check 2/23/96
+! ... 2/23/96 set hi=lo iff a lo value, only, was just given
+	   cx_hi_ww( idim, mods_cx ) = cx_lo_ww( idim, mods_cx )
+	   fmat_hi = fmat_lo
+	ENDIF	
+
+* save the formatting information (12/99)
+	cx_formatted(idim) = fmat_lo .OR. fmat_hi
+	
+* is there a third value given ?  (possibly implying a dynamic axis)
+	IF ( colon2 ) THEN
+	   CALL TRANSLATE_LIMIT
+     .		      ( text_buff(del_start:del_end), idim,
+     .			cx_by_ss( idim, mods_cx ),
+     .			cx_delta   ( idim, mods_cx ),
+     .			logical_dummy, cal_id, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+
+* get the dynamic regridding transformation, e.g. x=lo:hi:del at tran
+	   IF ( atsin .AND. .NOT.has_auxvar ) THEN
+	      comment = '?? transform'
+	      risc_buff = text_buff(atsin_pos:atsin_pos+3)
+	      len_rbuff = 4
+	      DO 300 itrans = 1, max_regrid_trans
+	         vax_code = STR_CASE_BLIND_COMPARE(
+     .				text_buff( atsin_pos+1:atsin_pos+3 ) ,
+     .				alg_regrid_code(itrans)		) 
+	      IF ( vax_code .EQ. vms_str_success )GOTO 310
+ 300	      CONTINUE
+	      GOTO 5020			! unknown regridding transformation
+ 310	      cx_regrid_trans(idim,mods_cx) = itrans
+	   ENDIF
+
+	ELSE
+* get the axis transformation, e.g. x=lo:hi at tran
+* ... but not gz(depth)=0:100 at ave, which was handled as an aux var regrid
+	   IF ( atsin .AND. .NOT.has_auxvar) THEN
+	      DO 320 itrans = 1, num_transforms
+	         vax_code = STR_CASE_BLIND_COMPARE(
+     .				text_buff( atsin_pos+1:atsin_pos+3 ) ,
+     .				alg_trans_text( itrans )		) 
+	      IF ( vax_code .EQ. vms_str_success )GOTO 330
+ 320	      CONTINUE
+	      GOTO 5170	! unknown transformation
+ 330	      cx_trans( idim, mods_cx ) = alg_trans_num( itrans )
+!	   ELSEIF ( first_time(idim) ) THEN   ! 8/92 set default first time
+	   ELSE				      ! replaced 8/92 check 2/23/96
+	      cx_trans( idim, mods_cx ) = trans_no_transform
+	   ENDIF
+
+* get the argument for the transformation, if given
+	   IF ( atcolon ) THEN
+	      buff = text_buff(atcolon_pos+1:iend)
+	      READ ( buff,* , ERR=5180 ) cx_trans_arg( idim, mods_cx )
+	   ENDIF
+
+* make sure the argument - explicit or implicit - is correct
+	   IF ( atsin ) THEN
+	      CALL DFLT_TRANS_ARG( idim, mods_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5035
+	   ENDIF
+	ENDIF
+	
+* 12/13
+* interpret gz(depth)=100 (a point) as a regrid to a dynamic axis of length 1
+* similarly gz(depth)=0:100 at ave is an implied regrid to a single point axis
+	IF (has_auxvar) THEN
+* ... identify the axis being regridding in this qualifier
+	  DO rgdim = 1, nferdims
+	     IF (cx_g_eq_regrid(rgdim)) THEN
+	        IF (rgdim .NE. z_dim) CYCLE  ! ignore all axes but Z
+* set up for dynamic axis by inserting a special cx_delta signal
+	        IF (cx_lo_ww(z_dim,mods_cx) .EQ. unspecified_val8) CYCLE
+	        IF (cx_delta(z_dim,mods_cx) .NE. unspecified_val8) CYCLE
+	        IF (cx_lo_ww(z_dim,mods_cx) .EQ. cx_hi_ww(z_dim,mods_cx)
+     .	       .OR. cx_regrid_trans(z_dim,mods_cx) .EQ. pauxrgrd_pwlave)
+     .					cx_delta(z_dim,mods_cx) = pauto_1pt_ax
+	     ENDIF
+	   ENDDO
+	ENDIF
+
+* make sure low limit is less than high
+* ... date strings: stored negatively as seconds since BC
+* 8/97 *kob* check cx_calendar rather than if fmat_hi or fmat_lo is set to 
+*            see if time is a date
+
+* 11/03 *acm* Why do we swap the limits when hi > lo?  This means that
+*             repeat/i=3:1:1 executes the same as repeat/i=1:3:1 and
+*             list var[i=180:10:10] the same as list var[i=10:180:10]
+
+	IF (  (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. cx_calendar(mods_cx) ) THEN
+	   IF ( cx_hi_ww(idim,mods_cx) .GT. 
+     .				cx_lo_ww(idim,mods_cx) ) THEN
+	      temp = cx_lo_ww( idim, mods_cx )
+	      cx_lo_ww( idim, mods_cx ) = cx_hi_ww( idim, mods_cx )
+	      cx_hi_ww( idim, mods_cx ) = temp
+	   ENDIF
+* ... all other limits
+	ELSEIF ( cx_hi_ww(idim,mods_cx) .LT. 
+     .				cx_lo_ww(idim,mods_cx) ) THEN
+	   temp = cx_lo_ww( idim, mods_cx )
+	   cx_lo_ww( idim, mods_cx ) = cx_hi_ww( idim, mods_cx )
+	   cx_hi_ww( idim, mods_cx ) = temp
+	ENDIF
+
+* if coordinates were given by subscript check 'em and convert 'em
+	IF ( cx_by_ss( idim, mods_cx )
+     . .AND. cx_lo_ww(idim,mods_cx) .NE. unspecified_val8 ) THEN
+	   IF ( INVALID_R8_TO_I4( cx_lo_ww( idim, mods_cx ) )
+     .	.OR. INVALID_R8_TO_I4( cx_hi_ww(idim,mods_cx) )) GOTO 5030
+	   IF ( cx_delta( idim, mods_cx ) .NE. unspecified_val8
+     .	.AND.INVALID_R8_TO_I4( cx_delta  (idim,mods_cx) )) GOTO 5030
+	   cx_lo_ss(mods_cx,idim) = NINT( cx_lo_ww(idim,mods_cx) )
+	   cx_hi_ss(mods_cx,idim) = NINT( cx_hi_ww(idim,mods_cx) )
+	   cx_lo_ww( idim, mods_cx ) = unspecified_val8
+	   cx_hi_ww( idim, mods_cx ) = unspecified_val8
+* 9/97 *kob* cx_calendar must reflect these changes as well	  
+	   IF (idim .EQ. t_dim .OR. idim .EQ. f_dim) 
+     .                cx_calendar(mods_cx) = .FALSE.
+	ENDIF
+
+* SPECIAL CASES for individual axes
+* ... @AAV given explicitly
+	IF (  cx_trans(idim,mods_cx) .EQ. trans_4d_ave
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_4d_int_def
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_4d_good_pt
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_4d_bad_pt
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_4d_sum
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_4d_var
+     .  .OR.  cx_trans(idim,mods_cx) .EQ. trans_reduced ) GOTO 5190
+
+* flag this dimension as specified (8/92)
+        first_time(idim) = .FALSE.
+
+500	CONTINUE
+
+* SPECIAL CASES for entire context
+* If a grid qualifiers wer given then a grid name from at least 1 was mandatory
+        IF ( cx_unstand_grid(mods_cx)
+     . .AND. .NOT.cx_has_impl_grid(mods_cx)
+     . .AND. cx_grid(mods_cx) .EQ. unspecified_int4 ) GOTO 5024
+
+* @AVE or @DIN applied to both X and Y performed as a 2D integral (for COSINE
+* factors) 
+* 7/96: average, variance, def. int, ngd, and nbg may be 2, 3, or 4D calcs
+*     substitute the 4D transform for the one specified
+	DO 610 i = 1, num_4d_trans
+	   other = 0
+	   DO 600 idim = 1, nferdims	   
+	      IF ( cx_trans(idim,mods_cx) .EQ. alg_1d_to_4d(i) ) THEN
+	         IF ( other .EQ. 0 ) THEN
+	            other = idim		! found 1 axis
+	         ELSE
+	            cx_trans(other,mods_cx) = alg_4d_trans(i)
+	            cx_trans( idim,mods_cx) = alg_4d_trans(i)
+	         ENDIF
+	      ENDIF
+ 600	   CONTINUE
+ 610	CONTINUE
+
+* same is true for indefinite integrals but never been used yet ...
+	IF (  cx_trans(x_dim,mods_cx) .EQ. trans_integ_indef
+     .	.AND. cx_trans(y_dim,mods_cx) .EQ. trans_integ_indef )
+     .		CALL SPLIT_LIST(pttmode_bull, ttout_lun, 
+     .		' @IIN on X and @IIN on Y computed as 1D integrals', 49)
+
+	status = ferr_ok
+	RETURN
+
+* error exits
+* ... clear implicit grids so axes within them don't get deallocated
+ 5000	IF (cx_has_impl_grid(mods_cx)) CALL INIT_GRID(
+     .		cx_impl_grid(mods_cx), '(implicit)',
+     .          unspecified_int4 )
+	RETURN
+ 5010	CALL ERRMSG( ferr_syntax, status, risc_buff(:len_rbuff), *5000 )
+ 5015	risc_buff = text_buff(istart-1:iend)		! for RISC/FORTRAN
+	len_rbuff = MIN(48, iend-istart)		! for RISC/FORTRAN
+ 	CALL ERRMSG( ferr_syntax, status,
+     .		'incomplete specification: '//risc_buff(:len_rbuff), *5000 )
+ 5020	CALL ERRMSG( ferr_regrid, status,
+     .		risc_buff(:len_rbuff)//' : '//comment,*5000 )
+ 5022	CALL ERRMSG( ferr_regrid, status,
+     .		risc_buff(:len_rbuff)//' - more than 1 target grid',
+     .          *5000 )
+ 5024	CALL ERRMSG( ferr_regrid, status, 'no target grid specified',
+     .          *5000 )
+ 5030	CALL ERRMSG
+     .		( ferr_out_of_range, status, risc_buff(:len_rbuff), *5000 )
+ 5035	CALL ERRMSG
+     .		( status, status, risc_buff(:len_rbuff), *5000 )
+ 5040	CALL ERRMSG
+     .		( ferr_unknown_data_set, status, risc_buff(:len_rbuff), *5000 )
+ 5050	CALL ERRMSG
+     .		( ferr_unknown_grid, status, risc_buff(:len_rbuff), *5000 )
+ 5052	CALL ERRMSG
+     .		( ferr_regrid, status,
+     .		'Axis orientation not matching request:'//
+     .		risc_buff(:len_rbuff), *5000 )
+ 5055	CALL ERRMSG( ferr_unknown_grid, status,	risc_buff(:len_rbuff)//
+     .			' --> g=user-or-pseudo-var not allowed', *5000 )
+ 5056	CALL ERRMSG( ferr_syntax, status, 
+     .	 'invalid nested brackets: '//risc_buff(:len_rbuff),*5000)
+ 5060	CALL ERRMSG( ferr_invalid_command, status, 
+     .	 'use @SHF only with IJK or L: '//risc_buff(:len_rbuff),*5000)
+ 5100	CALL ERRMSG( ferr_syntax, status, 
+     .	 'unknown region name: '//risc_buff(:len_rbuff),*5000)
+ 5110	CALL ERRMSG( ferr_syntax, status, 
+     .	 'What data set ?: '//risc_buff(:len_rbuff),*5000)
+ 5112	CALL ERRMSG( ferr_syntax, status, 
+     .	 'What calendar ?: '//risc_buff(:len_rbuff),*5000)
+ 5120	CALL ERRMSG( ferr_syntax, status, 
+     .	 'What grid ?: '//risc_buff(:len_rbuff),*5000)
+ 5130   CALL ERRMSG( ferr_syntax, status, 
+     .	 risc_buff(:len_rbuff)//pCR//
+     .	'"@" must precede a valid transformation like "Z=0:50 at AVE"'
+     .	//pCR//'Use SHOW TRANSFORMS for a list of legal transformations',
+     .  *5000)
+ 5140	CALL ERRMSG( ferr_syntax, status, 
+     .	 risc_buff(:len_rbuff)//pCR//
+     .	'":" is used incorrectly. A correct example is "Z=0:50".' ,*5000)
+ 5150	CALL ERRMSG( ferr_syntax, status, 
+     .	 risc_buff(:len_rbuff)//pCR//
+     .	'":" is used incorrectly. A correct example is "L=1:100:10".',
+     .	*5000)
+ 5160	CALL ERRMSG( ferr_syntax, status, 
+     .	 risc_buff(:len_rbuff)//pCR//
+     .	'":" is used incorrectly. A correct example is "L=@SBX:5".',
+     .	*5000)
+ 5165	CALL ERRMSG( ferr_syntax, status, risc_buff(:len_rbuff), *5000)
+ 5170   CALL ERRMSG( ferr_syntax, status, 
+     .	 'Unknown transformation:'//risc_buff(:len_rbuff)//pCR//
+     .	 'Use SHOW TRANSFORMS for a list of legal transformations',
+     .  *5000)
+ 5180	CALL ERRMSG( ferr_syntax, status, 
+     .	 'Invalid transformation argument:'//risc_buff(:len_rbuff),
+     .	*5000)
+ 5190	CALL ERRMSG( ferr_syntax, status, 
+     .	 'transformation reserved for FERRET internal use:'//pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5200	CALL ERRMSG( ferr_syntax, status, 
+     .	'used GX=lo:hi:delta with X=lo:hi (ditto for Y,Z, or T)'
+     .	 //pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5205	CALL ERRMSG( ferr_syntax, status, 
+     .	'lo:hi:delta must be given separately for each axis' //pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5210	CALL ERRMSG( ferr_syntax, status, 
+     .	'GX=lo:hi:delta with no delta (or ditto for Y,Z, or T)'
+     .	 //pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5220	CALL ERRMSG( ferr_syntax, status, 
+     .	'multiple specifications on '//ww_dim_name(idim)//' axis'
+     .	 //pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5300	CALL ERRMSG( ferr_syntax, status, 
+     .  name(:TM_LENSTR1(name))//' regrid of style gz(depth)=zax'
+     .	 //pCR//
+     .	 risc_buff(:len_rbuff), *5000)
+ 5400	CALL ERRMSG( ferr_internal, status, 
+     .  'get_context_mods logic corrptn', *5000)
+	END
diff --git a/fer/gnl/get_dataset_name.F b/fer/gnl/get_dataset_name.F
new file mode 100644
index 0000000..e006320
--- /dev/null
+++ b/fer/gnl/get_dataset_name.F
@@ -0,0 +1,107 @@
+
+
+        SUBROUTINE GET_DATASET_NAME_FROM_BROWSER(status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the name of a dataset for a SET DATA /BROWSE command
+*
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+
+        INTEGER status
+
+	include 'tmap_dims.parm'
+        include 'errmsg.parm'
+        include 'ferret.parm'
+        include 'slash.parm'
+        include 'xprog_state.cmn'
+
+	LOGICAL do_jnl
+        INTEGER RUN_THREDDS_BROWSER, TM_LENSTR,
+     .          len_name, buff_len, loc
+        CHARACTER*512 dataset_name
+        CHARACTER*2048 err_warn_msg
+
+	do_jnl = mode_journal .AND. jrnl_lun.NE.unspecified_int4 
+
+* Run the browser to get the dataset name
+        dataset_name = ' '
+        err_warn_msg = ' '
+        len_name = RUN_THREDDS_BROWSER(dataset_name, err_warn_msg)
+
+* Check if there was an error running the browser
+        IF ( len_name .LT. 0 ) THEN
+            IF (do_jnl) CALL SPLIT_LIST(pttmode_ops, jrnl_lun, 
+     .                      '!-> **ERROR**', 0)
+            CALL SPLIT_LIST(pttmode_ops, ttout_lun, 
+     .                      '!-> **ERROR**', 0)
+            CALL SPLIT_LIST(pttmode_ops, err_lun, err_warn_msg, 0)
+            status = ferr_erreq
+            RETURN
+        ENDIF
+
+* Check if the user canceled out
+        IF ( len_name .EQ. 0 ) THEN
+            IF (do_jnl) CALL SPLIT_LIST(pttmode_ops, jrnl_lun, 
+     .                      '!-> **CANCEL**', 0)
+            CALL SPLIT_LIST(pttmode_ops, ttout_lun, 
+     .                      '!-> **CANCEL**', 0)
+            status = ferr_erreq
+            RETURN
+        ENDIF
+
+* Append the dataset name obtained
+        buff_len = TM_LENSTR(cmnd_buff)
+        cmnd_buff(buff_len+1:) = ' "' // dataset_name(1:len_name) // '"'
+        num_items = num_items + 1
+        item_start(num_items) = buff_len + 3
+        item_end(num_items) = item_start(num_items) + len_name - 1
+
+* Blank out the /BROWSE option to make a nicer message printed to stdout and the journal
+        loc = qual_given(slash_set_data_browse)
+        IF ( loc .GT. 0 ) THEN
+            cmnd_buff(qual_start(loc)-1:qual_end(loc)) = ' '
+        ENDIF
+
+* Include the quotes in the filename printed to stdout and the journal
+        IF (do_jnl) CALL SPLIT_LIST(pttmode_ops, jrnl_lun, 
+     .                  '!-> ' // cmnd_buff, 0)
+        CALL SPLIT_LIST(pttmode_ops, ttout_lun, 
+     .                  '!-> ' // cmnd_buff, 0)
+
+        status = ferr_ok
+        RETURN
+
+        END
diff --git a/fer/gnl/get_fer_command.F b/fer/gnl/get_fer_command.F
new file mode 100644
index 0000000..c03c359
--- /dev/null
+++ b/fer/gnl/get_fer_command.F
@@ -0,0 +1,324 @@
+	SUBROUTINE GET_FER_COMMAND( memory, called_string, status, * )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* renamed to GET_FER_COMMAND for gfortran build, which has a call, "GET_COMMAND"
+*
+* get next command line and decode it placing information in COMMON
+* source of command may be calling argument string, operator, command file,
+* or internal macro command (e.g. REPEAT or semicolon command group)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/26/86
+* revision 0.1 - 3/4/87  - changed /star to /@
+* revision 1.0 - 4/30/87 - allowed for control by CS (control stack)
+* revision 1.1 - 8/11/87 - changer ^Z treatment from keyboard
+* revision 1.2 - 9/14/87 - added SMG_ routines for VMS line recall
+* revision 1.3 - 11/30/87- interrupt handling
+* revision 1.4 - 2/25/88 - corrected bug in EOF on non-keyboard input
+* revision 1.5 - 1/24/89 - allow for interrupts of PPLUS operations
+* revision 1.6 - 2/2/89  - check to see if journal file exists
+* V200:   2/8/90 - left justify text
+* Unix/RISC port - 1/91 - cant use "/star" in documentation
+*			- also ifdef'ed the VMS line recall routines
+* V230:  1/27/92 - replaced double ^D exit with Unix-like "q" (QUIT)
+*        8/26/92 - interpret command beginning with "?" as "HELP"
+* V300:   2/2/93 - implemented semicolon-separated command groups
+*	  5/6/93 - implemented "$" command arguments
+*	 6/16/93 - added mode_gui input
+* V301:  2/24/94 - small change due to mode_arg as a 2D variable
+*	 3/14/94 - under mode refresh (xwindows) tweak the X event loop before 
+*		   each new command (important under GO control)
+* V313: 31/10/94 - on AIX systems the output jrnl_lun buffer must be flushed.
+*			... dont know why ...
+* V320:  5/19/94 - accept calling argument string (from GUI control program)
+*	 	   cleanup from last command removed to CLEANUP_LAST_CMND
+* 	10/24/94 - abnormal return when command file finishes in mode_gui
+*       12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/18/95 - added MODE VERIFY:ALWAYS
+*		 - and double EOF from the command line is a QUIT (else
+*			redirected command files go into a loop)
+*        2/24/95 - send GUI output to journal fiie
+* V400: 3/20/95 - pass "memory" to parse_command for preliminary pass in which
+*		  grave accent expressions are evaluated
+* V420:  3/8/96 - add FLUSH on Solaris to keep the journal file up to date
+*	4/28/96 - call PROCESS_IF for multi-line IF's
+
+* v500: 5/24/99 *kob* - Have to insert call to NAG F90_UNIX module in
+*                       order to use the Fortan Flush.  USE command has
+*                       to come right after subroutine name
+*     : 5/34/99 *kob* - call FLUSH for all systems
+* V530: *sh* 1/01 - suppress verify output during skipped IF lines 
+*       *sh* 3/01 - do not call PARSE_COMMA_LIST if arg1 quoted
+* V531: *sh* 4/01 - chenge prompt for continuation line
+*	*sh* 5/01 - ignore DOS carriage returns in journal files
+* *kob* 2/03 - replace call to intrinsic func CHAR with its octal
+*              constant equivalent - needed for g77 port
+* *kob* 4/06 - back off my_readline call - needed for 64-bit port
+* v603 *acm* 5/07 Housekeeping: initialize arg_start and arg_end
+*                 before call to parse_command
+* V6.7 *kms* 8/11 add check for one-command mode before prompting
+*                 user for the next command
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V690 *sh* 2/14 initialize max_context, now a variable to support aux vars
+
+#ifdef MIXING_NAG_F90_AND_C
+	USE F90_UNIX
+#endif
+
+* calling argument declarations:
+	INTEGER		status
+	REAL		memory(*)
+	CHARACTER*(*)	called_string
+
+* internal variable declarations:
+	LOGICAL re_verify, do_verify, prefix_verify, arg1_quoted
+	INTEGER	TM_LENSTR, TM_LENSTR1,
+     .		iqual, ilist, cmnd_len, double_eof,
+     .          has_more, i
+
+        CHARACTER*1 backslash
+#ifdef NO_INTRINSIC_IN_PARAMETER
+        PARAMETER ( backslash = o'134' )
+#else
+        PARAMETER ( backslash = char(92) )
+#endif
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xcontrol.cmn'
+	include 'xinterrupt.cmn'
+	include 'xcontext.cmn'
+	include 'xgui.cmn'
+
+* initialize
+	gui_status = ferr_ok	! start w/ a clean bill o' health
+	double_eof = 0
+	max_context = max_noframe_context  ! 2/2014
+
+* if a command was given then execute it immediately
+	IF ( called_string .NE. ' ' ) THEN
+	   cmnd_buff = called_string
+	   cmnd_len = TM_LENSTR( cmnd_buff )
+	   IF (   mode_journal
+     .	    .AND. jrnl_lun .NE. unspecified_int4
+     .	    .AND. cmnd_len .GT. 0
+     .	    .AND. cmnd_buff(1:1) .NE. backslash ) then
+	      WRITE (jrnl_lun,'(A)') cmnd_buff(1:cmnd_len)
+
+* *kob* 5/99 - Flush buffer
+	      CALL FLUSH(jrnl_lun)
+
+	   ENDIF
+	   GOTO 1000
+	ENDIF
+
+* select source for input
+* If in one-command mode but asking to prompt user for the next
+* command, then we got here from reaching the end of a go file
+* or a multi-command line.  So return to the first alternative
+* since the user is never prompted by ferret in one-command mode.
+ 20     IF ( one_cmnd_mode .AND. (input_source .EQ. 1) ) THEN
+           RETURN 1
+        ENDIF
+        GOTO (100,200,300) input_source
+
+
+
+************** OPERATOR AS SOURCE OF COMMAND LINE ****************************
+
+ 100	IF (mode_gui) THEN
+
+* operator using mouse input device
+	   CALL MOUSE_COMMAND (cmnd_buff)
+	   cmnd_len = TM_LENSTR( cmnd_buff )
+
+	ELSE
+* operator sitting at his keyboard
+!	   WRITE (ttout_lun,3000) prompt(1:prompt_len)
+! 3000	   FORMAT (1X,A,$)	! vms
+! 3000	   FORMAT (A,$)         ! unix
+!	   READ  ( ttin_lun,'(A)',END=2000 ) cmnd_buff
+!	   cmnd_len = TM_LENSTR( cmnd_buff )
+
+! check for multiple ^D's from the keyboard (or EOF on stdin redirect)
+	   double_eof = double_eof + 1
+	   IF (double_eof .GT. 2) STOP       ! 1/18/95
+
+* ... gnu readline with a FORTRAN jacket
+	   IF ( has_continuation_cmnd ) THEN
+              CALL TM_FRIENDLY_READ('...? ',cmnd_buff,*20)
+	   ELSE
+              CALL TM_FRIENDLY_READ(prompt(:prompt_len),cmnd_buff,*20)
+	   ENDIF
+	   cmnd_len = TM_LENSTR( cmnd_buff )
+	   double_eof = 0	! in case comment or blank line returns here
+
+	ENDIF
+
+* echo command line to journal file
+
+	IF (   mode_journal
+     .	 .AND. jrnl_lun .NE. unspecified_int4
+     .	 .AND. cmnd_len .GT. 0
+     .	 .AND. cmnd_buff(1:1) .NE. backslash ) then
+	   WRITE (jrnl_lun,'(A)') cmnd_buff(1:cmnd_len)
+
+* *kob* 5/99 - Flush buffer
+	   CALL FLUSH(jrnl_lun)
+	      
+	ENDIF
+	do_verify = .FALSE.
+	GOTO 1000
+
+*************** COMMAND FILE AS SOURCE OF COMMAND LINE ***********************
+
+ 200	READ  (cmnd_lun, '(A)', END=210) cmnd_buff
+c 200	CALL my_readline(cmnd_lun,cmnd_buff,LEN(cmnd_buff),has_more)
+c        IF(has_more.NE.1) goto 210
+
+	cmnd_len = TM_LENSTR1( cmnd_buff )
+	IF (cmnd_buff(cmnd_len:cmnd_len) .EQ. pCR ) THEN
+	    cmnd_buff(cmnd_len:cmnd_len) = ' '
+	    IF (cmnd_len .GT. 1) cmnd_len = cmnd_len - 1
+	ENDIF
+        IF ( cmnd_buff(1:1) .EQ. backslash ) THEN
+           cmnd_buff(1:1) = ' '
+	   do_verify = .FALSE.
+        ELSE
+	   do_verify = mode_verify
+        ENDIF
+	prefix_verify = .FALSE.
+	GOTO 1000
+* end of command file - return to next lower control stack level
+ 210	CALL POP_CS
+	IF ( csp.EQ.0 .AND. mode_gui ) THEN		! GUI code ...
+	   gui_status = ferr_ok	! a clean bill o' health at GO termination
+	   RETURN 1
+	ELSE
+*          Consider an update of the graphics
+           CALL FGD_CONSIDER_UPDATE(.FALSE.)
+	   GOTO 20
+	ENDIF
+
+*************** COMMAND STACK AS SOURCE OF COMMAND LINE ***********************
+
+ 300	CALL CS_COMMAND( cmnd_buff, *20 )
+	cmnd_len = TM_LENSTR1( cmnd_buff )
+	do_verify =  mode_verify .AND. mode_arg(pmode_verify,1).GE.2
+	prefix_verify = .TRUE.
+
+*********** POSSIBLY SKIP COMMAND UNDER IF CONTROL (4/96) ********************
+ 1000	IF (if_conditional) CALL PROCESS_IF(cmnd_buff, cmnd_len, *20)
+
+*********** ECHO THE COMMAND ****************************
+	IF (do_verify) THEN
+	   IF (prefix_verify) THEN
+	      CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .			' !-> '//cmnd_buff, cmnd_len+5 )
+	   ELSE
+	      CALL SPLIT_LIST(pttmode_ops, ttout_lun, cmnd_buff, cmnd_len)
+	   ENDIF
+	ENDIF
+
+*********** LEFT JUSTIFY THE COMMAND  ********************
+	IF ( .NOT.has_continuation_cmnd ) THEN
+	   CALL LEFT_JUST( cmnd_buff, cmnd_buff, cmnd_len )
+           IF ( cmnd_buff(1:1) .EQ. '?' ) THEN   ! should be an ALIAS!!
+	      cmnd_buff = 'HELP'    ! 8/92
+	      cmnd_len = 4
+	   ENDIF
+	ENDIF
+
+*************** DECODE THE COMMAND LINE ***************************************
+
+        DO 400 i = 1, max_arg_list
+           arg_start(i) = 0
+           arg_end(i) = 0
+ 400    CONTINUE
+
+	CALL PARSE_COMMAND ( memory, cmnd_buff,
+     .			     max_arg_list, max_qual_list,
+     .			     len_cmnd, cmnd_num, subcmnd_num, 
+     .			     num_qualifiers, qualifier_list,
+     .			     qual_start, qual_end,
+     .			     num_args, arg_start, arg_end,
+     .			     err_lun, re_verify, arg1_quoted, status	)
+	IF ( status   .NE. ferr_ok ) RETURN 1	! messages already displayed
+	IF ( cmnd_num .EQ. 0 ) GOTO 20
+	IF ( re_verify ) THEN
+	   cmnd_len = TM_LENSTR1( cmnd_buff )
+	   IF ( mode_verify ) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .					' !-> '//cmnd_buff, cmnd_len+5 )
+	ENDIF
+
+*************** PROCESS SEMICOLON-SEPARATED COMMAND GROUPS ********************
+        IF ( cmnd_num .EQ. cmnd_semicolon )
+     .       CALL CS_SEMICOLON( cmnd_buff, *20)
+
+*************** REORGANIZE LIST OF QUALIFIERS GIVEN TO INTERNAL ORDER   ********
+
+	DO 1010 iqual = 1, max_qual_list
+ 1010	qual_given( iqual ) = 0
+	DO 1020 ilist = 1, num_qualifiers
+	   IF ( cmnd_buff( qual_start(ilist):qual_start(ilist) ) .NE. '@' )
+     .				qual_given( qualifier_list( ilist ) ) = ilist
+ 1020	CONTINUE
+
+*************** BREAK APART ITEMS SEPARATED BY COMMAS IN FIRST ARGUMENT ********
+
+	IF ( num_args .GT. 0 ) THEN
+	   IF ( arg1_quoted ) THEN
+	      num_items = 1
+	      item_start(1) = arg_start(1)
+	      item_end(1)   = arg_end(1)
+	   ELSE
+	      CALL PARSE_COMMA_LIST
+     .		      ( cmnd_buff, arg_start(1), arg_end(1), max_item_list,
+     .			num_items, item_start, item_end, status )
+	      IF ( status .NE. ferr_ok ) RETURN 1
+	   ENDIF
+	ELSE
+	   num_items = 0
+	ENDIF
+	
+	RETURN
+
+	END
diff --git a/fer/gnl/get_fvars_list_by_attname_and_val.F b/fer/gnl/get_fvars_list_by_attname_and_val.F
new file mode 100644
index 0000000..17c5097
--- /dev/null
+++ b/fer/gnl/get_fvars_list_by_attname_and_val.F
@@ -0,0 +1,105 @@
+	SUBROUTINE GET_FVARS_LIST_BY_ATTNAME_AND_VAL
+     .			(attname, attstring, maxlist,
+     .			 id_list, dset_list, nfound  )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a list of all file variables that have a particular given value for
+* a given string attribute
+* intended usage:  find variables that have _SIGMA_REF_'="DEPTH"
+* Note: if the incoming string is unspecified_name4, then all attrib vals match
+
+* V690: 2/14 *sh* 
+
+        IMPLICIT NONE
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl_vms.parm'
+	include 'xdset_info.cmn_text'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declaration:
+	CHARACTER*(*) attname, attstring
+	INTEGER	maxlist, id_list(maxlist), dset_list(maxlist), nfound
+
+* internal parameter declarations
+	INTEGER	maxlen
+	PARAMETER (maxlen = 50)
+
+* internal variable declarations:
+	LOGICAL NC_GET_ATTRIB, found_one, no_match_needed
+	INTEGER	ivar, dset, status, varid, attid, attlen, attoutflag,
+     .		vax_code, STR_CASE_BLIND_COMPARE
+	REAL	attvals(maxlen)
+	CHARACTER retstring*(maxlen)
+
+* initialize
+	no_match_needed = attstring .EQ. unspecified_name4
+	nfound = 0
+
+* loop through the file variables
+	DO ivar = 1, maxvars
+	   dset = ds_var_setnum(ivar)
+	   IF ( dset .EQ. set_not_open ) CYCLE
+
+	   CALL CD_GET_VAR_ID (dset, ds_var_code(ivar), varid, status)
+
+           found_one = NC_GET_ATTRIB ( dset, varid, patnam_sigma,
+     .                               .FALSE., ds_var_code(ivar), maxlen,
+     .                               attlen, attoutflag, retstring,
+     .                               attvals )
+* ... attrib name matches.
+*     if necessary now also check if the contents match
+           IF (found_one) THEN
+	      found_one = no_match_needed
+	      IF (.NOT.no_match_needed) THEN
+	         vax_code = STR_CASE_BLIND_COMPARE(attstring,retstring)
+	         found_one = vax_code .EQ. vms_str_success
+	      ENDIF
+	      IF (found_one) THEN
+	         nfound = nfound + 1
+	         id_list  (nfound) = varid
+	         dset_list(nfound) = dset
+	         IF (nfound .EQ. maxlist) RETURN  ! hacky but good enuf
+	      ENDIF
+	   ENDIF
+	ENDDO
+
+	RETURN
+	END
+
diff --git a/fer/gnl/get_input_varname.F b/fer/gnl/get_input_varname.F
new file mode 100644
index 0000000..13107b4
--- /dev/null
+++ b/fer/gnl/get_input_varname.F
@@ -0,0 +1,77 @@
+      SUBROUTINE GET_INPUT_VARNAME (varattname, varname)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+      
+* Return the varname part of an varattname, without any parentheses or brackets
+
+* V600 6/05 *acm* Attribute control.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+
+        INCLUDE 'xrisc.cmn'
+        INCLUDE 'errmsg.parm'
+
+* calling argument declarations
+
+      CHARACTER*(*) varattname, varname
+
+* local variable declarations
+
+      INTEGER TM_LENSTR1, slen, itmp, status
+
+      slen = TM_LENSTR1(varattname)
+      IF (varattname(1:1) .EQ. '(' .AND.
+     .    INDEX(varattname(1:slen), ')' ) .GT. 1 ) THEN
+
+         varname = varattname(2:slen)
+
+* locate the end of the parentheses
+
+         itmp = INDEX(varname,')')
+         IF ( itmp .GT. slen ) GOTO 5200		! unpaired parentheses
+         varname(itmp:slen) = ' '
+
+* Remove square brackets
+         IF ( INDEX(varname,'[') .GT. 0 ) THEN
+            slen = INDEX(varname,'[') 
+            varname(slen:) = ' ' 
+         ENDIF
+      ENDIF
+
+* error exits
+ 5000 RETURN
+ 5200 status = ferr_syntax
+      risc_buff = varattname
+      CALL ERRMSG( status, status, 'no closing parentheses'//
+     .	           risc_buff(:slen), *5000 )
+      END
diff --git a/fer/gnl/get_mode_arg.F b/fer/gnl/get_mode_arg.F
new file mode 100644
index 0000000..5a444b6
--- /dev/null
+++ b/fer/gnl/get_mode_arg.F
@@ -0,0 +1,205 @@
+      SUBROUTINE GET_MODE_ARG( mode, text, arg, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* interpret the text string accompanying the SET MODE command
+*	eg. SET MODE TIME:HOURS
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/18/88
+* V200:   6/8/89 - added mode desperate
+*	 12/6/89 - and mode GKS
+*	12/20/89 - and mode Xwindows
+*	  1/5/89 - and mode metafile
+* Unix/RISC port - 5/91 - cant use "//" with CHAR*(*) variable
+*                - and X-windows names are more general
+* V230:  5/14/92 - REMOTE_X mode was replaced by the REFRESH mode
+*        11/9/92 - MODE META and MODE GKS no longer take arguments - eliminate
+* V300:   2/3/93 - added MODE VERIFY FULL/FILE
+*	 5/12/93 - file name args to SET MODE JOURNAL and SET MODE PPLLIST
+* V301:  1/12/94 - allow filename arg for mode metafile
+* V320 8/94 *kob* -IBM port - had to use risc buff for string concats
+*       12/29/94 - eliminate unnecessary tty error message ("12/94")
+*	 1/18/94 - added SET MODE VERIFY:ALWAYS (iarg=3)
+*		   (bug fix for MODE VERIFY:garbage error msgs 2/3/95)
+* V500: 4/99 *sh* - added MODE STUPID:weak_cache
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+* V600: *acm* 5/06 - add new MODE LINECOLORS:[arg]
+* V610  *acm* 3/08 - add new MODE NLEVELS:argument
+* V67   *acm* 3/11 - Fix for ticket 1819, size of arg for MODE DESPERATE,
+*                    and allow for a floating-point input
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'	
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+	include 'xrisc.cmn'          ! for RISC/FORTRAN
+
+* calling argument declarations
+	INTEGER		mode, arg, status
+	REAL		farg
+	CHARACTER*(*)	text
+
+* local variable declarations:
+	INTEGER	STR_CASE_BLIND_COMPARE, TM_LENSTR1,
+     .		vax_code, tlen, cpos, iarg
+
+* initialize
+	status = ferr_ok
+	IF ( text .EQ. ' ' ) THEN
+	   IF ( mode .EQ. pmode_verify ) arg = 1   ! reset to "DEFAULT"
+           IF ( mode .EQ. pmode_stupid ) arg = 2   ! same as unspecified_int4
+	   RETURN
+	ENDIF
+
+* decode argument according to syntax for this mode
+! removed 12/94
+!	IF ( mode .EQ. pmode_diagnostic
+!     .	.OR. mode .EQ. pmode_interpolate ) THEN
+!	   WRITE ( ttout_lun, * ) 'mode argument not yet implemented'
+!	ELSEIF ( mode .EQ. pmode_long_lab
+
+	IF ( mode .EQ. pmode_long_lab
+     .	    .OR. mode .EQ. pmode_lat_lab
+     .	    .OR. mode .EQ. pmode_depth_lab ) THEN
+	   READ ( text, '(BN,I10)', ERR=5010 ) iarg
+	   IF ( ABS(iarg) .GT. 8  ) GOTO 5010
+	   arg = iarg
+
+	ELSEIF ( mode .EQ. pmode_time_lab ) THEN
+	   tlen = MIN( 7, TM_LENSTR1(text) )
+	   DO 100 iarg = 1, 6
+	      vax_code = STR_CASE_BLIND_COMPARE
+     .		( text(:tlen), date_labels(iarg)(:tlen) )
+	      IF ( vax_code .EQ. vms_str_success ) THEN
+	         arg = -iarg
+	         GOTO 1000
+	      ENDIF
+ 100	   CONTINUE
+	   GOTO 5010	! unknown argument
+
+	ELSEIF ( mode .EQ. pmode_desperate ) THEN
+	   READ ( text, *, ERR=5010 ) farg
+	   IF (farg .GT. 1.e9 .OR. farg .LE. 0) GOTO 5030
+           iarg = INT(farg)
+	   arg = iarg
+
+	ELSEIF ( mode .EQ. pmode_verify ) THEN
+	   tlen = MIN( 3, TM_LENSTR1(text) )
+           DO 200 iarg = 1, 3
+              vax_code = STR_CASE_BLIND_COMPARE
+     .          ( text(1:3), verify_modes(iarg)(1:tlen) )
+              IF ( vax_code .EQ. vms_str_success ) THEN
+                 arg = iarg
+                 GOTO 1000
+              ENDIF
+ 200       CONTINUE
+	   GOTO 5010
+	ELSEIF ( mode .EQ. pmode_journal ) THEN
+ 	   journal_file = text
+* ... change COMMON variable lttout in PLOT to output to file
+	ELSEIF ( mode .EQ. pmode_ppllist ) THEN
+	   ppllist_file = text
+	ELSEIF ( mode .EQ. pmode_metafile ) THEN
+	   CONTINUE     ! processed in XEQ_SET in case PLOT+ not opened yet
+* ... SET MODE STUPID:weak_cache
+	ELSEIF ( mode .EQ. pmode_stupid ) THEN
+           vax_code = STR_CASE_BLIND_COMPARE(text(1:4), 'weak' )
+           IF ( vax_code .EQ. vms_str_success ) THEN
+              arg = 1
+              GOTO 1000
+           ELSE
+	      GOTO 5010
+           ENDIF
+* ... SET MODE GRAT:graticule argument
+	ELSEIF ( mode .EQ. pmode_grat ) THEN
+            mode_grat_buff = text
+            
+	ELSEIF ( mode .EQ. pmode_linecolors ) THEN
+	   READ ( text, '(BN,I10)', ERR=5010 ) iarg
+	   IF ( iarg.LT.6 ) GOTO 5010
+	   arg = iarg
+
+	ELSEIF ( mode .EQ. pmode_nlevels ) THEN
+	   READ ( text, '(BN,I10)', ERR=5020 ) iarg
+	   IF ( iarg.LT.1 .OR. iarg .GT. 250 ) GOTO 5020
+	   arg = iarg
+
+        ELSE
+	   GOTO 5010	! mode does not accept argument
+	ENDIF
+
+* successful completion
+ 1000	RETURN
+        
+* error exit
+ 5000   RETURN
+#ifdef NO_PASSED_CONCAT
+ 5010   tlen = TM_LENSTR1(text)
+        risc_buff = text(:tlen)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument '//risc_buff, *5500 )
+ 5020   tlen = TM_LENSTR1(text)
+        risc_buff = text(:tlen)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument must be in [1,250] '//risc_buff, *5500 )
+ 5030   tlen = TM_LENSTR1(text)
+        risc_buff = text(:tlen)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument. Negative or > 1.e+9, ', *5500 )
+#else
+ 5010   tlen = TM_LENSTR1(text)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument < 6 '//text(:tlen), *5500 )
+ 5020   tlen = TM_LENSTR1(text)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument must be in [1,250] '//text(:tlen), *5500 )
+ 5030   tlen = TM_LENSTR1(text)
+        CALL ERRMSG( ferr_out_of_range, status,
+     .   'illegal mode argument > 1.e+9, ', *5500 )
+#endif
+ 5500   IF ( mode .EQ. pmode_verify ) CALL WARN(
+     .          'Legal VERIFY arguments are DEFAULT, ALL, and ALWAYS')
+        GOTO 5000
+
+        END
+
diff --git a/fer/gnl/get_ppl_memory_size.F b/fer/gnl/get_ppl_memory_size.F
new file mode 100644
index 0000000..9c2b7bc
--- /dev/null
+++ b/fer/gnl/get_ppl_memory_size.F
@@ -0,0 +1,54 @@
+	SUBROUTINE GET_PPL_MEMORY_SIZE ( outsize )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get PPL memory size from common.
+
+* programmer - Ansley Manke
+*
+* V533: 9/02 *acm* 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'PPLDAT.INC'
+
+* calling argument declarations:
+	INTEGER outsize
+
+* save the size for PPLUS memory.  
+
+         outsize = pplmem_nsize
+
+	RETURN
+	END
diff --git a/fer/gnl/get_scriptfile_name.F b/fer/gnl/get_scriptfile_name.F
new file mode 100644
index 0000000..ea87abd
--- /dev/null
+++ b/fer/gnl/get_scriptfile_name.F
@@ -0,0 +1,64 @@
+	SUBROUTINE get_scriptfile_name ( name, ipath )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*	Ansley Manke PMEL/TMAP
+*	8/2003
+
+* V602 1/07 Fix bug 1410: If the script name contains a relative path name,
+*           it was not recognized as a valid path/filename.  Need to check for
+*           PathSeparator in the filename.  (previously looked for 1st character /)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Get script file name from common, for running with the comand line option
+*  ferret -script 
+* 
+
+	include 'tmap_dims.parm'
+	INCLUDE 'xprog_state.cmn'
+#include "gt_lib.parm"
+
+* calling argument declarations:
+	CHARACTER*(*)	name
+        INTEGER ipath
+
+* Get the name and set a flag if the name begins with a path.
+
+        name = scriptfile_name
+        ipath = 0
+        IF ( INDEX( scriptfile_name, PathSeparator) .GT. 0) ipath = 1
+
+	RETURN
+	END
+
diff --git a/fer/gnl/get_uvars_list_by_attname_and_val.F b/fer/gnl/get_uvars_list_by_attname_and_val.F
new file mode 100644
index 0000000..63825c8
--- /dev/null
+++ b/fer/gnl/get_uvars_list_by_attname_and_val.F
@@ -0,0 +1,107 @@
+	SUBROUTINE GET_UVARS_LIST_BY_ATTNAME_AND_VAL
+     .			(attname, attstring, maxlist,
+     .			 id_list, dset_list, nfound  )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a list of all user variables that have a particular given value for
+* a given string attribute
+* intended usage:  find variables that have _SIGMA_REF_'="DEPTH"
+* Note: if the incoming string is unspecified_name4, then all attrib vals match
+
+* V690: 2/14 *sh* 
+
+        IMPLICIT NONE
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl_vms.parm'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declaration:
+	CHARACTER*(*) attname, attstring
+	INTEGER	maxlist, id_list(maxlist), dset_list(maxlist), nfound
+
+* internal parameter declarations
+	INTEGER	maxlen
+	PARAMETER (maxlen = 50)
+
+* internal variable declarations:
+	LOGICAL NC_GET_ATTRIB,
+     .		found_one, no_match_needed
+	INTEGER	STR_CASE_BLIND_COMPARE,
+     .		ivar, dset, status, varid, attid, attlen, attoutflag,
+     .		num_indices, vax_code, dsetm1
+	REAL	attvals(maxlen)
+	CHARACTER retstring*(maxlen)
+
+* initialize
+	no_match_needed = attstring .EQ. unspecified_name4
+	nfound = 0
+	dsetm1 = -1
+        CALL deleted_list_get_undel(uvar_num_items_head, 
+     .                          deleted_list_result(1),
+     .                          max_uvar, num_indices )
+
+* loop through the user variables
+	DO ivar = 1, num_indices
+
+	   CALL CD_GET_VAR_ID (dsetm1, uvar_name_code(ivar), varid, status)
+           found_one = NC_GET_ATTRIB ( dsetm1, varid, patnam_sigma,
+     .                            .FALSE., uvar_name_code(ivar), maxlen,
+     .                            attlen, attoutflag, retstring,
+     .                            attvals )
+* ... attrib name matches.
+*     if necessary now also check if the contents match
+           IF (found_one) THEN
+	      found_one = no_match_needed
+	      IF (.NOT.no_match_needed) THEN
+	         vax_code = STR_CASE_BLIND_COMPARE(attstring,retstring)
+	         found_one = vax_code .EQ. vms_str_success
+	      ENDIF
+	      IF (found_one) THEN
+	         nfound = nfound + 1
+	         id_list  (nfound) = varid
+	         dset_list(nfound) = -1 ! needs to be uvar_dset(ivar) for LET/D
+	         IF (nfound .EQ. maxlist) RETURN  ! hacky but good enuf
+	      ENDIF
+	   ENDIF
+	ENDDO
+
+	RETURN
+	END
+
diff --git a/fer/gnl/init_aggregate_dset.F b/fer/gnl/init_aggregate_dset.F
new file mode 100644
index 0000000..7d568b5
--- /dev/null
+++ b/fer/gnl/init_aggregate_dset.F
@@ -0,0 +1,340 @@
+	SUBROUTINE INIT_AGGREGATE_DSET (dname, dtitle, agg_dset, 
+     .     agg_quiet, agg_hide, status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 4/13 *acm* Ability to define ensemble with /HIDDEN
+*                 Get grid of user-vars, allow more combinations with user vars
+*                 better error handling.
+
+      IMPLICIT NONE
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+        include 'xprog_state.cmn'
+	include 'xtm_grid.cmn_text'  
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	dname, dtitle
+	INTEGER		agg_dset, status
+	LOGICAL		agg_quiet, agg_hide
+
+* local variable declarations:
+	LOGICAL	match, has_uvars
+	INTEGER	TM_LENSTR, TM_LENSTR1, STR_SAME, NCF_DELETE_DSET,
+     .		NCF_ADD_AGG_MEMBER, NCF_GET_AGG_MEMBER_INFO, 
+     .          KNOWN_GRID,
+     .		iset, dset, item, ii,
+     .		perm(nferdims), nsets, member_sets(maxdsets), 
+     .		imatch, nv, grid, igrid, idim, ivar, nvars, iline, 
+     .		slen, memb_var, memb_dset, memb_grid, ugrid, 
+     .		type, fvar
+	CHARACTER vname*128
+	CHARACTER TM_STRING*13
+
+* check to see if this name matches an already-open dataset name.
+* if so, thats an error
+
+	DO 100 iset = 1, maxdsets
+           match = ds_name(iset) .EQ. dname
+           IF ( match ) GOTO 5100
+  100	CONTINUE
+
+* See if requested datasets are open and if not, try to open them.
+
+	CALL CHECK_MEMBER_SETS (nsets, member_sets, status)
+	IF (status .NE. ferr_ok .OR. nsets .EQ. 0) GOTO 9950
+
+* Ok, all the member datasets are open and available
+
+* Assign aggregate data set number, exiting if maximum number 
+* of data sets are open
+
+	DO 200 iset = 1,maxdsets
+	  IF (ds_name(iset) .EQ. char_init1024) THEN
+	    agg_dset = iset
+	    GOTO 220
+	  ENDIF
+  200	CONTINUE
+
+* Too many data sets are open
+	CALL TM_ERRMSG ( merr_dsetlim, status, 'INIT_AGGREGATE_DSET',
+     .			 no_descfile, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxdsets)),
+     .			 no_errstring, *9950)
+ 220	CONTINUE
+
+* Create datset. Will delete it later if there are no aggregate variables found.
+
+	CALL CREATE_AGG_DSET (agg_dset, dname, dtitle, nsets, 
+     .			 e_dim, iline, status)  
+	IF (status .NE. ferr_ok) GOTO 5300
+
+* See what variables are shared by all the datsets
+
+	dset = member_sets(1)
+	nvars = 0
+	
+	DO 800 ivar = 1, maxvars
+           IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 800
+	   vname = ds_var_code(ivar)
+	   imatch = 1
+	   DO 400 ii = 2, nsets
+	      iset = member_sets(ii)
+              DO 300 nv = 1, maxvars
+	         IF ( (ds_var_setnum(nv) .EQ. iset) .AND.
+     .                (STR_SAME(ds_var_code(nv), vname) .EQ. 0) ) THEN
+                    imatch = imatch + 1
+		 ENDIF
+  300	      CONTINUE
+
+* See if a user-defined LET/D variable name matches
+              DO 350 nv = 1, maxvars
+	         IF ( (uvar_dset(nv) .EQ. iset) .AND.
+     .                (STR_SAME(uvar_name_code(nv), vname) .EQ. 0) ) THEN
+                    imatch = imatch + 1
+	      ENDIF
+  350	      CONTINUE
+
+  400	   CONTINUE
+
+           IF (imatch .NE. nsets) THEN
+	      IF ( .NOT.agg_quiet ) 
+     .	         CALL WARN('Exclude variable from aggregate. '//
+     .	         'Does not appear in all member datasets: '//
+     .	         vname)
+	      GOTO 800 ! Variable not in all datasets
+	   ENDIF
+
+           grid = ds_grid_number(ivar)
+	   IF (grid_line(e_dim, grid) .NE. 0) GOTO 5400
+
+* Check that grids match for file variables. 
+* NOTE if the variables in the member datasets share the same grid, and
+*      there is a record axis, then they may have different timesteps but 
+*      grid_line and ds_grid_start, ds_grid_end will have the same contents.
+*      How to find that case? (check line_mem) Or just allow it?
+
+           imatch = 1
+	   has_uvars = .FALSE.
+           DO 600 ii = 2, nsets
+	      iset = member_sets(ii)
+              DO 500 nv = 1, maxvars
+	         IF ( (ds_var_setnum(nv) .EQ. iset) .AND. 
+     .                (STR_SAME(ds_var_code(nv), vname) .EQ. 0) ) THEN
+                    igrid = ds_grid_number(nv)
+		    DO 550 idim = 1, nferdims
+		       IF ( grid_line(idim, grid) .NE.  
+     .                      grid_line(idim, igrid) ) GOTO 500
+  550	            CONTINUE
+                    imatch = imatch + 1
+		 ENDIF
+	         IF ( (uvar_dset(nv) .EQ. iset)   .AND. 
+     .                (STR_SAME(uvar_name_code(nv), vname) .EQ. 0) ) THEN
+
+	            CALL GET_UVAR_GRID( nv, iset, status )
+	            IF ( status .NE. ferr_ok ) GOTO 5600
+	            igrid = KNOWN_GRID(iset,cat_user_var,nv)
+
+	            IF (igrid .NE. grid) THEN
+		    DO 555 idim = 1, nferdims
+		       IF ( grid_line(idim, grid) .NE.  
+     .                      grid_line(idim, igrid) ) GOTO 500
+  555	            CONTINUE
+                    ENDIF
+		    imatch = imatch + 1 
+
+		    has_uvars = .TRUE.
+	         ENDIF
+  500	      CONTINUE
+  600	   CONTINUE
+
+*  variable in all datsets but they dont have the same grid.
+	   IF (imatch .NE. nsets) THEN
+	      IF ( .NOT.agg_quiet ) 
+     .	         CALL WARN('Exclude variable from aggregate. '//
+     .	         'Grid differs in member datasets: '//
+     .	         vname)
+	      GOTO 800 
+	   ENDIF
+	      
+* same grid for this variable in all datasets 
+	   
+           nvars = nvars + 1
+c	   IF (has_uvars) grid = unspecified_int4
+	   CALL DEFINE_AGGREGATE_GRID (agg_dset, nvars, vname,
+     .           ivar, iline, grid, e_dim, member_sets, nsets)
+	   IF (status .NE. ferr_ok) GOTO 5000
+
+  800   CONTINUE
+
+* See if user-defined (LET/D=) variables from the first dataset are 
+* shared by all the datsets
+
+	dset = member_sets(1)
+	DO 1800 ivar = 1, maxvars
+           IF ( uvar_dset(ivar) .NE. dset ) GOTO 1800
+	   vname = uvar_name_code(ivar)
+	   imatch = 1
+
+	   grid = unspecified_int4
+	   DO 1400 ii = 2, nsets
+	      iset = member_sets(ii)
+              DO 1300 nv = 1, maxvars
+	         IF ( (ds_var_setnum(nv) .EQ. iset) .AND.
+     .                (STR_SAME(ds_var_code(nv), vname) .EQ. 0) ) THEN
+                    imatch = imatch + 1
+		    grid = ds_grid_number(nv)
+		    fvar = nv
+
+		 ENDIF
+ 1300	      CONTINUE
+
+* See if a user-defined LET/D variable name matches
+              DO 1350 nv = 1, maxvars
+	         IF ( (uvar_dset(nv) .EQ. iset) .AND.
+     .                (STR_SAME(uvar_name_code(nv), vname) .EQ. 0) ) THEN
+
+                    imatch = imatch + 1
+		 ENDIF
+ 1350	      CONTINUE
+
+ 1400	   CONTINUE
+
+	   IF (imatch .NE. nsets) THEN
+	      
+	      IF ( .NOT.agg_quiet ) 
+     .	         CALL WARN('Exclude variable from aggregate. '//
+     .	         'Does not appear in all member datasets: '//
+     .	         vname)
+               GOTO 1800 ! Variable not in all datasets
+	   ENDIF
+
+* If one dataset contains the variable then we will be able to define the grid.
+	   
+	   IF (grid .NE. unspecified_int4) THEN
+
+              nvars = nvars + 1
+
+c	      grid = unspecified_int4
+	      CALL DEFINE_AGGREGATE_GRID (agg_dset, nvars, vname,
+     .           fvar, iline, grid, e_dim, member_sets, nsets)
+	      IF (status .NE. ferr_ok) GOTO 5000
+
+* Do not include variables that are entirely user-defined.
+	   ELSE
+	      IF ( .NOT.agg_quiet ) 
+     .	         CALL WARN('Exclude variable from aggregate. '//
+     .	         'Must be a file variable in at least one member dataset: '//
+     .	         vname)
+
+	   ENDIF
+
+ 1800	CONTINUE
+
+* If no variables from the datasets match, delete this dataset. 
+
+	if (nvars .EQ. 0) goto 5500
+
+* Add aggregate members to aggregate dataset
+
+	DO 2000 iset = 1, nsets
+	   status = NCF_ADD_AGG_MEMBER (agg_dset, member_sets(iset)) 
+ 2000	CONTINUE
+
+	IF (dtitle(1:2) .NE. char_init) THEN
+	   ds_title(agg_dset) = dtitle
+	ELSE
+	   ds_title(agg_dset) = 'Ensemble'
+	ENDIF
+	ds_mod_title(agg_dset) = ' '
+	ds_time_axis(agg_dset) = ds_time_axis(member_sets(1))
+	ds_format(agg_dset) = ds_format(member_sets(1))
+ 
+* set use counts and clean up temporary grids and axes for agg. dset
+	CALL TM_GARB_COL_GRIDS(agg_dset)
+
+* If user requested /HIDE, then mark the member datasets for
+* hidden status on SHOW DATA commands
+	
+	IF (agg_hide) THEN
+ 	   DO 2100 iset = 1, nsets
+	      ds_hide (iset) = .TRUE. 
+ 2100	   CONTINUE
+	ENDIF
+
+ 5000   RETURN	
+
+* Errors: too-many datasets open so aggregate dataset can't be opened,
+* or error on a member dataset. 
+* ?? If some member datasets were opened, close them??)
+* Return no-dataset-number.
+
+ 9950	agg_dset = unspecified_int4
+	status = ferr_TMAP_error
+	GOTO 5000
+ 9960	CALL CANCEL_DATA_SET( agg_dset, .FALSE., status )
+	agg_dset = unspecified_int4
+	GOTO 5000
+
+ 5100   CALL ERRMSG( ferr_syntax,status,'dataset name already in use:'
+     .		//dname(:TM_LENSTR1(dname)), *5000 )
+     
+ 5300	CALL ERRMSG( ferr_aggregate_error, status, ' ', *9950 )
+
+ 5400	CALL ERRMSG( ferr_TMAP_error, status,
+     .		' Variables in member datasets already '
+     .		//'have axis in the E direction', *9950 )
+
+ 5500	CALL ERRMSG( ferr_aggregate_error, status,
+     .		'No valid datasets or datasets share no variables. ', 
+     .		*9960 )
+
+ 5600	CALL ERRMSG( ferr_aggregate_error, status,
+     .		'Could not get grid for user-defined variables '
+     .		//uvar_name_code(nv)(:TM_LENSTR1(uvar_name_code(nv))), 
+     .		*9960 )
+	END
+
diff --git a/fer/gnl/init_journal.F b/fer/gnl/init_journal.F
new file mode 100644
index 0000000..690237b
--- /dev/null
+++ b/fer/gnl/init_journal.F
@@ -0,0 +1,90 @@
+
+
+	SUBROUTINE INIT_JOURNAL( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* open the FERRET journal file
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300:  5/93 - extracted from initialize.F
+* V312:  5/94 - insert "PROCLAIM" output from here instead of from INITIALIZE
+* V320: 12/29/94 - use WARN to avoid direct tty output (for GUI)
+* V66   *kms* 5/10 LIB_GET_LUN is a subroutine, not a function
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'tmap_errors.parm'  ! error codes
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER status
+
+* local variable declarations:
+	INTEGER TM_LENSTR1, jnl_len
+
+* get logical unit to open the journal file
+	CALL LIB_GET_LUN( jrnl_lun )
+
+*  rename last journal file by this name to old version
+        CALL TM_PARK_LAST_VERSION( journal_file, status )
+        IF ( status .NE. merr_ok ) GOTO 9000
+	OPEN (	FILE=journal_file,
+     .		UNIT=jrnl_lun,
+     .		STATUS='NEW',
+     .		ERR = 9000 )
+
+* put introductory remarks into journal file
+	CALL PROCLAIM ( jrnl_lun, '! ', .FALSE. )
+
+* successful completion
+	status = ferr_ok   ! status not really used
+	RETURN
+
+* errors
+* note: error not reported to ERRMSG since this is called from INITIALIZE
+ 9000	jrnl_lun = unspecified_int4	! flag that there is no journal file
+	jnl_len = TM_LENSTR1(journal_file)
+	CALL WARN('Unable to create journal file '
+     .			//journal_file(:jnl_len) )
+	status = ferr_invalid_command  
+
+	END
+
diff --git a/fer/gnl/init_memory.F b/fer/gnl/init_memory.F
new file mode 100644
index 0000000..934770a
--- /dev/null
+++ b/fer/gnl/init_memory.F
@@ -0,0 +1,109 @@
+
+
+	SUBROUTINE INIT_MEMORY( block_size, number_of_blocks )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize memory management linked lists, etc.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/21/88
+* revision 0.1 - 8/15/88 - only initialize to max_mrs-1 - top is dummy
+* revision 0.2 -11/22/88 - new TM IO library eliminating nblks_for_lines
+* V200:  6/12/89 - initialize back link of memory regions
+* V312:  5/19/94 - changes for reconfigurable (dynamic) memory
+* V420: initialize the no-cache memory hash pointer
+* V500: 4/99 *sh* - set mode desperate while we're at it
+* V510: 2/00 *sh* initialize additional new hash piles
+* V606: 8/07 *acm* Set a symbol with the current memory setting
+* V62   5/09 *acm*- make FERRET_MEMORY a special symbol (remove 
+*                 code defining it from this routine)
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER block_size, number_of_blocks
+
+* internal variable declarations
+	INTEGER	bigblk, mv
+      INTEGER i1, i2, len
+      CHARACTER*30 TM_FMT, sym_name, buff
+
+* initialize memory configuration
+	mem_blk_size = block_size
+	max_mem_blks = number_of_blocks
+
+* BULK MEMORY
+* note: arrays mblk_* are initialized by DATA to unspecified
+* ... designate all the rest as 1 giant free contiguous block
+	bigblk = 1
+	mblk_flink(0) = bigblk
+	mblk_blink(0) = bigblk
+	mblk_size (0) = 0
+	mblk_flink(bigblk) = 0
+	mblk_blink(bigblk) = 0
+	mblk_size (bigblk) = max_mem_blks
+
+* LINKS IN MEMORY VARIABLE TABLE
+* ... all hash pile start pointers point to self (empty lists)
+	DO 100 mv = pmv_lowest_head, -1
+	   mv_flink(mv) = mv
+	   mv_blink(mv) = mv
+ 100	CONTINUE
+* ... free list (pointer at subscript 0) contains all table slots
+	DO 110 mv = 0, max_mr_avail
+	   mv_flink(mv) = mv + 1
+	   mv_blink(mv) = unspecified_int4   ! bck link not used in free list
+ 110	CONTINUE
+	mv_flink(max_mr_avail) = 0	     ! make list circular
+
+* set MODE DESPERATE to 1/10 of full memory size
+* the reason so small is that Ferret memory management is not aware of
+* large hierarchies of definitions -- so a command like "LIST var"
+* may involve far more data than the transformations of "var" alone
+	mode_arg(pmode_desperate,1) = 0.1 *  block_size *  number_of_blocks
+
+	RETURN
+	END
+
diff --git a/fer/gnl/initialize.F b/fer/gnl/initialize.F
new file mode 100644
index 0000000..1e7823d
--- /dev/null
+++ b/fer/gnl/initialize.F
@@ -0,0 +1,295 @@
+	SUBROUTINE INITIALIZE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize run-time variables and I/O in preparation to begin execution
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/26/86
+* revision 0.1 - 12/11/86 - explicit OPEN of SYS_OUTPUT with 255 byte RECL
+*			    and 255 byte RECL on journal file OPEN
+* revision 0.2 - 1/30/87 - modified for mr_protected declared as INTEGER
+*			   and RADIUS made a parameter in FERRET.PARM
+* revision 0.3 - 5/1/87  - EXTERNAL *CONTROL and no LIST file opened
+* revision 0.4 - 9/14/87 - added VMS calls to turn on line recall
+* revision 0.5 - 11/30/87- added call to enable ^C interrupts
+* revision 0.6 - 2/18/88 - converted X axes to "regular" format
+* revision 0.7 - 5/2/88  - changed GFDL.JNL to GFDL_JOURNAL (logical) and added
+*			   ERR= branch to OPEN
+* revision 0.8 - 6/29/88  - changed GFDL_JOURNAL to FERRET_JOURNAL
+*			    and today_time in hours:minutes, only
+*			    determine mode (interactive) here
+* revision 0.9 - 7/21/88 - memory initialization done by INIT_MEMORY
+* revision 1.0 - 8/12/88 - added FERRET_INIT optioal initialization file
+* revision 1.1 -11/22/88 - new TM IO library
+* revision 1.2 - 2/2/89  - allow program to continue w/out journal file
+* V200:  6/22/89 - define special grids at run time
+*	 12/6/89 - initialize mode_GKS and mode_wait
+* Unix/RISC port - 1/91 ... several OS dependencies fixed
+*                - 9/91 - fixed err handling when journal file cant be opened
+*                - 10/91 - hook to enable PLOT+ braindead features
+*                - 10/91 -   FER_INIT ==> .ferret
+* V230:  5/14/92 - on SGI (with no backing store) set REFRESH mode
+* V300:  5/12/93 - split journal file init into another file
+*		 - relocated sgi IFDEF to default REFRESH to ON
+*       10/25/93 - default MODE REFRESH ON for **all** systems
+*	 2/24/94 - small change due to mode_state as a 2D variable
+*	 3/14/94 - base initial state of mode refresh on "ifdef X_REFRESH"
+* V312:  5/19/94 - significant portions of routine removed to new MAIN program
+* V313: 10/27/94 - *sh* AIX port: avoid the routine name "time"
+* V420:  9/19/95 - call TM_INIT_DYN_GRIDS for dynamic (implicit) grid creation
+* Linux port *kob* 3/96 - had to add calls to use F90 data and time routine
+*		     rather than f77 default routines.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+*                  Use pseudo-dataset of user-defined axes to keep track of attributes.
+* V65   2/10 *acm*- Changes for CLOCK symbols that work with gfortran as well as g77.
+*                   see special_symbol.F
+*     *kms* 11/10 - added cat_pystat_var string_array_init
+* V68   1/12 *acm* declarations changes for double-precision ferret.
+*       3/12 *acm* cleanup ifdefs and unnecessary include files
+
+        include 'tmap_errors.parm'  ! error codes
+	include 'tmap_dims.parm'
+	include 'xio.cmn_text'
+        include 'xdset_info.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'gfdl_vms.parm'
+	include	'errmsg.parm'
+	include	'gfdl.parm'			! from phil/sieg
+	include	'xonedim.cmn'		! from phil.sieg
+	include 'xprog_state.cmn'
+        include 'xalgebra.cmn'
+	include 'xvariables.cmn'
+	include 'xtoday.cmn'
+        include 'xpyvar_info.cmn'
+
+* local variable declarations:
+	LOGICAL	GKS_WINDOWS, fexist
+	INTEGER	TM_LENSTR1, ito, ifrom, mem_blk, mr, iset, status
+      integer icount, irate, imax
+	REAL	DTIME, radian, cm2deg
+	REAL*4  TArray(2), dtime_res
+
+
+*************** I/O ************************************************************
+	interactive = .TRUE.
+
+* determine default GKS usage based on system logon device
+	mode_GKS = GKS_WINDOWS()
+	mode_wait = .NOT.mode_GKS	! no wait after plot on window device
+
+* turn on segment-based screen refresh or screen updates dont always work
+#ifdef X_REFRESH
+      CALL TM_SET_FREE_EVENT(1)
+      mode_state( pmode_xwindows, 1 ) = .TRUE.
+#else
+      mode_state( pmode_xwindows, 1 ) = .FALSE.
+#endif
+        CONTINUE
+
+* set up special grids
+	CALL DEFINE_SPECIAL_GRIDS   ! label 1000 moved here 9/91 *sh*
+
+* initialize dynamic grid management
+	CALL TM_INIT_DYN_GRIDS
+
+*************** TODAY'S DATE ***************************************************
+
+
+#ifdef AIX_XLF
+	CALL AIX_DATE( today_date )
+	CALL AIX_TIME( today_time )
+#elif F90_DATE_TIME
+	CALL FDATE(today_date)
+	CALL FTIME(today_time)
+#else
+*	CALL DATE( today_date )
+*	CALL TIME( today_time )
+* *kob*  try new routine for y2k fix
+	CALL GET_DATE_AND_TIME (today_date, today_time)
+#endif
+	today_time = today_time(:5)	! w/out seconds
+
+* DTIME returns a real number which is the running time for this 
+* process since the last call to DTIME. TIMEARRAY(1) reports the user time, 
+* and TIMEARRAY(2) supports the system time. Argument 2 is the sum of the two.
+* Call the routine to initialize the result. It can be updated by evaluating 
+* the symbol DELTA_CPU. See special_symbol.F
+
+      dtime_res = DTime(TArray)
+      cpu_last = 0.0  ! in common xtoday.cmn
+
+* ALso a special symbol CLOCK_SECS, the delta seconds in clock time since Ferret
+* session is initialized.  Save clock_start_count to subtract from the value
+* when this symbol is updated.
+
+      CALL System_Clock(icount, irate, imax)
+      clock_start_count = icount
+
+* initialize pseudo-dataset in linked-list structure which will contain all 
+* user variables and their attributes.
+* Also another pseudo-dataset to contain user-defined coordinate variables (axes). 
+
+        iset  = -1;
+        CALL ncf_init_uvar_dset( iset )
+        iset  = -2;
+        CALL ncf_init_uax_dset( iset )
+
+*************** STATE VARIABLES ************************************************
+* see BLOCK DATA initialization of COMMON/ XPROG_STATE /
+
+*********************** GRIDS **************************************************
+	CALL GFDL_TERMS
+
+	RADIAN=57.29578							! 1027
+	cm2deg = radian / radius
+	
+!	ito = line_subsc1(mpsxt)
+!	DO 210 ifrom = 1, line_dim(mpsxt)
+!	   line_mem ( ito ) = xt ( ifrom )		! point location
+!	   ito = ito + 1
+! 210	CONTINUE
+!	DO 212 ifrom = 1, line_dim(mpsxt)
+!	   line_mem ( ito ) = dxt( ifrom ) * cm2deg	! grid box size
+!	   ito = ito + 1
+! 212	CONTINUE
+!
+!	ito = line_subsc1(mpsxu)
+!	DO 220 ifrom = 1, line_dim(mpsxu)
+!	   line_mem ( ito ) = xv ( ifrom )
+!	   ito = ito + 1
+! 220	CONTINUE
+!	DO 222 ifrom = 1, line_dim(mpsxu)
+!	   line_mem ( ito ) = dxu( ifrom ) * cm2deg
+!	   ito = ito + 1
+! 222	CONTINUE
+!
+!	ito = line_subsc1(mpsyt)
+!	line_start(mpsyt) = yt( 1 )
+!	DO 230 ifrom = 1, line_dim(mpsyt)
+!	   line_mem ( ito ) = yt ( ifrom )
+!	   ito = ito + 1
+! 230	CONTINUE
+!	DO 232 ifrom = 1, line_dim(mpsyt)
+!	   line_mem ( ito ) = dyt( ifrom ) * cm2deg
+!	   ito = ito + 1
+! 232	CONTINUE
+!
+!	ito = line_subsc1(mpsyu)
+!	line_start(mpsyu) = yv( 1 )
+!	DO 240 ifrom = 1, line_dim(mpsyu)
+!	   line_mem ( ito ) = yv ( ifrom )
+!	   ito = ito + 1
+! 240	CONTINUE
+!	DO 242 ifrom = 1, line_dim(mpsyu)
+!	   line_mem ( ito ) = dyu( ifrom ) * cm2deg
+!	   ito = ito + 1
+! 242	CONTINUE
+!
+!	ito = line_subsc1(mpszt)
+!	line_start(mpszt) = zdzz( 1 ) * .01
+!	DO 250 ifrom = 1, line_dim(mpszt)
+!	   line_mem ( ito ) = zdzz( ifrom ) * .01
+!	   ito = ito + 1
+! 250	CONTINUE
+!	DO 252 ifrom = 1, line_dim(mpszt)
+!	   line_mem ( ito ) = dz  ( ifrom ) * .01
+!	   ito = ito + 1
+! 252	CONTINUE
+!
+!	ito = line_subsc1(mpszw)
+!	line_start(mpszw) = zdz( 1 ) * .01
+!	DO 260 ifrom = 1, line_dim(mpszw)
+!	   line_mem ( ito ) = zdz( ifrom     ) * .01
+!	   ito = ito + 1
+! 260	CONTINUE
+!	DO 262 ifrom = 1, line_dim(mpszw)
+!	   line_mem ( ito ) = dzz( ifrom + 1 ) * .01 ! Phil/Sieg start at 0
+!	   ito = ito + 1
+! 262	CONTINUE
+
+*************** MISCELLANEOUS **************************************************
+* TMAP librabry routine errors to same output unit as other errors
+	lunit_errors = err_lun
+
+*************** INITIALIZE SPECIAL CHARACTERS *************************
+*
+*       Initialize special characters in COMMON - needed for g77 port to
+*         comply with other compilers *kob*  3/03
+	pCR = CHAR(15)
+
+*************** BRAINDEAD PLOT+ ******************************************
+        CALL PPL_BDEAD
+
+        CALL string_array_init(alg_pvar_head,
+     .                         num_pseudo_vars,
+     .                         8,
+     .                         alg_pvar(1))
+
+        CALL string_array_init(countervar_name_head,
+     .                         num_counter_vars,
+     .                         128,
+     .                         countervar_name(1))
+
+        CALL string_array_init(uvar_name_code_head,
+     .                         max_uvar,
+     .                         128,
+     .                         uvar_name_code(1))
+
+        CALL string_array_init(ds_var_code_head,
+     .                         maxvars,
+     .                         128,
+     .                         ds_var_code(1))
+
+        CALL string_array_init(pyvar_code_head,
+     .                         maxpyvars,
+     .                         128,
+     .                         pyvar_code(1))
+
+        CALL deleted_list_init(uvar_num_items_head,
+     .                         uvar_num_items(1),
+     .                         max_uvar,
+     .                         uvar_deleted)
+
+	RETURN
+
+	END
+
diff --git a/fer/gnl/isit_another_dset.F b/fer/gnl/isit_another_dset.F
new file mode 100644
index 0000000..3a3f76f
--- /dev/null
+++ b/fer/gnl/isit_another_dset.F
@@ -0,0 +1,74 @@
+      SUBROUTINE ISIT_ANOTHER_DSET (expression, dset, varname, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Look for [d=n] within an expression, and reset dset to match the dataset number
+* or name. varname is returned without the [d=] expression.
+
+* V600 6/05 *acm* Attribute control.
+
+	INCLUDE	'ferret.parm'
+	INCLUDE 'errmsg.parm'
+
+* calling argument declarations
+
+      INTEGER dset, status
+      CHARACTER*(*) expression, varname
+
+* local variable declarations
+      INTEGER TM_LENSTR1, slen, elen, llen, ivar, mods_cx, category
+
+      llen = TM_LENSTR1(expression)
+      varname = expression
+
+      IF ( INDEX(expression,'[') .GT. 0 ) THEN
+
+         dset = pdset_irrelevant	! default (not used ...)
+         CALL PARSE_NAM_DSET(expression, cx_last, dset, category, 
+     .                       ivar, mods_cx, status)
+         IF (status .NE. ferr_ok) GOTO 5010
+         slen = INDEX(expression,'[') 
+         elen = INDEX(expression,']')
+         varname = expression(1:slen-1)
+         IF (llen .GT. elen) 
+     .      varname = expression(1:slen-1)//expression(elen+1:llen)
+ 
+      ENDIF
+
+5000  RETURN
+
+5010  IF (dset .EQ. pdset_irrelevant .OR. 
+     .       dset .EQ. unspecified_int4) status = ferr_syntax
+
+      RETURN
+      END
diff --git a/fer/gnl/isit_coord_var.F b/fer/gnl/isit_coord_var.F
new file mode 100644
index 0000000..e26e90d
--- /dev/null
+++ b/fer/gnl/isit_coord_var.F
@@ -0,0 +1,155 @@
+      SUBROUTINE ISIT_COORD_VAR ( expression, dset, varname, 
+     .                            coordvar, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+      
+* See if the expression is a coordinate variable name from the linked-list structure, 
+* inside parentheses.  Return the dset and logical flag coordvar.  If the expression
+* is not in parentheses, it is not treated as a variable name.
+
+* V600 6/05 *acm* Attribute control.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+
+        INCLUDE	'ferret.parm'
+	INCLUDE 'errmsg.parm'
+        INCLUDE 'xrisc.cmn'
+
+
+* calling argument declarations
+      LOGICAL coordvar
+      INTEGER dset, status
+      CHARACTER*(*) expression, varname
+
+* local variable declarations
+
+      INTEGER TM_LENSTR1, NCF_GET_VAR_AXFLAG, slen, varid, ivar, 
+     .        mods_cx, category, itmp, dir, ic
+      CHARACTER*128 buff
+      CHARACTER*1   c
+   
+      coordvar = .FALSE.
+
+      slen = TM_LENSTR1(expression)
+      buff = expression
+
+      IF (expression(1:1) .EQ. '(' .AND.
+     .    INDEX(expression(1:slen), ')' ) .GT. 1 ) THEN
+
+         varname = expression(2:slen)
+
+* locate the end of the parentheses
+
+         itmp = INDEX(varname,')')
+         IF ( itmp .GT. slen .OR. itmp .LE. 0) GOTO 5200   ! unpaired parentheses
+         varname(itmp:itmp) = ' '
+         itmp = itmp - 1
+         slen = itmp
+
+         IF ( INDEX(varname,'[') .GT. 0 ) THEN
+
+            dset = pdset_irrelevant	! default (not used ...)
+            CALL PARSE_NAM_DSET(varname, cx_last, dset,
+     .        category, ivar, mods_cx, status)
+            IF (status .NE. ferr_ok) GOTO 5000
+            slen = INDEX(varname,'[') 
+            varname(slen:) = ' ' 
+         ENDIF
+         IF (dset .EQ. pdset_irrelevant .OR. 
+     .       dset .EQ. unspecified_int4) GO TO 5100
+
+         CALL CD_GET_VAR_ID (dset, varname(:slen), varid, status)
+     
+         IF (status .NE. ferr_ok) THEN
+
+* The name may be axis name with digit(s) added for a unique name. 
+* test that only extra digits were added
+
+            DO 80 ic = slen, 1, -1
+	       c = varname(ic:ic)
+	       IF (  c .LT. '0' .OR. c .GT. '9' ) GOTO 90
+
+* axis names must be enclosed in parentheses to get a varid returned from cd_get_var_id
+c               buff = '('//varname(1:ic-1)//')'
+               buff = varname(1:ic-1)
+               CALL CD_GET_VAR_ID (dset, buff, varid, status)
+
+               IF (varid .GT. 0) THEN
+* Remove the digit 
+                  buff(ic:slen) = ' '
+                  GOTO 90
+
+               ENDIF
+
+ 80	    CONTINUE
+         ENDIF
+
+ 90      CONTINUE      
+
+         IF (status .NE. ferr_ok) GOTO 5100
+
+         status = NCF_GET_VAR_AXFLAG (dset, varid, coordvar, dir)
+
+      ELSE
+ 
+         varname = expression
+
+         IF ( INDEX(varname,'[') .GT. 0 ) THEN
+
+            dset = pdset_irrelevant	! default (not used ...)
+            CALL PARSE_NAM_DSET(varname, cx_last, dset,
+     .        category, ivar, mods_cx, status)
+            IF (status .NE. ferr_ok) GOTO 5000
+            slen = INDEX(varname,'[') 
+            varname(slen:) = ' ' 
+            slen = slen - 1
+         ENDIF
+         IF (dset .EQ. pdset_irrelevant .OR. 
+     .       dset .EQ. unspecified_int4) GO TO 5100
+
+         CALL CD_GET_VAR_ID (dset, varname(:slen), varid, status)
+      
+         IF (status .NE. ferr_ok) GOTO 5100
+
+         status = NCF_GET_VAR_AXFLAG (dset, varid, coordvar, dir)  
+
+      ENDIF
+
+* error exits
+ 5000 RETURN
+ 5100 status = ferr_invalid_command
+      RETURN
+ 5200 status = ferr_syntax
+      CALL ERRMSG( status, status, 'no closing parentheses'//
+     .			buff(:slen), *5000 )
+      END
diff --git a/fer/gnl/line_facts.F b/fer/gnl/line_facts.F
new file mode 100644
index 0000000..3ff622b
--- /dev/null
+++ b/fer/gnl/line_facts.F
@@ -0,0 +1,186 @@
+
+
+	SUBROUTINE LINE_FACTS( lun, idim, grid, orient )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* print basic facts about an axis defined in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/1/88 - extracted from SHOW_GRID - axis limits --> box_middle
+* revision 0.1 - 8/16/88 - elimiinated units, expanded title field
+* revision 0.2 - 2/6/89 - added modulo axis indicator 
+* V200:  9/22/89 - added "orient" for axes without particular orientations
+* SUN port 3/92 *sh* - "T" format specifiers cannot move to left
+*                    - changed format 3020
+* V230:  6/22/92 - allow for long axis names by truncating the title field
+*        1/93 - corrected left-over bug in format 3020 from SUN port A15->A14
+* V320: 12/20/94 - Put "(-)" along with "m" and "r" so it doesn't get
+*		truncated now that DEPTH(units) is the label
+*       12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V510 *sh* 12/99 - show units even if line has no orientation
+* V68  *acm 12/11 - if npts > 1.e7 the format overflowed. Up the size.
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations
+	INTEGER	  lun, idim, grid, orient
+
+* local variable declarations:
+	LOGICAL	BKWD_AXIS, GEOG_LABEL, calendar
+	INTEGER TM_LENSTR1, lo, hi, i, line, dlen, ndec, status,
+     .          nlen, naxlen, int1
+	CHARACTER AX_TITLE*32, 	lo_str*20, hi_str*20, direction*1,
+     .		  title*32, reg*1, modflag*1, truncated*1, frmt*50
+	REAL*8	TM_WORLD, lo_val8, hi_val8, pts
+
+
+* local parameter declarations:
+	INTEGER		sig_figs
+	PARAMETER     ( sig_figs = 5 )
+
+* pull line from grid table
+	line = grid_line( idim, grid )
+
+* line ok ?
+	risc_buff = ' '
+	IF ( line .EQ. munknown ) THEN
+	   title = 'unknown'
+	   WRITE ( risc_buff, 3010 ) title, ww_dim_name( idim )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ELSEIF ( line .EQ. mnormal ) THEN
+	   title = 'normal'
+	   WRITE ( risc_buff, 3010 ) title, ww_dim_name( idim )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ELSE
+
+* get nicely formatted limits (end box outer edges)
+	   calendar = idim .EQ. t_dim .AND. GEOG_LABEL( idim, grid )	
+	   lo_val8 = TM_WORLD( 1, grid, idim, box_middle )
+	   IF ( calendar ) THEN
+	      ndec = 5 		! accurate to minutes
+	   ELSE
+	      ndec = -sig_figs	! 5 sig places w/out extra zeros
+	   ENDIF
+	   CALL TRANSLATE_TO_WORLD( lo_val8, idim, grid, ndec, lo_str )
+	   hi_val8 = TM_WORLD( line_dim(line), grid, idim, box_middle )
+	   IF ( calendar ) THEN
+	      ndec = 5 
+	   ELSE
+	      ndec = -sig_figs
+	   ENDIF
+	   CALL TRANSLATE_TO_WORLD( hi_val8, idim, grid, ndec, hi_str )
+
+* axis oriented backwards ?
+	   IF ( BKWD_AXIS(idim, grid) ) THEN
+	      direction = '-'
+	   ELSE
+	      direction = ' '
+	   ENDIF
+
+* axis title
+	   IF ( orient .EQ. 0 ) THEN
+	      title = line_units(line)
+	      IF (title .EQ. ' ') THEN
+	         dlen = 1
+	      ELSE
+	         dlen = TM_LENSTR1(title)
+	         title = '('//line_units(line)(:dlen)//')'
+	         dlen = dlen + 2
+	      ENDIF
+	   ELSE
+	      title = AX_TITLE( idim, grid, dlen )
+	   ENDIF
+!	   title = title(:dlen)//direction	! 12/94 removed
+
+* regularly spaced ?
+	   IF ( line_regular( line ) ) THEN
+	     reg = 'r'
+	   ELSE
+	     reg = 'i'
+	   ENDIF
+
+* modulo ?
+	   IF ( line_modulo( line ) ) THEN
+	     modflag = 'm'
+	   ELSE
+	     modflag = ' '
+	   ENDIF
+
+* allow for long axis names (6/92)
+           nlen = MAX( TM_LENSTR1(line_name(line)), 9 )
+
+	   naxlen = INT(0.5+DLOG10(DFLOAT(line_dim(line))) ) 
+
+* write info
+	   int1 = 34 - (naxlen+1)
+	   naxlen = naxlen + 1
+	   IF (naxlen .LT. 10) THEN
+	      WRITE (frmt, 3020) int1, naxlen
+	   ELSE
+	      WRITE (frmt, 3030) int1, naxlen
+	   ENDIF
+
+           WRITE ( risc_buff, frmt )	line_name ( line )(:nlen),
+     .				title (:41-nlen),
+     .				line_dim  ( line ),
+     .				modflag,
+     .				reg,
+     .				direction,
+     .				lo_str,
+     .				hi_str
+
+
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ENDIF
+	RETURN
+
+ 3010	FORMAT ( T2,A8,T12,A1 )
+c 3020	FORMAT ( T2,A,1X,A,T27,I7,3A1,T39,A20,T60,A20 )
+c 3030	FORMAT ( T2,A,1X,A,T22,I12,3A1,T39,A20,T60,A20 )
+
+ 3020   FORMAT ('(T2,A,1X,A,T',I2,',I',I1',3A1,T39,A20,T60,A20 )')
+ 3030   FORMAT ('(T2,A,1X,A,T',I2,',I',I2',3A1,T39,A20,T60,A20 )')
+
+	END
diff --git a/fer/gnl/line_facts_xml.F b/fer/gnl/line_facts_xml.F
new file mode 100644
index 0000000..b95a9ea
--- /dev/null
+++ b/fer/gnl/line_facts_xml.F
@@ -0,0 +1,282 @@
+	SUBROUTINE LINE_FACTS_XML( lun, idim, grid, orient, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+* display basic facts about the given line in xml-style format 
+
+* programmer - Ansley Manke, based on line_facts.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+
+* 2/2005     bug 1171: the code checked line_regular instead
+*            of line_modulo for modulo attribute!
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600 *acm* 2/06 - Fix for bug 1394, send do_err flag to TM_DATE_REFORMAT
+* V602 *acm* 1/07 - add <direction> output -- I J K L for the axis.
+* V616  1/2009 *acm* Fixing LAS ticket 481, new style of xml output
+* V631 11/09 *acm* For XML-formatted output check for and replace the strings < > and &
+*                  with < etc.
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*      *acm* 3/13 Dont show axes with names in parentheses e.g. (AX004)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+        include 'errmsg.parm'
+	include 'xdset_info.cmn_text'
+	include 'netcdf.inc'
+
+* calling argument declarations
+	INTEGER	  lun, idim, grid, orient
+
+* local variable declarations:
+	LOGICAL	BKWD_AXIS, GEOG_LABEL,
+     .          calendar, new, got_it, coordvar
+	INTEGER TM_LENSTR, TM_LENSTR1, TM_GET_CALENDAR_ID, 
+     .          STR_SAME, line, slen, llen, ndec, cal_id, status,
+     .            varid, vtype, nvdims, vdims(8), nvatts, blen, i, 
+     .            len_attbuff, attoutflag, all_outflag, attid, 
+     .            attlen, attype, iatt, iset, dset, alen
+	CHARACTER TM_FMT*16, show_str*16, lo_str*20, hi_str*20, 
+     .            title*32, outbuff*20, aname*128,
+     .            attname*128, attbuff*2048, buff*20, outstring*2048,
+     .            atype*10, axis_name*128
+
+	REAL*8	TM_WORLD, lo_val8, hi_val8
+	REAL      vals(100), fval
+
+* local parameter declarations:
+	INTEGER		sig_figs
+	PARAMETER     ( sig_figs = 5 )
+
+ 2010	FORMAT ( '<axis name="', A8, 5x, A1, '">' )
+ 2020	FORMAT ( '<axis name="', A, '">' )
+ 2030	FORMAT ( '<attribute name="', A, '" type="char">' )
+ 2040	FORMAT ( '<attribute name="', A, '" type="short">' )
+ 2050	FORMAT ( '<attribute name="', A, '" type="double">' )
+ 2060   FORMAT ('   <value><![CDATA[', A, ' since ', A, ']]></value>')
+ 2070   FORMAT ('   <value>', A, '</value>')
+ 2075   FORMAT ('   <value><![CDATA[', A, ']]></value>')
+ 2080   FORMAT ('</attribute>')
+
+* pull line from grid table
+	line = grid_line( idim, grid )
+
+* line ok ?
+	risc_buff = ' '
+
+	IF ( line .EQ. munknown ) THEN
+	   title = 'unknown'
+	   WRITE ( risc_buff, 2010 ) title, ww_dim_name( idim )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           status = 0
+	ELSEIF ( line .EQ. mnormal ) THEN
+	   title = 'normal'
+	   WRITE ( risc_buff, 2010 ) title, ww_dim_name( idim )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           status = 0
+	ELSE
+
+	   axis_name = line_name(line)
+
+* header
+	   IF (axis_name(1:1) .EQ. '(') GOTO 5000
+
+           CALL ESCAPE_FOR_XML (axis_name, outstring, slen)
+	   WRITE ( risc_buff, 2020 ) outstring(1:slen)
+
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* axis units, including ... since start date if time axis
+
+* direction I,J,K, or L
+
+           buff = ss_dim_name(idim)
+           CALL ESCAPE_FOR_XML(buff, outstring, slen)
+           WRITE ( risc_buff, 2030 ) 'direction'
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2075 ) outstring(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2080 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* Units. Report since time origin for formatted time axis
+
+           slen = TM_LENSTR(line_units(line))
+           IF (line_units(line)(1:2) .NE. char_init 
+     .           .AND. slen.GT.0) THEN
+              
+              WRITE ( risc_buff, 2030 ) 'units'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              CALL ESCAPE_FOR_XML (line_units(line), outstring, slen)
+              WRITE (risc_buff, 2075) outstring(1:slen)
+
+              IF ( line_direction(line) .EQ. 'TI' ) THEN
+              
+	         buff = line_cal_name (line)
+	         cal_id = TM_GET_CALENDAR_ID (buff)
+
+	         IF (line_shift_origin(line)) THEN
+	            buff = '01-JAN-0001 00:00:00'
+	         ELSE
+	            buff = line_t0(line)
+	         ENDIF
+
+	         CALL TM_DATE_REFORMAT (buff, 1, cal_id, outbuff, 2, 
+     .               .TRUE., status) 
+                 llen = TM_LENSTR1(outbuff)
+                 WRITE (risc_buff, 2060) outstring(1:slen), outbuff(:llen)
+
+              ENDIF
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2080 )
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           ENDIF
+
+* line dimension
+
+           show_str = TM_FMT(FLOAT(line_dim(line)), 7,16,slen)
+	   CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+           WRITE ( risc_buff, 2040 ) 'length'
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2070 ) outstring(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2080 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+
+* start and end
+
+	   calendar = ( idim .EQ. t_dim .AND. GEOG_LABEL(idim, grid) )
+
+           lo_val8 = TM_WORLD( 1, grid, idim, box_middle )
+	   IF ( calendar ) THEN
+	      ndec = 5 		! accurate to minutes
+ 	      CALL TRANSLATE_TO_WORLD( lo_val8, idim, grid, ndec, lo_str )
+              CALL TM_DATE_REFORMAT (lo_str, 1, cal_id, outbuff, 2,
+     .                               .TRUE., status)
+              lo_str = outbuff
+	   ELSE
+	      ndec = -sig_figs	! 5 sig places w/out extra zeros
+	      fval = lo_val8
+	      lo_str = TM_FMT(fval, 7,16,slen)
+	   ENDIF
+
+	   hi_val8 = TM_WORLD( line_dim(line), grid, idim, box_middle )
+	   IF ( calendar ) THEN
+	      ndec = 5 
+	      CALL TRANSLATE_TO_WORLD( hi_val8, idim, grid, ndec, hi_str )
+              CALL TM_DATE_REFORMAT (hi_str, 1, cal_id, outbuff, 2,
+     .                               .TRUE., status) 
+              hi_str = outbuff
+	   ELSE
+	      ndec = -sig_figs
+	      fval = hi_val8
+	      hi_str = TM_FMT(fval, 7, 16, slen)
+	   ENDIF
+
+* Write the start and end; if dates then format them as for time origin.
+
+           WRITE ( risc_buff, 2050 ) 'start'
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           CALL ESCAPE_FOR_XML (lo_str, outstring, slen)
+
+           WRITE ( risc_buff, 2070 ) outstring(1:slen)
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2080 )
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           WRITE ( risc_buff, 2050 ) 'end' 
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           CALL ESCAPE_FOR_XML (hi_str, outstring, slen)
+
+           WRITE ( risc_buff, 2070 ) outstring(1:slen)
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2080 )
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* axis oriented backwards ?
+	   IF ( BKWD_AXIS(idim, grid) ) THEN
+              WRITE ( risc_buff, 2030 ) 'positive'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2075 ) 'down'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2080 )
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   ENDIF
+
+* regularly spaced ?
+           WRITE ( risc_buff, 2030 ) 'point_spacing'
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   IF ( line_regular( line ) ) THEN
+              WRITE ( risc_buff, 2075 ) 'even'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           ELSE
+              WRITE ( risc_buff, 2070 ) 'uneven'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           ENDIF
+           WRITE ( risc_buff, 2080 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* modulo ?
+           WRITE ( risc_buff, 2030 ) 'modulo'
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   IF ( line_modulo( line ) ) THEN
+              WRITE ( risc_buff, 2075 ) 'yes' 
+           ELSE
+              WRITE ( risc_buff, 2070 ) 'no'
+           ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2080 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* All attributes not already listed.
+
+1000    CONTINUE
+        status = ferr_ok
+	ENDIF
+	RETURN
+ 5000	status = -1
+	RETURN
+	END
diff --git a/fer/gnl/list_cmnd_data.F b/fer/gnl/list_cmnd_data.F
new file mode 100644
index 0000000..8371d3f
--- /dev/null
+++ b/fer/gnl/list_cmnd_data.F
@@ -0,0 +1,879 @@
+        SUBROUTINE LIST_CMND_DATA( grid_data, mr, cx,
+     .                             ax_buff, heading, head_enh, recsofar,
+     .                             perm, clobber, dods_file, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* list a gridded variable stored in memory - 0 to 6 dimensions
+* Note: the looping/axis labelling procedures of LIST_MULTI are cleaner and
+*	more efficient than this - this could be improved easily (*sh* 7/90)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/16/86
+* V200:  6/22/89 - major changes to accomodate 4D memory resident variables
+*		 - handle data sets that are indicated "irrelevant"
+*	  9/1/89 - accept permutation specification
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*	12/19/89 - eliminated the possibility of multiple data set variables
+*	  7/9/90 - extracted code fragments to subroutines MINMAX, VAR_DATA_FMT
+*		   and ROW_COORD_FMT to be shared with LIST_MULTI
+*		   changed POS_LAB call
+* V301: 11/1/93 - change to WRITE(ERR=...) processing for DEC compilers 
+* V313: 31/10/94 - size of row_ss_fmt increased due to ROW_COORD_FMT chg
+* V320: 10/5/94 - added code for /HEADING=enhanced
+*	11/9/94 - replaced all WRITE statements with SPLIT_LIST 
+*	12/28/94- added LIST/FORMAT=STREAM (add'l argument "recsofar")
+*		  and added units and T0 to /HEADING=enhanced (/xtm_grid.cmn)
+*	3/2/95  - fixed bug in SIZE output for /HEADING=enhanced
+* V420  9/28/95 - added tab and comma-delimited output format
+*		- line_buff increased hugely (from 132) to accomodate
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V500: *kob* 3/99 - up VAR_UNITS from 32 to 64 
+* V530:  8/00 *sh* - added support for string variables
+* V530:  3/01 *acm*- Put the calendar name in the heading if TIME not
+*		     otherwise listed, and if non-gregorian calendar.
+* V540: 11/01 *sh* - added LIST/WIDTH=
+*	           - expanded and reorganized the LIST heading
+* V552   2/03 *acm*- Increase line_buff to 10000
+* v553   9/03 *kob*- Increase GET_STRING_ELEMENT to 512 
+* V554   3/04 *acm*-For REPEAT/RANGE vars, add check for dset = unspecified_int4
+
+* V554   9/03 *acm* - add output in /DODS binary format, see the flag do_dods 
+*                     change this comment, so that the checkin under branch FDSv1
+*                     will occur.
+* v560   4/04 *acm* Very wide output needs a fix in the format specifier that is written.
+* V580   9/04 *acm* call ndig_coords to compute the precision needed to list the
+*                   coordinates in tab and comma delimited formats.  Note that if
+*                   precision more than 0.001 is needed for longitude and latitude
+*                   axes, then a change needs to be made in translate_to_world.
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600: *acm* 8/05 - Add new qualifier LIST/NOROWHEAD to remove labels that
+*                    start each row labelling the coordinate values. (bug 1273)
+* V650: *acm* 2/10 - Clean up line with coordinates on listings with tabs/commas
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	include 'xtm_grid.cmn_text'		! for line_units and t0
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xinterrupt.cmn'
+	include 'xrisc.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* local parameter declarations:
+	INTEGER		 min_field_width, max_line_len
+	PARAMETER     ( min_field_width = 4,
+     .			max_line_len = 10000 )
+
+* calling argument declarations:
+	LOGICAL		heading, head_enh, clobber
+	INTEGER		mr, cx, perm(nferdims), recsofar, status
+	REAL grid_data(m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif),
+     .       ax_buff(*)
+        CHARACTER*(*) dods_file
+	
+* local variable declarations:
+	LOGICAL		GEOG_LABEL, TM_DFPEQ, 
+     .			line_too_long, del_col_changed, all_bad,
+     .			valid(nferdims), need_doc(nferdims), span(nferdims), do_unform,
+     .			do_stream, do_comma_del, do_tab_del, itsa_string,
+     .			fortran_selfdoc, do_auto_fmt, do_dods, norow
+	INTEGER		TM_LENSTR, TM_LENSTR1, CX_DIM_LEN,
+     .			FIELD_WIDTH, MGRID_SIZE,
+     .			GET_MAX_C_STRING_LEN, TM_GET_CALENDAR_ID,
+     .			width, w0, grid, dlen, prec_digits,
+     .			ndim, lo(nferdims), hi(nferdims), del(nferdims),
+     .			i, j, k, l, m, n, npts, line_length, dset,
+     .			temp, num_fld_est, nleft, nright, alen, num_fields,
+     .			idim, vlen, istart, iend, ifield,
+     .			cleft, usable_line_len, max_fields, row_ax,
+     .			col_ax, places, col_dec, row_dec, row_wld, 
+     .			numbers, first, slen, llen, axis, lp, cal_id,
+     .                  wkblk, ndig(nferdims)
+	CHARACTER*255	VAR_TITLE, VAR_TITLE_MOD, PAREN_SURROUND, vname_buff
+* V500: *kob* 3/99 - up VAR_UNITS from 32 to 64 
+	CHARACTER	AX_TITLE*32, VAR_UNITS*64, LEFINT*8, TM_FMT*16,
+     .			GET_STRING_ELEMENT*512,
+     .			line_buff*10000, 
+     .			good_data_form*10, row_ss_fmt*14, tab_or_comma*1,
+     .			bad_data_form*10, col_head_format*32, cal_name*32
+	REAL		BOX_SIZE, big, small, biggest, bad_data, value
+	REAL*8		TM_WORLD, val8, val_last, diff_min, diff_ave, count
+
+
+* convenience equivalence:* convenience equivalence:
+        INTEGER         lo1, lo2, lo3, lo4, lo5, lo6, 
+     .                  hi1, hi2, hi3, hi4, hi5, hi6, 
+     .                  del1, del2, del3, del4, del5, del6
+        EQUIVALENCE     (lo1, lo(1)), (lo2, lo(2)), (lo3, lo(3)),  
+     .                  (lo4, lo(4)), (lo5, lo(5)), (lo6, lo(6)),
+     .                  (hi1, hi(1)), (hi2, hi(2)), (hi3, hi(3)),  
+     .                  (hi4, hi(4)), (hi5, hi(5)), (hi6, hi(6)),
+     .                  (del1,del(1)),(del2,del(2)),(del3,del(3)),
+     .                  (del4,del(4)),(del5,del(5)),(del6,del(6))
+
+
+* initialize
+	status		= ferr_ok
+	grid		= mr_grid( mr )
+	bad_data	= mr_bad_data( mr )
+	line_too_long	= .FALSE.
+	del_col_changed	= .FALSE.
+	width		= min_field_width
+        do_unform       = list_fmt_type .EQ. plist_unformatted
+        do_dods         = list_fmt_type .EQ. plist_dods
+        do_stream       = list_fmt_type .EQ. plist_stream
+        do_comma_del    = list_fmt_type .EQ. plist_comma_del
+        do_tab_del      = list_fmt_type .EQ. plist_tab_del
+        do_auto_fmt     = list_fmt_type .EQ. plist_default
+	fortran_selfdoc = head_enh .AND. list_format_given
+	itsa_string     = mr_type(mr) .EQ. ptype_string
+        norow = qual_given(slash_list_norow) .GT. 0
+
+* determine precision for outputting values
+	lp = qual_given( slash_list_precision ) 
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                     value, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   prec_digits = MAX(1.,MIN(value, 16.))	! 1 to 16	   
+	ELSE
+	   prec_digits = list_digits
+	ENDIF
+
+* determine maximum width of the output records
+	lp = qual_given( slash_list_width )
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                     value, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   i = value
+	   line_length  = MIN(ABS(i),max_line_len)
+	ELSE
+	   line_length  = 130
+	ENDIF
+
+* determine row and column axes and how many axes are "significant"
+	row_ax = perm(1)
+	col_ax = perm(2)
+	ndim = 0
+	DO 10 ndim = nferdims, 1, -1
+	   IF ( CX_DIM_LEN( perm(ndim), cx ) .GT. 1 ) GOTO 20
+ 10	CONTINUE
+	ndim = 0
+ 20	DO 30 idim = 1, nferdims
+	   span(idim) = CX_DIM_LEN( perm(idim), cx ) .GT. 1
+	   valid(idim) = cx_lo_ss( cx, perm(idim) ) .NE. unspecified_int4
+ 30	CONTINUE
+* * * * * * WRITE INTRODUCTORY LINES * * * * *
+	IF ( do_unform .OR. do_stream .OR. do_dods .OR.
+     .       .NOT.heading ) GOTO 200
+* ... first the variable name
+	vname_buff   = VAR_TITLE( cx )
+	vlen   = TM_LENSTR1( vname_buff )
+	vname_buff   = vname_buff(:vlen)//' '//
+     .				PAREN_SURROUND(VAR_UNITS(cx), alen)
+	CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				'             VARIABLE : '//vname_buff, 0)
+
+* ... qualify title with modification line ?
+	vname_buff = VAR_TITLE_MOD( cx )
+	vlen   = TM_LENSTR( vname_buff )
+	IF ( vlen .GT. 0 ) CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .			'                        '//vname_buff(1:vlen),
+     .				      vlen+24)
+
+* ... then DATA SET
+	dset = cx_data_set(cx)
+	IF ( dset .NE. pdset_irrelevant .AND.        ! for REPEAT/RANGE vars, add 
+     .       dset .NE. unspecified_int4) THEN        ! check for unspecified_int4
+* ... title
+	   CALL GET_DSET_TITLE( cx_data_set(cx), line_buff, slen )
+	   IF (line_buff .NE. ' ') THEN
+	     CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			'             DATA SET : '//
+     .			 line_buff(1:slen), slen+24)
+	   ENDIF
+* ... find split point between filename and path
+	   slen = TM_LENSTR1(ds_des_name(dset))
+	   DO i = slen, 1, -1
+	      IF ( ds_des_name(dset)(i:i) .EQ. '/' ) GOTO 34
+	   ENDDO
+	   i = 0
+* ... filename
+ 34	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			'             FILENAME : '//
+     .			ds_des_name(dset)(i+1:slen), 24+(slen-i))
+* ... DODS URL BASE or ABSOLUTE PATH
+* *kob* v553 - CYGWIN paths are always preceded by '.'
+#ifdef __CYGWIN__
+	   IF (i.GT.0 .AND.  ds_des_name(dset)(2:2).EQ.'\')
+#else
+	   IF (i.GT.0 .AND.  ds_des_name(dset)(1:1).NE.'.')
+#endif
+     .			CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			'             FILEPATH : '//
+     .			 ds_des_name(dset)(:i), i+24)
+	ENDIF
+
+* ... BAD FLAG: xxx
+	IF (.NOT.fortran_selfdoc) THEN
+	   IF (.NOT.do_auto_fmt) THEN
+	     line_buff = ' '
+	     WRITE ( line_buff, '(1PG14.7)' ) cx_bad_data(cx)
+	     line_buff = TM_FMT(cx_bad_data(cx),prec_digits,16,vlen)
+	     CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .			'             BAD FLAG : '//
+     .		        line_buff, 38 )
+	   ENDIF
+* ... SUBSET:   e.g. "Nx by Ny (longitude-latitude)"
+	   line_buff = '             SUBSET   : '
+	   l = 24
+	   DO idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         i = perm(idim)
+	         j = CX_DIM_LEN ( i, cx )
+	         line_buff = line_buff(:l)//LEFINT( j, vlen )
+	         l = l + vlen
+	         line_buff = line_buff(:l)//' by '
+	         l = l + 4
+	      ENDIF
+	   ENDDO
+	   IF ( l.GT.24) THEN
+	      line_buff(l-3:l+7) = ' points (  '
+	      l = l + 5
+	      DO idim = 1, nferdims
+	         IF ( span(idim) ) THEN
+	            line_buff = line_buff(:l)//
+     .				AX_TITLE(perm(idim), cx_grid(cx), vlen)
+	            l = l + vlen
+	            line_buff = line_buff(:l)//'-'
+	            l = l + 1
+	         ENDIF
+	      ENDDO
+	      line_buff(l:l) = ')'
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			      line_buff(:l), l)
+	   ENDIF
+	ENDIF
+
+* ... which axes require labels
+	DO 35 idim = 1, nferdims
+ 35	need_doc(idim) = .TRUE.
+	IF ( .NOT.(do_unform.OR.do_dods.OR.list_format_given) ) THEN
+	   DO 36 idim = 1, ndim
+ 36	   need_doc(idim) = CX_DIM_LEN( perm(idim), cx ) .EQ. 1
+	ENDIF
+
+* ... if not indicated in time label show a nonstandard calendar name
+	cal_name = line_cal_name( grid_line(t_dim, grid) )
+	cal_id = TM_GET_CALENDAR_ID (cal_name)
+	DO i = 1, nferdims
+	   idim = perm(i)
+	   IF ( .NOT.need_doc(i) .AND. idim.EQ.t_dim .AND.
+     .	     cal_id .GT. gregorian .AND. cal_id .LE. max_calendars) THEN
+	      slen = TM_LENSTR(cal_name)
+	      CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .                  '             CALENDAR : '
+     .			//cal_name(:slen), slen+24)
+	   ENDIF
+	ENDDO
+
+* ... region information
+	DO 60 i = 1, nferdims
+	   idim = perm(i)
+	   IF ( need_doc(i) ) THEN
+	      IF ( cx_lo_ww( idim,cx ) .NE. unspecified_val8 ) THEN 
+	         CALL ASCII_LIMITS( cx, idim, line_buff, vlen )
+	         col_head_format = AX_TITLE( idim, grid, alen )
+	         IF (alen .LT. 9) alen = 9
+	         CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .			'             '//col_head_format( :alen )//': '
+     .			//line_buff(1:vlen), alen+vlen+15)
+	      ENDIF
+	   ENDIF
+ 60	CONTINUE
+
+* * * * * DETERMINE LIST LIMITS * * *
+ 200	DO 210 i = 1, nferdims
+	   idim = perm(i)
+	   lo(i) = cx_lo_ss( cx, idim )
+	   hi(i) = cx_hi_ss( cx, idim )
+	   del(i)= 1
+ 210	CONTINUE
+
+
+
+* * * * *  ENHANCED HEADING STUFF (10/94) * * * * *
+	IF ( fortran_selfdoc ) THEN
+* ... GEOMETRY: xxx
+	   line_buff = ' '
+	   i = 1	   
+	   DO 220 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         line_buff(i:i) = ww_dim_name(perm(idim))
+	         i = i + 1
+	      ENDIF
+ 220	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				'             GEOMETRY: '//
+     .			 	line_buff(:i), i+23)
+
+* ... SIZE: xxx
+	   line_buff = ' '
+	   l = 1
+	   DO 230 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         i = perm(idim)
+	         j = CX_DIM_LEN ( i, cx )
+	         line_buff = line_buff(:l)//LEFINT( j, vlen )
+	         l = l + vlen + 2
+	      ENDIF
+ 230	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				'             SIZE: '//
+     .			 	line_buff(:l), l+19)
+
+* ... FORTRAN FORMAT: xxx
+	   IF ( list_format .EQ. '(5(1PG12.5))' ) THEN
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             FORTRAN FORMAT: (5F12.5)', 37 )
+	   ELSE
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             FORTRAN FORMAT: '//list_format, 0)
+	   ENDIF
+
+* ... MISSING VALUE FLAG: xxx
+	   line_buff = ' '
+	   WRITE ( line_buff, 3062 ) cx_bad_data(cx)
+ 3062	   FORMAT( 13x,'MISSING VALUES FLAG: ',1PG14.7)
+	   CALL SPLIT_LIST( pttmode_explct, list_lun, line_buff, 0 )
+
+* ... axis COORDINATES:
+	   DO 250 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         line_buff = ' '
+	         i = perm(idim)
+	         axis = grid_line(i, cx_grid(cx) )
+	         WRITE ( line_buff, 3065 ) ww_dim_name(i)
+ 3065	         FORMAT(A1,' COORDINATES: ')
+	         line_buff(16:) = line_units(axis)
+	         alen = TM_LENSTR1( line_buff )
+	  	 IF (  i .EQ. t_dim ) THEN		! add T0=
+	            IF ( GEOG_LABEL(i,cx_grid(cx)) ) THEN 
+	               line_buff(alen+2:) =  '(T0='//line_t0(axis)
+                       IF (line_shift_origin(axis)) 
+     .                  line_buff(alen+2:) =  '(T0=01-JAN-0001 00:00:00'
+	               alen = TM_LENSTR1( line_buff )
+	               line_buff(alen+1:) =  ')'
+	               alen = alen + 1
+	            ENDIF
+	         ENDIF
+	         CALL SPLIT_LIST(pttmode_explct,list_lun,line_buff,alen)
+	         npts =  hi(idim)-lo(idim)+1
+                 CALL MAKE_AXIS(cx_grid(cx),i,lo(idim),hi(idim),ax_buff)
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+	         WRITE ( list_lun, list_format ) (ax_buff(j),j=1,npts)
+	      ENDIF
+ 250	   CONTINUE
+* ... DATA:
+	     CALL SPLIT_LIST(pttmode_explct, list_lun, 'DATA:', 5 )
+	ENDIF
+
+* * * * * LIST DATA UNFORMATTED OR WITH USER FORMAT (no frills)
+
+
+	IF ( do_dods) THEN
+           CALL WRITE_DODS_FMT (grid_data, 
+     .           m1lox,m1hix, m1loy,m1hiy, m1loz,m1hiz, m1lot,m1hit, 
+     .           ax_buff, dods_file, clobber, status)
+
+* done - 
+	   RETURN
+        ENDIF
+
+	IF ( do_unform
+     .	.OR. do_stream
+     .	.OR. list_format_given ) THEN
+
+	   DO 300 n = lo6, hi6, del6
+	   DO 300 m = lo5, hi5, del5
+	   DO 300 l = lo4, hi4, del4
+	   DO 300 k = lo3, hi3, del3
+	   DO 300 j = lo2, hi2, del2
+	      IF ( interrupted ) RETURN
+! ----- start string handler -------------
+	      IF (itsa_string) THEN
+	         llen = 0
+	         DO 270 i = lo1, hi1, del1
+	            line_buff(llen+1:) = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,
+     .			m1loe,m1hie,m1lof,m1hif,grid_data,i,j,k,l,m,n,
+     .			max_line_len,slen )
+	            llen = MIN(max_line_len-1, llen+slen)
+	            IF (do_stream) THEN
+	               llen = llen + 1
+	               line_buff(llen:llen) = CHAR(0) ! NULL terminator
+	            ENDIF
+ 270		 CONTINUE
+	         IF ( do_unform ) THEN
+	            WRITE (list_lun, ERR=5010) line_buff(:llen)
+	         ELSEIF ( do_stream ) THEN
+	            recsofar = recsofar + 1
+	            WRITE (list_lun, REC=recsofar, ERR=5010)
+     .						 line_buff(:llen)
+	         ELSE
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+	            DO 272 i = lo1, hi1, del1
+	               line_buff = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,
+     .			m1loe,m1hie,m1lof,m1hif,grid_data,i,j,k,l,m,n,
+     .			max_line_len,slen )
+	               WRITE (list_lun,list_format, ERR=5010)
+     .							line_buff(:slen)
+ 272		    CONTINUE
+	         ENDIF
+	         GOTO 300
+	      ENDIF
+! ----- end string handler -------------
+	      IF ( do_unform ) THEN
+	         WRITE (list_lun, ERR=5010)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+
+	      ELSEIF ( do_stream ) THEN				! 12/94
+	         DO 298 i = lo1, hi1, del1
+	            recsofar = recsofar + 1
+	            WRITE (list_lun, REC=recsofar, ERR=5010)
+     .						grid_data(i,j,k,l,m,n)
+ 298		 CONTINUE
+	      ELSE
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+#ifdef DEC_FORTRAN
+* on DEC compilers a field too small for the value generates an ERR= branch
+	         WRITE (list_lun,list_format, IOSTAT=ios)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+	         IF ( ios.NE.0 .AND. ios.NE.63 ) GOTO 5010  ! 63 = fmt conv err
+#else
+	         WRITE (list_lun,list_format, ERR=5010)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+#endif
+	      ENDIF
+ 300	   CONTINUE
+
+* done - go home
+	   RETURN
+
+* 9/95 - COMMA OR TAB DELIMITED OUTPUT ... some frills  but not too many
+* (note that indent levels aren't changed for k and l loops)
+	ELSEIF ( do_comma_del .OR. do_tab_del ) THEN
+* ... column headings for tab and comma-delimited output (9/95)
+	   IF ( do_comma_del ) THEN
+	      tab_or_comma = ','
+	   ELSEIF( do_tab_del ) THEN
+	      tab_or_comma = CHAR(9)
+	   ENDIF
+	   IF ( do_comma_del) 
+     .       line_buff(1:line_length) = '   '
+	   IF ( do_tab_del) 
+     .       line_buff(1:line_length) = '  '//tab_or_comma
+	   alen = 3
+
+           IF (perm(2) .EQ. 4) THEN ! time axis on the left      
+	      IF ( do_comma_del) 
+     .          line_buff(1:line_length) = '          '
+	      IF ( do_tab_del) 
+     .          line_buff(1:line_length) = '         '//tab_or_comma
+	      alen = 10
+           ENDIF
+
+* Get number of decimal places for formatting the row coordinates
+
+           ndig(row_ax)= ax_dec_pt(row_ax)
+           CALL NDIG_COORDS (grid, row_ax, lo1, hi1, del1, 
+     .        bad_data, ndig(row_ax), ax_dec_pt(row_ax) )
+
+* Get number of decimal places for formatting the column coordinates
+
+           ndig(col_ax) = ax_dec_pt(col_ax)
+           CALL NDIG_COORDS (grid, col_ax, lo2, hi2, del2, 
+     .        bad_data, ndig(col_ax), ax_dec_pt(col_ax) )
+
+* Get number of decimal places for formatting coordinate labels
+
+           ndig(perm(3)) = ax_dec_pt(perm(3))
+	   IF ( ndim .GE. 3 .AND. valid(3) .AND. 
+     .          ax_dec_pt(perm(3)) .GE. 0 ) 
+     .        CALL NDIG_COORDS (grid, perm(3), lo3, hi3, del3, 
+     .           bad_data, ndig(perm(3)), ax_dec_pt(perm(3)) )
+
+           ndig(perm(4)) = ax_dec_pt(perm(4))
+	   IF ( ndim .GE. 4 .AND. valid(4) ) 
+     .        CALL NDIG_COORDS (grid, perm(4), lo4, hi4, del4, 
+     .           bad_data, ndig(perm(4)), ax_dec_pt(perm(4)) )
+
+* Write coordinates
+
+	   DO 330 i = lo1, hi1, del1
+	      val8 = TM_WORLD( i, grid, row_ax, box_middle )
+	      width = FIELD_WIDTH(val8, grid, row_ax, ndig(row_ax),
+     .					numbers)
+	      alen = alen + width
+	      IF ( alen .GT. max_line_len ) THEN
+	         line_buff(max_line_len-18:max_line_len) = 
+     .			'** line too long **'
+	         alen = max_line_len
+	         GOTO 331
+	      ENDIF
+	      CALL TRANSLATE_TO_WORLD
+     .		      ( val8,
+     .			row_ax,
+     .			grid,
+     .			ndig(row_ax),
+     .			line_buff(alen-(width-1):alen) )
+	      IF ( i .LT. hi1 ) THEN
+	         alen = alen + 1
+	         line_buff(alen:alen) = tab_or_comma
+	      ENDIF
+ 330	   CONTINUE
+ 331	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				line_buff(:alen), alen )
+
+	   DO 350 n = lo6, hi6, del6
+* ... label the block of blocks (6th dimension)
+	      IF ( ndim .GE. 6 .AND. valid(6) ) THEN
+	         CALL POS_LAB( l, cx, perm(6),
+     .			    ndig(perm(6)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 m = lo5, hi5, del5
+* ... label the block of blocks (5th dimension)
+	      IF ( ndim .GE. 5 .AND. valid(5) ) THEN
+	         CALL POS_LAB( l, cx, perm(5),
+     .			    ndig(perm(5)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 l = lo4, hi4, del4
+* ... label the block of blocks (4th dimension)
+	      IF ( ndim .GE. 4 .AND. valid(4) ) THEN
+	         CALL POS_LAB( l, cx, perm(4),
+     .			    ndig(perm(4)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 k = lo3, hi3, del3
+* ... label a single block (3rd dimension)
+	      IF ( ndim .GE. 3 .AND. valid(3) ) THEN
+	         CALL POS_LAB( k, cx, perm(3),
+     .			       ndig(perm(3)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 j = lo2, hi2, del2
+	      IF ( interrupted ) RETURN
+* ...  create label for this row
+	         IF ( ndim .GE. 2 .AND. valid(2) ) THEN
+	            CALL TRANSLATE_TO_WORLD
+     .		      ( TM_WORLD( j, grid, col_ax, box_middle ),
+     .			col_ax, grid, ndig(col_ax), line_buff(:16) )
+	            alen = TM_LENSTR1(line_buff(:16))
+	         ELSE	! 1D row-only (will this ever happen?)
+	            line_buff(1:5) = 'row 1'	
+	            alen = 5
+	         ENDIF
+* ...  and append the values for this row
+	         DO 340 i = lo1, hi1, del1
+	            IF ( itsa_string ) THEN
+	               line_buff = line_buff(:alen)//tab_or_COMMA//
+     .			GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,
+     .			m1loe,m1hie,m1lof,m1hif,grid_data,i,j,k,l,m,n,
+     .			max_line_len,vlen )
+	            ELSE
+	               line_buff = line_buff(:alen)//tab_or_COMMA//
+     .			TM_FMT(grid_data(i,j,k,l,m,n),prec_digits,16,vlen)
+	            ENDIF
+	            alen = alen+vlen+1
+	            IF ( alen .GT. max_line_len ) THEN
+	               line_buff(max_line_len-18:max_line_len) = 
+     .			'** line too long **'
+	               alen = max_line_len
+	               GOTO 341
+	            ENDIF
+ 340	         CONTINUE
+ 341	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				line_buff(:alen), alen )
+ 350	   CONTINUE
+* done - go home
+	   RETURN
+	ENDIF
+
+* * * * PREPARE FORMATS ADAPTED TO THE DATA AND AXIS RANGES
+* ... row labelling
+	IF ( ndim .GE. 2 .AND. valid(2) ) THEN
+	   CALL ROW_COORD_FMT( col_ax, cx, lo2, hi2, del2,
+     .			       row_ss_fmt, col_dec, row_wld, cleft )
+	ELSE
+	   cleft = 7
+	   line_buff(:cleft) = ' '		! just 1 value to write
+	ENDIF
+        IF (norow) cleft = 0
+
+	usable_line_len = line_length - cleft
+	max_fields = usable_line_len / min_field_width
+* ... column labelling - how many decimal places for coordinate label ?
+	IF ( ndim .GE. 1 .AND. valid(1) ) THEN
+	   small = +1.E33
+	   DO 404 i = lo1, hi1, del1
+	      small = MIN( small, BOX_SIZE( i, grid, row_ax ) )
+ 404	   CONTINUE	      
+	   CALL GET_PREC_DIGITS( cx_lo_ww(row_ax,cx),
+     .				 cx_hi_ww(row_ax,cx),
+     .				 small, places, row_dec )
+	   row_dec = row_dec + 1		! add 1 more, arbitrarily
+	ENDIF
+
+* ... determine numeric format to fit nicely on the line
+* ... first find largest value to be printed
+! bug here since the mem res data limits may not match the cx limits 8/00 *sh*
+	IF ( itsa_string ) THEN
+	   nleft = GET_MAX_C_STRING_LEN(mr_c_pointer(mr), MGRID_SIZE(mr))
+	   all_bad = .FALSE.
+	ELSE
+	   CALL MINMAX(grid_data, MGRID_SIZE(mr), bad_data, small, big)
+	   all_bad = small .EQ. arbitrary_large_val4
+
+* . . . how many digits right and left of decimal point ?
+ 	   biggest = MAX( ABS( small ), big )
+	   CALL GET_SIG_DIGITS( biggest, prec_digits, nleft, nright )
+	   nleft = MAX( 1, nleft )			! at least "0" to left
+	ENDIF
+
+* . . . unreasonable line length ?
+ 410	IF ( ndim .EQ. 0 ) THEN
+	   num_fields = 1
+	ELSE
+	   num_fields = ABS( (hi1-lo1) / del1  + 1 )
+	   IF ( num_fields .GT. max_fields ) line_too_long = .TRUE.
+* . . . shorten the line to something that will fit
+	   IF ( line_too_long ) THEN
+	      num_fld_est	= usable_line_len / width
+	      temp		= ABS(hi1-lo1) / num_fld_est + 1.
+	      del1		= SIGN( temp, del1 )		! for del1<0
+	      num_fields 	= ABS( (hi1-lo1) / del1 + 1 )
+	      del_col_changed	= .TRUE.
+	   ENDIF
+	ENDIF
+
+* . . . determine FORTRAN format for listing
+	IF ( all_bad ) THEN
+	   width = min_field_width
+	   WRITE ( bad_data_form, 3002 ) min_field_width
+ 3002	FORMAT ( '(A',I2,')' )	
+	ELSE
+	   IF ( itsa_string ) THEN
+	      width = nleft + 2
+	   ELSE
+	      CALL VAR_DATA_FMT( nleft, nright, prec_digits, min_field_width,
+     .			      width, good_data_form, bad_data_form )
+	   ENDIF
+	ENDIF
+
+* . . . will it fit ? - if not go back and try again with a shorter line
+	dlen = cleft + width*num_fields
+* . . . *kob* 9/03 - we do not want to set line_to_long to true for strings -
+*                    results in a hang because dlen doesn't get changed or 
+*                    shortened and so this will always be true for long strings
+*		     and we will be sent back to 410 ad naseum
+	IF ( dlen .GT. line_length .AND. .NOT. itsa_string ) THEN
+	   line_too_long = .TRUE.
+	   GOTO 410
+	ENDIF
+	
+* . . . notify operator if were skipping some data
+	IF ( del_col_changed ) THEN
+	   WRITE ( line_buff, 3005 ) del1
+ 3005	FORMAT ( 5X,' ... listing every',I4,'th point' )
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff, 35 )
+	ENDIF
+
+* . . . write a heading line of coordinate values and subscripts ?
+	IF ( heading .AND. ndim.GE.1 .AND. valid(1) ) THEN
+	   line_buff(1:line_length) = ' '
+	   w0 = cleft + 2	! 2 col arbitrary shift to align
+	   DO 420 i = lo1, hi1, del1
+	      val8 = TM_WORLD( i, grid, row_ax, box_middle )
+	      first = FIELD_WIDTH(val8, grid, row_ax, row_dec, numbers)
+	      first = 1 + MAX( 0, (width-first)/2 )	! centered
+	      CALL TRANSLATE_TO_WORLD
+     .		      ( val8,
+     .			row_ax,
+     .			grid,
+     .			row_dec,
+     .			line_buff(w0+first:w0+width) )
+	      w0 = w0 + width
+ 420	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				' '//line_buff(:w0), w0+1 )
+
+* . . .  then subscript values ...
+	   WRITE ( col_head_format, 3020 ) cleft+1-(width-3)/2,
+     .					      num_fields,  width
+	   WRITE ( line_buff, col_head_format ) ( i,i = lo1,hi1,del1 ) 
+ 3020	   FORMAT ( '(',I2,'X,',I5,'I',I2,')' )	! eg. "( 8X, 10I 6)"
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff, 0 )
+	ENDIF
+
+* . . . list column of latitudes backwards (north to south)
+	IF ( col_ax.EQ.Y_dim .AND. GEOG_LABEL(y_dim,grid) ) THEN
+	   del2 = -1
+	   temp = lo2
+	   lo2  = hi2
+	   hi2  = temp
+	ENDIF
+
+* * * * *  WRITE FORMATTED DATA LINES * * * * *
+* each line has format: "coord/sub: data1 data2 data3 ..."
+* for a 2D field a single block of such lines is printed
+* for a 3D field each block is separated by an identifier of the 3rd axis
+* for a 4D field each block of blocks is further separated and identified
+
+	DO 550 n = lo6, hi6, del6
+* label the block of blocks (6th dimension)
+	   IF ( ndim .GE. 6 .AND. valid(6) ) THEN
+	      CALL POS_LAB( n, cx, perm(6),
+     .			    ax_dec_pt(perm(6)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	   ENDIF
+
+	DO 540 m = lo5, hi5, del5
+* label the block of blocks (5th dimension)
+	   IF ( ndim .GE. 5 .AND. valid(5) ) THEN
+	      CALL POS_LAB( m, cx, perm(5),
+     .			    ax_dec_pt(perm(5)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	   ENDIF
+
+	DO 530 l = lo4, hi4, del4
+* label the block of blocks (4th dimension)
+	   IF ( ndim .GE. 4 .AND. valid(4) ) THEN
+	      CALL POS_LAB( l, cx, perm(4),
+     .			    ax_dec_pt(perm(4)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	   ENDIF
+
+	   DO 520 k = lo3, hi3, del3
+*    label a single block (3rd dimension)
+	      IF ( ndim .GE. 3 .AND. valid(3) ) THEN
+	         CALL POS_LAB( k, cx, perm(3),
+     .			       ax_dec_pt(perm(3)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+
+	      DO 510 j = lo2, hi2, del2
+*       create carefully sized label for this row
+	         IF ( ndim .GE. 2 .AND. valid(2) .AND. 
+     .               (.NOT.norow) ) THEN
+	            CALL TRANSLATE_TO_WORLD
+     .		      ( TM_WORLD( j, grid, col_ax, box_middle ),
+     .			col_ax, grid, col_dec, line_buff(:row_wld) )
+	            WRITE ( line_buff(row_wld+1:cleft), row_ss_fmt ) j
+	         ENDIF
+	         ifield = 0
+
+	         DO 500 i = lo1, hi1, del1
+* put values into the output line buffer
+	         ifield = ifield + 1
+	         iend   = cleft + ifield*width
+	         istart = iend - width + 1
+	         IF (itsa_string) THEN
+	           line_buff(istart:istart) = '"'
+	           line_buff(istart+1:iend) = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,
+     .			m1loe,m1hie,m1lof,m1hif,grid_data,i,j,k,l,m,n,
+     .			width-2,slen)
+	           IF (slen .GT. width-2) THEN
+	              line_buff(iend-3:iend) = '..."'
+	           ELSE
+	              line_buff(istart+slen+1:istart+slen+1) = '"'
+	           ENDIF
+	         ELSE
+	           value = grid_data(i,j,k,l,m,n)
+	           IF ( value .NE. bad_data ) THEN
+	              WRITE ( line_buff(istart:iend), good_data_form ) value
+	           ELSE
+	              WRITE ( line_buff(istart:iend),  bad_data_form ) '....'
+	           ENDIF
+	         ENDIF
+ 500	         CONTINUE
+
+	         IF ( interrupted ) RETURN
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .					' '//line_buff(:dlen),dlen+1) 
+ 510	      CONTINUE
+ 520	   CONTINUE
+ 530	CONTINUE
+ 540	CONTINUE
+ 550	CONTINUE
+
+* successful completion
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_erreq, status, list_format, *5000 )
+	END
diff --git a/fer/gnl/list_cmnd_data_xml.F b/fer/gnl/list_cmnd_data_xml.F
new file mode 100644
index 0000000..b923a7a
--- /dev/null
+++ b/fer/gnl/list_cmnd_data_xml.F
@@ -0,0 +1,888 @@
+        SUBROUTINE LIST_CMND_DATA_XML( grid_data, mr, cx,
+     .                             ax_buff, heading, head_enh, recsofar,
+     .                             perm, clobber, dods_file, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* list a gridded variable stored in memory - 0 to 6 dimensions
+* Note: the looping/axis labelling procedures of LIST_MULTI are cleaner and
+*	more efficient than this - this could be improved easily (*sh* 7/90)
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	include 'xtm_grid.cmn_text'		! for line_units and t0
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xinterrupt.cmn'
+	include 'xrisc.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* local parameter declarations:
+	INTEGER		 min_field_width, max_line_len
+	PARAMETER     ( min_field_width = 4,
+     .			max_line_len = 10000 )
+
+* calling argument declarations:
+	LOGICAL		heading, head_enh, clobber
+	INTEGER		mr, cx, perm(nferdims), recsofar, status
+	REAL grid_data(m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif),
+     .       ax_buff(*)
+        CHARACTER*(*) dods_file
+	
+* local variable declarations:
+	LOGICAL		GEOG_LABEL, TM_DFPEQ, 
+     .			line_too_long, del_col_changed, all_bad,
+     .			valid(nferdims), need_doc(nferdims), span(nferdims), do_unform,
+     .			do_stream, do_comma_del, do_tab_del, itsa_string,
+     .			fortran_selfdoc, do_auto_fmt, do_dods, norow
+	INTEGER		TM_LENSTR, TM_LENSTR1, CX_DIM_LEN,
+     .			FIELD_WIDTH, MGRID_SIZE,
+     .			GET_MAX_C_STRING_LEN, TM_GET_CALENDAR_ID,
+     .			width, w0, grid, dlen, prec_digits,
+     .			ndim, lo(nferdims), hi(nferdims), del(nferdims),
+     .			i, j, k, l, m, n, npts, line_length, dset,
+     .			temp, num_fld_est, nleft, nright, alen, num_fields,
+     .			idim, vlen, istart, iend, ifield,
+     .			cleft, usable_line_len, max_fields, row_ax,
+     .			col_ax, places, col_dec, row_dec, row_wld, 
+     .			numbers, first, slen, llen, axis, lp, cal_id,
+     .                  wkblk, ndig(nferdims)
+	CHARACTER*255	VAR_TITLE, VAR_TITLE_MOD, PAREN_SURROUND, vname_buff
+* V500: *kob* 3/99 - up VAR_UNITS from 32 to 64 
+	CHARACTER	AX_TITLE*32, VAR_UNITS*64, LEFINT*8, TM_FMT*16,
+     .			GET_STRING_ELEMENT*512,
+     .			line_buff*10000, entry_value*30, row_value*30,
+     .                  k_value*30, l_value*30,
+     .			good_data_form*10, row_ss_fmt*14, tab_or_comma*1,
+     .			bad_data_form*10, col_head_format*32, cal_name*32
+	REAL		BOX_SIZE, big, small, biggest, bad_data, value
+	REAL*8		TM_WORLD, val8, val_last, diff_min, diff_ave, count
+
+* convenience equivalence:
+	INTEGER		lo1, lo2, lo3, lo4, lo5, lo6, 
+     .			hi1, hi2, hi3, hi4, hi5, hi6, 
+     .			del1, del2, del3, del4, del5, del6
+     .			i1, i2, i3, i4, i5, i6
+	EQUIVALENCE	(i1, pt(1)) , (i2, pt(2)) , (i3, pt(3)),  (i4,pt(4)),
+     .			(i5, pt(5)),  (i6,pt(6)),
+     .			(lo1, lo(1)), (lo2, lo(2)), (lo3,lo(3)),  (lo4,lo(4)),
+     .			(lo5,lo(5)),  (lo6,lo(6)),
+     .			(hi1, hi(1)), (hi2, hi(2)), (hi3,hi(3)),  (hi4,hi(4)),
+     .			(hi5,hi(5)),  (hi6,hi(6)),
+     .			(del1,del(1)),(del2,del(2)),(del3,del(3)),(del4,del(4)),
+     .			(del5,del(5)),(del6,del(6))
+
+* initialize
+	status		= ferr_ok
+	grid		= mr_grid( mr )
+	bad_data	= mr_bad_data( mr )
+	line_too_long	= .FALSE.
+	del_col_changed	= .FALSE.
+	width		= min_field_width
+        do_unform       = list_fmt_type .EQ. plist_unformatted
+        do_dods         = list_fmt_type .EQ. plist_dods
+        do_stream       = list_fmt_type .EQ. plist_stream
+        do_comma_del    = list_fmt_type .EQ. plist_comma_del
+        do_tab_del      = list_fmt_type .EQ. plist_tab_del
+        do_auto_fmt     = list_fmt_type .EQ. plist_default
+	fortran_selfdoc = head_enh .AND. list_format_given
+	itsa_string     = mr_type(mr) .EQ. ptype_string
+        norow = qual_given(slash_list_norow) .GT. 0
+
+* determine precision for outputting values
+	lp = qual_given( slash_list_precision ) 
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                     value, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   prec_digits = MAX(1.,MIN(value, 16.))	! 1 to 16	   
+	ELSE
+	   prec_digits = list_digits
+	ENDIF
+
+* determine maximum width of the output records
+	lp = qual_given( slash_list_width )
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                     value, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   i = value
+	   line_length  = MIN(ABS(i),max_line_len)
+	ELSE
+	   line_length  = 130
+	ENDIF
+
+* determine row and column axes and how many axes are "significant"
+	row_ax = perm(1)
+	col_ax = perm(2)
+	ndim = 0
+	DO 10 ndim = nferdims, 1, -1
+	   IF ( CX_DIM_LEN( perm(ndim), cx ) .GT. 1 ) GOTO 20
+ 10	CONTINUE
+	ndim = 0
+ 20	DO 30 idim = 1, nferdims
+	   span(idim) = CX_DIM_LEN( perm(idim), cx ) .GT. 1
+	   valid(idim) = cx_lo_ss( cx, perm(idim) ) .NE. unspecified_int4
+ 30	CONTINUE
+* * * * * * WRITE INTRODUCTORY LINES * * * * *
+	IF ( do_unform .OR. do_stream .OR. do_dods .OR.
+     .       .NOT.heading ) GOTO 200
+* ... first the variable name
+	vname_buff   = VAR_TITLE( cx )
+	vlen   = TM_LENSTR1( vname_buff )
+	vname_buff   = vname_buff(:vlen)//' '//
+     .				PAREN_SURROUND(VAR_UNITS(cx), alen)
+        slen=TM_LENSTR1(vname_buff)
+	CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'<variable>'//vname_buff(:slen)
+     .          //'</variable>', 0)
+
+* ... qualify title with modification line ?
+	vname_buff = VAR_TITLE_MOD( cx )
+	vlen   = TM_LENSTR( vname_buff )
+	IF ( vlen .GT. 0 ) CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .			'                        '//vname_buff(1:vlen),
+     .				      vlen+24)
+
+* ... then DATA SET
+	dset = cx_data_set(cx)
+	IF ( dset .NE. pdset_irrelevant .AND.        ! for REPEAT/RANGE vars, add 
+     .       dset .NE. unspecified_int4) THEN        ! check for unspecified_int4
+* ... title
+	   CALL GET_DSET_TITLE( cx_data_set(cx), line_buff, slen )
+	   IF (line_buff .NE. ' ') THEN
+             slen=TM_LENSTR1(line_buff)
+	     CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		  '<dataset>'//line_buff(:slen)//'</dataset>',0)
+	   ENDIF
+* ... find split point between filename and path
+	   slen = TM_LENSTR1(ds_des_name(dset))
+	   DO i = slen, 1, -1
+	      IF ( ds_des_name(dset)(i:i) .EQ. '/' ) GOTO 34
+	   ENDDO
+	   i = 0
+* ... filename
+ 34	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .	        '<filename>'//
+     .		ds_des_name(dset)(i+1:slen)//'</filename>', 0)
+* ... DODS URL BASE or ABSOLUTE PATH
+* *kob* v553 - CYGWIN paths are always preceded by '.'
+#ifdef __CYGWIN__
+	   IF (i.GT.0 .AND.  ds_des_name(dset)(2:2).EQ.'\')
+#else
+	   IF (i.GT.0 .AND.  ds_des_name(dset)(1:1).NE.'.')
+#endif
+     .			CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			'<filepath>'//
+     .			ds_des_name(dset)(:i)//'</filepath>',0)
+	ENDIF
+
+* ... BAD FLAG: xxx
+	IF (.NOT.fortran_selfdoc) THEN
+	   IF (.NOT.do_auto_fmt) THEN
+	     line_buff = ' '
+	     WRITE ( line_buff, '(1PG14.7)' ) cx_bad_data(cx)
+             slen=TM_LENSTR1(line_buff)
+	     CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .			'<badflag>'//
+     .		        line_buff(:slen)//'</badflag>', 0)
+	   ENDIF
+* ... SUBSET:   e.g. "Nx by Ny (longitude-latitude)"
+	   line_buff = '<subset>'
+	   l = 8
+	   DO idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         i = perm(idim)
+	         j = CX_DIM_LEN ( i, cx )
+	         line_buff = line_buff(:l)//LEFINT( j, vlen )
+	         l = l + vlen
+	         line_buff = line_buff(:l)//' by '
+	         l = l + 4
+	      ENDIF
+	   ENDDO
+	   IF ( l.GT.8) THEN
+	      line_buff(l-3:l+7) = ' points (  '
+	      l = l + 5
+	      DO idim = 1, nferdims
+	         IF ( span(idim) ) THEN
+	            line_buff = line_buff(:l)//
+     .				AX_TITLE(perm(idim), cx_grid(cx), vlen)
+	            l = l + vlen
+	            line_buff = line_buff(:l)//'-'
+	            l = l + 1
+	         ENDIF
+	      ENDDO
+	      line_buff(l:l) = ')'
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			      line_buff(:l)//'</subset>', 0)
+	   ENDIF
+	ENDIF
+
+* ... which axes require labels
+	DO 35 idim = 1, nferdims
+ 35	need_doc(idim) = .TRUE.
+	IF ( .NOT.(do_unform.OR.do_dods.OR.list_format_given) ) THEN
+	   DO 36 idim = 1, ndim
+ 36	   need_doc(idim) = CX_DIM_LEN( perm(idim), cx ) .EQ. 1
+	ENDIF
+
+* ... if not indicated in time label show a nonstandard calendar name
+	cal_name = line_cal_name( grid_line(t_dim, grid) )
+	cal_id = TM_GET_CALENDAR_ID (cal_name)
+	DO i = 1, nferdims
+	   idim = perm(i)
+	   IF ( .NOT.need_doc(i) .AND. idim.EQ.t_dim .AND.
+     .	     cal_id .LE. max_calendars) THEN
+	      slen = TM_LENSTR(cal_name)
+	      CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .                  '             CALENDAR : '
+     .			//cal_name(:slen), slen+24)
+	   ENDIF
+	ENDDO
+
+* ... region information
+	DO 60 i = 1, nferdims
+	   idim = perm(i)
+	   IF ( need_doc(i) ) THEN
+	      IF ( cx_lo_ww( idim,cx ) .NE. unspecified_val8 ) THEN 
+	         CALL ASCII_LIMITS( cx, idim, line_buff, vlen )
+	         col_head_format = AX_TITLE( idim, grid, alen )
+	         IF (alen .LT. 9) alen = 9
+
+                 CALL SPLIT_LIST( pttmode_explct, list_lun,
+     .                 '<'//col_head_format( :alen )//'>'
+     .                 //line_buff(1:vlen)//
+     .                 '</'//col_head_format( :alen)//'>', 0)
+
+	      ENDIF
+	   ENDIF
+ 60	CONTINUE
+
+* * * * * DETERMINE LIST LIMITS * * *
+ 200	DO 210 i = 1, nferdims
+	   idim = perm(i)
+	   lo(i) = cx_lo_ss( cx, idim )
+	   hi(i) = cx_hi_ss( cx, idim )
+	   del(i)= 1
+ 210	CONTINUE
+
+
+
+* * * * *  ENHANCED HEADING STUFF (10/94) * * * * *
+	IF ( fortran_selfdoc ) THEN
+* ... GEOMETRY: xxx
+	   line_buff = ' '
+	   i = 1	   
+	   DO 220 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         line_buff(i:i) = ww_dim_name(perm(idim))
+	         i = i + 1
+	      ENDIF
+ 220	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				'             GEOMETRY: '//
+     .			 	line_buff(:i), i+23)
+
+* ... SIZE: xxx
+	   line_buff = ' '
+	   l = 1
+	   DO 230 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         i = perm(idim)
+	         j = CX_DIM_LEN ( i, cx )
+	         line_buff = line_buff(:l)//LEFINT( j, vlen )
+	         l = l + vlen + 2
+	      ENDIF
+ 230	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				'             SIZE: '//
+     .			 	line_buff(:l), l+19)
+
+* ... FORTRAN FORMAT: xxx
+	   IF ( list_format .EQ. '(5(1PG12.5))' ) THEN
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             FORTRAN FORMAT: (5F12.5)', 37 )
+	   ELSE
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             FORTRAN FORMAT: '//list_format, 0)
+	   ENDIF
+
+* ... MISSING VALUE FLAG: xxx
+	   line_buff = ' '
+	   WRITE ( line_buff, 3062 ) cx_bad_data(cx)
+ 3062	   FORMAT( 13x,'MISSING VALUES FLAG: ',1PG14.7)
+	   CALL SPLIT_LIST( pttmode_explct, list_lun, line_buff, 0 )
+
+* ... axis COORDINATES:
+	   DO 250 idim = 1, nferdims
+	      IF ( span(idim) ) THEN
+	         line_buff = ' '
+	         i = perm(idim)
+	         axis = grid_line(i, cx_grid(cx) )
+	         WRITE ( line_buff, 3065 ) ww_dim_name(i)
+ 3065	         FORMAT(A1,' COORDINATES: ')
+	         line_buff(16:) = line_units(axis)
+	         alen = TM_LENSTR1( line_buff )
+	  	 IF (  i .EQ. t_dim ) THEN		! add T0=
+	            IF ( GEOG_LABEL(i,cx_grid(cx)) ) THEN 
+	               line_buff(alen+2:) =  '(T0='//line_t0(axis)
+                       IF (line_shift_origin(axis)) 
+     .                  line_buff(alen+2:) =  '(T0=01-JAN-0001 00:00:00'
+	               alen = TM_LENSTR1( line_buff )
+	               line_buff(alen+1:) =  ')'
+	               alen = alen + 1
+	            ENDIF
+	         ENDIF
+	         CALL SPLIT_LIST(pttmode_explct,list_lun,line_buff,alen)
+	         npts =  hi(idim)-lo(idim)+1
+                 CALL MAKE_AXIS(cx_grid(cx),i,lo(idim),hi(idim),ax_buff)
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+	         WRITE ( list_lun, list_format ) (ax_buff(j),j=1,npts)
+	      ENDIF
+ 250	   CONTINUE
+* ... DATA:
+	     CALL SPLIT_LIST(pttmode_explct, list_lun, 'DATA:', 5 )
+	ENDIF
+
+* * * * * LIST DATA UNFORMATTED OR WITH USER FORMAT (no frills)
+
+
+	IF ( do_dods) THEN
+           CALL WRITE_DODS_FMT (grid_data, 
+     .           m1lox,m1hix, m1loy,m1hiy, m1loz,m1hiz, m1lot,m1hit, 
+     .           m1loe,m1hie, m1lof,m1hif, ax_buff, dods_file, clobber, status)
+
+* done - 
+	   RETURN
+        ENDIF
+
+	IF ( do_unform
+     .	.OR. do_stream
+     .	.OR. list_format_given ) THEN
+
+	   DO 300 n = lo6, hi6, del6
+	   DO 300 m = lo5, hi5, del5
+	   DO 300 l = lo4, hi4, del4
+	   DO 300 k = lo3, hi3, del3
+	   DO 300 j = lo2, hi2, del2
+	      IF ( interrupted ) RETURN
+! ----- start string handler -------------
+	      IF (itsa_string) THEN
+	         llen = 0
+	         DO 270 i = lo1, hi1, del1
+	            line_buff(llen+1:) = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,m1loe,m1hie,
+     .			m1lof,m1hif,grid_data,i,j,k,l,m,n,max_line_len,slen )
+	            llen = MIN(max_line_len-1, llen+slen)
+	            IF (do_stream) THEN
+	               llen = llen + 1
+	               line_buff(llen:llen) = CHAR(0) ! NULL terminator
+	            ENDIF
+ 270		 CONTINUE
+	         IF ( do_unform ) THEN
+	            WRITE (list_lun, ERR=5010) line_buff(:llen)
+	         ELSEIF ( do_stream ) THEN
+	            recsofar = recsofar + 1
+	            WRITE (list_lun, REC=recsofar, ERR=5010)
+     .						 line_buff(:llen)
+	         ELSE
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+	            DO 272 i = lo1, hi1, del1
+	               line_buff = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,,m1loe,m1hie,
+     .			m1lof,m1hif,grid_data,i,j,k,l,m,n,max_line_len,slen )
+	               WRITE (list_lun,list_format, ERR=5010)
+     .							line_buff(:slen)
+ 272		    CONTINUE
+	         ENDIF
+	         GOTO 300
+	      ENDIF
+! ----- end string handler -------------
+	      IF ( do_unform ) THEN
+	         WRITE (list_lun, ERR=5010)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+
+	      ELSEIF ( do_stream ) THEN				! 12/94
+	         DO 298 i = lo1, hi1, del1
+	            recsofar = recsofar + 1
+	            WRITE (list_lun, REC=recsofar, ERR=5010)
+     .						grid_data(i,j,k,l,m,n)
+ 298		 CONTINUE
+	      ELSE
+! Note: FORMATTED output cannot be passed through SPLIT_AXIS because a
+!	single WRITE may imply many records of output
+#ifdef DEC_FORTRAN
+* on DEC compilers a field too small for the value generates an ERR= branch
+	         WRITE (list_lun,list_format, IOSTAT=ios)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+	         IF ( ios.NE.0 .AND. ios.NE.63 ) GOTO 5010  ! 63 = fmt conv err
+#else
+	         WRITE (list_lun,list_format, ERR=5010)
+     .			( grid_data(i,j,k,l,m,n),i = lo1, hi1, del1 )
+#endif
+	      ENDIF
+ 300	   CONTINUE
+
+* done - go home
+	   RETURN
+
+* 9/95 - COMMA OR TAB DELIMITED OUTPUT ... some frills  but not too many
+* (note that indent levels aren't changed for k and l loops)
+	ELSEIF ( do_comma_del .OR. do_tab_del ) THEN
+* ... column headings for tab and comma-delimited output (9/95)
+	   IF ( do_comma_del ) THEN
+	      tab_or_comma = ','
+	   ELSEIF( do_tab_del ) THEN
+	      tab_or_comma = CHAR(9)
+	   ENDIF
+	   line_buff(1:line_length) = 'coordinates'//tab_or_comma
+	   alen = 12
+
+* Get number of decimal places for formatting the row coordinates
+
+           ndig(row_ax)= ax_dec_pt(row_ax)
+           CALL NDIG_COORDS (grid, row_ax, lo1, hi1, del1, 
+     .        bad_data, ndig(row_ax), ax_dec_pt(row_ax) )
+
+* Get number of decimal places for formatting the column coordinates
+
+           ndig(col_ax) = ax_dec_pt(col_ax)
+           CALL NDIG_COORDS (grid, col_ax, lo2, hi2, del2, 
+     .        bad_data, ndig(col_ax), ax_dec_pt(col_ax) )
+
+* Get number of decimal places for formatting coordinate labels
+
+           ndig(perm(3)) = ax_dec_pt(perm(3))
+	   IF ( ndim .GE. 3 .AND. valid(3) .AND. 
+     .          ax_dec_pt(perm(3)) .GE. 0 ) 
+     .        CALL NDIG_COORDS (grid, perm(3), lo3, hi3, del3, 
+     .           bad_data, ndig(perm(3)), ax_dec_pt(perm(3)) )
+
+           ndig(perm(4)) = ax_dec_pt(perm(4))
+	   IF ( ndim .GE. 4 .AND. valid(4) ) 
+     .        CALL NDIG_COORDS (grid, perm(4), lo4, hi4, del4, 
+     .           bad_data, ndig(perm(4)), ax_dec_pt(perm(4)) )
+
+           ndig(perm(5)) = ax_dec_pt(perm(5))
+	   IF ( ndim .GE. 5 .AND. valid(5) ) 
+     .        CALL NDIG_COORDS (grid, perm(5), lo5, hi5, del5, 
+     .           bad_data, ndig(perm(5)), ax_dec_pt(perm(5)) )
+
+           ndig(perm(6)) = ax_dec_pt(perm(6))
+	   IF ( ndim .GE. 6 .AND. valid(6) ) 
+     .        CALL NDIG_COORDS (grid, perm(6), lo6, hi6, del6, 
+     .           bad_data, ndig(perm(6)), ax_dec_pt(perm(6)) )
+
+* Write coordinates
+
+	   DO 330 i = lo1, hi1, del1
+	      val8 = TM_WORLD( i, grid, row_ax, box_middle )
+	      width = FIELD_WIDTH(val8, grid, row_ax, ndig(row_ax),
+     .					numbers)
+	      alen = alen + width
+	      IF ( alen .GT. max_line_len ) THEN
+	         line_buff(max_line_len-18:max_line_len) = 
+     .			'** line too long **'
+	         alen = max_line_len
+	         GOTO 331
+	      ENDIF
+	      CALL TRANSLATE_TO_WORLD
+     .		      ( val8,
+     .			row_ax,
+     .			grid,
+     .			ndig(row_ax),
+     .			line_buff(alen-(width-1):alen) )
+	      IF ( i .LT. hi1 ) THEN
+	         alen = alen + 1
+	         line_buff(alen:alen) = tab_or_comma
+	      ENDIF
+ 330	   CONTINUE
+ 331	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				line_buff(:alen), alen )
+	   DO 350 n = lo6, hi6, del6
+* ... label the block of blocks (6th dimension)
+	      IF ( ndim .GE. 6 .AND. valid(6) ) THEN
+	         CALL POS_LAB( l, cx, perm(6),
+     .			    ndig(perm(6)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 l = lo5, hi5, del5
+* ... label the block of blocks (5th dimension)
+	      IF ( ndim .GE. 5 .AND. valid(5) ) THEN
+	         CALL POS_LAB( l, cx, perm(5),
+     .			    ndig(perm(5)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 l = lo4, hi4, del4
+* ... label the block of blocks (4th dimension)
+	      IF ( ndim .GE. 4 .AND. valid(4) ) THEN
+	         CALL POS_LAB( l, cx, perm(4),
+     .			    ndig(perm(4)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 k = lo3, hi3, del3
+* ... label a single block (3rd dimension)
+	      IF ( ndim .GE. 3 .AND. valid(3) ) THEN
+	         CALL POS_LAB( k, cx, perm(3),
+     .			       ndig(perm(3)), line_buff, alen )
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .			' ---- '//line_buff(:alen), 6+alen )
+	      ENDIF
+	   DO 350 j = lo2, hi2, del2
+	      IF ( interrupted ) RETURN
+* ...  create label for this row
+	         IF ( ndim .GE. 2 .AND. valid(2) ) THEN
+	            CALL TRANSLATE_TO_WORLD
+     .		      ( TM_WORLD( j, grid, col_ax, box_middle ),
+     .			col_ax, grid, ndig(col_ax), line_buff(:16) )
+	            alen = TM_LENSTR1(line_buff(:16))
+	         ELSE	! 1D row-only (will this ever happen?)
+	            line_buff(1:5) = 'row 1'	
+	            alen = 5
+	         ENDIF
+* ...  and append the values for this row
+	         DO 340 i = lo1, hi1, del1
+	            IF ( itsa_string ) THEN
+	               line_buff = line_buff(:alen)//tab_or_COMMA//
+     .			GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,m1loe,m1hie,
+     .			m1lof,m1hif,grid_data,i,j,k,l,m,n,max_line_len,vlen )
+	            ELSE
+	               line_buff = line_buff(:alen)//tab_or_COMMA//
+     .			TM_FMT(grid_data(i,j,k,l,m,n),prec_digits,16,vlen)
+	            ENDIF
+	            alen = alen+vlen+1
+	            IF ( alen .GT. max_line_len ) THEN
+	               line_buff(max_line_len-18:max_line_len) = 
+     .			'** line too long **'
+	               alen = max_line_len
+	               GOTO 341
+	            ENDIF
+ 340	         CONTINUE
+ 341	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				line_buff(:alen), alen )
+ 350	   CONTINUE
+* done - go home
+	   RETURN
+	ENDIF
+
+* * * * PREPARE FORMATS ADAPTED TO THE DATA AND AXIS RANGES
+* ... row labelling
+	IF ( ndim .GE. 2 .AND. valid(2) ) THEN
+	   CALL ROW_COORD_FMT( col_ax, cx, lo2, hi2, del2,
+     .			       row_ss_fmt, col_dec, row_wld, cleft )
+	ELSE
+	   cleft = 7
+	   line_buff(:cleft) = ' '		! just 1 value to write
+	ENDIF
+        IF (norow) cleft = 0
+
+	usable_line_len = line_length - cleft
+	max_fields = usable_line_len / min_field_width
+* ... column labelling - how many decimal places for coordinate label ?
+	IF ( ndim .GE. 1 .AND. valid(1) ) THEN
+	   small = +1.E33
+	   DO 404 i = lo1, hi1, del1
+	      small = MIN( small, BOX_SIZE( i, grid, row_ax ) )
+ 404	   CONTINUE	      
+	   CALL GET_PREC_DIGITS( cx_lo_ww(row_ax,cx),
+     .				 cx_hi_ww(row_ax,cx),
+     .				 small, places, row_dec )
+	   row_dec = row_dec + 1		! add 1 more, arbitrarily
+	ENDIF
+
+* ... determine numeric format to fit nicely on the line
+* ... first find largest value to be printed
+! bug here since the mem res data limits may not match the cx limits 8/00 *sh*
+	IF ( itsa_string ) THEN
+	   nleft = GET_MAX_C_STRING_LEN(mr_c_pointer(mr), MGRID_SIZE(mr))
+	   all_bad = .FALSE.
+	ELSE
+	   CALL MINMAX(grid_data, MGRID_SIZE(mr), bad_data, small, big)
+	   all_bad = small .EQ. arbitrary_large_val4
+
+* . . . how many digits right and left of decimal point ?
+ 	   biggest = MAX( ABS( small ), big )
+	   CALL GET_SIG_DIGITS( biggest, prec_digits, nleft, nright )
+	   nleft = MAX( 1, nleft )			! at least "0" to left
+	ENDIF
+
+* . . . unreasonable line length ?
+ 410	IF ( ndim .EQ. 0 ) THEN
+	   num_fields = 1
+	ELSE
+	   num_fields = ABS( (hi1-lo1) / del1  + 1 )
+	   IF ( num_fields .GT. max_fields ) line_too_long = .TRUE.
+* . . . shorten the line to something that will fit
+	   IF ( line_too_long ) THEN
+	      num_fld_est	= usable_line_len / width
+	      temp		= ABS(hi1-lo1) / num_fld_est + 1.
+	      del1		= SIGN( temp, del1 )		! for del1<0
+	      num_fields 	= ABS( (hi1-lo1) / del1 + 1 )
+	      del_col_changed	= .TRUE.
+	   ENDIF
+	ENDIF
+
+* . . . determine FORTRAN format for listing
+	IF ( all_bad ) THEN
+	   width = min_field_width
+	   WRITE ( bad_data_form, 3002 ) min_field_width
+ 3002	FORMAT ( '(A',I2,')' )	
+	ELSE
+	   IF ( itsa_string ) THEN
+	      width = nleft + 2
+	   ELSE
+	      CALL VAR_DATA_FMT( nleft, nright, prec_digits, min_field_width,
+     .			      width, good_data_form, bad_data_form )
+	   ENDIF
+	ENDIF
+
+* . . . will it fit ? - if not go back and try again with a shorter line
+	dlen = cleft + width*num_fields
+* . . . *kob* 9/03 - we do not want to set line_to_long to true for strings -
+*                    results in a hang because dlen doesn't get changed or 
+*                    shortened and so this will always be true for long strings
+*		     and we will be sent back to 410 ad naseum
+	IF ( dlen .GT. line_length .AND. .NOT. itsa_string ) THEN
+	   line_too_long = .TRUE.
+	   GOTO 410
+	ENDIF
+	
+* . . . notify operator if were skipping some data
+	IF ( del_col_changed ) THEN
+	   WRITE ( line_buff, 3005 ) del1
+ 3005	FORMAT ( 5X,' ... listing every',I4,'th point' )
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff, 35 )
+	ENDIF
+
+* . . . write a heading line of coordinate values and subscripts ?
+	IF ( heading .AND. ndim.GE.1 .AND. valid(1) ) THEN
+	   line_buff(1:line_length) = ' '
+	   w0 = cleft + 2	! 2 col arbitrary shift to align
+	   DO 420 i = lo1, hi1, del1
+	      val8 = TM_WORLD( i, grid, row_ax, box_middle )
+	      first = FIELD_WIDTH(val8, grid, row_ax, row_dec, numbers)
+	      first = 1 + MAX( 0, (width-first)/2 )	! centered
+	      CALL TRANSLATE_TO_WORLD
+     .		      ( val8,
+     .			row_ax,
+     .			grid,
+     .			row_dec,
+     .			line_buff(w0+first:w0+width) )
+	      w0 = w0 + width
+ 420	   CONTINUE
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .				' '//line_buff(:w0), w0+1 )
+
+* . . .  then subscript values ...
+	   WRITE ( col_head_format, 3020 ) cleft+1-(width-3)/2,
+     .					      num_fields,  width
+	   WRITE ( line_buff, col_head_format ) ( i,i = lo1,hi1,del1 ) 
+ 3020	   FORMAT ( '(',I2,'X,',I5,'I',I2,')' )	! eg. "( 8X, 10I 6)"
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff, 0 )
+	ENDIF
+
+* . . . list column of latitudes backwards (north to south)
+	IF ( col_ax.EQ.Y_dim .AND. GEOG_LABEL(y_dim,grid) ) THEN
+	   del2 = -1
+	   temp = lo2
+	   lo2  = hi2
+	   hi2  = temp
+	ENDIF
+
+* * * * *  WRITE FORMATTED DATA LINES * * * * *
+* each line has format: "coord/sub: data1 data2 data3 ..."
+* for a 2D field a single block of such lines is printed
+* for a 3D field each block is separated by an identifier of the 3rd axis
+* for a 4D field each block of blocks is further separated and identified
+
+	DO 550 n = lo6, hi6, del6
+
+* label the block of blocks (4th dimension)
+	   IF ( ndim .GE. 6 .AND. valid(6) ) THEN
+	      CALL POS_LAB( l, cx, perm(6),
+     .			    ax_dec_pt(perm(6)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  <6D value=\''//line_buff(:alen)//'\'>', 0)
+	   ENDIF
+
+	DO 540 m = lo5, hi5, del5     
+
+* label the block of blocks (5th dimension)
+	   IF ( ndim .GE. 5 .AND. valid(5) ) THEN
+	      CALL POS_LAB( l, cx, perm(5),
+     .			    ax_dec_pt(perm(5)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  <5D value=\''//line_buff(:alen)//'\'>', 0)
+	   ENDIF
+
+	DO 530 l = lo4, hi4, del4
+
+           CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .            '<tgroup>',0)                 
+
+
+* label the block of blocks (4th dimension)
+	   IF ( ndim .GE. 4 .AND. valid(4) ) THEN
+	      CALL POS_LAB( l, cx, perm(4),
+     .			    ax_dec_pt(perm(4)), line_buff, alen )
+	      CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  <4D value=\''//line_buff(:alen)//'\'>', 0)
+	   ENDIF
+
+	   DO 520 k = lo3, hi3, del3
+
+*    label a single block (3rd dimension)
+	      IF ( ndim .GE. 3 .AND. valid(3) ) THEN
+                 CALL TRANSLATE_TO_WORLD
+     .                ( TM_WORLD( k, grid, perm(3), box_middle ),
+     .                  perm(3), grid, ax_dec_pt(perm(3)), k_value )
+                    slen= TM_LENSTR1(k_value)
+
+	         CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .            '    <3D value=\''//k_value(:slen)//'\'>',0)                 
+	      ENDIF
+
+	      DO 510 j = lo2, hi2, del2
+*       create carefully sized label for this row
+	         IF ( ndim .GE. 2 .AND. valid(2) .AND. 
+     .               (.NOT.norow) ) THEN
+
+	            CALL TRANSLATE_TO_WORLD
+     .		      ( TM_WORLD( j, grid, col_ax, box_middle ),
+     .                  col_ax, grid, col_dec, row_value )
+                    slen= TM_LENSTR1(row_value)
+                    CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .                  '       <row value=\''//row_value(:slen)
+     .                  //'\'>', 0)
+
+	         ENDIF
+	         ifield = 0
+
+	         DO 500 i = lo1, hi1, del1
+* put values into the output line buffer
+	         ifield = ifield + 1
+	         iend   = cleft + ifield*width
+	         istart = iend - width + 1
+	         IF (itsa_string) THEN
+	           line_buff(istart:istart) = '"'
+	           line_buff(istart+1:iend) = GET_STRING_ELEMENT(
+     .			m1lox,m1hix,m1loy,m1hiy,m1loz,m1hiz,m1lot,m1hit,
+     .			m1loe,m1hie,m1lof,m1hif,grid_data,i,j,k,l,m,n,width-2,slen)
+	           IF (slen .GT. width-2) THEN
+	              line_buff(iend-3:iend) = '..."'
+	           ELSE
+	              line_buff(istart+slen+1:istart+slen+1) = '"'
+	           ENDIF
+	         ELSE
+	           value = grid_data(i,j,k,l,m,n)
+	           IF ( value .NE. bad_data ) THEN
+	              WRITE ( entry_value, good_data_form ) value
+	           ELSE
+	              WRITE ( entry_value,  bad_data_form ) '....'
+	           ENDIF
+	         ENDIF
+                 slen=TM_LENSTR1(entry_value)
+                 CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .           '         <entry>'//entry_value(3:slen)//'</entry>', 0)
+
+ 500	         CONTINUE
+
+	         IF ( interrupted ) RETURN
+                 IF ( ndim .GE. 2 .AND. valid(2) .AND.
+     .               (.NOT.norow) ) THEN
+
+                     CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .                '       </row>', 0)
+                 ENDIF
+
+ 510	      CONTINUE
+              IF ( ndim .GE. 3 .AND. valid(3) ) THEN
+                  CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '    </3D>', 0)
+              ENDIF
+
+ 520	   CONTINUE
+           IF ( ndim .GE. 4 .AND. valid(4) ) THEN
+               CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  </4D>', 0)
+           ENDIF
+
+           CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .            '</tgroup>',0)                 
+
+ 530	CONTINUE
+ 
+           IF ( ndim .GE. 5 .AND. valid(5) ) THEN
+               CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  </5D>', 0)
+           ENDIF
+
+ 540	CONTINUE
+ 
+           IF ( ndim .GE. 6 .AND. valid(6) ) THEN
+               CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .             '  </6D>', 0)
+           ENDIF               
+
+ 550	CONTINUE
+
+* successful completion
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_erreq, status, list_format, *5000 )
+	END
diff --git a/fer/gnl/list_multi.F b/fer/gnl/list_multi.F
new file mode 100644
index 0000000..0f9ba7a
--- /dev/null
+++ b/fer/gnl/list_multi.F
@@ -0,0 +1,80 @@
+	SUBROUTINE LIST_MULTI( memory, mr_list, cx_list,
+     .			       heading, perm, wsize, work, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* control routine to set up working arrays for LIST_MULTI_SUB
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/31/90
+* V312: 5/94 - array "memory" as a calling argument
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+
+
+* calling argument declarations:
+	LOGICAL	heading
+	INTEGER	mr_list(*), cx_list(*), perm(nferdims), wsize, status
+	REAL	memory(*), work(0:wsize)
+	
+* internal variable declarations:
+	INTEGER ws
+
+* the work array is partitioned as follows in the called routine:
+* These need to be recomputed if nferdims is changed.
+*	work(0)	     is xact_range(nvar)
+*	work(ws)     is has_size(nferdims,nvar)
+*	work(7*ws)   is bad(nvar)
+*	work(8*ws)   is pt_blk(nvar)
+*	work(9*ws)   is size(nferdims,nvar)
+*	work(15*ws)  is msize(nvar)
+*	work(16*ws)  is width(nvar)
+*	work(17*ws)  is out(nvar)
+
+	ws = wsize / (2*nferdims+6)
+	CALL LIST_MULTI_SUB(memory,mr_list,cx_list,heading,perm, ws,
+     .			work(0),     work(ws),   work(7*ws),
+     .			work(8*ws),  work(9*ws), work(15*ws),
+     .			work(16*ws), work(17*ws),
+     .			status)
+
+
+	RETURN
+	END
diff --git a/fer/gnl/list_multi_sub.F b/fer/gnl/list_multi_sub.F
new file mode 100644
index 0000000..acd704f
--- /dev/null
+++ b/fer/gnl/list_multi_sub.F
@@ -0,0 +1,739 @@
+	SUBROUTINE LIST_MULTI_SUB(memory, mr_list,cx_list,heading,
+     .				  perm,ws,xact_range, has_size, bad,
+     .				  pt_blk, size, msize, width, out,
+     .				  status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* list several gridded variables with multiple variables per record
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   7/5/90 - based on LIST_CMND_DATA
+* V230:  6/18/92 - 2 bug fixes for listings with ambiguous coords
+*       list/k=2/l=5/x=130e:180/y=0:20/d=gtsa056 temp,salt,u,v[k=1]
+*                - use COMMON variable list_format_type
+*        7/22/92 - identify "column 1", "column 2", ... in header (bug 7/31)
+*        11/4/92 - expanded variable name length
+* V300:  4/29/93 - fixed subscript bug for xact lists longer than mem_blk_size
+* V301: 11/1/93 - change to WRITE(ERR=...) processing for DEC compilers
+* V312: 5/94 - array "memory" as a calling argument
+* V313: 8/14/94 *kob* IBM port - variable declaration for ss_save changed from
+*				 integer to logical
+*	31/10/94 *sh* and size of row_ss_fmt increased due to ROW_COORD_FMT chg
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V500 *kob* 3/99- up VAR_CODE and vcode decl's from 8 to 64 chars
+* V530  8/00 - added support for string variables
+* V552 *acm* 4/03- up VAR_CODE and vcode decl's from 64 to 128 chars
+* V581: *acm*/3/05 - increase length of strings for dataset title to 1024
+* V600: *acm* 8/05 - make multi-variable tab and comma-delimited listings of
+*                    multiple variables like free-format listings, rather than 
+*                    like LIST/SINGLY. (bug 1273)
+* V600: *acm* 8/05 - Add new qualifier LIST/NOROWHEAD to remove labels that
+*                    start each row labelling the coordinate values. (bug 1273)
+* V600: *acm* 8/05 - fix bug 1313; reinitialize list_buffer after heading of 
+*                    variable names on columns, before listing data
+* V602: *acm 11/06 - fix bug 1451 when list/form=comma or /format=tab,
+*                    and there is missing data, output a comma or tab
+*                    placeholder for the missing values'
+* V603: *acm* 6/07 - Fix bug 1388. LIST/PREC= did not work on multi-variable 
+*                    listings but SET LIST/PREC=; LIST  did. The code to get
+*                    the value of /PREC= was inside an IF block only executed for
+*                    tab and comma formatting, and there was also an inconsistency
+*                    in how the two flags were used: prec_digits(for LIST/PREC=) and
+*                    list_digits(setting from SET LIST/PREC=)
+* V610: *acm* 2/10 - Fix bug 1698. For tab and comma-delimited files,
+*                    list out the missing data values. The point of these
+*                    is that they'll be read into some other software e.g.
+*                    spreadsheets, so the user wants the missing flags in there.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'slash.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xinterrupt.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* local parameter declarations:
+	LOGICAL		no_decims
+	INTEGER		line_length
+	PARAMETER     ( line_length  = 2048,
+     .			no_decims = .FALSE. )
+
+* calling argument declarations:
+	LOGICAL	heading
+	INTEGER	mr_list(num_uvars_in_cmnd), cx_list(num_uvars_in_cmnd),
+     .		perm(nferdims), ws, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* ... work arrays ...
+	LOGICAL		xact_range(ws), has_size(nferdims,ws)
+	INTEGER		pt_blk(ws), size(nferdims,ws), msize(ws), width(ws)
+	REAL		out(ws), bad(ws)
+* ss_save removed from integer declaration and put in logical decl.  *kob* 8/94	
+* V500 *kob* 3/99- up VAR_CODE and vcode decl's to 64 chars and KEY_STRING
+*                  to 128 and VAR_UNITS to 64
+* V552 *acm* 4/03- up VAR_CODE and vcode decl's from 64 to 128 chars
+* local variable declarations:
+	LOGICAL		all_bad, do_unform, ss_save, do_tab_del,
+     .                  do_comma_del, norow
+	INTEGER		TM_LENSTR1, CGRID_AXIS, GET_MAX_STRING_LEN,
+     .			GET_OFFSET_C_STRING_LEN, 
+     .			w0, w, data_len, nleft, nright, alen, blen,
+     .			idim, vlen, cleft, col_ax, col_dec,
+     .			cx, slen1, slen2, slen3, i, 
+     .			ivar, point, word, block, iwd, iblk, dset, ax, new_ax,
+     .			min_width, row_ww_wid, lp, prec_digits, ww,
+     .			lo(nferdims), hi(nferdims), del(nferdims), 
+     .			pt(nferdims), valid_ax(nferdims)
+	CHARACTER*255	VAR_TITLE, VAR_TITLE_MOD, PAREN_SURROUND, vname_buff
+	CHARACTER	KEY_STRING*128, AX_TITLE*32, VAR_UNITS*64, LEFINT*8,
+     .			CX_DIM_STR*16, VAR_CODE*128, TM_FMT*16,
+     .			buff1*16, buff2*16, buff3*16, line_buff*2048,
+     .			row_ss_fmt*14, bad_ax*5, bad_buff*32,
+     .			col_head_format*32, sep*1
+	REAL		big, small, biggest, value
+	REAL*8		TM_WORLD
+	CHARACTER	good_fmt(max_intrp)*10, bad_fmt(max_intrp)*10,
+     .			vcode(max_intrp)*128, tab_or_comma*1
+#ifdef DEC_FORTRAN
+	INTEGER		ios
+#endif
+* convenience equivalence:
+	INTEGER		lo1, lo2, lo3, lo4, lo5, lo6, 
+     .			hi1, hi2, hi3, hi4, hi5, hi6, 
+     .			del1,del2,del3,del4,del5,del6, 
+     .			i1, i2, i3, i4, i5, i6
+	EQUIVALENCE	
+     .  (i1, pt(1)) , (i2, pt(2)) , (i3, pt(3)),  (i4,pt(4)),   (i5, pt(5)),  (i6,pt(6)),
+     .  (lo1, lo(1)), (lo2, lo(2)), (lo3,lo(3)),  (lo4,lo(4)),  (lo5,lo(5)),  (lo6,lo(6)),
+     .  (hi1, hi(1)), (hi2, hi(2)), (hi3,hi(3)),  (hi4,hi(4)),  (hi5,hi(5)),  (hi6,hi(6)),
+     .  (del1,del(1)),(del2,del(2)),(del3,del(3)),(del4,del(4)),(del5,del(5)),(del6,del(6))
+
+* initialize
+
+	status		= ferr_ok
+        do_unform       = list_fmt_type .EQ. plist_unformatted
+	risc_buff = ' '
+
+        do_tab_del   = list_fmt_type .EQ. plist_tab_del
+        do_comma_del = list_fmt_type .EQ. plist_comma_del
+
+        norow = qual_given(slash_list_norow) .GT. 0
+
+        IF ( do_comma_del .OR. do_tab_del ) THEN
+* ... column headings for tab and comma-delimited output (9/95)
+	   IF ( do_comma_del ) THEN
+	      tab_or_comma = ','
+	   ELSEIF( do_tab_del ) THEN
+	      tab_or_comma = CHAR(9)
+           ENDIF
+              
+	ENDIF
+
+* determine precision for outputting values
+	lp = qual_given( slash_list_precision ) 
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                     value, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           prec_digits = MAX(1.,MIN(value, 16.))	! 1 to 16	   
+	ELSE
+           prec_digits = list_digits
+	ENDIF
+
+* determine list limits checking for conformable shapes of data to list
+* ... for each axis each var must be same size or length 1
+	DO 10 i = 1, nferdims
+	   idim = perm(i)
+	   lo(i) = unspecified_int4
+	   hi(i) = unspecified_int4
+	   del(i)= 1
+	   DO 8 ivar = 1, num_uvars_in_cmnd
+	      cx = cx_list(ivar)
+	      IF ( cx_lo_ss(cx,idim) .NE. cx_hi_ss(cx,idim) ) THEN
+	         IF ( lo(i) .EQ. unspecified_int4 ) THEN
+	            lo(i) = cx_lo_ss( cx, idim )
+	            hi(i) = cx_hi_ss( cx, idim )
+	         ELSEIF ( lo(i) .NE. cx_lo_ss(cx,idim)
+     .		     .OR. hi(i) .NE. cx_hi_ss(cx,idim) ) THEN
+	            GOTO 5020	! not conformable shapes
+	         ENDIF
+	      ENDIF
+ 8	   CONTINUE
+ 10	CONTINUE
+
+* compute lengths of each variables' axes
+	DO 20 i = 1, nferdims
+	   idim = perm(i)
+	   DO 18 ivar = 1, num_uvars_in_cmnd
+	      cx = cx_list(ivar)
+	      has_size( i, ivar ) = cx_hi_ss(cx,idim) .GT. cx_lo_ss(cx,idim)
+	      size( i, ivar ) = cx_hi_ss(cx,idim) - cx_lo_ss(cx,idim) + 1
+ 18	   CONTINUE
+ 20	CONTINUE
+
+* ... and total size
+	DO 25 ivar = 1, num_uvars_in_cmnd
+	msize(ivar) = 1
+	DO 25 idim = 1, nferdims	
+ 25	msize(ivar) = msize(ivar) * size(idim,ivar)	
+
+* determine which axes have unambiguous coordinates (all variables that are
+* not point locations on this axis must have the same coordinates)
+* create a string (bad_ax) with a list of ambiguous axes and a list, valid_ax,
+* of context pointers for axes with valid lists of coordinates
+	sep = ' '
+	bad_ax = ' '
+	slen1 = 1	! length of bad axis string
+	DO 30 i = 1, nferdims
+	   idim = perm(i)
+	   valid_ax(i) = 0	! assume ambiguous coordinates
+	   ax = mnormal
+	   DO 28 ivar = 1, num_uvars_in_cmnd
+	      cx = cx_list(ivar)
+	      new_ax = CGRID_AXIS( idim, cx )
+	      IF ( new_ax .EQ. mnormal ) GOTO 28
+* ... point location context needed if all vars have point locations
+	      IF ( .NOT.has_size(i,ivar) ) THEN
+	         IF ( ax .EQ. mnormal ) valid_ax(i) = -cx
+	         GOTO 28
+	      ENDIF
+	      IF ( ax .EQ. mnormal ) THEN
+	         ax = new_ax
+	         valid_ax(i) = cx
+	      ELSEIF ( ax .NE. new_ax
+     .		.OR.   cx_lo_ss(cx,idim) .NE. lo(i) ) THEN
+	         valid_ax(i) = 0	! ambiguous
+	         bad_ax = bad_ax(:slen1)//sep//ww_dim_name(idim)
+		 sep = ','
+	         slen1 = MIN( slen1 + 2, 5 )  ! bug fix 6/92
+	      ENDIF
+ 28	   CONTINUE
+ 30	CONTINUE
+
+* ... warn of ambiguous coordinates if output is not to the screen
+	IF ( slen1.GT.1 .AND. ttout_lun.NE.list_lun ) THEN
+	   WRITE (risc_buff, 3010) bad_ax(2:slen1)
+	   CALL SPLIT_LIST
+     .		(pttmode_bull, ttout_lun, risc_buff, 0)
+	   risc_buff = ' '
+	ENDIF
+	   
+* (for optimization) which variables are full sized ?
+	DO 40 ivar = 1, num_uvars_in_cmnd
+	   cx = cx_list(ivar)
+	   xact_range(ivar) = .TRUE.
+	   DO 38 i = 1, nferdims
+	      idim = perm(i)
+	      IF ( lo(i) .EQ. hi(i) ) GOTO 38
+	      IF ( cx_lo_ss(cx,idim) .NE. lo(i)
+     .	      .OR. cx_hi_ss(cx,idim) .NE. hi(i) ) THEN
+	         xact_range(ivar) = .FALSE.
+	         GOTO 40
+	      ENDIF
+ 38	   CONTINUE
+ 40	CONTINUE
+
+* (for optimization) save stuff
+	DO 50 ivar = 1, num_uvars_in_cmnd
+	   cx = cx_list(ivar)
+	   vcode(ivar)  = VAR_CODE( cx_category(cx), cx_variable(cx) )
+	   bad(ivar)    = mr_bad_data(  mr_list(ivar) )
+	   pt_blk(ivar) = mr_blk1( mr_list(ivar) )	
+ 50	CONTINUE
+
+* * * * * * WRITE INTRODUCTORY LINES * * * * *
+	IF ( do_unform .OR. .NOT.heading ) GOTO 200
+
+* ... begin with warning if coordinates are ambiguous
+	IF ( slen1 .GT. 1 ) THEN
+	   WRITE ( risc_buff, 3010 ) bad_ax(2:slen1)
+	   CALL SPLIT_LIST
+     .		(pttmode_bull, list_lun, risc_buff, 0)
+	   risc_buff = ' '
+	ENDIF
+ 3010	FORMAT (' WARNING: Listed variables have ambiguous ',
+     .            'coordinates on axes:',A)
+
+* ... summarize what the contexts have in common
+	CALL GRP_CX_DOC( cx_list, num_uvars_in_cmnd, cx_buff, cx_xtra_doc )
+
+* ... data set information for all variables
+	dset = cx_data_set( cx_buff )
+	IF (  dset .NE. unspecified_int4
+     .	.AND. dset .NE. pdset_irrelevant ) THEN
+* ... name of data set
+	   CALL GET_DSET_NAME( dset, line_buff, alen )
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             DATA SET: '//line_buff(:alen), alen+23)
+ 3020	   FORMAT( 13X,A)
+* ... title of data set
+	   CALL GET_DSET_TITLE( dset, line_buff, alen )
+	   IF ( alen .GT. 1 ) CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             '//line_buff(:alen), alen+13)
+	ENDIF
+
+* ... location information in common for all variables
+	DO 70 i = 1, nferdims
+	   idim = perm(i)
+	   cx = ABS( valid_ax(i) )
+           IF ( cx .LE. 0 ) GOTO 70     !  6/92 bug fix
+	   IF ( cx_lo_ww(idim,cx_buff).EQ.unspecified_val8
+     .	   .OR. cx_lo_ww(idim,cx_buff).EQ.unspec_val8_2 ) GOTO 70
+	   CALL ASCII_LIMITS( cx_buff, idim, line_buff, vlen )
+	   col_head_format = AX_TITLE( idim, cx_grid(cx), alen )
+	   CALL SPLIT_LIST(pttmode_explct, list_lun,
+     .		'             '//col_head_format( :alen )//
+     .				': '// line_buff(1:vlen), 0)
+ 70	CONTINUE
+
+* ... then variable titles and any special limits or data set for a variable
+	DO 60 ivar = 1, num_uvars_in_cmnd
+	   cx = cx_list(ivar)
+	   line_buff = vcode(ivar)
+	   alen = TM_LENSTR1( vcode(ivar) )
+	   IF ( INDEX(line_buff(:alen),'#') .EQ. 0 ) line_buff =
+     .				KEY_STRING(cx, cx_xtra_doc, alen )
+	   vname_buff   = VAR_TITLE( cx )
+	   vlen   = TM_LENSTR1( vname_buff )
+	   vname_buff   = vname_buff(:vlen)//' '//
+     .			PAREN_SURROUND(VAR_UNITS(cx), slen1)
+	   vlen = vlen+1+slen1
+	   vname_buff   =  vname_buff(:vlen)//
+     .			PAREN_SURROUND(VAR_TITLE_MOD(cx),slen2)
+	   vlen = vlen+slen2
+	   risc_buff = ' '
+
+	   bad_buff = ' '
+	   blen = 1
+           IF (do_comma_del .OR. do_tab_del) THEN
+             bad_buff = '   BAD FLAG : '// 
+     .                  TM_FMT(bad(ivar),prec_digits,16,blen)
+             blen = blen + 14
+           ENDIF
+
+	   IF ( line_buff(:vlen) .EQ. vname_buff(:vlen) ) THEN
+	      WRITE ( risc_buff, 3028 ) ivar, line_buff(:alen), 
+     .           bad_buff(:blen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+ 3028         FORMAT (' Column',I3,': ',A, A) 
+	   ELSE	      
+	      WRITE ( risc_buff, 3030 ) ivar,
+     .           line_buff(:alen), vname_buff(:vlen),bad_buff(:blen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+ 3030	      FORMAT (' Column',I3,': ',A,' is ',A, A)
+	   ENDIF
+ 60	CONTINUE
+
+* * * * * LIST DATA UNFORMATTED OR WITH USER FORMAT (no frills)
+* Note: cannot direct user format to GUI because records may be
+* arbitrarily long
+ 200	IF ( do_unform .OR. list_format_given ) THEN
+	   point = -1                    ! bug fix 4/93
+	   DO 300 i6 = lo6, hi6, del6
+	   DO 300 i5 = lo5, hi5, del5
+	   DO 300 i4 = lo4, hi4, del4
+	   DO 300 i3 = lo3, hi3, del3
+	   DO 300 i2 = lo2, hi2, del2
+	   DO 300 i1 = lo1, hi1, del1
+	      IF ( interrupted ) RETURN
+* default memory pointer for full-region variables
+	      point = point + 1
+	      block = point / mem_blk_size
+	      word  = point - block*mem_blk_size
+
+* loop through all variables for each record
+	      DO 250 ivar = 1, num_uvars_in_cmnd
+	         IF (mr_type(mr_list(ivar)) .EQ. ptype_string) GOTO 5040
+* ... optimized calculation for full-region variables
+	         IF ( xact_range(ivar) ) THEN
+	            out(ivar) = memory( word+1, pt_blk(ivar)+block ) 
+	         ELSE
+* ... separate pointer calcs for non-full region variables
+* ... e.g. a 2D field listed with a 3D will replicate at each 3rd-D location
+	            iwd = 0
+	            IF ( has_size(nferdims,ivar) ) iwd = (pt(nferdims)-lo(nferdims))
+	            DO 240 i = nferdims-1, 1, -1
+	            iwd = iwd*size(i,ivar)
+		    IF ( has_size(i,ivar) ) iwd = iwd + (pt(i)-lo(i))
+ 240	            CONTINUE
+	            iblk = iwd / mem_blk_size
+	            iwd  = iwd - iblk*mem_blk_size
+	            out(ivar) = memory( iwd+1, pt_blk(ivar)+iblk ) 
+	         ENDIF
+ 250	      CONTINUE
+	      IF ( do_unform ) THEN
+	         WRITE (list_lun, ERR=5010)
+     .			( out(ivar),ivar = 1, num_uvars_in_cmnd )
+	      ELSE
+
+	         WRITE (list_lun, list_format, ERR=5010)
+     .			( out(ivar),ivar = 1, num_uvars_in_cmnd )
+	      ENDIF
+ 300	   CONTINUE
+* done - go home
+	   RETURN
+	ENDIF
+
+* * * * PREPARE FORMATS ADAPTED TO THE DATA AND AXIS RANGES
+* ... coordinate labelling at left of each record
+	col_ax = perm(1)
+	cx = valid_ax(1)
+	CALL ROW_COORD_FMT( col_ax, cx, lo(1), hi(1), 1,
+     .			    row_ss_fmt, col_dec, row_ww_wid, cleft )
+	data_len = 0
+        IF (norow) cleft = 0
+
+* ... column labelling - variable codes for headings - FORTRAN formats for data
+	DO 400 ivar = 1, num_uvars_in_cmnd
+
+* ... determine numeric format to fit nicely in each field
+* ... first find largest value to be printed
+	   IF ( mr_type(mr_list(ivar)) .EQ. ptype_string ) THEN
+	       nleft = GET_MAX_STRING_LEN(cx_list(ivar),
+     .					  mr_list(ivar),
+     .					  memory(1,pt_blk(ivar)) )
+	   ELSE 
+	      CALL MINMAX( memory(1,pt_blk(ivar)), msize(ivar),
+     .			   bad(ivar), small, big )
+	      all_bad = small .EQ. arbitrary_large_val4
+
+* . . . how many digits right and left of decimal point ?
+	      biggest = MAX( ABS( small ), big )
+	      CALL GET_SIG_DIGITS( biggest, prec_digits, nleft, nright )
+	      nleft = MAX( 1, nleft )			! at least "0" to left
+	   ENDIF
+
+* ... field must be wide enough to accomodate the variable code heading
+*     (to a max of 8 characters)
+	   min_width = MIN( 8, TM_LENSTR1( vcode(ivar) ) + 1 )
+
+* . . . determine FORTRAN format for listing of this variable
+	   IF ( mr_type(mr_list(ivar)) .EQ. ptype_string ) THEN
+              width(ivar) = MIN(nleft+3, 1020)  ! arbitrary 1020 char max   
+	   ELSEIF ( all_bad ) THEN
+	      width(ivar) = min_width
+	      WRITE ( bad_fmt(ivar), 3002 ) min_width
+ 3002	FORMAT ( '(A',I2,')' )	
+	   ELSE
+	      CALL VAR_DATA_FMT( nleft, nright, prec_digits, min_width,
+     .			         width(ivar), good_fmt(ivar), bad_fmt(ivar) )
+	   ENDIF
+
+	   data_len = data_len + width(ivar)
+
+ 400	CONTINUE
+
+* . . . will it fit ?
+	IF ( data_len .GT. line_length-cleft ) GOTO 5030
+	
+* . . . write a heading line of variable codes
+	IF ( heading ) THEN
+           line_buff = ' '
+
+           IF (do_comma_del .OR. do_tab_del) THEN
+* ... Write entire variable names without cutting them off.
+
+              slen1 = TM_LENSTR1( vcode(1) )
+	      w0 = cleft - slen1 + MIN(width(1), slen1)
+              IF (w0 .LE. 0 .OR. cleft .EQ. 0) w0 = 1
+              DO 420 ivar = 1, num_uvars_in_cmnd
+
+                 slen1 = TM_LENSTR1(vcode(ivar))
+                 line_buff(w0:w0+slen1) = vcode(ivar)(:slen1)
+
+                 IF (ivar .LT. num_uvars_in_cmnd)
+     .              line_buff(w0+slen1:w0+slen1) = tab_or_comma
+                 w0 = w0 + slen1 + 1
+ 420	      CONTINUE
+
+           ELSE
+* ... Not tab or comma delimited: use width of each field
+ 
+	      w0 = cleft
+	      slen1 = MIN( w0, TM_LENSTR1( vcode(1) ) )
+              IF (cleft .EQ. 0) slen1 = TM_LENSTR1( vcode(1) )
+	      w0 = w0 + width(1)
+	      line_buff(w0-slen1:w0-1) = vcode(1)(:slen1)
+              w0 = w0 + 1
+              IF (num_uvars_in_cmnd .GT. 1) line_buff(w0:w0) = ' '
+
+	      DO 421 ivar = 2, num_uvars_in_cmnd
+                 line_buff(w0:w0) = ' '
+
+                 slen2 = 0
+                 IF ( TM_LENSTR1(vcode(ivar)) .LT. width(ivar) ) 
+     .               slen2 = (width(ivar) - TM_LENSTR1(vcode(ivar)))/2
+                 line_buff(w0+1+slen2:w0+width(ivar)) = vcode(ivar)
+
+                 IF (ivar .EQ. num_uvars_in_cmnd)
+     .              line_buff(w0+1+slen2:) = vcode(ivar)
+                 w0 = w0 + width(ivar)
+ 421	      CONTINUE
+
+           ENDIF
+
+
+           w0 = TM_LENSTR1(line_buff) 
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff(1:w0), w0)
+	ENDIF
+        line_buff = ' '
+
+* * * * *  WRITE FORMATTED DATA LINES * * * * *
+* each line has format: "coord/sub: data1 data2 data3 ..."
+* for a 1D field a single block of such lines is printed
+* for a 2D field each block is separated by an identifier of the 3rd axis
+* for a 3D field each block of blocks is further separated and identified
+* etc. for a 4D field
+
+* If the /NOROWLAB qualifier was given, do not do the "coord/sub:" on each data line
+
+ 3050   FORMAT (1X,4('-'),1X,A)
+	point = -1                    ! bug fix 4/93
+	DO 600 i6 = lo6, hi6, del6
+* label the block of block of blocks (6th dimension)
+	   risc_buff = ' '
+	   IF ( hi6 .GT. lo6 ) THEN
+	      CALL POS_LAB( i6, valid_ax(6), perm(6),
+     .			    ax_dec_pt(perm(6)), line_buff, alen )
+	      WRITE (risc_buff, 3050) line_buff(:alen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+	   ENDIF
+	DO 600 i5 = lo5, hi5, del5
+* label the block of block of blocks (5th dimension)
+	   risc_buff = ' '
+	   IF ( hi5 .GT. lo5 ) THEN
+	      CALL POS_LAB( i5, valid_ax(5), perm(5),
+     .			    ax_dec_pt(perm(5)), line_buff, alen )
+	      WRITE (risc_buff, 3050) line_buff(:alen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+	   ENDIF
+	DO 600 i4 = lo4, hi4, del4
+* label the block of block of blocks (4th dimension)
+	   risc_buff = ' '
+	   IF ( hi4 .GT. lo4 ) THEN
+	      CALL POS_LAB( i4, valid_ax(4), perm(4),
+     .			    ax_dec_pt(perm(4)), line_buff, alen )
+	      WRITE (risc_buff, 3050) line_buff(:alen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+	   ENDIF
+	DO 600 i3 = lo3, hi3, del3
+* label the block of blocks (3rd dimension)
+	   IF ( hi3 .GT. lo3 ) THEN
+	      CALL POS_LAB( i3, valid_ax(3), perm(3),
+     .			    ax_dec_pt(perm(3)), line_buff, alen )
+	      WRITE (risc_buff, 3050) line_buff(:alen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+	   ENDIF
+	DO 600 i2 = lo2, hi2, del2
+* label the block of blocks (3rd dimension)
+	   IF ( hi2 .GT. lo2 ) THEN
+	      CALL POS_LAB( i2, valid_ax(2), perm(2),
+     .			    ax_dec_pt(perm(2)), line_buff, alen )
+	      WRITE (risc_buff, 3050) line_buff(:alen)
+	      CALL SPLIT_LIST(pttmode_explct, list_lun, risc_buff, 0)
+	   ENDIF
+	DO 600 i1 = lo1, hi1, del1
+           line_buff = ' '
+	   IF ( interrupted ) RETURN
+
+*  create carefully sized label for this row
+	   cx = valid_ax(1)
+
+           IF (.NOT. norow) THEN
+	      IF ( cx .GT. 0 ) THEN
+	         CALL TRANSLATE_TO_WORLD( 
+     .			TM_WORLD( i1, cx_grid(cx), perm(1), box_middle ),
+     .			perm(1), cx_grid(cx), col_dec, line_buff(:row_ww_wid) )
+	         WRITE ( line_buff(row_ww_wid+1:cleft), row_ss_fmt ) i1
+	      ELSE
+	         line_buff(1:1) = ss_dim_name(perm(1))
+	         IF ( i1 .NE. unspecified_int4 ) THEN
+	            WRITE ( line_buff(2:cleft), row_ss_fmt ) i1	! e.g. "I / 15:"
+	         ELSE
+	            line_buff(2:) = ' / *:'			! e.g. "I / *:"
+	         ENDIF 
+	      ENDIF
+           ENDIF
+           w0 = cleft
+
+* default memory pointer for full-region variables
+	   point = point + 1
+	   block = point / mem_blk_size
+	   word  = point - block*mem_blk_size
+
+* loop through all variables for each record
+           ww = w0 + 1
+	   DO 550 ivar = 1, num_uvars_in_cmnd
+	      w = w0 + width(ivar) ! points to last column of field
+	      IF ( mr_type(mr_list(ivar)) .EQ. ptype_string ) THEN
+* ... string variable
+	         IF ( xact_range(ivar) ) THEN
+	            iwd = point
+                 ELSE	
+	            iwd = 0
+	            IF ( has_size(nferdims,ivar) ) iwd = (pt(nferdims)-lo(nferdims))
+	            DO 530 i = nferdims-1, 1, -1
+                       iwd = iwd*size(i,ivar)
+                       IF ( has_size(i,ivar) ) iwd = iwd + (pt(i)-lo(i))
+ 530	            CONTINUE
+	         ENDIF
+
+                 IF (do_comma_del .OR. do_tab_del) THEN
+* ... tab or comma formatting
+                    line_buff(ww:ww) = '"'
+	            slen1 = GET_OFFSET_C_STRING_LEN(mr_c_pointer(mr_list(ivar)),
+     .					 iwd )
+	            CALL GET_OFFSET_C_STRING(mr_c_pointer(mr_list(ivar)),
+     .				   iwd,
+     .				   line_buff(ww+1:),
+     .				   slen1    )
+                    line_buff(ww+slen1+1:ww+slen1+1) = '"'
+
+                    IF (ivar .LT. num_uvars_in_cmnd) 
+     .                 line_buff(ww+slen1+2:ww+slen1+2) = tab_or_comma
+                    ww = ww + slen1 + 3
+                    w = ww               
+                 ELSE
+* ... not tab or comma formatting
+
+	            line_buff(w0+2:w0+2) = '"'
+	            line_buff(w0+3:w) = ' '
+	            slen1 = GET_OFFSET_C_STRING_LEN(mr_c_pointer(mr_list(ivar)),
+     .		  			 iwd )
+	            CALL GET_OFFSET_C_STRING(mr_c_pointer(mr_list(ivar)),
+     .				   iwd,
+     .				   line_buff(w0+3:),
+     .				   width(ivar)-2     )
+
+	            IF (slen1 .GT. width(ivar)-2) THEN
+	               line_buff(w-3:w) = '..."'
+	            ELSE
+	               line_buff(w0+slen1+3:w0+slen1+3) = '"'
+	            ENDIF
+                 ENDIF  ! tab-or-comma
+	      ELSE
+* ... numerical variable
+* ... optimized calculation for full-region variables
+	        IF ( xact_range(ivar) ) THEN
+	           out(ivar) = memory( word+1, pt_blk(ivar)+block ) 
+	        ELSE
+* ... separate pointer calcs for non-full region variables
+* ... e.g. a 2D field listed with a 3D will replicate at each 3rd-D location
+	           iwd = 0
+	           IF ( has_size(nferdims,ivar) ) iwd = (pt(nferdims)-lo(nferdims))
+	           DO 540 i = nferdims-1, 1, -1
+	           iwd = iwd*size(i,ivar)
+	           IF ( has_size(i,ivar) ) iwd = iwd + (pt(i)-lo(i))
+ 540	           CONTINUE
+	           iblk = iwd / mem_blk_size
+	           iwd  = iwd - iblk*mem_blk_size
+	           out(ivar) = memory( iwd+1, pt_blk(ivar)+iblk ) 
+	        ENDIF
+	        IF ( out(ivar) .EQ. bad(ivar) ) THEN
+                   IF (do_comma_del .OR. do_tab_del) THEN
+                       line_buff = line_buff(:ww-1)//
+     .	                   TM_FMT(out(ivar),prec_digits,16,vlen)
+                       IF (ivar .LT. num_uvars_in_cmnd) 
+     .                   line_buff(ww+vlen:ww+vlen) = tab_or_COMMA
+     	               ww = ww+vlen+1
+                       w = ww
+                   ELSE
+	              WRITE(line_buff(w0+1:w),bad_fmt(ivar)) '....'
+                   ENDIF
+	        ELSE
+                   IF (do_comma_del .OR. do_tab_del) THEN
+* ... tab or comma formatting
+                       line_buff = line_buff(:ww-1)//
+     .	                   TM_FMT(out(ivar),prec_digits,16,vlen)
+                       IF (ivar .LT. num_uvars_in_cmnd) 
+     .                   line_buff(ww+vlen:ww+vlen) = tab_or_COMMA
+     	               ww = ww+vlen+1
+                       w = ww
+                    ELSE
+	              WRITE(line_buff(w0+1:w),good_fmt(ivar)) out(ivar)
+                    ENDIF
+	        ENDIF
+	      ENDIF
+	      w0 = w
+
+ 550	   CONTINUE
+
+* write the fully formatted line
+           IF (do_comma_del .OR. do_tab_del) w0 = ww
+	   CALL SPLIT_LIST(pttmode_explct, list_lun, line_buff, w0)
+           line_buff = ' '
+ 600	   CONTINUE
+
+* successful completion
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_erreq, status, list_format, *5000 )
+ 5020	ss_save = cx_by_ss(idim,cx)
+	cx_by_ss(idim,cx) = .TRUE.
+	buff1 = CX_DIM_STR( idim,cx,':',no_decims,slen1 )
+	cx_by_ss(idim,cx) = ss_save
+	cx_by_ss(idim,cx_buff) = .TRUE.
+	cx_lo_ss(cx_buff,idim) = lo(i)
+	cx_hi_ss(cx_buff,idim) = hi(i)
+	buff2 = CX_DIM_STR( idim,cx_buff,':',no_decims,slen2 )
+	buff3 = LEFINT(ivar,slen3)
+	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		ww_dim_name(idim)//' axis'//pCR//
+     .		'Variable '//buff3(:slen3)//' is '//buff1(:slen1)//pCR//
+     .		'expression is '//buff2(:slen2), *5000 )
+ 5030	CALL ERRMSG( ferr_invalid_command, status,
+     .		'list of variables too long for output lines'//pCR//
+     .		'Reduce SET LIST/PRECISION or specify /FORMAT', *5000 )
+ 5040	CALL ERRMSG( ferr_invalid_command, status,
+     .		'format disallowed for multiple variables w/ strings',
+     .		*5000 )
+	END
diff --git a/fer/gnl/mouse_command.F b/fer/gnl/mouse_command.F
new file mode 100644
index 0000000..1cceb04
--- /dev/null
+++ b/fer/gnl/mouse_command.F
@@ -0,0 +1,137 @@
+	SUBROUTINE MOUSE_COMMAND
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get next command line from the GUI input source
+* if it is a coded query respond instantly
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300:  6/16/93
+* V301:  1/94 - bug:  incorrect call to DO_QUERY in error return
+* V314: 8/19/94 *kob* IBM port - Modified format statements, added 
+*				 ifdef MANDATORY_FORMAT_WIDTHS for I format
+*			         descriptor 
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xinterrupt.cmn'
+	include 'xgui.cmn'
+
+* calling argument declarations: (none)
+
+* internal variable declarations:
+	LOGICAL previous_eof, reverify, looking_for_end
+	INTEGER	TM_LENSTR, TM_LENSTR1,
+     .		status, iqual, ilist, cmnd_len, query, i
+
+        CHARACTER*1 backslash
+#ifdef NO_INTRINSIC_IN_PARAMETER
+        PARAMETER ( backslash = o'134' )
+#else
+        PARAMETER ( backslash = CHAR(92) )
+#endif
+
+
+* read from standard input without prompt
+ 10	READ ( ttin_lun, '(A)' ) cmnd_buff
+
+* Check for for QUERY commands beginning with "gui_char"
+* These commands are handled by this routine without returning to FERRET
+	IF ( cmnd_buff(1:1) .EQ. gui_char ) THEN
+	   IF ( cmnd_buff(2:2) .EQ. '>' ) THEN
+* ">" is a "CONTINUE" signal from GUI  (not used by GUI ??)
+	      cmnd_buff = ' '
+	      RETURN
+	   ELSE
+* parse the query: format of command is blank-only separated:
+*	"^nn tag arg2 arg3" 
+*      (argument numbering to match "QUERY ARG1 arg2 arg3 ...")
+* the "tag" field is not a standard part of the QUERY command
+* it is a special field which is simply echoed by FERRET to help the 
+* GUI keep track of replies
+#ifdef MANDATORY_FORMAT_WIDTHS
+* no fixed field width works but "*" may cause problems too
+* such as "Y" being an unacceptable integer
+	      READ ( cmnd_buff(2:3), *, ERR=5000 ) query
+#else
+	      READ ( cmnd_buff(2:3), '(I)', ERR=5000 ) query
+#endif
+	      len_cmnd = TM_LENSTR1( cmnd_buff )
+	      num_args = 0
+	      looking_for_end = .TRUE.
+	      DO 100 i = 2, len_cmnd
+* find end of this argument (starting with pseudo-argument 0 which is "^nn")
+	         IF ( looking_for_end ) THEN
+		   IF ( cmnd_buff(i:i) .EQ. " " ) THEN
+* ... record end of arg
+	              IF ( num_args .GE. 1 ) arg_end(num_args) = i-1
+	              looking_for_end = .FALSE.
+	           ENDIF
+	         ELSE
+* find start of arg
+	            IF ( cmnd_buff(i:i) .NE. " " ) THEN
+* ... record start of next arg
+	               num_args = num_args + 1
+	               arg_start(num_args) = i
+	               looking_for_end = .TRUE.
+	            ENDIF
+	         ENDIF
+ 100	      CONTINUE
+	      IF ( num_args .GE. 1 ) arg_end(num_args) = len_cmnd
+
+* answer query and request next command from GUI without ever bothering FERRET
+	      CALL DO_QUERY( err_lun, gui_fmt1, query,
+     .	                     cmnd_buff(arg_start(1):arg_end(1)), status )
+	      GOTO 10
+	   ENDIF
+	ELSE
+
+* normal command - pass it along to FERRET
+	   RETURN
+	ENDIF
+
+* synax error in GUI query - give a no-content response
+ 5000	CALL DO_QUERY( err_lun, gui_fmt1, 9999, '*', status )
+	GOTO 10
+	END
diff --git a/fer/gnl/name_equal_string.F b/fer/gnl/name_equal_string.F
new file mode 100644
index 0000000..e6cd75b
--- /dev/null
+++ b/fer/gnl/name_equal_string.F
@@ -0,0 +1,122 @@
+	SUBROUTINE NAME_EQUAL_STRING(nambuff, start_pos, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* decode "NAME = expression" on a command line
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510 - 12/99 *sh* - extracted from XEQ_DEFINE
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER		start_pos, status
+	CHARACTER*(*) nambuff
+
+* local variable declarations:
+	INTEGER STR_UPCASE, pos, i1
+
+	CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* find name to define
+* 2 syntaxes are allowed: "DEFINE VAR NAME=TEXT", "DEFINE VAR NAME TEXT"
+* in the latter be careful that "TEXT" may contain "="
+	pos = INDEX(cmnd_buff(arg_start(1):len_cmnd), '=')
+* ... is it a legit = sign or one used within [] further on in expression ?
+	IF ( num_args .GT. 1 ) THEN
+	   IF ( pos+arg_start(1)-1 .GT. arg_start(2) ) pos = 0
+	ENDIF
+	IF ( pos .EQ. 0 ) THEN
+* ... no "=" separator
+	   nambuff = cmnd_buff( arg_start(1):arg_end(1) )
+	   IF ( num_args .LT. 2 ) GOTO 400
+	   pos = arg_start(2)
+	ELSE
+* ... yes "=" separator
+	   pos = pos + arg_start(1)	! character after "="
+*    ... hunt backwards for end of variable name
+	   nambuff = '(none)'
+	   DO 101 i1 = pos-2, arg_start(1), -1
+	      IF ( cmnd_buff(i1:i1).EQ.' '
+     .	      .OR. cmnd_buff(i1:i1).EQ.tab ) THEN
+	         CONTINUE
+	      ELSE
+	         GOTO 102
+	      ENDIF
+ 101	   CONTINUE
+	   GOTO 5100
+ 102	   nambuff = cmnd_buff( arg_start(1):i1 )
+*    ... find next non-blank, non-tab after "=" -- start of expression
+	   DO 105 pos = pos, len_cmnd
+	      IF ( cmnd_buff(pos:pos) .NE. ' ' 
+     .	     .AND. cmnd_buff(pos:pos) .NE. tab  ) GOTO 106
+ 105	   CONTINUE
+	   GOTO 400	! no text following equal sign
+ 106	   CONTINUE
+	ENDIF
+	GOTO 500
+
+* no text follows the name -- this is just a name.
+ 400	start_pos = 0
+	GOTO 1000
+
+* save starting position of the text
+ 500	start_pos = pos
+
+* success
+ 1000	i1 = STR_UPCASE( nambuff, nambuff )	! uppercase name always
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100 	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff(:len_cmnd)//' ???', *5000 )
+
+
+	END
+
diff --git a/fer/gnl/name_equal_string_lc.F b/fer/gnl/name_equal_string_lc.F
new file mode 100644
index 0000000..1ecb3d4
--- /dev/null
+++ b/fer/gnl/name_equal_string_lc.F
@@ -0,0 +1,119 @@
+	SUBROUTINE NAME_EQUAL_STRING_LC(nambuff, start_pos, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* decode "NAME = expression" on a command line
+* Leaving the output in the original upper- or lower-case spelling.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER		start_pos, status
+	CHARACTER*(*) nambuff
+
+* local variable declarations:
+	INTEGER pos, i1
+
+	CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* find name to define
+* 2 syntaxes are allowed: "DEFINE VAR NAME=TEXT", "DEFINE VAR NAME TEXT"
+* in the latter be careful that "TEXT" may contain "="
+	pos = INDEX(cmnd_buff(arg_start(1):len_cmnd), '=')
+* ... is it a legit = sign or one used within [] further on in expression ?
+	IF ( num_args .GT. 1 ) THEN
+	   IF ( pos+arg_start(1)-1 .GT. arg_start(2) ) pos = 0
+	ENDIF
+	IF ( pos .EQ. 0 ) THEN
+* ... no "=" separator
+	   nambuff = cmnd_buff( arg_start(1):arg_end(1) )
+	   IF ( num_args .LT. 2 ) GOTO 400
+	   pos = arg_start(2)
+	ELSE
+* ... yes "=" separator
+	   pos = pos + arg_start(1)	! character after "="
+*    ... hunt backwards for end of variable name
+	   nambuff = '(none)'
+	   DO 101 i1 = pos-2, arg_start(1), -1
+	      IF ( cmnd_buff(i1:i1).EQ.' '
+     .	      .OR. cmnd_buff(i1:i1).EQ.tab ) THEN
+	         CONTINUE
+	      ELSE
+	         GOTO 102
+	      ENDIF
+ 101	   CONTINUE
+	   GOTO 5100
+ 102	   nambuff = cmnd_buff( arg_start(1):i1 )
+*    ... find next non-blank, non-tab after "=" -- start of expression
+	   DO 105 pos = pos, len_cmnd
+	      IF ( cmnd_buff(pos:pos) .NE. ' ' 
+     .	     .AND. cmnd_buff(pos:pos) .NE. tab  ) GOTO 106
+ 105	   CONTINUE
+	   GOTO 400	! no text following equal sign
+ 106	   CONTINUE
+	ENDIF
+	GOTO 500
+
+* no text follows the name -- this is just a name.
+ 400	start_pos = 0
+	GOTO 1000
+
+* save starting position of the text
+ 500	start_pos = pos
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100 	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff(:len_cmnd)//' ???', *5000 )
+
+
+	END
+
diff --git a/fer/gnl/name_equal_string_vatt.F b/fer/gnl/name_equal_string_vatt.F
new file mode 100644
index 0000000..eaf574d
--- /dev/null
+++ b/fer/gnl/name_equal_string_vatt.F
@@ -0,0 +1,121 @@
+	SUBROUTINE NAME_EQUAL_STRING_VATT (nambuff, start_pos, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* decode "NAME = expression" on a command line
+! when the name is a varname.attname, do not upcase the attribute name.
+
+* programmer - Ansley Manke - for attribute handling
+* Derived from NAME_EQUAL_STRING
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER		start_pos, status
+	CHARACTER*(*) nambuff
+
+* local variable declarations:
+	INTEGER STR_UPCASE, pos, i1
+
+	CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* find name to define
+* 2 syntaxes are allowed: "DEFINE VAR NAME=TEXT", "DEFINE VAR NAME TEXT"
+* in the latter be careful that "TEXT" may contain "="
+	pos = INDEX(cmnd_buff(arg_start(1):len_cmnd), '=')
+* ... is it a legit = sign or one used within [] further on in expression ?
+	IF ( num_args .GT. 1 ) THEN
+	   IF ( pos+arg_start(1)-1 .GT. arg_start(2) ) pos = 0
+	ENDIF
+	IF ( pos .EQ. 0 ) THEN
+* ... no "=" separator
+	   nambuff = cmnd_buff( arg_start(1):arg_end(1) )
+	   IF ( num_args .LT. 2 ) GOTO 400
+	   pos = arg_start(2)
+	ELSE
+* ... yes "=" separator
+	   pos = pos + arg_start(1)	! character after "="
+*    ... hunt backwards for end of variable name
+	   nambuff = '(none)'
+	   DO 101 i1 = pos-2, arg_start(1), -1
+	      IF ( cmnd_buff(i1:i1).EQ.' '
+     .	      .OR. cmnd_buff(i1:i1).EQ.tab ) THEN
+	         CONTINUE
+	      ELSE
+	         GOTO 102
+	      ENDIF
+ 101	   CONTINUE
+	   GOTO 5100
+ 102	   nambuff = cmnd_buff( arg_start(1):i1 )
+*    ... find next non-blank, non-tab after "=" -- start of expression
+	   DO 105 pos = pos, len_cmnd
+	      IF ( cmnd_buff(pos:pos) .NE. ' ' 
+     .	     .AND. cmnd_buff(pos:pos) .NE. tab  ) GOTO 106
+ 105	   CONTINUE
+	   GOTO 400	! no text following equal sign
+ 106	   CONTINUE
+           IF (INDEX(nambuff,'[') .GT. 0)   ! get the rest of the [d=] spec
+     .        nambuff = cmnd_buff( arg_start(1):len_cmnd )
+	ENDIF
+	GOTO 500
+
+* no text follows the name -- this is just a name.
+ 400	start_pos = 0
+	GOTO 1000
+
+* save starting position of the text
+ 500	start_pos = pos
+
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100 	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff(:len_cmnd)//' ???', *5000 )
+
+
+	END
+
diff --git a/fer/gnl/netcdf4_cancel_settings.F b/fer/gnl/netcdf4_cancel_settings.F
new file mode 100644
index 0000000..7b8e9b1
--- /dev/null
+++ b/fer/gnl/netcdf4_cancel_settings.F
@@ -0,0 +1,68 @@
+	SUBROUTINE NETCDF4_CANCEL_SETTINGS
+* 
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Reset the settings for netcdf4 output datasets and store in common.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 1/13/2010
+
+        include 'netcdf4_settings.cmn'
+
+	netcdf4_type = 3
+	xchunk_size  = 0
+	ychunk_size  = 0
+	zchunk_size  = 0
+	tchunk_size  = 0
+	echunk_size  = 0
+	fchunk_size  = 0
+	deflate_lev  = 0
+	shuffle_flag = 0
+	endian_code  = 0
+
+	netcdf4_type_set = netcdf4_type
+	xchunk_size_set  = xchunk_size
+	ychunk_size_set  = ychunk_size
+	zchunk_size_set  = zchunk_size
+	tchunk_size_set  = tchunk_size
+	echunk_size_set  = echunk_size
+	fchunk_size_set  = fchunk_size
+	deflate_lev_set  = deflate_lev
+	shuffle_flag_set = shuffle_flag
+	endian_code_set  = endian_code
+
+	RETURN
+	END
diff --git a/fer/gnl/netcdf4_list_settings.F b/fer/gnl/netcdf4_list_settings.F
new file mode 100644
index 0000000..f9a304d
--- /dev/null
+++ b/fer/gnl/netcdf4_list_settings.F
@@ -0,0 +1,289 @@
+
+
+	SUBROUTINE NETCDF4_LIST_SETTINGS (status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the settings for netcdf4 output datasets and store them in common.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 1/13/2010
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Read info from qualilifiers for LIST netCDF4: NCFORMAT,
+* XCHUNK,YCHUNK,ZCHUNK,TCHUNK,ECHUNK,FCHUNK,DEFLATE,SHUFFLE,ENDIAN
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'errmsg.parm'
+        include 'netcdf4_settings.cmn'
+
+* calling argument declarations
+	INTEGER		status
+
+* internal variable declarations
+	INTEGER  STR_SAME, loc, slen
+	CHARACTER buff*128
+
+* initialize netcdf4-type stuff. If there has been a 
+* SET LIST/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE then these contain those values,
+* otherwise they are set to the defaults
+
+	netcdf4_type = netcdf4_type_set
+	xchunk_size  = xchunk_size_set
+	ychunk_size  = ychunk_size_set
+	zchunk_size  = zchunk_size_set
+	tchunk_size  = tchunk_size_set
+	echunk_size  = echunk_size_set
+	fchunk_size  = fchunk_size_set
+	deflate_lev  = deflate_lev_set
+	shuffle_flag = shuffle_flag_set
+	endian_code  = endian_code_set
+
+* /NCFORMAT for netCDF4 types ?
+* NETCDF4 and CLASSIC, or 4=NETCDF4, 3=CLASSIC, 64BIT_OFFSET(?)
+
+        loc = qual_given( slash_list_ncformat )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )              
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff(1:3), 'CLA') .EQ. 0) THEN
+              netcdf4_type = 3
+	   ELSEIF (STR_SAME(buff(1:1), '3') .EQ. 0) THEN
+              netcdf4_type = 3
+	   ELSEIF (STR_SAME(buff(1:7), 'NETCDF4') .EQ. 0) THEN
+              netcdf4_type = 4
+	   ELSEIF (STR_SAME(buff(1:1), '4') .EQ. 0) THEN
+              netcdf4_type = 4
+	   ELSEIF (STR_SAME(buff(1:3), '64B' ) .EQ. 0) THEN ! NF_64BIT_OFFSET
+              netcdf4_type = 6
+	   ELSEIF (STR_SAME(buff(1:1), '6' ) .EQ. 0) THEN
+              netcdf4_type = 6
+           ELSE
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+
+* /XCHUNK,YCHUNK,ZCHUNK,TCHUNK,ECHUNK,FCHUNK for netCDF4 chunking?
+
+	loc = qual_given( slash_list_xchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )              
+           READ (buff, *) xchunk_size
+	   IF (xchunk_size .LE. 0) GOTO 5200
+	ENDIF
+ 
+        loc = qual_given( slash_list_ychunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) ychunk_size
+	   IF (ychunk_size .LE. 0) GOTO 5200
+	ENDIF
+
+        loc = qual_given( slash_list_zchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) zchunk_size
+	   IF (zchunk_size .LE. 0) GOTO 5200
+	ENDIF
+	
+        loc = qual_given( slash_list_tchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) tchunk_size
+	   IF (tchunk_size .LE. 0) GOTO 5200
+	ENDIF
+	
+        loc = qual_given( slash_list_echunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) echunk_size
+	   IF (echunk_size .LE. 0) GOTO 5200
+	ENDIF
+	
+        loc = qual_given( slash_list_fchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) fchunk_size
+	   IF (fchunk_size .LE. 0) GOTO 5200
+	ENDIF
+
+* DEFLATE 
+* Can set compression level though all indicatins are that value=1 is best
+* deflate=0 means no deflate
+
+        loc = qual_given( slash_list_DEFLATE )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      deflate_lev = 1
+	   ELSE
+              READ (buff, *) deflate_lev
+	   ENDIF
+	   IF (deflate_lev .LT. 0 .OR. deflate_lev.GT.9) GOTO 5300
+	ENDIF
+
+* SHUFFLE 
+* Shuffle = 0 or 1
+
+	loc = qual_given( slash_list_shuffle )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      shuffle_flag = 1
+	   ELSE
+              READ (buff, *) shuffle_flag
+	   ENDIF
+	   IF (shuffle_flag .NE. 0 .AND. shuffle_flag.NE.1) GOTO 5400
+	ENDIF
+
+! ENDIAN: native, little, big
+
+        loc = qual_given( slash_list_endian )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      endian_code = 0 
+	   ELSEIF (STR_SAME(buff(1:3), 'LIT') .EQ. 0) THEN
+              endian_code = 1 ! nf_endian_little
+	   ELSEIF (STR_SAME(buff(1:3), 'BIG') .EQ. 0) THEN
+              endian_code = 2 ! nf_endian_big
+	   ELSEIF (STR_SAME(buff(1:3), 'NAT') .EQ. 0) THEN
+              endian_code = 0 ! nf_endian_native
+	   ELSE
+              GOTO 5500
+	   ENDIF
+	   
+	ENDIF
+
+* Check for illegal compression or chunking requested on netCDF3 or 
+* 64BIT_OFFSET and restore defaults
+
+	IF (netcdf4_type .EQ. 3) THEN
+	   buff = 'NetCDF Classic'
+	   slen = 14
+	ENDIF
+	IF (netcdf4_type .EQ. 6) THEN
+	   buff = 'NetCDF 64BIT_OFFSET'
+           slen = 19
+	ENDIF
+
+	IF (netcdf4_type.EQ.3 .OR. netcdf4_type.EQ.6) THEN
+	   IF (deflate_lev .NE. 0) THEN
+	      deflate_lev = 0
+	      CALL WARN(
+     . buff(:slen)//' style cannot set compression, ignoring /DEFLATE')
+	   ENDIF
+
+	   IF (shuffle_flag .NE. 0) THEN
+	      shuffle_flag = 0
+	      CALL WARN(
+     . buff(:slen)//' style cannot set compression, ignoring /SHUFFLE')
+	   ENDIF
+
+	   IF (xchunk_size .NE. 0 .OR. ychunk_size .NE. 0 .OR. 
+     .         zchunk_size .NE. 0 .OR. tchunk_size .NE. 0.OR. 
+     .         echunk_size .NE. 0 .OR. fchunk_size .NE. 0) THEN
+	      xchunk_size = 0
+	      ychunk_size = 0
+	      zchunk_size = 0
+	      tchunk_size = 0
+	      echunk_size = 0
+	      fchunk_size = 0
+	      CALL WARN(
+     . buff(:slen)//' style cannot set chunking, ignoring /*CHUNK')
+	   ENDIF
+
+	   IF (endian_code .NE. 0) THEN
+	      endian_code = 0
+	      CALL WARN(
+     . buff(:slen)//' style cannot set Endian, ignoring /ENDIAN')
+	   ENDIF
+	
+	ENDIF
+
+	status = ferr_ok
+
+ 1000	CONTINUE
+	RETURN
+
+* error messages
+
+ 5000	CALL ERRMSG( ferr_invalid_command, status,
+     .  'Error reading parameters in netcdf4_list_settings', *1000 )
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     . '/NCFORMAT may take values NETCDF4, CLASSIC, 4, 3, 64BIT_OFFSET', 
+     . *1000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/*CHUNK= values must be > 0', *1000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/DEFLATE level must be between 0 and 9', *1000 )
+ 5400	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/SHUFFLE must take the value 0 or 1', *1000 )
+ 5500	CALL ERRMSG( ferr_invalid_command, status,
+     . '/ENDIAN may be NATIVE, LITTLE or BIG', *1000 )
+	END
diff --git a/fer/gnl/netcdf4_set_list_settings.F b/fer/gnl/netcdf4_set_list_settings.F
new file mode 100644
index 0000000..acbd285
--- /dev/null
+++ b/fer/gnl/netcdf4_set_list_settings.F
@@ -0,0 +1,257 @@
+
+
+	SUBROUTINE NETCDF4_SET_LIST_SETTINGS (status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the settings for netcdf4 output datasets and store them in common.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 1/13/2010
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Read info from qualilifiers for LIST netCDF4: NCFORMAT,
+* XCHUNK,YCHUNK,ZCHUNK,TCHUNK,ECHUNK,FCHUNK,DEFLATE,SHUFFLE,ENDIAN
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'errmsg.parm'
+        include 'netcdf4_settings.cmn'
+
+* calling argument declarations
+	INTEGER		status
+
+* internal variable declarations
+	INTEGER  STR_SAME, loc, slen
+	CHARACTER buff*128
+
+* initialize netcdf4-type stuff. If there has been a 
+* SET LIST/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE then these contain those values,
+* otherwise they are set to the defaults
+
+	netcdf4_type = netcdf4_type_set
+	xchunk_size  = xchunk_size_set
+	ychunk_size  = ychunk_size_set
+	zchunk_size  = zchunk_size_set
+	tchunk_size  = tchunk_size_set
+	echunk_size  = echunk_size_set
+	fchunk_size  = fchunk_size_set
+	deflate_lev  = deflate_lev_set
+	shuffle_flag = shuffle_flag_set
+	endian_code  = endian_code_set
+
+* /NCFORMAT for netCDF4 types ?
+* NETCDF4 and CLASSIC, or 4=NETCDF4, 3=CLASSIC, 64BIT_OFFSET(?)
+
+        loc = qual_given( slash_set_list_ncformat )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )              
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff(1:3), 'CLA') .EQ. 0) THEN
+              netcdf4_type = 3
+	   ELSEIF (STR_SAME(buff(1:1), '3') .EQ. 0) THEN
+              netcdf4_type = 3
+	   ELSEIF (STR_SAME(buff(1:7), 'NETCDF4') .EQ. 0) THEN
+              netcdf4_type = 4
+	   ELSEIF (STR_SAME(buff(1:1), '4') .EQ. 0) THEN
+              netcdf4_type = 4
+	   ELSEIF (STR_SAME(buff(1:3), '64B' ) .EQ. 0) THEN ! NF_64BIT_OFFSET
+              netcdf4_type = 6
+	   ELSEIF (STR_SAME(buff(1:1), '6' ) .EQ. 0) THEN
+              netcdf4_type = 6
+           ELSE
+	      GOTO 5100
+	   ENDIF
+	   netcdf4_type_set = netcdf4_type
+	ENDIF
+
+* /XCHUNK,YCHUNK,ZCHUNK,TCHUNK,ECHUNK,FCHUNK for netCDF4 chunking?
+
+	loc = qual_given( slash_set_list_xchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )              
+           READ (buff, *) xchunk_size
+	   IF (xchunk_size .LE. 0) GOTO 5200
+	   xchunk_size_set = xchunk_size
+	ENDIF
+ 
+        loc = qual_given( slash_set_list_ychunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) ychunk_size
+	   IF (ychunk_size .LE. 0) GOTO 5200
+	   ychunk_size_set = ychunk_size
+	ENDIF
+
+        loc = qual_given( slash_set_list_zchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) zchunk_size
+	   IF (zchunk_size .LE. 0) GOTO 5200
+	   zchunk_size_set = zchunk_size
+	ENDIF
+	
+        loc = qual_given( slash_set_list_tchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) tchunk_size
+	   IF (tchunk_size .LE. 0) GOTO 5200
+	   tchunk_size_set = tchunk_size
+	ENDIF
+	
+        loc = qual_given( slash_set_list_echunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) echunk_size
+	   IF (echunk_size .LE. 0) GOTO 5200
+	   echunk_size_set = echunk_size
+	ENDIF
+	
+        loc = qual_given( slash_set_list_fchunk )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           READ (buff, *) fchunk_size
+	   IF (fchunk_size .LE. 0) GOTO 5200
+	   fchunk_size_set = fchunk_size
+	ENDIF
+
+* DEFLATE 
+* Can set compression level though all indicatins are that value=1 is best
+* deflate=0 means no deflate
+
+        loc = qual_given( slash_set_list_DEFLATE )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      deflate_lev = 1
+	   ELSE
+              READ (buff, *) deflate_lev
+	   ENDIF
+	   IF (deflate_lev .LT. 0 .OR. deflate_lev.GT.9) GOTO 5300
+	   deflate_lev_set = deflate_lev
+	ENDIF
+
+* SHUFFLE 
+* Shuffle = 0 or 1
+
+	loc = qual_given( slash_set_list_shuffle )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      shuffle_flag = 1
+	   ELSE
+              READ (buff, *) shuffle_flag
+	   ENDIF
+	   IF (shuffle_flag .NE. 0 .AND. shuffle_flag.NE.1) GOTO 5400
+	   shuffle_flag_set = shuffle_flag
+	ENDIF
+
+! ENDIAN: native, little, big
+
+        loc = qual_given( slash_set_list_endian )
+	IF (loc .GT. 0) THEN 
+	   CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (STR_SAME(buff, ' ' ) .EQ. 0) THEN 
+	      endian_code = 0 
+	   ELSEIF (STR_SAME(buff(1:3), 'LIT') .EQ. 0) THEN
+              endian_code = 1 ! nf_endian_little
+	   ELSEIF (STR_SAME(buff(1:3), 'BIG') .EQ. 0) THEN
+              endian_code = 2 ! nf_endian_big
+	   ELSEIF (STR_SAME(buff(1:3), 'NAT') .EQ. 0) THEN
+              endian_code = 0 ! nf_endian_native
+	   ELSE
+              GOTO 5500
+	   ENDIF
+	   
+	   endian_code_set = endian_code
+	ENDIF
+
+* No checks for illegal compression or chunking requested on netCDF3 or 
+* 64BIT_OFFSET file types. Settings may be made in more than one SET LIST/ 
+* commands.  Need those kinds of checks when we go to make use of them.
+
+	status = ferr_ok
+
+ 1000	CONTINUE
+	RETURN
+
+* error messages
+
+ 5000	CALL ERRMSG( ferr_invalid_command, status,
+     .  'Error reading parameters in netcdf4_list_settings', *1000 )
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     . '/NCFORMAT may take values NETCDF4, CLASSIC, 4, 3, 64BIT_OFFSET', 
+     . *1000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/*CHUNK= values must be > 0', *1000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/DEFLATE level must be between 0 and 9', *1000 )
+ 5400	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/SHUFFLE must take the value 0 or 1', *1000 )
+ 5500	CALL ERRMSG( ferr_invalid_command, status,
+     . '/ENDIAN may be NATIVE, LITTLE or BIG', *1000 )
+	END
diff --git a/fer/gnl/netcdf4_show_list_settings.F b/fer/gnl/netcdf4_show_list_settings.F
new file mode 100644
index 0000000..8d1fd3f
--- /dev/null
+++ b/fer/gnl/netcdf4_show_list_settings.F
@@ -0,0 +1,159 @@
+	SUBROUTINE NETCDF4_SHOW_LIST_SETTINGS
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the settings for netcdf4 output datasets and show them as other
+* SET LIST settings are shown
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 1/13/2010
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Qualilifiers for SET LIST: NCFORMAT,
+* XCHUNK,YCHUNK,ZCHUNK,TCHUNK,DEFLATE,SHUFFLE,ENDIAN
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'errmsg.parm'
+        include 'netcdf4_settings.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations
+	INTEGER		status
+
+* internal variable declarations
+	INTEGER  STR_SAME, loc, slen, nchunk
+	CHARACTER TM_FMT*12, show_str*12
+	REAL val
+
+* initialize netcdf4-type stuff. If there has been a 
+* SET LIST/NCFORMAT/ENDIAN/DEFLATE/SHUFFLE then these contain those values,
+* otherwise they are set to the defaults
+
+
+        risc_buff = '           ---- '
+        CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        risc_buff = '        NetCDF-4 settings: '
+        CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+* /NCFORMAT for netCDF4 types ?
+* NETCDF4 and CLASSIC, or 4=NETCDF4, 3=CLASSIC, 64BIT_OFFSET(?)
+
+        IF (netcdf4_type .EQ. 3) 
+     .      risc_buff = '        NetCDF file type = classic'
+	IF (netcdf4_type .EQ. 4) 
+     .      risc_buff = '        NetCDF file type = NetCDF-4'
+	IF (netcdf4_type .EQ. 6) 
+     .      risc_buff = '        NetCDF file type = NF_64BIT_OFFSET'
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+* DEFLATE 
+* Can set compression level though all indicatins are that value=1 is best
+* deflate=0 means no deflate
+
+        IF (deflate_lev .LE. 0) THEN
+           risc_buff = 'Compression not set'
+        ELSE 
+	   WRITE (risc_buff, 1100) deflate_lev
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	ENDIF
+ 1100   FORMAT (8X, 'Compression (deflate) level set to ', I1)
+
+        nchunk = 0
+        IF (xchunk_size_set .GT. 0) THEN
+	   val = xchunk_size
+           show_str = TM_FMT(val, 5, 12, slen)
+	   WRITE (risc_buff, 1200) 'X', show_str(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   nchunk = nchunk + 1
+	ENDIF
+ 1200   FORMAT (8X, A1,'CHUNK size set to ', A)
+        IF (ychunk_size_set .GT. 0) THEN
+	   val = ychunk_size
+           show_str = TM_FMT(val, 5, 12, slen)
+	   WRITE (risc_buff, 1200) 'Y', show_str(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   nchunk = nchunk + 1
+	ENDIF
+
+        IF (zchunk_size_set .GT. 0) THEN
+	   val = zchunk_size
+           show_str = TM_FMT(val, 5, 12, slen)
+	   WRITE (risc_buff, 1200) 'Z', show_str(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   nchunk = nchunk + 1
+	ENDIF
+
+        IF (tchunk_size_set .GT. 0) THEN
+	   val = tchunk_size
+           show_str = TM_FMT(val, 5, 12, slen)
+	   WRITE (risc_buff, 1200) 'T', show_str(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   nchunk = nchunk + 1
+	ENDIF
+        
+	IF (nchunk .EQ. 0) THEN
+	   risc_buff = '        NetCDF chunk sizes = default'
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	ENDIF
+
+* SHUFFLE 
+* Shuffle = 0 or 1
+
+	IF (shuffle_flag .EQ. 1) THEN
+           risc_buff = '        SHUFFLE set to off'
+	ELSE
+           risc_buff = '        SHUFFLE set to on'
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+! ENDIAN: native, little, big
+
+	IF (endian_code .EQ. 0) THEN
+           risc_buff = '        ENDIAN set to native'
+	ELSEIF (endian_code .EQ. 1) THEN
+           risc_buff = '        ENDIAN set to little'
+	ELSEIF (endian_code .EQ. 2) THEN
+           risc_buff = '        ENDIAN set to big'
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+	RETURN
+
+	END
diff --git a/fer/gnl/no_journal.F b/fer/gnl/no_journal.F
new file mode 100644
index 0000000..687a549
--- /dev/null
+++ b/fer/gnl/no_journal.F
@@ -0,0 +1,52 @@
+	SUBROUTINE NO_JOURNAL
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Setting for no Ferret journal file, for ferret -nojnl switch
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V5.42: 11/02 - from init_journal and xeq_cancel
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+   
+	include 'tmap_dims.parm'
+	include 'xprog_state.cmn'
+	include 'ferret.parm'
+
+        jrnl_lun = unspecified_int4
+
+	RETURN
+	END
diff --git a/fer/gnl/parse_comma_list.F b/fer/gnl/parse_comma_list.F
new file mode 100644
index 0000000..4246042
--- /dev/null
+++ b/fer/gnl/parse_comma_list.F
@@ -0,0 +1,217 @@
+
+
+	SUBROUTINE PARSE_COMMA_LIST ( buffer, istart, iend, max_items, 
+     .				      num_it, it_start, it_end, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* find the boundaries of the "items" that are separated by commas
+* istart and iend delimit the search region within the buffer and are
+* both assumed to represent the positions of non-blank characters
+* likewise the returned item limits will represent non-blank characters
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/7/86
+* revision 1.0 - 7/28/88 - complete re-write to cope wit imbedded "[" and ""
+* revision 1.1 - 8/9/88  - allow multiple commas for PLOT+ compatibility
+* V230:  8/4/92 - error message lacks blanks
+* V320: 12/29/94 - use WARN to avoid direct tty output (for GUI)
+* Linux Port - 12/96 *kob
+*	     - had to close open quotes in above comment line - linux f77
+*	       was freaking out because of it...
+* V530: *sh* 3/01 - remove surrounding quotes from items in list
+* V532: *sh* 5/01 - ignore commas embedded in parentheses
+*		  - allow for nested parens and brackets
+* V533: *sh* 7/01 - allow both single and double quoted strings
+* 1/03 *kob* g77 port -  Need to use risc_buff for arbitrary concatenations
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'	! for ttout_lun
+	include 'xrisc.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	buffer
+	INTEGER		istart, iend, max_items, num_it,
+     .			it_start(max_items), it_end(max_items), status
+
+* internal variable declarations:
+	INTEGER		ip, i, nest_level
+	CHARACTER*8	LEFINT
+
+* initialize
+	risc_buff = buffer		! for RISC/FORTRAN
+	num_it = 0
+	ip = istart
+
+* TOP OF LOOP
+ 10	CONTINUE
+
+	IF ( buffer(ip:ip) .EQ. ' '
+     .  .OR. buffer(ip:ip) .EQ. '	' ) THEN
+* skip past leading tabs and blanks to find first character
+	   ip = ip + 1
+	   IF ( ip .GT. iend ) GOTO 1000
+	   GOTO 10
+	ELSE
+* found first character of item
+	   IF ( num_it .EQ. max_items ) GOTO 6000
+	   num_it = num_it + 1
+	   it_start(num_it) = ip
+	ENDIF
+
+* comma alone representing a place holder ?
+	IF ( buffer(ip:ip) .EQ. ',' ) THEN
+	   it_end(num_it) = ip
+	   ip = ip + 1
+	   IF ( ip .GE. iend ) GOTO 1000
+	   GOTO 10
+	ENDIF
+
+* search for end of item
+	ip = ip - 1
+ 30	ip = ip + 1
+	IF ( ip .GE. iend ) THEN
+	   it_end(num_it) = iend
+	   GOTO 1000
+	ENDIF
+
+* ... ignore commas sandwiched between [ ]
+	IF ( buffer(ip:ip) .EQ. '[' ) THEN
+	   nest_level = -1  ! will be immediately incremented
+	   DO 40 i = ip, iend
+	      IF ( buffer(i:i) .EQ. '[' ) THEN
+	         nest_level = nest_level + 1
+	      ELSEIF ( buffer(i:i) .EQ. ']' ) THEN
+	         IF (nest_level .GT. 0) THEN
+	            nest_level = nest_level - 1
+	         ELSE
+	            ip = i
+	            GOTO 30
+	         ENDIF
+	      ENDIF
+ 40	   CONTINUE
+	   GOTO 5020	! unpaired
+
+* ... ignore commas sandwiched between ( )
+	ELSEIF ( buffer(ip:ip) .EQ. '(' ) THEN
+	   nest_level = -1  ! will be immediately incremented
+	   DO 45 i = ip, iend
+	      IF ( buffer(i:i) .EQ. '(' ) THEN
+	         nest_level = nest_level + 1
+	      ELSEIF ( buffer(i:i) .EQ. ')' ) THEN
+	         IF (nest_level .GT. 0) THEN
+	            nest_level = nest_level - 1
+	         ELSE
+	            ip = i
+	            GOTO 30
+	         ENDIF
+	      ENDIF
+ 45	   CONTINUE
+	   GOTO 5020	! unpaired
+
+* ... ignore commas sandwiched between " "
+	ELSEIF ( buffer(ip:ip) .EQ. '"' ) THEN
+	   DO 50 i = ip+1, iend
+	      IF ( buffer(i:i) .EQ. '"' ) THEN
+	         ip = i
+	         GOTO 30
+	      ENDIF
+ 50	   CONTINUE
+	   GOTO 5020	! unpaired
+
+* ... ignore commas sandwiched between ' '   ! 7/01
+	ELSEIF ( buffer(ip:ip) .EQ. "'" ) THEN
+	   DO i = ip+1, iend
+	      IF ( buffer(i:i) .EQ. "'" ) THEN
+	         ip = i
+	         GOTO 30
+	      ENDIF
+	   ENDDO
+	   GOTO 5020	! unpaired
+
+* ... comma as terminator
+	ELSEIF ( buffer(ip:ip) .EQ. ',' ) THEN
+* ... search backwards for the last non-blank/tab
+	   DO 60 i = ip-1,it_start(num_it),-1
+	      IF ( buffer(i:i) .NE. ' '
+     .	     .AND. buffer(i:i) .NE. '	' ) THEN
+	         it_end(num_it) = i
+	         ip = ip + 1
+	         GOTO 10
+	      ENDIF
+ 60	   CONTINUE
+	   it_end(num_it) = it_start(num_it)
+	   ip = it_start(num_it) + 1
+	   GOTO 10
+
+* any other character
+	ELSE
+	   GOTO 30
+
+	ENDIF	   
+
+* remove surrounding quotes from individual items
+ 1000	DO i = 1, num_it
+	   IF (buffer(it_start(i):it_start(i)) .EQ. '"'
+     .   .AND. buffer(it_end  (i):it_end  (i)) .EQ. '"' ) THEN
+	      IF ( it_end(i) .GT. it_start(i)+1 ) THEN
+	         it_start(i) = it_start(i) + 1
+	         it_end(i)   = it_end(i)   - 1
+	      ENDIF
+	   ENDIF
+	ENDDO
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5020	CALL ERRMSG( ferr_syntax, status,
+     .		'unpaired quotations, parens, or brackets '
+     .           //pCR//risc_buff(istart:iend), *5000 )
+
+* warning exit
+* *kob 1/03 g77 port needs risc buff
+ 6000	risc_buff = buffer(istart:iend)
+	CALL WARN( 'command incompletely processed: '
+     .		//risc_buff )
+	CALL WARN( 'Maximum items in command: '//LEFINT(max_items,i))
+	RETURN
+
+	END
diff --git a/fer/gnl/parse_command.F b/fer/gnl/parse_command.F
new file mode 100644
index 0000000..9449c6a
--- /dev/null
+++ b/fer/gnl/parse_command.F
@@ -0,0 +1,911 @@
+	SUBROUTINE PARSE_COMMAND ( memory, cmnd_buff,
+     .				   max_words, max_quals,
+     .				   cmnd_len, cmnd_num, subcmnd_num,
+     .				   num_quals, qualifier_list,
+     .				   qual_start, qual_end,
+     .				   num_args, arg_start, arg_end,
+     .				   err_lun, reverify, arg1_quoted, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* decode a command line into command, subcommand, qualifiers and arguments
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/24/86
+* revision 0.1 - 3/4/87  - changed /star to /@
+* revision 0.2 - 5/13/87 - errors processed via ERRMSG
+* revision 0.3 - 3/23/88 - bug in quotation mark processing (/T="17-AUG-1982")
+* revision 0.4 - 7/28/88 - treat "[" similar to '"' -  allowing commmas as in
+*			   TEMP[D=1,G=U] 
+* V200:  12/8/89 - correctly handle tabs and spaces preceding ! comment
+* 	  2/8/90 - fill in command alias, if any
+* Unix/RISC port - 1/91 - cant use "/star" in documentation
+*                 10/91 - added TM_LEGAL_NAME for improved syntax checks
+*!! removed - doesn't work !! - checked for buffer overflow
+* V230:  6/26/92 - commands, subcommands, and qualifiers 4-->8 characters
+*         8/4/92 - bug fix:  message "yy" ,xx --> error: unpaired quotation ...
+*                          - formalized handling of quotations (see comments)
+* V300: 2/3/93 - check for semicolons and parens in command groups
+*      4/20/93 - "go back" and start again after alias substitution
+*	          allowing command groups or other aliases in an alias
+*      4/21/93 - replace "$n" arguments in GO command lines
+*	       - ignore semicolons inside of quotation marks
+*       5/6/93 - lots of little stuff for dollar argument subst incl "reverify"
+* V301:2/25/94 - bug fix: num_args wrong if "/"'s follow args inside other args
+* V314:8/18/94 *kob* IBM port - MATCH4 should be defined as logical
+* V400: 3/20/95 - call REPL_EXPRNS to evaluated any grave accent-enclosed
+*		  expressions as a part of command parsing.
+*		  Added argument "memory".
+*	 6/2/95  - substitute (PLOT+) symbols prior to any other parsing
+* V420:10/26/95 - Avoid paren removal when line begins with "($name)"
+*		- do not allow ":" to end a word (e.g. "/xlimits=12: 16")
+*		- make sure "()" is retained as a single word
+*       11/3/95 - allow \ to escap !,`,/ and ;	! removed quotes *kob* 12/96
+*		- improve parsing to accomodate nested [] and ()
+*	4/25/96 - for IF and ELIF commands only evaluate grave accents in the
+*		  up to the first command argument (others will be evaluated
+*		  when the sub-clause of the IF is evaluated.
+* V430: 6/11/96 - Ignore "yes?" at start of command
+* Linux Port - 12/96 *kob
+*	     - had to close open quotes in above comment line - linux f77
+*	       was freaking out because of it...
+*	     - added ifdef check for double slash because f90/linux didn't
+*	       need two of them together for escapes
+* v4.91 12/97 *kob* - added parameter decl. for local_max_arg_list to use as
+*                     number of elements for itsa_qualifer logical array
+* V500 *sh* 4/99 - Increased nsubst_passes to 100 for detecting recursion
+*		- so large numbers of grave accents can be in a single line
+* V530 *sh* 10/00 - modify so that symbols inside of REPEAT loops get
+*	translated inside of the loop (keep copy of input in risc_buff)
+*	*sh* 3/01 - added arg1_quoted to indicate if the first arg in the list
+*		has enclosing quotes - and avoid calling PARSE_COMMA_LIST
+* V531 *sh* 4/01 - added continuation lines
+* V533 *sh* 7/01 - allow both single and double quotes
+* v541 *acm* 3/02 -bug fix; nested repeat loops, parsing parentheses in the command.
+*                  Make another copy of cmnd_buff AFTER removal of enclosing parens
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+* V552 *acm* 6/03  The v541 fix noted above introduced bug in symbol substitution
+*                  within REPEATS: yes? def sym a 0; rep/i=1:3 (def sym a `i`; say ($a))
+*                  Fix in saving cmnd_copy.  Bugs 376 and 558 fixed.
+* V600 *acm* 3/06  fixing bugs 439&1390, pass cmnd_num to repl_exprns so we can decide
+*                  if the command is an action command, and so whether to apply command
+*                  context to grave-accent expressions.
+* v603 *acm* 5/07  fix bug 919; null symbol entered as the command produced an error;
+*                  the fix is to return at statement 500 if word_num = 0
+* v612 *acm* 7/08  Fix bug 1583: precision of grave-accent expressions upped from 5 to 7.
+* v62  *acm*11/08  Fix bug 1608: semicolon inside double quotes.
+* V68  *acm* 3/12  For double-precision Ferret, let the precision of grave-accent 
+*                  expressions increase to 14.
+* V68  *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V68  *acm* 7/12 return 16 digits by default for grave-accent expressions
+* V685+ *acm* 12/13  bounds checking: dont refer to parts of the string outside its bounds.
+
+* command, subcommand and qualifiers will be identified by number in
+*	 COMMON/XCOMMAND.  Arguments will be returned as positions in
+*	 the command buffer
+* command syntax:
+*	COMMAND_NAME [/QUALx/QUALy...] [SUBCOMMAND] [ARGUMENTa ARGUMENTb ...]
+*
+*	qualifiers may be anywhere preceeding the first argument
+*	arguments are separated by spaces or tabs unless = or comma is present
+*	SUBCOMMAND is optional
+*	quotes may surround any group of characters that is to be regarded as a
+*	single argument
+ 
+* note: arrays arg_start and arg_end must be large enough to accomodate the
+*	sum of command, subcommand, qualifiers and args since they are used
+*	for working storage
+
+* note: quotations (8/92): quotation mark pairs will be interpreted either
+*       as surrounding quotes or as embedded quotes depending on whether the
+*       quote marks are both the starting and ending characters of the "word".
+*       For surrounding quotes the word start/end will exclude the quotes.
+
+* declare calling arguments of SUBROUTINE
+	LOGICAL		reverify, arg1_quoted
+	REAL		memory(*)
+	CHARACTER*(*)	cmnd_buff
+	INTEGER		max_words,max_quals,cmnd_len,cmnd_num,subcmnd_num,
+     .			num_quals,qualifier_list(max_quals),
+     .			qual_start(max_quals), qual_end(max_quals),
+     .			num_args,arg_start(max_words),arg_end(max_words),
+     .			err_lun,status
+
+	include	'tmap_dims.parm'
+	include	'errmsg.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include 'xcommand.cmn'
+	include 'xcontrol.cmn'
+	include 'xvariables.cmn'	! for num_uvars_in_cmnd
+
+* local variable declarations:
+*
+**kob*12/97!!! NOTE:local_max_arg_list must match max_arg_list in xprog_state
+        INTEGER local_max_arg_list
+        PARAMETER (local_max_arg_list = 256)
+
+* modified def of MATCH4 from INTEGER to LOGICAL *kob* IBM port 8/94
+	LOGICAL	TM_LEGAL_NAME, known_qualifier, atsin_qualifier,
+     .          surround_quote, doub_quote, subst, first_paren,
+     .          itsa_qualifier(local_max_arg_list), 
+     .          MATCH4, escape, apply_cx, ptrslash
+	INTEGER TM_LENSTR
+	INTEGER	buff_len, bang_position, ptr, quote_end,
+     .		word_num, look_ahead, look_back, isub_word, csgo,
+     .		isubcmnd_ptr, iword, last_qual, iqual_word, iterm,
+     .		iqual, iqual_ptr, iarg, i, nparen, nsubst_passes,
+     .		grave_start, grave_end, in, out, nest,
+     .		paren_level,len_test,len_mchars, m
+	CHARACTER c1*1
+	CHARACTER url_buff*2048
+
+* local parameter declarations:
+	INTEGER		grave_digits
+	CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9) )
+#endif
+        PARAMETER ( grave_digits = 16 )
+
+* intialize
+	grave_start	= 1
+	nsubst_passes   = 0
+	reverify	= .FALSE.
+	arg1_quoted	= .FALSE.
+	status 		= ferr_ok
+	buff_len	= LEN ( cmnd_buff )
+ 5	ptr		= 1		! current position in cmnd_buff
+	word_num	= 0		! current "word" in cmnd_buff
+	num_quals	= 0
+	num_args	= 0
+	cmnd_num 	= 0		! in case of comment line
+	cmnd_buff (buff_len:buff_len) = ' '	! always end with blank
+
+* full length of text
+	cmnd_len = TM_LENSTR (cmnd_buff)
+
+* ignore "yes?" at start of command
+ 2	IF (cmnd_buff(1:5) .EQ. 'yes? '
+     . .OR. cmnd_buff(1:5) .EQ. '...? ' ) THEN
+	   IF ( cmnd_len .LT. 6 ) THEN
+	     cmnd_buff = ' '
+	     cmnd_len = 0
+	   ELSE
+	     cmnd_buff = cmnd_buff(6:cmnd_len)
+	     cmnd_len = cmnd_len - 5
+	     GOTO 2		! in case there are multiple "yes?"'s
+	   ENDIF
+	ENDIF
+
+* comment line ?
+	IF ( (cmnd_len .LE. 0
+     .   .OR. cmnd_buff(1:1) .EQ. '*'
+     .   .OR. cmnd_buff(1:1) .EQ. '!' ) 
+     . .AND. .NOT.has_continuation_cmnd ) THEN
+	   RETURN
+	ENDIF
+	IF ( cmnd_buff(1:1) .EQ. '/'
+     .	.AND. .NOT.has_continuation_cmnd ) GOTO 5050
+
+* find length of command line ("!" is a valid terminator to permit comments)
+	bang_position = INDEX ( cmnd_buff, '!' )
+* ... 11/95 allow "!" to be be "escaped"
+	IF ( bang_position .GT. 1 ) THEN
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	   IF ( cmnd_buff(bang_position-1:bang_position) .EQ. '\!' ) THEN
+#else
+	   IF ( cmnd_buff(bang_position-1:bang_position) .EQ. '\\!' ) THEN
+#endif
+* ... ... this block of code could replace INDEX() but doesn't for performance
+	      DO 6 bang_position = bang_position+1, cmnd_len
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	         IF (cmnd_buff(bang_position:bang_position).EQ.'!'
+     .         .AND. cmnd_buff(bang_position-1:bang_position-1).NE.'\')
+     .				GOTO 8
+#else
+	         IF (cmnd_buff(bang_position:bang_position).EQ.'!'
+     .         .AND. cmnd_buff(bang_position-1:bang_position-1).NE.'\\')
+     .				GOTO 8
+#endif
+ 6	      CONTINUE
+	      bang_position = 0
+	   ENDIF
+	ENDIF
+ 8	IF ( bang_position .GT. 0 ) THEN
+	   DO 10 cmnd_len = bang_position-1, 1, -1
+	      IF (  cmnd_buff(cmnd_len:cmnd_len) .NE. ' '
+     .	      .AND. cmnd_buff(cmnd_len:cmnd_len) .NE. tab ) GOTO 15
+ 10	   CONTINUE
+	   IF (.NOT.has_continuation_cmnd) RETURN	! no text before !
+	ENDIF
+
+* prepend continuation from a previous line if any
+ 15	IF ( has_continuation_cmnd ) THEN
+	   len_cmnd_copy = len_cmnd_copy - 1  ! final char is continuation
+	   IF (len_cmnd_copy .GT. 0) THEN
+	     IF ( cmnd_len .GT. 0) THEN
+	        cmnd_buff = cmnd_copy(:len_cmnd_copy) // cmnd_buff(:cmnd_len)
+	     ELSE
+	        cmnd_buff = cmnd_copy(:len_cmnd_copy)
+	     ENDIF
+	   ENDIF
+	   cmnd_len = len_cmnd_copy + cmnd_len
+	   IF ( cmnd_len .GE. 2048 ) GOTO 5005 ! must match cmnd_buff_len
+	ENDIF
+
+* save a copy of the command with untranslated symbols for use by REPEAT
+* and for building the complete command when continuation lines are used.
+
+	cmnd_copy = cmnd_buff
+	len_cmnd_copy = cmnd_len
+
+* is this an incomplete line requiring continuation (terminated w/ backslash)?
+	has_continuation_cmnd =
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+     .				cmnd_buff(cmnd_len:cmnd_len) .EQ. '\' 
+#else
+     .				cmnd_buff(cmnd_len:cmnd_len) .EQ. '\\'
+#endif
+	IF ( has_continuation_cmnd
+     . .OR. cmnd_len .EQ. 0        ) THEN
+	   cmnd_num = 0
+	   RETURN
+	ENDIF
+
+* * * * * * * * *
+* remove parens enclosing entire command or command group
+* modified 10/95 to protect "($name) at line start
+ 20     IF (cmnd_len .GT. 1) THEN
+	   IF( cmnd_buff(1:1) .EQ. '(' 
+     .	 .AND. cmnd_buff(2:2) .NE. '$'
+     .   .AND. cmnd_buff(cmnd_len:cmnd_len) .EQ. ')' ) THEN
+              cmnd_buff(1:1) = ' '
+              cmnd_buff(cmnd_len:cmnd_len) = ' '
+              CALL LEFT_JUST( cmnd_buff(1:cmnd_len),
+     .                        cmnd_buff(1:cmnd_len), cmnd_len )
+           ENDIF
+        ENDIF
+
+* Again save a copy of the command with untranslated symbols for use by REPEAT
+* this time without enclosing parens.
+
+        IF (len_cmnd_copy .GT. 1) THEN
+	   IF( cmnd_copy(1:1) .EQ. '(' 
+     .	 .AND. cmnd_copy(2:2) .NE. '$'
+     .   .AND. cmnd_copy(len_cmnd_copy:len_cmnd_copy) .EQ. ')' ) THEN
+              cmnd_copy(1:1) = ' '
+              cmnd_copy(len_cmnd_copy:len_cmnd_copy) = ' '
+              CALL LEFT_JUST( cmnd_copy(1:len_cmnd_copy),
+     .                        cmnd_copy(1:len_cmnd_copy), len_cmnd_copy)
+           ENDIF
+        ENDIF
+
+
+* * * * * * * * *
+* process semicolon-separated command group  (2/93)
+* "REPEAT/L=lo:hi (command1;command2)"  is a single command (at this stage) but
+* "command1;command2" and "(command1;command2)" are command groups
+        IF ( INDEX(cmnd_buff(1:cmnd_len),';') .GT. 0 ) THEN
+* ... it is a command group if there is a ";" NOT enclosed in parens
+           nparen = 0
+           surround_quote = .FALSE.
+           DO 60 i = 1, cmnd_len
+	      c1 = cmnd_buff(i:i)
+              IF ( c1 .EQ. '(' ) THEN
+                 nparen = nparen + 1
+              ELSEIF ( c1 .EQ. ')' ) THEN
+                 nparen = nparen - 1
+              ELSEIF ( c1 .EQ. '"' ) THEN
+                 surround_quote = .NOT.surround_quote
+              ELSEIF ( c1 .EQ. ';' ) THEN
+	         escape = i.GT.1
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	         IF (escape) escape = cmnd_buff(i-1:i) .EQ. '\;'
+#else
+	         IF (escape) escape = cmnd_buff(i-1:i) .EQ. '\\;'
+#endif
+                 IF ( nparen.EQ.0
+     .		.AND. .NOT.escape
+     .		.AND. .NOT.surround_quote ) THEN
+                    cmnd_num = cmnd_semicolon
+                    GOTO 1000   ! successful exit
+                 ENDIF
+              ENDIF
+ 60        CONTINUE
+        ENDIF
+
+!* check for buffer overflow (too-long command line)
+! 90     IF ( cmnd_len .EQ. buff_len ) GOTO  5005
+!	cmnd_buff (buff_len:buff_len) = ' '	! always end with blank
+
+* * * * * * * * *
+* substitute GO command arguments, if any
+* and return to re-process command if substitution occurs (4/93)
+* Note: could have been done as a command stack operation ... maybe cleaner 
+	nsubst_passes = nsubst_passes + 1 ! guard against recursion (4/93)
+	IF ( nsubst_passes .GT. 100 ) GOTO 5060
+	IF ( cs_in_control ) THEN
+	   IF ( INDEX(cmnd_buff(:cmnd_len),'$') .GT. 0 ) THEN
+* ... search backwards for a GO command in charge of the command stack
+	      DO 92 csgo = csp, 1, -1
+	         IF ( cs_cmnd_num(csgo) .EQ. cmnd_go ) THEN
+	            CALL DOLLAR_COMMAND( cmnd_buff, cmnd_len,
+     .			  	         cs_text(csgo), subst, status )
+	            IF ( status .NE. ferr_ok ) GOTO 5000	
+		    IF ( subst ) THEN
+			reverify = .TRUE.      ! informational echo needed
+			GOTO 20   ! back for recursive substitutions
+		   ENDIF
+	         ENDIF
+ 92	      CONTINUE
+	   ENDIF
+	ENDIF
+
+* * * * * * * * *
+* substitute symbols (PLOT+ symbols expressed as "($symname)" ), if any (6/95)
+* and return to re-process command if substitution occurs
+        CALL SYMBOL_COMMAND( cmnd_buff, cmnd_len, subst, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( subst ) THEN
+	   reverify = .TRUE.      ! informational echo needed
+	   GOTO 20   ! back for more substitutions
+	ENDIF
+
+* * * * * * * * *
+* substitute command alias, if any
+* and return to re-process command if substitution occurs (4/93)
+* Note: could have been done as a command stack operation ... maybe cleaner 
+         CALL ALIAS_COMMAND( cmnd_buff, cmnd_len, *20 )
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
+* parser: break up command into "words" storing start and end locations
+* "words" are separated by blank, tab, "/" or " but not by comma or =
+* 10/95 - words are also not separated by ":"
+ 100	CONTINUE
+
+* skip blanks preceeding word
+	DO 110 ptr = ptr, cmnd_len
+		IF (      cmnd_buff(ptr:ptr) .NE. ' '
+     .		    .AND. cmnd_buff(ptr:ptr) .NE. tab ) GOTO 200
+ 110	CONTINUE
+	GOTO 500		! end of command buffer - no more words
+
+* we have another word in the buffer.  Is this word a qualifier ?
+
+ 200	IF ( word_num .EQ. max_words ) GOTO 500
+	word_num 	= word_num + 1
+	IF ( cmnd_buff(ptr:ptr) .EQ. '/' ) THEN
+	   itsa_qualifier(word_num) = .TRUE.
+	   ptr = ptr + 1		! jump over "/"
+*	skip blanks between "/" and text of word
+	   DO 210 ptr = ptr, cmnd_len
+		IF (      cmnd_buff(ptr:ptr) .EQ. '/' ) GOTO 5050
+		IF (      cmnd_buff(ptr:ptr) .NE. ' '
+     .		    .AND. cmnd_buff(ptr:ptr) .NE. tab ) GOTO 300
+ 210	   CONTINUE
+	   word_num = word_num - 1
+	   GOTO 500			! ignore "/" at end of buffer
+	ELSE
+	   itsa_qualifier(word_num) = .FALSE.
+	ENDIF
+
+* we have found the start of a word - initialize variables
+ 300    arg_start (word_num) = ptr
+        surround_quote = .FALSE.
+
+* start searching for the end of the word: blank,tab,"/" or ", if its a quote
+ 400	CONTINUE
+
+* Define a logical to stay away from cmnd_buff(ptr-1:ptr-1) when ptr = 1
+        ptrslash = .FALSE.
+	IF (ptr .GT. 1) THEN
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	   IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\' ) ptrslash = .TRUE.
+#else
+	   IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\\' ) ptrslash = .TRUE.
+#endif
+        ENDIF
+	   IF (ptrslash) THEN
+	      GOTO 410
+  
+	   ELSEIF ( cmnd_buff(ptr:ptr) .EQ. '"' 
+     .	   .OR.     cmnd_buff(ptr:ptr) .EQ. "'"  ) THEN
+* ... quotation marks - skip past entire quotated string
+	      doub_quote = cmnd_buff(ptr:ptr) .EQ. '"' 
+              surround_quote = doub_quote
+     .	                 .AND. ptr .EQ. arg_start(word_num)
+	      DO 401 ptr = ptr+1, cmnd_len
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	        IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\'  ) GOTO 401
+#else
+	        IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\\' ) GOTO 401
+#endif
+	        IF (cmnd_buff(ptr:ptr).EQ.'"' .AND. doub_quote
+     .	       .OR. cmnd_buff(ptr:ptr).EQ."'" .AND. .NOT.doub_quote) THEN
+                  quote_end = ptr
+                  GOTO 410
+                ENDIF
+ 401	      CONTINUE
+	      GOTO 5010
+	   ELSEIF ( cmnd_buff(ptr:ptr) .EQ. '`' ) THEN
+* ... grave accent - skip past entire immediate mode expression
+	      DO 402 ptr = ptr+1, cmnd_len
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\'  ) GOTO 402
+#else
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\\' ) GOTO 402
+#endif
+	         IF ( cmnd_buff(ptr:ptr) .EQ. '`' ) GOTO 410
+ 402	      CONTINUE
+	      GOTO 5010
+	   ELSEIF ( cmnd_buff(ptr:ptr) .EQ. '[' ) THEN
+* ... embedded bracket - find matching right bracket
+	      nest = 1
+	      DO 403 ptr = ptr+1, cmnd_len
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\'  ) GOTO 403
+#else
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\\' ) GOTO 403
+#endif
+	         IF ( cmnd_buff(ptr:ptr) .EQ. '[' ) THEN
+	            nest = nest + 1
+	         ELSEIF ( cmnd_buff(ptr:ptr) .EQ. ']' ) THEN
+	            nest = nest - 1
+	            IF ( nest .EQ. 0 ) GOTO 410
+	         ENDIF
+ 403	      CONTINUE
+	      GOTO 5010
+	   ELSEIF ( cmnd_buff(ptr:ptr) .EQ. '(' ) THEN
+* ... embedded paren - find matching right paren (10/95)
+	      nest = 1
+	      DO 404 ptr = ptr+1, cmnd_len
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\'  ) GOTO 404
+#else
+	         IF ( cmnd_buff(ptr-1:ptr-1) .EQ. '\\' ) GOTO 404
+#endif
+	         IF ( cmnd_buff(ptr:ptr) .EQ. '(' ) THEN
+	            nest = nest + 1
+	         ELSEIF ( cmnd_buff(ptr:ptr) .EQ. ')' ) THEN
+	            nest = nest - 1
+	            IF ( nest .EQ. 0 ) GOTO 410
+	         ENDIF
+ 404	      CONTINUE
+	      GOTO 5010
+	   ELSE
+		IF (	  cmnd_buff(ptr:ptr) .NE. ' '
+     .		    .AND. cmnd_buff(ptr:ptr) .NE. '/'
+     .		    .AND. cmnd_buff(ptr:ptr) .NE. tab ) THEN
+                   surround_quote = .FALSE.  ! text outside of quotation
+                   GOTO 410
+                ENDIF
+	   ENDIF
+
+* "/" can be escaped using "\/"
+	   IF (ptr .GT. 1) THEN
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	      IF (cmnd_buff(ptr-1:ptr) .EQ. '\/') GOTO 410
+#else
+	      IF (cmnd_buff(ptr-1:ptr) .EQ. '\\/') GOTO 410
+#endif
+	   ENDIF
+	
+* probable terminator found - make sure it's not hiding a comma or =
+* first check ahead that the next non-blank/tab is not comma or =
+* ... also check for ":"
+	   DO 405 look_ahead = ptr+1, cmnd_len
+	      IF (   cmnd_buff( look_ahead:look_ahead ) .EQ. ' '
+     .		.OR. cmnd_buff( look_ahead:look_ahead ) .EQ. tab ) GOTO 405
+	      IF (   cmnd_buff( look_ahead:look_ahead ) .EQ. ','
+     .		.OR. cmnd_buff( look_ahead:look_ahead ) .EQ. ':'
+     .		.OR. cmnd_buff( look_ahead:look_ahead ) .EQ. '=' ) THEN
+		   GOTO 410	! no. "," ":" or "=" connects a single "word"
+	      ELSE
+		   GOTO 406	! all clear ahead - no = or comma
+	      ENDIF
+ 405	   CONTINUE
+
+* now look back to make sure this isn'a a gap following an = or comma
+ 406	   CONTINUE
+           IF (ptr .GT. 1) THEN
+           DO 408 look_back = ptr-1, 1, -1
+	      IF (   cmnd_buff( look_back:look_back ) .EQ. ' '
+     .	      .OR. cmnd_buff( look_back:look_back ) .EQ. tab ) GOTO 408
+	      IF (   cmnd_buff( look_back:look_back ) .EQ. ','
+     .	      .OR. cmnd_buff( look_back:look_back ) .EQ. ':'
+     .	      .OR. cmnd_buff( look_back:look_back ) .EQ. '=' ) THEN
+		 GOTO 410	! no  - , or = connects a single "word"
+	      ELSE
+		 GOTO 420	! yes - we found a terminator
+	      ENDIF
+ 408	   CONTINUE
+           ENDIF
+		 GOTO 420	! yes - we found a terminator
+
+* manual DO-loop to permit embedded quotation marks
+ 410	IF ( ptr .LT. cmnd_len ) THEN
+	   ptr = ptr + 1
+	   GOTO 400
+	ENDIF
+
+* end of buffer has been reached with no word terminator - assume the word ends
+ 415	ptr = cmnd_len + 1
+
+* we have found the end of the word.  
+ 420    IF ( surround_quote ) THEN
+	   arg_start(word_num) = arg_start(word_num) + 1
+           arg_end  (word_num) = quote_end - 1
+cc           IF ( arg_start(word_num) .GT. arg_end(word_num) ) GOTO 5015
+cc  Allow it to be zero-length
+           IF ( arg_start(word_num) .GT. arg_end(word_num)+1 ) GOTO 5015
+	ELSE
+	   arg_end (word_num) = ptr - 1
+	ENDIF
+        IF ( ptr .LT. cmnd_len ) THEN
+           GOTO 100                              ! go back for next word
+        ELSE
+	   GOTO 500				 ! done parsing
+        ENDIF
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
+* identify the words in the command line	
+
+* +++++++ COMMAND +++++++
+* first word must be command name
+* legal syntax of command ?  (avoid, e.g., "LISTX=160W")
+
+ 500    CONTINUE
+        IF ( word_num .EQ. 0 ) RETURN
+        IF ( .NOT.TM_LEGAL_NAME(cmnd_buff(arg_start(1):arg_end(1))) )
+     .                                                        THEN
+           word_num = 1
+           GOTO 5025
+        ENDIF
+* search the list of options
+        len_test = TM_LENSTR(cmnd_buff(arg_start(1):arg_end(1)))
+	DO 510 cmnd_num = 1, total_num_commands
+           len_mchars = TM_LENSTR(commands(cmnd_num)(:4))
+	   IF ( MATCH4( cmnd_buff(arg_start(1):arg_end(1)),len_test,
+     .			commands(cmnd_num), len_mchars ) )  GOTO 600
+ 510	CONTINUE
+* no matches against known 4 character command names --> error
+	GOTO 5020					! error exit
+
+* +++++++ SUBCOMMAND +++++++
+* now identify the subcommand (if any) as next non-qualifier word
+ 600    DO 610 isub_word = 2,word_num
+	   IF ( .NOT.itsa_qualifier(isub_word) ) GOTO 620
+ 610	CONTINUE
+* no other words - therefore no subcommand was given
+	GOTO 650
+* look for a match in the list of subcommands for this command
+ 620	len_test = 
+     .     TM_LENSTR(cmnd_buff(arg_start(isub_word):arg_end(isub_word)))
+        DO 630 subcmnd_num = 2, num_subcommands(cmnd_num)
+	   isubcmnd_ptr = subcmnd_num + subcommand_pointer(cmnd_num) - 1
+           len_mchars = TM_LENSTR(subcommands( isubcmnd_ptr)(:4))
+	   IF ( MATCH4( cmnd_buff(arg_start(isub_word):arg_end(isub_word)),
+     .                  len_test,
+     .			subcommands( isubcmnd_ptr),  
+     .                  len_mchars)  ) THEN
+* ... legal syntax of subcommand ?  (avoid, e.g., "SET REGION at T")
+
+*     If we passed over part of the command inside the grave accents above,
+*     then pass over that part again here.  This allows
+*        LET rname = "/x=1:5"; SET REGION`rname` 
+
+              grave_start = INDEX(
+     .           cmnd_buff(arg_start(isub_word):arg_end(isub_word)),'`')
+              IF (grave_start .EQ. 0) grave_start = arg_end(isub_word)+1
+              IF ( .NOT.TM_LEGAL_NAME
+     .        (cmnd_buff(arg_start(isub_word):(grave_start-1))) )
+     .                                                        THEN
+                 word_num = isub_word
+                 GOTO 5025
+              ELSE
+                 GOTO 700
+              ENDIF
+           ENDIF
+ 630	CONTINUE
+* no matches against known 4 character subcommands --> no subcommand given
+ 650	isub_word	 = 0		! no subcommand word in cmnd_buff
+	subcmnd_num	 = 1		! use "    " as  subcommand
+	isubcmnd_ptr = subcommand_pointer(cmnd_num)
+
+* +++++++ QUALIFIERS +++++++
+* since "/" may be used for syntax purposes other that qualifiers determine the
+* last "/" that is intended as a qualifier
+ 700    DO 702 iword = MAX( isub_word+1, 2 ), word_num
+	   IF ( .NOT.itsa_qualifier(iword) )	  THEN
+	      last_qual = iword - 1
+	      GOTO 704
+	   ENDIF
+ 702	CONTINUE
+	last_qual = word_num
+
+* loop through qualifiers
+ 704	DO 740 iqual_word = 2, last_qual
+	   IF ( .NOT.itsa_qualifier(iqual_word) )	  GOTO 740
+	   IF ( num_qualifs(isubcmnd_ptr) .EQ. 0 )        GOTO 5030	! error
+	   IF ( num_quals .EQ. max_quals )		  GOTO 5040	! error
+
+* find qualifier terminator ( eg. /K=1:5  is terminated by "=" )
+	   DO 710 iterm = arg_start(iqual_word), arg_end(iqual_word)
+	      IF (   cmnd_buff(iterm:iterm) .EQ. ' '
+     .		.OR. cmnd_buff(iterm:iterm) .EQ. '	'
+     .		.OR. cmnd_buff(iterm:iterm) .EQ. '=' ) GOTO 720
+ 710	   CONTINUE
+	   iterm = arg_end(iqual_word) + 1	! no funny terminator
+
+* identify against list of qualifiers for this subcommand
+ 720	   len_test = TM_LENSTR(cmnd_buff(arg_start(iqual_word):iterm-1))
+           DO 730 iqual = 1,num_qualifs(isubcmnd_ptr)
+	   iqual_ptr = iqual + qualifier_pointer(isubcmnd_ptr) - 1
+           len_mchars = TM_LENSTR(qualifiers(iqual_ptr)(:4))
+	   known_qualifier = 
+     .		MATCH4( cmnd_buff(arg_start(iqual_word):iterm - 1 ),
+     .                  len_test,
+     .			qualifiers(iqual_ptr),len_mchars )
+* "@/anything" will be permitted to pass
+* (8/92 - this should be lifted outside of this loop for speed!!! *sh*)
+	   atsin_qualifier  = 
+     .		cmnd_buff(arg_start(iqual_word):arg_start(iqual_word)) .EQ. '@'
+	   IF ( known_qualifier .OR. atsin_qualifier ) THEN
+		num_quals = num_quals + 1
+		qual_start(num_quals) = arg_start(iqual_word)
+		qual_end  (num_quals) = arg_end  (iqual_word)
+		IF ( known_qualifier ) THEN
+		   qualifier_list(num_quals) = iqual
+		ELSE
+		   qualifier_list(num_quals) = 0
+		ENDIF
+		GOTO 740
+	   ENDIF
+ 730	   CONTINUE
+
+* checked all possible qualifiers and did't find a match
+	   GOTO 5030							! error
+
+ 740	CONTINUE
+
+* +++++++ ARGUMENTS +++++++
+* return buffer locations for all words not yet identified
+* (last_qual check as bug fix 2/94 *sh*)
+	DO 810 iarg = 2,word_num
+	   IF ( iarg .LE. last_qual
+     .      .AND. (itsa_qualifier(iarg) .OR. isub_word.EQ.iarg) ) THEN
+		GOTO 810     ! command, subcommand, or qualifier
+	   ELSE
+		num_args		= num_args + 1
+		arg_start( num_args )	= arg_start( iarg )
+		arg_end  ( num_args ) 	= arg_end  ( iarg )
+	   ENDIF
+ 810	CONTINUE
+
+* is the first argument enclosed in quotation marks?
+* the nature of arg_start,end allows safe (??) decrement/increment
+	IF (num_args .GE. 1) THEN
+	   arg1_quoted =
+     .	   (     cmnd_buff(arg_start(1)-1:arg_start(1)-1) .EQ. '"'
+     .     .AND. cmnd_buff(arg_end(1)  +1:arg_end(1)  +1) .EQ. '"' )
+     . .OR.(     cmnd_buff(arg_start(1)-1:arg_start(1)-1) .EQ. "'"
+     .     .AND. cmnd_buff(arg_end(1)  +1:arg_end(1)  +1) .EQ. "'" )
+	ENDIF
+
+* REPEAT loops postpone symbol substitutions in arguments -- all 1 arg for now
+	IF ( cmnd_num .EQ. cmnd_repeat ) THEN
+	   IF ( cmnd_buff(arg_end(num_args):arg_end(num_args)) .EQ. ')' 
+     .    .AND. cmnd_buff(arg_start(1):arg_start(1)) .EQ. '(' ) THEN
+*   ... search backwards for left paren
+	    first_paren = .TRUE.
+	    paren_level = 1
+	    DO 850 i = len_cmnd_copy-1, 1, -1
+	      IF (cmnd_copy(i:i) .EQ. ')') THEN
+	        paren_level = paren_level + 1
+	        first_paren = .FALSE.
+	      ELSEIF (cmnd_copy(i:i) .EQ. '(') THEN
+	        paren_level = paren_level - 1
+	        IF (first_paren) THEN
+*   ... dont confuse symbol at end "($sym)" with paren-enclosed command group 
+	          IF (cmnd_copy(i+1:i+1) .EQ. '$') GOTO 890
+	          first_paren = .FALSE.
+	        ENDIF
+	        IF ( paren_level .EQ. 0 ) THEN
+*   ... found the block of REPEAT argument - replace the text with original
+	          cmnd_buff(arg_start(1):) = cmnd_copy(i:len_cmnd_copy)
+	          cmnd_len = arg_start(1) + (len_cmnd_copy-i)
+	          num_args = 1
+	          arg_end(1) = cmnd_len
+	          GOTO 890
+	        ENDIF
+	      ENDIF
+ 850	    CONTINUE
+*   ... no matching left paren ever found (probably a syntax error ...)
+	  ENDIF
+	ENDIF
+ 890	CONTINUE
+
+
+* For SET DATA commands if there is an F-TDS expression, then encode that now.
+
+	IF  (cmnd_num .EQ. cmnd_set .AND. 
+     .       subcmnd_num .EQ. subcmnd_set_data+1 ) THEN
+	
+	   IF (num_args .GT. 0) url_buff = cmnd_buff( arg_start(1):arg_end(num_args) )
+	   len_test = TM_LENSTR(url_buff)
+           i = INDEX( url_buff(1:len_test), '_expr_{}' ) 
+	   IF (i .GT. 0) THEN
+	      num_args = 1
+              CALL CD_ENCODE_URL (url_buff)
+	      len_test = TM_LENSTR(url_buff)
+	      i = INDEX(cmnd_buff, "http://")
+	      cmnd_buff(i:i+len_test) = url_buff
+	      arg_end(1) = i+len_test - 1
+	   ENDIF
+	ENDIF
+
+* +++++++++ grave-accented immediate-mode expressions +++++++++++  3/95
+* evaluate and substitute the first grave accent-surrounded expression, if any
+* beginning at character grave_start
+* and return to re-process command if substitution occurs (4/93)
+* This part of the command parsing is postponed until the end so that
+* the command qualifiers (which may contain region information) will have
+* been identified and can be used while evaluating the grave expressions
+	nsubst_passes = nsubst_passes + 1 ! guard against recursion (4/93)
+	IF ( nsubst_passes .GT. 100 ) GOTO 5060
+* For REPEAT commands the grave accented expressions INSIDE the REPEAT loop
+* must be deferred until later
+	IF ( INDEX(cmnd_buff(:cmnd_len),'`') .GT. 0 ) THEN
+	   IF  ( cmnd_num .EQ. cmnd_repeat ) THEN
+	      grave_end = qual_end(num_quals)
+
+	   ELSEIF  ( cmnd_num .EQ. cmnd_if
+     .	     .OR.    cmnd_num .EQ. cmnd_elif ) THEN
+	      IF ( num_args .GE. 1 ) THEN
+	         grave_end = arg_end(1)
+	      ELSE
+	         grave_end = grave_start      ! invalid IF comand syntax
+	      ENDIF
+	   ELSE
+	      grave_end = cmnd_len
+	   ENDIF
+           apply_cx = its_action_command(cmnd_num)
+	   CALL REPL_EXPRNS( memory, cmnd_buff, cmnd_len,
+     .			     apply_cx, grave_start, grave_end,
+     .                       grave_digits, subst, status  )
+	   IF ( status .NE. ferr_ok ) GOTO 5000	
+	   IF ( subst ) THEN
+! ... num_uvars_in_cmnd flags expression results from previous cmnds as invalid
+	      num_uvars_in_cmnd = cmnd_uvars_not_given
+	      reverify = .TRUE.      ! informational echo needed
+	      GOTO 5   ! back to parse again with the expresns replaced
+	   ENDIF
+	ENDIF
+
+* replace backslashes that were escapes
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	IF ( INDEX(cmnd_buff(:cmnd_len),'\') .GT. 0 ) THEN
+	   in  = 1
+	   out = 1
+ 900	   IF (cmnd_buff(in:in+1) .EQ. '\!') THEN
+	      cmnd_buff(out:out) = '!'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\;') THEN
+	      cmnd_buff(out:out) = ';'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\`') THEN
+	      cmnd_buff(out:out) = '`'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\/') THEN
+	      cmnd_buff(out:out) = '/'
+	      in = in + 2
+#else
+	IF ( INDEX(cmnd_buff(:cmnd_len),'\\') .GT. 0 ) THEN
+	   in  = 1
+	   out = 1
+ 900	   IF (cmnd_buff(in:in+1) .EQ. '\\!') THEN
+	      cmnd_buff(out:out) = '!'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\\;') THEN
+	      cmnd_buff(out:out) = ';'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\\`') THEN
+	      cmnd_buff(out:out) = '`'
+	      in = in + 2
+	   ELSEIF (cmnd_buff(in:in+1) .EQ. '\\/') THEN
+	      cmnd_buff(out:out) = '/'
+	      in = in + 2
+#endif	
+	   ELSE
+	      cmnd_buff(out:out) = cmnd_buff(in:in)
+	      in = in + 1
+	   ENDIF
+	   out = out + 1
+	   IF (in.LT.cmnd_len) GOTO 900	
+	   cmnd_buff(out:out) = cmnd_buff(in:in)
+	   cmnd_len = out
+* ... cover over characters exposed at line end
+	   DO 910 out = out+1,in+1
+ 910	   cmnd_buff(out:out) = ' '
+	ENDIF
+
+* successful completion
+ 1000   status = ferr_ok
+	RETURN
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* error exits
+ 5000	RETURN
+
+! 5005   risc_buff = cmnd_buff(cmnd_len-19:cmnd_len)
+! 	CALL ERRMSG( ferr_line_too_long, status,
+!     .		     risc_buff(:20), *5000 )
+
+ 5005	CALL ERRMSG( ferr_syntax, status,
+     .			'command line too long -- exceeds 2048', *5000 )
+! 2048 must match cmnd_buff_len
+
+ 5010	CALL ERRMSG( ferr_syntax, status,
+     .			'unpaired quotation marks, grave accent or brackets',
+     .			*5000 )
+
+ 5015	CALL ERRMSG( ferr_syntax, status,
+     .				'zero length quotation forbidden', *5000 )
+
+ 5020	CALL ERRMSG( ferr_unknown_command, status,
+     .		cmnd_buff( arg_start(1):arg_end(1) ), *5000 )
+
+ 5025	CALL ERRMSG( ferr_syntax, status,
+     .		cmnd_buff( arg_start(word_num):arg_end(word_num) ), *5000 )
+
+ 5030	CALL ERRMSG( ferr_unknown_qualifier, status,
+     .		cmnd_buff( arg_start(iqual_word):arg_end(iqual_word) ), *5000 )
+
+ 5040	CALL ERRMSG
+     .		( ferr_cmnd_too_complex, status, 'too many qualifiers', *5000 )
+
+ 5050	CALL ERRMSG( ferr_syntax, status, '"/"', *5000 )
+
+ 5060	CALL ERRMSG( ferr_syntax, status,
+     .		'Recursive aliases or GO argument definitions', *5000 )
+	END
+
diff --git a/fer/gnl/pop_cs.F b/fer/gnl/pop_cs.F
new file mode 100644
index 0000000..dd183e9
--- /dev/null
+++ b/fer/gnl/pop_cs.F
@@ -0,0 +1,195 @@
+	SUBROUTINE POP_CS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* POP the contral stack turning control over to the next lower level, if any
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 4/29/87
+* V230: restore original context following REPEAT command
+* V300 - 2/2/93 - added semicolon-separated command groups
+* V420 - added IF (single risc_buff version controls input source)
+*      - generate warning if multi-risc_buff IF is unclosed
+* V500 4/99 *sh* - remove the informative message about an unclosed IF
+*    This is not an error in IF cond THEN stmt; QUIT ENDIF 
+* V530:  8/00 *sh* - when restoring the original context after a REPEAT it
+*	is necessary to set the unsaved region (as per cx_by_ss) to unspecified
+*	(The need to do this represents a bug somewhere up the risc_buff -- region
+*		information is used without regard to cx_by_ss)
+*	see err522_repeat_leftover.jnl
+* V554 1/04 *acm* - add cs_repeatname for named /RANGE loop control; reset repeat controls.
+* v560 3/04 *acm    reset last_cmnd_buff  when resetting repeat controls.
+*      6/04 ywei    change MATCH_NAME function
+* v5.80 *acm* 11/04 use cx_cal_id to store the calender used when
+*                   computing world coordinates; restore cx_cal_id
+*                   along with  the rest of the context after a REPEAT
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687  3/14 *acm* for ticket 2044, write note ! Exit from <script>
+* V687  3/14 *acm* for ticket 2044, write note ! Exit_GO only if SET REDIRECT is turned on.
+
+* internal variable declarations:
+	INTEGER	LIB_FREE_LUN,TM_LENSTR1,stat,axis,ivar,cvar,csp_to,ll,
+     .          slen, plen
+        INTEGER j, num_indices
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xcontrol.cmn'
+        include 'xcontext.cmn'
+        include 'xalgebra.cmn'
+        include 'xvariables.cmn'
+	include	'xrisc.cmn'
+
+
+* internal error ?
+	IF ( csp .LT. 1 ) STOP 'csp_undflw'
+
+* popping out of a stack level with an unclosed IF statement is a form of error
+* we will issue a warning and then implicitly close the IF
+	IF (if_conditional) THEN
+	   IF (csp .LE. if_cs(ifstk) ) THEN
+! no! 4/99	      CALL WARN('Unclosed IF statement ... assuming ENDIF')
+	      ifstk = ifstk - 1
+	      IF (ifstk .EQ. 0 ) if_conditional = .FALSE.
+	   ENDIF
+	ENDIF
+
+* clean up old level
+	IF ( cs_cmnd_num( csp ) .EQ. cmnd_go ) THEN
+
+* ... Write note with script name, only if SET REDIRECT is turned on.
+	   IF (redirect_stdout_flags .NE. redirect_none) THEN
+              risc_buff = '! Exit_GO '
+              CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, ll)
+	   ENDIF
+
+* ... close input GO file
+	   CLOSE( UNIT = cmnd_lun, ERR = 10 )
+ 10	   stat = LIB_FREE_LUN( cmnd_lun )
+
+	ELSEIF ( cs_cmnd_num( csp ) .EQ. cmnd_repeat ) THEN
+* ... restore context prior to REPEAT loop (along repeat axis only)
+           axis = cs_axis( csp )
+           cx_by_ss(axis,cx_last) = cs_save_by_ss( csp )
+
+           IF (axis .eq. t_dim) THEN
+              cx_calendar(cx_last) = .FALSE.
+              cx_cal_id(cx_last) = unspecified_int4
+           ENDIF
+
+           IF ( cs_save_by_ss( csp ) ) THEN
+              cx_lo_ss (cx_last,axis) = cs_save_lo( csp )
+              cx_hi_ss (cx_last,axis) = cs_save_hi( csp )
+              cx_lo_ww (axis,cx_last) = unspecified_val8
+              cx_hi_ww (axis,cx_last) = unspecified_val8
+           ELSE
+              cx_lo_ww (axis,cx_last) = cs_save_lo( csp )
+              cx_hi_ww (axis,cx_last) = cs_save_hi( csp )
+              cx_lo_ss (cx_last,axis) = unspecified_int4
+              cx_hi_ss (cx_last,axis) = unspecified_int4
+              cx_cal_id (cx_last) = cs_save_cal(csp) 
+           ENDIF
+
+* clean up counter variable 
+
+           cvar = 0
+*           len_test = TM_LENSTR(cs_repeatname(csp))
+*	   DO 20 ivar =  num_counter_vars, 1, -1
+*              len_mchars = TM_LENSTR(countervar_name(ivar))
+*	      IF ( MATCH_NAME( cs_repeatname(csp), len_test,
+*     .           countervar_name(ivar), len_mchars ) ) THEN
+*                cvar = ivar
+*                GOTO 1000
+*              ENDIF
+*  20	   CONTINUE
+*1000       CONTINUE
+ 	CALL string_array_find(countervar_name_head,
+     .                         cs_repeatname(csp),
+     .                         LEN(cs_repeatname(csp)),
+     .                         string_array_result(1),
+     .                         max_uvar,
+     .                         num_indices)
+        IF(num_indices.GT.0) THEN
+              cvar = string_array_result(1)
+        ENDIF
+
+           IF (cvar .GT. 0) THEN
+*              countervar_name(cvar) = unspecified_name4
+              CALL string_array_modify(countervar_name_head,
+     .                                 cvar,
+     .                                 unspecified_name4,
+     .                                 LEN(unspecified_name4))
+
+              alg_cvar( cvar ) = unspecified_name4
+              cs_repeatname( csp ) = unspecified_name4
+              csp_cvar( csp ) = unspecified_int4
+              last_cmnd_buff = ' '
+           ENDIF
+
+	ENDIF
+	csp = csp - 1
+
+* now who gets control ?
+	IF ( csp .EQ. 0 ) THEN
+* ... the operator
+	   cs_in_control = .FALSE.
+	   input_source  = input_from_tty
+	ELSE
+* ... the next stack level down
+	   IF    ( cs_cmnd_num( csp ) .EQ. cmnd_go     ) THEN
+	      input_source = input_from_file
+	      cmnd_lun = cs_lun( csp )
+	   ELSEIF ( cs_cmnd_num( csp ) .EQ. cmnd_semicolon
+     .         .OR. cs_cmnd_num( csp ) .EQ. cmnd_if
+     .         .OR. cs_cmnd_num( csp ) .EQ. cmnd_repeat ) THEN
+	      input_source = input_from_cs
+	   ELSE
+	      STOP 'cs_stk_??'
+	   ENDIF
+	ENDIF
+		   
+	RETURN
+	END
+
+
+
+
diff --git a/fer/gnl/process_if.F b/fer/gnl/process_if.F
new file mode 100644
index 0000000..09e45e5
--- /dev/null
+++ b/fer/gnl/process_if.F
@@ -0,0 +1,212 @@
+	SUBROUTINE PROCESS_IF( cmnd_string, slen, * )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is called when the process of obtaining Ferret commands is
+* under the control of a multi-line IF clause
+* This routine inspects the currently available command and decides whether
+* to execute it or to skip it. It also updates the IF-stack as needed.
+
+* Note that error checking need not be done in this routine because the
+* "logical control" tokens "IF", "ELSE", "ELIF", and "ENDIF" are themselves
+* commands which will check for errors and set appropriate states
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:  4/28/96
+*     : bug fix 5/96: ENDIF processed wrong for nested IF
+* V530: 1/01 *sh* - skip white space at start of line
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead
+* 10/05 *acm*  Fix bug 918, parsing immediate mode expr when they are inside
+*              a conditional, using the IF STACK.
+* 12/05 *acm*  Fix bug 1368. if skipping commands, also skip one-line if-then-condition
+* V6.01 10/06 *acm*  Fix bug 1446 in the loop DO 200 when testing for a tab character, the
+*              index should be i not ic1. The perils of cut-and-pasting text from elsewhere!
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER		slen
+	CHARACTER	cmnd_string*(*)
+* RETURN 1 - used when the current command should be **skipped**
+
+* internal variable declarations:
+	INTEGER	STR_CASE_BLIND_COMPARE, ic1,
+     .		status	! not returned
+        INTEGER STR_UPCASE, i, end_then, cmnd_len
+	LOGICAL its_endif, its_else, its_elif, its_if, one_liner
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'command.parm'
+	include 'gfdl_vms.parm'
+	include 'xprog_state.cmn'
+        include 'xrisc.cmn'
+
+* internal parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* sanity check
+	IF ( ifstk.LT.1 .OR. ifstk.GT.max_ifstk ) GOTO 5000
+
+        i = STR_UPCASE (risc_buff, cmnd_buff)
+* skip initial white space
+	DO ic1 = 1, slen
+	   IF (cmnd_string(ic1:ic1).NE. ' '
+     .   .AND. cmnd_string(ic1:ic1).NE. tab) GOTO 100
+	END DO
+! should never arrive here ...
+	ic1 = 1
+
+* check for IF or ENDIF
+ 100	its_endif =
+     .	      STR_CASE_BLIND_COMPARE(cmnd_string(ic1:ic1+3),'ENDI')
+     .		 .EQ. vms_str_success
+	its_if   =
+     .	     (STR_CASE_BLIND_COMPARE(cmnd_string(ic1:ic1+2),'IF ')
+     .		 .EQ. vms_str_success)
+     .  .OR. (STR_CASE_BLIND_COMPARE(cmnd_string(ic1:ic1+2),'IF'//tab)
+     .		 .EQ. vms_str_success)
+
+* Fix bug 918: do NOT always execute IF and ENDIF statements!
+cc	IF (its_if .OR. its_endif) RETURN
+
+        IF ((its_if .OR. its_endif) .AND. 
+     .      if_doing(ifstk) .EQ. pif_doing_clause) RETURN
+
+	IF (if_conditional .AND. its_if ) THEN     ! nested IF?
+	   IF (if_doing(ifstk).NE.pif_doing_clause) THEN	! skipped IF?
+
+* --- here is cause of bug 1368: if the current statement is a one-line IF statement, 
+* --- and we are skipping commands, we want to just skip this one too.
+* --- Check whether the current command is a one-line IF condition THEN command
+* --- and if so skip it, otherwise bump the IF stack.
+
+
+            one_liner = .FALSE.
+            IF (its_if) THEN
+               end_then = INDEX(risc_buff(:slen), 'THEN') + 4
+               cmnd_len = INDEX(risc_buff(:slen), '!') - 1  ! check for comment at end
+               IF (cmnd_len .EQ. -1) cmnd_len = slen
+
+* See if there is a command after the THEN
+               DO 200 i = end_then,cmnd_len
+                   IF (cmnd_string(i:i).NE. ' '
+     .           .AND. cmnd_string(i:i).NE. tab) one_liner = .TRUE.
+  200          CONTINUE
+
+            ENDIF  
+
+	    IF ( num_args .LE. 2 .AND. .NOT. one_liner) THEN   ! multi-line nested IF?
+* ...       bump the IF stack - set up to skip this entire IF clause
+	         IF ( ifstk .GE. max_ifstk ) GOTO 5400
+	         ifstk = ifstk + 1
+cc	         if_doing(ifstk) = if_doing(ifstk-1)
+	         if_doing(ifstk) = pif_skip_to_endif
+	         if_cs(ifstk) = if_cs(ifstk-1)
+                 RETURN 1
+	      ENDIF
+	   ENDIF
+	ENDIF
+        
+* Skipped if inside a repeat?  will have a ; or a ) after it.
+* One more fix: if the ; or ) follows a ! then ignore.
+
+	IF (if_conditional .AND. its_endif ) THEN     ! nested IF?
+	   IF (if_doing(ifstk).NE.pif_doing_clause) THEN	! skipped IF?
+
+           IF (INDEX(risc_buff, ')') .GT. INDEX(risc_buff,'ENDIF'))THEN
+	      IF (INDEX(risc_buff, '!') .GT. 0) THEN
+                IF (INDEX(risc_buff, ')') .LT. INDEX(risc_buff,'!'))
+     .            its_endif = .FALSE.
+              ELSE
+                 its_endif = .FALSE.
+              ENDIF
+	   ENDIF
+
+           IF (INDEX(risc_buff, ';') .GT. INDEX(risc_buff,'ENDIF'))THEN
+	      IF (INDEX(risc_buff, '!') .GT. 0) THEN
+                IF (INDEX(risc_buff, ';') .LT. INDEX(risc_buff,'!'))
+     .            its_endif = .FALSE.
+              ELSE
+                 its_endif = .FALSE.
+              ENDIF
+	   ENDIF
+        ENDIF
+
+        ENDIF
+
+	IF (its_endif) RETURN  ! process the endif, always
+
+* now check each of the possible IF execution states
+	IF ( if_doing(ifstk) .EQ. pif_skip_to_endif ) THEN
+* skip everything until ENDIF is encountered
+	   RETURN 1
+
+	ELSEIF ( if_doing(ifstk) .EQ. pif_doing_clause ) THEN
+* execute everything cuz we're "doing" the clause
+	   RETURN
+
+	ELSEIF ( if_doing(ifstk) .EQ. pif_skip_to_clause ) THEN
+* check for ELSE or ELIF
+	   its_else  =
+     .	      STR_CASE_BLIND_COMPARE(cmnd_string(ic1:ic1+3),'ELSE')
+     .	 	    .EQ. vms_str_success
+	   its_elif  =
+     .	      STR_CASE_BLIND_COMPARE(cmnd_string(ic1:ic1+3),'ELIF')
+     .		    .EQ. vms_str_success
+	   IF (its_else .OR. its_elif) RETURN
+* nope - just an ordinary command ... keep skipping 
+	   RETURN 1
+
+	ELSE
+* unknown if condition
+	   GOTO 5000
+
+	ENDIF
+ 1000	RETURN
+
+
+ 5000	CALL ERRMSG(ferr_internal, status, 'ifstk!!', *1000)
+
+ 5400	CALL ERRMSG( ferr_invalid_command, status, 'IFs nested too deep',
+     .							*5000 )
+     
+        END
diff --git a/fer/gnl/proclaim.F b/fer/gnl/proclaim.F
new file mode 100644
index 0000000..8e74f0b
--- /dev/null
+++ b/fer/gnl/proclaim.F
@@ -0,0 +1,97 @@
+	SUBROUTINE PROCLAIM ( logical_unit, left_margin, quiet )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* introduce the program
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+* V400 - 3/95 - changed "Revision" to "Version"
+* V402 - 8/95 - use XREVISION_TYPE to automate version info
+* V510 6/00 *sh* - if revision_type is "()" ignore it
+* v540 10/01 *kob* - add platform type to proclaim message and rearrange
+*                   proclaim message
+*      10/01 *kob* - insert missing comma in format statement
+*                    discovered by linux compiler
+*       8/05 *acm* - Allow more digits in xrevision number
+* V63  *acm* 10/09 Changes for gfortran build
+* PyFr *kms* 10/12 Add quiet flag
+
+	include 'xrevision.cmn'
+	include 'xrevision_type.cmn'
+	include 'xtoday.cmn'
+	include 'xmake_date.cmn'
+	include 'xplatform_type.cmn'
+
+* calling argument declarations:
+	INTEGER		logical_unit
+	CHARACTER*(*)	left_margin
+        LOGICAL         quiet
+
+* local variable definitions
+	INTEGER TM_LENSTR1, len_platform_type, slen
+        CHARACTER*12 TM_FMT, show_str
+
+* get revision type info (8/95 - kind of a hack)
+	IF ( revision_type .EQ. '()' ) THEN
+	   progname_mod = ' '
+	ELSE
+	   progname_mod = revision_type
+	ENDIF
+	len_progname_mod = TM_LENSTR1(progname_mod)
+	len_platform_type = TM_LENSTR1(platform_type)
+        show_str = TM_FMT(revision_level, 5, 12, slen)
+
+        IF ( .NOT. quiet )
+     .     WRITE  ( logical_unit, 3000)
+     .				left_margin,
+     .				left_margin, program_name(1:len_program_name),
+     .                                       show_str(1:slen),
+     .					     progname_mod(1:len_progname_mod), 
+     .				left_margin, platform_type(1:len_platform_type),
+     .                                       make_date,
+     .				left_margin, today_date, today_time
+
+ 3000	FORMAT ( 1X,A,'NOAA/PMEL TMAP',/
+     .           1X,A,A,1X,'v',A,1x,A,/
+     .           1X,A,A,1X,'-',1X,A,/
+     .           1X,2A,1X,A/ )
+
+	RETURN
+	END
diff --git a/fer/gnl/proclaim_c.F b/fer/gnl/proclaim_c.F
new file mode 100644
index 0000000..ef679ee
--- /dev/null
+++ b/fer/gnl/proclaim_c.F
@@ -0,0 +1,74 @@
+	SUBROUTINE PROCLAIM_C( lun, leader, quiet_flag ) 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* pass arguments from C language to the "PROCLAIM" routine
+* make a movie frame of the current output graphics
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 8/94
+
+
+* calling argument declarations
+	INTEGER lun, quiet_flag
+	INTEGER	slen
+        PARAMETER  ( slen = 32 )
+#ifdef sun
+        BYTE      leader(slen) ! c-type Hollerith string buffer
+#else
+        INTEGER*1 leader(slen) ! c-type Hollerith string buffer
+#endif
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, flen
+	CHARACTER*32 fstrng
+        LOGICAL quiet
+
+	CALL TM_CTOF_STRNG( leader, fstrng, slen )
+	flen = TM_LENSTR1(fstrng)
+        IF ( quiet_flag .EQ. 0 ) THEN
+           quiet = .FALSE.
+        ELSE
+           quiet = .TRUE.
+        ENDIF
+
+	CALL PROCLAIM( lun, fstrng(:flen), quiet )
+	RETURN
+	
+	END
+
diff --git a/fer/gnl/redefine_ax_att.F b/fer/gnl/redefine_ax_att.F
new file mode 100644
index 0000000..cc1eb9d
--- /dev/null
+++ b/fer/gnl/redefine_ax_att.F
@@ -0,0 +1,321 @@
+      SUBROUTINE REDEFINE_AX_ATT (name, new_units, new_t0,  
+     .       new_cal_name, new_modulo, new_modulo_len, 
+     .       direction, regular_flag )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*  Change attributes for a redefined axis
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* 11/2006 
+* V602  3/07 *acm* Also look for the axis in dataset -2, the pseudo-dataset 
+*                  containing information on user-defined axes
+* V602  3/07 *acm* Treat t0 as units; if new t0 is not defined, remove the attribute.
+* v604 *acm* 7/07 increase length of ds_name
+* v616 *acm* 1/09 Fix ticket 1614: Needed to set the attname to modulo for the block,
+*                 if new_modulo is false then remove attribute from axis
+* V64  *acm*11/09 The ENDIF for name-is-an-axis-of-dset was in the wrong place:
+*                 check for changes in all the attribs.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+        include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+        include 'xdset_parms.cmn'
+        include 'netcdf.inc'
+
+* calling argument declarations:
+
+      CHARACTER*(*) name, direction, new_units, new_t0, 
+     .              new_cal_name
+      REAL*8 new_modulo_len
+      LOGICAL regular_flag, new_modulo
+
+* local variable declarations: 
+      
+      INTEGER TM_LENSTR1, STR_SAME, 
+     .        dset, varid, attlen, attype, attoutflag, 
+     .        vartype, nvdims, nvatts, vdims(8), all_outflag,
+     .        attid, len, maxlen, status
+      REAL dummy
+      CHARACTER buff*128, varname*128, attbuff*10, attname*128, dir*4
+      LOGICAL	coordvar, do_warn, got_it
+
+      dummy = 0.
+      do_warn = .FALSE.
+      maxlen = 128
+
+c... loop over datasets
+c    Dataset -2 is the pseudo-dataset containing user-defined axes.
+c    see if name exists as an axis name.
+
+      DO 100 dset = -2, maxdsets
+         IF (dset .EQ. -1) GOTO 100
+         IF (dset .EQ.  0) GOTO 100
+
+         IF (dset .GT. 0) THEN
+            IF ( ds_name(dset) .EQ. char_init1024) GOTO 100
+         ENDIF
+
+         CALL CD_GET_VAR_ID (dset, name, varid, status)
+
+         IF (status .EQ. ferr_ok) THEN  ! name is an axis name in the dataset
+
+! name is a variable; is it a coordinate variable of the dataset?
+
+            CALL CD_GET_VAR_INFO (dset, varid, name, vartype, 
+     .          nvdims, vdims, nvatts, coordvar, all_outflag, status) 
+            IF (.NOT. coordvar) goto 100
+
+c ... If units attribute already exists, change it; otherwise add new
+c     If new units not defined, remove units attribute.
+
+         attname = 'units'
+         IF (new_units .NE. " ") THEN
+            len = TM_LENSTR1(new_units)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               attoutflag = 1
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .         attoutflag, new_units, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, NCCHAR, len, new_units, dummy, status)
+            ENDIF
+
+        ELSE
+           
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+            IF (status .EQ. ferr_ok) CALL CD_DELETE_ATTRIBUTE (dset, varid, 
+     .          attname, status)
+
+        ENDIF
+
+c ... If t0 attribute already exists, change it; otherwise add new
+c     If new t0 not defined, remove the time_origin attribute.
+
+         attname = 'time_origin'
+         IF (new_t0 .NE. " ") THEN
+
+            len = TM_LENSTR1(new_t0)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               attoutflag = 1
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .           attoutflag, new_t0, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, new_t0, dummy, status)
+            ENDIF
+
+        ELSE
+           
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+            IF (status .EQ. ferr_ok) CALL CD_DELETE_ATTRIBUTE (dset, varid, 
+     .          attname, status)
+
+        ENDIF
+
+c ... direction; Change positive=up or down on Z axes; replace cartesian_axis 
+c     or axis attribute only if already an attribute
+
+         attname = 'positive'
+
+         CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+         IF (status .EQ. ferr_ok) THEN
+            CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname,
+     .        attype, attlen, attoutflag, status)
+
+            IF (direction .EQ. 'DU') THEN
+               dir = 'up'
+               len = 2
+            ELSE
+               dir = 'down'
+               len = 4
+            ENDIF
+            CALL CD_REPLACE_ATTR (dset, varid, attname, attype, 
+     .        len, dir, dummy, status)
+         ENDIF
+
+         attname = 'cartesian_axis'
+         len = 1
+
+         dir = ' '
+         IF (direction(1:1) .EQ. 'T') dir = 'T' 
+         IF (direction .EQ. 'WE' .OR. 
+     .    direction(1:1) .EQ. 'X') dir = 'X'
+         IF (direction .EQ. 'SN' .OR. 
+     .    direction(1:1) .EQ. 'Y') dir = 'Y'
+         IF (direction .EQ. 'UD' .OR. 
+     .    direction .EQ. 'DU' .OR.  
+     .    direction(1:1) .EQ. 'Z') dir = 'Z'
+         
+         IF (dir .NE. ' ') THEN
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname,
+     .            attype, attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .            attname, attype, len, dir, dummy, status)
+            ENDIF
+
+            attname = 'axis'
+
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, dir, dummy, status)
+            ENDIF
+         ENDIF
+
+c ... If calendar attribute already existed, change it; otherwise add new
+c     If new calendar not defined, remove calendar attribute.
+
+         attname = 'calendar'
+         IF (new_cal_name .NE. " ") THEN
+            attoutflag = 1
+            IF ( (STR_SAME(new_cal_name(1:3), 'GRE') .EQ. 0) .OR.
+     .           (STR_SAME(new_cal_name(1:3), 'STA') .EQ. 0) ) attoutflag = 0
+
+            len = TM_LENSTR1(new_cal_name)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .           attoutflag, new_cal_name, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, new_cal_name, dummy, status)
+            ENDIF
+
+        ELSE
+           
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+            IF (status .EQ. ferr_ok) CALL CD_DELETE_ATTRIBUTE (dset, varid, 
+     .          attname, status)
+
+         ENDIF
+
+c ... point_spacing; change only if it was already an attribute
+
+         attname = 'point_spacing'
+         attbuff = 'uneven'
+         IF (regular_flag) attbuff = 'even'
+         len = TM_LENSTR1(attbuff)
+
+         CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+         IF (status .EQ. ferr_ok) THEN
+            CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .        attlen, attoutflag, status)
+            CALL CD_REPLACE_ATTR (dset, varid, 
+     .        attname, attype, len, attbuff, dummy, status)
+         ENDIF
+
+c ... modulo; either write modulo = ' ' for modulo=true,
+c     or write modulo length.
+
+         IF (new_modulo) THEN
+            attname = 'modulo'
+
+            IF (new_modulo .OR. (new_modulo_len .GT. 0.D0)) THEN
+               attbuff = ' '
+               len = 1
+               CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+               IF (new_modulo_len .GT. 0) THEN  ! write the value of new_modulo_len
+                  IF (status .NE. ferr_ok) THEN
+                     attoutflag = 1
+                     CALL CD_PUT_NEW_ATTR_DP (dset, varid, attname, NCDOUBLE, len,
+     .               attoutflag, attbuff, new_modulo_len, status)
+                  ELSE
+                     CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .               attlen, attoutflag, status)
+                     CALL CD_REPLACE_ATTR_DP (dset, varid, 
+     .               attname, attype, len, attbuff, new_modulo_len, status)
+                  ENDIF
+
+               ELSE  ! write string attribute modulo=' '
+                  IF (status .NE. ferr_ok) THEN
+                     attoutflag = 1
+                     CALL CD_PUT_NEW_ATTR_DP (dset, varid, attname, NCCHAR, len,
+     .               attoutflag, attbuff, new_modulo_len, status)
+                  ELSE
+                     CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .               attlen, attoutflag, status)
+                     CALL CD_REPLACE_ATTR (dset, varid, 
+     .               attname, NCCHAR, len, attbuff, dummy, status)
+                  ENDIF
+               ENDIF
+
+            ENDIF
+         ELSE  ! if new_modulo is false then remove attribute from axis
+            
+	    attname = "modulo"
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_DELETE_ATTRIBUTE (dset, varid, attname, status)
+            ENDIF
+         ENDIF
+
+        ENDIF  ! name is an axis name in the dataset
+
+  100 CONTINUE   
+      
+      status = ferr_ok
+
+      RETURN
+      END
diff --git a/fer/gnl/repl_exprns.F b/fer/gnl/repl_exprns.F
new file mode 100644
index 0000000..8896bdc
--- /dev/null
+++ b/fer/gnl/repl_exprns.F
@@ -0,0 +1,848 @@
+	SUBROUTINE REPL_EXPRNS( memory, cmnd, lencmnd, cmnd_num,
+     .				istart, max_check,
+     .				digits, did_sub, status  )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* parse the command line replacing the first expression that is enclosed
+* between grave accents with text strings representing their values
+* this routine will be called once for each such expression so that the
+* entire command line can be re-parsed between calls.  This makes it possible
+* to build the command qualifier information from fixed limits and grave
+* accented expressions working from left to right
+
+* USAGE EXAMPLE:
+*	CONTOUR/Z=`TEMP[Z=0:1000 at LOC:15]` SALINITY*`some_factor`
+
+* NOTE (3/00) THE POTENTIAL FOR WRONG RESULTS WITH OPERATIONS SUCH AS MATRIX
+* TRANSPOSE - ALL "IMPOSED" AXES PRESENT THE RISK OF WRONG RESULTS.
+* THIS COULD BE FIXED BY FORCING FULL EVALUATION OF EVERY EXPRESSION THAT
+* CONTAINS A GC FUNCTION WITH AN IMPOSED AXIS. (For now we leave this
+* bug in favor of the performance increase ... important in automated scripts
+* that want to test the size of a result before computing it.
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V400 3/95
+* V411: 9/8/95 - serious bug fixed:  use CREATE_TEMP_MEM_VAR and COPY_GRID
+*		so that the result scalar is picked correctly from within
+*		the body of a larger mvar (instead of assuming that it is
+*		always element (1,1,1,1) of the mvar)
+* V420: 11/95 - allow grave accents to be "escaped" by '\'
+* 	 1/96 - bug fix: special check if grave accents enclose white space
+*	 2/96 - allow digits control with `expr,PREC=n`
+*		and control of "bad string" with "BAD=xx.xx"
+*	 3/96 - added RETURN=shape, isize,istart,iend, etc. for j,k, and l
+* Linux Port - 5/97 *kob*
+*	     - added ifdef check for double slash because f90/linux didn't
+*	       need two of them together for escapes
+* V510: 9/99 *sh* - added RETURN=XSTART (X-Y-Z-T, START-END-UNITS))
+*	3/00 *sh* - RETURN= options computed without evaluating the expression
+*		  - added RETURN=SIZE
+* V522: 6/00 *sh* - added RETURN = XAXIS, YAXIS, ZAXIS, TAXIS
+* V530: *sh* 9/00 - added support for string variables
+*       *sh* 2/01 - added FORMAT = I4.4, etc. (NOT IMPLEMENTED)
+*	          - added WIDTH=width and ZWIDTH=width
+*	*sh* 3/01 - added RETURN=dset, dsetnum, dsetpath
+* V531: *sh* 4/01 - added RETURN=bad
+* V532: *sh* 5/01 - mod to EVAL_CONTEXT forced change here  
+* *kob* 2/03 - replace call to intrinsic func CHAR with its octal
+*              constant equivalent - needed for g77 port
+*            - Need to use risc_buff for arbitrary concatenations
+* v552: *acm* 4/03 - Issue a complete error message for wrong arguments
+*                    to RETURN=
+* v552: *acm* 4/03 - Add RETURN=dsettitle
+*       *acm* 4/03 - Add RETURN=nc_scale, nc_off[set], user_scale, user_off[set]
+* V570  *acm* 6/04 - Add RETURN=CALENDAR
+* V580  *acm* 8/04 - Increase the length of string repl from 128 to 2048: If using a
+*                    long string, e.g. in a label, this string can be very long. (bug 956)
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600 *acm* 3/06  fixing bugs 439&1390, pass apply_cx to get_new_cx to say whether
+*                  to apply command context to grave-accent expressions.
+* V600 *acm* 6/05 - Attribute control, RETURN= attribute information.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V600  6/06 *acm* - additional declarations found by Solaris compiler
+* V601 10/06 *acm* - fix bug 1447, where say `var[d=fname.cdf],return=size` failed
+*            parsing error, confusing the dot in the filename with `var.att,return=size`
+* V602  4/07 *acm* - Add RETURN=xmod,tmod
+* V615 11/08 *acm* - fixing bug 1523. If the variable contains a grid-changing 
+*                    function, we will do a full evaluation to get its size
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V684 *acm* 12/12 Add data type of DOUBLE for return=dtype
+* V685 *sh*  11/13 Add return=status and return=ready
+
+#include "netcdf.inc"
+	include 'tmap_dims.parm'
+        include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xdependency_tree.cmn'
+	include 'xtm_grid.cmn_text'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+
+* calling argument declarations:
+	LOGICAL	  did_sub, info_query, itsa_subsc, apply_cx
+	INTEGER	  cmnd_num, lencmnd, istart, max_check, digits, status
+	REAL	  memory( mem_blk_size, max_mem_blks )
+	CHARACTER cmnd*(*)
+
+* local parameter declarations
+	INTEGER	   max_len
+	PARAMETER (max_len = 2048)
+!	INTEGER	   fmt_lenH
+!	PARAMETER (fmt_len = 64 )
+
+* internal variable declarations:
+	LOGICAL   need_formatting, zero_fill, coordvar,
+     .            do_err, do_eval, get_ready
+	INTEGER   CGRID_SIZE, CGRID_AXIS, TM_LENSTR1, CX_DIM_LEN,
+     .		  FIND_DSET_NUMBER, str_len, lenbuff, iend, itmp, axis,
+     .		  mr, cx, mr_temp, i, i2, use_digits, true_end,
+     .		  qual_end, brkt, idim, use_width, dset, varid, 
+     .            vartype, nvdims, vdims(8), nvatts, ist, ind,
+     .            attype, attlen, inxt, attoutflag,outflag, fertype, 
+     .            attid, ieq, dqote, base_isp, base_cx
+	REAL	  result, val
+	REAL*8 TM_WORLD, TM_WW_AXLEN, ww
+	CHARACTER TM_FMT*18, LEFINT*16, VAR_TITLE*(max_len),
+     .		  VAR_UNITS*(max_len), GET_STRING_ELEMENT*(max_len),
+     .		  repl*(max_len), bad_str*(max_len), return_errmsg*256,
+     .            buff*128, varname*512, attname*128, aname*128
+!	CHARACTER fmt*(max_len)
+        CHARACTER*6 typstring(0:6)
+
+* local parameter declarations
+	CHARACTER	tab*1
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+        DATA typstring/
+     .  'Notype', 'BYTE', 'CHAR', 'SHORT', 'INT4', 'FLOAT', 'DOUBLE' /
+
+* initialize
+	did_sub = .FALSE.    	! any substitutions done?
+	lenbuff = LEN( cmnd )
+	use_digits = digits
+	bad_str = 'bad'
+!	fmt = ' '
+	use_width = 0
+	zero_fill = .FALSE.
+	info_query = .FALSE.
+        coordvar = .FALSE.
+        apply_cx = .FALSE.
+
+* do_err: issue error message if attrib does not exist on varname.attname
+        do_err = .TRUE.
+
+* begin the search/replace at the point specified in the call.  (This is done
+* to facilitate  grave accents condensed into single accents so they
+* can be passed to the command line in SPAWN commands)
+* locate the start of the next grave accent pair
+ 10	IF ( istart .GE. lencmnd ) RETURN
+	itmp = INDEX(cmnd(istart:),'`')
+        IF ( itmp .EQ. 0 ) RETURN
+	istart = istart + itmp
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	IF ( istart .GT. 2 ) THEN
+	   IF (cmnd(istart-2:istart-2) .EQ. '\') GOTO 10  
+	ENDIF
+#else
+	IF ( istart .GT. 2 ) THEN
+	   IF (cmnd(istart-2:istart-2) .EQ. '\\') GOTO 10  
+	ENDIF
+#endif
+
+
+* locate the end of the next grave accent pair
+* Note: no check for backslash-escaped accent here because properly paired
+*    accents only need to be checked at start of accent pair
+	itmp = INDEX(cmnd(istart:),'`')
+	IF ( itmp .EQ. 0 ) GOTO 5100		! unpaired grave accent
+	IF ( itmp .EQ. 1 ) THEN
+* ... replace  grave accents with single
+	   cmnd = cmnd(:istart-1)//cmnd(istart+1:)
+	   istart = istart + 1			! first char following accent
+	   lencmnd = lencmnd - 1
+	   GOTO 1000
+	ENDIF
+	iend = istart + itmp - 2
+	true_end = iend
+
+* do not perform substitutions beyond max_check characters
+	IF ( istart .GE. max_check ) RETURN
+
+* ====== 2/96
+* Parse ",PRECISION=n" and/or ",BAD=xx.xx" at the end of the expression
+*  (may be abbreviated to "P=n" and "B=xx.xx")
+* 3/96: added RETURN= (abbreviated R=)
+* ... hunt for the first equal sign that is not in square brackets
+	brkt = 0
+	DO 90 i = istart, iend
+	   IF (cmnd(i:i).EQ.'[') THEN
+	      brkt = brkt + 1
+	   ELSEIF (cmnd(i:i).EQ.']') THEN
+	      brkt = brkt - 1
+	   ELSEIF (cmnd(i:i).EQ.'=') THEN
+	      IF ( brkt .EQ. 0 ) GOTO 98
+	   ENDIF
+ 90	CONTINUE
+	GOTO 149	! nope - no equal sign
+* ... see if the first part of the expression is a d=dsetnum or d=dsetname
+ 98	inxt = i
+        ieq = i
+        IF (cmnd(i-1:i-1).EQ.'d') THEN
+           inxt = i+1
+           DO 91 i = inxt,iend
+              IF ( cmnd(i:i) .EQ. ',' ) GOTO 94
+ 91        CONTINUE
+ 94        dset = FIND_DSET_NUMBER(cmnd(inxt:i-1))
+       ENDIF
+
+* ... see if the equals sign is just part of some string within the grave accents
+*     This fixes bug 1469 (and its duplicate 1690)
+	dqote = 0
+	DO 198 i = istart, iend
+	   IF (cmnd(i:i).EQ.'"') THEN
+	      dqote = dqote + 1
+	   ELSEIF (cmnd(i:i).EQ.'=' .AND. dqote.GT.0) THEN
+	      IF (INDEX(cmnd(i:iend), '"') .GT. 0) GOTO 149 ! = inside a string
+	   ENDIF
+198	CONTINUE
+
+* ... hunt for the next equal sign 
+	DO 93 i = ieq, iend
+           IF (cmnd(i:i).EQ.'=') GOTO 99
+ 93	CONTINUE
+	GOTO 149	! nope - no equal sign
+
+* ... locate the comma following the mathematical expression
+  99	DO 100 i = i, istart, -1
+ 100	IF ( cmnd(i:i) .EQ. ',' ) GOTO 101
+	GOTO 5500			! no comma ???
+ 101	iend = i - 1
+* ... now decode the name/value pairs following the comma
+ 110	i = i + 1	   ! advance to character following the comma
+* ... locate the end of the name/value pair string
+	DO 120 i2 = i, true_end   
+	   IF ( cmnd(i2:i2) .EQ. ',' ) THEN
+	      qual_end = i2 - 1	
+	      GOTO 121
+	   ENDIF
+ 120	CONTINUE
+	qual_end = true_end
+ 121	CONTINUE
+* ... locate the keyword start and decode the keyword/value pair
+	DO 130 i = i, qual_end   
+	   IF (cmnd(i:i).EQ.' ' .OR. cmnd(i:i).EQ.tab) THEN
+	      CONTINUE
+	   ELSEIF (cmnd(i:i).EQ.'p' .OR. cmnd(i:i).EQ.'P') THEN
+* ... decode PRECISION = #_digits
+	      CALL EQUAL_VAL(cmnd(i:qual_end), result, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF (ABS(result) .GT. 16.) GOTO 5510 	         
+	      use_digits = NINT(result)
+	      GOTO 131
+	   ELSEIF (cmnd(i:i).EQ.'b' .OR. cmnd(i:i).EQ.'B') THEN
+* ... decode BAD = string
+	      CALL EQUAL_STR_LC(cmnd(i:qual_end), bad_str, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      GOTO 131
+	   ELSEIF (cmnd(i:i).EQ.'r' .OR. cmnd(i:i).EQ.'R') THEN
+* ... decode RETURN = string
+	      CALL EQUAL_STRING(cmnd(i:qual_end), repl, status) !repl is buffer
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      info_query = .TRUE.
+	      GOTO 131
+	   ELSEIF (cmnd(i:i).EQ.'w' .OR. cmnd(i:i).EQ.'W') THEN
+* ... decode width = width (blank-filled width)
+	      CALL EQUAL_VAL(cmnd(i:qual_end), val, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF (val.GT.0 .AND. val.LT.max_len) use_width = INT(val)
+	      GOTO 131
+	   ELSEIF (cmnd(i:i).EQ.'z' .OR. cmnd(i:i).EQ.'Z') THEN
+* ... decode zwidth = width (zero-filled width)
+	      CALL EQUAL_VAL(cmnd(i:qual_end), val, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF (val.GT.0 .AND. val.LT.max_len) use_width = INT(val)
+	      zero_fill = .TRUE.
+	      GOTO 131
+! unimplemented code to allow user to control format
+!	   ELSEIF (cmnd(i:i).EQ.'f' .OR. cmnd(i:i).EQ.'F') THEN
+!* ... decode FORMAT = string
+!	      CALL EQUAL_STRING(cmnd(i:qual_end), fmt, status)
+!	      IF ( status .NE. ferr_ok ) GOTO 5000
+!	      GOTO 131
+	   ELSE
+	      GOTO 5500
+	   ENDIF
+ 130	CONTINUE
+ 131	i = qual_end + 1	! comma or beyond end
+* ... go back for another keyword?
+	IF ( i .LT. true_end ) GOTO 110
+* ======
+
+* is the expression just white space?	(1/96 ... quick fix with GOTO's)
+ 149	DO 150 i = istart, iend
+ 150	IF ( cmnd(i:i) .NE. ' ' .AND. cmnd(i:i) .NE. tab ) GOTO 160
+* ... weird - they gave us pure white space - no numerical result possible
+	repl = bad_str
+	str_len = 3
+	GOTO 500
+
+* is this a single number request or a RETURN= query?
+ 160	IF ( info_query ) THEN
+
+* 11/2013
+* return=ISREADY and return=STATUS are special.  They must function
+*   correctly even in the face of unknown variables and unknown datasets.
+*   So they must be handled before we attempt even to get the context for the
+*   given expression.
+	   IF (repl(1:4).EQ. 'STAT' .OR. repl(1:4) .EQ. 'ISRE') THEN
+	      get_ready = repl(1:4) .EQ. 'ISRE'
+	      CALL GET_DEPENDENCY_STATUS(memory, cmnd(istart:iend),
+     .					 repl, str_len, status) 
+              IF (status.NE. ferr_ok) GOTO 5050
+	      IF (get_ready) THEN
+*  return=READY gives merely a 1 or 0 
+	         IF (    dependency_status .EQ. df_valid_var) THEN
+	            repl = '1'
+	         ELSE
+	            repl = '0'
+	         ENDIF
+	      ENDIF
+	      GOTO 500
+	   ENDIF
+
+* ... evaluate the context without computing the expression
+*	this is a major performance consideration, but not 100% reliable
+	   has_uvar_gc = .FALSE.
+	   CALL GET_NEW_CX( cx_last, cx_cmnd, apply_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+           ist = istart
+           ind = iend 
+
+	   IF (cmnd(istart:istart) .EQ. '(') THEN
+              dset = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+              CALL ISIT_COORD_VAR ( cmnd(istart:iend), dset, 
+     .            buff, coordvar, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+
+           ELSE
+* ... context meaningless for d=1,return=varnames
+              IF (cmnd(istart:istart+1) .NE. 'd=') THEN
+                 CALL EVAL_CONTEXT ( cx_cmnd, cmnd(istart:iend), status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+
+                 cx = is_cx(1)	! always comes back as the first context
+
+* ... if the result has any axes with unknown limits then we have to do a
+*	full evaluation. This happens (only?) from grid-changing fcns that
+*	return ABSTRACT axes, on which limits may depend on data values
+* NOTE THE POTENTIAL FOR WRONG RESULTS WITH OPERATIONS SUCH AS MATRIX
+* TRANSPOSE - ALL "IMPOSED" AXES PRESENT THE RISK OF WRONG RESULTS
+
+                 DO 190 idim = 1, nferdims
+		    do_eval = ( cx_hi_ww(idim, cx) .EQ. unspecified_val8
+     .	                        .AND. CGRID_AXIS(idim, cx) .NE. mnormal )
+	            IF ( do_eval .OR. has_uvar_gc) THEN
+	               CALL EVAL_EXPR ( memory, cx_last,
+     .		                     cmnd(istart:iend), apply_cx, status )
+	               IF ( status .NE. ferr_ok ) GOTO 5000
+	               cx = is_cx(1)	! always comes back as the first context
+	              GOTO 200
+	            ENDIF
+ 190	         CONTINUE
+              ENDIF  ! `d=1,return=varnames`
+
+	   ENDIF
+* ... RETURN= information request: "repl" contains the keyword
+*     Add to this error string when adding new arguments:
+
+           WRITE (return_errmsg,*)  
+     .       'use RETURN= shape,size,grid,title,bad,t0,units,dset, '//pCR//
+     .	     '  dsetnum,dsetpath,dsettitle,*size,*start,*end,'//pCR//
+     .       '  *units,*axis,nc_scale,nc_offset,user_scale,user_offset,'//pCR//
+     .       '  calendar,dtype,xmod,tmod,status,isDepth,isReady'
+!     .       '  calendar,dtype,xmod,tmod,status,isDepth,isReady,isLoaded' ! w isLoaded
+
+* ... RETURN=SHAPE
+
+ 200	   IF ( repl .EQ. "SHAPE" ) THEN
+	      repl = ' '
+	      str_len = 0
+	      DO 210 idim = 1, nferdims
+	         IF ( CX_DIM_LEN( idim, cx ) .GT. 1 ) THEN
+	            str_len = str_len + 1
+	            repl(str_len:str_len) = ww_dim_name(idim)
+	         ENDIF
+ 210	      CONTINUE
+	      IF (str_len .EQ. 0) THEN
+	         repl = "POINT"
+	         str_len = 5
+	      ENDIF
+
+* ... RETURN=T0
+	   ELSEIF ( repl .EQ. "T0" ) THEN
+	      repl = ' '	! default
+	      axis = CGRID_AXIS ( T_dim, cx )
+	      IF ( axis.NE.mnormal) THEN
+	          IF (line_direction(axis) .EQ. 'TI') THEN
+    		      repl = line_T0(axis)
+                      IF (line_shift_origin(axis)) 
+     .                  repl =  '01-JAN-0001 00:00:00'
+                  ENDIF
+	      ENDIF
+              
+* ... RETURN=CALENDAR
+	   ELSEIF ( repl(1:3) .EQ. "CAL" ) THEN
+	      repl = ' '	! default
+	      axis = CGRID_AXIS ( T_dim, cx )
+	      IF ( axis.NE.mnormal) THEN
+	          IF (line_direction(axis) .EQ. 'TI' .OR.
+     .                line_direction(axis) .EQ. 'TT')
+     .		      repl = line_cal_name(axis)
+	      ENDIF
+
+* ... RETURN=UNITS
+	   ELSEIF ( repl(1:4) .EQ. "UNIT" ) THEN	! or "=UNITS"
+	      repl = VAR_UNITS( cx )
+
+* ... RETURN=TITLE
+	   ELSEIF ( repl .EQ. "TITLE" ) THEN
+	      repl = VAR_TITLE( cx )
+
+* ... RETURN=GRID
+	   ELSEIF ( repl .EQ. "GRID" ) THEN
+	      repl = grid_name( cx_grid(cx) )
+
+* ... RETURN=DSET, DSETNUM, DSETPATH, DSETTITLE
+	   ELSEIF ( repl(1:4) .EQ. "DSET" ) THEN
+	      i2 = cx_data_set(cx)
+	      IF ( i2 .EQ. pdset_irrelevant
+     .	     .OR.  i2 .EQ. unspecified_int4 ) THEN
+	         repl = bad_str
+	      ELSE
+	         IF ( repl .EQ. "DSETNUM") THEN
+	            repl = LEFINT(i2, str_len)
+	         ELSEIF ( repl .EQ. "DSETPATH" ) THEN
+	            CALL GET_DSET_NAME(i2, repl, str_len)
+	         ELSEIF ( repl .EQ. "DSET" ) THEN
+	            CALL GET_SHORT_DSET_NAME(i2, repl, str_len)
+	         ELSEIF ( repl .EQ. "DSETTITLE" ) THEN
+	            CALL GET_DSET_TITLE(i2, repl, str_len)
+	         ELSE 
+	            GOTO 5520
+	         ENDIF
+	      ENDIF
+
+* ... RETURN=SIZE
+	   ELSEIF ( repl .EQ. "SIZE"  .AND. 
+     .              INDEX(cmnd(istart:iend),'.') .EQ. 0) THEN
+	      i2 = CGRID_SIZE ( cx )
+	      repl = LEFINT(i2, str_len)
+
+* ... RETURN=BAD
+	   ELSEIF ( repl .EQ. "BAD" ) THEN
+	      result = cx_bad_data ( cx )
+	      repl = TM_FMT( result, use_digits, max_len, str_len )
+
+* ... RETURN=nc_scale, nc_offset
+	   ELSEIF ( repl(1:3) .EQ. "NC_" ) THEN
+              IF ( repl .EQ. "NC_SCALE" ) THEN
+	         CALL GET_NC_SCALE (cx, result)
+	      ELSEIF ( repl(1:6) .EQ. "NC_OFF" ) THEN
+	         CALL GET_NC_OFFSET (cx, result)
+	      ELSE 
+	         GOTO 5520
+	      ENDIF
+	      repl = TM_FMT( result, use_digits, max_len, str_len )
+
+* ... RETURN=user_scale, user_offset
+	   ELSEIF ( repl(1:5) .EQ. "USER_" ) THEN
+              IF ( repl .EQ. "USER_SCALE" ) THEN
+	         CALL GET_USER_SCALE (cx, result)
+	      ELSEIF ( repl(1:8) .EQ. "USER_OFF" ) THEN
+                 CALL GET_USER_OFFSET (cx, result)
+	      ELSE 
+	         GOTO 5520
+	      ENDIF
+	      repl = TM_FMT( result, use_digits, max_len, str_len )
+
+* ... varname ,RETURN=dtype
+	   ELSEIF ( repl .EQ. "DTYPE" .AND. 
+     .              INDEX(cmnd(istart:iend),'.') .EQ. 0) THEN
+              dset = cx_data_set(cx)
+              IF (dset .EQ. pdset_irrelevant .OR. 
+     .            dset .EQ. unspecified_int4) dset = -1  ! try user vars
+
+              varid = 0
+              vartype = 0
+
+              CALL CD_GET_VAR_ID(dset, cmnd(istart:iend), varid, status)
+
+              IF (status .EQ. ferr_ok)  
+     .          CALL CD_GET_VAR_INFO (dset, varid, cmnd(istart:iend), 
+     .                              vartype, nvdims, vdims, nvatts,
+     .                              coordvar, outflag, status )
+
+              IF (vartype.EQ.0 ) THEN  
+
+*  evaluate expr to get type and translate ferret type to netcdf
+
+	         CALL EVAL_EXPR ( memory, cx_last,
+     .		                     cmnd(istart:iend), apply_cx, status )
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+                 fertype = cx_type(cx)
+
+                 IF (fertype .EQ. ptype_unknown) THEN
+                    vartype = 0  ! NAT = 'Not A Type' (c.f. NaN) 
+                 ELSE IF (fertype .EQ. ptype_float) THEN
+                    vartype = 5    ! NC_FLOAT
+                 ELSE IF (fertype .EQ. ptype_int4) THEN
+                    vartype = 4     ! NC_INT
+                 ELSE IF (fertype .EQ. ptype_int2) THEN
+                    vartype = 3     ! NC_SHORT
+                 ELSE IF (fertype .EQ. ptype_int1) THEN
+                    vartype = 1     ! NC_BYTE
+                 ELSE IF (fertype .EQ. ptype_char) THEN
+                    vartype = 2     ! NC_CHAR
+                 ELSE IF (fertype .EQ. ptype_string) THEN
+                    vartype = 2   ! NC_CHAR
+                 ELSE IF (fertype .EQ. ptype_double) THEN
+                    vartype = 6   ! NC_DOUBLE
+                 ELSE
+                    vartype = 0
+                 ENDIF
+              ENDIF
+              repl = typstring(vartype)
+
+* ... varname.atttnum,RETURN=dtype  or varname.attname, RETURN=dtype
+	   ELSEIF ( repl .EQ. "DTYPE" .AND. 
+     .              INDEX(cmnd(istart:iend),'.') .GT. 0) THEN
+              attype = 0
+              dset = cx_data_set(cx)
+              IF (cx_data_set(cx) .EQ. pdset_irrelevant) dset = -1  ! user vars
+              CALL BREAK_VARATTNAME( cmnd(istart:iend), dset, 
+     .                    varname, attname, varid, do_err, status )
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .              status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .              attid, aname, attype, attlen, attoutflag, status )
+
+              IF (status .EQ. ferr_ok) THEN
+                 repl = typstring(attype)
+	      ELSE 
+	         GOTO 5520
+              ENDIF
+
+* ... varname.atttnum,RETURN=size  or varname.attname, RETURN=size
+	   ELSEIF ( repl .EQ. "SIZE" .AND. 
+     .              INDEX(cmnd(istart:iend),'.') .GT. 0) THEN
+              IF (.NOT. coordvar) dset = cx_data_set(cx)
+              IF (dset .GE. 1) THEN
+                 IF (coordvar) THEN
+
+                    IF (INDEX(buff,'.') .GT. 0)
+     .              CALL BREAK_VARATTNAME( cmnd(istart:iend), dset, varname, 
+     .                              attname,  varid, do_err, status )
+
+                 ELSE
+                    CALL CD_GET_VAR_ID (dset, cmnd(istart:iend), varid,
+     .                  status)
+                    
+                    IF (status .NE. ferr_ok .AND. 
+     .                  INDEX(cmnd(istart:iend),'.') .GT. 0) THEN
+                       CALL BREAK_VARATTNAME( cmnd(istart:iend), dset,
+     .                         varname, attname, varid, do_err, status )
+                    ELSE
+                       i2 = CGRID_SIZE ( cx )
+                       repl = LEFINT(i2, str_len) 
+                       GOTO 500
+                    ENDIF
+
+                 ENDIF
+                 
+                 CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .               status)
+                 IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid,
+     .               attid, aname,  attype, attlen, attoutflag, status )
+
+                 IF (status .EQ. ferr_ok) THEN
+                    IF (attlen .GT. 0) THEN
+                       result = attlen
+                       repl = TM_FMT( result, use_digits, max_len, str_len )
+                    ENDIF
+	         ELSE 
+	            GOTO 5520
+                 ENDIF
+              ENDIF
+
+* ... RETURN=XMOD
+	   ELSEIF ( repl .EQ. "XMOD" ) THEN
+	      repl = ' '	! default
+	      axis = CGRID_AXIS ( X_dim, cx )
+	      IF ( axis.NE.mnormal) THEN
+	         IF (line_modulo(axis)) THEN
+                    result = line_modulo_len(axis)
+
+! If axis has modulo=" ", and units are not degrees, mod len = axis len.
+#ifdef double_p
+                    IF (result .EQ. 0) result = (TM_WW_AXLEN(axis))
+#else
+                    IF (result .EQ. 0) result = SNGL(TM_WW_AXLEN(axis))
+#endif
+                    repl = TM_FMT( result, use_digits, max_len, str_len)
+                 ENDIF
+	      ENDIF
+
+* ... RETURN=TMOD
+	   ELSEIF ( repl .EQ. "TMOD" ) THEN
+	      repl = ' '	! default
+	      axis = CGRID_AXIS ( T_dim, cx )
+	      IF ( axis.NE.mnormal) THEN
+	         IF (line_modulo(axis)) THEN
+                    result = line_modulo_len(axis)
+
+! If axis has modulo=" ", mod len = axis len.
+#ifdef double_p
+                    IF (result .EQ. 0) result = (TM_WW_AXLEN(axis))
+#else
+                    IF (result .EQ. 0) result = SNGL(TM_WW_AXLEN(axis))
+#endif
+                    repl = TM_FMT( result, use_digits, max_len, str_len)
+                 ENDIF
+	      ENDIF
+
+* ... RETURN=ISDEPTH
+	   ELSEIF ( repl(1:3) .EQ. "ISD" ) THEN
+	      repl = '0'	! default, pos=up, or not-depth.
+	      axis = CGRID_AXIS ( Z_dim, cx )
+	      IF ( axis.NE.mnormal) THEN
+	         IF (line_direction(axis) .EQ. "UD") repl = '1'
+	      ELSE 
+	         repl = 'NORMAL'
+	      ENDIF
+
+* ... RETURN=ISLOADED
+!	   ELSEIF ( repl(1:4) .EQ. "ISLO" ) THEN
+!* see is an mr variable matching this cx is already in memory
+!	      CALL FIND_MEM_VAR( cx, mr, search_by_value )
+!	      IF ( mr.EQ.mr_nonexist ) THEN
+!	         repl = '0'
+!	      ELSE
+!	         repl = '1'
+!	      ENDIF
+!	   
+* ... RETURN=*SIZE, *START, *END, *UNITS, *AXIS
+	   ELSE	
+* ... axis specific requests - must start with i,j,k,l,m,n or x,y,z,t,e,f
+	      DO 220 idim = 1, nferdims
+	         IF ( repl(1:1) .EQ. ss_dim_name(idim) ) THEN
+	            itsa_subsc = .TRUE.
+	            GOTO 221
+	         ELSEIF ( repl(1:1) .EQ. ww_dim_name(idim) ) THEN
+	            itsa_subsc = .FALSE.
+	            GOTO 221
+	         ENDIF
+ 220	      CONTINUE
+	      GOTO 5520
+ 221	      need_formatting = .TRUE.
+	      IF ( repl(2:5) .EQ. "SIZE" ) THEN
+	         IF (.NOT.itsa_subsc) GOTO 5520
+	         i2 = CX_DIM_LEN(idim, cx)
+	      ELSEIF ( repl(2:6) .EQ. "START" ) THEN
+	         i2 = cx_lo_ss(cx,idim)
+	      ELSEIF ( repl(2:4) .EQ. "END" ) THEN
+	         i2 = cx_hi_ss(cx,idim)
+	      ELSEIF ( repl(2:5) .EQ. "AXIS" ) THEN
+	         axis = CGRID_AXIS ( idim, cx )
+	         IF (axis.EQ.mnormal .OR. axis.EQ.munknown) THEN
+	           repl = 'NORMAL'
+	         ELSE
+	            repl = line_name( axis )
+	         ENDIF
+	         need_formatting = .FALSE.
+	      ELSEIF ( repl(2:5) .EQ. "UNIT" ) THEN
+	         axis = CGRID_AXIS ( idim, cx )
+	         IF (axis.EQ.mnormal .OR. axis.EQ.munknown) THEN
+	           repl = ' '
+	         ELSE
+	           repl = line_units( axis )
+	         ENDIF
+	         need_formatting = .FALSE.
+	      ELSE
+	         GOTO 5520
+	      ENDIF
+	      IF ( need_formatting ) THEN
+	         IF ( itsa_subsc) THEN
+	            IF (i2 .EQ. unspecified_int4) i2 = 0
+	            repl = LEFINT(i2, str_len)
+	         ELSE
+	            ww = TM_WORLD(i2, cx_grid(cx), idim, box_middle)
+! unimplemented code to allow user to control format
+!	            IF ( fmt .NE. ' ' ) THEN
+!*    ... use user-specified time format
+!	              CALL TRANSLATE_FORMATTED( ww, idim, cx_grid(cx),
+!     .					        fmt, bad_str, repl )
+!	            ELSE
+*   ... default formatting for world coordinates
+	              CALL TRANSLATE_TO_WORLD( ww, idim, cx_grid(cx),
+     .				             use_digits, repl )
+!	            ENDIF
+	         ENDIF
+	      ENDIF
+	   ENDIF
+	   str_len = TM_LENSTR1(repl)
+
+	ELSE
+* single number answer desired
+* ... evaluate the expression
+	   CALL EVAL_EXPR ( memory, cx_last, cmnd(istart:iend), 
+     .        .TRUE., status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   cx = is_cx(1)	! always comes back as the first context
+	   mr = is_mr(1)
+
+* ... make sure the result is a single, valid value
+	   IF ( CGRID_SIZE(cx) .NE. 1 ) GOTO 5200	! result not a scalar
+
+* ... extract the result scalar from the (possibly larger) memory variable
+	   CALL CREATE_TEMP_MEM_VAR( cx, mr_temp, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL COPY_GRID( memory(1, mr_blk1(mr)     ), mr,
+     .                     memory(1, mr_blk1(mr_temp)), mr_temp )
+
+	   IF (mr_type(mr_temp) .EQ. ptype_string ) THEN
+
+* ... get one string
+	     repl =  GET_STRING_ELEMENT(
+     .				mr_lo_s1(mr_temp), mr_hi_s1(mr_temp),
+     .				mr_lo_s2(mr_temp), mr_hi_s2(mr_temp),
+     .				mr_lo_s3(mr_temp), mr_hi_s3(mr_temp),
+     .				mr_lo_s4(mr_temp), mr_hi_s4(mr_temp),
+     .				mr_lo_s5(mr_temp), mr_hi_s5(mr_temp),
+     .				mr_lo_s6(mr_temp), mr_hi_s6(mr_temp),
+     .				memory(1, mr_blk1(mr_temp)),
+     .				cx_lo_s1(cx), cx_lo_s2(cx),
+     .				cx_lo_s3(cx), cx_lo_s4(cx),
+     .				cx_lo_s5(cx), cx_lo_s6(cx),
+     .				max_len, str_len)
+	   ELSE
+
+* .... convert to a formatted result with requested digits
+	     result =  memory(1, mr_blk1(mr_temp))
+	     IF ( result .EQ. mr_bad_data(mr) ) THEN
+	        repl = bad_str
+	        str_len = TM_LENSTR1(bad_str)
+	     ELSE
+	        repl = TM_FMT( result, use_digits, max_len, str_len )
+	     ENDIF
+	   ENDIF
+* ... clean up temporary variable
+	   CALL DELETE_VARIABLE( mr_temp )
+	ENDIF
+
+* adjust the field width if requested by the user
+ 500	IF (use_width .GT. 0) THEN
+	   IF (str_len .LT. use_width) THEN
+	      i2 = use_width - str_len
+	      DO i = use_width, i2+1, -1   ! shift characters to right
+	        repl(i:i) = repl(i-i2:i-i2)
+	      END DO
+	      DO i = 1, i2
+	        IF (zero_fill) THEN
+	          repl(i:i) = '0'
+	        ELSE
+	          repl(i:i) = ' '
+	        ENDIF
+	      END DO
+	   ENDIF
+	   str_len = use_width
+	ENDIF
+
+* replace the expression text (incl grave accents) with the formatted string
+	IF ( (istart-1)+str_len+(lencmnd-true_end-1) .GT. lenbuff ) THEN
+           GOTO 5400					! too big to fit
+        ELSE
+	   IF ( iend+2 .LE. lencmnd ) THEN
+	      risc_buff = cmnd(true_end+2:)
+	   ELSE
+	      risc_buff = ' '
+	   ENDIF
+           cmnd(istart-1:) = repl(:str_len) // risc_buff
+           lencmnd = lencmnd - ((true_end-istart+3) - str_len)
+        ENDIF
+
+* successful translation of a grave-accented expression
+ 1000	did_sub = .TRUE.
+	RETURN
+
+* error exits
+ 5050	CALL RELEASE_WORK_SPC
+ 5000   RETURN
+ 5100	risc_buff = cmnd(:lencmnd)
+	CALL ERRMSG( ferr_syntax, status,
+     .       'unpaired grave accents: '//risc_buff, *5000)
+ 5200	risc_buff = cmnd(istart:iend)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .       'grave accent doesnt evaluate to scalar'//pCR
+     .                                  //risc_buff, *5000)
+ 5400	risc_buff = cmnd(istart:iend)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .       'grave accent evaluates to string too long'//pCR
+     .					//risc_buff, *5000)
+ 5500	risc_buff = cmnd(:lencmnd)
+	CALL ERRMSG( ferr_syntax, status,
+     .       'options: "P=prec","B=bad","W=width","ZW=zero-width" or'
+     .	     //' "R=return-item"'//pCR//risc_buff, *5000)
+ 5510	risc_buff = cmnd(i:qual_end)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .       'maximum precision is 16 digits: '
+     .					//risc_buff, *5000)
+ 5520   risc_buff = cmnd(i:qual_end)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .     return_errmsg//pCR//risc_buff, *5000)
+	END
diff --git a/fer/gnl/reset_ax_att.F b/fer/gnl/reset_ax_att.F
new file mode 100644
index 0000000..e974fcb
--- /dev/null
+++ b/fer/gnl/reset_ax_att.F
@@ -0,0 +1,288 @@
+      SUBROUTINE RESET_AX_ATT (name, new_units, new_t0,  
+     .       new_cal_name, new_modulo, new_modulo_len, 
+     .       direction, regular_flag )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*  Change attributes for an axis
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* 11/2006 
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+*                  Use pseudo-dataset of user-defined axes to keep track of attributes.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+        include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+        include 'xdset_parms.cmn'
+        include 'netcdf.inc'
+
+* calling argument declarations:
+
+      CHARACTER*(*) name, direction, new_units, new_t0, 
+     .              new_cal_name
+      REAL*8 new_modulo_len
+      LOGICAL regular_flag, new_modulo
+
+* local variable declarations: 
+      
+      INTEGER TM_LENSTR1, STR_SAME, 
+     .        dset, varid, attlen, attype, attoutflag, 
+     .        vartype, nvdims, nvatts, vdims(8), all_outflag,
+     .        attid, len, maxlen, status
+      REAL dummy
+      CHARACTER buff*128, varname*128, attbuff*10, attname*128, dir*4
+      LOGICAL	coordvar, do_warn, got_it
+
+      dummy = 0.
+      do_warn = .FALSE.
+      maxlen = 128
+
+c... loop over datasets
+c    see if name exists as an axis name.
+
+      DO 100 dset = -2, maxdsets
+         IF (dset .EQ. -1 .OR. dset .EQ. 0) GOTO 100
+         
+         IF (dset .GT. 0) THEN
+            IF ( ds_name(dset) .EQ. char_init256) GOTO 100
+         ENDIF
+
+         CALL CD_GET_VAR_ID (dset, name, varid, status)
+
+         IF (status .EQ. ferr_ok) THEN  
+! name is a variable; is it a coordinate variable of the dataset?
+
+            CALL CD_GET_VAR_INFO (dset, varid, name, vartype, 
+     .          nvdims, vdims, nvatts, coordvar, all_outflag, status) 
+            IF (.NOT. coordvar) goto 100
+
+         ELSE
+	    GOTO 100
+	 ENDIF
+
+c ... If units attribute already exists, change it; otherwise add new
+
+         IF (new_units .NE. " ") THEN
+            attname = 'units'
+            len = TM_LENSTR1(new_units)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               attoutflag = 1
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .         attoutflag, new_units, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, NCCHAR, len, new_units, dummy, status)
+            ENDIF
+        ENDIF
+
+c ... If t0 attribute already exists, change it; otherwise add new
+
+         IF (new_t0 .NE. " ") THEN
+            attname = 'time_origin'
+            len = TM_LENSTR1(new_t0)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               attoutflag = 1
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .           attoutflag, new_t0, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, new_t0, dummy, status)
+            ENDIF
+         ENDIF
+
+c ... direction; Change positive=up or down on Z axes; replace cartesian_axis 
+c     or axis attribute only if already an attribute
+
+         attname = 'positive'
+
+         CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+         IF (status .EQ. ferr_ok) THEN
+            CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname,
+     .        attype, attlen, attoutflag, status)
+
+            IF (direction .EQ. 'DU') THEN
+               dir = 'up'
+               len = 2
+            ELSE
+               dir = 'down'
+               len = 4
+            ENDIF
+            CALL CD_REPLACE_ATTR (dset, varid, attname, attype, 
+     .        len, dir, dummy, status)
+         ENDIF
+
+         attname = 'cartesian_axis'
+         len = 1
+
+         dir = ' '
+         IF (direction(1:1) .EQ. 'T') dir = 'T' 
+         IF (direction .EQ. 'WE' .OR. 
+     .    direction(1:1) .EQ. 'X') dir = 'X'
+         IF (direction .EQ. 'SN' .OR. 
+     .    direction(1:1) .EQ. 'Y') dir = 'Y'
+         IF (direction .EQ. 'UD' .OR. 
+     .    direction .EQ. 'DU' .OR.  
+     .    direction(1:1) .EQ. 'Z') dir = 'Z'
+         
+         IF (dir .NE. ' ') THEN
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, dir, dummy, status)
+            ENDIF
+
+            attname = 'axis'
+
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, dir, dummy, status)
+            ENDIF
+         ENDIF
+
+c ... If calendar attribute already exists, change it; otherwise add new
+
+         IF (new_cal_name .NE. " ") THEN
+            attname = 'calendar'
+            attoutflag = 1
+            IF ( (STR_SAME(new_cal_name(1:3), 'GRE') .EQ. 0) .OR.
+     .           (STR_SAME(new_cal_name(1:3), 'STA') .EQ. 0) ) attoutflag = 0
+
+            len = TM_LENSTR1(new_cal_name)
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .NE. ferr_ok) THEN
+               CALL CD_PUT_NEW_ATTR (dset, varid, attname, NCCHAR, len,
+     .           attoutflag, new_cal_name, dummy, status)
+            ELSE
+               CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .           attlen, attoutflag, status)
+               CALL CD_REPLACE_ATTR (dset, varid, 
+     .           attname, attype, len, new_cal_name, dummy, status)
+            ENDIF
+         ENDIF
+
+c ... point_spacing; change only if it was already an attribute
+
+         attname = 'point_spacing'
+         attbuff = 'uneven'
+         IF (regular_flag) attbuff = 'even'
+         len = TM_LENSTR1(attbuff)
+
+         CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+         IF (status .EQ. ferr_ok) THEN
+            CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .        attlen, attoutflag, status)
+            CALL CD_REPLACE_ATTR (dset, varid, 
+     .        attname, attype, len, attbuff, dummy, status)
+         ENDIF
+
+c ... modulo; either write modulo = ' ' for modulo=true,
+c     or write modulo length.
+
+         attname = 'modulo'
+         IF (new_modulo) THEN
+         
+            IF (new_modulo .OR. (new_modulo_len .GT. 0.D0)) THEN
+               attbuff = ' '
+               len = 1
+               CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+               IF (new_modulo_len .GT. 0) THEN  ! write the value of new_modulo_len
+                  IF (status .NE. ferr_ok) THEN
+                     attoutflag = 1
+                     CALL CD_PUT_NEW_ATTR_DP (dset, varid, attname, NCDOUBLE, len,
+     .               attoutflag, attbuff, new_modulo_len, status)
+                  ELSE
+                     CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .               attlen, attoutflag, status)
+                     CALL CD_REPLACE_ATTR_DP (dset, varid, 
+     .               attname, attype, len, attbuff, new_modulo_len, status)
+                  ENDIF
+
+               ELSE  ! write string attribute modulo=' '
+                  IF (status .NE. ferr_ok) THEN
+                     attoutflag = 1
+                     CALL CD_PUT_NEW_ATTR_DP (dset, varid, attname, NCCHAR, len,
+     .               attoutflag, attbuff, new_modulo_len, status)
+                  ELSE
+                     CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype,
+     .               attlen, attoutflag, status)
+                     CALL CD_REPLACE_ATTR (dset, varid, 
+     .               attname, NCCHAR, len, attbuff, dummy, status)
+                  ENDIF
+               ENDIF
+
+            ENDIF
+         ELSE  ! if new_modulo is false then set attribute from axis
+ 
+            CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+            IF (status .EQ. ferr_ok) THEN
+               CALL CD_DELETE_ATTRIBUTE (dset, varid, attname, status)
+            ENDIF
+         ENDIF
+
+  100 CONTINUE   
+      
+      status = ferr_ok
+
+      RETURN
+      END
diff --git a/fer/gnl/reset_axis.F b/fer/gnl/reset_axis.F
new file mode 100644
index 0000000..67d1105
--- /dev/null
+++ b/fer/gnl/reset_axis.F
@@ -0,0 +1,314 @@
+      SUBROUTINE RESET_AXIS (dset, varid, varname, attname, attbuff, 
+     .     val, status) 
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SET command
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA 
+* 3/20/2006
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+*
+* Set axis attributes as in SET AXIS; called by edit_attribute.F
+* doing SET ATT axname.attribute=
+
+	include 'tmap_dims.parm'
+	include 'tmap_errors.parm'
+#	include "tmap_dset.parm"
+        include 'xtm_grid.cmn_text'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xunits.cmn_text'
+	include 'xvariables.cmn'
+        include 'calendar.decl'
+        include 'calendar.cmn'
+
+* Argument declarations
+
+      CHARACTER*(*) varname, attname, attbuff
+      INTEGER dset, varid, status
+      REAL val
+
+* Internal declarations
+
+      REAL*8  TM_WW_AXLEN, axwwlen
+      INTEGER STR_SAME, TM_GET_LINENUM, TM_LENSTR1, TM_UNIT_ID, 
+     .        TM_GET_CALENDAR_ID, axis, i, since_T0, units, cal_id, 
+     .        year, month, day, hour, minute, second, slen
+      LOGICAL TM_HAS_STRING, its_changed, ok_cal
+      CHARACTER*128 buff1
+
+        buff1 = attname
+ 	axis = TM_GET_LINENUM( varname)
+        IF ( axis .EQ. unspecified_int4 ) GOTO 5100
+* MODULO
+	IF ( STR_SAME(buff1, 'modulo') .EQ. 0) THEN
+	   IF (val .EQ. unspecified_val4) THEN
+	      val = 0.0
+	   ELSE
+	      val = ABS(val)  ! ABS to tolerate negatives
+	   ENDIF
+	   its_changed = .NOT.line_modulo(axis)
+     .		    .OR.  val .NE. line_modulo_len(axis)
+           line_modulo( axis ) = .TRUE.
+	   line_modulo_len( axis ) = val
+
+* ... wipe memory clear of stored variables - this could change all definitions
+*      ( could be more selective for efficiency by checking to see where this
+*      axis gets used )
+	   IF ( its_changed ) THEN
+              DO 100 i = 1,max_mr_avail
+ 100          IF ( mr_protected( i ) .NE. mr_deleted ) 
+     .                                CALL DELETE_VARIABLE( i )
+           ENDIF
+
+           RETURN
+        ENDIF
+
+* DEPTH
+	IF ( STR_SAME(buff1, 'depth') .EQ. 0) THEN
+           IF ( line_direction(axis) .EQ. 'DU' ) THEN
+	      line_direction(axis) = 'UD'
+           ENDIF
+
+           RETURN
+        ENDIF
+
+
+* POSITIVE
+	IF ( STR_SAME(buff1, 'positive') .EQ. 0) THEN
+           IF ( STR_SAME(attbuff,'up') .EQ. 0) THEN
+	      line_direction(axis) = 'DU'
+           ELSE IF ( STR_SAME(attbuff,'down') .EQ. 0) THEN
+	      line_direction(axis) = 'UD'
+           ELSE
+              GOTO 5200
+           ENDIF
+
+           RETURN
+        ENDIF
+
+* CALENDAR 
+
+        IF (STR_SAME(buff1, 'calendar') .EQ. 0) THEN
+           IF ( line_direction(axis) .EQ. 'TI' ) THEN
+
+              ok_cal = .FALSE.
+
+              IF (attbuff(1:3) .EQ. '360') attbuff = '360_DAY' 
+              IF (attbuff(1:3) .EQ. 'STA') attbuff = 'GREGORIAN' 
+              IF (attbuff(1:3) .EQ. 'PRO') attbuff = 'GREGORIAN' 
+              IF (attbuff(1:3) .EQ. 'COM') attbuff = 'NOLEAP' 
+              IF (attbuff(1:3) .EQ. '365') attbuff = 'NOLEAP' 
+              IF (attbuff(1:3) .EQ. '366') attbuff = 'ALL_LEAP' 
+
+              DO 200 i = 1, mxcals
+                 IF (attbuff(1:3) .EQ. allowed_calendars(i)(1:3) ) THEN
+                    ok_cal = .TRUE.
+                    line_cal_name(axis) = allowed_calendars(i)
+                 ENDIF
+200          CONTINUE
+
+              IF (.NOT. ok_cal) GOTO 5300
+
+           ENDIF
+
+           RETURN
+        ENDIF
+
+* TIME 0RIGIN 
+
+        IF (STR_SAME(buff1, 'time_origin') .EQ. 0) THEN
+           IF ( line_direction(axis) .EQ. 'TI' .OR.
+     .          line_direction(axis) .EQ. 'TT' ) THEN
+
+              CALL TM_BREAK_DATE (attbuff, 1, year, month, day,
+     .				  hour, minute, second, status)
+              IF ( status .NE. ferr_ok ) GOTO 5400
+              line_t0(axis) = attbuff
+              line_direction(axis) = 'TI'
+
+           ENDIF
+
+           RETURN
+        ENDIF
+
+*  UNITS
+* Note we do not change line direction with a resetting of units; line
+* direction UD, DU, WE, SN stay as they were when they were input.
+
+        IF (STR_SAME(buff1, 'units') .EQ. 0) THEN
+
+           since_T0 = MAX( INDEX(attbuff,'since'), 
+     .        INDEX(attbuff,'SINCE') )
+           IF (since_T0 .GT. 0) GOTO 5500
+
+           line_units(axis) = attbuff
+
+* ... decode the units (code lifted from cd_get_1_axis)
+
+           units = TM_UNIT_ID( line_units(axis) )
+
+* Named calendar with unit=year gets length of year in that calendar.
+
+           cal_id = TM_GET_CALENDAR_ID (line_cal_name(axis))
+           IF (units .EQ. -6 .OR. units .EQ. -10) THEN
+              IF (cal_id .EQ. d360) units = -9
+              IF (cal_id .EQ. julian) units = -12
+              IF (cal_id .EQ. noleap) units = -11
+              IF (cal_id .EQ. all_leap) units = -8
+           ENDIF
+
+           line_unit_code(axis) = units
+           IF  ( units.EQ.0 .AND. line_units(axis) .NE. ' ' ) THEN
+              CALL WARN ('Units  not recognized: '//line_units(axis))
+              CALL WARN ('They will not be convertible:')
+           ENDIF
+           IF ( units .GE. 0 ) THEN
+              line_tunit(axis) = real4_init
+           ELSE
+              line_tunit(axis) = un_convert(line_unit_code(axis))
+           ENDIF
+
+* See if we are resetting from a generic XX or YY axis to a geographic one.
+
+           IF (line_direction(axis) .EQ. 'XX') THEN
+              IF ( units .EQ. 4 .AND. 
+     .              TM_HAS_STRING(line_units(axis), 'deg')
+     .             .OR. TM_HAS_STRING(line_units(axis), 'lon') ) THEN 
+                 line_direction(axis) = 'WE'
+
+* Should we set axis to modulo?
+                 axwwlen = TM_WW_AXLEN(axis)
+                 IF ( axwwlen .LE. 360.D0 ) THEN
+                    line_modulo(axis) = .TRUE.
+                    IF (line_modulo_len(axis) .EQ. 0.0D0)
+     .                    line_modulo_len(axis) = 360.D0
+                 ENDIF
+
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'YY') THEN
+              IF ( units .EQ. 4 .AND. 
+     .                  TM_HAS_STRING(line_units(axis), 'deg')
+     .             .OR. TM_HAS_STRING(line_units(axis), 'lat') ) THEN 
+                    line_direction(axis) = 'SN'
+              ENDIF
+           ENDIF
+
+* recheck units and see if we are resetting from a geographic axis to a 
+* non-geographic one or a calendar to non-calendar.
+
+           IF (line_direction(axis) .EQ. 'WE' .OR. 
+     .         line_direction(axis) .EQ. 'XX' ) THEN
+              IF ( units .NE. 4 ) THEN 
+                 line_direction(axis) = 'XX'
+                 IF (units .LT. 0) THEN
+                    CALL WARN ('Units  not recognized for X axis: '
+     .                 //line_units(axis))
+                    CALL WARN ('They will not be convertible')
+                 ENDIF
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'SN' .OR. 
+     .         line_direction(axis) .EQ. 'YY' ) THEN
+              IF ( units .NE. 4 ) THEN 
+                 line_direction(axis) = 'YY'
+                 IF (units .LT. 0) THEN
+                    CALL WARN ('Units  not recognized for Y axis: '
+     .                 //line_units(axis))
+                    CALL WARN ('They will not be convertible')
+                 ENDIF
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'DU' .OR. 
+     .         line_direction(axis) .EQ. 'UD' ) THEN
+               IF (units .LT. 0) THEN
+                 CALL WARN ('Units  not recognized for Z axis: '
+     .                 //line_units(axis))
+                 CALL WARN ('They will not be convertible')
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'TI' .OR. 
+     .         line_direction(axis) .EQ. 'TT' ) THEN
+              IF ( units .GE. 0 ) THEN 
+                 line_direction(axis) = 'TT'
+                 CALL WARN ('Units  not recognized for T axis: '
+     .                 //line_units(axis))
+                 CALL WARN ('They will not be convertible')
+              ENDIF
+           ENDIF
+
+
+        ENDIF
+
+	RETURN
+
+* error exits
+
+ 5000	RETURN
+
+ 5100 buff1 = varname
+      slen = TM_LENSTR1(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .		 'unknown axis: '//buff1(1:slen),
+     .               *5000 )
+ 5200 CALL ERRMSG( ferr_syntax, status,
+     . 	         'positve may take the value UP or DOWN ',
+     .               *5000 )
+      
+ 5300 buff1 = attbuff
+      slen = TM_LENSTR1(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .	         'invalid calendar name: '
+     .           //buff1(1:slen), 
+     .               *5000 )
+
+ 5400 buff1 = attbuff
+      slen = TM_LENSTR1(buff1)	
+      CALL ERRMSG( ferr_syntax, status,
+     .	         'invalid date string: '
+     .           //buff1(1:slen), 
+     .               *5000 )
+
+ 5500 CALL ERRMSG( ferr_syntax, status,
+     .	         'specify TIME ORIGIN separately from UNITS ',
+     .               *5000 )
+      END
diff --git a/fer/gnl/sample.F b/fer/gnl/sample.F
new file mode 100644
index 0000000..7f79b67
--- /dev/null
+++ b/fer/gnl/sample.F
@@ -0,0 +1,313 @@
+	SUBROUTINE SAMPLE( memory, mr_list, cx_list, nvars,
+     .			   opt1_string, opt2_string, file_given,
+     .			   fname, fmt, binary, columns, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sample the given field at the specified XYZT coordinates
+* opt1_string contains special instructions
+*	"FILL" indicates to fill holes when the field contains missing values
+* opt2_string contains flags to indicate if the coordinates are given as
+*	world positions (C=Coordinate) or subscripts (I=index)
+
+*  USER/COMMAND=SAMPLE/OPT1=FILL,STANDARD_BAD/OPT2=CCII/FILE=outfile/FORM=(F10)
+
+* The format may be a FORTRAN FORMAT or "UNFORMATTED", or,
+* "UNFORMATTED:columns" - the latter produces condensed output (results, only)
+
+* Each output record will consist of
+*	value xcoord ycoord zcoord tcoord code
+* where "code" is 0=fully successful
+*		  1=successful with hole filling
+*              -1-4=failed due to beyond input data limits on axis -code
+*		 -9=failed due to hole in input data field
+*		-99=failed due to hole in input coordinates
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V301:  1/94
+*
+* V312: 5/94 - array "memory" as a calling argument
+* V314: 8/22/94 *kob* IBM port: 1) ACCESS=APPEND not allowed in file opens - added
+*				   ifdef NO_ACCESS_APPEND check
+*				2) TM_HAS_STRING incorrectly defined as INTEGER
+*				3) inherited length string concats are not legal -
+*					use risc buff
+* Linux Port 5/97 *kob* - had to add ifdef F90_OPEN_FILE_APPEND because f90
+*			  uses "POSITION" instead of "ACCESS" to specify 
+*			  opening a file for append.
+* v552  4/03 *acm* up VAR_TRANS to 150 characters (variables are up to 128, plus
+*                  space for the transformation specifier)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+#ifdef NO_PASSED_CONCAT	
+	include 'xrisc.cmn'
+#endif
+
+* calling argument declarations:
+	LOGICAL	file_given, binary
+	INTEGER	nvars, mr_list(nvars), cx_list(nvars), columns, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+	CHARACTER opt1_string*(*), opt2_string*(*), fname*(*), fmt*(*)
+
+* internal variable declarations:
+	LOGICAL	fill, standard_bad, tempx, tempy, tempz, tempt,
+     .		TM_HAS_STRING
+	INTEGER	TM_LENSTR1, CGRID_SIZE, STR_UPCASE,
+     .		CX_DIM_LEN,
+     .		mblk1, nblks, col_mblk1, col_nblks, slen,
+     .		ssorww(4), out_lun,
+     .		i, flen, fmlen, npts, cx, ndim, dim(4), cxpts(2:5)
+	REAL	missing
+	CHARACTER VAR_TRANS*150, buff*150
+	
+* internal parameter definitions
+	INTEGER by_ss, by_ww, by_nothin
+	PARAMETER ( by_ss=1, by_ww=2, by_nothin=0 )
+
+* DECODE THE OPT1 COMMAND QUALIFIER:
+* /OPT1 = "FILL,STANDARD_BAD"
+	slen = TM_LENSTR1( opt1_string )
+	fill = TM_HAS_STRING(opt1_string(:slen),'FILL')
+	standard_bad = TM_HAS_STRING(opt1_string(:slen),'STANDARD')
+	IF ( .NOT.fill .AND. .NOT.standard_bad .AND. opt1_string.NE.' ' 
+     .	.AND. .NOT.TM_HAS_STRING(opt1_string(:slen),'HOLE') ) GOTO 5100
+
+* Must be exactly 5 arguments given
+* arguments 2-5 must be either same size or constants
+	IF ( nvars .NE. 5 ) GOTO 5200
+	npts = unspecified_int4
+	DO 100 i = 2, 5
+	   cx = cx_list(i)
+	   CALL GET_CX_DIMS( cx, ndim, dim ) 
+	   cxpts(i) = CGRID_SIZE( cx )	
+	   IF ( cxpts(i) .NE. 1 ) THEN
+	      IF ( npts .EQ. unspecified_int4 ) npts = cxpts(i)
+	      IF ( npts .NE. CGRID_SIZE( cx ) ) GOTO 5300
+	   ENDIF
+ 100	CONTINUE
+	IF ( npts .EQ. unspecified_int4 ) npts = 1
+	
+* determine what to output for missing data points
+	IF ( standard_bad ) THEN
+	   missing = bad_val4
+	ELSE
+	   missing = mr_bad_data(mr_list(1))
+	ENDIF
+
+* Decode the specification of subscript or world coordinate
+* /OPT2 = "C" (all coordinates) or "I" (all indices) or "CCIN", ...
+	DO 200 i = 1, 4
+ 200	ssorww(i) = by_ww			! default to "C"
+	IF ( opt2_string .NE. ' ' ) THEN
+	   i = STR_UPCASE( opt2_string, opt2_string )
+	   slen = TM_LENSTR1( opt2_string )
+	   IF ( slen.NE.1 .AND. slen.NE.4 ) GOTO 5400
+	   IF ( slen.EQ.1 ) THEN     ! replicate single char shorthand
+	      DO 210 i = 2, 4
+ 210	      opt2_string(i:i) = opt2_string(1:1)
+	   ENDIF
+	   DO 220 i = 1, 4
+	      IF ( opt2_string(i:i) .EQ. 'C' ) THEN
+	         ssorww(i) = by_ww
+	      ELSEIF ( opt2_string(i:i) .EQ. 'I' ) THEN
+	         ssorww(i) = by_ss
+	      ELSEIF ( opt2_string(i:i) .EQ. 'N' ) THEN
+	         ssorww(i) = by_nothin
+	      ELSE
+	         GOTO 5400
+	      ENDIF
+ 220	   CONTINUE
+	ENDIF
+
+* narrow the ssorww choices if only a bad_flag was given for a coord
+	DO 250 i = 2,5
+	   IF ( cxpts(i).EQ.1 .AND. ( memory(1,mr_blk1(mr_list(i)))
+     .		.EQ. mr_bad_data(mr_list(i)) )  ) ssorww(i-1) = by_nothin
+ 250	CONTINUE
+
+* make sure the field of data provided doesn't create ambiguities on the
+* unsampled axes  (i.e. multiple points provided but no sampling coordinates)
+	cx = cx_list(1)
+	DO 300 i = 1, 4
+	   IF ( ssorww(i) .EQ. by_nothin
+     .	   .AND. CX_DIM_LEN(i, cx) .GT. 1 ) GOTO 5500
+ 300	CONTINUE	
+
+* make sure there is no attempt to sample on a normal axis
+	DO 400 i = 1, 4
+	   IF ( ssorww(i) .NE. by_nothin
+     .	   .AND. cx_lo_ss(cx,i) .EQ. unspecified_int4 ) GOTO 5700
+ 400	CONTINUE	
+
+* insert the default filename based on format type
+* or prepare for terminal output
+	IF ( file_given ) THEN
+	   IF ( fname .EQ. ' ' ) THEN
+	      IF ( binary ) THEN
+	         fname = 'fer_sample.unf'
+	      ELSE
+	         fname = 'fer_sample.dat'
+	      ENDIF
+	   ENDIF
+	ENDIF
+	IF ( .NOT.binary .AND. fmt.EQ.' ' )
+     .			fmt = '(5(1PG14.6),0PF5.0)'   ! "0P" for DEC bug
+	flen = TM_LENSTR1( fname )
+	fmlen = TM_LENSTR1( fmt )
+
+* allocate memory for consolidated 4D coordinates
+	CALL GET_MEMORY( npts*4, mblk1, nblks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* allocate memory for output record buffer if needed
+	IF ( columns .GT. 0 ) THEN
+	   CALL GET_MEMORY( columns, col_mblk1, col_nblks, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ELSE
+	   col_mblk1 = 1	! dummy, unused
+	ENDIF
+
+* Open the output file
+	IF ( file_given ) THEN
+	   IF ( fmt .EQ. ' ' ) THEN
+	      OPEN( UNIT        = default_list_lun,
+     .              FILE        = fname,
+     .              FORM        = 'UNFORMATTED',
+#ifdef NO_ACCESS_APPEND	
+#else
+#ifdef F90_OPEN_FILE_APPEND
+     .		    POSITION    = 'APPEND',
+#else
+     .              ACCESS      = 'APPEND',
+#endif
+#endif
+     .              STATUS      = 'UNKNOWN',
+     .              ERR         = 5600 )
+!	      WRITE (ttout_lun, 3000) 'binary', fname(:flen)
+	   ELSE
+	      OPEN( UNIT        = default_list_lun,
+     .              FILE        = fname,
+     .              FORM        = 'FORMATTED',
+#ifdef NO_ACCESS_APPEND	
+#else
+#ifdef F90_OPEN_FILE_APPEND
+     .		    POSITION    = 'APPEND',
+#else
+     .              ACCESS      = 'APPEND',
+#endif
+#endif
+     .              STATUS      = 'UNKNOWN',
+     .              ERR         = 5600 )
+!	      WRITE (ttout_lun, 3000) 'ASCII', fname(:flen)
+	   ENDIF
+! 3000	   FORMAT (' Sampled output is in ',A,' file ',A)
+	   out_lun = default_list_lun
+	ELSE
+	   out_lun = ttout_lun
+	ENDIF
+
+* call the SAMPLing work routine
+	CALL SAMPLE_SUB( memory, cx_list(2), mr_list(2), npts, cxpts,
+     .	memory(1, mr_blk1(mr_list(1))), mr_list(1), cx_list(1),
+     .	missing,
+     .	memory(1, mblk1), memory(1, col_mblk1), 
+     .  fmt(1:fmlen), fill, ssorww,
+     .	out_lun, binary, columns, status )
+     
+* close the output file
+	IF ( file_given ) CLOSE(UNIT=out_lun, ERR=5600)
+
+* cleanup
+ 1000	CALL FREE_MEMORY( mblk1, nblks )
+	IF ( columns .GT. 0 ) THEN
+	   CALL FREE_MEMORY( col_mblk1, col_nblks )
+	ENDIF
+	RETURN
+
+* error exits
+ 5000	RETURN
+#ifdef NO_PASSED_CONCAT
+ 5100	risc_buff = opt1_string(:slen)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .		    '/OPT1='//risc_buff//pCR//
+     .		    'May be "FILL" or "HOLES" with "STANDARD_BAD"',
+     .		     *5000 )
+#else
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		    '/OPT1='//opt1_string(:slen)//pCR//
+     .		    'May be "FILL" or "HOLES" with "STANDARD_BAD"',
+     .		     *5000 )
+#endif
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		    'arguments must be field,xpts,ypts,zpts,tpts', *5000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		    '# of X,Y,Z, and T coordinates must each be same or 1',
+     .		    *5000 )
+#ifdef NO_PASSED_CONCAT
+ 5400   risc_buff = opt2_string(:slen)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .   '/OPT2='//risc_buff//pCR//
+     .   'Must be xxxx - 4 letters of "C"(coord),'
+     .   //' "I"(index) or "N"(N/A)',
+     .		    *5000 )
+#else
+ 5400	CALL ERRMSG( ferr_invalid_command, status,
+     .   '/OPT2='//opt2_string(:slen)//pCR//
+     .   'Must be xxxx - 4 letters of "C"(coord),'
+     .   //' "I"(index) or "N"(N/A)',
+     .		    *5000 )
+#endif
+ 5500	buff = VAR_TRANS(i, cx, slen )
+	CALL ERRMSG( ferr_invalid_command, status,
+     .  'Sampling of '//buff(:slen)//' is ambiguous on '//
+     .	ww_dim_name(i)//' axis', *5000 )
+ 5600	CALL ERRMSG( ferr_erreq,status,fname,*1000 )
+ 5700	buff = VAR_TRANS(i, cx, slen )
+	CALL ERRMSG( ferr_invalid_command, status,
+     .  'Attempt to sample normal '//ww_dim_name(i)//' axis of '//
+     .  buff(:slen), *5000 )
+
+	END
+
diff --git a/fer/gnl/sample_sub.F b/fer/gnl/sample_sub.F
new file mode 100644
index 0000000..4700313
--- /dev/null
+++ b/fer/gnl/sample_sub.F
@@ -0,0 +1,346 @@
+	SUBROUTINE SAMPLE_SUB(  memory, cx_list, mr_list, npts, cxpts,
+     .				field, mfield, cxfield, fill_value,
+     .				coords, out_buf,
+     .				fmt, fix_holes, ssorww,
+     .				out_lun, binary, columns, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sample the given field at the specified XYZTEF coordinates
+
+* Each output record will consist of
+*	value xcoord ycoord zcoord tcoord code
+* where "code" is 0=fully successful
+*		  1=successful with extrapolation
+*              -1-4=failed due to beyond input data limits on axis -code
+*		 -9=failed due to hole in input data field
+*		-99=failed due to hole in input coordinates
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V301:  1/94
+* V312: 5/94 - array "memory" as a calling argument
+* V541: 2/02 *sh* - added support for modilo lengths
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xmem_subsc.cmn'
+
+* calling argument declarations:
+	LOGICAL fix_holes, binary
+	INTEGER	cx_list(4), mr_list(4), npts, cxpts(4), columns,
+     .		mfield, cxfield, ssorww(4), out_lun, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+	REAL	coords(npts, 4), out_buf(columns), fill_value,
+     .		field( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit )
+	CHARACTER fmt*(*)
+
+* internal parameter definitions
+	INTEGER     by_ss, by_ww, by_nothin
+	PARAMETER ( by_ss=1, by_ww=2, by_nothin=0 )
+
+* internal variable declarations:
+	LOGICAL	extrapolate, condensed
+	INTEGER	TM_MODULO_LINE_DIM,
+     .		ii(4), di(4), ss(4,2), grid, idim, mr, mv_temp, ipt,
+     .		i, j, k, l, ix, jy, kz, lt, hi_surrnd(4), nbuf, llen,
+     .		nfix, ssfix(4,-1:1), ssp1(4), ssm1(4), line, lohi
+	REAL lin_fact(4), surrnd(2,2,2,2), result, missing, res_flag,
+     .		coord, missing_coord(4), sumfix
+	
+* equivalences
+	INTEGER ss_lo(4), ss_hi(4), ihi, jhi, khi, lhi
+	EQUIVALENCE (ss(1,1),ss_lo), (ss(1,2),ss_hi),
+     .		    (hi_surrnd(1), ihi), (hi_surrnd(2), jhi),
+     .		    (hi_surrnd(3), khi), (hi_surrnd(4), lhi)
+
+* *** INITIALIZE ***
+* background quantities
+	condensed = columns .GT. 0
+	nbuf = 0
+	missing = mr_bad_data(mfield)
+	grid = mr_grid(mfield)
+	DO 10 idim = 1, 4
+ 10	missing_coord(idim) = mr_bad_data(mr_list(idim))
+
+* extract the 4 coordinate variables into a single 4D array
+	DO 100 idim = 1, 4
+	   mr = mr_list(idim)
+	   CALL CREATE_TEMP_MEM_VAR( cx_list(idim), mv_temp, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   CALL COPY_GRID(memory(1,mr_blk1(mr)),mr,
+     .		          coords(1,idim), mv_temp )
+	   CALL DELETE_VARIABLE( mv_temp )
+ 100	CONTINUE
+
+* input sampling coordinates are a mix of single point and n point arrays
+* ... ii - sample coordinate pointers (increment by delta each loop)
+* ... di - delta for sample coordinate pointer (0 or 1)
+	DO 200 idim = 1, 4
+	   ii(idim) = 1
+	   IF ( cxpts(idim) .EQ. 1 ) THEN
+	      di(idim) = 0
+	   ELSE
+	      di(idim) = 1
+	   ENDIF
+ 200	CONTINUE
+
+* prepare those axes on which there will be no interpolating
+* ... hi_surrnd - # of pts surrounding requested coord on each axis (1 or 2)
+* ... also preload the subscript limits to avoid redoing it npts times below
+	DO 210 idim = 1, 4
+	   IF ( ssorww(idim) .EQ. by_nothin ) THEN
+	      hi_surrnd(idim) = 1		! no interp on this axis
+	      ss_lo(idim) = cx_lo_ss(cxfield, idim)
+	      ss_hi(idim) = ss_lo(idim)			! needed to automate
+	      lin_fact(idim) = unspecified_int4		! not needed
+	   ELSE
+	      hi_surrnd(idim) = 2		! interpolate on this axis
+	      ss_lo(idim) = unspecified_int4
+	   ENDIF
+ 210	CONTINUE
+
+* *** START OF LOOP OVER ALL SAMPLING POINTS ***
+	DO 2000 ipt = 1, npts
+
+* initialize next sample point
+	   res_flag = 0.
+
+* determine the lo and hi subscript bounds of the surrounding points
+* and the interpolation cooeficients for each axis
+	   DO 500 idim = 1, 4
+	      coord = coords(ii(idim), idim)
+	      IF ( ssorww(idim) .NE. by_nothin
+     .	     .AND. coord .EQ. missing_coord(idim) ) THEN
+	         res_flag = -idim
+	         result = fill_value
+	         GOTO 1000
+	      ELSEIF ( ssorww(idim) .EQ. by_ss ) THEN   ! e.g. j=55.2
+	         ss_lo(idim) = INT( coord )
+	         ss_hi(idim) = INT( coord + .99999 )
+	         lin_fact(idim) = ss_hi(idim) - coord
+	      ELSEIF ( ssorww(idim) .EQ. by_ww ) THEN
+	         CALL SS_NEIGHBORS( coord, grid, idim, extrapolate,
+     .				ss_lo(idim), ss_hi(idim), lin_fact(idim) )
+	         IF ( extrapolate ) THEN
+	            IF ( fix_holes ) THEN
+	               res_flag = 1.
+	            ELSE
+	               res_flag = -idim
+	               result = fill_value
+	               GOTO 1000
+	            ENDIF
+	         ENDIF
+	      ENDIF
+ 500	   CONTINUE
+
+* check that all subscripts are within the given range of the field
+	   DO 600 idim = 1, 4
+	      IF ( ss_lo(idim) .LT. cx_lo_ss(cxfield, idim)
+     .	      .OR. ss_hi(idim) .GT. cx_hi_ss(cxfield, idim)
+     .        .OR. ss_lo(idim) .GT. ss_hi(idim)  ) THEN
+	         res_flag = -idim
+	         result = fill_value
+	         GOTO 1000
+	      ENDIF
+ 600	   CONTINUE
+
+* pre-cleanse array if diagnostic testing in progress
+	   IF ( mode_diagnostic ) THEN
+	      DO 650 i = 1, ihi
+	      DO 650 j = 1, jhi
+	      DO 650 k = 1, khi
+	      DO 650 l = 1, lhi
+ 650	      surrnd(i,j,k,l) = bad_val4
+	   ENDIF
+
+* assemble the 4-dimensional collection of surrounding points
+	   DO 700 i = 1, ihi
+	   DO 700 j = 1, jhi
+	   DO 700 k = 1, khi
+	   DO 700 l = 1, lhi
+ 700	   surrnd(i,j,k,l) = field(ss(x_dim,i),
+     .				      ss(y_dim,j),
+     .				      ss(z_dim,k),
+     .				      ss(t_dim,l) )
+! diag	WRITE (6,'(A/,4(1PG15.6))') ' Surrounding: ',surrnd
+
+* check for missing values - try to fill them in if requested
+	   DO 850 l = 1, lhi
+	   DO 850 k = 1, khi
+	   DO 850 j = 1, jhi
+	   DO 850 i = 1, ihi
+	      IF ( surrnd(i,j,k,l) .EQ. missing ) THEN
+	         IF ( fix_holes ) THEN
+* ... Try to fill hole with the average of all surrounding values
+*     Procedure is to locate the subscripts surrounding the missing point
+*     that may contain valid data and to average all of the data found.
+*     The axes may be modulo - in which case wrap around the subscripts.
+*     The supplied data (context) may or may not provide the surrounding pts   
+	            nfix = 0
+	            sumfix = 0.0		
+	            DO 800 idim =  1, 4
+	            DO 800 lohi = -1, 1
+ 800	            ssfix(idim,lohi) = ss(idim,i) + lohi
+	            DO 810 idim = 1, 4    	 ! modulo-based subscripts
+	               line = grid_line(idim,grid)
+	               llen = TM_MODULO_LINE_DIM(line)
+	               IF ( line.EQ.mnormal .OR. line.EQ.munknown ) GOTO 810
+	               IF ( line_modulo(line) ) THEN
+		          IF ( ssfix(idim,-1) .EQ. 0 )
+     .					ssfix(idim,-1) = llen
+		          IF ( ssfix(idim,+1) .GT. llen )
+     .					ssfix(idim,+1) = 1
+	               ENDIF
+ 810	            CONTINUE
+	            DO 820 idim = 1, 4		! check context limits
+	               IF (ssfix(idim,-1).LT.cx_lo_ss(cxfield,idim)
+     .		       .OR.ssfix(idim,-1).GT.cx_hi_ss(cxfield,idim) ) THEN
+	                  ssm1(idim) = 0
+	               ELSE
+	                  ssm1(idim) = -1
+	               ENDIF
+	               IF (ssfix(idim,+1).LT.cx_lo_ss(cxfield,idim)
+     .		       .OR.ssfix(idim,+1).GT.cx_hi_ss(cxfield,idim) ) THEN
+	                  ssp1(idim) = 0
+	               ELSE
+	                  ssp1(idim) = +1
+	               ENDIF
+ 820	            CONTINUE
+	            DO 830 lt = ssfix(t_dim,ssm1(t_dim)),
+     .				ssfix(t_dim,ssp1(t_dim))
+	            DO 830 kz = ssfix(z_dim,ssm1(z_dim)),
+     .				ssfix(z_dim,ssp1(z_dim))
+	            DO 830 jy = ssfix(y_dim,ssm1(y_dim)),
+     .				ssfix(y_dim,ssp1(y_dim))
+	            DO 830 ix = ssfix(x_dim,ssm1(x_dim)),
+     .				ssfix(x_dim,ssp1(x_dim))
+	               IF ( field(ix,jy,kz,lt) .NE. missing ) THEN
+	                  nfix = nfix + 1
+	                  sumfix = sumfix +  field(ix,jy,kz,lt)
+	               ENDIF
+ 830	            CONTINUE
+	            IF ( nfix .GT. 0 ) THEN
+	               surrnd(i,j,k,l) = sumfix/nfix
+	               res_flag = 1.
+	            ELSE
+	               res_flag = -9.
+	               result = fill_value
+	               GOTO 1000  
+	            ENDIF
+	         ELSE
+* ... dont even try to fill the hole
+	            res_flag = -9.
+	            result = fill_value
+	            GOTO 1000
+	         ENDIF
+	      ENDIF
+ 850	   CONTINUE
+
+* compute the interpolated value from the fully-specified surrounding points
+* ... interpolate on T axis 
+	   IF (ssorww(t_dim) .NE. by_nothin) THEN
+	      DO 910 i = 1,ihi
+	      DO 910 j = 1,jhi
+	      DO 910 k = 1,khi
+ 910	      surrnd(i,j,k,1) =   lin_fact(t_dim)  * surrnd(i,j,k,1)
+     .			    + (1.-lin_fact(t_dim)) * surrnd(i,j,k,2)
+	   ENDIF
+* ... interpolate on Z axis 
+	   IF (ssorww(z_dim) .NE. by_nothin) THEN
+	      DO 920 i = 1,ihi
+	      DO 920 j = 1,jhi
+ 920	      surrnd(i,j,1,1) =   lin_fact(z_dim)  * surrnd(i,j,1,1)
+     .			    + (1.-lin_fact(z_dim)) * surrnd(i,j,2,1)
+	   ENDIF
+* ... interpolate on Y axis 
+	   IF (ssorww(y_dim) .NE. by_nothin) THEN
+	      DO 930 i = 1,ihi
+ 930	      surrnd(i,1,1,1) =   lin_fact(y_dim)  * surrnd(i,1,1,1)
+     .			    + (1.-lin_fact(y_dim)) * surrnd(i,2,1,1)
+	   ENDIF
+* ... interpolate on X axis 
+	   IF (ssorww(x_dim) .NE. by_nothin) THEN
+	      surrnd(1,1,1,1) =   lin_fact(x_dim)  * surrnd(1,1,1,1)
+     .			    + (1.-lin_fact(x_dim)) * surrnd(2,1,1,1)
+	   ENDIF
+	   result = surrnd(1,1,1,1)
+
+* output the result
+ 1000	   IF ( binary ) THEN
+	      IF ( condensed ) THEN
+	         nbuf = nbuf + 1
+	         out_buf(nbuf) = result
+	         IF ( nbuf .EQ. columns ) THEN
+	            WRITE ( out_lun ) out_buf
+	            nbuf = 0
+	         ENDIF
+	      ELSE
+	         WRITE ( out_lun ) result,
+     .				(coords(ii(i),i),i=1,4), res_flag
+	      ENDIF
+	   ELSE
+	       WRITE ( out_lun, fmt ) result,
+     .				(coords(ii(i),i),i=1,4), res_flag
+	   ENDIF
+	
+! diag	   WRITE (6,*) 'Result: ',result
+! diag	   WRITE (6,*) 'lo/hi subscripts: ',((ss(idim,i),i=1,2),idim=1,4)
+! diag	   WRITE (6,*) 'factors: ',lin_fact
+
+* prepare for the next sample point
+	   DO 1100 idim = 1, 4
+ 1100	   ii(idim) = ii(idim) + di(idim)
+
+ 2000	CONTINUE
+
+* check for any output remaining in the output record buffer
+	IF ( condensed .AND. nbuf.GT.0 ) 
+     .		CALL WARN( 'Output columns didnt match sampling coordinates')
+
+* success!
+	RETURN
+
+* error exits
+ 5000	RETURN
+
+	END
diff --git a/fer/gnl/save_ppl_memory_size.F b/fer/gnl/save_ppl_memory_size.F
new file mode 100644
index 0000000..505fe24
--- /dev/null
+++ b/fer/gnl/save_ppl_memory_size.F
@@ -0,0 +1,56 @@
+	SUBROUTINE SAVE_PPL_MEMORY_SIZE ( insize )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* put PPL memory size into common.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V544: 9/02 *acm* 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+        include 'PPLDAT.INC'
+
+* calling argument declarations:
+	INTEGER insize
+
+* save the size for PPLUS memory.  
+
+        pplmem_nsize = insize
+
+	RETURN
+	END
diff --git a/fer/gnl/save_scriptfile_name.F b/fer/gnl/save_scriptfile_name.F
new file mode 100644
index 0000000..a2b0700
--- /dev/null
+++ b/fer/gnl/save_scriptfile_name.F
@@ -0,0 +1,90 @@
+        SUBROUTINE save_scriptfile_name(name, clen, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*        Ansley Manke PMEL/TMAP
+*        8/2003  (based on save_metafile_name)
+**       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Put script file name into common, for running with the comand line option
+*  ferret -script 
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'tmap_errors.parm'
+        INCLUDE 'xprog_state.cmn'
+        
+
+* calling argument declarations:
+        INTEGER clen, status
+#ifdef sun
+        BYTE name(clen) 
+#else   
+        INTEGER*1 name(clen)
+#endif  
+
+* Local variable declarations
+
+        CHARACTER TM_INQ_PATH*2048, cbuff*2048, sname*2048
+
+        LOGICAL TM_HAS_STRING
+        INTEGER ok, TMAP_status
+
+        CALL tm_ctof_strng(name, sname, clen)
+        scriptfile_name(1:clen) = sname
+
+! Save the state, running with -script switch
+
+        its_script = .TRUE.
+
+        IF (TM_HAS_STRING(sname, '.jnl')) THEN
+           ok = 1
+        ELSE 
+           scriptfile_name(clen+1:clen+4) = '.jnl'
+           clen = clen + 4
+        ENDIF
+
+! See if the file exists
+
+        cbuff = TM_INQ_PATH (scriptfile_name(1:clen), 'FER_GO',
+     .                       '.jnl', .TRUE., TMAP_status)
+
+        IF ( TMAP_status .NE. merr_ok ) status = 0
+
+
+ 5000	RETURN
+        END
+
diff --git a/fer/gnl/set_var.F b/fer/gnl/set_var.F
new file mode 100644
index 0000000..4ba5330
--- /dev/null
+++ b/fer/gnl/set_var.F
@@ -0,0 +1,703 @@
+	SUBROUTINE SET_VAR( vname, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a SET VARIABLE on a variable from a data set of type EZ
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/23/89
+* 	 3/26/90 - renamed from SET_EZ_VAR.  Allowed user-defined vars
+* V230:  7/23/92 - trap attempts to set units on user variable
+*       10/22/92 - added units on uvars  (increased units string to 24 chars)
+*        11/9/92 - made units and title case-sensitive
+* V402: 7/95 - use PARSE_NAM_DSET instead of PARSE_NAM_DSET_GRD so the
+*		grid is never determined and the underlying uvar defn need
+*		not be based on variables that are valid at this moment
+* V420: 10/95 - can apply SET VARIABLE/BAD=/UNIT=/TITLE= to GT and CDF files
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V510 5/00 *sh* - allow SET VARIABLE/BAD applied to user variables
+*		 - on file variables (e.g. netCDF) interchange the 2 missing
+*		   flags so that the output will inherit the manually set value
+* V533 6/01 *sh* - added SET VARIABLE/NAME
+*		 - increased units char buffer to 64
+
+* v533 9/01 *acm*- Check that SET VARIABLE/NAME doesnt give a name already in the dataset
+*                - and that not using a variable from a GT or TS data set
+* V552: 4/03 *acm* - add SET VARIABLE/SCALEFAC/OFFSET
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+* v553: 7/03 *kob* - Add SET VARIABLE/bad=NaN ability
+* V600:11/05 *acm* - issue error for SET VAR/SCALE/OFFSET if dset = -111 
+* V600: 2/06 *acm* - For attribute-access additions, add new SET VAR/OUTTYPE=
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* v600  4/06 *acm* - Change the call to set_nan from a float function to void, passing
+*                    back the result as an argument. Needed for port to 64-bit 
+* V601 10/06 *acm* - When units, title, or missing is set, change the corresponding
+*                    value or string in the attribute linked-list structure.
+* V608 11/07 *acm* - If doing SET VAR/UNITS, /TITLE, /BAD on a a user variable,
+*                    and that attribute was not previously set, add it.
+* V616  1/09 *acm* - Fix ticket 1615, If doing SET VAR/UNITS, /TITLE, /BAD on a
+*                    var from an EZ dataset, set the appropriate attributes.
+* V619  2/09 *acm* - Fix SET VAR/OUTTYPE= when the variable is a user var that
+*                    yet has dset=n.
+* V630  9/09 *acm* - Fix bug 1646: write the attribute Ferret_Precision_Note, when
+*                    converting to Double from another data type, but only if the
+*                    attribute isnt already there.
+* V64  10/09 *acm* longer string length for grid_name
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V683 8/12  *acm* Move writing of notes about output precision to cdf_list.F
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+* V690 *sh* 1/14   Added SET VARIABLE/SIGMA=varname
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+        include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+        include 'netcdf.inc'
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER	vname*(*)
+
+* internal variable declarations:
+	LOGICAL		VALID_GRID, TM_LEGAL_NAME, TM_HAS_STRING,
+     .                  have_mods, ez, gtts, ncfile, coordvar
+	INTEGER		GRID_FROM_NAME, TM_LENSTR1, STR_UPCASE, mod_cx,
+     .			i, dset, grid, cat, var, loc, TMAP_status, 
+     .			testvar, outtype_flag, varid, attid, attype, attlen, 
+     .			attoutflag, vartype, nvdims, nvatts, vdims(8), 
+     .			varoutflag, cx, idum
+	REAL		bad, scalefac, offset, val, dummy
+	CHARACTER	grid_name*64, title*128, units*128, newname*128,
+     .                  is_nan*3, flag*10, typflag*10, varattname*512,
+     .                  varname*128, attname*128, buf*2, newname_lc*128,
+     .			sigma_ref*128
+
+* Initialize
+
+	grid      = unspecified_int4
+	bad       = real4_init
+	scalefac  = real4_init
+	offset    = real4_init
+        have_mods = .FALSE.
+        gtts      = .FALSE.
+        ncfile    = .FALSE.
+        ez        = .FALSE.
+	newname   = char_init128
+	title     = char_init128
+	units     = char_init64
+	grid_name = char_init16
+	sigma_ref = char_init128
+
+* note:  this routine manages 
+
+* decode specified variable name of form VNAME[D=dset]
+	dset = unspecified_int4			! default is global variable
+	CALL PARSE_NAM_DSET( vname, cx_last, dset,
+     .			     cat, var, mod_cx, status )
+* ... RISC FORTRAN bug prevents "//" on char*(*) variable vname
+	risc_buff = vname
+	len_rbuff = LEN(vname)
+	IF ( status .NE. ferr_ok ) RETURN
+	IF ( var .EQ. munknown_var_name ) GOTO 5005
+
+* May be an EZ or user-defined variable
+	IF ( cat .EQ. cat_file_var ) THEN
+	   ez = ds_type(dset) .EQ. pds_type_ez
+!	   IF ( .NOT. ez ) GOTO 5010		! removed restriction 10/95
+	ELSEIF ( cat .EQ. cat_user_var ) THEN   ! uvars bad, too, until 10/92
+           ez = .FALSE.
+	ELSE
+	   GOTO 5015
+	ENDIF
+
+* process qualifiers given
+
+* SET VAR/NAME=
+
+	loc = qual_given( slash_set_var_name )
+	IF ( loc .GT. 0 ) THEN
+
+* SET VAR/NAME does not work for GT, TS datasets where sanity check is done
+* in gt_find_rec.F comparing var name to the name in the dataset.
+
+	   IF (dset .GT. 0) THEN
+	      gtts = ( (ds_type(dset) .EQ. pds_type_gt)  .OR. 
+     .              (ds_type(dset) .EQ. pds_type_ts) )
+	      IF ( gtts ) GOTO 5600
+	   ENDIF
+
+	   have_mods = .TRUE.
+           CALL EQUAL_STR_LC 
+     .             ( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .               newname_lc, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   status = STR_UPCASE (newname, newname_lc)
+
+* check that the name isnt already in the data set.
+           CALL FIND_VAR_NAME ( dset, newname, idum, testvar )
+	   len_rbuff = TM_LENSTR1(newname_lc)
+           IF (  testvar .NE. munknown_var_name ) GOTO 5400
+
+	   IF ( .NOT.TM_LEGAL_NAME(newname) ) THEN
+	      risc_buff = vname
+	      len_rbuff = LEN(vname)
+              GOTO 5200
+           ENDIF
+	ELSE
+	   newname = char_init128
+	ENDIF
+
+* SET VAR/SCALEFAC only for NetCDF datasets
+
+	loc = qual_given( slash_set_var_scale )
+	IF ( loc .GT. 0 ) THEN
+
+           IF (dset .EQ. unspecified_int4) GOTO 5700
+	   ncfile = (TM_HAS_STRING(ds_type(dset), 'CDF') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'MC') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'ENS') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'GT')  )
+	   IF ( .NOT. ncfile ) GOTO 5700
+
+	   have_mods = .TRUE.
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   scalefac, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   scalefac = real4_init
+	ENDIF
+
+* SET VAR/OFFSET only for NetCDF datasets
+
+	loc = qual_given( slash_set_var_offset )
+	IF ( loc .GT. 0 ) THEN
+
+           IF (dset .EQ. unspecified_int4) GOTO 5700
+	   ncfile = (TM_HAS_STRING(ds_type(dset), 'CDF') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'MC') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'ENS') .OR.
+     .               TM_HAS_STRING(ds_type(dset), 'GT')  )
+	   IF ( .NOT. ncfile ) GOTO 5800
+
+	   have_mods = .TRUE.
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   offset, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   offset = real4_init
+	ENDIF
+
+* SET VAR/TITLE=
+
+	loc = qual_given( slash_set_var_title )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      title, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   title = char_init80
+	ENDIF
+
+* SET VAR/UNITS=
+
+	loc = qual_given( slash_set_var_unit )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      units, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   units = char_init16
+	ENDIF
+
+* SET VAR/GRID=
+
+	loc = qual_given( slash_set_var_grid )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      grid_name, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   grid = GRID_FROM_NAME( grid_name, cx_last, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   IF ( .NOT.VALID_GRID( grid ) ) GOTO 5500
+	ELSE
+	   grid = int4_init
+	ENDIF
+
+* SET VAR/BAD=
+
+	loc = qual_given( slash_set_var_bad )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+* *kob* 7/03 - Add check for bad=NaN
+	   CALL EQUAL_STRING (cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                         is_nan, status)
+           IF ( status .NE. ferr_ok ) RETURN     ! *sh* 1/14 added status check
+	   IF (is_nan .EQ. ' ') GOTO 5550
+	   IF (TM_HAS_STRING(is_nan, 'NaN')) THEN
+              CALL SET_NAN(bad)
+	   ELSE
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   bad, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	   ENDIF
+	ELSE
+	   bad = real4_init
+	ENDIF
+
+* SET VAR/SIGMA=
+* creates an attribute __sigma_ref_ that contains the desired auxiliary variable name
+	loc = qual_given( slash_set_var_sigma )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+	   CALL EQUAL_STRING (cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        sigma_ref, status)
+           IF ( status .NE. ferr_ok ) RETURN
+	   IF (sigma_ref .EQ. ' ') GOTO 5550
+	   IF ( .NOT.TM_LEGAL_NAME(sigma_ref) ) GOTO 5560
+	ENDIF
+
+* SET VAR/OUTTYPE= INTYPE, FLOAT, INT, SHORT
+
+	loc = qual_given( slash_set_var_outtype )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      flag, status )
+           IF ( status .NE. ferr_ok ) RETURN
+           i = STR_UPCASE (typflag, flag)
+
+           IF (typflag(1:5) .EQ. 'INPUT'  ) THEN   ! input type
+              outtype_flag = 99  ! do not change from incoming type
+           ELSE IF (typflag(1:3) .EQ. 'BYT' .OR. typflag(1:4) .EQ. 'INT1') THEN
+              outtype_flag = 1   ! NC_BYTE
+           ELSE IF (typflag(1:3) .EQ. 'SHO' .OR. typflag(1:4) .EQ. 'INT2') THEN
+              outtype_flag = 3   ! NC_SHORT
+           ELSE IF (typflag(1:3) .EQ. 'INT' .OR. typflag(1:4) .EQ. 'INT4') THEN
+              outtype_flag = 4   ! NC_INT (4-byte integer)
+           ELSE IF (typflag(1:3) .EQ. 'FLO' .OR. typflag(1:3) .EQ. 'REA') THEN
+              outtype_flag = 5   ! NC_FLOAT
+           ELSE IF (typflag(1:3) .EQ. 'DOU') THEN
+              outtype_flag = 6   ! NC_DOUBLE
+           ELSE
+              GOTO 5900
+           ENDIF
+
+* get dataset from varname.attname
+* evaluate the context without computing the expression to get the dataset
+
+           IF (dset .EQ. unspecified_int4) THEN
+
+	      IF (cat .EQ. cat_user_var) THEN 
+	         dset = -1
+	      ELSE
+
+                 CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+                 CALL EVAL_CONTEXT ( cx_cmnd, varattname, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+
+                 cx = is_cx( 1 )
+                 dset = cx_data_set(cx) 
+                 IF (dset .EQ. pdset_irrelevant) THEN
+                    dset = cx_data_set(cx_last) 
+                    cx = cx_last
+                 ENDIF
+
+              ENDIF
+
+           ENDIF
+
+* Make sure we have varid for varname, then reset the variable type.
+
+           CALL CD_GET_VAR_ID (dset, vname, varid, status)
+	   
+           IF  (cat .EQ. cat_user_var) THEN 
+	      dset = -1
+  	      CALL CD_GET_VAR_ID (dset, vname, varid, status)
+           ENDIF
+
+* Get input type, store in variable outtype_flag
+           IF (outtype_flag .EQ. 99) THEN
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, 
+     .                  nvdims, vdims, nvatts, coordvar, varoutflag, 
+     .                  status) 
+              outtype_flag = vartype 
+           ENDIF
+
+           CALL CD_SET_VAR_TYPE (dset, varid, outtype_flag, status )
+           IF (status .NE. ferr_ok) GOTO 5000
+
+        ENDIF
+
+* Apply the changes in Ferret structures, and in the linked-list structure.
+
+        IF (dset .EQ. unspecified_int4) dset = -1 ! user variable
+        CALL CD_GET_VAR_ID (dset, vname, varid, status)
+
+
+* note on EZ vars:
+* modifying the variable info invalidates data in memory
+*        the purging of memory variables below is unnecessarily strict in both
+*	 the uvar and fvar cases.  FVAR's can be modified in memory to change
+*	 mr_grid, units, etc.  They need to be deleted only if they were on 
+* 	 non-standard grids or units.  The UVAR's need to be purged only if
+*	 they depend on the FVAR being changed)
+	IF ( ez ) THEN
+	   IF ( have_mods ) THEN
+
+* The following block of code -- setting the sigma reference -- appears identically
+* in 3 places.  Similar duplication of code for the other attributes.
+* The reason is that the management of dset and varid is context dependent.
+* CD_GET_VAR_ID is for example called 3 times immediately preceding this block
+* Cleanup would be desirable: a single, reliable routine that returns varid;
+* called just once; and then factor out the duplicated code
+	      IF ( sigma_ref .NE. char_init128 ) THEN
+                 attlen = TM_LENSTR1(sigma_ref)
+                 attname = patnam_sigma
+                 CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+                 IF (attid .GT. 0) THEN
+                    CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .                attname, attype, attlen, attoutflag, status )
+                    CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .              sigma_ref, dummy, status)
+                 ELSE
+                    attype = NCCHAR
+                    attoutflag = 1
+                    CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .                 attlen, attoutflag, sigma_ref, dummy, status )
+                 ENDIF
+              ENDIF
+
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+	      CALL EZ_MOD_VARS( dset,var,varid,
+     .			        newname,title,units,grid,bad,tmap_status )
+	      IF ( tmap_status .NE. merr_ok ) THEN
+	         status = ferr_TMAP_error
+	         RETURN
+	      ENDIF
+	   ENDIF
+
+	ELSEIF ( cat .EQ. cat_file_var ) THEN
+* ... other file variables (10/95)
+	   IF ( grid .NE. int4_init   ) GOTO 5112
+	   IF ( bad  .NE. real4_init  ) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+	      ds_missing_flag(var) = ds_bad_flag(var)	      
+              ds_bad_flag    (var) = bad
+
+              attlen = 1
+              attname = 'missing_value'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+              ENDIF
+              attname = '_FillValue'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+              ENDIF
+
+	   ENDIF
+*	   IF (newname.NE. char_init16 ) ds_var_code ( var ) = newname
+	   IF (newname.NE. char_init128 )
+     .         CALL string_array_modify( ds_var_code_head, var,
+     .                                   newname, LEN(newname))
+
+	   IF ( units .NE. char_init16 ) THEN
+              ds_var_units( var ) = units
+
+              attlen = TM_LENSTR1(units)
+              attname = 'units'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           units, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, units, dummy, status )
+              ENDIF
+           ENDIF
+
+	   IF ( title .NE. char_init128 ) THEN  ! changed from char_init80 1/14
+              ds_var_title( var ) = title
+
+              attlen = TM_LENSTR1(title)
+              attname = 'long_name'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           title, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, title, dummy, status )
+              ENDIF
+           ENDIF
+
+	   IF ( sigma_ref .NE. char_init128 ) THEN
+              attlen = TM_LENSTR1(sigma_ref)
+              attname = patnam_sigma
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           sigma_ref, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, sigma_ref, dummy, status )
+              ENDIF
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+           ENDIF
+
+           IF (scalefac .NE. real4_init .AND. ncfile) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+              ds_var_scale(var) = scalefac
+              ds_var_scaleit(var)       = .TRUE.
+           ENDIF
+           IF (offset .NE. real4_init .AND. ncfile) THEN
+	      CALL PURGE_FILE_VAR( var ) ! remove memory-resident variables
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+              ds_var_off(var)   = offset
+              ds_var_scaleit(var)       = .TRUE.
+           ENDIF
+	ELSE
+
+* ... user-defined var
+	   IF ( grid .NE. int4_init   ) GOTO 5110
+*	   IF (newname.NE. char_init16 ) uvar_name_code(var)= newname
+	   IF (newname.NE. char_init128 ) 
+     .         CALL string_array_modify(uvar_name_code_head,
+     .                                  var,
+     .                                  newname,
+     .                                  LEN(newname))
+
+           dset = -1 ! user variables
+           CALL CD_GET_VAR_ID (dset, vname, varid, status)
+
+	   IF ( units .NE. char_init16 ) THEN
+              uvar_units( var )  = units
+
+              attlen = TM_LENSTR1(units)
+              attname = 'units'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           units, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, units, dummy, status )
+              ENDIF
+           ENDIF
+     
+	   IF ( title .NE. char_init128 ) THEN
+              uvar_title( var ) = title
+
+              attlen = TM_LENSTR1(title)
+              attname = 'long_name'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           title, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, title, dummy, status )
+              ENDIF
+           ENDIF
+
+	   IF ( sigma_ref .NE. char_init128 ) THEN
+              attlen = TM_LENSTR1(sigma_ref)
+              attname = patnam_sigma
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           sigma_ref, dummy, status)
+              ELSE
+                 attype = NCCHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, sigma_ref, dummy, status )
+              ENDIF
+	      CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+           ENDIF
+
+	   IF ( bad  .NE. real4_init  ) THEN
+	      CALL PURGE_ALL_UVARS	 ! delete invalidated uvars
+	      uvar_bad_data(var) = bad
+
+              attlen = 1
+              attname = 'missing_value'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+              ELSE
+                 attype = NCFLOAT
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, buf, bad, status )
+              ENDIF
+
+              attname = '_FillValue'
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+              IF (attid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+              ELSE
+                 attype = NCFLOAT
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, buf, bad, status )
+              ENDIF
+	   ENDIF
+
+	ENDIF
+
+! Replace the name in the linked-list structure.
+	IF (newname .NE. char_init128 ) 
+     .      CALL CD_RENAME_VAR (dset, varid, newname_lc, status)
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5005	CALL ERRMSG( ferr_unknown_variable, status,
+     .		    '(data set ok ?): '//risc_buff(:len_rbuff), *5000 )
+! 5010	CALL ERRMSG( ferr_invalid_command, status,
+!     .		risc_buff(:len_rbuff)//' is from a self-documented data set'
+!     .		//pCR//'Can only SET VARIABLE on variable from an EZ data set',
+!     .							 *5000 )
+ 5015	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Cannot SET VARIABLE on '//risc_buff(:len_rbuff)//pCR//
+     .		'Only on variables from "EZ" data sets',
+     .							 *5000 )
+!     .		'Only on user-defined and variables from "EZ" data sets',
+ 5100	CALL ERRMSG( ferr_erreq, status,
+     .		cmnd_buff(qual_start(loc):qual_end(loc)), *5000 )
+ 5110   CALL ERRMSG( ferr_invalid_command, status,
+     .               'cannot specify grid for '//risc_buff(:len_rbuff)//
+     .		      pCR//
+     .               'Grid for a user-defined variable is implied '//
+     .               'by its definition', *5000 )
+ 5112   CALL ERRMSG( ferr_invalid_command, status,
+     .               'cannot specify grid for '//risc_buff(:len_rbuff),
+     .               						*5000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal new name given for '
+     .			//risc_buff(:len_rbuff),
+     .               						*5000 )
+ 5400	IF (dset .GT. 0) THEN
+           CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal new name.  Variable '
+     .			//newname_lc(:len_rbuff)//' exists in dataset ',
+     .                                                          *5000 )
+        ELSE
+           CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal new name.  Variable '
+     .			//newname_lc(:len_rbuff)//' already defined ',
+     .                                                          *5000 )
+        ENDIF
+ 5500	CALL ERRMSG( ferr_grid_definition, status, grid_name, *5000 )
+
+ 5550	CALL ERRMSG( ferr_unknown_arg, status, 'argument required', *5000)
+
+ 5560	CALL ERRMSG( ferr_invalid_command, status,
+     .			'referenced variable is not an acceptable name', *5000)
+
+ 5600	CALL ERRMSG( ferr_invalid_command, status,
+     .               'Cannot SET VARIABLE/NAME= with GT or TS datasets',
+     .               						*5000 )
+ 5700	CALL ERRMSG( ferr_invalid_command, status,
+     .           'Can SET VARIABLE/SCALEFAC= only with NetCDF datasets',
+     .               						*5000 )
+ 5800	CALL ERRMSG( ferr_invalid_command, status,
+     .           'Can SET VARIABLE/OFFSET= only with NetCDF datasets',
+     .               						*5000 )
+     
+ 5900	CALL ERRMSG( ferr_unknown_arg, status,
+     .'Can SET VARIABLE/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE',
+     .               						*5000 )
+
+	END
+
diff --git a/fer/gnl/show_1_dsvar.F b/fer/gnl/show_1_dsvar.F
new file mode 100644
index 0000000..68d58b9
--- /dev/null
+++ b/fer/gnl/show_1_dsvar.F
@@ -0,0 +1,94 @@
+	SUBROUTINE SHOW_1_DSVAR( lun, dset, vname, varid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* output some lines describing a dataset (netCDF) variable
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V600 6/05 *acm* Attribute control.
+* V685 5/13 *acm* Write the long_name not the variable number.
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xrisc.cmn'
+
+* calling argument declarations:
+
+	INTEGER	lun, dset, varid
+	CHARACTER*(*) vname
+	
+* local variable declarations:
+	LOGICAL NC_GET_ATTRIB_STRING, do_warn, got_it
+	INTEGER TM_LENSTR1, slen, llen, maxlen, attlen, attoutflag
+	CHARACTER*512 string
+
+* initialize
+	slen = TM_LENSTR1(vname)
+	maxlen = 512
+
+* variable name and definition
+	risc_buff = ' '//vname(:slen)
+        slen = slen + 1
+
+        got_it = NC_GET_ATTRIB_STRING ( dset, varid, 'LONG_NAME',
+     .                                   do_warn, vname, maxlen,
+     .                                   attlen, attoutflag, string)
+
+	IF (got_it) THEN
+	   risc_buff = risc_buff(:slen)//': '
+           slen = slen + 2
+	   risc_buff = risc_buff(:slen)//string(:attlen)
+           slen = slen + attlen
+	ENDIF
+
+	risc_buff = risc_buff(:slen)//', in dataset '
+        slen = slen + 13
+
+        llen = TM_LENSTR1(ds_des_name(dset))
+
+        risc_buff = risc_buff(:slen)//ds_des_name(dset)(:llen)
+        slen = slen + llen
+
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	risc_buff = ' '
+
+	RETURN
+	END
diff --git a/fer/gnl/show_1_function.F b/fer/gnl/show_1_function.F
new file mode 100644
index 0000000..598678b
--- /dev/null
+++ b/fer/gnl/show_1_function.F
@@ -0,0 +1,326 @@
+	SUBROUTINE SHOW_1_FUNCTION( lun, its_gc, brief, detail, ifcn )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* output a text description about the specified function
+
+* there are 3 classes of functions:
+*  classic internal Ferret functions (non-grid-changing) e.g. SIN(X)
+*  internal grid-changing functions
+*  external grid changing functions
+
+* programmer - steve hankin
+
+* V450: 7/97
+* 97.07.30 *jc* added code to enable external functions
+* V500: 1/99 *sh* added support for string arguments to functions
+* V510: 5/00 *sh* added argument "detail"
+* V620:11/08 acm* On a show func/detail, list the alternative 
+*                 function for other arg types, if it exists.
+* V664  9/10 *kms* Increase slen and size of ef_descr to 128 to match
+*                  the size of gfcn_descr and gfcn_arg_descr
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If cancelled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'grid_chg_fcns.parm'
+	include	'xalgebra.cmn'
+	include	'xgrid_chg_fcns.cmn'
+	include	'xtext_info.cmn'
+	include	'xrisc.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	LOGICAL	its_gc, brief, detail
+	INTEGER	lun, ifcn
+	
+* local variable declarations:
+	LOGICAL	its_reshape
+	INTEGER TM_LENSTR, TM_LENSTR1, GCF_ARG_TYPE, GCF_FIND_FCN,
+     .		ll, ll2, llsave, itype, narg, i, iarg, iarg2, idim, listdims
+	CHARACTER units*40, gcf_name*40, ef_arg_name*40, ef_descr*128, 
+     .		ef_units*40, ax_remark*64, alt_name*40
+	INTEGER EFCN_SCAN, EFCN_GET_NUM_REQD_ARGS, EFCN_GATHER_INFO,
+     .		axis_will_be(6), ifcn_alt
+
+* local parameter definitions
+	CHARACTER*4 indent
+	PARAMETER ( indent = '    ' )
+        INTEGER      slen
+        PARAMETER  ( slen = 128 )
+
+#ifdef sun
+        BYTE      fhol(slen)    ! c-type Hollerith string buffer
+#else
+        INTEGER*1 fhol(slen)    ! c-type Hollerith string buffer
+#endif
+ 
+* initialize
+	len_rbuff = LEN(risc_buff)	! maximum length
+	its_reshape = ifcn .EQ. p_reshape
+
+* If mode 6d_lab has been cancelled, we will list info only for 
+* the first 4 dimensions.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+
+* 1st line -- function name with args in parens
+* ... name
+	IF ( .NOT.its_gc ) THEN
+	   risc_buff = alg_fcn(ifcn)
+	   narg = alg_num_fcn_args(ifcn)
+	   iarg = alg_fcn_arg_ptr(ifcn)
+	ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	   risc_buff = gfcn_name(ifcn)
+	   narg = gfcn_num_reqd_args(ifcn)
+	   iarg = gfcn_arg_ptr(ifcn)
+	ELSE
+	   IF ( efcn_scan(gfcn_num_internal) .EQ. 0 ) THEN
+	      ! JC_TODO: what if no external functions are found?
+	      STOP 'no external functions found'
+	   ELSE
+	      IF ( efcn_gather_info(ifcn) .ne. 0 ) THEN
+		 RETURN
+	      ENDIF
+	      risc_buff = gcf_name(ifcn)
+	      narg = efcn_get_num_reqd_args(ifcn)
+	      iarg = 1
+	   ENDIF
+	ENDIF
+
+* ... open paren
+	ll = TM_LENSTR1(risc_buff)
+	risc_buff = risc_buff(:ll)//'('
+	ll = ll + 1
+	IF ( ll .GE. len_rbuff ) GOTO 200   ! undetected (unlikely) error
+
+* ... first argument
+	IF ( .NOT.its_gc ) THEN
+	   risc_buff = risc_buff(:ll) // alg_arg_name(iarg)
+	ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	   risc_buff = risc_buff(:ll) // gfcn_arg_name(iarg)
+	ELSE
+           call efcn_get_arg_name(ifcn, iarg, fhol)
+           call TM_CTOF_STRNG( fhol, ef_arg_name, slen)
+	   risc_buff = risc_buff(:ll) // ef_arg_name
+	ENDIF
+	ll = TM_LENSTR1(risc_buff)
+	IF ( ll .GE. len_rbuff ) GOTO 200   ! undetected (unlikely) error
+
+* ... additional arguments, if any
+        iarg2 = iarg
+	DO 100 i = 2, narg
+	   iarg2 = iarg2 + 1      ! point to next arg
+	   risc_buff = risc_buff(:ll) // ','
+	   ll = ll + 1
+	   IF ( .NOT.its_gc ) THEN
+	      risc_buff = risc_buff(:ll) // alg_arg_name(iarg2)
+	   ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	      risc_buff = risc_buff(:ll) // gfcn_arg_name(iarg2)
+	   ELSE
+	      call efcn_get_arg_name(ifcn, iarg2, fhol)
+	      call TM_CTOF_STRNG( fhol, ef_arg_name, slen)
+	      risc_buff = risc_buff(:ll) // ef_arg_name
+	   ENDIF
+	   ll = TM_LENSTR1(risc_buff)
+	   IF ( ll .GE. len_rbuff ) GOTO 200   ! truncation error
+ 100	CONTINUE
+
+* ... closing parenthesis
+	risc_buff = risc_buff(:ll)//')'
+	ll = ll + 1
+
+* ... write out the function name with its args
+ 200	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, ll)
+	IF ( brief ) RETURN
+
+* write 2nd line (if available) -- description of function
+	IF ( .NOT.its_gc ) THEN
+	   risc_buff = alg_fcn_descr(ifcn)
+	ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	   risc_buff = gfcn_descr(ifcn)
+	ELSE
+	   call efcn_get_descr(ifcn, fhol)
+	   call TM_CTOF_STRNG( fhol, ef_descr, slen)
+	   risc_buff = ef_descr
+	ENDIF
+	IF ( risc_buff .NE. ' ') CALL SPLIT_LIST
+     .			(pttmode_explct, lun, indent//risc_buff, 0)
+
+* tell about the result grid
+	IF ( its_gc .AND. detail ) THEN
+	   CALL SPLIT_LIST( pttmode_explct, lun,
+     .		'        Axes of result:', 23)
+	   IF ( ifcn .LE. gfcn_num_internal ) THEN
+	      DO 210 idim = 1, listdims
+ 210          axis_will_be(idim) = gfcn_axis_will_be(idim,ifcn)
+	   ELSE
+	      CALL EFCN_GET_AXIS_WILL_BE(ifcn, axis_will_be)
+	   ENDIF
+	   DO 220 idim = 1, listdims
+	      IF (its_reshape) THEN
+	         ax_remark = 'inferred from argument B'
+	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_is_abstract) THEN
+                 ax_remark =
+     .			'ABSTRACT (result will occupy indices 1...N)'
+	      ELSEIF(axis_will_be(idim) .EQ. pgc_axis_is_normal) THEN
+                 ax_remark = 'NORMAL (no axis)'
+	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_implied_by_args) THEN
+                 ax_remark = 'inherited from argument(s)'
+	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_supplied_herein) THEN
+	         ax_remark = 'created by this function'
+	      ELSE
+	         ax_remark = '???'
+	      ENDIF
+	      CALL SPLIT_LIST (pttmode_explct, lun,
+     .		'          '//ww_dim_name(idim)//': '//ax_remark, 0)
+ 220	   CONTINUE
+	ENDIF
+
+* write list of arguments and their definitions
+* ... "argname: description (units)"
+	DO 500 i = 1, narg
+* ... arg name
+	   IF ( .NOT.its_gc ) THEN
+	      risc_buff = alg_arg_name(iarg)
+	   ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	      risc_buff = gfcn_arg_name(iarg)
+	   ELSE
+	      call efcn_get_arg_name(ifcn, iarg, fhol)
+	      call TM_CTOF_STRNG( fhol, ef_arg_name, slen)
+	      risc_buff = ef_arg_name
+	   ENDIF
+	   ll = TM_LENSTR1(risc_buff)
+	   IF ( ll .GE. len_rbuff ) GOTO 400   ! truncation error
+* ... arg description
+	   risc_buff = risc_buff(:ll) //': '
+	   llsave = ll + 1		! save length of "arg:"
+	   IF ( .NOT.its_gc ) THEN
+	      risc_buff = risc_buff(:ll+2) // alg_arg_descr(iarg)
+	   ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	      risc_buff = risc_buff(:ll+2) // gfcn_arg_descr(iarg)
+	   ELSE
+	      call efcn_get_arg_desc(ifcn, iarg, fhol)
+	      call TM_CTOF_STRNG( fhol, ef_descr, slen)
+	      risc_buff = risc_buff(:ll+2) // ef_descr
+	   ENDIF
+* ... arg units
+	   IF ( .NOT.its_gc ) THEN
+	      units = alg_arg_units(iarg)
+	   ELSEIF ( ifcn .LE. gfcn_num_internal ) THEN
+	      units = gfcn_arg_units(iarg)
+	   ELSE
+	      call efcn_get_arg_unit(ifcn, iarg, fhol)
+	      call TM_CTOF_STRNG( fhol, ef_units, slen)
+	      units = ef_units
+	   ENDIF
+	   ll2 = TM_LENSTR(units)
+	   IF ( ll2 .GT. 0 ) THEN
+	      ll = TM_LENSTR1(risc_buff)
+	      IF ( ll .GE. len_rbuff ) GOTO 400   ! truncation error
+	      risc_buff = risc_buff(:ll) // ' (' //units(:ll2) //')'
+	   ENDIF
+	   ll = TM_LENSTR1(risc_buff)
+* ... data type (if STRING)
+	   IF ( .NOT.its_gc ) THEN
+	      itype = parg_type_float
+	   ELSE
+	      itype = GCF_ARG_TYPE(ifcn, i)
+	   ENDIF
+	   IF (itype .EQ. parg_type_string) THEN
+	       risc_buff = risc_buff(:ll) // ' (STRING)'
+	   ENDIF
+	   ll = TM_LENSTR1(risc_buff)
+
+* ... write the line
+ 400	   IF (ll .GT. llsave) CALL SPLIT_LIST
+     .			(pttmode_explct, lun, indent//risc_buff, 4+ll)
+
+* tell how the grid inheritance works
+	IF ( its_gc .AND. detail ) THEN
+	   CALL SPLIT_LIST( pttmode_explct, lun,
+     .			'        Influence on output axes:', 0)
+	   CALL GCF_GET_AXIS_SRCS(ifcn, i, axis_will_be)
+	   DO 420 idim = 1, listdims
+	      IF (its_reshape) THEN
+	         IF (i .EQ. 1) THEN
+	            ax_remark =
+     .	'none (if axis doesnt match B indicate arg limits with "[]")'
+	         ELSE
+	            ax_remark =
+     .	'passed to result grid (use [] limits to define output region)'
+	         ENDIF
+	      ELSEIF (axis_will_be(idim) .EQ. pgc_merge_axis ) THEN
+                 ax_remark = 'passed to result grid'
+	      ELSE
+	         ax_remark =
+     .			'no influence (indicate argument limits with "[]")'
+	      ENDIF
+	      CALL SPLIT_LIST (pttmode_explct, lun,
+     .		'          '//ww_dim_name(idim)//': '//ax_remark, 0)
+ 420	   CONTINUE
+	ENDIF	
+
+* ... go back for the next argument
+	   iarg = iarg + 1      ! point to next arg
+ 500	CONTINUE
+
+* See if there is a function for alternative argument types
+	IF ( its_gc .AND. detail ) THEN
+
+*          alt_name is blank-terminated (not null-terminated)
+*          and is unchanged if alt_type_fcn does not exist
+           alt_name = ' '
+	   CALL efcn_get_alt_type_fcn( ifcn, alt_name )
+
+	   ifcn_alt = GCF_FIND_FCN( alt_name )
+	   IF (ifcn_alt .EQ. unspecified_int4) THEN
+              RETURN
+	   ELSE
+	      CALL SPLIT_LIST( pttmode_explct, lun,
+     .          indent//
+     .          'Alternative function called for other argument types: '
+     .          //alt_name, 0)
+           ENDIF
+	ENDIF
+
+	RETURN
+	END
+
+
diff --git a/fer/gnl/show_1_mr.F b/fer/gnl/show_1_mr.F
new file mode 100644
index 0000000..f8ce985
--- /dev/null
+++ b/fer/gnl/show_1_mr.F
@@ -0,0 +1,207 @@
+	SUBROUTINE SHOW_1_MR( mr, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display a description of variable MR
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/12/89 - extracted from SHOW_MEM_VARS
+*	 2/27/90 - changed VAR_CODE to *8
+*	 3/30/90 - allow 6 digit subscripts
+* Risc/UNIX port 4/91 *sh* cannot use functions in WRITE list
+* V230:  11/4/92 - expanded variable name length
+* V420: 11/95 - indicate un-cached variables
+* V500 *kob* 3/99- up VAR_CODE and vname decl's to 64 chars
+* V552 *acm* 4/03- up VAR_CODE and vname decl's from 64 to 128 chars
+* V63  *acm* 10/09 Changes for gfortran build
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+
+	include	'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xtext_info.cmn'
+	include 'xalgebra.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER	mr, status
+
+* V500 *kob* 3/99- up VAR_CODE and vname decl's to 64 chars
+* V552 *acm* 4/03- up VAR_CODE and vname decl's from 64 to 128 chars
+* local variable declarations:
+	LOGICAL	ITS_UN_CACHED
+	INTEGER TM_LENSTR1, MR_DIM_LEN,
+     .		idim, ndim, mrlen, bk1len, nbklen, dset, listdims
+	CHARACTER VAR_CODE*128, ALG_TRANS_CODE*3, ARG_STRING*12, TM_FMT*8,
+     .		  protection*4, shape*4, dname*14, gname*12, vname*128,
+     .		  ww_lo(nferdims)*20, ww_hi(nferdims)*20, 
+     .		  ss_lo(nferdims)*6, ss_hi(nferdims)*6,
+     .		  mrbuf*4, bk1buf*4, 
+     .		  nbkbuf*4, cache_stat*8
+
+* If mode 6d_lab has been canceled, we will list only the first 4 dimensions.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+	status = ferr_ok
+
+* get shape
+	shape = ' '
+	ndim = 0
+
+* If mode 6d_lab has been canceled, but the variable has dimension 5 or 6,
+* that is an error
+	DO 150 idim = listdims, nferdims
+	   IF ( MR_DIM_LEN( idim, mr ) .GT. 1 ) GOTO 5100
+ 150	CONTINUE
+
+	DO 170 idim = 1, listdims
+	   IF ( MR_DIM_LEN( idim, mr ) .GT. 1 ) THEN
+	      ndim = ndim + 1
+	      shape(ndim:ndim) = ww_dim_name(idim)
+	   ENDIF
+ 170	CONTINUE
+
+* get formatted world positions
+	DO 180 idim = 1, listdims
+	   IF ( mr_lo_ww(idim,mr) .EQ. unspecified_val8 ) THEN
+	      ww_lo(idim) = ' ...'
+	      ww_hi(idim) = ' ...'
+	   ELSE
+	      CALL TRANSLATE_TO_WORLD
+     .	           ( mr_lo_ww(idim,mr),idim,mr_grid(mr),
+     .		     ax_dec_pt(idim), ww_lo(idim) )
+	      CALL TRANSLATE_TO_WORLD
+     .	           ( mr_hi_ww(idim,mr),idim,mr_grid(mr),
+     .		     ax_dec_pt(idim), ww_hi(idim) )
+	   ENDIF
+	   IF ( mr_lo_ss(mr,idim) .EQ. unspecified_int4 ) THEN
+	      ss_lo(idim) = ' ...'
+	      ss_hi(idim) = ' ...'
+	   ELSEIF ( mr_hi_ss(mr,idim) .GT. 9999 ) THEN
+	      WRITE ( ss_lo(idim), '(I6)' ) mr_lo_ss(mr,idim)
+	      WRITE ( ss_hi(idim), '(I6)' ) mr_hi_ss(mr,idim)
+	   ELSE
+	      WRITE ( ss_lo(idim), '(I4)' ) mr_lo_ss(mr,idim)
+	      WRITE ( ss_hi(idim), '(I4)' ) mr_hi_ss(mr,idim)
+	   ENDIF
+ 180	CONTINUE
+
+* write a line summary of this memory variable
+	IF ( mr_protected(mr) .EQ. mr_not_protected ) THEN
+	   protection = ' '
+	ELSEIF ( mr_protected(mr) .EQ. mr_perm_protected ) THEN
+	   protection = 'PERM'
+	ELSE
+	   protection = '*ERR'
+	ENDIF
+	IF ( ITS_UN_CACHED(mr) ) THEN
+	   cache_stat = 'UNCACHED'
+	ELSE
+	   cache_stat = ' '
+	ENDIF
+	vname = VAR_CODE( mr_category(mr),mr_variable(mr) )
+	dset = mr_data_set(mr)
+	IF ( dset .EQ. pdset_irrelevant ) THEN
+	   dname = ' '
+	ELSE
+	   dname = 'D='//ds_name(dset)
+	ENDIF
+	IF ( mr_unstand_grid(mr) ) THEN
+	   gname = grid_name(mr_grid(mr))
+	   gname = ',G='//gname(:TM_LENSTR1(gname))//']'
+	ELSE
+	   gname = ']'
+	ENDIF
+	mrbuf  = TM_FMT( FLOAT(mr), 0, 4, mrlen )
+	nbkbuf = TM_FMT( FLOAT(mr_nblks(mr)),0,4,nbklen )
+	bk1buf = TM_FMT( FLOAT(mr_blk1(mr)),0,4,bk1len )
+	risc_buff = ' '
+	WRITE ( risc_buff, 3010 )	vname(:TM_LENSTR1(vname)),
+     .					dname(:TM_LENSTR1(dname)),
+     .					gname(:TM_LENSTR1(gname)),
+     .					shape,
+     .					mrbuf(:mrlen),
+     .					bk1buf(:bk1len),
+     .					nbkbuf(:nbklen),
+     .					protection,
+     .					cache_stat
+
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+	WRITE ( risc_buff, 3020 )
+     .	  ( ss_lo(idim), ww_lo(idim), idim=1,listdims )
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+	WRITE ( risc_buff, 3020 )
+     .	  ( ss_hi(idim), ww_hi(idim), idim=1,listdims )
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+
+* RISC compiler bug: cannot use character functions in WRITE statement
+* ... use ww_lo and ss_lo as temporary buffers
+        DO 200 idim = 1, listdims
+           ss_lo(idim) = ALG_TRANS_CODE( mr_trans(idim,mr) )
+           ww_lo(idim) = ARG_STRING( mr_trans_arg(idim,mr) )
+ 200    CONTINUE
+	WRITE ( risc_buff, 3030 ) (ss_lo(idim), ww_lo(idim), idim = 1,listdims)
+
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+ 3010	FORMAT(T2,A,'[',2A,T36,A4,'  mr:',A,'  blk1:',A,
+     .'  nblk:',A,1X,A4,1x,A8)
+ 3020	FORMAT(T2,5(A6,'/',A12),A6,'/',A12)
+ 3030	FORMAT(T2,6(4X,A3,A12))
+
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'variable has more than 4 dimensions. Set mode 6D_LAB'
+     .		     //pCR//cmnd_buff(:len_cmnd),
+     .			*5000 )
+	END
diff --git a/fer/gnl/show_1_pyvar.F b/fer/gnl/show_1_pyvar.F
new file mode 100644
index 0000000..a38d195
--- /dev/null
+++ b/fer/gnl/show_1_pyvar.F
@@ -0,0 +1,145 @@
+      SUBROUTINE SHOW_1_PYVAR(lun, ivar, full)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administrations (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* output some lines describing a pyvar (cat_pystat_var) variable
+*
+      IMPLICIT NONE
+
+      include 'ferret.parm'
+      include 'tmap_dims.parm'
+      include 'xprog_state.cmn'
+      include 'xpyvar_info.cmn'
+      include 'xrisc.cmn'
+      include 'xtext_info.cmn'
+      include 'xtm_grid.cmn_text'
+
+* arguments
+      INTEGER lun, ivar
+      LOGICAL full
+
+* function return values
+      INTEGER      TM_LENSTR1
+      CHARACTER*48 LOHI_STRING
+      CHARACTER*14 TM_FMT
+      CHARACTER*6  LEFINT
+      REAL*8       TM_WORLD
+
+* local variables
+      CHARACTER*256 myline
+      CHARACTER*17  axstr(4), fltstr
+      INTEGER       j, k, q, starti(4), grid, listdims
+      REAL*8        lo, hi
+
+      listdims = nferdims
+      IF ( .NOT. mode_6d_lab ) listdims = 4
+
+* if the code name is long, print it on a separate line
+      myline = pyvar_code(ivar)
+      IF ( TM_LENSTR1(myline) .GT. 8 ) THEN
+          risc_buff = ' '
+          WRITE (risc_buff, '(1X,A)') pyvar_code(ivar)
+          CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+          myline = ' '
+      ENDIF
+
+* grid axis limits
+      DO 120 k = 1,listdims
+          IF ( grid_line(k,pyvar_grid_number(ivar)) .EQ. mnormal) THEN
+              axstr(k) = '       ...'
+              starti(k) = 6
+          ELSE
+              WRITE(axstr(k),'(I8)') pyvar_grid_start(k,ivar)
+*             just use the last three characters unless more is needed
+              starti(k) = 6
+              DO 100 j = 1,5
+                  IF ( axstr(k)(j:j) .NE. ' ' ) THEN
+                      starti(k) = j
+                      GOTO 110
+                  ENDIF
+ 100          CONTINUE
+ 110          CONTINUE
+              axstr(k)(9:9) = ':'
+              axstr(k)(10:) = LEFINT(pyvar_grid_end(k,ivar),j)
+          ENDIF
+ 120  CONTINUE
+
+* write the basic information line
+      IF ( listdims .EQ. nferdims ) THEN
+          WRITE (risc_buff, 200) myline, pyvar_title(ivar),
+     .                           (axstr(k)(starti(k):15),k=1,nferdims)
+ 200      FORMAT(1X,A8,1X,A31,T42,6(A))
+      ELSE
+          WRITE (risc_buff, 205) myline, pyvar_title(ivar),
+     .                           (axstr(k)(starti(k):15),k=1,4)
+ 205      FORMAT(1X,A8,1X,A31,T42,4(A))
+      ENDIF
+      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+
+* write more information if full output requested
+      IF ( full ) THEN
+          grid = pyvar_grid_number(ivar)
+*         "<units> on grid <name> with <value> for missing data"
+          j = TM_LENSTR1(pyvar_units(ivar))
+          k = TM_LENSTR1(grid_name(grid))
+          fltstr = TM_FMT(pyvar_missing_flag(ivar),7,14,q)
+          myline = '             ' // pyvar_units(ivar)(:j) //
+     .           ' on grid ' // grid_name(grid)(:k) // ' with ' //
+     .           fltstr(:q) // ' for missing data'
+          CALL SPLIT_LIST(pttmode_explct, lun, myline, 0)
+* ... world coordinate limits
+          myline = ' '
+          j = 1
+          DO 300 k = 1,3
+              IF ( grid_line(k,grid) .NE. mnormal ) THEN
+                  lo = TM_WORLD(pyvar_grid_start(k,ivar), 
+     .                          grid, k, box_lo_lim)
+                  hi = TM_WORLD(pyvar_grid_end(k,ivar), 
+     .                          grid, k, box_hi_lim )
+                  risc_buff = myline(:j)
+                  myline = risc_buff(:j) // ww_dim_name(k) // '=' //
+     .                   LOHI_STRING(lo,hi,k,grid,':',ax_dec_pt(k),q)
+     .            // '  '
+                  j = MIN(64,j+4+q)
+               ENDIF
+ 300      CONTINUE
+          CALL SPLIT_LIST(pttmode_explct, lun,
+     .                    '            ' // myline(:j), j+12)
+      ENDIF
+
+      RETURN
+      END
+
+
diff --git a/fer/gnl/show_1_uvar.F b/fer/gnl/show_1_uvar.F
new file mode 100644
index 0000000..d63cbc3
--- /dev/null
+++ b/fer/gnl/show_1_uvar.F
@@ -0,0 +1,114 @@
+	SUBROUTINE SHOW_1_UVAR( lun, uvar, line, lead_in, full )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* output some lines describing a user variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V402: 7/95 - extracted from XEQ_SHOW with additions for LET/D=
+* V510: 5/00 *sh* - show bad data flag if manually set
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+*                   (variables are up to 128, so FULL_UVAR_NAME needs extra 
+*                   space i.e. for a transformation specifier)
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xrisc.cmn'
+
+* calling argument declarations:
+	LOGICAL	full
+	INTEGER	lun, uvar
+	CHARACTER*(*) lead_in	! characters at margin - at least 1 character
+	CHARACTER*(*) line	! line buffer -- 255 char
+	
+* local variable declarations:
+	INTEGER TM_LENSTR1, slen, llen
+	CHARACTER FULL_UVAR_NAME*150, TM_FMT*12
+
+* initialize
+	IF (uvar_num_items(uvar) .EQ. uvar_deleted  ) RETURN
+	llen = LEN(lead_in)
+
+* variable name and definition
+	risc_buff = lead_in//FULL_UVAR_NAME(uvar,slen)
+	slen = slen + llen
+	risc_buff = risc_buff(:slen)//' = '//uvar_text(uvar)		
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	risc_buff = ' '
+
+* extra information for "full" output
+	IF ( full ) THEN
+* ... title and units as "...title...(units)"
+	   line = uvar_title(uvar)
+	   IF ( line .EQ. ' ' ) THEN
+	      slen = 3
+	   ELSE
+	      slen = 1
+	   ENDIF
+	   IF ( uvar_units(uvar) .NE. ' ' ) THEN
+	      line = line(:TM_LENSTR1(line))//
+     .                      ' ('//uvar_units(uvar)
+	      line = line(:TM_LENSTR1(line))//')'
+	   ENDIF
+	   IF ( line .NE. ' ' ) THEN
+	      WRITE (risc_buff,4020)
+     .                       line(slen:TM_LENSTR1(line))
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .                       risc_buff, 0)
+	      risc_buff = ' '
+	   ENDIF
+* ... bad data flag if was manually set
+	   IF ( uvar_bad_data(uvar) .NE. bad_val4 ) THEN
+	      line = '          bad value flag = '//
+     .			TM_FMT(uvar_bad_data(uvar),7,12,slen)
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .                       line, 0)
+	      risc_buff = ' '
+	   ENDIF
+	ENDIF
+
+ 4020   FORMAT (T10,'"',A,'"')
+
+	RETURN
+	END
+
+
diff --git a/fer/gnl/show_1_uvar_xml.F b/fer/gnl/show_1_uvar_xml.F
new file mode 100644
index 0000000..35a39d0
--- /dev/null
+++ b/fer/gnl/show_1_uvar_xml.F
@@ -0,0 +1,241 @@
+	SUBROUTINE SHOW_1_UVAR_XML( lun, uvar, vname, first )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* output some lines describing a user variable in xml-style format
+* 20-Oct-2004 acm  from show_1_uvar.F
+*  7-Feb-2005 acm  (bug 1165) fix string vars so they are output with 
+*                  surrounding "
+* V602 12/06 *acm* remove extra call to GRID_FROM_NAME_XML
+* V606  8/07 *acm* when there are quotes within the var definition, as in
+*                  a date specification change these to " for valid xml.
+* V616  1/2009 *acm* Fixing LAS ticket 481, new style of xml output
+* V631 11/09 *acm* For XML-formatted output check for and replace the strings < > and &
+*                  with < etc.
+* V650  Write to lun which may be set to a file unit number rather than std out
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+
+        include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xrisc.cmn'
+	include 'xprog_state.cmn'
+        include 'errmsg.parm'
+	include 'netcdf.inc'
+
+* calling argument declarations:
+	INTEGER	lun, uvar
+	CHARACTER*(*) vname	! buffer -- 255 char
+        LOGICAL first
+	
+* local variable declarations:
+        LOGICAL NC_GET_ATTRIB, got_it, coordvar
+	INTEGER TM_LENSTR1, GRID_FROM_NAME_XML, STR_SAME,
+     .          slen, llen, grid, cx_expr, i, j, status,
+     .            varid, vtype, nvdims, vdims(8), nvatts, blen, 
+     .            len_attbuff, attoutflag, all_outflag, attid, 
+     .            attlen, attype, iatt, dset, alen
+	CHARACTER FULL_UVAR_NAME_XML*150, FULL_UVAR_NAME*150, 
+     .            TM_FMT*12,
+     .            buff*150, buff2*170, c*1, atype*10, aname*128, 
+     .            attname*128, attbuff*2048, outstring*2048
+	REAL      vals(100)
+        LOGICAL TM_HAS_STRING, save_mode_ignore, save_silent_err, new
+
+ 2010  FORMAT ('<var name="', A, '">' )
+ 2020  FORMAT ('<attribute name="', A, '" type="char">' )
+ 2030  FORMAT ('<attribute name="', A, '" type="float">' )
+ 2040  FORMAT ('<attribute name="',  A, '" type="', A,'">' )
+ 2050  FORMAT ('   <value>', A, '</value>')
+ 2055  FORMAT ('   <value><![CDATA[', A, ']]></value>')
+ 2060  FORMAT ('</attribute>')
+ 2070  FORMAT ('</var>')
+
+* initialize
+	IF (uvar_num_items(uvar) .EQ. uvar_deleted  ) RETURN
+
+* See if user variable is relevant to the context
+* turn off error reporting
+
+        save_mode_ignore = mode_ignore_err 
+        silent_err = save_silent_err
+        mode_ignore_err = .TRUE.
+        silent_err = .TRUE.
+
+        vname = FULL_UVAR_NAME(uvar,slen)
+        grid= GRID_FROM_NAME_XML(vname, cx_last, cx_expr, 
+     .       status)
+
+* Restore error reporting
+
+        save_mode_ignore = mode_ignore_err 
+        mode_ignore_err = save_mode_ignore
+        silent_err = save_silent_err
+
+        IF (status .NE. ferr_ok) RETURN
+
+* Before first variable output the global tag.
+
+        IF (first) THEN
+           risc_buff = '<global>'
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           first = .FALSE.
+        ENDIF
+
+* variable name and definition
+
+* ... output variable code, units, grid, and type
+
+        vname = FULL_UVAR_NAME_XML(uvar,slen)
+        CALL ESCAPE_FOR_XML (vname, outstring, slen)
+        WRITE ( risc_buff, 2010 ) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+        WRITE ( risc_buff, 2020 ) 'definition'
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	buff = uvar_text(uvar)
+        CALL ESCAPE_FOR_XML (buff, outstring, slen)
+	WRITE (risc_buff, 2055) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	WRITE ( risc_buff, 2060 ) 
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	risc_buff = ' '
+
+* ... title and units 
+	IF ( uvar_units(uvar) .NE. ' ' ) THEN
+           CALL ESCAPE_FOR_XML (uvar_units(uvar), outstring, slen)
+           WRITE ( risc_buff, 2020 ) 'units'
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE (risc_buff, 2055) outstring(1:slen)
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2060 ) 
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        ENDIF
+
+	IF ( uvar_title(uvar) .NE. ' ' ) THEN
+           CALL ESCAPE_FOR_XML (uvar_title(uvar), outstring, slen)
+           WRITE ( risc_buff, 2020 ) 'long_name'
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE (risc_buff, 2055) outstring(1:slen)
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2060 ) 
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        ENDIF
+
+* ... bad data flag 
+
+        buff = TM_FMT(uvar_bad_data(uvar), 7,16,slen)
+        CALL ESCAPE_FOR_XML (buff, outstring, slen)
+        WRITE ( risc_buff, 2030 ) 'missing_value'
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        WRITE (risc_buff, 2050) outstring(1:slen)
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        WRITE ( risc_buff, 2060 ) 
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* All attributes not already listed.
+ 
+	dset = 0
+	CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims, 
+     .            vdims, nvatts, coordvar, all_outflag, status)
+	IF (status .NE. ferr_ok) GOTO 1000
+
+	DO 200 iatt = 1, nvatts
+           CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+           new = .TRUE.
+           new = (STR_SAME(attname, 'units') .NE. 0)         .AND. 
+     .              (STR_SAME(attname, 'long_name') .NE. 0)     .AND. 
+     .              (STR_SAME(attname, 'history') .NE. 0)       .AND. 
+     .              (STR_SAME(attname, 'missing_value') .NE. 0) .AND. 
+     .              (STR_SAME(attname, '_FillValue') .NE. 0)
+
+           IF (new) THEN
+              blen = 2048  ! len of attbuff
+              got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .                                .TRUE., vname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+
+              CALL ESCAPE_FOR_XML (attname, aname, slen)
+
+              IF (attype .EQ. NCCHAR)   atype = 'char'
+              IF (attype .EQ. NCBYTE)   atype = 'byte'
+              IF (attype .EQ. NCSHORT)  atype = 'int'
+              IF (attype .EQ. NCLONG)   atype = 'int'
+              IF (attype .EQ. NCFLOAT)  atype = 'float'
+              IF (attype .EQ. NCDOUBLE) atype = 'double'
+              alen = TM_LENSTR1(atype)
+
+              WRITE (risc_buff, 2040) aname(1:slen), atype(1:alen)
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+              IF (attype .NE. NCCHAR) THEN
+                 slen = 1
+                 attbuff = ' '
+                 DO 150 i = 1, attlen
+                    buff = TM_FMT(vals(i), 7, 14, llen)
+                    CALL ESCAPE_FOR_XML (buff, outstring, llen)
+                    WRITE ( risc_buff, 2050 ) outstring(1:llen)
+                    CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+ 150             CONTINUE
+              ELSE 
+                 CALL ESCAPE_FOR_XML (buff, outstring, llen)
+                 WRITE ( risc_buff, 2050 ) outstring(1:llen)
+                 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              ENDIF
+
+              WRITE ( risc_buff, 2060 )
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           ENDIF
+
+ 200    CONTINUE
+1000    CONTINUE
+
+* ... grid
+
+        IF (grid .NE. unspecified_int4) 
+     .          CALL SHOW_GRID_XML (lun, grid, cx_expr)
+
+        WRITE ( risc_buff, 2070 )
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	RETURN
+	END
diff --git a/fer/gnl/show_attribute.F b/fer/gnl/show_attribute.F
new file mode 100644
index 0000000..7e87af8
--- /dev/null
+++ b/fer/gnl/show_attribute.F
@@ -0,0 +1,127 @@
+	SUBROUTINE SHOW_ATTRIBUTE ( varname, coordvar, attname, attype, 
+     .                    attlen, attstr, attvals, attoutflag, sho_out) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute SHOW ATTRIBUTE for a single variable and attribute name
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+*
+* V600 6/05 *acm* Attribute control.
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xtext_info.cmn'
+        include 'xprog_state.cmn'
+        include 'xinterrupt.cmn'
+        include 'netcdf.inc'
+
+* calling argument declarations
+        LOGICAL coordvar, sho_out
+	INTEGER	attype, attlen, attoutflag
+	REAL attvals(*)
+	CHARACTER varname*(*), attname*(*), attstr*(*)
+
+* local parameter declarations:
+	LOGICAL	    full_precision
+	PARAMETER ( full_precision = .TRUE. )
+
+* local variable declarations:
+	INTEGER  TM_LENSTR1, slen, llen, vlen, i, status
+        CHARACTER TM_FMT*14, vbuff*14, buff*2048, punc*2
+
+* local parameter declarations:
+	INTEGER		sig_figs
+	PARAMETER     ( sig_figs = 7 )   ! was 5 1/95
+
+        slen = 2
+        vlen = TM_LENSTR1(varname)
+        llen = TM_LENSTR1(attname)
+        buff = ' '//varname(:vlen)//'.'//attname(:llen)//' '
+        slen = slen + llen + vlen + 1
+        IF (coordvar) THEN
+           buff = ' ('//varname(:vlen)//').'//attname(:llen)//' '
+           slen = slen + 2
+        ENDIF
+
+* if character type, write the attribute name with its string value
+
+        IF (attype .EQ. NCCHAR) THEN
+
+           buff = buff(:slen)//'= '//attstr(:attlen)
+           slen = slen + 3 + attlen
+
+           IF (sho_out) THEN
+              IF (attoutflag .EQ. 0) buff = buff(:slen)//'    0'
+              IF (attoutflag .EQ. 1) buff = buff(:slen)//'    1'
+              slen = slen + 5
+           ENDIF
+        
+           CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		           buff, slen)
+
+* If numeric, write the value(s)
+
+        ELSE
+           
+           punc = '= '
+	   DO 100 i = 1, attlen
+	      IF ( interrupted ) CALL ERRMSG
+     .		   ( ferr_interrupt, status, ' ', *1000 )
+	   
+              vbuff = TM_FMT(attvals(i), sig_figs, 14, llen )
+              buff = buff(:slen)//punc//vbuff(:llen)
+              slen = slen + 2 + llen
+              punc = ', '
+
+ 100	   CONTINUE
+ 
+           IF (sho_out) THEN
+              IF (attoutflag .EQ. 0) buff = buff(:slen)//'    0'
+              IF (attoutflag .EQ. 1) buff = buff(:slen)//'    1'
+              slen = slen + 5
+           ENDIF
+
+           CALL SPLIT_LIST(pttmode_explct, show_lun, buff, slen)
+
+	ENDIF      
+
+* successful completion
+ 1000	RETURN
+	END
diff --git a/fer/gnl/show_data.F b/fer/gnl/show_data.F
new file mode 100644
index 0000000..ad81467
--- /dev/null
+++ b/fer/gnl/show_data.F
@@ -0,0 +1,220 @@
+	SUBROUTINE SHOW_DATA(dset, status) 
+	
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 4/2012 *acm*
+* taken out of xeq_show.F, execute SHOW DATA
+* v675  *acm  4/12 Fix ticket 1934, simpler SHOW ATTRIBUTE syntax.
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+* V685 4/13 *acm* Ability to define ensemble with /HIDDEN
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xcontext.cmn'
+	include 'xinterrupt.cmn'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn' 
+
+	INTEGER dset, status
+
+	LOGICAL TM_HAS_STRING, 
+     .          sbrief, sfull, svars, sfile, sattr, sxml, clobber, 
+     .          append, only_1, un_hide
+	INTEGER TM_LENSTR1, TM_LENSTR, FIND_DSET_NUMBER, 
+     .		    sho_file, iset, len, len0,
+     .		    slash_brief,
+     .		    slash_full,
+     .		    slash_vars,
+     .		    slash_file,
+     .		    slash_attr,
+     .		    slash_xml
+	CHARACTER name*32, default*50, outstring*2048
+
+	PARAMETER ( slash_brief    = 1 + 1,
+     .		    slash_full     = 1 + 2,
+     .		    slash_vars     = 1 + 3,
+     .		    slash_file     = 1 + 4,
+     .		    slash_attr     = 1 + 6,
+     .		    slash_xml      = 1 + 5)
+
+* initialize
+	show_lun = ttout_lun
+	sxml = .FALSE.
+	status = ferr_ok
+
+   	sbrief = qual_given( slash_brief ) .GT. 0 
+	sfull  = qual_given( slash_full  ) .GT. 0
+	svars  = qual_given( slash_vars  ) .GT. 0   .OR. sfull
+ 	sfile  = qual_given( slash_file  ) .GT. 0   .OR. sfull
+ 	sattr  = qual_given( slash_attr  ) .GT. 0  
+        IF (sattr) sbrief = .TRUE.
+ 	sxml  = qual_given( slash_xml  ) .GT. 0 
+
+* 	SHOW DATA/FILE=[/APPEND][/CLOBBER][/HIDDEN]
+        sho_file = qual_given( slash_show_data_file )
+	clobber = qual_given( slash_show_data_clobber ) .GT. 0
+	append = qual_given( slash_show_data_append ) .GT. 0
+
+* SHOW DATA/HIDDEN  if ensembles are defined with /HIDE, then
+*             SHOW DAT/HIDDEN will show the member datasets.
+
+	un_hide = qual_given( slash_show_data_hidden ) .GT. 0
+
+	IF (sho_file .GT. 0) THEN
+	   CALL OPEN_SHOW_FILE (show_lun, sho_file,  
+     .                          clobber, append, status)
+	   IF (status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+	only_1 = num_args .GT. 0
+	IF ( only_1 ) THEN
+	   name = cmnd_buff(arg_start(1):arg_end(1))
+	   dset = FIND_DSET_NUMBER( name )
+	   IF ( dset .EQ. unspecified_int4 ) GOTO 5000
+	   un_hide = .TRUE.
+	ENDIF
+
+        IF (.NOT. sxml) THEN
+           WRITE ( risc_buff, 3700 )	! heading line
+           CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ELSE
+           risc_buff = '<datasets>'
+           CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ENDIF
+
+	risc_buff = ' '
+
+	DO 790 iset = 1, maxdsets
+	   IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+
+	   IF ( ds_name(iset) .EQ. char_init1024
+     .	   .OR. (only_1 .AND. iset .NE. dset) ) GOTO 790
+
+           IF ( ds_hide(iset) .AND. .NOT.un_hide) GOTO 790
+           dset = iset
+
+* ... is it the default data set?
+	   IF ( iset .EQ. cx_data_set(cx_last) ) THEN
+	      default = '(default)'
+	      len0 = 9
+	   ELSE
+	      default = ' '
+	      len0 = 1
+	   ENDIF
+	   IF (dset.NE.unspecified_int4 .AND. dset.NE.pdset_irrelevant) THEN
+	   IF ( TM_HAS_STRING(ds_type(iset), 'ENS') ) THEN
+	      default = default(:len0)//'  Ferret-defined Ensemble dataset'
+	      len0 = TM_LENSTR1( default )
+	   ENDIF
+	   ENDIF
+
+	   len = TM_LENSTR1( ds_des_name( iset ) )
+           IF (sxml) THEN
+
+* Write data set name
+              IF (len0 .EQ. 1) THEN
+                 CALL ESCAPE_FOR_XML (ds_des_name(iset), outstring, len)
+                 WRITE (risc_buff,3711) outstring(:len)
+	      ENDIF
+              IF (len0 .EQ. 9) THEN
+                 CALL ESCAPE_FOR_XML (ds_des_name(iset), outstring, len)
+                 WRITE (risc_buff,3712) outstring(:len)
+              ENDIF
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+* Write data set title
+              CALL ESCAPE_FOR_XML (ds_title(iset), outstring, len)
+	      WRITE ( risc_buff, 2020 ) outstring(1:len)
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+	      len = TM_LENSTR(ds_mod_title(iset))
+	      IF (len .GT. 0) THEN
+                 CALL ESCAPE_FOR_XML (ds_mod_title(iset), outstring, len)
+	         WRITE ( risc_buff, 2030 ) outstring(1:len)
+	         CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+              ENDIF
+
+           ELSE
+	      WRITE (risc_buff,3710) iset,ds_des_name(iset)(:len),default(:len0)
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+           ENDIF
+
+	   risc_buff = ' '
+* ... by default only name and variables are shown
+           IF ( sxml) THEN
+              IF (svars) THEN
+                 CALL SHOW_DATA_SET_VARS_XML (show_lun, iset)
+              ELSE
+                 CALL SHOW_DATA_SET_XML (show_lun, iset)
+              ENDIF
+           ELSE
+	      IF ( svars       ) CALL SHOW_DATA_SET_PARAMS 
+     .                             (show_lun, iset)
+	      IF ( .NOT.sbrief ) CALL SHOW_DATA_SET_VARS
+     .                             (show_lun, iset, svars, status)
+	      IF ( sfile       ) CALL SHOW_DATA_FILES      
+     .                             (ttout_lun, iset)
+	      IF ( sattr       ) CALL SHOW_DATA_SET_ATTRS      
+     .                             (show_lun, iset)
+           ENDIF
+           IF (sxml .AND. (.NOT.svars)) THEN
+              risc_buff = '</dataset>'
+              CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+           ENDIF
+	   IF (status .NE. ferr_ok) GOTO 5000
+ 790	CONTINUE
+
+        IF (sxml .AND. (.NOT.svars)) THEN
+           risc_buff = '</datasets>'
+           CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ENDIF
+
+	IF (sho_file .GT. 0) CLOSE (UNIT = show_lun)
+
+
+ 2020   FORMAT( '<title>', A, '</title>' )
+ 2030   FORMAT( '<title_mod>', A, '</title_mod>' )
+ 3700	FORMAT (T6,'currently SET data sets:')
+ 3710	FORMAT (T2,I4,'> ',A,2X,A)
+ 3711	FORMAT ('<dataset name="',A,'" default="false">')
+ 3712	FORMAT ('<dataset name="',A,'" default="true">')
+
+ 5000	RETURN
+        END
diff --git a/fer/gnl/show_data_files.F b/fer/gnl/show_data_files.F
new file mode 100644
index 0000000..98663f7
--- /dev/null
+++ b/fer/gnl/show_data_files.F
@@ -0,0 +1,140 @@
+	SUBROUTINE SHOW_DATA_FILES( lun, dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* show the files and time step ranges for the requested data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/15/88
+* V230: 6/92 - elaborated on kludge to locate time axis for data set
+*            - use the first variable that HAS a time axis
+*              (not clear why ds_time_axis cannot be used ??)
+* V301: 4/94 - show file for T-independent data set, too
+*	       but not for a netCDF data set
+* V320:12/94 - increased the output field size for /COLUMNS=xxxx
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*           *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	lun, dset
+	
+* local variable declarations:
+	INTEGER		KNOWN_GRID, TM_LENSTR1,
+     .			ivar, grid, istep, ndec, status, lskip, slen
+	CHARACTER	LEFINT*8, lo_date*20, hi_date*20, skip*8
+
+* special processing of EZ data sets
+	IF ( ds_type(dset) .EQ. pds_type_ez ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		' /FORMAT = '//ds_parm_text(1,dset), 0)
+           DO 10 istep = 1,maxstepfiles
+ 10	   IF (sf_setnum(istep) .EQ. dset) GOTO 20
+	   CALL ERRMSG( ferr_internal, status, 'EZ_ err', *5000 )
+ 20	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		' /SKIP = '//LEFINT( sf_skip(istep), lskip ), 0)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		' /COLUMNS = '//LEFINT( ds_ntuple(dset), lskip ), 0)
+ 5000	   RETURN
+
+* nothing to show for netCDF files (4/94)
+        ELSEIF (ds_type(dset) .EQ. 'CDF'
+     .    .OR.  ds_type(dset) .EQ. 'ENS'
+     .    .OR.  ds_type(dset) .EQ. 'ECDF') THEN
+	   RETURN
+	ENDIF
+
+* !kludge - get the time axis from a variable in this data set
+	DO 100 ivar = 1, maxvars
+	   IF ( ds_var_setnum(ivar) .EQ. dset ) THEN
+	      grid = KNOWN_GRID( dset, cat_file_var, ivar )
+              IF ( grid_line(t_dim,grid) .NE. mnormal ) GOTO 200
+	   ENDIF
+ 100	CONTINUE
+
+******* 4/94 addition ******
+* a time-independent data set
+* list files belonging to this data set (should be one, only) 
+	DO 110 istep = 1, maxstepfiles
+	    IF ( sf_setnum(istep) .EQ. dset ) CALL SPLIT_LIST
+     .		(pttmode_explct, lun, ' time-independent data file: '
+     .		//sf_name(istep), 0 )
+ 110	CONTINUE
+******* end of 4/94 addition ******
+	RETURN
+
+* a time-dependent data set:
+* write heading line for step file list
+ 200	CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'          time-dependent data files:', 36)
+
+* output string precision (from SET MODE CALENDAR)
+           ndec = ax_dec_pt( t_dim )
+
+* see which step files belong with this data set 
+	DO 300 istep = 1, maxstepfiles
+	    IF ( sf_setnum(istep) .EQ. dset ) THEN
+	      CALL TRANSLATE_TO_WORLD(	sf_1step(istep), t_dim, grid,
+     .					ndec, lo_date )
+	      CALL TRANSLATE_TO_WORLD(	sf_lastep(istep), t_dim, grid,
+     .					ndec, hi_date )
+	      slen = TM_LENSTR1(hi_date)
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .		lo_date(:slen)//' -> '//hi_date(:slen)//'    '
+     .		//sf_name(istep), 0 )
+	   ENDIF
+ 300	CONTINUE
+
+	RETURN
+	END
+
diff --git a/fer/gnl/show_data_set_attrs.F b/fer/gnl/show_data_set_attrs.F
new file mode 100644
index 0000000..0b8f8d6
--- /dev/null
+++ b/fer/gnl/show_data_set_attrs.F
@@ -0,0 +1,264 @@
+	SUBROUTINE SHOW_DATA_SET_ATTRS( lun, dset, full )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* describe the attributes in the named nc data set
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* - based on SHOW_DATA_SET_VARS 
+* V600 6/05 *acm* Attribute control.
+* V600 4/08 SHOW DATA/ATT only for nc data so far; var info not in 
+*           the linked list structure.
+* V62  4/09 List the data type of variables as they are in the input
+*           dataset.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'ez_lib.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xez_info.cmn_text'
+	external xez_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+#include "netcdf.inc"
+
+* calling argument declarations:
+	LOGICAL	full
+	INTEGER	lun, dset
+	
+* local variable declarations:
+        LOGICAL         NC_GET_ATTRIB, coordvar, got_it
+	INTEGER 	TM_LENSTR1, STR_SAME, NCF_INQ_DS, varid, ndims,
+     .                  nvars, ngatts, recdim, iatt, attype, attlen,
+     .                  slen,  llen, vlen, vtype, nvdims,
+     .                  vdims(8),  nvatts, status, blen, i, len_attbuff,
+     .                  attoutflag, all_outflag, attid
+        REAL            vals(10)
+	CHARACTER	TM_FMT*14, varname*512, attname*128, 
+     .                  buff*14, attbuff*2048, oflag*1
+        CHARACTER*6     typ(0:7)
+        PARAMETER       (len_attbuff = 2048)
+        
+* See netcdf.h for the data types
+	DATA typ/'NaN',          ! NAT = 'Not A Type' (c.f. NaN)
+     .           'BYTE',         ! signed 1 byte integer
+     .           'CHAR',         ! ISO/ASCII character
+     .           'SHORT',        ! signed 2 byte integer
+     .           'INT',          ! signed 4 byte integer
+     .           'FLOAT',        ! single precision floating point number
+     .           'DOUBLE',       ! double precision floating point number
+     .           ' '/		 ! blank for the global attributes
+
+* describe the variables in the set, only for datasets originating 
+* as netcdf data.
+
+        IF (dset .LE. 0) RETURN
+        status = NCF_INQ_DS (dset, ndims, nvars, ngatts, recdim )
+
+	risc_buff = ' '
+	WRITE ( risc_buff, 3200 )
+ 3200	FORMAT(' Variable',T14,'VarType(in dset)',T34,'AttributeName',
+     .         T50,'AttType',T62,'Size',T67,'OutFlag',T75,'AttValue')
+ 3201	FORMAT('---------------------------------------------',
+     .         '---------------------------------------------')
+ 3300	FORMAT(' ',A,T24,A,T34,A,T50,A,T62,A,T67,A,T75,A)
+ 3301	FORMAT(' ',A,T24,A,T34,A,T50,A,T62,A,T67,A,T75)
+ 3302	FORMAT(' ',A)
+ 3400	FORMAT('(',A,')',T24,A,T34,A,T50,A,T62,A,T67,A,T75,A)
+ 3500	FORMAT(T34,A,T50,A,T62,A,T67,A,T75,A)
+
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+        WRITE (lun, 3201) 
+        WRITE (lun, *) ' '
+
+* Write global atttributes
+
+        IF ( ngatts .GE. 1) THEN
+   
+	      varname = '.'
+	      CALL CD_GET_VAR_ID (dset, varname, varid, status)
+              IF (varid .EQ. 0) vtype = 7  ! 
+              
+	      vlen = TM_LENSTR1(varname)
+	      DO 100 iatt = 1, ngatts
+                 CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, attname, 
+     .              status )
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+	         blen = len_attbuff
+	         got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .                                .TRUE., varname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+
+	         IF (got_it) THEN
+	            IF (attype .NE. NCCHAR) THEN
+                       blen = 1
+                       attbuff = ' '
+                       DO 50 i = 1, attlen
+                          buff = TM_FMT(vals(i), 7, 14, llen)
+                          attbuff(blen:blen+llen+1) = buff//' '
+                          blen = blen + llen + 1
+  50                  CONTINUE
+                    ELSE 
+                       blen = TM_LENSTR1(attbuff)
+                    ENDIF
+                    oflag = 'F'
+                    IF (attoutflag .EQ. 1) oflag = 'T'
+                 ELSE
+                    attbuff = ' '
+                    blen = 1
+                    oflag = ' '
+                 ENDIF
+
+                 slen = TM_LENSTR1(attname)
+                 buff = TM_FMT (FLOAT(attlen),7,14,llen)
+		 IF (vlen+slen+llen+blen+20 .LE. len_attbuff) THEN
+                    WRITE (risc_buff, 3300) varname(1:vlen), typ(vtype),
+     .                 attname(1:slen), typ(attype), buff(1:llen), oflag,
+     .                 attbuff(1:blen)
+                 ELSE
+                    WRITE (risc_buff, 3301) varname(1:vlen), typ(vtype),
+     .                 attname(1:slen), typ(attype), buff(1:llen), oflag
+                    CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+                    WRITE (risc_buff, 3302) attbuff(1:len_attbuff-2)
+                 ENDIF
+                 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+                 risc_buff = ' '
+                 varname = ' '
+ 100         CONTINUE
+             WRITE (lun, *) ' '
+
+        ENDIF
+
+* Write attributes for all variables
+        IF (nvars .GE. 1) THEN
+
+           DO 300 varid = 1, nvars
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vtype, nvdims,
+     .           vdims, nvatts, coordvar, all_outflag, status)
+              IF (varid .EQ. 0) vtype = 7  ! 
+              vlen = TM_LENSTR1(varname)
+
+              IF (nvatts .EQ. 0) THEN
+                 IF (coordvar) THEN
+                    WRITE (risc_buff, 3400) varname(1:vlen), typ(vtype)
+                 ELSE
+                    WRITE (risc_buff, 3300) varname(1:vlen), typ(vtype)
+                 ENDIF
+		 
+		 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+              ENDIF
+
+              DO 200 iatt = 1, nvatts
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+                 blen = len_attbuff
+                 got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .                                .TRUE., varname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+
+                 IF (got_it) THEN
+                    IF (attype .NE. NCCHAR) THEN
+                       blen = 1
+                       attbuff = ' '
+                       DO 150 i = 1, attlen
+                          buff = TM_FMT(vals(i), 7, 14, llen)
+                          attbuff(blen:blen+llen+1) = buff//' '
+                          blen = blen + llen + 1
+ 150                   CONTINUE
+                    ELSE 
+                       blen = TM_LENSTR1(attbuff)
+                    ENDIF
+                    oflag = 'F'
+                    IF (attoutflag .EQ. 1) oflag = 'T'
+                 ELSE
+                    attbuff = ' '
+                    blen = 1
+                    oflag = ' '
+                 ENDIF
+
+                 slen = TM_LENSTR1(attname)
+                 buff = TM_FMT (FLOAT(attlen),7,14,llen) 
+                
+                 IF (iatt .EQ. 1) THEN
+                    IF (coordvar) THEN
+                       WRITE (risc_buff, 3400) varname(1:vlen), 
+     .                    typ(vtype), attname(1:slen), typ(attype), 
+     .                    buff(1:llen), oflag, attbuff(1:blen)
+                    ELSE
+		    IF (vlen+slen+llen+blen+20 .LE. len_attbuff) THEN
+                       WRITE (risc_buff, 3300) varname(1:vlen), typ(vtype),
+     .                 attname(1:slen), typ(attype), buff(1:llen), oflag,
+     .                 attbuff(1:blen)
+		    ELSE
+                       WRITE (risc_buff, 3301) varname(1:vlen), typ(vtype),
+     .                 attname(1:slen), typ(attype), buff(1:llen), oflag
+                       CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+                    WRITE (risc_buff, 3302) attbuff(1:len_attbuff-2)
+                    ENDIF
+                    ENDIF
+                 ELSE 
+                    WRITE (risc_buff, 3500) 
+     .                  attname(1:slen), typ(attype), buff(1:llen),
+     .                  oflag, attbuff(1:blen)
+                 ENDIF
+
+                 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+
+                 risc_buff = ' '
+ 200          CONTINUE
+              WRITE (lun, *) ' '
+ 300       CONTINUE
+        ENDIF
+
+5100    RETURN
+
+	END
diff --git a/fer/gnl/show_data_set_params.F b/fer/gnl/show_data_set_params.F
new file mode 100644
index 0000000..dd53490
--- /dev/null
+++ b/fer/gnl/show_data_set_params.F
@@ -0,0 +1,121 @@
+	SUBROUTINE SHOW_DATA_SET_PARAMS( lun, dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* describe the diagnostic parameters of the given data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  1/10/89 - based on SHOW_DATA_SET 0.2
+* Unix/RISC port 3/91 *sh* - cannot use function in WRITE list
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xdset_parms.cmn'
+	include	'xrisc.cmn'
+
+* calling argument declarations:
+	INTEGER	lun, dset
+	
+* local parameters:
+	INTEGER	sigdig, mxlen
+	PARAMETER     ( sigdig = 5, mxlen = 20 )
+
+* local variable declarations:
+	INTEGER 	TM_LENSTR1, dlen, cairt
+	CHARACTER*4	buffer*24, TM_FMT*20
+
+* data set title (and possible modifier)
+	CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'     '//ds_title(dset)(:TM_LENSTR1(ds_title(dset)))
+     .								,0)
+	IF ( ds_mod_title(dset) .NE. ' ' ) CALL SPLIT_LIST
+     .		(pttmode_explct, lun,
+     .	'     '//ds_mod_title(dset)(:TM_LENSTR1(ds_mod_title(dset)))
+     .								,0)
+
+* describe the "type" of data set
+	IF ( dp_phil_sieg(dset) .OR. dp_cox(dset) ) CALL SPLIT_LIST
+     .	(pttmode_explct, lun,
+     .	'             Philander/Seigel diagnostic variables available'
+     .					,0)
+
+* special Philander/Seigel parameters:
+	IF ( dp_phil_sieg(dset) ) THEN
+* ... min. wind speed
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'           minimum wind speed: '//
+     .		TM_FMT(dp_min_wind(dset),sigdig,mxlen,dlen), 0 )
+* ... heat flux parameterization
+	   risc_buff = ' '
+	   IF ( dp_phil_qflux(dset) ) THEN
+	      WRITE (risc_buff, 3110) 'from Philander/Seigel'
+	   ELSEIF ( dp_ramp1_qflux(dset) ) THEN
+	      WRITE (risc_buff, 3110) 'single ramp - attenuate above 27 deg.'
+	   ELSEIF ( dp_ramp2_qflux(dset) ) THEN
+	      WRITE (risc_buff, 3110) 'double ramp - at T>27 and T<26'
+	   ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0 )
+* ... constant air/sst temp. delta
+	   IF ( dp_const_air_sst(dset) ) THEN
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .			'           constant air/SST difference: '//
+     .			TM_FMT(dp_delta_air_sst(dset),sigdig,mxlen,dlen), 0)
+           ENDIF
+* ... climatological air temp field
+	   cairt = dp_clim_air_sst( dset )		! cairt needed for calcs
+	   risc_buff = ' '
+	   WRITE (risc_buff,3130) dp_airt_name( cairt )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0 )
+* ... Am factor
+	   buffer = TM_FMT( dp_Am_factor(dset), sigdig, mxlen, dlen )
+	   risc_buff = ' '
+	   WRITE (risc_buff,3140) buffer 
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0 )
+	ENDIF
+ 3110	FORMAT ( T12,'surface radiation parameterization: ',A)
+ 3120	FORMAT ( T12,'constant air/SST difference: ',A)
+ 3130	FORMAT ( T12,A,' climatological air temperature field')
+ 3140	FORMAT ( T12,'horizontal momentum Am = ',A )
+
+	RETURN
+	END
diff --git a/fer/gnl/show_data_set_vars.F b/fer/gnl/show_data_set_vars.F
new file mode 100644
index 0000000..fcd88fe
--- /dev/null
+++ b/fer/gnl/show_data_set_vars.F
@@ -0,0 +1,487 @@
+	SUBROUTINE SHOW_DATA_SET_VARS( lun, dset, full, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* describe the variables in the named data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  1/10/89 - based on SHOW_DATA_SET 0.2
+*			  - with added world coordinate output
+* V200:  8/31/90 - changed field widths for subscript limits
+* Unix/RISC port 3/11/91 *sh* - eliminated "unaligned data access" errors when
+*                               writing variables
+* V230: ?? - formatting changes to accomodate indices of more than 4 digits
+*     6/92 - locate a grid using this time axis for "time range"
+*     7/92 - bypass listing of variables named "-" (EZ data sets)
+*    11/92 - increased length of variable names 8 --> 24 characters
+* V301: 3/94 - bug fix: no time range display for T-independent data sets
+*    3/16/94 - repaired bug introduced 3/3/94 for EZ data set
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/18/95 - show units in full listing  
+* V402: 8/95 - Added support for  LET/D=dset var = ...
+*	     - Added missing data flag to outputs
+* V420:	10/95 - extended missing flag output to cover dual flags
+* V500: 3/99 *kob* - added check for NORMAL Axes - output only ... rather
+*                    than a 1:1 or 100:100
+*       4/99 *kob* - bug fix to above - check grid_line to see if axis is
+*                    truly normal
+* V510: 4/00 *sh* - search dynamic grids for netCDF time axis
+* V530: 10/00 *sh* - added information about data typed
+* v530  *acm* 3/01 - Show calendar name for alternative calendar types.
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+* V570  *acm* when showing calendar, need  cal_id .LE. max_calendars, not .LT.
+* V600  *acm* 1/06  prevent values of LOG10(0.0) 
+* V68   *acm* 12/11 Fix ticket 1905. Axis-lengths that need more than 6 characters
+*                   were being cut off.
+* PyFr  *kms* 11/10 added display of pyvars associated with the dataset
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+* v6.85  *acm* 4/13 Can show grid for variables in an ensemble aggregated dataset.
+* v6.85  *acm* 10/13 See ticket 1098, extraneous lines when error getting grid.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'ez_lib.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'errmsg.parm'
+	include 'xez_info.cmn_text'
+	external xez_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+        include 'xpyvar_info.cmn'
+
+* calling argument declarations:
+	LOGICAL	full
+	INTEGER	lun, dset, status
+	
+* local variable declarations:
+	LOGICAL		first_time, its_delimited, is_undetermined
+	INTEGER 	TM_LENSTR1, TM_LENSTR, TM_GET_CALENDAR_ID, GRID_FROM_NAME,
+     .			ivar, i, dlen, len, grid, taxis, slen(nferdims), tlen, 
+     .			nfields, kvar, field_types(maxezvars), 
+     .			cal_id, len_cal, j, num_indices, rlen(nferdims), iok,
+     .			listdims, idim, igrid, nv
+	CHARACTER	LEFINT*16, LOHI_STRING*48, TM_FMT*14, 
+     .			TM_GET_CAL*32, 
+     .			line*255, cal_name*32
+	REAL*8		TM_WORLD, lo, hi
+        CHARACTER       rbuff(12)*8, short*6, long*16, delims*128, c*1
+
+* internal parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+
+* initialize
+	its_delimited = ds_type(dset) .EQ. pds_type_ez
+     .            .AND. ds_parm_text(1,dset)(:4) .eq. 'DELI'
+
+	IF (its_delimited) THEN
+	   CALL GET_DELIMITED_INFO(nfields, field_types, delims, 
+     .				   ds_file_info_ptr(dset) )
+	ENDIF
+
+* If mode 6d_lab has been canceled, we will list only the first 4 dimensions.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+	status = ferr_ok
+
+* describe the variables in the set
+
+	risc_buff = ' '
+	IF (listdims .EQ. nferdims) THEN
+           WRITE ( risc_buff, 3200 )
+	ELSE
+           WRITE ( risc_buff, 3210 )
+	ENDIF
+
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+	kvar = 0
+	DO 400 ivar = 1, maxvars
+	   IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 400
+	   kvar = kvar + 1
+           IF ( ds_var_code(ivar) .EQ. '-' ) GOTO 400  
+* ... output variable code, title and subscript bounds within grid
+
+	   is_undetermined = .TRUE.
+	   DO 200 idim = 1, nferdims
+	      IF (ds_grid_start(1,ivar) .NE. int4_init) 
+     .            is_undetermined = .FALSE. 
+  200	   CONTINUE
+
+* Is this an aggregated dataset? - if so then we can go get the grid.
+* GRID_FROM_NAME increments the use count for the grid, so call
+* DEALLO_DYN_GRID to restore the count where it should be.
+
+           IF (is_undetermined .AND. ds_type(dset).EQ.'ENS') THEN
+	      igrid = GRID_FROM_NAME(ds_var_code(ivar), cx_last, status)
+	      IF (status .NE. ferr_ok) GOTO 5000
+	      CALL TM_DEALLO_DYN_GRID (igrid)  
+
+*  Fill the grid in as in is_aggregate_grid
+
+	      IF (igrid .NE. unspecified_int4) THEN
+	         DO 220 nv = 1, maxvars
+	            IF (ds_grid_number(nv) .EQ. igrid)  GOTO 225
+ 220	         CONTINUE
+ 225	         CONTINUE
+	      ENDIF
+
+	      IF (nv .LE. maxvars) THEN
+	         DO 230 idim = 1, nferdims
+	            ds_grid_start(idim,ivar)= ds_grid_start(idim,nv)
+	            ds_grid_end(idim,ivar)  = ds_grid_end(idim,nv)
+	            ds_ordering(idim,ivar)  = ds_ordering(idim,nv)
+ 230	         CONTINUE
+	         is_undetermined = .FALSE.
+              ENDIF
+           ENDIF
+
+           IF (.NOT.is_undetermined) THEN
+	      
+              DO 100 i = 1, listdims
+                 WRITE( rbuff(i+listdims),'(I8)' ) ds_grid_start(i,ivar)
+                 IF (FLOAT(ds_grid_start(i,ivar)) .EQ. 0.0) THEN
+                    slen(i) = 1
+                 ELSE
+                    slen(i)  = LOG10( FLOAT(ds_grid_start(i,ivar)) )
+                 ENDIF
+                 slen(i)  = MIN( 6, 8-slen(i) )   ! last few characters in buffer
+                 long = LEFINT(ds_grid_end(i,ivar),dlen)
+                 rlen(i) = dlen
+                 short = LEFINT(ds_grid_end(i,ivar),dlen)
+                 rbuff(i) = short
+ 100          CONTINUE
+           ENDIF
+
+	   line = ds_var_code(ivar)
+* ... separate into two lines if variable code is too long (11/92)
+           IF ( TM_LENSTR1( line ) .GT. 8 ) THEN
+	      risc_buff = ' '
+              WRITE ( risc_buff, '(1X,A)' ) ds_var_code(ivar)
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+              line = ' '
+           ENDIF
+	   IF (is_undetermined) THEN 
+	      WRITE ( risc_buff, 4011 )	line,
+     .				        ds_var_title(ivar),
+     .				        '... Aggregate grid undetermined' 
+           ELSE
+	      WRITE ( risc_buff, 4010 )	line,
+     .				        ds_var_title(ivar),
+     .	     (rbuff(i+listdims)(slen(i):),rbuff(i)(:6),i=1,listdims)
+
+ 4010	      FORMAT( 1X,A8,1X,A31,T42,6(A,':',A) )
+ 4011	      FORMAT( 1X,A8,1X,A31,T42,A )
+* *kob* 3/99 check for NORMAL Axis and insert ... rather than 1:1 
+              DO 150 i = 1, listdims
+	         IF ( grid_line(i,ds_grid_number(ivar)) .EQ. mnormal) THEN
+		    tlen = 34 + (i*10)
+		    risc_buff(tlen:tlen+2) = '...'
+	         ENDIF
+ 150	      CONTINUE
+
+           ENDIF
+
+* See if any axis lengths were too long for the standard formatting.
+* Do a more brute-force formatting which may or may not line up 
+* all variables perfectly
+
+           iok = 1
+           DO 160 i = 1, listdims
+	      IF (rlen(i) .GT. 6) iok = 0
+ 160	   CONTINUE
+
+	   IF (iok .EQ. 0) THEN  ! re-format the line for this variable
+	   
+           line = ds_var_code(ivar)
+* ... separate into two lines if variable code is too long (11/92)
+           IF ( TM_LENSTR1( line ) .GT. 8 ) THEN
+	      risc_buff = ' '
+              WRITE ( risc_buff, '(1X,A)' ) ds_var_code(ivar)
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+              line = ' '
+           ENDIF
+	   WRITE ( risc_buff, 4010 )	line,
+     .				        ds_var_title(ivar)
+           tlen = MAX(40, TM_LENSTR1(risc_buff))
+	   risc_buff(tlen+1:tlen+2) = '  ' 
+           tlen = tlen + 2
+
+           DO 170 i = 1, listdims
+	      IF ( grid_line(i,ds_grid_number(ivar)) .EQ. mnormal) THEN
+		 risc_buff(tlen:tlen+8) = '   ...   '
+		 tlen = tlen + 9
+              ELSE
+                 long = LEFINT(ds_grid_start(i,ivar),dlen)
+	         risc_buff(tlen+1:tlen+dlen) = long(1:dlen)
+	         tlen = TM_LENSTR1(risc_buff)
+	         risc_buff(tlen+1:tlen+1) = ":"
+	         tlen = tlen + 1
+                 long = LEFINT(ds_grid_end(i,ivar),dlen)
+	         risc_buff(tlen+1:tlen+dlen) = long(1:dlen)
+	         tlen = TM_LENSTR1(risc_buff)
+	         risc_buff(tlen+1:tlen+2) = '  ' 
+	         tlen = tlen + 2
+
+	      ENDIF
+ 170	   CONTINUE
+	   ENDIF ! iok
+
+ 3200	FORMAT(' name',T11,'title',T45,'I',T55,'J',T65,'K',T75,'L',T85,'M',T95,'N')
+ 3210	FORMAT(' name',T11,'title',T45,'I',T55,'J',T65,'K',T75,'L')
+
+* ... write to array first to avoid line wraps due to blanks at end
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0) 
+
+* ... if there is modifying title info give it to
+	      IF ( ds_var_titl_mod(ivar) .NE. ' '  ) CALL SPLIT_LIST
+     .	(pttmode_explct, lun, '       ('//
+     .	ds_var_titl_mod(ivar)(:TM_LENSTR1(ds_var_titl_mod(ivar)))
+     .	//')', 0) 
+
+* "FULL" output, only below
+	   IF ( full ) THEN
+	      grid = ds_grid_number(ivar)
+
+* ... data type if interesting
+	      IF (ds_var_type(ivar) .EQ. ptype_string ) THEN
+	        CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'            '//'Data type = TEXT', 28)
+	      ELSEIF (its_delimited                   ) THEN
+	        CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'            '//'Data type = NUMERIC', 31)
+	      ENDIF
+
+* ... field type conversion
+	      IF (its_delimited) THEN
+	        CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'            '//'Conversion /TYPE='//
+     .			     ftyp_name(field_types(kvar)), 0)
+	      ENDIF
+
+* ... "<units> on grid <name> with 1E35 & -999 for missing data"
+	      dlen = TM_LENSTR1( ds_var_units(ivar) )
+	      line = '             '//ds_var_units(ivar)(:dlen)//
+     .		' on grid '//grid_name(grid)
+	      dlen = TM_LENSTR1( line )
+#ifdef NO_PREPEND_STRING
+	      risc_buff = line(:dlen)
+	      len_rbuff = dlen
+	      line = risc_buff(:len_rbuff)//' with '//
+#else
+	      line = line(:dlen)//' with '//
+#endif
+     .				TM_FMT(ds_bad_flag(ivar),7,14,dlen)
+	      dlen = TM_LENSTR1( line )
+	      IF ( ds_bad_flag(ivar) .NE. ds_missing_flag(ivar) ) THEN
+#ifdef NO_PREPEND_STRING
+	      risc_buff = line(:dlen)
+	      len_rbuff = dlen
+	      line = risc_buff(:len_rbuff)//' & '//
+#else
+	         line = line(:dlen)//' & '//
+#endif
+     .				TM_FMT(ds_missing_flag(ivar),7,14,dlen)
+	         dlen = TM_LENSTR1( line )
+	      ENDIF
+	      line = line(:dlen)//' for missing data'
+	      CALL SPLIT_LIST(pttmode_explct, lun, line, 0)
+* ... world coordinate limits
+	      line = ' '
+	      len = 1
+	      DO 300 i = 1, listdims
+	         IF ( grid_line(i,grid) .NE. mnormal ) THEN
+
+	            IF (i .NE. 4) THEN  ! Skip time dim
+
+	               lo = TM_WORLD( ds_grid_start(i,ivar), grid, i, box_lo_lim )
+	               hi = TM_WORLD( ds_grid_end  (i,ivar), grid, i, box_hi_lim )
+#ifdef NO_PREPEND_STRING
+	               risc_buff = line(:len)
+ 	               len_rbuff = len
+		       line = risc_buff(:len_rbuff)// ww_dim_name(i) // '=' //
+#else
+		       line = line(:len) // ww_dim_name(i) // '=' //
+#endif
+     .			 LOHI_STRING( lo,hi,i,grid,':',ax_dec_pt(i),dlen )
+     .			 // '  '
+	               len = MIN( 64, len+4+dlen )  ! ??
+	            ENDIF ! Skip time dim
+
+	         ENDIF
+ 300	      CONTINUE
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .		'            '//line(:len), len+12)
+	   ENDIF
+
+ 400	CONTINUE
+
+* describe the time range (uses "grid" from last variable displayed)
+	taxis = ds_time_axis(dset)
+* ... check among the static grids
+        DO 500 grid = 1, max_grids
+ 500    IF ( grid_line(t_dim,grid) .EQ. taxis ) GOTO 520
+* ... check among the dynamic grids
+	grid = 0
+ 510	CALL TM_NEXT_DYN_GRID( grid, *515)
+	  IF ( grid_line(t_dim,grid) .EQ. taxis ) GOTO 520
+	GOTO 510
+ 515	grid = 1		!  internal error if we get here !!
+ 520    IF ( full .AND. taxis.NE.mnormal
+     .		  .AND. taxis.NE.unspecified_int4) THEN    ! bug fix: 3/94
+	   len = line_dim( ds_time_axis(dset) )
+	   lo = TM_WORLD( 1,   grid, t_dim, box_middle )
+	   hi = TM_WORLD( len, grid, t_dim, box_middle )
+	   line = LOHI_STRING( lo,hi,t_dim,grid,' to ',ax_dec_pt(t_dim),dlen )
+	   CALL SPLIT_LIST(pttmode_explct, lun, ' ', 1)
+
+* calendar name?  only if not Gregorian.
+	   cal_name = TM_GET_CAL (grid)
+	   cal_id = TM_GET_CALENDAR_ID (cal_name)
+	   IF (cal_id .GT. gregorian .AND. cal_id .LE. max_calendars) THEN
+	      len_cal = TM_LENSTR(cal_name)
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .	       '  time range: '//line(:dlen)//
+     .	       ' Calendar:'//cal_name(:len_cal), 0) 
+	   ELSE
+	      CALL SPLIT_LIST(pttmode_explct, lun,
+     .			'  time range: '//line(:dlen), 0) 
+	   ENDIF
+	ENDIF
+
+* show the data-set-specific pyvar (cat_pystat_var) variables
+        first_time = .TRUE.
+        DO 580 i = 1,maxpyvars
+            IF ( pyvar_ndarray_obj(i) .EQ. 0 ) GOTO 580
+            IF ( pyvar_dset_number(i) .NE. dset ) GOTO 580
+            IF ( first_time ) THEN
+                CALL SPLIT_LIST(pttmode_explct, lun,
+     .                          ' ------ Python Variables ------', 31) 
+                first_time = .FALSE.
+            ENDIF
+            CALL SHOW_1_PYVAR(lun, i, full)
+ 580    CONTINUE
+
+* show the data-set-specific user-defined variables
+* Skip intermediate variables by checking uvar_parent
+
+	first_time = .TRUE.
+*	DO 600 i = 1, max_uvar
+*	   IF (uvar_num_items(i) .EQ. uvar_deleted  ) GOTO 600
+        CALL deleted_list_get_undel(uvar_num_items_head,
+     .                              deleted_list_result(1),
+     .                              max_uvar, num_indices )
+        DO 600 j = 1, num_indices
+           i = deleted_list_result(j)
+	   IF (uvar_dset(i) .EQ. dset .AND.
+     .         uvar_parent(i) .EQ. 0   ) THEN
+	      IF ( first_time ) THEN
+	         CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' ------------------------------', 31) 
+	         first_time = .FALSE.
+	      ENDIF
+	      CALL  SHOW_1_UVAR(lun, i, line, ' ', full)
+	   ENDIF
+ 600	CONTINUE
+
+* end with a blank line
+	CALL SPLIT_LIST(pttmode_explct, lun, ' ', 1) 
+
+* show delimiters used for delimited files
+	IF (full .AND. its_delimited) THEN
+* ... convert delimiter string into readabl;e form
+	  line = ' '
+	  len = 0
+* ... a DO-WHILE loop until the null is encountered
+	  i = 0
+ 700	  i = i + 1
+	    c = delims(i:i)
+	    IF (c.EQ.CHAR(0)) THEN
+	      len = len - 1   ! remove final comma
+	      GOTO 710
+	    ELSEIF (c.EQ.tab) THEN
+	      len = len + 2
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+              line(len-1:len) = '\'//'t'
+#else
+              line(len-1:len) = '\\'//'t'
+#endif	     
+	    ELSEIF (c.EQ.',') THEN
+	      len = len + 2
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+              line(len-1:len) = '\'//','
+#else
+              line(len-1:len) = '\\'//','
+#endif	     
+	    ELSEIF ( (c.GE.' ' .AND. c.LE.'~') )THEN
+	      len = len + 1
+	      line(len:len) = c  ! printable character
+	    ELSE
+	      len = len + 3
+	      WRITE (line(len-2:len),'(I3.3)') ICHAR(c) 
+	    ENDIF
+	    len = len + 1
+	    line(len:len) = ','
+	  GOTO 700
+ 710	  CALL SPLIT_LIST(pttmode_explct, lun,
+     .			  ' /DELIMITERS="'//line(:len)//'"', len+15) 
+	ENDIF
+
+5000    RETURN
+5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'variable has more than 4 dimensions. Set mode 6D_LAB'
+     .		     //pCR//cmnd_buff(:len_cmnd),
+     .			*5000 )
+	END
diff --git a/fer/gnl/show_data_set_vars_xml.F b/fer/gnl/show_data_set_vars_xml.F
new file mode 100644
index 0000000..f1b0824
--- /dev/null
+++ b/fer/gnl/show_data_set_vars_xml.F
@@ -0,0 +1,608 @@
+	SUBROUTINE SHOW_DATA_SET_VARS_XML( lun, dset)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* List information about all variables in the data set in xml-style format
+
+* programmer - Ansley Manke, based on show_data_set_vars.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+* V5.80 13-Sep-2004 *acm* Add data-set specific user variables to the listing
+*       13-Oct-2004 *acm* Make the current dataset the default dataset so
+*                         we can get all the info on dataset-specific user-defined
+*                         variables in all files.
+* V6.1  2/2008 *acm* Use attribute structure to get all attributes for the variable.
+* V612  8/2007 *acm* Revert to old xml style output for infile_datatype and 
+*                    ferret_datatype attributes
+* V616 12/2008 *acm* Close the tag correctly; line written using format 2075 needs
+*                    the attribute name given a second time.
+* V616  1/2009 *acm* Fixing LAS ticket 481, new style of xml output
+* V631 11/09 *acm* For XML-formatted output check for and replace the strings < > and &
+*                  with < etc.
+* V650  2/10 *acm* LAS ticket 761: consistency of the missing-value flags. Use a Fortran
+*                  format rather than TM_FMT to write the value to the xml output.
+* V67  *acm* 2/11  XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+* V685 *acm* 2/13  Always list the default Ferret bad-flag in the xml header. The script 
+*                  get_datavar.jnl under LAS iosp/scripts makes sure that is the value written 
+*                  to the netcdf data files.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'ez_lib.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xez_info.cmn_text'
+	external xez_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+	include	'xcontext.cmn'
+	include 'errmsg.parm'
+        include 'netcdf.inc'
+
+* calling argument declarations:
+	INTEGER	lun, dset
+	
+* local variable declarations:
+	INTEGER   TM_LENSTR, TM_LENSTR1, GRID_FROM_NAME_XML,
+     .            STR_SAME, 
+     .            ivar, slen, llen, grid, cx_expr, dset_save,
+     .            varid, vtype, nvdims, vdims(8), nvatts, blen, i, 
+     .            len_attbuff, attoutflag, all_outflag, attid, 
+     .            attlen, attype, iatt, iset, alen, npts, status
+	REAL      vals(100)
+
+        LOGICAL   NC_GET_ATTRIB, got_it, coordvar, newatt, have_units,
+     .            have_title, have_dims
+
+        CHARACTER show_str*128
+        CHARACTER uvarname*150, attname*128, attbuff*2048, buff*128,
+     .            outstring*2048, aname*128, atype*10
+
+C New form for attribute output, dont implement it yet. (Check the
+C Write statement that uses number 2075 when we change to using these.)
+
+ 2010  FORMAT ('<var name="', A, '">' )
+ 2020  FORMAT ('<attribute name="', A, '" type="char">' )
+ 2030  FORMAT ('<attribute name="', A, '" type="float">' )
+ 2040  FORMAT ('<attribute name="',  A, '" type="', A,'">' )
+
+ 2050  FORMAT ('   <value>', A, '</value>')
+ 2055  FORMAT ('   <value><![CDATA[', A, ']]></value>')
+ 2060  FORMAT ('</attribute>')
+
+ 2070  FORMAT ('</var>')
+
+* describe the variables in the set, including a report on the axes of this grid.
+
+* Initialize flag for writing axes that are used in the dataset variables.
+
+	DO 100 i = 1, line_ceiling
+	   line_write(i) = .FALSE.
+ 100	CONTINUE
+
+* temporarily make this the default data set
+
+        dset_save = cx_data_set(cx_last)
+        cx_data_set(cx_last) = dset
+
+	DO 400 ivar = 1, maxvars
+	   IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 400
+
+           IF ( ds_var_code(ivar) .EQ. '-' ) GOTO 400  
+
+* ... output variable code, units, grid, and type
+
+*           slen = TM_LENSTR1(ds_var_code(ivar))
+
+          uvarname = ds_var_code(ivar)
+
+           CALL CD_GET_VAR_ID (dset, uvarname, varid, status)
+           CALL CD_GET_VAR_INFO (dset, varid, uvarname, vtype, nvdims,
+     .           vdims, nvatts, coordvar, all_outflag, status)
+
+           CALL string_array_get_strlen1(ds_var_code_head, ivar, slen)
+           CALL ESCAPE_FOR_XML (uvarname, outstring, slen)
+           WRITE ( risc_buff, 2010 ) outstring(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           slen = TM_LENSTR(ds_var_units(ivar))
+           IF (ds_var_units(ivar)(1:2) .NE. char_init 
+     .           .AND. slen.GT.0) THEN
+              CALL ESCAPE_FOR_XML (ds_var_units(ivar), outstring, slen)
+              WRITE ( risc_buff, 2020 ) 'units'
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE (risc_buff, 2055) outstring(1:slen)
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2060 ) 
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           ENDIF
+
+           slen = TM_LENSTR(ds_var_title(ivar))
+           IF (ds_var_title(ivar)(1:2) .NE. char_init 
+     .           .AND. slen.GT.0) THEN
+              CALL ESCAPE_FOR_XML (ds_var_title(ivar), outstring, slen)
+              WRITE ( risc_buff, 2020 ) 'long_name'
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE (risc_buff, 2055) outstring(1:slen)
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2060 ) 
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           ENDIF
+
+           slen = TM_LENSTR(ds_var_titl_mod(ivar))
+           IF (ds_var_titl_mod(ivar)(1:2) .NE. char_init 
+     .           .AND. slen.GT.0) THEN
+              CALL ESCAPE_FOR_XML (ds_var_titl_mod(ivar), outstring, slen)
+              WRITE ( risc_buff, 2020 ) 'history'
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE (risc_buff, 2055) outstring(1:slen)
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2060 ) 
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           ENDIF
+
+! missing_flag comes from attribute FillValue; 
+! bad_flag comes from missing_value
+
+          uvarname = ds_var_code(ivar)
+          CALL CD_GET_VAR_ID (dset, uvarname, varid, status)
+	   
+          attname = '_FillValue'
+          CALL CD_GET_VAR_ATT_ID (dset, varid, attname, iatt, status)
+          IF (status .EQ. ferr_ok) THEN
+
+             CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, attype, 
+     .          attlen, attoutflag, status )
+             got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .          .TRUE., uvarname, blen, attlen, 
+     .          attoutflag, attbuff, vals)
+
+* For double-prec Ferret, check whether we need more precision to write the value
+
+	     CALL FLOAT2STRING_FOR_XML (vals(1), attype, show_str, slen)
+
+             CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+             WRITE ( risc_buff, 2030 ) '_FillValue' 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE (risc_buff, 2050) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+          ENDIF
+
+          attname = 'missing_value'
+          CALL CD_GET_VAR_ATT_ID (dset, varid, attname, iatt, status)
+          IF (status .EQ. ferr_ok) THEN
+
+             CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, attype, 
+     .          attlen, attoutflag, status )
+             got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .          .TRUE., uvarname, blen, attlen, 
+     .          attoutflag, attbuff, vals)
+	     
+	     CALL FLOAT2STRING_FOR_XML (vals(1), attype, show_str, slen)
+
+             CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+             WRITE ( risc_buff, 2030 ) 'missing_value'
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE (risc_buff, 2050) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+          ENDIF
+
+
+          IF (ds_var_type(ivar) .EQ. ptype_string ) THEN
+             show_str = 'STRING'
+          ELSE
+             show_str = 'FLOAT'
+          ENDIF
+          CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+          WRITE ( risc_buff, 2020 ) 'ferret_datatype'
+          CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+          WRITE (risc_buff, 2055) outstring(1:slen)
+          CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+          WRITE ( risc_buff, 2060 ) 
+          CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* other attributes
+
+           uvarname = ds_var_code(ivar)
+           CALL CD_GET_VAR_ID (dset, uvarname, varid, status)
+           CALL CD_GET_VAR_INFO (dset, varid, uvarname, vtype, nvdims,
+     .           vdims, nvatts, coordvar, all_outflag, status)
+
+* Data type of the variable in the file...
+
+           IF (vtype .EQ. ncbyte ) THEN
+              show_str = 'BYTE'
+           ELSE IF (vtype .EQ. ncchar ) THEN
+              show_str = 'CHAR'
+           ELSE IF (vtype .EQ. ncshort ) THEN
+              show_str = 'SHORT'
+           ELSE IF (vtype .EQ. nclong ) THEN
+              show_str = 'LONG'
+           ELSE IF (vtype .EQ. ncfloat ) THEN
+              show_str = 'FLOAT'
+           ELSE IF (vtype .EQ. ncdouble ) THEN
+              show_str = 'DOUBLE'
+           ENDIF
+
+           CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+           WRITE ( risc_buff, 2020 ) 'infile_datatype'
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           WRITE (risc_buff, 2055) outstring(1:slen)
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           WRITE ( risc_buff, 2060 ) 
+           CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* All attributes not already listed.
+* Skip 'parent_grid', 'slab_min_index', 'slab_max_index' as these
+* wind up causing an incomplete spec of the grid in the F-TDS dataset
+
+           DO 200 iatt = 1, nvatts
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+              newatt = .TRUE.
+              newatt = (STR_SAME(attname, 'units') .NE. 0)       .AND. 
+     .              (STR_SAME(attname, 'long_name') .NE. 0)      .AND. 
+     .              (STR_SAME(attname, 'history') .NE. 0)        .AND. 
+     .              (STR_SAME(attname, 'missing_value') .NE. 0)  .AND. 
+     .              (STR_SAME(attname, '_FillValue') .NE. 0)     .AND. 
+     .              (STR_SAME(attname, 'parent_grid') .NE. 0)    .AND. 
+     .              (STR_SAME(attname, 'slab_min_index') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'slab_max_index') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'ferret_datatype') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'infile_datatype') .NE. 0)
+
+              IF (newatt) THEN
+                 blen = 2048  ! len of attbuff
+                 got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .                                .TRUE., uvarname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+                 IF (attlen .GT. 0) THEN
+
+                 CALL ESCAPE_FOR_XML (attname, aname, slen)
+
+		 IF (attype .EQ. NCCHAR)   atype = 'char'
+		 IF (attype .EQ. NCBYTE)   atype = 'byte'
+		 IF (attype .EQ. NCSHORT)  atype = 'int'
+		 IF (attype .EQ. NCLONG)   atype = 'int'
+		 IF (attype .EQ. NCFLOAT)  atype = 'float'
+		 IF (attype .EQ. NCDOUBLE) atype = 'double'
+		 alen = TM_LENSTR1(atype)
+
+		 WRITE (risc_buff, 2040) aname(1:slen), atype(1:alen)
+		 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+		 IF (attype .NE. NCCHAR) THEN
+		    slen = 1
+		    attbuff = ' '
+		    DO 150 i = 1, attlen
+                       CALL FLOAT2STRING_FOR_XML (vals(i), attype, buff, slen)
+
+                       CALL ESCAPE_FOR_XML (buff, outstring, llen)
+                       WRITE ( risc_buff, 2050 ) outstring(1:llen)
+                       CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+ 150                CONTINUE
+		 ELSE 
+		    CALL ESCAPE_FOR_XML (attbuff, outstring, llen)
+		    WRITE ( risc_buff, 2055 ) outstring(1:llen)
+		    CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+		 ENDIF
+
+		 WRITE ( risc_buff, 2060 )
+		 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+              ENDIF  ! attlen GT 0
+              ENDIF
+
+ 200       CONTINUE
+
+           grid = ds_grid_number(ivar)
+
+! If its a string get the name and length of the string dimension.
+           IF (vtype .EQ. NCCHAR ) THEN
+              CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts, status)
+              CALL SHOW_GRID_STRING_XML (lun, grid, unspecified_int4,
+     .                  buff, npts)
+	   ELSE
+              CALL SHOW_GRID_XML (lun, grid, unspecified_int4)
+	   ENDIF
+
+	   WRITE ( risc_buff, 2070 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+ 400	CONTINUE
+
+* show the data-set-specific user-defined variables
+
+	DO 600 ivar = 1, max_uvar
+	   IF (uvar_num_items(ivar) .EQ. uvar_deleted  ) GOTO 600
+	   IF (uvar_dset(ivar) .EQ. dset) THEN
+
+* ... output variable code, units, grid, and type
+*     Skip intermediate variables by checking uvar_parent
+
+             uvarname = uvar_name_code(ivar)
+             IF (uvar_parent(ivar) .NE. 0) GOTO 600
+
+	     iset = -1
+	     CALL CD_GET_VAR_ID (iset, uvarname, varid, status)
+             CALL CD_GET_VAR_INFO (iset, varid, uvarname, vtype, nvdims, 
+     .          vdims, nvatts, coordvar, all_outflag, status)
+
+             CALL ESCAPE_FOR_XML (uvarname, outstring, slen)
+             WRITE ( risc_buff, 2010 ) outstring(1:slen)
+
+
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             slen = TM_LENSTR1(uvar_text(ivar))
+             CALL ESCAPE_FOR_XML (uvar_text(ivar), outstring, slen)
+             WRITE ( risc_buff, 2020 ) 'definition'
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE (risc_buff, 2055) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+
+* Write the units and title
+             slen = TM_LENSTR(uvar_units(ivar))
+             IF (uvar_units(ivar)(1:2) .NE. char_init 
+     .             .AND. slen.GT.0) THEN
+                slen = TM_LENSTR1(uvar_units(ivar))
+                CALL ESCAPE_FOR_XML (uvar_units(ivar), outstring, slen)
+                WRITE ( risc_buff, 2020 ) 'units'
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+                WRITE (risc_buff, 2055) outstring(1:slen)
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+                WRITE ( risc_buff, 2060 ) 
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+		have_units = .TRUE.
+             ENDIF
+
+             slen = TM_LENSTR(uvar_title(ivar))
+             IF (uvar_title(ivar)(1:2) .NE. char_init 
+     .             .AND. slen.GT.0) THEN
+                CALL ESCAPE_FOR_XML (uvar_title(ivar), outstring, slen)
+                WRITE ( risc_buff, 2020 ) 'long_name'
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+                WRITE (risc_buff, 2055) outstring(1:slen)
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+                WRITE ( risc_buff, 2060 ) 
+                CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+		have_title = .TRUE.
+             ENDIF
+
+! missing_flag and _FillValue same for user-variable 
+
+             CALL FLOAT2STRING_FOR_XML (uvar_bad_data(ivar), attype, show_str, slen)
+             CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+             WRITE ( risc_buff, 2030 ) '_FillValue' 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE (risc_buff, 2050) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+             WRITE ( risc_buff, 2030 ) 'missing_value'
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE (risc_buff, 2050) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+             IF (uvar_data_type(ivar,dset) .EQ. ptype_string ) THEN
+                show_str = 'STRING'
+             ELSE
+                show_str = 'FLOAT'
+             ENDIF
+
+             CALL ESCAPE_FOR_XML (show_str, outstring, slen)
+             WRITE ( risc_buff, 2020 ) 'ferret_datatype'
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+             WRITE (risc_buff, 2055) outstring(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+             WRITE ( risc_buff, 2060 ) 
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* Now get other attributes that may have been assigned.
+             iset = -1
+	     CALL CD_GET_VAR_ID (iset, uvarname, varid, status)
+             CALL CD_GET_VAR_INFO (iset, varid, uvarname, vtype, nvdims, 
+     .          vdims, nvatts, coordvar, all_outflag, status)
+             IF (status .NE. ferr_ok) GOTO 600  ! or where?
+             DO 700 iatt = 1, nvatts
+
+                CALL CD_GET_VAR_ATT_INFO (iset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+* All attributes not already listed.
+* Skip 'parent_grid', 'slab_min_index', 'slab_max_index' as these
+* wind up causing an incomplete spec of the grid in the F-TDS dataset.
+* For transformed variables, the range, min, and max from the original variable
+* do not apply.
+* Attributes are inherited from the defining variable. That variable got 
+* attributes direction, infile_datatype when writing from the header file
+* based on the original dataset.  Skip those two here.
+
+                newatt = .TRUE.
+                newatt = 
+     .              (STR_SAME(attname, 'missing_value')  .NE. 0) .AND. 
+     .              (STR_SAME(attname, '_FillValue')     .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'parent_grid')    .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'slab_min_index') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'slab_max_index') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'valid_range') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'valid_min') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'valid_max') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'direction') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'infile_datatype') .NE. 0)
+
+                IF (STR_SAME(attname, 'units').EQ.0 .AND.have_units) 
+     .                newatt = .FALSE.
+                IF (STR_SAME(attname, 'long_name').EQ.0 .AND.
+     .                have_title) newatt = .FALSE.
+
+
+                IF (newatt) THEN
+                   blen = 2048  ! len of attbuff
+                   got_it = NC_GET_ATTRIB (iset, varid, attname, 
+     .                                .TRUE., uvarname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+                   IF (attlen .GT. 0) THEN
+
+                   CALL ESCAPE_FOR_XML (attname, aname, slen)
+
+                   IF (attype .EQ. NCCHAR)   atype = 'char'
+                   IF (attype .EQ. NCBYTE)   atype = 'byte'
+                   IF (attype .EQ. NCSHORT)  atype = 'int'
+                   IF (attype .EQ. NCLONG)   atype = 'int'
+                   IF (attype .EQ. NCFLOAT)  atype = 'float'
+                   IF (attype .EQ. NCDOUBLE) atype = 'double'
+                   alen = TM_LENSTR1(atype)
+
+                   WRITE (risc_buff, 2040) aname(1:slen), atype(1:alen)
+                   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+                   IF (attype .NE. NCCHAR) THEN
+                      slen = 1
+                      attbuff = ' '
+                      DO 750 i = 1, attlen
+                         CALL FLOAT2STRING_FOR_XML (vals(i), attype, buff, slen)
+                         CALL ESCAPE_FOR_XML (buff, outstring, llen)
+                         WRITE ( risc_buff, 2050 ) outstring(1:llen)
+                         CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+ 750                  CONTINUE
+                   ELSE 
+		      CALL ESCAPE_FOR_XML (attbuff, outstring, llen)
+		      WRITE ( risc_buff, 2055 ) outstring(1:llen)
+		      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+		   ENDIF
+
+                   WRITE ( risc_buff, 2060 )
+                   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+                ENDIF  ! attlen GT 0
+                ENDIF
+ 
+ 700         CONTINUE
+
+* The grid
+             grid = GRID_FROM_NAME_XML( uvarname, cx_last, cx_expr, status )
+	     
+* If its a string get the name and length of the string dimension.
+* (but how to do this for a user-defined variable?)
+c             IF (vtype .EQ. NCCHAR ) THEN
+c                CALL CD_GET_DS_DIMS (iset, vdims(1), buff, npts, status)
+c                CALL SHOW_GRID_STRING_XML (lun, grid, cx_expr,
+c     .                  buff, npts)
+c             ELSE
+                CALL SHOW_GRID_XML (lun, grid, cx_expr)
+c             ENDIF
+c             IF ( status .NE. ferr_ok ) GOTO 5100
+
+             WRITE ( risc_buff, 2070 )
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+         ENDIF
+ 600  CONTINUE
+
+
+* Write the axes used in the dataset
+      
+      risc_buff = '</dataset>'
+      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+      risc_buff = '</datasets>'
+      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+      risc_buff = '<axes>'
+      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+      DO 800, i = 1, line_ceiling
+         IF (line_write(i)) CALL SHOW_LINE_XML( show_lun, i)
+ 800  CONTINUE
+
+      risc_buff = '</axes>'
+      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+* were there string variables?  If so write basic info about their string dimensions.
+
+      have_dims = .FALSE.
+      DO 900 ivar = 1, maxvars
+         IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 900
+         IF ( ds_var_code(ivar) .EQ. '-' ) GOTO 900  
+         uvarname = ds_var_code(ivar)
+
+         CALL CD_GET_VAR_ID (dset, uvarname, varid, status)
+         CALL CD_GET_VAR_INFO (dset, varid, uvarname, vtype, nvdims,
+     .         vdims, nvatts, coordvar, all_outflag, status)
+         IF (vtype .EQ. NCCHAR ) THEN
+            IF (.NOT.have_dims) THEN
+               have_dims = .TRUE.
+               risc_buff = '<dimensions>'
+               CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+            ENDIF
+
+	    CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts, status)
+            CALL SHOW_DIM_XML(buff, npts, show_lun)
+         ENDIF
+ 900  CONTINUE
+                  
+      IF (have_dims) THEN
+         risc_buff = '</dimensions>'
+         CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+       ENDIF
+
+* Restore the default data set
+
+      cx_data_set(cx_last) = dset_save
+
+ 5000 RETURN
+ 5100   CALL errmsg( ferr_unknown_grid, status, 
+     .          'Cannot get grid for variable', *5000 )
+      END
diff --git a/fer/gnl/show_data_set_xml.F b/fer/gnl/show_data_set_xml.F
new file mode 100644
index 0000000..4b9f209
--- /dev/null
+++ b/fer/gnl/show_data_set_xml.F
@@ -0,0 +1,109 @@
+	SUBROUTINE SHOW_DATA_SET_XML( lun, dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Output the name and list variables in the data set in xml-style format
+
+* programmer - Ansley Manke, based on show_data_set_vars.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+* V5.80 13-Sep-2004 *acm* Add data-set specific user variables to the listing
+*       30-Sep-2004 *acm* Move listing of dataset info to show_data.F, show any
+*                         dataset-specific user-defined variables, use the
+*                         tag <var name> rather than <vname>
+*       13-Oct-2004 *acm* for consistent XML, write <var name="VNAME" />
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'ez_lib.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xez_info.cmn_text'
+	external xez_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+
+* calling argument declarations:
+	INTEGER	lun, dset
+	
+* local variable declarations:
+	INTEGER TM_LENSTR, TM_LENSTR1, ivar, slen
+        CHARACTER uvarname*150
+
+ 2040   FORMAT ('<var name="', A, '" />' )
+
+* List the variables in the set
+
+	risc_buff = ' '
+
+	DO 400 ivar = 1, maxvars
+	   IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 400
+           IF ( ds_var_code(ivar) .EQ. '-' ) GOTO 400
+  
+* ... output variable code
+
+*           slen = TM_LENSTR1(ds_var_code(ivar))
+           CALL string_array_get_strlen1(ds_var_code_head, ivar, slen)
+           WRITE ( risc_buff, 2040 ) ds_var_code(ivar)(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+ 400	CONTINUE
+
+
+* show the data-set-specific user-defined variables
+
+	DO 600 ivar = 1, max_uvar
+	   IF (uvar_num_items(ivar) .EQ. uvar_deleted  ) GOTO 600
+	   IF (uvar_dset(ivar) .EQ. dset) THEN
+
+* ... output variable name
+
+             uvarname = uvar_name_code(ivar)
+             slen = TM_LENSTR1(uvarname)
+             WRITE ( risc_buff, 2040 ) uvarname(1:slen)
+             CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+         ENDIF
+ 600  CONTINUE
+
+      RETURN
+      END
diff --git a/fer/gnl/show_diag_vars.F b/fer/gnl/show_diag_vars.F
new file mode 100644
index 0000000..fc7520a
--- /dev/null
+++ b/fer/gnl/show_diag_vars.F
@@ -0,0 +1,132 @@
+	SUBROUTINE SHOW_DIAG_VARS( name, order )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SHOW VARIABLES/DIAGNOSTIC command - display an alphabetized list 
+* of the available variables
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/8/87  - from SHOW_MEM_VARS and XEQ_SHOW
+* revision 0.1 - 3/25/88 - added interruptibility
+* revision 0.2 - 4/5/88  - eliminated cvar_second_name
+* revision 0.3 - 4/29/88 - added "name" for name matching
+* V200:  7/25/89 - show component vars
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xtext_info.cmn'
+	include 'xinterrupt.cmn'
+
+* calling argument declarations:
+	INTEGER		order( max_calc_vars )
+	CHARACTER	name*4
+
+* local variable declarations:
+	LOGICAL MATCH4, all, full
+	INTEGER i, i2, temp, len, icomp, comp0, iend, var, status,
+     .          TM_LENSTR, len_test, len_mchars
+	CHARACTER	var_code*4, comp_buff*64
+	DATA		comp_buff(1:9) / '-->using:' /
+
+* local parameters
+	INTEGER	    slash_full
+	PARAMETER ( slash_full = 1 + 1 )
+
+* initialize
+	all  = name .EQ. unspecified_name4
+	full = qual_given(slash_full) .GT. 0
+
+* fill the order buffer with the default order
+	DO 100 i = 1, num_calc_vars
+ 100	order(i) = i
+
+* alphabetize the list
+	DO 200 i2 = num_calc_vars, 2, -1
+	DO 200 i = 2, i2
+	   IF ( cvar_name_code(order(i-1)) .GT. cvar_name_code(order(i)) )
+     .									THEN
+	      temp = order(i)
+	      order(i  ) = order(i-1)
+	      order(i-1) = temp
+	   ENDIF
+ 200	CONTINUE
+
+* ... and write it out
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'Diagnostic variables:',21)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'name         title',18)
+           len_test = TM_LENSTR(name)
+	   DO 300 i2 = 1, num_calc_vars
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *1000 )
+	      i = order( i2 )
+              len_mchars = TM_LENSTR(cvar_name_code(i)(:4))
+	      IF ( all .OR. MATCH4(name,len_test, 
+     .            cvar_name_code(i),len_mchars) ) THEN
+	         CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			cvar_name_code(i)//'      '//cvar_primary_name(i), 0)
+	         IF ( .NOT.full ) GOTO 300
+* ... show the components
+	         comp0  = cvar_frame_start( i )
+	         iend = 9
+	         DO 250 icomp = comp0 + 1, comp0 + cvar_frame_length(i)
+	            iend = iend + 5
+	            var = cv_variable( icomp )
+	            IF (var .GT. pcv_spec_flg) var = var - pcv_spec_flg
+	            IF ( cv_category( icomp ) .EQ. cat_calc_var ) THEN
+	               var_code = cvar_name_code( var )
+	            ELSE
+	               var_code = fvar_name_code( var )
+	            ENDIF
+	            WRITE( comp_buff( iend-4:iend ), '(1X,A)' ) var_code
+ 250	         CONTINUE
+	         CALL SPLIT_LIST(pttmode_explct, show_lun, comp_buff, iend)
+	      ENDIF
+ 300	   CONTINUE
+
+ 1000	RETURN
+	END
diff --git a/fer/gnl/show_dim_xml.F b/fer/gnl/show_dim_xml.F
new file mode 100644
index 0000000..699482f
--- /dev/null
+++ b/fer/gnl/show_dim_xml.F
@@ -0,0 +1,89 @@
+	SUBROUTINE SHOW_DIM_XML( dim_name, dim_len, lun )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display basic facts about the given dimension (which is not a coordiante axis) 
+* in xml-style format 
+
+* programmer - Ansley Manke, based on show_line_xml.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* Dec-2013
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'ferret.parm'
+	include 'xrisc.cmn'
+
+* calling argument declarations
+	CHARACTER*(*)   dim_name
+	INTEGER 	dim_len, lun
+
+* local variable declarations:
+	INTEGER		slen
+	CHARACTER	TM_FMT*32, outbuff*20
+        CHARACTER       attname*128, attbuff*2048, 
+     .                  outstring*2048
+
+ 2010	FORMAT ( '<dimension name="', A, '">' )
+ 2030	FORMAT ('<attribute name="', A, '" type="short">' )
+ 2050   FORMAT ('   <value>', A, '</value>')
+ 2060   FORMAT ('</attribute>')
+ 2080	FORMAT ( '</dimension>' )
+
+	CALL ESCAPE_FOR_XML (dim_name, outstring, slen)
+	WRITE ( risc_buff, 2010 ) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	
+* Length of dimension
+
+	attname = 'length'
+	CALL ESCAPE_FOR_XML(attname, outstring, slen)
+	WRITE ( risc_buff, 2030 ) outstring(:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	attbuff = TM_FMT(FLOAT(dim_len), 7, 14, slen)
+	CALL ESCAPE_FOR_XML (attbuff, outstring, slen)
+	WRITE ( risc_buff, 2050 ) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	WRITE ( risc_buff, 2060 )
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* closing tag
+
+	WRITE ( risc_buff, 2080 ) 
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	RETURN
+	END
diff --git a/fer/gnl/show_dyn_grids.F b/fer/gnl/show_dyn_grids.F
new file mode 100644
index 0000000..ec9cf38
--- /dev/null
+++ b/fer/gnl/show_dyn_grids.F
@@ -0,0 +1,193 @@
+    	SUBROUTINE SHOW_DYN_GRIDS(mods_cx)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* summarize the dynamic grids and axes currently in existence
+* also do sanity checks that use counts are appropriate
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:  11/95
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V510 *sh* 4/00 - grids may also be allocated by data set variables
+*                  Use /DYNAMIC/ALL to see them.
+* V532 5/01 *sh* - bug fix: ignore deleted static grids when chking axis usage
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	include 'xtm_grid.cmn_text'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+        include 'xfr_grid.cmn'   ! w/ mgrid_abstract
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER mods_cx
+
+* local variable declarations:
+        LOGICAL show_all, shown
+	INTEGER grid, line, dset, var, count, i, slash_all, status
+	CHARACTER sanity_msg*24
+
+* local parameter declarations
+        PARAMETER ( slash_all  = 1 + 0 )
+
+* initialize
+        show_all   = qual_given( slash_all ) .GT. 0
+
+* first show the dynamic grids
+        shown = .FALSE.
+	grid = grid_flink(max_grids)
+ 	IF ( grid .EQ. max_grids ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .						'No dynamic grids',16)
+	ELSE
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .						'Dynamic grids:',14)
+	ENDIF
+* ... --- "while" loop
+ 100	IF ( grid .NE. max_grids ) THEN
+* ... is this an exlicit (netCDF) grid that shouldn't be shown 
+           IF (grid_name(grid)(1:1).NE.'(' .AND. .NOT.show_all) THEN
+               grid = grid_flink(grid)
+               GOTO 100
+           ENDIF
+* ... sanity check the use count -- must be in use by user vars or dset vars
+	   count = 0
+           IF (grid .EQ. mgrid_abstract) count = 1  ! is it SET GRID?
+	   DO 125 var = 1, max_uvar	
+	      DO 120 dset = 0, max_gfdl_dsets
+	         IF ( uvar_grid(var,dset) .EQ. grid ) count = count + 1
+ 120	      CONTINUE
+ 125	   CONTINUE
+	   DO 135 var = 1, maxvars
+	      IF ( ds_grid_number(var) .EQ. grid ) count = count + 1
+ 135	   CONTINUE
+	   IF ( count .EQ. grid_use_cnt(grid) ) THEN
+	      sanity_msg = ' '
+	   ELSEIF ( count .GT. grid_use_cnt(grid) ) THEN
+	      sanity_msg = 'err: grid under-allocated'
+	   ELSE
+	      sanity_msg = 'err: grid over-allocated'
+	   ENDIF
+* ... end of sanity check
+* 4/99 *kob* modify write and format statement - mostly for stylistic reasons
+	   WRITE (risc_buff,3000) 'GRID', 
+     .           grid_name(grid),
+     .            grid_use_cnt(grid),
+     .					sanity_msg
+* *kob* 4/99 shorten dynamic grid name on output statment
+ 3000	   FORMAT ( 4X,A,1X,A16,16X, 'use count:',I4,5x,A)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   CALL SHOW_GRID(grid, mods_cx, status)
+	   IF (status .NE. ferr_ok) GOTO 5000
+           shown = .TRUE.
+	   grid = grid_flink(grid)
+	ENDIF
+	IF (grid .NE.max_grids) GOTO 100
+        IF (.NOT.shown)  CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .					'    no implicit grids',21)
+
+* now the dynamic axes
+        shown = .FALSE.
+	line = line_flink(max_lines)
+ 	IF ( line .EQ. max_lines ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .						'No dynamic axes',15)
+	ELSE
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .						'Dynamic axes:',13)
+	ENDIF
+* ... --- "while" loop
+ 200	IF ( line .NE. max_lines ) THEN
+* ... is this an exlicit (netCDF) grid that shouldn't be shown 
+           IF (line_name(line)(1:1).NE.'(' .AND. .NOT.show_all) THEN
+               line = line_flink(line)
+               GOTO 200
+           ENDIF
+* ... sanity check the use count -- must be in use by user vars
+	   count = 0
+* ... in use by static grids
+	   DO 225 grid = 1, max_grids-1
+              IF ( grid_name(grid) .NE. char_init16 ) THEN
+	        DO 220 i = 1, nferdims
+	           IF ( grid_line(i,grid) .EQ. line ) count = count + 1
+ 220	        CONTINUE
+              ENDIF
+ 225	   CONTINUE
+* ... in use by dynamic grids
+	   grid = grid_flink(max_grids)
+ 230	   IF ( grid .NE. max_grids ) THEN
+	      DO 232 i = 1, nferdims
+	         IF ( grid_line(i,grid) .EQ. line ) count = count + 1
+ 232	      CONTINUE
+	      grid = grid_flink(grid)
+	   ENDIF
+	   IF (grid .NE.max_grids) GOTO 230
+* ... in use by other axes
+	   DO 235 i = max_lines, max_dyn_lines
+	         IF ( line_parent(i) .EQ. line ) count = count + 1
+ 235	   CONTINUE
+	   IF ( count .EQ. line_use_cnt(line) ) THEN
+	      sanity_msg = ' '
+	   ELSEIF ( count .GT. line_use_cnt(line) ) THEN
+	      sanity_msg = 'err: axis under-allocated'
+	   ELSE
+	      sanity_msg = 'err: axis over-allocated'
+	   ENDIF
+* ... end of sanity check
+* *kob* 4/99 - reference format statement at 3000 - for stylistic reasons
+	   WRITE (risc_buff,3000) 'AXIS',line_name(line), line_use_cnt(line),
+     .					sanity_msg
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+           shown = .TRUE.
+	   line = line_flink(line)
+	ENDIF
+	IF (line .NE.max_lines) GOTO 200
+        IF (.NOT.shown)  CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .					'    no implicit axes',20)
+
+ 5000	RETURN
+	END
+
+
+
diff --git a/fer/gnl/show_grid.F b/fer/gnl/show_grid.F
new file mode 100644
index 0000000..8f974c4
--- /dev/null
+++ b/fer/gnl/show_grid.F
@@ -0,0 +1,127 @@
+	SUBROUTINE SHOW_GRID( grid, cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* describe the axes of a grid and then give coordinate data about those
+* axes as indicated in cx
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 9/23/87
+* revision 0.1 - 2/18/88 - checks subscript limits on axes
+*			   and allows non-geographical, +/- oriented axes
+* revision 0.2 - 3/18/88 - decimal places automated for sig. figs.
+*			 - time step written in calendar mode
+*			 - interruptable; - axis unit labels via AX_TITLE
+* revision 1.0 - 8/1/88  - created LINE_FACTS and removed half of code to it
+* revision 1.1 - 8/16/88 - eliminated units column, added delta in coord display
+* V200:  5/19/89 - reordered lo/hi_ss arguments
+*        9/22/89 - change to LINE_FACTS call for abstract axis orientations
+* Unix/RISC port 3/18/91 *sh*: can't use function in WRITE list
+*                            - corrected use of risc_buff (was right justified)
+* V300:  5/28/93 - bug fix: incorrect branch for mnormal or munknown axis
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	  1/5/95 - changed default precision from 5 to 7  (and for
+*		   dates to seconds) 
+* kob*   9/97 - replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in order
+*               to have access to context information - needed for negative
+*               time step processing
+* *kob*  1/98 - add calls to convert cx_lo/hi_ww to tsteps before calling
+*               ISUBSCR_CX
+* V500 - *sh* 4/99 - extracted guts of code to SHOW_LINE_COORDS to be shared
+*		by the SHOW AXIS command
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations
+	INTEGER grid, cx, status
+
+* local variable declarations:
+	INTEGER i, idim, listdims
+
+* If mode 6d_lab has been cancelled, we will list only the first 4 dimensions.
+* But if the grid has E or F axes, thats an error.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+	
+	status = ferr_ok
+	IF (listdims .LT. nferdims) THEN
+	   DO 90 i = listdims+1,nferdims
+	      IF ( grid_line(i,grid) .NE. mnormal) GOTO 5100
+  90	   CONTINUE
+	ENDIF
+
+* list and describe the axes of the grid
+	risc_buff = ' '
+	WRITE ( risc_buff, 3000 )
+	CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, 0)
+	DO 110 idim = 1, listdims
+	   CALL LINE_FACTS( ttout_lun, idim, grid, idim )
+ 110	CONTINUE
+
+* list the data on any axis that has been especially requested
+*		via (eg.) /X=lo:hi or /X alone
+	DO 130 idim = 1, listdims
+	   IF ( qual_given( slash_show_grid_x0+idim ) .GT. 0
+     .	  .OR.  qual_given( slash_show_grid_i0+idim ) .GT. 0 ) THEN
+	     CALL SHOW_LINE_COORDS( grid, cx, idim )
+	   ENDIF
+ 130	CONTINUE
+
+* successful completion
+ 1000	RETURN
+
+ 3000	FORMAT (T2,'name',T13,'axis',T31,'# pts',T39,'start',T60,
+     .          'end' )
+
+5000    RETURN
+5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'variable has more than 4 dimensions. Set mode 6D_LAB'
+     .		     //pCR//cmnd_buff(:len_cmnd),
+     .			*5000 )
+	END
diff --git a/fer/gnl/show_grid_string_xml.F b/fer/gnl/show_grid_string_xml.F
new file mode 100644
index 0000000..0355840
--- /dev/null
+++ b/fer/gnl/show_grid_string_xml.F
@@ -0,0 +1,131 @@
+	SUBROUTINE SHOW_GRID_STRING_XML (lun, grid, cx_expr,
+     .                  stringdimname, strdim)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  list the axes for a grid in xml-style format
+
+* programmer - Ansley Manke, based on show_grid.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+* V580 *acm* 11/4/04 add <axes> tags
+* v6.5 *acm* 3/10 Cleanup - remove commented-out includes
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+	include	'xcontext.cmn'
+
+
+* calling argument declarations
+	INTEGER lun, grid, cx_expr, strdim
+	CHARACTER*(*) stringdimname
+
+* local variable declarations:
+	INTEGER TM_LENSTR1, TM_LENSTR, STR_DNCASE, idim, slen, line, status
+        CHARACTER*1 axdir
+	CHARACTER*2048 outstring
+	CHARACTER TM_FMT*16, show_str*16
+
+ 2020   FORMAT ('<grid name="',A,'">' )
+ 2030   FORMAT ('<axes>' )
+ 2040   FORMAT( '<', A1, 'axis>' ,A , '</', A1, 'axis>' )
+ 2050   FORMAT ('</axes>')
+ 2060   FORMAT ('</grid>') 
+ 2070   FORMAT ('<dimension>', A, '</dimension>')
+
+
+* list the axes of the grid
+
+        CALL ESCAPE_FOR_XML (grid_name(grid), outstring, slen)
+	WRITE ( risc_buff, 2020 ) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	WRITE ( risc_buff, 2030 ) 
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* First the string-length dimension
+
+	slen = TM_LENSTR(stringdimname)
+
+	CALL ESCAPE_FOR_XML (stringdimname, outstring, slen)
+	WRITE (risc_buff, 2070 ) outstring(1:slen) 
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	DO 110 idim = 1, nferdims
+           line = grid_line(idim, grid)
+           IF (line .GT. 0) THEN
+	      slen = TM_LENSTR(line_name(line))
+	      status = STR_DNCASE(axdir, ww_dim_name(idim))
+	   ENDIF
+
+           IF (line .GT. 0  .AND.  slen .GT. 0 .AND.
+     .         cx_expr .EQ. unspecified_int4) THEN
+              CALL ESCAPE_FOR_XML (line_name(line), outstring, slen)
+              WRITE (risc_buff, 2040 ) axdir, outstring(1:slen), axdir
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+           ENDIF
+
+           IF (line .GT. 0  .AND.  slen .GT. 0 .AND.
+     .         cx_expr .NE. unspecified_int4) THEN
+
+              IF ( cx_hi_ss(cx_expr,idim).NE.unspecified_int4 .AND. 
+     .	           cx_lo_ss(cx_expr,idim).NE.unspecified_int4 ) THEN
+                 slen = TM_LENSTR1(line_name(line))
+                 WRITE (risc_buff, 2040 ) axdir,
+     .              line_name(line)(1:slen), axdir
+	         CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              ENDIF
+           ENDIF
+
+ 110	CONTINUE
+
+        WRITE ( risc_buff, 2050 )
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        WRITE ( risc_buff, 2060 )
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+        RETURN
+	END
diff --git a/fer/gnl/show_grid_xml.F b/fer/gnl/show_grid_xml.F
new file mode 100644
index 0000000..45310c4
--- /dev/null
+++ b/fer/gnl/show_grid_xml.F
@@ -0,0 +1,147 @@
+	SUBROUTINE SHOW_GRID_XML( lun, grid, cx_expr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  list the axes for a grid in xml-style format
+
+* programmer - Ansley Manke, based on show_grid.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+* V580 *acm* 11/4/04 add <axes> tags
+* v6.5 *acm* 3/10 Cleanup - remove commented-out includes
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+*      *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* v685 *acm* 4/12 The flag line_write tells us whether to write the axis name to the xml
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xrisc.cmn'
+	include	'xcontext.cmn'
+
+
+* calling argument declarations
+	INTEGER lun, grid, cx_expr
+
+* local variable declarations:
+	INTEGER TM_LENSTR1, TM_LENSTR, STR_DNCASE, STR_SAME,
+     .		idim, slen, line, iwrite, status
+        CHARACTER*1 axdir
+	CHARACTER*512 outstring
+
+ 2020   FORMAT ('<grid name="',A,'">' )
+ 2030   FORMAT ('<axes>' )
+ 2040   FORMAT( '<', A1, 'axis>' ,A , '</', A1, 'axis>' )
+ 2050   FORMAT ('</axes>')
+ 2060   FORMAT ('</grid>')
+
+* list the axes of the grid
+
+        CALL ESCAPE_FOR_XML (grid_name(grid), outstring, slen)
+	WRITE ( risc_buff, 2020 ) outstring(1:slen)
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	WRITE ( risc_buff, 2030 ) 
+	CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	iwrite = 0
+	DO 110 idim = 1, nferdims
+	   slen = 0
+           line = grid_line(idim, grid)
+           IF (line .GT. 0 .AND. 
+     .	          STR_SAME(line_name(line), 'ABSTRACT') .NE. 0) THEN
+	      slen = TM_LENSTR(line_name(line))
+	      status = STR_DNCASE(axdir, ww_dim_name(idim))
+	      IF (slen .EQ. 0) GOTO 110
+	      CALL ESCAPE_FOR_XML (line_name(line), outstring, slen)
+
+
+              IF (cx_expr .EQ. unspecified_int4) THEN
+                 WRITE (risc_buff, 2040 ) axdir, outstring(1:slen), axdir
+	         CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	         line_write(line) = .TRUE.
+	         iwrite = iwrite + 1
+              ELSE
+                 IF ( cx_hi_ss(cx_expr,idim).NE.unspecified_int4 .AND. 
+     .	           cx_lo_ss(cx_expr,idim).NE.unspecified_int4 ) THEN
+                    WRITE (risc_buff, 2040 ) axdir, outstring(1:slen), axdir
+	            CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	            line_write(line) = .TRUE.
+	         iwrite = iwrite + 1
+                ENDIF
+              ENDIF
+
+	   ENDIF
+ 110	CONTINUE
+
+* (hack:) If there are axes, but nothing has been written yet, then 
+* just write the axes.
+
+        IF (iwrite .EQ. 0) THEN
+	   DO 120 idim = 1, nferdims
+	      slen = 0
+              line = grid_line(idim, grid)
+              IF (line .GT. 0 .AND. 
+     .	          STR_SAME(line_name(line), 'ABSTRACT') .NE. 0) THEN
+	         slen = TM_LENSTR(line_name(line))
+	         status = STR_DNCASE(axdir, ww_dim_name(idim))
+	         IF (slen .EQ. 0) GOTO 120
+	         CALL ESCAPE_FOR_XML (line_name(line), outstring, slen)
+
+                 WRITE (risc_buff, 2040 ) axdir, outstring(1:slen), axdir
+                 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	         line_write(line) = .TRUE.
+
+	      ENDIF
+ 120	   CONTINUE
+        ENDIF
+
+        WRITE ( risc_buff, 2050 )
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        WRITE ( risc_buff, 2060 )
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+        RETURN
+
+	END
+
diff --git a/fer/gnl/show_line.F b/fer/gnl/show_line.F
new file mode 100644
index 0000000..2481346
--- /dev/null
+++ b/fer/gnl/show_line.F
@@ -0,0 +1,175 @@
+	SUBROUTINE SHOW_LINE( line, brief )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display basic facts about the given line
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/1/88
+* V200:  9/22/89 - added "orient" for axes without particular orientations
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V530:  3/01    - indicate the calendar for non-Gregorian calendar types 
+* V541 *sh*  2/02 - describe axis span and modulo length
+* V553 *acm* 6/03 - Allow for line_direction code of 'XX' or 'YY'
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+	include	'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* calling argument declarations
+	LOGICAL		brief
+	INTEGER 	line
+
+* local variable declarations:
+	LOGICAL		TM_ITS_SUBSPAN_MODULO
+	INTEGER		idim, orient, slen, i
+	INTEGER		TM_LENSTR1, TM_GET_CALENDAR_ID, cal_id
+	CHARACTER	TM_FMT*32, buff*80, buff20*20
+	REAL*8		TM_WW_AXLEN
+
+* determine orientation
+	DO 100 idim = 1, nferdims+1
+	   IF ( line_direction(line) .EQ. axis_orients( idim ) ) THEN
+	      orient = idim
+	      GOTO 110
+	   ENDIF
+ 100	CONTINUE
+        IF (line_direction(line) .EQ. 'XX') THEN
+           orient = 1
+           idim = 1
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'YY') THEN
+           orient = 2
+           idim = 2
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'TT') THEN
+           orient = 4
+           idim = 4
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'EE') THEN
+           orient = 5
+           idim = 5
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'FF') THEN
+           orient = 6
+           idim = 6
+           GOTO 110
+        ENDIF
+
+	orient = 0
+	idim   = 1				! use X slot for non-oriented
+ 110	IF ( idim .EQ. nferdims+1 ) idim = 3	! DU --> UD on Z axis
+
+* create a dummy grid with this axis
+* (kludge to use existing code that works with grids)
+	grid_line(idim, mgrid_buff) = line
+
+* report basic facts using code from SHOW_GRID
+	CALL LINE_FACTS( show_lun, idim, mgrid_buff, orient )
+	IF ( brief ) RETURN
+
+* report /T0= for formatted time axis
+	IF ( line_direction(line) .EQ. 'TI' ) THEN
+            IF (line_shift_origin(line)) THEN
+               buff20 = '01-JAN-0001 00:00:00'
+            ELSE
+ 	       buff20 = line_t0(line)
+            ENDIF
+	   CALL SPLIT_LIST
+     .		(pttmode_explct, show_lun, 'T0 = '//buff20, 0)
+
+* report the calendar of a time axis if "interesting"
+	   buff = line_cal_name (line)
+	   cal_id = TM_GET_CALENDAR_ID (buff)
+	   IF (cal_id .GT. gregorian .AND. cal_id .LE. max_calendars) THEN
+	      slen = TM_LENSTR1(buff)
+	      CALL SPLIT_LIST (pttmode_explct, show_lun, 
+     .		               'CALENDAR = '//buff(:slen), 0)
+	   ENDIF
+	ENDIF
+
+* report the full span of the axis
+#ifdef double_p
+	buff =  '   Axis span (to cell edges) = '//
+     .		TM_FMT( (TM_WW_AXLEN(line)),7,32,slen )
+#else
+	buff =  '   Axis span (to cell edges) = '//
+     .		TM_FMT( SNGL(TM_WW_AXLEN(line)),7,32,slen )
+#endif
+	slen = slen + 31
+
+* if line is modulo, report its modulo cycle length
+	IF ( line_modulo(line) ) THEN
+	   IF ( TM_ITS_SUBSPAN_MODULO(line) ) THEN
+#ifdef double_p
+	     buff = buff(:slen)// ' (modulo length = ' //
+     .		   TM_FMT( (line_modulo_len(line)),7,32,i )
+#else
+	     buff = buff(:slen)// ' (modulo length = ' //
+     .		   TM_FMT( SNGL(line_modulo_len(line)),7,32,i )
+#endif
+	     slen = slen + i + 18
+	     buff = buff(:slen) //')'
+	     slen = slen + 1
+	   ELSE
+	     buff = buff(:slen) // ' (modulo length = axis span)'
+	     slen = slen + 28
+	   ENDIF
+	ENDIF
+	CALL SPLIT_LIST (pttmode_explct, show_lun, buff, slen)
+
+	RETURN
+	END
+
+
+
diff --git a/fer/gnl/show_line_coords.F b/fer/gnl/show_line_coords.F
new file mode 100644
index 0000000..a83e20d
--- /dev/null
+++ b/fer/gnl/show_line_coords.F
@@ -0,0 +1,229 @@
+	SUBROUTINE SHOW_LINE_COORDS( grid, cx, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* describe the axes of a grid and then give coordinate data about those
+* axes as indicated in cx
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V50 - *sh* 4/99 code extracted from SHOW_GRID
+* V530 - *sh* 1/01 - show lower limit value of grid box
+* 560 *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+* v580 *acm* 11/04 Store cal_id in cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+* V581 *acm*  6/05 Fix bug in show axis/t with non-standard calendars; RESET_SECS_FROM_BC
+* V581 *acm*  6/05 Fix call to TM_GET_CALENDAR_ID (did this ever work with the
+*                  argument grid rather than calendar name?!)
+* V601 *acm*  3/08 Allow more figs when writing values with negative exponents.
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 6D Ferret, changed a comment only
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+	include 'xcontext.cmn'
+	include 'xinterrupt.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations
+	INTEGER grid, cx, idim
+
+* local variable declarations:
+	LOGICAL	GEOG_LABEL, calendar
+	INTEGER ISUBSCR_CX, TM_LENSTR, TM_LENSTR1,
+     .          TM_GET_CALENDAR_ID, axis,
+     .		lo, hi, i, line, loest, hiest, dlen,
+     .		ndec, status, delta, exlen, cal_id,
+     .          prev_cal_id, less_figs
+	CHARACTER TM_FMT*14, buff*14, pt_str*20, lo_str*20, extra*24
+	REAL	BOX_SIZE
+	REAL*8	TM_WORLD, SECS_TO_TSTEP,
+     .          pt_val8, lo_val8, start, end, new_ww
+
+* local parameter declarations:
+	INTEGER		sig_figs
+	PARAMETER     ( sig_figs = 7 )   ! was 5 1/95
+
+* initialize
+	line = grid_line( idim, grid )
+
+* ignore bogus lines (should never occur ...)
+	IF ( line .EQ. munknown
+     .  .OR. line .EQ. mnormal ) RETURN
+
+	calendar = (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. GEOG_LABEL( idim, grid )	
+	IF ( calendar ) THEN
+	   extra = 'TSTEP ('//line_units(line)
+	   extra = extra(:TM_LENSTR(extra))//')'
+	ELSE
+	   extra = ' '
+	ENDIF
+	exlen = TM_LENSTR1(extra)
+	risc_buff = ' '
+	WRITE ( risc_buff, 3030 ) ss_dim_name(idim),
+     .				  ww_dim_name(idim),
+     .				  ww_dim_name(idim),
+     .				  ww_dim_name(idim), extra
+	CALL SPLIT_LIST(pttmode_explct, show_lun, ' ', 1)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+* ... determine range of data to display
+	IF ( cx_lo_ss( cx, idim ) .EQ. unspecified_int4
+     . .AND. cx_lo_ww( idim, cx ) .EQ. unspecified_val8 )
+     .									THEN
+	   lo    = 1
+	   hi    = line_dim( line )
+	ELSEIF ( cx_by_ss( idim, cx ) ) THEN
+	   CALL GRID_SUBSCRIPT_EXTREMES( loest, hiest, grid, idim )
+	   lo = MAX( loest, cx_lo_ss( cx, idim ) )
+	   hi = MIN( hiest, cx_hi_ss( cx, idim ) )
+	ELSE
+* kob - 1/98 -  cx_lo/hi_ww need to be translated to tsteps, before calling
+*         ISUBSCR_CX, for the t dimension when cx_calendar is true.
+*         similar to what goes on in flesh_out_axis. 
+*
+* cx_lo_ww was set without knowledge of the axis, so if this is a non-std calendar
+* need to reset according to the actual calendar type
+
+	   IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. cx_calendar(cx) ) THEN
+
+              axis = grid_line(idim, grid)
+	      IF (line_t0(axis) .EQ. char_init20) GOTO 110  ! Not a calendar ax (e.g. f axis)
+              cal_id = TM_GET_CALENDAR_ID(line_cal_name(axis))
+              cx_cal_id(cx) = cal_id
+
+	      start = cx_lo_ww(idim,cx)
+	      end   = cx_hi_ww(idim,cx)
+              prev_cal_id = 1
+
+	      IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim)  .AND.  cal_id .NE. prev_cal_id .AND.
+     .             start .LT. 0. .AND. start .NE. unspecified_val8.AND.
+     .             end   .LT. 0. .AND. end   .NE. unspecified_val8) THEN
+	         CALL RESET_SECS_FROM_BC (-start, new_ww, prev_cal_id, 
+     .                                    cal_id, status)
+	         cx_lo_ww(idim,cx) = new_ww   ! not negative as we now know the axis.
+
+	         CALL RESET_SECS_FROM_BC (-end, new_ww, prev_cal_id, 
+     .                                    cal_id, status)
+	         IF ( status .NE. ferr_ok ) RETURN
+
+	         cx_hi_ww(idim,cx) = new_ww
+
+              ELSE IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim)  .AND. 
+     .              cal_id .EQ. prev_cal_id .AND.
+     .             start .LT. 0. .AND. start .NE. unspecified_val8.AND.
+     .             end   .LT. 0. .AND. end   .NE. unspecified_val8) THEN
+	         cx_lo_ww(idim,cx) = -1*cx_lo_ww(idim,cx)
+	         cx_hi_ww(idim,cx) = -1*cx_hi_ww(idim,cx)
+              ENDIF
+
+              cx_lo_ww(idim,cx) =
+     .            SECS_TO_TSTEP( grid, idim, cx_lo_ww(idim,cx) )
+              cx_hi_ww(idim,cx) =
+     .		   SECS_TO_TSTEP( grid, idim, cx_hi_ww(idim,cx) )
+ 
+
+* reset cx_calendar now that cx_lo/hi_ww have been converted
+              cx_calendar(cx) = .FALSE.
+	   ENDIF
+ 110	   CONTINUE
+	   lo = ISUBSCR_CX( cx_lo_ww(idim,cx),
+     .			grid, idim, cx, round_dn )
+	   hi = ISUBSCR_CX( cx_hi_ww(idim,cx),
+     .			grid, idim, cx, round_up )
+	ENDIF
+
+* determine delta increment for listing
+	IF ( cx_delta( idim, cx ) .NE. unspecified_val8 ) THEN
+	   delta = NINT(cx_delta( idim, cx ))
+	ELSE
+	   delta = 1
+	ENDIF
+
+* write lines of coord and box size data
+	DO 120 i = lo, hi, delta
+	   IF ( interrupted ) CALL ERRMSG
+     .		( ferr_interrupt, status, ' ', *1000 )
+	   lo_val8 = TM_WORLD( i, grid, idim, box_lo_lim )
+	   pt_val8 = TM_WORLD( i, grid, idim, box_middle )
+	   IF ( calendar ) THEN
+	      ndec = 6	! was 5 1/95
+	   ELSE
+	      ndec = -sig_figs
+	   ENDIF
+	   CALL TRANSLATE_TO_WORLD( pt_val8,idim,grid,ndec,pt_str )
+	   CALL TRANSLATE_TO_WORLD( lo_val8,idim,grid,ndec,lo_str )
+#ifdef double_p
+	   IF ( calendar ) extra = 
+     .	         	TM_FMT( (pt_val8), sig_figs, 14, dlen )
+#else
+	   IF ( calendar ) extra = 
+     .	         	TM_FMT( SNGL(pt_val8), sig_figs, 14, dlen )
+#endif
+           buff = TM_FMT(
+     .                       BOX_SIZE(i,grid,idim), sig_figs, 9, dlen )
+           IF (dlen .GT. 9) THEN
+              less_figs = sig_figs - 3
+              buff = TM_FMT(
+     .            BOX_SIZE(i,grid,idim), less_figs, 9, dlen )
+           ENDIF
+	   risc_buff = ' '
+	   WRITE ( risc_buff, 3040 ) 
+     .			i, pt_str,
+     .			buff, lo_str,
+     .			extra(:exlen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+ 120	CONTINUE
+
+ 3030	FORMAT ( T8,A1,T14,A1,T34,A1,'BOX  ',T44,A1,'BOXLO',T62,A28 )
+c 3040   FORMAT ( T3,I6,'> ',T12,A20,T34,A9,T44,A20,T66,A14 )
+ 3040   FORMAT ( T3,I6,'> ',T12,A20,T34,A10,T45,A20,T67,A14 )
+c 3040	FORMAT ( T3,I6,'> ',T12,A20,T34,A12,T48,A20,T70,A14 )
+
+* successful completion
+ 1000	RETURN
+	END
diff --git a/fer/gnl/show_line_xml.F b/fer/gnl/show_line_xml.F
new file mode 100644
index 0000000..6b7ac92
--- /dev/null
+++ b/fer/gnl/show_line_xml.F
@@ -0,0 +1,377 @@
+	SUBROUTINE SHOW_LINE_XML( lun, line)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display basic facts about the given line in xml-style format 
+
+* programmer - Ansley Manke, based on show_line.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 6-Aug-2003
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600 *acm* 2/06 - Fix for bug 1394, send do_err flag to TM_DATE_REFORMAT
+* V602 *acm*11/06 - Fix bug 1468, wrong string was written instead of the
+*                   calendar name.
+* V6.1  2/2008 *acm* Use attribute structure to get all attributes for the axis.
+* V612  8/2008 *acm* Revert to old xml style output for infile_datatype and 
+*                    ferret_datatype attributes
+* V616  1/2009 *acm* Fixing LAS ticket 481, new style of xml output
+* V631 11/09 *acm* For XML-formatted output check for and replace the strings < > and &
+*                  with < etc.
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+* V67  *acm* 2/11 XML fixes. New attribute formatting, ![CDATA] escape, upper/lowercase handling.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*      *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*      *acm* 3/13 Dont show axes with names in parentheses e.g. (AX004)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+	include	'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+	include 'xrisc.cmn'
+        include 'errmsg.parm'
+        include 'netcdf.inc'
+	include 'xdset_info.cmn_text'
+
+* calling argument declarations
+	INTEGER 	lun, line
+
+* local variable declarations:
+	LOGICAL		TM_ITS_SUBSPAN_MODULO, NC_GET_ATTRIB, GEOG_LABEL, 
+     .                  got_it, calendar, bounds_done
+	INTEGER		idim, orient, slen, iset, dset, alen, igrid
+	INTEGER		TM_LENSTR1, TM_GET_CALENDAR_ID, cal_id, status
+	CHARACTER	TM_FMT*32, buff*80, outbuff*20
+
+        LOGICAL         coordvar, new
+        INTEGER         STR_SAME, 
+     .                  ivar,  llen,
+     .                  varid, vtype, nvdims, vdims(8), nvatts, blen, i, 
+     .                  len_attbuff, attoutflag, all_outflag, attid, 
+     .                  attlen, attype, iatt
+        CHARACTER       vname*128, attname*128, attbuff*2048, 
+     .                  outstring*2048, atype*10
+	REAL            vals(100)
+
+C New form for attribute output, list values separately.
+
+
+ 2020	FORMAT ('<attribute name="', A, '" type="char">' )
+ 2030	FORMAT ('<attribute name="', A, '" type="short">' )
+ 2040   FORMAT ('<attribute name="', A, '" type="', A,'">' )
+ 2050   FORMAT ('   <value>', A, '</value>')
+ 2055   FORMAT ('   <value><![CDATA[', A, ']]></value>')
+ 2060   FORMAT ('</attribute>')
+ 2080	FORMAT ( '</axis>' )
+
+* determine orientation
+
+	DO 100 idim = 1, nferdims+1
+	   IF ( line_direction(line) .EQ. axis_orients( idim ) ) THEN
+	      orient = idim
+	      GOTO 110
+	   ENDIF
+ 100	CONTINUE
+        IF (line_direction(line) .EQ. 'XX') THEN
+           orient = 1
+           idim = 1
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'YY') THEN
+           orient = 2
+           idim = 2
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'TT') THEN
+           orient = 4
+           idim = 4
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'EE') THEN  !! ??
+           orient = 5
+           idim = 5
+           GOTO 110
+        ENDIF
+        IF (line_direction(line) .EQ. 'FF') THEN
+           orient = 6
+           idim = 6
+           GOTO 110
+        ENDIF
+
+	orient = 0
+	idim   = 1			! use X slot for non-oriented
+ 110	IF ( idim .EQ. 7 ) idim = 3	! DU --> UD on Z axis
+
+        ! Oriengation still not defined. Look for the axis in the grids
+        IF (orient .EQ. 0) THEN
+	   DO 130 igrid = 1, max_dyn_grids
+	   DO 120 idim = 1, nferdims
+	      IF ( line .EQ. grid_line(idim,igrid) ) THEN
+	         orient = idim
+	         GOTO 140
+	      ENDIF
+ 120	   CONTINUE
+ 130	   CONTINUE
+        ENDIF
+
+ 140	CONTINUE
+        IF (orient .EQ. 0) RETURN  ! axis has no direction and is not used.
+
+* create a dummy grid with this axis
+* (kludge to use existing code that works with grids)
+	grid_line(idim, mgrid_buff) = line
+
+* report basic facts using code from SHOW_GRID
+	CALL LINE_FACTS_XML( lun, idim, mgrid_buff, orient, status )
+        IF (status .NE. ferr_ok) GOTO 1000
+
+* report /T0= for formatted time axis
+	IF ( line_direction(line) .EQ. 'TI' ) THEN
+	   calendar = GEOG_LABEL(idim, igrid)
+           IF (calendar) THEN
+	      buff = line_cal_name (line)
+	      cal_id = TM_GET_CALENDAR_ID (buff)
+
+              IF (line_shift_origin(line)) THEN
+                 buff = '01-JAN-0001 00:00:00'
+              ELSE
+                 buff = line_t0(line)
+              ENDIF
+
+* Make sure it is formatted as  2000-11-01 00:00:00
+              CALL TM_DATE_REFORMAT (buff, 1, cal_id, outbuff, 2, 
+     .        .TRUE., status) 
+              CALL ESCAPE_FOR_XML(outbuff, outstring, slen)
+              WRITE ( risc_buff, 2020 ) 'time_origin'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	      WRITE (risc_buff, 2055) outstring(1:slen)
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2060 ) 
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* report the calendar of a time axis
+
+              buff = line_cal_name(line)
+              CALL ESCAPE_FOR_XML(buff, outstring, slen)
+              WRITE ( risc_buff, 2020 ) 'calendar'
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2055 ) outstring(1:slen)
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              WRITE ( risc_buff, 2060 )
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   ENDIF
+	ENDIF
+
+* if line is subspan modulo, report its modulo cycle length
+	IF ( line_modulo(line) .AND. TM_ITS_SUBSPAN_MODULO(line) ) THEN
+#ifdef double_p
+	   buff = TM_FMT( (line_modulo_len(line)),7,32,slen)
+#else
+	   buff = TM_FMT( SNGL(line_modulo_len(line)),7,32,slen)
+#endif
+           CALL ESCAPE_FOR_XML(buff, outstring, slen)
+	   WRITE (risc_buff, 2030) 'modulo_length'
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   WRITE ( risc_buff, 2050 ) outstring(1:slen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	   WRITE ( risc_buff, 2060 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ENDIF
+
+* Get the dataset (show line/xml only used for axes in datasets)
+
+        vname = line_name_orig(line)
+	DO 300 iset = 1, maxdsets
+	   IF ( ds_name(iset) .EQ. char_init1024) GOTO 400
+           CALL CD_GET_VAR_ID (iset, vname, varid, status)
+           IF (status .EQ. ferr_ok) GOTO 50
+  300   CONTINUE
+
+* Try user-defined axes, may want to get some attributes (F-TDS variables)
+  400   CONTINUE
+        iset = -2
+        CALL CD_GET_VAR_ID (iset, vname, varid, status)
+	IF (status .NE. ferr_ok) GOTO 1000
+
+   50   dset = iset
+
+* other attributes
+
+        CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims,
+     .           vdims, nvatts, coordvar, all_outflag, status)
+
+* Data type of the axis in the file...
+
+        WRITE (risc_buff, 2020) 'infile_datatype'
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        IF (vtype .EQ. ncbyte ) THEN
+	   buff = 'BYTE'
+        ELSE IF (vtype .EQ. ncchar ) THEN
+           buff = 'CHAR'
+        ELSE IF (vtype .EQ. ncshort ) THEN
+           buff = 'SHORT'
+        ELSE IF (vtype .EQ. nclong ) THEN
+           buff = 'LONG'
+        ELSE IF (vtype .EQ. ncfloat ) THEN
+           buff = 'FLOAT'
+        ELSE IF (vtype .EQ. ncdouble ) THEN
+           buff = 'DOUBLE'
+        ENDIF
+        CALL ESCAPE_FOR_XML(buff, outstring, slen)
+        WRITE ( risc_buff, 2055 ) outstring(1:slen)
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+        WRITE ( risc_buff, 2060 )
+        CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+* All attributes not already listed.
+
+	bounds_done = .FALSE.
+
+        DO 200 iatt = 1, nvatts
+           CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, attname, 
+     .              attype, attlen, attoutflag, status )
+
+           new = .TRUE.
+           new = (STR_SAME(attname,    'direction')     .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'units')         .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'length')        .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'positive')      .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'modulo')        .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'modulo_length') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'start')         .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'end')           .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'time_origin')   .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'calendar')      .NE. 0) .AND.  
+     .              (STR_SAME(attname, 'point_spacing') .NE. 0) .AND. 
+     .              (STR_SAME(attname, 'infile_datatype') .NE. 0)
+
+	if (.NOT.new) new = (STR_SAME(attname, 'long_name') .EQ. 0)
+
+           IF (new) THEN
+              blen = 2048  ! len of attbuff
+              got_it = NC_GET_ATTRIB (dset, varid, attname, 
+     .                                .TRUE., vname, blen, attlen, 
+     .                                attoutflag, attbuff, vals)
+              IF (attlen .GT. 0) THEN
+
+	      IF (STR_SAME(attname, 'edges')  .EQ. 0) THEN
+	         attname = 'bounds'
+	         slen = TM_LENSTR1(vname)
+	         attbuff = vname(1:slen)//'_bnds'
+              ENDIF
+
+              CALL ESCAPE_FOR_XML(attname, outstring, slen)
+	      IF (STR_SAME(attname, 'bounds') .EQ. 0) bounds_done = .TRUE.
+
+* Original type of the attribute
+              IF (attype .EQ. NCCHAR)   atype = 'char'
+              IF (attype .EQ. NCBYTE)   atype = 'byte'
+              IF (attype .EQ. NCSHORT)  atype = 'int'
+              IF (attype .EQ. NCLONG)   atype = 'int'
+              IF (attype .EQ. NCFLOAT)  atype = 'float'
+              IF (attype .EQ. NCDOUBLE) atype = 'double'
+              alen = TM_LENSTR1(atype)
+
+	      WRITE (risc_buff, 2040) attname(1:slen), atype(1:alen)
+              CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+              IF (attype .NE. NCCHAR) THEN
+                 slen = 1
+                 attbuff = ' '
+                 DO 150 i = 1, attlen
+                    buff = TM_FMT(vals(i), 7, 14, llen)
+                    CALL ESCAPE_FOR_XML (buff, outstring, llen)
+	            WRITE ( risc_buff, 2050 ) outstring(1:llen)  ! was slen
+	            CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+ 150             CONTINUE
+              ELSE 
+                 CALL ESCAPE_FOR_XML (attbuff, outstring, llen)
+                 WRITE ( risc_buff, 2055 ) outstring(1:llen)
+                 CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+              ENDIF
+
+	      WRITE ( risc_buff, 2060 )
+	      CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+           ENDIF  ! attlen GT 0
+           ENDIF
+
+ 200    CONTINUE
+
+* Write a bounds attribute for unevenly-spaced axes even if the intput file
+* didnt have a bounds or edges attribute.
+
+	IF ( (.NOT.bounds_done) .AND. (.NOT.line_regular( line )) ) THEN
+	   attname = 'bounds'
+	   atype = 'char'
+	   slen = TM_LENSTR1(attname)
+	   alen = TM_LENSTR1(atype)
+
+	   WRITE (risc_buff, 2040) attname(1:slen), atype(1:alen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+	   slen = TM_LENSTR1(vname)
+	   attbuff = vname(1:slen)//'_bnds'
+
+	   CALL ESCAPE_FOR_XML (attbuff, outstring, llen)
+	   WRITE ( risc_buff, 2050 ) outstring(1:llen)
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+
+
+	   WRITE ( risc_buff, 2060 )
+	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ENDIF
+
+* closer tag
+
+ 1000   CONTINUE
+	IF (status .LT. 0) THEN
+	   status = ferr_ok
+	ELSE
+           WRITE ( risc_buff, 2080 ) 
+   	   CALL SPLIT_LIST(pttmode_explct, lun, risc_buff, 0)
+	ENDIF
+
+	RETURN
+	END
+
+
+
diff --git a/fer/gnl/show_mem_vars.F b/fer/gnl/show_mem_vars.F
new file mode 100644
index 0000000..efe6d27
--- /dev/null
+++ b/fer/gnl/show_mem_vars.F
@@ -0,0 +1,128 @@
+	SUBROUTINE SHOW_MEM_VARS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SHOW VARIABLES/MEMORY command - display a priority-sorted list 
+* of the data in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/29/87 - (from XEQ_EXAMINE)
+* revision 0.1 - 7/8/87  - made mr_list and mr_sort into dummy args
+* revision 0.2 - 9/17/87 - made permanent vars,only the default
+*			   and added trans_arg output
+* revision 0.3 - 3/25/88 - added /NAMED qualifier, reformatted "PERM" output
+*			   and added interrupts
+* revision 0.4 - 6/27/88 - added /PERM and /TEMP qualifiers
+* revision 0.5 - 10/5/88 - loop 2,max_mrs --> 1,max_mr_avail
+* revision 0.6 - 1/10/89 - added grid info
+* V200:  5/19/89 - 4D symmetrical; major reformatting of output
+* 		 - deleted variables flagged in mr_protected
+*		 - sorting not needed because of deletion priority chain
+*		 - most code moved to SHOW_1_MR
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V650  Write to show_lun which may be set to a file unit number rather than std out*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xinterrupt.cmn'
+
+* calling argument declarations:
+
+* local variable declarations:
+	LOGICAL	show_all, show_perm, show_named, show_temp
+	INTEGER status, iqual, mr
+	CHARACTER datmsg*16
+	PARAMETER ( datmsg = 'data loaded with' )	!kob 12/96
+* local parameter declarations:
+	INTEGER	    slash_all, slash_named, slash_temp, slash_perm
+	PARAMETER ( slash_all = 1,
+     .		    slash_named = 2,
+     .		    slash_temp  = 3,
+     .		    slash_perm  = 4 )
+
+* interpret qualifiers
+	show_all   = qual_given( slash_all ) .GT. 0
+	show_named = show_all .OR. qual_given( slash_named ) .GT. 0
+	show_perm  = show_all .OR. qual_given( slash_perm ) .GT. 0
+	show_temp  = show_all .OR. qual_given( slash_temp ) .GT. 0
+	show_all   = show_temp .AND. show_perm
+* ... /PERM is default
+	show_perm  = show_perm .OR.
+     .		     .NOT.(show_all .OR. show_named .OR. show_temp)
+
+* write introductory line
+	IF ( show_all ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				'all data in memory:',19 )
+	ELSE
+	   IF ( show_named ) CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				datmsg//' /NAME=:',24 )
+	   IF ( show_perm  ) CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				datmsg//' /PERMANENT:',28 )
+	   IF ( show_temp  ) CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				datmsg//'out /PERMANENT:',31 )
+	ENDIF
+
+* display permanent variables
+	IF ( show_perm ) THEN
+	   DO 100 mr = 1, max_mr_avail
+	      IF ( interrupted ) CALL ERRMSG( ferr_interrupt,status,' ',*5000 )
+ 100	   IF (mr_protected(mr).EQ.mr_perm_protected) CALL SHOW_1_MR(mr,status)
+	ENDIF
+
+* display deletable variables
+	IF ( show_temp ) THEN
+	   mr = mr_del_flink(0)
+ 200	   IF ( mr .NE. 0 ) THEN
+	      IF ( interrupted ) CALL ERRMSG( ferr_interrupt,status,' ',*5000 )
+	      CALL SHOW_1_MR( mr, status )
+	      IF (status .NE. ferr_ok) GOTO 5000
+	      mr = mr_del_flink(mr)
+	      GOTO 200
+	   ENDIF
+	ENDIF
+
+ 5000	RETURN
+	END
diff --git a/fer/gnl/show_region.F b/fer/gnl/show_region.F
new file mode 100644
index 0000000..d2a0bdc
--- /dev/null
+++ b/fer/gnl/show_region.F
@@ -0,0 +1,114 @@
+	SUBROUTINE SHOW_REGION( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute SHOW REGION for a single context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/23/87
+* revision 0.1 - 3/23/88 - enlarged cx_DIM_STR to accomodate date/time strings
+* V200:  5/19/89 - reordered lo/hi_ss args
+* Unix/RISC port - 2/27/91 - mystery error with version of FORTRAN compiler
+*		          eliminated using temporary buffer for cx_dim_str
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V550: *acm*10/02- Changed cx_name to char*24, so use TM_LENSTR1 with it.
+*       *ACM*11/02- Did NOT need the above change with TM_LENSTR1.
+* v554: *acm* 11/03 call SPLIT_LIST with open string length; region names now up to 24 long.
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If cancelled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER	cx
+
+* local parameter declarations:
+	LOGICAL	    full_precision
+	PARAMETER ( full_precision = .TRUE. )
+
+* local variable declarations:
+	INTEGER  idim, slen, listdims
+	CHARACTER cx_DIM_STR*48
+
+* If mode 6d_lab has been cancelled, we will list info only for 
+* the first 4 dimensions. (If they've set an E or F region, just
+* don't show it.)
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+
+* write region name
+	IF ( cx .EQ. cx_last ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				'default region:',0)
+	ELSE
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'region '//cx_name(cx),0)
+	ENDIF
+
+* describe each axis - produce lines as complex as:"X=lo:hi at xxx:nn (transform)"
+	DO 100 idim = 1, listdims
+* axis unspecified ?
+	   IF (  cx_by_ss(idim,cx)
+     .	        .AND. cx_lo_ss (cx,idim) .EQ. unspecified_int4
+     .	   .OR..NOT.cx_by_ss(idim,cx)
+     .		.AND.  cx_lo_ww (idim,cx) .EQ. unspecified_val8) THEN
+	      CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				'        '//ww_dim_name(idim)//
+     .				'/'//ss_dim_name(idim)//' is unspecified',
+     .				26 )
+	   ELSE
+
+* write it out
+	      CALL SPLIT_LIST(pttmode_explct, show_lun,'        '
+     .		//CX_DIM_STR(idim,cx,':',full_precision,slen),0)
+
+	   ENDIF
+
+ 100	CONTINUE	      
+
+	RETURN
+	END
diff --git a/fer/gnl/show_regrid_transforms.F b/fer/gnl/show_regrid_transforms.F
new file mode 100644
index 0000000..ee09cad
--- /dev/null
+++ b/fer/gnl/show_regrid_transforms.F
@@ -0,0 +1,185 @@
+    	SUBROUTINE SHOW_REGRID_TRANSFORMS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* show a nicely formatted list of the available regridding transforms
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:  11/95 - based on SHOW_TRANSFORMS
+*	  1/96 - bug fix: crash on last (single transform) line
+*			"num_transforms" ==> "max_regrid_trans"
+*	  4/96 - branching bug detected by Sun f77 compiler
+* V650  Write to show_lun which may be set to a file unit number rather than std out
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V690  12/13 *sh* show auxiliary variable regridding transforms
+*    Note:  this routine and SHOW_TRANSFORMS are both messy and could be
+*           readily cleaned up and consolidated into 1 piece of code
+*           by creating a single output routine and using logical arrays
+*           to indicate which transforms to hide during SHOW TRANSFORMS
+
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xprog_state.cmn'
+	include	'xalgebra.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations:
+*...
+
+* local variable declarations:
+	INTEGER n, i, i1, i2
+
+* introductory line
+	CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'regridding transforms e.g.SST[GX=x5deg at AVE]', 43)
+
+* count number of transforms
+	n=0
+	DO 110 i = 1, max_regrid_trans
+           IF (.NOT.alg_regrid_vizb(i)) GOTO 110
+	   n = n+1
+ 110	CONTINUE
+* locate half-way point in the list
+	i = 0
+	DO 112 i2 =  1, max_regrid_trans
+           IF (.NOT.alg_regrid_vizb(i2)) GOTO 112
+           i = i+1
+	   IF ( i .GT. (n+1)/2 ) GOTO 115
+ 112	CONTINUE
+* heading lines
+ 115	WRITE (risc_buff, 3050) ('code','description',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+        WRITE (risc_buff, 3050) ('----','-----------',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3050   FORMAT (T4,A,T16,A,T45,A,T57,A)
+* list the transforms 2 per line - use 2 separate pointers
+	i1 = 0
+	i2 = i2 - 1
+	DO 150 i = 1, (n+1)/2
+* ... locate first pointer
+           DO 120 i1 = i1+1, max_regrid_trans
+              IF (.NOT.alg_regrid_vizb(i1)) GOTO 120
+	      GOTO 121
+ 120	   CONTINUE
+* ... locate second pointer
+ 121	   DO 130 i2 = i2+1,  max_regrid_trans
+              IF (.NOT.alg_regrid_vizb(i2)) GOTO 130
+	      GOTO 131
+ 130	   CONTINUE
+ 131	   IF ( i .LE. n/2 ) THEN
+* ... write two transforms per line
+              WRITE (risc_buff, 3054)
+     .                 alg_regrid_code(i1), alg_regrid_title(i1),
+     .                 alg_regrid_code(i2), alg_regrid_title(i2)
+	   ELSE
+* ... write the last transformation on a line alone
+              WRITE (risc_buff, 3055)
+     .                 alg_regrid_code(i1), alg_regrid_title(i1)
+	   ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 150   CONTINUE
+
+***********
+* now the auxiliary regridding transforms
+
+* introductory line
+	CALL SPLIT_LIST(pttmode_explct, show_lun, ' ', 1)
+	CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'auxiliary varible regridding transforms'//
+     .          ' e.g.TEMP[GZ(depth)=zax at AVE]', 0)
+
+* count number of transforms
+	n=0
+	DO 210 i = max_regrid_trans+1, max_auxregrid_trans
+           IF (.NOT.alg_regrid_vizb(i)) GOTO 210
+	   n = n+1
+ 210	CONTINUE
+* locate half-way point in the list
+	i = 0
+	DO 212 i2 =  max_regrid_trans+1, max_auxregrid_trans
+           IF (.NOT.alg_regrid_vizb(i2)) GOTO 212
+           i = i+1
+	   IF ( i .GT. (n+1)/2 ) GOTO 215
+ 212	CONTINUE
+* heading lines
+ 215	WRITE (risc_buff, 3050) ('code','description',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+        WRITE (risc_buff, 3050) ('----','-----------',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+* list the transforms 2 per line - use 2 separate pointers
+	i1 = max_regrid_trans
+	i2 = i2 - 1
+	DO 250 i = 1, (n+1)/2
+* ... locate first pointer
+           DO 220 i1 = i1+1, max_auxregrid_trans
+              IF (.NOT.alg_regrid_vizb(i1)) GOTO 220
+	      GOTO 221
+ 220	   CONTINUE
+* ... locate second pointer
+ 221	   DO 230 i2 = i2+1,  max_regrid_trans
+              IF (.NOT.alg_regrid_vizb(i2)) GOTO 230
+	      GOTO 231
+ 230	   CONTINUE
+ 231	   IF ( i .LE. n/2 ) THEN
+* ... write two transforms per line
+              WRITE (risc_buff, 3054)
+     .                 alg_regrid_code(i1), alg_regrid_title(i1),
+     .                 alg_regrid_code(i2), alg_regrid_title(i2)
+	   ELSE
+* ... write the last transformation on a line alone
+              WRITE (risc_buff, 3055)
+     .                 alg_regrid_code(i1), alg_regrid_title(i1)
+	   ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 250   CONTINUE
+
+
+***********
+ 3054   FORMAT (T4,'@',A6,T16,A20,T45,'@',A6,T57,A20)
+ 3055   FORMAT (T4,'@',A6,T16,A20)
+	RETURN
+
+	END
diff --git a/fer/gnl/show_transforms.F b/fer/gnl/show_transforms.F
new file mode 100644
index 0000000..c625ea4
--- /dev/null
+++ b/fer/gnl/show_transforms.F
@@ -0,0 +1,138 @@
+    	SUBROUTINE SHOW_TRANSFORMS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* show a nicely formatted list of the available transforms
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:  11/95 - lifted from XEQ_SHOW
+*	       - and SHOW LIST (tab and comma delimited formats)
+*	 12/95 - show explicit ITP as well (start at index 3 instead of 4)
+* V430:   7/96 - incorporate 4D transformations: AVE, VAR, DIN, NDG, NBD
+* V446:   9/97 - bug showed up with addition of new xforms
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xprog_state.cmn'
+	include	'xalgebra.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations:
+*...
+
+* local variable declarations:
+	INTEGER n, i, i1, i2, i4d
+
+* count number of transforms
+	n=0
+	DO 110 i = 1, num_transforms
+	   IF ( alg_trans_num( i ) .EQ. unspecified_int4  ) GOTO 110
+	   IF ( alg_trans_num( i ) .EQ. trans_no_transform) GOTO 110
+       IF ( alg_trans_num( i ) .EQ. trans_reduced     ) GOTO 110
+* ... skip hidden transforms (e.g. 4D internal implementations)
+	   DO 109 i4d = 1, num_4d_trans
+	      IF (alg_trans_num( i ) .EQ. alg_4d_trans(i4d)) GOTO 110
+ 109	   CONTINUE
+	   n = n+1
+ 110	CONTINUE
+* locate half-way point in the list
+	i = 0
+	DO 112 i2 = 1, num_transforms
+	   IF ( alg_trans_num( i2 ) .EQ. unspecified_int4  ) GOTO 112
+	   IF ( alg_trans_num( i2 ) .EQ. trans_no_transform) GOTO 112
+       IF ( alg_trans_num( i2 ) .EQ. trans_reduced     ) GOTO 112
+* ... skip hidden transforms (e.g. 4D internal implementations)
+	   DO 111 i4d = 1, num_4d_trans
+	      IF (alg_trans_num( i2 ) .EQ. alg_4d_trans(i4d)) GOTO 112
+ 111	   CONTINUE
+           i = i+1
+	   IF ( i .GT. (n+1)/2 ) GOTO 115
+ 112	CONTINUE
+* heading lines
+ 115	WRITE (risc_buff, 3050) ('code','description',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, 0)
+	risc_buff = ' '
+        WRITE (risc_buff, 3050) ('----','-----------',i=1,2)
+	CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3050   FORMAT (T4,A,T16,A,T45,A,T57,A)
+* list the transforms 2 per line - use 2 separate pointers
+	i1 = 3 - 1
+	i2 = i2 - 1
+	DO 150 i = 1, (n+1)/2
+* ... locate first pointer
+           DO 120 i1 = i1+1, num_transforms
+              IF ( alg_trans_num( i1 ) .EQ. unspecified_int4  ) GOTO 120
+	      IF ( alg_trans_num( i1 ) .EQ. trans_no_transform) GOTO 120
+          IF ( alg_trans_num( i1 ) .EQ. trans_reduced     ) GOTO 120
+* ... skip hidden transforms (e.g. 4D internal implementations)
+	      DO 119 i4d = 1, num_4d_trans
+	         IF (alg_trans_num( i1 ) .EQ. alg_4d_trans(i4d)) GOTO 120
+ 119	      CONTINUE
+	      GOTO 121
+ 120	   CONTINUE
+* ... locate second pointer
+ 121	   DO 130 i2 = i2+1, num_transforms
+              IF ( alg_trans_num( i2 ) .EQ. unspecified_int4  ) GOTO 130
+	      IF ( alg_trans_num( i2 ) .EQ. trans_no_transform) GOTO 130
+          IF ( alg_trans_num( i2 ) .EQ. trans_reduced     ) GOTO 130
+* ... skip hidden transforms (e.g. 4D internal implementations)
+	      DO 129 i4d = 1, num_4d_trans
+	         IF (alg_trans_num( i2 ) .EQ. alg_4d_trans(i4d)) GOTO 130 !9/97
+ 129	      CONTINUE
+	      GOTO 131
+ 130	   CONTINUE
+ 131	   IF ( i .LE. n/2 ) THEN
+* ... write two transforms per line
+              WRITE (risc_buff, 3054)
+     .                 alg_trans_text(i1), alg_trans_title(i1),
+     .                 alg_trans_text(i2), alg_trans_title(i2)
+	   ELSE
+* ... write the last transformation on a line alone
+              WRITE (risc_buff, 3055)
+     .                 alg_trans_text(i1), alg_trans_title(i1)
+	   ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 150   CONTINUE
+ 3054   FORMAT (T4,'@',A3,T16,A20,T45,'@',A3,T57,A20)
+ 3055   FORMAT (T4,'@',A3,T16,A20)
+	RETURN
+
+	END
diff --git a/fer/gnl/special_symbol.F b/fer/gnl/special_symbol.F
new file mode 100644
index 0000000..f9df96a
--- /dev/null
+++ b/fer/gnl/special_symbol.F
@@ -0,0 +1,310 @@
+	SUBROUTINE SPECIAL_SYMBOL( isym, name, value, slen )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* this routine is 2-in-1 to handle "special" (internally defined) symbols
+* it acts like an encapsulated special symbol "object" (FORTRAN ...)
+* if isym=0 on input then this is a request to translate the passed "name"
+*	if the given name is the name of a special symbol return its definition
+*	in value and its length in slen. Else return slen=0
+* if slen is a positive integer then return the name of that symbol
+*	or a blank name if the integer is larger than the number of symbols 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V522 7/00 *sh* - extracted from symbol_command.F
+* V530  8/00 *sh* - bug (feature) fix so that SHOW SYM doesn't eveluate
+*			PPL$XPIXEL
+*      12/00 *sh* - added symbols SESSION_DATE and SESSION_TIME
+*      10/01 *kob*- add symbol FERRET_PLATFORM to display the platform
+*                   the executable was built on. 
+*       8/05 *acm*- Allow more digits in xrevision number
+* V62   4/09 *acm*- Add new symbol DELTA_CPU. When it is evaluated,
+*                   calls the intrinsic fcn Dtime and sets the value to that new
+*                   delta-time since the last call.  Initialized in initizlize.F
+* V62   4/09 *acm*- Add new symbol CLOCK_SECS. When it is evaluated, calls the
+*                   intrinsic SYSTEM_CLOCK and sets the value to the delta-time 
+*                   in seconds since Ferret was initialized.
+* V62   4/09 *acm*- Add new symbols CURRENT_DATE, CURRENT_TIME. These get formatted
+*                   date and time, unlike SESSION_DATE, SESSION_TIME which remain
+*                   fixed at the start time of the Ferret session.
+* V62   5/09 *acm*- make FERRET_MEMORY a special symbol.
+* V65   1/10 *acm*- New special symbol N_OPEN_DSETS, counts the number of open datasets
+* V65   2/10 *acm*- Call CPU_TIME rather than DTIME for clock symbols. Works
+*                   with gfortran as well as g77.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V68   1/12 *acm*- Symbol FERRET_PRECISION is single or double.
+* V68   3/12 *acm*- Symbol SESSION_PID for the process ID
+* V68   2/13 *kms*- Symbol PROGRAM_NAME = Ferret or PyFerret
+
+* calling argument declarations:
+	INTEGER	  isym, slen
+	CHARACTER name*(*), value*(*)
+
+* internal parameter declaration
+	INTEGER nspecial
+	PARAMETER (nspecial = 17)
+
+* internal variable declarations:
+	INTEGER STR_UPCASE, TM_LENSTR, i, i1, ierr, wsid, 
+     .          nxpix, nypix, llen, icount, irate, imax, iset
+c        REAL DTIME 
+        REAL TArray(2), dtime_res, clock_secs, count, cputime_now
+	CHARACTER special(nspecial)*16, upname*16
+	CHARACTER LEFINT*16, TM_FMT*12, NF_INQ_LIBVERS*80, NF_INQ_LIBVERS_*80
+        CHARACTER*10 current_date, current_time, zone
+	INTEGER itimes(8)
+
+* names of special symbols (must be upper case)
+	DATA special(1)/ 'PPL$XPIXEL' /,
+     .	     special(2)/ 'PPL$YPIXEL' /,
+     .	     special(3)/ 'BYTEORDER' /,
+     .	     special(4)/ 'FERRET_VERSION' /,
+     .	     special(5)/ 'FERRET_PLATFORM' /,
+     .	     special(6)/ 'FERRET_PRECISION' /,
+     .	     special(7)/ 'NETCDF_VERSION' /,
+     .	     special(8)/ 'FERRET_MEMORY' /,
+     .	     special(9)/ 'SESSION_DATE' /,
+     .	     special(10)/ 'SESSION_TIME' /,
+     .	     special(11)/ 'SESSION_PID' /,
+     .	     special(12)/ 'DELTA_CPU' /,
+     .	     special(13)/ 'CLOCK_SECS' /,
+     .	     special(14)/ 'CURRENT_DATE' /,
+     .	     special(15)/ 'CURRENT_TIME' /,
+     .	     special(16)/ 'N_OPEN_DSETS' /,
+     .	     special(17)/ 'PROGRAM_NAME' /
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xplot_state.cmn'	! for PPL$XPIXEL
+	include 'xrevision.cmn'
+	include 'xtoday.cmn'
+	include 'xplatform_type.cmn'
+	include 'xvariables.cmn'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+
+* #ifdef for endianness info.
+#ifdef sun
+	include 'xmachine_byte.cmn'
+#else
+	include 'xmachine_int1.cmn'
+#endif
+
+* is this a query by integer or by name?
+	IF (isym .GE. 1) THEN 
+* ***** QUERY BY INTEGER ******
+	   IF (isym.GT.nspecial) THEN
+	      name = ' '
+	      RETURN
+	   ENDIF
+	   name = special(isym)
+	   RETURN
+	ENDIF
+
+* ***** QUERY BY NAME *****
+* identify the given name
+	ierr = STR_UPCASE( upname, name )
+	DO 100 i = 1, nspecial
+	   IF (upname .EQ. special(i)) GOTO 200
+ 100	CONTINUE
+
+* not a recognized special symbol
+	slen = 0
+	RETURN
+
+ 200	GOTO (1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 
+     .        1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600,
+     .        2700) i
+
+* PPL$XPIXEL, PPL$YPIXEL
+ 1100	CONTINUE
+* ... determine the current output window (GKS wkstn ID, that is)
+ 1200	DO 1230 wsid = 1, max_windows
+           IF ( wn_active(wsid) ) GOTO 1240
+ 1230   CONTINUE
+* ... no currently active window
+	value = '0'
+	slen = 1
+	RETURN
+ 1240	CALL GET_WINDOW_PIXELS(wsid, nxpix, nypix)
+	IF ( i.EQ.1 ) THEN
+	   value = LEFINT(nxpix,slen)
+	ELSE
+	   value = LEFINT(nypix,slen)
+	ENDIF
+	RETURN
+
+* BYTEORDER - get byteorder of this architecture
+ 1300	IF (active_cpu .EQ. cptype_sun) THEN
+	   value = 'BIG'
+	   slen = 3
+	ELSE
+	   value = 'LITTLE'
+	   slen = 6
+	ENDIF
+	RETURN
+
+* FERRET_VERSION
+ 1400	value = ' '
+	value = TM_FMT(revision_level, 5, 12, llen)
+	slen = llen
+	RETURN
+
+* PLATFORM_TYPE  *kob* 10/01
+ 1500	value = platform_type
+	slen = TM_LENSTR(platform_type)
+	RETURN
+
+* FERRET_PRECISION
+ 1600	CONTINUE
+#ifdef double_p
+        value = 'double'
+#else
+        value = 'single'
+#endif
+	slen = TM_LENSTR(value)
+	RETURN
+
+* NETCDF_VERSION
+ 1700	CONTINUE
+#ifdef usingDODSf2cUnderscore
+        value = NF_INQ_LIBVERS_()
+#else
+	value = NF_INQ_LIBVERS()
+#endif
+	slen = TM_LENSTR(value)
+	RETURN
+
+* FERRET_MEMORY
+ 1800	value = TM_FMT(max_mem_blks*mem_blk_size/1.E6,3,12,llen)
+	slen = llen
+	RETURN
+
+* SESSION_DATE
+ 1900	value = today_date
+	slen = 9
+	RETURN
+
+* SESSION_TIME
+ 2000	value = today_time
+	slen = 5
+	RETURN
+
+* SESSION_PID
+ 2100	CONTINUE
+	i1 = GETPID()
+	count = i1
+	value =  TM_FMT(count, 10, 10, slen)
+	RETURN
+
+
+* DELTA_CPU
+ 2200	CONTINUE
+c        CALL DTIME(TArray)
+	CALL CPU_TIME(cputime_now)
+        dtime_res = cputime_now - cpu_last
+	cpu_last = cputime_now
+	value = ' '
+	value = TM_FMT(dtime_res, 6, 8, slen)
+	RETURN
+
+* CLOCK_SECS
+ 2300	CALL SYSTEM_CLOCK(icount, irate, imax)
+        clock_secs = FLOAT(icount-clock_start_count)/FLOAT(irate)
+	IF (clock_secs .LT. 0) THEN
+           CALL WARN('Evaluating CLOCK_SECS, call to '//
+     .     'SYSTEM_CLOCK. Count has exceeded its max and reset.')
+           CALL WARN( 'This value of CLOCK_SECS is invalid. '//
+     .     'Resetting to new initial value.')
+           clock_secs = 0.
+	   clock_start_count = FLOAT(icount)/FLOAT(irate)
+	ENDIF
+	value = ' '
+	value = TM_FMT(clock_secs, 6, 8, slen)
+	RETURN
+
+* CURRENT_DATE
+ 2400	CONTINUE
+
+#ifdef AIX_XLF
+	CALL AIX_DATE( current_date )
+#elif F90_DATE_TIME
+	CALL FDATE(current_date)
+#else
+	CALL GET_DATE_AND_TIME (current_date, current_time)
+#endif
+        value = current_date
+	slen = 9
+	RETURN
+
+* CURRENT_TIME
+ 2500	CONTINUE
+
+#ifdef AIX_XLF
+	CALL AIX_TIME( current_time )
+#elif F90_DATE_TIME
+	CALL FTIME(current_time)
+#else
+	CALL GET_DATE_AND_TIME (current_date, current_time)  ! doesnt get seconds
+
+	CALL Date_and_Time(current_date, current_time, Zone, itimes)
+        WRITE (current_time,1000) itimes(5), itimes(6), itimes(7)
+ 1000   FORMAT (2(I2.2,":"), I2.2)
+
+#endif
+	value = current_time
+	slen = 8
+	RETURN
+
+* N_OPEN_DSETS
+ 2600	CONTINUE
+ 
+	count = 0.
+	DO 2690 iset = 1, maxdsets
+	   IF ( ds_name(iset) .NE. char_init1024) count = count + 1.
+ 2690	CONTINUE
+
+	value =  TM_FMT(count, 10, 10, slen)
+	RETURN
+
+* PROGRAM_NAME
+ 2700   CONTINUE
+
+        value = 'PyFerret'
+        slen = 8
+        RETURN
+
+
+	END
diff --git a/fer/gnl/symbol_command.F b/fer/gnl/symbol_command.F
new file mode 100644
index 0000000..0020051
--- /dev/null
+++ b/fer/gnl/symbol_command.F
@@ -0,0 +1,253 @@
+	SUBROUTINE SYMBOL_COMMAND( buffer, clen, did_sub, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if any PLOT+ symbols were used and replace the first one with
+* the "value" string if so
+
+* replacing only the first allows the calling routine to trap recursions
+* and makes the logic simpler ... it is not optimal, however, for performance
+
+* note that additional logic in this routine allows it to detect nested 
+* PLOT+ symbols (e.g. "($lab_($lab_title))" where lab_title="4" would first
+* translate to "($lab_4)" and then resolve this symbol
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V400: *sh* 6/1/95 - based on ALIAS_COMMAND
+* V420: *sh* 10/9/95 - added PPL$XPIXEL and PPL$YPIXEL
+*	      11/95 - bug fix: single character symbols not translated
+*	       3/96 - allow the same coaching (string substitution) options
+*			for editing symbols that exists for numbered
+*			"dollar arguments" to GO files
+* V430	*kob* 11/96 - Need to avoid passing a concatenated string as
+*		      on argument to COACHED_STR_SUB routine for sgi. 
+*		      added crptd_cat_argument ifdef and set it to true
+*		      for sgi
+* Linux Port *kob* 12/96 - had to remove a single quote from a comment line
+* 
+* v491b2 - *kob* 3/98 - fixed sgi only bug introduced by 11/96 change.  erroneously
+*                       reused "clen" argument..changed it to clen2
+*      *js* 4/99 - yet another Ferret hack to add a byteorder symbol -- value
+*                can be BIG or LITTLE
+* v500 5/99 *kob* - bug fix:  erroneous error trap for single character symbol 
+*                             replacement
+* V522 7/00 *sh* - hack to add symbol "FERRET_VERSION"
+*	         - call upon the new routine SPECIAL_SYMBOL
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+* 9/06 *acm* 6.01  fixing bug 1439 long symbol values; change length of symval to 2048
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+* calling argument declarations:
+	LOGICAL	  did_sub
+	INTEGER	  clen, status
+	CHARACTER buffer*(*)
+
+*11/96 *kob*
+#ifdef sgi
+#  define crptd_cat_argument
+#endif
+
+
+* internal variable declarations:
+	LOGICAL coaching
+	INTEGER	STR_UPCASE, lenbuff, spos, epos, nchar, ierr,
+     .		i, i2, coach_start, coach_end, sym_end
+	CHARACTER symname*120, c1*1,
+     .					symval*2048
+!     .					symval*255 ! to match PPLUS
+
+* internal parameter declarations:
+	CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+
+* 11/96 *kob*
+#ifdef crptd_cat_argument
+	INTEGER clen2
+	CHARACTER cat_argument*48
+#endif 
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcommand.cmn'
+	include 'xrisc.cmn'
+
+* initialize
+	did_sub = .FALSE.
+	status = ferr_ok
+
+* immediate exit if there are no symbols in the line
+	spos = INDEX( buffer(:clen), '($' )
+	IF ( spos .EQ. 0 ) RETURN
+
+* initialize to continue
+	risc_buff = buffer	! ready for error messages (f77 "//" Unix bug)
+	lenbuff = LEN( buffer )
+
+* locate the closing parenthesis
+* but watching out for a nested "($" as in the commens above
+	epos = spos + 2
+100	CONTINUE
+* ... check for nested symbols
+	   IF ( epos .LE. clen-2 ) THEN
+	      IF ( buffer(epos:epos+1) .EQ. '($' ) THEN
+	         spos = epos	! new starting point
+	         epos = epos + 2
+	         GOTO 100
+	      ENDIF
+	   ENDIF
+* ... check for closing parenthesis	         
+	   IF ( buffer(epos:epos) .EQ. ')' ) GOTO 110
+	   epos = epos + 1
+	IF ( epos .LE. clen ) GOTO 100
+	GOTO 5100	! no closing paren was supplied
+ 110	sym_end = epos - 1
+
+* 3/96 identify and locate any "coaching" text that accompanies the symbol
+* ... look for a character between '!' and '&' in the ASCII table
+*     but not a dollar sign
+	coaching = .FALSE.
+	DO 150 i = spos+2, epos-1
+	   c1 =  buffer(i:i)
+	   IF (c1.GE.'!' .AND. c1.LE.'&' .AND. c1.NE.'$') THEN
+	      coaching = .TRUE.
+	      sym_end = i - 1
+	      coach_start = i + 1
+	      GOTO 151		! break out of loop
+	   ENDIF
+ 150	CONTINUE
+ 151	CONTINUE
+
+* if coaching text was supplied then locate the coaching end
+	IF ( coaching ) THEN
+* ... locate the terminating coach character (if supplied)
+	   coach_end = epos - 1			! default if no closing char
+	   DO 170 i = coach_start, epos-1
+	      IF ( c1 .EQ.  buffer(i:i) ) THEN
+* ... make sure there is only white space filling out the parens
+	        DO 160 i2 = i+1, epos-1
+ 160	        IF ( buffer(i2:i2) .NE. ' '
+     .	      .AND.  buffer(i2:i2) .NE. tab ) GOTO 5300
+	        coach_end = i-1
+	        GOTO 171
+	      ENDIF
+ 170	   CONTINUE
+ 171	   CONTINUE
+	ENDIF
+
+* translate the symbol name
+* ierr=0 means success;   ierr=1 means symbol not found
+ 	IF ( spos+2 .LE. sym_end ) THEN 	! 11/95 bug fix: "LT" --> "LE"
+!	   symname = buffer(spos+2:sym_end)	! change case for PPL$XPIXEL
+	   ierr = STR_UPCASE( symname, buffer(spos+2:sym_end) )	! 10/95
+* ... check for special internal Ferret symbols 
+	   CALL SPECIAL_SYMBOL(0, symname, symval, nchar)
+	   IF (nchar .EQ. 0) THEN
+* ... translate a standard PLOT+ symbol
+	      CALL GETSYM(symname, symval, nchar, ierr)
+	      IF ( ierr .EQ. 1 ) nchar = 0	! use NULL string if undefined
+	   ENDIF
+	ELSE
+	   nchar = 0
+	ENDIF
+
+* perform the coached text substitution, if requested
+	IF ( coaching ) THEN
+* 4/99 *kob* bug fix  - change below to .GT. from .GE
+	   IF (coach_start .GT. coach_end) GOTO 5400
+*11/96 *kob* - concatenation w/in procedure call corrupted on sgis. !kob 12/96
+#ifdef crptd_cat_argument	
+	   cat_argument = 'symbol '//buffer(spos+2:sym_end)
+	   clen2 = MIN(48,7 + sym_end-spos-1)
+	   CALL COACHED_STR_SUB( cat_argument(:clen2),
+     .		symval, buffer(coach_start:coach_end), risc_buff,
+     .		nchar, status ) 
+#else
+	   CALL COACHED_STR_SUB( 'symbol '//buffer(spos+2:sym_end),
+     .		symval, buffer(coach_start:coach_end), risc_buff,
+     .		nchar, status ) 
+#endif
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   symval = risc_buff(:nchar)
+	ENDIF
+
+* substitute the value text for the symbol name and the enclosing quotes
+        IF ( clen + (nchar-(epos-spos+1)) .GT. lenbuff ) THEN
+           GOTO 5200					! too big to fit
+        ELSE
+* ... place the "value" string into risc_buff
+	   IF ( nchar .EQ. 0 ) THEN
+	      risc_buff = ' '
+	      nchar = 1
+	   ELSE
+	      risc_buff = symval(:nchar)
+	   ENDIF
+* ... append onto it anything to the right of the symbol in the cmnd buffer
+	   IF ( epos .LT. clen ) THEN
+	      risc_buff(nchar+1:) = buffer(epos+1:)
+	      nchar = nchar + (clen-epos)
+	   ENDIF
+* ... replace the symbol name and all that is to the right	   
+           buffer(spos:) = risc_buff(:nchar)
+           clen = (spos-1) + nchar
+        ENDIF
+
+* successful substitution
+	did_sub = .TRUE.
+
+* error exits
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, 'no closing symbol paren: '//
+     .		risc_buff(spos:clen), *5000)
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'symbol substitution makes line too long'//pCR//
+     .		symname(:epos-spos-2)//' = '//symval(:nchar), *5000)
+ 5300	CALL ERRMSG( ferr_syntax, status,
+     .		'stray characters at symbol end: '//
+     .		risc_buff(spos:epos), *5000)
+ 5400	CALL ERRMSG( ferr_syntax, status,
+     .		'empty argument replacement string: '//
+     .		risc_buff(spos:epos), *5000)
+	END
diff --git a/fer/gnl/translate_lat_long.F b/fer/gnl/translate_lat_long.F
new file mode 100644
index 0000000..e7a2eef
--- /dev/null
+++ b/fer/gnl/translate_lat_long.F
@@ -0,0 +1,110 @@
+	SUBROUTINE TRANSLATE_LAT_LONG(string, idim, answer, formatted, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert an ascii representation of a latitude or longitude value into 
+* a floating point value using special format rules
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/11/86
+* revision 0.1 - 3/14/89 - return "formatted" flag
+* V300  9/93 - insist that "N", "S", "E", "W" are the LAST character
+* V420 (IBM/AIX port of V411): 10/5/95 - buffer "READ(var,*"
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* possible formats:
+*   x coord:  #  or #E  or  #W  for East  or West,  respectively
+*   y coord:  #  or #S  or  #N  for South or North, respectively
+*   z coord:  #
+*   t coord:  #  or dd-mmm-yyyy at hh-mm-ss  eg 14-JAN-1986 at 11:15
+
+	include 'errmsg.parm'
+	include 'ferret.parm'
+
+	CHARACTER*(*)	string
+	LOGICAL		n_given, s_given, e_given, w_given, formatted
+	INTEGER		n_pos, s_pos, e_pos, w_pos, slen, status, idim
+	REAL*8		answer
+
+* local declarations
+	CHARACTER	buff*32		! 10/95
+
+* initialize
+	slen = LEN ( string )
+	n_given = string(slen:slen).EQ.'N' .OR. string(slen:slen).EQ.'n'
+	s_given = string(slen:slen).EQ.'S' .OR. string(slen:slen).EQ.'s'
+	e_given = string(slen:slen).EQ.'E' .OR. string(slen:slen).EQ.'e'
+	w_given = string(slen:slen).EQ.'W' .OR. string(slen:slen).EQ.'w'
+	formatted = n_given .OR. s_given .OR. e_given .OR. w_given
+
+* how much of the string is numeric ?
+	IF ( formatted ) slen = slen - 1
+
+* decode the value
+	buff =  string(1:slen)		! 10/95
+	READ ( buff, * , ERR=5000 ) answer
+
+* make corrections for latitude/longitude notation
+	IF     ( n_given ) THEN
+
+* latN - no change
+	   IF ( idim .NE. y_dim ) GOTO 5000
+	ELSEIF ( s_given ) THEN
+
+* latS - make negative
+	   IF ( idim .NE. y_dim ) GOTO 5000
+	   answer = -answer
+	ELSEIF ( e_given ) THEN
+
+* longE - no change
+	   IF ( idim .NE. x_dim ) GOTO 5000
+	ELSEIF ( w_given ) THEN
+
+* longW - convert	
+	   IF ( idim .NE. x_dim ) GOTO 5000
+	   answer = 360. - answer
+	ENDIF
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	CALL ERRMSG	( ferr_syntax, status, string, *5010 )
+ 5010	RETURN
+	END
diff --git a/fer/gnl/translate_limit.F b/fer/gnl/translate_limit.F
new file mode 100644
index 0000000..bfd4955
--- /dev/null
+++ b/fer/gnl/translate_limit.F
@@ -0,0 +1,207 @@
+	SUBROUTINE TRANSLATE_LIMIT
+     .		(string, idim, subscript, answer, formatted, cal_id, 
+     .		status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert an ascii representation of a coordinate value into a floating point 
+* representation using special format rules
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/11/86
+* revision 0.1 - 3/27/87 - corrected bug that let ","," " or tab slip through
+* revision 0.2 - 4/28/87 - allowed relative ("d") notation
+* revision 0.3 - 3/25/88 - added date/time formatted input
+* revision 0.4 -12/14/88 - corrected error detection
+* revision 0.5 - 3/14/89 - return "formatted" flag
+* V200:  6/15/89 - eliminated "d" notation and "relative" logic
+*	11/30/89 - error check for comma in string
+*	 2/16/90 - error check for slash in string
+* Unix/RISC port - 3/12/91 - TM_DATE to replace READ(ERR=) testing date string
+* V230:  6/19/92 - bug in error reporting using "risc_buff" fixed
+* V300:  9/93 - allow "m" as in Z=15m to be acceptable
+* V310: 4/94 - ignore blanks before or after the text
+* V320: 1/95 - allow blanks in dates ("1-jan-1985 12:00")  TM_BREAK_DATE has
+*		a thorough parser
+* V420 (IBM/AIX port of V411): 10/5/95 - buff for "READ(var,*"
+* V500 *sh* - 6/99 check for quotations around text (e.g. date strings)
+* V53 *acm* - 3/01 calendar axes:  pass in calendar ID
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+* possible formats:
+* for subscript values ( subscript .EQ. .TRUE. ) :
+*	#	- simple number
+* for world coordinate values:
+*   x coord:  #  or #E  or  #W     for East, West
+*   y coord:  #  or #S  or  #N     for South, North
+*   z coord:  #  
+*   t coord:  #  or dd-mmm-$_ at hh:mm:ss  eg 14-JAN-1986 at 11:15
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'xrisc.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+	LOGICAL		subscript, formatted
+	INTEGER		status, idim
+	REAL*8		answer
+
+* internal variable declarations:
+	LOGICAL		TM_DIGIT, TM_DATE
+	INTEGER		TM_LENSTR1, end_pos, start_pos, pbad, i, 
+     .                  slen, j, cal_id
+	REAL*8		SECS_FROM_BC, given_answer
+	CHARACTER	buff*32				! for AIX port 10/95
+
+* internal parameter declarations:
+	CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* initialize fixed length string for RISC
+        risc_buff = string
+	len_rbuff = MIN( size_rbuff, LEN(string) )
+
+* imbedded comma, blank, slash or tab will go undetected as a READ syntax error
+	pbad = INDEX( string, ',' )
+	IF ( pbad .GT. 0 ) GOTO 5100
+	pbad = INDEX( string, tab )
+	IF ( pbad .GT. 0 ) GOTO 5100
+	pbad = INDEX( string, '/' )
+	IF ( pbad .GT. 0 ) GOTO 5100
+
+* initialize
+	end_pos = TM_LENSTR1( string )
+	formatted = .FALSE.	! may be reset later
+
+* (6/99) check for enclosing quotes
+	DO 4 i = 1, end_pos
+	   IF (string(i:i) .EQ. '"') THEN
+	      start_pos = i + 1
+	      GOTO 6
+	   ENDIF
+ 4	CONTINUE
+	start_pos = 1
+ 6	IF (start_pos .GT. 1) THEN
+	   DO 8 i = end_pos, start_pos, -1
+	      IF (string(i:i) .EQ. '"') THEN
+	         end_pos = i - 1
+	         GOTO 9
+	      ENDIF
+ 8	   CONTINUE
+	ENDIF
+ 9	IF (start_pos .GT. end_pos) GOTO 5000
+
+* special check for embedded blanks ignoring leading and following blanks 4/94
+	DO 10 i = start_pos, end_pos
+	   IF ( string(i:i) .NE. ' ' ) GOTO 11
+ 10	CONTINUE
+	pbad = 1
+	GOTO 5100    ! all blank string
+ 11	pbad = INDEX( string(i:end_pos), ' ' )
+	IF ( pbad.GT.0 .AND. idim.NE.t_dim ) GOTO 5100   ! t_dim fallthru 1/95
+
+* flag "D" ending as error as of version 2.00 of FERRET
+	IF ( string(end_pos:end_pos) .EQ. 'd'
+     .  .OR. string(end_pos:end_pos) .EQ. 'D' ) GOTO 5000
+
+	buff = string(i:end_pos)		! AIX port 10/95
+	slen = end_pos - i + 1
+	IF ( subscript ) THEN
+
+* /I /J /K or /L
+	   IF ( .NOT.TM_DIGIT(string(i:end_pos)) ) GOTO 5000
+	   READ ( buff,* , ERR=5000 ) given_answer
+* make sure the value given is integer
+	   answer = INT(given_answer)
+	   IF ( ABS( answer-given_answer ) .GT. 0.0001 ) GOTO 5000
+
+	ELSEIF ( idim .EQ. z_dim ) THEN    ! 9/93 addition to allow "m" at end
+* /Z
+	   formatted = string(end_pos:end_pos) .EQ.'m'
+     .	          .OR. string(end_pos:end_pos) .EQ.'M'
+	   IF ( formatted ) end_pos = end_pos - 1
+	   READ ( buff,* , ERR=5000 ) answer
+
+	ELSEIF ( idim .EQ. x_dim .OR. idim .EQ. y_dim .OR. idim .EQ. e_dim) THEN
+
+* /X and /Y and /E
+	   CALL TRANSLATE_LAT_LONG ( buff(:slen), idim,
+     .				     answer, formatted,status )
+	   IF ( status .NE. ferr_ok ) GOTO 5900
+
+	ELSE
+* /T or /F
+* date/time string ?
+           IF ( TM_DATE( buff(:slen) ) ) THEN
+* ... time step cannot be evaluated until we know what axis this is on
+* ... save number of seconds from B.C. as a negative to flag later translation
+
+	      answer = -1.D0 * SECS_FROM_BC( buff(:slen), cal_id, 
+     .                                       status )
+	      formatted = .TRUE.
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+           ELSE
+* ... read it as a time step value
+	      READ ( buff,* , ERR=5000 ) answer
+           ENDIF
+        ENDIF
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *5900 )
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .		'"'//risc_buff(pbad:pbad)//'" is illegal in '//
+     .		risc_buff(:len_rbuff), *5900 )
+ 5900	RETURN
+
+	END
diff --git a/fer/gnl/turnoff_verify.F b/fer/gnl/turnoff_verify.F
new file mode 100644
index 0000000..9fd5f52
--- /dev/null
+++ b/fer/gnl/turnoff_verify.F
@@ -0,0 +1,57 @@
+	SUBROUTINE turnoff_verify (status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Turn off verify, for -script mode
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* 8/2003
+* *kob* bug fix - remove ";" at end of status assingment line.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+
+	include 'tmap_dims.parm'
+	INCLUDE 'xprog_state.cmn'
+
+        INTEGER status
+
+	mode_state(pmode_verify,1) = .FALSE.
+        status = 1
+
+	END
+
diff --git a/fer/gnl/var_stat.F b/fer/gnl/var_stat.F
new file mode 100644
index 0000000..31da1ee
--- /dev/null
+++ b/fer/gnl/var_stat.F
@@ -0,0 +1,384 @@
+	SUBROUTINE VAR_STAT( dat, mv, cx, lun, full, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* report basic statistics about the data passed
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 3/25/88
+* V200:	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*	12/19/89 - eliminated the possibility of multiple data set variables
+*		 - corrected serious error in standard deviation calculation
+* Unix/RISC port - 3/12/91 - "formatted internal IO" bugs with
+*                            FUNCTIONS in WRITE list
+* V230: 7/29/92 - fixed precision problems when the variance is very small
+*                 compared to the mean - sumsq_dev could be negative.
+*                 Switched to a 2-pass computation
+*       8/28/92 - document shape of regions, too  (e.g. 160*100*27*12)
+*               - avoid overflows with "**too big**"
+* V300: 10/20/93 - changed **0.5 to SQRT to work-around Macintosh Lang. Sys.
+*		   FORTRAN bug
+* V320: 10/26/94 - changed routine name "STAT" to VAR_STAT for IBM/AIX
+*			compatibility
+*       12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420	 2/7/96  - added STAT/BRIEF
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V530: 9/00 *sh* - increase rbuff size to allow longer "(isiz*jsiz*ksiz*lsiz)"
+*		  - added support for string variables
+* V532: 5/01 *sh* - minor bug fix: "small" and "large" init'ed to wrong dtype
+* V606: 7/07 *acm*- define symbols with the latest results of a call to STAT
+*                   STAT_MIN, STAT_MAX, STAT_MEAN, STAT_STD
+* V608:10/07 *acm*- If all missing then set these symbols to 'bad'. Also set
+*                   symbols STAT_NGOOD, STAT_NBAD
+* V664:  8/10 - implement robust method for computing variances
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  Rename the file to match the function name var_stat.F
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+* V6.68  acm 3/14 ticket 2148: fix truncated ntot or nbad in stat listing
+
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+        include 'xrisc.cmn'           ! for Unix/RISC bugs (&12/94)
+	include 'xprog_state.cmn'
+
+* special equivalence needed only with risc compiler: bug fix
+        CHARACTER rbuff(4)*24
+        EQUIVALENCE ( rbuff, risc_buff )
+
+* calling argument declarations:
+	LOGICAL	full
+	INTEGER	mv, cx, lun, status
+	REAL    dat( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, CGRID_SIZE, GET_MAX_STRING_LEN,
+     .		i, j, k, l, m, n, nbad, ngood, ntot, idim,
+     .		len_line, len_set_name, grid, slen, i1, i2, nok, listdims
+	REAL	datum, bad, std_dev, large, small, mean, sumsq_dev, dev
+	REAL*8	sum, sum2, xmean, zmean, x, xdelta, variance_c
+
+	CHARACTER*255	VAR_TITLE, VAR_TITLE_MOD, vname_buff
+	CHARACTER	TM_FMT*12, LEFINT*16, AX_TITLE*32, CX_SIZE_STR*24,
+     .			line_buff*130, title*32, bl13*13, symbuff*30
+	PARAMETER (bl13 = '             ' )
+
+* local parameter declarations:
+	INTEGER		sig_fig
+	PARAMETER     ( sig_fig = 5 )
+
+* initialize
+	grid  = mr_grid( mv )
+	bad   = mr_bad_data( mv )
+	nbad  = 0
+	ngood = 0
+	small = arbitrary_large_val4
+	large = arbitrary_small_val4
+	sum   = 0.0D0
+        sumsq_dev = 0.0
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+
+	IF ( full ) THEN
+* give background on the data
+* ... first the variable name
+	   vname_buff   = VAR_TITLE( cx )
+	   CALL SPLIT_LIST(pttmode_explct, lun, ' ', 1)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		bl13//vname_buff( 1:TM_LENSTR1(vname_buff)), 0)
+ 3010	   FORMAT (13X,A)
+
+* ... qualify title with modification line ?
+	   vname_buff = VAR_TITLE_MOD( cx )
+	   IF ( vname_buff .NE. ' ' ) THEN
+	      len_line   = TM_LENSTR1( vname_buff )
+	      CALL SPLIT_LIST(pttmode_explct, lun, 
+     .			bl13//vname_buff(1:len_line), len_line+13)
+	   ENDIF
+
+* ... then location information normal to grid
+	   DO 60 idim = 1, listdims
+	      CALL ASCII_LIMITS( cx, idim, line_buff, len_line )
+	      title = AX_TITLE( idim, grid, slen )
+	      CALL SPLIT_LIST(pttmode_explct, lun, 
+     .		bl13//title( :slen )//': '//line_buff(:len_line), 0)
+ 60	   CONTINUE
+
+* ... then data set name or names
+	   CALL GET_DSET_NAME( cx_data_set(cx), line_buff, len_set_name )
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .		bl13//'DATA SET: '//line_buff(:len_set_name), 0)
+
+	ENDIF
+
+* string variables
+	IF ( mr_type(mv) .EQ. ptype_string ) THEN
+	   rbuff(1) = LEFINT(GET_MAX_STRING_LEN(cx,mv,dat), slen) 
+	   rbuff(2) = LEFINT(CGRID_SIZE(cx), slen)
+	   rbuff(3) = CX_SIZE_STR(cx,listdims,len_line)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Total # of strings: '//
+     .			 rbuff(2)(:slen)//' ('//rbuff(3)(:len_line)//')',0)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Maximum string length: '//rbuff(1),0)
+	   RETURN
+	ENDIF
+
+* pass 1: compute mean 
+        IF (mode_6d_lab) THEN
+	   DO 200 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	   DO 200 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	   DO 200 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	   DO 200 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	   DO 200 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	   DO 200 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	      datum = dat(i,j,k,l,m,n)
+
+	      IF ( datum .EQ. bad ) THEN
+	         nbad = nbad + 1
+
+	      ELSE
+	         ngood = ngood + 1
+	         small = MIN( small, datum )
+	         large = MAX( large, datum )
+                 sum   = sum + datum
+	      ENDIF
+ 200	   CONTINUE
+	ELSE 
+* If the data is 4D, and the user has canceled mode_6d_lab, just 
+* compute and list the 4D result.
+
+	   IF (cx_lo_s6(cx) .NE. unspecified_int4 .OR.
+     .	       cx_lo_s5(cx) .NE. unspecified_int4) GOTO 5100
+	   m = unspecified_int4
+	   n = unspecified_int4
+	   DO 210 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	   DO 210 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	   DO 210 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	   DO 210 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	   DO 210 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	      datum = dat(i,j,k,l,m,n)
+
+	      IF ( datum .EQ. bad ) THEN
+	         nbad = nbad + 1
+
+	      ELSE
+	         ngood = ngood + 1
+	         small = MIN( small, datum )
+	         large = MAX( large, datum )
+                 sum   = sum + datum
+	      ENDIF
+ 210	   CONTINUE
+	ENDIF
+
+        IF ( ngood .GT. 0 ) mean = sum / FLOAT(ngood)
+        IF ( ABS(sum) .GE. 3.D35 ) sumsq_dev = 3.E35  ! flag for next pass
+
+	IF ( full .AND. (ngood .GT. 1)) THEN
+* pass 2: compute variance 
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	   nok = 0
+	   xmean = 0.D0
+	   sum2 = 0.D0
+           zmean = mean
+
+           IF (mode_6d_lab) THEN
+	      DO 300 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	      DO 300 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	      DO 300 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	      DO 300 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	      DO 300 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	      DO 300 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	         x = dat(i,j,k,l,m,n)
+	         IF ( x .NE. bad ) THEN
+                    nok = nok + 1
+		    x = x - zmean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/FLOAT(nok)
+                    sum2 = sum2 + xdelta*(x - xmean)  ! This expression uses the new value of mean
+ 	         ENDIF
+
+ 300	      CONTINUE
+           ELSE  ! 4D result
+	      DO 310 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	      DO 310 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	      DO 310 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	      DO 310 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	      DO 310 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	      DO 310 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	         x = dat(i,j,k,l,m,n)
+	         IF ( x .NE. bad ) THEN
+                    nok = nok + 1
+		    x = x - zmean
+                    xdelta = x - xmean
+                    xmean = xmean + xdelta/FLOAT(nok)
+                    sum2 = sum2 + xdelta*(x - xmean)  ! This expression uses the new value of mean
+ 	         ENDIF
+
+ 310	      CONTINUE 
+           ENDIF
+
+           variance_c = sum2/FLOAT(nok - 1)
+	   std_dev = SQRT(variance_c)
+ 
+	ENDIF
+
+* compute and display results
+	ntot = nbad + ngood
+
+        rbuff(1) = LEFINT(nbad, slen)
+        rbuff(2) = LEFINT(ntot, slen)
+        rbuff(3) = CX_SIZE_STR(cx,listdims,len_line)
+	CALL SPLIT_LIST(pttmode_explct, lun,' ',1)
+	CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Total # of data points: '//
+     .			rbuff(2)(:slen)//' ('//rbuff(3)(:len_line)//')',0)
+	CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' # flagged as bad  data: '//rbuff(1),0)
+	IF ( ngood .GT. 0 ) THEN
+           rbuff(1) = TM_FMT(small, sig_fig, 12, slen)
+           rbuff(2) = TM_FMT(large, sig_fig, 12, slen)
+           IF ( ABS(sum) .GE. 3.D35 ) THEN
+              rbuff(3) = '**too big**'
+	      slen = 11
+           ELSE
+              rbuff(3) = TM_FMT(mean , sig_fig, 12, slen)
+           ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Minimum value: '//rbuff(1), 0)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Maximum value: '//rbuff(2), 0)
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Mean    value: '//rbuff(3)(:slen)//
+     .					' (unweighted average)', 0)
+	ENDIF
+
+! Define Ferret symbols with min, max, mean
+        IF (ngood .EQ. 0) THEN 
+           rbuff(1) = 'bad'
+           rbuff(2) = 'bad'
+           rbuff(3) = 'bad'
+        ENDIF
+	IF ( mr_type(mv) .NE. ptype_string ) THEN
+           symbuff = 'STAT_MIN'
+	   CALL GETSYM( symbuff, title, i2, i1 )
+	   IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           slen = TM_LENSTR1(rbuff(1))
+      	   CALL PUTSYM( symbuff, rbuff(1), slen, i2)
+           symbuff = 'STAT_MAX'
+	   CALL GETSYM( symbuff, title, i2, i1 )
+	   IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           slen = TM_LENSTR1(rbuff(2))
+      	   CALL PUTSYM( symbuff, rbuff(2), slen, i2)
+           symbuff = 'STAT_MEAN'
+	   CALL GETSYM( symbuff, title, i2, i1 )
+	   IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           slen = TM_LENSTR1(rbuff(3))
+      	   CALL PUTSYM( symbuff, rbuff(3), slen, i2)
+        ENDIF
+
+
+	IF ( full .AND. ngood.GT.1 ) THEN
+           IF ( sumsq_dev .GE. 3.E35 ) THEN
+              rbuff(1) = ' **too big**' 
+           ELSE
+              rbuff(1) = TM_FMT(std_dev, sig_fig, 12, slen)
+           ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, lun,
+     .			' Standard deviation: '//rbuff(1), 0)
+
+! Define Ferret symbols with std 
+	   IF ( mr_type(mv) .NE. ptype_string ) THEN
+              symbuff = 'STAT_STD'
+	      CALL GETSYM( symbuff, title, i2, i1 )
+	      IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+              slen = TM_LENSTR1(rbuff(1))
+      	      CALL PUTSYM( symbuff, rbuff(1), slen, i2)
+
+           ENDIF
+	ENDIF
+
+	IF ( full .AND. ngood.LE.1 .AND.
+     .        mr_type(mv) .NE. ptype_string) THEN
+           symbuff = 'STAT_STD'
+           CALL GETSYM( symbuff, title, i2, i1 )
+           IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           slen = 3
+           CALL PUTSYM( symbuff, 'bad', slen, i2)
+	ENDIF
+
+! Define Ferret symbols with ngood and nbad
+	IF ( full .AND. mr_type(mv) .NE. ptype_string ) THEN
+
+           symbuff = 'STAT_NGOOD'
+           CALL GETSYM( symbuff, title, i2, i1 )
+           IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           datum = ngood
+           rbuff(1) = TM_FMT(datum , sig_fig, 12, slen)
+           slen = TM_LENSTR1(rbuff(1))
+           CALL PUTSYM( symbuff, rbuff(1), slen, i2)
+
+           symbuff = 'STAT_NBAD'
+           CALL GETSYM( symbuff, title, i2, i1 )
+           IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+           datum = nbad
+           rbuff(1) = TM_FMT(datum , sig_fig, 12, slen)
+           slen = TM_LENSTR1(rbuff(1))
+           CALL PUTSYM( symbuff, rbuff(1), slen, i2)
+        ENDIF
+
+5000    RETURN
+5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'variable has more than 4 dimensions. Set mode 6D_LAB'
+     .		     //pCR//cmnd_buff(:len_cmnd),
+     .			*5000 )
+	END
diff --git a/fer/gnl/version_only.F b/fer/gnl/version_only.F
new file mode 100644
index 0000000..8d7b049
--- /dev/null
+++ b/fer/gnl/version_only.F
@@ -0,0 +1,66 @@
+	SUBROUTINE VERSION_ONLY 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write the version number, and stop
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 3/26/2010
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'xrevision.cmn'
+	include 'xrevision_type.cmn'
+	include 'xplatform_type.cmn'
+	include 'xmake_date.cmn'
+
+
+* calling argument declarations:
+
+* local variable definitions
+	INTEGER TM_LENSTR1, slen, plen
+        CHARACTER*12 TM_FMT, show_str
+
+        show_str = TM_FMT(revision_level, 5, 12, slen)
+	
+	plen = TM_LENSTR1(platform_type)
+
+	PRINT 3000, show_str(1:slen)
+ 3000	FORMAT (A )
+
+	RETURN
+	END
diff --git a/fer/gnl/warn.F b/fer/gnl/warn.F
new file mode 100644
index 0000000..a52561a
--- /dev/null
+++ b/fer/gnl/warn.F
@@ -0,0 +1,75 @@
+	SUBROUTINE WARN ( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display a warning message to the operator
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  7/17/89
+* Unix/RISC port "WARNING" --> "NOTE"
+* V300: - 6/17/93: added GUI control option for messages
+* V314: 8/22/94 *kob* IBM port - need to use risc buff for char. concat 
+* V400: 11/94 - send warnings to GUI via 
+* V320: 2/95 - use TMAP routine tm_note
+* V606  8/07 ACM Send Notes to std error.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+#ifdef NO_PASSED_CONCAT
+	include 'xrisc.cmn'
+#endif
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+        include 'gui.parm'
+	include 'xprog_state.cmn'
+        include 'xgui.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER TM_LENSTR1, llen
+
+* initialize
+	llen = TM_LENSTR1( string )
+
+* let the TMAP library do the work
+
+	CALL TM_NOTE( string(:llen), err_lun )
+
+	RETURN
+	END
diff --git a/fer/gnl/warn_occasionally.F b/fer/gnl/warn_occasionally.F
new file mode 100644
index 0000000..e311a00
--- /dev/null
+++ b/fer/gnl/warn_occasionally.F
@@ -0,0 +1,96 @@
+	SUBROUTINE WARN_OCCASIONALLY ( string, ncycle, cookie )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* display a warning message to the operator, but do not display it again
+* until it has been requested at least ncycle times.
+* each message must be associated with a unique, arbitrary cookie.
+
+* V690 12/13 *sh*
+
+!#ifdef NO_PASSED_CONCAT
+!	include 'xrisc.cmn'
+!#endif
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+!        include 'gui.parm'
+	include 'xprog_state.cmn'
+!        include 'xgui.cmn'
+
+* calling argument declarations:
+	INTEGER		ncycle, cookie
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER i
+
+* private COMMON storage used only by this routine
+	INTEGER	pn_uniq_msgs
+	PARAMETER (pn_uniq_msgs = 10)
+	INTEGER	nused, counter(pn_uniq_msgs), cookies(pn_uniq_msgs)
+	COMMON / XWARN_OCCASIONALLY / counter
+	DATA nused / 0 /
+	DATA counter /	pn_uniq_msgs*0 /
+
+* have we seen this cookie before?
+	DO 100 i = 1, nused
+	   IF (cookies(i) .EQ. cookie) THEN
+* ... a repeat request for this message
+	      IF (MOD(counter(i),ncycle) .EQ. 0) THEN
+	         GOTO 500
+	      ELSE
+	         counter(i) = counter(i) + 1
+	      ENDIF
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* this is a first time request -- cllaim a spot
+	nused = nused + 1
+	IF (nused .GT. pn_uniq_msgs) THEN
+	   CALL WARN('crptn: warn_occasionally ovfl')	
+	   RETURN
+	ENDIF
+	cookies(nused) = cookie
+
+* issue the warning and start the count-up cycle
+ 500	CALL WARN(string)
+	CALL WRITE_MULTI(err_lun,
+     .	   "           (This note will be repeated occasionally.)")
+	counter(i) = 1
+	RETURN
+	END
diff --git a/fer/gnl/write_dods_fmt.F b/fer/gnl/write_dods_fmt.F
new file mode 100644
index 0000000..2c74353
--- /dev/null
+++ b/fer/gnl/write_dods_fmt.F
@@ -0,0 +1,102 @@
+        SUBROUTINE WRITE_DODS_FMT ( data, 
+     .           m1lox,m1hix, m1loy,m1hiy, m1loz,m1hiz, m1lot,m1hit, 
+     .           m1loe,m1hie, m1lof,m1hif, 
+     .           workspace, filename, clobber, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write a gridded variable in DODS DAS binary format
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* Ferret v5.54 9/4/06
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* change this comment, so that the checkin under branch FDSv1
+* will occur.
+
+* calling argument declarations:
+        LOGICAL clobber
+        INTEGER status,
+     .          m1lox,m1hix, m1loy,m1hiy, m1loz,m1hiz, m1lot,m1hit, 
+     .          m1loe,m1hie, m1lof,m1hif
+	REAL data(m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif)
+        REAL    workspace (*)  
+        CHARACTER*(*) filename
+
+* Local variable declarations
+        INTEGER TM_LENSTR1, i, j, k, l, m, n, size, swap_flag,
+     .          clobber_flag, slen
+
+
+* #ifdef for endianness info.
+#ifdef sun
+	include 'xmachine_byte.cmn'
+#else
+	include 'xmachine_int1.cmn'
+#endif
+
+
+* BYTEORDER - get byteorder of this architecture
+ 	IF (active_cpu .EQ. cptype_sun) THEN
+	   swap_flag = 0
+	ELSE
+	   swap_flag = 1
+	ENDIF
+
+        size = 0
+
+	DO 100 n = m1lof,m1hif
+	DO 100 m = m1loe,m1hie
+	DO 100 l = m1lot,m1hit
+	DO 100 k = m1loz,m1hiz
+	DO 100 j = m1loy,m1hiy
+	DO 100 i = m1lox,m1hix
+
+           size = size + 1
+           workspace(size) = data(i,j,k,l,m,n)
+  100   CONTINUE
+
+         slen = TM_LENSTR1(filename)
+         clobber_flag = 0
+         IF (clobber) clobber_flag = 1
+         CALL write_dods (filename, slen, clobber_flag, swap_flag, 
+     .                    size,  workspace)
+
+        RETURN
+
+ 5010   status = 0
+        RETURN
+        END
diff --git a/fer/gnl/write_multi.F b/fer/gnl/write_multi.F
new file mode 100644
index 0000000..3ffa419
--- /dev/null
+++ b/fer/gnl/write_multi.F
@@ -0,0 +1,95 @@
+	SUBROUTINE WRITE_MULTI( lun, string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write multiple lines of the form line//CR//line... to unit lun
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200: 11/27/89
+* 	 2/20/90 - corrected string length bug for more-than 2 lines
+* V300: adapted for output to GUI displa
+* V314: 8/22/94 *kob* IBM port - need to use risc buff for char. concat 
+* V320: 2/28/95 - SPLIT_GUI_MESSAGE --> TM_SPLIT_MESSAGE
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+#ifdef NO_PASSED_CONCAT
+	include 'xrisc.cmn'
+#endif
+
+* calling argument declarations:
+	INTEGER		lun
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	LOGICAL 	multiline
+	INTEGER		TM_LENSTR1, cr_pos, c1, clast
+
+* initialize
+	c1 = 1
+	
+* multiple lines ?
+ 100	cr_pos = INDEX( string(c1:), pCR )
+	multiline = cr_pos .NE. 0
+
+* get last character of line
+	IF ( multiline ) THEN
+	   clast = c1 + cr_pos - 2
+	ELSE
+	   clast = (c1-1) + TM_LENSTR1( string(c1:) )		! mod 2/90
+	ENDIF
+
+* write one line
+#ifdef NO_PASSED_CONCAT
+	risc_buff = string(c1:clast)
+	CALL TM_SPLIT_MESSAGE(lun, '          '//risc_buff)
+#else
+	CALL TM_SPLIT_MESSAGE(lun, '          '//string(c1:clast))
+#endif
+
+* more ?
+	IF ( multiline ) THEN
+	   c1 = clast + 2
+	   GOTO 100
+	ENDIF
+
+* no. done
+	RETURN
+	END
diff --git a/fer/grdel/Makefile b/fer/grdel/Makefile
new file mode 100644
index 0000000..e2a88e1
--- /dev/null
+++ b/fer/grdel/Makefile
@@ -0,0 +1,41 @@
+#
+# Makefile for the graphics delegate library
+#
+
+include ../../site_specific.mk
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+LIBNAME = ../../lib/libgrdel.a
+CHDRS = $(wildcard *.h) ../cferbind/cferbind.h
+CSRCS = $(wildcard *.c)
+COBJS = $(CSRCS:.c=.o)
+FSRCS = $(wildcard *.F)
+FOBJS = $(FSRCS:.F=.o)
+
+.PHONY : all
+all : optimized
+
+.PHONY : optimized
+optimized :
+	$(MAKE) "CFLAGS = $(CFLAGS) -Wall -Werror -DNDEBUG -O" \
+		"FFLAGS = $(FFLAGS) -DNDEBUG -O" $(LIBNAME)
+
+.PHONY : debug
+debug :
+	$(MAKE) "CFLAGS = $(CFLAGS) -Wall -Werror -DVERBOSEDEBUG -O0 -g" \
+		"FFLAGS = $(FFLAGS) -O0 -g" $(LIBNAME)
+
+$(LIBNAME) : $(COBJS) $(FOBJS)
+	$(AR) $(ARFLAGS) $(LIBNAME) $(COBJS) $(FOBJS)
+	$(RANLIB) $(LIBNAME)
+
+$(COBJS) : $(CHDRS)
+
+.PHONY : clean
+clean :
+	rm -f *.o $(LIBNAME)
+
+#
+# End of Makefile
+#
+
diff --git a/fer/grdel/brush.c b/fer/grdel/brush.c
new file mode 100644
index 0000000..c70abba
--- /dev/null
+++ b/fer/grdel/brush.c
@@ -0,0 +1,300 @@
+/*
+ * Brush objects can only be used with the Window
+ * from which they were created.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+static const char *grdelbrushid = "GRDEL_BRUSH";
+
+typedef struct GDbrush_ {
+    const char *id;
+    grdelType window;
+    grdelType object;
+} GDBrush;
+
+
+/*
+ * Returns a Brush object.
+ *
+ * Arguments:
+ *     window: Window in which this brush is to be used
+ *     color: Color to use
+ *     style: fill style name (e.g., "solid", "cross")
+ *     stylelen: actual length of the style name
+ *
+ * Returns a pointer to the brush object created.  If an error occurs,
+ * NULL is returned and grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelBrush(grdelType window, grdelType color,
+                     const char *style, int stylelen)
+{
+    const BindObj *bindings;
+    grdelType *colorobj;
+    GDBrush   *brush;
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrush: window argument is not "
+                            "a grdel Window");
+        return NULL;
+    }
+    colorobj = grdelColorVerify(color, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrush: color argument is not "
+                            "a valid grdel Color for the window");
+        return NULL;
+    }
+
+    brush = (GDBrush *) PyMem_Malloc(sizeof(GDBrush));
+    if ( brush == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrush: out of memory for a new Brush");
+        return NULL;
+    }
+
+    brush->id = grdelbrushid;
+    brush->window = window;
+    if ( bindings->cferbind != NULL ) {
+        brush->object = bindings->cferbind->createBrush(bindings->cferbind,
+                                                  colorobj, style, stylelen);
+        if ( brush->object == NULL ) {
+            /* grdelerrmsg already assigned */
+            PyMem_Free(brush);
+            return NULL;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        brush->object = PyObject_CallMethod(bindings->pyobject, "createBrush",
+                                 "Os#", (PyObject *) colorobj, style, stylelen);
+        if ( brush->object == NULL ) {
+            sprintf(grdelerrmsg, "grdelBrush: error when calling the Python "
+                    "binding's createBrush method: %s", pyefcn_get_error());
+            PyMem_Free(brush);
+            return NULL;
+        }
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelBrush: unexpected error, "
+                            "no bindings associated with this Window");
+        PyMem_Free(brush);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelBrush created: "
+            "window = %p, color = %p, brush = %p\n",
+            window, color, brush);
+    fflush(debuglogfile);
+#endif
+
+    return brush;
+}
+
+/*
+ * Verifies brush is a grdel Brush.  If window is not NULL,
+ * also verifies brush can be used with this Window.
+ * Returns a pointer to the graphic engine's brush object
+ * if successful.  Returns NULL if there is a problem.
+ */
+grdelType grdelBrushVerify(grdelType brush, grdelType window)
+{
+    GDBrush *mybrush;
+
+    if ( brush == NULL )
+        return NULL;
+    mybrush = (GDBrush *) brush;
+    if ( mybrush->id != grdelbrushid )
+        return NULL;
+    if ( (window != NULL) && (mybrush->window != window) )
+        return NULL;
+    return mybrush->object;
+}
+
+/*
+ * Replace the color in the given brush object with that in
+ * the given color object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool grdelBrushReplaceColor(grdelType brush, grdelType color)
+{
+    const BindObj *bindings;
+    GDBrush   *mybrush;
+    grdelType *colorobj;
+    grdelBool  success;
+    PyObject  *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelBrushReplaceColor called: "
+            "brush = %p, color = %p\n", brush, color);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelBrushVerify(brush, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrushReplaceColor: brush argument is not "
+                            "a grdel Brush");
+        return 0;
+    }
+    mybrush = (GDBrush *) brush;
+
+    colorobj = grdelColorVerify(color, mybrush->window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrushReplaceColor: color argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mybrush->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->replaceBrushColor(bindings->cferbind,
+                                                  mybrush->object, colorobj);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        result = PyObject_CallMethod(bindings->pyobject, "replaceBrushColor",
+                                     "OO", (PyObject *) mybrush->object,
+                                           (PyObject *) colorobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelBrushDelete: error when calling the "
+                    "Python binding's replaceBrushColor method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelBrushReplaceColor: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    return success;
+}
+
+/*
+ * Delete a Brush created by grdelBrush
+ *
+ * Arguments:
+ *     brush: Brush to be deleted
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelBrushDelete(grdelType brush)
+{
+    const BindObj *bindings;
+    GDBrush  *mybrush;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelBrushDelete called: "
+            "brush = %p\n", brush);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelBrushVerify(brush, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelBrushDelete: brush argument is not "
+                            "a grdel Brush");
+        return 0;
+    }
+    mybrush = (GDBrush *) brush;
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mybrush->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->deleteBrush(bindings->cferbind,
+                                                  mybrush->object);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* "N" - steals the reference to this brush object */
+        result = PyObject_CallMethod(bindings->pyobject, "deleteBrush",
+                                     "N", (PyObject *) mybrush->object);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelBrushDelete: error when calling the "
+                    "Python binding's deleteBrush method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelBrushDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    /* regardless of success, free this Brush */
+    mybrush->id = NULL;
+    mybrush->window = NULL;
+    mybrush->object = NULL;
+    PyMem_Free(brush);
+
+    return success;
+}
+
+/*
+ * Creates a Brush object.
+ *
+ * Input Arguments:
+ *     window: Window in which this brush is to be used
+ *     color: Color to use
+ *     style: fill style name (e.g., "solid", "cross")
+ *     stylelen: actual length of the style name
+ * Output Arguments:
+ *     brush: the created brush object, or zero if failure.
+ *             Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdbrush_(void **brush, void **window, void **color,
+               char *style, int *stylelen)
+{
+    grdelType mybrush;
+
+    mybrush = grdelBrush(*window, *color, style, *stylelen);
+    *brush = mybrush;
+}
+
+/*
+ * Replace a color used in a brush
+ *
+ * Input Arguments:
+ *     brush: Brush to be modified
+ *     color: new Color to use in brush
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdbrushreplacecolor_(int *success, void **brush, void **color)
+{
+    grdelBool result;
+
+    result = grdelBrushReplaceColor(*brush, *color);
+    *success = result;
+}
+
+/*
+ * Deletes a Brush created by fgdbrush_
+ *
+ * Input Arguments:
+ *     brush: Brush to be deleted
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdbrushdel_(int *success, void **brush)
+{
+    grdelBool result;
+
+    result = grdelBrushDelete(*brush);
+    *success = result;
+}
+
diff --git a/fer/grdel/color.c b/fer/grdel/color.c
new file mode 100644
index 0000000..04e7242
--- /dev/null
+++ b/fer/grdel/color.c
@@ -0,0 +1,243 @@
+/*
+ * Color objects can only be used with the Window
+ * from which they were created.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+static const char *grdelcolorid = "GRDEL_COLOR";
+
+typedef struct GDColor_ {
+    const char *id;
+    grdelType window;
+    grdelType object;
+} GDColor;
+
+
+/*
+ * Returns a Color object from fractional [0.0, 1.0] intensities
+ * of the red, green, and blue channels.
+ *
+ * Arguments:
+ *     window: Window in which this color is to be used
+ *     redfrac: fractional [0.0, 1.0] red intensity
+ *     greenfrac: fractional [0.0, 1.0] green intensity
+ *     bluefrac: fractional [0.0, 1.0] blue intensity
+ *     opaquefrac: fractional [0.0, 1.0] opaqueness
+ *             (0.0 is transparent; 1.0 is opaque) of the color.
+ *             If the graphics engine does not support this
+ *             feature (alpha channel), this may be silently
+ *             ignored and the color be completely opaque.
+ *
+ * Returns a pointer to the color object created.  If an error occurs,
+ * NULL is returned and grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelColor(grdelType window, float redfrac, float greenfrac,
+                                       float bluefrac, float opaquefrac)
+{
+    const BindObj *bindings;
+    GDColor *color;
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "grdelColor: window argument is not "
+                            "a grdel Window");
+        return NULL;
+    }
+
+    if ( (0.0 > redfrac) || (redfrac > 1.0) ) {
+        strcpy(grdelerrmsg, "grdelColor: redfrac must be in [0.0, 1.0]");
+        return NULL;
+    }
+    if ( (0.0 > greenfrac) || (greenfrac > 1.0) ) {
+        strcpy(grdelerrmsg, "grdelColor: greenfrac must be in [0.0, 1.0]");
+        return NULL;
+    }
+    if ( (0.0 > bluefrac) || (bluefrac > 1.0) ) {
+        strcpy(grdelerrmsg, "grdelColor: bluefrac must be in [0.0, 1.0]");
+        return NULL;
+    }
+    if ( (0.0 > opaquefrac) || (opaquefrac > 1.0) ) {
+        strcpy(grdelerrmsg, "grdelColor: opaquefrac must be in [0.0, 1.0]");
+        return NULL;
+    }
+
+    color = (GDColor *) PyMem_Malloc(sizeof(GDColor));
+    if ( color == NULL ) {
+        strcpy(grdelerrmsg, "grdelColor: out of memory for a new Color");
+        return NULL;
+    }
+
+    color->id = grdelcolorid;
+    color->window = window;
+    if ( bindings->cferbind != NULL ) {
+        color->object = bindings->cferbind->createColor(bindings->cferbind,
+                                  (double) redfrac, (double) greenfrac,
+                                  (double) bluefrac, (double) opaquefrac);
+        if ( color->object == NULL ) {
+            /* grdelerrmsg already assigned */
+            PyMem_Free(color);
+            return NULL;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        color->object = PyObject_CallMethod(bindings->pyobject, "createColor",
+                                 "dddd", (double) redfrac, (double) greenfrac,
+                                 (double) bluefrac, (double) opaquefrac);
+        if ( color->object == NULL ) {
+            sprintf(grdelerrmsg, "grdelColor: error when calling the Python "
+                    "binding's createColor method: %s", pyefcn_get_error());
+            PyMem_Free(color);
+            return NULL;
+        }
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelColor: unexpected error, "
+                            "no bindings associated with this Window");
+        PyMem_Free(color);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelColor created: "
+            "window = %p, rgba = (%f,%f,%f,%f), color = %p\n",
+            window, redfrac, greenfrac, bluefrac, opaquefrac, color);
+    fflush(debuglogfile);
+#endif
+
+    return color;
+}
+
+/*
+ * Verifies color is a grdel Color.  If window is not NULL,
+ * also verifies color can be used with this Window.
+ * Returns a pointer to the graphic engine's color object
+ * if successful.  Returns NULL if there is a problem.
+ */
+grdelType grdelColorVerify(grdelType color, grdelType window)
+{
+    GDColor *mycolor;
+
+    if ( color == NULL )
+        return NULL;
+    mycolor = (GDColor *) color;
+    if ( mycolor->id != grdelcolorid )
+        return NULL;
+    if ( (window != NULL) && (mycolor->window != window) )
+        return NULL;
+    return mycolor->object;
+}
+
+/*
+ * Delete a Color created by grdelColor
+ *
+ * Arguments:
+ *     color: Color to be deleted
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelColorDelete(grdelType color)
+{
+    const BindObj *bindings;
+    GDColor  *mycolor;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelColorDelete called: "
+            "color = %p\n", color);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelColorVerify(color, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelColorDelete: color argument is not "
+                            "a grdel Color");
+        return 0;
+    }
+    mycolor = (GDColor *) color;
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mycolor->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->deleteColor(bindings->cferbind,
+                                                  mycolor->object);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* "N" - steals the reference to this color object */
+        result = PyObject_CallMethod(bindings->pyobject, "deleteColor",
+                                     "N", (PyObject *) mycolor->object);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelColorDelete: error when calling the "
+                    "Python binding's deleteColor method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelColorDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    /* regardless of success, free this Color */
+    mycolor->id = NULL;
+    mycolor->window = NULL;
+    mycolor->object = NULL;
+    PyMem_Free(color);
+
+    return success;
+}
+
+/*
+ * Creates a Color object from fractional [0.0, 1.0] intensities
+ * of the red, green, and blue channels.
+ *
+ * Input Arguments:
+ *     window: Window in which this color is to be used
+ *     redfrac: fractional [0.0, 1.0] red intensity
+ *     greenfrac: fractional [0.0, 1.0] green intensity
+ *     bluefrac: fractional [0.0, 1.0] blue intensity
+ *     opaquefrac: fractional [0.0, 1.0] opaqueness
+ *             (0.0 is transparent; 1.0 is opaque) of the color.
+ *             If the graphics engine does not support this
+ *             feature (alpha channel), this may be silently
+ *             ignored and the color be completely opaque.
+ * Output Arguments:
+ *     color: the created color object, or zero if failure.
+ *             Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdcolor_(void **color, void **window, float *redfrac,
+               float *greenfrac, float *bluefrac, float *opaquefrac)
+{
+    grdelType mycolor;
+
+    mycolor = grdelColor(*window, *redfrac, *greenfrac,
+                         *bluefrac, *opaquefrac);
+    *color = mycolor;
+}
+
+/*
+ * Deletes a Color created by fgdcolor_
+ *
+ * Input Arguments:
+ *     color: Color to be deleted
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdcolordel_(int *success, void **color)
+{
+    grdelBool result;
+
+    result = grdelColorDelete(*color);
+    *success = result;
+}
+
diff --git a/fer/grdel/draw.c b/fer/grdel/draw.c
new file mode 100644
index 0000000..8eeaf8d
--- /dev/null
+++ b/fer/grdel/draw.c
@@ -0,0 +1,847 @@
+/*
+ * Drawing commands
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+/*
+ * Assigns the transformation values my, sx, sy, dx, and dy used
+ * to convert user coordinate (userx, usery) to device coordinate
+ * (devx, devy) using the formulae:
+ *    devx = userx * sx + dx
+ *    devy = (my - usery) * sy + dy
+ */
+static void getTransformValues(double *my, double *sx, double *sy,
+                               double *dx, double *dy)
+{
+   float lftfrc, rgtfrc, btmfrc, topfrc;
+   float lftcrd, rgtcrd, btmcrd, topcrd;
+   float winwidth, winheight;
+   double devlft, devtop, devwidth, devheight;
+   double usrlft, usrtop, usrwidth, usrheight;
+
+   fgd_get_view_limits_(&lftfrc, &rgtfrc, &btmfrc, &topfrc,
+                        &lftcrd, &rgtcrd, &btmcrd, &topcrd);
+   fgd_get_window_size_(&winwidth, &winheight);
+
+   devlft     = (double) lftfrc * (double) winwidth;
+   devwidth   = (double) rgtfrc * (double) winwidth;
+   devwidth  -= devlft;
+   devtop     = (1.0 - (double) topfrc) * (double) winheight;
+   devheight  = (1.0 - (double) btmfrc) * (double) winheight;
+   devheight -= devtop;
+
+   usrlft = (double) lftcrd;
+   usrwidth = (double) rgtcrd - usrlft;
+   usrtop = 0.0;
+   usrheight = (double) topcrd - (double) btmcrd;
+
+   *my = (double) topcrd;
+   *sx = devwidth / usrwidth;
+   *sy = devheight / usrheight;
+   *dx = devlft - (*sx) * usrlft;
+   *dy = devtop - (*sy) * usrtop;
+}
+
+/*
+ * Draws connected line segments.
+ *
+ * Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the endpoint
+ *     ptsy: user Y-coordinates of the endpoints
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     pen: Pen to use to draw the line segments
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelDrawMultiline(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType pen)
+{
+    const BindObj *bindings;
+    grdelType penobj;
+    double   *xvals;
+    double   *yvals;
+    grdelBool success;
+    PyObject *xtuple;
+    PyObject *ytuple;
+    PyObject *fltobj;
+    PyObject *result;
+    double my, sx, sy, dx, dy;
+    double transval;
+    int k;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelDrawMultiline called: "
+            "window = %p, pen = %p\n", window, pen);
+    fflush(debuglogfile);
+#endif
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL  ) {
+        strcpy(grdelerrmsg, "grdelDrawMultiline: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    penobj = grdelPenVerify(pen, window);
+    if ( penobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelDrawMultiline: pen argument is not "
+                            "a valid grdel Pen for the window");
+        return 0;
+    }
+    if ( numpts <= 1 ) {
+        strcpy(grdelerrmsg, "grdelDrawMultiline: invalid number of points");
+        return 0;
+    }
+
+    /* Get the transform values for converting user to device coordinates */
+    getTransformValues(&my, &sx, &sy, &dx, &dy);
+
+    if ( bindings->cferbind != NULL ) {
+        xvals = (double *) PyMem_Malloc(2 * numpts * sizeof(double));
+        if ( xvals == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawMultiline: out of memory "
+                                 "for an array of %d doubles", 2 * numpts);
+            return 0;
+        }
+        yvals = &(xvals[numpts]);
+        for (k = 0; k < numpts; k++)
+            xvals[k] = (double) (ptsx[k]) * sx + dx;
+        for (k = 0; k < numpts; k++)
+            yvals[k] = (my - (double) (ptsy[k])) * sy + dy;
+        success = bindings->cferbind->drawMultiline(bindings->cferbind,
+                                      xvals, yvals, numpts, penobj);
+        PyMem_Free(xvals);
+        if ( ! success ) {
+            /* grdelerrmsg is already assigned */
+            return 0;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        xtuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( xtuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawMultiline: problems creating "
+                                "a Python tuple");
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (double) (ptsx[k]) * sx + dx;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawMultiline: problems creating "
+                                    "a Python float");
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(xtuple, (Py_ssize_t) k, fltobj);
+        }
+
+        ytuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( ytuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawMultiline: problems creating "
+                                "a Python tuple");
+            Py_DECREF(xtuple);
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (my - (double) (ptsy[k])) * sy + dy;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawMultiline: problems creating "
+                                    "a Python float");
+                Py_DECREF(ytuple);
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(ytuple, (Py_ssize_t) k, fltobj);
+        }
+
+        /*
+         * Call the drawMultiline method of the bindings instance.
+         * Using 'N' to steal the reference to xtuple and to ytuple.
+         */
+        result = PyObject_CallMethod(bindings->pyobject, "drawMultiline",
+                          "NNO", xtuple, ytuple, (PyObject *) penobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawMultiline: error when calling the Python "
+                    "binding's drawMultiline method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdeldrawMultiline: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Draws discrete points.
+ *
+ * Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the points
+ *     ptsy: user Y-coordinates of the points
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     symbol: Symbol to use to draw a point
+ *     color: color of the Symbol
+ *     ptsize: size of the symbol (scales with view size)
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelDrawPoints(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType symbol,
+               grdelType color, float ptsize)
+{
+    const BindObj *bindings;
+    grdelType symbolobj;
+    grdelType colorobj;
+    double   *xvals;
+    double   *yvals;
+    grdelBool success;
+    PyObject *xtuple;
+    PyObject *ytuple;
+    PyObject *fltobj;
+    PyObject *result;
+    double my, sx, sy, dx, dy;
+    double transval;
+    int k;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelDrawPoints called: "
+            "window = %p, symbol = %p, color = %p", window, symbol, color);
+    fflush(debuglogfile);
+#endif
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL  ) {
+        strcpy(grdelerrmsg, "grdelDrawPoints: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    symbolobj = grdelSymbolVerify(symbol, window);
+    if ( symbolobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelDrawPoints: symbol argument is not "
+                            "a valid grdel Symbol for the window");
+        return 0;
+    }
+    colorobj = grdelColorVerify(color, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelDrawPoints: color argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+    if ( numpts <= 0 ) {
+        strcpy(grdelerrmsg, "grdelDrawPoints: invalid number of points");
+        return 0;
+    }
+
+    /* Get the transform values for converting user to device coordinates */
+    getTransformValues(&my, &sx, &sy, &dx, &dy);
+
+    if ( bindings->cferbind != NULL ) {
+        xvals = (double *) PyMem_Malloc(2 * numpts * sizeof(double));
+        if ( xvals == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawPoints: out of memory "
+                                 "for an array of %d doubles", 2 * numpts);
+            return 0;
+        }
+        yvals = &(xvals[numpts]);
+        for (k = 0; k < numpts; k++)
+            xvals[k] = (double) (ptsx[k]) * sx + dx;
+        for (k = 0; k < numpts; k++)
+            yvals[k] = (my - (double) (ptsy[k])) * sy + dy;
+        success = bindings->cferbind->drawPoints(bindings->cferbind,
+                                      xvals, yvals, numpts, symbolobj,
+                                      colorobj, (double) ptsize);
+        PyMem_Free(xvals);
+        if ( ! success ) {
+            /* grdelerrmsg is already assigned */
+            return 0;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        xtuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( xtuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawPoints: problems creating "
+                                "a Python tuple");
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (double) (ptsx[k]) * sx + dx;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawPoints: problems creating "
+                                    "a Python float");
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(xtuple, (Py_ssize_t) k, fltobj);
+        }
+
+        ytuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( ytuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawPoints: problems creating "
+                                "a Python tuple");
+            Py_DECREF(xtuple);
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (my - (double) (ptsy[k])) * sy + dy;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawPoints: problems creating "
+                                    "a Python float");
+                Py_DECREF(ytuple);
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(ytuple, (Py_ssize_t) k, fltobj);
+        }
+
+        /*
+         * Call the drawPoints method of the bindings instance.
+         * Using 'N' to steal the reference to xtuple and to ytuple.
+         */
+        result = PyObject_CallMethod(bindings->pyobject, "drawPoints",
+                          "NNOOd", xtuple, ytuple, (PyObject *) symbolobj,
+                          (PyObject *) colorobj, (double) ptsize);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawPoints: error when calling the Python "
+                    "binding's drawPoints method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdeldrawPoints: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Draws a polygon.
+ *
+ * Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the vertices
+ *     ptsy: user Y-coordinates of the vertices
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     brush: Brush to use to fill the polygon; if NULL,
+ *             the polygon will not be filled
+ *     pen: Pen to use to outline the polygon; if NULL
+ *             the polygon will not be outlined
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelDrawPolygon(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType brush,
+               grdelType pen)
+{
+    const BindObj *bindings;
+    grdelType brushobj;
+    grdelType penobj;
+    double   *xvals;
+    double   *yvals;
+    grdelBool success;
+    PyObject *xtuple;
+    PyObject *ytuple;
+    PyObject *fltobj;
+    PyObject *result;
+    double my, sx, sy, dx, dy;
+    double transval;
+    int k;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelDrawPolygon called: "
+            "window = %p, brush = %p, pen = %p\n", window, brush, pen);
+    fflush(debuglogfile);
+#endif
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL  ) {
+        strcpy(grdelerrmsg, "grdelDrawPolygon: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    if ( (brush == NULL) && (pen == NULL) ) {
+        strcpy(grdelerrmsg, "grdelDrawPolygon: neither a pen nor "
+                            "a brush was specified");
+        return 0;
+    }
+    if ( brush != NULL ) {
+        brushobj = grdelBrushVerify(brush, window);
+        if ( brushobj == NULL ) {
+            strcpy(grdelerrmsg, "grdelDrawPolygon: brush argument is not "
+                                "a valid grdel Brush for the window");
+            return 0;
+        }
+    }
+    else
+        brushobj = NULL;
+    if ( pen != NULL ) {
+        penobj = grdelPenVerify(pen, window);
+        if ( penobj == NULL ) {
+            strcpy(grdelerrmsg, "grdelDrawPolygon: pen argument is not "
+                                "a valid grdel Pen for the window");
+            return 0;
+        }
+    }
+    else
+        penobj = NULL;
+    if ( numpts <= 2 ) {
+        strcpy(grdelerrmsg, "grdelDrawPolygon: invalid number of points");
+        return (grdelBool) 0;
+    }
+
+    /* Get the transform values for converting user to device coordinates */
+    getTransformValues(&my, &sx, &sy, &dx, &dy);
+
+    if ( bindings->cferbind != NULL ) {
+        xvals = (double *) PyMem_Malloc(2 * numpts * sizeof(double));
+        if ( xvals == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawPolygon: out of memory "
+                                 "for an array of %d doubles", 2 * numpts);
+            return 0;
+        }
+        yvals = &(xvals[numpts]);
+        for (k = 0; k < numpts; k++)
+            xvals[k] = (double) (ptsx[k]) * sx + dx;
+        for (k = 0; k < numpts; k++)
+            yvals[k] = (my - (double) (ptsy[k])) * sy + dy;
+        success = bindings->cferbind->drawPolygon(bindings->cferbind,
+                                      xvals, yvals, numpts, brushobj, penobj);
+        PyMem_Free(xvals);
+        if ( ! success ) {
+            /* grdelerrmsg is already assigned */
+            return 0;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        xtuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( xtuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawPolygon: problems creating "
+                                "a Python tuple");
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (double) (ptsx[k]) * sx + dx;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawPolygon: problems creating "
+                                    "a Python float");
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(xtuple, (Py_ssize_t) k, fltobj);
+        }
+
+        ytuple = PyTuple_New( (Py_ssize_t) numpts );
+        if ( ytuple == NULL ) {
+            PyErr_Clear();
+            strcpy(grdelerrmsg, "grdelDrawPolygon: problems creating "
+                                "a Python tuple");
+            Py_DECREF(xtuple);
+            return 0;
+        }
+        for (k = 0; k < numpts; k++) {
+            transval = (my - (double) (ptsy[k])) * sy + dy;
+            fltobj = PyFloat_FromDouble(transval);
+            if ( fltobj == NULL ) {
+                PyErr_Clear();
+                strcpy(grdelerrmsg, "grdelDrawPolygon: problems creating "
+                                    "a Python float");
+                Py_DECREF(ytuple);
+                Py_DECREF(xtuple);
+                return 0;
+            }
+            /* PyTuple_SET_ITEM steals the reference to fltobj */
+            PyTuple_SET_ITEM(ytuple, (Py_ssize_t) k, fltobj);
+        }
+
+        if ( brushobj == NULL )
+            brushobj = Py_None;
+        if ( penobj == NULL )
+            penobj = Py_None;
+        /*
+         * Call the drawPolygon method of the bindings instance.
+         * Using 'N' to steal the reference to xtuple and to ytuple.
+         */
+        result = PyObject_CallMethod(bindings->pyobject, "drawPolygon",
+                          "NNOO", xtuple, ytuple, 
+                          (PyObject *) brushobj, (PyObject *) penobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawPolygon: error when calling the Python "
+                    "binding's drawPolygon method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdeldrawPolygon: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Draws a rectangle.
+ *
+ * Arguments:
+ *     window: Window with an active View to draw in
+ *     left: user X-coordinate of the left edge
+ *     bottom: user Y-coordinate of the bottom edge
+ *     right: user X-coordinate of the right edge
+ *     top: user Y-coordinate of the top edge
+ *     brush: Brush to use to fill the rectangle; if NULL,
+ *             the rectangle will not be filled
+ *     pen: Pen to use to outline the rectangle; if NULL
+ *             the rectangle will not be outlined
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelDrawRectangle(grdelType window, float left, float bottom,
+               float right, float top, grdelType brush, grdelType pen)
+{
+    const BindObj *bindings;
+    grdelType brushobj;
+    grdelType penobj;
+    grdelBool success;
+    PyObject *result;
+    double my, sx, sy, dx, dy;
+    double trlft, trbtm, trrgt, trtop;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelDrawRectangle called: "
+            "window = %p, brush = %p, pen = %p\n", window, brush, pen);
+    fflush(debuglogfile);
+#endif
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL  ) {
+        strcpy(grdelerrmsg, "grdelDrawRectangle: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    if ( (brush == NULL) && (pen == NULL) ) {
+        strcpy(grdelerrmsg, "grdelDrawRectangle: neither a pen nor "
+                            "a brush was specified");
+        return (grdelBool) 0;
+    }
+    if ( brush != NULL ) {
+        brushobj = grdelBrushVerify(brush, window);
+        if ( brushobj == NULL ) {
+            strcpy(grdelerrmsg, "grdelDrawRectangle: brush argument is not "
+                                "a valid grdel Brush for the window");
+            return (grdelBool) 0;
+        }
+    }
+    else
+        brushobj = NULL;
+    if ( pen != NULL ) {
+        penobj = grdelPenVerify(pen, window);
+        if ( penobj == NULL ) {
+            strcpy(grdelerrmsg, "grdelDrawRectangle: pen argument is not "
+                                "a valid grdel Pen for the window");
+            return (grdelBool) 0;
+        }
+    }
+    else
+        penobj = NULL;
+
+    /* Get the transform values for converting user to device coordinates */
+    getTransformValues(&my, &sx, &sy, &dx, &dy);
+    trlft = (double) left * sx + dx;
+    trrgt = (double) right * sx + dx;
+    trtop = (my - (double) top) * sy + dy;
+    trbtm = (my - (double) bottom) * sy + dy;
+
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->drawRectangle(bindings->cferbind,
+                                      trlft, trbtm, trrgt, trtop,
+                                      brushobj, penobj);
+        if ( ! success ) {
+            /* grdelerrmsg is already assigned */
+            return 0;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        if ( brushobj == NULL )
+            brushobj = Py_None;
+        if ( penobj == NULL )
+            penobj = Py_None;
+        /*
+         * Call the drawRectangle method of the bindings instance.
+         */
+        result = PyObject_CallMethod(bindings->pyobject, "drawRectangle",
+                          "ddddOO", trlft, trbtm, trrgt, trtop,
+                          (PyObject *) brushobj, (PyObject *) penobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawRectangle: error when calling the Python "
+                    "binding's drawRectangle method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdeldrawRectangle: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Draws text.
+ *
+ * Arguments:
+ *     window: Window with an active View to draw in
+ *     text: text string to draw
+ *     textlen: actual length of the text string
+ *     startx: user X-coordinate of the beginning
+ *              of the text baseline
+ *     starty: user Y-coordinate of the beginning 
+ *              of the text baseline
+ *     font: font to use
+ *     color: color to use (as a solid brush or pen)
+ *     rotate: angle of the text baseline in degrees
+ *              clockwise from horizontal
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelDrawText(grdelType window, const char *text, int textlen,
+               float startx, float starty, grdelType font, grdelType color,
+               float rotate)
+{
+    const BindObj *bindings;
+    grdelType fontobj;
+    grdelType colorobj;
+    grdelBool success;
+    PyObject *result;
+    double my, sx, sy, dx, dy;
+    double trstx, trsty;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelDrawText called: "
+            "window = %p, font = %p, color = %p\n", window, font, color);
+    fflush(debuglogfile);
+#endif
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL  ) {
+        strcpy(grdelerrmsg, "grdelDrawText: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    fontobj = grdelFontVerify(font, window);
+    if ( fontobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelDrawText: font argument is not "
+                            "a valid grdel Font for the window");
+        return 0;
+    }
+    colorobj = grdelColorVerify(color, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelDrawText: color argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+
+    /* Get the transform values for converting user to device coordinates */
+    getTransformValues(&my, &sx, &sy, &dx, &dy);
+    trstx = (double) startx * sx + dx;
+    trsty = (my - (double) starty) * sy + dy;
+
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->drawText(bindings->cferbind,
+                                      text, textlen, trstx, trsty,
+                                      fontobj, colorobj, (double) rotate);
+        if ( ! success ) {
+            /* grdelerrmsg is already assigned */
+            return 0;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* Call the drawText method of the bindings instance. */
+        result = PyObject_CallMethod(bindings->pyobject, "drawText",
+                          "s#ddOOd", text, textlen, trstx, trsty,
+                          (PyObject *) fontobj, (PyObject *) colorobj,
+                          (double) rotate);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelDrawText: Error when calling the Python "
+                    "binding's drawText method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdeldrawText: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Draws connected line segments.
+ *
+ * Input Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the endpoints
+ *     ptsy: user Y-coordinates of the endpoints
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     pen: Pen to use to draw the line segments
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgddrawmultiline_(int *success, void **window, float ptsx[],
+               float ptsy[], int *numpts, void **pen)
+{
+    grdelBool result;
+
+    result = grdelDrawMultiline(*window, ptsx, ptsy, *numpts, *pen);
+    *success = result;
+}
+
+/*
+ * Draws discrete points.
+ *
+ * Input Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the points
+ *     ptsy: user Y-coordinates of the points
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     symbol: Symbol to use to draw a point
+ *     color: color of the Symbol
+ *     ptsize: size of the symbol (scales with view size)
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgddrawpoints_(int *success, void **window, float ptsx[],
+                    float ptsy[], int *numpts, void **symbol,
+                    void **color, float *ptsize)
+{
+    grdelBool result;
+
+    result = grdelDrawPoints(*window, ptsx, ptsy, *numpts, *symbol,
+                             *color, *ptsize);
+    *success = result;
+}
+
+/*
+ * Draws a polygon.
+ *
+ * Input Arguments:
+ *     window: Window with an active View to draw in
+ *     ptsx: user X-coordinates of the vertices
+ *     ptsy: user Y-coordinates of the vertices 
+ *     numpts: number of coordinates in ptsx and ptsy to use
+ *     brush: Brush to use to fill the polygon; if NULL,
+ *             the polygon will not be filled
+ *     pen: Pen to use to outline the polygon; if NULL
+ *             the polygon will not be outlined
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgddrawpolygon_(int *success, void **window, float ptsx[],
+                     float ptsy[], int *numpts, void **brush, void **pen)
+{
+    grdelBool result;
+
+    result = grdelDrawPolygon(*window, ptsx, ptsy, *numpts, *brush, *pen);
+    *success = result;
+}
+
+/*
+ * Draws a rectangle.
+ *
+ * Input Arguments:
+ *     window: Window with an active View to draw in
+ *     left: user X-coordinate of the left edge 
+ *     bottom: user Y-coordinate of the bottom edge 
+ *     right: user X-coordinate of the right edge 
+ *     top: user Y-coordinate of the top edge 
+ *     brush: Brush to use to fill the rectangle; if NULL,
+ *             the rectangle will not be filled
+ *     pen: Pen to use to outline the rectangle; if NULL
+ *             the rectangle will not be outlined
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgddrawrect_(int *success, void **window, float *left, float *bottom,
+                  float *right, float *top, void **brush, void **pen)
+{
+    grdelBool result;
+
+    result = grdelDrawRectangle(*window, *left, *bottom, *right, *top,
+                                *brush, *pen);
+    *success = result;
+}
+
+/*
+ * Draws text.
+ *
+ * Input Arguments:
+ *     window: the Window with an active View to draw in
+ *     text: text string to draw
+ *     textlen: actual length of the text string
+ *     startx: user X-coordinate of the beginning baseline
+ *              of the text 
+ *     starty: user Y-coordinate of the beginning baseline
+ *              of the text 
+ *     font: font to use 
+ *     color: color to use (as a solid brush or pen)
+ *     rotate: angle of the baseline in degrees
+ *              clockwise from horizontal
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgddrawtext_(int *success, void **window, char *text, int *textlen,
+                  float *startx, float *starty, void **font, void **color,
+                  float *rotate)
+{
+    grdelBool result;
+
+    result = grdelDrawText(*window, text, *textlen, *startx, *starty,
+                           *font, *color, *rotate);
+    *success = result;
+}
+
diff --git a/fer/grdel/dup_color_set_opacity.F b/fer/grdel/dup_color_set_opacity.F
new file mode 100644
index 0000000..72b4034
--- /dev/null
+++ b/fer/grdel/dup_color_set_opacity.F
@@ -0,0 +1,75 @@
+      SUBROUTINE DUP_COLOR_SET_OPACITY(windowid, icolor, opacity_frac)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*  For the active window, uses the RGB part of the given color ID and 
+*  the opacity fraction to create a new temporary color.  The ID of 
+*  this new color is returned in icolor.  Calls STOP if any problems.
+
+        INCLUDE 'fgrdel.cmn'
+
+* calling argument declarations:
+        INTEGER windowid, icolor
+        REAL*4 opacity_frac
+
+* local argument declarations:
+        INTEGER ier
+        REAL*4 redfrac, grnfrac, bluefrac, opaqfrac
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'DUP_COLOR_SET_OPACITY: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'DUP_COLOR_SET_OPACITY: null windowobj'
+        ENDIF
+        IF ( (opacity_frac .LT. 0.0) .OR. (opacity_frac .GT. 1.0) )
+     .     STOP 'Invalid opacity_frac passed to DUP_COLOR_SET_OPACITY'
+
+*       Get the color fractions for the given color
+        CALL FGD_GQCR(windowid, icolor, ier, 
+     .                redfrac, grnfrac, bluefrac, opaqfrac)
+        IF ( ier .NE. 0 )
+     .     STOP 'Invalid icolor passed to DUP_COLOR_SET_OPACITY'
+
+*       Create a new temporary color with the new opacity
+        opaqfrac = opacity_frac
+        CALL FGD_CREATE_TEMP_COLOR(windowid, icolor, 
+     .                  redfrac, grnfrac, bluefrac, opaqfrac)
+
+        RETURN
+
+        END
+
diff --git a/fer/grdel/dup_std_pen_set_opacity.F b/fer/grdel/dup_std_pen_set_opacity.F
new file mode 100644
index 0000000..0c7f509
--- /dev/null
+++ b/fer/grdel/dup_std_pen_set_opacity.F
@@ -0,0 +1,96 @@
+      SUBROUTINE DUP_STD_PEN_SET_OPACITY(windowid, ipen, opacity_frac)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*  For the active window, uses the RGB and thickness part of the given 
+*  standard pen and the given opacity fraction to create a new temporary 
+*  pen.  The ID of this new pen is returned in ipen.  Calls STOP if any 
+*  problems arise.
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+* calling argument declarations:
+        INTEGER windowid, ipen
+        REAL*4 opacity_frac
+
+* local argument declarations:
+        INTEGER ncolors, icolor, ier
+        REAL*4 dfltthick, redfrac, grnfrac, bluefrac, opaqfrac
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'DUP_STD_PEN_SET_OPACITY: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'DUP_STD_PEN_SET_OPACITY: null windowobj'
+        ENDIF
+        ncolors = mode_arg(pmode_linecolors,1)
+        IF ( (ipen .LT. 1) .OR. (ipen .GT. 3*ncolors) )
+     .     STOP 'Invalid ipen passed to DUP_STD_PEN_SET_OPACITY'
+        IF ( (opacity_frac .LT. 0.0) .OR. (opacity_frac .GT. 1.0) )
+     .     STOP 'Invalid opacity_frac passed to DUP_STD_PEN_SET_OPACITY'
+
+*       Get the color and thickness of the given standard pen
+        IF ( ipen .LE. ncolors ) THEN
+           icolor = ipen
+           dfltthick = 1.0
+        ELSE IF ( ipen .LE. 2*ncolors ) THEN
+           icolor = ipen - ncolors
+           dfltthick = 2.0
+        ELSE
+           icolor = ipen - 2*ncolors
+           dfltthick = 3.0
+        ENDIF
+
+*       Get the RGB for the color of the pen
+        CALL FGD_GQCR(windowid, icolor, ier, 
+     .                redfrac, grnfrac, bluefrac, opaqfrac)
+        IF ( ier .NE. 0 )
+     .     STOP 'Invalid icolor from ipen in DUP_STD_PEN_SET_OPACITY'
+
+*       Create a new temporary color with the new opacity
+        opaqfrac = opacity_frac
+        CALL FGD_CREATE_TEMP_COLOR(windowid, icolor, 
+     .                  redfrac, grnfrac, bluefrac, opaqfrac)
+
+*       Create a new temporary pen with the new temporary color
+        CALL FGD_CREATE_TEMP_PEN(windowid, ipen, icolor, dfltthick)
+
+        RETURN
+
+        END
+
diff --git a/fer/grdel/fgd_consider_update.F b/fer/grdel/fgd_consider_update.F
new file mode 100644
index 0000000..63e7412
--- /dev/null
+++ b/fer/grdel/fgd_consider_update.F
@@ -0,0 +1,49 @@
+*
+* Consider updating the active Window.  If something has
+* been drawn to the active window since the last update,
+* and if the program is at the base command level (not in
+* a script), then issue an FGD_GUWK command on the active
+* window.
+*
+* If the argument atapause is .TRUE., update irregardless
+* of the command level (ie, waiting at a pause in a script).
+*
+
+        SUBROUTINE FGD_CONSIDER_UPDATE(atapause)
+
+        IMPLICIT NONE
+        LOGICAL atapause
+
+        INCLUDE 'xcontrol.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+*       Return if nothing has been drawn to the active window
+*       since the last update (fastest check first)
+        IF ( .NOT. somethingdrawn ) THEN
+            RETURN
+        ENDIF
+
+*       Return if not at a pause and not at the base command level
+*
+*       DO NOT RETURN - causes problems if in a script which 
+*       contains frame/file=... to save the image.
+*
+*       IF ( (.NOT. atapause) .AND. (csp .GT. 0) ) THEN
+*           RETURN
+*       ENDIF
+
+*       Return if there is not a valid active window
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            RETURN
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            RETURN
+        ENDIF
+
+*       Update the display
+        CALL FGD_GUWK(activewindow)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_create_temp_color.F b/fer/grdel/fgd_create_temp_color.F
new file mode 100644
index 0000000..b85f073
--- /dev/null
+++ b/fer/grdel/fgd_create_temp_color.F
@@ -0,0 +1,42 @@
+*
+* Create a temporary color object for the default window
+*
+
+        SUBROUTINE FGD_CREATE_TEMP_COLOR(windowid, icolor, 
+     .                 redfrac, greenfrac, bluefrac, opaquefrac)
+
+        IMPLICIT NONE
+
+        INTEGER windowid, icolor
+        REAL*4 redfrac, greenfrac, bluefrac, opaquefrac
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: null windowobj'
+        ENDIF
+        IF ( (redfrac .LT. 0.0) .OR.  (redfrac .GT. 1.0) ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: Invalid redfrac'
+        ENDIF
+        IF ( (greenfrac .LT. 0.0) .OR.  (greenfrac .GT. 1.0) ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: Invalid greenfrac'
+        ENDIF
+        IF ( (bluefrac .LT. 0.0) .OR.  (bluefrac .GT. 1.0) ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: Invalid bluefrac'
+        ENDIF
+        IF ( (opaquefrac .LT. 0.0) .OR.  (opaquefrac .GT. 1.0) ) THEN
+            STOP 'FGD_CREATE_TEMP_COLOR: Invalid opaquefrac'
+        ENDIF
+
+        icolor = maxcolorobjs - 1
+        CALL FGD_GSCR(windowid, icolor,
+     .                redfrac, greenfrac, bluefrac, opaquefrac)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_create_temp_pen.F b/fer/grdel/fgd_create_temp_pen.F
new file mode 100644
index 0000000..f11a8e5
--- /dev/null
+++ b/fer/grdel/fgd_create_temp_pen.F
@@ -0,0 +1,43 @@
+*
+* Create a temporary pen and symbol object (dot) 
+* for the default window using the given color
+*
+
+        SUBROUTINE FGD_CREATE_TEMP_PEN(windowid, 
+     .                        ipen, icolor, thickness)
+
+        IMPLICIT NONE
+
+        INTEGER windowid, ipen, icolor
+        REAL*4 thickness
+        REAL*4 dotsize
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_CREATE_TEMP_PEN: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_CREATE_TEMP_PEN: null windowobj'
+        ENDIF
+        IF ( (icolor .LT. 0) .OR.
+     .       (icolor .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_CREATE_TEMP_PEN: Invalid icolor'
+        ENDIF
+        IF ( colorobjs(icolor+1, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_CREATE_TEMP_PEN: null colorobj for icolor'
+        ENDIF
+
+        ipen = maxpenobjs
+*       linestyle = 1 is a solid line
+        CALL FGD_GSPLR(windowid, ipen, 1, thickness, icolor)
+*       also make a temporary symbol object (dot) at the same array index;
+*       code in ferret expects this
+        dotsize = 6.0 + thickness
+        CALL FGD_GSPMR(windowid, ipen, 1, dotsize, icolor)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_engine_match.F b/fer/grdel/fgd_engine_match.F
new file mode 100644
index 0000000..f0ed21b
--- /dev/null
+++ b/fer/grdel/fgd_engine_match.F
@@ -0,0 +1,72 @@
+*
+* Compare the graphics engine name given to that used
+* for indicated window.
+*
+* Input Arguments:
+*     windowid - window number to use
+*     engname - name (or partial name) of the engine;
+*               standard recognized names are Cairo, 
+*               PipedViewerPQ, or PipedImager 
+* Returns
+*     .TRUE. if the window uses the indicated engine; 
+*     otherwise .FALSE.
+*
+        LOGICAL FUNCTION FGD_ENGINE_MATCH(windowid, engname)
+
+        IMPLICIT NONE
+        CHARACTER*(*) engname
+        INTEGER windowid
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'fgrdel.cmn'
+
+*       Function declarations
+        INTEGER TM_LENSTR
+
+*       Local variables
+        INTEGER slen, idx
+
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_ENGINE_MATCH: Invalid windowid value'
+        ENDIF
+
+* Get the actual string length of given engine name
+        slen = TM_LENSTR(engname)
+
+* An empty engine name uses the default engine
+        IF ( slen .EQ. 0 ) THEN
+            FGD_ENGINE_MATCH = 
+     .          enginename(windowid) .EQ. defaultenginename
+            RETURN
+        ENDIF
+
+* INDEX is used to match incomplete new engine names
+        idx = INDEX('Cairo', engname(1:slen))
+        IF ( idx .EQ. 1 ) THEN
+            FGD_ENGINE_MATCH = enginename(windowid) .EQ. 'Cairo'
+            RETURN
+        ENDIF
+
+        idx = INDEX('PipedViewerPQ', engname(1:slen))
+        IF ( idx .EQ. 1 ) THEN
+            FGD_ENGINE_MATCH = enginename(windowid) .EQ. 'PipedViewerPQ'
+            RETURN
+        ENDIF
+
+        idx = INDEX('PipedImager', engname(1:slen))
+        IF ( idx .EQ. 1 ) THEN
+            FGD_ENGINE_MATCH = enginename(windowid) .EQ. 'PipedImager'
+            RETURN
+        ENDIF
+
+        IF ( slen .LE. 64 ) THEN
+            FGD_ENGINE_MATCH = enginename(windowid) .EQ. engname
+            RETURN
+        ENDIF
+
+        FGD_ENGINE_MATCH = .FALSE.
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gacwk.F b/fer/grdel/fgd_gacwk.F
new file mode 100644
index 0000000..20093ea
--- /dev/null
+++ b/fer/grdel/fgd_gacwk.F
@@ -0,0 +1,28 @@
+*
+* Set the active window
+*
+
+        SUBROUTINE FGD_GACWK(windowid)
+
+        IMPLICIT NONE
+        INTEGER windowid
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GACWK: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GACWK: null windowobj'
+        ENDIF
+
+        activewindow = windowid
+
+*       Begin a view in the active window by selecting
+*       the default transform (same as windowid)
+        CALL FGD_GSELNT(windowid)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gca.F b/fer/grdel/fgd_gca.F
new file mode 100644
index 0000000..ee5fb5e
--- /dev/null
+++ b/fer/grdel/fgd_gca.F
@@ -0,0 +1,31 @@
+*
+* Draw a multicolored rectangle
+* (fill cell array)
+*
+* The rectangle from (left, bottom) to (top, right) is filled with
+* colors from colorindices.  The arguments totcols and totrows are
+* only used for dimensioning colorindices (so basically ignored).
+* The arguments igcol and igrow are ignored here as they were also
+* ignored in the GKS code.  (They were suppose to be the start indices.)
+* The rectangle is divided evenly into numcols columns (X-axis) and
+* numrows rows (Y-axis) and filled from colors in colorindices assign
+* in column-major order.
+*
+* Not working properly and not actually needed, so stubbed out.
+* Modern graphics engines would turn this into multiple calls to
+* drawRectangle anyway, so just have Ferret make the drawRectangle
+* calls instead.
+*
+
+        SUBROUTINE FGD_GCA(left, bottom, right, top, totcols, totrows,
+     .                 stcol, strow, numcols, numrows, colorindices)
+
+        IMPLICIT NONE
+        INTEGER totcols, totrows, stcol, strow, numcols, numrows,
+     .          colorindices
+        REAL*4 left, bottom, right, top
+
+        STOP 'FGD_GCA: Stubbed, unexpected call'
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gclks.F b/fer/grdel/fgd_gclks.F
new file mode 100644
index 0000000..61025c1
--- /dev/null
+++ b/fer/grdel/fgd_gclks.F
@@ -0,0 +1,20 @@
+*
+* Deletes (closes and destroys) all Windows created by FGD_GOPWK
+* Also deletes any color, brush, font, pen, and symbol objects
+* associated with these windows.
+*
+        SUBROUTINE FGD_GCLKS()
+
+        IMPLICIT NONE
+        INCLUDE 'fgrdel.cmn'
+        INTEGER k
+
+        DO 10 k = 1, maxwindowobjs
+            IF ( windowobjs(k) .NE. nullobj ) THEN
+                CALL FGD_GCLWK(k)
+            ENDIF
+   10   CONTINUE
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gclrwk.F b/fer/grdel/fgd_gclrwk.F
new file mode 100644
index 0000000..34c9cbe
--- /dev/null
+++ b/fer/grdel/fgd_gclrwk.F
@@ -0,0 +1,48 @@
+*
+* Clear the window.
+* Input arguments:
+*    windowid: ID number of the window to clear
+*    ctrlflag: ignored
+*
+* NOTE: if windowid is not valid, this call is ignored
+*       since this can arise from SET WINDOW /NEW /CLEAR
+*
+
+        SUBROUTINE FGD_GCLRWK(windowid, ctrlflag)
+
+        IMPLICIT NONE
+        INTEGER windowid, ctrlflag
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            RETURN
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            RETURN
+        ENDIF
+*       Background color is always color zero which is colornum one
+        colornum = 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GCLRWK: null color for background'
+        ENDIF
+
+        CALL FGDWINCLEAR(success, windowobjs(windowid),
+     .                   colorobjs(colornum, windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gclsg.F b/fer/grdel/fgd_gclsg.F
new file mode 100644
index 0000000..5b74a2d
--- /dev/null
+++ b/fer/grdel/fgd_gclsg.F
@@ -0,0 +1,34 @@
+*
+* Definition of GCLSG (close segment).
+*
+        SUBROUTINE FGD_GCLSG()
+
+        IMPLICIT NONE
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GCLSQ: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GCLSQ: null windowobj'
+        ENDIF
+
+        CALL FGDSEGEND(success, windowobjs(activewindow))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gclwk.F b/fer/grdel/fgd_gclwk.F
new file mode 100644
index 0000000..21beed2
--- /dev/null
+++ b/fer/grdel/fgd_gclwk.F
@@ -0,0 +1,110 @@
+*
+* Deletes (closes and destroys) a Window created by FGD_GOPWK
+* Also deletes any color, brush, font, pen, and symbol objects
+* associated with this window
+*
+* Input Arguments:
+*     windowid: ID number of the Window to be closed
+*
+        SUBROUTINE FGD_GCLWK(windowid)
+
+        IMPLICIT NONE
+        INTEGER windowid
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GCLWK: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GCLWK: null windowobj'
+        ENDIF
+
+*       Delete any remaining objects associated with this window
+*       Error messages are printed just as warnings that something
+*       is not right, but errors are otherwise ignored.
+        DO 10 k = 1, maxsymbolobjs
+            IF ( symbolobjs(k, windowid) .NE. nullobj ) THEN
+                CALL FGDSYMBOLDEL(success, symbolobjs(k, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun, 
+     .                              errmsg, errmsglen)
+                ENDIF
+                symbolobjs(k, windowid) = nullobj
+            ENDIF
+   10   CONTINUE
+        DO 20 k = 1, maxpenobjs
+            IF ( penobjs(k, windowid) .NE. nullobj ) THEN
+                CALL FGDPENDEL(success, penobjs(k, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun, 
+     .                              errmsg, errmsglen)
+                ENDIF
+                penobjs(k, windowid) = nullobj
+            ENDIF
+   20   CONTINUE
+        DO 30 k = 1, maxfontobjs
+            IF ( fontobjs(k, windowid) .NE. nullobj ) THEN
+                CALL FGDFONTDEL(success, fontobjs(k, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun, 
+     .                              errmsg, errmsglen)
+                ENDIF
+                fontobjs(k, windowid) = nullobj
+            ENDIF
+   30   CONTINUE
+        DO 40 k = 1, maxbrushobjs
+            IF ( brushobjs(k, windowid) .NE. nullobj ) THEN
+                CALL FGDBRUSHDEL(success, brushobjs(k, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun, 
+     .                              errmsg, errmsglen)
+                ENDIF
+                brushobjs(k, windowid) = nullobj
+            ENDIF
+   40   CONTINUE
+        DO 50 k = 1, maxcolorobjs
+            IF ( colorobjs(k, windowid) .NE. nullobj ) THEN
+                CALL FGDCOLORDEL(success, colorobjs(k, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun, 
+     .                              errmsg, errmsglen)
+                ENDIF
+                colorobjs(k, windowid) = nullobj
+            ENDIF
+   50   CONTINUE
+
+*       Clear the DPI values just to be safe
+        windowdpix(windowid) = 0.0
+        windowdpiy(windowid) = 0.0
+
+*       Delete the window
+        CALL FGDWINDELETE(success, windowobjs(windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        windowobjs(windowid) = nullobj
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gcrsg.F b/fer/grdel/fgd_gcrsg.F
new file mode 100644
index 0000000..0da7adf
--- /dev/null
+++ b/fer/grdel/fgd_gcrsg.F
@@ -0,0 +1,35 @@
+*
+* Definition of GCRSG (create segment).
+*
+        SUBROUTINE FGD_GCRSG(segnum)
+
+        IMPLICIT NONE
+        INTEGER segnum
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GCRSQ: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GCRSQ: null windowobj'
+        ENDIF
+
+        CALL FGDSEGBEGIN(success, windowobjs(activewindow), segnum)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gdawk.F b/fer/grdel/fgd_gdawk.F
new file mode 100644
index 0000000..3e50575
--- /dev/null
+++ b/fer/grdel/fgd_gdawk.F
@@ -0,0 +1,37 @@
+*
+* Definition for GDAWK (deactivate workstation)
+* Ends the view of the active window (if valid)
+* and zeros out activewindow
+*
+
+        SUBROUTINE FGD_GDAWK(wk_id)
+
+        IMPLICIT NONE
+        INTEGER wk_id
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       End the view of a valid active window
+        IF ( (activewindow .GE. 1) .AND.
+     .       (activewindow .LE. maxwindowobjs) ) THEN
+            CALL FGDVIEWEND(success, windowobjs(activewindow))
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+        ENDIF
+
+*       set so there are no active windows
+        activewindow = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gdsg.F b/fer/grdel/fgd_gdsg.F
new file mode 100644
index 0000000..ea07d05
--- /dev/null
+++ b/fer/grdel/fgd_gdsg.F
@@ -0,0 +1,36 @@
+*
+* Definition of GDSG (delete segment).
+*
+        SUBROUTINE FGD_GDSG(segnum)
+
+        IMPLICIT NONE
+        INTEGER segnum
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GCRSQ: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GCRSQ: null windowobj'
+        ENDIF
+
+        CALL FGDSEGDELETE(success, windowobjs(activewindow), segnum)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gesspn.F b/fer/grdel/fgd_gesspn.F
new file mode 100644
index 0000000..0ba4a95
--- /dev/null
+++ b/fer/grdel/fgd_gesspn.F
@@ -0,0 +1,15 @@
+*
+* Sets the window title to be used when creating a window.
+*
+
+        SUBROUTINE FGD_GESSPN(wintitle)
+
+        IMPLICIT NONE
+        INCLUDE 'fgrdel.cmn'
+        CHARACTER*(*) wintitle
+
+        windowtitle = wintitle
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_get_view_limits.F b/fer/grdel/fgd_get_view_limits.F
new file mode 100644
index 0000000..47e4055
--- /dev/null
+++ b/fer/grdel/fgd_get_view_limits.F
@@ -0,0 +1,87 @@
+*
+* Return the limits of the active transform of the 
+* active window in terms of both the view fractions
+* and the user coordinates.
+*
+
+        SUBROUTINE FGD_GET_VIEW_LIMITS(
+     .                 lftfrc, rgtfrc, btmfrc, topfrc,
+     .                 lftcrd, rgtcrd, btmcrd, topcrd)
+
+        IMPLICIT NONE
+
+        REAL*4 lftfrc, rgtfrc, btmfrc, topfrc,
+     .         lftcrd, rgtcrd, btmcrd, topcrd
+
+        INCLUDE 'fgrdel.cmn'
+        REAL*4 EPSIL
+        PARAMETER (EPSIL = 1.0E-3)
+
+*       Sanity checks - transform 0 is an implicit transform
+        IF ( (activetransform .LT. 0) .OR.
+     .       (activetransform .GT. maxtransforms) ) THEN
+            STOP 'FGD_GET_VIEW_LIMTS: No active transform'
+        ENDIF
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GET_VIEW_LIMITS: No active window'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GET_VIEW_LIMITS: null active windowobj'
+        ENDIF
+
+        IF ( activetransform .NE. 0 ) THEN
+*           Get the view limits and adjust, realizing that the
+*           full window is thought of as going from [0.0,0.0]
+*           to [ndcxmax,ndcymax] (set by FGD_GSWKWN).
+            lftfrc = viewleftfrac(activetransform) / 
+     .               ndcxmax(activewindow)
+            rgtfrc = viewrightfrac(activetransform) / 
+     .               ndcxmax(activewindow)
+            btmfrc = viewbottomfrac(activetransform) / 
+     .               ndcymax(activewindow)
+            topfrc = viewtopfrac(activetransform) / 
+     .               ndcymax(activewindow)
+*           Allow some tolerance for all PlotPlus arithmetic 
+*           (more than just the above) in single-precision
+            IF ( (lftfrc .LT. 0.0) .AND. (lftfrc .GT. -EPSIL) )
+     .          lftfrc = 0.0
+            IF ( (rgtfrc .GT. 1.0) .AND. (rgtfrc .LT. 1.0+EPSIL) )
+     .          lftfrc = 1.0
+            IF ( (btmfrc .LT. 0.0) .AND. (btmfrc .GT. -EPSIL) )
+     .          btmfrc = 0.0
+            IF ( (topfrc .GT. 1.0) .AND. (topfrc .LT. 1.0+EPSIL) )
+     .          topfrc = 1.0
+            lftcrd = viewleftcoord(activetransform)
+            btmcrd = viewbottomcoord(activetransform)
+            rgtcrd = viewrightcoord(activetransform)
+            topcrd = viewtopcoord(activetransform)
+            IF ( (lftfrc .LT. 0.0) .OR.
+     .           (lftfrc .GE. rgtfrc) .OR.
+     .           (rgtfrc .GT. 1.0) .OR.
+     .           (btmfrc .LT. 0.0) .OR.
+     .           (btmfrc .GE. topfrc) .OR.
+     .           (topfrc .GT. 1.0) ) THEN
+                WRITE(*,*) 'lft, btm, rgt, top fracs = ',
+     .                     lftfrc, btmfrc, rgtfrc, topfrc
+                WRITE(*,*) 'lft, btm, rgt, top coords = ',
+     .                     lftcrd, btmcrd, rgtcrd, topcrd
+                STOP 'FGD_GET_VIEW_LIMITS: invalid adj view fracs'
+            ENDIF
+        ELSE
+*           The identity transform.
+            lftfrc = 0.0
+            btmfrc = 0.0
+            rgtfrc = 1.0
+            topfrc = 1.0
+            lftcrd = 0.0
+            btmcrd = 0.0
+            rgtcrd = windowwidth(activewindow) *
+     .               windowdpix(activewindow)
+            topcrd = windowheight(activewindow) *
+     .               windowdpiy(activewindow)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_get_window_size.F b/fer/grdel/fgd_get_window_size.F
new file mode 100644
index 0000000..43ea035
--- /dev/null
+++ b/fer/grdel/fgd_get_window_size.F
@@ -0,0 +1,28 @@
+*
+* Return the size of the active window in pixels.
+*
+
+        SUBROUTINE FGD_GET_WINDOW_SIZE(width, height)
+
+        IMPLICIT NONE
+
+        REAL*4 width, height
+
+        INCLUDE 'fgrdel.cmn'
+
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GET_WINDOW_SIZE: No active window'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GET_WINDOW_SIZE: null active windowobj'
+        ENDIF
+
+        width = windowwidth(activewindow) *
+     .          windowdpix(activewindow)
+        height = windowheight(activewindow) *
+     .           windowdpiy(activewindow)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_getanimate.F b/fer/grdel/fgd_getanimate.F
new file mode 100644
index 0000000..56712df
--- /dev/null
+++ b/fer/grdel/fgd_getanimate.F
@@ -0,0 +1,25 @@
+*
+* Return arguments:
+*    inanimation: 1 if the current plotting is part of an animation
+*                   and is not the first frame;
+*                 0 otherwise.
+*
+
+        SUBROUTINE FGD_GETANIMATE(inanimation)
+
+        IMPLICIT NONE
+        INTEGER inanimation
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xplot_setup.cmn'
+
+        IF ( .NOT. animate ) THEN
+            inanimation = 0
+        ELSE IF ( first_frame ) THEN
+            inanimation = 0
+        ELSE
+            inanimation = 1
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gfa.F b/fer/grdel/fgd_gfa.F
new file mode 100644
index 0000000..00253c5
--- /dev/null
+++ b/fer/grdel/fgd_gfa.F
@@ -0,0 +1,117 @@
+*
+* Fill an area in the active window using the active brush object
+* or a temporary brush created from the last brush description.
+*
+
+        SUBROUTINE FGD_GFA(npts, ptsx, ptsy)
+
+        IMPLICIT NONE
+        INTEGER npts
+        REAL*4 ptsx, ptsy
+        DIMENSION ptsx(npts), ptsy(npts)
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k, success, errmsglen
+        CHARACTER*2048 errmsg
+        REAL*8 tempbrush, fillbrush
+        REAL*4 left, bottom, right, top
+        LOGICAL rectdrawn;
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GFA: No active window'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GFA: null active windowobj'
+        ENDIF
+
+        IF ( (activebrush .GE. 1) .AND.
+     .       (activebrush .LE. maxbrushobjs) ) THEN
+*           Use the predefined brush
+            fillbrush = brushobjs(activebrush, activewindow)
+            IF ( fillbrush .EQ. nullobj ) THEN
+                STOP 'FGD_GFA: null activebrush'
+            ENDIF
+            tempbrush = nullobj
+        ELSE
+*           Create a temporary brush to use
+            IF ( (lastbrushcolor .LT. 1) .OR.
+     .           (lastbrushcolor .GT. maxcolorobjs) ) THEN
+                STOP 'FGD_GFA: invalid lastbrushcolor'
+            ENDIF
+            IF ( colorobjs(lastbrushcolor, activewindow)
+     .           .EQ. nullobj ) THEN
+                STOP 'FGD_GFA: null lastbrushcolor'
+            ENDIF
+            CALL FGDBRUSH(tempbrush, windowobjs(activewindow),
+     .                    colorobjs(lastbrushcolor, activewindow),
+     .                    lastbrushstyle, lastbstylen)
+            IF ( tempbrush .EQ. nullobj ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+                STOP 'FGD_GFA: null tempbrush'
+            ENDIF
+            fillbrush = tempbrush
+        ENDIF
+
+*       Quick check for a rectangle as specified by Ferret
+*       (Drawing rectangles much faster than generic polygons.)
+        rectdrawn = .FALSE.
+        IF ( npts .EQ. 4 ) THEN
+            IF ( (ptsx(1) .EQ. ptsx(2)) .AND.
+     .           (ptsx(3) .EQ. ptsx(4)) .AND.
+     .           (ptsy(1) .EQ. ptsy(4)) .AND.
+     .           (ptsy(2) .EQ. ptsy(3)) ) THEN
+                IF ( ptsx(1) .LT. ptsx(3) ) THEN
+                    left = ptsx(1)
+                    right = ptsx(3)
+                ELSE
+                    left = ptsx(3)
+                    right = ptsx(1)
+                ENDIF
+                IF ( ptsy(1) .LT. ptsy(2) ) THEN
+                    bottom = ptsy(1)
+                    top = ptsy(2)
+                ELSE
+                    bottom = ptsy(2)
+                    top = ptsy(1)
+                ENDIF
+*               Fill rectangle area (no outline)
+                CALL FGDDRAWRECT(success, windowobjs(activewindow),
+     .                  left, bottom, right, top, fillbrush, nullobj)
+                rectdrawn = .TRUE.
+            ENDIF
+        ENDIF
+        IF ( .NOT. rectdrawn ) THEN
+*           Fill generic polygon area (no outline)
+            CALL FGDDRAWPOLYGON(success, windowobjs(activewindow),
+     .                          ptsx, ptsy, npts, fillbrush, nullobj)
+        ENDIF
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        somethingdrawn = .TRUE.
+
+*       If a temporary brush was created, delete it
+        IF ( tempbrush .NE. nullobj ) THEN
+            CALL FGDBRUSHDEL(success, tempbrush)
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_ginch.F b/fer/grdel/fgd_ginch.F
new file mode 100644
index 0000000..260e341
--- /dev/null
+++ b/fer/grdel/fgd_ginch.F
@@ -0,0 +1,16 @@
+*
+* Definition of GINCH (initialize choices)
+* Does nothing.
+*
+        SUBROUTINE FGD_GINCH(windowid, chdnr, istat, ichnr, pet,
+     .                   xmin, xmax, ymin, ymax, ldr, datarec)
+
+        IMPLICIT NONE
+        INTEGER windowid, chdnr, istat, ichnr, pet, ldr
+        REAL*4    xmin, xmax, ymin, ymax
+        CHARACTER*(80) datarec
+        DIMENSION datarec(ldr)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gopks.F b/fer/grdel/fgd_gopks.F
new file mode 100644
index 0000000..f371c78
--- /dev/null
+++ b/fer/grdel/fgd_gopks.F
@@ -0,0 +1,13 @@
+*
+* Definition for GOPKS (open GKS).  Does nothing since FGD_GOPWS 
+* initializes the appropriate graphics engine if needed.
+*
+
+        SUBROUTINE FGD_GOPKS(gkserrlun)
+
+        IMPLICIT NONE
+        INTEGER gkserrlun
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gopwk.F b/fer/grdel/fgd_gopwk.F
new file mode 100644
index 0000000..2a15aa5
--- /dev/null
+++ b/fer/grdel/fgd_gopwk.F
@@ -0,0 +1,116 @@
+*
+* Creates a Window object for a given graphics engine.
+* (Initializes the graphics engine if needed.)
+*
+* Input arguments:
+*     windowid: ID number for this window (1, 2, ...)
+*     connectid: ignored
+*     windowtype: ignored
+*
+* Values used from fgrdel.cmn:
+*     enginename
+*     windowtitle
+*     antialias
+*     thickfactor
+*
+
+        SUBROUTINE FGD_GOPWK(windowid, connectid, windowtype)
+
+        IMPLICIT NONE
+        INTEGER windowid, connectid, windowtype
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER TM_LENSTR
+
+        INTEGER engnamelen, wintitlelen, showit, 
+     .          success, errmsglen, aaint
+        CHARACTER*2048 errmsg
+        REAL*4 redf, greenf, bluef, opaquef
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GOPWK: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .NE. nullobj ) THEN
+            STOP 'FGD_GOPWK: non-null windowobj'
+        ENDIF
+
+*       Create the window
+        engnamelen = TM_LENSTR(enginename(windowid))
+        wintitlelen = TM_LENSTR(windowtitle)
+        showit = 1
+        CALL FGDWINCREATE(windowobjs(windowid),
+     .                    enginename(windowid), engnamelen,
+     .                    windowtitle, wintitlelen, showit)
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+            RETURN
+        ENDIF
+
+*       Create opaque white as the first color for this window
+        redf = 1.0
+        greenf = 1.0
+        bluef = 1.0
+        opaquef = 1.0
+        CALL FGDCOLOR(colorobjs(1, windowid), windowobjs(windowid),
+     .                redf, greenf, bluef, opaquef)
+        IF ( colorobjs(1, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Create opaque black as the second color for this window
+        redf = 0.0
+        greenf = 0.0
+        bluef = 0.0
+        opaquef = 1.0
+        CALL FGDCOLOR(colorobjs(2, windowid), windowobjs(windowid),
+     .                redf, greenf, bluef, opaquef)
+        IF ( colorobjs(2, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Set the antialias state
+        IF ( antialias(windowid) ) THEN
+            aaint = 1
+        ELSE
+            aaint = 0
+        ENDIF
+        CALL FGDWINSETANTIALIAS(success, windowobjs(windowid), aaint)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Set the scaling factor for line widths and symbol sizes
+        CALL FGDWINSETWIDTHFACTOR(success, windowobjs(windowid), 
+     .                            thickfactor(windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Set the background color
+        CALL FGDWINCLEAR(success, windowobjs(windowid), 
+     .                   colorobjs(1,windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gpl.F b/fer/grdel/fgd_gpl.F
new file mode 100644
index 0000000..f1577f4
--- /dev/null
+++ b/fer/grdel/fgd_gpl.F
@@ -0,0 +1,49 @@
+*
+* Draw a polyline in the active window using the active pen object
+*
+
+        SUBROUTINE FGD_GPL(npts, ptsx, ptsy)
+
+        IMPLICIT NONE
+        INTEGER npts
+        REAL*4 ptsx, ptsy
+        DIMENSION ptsx(npts), ptsy(npts)
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GPL: Invalid activewindow'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GPL: null activewindow'
+        ENDIF
+
+        IF ( (activepen .LT. 1) .OR.
+     .       (activepen .GT. maxpenobjs) ) THEN
+            STOP 'FGD_GPL: invalid activepen'
+        ENDIF
+        IF ( penobjs(activepen, activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GPL: null activepen'
+        ENDIF
+
+*       Draw polyline
+        CALL FGDDRAWMULTILINE(success, windowobjs(activewindow),
+     .          ptsx, ptsy, npts, penobjs(activepen, activewindow))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        somethingdrawn = .TRUE.
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gpm.F b/fer/grdel/fgd_gpm.F
new file mode 100644
index 0000000..c66f82f
--- /dev/null
+++ b/fer/grdel/fgd_gpm.F
@@ -0,0 +1,64 @@
+*
+* Draw points in the active window using
+* the active symbol object (polymarker)
+*
+
+        SUBROUTINE FGD_GPM(npts, ptsx, ptsy)
+
+        IMPLICIT NONE
+        INTEGER npts
+        REAL*4 ptsx, ptsy
+        DIMENSION ptsx(npts), ptsy(npts)
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GPM: Invalid activewindow'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GPM: null activewindow'
+        ENDIF
+        IF ( (activesymbol .LT. 1) .OR.
+     .       (activesymbol .GT. maxsymbolobjs) ) THEN
+            STOP 'FGD_GPM: Invalid activesymbol'
+        ENDIF
+        IF ( symbolobjs(activesymbol, activewindow)
+     .       .EQ. nullobj ) THEN
+            STOP 'FGD_GPM: null activesymbol'
+        ENDIF
+        colornum = symbolcolor(activesymbol, activewindow)
+        IF ( (colornum .LT. 1) .OR.
+     .       (colornum .GT. maxcolorobjs) ) THEN
+            STOP 'FGD_GPM: Invalid symbolcolor'
+        ENDIF
+        IF ( colorobjs(colornum, activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GPM: null symbolcolor'
+        ENDIF
+        IF ( symbolsize(activesymbol, activewindow) .LE. 0.0 ) THEN
+            STOP 'FGD_GPM: invalid symbolsize'
+        ENDIF
+
+*       Draw the symbols
+        CALL FGDDRAWPOINTS(success, windowobjs(activewindow),
+     .                     ptsx, ptsy, npts,
+     .                     symbolobjs(activesymbol, activewindow),
+     .                     colorobjs(colornum, activewindow),
+     .                     symbolsize(activesymbol, activewindow))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        somethingdrawn = .TRUE.
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gprec.F b/fer/grdel/fgd_gprec.F
new file mode 100644
index 0000000..f465e80
--- /dev/null
+++ b/fer/grdel/fgd_gprec.F
@@ -0,0 +1,17 @@
+*
+* Definition of GPREC (pack data record)
+* Does nothing.
+*
+        SUBROUTINE FGD_GPREC(il, ia, rl, ra, sl, lstr, str, mldr,
+     .                   errind, ldr, datarec)
+
+        IMPLICIT NONE
+        INTEGER il, ia, rl, sl, lstr, mldr, errind, ldr
+        REAL*4 ra
+        CHARACTER*10 str
+        CHARACTER*80 datarec
+        DIMENSION ia(il), ra(rl), lstr(sl), str(sl), datarec(mldr)
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqacwk.F b/fer/grdel/fgd_gqacwk.F
new file mode 100644
index 0000000..fb8ce31
--- /dev/null
+++ b/fer/grdel/fgd_gqacwk.F
@@ -0,0 +1,29 @@
+*
+* Definition of GQACWK (inquire about active workstations)
+* Sets retwin to the value of activewindow, and sets
+* numactive to one, if activewindow is valid, or zero,
+* if activewindow is invalid.  Sets istat to zero and ignores
+* nwin.
+*
+
+        SUBROUTINE FGD_GQACWK(nwin, istat, numactive, retwin)
+
+        IMPLICIT NONE
+        INTEGER nwin, istat, numactive, retwin
+
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k
+
+        retwin = activewindow
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            numactive = 0
+        ELSE
+            numactive = 1
+        ENDIF
+        istat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqasf.F b/fer/grdel/fgd_gqasf.F
new file mode 100644
index 0000000..4b10b58
--- /dev/null
+++ b/fer/grdel/fgd_gqasf.F
@@ -0,0 +1,21 @@
+*
+* Definition of GQASF
+* (inquire aspect source flags)
+* Sets everything to zero as these flags are not used.
+*
+
+        SUBROUTINE FGD_GQASF(stat, lasf)
+
+        IMPLICIT NONE
+        INTEGER stat, lasf(13)
+
+        INTEGER k
+
+        stat = 0
+        DO 10 k = 1, 13
+            lasf(k) = 0
+   10   CONTINUE
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqchs.F b/fer/grdel/fgd_gqchs.F
new file mode 100644
index 0000000..206bafc
--- /dev/null
+++ b/fer/grdel/fgd_gqchs.F
@@ -0,0 +1,22 @@
+*
+* Definition of GQCHS
+* (inquire choice device state
+* Sets stat to 1 since input functions are not supported at this time
+*
+
+        SUBROUTINE FGD_GQCHS(windowid, chdevnum, maxdr, stat,
+     .                   opmode, echomode, chnum, promptyp,
+     .                   echoarea, lendr, datarec)
+
+        IMPLICIT NONE
+        INTEGER windowid, chdevnum, maxdr, stat, opmode,
+     .          echomode, chnum, promptyp, lendr
+        REAL*4 echoarea(4)
+        CHARACTER*80 datarec
+        DIMENSION datarec(maxdr)
+
+       stat = 1
+
+       RETURN
+       END
+
diff --git a/fer/grdel/fgd_gqclip.F b/fer/grdel/fgd_gqclip.F
new file mode 100644
index 0000000..2b8e0f2
--- /dev/null
+++ b/fer/grdel/fgd_gqclip.F
@@ -0,0 +1,30 @@
+*
+* Inquire clipping indicator for the active window.
+*
+
+        SUBROUTINE FGD_GQCLIP(stat, clipit)
+
+        IMPLICIT NONE
+        INTEGER stat, clipit
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GQCLIP: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GQCLIP: null activewindow'
+        ENDIF
+*       Inquire the clipping state
+        IF ( cliptoview(activewindow) ) THEN
+            clipit = 1
+        ELSE
+            clipit = 0
+        ENDIF
+        stat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqcls.F b/fer/grdel/fgd_gqcls.F
new file mode 100644
index 0000000..70b335b
--- /dev/null
+++ b/fer/grdel/fgd_gqcls.F
@@ -0,0 +1,22 @@
+*
+* Definition of GQLCS
+* (inquire locator device state)
+* Sets stat to 1 since input functions are not supported at this time
+*
+
+        SUBROUTINE FGD_GQLCS(windowid, locdevnum, rettyp, maxdr,
+     .                   stat, opmode, echomode, transnum, locx,
+     .                   locy, promptyp, echoarea, lendr, datarec)
+
+        IMPLICIT NONE
+        INTEGER windowid, locdevnum, rettyp, maxdr, stat, opmode,
+     .          echomode, transnum, promptyp, lendr
+        REAL*4 locx, locy, echoarea(4)
+        CHARACTER*80 datarec
+        DIMENSION datarec(maxdr)
+
+       stat = 1
+
+       RETURN
+       END
+
diff --git a/fer/grdel/fgd_gqcntn.F b/fer/grdel/fgd_gqcntn.F
new file mode 100644
index 0000000..c736b27
--- /dev/null
+++ b/fer/grdel/fgd_gqcntn.F
@@ -0,0 +1,17 @@
+*
+* Inquire current (normalization) transformation number
+*
+
+        SUBROUTINE FGD_GQCNTN(istat, transnum)
+
+        IMPLICIT NONE
+        INTEGER istat, transnum
+
+        INCLUDE 'fgrdel.cmn'
+
+        transnum = activetransform
+        istat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqcr.F b/fer/grdel/fgd_gqcr.F
new file mode 100644
index 0000000..1708dad
--- /dev/null
+++ b/fer/grdel/fgd_gqcr.F
@@ -0,0 +1,53 @@
+*
+* Returns the RGBA fractions of a color object with index
+* colorindex for the window with ID number windowid.  
+* If the color object exists the RGBA fractions are returned 
+* in redfrac, greenfrac, bluefrac, and opaquefrac arguments, 
+* and istat is set to zero.  If the colorobj does not exist, 
+* then istat is set to one and the RGBA fractions are unchanged.
+*
+
+        SUBROUTINE FGD_GQCR(windowid, colorindex, istat,
+     .                      redfrac, greenfrac, bluefrac, opaquefrac)
+
+        IMPLICIT NONE
+        INTEGER windowid, colorindex, istat
+        REAL*4 redfrac, greenfrac, bluefrac, opaquefrac
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GQCR: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GQCR: null windowobj'
+        ENDIF
+        IF ( (colorindex .LT. 0) .OR.
+     .       (colorindex .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_GQCR: Invalid colorindex'
+        ENDIF
+
+        colornum = colorindex + 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            istat = 1
+            RETURN
+        ENDIF
+
+*       Simplest approach for retrieving color RGBA values was 
+*       just to store them in the common block when they are set
+        redfrac = colorrgba(1, colornum, windowid)
+        greenfrac = colorrgba(2, colornum, windowid)
+        bluefrac = colorrgba(3, colornum, windowid)
+        opaquefrac = colorrgba(4, colornum, windowid)
+        istat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqdsp.F b/fer/grdel/fgd_gqdsp.F
new file mode 100644
index 0000000..b59487b
--- /dev/null
+++ b/fer/grdel/fgd_gqdsp.F
@@ -0,0 +1,57 @@
+*
+* Definition of GQDSP
+* (inqure worstation display space size)
+* Returns the DPI and size of the default screen (display) 
+* for the given window.
+*    dmaxx and dmaxy are sizes in meters
+*    imaxx and imaxy are sizes in pixels
+*
+
+        SUBROUTINE FGD_GQDSP(windowid, istat, dspunit,
+     .                   dmaxx, dmaxy, imaxx, imaxy)
+
+        IMPLICIT NONE
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER windowid, istat, dspunit, imaxx, imaxy
+        REAL*4 dmaxx, dmaxy
+
+        REAL*4 dpix, dpiy
+        INTEGER screenwidth, screenheight, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GQDSP: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GQDSP: null windowobj'
+        ENDIF
+
+        CALL FGDWINSCREENINFO(success, windowobjs(windowid), 
+     .                        dpix, dpiy, screenwidth, screenheight)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Save the dpix and dpiy for use elsewhere 
+*       so this routine does need to be called all the time
+        windowdpix(windowid) = dpix
+        windowdpiy(windowid) = dpiy
+
+        dspunit = 1
+        dmaxx = (screenwidth * 0.0254) / dpix
+        dmaxy = (screenheight * 0.0254) / dpiy
+        imaxx = screenwidth
+        imaxy = screenheight
+        istat = 0
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gqlwk.F b/fer/grdel/fgd_gqlwk.F
new file mode 100644
index 0000000..6b41855
--- /dev/null
+++ b/fer/grdel/fgd_gqlwk.F
@@ -0,0 +1,33 @@
+*
+* Definition of GQLWK
+* (inquire maximum length of workstation state tables)
+* set value to the maximum number of each type of object for a window
+*
+
+        SUBROUTINE FGD_GQLWK(wintype, stat, maxpens, maxsyms,
+     .                 maxfonts, maxbrushes, maxpatterns, maxcolors)
+
+        IMPLICIT NONE
+        INTEGER wintype, stat, maxpens, maxsyms, maxfonts,
+     .          maxbrushes, maxpatterns, maxcolors
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Last pen reserved for the temporary pen
+        maxpens = maxpenobjs - 1
+*       Last symbol reserved for the temporary symbol
+        maxsyms = maxsymbolobjs - 1
+*       Fonts not used at this time
+        maxfonts = maxfontobjs
+*       Brushes
+        maxbrushes = maxbrushobjs
+*       Set to the number of hash styles supported
+*       although this might not be what it actually means
+        maxpatterns = 7
+*       Last color reserved for the temporary color
+        maxcolors = maxcolorobjs - 1
+        stat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqnt.F b/fer/grdel/fgd_gqnt.F
new file mode 100644
index 0000000..59ac797
--- /dev/null
+++ b/fer/grdel/fgd_gqnt.F
@@ -0,0 +1,45 @@
+*
+* Inquire (normalization) transformation
+*
+
+        SUBROUTINE FGD_GQNT(transnum, istat, usercoords, viewfracs)
+
+        IMPLICIT NONE
+        INTEGER transnum, istat
+        REAL*4 usercoords(4), viewfracs(4)
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (transnum .LT. 0) .OR.
+     .       (transnum .GT. maxtransforms) ) THEN
+            STOP 'FGD_GQNT: invalid transnum'
+        ENDIF
+
+        IF ( transnum .EQ. 0 ) THEN
+*           Implicit transformation - should not actually be used.
+*           Using 1000.0 * I instead of just I
+            usercoords(1) = 0.0
+            usercoords(2) = 1.0
+            usercoords(3) = 0.0
+            usercoords(4) = 1.0
+            viewfracs(1) = 0.0
+            viewfracs(2) = 1000.0
+            viewfracs(3) = 0.0
+            viewfracs(4) = 1000.0
+        ELSE
+*           Tranformation given in the common block values
+            usercoords(1) = viewleftcoord(transnum)
+            usercoords(2) = viewrightcoord(transnum)
+            usercoords(3) = viewbottomcoord(transnum)
+            usercoords(4) = viewtopcoord(transnum)
+            viewfracs(1) = viewleftfrac(transnum)
+            viewfracs(2) = viewrightfrac(transnum)
+            viewfracs(3) = viewbottomfrac(transnum)
+            viewfracs(4) = viewtopfrac(transnum)
+        ENDIF
+
+        istat = 0
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqops.F b/fer/grdel/fgd_gqops.F
new file mode 100644
index 0000000..04b9cf5
--- /dev/null
+++ b/fer/grdel/fgd_gqops.F
@@ -0,0 +1,17 @@
+*
+* Defiinition of GQOPS (inquire operating state).
+* Just returns 3 (open and running) in its argument
+* since there is no explicit engine intitialization
+* or finalization.
+*
+
+        SUBROUTINE FGD_GQOPS(istat)
+
+        IMPLICIT NONE
+        INTEGER istat
+
+        istat = 3
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqopwk.F b/fer/grdel/fgd_gqopwk.F
new file mode 100644
index 0000000..16677c9
--- /dev/null
+++ b/fer/grdel/fgd_gqopwk.F
@@ -0,0 +1,30 @@
+*
+* Definition of GQOPWK (inquire about open workstations)
+* Just returns the number of non-null window objects in
+* the numopen argument, and the window ID number of the
+* first of these in the retwin argument.  The istat argument
+* is set to zero, and the nwin argument is ignored.
+*
+
+        SUBROUTINE FGD_GQOPWK(nwin, istat, numopen, retwin)
+
+        IMPLICIT NONE
+        INTEGER nwin, istat, numopen, retwin
+
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k
+
+        numopen = 0
+        retwin = 0
+        DO 10 k = 1, maxwindowobjs
+            IF ( windowobjs(k) .NE. nullobj ) THEN
+                numopen = numopen + 1
+                IF ( retwin .EQ. 0 ) retwin = k
+            ENDIF
+   10   CONTINUE
+        istat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqpcr.F b/fer/grdel/fgd_gqpcr.F
new file mode 100644
index 0000000..4949244
--- /dev/null
+++ b/fer/grdel/fgd_gqpcr.F
@@ -0,0 +1,34 @@
+*
+* Definition of GQPCR
+* (inquire predefined color representation)
+* Only black and white are automatically set,
+* so only set info for those
+*
+
+        SUBROUTINE FGD_GQPCR(wstype, colorindex, stat,
+     .                 redfrac, greenfrac, bluefrac, opaquefrac)
+
+        IMPLICIT NONE
+        INTEGER wstype, colorindex, stat
+        REAL*4 redfrac, greenfrac, bluefrac, opaquefrac
+
+*       Opaque white is color index 0, opaque black is color index 1
+        IF ( colorindex .EQ. 0 ) THEN
+            redfrac = 1.0
+            greenfrac = 1.0
+            bluefrac = 1.0
+            opaquefrac = 1.0
+            stat = 0
+        ELSE IF ( colorindex .EQ. 1 ) THEN
+            redfrac = 0.0
+            greenfrac = 0.0
+            bluefrac = 0.0
+            opaquefrac = 1.0
+            stat = 0
+        ELSE
+            stat = 1
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gqpxad.F b/fer/grdel/fgd_gqpxad.F
new file mode 100644
index 0000000..3c3a910
--- /dev/null
+++ b/fer/grdel/fgd_gqpxad.F
@@ -0,0 +1,54 @@
+*
+* Inquire pixel array dimensions from user (world) coordinates.
+*
+
+        SUBROUTINE FGD_GQPXAD(windowid, left, top, right, bottom,
+     .                        istat, widthpix, heightpix)
+
+        IMPLICIT NONE
+        INTEGER windowid, istat, widthpix, heightpix
+        REAL*4 left, top, right, bottom
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        REAL*4 mywidth, myheight
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GQPXAD: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GQPXAD: null windowobj'
+        ENDIF
+
+        mywidth = right - left
+        myheight = top - bottom
+        IF ( activetransform .GT. 0 ) THEN
+            mywidth = mywidth * ( viewrightfrac(activetransform)
+     .                           - viewleftfrac(activetransform) )
+            mywidth = mywidth / ( viewrightcoord(activetransform)
+     .                           - viewleftcoord(activetransform) )
+            mywidth = mywidth / ndcxmax(windowid)
+            myheight = myheight * ( viewtopfrac(activetransform)
+     .                            - viewbottomfrac(activetransform) )
+            myheight = myheight / ( viewtopcoord(activetransform)
+     .                            - viewbottomcoord(activetransform) )
+            myheight = myheight / ndcymax(windowid)
+        ENDIF
+        mywidth = mywidth * windowwidth(windowid) * 
+     .                      windowdpix(windowid)
+        myheight = myheight * windowheight(windowid) * 
+     .                        windowdpiy(windowid)
+
+*       make sure the width and height are positive integers
+        widthpix = INT(ABS(mywidth))
+        heightpix = INT(ABS(myheight))
+        istat = 0
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gqwkc.F b/fer/grdel/fgd_gqwkc.F
new file mode 100644
index 0000000..b9b1f13
--- /dev/null
+++ b/fer/grdel/fgd_gqwkc.F
@@ -0,0 +1,25 @@
+*
+* Definition of GQWKC
+* (inquire workstatrion connection and type)
+*
+
+        SUBROUTINE FGD_GQWKC(windowid, istat, connectid, wstype)
+
+        IMPLICIT NONE
+        INTEGER windowid, istat, connectid, wstype
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity check
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GQWKC: Invalid windowid value'
+        ENDIF
+
+*       Canned return values based of XWindows display
+        connectid = 1
+        wstype = 4
+        istat = 0
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_grqch.F b/fer/grdel/fgd_grqch.F
new file mode 100644
index 0000000..68394fd
--- /dev/null
+++ b/fer/grdel/fgd_grqch.F
@@ -0,0 +1,16 @@
+*
+* Definition of GRQCH
+* (request choice)
+* Only sets outstat to 0 as input functions are not supported at this time.
+*
+
+        SUBROUTINE FGD_GRQCH(windowid, chdevnum, outstat, outchnum)
+
+        IMPLICIT NONE
+        INTEGER windowid, chdevnum, outstat, outchnum
+
+        outstat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_grqlc.F b/fer/grdel/fgd_grqlc.F
new file mode 100644
index 0000000..5c84cb4
--- /dev/null
+++ b/fer/grdel/fgd_grqlc.F
@@ -0,0 +1,18 @@
+*
+* Definition of GRQLC
+* (request locator)
+* Assigns outstat to 0 since input functions are not supported at this time.
+*
+
+        SUBROUTINE FGD_GRQLC(windowid, locdevnum,
+     .                   outstat, transnum, outx, outy)
+
+        IMPLICIT NONE
+        INTEGER windowid, locdevnum, outstat, transnum
+        REAL*4 outx, outy
+
+        outstat = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsasf.F b/fer/grdel/fgd_gsasf.F
new file mode 100644
index 0000000..515f05b
--- /dev/null
+++ b/fer/grdel/fgd_gsasf.F
@@ -0,0 +1,13 @@
+*
+* Definition of GSASF
+* (set aspect source flags)
+* Does nothing as these flags are not used.
+*
+
+        SUBROUTINE FGD_GSASF(lasf)
+
+        IMPLICIT NONE
+        INTEGER lasf(13)
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gsclip.F b/fer/grdel/fgd_gsclip.F
new file mode 100644
index 0000000..9a960c0
--- /dev/null
+++ b/fer/grdel/fgd_gsclip.F
@@ -0,0 +1,42 @@
+*
+* Set clipping indicator for the active window.
+*
+
+        SUBROUTINE FGD_GSCLIP(clipit)
+
+        IMPLICIT NONE
+        INTEGER clipit
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSCLIP: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GSCLIP: null activewindow'
+        ENDIF
+*       Record the clipping state
+        IF ( clipit .EQ. 0 ) THEN
+            cliptoview(activewindow) = .FALSE.
+        ELSE
+            cliptoview(activewindow) = .TRUE.
+        ENDIF
+*       Assign the clipping state
+        CALL FGDVIEWCLIP(success, windowobjs(activewindow), clipit)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gscr.F b/fer/grdel/fgd_gscr.F
new file mode 100644
index 0000000..1f2ec07
--- /dev/null
+++ b/fer/grdel/fgd_gscr.F
@@ -0,0 +1,112 @@
+*
+* Create color objects for a Window.
+*
+
+        SUBROUTINE FGD_GSCR(windowid, colorindex,
+     .             redfrac, greenfrac, bluefrac, opaquefrac)
+
+        IMPLICIT NONE
+        INTEGER windowid, colorindex
+        REAL*4 redfrac, greenfrac, bluefrac, opaquefrac
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, success, errmsglen
+        CHARACTER*2048 errmsg
+        INTEGER brushnum, pennum
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSCR: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSCR: null windowobj'
+        ENDIF
+        IF ( (colorindex .LT. 0) .OR.
+     .       (colorindex .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_GSCR: Invalid colorindex'
+        ENDIF
+        IF ( (redfrac .LT. 0.0) .OR.  (redfrac .GT. 1.0) ) THEN
+            STOP 'FGD_GSCR: Invalid redfrac'
+        ENDIF
+        IF ( (greenfrac .LT. 0.0) .OR.  (greenfrac .GT. 1.0) ) THEN
+            STOP 'FGD_GSCR: Invalid greenfrac'
+        ENDIF
+        IF ( (bluefrac .LT. 0.0) .OR.  (bluefrac .GT. 1.0) ) THEN
+            STOP 'FGD_GSCR: Invalid bluefrac'
+        ENDIF
+        IF ( (opaquefrac .LT. 0.0) .OR.  (opaquefrac .GT. 1.0) ) THEN
+            STOP 'FGD_GSCR: Invalid opaquefrac'
+        ENDIF
+
+        colornum = colorindex + 1
+
+*       If this is replacing an existing color object,
+*       delete the previous color object.
+        IF ( colorobjs(colornum, windowid) .NE. nullobj ) THEN
+            CALL FGDCOLORDEL(success, colorobjs(colornum, windowid))
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+            colorobjs(colornum, windowid) = nullobj
+        ENDIF
+
+*       Create the new color object.
+        CALL FGDCOLOR(colorobjs(colornum, windowid),
+     .                windowobjs(windowid),
+     .                redfrac, greenfrac, bluefrac, opaquefrac)
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Simplest approach for retrieving color RGBA values was 
+*       just to store them in the common block when they are set
+        colorrgba(1, colornum, windowid) = redfrac
+        colorrgba(2, colornum, windowid) = greenfrac
+        colorrgba(3, colornum, windowid) = bluefrac
+        colorrgba(4, colornum, windowid) = opaquefrac
+
+*       Update any brushes that used this color number
+        DO 10 brushnum = 1, maxbrushobjs
+            IF ( (brushobjs(brushnum, windowid)  .NE. nullobj) .AND.
+     .           (brushcolor(brushnum, windowid) .EQ. colornum) ) THEN
+                CALL FGDBRUSHREPLACECOLOR(success,
+     .                       brushobjs(brushnum, windowid),
+     .                       colorobjs(colornum, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                              errmsg, errmsglen)
+                ENDIF
+            ENDIF
+   10   CONTINUE
+
+*       Update any pens that used this color number
+        DO 20 pennum = 1, maxpenobjs
+            IF ( (penobjs(pennum, windowid)  .NE. nullobj) .AND.
+     .           (pencolor(pennum, windowid) .EQ. colornum) ) THEN
+                CALL FGDPENREPLACECOLOR(success,
+     .                     penobjs(pennum, windowid),
+     .                     colorobjs(colornum, windowid))
+                IF ( success .EQ. 0 ) THEN
+                    errmsg = ' '
+                    CALL FGDERRMSG(errmsg, errmsglen)
+                    CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                              errmsg, errmsglen)
+                ENDIF
+            ENDIF
+   20   CONTINUE
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsds.F b/fer/grdel/fgd_gsds.F
new file mode 100644
index 0000000..bf4ac06
--- /dev/null
+++ b/fer/grdel/fgd_gsds.F
@@ -0,0 +1,13 @@
+*
+* Definition for GSDS (set deferral state).  Does nothing since
+* update of the display is left to the graphics engine.
+*
+
+        SUBROUTINE FGD_GSDS(windowid, deferralmode, regenmode)
+
+        IMPLICIT NONE
+        INTEGER windowid, deferralmode, regenmode
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gselnt.F b/fer/grdel/fgd_gselnt.F
new file mode 100644
index 0000000..d233d91
--- /dev/null
+++ b/fer/grdel/fgd_gselnt.F
@@ -0,0 +1,62 @@
+*
+* Select current (normalization) transformation number
+*
+
+        SUBROUTINE FGD_GSELNT(transnum)
+
+        IMPLICIT NONE
+        INTEGER transnum
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        REAL*4 lftfrac, rgtfrac, btmfrac, topfrac,
+     .         lftcoord, rgtcoord, btmcoord, topcoord
+        INTEGER clipit, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks - transform 0 is an implicit identity transform
+        IF ( (transnum .LT. 0) .OR.
+     .       (transnum .GT. maxtransforms) ) THEN
+            STOP 'FGD_GSELNT: Invalid transnum value'
+        ENDIF
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSELNT: No active window'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GSELNT: null active windowobj'
+        ENDIF
+
+*       Set this transform number to be the active one
+        activetransform = transnum
+
+*       Get the view limits of this transform
+        CALL FGD_GET_VIEW_LIMITS(lftfrac, rgtfrac, btmfrac, topfrac,
+     .                       lftcoord, rgtcoord, btmcoord, topcoord)
+
+*       End any view that may currently be active
+*       There might not be one started, so ignore any errors
+        CALL FGDVIEWEND(success, windowobjs(activewindow))
+
+*       Begin the new view
+        IF ( cliptoview(activewindow) ) THEN
+            clipit = 1
+        ELSE
+            clipit = 0
+        ENDIF
+        CALL FGDVIEWBEGIN(success, windowobjs(activewindow),
+     .                    lftfrac, btmfrac, rgtfrac, topfrac,
+     .                    clipit)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        somethingdrawn = .FALSE.
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsfaci.F b/fer/grdel/fgd_gsfaci.F
new file mode 100644
index 0000000..5cdfa84
--- /dev/null
+++ b/fer/grdel/fgd_gsfaci.F
@@ -0,0 +1,19 @@
+*
+* Set the color to use when creating a temporary brush.
+* This unsets the active brush.
+* (set fill area color index)
+*
+
+        SUBROUTINE FGD_GSFACI(colorindex)
+
+        IMPLICIT NONE
+        INTEGER colorindex
+
+        INCLUDE 'fgrdel.cmn'
+
+        lastbrushcolor = colorindex + 1
+        activebrush = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsfai.F b/fer/grdel/fgd_gsfai.F
new file mode 100644
index 0000000..f2c8c07
--- /dev/null
+++ b/fer/grdel/fgd_gsfai.F
@@ -0,0 +1,30 @@
+*
+* Set the active brush.
+* (set fill area index)
+*
+
+        SUBROUTINE FGD_GSFAI(brushnum)
+
+        IMPLICIT NONE
+        INTEGER brushnum
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSFAI: No active window'
+        ENDIF
+        IF ( (brushnum .LT. 1) .OR.
+     .       (brushnum .GT. maxbrushobjs) ) THEN
+            STOP 'FGD_GSFAI: Invalid brushnum'
+        ENDIF
+        IF ( brushobjs(brushnum, activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GSFAI: null brushobj'
+        ENDIF
+
+        activebrush = brushnum
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsfais.F b/fer/grdel/fgd_gsfais.F
new file mode 100644
index 0000000..a05870d
--- /dev/null
+++ b/fer/grdel/fgd_gsfais.F
@@ -0,0 +1,29 @@
+*
+* Set the fill style to use when creating a temporary brush.
+* This unsets the active brush.
+* (set fill area interior style)
+*
+
+        SUBROUTINE FGD_GSFAIS(style)
+
+        IMPLICIT NONE
+        INTEGER style
+
+        INCLUDE 'fgrdel.cmn'
+
+        IF ( style .EQ. 1 ) THEN
+*           Solid brush
+            lastbrushstyle = 'solid'
+            lastbstylen = 5
+        ELSE IF ( style .EQ. 3 ) THEN
+*           Hatch brush - default to diagcross
+            lastbrushstyle = 'diagcross'
+            lastbstylen = 9
+        ELSE
+            STOP 'FGD_GSFAIS: Invalid style'
+        ENDIF
+        activebrush = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsfar.F b/fer/grdel/fgd_gsfar.F
new file mode 100644
index 0000000..006bf2c
--- /dev/null
+++ b/fer/grdel/fgd_gsfar.F
@@ -0,0 +1,100 @@
+*
+* Creates a Brush object.
+* (set fill area representation)
+*
+
+        SUBROUTINE FGD_GSFAR(windowid, brushnum,
+     .                       style, hstyle, colorndx)
+
+        IMPLICIT NONE
+        INTEGER windowid, brushnum, style, hstyle, colorndx
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, success, errmsglen, bstylen
+        CHARACTER*2048 errmsg
+        CHARACTER*64 brushstyle
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSFAR: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSFAR: null windowobj'
+        ENDIF
+        IF ( (brushnum .LT. 1) .OR.
+     .       (brushnum .GT. maxbrushobjs) ) THEN
+            STOP 'FGD_GSFAR: Invalid brushnum'
+        ENDIF
+        IF ( (colorndx .LT. 0) .OR.
+     .       (colorndx .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_GSFAR: Invalid colorndx'
+        ENDIF
+        colornum = colorndx + 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSFAR: null colorobj'
+        ENDIF
+
+        IF ( style .EQ. 1 ) THEN
+*           Solid brush
+            brushstyle = "solid"
+            bstylen = 5
+        ELSE IF ( style .EQ. 3 ) THEN
+*           Hatch brush styles
+            IF ( hstyle .EQ. 1 ) THEN
+                brushstyle = "hor"
+                bstylen = 3
+            ELSE IF ( hstyle .EQ. 2 ) THEN
+                brushstyle = "fdiag"
+                bstylen = 5
+            ELSE IF ( hstyle .EQ. 3 ) THEN
+                brushstyle = "ver"
+                bstylen = 3
+            ELSE IF ( hstyle .EQ. 4 ) THEN
+                brushstyle = "bdiag"
+                bstylen = 5
+            ELSE IF ( hstyle .EQ. 5 ) THEN
+                brushstyle = "cross"
+                bstylen = 5
+            ELSE IF ( hstyle .EQ. 6 ) THEN
+                brushstyle = "diagcross"
+                bstylen = 9
+            ELSE
+                STOP 'FGD_GSFAR: Invalid hstyle'
+            ENDIF
+        ELSE
+            STOP 'FGD_GSFAR: Invalid style'
+        ENDIF
+
+*       If a brush object already exists, delete it
+        IF ( brushobjs(brushnum, windowid) .NE. nullobj ) THEN
+            CALL FGDBRUSHDEL(success, brushobjs(brushnum, windowid))
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+            brushobjs(brushnum, windowid) = nullobj
+        ENDIF
+
+*       Create the new brush object
+        CALL FGDBRUSH(brushobjs(brushnum, windowid),
+     .                windowobjs(windowid),
+     .                colorobjs(colornum, windowid),
+     .                brushstyle, bstylen)
+
+        IF ( brushobjs(brushnum, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        brushcolor(brushnum, windowid) = colornum
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsfasi.F b/fer/grdel/fgd_gsfasi.F
new file mode 100644
index 0000000..c348228
--- /dev/null
+++ b/fer/grdel/fgd_gsfasi.F
@@ -0,0 +1,39 @@
+*
+* Set the hatch style to use when creating a temporary brush.
+* This unsets the active brush.
+* (set fill area style index)
+*
+
+        SUBROUTINE FGD_GSFASI(hstyle)
+
+        IMPLICIT NONE
+        INTEGER hstyle
+
+        INCLUDE 'fgrdel.cmn'
+
+        IF ( hstyle .EQ. 1 ) THEN
+            lastbrushstyle = "hor"
+            lastbstylen = 3
+        ELSE IF ( hstyle .EQ. 2 ) THEN
+            lastbrushstyle = "fdiag"
+            lastbstylen = 5
+        ELSE IF ( hstyle .EQ. 3 ) THEN
+            lastbrushstyle = "ver"
+            lastbstylen = 3
+        ELSE IF ( hstyle .EQ. 4 ) THEN
+            lastbrushstyle = "bdiag"
+            lastbstylen = 5
+        ELSE IF ( hstyle .EQ. 5 ) THEN
+            lastbrushstyle = "cross"
+            lastbstylen = 5
+        ELSE IF ( hstyle .EQ. 6 ) THEN
+            lastbrushstyle = "diagcross"
+            lastbstylen = 9
+        ELSE
+            STOP 'FGD_GSFASI: Invalid hstyle'
+        ENDIF
+        activebrush = 0
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gslcm.F b/fer/grdel/fgd_gslcm.F
new file mode 100644
index 0000000..9e3a40d
--- /dev/null
+++ b/fer/grdel/fgd_gslcm.F
@@ -0,0 +1,14 @@
+*
+* Definition of GSLCM
+* (set locator mode)
+* DOes nothing as input functions are not supported at this time
+*
+
+        SUBROUTINE FGD_GSLCM(windowid, locdevnum, opermode, echomode)
+
+        IMPLICIT NONE
+        INTEGER windowid, locdevnum, opermode, echomode
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gspli.F b/fer/grdel/fgd_gspli.F
new file mode 100644
index 0000000..713b72f
--- /dev/null
+++ b/fer/grdel/fgd_gspli.F
@@ -0,0 +1,30 @@
+*
+* Set the active pen of the active window
+* (set polyline index)
+*
+
+        SUBROUTINE FGD_GSPLI(pennum)
+
+        IMPLICIT NONE
+        INTEGER pennum
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSPLI: No active window'
+        ENDIF
+        IF ( (pennum .LT. 1) .OR.
+     .       (pennum .GT. maxpenobjs) ) THEN
+            STOP 'FGD_GSPLI: Invalid pennum'
+        ENDIF
+        IF ( penobjs(pennum, activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPLI: null penobj'
+        ENDIF
+
+        activepen = pennum
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsplr.F b/fer/grdel/fgd_gsplr.F
new file mode 100644
index 0000000..758d9df
--- /dev/null
+++ b/fer/grdel/fgd_gsplr.F
@@ -0,0 +1,93 @@
+*
+* Create a pen object.  (set polyline representation)
+*
+* The linewidth in GSK was a factor, so not very clear
+* what the units should be.  The line widths in PyFerret
+* are in units of points (1/72 inches); possibly further 
+* scaled by the line width scaling factor.
+*
+
+        SUBROUTINE FGD_GSPLR(windowid, pennum, linestyle,
+     .                       linewidth, colorindex)
+
+        IMPLICIT NONE
+        INTEGER windowid, pennum, linestyle, colorindex
+        REAL*4 linewidth
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, stylen, cstylen, jstylen,
+     .          success, errmsglen
+        CHARACTER*64 stylename, capstyle, joinstyle
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSPLR: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPLR: null windowobj'
+        ENDIF
+        IF ( (pennum .LT. 1) .OR. (pennum .GT. maxpenobjs) ) THEN
+            STOP 'FGD_GSPLR: Invalid pennum'
+        ENDIF
+        IF ( (colorindex .LT. 0) .OR.
+     .       (colorindex .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_GSPLR: Invalid colorindex'
+        ENDIF
+
+        colornum = colorindex + 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPLR: null colorobj'
+        ENDIF
+
+*       Line type
+        IF ( linestyle .EQ. 1 ) THEN
+            stylename = 'solid'
+            stylen = 5
+        ELSE IF ( linestyle .EQ. 2 ) THEN
+            stylename = 'dash'
+            stylen = 4
+        ELSE IF ( linestyle .EQ. 3 ) THEN
+            stylename = 'dot'
+            stylen = 3
+        ELSE IF ( linestyle .EQ. 4 ) THEN
+            stylename = 'dashdot'
+            stylen = 7
+        ELSE
+            STOP 'FGD_GSPLR: invalid linestyle'
+        ENDIF
+        capstyle = 'square'
+        cstylen = 6
+        joinstyle = 'bevel'
+        jstylen = 5
+
+*       If a pen object already exists, delete it
+        IF ( penobjs(pennum, windowid) .NE. nullobj ) THEN
+            CALL FGDPENDEL(success, penobjs(pennum, windowid))
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+            penobjs(pennum, windowid) = nullobj
+        ENDIF
+
+*       Create the new pen object
+        CALL FGDPEN(penobjs(pennum, windowid), windowobjs(windowid),
+     .          colorobjs(colornum, windowid), linewidth, stylename,
+     .          stylen, capstyle, cstylen, joinstyle, jstylen)
+        IF ( penobjs(pennum, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        pencolor(pennum, windowid) = colornum
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gspmi.F b/fer/grdel/fgd_gspmi.F
new file mode 100644
index 0000000..376754d
--- /dev/null
+++ b/fer/grdel/fgd_gspmi.F
@@ -0,0 +1,30 @@
+*
+* Set the active symbol of the active window
+* (set polymarker index)
+*
+
+        SUBROUTINE FGD_GSPMI(symbolnum)
+
+        IMPLICIT NONE
+        INTEGER symbolnum
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR.
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSPMI: Invalid activewindow'
+        ENDIF
+        IF ( (symbolnum .LT. 1) .OR.
+     .       (symbolnum .GT. maxsymbolobjs) ) THEN
+            STOP 'FGD_GSPMI: Invalid symbolnum'
+        ENDIF
+        IF ( symbolobjs(symbolnum, activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPMI: null symbolobj'
+        ENDIF
+
+        activesymbol = symbolnum
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gspmr.F b/fer/grdel/fgd_gspmr.F
new file mode 100644
index 0000000..8a07b63
--- /dev/null
+++ b/fer/grdel/fgd_gspmr.F
@@ -0,0 +1,107 @@
+*
+* Create a symbol object.
+* (set polymarker representation)
+*
+* The marker size in GSK was a factor, so not very clear
+* what the units should be.  The marker size in PyFerret
+* are in units of points (1/72 inches); possibly further 
+* scaled by the line width scaling factor.
+*
+
+        SUBROUTINE FGD_GSPMR(windowid, symnum, 
+     .                 symtype, symsize, colorindex)
+
+        IMPLICIT NONE
+        INTEGER windowid, symnum, symtype, colorindex
+        REAL*4 symsize
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, snlen, success, errmsglen
+        CHARACTER*8 symname
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSPMR: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPMR: null windowobj'
+        ENDIF
+        IF ( (symnum .LT. 1) .OR.
+     .       (symnum .GT. maxsymbolobjs) ) THEN
+            STOP 'FGD_GSPMR: Invalid symnum'
+        ENDIF
+        IF ( (colorindex .LT. 0) .OR.
+     .       (colorindex .GE. maxcolorobjs) ) THEN
+            STOP 'FGD_GSPMR: Invalid colorindex'
+        ENDIF
+
+        colornum = colorindex + 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSPMR: null colorobj'
+        ENDIF
+
+*       symbol types
+        IF ( symtype .EQ. 1 ) THEN
+*           small filled circle
+            symname = '.'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 2 ) THEN
+*           plus
+            symname = '+'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 3 ) THEN
+*           asterisk
+            symname = '*'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 4 ) THEN
+*           open circle
+            symname = 'o'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 5 ) THEN
+*           ex
+            symname = 'x'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 6 ) THEN
+*           triangle
+            symname = '^'
+            snlen = 1
+        ELSE IF ( symtype .EQ. 7 ) THEN
+*           square
+            symname = '#'
+            snlen = 1
+        ELSE
+            STOP 'FGD_GSPMR: invalid symtype'
+        ENDIF
+
+*       If a symbol object already exists, delete it
+        IF ( symbolobjs(symnum, windowid) .NE. nullobj ) THEN
+            CALL FGDSYMBOLDEL(success, symbolobjs(symnum, windowid))
+            IF ( success .EQ. 0 ) THEN
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, err_lun,
+     .                          errmsg, errmsglen)
+            ENDIF
+            symbolobjs(symnum, windowid) = nullobj
+        ENDIF
+
+*       Create the symbol object
+        CALL FGDSYMBOL(symbolobjs(symnum, windowid),
+     .                 windowobjs(windowid), symname, snlen)
+        IF ( symbolobjs(symnum, windowid) .EQ. nullobj ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        symbolcolor(symnum, windowid) = colornum
+        symbolsize(symnum, windowid) = symsize
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_gsvp.F b/fer/grdel/fgd_gsvp.F
new file mode 100644
index 0000000..f2675c9
--- /dev/null
+++ b/fer/grdel/fgd_gsvp.F
@@ -0,0 +1,65 @@
+*
+* Set the view fractions for a view transformation
+* (view limits in terms of normalized device coordinates)
+*
+
+        SUBROUTINE FGD_GSVP(transnum, xmin, xmax, ymin, ymax)
+
+        IMPLICIT NONE
+        INTEGER transnum
+        REAL*4 xmin, xmax, ymin, ymax
+
+        INCLUDE 'fgrdel.cmn'
+
+        REAL*4 EPSIL, modxmin, modxmax, modymin, modymax
+        PARAMETER (EPSIL = 1.0E-4)
+
+*       Sanity checks - transform 0 is implicit identity
+        IF ( (transnum .LT. 1) .OR.
+     .       (transnum .GT. maxtransforms) ) THEN
+            STOP 'FGD_GSVP: Invalid transnum value'
+        ENDIF
+
+*       Allow some tolerance for floating point error
+        IF ( (xmin .LT. 0.0) .AND. (xmin .GT. 0.0-EPSIL) ) THEN
+           modxmin = 0.0
+        ELSE
+           modxmin = xmin
+        ENDIF
+        IF ( (xmax .GT. 1.0) .AND. (xmax .LT. 1.0+EPSIL) ) THEN
+           modxmax = 1.0
+        ELSE
+           modxmax = xmax
+        ENDIF
+        IF ( (ymin .LT. 0.0) .AND. (ymin .GT. 0.0-EPSIL) ) THEN
+           modymin = 0.0
+        ELSE
+           modymin = ymin
+        ENDIF
+        IF ( (ymax .GT. 1.0) .AND. (ymax .LT. 1.0+EPSIL) ) THEN
+           modymax = 1.0
+        ELSE
+           modymax = ymax
+        ENDIF
+
+        IF ( (0.0 .GT. modxmin) .OR.
+     .       (modxmin .GE. modxmax) .OR.
+     .       (modxmax .GT. 1.0) ) THEN
+            WRITE(*,*) 'FGD_GSVP: xmin = ', xmin, ', xmax = ', xmax
+            STOP 'FGD_GSVP: invalid xmin, xmax values'
+        ENDIF
+        IF ( (0.0 .GT. modymin) .OR.
+     .       (modymin .GE. modymax) .OR.
+     .       (modymax .GT. 1.0) ) THEN
+            WRITE(*,*) 'FGD_GSVP: ymin = ', ymin, ', ymax = ', ymax
+            STOP 'FGD_GSVP: invalid ymin, ymax values'
+        ENDIF
+
+        viewleftfrac(transnum) = modxmin
+        viewrightfrac(transnum) = modxmax
+        viewbottomfrac(transnum) = modymin
+        viewtopfrac(transnum) = modymax
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gsvpip.F b/fer/grdel/fgd_gsvpip.F
new file mode 100644
index 0000000..21018c4
--- /dev/null
+++ b/fer/grdel/fgd_gsvpip.F
@@ -0,0 +1,14 @@
+*
+* Definition of GSVPIP
+* (set viewport input priority)
+* Does nothing since input functions are not supported.
+*
+
+        SUBROUTINE FGD_GSVPIP(transnum, reftransnum, relpriority)
+
+        IMPLICIT NONE
+        INTEGER transnum, reftransnum, relpriority
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gswkvp.F b/fer/grdel/fgd_gswkvp.F
new file mode 100644
index 0000000..02c7cc2
--- /dev/null
+++ b/fer/grdel/fgd_gswkvp.F
@@ -0,0 +1,59 @@
+*
+* Set the size of the viewer window.
+* (set workstation viewport)
+* Coordinates are given in meters.
+* Only the height and width are used;
+* the absolute positions are ignored.
+*
+
+        SUBROUTINE FGD_GSWKVP(windowid, xmin, xmax, ymin, ymax)
+
+        IMPLICIT NONE
+        INTEGER windowid
+        REAL*4 xmin, xmax, ymin, ymax
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        REAL*4 newwidth, newheight
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSWKVP: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GSWKVP: null windowobj'
+        ENDIF
+
+*       Compute the window width and height in inches
+*       Assume a half inch minimum for the width and height
+        newwidth = (xmax - xmin) * (1000.0 / 25.4)
+        IF ( newwidth .LE. 0.5 ) THEN
+            STOP 'FGD_GSWKVP: invalid width'
+        ENDIF
+        newheight = (ymax - ymin) * (1000.0 / 25.4)
+        IF ( newheight .LE. 0.5 ) THEN
+            STOP 'FGD_GSWKVP: invalid height'
+        ENDIF
+        windowwidth(windowid) = newwidth
+        windowheight(windowid) = newheight
+
+*       Resize the window - uses units of pixels
+        newwidth = newwidth * windowdpix(windowid)
+        newheight = newheight * windowdpiy(windowid)
+        CALL FGDWINSETSIZE(success, windowobjs(windowid),
+     .                     newwidth, newheight)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gswkwn.F b/fer/grdel/fgd_gswkwn.F
new file mode 100644
index 0000000..429d29d
--- /dev/null
+++ b/fer/grdel/fgd_gswkwn.F
@@ -0,0 +1,44 @@
+*
+* Define the normalized device coordinates limits for the full window.
+* (set workstation window)
+* In other words: the full window, instead of
+* going from zero to one for X and Y, 
+* it goes from xmin to xmax for X 
+*          and ymin to ymax for Y
+* Ferret always sets xmin and ymin to zero,
+* and either xmax or ymax to one, with the other to (0.0,1.0],
+* thus used to adjust for the aspect ratio of the monitor.
+*
+
+        SUBROUTINE FGD_GSWKWN(windowid, xmin, xmax, ymin, ymax)
+
+        IMPLICIT NONE
+        INTEGER windowid
+        REAL*4 xmin, xmax, ymin, ymax
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GSWKWN: Invalid windowid value'
+        ENDIF
+        IF ( xmin .NE. 0.0 ) THEN
+            STOP 'FGD_GSWKWN: Unexpected non-zero xmin'
+        ENDIF
+        IF ( ymin .NE. 0.0 ) THEN
+            STOP 'FGD_GSWKWN: Unexpected non-zero ymin'
+        ENDIF
+        IF ( xmax .GT. 1.0 ) THEN
+            STOP 'FGD_GSWKWN: Unexpected xmax greater than one'
+        ENDIF
+        IF ( ymax .GT. 1.0 ) THEN
+            STOP 'FGD_GSWKWN: Unexpected ymax greater than one'
+        ENDIF
+
+        ndcxmax(windowid) = xmax
+        ndcymax(windowid) = ymax
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_gswn.F b/fer/grdel/fgd_gswn.F
new file mode 100644
index 0000000..7f62610
--- /dev/null
+++ b/fer/grdel/fgd_gswn.F
@@ -0,0 +1,34 @@
+*
+* Set the user (world) coordinates for a view transformation
+*
+
+        SUBROUTINE FGD_GSWN(transnum, xmin, xmax, ymin, ymax)
+
+        IMPLICIT NONE
+        INTEGER transnum
+        REAL*4 xmin, xmax, ymin, ymax
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Sanity checks - transform 0 is implicit identity
+        IF ( (transnum .LT. 1) .OR.
+     .       (transnum .GT. maxtransforms) ) THEN
+            STOP 'FGD_GSWN: Invalid transnum value'
+        ENDIF
+        IF ( (xmax - xmin) .LE. 0.0 ) THEN
+            WRITE(*,*) 'FGD_GSWN: xmin = ', xmin, ', xmax = ', xmax
+            STOP 'FGD_GSWN: invalid xmin, xmax values'
+        ENDIF
+        IF ( (ymax - ymin) .LE. 0.0 ) THEN
+            WRITE(*,*) 'FGD_GSWN: ymin = ', ymin, ', ymax = ', ymax
+            STOP 'FGD_GSWN: invalid ymin, ymax values'
+        ENDIF
+
+        viewleftcoord(transnum) = xmin
+        viewrightcoord(transnum) = xmax
+        viewbottomcoord(transnum) = ymin
+        viewtopcoord(transnum) = ymax
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_guwk.F b/fer/grdel/fgd_guwk.F
new file mode 100644
index 0000000..a981693
--- /dev/null
+++ b/fer/grdel/fgd_guwk.F
@@ -0,0 +1,53 @@
+*
+* Update a Window.
+* Also ensures the window is visible
+* (if appropriate for the engine).
+*
+* Input arguments:
+*    windowid: window ID number to update
+*    regenflag: ignored
+*
+
+        SUBROUTINE FGD_GUWK(windowid, regenflag)
+
+        IMPLICIT NONE
+        INTEGER windowid
+        INTEGER regenflag
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER showit, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_GUWK: Invalid windowid'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_GUWK: null windowobj'
+        ENDIF
+
+*       Make the call to update the graphics
+        CALL FGDWINUPDATE(success, windowobjs(windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+*       Make the call to show the window (ignored if not appropriate)
+        showit = 1
+        CALL FGDWINSETVIS(success, windowobjs(windowid), showit)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_redraw_background.F b/fer/grdel/fgd_redraw_background.F
new file mode 100644
index 0000000..9dd9816
--- /dev/null
+++ b/fer/grdel/fgd_redraw_background.F
@@ -0,0 +1,45 @@
+*
+* Redraw the current image using the current color zero
+* (colornum one) as the background color.
+*
+
+        SUBROUTINE FGD_REDRAW_BACKGROUND(windowid)
+
+        IMPLICIT NONE
+        INTEGER windowid, colorindex
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER colornum, success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_REDRAW_BACKGROUND: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_REDRAW_BACKGROUND: null windowobj'
+        ENDIF
+
+*       Background color is always color zero = colornum one
+        colornum = 1
+        IF ( colorobjs(colornum, windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_REDRAW_BACKGROUND: invalid colorindex'
+        ENDIF
+
+*       Redraw the contents of the window with this background color
+        CALL FGDWINREDRAW(success, windowobjs(windowid), 
+     .                    colorobjs(colornum, windowid))
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_save_window.F b/fer/grdel/fgd_save_window.F
new file mode 100644
index 0000000..d9686f5
--- /dev/null
+++ b/fer/grdel/fgd_save_window.F
@@ -0,0 +1,76 @@
+*
+* Save the active window graphics to file.
+* This is intended to be used as the alternative
+* of writing a GKS metafile by PlotPlus.
+*
+* Input Arguments:
+*     windowid: ID number of the Window to be closed
+*
+        SUBROUTINE FGD_SAVE_WINDOW(filename)
+
+        IMPLICIT NONE
+        CHARACTER*(*) filename
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'xplot_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+*       Function return value definition
+        INTEGER TM_LENSTR
+
+*       Local variables
+        INTEGER fnamelen, fmtlen, transpbkg, success, errmsglen
+        REAL*4 xinches, yinches
+        INTEGER xpixels, ypixels
+        CHARACTER*8 fformat
+        CHARACTER*2048 errmsg
+        REAL*8 memory(2)
+        INTEGER firststr, numstrs
+
+*       Sanity checks
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_SAVE_WINDOW: Invalid activewindow value'
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            STOP 'FGD_SAVE_WINDOW: null windowobj'
+        ENDIF
+*       Get the length of the filename
+        fnamelen = TM_LENSTR(filename)
+        IF ( fnamelen .LE. 0 ) THEN
+            STOP 'FGD_SAVE_WINDOW: empty filename'
+        ENDIF
+*       Let it guess the format from the filename extension
+        fformat = ' '
+        fmtlen = 0
+*       Set the background transparency from the common block value
+        IF ( savetransparent ) THEN
+            transpbkg = 1
+        ELSE
+            transpbkg = 0
+        ENDIF
+*       Save the graphics to file
+        xinches = wn_xinches(activewindow)
+        yinches = wn_yinches(activewindow)
+        xpixels = NINT(wn_xpixels(activewindow))
+        ypixels = NINT(wn_ypixels(activewindow))
+*       Just some dummy variables to indicate no annotations
+        memory(1) = 0
+        memory(2) = 0
+        firststr = 0
+        numstrs = 0
+        CALL FGDWINSAVE(success, windowobjs(activewindow), filename,
+     .                  fnamelen, fformat, fmtlen, transpbkg,
+     .                  xinches, yinches, xpixels, ypixels,
+     .                  memory, firststr, numstrs)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_send_image_scale.F b/fer/grdel/fgd_send_image_scale.F
new file mode 100644
index 0000000..c6a8588
--- /dev/null
+++ b/fer/grdel/fgd_send_image_scale.F
@@ -0,0 +1,38 @@
+*
+* Suggest to the graphics engine the initial scaling factor
+* for this window. 
+*
+
+        SUBROUTINE FGD_SEND_IMAGE_SCALE(windowid, scl)
+
+        IMPLICIT NONE
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER windowid, istat
+        REAL*4 scl
+
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+*       Sanity checks
+        IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_SEND_IMAGE_SCALE: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'FGD_SEND_IMAGE_SCALE: null windowobj'
+        ENDIF
+
+        CALL FGDWINSETSCALE(success, windowobjs(windowid), scl)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+
+        RETURN
+        END
diff --git a/fer/grdel/fgd_set_antialias.F b/fer/grdel/fgd_set_antialias.F
new file mode 100644
index 0000000..cf642ad
--- /dev/null
+++ b/fer/grdel/fgd_set_antialias.F
@@ -0,0 +1,52 @@
+*
+* Turns on or off anti-aliasing on items drawn after this call
+* in the specified window
+*
+* Input Arguments:
+*     windowid - number of the window to use
+*     aaint - if non-zero, turn on antialiasing;
+*             if zero, turn off antialiasing
+*
+        SUBROUTINE FGD_SET_ANTIALIAS(windowid, aaint)
+
+        IMPLICIT NONE
+        INTEGER windowid, aaint
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+*       Local variables
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_SET_ANTIALIAS: Invalid windowid value'
+        ENDIF
+
+*       This may be called to prior to window creation
+        IF ( windowobjs(windowid) .NE. nullobj ) THEN
+*           Update the anti-aliasing state of this window
+            CALL FGDWINSETANTIALIAS(success, 
+     .                              windowobjs(windowid), aaint)
+            IF ( success .EQ. 0 ) THEN
+*               Error - output error message
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, 
+     .                          err_lun, errmsg, errmsglen)
+            ENDIF
+        ENDIF
+
+*       Record the current anti-aliasing state
+        IF ( aaint .EQ. 0 ) THEN
+            antialias(windowid) = .FALSE.
+        ELSE
+            antialias(windowid) = .TRUE.
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_set_engine.F b/fer/grdel/fgd_set_engine.F
new file mode 100644
index 0000000..897bd1b
--- /dev/null
+++ b/fer/grdel/fgd_set_engine.F
@@ -0,0 +1,117 @@
+*
+* Set the name of the graphics engine for windows created
+* after this call. 
+*
+* Input Arguments:
+*     windowid - window number to use
+*     newname - name (or partial name) of the engine;
+*               standard recognized names are Cairo, 
+*               CAIRO, PipedViewerPQ, PIPEDVIEWERPQ, 
+*               PipedImager, and PIPEDIMAGER
+*               Need all-uppercase for /ENGINE="..."
+*     forceit - change the engine name regardless of 
+*               no-display command-line options?
+* Output Arguments:
+*     sts - FERR_OK if successful; 
+*           FERR_INVALID_COMMAND otherwise
+*
+        SUBROUTINE FGD_SET_ENGINE(windowid, newname, forceit, sts)
+
+        IMPLICIT NONE
+        CHARACTER*(*) newname
+        INTEGER windowid, sts
+        LOGICAL forceit
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'fgrdel.cmn'
+
+*       Function declarations
+        INTEGER TM_LENSTR
+
+*       Local variables
+        INTEGER slen, idx
+        CHARACTER*256 warnmsg
+
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_SET_ENGINE: Invalid windowid value'
+        ENDIF
+
+* The window will not exist at the time this is called.
+* So just set the values to use when the window is created.
+
+* Get the actual string length of new engine name
+        slen = TM_LENSTR(newname)
+
+* An empty engine name uses the default engine
+        IF ( slen .EQ. 0 ) THEN
+            enginename(windowid) = defaultenginename
+            antialias(windowid) = .TRUE.
+            thickfactor(windowid) = dflt_thicken
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+* INDEX is used to match incomplete new engine names
+        idx = INDEX('Cairo', newname(1:slen))
+        IF ( idx .NE. 1 ) THEN
+            idx = INDEX('CAIRO', newname(1:slen))
+        ENDIF
+        IF ( idx .EQ. 1 ) THEN
+            enginename(windowid) = 'Cairo'
+            antialias(windowid) = .TRUE.
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+* If a no-display command-line option was used (and thus
+* defaultenginename .EQ. 'Cairo'), do not allow other 
+* engines to be used unless forceit is .TRUE.
+        IF ( (defaultenginename .EQ. 'Cairo') .AND. .NOT. forceit ) THEN
+            warnmsg = '/QUALITY was ignored in SET WINDOW ' //
+     .          'since a no-display command-line option was given'
+            CALL WARN(warnmsg)
+            enginename(windowid) = defaultenginename
+            antialias(windowid) = .TRUE.
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+        idx = INDEX('PipedViewerPQ', newname(1:slen))
+        IF ( idx .NE. 1 ) THEN
+            idx = INDEX('PIPEDVIEWERPQ', newname(1:slen))
+        ENDIF
+        IF ( idx .EQ. 1 ) THEN
+            enginename(windowid) = 'PipedViewerPQ'
+            antialias(windowid) = .TRUE.
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+        idx = INDEX('PipedImager', newname(1:slen))
+        IF ( idx .NE. 1 ) THEN
+            idx = INDEX('PIPEDIMAGER', newname(1:slen))
+        ENDIF
+        IF ( idx .EQ. 1 ) THEN
+            enginename(windowid) = 'PipedImager'
+            antialias(windowid) = .FALSE.
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+        IF ( slen .LE. 64 ) THEN
+            warnmsg = 'Non-standard graphics engine "'
+     .                // newname(1:slen) // '"'
+            CALL WARN(warnmsg)
+            enginename(windowid) = newname
+            antialias(windowid) = .TRUE.
+            sts = FERR_OK
+            RETURN
+        ENDIF
+
+        sts = FERR_INVALID_COMMAND
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_set_thick_factor.F b/fer/grdel/fgd_set_thick_factor.F
new file mode 100644
index 0000000..6923537
--- /dev/null
+++ b/fer/grdel/fgd_set_thick_factor.F
@@ -0,0 +1,51 @@
+*
+* Assigns the scaling factor for line widths and symbol sizes
+* in the specified window
+*
+* Input Arguments:
+*     windowid - number of the window to use
+*     widthfactor - scaling factor to use
+*
+        SUBROUTINE FGD_SET_THICK_FACTOR(windowid, widthfactor)
+
+        IMPLICIT NONE
+        INTEGER windowid
+        REAL*4 widthfactor
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+*       Local variables
+        INTEGER success, errmsglen
+        CHARACTER*2048 errmsg
+
+        IF ( (windowid .LT. 1) .OR.
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'FGD_SET_THICK_FACTOR: Invalid windowid value'
+        ENDIF
+        IF ( widthfactor .LE. 0.0 ) THEN
+            STOP 'FGD_SET_THICK_FACTOR: Invalid widthfactor value'
+        ENDIF
+
+*       This may be called to prior to window creation
+        IF ( windowobjs(windowid) .NE. nullobj ) THEN
+*           Update the width scaling factor of this window
+            CALL FGDWINSETWIDTHFACTOR(success, 
+     .                    windowobjs(windowid), widthfactor)
+            IF ( success .EQ. 0 ) THEN
+*               Error - output error message
+                errmsg = ' '
+                CALL FGDERRMSG(errmsg, errmsglen)
+                CALL SPLIT_LIST(pttmode_help, 
+     .                          err_lun, errmsg, errmsglen)
+            ENDIF
+        ENDIF
+
+*       Record the width scaling factor for this window
+        thickfactor(windowid) = widthfactor
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_set_transparency.F b/fer/grdel/fgd_set_transparency.F
new file mode 100644
index 0000000..e232cf3
--- /dev/null
+++ b/fer/grdel/fgd_set_transparency.F
@@ -0,0 +1,24 @@
+*
+* Turns on or off background transparency for images saved on exit.
+*
+* Input Arguments:
+*     transint - if non-zero, save with transparent background;
+*                if zero, save with opaque background
+*
+        SUBROUTINE FGD_SET_TRANSPARENCY(transint)
+
+        IMPLICIT NONE
+        INTEGER transint
+
+        INCLUDE 'fgrdel.cmn'
+
+*       Set the value in the common block
+        IF ( transint .NE. 0 ) THEN
+           savetransparent = .TRUE.
+        ELSE
+           savetransparent = .FALSE.
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_set_unmapped_default.F b/fer/grdel/fgd_set_unmapped_default.F
new file mode 100644
index 0000000..53c89a3
--- /dev/null
+++ b/fer/grdel/fgd_set_unmapped_default.F
@@ -0,0 +1,21 @@
+*
+* Change the name of the default graphics engine and the engine for
+* all windows to a no-display engine (Cairo).  This is only called 
+* at start-up time before anything has been displayed.
+*
+        SUBROUTINE FGD_SET_UNMAPPED_DEFAULT()
+
+        IMPLICIT NONE
+
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER k
+
+        defaultenginename = 'Cairo'
+        DO 10 k = 1, maxwindowobjs
+            enginename(k) = 'Cairo'
+            antialias = .TRUE.
+   10   CONTINUE
+        RETURN
+        END
+
diff --git a/fer/grdel/fgd_setimgname.F b/fer/grdel/fgd_setimgname.F
new file mode 100644
index 0000000..e52d582
--- /dev/null
+++ b/fer/grdel/fgd_setimgname.F
@@ -0,0 +1,53 @@
+*
+* Informs the currently active window the filename (and format, dervied
+* from the filename entesion) for the image.  This may just be a default
+* filename when saving a window (for interactive graphics window), or it
+* may be the filename which is written as the drawing proceeds (for non-
+* interactive "batch mode" graphics without a display window).
+*
+* Input arguments:
+*    imgname: filename for the image
+*
+
+        SUBROUTINE FGD_SETIMGNAME(imgname, namesent)
+
+        IMPLICIT NONE
+        CHARACTER*(*) imgname
+        LOGICAL namesent
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER TM_LENSTR
+
+        INTEGER imgnamelen, fmtnamelen, success, errmsglen
+        CHARACTER*8 fmtname
+        CHARACTER*2048 errmsg
+
+*       This could be called before creating a window
+        namesent = .FALSE.
+        IF ( (activewindow .LT. 1) .OR. 
+     .       (activewindow .GT. maxwindowobjs) ) THEN
+            RETURN
+        ENDIF
+        IF ( windowobjs(activewindow) .EQ. nullobj ) THEN
+            RETURN
+        ENDIF
+
+        imgnamelen = TM_LENSTR(imgname)
+        fmtname = ' '
+        fmtnamelen = 0
+        CALL FGDWINIMGNAME(success, windowobjs(activewindow),
+     .                     imgname, imgnamelen, fmtname, fmtnamelen)
+        IF ( success .EQ. 0 ) THEN
+            errmsg = ' '
+            CALL FGDERRMSG(errmsg, errmsglen)
+            CALL SPLIT_LIST(pttmode_help, err_lun, errmsg, errmsglen)
+        ENDIF
+        namesent = .TRUE.
+
+        RETURN
+        END
+
diff --git a/fer/grdel/font.c b/fer/grdel/font.c
new file mode 100644
index 0000000..9c1f41e
--- /dev/null
+++ b/fer/grdel/font.c
@@ -0,0 +1,239 @@
+/*
+ * Font objects can only be used the Window
+ * from which they were created.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+static const char *grdelfontid = "GRDEL_FONT";
+
+typedef struct GDfont_ {
+    const char *id;
+    grdelType window;
+    grdelType object;
+} GDFont;
+
+
+/*
+ * Returns a Font object.
+ *
+ * Arguments:
+ *     window: Window in which this font is to be used
+ *     familyname: name of the font family (e.g., "Helvetica", "Times");
+ *                 NULL or an empty string uses the default font
+ *     familynamelen: actual length of the font family name
+ *     fontsize: desired size of the font View units
+ *     italic: use the italic version of the font?
+ *     bold: use the bold version of the font?
+ *     underlined: use the underlined version of the font?
+ *
+ * Returns a pointer to the font object created.  If an error occurs,
+ * NULL is returned and grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelFont(grdelType window, const char *familyname,
+               int familynamelen, float fontsize, grdelBool italic,
+               grdelBool bold, grdelBool underlined)
+{
+    const BindObj *bindings;
+    PyObject *italicbool;
+    PyObject *boldbool;
+    PyObject *underlinedbool;
+    GDFont *font;
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "grdelFont: window argument is not "
+                            "a grdel Window");
+        return NULL;
+    }
+
+    font = (GDFont *) PyMem_Malloc(sizeof(GDFont));
+    if ( font == NULL ) {
+        strcpy(grdelerrmsg, "grdelFont: out of memory for a new Font");
+        return NULL;
+    }
+
+    font->id = grdelfontid;
+    font->window = window;
+    if ( bindings->cferbind != NULL ) {
+        font->object = bindings->cferbind->createFont(bindings->cferbind,
+                                 familyname, familynamelen, (double) fontsize, 
+                                 italic, bold, underlined);
+        if ( font->object == NULL ) {
+            /* grdelerrmsg already assigned */
+            PyMem_Free(font);
+            return NULL;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        if ( italic )
+            italicbool = Py_True;
+        else
+            italicbool = Py_False;
+        if ( bold )
+            boldbool = Py_True;
+        else
+            boldbool = Py_False;
+        if ( underlined )
+            underlinedbool = Py_True;
+        else
+            underlinedbool = Py_False;
+        font->object = PyObject_CallMethod(bindings->pyobject, "createFont", 
+                                "s#dOOO", familyname, familynamelen,
+                                (double) fontsize, italicbool, boldbool,
+                                underlinedbool);
+        if ( font->object == NULL ) {
+            sprintf(grdelerrmsg, "grdelFont: error when calling the Python "
+                    "binding's createFont method: %s", pyefcn_get_error());
+            PyMem_Free(font);
+            return NULL;
+        }
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelFont: unexpected error, "
+                            "no bindings associated with this Window");
+        PyMem_Free(font);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelFont created: "
+            "window = %p, fontsize = %f, font = %p\n",
+            window, fontsize, font);
+    fflush(debuglogfile);
+#endif
+
+    return font;
+}
+
+/*
+ * Verifies font is a grdel Font.  If window is not NULL,
+ * also verifies font can be used with this Window.
+ * Returns a pointer to the graphic engine's font object
+ * if successful.  Returns NULL if there is a problem.
+ */
+grdelType grdelFontVerify(grdelType font, grdelType window)
+{
+    GDFont *myfont;
+
+    if ( font == NULL )
+        return NULL;
+    myfont = (GDFont *) font;
+    if ( myfont->id != grdelfontid )
+        return NULL;
+    if ( (window != NULL) && (myfont->window != window) )
+        return NULL;
+    return myfont->object;
+}
+
+/*
+ * Delete a Font created by grdelFont
+ *
+ * Arguments:
+ *     font: Font to be deleted
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelFontDelete(grdelType font)
+{
+    const BindObj *bindings;
+    GDFont   *myfont;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelFontDelete called: "
+            "font = %p\n", font);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelFontVerify(font, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelFontDelete: font argument is not "
+                            "a grdel Font");
+        return (grdelBool) 0;
+    }
+    myfont = (GDFont *) font;
+
+    success = 1;
+
+    bindings = grdelWindowVerify(myfont->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->deleteFont(bindings->cferbind,
+                                                 myfont->object);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* "N" - steals the reference to this font object */
+        result = PyObject_CallMethod(bindings->pyobject, "deleteFont",
+                                     "N", (PyObject *) myfont->object);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelFontDelete: error when calling "
+                    "the binding's deleteFont method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelFontDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    /* regardless of success, free this Font */
+    myfont->id = NULL;
+    myfont->window = NULL;
+    myfont->object = NULL;
+    PyMem_Free(font);
+
+    return success;
+}
+
+/*
+ * Creates a Font object.
+ *
+ * Input Arguments:
+ *     window: Window in which this font is to be used
+ *     familyname: name of the font family (e.g., "Helvetica", "Times");
+ *                 an empty string uses the default font
+ *     namelen: actual length of the font family name
+ *     fontsize: desired size of the font View units
+ *     italic: use the italic version of the font? non-zero yes, zero no.
+ *     bold: use the bold version of the font? non-zero yes, zero no.
+ *     underlined: use the underlined version of the font? non-zero yes, zero no.
+ * Output Arguments:
+ *     font: the created font object, or zero if failure.
+ *           Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdfont_(void **font, void **window, char *familyname, int *namelen,
+               float *fontsize, int *italic, int *bold, int *underlined)
+{
+    grdelType myfont;
+
+    myfont = grdelFont(*window, familyname, *namelen, *fontsize,
+                       *italic, *bold, *underlined);
+    *font = myfont;
+}
+
+/*
+ * Delete a Font created by fgdfont_
+ *
+ * Input Arguments:
+ *     font: Font to be deleted
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdfontdel_(int *success, void **font)
+{
+    grdelBool result;
+
+    result = grdelFontDelete(*font);
+    *success = result;
+}
+
diff --git a/fer/grdel/grdel.h b/fer/grdel/grdel.h
new file mode 100644
index 0000000..4c05bec
--- /dev/null
+++ b/fer/grdel/grdel.h
@@ -0,0 +1,271 @@
+#ifndef GRDEL_H_
+#define GRDEL_H_
+
+#include <Python.h>
+
+#ifdef VERBOSEDEBUG
+#include <stdio.h>
+extern FILE *debuglogfile;
+#endif
+
+/*
+ * Code for a delegate "object" for graphics calls used by Ferret/PlotPlus.
+ * Coordinates are (usually) from the bottom left corner increasing to the
+ * top right corner.
+ *
+ * All the graphics functions in this library simply call the appropriate
+ * function(s)/method(s) of the graphics library/object being used for that
+ * window.
+ *
+ * Note that in double-precision Ferret, the PlotPlus code is still single
+ * precision.  Thus all the C functions still use float, and the Fortran
+ * functions use REAL*4, for their arguments.  However, the bindings 
+ * functions use double precision; thus the C functions convert any float
+ * arguments to double for calling the bindings function.
+ */
+
+/*
+ * Opaque general graphics delegate object type.
+ * Valid objects are not NULL.
+ */
+typedef void * grdelType;
+
+/*
+ * Alias of int type to clarify when the value should be considered
+ * a boolean type.  Non-zero is considered "true", "yes", or "success".
+ * Zero is considered "false", "no", or "failure".
+ */
+typedef int grdelBool;
+
+/*
+ * Declaration of a structure to be defined
+ * (since cferbind.h includes this file).
+ */
+struct CFerBind_struct;
+
+/*
+ * Bindings for the window.  Only one of the elements
+ * will be defined and the rest will be NULL.
+ */
+typedef struct BindObj_struct {
+    struct CFerBind_struct *cferbind;
+    PyObject *pyobject;
+} BindObj;
+
+/*
+ * Global string for error messages.  When a function returns an error
+ * value, some explanatory message should be assigned to this string.
+ */
+extern char grdelerrmsg[2048];
+
+/*
+ * Fortran interface for retrieving the error message.
+ */
+void fgderrmsg_(char *errmsg, int *errmsglen);
+
+/*
+ * Prototypes of some Fortran functions called by C functions.
+ */
+void fgd_bkgcolor_(int *windowid, int *colorindex);
+void fgd_get_window_size_(float *width, float *height);
+void fgd_get_view_limits_(float *lftfrc, float *rgtfrc,
+                          float *btmfrc, float *topfrc,
+                          float *lftcrd, float *rgtcrd,
+                          float *btmcrd, float *topcrd);
+void fgd_getdpi_(int *windowid, float *dpix, float *dpiy);
+void fgd_gswkvp_(int *windowid, float *xmin, float *xmax,
+                                float *ymin, float *ymax);
+void fgd_set_unmapped_default_(void);
+void fgd_set_transparency_(int *transparent);
+void fgd_getanimate_(int *inanimation);
+
+/*
+ * "Window" refers to the full canvas; however, no drawing, except possibly
+ * clearing the window, is done on the full window.  Instead, a "View" of
+ * the Window is "begun", and drawing is done in that View of the Window.
+ */
+
+grdelType grdelWindowCreate(const char *engine, int enginelen,
+                     const char *title, int titlelen, grdelBool visible);
+const BindObj *grdelWindowVerify(grdelType window);
+grdelBool grdelWindowDelete(grdelType window);
+grdelBool grdelWindowClear(grdelType window, grdelType fillcolor);
+grdelBool grdelWindowRedraw(grdelType window, grdelType fillcolor);
+grdelBool grdelWindowSetImageName(grdelType window, const char *imagename,
+                     int imgnamelen, const char *formatname, int fmtnamelen);
+grdelBool grdelWindowUpdate(grdelType window);
+grdelBool grdelWindowSetAntialias(grdelType window, int antialias);
+grdelBool grdelWindowSetSize(grdelType window, float width, float height);
+grdelBool grdelWindowSetScale(grdelType window, float scale);
+grdelBool grdelWindowSetVisible(grdelType window, grdelBool visible);
+grdelBool grdelWindowSave(grdelType window, const char *filename,
+                          int filenamelen, const char *fileformat,
+                          int formatlen, grdelBool transparentbkg,
+                          float xinches, float yinches, 
+                          int xpixels, int ypixels,
+                          void **annotations, int numannotations);
+grdelBool grdelWindowScreenInfo(grdelType window, float *dpix, float *dpiy,
+                                int *screenwidth, int* screenheight);
+grdelBool grdelWindowSetWidthFactor(grdelType window, float widthfactor);
+
+/*
+ * Fortran interfaces for the Window functions.
+ */
+void fgdwincreate_(void **window, char *engine, int *enginelen,
+                   char *title, int *titlelen, int *visible);
+void fgdwindelete_(int *success, void **window);
+void fgdwinclear_(int *success, void **window, void **fillcolor);
+void fgdwinredraw_(int *success, void **window, void **fillcolor);
+void fgdwinupdate_(int *success, void **window);
+void fgdwinsetantialias_(int *success, void **window, int *antialias);
+void fgdwinsetsize_(int *success, void **window, float *width, float *height);
+void fgdwinsetscale_(int *success, void **window, float *scale);
+void fgdwinsetvis_(int *success, void **window, int *visible);
+void fgdwinsave_(int *success, void **window, char *filename, int *namelen,
+                 char *fileformat, int *formatlen, int *tranparentbkg,
+                 float *xinches, float *yinches, int *xpixels, int *ypixels,
+                 void **memory, int *firststr, int *numstr);
+void fgdwinscreeninfo_(int *success, void **window, float *dpix, float *dpiy,
+                       int *screenwidth, int* screenheight);
+void fgdwinsetwidthfactor_(int *success, void **window, float *widthfactor);
+
+/*
+ * A "View" refers to a rectangular subsection of the Window, possibly
+ * the full Window.  Drawing is performed after defining a View; however,
+ * coordinates are given in "device units" (pixels, using the current
+ * Window DPI, from the top left corner).  The defined View is used to
+ * set the clipping rectangle, when desired.  When drawing in this View 
+ * is complete, the View is "ended".  Only one view can be active at a 
+ * time, so switching between views requires ending one view and beginning
+ * another view.
+ */
+
+grdelBool grdelWindowViewBegin(grdelType window,
+                               float leftfrac, float bottomfrac,
+                               float rightfrac, float topfrac,
+                               int clipit);
+grdelBool grdelWindowViewClip(grdelType window, int clipit);
+grdelBool grdelWindowViewEnd(grdelType window);
+
+/*
+ * Fortran interfaces for the Window View functions.
+ */
+void fgdviewbegin_(int *success, void **window,
+                   float *leftfrac, float *bottomfrac,
+                   float *rightfrac, float *topfrac,
+                   int *clipit);
+void fgdviewclip_(int *success, void **window, int *clipit);
+void fgdviewend_(int *success, void **window);
+
+/*
+ * A segment is an collection of drawing commands with an ID.  Drawing
+ * commands in a segment can be deleted and the image recreated from
+ * the remaining drawing commands.
+ */
+grdelBool grdelWindowSegmentBegin(grdelType window, int segid);
+grdelBool grdelWindowSegmentEnd(grdelType window);
+grdelBool grdelWindowSegmentDelete(grdelType window, int segid);
+
+/*
+ * Fortran interfaces for the Window Segment functions.
+ */
+void fgdsegbegin_(int *success, void **window, int *segid);
+void fgdsegend_(int *success, void **window);
+void fgdsegdelete_(int *success, void **window, int *segid);
+
+/*
+ * All Color, Font, Pens, Brush, or Symbol objects can only be used
+ * in the Window from which they were created.
+ */
+
+grdelType grdelColor(grdelType window, float redfrac,
+               float greenfrac, float bluefrac, float opaquefrac);
+grdelType grdelColorVerify(grdelType color, grdelType window);
+grdelBool grdelColorDelete(grdelType color);
+
+grdelType grdelFont(grdelType window, const char *familyname,
+               int familynamelen, float fontsize, grdelBool italic,
+               grdelBool bold, grdelBool underlined);
+grdelType grdelFontVerify(grdelType font, grdelType window);
+grdelBool grdelFontDelete(grdelType font);
+
+grdelType grdelPen(grdelType window, grdelType color,
+               float width, const char *style, int stylelen,
+               const char *capstyle, int capstylelen,
+               const char *joinstyle, int joinstylelen);
+grdelType grdelPenVerify(grdelType pen, grdelType window);
+grdelBool grdelPenReplaceColor(grdelType brush, grdelType color);
+grdelBool grdelPenDelete(grdelType pen);
+
+grdelType grdelBrush(grdelType window,  grdelType color,
+               const char *style, int stylelen);
+grdelType grdelBrushVerify(grdelType brush, grdelType window);
+grdelBool grdelBrushReplaceColor(grdelType brush, grdelType color);
+grdelBool grdelBrushDelete(grdelType brush);
+
+grdelType grdelSymbol(grdelType window, const char *symbolname,
+               int symbolnamelen);
+grdelType grdelSymbolVerify(grdelType symbol, grdelType window);
+grdelBool grdelSymbolDelete(grdelType symbol);
+
+/*
+ * Fortran interfaces for the Color, Font, Pen, Brush, and Symbol functions.
+ */
+void fgdcolor_(void **color, void **window, float *redfrac,
+               float *greenfrac, float *bluefrac, float *opaquefrac);
+void fgdcolordel_(int *success, void **color);
+
+void fgdfont_(void **font, void **window, char *familyname, int *namelen,
+               float *fontsize, int *italic, int *bold, int *underlined);
+void fgdfontdel_(int *success, void **font);
+
+void fgdpen_(void **pen, void **window, void **color, float *width,
+               char *style, int *stylelen, char *capstyle, int *capstylelen,
+               char *joinstyle, int *joinstylelen);
+void fgdpenreplacecolor_(int *success, void **pen, void **color);
+void fgdpendel_(int *success, void **pen);
+
+void fgdbrush_(void **brush, void **window, void **color,
+               char *style, int *stylelen);
+void fgdbrushreplacecolor_(int *success, void **brush, void **color);
+void fgdbrushdel_(int *success, void **brush);
+
+void fgdsymbol_(void **symbol, void **window, char *symbolname, int *namelen);
+void fgdsymboldel_(int *success, void **symbol);
+
+/*
+ * Drawing commands
+ */
+
+grdelBool grdelDrawMultiline(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType pen);
+grdelBool grdelDrawPoints(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType symbol,
+               grdelType color, float ptsize);
+grdelBool grdelDrawPolygon(grdelType window, const float ptsx[],
+               const float ptsy[], int numpts, grdelType brush,
+               grdelType pen);
+grdelBool grdelDrawRectangle(grdelType window, float left, float bottom,
+               float right, float top, grdelType brush, grdelType pen);
+grdelBool grdelDrawText(grdelType window, const char *text, int textlen,
+               float startx, float starty, grdelType font, grdelType color,
+               float rotate);
+
+/*
+ * Fortran interfaces for the drawing commands.
+ */
+void fgddrawmultiline_(int *success, void **window, float ptsx[],
+               float ptsy[], int *numpts, void **pen);
+void fgddrawpoints_(int *success, void **window, float ptsx[],
+               float ptsy[], int *numpts, void **symbol,
+               void **color, float *ptsize);
+void fgddrawpolygon_(int *success, void **window, float ptsx[],
+               float ptsy[], int *numpts, void **brush, void **pen);
+void fgddrawrect_(int *success, void **window, float *left, float *bottom,
+               float *right, float *top, void **brush, void **pen);
+void fgddrawtext_(int *success, void **window, char *text, int *textlen,
+               float *startx, float *starty, void **font, void **color,
+               float *rotate);
+
+#endif /* GRDEL_H_ */
+
diff --git a/fer/grdel/pen.c b/fer/grdel/pen.c
new file mode 100644
index 0000000..8b7c8b3
--- /dev/null
+++ b/fer/grdel/pen.c
@@ -0,0 +1,319 @@
+/*
+ * Pen objects can only be used with the Window
+ * from which they were created.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+static const char *grdelpenid = "GRDEL_PEN";
+
+typedef struct GDpen_ {
+    const char *id;
+    grdelType window;
+    grdelType object;
+} GDPen;
+
+
+/*
+ * Returns a Pen object.
+ *
+ * Arguments:
+ *     window: Window in which this pen is to be used
+ *     color: Color to use
+ *     width: line width in units of 0.001 of the length
+ *            of the longest side of the view
+ *     style: line style name (e.g., "solid", "dash")
+ *     stylelen: actual length of the style name
+ *     capstyle: end-cap style name (e.g., "square")
+ *     capstylelen: actual length of the capstyle name
+ *     joinstyle: join style name (e.g., "bevel")
+ *     joinstylelen: actual length of the joinstyle name
+ *
+ * Returns a pointer to the pen object created.  If an error occurs,
+ * NULL is returned and grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelPen(grdelType window, grdelType color,
+                   float width, const char *style, int stylelen,
+                   const char *capstyle, int capstylelen,
+                   const char *joinstyle, int joinstylelen)
+{
+    const BindObj *bindings;
+    grdelType colorobj;
+    GDPen    *pen;
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "grdelPen: window argument is not "
+                            "a grdel Window");
+        return NULL;
+    }
+    colorobj = grdelColorVerify(color, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelPen: color argument is not "
+                            "a valid grdel Color for the window");
+        return NULL;
+    }
+
+    pen = (GDPen *) PyMem_Malloc(sizeof(GDPen));
+    if ( pen == NULL ) {
+        strcpy(grdelerrmsg, "grdelPen: out of memory for a new Pen");
+        return NULL;
+    }
+
+    pen->id = grdelpenid;
+    pen->window = window;
+    if ( bindings->cferbind != NULL ) {
+        pen->object = bindings->cferbind->createPen(bindings->cferbind,
+                                colorobj, (double) width, style, stylelen,
+                                capstyle, capstylelen, joinstyle, joinstylelen);
+        if ( pen->object == NULL ) {
+            /* grdelerrmsg already assigned */
+            PyMem_Free(pen);
+            return NULL;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        pen->object = PyObject_CallMethod(bindings->pyobject, "createPen",
+                               "Ods#s#s#", (PyObject *) colorobj,
+                               (double) width, style, stylelen, capstyle,
+                               capstylelen, joinstyle, joinstylelen);
+        if ( pen->object == NULL ) {
+            sprintf(grdelerrmsg, "grdelPen: error when calling the Python "
+                    "binding's createPen method: %s", pyefcn_get_error());
+            PyMem_Free(pen);
+            return NULL;
+        }
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelPen: unexpected error, "
+                            "no bindings associated with this Window");
+        PyMem_Free(pen);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelPen created: "
+            "window = %p, color = %p, width = %f, pen = %p\n",
+            window, color, width, pen);
+    fflush(debuglogfile);
+#endif
+
+    return pen;
+}
+
+/*
+ * Verifies pen is a grdel Pen.  If window is not NULL,
+ * also verifies pen can be used with this Window.
+ * Returns a pointer to the graphic engine's pen object
+ * if successful.  Returns NULL if there is a problem.
+ */
+grdelType grdelPenVerify(grdelType pen, grdelType window)
+{
+    GDPen *mypen;
+
+    if ( pen == NULL )
+        return NULL;
+    mypen = (GDPen *) pen;
+    if ( mypen->id != grdelpenid )
+        return NULL;
+    if ( (window != NULL) && (mypen->window != window) )
+        return NULL;
+    return mypen->object;
+}
+
+/*
+ * Replace the color in the given pen object with that in
+ * the given color object.
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool grdelPenReplaceColor(grdelType pen, grdelType color)
+{
+    const BindObj *bindings;
+    GDPen     *mypen;
+    grdelType *colorobj;
+    grdelBool  success;
+    PyObject  *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelPenReplaceColor called: "
+            "pen = %p, color = %p\n", pen, color);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelPenVerify(pen, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelPenReplaceColor: pen argument is not "
+                            "a grdel Pen");
+        return 0;
+    }
+    mypen = (GDPen *) pen;
+
+    colorobj = grdelColorVerify(color, mypen->window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelPenReplaceColor: color argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mypen->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->replacePenColor(bindings->cferbind,
+                                                mypen->object, colorobj);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        result = PyObject_CallMethod(bindings->pyobject, "replacePenColor",
+                                     "OO", (PyObject *) mypen->object,
+                                           (PyObject *) colorobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelPenDelete: error when calling the "
+                    "Python binding's replacePenColor method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelPenReplaceColor: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    return success;
+}
+
+/*
+ * Delete a Pen created by grdelPen
+ *
+ * Arguments:
+ *     pen: Pen to be deleted
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelPenDelete(grdelType pen)
+{
+    const BindObj *bindings;
+    GDPen    *mypen;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelPenDelete called: "
+            "pen = %p\n", pen);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelPenVerify(pen, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelPenDelete: pen argument is not "
+                            "a grdel Pen");
+        return 0;
+    }
+    mypen = (GDPen *) pen;
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mypen->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->deletePen(bindings->cferbind,
+                                                mypen->object);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* "N" - steals the reference to this pen object */
+        result = PyObject_CallMethod(bindings->pyobject, "deletePen",
+                                     "N", (PyObject *) mypen->object);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelPenDelete: error when calling the Python "
+                    "binding's deletePen method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelPenDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    /* regardless of success, free this Pen */
+    mypen->id = NULL;
+    mypen->window = NULL;
+    mypen->object = NULL;
+    PyMem_Free(mypen);
+
+    return success;
+}
+
+/*
+ * Creates a Pen object.
+ *
+ * Input Arguments:
+ *     window: Window in which this pen is to be used
+ *     color: Color to use
+ *     width: line width in units of 0.001 of the length
+ *            of the longest side of the view
+ *     style: line style name (e.g., "solid", "dash")
+ *     stylelen: actual length of the style name
+ *     capstyle: end-cap style name (e.g., "square")
+ *     capstylelen: actual length of the capstyle name
+ *     joinstyle: join style name (e.g., "bevel")
+ *     joinstylelen: actual length of the joinstyle name
+ * Output Arguments:
+ *     pen: the created pen object, or zero if failure.
+ *             Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdpen_(void **pen, void **window, void **color, float *width,
+             char *style, int *stylelen, char *capstyle, int *capstylelen,
+             char *joinstyle, int *joinstylelen)
+{
+    grdelType mypen;
+
+    mypen = grdelPen(*window, *color, *width, style, *stylelen,
+                     capstyle, *capstylelen, joinstyle, *joinstylelen);
+    *pen = mypen;
+}
+
+/*
+ * Replace a color used in a pen
+ *
+ * Input Arguments:
+ *     pen: Pen to be modified
+ *     color: new Color to use in pen
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdpenreplacecolor_(int *success, void **pen, void **color)
+{
+    grdelBool result;
+
+    result = grdelPenReplaceColor(*pen, *color);
+    *success = result;
+}
+
+/*
+ * Deletes a Pen created by fgdpen_
+ *
+ * Input Arguments:
+ *     pen: Pen to be deleted
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdpendel_(int *success, void **pen)
+{
+    grdelBool result;
+
+    result = grdelPenDelete(*pen);
+    *success = result;
+}
+
diff --git a/fer/grdel/symbol.c b/fer/grdel/symbol.c
new file mode 100644
index 0000000..563729f
--- /dev/null
+++ b/fer/grdel/symbol.c
@@ -0,0 +1,208 @@
+/*
+ * Symbol objects can only be used with the Window
+ * from which they were created.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+static const char *grdelsymbolid = "GRDEL_SYMBOL";
+
+typedef struct GDsymbol_ {
+    const char *id;
+    grdelType window;
+    grdelType object;
+} GDSymbol;
+
+
+/*
+ * Returns a Symbol object.
+ *
+ * Arguments:
+ *     window: Window in which this symbol is to be used
+ *     symbolname: name of the symbol (e.g., ".", "+")
+ *     symbolnamelen: actual length of the symbol name
+ *
+ * Returns a pointer to the symbol object created.  If an error occurs,
+ * NULL is returned and grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelSymbol(grdelType window, const char *symbolname,
+                      int symbolnamelen)
+{
+    const BindObj *bindings;
+    GDSymbol *symbol;
+
+    bindings = grdelWindowVerify(window);
+    if ( bindings == NULL ) {
+        strcpy(grdelerrmsg, "grdelSymbol: window argument is not "
+                            "a grdel Window");
+        return NULL;
+    }
+
+    symbol = (GDSymbol *) PyMem_Malloc(sizeof(GDSymbol));
+    if ( symbol == NULL ) {
+        strcpy(grdelerrmsg, "grdelSymbol: out of memory for a new Symbol");
+        return NULL;
+    }
+
+    symbol->id = grdelsymbolid;
+    symbol->window = window;
+    if ( bindings->cferbind != NULL ) {
+        symbol->object = bindings->cferbind->createSymbol(bindings->cferbind,
+                                             symbolname, symbolnamelen);
+        if ( symbol->object == NULL ) {
+            /* grdelerrmsg already assigned */
+            PyMem_Free(symbol);
+            return NULL;
+        }
+    }
+    else if ( bindings->pyobject != NULL ) {
+        symbol->object = PyObject_CallMethod(bindings->pyobject, "createSymbol",
+                                  "s#", symbolname, symbolnamelen);
+        if ( symbol->object == NULL ) {
+            sprintf(grdelerrmsg, "grdelSymbol: error when calling the Python "
+                    "binding's createSymbol method: %s", pyefcn_get_error());
+            PyMem_Free(symbol);
+            return NULL;
+        }
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelSymbol: unexpected error, "
+                            "no bindings associated with this Window");
+        PyMem_Free(symbol);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelSymbol created: "
+            "window = %p, symbolname[0] = %c, symbol = %p\n",
+            window, symbolname[0], symbol);
+    fflush(debuglogfile);
+#endif
+
+    return symbol;
+}
+
+/*
+ * Verifies symbol is a grdel Symbol.  If window is not NULL,
+ * also verifies symbol can be used with this Window.
+ * Returns a pointer to the graphic engine's symbol object
+ * if successful.  Returns NULL if there is a problem.
+ */
+grdelType grdelSymbolVerify(grdelType symbol, grdelType window)
+{
+    GDSymbol *mysymbol;
+
+    if ( symbol == NULL )
+        return NULL;
+    mysymbol = (GDSymbol *) symbol;
+    if ( mysymbol->id != grdelsymbolid )
+        return NULL;
+    if ( (window != NULL) && (mysymbol->window != window) )
+        return NULL;
+    return mysymbol->object;
+}
+
+/*
+ * Delete a Symbol created by grdelSymbol
+ *
+ * Arguments:
+ *     symbol: Symbol to be deleted
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelSymbolDelete(grdelType symbol)
+{
+    const BindObj *bindings;
+    GDSymbol *mysymbol;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelSymbolDelete called: "
+            "symbol = %p\n", symbol);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelSymbolVerify(symbol, NULL) == NULL ) {
+        strcpy(grdelerrmsg, "grdelSymbolDelete: symbol argument is not "
+                            "a grdel Symbol");
+        return 0;
+    }
+    mysymbol = (GDSymbol *) symbol;
+
+    success = 1;
+
+    bindings = grdelWindowVerify(mysymbol->window);
+    if ( bindings->cferbind != NULL ) {
+        success = bindings->cferbind->deleteSymbol(bindings->cferbind,
+                                                   mysymbol->object);
+        /* if there was a problem, grdelerrmsg is already assigned */
+    }
+    else if ( bindings->pyobject != NULL ) {
+        /* "N" - steals the reference to this symbol object */
+        result = PyObject_CallMethod(bindings->pyobject, "deleteSymbol",
+                                     "N", (PyObject *) mysymbol->object);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelSymbolDelete: error when calling the Python "
+                    "binding's deleteSymbol method: %s", pyefcn_get_error());
+            success = 0;
+        }
+        else
+            Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelSymbolDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        success = 0;
+    }
+
+    /* regardless of success, free this Symbol */
+    mysymbol->id = NULL;
+    mysymbol->window = NULL;
+    mysymbol->object = NULL;
+    PyMem_Free(mysymbol);
+
+    return success;
+}
+
+/*
+ * Creates a Symbol object.
+ *
+ * Input Arguments:
+ *     window: Window in which this symbol is to be used
+ *     symbolname: name of the symbol (e.g., ".", "+")
+ *     symbolnamelen: actual length of the symbol name
+ * Output Arguments:
+ *     symbol: the created symbol object, or zero if failure.
+ *             Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdsymbol_(void **symbol, void **window, char *symbolname, int *namelen)
+{
+    grdelType mysymbol;
+
+    mysymbol = grdelSymbol(*window, symbolname, *namelen);
+    *symbol = mysymbol;
+}
+
+/*
+ * Deletes a Symbol created by fgdsymbol_
+ *
+ * Input Arguments:
+ *     symbol: Symbol to be deleted
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdsymboldel_(int *success, void **symbol)
+{
+    grdelBool result;
+
+    result = grdelSymbolDelete(*symbol);
+    *success = result;
+}
+
diff --git a/fer/grdel/window.c b/fer/grdel/window.c
new file mode 100644
index 0000000..ca72edc
--- /dev/null
+++ b/fer/grdel/window.c
@@ -0,0 +1,1823 @@
+/*
+ * "Window" refers to the full canvas; however, no drawing, except
+ * possibly clearing the window, is done on the full window.  Instead,
+ * a "View" of the Window is "begun", and drawing is done in that View
+ * of the Window.
+ *
+ * "View" refers to a rectangular subsection of the Window (possibly
+ * the complete canvas of the Window).
+ *
+ * In order to draw in a Window, a View must first have been specified
+ * using grdelViewBegin.  When drawing in a View is complete, grdelViewEnd
+ * is called, at which point the Window should be updated.
+ *
+ * Only one View can be active at any time.  So a switch between views
+ * requires ending one view and beginning a another view.
+ *
+ * A segment is an collection of drawing commands with an ID.  Drawing
+ * commands in a segment can be deleted and the image recreated from
+ * the remaining drawing commands.
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+#include "grdel.h"
+#include "cferbind.h"
+#include "pyferret.h"
+
+
+#ifdef VERBOSEDEBUG
+#include <stdio.h>
+#include <stdlib.h>
+
+FILE *debuglogfile;
+
+static void closelogfile(void)
+{
+    if ( debuglogfile != NULL ) {
+        fclose(debuglogfile);
+        debuglogfile = NULL;
+    }
+}
+
+static void openlogfile(void)
+{
+    debuglogfile = fopen("pyferretdebug.log", "w");
+    if ( debuglogfile == NULL ) {
+        fputs("Open of pyferretdebug.log failed", stderr);
+        fflush(stderr);
+        exit(1);
+    }
+    atexit(closelogfile);
+}
+#endif /* VERBOSEDEBUG */
+
+
+static const char *grdelwindowid = "GRDEL_WINDOW";
+
+/* Instantiate the global error message string */
+char grdelerrmsg[2048];
+
+typedef struct GDWindow_ {
+    const char *id;
+    BindObj   bindings;
+    grdelBool hasview;
+    grdelBool hasseg;
+} GDWindow;
+
+/*
+ * Copies of the error message in grdelerrmsg to errmsg, but will not null
+ * terminated.  The argument errmsg should be at least 2048 characters in
+ * length and initialized to all blank prior to calling this function for
+ * return of a proper Fortran string.  The argument errmsglen is assigned
+ * the actual length of the message returned in errmsg.
+ */
+void fgderrmsg_(char *errmsg, int *errmsglen)
+{
+    *errmsglen = strlen(grdelerrmsg);
+    strncpy(errmsg, grdelerrmsg, *errmsglen);
+}
+
+/*
+ * Creates and returns a Window object.
+ * Initializes the graphics engine if needed.
+ *
+ * Arguments:
+ *     engine: name of the graphics engine for creating the Window
+ *     enginelen: actual length of the graphics engine name
+ *     title: display title for the Window
+ *     titlelen: actual length of the title
+ *     visible: display Window on start-up?
+ *
+ * Returns a pointer to the window object created.
+ * If an error occurs, NULL is returned and
+ * grdelerrmsg contains an explanatory message.
+ */
+grdelType grdelWindowCreate(const char *engine, int enginelen,
+               const char *title, int titlelen, grdelBool visible)
+{
+    GDWindow *window;
+    PyObject *visiblebool;
+
+    /* Allocate memory for this GDWindow */
+    window = (GDWindow *) PyMem_Malloc(sizeof(GDWindow));
+    if ( window == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowCreate: out of memory for a new Window");
+        return NULL;
+    }
+    window->id = grdelwindowid;
+    window->bindings.cferbind = NULL;
+    window->bindings.pyobject = NULL;
+    window->hasview = 0;
+    window->hasseg = 0;
+
+    /*
+     * First try to create the C window bindings for this engine.
+     * This will fail if it is a Python-based engine.
+     */
+    window->bindings.cferbind = cferbind_createWindow(engine, enginelen,
+                                                      title, titlelen, visible);
+    if ( window->bindings.cferbind != NULL ) {
+        /* Success - engine found; done */
+#ifdef VERBOSEDEBUG
+        /*
+         * Since a window has to be created before anything else can happen
+         * the initialization check of debuglogfile only needs to happen here.
+         */
+        if ( debuglogfile == NULL )
+            openlogfile();
+        fprintf(debuglogfile, "grdelWindow created with C bindings: "
+                              "window = %p\n", window);
+        fflush(debuglogfile);
+#endif
+        grdelerrmsg[0] = '\0';
+        return window;
+    }
+
+    /* C bindings failed, try Python bindings */
+
+    /*
+     * Call pyferret.graphbind.createWindow, which, if successful,
+     * will create and return an instance of the bindings for this
+     * graphics engine.
+     */
+    if ( visible )
+        visiblebool = Py_True;
+    else
+        visiblebool = Py_False;
+    window->bindings.pyobject = 
+            PyObject_CallMethod(pyferret_graphbind_module_pyobject, 
+                                "createWindow", "s#s#O", engine, enginelen,
+                                title, titlelen, visiblebool);
+    if ( window->bindings.pyobject == NULL ) {
+        sprintf(grdelerrmsg, "grdelWindowCreate: error when calling createWindow "
+                             "in pyferret.graphbind: %s", pyefcn_get_error());
+        PyMem_Free(window);
+        return NULL;
+    }
+
+#ifdef VERBOSEDEBUG
+    /*
+     * Since a window has to be created before anything else can happen
+     * the initialization check of debuglogfile only needs to happen here.
+     */
+    if ( debuglogfile == NULL )
+        openlogfile();
+    fprintf(debuglogfile, "grdelWindow created with Python bindings: "
+                          "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    /* return the pointer to the GDWindow */
+    return window;
+}
+
+
+/*
+ * Verifies the argument is a grdel Window.
+ * Returns the graphic engine's window bindings
+ * object if it is.  Returns NULL if it is not.
+ */
+const BindObj *grdelWindowVerify(grdelType window)
+{
+    GDWindow *mywindow;
+
+    if ( window == NULL )
+        return NULL;
+    mywindow = (GDWindow *) window;
+    if ( mywindow->id != grdelwindowid )
+        return NULL;
+    return &(mywindow->bindings);
+}
+
+
+/*
+ * Deletes (closes and destroys) a Window created by grdelWindowCreate.
+ *
+ * Arguments:
+ *     window: Window to be closed
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelWindowDelete(grdelType window)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowDelete called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowDelete: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    /* if a view is still active, end it */
+    if ( mywindow->hasview ) {
+        if ( ! grdelWindowViewEnd(window) ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        /* Call the deleteWindow method to delete the bindings instance. */
+        success = mywindow->bindings.cferbind->
+                                    deleteWindow(mywindow->bindings.cferbind);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        /*
+         * Call the deleteWindow method of the bindings instance.
+         * If True is returned, decrement the reference to this
+         * bindings instance.
+         */
+        result = PyObject_CallMethod(mywindow->bindings.pyobject,
+                                     "deleteWindow", NULL);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowDelete: error when calling the "
+                    "Python binding's deleteWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+        /* Py_True and Py_False are singleton objects */
+        if ( result != Py_True ) {
+            strcpy(grdelerrmsg, "grdelWindowDelete: deleteWindow method "
+                                "returned False");
+            return 0;
+        }
+        Py_DECREF(mywindow->bindings.pyobject);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    /* Free the memory for the GDWindow */
+    mywindow->id = NULL;
+    mywindow->hasview = 0;
+    mywindow->hasseg = 0;
+    mywindow->bindings.cferbind = NULL;
+    mywindow->bindings.pyobject = NULL;
+    PyMem_Free(window);
+
+    return 1;
+}
+
+/*
+ * Assigns the image filename and format.  This may just be a default
+ * filename when saving a window (for interactive graphics window), or
+ * it may be the filename which is written as the drawing proceeds (for
+ * non-interactive "batch mode" graphics without a display window).
+ *
+ * Arguments:
+ *     window:     Window to use
+ *     imagename:  filename for saving the image
+ *     imgnamelen: actual length of imagename
+ *     formatname: name of the format (case insensitive);
+ *                 eg, "PNG", "PDF", "PS".  May be NULL.
+ *     fmtnamelen: actual lenght of formatname (zero if NULL)
+ *
+ * If formatname is empty or NULL, the format is quessed for the
+ * filename extension of imagename.
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSetImageName(grdelType window, const char *imagename,
+                     int imgnamelen, const char *formatname, int fmtnamelen)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetImageName called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetImageName: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            setImageName(mywindow->bindings.cferbind, imagename,
+                                         imgnamelen, formatname, fmtnamelen);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "setImageName",
+                                     "s#s#", imagename, imgnamelen,
+                                     formatname, fmtnamelen);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetImageName: Error when calling "
+                    "the Python binding's setImageName method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowClear: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Clears the window of all drawings.  The window is filled
+ * (initialized) with bkgcolor; i.e., the background color.
+ *
+ * Arguments:
+ *     window: Window to be cleared
+ *     bkgcolor: Color to fill (initialize) the scene
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowClear(grdelType window, grdelType bkgcolor)
+{
+    GDWindow *mywindow;
+    grdelType colorobj;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowClear called: "
+            "window = %p, bkgcolor = %p\n", window, bkgcolor);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowClear: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    colorobj = grdelColorVerify(bkgcolor, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowClear: bkgcolor argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            clearWindow(mywindow->bindings.cferbind, colorobj);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "clearWindow",
+                                     "O", (PyObject *) colorobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowClear: Error when calling "
+                    "the Python binding's clearWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowClear: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Redraws the current drawing with bkgcolor as the background Color. 
+ *
+ * Arguments:
+ *     window: Window to be cleared
+ *     bkgcolor: Color to fill (initialize) the scene
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowRedraw(grdelType window, grdelType bkgcolor)
+{
+    GDWindow *mywindow;
+    grdelType colorobj;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowRedraw called: "
+            "window = %p, bkgcolor = %p\n", window, bkgcolor);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowRedraw: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    colorobj = grdelColorVerify(bkgcolor, window);
+    if ( colorobj == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowRedraw: bkgcolor argument is not "
+                            "a valid grdel Color for the window");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            redrawWindow(mywindow->bindings.cferbind, colorobj);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "redrawWindow",
+                                     "O", (PyObject *) colorobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowRedraw: Error when calling "
+                    "the Python binding's redrawWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowRedraw: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Updates a Window, adding any new drawing elements and redrawing.
+ *
+ * Arguments:
+ *     window: Window to be updated
+ *
+ * Returns success or failure.  If failure, grdelerrmsg contains
+ * an explanatory message.
+ */
+grdelBool grdelWindowUpdate(grdelType window)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowUpdate called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowUpdate: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            updateWindow(mywindow->bindings.cferbind);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        /* Call the updateWindow method of the bindings instance. */
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "updateWindow",
+                                     NULL);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowUpdate: error when calling the "
+                    "Python binding's updateWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowUpdate: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Turns on or off anti-aliasing on items drawn after this call.
+ *
+ * Arguments:
+ *     window: Window to be updated
+ *     antialias: if zero, turn off antialiasing;
+ *                otherwise, turn on antialiasing
+ *
+ * Returns one if successful.   If an error occurs, grdelerrmsg
+ * is assigned an appropriate error message and zero is returned.
+ */
+grdelBool grdelWindowSetAntialias(grdelType window, int antialias)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *aaobj;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetAntialias called: "
+            "window = %p, antialias = %d\n", window, antialias);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetAntialias: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            setAntialias(mywindow->bindings.cferbind, antialias);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        if ( antialias == 0 ) 
+            aaobj = Py_False;
+        else
+            aaobj = Py_True;
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "setAntialias",
+                                     "O", aaobj);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetAntialias: error when calling the "
+                    "Python binding's setAntiAlias method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSetAntialias: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Sets the current size of a Window.
+ *
+ * Arguments:
+ *     window: Window to use
+ *     width: width of the Window, in "device units"
+ *     height: height of the window in "device units"
+ *
+ * "device units" is pixels at the current window DPI.
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSetSize(grdelType window, float width, float height)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetSize called: "
+            "window = %p, width = %f, height = %f\n", window, width, height);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetSize: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            resizeWindow(mywindow->bindings.cferbind,
+                                         (double) width, (double) height);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "resizeWindow",
+                                     "dd", (double) width, (double) height);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetSize: error when calling the "
+                    "Python binding's resizeWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSetSize: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Sets the current scalinf factor of a Window.
+ *
+ * Arguments:
+ *     window: Window to use
+ *     scale: scaling factor for the Window
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSetScale(grdelType window, float scale)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetScale called: "
+            "window = %p, scale = %f\n", window, scale);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetScale: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            scaleWindow(mywindow->bindings.cferbind,
+                                        (double) scale);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "scaleWindow",
+                                     "d", (double) scale);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetScale: error when calling the "
+                    "Python binding's scaleWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSetScale: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Display or hide a Window.  A graphics engine that does not
+ * have the ability to display a Window will ignore this call.
+ *
+ * Arguments:
+ *     window: Window to use
+ *     visible: display Window?
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSetVisible(grdelType window, grdelBool visible)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *visiblebool;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetVisible called: "
+            "window = %p, visible = %d\n", window, visible);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetVisible: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            showWindow(mywindow->bindings.cferbind, visible);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        if ( visible )
+            visiblebool = Py_True;
+        else
+            visiblebool = Py_False;
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "showWindow",
+                                     "O", visiblebool);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetVisible: error when calling the "
+                    "Python binding's showWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSetVisible: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Save the contents of the window to a file.
+ *
+ * Arguments:
+ *     window: Window to use
+ *     filename: name of the file to create
+ *     filenamelen: actual length of the file name
+ *     fileformat: name of the format to use
+ *     formatlen: actual length of the format name
+ *     transparentbkg: make the background transparent?
+ *     xinches: horizontal size of vector image in inches
+ *     yinches: vertical size of vector image in inches
+ *     xpixels: horizontal size of raster image in pixels
+ *     ypixels: vertical size of raster image in pixels
+ *     annotations: array of annotation strings; 
+ *                  pointers are always 8 bytes apart
+ *     numannotations: number of annotation strings
+ *
+ * If fileformat is NULL, the fileformat is guessed from the
+ * filename extension.
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSave(grdelType window, const char *filename,
+                          int filenamelen, const char *fileformat,
+                          int formatlen, grdelBool transparentbkg,
+                          float xinches, float yinches, 
+                          int xpixels, int ypixels,
+                          void **annotations, int numannotations)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *transparentbool;
+    PyObject *annostuple;
+    PyObject *annostrobj;
+    PyObject *result;
+    int k;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSave called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSave: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            saveWindow(mywindow->bindings.cferbind,
+                                       filename, filenamelen,
+                                       fileformat, formatlen, transparentbkg,
+                                       xinches, yinches, xpixels, ypixels,
+                                       annotations, numannotations);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        if ( transparentbkg )
+            transparentbool = Py_True;
+        else
+            transparentbool = Py_False;
+        if ( numannotations > 0 ) {
+            annostuple = PyTuple_New((Py_ssize_t) numannotations);
+            if ( annostuple == NULL ) {
+                strcpy(grdelerrmsg, "grdelWindowSave: unexpected error, "
+                                    "unable to create a tuple for the annotations");
+                return 0;
+            }
+            for (k = 0; k < numannotations; k++) {
+                annostrobj = PyString_FromString((char *) annotations[k * 8 / sizeof(void *)]);
+                if ( annostrobj == NULL ) {
+                    Py_DECREF(annostuple);
+                    strcpy(grdelerrmsg, "grdelWindowSave: unexpected error, "
+                                        "unable to create a annotation string object");
+                    return 0;
+                }
+                PyTuple_SET_ITEM(annostuple, (Py_ssize_t) k, annostrobj);
+            }
+        }
+        else {
+            annostuple = Py_None;
+            /* PyObect_CallMethod will steal the reference to annostuple (N instead of O) */
+            Py_INCREF(Py_None);
+        }
+        result = PyObject_CallMethod(mywindow->bindings.pyobject,
+                                     "saveWindow", "s#s#OddiiN",
+                                     filename, filenamelen,
+                                     fileformat, formatlen, transparentbool,
+                                     (double) xinches, (double) yinches,
+                                     xpixels, ypixels, annostuple);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSave: error when calling the "
+                    "Python binding's saveWindow method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSave: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+
+/*
+ * Get information about the default screen (display) for a window.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *
+ * Output Arguments:
+ *     dpix: the number of dots per inch in the horizontal (X) direction
+ *     dpiy: the number of dots per inch in the vertical (Y) direction
+ *     screenwidth: the width of the screen (display) in pixels (dots)
+ *     screenheight: the height of the screen (display) in pixels (dots)
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowScreenInfo(grdelType window, float *dpix, float *dpiy,
+                                int *screenwidth, int *screenheight)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowScreenInfo called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowScreenInfo: window argument is not a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            windowScreenInfo(mywindow->bindings.cferbind,
+                                        dpix, dpiy, screenwidth, screenheight);
+        if ( success == 0 ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "windowScreenInfo", NULL);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowScreenInfo: error when calling the Python "
+                                 "binding's windowScreenInfo method: %s", pyefcn_get_error());
+            return 0;
+        }
+        if ( ! PyArg_ParseTuple(result, "ffii", dpix, dpiy, 
+                                                screenwidth, screenheight) ) {
+            Py_DECREF(result);
+            sprintf(grdelerrmsg, "grdelWindowScreenInfo: Error when parsing the Python "
+                                 "binding's windowScreenInfo return value: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowScreenInfo: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Set the scaling factor for pen widths, symbol sizes, and font sizes.
+ *
+ * Arguments:
+ *     window: Window to use
+ *     widthfactor: scaling factor to use
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSetWidthFactor(grdelType window, float widthfactor)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSetWidthFactor called: "
+            "window = %p, scalingfactor = %f\n", window, widthfactor);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSetWidthFactor: "
+                            "window argument is not a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                    setWidthFactor(mywindow->bindings.cferbind, (double) widthfactor);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "setWidthFactor",
+                                     "d", (double) widthfactor);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSetWidthFactor: error when calling the "
+                    "Python binding's setWidthFactor method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSetWidthFactor: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Creates and returns a Window object.
+ * Initializes the graphics engine if needed.
+ *
+ * Input arguments:
+ *     engine: name of the graphics engine for creating the Window
+ *     enginelen: actual length of the graphics engine name
+ *     title: display title for the Window
+ *     titlelen: actual length of the title
+ *     visible: display Window on start-up? If zero, no; if non-zero, yes.
+ * Output Arguments:
+ *     window: the window object created, or zero if failure.
+ *             Use fgderrmsg_ to retreive the error message.
+ */
+void fgdwincreate_(void **window, char *engine, int *enginelen,
+                   char *title, int *titlelen, int *visible)
+{
+    grdelType mywindow;
+
+    mywindow = grdelWindowCreate(engine, *enginelen,
+                                 title, *titlelen, *visible);
+    *window = mywindow;
+}
+
+/*
+ * Deletes (closes and destroys) a Window created by fgdwincreate_
+ *
+ * Input Arguments:
+ *     window: Window to be closed
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwindelete_(int *success, void **window)
+{
+    grdelBool result;
+
+    result = grdelWindowDelete(*window);
+    *success = result;
+}
+
+/*
+ * Assigns the image filename and format.  This may just be a default
+ * filename when saving a window (for interactive graphics window), or
+ * it may be the filename which is written as the drawing proceeds (for
+ * non-interactive "batch mode" graphics without a display window).
+ *
+ * If formatname is empty or NULL, the format is quessed for the
+ * filename extension of imagename.
+ *
+ * Input Arguments:
+ *     window:     Window to use
+ *     imagename:  filename for saving the image
+ *     imgnamelen: actual length of imagename
+ *     formatname: name of the format (case insensitive);
+ *                 eg, "PNG", "PDF", "PS".  May be NULL.
+ *     fmtnamelen: actual lenght of formatname (zero if NULL)
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinimgname_(int *success, void **window, char *imagename,
+                    int *imgnamelen, char *formatname, int *fmtnamelen)
+{
+    grdelBool result;
+
+    result = grdelWindowSetImageName(*window, imagename, *imgnamelen,
+                                     formatname, *fmtnamelen);
+    *success = result;
+}
+
+/*
+ * Clears the window of all drawings.  The window is filled
+ * (initialized) with bkgcolor; i.e., the background color.
+ *
+ * Input Arguments:
+ *     window: Window to be cleared
+ *     bkgcolor: Color to fill (initialize) the scene
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinclear_(int *success, void **window, void **bkgcolor)
+{
+    grdelBool result;
+
+    result = grdelWindowClear(*window, *bkgcolor);
+    *success = result;
+}
+
+/*
+ * Redraws the current drawing with bkgcolor as the background Color. 
+ *
+ * Input Arguments:
+ *     window: Window to be cleared
+ *     bkgcolor: Color to fill (initialize) the scene 
+ *               prior to redrawing the scene.
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinredraw_(int *success, void **window, void **bkgcolor)
+{
+    grdelBool result;
+
+    result = grdelWindowRedraw(*window, *bkgcolor);
+    *success = result;
+}
+
+/*
+ * Updates a Window, adding any new drawing elements and redrawing.
+ *
+ * Input Arguments:
+ *     window: Window to be updated
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinupdate_(int *success, void **window)
+{
+    grdelBool result;
+
+    result = grdelWindowUpdate(*window);
+    *success = result;
+}
+
+/*
+ * Turns on or off anti-aliasing on items drawn after this call.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     antialias: if zero, turn off antialiasing;
+ *                otherwise, turn on antialiasing
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsetantialias_(int *success, void **window, int *antialias)
+{
+    grdelBool result;
+
+    result = grdelWindowSetAntialias(*window, *antialias);
+    *success = result;
+}
+
+/*
+ * Sets the current size of a Window.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     width: width of the Window, in "device units"
+ *     height: height of the window in "device units"
+ *   "device units" is pixels at the current window DPI.
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsetsize_(int *success, void **window, float *width, float *height)
+{
+    grdelBool result;
+
+    result = grdelWindowSetSize(*window, *width, *height);
+    *success = result;
+}
+
+/*
+ * Sets the scaling factor of a Window.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     scale: scaling factor for the Window
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsetscale_(int *success, void **window, float *scale)
+{
+    grdelBool result;
+
+    result = grdelWindowSetScale(*window, *scale);
+    *success = result;
+}
+
+/*
+ * Display or hide a Window.  A graphics engine that does not
+ * have the ability to display a Window will ignore the call.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     visible: non-zero to show the window; zero to hide the window
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsetvis_(int *success, void **window, int *visible)
+{
+    grdelBool result;
+
+    result = grdelWindowSetVisible(*window, *visible);
+    *success = result;
+}
+
+/*
+ * Save the contents of the window to a file.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     filename: name of the file to create
+ *     filenamelen: actual length of the file name
+ *     fileformat: name of the format to use
+ *     formatlen: actual length of the format name
+ *     transparentbkg: make the background transparent?
+ *     xinches: horizontal size of vector image in inches
+ *     yinches: vertical size of vector image in inches
+ *     xpixels: horizontal size of raster image in pixels
+ *     ypixels: vertical size of raster image in pixels
+ *     memory: ferret memory containing annotation C strings; 
+ *             pointers are always 8 bytes apart
+ *     firststr: offset into memory of the first annotation C string
+ *     numstr: number of annotation C strings
+ *
+ * If formatlen is zero, the fileformat is guessed from the
+ * filename extension.
+ *
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsave_(int *success, void **window, char *filename, int *namelen,
+                 char *fileformat, int *formatlen, int *transparentbkg,
+                 float *xinches, float *yinches, int *xpixels, int *ypixels,
+                 void **memory, int *firststr, int *numstr)
+{
+    grdelBool result;
+
+    result = grdelWindowSave(*window, filename, *namelen,
+                             fileformat, *formatlen, *transparentbkg,
+                             *xinches, *yinches, *xpixels, *ypixels,
+                             &(memory[(*firststr) * 8 / sizeof(void *)]), 
+                             *numstr);
+    *success = result;
+}
+
+
+/*
+ * Get information about the default screen (display) for a window.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *
+ * Output Arguments:
+ *     dpix: the number of dots per inch in the horizontal (X) direction
+ *     dpiy: the number of dots per inch in the vertical (Y) direction
+ *     screenwidth: width of the screen (display) in pixels (dots)
+ *     screenheight: height of the screen (display) in pixels (dots)
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinscreeninfo_(int *success, void **window, float *dpix, float *dpiy,
+                                     int *screenwidth, int*screenheight)
+{
+    grdelBool result;
+
+    result = grdelWindowScreenInfo(*window, dpix, dpiy, 
+                                   screenwidth, screenheight);
+    *success = result;
+}
+
+
+/*
+ * Assign the scaling factor for line widths, symbol sizes, and font sizes.
+ *
+ * Input Arguments:
+ *     window: Window to use
+ *     widthfactor: scaling factor to use
+ *
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdwinsetwidthfactor_(int *success, void **window, float *widthfactor)
+{
+    grdelBool result;
+
+    result = grdelWindowSetWidthFactor(*window, *widthfactor);
+    *success = result;
+}
+
+
+/*
+ * Starts a View in a Window.  "View" refers to a rectangular subsection of
+ * the Window (possibly the complete canvas of the Window).
+ *
+ * Arguments:
+ *     window: Window object to use
+ *     leftfrac: location of the left side of the View as a fraction
+ *             [0.0, 1.0] of the total width of the Window
+ *     bottomfrac: location of the bottom of the View as a fraction
+ *             [0.0, 1.0] of the total height of the Window
+ *     rightfrac: location of the right side of the View as a fraction
+ *             [0.0, 1.0] of the total width of the Window
+ *     topfrac: location of the top of the View as a fraction
+ *             [0.0, 1.0] of the total height of the Window
+ *     clipit: clip drawing to this View?
+ *
+ * The Window fractions start at the bottom left corner and increase
+ * to the top right corner; thus rightfrac must be larger than leftfrac,
+ * and topfrac must be larger than bottomfrac.
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowViewBegin(grdelType window,
+                               float leftfrac, float bottomfrac,
+                               float rightfrac, float topfrac,
+                               grdelBool clipit)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *clipbool;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowViewBegin called: "
+            "window = %p, "
+            "viewfrac  = (%f, %f, %f, %f) "
+            "clipit = %d\n",
+            window, leftfrac, bottomfrac, rightfrac, topfrac, clipit);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowViewBegin: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    if ( mywindow->hasview ) {
+        strcpy(grdelerrmsg, "grdelWindowViewBegin: window "
+                            "already has a View defined");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            beginView(mywindow->bindings.cferbind,
+                                      (double) leftfrac, 1.0 - (double) bottomfrac,
+                                      (double) rightfrac, 1.0 - (double) topfrac,
+                                      clipit);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        if ( clipit )
+            clipbool = Py_True;
+        else
+            clipbool = Py_False;
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "beginView", "ddddO",
+                                     (double) leftfrac, 1.0 - (double) bottomfrac,
+                                     (double) rightfrac, 1.0 - (double) topfrac,
+                                     clipbool);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowViewBegin: Error when calling the "
+                    "Python binding's beginView method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowViewBegin: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    mywindow->hasview = 1;
+    return 1;
+}
+
+/*
+ * Enable or disable clipping to the current View.
+ *
+ * Arguments:
+ *     clipit: clip to the current View?
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowViewClip(grdelType window, grdelBool clipit)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *clipbool;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowViewClip called: "
+            "window = %p "
+            "clipit = %d\n",
+            window, clipit);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowViewClip: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    if ( ! mywindow->hasview ) {
+        strcpy(grdelerrmsg, "grdelWindowViewClip: window does not "
+                            "have a view defined");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            clipView(mywindow->bindings.cferbind, clipit);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        if ( clipit )
+            clipbool = Py_True;
+        else
+            clipbool = Py_False;
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "clipView",
+                                     "O", clipbool);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowViewClip: error when calling the "
+                    "Python binding's clipView method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowViewClip: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * End a View created by grdelViewBegin.
+ *
+ * Arguments:
+ *     window: Window on which the view was defined
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowViewEnd(grdelType window)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowViewEnd called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowViewEnd: window argument is not "
+                            "a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    if ( ! mywindow->hasview ) {
+        strcpy(grdelerrmsg, "grdelWindowViewEnd: window does not "
+                            "have a view defined");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            endView(mywindow->bindings.cferbind);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "endView", NULL);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowViewEnd: error when calling the "
+                    "Python binding's endView method: %s", pyefcn_get_error());
+            return 0;
+        }
+	Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowViewEnd: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    mywindow->hasview = 0;
+    return 1;
+}
+
+/*
+ * Starts a View in a Window.  "View" refers to a rectangular subsection of
+ * the Window (possibly the complete canvas of the Window).
+ *
+ * Input Arguments:
+ *     window: Window object to use
+ *     leftfrac: location of the left side of the View as a fraction
+ *             [0.0, 1.0] of the total width of the Window
+ *     bottomfrac: location of the bottom of the View as a fraction
+ *             [0.0, 1.0] of the total height of the Window
+ *     rightfrac: location of the right side of the View as a fraction
+ *             [0.0, 1.0] of the total width of the Window
+ *     topfrac: location of the top of the View as a fraction
+ *             [0.0, 1.0] of the total height of the Window
+ *     clipit: clip drawing to this View? (zero: no, non-zero: yes)
+ *
+ * The Window fractions start at the bottom left corner and increase
+ * to the top right corner; thus rightfrac must be larger than leftfrac,
+ * and topfrac must be larger than bottomfrac.
+ *
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdviewbegin_(int *success, void **window,
+                   float *leftfrac, float *bottomfrac,
+                   float *rightfrac, float *topfrac,
+                   int *clipit)
+{
+    grdelBool result;
+
+    result = grdelWindowViewBegin(*window, *leftfrac, *bottomfrac,
+                                  *rightfrac, *topfrac, *clipit);
+    *success = result;
+}
+
+/*
+ * Enable or disable clipping to the current View.
+ *
+ * Input Arguments:
+ *     clipit: clip to the current View? (zero: no, non-zero: yes)
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdviewclip_(int *success, void **window, int *clipit)
+{
+    grdelBool result;
+
+    result = grdelWindowViewClip(*window, *clipit);
+    *success = result;
+}
+
+/*
+ * End a View created by fgdviewbegin_
+ *
+ * Input Arguments:
+ *     window: Window on which the view was defined
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdviewend_(int *success, void **window)
+{
+    grdelBool result;
+
+    result = grdelWindowViewEnd(*window);
+    *success = result;
+}
+
+/*
+ * Starts a Segment in a Window.
+ * A "Segment" is a group of drawing commands.
+ *
+ * Input Arguments:
+ *     window: Window object to use
+ *     segid: ID for the Segment
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+grdelBool grdelWindowSegmentBegin(grdelType window, int segid)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSegmentBegin called: "
+            "window = %p, "
+            "segid = %d\n",
+            window, segid);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSegmentBegin: window argument "
+                            "is not a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    if ( mywindow->hasseg ) {
+        strcpy(grdelerrmsg, "grdelWindowSegmentBegin: window "
+                            "already has a Segment defined");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            beginSegment(mywindow->bindings.cferbind, segid);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, 
+                                     "beginSegment", "i", segid);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSegmentBegin: Error when calling the "
+                    "Python binding's beginSegment method: %s", pyefcn_get_error());
+            return 0;
+        }
+        Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSegmentBegin: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    mywindow->hasseg = 1;
+    return 1;
+}
+
+/*
+ * Ends the current Segment in a Window. 
+ *
+ * Arguments:
+ *     window: Window on which the segment was defined
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSegmentEnd(grdelType window)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSegmentEnd called: "
+            "window = %p\n", window);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSegmentEnd: window argument "
+                            "is not a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+    if ( ! mywindow->hasseg ) {
+        strcpy(grdelerrmsg, "grdelWindowSegmentEnd: window does not "
+                            "have a segment defined");
+        return 0;
+    }
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            endSegment(mywindow->bindings.cferbind);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, "endSegment", NULL);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSegmentEnd: error when calling the "
+                    "Python binding's endSegment method: %s", pyefcn_get_error());
+            return 0;
+        }
+	Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSegmentEnd: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    mywindow->hasseg = 0;
+    return 1;
+}
+
+/*
+ * Deletes the drawing commands in the indicated Segment of a Window. 
+ *
+ * Arguments:
+ *     window: Window on which the segment was defined
+ *     segid: ID for the Segment to delete
+ *
+ * Returns success (nonzero) or failure (zero).
+ * If failure, grdelerrmsg contains an explanatory message.
+ */
+grdelBool grdelWindowSegmentDelete(grdelType window, int segid)
+{
+    GDWindow *mywindow;
+    grdelBool success;
+    PyObject *result;
+
+#ifdef VERBOSEDEBUG
+    fprintf(debuglogfile, "grdelWindowSegmentDelete called: "
+            "window = %p, "
+            "segid = %d\n",
+            window, segid);
+    fflush(debuglogfile);
+#endif
+
+    if ( grdelWindowVerify(window) == NULL ) {
+        strcpy(grdelerrmsg, "grdelWindowSegmentDelete: window argument "
+                            "is not a grdel Window");
+        return 0;
+    }
+    mywindow = (GDWindow *) window;
+
+    if ( mywindow->bindings.cferbind != NULL ) {
+        success = mywindow->bindings.cferbind->
+                            deleteSegment(mywindow->bindings.cferbind, segid);
+        if ( ! success ) {
+            /* grdelerrmsg already assigned */
+            return 0;
+        }
+    }
+    else if ( mywindow->bindings.pyobject != NULL ) {
+        result = PyObject_CallMethod(mywindow->bindings.pyobject, 
+                                     "deleteSegment", "i", segid);
+        if ( result == NULL ) {
+            sprintf(grdelerrmsg, "grdelWindowSegmentDelete: error when calling the "
+                    "Python binding's deleteSegment method: %s", pyefcn_get_error());
+            return 0;
+        }
+	Py_DECREF(result);
+    }
+    else {
+        strcpy(grdelerrmsg, "grdelWindowSegmentDelete: unexpected error, "
+                            "no bindings associated with this Window");
+        return 0;
+    }
+
+    mywindow->hasseg = 0;
+    return 1;
+}
+
+/*
+ * Start a Segment in a Window. 
+ * A "Segment" is a group of drawing commands.
+ *
+ * Input Arguments:
+ *     window: Window object to use
+ *     segid: ID for the Segment
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdsegbegin_(int *success, void **window, int *segid)
+{
+    grdelBool result;
+
+    result = grdelWindowSegmentBegin(*window, *segid);
+    *success = result;
+}
+
+/*
+ * Ends the current Segment in a Window. 
+ *
+ * Input Arguments:
+ *     window: Window object to use
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdsegend_(int *success, void **window)
+{
+    grdelBool result;
+
+    result = grdelWindowSegmentEnd(*window);
+    *success = result;
+}
+
+/*
+ * Deletes the drawing commands in the indicated Segment of a Window. 
+ *
+ * Input Arguments:
+ *     window: Window object to use
+ *     segid: ID for the Segment
+ * Output Arguments:
+ *     success: non-zero if successful; zero if an error occurred.
+ *              Use fgderrmsg_ to retrieve the error message.
+ */
+void fgdsegdelete_(int *success, void **window, int *segid)
+{
+    grdelBool result;
+
+    result = grdelWindowSegmentDelete(*window, *segid);
+    *success = result;
+}
+
diff --git a/fer/ino/LIB_NAME b/fer/ino/LIB_NAME
new file mode 100644
index 0000000..4d2f8b7
--- /dev/null
+++ b/fer/ino/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libino.a 
diff --git a/fer/ino/Makefile b/fer/ino/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/ino/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/ino/SOURCE_FILES b/fer/ino/SOURCE_FILES
new file mode 100644
index 0000000..c33d3fd
--- /dev/null
+++ b/fer/ino/SOURCE_FILES
@@ -0,0 +1,17 @@
+SRCS_F = \
+cdf_prep_cache.F\
+dset_type.F\
+equal_delimit.F\
+find_dset_number.F\
+get_dset_parms.F\
+init_ez_dset.F\
+make_cvar_grids.F\
+read_ez.F\
+read_binary.F\
+read_delimited.F\
+read_perl.F\
+read_remote.F\
+read_tm.F\
+repl_tm_find_grid_slot.F\
+replace_bad_data.F\
+var_ss_lims.F 
diff --git a/fer/ino/cdf_prep_cache.F b/fer/ino/cdf_prep_cache.F
new file mode 100644
index 0000000..896b217
--- /dev/null
+++ b/fer/ino/cdf_prep_cache.F
@@ -0,0 +1,192 @@
+	SUBROUTINE CDF_PREP_CACHE( dflt_cx, filename, nvars, memory,
+     .			           mrlist, cxlist, clobber, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* setup to create a DODS NetCDF cache
+* create a list of contexts appropriate to describe the (1,1,1,1) element
+* of each variable in the DODS data set.
+
+* programmer - steve hankin
+
+* V450	11/96
+
+* V600 *acm* 3/06  fixing bugs 439&1390, new arg to get_new_cx.
+*       *acm* 3/12 cleanup old VMS ifdef
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+        include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+        include 'xdset_info.cmn_text'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling argument declarations:
+	LOGICAL clobber
+	INTEGER dflt_cx, nvars, mrlist(*), cxlist(*), status
+	REAL	memory( mem_blk_size, max_mem_blks )
+	CHARACTER TM_INQ_PATH*2048, filename*(*)
+
+* local variable declarations
+	LOGICAL		TM_HAS_STRING, fexist
+	INTEGER		TM_LENSTR1,
+     .			qfile, dset, cx0, cx, ivar, idim, flen, dlen,
+     .			iin, iout
+	CHARACTER	ch*1, raw_name*200
+
+* local parameter declarations
+	INTEGER         slash_file
+	PARAMETER     ( slash_file    = 12+1)
+
+* determine the data set in question
+        CALL GET_NEW_CX( dflt_cx, cx_cmnd, .TRUE., status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+	dset = cx_data_set(cx_cmnd)
+	IF ( dset .EQ. unspecified_int4 ) GOTO 5100
+	IF ( ds_type(dset) .NE. 'CDF' )   GOTO 5200
+	IF ( ds_type(dset) .NE. 'ENS' )   GOTO 5200
+	IF ( .NOT.TM_HAS_STRING(ds_des_name(dset)(:8), 'http://') )
+     .					  GOTO 5200
+
+* determine the directory to receive the cached file
+        qfile = qual_given( slash_file )
+        IF ( qfile .GT. 0 ) THEN
+           CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(qfile):qual_end(qfile)),
+     .                  raw_name, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+* ... translate a possible env. var. at start of directory name.
+*	Make sure the directory exists.
+	   filename = TM_INQ_PATH( raw_name, ' ', ' ',
+     .			.TRUE., status )
+           IF ( status .NE. merr_ok ) GOTO 5000
+	ELSE
+	   filename = '.'
+        ENDIF
+
+* create the file name from the directory name
+* ... name too long to cache?
+	flen = TM_LENSTR1(filename)
+	dlen = TM_LENSTR1(ds_des_name(dset))
+	IF ( LEN(ds_des_name(dset)) .EQ. dlen ) GOTO 5300
+	IF ( LEN(filename) .LE. flen+dlen-7 ) GOTO 5300
+	filename(flen+1:flen+1) = '/'		! after user-supplied directory
+	iout = flen+2				
+	DO 10 iin = 8, dlen			! just past the "http://"
+	   ch = ds_des_name(dset)(iin:iin)	
+	   IF ( ch .EQ. '/' ) THEN
+	      filename(iout:iout) = '_'
+	   ELSE
+	      filename(iout:iout) = ch 
+	   ENDIF
+	   iout = iout + 1
+ 10	CONTINUE
+
+* if the file already exists and we are not in clobber mode ---> error
+	IF ( .NOT.clobber ) THEN
+	   INQUIRE( FILE = filename, EXIST = fexist )
+	   IF ( fexist ) GOTO 5400
+	ENDIF
+
+* create a base context
+        CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+        cx0 = cx_stack_ptr
+        cx_data_set(cx0) = dset
+        cx_category(cx0) = cat_file_var
+        DO 20 idim = 1, nferdims
+          cx_lo_ss(cx0,idim) = 1
+          cx_hi_ss(cx0,idim) = 1
+          cx_by_ss(idim,cx0) = .TRUE.
+          cx_trans(idim,cx0) = trans_no_transform
+          cx_given(idim,cx0) = .FALSE.
+          cx_delta(idim,cx0) = unspecified_val8
+ 20    CONTINUE
+
+* set up one dummy variable for each variable in the data set
+	nvars = 0
+	DO 100 ivar = 1, maxvars
+	   IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 100
+           CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           cx = cx_stack_ptr
+	   nvars = nvars + 1
+	   cxlist(nvars) = cx
+	   CALL TRANSFER_CONTEXT(cx0, cx)
+           cx_variable(cx) = ivar
+	   cx_grid(cx)     = ds_grid_number(ivar)
+	   cx_bad_data(cx) = ds_bad_flag( ivar )
+	   DO 110 idim = 1, nferdims
+	      CALL FLESH_OUT_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+ 110	   CONTINUE
+	   CALL CREATE_TEMP_MEM_VAR( cx, mrlist(nvars), status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   CALL UN_CACHE( mrlist(nvars) )
+	   memory(1, mr_blk1(mrlist(nvars))) = 0.0    ! just good house-keeping
+ 100	CONTINUE
+
+* echo the name of the output cache file
+* 1/03 *kob* g77 port demands the use of risc_buff
+	risc_buff = filename(1:TM_LENSTR1(filename))
+	CALL SPLIT_LIST(pttmode_bull, ttout_lun,
+     .		' LISTing to file '//risc_buff,0)
+
+	RETURN
+
+* error exits
+ 5000	CALL DELETE_MRS_IN_PROGRESS		! remove temporary vars
+	RETURN
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .			'no data set specified to cache', *5000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .			'can only cache a DODS NetCDF data set', *5000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .			'URL string too long to cache', *5000 )
+
+* 1/03 *kob* g77 port demands the use of risc_buff
+ 5400	risc_buff = filename
+	CALL ERRMSG( ferr_invalid_command, status,
+     .			'/CLOBBER not specified and file exists: '
+     .			//risc_buff, *5000 )
+
+	END
diff --git a/fer/ino/dset_type.F b/fer/ino/dset_type.F
new file mode 100644
index 0000000..3b3cabd
--- /dev/null
+++ b/fer/ino/dset_type.F
@@ -0,0 +1,60 @@
+	CHARACTER*4 FUNCTION DSET_TYPE( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the TMAP data set type (as stored in the descriptor file)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/25/89
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 changes for 6D Ferret
+
+* calling argument declarations:
+	INTEGER	dset
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+	DSET_TYPE = ds_type( dset )
+
+	RETURN
+	END
diff --git a/fer/ino/equal_delimit.F b/fer/ino/equal_delimit.F
new file mode 100644
index 0000000..8e2c47f
--- /dev/null
+++ b/fer/ino/equal_delimit.F
@@ -0,0 +1,143 @@
+	SUBROUTINE EQUAL_DELIMIT( string, outstring, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "DELIMITER=xxxx" determine the list of field
+* delimiters and return in outstring
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530: *sh* 11/00
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		status
+	CHARACTER*(*)	string, outstring
+
+* internal variable declarations
+	INTEGER	TM_LENSTR1, n, llen, pos, ll, ic
+	CHARACTER buff*80, buff1*8
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* internal parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* input is comma separated, may include "\t", "\,", and HEX characters
+
+* get the input string
+        CALL EQUAL_STR_LC( string, buff, status )   ! lower case 11/92
+        IF ( status .NE. ferr_ok ) RETURN
+
+! initialize
+	n = 0
+	llen = TM_LENSTR1(buff)
+	
+* parse out the next field (implied DO-WHILE loop)
+ 100	pos = INDEX(buff,',')   ! points to the terminating comma
+	  IF (pos.EQ.0) THEN
+	    pos = llen + 1
+	  ELSEIF (pos.EQ.1) THEN
+	    GOTO 5100   ! null delimiter
+*  ... escaped comma?
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	  ELSEIF (buff(pos-1:pos-1).EQ.'\') THEN
+#else
+	  ELSEIF (buff(pos-1:pos-1).EQ.'\\') THEN
+#endif	    
+	    ll = INDEX(buff(pos+1:),',')
+	    IF (ll.EQ.0) THEN
+	      pos = llen + 1
+	    ELSE
+	      pos = pos + ll
+	    ENDIF 
+	  ENDIF
+
+* interpret the next delimiter
+	  n = n + 1
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+	  IF (buff(1:1).EQ.'\') THEN
+#else
+	  IF (buff(1:1).EQ.'\\') THEN
+#endif	     
+	    IF (buff(2:2).EQ.'t' .OR. buff(2:2).EQ.'T') THEN
+	      outstring(n:n) = tab
+	    ELSEIF (buff(2:2).EQ.'b' .OR. buff(2:2).EQ.'B' ) THEN
+	      outstring(n:n) = ' '
+	    ELSEIF (buff(2:2).EQ.'n' .OR. buff(2:2).EQ.'N') THEN
+	      outstring(n:n) = CHAR(12) ! newline character
+	    ELSE
+	      outstring(n:n) = buff(2:2)
+	    ENDIF
+	  ELSEIF ( buff(1:1).GE.'0'
+     .	     .AND. buff(1:1).LE.'9'
+     .	     .AND. pos.GT.2 ) THEN
+	    buff1 = buff(:pos-1)
+	    READ(buff1,'(I4)',ERR=5100) ic
+	    IF (ic.GT.127) GOTO 5100
+	    outstring(n:n) = CHAR(ic)  ! any decimal value
+	  ELSEIF (pos.GT.2) THEN
+	     GOTO 5100
+	  ELSE
+	    outstring(n:n) = buff(1:1)
+	  ENDIF
+
+* ... shift to the next field in the buffer
+	  buff = buff(pos+1:)
+	  llen = llen - pos
+	IF (llen.GT.0) GOTO 100 
+* -- end of implied DO-WHILE loop
+
+* terminate with a NULL (C-style)
+	outstring(n+1:n+1) = CHAR(0)
+
+* success
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, buff(pos:llen), *5000 )
+	END
diff --git a/fer/ino/find_dset_number.F b/fer/ino/find_dset_number.F
new file mode 100644
index 0000000..6d0b4f2
--- /dev/null
+++ b/fer/ino/find_dset_number.F
@@ -0,0 +1,238 @@
+	INTEGER FUNCTION FIND_DSET_NUMBER( dname )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the data set number of set "dname"
+* dname may be either the name (without directory pathname or .DES extension)
+* or the number
+* check that the number is valid before exiting
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/25/88
+* revision 0.1 - 2/16/89 - ds_open --> ds_name.EQ.char_init30 to test open-ness
+* Unix/RISC port 4/25/91 *sh*: increased size of ds_name
+* V300: 5/93 *sh* - if the given name includes a .des or .cdf extension ignore
+*		it when matching against data sets of these types
+*		(TM_CLEAN_FILENAME doesn't store these extensions)
+* V420 (IBM/AIX port of V411): 10/5/95 - buffer "READ(var,*"
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*	    4/97 *kob* - added ifdef for MANDATORY_FORMAT_WIDTHS on internal
+*			 read because linux/nag f90 needed a format width.
+* v500 *kob* 3/99 - modifications to allow datasets to start w/ a digit.
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v551 *acm* 1/03  Also check for extension .NC along with .DES, .CDF
+* v580 *acm*11/04  Fix bug 1102; under linux, var[d=5coads] is read as dset=5
+* V600 *acm* 2/06  fix bug 1392, cancelling datasets
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* v604 *acm* 7/07 increase length of ds_name
+* V680 6/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include 'gfdl_vms.parm'	
+        include 'errmsg.parm'
+
+* calling argument declarations:
+	CHARACTER*(*)	dname
+
+* internal variable declarations:
+	LOGICAL		TM_DIGIT_TEST, TM_HAS_STRING,
+     .		        cdf_name, des_name, full_name_used, nc_name
+	INTEGER		STR_CASE_BLIND_COMPARE, TM_LENSTR1,
+     .			vax_code, dset, full_len, short_len, status
+	CHARACTER	TM_INQ_PATH*2048, buff*2048
+	CHARACTER*13	TM_STRING, buff13, vbuff
+        REAL*8          val
+
+	IF ( TM_DIGIT_TEST( dname ) ) THEN
+
+	   buff = dname				! buffer for AIX
+* *kob* 3/99 - change the err= to go to 50 rather than 500 - this is so a
+*              failed read a number is a clue that perhaps it is part of a name
+*              of a dataset (eg 5coads) rather than just an error
+* *kob* 3/30/99 - minor modification in logic forced by F90.  
+c *kob* 4/97
+* *acm* 11/04 current linux compiler reads a filename starting with digits
+*             as just the digits with no error (10a.nc is read as dset=10)
+*             Check explicitly whether the dset read is the same as buff
+
+#ifdef MANDATORY_FORMAT_WIDTHS
+	   READ (buff,*, ERR=50 ) dset
+#else
+	   READ (buff, '(I)', ERR=50 ) dset
+#endif
+           val = dset
+           buff13 = TM_STRING(val)
+           CALL TM_PACK_STRING(buff13, vbuff, 1,13, short_len)
+	   vax_code = STR_CASE_BLIND_COMPARE( vbuff, buff(1:13) )
+	   IF (  vax_code .NE. vms_str_success ) GOTO 50
+
+	   GOTO 400
+	ENDIF
+
+* 5/93 locate "true" end to the given filename (.des, .cdf, and .nc are invisible)
+* note: filenames are always in CAPS since they may be embedded in the var defn
+
+           cdf_name = .FALSE.
+           des_name = .FALSE.
+           nc_name  = .FALSE.
+
+ 50	   full_len = TM_LENSTR1( dname )
+	   IF ( full_len .GT. 4 ) THEN
+	      cdf_name = dname(full_len-3:full_len) .EQ. '.cdf'
+     .        .OR. dname(full_len-3:full_len) .EQ. '.CDF'
+	      des_name = dname(full_len-3:full_len) .EQ. '.des'
+     .        .OR. dname(full_len-3:full_len) .EQ. '.DES'
+	   ELSE
+	      cdf_name = .FALSE.
+	      des_name = .FALSE.
+	   ENDIF
+	   IF ( cdf_name .OR. des_name ) THEN
+	      short_len = full_len - 4
+	      full_name_used = .FALSE.
+	   ELSE
+	      short_len = full_len
+              full_name_used = .TRUE.
+	   ENDIF
+
+	   IF ( full_len .GT. 3 ) THEN
+	      nc_name = dname(full_len-2:full_len) .EQ. '.nc'
+     .        .OR. dname(full_len-2:full_len) .EQ. '.NC'
+	   ENDIF
+	   IF ( nc_name ) THEN
+	      short_len = full_len - 3
+	      full_name_used = .FALSE.
+              cdf_name = .TRUE.
+           ENDIF
+
+* compare with filenames stored by the TMAP library
+	   DO 100 dset = 1, maxdsets
+
+	      IF ( ds_name(dset) .EQ. char_init1024) GOTO 100
+
+* special name match checks to account for implied .cdf or .des   5/93
+** what about aggregate datasets?
+
+	      IF ( TM_HAS_STRING(ds_type(dset),'CDF')   .OR. 
+     .		   TM_HAS_STRING(ds_type(dset),'ENS') ) THEN
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_name(dset),
+     .						    dname(1:short_len) )
+	         IF (  vax_code .EQ. vms_str_success
+     .	        .AND. (cdf_name .OR. full_name_used) ) GOTO 400
+
+	      ELSEIF ( TM_HAS_STRING(ds_type(dset),'GT')) THEN	
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_name(dset),
+     .						    dname(1:short_len) )
+	         IF (  vax_code .EQ. vms_str_success
+     .	        .AND. (des_name .OR. full_name_used) ) GOTO 400
+
+	      ELSE     ! EZ data set - any filename extension allowed
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_name(dset),
+     .						    dname(1:full_len) )
+	         IF (  vax_code .EQ. vms_str_success ) GOTO 400
+
+	      ENDIF
+
+ 100	   CONTINUE
+
+* Is the name a full path name?
+
+	   DO 200 dset = 1, maxdsets
+
+	      IF ( ds_des_name(dset) .EQ. char_init1024) GOTO 200
+
+* special name match checks to account for implied .cdf or .des   5/93
+	      IF ( TM_HAS_STRING(ds_type(dset),'CDF')) THEN
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_des_name(dset),
+     .						    dname )
+	         IF (  vax_code .EQ. vms_str_success
+     .	        .AND. (cdf_name .OR. full_name_used) ) GOTO 400
+
+	      ELSEIF ( TM_HAS_STRING(ds_type(dset),'GT')) THEN	
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_des_name(dset),
+     .						    dname )
+	         IF (  vax_code .EQ. vms_str_success
+     .	        .AND. (des_name .OR. full_name_used) ) GOTO 400
+
+	      ELSE     ! EZ data set - any filename extension allowed
+	         vax_code = STR_CASE_BLIND_COMPARE( ds_des_name(dset),
+     .						    dname(1:full_len) )
+	         IF (  vax_code .EQ. vms_str_success ) GOTO 400
+
+	      ENDIF
+
+ 200	   CONTINUE
+
+
+
+* Try TM_INQ_PATH and compare with full path names
+
+           buff = TM_INQ_PATH (dname, 'FER_DATA', '    ', .FALSE.,
+     .                              status)
+           IF (status .NE. ferr_ok) GOTO 500
+
+	   DO 300 dset = 1, maxdsets
+
+	      IF ( ds_des_name(dset) .EQ. char_init1024) GOTO 300
+	      vax_code = STR_CASE_BLIND_COMPARE( ds_des_name(dset),
+     .						    buff )
+
+ 300	   CONTINUE
+
+	   GOTO 500
+
+* check for valid number given
+ 400	IF ( dset .LT. 1 .OR. dset .GT. maxdsets ) GOTO 500
+	IF ( ds_name(dset) .EQ. char_init40 ) GOTO 500
+
+* success
+	FIND_DSET_NUMBER = dset
+	RETURN
+
+* no match
+ 500	FIND_DSET_NUMBER = unspecified_int4
+	RETURN
+
+	END
diff --git a/fer/ino/get_dset_parms.F b/fer/ino/get_dset_parms.F
new file mode 100644
index 0000000..6e38ee2
--- /dev/null
+++ b/fer/ino/get_dset_parms.F
@@ -0,0 +1,323 @@
+	SUBROUTINE GET_DSET_PARMS( dset, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get parameter values for data set - 1st set defaults, then read (if possible)
+* from the 205 data base, then over-ride using any parameters given in the
+* descriptor
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/11/88
+* revision 0.1 - 4/28/88 - get parameters from 205 data base
+* revision 0.2 - 6/22/88 - allow SIEG and SEIG interchangeably
+*			 - warning only for invalid 205 data base entry
+* revision 0.3 - 7/1/88  - allow multiple air temp climatologies
+*			 - add dp_Am_factor
+* revision 1.0 -11/17/88 - new io library and grid common
+* revision 1.1 - 4/19/89 - changed AIRT logic so that 3-letter code is read
+*			   from 205 data base.  "LEV" is still default.
+* Unix/RISC port 5/91 *sh*: changed runs data base file name
+*               8/29/91 - added add'l parm "NTS30 WIND STRESS CALC"
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420: 9/95 - using TM_ITSA_MODEL_RUN TMAP runs are now recognizable from
+* 		their file names, alone.  Parameters are then read from the
+*		205 run data base.
+*       *acm* 3/12 changes for 6D Ferret
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'tmap_dims.parm'
+	include 'tmap_errors.parm'
+	include 'xdset_parms.cmn'
+	include 'xprog_state.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+
+* calling argument declarations
+	INTEGER	dset, num_prev_gridfiles, status
+
+* local variable declarations
+	LOGICAL	TM_HAS_STRING, TM_DIGIT, TM_ITSA_MODEL_RUN
+	INTEGER	TM_LENSTR1,
+     .		NEXT205, TMAP_status, dummy, i, slen, iclim
+	CHARACTER	TM_EXP_CODE*6, col_head*132, table_row*132,
+     .			entry*64, entry_nam*64
+
+* parameter definitions
+	INTEGER	    max_dset_parms
+	PARAMETER ( max_dset_parms = 15 )	! to match *DSET_INFO.CMN
+
+* Philander/Siegel model output ? (Sieg or Seig)
+	dp_phil_sieg( dset ) = TM_HAS_STRING( ds_source(dset), 'PHIL' )
+     .			 .AND. ( TM_HAS_STRING( ds_source(dset), 'SIEG' )
+     .			    .OR. TM_HAS_STRING( ds_source(dset), 'SEIG' ) )
+
+* 9/95 - may conclude it is a TMAP model run based on file name, too
+* (the term "Philander/Siegel" has been commandeered for all TMAp runs)
+	IF (.NOT.dp_phil_sieg(dset)) dp_phil_sieg(dset) =TM_ITSA_MODEL_RUN
+     .					(ds_name(dset),
+     .					 ds_source(dset),
+     .					 ds_expnum(dset)  )
+
+* Cox model output ?
+	dp_cox( dset )	 = TM_HAS_STRING( ds_source(dset), 'COX' )
+
+* something unknown ?
+	IF (   ds_source(dset) .NE. ' '
+     .	.AND. .NOT.dp_phil_sieg(dset)
+     .	.AND. .NOT.dp_cox(dset) ) THEN
+	   WRITE ( risc_buff, 3020 )
+     .		ds_source(dset)( :TM_LENSTR1( ds_source(dset) ) ),
+     .		ds_name(dset)( :TM_LENSTR1( ds_name(dset) ) )
+	   CALL WARN ( risc_buff )
+	ENDIF
+
+* tropical Pacific (160x100x27) grid ?
+	dp_trop_pacific( dset ) = TM_HAS_STRING( ds_subsource(dset), 'TROP' )
+     .			    .AND. TM_HAS_STRING( ds_subsource(dset), 'PAC'  )
+
+********* PHILANDER/COX parameters ****************************
+* * * * INITIALIZE PARAMETER DEFAULTS * * * * 
+	dp_min_wind	( dset ) = 488.
+	dp_phil_qflux	( dset ) = .TRUE.
+	dp_ramp1_qflux	( dset ) = .FALSE.
+	dp_ramp2_qflux	( dset ) = .FALSE.
+	dp_clim_air_sst	( dset ) = 1		! LEVITUS
+	dp_const_air_sst( dset ) = .TRUE.
+	dp_delta_air_sst( dset ) = 1.0
+	dp_Am_factor	( dset ) = 2.0
+        dp_nts30_wind   ( dset ) = .FALSE.
+
+* * * *  CHECK THE 205 DATA BASE * * * * 
+	IF ( dp_phil_sieg(dset).OR.dp_cox(dset) ) THEN
+* get the table heading line and row containing this experiment code
+	   CALL TM_GET_205_RUN_LINE
+     .		( 'model_runs.doc', TM_EXP_CODE(dset), col_head, table_row,
+     .			TMAP_status )	
+	   IF ( TMAP_status .NE. merr_ok ) THEN
+	      CALL WARN ('Model run parameters not available')
+	      CALL WARN ('Diagnostic variable results may be incorrect')
+	      GOTO 500
+	   ENDIF
+
+* ... MINIMUM WIND
+	   ASSIGN 110 TO NEXT205
+	   entry_nam = 'WND'
+	   CALL TM_GET_205_RUN_PARM
+     .		( entry_nam, col_head, table_row, entry, slen, TMAP_status )
+	   IF ( TMAP_status .NE. merr_ok ) GOTO 5010
+	   IF ( .NOT.TM_DIGIT(entry) ) GOTO 5010
+	   READ ( entry, *, ERR=5010 ) dp_min_wind(dset)
+
+* ... HEAT FLUX PARAMETERIZATION
+ 110	   ASSIGN 120 TO NEXT205
+	   entry_nam = 'FLUX'
+	   CALL TM_GET_205_RUN_PARM
+     .		( entry_nam, col_head, table_row, entry, slen, TMAP_status )
+	   IF ( TMAP_status .NE. merr_ok ) GOTO 5010
+	   dp_phil_qflux  ( dset ) = TM_HAS_STRING( entry, 'PHIL' )
+	   dp_ramp1_qflux ( dset ) = TM_HAS_STRING( entry, 'RAMP1' )
+	   dp_ramp2_qflux ( dset ) = TM_HAS_STRING( entry, 'RAMP2' )
+	   IF ( .NOT.dp_phil_qflux( dset )
+     .	  .AND. .NOT.dp_ramp1_qflux( dset )
+     .	  .AND. .NOT.dp_ramp2_qflux( dset ) ) GOTO 5010
+
+* ... AIR/SST DELTA TEMP (a value or "CLIM")
+ 120	   ASSIGN 130 TO NEXT205
+	   entry_nam = 'SEAT'
+	   CALL TM_GET_205_RUN_PARM
+     .		( entry_nam, col_head, table_row, entry, slen, TMAP_status )
+	   IF ( TMAP_status .NE. merr_ok ) GOTO 5010
+	   IF ( TM_DIGIT( entry ) ) THEN
+	      READ ( entry, '(F24.0)', ERR=5010 ) dp_delta_air_sst(dset)
+	      dp_delta_air_sst( dset ) = -dp_delta_air_sst(dset) ! neg. stored
+	      dp_const_air_sst( dset ) = .TRUE.
+	   ELSE
+	      IF ( entry(:4) .NE. 'CLIM' ) GOTO 5010
+	      dp_const_air_sst( dset ) = .FALSE.
+	   ENDIF
+
+* ... CLIMATOLOGICAL AIR TEMP FIELD
+ 130	   ASSIGN 140 TO NEXT205
+	   entry_nam = 'AIR'
+	   CALL TM_GET_205_RUN_PARM
+     .		( entry_nam, col_head, table_row, entry, slen, TMAP_status )
+	   IF ( TMAP_status .NE. merr_ok ) GOTO 5010
+	   DO 135 iclim = 1, max_airt_clim
+	      IF ( dp_airt_name(iclim) .EQ. unspecified_name4 ) GOTO 137
+	      IF ( TM_HAS_STRING(entry,dp_airt_name(iclim)) ) THEN
+* ... this 3-letter AIRT code is already known: point data set to it
+	         dp_clim_air_sst ( dset ) = iclim
+	         GOTO 140
+	      ENDIF
+ 135	   CONTINUE
+* ... a new 3-letter code but no room to store it
+	   GOTO 5030
+* ... a new 3-letter code: save it and point data set to it
+ 137	   dp_airt_name( iclim )   = entry
+	   dp_clim_air_sst( dset ) = iclim
+
+* ... Am FACTOR - HORIZONTAL MOMENTUM DIFFUSION
+ 140	   ASSIGN 500 TO NEXT205
+	   entry_nam = 'Am'
+	   CALL TM_GET_205_RUN_PARM
+     .		( entry_nam, col_head, table_row, entry, slen, TMAP_status )
+	   IF ( TMAP_status .NE. merr_ok ) GOTO 5010
+	   IF ( .NOT.TM_DIGIT( entry ) ) GOTO 5010
+	   READ ( entry, '(F24.0)', ERR=5010 ) dp_Am_factor(dset)
+	ENDIF
+
+* * * * DESCRIPTOR PARAMETERS * * * *
+* "name" = "value"
+ 500	DO 590 i = 1, max_dset_parms
+
+	   entry_nam = ds_parm_name(i,dset)
+	   IF ( entry_nam .EQ. ' ' ) THEN
+	      GOTO 590
+	   ELSE
+	      entry = ds_parm_text(i,dset)
+	   ENDIF
+
+* ... "HEAT FLUX = PHILANDER/SIEGEL" or "HEAT FLUX = DOUBLE RAMP", etc.
+	   IF ( TM_HAS_STRING( entry_nam, 'HEAT FLUX'	) )THEN
+	      dp_phil_qflux  ( dset ) = TM_HAS_STRING( entry, 'PHIL' )
+	      dp_ramp1_qflux ( dset ) = TM_HAS_STRING( entry, 'SINGLE' )
+	      dp_ramp2_qflux ( dset ) = TM_HAS_STRING( entry, 'DOUBLE' )
+
+* ... "AIR-SEA DELTA T = value,"LEV","CAC",... "?
+	   ELSEIF ( TM_HAS_STRING( entry_nam, 'AIR-SEA DELTA T'	) ) THEN
+	   IF ( TM_DIGIT( entry ) ) THEN
+	      READ ( entry, '(F24.0)', ERR=5010 ) dp_delta_air_sst(dset)
+	      dp_delta_air_sst( dset ) = -dp_delta_air_sst(dset) ! neg. stored
+	      dp_const_air_sst( dset ) = .TRUE.
+	      dp_clim_air_sst ( dset ) = unspecified_int4
+	   ELSE
+	      DO 510 iclim = 1, max_airt_clim
+	         IF ( TM_HAS_STRING(entry,dp_airt_name(iclim)) ) THEN
+	            dp_const_air_sst( dset ) = .FALSE.
+	            dp_clim_air_sst ( dset ) = iclim
+	            GOTO 590
+	         ENDIF
+ 510	      CONTINUE
+	      GOTO 5020
+	   ENDIF
+
+* ... "MINIMUM WIND = 488."
+	   ELSEIF ( TM_HAS_STRING( entry_nam, 'MINIMUM WIND' ) ) THEN
+	      IF ( entry .EQ. ' ' ) GOTO 5020
+	      IF ( TM_DIGIT( entry ) ) THEN
+	         READ ( entry, *, ERR=5020 ) dp_min_wind(dset)
+	      ELSE
+	         GOTO 5020
+	      ENDIF
+
+* ... "Am_factor = 2.0"
+	   ELSEIF ( TM_HAS_STRING( entry_nam, 'Am_factor' ) ) THEN
+	      IF ( entry .EQ. ' ' ) GOTO 5020
+	      IF ( TM_DIGIT( entry ) ) THEN
+	         READ ( entry, *, ERR=5020 ) dp_Am_factor(dset)
+	         IF ( dp_Am_factor(dset) .LT. 0.0 ) GOTO 5020
+	      ELSE
+	         GOTO 5020
+	      ENDIF
+
+* ... "205_AIRT = "LEV","CAC", "ALV", etc.
+*     (flag this data set as containing climatological air temp ?)
+	   ELSEIF ( TM_HAS_STRING( entry_nam, '205_AIRT' ) ) THEN
+	      DO 550 iclim = 1, max_airt_clim
+	         IF ( dp_airt_name(iclim) .EQ. unspecified_name4 ) THEN
+*	... fill blank AIRT slot with this AIRT 3-letter code
+	            dp_airt_name(iclim) = entry(:3)
+	            dp_airt_dset(iclim) = dset
+	            GOTO 590
+	         ELSEIF (TM_HAS_STRING(entry,dp_airt_name(iclim)) ) THEN
+*	... point this data set at the already specified 3-letter AIRT code
+	            IF ( dp_airt_dset(iclim) .EQ. unspecified_int4 ) THEN
+	               dp_airt_dset(iclim) = dset
+	               GOTO 590
+	            ELSE
+	              GOTO 5019
+	            ENDIF
+	         ENDIF
+ 550	      CONTINUE
+*	... no blank AIRT slots for this AIRT set
+	      GOTO 5030
+
+* ... "NTS30 WIND STRESS MODIFICATION"
+	   ELSEIF ( TM_HAS_STRING( entry_nam, 'NTS30 WIND' ) ) THEN
+              dp_nts30_wind( dset ) = .TRUE.
+
+* ... parameter not recognized
+	   ELSEIF ( dp_phil_sieg(dset).OR.dp_cox(dset) ) THEN
+	      WRITE ( risc_buff, 3020 )
+     .		entry_nam( :TM_LENSTR1( entry_nam ) ),
+     .		ds_name(dset)( :TM_LENSTR1( ds_name(dset) ) )
+ 3020	      FORMAT( ' Warning: unrecognized parameter ', A,
+     .					  ' in data set ', A )
+	      CALL WARN ( risc_buff )
+	   ENDIF
+
+ 590	CONTINUE
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* syntax error
+ 5000	RETURN
+
+ 5010	CALL WARN('Invalid entry in model run data base')
+	CALL WARN('Data set: '//ds_name(dset)(:TM_LENSTR1(ds_name(dset))))
+	CALL WARN('Column:'//entry_nam(:TM_LENSTR1(entry_nam)))
+	CALL WARN('Field:'//entry(:slen))
+	CALL WARN( 'Continuing with errors ...')
+	GOTO NEXT205
+ 5019	CALL WARN( 'MULTIPLE DSETS CLAIM TO BE SAME AIR TEMPERATURE SET')
+ 5020	CALL ERRMSG( ferr_descriptor, status,
+     .		ds_name(dset)( :TM_LENSTR1( ds_name(dset) ) )//' : "'//
+     .		entry_nam(:TM_LENSTR1(entry_nam))//'='//
+     .		entry(:TM_LENSTR1(entry))//'"',
+     .		*5000 )
+ 5030	CALL ERRMSG( ferr_prog_limit, status,
+     .		ds_name(dset)( :TM_LENSTR1( ds_name(dset) ) )//
+     .		' :no room for air temp data set '// entry(:4),
+     .		*5000 )
+
+	END
diff --git a/fer/ino/init_ez_dset.F b/fer/ino/init_ez_dset.F
new file mode 100644
index 0000000..a66de8e
--- /dev/null
+++ b/fer/ino/init_ez_dset.F
@@ -0,0 +1,373 @@
+	SUBROUTINE INIT_EZ_DSET( dset_name, dset, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize a data set of type "EZ" (simple ASCII or unformatted file with
+* no attendant descriptor
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/20/89
+*	  2/2/90 - make sure its really an EZ set
+*	  2/8/90 - default /VAR is "V1"
+*	 3/27/90 - cancel data set (vs warning) if /VAR or /COL is changed
+*	  4/2/90 - cancel data set (vs warning) if already_init
+* Unix/RISC port - filesystem specific needs - new routine to evaluate path
+*                - and longer saved descriptor name
+* V3.1      5/94 - added /ORDER= 
+* V320  11/94 - *sh* IBM port - need to pass 4 character blank in TM_INQ_PATH
+*       11/94 - title needs to be case sensitive
+* V420 (V411) 10/95 - for IBM port change "READ(dset_name,*" to use '(I)'
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*	    4/97 *kob* - added ifdef for MANDATORY_FORMAT_WIDTHS on internal
+*			 read because linux/nag f90 needed a format width.
+* V450 7/97 - Increase array var_list holding dset var names
+*      7/98 *js*   Mods to support new /swap and /type qualifiers for stream
+*                  datasets
+* 3/99 *kob* - nag F90 wants to use eqv for logical expressions
+* 5/99 *sh* - added arguments to EQUAL_PERMUTE call
+* V510 *sh* 3/00 - increased allowable filename length
+*	    4/00 - bump use counts on grids and axes used by this data set
+* V530 *sh* 10/00 - added /FORMAT=delimited/TYPE=data_types
+* V533 *sh* 7/01 - bug fix: filenames beginning with digits
+* V540 *sh* 10/01 - bug fig -- process TMAP error from ez_init_dset
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+* v604 *acm* 7/07  increase length of ds_name
+* v614 *acm* 11/08 robust fix for bug 287: filenames beginning with digits. 
+*                  Check if the filename contains characters other than digits.
+* V64  10/09 *acm* longer string length for grid_name
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 cleanup old VMS ifdef
+* V687  2.14 *acm* fix ticket 2144: Make buffer for list of varnames longer
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER		dset, status, i
+	CHARACTER	dset_name*(*)
+
+* internal variable declarations:
+	INTEGER		nferdimsp1 
+	PARAMETER	(nferdimsp1 = nferdims+1)
+	LOGICAL		TM_DIGIT, VALID_GRID, its_delimited,
+     .			have_mods, already_init, by_number, swap
+	LOGICAL         have_type
+	INTEGER		TM_LENSTR1, TM_DSET_NUMBER, GRID_FROM_NAME,
+     .			tmap_status, loc, skip, grid, columns,
+     .			order(nferdimsp1), idim, s1, slen, ndigits
+	CHARACTER	TM_INQ_PATH*2048, var_list*2048,
+     .			path_name*2048, ezform*80, title*128, grid_name*64,
+     .			type*2048, ctype*16, delim*24
+	REAL		rval
+
+* local parameter declarations
+	CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* functions
+	INTEGER         br_set_type
+* initialize
+	have_mods = .FALSE.
+	swap = .FALSE.
+	have_type = .FALSE.
+
+* interpret the data set name or number given
+* 3 possibilities:
+*   i) dset implied from current default
+*  ii) dset given by number
+* iii) dset given by name  
+	IF ( dset_name .EQ. ' ' ) THEN
+	   by_number = .TRUE.
+	   already_init = .TRUE.
+	   dset = cx_data_set(cx_last)
+	   GOTO 200
+	ELSEIF ( TM_DIGIT(dset_name) ) THEN
+* *kob* 4/97
+#ifdef MANDATORY_FORMAT_WIDTHS
+	   READ (dset_name,*,ERR=100) dset	! 10/95
+#else
+	   READ (dset_name,'(I)',ERR=100) dset	! 10/95
+#endif
+
+* Is this a dataset name that starts with a number ?
+* (some compilers get an error on the above read if
+*  dset_namecontains other than digits, some do not.)
+
+	   slen = TM_LENSTR1(dset_name)
+	   ndigits = 1
+	   IF (dset .GE. 10) ndigits = 2
+	   IF (slen .GT. ndigits) THEN
+              s1 = ndigits + 1
+              DO 80, i = s1,slen
+	         IF (.NOT. TM_DIGIT(dset_name(i:i)) ) GOTO 100
+  80	      CONTINUE
+           ENDIF
+	      
+	   by_number = .TRUE.
+	   already_init = .TRUE.
+	   GOTO 200
+	ENDIF
+
+* open data set by name
+ 100	by_number = .FALSE.
+#ifdef unix
+        path_name = TM_INQ_PATH( dset_name, 'FER_DATA', '    ',
+     .                                   .TRUE., TMAP_status )
+#else
+	path_name = TM_INQ_PATH( dset_name, 'FER_DATA', 'data.dat', .TRUE.,
+     .					  TMAP_status )
+#endif
+	IF ( TMAP_status .EQ. merr_notmounted ) GOTO 5400
+	IF ( TMAP_status .NE. merr_ok ) GOTO 5900
+	dset = TM_DSET_NUMBER( path_name )
+	already_init = dset .NE. unspecified_int4
+
+ 200	IF ( by_number ) THEN
+	   IF   ( dset .LT. 1
+     .	   .OR.   dset .GT. maxdsets
+     .	   .OR.   dset .GT. max_gfdl_dsets )		GOTO 5300
+	   IF ( ds_name( dset ) .EQ. char_init40 )	GOTO 5300
+	ENDIF
+
+* already initialized ? - cancel it
+	IF ( already_init ) THEN
+* ... is it an EZ set ?
+	   IF ( ds_type(dset) .NE. '  EZ' ) GOTO 5100
+	   CALL PURGE_DSET( dset )	! remove memory-resident variables
+	   CALL PURGE_ALL_UVARS		! delete (possibly dependent) uvars
+* (note: this purge is unnecessarily strict - could be refined in the future)
+
+	   CALL CANCEL_DATA_SET( dset, .FALSE., status )
+	
+	   IF ( status .NE. ferr_ok ) RETURN
+	   already_init = .FALSE.
+	ENDIF
+
+* get number of columns if specified
+	loc = qual_given( slash_set_data_column )
+	IF ( loc .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   rval, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   columns = INT( rval )
+	ELSE
+	   columns = int4_init
+	ENDIF
+
+* read the file format
+        loc = qual_given( slash_set_data_form )
+        IF ( loc .GT. 0 ) THEN
+           have_mods = .TRUE.
+           CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        ezform, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   its_delimited = ezform(1:4) .EQ. 'DELI'
+        ELSE
+           ezform = char_init16
+	   its_delimited = .FALSE.
+        ENDIF
+
+* the /TYPE qualifier may refer to either delimited reads or binary reads
+* Note: "?TYPE" is overloaded -- used independently for STREAM and
+* DELIMITED format reads
+        loc = qual_given( slash_set_data_type )
+	IF ( loc .EQ. 0 ) THEN
+	   IF (its_delimited) THEN
+	      type = ' '  ! to be determined in ez_init_dset
+	   ELSE
+#ifdef double_p
+	      type = 'R8'  ! default for stream reads
+#else
+	      type = 'R4'  ! default for stream reads
+#endif
+	   ENDIF
+	ELSE
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      type, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF (.NOT.its_delimited) have_type = .TRUE. ! Joe's binary stream
+	ENDIF
+
+* /DELIMIT=
+	loc = qual_given( slash_set_data_delimiters )
+	IF ( loc .GT. 0 ) THEN
+	   IF (.NOT.its_delimited) GOTO 5450
+	   CALL EQUAL_DELIMIT(
+     .			cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			delim, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   delim = tab//','//CHAR(0)  ! NULL terminated
+	ENDIF
+
+* get list of variable names: SET DATA/EZ/VAR="..." name 
+	loc = qual_given( slash_set_data_var )
+	IF ( loc .EQ. 0 ) THEN
+	   var_list = ' '
+	ELSE
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      var_list, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* /SKIP
+	loc = qual_given( slash_set_data_skip )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   rval, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   skip = INT( rval )
+	ELSE
+	   skip = 0  ! was int4_init pre 10/00
+	ENDIF
+
+	CALL EZ_INIT_DSET( path_name, ezform, var_list, type, delim,
+     .			   skip, columns, dset, tmap_status )
+	IF ( tmap_status .NE. merr_ok ) GOTO 5900
+
+* always process any other qualifiers given
+	loc = qual_given( slash_set_data_title )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      title, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   title = char_init80
+	ENDIF
+	loc = qual_given( slash_set_data_order )    ! 5/94
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_PERMUTE( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                         .TRUE., .TRUE., .FALSE., order, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   DO 500 idim = 1,nferdimsp1
+ 500	   order(idim) = idim
+	ENDIF
+	loc = qual_given( slash_set_data_grid )
+	IF ( loc .GT. 0 ) THEN
+	   have_mods = .TRUE.
+           CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      grid_name, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   grid = GRID_FROM_NAME( grid_name, cx_last, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   IF ( .NOT.VALID_GRID( grid ) ) GOTO 5500
+	ELSEIF ( .NOT.already_init ) THEN
+* ... insert the default defining grid
+	   have_mods = .TRUE.
+	   grid = mgrid_ez_dflt
+	ELSE
+	   grid = int4_init
+	ENDIF
+
+c       /swap
+	loc = qual_given(slash_set_data_swap)
+	if (loc .GT. 0) then
+	   swap = .TRUE.
+	END IF
+	   
+	IF ( have_mods ) THEN
+	   CALL EZ_MOD_DSET( dset, title, ezform, grid, skip, order,
+     .				tmap_status )
+	   IF ( tmap_status .NE. merr_ok ) GOTO 5900
+	ENDIF
+
+* Make sure no v permutations are defined for non-stream formats,
+* and don't allow /swap or /type flags 
+	if (ezform(:3) .NE. 'STR') then
+	   do i=1,nferdims
+	      if (order(i) .eq. nferdimsp1) goto 5700
+	   end do
+* 3/99 *kob* - nag F90 wants to use eqv for logical expressions
+	   if (swap .eqv. .TRUE. .or. have_type .eqv. .TRUE.) then
+	      goto 5800
+	   end if
+	else
+	   call toChar(type, ctype)
+	   if (BR_SET_TYPE(ctype) .EQ. 0) goto 5600
+	   call BR_SET_ATTS(order, swap)
+	end if
+
+
+* bump use counts on grids and axes used by this data set
+	CALL TM_DSET_USE_GRIDS( dset )
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5050	CALL ERRMSG( ferr_erreq, status, dset_name, *5000 )
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		ds_name(dset)(:TM_LENSTR1(ds_name(dset)))//
+     .		' is not an EZ data set', *5000 )
+ 5300	CALL ERRMSG( ferr_unknown_data_set, status,
+     .		'invalid data set number for SET DATA/EZ', *5000 )
+ 5400	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5000 )
+ 5450	CALL ERRMSG(ferr_invalid_command, status,
+     .        '/DELIMIT only allowed for DELIMITED format', 
+     .        *5000)
+ 5500	CALL ERRMSG( ferr_grid_definition, status, grid_name, *5000 )
+ 5600	call errmsg(ferr_invalid_command, status,
+     .        'invalid argument for /TYPE', *5000)
+ 5700	CALL ERRMSG(ferr_invalid_command, status,
+     .        'variable permutations only allowed for STREAM format', 
+     .        *5000)
+ 5800	CALL ERRMSG(ferr_invalid_command, status,
+     .        '/SWAP or /TYPE only allowed for STREAM format', 
+     .        *5000)
+ 5900	CALL ERRMSG ( ferr_TMAP_error, status, ' ', *5000 ) 
+	END
diff --git a/fer/ino/make_cvar_grids.F b/fer/ino/make_cvar_grids.F
new file mode 100644
index 0000000..11a5a0d
--- /dev/null
+++ b/fer/ino/make_cvar_grids.F
@@ -0,0 +1,116 @@
+	SUBROUTINE MAKE_CVAR_GRIDS ( dset, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find or make a full grid, including a time axis, for each cvar variable in 
+* the given data set based on information stored in COMMON by INIT_DSET.
+* results are stored COMMON/~VARIABLES/ in cvar_grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -11/17/88 - based on MAKE_DS_4D_GRIDS v1.0
+*			   new io library does file variables - only cvars here
+* Unix/RISC port - 1/91 - cant use "/star" in comments on Unix
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 changes for 6D Ferret
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xdset_parms.cmn'
+
+* calling argument declarations
+	INTEGER	dset, status
+
+* local variable declarations
+	INTEGER	TM_LENSTR1, fvar, cvar, idim, iline, slen
+	CHARACTER TM_FMT*4, gname*8
+
+* * * * CALCULATED VARIABLES
+	IF ( .NOT.( dp_phil_sieg(dset) .OR. dp_cox(dset) ) ) THEN
+* not available: not Philander/Siegel or Cox
+	   DO 150 cvar = 1, num_calc_vars
+ 150	   cvar_grid( cvar, dset ) = unspecified_int4
+
+	ELSE
+* create a template for the unchanging grid stuff
+	   DO 200 idim = 1, 4
+ 200	   grid_out_prod( idim, mgrid_buff ) = .TRUE.
+	   grid_line( t_dim, mgrid_buff ) = ds_time_axis( dset )
+
+	   DO 320 cvar = 1, num_calc_vars
+
+* fill in the spacial axes for the grid to look for
+	      DO 310 idim = 1,3
+	         IF ( cvar_axes( idim, cvar ) .EQ. mnormal ) THEN
+	            grid_line( idim, mgrid_buff ) = mnormal
+	         ELSE
+	            grid_line( idim, mgrid_buff ) =
+     .			ds_basic_axes( cvar_axes(idim,cvar)-1, dset )
+	         ENDIF
+ 310	      CONTINUE
+
+* make a plausible name for the new grid (e.g. GPCDZ1)
+	      gname = 'G' // cvar_name_code(cvar)
+     .			  // TM_FMT( REAL(dset), 4, 4, slen )
+
+* make sure name is unique
+	      CALL TM_NEW_GRID_NAME( gname, gname )
+
+* save it or use an identical one that already exists
+	      CALL TM_GET_LIKE_GRID( mgrid_buff, gname,
+     .				     cvar_grid(cvar,dset), status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+ 320	   CONTINUE
+	ENDIF
+
+* successful completion
+	status = ferr_ok
+ 	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/ino/read_binary.F b/fer/ino/read_binary.F
new file mode 100644
index 0000000..4464872
--- /dev/null
+++ b/fer/ino/read_binary.F
@@ -0,0 +1,291 @@
+	SUBROUTINE READ_BINARY ( memory, cx, mr, status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a stream formatted file 
+* stolen from read_ez
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* 7/98 *js*  First version hacked from read_ez
+* 3/99 *kob* - nag F90 wants to use eqv for logical expressions
+* V552 4/03 *acm* Up VAR_CODE to 128 characters
+* V552 5/03 *acm* Use ds_des_name(data_set) when opening the data; it has
+*                 the pathname as well as the filename
+* v604 *acm* 7/07 increase length of ds_name
+* V63  *acm* 10/09 Changes for gfortran build
+*       *acm* 3/12 cleanup old VMS ifdef
+* V685 *acm* 1/13  Ticket 2030: if we run out of memory, issue a new message
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status, fstatus
+	REAL	memory( mem_blk_size, max_mem_blks ), fdummy(1)
+
+* functions
+	INTEGER BR_OPEN, BR_READ, BR_ADD_VAR
+
+* internal variable declarations:
+	INTEGER		nferdimsp1 
+	PARAMETER	(nferdimsp1 = nferdims+1)
+	INTEGER 	CGRID_SIZE, 
+     .			idim, ask_var, category, data_set, grid, ivar,
+     .			fvar, nvar20, the_var, nleft, 
+     .			cx0, cx1, cx20(20), mr20(20),
+     .			mr1, rec1, scnt,
+     .			rec_to_read, nrepeat, columns, num_names, buffblk
+	INTEGER         lengths(nferdimsp1), permutes(nferdimsp1), skip, doRead
+	LOGICAL         firstTime
+	CHARACTER	VAR_CODE*128
+	CHARACTER*256   cerrmsg,ferrmsg
+        CHARACTER*1024  cname
+
+* --- end of introductory code ---
+
+* nvar20  and the_var - value from 1 to 20      --> variable # within EZ set
+* ask_var and fvar    - value from 1 to maxvars --> var # within DSET common
+
+* initialize
+	cx0 = cx_stack_ptr
+	data_set = cx_data_set( cx )
+	category = cx_category( cx )
+	ask_var  = cx_variable( cx )
+	grid = cx_grid( cx )
+	fvar      = 0
+	nvar20    = 0
+	rec_to_read = 2**30      ! was 99999 - limited file reads
+	firstTime = .true.
+	skip = 0
+	doRead = 0
+
+* how many values of each variable are repeated on each record ?
+	columns = ds_ntuple(data_set)
+	num_names = ds_basic_axes(1, data_set)
+	nrepeat = columns / num_names
+
+* purge from memory any variables from this data set to avoid duplication
+* (1 variable may be deleted at any time by memory management but this routine
+*  always reads all of 'em)
+* note: problem arises if variable is in use
+!	CALL PURGE_DSET( data_set )
+
+* create a memory variable for each of up-to-20 variables in the file
+	DO ivar = 1, 20
+
+* ... locate the next variable in this data set
+	   DO fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum( fvar ) .EQ. data_set ) then
+* ... is it a dummy '-' placeholder in the variable list ?
+ 		 IF (INDEX( ds_var_code(fvar),'-') .EQ. 0 ) THEN
+
+* save record of which is the desired var
+		    nvar20 = nvar20 + 1
+		    IF ( fvar .EQ. ask_var ) the_var = nvar20
+
+* ... create a context describing this variable
+		    CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+		    IF ( status .NE. ferr_ok ) RETURN
+		    cx20(nvar20) = cx_stack_ptr
+		    CALL TRANSFER_CONTEXT( cx, cx_stack_ptr )
+		    cx_variable( cx_stack_ptr ) = fvar
+		    cx_grid( cx_stack_ptr ) = ds_grid_number( fvar )
+		    cx_bad_data( cx_stack_ptr ) = ds_bad_flag( fvar ) ! 12/93 add'n
+		    DO idim = 1, nferdims
+		       cx_lo_ss( cx_stack_ptr, idim ) = ds_grid_start( idim, fvar )
+		       cx_hi_ss( cx_stack_ptr, idim ) = ds_grid_end  ( idim, fvar )
+		       cx_by_ss( idim, cx_stack_ptr ) = .TRUE.
+* 3/99 *kob* - nag F90 wants to use eqv for logical expressions
+		       if (firstTime .eqv. .TRUE.) THEN
+			  lengths(idim) = ds_grid_end(idim,fvar) - 
+     .		          ds_grid_start(idim,fvar) + 1
+		       end if
+		       CALL CONFINE_AXIS( idim, cx_stack_ptr, status )
+		       IF ( status .NE. ferr_ok ) RETURN
+		       CALL FLESH_OUT_AXIS( idim, cx_stack_ptr, status )
+		       IF ( status .NE. ferr_ok ) RETURN
+		    END DO
+		    firstTime = .FALSE.
+
+*       read only what will fit into smallest grid
+		    rec1 = CGRID_SIZE(cx_stack_ptr) / nrepeat
+		    rec_to_read = MIN( rec_to_read, rec1 )
+
+*       reserve and catalog space for the result
+		    CALL CREATE_MEM_VAR( cx_stack_ptr, mr20(nvar20), status )
+		    IF ( status .NE. ferr_ok ) GOTO 5000
+		 END IF
+	      END IF
+	   END DO
+	END DO
+
+* point to asked-for variable and create dummy entries for the rest
+ 500	mr = mr20( the_var )
+	DO nleft = nvar20+1, 20
+	   mr20(nleft) = dummy_mr
+	END DO
+	
+* allocate a buffer big enough for one record
+        CALL GET_WORK_SPC( columns, buffblk, status )	! was "nrepeat" B4 3/95
+	IF ( status .NE. merr_ok ) GOTO 5500
+
+* Get the current permutation list
+	CALL BR_GET_PERMUTES(permutes)
+
+* Get the skip header
+	do scnt = 1, maxstepfiles
+	   if (sf_setnum(scnt) .EQ. data_set) then
+	      skip = sf_skip(scnt)
+	      goto 3000
+	   end if
+	end do
+ 3000	continue
+
+* initialize the binary reader
+!	call toChar(ds_name(data_set), cname)
+	call toChar(ds_des_name(data_set), cname)
+	if (BR_OPEN(cname, lengths, permutes,
+     1      skip) .eq. 0) goto 6000
+
+	fvar = 0
+	nvar20 = 0
+	DO ivar = 1, 20
+	   DO fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum( fvar ) .EQ. data_set ) then
+ 		 IF (INDEX( ds_var_code(fvar),'-') .EQ. 0 ) THEN
+		    doRead = 1
+		    nvar20 = nvar20 + 1
+		    fstatus = BR_ADD_VAR(memory(1, mr_blk1(mr20(nvar20))),
+     1		                 doRead)
+		 ELSE
+		    doRead = 0
+		    fstatus = BR_ADD_VAR(fdummy, doRead)
+		 END IF
+		 if (fstatus .EQ. 0) goto 6000
+	      END IF
+	   END DO
+	END DO
+
+
+* read the data
+	if (BR_READ() .EQ. 0) goto 6000
+
+
+
+* free up the buffer space
+        CALL  RELEASE_WORK_SPC
+
+* flag that all the data is available
+	DO 800 ivar = 1, nvar20
+	   mr1 = mr20(ivar)
+	   mr_protected( mr1 ) = mr_not_protected
+	   CALL MR_NOT_IN_USE( mr1 )
+ 800	CONTINUE
+
+* the data region obtained may be inadequate for the request
+* ("cx" is request, "cx1" is available)
+	cx1 = cx20(the_var)
+	DO 900 idim = 1, nferdims
+	   IF ( cx_hi_ss(cx,idim) .GT. cx_hi_ss(cx1,idim) ) THEN
+	      IF ( cx_hi_ss(cx_last,idim) .NE. unspecified_int4
+     .	     .OR.  cx_given(idim,cx) ) THEN
+* ... error: the user explicitly requested more than there is
+	         GOTO 5600
+              ELSEIF (cx_lo_ss(cx,idim) .GT. cx_hi_ss(cx1,idim)) THEN
+* ... requested data is completely out of range of disk data (2/93 bug fix)
+                 GOTO 5600
+	      ELSE
+* ... no error: the region was filled in by FERRET automatically
+	         cx_hi_ss(cx,idim) = cx_hi_ss(cx1,idim)
+	         cx_hi_ww(idim,cx) = cx_hi_ww(idim,cx1)
+	      ENDIF
+	   ENDIF
+ 900	CONTINUE
+
+* successful completion
+	cx_stack_ptr = cx0
+	CALL BR_CLOSE()
+	RETURN
+
+* error exit
+ 4900	nvar20 = nvar20 + 1		! delete all
+ 5000	cx_stack_ptr = cx0
+	IF (nvar20 .GT. 1) THEN
+	   WRITE ( ferrmsg, 1000 ) nvar20
+           CALL WARN (ferrmsg)
+	ENDIF
+ 1000   FORMAT ('Binary file reading: Insufficient memory reading variable ', i4)
+	DO 5010 nleft = 1, nvar20-1	! delete all except last
+ 5010	CALL DELETE_VARIABLE(mr20(nleft))
+        CALL  RELEASE_WORK_SPC
+	CALL BR_CLOSE()
+ 5500	RETURN
+ 5600	CALL ERRMSG( ferr_limits, status,
+     .		ww_dim_name(idim)//' axis of '//VAR_CODE(cat_file_var,ask_var),
+     .		*5500 )
+ 6000	CALL BR_GET_ERROR(cerrmsg)
+	CALL TM_CTOF_STRNG(cerrmsg, ferrmsg, 255)
+	CALL TM_SPLIT_MESSAGE(err_lun, ' **ERROR: '//ferrmsg(1:LEN(ferrmsg)))
+        CALL ERRMSG( ferr_TMAP_error, status, ' ', *4900 )
+	END	
+
+c-------------------------------------------------------------------------------
+c     Convert a Fortran string to a zero delimited C string
+
+      subroutine toChar(fstring, cstring)
+      character*(*) fstring, cstring
+
+      integer TM_LENSTR1
+      integer length
+      
+      length = TM_LENSTR1(fstring)
+      cstring = fstring(1:length)
+      cstring(length+1:length+1) = char(0)
+      return
+      end
diff --git a/fer/ino/read_delimited.F b/fer/ino/read_delimited.F
new file mode 100644
index 0000000..1ef85cb
--- /dev/null
+++ b/fer/ino/read_delimited.F
@@ -0,0 +1,263 @@
+	SUBROUTINE READ_DELIMITED( memory, cx, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read an ASCII delimited file
+* return only the requested variable in "mr"
+* note: always read and store the entire grid limits of data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530: 11/00 *sh*
+* V533: 6/01 *sh* - check that data type is correct instead of asserting it
+* V540: 10/01 *sh* - undo the erroneous change of V533 (why was V533 chg done?)
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars
+*       *acm* 3/12 changes for 6D Ferret
+* V685 *acm* 1/13  Ticket 2030: if we run out of memory, issue a new message
+*                  and only clear the variables that had been initialized.
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'ez_lib.parm'
+	include	'xstep_files.cmn_text'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER 	CGRID_SIZE, CX_DIM_LEN, TM_LENSTR1,
+     .			idim, ask_var, category, dset, grid, ivar,
+     .			fvar, nvar, the_var, nleft, nsize,
+     .			cx0, cx1, nread, istep, nvar20,
+     .			cxlist(maxezvars), mrlist(maxezvars),
+     .			field_type(maxezvars),
+     .			mr1, ndim, las_dim, fst_dim, dims(nferdims),
+     .			rec_to_read, buffblk
+	CHARACTER	VAR_CODE*128, delims*80, errbuff*100
+
+* --- end of introductory code ---
+
+* nvar  and the_var - value from 1 to maxezvars --> variable # within EZ set
+* ask_var and fvar    - value from 1 to maxvars --> var # within DSET common
+
+* initialize
+	cx0 = cx_stack_ptr
+	dset = cx_data_set( cx )
+	category = cx_category( cx )
+	ask_var  = cx_variable( cx )
+	grid = cx_grid( cx )
+	fvar      = 0
+	nvar20    = 0
+	CALL GET_DELIMITED_INFO(nvar, field_type, delims, 
+     .				   ds_file_info_ptr(dset) )
+* locate the step file belonging to this data set
+
+	DO 10 istep = 1,maxstepfiles
+	  IF (sf_setnum(istep) .EQ. dset) GOTO 20
+ 10	CONTINUE
+	CALL ERRMSG( ferr_internal, status, 'delim stepfile?', *5000)
+
+* create a memory variable for each variable in the file
+ 20	DO 400 ivar = 1, nvar
+
+* ... locate the next variable in this data set
+	   DO 100 fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum(fvar) .EQ. dset ) GOTO 110
+ 100	   CONTINUE
+* ... no more
+	   GOTO 500
+
+* ... is it a dummy '-' placeholder in the variable list ?
+ 110	   IF (field_type(ivar) .EQ. FTYP_MISSING) THEN
+	      cxlist(ivar) = 0
+	      mrlist(ivar) = 0
+	   ELSE
+
+* save record of which is the desired var
+	     nvar20 = nvar20 + 1
+
+* ... create a context describing this variable
+	     CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	     IF ( status .NE. ferr_ok ) RETURN
+	     cxlist(ivar) = cx_stack_ptr
+	     CALL TRANSFER_CONTEXT( cx, cx_stack_ptr )
+	     cx_variable( cx_stack_ptr ) = fvar
+	     cx_grid    ( cx_stack_ptr ) = ds_grid_number( fvar )
+	     cx_bad_data( cx_stack_ptr ) = ds_bad_flag( fvar )	! 12/93 add'n
+	     cx_type    ( cx_stack_ptr ) = ds_var_type( fvar )
+	     DO 200 idim = 1, nferdims
+	        cx_lo_ss(cx_stack_ptr, idim) = ds_grid_start(idim, fvar)
+	        cx_hi_ss(cx_stack_ptr, idim) = ds_grid_end  (idim, fvar)
+	        cx_by_ss(idim, cx_stack_ptr) = .TRUE.
+	        CALL CONFINE_AXIS( idim, cx_stack_ptr, status )
+	        IF ( status .NE. ferr_ok ) RETURN
+	        CALL FLESH_OUT_AXIS( idim, cx_stack_ptr, status )
+	        IF ( status .NE. ferr_ok ) RETURN
+ 200	     CONTINUE
+
+* reserve and catalog space for the result
+	     CALL CREATE_MEM_VAR( cx_stack_ptr, mrlist(ivar), status )
+	     IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+
+* save index of the desired var
+	   IF ( fvar .EQ. ask_var ) the_var = ivar
+
+ 400	CONTINUE
+
+* point to asked-for variable and create dummy entries for the rest
+ 500	rec_to_read = CGRID_SIZE(cxlist(the_var))
+	mr = mrlist( the_var )
+	
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('reading',mr,point_to_mr)
+
+* allocate a buffer big enough for one input ASCII record
+        CALL GET_WORK_SPC( 1024, buffblk, status ) ! really 4x1024
+        IF ( status .NE. merr_ok ) GOTO 5500
+
+* create a null terminated string from the data set name (use record buffer)
+	CALL TM_FTOC_STRNG( ds_des_name(dset)
+     .		     (:TM_LENSTR1(ds_des_name(dset))),
+     .		     memory(1,buffblk), 4*1024 )
+
+* read the data via TMAP library routine
+	CALL DECODE_FILE_JACKET (
+     .		  memory(1,buffblk), memory(1,buffblk),
+     .		  delims, sf_skip(istep), rec_to_read, 4*1024, nvar,
+     .		  field_type, nread, mrlist, memory, mr_blk1,
+     .		  mem_blk_size, mr_bad_data, mr_c_pointer)
+
+* update the variables with info about the number of records actually read
+* (for multi-dimensional grid reads just truncate the last axis best we can)
+	IF ( nread .LT. rec_to_read ) THEN
+	   DO 700 ivar = 1, nvar
+	      IF (field_type(ivar) .NE. FTYP_MISSING) THEN
+	        cx1 = cxlist(ivar)
+	        mr1 = mrlist(ivar)
+	        CALL GET_CX_DIMS( cx1, ndim, dims )
+	        fst_dim = dims(1)
+	        IF ( ndim .GT. 0 ) THEN        ! "IF" added 5/5/93
+	           las_dim = dims(ndim)
+	        ELSE
+	           las_dim = fst_dim
+	        ENDIF
+	        IF ( ndim .EQ. 1 ) THEN
+	           nsize = 1
+	        ELSEIF( ndim .EQ. 2 ) THEN
+	           nsize = CX_DIM_LEN(fst_dim,cx1)
+	        ELSE
+	           nsize =  CGRID_SIZE(cx1) / CX_DIM_LEN(las_dim,cx1)
+	        ENDIF
+* ... last dim (each var) is
+*     (total values read)/(prod. of all axis lengths except last)
+	        cx_hi_ss( cx1, las_dim ) = MAX( 1, nread/nsize )
+	        CALL FLESH_OUT_AXIS( las_dim, cx1, status )
+	        IF ( status .NE. ferr_ok ) GOTO 6000
+	        mr_hi_ss( mr1, las_dim ) = cx_hi_ss( cx1, las_dim )
+	        mr_hi_ww( las_dim, mr1 ) = cx_hi_ww( las_dim, cx1 )
+* ... also let the TMAP library know how much is there
+	        ds_grid_end(las_dim, mr_variable(mr1)) = cx_hi_ss( cx1, las_dim )
+	      ENDIF
+ 700	   CONTINUE
+	ENDIF
+
+* flag that all the data is available
+	DO 800 ivar = 1, nvar
+	   IF (field_type(ivar) .NE. FTYP_MISSING) THEN
+	     mr1 = mrlist(ivar)
+	     mr_protected( mr1 ) = mr_not_protected
+	     CALL MR_NOT_IN_USE( mr1 )
+	   ENDIF
+ 800	CONTINUE
+
+* the data region obtained may be inadequate for the request
+* ("cx" is request, "cx1" is available)
+	cx1 = cxlist(the_var)
+	DO 900 idim = 1, nferdims
+	   IF ( cx_hi_ss(cx,idim) .GT. cx_hi_ss(cx1,idim) ) THEN
+	      IF ( cx_given(idim,cx) ) THEN  ! 3/00 cut mystery cx_last ref.
+* ... error: the user explicitly requested more than there is
+	         GOTO 5600
+              ELSEIF (cx_lo_ss(cx,idim) .GT. cx_hi_ss(cx1,idim)) THEN
+* ... requested data is completely out of range of disk data (2/93 bug fix)
+                 GOTO 5600
+	      ELSE
+* ... no error: the region was filled in by FERRET automatically
+	         cx_hi_ss(cx,idim) = cx_hi_ss(cx1,idim)
+	         cx_hi_ww(idim,cx) = cx_hi_ww(idim,cx1)
+	      ENDIF
+	   ENDIF
+ 900	CONTINUE
+
+* set the data type based on the file
+	cx_type(cx) = cx_type(cx1)
+
+* successful completion
+	cx_stack_ptr = cx0
+	RETURN
+
+* error exit
+ 4900	nvar = nvar + 1		! delete all
+ 5000	cx_stack_ptr = cx0
+	IF (nvar20 .GT. 1) THEN
+	   WRITE ( errbuff, 1000 ) nvar20
+           CALL WARN (errbuff)
+	ENDIF
+ 1000   FORMAT ('Delimited file reading: Insufficient memory reading variable ', i4)
+	DO 5010 nleft = 1, nvar20-1	! delete all initialized so far
+ 5010	CALL DELETE_VARIABLE(mrlist(nleft))
+        CALL  RELEASE_WORK_SPC
+ 5500	RETURN
+ 5600	CALL ERRMSG( ferr_limits, status,
+     .		ww_dim_name(idim)//' axis of '//VAR_CODE(cat_file_var,ask_var),
+     .		*5500 )
+ 5650	CALL ERRMSG( ferr_limits, status,
+     .		'/COLUMNS is impossibly large', *5500 )
+ 5700	CALL ERRMSG( ferr_TMAP_error, status, ' ', *4900 )
+ 6000	CALL ERRMSG( ferr_internal, status, 'READ_EZ ??', *4900 )
+	END	
diff --git a/fer/ino/read_ez.F b/fer/ino/read_ez.F
new file mode 100644
index 0000000..5d34478
--- /dev/null
+++ b/fer/ino/read_ez.F
@@ -0,0 +1,288 @@
+	SUBROUTINE READ_EZ ( memory, cx, mr, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a file of EZ-type (ASCII or unformatted) data
+* return only the requested variable in "mr"
+* note: always read and store the entire grid limits of data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  10/89/89
+*	  4/24/90 - bug fix: when this routine determines data limits it must
+*			    pass cx_hi_ww(idim,cx) as well as cx_hi_ss(cx,idim)
+* V230:   7/15/92 - bug fix: was limited to 99999 record read
+*         11/6/92 - increased variable length to 24 characters
+* V300:   2/17/93 - bug fix: when requested lo limit exceeds received hi
+*         3/12/93 - allow unlimited number of columns using FERRET mem mgmt
+*	   5/5/93 - minor bug fix when file has no data and grid is only 1 pt
+* V301:  12/21/93 - need to set separate bad value flag for each variable
+* V312: 5/94 - array "memory" as a calling argument
+* V320: 2/95 - increased number of readable vars from 10 to 20
+*	3/95 - fixed bug - reserve "buff" of size "column" instead of "nrepeat"
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars
+* V510: *sh* 3/00 - bug fix: needless (?) reference to cx_last
+*		(see err500_2nd_try.jnl)
+* V510: 6/00 *sh* - bug fix trap /COLUMNS= >grid size
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars
+*       *acm* 3/12 cleanup old VMS ifdef
+* V685 *acm* 1/13  Ticket 2030: if we run out of memory, issue a new message
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER 	CGRID_SIZE, CX_DIM_LEN,
+     .			idim, ask_var, category, data_set, grid, ivar,
+     .			fvar, nvar20, the_var, nleft, nsize,
+     .			cx0, cx1, cx20(20), mr20(20), nread,
+     .			mr1, ndim, las_dim, fst_dim, dims(nferdims), rec1,
+     .			rec_to_read, nrepeat, columns, num_names, buffblk
+	CHARACTER	VAR_CODE*128, errbuff*100
+
+* --- end of introductory code ---
+
+* nvar20  and the_var - value from 1 to 20      --> variable # within EZ set
+* ask_var and fvar    - value from 1 to maxvars --> var # within DSET common
+
+* initialize
+	cx0 = cx_stack_ptr
+	data_set = cx_data_set( cx )
+	category = cx_category( cx )
+	ask_var  = cx_variable( cx )
+	grid = cx_grid( cx )
+	fvar      = 0
+	nvar20    = 0
+	rec_to_read = 2**30      ! was 99999 - limited file reads
+
+* how many values of each variable are repeated on each record ?
+	columns = ds_ntuple(data_set)
+	num_names = ds_basic_axes(1, data_set)
+	nrepeat = columns / num_names
+
+* purge from memory any variables from this data set to avoid duplication
+* (1 variable may be deleted at any time by memory management but this routine
+*  always reads all of 'em)
+* note: problem arises if variable is in use
+!	CALL PURGE_DSET( data_set )
+
+* create a memory variable for each of up-to-20 variables in the file
+	DO 400 ivar = 1, 20
+
+* ... locate the next variable in this data set
+	   DO 100 fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum( fvar ) .EQ. data_set ) GOTO 110
+ 100	   CONTINUE
+* ... no more
+	   GOTO 500
+
+* ... is it a dummy '-' placeholder in the variable list ?
+ 110	   IF (INDEX( ds_var_code(fvar),'-') .NE. 0 ) GOTO 400
+
+* save record of which is the desired var
+	   nvar20 = nvar20 + 1
+	   IF ( fvar .EQ. ask_var ) the_var = nvar20
+
+* ... create a context describing this variable
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   cx20(nvar20) = cx_stack_ptr
+	   CALL TRANSFER_CONTEXT( cx, cx_stack_ptr )
+	   cx_variable( cx_stack_ptr ) = fvar
+	   cx_grid( cx_stack_ptr ) = ds_grid_number( fvar )
+	   cx_bad_data( cx_stack_ptr ) = ds_bad_flag( fvar )	! 12/93 add'n
+	   DO 200 idim = 1, nferdims
+	      cx_lo_ss( cx_stack_ptr, idim ) = ds_grid_start( idim, fvar )
+	      cx_hi_ss( cx_stack_ptr, idim ) = ds_grid_end  ( idim, fvar )
+	      cx_by_ss( idim, cx_stack_ptr ) = .TRUE.
+	      CALL CONFINE_AXIS( idim, cx_stack_ptr, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      CALL FLESH_OUT_AXIS( idim, cx_stack_ptr, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+ 200	   CONTINUE
+
+* read only what will fit into smallest grid
+	   rec1 = CGRID_SIZE(cx_stack_ptr) / nrepeat
+	   rec_to_read = MIN( rec_to_read, rec1 )
+	   IF (rec_to_read .LE. 0 ) GOTO 5650
+
+* reserve and catalog space for the result
+	   CALL CREATE_MEM_VAR( cx_stack_ptr, mr20(nvar20), status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+ 400	CONTINUE
+
+* point to asked-for variable and create dummy entries for the rest
+ 500	mr = mr20( the_var )
+	DO 600 nleft = nvar20+1, 20
+ 600	mr20(nleft) = dummy_mr
+	
+* allocate a buffer big enough for one record
+        CALL GET_WORK_SPC( columns, buffblk, status )	! was "nrepeat" B4 3/95
+	IF ( status .NE. merr_ok ) GOTO 5500
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('reading',mr,point_to_mr)
+
+* read the data via TMAP library routine
+	nread = rec_to_read
+
+	CALL EZ_READ( data_set, nread, nrepeat, columns,
+     .          memory( 1, buffblk), status,
+     .		memory( 1, mr_blk1(mr20( 1)) ),
+     .		memory( 1, mr_blk1(mr20( 2)) ),
+     .		memory( 1, mr_blk1(mr20( 3)) ),
+     .		memory( 1, mr_blk1(mr20( 4)) ),
+     .		memory( 1, mr_blk1(mr20( 5)) ),
+     .		memory( 1, mr_blk1(mr20( 6)) ),
+     .		memory( 1, mr_blk1(mr20( 7)) ),
+     .		memory( 1, mr_blk1(mr20( 8)) ),
+     .		memory( 1, mr_blk1(mr20( 9)) ),
+     .		memory( 1, mr_blk1(mr20(10)) ),
+     .		memory( 1, mr_blk1(mr20(11)) ),
+     .		memory( 1, mr_blk1(mr20(12)) ),
+     .		memory( 1, mr_blk1(mr20(13)) ),
+     .		memory( 1, mr_blk1(mr20(14)) ),
+     .		memory( 1, mr_blk1(mr20(15)) ),
+     .		memory( 1, mr_blk1(mr20(16)) ),
+     .		memory( 1, mr_blk1(mr20(17)) ),
+     .		memory( 1, mr_blk1(mr20(18)) ),
+     .		memory( 1, mr_blk1(mr20(19)) ),
+     .		memory( 1, mr_blk1(mr20(20)) )  )
+	IF ( status .NE. merr_ok ) GOTO 5700
+
+* free up the buffer space
+        CALL  RELEASE_WORK_SPC
+
+* update the variables with info about the number of records actually read
+* (for multi-dimensional grid reads just truncate the last axis best we can)
+	IF ( nread .LT. rec_to_read ) THEN
+	   DO 700 ivar = 1, nvar20
+	      cx1 = cx20(ivar)
+	      mr1 = mr20(ivar)
+	      CALL GET_CX_DIMS( cx1, ndim, dims )
+	      fst_dim = dims(1)
+	      IF ( ndim .GT. 0 ) THEN        ! "IF" added 5/5/93
+	         las_dim = dims(ndim)
+	      ELSE
+	         las_dim = fst_dim
+	      ENDIF
+	      IF ( ndim .EQ. 1 ) THEN
+	         nsize = 1
+	      ELSEIF( ndim .EQ. 2 ) THEN
+	         nsize = CX_DIM_LEN(fst_dim,cx1)
+	      ELSE
+	         nsize =  CGRID_SIZE(cx1) / CX_DIM_LEN(las_dim,cx1)
+	      ENDIF
+* ... last dim (each var) is
+*     (total values read)/(prod. of all axis lengths except last)
+	      cx_hi_ss( cx1, las_dim ) = MAX( 1, nrepeat*nread/nsize )
+	      CALL FLESH_OUT_AXIS( las_dim, cx1, status )
+	      IF ( status .NE. ferr_ok ) GOTO 6000
+	      mr_hi_ss( mr1, las_dim ) = cx_hi_ss( cx1, las_dim )
+	      mr_hi_ww( las_dim, mr1 ) = cx_hi_ww( las_dim, cx1 )
+* ... also let the TMAP library know how much is there
+	      ds_grid_end(las_dim, mr_variable(mr1)) = cx_hi_ss( cx1, las_dim )
+ 700	   CONTINUE
+	ENDIF
+
+* flag that all the data is available
+	DO 800 ivar = 1, nvar20
+	   mr1 = mr20(ivar)
+	   mr_protected( mr1 ) = mr_not_protected
+	   CALL MR_NOT_IN_USE( mr1 )
+ 800	CONTINUE
+
+* the data region obtained may be inadequate for the request
+* ("cx" is request, "cx1" is available)
+	cx1 = cx20(the_var)
+	DO 900 idim = 1, nferdims
+	   IF ( cx_hi_ss(cx,idim) .GT. cx_hi_ss(cx1,idim) ) THEN
+	      IF ( cx_given(idim,cx) ) THEN  ! 3/00 cut mystery cx_last ref.
+* ... error: the user explicitly requested more than there is
+	         GOTO 5600
+              ELSEIF (cx_lo_ss(cx,idim) .GT. cx_hi_ss(cx1,idim)) THEN
+* ... requested data is completely out of range of disk data (2/93 bug fix)
+                 GOTO 5600
+	      ELSE
+* ... no error: the region was filled in by FERRET automatically
+	         cx_hi_ss(cx,idim) = cx_hi_ss(cx1,idim)
+	         cx_hi_ww(idim,cx) = cx_hi_ww(idim,cx1)
+	      ENDIF
+	   ENDIF
+ 900	CONTINUE
+
+* successful completion
+	cx_stack_ptr = cx0
+	RETURN
+
+* error exit
+ 4900	nvar20 = nvar20 + 1		! delete all
+ 5000	cx_stack_ptr = cx0
+	IF (nvar20 .GT. 1) THEN
+	   WRITE ( errbuff, 1000 ) nvar20
+           CALL WARN (errbuff)
+	ENDIF
+ 1000   FORMAT ('ASCII file reading: Insufficient memory reading variable ', i4)
+	DO 5010 nleft = 1, nvar20-1	! delete all except last
+ 5010	CALL DELETE_VARIABLE(mr20(nleft))
+        CALL  RELEASE_WORK_SPC
+ 5500	RETURN
+ 5600	CALL ERRMSG( ferr_limits, status,
+     .		ww_dim_name(idim)//' axis of '//VAR_CODE(cat_file_var,ask_var),
+     .		*5500 )
+ 5650	CALL ERRMSG( ferr_limits, status,
+     .		'/COLUMNS is impossibly large', *5500 )
+ 5700	CALL ERRMSG( ferr_TMAP_error, status, ' ', *4900 )
+ 6000	CALL ERRMSG( ferr_internal, status, 'READ_EZ ??', *4900 )
+	END	
+
diff --git a/fer/ino/read_perl.F b/fer/ino/read_perl.F
new file mode 100644
index 0000000..fcfdd4f
--- /dev/null
+++ b/fer/ino/read_perl.F
@@ -0,0 +1,246 @@
+
+
+	SUBROUTINE READ_PERL ( memory, cx, mr, status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a stream formatted file 
+* stolen from read_ez
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* 9/99 *js*  First version hacked from read_binary
+* V552 *acm* 4/03- up VAR_CODE  to 128
+* v604 *acm* 7/07 increase length of ds_name
+* V63  *acm* 10/09 Changes for 1 build
+*       *acm* 3/12 cleanup old VMS ifdef
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status, fstatus
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* functions
+	INTEGER PL_OPEN, PL_READ_VAR
+
+* internal variable declarations:
+	INTEGER		nferdimsp1 
+	PARAMETER	(nferdimsp1 = nferdims+1)
+	INTEGER 	CGRID_SIZE, 
+     .			idim, ask_var, category, data_set, grid, ivar,
+     .			fvar, nvar20, the_var, nleft, 
+     .			cx0, cx1, cx20(20), mr20(20),
+     .			mr1, rec1, 
+     .			rec_to_read, nrepeat, columns, num_names, buffblk
+	INTEGER         lengths(nferdimsp1)
+	LOGICAL         firstTime
+	CHARACTER	VAR_CODE*128
+	CHARACTER*256   cerrmsg,ferrmsg
+	CHARACTER*1024  cname
+
+* --- end of introductory code ---
+
+* nvar20  and the_var - value from 1 to 20      --> variable # within EZ set
+* ask_var and fvar    - value from 1 to maxvars --> var # within DSET common
+
+* initialize
+	cx0 = cx_stack_ptr
+	data_set = cx_data_set( cx )
+	category = cx_category( cx )
+	ask_var  = cx_variable( cx )
+	grid = cx_grid( cx )
+	fvar      = 0
+	nvar20    = 0
+	rec_to_read = 2**30      ! was 99999 - limited file reads
+	firstTime = .true.
+
+* how many values of each variable are repeated on each record ?
+	columns = ds_ntuple(data_set)
+	num_names = ds_basic_axes(1, data_set)
+	nrepeat = columns / num_names
+
+* purge from memory any variables from this data set to avoid duplication
+* (1 variable may be deleted at any time by memory management but this routine
+*  always reads all of 'em)
+* note: problem arises if variable is in use
+!	CALL PURGE_DSET( data_set )
+
+* create a memory variable for each of up-to-20 variables in the file
+	DO ivar = 1, 20
+
+* ... locate the next variable in this data set
+	   DO fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum( fvar ) .EQ. data_set ) then
+* ... is it a dummy '-' placeholder in the variable list ?
+ 		 IF (INDEX( ds_var_code(fvar),'-') .EQ. 0 ) THEN
+
+* save record of which is the desired var
+		    nvar20 = nvar20 + 1
+		    IF ( fvar .EQ. ask_var ) the_var = nvar20
+
+* ... create a context describing this variable
+		    CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+		    IF ( status .NE. ferr_ok ) RETURN
+		    cx20(nvar20) = cx_stack_ptr
+		    CALL TRANSFER_CONTEXT( cx, cx_stack_ptr )
+		    cx_variable( cx_stack_ptr ) = fvar
+		    cx_grid( cx_stack_ptr ) = ds_grid_number( fvar )
+		    cx_bad_data( cx_stack_ptr ) = ds_bad_flag( fvar ) ! 12/93 add'n
+		    DO idim = 1, nferdims
+		       cx_lo_ss( cx_stack_ptr, idim ) = ds_grid_start( idim, fvar )
+		       cx_hi_ss( cx_stack_ptr, idim ) = ds_grid_end  ( idim, fvar )
+		       cx_by_ss( idim, cx_stack_ptr ) = .TRUE.
+* 3/99 *kob* - nag F90 wants to use eqv for logical expressions
+		       if (firstTime .eqv. .TRUE.) THEN
+			  lengths(idim) = ds_grid_end(idim,fvar) - 
+     .		          ds_grid_start(idim,fvar) + 1
+		       end if
+		       CALL CONFINE_AXIS( idim, cx_stack_ptr, status )
+		       IF ( status .NE. ferr_ok ) RETURN
+		       CALL FLESH_OUT_AXIS( idim, cx_stack_ptr, status )
+		       IF ( status .NE. ferr_ok ) RETURN
+		    END DO
+		    firstTime = .FALSE.
+
+*       read only what will fit into smallest grid
+		    rec1 = CGRID_SIZE(cx_stack_ptr) / nrepeat
+		    rec_to_read = MIN( rec_to_read, rec1 )
+
+*       reserve and catalog space for the result
+		    CALL CREATE_MEM_VAR( cx_stack_ptr, mr20(nvar20), status )
+		    IF ( status .NE. ferr_ok ) GOTO 5000
+		 END IF
+	      END IF
+	   END DO
+	END DO
+
+* point to asked-for variable and create dummy entries for the rest
+ 500	mr = mr20( the_var )
+	DO nleft = nvar20+1, 20
+	   mr20(nleft) = dummy_mr
+	END DO
+	
+* allocate a buffer big enough for one record
+        CALL GET_WORK_SPC( columns, buffblk, status )	! was "nrepeat" B4 3/95
+	IF ( status .NE. merr_ok ) GOTO 5500
+
+* initialize the Perl reader
+	call toChar(ds_name(data_set), cname)
+	if (PL_OPEN(cname) .eq. 0) goto 6000
+
+	fvar = 0
+	nvar20 = 0
+	DO ivar = 1, 20
+	   DO fvar = fvar+1, maxvars
+	      IF ( ds_var_setnum( fvar ) .EQ. data_set ) then
+ 		 IF (INDEX( ds_var_code(fvar),'-') .EQ. 0 ) THEN
+		    nvar20 = nvar20 + 1
+		    fstatus = PL_READ_VAR(memory(1, mr_blk1(mr20(nvar20))),
+     1		                 lengths)
+		 END IF
+		 if (fstatus .EQ. 0) goto 6000
+	      END IF
+	   END DO
+	END DO
+
+
+
+* free up the buffer space
+        CALL  RELEASE_WORK_SPC
+
+* flag that all the data is available
+	DO 800 ivar = 1, nvar20
+	   mr1 = mr20(ivar)
+	   mr_protected( mr1 ) = mr_not_protected
+	   CALL MR_NOT_IN_USE( mr1 )
+ 800	CONTINUE
+
+* the data region obtained may be inadequate for the request
+* ("cx" is request, "cx1" is available)
+	cx1 = cx20(the_var)
+	DO 900 idim = 1, nferdims
+	   IF ( cx_hi_ss(cx,idim) .GT. cx_hi_ss(cx1,idim) ) THEN
+	      IF ( cx_hi_ss(cx_last,idim) .NE. unspecified_int4
+     .	     .OR.  cx_given(idim,cx) ) THEN
+* ... error: the user explicitly requested more than there is
+	         GOTO 5600
+              ELSEIF (cx_lo_ss(cx,idim) .GT. cx_hi_ss(cx1,idim)) THEN
+* ... requested data is completely out of range of disk data (2/93 bug fix)
+                 GOTO 5600
+	      ELSE
+* ... no error: the region was filled in by FERRET automatically
+	         cx_hi_ss(cx,idim) = cx_hi_ss(cx1,idim)
+	         cx_hi_ww(idim,cx) = cx_hi_ww(idim,cx1)
+	      ENDIF
+	   ENDIF
+ 900	CONTINUE
+
+* successful completion
+	cx_stack_ptr = cx0
+	CALL PL_CLOSE()
+	RETURN
+
+* error exit
+ 4900	nvar20 = nvar20 + 1		! delete all
+ 5000	cx_stack_ptr = cx0
+	DO 5010 nleft = 1, nvar20-1	! delete all except last
+ 5010	CALL DELETE_VARIABLE(mr20(nleft))
+        CALL  RELEASE_WORK_SPC
+	CALL PL_CLOSE()
+ 5500	RETURN
+ 5600	CALL ERRMSG( ferr_limits, status,
+     .		ww_dim_name(idim)//' axis of '//VAR_CODE(cat_file_var,ask_var),
+     .		*5500 )
+ 6000	CALL PL_GET_ERROR(cerrmsg)
+	CALL TM_CTOF_STRNG(cerrmsg, ferrmsg, 255)
+	CALL TM_SPLIT_MESSAGE(err_lun, ' **ERROR: '//ferrmsg(1:LEN(ferrmsg)))
+        CALL ERRMSG( ferr_TMAP_error, status, ' ', *4900 )
+	END	
+
diff --git a/fer/ino/read_remote.F b/fer/ino/read_remote.F
new file mode 100644
index 0000000..4c57d42
--- /dev/null
+++ b/fer/ino/read_remote.F
@@ -0,0 +1,329 @@
+	SUBROUTINE READ_REMOTE ( memory, baddat, cx, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a grid of data from an F-TDS dataset, having been defined with LET/REMOTE
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* revision 0.0 - 2/2012 - based on READ_TM
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status
+	REAL	memory( mem_blk_size, max_mem_blks ), baddat
+
+* internal variable declarations:
+	LOGICAL	has_a_stride, has_strides(nferdims)
+	INTEGER MGRID_SIZE,
+     .			idim, uvar, category, dset, grid,
+     .			sf_num, tmap_status, idir, ndim,
+     .			lo_ss(nferdims), hi_ss(nferdims),
+     .			lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6, 
+     .			hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6,
+     .			stride(nferdims), lo_ss_ds,hi_ss_ds, line, 
+     .			gridlines(nferdims), grid_start(nferdims),
+     .			grid_end(nferdims), grid_order(nferdims)
+* V500 *kob* 3/99- up VAR_CODE and local var vname to 64 chars
+	CHARACTER*128	VAR_CODE, vname
+
+	LOGICAL		reprimand
+	DATA       	reprimand/.TRUE./
+* *kob* 2/99 - add declaration for new c function
+
+	INTEGER REPLACEABLE_BAD_FLAGS
+
+	EQUIVALENCE	(lo_ss(1),lo_s1), (lo_ss(2),lo_s2),
+     .			(lo_ss(3),lo_s3), (lo_ss(4),lo_s4),
+     .			(lo_ss(5),lo_s5), (lo_ss(6),lo_s6),
+     .			(hi_ss(1),hi_s1), (hi_ss(2),hi_s2),
+     .			(hi_ss(3),hi_s3), (hi_ss(4),hi_s4),
+     .			(hi_ss(5),hi_s5), (hi_ss(6),hi_s6)
+
+* --- end of introductory code ---
+
+* initialize
+	dset = cx_data_set( cx )
+	category = cat_user_var
+	uvar = cx_variable( cx )
+	vname = VAR_CODE( category, uvar )
+
+	grid = cx_grid( cx )
+
+	DO 50 idim = 1, nferdims
+	   gridlines(idim) = grid_line(idim, grid)
+  50	CONTINUE
+	CALL CD_NF_GET_VAR_GRID ( dset, vname, gridlines, status )
+
+	ndim = 0
+	DO 70 idim = 1, nferdims
+	   line = gridlines(idim)
+	   grid_start(idim) = 1
+	   grid_end(idim) = 1
+	   grid_order(idim) = 0
+	   IF (line .NE. mnormal) THEN
+	      grid_end(idim) = line_dim(line)
+
+	      DO 60 idir = 1, nferdims+1
+                 IF ( line_direction(line) .EQ. axis_orients( idir ) ) THEN
+		    ndim = ndim + 1
+		    grid_order(ndim) = idir
+		    IF (grid_order(ndim) .EQ. 7) grid_order(ndim) = 3
+		    GOTO 65
+		 ENDIF
+ 60	      CONTINUE
+ 65	      CONTINUE
+	   ENDIF
+ 70     CONTINUE
+
+* ensure that all needed limits are known and correct for the remote var
+
+	DO 100 idim = 1, nferdims
+
+	   IF ( gridlines(idim) .EQ. mnormal) THEN
+	      cx_lo_ss( cx, idim ) = unspecified_int4
+	      cx_hi_ss( cx, idim ) = unspecified_int4
+	   ENDIF
+
+	   IF ( cx_lo_ss( cx, idim ) .NE. unspecified_int4 ) GOTO 100
+	   IF ( gridlines(idim).EQ.mnormal) GOTO 100
+
+	   IF ( reprimand ) THEN
+	      CALL WARN
+     .		('FERRET is more efficient if regions are fully specified' )
+	      CALL WARN( ww_dim_name(idim)//
+     .		' axis limits are unspecified - possibly others, too' )
+	      reprimand = .FALSE.		! only remind them once
+	   ENDIF
+	   CALL FLESH_OUT_AXIS( idim, cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000		! should never happen
+!	   CALL ERRMSG( ferr_limits, status,
+!     .			ww_dim_name(idim)//' axis limits are unknown for '//
+!     .			VAR_CODE( cat_file_var, cx_variable(cx) ), *5000 )
+ 100	CONTINUE
+
+
+* jli: replace the following cx_delta logic by the line_delta
+
+* strides indicated in cx_delta e.g. SST[I=110:180:10] ?
+* If so, transfer this info to the stride array
+	has_a_stride = .FALSE.
+
+* reserve and catalog space for the result
+	CALL CREATE_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5900
+	IF (ds_var_type(uvar) .EQ. ptype_string)
+     .		CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mr),
+     .			                  memory(1,mr_blk1(mr)),
+     .					  mr_c_pointer(mr)      )
+
+* un-cache it?
+* Turns out that uncaching the result here causes all of its descendants to
+* become uncached, as well, and lowers the cache hit rate. Instead, we will
+* handle invalid mr limits left by strides in IS_REGRID
+!	IF ( has_a_stride ) CALL UN_CACHE( mr )   ! since lo:hi are "fake"
+
+* set up array of subscripts
+	DO 300 idim = 1, nferdims
+*<jli
+           line = gridlines(idim)
+
+*          For strides indicated in cx_delta e.g. SST[I=110:180:10]
+*          use cx_delta logic
+
+           IF(line_parent(line) .EQ. 0) THEN
+              has_strides(idim) =  cx_delta(idim,cx) .NE. unspecified_val8
+     .                  .AND.  cx_delta(idim,cx) .NE. 1 
+              IF (has_strides(idim)) THEN
+                stride(idim) = NINT(cx_delta(idim,cx))
+                has_a_stride = .TRUE.
+              ELSE
+                stride(idim) = 1
+              ENDIF
+     
+              IF ( gridlines(idim) .EQ. mnormal ) THEN
+                 lo_ss( idim ) = 1
+                 hi_ss( idim ) = 1
+              ELSE
+                 lo_ss( idim ) = cx_lo_ss( cx, idim )
+                 hi_ss( idim ) = cx_hi_ss( cx, idim )
+              ENDIF
+           
+           ELSE
+
+*             For strides specified in SET AXIS/STRIDE
+*             Use line_delta logic
+
+              has_strides(idim) = .TRUE.
+
+	      IF ( gridlines(idim) .EQ. mnormal ) THEN
+	         lo_ss( idim ) = 1
+	         hi_ss( idim ) = 1
+                 stride( idim ) = 1
+
+              ELSEIF ( line_regular(line) ) THEN
+              
+                 IF (has_strides(idim)) THEN
+                    stride(idim) = line_delta(line)/line_delta(line_parent(line))+0.5
+                    has_a_stride = .TRUE.
+                 ELSE
+                    stride(idim) =1 
+                 ENDIF
+
+!                get size of the native axis
+                 CALL VAR_SS_LIMS(idim, cx,lo_ss_ds,hi_ss_ds)
+
+                 lo_ss(idim) = (cx_lo_ss( cx, idim )-1)*stride(idim) + 
+     .                         line_offset(line)
+
+                 hi_ss(idim) = (cx_hi_ss( cx, idim )-1)*stride(idim) +
+     .                         line_offset(line) 
+
+!                for a reversed axis
+                 IF( line_reversed(line)) THEN
+!                   must compute hi_ss first and then lo_ss
+                    hi_ss(idim) = hi_ss_ds - 
+     .                         (line_dim(line)-cx_hi_ss( cx, idim ))*stride(idim) -
+     .                         line_offset(line) + 1
+  
+                    lo_ss(idim) = hi_ss(idim) - 
+     .                         (cx_hi_ss(cx,idim)-cx_lo_ss(cx,idim))*stride(idim)
+                 ENDIF
+
+!                for nested stride
+                 IF( (cx_delta(idim,cx) .NE. unspecified_val8)
+     .                  .AND.  (cx_delta(idim,cx) .NE. 1) ) THEN
+                    stride(idim) = stride(idim)*cx_delta(idim,cx)
+                 ENDIF
+
+
+              ELSE
+*             Irregular line
+
+                 IF (has_strides(idim)) THEN
+                    has_a_stride = .TRUE.
+                    stride(idim) = line_delta(line)
+
+!                   Nested strided, e.g.,i=1:20:2      
+                    IF( (cx_delta(idim,cx) .NE. unspecified_val8)
+     .                  .AND.  (cx_delta(idim,cx) .NE. 1) ) THEN
+                       stride(idim) = stride(idim)*cx_delta(idim,cx)
+                    ENDIF
+
+                    lo_ss(idim)  = line_start(line) +  
+     .                             (cx_lo_ss( cx, idim )-1)*stride(idim)
+                    hi_ss(idim)  = line_start(line) +  
+     .                             (cx_hi_ss( cx, idim )-1)*stride(idim)
+                 ELSE
+                    lo_ss( idim ) = cx_lo_ss( cx, idim )
+                    hi_ss( idim ) = cx_hi_ss( cx, idim )
+                    stride(idim) = 1 
+                 ENDIF 
+
+	      ENDIF
+           
+           ENDIF
+ 300	CONTINUE
+
+* diagnostic output
+	IF (mode_diagnostic) THEN
+	   IF ( has_a_stride) THEN
+	     CALL DIAGNOSTIC_OUT('rdstride',cx,point_to_cx)
+	   ELSE
+	     CALL DIAGNOSTIC_OUT('reading',mr,point_to_mr)
+	   ENDIF
+	ENDIF
+
+* read the data
+
+	CALL REMOTE_READ  ( dset,
+     .			vname,
+     .			rvar_varid(uvar),
+     .			lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6, 
+     .			hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6,
+     .			lo_ss,
+     .			hi_ss,
+     .			stride,
+     .			gridlines,
+     .			grid_start,
+     .			grid_end,
+     .			grid_order,
+     .			memory( 1, mr_blk1( mr ) ),
+     .			baddat, 
+     .			sf_num,
+     .			tmap_status		)
+	IF ( tmap_status .NE. merr_ok ) THEN
+	   CALL DELETE_VARIABLE( mr )
+	   GOTO 5010
+	ENDIF
+
+* baddat attribute is read from the f-tds dataset; if the 
+* _FillValue attribute and the bad-value with in the data
+* are corrupted by e.g. a conversion from float to double,
+* then this way both are corrupted in the same way.
+
+	mr_bad_data(mr) = baddat
+
+* replace multiple bad data flags in some variables
+* IF ( ds_bad_flag( variable ) .NE. ds_missing_flag( variable ) )
+* *kob* 2/99 - call new routine to check for usage of NaN
+	IF (REPLACEABLE_BAD_FLAGS(ds_bad_flag(uvar), 
+     .                            ds_missing_flag(uvar)) .EQ. 1)
+     .	   CALL REPLACE_BAD_DATA
+     .		(memory(1,mr_blk1(mr)),mr,cx,ds_missing_flag(uvar))
+
+* successful completion
+ 	RETURN
+
+* error exit
+ 5000	cx_category(cx) = category
+ 	RETURN
+
+* error exit
+ 5010	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5900 )   ! 7/92
+ 5900	RETURN
+	END	
diff --git a/fer/ino/read_tm.F b/fer/ino/read_tm.F
new file mode 100644
index 0000000..7982252
--- /dev/null
+++ b/fer/ino/read_tm.F
@@ -0,0 +1,275 @@
+	SUBROUTINE READ_TM ( memory, cx, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a grid of data from a TMAP data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 11/28/88 - based on IS_READ_GT v0.3 and READ_GT_XYZ v1.1
+* V200:  5/19/89 - reordered lo/hi_ss args
+*	 12/8/89 - changed call arguments in TM_READ for new compiler
+* V230:  7/30/92 - must CALL ERRMSG to stop command files, etc. following error
+*        11/6/92 - increased variable length to 24 characters
+* V312: 5/94 - array "memory" as a calling argument
+* V500: 2/99 - *kob* add call to new routine REPLACEABLE_BAD_FLAGS to allow
+*              and check for NaN as missing values
+*	3/99 - *kob* up VAR_CODE and local var variable_code to 64 chars
+*	5/99 - *sh* added strides to TMAP read calls
+* V533: 6/01 - *sh* initialize string input variable
+* v552: 4/03 - *acm* up VAR_CODE and local var variable_code to 128 chars
+* V556  4/04 - *acm* stride/modulo fixes: use NINT to convert REAL*8 to integer
+* v602  8/06 - *jli* native strides  replace cx_delta logic by the line_delta
+*       *acm* 3/12 cleanup old VMS ifdef
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+
+	include	'tmap_errors.parm'
+	include	'tmap_dims.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL	has_a_stride, has_strides(nferdims)
+	INTEGER MGRID_SIZE,
+     .			idim, variable, category, data_set, grid,
+     .			sf_num, tmap_status, 
+     .			lo_ss(nferdims), hi_ss(nferdims),
+     .			lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6, 
+     .			hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6,
+     .			stride(nferdims), lo_ss_ds,hi_ss_ds, line
+* V500 *kob* 3/99- up VAR_CODE and local var variable_code to 64 chars
+	CHARACTER*128	VAR_CODE, variable_code
+
+* *kob* 2/99 - add declaration for new c function
+	INTEGER REPLACEABLE_BAD_FLAGS
+
+	EQUIVALENCE	(lo_ss(1),lo_s1), (lo_ss(2),lo_s2),
+     .			(lo_ss(3),lo_s3), (lo_ss(4),lo_s4),
+     .			(lo_ss(5),lo_s5), (lo_ss(6),lo_s6),
+     .			(hi_ss(1),hi_s1), (hi_ss(2),hi_s2),
+     .			(hi_ss(3),hi_s3), (hi_ss(4),hi_s4),
+     .			(hi_ss(5),hi_s5), (hi_ss(6),hi_s6)
+
+* --- end of introductory code ---
+
+* initialize
+	data_set = cx_data_set( cx )
+	category = cx_category( cx )
+	variable = cx_variable( cx )
+	grid = cx_grid( cx )
+	variable_code = VAR_CODE( category, variable )
+
+* check data type
+	IF ( cx_type(cx) .NE. ds_var_type(variable) ) THEN
+	   CALL WARN('Internal err: read data type mismatch')
+	   cx_type(cx) = ds_var_type(variable)
+	ENDIF
+
+* jli: replace the following cx_delta logic by the line_delta
+
+* strides indicated in cx_delta e.g. SST[I=110:180:10] ?
+* If so, transfer this info to the stride array
+	has_a_stride = .FALSE.
+
+* reserve and catalog space for the result
+	CALL CREATE_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5900
+	IF (ds_var_type(variable) .EQ. ptype_string)
+     .		CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mr),
+     .			                  memory(1,mr_blk1(mr)),
+     .					  mr_c_pointer(mr)      )
+
+* un-cache it?
+* Turns out that uncaching the result here causes all of its descendants to
+* become uncached, as well, and lowers the cache hit rate. Instead, we will
+* handle invalid mr limits left by strides in IS_REGRID
+!	IF ( has_a_stride ) CALL UN_CACHE( mr )   ! since lo:hi are "fake"
+
+* set up array of subscripts
+	DO 300 idim = 1, nferdims
+*<jli
+           line = grid_line(idim, grid)
+
+*          For strides indicated in cx_delta e.g. SST[I=110:180:10]
+*          use cx_delta logic
+
+           IF(line_parent(line) .EQ. 0) THEN
+              has_strides(idim) =  cx_delta(idim,cx) .NE. unspecified_val8
+     .                  .AND.  cx_delta(idim,cx) .NE. 1 
+              IF (has_strides(idim)) THEN
+                stride(idim) = NINT(cx_delta(idim,cx))
+                has_a_stride = .TRUE.
+              ELSE
+                stride(idim) = 1
+              ENDIF
+     
+              IF ( grid_line( idim, grid ) .EQ. mnormal ) THEN
+                 lo_ss( idim ) = 1
+                 hi_ss( idim ) = 1
+              ELSE
+                 lo_ss( idim ) = cx_lo_ss( cx, idim )
+                 hi_ss( idim ) = cx_hi_ss( cx, idim )
+              ENDIF
+           
+           ELSE
+
+*             For strides specified in SET AXIS/STRIDE
+*             Use line_delta logic
+
+              has_strides(idim) = .TRUE.
+
+	      IF ( grid_line( idim, grid ) .EQ. mnormal ) THEN
+	         lo_ss( idim ) = 1
+	         hi_ss( idim ) = 1
+                 stride( idim ) = 1
+
+              ELSEIF ( line_regular(line) ) THEN
+              
+                 IF (has_strides(idim)) THEN
+                    stride(idim) = line_delta(line)/line_delta(line_parent(line))+0.5
+                    has_a_stride = .TRUE.
+                 ELSE
+                    stride(idim) =1 
+                 ENDIF
+
+!                get size of the native axis
+                 CALL VAR_SS_LIMS(idim, cx,lo_ss_ds,hi_ss_ds)
+
+                 lo_ss(idim) = (cx_lo_ss( cx, idim )-1)*stride(idim) + 
+     .                         line_offset(line)
+
+                 hi_ss(idim) = (cx_hi_ss( cx, idim )-1)*stride(idim) +
+     .                         line_offset(line) 
+
+!                for a reversed axis
+                 IF( line_reversed(line)) THEN
+!                   must compute hi_ss first and then lo_ss
+                    hi_ss(idim) = hi_ss_ds - 
+     .                         (line_dim(line)-cx_hi_ss( cx, idim ))*stride(idim) -
+     .                         line_offset(line) + 1
+  
+                    lo_ss(idim) = hi_ss(idim) - 
+     .                         (cx_hi_ss(cx,idim)-cx_lo_ss(cx,idim))*stride(idim)
+                 ENDIF
+
+!                for nested stride
+                 IF( (cx_delta(idim,cx) .NE. unspecified_val8)
+     .                  .AND.  (cx_delta(idim,cx) .NE. 1) ) THEN
+                    stride(idim) = stride(idim)*cx_delta(idim,cx)
+                 ENDIF
+
+
+              ELSE
+*             Irregular line
+
+                 IF (has_strides(idim)) THEN
+                    has_a_stride = .TRUE.
+                    stride(idim) = line_delta(line)
+
+!                   Nested strided, e.g.,i=1:20:2      
+                    IF( (cx_delta(idim,cx) .NE. unspecified_val8)
+     .                  .AND.  (cx_delta(idim,cx) .NE. 1) ) THEN
+                       stride(idim) = stride(idim)*cx_delta(idim,cx)
+                    ENDIF
+
+                    lo_ss(idim)  = line_start(line) +  
+     .                             (cx_lo_ss( cx, idim )-1)*stride(idim)
+                    hi_ss(idim)  = line_start(line) +  
+     .                             (cx_hi_ss( cx, idim )-1)*stride(idim)
+                 ELSE
+                    lo_ss( idim ) = cx_lo_ss( cx, idim )
+                    hi_ss( idim ) = cx_hi_ss( cx, idim )
+                    stride(idim) = 1 
+                 ENDIF 
+
+	      ENDIF
+           
+           ENDIF
+ 300	CONTINUE
+
+* diagnostic output
+	IF (mode_diagnostic) THEN
+	   IF ( has_a_stride) THEN
+	     CALL DIAGNOSTIC_OUT('rdstride',cx,point_to_cx)
+	   ELSE
+	     CALL DIAGNOSTIC_OUT('reading',mr,point_to_mr)
+	   ENDIF
+	ENDIF
+
+* read the data
+
+	CALL TM_READ  ( data_set,
+     .			variable_code,
+     .			lo_s1, lo_s2, lo_s3, lo_s4, lo_s5, lo_s6, 
+     .			hi_s1, hi_s2, hi_s3, hi_s4, hi_s5, hi_s6,
+     .			lo_ss,
+     .			hi_ss,
+     .			stride,
+     .			memory( 1, mr_blk1( mr ) ),
+     .			sf_num,
+     .			tmap_status		)
+	IF ( tmap_status .NE. merr_ok ) THEN
+	   CALL DELETE_VARIABLE( mr )
+	   GOTO 5010
+	ENDIF
+
+* replace multiple bad data flags in some variables
+* IF ( ds_bad_flag( variable ) .NE. ds_missing_flag( variable ) )
+* *kob* 2/99 - call new routine to check for usage of NaN
+	IF (REPLACEABLE_BAD_FLAGS(ds_bad_flag(variable), 
+     .                            ds_missing_flag(variable)) .EQ. 1)
+     .	   CALL REPLACE_BAD_DATA
+     .		(memory(1,mr_blk1(mr)),mr,cx,ds_missing_flag(variable))
+
+* successful completion
+	RETURN
+
+* error exit
+ 5010	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5900 )   ! 7/92
+ 5900	RETURN
+	END	
diff --git a/fer/ino/repl_tm_find_grid_slot.F b/fer/ino/repl_tm_find_grid_slot.F
new file mode 100644
index 0000000..8f3040e
--- /dev/null
+++ b/fer/ino/repl_tm_find_grid_slot.F
@@ -0,0 +1,88 @@
+	INTEGER*4 FUNCTION TM_FIND_GRID_SLOT ( islot )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Locates an unused space in XGRID common for a new grid. If no space available,
+* returns error.
+*
+* revision 0.00 - 11/22/88
+* revision 1.00 - 12/13/88 - changed to reverse order search 
+* V200:  7/12/89 - modified for FERRET to start slot search below grid stack
+*		   pointer  *sh*
+*		   all changes marked with "FR200"
+*
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 changes for 6D Ferret
+
+* Arguments
+	INTEGER*4	islot
+*
+* Parameters and commons
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xfr_grid.cmn'			! fr200
+*
+* Local declarations
+	CHARACTER*13	TM_STRING
+	INTEGER*4	igrd
+*
+!	DO 100 igrd = max_grids,1,-1
+	DO 100 igrd = grd_stk_ptr-1,1,-1			! FR200
+	  IF (grid_name(igrd) .NE. char_init16) THEN
+!	    IF (igrd .EQ. max_grids) GOTO 9000
+	    IF (igrd .EQ. grd_stk_ptr-1) GOTO 9000		! FR200
+	    islot = igrd + 1
+	    GOTO 200
+	  ENDIF
+  100	CONTINUE
+	islot = 1
+  200	TM_FIND_GRID_SLOT = merr_ok
+	GOTO 9999
+*
+* No slot available
+! FR200
+ 9000	CALL TM_ERRMSG (merr_gridlim, TM_FIND_GRID_SLOT,
+     .	                'TM_FIND_GRID_SLOT', no_descfile, no_stepfile,
+     .	                'MAX='//TM_STRING(DBLE(max_grids)), no_errstring,
+     .	                *9999)
+
+
+ 9999	RETURN
+	END
diff --git a/fer/ino/replace_bad_data.F b/fer/ino/replace_bad_data.F
new file mode 100644
index 0000000..28ba17b
--- /dev/null
+++ b/fer/ino/replace_bad_data.F
@@ -0,0 +1,68 @@
+	SUBROUTINE REPLACE_BAD_DATA( src, msrc, cx, old_bad )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* replace all occurances of the value "old_bad" with the bad data flag
+* associated with this msrc
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 3/19/87
+* V200:  5/18/89 - 4D-symmetrical version
+*	10/16/89 - modified array declarations using REPLACE_BAD_DATA_SUB
+* V500: 2/18/99 - *kob* - call new C routine REPLACE_BAD_DATA_SUB which
+*                         will check for use of NaN as missing/bad flag.  new
+*                         routine is also simpler and faster
+* V541: *sh* 4/02 - need to use MGRID_SIZE_DELTA to determine the size
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+* 2/99 *kob* add new variable size and reference to function MGRID_SIZE
+	INTEGER	msrc, cx, size, MGRID_SIZE_DELTA
+	REAL    src( * )
+	REAL	old_bad
+
+	size = MGRID_SIZE_DELTA(msrc)
+        CALL REPLACE_BAD_DATA_SUB( old_bad, src, size,
+     .                            mr_bad_data(msrc) )
+
+	RETURN
+	END
+
diff --git a/fer/ino/var_ss_lims.F b/fer/ino/var_ss_lims.F
new file mode 100644
index 0000000..03a158f
--- /dev/null
+++ b/fer/ino/var_ss_lims.F
@@ -0,0 +1,113 @@
+	SUBROUTINE VAR_SS_LIMS( idim, cx, lo_ss, hi_ss )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the subscript limits for a "file variable"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/19/89 - created
+*	10/25/89 - streamlined determining file variable number
+* V300: 10/28/93 - apply limits to pseudo-variables, too, if grid is suitable
+*	note: this addition was made YEARS after the logic here was developed
+*	      there are uncertainties whether special circumstances in FERRET
+*	      may lead to problem behavior
+*       *acm* 3/12 cleanup old VMS ifdef
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xfr_grid.cmn'	! 10/93
+	include	'xpyvar_info.cmn'
+
+* calling argument declarations
+	INTEGER idim, cx, lo_ss, hi_ss
+
+* internal variable declarations
+	LOGICAL is_file_var
+	INTEGER dset, cat, var, grid, line, status
+	INTEGER TM_GET_GRIDNUM		! 10/93
+
+* initialize
+	dset = cx_data_set(cx)
+	var  = cx_variable(cx)
+	cat  = cx_category(cx)
+	grid = cx_grid(cx)
+	IF ( grid .NE. unspecified_int4 ) line = grid_line( idim, grid )
+
+* pseudo-variables - added 10/93
+* (must be a known axis and not be ABSTRACT)
+	IF ( cat  .EQ. cat_pseudo_var
+     . .AND. grid .NE. unspecified_int4
+     . .AND. line .NE. unspecified_int4
+     . .AND. grid .NE. TM_GET_GRIDNUM('ABSTRACT')  ) THEN
+	   lo_ss = 1
+	   hi_ss = line_dim( line )
+	   RETURN
+	ENDIF
+* ... end of 10/93 additions
+
+* cannot return answer under several conditions
+	is_file_var = cat .EQ. cat_file_var .OR. 
+     .                cat .EQ. cat_aggregate_var .OR.
+     .                cat .EQ. cat_pystat_var
+	IF ( (.NOT.is_file_var)
+     .  .OR. dset .EQ. unspecified_int4
+     .  .OR. line .EQ. mnormal
+     .  .OR. cx_unstand_grid(cx)	 ) THEN
+	   lo_ss = unspecified_int4
+	   hi_ss = unspecified_int4
+	   RETURN
+	ENDIF
+
+* return subscript limits
+        IF ( cat .EQ. cat_file_var ) THEN
+           lo_ss = ds_grid_start(idim, var)
+           hi_ss = ds_grid_end  (idim, var)
+        ELSE
+           lo_ss = pyvar_grid_start(idim, var)
+           hi_ss = pyvar_grid_end  (idim, var)
+        ENDIF
+        RETURN
+
+	END
diff --git a/fer/link.ppc64.sh b/fer/link.ppc64.sh
new file mode 100755
index 0000000..4312277
--- /dev/null
+++ b/fer/link.ppc64.sh
@@ -0,0 +1,27 @@
+# Contributed by support at BSC-CNS, Barcelona, Spain
+# for build using PPC processors and SLES 9  10/2008
+# They say this is the link option that I used, the 
+# default one didn't work in our system
+
+
+g++ -m32 -L/lib -L/usr/X11R6/lib -o ferretdods_gui \
+ccr/fermain_c.o ccr/gui_init.o \
+ccr/save_arg_pointers.o special/linux_routines.o dat/*.o ../fmt/src/x*.o ../ppl/plot/ppldata.o special/ferret_dispatch.o special/xmake_date_data.o special/fakes3.o special/ferret_query_f.o  special/xrevision_type_data.o special/xplatform_type_data.o \
+         \
+         \
+        /gpfs/apps/FERRET/SRC/6.13_beta/lib/libgui.a ../list-2.1/liblist.a \
+         \
+        ../ppl/tmapadds/*.o  \
+        ef_utility/*.o \
+         \
+        /gpfs/apps/FERRET/SRC/6.13_beta/lib/libxeq.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libgnl.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libferplt.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/librpn.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libstk.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libdoo.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libocn.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libctx.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libfmt.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libino.a /gpfs/apps/FERRET/SRC/6.13_beta [...]
+        /gpfs/apps/FERRET/SRC/6.13_beta/lib/libplt.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libpll.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libsym.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libcmp.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libour.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libepi.a /gpfs/apps/FERRET/SRC/6.13_beta/lib/libusr.a  \
+         \
+        /gpfs/apps/FERRET/SRC/6.13_beta/lib/tmap_lib.a \
+        ../readline-4.1/libreadline.a  \
+        /usr/lib/libncurses.a \
+        -L/gpfs/apps/DAP/3.8.2/32/lib /gpfs/apps/NCDAP/3.7.2/32/lib/libnc-dap.a /gpfs/apps/DAP/3.8.2/32/lib/libdap.a /gpfs/apps/DAP/3.8.2/32/lib/libdapclient.a /gpfs/apps/NCDAP/3.7.2/32/lib/libnc-dap.a /gpfs/apps/DAP/3.8.2/32/lib/libdap.a /usr/lib/libxml2.a -L/gpfs/apps/DAP/3.8.2/32/lib -L/gpfs/apps/DAP/3.8.2/32/lib -lz -lpthread /gpfs/apps/CURL/7.19.0/32/lib/libcurl.a -L/usr/lib -lssl -lcrypto -ldl -lssl -lcrypto /usr/lib/libgssapi.so.1 -lcrypto -lresolv -ldl -lz -lz  -lpthread -lz /gpf [...]
+        -L/gpfs/apps/HDF4/32/lib/  -ldf -ljpeg /gpfs/apps/HDF4/32/lib/libz.a  \
+        ../xgks/src/lib/libxgks.a \
+        -L/usr/X11R6/lib -ldl /usr/X11R6/lib/libXpm.a  -lc /usr/X11R6/lib/libXm.a -lXt -lXext -lX11 -lXp /usr/X11R6/lib/libXmu.a -lSM       -lICE        -lc -lg2c -lstdc++ -L/opt/ibmcmp/xlf/10.1/lib/ -lxl -lrt -Wl,-relax
+
diff --git a/fer/mem/LIB_NAME b/fer/mem/LIB_NAME
new file mode 100644
index 0000000..abbe4a6
--- /dev/null
+++ b/fer/mem/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libmem.a 
diff --git a/fer/mem/Makefile b/fer/mem/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/mem/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/mem/SOURCE_FILES b/fer/mem/SOURCE_FILES
new file mode 100644
index 0000000..2dafa4c
--- /dev/null
+++ b/fer/mem/SOURCE_FILES
@@ -0,0 +1,57 @@
+SRCS_F = \
+allo_grid_to_cx.F\
+assign_mr_cx.F\
+assign_temp_var.F\
+assign_variable.F\
+cgrid_size_delta.F\
+create_mem_var.F\
+create_permutation.F\
+create_temp_mem_var.F\
+deallo_dyn_grid.F\
+deallo_uvar_grids.F\
+delete_mrs_in_progress.F\
+delete_old_expr.F\
+delete_transformed_vars.F\
+delete_un_cached_mvars.F\
+delete_user_var.F\
+delete_user_var_sub.F\
+delete_variable.F\
+erase_dset.F\
+fill_memory.F\
+find_mem_var.F\
+find_mr_slot.F\
+find_var_name.F\
+free_memory.F\
+fvar_number.F\
+get_memory.F\
+get_work_mr.F\
+get_work_spc.F\
+hash_cx.F\
+hash_name.F\
+init_grid.F\
+its_un_cached.F\
+mgrid_size.F\
+mgrid_size_delta.F\
+mr_available.F\
+mr_dim_len.F\
+mr_in_use.F\
+mr_not_in_use.F\
+mvar_num_dims.F\
+new_mr_w_edges.F\
+purge_all_memory.F\
+purge_all_pystat_vars.F\
+purge_all_uvars.F\
+purge_aux_var_dependents.F\
+purge_dset.F\
+purge_file_var.F\
+purge_mr_axis.F\
+purge_mr_grid.F\
+purge_pystat_var.F\
+purge_pystat_dset_vars.F\
+purge_user_var.F\
+re_assign_variable.F\
+release_work_spc.F\
+un_cache.F\
+unprotect_all_mrs.F\
+uvar_number.F\
+var_code.F 
diff --git a/fer/mem/allo_grid_to_cx.F b/fer/mem/allo_grid_to_cx.F
new file mode 100644
index 0000000..765b948
--- /dev/null
+++ b/fer/mem/allo_grid_to_cx.F
@@ -0,0 +1,81 @@
+	SUBROUTINE ALLO_GRID_TO_CX( cx, grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Allocate a temporary grid from the grid stack (not a managed dynamic grid)
+* and place the necessary flags about it in the given context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420 9/8/95 - for implicit grid management
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	cx, grid, status
+
+* internal variable declarations
+
+* allocate the grid slot
+	CALL ALLO_GRID( grid,status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* initialize the grid to be completely unspecified
+	CALL INIT_GRID(grid,
+     .		'(implicit)',
+     .		unspecified_int4 )
+
+
+* place flags in the given context
+	cx_has_impl_grid(cx) = .TRUE.
+	cx_impl_grid(cx) = grid
+
+
+* optional diagnostic message
+#ifdef debug_dyn_grids
+	IF ( mode_diagnostic )  CALL DIAG_OP
+     .		('allocate', isact_class_grid, grid, 0)
+#endif
+
+ 5000	RETURN
+	END
+
diff --git a/fer/mem/assign_mr_cx.F b/fer/mem/assign_mr_cx.F
new file mode 100644
index 0000000..3b846da
--- /dev/null
+++ b/fer/mem/assign_mr_cx.F
@@ -0,0 +1,111 @@
+	SUBROUTINE ASSIGN_MR_CX( cx, mr )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill a slot in the memory variable table with context information
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V200:  6/26/89 - extracted from ASSIGN_VARIABLE
+* V530:  8/00 *sh* save data type, too
+* V530:  6/01 *sh* save the delta value, too
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685+ 10/13 *sh* added auxiliary regridding "aux" variables
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		cx, mr
+
+* internal variable declarations:
+	INTEGER		idim, trans, grid
+	REAL*8		TM_WORLD
+
+* initialize
+	grid = cx_grid( cx ) 
+
+* background info
+	mr_data_set ( mr )	= cx_data_set( cx )
+	mr_category ( mr )	= cx_category( cx )
+	mr_variable ( mr )	= cx_variable( cx )
+	mr_type     ( mr )	= cx_type    ( cx )
+	mr_grid     ( mr )	= grid
+	mr_bad_data ( mr )	= cx_bad_data( cx )
+	mr_unstand_grid( mr )   = cx_unstand_grid( cx )
+	mr_naux     ( mr )      = cx_naux     ( cx )
+
+* region, transformations and regridding transforms
+	DO 100 idim = 1,nferdims
+	   trans = cx_trans( idim, cx )
+	   mr_trans  ( idim, mr )   = trans
+	   mr_lo_ss  ( mr, idim )   = cx_lo_ss  ( cx, idim )
+	   mr_hi_ss  ( mr, idim )   = cx_hi_ss  ( cx, idim )
+	   mr_delta  ( idim, mr )   = cx_delta  ( idim, cx )
+	   mr_aux_var( idim, mr )   = cx_aux_var( idim, cx )
+	   mr_aux_cat( idim, mr )   = cx_aux_cat( idim, cx )
+	   mr_trans_arg(idim, mr)   = cx_trans_arg(idim, cx)
+	   mr_regrid_trans( idim, mr ) = cx_regrid_trans( idim, cx )
+
+* round out to world coordinate box edges except in some special cases:
+*   i) indefinite integrals (since they depend on exact integration limits)
+*  ii) transforms (except MIN and MAX) that reduce to a point
+* iii) user-defined variables that are based on transformed quantities
+*      (e.g. DEFINE UAVE = U[K=1:3 at AVE])
+
+	   IF ( (trans .EQ. trans_integ_indef) .OR.
+     .          ( (trans .GT. trans_compress_code) .AND.
+     .            (trans .NE. trans_max) .AND.
+     .            (trans .NE. trans_min) ) .OR.
+     .          (cx_lo_ss(cx,idim) .EQ. unspecified_int4) ) THEN
+* ... catalog with exact world coordinate limits
+	      mr_lo_ww( idim, mr ) = cx_lo_ww( idim, cx )
+	      mr_hi_ww( idim, mr ) = cx_hi_ww( idim, cx )
+	   ELSE
+* ... round out limits out to indicate full span of end grid boxes
+	      mr_lo_ww(idim, mr) = TM_WORLD( cx_lo_ss(cx,idim),
+     .					     grid,
+     .					     idim, box_lo_lim	)
+	      mr_hi_ww(idim, mr) = TM_WORLD( cx_hi_ss(cx,idim),
+     .					     grid,
+     .					     idim, box_hi_lim	)
+	   ENDIF
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/assign_temp_var.F b/fer/mem/assign_temp_var.F
new file mode 100644
index 0000000..168c878
--- /dev/null
+++ b/fer/mem/assign_temp_var.F
@@ -0,0 +1,77 @@
+	SUBROUTINE ASSIGN_TEMP_VAR ( cx, start_blk, num_blks, mr, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* catalog in memory the description of this temporary variable
+* typically an intermediate result in a calculation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/9/86
+* revision 0.1 - 2/4/87 - eliminated need for tvar_grid
+* V200:  6/20/89 - variable protection scheme changed
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+
+* calling arguments and local variables . . . . . . .
+	INTEGER	cx, start_blk, num_blks, mr, status
+
+* begin executable code:
+
+* assign the temporary variable into the memory variable list
+	CALL ASSIGN_VARIABLE  (	cx,
+     .				start_blk,
+     .				num_blks,
+     .				mr,
+     .				status		)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* modify assigned slot in memory table to reflect temporary nature of variable
+	mr_protected( mr ) = mr_temporary
+
+	RETURN
+
+* error exits
+ 5000	RETURN
+	END
diff --git a/fer/mem/assign_variable.F b/fer/mem/assign_variable.F
new file mode 100644
index 0000000..55f7e09
--- /dev/null
+++ b/fer/mem/assign_variable.F
@@ -0,0 +1,98 @@
+	SUBROUTINE ASSIGN_VARIABLE
+     .		      ( cx,
+     .			start_block,
+     .			num_blocks,
+     .			mr,
+     .			status      )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* assign and fill a slot in the memory variable table to the variable or
+* expression indicated in the context cx
+* the assigned variable will always be designated as "in-progress"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.1 - 1/30/87 - modified for mr_protected declared as INTEGER
+* revision 0.2 - 3/23/87 - eliminated mr_norm
+* revision 0.3 - 4/1/87  - bad_flag changed
+* revision 0.4 - 7/21/87 - contexts changed to reflect exact size requested by
+*			   the operator so the stored in-plane memory variable
+*			   limits must be rounded out to the grid box edges
+* revision 0.5 - 8/18/87 - added trans_arg (for @SHF)
+* revision 0.6 - 7/21/88 - find mem var slot with FIND_MR_SLOT
+* revision 0.7 - 1/4/89  - added regrid transforms
+* V200:  5/18/89 - 4D symmetrical; using mr_del_ deletion chain
+*		 - context assignment in a separate routine
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		cx, start_block, num_blocks, mr, status
+
+* internal variable declarations:
+	CHARACTER*4	VAR_CODE
+
+* get a free slot in the memory variable table
+	CALL FIND_MR_SLOT( cx, mr, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* point mr slot to data in bulk memory
+	mr_blk1     ( mr )	= start_block
+	mr_nblks    ( mr )	= num_blocks
+
+* flag it as "in progress"
+	mr_protected( mr )	= mr_in_progress
+
+* assign variable context to slot
+	CALL ASSIGN_MR_CX( cx, mr )
+
+* success
+ 5000	RETURN
+
+* error exit : no space available
+! 5010	CALL ERRMSG( ferr_too_many_vars, status,
+!     .			VAR_CODE(cx_category(cx),cx_variable(cx)), *5000 )
+
+	END
diff --git a/fer/mem/cgrid_size_delta.F b/fer/mem/cgrid_size_delta.F
new file mode 100644
index 0000000..6d04a50
--- /dev/null
+++ b/fer/mem/cgrid_size_delta.F
@@ -0,0 +1,74 @@
+	INTEGER FUNCTION CGRID_SIZE_DELTA ( cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of values in a 2D grid that lies within the plane
+* of the specified context
+* Unlike CGRID_SIZE this routine *IS* sensitive to cx_delta values
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533 *sh* 6/01
+* V560 *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	cx
+
+* internal variable declkarations
+	INTEGER	idim, size, delta
+
+* determine the delta product
+	size = 1
+	DO 10 idim = 1, nferdims
+	  IF (cx_delta(idim,cx) .NE. unspecified_val8) THEN
+	    delta = NINT(cx_delta(idim,cx))
+	  ELSE
+	    delta = 1
+	  ENDIF
+	  size = size * 
+     .		((cx_hi_ss(cx,idim)-cx_lo_ss(cx,idim))/delta + 1)
+ 10 	CONTINUE
+
+* the result
+	CGRID_SIZE_DELTA = size
+
+	RETURN
+	END
diff --git a/fer/mem/create_mem_var.F b/fer/mem/create_mem_var.F
new file mode 100644
index 0000000..cf2e7dc
--- /dev/null
+++ b/fer/mem/create_mem_var.F
@@ -0,0 +1,87 @@
+	SUBROUTINE CREATE_MEM_VAR( cx, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* allocate and claim sufficient memory space, and assign and fill a slot in the 
+* memory variable table for the variable or expression indicated in the context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+* V530   8/00 *sh* - double the memory allocation for string variables
+*			(to support 64 bit pointers)
+* V533   6/01 *sh* - use CGRID_SIZE_DELTA to allow mem vars with delta values
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		cx, mr, status
+
+* internal variable declarations:
+	INTEGER	CGRID_SIZE_DELTA,
+     .		grid_size, start_block, num_blocks
+
+* amount of storage space required
+	grid_size = CGRID_SIZE_DELTA( cx )
+* ... note: later we will want an array of word sizes indexed by type
+#ifdef double_p
+	IF (cx_type(cx) .EQ. ptype_string) grid_size = grid_size
+#else
+	IF (cx_type(cx) .EQ. ptype_string) grid_size = grid_size*2 ! 8 byte ptr
+#endif
+
+* claim the storage space
+	CALL GET_MEMORY( grid_size, start_block, num_blocks, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* catalog it in the memory variable table
+	CALL ASSIGN_VARIABLE
+     .		      ( cx,
+     .			start_block,
+     .			num_blocks,
+     .			mr,
+     .			status 	)
+	IF ( status .NE. ferr_ok ) RETURN
+
+	RETURN
+	END
diff --git a/fer/mem/create_permutation.F b/fer/mem/create_permutation.F
new file mode 100644
index 0000000..5e9af0a
--- /dev/null
+++ b/fer/mem/create_permutation.F
@@ -0,0 +1,174 @@
+	SUBROUTINE CREATE_PERMUTATION( memory,
+     .				cx, msrc, perm, mdst, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a memory-resident variable from input data, msrc, using region limits
+* from context cx permuted into the order specified by array perm
+* To optimize speed pre-test to see if the input data is already suitably
+* organized
+* -- flag the result as temporary
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  9/1/89
+* V312: 5/94 - array "memory" as a calling argument
+* V530:  8/00 *sh* - partial implementation of permuting string arrays
+*		("table only")
+*v580  *acm* 11/04 transfer cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, msrc, perm(nferdims), mdst, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL	table_entry_only
+	INTEGER nsrc, ndst, idim, dim, prm,
+     .		src_len(nferdims), dst_len(nferdims),
+     .          src_ax(nferdims),  dst_ax(nferdims)
+
+* initialize
+	table_entry_only = .FALSE.
+
+* test if any action is necessary
+* ... it is unnecessary if all dimensions with length greater than 1 are
+* the same length and in the same order in the source data as in the requested
+* permutation
+* (Note: msrc regions always span cx regions)
+* Compute src_len and dst_len - the non-unity axis lengths in the source and
+* destination data
+	nsrc = 0
+	DO 200 idim = 1, nferdims
+	   dim = mr_hi_ss(msrc,idim) - mr_lo_ss(msrc,idim)
+	   IF ( dim .GT. 0 ) THEN
+	      nsrc = nsrc + 1
+	      src_ax (nsrc) = idim
+	      src_len(nsrc) = dim
+	   ENDIF
+ 200	CONTINUE
+	ndst = 0
+	DO 210 idim = 1, nferdims
+	   prm = perm(idim)
+	   dim = cx_hi_ss(cx,prm) - cx_lo_ss(cx,prm)
+	   IF ( dim .GT. 0 ) THEN
+	      ndst = ndst + 1
+	      dst_ax (ndst) = prm
+	      dst_len(ndst) = dim
+	   ENDIF
+ 210	CONTINUE
+
+* must "extract" data if the source data is a larger object than the request
+* must permute if the axis ordering is different
+	IF ( nsrc .NE. ndst ) GOTO 500
+	DO 250 idim = 1, nsrc
+	   IF ( dst_len(idim) .NE. src_len(idim)
+     .	  .OR.  dst_ax (idim) .NE. src_ax (idim) ) GOTO 500
+ 250	CONTINUE
+
+* no actual permutation of values is necessary
+* see if a dummy mr table entry is needed to represent the permutation
+	DO 300 idim = 1, nferdims
+	   IF ( perm(idim) .NE. idim ) THEN
+	      table_entry_only = .TRUE.
+	      GOTO 500
+	   ENDIF
+ 300	CONTINUE
+
+* dimensions have not been permuted nor are context region sizes < stored data
+	status = ferr_ok
+	mdst = msrc
+	RETURN
+
+* need a dummy entry
+
+* create a permuted context
+ 500	DO 510 idim = 1,nferdims
+	   prm = perm(idim)
+	   cx_lo_ss ( cx_buff, idim )   = cx_lo_ss ( cx, prm )
+	   cx_hi_ss ( cx_buff, idim )   = cx_hi_ss ( cx, prm )
+	   cx_lo_ww ( idim, cx_buff )   = cx_lo_ww ( prm, cx )
+	   cx_hi_ww ( idim, cx_buff )   = cx_hi_ww ( prm, cx )
+	   cx_trans ( idim, cx_buff )   = cx_trans ( prm, cx )
+	   cx_by_ss ( idim, cx_buff )   = cx_by_ss ( prm, cx )
+	   cx_given ( idim, cx_buff )   = cx_given ( prm, cx )
+	   cx_delta ( idim, cx_buff )   = cx_delta ( prm, cx )
+	   cx_trans_arg(idim, cx_buff)  = cx_trans_arg(prm, cx)
+	   cx_regrid_trans(idim,cx_buff)=cx_regrid_trans(prm,cx)
+ 510	CONTINUE
+
+	cx_data_set( cx_buff ) = cx_data_set( cx )
+	cx_dset_gvn( cx_buff ) = cx_dset_gvn( cx )
+	cx_category( cx_buff ) = cx_category( cx )
+	cx_variable( cx_buff ) = cx_variable( cx )
+	cx_grid    ( cx_buff ) = cx_grid    ( cx )
+	cx_type    ( cx_buff ) = cx_type    ( cx )
+	cx_ovsiz   ( cx_buff ) = cx_ovsiz   ( cx )
+	cx_bad_data( cx_buff ) = cx_bad_data( cx )
+        cx_cal_id  ( cx_buff ) = cx_cal_id  ( cx )
+
+	cx_unstand_grid( cx_buff ) = cx_unstand_grid( cx )
+
+* create a memory space for the result
+	CALL CREATE_TEMP_MEM_VAR( cx_buff, mdst, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* permute or kludge around permuting the data
+	IF ( table_entry_only ) THEN
+* ... point to the original data using permuted limits
+	   CALL FREE_MEMORY( mr_blk1(mdst), mr_nblks(mdst) )
+	   mr_c_pointer(mdst) = mr_c_pointer(msrc)
+	   mr_blk1     (mdst) = mr_blk1(msrc)
+	   mr_nblks    (mdst) = mr_nblks(msrc)
+	   mr_protected(mdst) = mr_table_entry_only
+	ELSE
+* ... permute the data
+	   CALL PERMUTE( cx, memory(1, mr_blk1(msrc)), msrc,
+     .			     memory(1, mr_blk1(mdst)), mdst, perm )
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/mem/create_temp_mem_var.F b/fer/mem/create_temp_mem_var.F
new file mode 100644
index 0000000..961c4ec
--- /dev/null
+++ b/fer/mem/create_temp_mem_var.F
@@ -0,0 +1,88 @@
+	SUBROUTINE CREATE_TEMP_MEM_VAR( cx, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* allocate and claim sufficient memory space, and assign and fill a slot in the 
+* memory variable table for the variable or expression indicated in the context
+* -- flag the variable as temporary
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/14/88 - from CREATE_MEM_VAR ver 0.0
+* V530   8/00 *sh* - double the memory allocation for string variables
+*			(to support 64 bit pointers)
+* V533   6/01 *sh* - use CGRID_SIZE_DELTA to allow mem vars with delta values
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		cx, mr, status
+
+* internal variable declarations:
+	INTEGER	CGRID_SIZE_DELTA,
+     .		grid_size, start_block, num_blocks
+
+* amount of storage space required
+	grid_size = CGRID_SIZE_DELTA( cx )
+* ... note: later we will want an array of word sizes indexed by type
+#ifdef double_p
+	IF (cx_type(cx) .EQ. ptype_string) grid_size = grid_size
+#else
+	IF (cx_type(cx) .EQ. ptype_string) grid_size = grid_size*2 ! 8 byte ptr
+#endif
+
+* claim the storage space
+	CALL GET_MEMORY( grid_size, start_block, num_blocks, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* catalog it in the memory variable table
+	CALL ASSIGN_TEMP_VAR
+     .		      ( cx,
+     .			start_block,
+     .			num_blocks,
+     .			mr,
+     .			status 	)
+	IF ( status .NE. ferr_ok ) RETURN
+
+	RETURN
+	END
diff --git a/fer/mem/deallo_dyn_grid.F b/fer/mem/deallo_dyn_grid.F
new file mode 100644
index 0000000..52ea3c6
--- /dev/null
+++ b/fer/mem/deallo_dyn_grid.F
@@ -0,0 +1,80 @@
+	SUBROUTINE DEALLO_DYN_GRID ( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate the specified dynamic grid (no check made on grid number)
+* and clear any memory references to this grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420 9/8/95 - new
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'interp_stack.parm'
+	include 'xvariables.cmn'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xprog_state.cmn'
+
+* calling argument declarations
+	INTEGER	grid
+
+* local declarations
+	INTEGER mr
+
+* diagnostic message
+	IF ( mode_diagnostic )  CALL DIAG_OP
+     .	     ('dealloc ',isact_class_impl_grid,grid,0)
+
+* deallocate the grid
+	CALL TM_DEALLO_DYN_GRID(grid)
+
+* if the grid was actually destroyed then delete any memory resident 
+* variables that were built on this grid
+	IF ( grid_use_cnt(grid) .EQ. 0 ) THEN
+	   DO 100  mr = 1, max_mrs
+	      IF ( mr_protected(mr) .NE. mr_deleted ) THEN
+	         IF (mr_grid(mr) .EQ. grid) CALL DELETE_VARIABLE(mr)
+	      ENDIF
+ 100	   CONTINUE
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/mem/deallo_uvar_grids.F b/fer/mem/deallo_uvar_grids.F
new file mode 100644
index 0000000..0c2078f
--- /dev/null
+++ b/fer/mem/deallo_uvar_grids.F
@@ -0,0 +1,85 @@
+	SUBROUTINE DEALLO_UVAR_GRIDS( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate all dynamic grids associated with this user variable
+* (clearing any memory references to this grid)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420 9/8/95 - new
+* V510 *sh* 4/00 - deallocate any grid, not just dynamic ones
+* V533 *sh* 7/01 - set data type of grid/variable
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations
+	INTEGER	uvar
+
+* local declarations
+	INTEGER i
+
+
+* loop through all of the grids that may be associated with this
+* note: could be more efficient:  check to see if this is a data set
+*	dependent variable (or "EX#n") and delete only the single data set grid
+
+	DO 100 i = 0, max_gfdl_dsets
+
+* Remove the grid
+* (and possibly all memory resident variables that depend on it)
+	   IF ( uvar_grid(uvar,i) .GE. 1
+     .   .AND.  uvar_grid(uvar,i) .LE. max_dyn_grids ) THEN
+	      CALL DEALLO_DYN_GRID(uvar_grid(uvar,i))
+	   ENDIF
+
+* set the grid pointer to its initialized state
+	uvar_grid( uvar, i ) = unspecified_int4
+
+* set the data type of the grid/variable
+	uvar_data_type( uvar, i ) = unspecified_int4
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/delete_mrs_in_progress.F b/fer/mem/delete_mrs_in_progress.F
new file mode 100644
index 0000000..35dec19
--- /dev/null
+++ b/fer/mem/delete_mrs_in_progress.F
@@ -0,0 +1,70 @@
+	SUBROUTINE DELETE_MRS_IN_PROGRESS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete from memory all in-progress grids ( grids that have been cataloged in
+* the memory variable table but whose computation is not yet completed )
+* 6/89 - and other temporary data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/25/87
+* V200:  6/27/89 - delete temporary variables, too 
+* V420: 11/95 - also delete un-cached memory vars
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* internal variable declarations:
+	INTEGER	mr
+
+	DO 100 mr = 1, max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_in_progress
+     .	   .OR. mr_protected( mr ) .EQ. mr_temporary )
+     .						CALL DELETE_VARIABLE( mr )
+ 100	CONTINUE
+
+* also delete un-cached memory variables
+	CALL DELETE_UN_CACHED_MVARS
+
+	RETURN
+	END
+
diff --git a/fer/mem/delete_old_expr.F b/fer/mem/delete_old_expr.F
new file mode 100644
index 0000000..eda5557
--- /dev/null
+++ b/fer/mem/delete_old_expr.F
@@ -0,0 +1,83 @@
+	SUBROUTINE DELETE_OLD_EXPR
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete from memory all "expression" variables - internally defined user-vars
+* that were created by expressions given with the commmand line
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/31/86
+* revision 0.1 - 1/30/87 - modified for mr_protected declared as INTEGER
+* revision 1.0 - 2/23/87 - changes for conversion to INTERPRETATION STACK using
+*			   the idea that all expressions are special cases of
+*			   user-defined variables
+* revision 1.1 - 5/6/87  - corrected bug in UVAR_NUMBER (status) call
+* V200:   7/7/89 - expression may have been deleted outside this routine
+* 	 2/19/90 - major rewrite: loop through ALL user vars deleting "EX#"
+* V540:  11/01 - initialize last_cmnd_buff
+*	         (formerly local array in get_prot_cmnd_data)
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* internal variable declarations:
+	INTEGER	uvar, j, num_indices, result_array(max_uvar)
+
+* eliminate all user variables created by the last expression given
+*	DO 100 uvar = 1, max_uvar
+*	   IF ( uvar_num_items( uvar ) .EQ. uvar_deleted ) GOTO 100
+        CALL deleted_list_get_undel(uvar_num_items_head,
+     .                              result_array(1),
+     .                              max_uvar, num_indices )
+        DO 100 j = 1, num_indices
+           uvar = result_array(j)        
+	   IF ( uvar_name_code(uvar)(:3) .EQ. 'EX#' )
+     .					CALL DELETE_USER_VAR( uvar )
+ 100	CONTINUE
+
+* remove memory of previous expressions
+	last_cmnd_buff = ' '
+	len_last_cmnd = 1
+
+	RETURN
+	END
+
diff --git a/fer/mem/delete_transformed_vars.F b/fer/mem/delete_transformed_vars.F
new file mode 100644
index 0000000..f4acc4c
--- /dev/null
+++ b/fer/mem/delete_transformed_vars.F
@@ -0,0 +1,82 @@
+	SUBROUTINE DELETE_TRANSFORMED_VARS( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all regridded or transformed variables
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/10/89
+* V200:  6/9/89 - deleted variables flagged in mr_protected
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+
+* internal variable declarations:
+	INTEGER	mr, idim
+
+* do it (entry max_mrs is the dummy slot)
+	DO 100 mr = 1, max_mr_avail
+	   IF ( mr_protected(mr) .EQ. mr_deleted ) GOTO 100
+
+* transforms ?
+	   DO 50 idim = 1,nferdims
+  50	   IF ( mr_trans(idim,mr) .NE. trans_no_transform ) GOTO 60
+* regridded ?
+	   IF ( .NOT.mr_unstand_grid(mr) ) GOTO 100
+
+* delete it if it is not permanent
+  60	   IF ( mr_protected( mr ) .EQ. mr_perm_protected ) THEN
+	      CALL ERRMSG( ferr_perm_var, status,
+     .			'use SHOW MEMORY/PERM', *5000 )
+	   ELSE
+	      CALL DELETE_VARIABLE( mr )
+	   ENDIF
+
+ 100	CONTINUE
+	status = ferr_ok
+
+ 5000	RETURN
+	END
diff --git a/fer/mem/delete_un_cached_mvars.F b/fer/mem/delete_un_cached_mvars.F
new file mode 100644
index 0000000..20b1aea
--- /dev/null
+++ b/fer/mem/delete_un_cached_mvars.F
@@ -0,0 +1,85 @@
+	SUBROUTINE DELETE_UN_CACHED_MVARS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* clear (delete) the entire list of uncached memory variables
+* (sanity check along the way)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+* V510: 8/99 *sh* -- added deletion of pmv_work_var_pile
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+* ...
+
+* internal variable declarations:
+	INTEGER	mr
+
+* initialize linked list search of "nocache" variables
+	mr =  mv_flink( pmv_nocache_pile )
+
+* gobble up the linked list
+ 100	IF ( mr .EQ. pmv_nocache_pile ) THEN
+	   RETURN
+	ELSE
+	   CALL DELETE_VARIABLE( mr )		! delete head of list
+	   mr =  mv_flink( pmv_nocache_pile )	! new head of list
+	   GOTO 100
+	ENDIF
+	   
+* ---
+
+* initialize linked list search of "work_var" variables
+	mr =  mv_flink( pmv_work_var_pile )
+
+* gobble up the linked list
+ 200	IF ( mr .EQ. pmv_work_var_pile ) THEN
+	   RETURN
+	ELSE
+	   CALL DELETE_VARIABLE( mr )		! delete head of list
+	   mr =  mv_flink( pmv_work_var_pile )	! new head of list
+	   GOTO 200
+	ENDIF
+	   
+	END
diff --git a/fer/mem/delete_user_var.F b/fer/mem/delete_user_var.F
new file mode 100644
index 0000000..4614f56
--- /dev/null
+++ b/fer/mem/delete_user_var.F
@@ -0,0 +1,78 @@
+	SUBROUTINE DELETE_USER_VAR ( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete a user-defined variable 
+* First locate each of its children and delete them
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450 7/97 - guts of routine moved to DELETE_USER_VAR_SUB
+* V510 *sh* 1/00 - bug fixes to support nested GC variables
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	uvar
+
+* internal variable declarations:
+	INTEGER	i, uv, uvar_ancestor, num_indices, result_array(max_uvar)
+
+* delete child vars
+*	DO 200 uv = 1, max_uvar
+*	   IF ( uvar_num_items( uv ) .EQ. uvar_deleted ) GOTO 200
+        CALL deleted_list_get_undel(uvar_num_items_head, 
+     .                          result_array(1),
+     .                          max_uvar, num_indices )
+         DO 200 i =1, num_indices
+           uv = result_array(i)
+* ... delete if this variable is a child of uvar 
+*	uvar_name_code for child vars is "(Cnnn,Vmmm)" -- the "mmm" is the ancestor
+	   IF (uvar_name_code(uv)(1:2) .NE. '(C' ) GOTO 200
+	   READ (uvar_name_code(uv)(8:10),'(I3)',ERR=200) uvar_ancestor
+	   IF (uvar_ancestor.EQ.uvar) CALL DELETE_USER_VAR_SUB(uv)
+ 200	CONTINUE
+
+* now delete the variable itself
+        CALL DELETE_USER_VAR_SUB(uvar)
+	      
+	RETURN
+	END
diff --git a/fer/mem/delete_user_var_sub.F b/fer/mem/delete_user_var_sub.F
new file mode 100644
index 0000000..cc0b022
--- /dev/null
+++ b/fer/mem/delete_user_var_sub.F
@@ -0,0 +1,180 @@
+	SUBROUTINE DELETE_USER_VAR_SUB ( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete a user-defined variable (7/97) ON THE ASSUMPTION THAT IT HAS
+* NO CHILDREN (children are handled by DELETE_USER_VAR)
+* this involves not only eliminating the variable from the list of user var
+* definitions but also eliminating in memory any stored grids that depend on
+* this variable AND eliminating from memory any stored grids of other user vars
+* whose definitions depend on this variable
+*  eg DEFINE VARIABLE TEST1 = SALT / 1000
+*     DEFINE VARIABLE TEST2 = TEST1^2
+*     DEFINE VARIABLE TEST3 = TEST2^2
+* if DELETE_USER_VAR is called to delete TEST1 it must also eliminate all stored
+* grids of TEST2 and TEST3
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 2/23/87
+* Ultrix/RISC port - 2/91 - eliminated dependency on VAX STR$ routine
+*     10/22/92 - increased uvar name length
+
+* V420 9/95 - When user variable is deleted release any claim on dynamic grids
+* V450 7/97 - renamed to DELETE_USER_VAR_SUB from DELETE_USER_VAR
+* V510 2/00 *sh* - with the advent of "child variables" created by grid
+*	changing variables deleting a user variable must also remove the name
+*	of the (child) variable
+* V600  4/06 *acm* - remove deleted variable defs from the linked-list structure
+*                    that does attribute handling
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V602 12/06 *acm* - When removeing var from the user-variables dataset in
+*                    linked-list structure, no need to check for  EX# expressions
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'interp_stack.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations:
+	INTEGER	uvar
+
+* internal variable declarations:
+	INTEGER		STR_UPCASE, TM_LENSTR, TM_LENSTR1,
+     .			du_list( max_uvar ), ndu, kdu, uv, vax_code,
+     .			ind, i, j, num_indices, dset_uvars, slen, flen
+	CHARACTER*24	check_name
+
+      PARAMETER (flen=128)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+* procedure:
+*	generate a list of all user variables depending on the named uvar
+*	then eliminate all refs. to all vars in the list
+
+* variables:
+*	du_list	- list of user variables that must be cleared from memory
+*	ndu	- number of variables in list
+*	kdu	- variable in du_list for which dependencies are being checked
+
+* initialize list of variables to be cleared from memory
+	du_list( 1 ) = uvar
+	ndu = 1
+	kdu = 1
+
+* look through the stored uvar definitions for dependencies
+* note: this search depends on uvar_name_code being upper case
+*	use risc_buff as temporary storage for an upvase version
+*	(unnecessary as of 2/91 but possibly lower case in future)
+ 100	check_name = uvar_name_code( du_list( kdu ) )	! upper case
+
+*	DO 200 uv = 1, max_uvar
+*	   IF ( uvar_num_items( uv ) .EQ. uvar_deleted ) GOTO 200
+        CALL deleted_list_get_undel(uvar_num_items_head,
+     .                              deleted_list_result(1),
+     .                              max_uvar, num_indices )
+        DO 200 j = 1, num_indices
+           uv = deleted_list_result(j)
+	   vax_code = STR_UPCASE( risc_buff, uvar_text( uv ) )
+	   ind = INDEX( check_name, risc_buff )
+	   IF ( ind .EQ. 0 ) GOTO 200
+
+* make sure this user variable is not already in the list
+	   DO 110 i = 1, ndu
+	      IF ( du_list( i ) .EQ. uv ) GOTO 200
+ 110	   CONTINUE
+
+* add another dependent variable to the list
+	   ndu = ndu + 1
+	   du_list( ndu ) = uv
+
+ 200	CONTINUE
+
+* done checking for dependencies on this.  More to check ?
+	kdu = kdu + 1
+	IF ( kdu .LE. ndu ) GOTO 100
+
+* eliminate all memory grids for variables in the list
+	DO 300 i = 1, ndu
+ 300	CALL PURGE_USER_VAR( du_list( i ) )
+
+* if this user variable is associated with any dynamic grids release them
+	CALL DEALLO_UVAR_GRIDS(uvar)
+
+* eliminate the named variable from the list of uvars
+*	uvar_num_items( uvar ) = uvar_deleted
+        CALL deleted_list_modify(uvar_num_items_head,uvar,uvar_deleted)
+
+* Remove from linked-list structure, the user-variables dataset
+* No need to check EX# expressions
+
+        slen = TM_LENSTR( uvar_name_code(uvar)  )
+        IF (slen .GT. 0 .AND. uvar_name_code(uvar)(1:3) .NE. 'EX#') THEN
+           slen = TM_LENSTR1( uvar_name_code(uvar)  )
+           CALL TM_FTOC_STRNG( uvar_name_code(uvar)(1:slen), fhol, flen )
+
+           dset_uvars = -1
+           CALL NCF_DELETE_VAR (dset_uvars, fhol )
+        ENDIF
+
+*	uvar_name_code( uvar ) = " "
+        CALL string_array_modify(uvar_name_code_head, uvar, " ", 1 )
+
+	uvar_text     ( uvar ) = " "
+
+	IF (uvar_remote (uvar)) THEN
+	   rvar_dset (uvar) = 0
+	   rvar_varid (uvar) = 0
+	   rvar_on_server (uvar) = .FALSE.
+	   rvar_uvar (uvar) = 0
+	   uvar_remote (uvar) = .FALSE.
+	ENDIF
+	      
+	RETURN
+	END
diff --git a/fer/mem/delete_variable.F b/fer/mem/delete_variable.F
new file mode 100644
index 0000000..0913f8e
--- /dev/null
+++ b/fer/mem/delete_variable.F
@@ -0,0 +1,139 @@
+	SUBROUTINE DELETE_VARIABLE ( mr )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete a memory resident variable releaseing its space in the memory
+* variable table and bulk memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 4/1/86
+* revision 0.1 - 1/29/87 - change to leave illegal limits in mr if deleted
+*			   in diagnostic mode and to accomodate mr_protected
+*			   as declared INTEGER instead of LOGICAL
+*		     and   to eliminate references to tvar_grid
+* revision 0.2 - 9/30/87 - added mr_perm_prot
+* revision 0.3 - 3/10/88 - added cat_named_var
+* revision 1.0 - 7/21/88 - deletion involves removing the variable from its
+*			   hash pile in the memory variable table and returning
+*			   it to the free list
+* revision 1.1 -10/12/88 - for named variables possibly call DELETE_NVAR
+* V200:  5/25/89 - reordered lo/hi_ss arguments
+* 		 - deleted variables flagged in mr_protected and mr_del_ links
+*		 - nvar variables eliminated
+*		 - temporary variables represented via mr_protected
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V510: 2/00 *sh* - free up the mr_grid pointer when variable is deleted
+* V530: 8/00 *sh* - if the variable was a string array then free the C memory
+* V533: 6/01 *sh* - allow for string variables with strides
+* V601 11/06 *acm*- fix bug 1466: memory for string vars is NOT allocated via malloc,
+*                   so do not FREE it here. 
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER mr
+
+* internal variable declarations:
+	INTEGER MGRID_SIZE_DELTA, size, idim, prev, next
+
+	IF (mode_diagnostic) THEN
+	   IF ( mr_protected(mr) .NE. mr_table_entry_only )
+     .			CALL DIAGNOSTIC_OUT( '-DELETE', mr, point_to_mr )
+
+	   IF     ( mr_protected( mr ) .EQ. mr_not_protected	) THEN
+	      CONTINUE
+	   ELSEIF ( mr_protected( mr ) .EQ. mr_temporary	) THEN
+	      CONTINUE
+	   ELSEIF ( mr_protected( mr ) .EQ. mr_table_entry_only	) THEN
+	      CONTINUE
+	   ELSEIF ( mr_protected( mr ) .EQ. mr_perm_protected	) THEN
+	      CALL SPLIT_LIST(pttmode_ops, ttout_lun,'PERMANENT', 9)
+	   ELSEIF ( mr_protected( mr ) .EQ. mr_in_progress	) THEN
+	      CONTINUE
+	   ELSE
+	      CALL WARN( 'CORRUPTION! mr_protected ????' )
+	   ENDIF
+	ENDIF
+
+* if this is a string array variable then free the "C" memory allocated
+* if mr_table_entry_only, no memory was given to the variable
+	IF ( mr_type(mr)      .EQ. ptype_string  .AND.
+     .       mr_protected(mr) .NE. mr_table_entry_only ) THEN
+	   size = MGRID_SIZE_DELTA(mr)
+	   CALL FREE_C_STRING_ARRAY(mr_c_pointer(mr), size)
+	ENDIF
+
+* diagnostic "delete" message
+* remove variable slot from hash pile doubly linked list
+	prev = mv_blink( mr )
+	next = mv_flink( mr )
+	mv_flink( prev ) = next
+	mv_blink( next ) = prev
+
+* return the slot to the memory variable free list
+	mv_flink( mr ) = mv_flink( 0 )	
+	mv_blink( mr ) = unspecified_int4		! temp diag
+	mv_flink( 0 ) = mr
+
+* remove the variable from the deletion chain if it is there
+	IF ( mr_protected(mr) .EQ. mr_not_protected ) THEN
+	   prev = mr_del_blink(mr)
+	   next = mr_del_flink(mr)
+	   mr_del_flink(prev) = next
+	   mr_del_blink(next) = prev
+	   mr_del_flink(mr)   = unspecified_int4	! temp diag
+	   mr_del_blink(mr)   = unspecified_int4	! temp diag
+	ENDIF
+
+* release bulk memory that the variable used
+	IF ( mr_protected( mr ) .NE. mr_table_entry_only ) 
+     . 		CALL FREE_MEMORY( mr_blk1(mr), mr_nblks(mr) )
+
+
+* eliminate any stray indications that this variable points to a grid
+	mr_grid( mr ) = unspecified_int4
+
+* set protection to indicate deleted
+	mr_protected( mr ) = mr_deleted
+
+	RETURN
+	END
+
diff --git a/fer/mem/erase_dset.F b/fer/mem/erase_dset.F
new file mode 100644
index 0000000..88d4050
--- /dev/null
+++ b/fer/mem/erase_dset.F
@@ -0,0 +1,109 @@
+	SUBROUTINE ERASE_DSET ( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all memory variables with data from a particular data set
+* eliminate all context references to it, too
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+* V200:   6/9/89 - deleted variables flagged in mr_protected
+*	10/25/89 - moved memory-resident purging to PURGE_DSET
+* V411:  7/95 - Delete variables created with  LET/D=this_dset
+* V601  11/06 - Also need to delete LET/D= variables from the linked-
+*               list attribute structure.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+
+* calling argument declarations:
+	INTEGER dset
+
+* local variable declarations:
+	INTEGER TM_LENSTR, mr, ii, slen, flen, dset_uvars
+
+      PARAMETER (flen=128)      ! size of variable name string
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+* eliminate memory resident data
+	CALL PURGE_DSET( dset )
+
+* delete LET-defined variables that belong to this data set
+	DO 100 ii = 1, max_uvar
+*	   IF (uvar_dset(ii) .EQ. dset) uvar_num_items(ii) =
+*     .					uvar_deleted
+	   IF (uvar_dset(ii) .EQ. dset) THEN
+	      CALL DELETE_USER_VAR(ii)
+              CALL deleted_list_modify(uvar_num_items_head, ii,
+     .	            uvar_deleted)
+
+* Remove variable from linked-list structure, the user-variables dataset
+
+              slen = TM_LENSTR( uvar_name_code(ii)  )
+              IF (slen .GT. 0 .AND. uvar_name_code(ii)(1:3) .NE. 'EX#') THEN
+                 CALL TM_FTOC_STRNG( uvar_name_code(ii)(1:slen), fhol, flen )
+
+                 dset_uvars = -1
+                 CALL NCF_DELETE_VAR (dset_uvars, fhol )
+              ENDIF
+
+           ENDIF
+
+ 100	CONTINUE
+
+
+* eliminate context information depending on this data set
+	DO 200 ii = 1, max_context
+	   IF ( cx_data_set( ii ) .EQ. dset ) THEN
+	      cx_data_set( ii ) = unspecified_int4
+	      cx_grid( ii ) = unspecified_int4
+	   ENDIF
+ 200	CONTINUE
+
+	RETURN
+	END
+
diff --git a/fer/mem/fill_memory.F b/fer/mem/fill_memory.F
new file mode 100644
index 0000000..3b277a8
--- /dev/null
+++ b/fer/mem/fill_memory.F
@@ -0,0 +1,66 @@
+	SUBROUTINE FILL_MEMORY ( memory, start_block, num_blocks, fill_word )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill a memory region with the specified value
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/23/86
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	start_block, num_blocks
+	REAL	memory( mem_blk_size, max_mem_blks )
+	REAL	fill_word
+
+* internal variable declarations:
+	INTEGER	iword, iblock
+
+	DO 100 iblock = start_block, start_block+num_blocks-1
+	DO 100 iword  = 1, mem_blk_size
+ 100	memory( iword, iblock ) = fill_word
+
+	RETURN
+	END
+
diff --git a/fer/mem/find_mem_var.F b/fer/mem/find_mem_var.F
new file mode 100644
index 0000000..b32081d
--- /dev/null
+++ b/fer/mem/find_mem_var.F
@@ -0,0 +1,360 @@
+	SUBROUTINE FIND_MEM_VAR( cx, mr, by_value )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* look in the list of variables in memory to see if the requested one is there
+* search may be done based on subscript or on world coordinate values.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/31/86
+* revision 0.1 - 2/25/87 - bumps priority when variable is found
+* revision 1.0 - 3/23/87 - eliminated references to mvar_norm in prep. for 0,1
+*			   dimensional structures.  Added contiguousity test.
+*			   Syntax changes to enhance performance.
+*			   Diagnostic output.
+* revision 1.1 - 5/28/87 - added "STUPID" mode
+* revision 1.2 - 8/19/87 - added check on cx_trans_arg
+* revision 1.3 - 9/10/87 - corrected check on cx_trans_arg
+* revision 1.4 - 3/5/88  - added extraction of lower dimensioned objects
+* revision 2.0 - 7/21/88 - search only through the hash pile of the context
+* revision 2.1 - 10/7/88 - don't use ctxt_norm to determine if exact limits
+*			   check is necessary - test to see if the context
+*			   truely requires a normal location
+* revision 2.1 -10/12/88 - pass bad data flag on extracted variables
+* revision 2.2 - 1/4/89  - check regridding transforms
+* V200:  5/18/89 - 4D symmetrical - no "extracts", no priority "bumping"
+*		 - ignore "given" axes in user defined variables
+* V230:  1/27/92 - special checks for transformations RSUM and WEQ
+*                  and for uvlim_need_lohi used by @WEQ
+*        8/18/92 - @iin matches incorrectly on top limits that aren't full box
+*                  e.g. TEMP[Z=0:1000 at iin] is found looking for TEMP[Z=0:0 at iin]
+* V420:  11/95	- speed up by bypassing NORMAL axes
+*	 	- for modulo axes uvar_given "given" is not a sufficient test
+*				to bypass checks
+* V500: 12/98 *sh* - added support for cat_const_var ("{1,3,5}") (uncached)
+*        1/99 *sh* - added support for cat_string (uncached)
+*	 4/99 *sh* - check mode_arg for mode_stupid
+* V510: 12/99 *sh* - modulo axis to not prevent uvlin_gvn_xact hit
+* V533: 6/01 *sh* - added @EVNT - check as in trans_run_sum
+*	          - check that the data type matches
+*		  - check that the delta value matches
+* 2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 4/13-3/14 *sh* support for auxiliary variables used in regridding
+
+* (V510) How on cache hits on external functions (EFs) work:
+* uvar_given is used to encapsulate information about cache reuse for EF
+* results. This ensures that the information is inherited by variables that use
+* variables that use EFs. The resultant grid of an EF gets its axes from its
+* arguments and from impositions where the EF asserts that the result will have
+* a normal, abstract, or custom-imposed axis. These determine the value
+* of uvar_given as follows. If the result axis is:
+*	set to normal	-> uvlim_irrelevant (no match needed)
+*	set to ABSTRACT	-> uvlim_hidden (no match needed)
+*	set to custom   -> uvlim_hidden (no match needed)
+*	inherited	(exact match required)
+*	  with limits given in the arg definitions -> uvlim_gvn_xact
+*	  with limits missing from the arg definitions -> uvlim_needed_xact
+* Requiring an exact match means that the cached field will be reused only
+* when the lo:hi limits of the requested context exactly match the lo:hi
+* limits for this axis of the cached field. The reason that an exact match
+* is required is because, in general, the function may utilize information
+* from any part of the incoming data to effect all of the result. (For example
+* a function that multipled one argument by the maximum value along the axis
+* of another.) 
+* Some of the internal grid-changing functions (e.g. RESHAPE) require
+* slightly different rules for setting uvar_given -- see gcf_impose_axes.F
+*
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER cx, mr
+	LOGICAL by_value
+
+* internal variable declarations:
+	LOGICAL has_trans, itsa_uvar,
+     .          normal(nferdims), non_modulo(nferdims)
+	INTEGER HASH_CX, line,
+     .		mv, defining_grid, idim, var
+        REAL*8  TM_WORLD, ww_hi_bound
+
+* in "STUPID" mode the program cannot find anything in memory
+*  (4/99) if mode_arg is 1 we are are using "weak_cache", so do not skip out
+	IF (mode_stupid .AND. mode_arg(pmode_stupid,1).NE.1) GOTO 5000
+
+* if the context carries a paux_stat_needed requirement, then a cache hit should
+* not be made, because there is an auxiliary variable to be loaded as well
+	DO idim = 1, nferdims
+	   IF (cx_aux_stat(idim, cx) .EQ. paux_stat_needed) GOTO 5000
+	ENDDO
+
+* initialize
+	defining_grid = cx_grid( cx )
+	var	      = cx_variable(cx)
+
+* is there a completed context to look for ?
+	IF ( defining_grid   .EQ. unspecified_int4
+     .	.OR. cx_data_set(cx) .EQ. unspecified_int4
+     .	.OR. var             .EQ. unspecified_int4 ) GOTO 5000
+
+* cat_const_vars are never cached (see IS_CONST_VAR)
+* ditto for cat_string (as-of 1/99)
+	IF ( cx_category(cx) .EQ. cat_const_var
+     .  .OR. cx_category(cx) .EQ. cat_string   ) GOTO 5000
+
+* are we looking for  user defined variable ?
+	itsa_uvar = cx_category(cx) .EQ. cat_user_var
+
+* do we need special checks for transforms ?
+	has_trans = .FALSE.
+	DO 200 idim = 1, nferdims
+ 200    has_trans = has_trans
+     .        .OR. (cx_trans(idim,cx).NE.trans_no_transform)
+
+* flag the normal axes so we can bypass checks on them quickly
+	DO 210 idim = 1, nferdims
+	   line = grid_line(idim,defining_grid)
+	   IF (line .EQ. mnormal) THEN
+	      normal(idim) = .TRUE.
+	   ELSE 
+	      normal(idim) = .FALSE.
+	      non_modulo(idim) = .NOT.line_modulo(line)
+	   ENDIF
+ 210	CONTINUE
+
+* determine memory hash pile to search
+	mv = HASH_CX( cx )
+
+* locate next table slot in linked list
+ 100	mv = mv_flink( mv )
+	IF ( mv .LT. 0 ) THEN
+	   mr = mr_nonexist
+	   RETURN
+	ENDIF
+
+* right variable ?
+	IF ( mr_variable ( mv ) .NE. cx_variable(cx)
+     .	.OR. mr_category ( mv ) .NE. cx_category(cx)
+     .	.OR. mr_data_set ( mv ) .NE. cx_data_set(cx)
+     .	.OR. mr_grid ( mv ) .NE. defining_grid       ) GOTO 100
+
+* check variable type
+	IF ( mr_type(mv) .NE. cx_type(cx) ) GOTO 100
+
+* right instance (coordinate ranges and transformations) ?
+	IF ( itsa_uvar ) THEN
+
+* * * * * LOOK FOR A USER-DEFINED VARIABLE BASED ON COORDINATE VALUES  * * * * 
+	   DO 40 idim = 1,nferdims
+
+	      IF ( normal(idim) ) GOTO 40
+
+* transformation correct ?
+	      IF ( mr_trans(idim,mv) .NE. cx_trans(idim,cx) ) GOTO 100
+
+* limits specified in uvar expression ? -->  no match necessary
+* 11/95 - since modulo is not stripped until after FIND_MEM_VAR is called
+*	  we cannot bypass this on modulo axes.
+*		e.g. x1 has I=1:10; let xgap=x1[i=3:7]
+*		then list xgap[i=1:15] should not "find" the i=3:7 result
+* 12/99 - if uvlim_gvn_xact then modulo is never stripped in INTERP_STACK
+*	(note: when is it ever stripped for uvlim_gvn_*?. This logic looks
+*		out of date. Maybe the non_modulo restriction can be lifted)
+
+	      IF ( (uvar_given(idim,var) .EQ. uvlim_gvn_xact) .OR.
+     .		   ( (uvar_given(idim,var) .LT. uvlim_gvn_xact) .AND.
+     .		      non_modulo(idim) )  ) GOTO 40
+
+* insist that the  grid stored in memory encompasses the requested data
+	      IF ( mr_lo_ww(idim,mv) .GT. cx_lo_ww(idim,cx)
+     .        .OR. mr_hi_ww(idim,mv) .LT. cx_hi_ww(idim,cx)) GOTO 100
+
+* insist that the delta values match
+	      IF ( mr_delta(idim,mv) .NE. cx_delta(idim,cx) ) GOTO 100
+
+ 40	   CONTINUE
+
+* right instance (coordinate ranges and transformations) ?
+	ELSEIF ( by_value ) THEN
+
+* * * * * * LOOK FOR A VARIABLE BASED ON COORDINATE VALUES * * * * * * * * 
+	   DO 50 idim = 1,nferdims
+
+	      IF ( normal(idim) ) GOTO 50
+
+* transformation correct ?
+	      IF ( mr_trans(idim,mv) .NE. cx_trans(idim,cx) ) GOTO 100
+
+* insist that the  grid stored in memory encompasses the requested data
+	      IF ( mr_lo_ww(idim, mv) .GT. cx_lo_ww(idim, cx)
+     .        .OR. mr_hi_ww(idim, mv) .LT. cx_hi_ww(idim, cx)) GOTO 100
+
+* insist that the delta values match
+	      IF ( mr_delta(idim,mv) .NE. cx_delta(idim,cx) ) GOTO 100
+
+ 50	   CONTINUE
+
+	ELSE		! by subscript
+
+* * * * * * LOOK FOR A VARIABLE BASED ON SUBSCRIPT VALUES * * * * * * * * *
+	   DO 60 idim = 1,nferdims
+
+	      IF ( normal(idim) ) GOTO 60
+
+* transformation correct ?
+	      IF ( mr_trans(idim,mv) .NE. trans_no_transform ) GOTO 100
+	      IF ( cx_trans(idim,cx) .NE. trans_no_transform ) 
+     .		 STOP 'find_by_ss_trans'	! temp diagnostic
+
+* insist that the  grid stored in memory encompasses the requested data
+* ... this is an adequate test because the grids looked for by subscript are
+* ... always untransformed --> normal axes always have a span on 1 point
+	      IF ( mr_lo_ss(mv, idim) .GT. cx_lo_ss(cx, idim)
+     .	      .OR. mr_hi_ss(mv, idim) .LT. cx_hi_ss(cx, idim)) GOTO 100
+
+* insist that the delta values match
+	      IF ( mr_delta(idim,mv) .NE. cx_delta(idim,cx) ) GOTO 100
+
+ 60	   CONTINUE
+	ENDIF
+
+* make sure it is completed
+	IF ( mr_protected( mv ) .EQ. mr_in_progress ) GOTO 100
+
+* special tests left for last to keep the main loop simple and fast
+* ... special limit requirements for indefinite integrals:
+*     to satisfy the search an indefinite integral must have exactly the same
+*     lower limit and must have upper limit either identical or the grid
+*     we are looking for must have upper endpoint on a grid box boundary
+*     ( to avoid errors of partial grid boxes )
+* fixed logic bug: 8/92 using ww_hi_bound
+** was:            IF ( mr_hi_ww(idim,mv).NE.cx_hi_ww(idim,cx)
+**     .          .AND. mr_hi_ss(mv,idim).EQ.cx_hi_ss(cx,idim) ) GOTO 100
+*
+	IF ( has_trans ) THEN
+	   DO 70 idim = 1, nferdims
+	      IF ( normal(idim) ) GOTO 70
+	      IF ( cx_trans( idim, cx ) .EQ. trans_integ_indef ) THEN
+	         IF ( mr_lo_ww(idim,mv).NE.cx_lo_ww(idim,cx) ) GOTO 100
+                 IF ( mr_hi_ww(idim,mv).NE.cx_hi_ww(idim,cx) ) THEN
+                    ww_hi_bound = TM_WORLD( cx_hi_ss(cx,idim),
+     .                         defining_grid, idim, box_hi_lim ) 
+                    IF ( ww_hi_bound .NE. cx_hi_ww(idim,cx)) GOTO 100
+                 ENDIF
+	      ENDIF
+ 70	   CONTINUE
+	ENDIF
+
+	IF ( has_trans ) THEN
+	   DO 80 idim = 1, nferdims
+	      IF ( normal(idim) ) GOTO 80
+* ... argument of transform must be right
+* ... and transforms that compress to a point must have exact limits
+	      IF ( cx_trans_arg(idim,cx).NE.mr_trans_arg(idim,mv) ) GOTO 100
+	      IF ( cx_trans(idim,cx) .GT. trans_compress_code ) THEN
+	         IF ( mr_lo_ww(idim,mv).NE.cx_lo_ww(idim,cx) ) GOTO 100
+	         IF ( mr_hi_ww(idim,mv).NE.cx_hi_ww(idim,cx) ) GOTO 100
+	      ENDIF
+* ... @RSUM must match lower subscript exactly (1/92)
+* ... @EVNT ditto (6/01)
+	      IF ( cx_trans( idim, cx ) .EQ. trans_run_sum
+     .        .OR. cx_trans( idim, cx ) .EQ. trans_event_mask ) THEN
+                 IF ( mr_lo_ss(mv,idim).NE.cx_lo_ss(cx,idim) ) GOTO 100
+              ENDIF
+* ... @WEQ must match both hi and lo subscripts (1/92)
+	      IF ( cx_trans( idim, cx ) .EQ. trans_wgted_eq ) THEN
+                 IF ( mr_lo_ss(mv,idim).NE.cx_lo_ss(cx,idim)
+     .           .OR. mr_hi_ss(mv,idim).NE.cx_hi_ss(cx,idim) ) GOTO 100
+              ENDIF
+
+ 80	   CONTINUE
+	ENDIF
+
+* ... if regridded then regridding transforms must be right
+	IF ( cx_unstand_grid( cx ) ) THEN
+	   DO 90 idim = 1, nferdims
+	      IF ( normal(idim) ) GOTO 90
+	      IF ( cx_regrid_trans( idim, cx ) .NE.
+     .		   mr_regrid_trans( idim, mv   ) ) GOTO 100
+ 90	   CONTINUE
+* ... check for auxiliary regridding match
+	   IF ( mr_naux( mv ) .NE. cx_naux( cx ) ) GOTO 100
+	   IF ( cx_naux( cx ) .GT. 0 ) THEN
+	      DO 91 idim = 1, nferdims
+	         IF ( cx_aux_var(idim,cx) .NE. mr_aux_var(idim, mv)
+     .	        .OR.  cx_aux_cat(idim,cx) .NE. mr_aux_cat(idim, mv) )
+     .								GOTO 100 
+ 91	      CONTINUE
+	   ENDIF
+	ENDIF
+
+* ... if user-defined then watch out for special limit match requirements
+	IF ( itsa_uvar ) THEN
+	   DO 92 idim = 1, nferdims
+	      IF ( normal(idim) ) GOTO 92
+	      IF ( uvar_given(idim,var) .EQ. uvlim_need_xact
+     .        .OR. uvar_given(idim,var) .EQ. uvlim_need_lohi ) THEN
+	         IF ( mr_lo_ww(idim,mv) .NE. cx_lo_ww(idim,cx)
+     .           .OR. mr_hi_ww(idim,mv) .NE. cx_hi_ww(idim,cx)) GOTO 100
+	      ELSEIF ( uvar_given(idim,var) .EQ. uvlim_need_lo ) THEN
+	         IF ( mr_lo_ww(idim,mv) .NE. cx_lo_ww(idim,cx)
+     .           .OR. mr_hi_ww(idim,mv) .LT. cx_hi_ww(idim,cx)) GOTO 100
+	      ENDIF
+ 92	   CONTINUE
+	ENDIF
+
+* WE FOUND IT !
+	mr = mv
+
+* ... diagnostic message ?
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('found  ',mr,point_to_mr)
+
+* ... send back pointer
+	RETURN
+
+* failure exit
+ 5000	mr = mr_nonexist
+	RETURN
+	END
diff --git a/fer/mem/find_mr_slot.F b/fer/mem/find_mr_slot.F
new file mode 100644
index 0000000..29a1adc
--- /dev/null
+++ b/fer/mem/find_mr_slot.F
@@ -0,0 +1,88 @@
+	SUBROUTINE FIND_MR_SLOT( cx, mr, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* locate an unused slot in the memory variable table and assign it to the
+* hash pile associated with the given context (cx)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/21/88
+* V200:  6/12/89 - delete priorities handled through linked lists
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cx, mr, status
+
+* internal variable declarations:
+	INTEGER HASH_cx, pile, head
+
+* is there a slot in the free slot list ?
+ 100	IF ( mv_flink( 0 ) . EQ. 0 ) THEN
+* ... no - delete lowest priority variable to make room and try again
+	   mr = mr_del_blink(0)
+	   IF ( mr .EQ. 0 ) GOTO 5010
+	   CALL DELETE_VARIABLE( mr )
+	ENDIF
+
+* transfer the slot from the free list to the cx hash pile
+*    ... remove from free list head
+	mr = mv_flink( 0 )
+	mv_flink( 0 ) = mv_flink( mr )
+*    ... add to head of hash pile
+	pile = HASH_cx( cx )
+	head = mv_flink( pile )
+	mv_flink( pile ) = mr
+	mv_flink( mr ) = head
+	mv_blink( mr ) = pile
+	mv_blink( head ) = mr
+
+* successful completion
+	status = ferr_ok
+ 5000	RETURN
+
+* error exit : no space available
+ 5010	CALL ERRMSG( ferr_too_many_vars, status,' ', *5000 )
+	END
diff --git a/fer/mem/find_var_name.F b/fer/mem/find_var_name.F
new file mode 100644
index 0000000..be6fa7d
--- /dev/null
+++ b/fer/mem/find_var_name.F
@@ -0,0 +1,392 @@
+	SUBROUTINE FIND_VAR_NAME ( dset_num, test_name, category, variable )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the given name by finding it in one of the known categories
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/4/86
+* revision 0.1 - 1/20/87 - changed nvari_prenamed to num_fils_vars for PSI
+* revision 0.2 - 3/6/87  - introduced user var search and munknown_var_name
+* revision 0.3 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 0.4 - 3/10/88 - added cat_named_var and unspecified data set
+* V200:  6/20/89 - eliminated "named" variables
+*	 1/25/90 - padded cvar_name_code with 4 blanks avoid QADXT=QADX match
+* V402:  7/95 - Added support for  LET/D=dset var = ...
+* V495: 7/7/98 - *sh* allow case-sensitive variable names in quotes from dsets
+*       user variable names are allowed in quotations just for
+*       consistency. Pseudo-variable names in quotes are not allowed -- so they
+*       don't get confused
+* V510 5/00 *sh* - don't match on a cvar unless the data set indicates
+*	Philander-Seigel
+* V554 1/04 *acm* Add category cat_counter_var
+*  ywei 05/04 change MATCH_NAME and MATCH_QUOTED_NAME function calls to speed up
+* V600 *acm* 6/05 attribute control.  If the variable contains a dot (e.g. varname.attname
+*                 or varname.attnum) then find and use just the varname.
+* V600 9/05 *acm* Fix bug 1336: 
+*                 Restore the order of searching through the different lists
+*                 of variable names (the chunk of code now at DO 250).  Yonghua had
+*                 moved this for efficiency but it wound up finding the wrong
+*                 variable def for user variables defined with LET/D.
+* v600 6/06 *acm* initialize category to 0 (needed for solaris)
+* V63  *acm* 10/09 Changes for gfortran build
+* PyFr *kms* 11/10 add examination of pyvar (cat_pystat_var) variables
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+* V685+ *acm* 3/13 For Ensemble ds_type, check datset number before testing its type
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+        include 'errmsg.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xcalc_vars.cmn'
+	include	'xalgebra.cmn'
+	include	'xdset_parms.cmn'
+        include 'xcontrol.cmn'
+        include 'xpyvar_info.cmn'
+
+* calling argument declarations:
+	INTEGER		dset_num, category, variable
+	CHARACTER*(*)	test_name
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR, ivar, uvdset, len_test, len_mchars,
+     .                  j, num_indices, varid, dset, status
+	LOGICAL		MATCH_QUOTED_NAME, single_dset, do_err
+        CHARACTER       varname*512, attname*128
+        CHARACTER*258   buff
+
+* initialize
+        buff = test_name
+	single_dset = dset_num .NE. unspecified_int4
+        len_test = TM_LENSTR(test_name)
+        category = 0
+        dset = dset_num
+
+        IF (INDEX(test_name, '.') .GT. 0) THEN
+           do_err = .TRUE.
+           CALL BREAK_VARATTNAME ( test_name, dset, varname, 
+     .                             attname, varid, do_err, status )
+           IF (status .EQ. ferr_ok) THEN
+              category = cat_attrib_val
+              RETURN
+
+* String marked as not being a varname.attname, perhaps a string in
+* quotes that may contain a dot.
+
+           ELSE IF (status .EQ. ferr_not_attribute) THEN
+              GOTO 500 
+
+           ELSE 
+              variable = munknown_var_name
+              RETURN
+           ENDIF
+        ENDIF
+*
+
+*                  CALL tm_log( test_name, len_test) 
+
+* start by checking counter variable names
+*	DO 10 ivar = 1, num_counter_vars
+*           len_mchars = TM_LENSTR(countervar_name(ivar))
+*	   IF ( MATCH_NAME( test_name, len_test,
+*        1	   countervar_name(ivar),len_mchars ) ) THEN
+*	      category = cat_counter_var
+*	      variable = ivar
+*	      RETURN
+*	   ENDIF
+* 10	CONTINUE
+
+ 500 	CALL string_array_find(countervar_name_head,
+     .                         test_name,
+     .                         len_test,
+     .                         string_array_result(1),
+     .                         max_uvar,
+     .                         num_indices)
+        IF(num_indices.GT.0) THEN
+              ivar = string_array_result(1)
+	      category = cat_counter_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+        ENDIF
+
+* check pseudo-variables names
+*	DO 20 ivar = 1, num_pseudo_vars
+*           len_mchars = TM_LENSTR(alg_pvar(ivar))
+*	   IF ( MATCH_NAME( test_name, len_test, alg_pvar(ivar),len_mchars)) 
+*        1	   THEN
+*	      category = cat_pseudo_var
+*	      variable = ivar
+*	      RETURN
+*	   ENDIF
+* 20	CONTINUE
+
+	CALL string_array_find(alg_pvar_head,
+     .                         test_name,
+     .                         len_test,
+     .                         string_array_result(1),
+     .                         max_uvar,
+     .                         num_indices)
+        IF(num_indices.GT.0) THEN
+              ivar = string_array_result(1)
+	      IF (ivar .GT. 30) ivar = ivar - 30 ! allow _I,_J,_K,_L,_X,_Y,_Z,_T 
+	      category = cat_pseudo_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+        ENDIF
+
+* check data user-defined variables
+*       CALL tm_log(my_cbuff, 255)
+        CALL string_array_find_quoted(uvar_name_code_head,
+     .                                test_name,
+     .                                len_test,
+     .                                string_array_result(1),
+     .                                max_uvar,
+     .                                num_indices)
+*         cat_test = -1
+*         var_test = -1
+* ... first check for an explicitly named data set
+*	   DO 40 ivar = 1, max_uvar
+*	      IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 40
+*	      IF ( uvar_dset( ivar ) .NE. dset ) GOTO 40
+*              len_mchars = TM_LENSTR(uvar_name_code(ivar))
+*	      IF ( MATCH_QUOTED_NAME(test_name,len_test, uvar_name_code(ivar), len_mchars))
+*     .        	   THEN
+*	         category = cat_user_var
+*	         variable = ivar
+*	         RETURN
+*	      ENDIF
+* 40	   CONTINUE
+	IF ( single_dset ) THEN
+           DO 40 j = 1, num_indices
+              ivar = string_array_result(j)
+	      IF ( uvar_dset( ivar ) .NE. dset ) GOTO 40
+              IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 40
+              category = cat_user_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+ 40	      CONTINUE
+
+
+	ELSE
+* ... check for an implicitly named data set - the "current" data set
+	   uvdset = cx_data_set(cx_last)
+	   IF ( uvdset .NE. unspecified_int4 ) THEN
+*	      DO 60 ivar = 1, max_uvar
+*	         IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 60
+*	         IF ( uvar_dset( ivar ) .NE. uvdset ) GOTO 60
+*                 len_mchars = TM_LENSTR(uvar_name_code(ivar))
+*	         IF ( MATCH_QUOTED_NAME( test_name,len_test, uvar_name_code(ivar),len_mchars))
+*     .        	      THEN
+*	            category = cat_user_var
+*	            variable = ivar
+*	            RETURN
+*	         ENDIF
+* 60	      CONTINUE
+           DO 60 j = 1, num_indices
+              ivar = string_array_result(j)
+	      IF ( uvar_dset( ivar ) .NE. uvdset ) GOTO 60
+              IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 60
+              category = cat_user_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+ 60	      CONTINUE
+	   ENDIF
+	ENDIF
+
+* ... check the global user variable definitions defined without /D
+*	DO 100 ivar = 1, max_uvar
+*	   IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 100
+*	   IF ( uvar_dset( ivar ) .NE. unspecified_int4 ) GOTO 100
+*           len_mchars = TM_LENSTR(uvar_name_code(ivar))
+*	   IF ( MATCH_QUOTED_NAME( test_name,len_test,uvar_name_code(ivar),len_mchars) )
+*     .        	THEN
+*	      category = cat_user_var
+*	      variable = ivar
+*	      RETURN
+*	   ENDIF
+* 100	CONTINUE
+           DO 100 j = 1, num_indices
+              ivar = string_array_result(j)
+	      IF ( uvar_dset( ivar ) .NE. unspecified_int4 ) GOTO 100
+              IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 100
+              category = cat_user_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+ 100	      CONTINUE
+
+*       Check pystat variables
+        CALL string_array_find_quoted(pyvar_code_head,
+     .                                test_name,
+     .                                len_test,
+     .                                string_array_result(1),
+     .                                maxpyvars,
+     .                                num_indices)
+        IF ( single_dset ) THEN
+*           Check for an explicitly named data set
+            DO 150 j = 1,num_indices
+                ivar = string_array_result(j)
+                IF ( pyvar_dset_number(ivar) .NE. dset) GOTO 150
+                IF ( pyvar_ndarray_obj(ivar) .EQ. 0 ) GOTO 150
+                category = cat_pystat_var
+                variable = ivar
+                test_name = buff
+                RETURN
+ 150        CONTINUE
+        ELSE
+*           Check for an implicitly named data set - the "current" data set
+            uvdset = cx_data_set(cx_last)
+            IF ( uvdset .NE. unspecified_int4 ) THEN
+                DO 160 j = 1,num_indices
+                    ivar = string_array_result(j)
+                    IF ( pyvar_dset_number(ivar) .NE. dset) GOTO 160
+                    IF ( pyvar_ndarray_obj(ivar) .EQ. 0 ) GOTO 160
+                    category = cat_pystat_var
+                    variable = ivar
+                    test_name = buff
+                    RETURN
+ 160            CONTINUE
+            ENDIF
+        ENDIF
+*       Check pystat variables without an associated dataset
+        DO 170 j = 1,num_indices
+            ivar = string_array_result(j)
+            IF ( pyvar_dset_number(ivar) .NE. unspecified_int4 ) GOTO 170
+            IF ( pyvar_ndarray_obj(ivar) .EQ. 0 ) GOTO 170
+            category = cat_pystat_var
+            variable = ivar
+            test_name = buff
+            RETURN
+ 170    CONTINUE
+
+* check file variables from this data set
+*	DO 200 ivar = 1, maxvars
+*	   IF ( single_dset .AND. ds_var_setnum( ivar ) .NE. dset ) GOTO 200
+*           len_mchars = TM_LENSTR(ds_var_code(ivar))
+*	   IF ( MATCH_QUOTED_NAME( test_name,len_test, ds_var_code( ivar ),len_mchars)) 
+*        1    THEN
+*	      category = cat_file_var
+*	      variable = ivar
+*	      RETURN
+*	   ENDIF
+* 200	CONTINUE
+
+        CALL string_array_find_quoted(ds_var_code_head,
+     .                                test_name,
+     .                                len_test,
+     .                                string_array_result(1),
+     .                                max_uvar,
+     .                                num_indices)
+        DO 200 j = 1, num_indices
+           ivar = string_array_result(j)
+	   IF ( single_dset .AND. ds_var_setnum( ivar ) .NE. dset ) GOTO 200
+ 	   category = cat_file_var
+ 	   IF (dset.NE.unspecified_int4) THEN
+	      IF (ds_type(dset) .EQ. 'ENS') category = cat_aggregate_var
+ 	   ENDIF
+	   variable = ivar
+           test_name = buff
+           RETURN
+ 200	CONTINUE
+
+
+* ... check the global user variable definitions defined with /D
+*       CALL tm_log(my_cbuff, 255)
+        CALL string_array_find_quoted(uvar_name_code_head,
+     .                                test_name,
+     .                                len_test,
+     .                                string_array_result(1),
+     .                                max_uvar,
+     .                                num_indices)
+*	DO 250 ivar = 1, max_uvar
+*	   IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 250
+*	   IF ( uvar_dset( ivar ) .NE. pdset_irrelevant ) GOTO 250
+*           len_mchars = TM_LENSTR(uvar_name_code(ivar))
+*	   IF ( MATCH_QUOTED_NAME( test_name,len_test,uvar_name_code(ivar),len_mchars))
+*     .        	THEN
+*	      category = cat_user_var
+*	      variable = ivar
+*	      RETURN
+*	   ENDIF
+* 250	CONTINUE
+           DO 250 j = 1, num_indices
+              ivar = string_array_result(j)
+	      IF ( uvar_dset( ivar ) .NE. pdset_irrelevant ) GOTO 250
+              IF ( uvar_num_items( ivar ) .EQ. uvar_deleted ) GOTO 250
+              category = cat_user_var
+	      variable = ivar
+              test_name = buff
+	      RETURN
+ 250	      CONTINUE
+
+* check table of calculatable variables (padded to 8 characters)
+*   but only if this is a Philander-Seigle model output
+	IF ( dset.GE.1 .AND. dset.LE.maxdsets ) THEN
+	   IF (dp_phil_sieg(dset).OR.dp_cox(dset)) THEN
+	      DO 300 ivar = 1, num_calc_vars
+                 len_mchars = TM_LENSTR(cvar_name_code(ivar))
+	         IF (MATCH_QUOTED_NAME(test_name,len_test,
+     .               cvar_name_code(ivar)//'    ',len_mchars))
+     .        	   THEN
+	            category = cat_calc_var
+	            variable = ivar
+                    test_name = buff
+	            RETURN
+	         ENDIF
+ 300	      CONTINUE
+	   ENDIF
+	ENDIF
+
+* not found
+	variable = munknown_var_name
+        test_name = buff
+
+	RETURN
+
+	END
diff --git a/fer/mem/free_memory.F b/fer/mem/free_memory.F
new file mode 100644
index 0000000..ce8f359
--- /dev/null
+++ b/fer/mem/free_memory.F
@@ -0,0 +1,144 @@
+	SUBROUTINE FREE_MEMORY ( mblk, num_blocks )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a contiguous region of bulk memory to the free list merging it with
+* the surrounding free regions if they are contiguous
+* ( return the merged size via COMMON in mr_del_last_size )
+* see documentation in XVARIABLES.CMN
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/1/86
+* revision 1.0 - 7/21/88 - complete re-write using linked list
+* V200:  6/12/89 - use doubly linked list; return mr_del_last_*
+*	 8/1/89  - corrected bug: mr_del_last* not set for not contig at all
+* V312: 5/94 - array "memory" as a calling argument
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	mblk, num_blocks, mem_blk, i
+
+* internal variable declarations:
+	INTEGER	prev, next, nex2
+	LOGICAL	contig_above, contig_below
+
+! temp diag
+	IF ( num_blocks .NE. mblk_size( mblk ) ) STOP ' FREE_MEMORY'
+
+!* as a diagnostic test - fill unused memory with a flag
+! removed 5/18/94 as "memory" is no longer in COMMON 
+!	IF ( mode_diagnostic ) THEN
+!	   DO 50 mem_blk = mblk, mblk+num_blocks-1
+!	   DO 50 i = 1, mem_blk_size
+! 50	   memory( i,mem_blk ) = bad_val4
+!	ENDIF
+
+* find the position of "mblk" in the ordered free memory list
+	prev = 0
+	next = mblk_flink( prev )
+ 100	IF ( next .EQ. 0 ) THEN
+* ... end of list - this mblk value must be greater than anything in the list
+	   GOTO 200
+	ELSEIF ( next .LT. mblk ) THEN
+* ... keep looking further in the list
+	   prev = next
+	   next = mblk_flink( next )
+	   GOTO 100
+	ENDIF
+* ... found it - prev<mblk and next>mblk
+	nex2 = mblk_flink( next )
+
+* will the new region merge contiguously above or below ?
+ 200	contig_above = mblk + num_blocks .EQ. next
+	contig_below = prev + mblk_size(prev) .EQ. mblk
+     .		 .AND. prev .NE. 0
+
+* insert the freed bulk memory region into the free list
+	IF ( contig_above .AND. contig_below ) THEN
+	   mr_del_last_mblk   = prev
+	   mr_del_last_size   = mblk_size( prev )
+     .			      + num_blocks
+     .			      + mblk_size( next )
+	   mblk_size ( prev ) = mr_del_last_size
+	   mblk_flink( prev ) = nex2
+	   mblk_blink( nex2 ) = prev
+	   mblk_flink( mblk ) = unspecified_int4	! temp diag
+	   mblk_blink( mblk ) = unspecified_int4	! temp diag
+	   mblk_size ( mblk ) = unspecified_int4	! temp diag
+	   mblk_flink( next ) = unspecified_int4	! temp diag
+	   mblk_blink( next ) = unspecified_int4	! temp diag
+	   mblk_size ( next ) = unspecified_int4	! temp diag
+
+	ELSEIF ( contig_above ) THEN
+	   mr_del_last_mblk   = mblk
+	   mr_del_last_size   = num_blocks + mblk_size( next )
+	   mblk_size ( mblk ) = mr_del_last_size
+	   mblk_flink( mblk ) = nex2
+	   mblk_blink( mblk ) = prev
+	   mblk_blink( nex2 ) = mblk
+	   mblk_flink( prev ) = mblk
+	   mblk_flink( next ) = unspecified_int4	! temp diag
+	   mblk_blink( next ) = unspecified_int4	! temp diag
+	   mblk_size ( next ) = unspecified_int4	! temp diag
+
+	ELSEIF ( contig_below ) THEN
+	   mr_del_last_mblk   = prev
+	   mr_del_last_size   = mblk_size( prev ) + num_blocks
+	   mblk_size ( prev ) = mr_del_last_size
+	   mblk_flink( mblk ) = unspecified_int4	! temp diag
+	   mblk_blink( mblk ) = unspecified_int4	! temp diag
+	   mblk_size ( mblk ) = unspecified_int4	! temp diag
+
+	ELSE
+	   mr_del_last_mblk   = mblk
+	   mr_del_last_size   = num_blocks
+	   mblk_flink( mblk ) = next
+	   mblk_blink( mblk ) = prev
+	   mblk_flink( prev ) = mblk
+	   mblk_blink( next ) = mblk
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/mem/fvar_number.F b/fer/mem/fvar_number.F
new file mode 100644
index 0000000..a14e6eb
--- /dev/null
+++ b/fer/mem/fvar_number.F
@@ -0,0 +1,91 @@
+	INTEGER FUNCTION FVAR_NUMBER( dset_num, name_code )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the given name_code by finding it among the given data set variables
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/18/87
+* revision 0.1 - 8/29/87 - added vms_str_success
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl_vms.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+* calling argument declarations:
+	INTEGER		dset_num
+	CHARACTER*(*)	name_code
+
+* internal variable declarations:
+	INTEGER	        fvar, j, num_indices 
+
+* loop through all file variables
+*	DO 100 fvar = 1, maxvars
+*	   IF ( ds_var_setnum( fvar ) .NE. dset_num ) GOTO 100
+*	   vax_code = STR_CASE_BLIND_COMPARE( name_code, ds_var_code(fvar) )
+
+* found the name code ?
+*	   IF ( vax_code .EQ. vms_str_success ) THEN
+*               FVAR_NUMBER = fvar
+*	       RETURN
+*	   ENDIF
+* 100	CONTINUE
+
+        CALL string_array_find_caseblind(ds_var_code_head,
+     .                                   name_code,
+     .                                   LEN(name_code),
+     .                                   string_array_result1(1),
+     .                                   maxvars,
+     .                                   num_indices)
+        DO 100 j = 1, num_indices
+           fvar = string_array_result1(j)
+           IF ( ds_var_setnum( fvar ) .NE. dset_num ) GOTO 100
+	   FVAR_NUMBER = fvar
+	   RETURN
+ 100	CONTINUE
+
+* not found
+	FVAR_NUMBER = var_name_nonexist
+	RETURN
+
+	END
diff --git a/fer/mem/get_memory.F b/fer/mem/get_memory.F
new file mode 100644
index 0000000..a494313
--- /dev/null
+++ b/fer/mem/get_memory.F
@@ -0,0 +1,160 @@
+	SUBROUTINE GET_MEMORY ( num_words, mblk, num_blocks, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find and reserve a section of contiguous memory sufficient to hold num_words 
+* procedure:
+* first check the list of free memory regions to see if there is one big enough
+* if not then delete variables working from the tail of the priority chain
+* when an adequate region is found pluck what it needed of it from the free list
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/31/86
+* revision 0.1 - 7/21/88 - no special call to "CLAIM_MEMORY" since FIND_MEMORY
+*			   claims it, too, now
+* V200:  6/12/89 - delete priorities handled through linked lists
+*		 - eliminated FIND_MEMORY
+*	  4/5/90 - spruced up error message
+* V230:  4/30/92 - added coaching to error message
+* V500:  3.20.99 Make sure num_words >= 0 (absurdly large grids can overflow
+*                integer) js
+* V520: 6/00 *sh* - improved error message
+* V522: 7/00 *sh* corrected typo in previous ... 
+* V530: 5/01 - further improved error mesages (for 9999999 words)
+* v553: 9/03 *kob* - need to update error calls to include alternate return
+*                    label.  Bug showed up on IRIX with missing elements
+*		     of error statement
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685 *acm*  6/13 Increase nominal length of abstract axis
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	num_words, mblk, num_blocks, status
+
+* internal variable declarations:
+	INTEGER	mr, next, prev, size, new_mblk, num_slen
+	CHARACTER  LEFINT*12, num_str*12
+
+* Number of words reasonable?
+	if (num_words .lt. 0) goto 5200
+	   
+
+* COMPUTE # BLOCKS NEEDED
+	num_blocks = ( num_words + mem_blk_size - 1 ) / mem_blk_size
+
+* LOOK FOR A MEMORY REGION ALREADY AVAILABLE
+* ... use linked list into free memory regions
+	mblk = mblk_flink( 0 )
+
+* ... nothing more to check ?
+ 100	IF ( mblk .EQ. 0 ) GOTO 200
+
+* ... another region to check out - is it big enough ?
+	size = mblk_size ( mblk )
+	IF ( size .LT. num_blocks ) THEN
+	   mblk = mblk_flink( mblk )
+	   GOTO 100
+	ELSE
+	   GOTO 500
+	ENDIF
+	   
+* NOTHING BIG ENOUGH IS AVAILABLE AT PRESENT
+* delete from tail of deletion priority chain looking for something big enough
+ 200	mr = mr_del_blink(0)
+	IF ( mr .EQ. 0 ) GOTO 5100
+	CALL DELETE_VARIABLE( mr )
+	size = mr_del_last_size
+	IF ( size .LT. num_blocks ) THEN
+	   GOTO 200
+	ELSE
+	   mblk = mr_del_last_mblk
+	ENDIF
+
+* WE HAVE GOT A REGION AT LEAST BIG ENOUGH
+ 500	prev = mblk_blink( mblk )
+	next = mblk_flink( mblk )
+
+	IF ( size .EQ. num_blocks ) THEN
+* ... perfect size - remove it from the free list
+	   mblk_flink( prev ) = next
+	   mblk_blink( next ) = prev
+
+	ELSE
+* ... unnecessarily big - bite off only what we need
+	   new_mblk = mblk + num_blocks
+	   mblk_flink( new_mblk ) = next
+	   mblk_blink( new_mblk ) = prev
+	   mblk_size ( new_mblk ) = size - num_blocks
+	   mblk_flink( prev )     = new_mblk
+	   mblk_blink( next )     = new_mblk
+	ENDIF
+
+* success - set up the requested region and give it to them
+	mblk_size ( mblk ) = num_blocks
+	status = ferr_ok
+
+	mblk_flink( mblk ) = unspecified_int4	! temp diag
+	mblk_blink( mblk ) = unspecified_int4	! temp diag
+
+ 5000	RETURN
+ 5100	CONTINUE
+	IF ( num_words .EQ. 99999999 ) THEN
+          num_str = LEFINT(num_words,num_slen)
+	  CALL ERRMSG( ferr_dim_underspec, status,
+     .	  num_str(:num_slen)//' words were requested. ', *5125)
+ 5125	  CALL WARN('Check for unspecified limits on an ABSTRACT axis')
+          CALL WARN('Use the SHOW GRID command to see the axes')
+	ELSE
+          num_str = LEFINT(INT((num_words+0.99999E6)/1.0E6),num_slen)
+	  CALL ERRMSG( ferr_insuff_memory,status,
+     .	  num_str(:num_slen)//' Mwords were requested. ', *5130)
+ 5130	  CALL WARN('You can use SET MEMORY/SIZE=xxx to increase memory.')
+          CALL WARN('The "Memory use" section of the FERRET '
+     .              //'Users Guide has further tips.') 
+	ENDIF
+        GOTO 5000
+ 5200	CONTINUE
+	CALL ERRMSG( ferr_insuff_memory,status,
+     .	'A negative number of words were requested. ', *5210)
+ 5210	CALL WARN('The current grid is most likely too large')
+	RETURN
+	END
diff --git a/fer/mem/get_work_mr.F b/fer/mem/get_work_mr.F
new file mode 100644
index 0000000..112d60a
--- /dev/null
+++ b/fer/mem/get_work_mr.F
@@ -0,0 +1,103 @@
+	SUBROUTINE GET_WORK_MR ( size, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* allocate and return a managed block of memory without a corresponding
+* context that points to it. 
+* The routines delete_variable and delete_uncached_vars are responsible for
+* freeing the memory
+* This routine may be called to get as many separate chunks of work space
+* as are required -- unlike GET_MEM_SPC, which returns always the same
+* single hunk of memory. (This routine is superior to GET_WORK_SPC in almost
+* every way ... should really replace that routine.)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510 8/99 *sh*
+*      2/00 *sh* bug fix - initialize mr_grid
+* V533 7/01 *sh* - set data type
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	size, mr, status
+
+* internal variable declarations
+	INTEGER start_block, num_blocks, idim
+
+* --- end of introductory code ---
+
+	CALL GET_MEMORY( size, start_block, num_blocks, status )
+
+* get a free slot in the memory variable table
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	cx_category(cx_stack_ptr) = cat_work_mr
+	CALL FIND_MR_SLOT( cx_stack_ptr, mr, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	cx_stack_ptr = cx_stack_ptr - 1
+
+* point mr slot to data in bulk memory
+	mr_blk1     ( mr )	= start_block
+	mr_nblks    ( mr )	= num_blocks
+
+* always set its data type to float
+	mr_type( mr ) = ptype_float
+
+* always set its missing value flag to the default
+	mr_bad_data( mr ) = bad_val4
+
+* flag it as "in progress"
+	mr_protected( mr )	= mr_in_progress
+
+* work arrays do not use any grids
+	mr_grid( mr ) = unspecified_int4
+
+* for good house-keeping, set the mr subscripts
+	mr_lo_ss(mr,x_dim) = 1
+	mr_hi_ss(mr,x_dim) = size
+	DO 100 idim = 2, nferdims
+	   mr_lo_ss(mr,idim) = unspecified_int4
+	   mr_hi_ss(mr,idim) = unspecified_int4
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/get_work_spc.F b/fer/mem/get_work_spc.F
new file mode 100644
index 0000000..973a74e
--- /dev/null
+++ b/fer/mem/get_work_spc.F
@@ -0,0 +1,77 @@
+	SUBROUTINE GET_WORK_SPC ( size, start_block, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* provide a region of temporary working space to the calling routine.
+* For greatest speed simply reuse the last provided if it is large enough
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+* V510: *sh 1/2000 - bug fix when unable to allocate requested work space
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xwork_space.cmn'
+
+* calling argument declarations:
+	INTEGER	size, start_block, status
+
+* --- end of introductory code ---
+
+	IF ( size .LE. sp_last_size ) THEN
+	   status = ferr_ok
+
+	ELSE
+	   CALL RELEASE_WORK_SPC
+	   CALL GET_MEMORY( size, sp_start_block, sp_num_blocks, status )
+	   IF ( status .EQ. ferr_ok ) THEN
+	      sp_last_size = sp_num_blocks * mem_blk_size
+	   ELSE
+	      sp_last_size = 0
+	   ENDIF
+	ENDIF
+
+	start_block = sp_start_block
+	RETURN
+	END
+
diff --git a/fer/mem/hash_cx.F b/fer/mem/hash_cx.F
new file mode 100644
index 0000000..32fef4b
--- /dev/null
+++ b/fer/mem/hash_cx.F
@@ -0,0 +1,104 @@
+	INTEGER FUNCTION HASH_CX( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* generate a pseudo-random pile number between 1 and pmv_npiles based on
+* information in the passed context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/21/88
+* V200:  7/12/89 - special treatment for cat_temp_var
+* V510: 8/99 *sh* special treatment for cat_work_mr
+* v580: 9/04 *acm* Fix Bug 993: constant variables and string variables
+*                  use (1000*uvar + item) to pack extra information
+*                  into what is stored in cx_variable(cx).  When these
+*                  very large values go into computing nsum here,
+*                  the expression 2107*nsum overflows and becomes
+*                  a negative number, and so HASH_CX computed at the 
+*                  end of this routine is 0 or > 0.  This messes up 
+*                  the linked lists for variables in memory. Use uvar 
+*                  for these types of vars so HASH_CX is always negative.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'	! for pmv_npiles
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cx
+
+* internal variable declarations:
+	INTEGER idim, nsum, cat, uvar
+
+* initialize
+	cat = cx_category( cx )
+
+* special Q&D solution for temporary variables, etc.
+	IF ( cat .EQ. cat_constant 
+     .  .OR. cat .EQ. cat_temp_var
+     .  .OR. cat .EQ. cat_pseudo_var ) THEN
+	   HASH_CX = -1
+	   RETURN
+	ELSEIF ( cat .EQ. cat_work_mr ) THEN
+	   HASH_CX = pmv_work_var_pile
+	   RETURN
+	ENDIF
+	
+* arbitrary number generated from context information
+        uvar = cx_variable( cx )
+        IF (cat .EQ. cat_const_var .OR. cat .EQ. cat_string)  
+     .       uvar = cx_variable(cx)/1000
+
+	nsum = cx_data_set( cx )
+     .	     + uvar * 7
+     .	     + cat * 13
+	DO 100 idim = 1, nferdims
+	   IF ( cx_trans( idim, cx ) .NE. trans_no_transform )
+     .	      nsum = nsum + idim*idim
+ 100	CONTINUE
+
+* randomize the number and return a NEGATIVE pile number
+
+	HASH_CX = -1 * ( MOD( 2107*nsum, pmv_npiles ) + 1 )
+        IF (HASH_CX .GE. 0) HASH_CX = -1
+
+	RETURN
+	END
diff --git a/fer/mem/hash_name.F b/fer/mem/hash_name.F
new file mode 100644
index 0000000..6952ccc
--- /dev/null
+++ b/fer/mem/hash_name.F
@@ -0,0 +1,68 @@
+	INTEGER FUNCTION HASH_NAME( name, npiles )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* produce a pseudo-random number between 1 and npiles from the given name
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/7/87
+
+        IMPLICIT NONE
+
+* calling argument declarations
+	INTEGER		npiles
+	CHARACTER*(*)	name
+
+* local variable declarations
+	INTEGER	TM_LENSTR1, len_name, pile, i, new_char
+
+	len_name = TM_LENSTR1( name )
+
+* generate pseudo-random integer based on name
+	pile = 0
+	DO 100 i = 1, len_name
+	   new_char = MOD( 2107*ICHAR(name(i:i)), 531 )
+	   pile = IEOR( pile, new_char )
+ 100	CONTINUE
+
+* modulo to number of piles indicated
+	HASH_NAME = MOD( pile, npiles ) + 1
+
+	RETURN
+	END
diff --git a/fer/mem/init_grid.F b/fer/mem/init_grid.F
new file mode 100644
index 0000000..69ca0d4
--- /dev/null
+++ b/fer/mem/init_grid.F
@@ -0,0 +1,69 @@
+	SUBROUTINE INIT_GRID ( grid, name, init_ax )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize the definition of a grid with non-commital information
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V420 9/8/95 - for implicit grid creation
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations
+	CHARACTER*(*) name
+	INTEGER	grid, init_ax
+
+* internal variable declarations
+	INTEGER	idim
+
+	grid_name     ( grid )	= name
+	grid_rotation ( grid )	= 0.0
+
+	DO 100 idim = 1, nferdims
+	   grid_line    (idim, grid) = init_ax
+	   grid_out_prod(idim, grid) = .TRUE.
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/its_un_cached.F b/fer/mem/its_un_cached.F
new file mode 100644
index 0000000..09ad2a5
--- /dev/null
+++ b/fer/mem/its_un_cached.F
@@ -0,0 +1,73 @@
+	LOGICAL FUNCTION ITS_UN_CACHED( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if a particular memory variable is not cache retreivable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	mr
+
+* internal variable declarations:
+	INTEGER	mr_test
+
+* initialize linked list search
+	mr_test =  mv_flink( pmv_nocache_pile )
+
+* loop through the uncached vars to see if it is here
+ 100	IF ( mr_test .EQ. pmv_nocache_pile ) THEN
+	   ITS_UN_CACHED = .FALSE.
+	   RETURN
+	ELSEIF ( mr .EQ. mr_test ) THEN
+	   ITS_UN_CACHED = .TRUE.
+	   RETURN
+	ELSE
+	   mr_test = mv_flink(mr_test)
+	   GOTO 100
+	ENDIF
+	   
+	END
+
diff --git a/fer/mem/mgrid_size.F b/fer/mem/mgrid_size.F
new file mode 100644
index 0000000..3d82625
--- /dev/null
+++ b/fer/mem/mgrid_size.F
@@ -0,0 +1,66 @@
+	INTEGER FUNCTION MGRID_SIZE ( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of values in a 2D grid that lies within the plane
+* of the specified variable stored in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/24/86
+* revision 0.1 - 7/20/87 - kludge introduction of 1D grids for XY averages
+* V200:  5/18/89 - 4D symmetrical
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+	INTEGER	MR_DIM_LEN, mr
+
+        INTEGER k, mgsize
+
+        mgsize = MR_DIM_LEN(1, mr)
+        DO 10 k = 2, nferdims
+           mgsize = mgsize * MR_DIM_LEN(k, mr)
+ 10     CONTINUE
+        MGRID_SIZE = mgsize
+
+	RETURN
+	END
diff --git a/fer/mem/mgrid_size_delta.F b/fer/mem/mgrid_size_delta.F
new file mode 100644
index 0000000..cf864c0
--- /dev/null
+++ b/fer/mem/mgrid_size_delta.F
@@ -0,0 +1,72 @@
+	INTEGER FUNCTION MGRID_SIZE_DELTA ( mr )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of values in a grid *with strides*
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533 *sh* like MGRID_SIZE but sensitive to _delta
+* V560 *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations
+	INTEGER mr
+
+* internal variable declkarations
+	INTEGER	idim, size, delta
+
+* determine the delta product
+	size = 1
+	DO idim = 1, nferdims
+	  IF (mr_delta(idim,mr) .NE. unspecified_val8) THEN
+	    delta = NINT(mr_delta(idim,mr))
+	  ELSE
+	    delta = 1
+	  ENDIF
+	  size = size * 
+     .		((mr_hi_ss(mr,idim)-mr_lo_ss(mr,idim))/delta + 1)
+	ENDDO
+
+* the result
+	MGRID_SIZE_DELTA = size
+
+	RETURN
+	END
diff --git a/fer/mem/mr_available.F b/fer/mem/mr_available.F
new file mode 100644
index 0000000..5ad6b6d
--- /dev/null
+++ b/fer/mem/mr_available.F
@@ -0,0 +1,75 @@
+	SUBROUTINE MR_AVAILABLE ( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* flag that the specified variable is available to be used as a component and
+* to be deleted should memory space be tight
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/12/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER mr
+
+* internal variable declarations:
+	INTEGER last_head
+
+* set flag that it is available for use and for deletion
+	mr_protected( mr ) = mr_not_protected
+
+! temp diag
+	IF (mr_del_flink(mr) .NE. unspecified_int4) 
+     .		WRITE (6,*)' mr_avail_err'
+
+* insert the variable at the head of the deletion priority chain
+	last_head = mr_del_flink(0)
+	mr_del_blink(mr) = 0
+	mr_del_flink(mr) = last_head
+	mr_del_flink(0)  = mr
+	mr_del_blink(last_head) = mr
+
+	RETURN
+	END
+
diff --git a/fer/mem/mr_dim_len.F b/fer/mem/mr_dim_len.F
new file mode 100644
index 0000000..44bed32
--- /dev/null
+++ b/fer/mem/mr_dim_len.F
@@ -0,0 +1,59 @@
+	INTEGER FUNCTION MR_DIM_LEN ( idim, mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the no. of points along the indicated axis of a memory resident var.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/18/89 - 4D-symmetrical - transforms reflected in subscript limits
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	idim, mr
+
+	   MR_DIM_LEN = mr_hi_ss( mr, idim ) 
+     .		      - mr_lo_ss( mr, idim ) + 1
+
+	RETURN
+	END
diff --git a/fer/mem/mr_in_use.F b/fer/mem/mr_in_use.F
new file mode 100644
index 0000000..9afd213
--- /dev/null
+++ b/fer/mem/mr_in_use.F
@@ -0,0 +1,77 @@
+	SUBROUTINE MR_IN_USE ( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* flag that the specified variable is in use as a component of a calculation
+* and is therefore not available to be deleted
+* (multiple calculations can claim the same component by incrementing the
+* protection counter)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/12/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER mr
+
+* internal variable declarations:
+	INTEGER prev, next
+
+* remove it from the deletion chain if it is in there
+	IF ( mr_protected(mr) .EQ. mr_not_protected ) THEN
+	   prev = mr_del_blink(mr)
+	   next = mr_del_flink(mr)
+	   mr_del_flink(prev) = next
+	   mr_del_blink(next) = prev
+	   mr_del_flink(mr)   = unspecified_int4	! temp diag
+	   mr_del_blink(mr)   = unspecified_int4	! temp diag
+	ENDIF
+
+* bump claims counter
+	IF ( mr_protected(mr) .GE. mr_not_protected ) 
+     .		mr_protected(mr) = mr_protected(mr) + 1
+	   
+	RETURN
+	END
+
diff --git a/fer/mem/mr_not_in_use.F b/fer/mem/mr_not_in_use.F
new file mode 100644
index 0000000..f965541
--- /dev/null
+++ b/fer/mem/mr_not_in_use.F
@@ -0,0 +1,75 @@
+	SUBROUTINE MR_NOT_IN_USE ( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* release one claim of being required for calculations from variable mr
+* if this release leaves the variable unneeded for any calculations then return
+* it to the deletable variable chain
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/12/89
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER mr
+
+* internal variable declarations:
+	INTEGER last_head
+
+	IF ( mr_protected(mr) .GT. mr_not_protected )
+     .		mr_protected(mr) = mr_protected(mr) - 1
+
+
+* possibly insert the variable at the head of the deletion priority chain
+	IF ( mr_protected(mr) .EQ. mr_not_protected ) THEN
+	   last_head = mr_del_flink(0)
+	   mr_del_blink(mr) = 0
+	   mr_del_flink(mr) = last_head
+	   mr_del_flink(0)  = mr
+	   mr_del_blink(last_head) = mr
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/mem/mvar_num_dims.F b/fer/mem/mvar_num_dims.F
new file mode 100644
index 0000000..743f9fb
--- /dev/null
+++ b/fer/mem/mvar_num_dims.F
@@ -0,0 +1,66 @@
+	INTEGER FUNCTION MR_NUM_DIMS ( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the number of non-normal axes for this memory variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/11/87
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	mr
+
+* internal variable declarations
+	INTEGER	mr_DIM_LEN, idim, num
+
+	num = 0	
+	DO 100 idim = 1, nferdims
+	   IF ( mr_DIM_LEN ( idim, mr ) .GT. 1 ) num = num + 1
+ 100	CONTINUE
+
+	MR_NUM_DIMS = num
+
+	RETURN
+	END
diff --git a/fer/mem/new_mr_w_edges.F b/fer/mem/new_mr_w_edges.F
new file mode 100644
index 0000000..0fb11d8
--- /dev/null
+++ b/fer/mem/new_mr_w_edges.F
@@ -0,0 +1,76 @@
+	SUBROUTINE NEW_MR_W_EDGES(memory,cx_valid,cx_model,mr,status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* allocate and claim sufficient memory space, and assign and fill a slot in the 
+* memory variable table for the variable or expression indicated in the context
+* the region of valid data within the cx_model context is indicated by the
+* cx_valid context ... fill the invalid regions with bad data flags
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   8/3/89
+* V312: 5/94 - array "memory" as a calling argument
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_valid, cx_model, mr, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations
+	INTEGER MGRID_SIZE
+
+* create the memory variable
+	CALL CREATE_MEM_VAR( cx_model, mr, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+	IF ( mr_type(mr) .EQ. ptype_string ) THEN
+           CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mr),
+     .                               memory(1, mr_blk1(mr)),
+     .                               mr_c_pointer(mr)      )
+	ENDIF
+
+* fill edges
+	CALL BAD_EDGES( cx_valid, memory(1, mr_blk1(mr)), mr )
+
+	RETURN
+	END
diff --git a/fer/mem/purge_all_memory.F b/fer/mem/purge_all_memory.F
new file mode 100644
index 0000000..ece7a7e
--- /dev/null
+++ b/fer/mem/purge_all_memory.F
@@ -0,0 +1,64 @@
+	SUBROUTINE PURGE_ALL_MEMORY 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all cached memory variables
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* JLI: 7/18/06 - based on PURGE_DSET.F
+*                called by xeq_set.F for native strides 
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+
+* local variable declarations:
+	INTEGER mr
+
+* eliminate all cached memory variables
+	DO 100 mr = 1,max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+	   IF (mr_protected(mr) .NE. mr_perm_protected) 
+     .           CALL DELETE_VARIABLE( mr )
+ 100	CONTINUE
+
+	RETURN
+
+	END
diff --git a/fer/mem/purge_all_pystat_vars.F b/fer/mem/purge_all_pystat_vars.F
new file mode 100644
index 0000000..4e4a697
--- /dev/null
+++ b/fer/mem/purge_all_pystat_vars.F
@@ -0,0 +1,56 @@
+      SUBROUTINE PURGE_ALL_PYSTAT_VARS()
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all cat_pystat_var memory variables
+
+      INCLUDE 'ferret.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xvariables.cmn'
+
+* local variable declarations:
+      INTEGER mr
+
+      DO 100 mr = 1,max_mrs
+         IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+         IF ( mr_category ( mr ) .EQ. cat_pystat_var ) THEN
+            CALL DELETE_VARIABLE( mr )
+         ENDIF
+  100 CONTINUE
+
+      RETURN
+      END
+
diff --git a/fer/mem/purge_all_uvars.F b/fer/mem/purge_all_uvars.F
new file mode 100644
index 0000000..ad20e22
--- /dev/null
+++ b/fer/mem/purge_all_uvars.F
@@ -0,0 +1,92 @@
+	SUBROUTINE PURGE_ALL_UVARS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored user variables from memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V200:  6/29/89
+* Unix/RISC port - 11/91 - bug fix: re-initialization of uvars was not complete
+*                          for redetermination of grid
+
+* V420 - use new routine DEALLO_UVAR_GRIDS to both deallocate dynamic
+*	 grids associated with a uvar and clean out any memory-cached 
+*	 results that may depend on this grid
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* v690 *sh* also purge any file vars that depend upon uvars as aux vars 
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+
+* internal variable declarations:
+	INTEGER	uvar, i, j, num_indices
+
+*	DO 500 uvar = 1, max_uvar                      
+*	   IF ( uvar_num_items( uvar ) .EQ. uvar_deleted ) GOTO 500  
+        CALL deleted_list_get_undel(uvar_num_items_head, 
+     .                          deleted_list_result(1),
+     .                          max_uvar, num_indices )
+        DO 500 j = 1, num_indices
+           uvar = deleted_list_result(j)
+* eliminate all memory resident instances of this variable
+	   CALL PURGE_USER_VAR( uvar )
+
+* back to initial defaults (see INIT_UVAR)
+* (eliminate all grid information that may have been rendered incorrect)
+	   CALL DEALLO_UVAR_GRIDS(uvar)
+
+*       bug fix: 11/91 *************
+* must reset ALL of the state variables as set up in INIT_UVAR
+* by default assume the definition requires an external data set specification
+        uvar_need_dset( uvar ) = .TRUE.
+
+* by default assume that all limits are irrelevant
+        DO 320 i = 1, nferdims
+ 320           uvar_given(i,uvar) = uvlim_irrelevant
+* end of bug fix: 11/91 *************
+
+
+ 500	CONTINUE
+
+	CALL PURGE_AUX_VAR_DEPENDENTS
+
+	RETURN
+	END
diff --git a/fer/mem/purge_aux_var_dependents.F b/fer/mem/purge_aux_var_dependents.F
new file mode 100644
index 0000000..38d88ca
--- /dev/null
+++ b/fer/mem/purge_aux_var_dependents.F
@@ -0,0 +1,70 @@
+	SUBROUTINE PURGE_AUX_VAR_DEPENDENTS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored mrs whose values depend upon ref to an auxiliary var
+
+* V690: 1/14 *sh* 
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declaration:
+
+* internal variable declarations:
+	INTEGER	mr
+
+* ?? since this is called always following DELETE_ALL_UVARS 
+*    could this be made more efficient by calling deleted_list_get_undel
+*    and loopong only through file variables in memory?
+
+	DO mr = 1, max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) CYCLE
+	   IF ( mr_naux     ( mr ) .EQ. 0          ) CYCLE
+
+	   IF (  mr_protected( mr ) .NE. mr_not_protected
+     .	   .AND. mr_protected( mr ) .NE. mr_perm_protected )
+     .		STOP 'var prot err --> UVAR'
+
+	   CALL DELETE_VARIABLE( mr )
+
+	ENDDO
+
+	RETURN
+	END
+
diff --git a/fer/mem/purge_dset.F b/fer/mem/purge_dset.F
new file mode 100644
index 0000000..5fcfb8f
--- /dev/null
+++ b/fer/mem/purge_dset.F
@@ -0,0 +1,66 @@
+	SUBROUTINE PURGE_DSET ( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all memory variables with data from a particular data set
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/25/89 - extracted from ERASE_DSET
+*	12/18/89 - eliminated the possibility of multiple data set variables
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	dset
+
+* local variable declarations:
+	INTEGER mr
+
+* eliminate memory variables depending on this data set
+	DO 100 mr = 1,max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+	   IF ( dset .EQ. mr_data_set(mr) ) CALL DELETE_VARIABLE( mr )
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/purge_file_var.F b/fer/mem/purge_file_var.F
new file mode 100644
index 0000000..295d6d5
--- /dev/null
+++ b/fer/mem/purge_file_var.F
@@ -0,0 +1,72 @@
+	SUBROUTINE PURGE_FILE_VAR( fvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored mrs for the given file variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/23/89 - based on PURGE_USER_V*
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declaration:
+	INTEGER	fvar
+
+* internal variable declarations:
+	INTEGER	mr
+
+	DO 100 mr = 1, max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+	   IF ( mr_variable ( mr ) .NE. fvar
+     .	   .OR. mr_category ( mr ) .NE. cat_file_var ) GOTO 100
+
+	   IF (  mr_protected( mr ) .NE. mr_not_protected
+     .	   .AND. mr_protected( mr ) .NE. mr_perm_protected )
+     .		STOP 'var prot err --> FVAR'
+
+	   CALL DELETE_VARIABLE( mr )
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/mem/purge_mr_axis.F b/fer/mem/purge_mr_axis.F
new file mode 100644
index 0000000..69ac464
--- /dev/null
+++ b/fer/mem/purge_mr_axis.F
@@ -0,0 +1,130 @@
+	SUBROUTINE PURGE_MR_AXIS( old_axis, new_axis, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored mrs that use a given axis
+* and replace all references within grids to the old axis with the new axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/4/89 - from PURGE_USER_VAR
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V450: 11/14/97 - check dynamic grids as well as static grids
+*		(err450_redefine_axis_in_dyn_grid.jnl)
+* V510 4/00 *sh* - netCDF data sets using dynamic grids, too
+* V541 6/02 *acm*  call PACK_LINE_STORAGE to recover line_mem storage when irregular
+*                  axis is cancelled.
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declaration:
+	INTEGER	old_axis, new_axis, status
+
+* internal variable declarations:
+	INTEGER	TM_GET_LINENUM, grid, idim, num_protected_axes
+	CHARACTER	I6*6
+
+* the lowest axes are protected
+	num_protected_axes = TM_GET_LINENUM( 'EZ' )  ! top protected axis
+	IF ( old_axis .LE. num_protected_axes ) GOTO 5200
+
+* only regular axes may be re-defined
+* (to avoid dealing with messy memory pointers)
+!	IF ( .NOT. line_regular( old_axis ) ) GOTO 5100
+
+* delete all variables in memory that are based on grids using this axis
+	DO 100 grid = 1, max_dyn_grids
+	  IF (grid_name(grid) .EQ. char_init16) GOTO 100
+
+	  DO 50 idim = 1, nferdims
+	     IF ( grid_line(idim,grid) .EQ. old_axis ) THEN
+	         CALL PURGE_MR_GRID( grid, status ) 
+	         IF ( status .NE. ferr_ok ) RETURN
+	         GOTO 100
+	     ENDIF
+ 50	  CONTINUE
+
+ 100	CONTINUE
+
+* now we are safe from errors: replace the old axis with the new one
+* 4/00: - check among dynamic grids, too -- though there would at present never
+*	be a replacement of one of these axes
+	DO 250 grid = 1, max_dyn_grids
+	  IF (grid_name(grid) .EQ. char_init16) GOTO 250
+
+	  DO 200 idim = 1, nferdims
+	     IF ( grid_line(idim,grid) .EQ. old_axis ) THEN
+	         grid_line(idim,grid) = new_axis
+	     ENDIF
+ 200	  CONTINUE
+
+ 250	CONTINUE
+	line_use_cnt(new_axis) = line_use_cnt(old_axis)
+
+* delete the old axis
+	IF ( .NOT.line_regular(old_axis) ) THEN
+           CALL PACK_LINE_STORAGE(old_axis)
+c	   WRITE ( I6,'(I6)' ) line_dim(old_axis)
+c	   CALL WARN( I6//' words of axis coordinate storage lost' )
+c	   line_subsc1( old_axis ) = unspecified_int4
+	ENDIF
+	line_use_cnt(old_axis) = 0
+	line_name( old_axis ) = char_init16
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+! 5100	CALL ERRMSG( ferr_grid_definition, status,
+!     .		'cannot delete axes with irregular points: '
+!     .		//line_name(old_axis),
+!     .		*5000 )
+ 5200	CALL ERRMSG( ferr_grid_definition, status,
+     .		'protected axis: '//line_name(old_axis), *5000 )
+	END
+
diff --git a/fer/mem/purge_mr_grid.F b/fer/mem/purge_mr_grid.F
new file mode 100644
index 0000000..f99a03f
--- /dev/null
+++ b/fer/mem/purge_mr_grid.F
@@ -0,0 +1,143 @@
+	SUBROUTINE PURGE_MR_GRID( grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored mrs on the given grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/4/89
+*	12/6/89 - purge mgrid_abstract_last, too
+* Unix/RISC port - 4/25/91 *sh*: longer ds_name
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V500 *sh* 7/99 - issue warning, only, if grid is in-use in a data set
+* V510: 5/00 *sh* - BUG fix: special grids exceed "6"
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_errors.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xfr_grid.cmn'
+	include 'xvariables.cmn'
+	include 'xcalc_vars.cmn'
+        include 'xpyvar_info.cmn'
+
+* calling argument declaration:
+	INTEGER	grid, status
+
+* internal variable declarations:
+	INTEGER	mr, ivar, dset, glen, done_dset
+!	INTEGER	TM_LENSTR1, mr, ivar, cvar, dset, glen, done_dset
+
+* the lowest grids are protected
+	IF ( grid .LE. mgrid_tabstract ) GOTO 5200
+
+* initialize
+	done_dset = 0
+
+* make sure grid is not used by any file variables
+	DO 10 ivar = 1, maxvars
+	   dset = ds_var_setnum( ivar )
+	   IF ( dset .EQ. set_not_open ) GOTO 10
+	   IF ( ds_grid_number(ivar) .EQ. grid
+     .	  .AND. dset .NE. done_dset ) THEN
+	      CALL WARN('grid '//grid_name(grid)(:glen)//
+     .		' used by data set '//ds_name(dset))
+	      CALL WARN
+     .		('Redefinition may alter apparent contents of data set')
+	      CALL PURGE_DSET(dset)
+	      done_dset = dset
+	   ENDIF
+ 10	CONTINUE
+
+* make sure it is not implicitly used by a cvar that depends on file variables
+* NOTE: cvars are irrelevant as of V500 ...
+!	DO 25 dset = 1, maxdsets
+!	   IF ( ds_name(dset) .EQ. char_init1024) GOTO 25
+!	   DO 20 cvar = 1, num_calc_vars
+! 20	   IF ( cvar_grid(cvar,dset) .EQ. grid ) GOTO 5100
+! 25	CONTINUE
+
+* make sure grid is not used by any pystat variables
+        DO 30 ivar = 1, maxpyvars
+           IF ( pyvar_ndarray_obj(ivar) .EQ. 0 ) GOTO 30
+           IF ( pyvar_grid_number(ivar) .EQ. grid ) THEN
+              CALL WARN('grid ' // grid_name(grid)(:glen) //
+     .            ' used by python data variable ' // pyvar_code(ivar))
+              CALL WARN(
+     .      'Redefinition may alter apparent contents of the variable')
+              CALL PURGE_PYSTAT_VAR(ivar)
+           ENDIF
+ 30     CONTINUE
+
+* the coast is clear
+* ...clear out the memory variables
+	DO 100 mr = 1, max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+	   IF ( mr_grid ( mr )     .NE. grid	   ) GOTO 100
+	   CALL DELETE_VARIABLE( mr )
+ 100	CONTINUE
+
+* and wipe out all user-defined variables (they may depend on it indirectly)
+	CALL PURGE_ALL_UVARS
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+! 5100	glen = TM_LENSTR1( grid_name( grid ) )
+!	CALL ERRMSG( ferr_grid_definition, status,
+!     .		'grid '//grid_name(grid)(:glen)//' used by data set '
+!     .		//ds_name(dset), *5000 )
+ 5200	CALL ERRMSG( ferr_grid_definition, status,
+     .		'protected grid: '//grid_name(grid), *5000 )
+	END
+
diff --git a/fer/mem/purge_pystat_dset_vars.F b/fer/mem/purge_pystat_dset_vars.F
new file mode 100644
index 0000000..8689c89
--- /dev/null
+++ b/fer/mem/purge_pystat_dset_vars.F
@@ -0,0 +1,59 @@
+      SUBROUTINE PURGE_PYSTAT_DSET_VARS( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all memory pystat variables associated with the given dataset
+
+      INCLUDE 'ferret.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xvariables.cmn'
+
+* calling argument declarations:
+      INTEGER dset
+
+* local variable declarations:
+      INTEGER mr
+
+* eliminate cat_pystat_var memory variables depending on this data set
+      DO 100 mr = 1,max_mrs
+         IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+         IF ( mr_category ( mr ) .NE. cat_pystat_var ) GOTO 100
+         IF ( dset .EQ. mr_data_set(mr) ) CALL DELETE_VARIABLE( mr )
+ 100  CONTINUE
+
+      RETURN
+      END
+
diff --git a/fer/mem/purge_pystat_var.F b/fer/mem/purge_pystat_var.F
new file mode 100644
index 0000000..e1b8f02
--- /dev/null
+++ b/fer/mem/purge_pystat_var.F
@@ -0,0 +1,61 @@
+      SUBROUTINE PURGE_PYSTAT_VAR( pyvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* eliminate all stored mrs for the given cat_pystat_var variable
+
+      INCLUDE 'ferret.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xvariables.cmn'
+
+* calling argument declaration:
+      INTEGER pyvar
+
+* internal variable declarations:
+      INTEGER mr
+
+      DO 100 mr = 1, max_mrs
+         IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+         IF ( mr_category ( mr ) .NE. cat_pystat_var ) GOTO 100
+         IF ( mr_variable ( mr ) .NE. pyvar ) GOTO 100
+         IF ( (mr_protected( mr ) .NE. mr_not_protected) .AND.
+     .        (mr_protected( mr ) .NE. mr_perm_protected) )
+     .                                    STOP 'var prot err --> PYVAR'
+         CALL DELETE_VARIABLE( mr )
+  100 CONTINUE
+
+      RETURN
+      END
+
diff --git a/fer/mem/purge_user_var.F b/fer/mem/purge_user_var.F
new file mode 100644
index 0000000..90f34e6
--- /dev/null
+++ b/fer/mem/purge_user_var.F
@@ -0,0 +1,75 @@
+	SUBROUTINE PURGE_USER_VAR( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate all stored mrs for the given user defined variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/23/87
+* revision 0.1 - 9/30/87 - added mr_perm_prot
+* V200:  6/9/89 - deleted variables flagged in mr_protected
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declaration:
+	INTEGER	uvar
+
+* internal variable declarations:
+	INTEGER	mr
+
+	DO 100 mr = 1, max_mrs
+	   IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 100
+	   IF ( mr_variable ( mr ) .NE. uvar
+     .	   .OR. mr_category ( mr ) .NE. cat_user_var ) GOTO 100
+
+	   IF (  mr_protected( mr ) .NE. mr_not_protected
+     .	   .AND. mr_protected( mr ) .NE. mr_perm_protected )
+     .		STOP 'var prot err --> UVAR'
+
+	   CALL DELETE_VARIABLE( mr )
+
+ 100	CONTINUE
+
+	RETURN
+	END
+
diff --git a/fer/mem/re_assign_variable.F b/fer/mem/re_assign_variable.F
new file mode 100644
index 0000000..7f4a3d3
--- /dev/null
+++ b/fer/mem/re_assign_variable.F
@@ -0,0 +1,85 @@
+	SUBROUTINE RE_ASSIGN_VARIABLE( mr, new_cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* re-assign the data which is currently cataloged in the memory variable
+* table under mr to the context information stored in new_cx
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+* V200:  6/20/89 - improved deletion priority scheme
+*		 - variable is assumed NOT to be in deletion chain
+*		 - use ASSIGN_MR_CX
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER mr, new_cx
+
+* internal variable declarations:
+	INTEGER HASH_CX, prev, next, pile, head
+
+* flag the variable as "in progress"
+	mr_protected(mr) = mr_in_progress
+
+* make this mem var the property of the new context
+	CALL ASSIGN_MR_CX( new_cx, mr )
+
+* correct the links to put this in the right hash pile
+*    ... remove variable slot from hash pile doubly linked list
+	   prev = mv_blink( mr )
+	   next = mv_flink( mr )
+	   mv_flink( prev ) = next
+	   mv_blink( next ) = prev
+*    ... add the slot to the head of the correct hash pile
+	   pile = HASH_CX( new_cx )
+	   head = mv_flink( pile )
+	   mv_flink( pile ) = mr
+	   mv_flink( mr ) = head
+	   mv_blink( mr ) = pile
+	   mv_blink( head ) = mr
+
+	RETURN
+	END
diff --git a/fer/mem/release_work_spc.F b/fer/mem/release_work_spc.F
new file mode 100644
index 0000000..b55cc7b
--- /dev/null
+++ b/fer/mem/release_work_spc.F
@@ -0,0 +1,55 @@
+	SUBROUTINE RELEASE_WORK_SPC
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* releases claim to temporary work space allocated by GET_WORK_SPC
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+
+        IMPLICIT NONE
+	include 'xwork_space.cmn'
+
+	IF ( sp_last_size .GT. 0 ) THEN
+	   CALL FREE_MEMORY( sp_start_block, sp_num_blocks )
+	   sp_last_size = 0
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/mem/un_cache.F b/fer/mem/un_cache.F
new file mode 100644
index 0000000..898dd81
--- /dev/null
+++ b/fer/mem/un_cache.F
@@ -0,0 +1,75 @@
+	SUBROUTINE UN_CACHE( mr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* flag a memory variable as not cache-retreivable
+* do this by shifting the variable to a "hash pile" which is not searched
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	mr
+
+* internal variable declarations:
+	INTEGER	prev, next, pile, head
+
+* remove variable slot from hash pile doubly linked list
+	prev = mv_blink( mr )
+	next = mv_flink( mr )
+	mv_flink( prev ) = next
+	mv_blink( next ) = prev
+
+* add the memory variable to the head of the non-retreivable hash pile
+	pile = pmv_nocache_pile
+	head = mv_flink( pile )
+	mv_flink( pile ) = mr
+	mv_flink( mr ) = head
+	mv_blink( mr ) = pile
+	mv_blink( head ) = mr
+
+	RETURN
+	END
+
+
diff --git a/fer/mem/unprotect_all_mrs.F b/fer/mem/unprotect_all_mrs.F
new file mode 100644
index 0000000..6ea71b9
--- /dev/null
+++ b/fer/mem/unprotect_all_mrs.F
@@ -0,0 +1,64 @@
+	SUBROUTINE UNPROTECT_ALL_MRS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* eliminate deletion protections from all memory-resident grids
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/25/87
+* revision 0.1 - 9/30/87 - added mr_perm_prot
+* V200:  6/9/89 - deleted variables flagged in mr_protected
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include		'ferret.parm'
+	include 	'xvariables.cmn'
+
+* internal variable declarations:
+	INTEGER	mr
+
+	DO 100 mr = 1, max_mrs
+	   IF (mr_protected(mr) .GT. mr_not_protected) 
+     .               CALL MR_AVAILABLE( mr )
+ 100	CONTINUE
+
+	RETURN
+	END
+
diff --git a/fer/mem/uvar_number.F b/fer/mem/uvar_number.F
new file mode 100644
index 0000000..077eb70
--- /dev/null
+++ b/fer/mem/uvar_number.F
@@ -0,0 +1,87 @@
+	INTEGER FUNCTION UVAR_NUMBER( name_code )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the number of the given user-defined variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+* revision 0.1 - 8/29/87 - added vms_str_success
+* Ultrix/RISC port - 2/91 - removed VMS runtime library reference
+*			    (STR_CASE_BLIND_COMPARE is in the TMAP library)
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	name_code
+
+* internal variable declarations:
+	INTEGER uvar, j, num_indices
+
+
+* locate the requested variable in the uvar variables
+*	DO 100 uvar = 1, max_uvar
+*	   vax_code = STR_CASE_BLIND_COMPARE( name_code, 
+*     .                       uvar_name_code(uvar) )
+*	   IF ( vax_code .EQ. vms_str_success
+*     .	  .AND. uvar_num_items( uvar ) .NE. uvar_deleted ) THEN
+        CALL string_array_find_caseblind(uvar_name_code_head,
+     .                                   name_code,
+     .                                   LEN(name_code),
+     .                                   string_array_result(1),
+     .                                   max_uvar,
+     .                                   num_indices)
+        DO 100 j = 1, num_indices
+           uvar = string_array_result(j)
+           IF(uvar_num_items(uvar) .NE. uvar_deleted) THEN
+	      UVAR_NUMBER = uvar
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* not found
+	UVAR_NUMBER = unspecified_int4
+	RETURN
+	END
diff --git a/fer/mem/var_code.F b/fer/mem/var_code.F
new file mode 100644
index 0000000..648319a
--- /dev/null
+++ b/fer/mem/var_code.F
@@ -0,0 +1,128 @@
+	CHARACTER*(*) FUNCTION VAR_CODE ( category, variable )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return name code for variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/4/86
+* revision 1.0 - 1/6/87 - cat_expr and cat_temp changed
+* revision 1.1 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 2.0 - 3/10/88 - removed cat_expr_var, added cat_named_var,
+*			   changed cat_user_var formatting to use HASH_NAME
+* V200:  6/20/89 - eliminated "named" variables
+*       11/30/89 - process pseudo-variables, too
+*	 12/4/89 - moved hashing of expression to SANITARY_VAR_CODE
+* V320:  2/22/95 - added support for reverse-axis variables: cat_file_rev
+* V500: 12/98 *sh* - added cat_const_var ... of the form "{1,3,5}"
+*	 1/99 *sh8 ... and cat_string
+*        2/12 *kms* Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xalgebra.cmn'
+	include	'xpyvar_info.cmn'
+
+* calling argument declarations:
+	INTEGER category, variable
+
+* internal variable declarations
+	INTEGER 	uvar, item, start, end
+
+	IF     ( category .EQ. cat_file_var 
+     . .OR.	 category .EQ. cat_file_rev 
+     . .OR.	 category .EQ. cat_aggregate_var ) THEN
+
+	   VAR_CODE = ds_var_code( variable )
+
+        ELSEIF ( category .EQ. cat_pystat_var ) THEN
+
+           VAR_CODE = pyvar_code( variable )
+
+	ELSEIF ( category .EQ. cat_calc_var ) THEN
+
+	   VAR_CODE = cvar_name_code( variable )
+
+	ELSEIF ( category .EQ. cat_user_var ) THEN
+
+	   VAR_CODE = uvar_name_code(variable)
+
+	ELSEIF ( category .EQ. cat_dummy_var ) THEN
+
+	   VAR_CODE = 'dumm'
+
+	ELSEIF ( category .EQ. cat_temp_var ) THEN
+
+	   VAR_CODE = 'tpry'
+
+	ELSEIF ( category .EQ. cat_pseudo_var ) THEN
+
+	   VAR_CODE = alg_pvar( variable )
+
+	ELSEIF ( category .EQ. cat_const_var ) THEN
+
+	   uvar = variable/1000
+           item = variable - 1000*uvar
+           start = uvar_item_start( item, uvar )
+           end   = uvar_item_end  ( item, uvar )
+	   VAR_CODE = uvar_text(uvar)(start:end)
+
+	ELSEIF ( category .EQ. cat_constant ) THEN
+
+	   VAR_CODE = 'cnst'
+
+	ELSEIF ( category .EQ. cat_string ) THEN
+
+	   VAR_CODE = 'str'
+
+	ELSE
+
+	   VAR_CODE = 'bad*'
+
+	ENDIF
+
+ 3000	FORMAT(A1,I3.3)
+	RETURN
+	END
diff --git a/fer/ocn/LIB_NAME b/fer/ocn/LIB_NAME
new file mode 100644
index 0000000..cd354b4
--- /dev/null
+++ b/fer/ocn/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libocn.a 
diff --git a/fer/ocn/Makefile b/fer/ocn/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/ocn/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/ocn/SOURCE_FILES b/fer/ocn/SOURCE_FILES
new file mode 100644
index 0000000..47c9078
--- /dev/null
+++ b/fer/ocn/SOURCE_FILES
@@ -0,0 +1,34 @@
+SRCS_F = \
+air_temp.F\
+calc_cvar.F\
+cmesh.F\
+conv_adj_mask.F\
+cvar_context.F\
+ew_hadvec.F\
+expl_coriolis.F\
+fuw.F\
+fvn.F\
+gfdl_terms.F\
+grad_p_clinic.F\
+hflux.F\
+hourly_data.F\
+hradiation.F\
+knudsen.F\
+mesh.F\
+prof.F\
+sn_hadvec.F\
+state.F\
+u_from_psi.F\
+vel_adv_ew.F\
+vel_adv_ns.F\
+vel_adv_z.F\
+vel_by_grad_p.F\
+vel_by_wind.F\
+vel_dif_xy.F\
+vel_dif_z.F\
+w_on_ts.F\
+w_on_uv.F\
+wind_stress.F\
+xy_hdiffus.F\
+z_hadvec.F\
+z_hdiffus.F 
diff --git a/fer/ocn/air_temp.F b/fer/ocn/air_temp.F
new file mode 100644
index 0000000..d959687
--- /dev/null
+++ b/fer/ocn/air_temp.F
@@ -0,0 +1,132 @@
+      SUBROUTINE AIR_TEMP ( sst, msst, cair, mcair, air, mair )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute air temperature: either climatological field (unmodified)
+*			   or SST-const south of j=91 and climatol. to the north
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/12/88
+* revision 0.1 - 7/2/88  - allow multiple air temp climatologies
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations
+
+#ifdef unix
+	include 'ferret.parm'
+	include 'tmap_dims.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xdset_parms.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XDSET_PARMS.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mair, msst, mcair
+	REAL     sst( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		cair( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit ),
+     .		 air( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, l, dset
+	REAL	bad_cair, bad_air, bad_sst, dairt
+
+* --- end of introductory code ---
+* initialize
+	dset    = mr_data_set( mair )
+
+* limits for calculation
+	i_lo = mr_lo_s1(mair)
+	i_hi = mr_hi_s1(mair)
+	j_lo = mr_lo_s2(mair)
+	j_hi = mr_hi_s2(mair)
+
+* flag for bad/missing data
+	bad_cair  = mr_bad_data( mcair )
+	bad_air   = mr_bad_data( mair )
+	bad_sst   = mr_bad_data( msst )
+
+* constant air/sst temperature difference
+	dairt = dp_delta_air_sst( dset )
+
+
+	IF ( .NOT.dp_const_air_sst(dset) ) THEN
+
+* climatological air temp
+	   DO 100 l = mr_lo_s4(mair), mr_hi_s4(mair)
+	   DO 100 j = j_lo, j_hi
+	   DO 100 i = i_lo, i_hi
+
+	      IF ( cair(i,j,l) .EQ. bad_cair ) THEN
+	         air(i,j,l) = bad_air
+	      ELSE
+	         air(i,j,l) = cair(i,j,l)
+	      ENDIF
+
+ 100	   CONTINUE
+
+	ELSE
+* constant air-sst difference in south, climatology in north
+	   DO 200 l = mr_lo_s4(mair), mr_hi_s4(mair)
+	   DO 200 j = j_lo, j_hi
+	   DO 200 i = i_lo, i_hi
+
+	      IF ( j .LT. 91 ) THEN
+	         IF ( sst(i,j,1,l) .EQ. bad_sst ) THEN
+	            air(i,j,l) = bad_air
+	         ELSE
+	            air(i,j,l) = sst(i,j,1,l) - dairt
+	         ENDIF
+	      ELSE
+	         IF ( cair(i,j,l) .EQ. bad_cair ) THEN
+	            air(i,j,l) = bad_air
+	         ELSE
+	            air(i,j,l) = cair(i,j,l)
+	         ENDIF
+	      ENDIF
+
+ 200	   CONTINUE
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/ocn/calc_cvar.F b/fer/ocn/calc_cvar.F
new file mode 100644
index 0000000..a6bfb1e
--- /dev/null
+++ b/fer/ocn/calc_cvar.F
@@ -0,0 +1,746 @@
+	SUBROUTINE CALC_CVAR( memory, cx, mrl, mres, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* calculate one or more variables based on the components supplied
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/24/89 - based on CALC_XYGRID
+*	10/16/89 - adjustable array dimensioning via NON_ARRAY_SUBSC
+*	 2/27/90 - added v2.0 CAIR
+*		 - and made it able to handle unspecified result region limits
+*	 3/13/90 - fixed subsc. err. in QAD (et.al.) with unspec lims
+*	 5/15/90 - special unknown subscript checks for AIR components
+* V312: 5/94 - array "memory" as a calling argument
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V685 *acm*  6/13 Increase nominal length of abstract axis
+
+* calling arguments:
+* inp	cx	- "context" of the desired result (variable,data set and region)
+* inp	mrl	- list of memory variable numbers for the 
+*			  component variables of the calculation
+* out	mres	- memory variable number of requested result
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'instance_table.parm'
+	include	'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+#else
+	INCLUDE	'FERRET_CMN:FERRET.PARM'
+	INCLUDE	'FERRET_CMN:ERRMSG.PARM'
+	INCLUDE	'FERRET_CMN:INSTANCE_TABLE.PARM'
+	INCLUDE	'FERRET_CMN:GFDL.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XCALC_VARS.CMN'
+	INCLUDE	'FERRET_CMN:XPROG_STATE.CMN'
+	INCLUDE	'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+	INTEGER		max_components
+	PARAMETER     ( max_components = 20 )
+
+* calling argument declarations:
+	INTEGER		cx, mrl( max_components ), mres, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL		HOURLY_DATA, chg(4), unk(4), reg, two_results
+	INTEGER		CGRID_SIZE, MGRID_SIZE, CGRID_AXIS, MR_DIM_LEN,
+     .			nmr, mxtra, cx_xtra, cx_lrg, grid_size, temp_grid_size,
+     .			var, ncomp, icomp, iend, k, i, idim, mr, fp, grid,
+     .			temp_start_blk, temp_nblks, dlo, dhi,
+     .			loest_ss, hiest_ss, res_ss_lo(4), res_ss_hi(4)
+	REAL		dt
+	REAL*8		TM_WORLD
+
+* for diagnostic output:
+	CHARACTER*4	VAR_CODE
+	CHARACTER*132	diag_buff
+	DATA		diag_buff(1:9) / '-->using:' /
+
+* remove special codes from variable to compute
+	var = cx_variable( cx )
+	IF ( var .GT. pcv_spec_flg ) var = var - pcv_spec_flg
+	cx_variable( cx ) = var
+
+* initialize some stuff
+	two_results = cvar_num_results( var ) .GT. 1	! only 2 or 1 allowed
+	ncomp  = cvar_frame_length( var )
+	grid   = cx_grid( cx )
+	DO 1 idim = 1, 4
+	res_ss_lo(idim) = 0
+	res_ss_hi(idim) = 9999999
+	unk( idim ) = .FALSE.
+ 1	chg( idim ) = .FALSE.
+
+* diagnostic output ?
+	IF ( mode_diagnostic ) THEN
+	   diag_buff = '--> '//VAR_CODE( cat_calc_var, var )//' from: '
+	   iend = 15
+	   DO 2 icomp = 1, cvar_frame_length( var )
+	      iend = iend + 5
+	      mr = mrl( icomp )
+	      WRITE ( diag_buff( iend-4:iend ), '(1X,A)' )
+     .			VAR_CODE(  mr_category(mr),mr_variable(mr) )
+ 2	   CONTINUE
+	   CALL SPLIT_LIST( pttmode_ops, ttout_lun, diag_buff, iend )
+	ENDIF
+
+* shrink requested dimensions to match smallest available component
+	fp = cvar_frame_start (var)		! frame pointer
+	DO 6 icomp = 1, ncomp
+	   fp = fp + 1
+	   mr = mrl( icomp )
+	   IF ( mr .EQ. dummy_mr ) GOTO 6
+	   DO 4 idim = 1, 4
+	      IF ( CGRID_AXIS( idim, cx ) .EQ. mnormal ) GOTO 4
+	      IF ( mr_lo_ss( mr, idim ) .EQ. unspecified_int4 ) GOTO 4
+	      CALL GRID_SUBSCRIPT_EXTREMES ( loest_ss, hiest_ss, grid, idim )
+	      dlo = cv_lo_ds(fp,idim)
+	      dhi = cv_hi_ds(fp,idim)
+	      IF ( idim.EQ.T_dim .AND. dlo.GT.pcv_hourly_flg ) THEN
+	         dlo = 0
+	         dhi = 0
+	         IF ( HOURLY_DATA( grid ) ) dlo = -1
+	      ENDIF
+* ... 5/90: air temp is special because it sometimes uses regridded CAIR
+* ... if it gets here with t_dim unspecified in the SST component
+* ... it must be a non-regridded case (note: mr(cair)-->dummy in this case)
+	      IF ( var .EQ. pair ) THEN
+	         IF ( idim .EQ. t_dim ) THEN
+	            IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) THEN
+	               res_ss_lo(idim) = mr_lo_ss(mr,idim)
+	               res_ss_hi(idim) = mr_hi_ss(mr,idim)
+	               chg( idim ) = .TRUE.
+	               unk( idim ) = .TRUE.
+	               GOTO 4
+	            ENDIF
+	         ENDIF
+	      ENDIF
+* ... fill in unspecified limits (2/90) - fixed QAD error 3/90
+	      IF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) THEN
+	         res_ss_lo(idim) = MAX( res_ss_lo(idim),
+     .					mr_lo_ss(mr,idim) - dlo )
+	         res_ss_hi(idim) = MIN( res_ss_hi(idim),
+     .					mr_hi_ss(mr,idim) - dhi )
+	         chg( idim ) = .TRUE.
+	         unk( idim ) = .TRUE.
+	         GOTO 4
+	      ENDIF
+* ... trim limits to available source data
+	      IF ( cx_lo_ss(cx,idim) .NE. loest_ss
+     .	     .AND. cx_lo_ss(cx,idim)+dlo .LT. mr_lo_ss(mr,idim) ) THEN
+	         cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim) - dlo
+	         chg( idim ) = .TRUE.
+	      ENDIF
+	      IF ( cx_hi_ss(cx,idim) .NE. hiest_ss
+     .	     .AND. cx_hi_ss(cx,idim)+dhi .GT. mr_hi_ss(mr,idim) ) THEN
+	         cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim) - dhi
+	         chg( idim ) = .TRUE.
+	      ENDIF
+ 4	   CONTINUE
+ 6	CONTINUE
+	DO 8 idim = 1, 4
+	   IF ( unk(idim) ) THEN
+* ... fill unspecified result limits with the amount of component available
+	      cx_lo_ss(cx,idim) = res_ss_lo(idim)
+	      cx_hi_ss(cx,idim) = res_ss_hi(idim)
+	   ENDIF
+	   IF ( chg(idim) ) THEN
+	      cx_by_ss(idim,cx) = .TRUE.
+	      CALL CONFINE_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      CALL FLESH_OUT_AXIS( idim, cx, status )	
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+ 8	CONTINUE
+
+* create another context in case result must be larger that requested size
+* (for example baroclinic pressure must always be computed from Z=0 even if
+*  it is requested only at depth)
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	cx_lrg = cx_stack_ptr
+	CALL TRANSFER_CONTEXT( cx, cx_lrg )
+
+* Z range to start at K=1 for components of baroclinic pres. and W
+	IF ( var.EQ.pdpdx  .OR. var.EQ.pdpdy
+     .	.OR. var.EQ.pw_u   .OR. var.EQ.pw_t  ) THEN
+	   DO 9 icomp = 1, ncomp
+	      mr = mrl( icomp )
+	      IF ( mr_lo_ss( mr, z_dim ) .EQ. unspecified_int4 ) GOTO 9
+	      IF ( mr_lo_ss( mr, z_dim ) .NE. 1 ) CALL ERRMSG
+     .		( ferr_out_of_range, status,
+     .		'baroclinic pressure requires surface data', *5000 )
+ 9	   CONTINUE
+* ... result will go to k=1, also
+	   cx_lo_ss( cx_lrg, z_dim ) = 1
+	   cx_lo_ww(z_dim, cx_lrg) = TM_WORLD( 1, cx_grid(cx_lrg),
+     .					       z_dim, box_lo_lim )
+	ENDIF
+	grid_size = CGRID_SIZE( cx_lrg )
+
+* reserve memory space for result
+	CALL CREATE_MEM_VAR( cx_lrg, mres, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	nmr = ncomp + 1
+	IF ( isp+nmr .GT. max_intrp ) CALL ERRMSG
+     .				( ferr_stack_ovfl, status, ' ',*5200 )
+	mrl(nmr) = mres	! put it in the list fot NON_ARRAY_SUBSC
+
+* create another context in case 2 results are computed at once
+	IF ( two_results ) THEN
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   cx_xtra = cx_stack_ptr
+	   CALL TRANSFER_CONTEXT( cx_lrg, cx_xtra )
+	   CALL CREATE_MEM_VAR( cx_xtra, mxtra, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   nmr = nmr + 1
+	   IF ( isp+nmr .GT. max_intrp ) CALL ERRMSG
+     .				( ferr_stack_ovfl, status, ' ',*5100 )
+	   mrl(nmr) = mxtra	! put it in the list fot NON_ARRAY_SUBSC
+	ENDIF
+
+* extract all the necessary dimensions to unsubscripted variables
+	CALL NON_ARRAY_SUBSC( mrl, nmr )
+
+* see BLOCK DATA XVARIABLES_DATA for lists of components in each calculation
+	GOTO (	 10, 20, 30, 40, 50, 60, 70, 80, 90,100,
+     .		110,120,130,140,150,160,170,180,190,200,
+     .		210,220,230,240,250,260,270,280,290,300,
+     .		310,320,330,340,350,360,370,380,390,400,
+     .		410,420,430,440,450,460,470,480,490,500,
+     .		510,520,530,540,550,560,570,580,590		 ) var
+
+* QCDZ - vertical heat diffussion coefficient
+* ... also computes and stores PCDZ ...
+ 10	cx_variable( cx_xtra ) = ppcdz
+	cx_grid( cx_xtra ) = cvar_grid( ppcdz, cx_data_set(cx) )
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL PROF (
+     .		km					, ! k max
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! rho0
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	, ! pcdz
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qcdz
+	GOTO 1900
+
+* PCDZ - vertical momentum diffussion coefficient
+* ... also computes and stores QCDZ ...
+ 20	cx_variable( cx_xtra ) = pqcdz
+	cx_grid( cx_xtra ) = cvar_grid( pqcdz, cx_data_set(cx) )
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL PROF (
+     .		km					, ! k max
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! rho0
+     .		memory( 1, mr_blk1( mres   ) ), mres	, ! pcdz
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	) ! qcdz
+	GOTO 1900
+
+* RHO0 - density referenced to surface ( compression effects neglected )
+ 30	CALL STATED (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	,	  ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, 	  ! salt
+     .		memory( 1, mr_blk1( mres   ) )	, mres		) ! rho0
+	GOTO 2000
+
+* QDFZ - vertical heat diffussion
+ 40	CALL Z_HDIFFUS (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! qvdc
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! qflx
+     .		memory( 1, mr_blk1( mres   ) )	, mres	) ! qdfz
+	GOTO 2000
+
+* QDFH - horizontal heat diffussion
+ 50	CALL XY_HDIFFUS (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qdfh
+	GOTO 2000
+
+* QADX - zonal heat advection
+ 60	CALL EW_HADVEC (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! u   
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qadx
+	GOTO 2000
+
+* QADY - meridianal heat advection
+ 70	CALL SN_HADVEC (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v   
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qady
+	GOTO 2000
+
+* QADZ - vertical heat advection
+ 80	CALL Z_HADVEC (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! w   
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qadz
+	GOTO 2000
+
+* QAD  - total heat advection
+ 90	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! qadx
+     .	  memory( 1, mr_blk1( mres   )), mres	)		! qad
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(2)) ) , mrl(2),		! qady
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! qad
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(3)) ) , mrl(3),		! qadz
+     .	  memory( 1, mr_blk1( mres   )), mres 	 )		! qad
+	GOTO 2000	
+
+* QDF  - total heat diffussion
+ 100	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! qdfh
+     .	  memory( 1, mr_blk1( mres   )), mres 	 )		! qdf
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(2)) ),  mrl(2),		! qdfz
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! qdf
+	GOTO 2000
+
+* QEVA - surface evaporative cooling
+* ... also computes and stores QSEN ...
+ 110	cx_variable( cx_xtra ) = pqsen
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL HFLUX (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! tau
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! sst
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! air
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	, ! qsen
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! qeva
+* ... convert units ...
+	CALL MULT_GRID( grid_size, memory(1,mr_blk1( mxtra  )), q2wattm2 )
+	CALL MULT_GRID( grid_size, memory(1,mr_blk1( mres   )), q2wattm2 )
+	GOTO 1900
+
+* TAU  - wind stress magnitude
+ 120	CALL WIND_STRESS (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	,	! taux
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	,	! tauy
+     .		memory( 1, mr_blk1( mres   ) ), mres	)	! tau
+	GOTO 2000
+
+* QSEN - surface sensible heat
+* ... also computes and stores QEVA ...
+ 130	cx_variable( cx_xtra ) = pqeva
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL HFLUX (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! tau
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! sst
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! air
+     .		memory( 1, mr_blk1( mres   ) ), mres	, ! qsen
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	) ! qeva
+* ... convert units ...
+	CALL MULT_GRID( grid_size, memory(1,mr_blk1( mxtra  )), q2wattm2 )
+	CALL MULT_GRID( grid_size, memory(1,mr_blk1( mres   )), q2wattm2 )
+	GOTO 1900
+
+* QRAD - surface radiative heat
+ 140	CALL HRADIATION( 
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	,	! sst
+     .		memory( 1, mr_blk1( mres   ) ), mres	)	! qrad
+*    ... convert units
+	CALL MULT_GRID( grid_size, memory(1, mr_blk1( mres   )), q2wattm2 )
+	GOTO 2000
+
+* QFLX  - total heat flux
+ 150	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) )  , mrl(1) , 			! qeva
+     .	  memory( 1, mr_blk1( mres   ) ), mres	  )			! qflx
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(2)) )  , mrl(2) , 			! qsen
+     .	  memory( 1, mr_blk1( mres   ) ), mres	  )			! qflx
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(3)) )  , mrl(3) , 			! qrad
+     .	  memory( 1, mr_blk1( mres   ) ), mres	  )			! qflx
+	GOTO 2000
+
+* RHO - true density
+ 160	CALL STATE (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	,		! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	,		! salt
+     .		memory( 1, mr_blk1( mres   ) ), mres		)	! rho
+	GOTO 2000
+
+* DPDX - x derivative of baroclinic pressure
+* ... also computes and stores DPDY ...
+ 170	cx_variable( cx_xtra ) = pdpdy
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL GRAD_P_CLINIC (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! rho 
+     .		memory( 1, mr_blk1( mres   ) ), mres	, ! dpdx
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	) ! dpdy
+	GOTO 1900
+
+* DPDY - y derivative of baroclinic pressure
+* ... also computes and stores DPDX ...
+ 180	cx_variable( cx_xtra ) = pdpdx
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL GRAD_P_CLINIC (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! rho 
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	, ! dpdx
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! dpdy
+	GOTO 1900
+
+* W_U - vertical velocity computed on the uv grid (still on w grid vertically)
+ 190	CALL W_ON_UV (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! fuw
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! fvn
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! w_u
+	GOTO 2000
+
+* UAVZ - vertically averaged zonal velocity calculated from PSI
+* ... also computes and stores VAVZ ...
+ 200	cx_variable( cx_xtra ) = pvavz
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL U_FROM_PSI (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! psi
+     .		memory( 1, mr_blk1( mres   ) ), mres	, ! uavz
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	) ! vavz
+	GOTO 1900
+
+* VAVZ - vertically averaged meridional velocity calculated from PSI
+* ... also computes and stores UAVZ ...
+ 210	cx_variable( cx_xtra ) = puavz
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	CALL U_FROM_PSI (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! psi
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	, ! uavz
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! vavz
+	GOTO 1900
+
+* FUW - zonal advection coefficient ( internal variable for W_U and *ADX )
+ 220	CALL FUW (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! psi
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! uavz
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! u
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! fuw
+	GOTO 2000
+
+* FVN - meridional advection coefficient ( internal variable for W_U and *ADY )
+ 230	CALL FVN (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! psi
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! vavz
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! v
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! fvn
+	GOTO 2000
+
+* UADX - EW advection of U
+ 240	CALL VEL_ADV_EW (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! fuw
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! u
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! uadx
+	GOTO 2000
+
+* UADY - NS advection of U
+ 250	CALL VEL_ADV_NS (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! fvn
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! u
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! uady
+	GOTO 2000
+
+* UADZ - vertical advection of U
+ 260	CALL VEL_ADV_Z(
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! w
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! uadz
+	GOTO 2000
+
+* VADX - EW advection of V
+* ... calculation is identical to UADX but with different components
+ 270	GOTO 240
+
+* VADY - NS advection of V
+* ... calculation is identical to UADY but with different components
+ 280	GOTO 250
+
+* VADZ - vertical advection of V
+* ... calculation is identical to UADZ but with different components
+ 290	GOTO 260
+
+* UDFH - horizontal diffusion of U
+ 300	CALL VEL_DIF_XY(
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! udfh
+	GOTO 2000
+
+* UDFZ - vertical diffusion of U
+ 310	CALL VEL_DIF_Z(
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! pcdz
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! u
+     .		memory( 1, mr_blk1( mrl(3) ) ), mrl(3)	, ! ubwi
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! udfz
+	GOTO 2000
+
+* VDFH - horizontal advection of V
+* ... calculation is identical to UDFH but with different components
+ 320	GOTO 300
+
+* VDFZ - vertical advection of V
+* ... calculation is identical to UDFZ but with different components
+ 330	GOTO 310
+
+* UCOI - implicit calculation of Coriolis effect on U
+ 340	CALL ERRMSG(ferr_unknown_variable,status,
+     .				'UCOI no longer implemented',*5000)
+* VCOI - implicit calculation of Coriolis effect on V
+ 350	CALL ERRMSG(ferr_unknown_variable,status,
+     .					'UCOI no longer implemented',*5000)
+
+* UBPI - Grad( Baroclinic pressure ) effect on U
+ 360	CALL VEL_BY_GRAD_P (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! dpdx
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! ubpi
+	GOTO 2000
+
+* VBPI - Grad( Baroclinic pressure ) effect on V
+* ... calculation is identical to UBPI but with different components
+ 370	GOTO 360
+
+* UBWI - wind stress effect on U
+ 380	CALL VEL_BY_WIND (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! taux
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! ubwi
+	GOTO 2000
+
+* VBWI - wind stress effect on V
+* ... calculation is identical to UBWI but with different components
+ 390	GOTO 380
+
+* UCOE - explicit calculation of Coriolis effect on U
+* ... also computes and stores VCOE ...
+ 400	cx_variable( cx_xtra ) = pvcoe
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	temp_grid_size = MGRID_SIZE( mrl(1) )	! working space for "AIR"
+	CALL GET_MEMORY( temp_grid_size,temp_start_blk,temp_nblks,status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+	CALL EXPL_CORIOLIS( 
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mres   ) ), mres	, ! ucoe
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	) ! vcoe
+	CALL FREE_MEMORY( temp_start_blk, temp_nblks )
+	GOTO 1900
+
+* VCOE - explicit calculation of Coriolis effect on V
+* ... also computes and stores UCOE ...
+ 410	cx_variable( cx_xtra ) = pucoe
+	CALL RE_ASSIGN_VARIABLE( mxtra, cx_xtra )
+	temp_grid_size = MGRID_SIZE( mrl(1) )	! working space for "AIR"
+	CALL GET_MEMORY( temp_grid_size,temp_start_blk,temp_nblks,status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+	CALL EXPL_CORIOLIS( 
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mxtra  ) ), mxtra	, ! ucoe
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! vcoe
+	CALL FREE_MEMORY( temp_start_blk, temp_nblks )
+	GOTO 1900
+
+* UAD - total advection of zonal velocity
+* ... uses identical code to QAD ...
+ 420	GOTO 90
+
+* VAD - total advection of merional velocity
+* ... uses identical code to QAD ...
+ 430	GOTO 90
+
+* UDF - total diffusion of zonal velocity
+* ... uses identical code to QDF ...
+ 440	GOTO 100
+
+* VDF - total diffusion of merional velocity
+* ... uses identical code to QDF ...
+ 450	GOTO 100
+
+* DUDT - centered time derivative of U
+ 460	IF ( MR_DIM_LEN(t_dim, mrl(1)).LE.2 ) CALL ERRMSG
+     .	( ferr_limits, status, 'insufficient T axis data for '
+     .				//VAR_CODE(cat_calc_var,var), *5200 )
+	CALL T_DERIV( 
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! u
+     .	  memory( 1, mr_blk1( mres   )), mres  ,		! difference
+     .    dt, reg )
+* ... convert per hour to per month
+	CALL MULT_GRID( grid_size, memory(1, mr_blk1(mres)), 730. )
+* ... store information about accuracy of calculation
+	IF ( reg ) THEN
+	   mr_trans_arg( t_dim, mres ) = dt / 2.
+	ELSE
+	   mr_trans_arg( t_dim, mres ) = bad_val4
+	ENDIF
+	GOTO 2000	
+
+* DVDT - time derivative of V
+* ... uses identical code to DUDT ...
+ 470	GOTO 460
+
+* DWDT - time derivative of W
+* ... uses identical code to DUDT ...
+ 480	GOTO 460
+
+* DTDT - time derivative of TEMP
+* ... uses identical code to DUDT ...
+ 490	GOTO 460
+
+* UBPS - monthly dU due to surface pressure effects
+* ... UBPS = DUDT - ( UDF + UAD + UCOE + UBPI )
+* ... we will use a kludge to get around 3D components to a 2D result
+ 500    mr_lo_ss( mres, z_dim ) = 1	! kludge - make it appear 3D
+	mr_hi_ss( mres, z_dim ) = 1	! kludge
+	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1) , 		! udf
+     .	  memory( 1, mr_blk1( mres   )), mres	  )		! udf
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(2)) ) , mrl(2) , 		! uad
+     .	  memory( 1, mr_blk1( mres   )), mres	  )		! udf+uad
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(3)) ) , mrl(3),		! ucoe
+     .	  memory( 1, mr_blk1( mres   )), mres 	 )		! udf+uad+ucoe
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(4)) ) , mrl(4),		! ubpi
+     .	  memory( 1, mr_blk1( mres   )), mres 	 )		! udf+uad+u...
+	CALL SUB_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(5)) ) , mrl(5),		! dudt 
+     .	  memory( 1, mr_blk1( mres   )), mres	,		! udf+uad+u...
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! ubps
+	mr_lo_ss( mres, z_dim ) = unspecified_int4	! kludge - back to 2D
+	mr_hi_ss( mres, z_dim ) = unspecified_int4	! kludge
+* ... store information about accuracy of derivative in calculation
+	mr_trans_arg( t_dim, mres ) = 	mr_trans_arg( t_dim, mrl(5) )
+	GOTO 2000	
+
+* VBPS - monthly dV due to surface pressure effects
+* ... uses identical code to UBPS ...
+ 510	GOTO 500
+
+* SALI - salinity in parts per thousand
+* ... from "SALT" in (PPT-35)/1000
+ 520	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! salt
+     .	  memory( 1, mr_blk1( mres   )), mres  )
+	CALL MULT_GRID   ( grid_size, memory(1, mr_blk1( mres )), 1000. )
+	CALL ADD_C_2_GRID( grid_size, memory(1, mr_blk1( mres )), 35. )
+	GOTO 2000
+
+* DENS - density in gm-cm**3
+* ... from "RHO" which is "normalized"
+ 530	CALL KNUDSEN(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! temp
+     .	  memory( 1, mr_blk1(mrl(2)) ) , mrl(2),		! salt
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! dens
+
+	GOTO 2000
+
+* UBP  - U change caused by baroclinic and barotropic pressure
+* ... special routine used to replicate 2D UBPS into 3D result
+ 540	CALL COPY_2D_TO_3D(
+     .	  memory( 1, mr_blk1(mrl(2)) ) , mrl(2),		! ubps
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! ubp
+	CALL ADD_2_GRIDS(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),		! ubpi
+     .	  memory( 1, mr_blk1( mres   )), mres	 )		! ubp
+	GOTO 2000
+
+* VBP  - V change caused by baroclinic and barotropic pressure
+* ... uses identical code to UBP ...
+ 550	GOTO 540
+
+* CMSK - convective adjustment mask
+ 560	CALL CONV_ADJ_MASK (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! temp
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! salt
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! w_u
+	GOTO 2000
+
+* W_T - vertical velocity computed on the ts grid (still on w grid vertically)
+ 570	CALL W_ON_TS (
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! u
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! v
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! w_u
+	GOTO 2000
+
+* CAIR - climatological air temperature regridded from monthly data
+ 580	CALL COPY_GRID(
+     .	  memory( 1, mr_blk1(mrl(1)) ) , mrl(1),	! regridded airt
+     .	  memory( 1, mr_blk1( mres   )), mres	)	! cair
+	GOTO 2000
+
+* AIR - air temperature taylored to data set
+ 590	CALL AIR_TEMP( 
+     .		memory( 1, mr_blk1( mrl(1) ) ), mrl(1)	, ! sst
+     .		memory( 1, mr_blk1( mrl(2) ) ), mrl(2)	, ! cair
+     .		memory( 1, mr_blk1( mres   ) ), mres	) ! air
+	GOTO 2000
+
+* ----------------------------------------------------------------------
+* 2 results were computed.  Catalog the extra one
+ 1900	mr_protected( mxtra ) = mr_not_protected
+	CALL MR_NOT_IN_USE( mxtra )
+	cx_stack_ptr = cx_stack_ptr - 1
+
+* free cx_lrg and cx_xtra space
+ 2000	cx_stack_ptr = cx_stack_ptr - 1
+
+* flag that the components are no longer in use
+	DO 2010 icomp = 1, ncomp
+ 2010	CALL MR_NOT_IN_USE( mrl(icomp) )
+
+* success
+	RETURN
+
+* error exit
+ 5000	RETURN 
+ 5100	CALL DELETE_VARIABLE( mxtra )
+ 5200	CALL DELETE_VARIABLE( mres )
+	RETURN
+	END
diff --git a/fer/ocn/cmesh.F b/fer/ocn/cmesh.F
new file mode 100644
index 0000000..bf9787a
--- /dev/null
+++ b/fer/ocn/cmesh.F
@@ -0,0 +1,60 @@
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*DECK CMESH
+      SUBROUTINE CMESH (DX,APB,AMB,WID,N,NDIR)
+C
+C  COSINE MESH
+C  APB=A+B = COARSE RESOLUTION
+C  AMB=A-B=FINE RESOLUTION
+C  WID = WIDTH BETWEEN COARSE & FINE RESOLUTION
+C  N = NUMBER OF VARIABLE SPACES CALCULATED TO SPAN WID
+C  NDIR = (1,-1) = SPACING (INCREASES,DECREASES) WITH INCREASING INDEX
+C
+      REAL DX(160)	! changed 100 to 160 : sh 6-13-85
+	REAL	apb, amb, wid, a, b, c, pi, rn
+	INTEGER	n, ndir, i, ii
+      DATA PI/3.14159/
+      A=.5*(APB+AMB)
+      B=.5*(APB-AMB)
+      C=WID/A
+      N=C+.1
+      RN=1./FLOAT(N)
+      DO 20 II=1,N
+      IF (NDIR.EQ.1) I=N+1-II
+      IF (NDIR.EQ.-1)  I=II
+   20 DX(I)=A+B*COS(PI*RN*(II-.5))
+      RETURN
+      END
diff --git a/fer/ocn/conv_adj_mask.F b/fer/ocn/conv_adj_mask.F
new file mode 100644
index 0000000..ce89063
--- /dev/null
+++ b/fer/ocn/conv_adj_mask.F
@@ -0,0 +1,160 @@
+	SUBROUTINE  CONV_ADJ_mask( t    , mt,
+     .				   s    , ms,
+     .				   cmask, mcmask )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute a mask with bad data flags indicating regions of convective adjustment
+* and 1's indicating regions without it
+* note: at K=1 this algorithm fails to detect a pass #1 convective adjustment
+*	that gets wiped out by pass #2 - ie k=1 is mixed with  k=2 on pass one,
+*	then k=2 is mixed with k=3 on pass #2 --> K=1 and K=2 are unequal at the
+*	end
+*	At K=km it will succeed or fail depending on whether km is odd or even
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -7/22/87
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	mt, ms, mcmask
+
+* subscript ranges from memory variable table ...
+	REAL        t( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		    s( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		cmask( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_t, bad_cmask
+
+****************   205 model code   ******************************************
+******************************************************************************
+* 3199 C   FIND DENSITY FOR STABILITY DETERMINATION
+* 3200 C
+* 3201       DO 965 KS=1,2
+* 3202       CALL STATEC(TA,TA(1,1,2),RHON,TDIF,TDIF(1,1,2),KS)
+* 3203 C
+* 3204 C   CONVECTIVELY ADJUST ADJACENT PAIRS OF BOXES IF GRAVITATIONALLY UNSTA
+* 3205 C
+* 3206       DO 960 M=1,NT1
+* 3207       TEMP(1,1;IMT*KM)=0.5*C2DZ2D(1,1;IMT*KM)*TA(1,1,M;IMT*KM)
+* 3208       LN=(2*((KMM1-KS)/2)+1)*IMT
+* 3209       WHERE (KALTBV(1,KS,KS;LN).AND.RHON(1,KS;LN).GT.RHON(1,KS+1;LN))
+* 3210         TA(1,KS,M;LN)=(TEMP(1,KS;LN)+TEMP(1,KS+1;LN))
+* 3211      *                 *DZZ2R2D(1,KS+1;LN)
+* 3212         TA(1,KS+1,M;LN)=TA(1,KS,M;LN)
+* 3213       ENDWHERE
+* 3214  960  CONTINUE
+* 3215  965  CONTINUE
+*****************************************************************************
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mcmask)
+	i_hi = mr_hi_s1(mcmask)
+	j_lo = mr_lo_s2(mcmask)
+	j_hi = mr_hi_s2(mcmask)
+
+* flag for bad/missing data
+	bad_t    = mr_bad_data( mt )
+	bad_cmask = bad_val4
+
+	DO 2000 l = mr_lo_s4(mcmask), mr_hi_s4(mcmask)
+	DO 2000 k = mr_lo_s3(mcmask), mr_hi_s3(mcmask)
+
+* preset entire mask to a value of 1.0
+	DO 10 j = j_lo, j_hi
+	DO 10 i = i_lo, i_hi
+ 10	cmask(i,j,k,l) = 1.0
+
+* since convective adjustment is computed in 2 passes we presume a point has
+* been convectively adjusted in this time step if its density is identical to
+* the density immediately above or below
+
+	IF ( k .GT. 1 ) THEN
+* ... check against plane above
+	   DO 200 j = j_lo, j_hi
+	      DO 100 i = i_lo, i_hi
+
+* ... only check temp for bad data - assume salt is bad at the same points
+	         IF ( t(i,j,k-1,l) .EQ. bad_t
+     .	         .OR. t(i,j,k  ,l) .EQ. bad_t ) THEN
+	            cmask(i,j,k,l) = bad_cmask
+
+	         ELSEIF (t(i,j,k,l) .EQ. t(i,j,k-1,l)
+     .	          .AND.  s(i,j,k,l) .EQ. s(i,j,k-1,l) ) THEN
+	            cmask(i,j,k,l) = bad_cmask
+
+	         ENDIF
+ 100	      CONTINUE
+ 200	   CONTINUE	
+	ENDIF
+
+	IF ( k .LT. km ) THEN
+* ... check against plane below
+	   DO 400 j = j_lo, j_hi
+	      DO 300 i = i_lo, i_hi
+
+* ... only check temp for bad data - assume salt is bad at the same points
+	         IF ( t(i,j,k+1,l) .EQ. bad_t
+     .	         .OR. t(i,j,k  ,l) .EQ. bad_t ) THEN
+	            cmask(i,j,k,l) = bad_cmask
+
+	         ELSEIF (t(i,j,k,l) .EQ. t(i,j,k+1,l)
+     .	          .AND.  s(i,j,k,l) .EQ. s(i,j,k+1,l) ) THEN
+	            cmask(i,j,k,l) = bad_cmask
+
+	         ENDIF
+ 300	      CONTINUE
+ 400	   CONTINUE	
+	ENDIF
+
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/cvar_context.F b/fer/ocn/cvar_context.F
new file mode 100644
index 0000000..ae0f26a
--- /dev/null
+++ b/fer/ocn/cvar_context.F
@@ -0,0 +1,243 @@
+	SUBROUTINE CVAR_CONTEXT( def_cx, cx, com, k_eq1, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a new variable context by combining the information pointed to by the
+* cvar table component pointer, com, with the default context, def_cx
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  7/25/89 - based on INST_IJKL_CONTEXT
+* 	 2/27/90 - incorporate CAIR as a regrid on the main stack
+* 		 - and allow unspecified limits to pass through
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+#ifdef unix
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'instance_table.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xtext_info.cmn'
+	include	'xdset_parms.cmn'
+#else
+	INCLUDE	'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE	'TMAP_FORMAT:TMAP_DSET.PARM'
+	INCLUDE	'FERRET_CMN:FERRET.PARM'
+	INCLUDE	'FERRET_CMN:ERRMSG.PARM'
+	INCLUDE	'FERRET_CMN:INTERP_STACK.PARM'
+	INCLUDE	'FERRET_CMN:INSTANCE_TABLE.PARM'
+	INCLUDE	'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XCALC_VARS.CMN'
+	INCLUDE	'FERRET_CMN:XTEXT_INFO.CMN'
+	INCLUDE	'FERRET_CMN:XDSET_PARMS.CMN'
+#endif
+
+* calling argument declarations:
+	LOGICAL k_eq1
+	INTEGER	def_cx, cx, com, status
+
+* internal variable declarations:
+	LOGICAL	HOURLY_DATA, special_var, re_flesh
+	INTEGER KNOWN_GRID, CGRID_AXIS, FVAR_NUMBER, ISUBSCRIPT,
+     .		l_step, var, l_lo, idim, def_ax, com_ax,
+     .		grid, dset, cat, fvar, cairt, cairt_dset
+	REAL*8	TM_WORLD, tptinc, t, hours, tmod, t0cairt,
+     .          tclim0, tfrombc
+	CHARACTER*20	date
+
+* internal parameters:
+	REAL*8		secsperhr, hrsperyr
+	PARAMETER     ( secsperhr = 3600.D0,
+     .			hrsperyr  = 365.D0*24.D0 )
+
+* initialize with context of variable to be computed
+	CALL TRANSFER_CONTEXT( def_cx, cx )
+
+* unravel the variable internal number coding
+* (this is the fixed var # - 1=TEMP, 2=SALT, etc.)
+	var = cv_variable( com )
+	special_var = var .GT. pcv_spec_flg
+	IF ( special_var ) var = var - pcv_spec_flg
+
+* determine the data set
+	IF ( special_var .AND. var .EQ. pairt ) THEN
+	   dset = cx_data_set( def_cx )
+	   cairt      = dp_clim_air_sst( dset )		! cairt needed for calcs
+	   cairt_dset = dp_airt_dset( cairt )		! dset containing cairt
+	   IF ( cairt_dset .EQ. unspecified_int4 ) THEN
+	      GOTO 5100					! needed dset not SET
+	   ELSE
+	      dset = cairt_dset
+	   ENDIF
+	ELSE
+	   dset = cx_data_set( cx )
+	ENDIF
+	cx_data_set( cx ) = dset
+
+* find the variable number as stored in the data set, if relevant
+	IF ( cv_category( com ) .EQ. cat_calc_var ) THEN
+	   fvar = var
+	ELSE
+	   fvar = FVAR_NUMBER( dset, fvar_name_code(var) )
+	   IF ( fvar .EQ. var_name_nonexist ) GOTO 5100
+	ENDIF
+	cx_variable( cx ) = fvar
+
+* determine the variable category and defining grid for the data
+	cat = cv_category( com )
+	cx_category( cx ) = cat
+	grid = KNOWN_GRID( dset, cat, fvar )
+	cx_grid( cx ) = grid
+
+* SPACIAL AXES: X,Y,Z
+* component may be wider (or narrower) than result
+	DO 100 idim = 1, 3
+	   def_ax = CGRID_AXIS(idim,def_cx)
+	   com_ax = CGRID_AXIS(idim,cx)
+	   re_flesh = def_ax .NE. com_ax
+	   IF ( def_ax.EQ.mnormal .OR. com_ax.EQ.mnormal ) THEN
+	      IF ( def_ax .EQ. com_ax ) GOTO 100
+	      re_flesh = .TRUE.
+	      IF ( def_ax .EQ. mnormal ) THEN
+* ... 3D component of 2D var: e.g. TEMP as comp. of QEVA ... needs SST
+	         cx_lo_ss(cx,idim) = 1
+	         cx_hi_ss(cx,idim) = 1
+	      ENDIF
+* ... for 2D component of 3D var FLESH_OUT_AXIS will set limits unspecified
+* ... e.g. QFLX as comp. of QDFZ
+	   ELSEIF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) THEN
+* ... allow unspecified regions to pass through still unspecified 2/90
+	      re_flesh = .FALSE.
+	   ELSE
+	      IF ( cv_lo_ds( com,idim ) .NE. 0 ) THEN
+	         cx_lo_ss(cx,idim) = cx_lo_ss(cx,idim) + cv_lo_ds( com,idim )
+	         re_flesh = .TRUE.
+	      ENDIF
+	      IF ( cv_hi_ds( com,idim ) .NE. 0 ) THEN
+	         cx_hi_ss(cx,idim) = cx_hi_ss(cx,idim) + cv_hi_ds( com,idim )
+	         re_flesh = .TRUE.
+	      ENDIF
+	      IF ( idim.EQ.3 .AND. k_eq1 ) THEN
+	         IF ( cx_lo_ss(cx,idim) .NE. 1 ) THEN
+	            cx_lo_ss(cx,idim) = 1
+	            re_flesh = .TRUE.
+	         ENDIF
+	      ENDIF
+	   ENDIF
+	   IF ( re_flesh ) THEN
+	      cx_by_ss( idim,cx ) = .TRUE.
+	      CALL CONFINE_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      CALL FLESH_OUT_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* TIME AXIS:
+* remark on "hourly_needed" below:
+* the time axes of the data sets are not in general the same as the underlying
+* time axis of the model (model integration is typically hourly, whereas data
+* sets will normally be 24 hour or 73 hour snapshots).  Some calculations, such
+* as d/dt(U) simply use the best data available - whatever is in the data set.
+* Other calculations require the exact 1 hour data to be exact.  If that data
+* is not available then the current time step (dt=0) is used as the best est.
+
+* get subscript for time step
+	re_flesh = .FALSE.
+	IF ( special_var .AND. var .EQ. pairt ) THEN
+* ... climatological air temp is just a variable in another file that
+*     needs to be regridded from its monthly axis to the time axis of this
+*     data set ( MOD(1 yr) )
+	   cx_grid(cx) = cvar_grid( pcair, cx_data_set(def_cx) )
+	   cx_unstand_grid(cx) = .TRUE.
+	   cx_regrid_trans( x_dim, cx ) = prgrd_exact
+	   cx_regrid_trans( y_dim, cx ) = prgrd_exact
+	   cx_regrid_trans( z_dim, cx ) = prgrd_exact
+	   cx_regrid_trans( t_dim, cx ) = prgrd_linear_interp
+
+* ... subscript on same axis as calling variable for all below
+	ELSEIF ( cv_lo_d4(com) .GT. pcv_hourly_flg ) THEN
+* ... special treatment of "hourly_needed" diagnostic data
+	   IF ( HOURLY_DATA( grid ) ) THEN
+* ... use 1 hr earlier for exact match of Philander/Cox code
+	      cx_lo_ss(cx,t_dim) = cx_lo_ss(cx,t_dim) - 1
+	      re_flesh = .TRUE.
+	   ENDIF
+	ELSEIF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) THEN
+* ... allow unspecified regions to pass through still unspecified 2/90
+	   re_flesh = .FALSE.
+	ELSE
+	   IF ( cv_lo_ds( com,t_dim ) .NE. 0 ) THEN
+	      cx_lo_ss(cx,t_dim) = cx_lo_ss(cx,t_dim) + cv_lo_d4( com )
+	      re_flesh = .TRUE.
+	   ENDIF
+	   IF ( cv_hi_ds( com,t_dim ) .NE. 0 ) THEN
+	      cx_hi_ss(cx,t_dim) = cx_hi_ss(cx,t_dim) + cv_hi_d4( com )
+	      re_flesh = .TRUE.
+	   ENDIF
+	ENDIF
+* finalize the time axis
+	IF ( re_flesh ) THEN
+	   cx_by_ss( t_dim, cx ) = .TRUE.
+	   CALL CONFINE_AXIS( t_dim, cx, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL FLESH_OUT_AXIS( t_dim, cx, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	IF ( special_var .AND. var .EQ. pairt ) THEN
+	   CALL ERRMSG( ferr_var_not_in_set, status,
+     .			'need to SET DATA CLIM_AIRT_'//dp_airt_name(cairt),
+     .			*5000 )
+	ELSE
+	   CALL ERRMSG( ferr_var_not_in_set, status,
+     .						 fvar_name_code(var), *5000 )
+	ENDIF
+	END
diff --git a/fer/ocn/ew_hadvec.F b/fer/ocn/ew_hadvec.F
new file mode 100644
index 0000000..59844f7
--- /dev/null
+++ b/fer/ocn/ew_hadvec.F
@@ -0,0 +1,140 @@
+	SUBROUTINE EW_HADVEC ( tk, mtk, uk, muk, advec, madvec )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute east-west component of heat advection
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/17/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - array declarations using XMEM_SUBSC.CMN (reordered args)
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	muk, mtk, madvec
+* subscript ranges from memory variable table ...
+	REAL       tk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   uk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		advec( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+	REAL fuw(2:imtp1)
+
+* internal variable declarations:
+	INTEGER	i, j, k, l
+	REAL	bad_tk, bad_uk, bad_qadvec, fact1, dutdxm, tdudx
+
+* --- end of introductory code ---
+* flag for bad/missing data
+	bad_tk     = mr_bad_data( mtk )
+	bad_uk     = mr_bad_data( muk )
+	bad_qadvec = mr_bad_data( madvec )
+
+* south to north loop through east-west lines
+	DO 2000 l = mr_lo_s4(madvec), mr_hi_s4(madvec)
+	DO 2000 k = mr_lo_s3(madvec), mr_hi_s3(madvec)
+	DO 1000 j = mr_lo_s2(madvec), mr_hi_s2(madvec)
+
+	IF ( j .EQ. 1 ) THEN
+	   DO 100 i = mr_lo_s1(madvec), mr_hi_s1(madvec)
+ 100	   advec( i,j,k,l ) = bad_qadvec
+	   GOTO 1000
+	ENDIF
+
+C   FIND ADVECTIVE COEFFICIENTS FOR WEST AND EAST FACES OF T,S BOXES	! 2967
+
+      FACT1=CSTR(j)*DYTR(j)	    				! 2969 mod
+      DO 690 i = MAX(2,mr_lo_s1(madvec)), mr_hi_s1(madvec)+1	! 2972 mod
+	IF ( uk( i-1,j  ,k,l ) .EQ. bad_uk
+     .  .OR. uk( i-1,j-1,k,l ) .EQ. bad_uk ) THEN
+	   fuw(i) = bad_val4
+	ELSE
+           FUW(I)=( Uk(i-1,j,k,l)  *DYU(j)
+     .		 +  Uk(I-1,j-1,k,l)*DYU(j-1) )*FACT1	! 2973 mod
+	ENDIF
+ 690  CONTINUE	    							! 2976
+
+* calculate minus east-west advection component of total advection in flux form
+      DO 820 i = mr_lo_s1(madvec), mr_hi_s1(madvec)		! 3066 mod
+
+	IF ( i .EQ. 1  .OR. i .EQ. im ) THEN
+	   advec( i,j,k,l ) = bad_qadvec
+	   GOTO 820
+	ENDIF
+	IF ( fuw( i   )    .EQ. bad_val4
+     .	.OR. fuw( i+1 )    .EQ. bad_val4
+     .	.OR. tk( i  ,j  ,k,l ) .EQ. bad_tk
+     .	.OR. tk( i-1,j  ,k,l ) .EQ. bad_tk
+     .	.OR. tk( i  ,j-1,k,l ) .EQ. bad_tk
+     .	.OR. tk( i-1,j-1,k,l ) .EQ. bad_tk ) THEN
+	   advec( i,j,k,l ) = bad_qadvec
+	   GOTO 820
+	ENDIF
+
+	dutdxm =  (
+     *          (-FUW(I+1)*(tk(i+1,j,k,l) + tk(i  ,j,k,l))    	      ! 3067 mod
+     *           +FUW(I  )*(tk(i  ,j,k,l) + tk(i-1,j,k,l)))*DXT4R(I) )! 3068 mod
+
+* calculate individual advection component by subtracting the vector t*dU/dX 
+	tdudx = tk(i,j,k,l) * (fuw(i+1) - fuw (i))*dxt4r(i)*2.0
+	advec(i,j,k,l) = (dutdxm + tdudx ) * cmonthly
+
+ 820  CONTINUE	    							! 3072
+
+ 1000	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/expl_coriolis.F b/fer/ocn/expl_coriolis.F
new file mode 100644
index 0000000..e46aa34
--- /dev/null
+++ b/fer/ocn/expl_coriolis.F
@@ -0,0 +1,163 @@
+	SUBROUTINE EXPL_CORIOLIS( u   , mu   , v   , mv   ,
+     .				  ucoe, mucoe, vcoe, mvcoe    )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute the explicit Coriolis effect based on velocity
+* components from the preceeding time step
+*			correction based on an implicit scheme
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/27/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	 mu, mv, mucoe, mvcoe
+
+* subscript ranges from memory variable table ...
+	REAL       u( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   v( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		ucoe( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit ),
+     .		vcoe( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit )
+
+* internal variable declarations:
+	LOGICAL	HOURLY_DATA
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l, dl
+	REAL	bad_u, factor
+
+* --- end of introductory code ---
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 388 C   ADD IN CORIOLIS FORCE
+* 389 C
+* 390       FACTOR=2.0*OMEGA*SINE(J)
+* 391       IF(ACOR.EQ.0) GO TO 358
+* 392       DO 357 K=1,KM
+* 393       DO 357 I=1,IMT
+* 394       UA(I,K)=UA(I,K)+FACTOR*VB(I,K)
+* 395       VA(I,K)=VA(I,K)-FACTOR*UB(I,K)
+* 396  357  CONTINUE
+* 397       GO TO 3590
+* 398  358  CONTINUE
+* 399       DO 359 K=1,KM
+* 400       DO 359 I=1,IMT
+* 401       UA(I,K)=UA(I,K)+FACTOR*V(I,K)
+* 402       VA(I,K)=VA(I,K)-FACTOR*U(I,K)
+* 403  359  CONTINUE
+* 404  3590 CONTINUE
+
+*************************************************************************
+* compute the explicit Coriolis increment implied by the past velocity
+
+* use 1 hour separation for exact results on hourly data
+	IF ( HOURLY_DATA(mr_grid(mucoe)) ) THEN
+	   dl = 1
+	ELSE
+	   dl = 0
+	ENDIF
+
+* limits for calculation
+	i_lo = mr_lo_s1(mucoe)
+	i_hi = mr_hi_s1(mucoe)
+	j_lo = mr_lo_s2(mucoe)
+	j_hi = mr_hi_s2(mucoe)
+
+* flag for bad/missing data
+	bad_u = mr_bad_data( mu )
+
+* compute:
+	DO 200 j = j_lo, j_hi
+
+	   factor = 2.0*omega*sine(j) * cmonthly
+*	   IF ( acor.EQ.0 ) GOTO 358
+
+	   DO 200 l = mr_lo_s4(mucoe), mr_hi_s4(mucoe)
+	   DO 200 k = mr_lo_s3(mucoe), mr_hi_s3(mucoe)
+
+* based on velocity at time n-1:
+	   DO 100 i = i_lo, i_hi 
+	      IF ( u(i,j,k,l) .EQ. bad_u ) THEN
+	         ucoe(i,j,k,l) = bad_val4
+	         vcoe(i,j,k,l) = bad_val4
+	      ELSE
+	         ucoe(i,j,k,l) =  factor * v(i,j,k,l)
+	         vcoe(i,j,k,l) = -factor * u(i,j,k,l)
+	      ENDIF
+ 100	   CONTINUE
+	   GOTO 200
+
+* based on velocity at time n:
+! 358 	   CONTINUE
+!	   STOP 'Coriolis based on single time step not implemented'
+*	   DO 110 i = i_lo, i_hi 
+*	      IF ( u(i,j,k,l+dl) .EQ. bad_u ) THEN
+*	         ucoe(i,j,k,l) = bad_val4
+*	         vcoe(i,j,k,l) = bad_val4
+*	      ELSE
+*	         ucoe(i,j,k,l) =  factor * v(i,j,k,l+dl)
+*	         vcoe(i,j,k,l) = -factor * v(i,j,k,l+dl)
+*	      ENDIF
+* 110	   CONTINUE
+
+ 200	CONTINUE
+	RETURN
+
+	END
diff --git a/fer/ocn/fuw.F b/fer/ocn/fuw.F
new file mode 100644
index 0000000..73de1e2
--- /dev/null
+++ b/fer/ocn/fuw.F
@@ -0,0 +1,150 @@
+	SUBROUTINE  FUW( psi , mpsi ,
+     .			 uavz, muavz,
+     .			 u   , mu,
+     .			 ufuw, mufuw )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute zonal flux term on the uv grid needed in the calculation of
+* both W_U ( W on uv grid columns ) and horizontal momentum advection
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/21/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mpsi, muavz, mu, mufuw
+
+* subscript ranges from memory variable table ...
+	REAL     psi( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		uavz( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit ),
+     .		   u( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit ),
+     .		ufuw( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_psi, bad_u, bad_uavz,
+     .		ufuw_1, sfu_1
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mufuw)
+	i_hi = mr_hi_s1(mufuw)
+	j_lo = mr_lo_s2(mufuw)
+	j_hi = mr_hi_s2(mufuw)
+
+* flag for bad/missing data
+	bad_psi  = mr_bad_data( mpsi  )
+	bad_uavz = mr_bad_data( muavz )
+	bad_u    = mr_bad_data( mu    )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+*  90  C   FIND ADVECTIVE COEFFICIENT 'FUW' FOR WEST FACE OF U,V BOX
+*  91  C
+*  92        DATA TAPLEN/5./
+*  93        DO 100 I=2,IMT
+*  94        SFU(I)=-(P(I,J+1)-P(I,J))*DYUR(J)*AMIN1(HR(I-1,J),HR(I,J))
+*  95   100  CONTINUE
+*  96        DO 110 K=1,KM
+*  97        DO 110 I=1,IMT
+*  98        FUW(I,K)=(UCLIN(I,K)+UCLIN(I-1,K))*0.5
+*  99   110  CONTINUE
+* 100        DO 115 K=1,KM
+* 101        DO 115 I=1,IMT
+* 102        FUW(I,K)=(FUW(I,K)+SFU(I))*CSR(J)
+* 103   115  CONTINUE
+*************************************************************************
+	DO 2000 l = mr_lo_s4(mufuw), mr_hi_s4(mufuw)
+	DO 2000 k = mr_lo_s3(mufuw), mr_hi_s3(mufuw)
+
+C   FIND ADVECTIVE COEFFICIENT 'FUW' FOR WEST FACE OF U,V BOX
+	DO 100 j = j_lo, j_hi
+	DO 100 i = i_lo, i_hi
+* ... cant compute derivatives at fringes of full grid
+	   IF ( i .EQ. 1 .OR. j .EQ. jm ) THEN
+	      ufuw(i,j,k,l) = bad_val4
+	      GOTO 100
+	   ENDIF
+
+	   IF (  psi(i  ,j    ,l) .EQ. bad_psi
+     .	    .OR. psi(i  ,j+1  ,l) .EQ. bad_psi
+     .	    .OR.   u(i  ,j  ,k,l) .EQ. bad_u
+     .	    .OR.   u(i-1,j  ,k,l) .EQ. bad_u
+     .	    .OR.uavz(i  ,j    ,l) .EQ. bad_uavz
+     .	    .OR.uavz(i-1,j    ,l) .EQ. bad_uavz ) THEN
+
+	      ufuw(i,j,k,l) = bad_val4
+
+	   ELSE
+
+	      sfu_1  = -( psi(i,j+1,l)-psi(i,j,l) ) * dyur(j) * hr
+	      ufuw_1 =  ( (u(i  ,j,k,l)-uavz(i  ,j,l))
+     .			+ (u(i-1,j,k,l)-uavz(i-1,j,l)) ) * 0.5
+	      ufuw(i,j,k,l)=( ufuw_1 + sfu_1 ) * csr(j)
+
+	   ENDIF
+
+ 100	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/fvn.F b/fer/ocn/fvn.F
new file mode 100644
index 0000000..8a6545a
--- /dev/null
+++ b/fer/ocn/fvn.F
@@ -0,0 +1,152 @@
+
+	SUBROUTINE FVN( 	psi , mpsi ,
+     .				vavz, mvavz,
+     .				v   , mv,
+     .				vfvn, mvfvn )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute meridional flux terms on the uv grid needed in the calculation of
+* both W_U ( W on uv grid columns ) and horizontal momentum advection
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/21/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mpsi, mvavz, mv, mvfvn
+
+* subscript ranges from memory variable table ...
+	REAL     psi( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		vavz( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit ),
+     .		   v( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit ),
+     .		vfvn( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_psi, bad_v, bad_vavz, factor, sfv_1, vfvn_1
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mvfvn)
+	i_hi = mr_hi_s1(mvfvn)
+	j_lo = mr_lo_s2(mvfvn)
+	j_hi = mr_hi_s2(mvfvn)
+
+* flag for bad/missing data
+	bad_psi  = mr_bad_data( mpsi  )
+	bad_vavz = mr_bad_data( mvavz )
+	bad_v    = mr_bad_data( mv    )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 105  C   FIND ADVECTIVE COEFFICIENT 'FVN' FOR NORTH FACE OF U,V BOX
+* 106  C
+* 107        DO 120 I=1,IMT
+* 108        SFV(I)=(P(I+1,J+1)-P(I,J+1))*DXUR(I)*CSTR(J+1)*AMIN1(HR(I,J+1),
+* 109       1 HR(I,J))
+* 110   120  CONTINUE
+* 111        FACTOR=DYU2R(J)*CSR(J)*CST(J+1)
+* 112        DO 130 K=1,KM
+* 113        DO 130 I=1,IMT
+* 114        FVN(I,K)=(VP(I,K)+VCLIN(I,K))*0.5
+* 115   130  CONTINUE
+* 116        DO 135 K=1,KM
+* 117        DO 135 I=1,IMT
+* 118        FVN(I,K)=(FVN(I,K)+SFV(I))*FACTOR
+* 119   135  CONTINUE
+********************************************************************
+	DO 2000 l = mr_lo_s4(mvfvn), mr_hi_s4(mvfvn)
+	DO 2000 k = mr_lo_s3(mvfvn), mr_hi_s3(mvfvn)
+
+C   FIND ADVECTIVE COEFFICIENT 'FUW' FOR WEST FACE OF U,V BOX
+	DO 100 j = j_lo, j_hi
+	   IF ( j .LT. jm ) factor = dyu2r(j) * csr(j) * cst(j+1)
+	DO 100 i = i_lo, i_hi
+* ... cant compute derivatives at fringes of full grid
+	   IF ( i .EQ. 1 .OR. j .EQ. jm ) THEN
+	      vfvn(i,j,k,l) = bad_val4
+	      GOTO 100
+	   ENDIF
+
+	   IF (  psi(i  ,j+1  ,l) .EQ. bad_psi
+     .	    .OR. psi(i+1,j+1  ,l) .EQ. bad_psi
+     .	    .OR.   v(i  ,j  ,k,l) .EQ. bad_v
+     .	    .OR.   v(i  ,j+1,k,l) .EQ. bad_v
+     .	    .OR.vavz(i  ,j    ,l) .EQ. bad_vavz
+     .	    .OR.vavz(i  ,j+1  ,l) .EQ. bad_vavz ) THEN
+
+	      vfvn(i,j,k,l) = bad_val4
+
+	   ELSE
+
+	      sfv_1  = (psi(i+1,j+1,l)-psi(i,j+1,l)) * dxur(i) * cstr(j+1) * hr
+	      vfvn_1 = ( ( v(i,j+1,k,l) - vavz(i,j+1,l) )
+     .		     +   ( v(i,j,k,l  ) - vavz(i,j,l  ) ) ) * 0.5
+	      vfvn(i,j,k,l)=( vfvn_1 + sfv_1 ) * factor
+
+	   ENDIF
+
+ 100	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/gfdl_terms.F b/fer/ocn/gfdl_terms.F
new file mode 100644
index 0000000..ba99bde
--- /dev/null
+++ b/fer/ocn/gfdl_terms.F
@@ -0,0 +1,233 @@
+	SUBROUTINE GFDL_TERMS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute geometrical and other constants as defined in GFDL code
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE HDIFFUS
+* revision 0.1 - 1/16/87 - added terms needed for momentum eqn
+* revision 0.2 - 7/18/88 - Am entered from data sets - not computed here
+
+#ifdef unix
+	include 'gfdl.parm'
+	include 'xonedim.cmn'
+#else
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'
+#endif
+
+* internal variable declarations:
+	INTEGER	i,j,k
+	REAL	ph1deg, radius, radian, sumdy, dym
+
+* begin executable code:
+* initialize - compute basic grid coordinates ( dxt and dyt in degrees )
+	CALL MESH( dxt, dyt )
+
+* for COMMON/XEDDY
+!	am = 2.E7
+	ah = 2.E7
+	fkpm = .0134
+	fkph = .00134
+	dtuv = 3600.	! 1 hour
+        c2dtuv=2.0*dtuv	! 2028
+	nts30 = 365.25*86400. / (12.*dtuv) + .1
+	dtts = 3600.
+	C2DTTS = 2.0*DTTS	! seconds to 2 hour timestep leapfrogs	! 2027
+	cmonthly = c2dtts * (730./2.)	! convert seconds to months
+
+C									!  937
+       PH1DEG=-30.0+dyt(1)					! 1019 mod
+C									! 1022
+C   DEFINE PHYSICAL CONSTANTS						! 1023
+C									! 1024
+       OMEGA=3.1415927/43082.						! 1025
+       RADIUS=6370.E5							! 1026
+       RADIAN=57.29578							! 1027
+       GRAV=980.6							! 1028
+
+      BAH=FKPH								! 1045
+      BAM=FKPM								! 1046
+
+*   --- Z axis definitions ---
+      DO 100 K=1,KM							! 1059
+      C2DZ(K)=2.0*DZ(K)							! 1060
+      DZ2R(K)=1.0/C2DZ(K)						! 1061
+ 100  CONTINUE								! 1062
+      DZZ(1)=0.5*DZ(1)							! 1063
+      ZDZ(1)=DZ(1)							! 1064
+      DO 110 K=2,km							! 1065
+      DZZ(K)=0.5*(DZ(K-1)+DZ(K))					! 1066
+      ZDZ(K)=ZDZ(K-1)+DZ(K)						! 1067
+ 110  CONTINUE								! 1068
+      DZZ(KM+1)=0.5*DZ(KM)						! 1069
+!      DZZ2R(KMP1)=.5/DZZ(KMP1)						! 1070
+      ZDZZ(1)=DZZ(1)							! 1071
+      DO 120 K=1,km							! 1072
+!      DZZ2R(K)=.5/DZZ(K)						! 1073
+      ZDZZ(K+1)=ZDZZ(K)+DZZ(K+1)					! 1074
+      EEH(K)=1./(DZ(K)*DZZ(K))						! 1075
+      FFH(K)=1./(DZ(K)*DZZ(K+1))					! 1076
+      EEM(K)=1./(DZ(K)*DZZ(K))						! 1077
+      FFM(K)=1./(DZ(K)*DZZ(K+1))					! 1078
+!      KAR(K)=K								! 1079
+ 120  CONTINUE								! 1080
+
+* convert dxt,dyt from degrees to cm
+!      DXT=DXT*RADIUS/RADIAN						! 1090
+!      DYT=DYT*RADIUS/RADIAN						! 1091
+	DO 124 i = 1,imt
+ 124	DXT(i) = dxt(i) * radius/radian
+	DO 125 j = 1,jmt
+ 125	DYT(j) = dyt(j) * radius/radian
+
+*   --- Y axis definitions ---
+       PHI(1)=PH1DEG/RADIAN						! 1092
+      PHIT(1)=PHI(1)-.5*DYT(1)/RADIUS					! 1093
+      SUMDY=PHI(1)							! 1094
+      DYU(JMT)=DYT(JMT)							! 1095
+      DO 130 J=1,JMT							! 1096
+      IF(J.NE.JMT) DYU(J)=.5*(DYT(J)+DYT(J+1))				! 1097
+      DYTR(J)=1./DYT(J)							! 1098
+!      DYT2R(J)=.5/DYT(J)						! 1099
+!      DYT4R(J)=.25/DYT(J)						! 1100
+      DYUR(J)=1./DYU(J)							! 1101
+      DYU2R(J)=.5/DYU(J)						! 1102
+      DYU4R(J)=.25/DYU(J)						! 1103
+      IF(J.NE.JMT) SUMDY=SUMDY+DYT(J+1)/RADIUS				! 1104
+      IF(J.NE.JMT) PHI(J+1)=SUMDY					! 1105
+      IF(J.NE.1) PHIT(J)=.5*(PHI(J-1)+PHI(J))				! 1106
+      CST(J)=COS(PHIT(J))						! 1107
+      CS (J)=COS(PHI (J))						! 1108
+      SINE(J)=SIN(PHI(J))						! 1109
+      CSTR(J)=1.0/CST(J)						! 1110
+      CSR(J)=1.0/CS(J)							! 1111
+      TNG(J)=SINE(J)/CS(J)						! 1112
+ 130  CONTINUE								! 1113
+
+*   --- X axis definitions ---
+      DXU(IMT)=DXT(IMT)					! 1114 mod
+!      IF(LCYC.EQ.1) DXU(IMT)=.5*(DXT(2)+DXT(3))		! 1115 mod
+      DXU(IMT)=.5*(DXT(2)+DXT(3))		! 1115 mod 2/93
+      DO 140  I=1,IMT							! 1116
+      IF(I.NE.IMT) DXU(I)=.5*(DXT(I)+DXT(I+1))		! 1117 mod
+      DXTR(I)=1./DXT(I)					! 1118 mod
+!      DXT2R(I)=.5/DXT(I)					! 1119 mod
+      DXT4R(I)=.25/DXT(I)					! 1120 mod
+      DXUR(I)=1./DXU(I)							! 1121
+      DXU2R(I)=.5/DXU(I)						! 1122
+!      DXU4R(I)=.25/DXU(I)						! 1123
+  140 CONTINUE								! 1124
+
+* compute actual coordinate positions for x and y in degrees
+* **** NOTE: the yv coordinates computed here DO NOT agree with the NMC
+* (and other) wind point coordinates, although the errors are small.  According
+* to the COX documentation the t,s grid points should lie at the midpoints of
+* the u,v points.  This was reversed in the SUBROUTINE GRIDS (by Ron Pacanowski)
+* which generated the NMC wind coordinates.  It has been corrected here.
+	xv(1) = 131.0				! from NMCWIN.DAT file
+	xt(1) = 130.5
+	DO 150 i = 2, imt
+	   xv(i) = xv( i-1 ) + 0.5 * ( dxu(i-1) + dxu(i) ) * radian/radius
+	   xt(i) = xt( i-1 ) + 0.5 * ( dxt(i-1) + dxt(i) ) * radian/radius
+ 150	CONTINUE
+	DO 160 j = 1, jmt
+	   yv(j) = phi (j) * radian
+	   yt(j) = phit(j) * radian
+ 160	CONTINUE
+
+C									! 1137
+C   PRINT SOME THINGS							! 1138
+C									! 1139
+!      PRINT 9701							! 1140
+! 9701 FORMAT(50H0 GRID BOX THICKNESS  'DZ'                        )	! 1141
+!      PRINT 970, DZ							! 1142
+!      PRINT 9702							! 1143
+! 9702 FORMAT(50H0 GRID POINT SEPARATION  'DZZ'                    )	! 1144
+!      PRINT 970, DZZ							! 1145
+!      PRINT 9703							! 1146
+! 9703 FORMAT(50H0 DEPTH OF BOX BOTTOM  'ZDZ'                      )	! 1147
+!      PRINT 970, ZDZ							! 1148
+!      PRINT 9704							! 1149
+! 9704 FORMAT(50H0 DEPTH OF GRID POINT  'ZDZZ'                     )	! 1150
+!      PRINT 970, ZDZZ							! 1151
+!      PRINT 9705							! 1152
+! 9705 FORMAT(50H0 LATITUDE OF T,S POINTS (RADIANS)  'PHIT'        )	! 1153
+!      PRINT 970, PHIT							! 1154
+!      PRINT 9706							! 1155
+! 9706 FORMAT(50H0 LATITUDE OF U,V POINTS (RADIANS)  'PHI'         )	! 1156
+!      PRINT 970, PHI							! 1157
+!      PRINT 9707							! 1158
+! 9707 FORMAT(50H0 COSINE OF T,S LATITUDE  'CST'                   )	! 1159
+!      PRINT 970, CST							! 1160
+!      PRINT 9708							! 1161
+! 9708 FORMAT(50H0 COSINE OF U,V LATITUDE  'CS'                    )	! 1162
+!      PRINT 970, CS							! 1163
+!      PRINT 9709							! 1164
+! 9709 FORMAT(50H0 SINE OF U,V LATITUDE  'SINE'                    )	! 1165
+!      PRINT 970, SINE							! 1166
+ 970  FORMAT(1X,10E13.5)						! 1167
+!C									! 1168
+!C  NEWTONIAN DAMPING COEFFICIENTS POLEWARD OF 30 DEGREES NORTH &	! 1169
+!C  20 DEGREES SOUTH.							! 1170
+!C									! 1171
+!      RGAMMA=1./(GAMMA*86400.)						! 1172
+!      DO 1200 J=1,NPS							! 1173
+! 1200 RGS(J)=RGAMMA*.5*(1.+COS(3.14159*(J-2.)/(NPS-1.)))		! 1174
+!      DO 1201 J=1,NPN							! 1175
+! 1201 RGN(J)=RGAMMA*.5*(1.+COS(3.14159*(J-2.)/(NPN-1.)))		! 1176
+!C									! 1177
+!C     VARIABLE HORIZONTAL DIFFUSION FACTORS...ALLOW UP TO 25.*AM	! 1178
+!C     AND 25.*AH FOR THE COARSE REGIONS				! 1179
+!C									! 1180
+!      XIV(*)=1.							! 1181
+!      XIT(*)=1.							! 1182
+	DO 1205 i = 1,imt
+	xiv(i) = 1.0
+ 1205	xit(i) = 1.0
+      DYM=1./DYT(50)							! 1183
+      DO 1210 J=1,JMT							! 1184
+1210  XJT(J)=3.166*DYT(J)*DYM-2.166					! 1185
+      XJV(JMT)=XJT(JMT)							! 1186
+      DO 1211 J=1,JMTM1							! 1187
+1211  XJV(J)=.5*(XJT(J)+XJT(J+1))					! 1188
+
+	RETURN
+	END
diff --git a/fer/ocn/grad_p_clinic.F b/fer/ocn/grad_p_clinic.F
new file mode 100644
index 0000000..7375ab0
--- /dev/null
+++ b/fer/ocn/grad_p_clinic.F
@@ -0,0 +1,215 @@
+	SUBROUTINE GRAD_P_CLINIC   (	rhok   , mrhok   , 
+     .					dpdx   , mdpdx   , 
+     .					dpdy   , mdpdy 		)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute horizontal components of grad p assuming constant surface pressure
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/14/87 extracted from SUBROUTINE CLINIC
+*			 with major modifications to convert i-k oriented
+*			 calculations to i-j oriented calculations
+* revision 0.1 - 4/3/87  corrected j offset error
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* V420 - 2/96 - fix bug in bounds checking on j loop
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mrhok, mdpdx, mdpdy
+
+* subscript ranges from memory variable table ...
+	REAL    rhok( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		dpdx( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		dpdy( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_rhok, bad_dpdx, bad_dpdy,
+     .		fact1, fact2, udif(im), vdif(im), udif1, vdif1, dpdx1, dpdy1
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mdpdx)
+	i_hi = mr_hi_s1(mdpdx)
+	j_lo = mr_lo_s2(mdpdx)
+	j_hi = mr_hi_s2(mdpdx)
+
+* flag for bad/missing data
+	bad_rhok = mr_bad_data( mrhok )
+	bad_dpdx = mr_bad_data( mdpdx )
+	bad_dpdy = mr_bad_data( mdpdy )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+*  226 C   FIND HYDROSTATIC PRESSURE GRADIENT AT FIRST LEVEL
+*  227 C
+*  228       FACT1=GRAV*DZZ(1)*CSR(J)
+*  229       FACT2=DYU2R(J)*GRAV*DZZ(1)
+*  230       DO 260 I=1,IMT
+*  231       UDIF(I,1)=RHON(I+1,1)-RHOS(I,1)
+*  232       VDIF(I,1)=RHON(I,1)-RHOS(I+1,1)
+*  233       DPDX(I,1)=(FACT1*(UDIF(I,1)-VDIF(I,1)))*DXU2R(I)
+*  234       DPDY(I,1)=(UDIF(I,1)+VDIF(I,1))*FACT2
+*  235  260  CONTINUE
+*  236 C
+*  237 C   FIND HYDROSTATIC PRESSURE GRADIENT AT OTHER LEVELS
+*  238 C
+*  239       FACT1=0.5*CSR(J)*GRAV
+*  240       FACT2=DYU4R(J)*GRAV
+*  241       DO 270 K=2,KM
+*  242       DO 270 I=1,IMT
+*  243       DPDX(I,K)=RHON(I,K-1)+RHON(I,K)
+*  244       DPDY(I,K)=RHOS(I,K-1)+RHOS(I,K)
+*  245  270  CONTINUE
+*  246       DO 273 K=2,KM
+*  247       DO 273 I=1,IMT
+*  248       UDIF(I,K)=DPDX(I+1,K)-DPDY(I  ,K)
+*  249       VDIF(I,K)=DPDX(I  ,K)-DPDY(I+1,K)
+*  250       DPDX(I,K)=(FACT1*(UDIF(I,K)-VDIF(I,K)))*DZZ2D(I,K)*DXU2R2D(I,K)
+*  251       DPDY(I,K)=(FACT2*(UDIF(I,K)+VDIF(I,K)))*DZZ2D(I,K)
+*  252  273  CONTINUE
+*  253       DO 275 K=1,KMM1
+*  254       DO 275 I=1,IMT
+*  255       DPDX(I,K+1)=DPDX(I,K)+DPDX(I,K+1)
+*  256       DPDY(I,K+1)=DPDY(I,K)+DPDY(I,K+1)
+*  257  275  CONTINUE
+
+* ******************************************************************
+
+	DO 2000 l = mr_lo_s4(mdpdx), mr_hi_s4(mdpdx)
+	DO 2000 k = mr_lo_s3(mdpdx), mr_hi_s3(mdpdx)
+
+* top level doesn't require recursive computation - deeper levels do
+	IF ( k .GT. 1 ) GOTO 500
+
+c find hydrostatic pressure gradient at first level
+	DO 260 j = j_lo, j_hi
+	   fact1 = grav * dzz(1) * csr(j)
+	   fact2 = dyu2r(j) * grav * dzz(1)
+	DO 260 i = i_lo, i_hi
+* ... cant compute derivatives at fringes of full grid
+! pre 2/96	   IF ( i .EQ. im .OR. j .EQ. 1 ) THEN
+	   IF ( i .EQ. im .OR. j .EQ. jm ) THEN
+	      dpdx(i,j,k,l) = bad_dpdx
+	      dpdy(i,j,k,l) = bad_dpdy
+	      GOTO 260
+	   ENDIF
+
+	   IF ( rhok(i  ,j+1,k,l) .EQ. bad_rhok
+     .	    .OR.rhok(i+1,j+1,k,l) .EQ. bad_rhok
+     .	    .OR.rhok(i+1,j  ,k,l) .EQ. bad_rhok
+     .	    .OR.rhok(i  ,j  ,k,l) .EQ. bad_rhok ) THEN
+	      dpdx(i,j,k,l) = bad_dpdx
+	      dpdy(i,j,k,l) = bad_dpdy
+	   ELSE
+	      udif1 = rhok(i+1,j+1,k,l) - rhok(i  ,j  ,k,l)
+	      vdif1 = rhok(i  ,j+1,k,l) - rhok(i+1,j  ,k,l)
+	      dpdx(i,j,k,l) = ( fact1*(udif1-vdif1) ) * dxu2r(i)
+	      dpdy(i,j,k,l) = ( udif1+vdif1 ) * fact2
+	   ENDIF
+ 260	CONTINUE
+	GOTO 2000
+
+**************************************************************************
+* find hydrostatic pressure gradient at deeper levels
+ 500	CONTINUE
+
+	DO 270 j = j_lo, j_hi
+	   fact1 = 0.5 * csr(j) * grav
+	   fact2 = dyu4r(j) * grav
+
+	DO 270 i = i_lo, i_hi
+* ... cant compute derivatives at fringes of full grid
+! pre 2/96	   IF ( i .EQ. im .OR. j .EQ. 1 ) THEN
+	   IF ( i .EQ. im .OR. j .EQ. jm ) THEN
+	      dpdx(i,j,k,l) = bad_dpdx
+	      dpdy(i,j,k,l) = bad_dpdy
+	      GOTO 270
+	   ENDIF
+
+	   IF ( rhok(i  ,j+1,k-1,l) .EQ. bad_rhok
+     .	   .OR. rhok(i  ,j+1,k  ,l) .EQ. bad_rhok
+     .	   .OR. rhok(i  ,j  ,k-1,l) .EQ. bad_rhok
+     .	   .OR. rhok(i  ,j  ,k  ,l) .EQ. bad_rhok
+     .	   .OR. rhok(i+1,j+1,k-1,l) .EQ. bad_rhok
+     .	   .OR. rhok(i+1,j+1,k  ,l) .EQ. bad_rhok
+     .	   .OR. rhok(i+1,j  ,k-1,l) .EQ. bad_rhok
+     .	   .OR. rhok(i+1,j  ,k  ,l) .EQ. bad_rhok ) THEN
+	      dpdx(i,j,k,l) = bad_dpdx
+	      dpdy(i,j,k,l) = bad_dpdy
+	      GOTO 270
+	   ENDIF
+
+* ... compute increment to grad P for this level
+* ... combining 2 adjacent rho planes - else results would be on w planes
+	   udif1 = ( rhok(i+1,j+1,k-1,l) + rhok(i+1,j+1,k,l) )
+     .		 - ( rhok(i  ,j  ,k-1,l) + rhok(i  ,j  ,k,l) )
+	   vdif1 = ( rhok(i  ,j+1,k-1,l) + rhok(i  ,j+1,k,l) )
+     .		 - ( rhok(i+1,j  ,k-1,l) + rhok(i+1,j  ,k,l) )
+	   dpdx1 = ( fact1*( udif1-vdif1 ) ) * dzz(k) * dxu2r(i)
+	   dpdy1 = ( fact2*( udif1+vdif1 ) ) * dzz(k)
+
+* ... combine with results from next shallower level
+	   dpdx(i,j,k,l) = dpdx(i,j,k-1,l) + dpdx1
+	   dpdy(i,j,k,l) = dpdy(i,j,k-1,l) + dpdy1
+ 270	CONTINUE
+
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/hflux.F b/fer/ocn/hflux.F
new file mode 100644
index 0000000..7d07581
--- /dev/null
+++ b/fer/ocn/hflux.F
@@ -0,0 +1,176 @@
+      SUBROUTINE HFLUX ( vel, mvel, sst, msst, air, mair,
+     .			 sens, msens,  evap, mevap )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute heat flux into sea surface
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 2.0 - 3/7/86	major modifications from GFDLCONT Rev 5.4 to convert
+*			i-k oriented calculations to i-j oriented calculations
+* revision 2.1 -4/4/88 - air temp is pre-computed for various parameterizations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - array declarations using XMEM_SUBSC.CMN (reordered args)
+
+* capitalized code is lifted from the GFDL model
+*
+* equations used:
+*	Q = SW - LW - QS - QE
+* where
+*	Q is heat flux
+*	SW-LW (C5) is short wave down less long wave up
+*	QS is sensible heating: = ro*Cd*Cp*V*(Tsst-Tair)
+*	QE is evaporative cooling: = ro*L*Cd*V*(qradi(Tsst) - R*qradi(Tair) )
+*	where
+*		qs(T) = 0.622es(T)/PA and
+*		qe(T) = 6.11*exp[L/Rv * (1/273 - 1/T) ]
+
+* note: in the original GFDL version of this subroutine the surface Q flux was
+*	imbedded in the array TDIF with suitable constants so that the surface
+*	flux appeared to be diffusing from level k=0 of the ocean.  Several of
+*	the variables went under non-explicit EQUIVALENCE names so that the
+*	effective calculation (where "qflux" is the surface heat flux) became:
+* 		tdif(i,1)= sst + dzz(1)/bvdc(i) * qflux(i)	- in HFLUX
+*		delta_T  = bvdc(i)*eeh(1) * (tdif(i,1)-sst(1))	- in TRACER 3106
+*	where	eeh(1)   = 1/(dz(1)*dzz(1))
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+	include 'xdset_parms.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+	INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE 'FERRET_CMN:XDSET_PARMS.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mair, mvel, msst, msens, mevap
+	REAL	 vel( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		 sst( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		 air( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit ),
+     .		sens( m4lox:m4hix,m4loy:m4hiy,            m4lot:m4hit ),
+     .		evap( m5lox:m5hix,m5loy:m5hiy,            m5lot:m5hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, l, dset
+	REAL	bad_air, bad_sst, bad_vel, bad_sens, bad_evap, vel1,
+     .		d1, d2, windmin
+	REAL	R, RO, EL, CD, PA, CP, C1, C2, rap
+
+* --- end of introductory code ---
+* initialize
+	dset    = mr_data_set( msens )
+	windmin = dp_min_wind( dset )
+
+* limits for calculation
+	i_lo = mr_lo_s1(msens)
+	i_hi = mr_hi_s1(msens)
+	j_lo = mr_lo_s2(msens)
+	j_hi = mr_hi_s2(msens)
+
+* flag for bad/missing data
+	bad_air  = mr_bad_data( mair )
+	bad_vel  = mr_bad_data( mvel )
+	bad_sst  = mr_bad_data( msst )
+	bad_sens = mr_bad_data( msens )
+	bad_evap = mr_bad_data( mevap )
+
+C     SET CONSTANTS							!  769
+C									!  770
+      R=.8
+      RO=1.2E-3			! (of air) gm/cm**3
+      EL=595.			! cal/gm
+      CD=1.4E-3
+      PA=1013.25		! millibars
+      CP=.24			! cal/gm-deg
+      C1=RO*CD*EL*.662/PA
+      C2=RO*CD*CP
+	rap = 1. / (ro * cd)	! translated from RAP assignment below
+
+	DO 2000 l = mr_lo_s4(msens), mr_hi_s4(msens)
+
+	DO 300 j = j_lo, j_hi
+	DO 300 i = i_lo, i_hi
+
+* check air, SST and wind stress
+	IF ( air(i,j  ,l) .EQ. bad_air
+     .	.OR. sst(i,j,1,l) .EQ. bad_sst
+     .	.OR. vel(i,j  ,l) .EQ. bad_vel ) GOTO 290
+
+C     CALC WIND MAGNITUDE FROM STRESS					!  803
+C(     DON'T ALLOW WIND MAGNITUDE < 488 CM/SEC (.40DYNES/CM**2)		!  811)
+C   don't allow wind magnitude < windmin
+C     TO APPROX HIGH FREQ DISTURBANCES IN ITCZ				!  812
+      vel1=RAP*VEL(i,j,l)					!  808 mod
+      vel1=SQRT(vel1)						!  809 mod
+      IF (vel1.LT.windmin) vel1=windmin				!  815 mod
+50    CONTINUE							!  816
+C								!  817
+C     SATURATION VAPOR PRESSURES ... LATENT HEATING		!  818
+C								!  819
+      d1   =9.4051-2353./( air(i,j  ,l) + 273.16 )		!  820 mod
+      d2   =9.4051-2353./( SST(i,j,1,l) + 273.16 )		!  821 mod
+      d2   =10.**d2						!  822 mod
+      d1   =10.**d1						!  823 mod
+      d1   =d2-R*d1						!  824 mod
+      d1   =C1*d1						!  825 mod
+	sens(i,j,l) =-c2 * vel1 * (sst(i,j,1,l)-air(i,j,l))     ! sensible heat
+	evap(i,j,l) =-d1 * vel1				! evaporative heat
+	GOTO 300
+	
+* cannot do calculation at this point
+ 290	      sens(i,j,l) = bad_sens
+	      evap(i,j,l) = bad_evap
+
+ 300	continue
+
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/hourly_data.F b/fer/ocn/hourly_data.F
new file mode 100644
index 0000000..b08cd45
--- /dev/null
+++ b/fer/ocn/hourly_data.F
@@ -0,0 +1,78 @@
+	LOGICAL FUNCTION HOURLY_DATA( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular grid has a regular hourly time axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  7/27/89
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+#else
+	INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE 'TMAP_FORMAT:XTM_GRID.CMN'
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+#endif
+
+* calling argument declarations:
+	INTEGER	grid
+
+* internal variable declarations:
+	INTEGER	taxis
+
+	taxis = grid_line( t_dim, grid )
+
+	IF ( taxis .EQ. munknown .OR. taxis.EQ.mnormal ) THEN
+	   HOURLY_DATA = .FALSE.
+	   RETURN
+	ENDIF
+
+	HOURLY_DATA =
+     .		 line_regular  ( taxis )
+     .	   .AND. line_delta    ( taxis ) .EQ. 1.
+     .	   .AND. line_tunit    ( taxis ) .EQ. 3600.
+     .	   .AND. line_dim      ( taxis ) .GT. 1
+     .	   .AND. line_direction( taxis ) .EQ. 'TI'
+
+	RETURN
+	END
diff --git a/fer/ocn/hradiation.F b/fer/ocn/hradiation.F
new file mode 100644
index 0000000..1561b0f
--- /dev/null
+++ b/fer/ocn/hradiation.F
@@ -0,0 +1,162 @@
+      SUBROUTINE HRADIATION ( sst, msst, rad, mrad )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute radiative heat flux into sea surface
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/30/86
+* revision 1.0 - 4/4/88  - added SST and heat ramp calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+* capitalized code is lifted from the GFDL model
+*
+*	SW-LW (C5) is short wave down less long wave up
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+	include 'xonedim.cmn'
+	include 'xdset_parms.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+	INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'
+	INCLUDE 'FERRET_CMN:XDSET_PARMS.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	msst, mrad
+	REAL    sst( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		rad( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, l, dset
+	REAL	qswd, qlwu, rday, c5, angl, bad_rad, bad_sst, factor
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mrad)
+	i_hi = mr_hi_s1(mrad)
+	j_lo = mr_lo_s2(mrad)
+	j_hi = mr_hi_s2(mrad)
+
+* flag for bad or missing values
+	bad_sst = mr_bad_data ( msst )
+	bad_rad = mr_bad_data ( mrad )
+
+* data set needed to determine which calculation to use
+	dset = mr_data_set( mrad)
+
+* ... PHILANDER/SIEGEL CODE ...
+      QSWD=500.			! cal/cm**2-day
+      QLWU=115.			!      "
+      RDAY=1./86400.		! 1 / seconds per day
+      C5=(QSWD-QLWU)*RDAY
+
+C									!  784
+C     APPROX ANNUAL SHORT WAVE DOWN - LONG WAVE UP			!  785
+C									!  786
+	DO 2000 l = mr_lo_s4(mrad), mr_hi_s4(mrad)
+
+      DO 30 i = i_lo, i_hi
+      DO 30 j = j_lo, j_hi					!  787 mod
+      ANGL=ACOS(CS(j))*57.29578		! degrees		!  788
+
+* select appropriate calculation for data set
+	IF ( dp_phil_qflux( dset ) ) THEN
+
+* ... Philander/Siegel heat flux (doesn't depend on SST)
+           rad(i,j,l)=(-ANGL*7.5+650.-QLWU)*RDAY		!  789
+           IF(ANGL.LT.20.) rad(i,j,l)=C5			!  790
+
+* ... calculations below depend on SST
+	ELSEIF( sst(i,j,l) .EQ. bad_sst ) THEN
+	   rad(i,j,l) = bad_rad
+
+	ELSEIF( dp_ramp1_qflux( dset ) ) THEN
+* ... single ramp heat flux - hot regions receive less radiation
+	   IF ( sst(i,j,l) .GT. 27. ) THEN
+	      factor = 1. - ( 82.65 * (sst(i,j,l)-27.) / (3.*500.) )
+	   ELSE
+	      factor = 1.
+	   ENDIF
+	   IF ( angl .GT. 20. ) THEN
+	      rad(i,j,l) = ( (-angl*7.5+650.)*factor - qlwu ) * rday
+	   ELSE
+	      rad(i,j,l) = (             qswd*factor - qlwu ) * rday
+	   ENDIF
+
+	ELSEIF( dp_ramp2_qflux( dset ) ) THEN
+* ... double ramp heat flux - hot regions receive less; cold regions, more
+	   IF ( sst(i,j,l) .LT. 26. ) THEN
+	      factor = 1. + ( 82.65 * (26.-sst(i,j,l)) / (2.*500.) )
+	   ELSEIF ( sst(i,j,l) .GT. 27. ) THEN
+	      factor = 1. - ( 82.65 * (sst(i,j,l)-27.) / (3.*500.) )
+	   ELSE
+	      factor = 1.
+	   ENDIF
+	   IF ( angl .GT. 20. ) THEN
+	      rad(i,j,l) = ( (-angl*7.5+650.)*factor - qlwu ) * rday
+	   ELSE
+	      rad(i,j,l) = (             qswd*factor - qlwu ) * rday
+	   ENDIF
+
+	ELSE
+* ... unknown heat flux parameterization
+	   rad(i,j,l) = bad_rad
+	ENDIF
+* compute increment
+
+
+30    CONTINUE								!  791
+
+ 2000	CONTINUE
+
+      RETURN								!  833
+      END								!  834
diff --git a/fer/ocn/knudsen.F b/fer/ocn/knudsen.F
new file mode 100644
index 0000000..498a5d4
--- /dev/null
+++ b/fer/ocn/knudsen.F
@@ -0,0 +1,162 @@
+	SUBROUTINE KNUDSEN( temp, mtemp, salt, msalt, dens, mdens )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* lifted from COX routine KNUDSEN to compute the density of sea water via
+* the Knudsen formula 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 12/15/87
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	   mtemp, msalt, mdens
+	REAL    temp( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		salt( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		dens( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	REAL T3,S2,T2,S3,F1,F2,F3,FS,SIGMA,A,B1,B2,B,CO,ALPHA,ALPSTD
+	REAL S,T,DN,D
+	REAL POTEM
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_temp, bad_salt, bad_dens
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mdens)
+	i_hi = mr_hi_s1(mdens)
+	j_lo = mr_lo_s2(mdens)
+	j_hi = mr_hi_s2(mdens)
+
+* flag for bad/missing data
+	bad_temp = mr_bad_data( mtemp )
+	bad_salt = mr_bad_data( msalt )
+	bad_dens = mr_bad_data( mdens )
+
+	DO 2000 l = mr_lo_s4(mdens), mr_hi_s4(mdens)
+	DO 2000 k = mr_lo_s3(mdens), mr_hi_s3(mdens)
+
+* depth in meters
+	D = zdzz(k) / 100.
+
+* main loop - compute one horizontal grid
+	DO 100 j = j_lo, j_hi
+	DO 100 i = i_lo, i_hi
+
+	   IF ( temp(i,j,k,l).EQ.bad_temp .OR. salt(i,j,k,l).EQ.bad_salt ) THEN
+	      dens(i,j,k,l) = bad_dens
+	      GOTO 100
+	   ENDIF
+
+* true salinity(ppt) and potential temperature
+	   s = (salt(i,j,k,l)*1000.D0) + 35.
+	   t = POTEM( temp(i,j,k,l), s, d )
+
+* stolen KNUDSEN code
+      T2 = T*T
+      T3= T2* T
+      S2 = S*S
+      S3 = S2 * S
+      F1 = -(T-3.98)**2 * (T+283.)/(503.57*(T+67.26))
+      F2 = T3*1.0843E-6 - T2*9.8185E-5 + T*4.786E-3
+      F3 = T3*1.667E-8 - T2*8.164E-7 + T*1.803E-5
+      FS= S3*6.76786136D-6 - S2*4.8249614D-4 + S*8.14876577D-1
+      SIGMA= F1 + (FS+3.895414D-2)*(1.-F2+F3*(FS-.22584586D0))
+      A= D*1.0E-4*(105.5+ T*9.50 - T2*0.158 - D*T*1.5E-4)  -
+     1(227. + T*28.33 - T2*0.551 + T3* 0.004)
+      B1 = (FS-28.1324)/10.0
+      B2 = B1 * B1
+      B= -B1* (147.3-T*2.72 + T2*0.04 - D*1.0E-4*(32.4- 0.87*T+.02*T2))
+      B= B+ B2*(4.5-0.1*T - D*1.0E-4*(1.8-0.06*T))
+      CO = 4886./(1. + 1.83E-5*D)
+      ALPHA=     D*1.0E-6* (CO+A+B)
+      DN=(SIGMA+ALPHA)/(1.-1.E-3*ALPHA)
+
+	dens(i,j,k,l) = DN
+ 100	CONTINUE
+ 2000	CONTINUE
+
+      RETURN
+      END
+********************************************************************
+      REAL FUNCTION POTEM(T,S,P)
+C     POTENTIAL TEMPERATURE FUNCTION
+C     BASED ON FOFONOFF AND FROESE (1958) AS SHOWN IN "THE SEA" VOL. 1,
+C     PAGE 17, TABLE IV
+C     INPUT IS TEMPERATURE, SALINITY, PRESSURE (OR DEPTH)
+C     UNITS ARE DEG.C., PPT, DBARS (OR METERS)
+	REAL t, s, p
+	REAL s2, p2, t2, t3, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11
+      B1=-1.60E-5*P
+      B2=1.014E-5*P*T
+      T2=T*T
+      T3=T2*T
+      B3=-1.27E-7*P*T2
+      B4=2.7E-9*P*T3
+      B5=1.322E-6*P*S
+      B6=-2.62E-8*P*S*T
+      S2=S*S
+      P2=P*P
+      B7=4.1E-9*P*S2
+      B8=9.14E-9*P2
+      B9=-2.77E-10*P2*T
+      B10=9.5E-13*P2*T2
+      B11=-1.557E-13*P2*P
+      POTEM=B1+B2+B3+B4+B5+B6+B7+B8+B9+B10+B11
+      POTEM=T-POTEM
+      RETURN
+      END
diff --git a/fer/ocn/mesh.F b/fer/ocn/mesh.F
new file mode 100644
index 0000000..7636d78
--- /dev/null
+++ b/fer/ocn/mesh.F
@@ -0,0 +1,64 @@
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*DECK MESH
+      SUBROUTINE MESH (DX,DY)
+      INTEGER  IM, JM, NX, NY
+      PARAMETER (IM=160,JM=100,NX= 1,NY=3)
+	INTEGER l, m, n
+      REAL DX(IM),DY(JM)
+      REAL XMAX(NX),XMIN(NX),XWID(NX)
+      REAL YMAX(NY),YMIN(NY),YWID(NY)
+	INTEGER	ID(NX), JD(NY)
+      DATA XMAX/1.0/
+      DATA XMIN/1.0/
+      DATA XWID/160.0/
+      DATA YMAX/2.3333334,.3333334,2.8666667/
+      DATA YMIN/3*.3333334/
+      DATA YWID/20.,20.,40./
+      DATA ID/1/
+      DATA JD/-1,2*1/
+      M=1
+      DO 5 L=1,NX
+      CALL CMESH (DX(M),XMAX(L),XMIN(L),XWID(L),N,ID(L))
+      M=M+N
+    5 CONTINUE
+      M=1
+      DO 8 L=1,NY
+      CALL CMESH (DY(M),YMAX(L),YMIN(L),YWID(L),N,JD(L))
+      M=M+N
+    8 CONTINUE
+      RETURN
+      END
diff --git a/fer/ocn/prof.F b/fer/ocn/prof.F
new file mode 100644
index 0000000..c61845f
--- /dev/null
+++ b/fer/ocn/prof.F
@@ -0,0 +1,175 @@
+      SUBROUTINE PROF( KMIX,	UK,  muk,
+     .				VK,  mvk,
+     .				ROK, mrok,
+     .				RNUE,mrnue, HNUE,mhnue  )	! 1522 mod
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* calculate vertical mixing coefficients
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 5/7/87 - changes in IF tests to avoid under/over flow
+* V200:  7/25/89 - 4D symmetrical
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	KMIX, muk, mvk, mrok, mrnue, mhnue
+* subscript ranges from memory variable table ...
+	REAL      uk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		  vk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		 rok( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit ),
+     .		rnue( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit ),
+     .		hnue( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,m5lot:m5hit )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l
+	REAL	bad_uk, bad_vk, bad_ro, bad_rnue, bad_hnue,
+     .		fricmax, gr, di, windmix
+
+      DATA FRICMAX / 50./,GR/980./					! 1541
+
+* flag(s) for bad or missing values
+	bad_uk = mr_bad_data ( muk  )
+	bad_vk = mr_bad_data ( mvk  )
+	bad_ro = mr_bad_data ( mrok )
+	bad_rnue = mr_bad_data ( mrnue )   ! added 2/93
+	bad_hnue = mr_bad_data ( mhnue )   ! added 2/93
+
+	DO 1000 l = mr_lo_s4(mrnue), mr_hi_s4(mrnue)
+	DO 1000 k = mr_lo_s3(mrnue), mr_hi_s3(mrnue)
+
+	IF ( k .LT. kmix ) THEN 	! kmix may be generalized to im x jm
+
+	DO 50 j = mr_lo_s2(mrnue), mr_hi_s2(mrnue)
+	DO 50 i = mr_lo_s1(mrnue), mr_hi_s1(mrnue)
+
+	IF ( uk  (i,j,k,l) .EQ. bad_uk
+     .	.OR. vk  (i,j,k,l) .EQ. bad_vk
+     .	.OR. rok (i,j,k,l) .EQ. bad_ro ) THEN
+	   rnue(i,j,k,l) = bad_rnue
+	   hnue(i,j,k,l) = bad_hnue
+	   GOTO 50
+	ENDIF
+
+      HNUE(i,j,k,l)=((Uk(I,j,K+1,l)-Uk(i,j,k,l))**2
+     .		   + (Vk(I,j,k+1,l)-Vk(i,j,k,l))**2)	! 1545 mod
+C									! 1547
+C     COMPUTE RICHARDSON NUMBER						! 1548
+C									! 1549
+	di = dzz(k+1)		! ref.   1088   DI(I,K)=ZDZZ(K+1)-ZDZZ(K)
+	HNUE(i,j,k,l)= GR*DI*(ROk(I,j,k+1,l)-ROk(i,j,k,l))
+     .		     /(HNUE(i,j,k,l)+1.E-20)! 1552 mod
+
+C									! 1553
+C     NEG RICH NUMBERS WILL BE HANDLED BY CONVECTIVE ADJUSTMENT!	! 1554
+C									! 1555
+	hnue(i,j,k,l) = ABS( hnue(i,j,k,l) )			     ! 1556 mod
+
+* under/over flow fix
+	IF ( hnue(i,j,k,l) .GT. 1.E11 ) THEN
+	 rnue(i,j,k,l) = bam
+	 hnue(i,j,k,l) = bah
+	 GOTO 50
+	ENDIF
+
+      HNUE(i,j,k,l)=1.+5.*HNUE(i,j,k,l)					! 1559
+C									! 1561
+C     COMPUTE VERTICAL VISCOSITY					! 1562
+C									! 1563
+      RNUE(i,j,k,l) = FRICMAX / HNUE(i,j,k,l)**2		! 1566 mod
+C									! 1567
+C     COMPUTE VERTICAL DIFFUSIVITY					! 1568
+C									! 1569
+      HNUE(i,j,k,l)=RNUE(i,j,k,l)/HNUE(i,j,k,l)+BAH		! 1572 mod
+C									! 1573
+C     ADD IN BACKGROUND							! 1574
+C									! 1575
+      RNUE(i,j,k,l)=RNUE(i,j,k,l)+BAM				! 1578 mod
+ 50	CONTINUE
+
+	ELSE
+
+C									! 1579
+C     SET BACKGROUND VALUES BELOW LEVEL KMIX				! 1580
+C									! 1581
+	DO 60 j = mr_lo_s2(mrnue), mr_hi_s2(mrnue)
+	DO 60 i = mr_lo_s1(mrnue), mr_hi_s1(mrnue)		! 1583 mod 
+      RNUE(i,j,k,l)=BAM							! 1584
+  60  HNUE(i,j,k,l)=BAH							! 1585
+
+	ENDIF
+C									! 1586
+C     APPROX HIGH FREQ WIND MIXING NEAR SURFACE				! 1587
+C									! 1588
+	IF ( k .EQ. 1 ) THEN
+      WINDMIX=10.							! 1589
+	DO 70 j = mr_lo_s2(mrnue), mr_hi_s2(mrnue)
+	DO 70 i = mr_lo_s1(mrnue), mr_hi_s1(mrnue)		! 1590 mod 
+      IF (   rnue(i,j,k,l) .NE. bad_rnue
+     . .AND. RNUE(i,j,k,l) .LT. WINDMIX ) RNUE(i,j,k,l)=WINDMIX	! 1591 mod
+      IF (   hnue(i,j,k,l) .NE. bad_hnue
+     . .AND. HNUE(i,j,k,l) .LT. WINDMIX ) HNUE(i,j,k,l)=WINDMIX	! 1592 mod
+70    CONTINUE								! 1593
+	ENDIF
+
+ 1000	CONTINUE
+
+      RETURN								! 1594
+      END								! 1595
+
diff --git a/fer/ocn/sn_hadvec.F b/fer/ocn/sn_hadvec.F
new file mode 100644
index 0000000..97dd4dd
--- /dev/null
+++ b/fer/ocn/sn_hadvec.F
@@ -0,0 +1,150 @@
+	SUBROUTINE SN_HADVEC ( tk, mtk, vk, mvk, advec, madvec )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute south-north component of heat advection
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/17/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 6/24/88 - added bad data check on vk(i,j-1)
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - array declarations using XMEM_SUBSC.CMN (reordered args)
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+* calling argument declarations:
+	INTEGER	mvk, mtk, madvec
+* subscript ranges from memory variable table ...
+	REAL       tk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   vk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		advec( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+	REAL	fvst(im),fvn(im)
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAl	bad_tk, bad_vk, bad_qadvec, fact1, fact2, fact3, dvtdym, tdvdy
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(madvec)
+	i_hi = mr_hi_s1(madvec)
+	j_lo = mr_lo_s2(madvec)
+	j_hi = mr_hi_s2(madvec)
+
+* flag for bad/missing data
+	bad_tk	   = mr_bad_data( mtk )
+	bad_vk	   = mr_bad_data( mvk )
+	bad_qadvec = mr_bad_data( madvec )
+
+* south to north loop through east-west lines
+	DO 2000 l = mr_lo_s4(madvec), mr_hi_s4(madvec)
+	DO 2000 k = mr_lo_s3(madvec), mr_hi_s3(madvec)
+
+	DO 1000 j = j_lo, j_hi
+
+	IF ( j .EQ. 1  .OR.  j .EQ. jm ) THEN
+	   DO 100 i = i_lo, i_hi
+ 100	   advec( i,j,k,l ) = bad_qadvec
+	   GOTO 1000
+	ENDIF
+
+C   FIND ADVECTIVE COEFFICIENTS FOR SOUTH AND NORTH FACES OF T,S BOXES	! 2967
+
+      FACT1 = CSTR(j)*DYTR(j)	    				! 2969 mod
+      FACT2 = fact1 * CS(j)	 	   			! 2970 mod
+      fact3 = fact1 * cs(j-1)
+      DO 690 I= MAX(2,i_lo), i_hi				! 2972 mod
+	IF ( vk(i  ,j  ,k,l) .EQ. bad_vk
+     .  .OR. vk(i-1,j  ,k,l) .EQ. bad_vk
+     .  .OR. vk(i  ,j-1,k,l) .EQ. bad_vk
+     .	.OR. vk(i-1,j-1,k,l) .EQ. bad_vk ) THEN
+	   fvn(i) = bad_val4
+	ELSE
+	   FVN (I)=(Vk(i,j,k,l  )*DXU(I)+Vk(I-1,j  ,k,l)
+     .		   *DXU(I-1))*FACT2*DXT4R(I)			! 2975 mod
+	   FVST(I)=(Vk(i,j-1,k,l)*DXU(I)+Vk(I-1,j-1,k,l)
+     .		   *DXU(I-1))*FACT3*DXT4R(I)
+	ENDIF
+ 690  CONTINUE	    							! 2976
+
+* calculate minus south-north component of total advection in flux form
+      DO 820 I= i_lo, i_hi					! 3066 mod
+
+	
+	IF ( i .EQ. 1
+     .	.OR. fvn(i    ) .EQ. bad_val4
+     .	.OR. tk (i,j  ,k,l) .EQ. bad_tk
+     .	.OR. tk (i,j-1,k,l) .EQ. bad_tk
+     .	.OR. tk (i,j+1,k,l) .EQ. bad_tk ) THEN
+	   advec( i,j,k,l ) = bad_qadvec
+	   GOTO 820
+	ENDIF
+
+        dvtdym =  (						! 3069 mod
+     *           -FVN (I)*(tk(i,j+1,k,l) + tk(i,j,  k,l))	! 3070 mod
+     *           +FVST(I)*(tk(i,j,k,l  ) + tk(i,j-1,k,l)))	! 3071 mod
+
+* calculate individual advection component by subtracting the vector t*dU/dX 
+	tdvdy = tk(i,j,k,l) * (fvn(i  ) - fvst(i))         *2.0
+	advec(i,j,k,l) = (dvtdym + tdvdy ) * cmonthly
+
+ 820  CONTINUE	    							! 3072
+
+ 1000	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/state.F b/fer/ocn/state.F
new file mode 100644
index 0000000..37f2d69
--- /dev/null
+++ b/fer/ocn/state.F
@@ -0,0 +1,238 @@
+      SUBROUTINE STATE ( temp, mtemp, salt, msalt, rho, mrho )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute density "referenced to surface" from equation of state
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/10/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 1.0 - 1/8/87 - STATED --> STATE with STATED added as ENTRY
+* V200:  7/25/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mtemp, msalt, mrho
+* subscript ranges from memory variable table ...
+	REAL    temp( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		salt( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		 rho( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	LOGICAL	use_k
+	INTEGER	n, i, j, k, l, m
+	REAL	bad_temp, bad_salt, bad_rho, tq, sq
+	REAL	TO(KMP1),SO(KMP1),C(KM,9)			! 2672 mod
+
+C     POLYNOMIAL COEFFS GO IN HERE					! 2674
+C									! 2675
+      DATA TO/13.4993058,13.4979166,13.4965263,13.4951349,13.4937423,	! 2676
+     *13.4923486,13.4909537,13.4895577,13.4881606,13.4867624,13.4851881,! 2677
+     *13.4832619,13.4809829,13.4783495,13.4751843,13.4713080,13.4663623,! 2678
+     * 8.4694918, 8.4614842, 8.4482321, 5.9391351, 4.4212668, 2.8993113,! 2679
+     * 2.8539693, 2.7957242, 2.7277752, 2.6540454,0./			! 2680
+      DATA SO/-.00225,-.00225,-.00225,-.00225,-.00225,-.00225,-.00225,	! 2681
+     *-.00225,-.00225,-.00225,-.00225,-.00225,-.00225,-.00225,-.00225,	! 2682
+     *-.00225,-.00225, .00015, .00015, .00015,-.00010,-.00010,-.00025,	! 2683
+     *-.00025,-.00020,-.00020,-.00020,0./				! 2684
+      DATA (C( 1,N),N=1,9)/						! 2685
+     1         -.2017283E-03, .7710055E+00,-.4918875E-05,-.2008622E-02,	! 2686
+     1          .4495770E+00, .3656158E-07, .4728884E-02, .3770116E-04,	! 2687
+     2          .6548569E+01/						! 2688
+      DATA (C( 2,N),N=1,9)/						! 2689
+     1         -.2019152E-03, .7709387E+00,-.4915766E-05,-.2007672E-02,	! 2690
+     1          .4496149E+00, .3652747E-07, .4725372E-02, .3768380E-04,	! 2691
+     2          .6548196E+01/						! 2692
+      DATA (C( 3,N),N=1,9)/						! 2693
+     1         -.2021021E-03, .7708719E+00,-.4912657E-05,-.2006722E-02,	! 2694
+     1          .4496524E+00, .3649331E-07, .4721864E-02, .3766645E-04,	! 2695
+     2          .6547823E+01/						! 2696
+      DATA (C( 4,N),N=1,9)/						! 2697
+     1         -.2022889E-03, .7708051E+00,-.4909550E-05,-.2005772E-02,	! 2698
+     1          .4496897E+00, .3645911E-07, .4718360E-02, .3764911E-04,	! 2699
+     2          .6547449E+01/						! 2700
+      DATA (C( 5,N),N=1,9)/						! 2701
+     1         -.2024757E-03, .7707383E+00,-.4906444E-05,-.2004821E-02,	! 2702
+     1          .4497267E+00, .3642486E-07, .4714860E-02, .3763177E-04,	! 2703
+     2          .6547076E+01/						! 2704
+      DATA (C( 6,N),N=1,9)/						! 2705
+     1         -.2026624E-03, .7706715E+00,-.4903338E-05,-.2003869E-02,	! 2706
+     1          .4497634E+00, .3639055E-07, .4711363E-02, .3761443E-04,	! 2707
+     2          .6546703E+01/						! 2708
+      DATA (C( 7,N),N=1,9)/						! 2709
+     1         -.2028490E-03, .7706047E+00,-.4900234E-05,-.2002918E-02,	! 2710
+     1          .4497997E+00, .3635621E-07, .4707871E-02, .3759710E-04,	! 2711
+     2          .6546329E+01/						! 2712
+      DATA (C( 8,N),N=1,9)/						! 2713
+     1         -.2030356E-03, .7705380E+00,-.4897130E-05,-.2001966E-02,	! 2714
+     1          .4498358E+00, .3632181E-07, .4704383E-02, .3757977E-04,	! 2715
+     2          .6545956E+01/						! 2716
+      DATA (C( 9,N),N=1,9)/						! 2717
+     1         -.2032221E-03, .7704712E+00,-.4894028E-05,-.2001014E-02,	! 2718
+     1          .4498716E+00, .3628736E-07, .4700898E-02, .3756245E-04,	! 2719
+     2          .6545583E+01/						! 2720
+      DATA (C(10,N),N=1,9)/						! 2721
+     1         -.2034085E-03, .7704045E+00,-.4890926E-05,-.2000061E-02,	! 2722
+     1          .4499071E+00, .3625287E-07, .4697418E-02, .3754514E-04,	! 2723
+     2          .6545209E+01/						! 2724
+      DATA (C(11,N),N=1,9)/						! 2725
+     1         -.2036182E-03, .7703294E+00,-.4887438E-05,-.1998989E-02,	! 2726
+     1          .4499466E+00, .3621401E-07, .4693507E-02, .3752566E-04,	! 2727
+     2          .6544789E+01/						! 2728
+      DATA (C(12,N),N=1,9)/						! 2729
+     1         -.2038743E-03, .7702377E+00,-.4883176E-05,-.1997678E-02,	! 2730
+     1          .4499945E+00, .3616642E-07, .4688734E-02, .3750187E-04,	! 2731
+     2          .6544276E+01/						! 2732
+      DATA (C(13,N),N=1,9)/						! 2733
+     1         -.2041769E-03, .7701293E+00,-.4878142E-05,-.1996128E-02,	! 2734
+     1          .4500503E+00, .3611007E-07, .4683103E-02, .3747376E-04,	! 2735
+     2          .6543669E+01/						! 2736
+      DATA (C(14,N),N=1,9)/						! 2737
+     1         -.2045258E-03, .7700043E+00,-.4872336E-05,-.1994338E-02,	! 2738
+     1          .4501137E+00, .3604489E-07, .4676619E-02, .3744135E-04,	! 2739
+     2          .6542968E+01/						! 2740
+      DATA (C(15,N),N=1,9)/						! 2741
+     1         -.2049441E-03, .7698544E+00,-.4865374E-05,-.1992189E-02,	! 2742
+     1          .4501885E+00, .3596645E-07, .4668857E-02, .3740247E-04,	! 2743
+     2          .6542128E+01/						! 2744
+      DATA (C(16,N),N=1,9)/						! 2745
+     1         -.2054550E-03, .7696712E+00,-.4856871E-05,-.1989560E-02,	! 2746
+     1          .4502778E+00, .3587025E-07, .4659397E-02, .3735500E-04,	! 2747
+     2          .6541100E+01/						! 2748
+      DATA (C(17,N),N=1,9)/						! 2749
+     1         -.2061045E-03, .7694382E+00,-.4846060E-05,-.1986211E-02,	! 2750
+     1          .4503884E+00, .3574728E-07, .4647401E-02, .3729463E-04,	! 2751
+     2          .6539793E+01/						! 2752
+      DATA (C(18,N),N=1,9)/						! 2753
+     1         -.1629093E-03, .7811063E+00,-.5282466E-05,-.2324422E-02,	! 2754
+     1          .7177684E+00, .4946791E-07, .5152206E-02, .3861644E-04,	! 2755
+     2          .6613048E+01/						! 2756
+      DATA (C(19,N),N=1,9)/						! 2757
+     1         -.1645366E-03, .7805728E+00,-.5255967E-05,-.2315935E-02,	! 2758
+     1          .7082405E+00, .4927405E-07, .5132079E-02, .3850946E-04,	! 2759
+     2          .6610456E+01/						! 2760
+      DATA (C(20,N),N=1,9)/						! 2761
+     1         -.1671881E-03, .7797018E+00,-.5212693E-05,-.2302030E-02,	! 2762
+     1          .6921882E+00, .4895038E-07, .5099609E-02, .3833500E-04,	! 2763
+     2          .6606212E+01/						! 2764
+      DATA (C(21,N),N=1,9)/						! 2765
+     1         -.1447954E-03, .7840290E+00,-.5507283E-05,-.2469817E-02,	! 2766
+     1          .5823823E+00, .5786840E-07, .6147739E-02, .3922164E-04,	! 2767
+     2          .6637359E+01/						! 2768
+      DATA (C(22,N),N=1,9)/						! 2769
+     1         -.1356332E-03, .7854813E+00,-.5641448E-05,-.2546893E-02,	! 2770
+     1          .3319438E+00, .6384623E-07, .6990543E-02, .3953988E-04,	! 2771
+     2          .6652626E+01/						! 2772
+      DATA (C(23,N),N=1,9)/						! 2773
+     1         -.1289633E-03, .7859899E+00,-.5750134E-05,-.2609364E-02,	! 2774
+     1         -.2227097E+00, .7043575E-07, .7961671E-02, .3998952E-04,	! 2775
+     2          .6664665E+01/						! 2776
+      DATA (C(24,N),N=1,9)/						! 2777
+     1         -.1422700E-03, .7819175E+00,-.5540261E-05,-.2539449E-02,	! 2778
+     1         -.1417770E+01, .6943923E-07, .7901023E-02, .3952927E-04,	! 2779
+     2          .6646847E+01/						! 2780
+      DATA (C(25,N),N=1,9)/						! 2781
+     1         -.1576122E-03, .7772468E+00,-.5293956E-05,-.2457059E-02,	! 2782
+     1         -.3896984E+01, .6802500E-07, .7840945E-02, .3896220E-04,	! 2783
+     2          .6626305E+01/						! 2784
+      DATA (C(26,N),N=1,9)/						! 2785
+     1         -.1734919E-03, .7722991E+00,-.5034400E-05,-.2370115E-02,	! 2786
+     1         -.5751618E+01, .6623761E-07, .7797404E-02, .3842858E-04,	! 2787
+     2          .6604176E+01/						! 2788
+      DATA (C(27,N),N=1,9)/						! 2789
+     1         -.1889668E-03, .7674361E+00,-.4777494E-05,-.2283773E-02,	! 2790
+     1         -.7821981E+01, .6415805E-07, .7773554E-02, .3792553E-04,	! 2791
+     2          .6582285E+01/						! 2792
+
+* for entry STATE include compression effects ( depth passed throuugh "m" )
+	use_k = .TRUE.
+	GOTO 100
+
+* for entry STATED REFERENCE DENSITY TO SURFACE ( depth m = 1 always )
+	ENTRY STATED ( temp, mtemp, salt, msalt, rho, mrho )
+	use_k = .FALSE.	
+	m=1								! 2811
+
+* flag for bad/missing data
+ 100	bad_temp = mr_bad_data( mtemp )
+	bad_salt = mr_bad_data( msalt )
+	bad_rho  = mr_bad_data( mrho )
+
+	DO 1000 l = mr_lo_s4(mrho), mr_hi_s4(mrho)
+	DO 1000 k = mr_lo_s3(mrho), mr_hi_s3(mrho)
+	IF ( use_k ) m = k
+
+	DO 120 j = mr_lo_s2(mrho), mr_hi_s2(mrho)
+	DO 120 i = mr_lo_s1(mrho), mr_hi_s1(mrho)		! 2813 mod
+
+	IF ( temp(i,j,k,l) .EQ. bad_temp
+     .	.OR. salt(i,j,k,l) .EQ. bad_salt ) THEN
+	   rho(i,j,k,l) = bad_rho
+	   GOTO 120
+	ENDIF
+
+      TQ = temp(i,j,k,l) - TO(M)				! 2814 mod
+      SQ = salt(i,j,k,l) - SO(M)				! 2815 mod
+      RHO(i,j,k,l)=( C(M,1) + (C(M,4) + C(M,7)* SQ ) * SQ	! 2816 mod
+     1+( C(M,3) + C(M,8)*SQ + C(M,6)*TQ ) * TQ )		! 2817 mod
+     2*TQ + ( C(M,2) + (C(M,5) + C(M,9)				! 2818 mod
+     3*SQ)*SQ)*SQ						! 2819 mod
+ 120  CONTINUE								! 2820
+ 1000	CONTINUE
+
+      RETURN								! 2821
+	END
+
diff --git a/fer/ocn/u_from_psi.F b/fer/ocn/u_from_psi.F
new file mode 100644
index 0000000..92cb9e2
--- /dev/null
+++ b/fer/ocn/u_from_psi.F
@@ -0,0 +1,133 @@
+	SUBROUTINE U_FROM_PSI (	psi , mpsi ,
+     .				uavz, muavz,
+     .				vavz, mvavz )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute vertically averaged components of velocity from transport stream fcn
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/20/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mpsi, muavz, mvavz
+
+* subscript ranges from memory variable table ...
+	REAL     psi( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		uavz( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit ),
+     .		vavz( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, l
+	REAL	bad_psi, bad_uavz, bad_vavz,
+     .		diag1, diag2
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(muavz)
+	i_hi = mr_hi_s1(muavz)
+	j_lo = mr_lo_s2(muavz)
+	j_hi = mr_hi_s2(muavz)
+
+* flag for bad/missing data
+	bad_psi  = mr_bad_data( mpsi  )
+	bad_uavz = mr_bad_data( muavz )
+	bad_vavz = mr_bad_data( mvavz )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+*  129       C   COMPUTE EXTERNAL MODE VELOCITIES FOR ROW J+1 AND TWO TIME LEVELS
+*  137             DO 155 I=1,IMTM1
+*  138             DIAG1=P (I+1,J+2)-P (I,J+1)
+*  139             DIAG2=P (I,J+2)-P (I+1,J+1)
+*  140             SFU (I)=-(DIAG1+DIAG2)*DYU2R(J+1)*HR(I,J+1)
+*  141             SFV(I)=(DIAG1-DIAG2)*DXU2R(I)*HR(I,J+1)*CSR(J+1)
+*  142        155  CONTINUE
+* ******************************************************************
+	DO 2000 l = mr_lo_s4(muavz), mr_hi_s4(muavz)
+
+	DO 155 j = j_lo, j_hi
+	DO 155 i = i_lo, i_hi
+* ... cant compute derivatives at fringes of full grid
+	   IF ( i .EQ. im .OR. j .EQ. jm ) THEN
+	      uavz(i,j,l) = bad_uavz
+	      vavz(i,j,l) = bad_vavz
+	      GOTO 155
+	   ENDIF
+
+	   IF ( psi(i  ,j  ,l) .EQ. bad_psi
+     .	    .OR.psi(i+1,j  ,l) .EQ. bad_psi
+     .	    .OR.psi(i+1,j+1,l) .EQ. bad_psi
+     .	    .OR.psi(i  ,j+1,l) .EQ. bad_psi) THEN
+	      uavz(i,j,l) = bad_uavz
+	      vavz(i,j,l) = bad_vavz
+	   ELSE
+	      diag1=psi(i+1,j+1,l) - psi(i  ,j,l)
+	      diag2=psi(i  ,j+1,l) - psi(i+1,j,l)
+	      uavz(i,j,l) = -(diag1+diag2) * dyu2r(j) * hr
+	      vavz(i,j,l) =  (diag1-diag2) * dxu2r(i) * hr * csr(j)
+	   ENDIF
+ 155	CONTINUE
+
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/vel_adv_ew.F b/fer/ocn/vel_adv_ew.F
new file mode 100644
index 0000000..467ccab
--- /dev/null
+++ b/fer/ocn/vel_adv_ew.F
@@ -0,0 +1,161 @@
+	SUBROUTINE  VEL_ADV_EW ( fuw , mfuw,
+     .				 u   , mu  ,
+     .				 uadx, muadx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute zonal advection of velocity components
+* note: the identical code applies to both U and V
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/23/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 4/14/87 - converted incorrect flux-form calculation to
+*			   true advection
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mfuw, mu, muadx
+
+* subscript ranges from memory variable table ...
+	REAL     fuw( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   u( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		uadx( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_u, bad_fuw, dqudx, qdudx
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(muadx)
+	i_hi = mr_hi_s1(muadx)
+	j_lo = mr_lo_s2(muadx)
+	j_hi = mr_hi_s2(muadx)
+
+* flag for bad/missing data
+	bad_u   = mr_bad_data( mu )
+	bad_fuw = mr_bad_data( mfuw )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 282 C   COMPUTE EFFECT OF HORIZONTAL ADVECTION IN MOMENTUM EQUATIONS
+* 283 C
+* 284       DO 300 K=1,KM
+* 285       DO 300 I=1,IMT
+* 286       TEMP2D(I,K)=FUW(I+1,K)*(U(I+1,K)+U(I,K))
+* 287  300  CONTINUE
+* 288       DO 303 K=1,KM
+* 289       DO 303 I=1,IMT
+* 290       UA(I,K)=(TEMP2D(I-1,K)-TEMP2D(I,K))*DXU2R2D(I,K)
+* 291  303  CONTINUE
+
+* 297       DO 310 K=1,KM
+* 298       DO 310 I=1,IMT
+* 299       TEMP2D(I,K)=FUW(I+1,K)*(V(I+1,K)+V(I,K))
+* 300  310  CONTINUE
+* 301       DO 313 K=1,KM
+* 302       DO 313 I=1,IMT
+* 303       VA(I,K)=(TEMP2D(I-1,K)-TEMP2D(I,K))*DXU2R2D(I,K)
+* 304  313  CONTINUE
+*************************************************************************
+	DO 2000 l = mr_lo_s4(muadx), mr_hi_s4(muadx)
+	DO 2000 k = mr_lo_s3(muadx), mr_hi_s3(muadx)
+
+	DO 300 j = j_lo, j_hi
+
+* to save half of the additions ...
+*	   IF ( i .NE. 1 ) tempim1 = fuw(i,j,k,l) * (u(i,j,k,l)+u(i-1,j,k,l))
+
+	DO 300 i = i_lo, i_hi
+
+	   IF ( i .EQ. 1 .OR. i .EQ. im ) THEN
+	      uadx(i,j,k,l) = bad_val4
+	      GOTO 300
+	   ENDIF
+
+	   IF ( u(i-1,j,k,l) .EQ. bad_u
+     .	    .OR.u(i  ,j,k,l) .EQ. bad_u
+     .	    .OR.u(i+1,j,k,l) .EQ. bad_u
+     .	    .OR.fuw(i  ,j,k,l) .EQ. bad_fuw
+     .	    .OR.fuw(i+1,j,k,l) .EQ. bad_fuw ) THEN
+  
+	      uadx(i,j,k,l) = bad_val4
+
+	   ELSE
+
+! temp - future performance:  tempi = fuw(i+1,j,k,l) * (u(i+1,j,k,l)+u(i,j,k,l))
+
+* flux-form calculation: compute +d/dx(QU) ( where "Q" may be "U" or "V" )
+	      dqudx = ( fuw(i+1,j,k,l) * (u(i+1,j,k,l)+u(i,j,k,l)) 
+     .		    -   fuw(i  ,j,k,l) * (u(i,j,k,l)+u(i-1,j,k,l)) ) * dxu2r(i)
+
+* compute +Q*d/dx(U)
+	      qdudx = u(i,j,k,l) * (fuw(i+1,j,k,l) - fuw(i,j,k,l)) * dxur(i)
+
+* compute -U*d/dx(Q) = Q*d/dx(U) - d/dx(QU)
+	      uadx(i,j,k,l) = ( qdudx - dqudx ) * cmonthly
+
+	   ENDIF
+
+ 300	CONTINUE
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/vel_adv_ns.F b/fer/ocn/vel_adv_ns.F
new file mode 100644
index 0000000..bb3179b
--- /dev/null
+++ b/fer/ocn/vel_adv_ns.F
@@ -0,0 +1,153 @@
+	SUBROUTINE  VEL_ADV_NS ( fvn , mfvn,
+     .				 v   , mv  ,
+     .				 vady, mvady )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute meridional advection of velocity components
+* note: the identical code applies to both U and V
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/23/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 4/14/87 - converted incorrect flux-form calculation to
+*			   true advection
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mfvn, mv, mvady
+
+* subscript ranges from memory variable table ...
+	REAL     fvn( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   v( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		vady( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_v, bad_fvn, factor, dQVdy, QdVdy, fvst_ij
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mvady)
+	i_hi = mr_hi_s1(mvady)
+	j_lo = mr_lo_s2(mvady)
+	j_hi = mr_hi_s2(mvady)
+
+* flag for bad/missing data
+	bad_v   = mr_bad_data( mv )
+	bad_fvn = mr_bad_data( mfvn )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 282       C   COMPUTE EFFECT OF HORIZONTAL ADVECTION IN MOMENTUM EQUATIONS
+
+* 292       DO 305 K=1,KM
+* 293       DO 305 I=1,IMT
+* 294       UA(I,K)=UA(I,K)
+* 295      2 -FVN(I,K)*(UP(I,K)+U(I,K))+FVSU(I,K)*(U(I,K)+UM(I,K))
+* 296  305  CONTINUE
+
+* 305       DO 315 K=1,KM
+* 306       DO 315 I=1,IMT
+* 307       VA(I,K)=VA(I,K)
+* 308      2 -FVN(I,K)*(VP(I,K)+V(I,K))+FVSU(I,K)*(V(I,K)+VM(I,K))
+* 309  315  CONTINUE
+*************************************************************************
+
+	DO 305 j = j_lo, j_hi
+
+	   IF ( j .GT. 1 ) factor = cs(j-1) * dyu(j-1) * csr(j) * dyur(j)
+
+	DO 305 l = mr_lo_s4(mvady), mr_hi_s4(mvady)
+	DO 305 k = mr_lo_s3(mvady), mr_hi_s3(mvady)
+	DO 305 i = i_lo, i_hi
+
+	   IF ( j .EQ. 1 .OR. j .EQ. jm ) THEN
+	      vady(i,j,k,l) = bad_val4
+	      GOTO 305
+	   ENDIF
+
+	   IF ( v(i,j-1,k,l) .EQ. bad_v
+     .	    .OR.v(i,j  ,k,l) .EQ. bad_v
+     .	    .OR.v(i,j+1,k,l) .EQ. bad_v
+     .	    .OR.fvn(i,j  ,k,l) .EQ. bad_fvn
+     .	    .OR.fvn(i,j-1,k,l) .EQ. bad_fvn ) THEN
+  
+	      vady(i,j,k,l) = bad_val4
+
+	   ELSE
+
+* flux-form calculation ( note 1/dy imbedded in FVN )
+* "Q" may be "U" or "V"
+	      fvst_ij = fvn(i,j-1,k,l) * factor
+	      dQVdy   =( fvn(i,j,k,l) * (v(i,j+1,k,l)+v(i,j,k,l  ))
+     .		       - fvst_ij      * (v(i,j,k,l  )+v(i,j-1,k,l)) )
+
+* compute Q*d/dy(V)
+	      QdVdy = v(i,j,k,l) * ( fvn(i,j,k,l) - fvst_ij ) * 2.0
+
+* compute -Vd/dy(Q) = Qd/dy(V) - d/dy(QV)
+	      vady(i,j,k,l) = ( QdVdy - dQVdy ) * cmonthly
+
+	   ENDIF
+
+ 305	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/vel_adv_z.F b/fer/ocn/vel_adv_z.F
new file mode 100644
index 0000000..6e06c14
--- /dev/null
+++ b/fer/ocn/vel_adv_z.F
@@ -0,0 +1,168 @@
+	SUBROUTINE  VEL_ADV_Z (	uk  , muk  ,
+     .				wk  , mwk  ,
+     .				uadz, muadz )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute vertical advection of velocity components
+* note: the identical code applies to both U and V
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/23/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 4/13/87 - corrected dz(1) --> dz(k)
+*			   and corrected flux form to true z advection
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* Linux Port 1/97 *kob* - Added a preprocessor include for xgfdl_masks.cmn
+*			  because it needed a preprocessor.
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+#	include "xgfdl_masks.cmn"
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XGFDL_MASKS.CMN'
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	muk, mwk, muadz
+
+* subscript ranges from memory variable table ...
+	REAL      uk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		  wk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		uadz( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_u, bad_w, factor, up, down, dwudz, udwdz
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(muadz)
+	i_hi = mr_hi_s1(muadz)
+	j_lo = mr_lo_s2(muadz)
+	j_hi = mr_hi_s2(muadz)
+
+* flag for bad/missing data
+	bad_u = mr_bad_data( muk )
+	bad_w = mr_bad_data( mwk )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 352 C   ADD IN VERTICAL ADVECTION AND VERTICAL DIFFUSION
+* 353 C
+* 354       DO 340 K=1,KMP1
+* 355       DO 340 I=1,IMT
+* 356       TEMP2D(I,K)=W(I,K)*(U(I,K-1)+U(I,K))
+* 357  340  CONTINUE
+* 358       DO 343 K=1,KM
+* 359       DO 343 I=1,IMT
+* 360       UA(I,K)=UA(I,K)+(TEMP2D(I,K+1)-TEMP2D(I,K))*DZ2R2D(I,K)
+* 361  343  CONTINUE
+
+* 371       DO 350 K=1,KMP1
+* 372       DO 350 I=1,IMT
+* 373       TEMP2D(I,K)=W(I,K)*(V(I,K-1)+V(I,K))
+* 374  350  CONTINUE
+* 375       DO 353 K=1,KM
+* 376       DO 353 I=1,IMT
+* 377  353  VA(I,K)=VA(I,K)+(TEMP2D(I,K+1)-TEMP2D(I,K))*DZ2R2D(I,K)
+*************************************************************************
+	DO 2000 l = mr_lo_s4(muadz), mr_hi_s4(muadz)
+	DO 2000 k = mr_lo_s3(muadz), mr_hi_s3(muadz)
+
+* note: k subscripting is offset by one in this code as compared to the 205 code
+*	because w(0) = 0. in this code whereas w(1)=0 in the 205 version
+
+	factor = (1. / dz(k)) * cmonthly
+
+	DO 340 j = j_lo, j_hi
+	DO 340 i = i_lo, i_hi
+
+	   IF ( uk(i,j,k,l) .EQ. bad_u
+     .	    .OR.wk(i,j,k,l) .EQ. bad_w ) THEN
+
+	      uadz(i,j,k,l) = bad_val4
+	      GOTO 340
+	   ENDIF
+
+* calculate flux form ( as in 205 code ): d/dz(WU)
+	   IF ( k .GT. 1 ) THEN
+	      up = wk(i,j,k-1,l) * ( uk(i,j,k-1,l) + uk(i,j,k,l) ) / 2
+	   ELSE
+	      up = 0.0
+	   ENDIF
+
+	   IF ( k .LT. kmu(i,j) ) THEN
+	      down = wk(i,j,k,l) * ( uk(i,j,k,l) + uk(i,j,k+1,l) ) / 2
+	   ELSE
+	      down = 0.0
+	   ENDIF
+
+	   dwudz = ( up - down ) * factor
+
+* calculate U*d/dz(W)
+	   IF ( k .EQ. 1 ) THEN
+	      udwdz = uk(i,j,k,l) * (     0.0       - wk(i,j,k,l) ) * factor
+	   ELSE
+	      udwdz = uk(i,j,k,l) * ( wk(i,j,k-1,l) - wk(i,j,k,l) ) * factor
+	   ENDIF
+
+* note: actually we need to calculate the negative: -W*d/dz(U)
+* subtract to get -W*d/dz(U) = U*d/dz(W) - d/dz(WU)
+	   uadz(i,j,k,l) = udwdz - dwudz
+
+ 340	CONTINUE
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/vel_by_grad_p.F b/fer/ocn/vel_by_grad_p.F
new file mode 100644
index 0000000..f02495b
--- /dev/null
+++ b/fer/ocn/vel_by_grad_p.F
@@ -0,0 +1,115 @@
+	SUBROUTINE  VEL_BY_GRAD_P( dpdx, mdpdx,
+     .				   ubp, mubp )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute contribution to velocity from GRAD(Pclinic)
+* essentially this routine performs only a change of units from sec-1 to month-1
+* note1: the same code applies to both X and Y components
+* note2: a value of rho=1 is assumed for dimensional correctness
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/26/87 
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mdpdx, mubp
+
+* subscript ranges from memory variable table ...
+	REAL    dpdx( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		 ubp( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit )
+
+* internal variable declarations:
+	INTEGER	MGRID_SIZE, grid_size
+	REAL	factor
+
+* --- end of introductory code ---
+
+* total words in result grid
+	grid_size = MGRID_SIZE( mubp )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 406 C   ADD IN PRESSURE TERM AND ZERO OUT LAND
+
+* 417       DO 360 K=1,KM
+* 418       DO 360 I=1,IMT
+* 419       UA(I,K)=GM(I,K)*((UA(I,K)-DPDX(I,K)
+* 420      * +TEMP(I,K)*U(I,K)-
+* 421      *  TEMP2D(I,K)*DXU2R2D(I,K)*(V(I+1,K)-V(I-1,K))))
+* 422  360  CONTINUE
+* 423       DO 370 K=1,KM
+* 424       DO 370 I=1,IMT
+* 425       VA(I,K)=GM(I,K)*((VA(I,K)-DPDY(I,K)
+* 426      * +TEMP(I,K)*V(I,K)+
+* 427      *  TEMP2D(I,K)*DXU2R2D(I,K)*(U(I+1,K)-U(I-1,K))))
+* 428  370  CONTINUE
+*************************************************************************
+* in the 205 code the effectd of DPDX are simple subtracted from UA
+
+* change the sign from how it is used in the 205 code so that all of the
+* incremental pieces get added together to form the velocity increment
+	factor = -1. * cmonthly
+
+	CALL COPY_GRID( dpdx, mdpdx, ubp, mubp )
+
+	CALL MULT_GRID( grid_size, ubp, factor )
+
+	RETURN
+
+	END
diff --git a/fer/ocn/vel_by_wind.F b/fer/ocn/vel_by_wind.F
new file mode 100644
index 0000000..42d3676
--- /dev/null
+++ b/fer/ocn/vel_by_wind.F
@@ -0,0 +1,140 @@
+	SUBROUTINE  VEL_BY_WIND(  tau, mtau,
+     .				 ubwi, mubwi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute contribution to velocity in surface layer due to wind stress
+* note1: the same code applies to both X and Y components
+* note2: a value of rho=1 is assumed for dimensional correctness
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/23/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to bypass th fudging of wind
+*			stress effects into the diffusion terms
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mtau, mubwi
+
+* subscript ranges from memory variable table ...
+	REAL     tau( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		ubwi( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit )
+
+* internal variable declarations:
+	INTEGER	MGRID_SIZE, grid_size
+	REAL	factor
+
+* --- end of introductory code ---
+
+* total words in result grid
+	grid_size = MGRID_SIZE( mubwi )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+*259  C   SET VERTICAL VISCOUS BOUNDARY CONDITIONS
+*260  C
+*261        DO 280 K=1,KM
+*262        DO 280 I=1,IMT
+*263        UDIF(I,K)=UB(I,K)
+*264        VDIF(I,K)=VB(I,K)
+*265   280  CONTINUE
+*266        TAPER=1.
+*267        IF(ITT*DTUV.LE.TAPLEN*86400.) TAPER=0.5*(1.-COS(PI*
+*268       1(ITT*DTUV/(TAPLEN*86400.))))
+*269        TFAC1=(MOD(ITT-1,NTS30)+1.)/FLOAT(NTS30)
+*270        TFAC2=1.-TFAC1
+*271        DO 290 I=1,IMT
+*272        FACTOR=(DZZ(1)/BVVC(I))*TAPER
+*273        UOVER(I)=UB(I,1)+(WSX(I)*TFAC2+TX(I)*TFAC1)*FACTOR
+*274        VOVER(I)=VB(I,1)+(WSY(I)*TFAC2+TY(I)*TFAC1)*FACTOR
+*275   290  CONTINUE
+
+*362        DO 345 K=1,KMP1
+*363        DO 345 I=1,IMT
+*364        TEMP2D(I,K)=UDIF(I,K-1)-UDIF(I,K)
+*365   345  CONTINUE
+*366        DO 348 K=1,KM
+*367        DO 348 I=1,IMT
+*368        UA(I,K)=UA(I,K)+EEM2D(I,K)*VVC(I,K-1)*TEMP2D(I,K)-
+*369       * FFM2D(I,K)*VVC(I,K)*TEMP2D(I,K+1)
+*370   348  CONTINUE
+	
+*378        DO 355 K=1,KMP1
+*379        DO 355 I=1,IMT
+*380        TEMP2D(I,K)=VDIF(I,K-1)-VDIF(I,K)
+*381   355  CONTINUE
+*382        DO 356 K=1,KM
+*383        DO 356 I=1,IMT
+*384        VA(I,K)=VA(I,K)+EEM2D(I,K)*VVC(I,K-1)*TEMP2D(I,K)-
+*385       * FFM2D(I,K)*VVC(I,K)*TEMP2D(I,K+1)
+*386   356  CONTINUE
+*************************************************************************
+
+* when all the fudging is done the entire contribution of wind stress reduces
+* to TAUi / dz(1)
+* factor also converts to units of cm/sec per month (730 hours )
+
+	factor = ( 1. / dz(1) ) * cmonthly
+
+	CALL COPY_GRID( tau, mtau, ubwi, mubwi )
+
+	CALL MULT_GRID( grid_size, ubwi, factor )
+
+	RETURN
+
+	END
diff --git a/fer/ocn/vel_dif_xy.F b/fer/ocn/vel_dif_xy.F
new file mode 100644
index 0000000..99868fa
--- /dev/null
+++ b/fer/ocn/vel_dif_xy.F
@@ -0,0 +1,236 @@
+	SUBROUTINE  VEL_DIF_XY(	u     , mu     ,
+     .				v     , mv     ,
+     .				udfh  , mudfh	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute horizontal diffusion of velocity components
+* note: the identical code applies to both U and V
+* ! temp - this is very inefficient code (as is XY_HDIFFUS) that could be
+*	greatly sped up by pre-computation of coefficients
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 1/26/87 - extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 7/2/88  - added Am_factor
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+	include 'xdset_parms.cmn'	! with am_factor
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'	! with maxdsets
+	INCLUDE 'FERRET_CMN:XDSET_PARMS.CMN'	! with Am_factor
+#endif
+
+* calling argument declarations:
+	INTEGER	mu, mv, mudfh
+
+* subscript ranges from memory variable table ...
+	REAL       u( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   v( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		udfh( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	LOGICAL	HOURLY_DATA
+	INTEGER	i_lo, i_hi, j_lo, j_hi, k_lo, k_hi, l_lo, l_hi,
+     .		i, j, k, l, dl, lb4
+	REAL	bad_u, ccuj, dduj, gguj, hhuj, ew, ns, rest
+
+	REAL	aauj(im), bbuj(im)
+	EQUIVALENCE ( aauj(1), aatj(1) ) ,
+     .		    ( bbuj(1), bbtj(1) )	! space saving
+
+* --- end of introductory code ---
+* use 1 hour separation for exact results on hourly data
+	IF ( HOURLY_DATA(mr_grid(mudfh)) ) THEN
+	   dl = -1
+	ELSE
+	   dl = 0
+	ENDIF
+
+* limits for calculation
+	i_lo = mr_lo_s1(mudfh)
+	i_hi = mr_hi_s1(mudfh)
+	j_lo = mr_lo_s2(mudfh)
+	j_hi = mr_hi_s2(mudfh)
+	k_lo = mr_lo_s3(mudfh)
+	k_hi = mr_hi_s3(mudfh)
+	l_lo = mr_lo_s4(mudfh)
+	l_hi = mr_hi_s4(mudfh)
+
+* flag for bad/missing data
+	bad_u = mr_bad_data( mu )
+
+* Am coefficient (scaled by 10**7)
+	Am = 1.E7 * dp_Am_factor( mr_data_set(mu) )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 311 C   ADD IN HORIZONTAL VISCOUS EFFECTS
+* 312 C
+* 313 C     VARIABLE LATERAL FRICTION
+* 314 C
+* 315       CCUJ=AM*CST(J+1)*DYTR(J+1)*DYUR(J)*CSR(J)*XJT(J+1)
+* 316       DDUJ=AM*CST(J  )*DYTR(J  )*DYUR(J)*CSR(J)*XJT(J)
+* 317       DO 322 I=1,IMT
+* 318       AAUJ(I)=AM*DXUR(I)*DXTR(I+1)*CSR(J)*CSR(J)*XIT(I+1)*XJV(J)
+* 319       BBUJ(I)=AM*DXUR(I)*DXTR(I  )*CSR(J)*CSR(J)*XIT(I)*XJV(J)
+* 320       C(I)=CCUJ*XIV(I)
+* 321       D(I)=DDUJ*XIV(I)
+* 322   322 CONTINUE
+* 323 C
+* 324       DO 3222 K=1,KM
+* 325       DO 3222 I=1,IMT
+* 326       ATJ(I,K)=AAUJ(I)
+* 327       BTJ(I,K)=BBUJ(I)
+* 328       TEMP2D(I,K)=C(I)
+* 329 3222  TEMP(I,K)=D(I)
+* 330 C
+* 331       DO 320 K=1,KM
+* 332       DO 320 I=1,IMT
+* 333       UA(I,K)=UA(I,K)+ATJ(I,K)*(UB(I+1,K)-UB(I,K))-BTJ(I,K)*
+* 334      *(UB(I,K)-UB(I-1,K))
+* 335  320  CONTINUE
+* 336       DO 323 K=1,KM
+* 337       DO 323 I=1,IMT
+* 338       UA(I,K)=UA(I,K)+TEMP2D(I,K)*(UBP(I,K)-UB(I,K))-TEMP(I,K)*
+* 339      * (UB(I,K)-UBM(I,K))
+* 340  323  CONTINUE
+* 341       DO 330 K=1,KM
+* 342       DO 330 I=1,IMT
+* 343       VA(I,K)=VA(I,K)+ATJ(I,K)*(VB(I+1,K)-VB(I,K))-BTJ(I,K)*
+* 344      *(VB(I,K)-VB(I-1,K))
+* 345  330  CONTINUE
+* 346       DO 333 K=1,KM
+* 347       DO 333 I=1,IMT
+* 348       VA(I,K)=VA(I,K)+TEMP2D(I,K)*(VBP(I,K)-VB(I,K))-TEMP(I,K)*
+* 349      * (VB(I,K)-VBM(I,K))
+* 350  333  CONTINUE
+
+* 408 C     ALSO ADD IN REST OF VARIABLE HORIZONTAL DIFFUSION
+* 409 C
+* 410       GGUJ=AM*(1.0-TNG(J)*TNG(J))/(RADIUS*RADIUS)
+* 411       HHUJ=2.*AM*SINE(J)/(RADIUS*CS(J)*CS(J))
+* 412       DO 3591 K=1,KM
+* 413       DO 3591 I=1,IMT
+* 414       TEMP(I,K)=GGUJ*XIV(I)*XJV(J)
+* 415 3591  TEMP2D(I,K)=HHUJ*XIV(I)*XJV(J)
+* 416 C
+* 417       DO 360 K=1,KM
+* 418       DO 360 I=1,IMT
+* 419       UA(I,K)=GM(I,K)*((UA(I,K)-DPDX(I,K)
+* 420      * +TEMP(I,K)*U(I,K)-
+* 421      *  TEMP2D(I,K)*DXU2R2D(I,K)*(V(I+1,K)-V(I-1,K))))
+* 422  360  CONTINUE
+* 423       DO 370 K=1,KM
+* 424       DO 370 I=1,IMT
+* 425       VA(I,K)=GM(I,K)*((VA(I,K)-DPDY(I,K)
+* 426      * +TEMP(I,K)*V(I,K)+
+* 427      *  TEMP2D(I,K)*DXU2R2D(I,K)*(U(I+1,K)-U(I-1,K))))
+* 428  370  CONTINUE
+*************************************************************************
+
+	DO 320 j = j_lo, j_hi
+
+* pre-compute some coefficients
+	IF ( j .LT. jm ) THEN
+	   ccuj=Am*cst(j+1)*dytr(j+1)*dyur(j)*csr(j)*xjt(j+1)
+	   dduj=Am*cst(j  )*dytr(j  )*dyur(j)*csr(j)*xjt(j)
+	   gguj=Am*(1.0-tng(j)*tng(j))/(radius*radius)
+	   hhuj=2.*Am*sine(j)/(radius*cs(j)*cs(j))
+	ENDIF
+	DO 322 I = i_lo, MIN(i_hi,im-1)
+	   aauj(i)=Am*dxur(i)*dxtr(i+1)*csr(j)*csr(j)*xit(i+1)*xjv(j)
+	   bbuj(i)=Am*dxur(i)*dxtr(i  )*csr(j)*csr(j)*xit(i)*xjv(j)
+ 322	CONTINUE
+
+	DO 320 l = l_lo, l_hi
+* ... some data may be needed from 1 integration step earlier
+	   lb4 = l + dl
+	DO 320 k = k_lo, k_hi
+	DO 320 i = i_lo, i_hi
+
+	   IF ( i .EQ. 1 .OR. i .EQ. im
+     .	  .OR.  j .EQ. 1 .OR. j .EQ. jm ) THEN
+	      udfh(i,j,k,l) = bad_val4
+	      GOTO 320
+	   ENDIF
+
+* V is assumed to have bad points exactly where U does ...
+	   IF ( u(i  ,j  ,k,lb4) .EQ. bad_u
+     .	   .OR. u(i-1,j  ,k,lb4) .EQ. bad_u
+     .	   .OR. u(i+1,j  ,k,lb4) .EQ. bad_u
+     .	   .OR. u(i  ,j-1,k,lb4) .EQ. bad_u
+     .	   .OR. u(i  ,j+1,k,lb4) .EQ. bad_u ) THEN
+	      udfh(i,j,k,l) = bad_val4
+	      GOTO 320
+
+	   ELSE
+	   ew = ( aauj(i)* (u(i+1,j,k,lb4)-u(i  ,j,k,lb4))
+     .		- bbuj(i)* (u(i  ,j,k,lb4)-u(i-1,j,k,lb4)) )
+	   ns = ( ccuj   * (u(i,j+1,k,lb4)-u(i,j  ,k,lb4))
+     .		- dduj   * (u(i,j  ,k,lb4)-u(i,j-1,k,lb4)) ) * xiv(i)
+	   rest = ( gguj*u(i,j,k,l)
+     .		- hhuj*dxu2r(i)*(v(i+1,j,k,l)-v(i-1,j,k,l)) )
+     .		* xiv(i) * xjv(j)
+
+	   udfh(i,j,k,l) = ( ew + ns + rest ) * cmonthly
+
+	   ENDIF
+
+ 320	CONTINUE
+	RETURN
+
+	END
diff --git a/fer/ocn/vel_dif_z.F b/fer/ocn/vel_dif_z.F
new file mode 100644
index 0000000..571edc7
--- /dev/null
+++ b/fer/ocn/vel_dif_z.F
@@ -0,0 +1,186 @@
+	SUBROUTINE  VEL_DIF_Z (	cdz  , mcdz  ,
+     .				u    , mu    ,
+     .				ubwi , mubwi  ,
+     .				udfz , mudfz    )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute vertical diffusion of velocity components
+* add wind stress effects if at surface
+* note: the identical code applies to both U and V
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/23/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 6/25/87 - added wind stress contribution at surface
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*	 3/13/90 - fixed bug at k.eq.km
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mcdz, mu, mubwi, mudfz
+
+* subscript ranges from memory variable table ...
+	REAL     cdz( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   u( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		ubwi( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit ),
+     .		udfz( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit )
+
+* internal variable declarations:
+	LOGICAL HOURLY_DATA, need_wind
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l, dl, lp1
+	REAL	bad_u, bad_cdz, bad_ubwi, up, down
+
+* --- end of introductory code ---
+* use 1 hour separation for exact results on hourly data
+	IF ( HOURLY_DATA(mr_grid(mudfz)) ) THEN
+	   dl = 1
+	ELSE
+	   dl = 0
+	ENDIF
+
+* limits for calculation
+	i_lo = mr_lo_s1(mudfz)
+	i_hi = mr_hi_s1(mudfz)
+	j_lo = mr_lo_s2(mudfz)
+	j_hi = mr_hi_s2(mudfz)
+
+* flag for bad/missing data
+	bad_u    = mr_bad_data( mu )
+	bad_cdz  = mr_bad_data( mcdz )
+	bad_ubwi = mr_bad_data( mubwi )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 261       DO 280 K=1,KM
+* 262       DO 280 I=1,IMT
+* 263       UDIF(I,K)=UB(I,K)
+* 264       VDIF(I,K)=VB(I,K)
+* 265  280  CONTINUE
+
+* 276       DO 295 I=1,IMT
+* 277       KZ=KMU(I)
+* 278       UDIF(I,KZ+1)=UB(I,KZ)
+* 279       VDIF(I,KZ+1)=VB(I,KZ)
+* 280  295  CONTINUE
+
+* 352 C   ADD IN VERTICAL ADVECTION AND VERTICAL DIFFUSION
+
+* 362       DO 345 K=1,KMP1
+* 363       DO 345 I=1,IMT
+* 364       TEMP2D(I,K)=UDIF(I,K-1)-UDIF(I,K)
+* 365  345  CONTINUE
+* 366       DO 348 K=1,KM
+* 367       DO 348 I=1,IMT
+* 368       UA(I,K)=UA(I,K)+EEM2D(I,K)*VVC(I,K-1)*TEMP2D(I,K)-
+* 369      * FFM2D(I,K)*VVC(I,K)*TEMP2D(I,K+1)
+* 370  348  CONTINUE
+
+* 378       DO 355 K=1,KMP1
+* 379       DO 355 I=1,IMT
+* 380       TEMP2D(I,K)=VDIF(I,K-1)-VDIF(I,K)
+* 381  355  CONTINUE
+* 382       DO 356 K=1,KM
+* 383       DO 356 I=1,IMT
+* 384       VA(I,K)=VA(I,K)+EEM2D(I,K)*VVC(I,K-1)*TEMP2D(I,K)-
+* 385      * FFM2D(I,K)*VVC(I,K)*TEMP2D(I,K+1)
+* 386  356  CONTINUE
+*************************************************************************
+	DO 2000 l = mr_lo_s4(mudfz)-dl, mr_hi_s4(mudfz)-dl
+	   lp1 = l + dl
+	DO 2000 k = mr_lo_s3(mudfz), mr_hi_s3(mudfz)
+
+* flag for surface wind effects
+	need_wind = k .EQ. 1
+
+	DO 345 j = j_lo, j_hi
+	DO 345 i = i_lo, i_hi
+
+	   IF (   u(i,j,k,l) .EQ. bad_u
+     .	    .OR.cdz(i,j,k,l) .EQ. bad_cdz ) THEN
+	       udfz(i,j,k,lp1) = bad_val4
+	      GOTO 345
+	   ENDIF
+
+	   IF ( k .GT. 1 ) THEN
+	      up = eem(k) * cdz(i,j,k-1,l) * ( u(i,j,k-1,l) - u(i,j,k,l) )
+	   ELSE
+	      up = 0.0
+	   ENDIF
+
+	   IF ( k .LT. km ) THEN
+	      down = ffm(k) * cdz(i,j,k,l) * ( u(i,j,k,l) - u(i,j,k+1,l) )
+	   ELSE
+	      down = 0.0
+	   ENDIF
+
+	   udfz(i,j,k,lp1) = ( up - down ) * cmonthly
+
+* add wind ?
+	   IF ( need_wind ) THEN
+	      IF ( ubwi(i,j,l) .EQ. bad_ubwi ) THEN
+	         udfz(i,j,1,lp1) = bad_val4
+	      ELSE
+	         udfz(i,j,1,lp1) = udfz(i,j,1,lp1) + ubwi(i,j,l)
+	      ENDIF
+	   ENDIF
+
+ 345	CONTINUE
+ 2000	CONTINUE
+	RETURN
+	END
diff --git a/fer/ocn/w_on_ts.F b/fer/ocn/w_on_ts.F
new file mode 100644
index 0000000..2c88de2
--- /dev/null
+++ b/fer/ocn/w_on_ts.F
@@ -0,0 +1,216 @@
+	SUBROUTINE  W_ON_TS( uk  , muk,
+     .			     vk  , mvk,
+     .			     w_t , mw_t )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute W ( vertical velocity ) on TEMP/SALT columns via zero divergence 
+* condition
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/22/87
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	muk, mvk, mw_t
+
+* subscript ranges from memory variable table ...
+	REAL     uk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		 vk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		w_t( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, k_lo, k_hi, l_lo, l_hi, i, j, k, l
+	REAL	bad_uk, bad_vk, bad_w_t, fact1, fact2, fact3, factor
+	REAL	fvn, fvst, fuw(2:imtp1)
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mw_t)
+	i_hi = mr_hi_s1(mw_t)
+	j_lo = mr_lo_s2(mw_t)
+	j_hi = mr_hi_s2(mw_t)
+	k_lo = mr_lo_s3(mw_t)
+	k_hi = mr_hi_s3(mw_t)
+	l_lo = mr_lo_s4(mw_t)
+	l_hi = mr_hi_s4(mw_t)
+
+* flag for bad/missing data
+	bad_uk   = mr_bad_data( muk )
+	bad_vk	 = mr_bad_data( mvk )
+	bad_w_t  = mr_bad_data( mw_t )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 2966 C
+* 2967 C   FIND ADVECTIVE COEFFICIENTS FOR WEST AND NORTH FACES OF T,S BOXES
+* 2968 C
+* 2969       FACT1=CSTR(J)*DYTR(J)
+* 2970       FACT2=DYTR(J)*CSTR(J)*CS(J)
+* 2971       DO 690 K=1,KM
+* 2972       DO 690 I=1,IMT
+* 2973       FUW(I,K)=(U(I-1,K)*DYU(J)+UM(I-1,K)*DYU(J-1))*FACT1
+* 2974       FVN(I,K)=(V(I,K)*DXU2D(I,K)+V(I-1,K)*DXU2D(I-1,K))
+* 2975      1 *FACT2*DXT4R2D(I,K)
+* 2976  690  CONTINUE
+* 2977       IF (NERGY.NE.0) W=0.
+* 2978 C
+* 2979 C   COMPUTE VERTICAL VELOCITY IN T,S COLUMNS
+* 2980 C
+* 2981       DO 700 I=1,IMT
+* 2982       W(I,1)=0.0
+* 2983  700  CONTINUE
+* 2984       DO 710 K=1,KM
+* 2985       DO 710 I=1,IMT
+* 2986       W(I,K+1)=C2DZ2D(I,K)*((FUW(I+1,K)-FUW(I,K))*DXT4R2D(I,K)+FVN(I,K)
+* 2987      1    -FVST(I,K))
+* 2988  710  CONTINUE
+* 2989       DO 712 K=1,KM
+* 2990       DO 712 I=1,IMT
+* 2991       W(I,K+1)=W(I,K)+W(I,K+1)
+* 2992  712  CONTINUE
+
+* 3250 C   SET ADVECTIVE COEFFICIENT FOR NEXT CALL
+* 3251 C
+* 3252       FACTOR=CST(J)*DYT(J)*CSTR(J+1)*DYTR(J+1)
+* 3253       DO 990 K=1,KM
+* 3254       DO 990 I=1,IMT
+* 3255       FVST(I,K)=FVN(I,K)*FACTOR
+* 3256  990  CONTINUE
+
+*******************************************************************
+C   COMPUTE VERTICAL VELOCITY IN TEMP/SALT COLUMNS
+* south to north loop through east-west lines
+	DO 1000 j = j_lo, j_hi
+
+	IF ( j .EQ. 1  .OR.  j .EQ. jm ) THEN
+	   DO 100 l = l_lo, l_hi
+	   DO 100 k = k_lo, k_hi
+	   DO 100 i = i_lo, i_hi
+ 100	   w_t(i,j,k,l) = bad_w_t
+	   GOTO 1000
+	ENDIF
+
+C   FIND ADVECTIVE COEFFICIENTS FOR SOUTH AND NORTH FACES OF T,S BOXES	! 2967
+
+      FACT1 = CSTR(j)*DYTR(j)	    				! 2969 mod
+      FACT2 = fact1 * CS(j)	 	   			! 2970 mod
+      fact3 = fact1 * cs(j-1)
+
+      DO 900 l = l_lo, l_hi
+      DO 900 k = k_lo, k_hi
+
+      DO 690 I= MAX(2,i_lo), MIN(imt,i_hi)+1			! 2972 mod
+	IF ( uk(i-1,j  ,k,l) .EQ. bad_uk
+     .  .OR. uk(i-1,j-1,k,l) .EQ. bad_uk ) THEN
+	   fuw(i) = bad_val4
+	ELSE
+           FUW(I)=(Uk(i-1,j,k,l)*DYU(j)+Uk(I-1,j-1,k,l)*DYU(j-1))*FACT1	! 2973 mod
+	ENDIF
+ 690  CONTINUE	    							! 2976
+
+
+C   COMPUTE VERTICAL increment to w VELOCITY IN T,S COLUMNS
+      DO 710 I = MAX(2,i_lo), MIN(imtm1,i_hi)
+	IF ( fuw(i  ) .EQ. bad_val4
+     .  .OR. fuw(i+1) .EQ. bad_val4 ) THEN
+	   w_t(i,j,k,l) = bad_w_t
+
+	ELSEIF ( vk(i  ,j  ,k,l) .EQ. bad_vk
+     .  .OR.     vk(i-1,j  ,k,l) .EQ. bad_vk
+     .	.OR.     vk(i-1,j-1,k,l) .EQ. bad_vk ) THEN
+	   w_t(i,j,k,l) = bad_w_t
+
+	ELSE
+	   FVN  = (Vk(I,j  ,k,l)*DXU(I)+Vk(I-1,j  ,k,l)
+     .				*DXU(I-1))*FACT2*DXT4R(I)		! 2975 
+	   FVST = (Vk(I,j-1,k,l)*DXU(I)+Vk(I-1,j-1,k,l)
+     .				*DXU(I-1))*FACT3*DXT4R(I)
+	   w_t(I,j,k,l)=C2DZ(K)*( (FUW(I+1)-FUW(I))*DXT4R(I) + FVN-FVST )
+	ENDIF
+ 710  CONTINUE
+
+* mask out edges ?
+	IF ( i_lo .EQ. 1   ) w_t(1  ,j,k,l) = bad_w_t
+	IF ( i_hi .EQ. imt ) w_t(imt,j,k,l) = bad_w_t
+
+ 900	CONTINUE
+ 1000	CONTINUE
+
+
+* now add this dW to w's from above
+	DO 255 l = l_lo, l_hi
+	DO 255 k = 2   , k_hi
+	DO 255 j = j_lo, j_hi
+	DO 255 i = i_lo, i_hi
+
+	   IF ( w_t(i,j,k-1,l) .EQ. bad_w_t ) THEN
+
+	      w_t(i,j,k,l) = bad_val4
+
+	   ELSE
+
+	      w_t(i,j,k,l) = w_t(i,j,k-1,l) + w_t(i,j,k,l)
+
+	   ENDIF
+
+ 255	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/w_on_uv.F b/fer/ocn/w_on_uv.F
new file mode 100644
index 0000000..ce5b28d
--- /dev/null
+++ b/fer/ocn/w_on_uv.F
@@ -0,0 +1,170 @@
+	SUBROUTINE  W_ON_UV( ufuw, mufuw,
+     .			     vfvn, mvfvn,
+     .			     w_u , mw_u )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute W ( vertical velocity ) on UV columns via zero divergence condition
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -1/21/87 extracted from SUBROUTINE CLINIC
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mufuw, mvfvn, mw_u
+
+* subscript ranges from memory variable table ...
+	REAL    ufuw( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		vfvn( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		 w_u( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_ufuw, bad_vfvn, bad_w_u, factor
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mw_u)
+	i_hi = mr_hi_s1(mw_u)
+	j_lo = mr_lo_s2(mw_u)
+	j_hi = mr_hi_s2(mw_u)
+
+* flag for bad/missing data
+	bad_ufuw = mr_bad_data( mufuw )
+	bad_vfvn = mr_bad_data( mvfvn )
+	bad_w_u  = mr_bad_data( mw_u )
+
+* ***************************************************************
+* ORIGINAL GFDL 205 CODE UPON WHICH CALCULATION IS BASED
+*
+* 700  C   TRANSFER THINGS IN PREPARATION FOR NEXT CALL
+* 701  C
+* 702        FACTOR=CS(J)*DYU(J)*CSR(J+1)*DYUR(J+1)
+* 703        DO 644 K=1,KM
+* 704        DO 644 I=1,IMT
+* 705        FVSU(I,K)=FVN(I,K)*FACTOR
+* 706   644  CONTINUE
+
+* 214  C   COMPUTE VERTICAL VELOCITY IN U,V COLUMNS
+* 215  C
+* 216        DO 250 K=1,KM
+* 217        DO 250 I=1,IMT
+* 218        W(I,K+1)=C2DZ2D(I,K)*((FUW(I+1,K)-FUW(I,K))*DXU2R2D(I,K)+FVN(I,K)
+* 219       1    -FVSU(I,K))
+* 220   250  CONTINUE
+* 221        DO 255 K=1,KM
+* 222        DO 255 I=1,IMT
+* 223        W(I,K+1)=W(I,K)+W(I,K+1)
+* 224   255  CONTINUE
+*************************************************************************
+	DO 2000 l = mr_lo_s4(mw_u), mr_hi_s4(mw_u)
+	DO 2000 k = mr_lo_s3(mw_u), mr_hi_s3(mw_u)
+
+C   COMPUTE VERTICAL VELOCITY IN U,V COLUMNS
+* first compute incremental dW for this layer
+	DO 250 j = j_lo, j_hi
+	   IF ( j .GT. 1 ) factor = cs(j-1) * dyu(j-1) * csr(j) * dyur(j)
+	DO 250 i = i_lo, i_hi
+
+	   IF ( j .EQ. 1 .OR. i .EQ. im ) THEN
+	      w_u(i,j,k,l) = bad_val4
+	      GOTO 250
+	   ENDIF
+
+	   IF ( ufuw(i  ,j  ,k,l) .EQ. bad_ufuw
+     .	    .OR.ufuw(i+1,j  ,k,l) .EQ. bad_ufuw
+     .	    .OR.vfvn(i  ,j  ,k,l) .EQ. bad_vfvn
+     .	    .OR.vfvn(i  ,j-1,k,l) .EQ. bad_vfvn ) THEN
+
+	      w_u(i,j,k,l) = bad_val4
+
+	   ELSE
+
+	      w_u(i,j,k,l) = c2dz(k)*
+     .			( (ufuw(i+1,j,k,l)-ufuw(i,j,k,l)) * dxu2r(i) 
+     .			 + vfvn(i,j,k,l) - (factor * vfvn(i,j-1,k,l)) )
+
+	   ENDIF
+
+ 250	CONTINUE
+
+* now add this dW to w's from above
+	IF ( k .GT. 1 ) THEN
+	   DO 255 j = j_lo, j_hi
+	   DO 255 i = i_lo, i_hi
+
+	      IF ( w_u(i,j,k-1,l) .EQ. bad_w_u ) THEN
+
+	         w_u(i,j,k,l) = bad_val4
+
+	      ELSE
+
+	         w_u(i,j,k,l) = w_u(i,j,k-1,l) + w_u(i,j,k,l)
+
+	      ENDIF
+
+ 255	   CONTINUE
+
+	ENDIF
+
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/wind_stress.F b/fer/ocn/wind_stress.F
new file mode 100644
index 0000000..f31dc25
--- /dev/null
+++ b/fer/ocn/wind_stress.F
@@ -0,0 +1,182 @@
+	SUBROUTINE WIND_STRESS ( uwind,  muwind,
+     .				 vwind,	 mvwind,
+     .				 stress, mstress )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute wind stress magnitude on T-S grid from components on U-V grid
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/17/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 1/27/89 - modified bad_flag error checking at j=2 in case of
+*			   improper GFDL model output
+*		note: bad flag checks are based on UWND, only for performance
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* Unix/RISC port 8/91 *sh*: added dp_nts30_wind sensitivity
+*                         - also fixed bug at j=2 and j=jmtm1 by changing to
+*                           ELSEIF logic
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+        include 'xdset_parms.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'
+        INCLUDE 'TMAP_FORMAT:TMAP_DIMS.PARM'
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+        INCLUDE 'FERRET_CMN:XDSET_PARMS.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	muwind, mvwind, mstress
+* subscript ranges from memory variable table ...
+	REAL     uwind( m1lox:m1hix,m1loy:m1hiy,            m1lot:m1hit ),
+     .		 vwind( m2lox:m2hix,m2loy:m2hiy,            m2lot:m2hit ),
+     .		stress( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit )
+
+* internal variable declarations:
+        LOGICAL need_nts30
+	INTEGER	dset, grid, i_lo, i_hi, j_lo, j_hi, i, j, l,
+     .          itt, ittmod, slen
+	REAL	bad_wind, bad_stress, taux, tauy
+        REAL*8  TM_WORLD
+	CHARACTER LEFINT*6
+
+* local parameters
+        INTEGER nts30
+        PARAMETER ( nts30 = 730 )
+
+* --- end of introductory code ---
+
+* limits for calculation
+	i_lo = mr_lo_s1(mstress)
+	i_hi = mr_hi_s1(mstress)
+	j_lo = mr_lo_s2(mstress)
+	j_hi = mr_hi_s2(mstress)
+
+* flag(s) for bad or missing values
+	bad_wind   = mr_bad_data ( muwind )
+	bad_stress = mr_bad_data ( mstress )
+
+* data set needed to determine whether to do NST30 modification
+        dset = mr_data_set( muwind )
+        grid = mr_grid    ( muwind )
+
+C									! 3003
+C     SINCE STRESS & AIRT ARE DEFINED CORRECTLY ONLY FOR THE CURRENT	! 3007
+C     JROW DURING THE 2 TIME STEPS WHEN BC ARE BROUGHT IN AT THE	! 3008
+C     BEGINNING OF EACH MONTH...APPROXIMATE THEM ON JROW-1 BY USING	! 3009
+C     THE JROW VALUES							! 3010
+C									! 3011
+* note:	Ron Pacanowski agrees that this IF test is incorrect and...
+*      IF (MOD(ITT-1,NTS30).EQ.0.OR.MOD(ITT-1,NTS30).EQ.1) THEN		! 3012
+*	should be replaced by:
+!	if (j.eq.2) then
+****** this will slightly alter the results ******
+* note 8/91: this incorrect test remained in throughout the life of
+* the 205 model and critically effects the balances when attempting
+* an exact match using hourly data.
+* The descriptor parameter "NTS30 WIND STRESS MOD" was created to turn back on
+* this feature
+C									! 3013
+	DO 2000 l = mr_lo_s4(mstress), mr_hi_s4(mstress)
+
+* special correction at nts30 time steps ?
+* NOTE: nts30 logic is only partially tested - month starts, only tested
+*       also, there is a bug (8/91) in the heat flux calculation at present
+*       when using hourly data:  qflx is entirely calculated at T-1.  In
+*       fact sst should be at T-1 but tau should be at T.  If that bug is
+*       fixed the MOD logic above will need to be changed
+        IF ( dp_nts30_wind( dset ) ) THEN
+	   CALL SPLIT_LIST(pttmode_bull, 6,
+     .			'WIND_STRESS: Checking itt against nts30',0)
+           itt = INT( TM_WORLD( l, grid, t_dim, box_middle ) )
+           ittmod = MOD(itt+1,nts30)
+           need_nts30 = ittmod.EQ.0 .OR. ittmod.EQ.1
+           IF ( need_nts30 ) 	   CALL SPLIT_LIST(pttmode_bull, 6,
+     .			'Using NTS30 at '//LEFINT(l,slen)//
+     .			LEFINT(itt,slen),0)
+        ELSE
+           need_nts30 = .FALSE.
+        ENDIF
+
+* shift winds from u,v grid to T grid points
+* via 4-point interpolation where possible
+	DO 1720 j = j_lo, j_hi
+	DO 1720 I = i_lo, i_hi					! 3021 mod
+
+	   IF ( j .EQ. 1  .OR.  i .EQ. 1 ) THEN
+	      stress(i,j,l) = bad_stress
+
+	   ELSEIF (      uwind(i  ,j,l  ) .EQ. bad_wind
+     .		.OR. uwind(i-1,j,l  ) .EQ. bad_wind ) THEN
+	      stress(i,j,l) = bad_stress
+
+	   ELSEIF ( j.EQ.2 .OR. j.EQ.jmtm1 .OR. need_nts30 )  THEN ! 2 pt intrp
+	      TAUX = .5*( uwind(i,j,l) + uwind(i-1,j,l) )	! 3015 mod
+	      TAUY = .5*( vwind(i,j,l) + vwind(i-1,j,l) )	! 3017 mod
+	      stress(i,j,l) = SQRT ( taux**2 + tauy**2 )
+
+	   ELSEIF (  uwind(i  ,j-1,l) .EQ. bad_wind
+     .		.OR. uwind(i-1,j-1,l) .EQ. bad_wind ) THEN
+	      stress(i,j,l) = bad_stress
+
+           ELSE
+	      TAUX = .25* ( uwind (i,j  ,l) + uwind (i-1,j  ,l) +    ! 3022 mod
+     .			    uwind (i,j-1,l) + uwind (i-1,j-1,l) )    ! 3023 mod
+	      TAUY = .25* ( vwind (i,j  ,l) + vwind (i-1,j  ,l) +    ! 3024 mod
+     .			    vwind (i,j-1,l) + vwind (i-1,j-1,l) )    ! 3025 mod
+	      stress(i,j,l) = SQRT ( taux**2 + tauy**2 )
+	   ENDIF
+
+ 1720	CONTINUE								! 3026
+ 2000	CONTINUE								! 3026
+
+	RETURN
+	END
diff --git a/fer/ocn/xy_hdiffus.F b/fer/ocn/xy_hdiffus.F
new file mode 100644
index 0000000..2fc1c7c
--- /dev/null
+++ b/fer/ocn/xy_hdiffus.F
@@ -0,0 +1,145 @@
+	SUBROUTINE XY_HDIFFUS ( tk, mtk, xy_qdiffus, mxy_qdiffus )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute diffussion of heat in horizontal plane at the specified depth
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE qdiffus
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/26/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+#endif
+
+* calling argument declarations:
+	INTEGER	mtk, mxy_qdiffus
+* subscript ranges from memory variable table ...
+	REAL            tk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		xy_qdiffus( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit )
+
+* internal variable declarations:
+	LOGICAL HOURLY_DATA
+	INTEGER	i, j, k, l, dl, lp1
+	REAL	bad_tk, bad_qdiffus, cctj, ddtj, ew_qdiffus, sn_qdiffus
+
+* --- end of introductory code ---
+* use 1 hour separation for exact results on hourly data
+	IF ( HOURLY_DATA(mr_grid(mxy_qdiffus)) ) THEN
+	   dl = 1
+	ELSE
+	   dl = 0
+	ENDIF
+
+* flag for bad/missing data
+	bad_tk      = mr_bad_data( mtk )
+	bad_qdiffus = mr_bad_data( mxy_qdiffus )
+
+	DO 2000 l = mr_lo_s4(mxy_qdiffus)-dl, mr_hi_s4(mxy_qdiffus)-dl
+	   lp1 = l + dl
+	DO 2000 k = mr_lo_s3(mxy_qdiffus), mr_hi_s3(mxy_qdiffus)
+
+	DO 1000 j = mr_lo_s2(mxy_qdiffus), mr_hi_s2(mxy_qdiffus)
+
+	IF ( j .EQ. 1  .OR.  j .EQ. jmt ) THEN
+	   DO 100 i = mr_lo_s1(mxy_qdiffus), mr_hi_s1(mxy_qdiffus)
+ 100	   xy_qdiffus( i,j,k,lp1 ) = bad_qdiffus
+	   GOTO 1000
+	ENDIF
+
+C   FORM LATERAL DIFFUSION COEFFICIENTS					! 3045
+C     VARIABLE HORIZONTAL DIFFUSION					! 3047
+      CCTJ=AH*CS(j)*DYUR(j)*DYTR(j)*CSTR(j)*XJV(j)		! 3049 mod (j)
+      DDTJ=AH*CS(j-1)*DYUR(j-1)*DYTR(j)*CSTR(j)*XJV(j-1)	! 3050 mod (j)
+
+	DO 900 i = mr_lo_s1(mxy_qdiffus), mr_hi_s1(mxy_qdiffus)	! 3051 mod
+
+	IF ( i .EQ. 1  .OR.  i .EQ. imt ) THEN
+	   xy_qdiffus( i,j,k,lp1 ) = bad_qdiffus
+	   GOTO 900
+	ENDIF
+
+	IF (	tk( i  ,j   ,k,l ) .EQ. bad_tk
+     .	   .OR. tk( i+1,j   ,k,l ) .EQ. bad_tk
+     .	   .OR. tk( i-1,j   ,k,l ) .EQ. bad_tk
+     .	   .OR. tk( i  ,j+1 ,k,l ) .EQ. bad_tk
+     .	   .OR. tk( i  ,j-1 ,k,l ) .EQ. bad_tk ) THEN
+	   xy_qdiffus( i,j,k,lp1 ) = bad_qdiffus
+	   GOTO 900
+	ENDIF
+
+      AATJ(I)=AH*DXUR(I)*DXTR(I)*CSTR(j)*CSTR(j)*XIV(I)*XJT(j)	  ! 3052 mod (j)
+      BBTJ(I)=AH*DXUR(I-1)*DXTR(I)*CSTR(j)*CSTR(j)*XIV(I-1)*XJT(j)! 3053 mod (j)
+  731 CONTINUE								! 3056
+
+C   ADD IN DIFFUSION TERMS						! 3086
+C									! 3087
+* compute east-west diffussion
+	ew_qdiffus = cmonthly * (
+     * aatj(I)*(tk(I+1,j,k,l)-tk(i,j,k,l))			! 3092 mod
+     *+bbtj(I)*(tk(I-1,j,k,l)-tk(i,j,k,l)) )			! 3093 mod
+	xy_qdiffus(i,j,k,lp1) = ew_qdiffus
+
+* compute south-north diffussion
+	sn_qdiffus = cmonthly * (
+     * cctj*xit(i)*(tk(i,j+1,k,l)-tk(i,j,k,l))				! 3102 mod
+     *+ddtj*xit(i)*(tk(i,j-1,k,l)-tk(i,j,k,l))	)			! 3103 mod
+	 xy_qdiffus(i,j,k,lp1) = xy_qdiffus(i,j,k,lp1) + sn_qdiffus
+
+ 900	CONTINUE
+ 1000	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/z_hadvec.F b/fer/ocn/z_hadvec.F
new file mode 100644
index 0000000..ccdcb17
--- /dev/null
+++ b/fer/ocn/z_hadvec.F
@@ -0,0 +1,178 @@
+	SUBROUTINE Z_HADVEC ( tk, mtk,
+     .			      wk, mwk,
+     .			      advec, madvec   )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute vertical  component of heat advection
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/17/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* V200:  7/27/89 - 4D symmetrical version
+*	10/11/89 - array declarations using XMEM_SUBSC.CMN (reordered args)
+* Linux Port 1/97 *kob* - Added a preprocessor include for xgfdl_masks.cmn
+*			  because it needed a preprocessor.
+* V450 - 7/22/97 - minor reordering of "#includes" for Solaris compiler bug
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+
+! land/water masks
+#	include "xgfdl_masks.cmn"	
+
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE 'FERRET_CMN:XGFDL_MASKS.CMN'	! land/water masks
+#endif
+
+* calling argument declarations:
+	INTEGER	mwk, mtk, madvec
+* subscript ranges from memory variable table ...
+	REAL       tk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		   wk( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		advec( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit )
+
+* internal variable declarations:
+	INTEGER	i_lo, i_hi, j_lo, j_hi, i, j, k, l
+	REAL	bad_wk, bad_tk, bad_advec, up_dwtdz, dn_dwtdz, dwtdz_neg,
+     .		tdwdz
+	LOGICAL	  bad_components
+
+* --- end of introductory code ---
+* limits for calculation
+	i_lo = mr_lo_s1(madvec)
+	i_hi = mr_hi_s1(madvec)
+	j_lo = mr_lo_s2(madvec)
+	j_hi = mr_hi_s2(madvec)
+
+* flag(s) for bad or missing values
+	bad_wk    = mr_bad_data ( mwk )
+	bad_tk    = mr_bad_data ( mtk )
+	bad_advec = mr_bad_data ( madvec )
+
+	DO 2000 l = mr_lo_s4(madvec), mr_hi_s4(madvec)
+	DO 2000 k = mr_lo_s3(madvec), mr_hi_s3(madvec)
+
+* south to north loop through east-west lines
+	DO 1000 j = j_lo, j_hi
+
+	   IF ( j .LE. 2  .OR.  j .GE. jmtm1 ) THEN
+	      DO 100 i = i_lo, i_hi
+ 100	      advec( i,j,k,l ) = bad_advec
+	      GOTO 1000
+	   ENDIF
+
+* calculate minus vert advection component of total advection in flux form
+* note on sign: increasing k is decreasing z
+* note on k levels: The surface (w=0) is at k=1 in GFDL code but is
+*		    omitted from the GFDL output. In this code k=1 represents
+*		    the first level of non-zero data (GFDL k=2).
+*		    The k=1 level of the S-T and U-V grids is therefore ABOVE
+*		    the k=1 level of W in this code.  The "up" and "dn" prefixes
+*		    on the variable names should be thought of relative to the
+*		    T level which is experiencing advective heat flux.
+
+      DO 824 i = i_lo, i_hi
+
+* check that all of the required component fields are available at this point
+* depending on depth, some of the components may be dummies
+	IF     ( k .EQ. 1 )  THEN
+	   bad_components =	wk( i,j,k  ,l ) .EQ. bad_wk
+     .			   .OR. tk( i,j,k  ,l ) .EQ. bad_tk
+     .			   .OR. tk( i,j,k+1,l ) .EQ. bad_tk
+	ELSEIF ( k .EQ. KM ) THEN
+	   bad_components =	wk( i,j,k-1,l ) .EQ. bad_wk
+     .			   .OR. wk( i,j,k  ,l ) .EQ. bad_wk
+     .			   .OR. tk( i,j,k-1,l ) .EQ. bad_tk
+     .			   .OR. tk( i,j,k  ,l ) .EQ. bad_tk
+	ELSE
+	   bad_components =	wk( i,j,k-1,l ) .EQ. bad_wk
+     .			   .OR. wk( i,j,k  ,l ) .EQ. bad_wk
+     .			   .OR. tk( i,j,k-1,l ) .EQ. bad_tk
+     .			   .OR. tk( i,j,k  ,l ) .EQ. bad_tk
+     .			   .OR. tk( i,j,k+1,l ) .EQ. bad_tk
+	ENDIF
+	IF ( bad_components ) THEN
+	   advec( i,j,k,l ) = bad_advec
+	   GOTO 824
+	ENDIF
+
+	IF ( k .EQ. 1 ) THEN
+	   up_dwtdz = 0.0
+	ELSE
+	   up_dwtdz = -(wk(i,j,k-1,l) * (tk(i,j,k-1,l) + tk(i,j,k,l)) )
+     .		    * DZ2R(K)					    ! 3075 mod
+	ENDIF
+
+	IF ( k .GE. kmt(i,j) ) THEN
+	   dn_dwtdz = 0.0
+	ELSE
+	   dn_dwtdz = (wk(i,j,k,l)*(tk(i,j,k,l)+tk(i,j,k+1,l)))*DZ2R(K)! 3079 mod
+	ENDIF
+
+	dwtdz_neg = up_dwtdz + dn_dwtdz
+
+* calculate actual vert advection by subtracting t*dW/dZ ...
+	IF ( k .EQ. 1 ) THEN
+	   tdwdz = tk(i,j,k,l) * (              - wk(i,j,k,l)) * dz2r(k) * 2.0
+	ELSE
+	   tdwdz = tk(i,j,k,l) * (wk(i,j,k-1,l) - wk(i,j,k,l)) * dz2r(k) * 2.0
+	ENDIF
+	advec(i,j,k,l) = ( dwtdz_neg + tdwdz ) * cmonthly
+
+ 824  CONTINUE	    							! 3080
+
+ 1000	CONTINUE
+ 2000	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/ocn/z_hdiffus.F b/fer/ocn/z_hdiffus.F
new file mode 100644
index 0000000..6c0532c
--- /dev/null
+++ b/fer/ocn/z_hdiffus.F
@@ -0,0 +1,174 @@
+	SUBROUTINE Z_HDIFFUS (	tk,   mtk,
+     .				vdc,  mvdc,
+     .				qflx, mqflx,
+     .				qdif, mqdif )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute vertical component of heat diffussion using temperature at
+* 3 layers (tkm,tk,tkp) and vertical diffussion coefficient at 2 (vdcM,vdc)
+* and using surface boundary fluxes if at the surface
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/7/86	extracted from SUBROUTINE HDIFFUS
+*			with major modifications to convert i-k oriented
+*			calculations to i-j oriented calculations
+* revision 0.1 - 6/25/87 - modified to include surface heat flux when k=1
+* V200:  7/25/89 - 4D symmetrical version
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*	10/18/89 - fixed bug: lb4-->l on setting qdif to bad_flag while adding
+*				      surface BC's
+* Linux Port 1/97 *kob* - Added a preprocessor include for xgfdl_masks.cmn
+*			  because it needed a preprocessor.
+* V450 - 7/22/97 - minor reordering of "#includes" for Solaris compiler bug
+
+#ifdef unix
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'gfdl.parm'		! parameter definitions
+
+! land/water masks
+#	include "xgfdl_masks.cmn"	
+
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xonedim.cmn'	! geometric constants
+	include 'xcontext.cmn'
+#else
+	INCLUDE 'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:GFDL.PARM'		! parameter definitions
+	INCLUDE	'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE	'FERRET_CMN:XMEM_SUBSC.CMN'
+	INCLUDE 'FERRET_CMN:XONEDIM.CMN'	! geometric constants
+	INCLUDE 'FERRET_CMN:XCONTEXT.CMN'
+	INCLUDE 'FERRET_CMN:XGFDL_MASKS.CMN'	! land/water masks
+#endif
+
+* calling argument declarations:
+	INTEGER	mtk, mvdc, mqflx, mqdif
+
+* subscript ranges from memory variable table ...
+	REAL      tk( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit ),
+     .		 vdc( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit ),
+     .		qflx( m3lox:m3hix,m3loy:m3hiy,            m3lot:m3hit ),
+     .		qdif( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit )
+
+* internal variable declarations:
+	LOGICAL HOURLY_DATA, need_qflux
+	INTEGER	i, j, k, l, dl, lb4
+	REAL	bad_vdc, bad_tk, bad_qdiffus, bad_qflx, up_qdif, dn_qdif
+
+* --- end of introductory code ---
+* use 1 hour separation for exact results on hourly data
+	IF ( HOURLY_DATA(mr_grid(mqdif)) ) THEN
+	   dl = -1
+	ELSE
+	   dl = 0
+	ENDIF
+
+* flag(s) for bad or missing values
+	bad_vdc      = mr_bad_data ( mvdc )
+	bad_tk       = mr_bad_data ( mtk  )
+	bad_qflx     = mr_bad_data ( mqflx )
+	bad_qdiffus  = mr_bad_data ( mqdif )
+
+* flag for surface heat flux
+	DO 1100 l = mr_lo_s4(mqdif), mr_hi_s4(mqdif)
+	DO 1100 k = mr_lo_s3(mqdif), mr_hi_s3(mqdif)
+
+* components from 1 hour before ?
+	lb4 = l + dl
+
+	need_qflux = k .EQ. 1
+
+	DO 1000 j = mr_lo_s2(mqdif), mr_hi_s2(mqdif)
+	DO 1000 i = mr_lo_s1(mqdif), mr_hi_s1(mqdif)
+
+* diffussion from above:
+	IF     ( k .EQ. 1        ) THEN
+	   up_qdif = 0.0			! top
+	ELSEIF ( k .GT. kmt(i,j) ) THEN
+	   up_qdif = 0.0			! bottom or below
+	ELSE	
+
+	   IF (vdc( i,j,k-1,lb4 ) .EQ. bad_vdc
+     .	   .OR.	tk( i,j,k-1,lb4 ) .EQ. bad_tk
+     .	   .OR. tk  ( i,j,k,lb4 ) .EQ. bad_tk ) THEN
+	      qdif( i,j,k,l ) = bad_qdiffus
+	      GOTO 1000
+	   ENDIF
+
+	   up_qdif = cmonthly * (
+     *		 vdc(i,j,k-1,lb4)*EEH(K)
+     .				*(tk(i,j,k-1,lb4) - tk(i,j,k,lb4)))! 3105 mod
+	ENDIF
+
+* diffussion to below:
+	IF ( k .GE. kmt(i,j) ) THEN
+	   dn_qdif = 0.0			! bottom or below
+	ELSE
+
+	   IF (	vdc( i,j,k,  lb4 ) .EQ. bad_vdc
+     .	   .OR. tk ( i,j,k+1,lb4 ) .EQ. bad_tk ) THEN
+	      qdif( i,j,k,l ) = bad_qdiffus
+	      GOTO 1000
+	   ENDIF
+
+	   dn_qdif = cmonthly * (
+     *		-VDC (i,j,k,lb4)*FFH(K)*(tk(i,j,k,lb4)-tk(i,j,k+1,lb4))) ! 3106 mod
+	ENDIF
+
+	qdif(i,j,k,l) = up_qdif + dn_qdif
+
+* add in surface boundary flux if at surface
+* (with units converted from cgs to deg/month over upper layer)
+	IF ( need_qflux ) THEN
+	   IF ( qflx(i,j,lb4) .EQ. bad_qflx ) THEN
+	      qdif(i,j,k,l) = bad_qdiffus
+	   ELSE
+	      qdif(i,j,k,l) = qdif(i,j,k,l)
+     .				 + 0.06265833*qflx(i,j,lb4)
+	   ENDIF
+	ENDIF
+
+ 1000	CONTINUE
+ 1100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/plt/LIB_NAME b/fer/plt/LIB_NAME
new file mode 100644
index 0000000..49e9acd
--- /dev/null
+++ b/fer/plt/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libferplt.a
+ 
diff --git a/fer/plt/Makefile b/fer/plt/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/plt/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/plt/SOURCE_FILES b/fer/plt/SOURCE_FILES
new file mode 100644
index 0000000..9e17734
--- /dev/null
+++ b/fer/plt/SOURCE_FILES
@@ -0,0 +1,83 @@
+SRCS_F = \
+abs_whoi_date.F\
+assign_modemeta.F\
+axis_ends.F\
+axis_end_syms.F\
+axis_format.F\
+ax_on_off.F\
+box_label.F\
+cancel_window.F\
+check_graphics.F\
+choose_cx_ww.F\
+ck_gks_active.F\
+clear_window.F\
+compound_key.F\
+curv_coord_add_sub.F\
+curv_coord_sub.F\
+curv_coord_range_sub.F\
+disp_data_set_up.F\
+disp_init.F\
+disp_labels.F\
+disp_prep.F\
+disp_reset.F\
+disp_set_up.F\
+echof_off.F\
+equal_color.F\
+equal_range.F\
+equal_range_t.F\
+equal_thick.F\
+flow_set_up.F\
+get_axis_format.F\
+get_frame_size.F\
+get_view_size.F\
+get_window_pixels.F\
+gks_windows.F\
+gks_x_conid.F\
+internal_whoi_date.F\
+its_curv_edges.F\
+its_curvilinear.F\
+itsa_axis_view.F\
+itsa_modulo_curvi_axis.F\
+itsa_modulo_curvi_axis_sub.F\
+key_loc.F\
+key_string.F\
+line_plot_labels.F\
+line_style.F\
+load_curvilinear.F\
+merged_whoi_date.F\
+parse_color_tuple.F\
+plot_set_up.F\
+polygon_set_up.F\
+pos_lab.F\
+ppl_axes_off.F\
+ppl_axes_restore.F\
+ppl_bdead.F\
+ppl_dash_restore.F\
+ppl_patset.F\
+ppl_shaset.F\
+ppl_time.F\
+put_cmnd_key.F\
+put_key.F\
+put_label.F\
+re_orient.F\
+save_frame.F\
+save_ppl_values.F\
+seg_off.F\
+seg_on.F\
+send_pltype.F\
+set_ax_sizes.F\
+set_graticules.F\
+set_plot_size.F\
+set_ppl_values.F\
+set_text_sizes.F\
+set_viewport.F\
+set_vp_symbols.F\
+set_window.F\
+setup_keys.F\
+start_pplus.F\
+taxis_style.F\
+trim_axis_ends.F\
+viewport_number.F\
+vp_axlim2lim.F\
+whoi_date.F\
+window_size_from_opts.F
diff --git a/fer/plt/abs_whoi_date.F b/fer/plt/abs_whoi_date.F
new file mode 100644
index 0000000..84257c8
--- /dev/null
+++ b/fer/plt/abs_whoi_date.F
@@ -0,0 +1,76 @@
+	CHARACTER*14 FUNCTION ABS_WHOI_DATE( secsfrombc, cal_id )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form YYMMDDHHMM from the absolute time in seconds
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300: 10/93 *sh*  most of the code lifted from WHOI_DATE
+* V420: 11/27/95 - 4-digit YEARS!!
+* v530: 1/01  *acm*  calendar ID passed in for alternative calendar types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+* calling argument declarations
+	REAL*8	secsfrombc
+
+* internal variable declarations
+	INTEGER 	yr100, yr, mon, day, hr, min, sec,
+     .			status, i, axis, grid
+	INTEGER		cal_id
+	CHARACTER*20	TM_SECS_TO_DATE, date
+
+* Convert to date string
+	date = TM_SECS_TO_DATE(secsfrombc, cal_id)
+
+* break the date string into component integer values
+	CALL TM_BREAK_DATE( date, cal_id, yr, mon, day, hr, min, 
+     .                      sec, status )
+	yr100 = yr/100		! 1980 --> 19
+	yr = yr - (yr100*100)	! 1982 --> 82
+
+* assemble the pieces in WHOI format
+	WRITE (ABS_WHOI_DATE,3000) yr100,yr,mon,day,hr,min,sec
+ 3000	FORMAT (7I2.2)
+
+	RETURN
+	END
diff --git a/fer/plt/assign_modemeta.F b/fer/plt/assign_modemeta.F
new file mode 100644
index 0000000..43b895a
--- /dev/null
+++ b/fer/plt/assign_modemeta.F
@@ -0,0 +1,54 @@
+        SUBROUTINE ASSIGN_MODEMETA
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Simply assign mode_metafile to .TRUE. without all the other
+* effects of a SET MODE META command.  Intended only to be used
+* by the SET_BATCH_GRAPHICS C function when assigning batch mode
+* (which is done at the start of the program).
+* 
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+
+        mode_metafile = .TRUE.
+        CALL WARN('the use of the "-batch" command-line option ' //
+     .            'is deprecated;')
+        CALL WARN('instead use the "FRAME /FILE=... /FORMAT=..." ' //
+     .            'Ferret command')
+
+        RETURN
+        END
diff --git a/fer/plt/ax_on_off.F b/fer/plt/ax_on_off.F
new file mode 100644
index 0000000..2ad4e40
--- /dev/null
+++ b/fer/plt/ax_on_off.F
@@ -0,0 +1,118 @@
+	SUBROUTINE ax_on_off (iax)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* August 2001
+* call AXSET to turn axes off or on according to argument iax (0=off, 1=on):
+*  iax(1) TOP	 
+*  iax(2) BOTTOM
+*  iax(3) LEFT
+*  iax(4) RIGTH
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* v540 *acm*  2/02 save the state of the axes; so can restore PPL AXSEST settings
+*             3/25  Put the common block in a separate include file.
+c v552 *acm* 3/03 new param IAXSET to restore axes after PLOT/AXES/set plot.
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'plot_setup.parm'
+        include 'xplot_setup.cmn'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'ppl_ax_save.cmn'
+
+	INTEGER		i, iax(4), indep_dim, dep_dim, labx, laby
+	CHARACTER*25	buff
+
+* save previous axis state (top,bottom,left,right)
+
+	DO 10 i = 1, 4
+ 10	save_iaxon(i) = iaxon(i)
+        save_labx = labelx
+        save_laby = labely
+
+	WRITE (buff,90) (iax(i), i=1,4)
+  90	FORMAT ('AXSET ', 3(i2,','), I2 )
+	CALL PPLCMD (from, line, 0, buff, 1, 1 )
+
+
+*  turn axis labels off or on
+
+	IF (iax(1) .EQ. 0  .AND. iax(2) .EQ. 0) CALL PPLCMD 
+     .         ( from, line, 0, 'XLAB', 1, 1 )
+
+	IF (iax(3) .EQ. 0  .AND. iax(4) .EQ. 0) CALL PPLCMD 
+     .         ( from, line, 0, 'YLAB', 1, 1 )
+
+*  When only top or right axis plotted, labels wouldnt appear. 
+*  Turn them on.
+
+        labx = labelx
+        laby = labely
+        change_axlab = .FALSE.
+        IF (iax(1) .EQ. 1  .AND. iax(2) .EQ. 0) THEN
+           labx = 1
+           change_axlab = .TRUE.
+	ENDIF
+        IF (iax(3) .EQ. 0  .AND. iax(4) .EQ. 1) THEN
+           laby = 1
+           change_axlab = .TRUE.
+        ENDIF
+        IF (change_axlab) THEN
+           WRITE (buff,92) labx, laby
+  92	   FORMAT ('AXLABP ', i2, ',', I2 )
+	   CALL PPLCMD (from, line, 0, buff, 1, 1)
+        ENDIF
+
+*  What if one is a time axis?  
+
+	indep_dim = plot_axis(1)
+	dep_dim = plot_axis(2)
+	time_axis = ( (indep_dim.EQ.t_dim .OR. indep_dim.EQ.f_dim)
+     .    .OR. (dep_dim.EQ.t_dim .OR. dep_dim.EQ.t_dim) )
+
+	IF ( time_axis .AND. change_axlab) THEN
+	   WRITE (buff,94) labx, laby
+  94	   FORMAT ('TXLABP ', i2, ',', I2 )
+	   CALL PPLCMD (from, line, 0, buff, 1, 1)
+	ENDIF
+
+        iaxset = 1
+
+	RETURN
+	END
diff --git a/fer/plt/axis_end_syms.F b/fer/plt/axis_end_syms.F
new file mode 100644
index 0000000..4842c71
--- /dev/null
+++ b/fer/plt/axis_end_syms.F
@@ -0,0 +1,67 @@
+	SUBROUTINE AXIS_END_SYMS( plot_ax, first, last )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* define symbols contining the plotted axis extremes (useful for scaling)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V500 - *sh* drawn from AXIS_ENDS
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+
+* calling argument declarations:
+	CHARACTER*1	plot_ax		! X (horiz) or Y (vert) axis of plot
+	REAL*8		first, last
+
+! internal variable declarations:
+	CHARACTER*16  val_buff
+
+* Define symbols identifying axis limits
+	WRITE ( val_buff, '(1PG15.8)' ) first
+	CALL PPLCMD ( from, line, 0, 
+     .		'SET '//plot_ax//'AXIS_MIN '//val_buff , 1, 1 )
+
+	WRITE ( val_buff, '(1PG15.7)' ) last
+	CALL PPLCMD ( from, line, 0, 
+     .		'SET '//plot_ax//'AXIS_MAX '//val_buff , 1, 1 )
+
+	RETURN
+      END
diff --git a/fer/plt/axis_ends.F b/fer/plt/axis_ends.F
new file mode 100644
index 0000000..c0556cc
--- /dev/null
+++ b/fer/plt/axis_ends.F
@@ -0,0 +1,150 @@
+	SUBROUTINE AXIS_ENDS( plot_ax, dat_ax, grid, first, last, delta,
+     .                        is_log,  axtp, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up PPLUS to know the correct axis endpoints and tic interval
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/21/87
+* revision 0.1 - 2/29/88 - allowed for non-inverted vertical Z axis
+* V300 10/93 - allow delta value to be passed into this routine
+* Linux Port *kob* 12/96 - had to add "external RANGE" because RANGE is an
+*			   intrinsic function for F90.
+* V500 - *jd* 5.3.99 Add axis extrema symbols
+*	 *sh* 6/99 - consolidated axis extrema symbols into AXIS_END_SYMS
+*             7/99 - use 7 digits of output precision
+*        *kob* 9/99 - fixed minor bug in which length of val_buff was one
+*                     character too short.  this only showed up under Linux
+*        *acm* 6/01 - add logical IS_LOG  for log axis
+* V580 *acm* 12/04 Fix bug 1129; send back correct value of delta if computed here
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'errmsg.parm'
+
+
+* kob 12/96
+	EXTERNAL RANGE
+* calling argument declarations:
+	LOGICAL		is_log
+	CHARACTER*1	plot_ax		! X (horiz) or Y (vert) axis of plot
+	INTEGER		dat_ax, grid	! X,Y,Z or T axis of data
+	REAL*8		first, last, delta
+
+* internal variable declarations:
+	LOGICAL		BKWD_AXIS
+	CHARACTER	val_buff*45
+	INTEGER		axtp, status
+	REAL*4		x1, x2, uminr, umaxr, dint
+	REAL*8		firstl, lastl, epsilon, eps2
+	PARAMETER	(epsilon=1.e-35)
+
+	STATUS = ferr_ok 
+
+* For log axes set up PPLUS for a regular or inverted log axis
+
+	IF (is_log) THEN
+ 
+* Check for negative or too-tiny values of range
+	   IF (first .LT. epsilon .OR. last  .LT. epsilon) GO TO 5000
+
+	   IF ( BKWD_AXIS(dat_ax, grid) ) THEN
+	      axtp = 4		! inverse log axis (leave type 3 as is in PPLUS)
+           ELSE
+	      axtp = 2		! log axis
+	   ENDIF
+
+	   firstl = LOG10(first)
+	   lastl = LOG10(last)
+
+	   first = INT(LOG10(first))
+	   last  = INT(LOG10(last))
+
+!  If needed, round the higher limit up, if not an exact decade already. 
+	   eps2 = ABS(MIN(firstl, lastl)/ 100.)
+
+           IF (lastl .GE. firstl ) THEN
+	      IF (ABS(lastl - last) .GT. eps2) last = last + 1.
+	   ELSE
+             IF (ABS(firstl - first) .GT. eps2) first = first + 1.
+	   ENDIF
+       ENDIF
+
+* Convert to single precision and reverse order if a depth plot on Y axis
+
+#ifdef double_p
+	IF ( plot_ax .EQ. 'Y'  .AND.  BKWD_AXIS(dat_ax, grid) ) THEN
+	   x2 = (first)
+	   x1 = (last)
+	ELSE
+	   x1 = (first)
+	   x2 = (last)
+	ENDIF
+#else	
+	IF ( plot_ax .EQ. 'Y'  .AND.  BKWD_AXIS(dat_ax, grid) ) THEN
+	   x2 = SNGL(first)
+	   x1 = SNGL(last)
+	ELSE
+	   x1 = SNGL(first)
+	   x2 = SNGL(last)
+	ENDIF
+#endif
+
+* use Denbo's PPLUS routine to calculate the tic interval, dint
+	IF ( delta .EQ. unspecified_val8 ) THEN
+	   CALL RANGE( x1, x2, 10, uminr, umaxr, dint )
+           delta = dint
+	ELSE
+	   dint = delta
+	ENDIF
+
+* and send the actual limits requested together with this tic interval to PPLUS
+	WRITE ( val_buff, '(3(E14.7,1X))' ) x1, x2, dint
+	CALL PPLCMD ( from, line, 0, 
+     .				plot_ax//'AXIS '//val_buff , 1, 1 )
+
+* Define symbols identifying axis limits
+	CALL AXIS_END_SYMS(plot_ax, first, last)
+
+	RETURN
+ 5000	STATUS = 9999
+
+      END
diff --git a/fer/plt/axis_format.F b/fer/plt/axis_format.F
new file mode 100644
index 0000000..690f640
--- /dev/null
+++ b/fer/plt/axis_format.F
@@ -0,0 +1,233 @@
+	SUBROUTINE AXIS_FORMAT( x_or_y, idim, grid, lo_val, hi_val,
+     .				del_val, curvilinear, cx_curv,
+     .				its_calendar, tstyle, no_labels )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up PPLUS to properly label the axis tics and titles
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/23/87
+* revision 1.0 - 2/25/88 - added grid to call; allowed non-geographic axes
+* revision 2.0 - 4/12/88 - added time axis set-ups and decimal place calcs.
+*			   and units on axis labels (via AX_TITLE)
+*			   x/y axis labels through PUT_LABEL call
+* revision 2.1 -  5/7/88 - increased format sizes
+* revision 2.2 -  9/8/88 - added position relative flags to PUT_LABEL call
+* revision 2.3 - 9/21/88 - suppress year on time axis for climatological sets
+*			 - added control over time axis tics (TXLINT)
+*			 - fixed PPLUS (TAXIS3) bug permitting "day"-style
+*			   time axes (TXTYPE) - return "tstyle"
+* revision 2.31 - 1/9/89 - doc chg: climatological axis in TAXIS_STYLE
+* V200:  10/13/89 - corrected FORMAT 3010 to allow dt_min=1/60
+* 	   1/4/90 - modified PUT_LABEL call
+* Unix/RISC port - 4/91 *sh*: RISC f77 can't handle CHAR fcn in WRITE list
+* V313: *sh* AIX port.  Replace "FOR ()" with "FOR,()" so AIX space-squeezing
+*		filter doesn't corrupt this routine
+* V400: 6/23/95 - *sh* use risc_buff instead of ppl_buff when calling PUT_LABEL
+*		because PUT_LABEL uses ppl_buff internally 
+* V420: 11/27/95 - 4-digit PLOT+ YEARS!!  also, new arg its_calendar
+*	11/28/95 - changes to TAXIS_STYLE call for Y-oriented calendar axes
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V450: 3/97 - support for curvilinear coordinate plots
+*		added args curvilinear and cx_curv
+* V500: 6/99 *sh* - save time axis infor to be used by PLOT/VS overlays
+* V510 *sh* 3/00 - added no_labels argument so /NOLABELS avoided xlab & ylab
+* V533 *sh* 7/01 - avoid using risc_buff -- conflict with PUT_LABEL
+* V580 *acm* 12/04 Fix bug 1129; formatting axis for small lon/lat ranges
+* V602 *acm*  3/07 Fix bug 1498: do not computes n_res but leave it hard-wired
+*                to 15; else the axis labels may not match data values
+* V62+ *acm* 6/09 Allow use_nice for more lon/lat axes; allows for long 
+*                 strings in the degree-minute-seconds labeling
+* V64+ *acm*12/09 Fix bugs (crash!)for plots with very small ranges in lon and lat
+*                 See the benchmark test err64_very_small_latlon.jnl, based on a 
+*                 report by Jean Newman.
+*       *acm* 3/12 6D Ferret: Add E and F dimensions 
+*                  A time axis may be a T axis or F axis, so idim is 
+*                  now an arg to TSTEP_TO_SECS, TSTEP_TO_DATE
+* PyFr  *kms* 7/13 Use hxlab and hylab from PPL with PUT_LABEL for axis titles
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+        include 'plot_setup.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xplot_setup.cmn'
+	include 'xplot_state.cmn'
+        INCLUDE 'labcom_inc.decl'
+        INCLUDE 'LABCOM.INC'    ! hxlab, hylab
+* special equivalence needed only with risc compiler: bug fix
+	include 'xrisc.cmn'     ! for f77 bug
+        CHARACTER rbuff(4)*14
+        EQUIVALENCE ( rbuff, risc_buff )
+
+* calling argument declarations:
+	LOGICAL		its_calendar, curvilinear, no_labels
+	INTEGER		idim, grid, cx_curv
+	CHARACTER	x_or_y*1, tstyle*3
+	REAL*8		lo_val, hi_val, del_val
+
+* parameter definitions:
+	INTEGER		pyear_only
+	PARAMETER     ( pyear_only = 1 )
+
+* internal variable declarations:
+	LOGICAL		GEOG_LABEL, GEOG_VAR, use_nice, special
+	INTEGER		TM_LENSTR1, dlen, places, ndec, dummy
+	CHARACTER	AX_TITLE*32, WHOI_DATE*14, VAR_TITLE*128,
+     .			INTERNAL_WHOI_DATE*14,
+     .			fmt*4, buff*200
+	REAL		res_del, dt_min, time_unit, labelht
+	REAL*8		TSTEP_TO_SECS
+	INTEGER		n_res
+
+	PARAMETER 	(n_res = 15)
+
+* initiailize
+	tstyle = ' '
+
+* decimal places needed for axis:
+* ... sufficient digits to resolve the tic interval differences and
+*     still display the largest axis labels
+*  res_del	- labels will be accurate enough to resolve this delta value
+
+	res_del = ABS( hi_val - lo_val ) / n_res
+	CALL GET_PREC_DIGITS( hi_val, lo_val, res_del, places, ndec )
+
+* format to use
+	use_nice = places .LE. 7
+
+	IF ( use_nice ) THEN
+	   IF ( ndec .EQ. 0 ) THEN
+	      fmt = 'I7'
+	   ELSE
+	      WRITE ( fmt, 3000 ) ndec
+ 3000	      FORMAT ('F8.',I1)
+	   ENDIF
+	ENDIF
+
+* default format to use has no special formatting
+	IF ( use_nice ) THEN
+	      CALL PPLCMD ( from, line, 0,
+     .				x_or_y//'FOR,('//fmt//')', 1, 1 )
+	ENDIF
+
+******* special axis formats ********
+	special = ((idim.EQ.t_dim .OR.  idim.EQ.f_dim) .AND. its_calendar)
+     .       .OR. ((idim.NE.t_dim .AND. idim.NE.f_dim) .AND. 
+     .             GEOG_LABEL( idim, grid ))
+	IF (curvilinear) THEN
+	   special = (idim.NE.t_dim .AND. idim.NE.f_dim) .AND. 
+     .             GEOG_VAR( idim, cx_curv )
+	ENDIF
+	IF ( special ) THEN
+	   IF (idim .EQ. x_dim .OR. idim.EQ. y_dim) 
+     .        use_nice = places .LE. 8
+     
+	   IF ( use_nice ) THEN
+	      IF ( ndec .EQ. 0 ) THEN
+	         fmt = 'I7'
+	      ELSE
+	         WRITE ( fmt, 3000 ) ndec
+	      ENDIF
+	   ENDIF
+	   IF (idim.EQ.t_dim .OR.  idim.EQ.f_dim) THEN
+* labels formatted in calendar dates
+* .. convert units of time axis from seconds to minutes
+	      time_unit = line_tunit( grid_line(idim,grid) )
+	      dt_min = time_unit / 60.
+
+* ... TAXIS command
+	      IF ( x_or_y .EQ. 'Y' ) THEN
+	         WRITE ( ppl_buff, 3010 ) dt_min
+	      ELSE
+	         WRITE ( ppl_buff, 3012 ) dt_min
+	      ENDIF
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+ 3010	      FORMAT ('TAXIS/YAXIS ',G13.5,',ON')
+ 3012	      FORMAT ('TAXIS ',G13.5,',ON')
+
+* ... TIME command (time axis limits)
+              rbuff(1) = WHOI_DATE(grid, idim, lo_val )      ! f77 bug
+              rbuff(2) = WHOI_DATE(grid, idim, hi_val )
+              rbuff(3) = WHOI_DATE(grid, idim, 1.0D0  )
+	      WRITE ( ppl_buff, 3020 )	'W'//rbuff(1),
+     .					'W'//rbuff(2),
+     .					'W'//rbuff(3)
+ 3020	      FORMAT ('TIME ',A15,',',A15,',',A15)
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+* ... save infor for PLOLT/VS/OVER
+	      saved_dt_min = dt_min
+	      saved_t1_date =  INTERNAL_WHOI_DATE(grid, idim, 1.0D0 )
+* ... TXTYPE and TXLINT commands (time axis style)
+	      CALL TAXIS_STYLE(	x_or_y, TSTEP_TO_SECS( grid, idim, lo_val ),
+     .				TSTEP_TO_SECS( grid, idim, hi_val ), tstyle )
+
+	   ELSEIF ( idim .EQ. x_dim .AND. use_nice) THEN
+* longitude format for axis tic labling
+	      ppl_buff = 
+     .		x_or_y//'FOR,('//fmt(:TM_LENSTR1(fmt))//',''''LONE'''')' 
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   ELSEIF ( idim .EQ. y_dim  .AND. use_nice) THEN
+* latitude format for axis tic labling
+	      ppl_buff = 
+     .		x_or_y//'FOR,('//fmt(:TM_LENSTR1(fmt))//',''''LAT'''')' 
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   ENDIF
+	ENDIF
+
+* lat/long or x/y axis label
+	IF ( no_labels ) RETURN
+	IF ( curvilinear ) THEN
+	   buff = VAR_TITLE( cx_curv)
+	   dlen = TM_LENSTR1(buff)
+	ELSE
+	   buff = AX_TITLE( idim, grid, dlen )	! risc_buff as of 6/95
+	ENDIF
+	IF ( x_or_y .EQ. 'X' ) THEN
+           labelht = hxlab
+	   CALL PUT_LABEL( ppl_xlab, dummy, dummy, dummy,
+     .                     labelht, buff(:dlen), dummy, dummy )
+	ELSE
+           labelht = hylab
+	   CALL PUT_LABEL( ppl_ylab, dummy, dummy, dummy,
+     .                     labelht, buff(:dlen), dummy, dummy )
+	ENDIF
+	RETURN
+      END
diff --git a/fer/plt/box_label.F b/fer/plt/box_label.F
new file mode 100644
index 0000000..6ef25e0
--- /dev/null
+++ b/fer/plt/box_label.F
@@ -0,0 +1,227 @@
+	SUBROUTINE BOX_LABEL( lab_type, string, xpos, ypos, xsize, ysize,
+     .			      lab_ht, justify, xaxrel, yaxrel )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a PLOT+ label that fits within the designated box
+* if necessary, use commas in the text as places where the string can be broken
+* into 2 lines
+* the position given refers to the lower left of the box
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+*	 3/30/90 - use font info in calling SYMWID
+* Unix/RISC port - 1/91 - cant use "//" with CHAR*(*)
+* v552 *acm* 3/03 multi-line strings in titles and labels.
+*                 If the string starts with @ do not set ASCII font
+*                 for title and X and Y label; lets user set pen and font.
+*                 Note can do colors and ASCII fonts, if set pen first: @P2 at AC
+* V68  *acm*  4/11 - more on bug 1098. Break up labels by sending <NL> to pplus
+*                    instead of creating multiple moveable labels. 
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations
+	INTEGER lab_type, justify, xaxrel, yaxrel, k, numlines
+	REAL	xpos, ypos, xsize, ysize, lab_ht
+	CHARACTER string*(*), font*3
+
+* internal variable declarations
+        INTEGER lnbeg(250), lnend(250)
+	INTEGER	TM_LENSTR1, slen, nfont, brk_pt, nex_brk_pt, 
+     .          las_brk_pt, nlines
+	REAL	ymid, width, ht, frac, frac_width, las_frac, xend,
+     .          htsave
+        REAL*4  SYMWID, rht
+	CHARACTER*1 break_char
+
+* initialize
+	ymid = ypos + ysize*0.5
+	ht = MIN( lab_ht, ysize )
+	slen = TM_LENSTR1( string )
+
+* Choose the break character. If there are commas use them. If there
+* are any slashes, use that.  Else use underscore or dash.
+
+	break_char = ','
+	brk_pt = INDEX( string(:slen), break_char )
+	IF (brk_pt .EQ. 0) THEN
+	   IF (INDEX( string(:slen), '/' ) .NE. 0) break_char = '/'
+	   brk_pt = INDEX( string(:slen), break_char )
+	ENDIF 
+	IF (brk_pt .EQ. 0) THEN
+	   IF (INDEX( string(:slen), '_' ) .NE. 0) break_char = '_'
+	   brk_pt = INDEX( string(:slen), break_char )
+	ENDIF 
+	IF (brk_pt .EQ. 0) THEN
+	   IF (INDEX( string(:slen), '-' ) .NE. 0) break_char = '-'
+	   brk_pt = INDEX( string(:slen), break_char )
+	ENDIF 
+
+	brk_pt = INDEX( string(:slen), break_char )
+	risc_buff = string			! for RISC/FORTRAN
+
+* compute the width of the string in the font that it will be presented
+        numlines = 1
+        call tm_break_lines (string, lnbeg, lnend, numlines)
+
+* select PLOT+ font
+
+        nfont = 0
+
+	IF ( .NOT.mode_font_ascii ) THEN
+	   font = ' '
+	ELSEIF ( lab_type .EQ. ppl_title ) THEN
+	   font = '@AC'
+           nfont = 3
+	ELSE
+	   font = '@AS'
+           nfont = 3
+	ENDIF
+
+* Let user select the font if they want
+
+        IF (string(1:1) .EQ. "@") THEN
+           font = ' '
+           nfont = 0
+        ENDIF
+
+        width = 0.
+        rht = ht
+        DO 330 k = 1, numlines
+           slen = lnend(k) - lnbeg(k) + 1
+           risc_buff = string(lnbeg(k):lnend(k) )
+           width = MAX(width, DBLE(SYMWID( rht, 
+     .          slen+nfont, font//risc_buff(:slen) )))
+  330      CONTINUE
+
+	slen = TM_LENSTR1( string )
+	risc_buff = string			! for RISC/FORTRAN
+
+* left or right justify or center
+	xend = xpos
+	IF ( xaxrel .EQ. lab_loc_absolute ) THEN
+	   IF ( justify .EQ. ppl_right_just ) THEN
+	      xend = xpos + xsize   
+	   ELSEIF ( justify .EQ. ppl_centered ) THEN
+	      xend = xpos + 0.5*xsize
+	   ENDIF
+	ENDIF
+
+* titles and axis labels cannot be broken into multiple lines
+* (unless the user does it with <NL> inserted in the strings)
+
+	nlines = 2
+	IF ( (lab_type.EQ.ppl_title) .OR. (lab_type.EQ.ppl_xlab) 
+     .        .OR. (lab_type.EQ.ppl_ylab)  ) THEN
+	   nlines = 1
+	ENDIF
+
+* should we write the label in a single line ?
+	IF ( nlines .LT. 2
+     .	.OR. width .LE. xsize*1.8
+     .	.OR. brk_pt.EQ.0 .OR. brk_pt.EQ.slen ) GOTO 500
+
+* it's too big - we will try to write it as 2 lines
+* ... break into pieces as close to halves as possible
+	las_frac = 999.0
+ 100	IF ( .NOT.mode_font_ascii ) THEN
+	   rht = ht
+	   frac_width = DBLE(SYMWID(rht,brk_pt,string(:brk_pt) ))
+	ELSEIF ( lab_type .EQ. ppl_title ) THEN
+	   rht = ht
+c	   frac_width = DBLE(SYMWID( ht, brk_pt+3, '@AC'//risc_buff(:brk_pt)  ))
+	   frac_width = DBLE(SYMWID( ht, brk_pt, risc_buff(:brk_pt)  ))
+	ELSE
+	   rht = ht
+c	   frac_width = DBLE(SYMWID( ht, brk_pt+3, '@AS'//risc_buff(:brk_pt)  ))
+	   frac_width = DBLE(SYMWID( ht, brk_pt, risc_buff(:brk_pt)  ))
+	ENDIF
+	frac = frac_width / width
+	IF ( ABS(0.5-frac) .LT. ABS(0.5-las_frac) ) THEN
+	   nex_brk_pt = INDEX( string(brk_pt+1:), break_char ) + brk_pt
+	   IF ( nex_brk_pt.EQ.brk_pt .OR. nex_brk_pt.EQ.slen ) GOTO 200
+	   las_frac   = frac
+	   las_brk_pt = brk_pt
+	   brk_pt     = nex_brk_pt
+	   GOTO 100
+
+	ELSEIF ( frac .GT. las_frac ) THEN
+	   brk_pt = las_brk_pt
+	   frac = las_frac
+
+	ENDIF
+
+* don't break into 2 lines unless both lines are reasonably long
+	IF ( frac.LT.0.2 .OR. frac.GT.0.8 ) GOTO 500
+
+* WRITE STRING AS 2 LINES
+ 200	width = MAX(frac, 1.-frac) * width
+	ht = MIN( ysize*0.4, ht*MIN(1.,xsize/width) )
+
+* ... line 1<NL>line 2
+	CALL PUT_LABEL( lab_type, xend, ymid, justify, ht,
+     .			string(:brk_pt)//'<NL>'//string(brk_pt+1:), 
+     .			xaxrel, yaxrel )
+	RETURN
+
+
+* WRITE STRING AS 1 LINE
+ 500	htsave = ht
+
+* Adjust character size for the length of the longest line
+        ht = ht * MIN(1., 1.25* xsize/width)
+
+* Adjust character size for the number of lines
+        IF (lab_type .NE. ppl_movlab) THEN
+           IF  (numlines .GE. 4 .AND. ht .EQ. htsave) ht = 0.5*ht
+           IF  (numlines .EQ. 3 .AND. ht .EQ. htsave) ht = 0.65*ht
+           IF  (numlines .EQ. 2 .AND. ht .EQ. htsave) ht = 0.8*ht
+        ENDIF
+
+	CALL PUT_LABEL( lab_type, xend, ymid-0.5*ht, justify, ht,
+     .			string(:slen), xaxrel, yaxrel )
+	RETURN
+	END
diff --git a/fer/plt/cancel_window.F b/fer/plt/cancel_window.F
new file mode 100644
index 0000000..0715238
--- /dev/null
+++ b/fer/plt/cancel_window.F
@@ -0,0 +1,173 @@
+      SUBROUTINE CANCEL_WINDOW( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete a window from the display.  If it was currently active then make the
+* main window active
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/29/88
+* V200:	12/20/89 - changed from UIS to Xwindows
+*	 3/13/90 - start PPLUS if not already started, check mode_GKS
+* V320:  2/28/95 - set a flag for ferret_dispatch so it can keep GUI informed
+*		   of window opens/closes
+* V400:  6/20/95 - remove changes from 2/28/95 -- state change on windows
+*		will be detected by mismatch between wn_open AND 
+*		gui_window_reported
+* *js* 12.12.97 Don't allow windows to be canceled when running in batch mode
+* *kob* 1.29.97 changed "can\'t" to cannot for compiler reasons
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* PyFr *kms*  1/13 Broke out the code actually cancelling a window 
+*                  into the subroutine CANCEL_WINDOW_NUM.
+* PyFr *kms*  7/13 Do not call START_PPLUS; if it is not started,
+*                  there are no windows open.
+
+        include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xgui.cmn'
+	include	'pltcom_dat.decl'	! with sizing data, etc.
+	include	'PLTCOM.DAT'	! with sizing data, etc.
+	include	'gkscm1_inc.decl'	! with gks common
+	include	'GKSCM1.INC'	! with gks common
+	
+* calling argument declarations:
+	INTEGER		status
+
+* internal variable declarations:
+	LOGICAL 	TM_DIGIT
+	INTEGER 	n, n_lo, n_hi, lo
+	CHARACTER	buffer*24
+
+* local parameter declarations:
+	INTEGER		slash_all
+	PARAMETER     ( slash_all = 0+1 )
+
+* get window numbers to close
+	IF ( qual_given( slash_all ) .GT. 0 ) THEN
+* ... /ALL
+	   n_lo = 1
+	   n_hi = max_windows
+	
+	ELSEIF ( num_args .EQ. 0 ) THEN
+* ... CANCEL WINDOW -- what window ?
+	   CALL ERRMSG
+     .		(ferr_invalid_command,status,'specify window # or /ALL',*5000)
+
+	ELSE
+* ... use number given
+	   buffer = cmnd_buff(arg_start(1):arg_end(1)) 
+	   IF ( .NOT.TM_DIGIT( buffer ) ) GOTO 5020
+	   READ ( buffer, *, ERR=5020 ) n
+	   n_lo = n
+	   n_hi = n
+	ENDIF	   
+
+* valid number ?
+ 60	IF ( n_lo.LT.1 .OR. n_hi.GT.max_windows ) 
+     .     CALL ERRMSG( ferr_out_of_range, status, 
+     .                  'legal numbers are 1-9', *5000 )
+
+* loop through all requested windows
+	DO 100 n = n_lo, n_hi
+           CALL CANCEL_WINDOW_NUM(n)
+ 100	CONTINUE
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit(s)
+ 5000	RETURN
+! 5010	CALL ERRMSG(ferr_erreq,status,'closing window',*5000)
+ 5020	CALL ERRMSG(ferr_invalid_command,status,buffer,*5000)
+	END
+
+
+*
+* Deactive,if active, and close the specified window.  
+*
+* Made into a separate routine for calling from 
+* CREATE_WINDOW when the graphics engine for a window 
+* is modified.
+*
+        SUBROUTINE CANCEL_WINDOW_NUM(n)
+
+        include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xgui.cmn'
+	include	'pltcom_dat.decl'	! with sizing data, etc.
+	include	'PLTCOM.DAT'	! with sizing data, etc.
+	include	'gkscm1_inc.decl'	! with gks common
+	include	'GKSCM1.INC'	! with gks common
+
+* calling argument declarations:
+        INTEGER n, lo
+
+        IF ( .NOT.wn_open( n ) ) RETURN
+
+* currently active ?
+        IF ( wn_active(n) ) THEN
+* ... clear segments from it
+           CALL SET_VIEWPORT( mvp_dflt )
+* ... deactivate it
+           CALL FGD_GDAWK( n )
+           wn_active( n ) = .FALSE.
+* ... activate lowest available window, if any
+           DO 70 lo = 1, max_windows
+              IF ( lo.NE.n  .AND. wn_open(lo) ) THEN
+                 CALL FGD_GACWK( lo )
+                 wn_active( lo ) = .TRUE.
+                 wsid = lo
+                 GOTO 80
+              ENDIF
+ 70        CONTINUE
+           wsid = 0           ! no active window if we get here
+        ENDIF
+            
+* close the specified window
+ 80     CALL FGD_GCLWK( n )
+        wn_open ( n ) = .FALSE.
+
+        RETURN
+        END
diff --git a/fer/plt/check_graphics.F b/fer/plt/check_graphics.F
new file mode 100644
index 0000000..112305a
--- /dev/null
+++ b/fer/plt/check_graphics.F
@@ -0,0 +1,68 @@
+	SUBROUTINE CHECK_GRAPHICS( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if there is a graphics output ready to recieve output
+* (this routine assumes that PPLUS has been started)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  3/12/90 - written to permit metafile-only output
+* v530: 1/00 *kob* - added info to check if animations are in progress
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'gkscm1_inc.decl'	! with wsid
+	include	'GKSCM1.INC'	! with wsid
+
+* calling argument declarations
+	INTEGER	status
+
+        IF ( wsid .EQ. 0 ) GOTO 5100
+
+* success
+	status = ferr_ok
+ 5000	RETURN
+
+* not output device is ready
+ 5100	CALL ERRMSG( ferr_state_not_set, status,
+     .		     'no graphical output'//pCR//
+     .		     'Use SET WINDOW', *5000 )
+	END
diff --git a/fer/plt/choose_cx_ww.F b/fer/plt/choose_cx_ww.F
new file mode 100644
index 0000000..6ee1ceb
--- /dev/null
+++ b/fer/plt/choose_cx_ww.F
@@ -0,0 +1,138 @@
+	SUBROUTINE CHOOSE_CX_WW( uvar, exp_cx, imp_cx, idim, ww_lo, ww_hi, np)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given an explicit context which may or may not contain data and an
+* implicit context which is always fleshed out determine the proper
+* world coordinate limits for the specified axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/19/89-8/6/89 (time representations)
+* 	 3/2/90 - bug fix: variable, grid, not defined correctly
+* V320:  3/2/95 - trim the 1/2 grid box fringe around CONTOUR and FILL plots
+*               This is OK to do because /xlimits and /ylimits offer explicit
+*               over-ride options
+*       8/97 - *kob*  - check cx_calender rather than ww_low to see if time entered is a
+*                       date string or a time step
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER uvar, exp_cx, imp_cx, idim, np
+	REAL*8	ww_lo, ww_hi
+
+* internal variable declarations:
+	INTEGER	imp_ndim, exp_ndim, imp_dim(4), exp_dim(4), grid,
+     .		lo_edge, hi_edge
+	REAL*8	TM_WORLD, SECS_TO_TSTEP, ww_low, ww_hiw
+
+* initialize
+* always use the grid carried with the data itself for ww/ss translations
+	grid = cx_grid( imp_cx )
+
+* default is to use the limits associated with the data itself
+	   ww_lo = cx_lo_ww(idim,imp_cx)
+	   ww_hi = cx_hi_ww(idim,imp_cx)
+	   lo_edge =  box_lo_lim
+	   hi_edge =  box_hi_lim
+
+* 3/95 but for contour (and filled contour) plots we can only plot the edges
+* up to the actual location of the point
+        IF ( cmnd_num .EQ. cmnd_contour ) THEN
+           ww_lo = MAX( ww_lo,
+     .                  TM_WORLD(cx_lo_ss(imp_cx,idim),grid,idim,
+     .                           box_middle)                    )
+           ww_hi = MIN( ww_hi,
+     .                  TM_WORLD(cx_hi_ss(imp_cx,idim),grid,idim,
+     .                           box_middle)                    )
+        ENDIF
+
+* contour expression has its own limits imbedded ?
+	IF ( uvar_given(idim,uvar) .LT. uvlim_needed ) RETURN
+
+* contour expression depends on command limits - use 'em
+* (test for unspecified in case limits came from file information)
+	IF ( cx_by_ss(idim,exp_cx) ) THEN
+	   IF ( cx_lo_ss(exp_cx,idim).EQ.unspecified_int4 ) THEN
+	      RETURN
+	   ELSE
+	      ww_lo = MAX(TM_WORLD(cx_lo_ss(exp_cx,idim),grid,idim,
+     .                    lo_edge),
+     .			  cx_lo_ww(idim,imp_cx) )
+	      ww_hi = MIN(TM_WORLD(cx_hi_ss(exp_cx,idim),grid,idim,
+     .                    hi_edge),
+     .			  cx_hi_ww(idim,imp_cx) )
+	   ENDIF
+	ELSE
+	   IF ( cx_lo_ww(idim,exp_cx).EQ.unspecified_val8 ) THEN
+	      RETURN
+	   ELSE
+* ... explicit limits can further restrict, but not expand
+* 8/97 *kob* - check cx_calender for a date time rather than ww_low
+	      ww_low = cx_lo_ww( idim, exp_cx )
+	      ww_hiw = cx_hi_ww( idim, exp_cx )
+	      IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. 
+     .             cx_calendar(exp_cx) ) THEN
+	         ww_low = SECS_TO_TSTEP( grid, idim, -ww_low )  
+	         ww_hiw = SECS_TO_TSTEP( grid, idim, -ww_hiw )  
+	      ENDIF                                     
+	      ww_lo = MAX( ww_low, ww_lo )
+	      ww_hi = MIN( ww_hiw, ww_hi )
+	   ENDIF
+	ENDIF
+	
+
+* For a one-point axis and contour plot, return the lo and hi ww requested
+        IF (np .EQ. 1) THEN
+	   ww_lo = cx_lo_ww(idim,imp_cx)
+	   ww_hi = cx_hi_ww(idim,imp_cx)
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/ck_gks_active.F b/fer/plt/ck_gks_active.F
new file mode 100644
index 0000000..5bd33d0
--- /dev/null
+++ b/fer/plt/ck_gks_active.F
@@ -0,0 +1,79 @@
+      SUBROUTINE CK_GKS_ACTIVE( * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check if GKS is avtive - if not declare error and take abnormal return
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 12/20/89
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+        include 'ferret.parm'
+        include 'errmsg.parm'
+        include 'pltcom_dat.decl'   ! with gksopn
+        include 'PLTCOM.DAT'   ! with gksopn
+
+        external errmsg
+
+* calling argument declarations:
+*       ...
+
+* internal variable declarations:
+        INTEGER state, status
+
+        IF ( .NOT. gksopn ) GOTO 4900
+
+* get GKS operating state
+        CALL FGD_GQOPS( state )
+
+* states:
+*       0 - GKS closed
+*       1 - GKS open
+*       2 - At least 1 workstation is open
+*       3 - At least 1 workstation is active
+*       4 - a segment is open
+
+        IF ( state .GE. 3 ) RETURN
+
+* GKS isn't ready !!
+ 4900   CALL ERRMSG( ferr_state_not_set, status,
+     .       'graphical output device isnt ready', *5000 )
+ 5000   RETURN 1
+
+        END
diff --git a/fer/plt/clear_window.F b/fer/plt/clear_window.F
new file mode 100644
index 0000000..a091719
--- /dev/null
+++ b/fer/plt/clear_window.F
@@ -0,0 +1,79 @@
+	SUBROUTINE CLEAR_WINDOW( wid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* clear full window
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   4/2/90
+* V230: 11/19/92 - clear protected colors
+* V411:  9/5/95 - explicitly delete each segment before calling GCLRWK
+*	to avoid XGKS memory leak in that routine
+* V602: *acm* 1/07 Changes for metafile-batch mode
+* PyFr *kms*  1/12 "metafile" no longer closed since it is not a separate entity
+* PyFr *kms*  7/13 No need to delete segments when clearing the whole window
+*                  in PyFerret; FGD_GCLRWK deletes them all in PyFerret
+
+	include 'plot_setup.parm'
+	include 'xplot_state.cmn'		! viewport info
+	include	'pltcom_dat.decl'	! with gksopn
+	include	'PLTCOM.DAT'	! with gksopn
+
+* calling argument declarations:
+	INTEGER	wid, ivp, iseg, istate
+
+* internal variable declarations:
+
+        CALL FGD_GQOPS (istate)
+*  mark segment as deleted
+	DO 200 ivp =  mvp_dflt, max_viewport
+	   vp_seg0(ivp) = 0
+	   vp_segn(ivp) = 0
+ 200	CONTINUE
+
+* tell GKS to clear the named "workstation" (window)
+
+        CALL FGD_GQOPS (istate)
+	IF (istate .GE. 2) CALL FGD_GCLRWK(wid,0)
+
+* tell PPLUS to release protected colors (on viewports and overlays)
+        CALL PPL_SHASET( 'RESET' )
+
+	RETURN
+	END
diff --git a/fer/plt/compound_key.F b/fer/plt/compound_key.F
new file mode 100644
index 0000000..4b9bc20
--- /dev/null
+++ b/fer/plt/compound_key.F
@@ -0,0 +1,75 @@
+	CHARACTER*(*) FUNCTION COMPOUND_KEY( cx_list, ncx, flags, tlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a full title for a plot 
+* - possibly with more than one variable documented
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+* V200:   1/4/89
+
+* calling argument declarations:
+	INTEGER	ncx, cx_list(ncx), flags(0:12), tlen
+
+* internal variable declarations:
+	CHARACTER*200	KEY_STRING
+	INTEGER		slen, maxlen, i
+
+	include 'ferret.parm'
+
+* maximum title length
+	maxlen = LEN( COMPOUND_KEY )
+
+* initialize to the first variable context
+	COMPOUND_KEY = KEY_STRING( cx_list(1), flags, tlen )
+
+* add any remaining variables separated by commas
+	DO 100 i = 2, ncx
+	   COMPOUND_KEY = COMPOUND_KEY(:tlen)//' , '//
+     .			  KEY_STRING( cx_list(i), flags, slen )
+	   tlen = MIN( maxlen, tlen+slen+3 )
+ 100	CONTINUE
+
+* in case it was too long give an indication
+	IF ( tlen .EQ. maxlen ) COMPOUND_KEY(tlen:tlen) = '*'
+
+	RETURN
+	END
diff --git a/fer/plt/curv_coord_add_sub.F b/fer/plt/curv_coord_add_sub.F
new file mode 100644
index 0000000..21b7e13
--- /dev/null
+++ b/fer/plt/curv_coord_add_sub.F
@@ -0,0 +1,346 @@
+	SUBROUTINE CURV_COORD_ADD_SUB( xi, yj, npt, xfield, yfield,
+     .				   xinv, yinv, xadd, first, 
+     .				   xfield_is_modulo, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert the incoming coordinate arrays (xi,yj), which are "fractional
+* indices" into true (X,Y) world coordinates by bi-linear interpolation
+* in the coordinate arrays, xfield, yfield
+
+*        from curv_coord_sub
+* V58+:  1/2005 ACM see if the longitude coordinates around the
+*                   x coordinate have crossed a branch cut, and 
+*                   if so correct the interpolants. Allows the
+*                   calling routine to add a modulo offset to the
+*                   longitudes.
+* V612: 7/08 *acm*  Fix bug 1589; if the units of the coordinates are not degrees
+*                   then dont try to see if we are near the branch cut.
+* V63   9/09 *acm* Fix bug 1688: curvlinear plots when the curv. coords are NOT
+*                  longitude and latitude.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcurvilinear.cmn'
+
+* calling argument declarations:
+        LOGICAL first, xfield_is_modulo
+	INTEGER npt, status
+#ifdef double_p
+	REAL*4  xinv, yinv, xadd
+	REAL*8	xi(npt), yj(npt),
+     .		xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+#else
+	REAL    xi(npt), yj(npt),
+     .		xinv, yinv, xadd
+	REAL	xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+#endif
+
+* internal variable declarations:
+
+	INTEGER xlo_dim1, xhi_dim1, xlo_dim2, xhi_dim2,
+     .		ylo_dim1, yhi_dim1, ylo_dim2, yhi_dim2, 
+     .          i, j, nx, ny, count_outliers, min_outliers, mid_y
+	REAL xfrac, yfrac, xit, yjt,
+     .	     x11, x12, x21, x22,
+     .	     y11, y12, y21, y22,
+     .       diff, dx_approx
+	CHARACTER*1 dim
+	LOGICAL TM_FPEQ
+
+        REAL branch_test, lon_degrees
+
+	curv_missing = .FALSE.
+        branch_test = 190.
+        lon_degrees = 360.
+	
+        IF (.NOT.units_degrees) xfield_is_modulo = .FALSE.
+
+* See if the xfield extends over 360 degrees. Do the outer values 
+* differ by about 360 ( relative to the size of the grid)?
+* Allow a few odd ones, perhaps at the edges of the domain.
+
+        IF (dim1_modulo .AND. first) THEN
+           xfield_is_modulo = .FALSE.
+           nx = xpos_hiss_dim1-xpos_loss_dim1
+           ny = xpos_hiss_dim2-xpos_loss_dim2
+           dx_approx = 360./FLOAT(nx)
+           mid_y = xpos_loss_dim2 + INT(ny/2)
+           dx_approx = ABS( xfield(xpos_hiss_dim1,mid_y) + 
+     .       xfield(xpos_loss_dim1,mid_y) )/FLOAT(nx)
+           count_outliers = 0
+
+           DO j = xpos_loss_dim2,xpos_hiss_dim2
+              diff = xfield(xpos_hiss_dim1,j) - xfield(xpos_loss_dim1,j)
+              IF (ABS(diff-360.) .GT. 2.*dx_approx) 
+     .            count_outliers = count_outliers+1
+           ENDDO
+   
+           min_outliers = max(1,INT(ny/20))
+           xfield_is_modulo = count_outliers .LT. min_outliers
+	   IF (.NOT.units_degrees) xfield_is_modulo = .FALSE.
+
+           first = .FALSE.
+        ENDIF
+   
+   	DO 100 i = 1, npt
+   
+* transfer coordinate pair to temporary variables
+   	xit = xi(i)
+   	yjt = yj(i)
+
+* clip to the limits of the axis subscripts
+c	IF ( .NOT.(dim1_modulo.OR.dim1_edges) ) THEN
+	IF ( .NOT.(xfield_is_modulo.OR.dim1_edges) ) THEN
+	   IF (xit .LT. minss_dim1) xit = minss_dim1
+	   IF (xit .GT. maxss_dim1) xit = maxss_dim1
+	ENDIF
+	IF ( .NOT.(dim2_modulo.OR.dim2_edges) ) THEN
+	   IF (yjt .LT. minss_dim2) yjt = minss_dim2
+	   IF (yjt .GT. maxss_dim2) yjt = maxss_dim2
+	ENDIF
+
+* determine the surrounding index values for both coordinates
+* (only the X component for now ... Y conponent later)
+	xlo_dim1 = INT(xit)
+	IF ( FLOAT(xlo_dim1) .EQ. xit ) THEN
+	   xhi_dim1 = xlo_dim1
+	ELSE
+	   IF (xit .LT. 0.) xlo_dim1 = xlo_dim1 - 1  ! neg val to round down
+	   xhi_dim1 = xlo_dim1 + 1
+	ENDIF
+	xlo_dim2 = INT(yjt)
+	IF ( FLOAT(xlo_dim2) .EQ. yjt ) THEN
+	   xhi_dim2 = xlo_dim2
+	ELSE
+	   IF (yjt .LT. 0.) xlo_dim2 = xlo_dim2 - 1  ! neg val to round down
+	   xhi_dim2 = xlo_dim2 + 1
+	ENDIF
+
+* determine the interpolation coefficients
+	xfrac = xit - xlo_dim1
+	yfrac = yjt - xlo_dim2
+
+* apply modulo wrapping
+* Note: this logic assumes that modulo wrapping is applied to indices
+*   that are at most one point beyond the edge of the coordinate fields.
+*   This is consistent with the index requirements of CONTOUR and SHADE
+* e.g. an input of xi=0.5 would result in xlo_dim1=N, xhi_dim1=1
+
+        IF ( dim1_modulo .AND. xfield_is_modulo) THEN
+	   IF ( xlo_dim1 .LT. minss_dim1 ) THEN
+              xlo_dim1 = maxss_dim1
+           ENDIF
+	   IF ( xlo_dim1 .GT. maxss_dim1 ) THEN
+              xlo_dim1 = minss_dim1
+           ENDIF
+	   IF ( xhi_dim1 .LT. minss_dim1 ) THEN
+              xhi_dim1 = maxss_dim1
+           ENDIF
+	   IF ( xhi_dim1 .GT. maxss_dim1 ) THEN
+              xhi_dim1 = minss_dim1
+           ENDIF
+	ENDIF
+	IF ( dim2_modulo ) THEN
+	   IF ( xlo_dim2 .LT. minss_dim2 ) xlo_dim2 = maxss_dim2
+	   IF ( xlo_dim2 .GT. maxss_dim2 ) xlo_dim2 = minss_dim2
+	   IF ( xhi_dim2 .LT. minss_dim2 ) xhi_dim2 = maxss_dim2
+	   IF ( xhi_dim2 .GT. maxss_dim2 ) xhi_dim2 = minss_dim2
+	ENDIF
+
+* Propagate the X indices to the Y field (to be modified next)
+	ylo_dim1 = xlo_dim1
+	yhi_dim1 = xhi_dim1
+	ylo_dim2 = xlo_dim2
+	yhi_dim2 = xhi_dim2
+
+* Set up for degenerate coordinate fields (single point on an axis)
+* e.g.  SHADE vals2D xpos1d ypos1d
+	IF (xspan_1_dim1) THEN
+	   xlo_dim1 = minss_dim1
+	   xhi_dim1 = xlo_dim1
+	ENDIF
+	IF (xspan_1_dim2) THEN
+	   xlo_dim2 = minss_dim2
+	   xhi_dim2 = xlo_dim2
+	ENDIF
+	IF (yspan_1_dim1) THEN
+	   ylo_dim1 = minss_dim1
+	   yhi_dim1 = ylo_dim1
+	ENDIF
+	IF (yspan_1_dim2) THEN
+	   ylo_dim2 = minss_dim2
+	   yhi_dim2 = ylo_dim2
+	ENDIF
+
+* The indexing of the X and Y fields may each be offset from the indices given
+	xlo_dim1 = xlo_dim1 + xpos_off0_dim1
+	xhi_dim1 = xhi_dim1 + xpos_off0_dim1
+	xlo_dim2 = xlo_dim2 + xpos_off0_dim2
+	xhi_dim2 = xhi_dim2 + xpos_off0_dim2
+
+	ylo_dim1 = ylo_dim1 + ypos_off0_dim1
+	yhi_dim1 = yhi_dim1 + ypos_off0_dim1
+	ylo_dim2 = ylo_dim2 + ypos_off0_dim2
+	yhi_dim2 = yhi_dim2 + ypos_off0_dim2
+
+* get the interpolants
+*	        (x,y)22           (x,y)22
+*	
+*	             	 (ix,jy)
+*	
+*	        (x,y)11           (x,y)12
+
+	x11 = xfield(xlo_dim1, xlo_dim2)
+	x12 = xfield(xhi_dim1, xlo_dim2)
+	x21 = xfield(xlo_dim1, xhi_dim2)
+	x22 = xfield(xhi_dim1, xhi_dim2)
+
+	y11 = yfield(ylo_dim1, ylo_dim2)
+	y12 = yfield(yhi_dim1, ylo_dim2)
+	y21 = yfield(ylo_dim1, yhi_dim2)
+	y22 = yfield(yhi_dim1, yhi_dim2)
+
+* check that all of the needed interpolants exist
+	IF ( TM_FPEQ(x11,badxcurv)
+     .	.OR. TM_FPEQ(x12,badxcurv)
+     .	.OR. TM_FPEQ(x21,badxcurv)
+     .	.OR. TM_FPEQ(x22,badxcurv)) THEN
+	   dim = 'X'
+	   GOTO 5100
+	ELSEIF (
+     .	     TM_FPEQ(y11,badycurv)
+     .	.OR. TM_FPEQ(y12,badycurv)
+     .	.OR. TM_FPEQ(y21,badycurv)
+     .	.OR. TM_FPEQ(y22,badycurv) ) THEN
+	   dim = 'Y'
+	   GOTO 5100
+	ENDIF
+
+C Check to see if any of the longitudes have crossed a branch cut.
+C add or subtract local coordinates to correct for this. Puts all 
+C coordinates on the same branch as x11
+
+       IF (units_degrees) THEN
+
+          IF (ABS(x11-x12) .GT. branch_test) THEN
+              IF (x11 .GT. x12) THEN
+                 x12 = x12 + lon_degrees
+              ELSE
+                 x12 = x12 - lon_degrees
+              ENDIF
+           ENDIF
+           IF (ABS(x11-x21) .GT. branch_test) THEN
+              IF (x11 .GT. x21) THEN
+                 x21 = x21 + lon_degrees
+              ELSE
+                 x21 = x21 - lon_degrees
+              ENDIF
+           ENDIF
+           IF (ABS(x11-x22) .GT. branch_test)   THEN
+              IF (x11 .GT. x22) THEN
+                 x22 = x22 + lon_degrees
+              ELSE
+                 x22 = x22 - lon_degrees
+              ENDIF
+           ENDIF
+
+        ENDIF ! units_degrees
+
+* perform the interpolation
+	xi(i) = (x11*(1.-xfrac) + x12*(xfrac)) * (1.-yfrac)
+     .	      + (x21*(1.-xfrac) + x22*(xfrac)) * (yfrac)
+	yj(i) = (y11*(1.-xfrac) + y12*(xfrac)) * (1.-yfrac)
+     .	      + (y21*(1.-xfrac) + y22*(xfrac)) * (yfrac)
+
+ 100	CONTINUE
+
+* Check longitudes for a branch point
+
+        x11 = xi(1)
+        DO 108 i = 2, npt
+           IF (ABS(x11-xi(i)) .GT. branch_test .AND. units_degrees) THEN
+              IF (x11 .GT. xi(i)) THEN
+                 xi(i) = xi(i) + lon_degrees
+              ELSE
+                 xi(i) = xi(i) - lon_degrees
+              ENDIF
+           ENDIF
+ 108    ENDDO
+
+* possibly invert the sign of the coordinates (used for descending Z axis)
+	IF ( xinv .EQ. -1. ) THEN
+	   DO 110  i = 1, npt
+ 110	   xi(i) = -1.*xi(i)
+	ENDIF
+	IF ( yinv .EQ. -1. ) THEN
+	   DO 120  i = 1, npt
+ 120	   yj(i) = -1.*yj(i)
+	ENDIF
+
+* Add the offset to the X output 
+
+	DO 130  i = 1, npt
+ 130	   xi(i) = xadd + xi(i)
+	
+
+* successful completion
+	status = 0  ! (like ferr_ok but for PLOT+)
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CONTINUE
+	curv_missing = .TRUE.
+	GOTO 5000
+c	CALL ERRMSG( ferr_out_of_range, status,
+c     .		dim//' coordinates'//pCR//
+c     .		'missing value where val is needed', *5000)
+
+	END 
diff --git a/fer/plt/curv_coord_range_sub.F b/fer/plt/curv_coord_range_sub.F
new file mode 100644
index 0000000..0055820
--- /dev/null
+++ b/fer/plt/curv_coord_range_sub.F
@@ -0,0 +1,166 @@
+	SUBROUTINE CURV_COORD_RANGE_SUB ( uc, xfield, yfield, ilo, ihi, 
+     .              jlo, jhi, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compute the range within X and Y coordinates actually needed for the 
+* hlimits and vlimits that were requested.
+*
+* V581:  1/2005 ACM 
+* V600:  9/2005 acm Fix bug 1342, curvi data with 1-d coordinates.
+*                   The loop 200 controls were wrong.
+* V600:  4/2006 fix bug where if an axis is reversed (depth axis) the
+*               comparisons also need to be reversed.
+* V602:  2/2007 Fix bug 1485; when determining the range of indices to
+*               use loop over the indices used in the projection; minss_dim1
+*               minss_dim2 etc. 
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcurvilinear.cmn'
+
+* calling argument declarations:
+	INTEGER ilo, ihi, jlo, jhi, status
+#ifdef double_p
+	REAL*4  uc(*)
+	REAL*8	xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+#else
+	REAL    uc(*)
+	REAL	xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+#endif
+
+* internal variable declarations:
+
+	LOGICAL TM_FPEQ 
+	INTEGER i, j, i1, i2, j1, j2
+        REAL xx, yy, up, dn
+
+        ilo = MAX(minss_dim1, maxss_dim1)
+        ihi = MIN(minss_dim1, maxss_dim1)
+        
+        up = MAX(uc(1), uc(2))
+        dn = MIN(uc(1), uc(2))
+
+* Loop over the indices to be used for the projection.
+* For map projections, a coord field may be 1D, in which case
+* set any missing indices to the unspecified-int flag.
+
+        i1 = minss_dim1
+        IF (xpos_loss_dim1 .EQ. unspecified_int4) i1 = xpos_loss_dim1
+        i2 = maxss_dim1
+        IF (xpos_hiss_dim1 .EQ. unspecified_int4) i2 = xpos_hiss_dim1
+        j1 = minss_dim2
+        IF (xpos_loss_dim2 .EQ. unspecified_int4) j1 = xpos_loss_dim2
+        j2 = maxss_dim2
+        IF (xpos_hiss_dim2 .EQ. unspecified_int4) j2 = xpos_hiss_dim2
+
+        DO 100 i = i1, i2
+        DO 100 j = j1, j2
+           xx = xfield(i,j)
+	   IF ( xx .EQ. badxcurv) THEN
+c              GOTO 5100 
+              GOTO 100 
+           ELSE
+              IF ( xx .GE. dn.AND.  xx .LE. up ) THEN
+                 ilo = MIN(i,ilo)
+                 ihi = MAX(i,ihi)
+              ENDIF
+	      IF (TM_FPEQ(xx, dn)) ilo = MIN(i,ilo)
+	      IF (TM_FPEQ(xx, up)) ihi = MAX(i,ihi)
+           ENDIF
+  100   CONTINUE
+
+        jlo = MAX(minss_dim2, maxss_dim2)
+        jhi = MIN(minss_dim2, maxss_dim2)
+
+        up = MAX(uc(3), uc(4))
+        dn = MIN(uc(3), uc(4))
+
+* Loop over the indices to be used for the projection.
+* For map projections, a coord field may be 1D, in which case
+* set any missing indices to the unspecified-int flag.
+
+        i1 = minss_dim1
+        IF (ypos_loss_dim1 .EQ. unspecified_int4) i1 = ypos_loss_dim1
+        i2 = maxss_dim1
+        IF (ypos_hiss_dim1 .EQ. unspecified_int4) i2 = ypos_hiss_dim1
+        j1 = minss_dim2
+        IF (ypos_loss_dim2 .EQ. unspecified_int4) j1 = ypos_loss_dim2
+        j2 = maxss_dim2
+        IF (ypos_hiss_dim2 .EQ. unspecified_int4) j2 = ypos_hiss_dim2
+
+        DO 200 i = i1, i2
+        DO 200 j = j1, j2
+           yy = yfield(i,j)
+	   IF ( yy .EQ. badycurv) THEN
+c              GOTO 5200 
+              GOTO 200 
+           ELSE
+              IF ( yy .GE. dn .AND. yy .LE. up ) THEN
+                 jlo = MIN(j, jlo)
+                 jhi = MAX(j, jhi)
+              ENDIF
+	      IF (TM_FPEQ(yy, dn)) jlo = MIN(j, jlo)
+	      IF (TM_FPEQ(yy, up)) jhi = MAX(j, jhi)
+           ENDIF
+  200   CONTINUE
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_out_of_range, status,
+     .		'X coordinates'//pCR//
+     .		'missing value where val is needed', *5000)
+ 5200	CALL ERRMSG( ferr_out_of_range, status,
+     .		'Y coordinates'//pCR//
+     .		'missing value where val is needed', *5000)
+	END 
diff --git a/fer/plt/curv_coord_sub.F b/fer/plt/curv_coord_sub.F
new file mode 100644
index 0000000..01f4d5f
--- /dev/null
+++ b/fer/plt/curv_coord_sub.F
@@ -0,0 +1,301 @@
+	SUBROUTINE CURV_COORD_SUB( xi, yj, npt, xfield, yfield,
+     .				   xinv, yinv, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert the incoming coordinate arrays (xi,yj), which are "fractional
+* indices" into true (X,Y) world coordinates by bi-linear interpolation
+* in the coordinate arrays, xfield, yfield
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 
+* V58+:  1/2005 ACM see if the longitude coordinates around x have
+*                   crossed a branch cut, and if so correct the
+*                   interpolants.
+* V612: 7/08 *acm*  Fix bug 1589; if the units of the coordinates are not degrees
+*                   then dont try to see if we are near the branch cut.
+* V63   9/09 *acm* Fix bug 1688: curvlinear plots when the curv. coords are NOT
+*                  longitude and latitude.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcurvilinear.cmn'
+
+* calling argument declarations:
+	INTEGER npt, status
+#ifdef double_p
+	REAL*4  xinv, yinv, xlo, xhi
+	REAL*8	xi(npt), yj(npt),
+     .		xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+#else
+	REAL	xfield(xpos_loss_dim1:xpos_hiss_dim1,
+     .		       xpos_loss_dim2:xpos_hiss_dim2),
+     .		yfield(ypos_loss_dim1:ypos_hiss_dim1,
+     .		       ypos_loss_dim2:ypos_hiss_dim2)
+	REAL    xi(npt), yj(npt),
+     .		xinv, yinv, xlo, xhi
+#endif
+
+
+* internal variable declarations:
+	INTEGER xlo_dim1, xhi_dim1, xlo_dim2, xhi_dim2,
+     .		ylo_dim1, yhi_dim1, ylo_dim2, yhi_dim2, i
+	REAL xfrac, yfrac, xit, yjt,
+     .	     x11, x12, x21, x22,
+     .	     y11, y12, y21, y22, aa
+	CHARACTER*1 dim
+        LOGICAL TM_FPEQ, lo, hi
+
+        REAL branch_test, lon_degrees
+
+	curv_missing = .FALSE.
+        branch_test = 190.
+        lon_degrees = 360.
+
+	DO 100 i = 1, npt
+
+* transfer coordinate pair to temporary variables
+	xit = xi(i)
+	yjt = yj(i)
+
+* clip to the limits of the axis subscripts
+	IF ( .NOT.(dim1_modulo.OR.dim1_edges) ) THEN
+	   IF (xit .LT. minss_dim1) xit = minss_dim1
+	   IF (xit .GT. maxss_dim1) xit = maxss_dim1
+	ENDIF
+	IF ( .NOT.(dim2_modulo.OR.dim2_edges) ) THEN
+	   IF (yjt .LT. minss_dim2) yjt = minss_dim2
+	   IF (yjt .GT. maxss_dim2) yjt = maxss_dim2
+	ENDIF
+
+* determine the surrounding index values for both coordinates
+* (only the X component for now ... Y conponent later)
+	xlo_dim1 = INT(xit)
+	IF ( FLOAT(xlo_dim1) .EQ. xit ) THEN
+	   xhi_dim1 = xlo_dim1
+	ELSE
+	   IF (xit .LT. 0.) xlo_dim1 = xlo_dim1 - 1  ! neg val to round down
+	   xhi_dim1 = xlo_dim1 + 1
+	ENDIF
+	xlo_dim2 = INT(yjt)
+	IF ( FLOAT(xlo_dim2) .EQ. yjt ) THEN
+	   xhi_dim2 = xlo_dim2
+	ELSE
+	   IF (yjt .LT. 0.) xlo_dim2 = xlo_dim2 - 1  ! neg val to round down
+	   xhi_dim2 = xlo_dim2 + 1
+	ENDIF
+
+* determine the interpolation coefficients
+	xfrac = xit - xlo_dim1
+	yfrac = yjt - xlo_dim2
+
+* apply modulo wrapping
+* Note: this logic assumes that modulo wrapping is applied to indices
+*   that are at most one point beyond the edge of the coordinate fields.
+*   This is consistent with the index requirements of CONTOUR and SHADE
+* e.g. an input of xi=0.5 would result in xlo_dim1=N, xhi_dim1=1
+	IF ( dim1_modulo ) THEN
+	   IF ( xlo_dim1 .LT. minss_dim1 ) xlo_dim1 = maxss_dim1
+	   IF ( xlo_dim1 .GT. maxss_dim1 ) xlo_dim1 = minss_dim1
+	   IF ( xhi_dim1 .LT. minss_dim1 ) xhi_dim1 = maxss_dim1
+	   IF ( xhi_dim1 .GT. maxss_dim1 ) xhi_dim1 = minss_dim1
+	ENDIF
+	IF ( dim2_modulo ) THEN
+	   IF ( xlo_dim2 .LT. minss_dim2 ) xlo_dim2 = maxss_dim2
+	   IF ( xlo_dim2 .GT. maxss_dim2 ) xlo_dim2 = minss_dim2
+	   IF ( xhi_dim2 .LT. minss_dim2 ) xhi_dim2 = maxss_dim2
+	   IF ( xhi_dim2 .GT. maxss_dim2 ) xhi_dim2 = minss_dim2
+	ENDIF
+
+* Propagate the X indices to the Y field (to be modified next)
+	ylo_dim1 = xlo_dim1
+	yhi_dim1 = xhi_dim1
+	ylo_dim2 = xlo_dim2
+	yhi_dim2 = xhi_dim2
+
+* Set up for degenerate coordinate fields (single point on an axis)
+* e.g.  SHADE vals2D xpos1d ypos1d
+	IF (xspan_1_dim1) THEN
+	   xlo_dim1 = minss_dim1
+	   xhi_dim1 = xlo_dim1
+	ENDIF
+	IF (xspan_1_dim2) THEN
+	   xlo_dim2 = minss_dim2
+	   xhi_dim2 = xlo_dim2
+	ENDIF
+	IF (yspan_1_dim1) THEN
+	   ylo_dim1 = minss_dim1
+	   yhi_dim1 = ylo_dim1
+	ENDIF
+	IF (yspan_1_dim2) THEN
+	   ylo_dim2 = minss_dim2
+	   yhi_dim2 = ylo_dim2
+	ENDIF
+
+* The indexing of the X and Y fields may each be offset from the indices given
+	xlo_dim1 = xlo_dim1 + xpos_off0_dim1
+	xhi_dim1 = xhi_dim1 + xpos_off0_dim1
+	xlo_dim2 = xlo_dim2 + xpos_off0_dim2
+	xhi_dim2 = xhi_dim2 + xpos_off0_dim2
+
+	ylo_dim1 = ylo_dim1 + ypos_off0_dim1
+	yhi_dim1 = yhi_dim1 + ypos_off0_dim1
+	ylo_dim2 = ylo_dim2 + ypos_off0_dim2
+	yhi_dim2 = yhi_dim2 + ypos_off0_dim2
+
+* get the interpolants
+*	        (x,y)22           (x,y)22
+*	
+*	             	 (ix,jy)
+*	
+*	        (x,y)11           (x,y)12
+
+	x11 = xfield(xlo_dim1, xlo_dim2)
+	x12 = xfield(xhi_dim1, xlo_dim2)
+	x21 = xfield(xlo_dim1, xhi_dim2)
+	x22 = xfield(xhi_dim1, xhi_dim2)
+
+	y11 = yfield(ylo_dim1, ylo_dim2)
+	y12 = yfield(yhi_dim1, ylo_dim2)
+	y21 = yfield(ylo_dim1, yhi_dim2)
+	y22 = yfield(yhi_dim1, yhi_dim2)
+
+* check that all of the needed interpolants exist3/24/2014
+	IF ( TM_FPEQ(x11,badxcurv)
+     .	.OR. TM_FPEQ(x12,badxcurv)
+     .	.OR. TM_FPEQ(x21,badxcurv)
+     .	.OR. TM_FPEQ(x22,badxcurv)) THEN
+	   dim = 'X'
+	   GOTO 5100
+	ELSEIF (
+     .	     TM_FPEQ(y11,badycurv)
+     .	.OR. TM_FPEQ(y12,badycurv)
+     .	.OR. TM_FPEQ(y21,badycurv)
+     .	.OR. TM_FPEQ(y22,badycurv) ) THEN
+	   dim = 'Y'
+	   GOTO 5100
+	ENDIF
+
+C Check to see if any of the longitudes have crossed a branch cut.
+C add or subtract local coordinates to correct for this. Puts all 
+C coordinates on the same branch as x11
+
+       IF (units_degrees) THEN
+
+          IF (ABS(x11-x12) .GT. branch_test) THEN
+              IF (x11 .GT. x12) THEN
+                 x12 = x12 + lon_degrees
+              ELSE
+                 x12 = x12 - lon_degrees
+              ENDIF
+           ENDIF
+           IF (ABS(x11-x21) .GT. branch_test) THEN
+              IF (x11 .GT. x21) THEN
+                 x21 = x21 + lon_degrees
+              ELSE
+                 x21 = x21 - lon_degrees
+              ENDIF
+           ENDIF
+           IF (ABS(x11-x22) .GT. branch_test)   THEN
+              IF (x11 .GT. x22) THEN
+                 x22 = x22 + lon_degrees
+              ELSE
+                 x22 = x22 - lon_degrees
+              ENDIF
+           ENDIF
+
+        ENDIF ! units_degrees
+
+* perform the interpolation
+	xi(i) = (x11*(1.-xfrac) + x12*(xfrac)) * (1.-yfrac)
+     .	      + (x21*(1.-xfrac) + x22*(xfrac)) * (yfrac)
+	yj(i) = (y11*(1.-xfrac) + y12*(xfrac)) * (1.-yfrac)
+     .	      + (y21*(1.-xfrac) + y22*(xfrac)) * (yfrac)
+
+ 100	CONTINUE
+
+* Check longitudes for a branch point
+
+        IF (units_degrees) THEN
+           x11 = xi(1)
+           DO 108 i = 2, npt
+              aa = ABS(x11-xi(i))
+              IF (ABS(x11-xi(i)) .GT. branch_test) THEN
+                 IF (x11 .GT. xi(i)) THEN
+                    xi(i) = xi(i) + lon_degrees
+                 ELSE
+                    xi(i) = xi(i) - lon_degrees
+                 ENDIF
+              ENDIF
+ 108       ENDDO
+        ENDIF ! units_degrees
+
+* possibly invert the sign of the coordinates (used for descending Z axis)
+	IF ( xinv .EQ. -1. ) THEN
+	   DO 110  i = 1, npt
+ 110	   xi(i) = -1.*xi(i)
+	ENDIF
+	IF ( yinv .EQ. -1. ) THEN
+	   DO 120  i = 1, npt
+ 120	   yj(i) = -1.*yj(i)
+	ENDIF
+
+* successful completion
+	status = 0  ! (like ferr_ok but for PLOT+)
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CONTINUE
+	curv_missing = .TRUE.
+	GOTO 5000
+c	CALL ERRMSG( ferr_out_of_range, status,
+c     .		dim//' coordinates'//pCR//
+c     .		'missing value where val is needed', *5000)
+
+	END 
diff --git a/fer/plt/disp_data_set_up.F b/fer/plt/disp_data_set_up.F
new file mode 100644
index 0000000..efeac27
--- /dev/null
+++ b/fer/plt/disp_data_set_up.F
@@ -0,0 +1,156 @@
+	SUBROUTINE DISP_DATA_SET_UP
+     .	( memory, ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up graphics environment and obtain the data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/7/87 
+* revision 0.1 - 2/25/87 - changes for INTERPRETATION STACK
+* revision 0.2 - 6/24/87 - changes to accomodate transposed plots
+* revision 0.3 - 9/16/87 - added want_cmnd_data to CALL GET_CMND_DATA
+* V200:  5/19/89 - 4D symmetrical
+*         5/9/90 - allow CGRID_SIZE for axes to accomodate PLOT/VS
+* V301:   1/7/94 - don't unprotect the command data cuz' GET_MEMORY is called
+*		   during set-up of plots
+* V312: 5/94 - array "memory" as a calling argument
+* V500: 2/99 *sh* - added support for POLYGON command -- working storage needs
+*       2/99 *sh* - bug fix: plot working storage based on cx(1) only
+*			can overflow for PLOT v1,v2  if v2 is bigger
+* V530: *sh* 9/00 - added initial data type support in get_cmnd_data 
+*	*sh* 1/01 - added PLOT/STEP with special work array needs
+*	          - also fixed apparent bug in loop over num_uvars_in_cmnd
+* V533: *sh* 6/01 - include CGRID_SIZE in determination of axis buffer sizes
+*	            only if PLOT/VS
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'command.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	
+* calling argument declarations:
+	INTEGER	ax1_blks, ax1_start, ax2_blks, ax2_start, status
+	REAL memory(*)
+
+* internal variable declarations:
+	LOGICAL plot_vs
+	INTEGER	MR_DIM_LEN, CX_DIM_LEN, CGRID_SIZE,
+     .		idim, ndim, dim(nferdims), mr1, ax_len, cx, ivar,
+     .		factor, loc
+	CHARACTER buff*4
+
+* check for PLOT/VS -- significant in axis buffer sizes
+	plot_vs = cmnd_num .EQ. cmnd_plot
+     .	.AND. qual_given(slash_plot_vs) .GT. 0
+
+* get the requested data somehow  (and leave it protected 1/94)
+	CALL GET_PROT_CMND_DATA ( memory, cx_last, ptype_float, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* PLOT/STEP needs double or triple the working storage
+*    double to make connected steps, triple for disconnected
+	factor = 1
+	IF (cmnd_num .EQ. cmnd_plot) THEN
+	   loc = qual_given( slash_plot_step )
+	   IF ( loc .GT. 0  ) THEN
+	      CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                           buff, status )
+              IF ( status .NE. ferr_ok ) RETURN
+	      IF ( buff(1:3) .EQ. 'con' ) THEN
+	         factor = 2
+	      ELSE
+	         factor = 3
+	      ENDIF
+	   ENDIF	   
+	ENDIF
+
+* compute working storage
+	IF (cmnd_num .EQ. cmnd_polygon) THEN
+* ... allocate buffers used to extract individual polygon coord arrays
+*     set buffer size to the longest axis of 1st coord arg
+	   cx = is_cx(1)
+	   CALL GET_CX_DIMS(cx, ndim, dim)
+	   ax_len = 1
+	   DO 100 idim = 1, ndim
+ 100	   ax_len = MAX(ax_len,
+     .			cx_hi_ss(cx,dim(idim)) - 
+     .			cx_lo_ss(cx,dim(idim)) + 1 )
+	ELSE
+* ... allocate memory used for single precision axes
+*     make them each equal to MAX in case /TRANSPOSE or mulit-dim PLOT/VS
+* (2/99: loop over all arguments to find largest requirement)
+* ?? why is CGRID_SIZE needed ... could get very large ??
+	   ax_len = 1
+	   DO 200 ivar = 1, num_uvars_in_cmnd
+	      mr1 = is_mr( ivar )
+	      CALL GET_CX_DIMS( is_cx(ivar), ndim, dim )
+	      ax_len = MAX( ax_len,
+     .			    MR_DIM_LEN( dim(1), mr1 ),
+     .		            MR_DIM_LEN( dim(2), mr1 ),
+     .			    factor*CX_DIM_LEN(dim(1), is_cx(ivar)),
+     .			    factor*CX_DIM_LEN(dim(2), is_cx(ivar)) )
+	      IF (plot_vs) ax_len =
+     .		       MAX( ax_len,
+     .		            CGRID_SIZE(is_cx(ivar))  )
+ 200	   CONTINUE
+	ENDIF
+
+* allocate working storage
+	CALL GET_MEMORY( ax_len, ax1_start, ax1_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5020
+	CALL GET_MEMORY( ax_len, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5010
+
+* successful completion
+	RETURN
+
+* error exits - release the memory used for axis buffers
+! 5000	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 5010	CALL FREE_MEMORY( ax1_start, ax2_blks )
+ 5020	CALL UNPROTECT_CMND_DATA	! added 2/99
+ 5100	RETURN
+	END
+
+
+
+
diff --git a/fer/plt/disp_init.F b/fer/plt/disp_init.F
new file mode 100644
index 0000000..3032620
--- /dev/null
+++ b/fer/plt/disp_init.F
@@ -0,0 +1,272 @@
+	SUBROUTINE DISP_INIT( no_labels, cx_list, ncx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize the underlying plot package (PPLUS) for a fresh plot
+* (this routine is not called for an overlayed plot)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/30/87 - extracted from DISP_SET_UP
+* revision 0.1 - 7/21/87 - added XAXIS, YAXIS and WINDOW initialization
+* revision 0.2 - 7/28/87 - removed LEV () to DISP_PREP, added documentation
+* revision 0.3 - 8/26/87 - added TXTYPE YR
+* revision 0.4 - 6/28/88 - added  AXLEN and AXSET
+* revision 0.5 - 8/26/88 - removed SIZE
+* revision 1.0 -  9/8/88 - removed all major re-setting to DISP_RESET 
+* revision 1.1 - 1/26/89 - bug fix: 24-->13 for length of "date time" string 
+* V200:   1/4/89 - major changes for plots with keys and joint contexts
+* V230:   6/8/92 - added WIRE command (requiring WINDOW OFF) so set WINDOW dflt
+*        7/22/92 - initialize ul_dolab so that /OVERLAYs following /NOLABEL
+*                  will have predictable results
+*        11/9/92 - unprotect colors if this is a fresh plot in a full window
+*        1/28/93 - added args to plotify_grp_cx to promote thin regions to 2D
+*       12/10/93 - set only the small tic size - do not mess with large tics
+* V301:	 1/24/94 - turn on metafiles here instead of in XEQ_SET & START_PPLUS 
+*	           (resolve problem of metafiles created with wrong name)
+* V310:  3/21/94 - squeeze unneeded blanks from "FERRET Ver.3.10"
+* v500:  1/26/99 - *kob* commented out PPLCMD call for aline, because this call
+*                  was moved to disp_prep.F so reinitialization could occur for 
+*                  plot overlays.
+* v533:  6/27/01 - *acm* call PPLCMD to initialize AXTYPE,1,1 (not log axis) and
+*		   initialize h_logaxis, v_logaxis to FALSE
+* v533:  7/11/01 - *acm* call AXSET,1,1,1,1  to set to the default state of all axes on.
+*      *acm* 10/01  remove VMS includes
+* v540 *acm*  2/02 Do not call AXSET,1,1,1,1 - want PPL AXSET settings to persist
+* V550 *acm* 12/02 use mode_labels and mode_logo to control labels and/or logo
+* v552 *acm*  3/03 new param IAXSET to restore axes after PLOT/AXES/set plot.
+* v552 *acm*  4/03 Delete symbols XAXIS_MIN, XAXIS_MAX, etc.  If they've
+*                  been set by a previous plot, they dont get reset on plots
+*                  like plot/vs xpts,ypts
+* v580 *acm* 11/04 Fix bug 1009. Distinguish between axes which really have one 
+*                  point, and those for which the hi and lo subscripts on the axes 
+*                  are undefined. When undefined return zero from CX_DIM_LEN_ZERO in
+*                  GET_CX_DIMS_ZERO. These axes are listed last in the heirarchy in 
+*                  array plot_axis().  This means we can plot a variable with just 
+*                  one point in their range (if /HLIMITS or /VLIMITS are used to give 
+*                  PPLUS a range to draw).
+* V600 *acm* 8/05 - Allow more digits in xrevision number
+* V600 *acm* 5/06 - flag no_plot_yet for applying mode_linecolors setting ...
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 Scale default lengths by pplscale; 
+*                  do not reset minor tic size (not scaled!)
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+* V686 *acm* 12 13 set up the label symbols LABNUM_E and LABNUM_F
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+	include 'xplot_state.cmn'
+	include 'xprog_state.cmn'
+	include 'xrevision.cmn'
+        include 'axis_inc.decl'    ! with iaxset
+        include 'AXIS.INC'
+
+* calling argument declarations:
+	LOGICAL no_labels
+	INTEGER ncx, cx_list(ncx)
+
+* internal variable declarations:
+	CHARACTER	TM_FMT*12, buffer*40, buffsym*30, show_str*12
+        INTEGER         idim, ier, nc, slen
+        REAL            logoht
+
+* open metafile for this new plot
+	CALL SEND_PLTYPE( mode_metafile )        ! added 1/94
+
+* PLOT5 re-initialization (to forget previous states)
+	CALL PPLCMD ( from, line, 0, 'XFOR', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YFOR', 1, 1 )
+ 	CALL PPLCMD ( from, line, 0, 'XLAB', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YLAB', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'XAXIS', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YAXIS', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'LABS ', 1, 1 )
+* 1/99 *kob* comment out call for aline as this was moved to disp_prep instead
+*	CALL PPLCMD ( from, line, 0, 'ALINE ', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'TAXIS OFF', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'TITLE', 1, 1 )
+*	CALL PPLCMD ( from, line, 0, 'TICS .125', 1, 1 )    ! chg 12/93
+	CALL PPLCMD ( from, line, 0, 'WINDOW ON', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'AXTYPE 1,1', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'XVALOFF 0', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YVALOFF 0', 1, 1 )
+
+        IF (iaxset .EQ. 1) THEN   ! If /AXES was used on prev. plot call, reset defaults
+           CALL PPL_AXES_RESTORE
+ 	   CALL PPLCMD ( from, line, 0, 'AXSET,1,1,1,1', 1, 1 )
+	   CALL PPLCMD ( from, line, 0, 'AXLABP -1,-1', 1, 1)
+           iaxset = 0
+        ENDIF
+
+
+* if the axis min and max symbols already exist then delete them
+
+        buffsym = 'XAXIS_MIN'
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'XAXIS_MAX'
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'YAXIS_MIN'
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'YAXIS_MAX'
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'X_REVERSED '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'Y_REVERSED '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+
+* If LABNUM symbols exist from a previous plot, delete them.
+
+        buffsym = 'LABNUM_X '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_Y '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_Z '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_T '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_E '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_F '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+           
+        buffsym = 'LABNUM_DSET '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_ASPECT '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_YEAR '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_DATITL '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_OFFSET '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_DODS '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+        buffsym = 'LABNUM_CALEND '
+	CALL GETSYM( buffsym, buffer, nc, ier )
+	IF ( ier .EQ. 0 ) CALL DELSYM(buffsym,nc)
+
+* free the color table on a full window
+        IF ( vp_num .EQ. mvp_dflt ) CALL PPL_SHASET( 'RESET' )
+
+* initialize labels and keys
+	nvect_on   = 0
+	ncont_on   = 0
+	nlabs_on   = 0
+	nline_on   = 0
+	nkeys_on   = 0
+	novkeys_on = 0
+	novkeys_ll = 0
+	onedee_on  = .FALSE.
+	twodee_on  = .FALSE.
+	ovkey_ll_full = .FALSE.
+	h_logaxis = .FALSE.
+	v_logaxis = .FALSE.
+        no_plot_yet = .FALSE.
+
+        DO 200 idim = 1, nferdims
+ 200    ul_dolab(idim) = .TRUE.
+
+* set up full context of plot (possibly multiple variables to plot)
+	CALL GRP_CX_DOC( cx_list, ncx, cx_plot, key_doc )
+	CALL GET_CX_DIMS_ZERO( cx_list(1), nplot_axis, plot_axis )
+	CALL PLOTIFY_GRP_CX( cx_list, ncx )
+	
+        IF (.NOT.mode_labels ) no_labels = .FALSE.  ! Apply MODE LABELS setting
+	
+	IF ( no_labels ) RETURN
+
+* set up positions for labels and keys  (including ul_dolab)
+	CALL SETUP_KEYS( ncx )
+
+* put program name and revision number onto plot
+* ... "FERRET debug Ver. x.xx"   (or "FERRET Ver. 3.10"  3/94) 
+        IF (mode_logo) THEN             ! Apply MODE LOGO setting
+           show_str = TM_FMT(revision_level, 5, 12, slen)
+	   IF ( progname_mod .NE. ' ' ) THEN
+	      WRITE ( buffer, 3010) program_name(:len_program_name),
+     .	  			 progname_mod(:len_progname_mod),
+     .				 show_str(1:slen)
+ 3010	      FORMAT(A,1X,A,' Ver.',A)
+	   ELSE
+	      WRITE ( buffer, 3011) program_name(:len_program_name),
+     .				 show_str(1:slen)
+ 3011	      FORMAT(A,' Ver. ',A)
+	   ENDIF
+           logoht = 0.5*dflt_letsize_label*textscale
+	   CALL PUT_LABEL( ppl_movlab, 
+     .                     0.0, 1.0*pplscale + 3.6*logoht,
+     .                     ppl_centered, logoht,
+     .                     buffer(:len_program_name+len_progname_mod+11),
+     .                     lab_loc_axlen_plus, lab_loc_axlen_plus )
+* ... "NOAA/PMEL TMAP"
+	   CALL PUT_LABEL( ppl_movlab, 
+     .                     0.0, 1.0*pplscale + 1.8*logoht,
+     .                     ppl_centered, logoht,
+     .                     'NOAA/PMEL TMAP',
+     .                     lab_loc_axlen_plus, lab_loc_axlen_plus )
+* ... "8-SEP-1988 11:05"
+	   CALL PUT_LABEL( ppl_movlab, 
+     .                     0.0, 1.0*pplscale,
+     .                     ppl_centered, logoht,
+     .                     '''date'' ''time''',
+     .                     lab_loc_axlen_plus, lab_loc_axlen_plus )
+        ENDIF ! mode_logo
+
+	RETURN
+	END
diff --git a/fer/plt/disp_labels.F b/fer/plt/disp_labels.F
new file mode 100644
index 0000000..fb2d6f0
--- /dev/null
+++ b/fer/plt/disp_labels.F
@@ -0,0 +1,226 @@
+	SUBROUTINE DISP_LABELS( joint_cx, year, cal_id )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* put background labels onto plot - data set name and information
+* about axes not apparent on the plot (eg. time and depth in an xy view)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/13/87 - extracted from DISP_SET_UP and modified
+* revision 0.1 - 2/25/87 - allowed for non_geographic labels
+* revision 0.2 - 4/1/88  - increased AX_TITLE size for units
+* revision 0.3 - 9/8/88  - added relative position flags to PUT_LABEL calls
+* revision 0.4 - 9/21/88 - don't update label positions if /NOLABEL
+* 			 - added time axis style: document year if taxis doesn't
+*	(bug: the year displayed should be the minimum from all the contexts.
+*		... laziness prevents me. *sh* )
+* revision 0.5 -  9/1/89 - suppress "N/A" labelling of normal axes
+* V200:  6/27/89 - ct-->cx for stylistic consistency
+*		 - base axis labelling needs on cx_lo_ww vs. mnormal
+*		 - check all variables in list to see if labels are needed
+*	12/19/89 - eliminated the possibility of multiple data set variables
+*	  1/4/89 - major revisions incorporating keys
+* Unix/RISC port 5/91 *sh*: use data set name, only (full path is too long)
+* V401: 6/23/95 - tag the movable labels by passing ppl_movlab minus nnn
+* V510 *sh* 3/00 - add DODS URL label
+* V530 *acm* 3/01 - add calendar name (if not Gregorian calendar)
+* v533 *acm* 8/01 - test for calendar label had .LT. max_calendars; needs .LE.
+*      *acm* 10/01  remove VMS includes
+* V580 *acm* 11/04 - bug 1098 url is cut off; keep going to the last /
+* V581: *acm*/3/05 - increase length of strings for dataset title to 1024
+* V68  *acm*  4/11 - more on bug 1098. Call the url the OPeNDAP label, break it up.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin to plot_setup.parm,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale or textscale.
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+	include 'xplot_state.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'axis_inc.decl'	! axis lengths
+	include 'AXIS.INC'	! axis lengths
+	include 'calendar.decl'
+	include 'calendar.cmn'
+
+* calling argument declarations:
+	INTEGER		joint_cx, cal_id
+	CHARACTER	year*4
+
+* internal variable declarations:
+	LOGICAL		show_year
+	CHARACTER	AX_TITLE*32, TM_GET_CALENDAR_NAME*32,
+     .			line_buff*1024, genl_buff*255, cal_buff*32
+	INTEGER		TM_LENSTR, idim, len, lablen,
+     .			nlabs, dset_num, tlen, lab2
+	REAL 		ul_yspace, ul_labht, ul_ypos, ul_ysqueeze,
+     .			yoff, ur_labht
+	EQUIVALENCE	( ppl_buff, genl_buff )	! save space
+
+* extra upper left label to display the year ?(in case its not on the time axis)
+	nlabs = ul_nlabs
+	show_year = year .NE. unspecified_name4
+	IF ( show_year ) nlabs = nlabs + 1
+        IF (cal_id .GT. GREGORIAN .AND. cal_id .LE. max_calendars) 
+     .     nlabs = nlabs + 1
+
+* need to reduce size of upper left labels ?
+	IF     ( nlabs .LE. 2 ) THEN
+	   ul_ysqueeze = 1.0
+	ELSEIF ( nlabs .EQ. 3 ) THEN
+	   ul_ysqueeze = 0.85
+	ELSE
+	   ul_ysqueeze = 0.65
+	ENDIF
+	ul_yspace = dflt_ul_yspace0*pplscale * ul_ysqueeze
+	ul_labht  = dflt_ul_labht0*textscale * ul_ysqueeze
+
+* define the position labels ("LATITUDE:", "DEPTH:", etc)
+* ... stack them above one another in the upper left
+	ul_ypos = dflt_ul_yorigin*pplscale + (nlabs-1)*ul_yspace
+	DO 300 idim = 1, nferdims
+	   IF ( ul_dolab(idim) ) THEN
+	      CALL ASCII_LIMITS( joint_cx, idim, line_buff, len )
+	         genl_buff = AX_TITLE( idim, cx_grid(joint_cx), tlen )
+	      CALL PUT_LABEL( ppl_movlab-idim, 
+     .                        dflt_ul_xorigin*pplscale, ul_ypos,
+     .			      ppl_left_just,
+     .			      ul_labht,
+     .			      genl_buff(:tlen)//' : '//line_buff(:len), 
+     .			      lab_loc_absolute, lab_loc_axlen_plus )
+	      ul_ypos = ul_ypos - ul_yspace
+	   ENDIF
+ 300	CONTINUE
+
+* ... add "YEAR : ($" ! kludge - unless year value indicates climatology
+	IF ( show_year ) THEN
+	   IF ( year .EQ. ' ' ) THEN
+	         line_buff = 'climatology'
+	         lablen = 11
+	   ELSE
+	         line_buff = year
+	         lablen = 4
+	   ENDIF
+	   CALL PUT_LABEL( ppl_movlab-ppl_year, 
+     .                     dflt_ul_xorigin*pplscale, ul_ypos,
+     .			   ppl_left_just,
+     .			   ul_labht,
+     .			   'YEAR : '//line_buff(:lablen),
+     .			   lab_loc_absolute, lab_loc_axlen_plus )
+	   ul_ypos = ul_ypos - ul_yspace
+	ENDIF
+
+* calendar label needed ?
+        IF (cal_id .GT. GREGORIAN .AND. cal_id .LE. max_calendars) THEN
+           cal_buff = TM_GET_CALENDAR_NAME (cal_id)
+           lablen = TM_LENSTR(cal_buff)
+
+	   CALL PUT_LABEL( ppl_movlab-ppl_calendar, 
+     .                     dflt_ul_xorigin*pplscale, ul_ypos,
+     .			   ppl_left_just,
+     .			   ul_labht,
+     .			   'CALENDAR: '//cal_buff(:lablen), 
+     .			   lab_loc_absolute, lab_loc_axlen_plus )
+	ENDIF
+
+
+* data set labels needed ?
+	dset_num = cx_data_set( joint_cx )
+	IF (  dset_num .NE. unspecified_int4
+     .	.AND. dset_num .NE. pdset_irrelevant ) THEN
+* ... name of data set
+! 5/91	   CALL GET_DSET_NAME( dset_num, line_buff, lablen )
+	   CALL GET_SHORT_DSET_NAME( dset_num, line_buff, lablen )
+
+           yoff = dflt_ul_yorigin*pplscale
+           ur_labht = dflt_ul_labht0*textscale
+	   IF ( ds_des_name(dset_num)(1:7) .EQ. 'http://' ) THEN
+              yoff = dflt_ul_yorigin*pplscale - 0.5*ul_yspace
+              ur_labht = 0.75*dflt_ul_labht0*textscale
+	   ENDIF
+	   CALL BOX_LABEL( ppl_movlab-ppl_dset, 
+     .			   'DATA SET: '//line_buff(:lablen),
+     .			   0.0, yoff,
+     .			   0.5*xlen, 1.5*dflt_letsize_label*textscale,
+     .			   ur_labht, ppl_right_just,
+     .			   lab_loc_axlen_plus, lab_loc_axlen_plus )
+
+* ... title of data set
+	   CALL GET_DSET_TITLE( dset_num, line_buff, lablen )
+	   CALL BOX_LABEL( ppl_movlab-ppl_datitl, line_buff(:lablen),
+     .			   0.5, 0.3*pplscale, 
+     .			   0.8*xlen, 1.5*dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, ppl_centered,
+     .			   lab_loc_axlen_times, lab_loc_axlen_plus )
+* ... OPeNDAP URL of data set
+* bug 1098 url is cut off; keep going to the last /
+
+	   IF ( ds_des_name(dset_num)(1:7) .EQ. 'http://' ) THEN
+	      lablen = INDEX(ds_des_name(dset_num)(8:),'/')
+              lab2 = lablen
+              DO WHILE (lab2 .GT. 0)
+ 	         lab2 = INDEX(ds_des_name(dset_num)(8+lablen:),'/')
+                 lablen = lablen + lab2
+	      ENDDO
+	      lablen = INDEX(ds_des_name(dset_num)(8+lablen:),'/')
+     .		     + 7 + lablen
+
+              yoff = dflt_ul_yorigin*pplscale + 0.5*ul_yspace
+	      CALL BOX_LABEL( ppl_movlab-ppl_dodsurl, 
+     .			   'OPeNDAP URL: '//ds_des_name(dset_num)(:lablen),
+     .			   0.0, yoff,
+     .			   0.4*xlen, 1.5*dflt_letsize_label*textscale,
+     .			   ur_labht, ppl_right_just,
+     .			   lab_loc_axlen_plus, lab_loc_axlen_plus )
+
+	   ENDIF
+	ENDIF
+
+
+	RETURN
+	END
diff --git a/fer/plt/disp_prep.F b/fer/plt/disp_prep.F
new file mode 100644
index 0000000..b54de28
--- /dev/null
+++ b/fer/plt/disp_prep.F
@@ -0,0 +1,460 @@
+	SUBROUTINE DISP_PREP( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* prepare the plot package (PPLUS) for another variable.  This routine is
+* called even for overlays
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/28/87
+* revision 1.0 - 6/22/88 - added VECSET,
+*			   added logical flags lev_given, len_given
+* revision 1.1 -  9/8/88 - added cmnd_shade
+* revision 1.2 - 4/26/89 - added direct control of PPLUS variable iautoc to
+*			   prevent PPLUS from resetting contour intervals when
+*			   /LEVELS_SAME is specified
+* V200:  1/17/90 - bug fix: set nlev2 so PLOT+ doesn't forget # of contour levs
+*		 (when levs are set automatically and then preserved via /LEV)
+*	 3/13/90 - added CHECK_GRAPHICS and status return
+*	 4/12/90 - same fix needed for /LEVELS is also needed in /LENGTH
+*	 4/16/90 - allow /LEVEL="(lo,hi,delta)" and /LENGTH=val
+* V313: *sh* AIX port.  Replace "LEV ()" with "LEV,()" so AIX space-squeezing
+*		filter doesn't corrupt this routine
+* V400:	 8/24/94 - allow /LEVELS=n to set the recommended number of levels
+* V4.1+  7/25/95 - allow automatic centered levels and delta-only levels 
+* v500 - 1/26/99 - *kob* add PPLCMD call for aline reinitialization - needed for
+*                   nolabel plot overlays
+* V608 - 10/07   - *acm* Give more detail int he error message when the number 
+*                  of contour levels given is too large
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V670  *acm* 2/11 Fix bug 1803. Centered levels confused with variance-based centered
+*                  levels.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685+ 12/13    - *acm*  bounds checking; dont refer to parts of the string outside its bounds.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'command.parm'
+	include 'slash.parm'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+	include 'xprog_state.cmn'
+	include 'parampl5_dat.decl'	! with inclen
+	include 'PARAMPL5.DAT'	! with inclen
+	include 'cont_inc.decl'	! with iautoc
+	include 'CONT.INC'	! with iautoc
+	include 'vector_inc.decl'	! with vauto
+	include 'VECTOR.INC'	! with vauto
+
+* calling argument declarations:
+	INTEGER	status
+
+* internal variable declarations:
+	LOGICAL TM_DIGIT, lev_given, len_given,
+     .		is_delta, is_std, is_mean, is_min, is_max, is_hist,
+     .          is_centered, is_openlev, is_cv, get_more,
+     .		has_std , has_mean, has_min, has_max
+	INTEGER	TM_LENSTR1,TM_LENSTR, lev_loc, len_loc, str_1, str_len, 
+     .          ii, ilen, ier, ist, nc, set_default_levs
+	REAL	val
+#ifdef double_p
+	REAL*4  rbad_val4
+#else
+	REAL  rbad_val4
+#endif
+
+* v500 - 1/26/99 *kob* double buffer size for /levels text
+* v532 - 5/11/01 *kob* increase buffer size for /levels text to 1028
+	CHARACTER str_buff*1028
+        CHARACTER*255 labsym_buff
+	CHARACTER*1 cbuf
+
+	CHARACTER TM_FMT*12, buffer*40, buff30*30
+
+* is the graphics output device open and ready ??
+	CALL CHECK_GRAPHICS( status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* initialize
+	centered  = .FALSE.
+	openlev = .FALSE.	
+	set_std = .FALSE.
+	set_mean = .FALSE.
+	set_min = .FALSE.
+	set_max = .FALSE.
+	set_delta = .FALSE.
+	need_histo = .FALSE.
+        need_std = .FALSE.
+
+	rbad_val4 = bad_val4
+	lev_mean = rbad_val4
+	lev_std = rbad_val4
+	lev_min = rbad_val4
+	lev_max = rbad_val4
+
+	ii = 0
+
+* reinitialize - *kob* 
+* forget line specimen definitions that were used in previous plots
+        CALL PPLCMD ( from, line, 0, 'ALINE ', 1, 1 )
+
+
+* what qualifiers will effect the initialization of PLOT+
+
+	lev_loc = qual_given( slash_levels )
+	IF (cmnd_num.EQ.cmnd_plot) lev_loc = qual_given( slash_plot_levels )
+	len_loc = qual_given( slash_length )
+	lev_given    = ( cmnd_num.EQ.cmnd_contour .OR. 
+     .                   cmnd_num.EQ.cmnd_shade   .OR.
+     .                   cmnd_num.EQ.cmnd_polygon .OR. 
+     .                   cmnd_num.EQ.cmnd_plot) .AND. lev_loc.NE.0
+	len_given = cmnd_num .EQ. cmnd_vector
+     .		.AND. len_loc .NE. 0
+
+        contour_fewer = 1
+        need_std = .FALSE.
+
+	IF ( lev_given    ) THEN
+           contour_fewer = 0
+           CALL EQUAL_STRING(  
+     .          cmnd_buff(qual_start(lev_loc):qual_end(lev_loc)), 
+     .                        str_buff, status ) 
+
+* Set symbol LEV_TEXT with the users input to the LABEL command.
+* (Note that the above call has put str_buff into uppercase.)
+
+        labsym_buff = "LEV_TEXT "//str_buff
+        ilen = TM_LENSTR1(labsym_buff)
+        ier = 0
+        ist = 0
+        CALL SETSYM (labsym_buff, ilen, ier, ist)
+
+	IF ( str_buff .NE. ' ' ) THEN
+	
+	   neginf = .FALSE.
+	   posinf = .FALSE.
+
+* ... pass the levels string given by the user to PLOT+
+	      str_len = TM_LENSTR1( str_buff )
+	      IF ( str_buff(1:1) .NE. '('
+     .	      .OR. str_buff(str_len:str_len) .NE. ')' ) THEN
+* ... is this a /LEVELS=nDC specifier or a mistaken forgetting of parentheses?
+*	/LEVELS=n for n levels
+*	/LEVELS=nC for n centered levels
+*	/LEVELS=xxD for levels specified by delta value
+*	/LEVELS=xxDC for centered levels specified by delta value
+*	/LEVELS=nv for n open-ended levels (possibly with specified MEAN and STD)
+*	/LEVELS=xxMEAN for open-ended levels centered about mean value
+*	/LEVELS=xxSTD for open-ended levels using given STD value
+*	/LEVELS=xxMIN for open-ended levels on top, closed at MIN below
+*	/LEVELS=xxMAX for open-ended levels on bottom, closed at MAX above
+
+ 1000            CONTINUE
+	         is_std = .FALSE.
+	         is_mean = .FALSE.
+	         is_min = .FALSE.
+	         is_max = .FALSE.
+	         is_hist = .FALSE.
+	         is_delta = .FALSE.
+	         is_cv = .FALSE.
+
+	         val = bad_val4
+
+	         is_centered =  str_buff(str_len:str_len) .EQ. 'C'
+	         is_openlev =  str_buff(str_len:str_len) .EQ. 'V'
+
+	         IF ( is_centered ) THEN
+		    centered = .TRUE.
+		    str_len = str_len - 1
+	            qual_end(lev_loc) = qual_end(lev_loc) - 1
+		    is_cv = .TRUE.
+	         ENDIF
+	         IF ( is_openlev ) THEN
+		    openlev = .TRUE.
+		    str_len = str_len - 1
+	            qual_end(lev_loc) = qual_end(lev_loc) - 1
+		    is_cv = .TRUE.
+	         ENDIF
+
+* set up some logicals -- with bounds checking we cannot refer to, e.g. 
+* str_buff(str_len-2:str_len)  if str_len is less than 3...
+
+		 has_std = .FALSE.
+		 IF (str_len .GE. 3) THEN
+		    has_std = str_buff(str_len-2:str_len) .EQ. 'STD'
+		 ENDIF
+
+		 has_mean = .FALSE.
+                 IF (str_len .GE. 4) THEN
+		    has_mean = str_buff(str_len-3:str_len) .EQ. 'MEAN'
+		 ENDIF
+		 
+		 has_min = .FALSE.
+		 IF (str_len .GE. 3) THEN
+		    has_min = str_buff(str_len-2:str_len) .EQ. 'MIN'
+		 ENDIF
+
+		 has_max = .FALSE.
+		 IF (str_len .GE. 3) THEN
+		    has_max = str_buff(str_len-2:str_len) .EQ. 'MAX'
+		 ENDIF
+
+
+	         IF ( str_len .GT. 0 ) THEN
+	            set_delta = str_buff(str_len:str_len) .EQ. 'D'
+	            is_delta = str_buff(str_len:str_len) .EQ. 'D'
+                    IF (has_std) THEN
+                          set_delta = .FALSE.
+			  is_delta = .FALSE.
+		          is_std = .TRUE.
+			  set_std = .TRUE.
+			  openlev = .TRUE.
+			  is_cv = .TRUE.
+			  str_len = str_len - 3
+	                  qual_end(lev_loc) = qual_end(lev_loc) - 3
+                    ENDIF 
+	            IF (str_len .EQ. 0 ) GOTO 5120
+
+	            IF ( set_delta ) THEN
+		       str_len = str_len - 1
+	               qual_end(lev_loc) = qual_end(lev_loc) - 1
+	            ENDIF
+	            IF (str_len .EQ. 0 ) GOTO 5120
+
+                    IF (has_mean) THEN
+                       is_mean = .TRUE.
+                       set_mean = .TRUE.
+                       centered = .TRUE.
+                       is_cv = .TRUE.
+                       str_len = str_len - 4
+                       qual_end(lev_loc) = qual_end(lev_loc) - 4
+                    ENDIF 
+	            IF (str_len .EQ. 0 ) GOTO 5120
+
+                    IF (has_min) THEN
+                       is_min = .TRUE.
+                       set_min = .TRUE.
+                       str_len = str_len - 3
+                       qual_end(lev_loc) = qual_end(lev_loc) - 3
+                    ENDIF 
+	            IF (str_len .EQ. 0 ) GOTO 5120
+
+                    IF (has_max) THEN
+                       is_max = .TRUE.
+                       set_max = .TRUE.
+                       str_len = str_len - 3
+                       qual_end(lev_loc) = qual_end(lev_loc) - 3
+                    ENDIF 
+
+                    IF (str_buff(str_len:str_len) .EQ. 'H') THEN  ! histogram
+                       is_hist = .TRUE.
+                       str_len = str_len - 1
+                       qual_end(lev_loc) = qual_end(lev_loc) - 1
+                    ENDIF 
+
+                    str_1 = qual_start(lev_loc)
+
+		    get_more = .FALSE.
+	            IF (INDEX(str_buff(1:str_len),',') .GT. 0) THEN
+		       str_1 = str_len
+		       DO WHILE (INDEX(str_buff(str_1:str_1),',') .EQ. 0)
+		          str_1 = str_1 - 1
+	               ENDDO
+		       str_1 = str_1 + 1
+		       IF (str_1 .LE. str_len) THEN
+      	                  READ (str_buff(str_1:str_len), *, err=5000) val
+		          qual_end(lev_loc) = 
+     .		          qual_end(lev_loc) - (str_len-str_1+1)  ! numb. len
+                          get_more = .TRUE.
+		       ENDIF
+		       qual_end(lev_loc) = qual_end(lev_loc) - 1 ! comma
+                       
+                       str_1 = str_1 - 2
+                       str_len = str_1
+                    ELSE
+
+* If its a number read it, otherwise will go back for another letter code.
+		       get_more = .FALSE.
+		       IF (qual_start(lev_loc) .LE. qual_end(lev_loc)) THEN
+		          labsym_buff = 
+     .                  cmnd_buff(qual_start(lev_loc):qual_end(lev_loc))
+		          cbuf = 
+     .                  cmnd_buff(qual_end(lev_loc):qual_end(lev_loc))
+           	          IF ( TM_DIGIT(cbuf) ) THEN
+     	                     CALL EQUAL_VAL(labsym_buff, val, status )
+                             str_1 = 1
+			  ELSE
+			     get_more = .TRUE.  ! Get another letter-code
+			  ENDIF
+		       ENDIF
+                    ENDIF
+
+	            IF ( status .NE. ferr_ok ) GOTO 5000
+
+ 500		    CONTINUE
+		    IF ( is_delta ) THEN
+		       iautoc = 1
+	               delta = val
+	            ELSEIF (is_std) THEN
+		       openlev = .TRUE.
+	               lev_std = val
+		       IF (lev_std .LE. 0.) GOTO 5210
+	            ELSEIF ( is_mean) THEN
+		       lev_mean = val
+	            ELSEIF ( is_min) THEN
+		       lev_min = val
+	            ELSEIF ( is_max) THEN
+		       lev_max = val
+	            ELSEIF ( is_hist) THEN
+		       lev_hist = val
+		       need_histo = .TRUE.
+		       IF (val .NE. bad_val4) THEN
+		          nlev = val
+		          IF (val.LE.0. .OR. val.GT.250.) GOTO 5160
+		       ENDIF
+	            ELSEIF ( is_cv) THEN
+		       IF (val .NE. bad_val4) THEN
+		          nlev = val
+		          IF (val.LE.0. .OR. val.GT.250.) GOTO 5150
+			  IF (.NOT. openlev) iautoc = 1
+		       ENDIF
+		    ELSE
+
+	               IF (val.LE.0 .OR. val.GT.250) GOTO 5150 
+* ... set the /LEVELS=n recommendation specifier
+		       iautoc = 1
+	               nlev = val   ! levels set in PPLUS plotting routine
+	            ENDIF
+		    IF  (str_1 .GT. 1) GOTO 1000
+		    IF  (get_more) GOTO 1000
+
+	         ELSE
+		    iautoc = 1
+! "C" is equivalent to "nC" where n is the current mode nlevels setting
+	            nlev = mode_arg(pmode_nlevels, 1)       
+		    contour_fewer = 1  ! if its a contour line plot
+	         ENDIF
+
+* If requested both open-ended values and a min and max, use only
+* the min and max, regardless of any Mean and Std settings
+	         IF (set_min .AND. set_max) THEN
+	            openlev = .FALSE.
+	            SET_STD = .FALSE.
+	            SET_MEAN = .FALSE.
+	            LEV_STD = rbad_val4
+	            LEV_MEAN = rbad_val4
+	         ENDIF
+
+* If requested centered, but no mean value given, set the mean to zero.
+	         IF (centered) THEN
+	            IF (LEV_MEAN .EQ. rbad_val4) LEV_MEAN = 0.
+	            set_mean = .TRUE.
+	         ENDIF
+
+* The processing always gets the data max/min.
+* Flag to indicate whether we need to get mean/std from the data.
+	         need_std = .FALSE.
+
+		 IF (OPENLEV .AND. 
+     .               ( LEV_STD.EQ.rbad_val4 .OR. LEV_MEAN.EQ.rbad_val4) )
+     .              need_std = .TRUE.
+
+	      ELSE
+	         CALL PPLCMD( from, line, 0,
+     .			      'LEV,()'//str_buff(:str_len), 1, 1 )
+	      ENDIF
+	   ELSEIF ( iautoc .EQ. 1 ) THEN
+* ... if levels were previously set automatically by PLOT+ and user has now
+*     requested to reuse them --> make PLOT+ think they were set manually
+	      iautoc = 0
+	      nlev = nlev2 ! reuse # of levels from last plot
+	   ENDIF
+	ELSE
+* ... set up for automatic levels
+	   CALL PPLCMD ( from, line, 0, 'LEV,()', 1, 1 )
+	ENDIF
+
+* vector length ?
+	IF ( len_given ) THEN
+	   CALL EQUAL_STRING( 
+     .           cmnd_buff(qual_start(len_loc):qual_end(len_loc)),
+     .			      str_buff, status )
+	   IF ( str_buff .NE. ' ' ) THEN
+	      CALL EQUAL_VAL( 
+     .             cmnd_buff(qual_start(len_loc):qual_end(len_loc)),
+     .			      val, status )	! syntax check
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF ( val .LE. 0.0 ) GOTO 5200
+	      str_len = TM_LENSTR1( str_buff )
+* ... send specified vector value to PLOT+
+	      CALL PPLCMD ( from,line,0,'VECSET ,'//str_buff(:str_len),1,1 )
+	   ELSE
+* ... preserve previous length - possible auto length from PLOT+
+	      IF ( vusrln .EQ. 0.0 ) vusrln = 1.0 ! has vec len been init'ed ?
+	      vauto = .FALSE.
+	   ENDIF
+	ELSE
+* ... set up for automatic vector lengths
+	   CALL PPLCMD ( from, line, 0, 'VECSET', 1, 1 )
+	ENDIF
+
+* success
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .		str_buff(:str_len)//' must be in parentheses', *5000 )
+ 5120	CALL ERRMSG( ferr_syntax, status,
+     .		'LEVELS=xxD with xx value missing', *5000 )
+ 5150	CALL ERRMSG( ferr_invalid_command, status,
+     .		'"'//str_buff(:str_len)//
+     . '": Number of contour levels must be between 1 and 250',
+     .		*5000 )
+ 5160	CALL ERRMSG( ferr_invalid_command, status,
+     .		'"'//str_buff(:str_len)//
+     . '": Number of histogram levels must be between 1 and 250',
+     .		*5000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'zero vector length on /LENGTH=', *5000 )
+ 5210	CALL ERRMSG( ferr_out_of_range, status,
+     .		'STD must be a positive number', *5000 )
+	END
diff --git a/fer/plt/disp_reset.F b/fer/plt/disp_reset.F
new file mode 100644
index 0000000..b9f9ca9
--- /dev/null
+++ b/fer/plt/disp_reset.F
@@ -0,0 +1,126 @@
+	SUBROUTINE DISP_RESET
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize or reset the underlying plot package (PPLUS) to FERRET defaults
+* (this routine is called only at start-up or by the command PPLUS/RESET)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/8/88 - extracted from DISP_INIT
+* V200:   1/3/89 - added ALINE, AXLSZE
+* V230:  11/4/92 - call SET_VIEWPORT(dflt_vp)
+*        11/9/92 - unprotect all colors
+* V540:  *sh* 9/01 - grab the PLOT+ origin from COMMON
+* V600 *acm* 5/2006 LINECOLORS User can change the number of line colors.
+* V62  *acm* 4/09 - Restore default settings for AXTYPE, AXLABP, AXLINT,
+*                   TXLABP, TXLSZE, TICS, CONPRE, CONPST, DFLTFNT, palette,
+*                   Default number of colors. (Should reset the line colors??)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 reset to scaled lengths and sizes using SET_PPL_VALUES
+
+        IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+	include 'xplot_state.cmn'
+        include 'xprog_state.cmn'
+	include 'xrevision.cmn'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'   ! for wsid
+
+* local variable declarations
+	CHARACTER buff*24
+
+* PLOT5 re-initialization (to forget previous states)
+
+*       set the default plot size
+        wn_xinches(wsid) = dflt_xinches
+        wn_yinches(wsid) = dflt_yinches
+
+*       set sizes and locations that scale with the plot size
+        CALL SET_PPL_VALUES(wsid, .TRUE.)
+
+	CALL PPLCMD ( from, line, 0, 'XFOR', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YFOR', 1, 1 )
+ 	CALL PPLCMD ( from, line, 0, 'XLAB', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YLAB', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'XAXIS', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YAXIS', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'XVALOFF 0', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YVALOFF 0', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'AXSET 1,1,1,1', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'PEN 0,1', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'PEN 1,1', 1, 1 )
+
+        WRITE (buff, 100) mode_arg(pmode_linecolors, 1)
+  100   FORMAT (I3)
+        CALL PPLCMD (from, line, 0, 'LINECOLORS '//buff(1:3)//' 1', 1, 1)
+
+	CALL PPLCMD ( from, line, 0, 'AXATIC 10,10', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'LABS', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'ALINE', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'TAXIS OFF', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'AXNMTC 0,0', 1, 1 )
+c	CALL PPLCMD ( from, line, 0, 'TXNMTC 0', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'TXNMTC -1', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'TITLE', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'WINDOW ON', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'BOX OFF', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'CROSS 0', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'AXTYPE 1,1', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'AXLABP -1,-1', 1, 1)
+	CALL PPLCMD ( from, line, 0, 'TXLABP -1', 1, 1)
+	CALL PPLCMD ( from, line, 0, 'AXLINT 2,2', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'CONPRE ', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'CONPST ', 1, 1 )
+
+* remove viewports and clear window, restore axis sizes, update window
+        CALL SET_VIEWPORT( mvp_dflt ) 
+
+* set up the default spectrum
+        CALL PPL_SHASET( 'RESET' )
+        CALL PPL_SHASET( 'SPECTRUM=default' )
+
+* Set default (initial) number of color levels
+
+        CALL SET_DEFAULT_NLEVELS( mode_arg(pmode_nlevels, 1) )
+
+	RETURN
+	END
diff --git a/fer/plt/disp_set_up.F b/fer/plt/disp_set_up.F
new file mode 100644
index 0000000..9c49c80
--- /dev/null
+++ b/fer/plt/disp_set_up.F
@@ -0,0 +1,885 @@
+	SUBROUTINE DISP_SET_UP( memory,
+     .				vector, shade, use_cell, aspect, overlay, 
+     .				transpz, no_labels, no_x_rng, valx1, 
+     .				density, is_logx, is_logy, mr_list, nmv, 
+     .				cx_list, uvar, s1_axis, s2_axis, pen, inc_grid,
+     .				status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up for contour and vector plots by loading data and title and 
+* defining axis formats
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - based on CONTOUR_CMND_DATA rev 0.1
+* revision 0.1 - 2/25/87 - changes for INTERPRETATION STACK
+* revision 0.2 - 5/11/87 - use list of mrs - compound titles and colors
+* revision 1.0 - 6/23/87 - separated initialization code into DISP_INIT
+*			   incorporated SUBR. AXIS_INTERVALS and AXIS_FORMAT to
+*			   make symmetric calculations for both x and y axes 
+*			   in order to permit z-t plots.  Put key/label on 
+*			   overlaid plots.  Added "/transposed" option.
+* revision 1.1 - 7/8/87  - separated labels for normal dimensions and data set
+*			   into DISP_LABELS.  general clean-up
+* revision 1.2 - 7/21/87 - added calls to AXIS_ENDS to specify precise axis ends
+* revision 1.3 -  8/7/87 - added XPPLUS.CMN to pass icode to LOAD_Y_VECTOR
+* revision 1.4 - 3/18/88 - added grid number and limits to AXIS_FORMAT for taxis
+* revision 2.0 - 4/14/88 - added do_labels argument for /NOLABELS option
+*			 - loaded Y vector component from this routine
+*			 - added aspect-ratio related vector rotations
+* revision 2.1 - 4/28/88 - return valx1
+* revision 2.2 -  9/8/88 - added relative position flag to PUT_LABEL calls
+* revision 2.3 - 9/23/88 - decision to output labels now done in PUT_LABEL
+*			 - time axis style determines possible "year" display
+* revision 2.4 - 1/25/89 - for overlay labels /NOLABELS is acted on here (messy)
+* revision 2.5 - 2/16/89 - kludge fix to improper # dimension check
+* V200:  5/19/89 - 4D symmetrical
+*		 - pass uvar: use exact axis limits if given as command
+*		   mods or set region
+*	  1/4/89 - major mods to incorporate keys on plots, pass axes to PLOT+
+*	  5/7/90 - bug fix in vector length adjustment key (don't use PPL_BUFF)
+* V230:  6/12/92 - trap PLOT+ nsize limitation before passing data
+*                  (fixed bug in error trapping 11/27/92)
+*       10/18/92 - bug fix: /NOLABELS prevented axis endpoints and styles
+*                  from being set
+*        1/28/93 - allow overlays on 0 and 1D promoted regions (plotify_grp_cx)
+*                - and allow all values to be bad in contour, shade, etc.
+* V301:	10/26/93 - added /XLIMITS and /YLIMITS axis range specifications
+*	11/ 3/93 - added /TITLE
+*	 1/13/94 - trap attempts to CONTOUR or SHADE 1D region as errors
+*	 2/10/94 - added /PEN= to control color easily
+* V320: 5/94 - array "memory" as a calling argument
+* 	9/94: restrict to 99% of NSIZE buffer - kludge fix to PLOT+ bug
+*      12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V401: 6/23/95 - tag the movable labels by passing ppl_movlab minus nnn
+* V420: 11/95 - change to args in AXIS_FORMAT for better time axis control
+*	 2/96 - /ASPECT needs to be sensitive to /XLIMITS and /YLIMITS
+*		(moved data rotating and loading to a point AFTER axis set up)
+*		/ASPECT needs to be similarly sensitive to /OVERLAY 
+*		==> COMMON XWINDOW_STATE has been created **temporarily**
+*		    with the intention that it will be expanded in future
+*		    so overlays can be placed on **previously** drawn windows
+* V430: 5/96 - fixed up error message text
+* Linux Port *kob* 1/97 - include new cmn file xwindow_state.cmn because
+*			  locally declared common blocks aren't allowed.
+* V450: 3/97 - support for curvilinear coordinate plots
+*       8/97 - added curvilinear check to make sure that args 2 and 3 lie in
+*              compatible planes with the variable to be plotted
+* V500  4/99 - *jd* Ensure PPL knows plot is overlay: set SOVER flag here
+*       6/99 - save time axis info in XPLOT_STATE to enable line plot overlays
+*		(with plot/vs and polygon)
+* V510	12/99 - *sh* plot of all bad data no longer an error
+*        3/00 - *sh* /NOLABELS to avoid xlab & ylab
+*	 5/00 - added /HLIMITS and /VLIMITS (denigrating /xlimits/ylimits)
+* V520   6/00 *sh* - bug fix: trap ndim>2 on overlays
+* V530 *sh* 1/01 - change "denigrated" to "deprecated"
+* V530 *acm* 1/01  cal_id for alternative calendar axes.
+* V533 *acm* 6/01 for LOG plots add logicals is_logx, is_logy.  set to plot
+*                   log of depth as inverse axis
+*       ACM  8/2001 BUG FIX: save cal id if vertical time axis
+*      *acm* 10/01  remove VMS includes
+*      *acm* 12/01  Allocate PPLUS memory for the flag array used by
+*                   flowline.
+* V541 *acm*  4/02  for flowlines, more PPLUS memory was allocated than needed.
+*      *acm*  4/02  If this is an overlay, and there is no valid data, add
+*                   this information variable name in the key below the plot.
+* v541 *acm*  8/02  For "No Valid Data" the test is: 
+*                    IF (no_x_rng .AND. (valx1.EQ.bad_val4) )
+* v5.5 *acm* 11/02  Set PPLUS memory for the cells array used by cellarray 
+*                   in SHADE plots
+*      *acm* 12/02  When setting has_time_axis flag, only do it if an
+*                   axis being used IS a time axis
+* v5.51*acm*  1/03  Comment out the cellarray implementation; xgks doesnt
+*                      completely implement it & has a precision bug for 
+*                      large plots.  see comment lines: c no_cellarray
+* V552 *acm*  3/03  Send the key string to key_loc since it may be multi-line
+*      *acm*  5/03  Send the flag irregular to AXIS_INTERVALS.  
+* v5.52*acm*  6/03  Restore cellarray setup. uses its_gif flag so these are
+*                   only done in -gif mode
+* v5.53*acm*  6/03  send correct axis to AXIS_INTERVALS
+* V580 *acm* 12/04 Fix bug 1129; formatting axis for small lon/lat ranges:
+*                  send delta to routine AXIS_FORMAT
+* V600 *acm* 10/05 Fix bug 1347; for very fine axes, set the flag irregular in
+*                  AXIS_INTERVALS, and compute the delta coordinate. Then after
+*                  the call to pplldc, reset the plot type to regular if the
+*                  grid is in fact regular.
+* V608 *acm* 09/07 Define symbols AX_HORIZ and AX_VERT with the x,y,z,t direction 
+*                  of the axes as they will appear on the plot.
+* V62  *acm* 03/09 Fix bug 1649: get the value of cal_id for this time axis
+*                  BEFORE using it in evaluating arguments to /hlim or /vlim 
+* V630 *acm*  9/09 Introduction of syntax for variance-based and histogram levels
+* V663 *acm* 07/10 If openlevels computation fails (very-large value data fields)
+*                  then issue a warning and do linear levels instead.
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* PyFr *kms*  7/13 Scale default lengths by pplscale; 
+*                  use hlab1 for plot title lettering height
+* V685  *acm* 9/13 Fixing ticket 2092. Check that the pplus internal storage
+*                  for coordinate data will be enough for the grid and if not
+*                  return an error message. 
+* V686 *acm* 12/13 Symbokls AX_HORIZ and AX_VERT may be x,y,z,t,e,f  
+
+C replace includes with those from plot_set_up, 
+C plus those starting w/ xbox_bounds:
+
+        IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xplot_setup.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xtext_info.cmn'
+        include 'axis_inc.decl'    ! with axis lengths
+        include 'AXIS.INC'         ! with axis lengths
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'       ! hlab1, hlabs
+	include 'PPLDAT.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+
+	include 'xbox_bounds.cmn'
+	include 'xcurvilinear.cmn'
+	include 'command.parm'
+	include 'xcommand.cmn'
+	include 'xpplus.cmn'
+
+
+*kob 1/97
+	include 'xwindow_state.cmn'
+
+
+* calling argument declarations:
+	LOGICAL		vector, overlay, transpz, no_labels, no_x_rng,
+     .			is_logx, is_logy, flows, shade, inc_grid
+	INTEGER		nmv, mr_list( nmv ), cx_list( nmv ), uvar,
+     .			density, pen, status
+	REAL		memory( mem_blk_size, max_mem_blks )
+	REAL 		aspect, valx1, s1_axis(*), s2_axis(*)
+
+* internal variable declarations:
+	CHARACTER*1020	COMPOUND_TITLE, COMPOUND_KEY, plot_title
+	CHARACTER	TM_FMT*16, LEFINT*8, LEFT_REAL*16,
+     .                  xstyle*3, ystyle*3, cmnd_name*8, year*4, buff*8,
+     .			letter*1, buff1*16, buff2*16, buff30*30,
+     .                  TM_GET_CALENDAR_NAME*32, cal_name_1*32, 
+     .                  cal_name_2*32, err_string*128
+        CHARACTER*1     axdir(6)
+
+	LOGICAL		NO_GRID_RANGE, GEOG_LABEL, TM_FPEQ, 
+     .			user_title, time_axis,
+     .			regrid_1, regrid_2, no_y_rng, edges_ok,
+     .			REGULARLY_SPACED,
+     .                  irregular
+        LOGICAL         use_cell
+
+	INTEGER		TM_LENSTR1, CX_DIM_LEN, CGRID_SIZE,
+     .			dim1, dim2, mvx, mvx_temp, mvy, mvy_temp,
+     .			ctx, cty, xblk1, yblk1, plot_mem_used, nvars,
+     .			lo1, lo2, hi1, hi2, size1, size2, size,
+     .			n1_regrid, n2_regrid, grid, slen, pxlim, pylim,
+     .			style, justify, ipen, ndim, dims(nferdims), ptitl,
+     .			arg_xpos, cx_xpos, cx_ypos, mr_xpos, mr_ypos,
+     .			phlim, pvlim, slen2, cal_id, tax,
+     .			x_axtyp, y_axtyp, iscl, siz, nsiz, 
+     .			TM_GET_CALENDAR_ID, mode_num, axis1, axis2,
+     .                  hblk1, mvh_temp
+	REAL		s, w1_lo, w1_hi, w2_lo, w2_hi, valy1,
+     .			d1_regrid, d2_regrid, bad_x, bad_y, rlo, rhi,
+     .			xkeypos, ykeypos, xkeysize, ykeysize, lab_ht,
+     .                  first, last, labelht
+	REAL*8		xaxlo, xaxhi, yaxlo, yaxhi, delta
+	REAL*4		rw1lo, rw2lo
+
+        DATA axdir / 'X', 'Y', 'Z', 'T', 'E', 'F' /
+
+* signal that plot set-up has begun
+	IF ( mode_diagnostic ) CALL SPLIT_LIST(pttmode_explct, ttout_lun,
+     .			'setting up 2D plot', 18 )
+
+* initialize
+	mvx	  = mr_list( 1 )
+	ctx       = cx_list  ( 1 )
+	grid	  = mr_grid( mvx )
+	bad_x	  = mr_bad_data( mvx )
+	cal_id    = 1
+	x_axtyp   = 1
+	y_axtyp   = 1
+        plot_mem_used = 0
+	mvx_temp  = 0
+
+	IF ( vector ) THEN
+	   mvy	  = mr_list( 2 )
+	   cty	  = cx_list  ( 2 )
+	   bad_y  = mr_bad_data( mvy )
+	ENDIF
+	phlim = qual_given( slash_hlimits )
+	pvlim = qual_given( slash_vlimits )
+	IF ( transpz ) THEN
+	  pxlim = qual_given( slash_ylimits )
+	  pylim = qual_given( slash_xlimits )
+	ELSE
+	  pxlim = qual_given( slash_xlimits )
+	  pylim = qual_given( slash_ylimits )
+	ENDIF
+	ptitl = qual_given( slash_title )
+	user_title = ptitl .GT. 0
+
+* get 4D shape of data region to load (already oversized)
+	dim1 = plot_axis(1)
+	dim2 = plot_axis(2)
+	axis1 = grid_line(dim1, grid)
+	axis2 = grid_line(dim2, grid)
+	size1 = CX_DIM_LEN( dim1, ctx )
+	size2 = CX_DIM_LEN( dim2, ctx )
+	size  = size1 * size2
+
+* determine PLOT+ memory required 
+
+        plot_mem_used = CGRID_SIZE( cx_list(1) ) + size1 + size2
+        IF ( vector ) 
+     .        plot_mem_used = plot_mem_used * 2
+
+	flows     = qual_given( slash_vect_flowline  ).GT.0
+
+!  For flowlines, more PLOT+ memory needed; based on density parameter and
+!  grid size.
+
+        IF ( flows ) THEN
+           nsiz = MAX(size1, size2)
+           iscl = 200/nsiz
+           iscl = iscl + density - 5
+           IF (iscl .LT. 1) iscl = 1
+           IF (iscl .GT. 10) iscl = 10
+
+C   set up memory for the flag grid
+
+           siz = (nsiz*nsiz*(iscl*iscl +2)) + nsiz*iscl   ! see flowline
+           plot_mem_used = plot_mem_used + siz
+        ENDIF
+
+* set flag indicating a 2D plot is on the screen
+	twodee_on = .TRUE.
+
+* save axis pointers so PLOT+ can get box boundaries
+	bb_grid = grid
+
+* On a plot/set, the intervening commads may change the default grid.
+* Increment the grid. It will be decremented at the end of xeq_pplus
+
+	bb_grid_inccount = 0
+	IF (inc_grid) THEN
+	   bb_grid_inccount = 1
+	   CALL TM_USE_DYN_GRID(grid)  ! see ticket 883
+	ENDIF
+
+	IF ( transpz ) THEN
+	   bb_yaxis = dim1
+	   bb_xaxis = dim2
+	ELSE
+	   bb_xaxis = dim1
+	   bb_yaxis = dim2
+	ENDIF
+
+* check for valid data plane
+	CALL GET_CX_DIMS( ctx, ndim, dims )
+	IF ( ndim .GT. 2 ) GOTO 5160
+	IF ( overlay ) THEN
+* *sh* 1/93 - restrictions less: coords merely have to be valid in 2D plane
+           IF ( cx_lo_ss(ctx,dim1) .EQ. unspecified_int4
+     .     .OR. cx_lo_ww(dim1,ctx) .GE. cx_hi_ww(dim1,ctx) ) GOTO 5150
+           IF ( cx_lo_ss(ctx,dim2) .EQ. unspecified_int4
+     .     .OR. cx_lo_ww(dim2,ctx) .GE. cx_hi_ww(dim2,ctx) ) GOTO 5150
+	ELSEIF ( vector) THEN     ! 1/94
+	   IF ( nplot_axis .GT. 2 ) GOTO 5160
+	ENDIF
+
+* check # of variables and consistency in X and Y component dimensions
+	IF ( vector ) THEN
+	   nvars = 2
+	   IF ( num_uvars_in_cmnd .EQ. 4 ) THEN
+	      curvilinear = .TRUE.
+	      arg_xpos = 3		! 3rd cmd arg is X positions
+	   ELSE
+	      curvilinear = .FALSE.
+	      IF ( num_uvars_in_cmnd .GT. 2 ) GOTO 5300
+	   ENDIF
+	   IF ( CX_DIM_LEN(dim1,ctx) .NE. CX_DIM_LEN(dim1,cty)
+     .	  .OR.  CX_DIM_LEN(dim2,ctx) .NE. CX_DIM_LEN(dim2,cty) )
+     .		CALL ERRMSG( ferr_inconsist_plane, status,
+     .			'X and Y vector components', *5100 )
+	ELSE
+	   nvars = 1
+	   IF ( num_uvars_in_cmnd .EQ. 3 ) THEN
+	      curvilinear = .TRUE.
+	      arg_xpos = 2
+	   ELSE
+	      curvilinear = .FALSE.
+	      IF ( num_uvars_in_cmnd .GT. 1 ) GOTO 5300
+	   ENDIF
+	ENDIF
+
+* If its a multi-argument curvilinear request check that the xpos, ypos
+* fields are conformable with the field of values
+	IF ( curvilinear ) THEN
+	   IF (.NOT. overlay) use_keys = .FALSE.
+	   edges_ok = cmnd_num.EQ.cmnd_shade
+	   mr_xpos = mr_list(arg_xpos)
+	   mr_ypos = mr_list(arg_xpos + 1)
+	   cx_xpos = cx_list(arg_xpos)
+	   cx_ypos = cx_list(arg_xpos + 1)
+* Note that the plot axes have never been transposed by this point
+	   IF ( CX_DIM_LEN(plot_axis(3),cx_xpos) .GT. 1
+     .	   .OR. CX_DIM_LEN(plot_axis(4),cx_xpos) .GT. 1
+     .	   .OR. CX_DIM_LEN(plot_axis(1),cx_xpos) .EQ. 1 ) THEN
+	      letter = 'X'
+	      GOTO 5400
+	   ELSEIF ( CX_DIM_LEN(plot_axis(3),cx_ypos) .GT. 1
+     .	   .OR. CX_DIM_LEN(plot_axis(4),cx_ypos) .GT. 1
+     .	   .OR. CX_DIM_LEN(plot_axis(2),cx_ypos) .EQ. 1 ) THEN
+	      letter = 'Y'
+	      GOTO 5400
+	   ENDIF
+	ENDIF
+
+* create temporary buffers to contain the plot data
+	CALL CREATE_TEMP_MEM_VAR( ctx, mvx_temp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	xblk1 = mr_blk1( mvx_temp )
+	IF ( vector ) THEN
+	   CALL CREATE_TEMP_MEM_VAR( cty, mvy_temp, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5010
+	   yblk1 = mr_blk1( mvy_temp )
+	ENDIF
+
+* copy the plot data to the buffer(s) - possibly transposing
+	IF ( transpz ) THEN
+	   CALL COPY_GRID_TRANS( size1, size2,
+     .				 memory(1, mr_blk1(mvx)), mvx,
+     .				 memory(1, xblk1       ), mvx_temp )
+	   IF ( vector )
+     .		CALL COPY_GRID_TRANS(   size1, size2,
+     .					memory(1, mr_blk1(mvy)), mvy,
+     .					memory(1, yblk1       ), mvy_temp )
+	ELSE
+	   CALL COPY_GRID( memory(1, mr_blk1(mvx)), mvx,
+     .			   memory(1, xblk1       ), mvx_temp )
+	   IF ( vector )
+     .		CALL COPY_GRID(	memory(1, mr_blk1(mvy)), mvy,
+     .				memory(1, yblk1       ), mvy_temp )
+	ENDIF
+	
+* determine plotting limits
+	IF ( transpz ) THEN
+	   dim2 = plot_axis(1)
+	   dim1 = plot_axis(2)
+	   axis1 = grid_line(dim1, grid)
+	   axis2 = grid_line(dim2, grid)
+	ENDIF
+	lo1  = cx_lo_ss( ctx, dim1 )
+	hi1  = cx_hi_ss( ctx, dim1 )
+	lo2  = cx_lo_ss( ctx, dim2 )
+	hi2  = cx_hi_ss( ctx, dim2 )
+	size1 = hi1 - lo1 + 1
+	size2 = hi2 - lo2 + 1
+
+* Define symbols AX_HORIZ and AX_VERT with the x,y,z,t direction 
+* of the axes as they will appear on the plot.
+
+        buff1 = axdir(dim1)
+	CALL PPLCMD ( from, line, 0, 'SET AX_HORIZ '//buff1, 1, 1 )
+
+        buff1 = axdir(dim2)
+        CALL PPLCMD ( from, line, 0, 'SET AX_VERT '//buff1, 1, 1 )
+
+* check that there is some valid data
+	no_x_rng = NO_GRID_RANGE( memory(1,xblk1), size, mvx_temp, valx1 )
+	IF ( no_x_rng .AND. valx1 .EQ. bad_x ) valx1 = bad_val4
+	IF ( vector ) THEN
+	   no_y_rng = NO_GRID_RANGE( memory(1,yblk1), size, mvy_temp, valy1 )
+	   IF ( no_y_rng .AND. valy1 .EQ. bad_y  ) THEN
+	      valx1 = bad_val4
+	      no_x_rng = no_y_rng	! need both to have either
+	   ENDIF
+	ENDIF
+
+* determine axis re-gridding needs
+
+        irregular = .NOT. ( line_regular(axis1) )
+	CALL AXIS_INTERVALS( 'X', mvx_temp, ctx, dim1, curvilinear, s1_axis,
+     .			     mr_lo_ss(mvx_temp,dim1), mr_hi_ss(mvx_temp,dim1),
+     .			     w1_lo, w1_hi, n1_regrid, d1_regrid, regrid_1,
+     .                       irregular )
+
+        irregular = .NOT. ( line_regular(axis2) )
+	CALL AXIS_INTERVALS( 'Y', mvx_temp, ctx, dim2, curvilinear, s2_axis,
+     .			     mr_lo_ss(mvx_temp,dim2), mr_hi_ss(mvx_temp,dim2),
+     .			     w2_lo, w2_hi, n2_regrid, d2_regrid, regrid_2,
+     .                       irregular )
+
+	IF ( regrid_1 .OR. regrid_2 ) THEN
+	   icode = 1
+	ELSE
+	   icode = 0
+	ENDIF
+
+* do not use the cell array drawing method
+        use_cell  = .FALSE.
+
+* For 3-argument curvilinear plots, see if we want to
+* do modulo replications of the data.
+ 	 
+         IF (curvilinear) xmodulo = qual_given(slash_shad_mod) .GT. 0
+     .                        .OR. qual_given(slash_cont_mod) .GT. 0   
+     .                        .OR. qual_given(slash_polygon_mod) .GT. 0  
+     .                        .OR. qual_given(slash_vect_mod) .GT. 0  
+
+* set up PLOT+ to ignore bad data flag
+	ppl_buff = ' '
+	WRITE ( ppl_buff, 3005 ) mr_bad_data( mvx )
+ 3005	FORMAT ( 'LIMITS ',G15.8,' ZEQ' )
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+
+* assign a color for the data plotting
+!	IF ( vector ) THEN
+!	   ipen = nvect_on+1
+!	ELSE
+!	   ipen = ncont_on+1
+!	ENDIF
+	IF ( pen .LT. 0 ) THEN    ! 2/94
+	   ipen = nvect_on + ncont_on + 1
+	ELSE
+	   ipen = pen
+	ENDIF
+	WRITE ( ppl_buff, 3105) ipen
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+ 3105	FORMAT('PEN 1,',I3)
+
+* set up the axis formats (use exact limits, if given by /HLIMITS or /VLIMITS)
+	IF ( .NOT.overlay ) THEN
+           time_axis = GEOG_LABEL( dim1, grid )  .AND. 
+     .                 (dim1.EQ.t_dim .OR. dim1.EQ.f_dim) 
+
+	   has_time_axis = time_axis	! save for PLOT/VS/OVERLAY (6/99)
+           IF (time_axis) THEN
+              tax = grid_line(dim1, grid)
+              cal_id = TM_GET_CALENDAR_ID ( line_cal_name(tax) )
+	      IF(overlay .AND. cal_id .NE. saved_calendar_id) GO TO 5660
+	      ppl_buff = ' '
+	      WRITE ( ppl_buff, 3004 ) line_cal_name(tax)
+              CALL PPLCMD (from, line, 0, ppl_buff, 1, 1)
+ 3004         FORMAT ('CALENDAR ', A7)
+	      saved_calendar_id = cal_id
+           ENDIF
+
+	   IF ( pxlim .GT. 0 ) THEN
+	      IF (.NOT.denig_xylim_msg_done) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+              tax = grid_line(f_dim, grid)
+              IF (tax .EQ. 0) tax = grid_line(f_dim, grid)
+              cal_id = TM_GET_CALENDAR_ID ( line_cal_name(tax) )
+	      CALL EQUAL_RANGE_T( cmnd_buff(qual_start(pxlim):qual_end(pxlim)),
+     .				dim1, grid, xaxlo, xaxhi, delta,
+     .				cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ELSEIF ( phlim.GT.0 ) THEN
+	      CALL EQUAL_RANGE_T(cmnd_buff(qual_start(phlim):qual_end(phlim)),
+     .				 bb_xaxis, grid, xaxlo, xaxhi, delta,
+     .				 cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ELSEIF ( curvilinear ) THEN
+	      CALL FIELD_MINMAX( memory(1,mr_blk1(mr_xpos) ), 
+     .				mr_xpos, cx_xpos, rlo, rhi )
+	      xaxlo = rlo
+	      xaxhi = rhi
+	      IF (xaxlo .EQ. xaxhi) THEN
+		 letter = 'X'
+		 GOTO 5500
+	      ENDIF
+	      delta = unspecified_val8
+	   ELSE
+	      CALL CHOOSE_CX_WW( uvar, cx_cmnd, ctx, dim1, xaxlo, xaxhi, size1 )
+              IF (shade_trim) CALL TRIM_AXIS_ENDS( uvar, cx_cmnd, ctx, 
+     .                        dim1, xaxlo, xaxhi )
+              IF (xaxlo .GE. xaxhi) GOTO 5160
+	      delta = unspecified_val8
+	   ENDIF
+
+	   haxlo = xaxlo	! save limits so overlays
+	   haxhi = xaxhi	! will know them
+
+	   time_axis = GEOG_LABEL( dim1, grid )  .AND. 
+     .                  (dim1.EQ.t_dim .OR. dim1.EQ.f_dim) 
+
+	   has_time_axis = time_axis	! save for PLOT/VS/OVERLAY (6/99)
+           IF (time_axis) THEN
+              tax = grid_line(dim1, grid)
+              cal_id = TM_GET_CALENDAR_ID ( line_cal_name(tax) )
+	      IF(overlay .AND. cal_id .NE. saved_calendar_id) GO TO 5660
+	      ppl_buff = ' '
+	      WRITE ( ppl_buff, 3004 ) line_cal_name(tax)
+              CALL PPLCMD (from, line, 0, ppl_buff, 1, 1)
+	      saved_calendar_id = cal_id
+           ENDIF
+
+	   CALL AXIS_ENDS  ( 'X', dim1, grid, xaxlo, xaxhi, delta, is_logx,
+     .			      x_axtyp, status )
+	   IF ( status .NE. ferr_ok ) THEN
+              first = xaxlo
+              last  = xaxhi
+              GOTO 5700
+           ENDIF
+
+	   CALL AXIS_FORMAT( 'X', dim1, grid, xaxlo, xaxhi, delta,
+     .						curvilinear, cx_xpos,
+     .						time_axis,xstyle,no_labels)
+
+	   time_axis = GEOG_LABEL( dim2, grid )  .AND. 
+     .                  (dim2.EQ.t_dim .OR. dim2.EQ.f_dim)
+
+	   has_time_axis = has_time_axis .OR. time_axis ! 6/99
+
+C ACM added 8/2001 save cal id if vertical time axis
+           IF (time_axis) THEN
+              tax = grid_line(dim2, grid)
+              cal_id = TM_GET_CALENDAR_ID ( line_cal_name(tax) )
+	      IF(overlay .AND. cal_id .NE. saved_calendar_id) GO TO 5660
+	      ppl_buff = ' '
+	      WRITE ( ppl_buff, 3004 ) line_cal_name(tax)
+              CALL PPLCMD (from, line, 0, ppl_buff, 1, 1)
+	      saved_calendar_id = cal_id
+           ENDIF
+
+	   IF ( pylim .GT. 0 ) THEN
+	      IF (.NOT.denig_xylim_msg_done) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+	      CALL EQUAL_RANGE_T( cmnd_buff(qual_start(pylim):qual_end(pylim)),
+     .				dim2, grid, yaxlo, yaxhi, delta,
+     .				cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ELSEIF ( pvlim.GT.0 ) THEN 
+	      CALL EQUAL_RANGE_T(cmnd_buff(qual_start(pvlim):qual_end(pvlim)),
+     .				 bb_yaxis, grid, yaxlo, yaxhi, delta,
+     .				 cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ELSEIF ( curvilinear ) THEN
+	      CALL FIELD_MINMAX( memory(1,mr_blk1(mr_ypos) ),
+     .				mr_ypos, cx_ypos, rlo, rhi )
+	      yaxlo = rlo
+	      yaxhi = rhi
+	      IF (yaxlo .EQ. yaxhi) THEN
+		 letter = 'Y'
+		 GOTO 5500
+	      ENDIF
+	      delta = unspecified_val8
+	   ELSE
+	      CALL CHOOSE_CX_WW( uvar, cx_cmnd, ctx, dim2, yaxlo, yaxhi, size2 )
+              IF (shade_trim) CALL TRIM_AXIS_ENDS( uvar, cx_cmnd, ctx, 
+     .                        dim2, yaxlo, yaxhi )
+              IF (yaxlo .GE. yaxhi) GOTO 5160
+	      delta = unspecified_val8
+	   ENDIF
+
+	   vaxlo = yaxlo	! save limits so overlays
+	   vaxhi = yaxhi	! will know them
+
+	   CALL AXIS_ENDS  ( 'Y', dim2, grid, yaxlo, yaxhi, delta, is_logy,
+     .			      y_axtyp, status )
+	   IF ( status .NE. ferr_ok ) THEN
+              first = xaxlo
+              last  = xaxhi
+              GOTO 5700
+           ENDIF 
+	   CALL AXIS_FORMAT( 'Y', dim2, grid, yaxlo, yaxhi, delta,
+     .						curvilinear, cx_ypos,
+     .						time_axis,ystyle,no_labels)
+
+*   When not an overlay, set the axis type to log or reverse log
+	   IF (is_logx .OR. is_logy) THEN
+	      WRITE (buff2, 3006) x_axtyp, y_axtyp
+
+ 3006         FORMAT ('axtype,', I2, ',', I2)
+	      CALL PPLCMD ( from, line, 0, buff2, 1, 1)
+	   ENDIF
+        ENDIF
+
+* rotate vectors to make axis scale ratio correction ?
+	IF ( vector .AND. aspect.GT.0. ) CALL RE_ORIENT(
+     .			haxlo, haxhi, vaxlo, vaxhi, dim1, dim2,
+     .			size1, size2, transpz, aspect,
+     .			memory(1, xblk1), mvx_temp,
+     .			memory(1, yblk1), mvy_temp, s )
+	if (overlay) SOVER = .true.
+
+
+* The coordinates are loaded into PPLUS arrays. Check that the grid
+* isn't too large.
+	CALL CHECK_2D_SIZE (size1, size2, err_string, status)
+	IF (status .NE. ferr_ok) GOTO 5720
+
+* load contour data into PPLUS and (possibly) regrid to regular grid
+	rw1lo = w1_lo
+	rw2lo = w2_lo
+
+	CALL PPLLDC_envelope ( icode, memory(1, xblk1), size1, size2,
+     .		      1, size1, 1, size2, s1_axis, s2_axis, 
+     .		      n1_regrid, n2_regrid, rw1lo, rw2lo,
+     .		      d1_regrid, d2_regrid, plot_mem_used)
+
+* load curvilinear pointers and sizes for later access from PLOT+
+	IF ( curvilinear ) THEN
+	   wwxmin = xaxlo
+	   wwxmax = xaxhi
+	   wwymin = yaxlo
+	   wwymax = yaxhi
+	   CALL LOAD_CURVILINEAR( memory(1,mr_blk1(mr_xpos)),
+     .				  memory(1,mr_blk1(mr_ypos)),
+     .				  dim1, dim2, arg_xpos,
+     .				  edges_ok, mr_xpos, mr_ypos,
+     .				  cx_xpos, cx_ypos, ctx, status)
+	   IF ( status .NE. ferr_ok) GOTO 5100
+	ENDIF
+
+* Compute data mean and if needed for the levels setting the std, store
+* in common.  If the user set a std to use, store that.
+
+       nsiz = size1* size2
+       CALL compute_mnstd (memory(1, xblk1), bad_x, need_std, 
+     .    nsiz, status)
+       IF (status .NE. ferr_ok) THEN
+* ... set up for automatic levels
+	   CALL PPLCMD ( from, line, 0, 'LEV,()', 1, 1 )
+          CALL USE_LINEAR_LEVELS
+	  CALL WARN(
+     . 'Data too large to compute Std Dev. Using linear levels instead.')
+       ENDIF
+
+* If histogram-based levels are requested, compute the 
+* histogram bins.
+
+       IF (need_histo) THEN
+* create temporary buffer to contain workspace
+	  CALL CREATE_TEMP_MEM_VAR( ctx, mvh_temp, status )
+	  IF ( status .NE. ferr_ok ) RETURN
+	  hblk1 = mr_blk1( mvh_temp )
+          plot_mem_used = plot_mem_used + nsiz
+
+	  CALL compute_histo_bins (memory(1,xblk1), memory(1,hblk1), 
+     .       bad_x, nsiz, status) 
+       ENDIF
+
+* For cases where regrid was set in AXIS_INTERVALS not because of a 
+* subspan modulo axis, but because the axis precsion is too small for 
+* single precision representation, now we reset the plot type to regular 
+* if the axes are in fact regular.
+
+        IF (line_regular(axis1) .AND. line_regular(axis2)) 
+     .      CALL SET_REGULAR_PLOT
+
+	CALL DELETE_VARIABLE( mvx_temp )
+
+	IF ( vector ) THEN
+* load the Y vector component
+	   CALL PPLLDV_envelope ( icode, memory(1,yblk1), size1, size2,
+     .		      1, size1, 1, size2)
+	   CALL DELETE_VARIABLE( mvy_temp )
+	ENDIF
+	
+	IF ( no_labels ) RETURN
+
+! ====================== LABELS ========================
+
+* if we are starting from a blank screen compose a title
+* if we are overlaying on a plot put the new variable name on as a key
+	IF ( user_title ) THEN
+	   CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                  plot_title, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   slen = TM_LENSTR1( plot_title )
+	ENDIF
+	IF ( overlay ) THEN
+* ... cook up a key label for this variable only (or pair for VECTOR)
+*     If no valid data (no_x_rng) add this info to the label.
+	   use_keys = .TRUE.
+	   IF ( .NOT.user_title ) THEN
+	      CALL OV_GRP_CX_DOC( cx_list, nmv, cx_xtra_doc )
+	      plot_title = COMPOUND_KEY( cx_list, nvars, cx_xtra_doc, slen )
+	   ENDIF
+           IF (no_x_rng .AND. (valx1.EQ.bad_val4) ) THEN
+              plot_title(slen+1:slen+14) = ' No Valid Data'
+              slen = slen + 14
+           ENDIF
+	   CALL KEY_LOC( overlay, xkeypos, ykeypos, xkeysize, ykeysize,
+     .			 lab_ht, style, justify, plot_title(:slen) )
+	   CALL PUT_CMND_KEY( cmnd_num, plot_title(:slen),
+     .			      xkeypos, ykeypos, xkeysize, ykeysize,
+     .			      lab_ht )
+	ELSE
+	   IF ( .NOT. user_title ) THEN
+	      IF ( use_keys ) THEN
+	         plot_title = COMPOUND_KEY( cx_list, nvars, key_doc, slen )
+	      ELSE
+	         plot_title = COMPOUND_TITLE( cx_list, nvars, slen )
+	      ENDIF
+	   ENDIF
+           labelht = hlab1
+	   CALL BOX_LABEL( ppl_title,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 
+     .			   0.75*xlen, labelht,
+     .			   labelht, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+* ... see if a "year" label is required
+	   year = unspecified_name4
+	   IF (dim1.EQ.t_dim.AND.(xstyle.EQ.'MON'.OR.xstyle.EQ.'DAY')) THEN
+	      CALL TSTEP_TO_DATE( grid, t_dim, xaxlo, ptime_yr, ppl_buff )
+	      year = ppl_buff(:4)
+	   ELSEIF (dim1.EQ.f_dim.AND.(xstyle.EQ.'MON'.OR.xstyle.EQ.'DAY')) THEN
+	      CALL TSTEP_TO_DATE( grid, f_dim, xaxlo, ptime_yr, ppl_buff )
+	      year = ppl_buff(:4)
+	   ELSEIF (dim2.EQ.t_dim.AND.
+     .                  (ystyle.EQ.'MON'.OR.ystyle.EQ.'DAY')) THEN
+	      CALL TSTEP_TO_DATE( grid, t_dim, yaxlo, ptime_yr, ppl_buff )
+	      year = ppl_buff(:4)
+	   ELSEIF (dim2.EQ.f_dim.AND.
+     .                  (ystyle.EQ.'MON'.OR.ystyle.EQ.'DAY')) THEN
+	      CALL TSTEP_TO_DATE( grid, f_dim, yaxlo, ptime_yr, ppl_buff )
+	      year = ppl_buff(:4)
+	   ENDIF
+* ... put on the basic position and data set labels
+
+* *ACM* if time axis, then cal_id is set to the calendar.  Label the
+*       plot with the calendar name if there is non-standard calendar
+
+	   CALL DISP_LABELS( cx_plot, year, cal_id )
+	ENDIF
+
+* special remarks for vector plots
+* ... "scale ratio adjustment: nnn"
+* note: "plot_title" is just used as a buffer
+	IF ( vector ) THEN
+           labelht = 0.75*dflt_letsize_label*textscale
+	   IF ( aspect .GT. 0.0 ) THEN
+	      plot_title = 'adjustment for differing X/Y scales: '//
+     .			  TM_FMT(s,3,16,slen)
+	      CALL PUT_LABEL( ppl_movlab-ppl_aspect, 
+     .			      0.0, 0.2*pplscale,
+     .			      ppl_left_just, labelht,
+     .			      plot_title(:37+slen),
+     .			      lab_loc_absolute, lab_loc_axlen_plus )
+	   ENDIF
+* ... offset components (staggered vectors)?
+	   IF (   cx_lo_ww(dim1,ctx) .NE. cx_lo_ww(dim1,cty)
+     .	     .OR. cx_hi_ww(dim1,ctx) .NE. cx_hi_ww(dim1,cty)
+     .	     .OR. cx_lo_ww(dim2,ctx) .NE. cx_lo_ww(dim2,cty)
+     .	     .OR. cx_hi_ww(dim2,ctx) .NE. cx_hi_ww(dim2,cty))THEN
+	         CALL PUT_LABEL( ppl_movlab-ppl_offset, 
+     .			         0.0, 0.2*pplscale,
+     .			         ppl_right_just, labelht,
+     .			         'X and Y components are offset',
+     .			         lab_loc_axlen_plus, lab_loc_axlen_plus )
+	   ENDIF
+	ENDIF
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	IF ( vector ) CALL DELETE_VARIABLE( mvy_temp )
+ 5010	CALL DELETE_VARIABLE( mvx_temp )
+ 5100	RETURN
+ 5150	CALL ERRMSG( ferr_dim_underspec, status, 
+     .			'overlay not valid in plane of plot'//pCR//
+     .					cmnd_buff(:len_cmnd), *5100 )
+ 5160	IF (mvx_temp .NE. 0) CALL DELETE_VARIABLE( mvx_temp )
+        CALL ERRMSG( ferr_dim_underspec, status, 
+     .			'must be a 2D region'//pCR//
+     .					cmnd_buff(:len_cmnd), *5100 )
+
+! 5200	CALL ERRMSG( ferr_no_range, status,
+!     .				'data are all flagged as bad', *5000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'can only '//commands(cmnd_num)//' single fields'//pCR//
+     .		     'Use /OVERLAY for multiple variables', *5100 )
+ 5400	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		 letter//' coord field lies'//pCR//
+     .		'in different plane from data to be plotted', *5100 )
+ 5500	CALL ERRMSG( ferr_no_range, status, letter//
+     .				' coordinate field', *5000 )
+
+ 5660	cal_name_1 = TM_GET_CALENDAR_NAME(saved_calendar_id)
+        cal_name_2 = TM_GET_CALENDAR_NAME(cal_id)
+        slen = TM_LENSTR1 (cal_name_1)
+        slen2 = TM_LENSTR1(cal_name_2)
+	CALL ERRMSG( ferr_inconsist_grid, status,
+     .          'Differing calendar axes: '//pCR//
+     .		'first variable is on '//cal_name_1(:slen)//
+     .          ' axis'//pCR//
+     .		'subsequent variable is on '//cal_name_2(:slen2)//
+     .		' axis', *5000 )
+
+ 5700	buff1 = LEFT_REAL (first, '(G15.3)', slen)
+	buff2 = LEFT_REAL (last,  '(G15.3)', slen2)
+	CALL ERRMSG( ferr_out_of_range, status,
+     . 'Limits for log axis negative or too small: '//
+     .  buff1(:slen)// ' : '// buff2(:slen2), *5000 )
+
+ 5710   CALL ERRMSG( ferr_out_of_range, status,
+     .     'data too large to compute Std Dev'//pCR//
+     .      cmnd_buff(:len_cmnd), *5100 )
+ 5720   CALL ERRMSG( ferr_out_of_range, status,
+     .     err_string//pCR//cmnd_buff(:len_cmnd), *5100 )
+
+	END
diff --git a/fer/plt/echof_off.F b/fer/plt/echof_off.F
new file mode 100644
index 0000000..9f0bb09
--- /dev/null
+++ b/fer/plt/echof_off.F
@@ -0,0 +1,46 @@
+	SUBROUTINE ECHOF_OFF
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* *acm* V6.08 10/07 Turn off the flag echof for batch mode, so we can set metafile
+* names without writing spurious stuff to fort.23
+
+	include	'system_inc.decl'	! with echof
+	include	'SYSTEM.INC'	        ! with echof
+
+	echof = .FALSE.
+
+	RETURN
+	END
diff --git a/fer/plt/equal_color.F b/fer/plt/equal_color.F
new file mode 100644
index 0000000..d16265a
--- /dev/null
+++ b/fer/plt/equal_color.F
@@ -0,0 +1,190 @@
+	SUBROUTINE EQUAL_COLOR( string, icolor, dfltthick, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* From a string of the form "name=value", assign the color ID of the 
+* color specified in the "value" string.  If the string is just "name",
+* color ID one is assigned.
+*
+* The default thickness of the pen for the color specified is returned
+* in dfltthick.  This is for when the color is specified by the pen number.
+
+* V510 *sh* 3/00 - based upon EQUAL_STRING
+*      *kob* 5/00 - minor change to declaration of colors array needed to
+*                   compile under nag f95 for linux
+* V520 6/00 *sh* - introduced "white" as color 19 (only thin available)
+*
+* 1/03 *kob* g77 port - requires use of risc_buff for concats
+*
+* PyFr *kms*  6/13 - add support for (R,G,B) and (R,G,B,A)
+* 
+* PyFr *kms*  7/13 - add support for R,G,B and R,G,B,A (no parentheses);
+*                    return a color ID and the default pen thickness
+*                    instead of a pen ID; white is color ID 7
+*
+* calling argument declarations
+
+        IMPLICIT NONE
+
+	INTEGER		icolor, status
+        REAL*4          dfltthick
+	CHARACTER*(*)	string
+
+* internal parameter declarations
+	INTEGER ncolor_string
+	PARAMETER (ncolor_string = 7)
+
+* internal variable declarations
+	LOGICAL	MATCH4, TM_DIGIT
+	INTEGER	TM_LENSTR, TM_LENSTR1, STR_UPCASE, ncolors,
+     .          equal_pos, slen, strt, vax_code, len_test, len_mchars
+	REAL	val
+        REAL*4 redfrac, grnfrac, bluefrac, opaqfrac
+	CHARACTER	LEFINT*4, str*32, parenstr*34
+	CHARACTER*12    COLORS(ncolor_string)
+
+* internal data declarations
+	DATA colors/'BLACK','RED','GREEN',
+     .		    'BLUE','LIGHTBLUE','PURPLE','WHITE'/
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+        include 'tmap_dims.parm'
+	include 'xrisc_buff.cmn'
+        include 'xprog_state.cmn'
+        include 'fgrdel.cmn'
+
+* initialize
+	slen	  = TM_LENSTR1( string )
+	equal_pos = INDEX( string, '=' )
+* in general, the default thickness is thin
+        dfltthick = 1.0
+        ncolors = mode_arg(pmode_linecolors,1)
+
+	IF ( equal_pos .EQ. 0 ) THEN
+	   str = ' '				! "name", alone
+	   icolor = 1
+	   RETURN
+
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+
+	ELSE
+
+* find first non-blank
+	   DO 100 strt = equal_pos+1, slen
+ 100	   IF ( string(strt:strt) .NE. ' ' ) GOTO 110
+	   STOP '=_str'		! cannot occur
+
+* remove quotation marks
+ 110	   IF ( string(strt:strt) .EQ. '"' ) strt = strt + 1
+	   IF ( string(slen:slen) .EQ. '"' ) slen = slen - 1
+
+	   IF ( strt .GT. slen ) THEN
+	      str = ' '
+	   ELSE
+	      vax_code = STR_UPCASE( str, string(strt:slen) )
+	   ENDIF
+
+	ENDIF
+
+	IF ( TM_DIGIT(str) ) THEN 
+           vax_code = INDEX(str,',')
+           IF ( vax_code .GT. 1 ) THEN
+* ... color by R,G,B,A or R,G,B
+*             add the surrounding parentheses expected by PARSE_TUPLE_COLOR
+              parenstr = '(' // str // ')'
+              CALL PARSE_COLOR_TUPLE(parenstr, redfrac, grnfrac, 
+     .                               bluefrac, opaqfrac, status)
+              IF ( status .NE. ferr_ok ) RETURN
+*             Now create a temporary color using these RGBA values
+              CALL FGD_CREATE_TEMP_COLOR(activewindow, icolor, 
+     .                        redfrac, grnfrac, bluefrac, opaqfrac)
+           ELSE
+* ... color and thickness by number
+              READ ( str, *, ERR=5000 ) val
+              icolor = NINT( val )
+              IF ((icolor .LT. 0).OR.(icolor .GE. maxcolorobjs-1)) THEN
+                 GOTO 5200
+              ELSE IF ( icolor .LE. ncolors ) THEN
+*                Pen is thin with the color ID same as pen ID
+                 CONTINUE
+              ELSE IF ( icolor .LE. 2 * ncolors ) THEN
+*                Pen is medium thickness with color ID  1 - ncolors
+                 icolor = icolor - ncolors
+                 dfltthick = 2.0
+              ELSE IF ( icolor .LE. 3 * ncolors ) THEN
+*                Pen is thick with color ID  1 - ncolors
+                 icolor = icolor - 2 * ncolors
+                 dfltthick = 3.0
+              ENDIF
+           ENDIF
+        ELSEIF ( str(1:1) .EQ. '(' ) THEN
+* ... color by (R,G,B,A) or (R,G,B)
+           CALL PARSE_COLOR_TUPLE(str, redfrac, grnfrac, 
+     .                            bluefrac, opaqfrac, status)
+           IF ( status .NE. ferr_ok ) RETURN
+*          Now create a temporary color using these RGBA values
+           CALL FGD_CREATE_TEMP_COLOR(activewindow, icolor, 
+     .                     redfrac, grnfrac, bluefrac, opaqfrac)
+	ELSE
+* ... compare with allowable colors
+           len_test = TM_LENSTR(str)
+	   DO 200 icolor = 1, ncolor_string
+              len_mchars = TM_LENSTR(colors(icolor)(:4))
+	      IF ( MATCH4(str, len_test,
+     .                    colors(icolor), len_mchars) ) GOTO 1000
+ 200	   CONTINUE
+	   GOTO 5100   ! unknown color
+	ENDIF
+
+* success
+ 1000	status = ferr_ok
+ 4999	RETURN
+
+* syntax error
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *4999 )
+ 5100	risc_buff = string
+	CALL ERRMSG( ferr_invalid_command, status, 
+     .		risc_buff(:TM_LENSTR1(risc_buff))//pCR//
+     .          'Colors are Black, Red, Green, Blue, '//
+     .          'LightBlue, Purple, and White', *4999 )
+ 5200	risc_buff = string
+	CALL ERRMSG( ferr_out_of_range, status, 
+     .		risc_buff(:TM_LENSTR1(risc_buff))
+     .          //pCR//'Legal range is 0 to '
+     .		//LEFINT(maxcolorobjs-2,slen), *4999 )
+	END
diff --git a/fer/plt/equal_range.F b/fer/plt/equal_range.F
new file mode 100644
index 0000000..83c3e5b
--- /dev/null
+++ b/fer/plt/equal_range.F
@@ -0,0 +1,189 @@
+	SUBROUTINE EQUAL_RANGE( string,idim,lo,hi,delta,formatted,
+     .				range_rqd, cal_id, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the lo/high value range
+* if the string is simply "name" then return unspecified values
+* the "delta" value is optional - return unspecfied_val8 if not given
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V3.00  20/10/93 - *sh*
+* V3.20  18/08/94 - *kob*  IBM port requires use of RISC buff for string concat's
+* 1/97 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V500 *sh* - 6/99 check for quotations around text (e.g. date strings)
+* V521 *sh* - added boolean "range_rqd" argument
+* V530 *acm* - send cal_id to TRANSLATE_LIMIT
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+* calling argument declarations
+	LOGICAL		formatted, range_rqd
+	INTEGER		idim, cal_id, status
+	REAL*8		lo, hi, delta
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		has_delta, ldummy, not_by_ss, in_quote
+	PARAMETER 	(not_by_ss =  .FALSE.)
+	INTEGER 	equal_pos, colon1, colon2, end2, slen, i
+	REAL*8		tmp
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+#ifdef NO_PASSED_CONCAT
+	include 'xrisc.cmn'
+#endif
+
+* initialize
+	status = ferr_ok
+	slen	  = LEN( string )
+	equal_pos = INDEX( string, '=' )
+
+* check for gross syntax errors
+	IF ( equal_pos .EQ. 0 ) THEN
+	   GOTO 5000
+	ELSEIF ( equal_pos .EQ. slen ) THEN	
+	   GOTO 5000				! "name ="
+	ELSEIF ( string(equal_pos+1:) .EQ. ' ' ) THEN
+	   GOTO 5000				! "name =    "
+! removed 6/99 so quotations wouldn't be trapped here
+!	ELSEIF ( .NOT.TM_DIGIT(string(equal_pos+1:)) ) THEN
+!	   GOTO 5000				! "name = text"
+	ENDIF
+
+* lo:hi:delta parsing and syntax checking
+	colon1 = 0
+	in_quote = .FALSE.
+	DO 100 i = equal_pos+1, SLEN
+	   IF (string(i:i) .EQ. '"') THEN
+	      in_quote = .NOT.in_quote
+	   ELSEIF (in_quote) THEN
+	      CONTINUE	! skip text inside of quotation
+	   ELSEIF (string(i:i) .EQ. ':') THEN
+	      colon1 = i
+	      GOTO 110
+	   ENDIF
+ 100	CONTINUE
+	IF ( in_quote ) GOTO 5000
+	IF (colon1 .EQ. 0 ) GOTO 5000
+
+ 110	colon2 = colon1
+	DO 200 i = colon1+1, slen
+	   IF (string(i:i) .EQ. '"') THEN
+	      in_quote = .NOT.in_quote
+	   ELSEIF (in_quote) THEN
+	      CONTINUE	! skip text inside of quotation
+	   ELSEIF (string(i:i) .EQ. ':') THEN
+	      colon2 = i
+	      GOTO 210
+	   ENDIF
+ 200	CONTINUE
+	IF ( in_quote ) GOTO 5000
+ 210	has_delta = colon2 .GT. colon1
+	IF ( has_delta ) THEN
+	    end2 = colon2 - 1
+	    IF ( slen .LE. colon2 ) GOTO 5000
+	ELSE
+	   end2 = slen
+	ENDIF
+	IF ( end2 .LE. colon1 ) GOTO 5000
+
+* translate the low limit
+	CALL TRANSLATE_LIMIT( string(equal_pos+1:colon1-1), idim,
+     .			      not_by_ss, lo, formatted, cal_id, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* translate the high limit
+	CALL TRANSLATE_LIMIT( string(colon1+1:end2), idim,
+     .			      not_by_ss, hi, formatted, cal_id, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* optionally translate the delta value
+	IF ( has_delta ) THEN
+	   CALL TRANSLATE_LIMIT( string(colon2+1:slen), idim,
+     .			      not_by_ss, delta, ldummy, cal_id, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   delta = unspecified_val8
+	ENDIF
+	
+* date strings are returned negative from TRANSLATE_LIMIT
+	IF ( formatted .AND. (idim .EQ. t_dim .OR. idim .EQ. f_dim) ) THEN
+	   delta = unspecified_val8	! can't modify time axis with delta
+	   has_delta = .FALSE.
+	   lo = -1 * lo
+	   hi = -1 * hi
+	   IF ( lo .GT. hi ) THEN	! PLOT+ cant handle reversed dates
+	      tmp = lo
+	      lo = hi
+	      hi = tmp
+	   ENDIF
+	ENDIF
+      
+* two possible notations to indicate reserved limits
+* change lo:hi:-delta  to hi:lo:delta
+	IF ( has_delta .AND. delta .LT. 0.D0 ) THEN
+	   IF ( lo .LT. hi ) THEN
+	      tmp = lo
+	      lo = hi
+	      hi = tmp
+	   ENDIF
+	   delta = ABS( delta )
+	ENDIF
+
+* check for valid range
+	IF ( range_rqd ) THEN
+	   IF ( lo .EQ. hi ) GOTO 5100
+	ENDIF
+
+* success
+ 1000	RETURN
+
+* errors
+ 5000	CALL ERRMSG( ferr_syntax, status, string, *1000 )
+#ifdef NO_PASSED_CONCAT	
+ 5100	risc_buff= string
+ 	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Must give a range: '//risc_buff, *1000 )
+#else
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Must give a range: '//string, *1000 )
+#endif
+	END
diff --git a/fer/plt/equal_range_t.F b/fer/plt/equal_range_t.F
new file mode 100644
index 0000000..9dfb9a9
--- /dev/null
+++ b/fer/plt/equal_range_t.F
@@ -0,0 +1,97 @@
+	SUBROUTINE EQUAL_RANGE_T( string,idim,grid,lo,hi,delta,cal_id,
+     .				status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* from a string of the form "name=value", return the lo/high value range
+* if the string is simply "name" then return unspecified values
+* the "delta" value is optional - return unspecfied_val8 if not given
+
+* This routine differs from EQUAL_RANGE in the treatment of time axes.
+* This routine always returns a tstep value.  If MODE CALENDAR is TRUE
+* this routine checks to make sure the points are ordered.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V3.00  20/10/93 - *sh*
+* V522 7/00 *sh* - added add'l argument to EQUAL_RANGE
+* V5.3 *ACM* 3/01  send cal_id to EQUAL_RANGE_T
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+
+* calling argument declarations
+	INTEGER		idim, grid, cal_id, status
+	REAL*8		lo, hi, delta
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		GEOG_LABEL, formatted
+	REAL*8		SECS_TO_TSTEP, tmp
+
+* local parameter declarations:
+	LOGICAL         range_rqd
+	PARAMETER     ( range_rqd = .TRUE. )
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* first get EQUAL_RANGE to convert the data normally
+	CALL EQUAL_RANGE( string, idim, lo, hi, delta,
+     .			  formatted,  range_rqd, cal_id, status )
+	IF ( status .NE. ferr_OK ) RETURN
+
+	IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+* if the time was given as a date convert it to a tstep
+
+	   IF ( formatted ) THEN
+	      lo = SECS_TO_TSTEP( grid, idim, lo )
+	      hi = SECS_TO_TSTEP( grid, idim, hi )
+	   ENDIF		
+
+* if MODE CALENDAR is TRUE in FERRET make sure the times are ordered
+	   IF ( GEOG_LABEL(idim,grid)
+     .    .AND. lo .GT. hi		 ) THEN 
+	      tmp = lo
+	      lo = hi
+	      hi = tmp
+	   ENDIF
+	ENDIF
+
+* success
+ 1000	RETURN
+	END
diff --git a/fer/plt/equal_thick.F b/fer/plt/equal_thick.F
new file mode 100644
index 0000000..6b19a81
--- /dev/null
+++ b/fer/plt/equal_thick.F
@@ -0,0 +1,171 @@
+        SUBROUTINE EQUAL_THICK(strng, dfltthick, icolor, ipen, istat)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* From a string in strng of the form "thick=value", giving the pen 
+* thickness, and using the color ID in icolor, assign the pen ID to 
+* ipen.  If strng is blank, the default thickness in dfltthick is used 
+* for the thickness.  (The name "thick" is not checked, only the value.)
+* If no "=value" is given, a value of 2.0 is used.
+*
+* If icolor is negative (presumably QUAL_ON, but maybe -1), then
+* only a thickness of 1.0, 2.0, or 3.0 (or no "=value", which becomes
+* 2.0) is accepted.  In these cases, ipen = icolor, icolor-10, or icolor-20
+*
+
+        IMPLICIT NONE
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xrisc_buff.cmn'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+* calling argument declarations
+        INTEGER icolor, ipen, istat
+        REAL*4  dfltthick
+        CHARACTER*(*) strng
+
+* external function declarations
+        LOGICAL TM_DIGIT
+        INTEGER TM_LENSTR, TM_LENSTR1
+
+* internal variable declarations
+        INTEGER slen, equal_pos, strt, numlinecolors
+        REAL*4  thickness
+
+
+* check if a thickness value is specified
+        slen = TM_LENSTR(strng)
+        IF ( slen .LE. 0 ) THEN
+*          blank string - use default thickness
+           thickness = dfltthick
+           GOTO 200
+        ENDIF
+
+        equal_pos = INDEX(strng, '=')
+        IF ( equal_pos .EQ. 0 ) THEN
+*          "/thick" - make it a thicker line
+           thickness = 2.0
+           GOTO 200
+        ENDIF
+
+* find first non-blank after the equals sign
+        IF ( equal_pos .EQ. slen ) THEN        
+*          "/thick=" - syntax error
+           GOTO 5010
+        ENDIF
+        DO 100 strt = equal_pos+1, slen
+ 100       IF ( strng(strt:strt) .NE. ' ' ) GOTO 110
+*       should never get here because of earlier checks
+        GOTO 5010
+
+*       remove quotation marks
+ 110    IF ( strng(strt:strt) .EQ. '"' ) strt = strt + 1
+        IF ( strng(slen:slen) .EQ. '"' ) slen = slen - 1
+        IF ( strt .GT. slen ) THEN
+*          /thick="" - treat the same as /thick
+           thickness = 2.0
+           GOTO 200
+        ENDIF
+
+* get the numeric thickness value specified
+        IF ( .NOT. TM_DIGIT(strng(strt:slen)) ) GOTO 5020
+        READ ( strng(strt:slen), *, ERR=5010 ) thickness
+*       cannot be negative; zero is okay
+        IF ( thickness .LT. 0.0 ) GOTO 5020
+
+* check the special case of negative icolor values
+ 200    IF ( icolor .LT. 0 ) THEN
+           IF ( ABS(thickness - 1.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor
+              GOTO 4900
+           ENDIF
+           IF ( ABS(thickness - 2.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor - 10
+              GOTO 4900
+           ENDIF
+           IF ( ABS(thickness - 3.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor - 20
+              GOTO 4900
+           ENDIF
+*          thicknesses must be 1.0, 2.0, or 3.0 in these cases
+           GOTO 5030
+        ENDIF
+
+* check if this is one of the standard pens
+        numlinecolors = mode_arg(pmode_linecolors,1)
+        IF ( (icolor .GE. 1) .AND. (icolor .LE. numlinecolors) ) THEN
+           IF ( ABS(thickness - 1.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor
+              GOTO 4900
+           ENDIF
+           IF ( ABS(thickness - 2.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor + numlinecolors
+              GOTO 4900
+           ENDIF
+           IF ( ABS(thickness - 3.0) .LT. 1.0E-4 ) THEN
+              ipen = icolor + 2 * numlinecolors
+              GOTO 4900
+           ENDIF
+        ENDIF
+
+* create a temporary pen using this custom combination of color and thickness
+        CALL FGD_CREATE_TEMP_PEN(activewindow, ipen, icolor, thickness)
+
+* success
+ 4900   istat = ferr_ok
+ 5000   RETURN
+
+* syntax error
+ 5010   CALL ERRMSG(ferr_syntax, istat, strng, *5000)
+
+* invalid value
+ 5020   risc_buff = strng
+        CALL ERRMSG(ferr_out_of_range, istat, 
+     .              risc_buff(:TM_LENSTR1(risc_buff))//
+     .              pCR//'Must be a non-negative number',
+     .              *5000)
+
+* restricted values for automatic colors
+ 5030   risc_buff = strng
+        CALL ERRMSG(ferr_out_of_range, istat, 
+     .              risc_buff(:TM_LENSTR1(risc_buff))//
+     .              pCR//'When color is not specified, '//
+     .              'only 1, 2, or 3 is acceptable',
+     .              *5000)
+
+        END
diff --git a/fer/plt/flow_set_up.F b/fer/plt/flow_set_up.F
new file mode 100644
index 0000000..a1f5a96
--- /dev/null
+++ b/fer/plt/flow_set_up.F
@@ -0,0 +1,88 @@
+	SUBROUTINE FLOW_SET_UP (mr_list, cx_list, transpz)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up for flowline plots, determining if we need the cosine correction
+
+* programmer - Ansley Manke -- from disp_set_up
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* 5/31/01
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+C replace includes with those from plot_set_up, 
+C plus those starting w/ xbox_bounds:
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xplot_setup.cmn'
+	include 'xvariables.cmn'
+
+	include 'vector_inc.decl'	! with need_cos
+	include 'VECTOR.INC'		! with need_cos
+
+*kob 1/97
+	include 'xwindow_state.cmn'
+
+* calling argument declarations:
+	INTEGER		mr_list(*), cx_list(*)
+
+* internal variable declarations:
+
+	INTEGER	dim1, dim2, mvx, ctx, grid
+        LOGICAL	GEOG_COS_FACTOR, transpz
+
+* initialize
+	mvx  = mr_list( 1 )
+	ctx  = cx_list  ( 1 )
+	grid = mr_grid( mvx )
+
+* get dimensions of data region 
+	dim1 = plot_axis(1)
+	dim2 = plot_axis(2)
+
+* will we need COS(latitude) corrections ? ( the true dx may be dx*COS(lat) )
+        IF ( dim1.EQ.x_dim .AND. dim2.EQ.y_dim ) THEN
+           need_cos =     GEOG_COS_FACTOR(x_dim, grid)
+     .              .AND. GEOG_COS_FACTOR(y_dim, grid)
+        ELSE
+           need_cos = .FALSE.
+        ENDIF
+
+        trnspz = transpz
+
+	RETURN
+	END
diff --git a/fer/plt/get_axis_format.F b/fer/plt/get_axis_format.F
new file mode 100644
index 0000000..7a4ff50
--- /dev/null
+++ b/fer/plt/get_axis_format.F
@@ -0,0 +1,80 @@
+	SUBROUTINE GET_AXIS_FORMAT( lo_val, hi_val, del_val, 
+     .     fmt, use_nice )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* ACM 5/2005
+* set up the format for PPLUS to properly label the axis tics
+* Extracted from axis_format.F
+* 
+* 2/2008 ACM If the lo and hi value on the axis are the same '
+* (which may happen in a PLOT/VS plot) we got a divide by zero.
+
+* calling argument declarations:
+	CHARACTER	fmt*4
+	REAL*8		lo_val, hi_val, del_val
+        LOGICAL         use_nice
+
+* internal variable declarations:
+	INTEGER		places, ndec
+	REAL		res_del
+	INTEGER		n_res
+
+* decimal places needed for axis:
+* ... sufficient digits to resolve the tic interval differences and
+*     still display the largest axis labels
+*  res_del	- labels will be accurate enough to resolve this delta value
+
+* Compute n_res; round up (hi-lo)/(2*del_val)  We label half of the tic marks...
+
+        n_res = INT(0.5+ ABS(hi_val - lo_val) / (2.D0*del_val) )
+        IF (n_res .EQ. 0) n_res = del_val
+	res_del = ABS( hi_val - lo_val ) / n_res
+	CALL GET_PREC_DIGITS( hi_val, lo_val, res_del, places, ndec )
+
+* format to use
+* Let smaller ranges be labeled with longitude (range 161.123 to 161.130)
+*	use_nice = places .LE. 6
+	use_nice = places .LE. 7
+	IF ( use_nice ) THEN
+	   IF ( ndec .EQ. 0 ) THEN
+	      fmt = 'I7'
+	   ELSE
+	      WRITE ( fmt, 3000 ) ndec
+ 3000	      FORMAT ('F8.',I1)
+	   ENDIF
+	ENDIF
+
+        RETURN
+        END
diff --git a/fer/plt/get_frame_size.F b/fer/plt/get_frame_size.F
new file mode 100644
index 0000000..cb8c9cb
--- /dev/null
+++ b/fer/plt/get_frame_size.F
@@ -0,0 +1,99 @@
+        SUBROUTINE GET_FRAME_SIZE (ws_id,status,x_pixel_dim,y_pixel_dim)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Capture size in pixels of GKS ws with id ws_id
+*       J Davison 12.23.92
+*	Mod 3.11.93 for Ferret to capture entire screen when in viewport
+* 1/97 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+
+        include 'errmsg.parm'
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+
+	integer		error_status,transno,ws_id
+	integer		x_pixel_dim,y_pixel_dim
+	integer		status,new_trans
+	PARAMETER	( new_trans = 10 )
+
+	real*4		rzero, fctx,fcty, world(4),
+     .			x_minw,x_maxw,y_minw,y_maxw,ndc(4)
+
+******************************************************************************
+
+*	GET WORLD COORDINATES AND PIXEL DIMENSIONS OF FRAME
+	call  FGD_GQCNTN(error_status,transno)
+	if (error_status .ne. 0) goto 1100
+
+	rzero = 0.0
+
+        IF(ASIZE.GT.BSIZE)THEN
+           FCTY=BSIZE/ASIZE
+           FCTX=1.0
+        ELSE
+           FCTX=ASIZE/BSIZE
+           FCTY=1.0
+        ENDIF
+	CALL FGD_GSWN(new_trans, rzero, asize, rzero, bsize )
+	CALL FGD_GSVP(new_trans, rzero, fctx,  rzero, fcty )
+	CALL FGD_GSELNT(new_trans)
+
+	call FGD_GQNT(new_trans,error_status,world,ndc)
+	if (error_status .ne. 0) goto 1000
+
+        x_minw = world(1)
+        x_maxw = world(2)
+        y_minw = world(3)
+        y_maxw = world(4)
+
+	call FGD_GQPXAD(ws_id,x_minw,y_maxw,x_maxw,y_minw,
+     .	error_status,x_pixel_dim,y_pixel_dim)
+
+	if (error_status .ne. 0) goto 1000
+	
+	call FGD_GSELNT(transno)
+        status = ferr_ok
+        return
+
+*	GKS ERROR EXIT
+ 1000   call FGD_GSELNT(transno)
+ 1100   status = ferr_tmap_error
+	return
+
+	end
+
diff --git a/fer/plt/get_view_size.F b/fer/plt/get_view_size.F
new file mode 100644
index 0000000..7689154
--- /dev/null
+++ b/fer/plt/get_view_size.F
@@ -0,0 +1,88 @@
+      SUBROUTINE GET_VIEW_SIZE( vxsize, vysize )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the X and Y size of the current viewport in Denbo inches
+* This routine is to be called directly from PLOT+.
+* It requires an External declaration in the main program to ensure
+* that it is loaded at link time.
+
+* Further, this routine supports a kludge:
+* PLOT+ "should" really be aware only of the current viewport.
+* The ASIZE,BSIZE known by PLOT+ should be the vaules that
+* this routine is computing.  Currently, PLOT+ creates the full window and
+* FERRET creates and modifies windows by communicating with PLOT+.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* Unix/RISC port - 10/91
+* V300:  4/19/93 - old style vp's: use ABS() for negative vp_size
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+
+	include 'ferret.parm'
+	include 'xplot_state.cmn'
+	include	'plt_inc.decl'	! with sizing data,etc.
+	include	'PLT.INC'	! with sizing data, etc.
+
+* calling argument declarations:
+	REAL*4 vxsize, vysize
+
+* internal variable declarations:
+	REAL	vxmax, vymax, scale
+
+* initialize to full plot size
+        vxsize = width
+        vysize = height
+
+* If viewports are active compute fraction of plot size in viewport
+	IF ( vp_num .NE. mvp_dflt ) THEN
+           IF ( vp_xclip(vp_num) .EQ. unspecified_val4 ) THEN
+              vxmax = 1.0
+              vymax = 1.0
+           ELSE
+              vxmax = vp_xclip(vp_num)
+              vymax = vp_yclip(vp_num)
+           ENDIF
+           scale = 1.0 / SQRT( ABS(vp_size(vp_num)) )
+           vxsize = scale * vxsize * (vxmax - vp_xorg(vp_num))
+           vysize = scale * vysize * (vymax - vp_yorg(vp_num))
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/plt/get_window_pixels.F b/fer/plt/get_window_pixels.F
new file mode 100644
index 0000000..774a629
--- /dev/null
+++ b/fer/plt/get_window_pixels.F
@@ -0,0 +1,115 @@
+        SUBROUTINE GET_WINDOW_PIXELS (ws_id,x_pixel_dim,y_pixel_dim)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Capture size in pixels of GKS ws with id ws_id
+*       J Davison 12.23.92
+*	Mod 3.11.93 for Ferret to capture entire screen when in viewport
+
+*	Mod 10/9/95 *sh* to make this a PLOT+ routine rather than a Ferret
+*	routine.  Renamed "GET_WINDOW_PIXELS" from "GET_FRAME_SIZE"
+
+*	Note:  because this routine uses floating point calculations there
+*	is reason for concern that there may be single pixel errors in the
+*	size returned.  An alternative approach (in C) would use
+*	XGKS gescinqxattr to get the X display, window, and graphic context
+*	and (presumably) XGetWindowAttributes (see Ferret's grab_image_xwd.c)
+*	to get the pixel size.
+* 1/97 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* 8/04 *acm* - Get x and y pixel sizes that were saved in common by set_window_size.
+*              When in gif or batch mode, these will be values of symbols PPL$XPIXEL 
+*              and PPL$YPIXEL.  If not in gif  or batch mode, we get the window size 
+*              from a GKS call.
+* V602: *acm* 1/07 Changes for metafile-batch mode
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+
+	integer		error_status,transno,ws_id
+	integer		x_pixel_dim,y_pixel_dim
+	integer		new_trans
+	PARAMETER	( new_trans = 10 )
+
+	real*4		rzero,fctx,fcty
+	real*4		world(4),ndc(4),x_minw,x_maxw,y_minw,y_maxw
+
+******************************************************************************
+
+* initialize in case of error (not an adequate response, really)
+	x_pixel_dim = 1
+	y_pixel_dim = 1
+	rzero = 0.0
+
+*	GET WORLD COORDINATES AND PIXEL DIMENSIONS OF FRAME
+	call  FGD_GQCNTN(error_status,transno)
+	if (error_status .ne. 0) RETURN
+
+        IF(ASIZE.GT.BSIZE)THEN
+           FCTY=BSIZE/ASIZE
+           FCTX=1.0
+        ELSE
+           FCTX=ASIZE/BSIZE
+           FCTY=1.0
+        ENDIF
+	CALL FGD_GSWN(new_trans, rzero, asize, rzero, bsize )
+	CALL FGD_GSVP(new_trans, rzero, fctx,  rzero, fcty )
+	CALL FGD_GSELNT(new_trans)
+
+	call FGD_GQNT(new_trans,error_status,world,ndc)
+	if (error_status .ne. 0) GOTO 1000
+
+        x_minw = world(1)
+        x_maxw = world(2)
+        y_minw = world(3)
+        y_maxw = world(4)
+
+! get pixx and pixy that were saved by set_window_size
+
+        CALL get_pix(ws_id,x_pixel_dim, y_pixel_dim)
+
+        CALL FGD_GQPXAD(ws_id,x_minw,y_maxw,
+     .  x_maxw,y_minw,error_status,x_pixel_dim,y_pixel_dim)
+
+ 1000	call FGD_GSELNT(transno)
+        return
+
+	end
+
diff --git a/fer/plt/gks_windows.F b/fer/plt/gks_windows.F
new file mode 100644
index 0000000..bf82e90
--- /dev/null
+++ b/fer/plt/gks_windows.F
@@ -0,0 +1,63 @@
+	LOGICAL FUNCTION GKS_WINDOWS()
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if the GKS is installed on the system and can be used from the
+* current environment
+* ... as of 5/01/91 the latter requirement isn't really checked ...
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 8/16/88
+* V200:  9/12/89 - DECwindows
+*	 1/25/90 - based on "GKS_WSTYPE" instead of "TT"
+*	 5/01/91 - unixify *JD*
+* V230: simply return .TRUE. on Unix systems
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+      GKS_WINDOWS = .TRUE.
+!* internal variable declarations:
+!	LOGICAL		there
+! 
+!* search for GKS3D library
+!	INQUIRE (FILE='/lib/libGKS3D.a',EXIST=there)	
+!
+!* if there then GKS is installed
+!	GKS_WINDOWS = there
+
+	RETURN
+	END
diff --git a/fer/plt/gks_x_conid.F b/fer/plt/gks_x_conid.F
new file mode 100644
index 0000000..eb8cbe0
--- /dev/null
+++ b/fer/plt/gks_x_conid.F
@@ -0,0 +1,78 @@
+      CHARACTER*(*) FUNCTION GKS_X_CONID( wsid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the correct name for the CONID to open the next GKS output window
+* the value of wsid is assumed to be 1 for the first window, 2,3,... for
+* subsequent windows
+* the name stored in xwind_node is assumed to end with ":0" or "::0"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200: 12/20/89
+* RISC/Ultrix port *sh* 5/91:  allow tcp/ip addresses, too 
+* V230:  5/14/92 - REMOTE_X mode was replaced by the REFRESH mode
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xprog_state.cmn'
+	
+* calling argument declarations:
+	INTEGER		wsid
+
+* internal variable declarations:
+	CHARACTER	letter*1
+
+* generate letter "A", "B", ...
+	letter = CHAR(64+wsid)
+
+* format of conid is DECnet_node::0.letter
+*                 or tcp.ip.node:0.letter
+* the stored name (xwind_node) lacks only the "dot-letter" ending
+* eliminated mode_Xwindows 5/92 
+!	IF ( mode_Xwindows ) THEN
+!           GKS_X_CONID = xwind_node(:xwind_node_len)//'.'//letter
+!	ELSE
+* ... local DECnet connect name
+	  GKS_X_CONID = '0::0.'//letter
+!	ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/internal_whoi_date.F b/fer/plt/internal_whoi_date.F
new file mode 100644
index 0000000..b769834
--- /dev/null
+++ b/fer/plt/internal_whoi_date.F
@@ -0,0 +1,105 @@
+	CHARACTER*14 FUNCTION INTERNAL_WHOI_DATE( grid, idim, tstep )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form YYMMDDHHMMSSCC (internal ordering) from the
+* time step
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/15/88
+* revision 0.1 - 1/18/89 - BREAK_DATE --> TM_BREAK_DATE
+* V200:  1/31/90 - fixed bug with climatological axes (years "0000" and "0001"
+*		   but produce the same WHOI dates)
+* V420: 11/27/95 - 4-digit YEARS!!
+* v530  12/19/00 *acm* cal_id for non-standard calendar types.
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	REAL*8	tstep
+
+* internal variable declarations
+	INTEGER 	yr100, yr, mon, day, hr, min, sec,
+     .			status, i, axis
+	INTEGER		TM_GET_CALENDAR_ID, cal_id
+	CHARACTER*20	TM_SECS_TO_DATE, date
+	REAL*8		start_secs, offset_secs, this_secs
+	REAL*8		SECS_FROM_BC
+
+* get the axis number
+	axis = grid_line( idim, grid )
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   INTERNAL_WHOI_DATE = '00000000000000'
+	   RETURN
+	ELSEIF ( line_direction(axis) .NE. 'TI' .AND. 
+     .           line_direction(axis) .NE. 'FI' ) THEN
+	   INTERNAL_WHOI_DATE = '00000000000000'
+	   RETURN
+	ENDIF
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+
+        cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+	start_secs = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* Find the number of seconds since start of data set for this time step
+	offset_secs = tstep*line_tunit( axis )
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	this_secs = start_secs + offset_secs
+
+* Convert to date
+	date = TM_SECS_TO_DATE(this_secs, cal_id)
+
+* break the date string into component integer values
+	CALL TM_BREAK_DATE( date, cal_id, yr, mon, day, hr, min, 
+     .                      sec, status )
+	yr100 = yr/100		! 1980 --> 19
+	yr = yr - (yr100*100)	! 1982 --> 82
+
+* assemble the pieces in WHOI format
+	WRITE (INTERNAL_WHOI_DATE,3000) yr,mon,day,hr,min,sec,yr100
+ 3000	FORMAT (7I2.2)
+
+	RETURN
+	END
diff --git a/fer/plt/its_curv_edges.F b/fer/plt/its_curv_edges.F
new file mode 100644
index 0000000..8c4bf70
--- /dev/null
+++ b/fer/plt/its_curv_edges.F
@@ -0,0 +1,60 @@
+	LOGICAL FUNCTION ITS_CURV_EDGES(idim)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* are the curvilinear coordinates grid points or box edges for this dimension
+
+* V450: 3/97
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER idim
+
+* internal variable declarations
+
+	include 'xcurvilinear.cmn'
+
+	IF ( idim .EQ. 1 ) THEN
+
+	   ITS_CURV_EDGES = dim1_edges	! from COMMON
+
+	ELSE
+
+	   ITS_CURV_EDGES = dim2_edges	! from COMMON
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/plt/its_curvilinear.F b/fer/plt/its_curvilinear.F
new file mode 100644
index 0000000..69ab0a5
--- /dev/null
+++ b/fer/plt/its_curvilinear.F
@@ -0,0 +1,52 @@
+	LOGICAL FUNCTION ITS_CURVILINEAR( )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* are we being asked to do a curvilinear coordinate plot?
+
+* V450: 3/97
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+
+* internal variable declarations
+
+	include 'xcurvilinear.cmn'
+	
+	ITS_CURVILINEAR = curvilinear	! from COMMON
+
+	RETURN
+	END
diff --git a/fer/plt/itsa_axis_view.F b/fer/plt/itsa_axis_view.F
new file mode 100644
index 0000000..b325cd8
--- /dev/null
+++ b/fer/plt/itsa_axis_view.F
@@ -0,0 +1,52 @@
+	LOGICAL FUNCTION ITSA_AXIS_VIEW (dum)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular viewport is defined by /AXES
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V551: 02/03
+
+        INTEGER dum
+
+	include 'xplot_state.cmn'
+
+	ITSA_AXIS_VIEW = vp_by_axis(vp_num)
+
+	RETURN
+	END
diff --git a/fer/plt/itsa_modulo_curvi_axis.F b/fer/plt/itsa_modulo_curvi_axis.F
new file mode 100644
index 0000000..87e1912
--- /dev/null
+++ b/fer/plt/itsa_modulo_curvi_axis.F
@@ -0,0 +1,155 @@
+	LOGICAL FUNCTION ITSA_MODULO_CURVI_AXIS( xfield, yfield, mr_xpos, 
+     .                                           mr_ypos, idim, 
+     .                                           dim1, dim2)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       determine whether a particular curvilinear context grid axis is a modulo one
+
+*       programmer - jonathan callahan
+*       NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*       V420: 04/97
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14  Ticket 2151: The coordinate variables may be in other dimensions
+*                  than XY, e.g. XZ or YZ for a sigma-coordinate vertical axis.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xcurvilinear.cmn'
+
+*       calling argument declarations:
+	LOGICAL ITSA_MODULO_CURVI_AXIS_SUB
+	REAL    xfield(*), yfield(*)
+	INTEGER	mr_xpos, mr_ypos, idim, dim1, dim2
+
+*	Internal declarations
+	INTEGER slox_dim1, shix_dim1, slox_dim2, shix_dim2, 
+     .          sloy_dim1, shiy_dim1, sloy_dim2, shiy_dim2
+
+* The typical xlon, ylat case
+	IF (dim1 .EQ. 1) THEN
+	   slox_dim1 = mr_lo_s1(mr_xpos)
+	   shix_dim1 = mr_hi_s1(mr_xpos)
+	   sloy_dim1 = mr_lo_s1(mr_ypos)
+	   shiy_dim1 = mr_hi_s1(mr_ypos)
+	ENDIF
+
+* Coordinate field 1 represents something else
+	IF (dim1 .EQ. 2) THEN
+	   slox_dim1 = mr_lo_s2(mr_xpos)
+	   shix_dim1 = mr_hi_s2(mr_xpos)
+	   sloy_dim1 = mr_lo_s2(mr_ypos)
+	   shiy_dim1 = mr_hi_s2(mr_ypos)
+	ENDIF
+	IF (dim1 .EQ. 3) THEN
+	   slox_dim1 = mr_lo_s3(mr_xpos)
+	   shix_dim1 = mr_hi_s3(mr_xpos)
+	   sloy_dim1 = mr_lo_s3(mr_ypos)
+	   shiy_dim1 = mr_hi_s3(mr_ypos)
+	ENDIF
+	IF (dim1 .EQ. 4) THEN
+	   slox_dim1 = mr_lo_s4(mr_xpos)
+	   shix_dim1 = mr_hi_s4(mr_xpos)
+	   sloy_dim1 = mr_lo_s4(mr_ypos)
+	   shiy_dim1 = mr_hi_s4(mr_ypos)
+	ENDIF
+	IF (dim1 .EQ. 5) THEN
+	   slox_dim1 = mr_lo_s5(mr_xpos)
+	   shix_dim1 = mr_hi_s5(mr_xpos)
+	   sloy_dim1 = mr_lo_s5(mr_ypos)
+	   shiy_dim1 = mr_hi_s5(mr_ypos)
+	ENDIF
+	IF (dim1 .EQ. 6) THEN
+	   slox_dim1 = mr_lo_s6(mr_xpos)
+	   shix_dim1 = mr_hi_s6(mr_xpos)
+	   sloy_dim1 = mr_lo_s6(mr_ypos)
+	   shiy_dim1 = mr_hi_s6(mr_ypos)
+	ENDIF
+
+
+* The typical xlon, ylat case
+	IF (dim2 .EQ. 2) THEN
+	   slox_dim2 = mr_lo_s2(mr_xpos)
+	   shix_dim2 = mr_hi_s2(mr_xpos)
+	   sloy_dim2 = mr_lo_s2(mr_xpos)
+	   shiy_dim2 = mr_hi_s2(mr_xpos)
+	ENDIF
+
+* Coordinate field 2 represents something else
+	IF (dim2 .EQ. 1) THEN
+	   slox_dim2 = mr_lo_s1(mr_xpos)
+	   shix_dim2 = mr_hi_s1(mr_xpos)
+	   sloy_dim2 = mr_lo_s1(mr_xpos)
+	   shiy_dim2 = mr_hi_s1(mr_xpos)
+	ENDIF
+	IF (dim2 .EQ. 3) THEN
+	   slox_dim2 = mr_lo_s3(mr_xpos)
+	   shix_dim2 = mr_hi_s3(mr_xpos)
+	   sloy_dim2 = mr_lo_s3(mr_xpos)
+	   shiy_dim2 = mr_hi_s3(mr_xpos)
+	ENDIF
+	IF (dim2 .EQ. 4) THEN
+	   slox_dim2 = mr_lo_s4(mr_xpos)
+	   shix_dim2 = mr_hi_s4(mr_xpos)
+	   sloy_dim2 = mr_lo_s4(mr_xpos)
+	   shiy_dim2 = mr_hi_s4(mr_xpos)
+	ENDIF
+	IF (dim2 .EQ. 5) THEN
+	   slox_dim2 = mr_lo_s5(mr_xpos)
+	   shix_dim2 = mr_hi_s5(mr_xpos)
+	   sloy_dim2 = mr_lo_s5(mr_xpos)
+	   shiy_dim2 = mr_hi_s5(mr_xpos)
+	ENDIF
+	IF (dim2 .EQ. 6) THEN
+	   slox_dim2 = mr_lo_s6(mr_xpos)
+	   shix_dim2 = mr_hi_s6(mr_xpos)
+	   sloy_dim2 = mr_lo_s6(mr_xpos)
+	   shiy_dim2 = mr_hi_s6(mr_xpos)
+	ENDIF
+
+	ITSA_MODULO_CURVI_AXIS = ITSA_MODULO_CURVI_AXIS_SUB( xfield, yfield,
+     .          slox_dim1, shix_dim1, slox_dim2, shix_dim2, 
+     .          sloy_dim1, shiy_dim1, sloy_dim2, shiy_dim2,
+     5    idim )
+
+	RETURN
+	END
+	
diff --git a/fer/plt/itsa_modulo_curvi_axis_sub.F b/fer/plt/itsa_modulo_curvi_axis_sub.F
new file mode 100644
index 0000000..70d0635
--- /dev/null
+++ b/fer/plt/itsa_modulo_curvi_axis_sub.F
@@ -0,0 +1,161 @@
+	LOGICAL FUNCTION ITSA_MODULO_CURVI_AXIS_SUB ( xfield, yfield,
+     1    slox_dim1, shix_dim1, slox_dim2, shix_dim2, 
+     2    sloy_dim1, shiy_dim1, sloy_dim2, shiy_dim2, dim1_or_2	)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       support routine for ITSA_MODULO_CURVI_AXIS
+*       
+*       programmer - jonathan callahan
+*       NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*       V450: 4/97
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+*
+*       ... ---> DISP_SET_UP ---> LOAD_CURVILINEAR
+*               ---> ITSA_MODULO_CURVI_AXIS ---> ITSA_MODULO_CURVI_AXIS_SUB
+*       
+*       This function checks to see if an an axis is modulo after it has been
+*       transformed by the 'curvilinear' transformations.  Curvilinear transformations
+*       are invoked by giving Ferret a 3-argument SHADE, or FILL command.
+*
+*       For an axis to be modulo, in curvilinear coordinates, it must be
+*       modulo in normal coordinates AND the transformation must leave the page
+*       position of the first point on the axis 'very near' the page position
+*       of the last point on the axis.
+*
+*       Every (x,y) pair (eg. (Lon,Lat)) in the range of data is transformed to
+*       a new page position by the curvilinear transofmation.  The transformed
+*       page positions (in user coordinates) are stored in the 'xfield' and 
+*       'yfield' 2D arrays.  The 'slox_' and 'sloy_' values are used to dimension
+*       the arrays.  'dim1_or_2' has a value of 1 or 2 and specifies which page
+*       dimension we are looking at.
+*
+*       To determine 'very near' we will use the 'wwx~' and 'wwy~' values
+*       stored in xcurvilinear.cmn.  These contain the X- and Y-axis maximum and minimum
+*       page positions (in user coordinates).
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include 'xcurvilinear.cmn'  
+
+*       calling argument declarations:
+c *kob* 8/97 had to move the continuation marker to col 5 - it was in col 8
+c       this bombed aix compiler, though it seems to work on others
+	INTEGER slox_dim1, shix_dim1, slox_dim2, shix_dim2, 
+     1    sloy_dim1, shiy_dim1, sloy_dim2, shiy_dim2, dim1_or_2
+	REAL    xfield( slox_dim1:shix_dim1, slox_dim2:shix_dim2 ),
+     1    yfield( sloy_dim1:shiy_dim1, sloy_dim2:shiy_dim2 )
+
+*       internal variable declarations:
+	INTEGER	i, imax, number_of_x_cells, number_of_y_cells
+	REAL page_width, page_height, minimum_width, minimum_height
+
+*       --- end of introductory code ---
+
+	ITSA_MODULO_CURVI_AXIS_SUB = .TRUE.
+
+*       The number of cells better be the same whether I calculate it from
+*       the X or from the Y dimensioning
+
+	number_of_x_cells = shix_dim1 - slox_dim1
+	number_of_y_cells = shix_dim2 - slox_dim2
+
+
+*       An **arbitrary** definition of whats 'very close'
+
+	minimum_width = (wwxmax - wwxmin) / sqrt(real(number_of_x_cells))
+	minimum_height = (wwymax - wwymin) / sqrt(real(number_of_y_cells))
+
+
+*       Now check the horizontal distance between the first and last X indices
+
+*       When dim1 is modulo:
+	IF (dim1_or_2 .EQ. 1) THEN
+
+	   DO 100 i = xpos_loss_dim2, xpos_hiss_dim2
+	      IF ( ( xfield(xpos_hiss_dim1,i) - xfield(xpos_loss_dim1,i) ) 
+     .               .GT. minimum_width ) THEN
+		 ITSA_MODULO_CURVI_AXIS_SUB = .FALSE.
+		 RETURN
+	      ENDIF
+ 100	   CONTINUE
+
+*       When dim2 is modulo:
+	ELSE
+
+	   DO 200 i = xpos_loss_dim1, xpos_hiss_dim1
+	      IF ( ( xfield(i,xpos_hiss_dim2) - xfield(i,xpos_loss_dim2) ) 
+     .                    .GT. minimum_width ) THEN
+		 ITSA_MODULO_CURVI_AXIS_SUB = .FALSE.
+		 RETURN
+	      ENDIF
+ 200	   CONTINUE
+
+	ENDIF
+
+
+
+*       Now check the vertical distance between the first and last Y indices
+
+*       When dim1 is modulo:
+	IF (dim1_or_2 .EQ. 1) THEN
+
+	   DO 300 i = ypos_loss_dim2, ypos_hiss_dim2
+	      IF ( ( yfield(ypos_hiss_dim1,i) - yfield(ypos_loss_dim1,i) ) 
+     .                  .GT. minimum_height ) THEN
+		 ITSA_MODULO_CURVI_AXIS_SUB = .FALSE.
+		 RETURN
+	      ENDIF
+ 300	   CONTINUE
+
+*       When dim2 is modulo:
+	ELSE
+
+	   DO 400 i = ypos_loss_dim1, ypos_hiss_dim1
+	      IF ( ( yfield(i,ypos_hiss_dim2) - yfield(i,ypos_loss_dim2) ) 
+     .                   .GT. minimum_height ) THEN
+		 ITSA_MODULO_CURVI_AXIS_SUB = .FALSE.
+		 RETURN
+	      ENDIF
+ 400	   CONTINUE
+
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/plt/key_loc.F b/fer/plt/key_loc.F
new file mode 100644
index 0000000..4233393
--- /dev/null
+++ b/fer/plt/key_loc.F
@@ -0,0 +1,136 @@
+	SUBROUTINE KEY_LOC( overlay, xpos, ypos, xsize, ysize,
+     .			    lab_ht, style, justify, string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find a location, size and style in which to put the next key
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  1/2/90
+* v552 *acm* 3/03 multi-line strings in key labels.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin to plot_setup.parm,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale or textscale.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'plot_setup.parm'
+	include	'xplot_setup.cmn'
+	include 'axis_inc.decl'		! axis lengths
+	include 'AXIS.INC'		! axis lengths
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'labels_inc.decl'
+        include 'LABELS.INC'            ! multi-line string
+
+* calling argument declarations
+	LOGICAL overlay
+	INTEGER	style, justify
+	REAL	xpos, ypos, xsize, ysize, lab_ht
+        CHARACTER*(*) string
+
+* internal variable declarations
+	INTEGER	colmn, numlines
+	REAL dylen
+
+	dylen = ylen
+
+* See if the label has more than one line
+
+        CALL tm_break_lines (string, lnbeg, lnend, numlines)
+
+	IF ( overlay ) THEN
+
+* is there room for this overlay label at the lower left ?
+* test the location of the last line of this key label
+
+	   ysize = dflt_ovkey_yspace*pplscale
+c	   ypos  = ovkey_yorigin - novkeys_on*ovkey_yspace
+	   ypos  = dflt_ovkey_yorigin*pplscale - 
+     .             (novkeys_on+numlines-1)*dflt_ovkey_yspace*pplscale
+	   IF ( ABS(ypos).GT.yorg .AND. novkeys_ll.EQ.0 ) THEN
+	      ovkey_ll_full = .TRUE.
+	      novkeys_ll = novkeys_on
+	   ENDIF
+
+* actual y position
+	   ypos  = dflt_ovkey_yorigin*pplscale - 
+     .             novkeys_on*dflt_ovkey_yspace*pplscale
+
+	   IF ( ovkey_ll_full ) THEN
+* ... no - try to put the label within the plot rectangle at the left
+	      xsize  = dflt_ovkey_xspace*pplscale * 0.8
+	      xpos   = 0.1*pplscale
+	      lab_ht = dflt_ovkey_labht*textscale  * 0.8
+	      ysize  = dflt_ovkey_yspace*pplscale * 0.8
+	      ypos   = 0.1*pplscale + 
+     .               (numlines-1+novkeys_on-novkeys_ll) *
+     .                 dflt_ovkey_yspace*pplscale * 0.8
+	      IF (ABS(ypos+lab_ht) .GT. dylen ) xpos = -999.	! off screen
+	   ELSE
+* ... yes - it will fit at the lower left
+	      xsize  = dflt_ovkey_xspace*pplscale
+	      xpos   = dflt_ovkey_xorigin*pplscale
+	      lab_ht = dflt_ovkey_labht*textscale
+	   ENDIF
+	   novkeys_on = novkeys_on + numlines
+
+	ELSE
+* locate a regular (non-overlay) key below the axis
+	   xsize = key_xsize
+	   ysize = key_ysize
+	   lab_ht = key_labht
+	   colmn = MOD( nkeys_on,key_ncolmn )	! from 0 to n-1
+	   xpos = dflt_key_xorigin*pplscale + colmn*key_xspace
+	   ypos = dflt_key_yorigin*pplscale - INT(nkeys_on/key_ncolmn)*key_yspace
+	   nkeys_on = nkeys_on + numlines
+	ENDIF
+
+* style and justify aren't really used in FERRET version 2.00
+	style   = ppl_sidebyside
+	justify = ppl_left_just	
+
+	RETURN
+	END
diff --git a/fer/plt/key_string.F b/fer/plt/key_string.F
new file mode 100644
index 0000000..ae99e4c
--- /dev/null
+++ b/fer/plt/key_string.F
@@ -0,0 +1,148 @@
+	CHARACTER*(*) FUNCTION KEY_STRING( cx, flags, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* generate a string that describes the given context using the flags as
+* guidelines for what limits, transformations, etc. to document
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200: 1/2/89
+* V230:  11/4/92 - expanded variable name length
+* V420:	 9/25/95 - comments appropriate to dynamic grids
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars and VAR_TITLE to 128
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars and name to 256 (ds_name)
+* V67  *acm* 3/11- fix ticket 1821
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685+ *acm* 12/13 For 6D Ferret, the array coming in as flags is longer for extra dimensions
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+
+* calling argument declarations
+	LOGICAL	flags(0:12)
+	INTEGER	cx, slen
+
+* local variable declarations:
+	LOGICAL		save_by_ss
+	INTEGER		TM_LENSTR1, idim, maxlen, plen, categ, var, dset
+	CHARACTER 	ALG_TRANS_CODE*3, ARG_STRING*12, VAR_CODE*128,
+     .			VAR_TITLE*128, CX_DIM_STR*40, REGRID_COMMENTS*64,
+     .			prefix*1, dim_name*1, name*256
+
+* local parameter declarations:
+	LOGICAL		full_prec
+	PARAMETER     ( full_prec = .TRUE. )
+
+* initialize
+	var     = cx_variable( cx )
+	categ   = cx_category( cx )
+	dset    = cx_data_set( cx )
+	prefix = '['
+	maxlen = LEN( KEY_STRING )
+
+* begin with the code for this variable	
+	KEY_STRING = VAR_CODE( categ, var )
+	IF ( INDEX(KEY_STRING,'#') .GT. 0 ) KEY_STRING = VAR_TITLE ( cx )
+	IF ( INDEX(KEY_STRING,'(C') .GT. 0 .AND. INDEX(KEY_STRING,',V') .GT. 0) 
+     .                                KEY_STRING = VAR_TITLE ( cx )
+	slen = TM_LENSTR1( KEY_STRING )
+
+* document the data set
+	IF ( flags(pdoc_dset) .AND. cx_data_set(cx).NE.pdset_irrelevant ) THEN
+	   name = ds_name( cx_data_set(cx) )
+	   plen = TM_LENSTR1(name)
+	   KEY_STRING = KEY_STRING(:slen)//prefix//'D='//name(:plen)
+	   slen = MIN( maxlen, slen+plen+3 )
+	   prefix = ','
+	ENDIF	   
+
+* document any regridding
+* (as of FERRET v2.00 the flag for this is ignored)
+	IF ( cx_unstand_grid(cx) ) THEN
+	   KEY_STRING = KEY_STRING(:slen)//prefix//'G='//
+     .			REGRID_COMMENTS(cx, plen)
+	   slen = MIN( maxlen, slen+3+plen )
+	   prefix = ','
+	ENDIF
+
+* document each axis (and it's transformation) that's requested
+	DO 100 idim = 1, nferdims
+* ... all keys in world coordinates
+	   save_by_ss = cx_by_ss( idim, cx )
+	   cx_by_ss( idim, cx ) = .FALSE.
+	   IF ( flags(idim)
+     .    .AND. cx_lo_ww(idim,cx) .NE. unspecified_val8
+     .    .AND. cx_lo_ww(idim,cx) .NE. unspec_val8_2	) THEN
+	      KEY_STRING = KEY_STRING(:slen)//prefix//
+     .				CX_DIM_STR(idim,cx,':',full_prec,plen)
+	      slen = MIN( maxlen, slen+plen+1 )
+	      prefix = ','
+	   ELSEIF ( flags(idim+pdoc_offset_xform)
+     .    .AND. cx_trans(idim,cx) .NE. trans_no_transform
+     .    .AND. cx_trans(idim,cx) .NE. unspecified_int4 ) THEN
+	      IF ( cx_by_ss( idim, cx ) ) THEN
+	         dim_name = ss_dim_name( idim )
+	      ELSE
+	         dim_name = ww_dim_name( idim )
+	      ENDIF
+	      KEY_STRING = KEY_STRING(:slen)//prefix//dim_name//'=@'//
+     .				ALG_TRANS_CODE( cx_trans( idim, cx )) //
+     .				ARG_STRING( cx_trans_arg( idim, cx ))
+	      slen = TM_LENSTR1( KEY_STRING )
+	      prefix = ','
+	   ENDIF
+* ... restore " by subscript" info
+	   cx_by_ss( idim, cx ) = save_by_ss
+ 100	CONTINUE
+
+* clean up
+	IF ( prefix .EQ. ',' ) THEN
+	   KEY_STRING = KEY_STRING(:slen)//']'
+	   slen = MIN( maxlen, slen+1 )
+	ENDIF
+	IF ( slen .EQ. maxlen ) KEY_STRING(slen:slen) = '*'
+
+	RETURN
+	END
diff --git a/fer/plt/line_plot_labels.F b/fer/plt/line_plot_labels.F
new file mode 100644
index 0000000..859ffa2
--- /dev/null
+++ b/fer/plt/line_plot_labels.F
@@ -0,0 +1,341 @@
+	SUBROUTINE LINE_PLOT_LABELS (var1, nmv, ndv, cx_list, 
+     .		this_no_range, overlay, versus, nokey, time_axis, 
+     .		tstyle, cal_id_1, ribbon_var, indep_lab, dep_lab, 
+     .		ind_min, dep_len, hlen)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Put titles on line plots. For multi-line or ribbon plots, add labels
+* for multi-lines as a key, or a "colored by var2" label for the ribbon color variable
+*
+* Pulled out of plot_set_up.F 
+* 8/12 ACM 
+* V6.83 *acm* 11/30/2012 Need AXIS.INC for the axis lengths, xlen, ylen
+* PyFr *kms*  7/13 Scale default lettering sizes by textscale
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xplot_setup.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'axis_inc.decl'    ! with axis lengths 
+	include 'AXIS.INC'         ! with axis lengths   
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	LOGICAL this_no_range(*), overlay, versus, nokey, time_axis
+	INTEGER var1, nmv, ndv, cx_list(*), cal_id_1, ribbon_var, 
+     .		indep_lab, dep_lab
+	REAL	dep_len, hlen
+	REAL*8  ind_min
+	CHARACTER*(*) tstyle
+
+* internal variable declarations:
+	LOGICAL user_title
+	INTEGER	TM_LENSTR1, TM_UNIT_ID, ipl, nline_in_mem, slen, slen1, 
+     .		status, ptitl, style, justify, iunits, istart
+	
+	CHARACTER*2040	FULL_VAR_TITLE,  KEY_STRING, plot_title, plot_title_1
+	CHARACTER	VAR_UNITS*64, SECS_TO_DATE*20, year*4, buff1*16
+	REAL		xkeypos, ykeypos, xkeysize, ykeysize, 
+     .			lab_ht, labsize
+
+	ptitl = qual_given( slash_title )
+	user_title = ptitl .GT. 0
+
+* * * * * * *    - - - TITLES - - -   * * * * * * * * *
+* if we are starting from a blank screen titling information is centered
+* below the X axis - either a title for a single variable or keys for multiple
+* if we are overlaying on an existing plot put the new variable name on as a
+* key at the lower left
+
+	IF (ribbon_plot) GOTO 1000
+
+
+* * * * * * *    - - - TITLES - - -   * * * * * * * * *
+* if we are starting from a blank screen titling information is centered
+* below the X axis - either a title for a single variable or keys for multiple
+* if we are overlaying on an existing plot put the new variable name on as a
+* key at the lower left
+	nline_in_mem = 0
+	IF ( overlay ) THEN
+	   DO 500 ipl = var1, nmv
+	      nline_in_mem = nline_in_mem + 1
+	      CALL OV_GRP_CX_DOC( cx_list(ipl), 1, cx_xtra_doc )
+	      IF ( user_title ) THEN
+	         CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                  plot_title, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         slen = TM_LENSTR1( plot_title )
+	      ELSE
+	         plot_title = KEY_STRING( cx_list(ipl), cx_xtra_doc, slen )
+	      ENDIF
+              IF (this_no_range(ipl) .AND. mode_nodata_lab) THEN
+                 plot_title(slen+1:slen+14) = ' No Valid Data'
+                 slen = slen + 14
+              ENDIF
+              IF (.NOT. nokey) THEN
+	         CALL KEY_LOC( overlay, xkeypos, ykeypos, xkeysize, ykeysize,
+     .			    lab_ht, style, justify, plot_title(:slen))
+	         CALL PUT_KEY( nline_in_mem, plot_title(:slen),
+     .			    xkeypos, ykeypos, xkeysize, ykeysize,
+     .			    lab_ht, style, lab_loc_absolute, lab_loc_absolute )
+              ENDIF
+ 500	   CONTINUE
+	ELSE
+* *kob* 1/00 check the variable time_axis before looking at
+*            any time-relevant variables.
+* ... basic position and data set labels 
+*    ... does the year need special documentation? 
+           year = unspecified_name4    ! assume no label needed by default 
+           IF ( time_axis ) THEN 
+*    ... document the year where the axis, itself, doesn't 
+              IF ( tstyle.EQ.'MON' .OR. tstyle.EQ.'DAY' ) THEN 
+                 ppl_buff = SECS_TO_DATE( ind_min, cal_id_1 ) 
+                 year = ppl_buff(8:11) 
+              ENDIF 
+           ENDIF 
+* *ACM* if time axis, then cal_id_1 is set to the calendar.  Label the
+*       plot with the calendar name if there is non-standard calendar
+	   CALL DISP_LABELS( cx_plot, year, cal_id_1 )
+* ... label dependent axis with units (over-written below if /vs)
+	   plot_title = VAR_UNITS( cx_list(var1) )
+	   slen = TM_LENSTR1( plot_title )
+	   CALL BOX_LABEL( dep_lab,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.6*dep_len, dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+* ... keys for the dependent vars, or if one, only then title or axis label
+	   DO 600 ipl = var1, nmv
+	      nline_in_mem = nline_in_mem + 1
+	      IF ( use_keys .AND. (.NOT. nokey) ) THEN
+	         plot_title = KEY_STRING( cx_list(ipl), key_doc, slen )
+	      ELSE
+	         plot_title = FULL_VAR_TITLE( cx_list(ipl), slen )
+	      ENDIF
+              IF (this_no_range(ipl) .AND. mode_nodata_lab) THEN
+                 plot_title(slen+1:slen+14) = ' No Valid Data'
+                 slen = slen + 14
+              ENDIF
+	      IF ( ndv .EQ. 1 .OR. user_title ) THEN
+	         IF ( versus ) THEN     ! ("xlen" changed to "dep_len" 11/92)
+	            CALL BOX_LABEL( dep_lab,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.6*dep_len, dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	         ENDIF
+	         IF ( .NOT.versus .OR. user_title ) THEN 
+	            IF ( user_title ) THEN     ! user over-ride of title
+	               CALL EQUAL_STR_LC
+     .			( cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                    plot_title, status )
+                       IF ( status .NE. ferr_ok ) GOTO 5000
+	               slen = TM_LENSTR1( plot_title )
+	            ENDIF
+	            CALL BOX_LABEL( ppl_title,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.75*hlen, dflt_letsize_title*textscale,
+     .			   dflt_letsize_title*textscale, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	         ENDIF
+	      ELSE
+                 IF (.NOT. nokey) THEN
+	            CALL KEY_LOC( overlay, xkeypos, ykeypos, xkeysize, ykeysize,
+     .			       lab_ht, style, justify, plot_title(:slen) )
+	            CALL PUT_KEY( nline_in_mem, plot_title(:slen),
+     .			       xkeypos, ykeypos, xkeysize, ykeysize,
+     .			       lab_ht, style,
+     .			       lab_loc_absolute, lab_loc_absolute )
+	         ENDIF
+	      ENDIF
+
+ 600	   CONTINUE
+
+           IF (versus) THEN
+	      plot_title = FULL_VAR_TITLE( cx_list(1), slen )
+              slen = TM_LENSTR1( plot_title )
+              CALL BOX_LABEL( indep_lab,
+     .                     plot_title(:slen),
+     .                     0.0, 0.0, 0.6*hlen, dflt_letsize_label*textscale,
+     .                     dflt_letsize_label*textscale, ppl_centered,
+     .                     lab_loc_absolute, lab_loc_absolute )
+           ENDIF
+
+
+	ENDIF  ! overlay
+	
+	GOTO 5000  ! done
+
+
+* Labels for ribbon plots.
+ 1000	CONTINUE
+
+	nline_in_mem = 0
+	IF ( overlay ) THEN
+	   DO 1500 ipl = var1, nmv
+	      nline_in_mem = nline_in_mem + 1
+	      CALL OV_GRP_CX_DOC( cx_list(ipl), 1, cx_xtra_doc )
+	      IF ( user_title ) THEN
+	         CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                  plot_title, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         slen = TM_LENSTR1( plot_title )
+	      ELSE
+	         plot_title = KEY_STRING( cx_list(ipl), cx_xtra_doc, slen )
+	      ENDIF
+              IF (this_no_range(ipl) .AND. mode_nodata_lab) THEN
+                 plot_title(slen+1:slen+14) = ' No Valid Data'
+                 slen = slen + 14
+              ENDIF
+              IF (.NOT. nokey) THEN
+	         CALL KEY_LOC( overlay, xkeypos, ykeypos, xkeysize, ykeysize,
+     .			    lab_ht, style, justify, plot_title(:slen))
+	         CALL PUT_KEY( nline_in_mem, plot_title(:slen),
+     .			    xkeypos, ykeypos, xkeysize, ykeysize,
+     .			    lab_ht, style, lab_loc_absolute, lab_loc_absolute )
+              ENDIF
+ 1500	   CONTINUE
+
+	ELSE ! Not overlay
+
+* *kob* 1/00 check the variable time_axis before looking at
+*            any time-relevant variables.
+* ... basic position and data set labels 
+*    ... does the year need special documentation? 
+
+	   year = unspecified_name4    ! assume no label needed by default 
+	   IF ( time_axis ) THEN 
+*    ... document the year where the axis, itself, doesn't 
+	      IF ( tstyle.EQ.'MON' .OR. tstyle.EQ.'DAY' ) THEN 
+                 ppl_buff = SECS_TO_DATE( ind_min, cal_id_1 ) 
+                 year = ppl_buff(8:11) 
+	      ENDIF 
+	   ENDIF 
+
+* *ACM* if time axis, then cal_id_1 is set to the calendar.  Label the
+*       plot with the calendar name if there is non-standard calendar
+
+	   CALL DISP_LABELS( cx_plot, year, cal_id_1 )
+
+* ... label dependent axis with units (over-written below if /vs)
+
+	   plot_title = VAR_UNITS( cx_list(var1) )
+
+	   slen = TM_LENSTR1( plot_title )
+	   buff1 = VAR_UNITS(cx_list(2))  ! ? was cx_y
+	   iunits = TM_UNIT_ID(buff1)
+	   IF (iunits .NE. 4) THEN
+	      CALL BOX_LABEL( dep_lab,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.6*dep_len, dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	   ENDIF
+
+	   IF (versus .AND. ribbon_plot) THEN
+	      plot_title = FULL_VAR_TITLE( cx_list(var1), slen )
+	      slen = TM_LENSTR1( plot_title )
+	      CALL BOX_LABEL( dep_lab,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.6*dep_len, dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	   ENDIF
+
+* ... keys for the dependent vars, or if one, only then title or axis label
+! ribbon_plot
+
+	   istart = var1
+	   IF (versus .AND. ribbon_plot) istart = 1
+
+	   DO 1600 ipl = istart, var1+1
+	      IF (ipl .EQ. var1 .AND. (versus .AND. ribbon_plot)) GOTO 1600     
+	      nline_in_mem = nline_in_mem + 1
+	      IF ( use_keys .AND. (.NOT. nokey) ) THEN
+	         plot_title = KEY_STRING( cx_list(ipl), key_doc, slen )
+	      ELSE
+	         plot_title = FULL_VAR_TITLE( cx_list(ipl), slen )
+	      ENDIF
+              IF (this_no_range(ipl) .AND. mode_nodata_lab) THEN
+                 plot_title(slen+1:slen+14) = ' No Valid Data'
+                 slen = slen + 14
+              ENDIF
+	         
+              labsize = dflt_letsize_title*textscale
+              IF (ipl.EQ.ribbon_var) THEN
+	         IF (versus) THEN
+                    slen1 = TM_LENSTR1( plot_title_1 )
+		    CALL BOX_LABEL( indep_lab,
+     .                     plot_title_1(:slen1),
+     .                     0.0, 0.0, 0.75*hlen, dflt_letsize_label*textscale,
+     .                     dflt_letsize_label*textscale, ppl_centered,
+     .                     lab_loc_absolute, lab_loc_absolute )
+		    plot_title = 'Colored by '//plot_title(1:slen)
+                 ELSE
+		    slen1 = TM_LENSTR1( plot_title_1 )
+                    plot_title = plot_title_1(1:slen1)//
+     .			'<NL>Colored by '//plot_title(1:slen)
+                 ENDIF
+
+                 IF ( user_title ) THEN     ! user over-ride of title
+                    CALL EQUAL_STR_LC
+     .			 ( cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                    plot_title, status )
+                    IF ( status .NE. ferr_ok ) GOTO 5000
+                    labsize = dflt_letsize_title*textscale
+	         ENDIF
+              ENDIF
+
+              slen = TM_LENSTR1( plot_title )
+              CALL BOX_LABEL( ppl_title,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.75*hlen, dflt_letsize_title*textscale,
+     .			   labsize, ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+
+              plot_title_1 = plot_title ! ribbon plot: combine with color-by label
+ 1600	   CONTINUE
+
+	ENDIF ! overlay
+
+
+ 5000	RETURN
+	END
diff --git a/fer/plt/line_style.F b/fer/plt/line_style.F
new file mode 100644
index 0000000..f527b53
--- /dev/null
+++ b/fer/plt/line_style.F
@@ -0,0 +1,227 @@
+	SUBROUTINE LINE_STYLE( symbol, sym_size, color, color1,
+     .			       use_line, do_dash, dashstyle,
+     .			       line_number, so_far )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* In Ferret the concept of the PLOT+ PEN command is generalized to combine
+* line type (dashing), color and symbol into this single call
+* Line number ipen will always be associated with line style ipen.
+* Prior to this call colors and line types have already been combined via GKS
+* bundles to define 6 distinct line styles as bundle indices 1-6
+* Symbols are now added to extend this number to 6x17=102
+* 1/94: number of line bundles is now num_fancy_lines.  All of these are
+* used if /LINES is specified without /SYMBOLS
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  1/2/90
+* 	 2/21/90 - changed line style order so all dash patterns are used for
+*		   each symbol choice, then the next symbol ...
+* 	 5/18/90 - added args symbol and color to force styling of lines
+* Unix/RISC port - 10/91 - /symb"/noline" -> successive line w/ new symbol
+* V230:  7/23/92 - when /LINE_STYLE is given /SYMBOLS must default to OFF
+* V301:  1/27/94 - when /LINE_STYLE is given w/out /SYMBOL use num_fancy_lines
+* V510 *sh* 3/00 - added args use_line and sym_size to suport PLOT/COLOR=/SIZE=
+* V530 *acm 5/01 - added args do_dash and dashstyle for 
+*		   PLOT/DASH[=(dn1,up1,dn2,up2)]
+* V580 *acm*11/04  Allow thickness to be set when cycling through colors automatically.
+*                  When color = -11  then thin line, color=-21 then thick=2, when 
+*                  color=-31 then thick=3
+* V590 *acm* 5/06  settable number of line colors, no longer hard-wired to 6 colors.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* v683 *acm* 11/12 Put sym_so_far into common - previously SAVEd here, no longer working.
+* V6.85 *acm* 9/13 New PLOT/COLOR w/o argument for all-color line plot
+
+	include 'tmap_dims.parm'
+	include	'slash.parm'
+	include	'plot_setup.parm'
+	include	'xplot_setup.cmn'
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+	include 'xprog_state.cmn'
+        include 'ppl_dash_save.cmn'
+
+* calling argument declarations
+	LOGICAL use_line
+	INTEGER symbol, color, color1, line_number, so_far, do_dash
+	REAL	sym_size, dashstyle(*)
+
+* internal variable declarations
+        LOGICAL unique_symbol, symbol_only1, select_lines
+	INTEGER	style, ppl_draw_line, i, ltyp
+
+* internal parameter declarations
+	INTEGER	num_line, ncolors, num_linebundles
+
+* internal variable declarations
+	INTEGER	ityp, imrk, style0, sym(num_sym)
+        LOGICAL setdash
+	DATA	sym/1,3,17,19,21,23,25,27,29,31,33,35,39,41,43,47,51/
+
+* initialize
+
+* num_plain colors was in common as 6, now use line_colors from mode setting
+* Use num_linebundles in place of hardwired num_fancy_lines
+
+        ncolors = mode_arg(pmode_linecolors,1)
+        num_linebundles = 3 * ncolors
+        num_line = ncolors*num_sym
+
+        IF ( so_far .EQ. 1 ) sym_so_far = 0      ! first line on screen
+* ... each line needs a new symbol for /SYMBOL or /LINE=n/SYMBOL
+        unique_symbol = ( symbol.EQ.qual_on
+     .             .AND. .NOT.use_line )
+        symbol_only1  = symbol.GT.0 .AND. .NOT.use_line
+	select_lines = symbol.EQ.qual_off .AND. use_line
+
+* respond to qualifiers that force actions
+	IF ( use_line ) THEN
+	   ppl_draw_line = 1	! draw the line by default
+	ELSE
+	   ppl_draw_line = 3	! PPL LINE command: mark points only
+	ENDIF
+	IF ( symbol .EQ. qual_on ) THEN
+* ... bypass plain lines
+	   style = so_far + ncolors
+	ELSE
+	   style = so_far		! default: no qualifiers
+	ENDIF
+
+* select line type and symbols
+        IF ( unique_symbol .OR. symbol_only1 ) THEN 
+           IF (color.GT.0) THEN
+	      ityp = color		! turn on symbol color 3/00
+	   ELSE
+	      ityp = 1
+	   ENDIF
+           imrk = MOD(sym_so_far,num_sym) + 1
+           sym_so_far = sym_so_far + 1
+	ELSEIF ( select_lines .AND. style .LE. num_linebundles ) THEN  ! 1/94
+	   ityp = style
+	   imrk = 0
+	ELSEIF ( style .LE. ncolors ) THEN
+	   ityp = style
+	   imrk = 0
+	ELSEIF ( style .LE. num_line ) THEN
+	   style0 = (style-ncolors) - 1
+	   ityp  = MOD(style0,ncolors) + 1
+	   imrk  = MOD(style0/ncolors,num_sym) + 1
+           sym_so_far = MAX( sym_so_far, imrk )    ! ... *sh* 10/91
+	ELSE
+	   ityp = 1
+	   imrk = 0
+	ENDIF	   
+* replace selections with forced values if supplied
+	IF ( symbol    .GT. 0 ) THEN
+	  imrk = symbol
+	ELSEIF ( symbol .EQ. qual_off ) THEN
+          imrk = 0                       ! 7/92
+	ELSEIF ( imrk .NE. 0 ) THEN
+	  imrk = sym(imrk)
+	ENDIF
+	IF ( color .GT. 0 ) THEN
+           ityp = color
+           ltyp = color
+        ELSE
+           IF (color .EQ. -21) THEN
+              ltyp = ityp + ncolors
+           ELSE IF (color .EQ. -31) THEN
+              ltyp = ityp + ncolors*2
+           ELSE
+              ltyp = ityp
+           ENDIF
+	   ltyp = ltyp  + color1 - 1
+
+        ENDIF
+
+	WRITE ( ppl_buff, 3000 ) line_number, ltyp
+ 3000	FORMAT('PEN ',2I4)
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+
+	IF ( imrk .GT. 0 ) THEN
+* ... "LINE 8 3 1" - symbol number 3 on line 8
+	   WRITE ( ppl_buff, 3100 ) line_number, imrk, ppl_draw_line
+ 3100	   FORMAT ('LINE ',3I4)
+	ELSE
+* ... "LINE 4 1 0" - no symbols on line 4
+	   WRITE ( ppl_buff, 3200 ) line_number
+ 3200	   FORMAT ('LINE ',I4,' 1 0')
+	ENDIF
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	IF ( imrk .GT. 0 ) THEN
+* ... "MARKH 8 0.08" - symbol size 0.08 on line 8
+	   WRITE ( ppl_buff, 3300 ) line_number, sym_size
+ 3300	   FORMAT ('MARKH ',I4,F8.3)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	ENDIF
+
+*  User-requested dash overrides automatic selections
+        dash_changed(line_number) = .FALSE.
+        linenum_save = 0
+        IF (do_dash .EQ. 1) THEN
+	   ityp = 4
+
+           dash_changed(line_number) = .TRUE.
+           dashsave(line_number,1) = dn1(line_number)
+           dashsave(line_number,2) = up1(line_number)
+           dashsave(line_number,3) = dn2(line_number)
+           dashsave(line_number,4) = up2(line_number)
+           linenum_save = line_number
+
+* communicate this to PLOT+
+           setdash = .FALSE.
+           DO 100 i = 1, 4
+              IF (dashstyle(i) .NE. 0.) setdash = .TRUE.
+  100	   CONTINUE
+           IF (setdash) THEN
+              WRITE (ppl_buff, 3400) line_number, ityp, (dashstyle(i),i=1,4)
+ 3400         FORMAT ('LINE ', I4, ' 0 ', I4, ' 0 0 ',4F7.3)
+           ELSE 
+              WRITE (ppl_buff, 3500) line_number, ityp
+ 3500         FORMAT ('LINE ', I4, ' 0 ', I4)
+           ENDIF
+
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+        ENDIF
+
+
+	RETURN
+	END
+
diff --git a/fer/plt/load_curvilinear.F b/fer/plt/load_curvilinear.F
new file mode 100644
index 0000000..761f9f8
--- /dev/null
+++ b/fer/plt/load_curvilinear.F
@@ -0,0 +1,237 @@
+	 SUBROUTINE LOAD_CURVILINEAR( xpos, ypos, dim1, dim2, argx_pos,
+     .				     edges_ok, mr_xpos, mr_ypos,
+     .				     cx_xpos, cx_ypos, cx_val, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* save the dimensioning information about the X position and Y position
+* arrays so these arrays will be accessible from inside of PLOT+ routines.
+* A C subroutine will be used to cache the pointers to these 2 arrays.
+* COMMON will be used to store the size/shape information.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 3/97
+* V541:  2/02 *sh - allow for subspan modulo axes
+* V612: 7/08 *acm*  Fix bug 1589; see if the units of the coordinates are degrees
+*                   and set a flag.
+* V63   9/09 *acm* Fix bug 1688: curvlinear plots when the curv. coords are NOT
+*                  longitude and latitude.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14  Ticket 2147: Need double-precision bad-values for coordinate variables 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xtext_info.cmn'
+	include 'xcurvilinear.cmn'
+
+* calling argument declarations:
+	LOGICAL	edges_ok
+	REAL	xpos(*), ypos(*)
+	INTEGER	argx_pos, dim1, dim2,
+     .		mr_xpos, mr_ypos, cx_xpos, cx_ypos, cx_val, status
+
+* internal variable declarations:
+	LOGICAL ITSA_MODULO_AXIS, ITSA_MODULO_CURVI_AXIS, TM_HAS_STRING,
+     .		xspan_n_dim1, xspan_n_dim2,
+     .		yspan_n_dim1, yspan_n_dim2,
+     .		xspan_np1_dim1, xspan_np1_dim2,
+     .		yspan_np1_dim1, yspan_np1_dim2
+
+	INTEGER	CAXIS_MODLEN, STR_SAME,
+     .		dim, x1span, x2span, y1span, y2span,
+     .          span_dim1, span_dim2, i1, i2, i3
+	CHARACTER*1	fieldname
+	CHARACTER*64	VAR_UNITS, xcoord_units
+
+* missing value flags
+	badx = mr_bad_data(mr_xpos)
+	bady = mr_bad_data(mr_ypos)
+	badxcurv = mr_bad_data(mr_xpos)
+	badycurv = mr_bad_data(mr_ypos)
+
+* subscript limits
+	minss_dim1 = cx_lo_ss(cx_val,dim1)
+	maxss_dim1 = cx_hi_ss(cx_val,dim1)
+	minss_dim2 = cx_lo_ss(cx_val,dim2)
+	maxss_dim2 = cx_hi_ss(cx_val,dim2)
+
+* subscript ranges to be used for dimensioning the arguments
+	xpos_loss_dim1 = mr_lo_ss(mr_xpos,dim1)
+	xpos_hiss_dim1 = mr_hi_ss(mr_xpos,dim1)
+	xpos_loss_dim2 = mr_lo_ss(mr_xpos,dim2)
+	xpos_hiss_dim2 = mr_hi_ss(mr_xpos,dim2)
+	ypos_loss_dim1 = mr_lo_ss(mr_ypos,dim1)
+	ypos_hiss_dim1 = mr_hi_ss(mr_ypos,dim1)
+	ypos_loss_dim2 = mr_lo_ss(mr_ypos,dim2)
+	ypos_hiss_dim2 = mr_hi_ss(mr_ypos,dim2)
+
+* offsets for start indices relative to the "values" argument indices
+	xpos_off0_dim1 = cx_lo_ss(cx_xpos,dim1) - cx_lo_ss(cx_val,dim1)
+	xpos_off0_dim2 = cx_lo_ss(cx_xpos,dim2) - cx_lo_ss(cx_val,dim2)
+	ypos_off0_dim1 = cx_lo_ss(cx_ypos,dim1) - cx_lo_ss(cx_val,dim1)
+	ypos_off0_dim2 = cx_lo_ss(cx_ypos,dim2) - cx_lo_ss(cx_val,dim2)
+
+* determine which axes are represented as only a single point
+* and which have N+1 points
+	span_dim1 = cx_hi_ss(cx_val,dim1) - cx_lo_ss(cx_val,dim1) + 1
+	span_dim2 = cx_hi_ss(cx_val,dim2) - cx_lo_ss(cx_val,dim2) + 1
+
+	x1span  = cx_hi_ss(cx_xpos,dim1) - cx_lo_ss(cx_xpos,dim1) + 1
+	x2span  = cx_hi_ss(cx_xpos,dim2) - cx_lo_ss(cx_xpos,dim2) + 1
+	y1span  = cx_hi_ss(cx_ypos,dim1) - cx_lo_ss(cx_ypos,dim1) + 1
+	y2span  = cx_hi_ss(cx_ypos,dim2) - cx_lo_ss(cx_ypos,dim2) + 1
+
+	xspan_1_dim1   = x1span .EQ. 1
+	xspan_1_dim2   = x2span .EQ. 1
+	yspan_1_dim1   = y1span .EQ. 1
+	yspan_1_dim2   = y2span .EQ. 1
+
+	xspan_n_dim1 = x1span .EQ. span_dim1
+	xspan_n_dim2 = x2span .EQ. span_dim2
+	yspan_n_dim1 = y1span .EQ. span_dim1
+	yspan_n_dim2 = y2span .EQ. span_dim2
+
+	xspan_np1_dim1 = .NOT.(xspan_1_dim1 .OR. xspan_n_dim1)
+	xspan_np1_dim2 = .NOT.(xspan_1_dim2 .OR. xspan_n_dim2)
+	yspan_np1_dim1 = .NOT.(yspan_1_dim1 .OR. yspan_n_dim1)
+	yspan_np1_dim2 = .NOT.(yspan_1_dim2 .OR. yspan_n_dim2)
+
+* check for mismatched array sizes
+* ... only sizes of 1, N, or N+1 are allowed
+	IF (xspan_np1_dim1) THEN
+	   IF (x1span .NE. span_dim1+1) THEN
+	      dim = dim1
+	      fieldname = 'X'
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+	IF (yspan_np1_dim1) THEN
+	   IF (y1span .NE. span_dim1+1) THEN
+	      dim = dim1
+	      fieldname = 'Y'
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+	IF (xspan_np1_dim2) THEN
+	   IF (x2span .NE. span_dim2+1) THEN
+	      dim = dim2
+	      fieldname = 'X'
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+	IF (yspan_np1_dim2) THEN
+	   IF (y2span .NE. span_dim2+1) THEN
+	      dim = dim2
+	      fieldname = 'Y'
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+* ... cannot mix size of N+1 with size of N 
+	IF (xspan_np1_dim1 .AND. yspan_n_dim1
+     . .OR. yspan_np1_dim1 .AND. xspan_n_dim1
+     . .OR. xspan_np1_dim2 .AND. yspan_n_dim2
+     . .OR. yspan_np1_dim2 .AND. xspan_n_dim2) GOTO 5200
+
+* have we been given grid box edges or grid points? 
+	dim1_edges = xspan_np1_dim1 .OR. yspan_np1_dim1
+	dim2_edges = xspan_np1_dim2 .OR. yspan_np1_dim2
+	IF (.NOT.edges_ok) THEN
+	   dim = dim1
+	   IF (dim1_edges) GOTO 5300
+	   dim = dim2
+	   IF (dim2_edges) GOTO 5300
+	ENDIF
+
+
+* Have we been given modulo-able fields
+* ... Both fields must agree that a dimension is modulo in order to honor it
+* ... A dimension of length 1 (delta=0) is automatically modulo
+	dim1_modulo = ITSA_MODULO_AXIS(cx_val,dim1)
+	IF ( dim1_modulo ) THEN
+	   dim1_modulo = (xspan_1_dim1
+     .		     .OR. x1span .EQ. CAXIS_MODLEN(dim1,cx_xpos))
+     .		.AND.
+     .		         (yspan_1_dim1
+     .		     .OR. y1span .EQ. CAXIS_MODLEN(dim1,cx_ypos))
+     .		.AND.
+     .		         ITSA_MODULO_CURVI_AXIS(xpos,ypos,mr_xpos,mr_ypos,1,
+     .		             dim1, dim2)
+	ENDIF
+
+	dim2_modulo = ITSA_MODULO_AXIS(cx_val,dim2)
+	IF ( dim2_modulo ) THEN
+	   dim2_modulo = (xspan_1_dim2
+     .		     .OR. x2span .EQ. CAXIS_MODLEN(dim2,cx_xpos))
+     .		.AND.
+     .		         (yspan_1_dim2
+     .		     .OR. y2span .EQ. CAXIS_MODLEN(dim2,cx_ypos))
+     .		.AND.
+     .		         ITSA_MODULO_CURVI_AXIS(xpos,ypos,mr_xpos,mr_ypos,2,
+     .		             dim1, dim2)
+	ENDIF
+
+* See what the units of the curvi coordinate fields are. Set a flag if the
+* x coordinates are degrees.
+
+        units_degrees = .FALSE.
+        xcoord_units = VAR_UNITS (cx_xpos)
+        IF  (TM_HAS_STRING(xcoord_units,'lon') .OR.
+     .       TM_HAS_STRING(xcoord_units,'deg') ) 
+     .       units_degrees = .TRUE.
+
+* save the memory pointers to the arrays, themselves
+	CALL SAVE_ARG_POINTERS( xpos, ypos )
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		ww_dim_name(dim)//' axis of '//fieldname
+     .		//' position array', *5000 )
+ 5200	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		ww_dim_name(dim)//' axis of X and Y'
+     .		//' position arrays', *5000 )
+ 5300	CALL ERRMSG( ferr_inconsist_plane, status,
+     .		'box edges (on '//ww_dim_name(dim)//' axis)'//pCR//
+     .		 'allowed only with SHADE', *5000 )
+
+	END
diff --git a/fer/plt/merged_whoi_date.F b/fer/plt/merged_whoi_date.F
new file mode 100644
index 0000000..cbcd544
--- /dev/null
+++ b/fer/plt/merged_whoi_date.F
@@ -0,0 +1,102 @@
+	CHARACTER*14 FUNCTION MERGED_WHOI_DATE( cx_list, idim, ncx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form YYMMDDHHMMSSCC (internal ordering) based
+* on the earlies time to be plotted from the given contexts
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/27/95 - 4-digit YEARS!!
+* V530:  1/01 *acm* cal_id for alternative calendar axis types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis.
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	ncx, cx_list(ncx), idim
+
+* internal variable declarations
+	INTEGER 	yr100, yr, mon, day, hr, mn, sec,
+     .			status, i, grid, cx, axis
+        INTEGER		TM_GET_CALENDAR_ID, cal_id
+	CHARACTER*20	TM_SECS_TO_DATE, date
+	REAL*8		TSTEP_TO_SECS, bcsecs
+
+* internal parameter declarations
+	REAL*8		yrofsecs
+	PARAMETER     ( yrofsecs = 60.*60.*24.*365. )
+
+* determne the earliest date to be plotted
+	DO 100 i = 1, ncx
+	   cx = cx_list(i)
+	   grid = cx_grid(cx)
+	   IF ( i .EQ. 1 ) THEN
+	      bcsecs = TSTEP_TO_SECS( grid, idim, cx_lo_ww(idim,cx) )
+	   ELSE
+	      bcsecs = MIN( bcsecs,
+     .		       TSTEP_TO_SECS( grid, idim, cx_lo_ww(idim,cx) ) )
+	   ENDIF
+
+* Convert to date
+          axis = grid_line ( idim, grid)
+          cal_id = TM_GET_CALENDAR_ID(line_cal_name(axis) )
+
+* arbitrarily subtract a year -- needed cuz PLOT* rounds down the "tmin" value
+ 	  bcsecs = MAX( 0.0D0, bcsecs - yrofsecs )
+	  date = TM_SECS_TO_DATE(bcsecs, cal_id)
+
+ 100	CONTINUE
+
+* break the date string into component integer values
+	CALL TM_BREAK_DATE( date, cal_id, 
+     .                      yr, mon, day, hr, mn, sec, status )
+	yr100 = yr/100		! 1980 --> 19
+	yr = yr - (yr100*100)	! 1982 --> 82
+
+* assemble the pieces in WHOI format
+	WRITE (MERGED_WHOI_DATE,3000) yr,mon,day,hr,mn,sec,yr100
+ 3000	FORMAT (7I2.2)
+
+	RETURN
+	END
diff --git a/fer/plt/parse_color_tuple.F b/fer/plt/parse_color_tuple.F
new file mode 100644
index 0000000..2a49187
--- /dev/null
+++ b/fer/plt/parse_color_tuple.F
@@ -0,0 +1,119 @@
+       SUBROUTINE PARSE_COLOR_TUPLE(strng, red_frac, grn_frac, 
+     .                              blue_frac, opaq_frac, istat)
+
+* NOTE: red_frac, grn_frac, blue_frac, and opaq_frac are explicit REAL*4
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administrations (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Parse a color string given as (R,G,B) or (R,G,B,A), where R, G, B,
+* and A are integer values in [0,100].  Return the color fractions 
+* (values in [0.0,1.0]).
+*
+
+        IMPLICIT NONE
+
+* calling argument declarations
+        CHARACTER*(*) strng
+        REAL*4 red_frac, grn_frac, blue_frac, opaq_frac
+        INTEGER istat
+
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'xrisc_buff.cmn'
+
+* function declarations
+        INTEGER TM_LENSTR1
+
+* internal variable declarations
+        INTEGER maxlen, nstart, nend
+
+* initialize
+        IF ( strng(1:1) .NE. '(' ) GOTO 5100
+        maxlen = INDEX(strng, ')')
+        IF ( maxlen .LT. 7 ) GOTO 5100
+
+*       Percent red
+        nstart = 2
+        nend = INDEX(strng(nstart:maxlen), ',')
+        IF ( nend .LT. 2 ) GOTO 5100
+        nend = nstart + nend - 2
+        READ( strng(nstart:nend), *, ERR=5100 ) red_frac
+        IF ((red_frac .LT. 0.0).OR.(red_frac .GT. 100.0)) GOTO 5100
+        red_frac = red_frac / 100.0
+
+*       Percent green
+        nstart = nend + 2
+        nend = INDEX(strng(nstart:maxlen), ',')
+        IF ( nend .LT. 2 ) GOTO 5100
+        nend = nstart + nend - 2
+        READ( strng(nstart:nend), *, ERR=5100 ) grn_frac
+        IF ((grn_frac .LT. 0.0).OR.(grn_frac .GT. 100.0)) GOTO 5100
+        grn_frac = grn_frac / 100.0
+
+*       Percent blue
+        nstart = nend + 2
+        nend = INDEX(strng(nstart:maxlen), ',')
+        IF ( nend .LT. 2 ) THEN
+*          Opacity not given; default to 100 percent
+           opaq_frac = 1.0
+           nend = maxlen - 1
+        ELSE
+           nend = nstart + nend - 2
+        ENDIF
+        READ( strng(nstart:nend), *, ERR=5100 ) blue_frac
+        IF ((blue_frac .LT. 0.0).OR.(blue_frac .GT. 100.0)) GOTO 5100
+        blue_frac = blue_frac / 100.0
+
+*       Percent opacity, if given
+        nstart = nend + 2
+        IF ( nstart .LT. maxlen ) THEN
+           nend = maxlen - 1
+           READ( strng(nstart:nend), *, ERR=5100 ) opaq_frac
+           IF ((opaq_frac .LT. 0.0).OR.(opaq_frac .GT. 100.0)) GOTO 5100
+           opaq_frac = opaq_frac / 100.0
+        ENDIF
+
+* success
+        istat = ferr_ok
+ 5000   RETURN
+
+* syntax error
+ 5100   risc_buff = strng
+        CALL ERRMSG(ferr_out_of_range, istat, 
+     .              risc_buff(:TM_LENSTR1(risc_buff))
+     .              //pCR//'Format is (R,G,B) or (R,G,B,A),'//
+     .              'where R,G,B,A are integer values 0-100',
+     .              *5000)
+
+        END
+
diff --git a/fer/plt/plot_set_up.F b/fer/plt/plot_set_up.F
new file mode 100644
index 0000000..6a11a15
--- /dev/null
+++ b/fer/plt/plot_set_up.F
@@ -0,0 +1,942 @@
+      SUBROUTINE PLOT_SET_UP( memory,
+     .				overlay, transpz, versus, no_labels,
+     .				symbol, sym_size, color, color1, use_line,
+     .				step_inc, do_dash, dashstyle,
+     .                          is_logx, is_logy, nokey,
+     .				all_1_dep, only_val, mv_list, cx_list, 
+     .				nmv, indep_dat, dep_dat, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up for line plot by loading data and title and defining axis formats
+* (the routine is confusing as a result of simultaneously coping with the needs
+* of single variables, multiple variables, /VS, /TRANSPOSE and /OVERLAY)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/8/87  - based on DISP_SET_UP rev 1.1
+* revision 0.1 - 7/21/87 - added transpose option and AXIS_ENDS
+* revision 0.2 - 8/26/87 - added TAXIS ON for time axis plots
+* revision 0.3 - 2/29/88 - allowed for non-geometric axes, time axis formats,
+*			   non-inverted Z data,
+*			   and check to keep PLOT+ from screwing up when data 
+*			   are all a single value
+* revision 0.4 - 4/12/88 - added do_labels argument for "/NOLABELS" option
+*			   and units labeled on dependent axis
+* revision 0.5 - 4/28/88 - force-scale axes if data is all 1 value
+* revision 0.6 -  9/8/88 - added relative flags to PUT_LABEL calls
+* revision 1.0 - 9/23/88 - allow lines of different lengths - bypass time axis
+*			   limits as computed by PPLLDX because of bugs in that
+*			   code.  Move /no_labels to PUT_LABEL.
+*			 - put "year" label on if time axis doesn't
+* V200:  5/19/89 - reordered lo/hi_ss arguments
+*         1/8/89 - major rewrite using keys
+*	  5/8/90 - allow PLOT/VS to overlay 2D fields
+*		 - PLOT/VS needn't be given a line - it can be a higher dim reg.
+*		 - improved error message for plot not of a line
+*	 5/17/90 - aded PLOT/SYMBOL and PLOT/LINE
+*  Unix/RISC port 3/91 *sh* : bug: TSTEP_TO_SECS requires REAL*8 arg
+*                 8/23/91 ; bug when time axis is normal cannot find dt_min
+* V230:   6/8/92 - corrected bug when line_t0 and line_units may be undefined
+*        6/12/92 - trap PLOT+ nsize limitation before passing data
+*        6/26/92 - time_axis variable not properly init'ed for /vs plot
+*        11/4/92 - expanded variable name length
+*                - corrected small bug in size of dependent axis label
+*       11/27/92 - symptomatic bug fix of mis-scaled TAXIS0 (hours) axis
+*                - see err230_ppl_taxis.jnl
+* V300: 3/11/93  - allow free-er overlay of plot on top of 2D display
+* V301:	10/22/93 - added /XLIMITS and /YLIMITS  (variables dep_min &_max
+*		   commandeered as not really used earlier)
+*	 11/3/93 - added /TITLE
+*	  1/7/94 - screen bad data flag on independent axis only for /VS
+* V320: 5/94 - array "memory" as a calling argument
+* 	9/94: restrict to 99% of NSIZE buffer - kludge fix to PLOT+ bug
+*       12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420: 11/27/95 - 4-digit PLOT+ YEARS!!
+*	11/28/95 - changes to TAXIS_STYLE to support y-oriented calendar axes
+*	 3/26/96 - number of expressions to be merged was incorrect in call to
+*			MERGE_WHOI_CONTEXT
+* V450: 3/97 - modified AXIS_FORMAT args for curvilinear coordinate plots
+* V500 *kob* 3/99- up VAR_CODE  and VAR_UNITS to 64 chars
+*       4/99 - *jd* Ensure PPL knows plot is overlay: set SOVER flag here
+*       6/99 - *sh* added logic to permit a PLOT/VS over a time series plot
+* V510 10/99 - *sh* plot/i=1:10 i/0 is not an error -- scale axis to -1:1
+*       1/00 - *kob* - check the variable time_axis before looking at
+*                      any time-relevant variables.
+*       3/00 - *sh* added use_line and sym_size args for PLOT/COLOR=/SIZE=
+*	     - pass no_labels to AXIS_FORMAT 
+*	5/00 - added /HLIMITS and /VLIMITS (denigrating /xlimits/ylimits)
+* V521	7/00 - *sh* bug fix to /TRANS/VLIMITS=... 
+*	7/00 - *sh* new argument range_rqd needed on EQUAL_RANGE
+* V530 *sh* 1/01 - change "denigrated" to "deprecated"
+* V530 *ACM* 1/01  cal_id for alternative calendar axes.
+*      *sh* 1/01 - added argument step_inc for PLOT/STEP
+*	         - bug fix: PLOT+ mem limit check off by x2 --  X&Y components
+*      *acm* 5/01 - added  PLOT/DASH  (do_dash, dashstyle)
+*      *acm* 5/01 - correct STEP bug: send NLOAD rather than NPTS2 to PPLLDX 
+* V533 *acm* 6/01 - for LOG plots add logicals is_logx, is_logy.  set to plot
+*                   log of depth as inverse axis
+* V533 *acm* 9/01 - changes for dynamic pplus buffer.  Rename NSIZE to pplmem_nsize.
+*                   call PPLLDX via pplldx_envelope.c which checks pplmem_nsize 
+*                   and allocates more memory if needed.
+*      *acm* 10/01  remove VMS includes
+* V552 *acm*  3/03  Send the key string to key_loc since it may be multi-line
+*                   also, make strings longer
+* V580 *acm*11/04  Allow thickness to be set when cycling through colors automatically.
+*                  In call to line_style, when color = -11  then thin line, color=-21 
+*                  then thick=2, when color=-31 then thick=3
+* V580 *acm*11/04  For /VS plots turn on lon/lat axis formatting, if lon/lat units
+*                  (as in polygon_set_up).
+* V580 *acm* 12/04 Fix bug 1129; formatting axis for small lon/lat ranges:
+*                  send delta to routine AXIS_FORMAT
+* V580 *acm* 10/05 Fix for bug 1349, longitude/latitude axis formatting. Need 
+*                  to set the format to use as well as the label.
+* V610 *acm*  2/08 Fix bug 1560. In the lon/lat axis formatting, check whether 
+*                  the unit is longitude or latitude. PLOT/VS plots may have 
+*                  either one of these on either axis.
+* V612 *acm*  7/08 Prev. fix was that variables with units of "degrees_e" and 
+*                  "degrees_n" get longitude/latitude units on a PLOT/VS plot. 
+*                  Also allow units of "longitude" or "latitude" to trigger 
+*                  lon/lat labels.
+* V612 *acm*  8/08 Fixing bug 1038. No Valid Data labeled as on 2D plots. If 
+*                  there is no valid data, send that information back, so a
+*                  label can be added to the plot. If this is an overlay, add
+*                  No Valid Data to the label.
+* V614  *acm* 10/08 - add new MODE NODATA_LAB to control the NO VALID DATA label.
+*                  Put it on plots only when this mode is set.
+* V62   *acm*  2/09 Fix bug 1636, on PLOT/VS when setting up dependent axis,
+*                  need to reinitialize delta=unspecified_val8 so that delta is
+*                  computed from the dependent data.
+* V662 *acm*  5/10 Set AX_VERT or AX_HORIZ symbol with the direction of the independent axis: X, Y, Z, T" plot_set_up.F
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret: Add E and F dimensions 
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+* PyFr *kms*  7/13 Scale default lettering sizes by textscale
+* V6.85 *acm* 9/13 New PLOT/COLOR w/o argument for all-color line plot
+* V685+ *acm  12/13 In dependent axis setup, make sure variable the_taxis is set.
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xplot_setup.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xtext_info.cmn'
+        include 'axis_inc.decl'    ! with axis lengths
+        include 'AXIS.INC'         ! with axis lengths	
+	include 'PPLDAT.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+
+* calling argument declarations:
+	LOGICAL		overlay, transpz, versus, no_labels, use_line,
+     .			is_logx, is_logy, nokey, all_1_dep
+	INTEGER		symbol, color, color1, step_inc, do_dash,
+     .			nmv, mv_list( nmv ), cx_list( nmv ), status
+	REAL		memory( mem_blk_size, max_mem_blks ), sym_size,
+     .                  dashstyle(*), only_val
+	REAL		indep_dat(*), dep_dat(*)     ! dynamic space allocation
+ 
+* V500 *kob* 3/99- up VAR_CODE and VAR_UNITS to 64 chars
+* internal variable declarations:
+	LOGICAL		NO_LINE_RANGE, GEOG_LABEL, TM_HAS_STRING,
+     .                  flip, time_axis,
+     .			all_1_ind, formatted,
+     .			indep_is_log, dep_is_log, use_nice,
+     .                  this_no_range(50), set_axis
+	CHARACTER*2040	FULL_VAR_TITLE,  KEY_STRING, plot_title
+	CHARACTER	INTERNAL_WHOI_DATE*14, VAR_UNITS*64,
+     .			SECS_TO_DATE*20, LEFINT*8, MERGED_WHOI_DATE*14, 
+     .			LEFT_REAL*16, TM_GET_CALENDAR_NAME*32, 
+     .			indep_ax*1, dep_ax*1, tstyle*3,
+     .			buff1*16, buff2*16, buff3*8, t1_date*14, tref*14,
+     .                  cal_name*32, cal_name_new*32, val_buff*32, fmt*4
+
+	INTEGER		TM_LENSTR1, CX_DIM_LEN, CGRID_SIZE, CGRID_AXIS,
+     .			mv, cx, slen, ito, indep_lab, dep_lab, nline_in_mem,
+     .			indep_dim, npts, dep_dim, npts2, ndv, var1,
+     .			grid, grid1, ipl, ndim, dims(6),
+     .			slen2, slen3, tax, plot_mem_used, nload, i,
+     .			pxlim, pylim, phlim, pvlim,pindeplim, pdeplim,
+     .			dep_axtyp, indep_axtyp, the_taxis, ribbon_var, 
+     .			junits, iaxis
+
+	INTEGER         TM_GET_CALENDAR_ID, cal_id_1, cal_id_2,
+     .			cal_id_old, cal_id_new
+        INTEGER         TM_UNIT_ID, cx_x , cx_y, iunits
+	CHARACTER*1     axdir(6), ax1
+
+	REAL		val1, dt_min, lo, hi, dep_len, 
+     .			ind_len, first, last, hlen
+	REAL*8		TSTEP_TO_SECS, SECS_TO_TSTEP,
+     .			ind_min, ind_max, dep_min, dep_max, delta, tmp
+
+* local parameter declarations:
+	LOGICAL		main, norm_labs, pnot_curv, range_rqd
+	PARAMETER     ( main = .TRUE.,
+     .			norm_labs = .FALSE.,
+     .			pnot_curv = .FALSE.,
+     .			range_rqd = .TRUE. )
+	DATA axdir / 'X', 'Y', 'Z', 'T', 'E', 'F' /
+
+* signal that plot set-up has begun
+	IF ( mode_diagnostic ) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .				'setting up plot', 15)
+
+* initialize
+!	dep_max = arbitrary_small_val8
+!	dep_min = arbitrary_large_val8
+	ind_max = arbitrary_small_val8
+	ind_min = arbitrary_large_val8
+	cx   = cx_list( 1 )
+	mv   = mv_list( 1 )
+	grid1 = cx_grid( cx )
+	indep_dim = plot_axis(1)
+	nline_in_mem = 0
+	phlim = qual_given( slash_hlimits )
+	pvlim = qual_given( slash_vlimits )
+	pxlim = qual_given( slash_xlimits )	! deprecated
+	pylim = qual_given( slash_ylimits )	! deprecated
+	cal_id_1 = 0
+	cal_id_2 = 0
+	cal_name = ' '
+	dep_axtyp = 1
+	indep_axtyp = 1
+	mod_vs_x = .FALSE.
+	mod_vs_y = .FALSE.
+        cx_x = cx_list(1)
+
+* determine PLOT+ memory required
+        plot_mem_used = 0
+        DO 10 ipl = 1, nmv
+ 10     plot_mem_used = plot_mem_used
+     .		      + 2*step_inc*CGRID_SIZE( cx_list(ipl) )
+c        IF ( plot_mem_used .GT. 0.999*pplmem_nsize ) GOTO 5150  ! test is now in
+                                                                ! pplldx_envelope
+
+* check for improper data supplied
+	IF ( versus ) THEN
+	   IF ( num_uvars_in_cmnd .LT. 2 ) GOTO 5100
+	ELSEIF ( overlay ) THEN
+	   CALL GET_CX_DIMS( cx, ndim, dims )
+           IF ( twodee_on ) indep_dim = dims(1)       ! 3/93
+	   IF ( ndim.NE.1 .OR. dims(1).NE.indep_dim ) GOTO 5120
+	ELSE
+	   ndim = nplot_axis
+	   IF ( ndim .GT. 1 ) GOTO 5110
+	ENDIF
+
+* length of plot array
+	IF ( versus ) THEN
+	   npts = CGRID_SIZE( cx )	! (redundantly calc'd below) 5/90
+	ELSE
+	   npts = CX_DIM_LEN ( indep_dim, cx )
+	ENDIF
+
+* set flag indicating a 1D plot is on the screen
+	IF (.NOT.overlay) onedee_on = .TRUE.
+
+	IF (ribbon_plot) THEN
+	   ribbon_var = 3
+	   IF (.NOT.versus) ribbon_var = 2
+	ENDIF
+
+* decide if the picture should be rotated 90 degrees
+	IF ( .NOT.versus .AND. indep_dim .EQ. z_dim  ) THEN
+* ... flip depth plots by default
+	   flip = .NOT.transpz
+	ELSE
+	   flip = transpz
+	ENDIF
+	IF ( flip ) THEN
+	   dep_ax    = 'X'
+	   indep_ax  = 'Y'
+	   dep_lab   = ppl_xlab
+	   indep_lab = ppl_ylab
+	   dep_len   = xlen
+	   ind_len   = ylen
+	   indep_is_log = is_logy
+           dep_is_log   = is_logx
+
+	   IF ( pxlim.GT.0 ) THEN
+	      pindeplim = pxlim
+	   ELSE
+	      pindeplim = pvlim
+	   ENDIF 
+	   IF ( pylim.GT.0 ) THEN
+	      pdeplim = pylim
+	   ELSE
+	      pdeplim = phlim
+	   ENDIF 
+	ELSE
+	   dep_ax    = 'Y'
+	   indep_ax  = 'X'
+	   dep_lab   = ppl_ylab
+	   indep_lab = ppl_xlab
+	   ind_len   = xlen
+	   dep_len   = ylen
+	   indep_is_log = is_logx
+           dep_is_log   = is_logy
+	   IF ( pxlim.GT.0 ) THEN
+	      pindeplim = pxlim
+	   ELSE
+	      pindeplim = phlim
+	   ENDIF 
+	   IF ( pylim.GT.0 ) THEN
+	      pdeplim = pylim
+	   ELSE
+	      pdeplim = pvlim
+	   ENDIF 
+	ENDIF
+
+* * * * * * *    - - - INDEPENDENT AXIS DATA - - - * * * * * * * * *
+	IF ( versus ) THEN
+	   time_axis =	.FALSE.
+	   CALL EXTRACT_LINE ( cx,
+     .			    memory( 1, mr_blk1(mv) ),
+     .			    mv,
+     .			    indep_dat,
+     .			    indep_dim,
+     .			    ndim,
+     .			    npts,
+     .			    status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   var1 = 2	! since first var is independent axis
+	   ndv  = nmv - 1	! # of dependent variables
+	   IF ( use_keys .AND. (.NOT. nokey)) THEN
+	      plot_title = KEY_STRING( cx_list(1), key_doc, slen )
+	   ELSE
+	      plot_title = FULL_VAR_TITLE( cx_list(1), slen )
+	   ENDIF
+* ... label the independent axis as the first var given
+	   IF ( .NOT.no_labels ) THEN
+	      buff1 = VAR_UNITS(cx_x)
+	      iunits = TM_UNIT_ID(buff1)
+	      IF (iunits .NE. 4) 
+     .           CALL BOX_LABEL( indep_lab,
+     .			   plot_title(:slen),
+     .			   0.0, 0.0, 0.6*ind_len, 
+     .                     dflt_letsize_label*textscale,
+     .			   dflt_letsize_label*textscale, 
+     .                     ppl_centered,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	   ENDIF
+* ... force axis scaling if the data has no range
+	   all_1_ind = NO_LINE_RANGE( indep_dat,npts,mr_bad_data(mv),val1 )
+	   delta = unspecified_val8
+
+	   IF ( pindeplim .GT. 0 ) THEN
+	      IF ( pxlim.GT.0 .AND. .NOT.denig_xylim_msg_done ) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+* Get calendar name for equal_range (even if not time axis)
+	      tax = grid_line(f_dim,cx_grid(cx_list(var1)) )
+              IF (tax .EQ. 0) tax = grid_line(t_dim,cx_grid(cx_list(var1)) )
+              cal_name = line_cal_name(tax)
+              cal_id_1 = TM_GET_CALENDAR_ID ( cal_name )
+	      CALL EQUAL_RANGE(
+     .			cmnd_buff(qual_start(pindeplim):qual_end(pindeplim)),
+     .			indep_dim, ind_min, ind_max, delta,
+     .			formatted, range_rqd, cal_id_1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ELSEIF ( all_1_ind .AND. .NOT.overlay ) THEN
+	      IF ( val1 .EQ. mr_bad_data(mv) ) THEN
+	         ind_min = 0.D0
+	         ind_max = 1.D0
+	      ELSE
+	         ind_min = val1 - 1.
+	         ind_max = val1 + 1.
+	      ENDIF
+	   ELSE
+	      CALL MINMAX( indep_dat, npts, mr_bad_data(mv), lo, hi )
+	      ind_min = DBLE( lo )
+	      ind_max = DBLE( hi )
+	   ENDIF
+
+* Set up modulo longitude handling if /vs and variable has units
+* of longitude
+
+	   cx_x = cx_list(1)	 
+	   cx_y = cx_list(2)
+	   buff1 = VAR_UNITS(cx_x)
+	   iunits = TM_UNIT_ID(buff1)
+	   IF (iunits .EQ. 4) THEN
+	      mod_vs_x = (TM_HAS_STRING(buff1, '_e') .OR.
+     .                   TM_HAS_STRING(buff1, 'lon') )
+	         
+	   ENDIF
+
+	   buff1 = VAR_UNITS(cx_y)	 
+	   junits = TM_UNIT_ID(buff1)
+	   IF (junits .EQ. 4) THEN
+               mod_vs_y = (TM_HAS_STRING(buff1, '_e') .OR.
+     .                     TM_HAS_STRING(buff1, 'lon') ) 
+	   ENDIF
+
+	   IF (.NOT.overlay) THEN
+	      CALL AXIS_ENDS(indep_ax,indep_dim,grid1,ind_min,ind_max,
+     .                       delta, indep_is_log, indep_axtyp, status)
+	      IF ( status .NE. ferr_ok ) THEN
+                 first = ind_min
+                 last  = ind_max
+                 GOTO 5170
+              ENDIF
+
+              IF (iunits .EQ. 4) THEN
+                 CALL GET_AXIS_FORMAT( ind_min, ind_max, delta, 
+     .                  fmt, use_nice )
+                 IF (use_nice) THEN
+                    IF (mod_vs_x) THEN
+                       ppl_buff = 'XFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                  ',''''LONE'''')'
+                    ELSE
+                       ppl_buff = 'XFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                  ',''''LAT'''')'
+                    ENDIF
+                    CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+                 ENDIF
+              ELSE	 
+                 CALL PPLCMD ( from, line, 0, 'XFOR 0', 1, 1 )	 
+              ENDIF	 
+		  
+              IF (junits .EQ. 4) THEN
+                 CALL GET_AXIS_FORMAT( ind_min, ind_max, delta, 
+     .                  fmt, use_nice )
+                 IF (use_nice) THEN
+                    IF (mod_vs_y) THEN
+                       ppl_buff = 'YFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                  ',''''LONE'''')'
+                    ELSE
+                       ppl_buff = 'YFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                  ',''''LAT'''')'
+                    ENDIF
+                    CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+                 ENDIF
+              ELSE	 
+                 CALL PPLCMD ( from, line, 0, 'YFOR 0', 1, 1 )	 
+              ENDIF	 
+           ELSE
+              CALL PPLCMD ( from, line, 0, indep_ax//'FOR 0', 1, 1 )
+	   ENDIF
+
+	ELSE	! (not VERSUS)
+	   var1 = 1
+	   ndv  = nmv
+	   ito  = 0
+	   time_axis =	indep_dim.EQ.t_dim .OR. indep_dim.EQ.f_dim
+	   IF ( time_axis ) THEN	! 11/95: are ALL vars time vars?
+
+	      the_taxis = indep_dim
+
+* and are all the calendar types the same?
+
+              tax = grid_line(the_taxis,cx_grid(cx_list(var1)) )
+              cal_name = line_cal_name(tax)
+              cal_id_1 = TM_GET_CALENDAR_ID ( cal_name )
+
+	      DO 100 ipl = var1, nmv
+	         time_axis = time_axis
+     .			.AND. GEOG_LABEL( the_taxis, cx_grid(cx_list(ipl)) )
+                 tax = grid_line(the_taxis,cx_grid(cx_list(ipl)) )
+                 cal_id_2 = TM_GET_CALENDAR_ID ( line_cal_name(tax) )
+                 IF (cal_id_2 .NE. cal_id_1) THEN
+                    cal_id_old = cal_id_1
+                    cal_id_new = cal_id_2
+                    GO TO 5160
+                 ENDIF
+ 100	      CONTINUE
+
+	   ENDIF
+
+* ... (PLOT+ needs TAXIS,ON prior to PPLLDX calls)
+* ... PPLLDX computes axis endpoints if TIME is set to auto (no args given)
+
+	   IF ( time_axis ) THEN
+! *sh* 11/92 added numerical dt_min argument to TAXIS call in PLOT+
+! this fixes err230_ppl_taxis.jnl symptomatically but probably leaves an
+! unresolved scaling problem - especially with multiple time series w/ diff
+! units so that the dt_min argument is not approproate to subsequent lines
+! problem seems to go away if DT=60.0
+	      CALL PPLCMD ( from, line, 0, 'TIME', 1, 1 )
+	      IF ( indep_ax .EQ. 'X' ) THEN
+	         CALL PPLCMD ( from, line, 0, 'TAXIS 60,ON', 1, 1 )
+	      ELSE
+	         CALL PPLCMD ( from, line, 0, 'TAXIS/YAXIS 60,ON', 1, 1 )
+	      ENDIF
+
+	      ppl_buff = ' '
+	      WRITE ( ppl_buff, 3004 ) cal_name
+              CALL PPLCMD (from, line, 0, ppl_buff, 1, 1)
+	   ENDIF
+	ENDIF
+ 3004   FORMAT ('CALENDAR ', A7)
+
+* set up PLOT5 to ignore bad data flag
+	IF ( versus ) THEN               ! 1/94
+	   ppl_buff = ' '
+	   WRITE ( ppl_buff, 3005 ) mr_bad_data( mv ), indep_ax
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1)
+	ENDIF
+ 3005	FORMAT ( 'LIMITS ',G15.8,1X,A1,'EQ' )
+
+* * * * * * *    - - - LOAD DATA - - - * * * * * * * * *
+* 11/95: determine T0 reference time for time axis
+	IF ( time_axis .AND. .NOT.overlay ) THEN
+	   tref = MERGED_WHOI_DATE( cx_list(var1), the_taxis, nmv )
+	ELSE
+	   tref = ' '		! overlays reuse previous tref
+	ENDIF
+
+* loop through all the dependent variables loading them into PPLUS
+
+	all_1_dep = .TRUE.
+	set_axis = .TRUE.
+	only_val  = bad_val4
+	DO 200 ipl = var1, nmv
+	   mv   = mv_list( ipl )
+	   cx   = cx_list( ipl )
+	   grid = cx_grid( cx )
+* set up a dependent variable
+	   CALL EXTRACT_LINE (	cx,
+     .				memory( 1, mr_blk1(mv) ),
+     .				mv,
+     .				dep_dat,
+     .				dep_dim,
+     .				ndim,
+     .				npts2,
+     .				status	)
+           iaxis = CGRID_AXIS(dep_dim,cx)
+	   
+	   IF (.NOT.overlay .AND. (ipl.EQ.var1 .AND. ribbon_plot)) THEN
+	      CALL MINMAX( dep_dat, npts, mr_bad_data(mv), lo, hi )
+	      dep_min = DBLE( lo )
+	      dep_max = DBLE( hi )
+	      delta = unspecified_val8
+	      CALL AXIS_ENDS(dep_ax,dep_dim,grid1,dep_min,dep_max,
+     .                      delta, dep_is_log, dep_axtyp, status)
+           ENDIF
+ 
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+* ... replicate points to create a "step" plot if requested  (1/01)
+	   nload = npts2 * step_inc
+           IF (step_inc .EQ. 2) THEN
+	      DO i = npts2, 1, -1
+	         dep_dat(2*i)   = dep_dat(i)
+	         dep_dat(2*i-1) = dep_dat(i)
+	      END DO
+           ELSEIF (step_inc .EQ. 3) THEN
+	      DO i = npts2, 1, -1
+	         dep_dat(3*i)   = mr_bad_data(mv)
+	         dep_dat(3*i-1) = dep_dat(i)
+	         dep_dat(3*i-2) = dep_dat(i)
+	      END DO
+	   ENDIF
+* set up corresponding independent axis
+* ( note - each variable may have different points on the indep. axis )
+
+	   IF ( versus ) THEN
+* ... number of values must be equal in independ. and depend. for ordered pairs
+	      IF ( npts2 .NE. npts ) GOTO 5130
+
+* Set up the dependent axis.
+
+	      set_axis = .TRUE.
+	      IF (ribbon_plot) set_axis = (ipl .EQ. var1)
+              IF (versus .AND. set_axis .AND. .NOT.overlay) THEN
+ 	         CALL MINMAX( dep_dat, npts, mr_bad_data(mv), lo, hi )
+	         dep_min = DBLE( lo )
+	         dep_max = DBLE( hi )
+                 cx_y = cx_list(2) 	
+                 buff1 = VAR_UNITS(cx_y)
+                 iunits = TM_UNIT_ID(buff1)
+                 IF (iunits .EQ. 4) THEN
+	            delta = unspecified_val8
+	            CALL AXIS_ENDS(dep_ax,dep_dim,grid1,dep_min,dep_max,
+     .                      delta, dep_is_log, dep_axtyp, status)
+
+	            CALL GET_AXIS_FORMAT( dep_min, dep_max, delta, 
+     .                 fmt, use_nice )
+                    IF (use_nice) THEN
+                       IF (TM_HAS_STRING(buff1, '_e') .OR.
+     .                      TM_HAS_STRING(buff1, 'lon') ) THEN
+                           ppl_buff = 'YFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                       ',''''LONE'''')' 
+                       ELSE
+                           ppl_buff = 'YFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .                       ',''''LAT'''')'
+                       ENDIF
+                       CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+                    ENDIF
+                 ENDIF
+              ENDIF
+
+	   ELSE
+* ... in PLOT TEMP , SALT , U all vars must be along same ww dimension
+	      IF ( ndim .GT. 1 ) GOTO 5110
+	      IF ( dep_dim .NE. indep_dim ) GOTO 5140
+	      CALL MAKE_STEP_AXIS( grid, dep_dim, step_inc,
+     .			cx_lo_ss(cx,dep_dim), cx_hi_ss(cx,dep_dim),
+     .			indep_dat )
+	      IF ( time_axis ) THEN
+	         ind_min = MIN( ind_min,
+     .                     TSTEP_TO_SECS(grid, the_taxis, DBLE(indep_dat(1)) ))
+	         ind_max = MAX( ind_max,
+     .                     TSTEP_TO_SECS(grid, the_taxis, DBLE(indep_dat(nload)) ))
+	      ELSE
+	         ind_min = MIN( ind_min, DBLE(indep_dat(1)) )
+	         ind_max = MAX( ind_max, DBLE(indep_dat(nload)) )
+	      ENDIF
+	      all_1_ind = ind_min .EQ. ind_max
+	      IF ( all_1_ind ) THEN
+	         ind_min = ind_min - 1.
+	         ind_max = ind_max + 1.
+	      ENDIF
+	   ENDIF
+
+* Compute the mean and standard dev for ribbon-color variable, 
+* needed for computing color levels. Results stored in PPLUS common.
+
+	   IF (ribbon_plot .AND. ipl.EQ.ribbon_var) THEN
+              CALL COMPUTE_MNSTD (dep_dat, mr_bad_data(mv), .TRUE., npts, status)
+	   ENDIF
+
+* ... check that there is a range of dependent data for PLOT+ auto-scaling
+* ... when all the variables are considered together
+        
+	this_no_range(ipl) = .FALSE.
+        IF (set_axis) this_no_range(ipl) = NO_LINE_RANGE( 
+     .       dep_dat, nload, mr_bad_data(mv), val1 )
+	all_1_dep = all_1_dep .AND. this_no_range(ipl)
+        IF (this_no_range(ipl) .AND. val1.NE.mr_bad_data(mv) )
+     .           this_no_range(ipl) = .FALSE. ! Keep the value for putting NO VALID on labels
+! 10/99	IF ( val1 .EQ. mr_bad_data(mv) ) CALL ERRMSG( ferr_no_range, status,
+!     .		'all data points are bad: '//VAR_CODE(mr_category(mv),
+!     .						      mr_variable(mv) ),*5000)
+	IF ( all_1_dep ) THEN
+	   IF ( only_val .EQ. bad_val4 ) THEN
+	      IF ( val1 .NE. mr_bad_data(mv) ) only_val = val1
+	   ELSE
+	      all_1_dep = all_1_dep .AND. only_val .EQ. val1
+	   ENDIF
+!	ELSE  ! commented out 10/93 - PLOT+ auto scaling used
+!	   CALL MINMAX( dep_dat, npts, mr_bad_data(mv), lo, hi )
+!	   IF ( lo .LT. dep_min ) dep_min = lo
+!	   IF ( hi .GT. dep_max ) dep_max = hi
+	ENDIF
+
+* pass the data to PLOT+
+
+	   WRITE ( ppl_buff, 3005 ) mr_bad_data( mv ), dep_ax
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   IF ( time_axis ) THEN
+              IF ( tax .EQ. mnormal .OR. tax .EQ. munknown ) THEN  ! 8/91 bug
+                 dt_min = 1.0
+              ELSE
+	         dt_min = line_tunit( grid_line(the_taxis,grid) ) / 60.! sec-->min
+
+*  Check for calendar mismatch for time- overlay plots
+	         IF (overlay) THEN
+                    IF (cal_id_1 .NE. saved_calendar_id) THEN
+                       cal_id_old = saved_calendar_id
+                       cal_id_new = cal_id_1
+                       GO TO 5160
+	            ENDIF
+                 ENDIF
+
+              ENDIF
+              t1_date = INTERNAL_WHOI_DATE( grid, the_taxis, 1.0D0 )
+           ELSE
+	      IF (overlay .AND. has_time_axis) THEN
+	         dt_min  = saved_dt_min
+	         t1_date = saved_t1_date
+	      ELSE
+                 dt_min  = 1.0
+                 t1_date = ' '
+	      ENDIF
+           ENDIF
+
+	   IF (overlay) THEN
+	      SOVER = .true.
+	   ELSE
+	      has_time_axis = time_axis
+ 	      IF (has_time_axis) THEN
+	         saved_dt_min  = dt_min		! to re-use on PLOT/VS or POLYGON
+	         saved_t1_date = t1_date
+	         saved_calendar_id = cal_id_1
+	      ENDIF
+	   ENDIF
+
+ ! put colorvar in the right place
+	   IF (ribbon_plot .AND. ipl.EQ.ribbon_var) THEN
+	      flip = .FALSE.
+	      IF (indep_dim .EQ. z_dim) THEN
+	         WRITE ( ppl_buff, 3005 ) mr_bad_data( mv ), indep_ax
+	         CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	      ENDIF
+	   ENDIF
+
+	   IF ( flip ) THEN
+	      CALL PPLLDX_envelope(0,dep_dat,indep_dat,nload,
+     .                             t1_date, tref, dt_min, plot_mem_used)
+	   ELSE
+	      CALL PPLLDX_envelope(0,indep_dat,dep_dat,nload,
+     .                             t1_date, tref, dt_min, plot_mem_used)
+	   ENDIF
+* ... increment number of lines on plot
+	   nline_on     = nline_on     + 1
+	   nline_in_mem = nline_in_mem + 1
+* ... assign line style for the data plotting:
+	   CALL LINE_STYLE(symbol, sym_size, color, color1, use_line,
+     .			   do_dash, dashstyle, nline_in_mem, nline_on)
+ 200	CONTINUE
+        nline_on = nline_on + color1 - 1
+
+* axis scaling and formatting
+* ... independent axis
+	IF ( .NOT.overlay ) THEN
+	   IF ( .NOT. versus ) THEN
+	      delta = unspecified_val8
+	      IF ( pindeplim .GT. 0 ) THEN
+	         IF (pxlim.GT.0 .AND. .NOT.denig_xylim_msg_done) THEN
+	            CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	            CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	            denig_xylim_msg_done = .TRUE.
+	         ENDIF
+	         CALL EQUAL_RANGE(
+     .			cmnd_buff(qual_start(pindeplim):qual_end(pindeplim)),
+     .			indep_dim, ind_min, ind_max, delta,
+     .			formatted, range_rqd, cal_id_1, status )
+	         IF ( status .NE. ferr_OK ) GOTO 5000
+* convert time given in time steps to absolute units	   
+	         IF ( time_axis .AND. .NOT.formatted ) THEN
+* time limits given as tstep range although mode calendar is true
+	            IF ( ind_min .GT. ind_max ) THEN  ! no reversed calendar
+	               tmp = ind_min
+	               ind_min = ind_max
+	               ind_max = tmp
+	            ENDIF
+	            ind_min = TSTEP_TO_SECS( grid1, the_taxis, ind_min )
+	            ind_max = TSTEP_TO_SECS( grid1, the_taxis, ind_max )
+	         ELSEIF ( indep_dim .EQ. the_taxis
+     .		   .AND. .NOT.time_axis
+     .	           .AND.  formatted ) THEN
+* time limits given as dates although mode calendar is false
+	            ind_min = SECS_TO_TSTEP( grid1, the_taxis, ind_min )
+	            ind_max = SECS_TO_TSTEP( grid1, the_taxis, ind_max )
+	         ENDIF
+              ELSE   ! /HLIM or /VLIM not used; check for range in indep direction
+                 IF (nload .EQ. 1) GOTO 5180
+	      ENDIF
+	      IF ( time_axis ) THEN
+	         IF ( pindeplim .GT. 0 ) CALL PPL_TIME( ind_min,ind_max,
+     .                                    cal_id_1)
+	         CALL TAXIS_STYLE( indep_ax, ind_min, ind_max, tstyle )
+* (6/99) Note: The time axis extrema symbols are only approximately correct
+*		since PLOT+ rounds out the time ranges ...
+	         CALL AXIS_END_SYMS( indep_ax,
+     .				SECS_TO_TSTEP( grid1, the_taxis, ind_min ),
+     .				SECS_TO_TSTEP( grid1, the_taxis, ind_max ) )
+	      ELSE
+
+	         CALL AXIS_ENDS  ( indep_ax, indep_dim, grid1,
+     .				   ind_min, ind_max, delta, 
+     .				   indep_is_log, indep_axtyp, status )
+	         IF ( status .NE. ferr_OK ) THEN
+                    first = ind_min
+                    last  = ind_max
+                    GOTO 5170
+                 ENDIF
+
+	         CALL AXIS_FORMAT( indep_ax, indep_dim, grid1,
+     .				   ind_min, ind_max, delta,
+     .				   pnot_curv, 0,
+     .				   time_axis, tstyle, no_labels )
+	      ENDIF
+	   ENDIF
+* ... dependent axis scaling
+*  force axis scaling if the data has no range
+           IF (the_taxis .EQ. 0) the_taxis = dep_dim
+
+	   IF ( pdeplim .GT. 0 ) THEN
+	      IF (pylim.GT.0 .AND. .NOT.denig_xylim_msg_done) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+	      CALL EQUAL_RANGE(
+     .			cmnd_buff(qual_start(pdeplim):qual_end(pdeplim)),
+     .			dep_dim, dep_min, dep_max, delta,
+     .			formatted, range_rqd, cal_id_1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+
+	      CALL AXIS_ENDS( dep_ax, the_taxis, grid, dep_min, dep_max, 
+     .                        delta, dep_is_log, dep_axtyp, status )
+	      IF ( status .NE. ferr_OK ) THEN
+                 first = dep_min
+                 last  = dep_max
+                 GOTO 5170
+              ENDIF
+
+	   ELSEIF ( all_1_dep ) THEN
+	      IF (only_val .EQ. bad_val4) val1 = 0.0	! 10/99
+	      CALL AXIS_ENDS( dep_ax, the_taxis, grid,val1-1.D0,val1+1.D0,1.D0,
+     .                        dep_is_log, dep_axtyp, status )   
+	      IF ( status .NE. ferr_OK ) THEN
+                  first = val1-1.0
+		  last  = val1+1.0
+		  GOTO 5170
+	      ENDIF   
+	   ELSEIF (dep_is_log) THEN	! get dependent var scaling and set up log axis
+	      CALL MINMAX( dep_dat, npts, mr_bad_data(mv), lo, hi )
+	      dep_min = DBLE( lo )
+	      dep_max = DBLE( hi )
+	      CALL AXIS_ENDS( dep_ax, the_taxis, grid, dep_min, dep_max, 
+     .                        delta, dep_is_log, dep_axtyp, status )
+	      IF ( status .NE. ferr_OK ) THEN
+                 first = dep_min
+                 last  = dep_max
+                 GOTO 5170
+              ENDIF
+
+	   ENDIF
+
+*   When not an overlay, set the axis type to log or reverse log
+
+	   IF (dep_is_log  .OR.  indep_is_log) THEN
+	      IF (flip) THEN
+		 WRITE (val_buff, 3006) dep_axtyp, indep_axtyp
+	      ELSE
+ 	         WRITE (val_buff, 3006) indep_axtyp, dep_axtyp
+	      ENDIF
+
+ 3006         FORMAT ('axtype,', I2, ',', I2)
+              CALL PPLCMD ( from, line, 0, val_buff, 1, 1)
+	   ENDIF
+
+	ENDIF
+
+        ax1 = axdir(indep_dim)
+	IF (flip) THEN
+           CALL PPLCMD ( from, line, 0, 'SET AX_VERT '//ax1, 1, 1 )
+	ELSE
+	   CALL PPLCMD ( from, line, 0, 'SET AX_HORIZ '//ax1, 1, 1 )
+        ENDIF
+
+*  TITLES
+* Main plot title. Add labels for multi-lines as a key, 
+* or a "Colored by var2" label for the ribbon color variable
+*
+	hlen = xlen ! single-precision xlen from PPLUS common -> double prec. var
+	IF ( .NOT.no_labels ) 
+     .          CALL LINE_PLOT_LABELS (var1, nmv, ndv, cx_list, 
+     .		this_no_range, overlay, versus, nokey, time_axis, 
+     .		tstyle, cal_id_1, ribbon_var, indep_lab, dep_lab, 
+     .		ind_min, dep_len, hlen)
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	CALL PPLCMD ( from, line, 0, 'NLINES', 1, 1 )	! wipe buffers clean
+	RETURN
+ 5100	CALL ERRMSG( ferr_invalid_command, status, 
+     .		     cmnd_buff(:len_cmnd)//' : vs what ?', *5000 )
+ 5110	dep_ax = LEFINT( ndim, slen )
+	CALL ERRMSG( ferr_dim_underspec, status, 
+     .			'specified data is not a line'//pCR//
+     .			' - its a '//dep_ax(:slen)//'D region: "'//
+     .			cmnd_buff(:len_cmnd)//'"', *5000 )
+ 5120	CALL ERRMSG( ferr_dim_underspec, status, 
+     .			'overlay is on a different axis'//pCR//
+     .			'"'//cmnd_buff(:len_cmnd)//'"', *5000 )
+ 5130	buff1 = LEFINT( npts,  slen  )
+	buff2 = LEFINT( npts2, slen2 )
+	buff3 = LEFINT( ipl, slen3 )
+	CALL ERRMSG( ferr_dim_underspec, status,
+     .		 'unequal line lengths: '//pCR//
+     .		'First expression has '//buff1(:slen)//' points.'//pCR//
+     .		'Expression '//buff3(:slen3)//' has '//buff2(:slen2)//
+     .						' points:'//
+     .		pCR//'"'//cmnd_buff(:len_cmnd)//'"', *5000 )
+
+ 5140	buff3 = LEFINT( ipl, slen3 )
+	CALL ERRMSG( ferr_dim_underspec, status,
+     .		'differing axes: '//pCR//
+     .		'first line is on '//ww_dim_name(indep_dim)//' axis'//pCR//
+     .		'line '//buff3(:slen3)//' is on '//ww_dim_name(dep_dim)//
+     .		' axis', *5000 )
+        
+! 5150	buff3 = LEFINT( INT(0.999*pplmem_nsize), slen3 )
+!	buff2 = LEFINT( plot_mem_used, slen2 )
+!	CALL ERRMSG( ferr_prog_limit, status,
+!     .          'Requested '//buff2(:slen2)//' words to plot'//pCR//
+!     .		'Plot buffer size is: '//buff3(:slen3), *5000 )
+
+ 5160	cal_name = TM_GET_CALENDAR_NAME(cal_id_old)
+        cal_name_new = TM_GET_CALENDAR_NAME(cal_id_new)
+        slen = TM_LENSTR1 (cal_name)
+        slen2 = TM_LENSTR1(cal_name_new)
+	CALL ERRMSG( ferr_inconsist_grid, status,
+     .          'Differing calendar axes: '//pCR//
+     .		'first variable is on '//cal_name(:slen)//
+     .          ' axis'//pCR//
+     .		'subsequent variable is on '//cal_name_new(:slen2)//
+     .		' axis', *5000 )
+
+ 5170	buff1 = LEFT_REAL (first, '(G15.3)', slen)
+	buff2 = LEFT_REAL (last,  '(G15.3)', slen2)
+	CALL ERRMSG( ferr_out_of_range, status,
+     . 'Limits for log axis negative or too small: '//
+     .  buff1(:slen)// ' : '//  buff2(:slen2), *5000 )
+
+
+ 5180	CALL ERRMSG( ferr_limits, status,
+     . 'One-point independent axis: Requires a '//
+     .  '/HLIMIT or /VLIMIT specification', *5000 )
+
+	END
diff --git a/fer/plt/polygon_set_up.F b/fer/plt/polygon_set_up.F
new file mode 100644
index 0000000..73d5ccb
--- /dev/null
+++ b/fer/plt/polygon_set_up.F
@@ -0,0 +1,1208 @@
+	SUBROUTINE POLYGON_SET_UP
+     .			      ( memory,
+     .				overlay, transpz, coord_ax, no_labels,
+     .				no_range, only_val,
+     .				symbol, line_type, use_line,
+     .				is_logx, is_logy, 
+     .				mr_list, cx_list, nmv,
+     .				is_modx,
+     .				do_mod_minus, 
+     .				do_mod_plus,
+     .				add_lon,
+     .				x_dat, y_dat, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Set up for single or multiple polygons to be  ploted by loading data
+* and labels and defining axis formats
+
+* The POLYGON command accepts single and multi-dimensional arguments
+* "1D FORM"
+*	   yes? POLYGON xpoly1D, ypoly1D, values
+*   where if xpoly1D or ypoly1D contain missing values, those represent
+*   the end of one polygon and the start of the next. The length of the values
+*   array must equal the number of polygons
+* in which case the X coordinate might ve visualized as
+*    x1,x1,x1,x1,BAD,x2,x2,x2,BAD,x3,x3,x3,x3,x3,x3,x3,x3,BAD,...
+* where the "1","2","3" refer to the successive polygons
+
+* "2D FORM"
+*	   yes?  POLYGON xpoly2D, ypoly2D, values
+*   where values must be 1-dimensional and its axis must match in size and
+*   orientation one of the axes from the 2D arrays. The other axis of the
+*   2D coordinates is the axis of the coordinates within each polygon
+* in which case the X coordinate might ve visualized as
+*    x1,x1,x1,x1,BAD,BAD,...
+*    x2,x2,x2,BAD,BAD,...
+*    x3,x3,x3,x3,x3,x3,x3,x3,BAD,BAD,...
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500: 2/99 - based on plot_set_up.F
+*       3/99 - *jd* mods to complete the command
+* V500: 3/99 *kob* - upped VAR_UNITS from 32 to 64 chars
+*       5/99 *kob* - minor mod to remove improper comment line linux compiler
+*                    didn't like
+*       6/99 - *jd* fix bug in 2 var form where x_dat(1) is reassigned
+* V510: *sh* 3/00 - trap if number of polygons is too large 
+*		  - new arg use_line for change in arguments to LINE_STYLE
+*	5/00 - added /HLIMITS and /VLIMITS (denigrating /xlimits/ylimits)
+* V510: *sh* 7/00 - added arg to EQUAL_RANGE 
+* V530 *sh* 1/01 - change "denigrated" to "deprecated"
+*	    1/01 - remove makep setting so segments are not pre-activated
+* V530 *ACM* 1/03  cal_id for alternative calendar axes.
+* V530 *ACM* 5/09  add arguments (unused here) to line_style call. 
+* V533 *acm* 6/01 - for LOG plots add logicals is_logx, is_logy.  set to plot
+*                   log of depth as inverse axis
+* V533 *acm* 9/01 - changes for dynamic pplus buffer.  Rename NSIZE to pplmem_nsize.
+*                   call PPLLDX via pplldx_envelope.c which checks pplmem_nsize 
+*                   and allocates more memory if needed.  
+*      *acm* 10/01  remove VMS includes
+* v540 *acm* 12/01  IF (missing_polygon) THEN don't call PPLLDX_envelope; calling
+*                   with missing data for time-axis data results in trying to 
+*                   compute a time axis (elsewhere) with out-of-range values.
+* v541 *acm*  3/02  The above fix is too broad.  Apply it only to time-axis 
+*                   overlays.
+* v541 *acm*  3/02  Compute and allocate the ammount of PPLUS memory that'll
+*                   be needed for this plot, before the loop that loads polygons.
+* v541 *acm*  3/02  set twodee_on to .TRUE. (as in disp_init) so we can overlay on 
+*                   polygon plots
+* v541 *acm*  4/02  If we have a depth axis, multiply the corresponding 
+*                   vertices by -1.  Else the polygons arent plotted.
+* v541 *acm*  8/02  For "No Valid Data" the test is: 
+*                   IF (no_range .AND. (only_val.EQ.mr_bad_data(mr_color))
+* V550 *acm* 11/02  When its a 1-d form the ppl memory allocation was wrong.
+*                   (Input is 1D arrays of p1,p1,p1,p1,BAD,p2,p2,p2,p2,BAD,..)
+* V552 *acm*  3/03  Send the key string to key_loc since it may be multi-line
+*                   Also, set strings longer
+* V553 *acm*  6/03  For polygons, store the # of points in each polygon in the PPLUS
+*                   memory buffer, rather than in lleng.  This way the number of
+*                   polygons that may be plotted is unlimited. Mark this with the
+*                   value of icode (first argument to pplldx_envelope)
+* v554 *acm* 12/03  Bug fix: for 1-D form of polygon command, save values of context 
+*                   so they can be properly restored. (ss_x_save, ss_y_save)
+* V580 *acm* 11/04  Check calendar id only for 2-D polygon form; 1-D polygon data are
+*                   just lists on abstract axis.  Fix for bug 1066
+* V580 *acm* 12/04  Correct the syntax sending XFOR LONE to pplus when we 
+*                   turn on lon/lat formatting.
+* V600 *acm*  11/05 Fix for bug 1130, 1349: axis labels need lat/lon labels,
+*                   fixes to the precision
+* V62  *acm* 5/09   Fixing bug 1661: if the plot is TRANSPOSED, then multiply 
+*                   vertices of the opposite axis by -1 
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V650 *acm*  3/10  Check calendar id only if polygon data is not a list on an
+*                   abstract time axis.  Fix for bug 1722.
+* V671 *acm*  5/11  For the 1D form of polygon plots, the check for adequate 
+*                   PLOT+ memory was not adequate - we need x,y, and variable 
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* PyFr *kms*  7/13 Scale default lettering sizes by textscale
+* V6.85 *acm* 9/13 Change to CALL LINE_STYLE, implementing new PLOT/COLOR w/o 
+*                  argument for all-color line plot
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+!	include 'gfdl_vms.parm'
+	include 'xplot_setup.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xtext_info.cmn'
+	include 'axis_inc.decl'       ! with axis lengths
+	include 'AXIS.INC'       ! with axis lengths	
+        include 'PPLDAT.INC'
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'	! with NPOLYGONS
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+	include 'vector_inc.decl' ! with TRANSPZ
+        include 'VECTOR.INC'
+
+
+* calling argument declarations:
+	LOGICAL		overlay, transpz, no_labels, no_range, use_line,
+     .			is_logx, is_logy, is_modx, do_mod_minus, do_mod_plus
+	INTEGER		symbol, line_type, coord_ax, iunits, do_dash,
+     .			nmv, mr_list( nmv ), cx_list( nmv ), status
+	REAL		memory( mem_blk_size, max_mem_blks )
+	REAL		x_dat(*), y_dat(*)     ! dynamic space allocation 
+	REAL            only_val, dashstyle(4), add_lon
+
+* internal variable declarations:
+	LOGICAL         missing_polygon, first_polygon, use_nice
+	LOGICAL		NO_LINE_RANGE, ambiguous_coord_axis,
+     .			formatted, user_title, oneD_form, stack_up,
+     .			x_is_log, y_is_log
+	CHARACTER*2048	KEY_STRING, FULL_VAR_TITLE, plot_title
+* 3/99 *kob* - upped VAR_UNITS from 32 to 64 chars
+	CHARACTER	VAR_UNITS*64, LEFINT*6, TM_GET_CALENDAR_NAME*32, 
+     .			x_ax*1, y_ax*1,buff*8, buff2*4, t1_date*14,
+     .                  cal_name*32, cal_name_saved*32, buff3*16,
+     .			buff4*16, LEFT_REAL*16, fmt*4, buffer*40, buffsym*30
+	INTEGER         TM_UNIT_ID
+	INTEGER		TM_LENSTR1, CX_DIM_LEN,	TM_GET_CALENDAR_ID, 
+     .			STR_SAME,
+     .			mr_x, cx_x, mr_y, cx_y, cx_color, mr_color,
+     .			slen, slen2, x_lab, y_lab, nline_in_mem, i,
+     .			npoly, ncolor, ipoly, xrow, yrow, start, end,
+     .			npts, idim, color_dim, coord_dim,
+     .			style, justify, ndim, dims(nferdims), nfdim,
+     .			fdims(nferdims), plot_mem_used, pxlim, pylim, ptitl,
+     .			cx_buff_x, cx_buff_y,
+     .			phlim, pvlim, pxdenig, pydenig,
+     .                  cal_id, tax, x_axtyp, y_axtyp, n,
+     .                  ss_x_save, ss_y_save, hblk1, mvh_temp, ier, nc
+
+	REAL		x_len, y_len, lo, hi, lox, hix, loy, hiy,
+     .			xkeypos, ykeypos, xkeysize, ykeysize, lab_ht,
+     .			dt_min, epsilon, small, scale,
+     .			xptsmin, xptsmax, xptsmean, xdif, xmeanlog,
+     .			yptsmin, yptsmax, yptsmean, ydif, ymeanlog,
+     .                  first, last
+
+	REAL*8		vmin, vmax, delta, ind_min, ind_max, dep_min,
+     .			dep_max
+
+* local parameter declarations:
+	LOGICAL		range_rqd
+	PARAMETER     ( range_rqd = .TRUE. )
+	PARAMETER     ( epsilon = 1.E-35 )
+
+
+* signal that plot set-up has begun
+	IF ( mode_diagnostic ) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .				'setting up polygons', 19)
+
+* Permit 2 arguments, ginn up dummy 3rd in that case
+        IF (nmv .EQ. 3) THEN
+	   cx_color = cx_list(3)
+	   mr_color = mr_list(3)
+        ELSEIF (nmv .EQ. 2) THEN
+	   CALL INIT_EMPTY_CONTEXT(cx_buff)
+*       ignore status ... always OK
+	   CALL CONSTANT_CONTEXT("0", cx_buff, cx_buff, status)
+	   cx_color = cx_buff
+	   mr_color = dummy_mr
+        ELSE
+	   GOTO 5200 
+        ENDIF
+
+* initialize
+	nline_in_mem = 0
+	pxlim = qual_given( slash_xlimits ) ! deprecated
+	pylim = qual_given( slash_ylimits ) ! deprecated
+	phlim = qual_given( slash_hlimits )
+	pvlim = qual_given( slash_vlimits )
+	ptitl = qual_given( slash_title )
+	user_title = ptitl .GT. 0
+	cx_x = cx_list(1)
+	cx_y = cx_list(2)
+	mr_x = mr_list(1)
+	mr_y = mr_list(2)
+	plot_mem_used = 0
+	lox = arbitrary_large_val4
+	hix = arbitrary_small_val4
+	loy = arbitrary_large_val4
+	hiy = arbitrary_small_val4
+c	ind_dim = plot_axis(1)
+	stack_up = .FALSE.
+	cal_id = 0
+	x_axtyp = 1
+	y_axtyp = 1
+
+* *acm* 3/02  set flag indicating a 2D plot is on the screen
+*             (so we can overlay other plots on a polygon plot)
+	twodee_on = .TRUE.
+
+* perform sanity checks on the arguments
+* ... check the X coordinate variable for shape
+	CALL GET_CX_DIMS( cx_x, ndim, dims)
+	IF (ndim .EQ. 0) GOTO 5210		! npoints = 1 !!! yuk!
+	IF (ndim .GT. 2) GOTO 5210		! could someday be relaxed ...
+* ... check the Y coordinate variable for conformability
+	CALL GET_CX_DIMS( cx_y, nfdim, fdims)
+	IF (ndim .NE. nfdim) GOTO 5210
+	DO 100, idim = 1, ndim
+	   IF (dims(idim) .NE. fdims(idim)) GOTO 5210
+	   IF ( CX_DIM_LEN(dims(idim),cx_x)
+     .    .NE.  CX_DIM_LEN(dims(idim),cx_y) ) GOTO 5210
+ 100	CONTINUE
+* ... check the color value array for consistent structure
+	oneD_form = ndim .EQ. 1
+	CALL GET_CX_DIMS( cx_color, nfdim, fdims)
+	IF (nfdim .GT. 1) GOTO 5210
+
+* determine coordinate axes for polygon coords and fill color values
+	IF (oneD_form) THEN
+* 1-dimensional form of command
+	   coord_dim = dims(1)	! axis of points in the polygon(s)
+	   color_dim = coord_dim
+	ELSE
+* 2-dimensional form of command
+* ... does the color value axis match one of the coordinate array axes?
+	   IF (nfdim .EQ. 0) THEN
+	      ambiguous_coord_axis = .TRUE.
+	   ELSE
+	      DO 105 idim = 1, ndim
+	         IF (dims(idim) .EQ. fdims(1)) THEN
+	            ambiguous_coord_axis = .FALSE.
+	            GOTO 106
+	         ENDIF
+ 105          CONTINUE
+	      ambiguous_coord_axis = .TRUE.
+	   ENDIF
+ 106	   IF (ambiguous_coord_axis) THEN
+* ... abmiguous 2D form since since color_array is a scalar
+	      IF (coord_ax .GT. 0 ) THEN
+* ... the user has specified the coordinate axis (e.g. "/COORD_AX=J")
+	         CALL EQUAL_STRING( cmnd_buff(qual_start(coord_ax):
+     .					      qual_end  (coord_ax)),
+     .				    buff, status )
+                 IF ( status .NE. ferr_ok ) RETURN
+                 DO 120 coord_dim = 1,4
+	            IF (ww_dim_name(coord_dim) .EQ. buff(1:1)
+     .		   .OR. ss_dim_name(coord_dim) .EQ. buff(1:1) ) THEN
+*      ... is the specified axis an axis of the arrays?
+	               DO 110 idim = 1, 2
+ 110		       IF (coord_dim .EQ. dims(idim)) GOTO 150
+	               GOTO 5300	! invalid coordinate dim given
+	            ENDIF
+ 120	         CONTINUE
+	         GOTO 5300	! coord dim wasn't "X","Y","Z", or "T"
+	      ELSE
+* ... the user has NOT specified the coordinate axis
+	         coord_dim = dims(2)
+	         CALL WARN("Ambiguous axes in 2D coordinate arrays")
+	         CALL WARN("Continuing as /COORD_AX="//
+     .				ww_dim_name(coord_dim))
+	      ENDIF
+ 150	      IF (dims(1) .EQ. coord_dim) THEN
+	         color_dim = dims(2)
+	      ELSE
+	         color_dim = dims(1)
+	      ENDIF
+	   ELSE
+* color fill value array is 1D and matches an axis of the coordinate arrays
+	      color_dim = fdims(1)
+	      IF (dims(1) .EQ. color_dim) THEN
+	         coord_dim = dims(2)
+	      ELSE
+	         coord_dim = dims(1)
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* set flag indicating a 1D plot is on the screen
+	IF (.NOT.overlay) onedee_on = .TRUE.
+
+        IF (.NOT. overlay) has_time_axis = .FALSE.  ! ??
+
+* prepare for possible transpose of X and Y axes
+	IF ( transpz ) THEN
+	   y_ax  = 'X'
+	   x_ax  = 'Y'
+	   y_lab = ppl_xlab
+	   x_lab = ppl_ylab
+	   y_len   = xlen
+	   x_len   = ylen
+	   x_is_log = is_logy
+           y_is_log = is_logx
+
+	   IF (pxlim .GT. 0) THEN
+	      pxdenig = pxlim
+	   ELSE
+	      pxdenig = pvlim
+	   ENDIF
+	   IF (pylim .GT. 0) THEN
+	      pydenig = pylim
+	   ELSE
+	      pydenig = phlim
+	   ENDIF
+	ELSE
+	   y_ax  = 'Y'
+	   x_ax  = 'X'
+	   y_lab = ppl_ylab
+	   x_lab = ppl_xlab
+	   x_len   = xlen
+	   y_len   = ylen
+	   x_is_log = is_logx
+           y_is_log = is_logy
+
+	   IF (pxlim .GT. 0) THEN
+	      pxdenig = pxlim
+	   ELSE
+	      pxdenig = phlim
+	   ENDIF
+	   IF (pylim .GT. 0) THEN
+	      pydenig = pylim
+	   ELSE
+	      pydenig = pvlim
+	   ENDIF
+	ENDIF
+
+* * * * * * *    - - - LOAD DATA - - -    * * * * * * * * *
+* allocate modifiable context buffers for data extraction
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	cx_buff_x = cx_stack_ptr
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	cx_buff_y = cx_stack_ptr
+	CALL TRANSFER_CONTEXT( cx_x, cx_buff_x )
+	CALL TRANSFER_CONTEXT( cx_y, cx_buff_y )
+	stack_up = .TRUE.
+
+* set start indices for extraction
+	IF (oneD_form) THEN
+	   end  = 0
+	ELSE
+	   xrow = cx_lo_ss(cx_x,color_dim) - 1
+	   yrow = cx_lo_ss(cx_y,color_dim) - 1
+	ENDIF
+
+* tell PLOT+ the bad data flags used
+	WRITE ( ppl_buff, 3005 ) mr_bad_data( mr_x ), x_ax
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	WRITE ( ppl_buff, 3005 ) mr_bad_data( mr_y ), y_ax
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+ 	WRITE ( ppl_buff, 3005 ) mr_bad_data( mr_color ), 'Z'
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+ 3005	FORMAT ( 'LIMITS ',G15.8,1X,A1,'EQ' )
+
+
+* need number of polygons and points in each. On the first polyon we will
+* check that we have enough PPLUS memory and allocate more if needed.
+
+        first_polygon = .TRUE.
+
+* ...  point to the first polygon 
+       IF ( oneD_form ) THEN
+*    ... coords are 1D arrays of p1,p1,p1,p1,BAD,p2,p2,p2,p2,BAD,...
+*    ... we will find npoly as we go through the list
+          npoly = 0
+	ELSE
+*    ... coords are 2D arrays of color_dim X coord_dim
+           npoly = cx_hi_ss(cx_x,color_dim) - cx_lo_ss(cx_x,color_dim) + 1
+	ENDIF
+
+* loop through all the polygons variables loading them into PPLUS
+* construct a funky FORTRAN 77 DO-WHILE loop
+* ---- 
+        IF (oneD_form) THEN
+           ss_x_save = cx_lo_ss(cx_buff_x,coord_dim)
+           ss_y_save = cx_lo_ss(cx_buff_y,coord_dim)
+        ENDIF
+
+200	CONTINUE
+
+* ... prepare the context buffer to point to the next polygon 
+	   IF ( oneD_form ) THEN
+*    ... coords are 1D arrays of p1,p1,p1,p1,BAD,p2,p2,p2,p2,BAD,...
+	      cx_lo_ss(cx_buff_x,coord_dim) =
+     .	       cx_lo_ss(cx_buff_x,coord_dim) + end   ! advance past end of last
+	      cx_lo_ss(cx_buff_y,coord_dim) =
+     .	       cx_lo_ss(cx_buff_y,coord_dim) + end
+	      IF (cx_lo_ss(cx_buff_x,coord_dim)
+     .	     .GE. cx_hi_ss(cx_buff_x,coord_dim)) THEN
+                
+ 	         cx_lo_ss(cx_buff_x,coord_dim) = ss_x_save   ! restore what it was
+	         cx_lo_ss(cx_buff_y,coord_dim) = ss_y_save   ! so we can count npts
+                                                             ! in the 700 loop below
+                 GOTO 290 ! exit DO_WHILE loop
+              ENDIF
+
+	   ELSE
+*    ... coords are 2D arrays of color_dim X coord_dim
+	      xrow = xrow + 1  ! advance to next polygon in the 2D array
+	      yrow = yrow + 1  ! advance to next polygon in the 2D array
+	      IF (xrow .GT. cx_hi_ss(cx_x,color_dim)) GOTO 290	! exit the DO_WHILE loop
+	      cx_lo_ss(cx_buff_x,color_dim) = xrow
+	      cx_hi_ss(cx_buff_x,color_dim) = xrow
+	      cx_lo_ss(cx_buff_y,color_dim) = yrow
+	      cx_hi_ss(cx_buff_y,color_dim) = yrow
+	   ENDIF
+
+* ... extract 1-dimensional arrays -- possibly with embedded missing values
+* ... x coordinates
+	   CALL EXTRACT_LINE (	cx_buff_x,
+     .				memory( 1, mr_blk1(mr_x) ),
+     .				mr_x,
+     .				x_dat,
+     .				coord_dim,
+     .				ndim,
+     .				npts,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+* ... y coordinates
+	   CALL EXTRACT_LINE (	cx_buff_y,
+     .				memory( 1, mr_blk1(mr_y) ),
+     .				mr_y,
+     .				y_dat,
+     .				coord_dim,
+     .				ndim,
+     .				npts,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+*  For 2d form, npts in each polygon; check PPLUS memory and if needed, 
+*  allocate more.  Multiply by 2 because we have X and Y vertices of 
+*  polygons, and by 2 again because the call below to 
+*       PPLLDX_envelope(5,x_dat,x_dat,ncolor...  
+*  loads polygon data after all the previous data.
+
+	   IF (first_polygon .AND. .NOT.oneD_form) THEN
+              plot_mem_used = 4* npts* npoly
+              CALL reallo_envelope(plot_mem_used)
+
+              first_polygon = .FALSE.
+              plot_mem_used = 0
+              npoly = 0
+           ENDIF
+
+* If one of the axes is a depth axis, multiply the corresponding 
+* vertices by -1.  Else they don't show up on the plot.
+* xlo, xhi, ylo, yhi are from AXIS.INC
+
+           IF (transpz) THEN
+              IF ( xlo .GT. xhi )  THEN
+                 DO 201 i = 1, npts
+                    IF ( y_dat(i) .NE. mr_bad_data(mr_y) )
+     .                y_dat(i) = -1.* y_dat(i)
+  201            CONTINUE
+              ENDIF
+   
+              IF ( ylo .GT. yhi )  THEN
+                 DO 202 i = 1, npts
+                    IF ( x_dat(i) .NE. mr_bad_data(mr_x) )
+     .                x_dat(i) = -1.* x_dat(i)
+  202            CONTINUE
+              ENDIF
+
+   	   ELSE
+
+      	      IF ( xlo .GT. xhi )  THEN
+                 DO 203 i = 1, npts
+                    IF ( x_dat(i) .NE. mr_bad_data(mr_x) )
+     .                x_dat(i) = -1.* x_dat(i)
+  203            CONTINUE
+              ENDIF
+   
+              IF ( ylo .GT. yhi )  THEN
+                 DO 204 i = 1, npts
+                    IF ( y_dat(i) .NE. mr_bad_data(mr_y) )
+     .                y_dat(i) = -1.* y_dat(i)
+  204            CONTINUE
+              ENDIF
+	   ENDIF  
+
+	   IF (add_lon .NE. 0.) THEN
+	      DO 205 i = 1, npts
+	         IF ( x_dat(i) .NE. mr_bad_data(mr_x) ) 
+     .              x_dat(i) = add_lon + x_dat(i)
+  205	      CONTINUE
+           ENDIF
+
+* When using log axis transform to log(x).  Scale the points of the
+* polygon within the log axis range xlo, xhi to keep something like
+* the original shape of the polygon.
+
+	   IF (x_is_log) THEN
+
+*  Find min and max x points in the polygon shape (linear units)
+
+	      xptsmin = ABS(mr_bad_data(mr_x))
+	      xptsmax = -1.* xptsmin
+
+	      DO 400 i = 1, npts
+		 IF (x_dat(i) .NE. mr_bad_data(mr_x)) THEN 
+		    xptsmin = MIN(xptsmin, x_dat(i))
+		    xptsmax = MAX(xptsmax, x_dat(i))
+		 ENDIF
+  400         CONTINUE
+
+	      xptsmean = (xptsmin+xptsmax)/2.
+
+*  Convert the x midpoint to log units, and put the other x points
+*  on the page scaled by the axis ends xlo and xhi
+
+	      IF (xptsmean .GT. epsilon) THEN
+		 xmeanlog = LOG10(xptsmean)
+		 scale = 0.1* (xhi-xlo)	! log axis units
+
+		 DO 410 i = 1, npts
+		    xdif = scale*(x_dat(i) - xptsmean)
+		    x_dat(i) = xmeanlog + xdif
+  410		 CONTINUE
+	      ELSE
+		 small = xptsmean
+		 GO TO 5600
+	      ENDIF
+	   ENDIF
+
+* When using log axis transform to log(y).  Scale the points of the
+* polygon within the log axis range ylo, yhi to keep something like
+* the original shape of the polygon.
+
+	   IF (y_is_log) THEN
+
+*  Find min and max y points in the polygon shape (linear units)
+
+	      yptsmin = ABS(mr_bad_data(mr_y))
+	      yptsmax = -1.* yptsmin
+
+	      DO 500 i = 1, npts
+		 IF (y_dat(i) .NE. mr_bad_data(mr_y)) THEN 
+		    yptsmin = MIN(yptsmin, y_dat(i))
+		    yptsmax = MAX(yptsmax, y_dat(i))
+		 ENDIF
+  500         CONTINUE
+
+	      yptsmean = (yptsmin+yptsmax)/2.
+
+*  Convert the y midpoint to log units, and put the other Y points
+*  on the page scaled by the axis ends ylo and yhi
+
+	      IF (yptsmean .GT. epsilon) THEN
+		 ymeanlog = LOG10(yptsmean)
+		 scale = 0.1* (yhi-ylo)	! log axis units
+
+		 DO 510 i = 1, npts
+		    ydif = scale*(y_dat(i) - yptsmean)
+		    y_dat(i) = ymeanlog + ydif
+  510		 CONTINUE
+	      ELSE
+		 small = yptsmean
+		 GO TO 5600
+	      ENDIF
+	   ENDIF
+
+* ... locate the (next) contiguous segment in the arrays
+*    ...search for start of segment
+	   missing_polygon = .false.
+	   start = npts
+	   end   = npts
+	   DO 210 i = 1, npts
+	      IF ( x_dat(i) .NE. mr_bad_data(mr_x) 
+     .       .AND. y_dat(i) .NE. mr_bad_data(mr_y) ) THEN
+	         start = i
+	         GOTO 220
+	      ENDIF
+ 210	   CONTINUE
+	   GOTO 240   ! This polygon is all missing in X - omit		
+*    ... find the end of the segment
+ 220	   DO 230 i = start, npts
+	      IF ( x_dat(i) .EQ. mr_bad_data(mr_x) 
+     .       .OR.  y_dat(i) .EQ. mr_bad_data(mr_y) ) THEN
+	         end = i - 1
+	         GOTO 250
+	      ENDIF
+ 230	   CONTINUE
+
+ 240	   IF (start .GE. end ) missing_polygon = .true.
+
+* ... check for adequate PLOT+ memory
+ 250	   npts = end-start+1
+
+           IF (oneD_form) THEN
+              plot_mem_used = plot_mem_used + 3*npts
+              CALL reallo_envelope(plot_mem_used)
+           ENDIF
+
+c	   IF ( npoly         .GE. NPOLYGON   ) GOTO 5160
+
+* ... maintain check on x data range for PLOT+ auto-scaling
+	   CALL MINMAX( x_dat(start), npts, mr_bad_data(mr_x), lo, hi)
+	   IF (lo .LT. lox) lox = lo
+	   IF (hi .GT. hix) hix = hi
+	   CALL MINMAX( y_dat(start), npts, mr_bad_data(mr_y), lo, hi)
+	   IF (lo .LT. loy) loy = lo
+	   IF (hi .GT. hiy) hiy = hi
+
+* ... pass the data to PLOT+
+
+	   if (overlay) SOVER = .true.
+
+* ... let PPL data loader know what's going on (kludge)
+	   makep = 'FILLPOL'
+
+* ... setup for possible overlay on a time axis plot  ? calendar_id here?
+	   IF (overlay .AND. has_time_axis  ) THEN
+	      dt_min  = saved_dt_min
+	      t1_date = saved_t1_date
+              IF ( .NOT. oneD_form) THEN
+              
+*  Check for calendar mismatch for time- overlay plots
+*  (but only for 2-D polygon form; 1-D polygon data are
+*  just lists on abstract axis.)
+*  If the axis is 7 (abstract) then dont do the check either.
+                 tax = grid_line(f_dim,cx_grid(cx_x ))
+                 IF (tax.EQ.mnormal) tax = grid_line(t_dim,cx_grid(cx_x ))
+		 IF (STR_SAME(line_name(tax),'ABSTRACT') .NE. 0) THEN 
+                    cal_name = line_cal_name(tax)
+                    cal_id = TM_GET_CALENDAR_ID ( cal_name )
+                    IF (cal_id .NE. saved_calendar_id) GO TO 5360
+                 ENDIF
+              ENDIF
+	   ELSE
+              dt_min  = 1.0
+              t1_date = ' '
+	   ENDIF
+
+	   IF (missing_polygon) THEN
+! for time series overlays, dont load the data
+              IF (.NOT. (has_time_axis .AND. overlay)) 
+     .    	  CALL PPLLDX_envelope(3,mr_bad_data(mr_x),
+     .            mr_bad_data(mr_y),1,t1_date,' ',dt_min,plot_mem_used)
+	   ELSE IF ( transpz ) THEN
+	      CALL PPLLDX_envelope(3,y_dat(start),x_dat(start),npts,
+     .		           t1_date, ' ', dt_min, plot_mem_used)
+	   ELSE
+	      CALL PPLLDX_envelope(3,x_dat(start),y_dat(start),npts,
+     .			   t1_date, ' ', dt_min, plot_mem_used)
+	   ENDIF
+
+* ... increment number of lines on plot
+!	   nline_on     = nline_on     + 1
+	   nline_in_mem = nline_in_mem + 1
+
+	   npoly = npoly + 1
+	GOTO 200	! end of DO-WHILE loop
+ 290	IF (npoly .EQ. 0 ) GOTO 5230
+
+
+* ... restore normal PPLOT+ operations (else segments get prematurely created)
+	   makep = ' '
+
+* NOW set the line style
+        do_dash = 0
+	CALL LINE_STYLE( symbol, 0.08, line_type, line_type, use_line, 
+     .                   do_dash, dashstyle, 1, 1 )
+
+* release context stack buffers
+	cx_stack_ptr = cx_stack_ptr - 2
+	stack_up = .FALSE.
+
+* pass the color value array to PLOT+ (use x_dat as a buffer)
+
+	if (nmv .eq. 2) then
+	   ncolor = 1
+	   x_dat(1) = 0.0
+	else
+	   CALL EXTRACT_LINE (	cx_color,
+     .				memory( 1, mr_blk1(mr_color) ),
+     .				mr_color,
+     .				x_dat,
+     .				color_dim,
+     .				ndim,
+     .				ncolor,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	endif
+	IF (ncolor .EQ. 1) THEN
+	   DO 300 ipoly = 1, npoly
+ 300	   x_dat(ipoly) = x_dat(1)	! single color applied to all pol'gs
+	   ncolor = npoly
+	ENDIF
+	IF (ncolor .NE. npoly) GOTO 5220	! color array length wrong
+
+* pass back a summary about the range of colors
+	no_range = NO_LINE_RANGE(x_dat,
+     .				 ncolor, mr_bad_data(mr_color), only_val )
+
+	if (overlay) SOVER = .true.
+	makep = 'FILLPOL'   ! that PLOT+ kludge again
+	CALL PPLLDX_envelope(5,x_dat,x_dat,ncolor, t1_date, ' ', 
+     .                       dt_min,plot_mem_used)
+
+
+* If needed for the levels setting, compute data mean and std, store
+* in common.  If the user set a std to use, store that.
+
+       CALL compute_mnstd (x_dat, mr_bad_data(mr_color), need_std, 
+     .    ncolor, status)
+
+* If histogram-based levels are requested, compute the 
+* histogram bins.
+
+       IF (need_histo) THEN
+* create temporary buffer to contain workspace
+
+	  CALL CREATE_TEMP_MEM_VAR( cx_x, mvh_temp, status )
+	  IF ( status .NE. ferr_ok ) RETURN
+	  hblk1 = mr_blk1( mvh_temp )
+          plot_mem_used = plot_mem_used + ncolor
+
+	  CALL compute_histo_bins (x_dat, memory(1,hblk1), 
+     .       mr_bad_data(mr_color), ncolor, status) 
+       ENDIF
+
+* ... check for adequate PLOT+ memory to store the npts for each poly. 
+* ... Save in ppl mem rather than array lleng to remove restriction on
+* ... total number of polys that can be plotted.
+
+           plot_mem_used = plot_mem_used + npoly + 1
+           CALL reallo_envelope(plot_mem_used)
+
+* reset start indices for extraction
+	IF (oneD_form) THEN
+	   end  = 0
+	ELSE
+	   xrow = cx_lo_ss(cx_x,color_dim) - 1
+	   yrow = cx_lo_ss(cx_y,color_dim) - 1
+	ENDIF
+
+* loop through all the polygons getting their npts;
+* loading the counts into PPLUS memory
+* ---- 
+         DO 700 n = 1, npoly
+
+* ... prepare the context buffer to point to the next polygon 
+	   IF ( oneD_form ) THEN
+*    ... coords are 1D arrays of p1,p1,p1,p1,BAD,p2,p2,p2,p2,BAD,...
+	      cx_lo_ss(cx_buff_x,coord_dim) =
+     .	       cx_lo_ss(cx_buff_x,coord_dim) + end   ! advance past end of last
+	      cx_lo_ss(cx_buff_y,coord_dim) =
+     .	       cx_lo_ss(cx_buff_y,coord_dim) + end
+	      IF (cx_lo_ss(cx_buff_x,coord_dim)
+     .	     .GE. cx_hi_ss(cx_buff_x,coord_dim)) GOTO 690 ! exit DO_WHILE loop
+	   ELSE
+*    ... coords are 2D arrays of color_dim X coord_dim
+	      xrow = xrow + 1  ! advance to next polygon in the 2D array
+	      yrow = yrow + 1  ! advance to next polygon in the 2D array
+	      IF (xrow .GT. cx_hi_ss(cx_x,color_dim)) GOTO 690	! exit the DO_WHILE loop
+	      cx_lo_ss(cx_buff_x,color_dim) = xrow
+	      cx_hi_ss(cx_buff_x,color_dim) = xrow
+	      cx_lo_ss(cx_buff_y,color_dim) = yrow
+	      cx_hi_ss(cx_buff_y,color_dim) = yrow
+	   ENDIF
+
+* ... extract 1-dimensional arrays -- possibly with embedded missing values
+* ... x coordinates
+	   CALL EXTRACT_LINE (	cx_buff_x,
+     .				memory( 1, mr_blk1(mr_x) ),
+     .				mr_x,
+     .				x_dat,
+     .				coord_dim,
+     .				ndim,
+     .				npts,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+* ... y coordinates
+	   CALL EXTRACT_LINE (	cx_buff_y,
+     .				memory( 1, mr_blk1(mr_y) ),
+     .				mr_y,
+     .				y_dat,
+     .				coord_dim,
+     .				ndim,
+     .				npts,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* ... check for missing polygon
+
+	   missing_polygon = .false.
+	   start = npts
+	   end   = npts
+	   DO 610 i = 1, npts
+	      IF ( x_dat(i) .NE. mr_bad_data(mr_x) 
+     .       .AND. y_dat(i) .NE. mr_bad_data(mr_y) ) THEN
+	         start = i
+	         GOTO 620
+	      ENDIF
+ 610	   CONTINUE
+	   GOTO 640   ! This polygon is all missing in X - omit		
+*    ... find the end of the segment
+ 620	   DO 630 i = start, npts
+	      IF ( x_dat(i) .EQ. mr_bad_data(mr_x) 
+     .       .OR.  y_dat(i) .EQ. mr_bad_data(mr_y) ) THEN
+	         end = i - 1
+	         GOTO 650
+	      ENDIF
+ 630	   CONTINUE
+
+ 640	   IF (start .GE. end ) missing_polygon = .true.
+
+* ... check for adequate PLOT+ memory
+ 650	   npts = end-start+1
+
+	   IF (missing_polygon) THEN
+! for time series overlays, dont load the data
+              IF (.NOT. (has_time_axis .AND. overlay)) 
+     .    	 CALL pplld_pts_envelope (1, plot_mem_used)
+	   ELSE
+	      CALL pplld_pts_envelope (npts, plot_mem_used)
+	   ENDIF
+
+ 700    CONTINUE
+ 690    CONTINUE
+        CALL pplld_pts_envelope (ncolor, plot_mem_used)
+
+	makep = ' '   ! that PLOT+ kludge again
+
+	IF ( .NOT.overlay ) THEN
+           CALL PPLCMD ( from, line, 0, 'XFOR 0', 1, 1 )
+           CALL PPLCMD ( from, line, 0, 'YFOR 0', 1, 1 )
+        ENDIF
+
+* turn on lon/lat axis formatting, if lon/lat units, otherwise off
+
+	IF (.NOT.overlay) THEN
+	   iunits = TM_UNIT_ID(VAR_UNITS(cx_x))
+	   IF (iunits .EQ. 4) THEN
+	      CALL PPLCMD ( from, line, 0, 'XFOR (I7,''''LONE'''')', 1, 1 )
+	   else
+	      CALL PPLCMD ( from, line, 0, 'XFOR 0', 1, 1 )
+	   endif
+	   
+	   iunits = TM_UNIT_ID(VAR_UNITS(cx_y))
+	   IF (iunits .EQ. 4) THEN
+	      CALL PPLCMD ( from, line, 0, 'YFOR (I7,''''LAT'''')', 1, 1 )
+	   else
+	      CALL PPLCMD ( from, line, 0, 'YFOR 0', 1, 1 )
+	   endif
+	ENDIF
+
+
+* If xmodulo, check for modulo operation
+* Get axis limits - if this is an overlay or the user specified /HLIM
+
+	IF (is_modx .AND. add_lon.EQ.0) THEN
+	   IF (overlay) THEN ! Get existing xaxis limits
+
+              buffsym = 'XAXIS_MIN'
+              CALL GETSYM( buffsym, buffer, nc, ier )
+              READ (buffer, *) vmin
+              buffsym = 'XAXIS_MAX'
+              CALL GETSYM( buffsym, buffer, nc, ier )
+              READ (buffer, *) vmax
+	   ELSE IF ( pxdenig .GT. 0 ) THEN 
+              tax = grid_line(f_dim,cx_grid(cx_x ))
+              IF (tax.EQ.mnormal) tax = grid_line(t_dim,cx_grid(cx_x ))
+              cal_name = line_cal_name(tax)
+              cal_id = TM_GET_CALENDAR_ID ( cal_name )
+	      CALL EQUAL_RANGE( 
+     .			cmnd_buff(qual_start(pxdenig):qual_end(pxdenig)),
+     .			x_dim, vmin, vmax, delta,
+     .			formatted, range_rqd, cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+	   ENDIF
+
+	   IF (lox.LT.vmin .OR. hix.LT.vmax) THEN
+	      do_mod_plus = .TRUE.
+	   ENDIF
+	   IF (hix .GT. vmax .OR. lox.GT.vmin) THEN
+	      do_mod_minus = .TRUE.
+	   ENDIF
+	   IF ((do_mod_minus.OR.do_mod_plus) .AND. x_is_log) THEN
+	      CALL WARN( '/MODULO ignored on polygon command with log x axis')
+	      do_mod_minus = .FALSE.
+	      do_mod_plus = .FALSE.
+	   ENDIF
+        ENDIF
+
+* axis scaling -- only applies if it is a fresh plot (not an overlay)
+* most of the work is avoiding an error if there is no data range with
+* which to make a scale ...
+
+
+	IF ( .NOT.overlay ) THEN
+	   delta = unspecified_val8
+* ... X axis
+	   IF ( pxdenig .GT. 0 ) THEN   ! explicit /XLIMITS 10/93
+	      IF (pxlim.GT.0 .AND. .NOT.denig_xylim_msg_done) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+              tax = grid_line(f_dim,cx_grid(cx_x ))
+              IF (tax.EQ.mnormal) tax = grid_line(t_dim,cx_grid(cx_x ))
+              cal_name = line_cal_name(tax)
+              cal_id = TM_GET_CALENDAR_ID ( cal_name )
+	      CALL EQUAL_RANGE( 
+     .			cmnd_buff(qual_start(pxdenig):qual_end(pxdenig)),
+     .			x_dim, vmin, vmax, delta,
+     .			formatted, range_rqd, cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+
+              CALL AXIS_ENDS(x_ax, coord_dim, cx_grid(cx_x), vmin, 
+     .			     vmax, delta, x_is_log, x_axtyp, status )
+		 IF ( status .NE. ferr_ok ) THEN
+		 first = vmin
+		 last = vmax
+		 GOTO 5400
+	      ENDIF
+
+	   ELSEIF (lox .GE. hix) THEN
+	      IF (lox .EQ. arbitrary_large_val4) lox = 1.0
+* ... no data range -- provide artifical axis limits
+              CALL AXIS_ENDS(x_ax, coord_dim, cx_grid(cx_x),
+     .			DBLE(lox-1.0), DBLE(lox+1.0), 0.5D0, x_is_log, 
+     .			x_axtyp, status )
+	      IF ( status .NE. ferr_ok ) THEN
+		 first = lox-1.0
+		 last = lox+1.0
+		 GOTO 5400
+	      ENDIF
+	   ELSE
+              CALL AXIS_ENDS(x_ax,coord_dim,cx_grid(cx_x),
+     .	       DBLE(lox),DBLE(hix), delta, x_is_log, x_axtyp, status )
+	      IF ( status .NE. ferr_ok ) THEN
+		 first = lox
+		 last = hix
+		 GOTO 5400
+	      ENDIF
+
+	   ENDIF
+
+* turn on lon/lat axis formatting, if lon/lat units, otherwise off
+
+	   iunits = TM_UNIT_ID(VAR_UNITS(cx_x))
+	   IF (iunits .EQ. 4) THEN
+	      CALL GET_AXIS_FORMAT( DBLE(lox), DBLE(hix), delta, 
+     .           fmt, use_nice )
+              IF (use_nice) THEN
+                  ppl_buff = 'XFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .              ',''''LONE'''')' 
+                 CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+              ENDIF
+           ELSE
+	      CALL PPLCMD ( from, line, 0, 'XFOR 0', 1, 1 )
+	   ENDIF
+
+* ... Y axis
+	   delta = unspecified_val8
+
+	   IF ( pydenig .GT. 0 ) THEN   ! explicit /XLIMITS 10/93
+	      IF (pxlim.GT.0 .AND. .NOT.denig_xylim_msg_done) THEN
+	         CALL WARN( '/XLIMITS and /YLIMITS are deprecated.')
+	         CALL WARN( 'Use /HLIMITS and /VLIMITS instead.')
+	         denig_xylim_msg_done = .TRUE.
+	      ENDIF
+              tax = grid_line(f_dim,cx_grid(cx_x ))
+              IF (tax.EQ.mnormal) tax = grid_line(t_dim,cx_grid(cx_x ))
+              cal_name = line_cal_name(tax)
+              cal_id = TM_GET_CALENDAR_ID ( cal_name )
+	      CALL EQUAL_RANGE( 
+     .			cmnd_buff(qual_start(pydenig):qual_end(pydenig)),
+     .			y_dim, vmin, vmax, delta,
+     .			formatted, range_rqd, cal_id, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5000
+              CALL AXIS_ENDS(y_ax,coord_dim,cx_grid(cx_y),
+     .			     vmin,vmax,delta, y_is_log, y_axtyp, status )
+	      IF ( status .NE. ferr_ok ) THEN
+		 first = vmin
+		 last = vmax
+		 GOTO 5400
+	      ENDIF
+	   ELSEIF (loy .GE. hiy) THEN
+	      IF (loy .EQ. arbitrary_large_val4) loy = 1.0
+* ... no data range -- provide artifical axis limits
+              CALL AXIS_ENDS(y_ax,coord_dim,cx_grid(cx_y),
+     .			DBLE(loy-1.0),DBLE(loy+1.0), 0.5D0, y_is_log, 
+     .			y_axtyp, status )
+	      IF ( status .NE. ferr_ok ) THEN
+		 first = loy-1.0
+		 last = loy+1.0
+		 GOTO 5400
+	      ENDIF
+	   ELSE
+              CALL AXIS_ENDS(y_ax,coord_dim,cx_grid(cx_y),
+     .		DBLE(loy),DBLE(hiy), delta, y_is_log, y_axtyp, status )
+	      IF ( status .NE. ferr_ok ) THEN
+		 first = loy
+		 last = hiy
+		 GOTO 5400
+	      ENDIF
+
+	   ENDIF
+
+	   iunits = TM_UNIT_ID(VAR_UNITS(cx_y))
+	   IF (iunits .EQ. 4) THEN
+	       CALL GET_AXIS_FORMAT( DBLE(loy), DBLE(hiy), delta, 
+     .            fmt, use_nice )
+               IF (use_nice) THEN
+                   ppl_buff = 'YFOR,('//fmt(:TM_LENSTR1(fmt))//
+     .               ',''''LAT'''')' 
+                  CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+               ENDIF
+           ELSE
+	      CALL PPLCMD ( from, line, 0, 'YFOR 0', 1, 1 )
+	   ENDIF
+
+*   When not an overlay, set the axis type to log or reverse log
+	   IF (is_logx .OR. is_logy) THEN
+	      WRITE (buff3, 3006) x_axtyp, y_axtyp
+
+ 3006         FORMAT ('axtype,', I2, ',', I2)
+	      CALL PPLCMD ( from, line, 0, buff3, 1, 1)
+	   ENDIF
+
+	ELSE
+	ENDIF
+
+	IF ( no_labels ) RETURN
+
+* * * * * * *    - - - LABELS - - -   * * * * * * * * *
+* if we are starting from a blank screen each axis is labelled with the units
+* of its coordinate variable
+* The plot title is derived from the color value variable (unless over-ridden
+* by the /TITLE qualifier) and it is placed in a key for overlays or as a
+* title for a fresh plot.
+	IF ( overlay ) THEN
+	   CALL OV_GRP_CX_DOC( cx_color, 1, cx_xtra_doc )
+	   IF ( user_title ) THEN
+	      CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .                  plot_title, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+	      slen = TM_LENSTR1( plot_title )
+	   ELSE
+	      plot_title = KEY_STRING( cx_color, cx_xtra_doc, slen )
+	   ENDIF
+           IF (no_range .AND. (only_val.EQ.mr_bad_data(mr_color)) ) THEN
+              plot_title(slen+1:slen+14) = ' No Valid Data'
+              slen = slen + 14
+           ENDIF
+	   CALL KEY_LOC( overlay, xkeypos, ykeypos, xkeysize, ykeysize,
+     .			 lab_ht, style, justify, plot_title(:slen) )
+*          Key uses line 1
+	   CALL PUT_KEY( 1, plot_title(:slen),
+     .			 xkeypos, ykeypos, xkeysize, ykeysize,
+     .			 lab_ht, style, lab_loc_absolute, lab_loc_absolute )
+	ELSE
+* ... basic position and data set labels
+	   CALL DISP_LABELS( cx_plot, unspecified_name4, cal_id)
+* ... title
+	   IF ( user_title ) THEN     ! user over-ride of title
+	      CALL EQUAL_STR_LC
+     .		( cmnd_buff(qual_start(ptitl):qual_end(ptitl)),
+     .            plot_title, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+	      slen = TM_LENSTR1( plot_title )
+	   ELSE
+	      plot_title = FULL_VAR_TITLE( cx_color, slen )
+	   ENDIF
+	   CALL BOX_LABEL( ppl_title,
+     .			 plot_title(:slen),
+     .			 0.0, 0.0, 0.75*xlen, dflt_letsize_title*textscale,
+     .			 dflt_letsize_title*textscale, ppl_centered,
+     .			 lab_loc_absolute, lab_loc_absolute )
+* ... label axis labels:  units from the polygon coordinates
+
+	   plot_title = FULL_VAR_TITLE( cx_x, slen )
+
+C	   plot_title = VAR_UNITS( cx_x )
+C	   slen = TM_LENSTR1( plot_title )
+	   CALL BOX_LABEL( x_lab,
+     .			 plot_title(:slen),
+     .			 0.0, 0.0, 0.6*x_len, dflt_letsize_label*textscale,
+     .			 dflt_letsize_label*textscale, ppl_centered,
+     .			 lab_loc_absolute, lab_loc_absolute )
+
+	   plot_title = FULL_VAR_TITLE( cx_y, slen )
+
+C	   plot_title = VAR_UNITS( cx_y )
+C	   slen = TM_LENSTR1( plot_title )
+	   CALL BOX_LABEL( y_lab,
+     .			 plot_title(:slen),
+     .			 0.0, 0.0, 0.6*y_len, dflt_letsize_label*textscale,
+     .			 dflt_letsize_label*textscale, ppl_centered,
+     .			 lab_loc_absolute, lab_loc_absolute )
+	 ENDIF
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	CALL PPLCMD ( from, line, 0, 'NLINES', 1, 1 )	! wipe buffers clean
+	IF (stack_up) cx_stack_ptr = cx_stack_ptr - 2
+	RETURN
+! 5150	buff = LEFINT( INT(0.99*pplmem_nsize), slen )
+!	CALL ERRMSG( ferr_prog_limit, status,
+!     .		'Plot buffer size is: '//buff(:slen), *5000 )
+ 5160	buff = LEFINT( NPOLYGON, slen )
+	CALL ERRMSG( ferr_prog_limit, status,
+     .		'Maximum polygons is: '//buff(:slen), *5000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'POLYGON may use 2 args (xpts,ypts) with /LINE only,' //
+     .          ' or 3 args (xpts,ypts,color_value)',
+     .		*5000)
+ 5210	CALL ERRMSG( ferr_invalid_command, status,
+     .		'illegal dimensions for polygon coordinate(s) or values',
+     .		*5000)
+ 5220	buff2 = LEFINT(npoly, slen2)
+	buff  = LEFINT(ncolor, slen) 
+	CALL ERRMSG( ferr_invalid_command, status,
+     .		'no. of values ('//buff(:slen)//') '//
+     .		'doesnt match no. of polygons ('//buff2(:slen2)//')', 
+     .		*5000)
+ 5230	CALL ERRMSG( ferr_invalid_command, status,
+     .		'zero polygons specified',
+     .		*5000)
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'invalid argument to /COORD_AX=',
+     .		*5000)
+
+ 5360	cal_name = TM_GET_CALENDAR_NAME(cal_id)
+        cal_name_saved = TM_GET_CALENDAR_NAME(saved_calendar_id)
+        slen = TM_LENSTR1 (cal_name_saved)
+        slen2 = TM_LENSTR1(cal_name)
+	CALL ERRMSG( ferr_inconsist_grid, status,
+     .          'Differing calendar axes: '//pCR//
+     .		'first variable is on '//cal_name_saved(:slen)//
+     .		' axis'//pCR//
+     .		'overlaid variable is on '//cal_name(:slen2)//
+     .		' axis', *5000 )
+
+ 5400	buff3 = LEFT_REAL (first, '(G15.3)', slen)
+	buff4 = LEFT_REAL (last,  '(G15.3)', slen2)
+	CALL ERRMSG( ferr_out_of_range, status,
+     . 'Limits for log axis negative or too small: '//
+     .  buff3(:slen)// ' : '//  buff4(:slen2), *5000 )
+
+ 5600	buff3 = LEFT_REAL (small, '(G15.3)', slen)
+	CALL ERRMSG( ferr_out_of_range, status,
+     . 'X coordinates on log axis negative or too small : '//
+     .  buff3(:slen), *5000 )
+	END
diff --git a/fer/plt/pos_lab.F b/fer/plt/pos_lab.F
new file mode 100644
index 0000000..a254f3a
--- /dev/null
+++ b/fer/plt/pos_lab.F
@@ -0,0 +1,94 @@
+	SUBROUTINE POS_LAB( ss, cx, idim, ndec, string, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form (e.g.) "I:22  X:130.5E"
+* if grid is unknown then "I:22", alone
+* if subscript is unknown then "I:*"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   ???? 
+*	 7/10/90 - added checks for invalid grid and ss
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER		ss, cx, idim, ndec, slen
+	CHARACTER*(*)	string
+	
+* local variable declarations:
+	INTEGER		TM_LENSTR1, grid
+	CHARACTER*4	TM_FMT
+	REAL*8		TM_WORLD
+
+* initialize string with subscript (e.g.) "I:22 " or "I:*"
+	IF ( ss .NE. unspecified_int4 ) THEN
+	   string = ss_dim_name(idim) // ':' // TM_FMT( FLOAT(ss),1,4,slen )
+	   slen = slen + 2
+	ELSE
+	   string = ss_dim_name(idim) // ':*'
+	   slen = 3
+	   RETURN
+	ENDIF
+
+* done with pathological cases
+	IF ( cx .GT. 0 ) THEN
+	   grid = cx_grid( cx )
+	ELSE
+	   RETURN
+	ENDIF
+
+* add on world coord axis name (e.g.) "I:22  X:"
+	string = string(:slen+1) // ww_dim_name(idim) // ':'
+
+* add formatted world coordinate position
+	CALL TRANSLATE_TO_WORLD
+     .	   ( TM_WORLD( ss, grid, idim, box_middle ),
+     .	     idim, grid, ndec, string(slen+7: ) )
+
+* compute string length
+	slen = TM_LENSTR1( string )
+
+	RETURN
+	END
diff --git a/fer/plt/ppl_axes_off.F b/fer/plt/ppl_axes_off.F
new file mode 100644
index 0000000..0e4897a
--- /dev/null
+++ b/fer/plt/ppl_axes_off.F
@@ -0,0 +1,82 @@
+	SUBROUTINE PPL_AXES_OFF(set_up)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* turn off the PLOT+ axes with the AXSET command but save the current
+* state so the axes can be restored
+
+* V450:  
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'plot_setup.parm'
+	include 'xcontrol.cmn'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'		! variable iaxon
+
+* calling argument declarations
+	LOGICAL set_up
+
+* local variable declarations:
+	INTEGER i
+	CHARACTER buff*16
+
+* static storage in COMMON
+	INTEGER save_iaxon(4)
+	COMMON /XAXIS_STATE/ save_iaxon
+
+* save current axis state
+	DO 10 i = 1, 4
+ 10	save_iaxon(i) = iaxon(i)
+
+* turn all 4 axes off
+	CALL PPLCMD ( from, line, 0, 'AXSET 0,0,0,0', 1, 1 )
+
+* turn axis labels off
+	CALL PPLCMD ( from, line, 0, 'XLAB', 1, 1 )
+	CALL PPLCMD ( from, line, 0, 'YLAB', 1, 1 )
+
+* if in /set_up mode this state will not be restored properly
+* issue warning only if user typed in command (csp.eq.0)
+	IF ( set_up .AND. csp.EQ.0 ) THEN
+	   buff = ' '
+	   WRITE (buff, '(4I3)' ) (save_iaxon(i), i=1, 4)
+	   CALL WARN(
+     .		'To restore axes after /SET_UP/NOAXES use PPL AXSET'
+     .		//buff(:12) )
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/ppl_axes_restore.F b/fer/plt/ppl_axes_restore.F
new file mode 100644
index 0000000..03845a3
--- /dev/null
+++ b/fer/plt/ppl_axes_restore.F
@@ -0,0 +1,80 @@
+	SUBROUTINE PPL_AXES_RESTORE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* restore the PLOT+ axes after they have been turned off by PPL_AXES_OFF
+
+* V450:  
+* V541: 3/02  *acm* restore of PPL AXLABP settings too
+*       3/25  Put the common block in a separate include file.
+* v552 *acm* 3/03 new param IAXSET to restore axes after PLOT/AXES/set plot.
+
+	include 'plot_setup.parm'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'		! variable iaxon
+        include 'ppl_ax_save.cmn'
+
+* calling argument declarations
+
+* local variable declarations:
+	INTEGER i
+	CHARACTER buff*16
+
+* convert 4 axis integers to character as arg to the AXSET command
+	buff = ' '
+	WRITE (buff, '(4I3)' ) (save_iaxon(i), i=1, 4)
+
+* restore axis state
+	CALL PPLCMD ( from, line, 0, 'AXSET '//buff, 1, 1 )
+
+* restore axis labelling
+
+        IF (change_axlab) THEN
+           WRITE (buff,92) save_labx, save_laby
+  92	   FORMAT ('AXLABP ', i2, ',', I2 )
+	   CALL PPLCMD (from, line, 0, buff, 1, 1)
+        ENDIF
+
+	IF ( time_axis .AND. change_axlab) THEN
+	   WRITE (buff,94) save_labx, save_laby
+  94	   FORMAT ('TXLABP ', i2, ',', I2 )
+	   CALL PPLCMD (from, line, 0, buff, 1, 1)
+	ENDIF
+
+        iaxset = 0
+
+	RETURN
+	END
diff --git a/fer/plt/ppl_bdead.F b/fer/plt/ppl_bdead.F
new file mode 100644
index 0000000..12e9bb5
--- /dev/null
+++ b/fer/plt/ppl_bdead.F
@@ -0,0 +1,47 @@
+	SUBROUTINE PPL_BDEAD
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* dummy routine for PLOT+ braindead features
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* Ultrix/RISC port - 10/91 - new
+
+	RETURN
+	END
diff --git a/fer/plt/ppl_dash_restore.F b/fer/plt/ppl_dash_restore.F
new file mode 100644
index 0000000..926e535
--- /dev/null
+++ b/fer/plt/ppl_dash_restore.F
@@ -0,0 +1,76 @@
+	SUBROUTINE PPL_DASH_RESTORE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* restore the PLOT+ dash lenghts after they have been changed by PLOT/DASH=
+
+* V541: 3/25  *acm*
+
+	! variables DN1,DN2,UP1,UP2
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'ppl_dash_save.cmn'
+
+* calling argument declarations
+
+* local variable declarations:
+	INTEGER line_number
+
+* For dash lines set up by /DASH=  reset to previous settings which
+* may be from a PPL LINE command and so should persist.
+
+      IF (linenum_save .GT. 0) THEN
+         DO 100 line_number = 1, linenum_save
+
+            dash_changed(line_number) = .FALSE.
+            dn1(line_number) = dashsave(line_number,1)
+            up1(line_number) = dashsave(line_number,2)
+            dn2(line_number) = dashsave(line_number,3)
+            up2(line_number) = dashsave(line_number,4) 
+  100    CONTINUE
+
+         dashsave(line_number,1) = 0.
+         dashsave(line_number,2) = 0.
+         dashsave(line_number,3) = 0.
+         dashsave(line_number,4) = 0.
+
+      linenum_save = 0
+      ENDIF
+
+      RETURN
+      END
diff --git a/fer/plt/ppl_patset.F b/fer/plt/ppl_patset.F
new file mode 100644
index 0000000..502d31c
--- /dev/null
+++ b/fer/plt/ppl_patset.F
@@ -0,0 +1,29 @@
+	SUBROUTINE PPL_PATSET( string )
+
+* execute a PLOT+ PATSET command with the given string as argument
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230: 11/92 - for color map protection during viewport manipulations
+* V491: 12.98 - add PPL_PATSET() for pattern support *jd*
+
+	include 'plot_setup.parm'
+	include 'xrisc.cmn'		! to fix RISC FORTRAN bug
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+
+* initialize fixed length string for RISC (needed for DEC f77 v2.1)
+	risc_buff = string
+	len_rbuff = MIN( size_rbuff, LEN(string) )
+
+* send the command to PLOT+  "PATSET [string]"
+	CALL PPLCMD ( from, line, 0,
+     .                'PATSET '//risc_buff(:len_rbuff), 1, 1 )
+
+* always successful
+        RETURN
+	END
diff --git a/fer/plt/ppl_shaset.F b/fer/plt/ppl_shaset.F
new file mode 100644
index 0000000..7390378
--- /dev/null
+++ b/fer/plt/ppl_shaset.F
@@ -0,0 +1,64 @@
+	SUBROUTINE PPL_SHASET( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute a PLOT+ SHASET command with the given string as argument
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230: 11/92 - for color map protection during viewport manipulations
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'plot_setup.parm'
+	include 'xrisc.cmn'		! to fix RISC FORTRAN bug
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+
+* initialize fixed length string for RISC (needed for DEC f77 v2.1)
+	risc_buff = string
+	len_rbuff = MIN( size_rbuff, LEN(string) )
+
+* send the command to PLOT+  "SHASET [string]"
+	CALL PPLCMD ( from, line, 0,
+     .                'SHASET '//risc_buff(:len_rbuff), 1, 1 )
+
+* always successful
+        RETURN
+	END
diff --git a/fer/plt/ppl_time.F b/fer/plt/ppl_time.F
new file mode 100644
index 0000000..9546822
--- /dev/null
+++ b/fer/plt/ppl_time.F
@@ -0,0 +1,90 @@
+	SUBROUTINE PPL_TIME( lo_val, hi_val, cal_id )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* send the PLOT+ TIME command with WHOI-formatted dates to PLOT+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300:  10/93 - *sh* extracted logic from AXIS_FORMAT
+* V420: 11/27/95 - 4-digit PLOT+ YEARS!!
+* V450: 11/14/97 - the arbitrary tstart, 1 year before start of interval,
+*	causes the /XLIMITS=lo_date:hi_date to mis-represent the data
+*	(see err450_time_xlimits.jnl). Eliminated tstart.
+* V530  *acm* cal_id for alternative calendar axis types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+* special equivalence needed only with DEC risc compiler: bug fix
+        include 'xrisc.cmn'     ! for f77 bug
+        CHARACTER rbuff(4)*14
+        EQUIVALENCE ( rbuff, risc_buff )
+
+
+* calling argument declarations:
+	REAL*8	  lo_val, hi_val
+	INTEGER	  cal_id
+
+* internal variable declarations:
+!	REAL*8	  tstart
+	CHARACTER ABS_WHOI_DATE*14
+
+* internal parameter declarations
+	REAL*8		yrofsecs
+	PARAMETER     ( yrofsecs = 60.*60.*24.*365. )
+
+!* set tstart 1 year before the beginning
+!	tstart = MAX( 0.0D0, lo_val - yrofsecs )
+
+* TIME command (time axis limits)
+
+              rbuff(1) = ABS_WHOI_DATE( lo_val, cal_id )      ! f77 bug
+              rbuff(2) = ABS_WHOI_DATE( hi_val, cal_id )
+!              rbuff(3) = ABS_WHOI_DATE( tstart, cal_id )
+              WRITE ( ppl_buff, 3020 )  'W'//rbuff(1),
+     .                                  'W'//rbuff(2)
+!     .                                  'W'//rbuff(3)
+
+! 3020	      FORMAT ('TIME ',A15,',',A15,',',A15)
+ 3020	      FORMAT ('TIME ',A15,',',A15)
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	RETURN
+      END
diff --git a/fer/plt/put_cmnd_key.F b/fer/plt/put_cmnd_key.F
new file mode 100644
index 0000000..6092fb0
--- /dev/null
+++ b/fer/plt/put_cmnd_key.F
@@ -0,0 +1,94 @@
+	SUBROUTINE PUT_CMND_KEY( cmnd, string, xll, yll, xsize, ysize, lab_ht )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a key for a plot using PLOT+ movable labels
+* that will document a SHADE, CONTOUR or VECTOR overlay
+* (xsize,ysize) is the size of the "key box" (including the line specimen
+* (xll,yll) is the lower left corner of the box
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/9/90
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'plot_setup.parm'
+	include	'command.parm'
+	include	'xplot_setup.cmn'
+
+* calling argument declarations
+	INTEGER cmnd
+	REAL	xll, yll, xsize, ysize, lab_ht
+	CHARACTER string*(*)
+
+* internal variable declarations
+	REAL	ymid, xmid
+	CHARACTER	cmnd_name*8
+
+	ymid = yll + ysize*0.5
+	IF ( cmnd .EQ. cmnd_vector ) THEN
+	   xmid = xsize*(1.-key_line_frac)
+	   WRITE ( ppl_buff, '(2F6.1)' ) xll+(1.05*xmid), ymid
+	   CALL PPLCMD (' ',' ',0,'VECKEY/NOUSER '//ppl_buff, 1, 1 )
+	   CALL BOX_LABEL( ppl_movlab, string,
+     .			   xll, yll, xmid , ysize,
+     .			   lab_ht, ppl_right_just,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	ELSE
+	   IF ( cmnd .EQ. cmnd_contour ) THEN
+	      cmnd_name = 'CONTOUR:'
+	   ELSE
+	      cmnd_name = 'SHADE:  '
+	   ENDIF
+	   xmid = xsize*key_line_frac
+	   CALL BOX_LABEL( ppl_movlab, cmnd_name,
+     .			   xll, yll, .95*xmid, ysize,
+     .			   lab_ht, ppl_right_just,
+     .			   lab_loc_absolute, lab_loc_absolute )
+	   CALL BOX_LABEL( ppl_movlab, string,
+     .			   xll+xmid, yll, xsize-xmid, ysize,
+     .			   lab_ht, ppl_left_just,
+     .			   lab_loc_absolute, lab_loc_absolute )
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/put_key.F b/fer/plt/put_key.F
new file mode 100644
index 0000000..099a431
--- /dev/null
+++ b/fer/plt/put_key.F
@@ -0,0 +1,112 @@
+	SUBROUTINE PUT_KEY( line_num, string, xpos, ypos, xsize, ysize,
+     .			      lab_ht, style, xaxrel, yaxrel )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a key for a plot using a PLOT+ movable label and an ALINE
+* (xsize,ysize) is the size of the "key box" (including the line specimen
+* (xpos,ypos) is the lower left corner of the box
+* as of V2.00 of FERRET the "style" is always line specimen to left of text
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:	  2/2/90
+* V301:  11/5/93 - define PLOT+ symbol "LABKEY" with the key string
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'plot_setup.parm'
+	include	'xplot_setup.cmn'
+	include 'axis_inc.decl'	! axis lengths
+	include 'AXIS.INC'	! axis lengths
+#ifdef NO_PASSED_CONCAT
+	include 'xrisc.cmn'
+#endif
+
+* calling argument declarations
+	INTEGER line_num, style, xaxrel, yaxrel
+	REAL	xpos, ypos, xsize, ysize, lab_ht
+	CHARACTER string*(*)
+
+* internal variable declarations
+	REAL	xmid, ymid, xll, yll, dxlen, dylen
+
+	dxlen = xlen
+	dylen = ylen
+* adjust positions relative to axis lengths if requested
+	xll = xpos
+	yll = ypos
+	IF ( xaxrel .EQ. lab_loc_axlen_plus ) THEN
+	   xll = xll + dxlen
+	ELSEIF ( xaxrel .EQ. lab_loc_axlen_times ) THEN
+	   xll = xll * dxlen
+	ENDIF
+	IF ( yaxrel .EQ. lab_loc_axlen_plus ) THEN
+	   yll = yll + dylen
+	ELSEIF ( yaxrel .EQ. lab_loc_axlen_times ) THEN
+	   yll = yll * dylen
+	ENDIF
+
+* x,y coords. of line specimen right end
+	xmid = xll + xsize*key_line_frac
+	ymid = yll + ysize*0.5
+
+* instruct PLOT+ to draw line specimen: "ALINE/NOUSER 3 2.5 -1.5 3.0 -1.5 ON"
+	WRITE ( ppl_buff, 3000) line_num, xll, ymid, xmid, ymid
+ 3000	FORMAT( 'ALINE/NOUSER ',I3,4F9.3,' ON')
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+
+* instruct PLOT+ to write the key text
+* ... x coord of text left end
+	xmid = xmid + xsize*0.05
+	CALL BOX_LABEL( ppl_movlab,
+     .			string, xmid, yll, xsize*(.95-key_line_frac), ysize,
+     .			lab_ht, ppl_left_just, xaxrel, yaxrel )
+
+* define a PLOT+ symbol LABKEY
+#ifdef NO_PASSED_CONCAT
+	risc_buff = string
+	CALL PPLCMD ( from, line, 0, 'SET LABKEY '//risc_buff, 1, 1 )
+#else
+	CALL PPLCMD ( from, line, 0, 'SET LABKEY '//string, 1, 1 )
+#endif
+
+	RETURN
+	END
diff --git a/fer/plt/put_label.F b/fer/plt/put_label.F
new file mode 100644
index 0000000..fb5a181
--- /dev/null
+++ b/fer/plt/put_label.F
@@ -0,0 +1,242 @@
+	SUBROUTINE PUT_LABEL(	labnum,
+     .				xpos, ypos,
+     .				justify,
+     .				labht,
+     .				string,
+     .				xaxrel, yaxrel )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* define a single label to PPLUS after checking to see if it needs to be shrunk
+* save its definition in a PPLUS symbol for customizing by user
+* possibly place the label on the plot relative to axis lengths
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/14/87
+* revision 0.1 - 9/23/87 - removed @AS - implied via DFLTFNT command
+* revision 0.2 - 3/23/88 - replaced @AS using SET MODE FONT_ASCII
+* revision 0.3 - 4/7/88  - added PPLUS symbol definition
+* revision 0.4 - 9/8/88  - added *axrel - relative to axis length calc.
+* revision 0.5 - 9/21/88 - no action if no_labels
+* V200:   1/3/89 - label numbers maintained internally
+*		 - no automatic shrinking of text string (maxlen removed)
+*		 - plot5_cmnd --> ppl_buff
+*		 - AS and AC fonts put into label but not into symbol
+* Unix/RISC port - 2/91 - cannot "//" with CHAR*(*) variables
+*                       - cannot use char functions in write stmts
+* V320: 8/18/94	- *kob* IBM port - need to use intrinsic function REAL instead
+*			           of SNGL for ibm
+* V400: 6/22/95 - *sh* define movable label numbers as symbols when requested
+*		  (requested by subtracting axis number from ppl_movlab)
+* V420: 2/1/96  - *sh* If "string" is blank output "<ESC>@AC" to wipe out
+*		   previous label
+* V510: *sh8 3/00 - add DODS URL label
+* V533: *sh8 7/01 - if label contains single tic marks double them so PLOT+
+*		    doesn't try to interpret symbols
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+* 7/10 *acm* - ticket 1747: LABNUM_CALEN for automatically generated CALENDAR
+*              label, points to the PPL LAB# number.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*      *kms* 5/12 Always use generic REAL instead of specific SNGL 
+*                 (SNGL must have a double-precision or complex argument)
+* V68  *acm* 5/12  Dont write the font to xlab, ylab if they are blank strings.
+* V686 *acm* 12 13 set up the label symbols LABNUM_E and LABNUM_F
+
+	include 'tmap_dims.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_setup.cmn'
+	include 'xtext_info.cmn'
+	include 'axis_inc.decl'	! axis lengths
+	include 'AXIS.INC'		! axis lengths
+	include 'xrisc.cmn'		! to fix RISC FORTRAN bug
+
+* PLOT+ parameter fom PPLV11INC:PARAMPL5.DAT
+	INTEGER		nlabs
+	PARAMETER     ( nlabs=50 )
+
+* calling argument declarations:
+	INTEGER		labnum, justify, xaxrel, yaxrel
+	REAL		xpos, ypos, labht
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER		flen, lsym, ii
+	CHARACTER	TM_FMT*4, font*3, buf4*4,
+     .			labname(ppl_dset:ppl_calendar)*6
+	REAL 		xp, yp
+
+* local parameter declarations:
+	INTEGER		maxsym, len_in, i
+	CHARACTER*1	esc
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( esc = o'033' ,
+#else
+	PARAMETER     ( esc = CHAR(27),
+#endif
+     .			maxsym = 102   )! max. symbol length for PPLUS (PPL bug)
+
+* data initialization
+	DATA labname(ppl_dset)/'DSET'/,
+     .	     labname(ppl_aspect)/'ASPECT'/,
+     .	     labname(ppl_year)/'YEAR'/,
+     .	     labname(ppl_datitl)/'DATITL'/,
+     .	     labname(ppl_offset)/'OFFSET'/,
+     .	     labname(ppl_dodsurl)/'DODS'/,
+     .	     labname(ppl_calendar)/'CALEND'/
+
+
+* if label has single tic marks double them so PLOT+ doesnt interpret symbols
+	IF ( INDEX(string,"'date'") .GT. 0 ) THEN
+* ... hack to let PLOT+ date time symbols be evaluated (using single tics)
+	  risc_buff = string
+	  len_in = MIN( size_rbuff, LEN(string) )
+	ELSE
+	  risc_buff = ' '
+	  len_in = MIN( size_rbuff-1, LEN(string) )
+	  len_rbuff = 0
+	  DO i = 1, len_in
+	    len_rbuff = len_rbuff+1
+	    risc_buff(len_rbuff:len_rbuff) = string(i:i)
+	    IF (string(i:i) .EQ. "'") THEN
+	      len_rbuff = len_rbuff+1
+	      risc_buff(len_rbuff:len_rbuff) = "'" ! 2 tics together
+	    ENDIF
+	  ENDDO
+	ENDIF
+
+* adjust positions relative to axis lengths if requested
+	xp = xpos
+	yp = ypos
+	IF ( xaxrel .EQ. lab_loc_axlen_plus ) THEN
+	   xp = xp + xlen
+	ELSEIF ( xaxrel .EQ. lab_loc_axlen_times ) THEN
+	   xp = xp * xlen
+	ENDIF
+	IF ( yaxrel .EQ. lab_loc_axlen_plus ) THEN
+	   yp = yp + ylen
+	ELSEIF ( yaxrel .EQ. lab_loc_axlen_times ) THEN
+	   yp = yp * ylen
+	ENDIF
+
+* PPLUST symbols strings cannot exceed maxsym
+	lsym = MIN( maxsym, len_rbuff )
+
+* select PLOT+ font
+	IF ( string .EQ. ' ' ) THEN
+	   font = esc // '@AC '
+	ELSEIF ( .NOT.mode_font_ascii ) THEN
+	   font = ' '
+	ELSEIF ( labnum .EQ. ppl_title ) THEN
+	   font = '@AC'
+	ELSE
+	   font = '@AS'
+	ENDIF
+
+* Let user select the font if they want
+
+        IF (string(1:1) .EQ. "@") THEN
+           font = ' '
+        ENDIF
+
+* define the label to PPLUS
+	IF     ( labnum .EQ. ppl_title ) THEN
+* ... TITLE
+	   WRITE ( ppl_buff, 3200) labht, font//risc_buff(:len_rbuff)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3500 ) 'TIT', risc_buff(:lsym)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	ELSEIF ( labnum .EQ. ppl_xlab ) THEN
+* ... XLAB
+	   IF (risc_buff(:len_rbuff) .NE. ' ') 
+     .			CALL PPLCMD( from, line, 0,
+     .			'XLAB '//font//risc_buff(:len_rbuff), 1, 1 )
+	   WRITE ( ppl_buff, 3300 ) labht
+	   CALL PPLCMD( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3500 ) 'X', risc_buff(:lsym)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	ELSEIF ( labnum .EQ. ppl_ylab ) THEN
+* ... YLAB
+	   IF (risc_buff(:len_rbuff) .NE. ' ') 
+     .			CALL PPLCMD( from, line, 0,
+     .			'YLAB '//font//risc_buff(:len_rbuff), 1, 1 )
+	   WRITE ( ppl_buff, 3400 ) labht
+	   CALL PPLCMD( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3500 ) 'Y', risc_buff(:lsym)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	ELSE
+* ... LABS (PLOT+ movable labels)
+	   nlabs_on = nlabs_on + 1
+* ... check for PLOT+ limit (no error chack there)
+	   IF ( nlabs_on .GT. nlabs ) CALL WARN( 'PLOT+ label limit exceeded' )
+	   WRITE ( ppl_buff, 3000 ) nlabs_on,xp,yp,justify,
+     .				    font//risc_buff(:len_rbuff)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3100 ) nlabs_on, labht
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+#ifdef double_p
+           buf4 = TM_FMT(DBLE(nlabs_on),3,3,flen)      ! for Unix/RISC
+#else
+           buf4 = TM_FMT(REAL(nlabs_on),3,3,flen)      ! for Unix/RISC
+#endif
+	   WRITE ( ppl_buff, 3500 ) buf4(:flen),  risc_buff(:lsym)
+	   CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+* ... define a PLOT+ symbol containing the label number "SET LABNUM_X 4"
+*	or LABNUM_DSET, LABNUM_YEAR, etc.
+	   ii = ppl_movlab - labnum
+	   IF ( ii.GE.1 .AND. ii.LE.nferdims ) THEN
+	      WRITE ( ppl_buff, 3500 )
+     .			"num_"//ww_dim_name(ii), buf4(:flen)
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   ELSEIF ( ii.GE.ppl_dset  .AND. ii.LE.ppl_calendar ) THEN
+	      WRITE ( ppl_buff, 3500 )
+     .			"num_"//labname(ii), buf4(:flen)
+	      CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   ENDIF
+	ENDIF
+
+* successful completion every time
+	RETURN
+ 3000	FORMAT('LABS/NOUSER ',I3,1X,2(F6.2,1X),I3,1X,A)
+ 3100	FORMAT('HLABS ',I3,1X,F6.3 )
+ 3200	FORMAT('TITLE ',F6.3,1X,A)
+ 3300   FORMAT('LABSET,,', F6.3 )	! "LABSET,,x.x"
+ 3400   FORMAT('LABSET,,,', F6.3 )	! "LABSET,,,x.x"
+ 3500   FORMAT('SET LAB',A,1X, A)	! "SET LABxxx string"
+	END
diff --git a/fer/plt/re_orient.F b/fer/plt/re_orient.F
new file mode 100644
index 0000000..aa310c3
--- /dev/null
+++ b/fer/plt/re_orient.F
@@ -0,0 +1,197 @@
+      SUBROUTINE RE_ORIENT( xlo, xhi, ylo, yhi,
+     .			    dim1, dim2, md1, md2, transpz, aspect,
+     .			    xgrid, mx, ygrid, my, sout )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* re-orient vectors so that they point in the correct direction on the plot
+* preserving the overall magnitude
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 4/1/88
+* V200:  5/19/89 - 4D symmetrical
+* V230:  1/24/92 - incorporate COS(lat) if appropriate
+* V301:  11/93 - replace exact zero check with FPEQ
+* V420	 2/96 - calling args changed so /XLIMITS and /YLIMITS can be passed
+*	      - also sout, the returned scale factor, was wrong on plots
+*		that used the COS factor - was based on "s" instead of "s0"
+* V600  4/06 *acm* - make refinement to cos(lat) factor as suggested by A. Wittenberg
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* 6/06 - Fix to Andrew*s correction for XY integ., bug1348
+*12/06 - Fix to cos_factor calculation was STILL wrong. Try VEC/ASPECT plots 
+*        to see the error.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* procedure:	at each point
+*	   x --> xprime = A * x
+*	   y --> yprime = B * y
+*	where
+*	   x**2 + y**2 = xprime**2 + yprime**2
+*	and  A/B = s, a constant
+
+*	let dx		the range of data on the x axis
+*	    dy		the range of data on the y axis
+*	    aspect 	the ratio of axis lengths ylen/xlen
+*	    xscale	the scale factor (units/inch) on the x axis
+*	    s		the ratio of scale factors, yscale/xscale
+*	    tan		the ratio of the vector components y/x at any point
+*	then
+*	    s = (dy/dx)/aspect
+
+*	and, from the constraints on the transformation, above
+*	    B = { (1 + tan**2) / (s**2 + tan**2) } **.5
+*	    A = s * B
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	LOGICAL	transpz
+	INTEGER	dim1, dim2, md1, md2, mx, my
+	REAL	aspect, sout
+	REAL	xgrid( md1, md2 ), ygrid( md1, md2 )
+	REAL*8	xlo, xhi, ylo, yhi
+
+* internal variable declarations:
+        LOGICAL need_cos, GEOG_COS_FACTOR, TM_FPEQ
+	INTEGER	grid, i, j, j0
+	REAL	AXIS_DISTANCE, s0, s, a, b, tan, tansq, ssq, dx, dy,
+     .          bad_x, bad_y, cos_factor, bx, box_size, yh_2, yc, 
+     .          ybxlo, ybxhi
+	REAL*8	TM_WORLD
+
+* initialize
+	grid  = mr_grid( mx )
+	bad_x = mr_bad_data( mx )
+	bad_y = mr_bad_data( my )
+        j0 = mr_lo_ss( mx, y_dim ) - 1  ! may need for latitude cuz j=1,md2
+
+* axis spans in km
+	dx = AXIS_DISTANCE( xlo, xhi, dim1, grid )
+	dy = AXIS_DISTANCE( ylo, yhi, dim2, grid )
+	s0   = (dy/dx) / aspect   ! axis scale ratio before COS(lat) correction
+
+* will we need COS(latitude) corrections ? ( the true dx may be dx*COS(lat) )
+        IF ( dim1.EQ.x_dim .AND. dim2.EQ.y_dim ) THEN
+           need_cos =     GEOG_COS_FACTOR(x_dim, grid)
+     .              .AND. GEOG_COS_FACTOR(y_dim, grid)
+        ELSE
+           need_cos = .FALSE.
+        ENDIF
+
+* re-orient each point
+	DO 110 j = 1, md2
+
+* compute COS(lat) correction at this latitude
+* 3/06 - apply Andrew*s suggested correction, bug1348
+
+	   IF ( need_cos ) THEN
+
+c Previous calculation
+#ifdef double_p
+              yc = deg2rad * (TM_WORLD(j+j0,grid,y_dim,box_middle))
+#else
+              yc = deg2rad * SNGL(TM_WORLD(j+j0,grid,y_dim,box_middle))
+#endif
+              cos_factor = COS( yc )
+  
+c Correction
+              bx = BOX_SIZE(j+j0, grid, y_dim )
+	      yh_2 = 0.5*deg2rad * bx
+              cos_factor =  COS( yc ) * ABS( SIN(yh_2) )/yh_2
+
+C The above are all OK if the coordinate point is in the middle of the box.
+C If the coordinate is not in the middle of the cell then it should be
+C ABS(SIN(yhi)-SIN(ylo))  
+C See this thread:
+C http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00506.html
+C And also ticket 1348.
+
+#ifdef double_p
+              ybxlo = deg2rad* 
+     .          ( TM_WORLD(j+j0,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .          ( TM_WORLD(j+j0,grid,y_dim,box_hi_lim) )
+#else
+              ybxlo = deg2rad* 
+     .          SNGL( TM_WORLD(j+j0,grid,y_dim,box_lo_lim) )
+              ybxhi = deg2rad* 
+     .          SNGL( TM_WORLD(j+j0,grid,y_dim,box_hi_lim) )
+#endif
+
+              cos_factor = ABS( SIN(ybxhi) - SIN(ybxlo) )/(deg2rad * bx)
+
+              IF ( cos_factor .LT. 1.E-6 ) cos_factor = 1.E-6 !arbitrary fix /0
+           ELSE
+              cos_factor = 1.0
+           ENDIF
+           s = s0 / cos_factor
+           IF ( transpz ) s = 1. / s
+           ssq  = s*s
+
+	   DO 100 i = 1, md1
+
+* skip flagged points
+	      IF ( xgrid(i,j).EQ.bad_x .OR. ygrid(i,j).EQ.bad_y ) THEN
+	         xgrid(i,j) = bad_x
+	         ygrid(i,j) = bad_y
+	         GOTO 100
+	      ENDIF
+
+* no rotation on vertical (or horizontal) vectors (avoid y/0)
+	      IF ( TM_FPEQ(xgrid(i,j), 0.0) ) GOTO 100
+
+	      tansq = ( ygrid(i,j)/xgrid(i,j) ) ** 2
+	      b     = SQRT( (1.+tansq) / (ssq+tansq) )
+	      a     = b * s
+
+	      xgrid(i,j) = a * xgrid(i,j)
+	      ygrid(i,j) = b * ygrid(i,j)
+
+ 100	   CONTINUE
+ 110    CONTINUE
+
+* return 1/s to display on plot (generally, s<1)
+	sout = 1. / s0			! bug fix 2/96: was 1./s 
+
+	RETURN
+	END
diff --git a/fer/plt/save_frame.F b/fer/plt/save_frame.F
new file mode 100644
index 0000000..74d606a
--- /dev/null
+++ b/fer/plt/save_frame.F
@@ -0,0 +1,160 @@
+        SUBROUTINE SAVE_FRAME(memory, filename, fformat, annovar,
+     .                        xinches, yinches, xpixels, ypixels, sts)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* make a movie or GIF frame of the current output graphics
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  11/14/89 - based on XEQ_FRAME
+* V320: 5/94 - array "memory" as a calling argument
+*       8/94 - filename added as calling argument
+*       1/95 - major revamp using entirely X code instead of GKS (much faster)
+*              and incorporating GIF output
+*       9/97 - now supports batch mode
+* V500: 4/99 *sh* increased filename string length from 128 to 255
+* 1/03 *kob* g77 port - requires use of risc_buff for concats
+*
+* V6.2  *jli* 5/08 pass background color and transparent to put_frame_batch()
+* PyFr  *kms* 11/11 major rewrite using graphics delegate function call
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* PyFr  *kms*  7/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to FRAME
+* PyFr  *kms*  8/13 Add /ANNOTATE to FRAME; include memory argument
+
+* calling argument declarations:
+        IMPLICIT NONE
+        REAL memory(*)
+        CHARACTER*(*) filename, fformat, annovar
+        REAL*4 xinches, yinches
+        INTEGER xpixels, ypixels, sts
+
+* function return value declarations
+        INTEGER TM_LENSTR
+
+* internal variable declarations:
+        INTEGER windowid, namlen, fmtlen, success, errstrlen, 
+     .          mr, cx, k, memlo, memhi, steplo, stephi, 
+     .          firststr, numstr
+        CHARACTER*2048 errstr
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'xcontext.cmn'
+        INCLUDE 'xplot_state.cmn'
+        INCLUDE 'xvariables.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        namlen = TM_LENSTR(filename)
+        fmtlen = TM_LENSTR(fformat)
+
+* determine the current output window (GKS wkstn ID, that is)
+        DO 10 windowid = 1, max_windows
+           IF ( wn_active(windowid) ) GOTO 110
+   10   CONTINUE
+
+*       Sanity checks
+  110   IF ( (windowid .LT. 1) .OR. 
+     .       (windowid .GT. maxwindowobjs) ) THEN
+            STOP 'SAVE_FRAME: Invalid windowid value'
+        ENDIF
+        IF ( windowobjs(windowid) .EQ. nullobj ) THEN
+            STOP 'SAVE_FRAME: null windowobj'
+        ENDIF
+
+*       Get the annotation strings to add at the top
+        IF ( annovar .NE. ' ' ) THEN
+*           Get the string array given by the variable named in annovar
+            CALL GET_FER_COMMAND(memory, 'LOAD ' // annovar, sts, *5200)
+            IF ( sts .NE. FERR_OK ) GOTO 5200
+*           Get the string data into memory
+            CALL GET_CMND_DATA(memory, cx_last, ptype_string, sts)
+            IF ( sts .NE. FERR_OK ) GOTO 5200
+            mr = is_mr(isp)
+            cx = is_cx(isp)
+*           Starting place in memory for this array of pointers to C strings
+            firststr = (mr_blk1(mr) - 1) * mem_blk_size
+*           If the whole array was not specified, a new copy of the data
+*           has been made in memory with unit increments (or so it appears).
+            numstr = 0
+            DO 120 k = 1,nferdims
+                memlo = mr_lo_ss(mr,k)
+                memhi = mr_hi_ss(mr,k)
+                steplo = cx_lo_ss(cx,k)
+                stephi = cx_hi_ss(cx,k)
+                IF ( (memlo .NE. unspecified_int4) .OR.
+     .               (memhi .NE. unspecified_int4) ) THEN
+                   IF ( (steplo .NE. memlo) .OR.
+     .                  (stephi .NE. memhi) ) GOTO 5400
+                   IF ( numstr .EQ. 0 ) THEN
+                       numstr = stephi - steplo + 1
+                   ELSE
+                       numstr = numstr * (stephi - steplo + 1)
+                   ENDIF
+                ENDIF
+  120       CONTINUE
+            IF ( numstr .LE. 0 ) GOTO 5400
+        ELSE
+            firststr = 0
+            numstr = 0
+        ENDIF
+
+        CALL FGDWINSAVE(success, windowobjs(windowid), filename,
+     .                  namlen, fformat, fmtlen, transparent, 
+     .                  xinches, yinches, xpixels, ypixels,
+     .                  memory, firststr, numstr)
+        IF ( success .EQ. 0 ) GOTO 5100
+
+* successful completion
+        sts = ferr_ok
+ 5000   RETURN
+
+* error exit
+ 5100   errstr = ' '
+        CALL FGDERRMSG(errstr, errstrlen)
+        CALL ERRMSG(ferr_invalid_command, sts, errstr, *5000)
+ 5200   errstr = 'problems evaluating ' // annovar
+        CALL ERRMSG(ferr_invalid_command, sts, errstr, *5000)
+ 5300   errstr = annovar//' is not a string array'
+        CALL ERRMSG(ferr_invalid_command, sts, errstr, *5000)
+ 5400   errstr = annovar//' is not a valid string array'
+        CALL ERRMSG(ferr_invalid_command, sts, errstr, *5000)
+ 
+        END
+
diff --git a/fer/plt/save_ppl_values.F b/fer/plt/save_ppl_values.F
new file mode 100644
index 0000000..e4e435b
--- /dev/null
+++ b/fer/plt/save_ppl_values.F
@@ -0,0 +1,90 @@
+        SUBROUTINE SAVE_PPL_VALUES(windid)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY 
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*  save the ppl size values for this window in the wn_...() arrays
+*  currently not used because ferret changes these values for viewports
+
+        IMPLICIT NONE
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'ferret.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'xplot_state.cmn'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'plt_inc.decl'
+        INCLUDE 'PLT.INC'         ! width, height
+        INCLUDE 'axis_inc.decl'
+        INCLUDE 'AXIS.INC'        ! xlen, xcsize, xorg, ylen, ycsize, yorg
+        INCLUDE 'tics_inc.decl'
+        INCLUDE 'TICS.INC'        ! tsmx, tlx, tsmy, tly
+        INCLUDE 'taxis_inc.decl'
+        INCLUDE 'TAXIS.INC'       ! tcsize
+        INCLUDE 'labcom_inc.decl'
+        INCLUDE 'LABCOM.INC'      ! hlab1, hxlab, hylab, hlabs
+        INCLUDE 'cont_inc.decl'
+        INCLUDE 'CONT.INC'        ! hgt
+        INCLUDE 'dashzz_inc.decl'
+        INCLUDE 'DASHZZ.INC'      ! dslab, dashln, spacln
+        INCLUDE 'vector_inc.decl'
+        INCLUDE 'VECTOR.INC'      ! vlen
+
+* argument declaration
+        INTEGER windid
+
+        wn_xinches(windid)   = width
+        wn_yinches(windid)   = height
+        wn_xwhitelo(windid)  = xorg
+        wn_ywhitelo(windid)  = yorg
+        wn_xwhitehi(windid)  = width - xlen - xorg
+        wn_ywhitehi(windid)  = height - ylen - yorg
+        wn_tics_smx(windid)  = tsmx
+        wn_tics_lgx(windid)  = tlx
+        wn_tics_smy(windid)  = tsmy
+        wn_tics_lgy(windid)  = tly
+        wn_axlsze_x(windid)  = xcsize
+        wn_axlsze_y(windid)  = ycsize
+        wn_txlsze(windid)    = tcsize
+        wn_labset_mn(windid) = hlab1
+        wn_labset_x(windid)  = hxlab
+        wn_labset_y(windid)  = hylab
+        wn_labset_mv(windid) = hlabs
+        wn_con_hgt(windid)   = hgt
+        wn_con_labsp(windid) = dslab
+        wn_con_dshln(windid) = dashln
+        wn_con_spcln(windid) = spacln
+        wn_vec_len(windid)   = vlen
+
+        RETURN
+        END
diff --git a/fer/plt/seg_off.F b/fer/plt/seg_off.F
new file mode 100644
index 0000000..fc39f68
--- /dev/null
+++ b/fer/plt/seg_off.F
@@ -0,0 +1,66 @@
+      SUBROUTINE SEG_OFF()
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* turn off current GKS segment
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/30/88
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+* ...
+
+* local variable declarations:
+* ...
+
+	include 'tmap_dims.parm'
+	include	'xprog_state.cmn'		! with mode_segment
+	include 'pltcom_dat.decl'	! with gksopn
+	include 'PLTCOM.DAT'	! with gksopn
+
+	IF ( .NOT. mode_segment			! not using segments
+     .	.OR. .NOT. gksopn	) RETURN	! not a VAXstation
+
+* close current segment
+	CALL FGD_GCLSG( )
+
+	RETURN
+	END
diff --git a/fer/plt/seg_on.F b/fer/plt/seg_on.F
new file mode 100644
index 0000000..a0e416b
--- /dev/null
+++ b/fer/plt/seg_on.F
@@ -0,0 +1,78 @@
+      SUBROUTINE SEG_ON ( )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* turn on GKS segment
+* ( this permits re-sizing of windows )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/30/88
+* revision 0.1 - 8/26/88 - moved segment name to XPLOT_STATE
+*			   set vp_segn
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+*	...
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xprog_state.cmn'		! with mode_segment
+	include	'xplot_state.cmn'
+	include	'gkscm1_inc.decl'	! with wsid
+	include	'GKSCM1.INC'	! with wsid
+	include 'pltcom_dat.decl'	! with gksopn
+	include 'PLTCOM.DAT'	! with gksopn
+
+	IF ( .NOT. mode_segment			! not using segments
+     .	.OR. .NOT. gksopn	) RETURN	! not a VAXstation
+
+* make up a segment name
+	curr_seg_name = curr_seg_name + 1
+	IF ( curr_seg_name .EQ. 10000 ) curr_seg_name = 1	! avoid overflow
+
+* create segment
+	CALL FGD_GCRSG( curr_seg_name )
+
+* store its name as the highest segment in the viewport
+	vp_segn( vp_num ) = curr_seg_name
+
+	RETURN
+	END
diff --git a/fer/plt/send_pltype.F b/fer/plt/send_pltype.F
new file mode 100644
index 0000000..0ac3a1c
--- /dev/null
+++ b/fer/plt/send_pltype.F
@@ -0,0 +1,77 @@
+	SUBROUTINE SEND_PLTYPE( meta )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* send the PLTYPE command to PPLUS including workstation type and metafile
+* information
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:   1/5/90
+* V230:  2/11/92 - (SUN port) fixed bug that "WS=DEFAULT" was sent to PPLUS
+*        11/9/92 - eliminate device dependence (no WS=, no META=)
+* V310:  12/4/94 - use mode_GKS to determine what PLTYPE to send
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	LOGICAL meta
+
+* local veriable declarations:
+	INTEGER	TM_LENSTR1
+
+	include 'tmap_dims.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_setup.cmn'
+	include 'xgks_devices.cmn'
+
+* command format: "PLTYPE 3 META"
+	IF ( mode_gks ) THEN
+	   ppl_buff = 'PLTYPE 3'
+	ELSE
+	   ppl_buff = 'PLTYPE 1'	!  4/94
+	ENDIF
+
+* append META=device
+	IF ( meta ) ppl_buff = ppl_buff(:8)//' META'
+
+* send it
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+
+	RETURN
+	END
diff --git a/fer/plt/set_ax_sizes.F b/fer/plt/set_ax_sizes.F
new file mode 100644
index 0000000..8f0d955
--- /dev/null
+++ b/fer/plt/set_ax_sizes.F
@@ -0,0 +1,88 @@
+	SUBROUTINE SET_AX_SIZES( xfrac, yfrac,
+     .			         xspc_lo, yspc_lo, xspc_hi, yspc_hi )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* adjust PPLUS AXLEN and ORIGIN commands to fit current plot size
+* xfrac and yfrac allow viewports to specify fractions of the window size
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  11/5/92 - removed from SET_PLOT_SIZE for auto-viewports
+* V301:  11/3/93 - set PLOT+ symbols VP_WIDTH and VP_HEIGHT
+* V540 *sh* 9/01 - white space limits passed as arguments
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'plot_setup.parm'
+        include 'xplot_setup.cmn'      ! 10/91 for saved_ppl_yax
+        include 'plt_inc.decl'     ! with width/height
+        include 'PLT.INC'
+
+* calling argument declarations:
+        REAL*4 xfrac, yfrac, xspc_lo, yspc_lo, xspc_hi, yspc_hi
+
+* internal variable declarations:
+	INTEGER slen
+	REAL	xaxlen, yaxlen, xsize, ysize
+	CHARACTER TM_FMT*8, buff*24
+
+* calculate plot size
+	xsize = xfrac*width
+	ysize = yfrac*height
+        xaxlen = MAX( 0.001, xsize - (xspc_lo+xspc_hi) )
+        yaxlen = MAX( 0.001, ysize - (yspc_lo+yspc_hi) )
+
+* tell axis lengths to PPLUS
+	WRITE ( buff, 3000 ) xaxlen, yaxlen
+	CALL PPLCMD ( from, line, 0, 'AXLEN '//buff, 1, 1 )
+ 3000	FORMAT(2F12.3)
+
+* define viewport size symbols to PLOT+ (11/93)
+	xsize  = MAX( 0.001, xsize )
+	ysize  = MAX( 0.001, ysize )
+	buff = TM_FMT(xsize,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_WIDTH '//buff, 1, 1 )
+	buff = TM_FMT(ysize,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_HEIGHT '//buff, 1, 1 )
+
+* unsave previous values and set the origin
+        saved_ppl_yax = .FALSE.
+	WRITE ( buff, 3000 ) xspc_lo, yspc_lo
+	CALL PPLCMD ( from, line, 0, 'ORIGIN '//buff, 1, 1 )
+
+	RETURN
+	END
diff --git a/fer/plt/set_graticules.F b/fer/plt/set_graticules.F
new file mode 100644
index 0000000..0a964f9
--- /dev/null
+++ b/fer/plt/set_graticules.F
@@ -0,0 +1,445 @@
+	SUBROUTINE SET_GRATICULES(loch, locv, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* parse qualifier text to set up horizontal and vertical graticule lines 
+* extending the tic marks across plots.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* Ferret v5.54   2/04
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+* V570 *acm* 6/30/04 VGRAT with no argument needs to default to lines
+* v580 *acm* 11/04   PLOT/HGRAT gave both horiz and vertical graticules
+*                    need to initialize buff.
+* V6.2  *acm& 2/09 Fix choice of color settings with /PEN and /THICK when we have 
+*                  increased the num of colors with MODE linecolors
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* PyFr  *kms* 7/13 EQUAL_COLOR now returns a color ID, and EQUAL_THICK 
+*                  returns a pen ID from a color ID and a thickness.
+*                  Only standard lines accepted for graticules at this time.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'command.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+
+* calling argument declarations:
+	INTEGER	loch, locv, status
+
+* internal variable declarations:
+	LOGICAL linetype, dashtype, thick, colr, small
+
+	INTEGER	TM_LENSTR1, STR_UPCASE, str_len, ii, i1, i2, i3, i4, 
+     .      i5, i6, index1, index2, s1, s2, 
+     .      colorcode, tic1, ntic, itic, iflag, ncolors, pencode
+
+        REAL*4 thickness
+
+	CHARACTER buff*1058
+        CHARACTER msg*60
+
+
+! Default, standard tics, no lines across plot.
+
+        buff = ' '
+
+        DO 100 ii = 1, 4
+          hgrat(ii,1) = 0.
+          hgrat(ii,2) = 0.
+          vgrat(ii,1) = 0.
+          vgrat(ii,2) = 0.
+100     CONTINUE
+
+        hcolor(1) = 1   ! default color is black
+        hcolor(2) = 1
+        vcolor(1) = 1
+        vcolor(2) = 1
+
+* If MODE GRAT was set, make those settings.  Any settings
+* made on the command line will override these.
+
+        IF (grat_on .AND. ((loch .EQ. 0) .AND. (locv .EQ. 0)) ) THEN
+           DO 101 ii = 1, 4
+             hgrat(ii,1) = -1.
+             hgrat(ii,2) = 0.
+             vgrat(ii,1) = -1.
+             vgrat(ii,2) = 0.
+101        CONTINUE
+
+           iflag = STR_UPCASE (buff, mode_grat_buff)
+        ENDIF
+
+* HGRAT
+        IF (.NOT. grat_on) buff = ' ' 
+        IF (loch .GT. 0) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(loch):qual_end(loch)),
+     .                     buff, status )
+
+* /HGRAT with no argument defaults to lines at large tic marks.
+
+           DO 105 ii = 1, 4
+             hgrat(ii,1) = -1.
+105        CONTINUE
+
+        ENDIF
+
+        IF ( buff .EQ. ' ' ) GOTO 4999
+
+        str_len = TM_LENSTR1(buff)
+        i1 = 1
+        IF (buff(1:1) .EQ. '(') i1 = 2
+        i2 = str_len
+
+        tic1 = 1   ! LARGE tics by default
+        ntic = 1
+        
+        index1 = i1
+        index2 = i2
+
+        IF ( INDEX(buff(i1:i2), 'LAR') .GT. 0) THEN
+           tic1 = 1   ! LARGE tics
+           i3 = INDEX(buff(i1:i2), 'LAR' )
+           i4 = MIN(INDEX(buff(i3:i2), 'SMA'), INDEX(buff(i3:i2), ')' ) )
+           IF (i4 .GT. 0) THEN
+              i4 = i4 + i3 - 2
+           ELSE
+              I4 = i2
+           ENDIF
+
+           index1 = i3
+           index2 = i4
+        ENDIF
+
+        small = .FALSE.
+        IF ( INDEX(buff(i1:i2), 'SMA') .GT. 0) small = .TRUE.
+        IF (small) THEN
+           i5 = INDEX(buff(i1:i2), 'SMA')
+           i6 = MIN(INDEX(buff(i5:i2), 'LAR'), INDEX(buff(i5:i2), ')' ) )
+           IF (i6 .GT. 0) THEN
+              i6 = i6 + i5 - 2
+           ELSE
+              i6 = i2
+           ENDIF
+
+           ntic = 2
+
+* If only small requsted, reset lines at large tics to off
+
+           IF (INDEX(buff(i1:i2), 'LAR') .LE. 0) THEN
+              tic1 = 2
+
+              DO 106 ii = 1, 4
+                hgrat(ii,1) = -0.
+106           CONTINUE
+
+              index1 = i5
+              index2 = i6
+
+           ENDIF
+        ENDIF
+
+        DO itic = tic1, ntic
+
+* By default use solid lines
+           DO 110 ii = 1, 4
+              hgrat(ii,itic) = -1.
+110        CONTINUE
+
+           IF (buff(index1:index1) .EQ. '(') index1 = index1 + 1
+           IF (buff(index2:index2) .EQ. ')') index2 = index2 - 1
+
+           linetype = INDEX(buff(index1:index2), 'LIN') .GT. 0
+           dashtype = INDEX(buff(index1:index2), 'DAS') .GT. 0
+           thick = INDEX(buff(index1:index2), 'THI') .GT. 0
+           colr = INDEX(buff(index1:index2), 'COL') .GT. 0
+
+           IF (linetype .AND. dashtype) THEN
+              CALL WARN (
+     .         '/HGRAT specified with both LINE and DASH, using LINE')
+              dashtype = .FALSE.
+           ENDIF
+
+           IF (linetype) THEN
+              hgrat(1,itic) = -1.  ! for solid lines
+              hgrat(2,itic) = -1.
+              hgrat(3,itic) = -1.
+              hgrat(4,itic) = -1.
+
+           ELSE IF (dashtype) THEN
+              hgrat(1,itic) = 0.03  ! set default values
+              hgrat(2,itic) = 0.05
+              hgrat(3,itic) = 0.0
+              hgrat(4,itic) = 0.0
+           ENDIF
+
+           hcolor(itic) = 1
+           thickness = 1.0   ! default to a thin black line 
+
+           IF (colr) THEN
+              s1 = INDEX(buff(index1:index2), 'COL') + index1 - 1
+              s2 = INDEX(buff(s1:index2), ',')
+              IF (s2 .EQ. 0) THEN
+                 s2 = index2
+              ELSE
+                 s2 = s2 + s1 - 2
+              ENDIF 
+              IF (INDEX(buff(s1:s2), '=') .GT. 0) THEN
+                 CALL EQUAL_COLOR(buff(s1:s2), colorcode, thickness, status)
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+                 hcolor(itic) = colorcode
+              ELSE
+                 WRITE (msg, 40) buff(s1:s2)
+  40             FORMAT ( 'No color code given for /HGRAT=',A , 
+     .                    '. Using black')
+                 CALL WARN (msg)
+              ENDIF
+           ENDIF
+
+           IF (thick) THEN
+              s1 = INDEX(buff(index1:index2), 'THI') + index1 - 1
+              s2 = INDEX(buff(s1:index2), ',') 
+              IF (s2 .EQ. 0) THEN
+                 s2 = index2
+              ELSE
+                 s2 = s2 + s1 - 2
+              ENDIF 
+*             get the pen for the color and the thickness specified in buff
+              CALL EQUAL_THICK(buff(s1:s2), thickness, hcolor(itic), 
+     .                         pencode, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ELSE
+*             get the pen for the color and the default thickness
+              CALL EQUAL_THICK(' ', thickness, hcolor(itic), 
+     .                         pencode, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+ 
+*          At this time, only standard lines are accepted
+           ncolors = mode_arg(pmode_linecolors,1)
+           IF ( (pencode .LT. 1) .OR. (pencode .GT. 3*ncolors) ) GOTO 5150
+
+*          Assign the pen to use
+           hcolor(itic) = pencode
+
+           index1 = i5
+           index2 = i6
+
+        ENDDO  ! back to to small htics, if requested.
+
+* 
+ 4999   CONTINUE
+
+*  /VGRAT
+
+        IF (.NOT. grat_on) buff = ' ' 
+        IF (locv .GT. 0) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(locv):qual_end(locv)),
+     .                     buff, status )
+
+* /VGRAT with no argument defaults to lines at large tic marks.
+
+           DO 115 ii = 1, 4
+             vgrat(ii,1) = -1.
+115        CONTINUE
+
+        ENDIF
+	IF ( buff .EQ. ' ' ) GOTO 5000  ! done
+
+        str_len = TM_LENSTR1(buff)
+        i1 = 1
+        IF (buff(1:1) .EQ. '(') i1 = 2
+        i2 = str_len
+
+        tic1 = 1   ! LARGE tics by default
+        ntic = 1
+        
+        index1 = i1
+        index2 = i2
+
+        IF ( INDEX(buff(i1:i2), 'LAR') .GT. 0) THEN
+           tic1 = 1   ! LARGE tics
+           i3 = INDEX(buff(i1:i2), 'LAR' )
+
+           i4 = MIN(INDEX(buff(i3:i2), 'SMA'), INDEX(buff(i3:i2), ')' ) )
+           IF (i4 .GT. 0) THEN
+              i4 = i4 + i3 - 2
+           ELSE
+              I4 = i2
+           ENDIF
+           
+           index1 = i3
+           index2 = i4
+        ENDIF
+
+        small = .FALSE.
+        IF ( INDEX(buff(i1:i2), 'SMA') .GT. 0) small = .TRUE.
+        IF (small) THEN
+           i5 = INDEX(buff(i1:i2), 'SMA')
+
+           i6 = MIN(INDEX(buff(i5:i2), 'LAR'), INDEX(buff(i5:i2), ')' ) )
+           IF (i6 .GT. 0) THEN
+              i6 = i6 + i5 - 2
+           ELSE
+              i6 = i2
+           ENDIF
+           
+           ntic = 2
+
+* If only small requsted, reset lines at large tics to off
+
+           IF (INDEX(buff(i1:i2), 'LAR') .LE. 0) THEN
+              tic1 = 2
+
+              DO 116 ii = 1, 4
+                vgrat(ii,1) = -0.
+116           CONTINUE
+
+              index1 = i5
+              index2 = i6
+
+           ENDIF
+        ENDIF
+
+        DO itic = tic1, ntic
+
+* By default use solid lines
+           DO 120 ii = 1, 4
+              vgrat(ii,itic) = -1.
+120        CONTINUE
+
+           IF (buff(index1:index1) .EQ. '(') index1 = index1 + 1
+           IF (buff(index2:index2) .EQ. ')') index2 = index2 - 1
+
+           linetype = INDEX(buff(index1:index2), 'LIN') .GT. 0
+           dashtype = INDEX(buff(index1:index2), 'DAS') .GT. 0
+           thick = INDEX(buff(index1:index2), 'THI') .GT. 0
+           colr = INDEX(buff(index1:index2), 'COL') .GT. 0
+
+           IF (linetype .AND. dashtype) THEN
+              CALL WARN (
+     .         '/VGRAT specified with both LINE and DASH, using LINE')
+              dashtype = .FALSE.
+           ENDIF
+
+           IF (linetype) THEN
+              vgrat(1,itic) = -1.  ! for solid lines
+              vgrat(2,itic) = -1.
+              vgrat(3,itic) = -1.
+              vgrat(4,itic) = -1.
+
+           ELSE IF (dashtype) THEN
+              vgrat(1,itic) = 0.03 ! set default values
+              vgrat(2,itic) = 0.05
+              vgrat(3,itic) = 0.0
+              vgrat(4,itic) = 0.0
+           ENDIF
+
+           vcolor(itic) = 1
+           thickness = 1.0   ! default to thin black line
+
+           IF (colr) THEN
+              s1 = INDEX(buff(index1:index2), 'COL') + index1 - 1
+              s2 = INDEX(buff(s1:index2), ',')
+              IF (s2 .EQ. 0) THEN
+                 s2 = index2
+              ELSE
+                 s2 = s2 + s1 - 2
+              ENDIF 
+              IF (INDEX(buff(s1:s2), '=') .GT. 0) THEN
+                 CALL EQUAL_COLOR(buff(s1:s2), colorcode, thickness, status)
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+                 vcolor(itic) = colorcode
+              ELSE
+                 WRITE (msg, 60) buff(s1:s2)
+  60             FORMAT ( 'No color code given for /VGRAT=',A , 
+     .                    '. Using black')
+                 CALL WARN (msg)
+              ENDIF
+           ENDIF
+
+           IF (thick) THEN
+              s1 = INDEX(buff(index1:index2), 'THI') + index1 - 1
+              s2 = INDEX(buff(s1:index2), ',') 
+              IF (s2 .EQ. 0) THEN
+                 s2 = index2
+              ELSE
+                 s2 = s2 + s1 - 2
+              ENDIF 
+*             get the pen for the color and the thickness specified in buff
+              CALL EQUAL_THICK(buff(s1:s2), thickness, vcolor(itic), 
+     .                         pencode, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ELSE
+*             get the pen for the color and the default thickness
+              CALL EQUAL_THICK(' ', thickness, vcolor(itic), 
+     .                         pencode, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+ 
+*          At this time, only standard lines are accepted
+           ncolors = mode_arg(pmode_linecolors,1)
+           IF ( (pencode .LT. 1) .OR. (pencode .GT. 3*ncolors) ) GOTO 5150
+
+*          Assign the pen to use
+           vcolor(itic) = pencode
+
+           index1 = i5
+           index2 = i6
+
+        ENDDO  ! back to to small htics, if requested.
+
+* success
+        RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .		buff(:str_len)//' mismatched parentheses', *5000 )
+ 5050	CALL ERRMSG( ferr_syntax, status,
+     .		buff(:str_len), *5000 )
+ 5150   CALL ERRMSG( ferr_invalid_command, status,
+     .          'Only standard line colors and thicknesses '//
+     .          'are accepted at this time', *5000 )
+ 5200	CALL ERRMSG( ferr_invalid_command, status,
+     .		'zero vector length on /LENGTH=', *5000 )
+	END
diff --git a/fer/plt/set_plot_size.F b/fer/plt/set_plot_size.F
new file mode 100644
index 0000000..04965f1
--- /dev/null
+++ b/fer/plt/set_plot_size.F
@@ -0,0 +1,64 @@
+	SUBROUTINE SET_PLOT_SIZE( xsize, ysize )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* adjust PPLUS SIZE command to re-size plot
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 9/16/88 
+* Unix/RISC port - 10/9/91 - unsave previous axis lengths held by
+*                            routine setup_keys
+*                          - also restore the origin
+* V230:  11/5/92 - removed axis resizing to SET_AX_SIZES
+
+ 
+	include 'plot_setup.parm'
+
+* calling argument declarations:
+	REAL*4	xsize, ysize
+
+* internal variable declarations:
+	CHARACTER buff*24
+
+* tell it to PPLUS
+	WRITE ( buff, 3000 ) xsize, ysize
+	CALL PPLCMD ( from, line, 0, 'SIZE '//buff, 1, 1 )
+ 3000	FORMAT(2F12.3)
+
+	RETURN
+	END
diff --git a/fer/plt/set_ppl_values.F b/fer/plt/set_ppl_values.F
new file mode 100644
index 0000000..d00e524
--- /dev/null
+++ b/fer/plt/set_ppl_values.F
@@ -0,0 +1,128 @@
+        SUBROUTINE SET_PPL_VALUES(windid, reset)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY 
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*  Tell ppl about the size values for this window that were stored in 
+*  the wn_...() arrays.  If reset is .TRUE., reset the values in the
+*  wn_...() arrays to default values based on the stored xinches and
+*  yinches values.
+
+        IMPLICIT NONE
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'ferret.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'xplot_setup.cmn'
+        INCLUDE 'xplot_state.cmn'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'cont_inc.decl'
+        INCLUDE 'CONT.INC'        ! hgt
+        INCLUDE 'dashzz_inc.decl'
+        INCLUDE 'DASHZZ.INC'      ! dslab, dashln, spacln
+        INCLUDE 'vector_inc.decl'
+        INCLUDE 'VECTOR.INC'      ! vlen
+
+* argument declaration
+        INTEGER windid
+        LOGICAL reset
+
+* local variables
+        REAL txtfactor
+        REAL*4 rone
+        CHARACTER*48 buff
+
+        rone = 1.0
+
+        pplscale = SQRT( wn_xinches(windid) * wn_yinches(windid)
+     .                   / (dflt_xinches * dflt_yinches) )
+        wn_pplscale(windid) = pplscale
+        IF ( reset ) THEN
+* assign the scaled default lengths
+           wn_xwhitelo(windid)  = dflt_xwhitelo      * pplscale
+           wn_ywhitelo(windid)  = dflt_ywhitelo      * pplscale
+           wn_xwhitehi(windid)  = dflt_xwhitehi      * pplscale
+           wn_ywhitehi(windid)  = dflt_ywhitehi      * pplscale
+           wn_tics_lgx(windid)  = dflt_tics_lg       * pplscale
+           wn_tics_lgy(windid)  = dflt_tics_lg       * pplscale
+           wn_tics_smx(windid)  = dflt_tics_sm       * pplscale
+           wn_tics_smy(windid)  = dflt_tics_sm       * pplscale
+           wn_con_labsp(windid) = dflt_con_labsp     * pplscale
+           wn_con_dshln(windid) = dflt_con_dshln     * pplscale
+           wn_con_spcln(windid) = dflt_con_dshln     * pplscale
+           wn_vec_len(windid)   = dflt_vec_len       * pplscale
+*          reset the text sizes in SET_TEXT_SIZES
+           txtfactor = dflt_textprom
+        ELSE
+*          use the stored text sizes in SET_TEXT_SIZES
+           txtfactor = 0.0
+        ENDIF
+
+*       calls PPL SIZE to set width and height (no actual resizing done)
+        CALL SET_PLOT_SIZE(wn_xinches(windid), wn_yinches(windid))
+
+*       calls PPL commands AXLEN, ORIGIN, SET VP_WIDTH, SET VP_HEIGHT
+        CALL SET_AX_SIZES(rone, rone, 
+     .                    wn_xwhitelo(windid), wn_ywhitelo(windid), 
+     .                    wn_xwhitehi(windid), wn_ywhitehi(windid))
+
+*       set the tic sizes
+        buff = ' '
+        IF ( reset ) THEN
+           WRITE(buff, 100) wn_tics_smx(windid), wn_tics_lgx(windid), 
+     .                      wn_tics_smy(windid), wn_tics_lgy(windid)
+ 100       FORMAT('TICS',4(',',F7.4),',-1,-1')
+        ELSE
+           WRITE(buff, 105) wn_tics_smx(windid), wn_tics_lgx(windid), 
+     .                      wn_tics_smy(windid), wn_tics_lgy(windid)
+ 105       FORMAT('TICS',4(',',F7.4))
+        ENDIF
+        CALL PPLCMD(from, line, 0, buff, 1, 1)
+
+*       the following can just be set directly (no extra actions)
+        dslab  = wn_con_labsp(windid)
+        dashln = wn_con_dshln(windid)
+        spacln = wn_con_spcln(windid)
+        vlen   = wn_vec_len(windid)
+
+*       set the text sizes
+        CALL SET_TEXT_SIZES(windid, txtfactor)
+
+*       set the symbol PPL$SCALE
+        buff = ' '
+        WRITE(buff, 110) pplscale
+ 110    FORMAT('SET PPL$SCALE ',F7.4)
+        CALL PPLCMD(from, line, 0, buff, 1, 1)
+
+        RETURN
+        END
diff --git a/fer/plt/set_text_sizes.F b/fer/plt/set_text_sizes.F
new file mode 100644
index 0000000..af0374b
--- /dev/null
+++ b/fer/plt/set_text_sizes.F
@@ -0,0 +1,99 @@
+        SUBROUTINE SET_TEXT_SIZES(windid, factor)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY 
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*  If factor is positive, reset the wn_...() array text sizes
+*  to the defaults scaled by the given factor and by pplscale.
+*  Always tell ppl about the text sizes assigned in the wn_...() arrays.
+
+        IMPLICIT NONE
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'ferret.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'xplot_setup.cmn'
+        INCLUDE 'xplot_state.cmn'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'cont_inc.decl'
+        INCLUDE 'CONT.INC'        ! hgt
+
+* argument declaration
+        INTEGER windid
+        REAL    factor
+
+* local variables
+        CHARACTER*48 buff
+
+        IF ( factor .GT. 0.0 ) THEN
+*          Reset this windows text scaling factor
+           textscale = factor * pplscale
+           wn_textscale(windid) = textscale
+           wn_axlsze_x(windid)  = dflt_letsize_axis  * textscale
+           wn_axlsze_y(windid)  = dflt_letsize_axis  * textscale
+           wn_txlsze(windid)    = dflt_letsize_axis  * textscale
+           wn_labset_mn(windid) = dflt_letsize_title * textscale
+           wn_labset_x(windid)  = dflt_letsize_label * textscale
+           wn_labset_y(windid)  = dflt_letsize_label * textscale
+           wn_labset_mv(windid) = dflt_letsize_label * textscale
+           wn_con_hgt(windid)   = 0.75 * dflt_letsize_label * textscale
+        ELSE
+*          Assign this windows text scaling factor
+           textscale = wn_textscale(windid)
+        ENDIF
+
+*       set the X and Y axis value labels sizes
+        buff = ' '
+        WRITE(buff, 110) wn_axlsze_x(windid), wn_axlsze_y(windid)
+ 110    FORMAT('AXLSZE',2(',',F7.4))
+        CALL PPLCMD(from, line, 0, buff, 1, 1)
+
+*       set the time axis value labels size
+        buff = ' '
+        WRITE(buff, 120) wn_txlsze(windid)
+ 120    FORMAT('TXLSZE,',F7.4)
+        CALL PPLCMD(from, line, 0, buff, 1, 1)
+
+*       set the title labels sizes
+        buff = ' '
+        WRITE(buff, 130) wn_labset_mn(windid), wn_labset_x(windid), 
+     .                   wn_labset_y(windid), wn_labset_mv(windid)
+ 130    FORMAT('LABSET',4(',',F7.4))
+        CALL PPLCMD ( from, line, 0, buff, 1, 1 )
+
+*       set the contour label values labels size
+*       the following can just be set directly (no extra actions)
+        hgt = wn_con_hgt(windid)
+
+        RETURN
+        END
diff --git a/fer/plt/set_viewport.F b/fer/plt/set_viewport.F
new file mode 100644
index 0000000..baded9b
--- /dev/null
+++ b/fer/plt/set_viewport.F
@@ -0,0 +1,209 @@
+      SUBROUTINE SET_VIEWPORT( ivp )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up the output viewport within the current window
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  8/31/88
+* revision 0.1 -  9/29/88 - allow separate GKS normaliz. trans. for each window
+* V200: 11/30/89 - pass viewport flag to PPLUS
+*	  4/2/90 - clear screen with CLEAR_WINDOW
+* Unix/RISC port - 2/91 - special cases for GKSDEFS include file
+* V230:  11/4/92 - added call to SET_AX_SIZES to auto-size viewport axes
+*        11/9/92 - incorporated SHASET PROTECT to save color tables
+*        3/29/93 - restore the old-style functioning of DEFINE VIEW/SIZE
+* V540: 9/01 *sh* - DEF VIEW/AXES: viewports based on *axis* positions
+* V580: 11/04 *acm* New symbols for viewport scaling
+* V602: *acm* 1/07 Changes for metafile-batch mode
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 No need to delete segments when clearing the whole window
+*                  in PyFerret; FGD_GCLRWK deletes them all in PyFerret.
+*                  No need to protect colors in PyFerret.
+*                  Send an update to make sure the changes are immediately seen.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+	include	'pltcom_dat.decl' ! with sizing data, etc.
+	include	'PLTCOM.DAT'	         ! with sizing data, etc.
+        include 'plt_inc.decl'     ! with width/height
+        include 'PLT.INC'
+	include	'ppl_in_ferret.cmn'	! with ppl_in_ferret
+	include	'gkscm1_inc.decl'	! with gks common
+	include	'GKSCM1.INC'	! with gks common
+!	include 'gksdefs.bnd'		! with gclip
+C  clipping indicator (lines from VMS SYS$LIBRARY:GKSDEFS.BND)
+	INTEGER*4  GNCLIP,GCLIP
+	DATA       GNCLIP,GCLIP/  0,    1/
+	
+* calling argument declarations:
+	INTEGER	ivp
+
+* internal variable declarations:
+	LOGICAL clip, newstyle_vp
+	INTEGER	iseg, i, old_vp, istate
+	REAL	fctx, fcty, xclip, yclip
+	REAL*4  rzero, arg1, arg2, arg3, arg4, r4_unspec, scale, 
+     .          xov, yov, xcv, ycv, xfrac, yfrac,
+     .          xcei, ycei, xoei, yoei
+
+* main window opened yet ?
+	IF ( .NOT.pplus_started ) CALL START_PPLUS(.FALSE.)
+
+* only works under GKS
+	IF ( .NOT. gksopn ) RETURN
+
+	rzero = 0.0
+
+* make this the new viewport
+	old_vp = vp_num
+	vp_num = ivp
+
+* emulate the obsolete /SIZE qualifier?
+	newstyle_vp = vp_size(ivp) .GT. 0.0
+
+	IF ( old_vp .EQ. mvp_dflt .OR. vp_num .EQ. mvp_dflt ) THEN
+* return to full screen - clear away everything
+	   CALL CLEAR_WINDOW( wsid )
+	ELSE
+* set new viewport - delete any segments showing in this viewport
+	   DO 200 iseg = vp_seg0(vp_num)+1, vp_segn(vp_num)
+ 200	   CALL FGD_GDSG( iseg ) 
+	ENDIF
+
+* indicate where new segments in this viewport of this window begin
+	vp_seg0( vp_num ) = curr_seg_name
+	vp_segn( vp_num ) = curr_seg_name
+
+* pass viewport flag to PPLUS
+	PPL_viewports_active = vp_num .NE. mvp_dflt
+
+* For viewport/AXES viewports, update ASIZE and BSIZE here,
+* or else the first viewport plotted is in the wrong place.
+*
+* *kms* - always update in case size has changed;
+*         if nothing changed, SIZE does nothing
+        CALL SIZE (width,height)
+
+* NDC space goes 0 to fctx and 0 to fcty (corresponding to PLOT+ SIZE command)
+	IF(ASIZE.GT.BSIZE)THEN
+	   FCTY=BSIZE/ASIZE
+	   FCTX=1.0
+	ELSE
+	   FCTX=ASIZE/BSIZE
+	   FCTY=1.0
+	ENDIF
+
+* decode clipping
+	r4_unspec = unspecified_val4
+	clip = vp_xclip(vp_num) .NE. r4_unspec
+	IF ( clip ) THEN
+	   xclip = vp_xclip( vp_num )
+	   yclip = vp_yclip( vp_num )
+	ELSE
+	   xclip = 1.0
+	   yclip = 1.0
+	ENDIF
+
+* determine the scale factor to be applied to the axis length to create
+* the "text_prominence" effect
+	scale = 1.0 / SQRT( ABS(vp_size(vp_num)) )
+
+* ... V5.22 default behaviors (viewport not specified by axis)
+        xoei = wn_xwhitelo(wsid)  ! ppl xorigin
+        yoei = wn_ywhitelo(wsid)  ! ppl yorigin
+        xcei = wn_xwhitehi(wsid)  ! white space to right of X axis
+        ycei = wn_ywhitehi(wsid)  ! white space for docmtn at top of plot
+        xov = vp_xorg(vp_num)
+        xcv = xclip
+        yov = vp_yorg(vp_num)
+        ycv = yclip
+        IF (vp_by_axis(vp_num)) THEN
+          CALL VP_AXLIM2LIM( scale, xov, yov, xcv, ycv, xov, yov, xcv, ycv, 
+     .                       xoei, yoei, xcei, ycei)
+        ENDIF
+* set viewport in NDC to limits requested
+
+	arg1 = fctx*xov
+	arg2 = fctx*xcv
+	arg3 = fcty*yov
+	arg4 = fcty*ycv
+	CALL FGD_GSVP(wsid, arg1, arg2, arg3, arg4 )
+
+* set world coordinate window to preserve 1:1 aspect
+	arg1 = ( xcv-xov )*asize*scale
+	arg2 = ( ycv-yov )*bsize*scale
+	CALL FGD_GSWN(wsid, rzero, arg1, rzero, arg2 )
+
+	IF ( newstyle_vp ) THEN
+
+* auto-size the axes to fit the plot window
+           xfrac = scale*(xcv-xov)
+           yfrac = scale*(ycv-yov)
+
+           CALL SET_AX_SIZES( xfrac, yfrac,
+     .                        xoei, yoei, xcei, ycei )
+
+* Set more symbols describing the viewport
+
+           CALL SET_VP_SYMBOLS (scale, vp_size(vp_num), xfrac, yfrac,
+     .			        xoei, yoei, xcei, ycei,
+     .                          xov,  yov,  xcv,  ycv)
+
+	   CALL FGD_GSELNT(wsid)     ! no clipping 11/92 (below) for PPL BOX ON 
+
+	ELSE
+* emulate old-style, non-automated viewports
+* select normalization transformation and turn on clipping
+	   CALL FGD_GSELNT(wsid)
+	   IF ( clip ) THEN
+	      CALL FGD_GSCLIP(gclip)
+	   ELSE
+	      CALL FGD_GSCLIP(gnclip)
+	   ENDIF
+	ENDIF
+
+* make sure the scene is updated to the cleared viewport
+        CALL FGD_GUWK(wsid, 1)
+
+* success
+	RETURN
+	END
diff --git a/fer/plt/set_vp_symbols.F b/fer/plt/set_vp_symbols.F
new file mode 100644
index 0000000..c62712a
--- /dev/null
+++ b/fer/plt/set_vp_symbols.F
@@ -0,0 +1,110 @@
+	SUBROUTINE SET_VP_SYMBOLS( scale, vp_size, xfrac, yfrac,
+     .			           xspc_lo, yspc_lo, xspc_hi, yspc_hi,
+     .                             xov,  yov,  xcv,  ycv)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set additional viewport symbols. Here is what happens with the scaling
+* 11/30/04 change names of margin symbols.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+
+
+ccc    DEFINE VIEWPORT/XLIM=xlo:xyi/YLIM=ylo:yhi[/TEXT=n/ my_view
+ccc
+ccc     vp_size(ivp) = value given by DEF VIEW/TEXT=      ! See xeq_define.F 
+ccc                    or, SQRT( (xhi-xlo)) * (yhi-ylo) )
+ccc
+ccc	scale = 1.0 / SQRT( ABS(vp_size(vp_num)) )        ! See set_viewport.F
+ccc                                                       ! if /TEXT=1, vp_size=1, scale=1
+ccc
+ccc     xfrac = scale*(xhi-xlo)
+ccc     yfrac = scale*(yhi-ylo)
+
+ccc	xsize = xfrac*width                               ! These are the viewport lengths 
+ccc	ysize = yfrac*height                              ! reported by VP_WIDTH, VP_HEIGHT
+
+* 11/16/2004 *acm*  from set_ax_sizes
+
+	include 'plot_setup.parm'
+c        include 'xplot_setup.cmn'      ! 10/91 for saved_ppl_yax
+c        include 'PLT.INC'
+
+* calling argument declarations:
+        REAL*4 vp_size
+        REAL*4 scale, xfrac, yfrac,
+     .       xspc_lo, yspc_lo, xspc_hi, yspc_hi,
+     .       xov,  yov,  xcv,  ycv
+
+* internal variable declarations:
+	INTEGER slen
+	CHARACTER TM_FMT_SNGL*8, buff*24
+
+	buff = TM_FMT_SNGL(scale,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_SCALE '//buff, 1, 1 )
+ 
+c	buff = TM_FMT_SNGL(vp_size,-3,8,slen) 
+c	CALL PPLCMD ( from, line, 0, 'SET VP_SIZE '//buff, 1, 1 )
+
+c	buff = TM_FMT_SNGL(xfrac,-3,8,slen) 
+c	CALL PPLCMD ( from, line, 0, 'SET VP_XSC '//buff, 1, 1 )
+	
+c	buff = TM_FMT_SNGL(yfrac,-3,8,slen) 
+c	CALL PPLCMD ( from, line, 0, 'SET VP_YSC '//buff, 1, 1 )
+        
+c	buff = TM_FMT_SNGL(xspc_lo,-3,8,slen) 
+c	CALL PPLCMD ( from, line, 0, 'SET VP_XORG '//buff, 1, 1 )
+        
+	buff = TM_FMT_SNGL(xspc_hi,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_RT_MARGIN '//buff, 1, 1 )
+        
+c	buff = TM_FMT_SNGL(yspc_lo,-3,8,slen) 
+c	CALL PPLCMD ( from, line, 0, 'SET VP_YORG '//buff, 1, 1 )
+        
+	buff = TM_FMT_SNGL(yspc_hi,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_TOP_MARGIN '//buff, 1, 1 )
+
+	buff = TM_FMT_SNGL(xov,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_XLO '//buff, 1, 1 )
+
+	buff = TM_FMT_SNGL(xcv,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_XHI '//buff, 1, 1 )
+
+	buff = TM_FMT_SNGL(yov,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_YLO '//buff, 1, 1 )
+
+	buff = TM_FMT_SNGL(ycv,-3,8,slen) 
+	CALL PPLCMD ( from, line, 0, 'SET VP_YHI '//buff, 1, 1 )
+
+	RETURN
+	END
diff --git a/fer/plt/set_window.F b/fer/plt/set_window.F
new file mode 100644
index 0000000..4481c67
--- /dev/null
+++ b/fer/plt/set_window.F
@@ -0,0 +1,515 @@
+      SUBROUTINE SET_WINDOW( status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a new output window and de-activate (but don't remove) the last
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 6/28/88
+* revision 0.1 - 8/1/88  - set window/size defaults to current window
+* revision 0.2 - 8/26/88 - added qualifiers /LOCATION
+* revision 0.3 -  9/8/88 - added /ASPECT and /TEXT_PROMINENCE
+* revision 0.4 - 9/29/88 - /ASPECT clears screen to avoid future redraws
+*			 - separate normalization transform for each window
+* V200: 12/15/89 - VAX binding required for Xwindows
+*	12/20/89 - allow all windows to have been cancelled, set up bundles
+*	 3/22/90 - POP the window to the top with an escape function
+*	  4/2/90 - clear screen with CLEAR_WINDOW
+* Unix/RISC port - 2/26/91 - commented out unused SYS$LIBRARY include statement
+*                - TM_LENSTR1 was declared LOGICAL !
+*                - added NEW_GKS_WINDOW for OS independence
+*                - fixed /ASPECT default behavior to consistent "edge" (10/91)
+* V230: 3/92: Sun port - 
+*                - replaced CALL GQDSP with CALL QUERY_DISPLAY_SIZE
+*                  and CALL GSWKVP with CALL SET_WINDOW_SIZE for ATC GKS
+*      10/92:    - update PPL_viewports_active so metafiles start fresh
+*     11/4/92    - change to SET_PLOT_SIZE call for auto viewports
+*         note about ABSIZE/BSIZE v.s. HEIGHT/WIDTH:  They differ in value by
+*              ASIZE = WIDTH*1000  **and** asize,bsize are updated **after**
+*              the next plot is produced whereas width,height are updated
+*              immediately when PPL SIZE is given (in SET_PLOT_SIZE)
+* V320: 8/94 *kob* IBM port- revealed that "physical" should be defined as
+*			     logical but was defined as integer
+* V411: 9/6/95 *sh* changes to CLEAR_WINDOW (explicit segment deleting) caused
+*	SET WINDOW/CLEAR/SIZE=0.2 to crash Ferret.  Indications are that this
+*	is timing-related (plot must be complex, does not happen in totalview)
+*	Changes here to clear window **before** other actions.
+* V420 (IBM/AIX port of V411): 10/5/95 - buffer "READ(var,*"
+* 1/97 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+*	    4/97 *kob* - added ifdef for MANDATORY_FORMAT_WIDTHS on internal
+*			 read because linux/nag f90 needed a format width.
+* *js* Don't create new window with set win/new if batch graphics active
+*      Don't set window to any number but 1 if batch graphics active
+* *kob* 1.29.97 changed "can\'t" to cannot for compiler reasons
+* V540 *sh* 9/01 - pass axis white space to SET_AX_SIZE (from PLOT_SETUP.cmn)
+* V600 *acm* 9/05  add SET WINDOW/TITLE.  If no title has been set, set it to 
+*                  the session date:time. Save window_title in xplot_setup.cmn 
+*                  for use in subsequent windows. Also define a symbol WIN_TITLE
+*  v600 *acm* 5/2006 Flag no_plot_yet: changes so user can change the number of 
+*                  line colors.
+* V602: *acm* 1/07 Changes for metafile-batch mode
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* PyFr *kms* 2/2013  Add /QUALITY=... /AALIAS /NOAALIAS /ENGINE=...
+* PyFr *kms* 4/2013  remove specific reference to /AALIAS /NOAALIAS in warning message
+* PyFr  *kms*  6/13  Add /COLOR= /OPACITY= to specify background color
+* PyFr  *kms*  6/13  Add /THICKEN= to specify line width scaling factor
+* PyFr  *kms*  6/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to SET WINDOW;
+*                   Call WINDOW_SIZE_FROM_OPTS to deal with them
+* PyFr  *kms*  7/13 Call SET_PPL_VALUES to set scaled lengths and label sizes;
+*                   set physical_chg to .TRUE. if START_PPLUS called or 
+*                   if the engine changes
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+        include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'errmsg.parm'
+        include 'ppl_in_ferret.cmn' ! with PPL_viewports_active
+	include	'pltcom_dat.decl' 
+	include	'PLTCOM.DAT'         	  ! with asize,bsize
+        include 'plt_inc.decl'     ! with width/height
+        include 'PLT.INC'
+	include	'gkscm1_inc.decl'	! with gks common
+	include	'GKSCM1.INC'	                ! with gks common
+	include 'axis_inc.decl'		! axis lengths
+	include 'AXIS.INC'		        ! axis lengths
+        include 'xplot_setup.cmn'       ! for animate boolean
+        include 'xtoday.cmn'            ! with today_date and today_time
+        include 'fgrdel.cmn'            ! with windowdpix and windowdpiy
+
+* calling argument declarations:
+	INTEGER	status
+
+* internal variable declarations:
+	LOGICAL TM_DIGIT, MATCH4, FGD_ENGINE_MATCH, 
+     .		physical_chg, relocate, chg_window, axis_ref
+	INTEGER TM_LENSTR1, ier, id, itype, imeter, irx, iry, 
+     .          wn, n, qp, ivp, colon_pos, slen, tlen, i, s1, 
+     .          idone, bkgcolor, xpixels, ypixels
+	REAL	dmaxx, dmaxy, xln, yln, xmn, xmx, ymn, ymx,
+     .		scale, xstretch, ystretch, aspect, ref_len,
+     .          xsc, ysc
+	REAL*4  rzero, rone, fcty, fctx, 
+     .          xwlo, ywlo, xwhi, ywhi, dfltthick,
+     .          redfrac, grnfrac, bluefrac, opaqfrac,
+     .          xinches, yinches, sc
+	CHARACTER	UPPER_CASE*1, GKS_X_CONID*16, warnmsg*80,
+     .			arg1*1, buffer*24, xwind_id*80, short_buff*24
+
+* local parameter declarations:
+	INTEGER slash_new,
+     .          slash_clear,
+     .          slash_title,
+     .          slash_quality,
+     .          slash_aalias,
+     .          slash_noaalias,
+     .          slash_engine,
+     .          slash_color,
+     .          slash_opacity,
+     .          slash_thicken,
+     .          slash_textprom
+	PARAMETER ( slash_new      =  1+1,
+     .              slash_clear    =  4+1,
+     .              slash_title    =  5+1,
+     .              slash_quality  =  6+1,
+     .              slash_aalias   =  7+1,
+     .              slash_noaalias =  8+1,
+     .              slash_engine   =  9+1,
+     .              slash_color    = 10+1,
+     .              slash_opacity  = 11+1,
+     .              slash_thicken  = 12+1,
+     .              slash_textprom = 17+1 )
+
+	rzero = 0.0
+	rone = 1.0
+        physical_chg = .FALSE.
+
+* /TITLE=text
+* This text becomes the name of the workstation. The name gets truncated 
+* at the first blank space. Replace any internal spaces with underscore.
+
+	IF ( .NOT.pplus_started ) window_title = ' '
+
+        tlen = 1
+	qp = qual_given( slash_title )
+	IF (qp .GT. 0 .AND. .NOT. animate) THEN
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   window_title, status )
+           tlen = TM_LENSTR1(window_title)
+           DO 70 i = 1, tlen
+             IF (window_title(i:i) .EQ. ' ') window_title(i:i) = '_'
+ 70        CONTINUE
+
+* By default let the session date and time be incorporated into the name.
+
+        ELSE IF (qp .EQ. 0 .AND. window_title .EQ. ' ') THEN
+           s1 = 1
+           IF (today_date(1:1) .EQ. ' ') s1 = 2
+           tlen = TM_LENSTR1(today_date)
+           window_title = today_date(s1:tlen)//':'//today_time
+
+* Or the directory.
+!  This works, but with slashes the path name does not get appended. 
+!  gks calls shorten FERRET_2_/home/ja8/ansley/FERRET/fer 
+!  to just the directory name.  If we do use the directory, change
+! the code in open_gks_ws.F to do it the same way.
+
+c           call getenv ('PWD',window_title)
+c           tlen = TM_LENSTR1(window_title)
+c           DO 75 i=1, tlen
+c              IF (window_title(i:i) .EQ. '/') window_title(i:i) = '_'
+c 75        CONTINUE
+
+        ENDIF
+        tlen = TM_LENSTR1(window_title)
+        ier = 0
+        CALL SETSYM ("WIN_TITLE "//window_title(:tlen), tlen+10, ier, status)
+
+* main window opened yet ?
+	IF ( .NOT.pplus_started ) THEN
+	   CALL START_PPLUS(.TRUE.)
+*          this opens a window, so need to set physical_chg .TRUE. to resize it
+           physical_chg = .TRUE.
+	ENDIF
+
+* are we in a valid GKS window environment ?
+	IF ( .NOT. gksopn	) RETURN
+
+* get number
+	IF ( num_args .EQ. 0 .AND. qual_given(slash_new) .GT. 0 ) THEN
+           
+* ... find next free number
+* *kob* 1/00 - check to make sure user doesnt open window 9 - reserved
+*              for animation purposes
+           chg_window = .TRUE.
+           DO 50 n = 1, (max_windows-1)
+              IF ( .NOT.wn_open( n ) ) GOTO 60
+ 50        CONTINUE
+           CALL ERRMSG(ferr_prog_limit,status,'# windows',*5000)
+	ELSEIF ( num_args .GT. 0 ) THEN
+* ... use number given
+	   buffer = cmnd_buff(arg_start(1):arg_end(1)) 
+	   IF ( .NOT.TM_DIGIT( buffer ) ) GOTO 5040
+* *kob* 4/97
+#ifdef MANDATORY_FORMAT_WIDTHS
+	   READ ( buffer, *, ERR=5040 ) n
+#else
+	   READ ( buffer, '(I)', ERR=5040 ) n
+#endif
+	   chg_window = n .NE. wsid
+	ELSE
+	   chg_window = .FALSE.
+* ... locate currently active window
+	   DO 55 wn = 1, max_windows
+	      IF ( wn_active( wn ) ) THEN
+	         n = wn
+	         GOTO 60
+	      ENDIF
+ 55	   CONTINUE
+	   GOTO 5060
+	ENDIF	   
+
+* valid number ? 
+* *kob* 1/00 - check to make sure user doesnt open window 9 - reserved
+*              for animation purposes
+ 60	IF ( (n.LT.1 .OR. n.GT.(max_windows-1)) .AND. 
+     .          .NOT.animate  ) CALL ERRMSG
+     .		( ferr_out_of_range, status, 'legal numbers are 1-8', *5000 )
+
+* Determine the graphics engine to use.  This also sets the default 
+* anti-alias state for that engine.  If a new window and neither 
+* /quality nor /engine is given, the default engine is assigned.
+        qp = qual_given(slash_quality)
+        IF ( qp .GT. 0 ) THEN
+* /QUALITY=... given; translate to an engine name to use,
+* but do not force it to be used (in case -nodisplay was specified)
+            CALL EQUAL_STRING(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                        buffer, status)
+            IF ( status .NE. ferr_ok ) RETURN
+            IF ( buffer .EQ. ' ' ) THEN
+                CALL ERRMSG(ferr_syntax, status, '/QUALITY=?', *5000)
+            ENDIF
+            slen = TM_LENSTR1(buffer)
+            IF ( MATCH4(buffer, slen, 'DRAFT', 5) ) THEN
+                IF ( .NOT. FGD_ENGINE_MATCH(n, 'PipedImager') ) THEN
+                    physical_chg = .TRUE.
+                    CALL CANCEL_WINDOW_NUM(n)
+                    CALL FGD_SET_ENGINE(n, 'PipedImager', .FALSE., status)
+                    IF ( status .NE. ferr_ok ) RETURN
+                ENDIF
+            ELSE IF ( MATCH4(buffer, slen, 'HIGH', 4) ) THEN
+                IF ( .NOT. FGD_ENGINE_MATCH(n, 'PipedViewerPQ') ) THEN
+                    physical_chg = .TRUE.
+                    CALL CANCEL_WINDOW_NUM(n)
+                    CALL FGD_SET_ENGINE(n, 'PipedViewerPQ', .FALSE., status)
+                    IF ( status .NE. ferr_ok ) RETURN
+                ENDIF
+            ELSE
+                CALL ERRMSG(ferr_syntax, status, 
+     .                      'Unknown /QUALITY value of ' // 
+     .                      buffer(1:slen), *5000)
+            ENDIF
+            qp = qual_given(slash_engine)
+            IF ( qp .GT. 0 ) THEN
+* /ENGINE=... also given; ignore but warn
+                warnmsg = '/QUALITY and /ENGINE both given ' //
+     .                    'with SET WINDOW; /ENGINE ignored'
+                CALL WARN(warnmsg)
+            ENDIF
+        ELSE
+            qp = qual_given(slash_engine)
+            IF ( qp .GT. 0 ) THEN
+* /ENGINE=... given; force the use of this engine
+                CALL EQUAL_STRING(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                         buffer, status)
+                IF ( status .NE. ferr_ok ) RETURN
+                slen = TM_LENSTR1(buffer)
+                IF ( .NOT. FGD_ENGINE_MATCH(n, buffer(1:slen)) ) THEN
+                    physical_chg = .TRUE.
+                    CALL CANCEL_WINDOW_NUM(n)
+                    CALL FGD_SET_ENGINE(n, buffer(1:slen), .TRUE., status)
+                    IF ( status .NE. ferr_ok ) RETURN
+                ENDIF
+            ELSE IF ( .NOT. wn_open(n) ) THEN
+* Neither /QUALITY=... nor /ENGINE=... given but a new window
+* Give a blank engine name to reset to the default engine
+                CALL FGD_SET_ENGINE(n, '', .TRUE., status)
+                IF ( status .NE. ferr_ok ) RETURN
+            ENDIF
+        ENDIF
+
+* create new window ?
+	IF ( .NOT. wn_open(n) ) THEN
+	   xwind_id = GKS_X_CONID( n )
+	   CALL NEW_GKS_WINDOW( n, xwind_id, window_title(:tlen), status )   ! status always OK
+	   physical_chg = .TRUE.
+* ... set up GKS bundles for the new "workstation" (window)
+	   CALL WS_LINE_BUNDLES( n, wstype )
+           no_plot_yet = .TRUE.
+	ENDIF
+
+* clear the screen ? (which deletes all segments from window)
+	IF ( qual_given( slash_clear ) .GT. 0 .AND. .NOT.animate) THEN
+           CALL CLEAR_WINDOW( n )
+	   vp_seg0( vp_num ) = curr_seg_name	! no segments left in viewport
+	   vp_segn( vp_num ) = curr_seg_name
+	ENDIF
+
+* store appropriate segment range with each viewport
+	IF ( chg_window ) THEN
+* ... change windows --> segments will remain until previous window is cleared
+	   vp_num = mvp_dflt
+           PPL_viewports_active = .FALSE.    ! communicate to PPLUS (10/92) 
+	   DO 80 ivp = mvp_dflt, max_viewport
+	      vp_seg0(ivp) = 0
+	      vp_segn(ivp) = 0
+ 80	   CONTINUE
+	ENDIF
+
+* Decipher /SIZE /ASPECT /XPIXELS /YPIXELS /XINCHES /YINCHES
+        CALL WINDOW_SIZE_FROM_OPTS(n, xinches, yinches, 
+     .              xpixels, ypixels, physical_chg, status)
+        IF ( status .NE. ferr_ok ) RETURN
+
+        IF ( physical_chg ) THEN
+* tell ppl of the new default sizes for this window
+           wn_xinches(n) = xinches
+           wn_yinches(n) = yinches
+           CALL SET_PPL_VALUES(n, .TRUE.)
+        ELSEIF ( chg_window ) THEN
+* tell ppl of the sizes used for this window
+           CALL SET_PPL_VALUES(n, .FALSE.)
+        ENDIF
+
+* define the default normalization transformation for this window
+        IF ( physical_chg .OR. chg_window ) THEN
+           ASIZE = width * 1000
+           BSIZE = height * 1000
+           IF(ASIZE.GT.BSIZE)THEN
+              FCTY=BSIZE/ASIZE
+              FCTX=1.0
+           ELSE
+              FCTX=ASIZE/BSIZE
+              FCTY=1.0
+           ENDIF
+           CALL FGD_GSWKWN(n, rzero, FCTX, rzero, FCTY)
+           CALL FGD_GSVP(n, rzero, FCTX, rzero, FCTY)
+           CALL FGD_GSWN(n, rzero, ASIZE, rzero, BSIZE)
+        ENDIF
+
+* deactivate previously active window
+        DO 100 wn = 1, max_windows
+           IF ( wn_active( wn ) ) THEN
+              CALL FGD_GDAWK( wn )
+	      wn_active( wn ) = .FALSE.
+	   ENDIF
+ 100	CONTINUE
+
+* activate window and select the default transform (same as the windowid)
+        CALL FGD_GACWK(n)
+        wsid = n
+        wn_open  ( wsid ) = .TRUE.
+        wn_active( wsid ) = .TRUE.
+
+        IF ( physical_chg ) THEN
+
+* ... clear previous plot and any viewports used within it
+*     and set the size of the window.
+*          Set ASIZE and BSIZE to invalid values so the SIZE routine
+*          in SET_VIEWPORT will not return immediately, thinking there 
+*          was no size change from the ASIZE and BSIZE values set above.
+           ASIZE = 0.0
+           BSIZE = 0.0
+           CALL SET_VIEWPORT( mvp_dflt )
+
+*          Send the scaling factor to the viewer so the image is 
+*          the desired pixel size.  To make up for integer rounding, 
+*          compute the scaling factor using both height and width.
+           xsc = xpixels / (xinches * windowdpix(n))
+           ysc = ypixels / (yinches * windowdpiy(n))
+           sc = SQRT(xsc * ysc)
+           CALL FGD_SEND_IMAGE_SCALE(n, sc)
+
+*          Save xpixels and ypixels only for specifying the default
+*          size when saving raster graphics.
+           wn_xpixels(n) = xpixels
+           wn_ypixels(n) = ypixels
+
+        ENDIF
+
+* use anti-aliasing?
+        qp = qual_given(slash_aalias)
+        IF ( qp .GT. 0 ) THEN
+* turn anti-aliasing on for this window
+            CALL FGD_SET_ANTIALIAS(n, 1)
+            qp = qual_given(slash_noaalias)
+            IF ( qp .GT. 0 ) THEN
+* also specified turning anti-aliasing off; ignore but warn
+                warnmsg = 'anti-aliasing and no anti-aliasing ' //
+     .            'both specified with SET WINDOW; using anti-aliasing'
+                CALL WARN(warnmsg)
+            ENDIF
+        ELSE
+            qp = qual_given(slash_noaalias)
+            IF ( qp .GT. 0 ) THEN
+* turn anti-aliasing off for this window
+                CALL FGD_SET_ANTIALIAS(n, 0)
+            ENDIF
+        ENDIF
+
+* set line thickness scaling factor?
+        qp = qual_given(slash_thicken)
+        IF ( qp .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                     scale, status)
+            IF ( status .NE. ferr_ok ) RETURN
+            IF ( scale .LE. 0.0 ) GOTO 5070
+            dfltthick = scale
+            CALL FGD_SET_THICK_FACTOR(n, dfltthick)
+        ENDIF
+
+* set text size scaling factor?
+        qp = qual_given(slash_textprom)
+        IF ( qp .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                     scale, status)
+            IF ( status .NE. ferr_ok ) RETURN
+            IF ( scale .LE. 0.0 ) GOTO 5090
+*           Note: scale text by this factor as well as by pplscale
+            CALL SET_TEXT_SIZES(n, scale)
+        ENDIF
+
+* background color is always color zero
+        bkgcolor = 0
+* background color specified?
+        qp = qual_given(slash_color)
+        IF ( qp .GT. 0 ) THEN
+            CALL EQUAL_COLOR(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                       bkgcolor, dfltthick, status)
+            IF ( status .NE. ferr_ok ) RETURN
+*           Check if opacity is given before resetting the background
+        ENDIF
+
+* opacity specified? (must be after /COLOR to reset alpha channel value)
+        qp = qual_given(slash_opacity)
+        IF ( qp .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)), 
+     .                     scale, status)
+            IF ( status .NE. ferr_ok ) RETURN
+            IF ( (scale .LT. 0.0) .OR. (scale .GT. 100.0) ) GOTO 5080
+            opaqfrac = scale / 100.0
+*           create a temporary color with the new opacity for the active window
+            CALL DUP_COLOR_SET_OPACITY(n, bkgcolor, opaqfrac)
+        ENDIF
+  
+        IF ( bkgcolor > 0 ) THEN
+*           Get the RGBA fractions for the new background
+            CALL FGD_GQCR(n, bkgcolor, ier, 
+     .                    redfrac, grnfrac, bluefrac, opaqfrac)
+*           Modify color zero and redraw the background
+            CALL FGD_GSCR(n, 0, redfrac, grnfrac, bluefrac, opaqfrac)
+            CALL FGD_REDRAW_BACKGROUND(n)
+        ENDIF
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit(s)
+ 5000	RETURN
+! 5010	CALL ERRMSG( ferr_erreq, status, buffer, *5000 )
+ 5020	CALL ERRMSG( ferr_syntax,status, buffer, *5000 )
+ 5040	CALL ERRMSG( ferr_unknown_arg, status, buffer, *5000 )
+ 5050	CALL ERRMSG( ferr_out_of_range, status, buffer,*5000)
+ 5060	CALL ERRMSG( ferr_invalid_command,status,
+     .          'no open window',*5000 )
+ 5070   CALL ERRMSG( ferr_out_of_range, status, 
+     .          'Invalid thicken specification; '//
+     .          'a positive number must be given', *5000)
+ 5080   CALL ERRMSG( ferr_out_of_range, status, 
+     .          'Invalid opacity specification; '//
+     .          'a value from 0 to 100 must be given', *5000)
+ 5090   CALL ERRMSG( ferr_out_of_range, status, 
+     .          'Invalid text prominence specification; '//
+     .          'a positive number must be given', *5000)
+	END
+
diff --git a/fer/plt/setup_keys.F b/fer/plt/setup_keys.F
new file mode 100644
index 0000000..6c4a97c
--- /dev/null
+++ b/fer/plt/setup_keys.F
@@ -0,0 +1,165 @@
+	SUBROUTINE SETUP_KEYS( nvar )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine parameters needed to layout titles and keys on the plot based on
+* how many variables are in the plot
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200: 12/21/89
+* 	  5/6/90 - fixed bug when xlen is very small using MAX
+* V420:  4/23/96 - number of columns was computed without respect to nvar
+*	  	thus if the plot could fit 3 keys across but only 2 were needed
+*	  	they didn't end up centered
+* V540: *sh* 9/01 - do not adjust Y axis origin of PLOT command if user
+*			specifies not to
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* PyFr *kms*  7/13 Moved key_xspace0, key_yspace0, key_labht0, key_xorigin, 
+*                  key_yorigin, key_xwhite_space, key_ywhite_space, 
+*                  key_line_frac, ovkey_space, ovkey_yspace, ovkey_labht,
+*                  ovkey_xorigin, ovkey_yorigin, ul_labht0, ul_yspace0,
+*                  ul_xorigin, and ul_yorigin to plot_setup.parm,
+*                  since they are used as parameters, and prefixed with 
+*                  dflt_ those that need to be scaled by pplscale or textscale.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include	'plot_setup.parm'
+	include	'command.parm'
+	include	'xplot_setup.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+	include 'axis_inc.decl'		! axis lengths
+	include 'AXIS.INC'		! axis lengths
+
+* calling argument declarations
+	INTEGER	nvar
+
+* local variable declarations:
+	LOGICAL	change_yorg, change_ysize, yadjust
+	INTEGER	nrow, idim
+	REAL	ysqueeze, yspace_needed, yspace_avail
+
+* how many columns of keys can fit on the plot ?
+	key_ncolmn  = MAX( 1, INT( (xlen - dflt_key_xorigin*pplscale)
+     .                            /(dflt_key_xspace0*pplscale) ) )
+	IF (key_ncolmn .GT. nvar) key_ncolmn = nvar	! 4/96
+	key_xspace  = MAX( xlen/5., (xlen - dflt_key_xorigin*pplscale)/key_ncolmn )
+	key_xsize   = MAX( xlen/6., key_xspace - dflt_key_xwhite_space*pplscale )
+
+* and how many rows do we need ?
+	nrow = ((nvar-1) / key_ncolmn) + 1
+	yspace_needed = nrow*dflt_key_yspace0*pplscale
+
+* where was the y origin before we tampered with it ?
+	IF ( saved_ppl_yax ) THEN
+	   yspace_avail = ppl_saved_yorg
+	ELSE
+	   yspace_avail = yorg
+	ENDIF
+	yspace_avail = yspace_avail + dflt_key_yorigin*pplscale
+
+* compute how much we will allow the key labels to shrink
+	IF ( nrow .LE. 2 ) THEN
+	   ysqueeze = 0.9
+	ELSE
+	   ysqueeze = MAX( 0.75, 0.92**(nrow-1) )
+	ENDIF
+
+* determine if
+*  1) the keys will fit using the default y origin and key label size
+*  2) the keys will fit but only by shrinking the label size
+*  3) the keys will fit only by shifting the y origin (y location of x axis)
+	yadjust = cmnd_num .EQ. cmnd_plot  ! added 9/01 *sh*
+	IF (yadjust) yadjust = qual_given(slash_plot_noyadjust).EQ.0
+	IF ( .NOT.yadjust ) THEN
+	   change_ysize = .FALSE.
+	   change_yorg  = .FALSE.
+	ELSE
+	   change_ysize = yspace_avail .LT. yspace_needed
+	   change_yorg  = yspace_avail .LT. yspace_needed*ysqueeze
+	ENDIF
+
+	IF ( .NOT. change_yorg ) THEN
+* ... restore the default vertical layout if we tampered with it
+           IF ( saved_ppl_yax ) THEN
+	      ylen = ppl_saved_yaxlen
+	      yorg = ppl_saved_yorg
+	      saved_ppl_yax = .FALSE.
+	   ENDIF
+	ENDIF
+
+	IF ( change_yorg ) THEN
+* ... shrunken keys AND increased yorigin
+* ... save the default vertical layout so we can restore it later
+	   IF ( .NOT. saved_ppl_yax ) THEN
+	      ppl_saved_yorg   = yorg
+	      ppl_saved_yaxlen = ylen
+	      saved_ppl_yax = .TRUE.
+	   ENDIF 
+	   yorg = yspace_needed * ysqueeze - dflt_key_yorigin*pplscale
+	   ylen = (ppl_saved_yaxlen + ppl_saved_yorg) - yorg
+	   key_yspace = dflt_key_yspace0*pplscale * ysqueeze
+	   key_ysize  = (dflt_key_yspace0*pplscale - 
+     .                   dflt_key_ywhite_space*pplscale) * ysqueeze
+	   key_labht  = dflt_key_labht0*textscale * ysqueeze
+	ELSEIF ( change_ysize ) THEN
+* ... shrunken keys but don't tamper with y origin
+	   ysqueeze = yspace_avail / yspace_needed
+	   key_yspace = dflt_key_yspace0*pplscale * ysqueeze
+	   key_ysize  = (dflt_key_yspace0*pplscale - 
+     .                   dflt_key_ywhite_space*pplscale) * ysqueeze
+	   key_labht  = dflt_key_labht0*textscale * ysqueeze
+	ELSE
+* ... full-sized keys, don't tamper with y origin
+	   key_yspace = dflt_key_yspace0*pplscale
+ 	   key_ysize  = dflt_key_yspace0*pplscale - 
+     .                  dflt_key_ywhite_space*pplscale
+	   key_labht  = dflt_key_labht0*textscale
+	ENDIF
+
+* how many labels in the upper left corner?
+	ul_nlabs = 0
+	DO 100 idim = 1, nferdims
+	   ul_dolab(idim) = cx_lo_ww(idim,cx_plot).NE.unspecified_val8
+     . 		      .AND. cx_lo_ww(idim,cx_plot).NE.unspec_val8_2
+	   IF ( ul_dolab(idim) ) ul_nlabs = ul_nlabs + 1	
+ 100	CONTINUE	
+
+	RETURN
+	END
diff --git a/fer/plt/start_pplus.F b/fer/plt/start_pplus.F
new file mode 100644
index 0000000..319ee64
--- /dev/null
+++ b/fer/plt/start_pplus.F
@@ -0,0 +1,183 @@
+	SUBROUTINE START_PPLUS(fromsetwin)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize Denbo's PPLUS program which is imbedded within this program
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/29/87 
+* revision 0.1 - 6/3/87  - added color definitions
+* revision 0.2 - 7/28/87 - added INQUIRE to see if wkstn. has colors
+* revision 1.0 - 6/29/88 - removed color definitions to DEFINE_COLORS
+*			   removed mode determination to INITIALIZE
+* revision 1.1 - 8/11/88 - added GKS deferral state call
+* revision 1.2 - 8/16/88 - added GKS_WINDOWS to allow FERRET on BETA
+*			   removed GKS deferral state call
+* revision 1.3 - 8/26/88 - added PPL SIZE (9,10) to initialize
+*			   since the SIZE command is removed from DISP_INIT
+* revision 1.4 - 9/8/88  - initialize PPLUS with PPL_in_FERRET
+*			 - add EXTERNALS to force loads from FERRET library
+*			   instead of PPLUS library
+* revision 1.5 - 4/1/89  - transfer MODE WAIT directly to PPLUS variable deflts
+* V200:  12/6/89 - GKS state determined by mode_GKS, color setup removed
+*	 9/19/90 - warning message when GKS mode is cancelled
+* Ultrix/RISC port - commented out GKSFORBND.DEF include: not used
+* V300:  3/11/93 - sets a default color spectrum
+* V301:	 11/3/93 - calls SET_VIEWPORT to define VP_WIDTH and VP_height symbols
+*	 1/24/94 - turn on metafiles in DISP_INIT instead of here
+*	           (resolve problem of metafiles created with wrong name)
+* V450:  TEMPORARY EXPERIMENTAL change to test metafile-only output
+* V450:  3/4/97 - Mod to support metafile-only (no X) output through a
+*		cuckoo's egg implantation of meta_wsid in place of wsid
+* V610 *acm* 3/08 - add new MODE NLEVELS; Store the setting for the default
+*                   number of contour/fill levels.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* PyFr *kms*  7/13 Added fromsetwin argument to indicate whether this was
+*                  called from set_window or not.  If not, there is addition
+*                  initialization required.  
+*                  Remove functions calls already made by DISP_RESET.
+
+        IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xgks_devices.cmn'
+	include	'system_inc.decl'	! with echof
+	include	'SYSTEM.INC'	! with echof
+	include	'plt_inc.decl'	! with icode
+	include	'PLT.INC'	! with icode
+	include	'gkscm1_inc.decl'	! with wsid
+	include	'GKSCM1.INC'	! with wsid
+	include	'switch_inc.decl'	! with deflts
+	include	'SWITCH.INC'	! with deflts
+	include	'pltcom_dat.decl'	! with gksopn
+	include	'PLTCOM.DAT'	! with gksopn
+	include	'ppl_in_ferret.cmn'	! with ppl_in_ferret
+!	include	'gksdefs.bnd'		! gks parameters
+        INCLUDE 'lunits_inc.decl'   ! std err unit number
+	INCLUDE 'LUNITS.INC'
+        INCLUDE 'fgrdel.cmn'    ! windowdpix, windowdpiy
+
+* argument declarations:
+        LOGICAL fromsetwin
+
+* internal parameter declarations:
+	CHARACTER	dummy_filename*1
+	PARAMETER     ( dummy_filename	  = ' ' )
+
+* internal variable declarations
+        REAL*4  sc
+        INTEGER sts
+
+* external declarations to force loading of modules used by PPLUS
+	EXTERNAL	GET_VP_FROM_FERRET, CLEAR_VP, INTERRUPT,
+     .			SEG_ON, SEG_OFF
+
+* still need to cold-start graphics ?
+	IF ( pplus_started ) RETURN
+
+* set to use the default graphics engine
+        CALL FGD_SET_ENGINE(wsid, '', .TRUE., sts)
+
+* tell PPLUS that it is under FERRET control without viewports
+	PPL_in_FERRET = .TRUE.
+	PPL_viewports_active = .FALSE.
+
+* Give PPLUS the unit number for std error, to write error messages
+        lerror = err_lun
+
+* set PPLUS /WAIT vs /NOWAIT mode directly from FERRET mode
+	deflts(5) = mode_wait	! sets swait default
+
+* tailor output graphics device to environment
+	IF ( mode_gks ) THEN
+!	   icode = 3		! PLTYPE 3 (GKS)
+	   icode = 1		! PLTYPE 3 WS=... is done below
+	ELSEIF ( .NOT.interactive ) THEN
+	   icode = 0		! PLTYPE 0 (PPLUS metafile)
+	ELSE
+	   icode = 1		! PLTYPE 1 (Tek terminal)
+	   CALL WARN('MODE GKS is disabled.')
+	   CALL WARN('Some graphics functionality will not be available.')
+	ENDIF
+
+* open PLOT5
+	CALL OPNPPL ( dummy_filename,41,42,43,44,ttout_lun,45,46,47,48 )
+	echof = .FALSE.
+	pplus_started = .TRUE.
+
+* define plot values and sizes
+	CALL COLOR(1)
+	CALL DISP_RESET
+
+* set correct plot device (e.g. "PLTYPE 3 WS=VSII" )
+	IF ( mode_gks ) CALL SEND_PLTYPE(.FALSE.) ! 1/94 was "mode_metafile"
+	IF ( .NOT.gksopn ) RETURN	! flag was set by PPLUS
+
+* start GKS on FERRET side
+	wn_open( wsid )   = .TRUE.
+	wn_active( wsid ) = .TRUE.
+
+* initialization needed if this is not called from SET_WINDOW
+        IF ( .NOT. fromsetwin ) THEN
+*          make sure the viewer knows the correct scene size
+           ASIZE = 0.0
+           BSIZE = 0.0
+           CALL SIZE(width, height)
+*          set the default scaling factor for the scene - SQRT(0.7)
+           sc = dflt_imgscale
+           wn_xpixels(wsid) = wn_xinches(wsid) * windowdpix(wsid) * sc
+           wn_ypixels(wsid) = wn_yinches(wsid) * windowdpiy(wsid) * sc
+           CALL FGD_SEND_IMAGE_SCALE(wsid, sc)
+        ENDIF
+
+* set GKS to regenerate whenever workstation viewport is modified - avoids
+*  bug interaction with segments when the first plot is done directly via PPLUS
+*  note: subsequent windows will still have their deferral states at default
+*	 but no problems are caused by that because FERRET and PPLUS agree on
+*	 the window viewport coordinates (see PPLUS SIZE2)
+!	CALL FGD_GSDS( wsid, gasap, gallow )
+! further bug - repeated SET WINDOW/SIZE=x for same x cause segment to go
+! invisible
+	RETURN
+	END
diff --git a/fer/plt/taxis_style.F b/fer/plt/taxis_style.F
new file mode 100644
index 0000000..d3aa86b
--- /dev/null
+++ b/fer/plt/taxis_style.F
@@ -0,0 +1,218 @@
+	SUBROUTINE TAXIS_STYLE( x_or_y, lo_bc, hi_bc, tstyle )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up PPLUS to properly format a time axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/22/88 - extracted from AXIS_FORMAT
+* revision 0.1 -  1/9/89 - added climatological axis logic
+* 12/10/93 - set only the small tic size - do not mess with large tics
+* V420: 11/95 - accomodate century long time axes
+*	      - and 4-digit PLOT+ years!!
+*	      - added "x_or_y" argument for Y axis calendar axes
+*	      - added TXTYPE MULTIYR
+* V510: 5/00 *sh* - extend formatting to 1000's of years axes
+* V650  1/10 *acm*- Define a symbol TXTYPE_SETTING which can be used in
+*               scripts when deciding whether to set the axis style as DMY
+** V650  1/10 *acm*-  Bug 670 fixed: added TXTYPE MULTIYR, multi-decade
+* V66    7/10 *kms* - undiscovered bug fixed: 'TXTYPE_SETTING' was used 
+*                     directly instead of buff30 in call to GETSYM
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+
+	include 'ferret.parm'
+	include 'plot_setup.parm'
+        include 'axis_inc.decl'	! with axis lengths
+        include 'AXIS.INC'      ! with axis lengths	
+
+
+* calling argument declarations:
+	CHARACTER	x_or_y*1, tstyle*3
+	REAL*8		lo_bc, hi_bc
+
+* parameter definitions:
+	INTEGER		pmax_tax
+	REAL*8		psecs_at_2_yrs
+	PARAMETER     ( pmax_tax   = 16,
+     .			psecs_at_2_yrs = 60.*60.*24.*365.*2. )
+
+* internal variable declarations:
+	LOGICAL		climatology, its_x
+	INTEGER		TM_LENSTR1, itax, hi_int, slen, i1, i2
+	CHARACTER	ppl_cmnd*128, tstyle_long*10, buff30*30, buff*10
+	REAL		hrs, hrsper8, axlen
+
+* time axis style table
+	INTEGER		tax_loint( pmax_tax ),	! PPL TXLINT lo,...
+     .			tax_hiint( pmax_tax )	! PPL TXLINT ...,hi
+	REAL		tax_hours( pmax_tax )	! bounds: range-->style
+	CHARACTER*10	tax_style( pmax_tax )	! PPL TXTYPE value
+
+	DATA	tax_hours(1)	/   24.	/,	! 0-24 hour long axis
+     .		tax_style(1)	/ 'DAY'	/,
+     .		tax_loint(1)	/    1	/,
+     .		tax_hiint(1)	/    1	/
+	DATA	tax_hours(2)	/  144.	/,	! 24 hour to 6 day long axis
+     .		tax_style(2)	/ 'DAY'	/,
+     .		tax_loint(2)	/    6	/,
+     .		tax_hiint(2)	/    1	/
+	DATA	tax_hours(3)	/  768.	/,	! 6 to 32 day long axis
+     .		tax_style(3)	/ 'MON'	/,
+     .		tax_loint(3)	/    1	/,
+     .		tax_hiint(3)	/    1	/
+	DATA	tax_hours(4)	/ 2880.	/,	! 32 day to 4 month long axis
+     .		tax_style(4)	/ 'MON'	/,
+     .		tax_loint(4)	/    5	/,
+     .		tax_hiint(4)	/    1	/
+	DATA	tax_hours(5)	/43200.	/,	! 4 month to 5 year long axis
+     .		tax_style(5)	/  'YR'	/,
+     .		tax_loint(5)	/    1	/,
+     .		tax_hiint(5)	/    1	/
+	DATA	tax_hours(6)	/100800./,	! 5 to 12 year long axis
+     .		tax_style(6)	/  'YR'	/,
+     .		tax_loint(6)	/    3	/,
+     .		tax_hiint(6)	/    1	/
+	DATA	tax_hours(7)	/144000./,	! 12 to 17 year long axis
+     .		tax_style(7)	/  'YR'	/,
+     .		tax_loint(7)	/    0	/,
+     .		tax_hiint(7)	/    2	/
+* ... eliminate small tics beyond here
+	DATA	tax_hours(8)	/172800./,	! 17 to 20 year long axis
+     .		tax_style(8)	/  'YR MULTIYR'	/,
+     .		tax_loint(8)	/    0	/,
+     .		tax_hiint(8)	/    2	/
+	DATA	tax_hours(9)	/432000./,	! 20 to 50 year long axis
+     .		tax_style(9)	/  'YR MULTIYR'	/,
+     .		tax_loint(9)	/    0	/,
+     .		tax_hiint(9)	/    5	/
+	DATA	tax_hours(10)	/864000./,	! 50 to 100 year long axis
+     .		tax_style(10)	/  'YR MULTIDC'	/,
+     .		tax_loint(10)	/    0	/,
+     .		tax_hiint(10)	/   10	/
+	DATA	tax_hours(11)	/1728000.	/, ! 100 to 200 yr long axis
+     .		tax_style(11)	/  'YR MULTIDC'	/,
+     .		tax_loint(11)	/    0	/,
+     .		tax_hiint(11)	/   20	/
+	DATA	tax_hours(12)	/4320000.	/, ! 200 to 500 yr long axis
+     .		tax_style(12)	/  'YR MULTIDC'	/,
+     .		tax_loint(12)	/    0	/,
+     .		tax_hiint(12)	/   50	/
+	DATA	tax_hours(13)	/8640000.	/, ! 500 to 1000 yr long axis
+     .		tax_style(13)	/  'YR MULTIDC'	/,
+     .		tax_loint(13)	/    0	/,
+     .		tax_hiint(13)	/   100	/
+	DATA	tax_hours(14)	/17280000.	/, ! 1000 to 2000 yr long axis
+     .		tax_style(14)	/  'YR MULTIDC'	/,
+     .		tax_loint(14)	/    0	/,
+     .		tax_hiint(14)	/   200	/
+	DATA	tax_hours(15)	/43200000.	/, ! 2000 to 5000 yr long axis
+     .		tax_style(15)	/  'YR MULTIDC'	/,
+     .		tax_loint(15)	/    0	/,
+     .		tax_hiint(15)	/   500	/
+	DATA	tax_hours(16)	/    0.	/,    ! greater than 5000 yr long axis
+     .		tax_style(16)	/  'YR MULTIDC'	/,
+     .		tax_loint(16)	/    0	/,
+     .		tax_hiint(16)	/   1000	/
+
+* time axis orientation
+	its_x = x_or_y .EQ. 'X'
+
+* axis length
+	IF ( its_x ) THEN
+	   axlen = xlen
+	ELSE
+	   axlen = ylen
+	ENDIF
+
+* regard axis as climatological if it starts in year 0000 or 0001 and
+* extends less than 2 years
+	climatology = lo_bc .LE. psecs_at_2_yrs
+     .		.AND. (hi_bc-lo_bc).LT.psecs_at_2_yrs
+
+* get axis length in hours from times since BC in seconds
+	hrs = ( hi_bc - lo_bc ) / 3600.
+
+* how many hours if the axis were 8 in length ?
+	hrsper8 = 8./axlen * hrs
+
+* select style based on axis length
+	DO 500 itax = 1, pmax_tax
+	   IF ( hrsper8 .LE. tax_hours( itax ) ) GOTO 510
+ 500	CONTINUE	         
+	itax = pmax_tax
+
+* TXTYPE and TXLINT commands (time axis style)
+ 510	tstyle_long = tax_style( itax )
+	tstyle = tstyle_long	! 3 character, only
+	CALL PPLCMD ( from, line, 0, 'TXTYPE '//tstyle_long, 1, 1 )
+
+* ---
+* Define a symbol TXTYPE_SETTING
+* if this symbol already exists then delete it
+        buff30 = 'TXTYPE_SETTING'
+	CALL GETSYM( buff30, buff, i2, i1 )
+	IF ( i1 .EQ. 0 ) CALL DELSYM(buff30,i1)
+
+* define the symbol
+	slen = TM_LENSTR1(tstyle_long)
+	CALL PUTSYM( buff30, tstyle_long, slen, i2)
+* ---
+
+* ... suppress year display on climatological axes
+	hi_int = tax_hiint(itax)
+	IF ( climatology ) THEN
+	   IF ( tstyle(:2) .EQ. 'YR' ) hi_int = 0 ! suppress year axis label
+	   tstyle = 'CLM'			  ! suppress "YEAR:" label
+	ENDIF
+	WRITE ( ppl_cmnd, 3030 ) tax_loint(itax), hi_int
+ 3030	FORMAT ('TXLINT',2I6)
+	CALL PPLCMD ( from, line, 0, ppl_cmnd, 1, 1 )
+
+* eliminate small tics if they would be too dense (default is .125)
+!	IF ( itax .GE. 8 ) THEN
+!	   IF ( its_x ) THEN
+!	      CALL PPLCMD ( from, line, 0, 'TICS 0', 1, 1 )  	! 12/93
+!	   ELSE
+!	      CALL PPLCMD ( from, line, 0, 'TICS,,,0', 1, 1 )	! 11/95
+!	   ENDIF
+!	ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/trim_axis_ends.F b/fer/plt/trim_axis_ends.F
new file mode 100644
index 0000000..ba8612b
--- /dev/null
+++ b/fer/plt/trim_axis_ends.F
@@ -0,0 +1,118 @@
+	SUBROUTINE TRIM_AXIS_ENDS( uvar, exp_cx, imp_cx, idim, ww_lo, ww_hi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Trim axis edges as for contour (and filled contour) plots
+* from choose_cx_ww, implementing SHADE/TRIM
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V609:  2/20/22008
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER uvar, exp_cx, imp_cx, idim
+	REAL*8	ww_lo, ww_hi
+
+* internal variable declarations:
+	INTEGER	imp_ndim, exp_ndim, imp_dim(4), exp_dim(4), grid,
+     .		lo_edge, hi_edge
+	REAL*8	TM_WORLD, SECS_TO_TSTEP, ww_low, ww_hiw
+
+* initialize
+* always use the grid carried with the data itself for ww/ss translations
+	grid = cx_grid( imp_cx )
+
+* default is to use the limits associated with the data itself
+	ww_lo = cx_lo_ww(idim,imp_cx)
+	ww_hi = cx_hi_ww(idim,imp_cx)
+	lo_edge =  box_lo_lim
+	hi_edge =  box_hi_lim
+
+* trim as for contour (and filled contour) plots 
+
+	ww_lo = MAX( ww_lo,
+     .               TM_WORLD(cx_lo_ss(imp_cx,idim),grid,idim,
+     .                        box_middle)                    )
+	ww_hi = MIN( ww_hi,
+     .               TM_WORLD(cx_hi_ss(imp_cx,idim),grid,idim,
+     .                        box_middle)                    )
+
+* contour expression has its own limits imbedded ?
+	IF ( uvar_given(idim,uvar) .LT. uvlim_needed ) RETURN
+
+* contour expression depends on command limits - use 'em
+* (test for unspecified in case limits came from file information)
+	IF ( cx_by_ss(idim,exp_cx) ) THEN
+	   IF ( cx_lo_ss(exp_cx,idim).EQ.unspecified_int4 ) THEN
+	      RETURN
+	   ELSE
+	      ww_lo = MAX(TM_WORLD(cx_lo_ss(exp_cx,idim),grid,idim,
+     .                    lo_edge),
+     .			  cx_lo_ww(idim,imp_cx) )
+	      ww_hi = MIN(TM_WORLD(cx_hi_ss(exp_cx,idim),grid,idim,
+     .                    hi_edge),
+     .			  cx_hi_ww(idim,imp_cx) )
+	   ENDIF
+	ELSE
+	   IF ( cx_lo_ww(idim,exp_cx).EQ.unspecified_val8 ) THEN
+	      RETURN
+	   ELSE
+* ... explicit limits can further restrict, but not expand
+* 8/97 *kob* - check cx_calender for a date time rather than ww_low
+	      ww_low = cx_lo_ww( idim, exp_cx )
+	      ww_hiw = cx_hi_ww( idim, exp_cx )
+	      IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND. cx_calendar(exp_cx) ) THEN
+	         ww_low = SECS_TO_TSTEP( grid, idim, -ww_low )  
+	         ww_hiw = SECS_TO_TSTEP( grid, idim, -ww_hiw )  
+	      ENDIF                                     
+	      ww_lo = MAX( ww_low, ww_lo )
+	      ww_hi = MIN( ww_hiw, ww_hi )
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/plt/viewport_number.F b/fer/plt/viewport_number.F
new file mode 100644
index 0000000..ca0666b
--- /dev/null
+++ b/fer/plt/viewport_number.F
@@ -0,0 +1,78 @@
+	INTEGER FUNCTION VIEWPORT_NUMBER( view_name )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the named viewport
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+
+* calling argument declarations:
+	CHARACTER*(*)	view_name
+
+* internal variable declarations:
+	LOGICAL	MATCH_NAME
+	INTEGER	ivp
+        INTEGER TM_LENSTR,len_test,len_mchars
+
+	include	'ferret.parm'
+	include	'gfdl_vms.parm'
+	include 'xplot_state.cmn'
+
+* revision 0.0 - 8/31/88
+* V200: 10/29/89 - viewport 0 not find-able
+*	  5/8/90 - bug: MATCH4 --> MATCH_NAME ("OV" doesn't match "OVER")
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* search the viewport_names
+        len_test = TM_LENSTR(view_name)
+	DO 10 ivp = 1, max_viewport
+           len_mchars = TM_LENSTR(vp_name(ivp))
+	   IF ( MATCH_NAME(view_name, len_test, 
+     .        vp_name(ivp),len_mchars) ) THEN
+	      VIEWPORT_NUMBER = ivp
+	      RETURN
+	   ENDIF
+
+ 10	CONTINUE
+
+* given VIEWPORT name doesn't match possible options
+	VIEWPORT_NUMBER = unspecified_int4
+	RETURN
+
+	END
diff --git a/fer/plt/vp_axlim2lim.F b/fer/plt/vp_axlim2lim.F
new file mode 100644
index 0000000..cb21621
--- /dev/null
+++ b/fer/plt/vp_axlim2lim.F
@@ -0,0 +1,173 @@
+      SUBROUTINE VP_AXLIM2LIM( scale, xloax, yloax, xhiax, yhiax,
+     .                                xlovp, ylovp, xhivp, yhivp,
+     .                                xoei,  yoei,  xcei,  ycei )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the viewport limits that are implied from viewport limits
+* specified ax axis endpoint positions
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V540: 9/01 *sh*
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+       IMPLICIT NONE
+
+       INCLUDE 'tmap_dims.parm'
+       INCLUDE 'ferret.parm'
+       INCLUDE 'xprog_state.cmn'
+       INCLUDE 'xplot_state.cmn'
+       INCLUDE 'xplot_setup.cmn'
+       INCLUDE 'plt_inc.decl'     ! with width, height
+       INCLUDE 'PLT.INC'
+       INCLUDE 'axis_inc.decl'    ! with xorg, yorg, xlen, ylen
+       INCLUDE 'AXIS.INC'
+       
+* calling argument declarations:
+       REAL*4  scale, xlovp, ylovp, xhivp, yhivp,
+     .         xcei, ycei, xoei, yoei,
+     .         xloax, yloax, xhiax, yhiax
+
+* internal variable declarations:
+       REAL*4  xcv, xov, ycv, yov, xwpi, ywpi
+
+* *** VIEWPORTS SPECIFIED BY AXIS ENDPOINTS ***
+* Previous to V5.4 all viewports were specified as the corners of the PLOT+
+* output window.  This made quick and dirty layouts very simple, but it
+* meant an arduous process for someone to carefully lay out a multi-frame
+* plot.
+* In V5.4 we introduce DEFINE VIEW/AXES, in which the viewport position
+* refers to the bounds of the active plotting area. The process of computing
+* the corresponding PLOT+ output window is complex because the layout is a
+* combination of normalized coordinates and PLOT+ "Denbo inches".
+*
+* The algorithm for determining the PLOT+ rectangle goes as follows.  It
+* applies identically for X and Y.
+*
+*     |-------------------------|
+*     |                         |
+*     |    |---------------|CV  |
+*     |    |               |    |
+*     |    |   +++++++++CA |    |
+*     |    |   +       +   |    |
+*     |    |-OE-       -CE-|    |
+*     |    |   +       +   |    |
+*     |    |   +       +   |    |
+*     |    | OA+++++++++   |    |
+*     |    |      WA       |    |
+*     |  OV|---------------|    |
+*     |           WV            |
+*     |-------------------------|
+*                 WP
+*
+* We begin with notation
+* "O" indicates an "origin" (lower left of a rectangle)
+* "C" indicates "clip" (upper right of a rectangle)
+* "W" indicates a width
+*
+* "V" indicates relative to the viewport
+* "A" indicates relative to the axes of the viewport
+* "E" indicates an "edge" distance -- the gap between the viewport and axes
+* "P" indicates relative to the "page" (the current output window or metafile)
+*
+* "i" indicates the value is in units of "Denbo inches"
+*     if "i" is absent it is normalized
+*
+* The known quantities are
+* WPi = scale*width  - width of the output page (with scale factor)
+* CA, OA - the limits of the axes given by the user in the DEF VIEW/AXES command
+* OEi, CEi - the PLOT+ origin (1.2,1.4) and white space above the axes (1.0,1.4)
+*
+* We shift to normalized units using
+*   OE = OEi/WPi
+*   CE = CEi/WPi
+*
+* Giving
+*   OV = OA - OE
+*      = OA - OEi/WPi
+* and similarly
+*   CV = CA + CEi/WPi
+*
+* Determining the desired PLOT+ output window is further complicated by the
+* ability of DEF VIEW/AXES to specify a viewport that implies a contradictory
+* layout with respect to the "white space" surrounding the active plot
+* rectangle.  For example, specifying an origin for the axes at 0,0 on the
+* output window leaves no room for white space.  Thus in this code we adjust
+* the PLOT+ origin as necessary to avoid this contradictory layout.
+
+* ... V5.22 default behaviors (viewport not specified by axis)
+
+        xov = xloax
+        xcv = xhiax
+        yov = yloax
+        ycv = yhiax
+
+        xwpi = scale * width
+        ywpi = scale * height
+
+        xcv = xcv + xcei/xwpi
+        ycv = ycv + ycei/ywpi
+        xov = xov - xoei/xwpi
+        yov = yov - yoei/ywpi
+
+* ... make adjustments if the normalized limits exceed allowable
+        IF (xcv .GT. 1.0) THEN
+          xcei = xcei + (1.0-xcv)*xwpi
+          xcv = 1.0
+        ENDIF
+        IF (ycv .GT. 1.0) THEN
+          ycei = ycei + (1.0-ycv)*ywpi
+          ycv = 1.0
+        ENDIF
+        IF (xov .LT. 0.0) THEN
+          xoei = xoei + xov*xwpi
+          xov = 0.0
+        ENDIF
+        IF (yov .LT. 0.0) THEN
+          yoei = yoei + yov*ywpi
+          yov = 0.0
+        ENDIF
+
+* results
+        xlovp = xov
+        ylovp = yov
+        xhivp = xcv
+        yhivp = ycv
+
+* success
+       RETURN
+       END
diff --git a/fer/plt/whoi_date.F b/fer/plt/whoi_date.F
new file mode 100644
index 0000000..4905ed1
--- /dev/null
+++ b/fer/plt/whoi_date.F
@@ -0,0 +1,106 @@
+	CHARACTER*14 FUNCTION WHOI_DATE( grid, idim, tstep )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a string of the form YYYYMMDDHHMMSS (was YYMMDDHHMM) from the time step
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/15/88
+* revision 0.1 - 1/18/89 - BREAK_DATE --> TM_BREAK_DATE
+* V200:  1/31/90 - fixed bug with climatological axes (years "0000" and "0001"
+*		   but produce the same WHOI dates)
+* V420: 11/27/95 - 4-digit YEARS!!
+* v530  12/19/00 *acm* cal_id for alternative calendar axis types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	REAL*8	tstep
+
+* internal variable declarations
+	INTEGER 	yr100, yr, mon, day, hr, min, sec,
+     .			status, i, axis
+	INTEGER		TM_GET_CALENDAR_ID, cal_id
+	CHARACTER*20	TM_SECS_TO_DATE, date
+	REAL*8		start_secs, offset_secs, this_secs
+	REAL*8		SECS_FROM_BC
+
+* get the axis number
+	axis = grid_line( idim, grid )
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   WHOI_DATE = '00000000000000'
+	   RETURN
+	ELSEIF ( line_direction(axis) .NE. 'TI' .AND. 
+     .           line_direction(axis) .NE. 'FI' ) THEN
+	   WHOI_DATE = '00000000000000'
+	   RETURN
+	ENDIF
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+
+        cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+	start_secs = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* Find the number of seconds since start of data set for this time step
+	offset_secs = tstep*line_tunit( axis )
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	this_secs = start_secs + offset_secs
+
+* Convert to date
+	date = TM_SECS_TO_DATE(this_secs, cal_id)
+
+* break the date string into component integer values
+	CALL TM_BREAK_DATE( date, cal_id, yr, mon, day, hr, min,
+     .                      sec, status )
+	yr100 = yr/100		! 1980 --> 19
+	yr = yr - (yr100*100)	! 1982 --> 82
+
+* assemble the pieces in WHOI format
+	WRITE (WHOI_DATE,3000) yr100,yr,mon,day,hr,min,sec
+ 3000	FORMAT (7I2.2)
+
+	RETURN
+	END
diff --git a/fer/plt/window_size_from_opts.F b/fer/plt/window_size_from_opts.F
new file mode 100644
index 0000000..1795163
--- /dev/null
+++ b/fer/plt/window_size_from_opts.F
@@ -0,0 +1,426 @@
+        SUBROUTINE WINDOW_SIZE_FROM_OPTS(windid, xinches, yinches, 
+     .                    xpixels, ypixels, physical_chg, istat)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY 
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Deal with SET WINDOW size options.  If there are no size options
+* specified and physical_chg if .FALSE., the routine immediately
+* returns without changing any values.  If any size options are 
+* given, physical_chg is set to .TRUE. and the size options are
+* processed.  If no size options are given but physical_chg is
+* .TRUE., default values based on the window DPI values are assigned.
+* This assumes that the window given by windid exists for FGD_GQDSP.
+*
+
+        IMPLICIT NONE
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'ferret.parm'
+        INCLUDE 'errmsg.parm'
+        INCLUDE 'plot_setup.parm'
+        INCLUDE 'xplot_setup.cmn'
+        INCLUDE 'xprog_state.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+* calling argument declarations:
+        REAL*4  xinches, yinches 
+        INTEGER windid, xpixels, ypixels, istat
+        LOGICAL physical_chg
+
+* function declaractions
+        CHARACTER UPPER_CASE*1
+*       the following are given below
+        REAL HEIGHT_FROM_AXIS_ASPECT, 
+     .       WIDTH_FROM_AXIS_ASPECT
+
+* local parameter declarations:
+        INTEGER slash_size,
+     .          slash_aspect,
+     .          slash_xpixels,
+     .          slash_ypixels,
+     .          slash_xinches,
+     .          slash_yinches
+        PARAMETER ( slash_size    =  0+1,
+     .              slash_aspect  =  3+1,
+     .              slash_xpixels = 13+1,
+     .              slash_ypixels = 14+1,
+     .              slash_xinches = 15+1,
+     .              slash_yinches = 16+1 )
+
+* internal variable declarations:
+        LOGICAL   size_gvn, aspect_gvn, 
+     .            xpixels_gvn, ypixels_gvn, 
+     .            xinches_gvn, yinches_gvn
+        INTEGER   qp, colon_pos, dspunit, imaxx, imaxy
+        REAL      val, aspect, xtmp, ytmp
+        REAL*4    dmaxx, dmaxy
+        CHARACTER buffer*80, numbuff*24, asp_ref*1
+
+*       No size changes during animation
+        IF ( animate ) 
+     .     GOTO 4990
+
+        size_gvn    = qual_given( slash_size )    .GT. 0
+        aspect_gvn  = qual_given( slash_aspect )  .GT. 0
+        xpixels_gvn = qual_given( slash_xpixels ) .GT. 0
+        ypixels_gvn = qual_given( slash_ypixels ) .GT. 0
+        xinches_gvn = qual_given( slash_xinches ) .GT. 0
+        yinches_gvn = qual_given( slash_yinches ) .GT. 0
+
+*       Check if there are any sizing options specified
+        IF ( .NOT. (physical_chg .OR. 
+     .              size_gvn .OR. aspect_gvn .OR. 
+     .              xpixels_gvn .OR. ypixels_gvn .OR. 
+     .              xinches_gvn .OR. yinches_gvn) ) 
+     .     GOTO 4990
+
+*       Check for conflicting sizing options
+        IF ( aspect_gvn .AND. xpixels_gvn .AND. ypixels_gvn ) 
+     .     GOTO 5010
+        IF ( aspect_gvn .AND. xinches_gvn .AND. yinches_gvn ) 
+     .     GOTO 5020
+        IF ( xpixels_gvn .AND. ypixels_gvn .AND. 
+     .       xinches_gvn .AND. yinches_gvn ) 
+     .     GOTO 5030
+        IF ( size_gvn .AND. (xpixels_gvn .OR. ypixels_gvn) )
+     .     GOTO 5040
+
+*       size options specified
+        physical_chg = .TRUE.
+
+*       Set the default page size and image size independent of window DPI
+        xinches = dflt_xinches
+        yinches = dflt_yinches
+        aspect  = dflt_yinches / dflt_xinches
+        xpixels = -1
+        ypixels = -1
+
+*       make sure we have the correct dpi's for this window
+        CALL FGD_GQDSP(windid, istat, dspunit,
+     .                 dmaxx, dmaxy, imaxx, imaxy)
+
+*       Default to edges for the aspect
+        asp_ref = 'E'
+        IF ( aspect_gvn ) THEN
+* ... decode the ratio and possible ":SIZE" or ":AXES" qualifier
+           qp = qual_given( slash_aspect )
+           CALL EQUAL_STRING(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                       buffer, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( istat .EQ. unspecified_val4 ) THEN
+              buffer = 'aspect ratio ?'
+              GOTO 5060
+           ENDIF
+           colon_pos = INDEX(buffer, ':')
+           IF ( colon_pos .GT. 0 ) THEN
+              numbuff = buffer(:colon_pos-1)
+              READ (numbuff, *, ERR=5050) aspect
+              asp_ref = UPPER_CASE(buffer(colon_pos+1:colon_pos+1))
+              IF ( (asp_ref .NE. 'A') .AND. (asp_ref .NE. 'E') ) 
+     .           GOTO 5050
+           ELSE
+              READ (buffer, *, ERR=5050) aspect
+           ENDIF
+           IF ( aspect .LE. 0.0 ) GOTO 5070
+        ENDIF
+
+*       Get the page size
+        IF ( xinches_gvn ) THEN
+           qp = qual_given( slash_xinches )
+           CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                    val, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( val .EQ. unspecified_val4 ) THEN
+              buffer = 'xinches value ?'
+              GOTO 5060
+           ENDIF
+           IF ( val .LT. 1.0 ) GOTO 5070
+           xinches = val
+        ENDIF
+        IF ( yinches_gvn ) THEN
+           qp = qual_given( slash_yinches )
+           CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                    val, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( val .EQ. unspecified_val4 ) THEN
+              buffer = 'yinches value ?'
+              GOTO 5060
+           ENDIF
+           IF ( val .LT. 1.0 ) GOTO 5070
+           yinches = val
+        ENDIF
+*       Get the aspect ratio if given by xinches and yinches
+        IF ( xinches_gvn .AND. yinches_gvn )
+     .     aspect = DBLE(yinches) / DBLE(xinches)
+
+*       Get the raster image size
+        IF ( xpixels_gvn ) THEN
+           qp = qual_given( slash_xpixels )
+           CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                    val, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( val .EQ. unspecified_val4 ) THEN
+              buffer = 'xpixels value ?'
+              GOTO 5060
+           ENDIF
+           xpixels = NINT(val)
+           IF ( xpixels .LT. 128 ) GOTO 5070
+        ENDIF
+        IF ( ypixels_gvn ) THEN
+           qp = qual_given( slash_ypixels )
+           CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                    val, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( val .EQ. unspecified_val4 ) THEN
+              buffer = 'ypixels value ?'
+              GOTO 5060
+           ENDIF
+           ypixels = NINT(val)
+           IF ( ypixels .LT. 128 ) GOTO 5070
+        ENDIF
+*       Get the aspect ratio if given by xpixels and ypixels
+        IF ( xpixels_gvn .AND. ypixels_gvn )
+     .     aspect = DBLE(ypixels) / DBLE(xpixels)
+
+*       Fill in missing xinches and yinches
+        IF ( xinches_gvn .AND. .NOT. yinches_gvn ) THEN
+           IF ( asp_ref .EQ. 'E' ) THEN
+              yinches = xinches * aspect
+           ELSE
+              yinches = HEIGHT_FROM_AXIS_ASPECT(xinches, aspect)
+           ENDIF
+           IF ( yinches .LT. 1.0 ) GOTO 5080
+        ELSEIF ( yinches_gvn .AND. .NOT. xinches_gvn ) THEN 
+           IF ( asp_ref .EQ. 'E' ) THEN
+              xinches = yinches / aspect
+           ELSE
+              xinches = WIDTH_FROM_AXIS_ASPECT(yinches, aspect)
+           ENDIF
+           IF ( xinches .LT. 1.0 ) GOTO 5080
+        ELSEIF ( .NOT. (xinches_gvn .OR. yinches_gvn) ) THEN
+           IF ( asp_ref .EQ. 'E' ) THEN
+              xtmp = SQRT(xinches * yinches / aspect)
+              ytmp = SQRT(xinches * yinches * aspect)
+              xinches = xtmp
+              yinches = ytmp
+           ELSE
+              xtmp = WIDTH_FROM_AXIS_ASPECT(yinches, aspect)
+              ytmp = HEIGHT_FROM_AXIS_ASPECT(xinches, aspect)
+*             Using the geometric means keeps the page area 
+*             the same and preserves the aspect ratio
+              xinches = SQRT(xtmp * xinches)
+              yinches = SQRT(yinches * ytmp)
+           ENDIF
+           IF ( (xinches .LT. 1.0) .OR. (yinches .LT. 1.0) ) GOTO 5080
+        ENDIF
+
+*       Change an axis aspect ratio to an edges aspect ratio
+        IF ( asp_ref .EQ. 'A' ) THEN
+           aspect = DBLE(yinches) / DBLE(xinches)
+           asp_ref = 'E'
+        ENDIF
+
+*       Fill in missing xpixels and ypixels if only one was given
+        IF ( xpixels_gvn .AND. .NOT. ypixels_gvn ) THEN
+           ypixels = NINT(xpixels * aspect)
+           IF ( ypixels .LT. 128 ) GOTO 5090
+        ELSEIF ( ypixels_gvn .AND. .NOT. xpixels_gvn ) THEN 
+           xpixels = NINT(ypixels / aspect)
+           IF ( xpixels .LT. 128 ) GOTO 5090
+        ENDIF
+
+*       Process /size if given instead of /xpixel and /ypixel
+*       For backwards compatibility; not really recommended anymore
+        IF ( size_gvn ) THEN
+           qp = qual_given( slash_size )
+           CALL EQUAL_VAL(cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                    val, istat)
+           IF ( istat .NE. ferr_ok ) RETURN
+           IF ( val .EQ. unspecified_val4 ) THEN
+              buffer = 'size value ?'
+              GOTO 5060
+           ENDIF
+        ELSE IF ( xinches_gvn .OR. yinches_gvn ) THEN
+*          If page size given, set default /SIZE=1.0
+           val = 1.0
+        ELSE
+*          Traditional Ferret had a default /SIZE=0.7
+           val = dflt_imgscale
+        ENDIF
+
+        IF ( .NOT. (xpixels_gvn .OR. ypixels_gvn) ) THEN
+*          Pixel size not specified; use the (possibly default) 
+*          page size at the window DPI, and scale by any /size value
+           xpixels = NINT(windowdpix(windid) * xinches * SQRT(val))
+           ypixels = NINT(windowdpiy(windid) * yinches * SQRT(val))
+           IF ( (xpixels .LT. 128) .OR. (ypixels .LT. 128) ) GOTO 5090
+        ENDIF
+
+* successful completion
+ 4990   istat = ferr_ok
+ 5000   RETURN
+
+* error returns
+ 5010   CALL ERRMSG(ferr_invalid_command, istat, 
+     .        'Only two of /ASPECT, /XPIXELS, and /YPIXELS '//
+     .        'can be given', *5000)
+ 5020   CALL ERRMSG(ferr_invalid_command, istat, 
+     .        'Only two of /ASPECT, /XINCHES, and /YINCHES '//
+     .        'can be given', *5000)
+ 5030   CALL ERRMSG(ferr_invalid_command, istat, 
+     .        'Only three of /XPIXLES, /YPIXELS, /XINCHES, '//
+     .        'and /YINCHES can be given', *5000)
+ 5040   CALL ERRMSG(ferr_invalid_command, istat, 
+     .        '/SIZE cannot be given along with '//
+     .        'either /XPIXLES or /YPIXELS', *5000)
+ 5050   buffer = cmnd_buff(qual_start(qp):qual_end(qp))
+ 5060   CALL ERRMSG(ferr_syntax, istat, buffer, *5000 )
+ 5070   buffer = cmnd_buff(qual_start(qp):qual_end(qp))
+        CALL ERRMSG(ferr_out_of_range, istat, buffer, *5000)
+ 5080   CALL ERRMSG(ferr_out_of_range, istat, 
+     .     'The implied size in inches is too small', *5000)
+ 5090   CALL ERRMSG(ferr_out_of_range, istat, 
+     .     'The implied size in pixels is too small', *5000)
+
+        END
+
+***********************************************************************
+*       The following solve the equation:
+*          (h - hm1 - hm2) / (w - wm1 -wm2) = asp
+*       for h given w, or for w given h,
+*       where hm1, hm2, wm1, wm2 are the scaled standard margins
+*       and the scaling is SQRT(w * h / (std_w * std_h))
+*       This reduces down to solving:
+*          h^2 - h * w * (V + 2 * asp) + w^2 * asp^2 = 0
+*       for h or w, where V is a term of only standard height, width, and margins
+***********************************************************************
+
+        REAL FUNCTION HEIGHT_FROM_AXIS_ASPECT(xin, asp)
+
+        IMPLICIT NONE
+        INCLUDE 'plot_setup.parm'
+
+* calling argument declarations:
+        REAL*4 xin
+        REAL asp
+
+* local argument declarations:
+        REAL val, sqval, rootp, rootm, yout,
+     .       sc, xax, yax, aspp, aspm
+
+        val = ( dflt_ywhitelo + dflt_ywhitehi
+     .          - asp * dflt_xwhitelo - asp * dflt_xwhitehi )
+        val = val * val
+     .        / (dflt_xinches * dflt_yinches)
+        val = val + 2.0 * asp
+        sqval = val * val - 4.0 * asp * asp
+*       .GT. instead of .NE. allows for some floating point precision error
+        IF ( sqval .GT. 0.0 ) THEN
+*          figure out which root to use
+*          if margins all the same, then rootp for asp < 1, rootm for asp > 1
+           rootp = val + SQRT(sqval)
+           yout = 0.5 * xin * rootp
+           sc = SQRT(xin * yout / (dflt_xinches * dflt_yinches))
+           xax = xin - sc * (dflt_xwhitelo + dflt_xwhitehi)
+           yax = yout - sc * (dflt_ywhitelo + dflt_ywhitehi)
+           aspp = yax / xax
+
+           rootm = val - SQRT(sqval)
+           yout = 0.5 * xin * rootm
+           sc = SQRT(xin * yout / (dflt_xinches * dflt_yinches))
+           xax = xin - sc * (dflt_xwhitelo + dflt_xwhitehi)
+           yax = yout - sc * (dflt_ywhitelo + dflt_ywhitehi)
+           aspm = yax / xax
+
+           IF ( ABS(aspp - asp) .LT. ABS(aspm - asp) ) THEN
+              val = rootp
+           ELSE
+              val = rootm
+           ENDIF
+        ENDIF
+
+        yout = 0.5 * xin * val
+        HEIGHT_FROM_AXIS_ASPECT = yout
+        RETURN
+        END
+
+***********************************************************************
+
+        REAL FUNCTION WIDTH_FROM_AXIS_ASPECT(yin, asp)
+
+        IMPLICIT NONE
+        INCLUDE 'plot_setup.parm'
+
+* calling argument declarations:
+        REAL*4 yin
+        REAL asp
+
+* local argument declarations:
+        REAL val, sqval, rootp, rootm, xout,
+     .       sc, xax, yax, aspp, aspm
+
+        val = ( dflt_ywhitelo + dflt_ywhitehi
+     .          - asp * dflt_xwhitelo - asp * dflt_xwhitehi )
+        val = val * val
+     .        / (dflt_xinches * dflt_yinches)
+        val = val + 2.0 * asp
+        sqval = val * val - 4.0 * asp * asp
+*       .GT. instead of .NE. allows for some floating point precision error
+        IF ( sqval .GT. 0.0 ) THEN
+*          figure out which root to use
+*          if margins all the same, then rootp for asp > 1, rootm for asp < 1
+           rootp = val + SQRT(sqval)
+           xout = 0.5 * yin * rootp / (asp * asp)
+           sc = SQRT(xout * yin / (dflt_xinches * dflt_yinches))
+           xax = xout - sc * (dflt_xwhitelo + dflt_xwhitehi)
+           yax = yin - sc * (dflt_ywhitelo + dflt_ywhitehi)
+           aspp = yax / xax
+
+           rootm = val - SQRT(sqval)
+           xout = 0.5 * yin * rootm / (asp * asp)
+           sc = SQRT(xout * yin / (dflt_xinches * dflt_yinches))
+           xax = xout - sc * (dflt_xwhitelo + dflt_xwhitehi)
+           yax = yin - sc * (dflt_ywhitelo + dflt_ywhitehi)
+           aspm = yax / xax
+
+           IF ( ABS(aspp - asp) .LT. ABS(aspm - asp) ) THEN
+              val = rootp
+           ELSE
+              val = rootm
+           ENDIF
+        ENDIF
+
+        xout = 0.5 * yin * val / (asp * asp)
+        WIDTH_FROM_AXIS_ASPECT = xout
+        RETURN
+        END
+
diff --git a/fer/pyf/LIB_NAME b/fer/pyf/LIB_NAME
new file mode 100644
index 0000000..5505771
--- /dev/null
+++ b/fer/pyf/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libpyf.a 
diff --git a/fer/pyf/Makefile b/fer/pyf/Makefile
new file mode 100644
index 0000000..14d00c4
--- /dev/null
+++ b/fer/pyf/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/pyf/SOURCE_FILES b/fer/pyf/SOURCE_FILES
new file mode 100644
index 0000000..2c6dbfd
--- /dev/null
+++ b/fer/pyf/SOURCE_FILES
@@ -0,0 +1,16 @@
+SRCS_F = \
+add_pystat_var.F \
+check_line_subset.F \
+check_time_line_subset.F \
+clear_fer_last_error_info.F \
+delete_all_pystat_vars.F \
+delete_pystat_dset_vars.F \
+delete_pystat_var.F \
+ef_get_single_axis_info.F \
+get_axis_num.F \
+get_data_array_coords.F \
+get_data_array_params.F \
+get_data_array_time_coords.F \
+get_fer_last_error_info.F \
+get_ferret_params.F \
+get_time_axis_num.F
diff --git a/fer/pyf/add_pystat_var.F b/fer/pyf/add_pystat_var.F
new file mode 100644
index 0000000..31c3ba4
--- /dev/null
+++ b/fer/pyf/add_pystat_var.F
@@ -0,0 +1,185 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Create a Python static variable in Ferret.  This is accomplished by
+* assigning the passed data to a slot in the XPYVAR_INFO common block.
+*
+* Input:
+*
+* Output:
+*
+
+      SUBROUTINE ADD_PYSTAT_VAR(ndarray_obj, codename, title, units,
+     .                      bdfval, dset, axis_nums, axis_starts,
+     .                      axis_ends, errmsg, lenerr)
+      IMPLICIT NONE
+
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'tmap_errors.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xprog_state.cmn'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xfr_grid.cmn'
+      INCLUDE 'xpyvar_info.cmn'
+
+*     Passed arguments
+      INTEGER*8     ndarray_obj
+      CHARACTER*(*) codename, title, units, dset, errmsg
+      REAL*8        bdfval
+      INTEGER       lenerr,
+     .              axis_nums(nferdims),
+     .              axis_starts(nferdims),
+     .              axis_ends(nferdims)
+
+*     Function declarations
+      INTEGER       TM_LENSTR, STR_UPCASE, FIND_DSET_NUMBER
+      LOGICAL       TM_LEGAL_NAME
+
+*     Local variables
+      INTEGER       k, ds_num, cx, vpos, category, ivar,
+     .              ingrid, outgrid, sts
+      CHARACTER*128 varname
+      LOGICAL       its_dyn
+
+*     Check the name for this pyvar
+      IF ( LEN(codename) .GT. 128 ) THEN
+          errmsg = 'variable name too long'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      IF ( .NOT. TM_LEGAL_NAME(codename) ) THEN
+          errmsg = 'variable name contains invalid characters'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      IF ( mode_upcase_output ) THEN
+          k = STR_UPCASE(varname, codename)
+      ELSE
+          varname = codename
+      ENDIF
+
+      IF ( dset .EQ. 'None' ) THEN
+*         do not associate with a dataset
+          ds_num = unspecified_int4
+      ELSE IF ( dset .EQ. '' ) THEN
+*         associate with the current dataset (if any)
+          ds_num = cx_data_set(cx_last)
+      ELSE
+*         associate with the indicated dataset
+          ds_num = FIND_DSET_NUMBER(dset)
+          IF ( ds_num .EQ. unspecified_int4 ) THEN
+              errmsg = 'Invalid dataset ' // dset
+              lenerr = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+      ENDIF
+
+*     Check if this variable will overwrite an existing variable
+*     in the associated dataset (if any).
+      CALL FIND_VAR_NAME(ds_num, varname, category, ivar)
+      IF ( ivar .NE. munknown_var_name ) THEN
+          IF ( category .EQ. cat_user_var ) THEN
+              CALL DELETE_USER_VAR(ivar)
+          ELSE IF ( category .EQ. cat_pystat_var ) THEN
+              CALL PURGE_PYSTAT_VAR(ivar)
+              CALL DELETE_PYSTAT_VAR(ivar, errmsg, lenerr)
+              IF ( lenerr .GT. 0 ) RETURN
+          ELSE
+              errmsg = 'File variable with the same name exists'
+              lenerr = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+          CALL PURGE_ALL_UVARS
+      ENDIF
+
+*     Find a slot for this pyvar
+      DO 10 vpos = 1,maxpyvars
+          IF ( pyvar_ndarray_obj(vpos) .EQ. 0 ) GOTO 20
+  10  CONTINUE
+      errmsg = 'No available slots for another Python-backed variable'
+      lenerr = TM_LENSTR(errmsg)
+      RETURN
+
+  20  CONTINUE
+*     Assign the code name into the array and hash table
+      CALL STRING_ARRAY_MODIFY(pyvar_code_head, vpos,
+     .                         varname, LEN(varname))
+*     Assign the rest of the data
+      pyvar_ndarray_obj(vpos) = ndarray_obj
+      pyvar_title(vpos) = title
+      pyvar_units(vpos) = units
+      pyvar_missing_flag(vpos) = bdfval
+      pyvar_dset_number(vpos) = ds_num
+*     Only floats supported at this time
+      pyvar_type(vpos) = ptype_float
+
+*     Use axis_nums to find or create a grid
+      CALL ALLO_GRID(ingrid, sts)
+      IF ( sts .NE. ferr_ok ) THEN
+          errmsg = 'Out of memory for a new temporary grid'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      CALL INIT_GRID(ingrid, '', mnormal)
+      DO 30 k = 1,nferdims
+          grid_line(k,ingrid) = axis_nums(k)
+          CALL TM_USE_LINE(axis_nums(k))
+   30 CONTINUE
+      CALL TM_GET_LIKE_DYN_GRID(ingrid, its_dyn, outgrid,
+     .                          grd_stk_ptr, sts)
+      IF ( sts .NE. merr_ok ) THEN
+          CALL DEALLO_GRID(sts)
+          errmsg = 'Out of memory for a new dynamic grid'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      pyvar_grid_number(vpos) = outgrid
+      CALL DEALLO_GRID(sts)
+
+*     Assign the start and end indices of the axes in this grid
+      DO 40 k = 1,nferdims
+          pyvar_grid_start(k,vpos) = axis_starts(k)
+          pyvar_grid_end(k,vpos) = axis_ends(k)
+   40 CONTINUE
+
+*     Success
+      errmsg = ' '
+      lenerr = 0
+      RETURN
+
+      END
+
diff --git a/fer/pyf/check_line_subset.F b/fer/pyf/check_line_subset.F
new file mode 100644
index 0000000..d66adf7
--- /dev/null
+++ b/fer/pyf/check_line_subset.F
@@ -0,0 +1,152 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*     Checks if a subsection of superline can describe the axis given
+*     by the rest of the arguments other that axisstart and axisend.
+*     If so, axisstart and axisend are assigned the first and last
+*     index of the coordinates of the line in superline.  A blank
+*     (empty) axisname will match any line name.
+*     Note: superline is assumed to be a valid line.
+*     Note: If superline is exactly the line described, axisstart will
+*           be assigned one and axisend will be assigned numcoords.
+*
+      LOGICAL FUNCTION CHECK_LINE_SUBSET(superline, axisstart, axisend,
+     .                               axisname, axisunit, axiscoords,
+     .                               numcoords, delta, eps, reg,
+     .                               modu, modulen, axucode)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      INTEGER       superline, axisstart, axisend,
+     .              numcoords, axucode
+      CHARACTER*(*) axisname, axisunit
+      REAL*8        axiscoords, delta, eps, modulen
+      LOGICAL       reg, modu
+      DIMENSION     axiscoords(numcoords)
+
+*     Local arguments
+      INTEGER       i, j, k
+      REAL*8        value
+
+*     First check the quick and easy, then go to the strings and coordinates
+      k = superline
+      IF ( .NOT. reg .EQV. line_regular(k) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( .NOT. modu .EQV. line_modulo(k) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( modu .AND. 
+     .     (abs(modulen - line_modulo_len(k)) .GT. eps) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( axucode .NE. line_unit_code(k) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( (axucode .EQ. 0) .AND. (axisunit .NE. line_units(k)) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( (axisname .NE. '') .AND. (axisname .NE. line_name(k)) ) THEN
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+*     Check the coordinates - may be a subset
+      IF ( reg ) THEN
+*         First check the spacing between coordinates
+          IF ( (numcoords .GT. 1) .AND.
+     .         (abs(delta - line_delta(k)) .GT. eps) ) THEN
+              CHECK_LINE_SUBSET = .FALSE.
+              RETURN
+          ENDIF
+*         Look for the first coordinate
+          DO 30 j = 1, line_dim(k)
+              value = line_start(k) + (j-1) * line_delta(k)
+              IF ( abs(value - axiscoords(1)) .LT. eps ) THEN
+*                 Verify the last coordinate is in there
+                  i = j + numcoords - 1
+                  IF ( i .GT. line_dim(k) ) THEN
+                      CHECK_LINE_SUBSET = .FALSE.
+                      RETURN
+                  ENDIF
+*                 Successfully found the regular axis
+                  axisstart = j
+                  axisend = i
+                  CHECK_LINE_SUBSET = .TRUE.
+                  RETURN
+              ENDIF
+  30      CONTINUE
+      ELSE
+*         Find the first coordinate
+          DO 40 j = 1, line_dim(k)
+              value = line_mem(line_subsc1(k) + j - 1)
+              IF ( abs(value - axiscoords(1)) .LT. eps ) THEN
+                  GOTO 50
+              ENDIF
+   40     CONTINUE
+*         First coordinate not found
+          CHECK_LINE_SUBSET = .FALSE.
+          RETURN
+*         First coordinate found; check the rest of the coordinates
+   50     IF ( (j + numcoords - 1) .GT. line_dim(k) ) THEN
+              CHECK_LINE_SUBSET = .FALSE.
+              RETURN
+          ENDIF
+          DO 60 i = 2, numcoords
+              value = line_mem(line_subsc1(k) + j + i - 2)
+              IF ( abs(value - axiscoords(i)) .GE. eps ) THEN
+                  CHECK_LINE_SUBSET = .FALSE.
+                  RETURN
+              ENDIF
+   60     CONTINUE
+*         Successfully found the irregular axis
+          axisstart = j
+          axisend = i
+          CHECK_LINE_SUBSET = .TRUE.
+          RETURN
+      ENDIF
+
+      CHECK_LINE_SUBSET = .FALSE.
+      RETURN
+
+      END
+
diff --git a/fer/pyf/check_time_line_subset.F b/fer/pyf/check_time_line_subset.F
new file mode 100644
index 0000000..7cd4ea2
--- /dev/null
+++ b/fer/pyf/check_time_line_subset.F
@@ -0,0 +1,185 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*     Checks if a subsection of superline can describe the axis given
+*     by the rest of the arguments other that axisstart and axisend.
+*     If so, axisstart and axisend are assigned the first and last
+*     index of the coordinates of the line in superline.  A blank
+*     (empty) axisname will match any line name.
+*     Note: superline is assumed to be a valid line.
+*     Note: If superline is exactly the line described, axisstart will
+*           be assigned one and axisend will be assigned numcoords.
+*     Note: axiscoords are assumed to be in units of time since
+*           01-JAN-0000 00:00:00, and adjustments to a different start
+*           for superline are made by this function.
+
+      LOGICAL FUNCTION CHECK_TIME_LINE_SUBSET(superline, axisstart,
+     .                            axisend, axisname, calid,
+     .                            axiscoords, numcoords, delta, eps,
+     .                            reg, modu, modulen, axucode)
+      IMPLICIT NONE
+
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'tmap_errors.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xunits.cmn_text'
+      EXTERNAL XUNITS_DATA
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      INTEGER       superline, axisstart, axisend,
+     .              calid, numcoords, axucode
+      CHARACTER*(*) axisname
+      REAL*8        axiscoords, delta, eps, modulen
+      LOGICAL       reg, modu
+      DIMENSION     axiscoords(numcoords)
+
+*     Function declarations
+      REAL*8        TM_SECS_FROM_BC
+
+*     Local arguments
+      INTEGER       i, j, k, sts,
+     .              t0yr, t0mon, t0day, t0hr, t0min, t0sec
+      REAL*8        base, value, factor
+
+*     First check the quick and easy, then go to the strings and coordinates
+      k = superline
+      IF ( .NOT. reg .EQV. line_regular(k) ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( .NOT. modu .EQV. line_modulo(k) ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+*     units can be different as long as they are time units
+      IF ( (line_unit_code(k) .LT. pun_1st_time) .OR.
+     .     (line_unit_code(k) .GT. pun_last_time) ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+*     Adjustment factor for unit conversion from superline to the described line
+      factor = un_convert(line_unit_code(k)) / un_convert(axucode)
+*     line_modulo_len not always set for time axes - ignore
+*     IF ( modu ) THEN
+*         value = line_modulo_len(k) * factor
+*         IF ( abs(modulen - value) .GT. eps ) THEN
+*             CHECK_LINE_SUBSET = .FALSE.
+*             RETURN
+*         ENDIF
+*     ENDIF
+      IF ( allowed_calendars(calid) .NE. line_cal_name(k) ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      IF ( (axisname .NE. '') .AND. (axisname .NE. line_name(k)) ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+*     Adjust for the t0 baseline of the line
+      CALL TM_BREAK_DATE(line_t0(k), calid, t0yr, t0mon,
+     .                   t0day, t0hr, t0min, t0sec, sts)
+      IF ( sts .NE. merr_ok ) THEN
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+      ENDIF
+      base = TM_SECS_FROM_BC(calid, t0yr, t0mon, t0day, t0hr, t0min,
+     .                    t0sec, sts) / un_convert(line_unit_code(k))
+*     Check the coordinates - may be a subset
+      IF ( reg ) THEN
+*         First check the spacing between coordinates
+          IF ( numcoords .GT. 1 ) THEN
+              value = line_delta(k) * factor
+              IF ( abs(delta - value) .GT. eps ) THEN
+                  CHECK_TIME_LINE_SUBSET = .FALSE.
+                  RETURN
+              ENDIF
+          ENDIF
+*         Look for the first coordinate
+          DO 130 j = 1, line_dim(k)
+              value = line_start(k) + (j-1) * line_delta(k) + base
+              value = value * factor
+              IF ( abs(value - axiscoords(1)) .LT. eps ) THEN
+*                 Verify the last coordinate is in there
+                  i = j + numcoords - 1
+                  IF ( i .GT. line_dim(k) ) THEN
+                      CHECK_TIME_LINE_SUBSET = .FALSE.
+                      RETURN
+                  ENDIF
+*                 Successfully found the regular axis
+                  axisstart = j
+                  axisend = i
+                  CHECK_TIME_LINE_SUBSET = .TRUE.
+                  RETURN
+              ENDIF
+ 130      CONTINUE
+      ELSE
+*         Find the first coordinate
+          DO 140 j = 1, line_dim(k)
+              value = line_mem(line_subsc1(k) + j - 1) + base
+              value = value * factor
+              IF ( abs(value - axiscoords(1)) .LT. eps ) THEN
+                  GOTO 150
+              ENDIF
+  140     CONTINUE
+*         First coordinate not found
+          CHECK_TIME_LINE_SUBSET = .FALSE.
+          RETURN
+*         First coordinate found; check the rest of the coordinates
+  150     IF ( (j + numcoords - 1) .GT. line_dim(k) ) THEN
+              CHECK_TIME_LINE_SUBSET = .FALSE.
+              RETURN
+          ENDIF
+          DO 160 i = 2, numcoords
+              value = line_mem(line_subsc1(k) + j + i - 2) + base
+              value = value * factor
+              IF ( abs(value - axiscoords(i)) .GE. eps ) THEN
+                  CHECK_TIME_LINE_SUBSET = .FALSE.
+                  RETURN
+              ENDIF
+  160     CONTINUE
+*         Successfully found the irregular axis
+          axisstart = j
+          axisend = i
+          CHECK_TIME_LINE_SUBSET = .TRUE.
+          RETURN
+      ENDIF
+
+      CHECK_TIME_LINE_SUBSET = .FALSE.
+      RETURN
+
+      END
+
diff --git a/fer/pyf/clear_fer_last_error_info.F b/fer/pyf/clear_fer_last_error_info.F
new file mode 100644
index 0000000..2103463
--- /dev/null
+++ b/fer/pyf/clear_fer_last_error_info.F
@@ -0,0 +1,49 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY 
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+
+
+
+*
+* Clears the last error message and resets the last error status value
+*
+      SUBROUTINE CLEAR_FER_LAST_ERROR_INFO()
+
+      IMPLICIT NONE
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xerrmsg_text.cmn'
+
+      INTEGER IER
+      last_error = ferr_ok;
+      CALL DELSYM('FER_LAST_ERROR', IER)
+
+      RETURN
+      END
diff --git a/fer/pyf/delete_all_pystat_vars.F b/fer/pyf/delete_all_pystat_vars.F
new file mode 100644
index 0000000..2c4143d
--- /dev/null
+++ b/fer/pyf/delete_all_pystat_vars.F
@@ -0,0 +1,57 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+*
+* Delete all pystat variables in Ferret.
+* Also purges all ferret-memory copies of all pystat variables.
+*
+
+      SUBROUTINE DELETE_ALL_PYSTAT_VARS()
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xpyvar_info.cmn'
+
+      CHARACTER*2048 errmsg
+      INTEGER k, lenerr
+
+      CALL PURGE_ALL_PYSTAT_VARS()
+      DO 200 k = 1,maxpyvars
+          IF ( pyvar_ndarray_obj(k) .NE. 0 ) THEN
+              CALL DELETE_PYSTAT_VAR(k, errmsg, lenerr)
+          ENDIF
+  200 CONTINUE
+      RETURN
+
+      END
+
diff --git a/fer/pyf/delete_pystat_dset_vars.F b/fer/pyf/delete_pystat_dset_vars.F
new file mode 100644
index 0000000..2b1cf17
--- /dev/null
+++ b/fer/pyf/delete_pystat_dset_vars.F
@@ -0,0 +1,62 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Deletes all pystat variables associated with the given dataset number.
+* Also purges all ferret-memory copies of these pystat variables.
+*
+
+      SUBROUTINE DELETE_PYSTAT_DSET_VARS(dset_num)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xpyvar_info.cmn'
+
+*     Passed arguments
+      INTEGER dset_num
+
+      CHARACTER*2048 errmsg
+      INTEGER k, lenerr
+
+      CALL PURGE_PYSTAT_DSET_VARS(dset_num)
+      DO 100 k = 1,maxpyvars
+          IF ( (pyvar_ndarray_obj(k) .NE. 0) .AND.
+     .         (pyvar_dset_number(k) .EQ. dset_num) ) THEN
+              CALL DELETE_PYSTAT_VAR(k, errmsg, lenerr)
+          ENDIF
+  100 CONTINUE
+      RETURN
+
+      END
+
diff --git a/fer/pyf/delete_pystat_var.F b/fer/pyf/delete_pystat_var.F
new file mode 100644
index 0000000..908e957
--- /dev/null
+++ b/fer/pyf/delete_pystat_var.F
@@ -0,0 +1,95 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Delete a pystat variable.
+* NOTE: this does NOT purge ferret-memory copies of this variable.
+*       CALL PURGE_PYSTAT_VAR prior to calling this function
+*       to purge ferret-memory copies of only this variable.
+*
+* Input:
+*     ivar - the (Fortran) index of the pystat variable to delete.  The
+*            reference count to the python memory associated with this 
+*            data is decremented.
+*
+* Output:
+*     errmsg - error message if unsuccessful; blank if and only if successful
+*     lenerr - length of the actual error message; zero if and only if successful
+*
+
+      SUBROUTINE DELETE_PYSTAT_VAR(ivar, errmsg, lenerr)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xpyvar_info.cmn'
+
+*     Passed arguments
+      CHARACTER*(*) errmsg
+      INTEGER       ivar, lenerr
+
+      CHARACTER*2 undef_name
+      PARAMETER ( undef_name = '%%' )
+
+*     Function declarations
+      INTEGER TM_LENSTR
+
+      IF ( (ivar .LT. 1) .OR. (ivar .GT. maxpyvars) ) THEN
+          WRITE(errmsg,*) 'Invalid pystat variable number: ', ivar
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      IF ( pyvar_ndarray_obj(ivar) .EQ. 0 ) THEN
+          WRITE(errmsg,*) 'No pystat variable at position ', ivar
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+*     Decrement the reference count to the ndarray object
+      CALL DECREF_PYOBJ(pyvar_ndarray_obj(ivar))
+      pyvar_ndarray_obj(ivar) = 0
+
+*     Clear the name from the array and hash table
+      CALL STRING_ARRAY_MODIFY(pyvar_code_head, ivar,
+     .                         undef_name, LEN(undef_name))
+
+*     Decrement the reference count to the associated grid and its lines
+      CALL DEALLO_DYN_GRID(pyvar_grid_number(ivar))
+
+*     Success
+      errmsg = ' '
+      lenerr = 0
+      RETURN
+
+      END
+
diff --git a/fer/pyf/ef_get_single_axis_info.F b/fer/pyf/ef_get_single_axis_info.F
new file mode 100644
index 0000000..185148e
--- /dev/null
+++ b/fer/pyf/ef_get_single_axis_info.F
@@ -0,0 +1,94 @@
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+* Retrieves information about an axis of a grid argument to an
+* external function.  Designed to be an C-callable interface
+* (assuming Hollerith strings in C are just character arrays
+* with array length appended to the argument list), so strings
+* are null-terminated and 0/1 are assigned for logicals.
+*
+
+      SUBROUTINE EF_GET_SINGLE_AXIS_INFO(id, iarg, iaxis, axis_name,
+     .         axis_unit, backwards_axis, modulo_axis, regular_axis)
+
+      IMPLICIT NONE
+      INCLUDE 'tmap_dims.parm'
+
+      INTEGER id, iarg, iaxis
+      CHARACTER*(*) axis_name, axis_unit
+      INTEGER backwards_axis, modulo_axis, regular_axis
+
+      CHARACTER*(64) axnames(nferdims), axunits(nferdims)
+      LOGICAL axbackwards(nferdims), axmodulos(nferdims), 
+     .        axregulars(nferdims)
+      INTEGER TM_LENSTR, namelen
+
+*     Get the information for all the axes (avoid duplication of code)
+      CALL EF_GET_AXIS_INFO_6D(id, iarg, axnames, axunits,
+     .                         axbackwards, axmodulos, axregulars)
+
+*     Assign the values for the axis requested
+      namelen = TM_LENSTR(axnames(iaxis))
+      IF ( namelen .GT. 0 ) THEN
+          axis_name(1:namelen) = axnames(iaxis)
+      ENDIF
+      axis_name(namelen+1:namelen+1) = CHAR(0)
+
+      namelen = TM_LENSTR(axunits(iaxis))
+      IF ( namelen .GT. 0 ) THEN
+          axis_unit(1:namelen) = axunits(iaxis)
+      ENDIF
+      axis_unit(namelen+1:namelen+1) = CHAR(0)
+
+      IF ( axbackwards(iaxis) ) THEN
+          backwards_axis = 1
+      ELSE
+          backwards_axis = 0
+      ENDIF
+
+      IF ( axmodulos(iaxis) ) THEN
+          modulo_axis = 1
+      ELSE
+          modulo_axis = 0
+      ENDIF
+
+      IF ( axregulars(iaxis) ) THEN
+          regular_axis = 1
+      ELSE
+          regular_axis = 0
+      ENDIF
+
+      RETURN
+      END
+
diff --git a/fer/pyf/get_axis_num.F b/fer/pyf/get_axis_num.F
new file mode 100644
index 0000000..d1d4af0
--- /dev/null
+++ b/fer/pyf/get_axis_num.F
@@ -0,0 +1,242 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*     Assign axisnum, axisstart, and axisend with the number, start
+*     index, and end index of a line, either existing or created by
+*     this routine, that matches the rest of the axis information
+*     arguments.  An empty (blank) axisname will match all names of
+*     existing axes.  If an error occurs, errmsg will be assigned
+*     with the error message and lenerrmsg will be the length of that
+*     message (a positive value).  If successful, lenerrmsg will be
+*     zero on return.
+*         axiscoords is a array of floating-point axis coordinates
+
+      SUBROUTINE GET_AXIS_NUM(axisnum, axisstart, axisend,
+     .                        axisname, axisunit, axiscoords,
+     .                        numcoords, axistype, errmsg, lenerrmsg)
+      IMPLICIT NONE
+
+#include "gt_lib.parm"
+#include "tmap_dset.parm"
+      INCLUDE 'implicit.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'tmap_errors.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      CHARACTER*(*) axisname, axisunit, errmsg
+      INTEGER       axisnum, axisstart, axisend,
+     .              numcoords, axistype, lenerrmsg
+      REAL*8        axiscoords
+      DIMENSION     axiscoords(numcoords)
+
+*     Function declarations
+      INTEGER TM_LENSTR, TM_UNIT_ID, STR_UPCASE
+      LOGICAL TM_LEGAL_NAME, CHECK_LINE_SUBSET
+
+*     Local arguments
+      CHARACTER*(64) capaxname, uniqaxname
+      INTEGER        axucode, k, sts, first_pt, j
+      REAL*8         delta, eps, value, modulen
+      LOGICAL        reg, modu
+
+*     Sanity check
+      IF ( numcoords .LT. 1 ) THEN
+          errmsg = 'Non-positive numcoords passed to GET_AXIS_NUM'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+*     Uppercase the name for comparisons
+      IF ( axisname .NE. '' ) THEN
+          sts = STR_UPCASE(capaxname, axisname)
+          IF ( .NOT. TM_LEGAL_NAME(capaxname) ) THEN
+              errmsg = 'Invalid axis name given'
+              lenerrmsg = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+      ELSE
+          capaxname = ''
+      ENDIF
+
+*     Get the code number of known units; returns zero for unknown units
+      axucode = TM_UNIT_ID(axisunit)
+
+      IF ( numcoords .GT. 1 ) THEN
+          delta = (axiscoords(numcoords) - axiscoords(1)) /
+     .                       (numcoords - 1)
+      ELSE
+          delta = 0.0
+      ENDIF
+      eps = abs(delta) * 1.0E-7
+      IF ( eps .LT. 1.0E-14 ) THEN
+          eps = 1.0E-14
+      ENDIF
+*     Check for regular coordinates
+      reg = .TRUE.
+      DO 10 k = 2, numcoords-1
+         value = axiscoords(1) + (k-1) * delta
+         IF ( abs(value - axiscoords(k)) .GT. eps ) THEN
+             reg = .FALSE.
+             GOTO 20
+         ENDIF
+   10 CONTINUE
+
+*     Crude assumption:
+*        longitude are modular with a modulo of 360 deg
+*        and nothing else is modular.
+   20 IF ( axistype .EQ. AXISTYPE_LONGITUDE ) THEN
+          modu = .TRUE.
+          modulen = 360.0
+      ELSE
+          modu = .FALSE.
+          modulen = 0.0
+      ENDIF
+
+*     See if a dynamic line already exists containing the provided info
+      k = max_lines
+   50 k = line_flink(k)
+      IF ( k .LE. max_lines ) THEN
+          GOTO 100
+      ENDIF
+      IF ( line_class(k) .EQ. pline_class_basic ) THEN
+          IF ( CHECK_LINE_SUBSET(k, axisstart, axisend, capaxname,
+     .                    axisunit, axiscoords, numcoords, delta, eps,
+     .                    reg, modu, modulen, axucode) ) THEN
+              axisnum = k
+              GOTO 500
+          ENDIF
+      ENDIF
+      GOTO 50
+
+*     See if a permanent line already exists containing the provided info
+ 100  CONTINUE
+      DO 110 k = 1, max_lines
+          IF ( (line_class(k) .EQ. pline_class_basic) .AND.
+     .         (line_name(k) .NE. char_init16) ) THEN
+              IF ( CHECK_LINE_SUBSET(k, axisstart, axisend, capaxname,
+     .                   axisunit, axiscoords, numcoords, delta, eps,
+     .                   reg, modu, modulen, axucode) ) THEN
+                  axisnum = k
+                  GOTO 500
+              ENDIF
+          ENDIF
+  110 CONTINUE
+
+*     If we got here, there is no line containing the provided info.
+      IF ( capaxname .NE. '' ) THEN
+*         If a name is given, make sure it is unique, or make it unique.
+*         Do this first so the newly created dynamic line will not interfere.
+          CALL TM_NEW_LINE_NAME(capaxname, uniqaxname)
+      ENDIF
+*     Now create the dynamic line
+      CALL TM_ALLO_DYN_LINE(k, sts)
+      IF ( sts .NE. merr_ok ) THEN
+          errmsg = 'No space left for a new dynamic line'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+*     Assign it a unique name.
+      IF ( capaxname .EQ. '' ) THEN
+          WRITE(line_name(k), 160) (k - max_lines)
+  160     FORMAT('(AX',I3.3,')')
+          line_name_orig(k) = line_name(k)
+      ELSE
+          line_name(k)      = uniqaxname
+          line_name_orig(k) = axisname
+      ENDIF
+*     Assign the rest of the line info
+      line_units(k)         = axisunit
+      line_unit_code(k)     = axucode
+      line_t0(k)            = char_init20
+      line_shift_origin(k)  = .FALSE.
+      line_tunit(k)         = 0.0
+      line_parent(k)        = 0
+      line_class(k)         = pline_class_basic
+      line_modulo(k)        = modu
+      line_modulo_len(k)    = modulen
+      IF ( axistype .EQ. AXISTYPE_LONGITUDE ) THEN
+          line_direction(k) = axis_orients(1)
+      ELSE IF ( axistype .EQ. AXISTYPE_LATITUDE ) THEN
+          line_direction(k) = axis_orients(2)
+      ELSE IF ( axistype .EQ. AXISTYPE_LEVEL ) THEN
+          line_direction(k) = axis_orients(3)
+      ELSE
+          line_direction(k) = 'NA'
+      ENDIF
+      line_dim(k)           = numcoords
+      line_regular(k)       = reg
+      IF ( reg ) THEN
+          line_subsc1(k)    = unspecified_int4
+          line_start(k)     = axiscoords(1)
+          line_delta(k)     = delta
+      ELSE
+          first_pt          = next_line_mem_pos
+          next_line_mem_pos = first_pt + 2 * numcoords + 1
+          IF ( next_line_mem_pos .GT. maxlinestore ) THEN
+              CALL TM_DEALLO_DYN_LINE(k)
+              errmsg = 'No space left for a new irregular line'
+              lenerrmsg = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+*         Store the coordinates
+          DO 170 j = 1, numcoords
+              line_mem(first_pt + j - 1) = axiscoords(j)
+  170     CONTINUE
+*         Compute and store the box boundries
+          line_mem(first_pt + numcoords) =
+     .         axiscoords(1) - 0.5 * (axiscoords(2) - axiscoords(1))
+          DO 180 j = 2, numcoords
+              line_mem(first_pt + numcoords + j - 1) =
+     .            0.5 * (axiscoords(j) + axiscoords(j-1))
+  180     CONTINUE
+          line_mem(first_pt + 2 * numcoords) = axiscoords(numcoords) +
+     .         0.5 * (axiscoords(numcoords) - axiscoords(numcoords-1))
+*         Assign the line info
+          line_subsc1(k)    = first_pt
+          line_start(k)     = axiscoords(1)
+          line_delta(k)     = unspecified_val8
+      ENDIF
+      line_use_cnt(k)       = 0
+
+      axisnum = k
+      axisstart = 1
+      axisend = numcoords
+
+  500 lenerrmsg = 0
+      RETURN
+
+      END
+
diff --git a/fer/pyf/get_data_array_coords.F b/fer/pyf/get_data_array_coords.F
new file mode 100644
index 0000000..8f5efdb
--- /dev/null
+++ b/fer/pyf/get_data_array_coords.F
@@ -0,0 +1,133 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Return coordinates for an axis of a data array loaded and described
+* from a call to GET_DATA_ARRAY_PARAMS
+*
+* Input:
+*     axnum - axis number to return coordinates
+*     numcoords - number of coordinates for this axis (for error checking)
+*     errmsg - error message if an error occurs
+*     lenerr - actual length of errmsg, will be zero if and only if no errors
+*
+* Output:
+*     axcoords - axis coordinates
+*     axunits - axis unit name - null terminated
+*     axname - axis name - null terminated
+*
+      SUBROUTINE GET_DATA_ARRAY_COORDS(axcoords, axunits, axname,
+     .                          axnum, numcoords, errmsg, lenerr)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xunits.cmn_text'
+      EXTERNAL XUNITS_DATA
+      INCLUDE 'xvariables.cmn'
+
+*     Passed arguments
+      CHARACTER*(*) axunits, errmsg, axname
+      INTEGER       axnum, numcoords, lenerr
+      REAL*8        axcoords(numcoords)
+
+*     Function declarations
+      INTEGER TM_LENSTR
+      LOGICAL GEOG_LABEL
+      REAL*8  TM_WORLD
+
+*     Local variables
+      INTEGER cx, grid, line, ss_low, ss_high, k, q
+
+      cx = is_cx(isp)
+      grid = cx_grid(cx)
+      IF ( grid .EQ. unspecified_int4 ) THEN
+          errmsg = 'Unexpected error: no grid found'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+      line = grid_line(axnum, grid)
+      IF ((line .EQ. munknown) .OR. (line .EQ. mnormal)) THEN
+          errmsg = 'Unexpected error: unknown or normal axis'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+      ss_low = cx_lo_ss(cx, axnum)
+      ss_high = cx_hi_ss(cx, axnum)
+      IF ( (ss_high - ss_low + 1) .NE. numcoords ) THEN
+          errmsg = 'Unexpected error: mismatch of the number of coords'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      DO 10 k = ss_low,ss_high
+          q = k - ss_low + 1
+          axcoords(q) = TM_WORLD(k, grid, axnum, box_middle)
+   10 CONTINUE
+
+      IF ( ((axnum .EQ. 1) .OR. (axnum .EQ. 2)) .AND.
+     .      GEOG_LABEL(axnum, grid) ) THEN
+*         Ferret standard longitude or latitude axis
+*         Set units to match cdms2 defaults for longitude and latitude
+          IF ( axnum .EQ. 1 ) THEN
+              axunits = 'degrees_east' // CHAR(0)
+          ELSE
+              axunits = 'degrees_north' // CHAR(0)
+          ENDIF
+      ELSE
+*         Use the stored units string, if assigned
+          k = TM_LENSTR(line_units(line))
+          IF ( k .GT. 0 ) THEN
+              axunits = line_units(line)(1:k) // CHAR(0)
+          ELSE
+              axunits(1:1) = CHAR(0)
+          ENDIF
+      ENDIF
+
+      k = TM_LENSTR(line_name(line))
+      IF ( k .GT. 0 ) THEN
+          axname = line_name(line)(1:k) // CHAR(0)
+      ELSE
+          axname = CHAR(0)
+      ENDIF
+
+      errmsg = ' '
+      lenerr = 0
+      RETURN
+
+      END
+
diff --git a/fer/pyf/get_data_array_params.F b/fer/pyf/get_data_array_params.F
new file mode 100644
index 0000000..cb68cdb
--- /dev/null
+++ b/fer/pyf/get_data_array_params.F
@@ -0,0 +1,180 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Return memory array parameters/indices for a float data array
+* described by datnam
+*
+* Input:
+*     datnam - description of the data array to retrieve
+*     lennam - actual length of datnam
+*     memory - ferret memory
+*
+* Output:
+*     start - offset into memory giving the start of the data array
+*     memlo, memhi - array dimensions
+*                    (memlo() = memhi() = -999 for invalid axes)
+*     steplo, stephi, incr - step values for the actual data requested
+*                    (steplo() = stephi() = -999 for invalid axes; incr always 1)
+*     datunit - units of the data
+*     axtyp - AXISTYPE parameter values describing the axes
+*     badflg - value of the bad-data-flag for this data
+*     errmsg - error message if an error occurs
+*     lenerr - actual length of errmsg, will be zero if and only if no errors
+*
+      SUBROUTINE GET_DATA_ARRAY_PARAMS(datnam, lennam, memory, start,
+     .                          memlo, memhi, steplo, stephi, incr,
+     .                          datunit, lendatunit, axtyp, badflg,
+     .                          errmsg, lenerr)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xerrmsg_text.cmn'
+      INCLUDE 'xprog_state.cmn'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      CHARACTER*(*) datnam, datunit, errmsg
+      INTEGER       lennam, start, lenerr, lendatunit,
+     .              memlo(nferdims), memhi(nferdims),
+     .              steplo(nferdims), stephi(nferdims),
+     .              incr(nferdims), axtyp(nferdims)
+      REAL          memory(*), badflg
+
+*     Function declarations
+      INTEGER TM_LENSTR
+      LOGICAL GEOG_LABEL
+      CHARACTER*(64) VAR_UNITS
+
+*     Local variables
+      INTEGER sts, mr, cx, k, cmnd_stack_level, grid, line
+
+*     Use GET_FER_COMMAND with a LOAD command to deal with parsing the data description
+      CALL GET_FER_COMMAND(memory, 'LOAD ' // datnam(1:lennam), sts, *1000)
+
+*     Get the data into memory
+      CALL GET_CMND_DATA(memory, cx_last, ptype_float, sts)
+      IF ( sts .NE. FERR_OK ) THEN
+           GOTO 1000
+      ENDIF
+
+      mr = is_mr(isp)
+      cx = is_cx(isp)
+
+*     Starting place in memory for this array
+      start = (mr_blk1(mr) - 1) * mem_blk_size
+
+*     Step values for this array.
+*     If the whole array was not requested, a new copy of the data
+*     has been made in memory with unit increments (or so it appears).
+      DO 20 k = 1,nferdims
+          memlo(k) = mr_lo_ss(mr,k)
+          memhi(k) = mr_hi_ss(mr,k)
+          steplo(k) = cx_lo_ss(cx,k)
+          stephi(k) = cx_hi_ss(cx,k)
+          incr(k) = 1
+   20 CONTINUE
+
+*     Units of the data
+      datunit = VAR_UNITS(cx)
+      lendatunit = TM_LENSTR(datunit)
+
+*     Axis types
+      grid = cx_grid(cx)
+      IF ( grid .EQ. unspecified_int4 ) THEN
+          errmsg = 'Unexpected error: no grid found'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      DO 30 k = 1,nferdims
+          IF ( GEOG_LABEL(k, grid) ) THEN
+*             In Ferret, if a special {longitude,latitude,level,time} axis,
+*             they have to be axis {1,2,3,4}.
+*             Do not do axtype(k) = k in case the parameter values change.
+              IF ( k .EQ. 1 ) THEN
+                  axtyp(k) = AXISTYPE_LONGITUDE
+              ELSE IF ( k .EQ. 2 ) THEN
+                  axtyp(k) = AXISTYPE_LATITUDE
+              ELSE IF ( k .EQ. 3 ) THEN
+                  axtyp(k) = AXISTYPE_LEVEL
+              ELSE IF ( k .EQ. 4 ) THEN
+                  axtyp(k) = AXISTYPE_TIME
+              ELSE
+                  errmsg = 'Unexpected error: unknown geographical axis'
+                  lenerr = TM_LENSTR(errmsg)
+                  RETURN
+              ENDIF
+          ELSE
+*             Either custom (has units), abstract (integers without units), or normal to this data
+              line = grid_line(k,grid)
+              IF ((line .EQ. mnormal) .OR. (line .EQ. munknown)) THEN
+                  axtyp(k) = AXISTYPE_NORMAL
+              ELSE IF ( line_unit_code(line) .NE. 0 ) THEN
+                  axtyp(k) = AXISTYPE_CUSTOM
+              ELSE IF ( line_units(line) .NE. ' ' ) THEN
+                  axtyp(k) = AXISTYPE_CUSTOM
+              ELSE
+                  axtyp(k) = AXISTYPE_ABSTRACT
+              ENDIF
+          ENDIF
+   30 CONTINUE
+
+*     Bad-data-flag value
+      badflg = mr_bad_data(mr)
+
+*     Success
+      errmsg = ' '
+      lenerr = 0
+      RETURN
+
+*     Error return - get message from FER_LAST_ERROR
+ 1000 CONTINUE
+      CALL CLEANUP_LAST_CMND(cmnd_stack_level)
+      CALL GETSYM('FER_LAST_ERROR', errmsg, lenerr, sts)
+      IF ( (lenerr .EQ. 1) .AND. (errmsg(1:1) .EQ. ' ') ) THEN
+          lenerr = 0
+      ENDIF
+      IF ( lenerr .LE. 0 ) THEN
+          errmsg = 'Unable to load ' // datnam(1:lennam)
+          lenerr = TM_LENSTR(errmsg)
+      ENDIF
+      RETURN
+
+      END
+
diff --git a/fer/pyf/get_data_array_time_coords.F b/fer/pyf/get_data_array_time_coords.F
new file mode 100644
index 0000000..cd6f86f
--- /dev/null
+++ b/fer/pyf/get_data_array_time_coords.F
@@ -0,0 +1,186 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Return time integer array coordinates for an axis of a data array loaded
+* and described from a call to GET_DATA_ARRAY_PARAMS
+*
+* Input:
+*     axnum - axis number to return coordinates
+*     numcoords - number of coordinates for this axis (for error checking)
+*     errmsg - error message if an error occurs
+*     lenerr - actual length of errmsg, will be zero if and only if no errors
+*
+* Output:
+*     axcoords - time integer array coordinates
+*     caltyp - CALTYPE parameter number identifying the calendar
+*     axname - axis name - null terminated
+*
+      SUBROUTINE GET_DATA_ARRAY_TIME_COORDS(axcoords, caltyp, axname,
+     .                               axnum, numcoords, errmsg, lenerr)
+      IMPLICIT NONE
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      CHARACTER*(*) axname, errmsg
+      INTEGER       caltyp, axnum, numcoords, lenerr
+      INTEGER       axcoords(6,numcoords)
+
+*     Function declarations
+      INTEGER TM_LENSTR, TM_GET_CALENDAR_ID
+      LOGICAL GEOG_LABEL
+      REAL*8  TM_WORLD
+
+*     Local variables
+      INTEGER cx, grid, line, ss_low, ss_high, k, q,
+     .        day, month, year, hour, minute, second, cal_id
+      REAL*8 worldsecs
+      CHARACTER*32 timestr, monthstr, calname
+
+      cx = is_cx(isp)
+      grid = cx_grid(cx)
+      IF ( grid .EQ. unspecified_int4 ) THEN
+          errmsg = 'Unexpected error: no grid found'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+      line = grid_line(axnum, grid)
+      IF ((line .EQ. munknown) .OR. (line .EQ. mnormal)) THEN
+          errmsg = 'Unexpected error: unknown or normal axis'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+      ss_low = cx_lo_ss(cx, axnum)
+      ss_high = cx_hi_ss(cx, axnum)
+      IF ( (ss_high - ss_low + 1) .NE. numcoords ) THEN
+          errmsg = 'Unexpected error: mismatch of the number of coords'
+          lenerr = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      DO 100 k = ss_low,ss_high
+          worldsecs = TM_WORLD(k, grid, axnum, box_middle)
+          CALL TSTEP_TO_DATE_OLD(grid, worldsecs, 6, timestr)
+*         Try to read as DD-MTH-YYYY HH:MM:SS
+*         If fails, try another format
+          READ(timestr, FMT=110, ERR=20) day, monthstr, year,
+     .                                   hour, minute, second
+          GOTO 90
+*         Try to read as DD-MTH HH:MM:SS
+*         If fails, report error
+   20     READ(timestr, FMT=120, ERR=500) day, monthstr, 
+     .                                    hour, minute, second
+          year = 0
+   90     CONTINUE
+*         Convert month string to a number
+          IF ( monthstr .EQ. 'JAN' ) THEN
+              month = 1
+          ELSE IF ( monthstr .EQ. 'FEB' ) THEN
+              month = 2
+          ELSE IF ( monthstr .EQ. 'MAR' ) THEN
+              month = 3
+          ELSE IF ( monthstr .EQ. 'APR' ) THEN
+              month = 4
+          ELSE IF ( monthstr .EQ. 'MAY' ) THEN
+              month = 5
+          ELSE IF ( monthstr .EQ. 'JUN' ) THEN
+              month = 6
+          ELSE IF ( monthstr .EQ. 'JUL' ) THEN
+              month = 7
+          ELSE IF ( monthstr .EQ. 'AUG' ) THEN
+              month = 8
+          ELSE IF ( monthstr .EQ. 'SEP' ) THEN
+              month = 9
+          ELSE IF ( monthstr .EQ. 'OCT' ) THEN
+              month = 10
+          ELSE IF ( monthstr .EQ. 'NOV' ) THEN
+              month = 11
+          ELSE IF ( monthstr .EQ. 'DEC' ) THEN
+              month = 12
+          ELSE
+              GOTO 500
+          ENDIF
+          q = k - ss_low + 1
+          axcoords(TIMEARRAY_DAYINDEX,q) = day
+          axcoords(TIMEARRAY_MONTHINDEX,q) = month
+          axcoords(TIMEARRAY_YEARINDEX,q) = year
+          axcoords(TIMEARRAY_HOURINDEX,q) = hour
+          axcoords(TIMEARRAY_MINUTEINDEX,q) = minute
+          axcoords(TIMEARRAY_SECONDINDEX,q) = second
+  100 CONTINUE
+  110 FORMAT(I2,X,A3,X,I4,X,I2,X,I2,X,I2)
+  120 FORMAT(I2,X,A3,X,I2,X,I2,X,I2)
+
+      calname = line_cal_name(line)
+      cal_id = TM_GET_CALENDAR_ID(calname)
+      IF ( cal_id .EQ. gregorian ) THEN
+          caltyp = CALTYPE_GREGORIAN
+      ELSE IF ( cal_id .EQ. noleap ) THEN
+          caltyp = CALTYPE_NOLEAP
+      ELSE IF ( cal_id .EQ. julian ) THEN
+          caltyp = CALTYPE_JULIAN
+      ELSE IF ( cal_id .EQ. d360 ) THEN
+          caltyp = CALTYPE_360DAY
+      ELSE IF ( cal_id .EQ. all_leap ) THEN
+          caltyp = CALTYPE_ALLLEAP
+      ELSE
+          caltyp = CALTYPE_NONE
+      ENDIF
+
+      k = TM_LENSTR(line_name(line))
+      IF ( k .GT. 0 ) THEN
+          axname = line_name(line)(1:k) // CHAR(0)
+      ELSE
+          axname = CHAR(0)
+      ENDIF
+
+      errmsg = ' '
+      lenerr = 0
+      RETURN
+
+  500 errmsg = 'Unexpected date string: ' // timestr
+      lenerr = TM_LENSTR(errmsg)
+      RETURN
+
+      END
+
diff --git a/fer/pyf/get_fer_last_error_info.F b/fer/pyf/get_fer_last_error_info.F
new file mode 100644
index 0000000..97396ea
--- /dev/null
+++ b/fer/pyf/get_fer_last_error_info.F
@@ -0,0 +1,59 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Returns the last error status value, and the last error message,
+* which will be null terminated.
+*
+      SUBROUTINE GET_FER_LAST_ERROR_INFO(ERRVAL, ERRMSG)
+
+      IMPLICIT NONE
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'xerrmsg_text.cmn'
+
+      INTEGER ERRVAL
+      CHARACTER*(*) ERRMSG
+
+      INTEGER NC, IER
+
+      ERRVAL = last_error
+      CALL GETSYM('FER_LAST_ERROR', ERRMSG, NC, IER)
+      IF ( (NC .EQ. 1) .AND. (ERRMSG(1:1) .EQ. ' ') ) THEN
+          NC = 0
+      ENDIF
+      ERRMSG(NC+1:NC+1) = CHAR(0)
+
+      RETURN
+      END
+
diff --git a/fer/pyf/get_ferret_params.F b/fer/pyf/get_ferret_params.F
new file mode 100644
index 0000000..c74ea65
--- /dev/null
+++ b/fer/pyf/get_ferret_params.F
@@ -0,0 +1,216 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*
+* Returns a listing of ferret parameter values and appropriate names for these
+* values.  The ordering of the values in these arrays is not specified beyond
+* that a name is appropriate for the corresponding value.  The names are unique
+* in this list and are null terminated.
+*
+      SUBROUTINE GET_FERRET_PARAMS(NAMES, VALUES, NUMVALS)
+
+      IMPLICIT NONE
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'EF_Util.parm'
+
+      INTEGER MAXVALS
+      CHARACTER*32 NAMES(64)
+      INTEGER VALUES(64), NUMVALS
+
+      NAMES(1) = 'FERR_OK' // CHAR(0)
+      VALUES(1) = ferr_ok
+
+      NAMES(2) = 'FERR_ERREQ' // CHAR(0)
+      VALUES(2) = ferr_erreq
+
+      NAMES(3) = 'FERR_INTERRUPT' // CHAR(0)
+      VALUES(3) = ferr_interrupt
+
+      NAMES(4) = 'FERR_TMAP_ERROR' // CHAR(0)
+      VALUES(4) = ferr_tmap_error
+
+      NAMES(5) = 'FERR_ODR_ERROR' // CHAR(0)
+      VALUES(5) = ferr_odr_error
+
+      NAMES(6) = 'FERR_SILENT_ERROR' // CHAR(0)
+      VALUES(6) = ferr_silent
+
+      NAMES(7) = 'FERR_INSUFF_MEMORY' // CHAR(0)
+      VALUES(7) = ferr_insuff_memory
+
+      NAMES(8) = 'FERR_TOO_MANY_VARS' // CHAR(0)
+      VALUES(8) = ferr_too_many_vars
+
+      NAMES(9) = 'FERR_DEL_PERM_VAR' // CHAR(0)
+      VALUES(9) = ferr_perm_var
+
+      NAMES(10) = 'FERR_SYNTAX_ERROR' // CHAR(0)
+      VALUES(10) = ferr_syntax
+
+      NAMES(11) = 'FERR_UNKNOWN_QUALIFIER' // CHAR(0)
+      VALUES(11) = ferr_unknown_qualifier
+
+      NAMES(12) = 'FERR_UNKNOWN_VARIABLE' // CHAR(0)
+      VALUES(12) = ferr_unknown_variable
+
+      NAMES(13) = 'FERR_INVALID_COMMAND' // CHAR(0)
+      VALUES(13) = ferr_invalid_command
+
+      NAMES(14) = 'FERR_REGRID_ERROR' // CHAR(0)
+      VALUES(14) = ferr_regrid
+
+      NAMES(15) = 'FERR_CMND_TOO_COMPLEX' // CHAR(0)
+      VALUES(15) = ferr_cmnd_too_complex
+
+      NAMES(16) = 'FERR_UNKNOWN_DATA_SET' // CHAR(0)
+      VALUES(16) = ferr_unknown_data_set
+
+      NAMES(17) = 'FERR_TOO_MANY_ARGS' // CHAR(0)
+      VALUES(17) = ferr_too_many_args
+
+      NAMES(18) = 'FERR_NOT_IMPLEMENTED' // CHAR(0)
+      VALUES(18) = ferr_not_implemented
+
+      NAMES(19) = 'FERR_INVALID_SUBCMND' // CHAR(0)
+      VALUES(19) = ferr_invalid_subcmnd
+
+      NAMES(20) = 'FERR_RELATIVE_COORD_ERROR' // CHAR(0)
+      VALUES(20) = ferr_relative_coord
+
+      NAMES(21) = 'FERR_UNKNOWN_ARG' // CHAR(0)
+      VALUES(21) = ferr_unknown_arg
+
+      NAMES(22) = 'FERR_DIM_UNDERSPEC' // CHAR(0)
+      VALUES(22) = ferr_dim_underspec
+
+      NAMES(23) = 'FERR_GRID_DEF_ERROR' // CHAR(0)
+      VALUES(23) = ferr_grid_definition
+
+      NAMES(24) = 'FERR_INTERNAL_ERROR' // CHAR(0)
+      VALUES(24) = ferr_internal
+
+      NAMES(25) = 'FERR_LINE_TOO_LONG' // CHAR(0)
+      VALUES(25) = ferr_line_too_long
+
+      NAMES(26) = 'FERR_INCONSIST_PLANE' // CHAR(0)
+      VALUES(26) = ferr_inconsist_plane
+
+      NAMES(27) = 'FERR_INCONSIST_GRID' // CHAR(0)
+      VALUES(27) = ferr_inconsist_grid
+
+      NAMES(28) = 'FERR_EXPR_TOO_COMPLEX' // CHAR(0)
+      VALUES(28) = ferr_expr_too_complex
+
+      NAMES(29) = 'FERR_STACK_OVERFLOW' // CHAR(0)
+      VALUES(29) = ferr_stack_ovfl
+
+      NAMES(30) = 'FERR_STACK_UNDERFLOW' // CHAR(0)
+      VALUES(30) = ferr_stack_undfl
+
+      NAMES(31) = 'FERR_OUT_OF_RANGE' // CHAR(0)
+      VALUES(31) = ferr_out_of_range
+
+      NAMES(32) = 'FERR_PROG_LIMIT' // CHAR(0)
+      VALUES(32) = ferr_prog_limit
+
+      NAMES(33) = 'FERR_UNKNOWN_GRID' // CHAR(0)
+      VALUES(33) = ferr_unknown_grid
+
+      NAMES(34) = 'FERR_NO_RANGE' // CHAR(0)
+      VALUES(34) = ferr_no_range
+
+      NAMES(35) = 'FERR_VAR_NOT_IN_SET' // CHAR(0)
+      VALUES(35) = ferr_var_not_in_set
+
+      NAMES(36) = 'FERR_UNKNOWN_FILE_TYPE' // CHAR(0)
+      VALUES(36) = ferr_unknown_file_type
+
+      NAMES(37) = 'FERR_LIMITS_ERROR' // CHAR(0)
+      VALUES(37) = ferr_limits
+
+      NAMES(38) = 'FERR_DESCRIPTOR_ERROR' // CHAR(0)
+      VALUES(38) = ferr_descriptor
+
+      NAMES(39) = 'FERR_BAD_DELTA' // CHAR(0)
+      VALUES(39) = ferr_bad_delta
+
+      NAMES(40) = 'FERR_TRANSFORM_ERROR' // CHAR(0)
+      VALUES(40) = ferr_trans_nest
+
+      NAMES(41) = 'FERR_STATE_NOT_SET' // CHAR(0)
+      VALUES(41) = ferr_state_not_set
+
+      NAMES(42) = 'FERR_UNKNOWN_COMMAND' // CHAR(0)
+      VALUES(42) = ferr_unknown_command
+
+      NAMES(43) = 'FERR_EF_ERROR' // CHAR(0)
+      VALUES(43) = ferr_ef_error
+
+      NAMES(44) = 'FERR_DATA_TYPE_ERROR' // CHAR(0)
+      VALUES(44) = ferr_data_type
+
+      NAMES(45) = 'FERR_NO_COACH_MESSAGE' // CHAR(0)
+      VALUES(45) = ferr_nomessge
+
+      NAMES(46) = 'FERR_UNKNOWN_ATTRIBUTE' // CHAR(0)
+      VALUES(46) = ferr_unknown_attribute
+
+      NAMES(47) = 'FERR_NOT_ATTRIBUTE' // CHAR(0)
+      VALUES(47) = ferr_not_attribute
+
+      NAMES(48) = 'AXIS_CUSTOM' // CHAR(0)
+      VALUES(48) = custom
+
+      NAMES(49) = 'AXIS_IMPLIED_BY_ARGS' // CHAR(0)
+      VALUES(49) = implied_by_args
+
+      NAMES(50) = 'AXIS_DOES_NOT_EXIST' // CHAR(0)
+      VALUES(50) = normal
+
+      NAMES(51) = 'AXIS_ABSTRACT' // CHAR(0)
+      VALUES(51) = abstract
+
+      NAMES(52) = 'AXIS_REDUCED' // CHAR(0)
+      VALUES(52) = reduced
+
+      NAMES(53) = 'FLOAT_ARG' // CHAR(0)
+      VALUES(53) = float_arg
+
+      NAMES(54) = 'STRING_ARG' // CHAR(0)
+      VALUES(54) = string_arg
+
+      NUMVALS = 54
+      RETURN
+      END
+
diff --git a/fer/pyf/get_time_axis_num.F b/fer/pyf/get_time_axis_num.F
new file mode 100644
index 0000000..8f11813
--- /dev/null
+++ b/fer/pyf/get_time_axis_num.F
@@ -0,0 +1,333 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+*     Assign axisnum, axisstart, and axisend with the number, start
+*     index, and end index of a line, either existing or created by
+*     this routine, that matches the rest of the axis information
+*     arguments.  An empty (blank) axisname will match all names of
+*     existing axes.  If an error occurs, errmsg will be assigned
+*     with the error message and lenerrmsg will be the length of that
+*     message (a positive value).  If successful, lenerrmsg will be
+*     zero on return.
+*         axiscoords is a array of 6 integer time values per coordinate
+
+      SUBROUTINE GET_TIME_AXIS_NUM(axisnum, axisstart, axisend,
+     .                             axisname, caltype, axiscoords,
+     .                             numcoords, errmsg, lenerrmsg)
+      IMPLICIT NONE
+
+#include "gt_lib.parm"
+#include "tmap_dset.parm"
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+      INCLUDE 'implicit.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'tmap_errors.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'xunits.cmn_text'
+      EXTERNAL XUNITS_DATA
+      INCLUDE 'pyferret.parm'
+
+*     Passed arguments
+      CHARACTER*(*) axisname, errmsg
+      INTEGER       axisnum, axisstart, axisend, caltype,
+     .              axiscoords, numcoords, lenerrmsg
+      DIMENSION     axiscoords(6,numcoords)
+
+*     Function declarations
+      INTEGER TM_LENSTR, TM_UNIT_ID, STR_UPCASE
+      LOGICAL TM_LEGAL_NAME, CHECK_TIME_LINE_SUBSET
+      REAL*8  TM_SECS_FROM_BC
+
+*     Local arguments
+      CHARACTER*(64) capaxname, uniqaxname, axisunit
+      CHARACTER*(16) calname
+      INTEGER        sts, calid, k, axucode, first_pt, j
+      REAL*8         modulen, delta, eps, value, base
+      LOGICAL        modu, reg
+
+*     Sanity check
+      IF ( numcoords .LT. 1 ) THEN
+          errmsg = 'Non-positive numcoords passed to GET_TIME_AXIS_NUM'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+*     Uppercase the name for comparisons
+      IF ( axisname .NE. '' ) THEN
+          sts = STR_UPCASE(capaxname, axisname)
+          IF ( .NOT. TM_LEGAL_NAME(capaxname) ) THEN
+              errmsg = 'Invalid axis name given'
+              lenerrmsg = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+      ELSE
+          capaxname = ''
+      ENDIF
+
+*     Get the calendar for this axis and initialize axisunit
+      IF ( caltype .EQ. CALTYPE_360DAY ) THEN
+          calid = d360
+          axisunit = 'year360'
+      ELSE IF ( caltype .EQ. CALTYPE_NOLEAP ) THEN
+          calid = noleap
+          axisunit = 'noleap_year'
+      ELSE IF ( caltype .EQ. CALTYPE_GREGORIAN ) THEN
+          calid = gregorian
+          axisunit = 'gregorian_year'
+      ELSE IF ( caltype .EQ. CALTYPE_JULIAN ) THEN
+          calid = julian
+          axisunit = 'julian_year'
+      ELSE IF ( caltype .EQ. CALTYPE_ALLLEAP ) THEN
+          calid = all_leap
+          axisunit = 'year366'
+      ELSE
+          errmsg = 'Unknown calendar type'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+*     Figure out the unit for this time series
+      DO 10 k = 2, numcoords
+         IF ( axiscoords(TIMEARRAY_SECONDINDEX,k) .NE.
+     .        axiscoords(TIMEARRAY_SECONDINDEX,1) ) THEN
+             axisunit = 'sec'
+             GOTO 100
+         ENDIF
+   10 CONTINUE
+      DO 20 k = 2, numcoords
+         IF ( axiscoords(TIMEARRAY_MINUTEINDEX,k) .NE.
+     .        axiscoords(TIMEARRAY_MINUTEINDEX,1) ) THEN
+             axisunit = 'min'
+             GOTO 100
+         ENDIF
+   20 CONTINUE
+      DO 30 k = 2, numcoords
+         IF ( axiscoords(TIMEARRAY_HOURINDEX,k) .NE.
+     .        axiscoords(TIMEARRAY_HOURINDEX,1) ) THEN
+             axisunit = 'hour'
+             GOTO 100
+         ENDIF
+   30 CONTINUE
+      DO 40 k = 2, numcoords
+         IF ( axiscoords(TIMEARRAY_DAYINDEX,k) .NE.
+     .        axiscoords(TIMEARRAY_DAYINDEX,1) ) THEN
+             axisunit = 'day'
+             GOTO 100
+         ENDIF
+   40 CONTINUE
+      DO 50 k = 2, numcoords
+         IF ( axiscoords(TIMEARRAY_MONTHINDEX,k) .NE.
+     .        axiscoords(TIMEARRAY_MONTHINDEX,1) ) THEN
+*            A "month" unit is ill-defined so Ferret uses days
+             axisunit = 'day'
+             GOTO 100
+         ENDIF
+   50 CONTINUE
+*     Use the initialized year axisunit
+  100 axucode = TM_UNIT_ID(axisunit)
+      IF ( (axucode .LT. pun_1st_time) .OR.
+     .     (axucode .GT. pun_last_time) ) THEN
+          errmsg = 'Unexpected unknown time unit'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+
+*     If all years are zero, assume annual modulo axis
+      DO 110 k = 1, numcoords
+          IF ( axiscoords(TIMEARRAY_YEARINDEX,k) .NE. 0 ) THEN
+              modu = .FALSE.
+              modulen = 0
+              GOTO 150
+          ENDIF
+  110 CONTINUE
+      modu = .TRUE.
+      modulen = cals_yeardays(calid) * (24.0 * 60.0 * 60.0) /
+     .                  un_convert(axucode)
+
+*     Temporarily grab memory for floating-point time coordinates
+  150 first_pt = next_line_mem_pos
+      IF ( first_pt + numcoords .GT. maxlinestore ) THEN
+          errmsg = 'No memory for floating-point time coordinates'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+      DO 160 k = 1, numcoords
+          line_mem(first_pt + k - 1) = TM_SECS_FROM_BC(calid,
+     .                        axiscoords(TIMEARRAY_YEARINDEX,k),
+     .                        axiscoords(TIMEARRAY_MONTHINDEX,k),
+     .                        axiscoords(TIMEARRAY_DAYINDEX,k),
+     .                        axiscoords(TIMEARRAY_HOURINDEX,k),
+     .                        axiscoords(TIMEARRAY_MINUTEINDEX,k),
+     .                        axiscoords(TIMEARRAY_SECONDINDEX,k),
+     .                        sts) / un_convert(axucode)
+  160 CONTINUE
+      IF ( numcoords .GT. 1 ) THEN
+          delta = (line_mem(first_pt + numcoords - 1) -
+     .             line_mem(first_pt)) / (numcoords - 1)
+      ELSE
+          delta = 0.0
+      ENDIF
+      eps = abs(delta) * 1.0E-7
+      IF ( eps .LT. 1.0E-14 ) THEN
+          eps = 1.0E-14
+      ENDIF
+*     Check for regular coordinates
+      reg = .TRUE.
+      DO 170 k = 2, numcoords-1
+         value = line_mem(first_pt) + (k-1) * delta
+         IF ( abs(value - line_mem(first_pt + k - 1)) .GT. eps ) THEN
+             reg = .FALSE.
+             GOTO 200
+         ENDIF
+  170 CONTINUE
+
+*     See if a dynamic line already exists containing the provided info
+  200 k = max_lines
+  210 k = line_flink(k)
+      IF ( k .LE. max_lines ) THEN
+          GOTO 300
+      ENDIF
+      IF ( (line_class(k) .EQ. pline_class_basic) .AND.
+     .     (line_t0(k) .NE. char_init20) ) THEN
+          IF ( CHECK_TIME_LINE_SUBSET(k, axisstart, axisend, capaxname,
+     .                    calid, line_mem(first_pt), numcoords, delta,
+     .                    eps, reg, modu, modulen, axucode) ) THEN
+              axisnum = k
+              GOTO 500
+          ENDIF
+      ENDIF
+      GOTO 210
+
+*     See if a permanent line already exists containing the provided info
+ 300  CONTINUE
+      DO 310 k = 1, max_lines
+          IF ( (line_class(k) .EQ. pline_class_basic) .AND.
+     .         (line_name(k) .NE. char_init16) .AND.
+     .         (line_t0(k) .NE. char_init20) ) THEN
+              IF ( CHECK_TIME_LINE_SUBSET(k, axisstart, axisend,
+     .                   capaxname, calid, line_mem(first_pt),
+     .                   numcoords, delta, eps, reg, modu, modulen,
+     .                   axucode) ) THEN
+                  axisnum = k
+                  GOTO 500
+              ENDIF
+          ENDIF
+  310 CONTINUE
+
+*     If we got here, there is no line containing the provided info.
+      IF ( capaxname .NE. '' ) THEN
+*         If a name is given, make sure it is unique, or make it unique.
+*         Do this first so the newly created dynamic line will not interfere.
+          CALL TM_NEW_LINE_NAME(capaxname, uniqaxname)
+      ENDIF
+*     Now create the dynamic line
+      CALL TM_ALLO_DYN_LINE(k, sts)
+      IF ( sts .NE. merr_ok ) THEN
+          errmsg = 'No space left for a new dynamic time line'
+          lenerrmsg = TM_LENSTR(errmsg)
+          RETURN
+      ENDIF
+*     Assign it a unique name.
+      IF ( capaxname .EQ. '' ) THEN
+          WRITE(line_name(k), 360) (k - max_lines)
+  360     FORMAT('(AX',I3.3,')')
+          line_name_orig(k) = line_name(k)
+      ELSE
+          line_name(k)      = uniqaxname
+          line_name_orig(k) = axisname
+      ENDIF
+*     Assign the rest of the line info
+      line_units(k)         = axisunit
+      line_unit_code(k)     = axucode
+      IF ( modu ) THEN
+          line_t0(k)        = '01-JAN-0000 00:00:00'
+          base = 0.0
+      ELSE
+          line_t0(k)        = '01-JAN-1900 00:00:00'
+          base = TM_SECS_FROM_BC(calid, 1900, 1, 1, 0, 0, 0, sts)
+      ENDIF
+      line_cal_name(k)      = allowed_calendars(calid)
+      line_shift_origin(k)  = .FALSE.
+      line_tunit(k)         = un_convert(axucode)
+      line_parent(k)        = 0
+      line_class(k)         = pline_class_basic
+      line_modulo(k)        = modu
+      line_modulo_len(k)    = modulen
+      line_direction(k)     = 'TI'
+      line_dim(k)           = numcoords
+      line_regular(k)       = reg
+      IF ( reg ) THEN
+          line_subsc1(k)    = unspecified_int4
+          line_start(k)     = line_mem(first_pt) - base
+          line_delta(k)     = delta
+      ELSE
+*         first_pt already assigned
+          next_line_mem_pos = first_pt + 2 * numcoords + 1
+          IF ( next_line_mem_pos .GT. maxlinestore ) THEN
+              CALL TM_DEALLO_DYN_LINE(k)
+              errmsg = 'No space left for a new irregular time line'
+              lenerrmsg = TM_LENSTR(errmsg)
+              RETURN
+          ENDIF
+*         Modify the coordinates to the new t0 baseline
+          DO 370 j = 1, numcoords
+  370         line_mem(first_pt+j-1) = line_mem(first_pt+j-1) - base
+*         Compute and store the box boundries
+          line_mem(first_pt + numcoords) = line_mem(first_pt) - 0.5 *
+     .                   (line_mem(first_pt + 1) - line_mem(first_pt))
+          DO 380 j = 2, numcoords
+              line_mem(first_pt + numcoords + j - 1) = 0.5 *
+     .        (line_mem(first_pt + j - 1) + line_mem(first_pt + j- 2))
+  380     CONTINUE
+          line_mem(first_pt + 2 * numcoords) =
+     .         line_mem(first_pt + numcoords - 1) +
+     .         0.5 * (line_mem(first_pt + numcoords - 1) -
+     .                line_mem(first_pt + numcoords - 2))
+*         Assign the line info
+          line_subsc1(k)    = first_pt
+          line_start(k)     = line_mem(first_pt)
+          line_delta(k)     = unspecified_val8
+      ENDIF
+      line_use_cnt(k)       = 0
+
+      axisnum = k
+      axisstart = 1
+      axisend = numcoords
+
+  500 lenerrmsg = 0
+      RETURN
+
+      END
+
diff --git a/fer/rpn/LIB_NAME b/fer/rpn/LIB_NAME
new file mode 100644
index 0000000..fd92e2c
--- /dev/null
+++ b/fer/rpn/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/librpn.a 
diff --git a/fer/rpn/Makefile b/fer/rpn/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/rpn/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/rpn/SOURCE_FILES b/fer/rpn/SOURCE_FILES
new file mode 100644
index 0000000..958d7ed
--- /dev/null
+++ b/fer/rpn/SOURCE_FILES
@@ -0,0 +1,18 @@
+SRCS_F = \
+alg_break_up.F\
+alg_class.F\
+alg_id.F\
+alg_trans_code.F\
+break_up_expr.F\
+break_varattname.F\
+break_varname.F\
+delete_all_uvar_grids.F\
+dflt_trans_arg.F\
+expr_name.F\
+init_counter_var.F\
+init_uvar.F\
+init_uvar_sub.F\
+not_rpn.F\
+ok_juxtapo.F\
+prcd.F\
+rpn.F 
diff --git a/fer/rpn/alg_break_up.F b/fer/rpn/alg_break_up.F
new file mode 100644
index 0000000..ce279ed
--- /dev/null
+++ b/fer/rpn/alg_break_up.F
@@ -0,0 +1,322 @@
+	SUBROUTINE ALG_BREAK_UP( text,at_start,at_end,natom,
+     .                               err_string,status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* lexical analyzer to break up algebraic expressions into atoms of known
+* type.  Possibly more than one expression separated by commas
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V200: 11/24/89
+* V402: 7/95 - Allow nested [] of the form vname1[G=vname2[D=dset]]
+* V495: 7/7/98 - allow variable names in single quotes - add new state S10
+*                and new character class 11 (single quote)
+*       7/23 - fixed problem missed the first time. brackets: 'X'[stuff]
+* V500: 12/98 - allow {1,3,5} notation for lists of constants
+*	 1/99 - allow strings in double quotes (as fcn args)
+* V530: //8/00 *sh* - allow {"string", "string"}
+* V600:  3/06 *acm* - fix bug 1395: string 1.0e-4+0*8 tried to inlcude plus sign 
+*                     and the 0 following it as part of the exponent. Define a new 
+*                     state, in which we are interpreting an exponent and getting 
+*                     the exponent value itself. Now this becomes like interpreting 
+*                     a constant.
+* V600:  5/05  *acm* For attribute control, allow . inside names: 
+*                    change next_stat(10,4) to 4 -- 
+* V685:  7/13  *acm* Bug 2084. If a string starts with . and is not numeric, make an atom.
+*                    It'll generally be an error.
+
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'rpn.parm'
+
+* calling argument declaration:
+	INTEGER		at_start(maxatoms), at_end(maxatoms), natom, status
+	CHARACTER*(*)	text, err_string
+
+* internal variable declarations:
+	LOGICAL		TM_DIGIT_TEST, was_operand, atom_open,
+     .			requires_closure(num_state),
+     .                      have_exp_digits
+	INTEGER		ALG_CLASS, TM_LENSTR1,
+     .			tlen, p, state, last_state, class,
+     .			i, next_state(num_class,num_state),
+     .			brkt_nest_level, pn
+
+* possible states of lexical analysis
+*	S1 - looking for start of atom
+*	S2 - + or - found following operator (*sh* following name ??)
+*	S3 - interpreting constant
+*	S4 - interpreting name (variable or function, ...)
+*	S5 - found last character of atom
+*	S6 - ignoring characters inside []
+*	S7 - just missed last character of atom
+*	S8 - interpreting exponent
+*	S9 - inside of nested []	(mod 7/95)
+*       S10- inside of single quote pair
+*	S11- ignoring characters inside {}
+*	S12- inside of double quote pair
+*	S13- interpreting exponent, found exponential value
+
+*	-1 ==> Syntax Error
+*	-2 ==> Illegal Character
+*	-9 ==> **lex state error
+
+* classes of characters
+*	C1 - + -
+*	C2 - digits
+*	C3 - letters _ _
+*	C4 - [
+*	C5 - ]
+*	C6 - * / ^ , (
+*	C7 - )
+*	C8 - blank tab
+*	C9 - E
+*	C10- .
+*       C11- '
+*	C12- {
+*	C13- }
+*	C14- "
+*	C15- all others
+
+*	... CHARACTER CLASS: next_state(class, last_state) ...
+*             C1 C2 C3 C4 C5 C6 C7 C8 C9 C10C11C12C13C14C15
+	DATA (next_state(i,1),i=1,num_class)
+     .        / 2, 3, 4,-1,-1, 5, 5, 1, 4,  3,10,11,-1,12,-2/
+	DATA (next_state(i,2),i=1,num_class)
+     .        / 7, 3, 7, 7, 7, 7, 7, 7, 7,  3, 7, 7, 7, 7,-2/
+	DATA (next_state(i,3),i=1,num_class)
+     .        / 7, 3,3,-1,-1, 7, 7, 7, 8,  3, 7,-1,-1, 7,-2/
+	DATA (next_state(i,4),i=1,num_class)
+     .        / 7, 4, 4, 6,-1, 7, 7, 7, 4, 4, 7,-1,-1, 7,-2/
+	DATA (next_state(i,5),i=1,num_class)
+     .        /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+	DATA (next_state(i,6),i=1,num_class)
+     .        / 6, 6, 6, 9, 5, 6, 6, 6, 6,  6, 6, 6, 6, 6, 6/
+	DATA (next_state(i,7),i=1,num_class)
+     .        /-9,-9,-9,-9,-9,-9,-9,-9,-9, -9,-9,-9,-9,-9,-2/
+	DATA (next_state(i,8),i=1,num_class)
+     .        / 8, 13, 7, 7, 7, 7, 7, 7, 7,  7, 7, 7, 7, 7,-2/
+	DATA (next_state(i,9),i=1,num_class)
+     .        / 9, 9, 9, 9, 9, 9, 9, 9, 9,  9, 9, 9, 9, 9, 9/
+	DATA (next_state(i,10),i=1,num_class)
+     .        / 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10/
+	DATA (next_state(i,11),i=1,num_class)
+     .        /11,11,11,11,11,11,11,11,11, 11,11,11, 5,11,11/
+	DATA (next_state(i,12),i=1,num_class)
+     .        / 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12/
+
+
+* which states are not valid on exit (e.g. unclosed braces)
+	DATA requires_closure(1 )/.FALSE./ !S1 - looking for start of atom
+	DATA requires_closure(2 )/.FALSE./ !S2 - + or - following operator
+	DATA requires_closure(3 )/.FALSE./ !S3 - interpreting constant
+	DATA requires_closure(4 )/.FALSE./ !S4 - interpreting name
+	DATA requires_closure(5 )/.FALSE./ !S5 - found last character of atom
+	DATA requires_closure(6 )/.TRUE. / !S6 - ignoring characters inside []
+	DATA requires_closure(7 )/.FALSE./ !S7 - just missed last character
+	DATA requires_closure(8 )/.FALSE./ !S8 - interpreting exponent
+	DATA requires_closure(9 )/.TRUE. / !S9 - inside of nested []
+	DATA requires_closure(10)/.TRUE. / !S10- inside of single quote pair
+	DATA requires_closure(11)/.TRUE. / !S11- ignoring characters inside {}
+	DATA requires_closure(12)/.TRUE. / !S12- inside of double quote pair
+
+* initialize
+*    "was_operand" flags the character of the previous atom to distinguish the
+*     operator "-" in "X-5" from the negative sign "-" in "X+-5"
+	tlen = TM_LENSTR1( text )
+	natom = 0
+	p = 0
+	state = 1
+	was_operand = .FALSE.
+	atom_open = .FALSE.
+        have_exp_digits = .FALSE.
+	brkt_nest_level = 0
+
+* advance to next character
+ 5	p = p + 1
+	IF ( p .GT. tlen ) THEN
+	   IF ( natom .EQ. 0 ) GOTO 9999
+	   IF (requires_closure(state)) GOTO 5400
+* ... SUCCESS - DONE
+	   status = ferr_ok
+	   at_end(natom) = tlen
+	   RETURN
+	ENDIF
+	   
+* check next character
+ 10	last_state = state
+	class = ALG_CLASS( text(p:p) )
+
+* determine lexical analysis state to determine next action
+ 50	state = next_state( class, last_state )
+	IF ( state .EQ. -2 ) GOTO 5100
+	IF ( state .EQ. -1 ) GOTO 5200
+	IF ( state .EQ. -9 ) GOTO 5900
+	IF ( state .EQ. 1  ) GOTO 5	! just keep looking
+
+*  "+" or "-" at start of atom is operator if last atom was an operand
+	IF ( was_operand .AND. last_state.EQ.1 .AND. class.EQ.1 ) state = 5
+
+* will this act like an operator or an operand for the next atom ?
+	IF ( state.EQ.7 .OR. class.EQ.8 .OR. class.EQ.13) THEN
+* ... last "significant" character hasn't changed
+	   CONTINUE
+	ELSEIF ( class.EQ.1 .OR. class .EQ.6 ) THEN
+	   was_operand = .FALSE.
+	ELSE
+	   was_operand = .TRUE.
+	ENDIF
+
+* begin new atom, possibly.
+	IF ( .NOT.atom_open ) THEN
+	   IF ( natom .EQ. maxatoms-1 ) GOTO 5300
+           IF (class .EQ. 10 ) THEN  ! var.attribute?
+              atom_open = .TRUE.
+              pn = MIN(p+1,tlen)
+	      IF ( TM_DIGIT_TEST(text(p:pn)) ) THEN  ! looks like a number...
+                 natom = natom + 1
+                 at_start(natom) = p 
+              ELSE
+* this is a var.attr, so continue as though we are parsing a string
+                 class = 3
+                 state = 4
+                 last_state = 4
+* Non-numeric text starting with a dot. Start the atom.
+		 IF (p.EQ.1) THEN
+                    natom = natom + 1
+                    at_start(natom) = p
+                    atom_open = .TRUE.
+                 ENDIF
+              ENDIF
+           ELSE
+              natom = natom + 1
+              at_start(natom) = p
+              atom_open = .TRUE.
+           ENDIF
+	ENDIF
+
+* take appropriate action
+*		S1  S2  S3  S4  S5  S6  S7  S8   S9  S10 S11 S12 S13
+	GOTO (9999,100,100,100,500,100,700,100, 900,1000,100,1100,1300)
+     .								state
+
+* continue to next character
+ 100	GOTO 5
+
+* flag the last character of an atom - begin search for next atom
+ 500	at_end(natom) = p
+	state = 1
+	atom_open = .FALSE.
+	GOTO 5
+	
+* flag the last character of an atom one back - begin search for next atom
+ 700	at_end(natom) = p-1
+	last_state = 1
+	atom_open = .FALSE.
+	GOTO 50
+
+* nested "[]" (mod 7/95)
+* this probably violates the theoretical underpinnings of the finite state
+* engine but ... what the heck, it's an easy hack
+* stay in this state until the matching "]" is found
+ 900	IF (class .EQ. 4) THEN		! increase nesting
+	   brkt_nest_level = brkt_nest_level + 1
+	ELSEIF ( class .EQ. 5 ) THEN	! decrease nesting
+	   brkt_nest_level = brkt_nest_level - 1
+	   IF ( brkt_nest_level .EQ. 0 ) state = 6	! <== leave state 
+	ENDIF
+	GOTO 5
+
+* single-quoted strings (mod 7/98)
+* this probably violates the theoretical underpinnings of the finite state
+* engine but ... what the heck, it's an easy hack
+* stay in this state until the matching \' is found
+* Note: this crude code cannot deal with nested quotations or escaped quotes
+*    Also, quoted names inside of square brackets will not be handled here
+ 1000	IF (class .EQ. 11) THEN		! quote found
+	   IF (last_state .EQ. 10) THEN      
+	      state = 4                 ! closing quote (?why not GOTO 500?)
+*       ... note that we may still be interpreting names like 'X'[stuff]
+	   ELSE
+	      atom_open = .TRUE.        ! opening quote
+	   ENDIF
+	ELSE          
+	   CONTINUE                     ! inside of quote
+	ENDIF
+	GOTO 5
+
+* double-quoted strings (mod 1/99)
+* this probably violates the theoretical underpinnings of the finite state
+* engine but ... what the heck, it's an easy hack
+* stay in this state until the matching \" is found
+* Note: this crude code cannot deal with nested quotations or escaped quotes
+ 1100	IF (class .EQ. 14) THEN		! quote found
+	   IF (last_state .EQ. 12) THEN      
+	      GOTO 500                 ! closing quote found
+*       ... note that we may still be interpreting names like 'X'[stuff]
+	   ELSE
+	      atom_open = .TRUE.        ! opening quote
+	   ENDIF
+	ELSE          
+	   CONTINUE                     ! inside of quote
+	ENDIF
+	GOTO 5
+
+* digit part of exponent
+ 1300	state = 3
+	GOTO 5
+
+
+* error exits
+ 5000	status = ferr_syntax
+ 5005	RETURN
+ 5100	err_string = 'illegal character: '//text(p:p)
+	GOTO 5000 
+ 5200	err_string = text(MAX(1,p-6):MIN(tlen,p+2))
+	GOTO 5000
+ 5300	err_string = '['//text(MAX(1,p-8):p)//' ]'
+	status = ferr_expr_too_complex
+	GOTO 5005
+ 5400	err_string = 'unclosed quotation, parenthesis, or bracket'
+	GOTO 5000
+ 5900	err_string = '*** lex state'
+	status = ferr_internal
+	GOTO 5005
+ 9999	STOP 'ALG_BREAK_UP'
+	END
+
+
+
diff --git a/fer/rpn/alg_class.F b/fer/rpn/alg_class.F
new file mode 100644
index 0000000..c5d8881
--- /dev/null
+++ b/fer/rpn/alg_class.F
@@ -0,0 +1,123 @@
+	INTEGER FUNCTION ALG_CLASS( ctr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* subroutine for lexical analyzer
+* determine chatacter class of character
+* note: the routine could be made simpler and faster by simply providing a
+*	DATA statement associating each character number (ICHAR('C')) with a
+*	class.   ... hurried development ...
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V200: 11/24/89
+* V495: 7/7/98 - add single quotes as another character class (11) (old 11->12)
+*     : 9/30/98 - NAG F90 (linux) received error on above change.  
+*                 need to put single  tick between double quotes  *kob*
+* V500: 12/98 - add "{" and "}" to support "{1,3,5}" notation
+*	 1/99 - allow strings in quoble quotes (as fcn args)
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'ferret.parm'
+
+* calling argument declaration:
+	CHARACTER*1	ctr
+
+* internal parameter declarations:
+	CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* classes of characters
+*	C1 - + -
+*	C2 - digits
+*	C3 - letters _ _
+*	C4 - [
+*	C5 - ]
+*	C6 - * / ^ , (
+*	C7 - )
+*	C8 - blank tab
+*	C9 - E e
+*	C10- .
+*       C11- '
+*	C12- {
+*	C13- }
+*	C14- "
+*	C15- all others
+
+	IF     ( ctr.EQ.'+' .OR.  ctr.EQ.'-' ) THEN
+	   ALG_CLASS = 1
+	ELSEIF ( ctr.GE.'0' .AND. ctr.LE.'9' ) THEN
+	   ALG_CLASS = 2
+	ELSEIF ( ctr.EQ.'E' .OR.  ctr.EQ.'e' ) THEN
+	   ALG_CLASS = 9
+	ELSEIF ( ( ctr.GE.'A' .AND. ctr.LE.'Z' )
+     .	    .OR. ( ctr.GE.'a' .AND. ctr.LE.'z' )
+     .	    .OR. ( ctr.EQ.'_'  .OR. ctr.EQ.'_' )	) THEN
+	   ALG_CLASS = 3
+	ELSEIF ( ctr.EQ.'[' ) THEN
+	   ALG_CLASS = 4
+	ELSEIF ( ctr.EQ.']' ) THEN
+	   ALG_CLASS = 5
+	ELSEIF ( ctr.EQ.'*' .OR. ctr.EQ.'/' .OR. ctr.EQ.'^'
+     .	    .OR. ctr.EQ.',' .OR. ctr.EQ.'('		) THEN
+	   ALG_CLASS = 6
+	ELSEIF ( ctr.EQ.')' ) THEN
+	   ALG_CLASS = 7
+	ELSEIF ( ctr.EQ.' ' .OR. ctr.EQ.tab ) THEN
+	   ALG_CLASS = 8
+	ELSEIF ( ctr.EQ.'.' ) THEN
+	   ALG_CLASS = 10
+	ELSEIF ( ctr.EQ. "'" ) THEN
+	   ALG_CLASS = 11
+	ELSEIF ( ctr.EQ.'{' ) THEN
+	   ALG_CLASS = 12
+	ELSEIF ( ctr.EQ.'}' ) THEN
+	   ALG_CLASS = 13
+	ELSEIF ( ctr.EQ.'"' ) THEN
+	   ALG_CLASS = 14
+	ELSE
+	   ALG_CLASS = 15
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/rpn/alg_id.F b/fer/rpn/alg_id.F
new file mode 100644
index 0000000..ba5c136
--- /dev/null
+++ b/fer/rpn/alg_id.F
@@ -0,0 +1,369 @@
+	SUBROUTINE ALG_ID( text, natom, at_start, at_end,
+     .			   at_type, at_id, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the atoms from the text
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200: 12/21/89
+* Unix/RISC port - 1/91 - cannot "//" with CHAR*(*) variables
+* V450: 12/2/96 - check that functions are followed by left parens.
+*		  Else, they are variable names.
+*		- Also, id grid-changing fcns as category alg_grid_chg_fcn
+*		- and check for negative constants 
+*		==> Note that this may modify natom
+* V495: 7/7/98 - allow variable names in single quotes - bypass name check
+*     : 9/30/98 - NAG F90 (linux) received error on above change.  
+*                 need to put single  tick between double quotes  *kob*
+* V500: 12/98 - allow "{1,3,5}" notation
+*	 1/99 - allow strings in double quotes (as args to function)
+* V553:1/04   - check variable to see if its a counter_var.
+* V554 1/04 *acm* - add counter variables for named REPEAT/RANGE control
+*      6/04 ywei - change MATCH_NAME function
+* V600 8/05 *acm* - Add variable type attrib_val for definitions of the form
+*                   varname.attname
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V600 *acm* 6/06 - fix declarations, found by solaris compiler
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685+ 12/13 *acm*  bounds checking: tm_digit needs more care in the argument sent in.
+
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'rpn.parm'
+	include 'xalgebra.cmn'
+	include 'xrisc.cmn'
+        include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER		natom, at_start(maxatoms), at_end(maxatoms),
+     .			at_type(maxatoms), at_id(maxatoms), status
+	CHARACTER*(*)	text
+
+* internal variable declarations:
+	LOGICAL		TM_DIGIT, TM_LEGAL_NAME, is_digit
+	INTEGER		STR_MATCH, GCF_FIND_FCN, TM_LENSTR1,
+     .			imatch, i, i2, j, brac_pos, aend,
+     .			num_indices, dot, new_nat, first, second, slen
+        CHARACTER*128   varname
+        
+        new_nat = 0
+
+	DO 100 i = 1, natom
+
+* operator ?
+	   imatch = STR_MATCH (	text(at_start(i):at_end(i)),
+     .				alg_op, num_operators )
+	   IF ( imatch .NE. atom_not_found ) THEN
+	      at_type(i) = alg_operator
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* punctuation?
+	   imatch = STR_MATCH (	text(at_start(i):at_end(i)),
+     .				alg_punct, num_punctuations )
+	   IF ( imatch .NE. atom_not_found ) THEN
+	      at_type(i) = alg_punctuation
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* function ?
+	   imatch = STR_MATCH (	text(at_start(i):at_end(i)),
+     .				alg_fcn, num_functions )
+	   IF ( imatch .NE. atom_not_found ) THEN
+	      at_type(i) = alg_function
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* grid-changing function ?
+	   imatch = GCF_FIND_FCN( text(at_start(i):at_end(i)) )
+	   IF ( imatch .NE. unspecified_int4 ) THEN
+	      at_type(i) = alg_grid_chg_fcn
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* logic structure ?
+	   imatch = STR_MATCH (	text(at_start(i):at_end(i)),
+     .				alg_struct, num_log_structs )
+	   IF ( imatch .NE. atom_not_found ) THEN
+	      at_type(i) = alg_log_struct
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* logic structure with IFV?
+	   imatch = STR_MATCH (	text(at_start(i):at_end(i)),
+     .				alg_vstruct, num_log_structs )
+	   IF ( imatch .NE. atom_not_found ) THEN
+	      at_type(i) = alg_log_vstruct
+	      at_id(i)   = imatch
+	      GOTO 100
+	   ENDIF
+
+* constant ?
+          is_digit = TM_DIGIT( text(at_start(i):at_start(i)) )
+	  IF ( is_digit ) THEN
+	      IF (at_end(i).GT.at_start(i) .AND. text(at_start(i):at_start(i)).EQ.'.') THEN
+	         IF (text(at_start(i)+1:at_start(i)+1) .EQ. '.') is_digit = .FALSE.
+	      ENDIF
+	      IF (is_digit) THEN
+ 	         at_type(i) = alg_constant
+	         at_id(i)   = unspecified_int4
+ 
+	         GOTO 100
+	      ENDIF
+	   ENDIF
+
+
+* pseudo-variable ?
+* (look for "[" as name end first)
+	   brac_pos = INDEX( text(at_start(i):at_end(i)), '[' )
+	   IF ( brac_pos .GT. 0 ) THEN
+	      aend = at_start(i) + brac_pos - 2
+	   ELSE
+	      aend = at_end(i)
+	   ENDIF
+*	   imatch = STR_MATCH (	text(at_start(i):aend),
+*     .				alg_pvar, num_pseudo_vars )
+*	   IF ( imatch .NE. atom_not_found ) THEN
+*	      at_type(i) = alg_pseudo_var
+*	      at_id(i)   = imatch
+*	      GOTO 100
+*	   ENDIF
+
+           CALL string_array_find_caseblind(alg_pvar_head,
+     .                         text(at_start(i):aend),
+     .                         LEN(text(at_start(i):aend)),
+     .                         string_array_result(1),
+     .                         max_uvar,
+     .                         num_indices)
+          IF(num_indices.GT.0) THEN
+	      at_type(i) = alg_pseudo_var
+	      at_id(i)   = string_array_result(1)
+              GOTO 100              
+          ENDIF
+
+* constant array of the form "{1,3,5}" ?
+	  IF ( text(at_start(i):at_start(i)).EQ."{"
+     .	 .AND. text(at_end  (i):at_end  (i)).EQ."}" ) THEN
+	      at_type(i) = alg_const_var
+	      at_id(i)   = unspecified_int4
+	      GOTO 100
+	   ENDIF
+
+* string in double quotes? (1/99)
+	  IF ( text(at_start(i):at_start(i)).EQ.'"'
+     .	 .AND. text(at_end  (i):at_end  (i)).EQ.'"' ) THEN
+	      at_type(i) = alg_string
+	      at_id(i)   = unspecified_int4
+	      GOTO 100
+	   ENDIF
+
+* attribute value variable.attname (will check later whether the
+* variable is in a netCDF dataset and whether the attribute exists)
+
+c           IF (INDEX(text(at_start(i):at_end(i)), '.') .GT. 0 
+c     .          .AND. INDEX(text(at_start(i):at_end(i)), '.') .LT.
+c     .          at_end(i) - at_start(i)+1 ) THEN
+
+           IF (INDEX(text(at_start(i):at_end(i)), '.') .GT. 0 ) THEN
+              
+* Is the dot a decimal point within an expression, as in LIST a[y=0.5:9.5]
+* or LIST a[gx=sst[d=1],y=1.5]. Look for opening bracket before the dot and 
+* closing bracket after the dot. Use varname as a temporary buffer to avoid
+* confusion between indices within the whole buffer -text- and indices within 
+* the atom we are now looking at.
+
+              varname = text(at_start(i):at_end(i))
+              slen = TM_LENSTR1(varname)
+              dot = INDEX(varname, '.')
+
+              IF ((INDEX(varname(1:dot-1),'[') .GT. 0) .AND. 
+     .            (INDEX(varname(dot+1:slen),']') .GT. 0) ) GOTO 99
+
+* Is this just a number in parentheses?
+              IF ( (INDEX(varname(1:1),'(') .GT. 0)  .AND. 
+     .             TM_DIGIT(varname(2:slen)) ) GOTO 99
+
+              IF ( (INDEX(varname(1:1),'(') .GT. 0)   .AND. 
+     .             (INDEX(varname(slen:slen),')') .GT. 0) .AND. 
+     .             TM_DIGIT(varname(2:slen-1)) ) GOTO 99
+
+* is the name in quotations? If so then it may contain a dot and not
+* be varname.attname. See if its all within quotes, if so this is a 
+* variable name containg a dot.
+
+              first = INDEX(varname, "'" )
+              second = 0
+              IF (slen .GT. 1) second = INDEX(varname(2:at_end(i)), "'" )
+              
+              IF (first .GT. 0 .AND. second .GT. 0 .AND. 
+     .            dot .GT. first .AND. dot .LT. second) GOTO 99
+
+* Otherwise this is a varname.attname  
+              at_type(i) = alg_attrib_val
+	      at_id(i)   = unspecified_int4
+
+* Is the end of varname a parentheses? Then is this part of (axisname).attname
+              IF ( INDEX(text(at_start(i):at_end(i)), ")" ) .GT. 0) THEN
+                 j = i - 1
+                 new_nat = 0
+                 DO WHILE (j .GT. 0 .AND. new_nat .EQ. 0 ) 
+                    IF (INDEX(text(at_start(j):at_end(j)), "(" ) .GT. 0) THEN
+                       at_type(j) = at_type(i)
+                       at_end(j) = at_end(i)
+                       at_id(j) = at_id(i)
+                       new_nat = j
+                    ENDIF
+                    j = j - 1
+                 ENDDO
+              ENDIF
+
+* Is the dot at the end of varname? if so then merge the next atom with this one.
+
+              IF ( text(at_end(i):at_end(i)) .EQ. "." ) THEN
+                 new_nat = natom-1
+                 at_end(i) = at_end(i+1)
+                 DO 110 j = i+1, natom
+                    at_start(j) = at_start(j-1)
+                    at_end(j) = at_end(j-1)
+  110            CONTINUE
+              ENDIF
+
+              GOTO 100
+	   ENDIF
+
+* cant identify it - we will call it an variable for now
+  99	   IF (text(at_start(i):at_start(i)) .NE. "'" ) THEN
+* (7/98) only check name if it is not in quotation marks
+	     IF ( .NOT.TM_LEGAL_NAME(text(at_start(i):aend)) ) GOTO 5100
+	   ENDIF
+	   at_type(i) = alg_variable
+	   at_id(i)   = unspecified_int4
+
+ 100	CONTINUE
+
+        IF (new_nat .NE. 0) natom = new_nat
+
+* A function name not followed by a left paren is actually a variable (12/96)
+	DO 200  i = 1, natom
+	   IF ( at_type(i) .EQ. alg_function
+     .	   .OR. at_type(i) .EQ. alg_grid_chg_fcn ) THEN
+	      IF (i .EQ. natom) THEN
+	          at_type(i) = alg_variable
+	          at_id(i)   = unspecified_int4
+	      ELSEIF ( at_type(i+1) .NE. alg_punctuation
+     .		  .OR. at_id  (i+1) .NE. left_paren ) THEN
+	          at_type(i) = alg_variable
+	          at_id(i)   = unspecified_int4
+	      ENDIF
+	   ENDIF
+ 200	CONTINUE
+
+* Just see if it is in the list of counter variables.  These need to be
+* treated as a constant at the start of interp_stack (in is_uvar_grid and so on)
+
+* start by checking counter variable names
+	DO 240 i = 1, natom
+*           len_test = TM_LENSTR(text(at_start(i):at_end(i)))
+*           DO 220 j = 1, num_counter_vars
+*              len_mchars = TM_LENSTR(countervar_name(j))
+*              IF ( MATCH_NAME(text(at_start(i):at_end(i)),len_test, 
+*     .             countervar_name(j),len_mchars ) ) THEN
+*	         at_type(i) = alg_counter_var
+*	         at_id(i)   = unspecified_int4
+*	      ENDIF
+* 220	   CONTINUE
+ 	CALL string_array_find(countervar_name_head,
+     .                         text(at_start(i):at_end(i)),
+     .                         LEN(text(at_start(i):at_end(i))),
+     .                         string_array_result(1),
+     .                         max_uvar,
+     .                         num_indices)
+        IF(num_indices.GT.0) THEN
+	   at_type(i) = alg_counter_var
+	   at_id(i)   = unspecified_int4
+        ENDIF
+ 240	CONTINUE
+
+* 12/96 kludge ...
+* In ALG_BREAK_UP the operators EQ, LT, GT, ... are just names so that routine
+* misinterprets the negative in  "a EQ -1". Correct that here.
+ 290	DO 310 i = 3, natom
+	   IF ( at_type(i) .EQ. alg_constant ) THEN
+	      IF ( at_type(i-1) .EQ. alg_operator
+     .	     .AND. at_id  (i-1) .EQ. 2
+     .	     .AND. at_type(i-2) .EQ. alg_operator
+     .	     .AND. at_end (i-1) .EQ. at_start(i)-1    ) THEN
+* ... this minus sign actually belongs to the constant
+	         at_start(i) = at_start(i-1)
+	         DO 300 i2 = i, natom 	   
+	            at_start(i2-1) = at_start(i2)
+	            at_end  (i2-1) = at_end  (i2)
+	            at_type (i2-1) = at_type (i2)
+	            at_id   (i2-1) = at_id   (i2)
+ 300	         CONTINUE
+	         natom = natom - 1
+	         GOTO 290
+	      ENDIF
+	   ENDIF
+ 310	CONTINUE
+
+* insert flag indicating end of atom list
+	at_type(natom+1)  = alg_finished
+	at_start(natom+1) = 1
+	at_end(natom+1)   = 1
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5100	risc_buff = text(at_start(i):aend)
+	CALL ERRMSG( ferr_syntax, status,
+     .		     'illegal name: '//risc_buff(:at_start(i)-aend+1), *5000 )
+	END
diff --git a/fer/rpn/alg_trans_code.F b/fer/rpn/alg_trans_code.F
new file mode 100644
index 0000000..c0209d2
--- /dev/null
+++ b/fer/rpn/alg_trans_code.F
@@ -0,0 +1,68 @@
+	CHARACTER*3 FUNCTION ALG_TRANS_CODE( tcode )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the text associated with the given transformation code
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/4/87
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER	tcode
+
+* internal variable declarations:
+	INTEGER	i
+
+	include 'ferret.parm'
+	include 'xalgebra.cmn'
+
+* identify the code from known codes
+	DO 100 i = 1, num_transforms
+	   IF ( tcode .EQ. alg_trans_num( i ) ) GOTO 200
+ 100	CONTINUE
+
+* unknown code
+	ALG_TRANS_CODE = '???'
+	RETURN
+
+* return the text
+ 200	ALG_TRANS_CODE = alg_trans_text( i )
+	RETURN
+	END
diff --git a/fer/rpn/break_up_expr.F b/fer/rpn/break_up_expr.F
new file mode 100644
index 0000000..8717582
--- /dev/null
+++ b/fer/rpn/break_up_expr.F
@@ -0,0 +1,240 @@
+	SUBROUTINE BREAK_UP_EXPR( text, num_parts, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* text may have more than one algebraic expression separated by commas
+* this routine will delimit the expressions and store them in reverse Polish
+* order in the user-var structure
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/23/87
+* V200:  6/20/89 - pass "implct_defn" to initialize user vars from here
+*       11/27/89 - perform Reverse Polish translation
+*        2/29 90 - don't double-report INIT_UVAR errors
+* Unix/RISC port - 1/91 - cant use "//" with CHAR*(*) variable
+*       10/22/92 - added units on uvars
+* V402:  7/95 - Added "dset" argument to INIT_UVAR for  LET/D=dset var = ... 
+* V450:  11/96 - Using reformulated version of INIT_UVAR (RPN called
+*		 from there). Part of changes to support external function.
+* V510: 5/00 *sh* - added "bad" (missing value flag) to INIT_UVAR arguments
+* V540:12/01 *acm*- for parsing expr like def axis/x x1={ 1, 2 } dont include
+*                   the brackets in risc_buff
+* 1/03 *kob* g77 port - requires use of risc_buff for concats
+* V611 5/08 *acm* Fix bug 1578; dataset specifiers applied correctly var[d=1].attname
+* V62   2/09 *acm* init_uvar has an extra argument, for keeping upper/lowrercase 
+*                  spelling of user-var names (no other changes in this routine).
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V685+ 12/13    - *acm*  bounds checking; dont refer to parts of the string outside its bounds.
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declaration:
+	INTEGER		num_parts, status
+	CHARACTER*(*)	text
+
+* internal parameter declarations:
+	LOGICAL		implct_defn
+	PARAMETER     ( implct_defn = .TRUE. )
+
+* internal variable declarations:
+	LOGICAL its_remote
+	INTEGER	tlen, uvar, natom, i, paren_level, at1,
+     .		at_type  (maxatoms), at_id  (maxatoms),
+     .		at_start (maxatoms), at_end (maxatoms),
+     .		exp_start(max_exp), exp_end(max_exp),
+     .		atom_1   (max_exp), atom_n (max_exp),
+     .          paren, startparen
+	CHARACTER	EXPR_NAME*8, err_string*128, t2*2
+
+        INTEGER ii
+
+* initialize fixed length string for RISC
+* If curly-brackets, dont count them.
+
+        risc_buff = text
+c        tlen = MIN( size_rbuff, LEN(text) )
+
+        IF (text(1:1) .EQ. '{') THEN
+            DO ii = 2, LEN(risc_buff)
+               risc_buff(ii:ii) = text(ii:ii)
+               IF (text(ii:ii) .EQ. '}') THEN
+                  go to 499 
+               ENDIF
+             ENDDO
+  499        CONTINUE
+        ENDIF
+        tlen = MIN( size_rbuff, LEN(text) )
+
+* break the expression into atoms
+
+* ----
+* When there is a .. in the expression, this will later be translated
+* as an attribute of the dataset.  Here just gloss over this by
+* temporarily replacing the two dots with a string.
+
+	IF (LEN(text) .GT. 1) THEN
+           t2 = text(1:2)
+           IF (t2 .EQ. '..') text(1:2) = 'aa'
+	ENDIF
+
+* a similar hack when the expression is (coordvar).attname 
+* ALG_BREAK_UP can parse this, but doesnt like more complicated expressions
+* like (coordvar).attname[d=2] Could make more cases in alg_break_up, but
+* instead avoid the confusion about the meaning of the parentheses by 
+* temporarily removing them.
+
+        paren = 0
+        IF ( INDEX(text, ').' )  .NE. 0) THEN
+           paren = INDEX(text, ').' )
+           DO 80 i = paren-1,1,-1
+              startparen = INDEX(text(i:paren), '(' )
+   80      CONTINUE
+           IF (startparen .EQ. 0) GOTO 5400
+           text(startparen:startparen) = 'A'
+           TEXT(paren:paren) = 'A'
+        ENDIF
+
+* a similar hack when the expression is (coordvar)[spec].attname 
+* ALG_BREAK_UP can parse this, but doesnt like more complicated expressions
+* like (coordvar).attname[d=2] Could make more cases in alg_break_up, but
+* instead avoid the confusion about the meaning of the parentheses by 
+* temporarily removing them.
+
+        IF ( INDEX(text, ')[' )  .NE. 0 .AND. 
+     .       INDEX(text, '].' )  .NE. 0) THEN
+           paren = INDEX(text, ')[' )
+           DO 90 i = paren-1,1,-1
+              startparen = INDEX(text(i:paren), '(' )
+   90      CONTINUE
+           IF (startparen .EQ. 0) GOTO 5400
+           text(startparen:startparen) = 'A'
+           TEXT(paren:paren) = 'A'
+        ENDIF
+
+	CALL ALG_BREAK_UP( text,at_start,at_end,natom,err_string,status )
+
+* ----
+* Restore text before the hack
+	IF (LEN(text) .GT. 1) THEN
+           text(1:2) = t2
+	ENDIF
+        
+        IF (paren .GT. 0) THEN
+           text(startparen:startparen) = '('
+           text(paren:paren) = ')'
+        ENDIF
+
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* identify the atoms
+	CALL ALG_ID( text, natom, at_start, at_end, at_type, at_id, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* locate the sub-expressions by looking for commas that are outside of
+* enclosing parentheses
+	num_parts    = 1
+	exp_start(1) = 1
+	atom_1(1)    = 1
+	paren_level  = 0
+	DO 100 i = 1, natom
+	   IF ( at_type(i) .EQ. alg_punctuation ) THEN
+	      IF ( at_id(i) .EQ. left_paren ) THEN
+	         paren_level = paren_level + 1
+	      ELSEIF (at_id(i) .EQ. right_paren ) THEN
+	         paren_level = paren_level - 1
+	      ELSEIF  (at_id(i) .EQ. comma ) THEN
+	         IF ( paren_level .EQ. 0 ) THEN
+	            IF ( i.EQ.1 .OR.  i.EQ.natom ) GOTO 5200
+	            IF ( num_parts .GE. max_exp  ) GOTO 5300
+	            IF ( at_type(i+1) .EQ. alg_punctuation
+     .		   .AND. at_id(i+1)   .EQ. comma ) GOTO 5200
+	            atom_n (num_parts) = i - 1
+	            exp_end(num_parts) = at_end(i-1)
+	            num_parts = num_parts + 1
+	            exp_start(num_parts) = at_start(i+1)
+	            atom_1(num_parts) = i + 1
+	         ENDIF
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+	atom_n (num_parts) = natom
+	exp_end(num_parts) = at_end(natom)
+
+* now file the expression in the user-defined variable area
+        its_remote = .FALSE.  ! LET/REMOTE only with LET itself.
+
+	DO 200 i = 1, num_parts
+	   at1 = atom_1(i)
+	   CALL INIT_UVAR( EXPR_NAME(i),text,' ', ' ', unspecified_int4,
+     .			   bad_val4, implct_defn, uvar,
+     .			   at_type(at1),  at_id(at1),
+     .			   at_start(at1), at_end(at1),
+     .			   atom_n(i)-at1+1,
+     .			   exp_start(i), exp_end(i), 
+     .			   EXPR_NAME(i), its_remote, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+ 200	CONTINUE
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	num_parts = cmnd_uvars_not_given
+	RETURN
+ 5100	CALL ERRMSG( status, status,
+     .			risc_buff(:tlen)//pCR//err_string, *5000 )
+ 5200	risc_buff = text(:tlen)
+	CALL ERRMSG( ferr_syntax, status,
+     .		'comma does not separate any expressions: '
+     .			//risc_buff, *5000 )
+ 5300   write ( err_string, '(I4)' ) max_exp
+	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Number of expressions in line must be less than'
+     .		//err_string(:4), *5000 )
+ 5400   CALL ERRMSG( ferr_invalid_command, status,
+     .		'Mismatched parentheses'
+     .		//text(1:paren), *5000 )
+	END
+
diff --git a/fer/rpn/break_varattname.F b/fer/rpn/break_varattname.F
new file mode 100644
index 0000000..62b68e4
--- /dev/null
+++ b/fer/rpn/break_varattname.F
@@ -0,0 +1,350 @@
+	SUBROUTINE BREAK_VARATTNAME( text, dset_in, varname, attname, 
+     .                               varid, do_err, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Break up a name of the form varname.attname
+* Check whether the variable and attribute exist within the dataset
+* stored in linked-list structure of nc datasets.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V600 6/05 *acm* Attribute control.
+* V601 11/06*acm* Instead of looking to see if the Ferret axis name and the
+*                 axis name in the attribute structure differ because Ferret
+*                 needed to rename an axis on file initialization for uniqueness;
+*                 we use the Ferret name throughout, restoring it only on output.
+* V604 6/07 *acm* Fix bug 1518 If we didnt find the varid in the dataset, it may 
+*                 be a user var
+* V611 5/08 *acm* Fix bug 1578; dataset specifiers applied correctly var[d=1].attname
+* v6.7 1/11 *acm* Fix ticket 1768; do not write nulls when writing err msgs 
+*                 with attname.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+	include 'gfdl_vms.parm'	
+
+* calling argument declaration:
+        LOGICAL         do_err
+	INTEGER		dset_in, status
+	CHARACTER*(*)	text, varname, attname
+
+* internal variable declarations:
+        LOGICAL TM_DIGIT, coordvar, attok
+	INTEGER	TM_LENSTR, TM_LENSTR1, STR_SAME, STR_CASE_BLIND_COMPARE,
+     .          dset, tlen, alen, vlen, dot, dotdot, varid, attlen, 
+     .          attype, end_att, short_len, attid, vartype, nvdims, 
+     .          nvatts, vdims(8), vax_code, ndims, nvars, ngatts, 
+     .          recdim, iatt, attoutflag, all_outflag, first, second
+        REAL*8 val
+        CHARACTER*128 err_string, buff
+
+	CHARACTER*13	TM_STRING, buff13, vbuff
+        CHARACTER*1 c
+
+* Break text at dot: varname.attname
+
+        dset = dset_in
+        IF (dset .EQ. unspecified_int4) dset = -1   ! try user variables.
+
+        tlen = TM_LENSTR(text)
+
+        tlen = MIN(tlen, LEN(varname))
+        tlen = MIN(tlen, LEN(attname))
+
+        IF (tlen .LT. 1 .OR. INDEX(text,'.') .EQ. 0 ) THEN
+           varname = text
+           attname = ""
+           status = ferr_not_attribute
+           GOTO 1000
+        ENDIF
+
+        dot = INDEX(text,'.')
+        dotdot = INDEX(text,'..')
+        IF (dotdot .GT. 0) dot = dotdot + 1
+
+        IF (dot .EQ. 1  .AND.  tlen .EQ. 1) THEN
+           varname = text
+           attname = ""
+           status = ferr_not_attribute
+           GOTO 1000
+        ENDIF
+
+* is the name in quotations? If so then it may contain a dot and not
+* be varname.attname See if its all within quotes, if so this is a 
+* variable name containg a dot.
+
+	first = INDEX(text(1:tlen), "'" )
+	second = INDEX(text(2:tlen), "'" )
+        IF (dot .GT. first .AND. dot .LT. second) THEN
+           varname = text
+           attname = ""
+           status = ferr_not_attribute
+           GOTO 5000
+        ENDIF
+
+        varname = text(:dot-1)
+        attname = text(dot+1:tlen)
+
+* Is the dot a decimal point within an expression, as in LIST a[y=0.5:9.5]
+* or LIST a[gx=sst[d=1],y=1.5] Look for opening bracket in varname and
+* closing bracket in attname.
+
+        IF ((INDEX(varname,'[') .GT. 0)  .AND. 
+     .      (INDEX(attname,']') .GT. 0)) THEN
+           varname = text
+           attname = ""
+           GOTO 1000
+        ENDIF
+
+* If attname has brackets on it, remove this part for the next tests
+
+       alen = TM_LENSTR1(attname)
+       end_att = alen
+       IF (INDEX(attname,'[') .GT. 0) THEN
+          end_att = INDEX(attname,'[')
+          attname(end_att:alen) = ' '
+       ENDIF
+
+* Is the varname the keyword ., representing the dataset? Check that the 
+* attname request is valid.
+
+       IF (STR_SAME (varname, '.') .EQ. 0) THEN
+          attok = .FALSE.
+          IF (STR_SAME(attname, 'varnames') .EQ. 0 ) THEN
+             attok = .TRUE.
+          ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+             attok = .TRUE.
+          ELSE IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN
+             attok = .TRUE.
+          ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+             attok = .TRUE.
+          ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+             attok = .TRUE.
+          ELSE IF (STR_SAME(attname, 'nvars') .EQ. 0 ) THEN
+             attok = .TRUE. 
+
+* Is the reference to a global attribute?
+
+          ELSE
+             CALL CD_GET_VAR_ID (dset, '.', varid, status)
+             CALL CD_GET_DS_INFO (dset, ndims, nvars, ngatts, 
+     .               recdim, status)
+
+             DO 100 iatt = 1, ngatts
+                CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, buff, 
+     .                    status)
+                IF (STR_SAME(buff, attname) .EQ. 0) attok = .TRUE.
+ 100         CONTINUE
+          ENDIF
+
+          IF (attok) THEN
+             varid = 0
+             GOTO 1000
+          ELSE
+
+* is the attribute name in quotations? If so then test without them now: When the
+* above keywords, attnames, etc, are in the file as attribute names, then 
+* they must be enclosed in quotes
+
+             alen = TM_LENSTR1(attname)
+             IF  (attname(1:1) .EQ. "'" .AND. 
+     .            attname(alen:alen) .EQ. "'") THEN
+
+                CALL CD_GET_VAR_ATT_ID (dset, varid, attname, 
+     .              attid, status)
+                IF (status .EQ. ferr_ok) GOTO 1000
+             ENDIF
+	     
+             CALL CD_GET_VAR_ATT_ID (dset, varid, attname, 
+     .              attid, status)
+             IF (status .EQ. ferr_ok) GOTO 1000
+ 
+             attok = .FALSE.
+             IF (status .EQ. atom_not_found) status = 
+     .               ferr_unknown_attribute
+             vlen = TM_LENSTR1(varname)
+             err_string = 'attribute '//attname(:alen)//
+     .                       ' not found for dataset '
+             GOTO 5200
+
+          ENDIF
+
+       ENDIF
+          
+* Check that the dset contains the variable; . is varid=0
+        
+* Is the variable name in quotations?
+        
+        vlen = TM_LENSTR1(varname)
+        IF (varname(1:1) .EQ. "'" .AND. varname(vlen:vlen) .EQ. "'") THEN
+           status = 3  ! just for debugging
+        ENDIF 
+
+        CALL CD_GET_VAR_ID (dset, varname, varid, status)
+
+* If we didnt find the name in the dataset, it may be a  user var,
+* which just depends on that data set
+
+        IF (status  .NE. ferr_ok) THEN
+           dset = -1
+           CALL CD_GET_VAR_ID (dset, varname, varid, status)
+           IF (status .EQ. ferr_ok) dset = -1
+        ENDIF
+
+        IF (status .NE. ferr_ok .AND. 
+     .      (STR_SAME(varname(:vlen), '.') .NE. 0) ) THEN
+           status = ferr_unknown_variable
+           err_string = " "
+           GOTO 5200
+        ENDIF
+
+  90    CONTINUE
+        CALL CD_GET_VAR_INFO (dset, varid, buff, vartype, nvdims, 
+     .                vdims, nvatts, coordvar, all_outflag, status) 
+        varname = buff  ! get varname in original upper- or lowercase form
+
+        IF ( INDEX(attname,'.') .GT. 0 ) THEN
+           GOTO 5100
+        ENDIF
+
+       IF (coordvar .AND. INDEX( text(:dot-1), '(' ) .EQ. 0 ) THEN
+          status = ferr_syntax
+          err_string = "enclose coordinate variable name in parentheses"
+          GOTO 5300
+       ENDIF
+
+       err_string = 'attribute '//attname(:alen)//
+     .              ' not found for variable '// varname(:vlen)
+
+* Is the attribute specified by a number? (check as in find_dset_number)
+	IF ( TM_DIGIT( attname ) ) THEN
+
+	   buff = attname(:alen)
+
+#ifdef MANDATORY_FORMAT_WIDTHS
+	   READ (buff,*, ERR=5200 ) attid
+#else
+	   READ (buff, '(I)', ERR=5200 ) attid
+#endif
+           val = attid
+           buff13 = TM_STRING(val)
+           CALL TM_PACK_STRING(buff13, vbuff, 1, 13, short_len)
+	   vax_code = STR_CASE_BLIND_COMPARE( vbuff, buff(1:13) )
+	   IF (  vax_code .NE. vms_str_success ) GOTO 5200
+
+* Check that this var has this attribute.  
+           IF (attid .LT. 1   .OR.  attid .GT. nvatts) GOTO 5200
+           CALL CD_GET_VAR_ATT_NAME (dset, varid, attid, attname, 
+     .              status)
+	ELSE
+
+           CALL CD_GET_VAR_ATT_ID(dset, varid, attname, attid, status)
+           IF (status .NE. ferr_ok .OR. attid .EQ. 0) THEN
+
+* See if it is a pseudo-attribute attnames, ndims, etc.
+
+              IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN 
+                 attok = .TRUE.
+              ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+                 attok = .TRUE.
+              ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+                 attok = .TRUE.
+              ELSE IF (STR_SAME(attname, 'nctype') .EQ. 0 ) THEN
+                 attok = .TRUE.
+              ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+                 attok = .TRUE.
+              ELSE
+
+* is the attribute name in quotations? If so then remove them, and test
+* for the name with case-sensitivity. When the above keywords, attnames, 
+* etc, are in the file as attribute names, then they must be enclosed in 
+* quotes to be accessed.
+
+                 alen = TM_LENSTR1(attname)
+                 IF  (attname(1:1) .EQ. "'" .AND. 
+     .                attname(alen:alen) .EQ. "'") THEN
+                    
+                    CALL CD_GET_VAR_ATT_ID (dset, varid, attname,
+     .                 attid, status ) 
+                    IF (status .EQ. ferr_ok) GOTO 1000
+                 ENDIF
+ 
+                 attok = .FALSE.
+                 IF (status .EQ. atom_not_found) status = 
+     .               ferr_unknown_attribute
+                 vlen = TM_LENSTR1(varname)
+                 err_string = 'attribute '//attname(:alen)//
+     .                       ' not found for variable '//
+     .                        varname(:vlen)
+                 GOTO 5200
+              ENDIF
+           ENDIF
+
+       ENDIF
+
+* successful completion
+        dset_in = dset
+ 1000	status = ferr_ok
+
+	RETURN
+
+* error exits. ADD_ATTRIBUTE uses this routine to see if an attribute is already
+* defined, and if not, creates the attribute.  In that case we do not want the 
+* error msg.
+
+ 5000	CONTINUE
+	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, text(:tlen), *5000 )
+        RETURN
+
+ 5200	IF (do_err) THEN
+           buff = text(:tlen)
+           CALL ERRMSG( status, status, buff(:tlen)//pCR//err_string, 
+     .               *5000 )
+        ELSE
+           RETURN
+        ENDIF
+
+ 5300	CALL ERRMSG( status, status, err_string, *5000 )
+        RETURN
+
+	END
diff --git a/fer/rpn/break_varname.F b/fer/rpn/break_varname.F
new file mode 100644
index 0000000..d8de0f9
--- /dev/null
+++ b/fer/rpn/break_varname.F
@@ -0,0 +1,183 @@
+	SUBROUTINE BREAK_VARNAME( text, dset_in, varname, attname, 
+     .                            varid, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Break up a name of the form varname.attname
+* Check whether the variable exists within the dataset
+* stored in linked-list structure of nc datasets.
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V600 6/05 *acm* Attribute control.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V604 6/07 *acm* Fix bug 1518 If we didnt find the varid in the dataset,
+*                 it may  be a user var(as in break_varattname, where the bug
+*                 occurred, but make the same change here.)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xprog_state.cmn'
+	include 'xrisc.cmn'
+	include 'gfdl_vms.parm'	
+
+* calling argument declaration:
+	INTEGER		dset_in, varid, dset_try, status
+	CHARACTER*(*)	text, varname, attname
+
+* internal variable declarations:
+        LOGICAL coordvar
+	INTEGER	TM_LENSTR, TM_LENSTR1, STR_SAME,
+     .         dset, tlen, vlen, dot, vartype, nvdims, nvatts, 
+     .         vdims(8), all_outflag, first, second, dotdot
+        CHARACTER*128 err_string
+
+* Break text at dot: varname.attname
+
+        dset = dset_in
+        IF (dset .EQ. unspecified_int4) dset = -1   ! try user variables.
+
+        risc_buff = text
+        tlen = MIN( size_rbuff, TM_LENSTR(text) )
+
+        IF (tlen .LE. 1 .OR. INDEX(risc_buff,'.') .EQ. 0 ) THEN
+           varname = risc_buff
+           attname = ""
+           GOTO 1000
+        ENDIF
+
+        dot = INDEX(risc_buff,'.')
+        dotdot = INDEX(risc_buff,'..')
+        IF (dotdot .GT. 0) dot = dotdot + 1
+
+* is the name in quotations? If so then it may contain a dot and not
+* be varname.attname See if its all within quotes, if so this is a 
+* variable name containg a dot.
+
+	first = INDEX(risc_buff(1:tlen), "'" )
+	second = INDEX(risc_buff(2:tlen), "'" )
+        IF (dot .GT. first .AND. dot .LT. second) THEN
+           varname = risc_buff
+           attname = ""
+           status = ferr_not_attribute
+           GOTO 5000
+        ENDIF
+
+        tlen = MIN(tlen, LEN(varname))
+        tlen = MIN(tlen, LEN(attname))
+
+        varname = risc_buff(:dot-1)
+        attname = risc_buff(dot+1:tlen)
+
+* Is the dot a decimal point within an expression, as in LIST a[y=0.5:9.5]
+* or LIST a[gx=sst[d=1],y=1.5] Look for opening bracket in varname and
+* closing bracket in attname.
+
+        IF ((INDEX(varname,'[') .GT. 0)  .AND. 
+     .      (INDEX(attname,']') .GT. 0)) THEN
+           varname = risc_buff
+           attname = ""
+           GOTO 1000
+        ENDIF
+
+! varname.attname[d=1]  is ok
+! varname[d=1].attname  is not ok
+
+        IF ( INDEX(varname,'[') .GT. 0 ) GOTO 5100 
+
+* Is the varname the keyword . referring to the dataset?
+        IF (STR_SAME (varname, '.') .EQ. 0) THEN
+           varid = 0
+           GOTO 1000
+        ENDIF
+          
+* Check that the dset contains the variable (varid=0 refers to . the 
+* pseudovariable that refers to global attributes)
+
+        CALL CD_GET_VAR_ID (dset, varname, varid, status)
+
+* If we didnt find the name in the dataset, it may be a  user var,
+* which just depends on that data set
+
+        IF (status  .NE. ferr_ok) THEN
+           dset_try = -1
+           CALL CD_GET_VAR_ID (dset_try, varname, varid, status)
+           IF (status .EQ. ferr_ok) dset_in = -1
+        ENDIF
+
+
+        IF (status .NE. ferr_ok) THEN
+           status = ferr_unknown_variable
+           GOTO 5200
+        ENDIF
+
+        vlen = TM_LENSTR1(varname)
+
+        IF (status .NE. ferr_ok .AND. 
+     .     (STR_SAME(varname(:vlen), '.') .NE. 0) ) THEN
+           status = ferr_unknown_variable
+           GOTO 5200
+        ENDIF
+
+        CALL CD_GET_VAR_INFO (dset, varid, varname, vartype, nvdims, 
+     .                vdims, nvatts, coordvar, all_outflag, status) 
+
+        IF (status .EQ. ferr_ok .AND. 
+     .      (coordvar .AND. INDEX( risc_buff(:dot-1), '(' ) .EQ. 0) ) THEN
+           status = ferr_syntax
+           err_string = "enclose coordinate variables in parentheses"
+           GOTO 5300
+        ENDIF
+
+        IF ( INDEX(attname,'.') .GT. 0 ) GOTO 5100
+
+* successful completion. 
+
+ 1000	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	CONTINUE
+	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, risc_buff(:tlen), *5000 )
+ 5200	CALL ERRMSG( status, status, risc_buff(:tlen),  *5000 )
+ 5300	CALL ERRMSG( status, status, risc_buff(:tlen)//pCR//err_string, 
+     .               *5000 )
+
+	END
diff --git a/fer/rpn/delete_all_uvar_grids.F b/fer/rpn/delete_all_uvar_grids.F
new file mode 100644
index 0000000..75d248f
--- /dev/null
+++ b/fer/rpn/delete_all_uvar_grids.F
@@ -0,0 +1,75 @@
+	SUBROUTINE DELETE_ALL_UVAR_GRIDS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* delete all the grids that have been determined for user variables
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V230:  8/10/92 - needed for DEFINE REGION which may change the implied
+*                  context info of uvars using let x = var[@reg] notation
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'	
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+* ...
+
+* internal variable declarations:
+	INTEGER	i, uvar, j, num_indices
+
+* loop through the user-defined variables
+*	DO 500 uvar = 1, max_uvar
+*	   IF ( uvar_num_items( uvar ) .EQ. uvar_deleted ) GOTO 500
+        CALL deleted_list_get_undel(uvar_num_items_head,
+     .                              deleted_list_result(1),
+     .                              max_uvar, num_indices )
+        DO 500 j = 1, num_indices
+           uvar = deleted_list_result(j)
+* return to default that all limits are irrelevant
+	   DO 100 i = 1, nferdims
+ 100	   uvar_given(i,uvar) = uvlim_irrelevant
+
+* reset grid to unknown for all data sets and clear dynamic grid info
+	   CALL DEALLO_UVAR_GRIDS(uvar)
+
+ 500	CONTINUE
+
+ 	RETURN
+	END
diff --git a/fer/rpn/dflt_trans_arg.F b/fer/rpn/dflt_trans_arg.F
new file mode 100644
index 0000000..30b338a
--- /dev/null
+++ b/fer/rpn/dflt_trans_arg.F
@@ -0,0 +1,121 @@
+	SUBROUTINE DFLT_TRANS_ARG( idim, cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* if no argument was specified for the given transformation then insert
+* a default
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   6/7/89 - removed this function from GET_CONTEXT_MODS
+*	 1/11/90 - added @LOC
+*	  2/7/90 - corrected error detect bug for transforms without args
+* V400:  5/30/95 - increased arbitrary argument limit of 1000 to 32766
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling arguments
+	INTEGER	idim, cx, status
+
+* internal variable declarations
+	INTEGER	i, ktrans
+	REAL	arg
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'	
+	include 'errmsg.parm'	
+	include 'xcontext.cmn'
+	include 'xalgebra.cmn'
+
+* initialize
+	ktrans = cx_trans( idim, cx )
+	arg   = cx_trans_arg( idim, cx )
+
+* identify the transformation in terms of numbering in COMMON (XALG*)
+	DO 100 i = 1, num_transforms
+	   IF ( ktrans .EQ. alg_trans_num(i) ) GOTO 200
+ 100	CONTINUE
+
+* not found !
+	status = ferr_internal
+	GOTO 5100
+
+* does it take an argument ?
+ 200	IF ( alg_trans_has_arg( i ) ) THEN
+* yes !
+	   IF ( arg .EQ. bad_val4 ) THEN
+* ... insert default value
+	      cx_trans_arg( idim, cx ) = alg_trans_dflt_arg(i)
+
+	   ELSEIF ( alg_trans_its_int(i) ) THEN
+* ... convert argument to integer if possible
+
+*     Dont limit the size of this -- using very large indices is ok.
+*     May need very large numbers for some @SHF operations.
+
+c	      IF ( ABS(arg) .GT. 32766. ) THEN	! was 1000 5/95
+c	         GOTO 5000
+c	      ELSE
+	         cx_trans_arg( idim, cx ) = INT( arg )
+c	      ENDIF
+	   ELSE
+* ... leave it as it is
+	      CONTINUE
+	   ENDIF
+
+	ELSE
+* no! if the user gave an argument he/she shouldn't have
+	   IF ( arg .NE. bad_val4 ) THEN
+	      status = ferr_unknown_arg
+	      GOTO 5100
+	   ENDIF
+	ENDIF
+
+* argument of zero is illegal for some things
+	IF( arg .EQ. 0.0
+     .	 .AND. (   ktrans.EQ.trans_smth_box
+     .	      .OR. ktrans.EQ.trans_smth_binml
+     .	      .OR. ktrans.EQ.trans_fill_ave )  ) GOTO 5000
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	status = ferr_out_of_range
+ 5100	RETURN
+	END
diff --git a/fer/rpn/expr_name.F b/fer/rpn/expr_name.F
new file mode 100644
index 0000000..e3bd6dd
--- /dev/null
+++ b/fer/rpn/expr_name.F
@@ -0,0 +1,56 @@
+	CHARACTER*8 FUNCTION EXPR_NAME( n )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a unique name for a user-defined variable
+* "expr#1","expr#2",..."expr#9","expr#:","expr#,",etc. from ASCII table
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/23/87
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		n
+
+	EXPR_NAME = 'EX#'//CHAR(48+n)
+
+	RETURN
+	END
diff --git a/fer/rpn/init_counter_var.F b/fer/rpn/init_counter_var.F
new file mode 100644
index 0000000..6a31c6d
--- /dev/null
+++ b/fer/rpn/init_counter_var.F
@@ -0,0 +1,175 @@
+ 	SUBROUTINE INIT_COUNTER_VAR ( name, text, txstart, txend, 
+     .                 xlo, xhi, del, cvar, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compile a variable structure into a counter variable.
+* Expression is of the form LO:HI or LO:HI:DEL
+* 1/21/04 *acm* from init_user_var.F
+* V554 1/04 *acm* - additions for /RANGE repeat loop control
+
+* V554 3/04 *acm* - fix error messages
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'	
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xvariables.cmn'
+	include 'xrisc_buff.cmn'
+        include 'xalgebra.cmn'
+	include	'xcontext.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*)	name, text
+	INTEGER		txstart, txend, xlo, xhi, del,  cvar, status
+
+* internal variable declarations:
+
+        INTEGER		TM_LENSTR, ATOM_POS, STR_UPCASE, iflag, 
+     .                  slen, colon_pos, colon2_pos, lo_start, lo_end, 
+     .                  hi_start, hi_end, del_start, del_end, dum
+        LOGICAL         colon, colon2, fmat, logical_dummy, by_ss
+        REAL*8          answer		
+        CHARACTER*50    err_msg
+
+* find an unused counter var slot for the variable
+	DO 100 cvar = 1, num_counter_vars
+	   IF ( alg_cvar( cvar ) .EQ. unspecified_name4 ) GOTO 1000
+ 100	CONTINUE
+	GOTO 5100
+
+* initialize the counter variable, "cvar"
+* algebraic expression too long ?
+
+1000	IF ( txend-txstart .GE. cvar_text_len ) CALL ERRMSG
+     .  ( ferr_line_too_long, status, text(txend-14:txend), *5000 )
+
+* copy name code and text into slot and change as needed to upper case
+* Should not have any text: these variables are LO:HI:DEL
+
+
+* copy name code and text into slot and change as needed to upper case
+*	iflag = STR_UPCASE( countervar_name( cvar ), name )
+        CALL string_array_modify_upcase(countervar_name_head,
+     .                           cvar,
+     .                           name,
+     .                           LEN(name))
+
+        iflag = STR_UPCASE( alg_cvar( cvar ), text(txstart:txend) )
+
+* get the X range
+
+        slen = TM_LENSTR(text)
+        IF (slen .LT. 3) CALL ERRMSG
+     .	 ( ferr_invalid_command, status, 
+     .     'REPEAT/RANGE without range ?', *5000 )
+
+* ... ":"
+        lo_start = 1
+        colon = .FALSE.
+	colon_pos = ATOM_POS( text, ':' )
+	IF ( colon_pos .EQ. atom_illegal_pos ) GOTO 5200
+	colon  = colon_pos .NE. atom_not_found
+	IF ( colon ) THEN
+	   lo_end	 = colon_pos - 1
+	ELSE
+	   colon2	 = .FALSE.
+	   lo_end	 = slen
+	ENDIF
+        IF (.NOT. colon) GOTO 5200
+
+*  ... second ":"
+
+        colon2 = .FALSE.
+	IF ( colon ) THEN
+	   colon2_pos = ATOM_POS(text( colon_pos+1:slen ), ':' )
+	   IF ( colon2_pos .EQ. atom_illegal_pos
+     .	   .OR. colon2_pos .EQ. 1 ) GOTO 5200
+	   colon2 = colon2_pos .NE. atom_not_found
+	   IF ( colon2 ) THEN
+	      colon2_pos = colon2_pos + colon_pos
+	      hi_end     = colon2_pos - 1
+	      IF (INDEX(text(colon2_pos+1:slen),':').GT.0) GOTO 5200
+	   ELSE
+	      hi_end     = slen
+	   ENDIF
+	   hi_start	 = colon_pos + 1
+	   del_start	 = colon2_pos + 1
+           del_end       = slen
+	ENDIF
+
+* Call translate_limit to check syntax and set ss limits
+
+        by_ss = .TRUE.
+        dum = 1
+
+	CALL TRANSLATE_LIMIT
+     .		      (  text(lo_start:lo_end), x_dim,
+     .			by_ss, answer, fmat, dum, status )
+        xlo = INT(answer)
+
+	CALL TRANSLATE_LIMIT
+     .		      (  text(hi_start:hi_end), x_dim,
+     .			by_ss, answer, fmat, dum, status )
+        xhi = INT(answer)
+
+	del = 1
+        IF (colon2) THEN
+           CALL TRANSLATE_LIMIT
+     .		      ( text(del_start:del_end), x_dim,
+     .			by_ss, answer, logical_dummy, dum, status )
+           del = INT(answer)
+        ENDIF
+
+* successful completion
+	status = ferr_ok
+	RETURN	
+
+* error exit
+ 5000	RETURN
+
+ 5100	WRITE (err_msg, 4000) num_counter_vars
+        CALL ERRMSG( ferr_prog_limit, status,
+     .		'too many counter variables'//pCR//
+     .		err_msg, *5000 ) 
+ 4000   FORMAT ('maximum number is ', i3)
+ 5200   CALL ERRMSG( ferr_syntax, status, 
+     .	          risc_buff(:slen)//pCR//
+     .'":" used incorrectly. A correct example is "RANGE=1:100:10".',
+     .	          *5000)
+        END
diff --git a/fer/rpn/init_uvar.F b/fer/rpn/init_uvar.F
new file mode 100644
index 0000000..6768e1e
--- /dev/null
+++ b/fer/rpn/init_uvar.F
@@ -0,0 +1,345 @@
+	SUBROUTINE INIT_UVAR ( name, text, title, units, dset, bad,
+     .                         implct_defn, uvar,
+     .			       at_type, at_id, at_start, at_end,
+     .			       natom, txstart, txend, varname, 
+     .			       its_remote, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compile a user variable structure into one or more user variables.
+* Expression should arrive with the atoms identified in at_type but
+* still in inifx order. Since multiple expressions may exist within
+* the same text string (text) this routine has txstart and txend 
+* to indicate the offsets to the particular expression in question
+
+* The incoming expression may contain "grid-changing functions", for example
+*	yes? LET vfft = TFFT(v) + A + B
+* in which "TFFT" replaces the T axis in the course of computing an FFT.
+* In such a case a "child variable" is created equivalent to 
+*	yes? LET (013,001) = TFFT(v)
+*	yes? LET vfft = (013,001) + A + B
+
+* Note that the addition of grid-changing variables and child variables
+* was introduced as a series of "hacks" that have made the code needlessly complex.
+* Could be cleaned up ... (*sh*)
+
+
+* revision 0.0 - 2/19/87
+* revision 0.1 - 9/22/87 - ferr_uvar_max --> *_prog_limit
+* V200:  6/20/89 - re-worked user defined variable logic
+*		 - syntax checking on variable names
+*       11/27/89 - major re-write for RPN ordering
+*        2/19/90 - corrected error messages
+* Unix/RISC port - 7/10/91 - shorter "line too long" text string
+*       10/22/92 - added units on uvars
+* V402:  7/95 - Added "dset" argument for  LET/D=dset var = ... 
+* V420:  12/95 - initialize uvar_mod_pseudo
+* V450:  12/96 - much of the guts of the routine moved to INIT_UVAR_SUB
+*		 Call RPN from within this routine instead of beforehand
+*		 in order to simplify breaking out of grid-changing functions
+*         5/97 - create separate child vars for expressions used as args to
+*		 a grid-changing function
+*         7/97 - bug fix for case of GCFCN(a,b)
+* V491:   2/98 - fix to 5/97 changes: a constant is an expression, too
+* V500:  2/99 *sh* - bug fix for GC child var parsing
+*		GCFCN((a)) generated an error -- paren problem
+* V510: 10/99 *sh* - bug fix: if, say, SST[Y=5s:5N:1] is an argument to a GC
+*		function, this routine must create a child variable so that
+*		the implicit grid is "owned" by someone.
+*	11/99 *sh* - bug fix: if child var occurred in the second (or higher)
+*			expression in a line the child var name was wrong
+*	12/99 *sh* - reverted to this code following temporary commenting out
+*		of 10/99 fix by Ansley to keep EFs running. Changes to
+*		EF_GET_ARG_SUBSCRIPTS now permit 10/99 change to work
+*	1/00 *sh* - bug fix: parent_uvar was always set to ultimate ancestor
+*		 instead of actual parent. Created gcf stack
+* V510: 5/00 *sh* - added "bad" (missing value flag) to arguments
+* 1/03 *kob* g77 port - requires use of risc_buff for concats
+* V62   2/09 *acm* Pass the original upper/lowercase spelling of user-defined variable
+*                  names to init_uvar_sub; name to be saved in the attribute structure, for 
+*                  use when writing out user-defined variables when MODE UPCASE_OUTPUT 
+*                  is cancelled.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'	
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xvariables.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling argument declarations:
+	LOGICAL		implct_defn, its_remote
+	CHARACTER*(*)	name, text, title, units, varname
+	INTEGER		uvar, natom, txstart, txend, status,
+     .			at_type  (maxatoms), at_id  (maxatoms),
+     .			at_start (maxatoms), at_end (maxatoms), dset
+	REAL		bad
+
+* internal parameter declarations
+	LOGICAL		itsa_gc
+	INTEGER		max_gcf_stack
+	PARAMETER     ( max_gcf_stack = 15 )
+* internal variable declarations:
+	LOGICAL		has_children, child, child_remote
+	INTEGER		tlen, iat, paren_level, atoms_lost, uvar_child, gcfstk, 
+     .			child_start, child_end, gc_arg_start, istart, iend,
+     .			parent,
+     .			gcf_start(0:max_gcf_stack), gcf_uvar(0:max_gcf_stack)
+	CHARACTER	child_name*16
+
+* initialize
+	tlen  =  txend - txstart + 1
+	has_children = .FALSE.
+
+* find an unused uvar slot for the variable and initialize grid chg fcn stack
+	DO 100 uvar = 1, max_uvar
+	   IF ( uvar_num_items( uvar ) .EQ. uvar_deleted ) THEN
+	      gcfstk = 0	
+	      gcf_start(0) = 0
+	      gcf_uvar (0) = uvar ! assignment never used but what the heck ...
+*	      uvar_num_items( uvar ) = uvar_on_hold
+              CALL deleted_list_modify(uvar_num_items_head, uvar,
+     .                uvar_on_hold)
+	      GOTO 200
+	   ENDIF
+ 100	CONTINUE
+	GOTO 5100
+
+* scan the atoms for grid-changing functions. These functions need to
+* be compiled each as a separate variable definition.
+* These variables will be invisible to the user of Ferret (except when
+* using mode diagnostic). They have the special property that their result
+* grid cannot necessarily be inferred from the component arguments.
+ 200	paren_level = 0
+	DO 300 iat = gcf_start(gcfstk)+1, natom
+	   IF ( at_type(iat).EQ. alg_grid_chg_fcn ) THEN
+* ... find the variable number for this "child variable"
+*     Note that for the simple non-nested case of LET v = GCF(arg, arg, ...)
+*     no child variables are needed - so at the end of this routine we clean
+*     up left-over "on_hold" uvars
+	      DO 250 uvar_child = 1, max_uvar
+	         IF ( uvar_child .EQ. uvar ) GOTO 250
+	         IF ( uvar_num_items( uvar_child ) .EQ. uvar_deleted ) GOTO 260
+ 250	      CONTINUE
+	      GOTO 5900
+ 260	      gcfstk = gcfstk + 1 ! new stack level for the child
+*	      uvar_num_items( uvar_child ) = uvar_on_hold
+              CALL deleted_list_modify(uvar_num_items_head, uvar_child,
+     .                                 uvar_on_hold)
+	      gcf_uvar (gcfstk) = uvar_child
+	      gcf_start(gcfstk) = iat
+	      paren_level = 0
+	   ELSEIF ( gcfstk .GT. 0
+     .	    .AND.   at_type(iat).EQ. alg_punctuation ) THEN
+	      IF ( at_id(iat) .EQ. left_paren ) THEN
+	         paren_level = paren_level + 1
+	      ELSEIF ( at_id(iat) .EQ. right_paren ) THEN
+	         paren_level = paren_level - 1
+	         child_end = iat
+* ... found the bounds of a grid changing function call ?
+	         IF ( paren_level .EQ. 0 ) GOTO 700
+	      ENDIF
+	   ENDIF
+ 300	CONTINUE
+	IF ( gcfstk .NE. 0 ) GOTO 5200	! syntax error
+
+* no (more) child definitions. Go initialize the parent
+	GOTO 1000
+
+* Grid-changing functions need to know the grids of each of their arguments
+* This requires that each argument be "simple" -- expressions like a+b are not
+* allowed. In this section, we scan the arguments of the grid-changing
+* function and if we find a complex argument or a simple argument that  may
+* have an implicit grid, we create a separate child
+* variable from it
+* At this point we know there are no grid-changing functions used in the args.
+* In this very simple parsing operation any arg with more than one "atom"
+* will generate a separate child variable, including "gcfcn( (A) )"
+ 700	child_start = gcf_start(gcfstk)
+	gc_arg_start = child_start + 2		! past first paren 
+	paren_level = 1
+	DO 750 iat = child_start+2, child_end
+	   IF ( at_type(iat) .NE. alg_punctuation ) GOTO 750
+	   IF     ( at_id(iat) .EQ. left_paren  ) THEN
+	      paren_level = paren_level + 1
+	   ELSEIF ( at_id(iat) .EQ. right_paren ) THEN
+	      paren_level = paren_level - 1
+	   ENDIF
+* ... check for the end of an argument -- comma or final paren
+	   IF (  (at_id(iat).EQ.comma .AND. paren_level.EQ.1)
+     .	    .OR. paren_level .EQ. 0   ) THEN
+* ...(2/98) treat lone constant like a "complex" argument (an expression)
+* ...(10/99)also treat sst[y=5s:5n:1] as a "complex" argument (has impl grid)
+	      istart = at_start (gc_arg_start)
+	      iend   = at_end   (gc_arg_start)
+	      IF ( (at_type(gc_arg_start) .EQ. alg_child_var)
+     .	     .OR.  ( (iat .EQ. gc_arg_start+1)
+     .         .AND. (at_type(gc_arg_start) .NE. alg_constant)
+     .	       .AND. (INDEX(text(istart:iend),'[').EQ.0)    )   ) THEN
+* ... this argument is "simple" (a single atom) 
+	         gc_arg_start = iat + 1	! look for next
+	      ELSE
+* ... make this (complex) argument into a separate child variable
+	         child_start = gc_arg_start
+	         child_end = iat - 1
+	         GOTO 800
+	      ENDIF	
+	   ENDIF
+ 750	CONTINUE
+
+* There were no complex arguments in this grid-changing function
+* If the entire definition is LET A = GCFCN(args) then no need for child fcns
+	IF ( gcfstk .EQ. 1
+     . .AND. .NOT.has_children
+     . .AND. child_start .LE. 1
+     . .AND. child_end   .EQ. natom ) GOTO 1000
+
+* generate name of child variable -- points to *ancestor*, not parent
+ 800	CALL GCF_CHILD_VAR_NAME( uvar,
+     .				 at_start(child_start)-(at_start(1)-1),
+     .				 child_name )
+	itsa_gc = at_type(child_start) .EQ. alg_grid_chg_fcn
+
+	IF ( itsa_gc ) THEN
+	   uvar_child = gcf_uvar(gcfstk)
+	   parent = gcf_uvar(gcfstk-1)
+	ELSE
+	   DO 850 uvar_child = 1, max_uvar
+	      IF ( uvar_child .EQ. uvar ) GOTO 850
+	      IF ( uvar_num_items( uvar_child ) .EQ. uvar_deleted ) THEN
+	         parent = gcf_uvar(gcfstk)
+	         GOTO 860
+	      ENDIF
+ 850	   CONTINUE
+	   GOTO 5900
+	ENDIF
+
+* initialize the child variable  its_remote is set .FALSE. for child variables. (?)
+ 860	child = .TRUE.
+        child_remote = .FALSE.
+        CALL INIT_UVAR_SUB (
+     .			     child_name,
+     .			     text, ' ', ' ', dset, bad,
+     .                       child_remote, implct_defn, uvar_child,parent,
+     .			     at_type(child_start), at_id(child_start),
+     .			     at_start(child_start), at_end(child_start),
+     .			     child_end-child_start+1,
+     .			     at_start(child_start), at_end(child_end),
+     .			     child, child_name, status )
+	IF ( status .NE. ferr_OK ) GOTO 5900
+
+* ... if the child we just created was a GC then pop the gc stack
+	IF ( itsa_gc ) gcfstk = gcfstk - 1
+
+* consolidate the parent atom definitions so that the child appears as a
+* single atom (a variable) in the definition
+	atoms_lost = child_end - child_start
+	at_end(child_start) = at_end(child_end)
+	at_type(child_start) = alg_child_var	! alg_variable w/ diff. naming 
+	at_id(child_start)   = unspecified_int4
+	DO 900 iat = child_end+1, natom
+	   child_start = child_start + 1
+	   at_start(child_start) = at_start(iat)
+	   at_end(child_start)   = at_end(iat)
+	   at_type(child_start)  = at_type(iat)
+	   at_id(child_start)    = at_id(iat)
+ 900	CONTINUE
+	natom = natom - atoms_lost
+	has_children = .TRUE.
+	GOTO 200		! back for more children
+
+*============================================================
+
+* initialize the parent user variable, "uvar"
+ 1000	child = .FALSE.
+        CALL INIT_UVAR_SUB ( name, text, title, units, dset, bad,
+     .                         its_remote, implct_defn, uvar, 0,
+     .			       at_type, at_id, at_start, at_end,
+     .			       natom, txstart, txend, child, varname,
+     .			       status )
+
+	IF ( status .NE. ferr_OK ) GOTO 5900
+
+* clean up left-over on-hold variables
+	DO 1100 uvar_child = 1, max_uvar
+*	   IF (uvar_num_items(uvar_child) .EQ. uvar_on_hold)
+*     .			uvar_num_items(uvar_child) = uvar_deleted
+	   IF (uvar_num_items(uvar_child) .EQ. uvar_on_hold)
+     .	      CALL deleted_list_modify(uvar_num_items_head, uvar_child,
+     .                                  uvar_deleted )
+ 1100	CONTINUE
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+* ... remove any holds left on variable slots
+ 5000	DO 5010 uvar = 1, max_uvar
+* 5010	IF  ( uvar_num_items(uvar) .EQ. uvar_on_hold )
+*     .	      uvar_num_items(uvar) = uvar_deleted
+ 5010	IF  ( uvar_num_items(uvar) .EQ. uvar_on_hold )
+     .	  CALL deleted_list_modify(uvar_num_items_head, uvar,
+     .                            uvar_deleted )
+	RETURN
+
+ 5100	CALL ERRMSG( ferr_prog_limit, status,
+     .		'too many user-defined variables'//pCR//
+     .		'cancel or redefine some variables', *5000 )
+ 5200	risc_buff = text(txstart:txend)
+	CALL ERRMSG( ferr_syntax, status,
+     .		'unclosed parentheses: '//risc_buff, *5000 )
+
+* remove all child variables of the variable being initialized
+ 5900	CALL GCF_CHILD_VAR_NAME( uvar, 0, child_name )
+	DO 5910 uvar_child = uvar, max_uvar
+	   IF ( uvar_name_code(uvar_child)(7:10)
+     .     .EQ. child_name(7:10) ) THEN
+*	      uvar_num_items( uvar_child ) = uvar_deleted
+              CALL deleted_list_modify(uvar_num_items_head, 
+     .                         uvar_child, uvar_deleted )
+
+*	      uvar_name_code( uvar_child ) = " "
+              CALL string_array_modify(uvar_name_code_head, uvar_child,
+     .                                  " ", 1)
+
+	      uvar_text     ( uvar_child ) = " "
+	   ENDIF
+ 5910	CONTINUE
+	GOTO 5000
+
+	END
diff --git a/fer/rpn/init_uvar_sub.F b/fer/rpn/init_uvar_sub.F
new file mode 100644
index 0000000..944b51e
--- /dev/null
+++ b/fer/rpn/init_uvar_sub.F
@@ -0,0 +1,286 @@
+	SUBROUTINE INIT_UVAR_SUB ( name, text, title, units, dset, bad,
+     .                             its_remote, implct_defn, uvar, parent_uvar,
+     .			           at_type, at_id, at_start, at_end,
+     .			           natom, txstart, txend, child, 
+     .			           varname, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Fill in a user variable structure with a new expression
+* Expression should arrive with the atoms identified in at_type but
+* still in infix order. Since multiple expressions may exist within
+* the same text string (text) this routine has txstart and txend
+* to indicate the offsets for the particular expression in question
+
+* V450:  12/96 - mostly borrowed from the previous INIT_UVAR
+* *kob*  6/97 - rpn_order was erroneously declared as array of size 
+*               max_exp, changed it to maxatoms
+* V450:  7/97 - save the value of parent_uvar in uvar_parent
+* V491:  12/97 - add check to ensure natom_rpn returned from RPN isn't
+*                greater than max_uvar_items  *kob*
+* V495: 7/7/98 - *sh* variable names in single quotes - don't upcase them
+*     : 9/30/98 - NAG F90 (linux) received error on above change.  
+*                 need to put single  tick between double quotes  *kob*
+*               - also needed a definition for HEXDF variable used
+* V500:  1/99 *sh* - don't upcase double quoted strings, either
+*        3/99 *sh* - bug fix: pass the full error text to RPN, since
+*			at_start, at_end are relative to full text buffer
+*	12/99 *sh* - initialize uvar_lo/hi*
+* V510: 5/00 *sh* - added "bad" (missing value flag) to arguments
+* 1/03 *kob* g77 port - requires use of risc_buff for concats
+*            bug fix - reference to uvar_text was missing uvar reference 
+* V600  4/06 *acm* - additional declarations found by Solaris compiler     
+* V601 11/06 *acm* - add user variables always to dataset -1. Previously
+*                    variables defined with LET/D= were added to that dataset.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V62   2/09 *acm* Pass the original upper/lowercase spelling of user-defined variable
+*                  names to cd_add_var; name to be saved in the attribute structure, for 
+*                  use when writing out user-defined variables when MODE UPCASE_OUTPUT 
+*                  is cancelled.
+* V63  *acm* 10/09 Changes for gfortran build
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'	
+	include 'errmsg.parm'	
+	include 'rpn.parm'
+	include 'xvariables.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling argument declarations:
+	LOGICAL		implct_defn, child, its_remote
+	CHARACTER*(*)	name, text, title, units, varname
+	INTEGER		dset, uvar, natom, txstart, txend, status,
+     .			parent_uvar, 
+     .			at_type  (maxatoms), at_id  (maxatoms),
+     .			at_start (maxatoms), at_end (maxatoms)
+	REAL		bad
+
+* internal variable declarations:
+	LOGICAL inquote
+	INTEGER	        TM_LENSTR1, TM_LENSTR, STR_SAME, i, idim,
+     .                  natom_rpn, rpn_order(maxatoms), i2, quote_type,
+     .                  dset_to_add, slen, iat, varid, type, coordvar
+	CHARACTER	err_string*255, c*1, attname*128
+
+* internal parameter declarations
+	INTEGER		p_single_quote, p_double_quote
+	PARAMETER     ( p_single_quote = 1,
+     .			p_double_quote = 2 )
+
+* kob 9/30/98 This needed for 7/7/98 code addition
+#ifdef FORTRAN_90
+      INTEGER HEXDF
+      DATA HEXDF/Z'DF'/
+#endif
+
+
+* initialize
+
+* algebraic expression too long ?
+	IF ( txend-txstart .GE. uvar_text_len ) CALL ERRMSG
+     .		( ferr_line_too_long, status, text(txend-14:txend), *5000 )
+
+* convert to Reverse Polish (stack evaluation) order
+	CALL RPN( text,
+     .		  at_type, at_id, at_start, at_end,
+     .            natom, natom_rpn, rpn_order,
+     .            status, err_string)
+	IF ( status .NE. ferr_ok ) GOTO 5440
+* kob 12/97 - natom_rpn cannot be greater than max_uvar_items
+	IF (natom_rpn .GE. max_uvar_items) GOTO 5500
+
+* copy name code and text into slot and change as needed to upper case
+*	vax_code = STR_UPCASE( uvar_name_code( uvar ), name )
+        CALL string_array_modify_upcase(uvar_name_code_head, uvar, 
+     .                                  name, LEN(name))
+
+* (7/98) - don't upcase portions of the string inside single quotes
+* (1/99) - same deal for double quotes
+!	vax_code = STR_UPCASE( uvar_text     ( uvar ), text(txstart:txend) )
+	uvar_text(uvar) = ' '
+	i2 = 0
+	inquote = .FALSE.
+	DO 100 i = txstart, txend
+	   i2 = i2 + 1
+	   c = text(i:i)
+	   IF ( c .EQ. "'" ) THEN
+* ... single quote -- start or end of string?
+	      IF (inquote) THEN
+	        IF (quote_type.EQ.p_single_quote) inquote = .FALSE.
+	      ELSE
+		inquote = .TRUE.
+	        quote_type = p_single_quote
+	      ENDIF
+	   ELSEIF ( c .EQ. '"' ) THEN
+* ... double quote -- start or end of string?
+	      IF (inquote) THEN
+	        IF (quote_type.EQ.p_double_quote) inquote = .FALSE.
+	      ELSE
+		inquote = .TRUE.
+	        quote_type = p_double_quote
+	      ENDIF
+	   ENDIF
+	   IF ( inquote .OR. (c .LT. 'a' .OR. c .GT. 'z' ) ) THEN
+	      uvar_text(uvar)(i2:i2) = c   ! preserve case
+	   ELSE
+* ... convert lower case character to upper case
+#if defined unix  && ! defined NEED_IAND
+	      uvar_text(uvar)(i2:i2) = CHAR( AND('DF'X, ICHAR(c)) )
+#else
+# ifdef FORTRAN_90
+	      uvar_text(uvar)(i2:i2) = CHAR( IAND(HEXDF, ICHAR(c)) )
+# elif defined gfortran
+	      uvar_text(uvar)(i2:i2) = CHAR( AND('DF'X, ICHAR(c)) )
+#else
+* VMS needs IAND
+* bug fix - forgot (uvar) in var reference
+	      uvar_text(uvar)(i2:12) = CHAR( IAND('DF'X, ICHAR(c)) )
+# endif
+#endif
+	   ENDIF
+ 100	CONTINUE
+* (7/98) end of quote-sensitive case changing loop
+
+c* copy title, units, dset, and missing flag into buffers
+	uvar_title( uvar ) = title
+        uvar_units( uvar ) = units
+        uvar_dset ( uvar ) = dset
+        uvar_bad_data ( uvar ) = bad
+        uvar_remote ( uvar ) = its_remote
+
+* Add variable to the user-variable dataset in the linked list structure.
+* The variable type is not known at this time - will set it later when the
+* variable gets loaded. 
+
+* Do not add EX# expressions or child variables
+
+       type = 0
+       coordvar = 0
+       IF (name(1:3) .NE. 'EX#' .AND. .NOT.child) THEN
+          dset_to_add = -1  ! user-variable dataset.
+
+          err_string = title  ! save the value and restore below
+          IF (TM_LENSTR(title) .LT. 1) title = uvar_text(uvar)
+
+          CALL CD_ADD_VAR( dset_to_add, varname, uvar, title, units, 
+     .         type, coordvar, bad, status)
+
+          title = err_string
+          IF ( status .NE. ferr_ok ) GOTO 5600
+       ENDIF
+
+* !!! All the rest of the uvar_*(uvar) properties could become attributes of this uvar !!!
+
+* save the ID of the parent variable (or zero if this is a parent, itself)
+	uvar_parent( uvar ) = parent_uvar
+
+* place the list of atoms into the uvar in RPN order.
+	DO 300 i = 1, natom_rpn
+	   uvar_item_start(i,uvar) = at_start(rpn_order(i)) - txstart + 1
+	   uvar_item_end  (i,uvar) = at_end  (rpn_order(i)) - txstart + 1
+	   uvar_item_type (i,uvar) = at_type (rpn_order(i))
+ 300	CONTINUE
+        uvar_ifv(uvar) = .FALSE.
+        IF ( STR_SAME( uvar_text(uvar)(1:3), 'IFV' ) .EQ. 0 )  
+     .      uvar_ifv(uvar) = .TRUE.
+        
+!* add a terminator to the end of the list of RPN-ordered atoms
+!	natom_rpn = natom_rpn + 1
+!	uvar_item_type (natom_rpn,uvar) = alg_finished
+
+* store number of items in definition
+*	uvar_num_items( uvar ) = natom_rpn
+        CALL deleted_list_modify(uvar_num_items_head, uvar,
+     .                           natom_rpn )
+
+!* 7/98 - remove surrounding single quotes from variable names
+! no - keep 'em in to signal special name -- use 'em in MATCH_NAME
+!	DO 310 i = 1, natom_rpn
+!	   IF ( uvar_item_type (i,uvar) .EQ. alg_variable ) THEN
+!	      is = uvar_item_start(i,uvar)
+!	      ie = uvar_item_end(i,uvar)
+!	      IF ( uvar_text(uvar)(is:is) .EQ.'\''
+!	1	   .AND. uvar_text(uvar)(ie:ie).EQ.'\'') THEN
+!		 uvar_item_start(i,uvar) = is + 1
+!		 uvar_item_end  (i,uvar) = ie - 1
+!	      ENDIF
+!	   ENDIF
+! 310	CONTINUE
+
+* by default assume the definition requires an external data set specification
+	uvar_need_dset( uvar ) = .TRUE.
+
+* by default assume that all limits are irrelevant
+	DO 320 idim = 1, nferdims
+	   uvar_lo_ss ( uvar, idim )  = unspecified_int4
+	   uvar_hi_ss ( uvar, idim )  = unspecified_int4
+	   uvar_lo_ww ( idim, uvar )  = unspecified_val8
+	   uvar_hi_ww ( idim, uvar )  = unspecified_val8
+	   uvar_by_ss ( idim, uvar )  = .FALSE.             !for bookkeeping
+  	   uvar_given ( idim, uvar )  = uvlim_irrelevant
+ 320	CONTINUE
+
+* by default assume that there are no pseudo-variables involved
+	DO 330 idim = 1, nferdims
+ 330	uvar_mod_pseudo(idim,uvar) = .FALSE.
+
+* set grid to unknown (to be determined at "run time") for all data sets
+* and clear all references in memory to any associated dynamic grids
+	CALL DEALLO_UVAR_GRIDS( uvar )	
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5440	risc_buff = text(txstart:txend)
+	CALL ERRMSG( ferr_syntax, status,
+     .                  risc_buff(:TM_LENSTR1(risc_buff))
+     .                  //pCR//err_string, *5000 )
+* 12/97 *kob*
+ 5500   CALL ERRMSG( ferr_expr_too_complex, status,
+     .                  text(txstart:txend), *5000 )
+ 5600   slen = TM_LENSTR1(name)
+        WRITE (risc_buff,*) 'error initializing ', name(:slen)
+        slen = TM_LENSTR1(risc_buff)
+        CALL ERRMSG( ferr_syntax, status,
+     .               risc_buff(:slen), *5000 )
+
+	END
diff --git a/fer/rpn/not_rpn.F b/fer/rpn/not_rpn.F
new file mode 100644
index 0000000..6bc5cec
--- /dev/null
+++ b/fer/rpn/not_rpn.F
@@ -0,0 +1,129 @@
+	SUBROUTINE NOT_RPN (text,atom_type,atom_id,atom_start,atom_end,
+     .			    nexp,exp_start,exp_end,exp_at1,exp_atn,
+     .			    status,err_msg)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Scan an expression given in Reverse Polish order for illegal atom types
+* and break up the expression if there are commas
+* other error checking is done at run time
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 11/29/89
+* V500: 12/98 *sh* - update this neglected, untested routine to recognize
+*	alg_grid_chg_fcn, alg_child_var, and alg_const_var
+*        1/99 -- and alg_string
+* V554 1/04 *acm* - add counter variables for named REPEAT/RANGE control
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'rpn.parm'
+	include 'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER		atom_type(maxatoms),atom_id(maxatoms),
+     .			atom_start(maxatoms),atom_end(maxatoms),
+     .			exp_start(max_exp),exp_end(max_exp), nexp,
+     .			exp_at1  (max_exp),exp_atn(max_exp),status
+	CHARACTER*(*)	text,err_msg
+
+* internal variable declarations:
+	INTEGER		atom
+
+* initialize
+	atom = 0
+	nexp = 1
+	exp_start(1) = atom_start(1)
+	exp_at1(1)   = 1
+
+ 10	atom = atom + 1
+	IF ( atom_type(atom) .EQ. alg_finished ) THEN
+	   GOTO 500
+	ELSEIF ( atom_type(atom) .EQ. alg_log_struct.OR.
+     .           atom_type(atom) .EQ. alg_log_vstruct ) THEN
+	   GOTO 5100
+	ELSEIF ( atom_type(atom) .EQ. alg_punctuation ) THEN
+	   IF ( atom_id(atom) .EQ. comma ) THEN
+	      GOTO 100
+	   ELSE
+	      GOTO 5100
+	   ENDIF
+	ELSEIF ( atom_type(atom) .EQ. alg_constant
+     .	   .OR.  atom_type(atom) .EQ. alg_variable
+     .	   .OR.  atom_type(atom) .EQ. alg_pseudo_var
+     .	   .OR.  atom_type(atom) .EQ. alg_function
+     .	   .OR.  atom_type(atom) .EQ. alg_operator
+     .	   .OR.  atom_type(atom) .EQ. alg_grid_chg_fcn
+     .	   .OR.  atom_type(atom) .EQ. alg_child_var
+     .	   .OR.  atom_type(atom) .EQ. alg_string
+     .	   .OR.  atom_type(atom) .EQ. alg_const_var
+     .	   .OR.  atom_type(atom) .EQ. alg_counter_var ) THEN
+	   GOTO 10	
+	ENDIF
+	STOP 'NOT_RPN'
+
+* comma - end of current and beginning of new expression
+ 100	exp_end(nexp) = atom_end(atom-1)
+	exp_atn(nexp) = atom-1
+	nexp = nexp + 1
+	IF ( nexp .GT. max_exp ) GOTO 5200
+	exp_start(nexp) = atom_start(atom+1)	! ... limited error check
+	exp_at1  (nexp) = atom+1
+	GOTO 10
+
+* done
+ 500	exp_end(nexp) = atom_end(atom-1)
+	exp_atn(nexp) = atom-1
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	status = ferr_syntax
+	RETURN
+ 5100	err_msg = 'Illegal Reverse Polish item: '//
+     .		   text(atom_start(atom):atom_end(atom))
+	GOTO 5000
+ 5200	err_msg = ' '
+	GOTO 5000
+
+	END
diff --git a/fer/rpn/ok_juxtapo.F b/fer/rpn/ok_juxtapo.F
new file mode 100644
index 0000000..d8b6f5f
--- /dev/null
+++ b/fer/rpn/ok_juxtapo.F
@@ -0,0 +1,155 @@
+	LOGICAL FUNCTION OK_JUXTAPO (las_ptr,inf_ptr,atom_type,atom_id)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Determines whether juxtaposition of two atom types in the infix string
+*	is allowed in the syntax of things.
+
+*	J Davison TMAP/JISAO/PMEL/NOAA
+*	10.22.87
+* V200: 11/23/89 - replaced constants with parameter names and strings !!!
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line. used DATA rather than PARAMETER stmnt.
+* V450: 12/96 - add checks for grid changing functions and child variables
+* V500: 12/98 *sh*  added alg_const_var -- for fixed arrays such as "{1,3,5}"
+*	 1/99 - added alg_string   
+* V554 1/04 *acm* Add category alg_counter_var for counter variables; REPEAT/RANGE=/NAME=
+* V600 8/05 *acm* - Add variable type attrib_val for definitions of the form
+*                   varname.attname
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+
+	include		'ferret.parm'
+	include		'rpn.parm'
+	include		'xalgebra.cmn'
+
+	CHARACTER	punct*1
+	integer		las_ptr,inf_ptr,atom_type(*),atom_id(*)
+	integer		atom(2),ndx(2),i,val
+	integer		kar_matrix(8,8)
+	DATA	 	kar_matrix	/0,0,1,0,0,1,0,0,
+     .					1,1,0,1,1,0,1,0,
+     .					1,1,0,1,1,0,1,0,
+     .					0,0,1,0,0,1,0,0,
+     .					1,1,0,1,1,0,1,1,
+     .					0,0,1,0,0,1,0,0,
+     .					0,0,1,1,1,1,0,0,
+     .					1,1,0,1,1,0,1,0/
+
+*******************************************************************************
+
+	atom(1) = las_ptr
+	atom(2) = inf_ptr
+
+	do 100 i = 1,2
+
+*	   LEFT_PAREN PLACED ON LEFT END OF INFIX STRING
+	   if (atom(i) .eq. added_left_paren) then
+	      ndx(i) = 5
+	      goto 100
+	   end if
+
+*	   ALL OPERATORS EXCEPT NOT
+	   if (atom_type(atom(i)) .eq. alg_operator) then
+	      if (alg_op(atom_id(atom(i))) .ne. 'NOT' )then
+		 ndx(i) = 1
+	      else 
+	         ndx(i) = 2
+	      end if
+	      goto 100
+	   end if
+
+*	   CONSTANT, VARIABLE, PSEUDO-VARIABLE OR OPERAND
+	   if  (atom_type(atom(i)) .eq. alg_constant
+     .	   .or.	atom_type(atom(i)) .eq. alg_variable
+     .	   .or.	atom_type(atom(i)) .eq. alg_pseudo_var
+     .	   .or.	atom_type(atom(i)) .eq. alg_const_var
+     .	   .or.	atom_type(atom(i)) .eq. alg_string
+     .	   .or.	atom_type(atom(i)) .eq. alg_child_var
+     .	   .or. atom_type(atom(i)) .eq. alg_operand
+     .	   .or. atom_type(atom(i)) .eq. alg_counter_var
+     .	   .or. atom_type(atom(i)) .eq. alg_attrib_val ) then
+	      ndx(i) = 3
+	      goto 100
+	   end if
+
+*	   COMMA,LEFT OR RIGHT PARENTHESIS
+	   if (atom_type(atom(i)) .eq. alg_punctuation ) then
+	      punct = alg_punct( atom_id(atom(i)) )
+	      if ( punct .eq. ',' ) ndx(i) = 4
+	      if ( punct .eq. '(' ) ndx(i) = 5
+	      if ( punct .eq. ')' ) ndx(i) = 6
+	      goto 100
+	   end if
+
+*	   WHERE,THEN OR ELSE
+	   if (atom_type(atom(i)) .eq. alg_log_struct) then
+	      ndx(i) = 7
+	      goto 100
+	   end if
+
+*	   IFV,THEN OR ELSE
+	   if (atom_type(atom(i)) .eq. alg_log_vstruct) then
+	      ndx(i) = 7
+	      goto 100
+	   end if
+
+*	   FUNCTION
+	   if (atom_type(atom(i)) .eq. alg_function
+     .	  .OR. atom_type(atom(i)) .eq. alg_grid_chg_fcn) then
+	      ndx(i) = 8
+	      goto 100
+	   end if
+
+*	   ALG_FINISHED (INTERPRETED AS A RIGHT PARENTHESIS)
+	   if (atom_type(atom(i)) .eq. alg_finished) then
+	      ndx(i) = 6
+	      goto 100
+	   end if
+
+	   stop 'unknown atom type encountered in ok_juxtapo'
+100	continue
+
+	val = kar_matrix(ndx(1),ndx(2))	   
+
+	if (val .eq. 0) then
+	   ok_juxtapo = .false.
+	else
+	   ok_juxtapo = .true.
+	end if
+
+	return 
+	end
diff --git a/fer/rpn/prcd.F b/fer/rpn/prcd.F
new file mode 100644
index 0000000..2302055
--- /dev/null
+++ b/fer/rpn/prcd.F
@@ -0,0 +1,116 @@
+	INTEGER FUNCTION PRCD (ndx,ptr,atom_type,atom_id)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Function to determine precedence values of atoms in the infix
+*	string and the stack
+
+*	J Davison TMAP/JISAO/PMEL/NOAA
+*	10.22.87
+* V200: 11/23/89 - changed constants for parameter names !!!
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line. used DATA rather than PARAMETER stmnt.
+* V450: 12/96 - add check for grid changing functions
+* V500: 12/98 *sh* - add check for alg_const_var (like "{1,3,5}")
+*	 1/99 *sh* - add check for alg_string
+* v554:  1/04 *acm* - add check for alg_counter_var
+* V600 8/05 *acm* - Add variable type attrib_val 
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+
+	include		'ferret.parm'
+	include		'rpn.parm'
+
+	integer 	ndx,ptr,atom_type(*),atom_id(*)
+
+	integer		i
+	integer		lp_prc(2)
+	DATA 		lp_prc/23,0/
+	integer		op_prc(2,13)
+	DATA		op_prc/11,12,11,12,13,14,13,14,16,15,5,6,
+     .			3,4,9,10,9,10,9,10,9,10,9,10,7,8/
+	integer		punc_prc(2,3)
+	DATA		punc_prc/0,-999,23,0,0,-999/
+	integer		atom_prc(2,alg_log_vstruct)
+
+! V450: 12/96 - added initializations for alg_grid_chg_fcn and alg_child_var
+	DATA	(atom_prc(i,alg_operator),i=1,2)/-888,-888/,
+     .		(atom_prc(i,alg_constant),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_variable),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_punctuation),i=1,2)/-888,-888/,
+     .		(atom_prc(i,alg_function),i=1,2)/17,18/,
+     .		(atom_prc(i,alg_pseudo_var),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_log_struct),i=1,2)/1,2/,
+     .		(atom_prc(i,alg_operand),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_finished),i=1,2)/0,-999/,
+     .		(atom_prc(i,alg_grid_chg_fcn),i=1,2)/17,18/,
+     .		(atom_prc(i,alg_child_var),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_const_var),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_string),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_counter_var),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_attrib_val),i=1,2)/21,22/,
+     .		(atom_prc(i,alg_log_vstruct),i=1,2)/1,2/
+
+********************************************************************************
+
+*	IS THIS THE LEFT PARENTHESIS PUT ON STACK AT BEGINNING?
+	if (ptr .eq. added_left_paren) then
+	   prcd = lp_prc(ndx)
+	   return
+	end if
+
+*	IF AN OPERATOR, DETERMINE PRECEDENCE FROM OP_PRC
+	if (atom_type(ptr) .eq. alg_operator) then
+	   prcd = op_prc(ndx,atom_id(ptr))
+	   goto 100
+	end if
+
+*	IF A PUNCTUATION ATOM, FROM PUNC_PRC
+	if (atom_type(ptr) .eq. alg_punctuation) then
+	   prcd = punc_prc(ndx,atom_id(ptr))
+	   goto 100
+	end if
+
+*	OTHERWISE FROM ATOM_PRC
+	prcd = atom_prc(ndx,atom_type(ptr))
+
+*	CHECK FOR ERRORS
+100	if (prcd .eq. -888) stop 'precedence function is fatally flawed'
+	if (prcd .eq. -999) stop
+     .		'right paren, comma, or alg_finished on stack'
+	return
+
+	end
diff --git a/fer/rpn/rpn.F b/fer/rpn/rpn.F
new file mode 100644
index 0000000..76e5512
--- /dev/null
+++ b/fer/rpn/rpn.F
@@ -0,0 +1,355 @@
+	SUBROUTINE RPN ( text,
+     .			 at_typ_in,atom_id,atom_start,atom_end,
+     .			 natom_infx, natom_pstfx, pstfx_order,
+     .			 status,err_msg)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to take an infix expression in the character variable text and 
+*	convert to a postfix format.
+
+*	J Davison TMAP/JISAO/PMEL/NOAA
+*	10.20.87
+* V200: 11/20/89 - *sh* changed include directories
+*		- fixed bug in expr_start,expr_end to give pre-RPN string ends
+*		- added arguments exp_at1, exp_atn 1st and last atom per expr'n
+*		- eliminate nesting of WHERE-THEN-ELSE but allow W-T w/out ELSE
+*	 3/20/90 - beef up error message resulting from monadic "-"
+*	  5/3/90 - bug fix: exp_ndx max check
+* V450	   11/96 - major reorg - this routine now works on only a single
+*		   expression at a time and returns the permutation array
+*		 - Also, support for alg_grid_chg_fcn
+* Linux Port - kob- 4/97 - logic change in if statement to prevent an overflow
+*			   error when looking at atom_id array.
+* V532 5/01 *sh* - improve error message about unknon function in FCN(a)
+* V533 7/01 *sh* - insert alg_if_marker and alg_then_marker instead of no_op
+*		   to enable IF cond THEN string1 ELSE string2 
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'rpn.parm'
+	include 'xalgebra.cmn'
+
+	integer		at_typ_in(maxatoms),atom_id(maxatoms),
+     .			atom_start(maxatoms),atom_end(maxatoms),
+     .			natom_infx, natom_pstfx,
+     .			pstfx_order(maxatoms),
+     .			status
+
+	character*(*)	text,err_msg
+
+	integer		PRCD, GCF_NUM_ARGS, atom_type(maxatoms),
+     .			inf_ptr,pos_ndx,stk_ndx,stack(maxatoms),
+     .			fcn_ndx,i,arg_cnt(max_fcn),
+     .			atom_cnt,inf_prc,tmp_ptr,las_ptr,
+     .			ndx, narg,
+     .			wte_ndx,wte_cnt(max_wte+1)
+	
+	logical		OK_JUXTAPO
+
+********************************************************************************
+
+*	INITIALIZE ALL POINTERS AND INDICES
+	inf_ptr		= added_left_paren
+	pos_ndx 	= 0
+	stk_ndx		= 1
+	stack(stk_ndx)	= added_left_paren
+	
+	fcn_ndx		= 0
+	do 10 i = 1,max_fcn
+	   arg_cnt(i) 	= 1
+10	continue
+
+! 11/96 - obsolete lines dealing with multiple expressions
+!	exp_ndx		= 1
+!	exp_start(1)	= 1
+!	exp_at1(1)	= 1	! 1st atom of RPN
+!	exp_end(1)	= 0
+!	do 20 i = 2,max_exp
+!	   exp_end(i)   = 0
+!20	continue
+
+	wte_ndx 	= 1
+	do 25 i = 1,max_wte+1
+	   wte_cnt(i)   = 0
+25	continue
+
+*	TRANSFER THE ATOM TYPE LIST TO A WORKING ARRAY WITH TERMINATOR (11/96)
+	DO 30 ndx = 1, natom_infx
+ 30	atom_type(ndx) = at_typ_in(ndx)
+	atom_cnt = natom_infx + 1
+	atom_type(atom_cnt) = alg_finished	! terminator
+
+*	EXAMINE EACH ATOM IN INFIX STRING, PUT ON STACK OR IN POSTFIX STRING
+40	do 60 ndx = 1, atom_cnt
+	   las_ptr = inf_ptr
+	   inf_ptr = ndx
+
+	   if (.not. OK_JUXTAPO (las_ptr,inf_ptr,atom_type,atom_id)) goto 5200
+	   if (atom_type(inf_ptr) .eq. alg_grid_chg_fcn
+     .	  .OR. atom_type(inf_ptr) .eq. alg_function )
+     .						fcn_ndx = fcn_ndx + 1
+	
+	   if (atom_type(inf_ptr) .eq. alg_log_struct .OR.
+     .         atom_type(inf_ptr) .EQ. alg_log_vstruct ) then
+
+*	      KEEP TRACK OF WHERE-THEN-ELSE CLAUSE VALIDITY
+* ... when "WHERE" is encountered increase the nesting level, wte_ndx
+* *kob* - linux port 4/97 change logic from ( .NOT.(A .OR. B) to 
+*  	                  ( .NOT.A .AND. .NOT.B )
+	      if (atom_id(inf_ptr) .eq. where) then
+		 if (.not. (las_ptr  .eq. added_left_paren)) THEN
+	      	    if (.not. (atom_type(las_ptr) .eq. alg_punctuation
+     .		    .and.
+     .		    atom_id(las_ptr) .eq. left_paren)) goto 5100
+		    endif
+		 wte_ndx = wte_ndx + 1
+	         IF (wte_ndx .GT. 2 ) GOTO 5150
+	      end if
+
+* ... bump the WHERE-THEN-ELSE pointer, wte_cnt, is it the right logic item ?
+	      wte_cnt(wte_ndx) = wte_cnt(wte_ndx) + 1
+	      if (wte_cnt(wte_ndx) .ne. atom_id(inf_ptr)) 	     goto 5100
+
+* ... decrement the W-T-E nesting level when ELSE is encountered
+!	      if (wte_cnt(wte_ndx) .eq. else) then
+!	         wte_cnt(wte_ndx) = 0
+!	         wte_ndx          = wte_ndx - 1
+!	      	 if (wte_ndx .lt. 1) 				     goto 5100
+!	      end if
+	   end if
+
+	   inf_prc = PRCD (inf_flg,inf_ptr,atom_type,atom_id)
+50	   if (inf_prc .gt. PRCD (stk_flg,stack(stk_ndx),atom_type,atom_id))
+     .								          then
+*	      PUT THIS ATOM ONTO STACK AND CONTINUE 
+	      stk_ndx 	     = stk_ndx + 1
+	      stack(stk_ndx) = inf_ptr
+	   else
+*	      POP OFF THE TOP OF THE STACK AND LOOK AT IT
+	      tmp_ptr = stack(stk_ndx)
+	      stk_ndx = stk_ndx - 1
+	      if (stk_ndx .eq. 0) then
+	         if (.not.( (inf_ptr .eq. atom_cnt) .or. 
+     .		            (atom_type(inf_ptr) .eq. alg_punctuation .and. 
+     .		             atom_id  (inf_ptr) .eq. comma) ))       goto 5300
+	      end if
+
+*	      PLACE ATOM OF HIGHER PRECEDENCE IN POSTFIX STRING
+	      if (inf_prc .lt. PRCD (stk_flg,tmp_ptr,atom_type,atom_id))  then
+		 pos_ndx	 = pos_ndx + 1 
+		 pstfx_order(pos_ndx) = tmp_ptr
+
+*		 ENSURE FUNCTION HAS RIGHT # OF ARGUMENTS
+	         if (atom_type(tmp_ptr) .eq. alg_function) then
+*                   ==> standard internal Ferret function
+	            narg = alg_num_fcn_args(atom_id(tmp_ptr))
+		    if (arg_cnt(fcn_ndx) .ne. narg)  goto 5400
+		    arg_cnt(fcn_ndx) = 1
+		    fcn_ndx 	     = fcn_ndx - 1
+	         ELSEif (atom_type(tmp_ptr) .eq. alg_grid_chg_fcn) then
+*                   ==> grid changing Ferret function
+*		        variable arguments?
+	            narg = GCF_NUM_ARGS( atom_id(tmp_ptr) )
+	            if ( narg .GE. 0 ) THEN
+		       if (arg_cnt(fcn_ndx) .ne. narg)  goto 5400
+	            else
+		       if (arg_cnt(fcn_ndx) .LT. ABS(narg))  goto 5400
+	            ENDIF
+		    arg_cnt(fcn_ndx) = 1
+		    fcn_ndx 	     = fcn_ndx - 1
+	         end if
+
+! 11/96 - obsolete lines dealing with multiple expressions
+!		 if (exp_end(exp_ndx) .ne. 0) then
+!*		    LAST EXPRESSION IS COMPLETE AND NEW ONE IS BEING BUILT
+!		    exp_ndx	       = exp_ndx + 1
+!	            IF ( exp_ndx .GE. max_exp ) GOTO 5600	! fix *sh* 5/90
+!!		    exp_start(exp_ndx) = atom_start(pstfx_order(pos_ndx)) ! old
+!* ... exp_start for expr'n n is determined at the end of expr'n n-1
+!		    exp_at1  (exp_ndx) = pos_ndx	! 1st atom of RPN
+!		 end if
+		 goto 50
+	      else
+*	         PARENTHESIS MATCH OR LEFT PARENTHESIS AND A COMMA
+
+	         if (atom_type(inf_ptr) .eq. alg_punctuation .and.
+     .               atom_id  (inf_ptr) .eq. comma)			  then
+
+*	            RETURN LEFT PARENTHESIS TO STACK
+	            stk_ndx	   = stk_ndx + 1
+	            stack(stk_ndx) = tmp_ptr
+
+*	            COMMA INDICATES NEW FUNCTION ARGUMENT OR END OF EXPRESSION
+	            if (fcn_ndx .ne. 0) then
+		       arg_cnt(fcn_ndx) = arg_cnt(fcn_ndx) + 1
+	            else
+	               GOTO 5600
+! 11/96 - obsolete lines dealing with multiple expressions
+!!		       exp_end(exp_ndx) = atom_end(pstfx_order(pos_ndx)) ! old
+!		       exp_end(exp_ndx) = atom_end(las_ptr)
+!		       exp_atn(exp_ndx) = pos_ndx	! last atom of RPN
+!	               exp_start(exp_ndx+1) = atom_start(inf_ptr+1)
+	            end if
+	         end if 
+	      end if
+	   end if
+60	continue
+! 11/96 - obsolete lines dealing with multiple expressions
+!!	exp_end(exp_ndx) = atom_end(pstfx_order(pos_ndx))	! old
+!	exp_end(exp_ndx) = atom_end(atom_cnt-1)
+!	exp_atn(exp_ndx) = pos_ndx			! last atom of RPN
+
+	if (wte_ndx .gt. 1) then
+* ... "WHERE" is a no-op at RPN execution time
+	   DO 64 i = 1, atom_cnt
+ 64	   IF ( ((atom_type(i) .EQ. alg_log_struct) .OR. 
+     .           (atom_type(i) .EQ. alg_log_vstruct) )
+     .	  .AND. atom_id(i)   .EQ. where ) at_typ_in(i) = alg_then_marker
+	   IF (wte_cnt(2) .eq. where) THEN
+	      goto 5100
+	   ELSEIF ( wte_cnt(2) .EQ. pelse ) THEN
+* ... WHERE-THEN-ELSE --> THEN becomes a no-op
+	      DO 66 i = 1, atom_cnt
+ 66	      IF ( ((atom_type(i) .EQ. alg_log_struct) .OR. 
+     .              (atom_type(i) .EQ. alg_log_vstruct) )
+     .	     .AND. atom_id(i)   .EQ. pthen ) at_typ_in(i) = alg_if_marker
+	   ENDIF
+	end if
+
+	if (stk_ndx .eq. 0) then
+
+*	DONE - RETURN THE pstfx_order ARRAY
+	   natom_pstfx = pos_ndx
+	   status = ferr_ok
+	   return
+
+! 11/96 - obsolete lines dealing with reordering input arrays
+!*	   REARRANGE TEXT ACCORDING TO PSTFX_ORDER ARRAY POSTFIX ORDERING
+!	   do 70 i = 1,pos_ndx
+!	      tmp_atom_type(i) 	= atom_type(pstfx_order(i))
+!	      tmp_atom_id(i)   	= atom_id(pstfx_order(i))
+!	      tmp_atom_start(i)	= atom_start(pstfx_order(i))
+!	      tmp_atom_end(i)	= atom_end(pstfx_order(i))
+!70	   continue
+!
+!	   do 80 i = 1,pos_ndx
+!	      atom_type(i)	= tmp_atom_type(i)
+!	      atom_id(i)	= tmp_atom_id(i)
+!	      atom_start(i)	= tmp_atom_start(i)
+!	      atom_end(i)	= tmp_atom_end(i)
+!80	   continue
+!	   
+!	   i			= pos_ndx + 1
+!	   atom_type(i)		= atom_type(atom_cnt)
+!	   atom_id(i)		= atom_id(atom_cnt)
+!	   atom_start(i)	= atom_start(atom_cnt)
+!	   atom_end(i)		= atom_end(atom_cnt)
+
+	else
+	   goto 5500
+	end if
+
+** error exits
+ 5000	status = ferr_syntax
+	return
+
+*	WHERE-THEN-ELSE CLAUSE ORDER IS INCORRECT
+ 5100	err_msg = 'There is an error in if-then-else clause order'
+	GOTO 5000
+
+*	WHERE-THEN-ELSE CLAUSES ARE NESTED
+ 5150	err_msg = 'Cannot use multiple IFs in an expression'
+	GOTO 5000
+
+
+*	DISALLOWED JUXTAPOSITION OF ATOM TYPES AT LAS_PTR & INF_PTR
+ 5200	if (las_ptr .eq. added_left_paren) then
+     	   err_msg = text(atom_start(inf_ptr):atom_end(inf_ptr))//
+     .	   ' may not start an expression'  
+	else if (inf_ptr .eq. atom_cnt) then
+     	   err_msg = text(atom_start(las_ptr):atom_end(las_ptr))//
+     .	   ' may not end an expression'  
+	else if (atom_type(inf_ptr).eq.alg_punctuation
+     .     .and. atom_id  (inf_ptr).eq.left_paren       ) then
+     	   err_msg = 'unknown function "'//
+     .			text(atom_start(las_ptr):atom_end(las_ptr))//'"'
+	else
+	   err_msg = text(atom_start(las_ptr):atom_end(las_ptr))//' before '
+     .	   //text(atom_start(inf_ptr):atom_end(inf_ptr))//' is illegal'  
+	   IF (text(atom_start(inf_ptr):atom_end(inf_ptr)).EQ.'-' ) THEN
+	      i = (atom_end(las_ptr)-atom_start(las_ptr)+1)
+     .		+ (atom_end(inf_ptr)-atom_start(inf_ptr)+1) + 19
+	      IF ( inf_ptr+1 .EQ. atom_cnt ) THEN
+	         err_msg = err_msg(:i)//pCR//
+     .		'and "-" may not end expression'
+	      ELSEIF ( atom_type(inf_ptr+1) .EQ. alg_constant ) THEN
+	         err_msg = err_msg(:i)//pCR//
+     .		'negative constants need to be enclosed in parentheses'
+	      ELSE
+	         err_msg = err_msg(:i)//pCR//
+     .		'Monadic minus sign isnt allowed.  Use "(-1)*"'
+	      ENDIF
+	   ENDIF
+	end if
+	GOTO 5000
+
+*	MISMATCHED PARENTHESIS NEAR ATOM INF_PTR
+ 5300	err_msg = 'There is a mismatch of parentheses near '//
+     .	text(atom_start(las_ptr):atom_end(las_ptr))
+	GOTO 5000
+
+*       INCORRECT NUMBER OF ARGUMENTS IN FUNCTION TMP_PTR
+ 5400	err_msg = 'The '//text(atom_start(tmp_ptr):atom_end(tmp_ptr))//
+     .  ' function has an incorrect number of arguments'
+	GOTO 5000
+
+*	MISMATCHED PARENTHESIS NEAR ATOM STACK(STK_NDX)
+ 5500	if (stack(stk_ndx) .eq. added_left_paren) then
+	   err_msg = 'There is a mismatch of parentheses near '//
+     .     text(atom_start(stack(stk_ndx+1)):atom_end(stack(stk_ndx+1)))
+	else
+	   err_msg = 'There is a mismatch of parentheses near '//
+     .     text(atom_start(stack(stk_ndx)):atom_end(stack(stk_ndx)))
+	end if
+	GOTO 5000
+ 5600	err_msg = 'Definition contains multiple expressions'
+	GOTO 5000
+
+! 5600	write ( err_msg, 5610 ) max_exp
+! 5610	FORMAT ('Number of expressions in line must be less than',I4)
+!	GOTO 5000
+	end
diff --git a/fer/special/Makefile b/fer/special/Makefile
new file mode 100644
index 0000000..d65957f
--- /dev/null
+++ b/fer/special/Makefile
@@ -0,0 +1,32 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(OBJS)
+
+clean:
+	rm -f *.o
+
+#
+# End of Makefile
+#
diff --git a/fer/special/SOURCE_FILES b/fer/special/SOURCE_FILES
new file mode 100644
index 0000000..f6bad70
--- /dev/null
+++ b/fer/special/SOURCE_FILES
@@ -0,0 +1,10 @@
+SRCS_F = \
+fakes3.F\
+ferret_dispatch.F\
+ferret_query_f.F\
+gui_fakes.F\
+linux_routines.F\
+xmake_date_data.F\
+xrevision_type_data.F\
+xplatform_type_data.F
+
diff --git a/fer/special/aix_routines.F b/fer/special/aix_routines.F
new file mode 100644
index 0000000..f9a8059
--- /dev/null
+++ b/fer/special/aix_routines.F
@@ -0,0 +1,169 @@
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* AIX replacement routine for CALL DATE(str) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/27/94
+*
+* *kob* 5/26/95	added ifdef HP_ADDS for gerror and flush which hp had prob's
+*	        with
+
+	SUBROUTINE AIX_DATE(str)
+
+* calling argument declarations
+	CHARACTER*(*) str
+
+* local variable declarations
+	CHARACTER aix_d_t*26
+
+* call the AIX function
+	CALL FDATE_(aix_d_t)
+
+* dd-mmm-yy
+	str = aix_d_t(9:10)//'-'//aix_d_t(5:7)//'-'//aix_d_t(23:24)
+
+	RETURN
+	END
+
+***********************************************************************
+
+* AIX replacement routine for CALL TIME(str) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/27/94
+
+	SUBROUTINE AIX_TIME(str)
+
+* calling argument declarations
+	CHARACTER*(*) str
+
+* local variable declarations
+	CHARACTER aix_d_t*26
+
+* call the AIX function
+	CALL FDATE_(aix_d_t)
+
+	str = aix_d_t(12:19)
+
+	RETURN
+	END
+
+***********************************************************************
+
+* AIX replacement routine for CALL FLUSH(lunit) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/31/94
+*
+*	*kob* 6/15/95 - for hp port -- changed lunit to 0 for fflush call
+*
+	SUBROUTINE FLUSH(lunit)
+
+* calling argument declarations
+	INTEGER lunit
+
+#ifdef HP_ADDS
+	call fflush(0)
+#else
+* call the AIX function
+	CALL FLUSH_(lunit)
+#endif
+	RETURN
+	END
+
+
+***********************************************************************
+
+* AIX replacement routine for CALL GETLOG(name) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/31/94
+
+	SUBROUTINE GETLOG(name)
+
+* calling argument declarations
+	CHARACTER*(*) name        ! hope this is OK ??? CHAR*8 limit ?
+
+* call the AIX function
+	CALL GETLOG_(name)
+
+	RETURN
+	END
+
+***********************************************************************
+
+* AIX replacement routine for CALL FDATE(string) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/31/94
+
+	SUBROUTINE FDATE(string)
+
+* calling argument declarations
+	CHARACTER*(*) string
+
+* call the AIX function
+	CALL FDATE_(string)
+
+	RETURN
+	END
+
+#ifndef HP_ADDS
+***********************************************************************
+
+* AIX replacement routine for CALL GERROR(string) which
+* is missing in IBM's xlf libraries
+
+*	Steve Hankin 10/31/94
+
+* Note that this routine does NOT attempt to reproduce the correct
+*	behavior.  This is a matter of laziness because I could not think
+*	of an easy way to create a system error that would be detected
+*	at the TMAP library level from whence this routine is called
+
+	SUBROUTINE GERROR(string)
+
+* calling argument declarations
+	CHARACTER*(*) string
+
+* heres the cheap fix:
+	string = 'AIX sys err msg inaccessible to FERRET'
+	RETURN
+
+***********************************************************************
+
+	end
+#endif
diff --git a/fer/special/fake_ppl.F b/fer/special/fake_ppl.F
new file mode 100644
index 0000000..35c121d
--- /dev/null
+++ b/fer/special/fake_ppl.F
@@ -0,0 +1,44 @@
+	subroutine fakes_ppl
+        entry	xeq_plot
+        stop	'xeq_plot has been removed for debugging'
+        entry	xeq_ppl
+        stop	'xeq_ppl has been removed for debugging'
+        entry	xeq_contour
+        stop    'xeq_contour has been removed for debugging'
+        entry	xeq_vector
+        stop    'xeq_vector has been removed for debugging'
+        entry	xeq_shade
+        stop    'xeq_shade has been removed for debugging'
+        entry	xeq_wire
+        stop    'xeq_wire has been removed for debugging'
+        entry	set_window
+        stop    'set_window has been removed for debugging'
+        entry	set_viewport
+        stop    'set_viewport has been removed for debugging'
+        entry	cancel_window
+        stop    'cancel_window has been removed for debugging'
+        entry	start_pplus
+        stop    'start_pplus has been removed for debugging'
+        entry ck_gks_active
+        stop  'ck_gks_active has been removed for debugging'
+        entry viewport_number
+        stop  'viewport_number has been removed for debugging'
+        entry send_pltype
+        stop  'send_pltype has been removed for debugging'
+        entry gdsg
+        stop  'gdsg has been removed for debugging'
+        entry clsppl
+        stop  'clsppl has been removed for debugging'
+        entry disp_reset
+        stop  'disp_reset has been removed for debugging'
+        entry pplcmd
+        stop  'pplcmd has been removed for debugging'
+        entry gks_device_number
+        stop  'gks_device_number has been removed for debugging'
+        entry meta_device_number
+        stop  'meta_device_number has been removed for debugging'
+        entry compound_key
+        stop  'compound_key has been removed for debugging'
+        entry pos_lab
+        stop  'pos_lab has been removed for debugging'
+        end
diff --git a/fer/special/fake_tmio.F b/fer/special/fake_tmio.F
new file mode 100644
index 0000000..35a5a5e
--- /dev/null
+++ b/fer/special/fake_tmio.F
@@ -0,0 +1,60 @@
+	subroutine fakes_tmio( d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,
+     .                         d11,d12,d13,d14,d15,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* arguments
+	integer d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,
+     .                         d11,d12,d13,d14,d15,status
+
+**************
+        entry	TM_INIT_DSET ( d1, d2, status)
+        write (6,*)	'tm_init_dset has been removed for debugging'
+        status = 0
+        return
+**************
+        entry	TM_READ_GRIDFILE ( d1, status)
+        write (6,*)	'tm_read_gridfile has been removed for debugging'
+        status = 0
+        return
+**************
+	entry    TM_READ( d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,
+     .                         d11,d12,d13,d14,d15,status)
+        write (6,*)	'tm_read has been removed for debugging'
+        status = 0
+        return
+
+        end
diff --git a/fer/special/fakes3.F b/fer/special/fakes3.F
new file mode 100644
index 0000000..6fc5ec2
--- /dev/null
+++ b/fer/special/fakes3.F
@@ -0,0 +1,41 @@
+* V530 10/00 *sh* - added COMPLEX declarations to force link FORTRAN complex
+* variable code for use in external functions
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	subroutine fakes
+
+	include	'errmsg.parm'
+
+	INTEGER status
+	COMPLEX a
+
+        entry	odr_op
+        entry	odr_quit
+        entry	movie_close
+        entry	odr_init
+        entry	movie_open
+	CALL ERRMSG( ferr_not_implemented, status,
+     .				'Unix-based laser disk movies', *20 )
+ 20     write (0,*)  'Use the HDF-based on-screen animations'
+        write (0,*)  'or use the VMS version of FERRET'
+	a=CMPLX(0.,1.)
+	a=AIMAG(a) 
+	RETURN
+
+        entry	epic_list
+	CALL ERRMSG( ferr_not_implemented, status,
+     .				'EPIC output', *30 )
+ 30     write (0,*)  'EPIC format is not yet available under Unix'
+        write (0,*)  'Use the VMS version of FERRET if available'
+        RETURN
+
+	entry	 gks_open_ws
+	stop	'gks_open_ws not available'
+	entry	 is_autogrid
+	stop	'is_autogrid not available'
+	end
+
+
+
+
+
diff --git a/fer/special/ferret_dispatch.F b/fer/special/ferret_dispatch.F
new file mode 100644
index 0000000..6a03daf
--- /dev/null
+++ b/fer/special/ferret_dispatch.F
@@ -0,0 +1,361 @@
+	SUBROUTINE FERRET_DISPATCH( memory, command, rtn_flags, nflags,
+     .					rtn_chars, nchars, nerrlines )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Execute a FERRET command
+* WHILE MODE GUI is "CANCELLED" control will remain inside this routine
+* If "command" contains text that command will be executed immediately
+* (formatted as a c-style, null-terminated string)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+
+* FERRET program history:
+* initially tailored to output format and content of the Philander/Seigel 
+* model from GFDL
+* revision 0.0  - 4/3/86
+* revision 1.0 - 11/17/86 - first "official" release
+* revision 2.0 - 10/23/87 - "official" release
+* revision 2.01(temporary) - 10/23/87 - smaller memory size, bug fixes,
+*			2 typos in XVARIABLES_DATA, ^C added, ZT planes added
+* revision 2.02 - ?????
+* revision 2.10 - 5/6/88 - "final" release - /NODEBUG version
+* FERRET 1.00     - 6/10/88 - rename of GFDL 2.10
+* FERRET 1.10     -  8/2/88 - numerous bug fixes and enhancements
+* FERRET 1.20     - 2/17/89 - numerous bug fixes and enhancements
+* FERRET 1.21     - 4/19/89 - minor bug fixes
+* FERRET 2.00	  - 5/??/89 - internal re-write: 4D grids and "object oriented"
+*			      transformations
+* FERRET 3.00     - 1/29/93 - revision 2.2-->2.3 changes became so extensive
+*                             and prolonged it made sense to rename to V3.0
+* FERRET 3.10     - 4/94 - official release using XGKS
+* FERRET 3.11     - 5/94 - added FILE/ORDER=/FORMAT=STREAM
+* FERRET 3.12     - 5/94 - restructured to be "dynamic memory" (C main routine)
+*			   former MAIN became FERRET_DISPATCH routine
+
+* FERRET_DISPATCH routine history
+* as MAIN program unit:
+* revision 1.1 - 4/29/87 - added FRAME and REPEAT commands
+* revision 1.2 - 7/7/87  - added PLOT command for line plots
+* revision 1.3 - 9/9/87  - added LOAD command
+* revision 1.4 - 9/23/87  - added DEFINE command
+* revision 2.0 - 10/23/87 - changed DATA stmt rev. level to 2.00
+*			    and added EXTERNAL statement
+* revision 2.1 - 3/25/88 - added STATISTICS command
+* revision 2.2 - 4/20/88 - ADDED &UNITS AND &DSET_PARMS TO EXTERNALS 2.02-->2.10
+* revision 2.3 - 6/10/88 - renamed to Program FERRET
+* revision 2.4 -  8/2/88 - for FERRET 1.10 - added SHADE and SPAWN commands
+* revision 2.5 - 12/12/88- eliminated XGRID_DATA to new TMAP library
+* V200:  1/21/90 - added user-definable command USER
+*	  5/2/90 - added externals for BOX_BOUNDS and CK_GKS_ACTIVE which are
+*		   called from PLOT+ routines
+* Unix/RISC port:  pulled xrevision information fully into main program
+*        7/12/91 - added note not to distribute
+*       10/17/91 - added external for viewport sizing
+* V230:   6/8/92 - added WIRE command
+* V300      1/93 - new version (includes animations, etc.)
+*                  added xgt_grid_data - forced from xcalc_vars_data.F by
+*                  DEC f77 3.2
+*           6/93 - added QUERY command, and EXTERNAL XGUI_DATA
+* These changes happened concurrent to the restructure for V320:
+* V311: 5/17/94 added FILE/ORDER and FILE/FORMAT=STREAM
+* V312: 6/17/94 metafile bug fix in XGKS (hangs and crashes with color plots)
+
+* as FERRET_DISPATCH routine (formerly MAIN routine ferret.F):
+* V320: 5/19/94  (also removed xrevision.cmn DATA stmts to xrevision_data.F
+*		  for AIX compatibility)
+* 	2/28/95 - error message buffer for GUI moved to TMAP COMMON
+*		- send "synch" message to GUI if new window is created
+* V400: 3/20/95 - pass "memory" to get_command for preliminary pass in which
+*		  grave accent expressions are evaluated
+*	6/20/95 - send "synch" for window destruction, too
+* V411: 9/13/95 - Ultrix port:  CHAR(integer*1) is illegal although CHAR(byte)
+*		  is allowed ... go figger
+* V420: 4/23/96 - added new commands IF, ELSE, ELIF, ENDIF
+* Linux Port *kob* 1/97 - Added external for XWINDOW_STATE_DATA block data
+* V450: 7/7/97 - added external for XGRID_CHG_FCNS block data
+* V500: 2/99 *sh* - added POLYGON command
+* V530: 10/00 *sh* - added external declaration for new xez_info_data
+* V553:  9/03 *acm*- Loop 2 ran to 200; change to cmnd_buff_len 
+*                    (came up when implementing the -script command-line option)
+* V63  *acm* 10/09 Changes for gfortran build
+* V664 *kms* 8/10 Add second alternate return from XEQ_EXIT to exit the dispatch
+*                 loop but just re-enter the loop if not under pyferret
+*       *acm* 3/12 removing use USER command
+*V685 *acm* 11/13 Issue an ERROR not a NOTE if USER command is tried.
+
+	include 'tmap_dims.parm'
+	include 'xalt_messages.cmn_text'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gui.parm'
+	include 'command.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xgui.cmn'
+	include 'xplot_state.cmn'
+
+* EXTERNAL references to force the LINKER to look for BLOCK DATA SUBROUTINES
+	EXTERNAL
+     .		XALGEBRA_DATA,
+     .		XCOMMAND_DATA,
+     .		XCONTEXT_DATA,
+     .		XCONTROL_DATA,
+     .		XERRMSG_TEXT_DATA,
+     .		XGFDL_MASKS_DATA,
+     .		XONEDIM_DATA,
+     .		XPLOT_SETUP_DATA,
+     .		XPLOT_STATE_DATA,
+     .		XPROG_STATE_DATA,
+     .		XTEXT_INFO_DATA,
+     .		XVARIABLES_DATA,
+     .		XCALC_VARS_DATA,
+     .		XDSET_PARMS_DATA,
+     .		XFR_GRID_DATA,
+     .		XGKS_DEVICES_DATA,
+     .		XGUI_DATA,
+     .		XREVISION_DATA
+
+        EXTERNAL XGT_GRID_DATA      ! 2/93
+
+	EXTERNAL BOX_BOUNDS, CK_GKS_ACTIVE, GET_VIEW_SIZE,
+     .           FERRET_PLOT_COMPLETE
+
+* kob 1/97
+	EXTERNAL XWINDOW_STATE_DATA
+* sh 7/97
+	EXTERNAL XGRID_CHG_FCNS_DATA,
+     .		 XEZ_INFO_DATA
+
+* temporarily we simply declare the "memory" array right here
+* calling argument declarations
+	INTEGER nflags, nchars, rtn_flags(nflags), nerrlines
+	REAL memory(*)
+#ifdef NEED_BYTE
+        BYTE       command(*), rtn_chars(nchars)
+#else
+#   ifdef ultrix
+        BYTE       command(*), rtn_chars(nchars)	! 9/95 Ultrix, only
+#   else
+        INTEGER*1  command(*), rtn_chars(nchars)
+#   endif
+#endif
+
+* local variable declarations:
+	INTEGER	TM_LENSTR1,
+     .		cmnd_stack_level, reconfig, status, i, gui_action,
+     .		insert_pt
+
+* local parameter declarations
+	INTEGER		slash_msg_continue
+	PARAMETER     (	slash_msg_continue	  = 1)
+
+* transfer the c-style string into a FORTRAN string
+	cmnd_buff = ' '
+c	DO 2 i = 1, 200
+	DO 2 i = 1, cmnd_buff_len
+	   IF ( command(i) .EQ. 0 ) GOTO 5
+ 2	cmnd_buff(i:i) = CHAR( command(i) )
+
+ 5	CALL GET_FER_COMMAND( memory, cmnd_buff, status, *300 )
+
+	GOTO (	 10, 20, 30, 40, 50, 60, 70, 80, 90,100,
+     .		110,120,130,140,150,160,170,180,190,200,
+     .          210,220,230,240,250,260,270 ) cmnd_num
+
+ 10	CALL XEQ_SET( memory, reconfig )
+	IF ( reconfig .NE. 0 ) GOTO 400
+	GOTO 300
+ 20	CALL XEQ_SHOW( memory )
+	GOTO 300
+ 30	CALL XEQ_CANCEL( memory )
+	GOTO 300
+ 40	CALL XEQ_CONTOUR( memory )	! after rev 1.00 1/5/87
+	GOTO 300
+ 50	CALL XEQ_LIST( memory )
+	GOTO 300
+ 60	CALL XEQ_PLOT( memory )
+	GOTO 300
+ 70	CALL XEQ_GO
+	GOTO 300
+ 80	CALL XEQ_HELP
+	GOTO 300
+ 90	CALL XEQ_LOAD( memory )
+	GOTO 300
+ 100	CALL XEQ_DEFINE( memory )
+	GOTO 300
+ 110	CALL XEQ_EXIT( *500, *450 )
+	GOTO 300			! command file xit or error
+ 120	CALL XEQ_MESSAGE
+	GOTO 300
+ 130	CALL XEQ_VECTOR( memory )
+	GOTO 300
+ 140	CALL XEQ_PPLUS
+	GOTO 300
+ 150	CALL XEQ_FRAME( memory )
+	GOTO 300
+ 160	CALL XEQ_REPEAT
+	GOTO 300
+ 170	CALL XEQ_STAT( memory )
+	GOTO 300
+ 180	CALL XEQ_SHADE( memory )
+	GOTO 300
+ 190	CALL XEQ_SPAWN
+	GOTO 300
+ 200	CONTINUE! CALL XEQ_USER_COMMAND( memory )
+        CALL ERRMSG(ferr_syntax, status, 
+     .    'USER command not available in this Ferret version ', *300)
+ 210	CALL XEQ_WIRE( memory )
+	GOTO 300
+ 220	CALL XEQ_QUERY
+	GOTO 300
+ 230	CALL XEQ_IF
+	GOTO 300
+ 240	CALL XEQ_ELSE
+	GOTO 300
+ 250	CALL XEQ_ELIF
+	GOTO 300
+ 260	CALL XEQ_ENDIF
+	GOTO 300
+ 270	CALL XEQ_POLYGON( memory )
+	GOTO 300
+
+* finished a single command
+ 300	gui_action = factn_no_action	! default
+	IF (    (cmnd_num    .EQ. cmnd_set
+     .	   .AND. subcmnd_num .EQ. subcmnd_set_data)
+     . .OR.     (cmnd_num    .EQ. cmnd_cancel
+     .	   .AND. subcmnd_num .EQ. subcmnd_canc_data) ) THEN
+* ... need to synchronize data sets with GUI
+	   gui_action = factn_synch_set_data
+	ELSEIF ( cmnd_num    .EQ. cmnd_message
+     .	   .AND. qual_given(slash_msg_continue) .EQ. 0 ) THEN
+	   gui_action = factn_pause
+	ELSE
+* ... need to synchronize output window creation/destruction with GUI
+* ... creation may be from any (initial) plot command or from SET WINDOW
+	   DO 302 i = 1, max_windows
+	      IF ( wn_open(i) .NEQV. gui_window_reported(i) ) THEN
+	         gui_action = factn_synch_window
+	         rtn_flags(frtn_idata1)  = i
+	         IF (wn_open(i)) THEN 
+	            rtn_flags(frtn_idata2)  = 1   ! 1 means "creation"
+	            gui_window_reported(i) = .TRUE.
+	         ELSE
+	            rtn_flags(frtn_idata2)  = -1  ! -1 means "destruction"
+	            gui_window_reported(i) = .FALSE.
+	         ENDIF
+	      ENDIF	         
+ 302	   CONTINUE
+	ENDIF
+
+* ... prepare error buffer to pass back to calling (GUI?) program
+	IF ( mode_gui .AND. gui_status .NE. ferr_ok ) THEN
+	   gui_action = factn_display_error
+	   insert_pt = 1
+	   DO 310 i = 1, alt_nlines
+	      nerrlines = i
+	      CALL CSTRING_INSERT(alt_text(i), TM_LENSTR1(alt_text(i)),
+     .				  rtn_chars, nchars, insert_pt )
+	      IF ( insert_pt .GT. nchars ) GOTO 320
+ 310	   CONTINUE
+	ELSE
+	   nerrlines = 0
+	ENDIF
+ 320	alt_nlines = 0
+	CALL CLEANUP_LAST_CMND( cmnd_stack_level )
+	IF ( .NOT.mode_gui ) THEN
+           IF ( one_cmnd_mode .AND. (cmnd_stack_level .EQ. 0) ) THEN
+              GOTO 450
+           ENDIF
+	   GOTO 5
+	ELSEIF ( cmnd_stack_level .GT. 0 ) THEN
+	   rtn_flags(frtn_control) = fctrl_in_ferret  ! command not yet finished
+	   rtn_flags(frtn_status)  = gui_status
+	   rtn_flags(frtn_action)  = gui_action
+	   RETURN
+	ELSE
+	   rtn_flags(frtn_control) = fctrl_back_to_gui
+	   rtn_flags(frtn_status)  = gui_status
+	   rtn_flags(frtn_action)  = gui_action
+	   RETURN
+	ENDIF
+	   
+* reconfigure main memory
+ 400	rtn_flags(frtn_control) = fctrl_in_ferret
+	rtn_flags(frtn_status)  = gui_status
+	rtn_flags(frtn_action)  = factn_mem_reconfigure
+	rtn_flags(frtn_idata1)  = reconfig
+	rtn_flags(frtn_idata2)  = cmnd_stack_level
+	RETURN
+
+* exit the dispatch loop - if from pyferret, to return control to python
+*                          if from ferret_c, just re-enter the dispatch loop
+ 450    rtn_flags(frtn_control) = fctrl_in_ferret
+        rtn_flags(frtn_status) = gui_status
+        rtn_flags(frtn_action) = factn_no_action
+        RETURN
+
+* exit the program
+ 500	rtn_flags(frtn_control) = fctrl_back_to_gui
+	rtn_flags(frtn_status)  = gui_status
+	rtn_flags(frtn_action)  = factn_exit
+	RETURN
+
+	END
+
+*
+* Routine to set the one_cmnd_mode in FERRET_DISPATCH 
+* The following only applies if gui_mode is .FALSE.
+* If new_mode_int is zero, FERRET_DISPATCH will return only 
+*     on memory resizes and exit (original behavior)
+* If new_mode_int is non-zero, FERRET_DISPATCH will return 
+*     after each submitted command is complete
+*
+        SUBROUTINE SET_ONE_CMND_MODE(new_mode_int)
+
+	include 'tmap_dims.parm'
+        INCLUDE 'xprog_state.cmn'
+
+        INTEGER new_mode_int
+
+        one_cmnd_mode = (new_mode_int .NE. 0)
+        RETURN
+
+        END
+
diff --git a/fer/special/ferret_query_f.F b/fer/special/ferret_query_f.F
new file mode 100644
index 0000000..4d503bb
--- /dev/null
+++ b/fer/special/ferret_query_f.F
@@ -0,0 +1,535 @@
+    	SUBROUTINE FERRET_QUERY_F( query, flags, nflags, ctext, ntext,
+     .				   num_strings, num_vals, nums, nnums,
+     .				   arg1, arg2, arg3, arg4, arg5, qstatus )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* respond to the GUI query API call
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* for FERRET V400: 8/94
+*   3/15/95 - fixed error in "strides" for query GCOORDS
+* V402: "temporary ferret_query.inc" changed to ferret_cmn/ferret_query.parm
+* V420: bug fix: query would crash if grid was unknown
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*	    4/97 *kob* - added ifdef for MANDATORY_FORMAT_WIDTHS on internal
+*			 read because linux/nag f90 needed a format width.
+*           12/00*acm* - cleanup: TM_DATE_OK declared but never called
+* V533      8/01 *acm* - calendar axis additions: SECS_FROM_BC needs cal_id
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+        include 'tmap_dims.parm'
+#       include "tmap_dset.parm"
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'ferret_query.parm'
+	include 'xprog_state.cmn'
+	include 'xcommand.cmn'
+	include 'xtext_info.cmn'
+	include 'xcontext.cmn'
+	include 'xalgebra.cmn'
+	include 'xgui.cmn'
+	include 'xvariables.cmn' ! JC_ADDITION
+
+
+* calling argument declarations
+	INTEGER query, nflags, flags(nflags), num_strings, num_vals, ntext,
+     .		nnums, qstatus
+* ... c-type Hollerith string buffers
+#ifdef NEED_BYTE
+        BYTE      ctext(ntext), arg1(*), arg2(*), arg3(*), arg4(*), arg5(*)
+#else
+        INTEGER*1 ctext(ntext), arg1(*), arg2(*), arg3(*), arg4(*), arg5(*)
+#endif
+	REAL*8	nums(nnums)
+
+* local variable declarations:
+	LOGICAL GEOG_LABEL
+	INTEGER	TM_LENSTR1, FIND_DSET_NUMBER, IGRID, TM_GET_LINENUM,
+     .		TM_GET_GRIDNUM, TM_GET_CALENDAR_ID,
+     .		i, i2, n, dim, dset, cat, var, axis, grid,
+     .		slen, insert_pt, stride, status, cal_id,
+     .          j, num_indices
+	REAL*8	TWORLD, TM_WORLD, SECS_FROM_BC, lo, hi, delta
+	CHARACTER AX_TITLE*32, TM_FMT*16, buff1*32,
+     .		  farg1*80, farg2*80, farg3*80, farg4*80, farg5*80
+
+* local parameter declarations:
+	CHARACTER*4 notext
+	PARAMETER ( notext = '****')
+
+* legal query ?
+	IF ( query .GT. max_queries ) THEN
+	   qstatus = QSTAT_UNKNOWN_QUERY
+	   RETURN
+	ENDIF
+
+* initialize
+	qstatus = QSTAT_OK
+	insert_pt = 1
+	num_strings = 0
+	num_vals = 0
+	DO 10 i = 1, nflags
+ 10	flags(i) = 0
+	ctext(1) = 0
+
+* convert arguments to FORTRAN character arrays
+	CALL TM_CTOF_STRNG(arg1, farg1, 80) 
+	CALL TM_CTOF_STRNG(arg2, farg2, 80) 
+	CALL TM_CTOF_STRNG(arg3, farg3, 80) 
+	CALL TM_CTOF_STRNG(arg4, farg4, 80) 
+	CALL TM_CTOF_STRNG(arg5, farg5, 80) 
+
+* respond to the appropriate query
+	GOTO ( 100, 200, 300, 400, 500, 600, 700, 800, 900,1000,
+     .	      1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,
+     .	      2100,2200,2300,2400,2500,2600,2700,2800,2900,3000 ) query
+	
+* STATUS
+* error status of last command
+ 100	CONTINUE
+	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+* MESSAGE
+* messages from last command
+ 200	CONTINUE
+	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+* DSET
+* list of open data sets
+ 300	DO 310 i = 1,  maxdsets
+	   IF ( ds_name(i) .NE. char_init1024) THEN
+	      slen = TM_LENSTR1(ds_name(i))
+	      CALL CSTRING_INSERT( ds_name(i),
+     .				slen, ctext, ntext, insert_pt)
+	      IF ( insert_pt .GT. ntext ) THEN
+	         qstatus = QSTAT_BUFF_OVFLOW
+	         RETURN
+	      ENDIF
+	      num_strings = num_strings + 1
+	   ENDIF
+ 310	CONTINUE
+	RETURN
+
+* VARIABLE dset
+* return the variables in a data set
+* ... identify the data set
+ 400	dset = FIND_DSET_NUMBER(farg1)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	DO 410 var = 1, maxvars
+	   IF ( ds_var_setnum(var) .NE. dset ) GOTO 410
+	   IF ( ds_var_code(var) .EQ. '-' ) GOTO 410
+*	   slen = TM_LENSTR1(ds_var_code(var))
+           CALL string_array_get_strlen1(ds_var_code_head,
+     .                                    var,  slen)
+	   CALL CSTRING_INSERT( ds_var_code(var),
+     .				slen, ctext, ntext, insert_pt)
+	   IF ( insert_pt .GT. ntext ) THEN
+	      qstatus = QSTAT_BUFF_OVFLOW
+	      RETURN
+	   ENDIF
+	   num_strings = num_strings + 1
+ 410	CONTINUE
+	RETURN
+
+* GRID dset variable
+* 4-axis description of grid for given variable
+* ... identify the data set, then variable, then its grid
+ 500	dset = FIND_DSET_NUMBER(farg1)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	CALL FIND_VAR_NAME( dset, farg2, cat, var )
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	grid = IGRID ( dset, cat, var, status )
+	IF ( grid.EQ.unspecified_int4 .OR. status.NE.ferr_ok) THEN
+	   qstatus = -1 * status
+	   RETURN
+	ENDIF
+* ... first return the grid name
+	slen = TM_LENSTR1(grid_name(grid))
+	CALL CSTRING_INSERT( grid_name(grid),
+     .			     slen, ctext, ntext, insert_pt)
+* ... then the 4 axis names
+	DO 510 dim = 1, nferdims
+	   axis = grid_line( dim, grid )
+	   IF ( axis .EQ. munknown ) THEN
+	      CALL CSTRING_INSERT( 'UNKNOWN',
+     .				   7, ctext, ntext, insert_pt)
+	   ELSEIF( axis .EQ. mnormal ) THEN
+	      CALL CSTRING_INSERT( 'NORMAL',
+     .				   6, ctext, ntext, insert_pt)
+	   ELSE
+	      slen = TM_LENSTR1(line_name(axis))
+	      CALL CSTRING_INSERT( line_name(axis),
+     .				   slen, ctext, ntext, insert_pt)
+	   ENDIF
+	   IF ( insert_pt .GT. ntext ) THEN
+	      qstatus = QSTAT_BUFF_OVFLOW
+	      RETURN
+	   ENDIF
+ 510    CONTINUE
+* ... then the 4 axis orientation codes
+	DO 520 dim = 1, nferdims
+	   axis = grid_line( dim, grid )
+	   IF ( axis .EQ. munknown .OR. axis .EQ. mnormal ) THEN
+	      CALL CSTRING_INSERT( '**',
+     .				   2, ctext, ntext, insert_pt)
+	   ELSE
+	      CALL CSTRING_INSERT( line_direction(axis),
+     .				   2, ctext, ntext, insert_pt)
+	   ENDIF
+	   IF ( insert_pt .GT. ntext ) THEN
+	      qstatus = QSTAT_BUFF_OVFLOW
+	      RETURN
+	   ENDIF
+ 520    CONTINUE
+	num_strings = 9	! 1 + 4 + 4
+	RETURN
+
+* AXIS  (args?)
+ 600	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+* COORDS axis
+* coordinates of (irregular) axis
+ 700	CONTINUE
+
+* TRANS  *************
+* list of transforms
+ 800	CONTINUE
+	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+* TRNARG (trans) ****will not be used!!*************
+* argument description for given transform
+ 900	CONTINUE
+* LVARS  *************
+* list of LET-defined variables
+ 1000	CONTINUE
+
+* DVARS (dset) *************
+* list of LET-defined variables defined for data set
+* ... identify the data set
+*
+* first attempt at an upgrade by JC (3/1/96)
+*
+ 1100	dset = FIND_DSET_NUMBER(farg1)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+*	DO 1110 var = 1, max_uvar
+*           IF (uvar_num_items(var) .EQ. uvar_deleted  ) GOTO 1110
+        CALL deleted_list_get_undel(uvar_num_items_head,
+     .                              deleted_list_result(1),
+     .                              max_uvar, num_indices )
+        DO 1110 j = 1, num_indices
+           var = deleted_list_result(j)
+           IF (uvar_name_code(var)(1:3) .EQ. 'EX#'    ) GOTO 1110
+           IF ( dset .NE. uvar_dset(var)         ) GOTO 1110
+*           slen = TM_LENSTR1(uvar_name_code(var))
+           CALL string_array_get_strlen1(uvar_name_code_head, var, slen)
+	   CALL CSTRING_INSERT( uvar_name_code(var),
+     .				slen, ctext, ntext, insert_pt)
+
+	   IF ( insert_pt .GT. ntext ) THEN
+	      qstatus = QSTAT_BUFF_OVFLOW
+	      RETURN
+	   ENDIF
+	   num_strings = num_strings + 1
+ 1110	CONTINUE
+	RETURN
+
+* VBACKGROUND  (dset variable) *************
+* background info about this variable
+ 1200	CONTINUE
+* DBACKGROUND (dset) *************
+* background info about this data set
+ 1300	CONTINUE
+* WINDOWS  *************
+* list of open windows
+ 1400	CONTINUE
+* WCURRENT  *************
+* name of current window
+ 1500	CONTINUE
+* VPORTS  *************
+* list of defined viewports
+ 1600	CONTINUE
+* VCURRENT  *************o
+* name of current viewport
+ 1700	CONTINUE
+* VIEW  (vport) *************
+* definition of indicated viewport
+ 1800	CONTINUE
+	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+* DCURRENT
+* name of current data set
+ 1900	DO 1910 dset = 1, maxdsets
+           IF ( ds_name(dset) .EQ. char_init1024) GOTO 1910
+	   IF ( dset .EQ. cx_data_set(cx_last) ) THEN
+	      slen = TM_LENSTR1(ds_name(dset))
+	      CALL CSTRING_INSERT( ds_name(dset),
+     .				   slen, ctext, ntext, insert_pt)
+	      num_strings = 1
+	      RETURN
+	   ENDIF
+ 1910	CONTINUE
+* ... there is no current data set
+	CALL CSTRING_INSERT( '*', 1, ctext, ntext, insert_pt)
+	num_strings = 1
+	RETURN
+
+* SPAN  dset variable
+* grid name and axis limits for a variable
+ 2000	dset = FIND_DSET_NUMBER(farg1)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	CALL FIND_VAR_NAME( dset, farg2, cat, var )
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	grid = IGRID ( dset, cat, var, status )
+	IF ( status .NE. ferr_ok ) THEN
+	   qstatus = -1 * status
+	   RETURN
+	ENDIF
+* ... first return the grid name
+	slen = TM_LENSTR1(grid_name(grid))
+	CALL CSTRING_INSERT( grid_name(grid),
+     .			     slen, ctext, ntext, insert_pt)
+* ... then the 4 axis spans
+* ... loss,hiss,loww,hiww (all presented as floating point)
+	DO 2010 dim = 1, nferdims
+	   axis = grid_line( dim, grid )
+	   i = (dim-1) * 4
+	   IF ( axis .EQ. munknown
+     .	   .OR. axis .EQ. mnormal  ) THEN
+	      nums(i+1) = DBLE( unspecified_int4 ) 
+	      nums(i+2) = DBLE( unspecified_int4 ) 
+	      nums(i+3) = DBLE(bad_val4)
+	      nums(i+4) = DBLE(bad_val4)
+	   ELSE
+! 4/4/96 - return grid limits rather than span limits (which are meaningful
+!               only for file variables)
+              nums(i+1) = 1.0D0
+              nums(i+2) = DBLE(line_dim(axis))
+              nums(i+3) = TM_WORLD( 1,
+     .                              grid, dim, box_middle)
+              nums(i+4) = TM_WORLD( line_dim(axis),
+     .                              grid, dim, box_middle)
+	   ENDIF
+ 2010    CONTINUE
+	num_strings = 1
+	num_vals = 16
+	RETURN
+
+* GAXIS grid orientation(1-4)
+ 2100	grid = TM_GET_GRIDNUM( farg1 )
+	IF ( grid .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+* *kob* 4/97
+#ifdef MANDATORY_FORMAT_WIDTHS
+	READ( farg2,* ) dim
+#else
+	READ( farg2,'(I)' ) dim
+#endif
+	axis = grid_line(dim, grid)
+* ... first return the axis title (units are appended already ...)
+	IF ( axis .NE. mnormal ) THEN
+	   buff1 = AX_TITLE(dim, grid, slen)
+	ELSE
+	   buff1 = notext
+	   slen = 4
+	ENDIF
+	CALL CSTRING_INSERT( buff1,
+     .			     slen, ctext, ntext, insert_pt)
+* ... then the axis units
+	IF ( axis .NE. mnormal ) THEN
+	   buff1 = line_units(axis)
+	   slen = TM_LENSTR1(buff1)
+	ELSE
+	   buff1 = notext
+	   slen = 4
+	ENDIF
+	CALL CSTRING_INSERT( buff1,
+     .			     slen, ctext, ntext, insert_pt)
+* ... now return some flags:
+	IF ( line_modulo(axis) ) THEN		! modulo ?
+	   flags(1) = 1
+	ELSE
+	   flags(1) = 0
+	ENDIF
+	IF ( GEOG_LABEL( dim, grid ) ) THEN	! fancy labeling ?
+	   flags(2) = 1
+	ELSE
+	   flags(2) = 0
+	ENDIF
+	IF ( line_regular(axis) ) THEN		! regular spacing ?
+	   flags(3) = 1
+	ELSE
+	   flags(3) = 0
+	ENDIF
+	flags(4) = line_unit_code(axis)		! unit code
+* ... some low:high:delta information
+	nums(1) = DBLE( line_dim(axis) )
+	nums(2) = line_start(axis)
+	nums(3) = line_delta(axis)
+	num_strings = 2
+	num_vals = 3
+* ... and finially special stuff for calendar axis formatting
+	IF ( (dim.EQ.t_dim .OR. dim.EQ.f_dim) .AND. flags(2).EQ.1 ) THEN
+
+*  See if we can find out the calendar, if grid/axis is known
+	IF (grid .EQ. unspecified_int4  .AND.  
+     .	    axis .EQ. unspecified_int4)  THEN 
+	   cal_id = 1
+	ELSE
+	   IF (axis .EQ. unspecified_int4) axis = grid_line(dim, grid)
+	   cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+	ENDIF
+
+	   nums(4) = SECS_FROM_BC( line_t0(axis), cal_id, status )
+	   nums(5) = line_tunit(axis)
+	ENDIF
+	RETURN
+
+* GCOORDS grid orientation(1-4)   offset   stride
+* ... the variable num_valstoj will tell the number of values returned
+ 2200	grid = TM_GET_GRIDNUM( farg1 )
+	IF ( grid .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+* *kob* 4/97 include axis...line in below ifdef just for simplicity
+#ifdef MANDATORY_FORMAT_WIDTHS
+	READ( farg2,* ) dim
+	axis = grid_line(dim, grid)
+	READ( farg3,* ) i2       ! offset
+	READ( farg4,* ) stride
+#else
+	READ( farg2,'(I)' ) dim
+	axis = grid_line(dim, grid)
+	READ( farg3,'(I)' ) i2       ! offset
+	READ( farg4,'(I)' ) stride
+#endif
+	i2 = i2 + 1
+	num_strings = 0
+	DO 2210 i = 1, nnums
+	   IF ( i2 .GT. line_dim(axis) ) RETURN
+	   nums( i ) = TM_WORLD( i2, grid, dim, box_middle)
+	   num_vals = i
+	   i2 = i2 + stride
+ 2210	CONTINUE
+	RETURN
+
+* SSPOINT grid orientation delta_index index
+ 2300	CONTINUE
+
+* WWPOINT grid orientation delta_index coordinate
+ 2400	CONTINUE
+
+* UVAR_DEFINITION dset variable
+* text of the algebraic expression defining the variable
+ 2500	dset = FIND_DSET_NUMBER(farg1)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+	CALL FIND_VAR_NAME( dset, farg2, cat, var )
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   qstatus = QSTAT_INVALID_ARG
+	   RETURN
+	ENDIF
+
+* ... return the definition
+	slen = TM_LENSTR1(uvar_text(var))
+	CALL CSTRING_INSERT( uvar_text(var),
+     .			     slen, ctext, ntext, insert_pt)
+* ... the title
+	slen = TM_LENSTR1(uvar_title(var))
+	CALL CSTRING_INSERT( uvar_title(var),
+     .			     slen, ctext, ntext, insert_pt)
+* ... and the units
+	slen = TM_LENSTR1(uvar_units(var))
+	CALL CSTRING_INSERT( uvar_units(var),
+     .			     slen, ctext, ntext, insert_pt)
+	num_strings = 3
+	RETURN
+
+
+* ****  *************
+ 2600	CONTINUE
+* ****  *************
+ 2700	CONTINUE
+* ****  *************
+ 2800	CONTINUE
+* ****  *************
+ 2900	CONTINUE
+* ****  *************
+ 3000	CONTINUE
+	qstatus = QSTAT_UNKNOWN_QUERY
+	RETURN
+
+	END
diff --git a/fer/special/gui_fakes.F b/fer/special/gui_fakes.F
new file mode 100644
index 0000000..763e741
--- /dev/null
+++ b/fer/special/gui_fakes.F
@@ -0,0 +1,69 @@
+! gui_fakes
+! routines to make it possible to link FERRET without its GUI
+
+	SUBROUTINE FERRET_LIST_IN_WINDOW( fhol, ftxout_append )
+
+	include 'tmap_dims.parm'
+        include 'ferret.parm'
+        include 'xprog_state.cmn'
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* calling argument declarations:
+	INTEGER fhol, ftxout_append
+
+	WRITE (err_lun, *) 
+     .		'FERRET_LIST_IN_WINDOW called from non-GUI version'
+
+	RETURN
+	END
+
+****************************************************************
+
+	SUBROUTINE FERRET_WARN_IN_WINDOW( fhol, ftxout_append )
+
+	include 'tmap_dims.parm'
+        include 'ferret.parm'
+        include 'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER fhol, ftxout_append
+
+	WRITE (err_lun, *) 
+     .		'FERRET_WARN_IN_WINDOW called from non-GUI version'
+
+	RETURN
+	END
diff --git a/fer/special/linux_routines.F b/fer/special/linux_routines.F
new file mode 100644
index 0000000..1054e98
--- /dev/null
+++ b/fer/special/linux_routines.F
@@ -0,0 +1,98 @@
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Linux replacement for fdate/date routines.  
+*
+* kob 3.11.97
+
+	SUBROUTINE FDATE(date)
+
+	CHARACTER*(*) date
+
+	CHARACTER*9 linux_date
+	CHARACTER*2 month
+	character*3 mmm
+#ifndef solaris
+	CALL DATE_AND_TIME(linux_date)
+#endif
+	month = linux_date(5:6)
+	if (month .eq. '01') then
+		mmm = "Jan"
+	else if (month .eq. '02') then
+		mmm = "Feb"
+	else if (month .eq. '03') then
+		mmm = "Mar"
+	else if (month .eq. '04') then
+		mmm = "Apr"
+	else if (month .eq. '05') then
+		mmm = "May"
+	else if (month .eq. '06') then
+		mmm = "Jun"
+	else if (month .eq. '07') then
+		mmm = "Jul"
+	else if (month .eq. '08') then
+		mmm = "Aug"
+	else if (month .eq. '09') then
+		mmm = "Sep"
+	else if (month .eq. '10') then
+		mmm = "Oct"
+	else if (month .eq. '11') then
+		mmm = "Nov"
+	else if (month .eq. '12') then
+		mmm = "Dec"
+	endif
+
+	date = linux_date(7:8)//'-'//mmm//'-'//linux_date(3:4)
+
+	return
+	end
+
+************************TODAY'S TIME******************************
+
+	SUBROUTINE FTIME(time)
+
+	CHARACTER*(*) time
+
+	character*9 linux_date
+	character*10 linux_time
+
+#ifndef solaris	
+	call DATE_AND_TIME(linux_date, linux_time)
+#endif
+	time = linux_time(1:2)//':'//linux_time(3:4)//':'//linux_time(5:6)
+
+	return
+	end
+
diff --git a/fer/special/xmake_date_data.template b/fer/special/xmake_date_data.template
new file mode 100644
index 0000000..e95c11a
--- /dev/null
+++ b/fer/special/xmake_date_data.template
@@ -0,0 +1,13 @@
+	BLOCK DATA XMAKE_DATE_DATA
+
+* this BLOCK DATA is generated automatically by the FERRET make routine
+
+#ifdef unix
+	include 'xmake_date.cmn'
+#else
+	INCLUDE 'FERRET_CMN:XMAKE_DATE.CMN'
+#endif
+
+	DATA make_date/'xxxxxxxx'/
+
+	END
diff --git a/fer/special/xplatform_type_data.template b/fer/special/xplatform_type_data.template
new file mode 100644
index 0000000..277507b
--- /dev/null
+++ b/fer/special/xplatform_type_data.template
@@ -0,0 +1,14 @@
+	BLOCK DATA XPLATFORM_TYPE_DATA
+
+* this BLOCK DATA is generated automatically by the FERRET make routine
+* v5.33 *kob* new template to add platform information
+
+#ifdef unix
+	include 'xplatform_type.cmn'
+#else
+	INCLUDE 'FERRET_CMN:XPLATFORM_TYPE.CMN'
+#endif
+
+	DATA platform_type	/ 'mmmmmmmm' /
+
+	END
diff --git a/fer/special/xrevision_type_data.template b/fer/special/xrevision_type_data.template
new file mode 100644
index 0000000..6d27220
--- /dev/null
+++ b/fer/special/xrevision_type_data.template
@@ -0,0 +1,15 @@
+	BLOCK DATA XREVISION_TYPE_DATA
+
+* this BLOCK DATA is generated automatically by the FERRET make routine
+* V4.02 8/95 - added initialization of progname_mod and len_progname_mod
+*		which were formerly handled in XREVISION_DATA.F
+
+#ifdef unix
+	include 'xrevision_type.cmn'
+#else
+	INCLUDE 'FERRET_CMN:XREVISION_TYPE.CMN'
+#endif
+
+	DATA revision_type	/ 'mmmmmmmm' /
+
+	END
diff --git a/fer/stk/LIB_NAME b/fer/stk/LIB_NAME
new file mode 100644
index 0000000..9f6207c
--- /dev/null
+++ b/fer/stk/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libstk.a 
diff --git a/fer/stk/Makefile b/fer/stk/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/stk/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/stk/SOURCE_FILES b/fer/stk/SOURCE_FILES
new file mode 100644
index 0000000..ffeb4e0
--- /dev/null
+++ b/fer/stk/SOURCE_FILES
@@ -0,0 +1,81 @@
+SRCS_F = \
+aux_regrid_lims.F\
+aux_regrid_lims_1d.F\
+bad_edges.F\
+bad_edges_sub.F\
+bad_ptr_edges_sub.F\
+clean_stack.F\
+constant_context.F\
+const_var_context.F\
+crawl_dependencies.F\
+diagnostic_out.F\
+eval_context.F\
+eval_expr.F\
+exit_dependency_mode.F\
+explicit_uvar.F\
+gcf_arg_eval_order.F\
+get_axis_speed.F\
+get_cmnd_data.F\
+get_dependencies.F\
+get_prot_cmnd_data.F\
+get_uvar_grid.F\
+hunt.F\
+i1mach.F\
+init_dependencies.F\
+init_ftds_dset.F\
+init_random_seed.F\
+interp_context.F\
+interp_stack.F\
+is_aggregate_gather.F\
+is_aggregate_grid.F\
+is_algebra.F\
+is_auxvar_regrid.F\
+is_calc.F\
+is_attrib_val.F\
+is_constant.F\
+is_const_var.F\
+is_counter_var.F\
+is_dependencies.F\
+is_do_gc_fcn.F\
+is_do_op.F\
+is_gather.F\
+is_grid_mode.F\
+is_modulo.F\
+is_pseudo.F\
+is_pystat_var.F\
+is_read.F\
+is_read_remote.F\
+is_reconcile.F\
+is_regrid.F\
+is_reverse.F\
+is_string.F\
+is_strip.F\
+is_subspan_fill.F\
+is_sample.F\
+is_trans.F\
+is_uvar_grid.F\
+its_auto_curvi.F\
+known_grid.F\
+make_pseudo_var.F\
+non_array_subsc.F\
+offset_ss.F\
+operate.F\
+pass_ambig_lims.F\
+potent_size.F\
+push_interp_stack.F\
+randn.F\
+randn2.F\
+randu.F\
+rcvd_regrid.F\
+regrid_lims.F\
+rqst_regrid.F\
+setup_sample.F\
+stack_ptr_dn.F\
+stack_ptr_up.F\
+string_context.F\
+string_operate.F\
+string_concatenate.F\
+string_conditional.F\
+transfer_isp.F\
+unprotect_cmnd_data.F\
+xerror.F 
diff --git a/fer/stk/aux_regrid_lims.F b/fer/stk/aux_regrid_lims.F
new file mode 100644
index 0000000..5356716
--- /dev/null
+++ b/fer/stk/aux_regrid_lims.F
@@ -0,0 +1,81 @@
+	SUBROUTINE AUX_REGRID_LIMS( dst_cx, src_cx, axis_list, naxis,
+     .			aux1, mr1, cx1,
+     .			aux2, mr2, cx2,
+     .			aux3, mr3, cx3,
+     .			status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Given a context describing data to be regridded to a destination grid
+* create the description of the needed source data in the source context
+* Use the auxiliary variables to determine the index range of data needed
+* For example, if the regrid has requested depth from 0 to 100 and in the 
+* auxiliary variable containing depths all of the values LE 100
+* are in K=1:6 then we need only request source data over the range K=1:7 
+
+* When called the source context should be a copy of the destination context 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*V685 4/13 *sh*
+
+	IMPLICIT NONE
+	include	'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER	src_cx, axis, dst_cx, naxis, axis_list(*), status,
+     .		mr1, cx1, mr2, cx2, mr3, cx3 
+        REAL*8  aux1(*), aux2(*), aux3(*)
+
+
+* this is just a dispatch routine that fans out to routines
+* based upon the number of dimensions in the regridding
+
+	IF ( naxis .EQ. 1 ) THEN
+	   CALL AUX_REGRID_LIMS_1D( dst_cx, src_cx, axis_list, naxis,
+     .			            aux1, mr1, cx1, status )
+	   IF (status .NE. ferr_ok) GOTO 5000
+	ELSE
+* TEMPORARY: insert routine to get 2D curvilinear index bounds here 
+	   CALL ERRMSG(ferr_internal, status, 'aux_regrid_lims', *5000 )
+	ENDIF
+
+* success
+        status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/stk/aux_regrid_lims_1d.F b/fer/stk/aux_regrid_lims_1d.F
new file mode 100644
index 0000000..9340576
--- /dev/null
+++ b/fer/stk/aux_regrid_lims_1d.F
@@ -0,0 +1,259 @@
+	SUBROUTINE AUX_REGRID_LIMS_1D( dst_cx, src_cx, axis_list, naxis,
+     .			               aux1, mr1, cx1, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Given a context describing data to be regridded to a destination grid
+* create the description of the needed source data in the source context
+* Use the auxiliary variables to determine the index range of data needed
+* For example, if the regrid has requested depth from 0 to 100 and in the 
+* auxiliary variable containing depths all of the values LE 100
+* are in K=1:6 then we need only request source data over the range K=1:7 
+
+* When called the source context should be a copy of the destination context 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+*V690 3/13-1/14 *sh*
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	src_cx, axis, dst_cx, naxis, axis_list(naxis), status,
+     .		mr1, cx1, mr2, cx2, mr3, cx3 
+        REAL*8  aux1(m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,
+     .               m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+
+* internal variable declarations:
+	LOGICAL increasing, increasing_here, looking_for_first
+	INTEGER	KNOWN_GRID, 
+     .		idim, src_grid, i, j, k, l, m, n, trans,
+     .		kdstmin, kdstmax, kkmin, kkmax, klo, khi, kdel
+	REAL*8  TM_WORLD, axmax, axmin, v, v1, bad_aux
+
+* initialize
+	bad_aux = mr_bad_data( mr1 )
+
+* insert source grid (the defining grid for this variable)
+* TEMPORARY -- ?move this block of code to AUX_VAR_REGRID when 2D curv is added?
+	src_grid = KNOWN_GRID( cx_data_set(src_cx),
+     .			       cx_category(src_cx),
+     .			       cx_variable(src_cx)  )
+	cx_grid( src_cx ) = src_grid
+	cx_unstand_grid( src_cx ) = .FALSE.
+	is_phase( isp )   = prgrd_from_source
+	cx_naux( src_cx ) = 0
+        DO 100 idim = 1, nferdims
+           cx_aux_var  (idim, src_cx) = unspecified_int4
+           cx_aux_cat  (idim, src_cx) = unspecified_int4
+           cx_aux_stat (idim, src_cx) = paux_stat_na
+ 100    CONTINUE
+	trans = cx_regrid_trans(z_dim,src_cx)    !  TEMPORARY: z_dim HARD CODED!!!
+
+* increasing or decreasing? determine by finding and examining
+* the first two valid values encountered in any column of the indicated axis
+        DO 110 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+        DO 110 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+        DO 110 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+        DO 110 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+        DO 110 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	   looking_for_first = .TRUE.
+           DO 105 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	      v = aux1(i,j,k,l,m,n)
+	      IF (v .EQ. bad_aux) THEN
+	         GO TO 105
+	      ELSEIF (looking_for_first) THEN
+	         v1 = v
+	         looking_for_first = .FALSE.
+	      ELSE
+	         increasing = v .GT. v1
+	         GOTO 112
+	      ENDIF
+ 105	   CONTINUE
+ 110	CONTINUE
+* ... no line of this data had 2 valid values!  But continue anyway
+
+* make sure that the auxiliary variable is monotonic
+* note:  missing values in the array are allowed, but only at the edges
+*        If a missing value is encountered in the body of the auxiliary var
+*        regridding will not proceed beyong that subscript in the regrid line
+ 112	DO 120 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+        DO 120 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+        DO 120 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+        DO 120 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+        DO 120 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+	   looking_for_first = .TRUE.
+           DO 115 k = cx_lo_s3(cx1), cx_hi_s3(cx1)
+	      v = aux1(i,j,k,l,m,n)
+	      IF (v .EQ. bad_aux) THEN
+	         IF (looking_for_first) GOTO 115
+	      ELSEIF (looking_for_first) THEN
+	         v1 = v
+	         looking_for_first = .FALSE.
+	      ELSE
+	         increasing_here = v .GT. v1
+	         IF (increasing .NEQV. increasing_here) GOTO 5100  ! not monot.
+	         v1 = v
+	      ENDIF
+ 115	   CONTINUE
+ 120	CONTINUE
+
+
+***** determine the minimal index limits needed to do the regrid *****
+* SINGLE AXIS CODE ONLY (GET_CONTEXT_MODS setup to dis-allow multiple args for now)
+* ... what are the desired world coordinate limts?
+ 130	idim    = axis_list(1)	! since this is 1D regridding
+	kdstmin = cx_lo_ss ( dst_cx, idim )
+	kdstmax = cx_hi_ss ( dst_cx, idim )
+	IF (trans .EQ. pauxrgrd_linear 
+     . .OR. trans .EQ. unspecified_int4  ) THEN
+* ... linear interp requires source data below/above target grid point coordinate
+* ... trans.EQ.unspec is for 3-argument plotting
+	   axmin   = TM_WORLD(kdstmin, cx_grid(dst_cx), idim, box_middle)
+	   axmax   = TM_WORLD(kdstmax, cx_grid(dst_cx), idim, box_middle)
+	ELSEIF (trans .EQ. pauxrgrd_pwlave ) THEN
+* ... averaging over cell requires source data over entire cell (larger region)
+	   axmin   = TM_WORLD(kdstmin, cx_grid(dst_cx), idim, box_lo_lim)
+	   axmax   = TM_WORLD(kdstmax, cx_grid(dst_cx), idim, box_hi_lim)
+	ELSE
+	   CALL ERRMSG( ferr_internal, status, 'unkwn rgrd trans', *5000)
+	ENDIF
+* when searching for the lo/hi index limts of the source data needed
+* reverse the direction of traversing the array for decreasing-ordered data
+* for a decreasing aux array min>max, lo>hi at this stage
+	IF (increasing) THEN
+	   klo   = cx_lo_s3(cx1)
+	   khi   = cx_hi_s3(cx1)
+	   kdel  = 1
+	ELSE
+	   khi  = cx_lo_s3(cx1)
+	   klo  = cx_hi_s3(cx1)
+	   kdel = -1
+	ENDIF
+	kkmin = khi
+	kkmax = klo 
+
+* find the smallest index range in the aux array that contains all of the aux
+* values lying within the axmin to axmax value range on the destination axis 
+* ==> CODE ONLY WORKS FOR Z AXIS               AT THIS STAGE !!!
+
+        DO 290 n = cx_lo_s6(cx1), cx_hi_s6(cx1)
+        DO 290 m = cx_lo_s5(cx1), cx_hi_s5(cx1)
+        DO 290 l = cx_lo_s4(cx1), cx_hi_s4(cx1)
+        DO 290 j = cx_lo_s2(cx1), cx_hi_s2(cx1)
+        DO 290 i = cx_lo_s1(cx1), cx_hi_s1(cx1)
+
+* ... search from low values to high for the upper index limit 
+           DO 210 k = klo, khi, kdel
+	      v = aux1(i,j,k,l,m,n)
+	      IF ( v .EQ. bad_aux ) THEN
+	         GOTO 210
+	      ELSEIF (v .LT. axmax) THEN
+	         IF ( increasing ) THEN
+	            IF (kkmax .LT. k) kkmax = k
+	         ELSE
+	            IF (kkmax .GT. k) kkmax = k
+	         ENDIF
+	      ELSE
+	         GOTO 220
+	      ENDIF
+ 210       CONTINUE
+
+* ... search from high values to low for the lower index limit 
+ 220	   DO 230 k = khi, klo, -1*kdel
+	      v = aux1(i,j,k,l,m,n)
+	      IF ( v .EQ. bad_aux ) THEN
+	         GOTO 230
+	      ELSEIF (v .GT. axmin) THEN
+	         IF (increasing) THEN
+	            IF (kkmin .GT. k) kkmin = k
+	         ELSE
+	            IF (kkmin .LT. k) kkmin = k
+	         ENDIF
+	      ELSE
+	         GOTO 290
+	      ENDIF
+ 230	   CONTINUE
+
+ 290    CONTINUE
+
+* for decreasing-ordered aux array swap the lo/hi limits just found
+	IF (.NOT.increasing) THEN
+	   k     = kkmin
+	   kkmin = kkmax
+	   kkmax = k
+	ENDIF
+
+* round out, so that regridding interpolations will be possible at the edges
+* (the value tests above were based on strict inequality so we always do this) 
+	IF (kkmin .GT. cx_lo_ss(cx1,idim) ) kkmin = kkmin - 1
+	IF (kkmax .LT. cx_hi_ss(cx1,idim) ) kkmax = kkmax + 1
+
+        cx_lo_ss ( src_cx, idim )  = kkmin
+        cx_hi_ss ( src_cx, idim )  = kkmax
+        cx_by_ss ( idim, src_cx )  = .TRUE.
+
+        cx_lo_ww ( idim, src_cx )  = unspecified_val8
+        cx_hi_ww ( idim, src_cx )  = unspecified_val8
+        cx_delta ( idim, src_cx )  = unspecified_val8
+        cx_trans ( idim, src_cx )  = trans_no_transform
+        cx_trans_arg(idim,src_cx)  = bad_val4
+        cx_given( idim, src_cx )  = .FALSE.
+        cx_regrid_trans(idim,src_cx) = unspecified_int4 
+        cx_formatted( idim )   = .FALSE.
+
+	CALL FLESH_OUT_AXIS( idim, src_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* success
+        status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100   CALL ERRMSG( ferr_invalid_command, status,
+     .		'auxiliary regridding coordinates are not monotonic', *5000)
+ 5200   CALL ERRMSG( ferr_invalid_command, status,
+     .		'auxiliary regridding coordinate field includes '//
+     .		'missing value(s)', *5000)
+	END
diff --git a/fer/stk/bad_edges.F b/fer/stk/bad_edges.F
new file mode 100644
index 0000000..6d53aa5
--- /dev/null
+++ b/fer/stk/bad_edges.F
@@ -0,0 +1,80 @@
+	SUBROUTINE BAD_EDGES( cx, x, mx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* context cx contains the limits of the valid data within array X
+* fill the edges of array X with bad-data flags
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   8/3/89
+*	10/16/89 - modified array declarations via call to *_SUB
+* V533: *sh* 6/01 - added string support
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER cx, mx
+	REAL    x( * )
+
+* --- end of introductory code ---
+
+	IF (mr_type(mx) .EQ. ptype_string) THEN
+	   CALL BAD_PTR_EDGES_SUB( cx, x,
+     .			    mr_lo_s1(mx), mr_hi_s1(mx),
+     .			    mr_lo_s2(mx), mr_hi_s2(mx),
+     .			    mr_lo_s3(mx), mr_hi_s3(mx),
+     .			    mr_lo_s4(mx), mr_hi_s4(mx),
+     .			    mr_lo_s5(mx), mr_hi_s5(mx),
+     .			    mr_lo_s6(mx), mr_hi_s6(mx) )
+	ELSE
+	   CALL BAD_EDGES_SUB( cx, x,
+     .			    mr_lo_s1(mx), mr_hi_s1(mx),
+     .			    mr_lo_s2(mx), mr_hi_s2(mx),
+     .			    mr_lo_s3(mx), mr_hi_s3(mx),
+     .			    mr_lo_s4(mx), mr_hi_s4(mx),
+     .			    mr_lo_s5(mx), mr_hi_s5(mx),
+     .			    mr_lo_s6(mx), mr_hi_s6(mx),
+     .			    mr_bad_data(mx) )
+	ENDIF
+
+	RETURN
+	END 
+
diff --git a/fer/stk/bad_edges_sub.F b/fer/stk/bad_edges_sub.F
new file mode 100644
index 0000000..9fccf7a
--- /dev/null
+++ b/fer/stk/bad_edges_sub.F
@@ -0,0 +1,200 @@
+	SUBROUTINE BAD_EDGES_SUB( cx,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif, bad_src )
+
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* context cx contains the limits of the valid data within array X
+* fill the edges of array X with bad-data flags
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/16/89 - from BAD_EDGES
+* V300:  3/16/93 - allow for possibility of entire region invalid
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER cx, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif )
+	REAL	bad_src
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, i_lo, j_lo, k_lo, l_lo, 
+     .		m_lo, n_lo, i_hi, j_hi, k_hi, l_hi, m_hi, n_hi
+
+* --- end of introductory code ---
+
+* valid limits
+	i_lo = cx_lo_s1(cx)
+	j_lo = cx_lo_s2(cx)
+	k_lo = cx_lo_s3(cx)
+	l_lo = cx_lo_s4(cx)
+	m_lo = cx_lo_s5(cx)
+	n_lo = cx_lo_s6(cx)
+	i_hi = cx_hi_s1(cx)
+	j_hi = cx_hi_s2(cx)
+	k_hi = cx_hi_s3(cx)
+	l_hi = cx_hi_s4(cx)
+	m_hi = cx_hi_s5(cx)
+	n_hi = cx_hi_s6(cx)
+
+* 3/93
+* if a low valid limit exceeds a high limit then there must be no valid region
+        IF ( i_lo .GT. i_hi
+     .  .OR. j_lo .GT. j_hi
+     .  .OR. k_lo .GT. k_hi
+     .  .OR. l_lo .GT. l_hi
+     .  .OR. m_lo .GT. m_hi
+     .  .OR. n_lo .GT. n_hi ) THEN
+* fill entire result with bad flags
+	   DO 10 i = slox, shix
+	   DO 10 j = sloy, shiy
+	   DO 10 k = sloz, shiz
+	   DO 10 l = slot, shit
+	   DO 10 m = sloe, shie
+	   DO 10 n = slof, shif
+ 10	   src(i,j,k,l,m,n) = bad_src
+           RETURN
+        ENDIF
+
+* fill in along X axis
+	DO 100 i = slox, i_lo-1
+	DO 100 j = j_lo, j_hi
+	DO 100 k = k_lo, k_hi
+	DO 100 l = l_lo, l_hi
+	DO 100 m = m_lo, m_hi
+	DO 100 n = n_lo, n_hi
+ 100	src(i,j,k,l,m,n) = bad_src
+	DO 110 i = i_hi+1, shix
+	DO 110 j = j_lo, j_hi
+	DO 110 k = k_lo, k_hi
+	DO 110 l = l_lo, l_hi
+	DO 110 m = m_lo, m_hi
+	DO 110 n = n_lo, n_hi
+ 110	src(i,j,k,l,m,n) = bad_src
+
+* fill in along Y axis
+	DO 200 j = sloy, j_lo-1
+	DO 200 i = i_lo, i_hi
+	DO 200 k = k_lo, k_hi
+	DO 200 l = l_lo, l_hi
+	DO 200 m = m_lo, m_hi
+	DO 200 n = n_lo, n_hi
+ 200	src(i,j,k,l,m,n) = bad_src
+	DO 210 j = j_hi+1, shiy
+	DO 210 i = i_lo, i_hi
+	DO 210 k = k_lo, k_hi
+	DO 210 l = l_lo, l_hi
+	DO 210 m = m_lo, m_hi
+	DO 210 n = n_lo, n_hi
+ 210	src(i,j,k,l,m,n) = bad_src
+
+* fill in along Z axis
+	DO 300 k = sloz, k_lo-1
+	DO 300 i = i_lo, i_hi
+	DO 300 j = j_lo, j_hi
+	DO 300 l = l_lo, l_hi
+	DO 300 m = m_lo, m_hi
+	DO 300 n = n_lo, n_hi
+ 300	src(i,j,k,l,m,n) = bad_src
+	DO 310 k = k_hi+1, shiz
+	DO 310 i = i_lo, i_hi
+	DO 310 j = j_lo, j_hi
+	DO 310 l = l_lo, l_hi
+	DO 310 m = m_lo, m_hi
+	DO 310 n = n_lo, n_hi
+ 310	src(i,j,k,l,m,n) = bad_src
+
+* fill in along T axis
+	DO 400 l = slot, l_lo-1
+	DO 400 i = i_lo, i_hi
+	DO 400 j = j_lo, j_hi
+	DO 400 k = k_lo, k_hi
+	DO 400 m = m_lo, m_hi
+	DO 400 n = n_lo, n_hi
+ 400	src(i,j,k,l,m,n) = bad_src
+	DO 410 l = l_hi+1, shit
+	DO 410 i = i_lo, i_hi
+	DO 410 j = j_lo, j_hi
+	DO 410 k = k_lo, k_hi
+	DO 410 m = m_lo, m_hi
+	DO 410 n = n_lo, n_hi
+ 410	src(i,j,k,l,m,n) = bad_src
+
+* fill in along E axis
+	DO 500 m = sloe, m_lo-1
+	DO 500 i = i_lo, i_hi
+	DO 500 j = j_lo, j_hi
+	DO 500 l = l_lo, l_hi
+	DO 500 k = k_lo, k_hi
+	DO 500 n = n_lo, n_hi
+ 500	src(i,j,k,l,m,n) = bad_src
+	DO 510 m = m_hi+1, shie
+	DO 510 i = i_lo, i_hi
+	DO 510 j = j_lo, j_hi
+	DO 510 k = k_lo, k_hi
+	DO 510 l = l_lo, l_hi
+	DO 510 n = n_lo, n_hi
+ 510	src(i,j,k,l,m,n) = bad_src
+
+* fill in along F axis
+	DO 600 n = slof, n_lo-1
+	DO 600 i = i_lo, i_hi
+	DO 600 j = j_lo, j_hi
+	DO 600 k = k_lo, k_hi
+	DO 600 l = l_lo, l_hi
+	DO 600 m = m_lo, m_hi
+ 600	src(i,j,k,l,m,n) = bad_src
+	DO 610 n = n_hi+1, shif
+	DO 610 i = i_lo, i_hi
+	DO 610 j = j_lo, j_hi
+	DO 610 k = k_lo, k_hi
+	DO 610 l = l_lo, l_hi
+	DO 610 m = m_lo, m_hi
+ 610	src(i,j,k,l,m,n) = bad_src
+
+	RETURN
+	END 
diff --git a/fer/stk/bad_ptr_edges_sub.F b/fer/stk/bad_ptr_edges_sub.F
new file mode 100644
index 0000000..e2c6289
--- /dev/null
+++ b/fer/stk/bad_ptr_edges_sub.F
@@ -0,0 +1,197 @@
+	SUBROUTINE BAD_PTR_EDGES_SUB( cx,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, slot, shit, sloe, shie, slof, shif )
+
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* context cx contains the limits of the valid data within array X
+* fill the edges of array X with bad-data flags
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V533: 6/01 - like BAD_EDGES_SUB but initialize null pointers
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER cx, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, i_lo, j_lo, k_lo, l_lo, 
+     .		m_lo, n_lo, i_hi, j_hi, k_hi, l_hi, m_hi, n_hi
+
+* --- end of introductory code ---
+
+* valid limits
+	i_lo = cx_lo_s1(cx)
+	j_lo = cx_lo_s2(cx)
+	k_lo = cx_lo_s3(cx)
+	l_lo = cx_lo_s4(cx)
+	m_lo = cx_lo_s5(cx)
+	n_lo = cx_lo_s6(cx)
+	i_hi = cx_hi_s1(cx)
+	j_hi = cx_hi_s2(cx)
+	k_hi = cx_hi_s3(cx)
+	l_hi = cx_hi_s4(cx)
+	m_hi = cx_hi_s5(cx)
+	n_hi = cx_hi_s6(cx)
+
+* 3/93
+* if a low valid limit exceeds a high limit then there must be no valid region
+        IF ( i_lo .GT. i_hi
+     .  .OR. j_lo .GT. j_hi
+     .  .OR. k_lo .GT. k_hi
+     .  .OR. l_lo .GT. l_hi
+     .  .OR. m_lo .GT. m_hi
+     .  .OR. n_lo .GT. n_hi ) THEN
+* fill entire result with bad flags
+	   DO 10 i = slox, shix
+	   DO 10 j = sloy, shiy
+	   DO 10 k = sloz, shiz
+	   DO 10 l = slot, shit
+	   DO 10 m = sloe, shie
+	   DO 10 n = slof, shif
+ 10	   CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+           RETURN
+        ENDIF
+
+* fill in along X axis
+	DO 100 i = slox, i_lo-1
+	DO 100 j = j_lo, j_hi
+	DO 100 k = k_lo, k_hi
+	DO 100 l = l_lo, l_hi
+	DO 100 m = m_lo, m_hi
+	DO 100 n = n_lo, n_hi
+ 100	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 110 i = i_hi+1, shix
+	DO 110 j = j_lo, j_hi
+	DO 110 k = k_lo, k_hi
+	DO 110 l = l_lo, l_hi
+	DO 110 m = m_lo, m_hi
+	DO 110 n = n_lo, n_hi
+ 110	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+* fill in along Y axis
+	DO 200 j = sloy, j_lo-1
+	DO 200 i = i_lo, i_hi
+	DO 200 k = k_lo, k_hi
+	DO 200 l = l_lo, l_hi
+	DO 200 m = m_lo, m_hi
+	DO 200 n = n_lo, n_hi
+ 200	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 210 j = j_hi+1, shiy
+	DO 210 i = i_lo, i_hi
+	DO 210 k = k_lo, k_hi
+	DO 210 l = l_lo, l_hi
+	DO 210 m = m_lo, m_hi
+	DO 210 n = n_lo, n_hi
+ 210	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+* fill in along Z axis
+	DO 300 k = sloz, k_lo-1
+	DO 300 i = i_lo, i_hi
+	DO 300 j = j_lo, j_hi
+	DO 300 l = l_lo, l_hi
+	DO 300 m = m_lo, m_hi
+	DO 300 n = n_lo, n_hi
+ 300	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 310 k = k_hi+1, shiz
+	DO 310 i = i_lo, i_hi
+	DO 310 j = j_lo, j_hi
+	DO 310 l = l_lo, l_hi
+	DO 310 m = m_lo, m_hi
+	DO 310 n = n_lo, n_hi
+ 310	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+* fill in along T axis
+	DO 400 l = slot, l_lo-1
+	DO 400 i = i_lo, i_hi
+	DO 400 j = j_lo, j_hi
+	DO 400 k = k_lo, k_hi
+	DO 400 m = m_lo, m_hi
+	DO 400 n = n_lo, n_hi
+ 400	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 410 l = l_hi+1, shit
+	DO 410 i = i_lo, i_hi
+	DO 410 j = j_lo, j_hi
+	DO 410 k = k_lo, k_hi
+	DO 410 m = m_lo, m_hi
+	DO 410 n = n_lo, n_hi
+ 410	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+* fill in along E axis
+	DO 500 m = sloe, m_lo-1
+	DO 500 i = i_lo, i_hi
+	DO 500 j = j_lo, j_hi
+	DO 500 l = l_lo, l_hi
+	DO 500 k = k_lo, k_hi
+	DO 500 n = n_lo, n_hi
+ 500	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 510 m = m_hi+1, shie
+	DO 510 i = i_lo, i_hi
+	DO 510 j = j_lo, j_hi
+	DO 510 k = k_lo, k_hi
+	DO 510 l = l_lo, l_hi
+	DO 510 n = n_lo, n_hi
+ 510	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+* fill in along F axis
+	DO 600 n = slof, n_lo-1
+	DO 600 i = i_lo, i_hi
+	DO 600 j = j_lo, j_hi
+	DO 600 k = k_lo, k_hi
+	DO 600 l = l_lo, l_hi
+	DO 600 m = m_lo, m_hi
+ 600	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+	DO 610 n = n_hi+1, shif
+	DO 610 i = i_lo, i_hi
+	DO 610 j = j_lo, j_hi
+	DO 610 k = k_lo, k_hi
+	DO 610 l = l_lo, l_hi
+	DO 610 m = m_lo, m_hi
+ 610	CALL SET_NULL_C_STRING(src(i,j,k,l,m,n))
+
+	RETURN
+	END 
diff --git a/fer/stk/clean_stack.F b/fer/stk/clean_stack.F
new file mode 100644
index 0000000..d1ae91a
--- /dev/null
+++ b/fer/stk/clean_stack.F
@@ -0,0 +1,59 @@
+	SUBROUTINE CLEAN_STACK
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* following an error during stack computation restore the stack variables
+* to a "clean" state
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* Unix/RISC port - version 0.0 - 9/25/91 *sh*
+* this corrects a bug in the VMS version, too: SET GRID following an error
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include		'tmap_dims.parm'
+	include		'ferret.parm'
+	include 	'xvariables.cmn'
+
+* unset is_cx(1) reflecting last data access as a failure
+      is_cx(1) = unspecified_int4
+
+	RETURN
+	END
+
diff --git a/fer/stk/const_var_context.F b/fer/stk/const_var_context.F
new file mode 100644
index 0000000..8d43f8e
--- /dev/null
+++ b/fer/stk/const_var_context.F
@@ -0,0 +1,71 @@
+	SUBROUTINE CONST_VAR_CONTEXT
+     .		      ( text,
+     .			uvar,
+     .			item, 
+     .			default_cx,
+     .			const_cx,
+     .			status )
+
+* return in const_cx context information describing the constant array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V5.00: 12/18/98 - based on CONSTANT_CONTEXT	
+*	 2/99 *sh* - bug fix on cx_given for normal axes
+* V530:  8/00 *sh* - allow constant arrays of strings
+* V533:  7/01 *sh* - allow single quoted strings
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	INTEGER		uvar, item, default_cx, const_cx, status
+	CHARACTER*(*)	text
+
+* internal variable declarations:
+	INTEGER		idim
+
+* initialize
+	CALL TRANSFER_CONTEXT ( default_cx, const_cx )
+	cx_category( const_cx ) = cat_const_var
+	cx_bad_data( const_cx ) = bad_val4
+	cx_data_set( const_cx ) = pdset_irrelevant
+	cx_dset_gvn( const_cx ) = .TRUE.
+	cx_variable( const_cx ) = 1000*uvar + item     ! packed info
+	cx_grid    ( const_cx ) = mgrid_xabstract
+
+* identify a constant array of strings by the presence of a quotation mark
+	IF ( INDEX(text,'"') .GT. 0
+     .	.OR. INDEX(text,"'") .GT. 0 ) THEN
+	   cx_type(const_cx) = ptype_string
+	ELSE
+	   cx_type(const_cx) = ptype_float
+	ENDIF
+
+* definition applies only to the axis of the constant list
+	cx_given( x_dim, const_cx ) = .TRUE.
+	DO 100 idim =  y_dim, nferdims
+ 100	cx_given( idim, const_cx ) = .FALSE.
+
+* remove all axes limits
+	DO 200 idim = y_dim, nferdims
+ 200	CALL DEL_CX_DIM( idim, const_cx )
+
+* set the X axis limits equal to the length of the array
+	cx_lo_ss(const_cx, x_dim) = 1
+	CALL COUNT_NUMBER_LIST(text, cx_hi_ss(const_cx,x_dim) )
+	cx_by_ss(x_dim,const_cx) = .TRUE.
+	CALL FLESH_OUT_AXIS(x_dim, const_cx, status)
+
+	RETURN
+
+!* error exit
+! 5000	RETURN
+! 5100	CALL ERRMSG( ferr_syntax, status, const_text, *5000 )
+	END
diff --git a/fer/stk/constant_context.F b/fer/stk/constant_context.F
new file mode 100644
index 0000000..369d7ee
--- /dev/null
+++ b/fer/stk/constant_context.F
@@ -0,0 +1,97 @@
+	SUBROUTINE CONSTANT_CONTEXT
+     .		      ( const_text, 
+     .			default_cx,
+     .			const_cx,
+     .			status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return in const_cx context information describing the constant
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/28/87
+* revision 0.1 - 5/5/88  - FINISH_CONTEXT_MODS --> FLESH_OUT_CONTEXT
+* V200:  6/20/89 - re-worked user defined variable logic 
+* V300: ifdef to work around "*" bug in READ (buff,*) in DEC f77 3.2.2
+* V420 (IBM/AIX port of V411): 10/5/95 - buffer "READ(var,*"
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER		default_cx, const_cx, status
+	CHARACTER*(*)	const_text
+
+* internal variable declarations:
+	INTEGER		idim
+	REAL		const_buff
+	CHARACTER	buff*24
+
+* equivalences
+	REAL		cx_value( max_cx )
+	EQUIVALENCE   ( cx_variable, cx_value )
+
+* initialize
+	CALL TRANSFER_CONTEXT ( default_cx, const_cx )
+	cx_category( const_cx ) = cat_constant
+	cx_bad_data( const_cx ) = bad_val4
+	cx_data_set( const_cx ) = pdset_irrelevant
+	cx_dset_gvn( const_cx ) = .TRUE.
+	cx_type    ( const_cx ) = ptype_float
+
+* get the value of the constant
+* bug is that if a "*" follows the numeric text the error branch is taken
+        buff = const_text
+	READ ( buff, *, ERR=5100 ) const_buff
+	cx_value( const_cx ) = const_buff
+
+* flesh out context by removing all axes limits
+	DO 200 idim = 1, nferdims
+ 200	CALL DEL_CX_DIM( idim, const_cx )
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, const_text, *5000 )
+	END
diff --git a/fer/stk/crawl_dependencies.F b/fer/stk/crawl_dependencies.F
new file mode 100644
index 0000000..216e868
--- /dev/null
+++ b/fer/stk/crawl_dependencies.F
@@ -0,0 +1,104 @@
+	SUBROUTINE CRAWL_DEPENDENCIES
+     .		( memory, expression, base_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is derived from EVAL_EXPR, much split off into INIT_DEPENDENCIES
+* see that routine for a discussion of how it is implemented
+* instead of evaluating the expression, it determines the dependencies in it
+
+* base_isp, base_cx allow the calling program to set base levels for work on
+* the stack, allowing pre-existing stack contents to be protected
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V685+ 9/13 *sh*  
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations
+	INTEGER	base_cx, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+	CHARACTER*(*) expression
+
+* local variable declarations
+	INTEGER		UVAR_NUMBER, uvar_pointer, i
+	CHARACTER	EXPR_NAME*8
+
+* initialize
+
+* store expression in the uvar list names as "EX#1"
+	CALL DELETE_OLD_EXPR
+	CALL BREAK_UP_EXPR( expression, num_uvars_in_cmnd, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+	DO 100 i = 1, num_uvars_in_cmnd
+* set up the stacks to look at this expression
+	   uvar_pointer = UVAR_NUMBER( EXPR_NAME(i) )  ! (easier way to do this?)
+           IF ( uvar_pointer .EQ. unspecified_int4 ) CALL ERRMSG
+     .             ( ferr_internal, status, 'crawl_dep', *5000 )
+	   cx_stack_ptr = base_cx
+	   CALL TRANSFER_CONTEXT( cx_cmnd, base_cx )
+           cx_variable( base_cx ) = uvar_pointer
+           cx_category( base_cx ) = cat_user_var
+           isp = dependency_root_level     ! set stack pointer to base
+           is_cx  ( isp ) = base_cx        ! context for stack activities
+           is_uvar( isp ) = uvar_pointer   ! pointer to text buffer
+
+* start a new dependency tree
+	   dependency_current_tree_start = dependency_nrows + 1
+	
+* when called the request is ALWAYS for an untransformed implicitly defined
+           CALL GET_DEPENDENCIES( uvar_pointer,
+     .		dependency_dflt_dset, memory(1,dependency_block1), status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+! temp diagnostic
+	   IF ( cx_stack_ptr .NE. base_cx ) WRITE (6,*) 'get_expr_dep???'
+ 100	CONTINUE
+
+	RETURN
+
+* error exit
+ 5000	CALL EXIT_DEPENDENCY_MODE
+     	RETURN
+	END
diff --git a/fer/stk/diagnostic_out.F b/fer/stk/diagnostic_out.F
new file mode 100644
index 0000000..c491c03
--- /dev/null
+++ b/fer/stk/diagnostic_out.F
@@ -0,0 +1,152 @@
+	SUBROUTINE DIAGNOSTIC_OUT( action, isub, pointer_type )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* output a line describing the activity in progress
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/5/87
+* V200:  5/19/89 - re-ordered lo/hi_ss args
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V420: 12/20/95 - do not print isub - changes too much between revisions
+* Linux Port 12/96 *kob* - missing comma in 3000 format statement 
+*                          discovered by f90 compiler
+* 			 - Added a preprocessor include for tmap_dset.parm
+*			   because it needed a preprocessor.
+* V450: 7/7/97 - make a readable short name from VAR_CODE
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars and change buff24 to buff64
+* V530 9/00 *sh* - output context or mr pointer rather than data set
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars and change buff64 to buff128
+* V63  *acm* 10/09 Changes for gfortran build
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V680  5/12 *acm* Add dataset ID to diagnostic output
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If cancelled, the 
+*                 output will not list info for E,F dimensions.
+
+* calling argument declarations:
+	INTEGER		isub, pointer_type
+	CHARACTER*(*)	action
+
+* internal argument declarations:
+	INTEGER	    TM_LENSTR1, lenbuff, i, listdims
+	CHARACTER   VAR_CODE*128, buff128*128, buff8*8
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+#	include	"tmap_dset.parm"
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xrisc.cmn'		! 12/94 SPLIT_LIST buffer
+
+
+* If mode 6d_lab has been cancelled, we will list info only for 
+* the first 4 dimensions.
+
+	listdims = nferdims
+	IF ( .NOT. mode_6d_lab) listdims = 4
+
+	risc_buff = ' '
+
+* readable variable name code
+	IF ( pointer_type .EQ. point_to_cx ) THEN
+ 	   buff128 = VAR_CODE( cx_category(isub), cx_variable(isub) )
+	ELSE
+	   buff128 = VAR_CODE( mr_category(isub), mr_variable(isub) )
+	ENDIF
+	IF ( buff128(:2) .EQ. '(C' ) THEN
+! ... use low order 2 digits from 3-digit numbers (shortening to 2-digits)
+	   buff8 = '(C'//buff128(4:5)//',V'//buff128(9:10)
+	ELSE
+	   lenbuff = TM_LENSTR1(buff128)
+! ... assemble short name from beginning and end of full name 
+	   IF (lenbuff .GT. 8 ) THEN
+	      buff8 = buff128(1:3)//'-'//buff128(lenbuff-3:lenbuff)
+	   ELSE
+	      buff8 = buff128
+	   ENDIF
+	ENDIF
+
+      IF (listdims .EQ. nferdims) THEN
+
+	IF ( pointer_type .EQ. point_to_cx ) THEN
+	   WRITE ( risc_buff,3000 )
+     .			action,
+     .		 	buff8,
+     .			'C',isub,
+     .			cx_data_set(isub),
+     .			(cx_lo_ss(isub,i),cx_hi_ss(isub,i),i=1,listdims)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+	ELSE
+	   WRITE ( risc_buff,3000 )
+     .			action,
+     .			buff8,
+     .			'M',isub,
+     .			mr_data_set(isub),
+     .			(mr_lo_ss(isub,i),mr_hi_ss(isub,i),i=1,listdims)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+	ENDIF
+
+      ELSE
+
+	IF ( pointer_type .EQ. point_to_cx ) THEN
+	   WRITE ( risc_buff,3100 )
+     .			action,
+     .		 	buff8,
+     .			'C',isub,
+     .			cx_data_set(isub),
+     .			(cx_lo_ss(isub,i),cx_hi_ss(isub,i),i=1,listdims)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+	ELSE
+	   WRITE ( risc_buff,3100 )
+     .			action,
+     .			buff8,
+     .			'M',isub,
+     .			mr_data_set(isub),
+     .			(mr_lo_ss(isub,i),mr_hi_ss(isub,i),i=1,listdims)
+	   CALL SPLIT_LIST(pttmode_ops, ttout_lun, risc_buff, 0 )
+	ENDIF
+
+      ENDIF
+
+ 3000	FORMAT (1X,A,1X,A8,1X,A1,':',I3,' dset:',i4,
+     . ' I:',2I5,'  J:',2I5,'  K:',2I5,'  L:',2I5,'  M:',2I5,'  N:',2I5)
+ 3100	FORMAT (1X,A,1X,A8,1X,A1,':',I3,' dset:',i4,
+     . ' I:',2I5,'  J:',2I5,'  K:',2I5,'  L:',2I5)
+
+	RETURN
+	END	
diff --git a/fer/stk/eval_context.F b/fer/stk/eval_context.F
new file mode 100644
index 0000000..062284c
--- /dev/null
+++ b/fer/stk/eval_context.F
@@ -0,0 +1,100 @@
+	SUBROUTINE EVAL_CONTEXT ( dflt_cx, expression, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* "evaluate context of expression"
+* calculate grid and completed context based on the expression given
+* without actually evaluating the expression
+
+* NOTE THAT THIS ROUTINE CAN RETURN WRONG REGION INFORMATION FOR THE SPECIAL
+* case of expressions like
+*	let a = XSEQUENCE(J[j=1:3])
+*	`a[i=100:200]`
+* where explicit limits are given that do not match returns on ABSTRACT axes
+* or on enhanced-header CDF files with incomplete axis regions included
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510: 3/00 - based on EVAL_EXPR
+* V532: 5/01 *sh* - move the interpretation of region limits from the command
+*		    line external to this routine
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	dflt_cx, status
+	CHARACTER*(*) expression
+
+* local variable declarations
+	INTEGER		cx_expr
+	CHARACTER	EXPR_NAME*8
+
+* initialize grid stack pointer (pushes down from top)
+	grd_stk_ptr = max_grids
+
+* delete any memory left-overs from last command
+!	CALL DELETE_MRS_IN_PROGRESS
+
+* store expression in the uvar list names as "EX#1"
+	CALL DELETE_OLD_EXPR
+	CALL BREAK_UP_EXPR( expression, num_uvars_in_cmnd, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( num_uvars_in_cmnd .NE. 1 ) CALL ERRMSG
+     .			(ferr_invalid_command,status,expression,*5000)
+
+* reserve a context slot to hold a fresh command context
+	cx_stack_ptr = cx_stack_ptr + 1
+	cx_expr = cx_stack_ptr
+
+* evaluate the expression
+	CALL TRANSFER_CONTEXT( dflt_cx, cx_expr )
+	CALL INTERP_CONTEXT( 1, cx_expr, EXPR_NAME(1), status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* success
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/stk/eval_expr.F b/fer/stk/eval_expr.F
new file mode 100644
index 0000000..945905e
--- /dev/null
+++ b/fer/stk/eval_expr.F
@@ -0,0 +1,128 @@
+	SUBROUTINE EVAL_EXPR ( memory, dflt_cx, expression, apply_cx, 
+     .              status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* "evaluate expression"
+* calculate grid of data based on the expression given
+* Saves (temporarily) expression in user-variable (uvar) structure.
+* when done - return with the variable un-"protected" (flagged as deletable)
+
+* a sample command may look like:
+*	CONTOUR/Z=`TEMP[Z=0:1000 at LOC:10]` TEMP[X=160E:160W]
+
+* contexts are transferred, modified and used in the following manner:
+*   i)	skeletal context ( without grid-related info.) is specified in the call
+*	Usually it is based on SET REGION,DTA_SET,etc. ( cx_last )
+*  ii)	this context is modified by the command qualifiers given to produce a 
+*	new skeletal context to be used for the evaluation of the current 
+*	command ( cx_cmnd )
+*	the command context may, itself, contain grave-accented expressions
+*	... those parts of the region are ignored until they are known
+*  iii)	as the expression is evaluated each variable, as it is encountered,
+*	begins with cx_cmnd and modifies it by the variable
+*	qualifiers to produce the context at which the variable is to be
+*	evaluated.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V400: 3/95 - based on GET_PROT_CMND_DATA
+* V600:  3/07 *acm* - fixing bug 439&1390. Add logical variable its_action_command 
+*                     to decide when the qualifiers /X=/Y=/Z=/T= apply to the evaluation
+*                     of immed. mode expressions in the command.
+* V600 *acm* 3/06  fixing bugs 439&1390, pass apply_cx to get_new_cx to say whether
+*                  to apply command context to grave-accent expressions.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+
+
+* calling argument declarations
+        LOGICAL apply_cx
+	INTEGER	dflt_cx, status
+	REAL	memory(*) 
+	CHARACTER*(*) expression
+
+* local variable declarations
+	INTEGER		cx_expr, mr
+	CHARACTER	EXPR_NAME*8
+	INTEGER		tlen
+
+* initialize grid stack pointer (pushes down from top)
+	tlen = LEN(expression)
+	grd_stk_ptr = max_grids
+
+* delete any memory left-overs from last command
+	CALL DELETE_MRS_IN_PROGRESS
+
+* * * * DETERMINE CONTEXT FOR COMMAND * * *
+* ==> this needs to be replaced with a version that can evaluate incomplete
+*	regions that have grave-accented region information
+	CALL GET_NEW_CX( dflt_cx, cx_cmnd, apply_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* store expression in the uvar list names as "EX#1"
+	CALL DELETE_OLD_EXPR
+	CALL BREAK_UP_EXPR( expression, num_uvars_in_cmnd, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( num_uvars_in_cmnd .NE. 1 ) CALL ERRMSG
+     .			(ferr_invalid_command,status,expression,*5000)
+
+* reserve a context slot to hold a fresh command context
+	cx_stack_ptr = cx_stack_ptr + 1
+	cx_expr = cx_stack_ptr
+
+* evaluate the expression
+	CALL TRANSFER_CONTEXT( cx_cmnd, cx_expr )
+	CALL INTERP_STACK( memory, 1, cx_expr, EXPR_NAME(1), status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+! temp diagnostic
+	   IF ( cx_stack_ptr .NE. cx_cmnd+1 ) WRITE (6,*) 'get_cmnd_???'
+
+* flag this result as temporary/delete-able
+        CALL UNPROTECT_CMND_DATA
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/stk/exit_dependency_mode.F b/fer/stk/exit_dependency_mode.F
new file mode 100644
index 0000000..465bb80
--- /dev/null
+++ b/fer/stk/exit_dependency_mode.F
@@ -0,0 +1,54 @@
+	SUBROUTINE EXIT_DEPENDENCy_MODE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* reset COMMON values that indicate the special mode used for assesing 
+* user variable dependency trees
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V685+ 11/13 *sh*  
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xdependency_tree.cmn'
+
+	dependency_tree_mode = .FALSE.
+	CALL RELEASE_WORK_SPC
+
+     	RETURN
+	END
diff --git a/fer/stk/explicit_uvar.F b/fer/stk/explicit_uvar.F
new file mode 100644
index 0000000..7e481f2
--- /dev/null
+++ b/fer/stk/explicit_uvar.F
@@ -0,0 +1,60 @@
+	LOGICAL FUNCTION EXPLICIT_UVAR( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if the given "user-defined" variable was explicitly created (with
+* DEFINE VARIABLE) or implicitly (e.g. with LIST U*V)
+
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   8/8/89
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	uvar
+
+	EXPLICIT_UVAR = INDEX( uvar_name_code(uvar), '#' ) .EQ. 0
+
+	RETURN
+	END
diff --git a/fer/stk/gcf_arg_eval_order.F b/fer/stk/gcf_arg_eval_order.F
new file mode 100644
index 0000000..a281943
--- /dev/null
+++ b/fer/stk/gcf_arg_eval_order.F
@@ -0,0 +1,74 @@
+	INTEGER FUNCTION GCF_ARG_EVAL_ORDER( ifcn, item )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Some grid changing functions require that arguments are evaluated in
+* an order other than the one in which they appear in the function call.
+* For example, SAMPLEI(field, indices) requires that the "indices" argument
+* be evaluated first, and then used to guide the process of obtaing "field"
+* In this function we supply the re-ordered sequence for evaluation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 9/99 *sh*
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+
+* calling argument declarations
+	INTEGER	ifcn, item
+
+* internal variable declarations
+	INTEGER next
+
+* default result
+	next = item
+
+	IF ( ifcn .GE. p_samplei
+     . .AND. ifcn .LE. p_samplen ) THEN		! SAMPLE*
+	   IF (item .EQ. 1) THEN
+	      next = 2			! get index list first
+	   ELSEIF (item .EQ. 2) THEN
+	      next = 1
+	   ENDIF
+	ENDIF  
+
+	GCF_ARG_EVAL_ORDER = next
+	RETURN
+
+	END
diff --git a/fer/stk/get_axis_speed.F b/fer/stk/get_axis_speed.F
new file mode 100644
index 0000000..264bea0
--- /dev/null
+++ b/fer/stk/get_axis_speed.F
@@ -0,0 +1,101 @@
+	SUBROUTINE GET_AXIS_SPEED( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* order the axes X,Y,Z and T into array ds_ax_speed with the fastest (axis of
+* records) in position 1, the slowest in position 6, and the others
+* ordered from fast to slow if possible.
+* normal axes will be regarded as fast (but slower than the record axis)
+
+* e.g. the variable TAUX ordered X,Y in a GT set would produce X,Z,Y,T
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/8/89
+* V230:  3/2/92  - netCDF support
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 removing use of old GT and TS data formats
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+
+* calling argument declarations:
+	INTEGER	dset
+
+* internal variable declarations:
+	INTEGER	idim, i, slowdim, igrid, ivar, nexdim
+
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	include 'ferret.parm'
+	include 'xax_speed.cmn'
+
+* insert default assumptions
+	DO 100 idim = 1, nferdims
+ 100	ds_ax_speed( idim, dset ) = idim
+
+* netCDF
+	IF( ds_type(dset) .EQ. 'CDF' .OR. 
+     .      ds_type(dset) .EQ. 'ENS') THEN
+* ... "record" axis is slowest (stored in ds_time_axis)
+* ... locate it in a grid to see what role it plays
+           IF (ds_time_axis(dset) .EQ. unspecified_int4) RETURN
+           DO 410 ivar = 1, maxvars
+              IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 410
+              igrid = ds_grid_number(ivar)
+              DO 400 idim = 1, nferdims
+ 400          IF (grid_line(idim,igrid).EQ.ds_time_axis(dset)) GOTO 450
+ 410       CONTINUE
+           RETURN
+
+* ... we found the record axis in a grid
+ 450       slowdim = idim
+           ds_ax_speed(6,dset) = slowdim
+           nexdim = 1
+	   DO 460 idim = 1, nferdims-1
+              IF ( idim .EQ. slowdim ) nexdim = nexdim + 1
+              ds_ax_speed(idim,dset) = nexdim
+              nexdim = nexdim + 1
+ 460       CONTINUE
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/stk/get_cmnd_data.F b/fer/stk/get_cmnd_data.F
new file mode 100644
index 0000000..6e0337e
--- /dev/null
+++ b/fer/stk/get_cmnd_data.F
@@ -0,0 +1,86 @@
+	SUBROUTINE GET_CMND_DATA ( memory, dflt_cx, dtype, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* calculate grid(s) of data based on the expression given or implied.
+* Expression(s) are in user-variable (uvar) structures.
+* Implied expression is left from last command
+
+* a sample command may look like:
+*	prompt> CONTOUR/Z=50 TEMP[X=160E:160W]
+* the "Z=50"		is a "command  qualifier" or "command  context modifier"
+* the "X=160E:160W"	is a "variable qualifier" or "variable context modifier"
+* contexts are transferred, modified and used in the following manner:
+*   i)	skeletal context ( without grid-related info.) is specified in the call
+*	Usually it is based on SET REGION,DTA_SET,etc. ( cx_last )
+*  ii)	this context is modified by the command qualifiers given to produce a 
+*	new skeletal context to be used for the evaluation of the current 
+*	command ( cx_cmnd )
+*  iii)	as the expression is evaluated each variable, as it is encountered,
+*	begins with cx_cmnd and modifies it by the variable
+*	qualifiers to produce the context at which the variable is to be
+*	evaluated.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230:  7/27/92 - split into two separate routines, GET_PROT_CMND_DATA and
+*                  and UUNPROTECT_CMND_DATA so that memory management can be
+*                  used during command (e.g. LIST command needs to create
+*                  permutations)
+* V312: 5/94 - array "memory" as a calling argument
+* V530 *sh* 9/00 - added initial support for multiple data types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'errmsg.parm'
+
+* calling argument declarations
+	INTEGER	dflt_cx, dtype, status
+	REAL	memory(*)
+
+* local variable declarations
+* ...
+
+        CALL GET_PROT_CMND_DATA( memory, dflt_cx, dtype, status )
+        IF ( status .NE. ferr_ok ) RETURN
+
+        CALL UNPROTECT_CMND_DATA
+
+	RETURN
+	END
+
+
+
diff --git a/fer/stk/get_dependencies.F b/fer/stk/get_dependencies.F
new file mode 100644
index 0000000..ee16de6
--- /dev/null
+++ b/fer/stk/get_dependencies.F
@@ -0,0 +1,109 @@
+	SUBROUTINE GET_DEPENDENCIES( uvar, dset, work, status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is derived from GET_UVAR_GRID
+* see that routine for a discussion of how it is implemented
+* instead of evaluating the grid of a uvar, this routine traces through the
+* same path and reports out the dependencies
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V685+ 9/13 *sh*  
+
+        include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xdependency_tree.cmn'
+
+* calling argument declarations:
+	INTEGER	uvar, dset, status
+	INTEGER	work(dependency_max_recs, dependency_nfields)
+
+* internal variable declarations:
+	INTEGER	isp_orig, cx_orig, cx, idim
+
+* pre-load the variable info onto the CX stack
+	cx_orig = cx_stack_ptr
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	cx = cx_stack_ptr
+	cx_data_set(cx) = dset
+	cx_variable(cx) = uvar
+	cx_category(cx) = cat_user_var
+
+* pre-load the variable info onto the IS stack
+	isp_orig = isp
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_cx   ( isp ) = cx
+	is_uvar ( isp ) = uvar
+	is_act  ( isp ) = isact_algebra	! temp diagnostic
+
+* initialize the stacks - (repeated for each component)
+ 100	is_phase( isp ) = 0
+	is_sum  ( isp ) = 0   ! flag to change after getting aux vars
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* evaluate the dependencies through recursive descent
+*  ... exit 100 is to evaluate the dependencies for a component uvar
+*  ... exit 300 means that a variable in need of reporting has been obtained
+*  ... "normal" return indicates an error has occurred
+* calling this starts a new dependency tree -- create a forward link from last
+ 200	CALL IS_DEPENDENCIES( *100, *300, work, status )
+	GOTO 5000
+ 
+* a uvar has just been reported.  Are we done ?
+ 300	IF ( isp .EQ. isp_orig ) THEN
+* ... yes - clean up and go home
+	   IF ( cx_stack_ptr .NE. cx_orig ) WRITE (6,*) 'cx_stk_lev_crptn'
+	   RETURN
+	ELSE
+* ... no - go back for more
+	   GOTO 200
+	ENDIF
+
+* error exit
+ 5000	IF ( status .EQ. ferr_stack_ovfl )
+     .		CALL WARN( 'Check for recursion in variable definitions' )
+	RETURN
+	END
diff --git a/fer/stk/get_prot_cmnd_data.F b/fer/stk/get_prot_cmnd_data.F
new file mode 100644
index 0000000..7838817
--- /dev/null
+++ b/fer/stk/get_prot_cmnd_data.F
@@ -0,0 +1,208 @@
+	SUBROUTINE GET_PROT_CMND_DATA ( memory, dflt_cx, dtype, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* "get protected command data"
+* calculate grid(s) of data based on the expression given or implied.
+* Expression(s) are in user-variable (uvar) structures.
+* Implied expression is left from last command
+* when done - return with the variables still "protected" (flagged as in use)
+
+* a sample command may look like:
+*	prompt> CONTOUR/Z=50 TEMP[X=160E:160W]
+* the "Z=50"		is a "command  qualifier" or "command  context modifier"
+* the "X=160E:160W"	is a "variable qualifier" or "variable context modifier"
+
+* contexts are transferred, modified and used in the following manner:
+*   i)	skeletal context ( without grid-related info.) is specified in the call
+*	Usually it is based on SET REGION,DTA_SET,etc. ( cx_last )
+*  ii)	this context is modified by the command qualifiers given to produce a 
+*	new skeletal context to be used for the evaluation of the current 
+*	command ( cx_cmnd )
+*  iii)	as the expression is evaluated each variable, as it is encountered,
+*	begins with cx_cmnd and modifies it by the variable
+*	qualifiers to produce the context at which the variable is to be
+*	evaluated.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230: 7/27/92 - new routine based on GET_CMND_DATA with the unprotecting
+* of variables removed to a separate routine
+*  (revision history for GET_CMND_DATA shown here)
+
+*   rev 0.0 - 6/17/86
+*   rev 1.0 - 1/5/87  - multiple variables in a single expression may be
+*			   evaluated and pointers returned in COMMON/XCONTEXT
+*   rev 2.0 - 1/5/87  - evaluations done on the INTERPRETATION STACK.  User-
+*			   defined variables introduced
+*   rev 2.1 - 9/16/87 - added get_cx_only to calling sequence
+*			   and unknown_qual_ok moved to FERRET.PARM
+*   rev 2.2 - 9/22/87 - shortened code using GET_NEW_cx
+*   rev 2.3 - 9/30/87 - added mr_perm_prot
+*   rev 2.4 - 7/26/88 - don't pass unstand_grid to last context
+*   V200:  5/18/89 - don't pass context on to next command
+*	  	   - initialize grid stack pointer
+*          8/19/91 - explicit SAVE statement for last expression buffer
+* V312: 5/94 - array "memory" as a calling argument
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line. used DATA statment rather than a
+*	        PARAMETER statement because laslen was modified in code
+*	      - Linux F90 doesn't allow SAVE statement, so put an ifdef
+*		check around it 
+* V500:  1/99 - allowing strings in quoble quotes requires fix to quote
+*		handling as in LIST "hello"
+*		Added call to ALL_1_ARG
+* V530: *sh* 9/00 - added data type ad an argument
+*		  - increased size of "last" stored command
+* V540: *sh* 11/00 - "last" var init moved to DELETE_OLD_EXPR
+* v552: *acm* 4/03   Increase length of variable names to 128 characters
+* V600 *acm* 3/06  fixing bugs 439&1390, new arg to get_new_cx.
+* V690 *sh* 12/13  manage auto-curvilinear mode
+*	           aux vars returned on the ISP stack in frame above is_aux_ptr
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'interp_stack.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	dflt_cx, dtype, status
+	REAL	memory(*) 
+
+* local variable declarations
+	LOGICAL		auto_auxvar_changed
+	INTEGER		TM_LENSTR1, nu, cx_expr, idim
+	CHARACTER	EXPR_NAME*8, VAR_CODE*128, buff*128
+
+* initialize grid stack pointer (pushes down from top)
+	grd_stk_ptr = max_grids
+
+* initialize aux stack frames at top of isp stack
+	max_usable_intrp = max_intrp
+	max_context = max_noframe_context  ! just to be clear (not needed)
+
+* determine if in auto-curvilinear mode
+	CALL SET_AUTO_CURVI_MODES( auto_auxvar_changed )
+
+* delete any memory left-overs from last command
+	CALL DELETE_MRS_IN_PROGRESS
+
+* * * * DETERMINE CONTEXT FOR COMMAND * * *
+	CALL GET_NEW_CX( dflt_cx, cx_cmnd, .TRUE., status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* consolidate arguments broken up by command parser back into a single arg
+* ... correct mis-handling of surrounding quotation marks
+	CALL ALL_1_ARG
+
+* * * * BREAK FULL EXPRESSION INTO SUB_EXPRESSIONS * * *
+* ... and store them in the uvar list names as "EX#n"
+* ... eg. LIST U^2,V^2 breaks into "U^2" and "V^2"
+* ... or re-use the last expression ?
+	IF ( num_args .GT. 0 
+     .  .OR. auto_auxvar_changed ) THEN
+	   IF ( last_cmnd_buff(:len_last_cmnd)
+     .     .NE.      cmnd_buff(arg_start(1):arg_end(1)) 
+     .	   .OR. num_uvars_in_cmnd .EQ. cmnd_uvars_not_given
+     .	   .OR. auto_auxvar_changed 		) THEN
+	      CALL DELETE_OLD_EXPR
+	      last_cmnd_buff = cmnd_buff(arg_start(1):arg_end(1))
+	      len_last_cmnd  = arg_end(1) - arg_start(1) + 1
+	      CALL BREAK_UP_EXPR( cmnd_buff(arg_start(1):arg_end(1)),
+     .				  num_uvars_in_cmnd, status )
+	      IF ( status .NE. ferr_ok ) THEN
+	         num_uvars_in_cmnd = cmnd_uvars_not_given
+	         GOTO 5000
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* * * * EVALUATE THE SUB-EXPRESSIONS * * *
+	IF ( num_uvars_in_cmnd .EQ. cmnd_uvars_not_given )
+     .		CALL ERRMSG
+     .			(ferr_invalid_command,status,'no data specified',*5000)
+
+	DO 300 nu = 1, num_uvars_in_cmnd
+
+* ... a context slot to hold a fresh command context for each sub-expression
+	   cx_stack_ptr = cx_stack_ptr + 1
+	   cx_expr = cx_stack_ptr
+
+* ... a frame of size nferdims to hold aux vars needed for plotting and listing
+	   max_usable_intrp = max_usable_intrp - nferdims
+	   max_context      = max_context      - nferdims
+	   DO idim = 1, nferdims
+	      is_mr(max_usable_intrp+idim) = unspecified_int4
+	      is_cx(max_usable_intrp+idim) = unspecified_int4  ! bookkeeping
+	   ENDDO
+
+* ... evaluate the next sub-expression
+	   CALL TRANSFER_CONTEXT( cx_cmnd, cx_expr )
+	   CALL INTERP_STACK( memory, nu, cx_expr,
+     .			      EXPR_NAME(nu), status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* check for legal data type
+	   IF ( dtype .NE. ptype_native ) THEN
+	      IF (mr_type(is_mr(isp)) .NE. dtype ) GOTO 5100
+	   ENDIF
+
+* tag the result for what it is
+* note that since aux vars may now be returned on the ISP stack, isp may be GT nu
+	   is_act(isp) = isact_var_ready
+
+! temp diagnostic
+	   IF ( cx_stack_ptr .NE. cx_cmnd+nu ) WRITE (6,*) 'get_cmnd_???'
+ 300	CONTINUE
+
+* turn off oversizing flag for next command
+	cx_ovsiz(dflt_cx) = ovsiz_off
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	buff = VAR_CODE(mr_category(is_mr(nu)),mr_variable(is_mr(nu)))
+* ... copied from INTERP_STACK error exit ... probably over-kill
+	CALL RELEASE_WORK_SPC
+        CALL DELETE_MRS_IN_PROGRESS
+        CALL UNPROTECT_ALL_MRS
+        CALL DEALLO_ALL_GRIDS
+        CALL CLEAN_STACK
+	CALL ERRMSG( ferr_data_type, status,buff(:TM_LENSTR1(buff)), *5000 )
+	END
diff --git a/fer/stk/get_uvar_grid.F b/fer/stk/get_uvar_grid.F
new file mode 100644
index 0000000..5ca6c10
--- /dev/null
+++ b/fer/stk/get_uvar_grid.F
@@ -0,0 +1,128 @@
+	SUBROUTINE GET_UVAR_GRID( uvar, dset, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the defining grid for user-defined variable, uvar
+* The procedure is performed on the (IS) interpretation stack using stack
+* frames on the IS stack, the CX (context) stack and the grid stack.
+* In order the determine the requested grid the grids for all of the user
+* variables on which the definition depends must also be known or determined.
+* Thus, the process is inherently recursive - requiring the stack usage from
+* FORTRAN.
+* Each stack frame is 1 IS level, 2 CX levels and 1 grid.
+* On successful exit from this routine all stacks should be left in their
+* original states.
+
+* Example:
+*	yes? DEFINE NEW1 = TEMP[Z=@AVE]
+*	yes? DEFINE NEW2 = NEW1 * X
+*	yes? LIST/Z=0:100/X=180:160W NEW2
+
+* ... to get the grid for NEW2 the grid for NEW1 must be determined.
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  7/5/89  
+
+* calling argument declarations:
+	INTEGER		uvar, dset, status
+
+* internal variable declarations:
+	INTEGER		isp_orig, cx_orig, cx, idim
+
+
+! debug includes 11/6/94 *sh*
+        include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* pre-load the variable info onto the CX stack
+	cx_orig = cx_stack_ptr
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	cx = cx_stack_ptr
+	cx_data_set(cx) = dset
+	cx_variable(cx) = uvar
+	cx_category(cx) = cat_user_var
+
+* pre-load the variable info onto the IS stack
+	isp_orig = isp
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_cx   ( isp ) = cx
+	is_uvar ( isp ) = uvar
+	is_act  ( isp ) = isact_get_grid	! temp diagnostic
+
+* initialize the stacks - (repeated for each component)
+
+ 100	CALL IS_GRID_MODE( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+	IF (is_act( isp ) .EQ. isact_get_agg_grid) THEN
+	   CALL IS_AGGREGATE_GRID (uvar, dset, is_cx(isp), status)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* evaluate the grid by merging component grids
+*  ... exit 100 is to evaluate the grid for a component uvar
+*  ... exit 300 means that a grid has been obtained
+*  ... "normal" return indicates an error has occurred
+ 200	CALL IS_UVAR_GRID( *100, *300, status )
+	GOTO 5000
+ 
+* a grid has been obtained.  Are we done ?
+ 300	IF ( isp .EQ. isp_orig ) THEN
+* ... yes - clean up and go home
+	   IF ( cx_stack_ptr .NE. cx_orig ) WRITE (6,*) 'usr_v_gd'	! temp
+	   RETURN
+	ELSE
+* ... no - go back for more
+	   GOTO 200
+	ENDIF
+
+* error exit
+ 5000	IF ( status .EQ. ferr_stack_ovfl )
+     .		CALL WARN( 'Check for recursion in variable definitions' )
+	RETURN
+	END
diff --git a/fer/stk/hunt.F b/fer/stk/hunt.F
new file mode 100644
index 0000000..41d7f3c
--- /dev/null
+++ b/fer/stk/hunt.F
@@ -0,0 +1,110 @@
+	SUBROUTINE HUNT (x1,lo_dim,hi_dim,x2,ndx_lo)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+*	J Davison JISAO/PMEL/NOAA
+*	5.3.88
+
+
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real*8		x1(lo_dim:hi_dim),x2
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(hi_dim) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+!	   else if (x2 .ge. x1(ndx_hi) .eqv. ascnd) then (ORIGINAL CODE)
+	   else if (x2 .gt. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	if (ndx_hi - ndx_lo .eq. 1) return
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/fer/stk/i1mach.F b/fer/stk/i1mach.F
new file mode 100644
index 0000000..080e92d
--- /dev/null
+++ b/fer/stk/i1mach.F
@@ -0,0 +1,526 @@
+      INTEGER FUNCTION I1MACH(I)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* modified by steve hankin to contain explicit declarations
+	INTEGER	I
+
+C***BEGIN PROLOGUE  I1MACH
+C***DATE WRITTEN   750101   (YYMMDD)
+C***REVISION DATE  840405   (YYMMDD)
+C***CATEGORY NO.  R1
+C***KEYWORDS  MACHINE CONSTANTS
+C***AUTHOR  FOX, P. A., (BELL LABS)
+C           HALL, A. D., (BELL LABS)
+C           SCHRYER, N. L., (BELL LABS)
+C***PURPOSE  RETURNS INTEGER MACHINE DEPENDENT CONSTANTS
+C***DESCRIPTION
+C
+C * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+C   THESE MACHINE CONSTANT ROUTINES MUST BE ACTIVATED FOR
+C   A PARTICULAR ENVIRONMENT.
+C * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+C
+C     I1MACH CAN BE USED TO OBTAIN MACHINE-DEPENDENT PARAMETERS
+C     FOR THE LOCAL MACHINE ENVIRONMENT.  IT IS A FUNCTION
+C     SUBROUTINE WITH ONE (INPUT) ARGUMENT, AND CAN BE CALLED
+C     AS FOLLOWS, FOR EXAMPLE
+C
+C          K = I1MACH(I)
+C
+C     WHERE I=1,...,16.  THE (OUTPUT) VALUE OF K ABOVE IS
+C     DETERMINED BY THE (INPUT) VALUE OF I.  THE RESULTS FOR
+C     VARIOUS VALUES OF I ARE DISCUSSED BELOW.
+C
+C  I/O UNIT NUMBERS.
+C    I1MACH( 1) = THE STANDARD INPUT UNIT.
+C    I1MACH( 2) = THE STANDARD OUTPUT UNIT.
+C    I1MACH( 3) = THE STANDARD PUNCH UNIT.
+C    I1MACH( 4) = THE STANDARD ERROR MESSAGE UNIT.
+C
+C  WORDS.
+C    I1MACH( 5) = THE NUMBER OF BITS PER INTEGER STORAGE UNIT.
+C    I1MACH( 6) = THE NUMBER OF CHARACTERS PER INTEGER STORAGE UNIT.
+C
+C  INTEGERS.
+C    ASSUME INTEGERS ARE REPRESENTED IN THE S-DIGIT, BASE-A FORM
+C
+C               SIGN ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) )
+C
+C               WHERE 0 .LE. X(I) .LT. A FOR I=0,...,S-1.
+C    I1MACH( 7) = A, THE BASE.
+C    I1MACH( 8) = S, THE NUMBER OF BASE-A DIGITS.
+C    I1MACH( 9) = A**S - 1, THE LARGEST MAGNITUDE.
+C
+C  FLOATING-POINT NUMBERS.
+C    ASSUME FLOATING-POINT NUMBERS ARE REPRESENTED IN THE T-DIGIT,
+C    BASE-B FORM
+C               SIGN (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
+C
+C               WHERE 0 .LE. X(I) .LT. B FOR I=1,...,T,
+C               0 .LT. X(1), AND EMIN .LE. E .LE. EMAX.
+C    I1MACH(10) = B, THE BASE.
+C
+C  SINGLE-PRECISION
+C    I1MACH(11) = T, THE NUMBER OF BASE-B DIGITS.
+C    I1MACH(12) = EMIN, THE SMALLEST EXPONENT E.
+C    I1MACH(13) = EMAX, THE LARGEST EXPONENT E.
+C
+C  DOUBLE-PRECISION
+C    I1MACH(14) = T, THE NUMBER OF BASE-B DIGITS.
+C    I1MACH(15) = EMIN, THE SMALLEST EXPONENT E.
+C    I1MACH(16) = EMAX, THE LARGEST EXPONENT E.
+C
+C  TO ALTER THIS FUNCTION FOR A PARTICULAR ENVIRONMENT,
+C  THE DESIRED SET OF DATA STATEMENTS SHOULD BE ACTIVATED BY
+C  REMOVING THE C FROM COLUMN 1.  ALSO, THE VALUES OF
+C  I1MACH(1) - I1MACH(4) SHOULD BE CHECKED FOR CONSISTENCY
+C  WITH THE LOCAL OPERATING SYSTEM.
+C***REFERENCES  FOX P.A., HALL A.D., SCHRYER N.L.,*FRAMEWORK FOR A
+C                 PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHEMATICAL
+C                 SOFTWARE, VOL. 4, NO. 2, JUNE 1978, PP. 177-188.
+C***ROUTINES CALLED  (NONE)
+C***END PROLOGUE  I1MACH
+C
+      INTEGER IMACH(16),OUTPUT
+      EQUIVALENCE (IMACH(4),OUTPUT)
+C
+C     MACHINE CONSTANTS FOR THE BURROUGHS 1700 SYSTEM.
+C
+C     DATA IMACH( 1) /    7 /
+C     DATA IMACH( 2) /    2 /
+C     DATA IMACH( 3) /    2 /
+C     DATA IMACH( 4) /    2 /
+C     DATA IMACH( 5) /   36 /
+C     DATA IMACH( 6) /    4 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   33 /
+C     DATA IMACH( 9) / Z1FFFFFFFF /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   24 /
+C     DATA IMACH(12) / -256 /
+C     DATA IMACH(13) /  255 /
+C     DATA IMACH(14) /   60 /
+C     DATA IMACH(15) / -256 /
+C     DATA IMACH(16) /  255 /
+C
+C     MACHINE CONSTANTS FOR THE BURROUGHS 5700 SYSTEM.
+C
+C     DATA IMACH( 1) /   5 /
+C     DATA IMACH( 2) /   6 /
+C     DATA IMACH( 3) /   7 /
+C     DATA IMACH( 4) /   6 /
+C     DATA IMACH( 5) /  48 /
+C     DATA IMACH( 6) /   6 /
+C     DATA IMACH( 7) /   2 /
+C     DATA IMACH( 8) /  39 /
+C     DATA IMACH( 9) / O0007777777777777 /
+C     DATA IMACH(10) /   8 /
+C     DATA IMACH(11) /  13 /
+C     DATA IMACH(12) / -50 /
+C     DATA IMACH(13) /  76 /
+C     DATA IMACH(14) /  26 /
+C     DATA IMACH(15) / -50 /
+C     DATA IMACH(16) /  76 /
+C
+C     MACHINE CONSTANTS FOR THE BURROUGHS 6700/7700 SYSTEMS.
+C
+C     DATA IMACH( 1) /   5 /
+C     DATA IMACH( 2) /   6 /
+C     DATA IMACH( 3) /   7 /
+C     DATA IMACH( 4) /   6 /
+C     DATA IMACH( 5) /  48 /
+C     DATA IMACH( 6) /   6 /
+C     DATA IMACH( 7) /   2 /
+C     DATA IMACH( 8) /  39 /
+C     DATA IMACH( 9) / O0007777777777777 /
+C     DATA IMACH(10) /   8 /
+C     DATA IMACH(11) /  13 /
+C     DATA IMACH(12) / -50 /
+C     DATA IMACH(13) /  76 /
+C     DATA IMACH(14) /  26 /
+C     DATA IMACH(15) / -32754 /
+C     DATA IMACH(16) /  32780 /
+C
+C
+C     MACHINE CONSTANTS FOR THE CDC CYBER 170 SERIES (FTN5).
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    7 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   60 /
+C     DATA IMACH( 6) /   10 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   48 /
+C     DATA IMACH( 9) / O"00007777777777777777" /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   48 /
+C     DATA IMACH(12) / -974 /
+C     DATA IMACH(13) / 1070 /
+C     DATA IMACH(14) /   96 /
+C     DATA IMACH(15) / -927 /
+C     DATA IMACH(16) / 1070 /
+C
+C     MACHINE CONSTANTS FOR THE CDC CYBER 200 SERIES
+C
+C     DATA IMACH( 1) /      5 /
+C     DATA IMACH( 2) /      6 /
+C     DATA IMACH( 3) /      7 /
+C     DATA IMACH( 4) /      6 /
+C     DATA IMACH( 5) /     64 /
+C     DATA IMACH( 6) /      8 /
+C     DATA IMACH( 7) /      2 /
+C     DATA IMACH( 8) /     47 /
+C     DATA IMACH( 9) / X'00007FFFFFFFFFFF' /
+C     DATA IMACH(10) /      2 /
+C     DATA IMACH(11) /     47 /
+C     DATA IMACH(12) / -28625 /
+C     DATA IMACH(13) /  28718 /
+C     DATA IMACH(14) /     94 /
+C     DATA IMACH(15) / -28625 /
+C     DATA IMACH(16) /  28718 /
+C
+C
+C     MACHINE CONSTANTS FOR THE CDC 6000/7000 SERIES.
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    7 /
+C     DATA IMACH( 4) /6LOUTPUT/
+C     DATA IMACH( 5) /   60 /
+C     DATA IMACH( 6) /   10 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   48 /
+C     DATA IMACH( 9) / 00007777777777777777B /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   47 /
+C     DATA IMACH(12) / -929 /
+C     DATA IMACH(13) / 1070 /
+C     DATA IMACH(14) /   94 /
+C     DATA IMACH(15) / -929 /
+C     DATA IMACH(16) / 1069 /
+C
+C     MACHINE CONSTANTS FOR THE CRAY 1
+C
+C     DATA IMACH( 1) /   100 /
+C     DATA IMACH( 2) /   101 /
+C     DATA IMACH( 3) /   102 /
+C     DATA IMACH( 4) /   101 /
+C     DATA IMACH( 5) /    64 /
+C     DATA IMACH( 6) /     8 /
+C     DATA IMACH( 7) /     2 /
+C     DATA IMACH( 8) /    63 /
+C     DATA IMACH( 9) /  777777777777777777777B /
+C     DATA IMACH(10) /     2 /
+C     DATA IMACH(11) /    47 /
+C     DATA IMACH(12) / -8189 /
+C     DATA IMACH(13) /  8190 /
+C     DATA IMACH(14) /    94 /
+C     DATA IMACH(15) / -8099 /
+C     DATA IMACH(16) /  8190 /
+C
+C     MACHINE CONSTANTS FOR THE DATA GENERAL ECLIPSE S/200
+C
+C     DATA IMACH( 1) /   11 /
+C     DATA IMACH( 2) /   12 /
+C     DATA IMACH( 3) /    8 /
+C     DATA IMACH( 4) /   10 /
+C     DATA IMACH( 5) /   16 /
+C     DATA IMACH( 6) /    2 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   15 /
+C     DATA IMACH( 9) /32767 /
+C     DATA IMACH(10) /   16 /
+C     DATA IMACH(11) /    6 /
+C     DATA IMACH(12) /  -64 /
+C     DATA IMACH(13) /   63 /
+C     DATA IMACH(14) /   14 /
+C     DATA IMACH(15) /  -64 /
+C     DATA IMACH(16) /   63 /
+C
+C     MACHINE CONSTANTS FOR THE HARRIS 220
+C
+C     DATA IMACH( 1) /       5 /
+C     DATA IMACH( 2) /       6 /
+C     DATA IMACH( 3) /       0 /
+C     DATA IMACH( 4) /       6 /
+C     DATA IMACH( 5) /      24 /
+C     DATA IMACH( 6) /       3 /
+C     DATA IMACH( 7) /       2 /
+C     DATA IMACH( 8) /      23 /
+C     DATA IMACH( 9) / 8388607 /
+C     DATA IMACH(10) /       2 /
+C     DATA IMACH(11) /      23 /
+C     DATA IMACH(12) /    -127 /
+C     DATA IMACH(13) /     127 /
+C     DATA IMACH(14) /      38 /
+C     DATA IMACH(15) /    -127 /
+C     DATA IMACH(16) /     127 /
+C
+C     MACHINE CONSTANTS FOR THE HONEYWELL 600/6000 SERIES.
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /   43 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   36 /
+C     DATA IMACH( 6) /    6 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   35 /
+C     DATA IMACH( 9) / O377777777777 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   27 /
+C     DATA IMACH(12) / -127 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   63 /
+C     DATA IMACH(15) / -127 /
+C     DATA IMACH(16) /  127 /
+C
+C     MACHINE CONSTANTS FOR THE HP 2100
+C     3 WORD DOUBLE PRECISION OPTION WITH FTN4
+C
+C     DATA IMACH(1) /      5/
+C     DATA IMACH(2) /      6 /
+C     DATA IMACH(3) /      4 /
+C     DATA IMACH(4) /      1 /
+C     DATA IMACH(5) /     16 /
+C     DATA IMACH(6) /      2 /
+C     DATA IMACH(7) /      2 /
+C     DATA IMACH(8) /     15 /
+C     DATA IMACH(9) /  32767 /
+C     DATA IMACH(10)/      2 /
+C     DATA IMACH(11)/     23 /
+C     DATA IMACH(12)/   -128 /
+C     DATA IMACH(13)/    127 /
+C     DATA IMACH(14)/     39 /
+C     DATA IMACH(15)/   -128 /
+C     DATA IMACH(16)/    127 /
+C
+C     MACHINE CONSTANTS FOR THE HP 2100
+C     4 WORD DOUBLE PRECISION OPTION WITH FTN4
+C
+C     DATA IMACH(1) /      5 /
+C     DATA IMACH(2) /      6 /
+C     DATA IMACH(3) /      4 /
+C     DATA IMACH(4) /      1 /
+C     DATA IMACH(5) /     16 /
+C     DATA IMACH(6) /      2 /
+C     DATA IMACH(7) /      2 /
+C     DATA IMACH(8) /     15 /
+C     DATA IMACH(9) /  32767 /
+C     DATA IMACH(10)/      2 /
+C     DATA IMACH(11)/     23 /
+C     DATA IMACH(12)/   -128 /
+C     DATA IMACH(13)/    127 /
+C     DATA IMACH(14)/     55 /
+C     DATA IMACH(15)/   -128 /
+C     DATA IMACH(16)/    127 /
+C
+C     MACHINE CONSTANTS FOR THE IBM 360/370 SERIES,
+C     THE XEROX SIGMA 5/7/9, THE SEL SYSTEMS 85/86, AND
+C     THE PERKIN ELMER (INTERDATA) 7/32.
+C
+C     DATA IMACH( 1) /   5 /
+C     DATA IMACH( 2) /   6 /
+C     DATA IMACH( 3) /   7 /
+C     DATA IMACH( 4) /   6 /
+C     DATA IMACH( 5) /  32 /
+C     DATA IMACH( 6) /   4 /
+C     DATA IMACH( 7) /  16 /
+C     DATA IMACH( 8) /  31 /
+C     DATA IMACH( 9) / Z7FFFFFFF /
+C     DATA IMACH(10) /  16 /
+C     DATA IMACH(11) /   6 /
+C     DATA IMACH(12) / -64 /
+C     DATA IMACH(13) /  63 /
+C     DATA IMACH(14) /  14 /
+C     DATA IMACH(15) / -64 /
+C     DATA IMACH(16) /  63 /
+C
+C     MACHINE CONSTANTS FOR THE PDP-10 (KA PROCESSOR).
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    5 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   36 /
+C     DATA IMACH( 6) /    5 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   35 /
+C     DATA IMACH( 9) / "377777777777 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   27 /
+C     DATA IMACH(12) / -128 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   54 /
+C     DATA IMACH(15) / -101 /
+C     DATA IMACH(16) /  127 /
+C
+C     MACHINE CONSTANTS FOR THE PDP-10 (KI PROCESSOR).
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    5 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   36 /
+C     DATA IMACH( 6) /    5 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   35 /
+C     DATA IMACH( 9) / "377777777777 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   27 /
+C     DATA IMACH(12) / -128 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   62 /
+C     DATA IMACH(15) / -128 /
+C     DATA IMACH(16) /  127 /
+C
+C     MACHINE CONSTANTS FOR PDP-11 FORTRAN SUPPORTING
+C     32-BIT INTEGER ARITHMETIC.
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    5 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   32 /
+C     DATA IMACH( 6) /    4 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   31 /
+C     DATA IMACH( 9) / 2147483647 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   24 /
+C     DATA IMACH(12) / -127 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   56 /
+C     DATA IMACH(15) / -127 /
+C     DATA IMACH(16) /  127 /
+C
+C     MACHINE CONSTANTS FOR PDP-11 FORTRAN SUPPORTING
+C     16-BIT INTEGER ARITHMETIC.
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    5 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   16 /
+C     DATA IMACH( 6) /    2 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   15 /
+C     DATA IMACH( 9) / 32767 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   24 /
+C     DATA IMACH(12) / -127 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   56 /
+C     DATA IMACH(15) / -127 /
+C     DATA IMACH(16) /  127 /
+C
+C     MACHINE CONSTANTS FOR THE UNIVAC 1100 SERIES. FTN COMPILER
+C
+C
+C     DATA IMACH( 1) /    5 /
+C     DATA IMACH( 2) /    6 /
+C     DATA IMACH( 3) /    1 /
+C     DATA IMACH( 4) /    6 /
+C     DATA IMACH( 5) /   36 /
+C     DATA IMACH( 6) /    4 /
+C     DATA IMACH( 7) /    2 /
+C     DATA IMACH( 8) /   35 /
+C     DATA IMACH( 9) / O377777777777 /
+C     DATA IMACH(10) /    2 /
+C     DATA IMACH(11) /   27 /
+C     DATA IMACH(12) / -128 /
+C     DATA IMACH(13) /  127 /
+C     DATA IMACH(14) /   60 /
+C     DATA IMACH(15) /-1024 /
+C     DATA IMACH(16) / 1023 /
+C
+C
+C     MACHINE CONSTANTS FOR THE VAX 11/780
+C
+      DATA IMACH(1) /    5 /
+      DATA IMACH(2) /    6 /
+      DATA IMACH(3) /    5 /
+      DATA IMACH(4) /    6 /
+      DATA IMACH(5) /   32 /
+      DATA IMACH(6) /    4 /
+      DATA IMACH(7) /    2 /
+      DATA IMACH(8) /   31 /
+      DATA IMACH(9) /2147483647 /
+      DATA IMACH(10)/    2 /
+      DATA IMACH(11)/   24 /
+      DATA IMACH(12)/ -127 /
+      DATA IMACH(13)/  127 /
+      DATA IMACH(14)/   56 /
+      DATA IMACH(15)/ -127 /
+      DATA IMACH(16)/  127 /
+C
+C     MACHINE CONSTANTS FOR THE Z80 MICROPROCESSOR
+C
+C     DATA IMACH( 1) /     1/
+C     DATA IMACH( 2) /     1/
+C     DATA IMACH( 3) /     0/
+C     DATA IMACH( 4) /     1/
+C     DATA IMACH( 5) /    16/
+C     DATA IMACH( 6) /     2/
+C     DATA IMACH( 7) /     2/
+C     DATA IMACH( 8) /    15/
+C     DATA IMACH( 9) / 32767/
+C     DATA IMACH(10) /     2/
+C     DATA IMACH(11) /    24/
+C     DATA IMACH(12) /  -127/
+C     DATA IMACH(13) /   127/
+C     DATA IMACH(14) /    56/
+C     DATA IMACH(15) /  -127/
+C     DATA IMACH(16) /   127/
+C
+C                               
+C***FIRST EXECUTABLE STATEMENT  I1MACH
+      IF (I .LT. 1  .OR.  I .GT. 16) GO TO 10
+C
+      I1MACH=IMACH(I)
+      RETURN
+C
+   10 CONTINUE
+      WRITE(OUTPUT,9000)
+9000  FORMAT('1ERROR    1 IN I1MACH - I OUT OF BOUNDS ')
+C
+C     CALL FDUMP
+C
+C
+      STOP
+      END
diff --git a/fer/stk/init_dependencies.F b/fer/stk/init_dependencies.F
new file mode 100644
index 0000000..a4149ef
--- /dev/null
+++ b/fer/stk/init_dependencies.F
@@ -0,0 +1,117 @@
+	SUBROUTINE INIT_DEPENDENCIES
+     .		( dflt_cx, yes_apply_cx, base_isp, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is derived from EVAL_EXPR -- but has only the initialization
+* part from it, so that other parts of the code may be called multiple times
+* for multiple expressions
+* see that routine for a discussion of how it is implemented
+* instead of evaluating the expression, it determines the dependencies in it
+
+* base_isp, base_cx allow the calling program to set base levels for work on
+* the stack, allowing pre-existing stack contents to be protected
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V685+ 9/13 *sh*  
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations
+        LOGICAL yes_apply_cx
+	INTEGER	dflt_cx, base_isp, status
+
+* local variable declarations
+	INTEGER		mr, num_indices, j, uv, wkblk, total_items
+
+* initialize grid stack pointer (pushes down from top)
+	dependency_tree_mode = .TRUE.
+
+* delete any memory left-overs from last command
+	CALL DELETE_MRS_IN_PROGRESS
+
+* * * * DETERMINE CONTEXT FOR COMMAND * * *
+	CALL GET_NEW_CX( dflt_cx, cx_cmnd, yes_apply_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* allocate temporary work space for recording the dependency tree in memory
+	total_items = 0
+	CALL deleted_list_get_undel(uvar_num_items_head, 
+     .                          deleted_list_result(1),
+     .                          max_uvar, num_indices )
+	DO 100 j = 1, num_indices
+	   uv = deleted_list_result(j)
+	   total_items = total_items + uvar_num_items( uv )
+ 100	CONTINUE
+* grossly crude heuristic to set an upper bound for the size of the completed
+* structure representing the tree -- the number of elements in
+* total when adding together all pyramids that can be built from a variable
+* colection
+* Approx half of elements are operators so divide by 2
+* Upper bound size is that each operand depends on all other operands ==> n^2
+* Crudely say we'd never in reality get to more than 1/4 of this
+* Each record saved contains NFIELDS fields, so multiply by NFIELDS
+* so ...   (500 items would will yield 93,750 words)
+	dependency_max_recs = total_items/2
+	dependency_max_recs = (dependency_max_recs*dependency_max_recs)/4
+	dependency_max_recs = MAX(dependency_max_recs, 1000)
+	CALL GET_WORK_SPC( dependency_max_recs*dependency_nfields,
+     .			   wkblk, status )
+	IF (status .NE. ferr_ok) GOTO 5000
+
+* initialize dependency COMMON
+	dependency_nrows      = 0
+	dependency_root_level = base_isp
+	dependency_block1     = wkblk
+	dependency_status     = df_valid_var
+	IF (cx_data_set(cx_cmnd) .EQ. unspecified_int4) THEN
+	   dependency_dflt_dset  = pdset_irrelevant
+	ELSE
+	   dependency_dflt_dset  = cx_data_set(cx_cmnd)
+	ENDIF
+	RETURN
+
+* error exit
+ 5000	CALL EXIT_DEPENDENCY_MODE
+     	RETURN
+	END
diff --git a/fer/stk/init_ftds_dset.F b/fer/stk/init_ftds_dset.F
new file mode 100644
index 0000000..0ab71a5
--- /dev/null
+++ b/fer/stk/init_ftds_dset.F
@@ -0,0 +1,149 @@
+	SUBROUTINE INIT_FTDS_DSET ( dset, uvar, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* v6.85 *acm* Ferret with LET/REMOTE
+* Reset the url for the dataset with its f-tds variable definitions.
+
+
+* calling argument declarations:
+	INTEGER		dset, uvar, status
+
+* local variable declarations
+	INTEGER TM_LENSTR1, nvars, nv, slen, vlen, varid, ivar
+	CHARACTER buff*3000, ebuff*3000, vname*128
+
+* Includes
+	include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+
+	IF (rvar_on_server(uvar)) RETURN
+
+	buff = '_expr_{}{'
+	slen = TM_LENSTR1(buff)
+	nvars = 0
+
+	DO 100 ivar = 1, maxvars
+	   IF (uvar_remote(ivar) .AND. rvar_dset(ivar) .EQ. dset) THEN
+
+* Concatenate multiple definitions with _cr_ not with ;
+	      IF (nvars .GT. 0) 
+     .	        buff = buff(:slen)//'_cr_'
+	      slen = TM_LENSTR1(buff)
+
+	      vname = uvar_name_code(ivar)
+	      vlen = TM_LENSTR1(vname)
+              buff = buff(:slen)//'letdeq1 '//vname(:vlen)//'='
+
+	      slen = TM_LENSTR1(buff)
+	      vlen = TM_LENSTR1(uvar_text(ivar))
+              buff = buff(:slen)//uvar_text(ivar)(:vlen)
+	      slen = TM_LENSTR1(buff)
+
+	      nv = ivar
+	      nvars = nvars + 1
+
+	   ENDIF
+  100	CONTINUE
+
+	IF (nvars .EQ. 0) GOTO 5100
+	
+* Close the url
+
+	buff = buff(:slen)//'}'
+* Encode the definitions
+	CALL CD_ENCODE_URL ( buff, ebuff, status)
+	IF (status .NE. ferr_ok) GOTO 5200
+	
+* Next make the full url and try to open it.
+
+	slen = TM_LENSTR1(ds_des_name(dset))
+	vlen = TM_LENSTR1(ebuff)
+	buff = ds_des_name(dset)(:slen)//ebuff(:vlen)
+
+
+* nc_close the dataset. We're going to re-open it with the
+* F-TDS variable definitions
+
+	CALL CD_NCCLOSE (dset, status)
+
+* Reopen dataset with the f-tds variables. Save its cdfid in
+* the storege for this dset.
+
+	CALL CD_NCOPEN (buff, dset, status)
+
+	IF (status .NE. ferr_ok) THEN  ! Just reopen the original dataset
+	   buff = ds_des_name(dset)
+	   CALL CD_NCOPEN (buff, dset, status)
+	   status = ferr_remotevar_error
+	   GOTO 5000
+	ENDIF
+
+* Now will get varids and stuff.
+
+	DO 200 ivar = 1, maxvars
+	   IF (uvar_remote(ivar) .AND. rvar_dset(ivar) .EQ. dset) THEN
+
+	      vname = uvar_name_code(ivar)
+	      CALL CD_NF_GET_VARID ( dset, vname, varid, status )
+	      IF (status .NE. ferr_ok) GOTO 5300
+
+	      rvar_varid (ivar) = varid
+	      rvar_on_server (ivar) = .TRUE.  ! Definition in current url.
+	      IF (ivar .GE. nv) GOTO 300
+	   ENDIF
+  200	CONTINUE
+
+  300	CONTINUE
+
+ 5000	RETURN
+ 5100   goto 5000 ! ? need message - no remote vars for this dataset
+ 5200   buff = 'Error encoding F-TDS url for LET/REMOTE definitions '
+        CALL ERRMSG(ferr_remotevar_error, status, buff, *5000 )
+
+ 5300   CONTINUE !  need error handling - error getting varid
+	buff = 'Error getting remote variable id for LET/REMOTE definition'
+        CALL ERRMSG (ferr_remotevar_error, status, buff, *5000 )
+
+	END
diff --git a/fer/stk/init_random_seed.F b/fer/stk/init_random_seed.F
new file mode 100644
index 0000000..df1f470
--- /dev/null
+++ b/fer/stk/init_random_seed.F
@@ -0,0 +1,71 @@
+	SUBROUTINE init_random_seed(inseed)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set seeds for calls to RANDOM_NUMBER.
+* Both RANDOM_NUMBER and RANDOM_SEED are part of the gfortran library.
+*
+* This routine based on init_random_seed from the gfortran documentation
+* except that the input argument inseed determines seeding as follows:
+*  inseed = 0 return. Continue to use the seeding that's currently in effect
+*  inseed = -1 use the system clock to initialize the seed
+*  inseed = N > 0 use N to initialize the seed, for repeatable results.
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+
+
+	INTEGER :: inseed
+	INTEGER :: i, n, clock
+	INTEGER, DIMENSION(:), ALLOCATABLE :: seed
+
+	INTEGER iseed
+
+	iseed = inseed
+	IF (inseed .EQ. 0) RETURN
+
+	CALL RANDOM_SEED(size = n)
+	ALLOCATE(seed(n))
+
+	IF (inseed .EQ. -1) THEN
+	   CALL SYSTEM_CLOCK(COUNT=clock)
+	   iseed = clock
+	ENDIF
+	seed = iseed + 37 * (/ (i - 1, i = 1, n) /)
+	CALL RANDOM_SEED(PUT = seed)
+
+	DEALLOCATE(seed)
+	END SUBROUTINE
diff --git a/fer/stk/interp_context.F b/fer/stk/interp_context.F
new file mode 100644
index 0000000..1e75acf
--- /dev/null
+++ b/fer/stk/interp_context.F
@@ -0,0 +1,179 @@
+	SUBROUTINE INTERP_CONTEXT ( isp_base, cx, name_code, status )
+
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the complete context of a user variable -- its grid
+* and all region information including region info that is embedded inside
+* of sub-definitions. For example 
+*	LET expr = A[l=1:5]; LET A = SST[X=130E:80W]
+* would need to include the X limits, too, in the final result 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510: 3/00 *sh* extracted from INTERP_STACK
+* V530: 3/01 *sh* bug fix - deallocate implicit grid 
+* V531: 4/01 *sh* insert missing value flag into the context
+* V532: 6/01 *sh* bug fix:  CALL DEALLO_UNFORMED_GRID instead of DEALLO_GRID
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V685: 1/13 *sh* ensure that sst[L=@ave] is recognized as a compressed axis
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER		isp_base, cx, status
+	CHARACTER*(*)	name_code
+
+* internal variable declarations:
+	LOGICAL		explicit_qualifiers
+	INTEGER		UVAR_NUMBER, KNOWN_GRID, idim, uvar,
+     .			start, end, mod_cx
+
+* calling arguments:
+* in	isp_base	- stack level at which to begin calculations
+*			  ( all levels below remain untouched )
+* in	cx		- context slot to return
+* in	name_code	- name of uvar to be evaluated
+* out	status		- completion code
+
+
+* locate the requested variable in the uvar variables
+	uvar = UVAR_NUMBER( name_code )
+	IF ( uvar .EQ. unspecified_int4 ) CALL ERRMSG
+     .		( ferr_internal, status, 'intp_stk', *5000 )
+	
+* initialize the default context for the quantity to evaluate
+	cx_variable( cx ) = uvar
+	cx_category( cx ) = cat_user_var
+	cx_grid    ( cx ) =
+     .		KNOWN_GRID(cx_data_set(cx),cat_user_var,uvar)
+
+* initialize base level of the interpretation stack
+* ... ( see PUSH_INTERP_STACK for isp>isp_base )
+	isp = isp_base			! stack pointer
+	is_cx  ( isp ) = cx	! context for stack activities
+	is_uvar( isp ) = uvar	! pointer to text buffer
+
+* when called the request is ALWAYS for an untransformed implicitly defined
+* user variable (e.g. "LIST U" or "LIST SIN(X+Y)"
+* determine its grid, if necessary - then flesh out the requested dimensions
+	IF ( cx_grid(cx) .EQ. unspecified_int4 ) THEN
+	   CALL GET_UVAR_GRID( uvar,cx_data_set(cx),status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   cx_grid(cx) =
+     .		KNOWN_GRID(cx_data_set(cx),cat_user_var,uvar)
+	ENDIF
+
+* flesh out the requested dimensions (noting if there are any)
+	explicit_qualifiers = .FALSE.
+	DO 5 idim = 1, nferdims
+	   IF ( uvar_given( idim, uvar ) .GE. uvlim_needed
+     .	   .OR. cx_given( idim,cx ) ) THEN
+	      explicit_qualifiers = explicit_qualifiers
+     .			       .OR. cx_given(idim,cx )
+	      CALL CONFINE_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL FLESH_OUT_AXIS( idim, cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+ 5	CONTINUE
+	
+* copy uvar_* limits into the output context
+	DO 100 idim = 1, nferdims
+	   IF ( cx_lo_ss(cx, idim) .EQ. unspecified_int4 ) THEN
+	      IF ( uvar_given(idim,uvar) .GE. uvlim_gvn_gnl
+     .       .AND. uvar_given(idim,uvar) .LE. uvlim_gvn_xact ) THEN
+	         cx_lo_ss(cx, idim) = uvar_lo_ss(uvar, idim)
+	         cx_hi_ss(cx, idim) = uvar_hi_ss(uvar, idim)
+	         cx_lo_ww (idim, cx) = uvar_lo_ww(idim, uvar)
+	         cx_hi_ww (idim, cx) = uvar_hi_ww(idim, uvar)
+	         cx_by_ss (idim, cx) = uvar_by_ss(idim, uvar)
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+
+* if the expression is a single variable, then "EX#1" becmes that variable
+	IF ( uvar_num_items(uvar) .EQ. 1
+     . .AND. uvar_item_type(1,uvar) .EQ. alg_variable ) THEN
+	   start = uvar_item_start( 1, uvar )
+	   end   = uvar_item_end  ( 1, uvar )
+	   CALL PARSE_NAM_DSET( uvar_text(uvar)(start:end),
+     .				cx, cx_data_set(cx),
+     .				cx_category(cx),
+     .				cx_variable(cx), mod_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( cx_has_impl_grid(mod_cx) ) THEN
+	      CALL DEALLO_UNFORMED_GRID( status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	ENDIF
+
+* fill in any unspecified limits with information from the grid
+	CALL COMPLETE_MISSING_LIMITS(cx)
+
+* *sh* 1/2013
+* make sure that the cx_lo/hi_ss limits of compressed axes are unset
+	DO 200 idim = 1, nferdims
+	   IF ( uvar_given(idim,uvar) .EQ. uvlim_need_xact ) THEN
+	      cx_lo_ss(cx, idim) = unspecified_int4
+	      cx_hi_ss(cx, idim) = unspecified_int4
+	   ENDIF
+ 200	CONTINUE
+
+
+* insert the missing value flag
+	CALL GET_CONTEXT_BAD_FLAG(cx)
+
+* success
+	RETURN
+
+* error exit - clean up
+ 5000	CALL RELEASE_WORK_SPC
+	CALL DELETE_MRS_IN_PROGRESS
+	CALL UNPROTECT_ALL_MRS
+	CALL DEALLO_ALL_GRIDS
+        CALL CLEAN_STACK
+	RETURN
+	END
+
+
+
+
diff --git a/fer/stk/interp_stack.F b/fer/stk/interp_stack.F
new file mode 100644
index 0000000..963406e
--- /dev/null
+++ b/fer/stk/interp_stack.F
@@ -0,0 +1,683 @@
+	SUBROUTINE INTERP_STACK ( memory, isp_base, dflt_cx,
+     .				  name_code, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return a grid of data and a buffer of context info about the grid given 
+* a default context for evaluation and the text of an expression.
+* Transformations, regrids, rotations, etc. are all controlled
+* by this routine.  Nesting of these operations is possible because all
+* operations are carried out on a stack - the "interpretation stack".
+* The results are left on the interpretation stack at level isp_base
+* The result computed, pointed to by is_mr(isp_base), is left protected
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/10/87
+* .
+* .
+* .
+* V200:  5/18/89 - 4D-symmetrical
+*		 - implicit regridding
+*		 - transformations not permitted on command line
+*		 - eliminated get_ctxt_only from call
+*		 - "cvar" evaluation is done on the IS stack
+*		 - uvar grids determined in IGRID
+*	 1/11/90 - added @LOC
+*	 2/28/90 - added kludge code to double check memory before IS_READ
+* for Unix/RISC port 9/91 - added Hanning,Parzen and Welch filters (windows)
+*                         - added CLEAN_STACK for better error handling
+* V230: 12/26/91 - added @SUM, @WEQ, @RSUM
+*        1/22/92 - added @WEQ
+*         2/3/92 - added @VAR, @NGD, and @NBD
+*        3/23/92 - added @FLN (fill with linear interpolation)
+* V312: 5/94  - array "memory" as a calling argument
+* V320: 12/94 - added logic to trap modulo reads on file variables
+*	 2/95 - added logic to trap reverse-direction axes and reverse them
+* V420: 11/95 - moved modulo logic from file vars only to all variables
+*		(12/95) screen out uvlim_*_xact from modulo
+*	      - added isact_class_reconcile so cmnd qualifiers are
+*		better processed
+*	      - support for non-reusable results: if component is non-reusable
+*		so is result (using ITS_UN_CACHED and UN_CACHE)
+* V430: 7/96  - incorporate 4D transformations
+* V450: 2/97  - Allow application of modulo to GC vars (but not other uvars)
+* V455    9/97 - added transforms @CDA,CDB,CIA,CIB
+* V500: 10/98 *jc* - added lines to ignore hidden @RDC
+*	12/98 *sh* added call to IS_CONST_VAR to support {1,3,5} notation
+*	 3/99 *sh* added call to COMPLETE_MISSING_LIMITS to improve cache hits
+*		and corresponding change in file reading to restrict limits
+*	 5/99 *sh* remove delta values error trap
+*		(cx_delta is now used by netCDF vars to signal that the
+*		read_tm should use strides)
+* V510: 8/99 *sh* handle isact_sample
+* V530: 11/00 *sh* - perform RESTRICT_FILE_LIMITS before recheck FIND_MEM_VAR
+*		for improved cache hits (case; ASCII file reads where EZ axis
+*		exceeds actual file size misses cache because
+*		COMPLETE_MISSING_LIMITS inserts full EZ ax limits)
+* V533: 6/01 *sh* - added @EVNT
+* V541: 2/02 *sh* - added support for modulo lengths (subspan modulo)
+* V554 1/04 *acm* - additions for /RANGE repeat loop control
+* V603 4/07 *acm* - Fix bug 636;  Resolve any wierd cx_grid definitions leftover from get_context_mods
+*                   before calling COMPLETE_MISSING_LIMITS. Bug occured from regridding a variable to 
+*                   its own axis with [gt=var]
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690 9/13-2/14 *sh* add support for aux var regridding: temp[gz(depth)=zax]
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xinterrupt.cmn'
+	include	'xfr_grid.cmn'
+
+* calling argument declarations:
+	INTEGER		isp_base, dflt_cx, status
+	REAL		memory(*)
+	CHARACTER*(*)	name_code
+
+* internal variable declarations:
+	LOGICAL		ITS_UN_CACHED, ITSA_MODULO_REGRID, ITSA_GCVAR,
+     .			ITSA_MODULO_GCF, TM_ITS_SUBSPAN_MODULO,
+     .			look_again, modulo_axes(nferdims), 
+     .			explicit_qualifiers, is_remote_var
+	INTEGER		UVAR_NUMBER, KNOWN_GRID, CGRID_AXIS, 
+     .			CAXIS_MODLEN, TM_AXES_REVERSED, rev_axes(nferdims),
+     .			cx, mr, idim, cat, act, uvar_pointer,
+     .			com_mr, var
+
+* external routines passed
+	EXTERNAL	DO_SHIFT, DO_SMTH_BOX, DO_FILL_AVE, DO_AVERAGE,
+     .			DO_INTEG_DEF, DO_4D_AVE, DO_4D_INT_DEF,
+     .			DO_DERIV_FRWD, DO_DERIV_CNTR,DO_DERIV_BKWD,
+     .			DO_SMTH_BINML, DO_MIN, DO_MAX, DO_INT_INDEF,
+     .			DO_INTERPOLATE, DO_LOCATE, DO_SMTH_HANNG,
+     .                  DO_SMTH_PARZN, DO_SMTH_WELCH, DO_SUM,
+     .                  DO_DIST_LOC, DO_RUN_SUM, DO_NGOOD, DO_NBAD,
+     .                  DO_VARIANCE, DO_FILL_INTERP, DO_FILL_NEAR,
+     .			DO_4D_VAR,DO_4D_NGD,DO_4D_NBD,DO_4D_SUM,
+     .			DO_NEAREST_DIST_ABOVE, DO_NEAREST_DIST_BELOW,
+     .			DO_NEAREST_INDEX_ABOVE,DO_NEAREST_INDEX_BELOW,
+     .			DO_EVENT, DO_SMTH_MEDIAN, DO_SMTH_MIN, DO_SMTH_MAX,
+     .			DO_STDDEV
+
+* calling arguments:
+* in	isp_base	- stack level at which to begin calculations
+*			  ( all levels below remain untouched )
+* in	dflt_cx		- "default context" for evaluation of expression
+* in	name_code	- name of uvar to be evaluated
+* out	status		- completion code
+
+* example of stack operations:
+*	let DTDX = ( temp[i=+1d] - temp[i=-1d] ) / 2*dx
+* ... and we wish to evaluate
+*	LIST/X=170E:160W:10 U[G=TEMP,Z=@AVE] * DTDX
+
+* outside of this routine the default context (from SET REGION,DATA,etc)
+* has been modified by "/X=170E:160W:10" to produce dflt_cx
+* Before entering this routine the text of the expression has been moved to 
+* a numbered buffer in uvar_text and broken down into reverse Polish 
+* ordered operations within other arrays in the uvar structure.
+
+* When the stack is entered ( in isact_request mode ) it will detect the delta
+* 10 degrees specified on the X axis and interpret this as an implicit request
+* to regrid the data.  IS_STRIP will be called to strip this off by claiming
+* a level on the IS stack for the regridding operation, incrementing the IS
+* stack pointer, isp, and passing on the context (pointed to by is_cx)
+* modified by the removal of ":10".
+
+* Having no transformations or regrids in its current top level context 
+* INTERP_STACK will then treat the context as an algebraic expression and
+* IS_ALGEBRA will be given control.  IS_ALGEBRA will claim an IS stack level
+* for its operations.  IS_ALGEBRA will parse the string "U[G=TEMP]",
+* identifying data set, variable, grid, transformations, etc. and setting
+* up a context that describes it.  The resulting request will then be passed
+* back to INTERP_STACK at label 10 in IS_REQUEST mode.
+
+* INTEEP_STACK will then detect the request for Z averaging.  Again,
+* IS_STRIP will be called to allocate a stack level for the operation and
+* strip the averaging request off in the context for the next stack level.
+
+* INTEEP_STACK will then detect the explicit request for regridding and call
+* IS_STRIP again to allocate a stack level for the operation and strip the
+* regridding request off in the context for the next stack level.
+
+* INTERP_STACK, again in IS_REQUEST mode, will then see that the context at the
+* top of the stack now contains a request for a variable ("U") to be read and
+* it will call IS_READ.  The variable will be read and the IS stack pointer
+* will be decremented.
+
+* INTERP_STACK now finds itself in regridding mode (isact_regrid) and calls
+* IS_REGRID to perform the operation on the results just averaged.  When
+* the regridding operation is completed isp is decremented.
+
+* INTERP_STACK now finds itself in averaging mode (isact_average) and calls
+* IS_AVERAGE to perform the operation on the results just read.  Again, when
+* the averaging operation is completed the IS stack pointer,isp, is decremented.
+
+* INTERP_STACK now finds itself back in algebra mode (isact_algebra) and calls
+* IS_ALGEBRA giving it the requested component pointed to by is_mr on the IS
+* stack.  IS_ALGEBRA then moves on to the next component, DTDX, parses the
+* expression and passes the request back to INTERP_STACK. ... etc.
+* When IS_ALGEBRA regains control again it will have the 2 needed operands
+* on the stack and it will perform the requested multiplication operation.
+* It will then detect that it has reached the end of the expression and
+* decrement isp.
+
+* INTERP_STACK now finds itself back in implicit regrid mode.  It calls
+* IS_AUTOGRID to perform the required action.  IS_AUTOGRID decrements isp
+* when it is finished.
+
+* INTERP_STACK then finds itself back at the base IS stack level signaling 
+* that the expression has been evaluated successfully.  It exits signalling
+* successful completion.
+
+* --- end of introductory code ---
+
+* locate the requested variable in the uvar variables
+	uvar_pointer = UVAR_NUMBER( name_code )
+	IF ( uvar_pointer .EQ. unspecified_int4 ) CALL ERRMSG
+     .		( ferr_internal, status, 'intp_stk', *5000 )
+	
+* initialize the default context for the quantity to evaluate
+	cx_variable( dflt_cx ) = uvar_pointer
+	cx_category( dflt_cx ) = cat_user_var
+	cx_grid    ( dflt_cx ) =
+     .		KNOWN_GRID(cx_data_set(dflt_cx),cat_user_var,uvar_pointer)
+
+* initialize base level of the interpretation stack
+* ... ( see PUSH_INTERP_STACK for isp>isp_base )
+ 6	isp = isp_base			     ! stack pointer
+	is_cx     ( isp ) = dflt_cx	     ! context for stack activities
+	is_uvar   ( isp ) = uvar_pointer     ! pointer to text buffer
+	is_aux_ptr( isp ) = max_usable_intrp ! pointer to aux vars for plotting
+
+* when called the request is ALWAYS for an untransformed implicitly defined
+* user variable (e.g. "LIST U" or "LIST SIN(X+Y)"
+* determine its grid, if necessary - then flesh out the requested dimensions
+	IF ( cx_grid(dflt_cx) .EQ. unspecified_int4 ) THEN
+	   CALL GET_UVAR_GRID( uvar_pointer,cx_data_set(dflt_cx),status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   cx_grid(dflt_cx) =
+     .		KNOWN_GRID(cx_data_set(dflt_cx),cat_user_var,uvar_pointer)
+	ENDIF
+
+* flesh out the requested dimensions (noting if there are any)
+	explicit_qualifiers = .FALSE.
+	DO 5 idim = 1, nferdims
+	   IF ( uvar_given( idim, uvar_pointer ) .GE. uvlim_needed
+     .	   .OR. cx_given( idim,dflt_cx ) ) THEN
+	      explicit_qualifiers = explicit_qualifiers
+     .			       .OR. cx_given(idim,dflt_cx )
+	      CALL CONFINE_AXIS( idim, dflt_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL FLESH_OUT_AXIS( idim, dflt_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+ 5	CONTINUE
+	
+* was a regridding operation implied through the command qualifier cx_delta?
+* (5/99) test moved from transformation stripping section below
+	DO 8 idim = 1, nferdims
+	   IF ( cx_delta(idim, dflt_cx) .NE. unspecified_val8 ) THEN
+	      CALL ERRMSG( ferr_invalid_command, status,
+     .			'delta values may only modify variable names', *5000 )
+	   ENDIF
+ 8	CONTINUE
+
+
+
+* special pre-initialization of stack to reconcile differences between command
+* qualifiers and expression -- e.g. LIST/I=1:5 a[i=3:4]
+	IF ( explicit_qualifiers ) THEN
+	   CALL IS_STRIP( isact_class_reconcile, 0, *10, status )
+	   GOTO 5000
+	ENDIF
+
+******************************************************************************
+* * * * * * TOP OF INTERPRETATION STACK - INITIALIZE STACK LEVEL * * * * * *
+******************************************************************************
+ 10	is_act(isp)   = isact_request
+	cx = is_cx( isp )
+	cat = cx_category( cx )
+	var = cx_variable( cx )
+
+* constants and pseudo-variables and counter variables may be handled immediately
+* ... get user variable grids if unknown
+	IF     ( cat .EQ. cat_pseudo_var ) THEN
+	   CALL IS_PSEUDO ( memory, *2000, status )
+	   GOTO 5000
+	ELSEIF ( cat .EQ. cat_constant ) THEN
+	   CALL IS_CONSTANT( memory, *2000, status )
+	   GOTO 5000
+* ... get a counter variable
+	ELSEIF ( cat .EQ. cat_counter_var ) THEN
+	   CALL IS_COUNTER_VAR   (var, memory, *2000, status )
+	   GOTO 5000
+
+        ENDIF
+
+* 3/99 complete missing context limits as full-span: to improve cache hits
+
+*      first resolve any wierd cx_grid definitions leftover from  get_context_mods
+	IF (cx_grid(cx) .LT. unspecified_int4) THEN 
+	   CALL GET_UVAR_GRID( uvar_pointer,cx_data_set(cx),status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   cx_grid(cx) =
+     .		KNOWN_GRID(cx_data_set(cx),cat_user_var,uvar_pointer)
+	ENDIF
+        
+        CALL COMPLETE_MISSING_LIMITS( cx )
+
+* check in memory to see if we already have the data 
+	CALL FIND_MEM_VAR( cx, mr, search_by_value )
+	IF ( mr .GT. mr_nonexist ) THEN
+* ... yes - already in memory
+	   is_mr( isp ) = mr
+	   IF ( mr_category(mr) .EQ. cat_user_var ) THEN
+	      CALL PASS_AMBIG_LIMS( cx, mr, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	   GOTO 2000						! pop stack
+	ENDIF
+
+******************************************************************************
+* * * * * * * * STRIP AWAY TRANSFORMATIONS ONTO STACK * * * * * * * * * * * * 
+******************************************************************************
+
+* ... strip off a transformation ?
+* ... reverse loop order ensures that X transformations are done BEFORE
+* ... the Y transformations. This is necessary for accuracy wrt. COS factors.
+* ... By stripping X last it will be done first.
+* 10/98 *jc* - need to ignore trans_reduce (see info in ctx/add_rdc_xform.F)
+	DO 200 idim = nferdims, 1, -1
+       IF ( cx_trans( idim, cx ) .NE. trans_no_transform
+     .          .AND. cx_trans( idim, cx ) .NE. trans_reduced ) THEN
+	      CALL IS_STRIP( isact_class_trans, idim, *10, status )
+	      GOTO 5000
+	   ENDIF
+ 200	CONTINUE
+
+* ... strip off "modulo" replications
+*   ... but do not strip modulo at the topmost level
+*     - else LIST/X=340:380 mod_var[X=@ave] will be wrong
+	IF ( cat .EQ. cat_user_var ) THEN
+	   IF (uvar_name_code(var)(1:3) .EQ. 'EX#'    ) GOTO 260
+	ENDIF	   
+	CALL GET_CX_MODULO_AXES(cx,modulo_axes)
+	DO 250 idim = 1, nferdims
+	   IF ( modulo_axes(idim)
+     .	  .AND. cx_lo_ss(cx,idim) .NE. unspecified_int4 ) THEN
+	      IF ( cat .EQ. cat_user_var ) THEN			! added 12/95
+*    ... cannot modulo an average (or other compressed result)
+	         IF ( uvar_given(idim,var) .EQ. uvlim_gvn_xact
+     .		 .OR. uvar_given(idim,var) .EQ. uvlim_need_xact ) GOTO 250
+*    ... do not apply modulo to pseudo-variables - else their values will not
+*	 match the modulo axis indices and values
+* 	 Exception to this is modulo regrids -- comments at end of IS_STRIP
+	         IF ( uvar_mod_pseudo(idim,var)
+     .		.AND. .NOT.ITSA_MODULO_REGRID(cx,idim) ) THEN
+*    ... (2/97) imposed axis of a grid changing var can get moduloed 
+		   IF ( ITSA_GCVAR(var) ) THEN
+	              IF (.NOT.ITSA_MODULO_GCF(cx,idim)) GOTO 250
+	           ELSE
+	              GOTO 250
+	           ENDIF
+	         ENDIF
+	      ENDIF
+! 11/95 - known bug/feature:
+! A[I=1:10] behaves inconsistently wrt  A[I=1:20] for A=VAR[I=3:7] on a
+! modulo axis of length 10 because is_modulo reconciles differences between
+! the component and the result differently from non-modulo vars
+	      IF (cx_hi_ss(cx,idim ) .GT. CAXIS_MODLEN(idim,cx)
+     .	     .OR. cx_lo_ss(cx,idim ) .LT. 1 ) THEN
+	         CALL IS_STRIP( isact_class_modulo, idim, *10, status )
+	         GOTO 5000
+	      ENDIF
+	   ENDIF
+ 250	CONTINUE
+
+* ... strip off creation of virtual "void" point on subspan modulo axes
+	DO 255 idim = 1, nferdims
+	   IF ( modulo_axes(idim)
+     .	  .AND. cx_lo_ss(cx,idim) .NE. unspecified_int4 ) THEN
+	     IF (TM_ITS_SUBSPAN_MODULO(CGRID_AXIS(idim, cx))) THEN
+	      IF (cx_hi_ss(cx,idim) .EQ. CAXIS_MODLEN(idim, cx)) THEN
+	        CALL IS_STRIP(isact_class_subspan_fill,idim,*10,status)
+	        GOTO 5000
+	      ENDIF
+	    ENDIF
+	  ENDIF
+ 255	CONTINUE
+
+* ... strip off need to gather aggregate components together ?
+ 	IF ( cat .EQ. cat_aggregate_var ) THEN
+	   CALL IS_STRIP( isact_class_aggregate_gather, e_dim, *10, status )
+	   GOTO 5000
+	ENDIF
+
+* ... strip off need for regridding data ?
+ 260	IF ( cx_unstand_grid( cx ) ) THEN
+	   CALL IS_STRIP( isact_class_regrid, no_dim, *10, status )
+	   GOTO 5000
+	ENDIF
+
+
+* ... strip off getting aux variables?
+*     note that regridding already stripped, so this is always for 3-arg plots
+	IF ( cx_naux(cx) .GT. 0 ) THEN
+	   CALL IS_STRIP( isact_class_aux_plot_vars, no_dim, *10, status )
+	   GOTO 5000
+	ENDIF
+
+* ... reduce algebraic expression to its components ?
+
+	IF ( cat .EQ. cat_user_var	) THEN
+
+* * * * * * * * * * * * How to test whether uvar is an F-TDS remote var 
+*  ??
+	   is_remote_var = ( uvar_remote(var) )
+
+	   IF (.NOT. is_remote_var) THEN
+	      CALL IS_ALGEBRA( memory, *10, *2000, isp_base, status )
+	   ELSE
+	   
+	      CALL INIT_FTDS_DSET ( cx_data_set(cx), var, status)
+	      CALL IS_READ_REMOTE( memory, *10, *2000, status )
+	   ENDIF
+
+	   GOTO 5000
+
+* ... read from disk ?
+	ELSEIF ( cat .EQ. cat_file_var
+     .	.OR.     cat .EQ. cat_file_rev	) THEN
+
+	   IF ( cat .EQ. cat_file_var ) THEN
+
+* ... trim context limits to what is available in file (ds_grid_start/end)
+	      CALL RESTRICT_FILE_LIMITS( cx, look_again, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+
+* ... kludge to avoid re-reading when regions aren't fully specified 2/90
+	      DO 300 idim = 1, nferdims
+	         IF ( cx_lo_ss( cx, idim ) .EQ. unspecified_int4 ) THEN
+		    IF ( CGRID_AXIS(idim,cx) .EQ. mnormal ) GOTO 300
+	            CALL FLESH_OUT_AXIS( idim, cx, status )
+	            IF ( status .NE. ferr_ok ) GOTO 5000
+	      	    look_again = .TRUE.
+	         ENDIF
+ 300	      CONTINUE
+	      IF ( look_again ) THEN
+* ...         check again in memory - maybe we already have it after all
+	         CALL FIND_MEM_VAR( cx, mr, search_by_value )
+	         IF ( mr .GT. mr_nonexist ) THEN
+* ...            yes - already in memory ... worth the trouble
+	            is_mr( isp ) = mr
+	            GOTO 2000					! pop stack
+	         ENDIF
+	      ENDIF
+	   
+* ... check to see if any axes need reversal
+	      IF ( TM_AXES_REVERSED(var,rev_axes) .GT. 0 ) THEN
+	         CALL IS_STRIP( isact_class_reverse, 1, *10, status )
+	         GOTO 5000
+	      ENDIF
+	   ENDIF
+
+	   CALL IS_READ( memory, *10, *2000, status )
+	   GOTO 5000
+
+* ... get a python static variable ?
+        ELSEIF ( cat .EQ. cat_pystat_var ) THEN
+           CALL IS_PYSTAT_VAR(memory, *10, *2000, status)
+           GOTO 5000
+
+* ... calculate from internal model-diagnostic code ?
+	ELSEIF ( cat .EQ. cat_calc_var	) THEN
+	   CALL IS_CALC   ( memory, *10, *2000, status )
+	   GOTO 5000
+
+* ... get a "constant variable" (say, "{1,3,5}")
+	ELSEIF ( cat .EQ. cat_const_var	) THEN
+	   CALL IS_CONST_VAR   ( memory, *10, *2000, status )
+	   GOTO 5000
+
+* ... get a string in qouble quotes
+	ELSEIF ( cat .EQ. cat_string	) THEN
+	   CALL IS_STRING   ( memory, *10, *2000, status )
+	   GOTO 5000
+
+* ... get an attribute value
+	ELSEIF ( cat .EQ. cat_attrib_val ) THEN
+	   CALL IS_ATTRIB_VAL   ( memory, *10, *2000, status )
+	   GOTO 5000
+
+* ... get a counter variable
+c	ELSEIF ( cat .EQ. cat_counter_var ) THEN
+c	   CALL IS_COUNTER_VAR   ( var, memory, *10, *2000, status )
+c	   GOTO 5000
+
+	ELSE
+	   STOP 'is_unkn_object'
+	ENDIF
+
+******************************************************************************
+* * * * * * POP THE STACK - A REQUESTED GRID HAS JUST BEEN OBTAINED * * * * *
+******************************************************************************
+* a ready-to-use-component has been found/created/read/etc.
+* it will now be flagged as a component of a higher level operation
+* if it has just been created it is not on the delete chain so just set
+* its protection with one claim of "in-use".
+* (9/99) when evaluating the SAMPLEI function, the intermediate result
+* returned here might be a temporary variable. If so, leave it alone
+ 2000	mr = is_mr( isp )
+	IF ( mr_protected(mr) .EQ. mr_temporary ) THEN
+	   CONTINUE	! 9/99 - container result for SAMPLE* function
+	ELSEIF ( mr_protected(mr) .EQ. mr_in_progress ) THEN
+	   mr_protected(mr) = mr_not_protected + 1
+	ELSEIF ( mr_protected(mr) .NE. mr_perm_protected ) THEN
+	   CALL MR_IN_USE( mr )
+	ENDIF
+
+* check for asychronous interrupt received
+	IF (interrupted) CALL ERRMSG( ferr_interrupt,status,' ',*5000 )
+
+
+* DONE ?
+ 2120	IF     ( isp .LT. isp_base ) THEN
+* ... yes - but with a serious error
+	   STOP 'isp_undfl'	! IS stack underflowed
+	ELSEIF ( isp .EQ. isp_base ) THEN
+* ... yes - clean up and go home
+	   CALL RELEASE_WORK_SPC
+	   RETURN
+	ELSE
+*    ... since the stack activity at this level is now completed it contains a
+*	 component that is needed by the next lower level.  Change its activity
+*	 to reflect its belonging to the lower level (needed when an algebraic
+*	 operation needs multiple components so at each component isp level
+*	 the "action" is still algebra after the component is obtained)
+	   act = is_act( isp - 1 )
+	   is_act( isp ) = act
+	   isp = isp - 1
+
+* ... not done - go back for more
+
+******************************************************************************
+* * * * * PERFORM TRANSFORMATIONS, ARITHMETIC, RE-GRIDDING, ETC. * * * * * *
+******************************************************************************
+	   IF     ( act .EQ. isact_request		) THEN
+	      GOTO 10					! grid just obtained
+	   ELSEIF ( act .EQ. isact_reconcile		) THEN
+	      CALL IS_RECONCILE( memory, *10, *2500, status ) ! 11/95
+	   ELSEIF ( act .EQ. isact_calculate		) THEN
+	      CALL IS_CALC   ( memory, *10, *2500, status ) ! temp ?? needed ?
+	   ELSEIF ( act .EQ. isact_algebra		) THEN
+	      CALL IS_ALGEBRA( memory, *10, *2500, isp_base, status )
+	   ELSEIF ( act .EQ. isact_modulo		) THEN
+	      CALL IS_MODULO( memory, *10, *2500, status )     ! 12/94
+	   ELSEIF ( act .EQ. isact_subspan_fill		) THEN
+	      CALL IS_SUBSPAN_FILL( memory, *10, *2500, status )! 7/02
+	   ELSEIF ( act .EQ. isact_reverse		) THEN
+	      CALL IS_REVERSE( memory, *10, *2500, status )     ! 2/95
+	   ELSEIF ( act .EQ. isact_gather		) THEN
+	      CALL IS_GATHER( memory, *10, *2500, status )
+	   ELSEIF ( act .EQ. isact_aggregate_gather	) THEN
+	      CALL IS_AGGREGATE_GATHER( memory, *10, *2500, status )
+	   ELSEIF ( act .EQ. isact_sample		) THEN
+	      CALL IS_SAMPLE( memory, *10, *2500, status )
+	   ELSEIF ( act .EQ. isact_interp		) THEN
+	      CALL IS_TRANS( memory, DO_INTERPOLATE, *2500, status )
+	   ELSEIF ( act .EQ. isact_average		) THEN
+	      CALL IS_TRANS( memory, DO_AVERAGE, *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_ave		) THEN	! 7/96
+	      CALL IS_TRANS( memory, DO_4D_AVE, *2500, status )
+	   ELSEIF ( act .EQ. isact_integ_def		) THEN	! 7/96
+	      CALL IS_TRANS( memory, DO_INTEG_DEF, *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_int_def		) THEN
+	      CALL IS_TRANS( memory, DO_4D_INT_DEF, *2500, status )
+	   ELSEIF ( act .EQ. isact_shift		) THEN
+	      CALL IS_TRANS( memory, DO_SHIFT, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_box		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_BOX, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_binml		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_BINML, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_hanng		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_HANNG, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_max		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_MAX, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_median		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_MEDIAN, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_min		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_MIN, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_parzn		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_PARZN, *2500, status )
+	   ELSEIF ( act .EQ. isact_smth_welch		) THEN
+	      CALL IS_TRANS( memory, DO_SMTH_WELCH, *2500, status )
+	   ELSEIF ( act .EQ. isact_fill_ave		) THEN
+	      CALL IS_TRANS( memory, DO_FILL_AVE, *2500, status )
+	   ELSEIF ( act .EQ. isact_fill_interp		) THEN
+	      CALL IS_TRANS( memory, DO_FILL_INTERP, *2500, status )
+	   ELSEIF ( act .EQ. isact_fill_near		) THEN
+	      CALL IS_TRANS( memory, DO_FILL_NEAR, *2500, status )
+	   ELSEIF ( act .EQ. isact_deriv_fwrd		) THEN
+	      CALL IS_TRANS( memory, DO_DERIV_FRWD, *2500, status )
+	   ELSEIF ( act .EQ. isact_deriv_cntr		) THEN
+	      CALL IS_TRANS( memory, DO_DERIV_CNTR, *2500, status )
+	   ELSEIF ( act .EQ. isact_deriv_bkwd		) THEN
+	      CALL IS_TRANS( memory, DO_DERIV_BKWD, *2500, status )
+	   ELSEIF ( act .EQ. isact_min			) THEN
+	      CALL IS_TRANS( memory, DO_MIN, *2500, status )
+	   ELSEIF ( act .EQ. isact_max			) THEN
+	      CALL IS_TRANS( memory, DO_MAX, *2500, status )
+	   ELSEIF ( act .EQ. isact_integ_indef		) THEN
+	      CALL IS_TRANS( memory, DO_INT_INDEF, *2500, status )
+	   ELSEIF ( act .EQ. isact_locate		) THEN
+	      CALL IS_TRANS( memory, DO_LOCATE, *2500, status )
+	   ELSEIF ( act .EQ. isact_sum  		) THEN
+	      CALL IS_TRANS( memory, DO_SUM, *2500, status )
+	   ELSEIF ( act .EQ. isact_run_sum		) THEN
+	      CALL IS_TRANS( memory, DO_RUN_SUM, *2500, status )
+	   ELSEIF ( act .EQ. isact_variance		) THEN
+	      CALL IS_TRANS( memory, DO_VARIANCE, *2500, status )
+	   ELSEIF ( act .EQ. isact_std_dev		) THEN
+	      CALL IS_TRANS( memory, DO_STDDEV, *2500, status )
+	   ELSEIF ( act .EQ. isact_good_pt		) THEN
+	      CALL IS_TRANS( memory, DO_NGOOD, *2500, status )
+	   ELSEIF ( act .EQ. isact_bad_pt		) THEN
+	      CALL IS_TRANS( memory, DO_NBAD, *2500, status )
+	   ELSEIF ( act .EQ. isact_wgted_eq		) THEN
+	      CALL IS_TRANS( memory, DO_DIST_LOC, *2500, status )
+	   ELSEIF ( act .EQ. isact_regrid		) THEN
+	      CALL IS_REGRID( memory, *2500, status )
+	   ELSEIF ( act .EQ. isact_auxvar_regrid
+     .         .OR. act .EQ. isact_aux_plot_vars	) THEN
+	      CALL IS_AUXVAR_REGRID( memory, *10, *2500, status )
+	   ELSEIF ( act .EQ. isact_autogrid		) THEN
+	      CALL IS_AUTOGRID( *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_var		) THEN	! 7/96
+	      CALL IS_TRANS( memory, DO_4D_VAR, *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_good_pt		) THEN	! 7/96
+	      CALL IS_TRANS( memory, DO_4D_NGD, *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_bad_pt		) THEN	! 7/96
+	      CALL IS_TRANS( memory, DO_4D_NBD, *2500, status )
+	   ELSEIF ( act .EQ. isact_4d_sum		) THEN	! 11/10
+	      CALL IS_TRANS( memory, DO_4D_SUM, *2500, status )
+	   ELSEIF ( act .EQ. isact_nrst_dist_abv	) THEN	! 9/97
+	      CALL IS_TRANS( memory, DO_NEAREST_DIST_ABOVE, *2500, status )
+	   ELSEIF ( act .EQ. isact_nrst_dist_blw	) THEN	! 9/97
+	      CALL IS_TRANS( memory, DO_NEAREST_DIST_BELOW, *2500, status )
+	   ELSEIF ( act .EQ. isact_nrst_indx_abv	) THEN	! 9/97
+	      CALL IS_TRANS( memory, DO_NEAREST_INDEX_ABOVE, *2500, status )
+	   ELSEIF ( act .EQ. isact_nrst_indx_blw	) THEN	! 9/97
+	      CALL IS_TRANS( memory, DO_NEAREST_INDEX_BELOW, *2500, status )
+	   ELSEIF ( act .EQ. isact_event_mask		) THEN	! 6/01
+	      CALL IS_TRANS( memory, DO_EVENT, *2500, status )
+	   ELSEIF ( act .EQ. isact_read			) THEN
+	      WRITE (6,*) 'Tell FERRET programmer to check INTERP_STACK'
+* ...	      could set "cat" and branch to above IS_READ
+	      CALL IS_READ( memory, *10, *2000, status )    ! temp ?? needed ?
+	   ELSE
+              CALL ERRMSG( ferr_internal, status,
+     .             'unknown transform', *5000 )
+	   ENDIF
+	   GOTO 5000		! error performing operation
+	ENDIF
+
+* 11/95 detour
+* A result has just been obtained from a component.
+* If the component was non-reusable then so is the result
+* NOTE: this is not a complete check for inheritance of non-reusable results!!
+*	- multiple components may have been used (e.g. IS_DO_OP)
+*	- multiple results may have been computed (e.g. FFT's)
+* Those special cases must be tracked inside the computing routines 
+ 2500	mr     = is_mr( isp )	! result (output)
+	com_mr = is_mr( isp+1)	! component (input)
+* ...  even if com_mr is wrong it doesn't cause trouble
+	IF ( ITS_UN_CACHED( com_mr ) ) CALL UN_CACHE( mr )
+	GOTO 2000
+
+* error exit - clean up
+ 5000	CALL RELEASE_WORK_SPC
+	CALL DELETE_MRS_IN_PROGRESS
+	CALL UNPROTECT_ALL_MRS
+	CALL DEALLO_ALL_GRIDS
+        CALL CLEAN_STACK
+	RETURN
+	END
diff --git a/fer/stk/is_aggregate_gather.F b/fer/stk/is_aggregate_gather.F
new file mode 100644
index 0000000..42c44bd
--- /dev/null
+++ b/fer/stk/is_aggregate_gather.F
@@ -0,0 +1,195 @@
+	SUBROUTINE IS_AGGREGATE_GATHER( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* bring together a full data grid from an aggregate defined with DEFINE DATA/AGGREGATE 
+* by requesting the members one by one on the interpretation stack
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another member ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for gathering )
+
+* internal variable declarations:
+	LOGICAL	NC_GET_ATTRIB, attoutflag, got_it
+	INTEGER NCF_GET_ATTR_FROM_ID,
+     .		com_mr, res_mr, com_cx, res_cx,	dflt_cx, com_isp, res_isp,
+     .		frag, idim, top, imemb, memb_dset, len, igrid, iline,
+     .		varid, attlen, maxlen, fer_uvar, nv
+	REAL	vbad
+	CHARACTER*128 VAR_CODE, vname
+	CHARACTER*10 buff
+
+* --- end of introductory code ---
+
+* initialize
+	res_isp    = isp
+	com_isp    = isp + 1
+	res_mr     = is_mr( res_isp )
+	com_mr     = is_mr( com_isp )
+	res_cx     = is_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	dflt_cx	   = is_big_cx( res_isp )
+	idim       = is_axis( res_isp )
+	frag	   = is_sum ( res_isp )
+
+* diagnostic mode output: " doing aggregate gather VAR_NAME[x=lo:hi at TRN:n,D=#]"
+* Put in the M index value just for this output
+
+	IF ( mode_diagnostic ) THEN
+	   cx_lo_ss( com_cx,idim ) = is_phase(isp)
+	   cx_hi_ss( com_cx,idim ) = is_phase(isp)
+	   CALL DIAG_OP
+     .				( 'doing',isact_class_aggregate_gather, com_cx, idim )
+	   cx_lo_ss( com_cx,idim ) = unspecified_int4
+	   cx_hi_ss( com_cx,idim ) = unspecified_int4
+	ENDIF
+
+* create context and mem. res. space if this is the first component recieved
+	IF ( res_mr .EQ. unspecified_int4 ) THEN
+* ... use gathering axis, category, grid and dataset from dflt_cx (aggregate
+* ... variable, datset and grid), and everything else from component
+* ... (since all else may be altered during evaluation if its a user var)
+	   CALL TRANSFER_CONTEXT( com_cx, res_cx )
+
+	   CALL TRANSFER_AXIS( idim, dflt_cx, res_cx )
+	   cx_grid(res_cx) = cx_grid(dflt_cx)
+	   cx_data_set(res_cx) = cx_data_set(dflt_cx)
+	   cx_bad_data(res_cx) = cx_bad_data(dflt_cx)
+	   cx_category(res_cx) = cx_category(dflt_cx)
+
+	   CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_mr( res_isp ) = res_mr
+	ENDIF
+
+* copy data just received into the result
+	CALL COPY_AGG_INTO( memory(1,mr_blk1(com_mr)), com_mr, com_cx,
+     .			memory(1,mr_blk1(res_mr)), res_mr, is_phase(isp) )
+
+* ... remove the component protection that signaled we needed it here
+	CALL MR_NOT_IN_USE( com_mr )
+
+* are we done ?
+	IF ( is_phase(isp) .EQ. is_sum(isp) ) THEN
+* ... yes - pop com_cx and dflt_cx from context stack
+
+	   IF ( dflt_cx .NE. cx_stack_ptr ) STOP 'AGG_GATH_STK_ERR'	! temp
+
+	   cx_stack_ptr = cx_stack_ptr - 2
+	   RETURN 2
+	ENDIF
+
+* no - set up com_cx to get the next aggregate member
+	is_phase(res_isp) = is_phase(res_isp) + 1
+	CALL TRANSFER_CONTEXT( dflt_cx, com_cx )
+* Set limits on e-direction to be unspecified
+ 
+	cx_lo_ss( com_cx,idim ) = unspecified_int4
+	cx_hi_ss( com_cx,idim ) = unspecified_int4
+	cx_by_ss( idim,com_cx) = .TRUE.
+
+* Set the grid to the grid of the next aggregate component...
+
+	imemb = is_phase(res_isp)
+
+	vname = VAR_CODE (cat_file_var, cx_variable(com_cx))
+	CALL CD_GET_AGG_VAR_INFO (cx_data_set(com_cx), vname, imemb, 
+     .      fer_uvar, memb_dset, igrid, iline, nv, status)
+
+* Grid wasnt stored for this variable if its a LET/D variable in member dset
+* Let it be the agg grid ?? (or could set the grid to a number less than 
+* unspecified_int4 to call get_uvar_grid for this LET/D member var)
+
+	IF (igrid .EQ. unspecified_int4) THEN 
+	   cx_data_set(com_cx) = memb_dset
+	   cx_category(com_cx) = cat_user_var
+	   cx_variable(com_cx) = nv
+	ELSE
+
+	   CALL CD_GET_VAR_ID (memb_dset, vname, varid, status)
+	   maxlen = 1
+	   got_it = NC_GET_ATTRIB( memb_dset, varid, 'missing_value',
+     .                .FALSE., vname, maxlen, attlen,
+     .                attoutflag, buff, vbad )
+           IF (.NOT.got_it) vbad = bad_val4
+
+	   cx_grid( com_cx ) = igrid
+	   cx_data_set(com_cx) = memb_dset
+
+	   IF (fer_uvar .EQ. 3) THEN
+	      cx_category(com_cx) = cat_user_var  
+	      cx_bad_data(com_cx) = cx_bad_data(dflt_cx)
+	   ELSE
+	      cx_category(com_cx) = cat_file_var 
+	      cx_bad_data(com_cx) = vbad
+	   ENDIF
+
+
+	   CALL FLESH_OUT_AXIS( idim, com_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF  ! or end this above flesh_out??
+	
+	is_uvar(com_isp) = cx_variable(com_cx)
+
+* push the interpretation stack and go get it
+	isp = com_isp
+	status = ferr_ok
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_aggregate_grid.F b/fer/stk/is_aggregate_grid.F
new file mode 100644
index 0000000..26c4b52
--- /dev/null
+++ b/fer/stk/is_aggregate_grid.F
@@ -0,0 +1,281 @@
+	SUBROUTINE IS_AGGREGATE_GRID(uvar, dset, cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* examine members of an aggregate datset, getting grids for 
+* elements that are user-defined (LET/D) variables. Use the 
+* interpretation stack in order to determine a defining grid for the
+* overall aggregate dataset.
+* Detailed description of the underlying logic is in MERGE_CONTEXT
+* Note: When pseudo-variables are used (eg. LIST U/Z[K=1:3]) the grids for them
+*	may not be known until all other components are examined.  In this
+*	case a 2nd pass is required
+
+* programmer - Ansley Mankek (from is_uvar_grid)
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* V6.83 *acm* 11/30/2012 If variable isn't a file variable, get the right definition.
+
+* V685  4/13 *acm* Better grid handling.
+* V685 10/13 *acm* Fix ticket 1098, error defining ensemble when LET/D variables are present.
+
+* calling argument declarations:
+* uvar and dset point to the variable in the aggregate dataset
+* And cx_orig points to the context for that variable.
+
+	INTEGER	uvar, dset, cx, status
+
+* internal variable declarations:
+	LOGICAL its_dynamic
+	INTEGER NCF_GET_AGG_COUNT, TM_LENSTR1, STR_SAME, KNOWN_GRID,
+     .		cx_orig, agg_cx, hi_cx, big_cx, isp_orig, agg_dset, 
+     .		agg_len, imemb, fer_uvar, memb_dset, memb_grid, iline, 
+     .		nv, test_grid, this_grid, len_name, agg_dim, gnum, var,
+     .		varid, idim, i, igrid, lo_cx, slen
+
+	CHARACTER vname*512, buff*512, nm*3
+
+#include "netcdf.inc"
+	include	'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xfr_grid.cmn'
+	include	'xdset_parms.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level to get grids for components
+*	 isp	<--	current level: evaluate user-variable grid
+
+* --- end of introductory code ---
+
+* initialize
+
+	agg_dim = e_dim
+	test_grid = unspecified_int4
+
+	agg_dset = dset
+	status = NCF_GET_AGG_COUNT (agg_dset, agg_len)
+
+	agg_cx = cx
+
+	vname = uvar_text(uvar)
+	len_name = TM_LENSTR1(vname)
+
+* are we pointing at a "LET var = [some expr with an agg var]"
+* If so then the vname is not in the agg dset. Find the 
+* var in the list of uvar_code, and get the right uvar_text
+* (this is a hack, something is wrong with my stack handling)
+
+	CALL CD_GET_VAR_ID (agg_dset, vname, varid, status)
+	IF (status .NE. ferr_ok) THEN 
+	   DO 30, i = uvar, 1, -1
+ 	      IF (STR_SAME(vname, uvar_name_code(i)) .EQ. 0) THEN
+	         vname =  uvar_text(i)
+	         len_name = TM_LENSTR1(vname)
+	         CALL CD_GET_VAR_ID (agg_dset, vname, varid, status)
+	         IF (status .NE. ferr_ok) GOTO 5010 
+	         GOTO 40
+               ENDIF
+   30	   CONTINUE
+	   GOTO 5010 
+   40	   CONTINUE
+	ENDIF
+
+	DO 90 imemb = 1, agg_len
+
+* See if the previous two members have matching grids (except for ensemble direction)
+	   IF (test_grid.NE.unspecified_int4 .AND. test_grid.NE.this_grid) THEN
+	      DO 80 idim = 1, nferdims
+	         IF ( (idim .NE. agg_dim) .AND. 
+     .	              (grid_line(idim,this_grid) .NE. grid_line(idim,test_grid)) ) GOTO 5300
+
+   80	      CONTINUE
+	   ENDIF
+
+	   CALL CD_GET_AGG_VAR_INFO (agg_dset, vname, imemb, 
+     .         fer_uvar, memb_dset, memb_grid, iline, nv, status)
+	   IF (fer_uvar .EQ. cat_user_var .AND. memb_grid .EQ. unspecified_int4) 
+     .           memb_grid = KNOWN_GRID(memb_dset, cat_user_var, nv) 
+	   IF (memb_grid .NE. unspecified_int4) THEN
+	      test_grid = memb_grid
+	      this_grid = memb_grid
+	      GOTO 90
+	   ENDIF
+
+* Get ready to call is_uvar_grid. 
+* pre-load the variable info onto the CX stack
+
+	   cx_orig = cx_stack_ptr
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   lo_cx  = is_cx( isp )
+	   hi_cx = cx_stack_ptr
+	   CALL GET_VAR_CONTEXT (  vname(:len_name),
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+
+	   cx_data_set(hi_cx) = memb_dset
+	   cx_grid(hi_cx) = memb_grid
+	   cx_variable(hi_cx) = nv
+	   cx_category(hi_cx) = cat_user_var
+
+* pre-load the variable info onto the IS stack
+	   isp_orig = isp
+	   CALL PUSH_INTERP_STACK( isp, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_cx   ( isp ) = hi_cx
+	   is_uvar ( isp ) = nv
+	   is_act  ( isp ) = isact_get_grid
+
+* initialize the stacks - (repeated for each component)
+
+ 100	   CALL IS_GRID_MODE( status )
+           hi_cx = is_big_cx(isp) + 1  ! ???
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* evaluate the grid by merging component grids
+*  ... exit 100 is to evaluate the grid for a component uvar
+*  ... exit 300 means that a grid has been obtained
+*  ... "normal" return indicates an error has occurred
+ 200	   CALL IS_UVAR_GRID( *100, *300, status )
+	   GOTO 5000
+
+* a grid has been obtained.  Are we done ?
+ 300	   IF ( isp .EQ. isp_orig ) THEN
+* ... yes - clean up and go home
+              this_grid = cx_grid(hi_cx) 
+	      IF ( cx_stack_ptr .NE. cx_orig ) WRITE (6,*) 'agg_v_gd'	! temp
+	      GOTO 90
+	   ELSE
+* ... no - go back for more
+	      GOTO 200
+	   ENDIF
+
+ 90	CONTINUE
+
+* Test that the grids match for the last aggregate member (except for ensemble direction)
+
+	IF (test_grid.NE.unspecified_int4 .AND. test_grid.NE.this_grid) THEN
+	   DO 180 idim = 1, nferdims
+	      IF ( (idim .NE. agg_dim) .AND. 
+     .	           (grid_line(idim,this_grid) .NE. grid_line(idim,test_grid)) ) GOTO 5300
+ 180	CONTINUE
+	ENDIF
+
+* Define the aggregrate grid here. Need a new context?  Should this be done when
+* we get back to is_uvar_grid?
+
+	big_cx = is_big_cx( isp )
+	
+	igrid = cx_grid(big_cx)
+	DO 400 idim = 1, nferdims
+	   grid_line(idim, igrid) = grid_line(idim,test_grid)
+  400	CONTINUE
+	grid_line(agg_dim, igrid) = iline
+
+* catalog this result checking for matching previously existing grid
+	CALL TM_GET_LIKE_DYN_GRID(igrid, its_dynamic, gnum, 
+     .				grd_stk_ptr, status ) 
+
+* set context for aggregate grid
+	cx_grid(agg_cx) = gnum
+	uvar_grid( uvar, dset ) = gnum 
+
+	cx_grid(agg_cx) = gnum
+	cx_data_set(agg_cx) = agg_dset
+	cx_category(agg_cx) = cat_aggregate_var
+
+	uvar_grid( uvar, dset ) = gnum 
+	uvar_dset( uvar ) = dset
+	uvar_need_dset( uvar ) = .TRUE.
+
+	var = cx_variable(agg_cx)
+	ds_grid_number(var) = gnum 
+
+* Get ds_grid_start, ds_grid_end, ds_ordering from the last file variable
+
+	IF (test_grid .NE. unspecified_int4) THEN
+	   DO 720 nv = 1, maxvars
+	       IF (ds_grid_number(nv) .EQ. test_grid)  GOTO 725
+ 720	   CONTINUE
+ 725	   CONTINUE
+        ENDIF
+
+	IF (nv .GT. maxvars) GOTO 5010
+
+        DO 730 idim = 1, nferdims
+	   ds_grid_start(idim,var)= ds_grid_start(idim,nv)
+	   ds_grid_end(idim,var)  = ds_grid_end(idim,nv)
+	   ds_ordering(idim,var)  = ds_ordering(idim,nv)
+ 730	CONTINUE
+        ds_ordering(agg_dim,var) = agg_dim
+        ds_grid_start(agg_dim,var) = 1
+        ds_grid_end(agg_dim,var) = line_dim(iline)
+
+	is_cx(isp) = agg_cx
+	is_uvar ( isp ) = uvar
+
+* Now we have the grid for the variable in the agg. dataset. Store the grid 
+* number for future use.
+
+CC dont think this is right. should be the MEMBER grids not the aggregate var grid.
+	DO 800 imemb = 1, agg_len
+	   CALL CD_PUT_AGG_MEMB_GRID (agg_dset, vname, imemb, gnum, status)
+ 800	CONTINUE
+
+	RETURN
+
+* error exit
+ 5000	CALL DEALLO_ALL_GRIDS
+	RETURN
+ 5300	CALL ERRMSG( ferr_aggregate_error, status,
+     .   'grids for LET/D variables do not match for aggregate dataset'
+     .   //vname,*5000 )
+ 5010	vname = uvar_text(uvar)
+	CALL ERRMSG( ferr_aggregate_error, status,
+     .   'error defining grid for variable in aggregate dataset'
+     .   //vname,*5000 )
+
+	END	
diff --git a/fer/stk/is_algebra.F b/fer/stk/is_algebra.F
new file mode 100644
index 0000000..557278c
--- /dev/null
+++ b/fer/stk/is_algebra.F
@@ -0,0 +1,945 @@
+	SUBROUTINE IS_ALGEBRA( memory, *, *, isp_base, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* evaluate an algebraic evpression component by component on the 
+* interpretation stack.  When component variables are required request them
+* by return to the top of the stack processor in "request" mode (RETURN 1).
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/12/87
+* revision 0.1 - 6/ 3/87 - corrected 'alg_stk_err' in "LIST 1"
+* revision 0.2 - 7/28/87 - changed method of constant evaluation to be like
+*			   vars and pseudo-vars in order to avoid stack errors
+*			   from constants left on stack when this subr. exits
+* revision 0.2a- 8/29/87 - context stack bug for norm trans of constant
+* V200:  6/20/89 - 4D symmetric version, numerous changes
+*	11/29/89 - include constants and pseudo-variables on context merges
+* V312:  5/94 - array "memory" as a calling argument
+* V420:  9/95 - deallocate dynamic grid (if any) at cleanup time
+* V450:  1/97 - process alg_child_var and alg_grid_chg_fcn
+*        7/97 - generate child var name using GCF_PARENT_UVAR
+* V491   3/98 - sgi benchmarking uncovered bug in psuedo_variable processing - 
+*               no valid "name" was being set up   *kob/sh*
+*        4/98 - pass default context (lo_cx) to MERGE_CONTEXT *jc*
+* V500: 12/98 *sh* - add cat_const_var (like "{1,3,5}")
+*	 1/99 *sh* - add cat_string -- temporarily do not allow A="string"
+*	 3/99 *sh* - bug fix in context passing to GC args
+*		default cx must contain grid before call to
+*		GCF_IMPOSE_ARG_LIM_DFLTS  - so it can check if arg
+*		axes match result for (say) RESHAPE
+*		This requires a "2-pass" approach ("ugly hack", below).
+*	3/99 *sh* ==> NOT IMPLEMENTER (see "3/99" below)
+*		call TRANSFER_CONTEXT(big_cx, lo_cx) at end of
+*		EXPLICIT_UVAR, too, since changes to handling unspecified
+*		limits (see COMPLETE_MISSING_LIMITS)
+* V510: 8/99 *sh* - added SAMPLE*. Logic in this routine is because the
+*		2nd arg to SAMPLE* controls the request for the 1st --
+*		here we detect that, interchange the ordering, and
+*		call IS_SAMPLE for arg 1 (Note: would have been much simpler
+*		if arg order was reversed, but the function already existed
+*	10/99 *sh* repair of bug introduced by 3/99 change for RESHABE, above
+*		see "ugly hack" in code
+*	1/00 *sh* error check bug corrected for GC functions (esp. RESHAPE) 
+*	1/00 *sh* naming bug corrected for nested GC functions
+*	2/00 *sh* bug in check for SAMPLE finctions -- use nitem not "3"
+*	3/00 *sh* bug in ERRMSG call at 5900 - extra comma in args
+* V510: 5/00 *sh* - set bad flag on user variables
+*	5/00 *sh* - bug fix: ifcn not init'ed in time for MERGE_CONTEXT(big_cx)
+* V530: 8/00 *sh* - added support for string arrays
+*	12/00 *sh* bug fix: constants as in LET a = 5 were not deleted -- they
+*		accumulated and used up mvars -- err522_too_many_vars.jnl
+* V533: 7/01 *sh* - added support for functions returning different data types
+*		  - alg_no_op removed to allow string IF-THEN-ELSE exprns
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+*                   (variables are up to 128, so **name** needs extra space
+*                   i.e. for a transformation specifier)
+* v554: 1/04 *acm* Counter variables for REPEAT/RANGE=/NAME=
+* V600 8/05 *acm* - Add variable type attrib_val for definitions of the form
+*                   varname.attname
+* v664 9/10 *acm* Check variables for NaN and replace (unless the bad-value IS NaN
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#include "netcdf.inc"
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'grid_chg_fcns.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+        include 'xcontrol.cmn'
+        include 'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	isp_base, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+* internal variable declarations:
+	LOGICAL	EXPLICIT_UVAR, ITSA_GCVAR, NC_GET_ATTRIB, 
+     .          its_gc, its_sample, start_sampling, got_it, coordvar,
+     .          reset_ss, do_err
+	INTEGER KNOWN_GRID, TM_LENSTR1, GCF_PARENT_UVAR, GCF_PARENT_CHAR,
+     .		GCF_FIND_FCN, GCF_ARG_EVAL_ORDER, GET_VAR_GRID,
+     .		MGRID_SIZE, STR_SAME, hi_mr, hi_cx, lo_cx, big_cx,
+     .		dflt_cx, start, end, saved_grid, ifcn, size,
+     .		dset, lo_isp, uvar, item, itype, idim,
+     .		nitem, new_mr, len_name, idig, csp1, cat, cvar, 
+     .          varid, attlen, attype, maxlen, attoutflag,
+     .          ndims, nvars, ngatts, recdim, ivar, vartype, 
+     .          nvdims, vdims(8), nvatts, nv, iatt, all_outflag, dot,
+     .          attid, slen
+        REAL    counter_const, val
+
+	CHARACTER TM_FMT*150, name*150, attname*128, aname*128, buff*10
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of next activity ( component to get )
+*	 isp	<--	... ( current stack level )
+*	isp-1		...
+*	isp-2	<--	...	components of this uvar on stack
+*	isp-n		...
+*	lo_isp	<--	level controlling evaluation of uvar
+
+* --- end of introductory code ---
+
+* test to see if first time called - designate stack activity as algebra
+	IF ( is_act(isp) .EQ. isact_request ) THEN
+	   lo_isp = isp
+	   is_phase( lo_isp ) = 0
+	   is_act  ( lo_isp ) = isact_algebra
+	ELSE
+	   isp = isp + 1			! point to component just got
+	   lo_isp = is_obj( isp )
+	   hi_cx  = is_cx( isp )
+	ENDIF
+
+* convenience values
+	lo_cx  = is_cx( lo_isp )
+	big_cx = is_big_cx( lo_isp )
+	uvar   = is_uvar( lo_isp )
+	nitem  = uvar_num_items( uvar )
+	dset   = cx_data_set( lo_cx )
+
+* is it a grid-changing variable?
+	its_gc = ITSA_GCVAR(uvar)
+	IF ( its_gc ) THEN
+	   start = uvar_item_start( nitem, uvar )  ! nitem has the fcn itself
+	   end   = uvar_item_end  ( nitem, uvar )
+	   ifcn = GCF_FIND_FCN( uvar_text(uvar)(start:end) )
+	ENDIF
+
+* create, initialize or merge overall context for the algebraic expression
+	IF ( is_phase(lo_isp) .EQ. 0 ) THEN
+	   cx_grid( lo_cx ) = KNOWN_GRID( dset ,cat_user_var, uvar )
+	   IF ( mode_diagnostic )
+     .			CALL DIAGNOSTIC_OUT( 'eval   ', lo_cx, point_to_cx )
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   big_cx = cx_stack_ptr
+	   CALL INIT_EMPTY_CONTEXT( big_cx)  ! moved from below 8/00 *sh*
+	   is_big_cx( lo_isp ) = big_cx
+	   is_sum   ( lo_isp ) = isalg_transfer
+!	ELSEIF ( cx_category( hi_cx ) .EQ. cat_constant
+!     .	   .OR. ( cx_category(hi_cx) .EQ. cat_pseudo_var
+!     .		  .AND. .NOT.cx_unstand_grid(hi_cx)      )  ) THEN
+!	   GOTO 100		! can't construct a context from these
+
+* 1/97 - need a somewhat separate path through the merging of contexts when
+*	dealing with grid changing variables. For non-grid-changing vars
+*	we may have "LIST A", inwhich case the merged context needs to look
+*	just like "A". For grid-changing variables this can never occur, since
+*	they are always of the form GCFUNC(arg1, arg2, ...), but it is not
+*	safe to begin the merging with TRANSFER_CONTEXT because the first
+*	arg may be designated not to contribute all of its axes to the merged
+*	result 
+	ELSEIF ( its_gc ) THEN
+	   IF ( is_sum(lo_isp) .EQ. isalg_transfer ) THEN
+	      CALL MERGIFY_CX( lo_cx, uvar, big_cx, status )
+!	      cx_type(big_cx) = ptype_float   ! TEMPORARY - UNTIL STRNG FCNS
+	      is_sum( lo_isp ) = isalg_merge_1
+	   ELSEIF ( is_sum(lo_isp) .EQ. isalg_merge_1 ) THEN
+* ... this allows us to distinguish between single component and
+*	multi-component expressions. "LIST A" should document "A", not "E315"
+	      is_sum( lo_isp ) = isalg_merge_n
+	   ENDIF
+	   item = GCF_ARG_EVAL_ORDER( ifcn, is_phase(lo_isp) )
+	   itype = uvar_item_type ( item, uvar )
+	   start = uvar_item_start( item, uvar )
+	   end   = uvar_item_end  ( item, uvar )
+	   CALL MERGE_CONTEXT(	its_gc, item, lo_cx, big_cx, hi_cx,
+     .				uvar_text(uvar)(start:end), status )
+	   IF ( status .NE. ferr_ok ) RETURN
+
+* pre grid-changing code - 1st arg treated differently from others
+	ELSEIF ( is_sum(lo_isp) .EQ. isalg_transfer ) THEN
+	   CALL TRANSFER_CONTEXT( hi_cx, big_cx )
+	   is_sum( lo_isp ) = isalg_merge_1
+	ELSE
+	   IF (  is_sum(lo_isp) .EQ. isalg_merge_1 ) THEN
+	      CALL MERGIFY_CX( lo_cx, uvar, big_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+!	      cx_type(big_cx) = ptype_float   ! only GC vars allow strings (??)
+	      is_sum( lo_isp ) = isalg_merge_n
+	   ENDIF
+	   item = is_phase(lo_isp)		! points into uvar_text
+	   itype = uvar_item_type ( item, uvar )
+	   start = uvar_item_start( item, uvar )
+	   end   = uvar_item_end  ( item, uvar )
+	   CALL MERGE_CONTEXT( its_gc, item, lo_cx, big_cx, hi_cx,
+     .				uvar_text(uvar)(start:end), status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* is it a SAMPLE* function? (8/99)
+	IF ( its_gc ) THEN
+	   its_sample = ifcn .GE. p_samplei
+     .		.AND.   ifcn .LE. p_samplen
+	ELSE
+	   its_sample = .FALSE.
+	ENDIF
+	start_sampling = .FALSE.
+
+* ****** (continue) LOOP through expression ***********************************
+* process the next item in the expression from the uvar buffer
+ 100	is_phase(lo_isp) = is_phase(lo_isp) + 1
+	IF ( its_gc ) THEN
+	   item = GCF_ARG_EVAL_ORDER( ifcn, is_phase(lo_isp) )
+	ELSE
+	    item = is_phase(lo_isp)		! points into uvar_text
+	ENDIF
+	IF ( its_sample ) THEN		! kludge for SAMPLE*
+	   start_sampling = item .EQ. 1
+	ENDIF  
+	IF ( item .GT. nitem ) GOTO 1000
+	itype = uvar_item_type ( item, uvar )
+	start = uvar_item_start( item, uvar )
+	end   = uvar_item_end  ( item, uvar )
+	IF     ( itype .EQ. alg_constant   ) THEN
+	   GOTO 200
+	ELSEIF ( itype .EQ. alg_child_var   ) THEN
+	   GOTO 300
+	ELSEIF ( itype .EQ. alg_variable   ) THEN
+	   GOTO 305
+	ELSEIF ( itype .EQ. alg_pseudo_var ) THEN
+	   GOTO 400
+	ELSEIF ( itype .EQ. alg_function
+     .	    .OR. itype .EQ. alg_operator
+     .	    .OR. itype .EQ. alg_log_struct
+     .	    .OR. itype .EQ. alg_log_vstruct   ) THEN
+	   GOTO 500
+	ELSEIF ( itype .EQ. alg_grid_chg_fcn ) THEN
+	   GOTO 600
+	ELSEIF ( itype .EQ. alg_const_var ) THEN
+	   GOTO 700
+	ELSEIF ( itype .EQ. alg_attrib_val ) THEN
+	   GOTO 750
+        ELSEIF ( itype .EQ. alg_string ) THEN
+	   GOTO 800
+	ELSEIF ( itype .EQ. alg_if_marker
+     .	    .OR. itype .EQ. alg_then_marker ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_counter_var ) THEN
+	   GOTO 210
+	ELSE
+	   STOP 'unknown algebraic category'
+	ENDIF
+
+* constant - with possible transformations (eg. integrated --> 1[Z=1:100 at DIN])
+* ... allocate a context buffer 
+ 200	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	CALL CONSTANT_CONTEXT   ( uvar_text(uvar)(start:end),
+     .				  lo_cx,
+     .				  hi_cx,
+     .				  status )
+	IF ( status .NE. ferr_ok ) RETURN
+* ... request this constant on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	RETURN 1
+        
+* counter (REPEAT/RANGE=/NAME=)
+* ... allocate a context buffer, dummy constant value which is replaced
+* ... later when the counter is evaluated.
+ 210	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+        
+* as in cs_command 
+        
+        CALL find_var_name (dset, uvar_text(uvar)(start:end), cat, cvar)
+        csp1 = csp_cvar(cvar)
+	counter_const = cs_phase( csp1 ) - cs_delta( csp1 )
+        name = TM_FMT(counter_const, idig, 150, len_name)
+	CALL CONSTANT_CONTEXT   ( name,
+     .				  lo_cx,
+     .				  hi_cx,
+     .				  status )
+	IF ( status .NE. ferr_ok ) RETURN
+* ... request this constant on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	RETURN 1
+
+* child variable: treat it just like a regular variable except that 
+* its name is not found in the text. Instead generate its name from
+* its position and its parent variable
+* example: for the definition	LET A = 5 * GCFUNC(b,c)
+*    the string "GCFUNC(b,c)" is processed as a child variable
+ 300	CALL GCF_CHILD_VAR_NAME( GCF_PARENT_UVAR(uvar),
+     .				 GCF_PARENT_CHAR(uvar,start), name )
+	len_name = TM_LENSTR1(name)
+	GOTO 310
+
+* variable: parse name, update full expression context and evaluate
+* ... allocate a context buffer for components
+ 305	name = uvar_text(uvar)(start:end)
+	len_name = end - start + 1
+ 310	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	IF ( .NOT. its_gc ) THEN
+	   CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				   lo_cx,
+     .				   hi_cx,
+     .				   status )
+	   IF ( status .NE. ferr_ok ) RETURN
+
+	ELSE
+* ... for GC variables the default context may get modified before using it
+*     to get an argument (e.g. for a fcn equivalent to x=@sbx:5 we'd have
+*     LIST/I=5:10 XSBX5(b) requiring I=3:12 of argument "b".
+*     BUT: for RESHAPE the grid must already be known to guide this process 
+* ... ugly hack: temporarily insert grid into lo_cx
+	   saved_grid = cx_grid(lo_cx)
+	   cx_grid(lo_cx) = GET_VAR_GRID(name(:len_name),
+     .				         lo_cx,
+     .				         hi_cx,
+     .				         status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   dflt_cx = cx_stack_ptr
+	   CALL GCF_IMPOSE_ARG_LIM_DFLTS( name(:len_name), item,
+     .					  lo_cx, dflt_cx, uvar, status )
+	   IF (status .NE. ferr_ok) RETURN
+	   cx_grid(lo_cx) = saved_grid		! restore HACK
+	   CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				dflt_cx,
+     .				hi_cx,
+     .				status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   cx_stack_ptr = cx_stack_ptr - 1	! release dflt_cx
+	   IF (cx_has_impl_grid(hi_cx)) THEN	! 10/99
+	     CALL DEALLO_DYN_GRID(cx_grid(hi_cx))
+	   ENDIF
+	ENDIF
+* ... request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	IF ( cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... special action if this component variable is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+	IF ( start_sampling ) GOTO 900
+	RETURN 1
+
+* pseudo-variable: parse mods, update full expression context and evaluate
+* ... allocate a context buffer for components
+ 400	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	CALL PSEUDO_VAR_CONTEXT ( uvar_text(uvar)(start:end),
+     .				  lo_cx,
+     .				  hi_cx,
+     .				  idim,
+     .				  status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+	IF (its_gc ) THEN	! see explanation under "variable' (stmt 310)
+* ... ugly hack: temporarily insert grid into lo_cx
+	   saved_grid = cx_grid(lo_cx)
+	   cx_grid(lo_cx) = cx_grid(hi_cx)
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   dflt_cx = cx_stack_ptr
+* use uvar_text as name to pass to gcf_impose...*kob* 3/98
+	   CALL GCF_IMPOSE_ARG_LIM_DFLTS( uvar_text(uvar)(start:end), item,
+     .					  lo_cx, dflt_cx, uvar, status )
+	   IF (status .NE. ferr_ok) RETURN
+	   cx_grid(lo_cx) = saved_grid		! restore HACK
+	   CALL PSEUDO_VAR_CONTEXT ( uvar_text(uvar)(start:end),
+     .				  dflt_cx,
+     .				  hi_cx,
+     .				  idim,
+     .				  status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   cx_stack_ptr = cx_stack_ptr - 1	! release dflt_cx
+	ENDIF
+
+	IF ( cx_lo_ss(hi_cx,idim) .EQ. unspecified_int4 )  CALL ERRMSG
+     .		(ferr_dim_underspec, status,uvar_text(uvar)(start:end), *5000)
+! temp diag
+	IF ( cx_grid(hi_cx) .EQ. unspecified_int4 ) CALL ERRMSG
+     .			( ferr_internal, status, 'isalg_ps', *5000 )
+* ... request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	IF ( start_sampling ) GOTO 900
+	RETURN 1
+
+* function logic structure or operator:
+* ...compute new value replacing component(s) (if any) on stack
+* ...and changing variable protections appropriately
+* ...also pop the space they used on the context stack
+ 500	CALL IS_DO_OP( memory, itype, uvar_text(uvar)(start:end),
+     .		       lo_isp, uvar_ifv(uvar), status )
+	IF ( status .NE. ferr_ok ) RETURN
+	GOTO 100
+
+* grid-changing function 
+* ...(internal or external GC function)
+* ...in addition to the manipulations of IS_DO_OP above, this procedure
+* ...has the additional flexibility that the result grid need not be
+* ...inferrable from the input component grids
+
+* 10/98 *jc*
+* CALL ADD_RDC_XFORM is a test to see if we can get the right
+* context onto the context which will be used for the result
+ 600    CALL ADD_RDC_XFORM(is_big_cx(lo_isp), status)
+	CALL IS_DO_GC_FCN( memory, uvar, uvar_text(uvar)(start:end),
+     .		       lo_isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	GOTO 100
+
+* "constant variable" (fixed array like "{1,3,5}")
+* ... get the context here, then RETURN 1 to evaluate
+ 700	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	CALL CONST_VAR_CONTEXT ( uvar_text(uvar)(start:end),
+     .				 uvar,
+     .				 item,
+     .				 lo_cx,
+     .				 hi_cx,
+     .				 status )
+	IF ( status .NE. ferr_ok ) RETURN
+* ... request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	IF ( cx_category(hi_cx) .EQ. cat_const_var ) THEN
+* ... special action if this component variable is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+	IF ( start_sampling ) GOTO 900
+	RETURN 1
+
+* "attrib_val" a string or float value or array of strings or floats.
+* ... get the context here, then RETURN 1 to evaluate
+ 750	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+
+        
+* set these to unspecified.  If they get set in GET_VAR_CONTEXT, 
+* then do not set them to 1:attlen below.
+
+ 	cx_lo_ss(hi_cx, x_dim) = unspecified_int4
+ 	cx_hi_ss(hi_cx, x_dim) = unspecified_int4
+
+	CALL GET_VAR_CONTEXT (  uvar_text(uvar),
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* Flag to set the limits. They were not set by GET_VAR_CONTEXT, so use the
+* attribute size
+
+        reset_ss = (cx_lo_ss(hi_cx, x_dim) .EQ. unspecified_int4  .OR.
+     .              cx_hi_ss(hi_cx, x_dim) .EQ. unspecified_int4 ) 
+
+        dset = cx_data_set(hi_cx)
+
+! See if this is a user variable and set dataset number accordingly
+
+        dot = INDEX(uvar_text(uvar),'.')
+        IF (dot .GT. 0) name = uvar_text(uvar)(1:dot-1)
+        CALL FIND_VAR_NAME(pdset_irrelevant, name, cat, ivar)
+        IF (  ivar .NE. munknown_var_name .AND.
+     .        cat .EQ. cat_user_var) dset = -1
+
+        IF (dset .NE. unspecified_int4 .AND. 
+     .      dset .NE. pdset_irrelevant) THEN
+
+* do_err: issue error message if attrib does not exist on varname.attname
+           do_err = .TRUE.
+           CALL  BREAK_VARATTNAME (  uvar_text(uvar), dset, 
+     .                            name, attname, varid, do_err, status )
+
+* Is the *attr name* a pseudo-name for a variable: attnames, dimnames,
+*  natts, type, ...
+
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_INFO (dset, varid, name, vartype,
+     .                nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                status)
+
+* attribute names
+              IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN
+                 cx_type(hi_cx) = ptype_string
+                 IF (reset_ss) THEN
+                    cx_lo_ss(hi_cx, x_dim) = 1
+                    cx_hi_ss(hi_cx, x_dim) = nvatts
+                 ELSE
+                    cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                    cx_hi_ss(hi_cx, x_dim) = MIN(nvatts, cx_hi_ss(hi_cx, x_dim))
+                 ENDIF
+
+* dimension names
+              ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN 
+                 cx_type(hi_cx) = ptype_string
+                 IF (reset_ss) THEN
+                    cx_lo_ss(hi_cx, x_dim) = 1
+                    cx_hi_ss(hi_cx, x_dim) = nvdims
+                 ELSE
+                    cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                    cx_hi_ss(hi_cx, x_dim) = MIN(nvdims, cx_hi_ss(hi_cx, x_dim))
+                 ENDIF
+ 
+* # of dimensions for variable 
+              ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+                 cx_type(hi_cx) = ptype_float
+                 cx_lo_ss(hi_cx, x_dim) = 1
+                 cx_hi_ss(hi_cx, x_dim) = 1
+
+*  variable types
+              ELSE IF (STR_SAME(attname, 'nctype') .EQ. 0 ) THEN
+                 cx_type(hi_cx) = ptype_float
+                 cx_lo_ss(hi_cx, x_dim) = 1
+                 cx_hi_ss(hi_cx, x_dim) = 1
+
+* # of attributes
+               ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+                cx_type(hi_cx) = ptype_float
+                 cx_lo_ss(hi_cx, x_dim) = 1
+                 cx_hi_ss(hi_cx, x_dim) = 1
+
+               ELSE
+           
+* General attribute.
+* Get attribute type and length
+        
+                  CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+                  IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid,  
+     .              attid, aname, attype, attlen, attoutflag, status )
+
+                  IF (status .NE. ferr_ok) THEN
+                     RETURN ! ?? error message
+                  ENDIF
+
+                  IF (attype .EQ. NCCHAR) THEN
+                     cx_type(hi_cx) = ptype_string
+	          ELSE
+	             cx_type(hi_cx) = ptype_float
+	          ENDIF
+
+* If the attribute we are asking for is the bad-data flag, set 
+* cx_bad_data to something else, so that the value will be displayed.
+
+                  IF (STR_SAME (attname, 'missing_value') .EQ. 0 .OR.
+     .               STR_SAME (attname, '_FillValue') .EQ. 0) THEN
+                     maxlen = 1
+                     got_it = NC_GET_ATTRIB ( dset, varid, attname, 
+     .                                .TRUE., name, maxlen, attlen, 
+     .                                attoutflag, buff, val)
+                     IF (got_it) cx_bad_data(hi_cx) = val/2. + 1.
+                  ENDIF
+
+                  IF (attype .EQ. NCCHAR) THEN
+                     cx_lo_ss(hi_cx, x_dim) = 1
+                     cx_hi_ss(hi_cx, x_dim) = 1
+                  ELSE
+ 
+* If they were not set by the var context, set the X axis limits equal 
+* to the length of the array. 
+
+                    IF (reset_ss) THEN
+                        cx_lo_ss(hi_cx, x_dim) = 1
+                        cx_hi_ss(hi_cx, x_dim) = attlen
+                    ELSE
+                       cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                       cx_hi_ss(hi_cx, x_dim) = MIN(attlen, cx_hi_ss(hi_cx, x_dim))
+                    ENDIF
+                 ENDIF
+
+               ENDIF  ! general attribute
+
+* If the varname is ., referring to the dataset itself, then the varid = 0. These are
+* dataset attributes: varnames, attnames, dimnames, ndims, nvars, ...
+
+           ELSE 
+              IF (varid .EQ. 0) THEN
+                 CALL CD_GET_DS_INFO (dset, ndims, nvars, ngatts, 
+     .               recdim, status)
+     
+* Count number of non-coordinate variables.
+                 nv = 0
+                 DO 760 ivar = 1, nvars
+                    CALL CD_GET_VAR_INFO (dset, ivar, name, vartype,
+     .                  nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                  status)
+                    IF (.NOT. coordvar) nv = nv + 1
+ 760             CONTINUE
+
+                 IF (STR_SAME(attname, 'varnames') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_string
+                    IF (reset_ss) THEN
+                       cx_lo_ss(hi_cx, x_dim) = 1
+                       cx_hi_ss(hi_cx, x_dim) = nv
+                    ELSE
+                       cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                       cx_hi_ss(hi_cx, x_dim) = MIN(nv, cx_hi_ss(hi_cx, x_dim))
+                    ENDIF
+
+* Global attributes
+                 ELSE IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_string
+                    IF (reset_ss) THEN
+                       cx_lo_ss(hi_cx, x_dim) = 1
+                       cx_hi_ss(hi_cx, x_dim) = ngatts
+                    ELSE
+                       cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                       cx_hi_ss(hi_cx, x_dim) = MIN(ngatts, cx_hi_ss(hi_cx, x_dim))
+                    ENDIF
+                    
+* # of dimensions
+                 ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_float
+                    cx_lo_ss(hi_cx, x_dim) = 1
+                    cx_hi_ss(hi_cx, x_dim) = 1
+   
+* dimension names
+                 ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_string
+
+
+* Count number of coordinate variables. (file may list more dimensions than
+* coordinates, e.g. a dimension for the grid definition, which is not a coord.)
+                    nv = 0
+                    DO 770 ivar = 1, nvars
+                       CALL CD_GET_VAR_INFO (dset, ivar, name, vartype,
+     .                     nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                     status)
+                       IF (coordvar) nv = nv + 1
+ 770                CONTINUE
+
+                    IF (reset_ss) THEN
+                       cx_lo_ss(hi_cx, x_dim) = 1
+                       cx_hi_ss(hi_cx, x_dim) = nv
+                    ELSE
+                       cx_lo_ss(hi_cx, x_dim) = MAX(1, cx_lo_ss(hi_cx, x_dim))
+                       cx_hi_ss(hi_cx, x_dim) = MIN(ndims, cx_hi_ss(hi_cx, x_dim))
+                    ENDIF
+
+* # variables 
+                 ELSE IF (STR_SAME(attname, 'nvars') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_float
+                    cx_lo_ss(hi_cx, x_dim) = 1
+                    cx_hi_ss(hi_cx, x_dim) = 1
+
+* # of global attributes
+                 ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+                    cx_type(hi_cx) = ptype_float
+                    cx_lo_ss(hi_cx, x_dim) = 1
+                    cx_hi_ss(hi_cx, x_dim) = 1
+
+* Is the reference to a global attribute? If so get its type and length
+
+                 ELSE
+                    CALL CD_GET_VAR_ID (dset, '.', varid, status)
+                    CALL CD_GET_DS_INFO (dset, ndims, nvars, ngatts, 
+     .               recdim, status)
+
+* If the attribute name is in quotes remove them. Perhaps the user
+* is looking for a global file attribute named the same as one of our
+* pseudo- attribute names 
+* (Logic for case-sensitive searching will go here...)
+
+                    slen = TM_LENSTR1(attname)
+                    IF (attname(1:1) .EQ. "'" .AND. 
+     .                   attname(slen:slen) .EQ. "'" ) THEN
+                       attname = attname(2:slen-1)
+                       attname(slen-1:slen) = ""
+                    ENDIF
+
+
+                    DO 790 iatt = 1, ngatts
+                       CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, name, 
+     .                    status)
+                       IF (STR_SAME(name, attname) .EQ. 0) THEN
+
+                          CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, 
+     .                        name, attype, attlen, attoutflag, status )
+
+                          cx_type(hi_cx) = ptype_float
+                          cx_lo_ss(hi_cx, x_dim) = 1
+                          cx_hi_ss(hi_cx, x_dim) = attlen
+
+                          IF (attype .EQ. NCCHAR) THEN
+                             cx_type(hi_cx) = ptype_string
+                             cx_hi_ss(hi_cx, x_dim) = 1
+                          ENDIF
+
+                       ENDIF
+
+ 790                CONTINUE
+
+                 ENDIF
+              ENDIF
+           ENDIF
+
+        ELSE
+           CALL TRANSFER_CONTEXT (lo_cx, hi_cx)
+        ENDIF
+
+* ... request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	IF ( cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... special action if this component variable is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+	IF ( start_sampling ) GOTO 900
+	RETURN 1
+
+* "string" in quotes in variable definition
+* ... get the context here, then RETURN 1 to evaluate
+ 800	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	CALL STRING_CONTEXT (	uvar,
+     .				item,
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+	IF ( status .NE. ferr_ok ) RETURN
+* ... request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp	! claimed by this level
+	IF ( cx_category(hi_cx) .EQ. cat_string ) THEN
+* ... special action if this component variable is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+	RETURN 1
+
+* "SAMPLEI" (and its family)
+* at this point the list of indices has been evaluated and is on the isp stack
+* (at lo_isp+1). Setup "sampling" activity on the stack, using that list to
+* guide obtaining the other arg
+ 900	CALL SETUP_SAMPLE( memory, is_cx(lo_isp+1), is_mr(lo_isp+1),
+     .			   ifcn, big_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+* ... setup to grab first chunk of sampling data
+	CALL IS_SAMPLE( memory, *910, *5900, status ) !	RETURN 2 means all done
+	GOTO 5900
+ 910	RETURN 1
+
+
+* DONE - clean up
+ 1000	hi_cx = is_cx( isp )
+	hi_mr = is_mr( isp )
+	is_mr( lo_isp ) = hi_mr
+	isp = isp - 1
+	IF ( isp .NE. lo_isp ) 
+     .	   CALL ERRMSG( ferr_syntax, status, 'RPN', *5000 )
+
+* Deallocate dynamic grid if one is associated with this result
+* This will (I think) only happen if a single component (no IS_DO_OP call)
+* result with a dynamic grid is requested
+* (This will not actually dismiss the grid -- it should always merely decrement
+*  the use count)
+	IF ( cx_has_impl_grid(hi_cx) ) THEN
+	   CALL DEALLO_DYN_GRID(cx_grid(hi_cx))
+	   cx_has_impl_grid(hi_cx) = .FALSE.
+	ENDIF
+
+* check for incomplete merged context
+* this is complicated in order to have implicit user-defn'd vars like
+* "LIST TEMP" get cataloged under "TEMP"
+* whereas "LIST TEMP/10" gets cataloged under the implied user-defn'd var name
+* and whereas the explicit "DEFINE A=TEMP" gets cataloged under "A".
+* Use the isp level to determine if it's implicit - implicit always at base lev
+* MERGIFY_CX "claims" a context under the user-defn'd name.
+	IF ( is_sum(lo_isp) .EQ. isalg_transfer ) THEN
+* ... expression entirely of unmodified pseudo-vars and constants
+	   CALL TRANSFER_CONTEXT( hi_cx, big_cx )
+	   IF ( cx_category(big_cx) .EQ. cat_temp_var
+     .	   .OR. EXPLICIT_UVAR(uvar) ) THEN
+* ... expr. like "LIST I+J" or "LIST A" after "DEFINE VAR A=I"
+	      CALL MERGIFY_CX( lo_cx, uvar, big_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	ELSEIF ( is_sum(lo_isp).EQ.isalg_merge_1
+     .	.AND.  ( nitem.GT.1 .OR. EXPLICIT_UVAR(uvar) )  ) THEN 
+* ... expression with constants, pseudo-variables and a single variable
+* ... like "LIST U/10" or single variable explicit uvars like "DEFINE NEW=U"
+	   CALL MERGIFY_CX( lo_cx, uvar, big_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* finalize the result on the stack - it may be the result of some algebra or
+* a simple variable or a constant or pseudo-variable
+* "temporary variables" are the result of algebraic operations
+* ... re-catalog them under their user-variable names
+* explicit user-defined variables (e.g. "DEFINE VAR NEW=X"; "LIST NEW") are
+* always re-cataloged under the user-defined name
+* Merged context info is then passed back to the calling context.
+* implicit uvars that are single pseudo-variables or constants are left as-is
+* ... to be deleted as soon as used (e.g. "LIST X")
+* implicit uvars that are single variables (e.g. "LIST U") need their "in-use"
+* flags removed (otherwise done when they're used as operands)
+	IF ( mr_category( hi_mr ) .EQ. cat_temp_var ) THEN
+* ... result of algebraic computation
+* ... if user set the missing value flag make sure it is used
+	   IF ( cx_bad_data(big_cx) .NE. mr_bad_data(hi_mr) ) THEN
+	      size = MGRID_SIZE( hi_mr )
+	      CALL REPLACE_BAD_DATA_SUB ( mr_bad_data(hi_mr),
+     .			                  memory(1,mr_blk1(hi_mr)), size,
+     .                                    cx_bad_data(big_cx)  )
+	   ENDIF
+	   CALL RE_ASSIGN_VARIABLE( hi_mr, big_cx )
+	   CALL PASS_AMBIG_LIMS( lo_cx, hi_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+!	ELSEIF (mr_category(hi_mr) .EQ. cat_string) THEN
+!! ... string variables not yet implemented 1/99 *sh*
+!	   GOTO 5100
+        ELSEIF  (mr_category(hi_mr) .EQ. cat_attrib_val) THEN  ! like the final ELSE below
+           CALL MR_NOT_IN_USE(hi_mr)
+	   CALL TRANSFER_CONTEXT( big_cx, lo_cx )
+	ELSEIF ( EXPLICIT_UVAR(uvar) ) THEN
+* ... result of a simple definition like DEFINE VARIABLE UAVE=U[K=@AVE]
+*	or DEFINE VARIABLE NEW=X
+	   CALL CREATE_MEM_VAR( big_cx, new_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_mr( lo_isp ) = new_mr
+	   CALL COPY_GRID( memory(1,mr_blk1(hi_mr)),  hi_mr,
+     .			   memory(1,mr_blk1(new_mr)), new_mr )
+	   CALL PASS_AMBIG_LIMS( lo_cx, new_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+* component no longer needed
+* 12/00 allow contstants to be deleted
+	   IF ( mr_category(hi_mr) .EQ. cat_constant ) THEN
+	      CALL DELETE_VARIABLE(hi_mr)
+	   ELSEIF ( mr_category(hi_mr) .NE. cat_pseudo_var ) THEN
+	      CALL MR_NOT_IN_USE(hi_mr)
+	   ENDIF
+
+!		This change would fix a minor bug that occurs for "enhanced"
+!		CDF files and GT files (bn230_cdf.sub3), but it creates more
+!		serious problems of ignoring limits restrictions (1:6) in
+!			let a = temp[i=90:110:2]; list a[i=1:6]
+!		see bn491_dynamic_grids
+!	   CALL TRANSFER_CONTEXT( big_cx, lo_cx )	! 3/99 correct cx, too
+
+	ELSE
+	   IF ( mr_category(hi_mr) .NE. cat_pseudo_var
+     .    .AND. mr_category(hi_mr) .NE. cat_constant   )
+     .                                        CALL MR_NOT_IN_USE(hi_mr)
+	   CALL TRANSFER_CONTEXT( big_cx, lo_cx )
+	ENDIF
+
+* if user set the missing value flag make sure it is used
+	IF ( mr_category(hi_mr) .NE. cat_attrib_val) THEN 
+	   IF ( cx_bad_data(lo_cx) .NE. mr_bad_data(is_mr(lo_isp))) THEN  
+	      new_mr = is_mr(lo_isp)
+	      size = MGRID_SIZE( new_mr )
+	      CALL REPLACE_BAD_DATA_SUB ( mr_bad_data(new_mr),
+     .			               memory(1,mr_blk1(new_mr)), size,
+     .                                  cx_bad_data(lo_cx)  )
+	      mr_bad_data(new_mr) = cx_bad_data(lo_cx)
+	   ELSE
+	      new_mr = is_mr(lo_isp)
+	      size = MGRID_SIZE( new_mr )
+	      CALL CHECK_NAN_DATA_SUB ( memory(1,mr_blk1(new_mr)), size,
+     .                                 mr_bad_data(new_mr) )
+	   ENDIF
+	ENDIF
+
+* pop off context for the last component received and "big" (merged) context
+
+* This diag condition not true when constructing the data with DEFINE DATA/AGG
+c	IF ( big_cx .NE. cx_stack_ptr-1
+c     .	.OR. big_cx .NE. lo_cx+1 ) WRITE (6, *) 'is_alg_2' ! temp diag
+
+	cx_stack_ptr = cx_stack_ptr - 2
+	RETURN 2
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG(ferr_not_implemented, status,
+     .		'Quoted strings may only be function arguments', 
+     .		*5000)
+ 5900	CALL ERRMSG( ferr_internal, status, 'SAMPLE* not startable',
+     .		*5000)
+
+	END	
diff --git a/fer/stk/is_attrib_val.F b/fer/stk/is_attrib_val.F
new file mode 100644
index 0000000..07234d5
--- /dev/null
+++ b/fer/stk/is_attrib_val.F
@@ -0,0 +1,394 @@
+	SUBROUTINE IS_ATTRIB_VAL( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* create a string or float abstract array containing attribute values,
+* including pseudo-names for global attributes ..nvars, ..ngatts, ..ndims, 
+* ..varnames, ..gattnames, and
+* varname.natts, varname.natts, varname.attnames
+
+* return in att_cx context information describing the array of attribute values
+* (based on is_constant_var.F)
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 8/18/05
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+ 
+        include 'tmap_dims.parm'
+#include "netcdf.inc"
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+        CHARACTER*512 varname, name
+        CHARACTER*128 attname, dname, aname
+        CHARACTER*128 err_string
+        LOGICAL coordvar, do_err, got_it
+	INTEGER	CGRID_SIZE, STR_SAME, TM_LENSTR1,
+     .		mr, cx, size, uvar, n, dset, 
+     .          varid, attype, attlen, ndims, nvars, 
+     .          ngatts, recdim, ivar, vartype, nvdims,
+     .          vdims(8), iatt, nvatts, idim, nd, vd, na,
+     .          attoutflag, all_outflag, xdim, i1, i2, slen,
+     .          i, indx, nv, dot, cat, attid
+
+* --- end of introductory code ---
+* initialize
+
+	cx = is_cx( isp )
+	size = CGRID_SIZE(cx)
+	dset = cx_data_set( cx )
+        xdim = 1
+        i1 = cx_lo_ss(cx,xdim)
+        i2 = cx_hi_ss(cx,xdim)
+        got_it = .FALSE.
+
+        IF (i2 .LT. i1) GOTO 5100
+        
+        IF (dset .LT. -1 .OR. (.NOT.cx_dset_gvn(cx) )) 
+     .      dset = cx_data_set( is_cx(isp-1) )
+
+* reserve and catalog space for the result
+
+	CALL CREATE_TEMP_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* diagnostic output
+	IF (mode_diagnostic) 
+     .      CALL DIAGNOSTIC_OUT ('attrib_val',mr,point_to_mr)
+
+* parse and insert the constant array
+
+	uvar = cx_variable(cx)
+
+! See if this is a user variable and set dataset number accordingly
+
+        dot = INDEX(uvar_text(uvar),'.')
+        IF (dot .GT. 0) varname = uvar_text(uvar)(1:dot-1)
+        CALL FIND_VAR_NAME(pdset_irrelevant, varname, cat, ivar)
+        IF (  ivar .NE. munknown_var_name .AND.
+     .         cat .EQ. cat_user_var) dset = -1
+
+* do_err: issue error message if attrib does not exist on varname.attname
+        do_err = .TRUE. 
+        CALL BREAK_VARATTNAME ( uvar_text(uvar), dset, varname, 
+     .                          attname, varid, do_err, status )
+ 
+        IF (STR_SAME (varname, '.') .EQ. 0) THEN
+
+           CALL CD_GET_DS_INFO (dset, ndims, nvars, ngatts, 
+     .               recdim, status)
+
+           IF (STR_SAME(attname, 'varnames') .EQ. 0 ) THEN
+
+* Get and store the variable names.
+
+              n = i2 - i1 + 1
+              CALL INIT_C_STRING_ARRAY( n,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+              n = 0
+              nv = 0
+              DO 120 i = 1, nvars
+                 name = ' '
+                 CALL CD_GET_VAR_INFO (dset, i, name, vartype,
+     .                nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                status)
+                 IF (.NOT. coordvar) THEN
+                    nv = nv + 1
+                    IF (nv .GE. i1 .AND. nv .LE. i2) THEN
+                       slen = TM_LENSTR1(name)
+                       CALL STORE_STRING(name(1:slen), mr, n, status)
+                       n = n + 1
+                    ENDIF
+                 ENDIF
+ 120          CONTINUE
+              got_it = .TRUE.
+ 
+           ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+
+* Get and store the coordinate variable names.
+
+              n = i2 - i1 + 1
+	      CALL INIT_C_STRING_ARRAY( n,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+              n = 0
+              nv = 0
+              DO 220 i = 1, nvars  
+                 name = ' '
+                 CALL CD_GET_VAR_INFO (dset, i, name, vartype,
+     .                nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                status)
+                 IF (coordvar) THEN
+                    nv = nv + 1
+                    IF (nv .GE. i1 .AND. nv .LE. i2) THEN
+                       slen = TM_LENSTR1(name)
+                       CALL STORE_STRING(name(1:slen), mr, n, status)
+                       n = n + 1
+                    ENDIF
+                 ENDIF
+ 220          CONTINUE
+              got_it = .TRUE.
+
+           ELSE IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN
+              IF (ngatts .GT. 0) THEN
+                 CALL CD_GET_VAR_ID (dset, '.', varid, status)
+
+	         CALL INIT_C_STRING_ARRAY( ngatts,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+                 n = 0
+                 DO 300 iatt = i1, i2
+                 CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, name, 
+     .                    status)
+                 slen = TM_LENSTR1(name)
+                 CALL STORE_STRING(name(1:slen), mr, n, status)
+                 n = n + 1
+ 300          CONTINUE
+              ENDIF
+              got_it = .TRUE.
+
+           ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+              memory( 1, mr_blk1(mr)) = ndims
+              got_it = .TRUE.
+
+           ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+              memory( 1, mr_blk1(mr)) = ngatts
+              got_it = .TRUE.
+
+           ELSE IF (STR_SAME(attname, 'nvars') .EQ. 0 ) THEN
+
+* Count number of non-coordinate variables.
+              n = 0
+              DO 400 ivar = 1, nvars
+                 CALL CD_GET_VAR_INFO (dset, ivar, name, vartype,
+     .                nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                status)
+                 IF (.NOT. coordvar) n = n + 1
+ 400          CONTINUE
+              memory( 1, mr_blk1(mr)) = n
+              got_it = .TRUE.
+           ENDIF
+
+* Is the user asking for the value of a global attribute?
+
+           IF (got_it) GOTO 1000
+
+           CALL CD_GET_VAR_ID (dset, '.', varid, status)
+
+           DO 500 iatt = 1, ngatts
+              CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, name, 
+     .                    status)
+              IF (STR_SAME(name, attname) .EQ. 0) THEN 
+
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, 
+     .                 name, attype, attlen, attoutflag, status )
+
+	         IF ( attype .EQ. NCCHAR ) THEN
+
+* ... set up FORTRAN-independent pointer
+
+	            CALL INIT_C_STRING_ARRAY( 1,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+
+* ... string
+	            CALL ATTRIB_STRING (cx, mr, dset, varid, 
+     .			         varname, attname, status)
+	         ELSE
+* ... array of numbers
+	            CALL ATTRIB_VALS (memory( 1, mr_blk1(mr)), 
+     .                size, n, dset, varid, varname, attname, status)
+	         ENDIF
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+              ELSE
+
+* If the attribute name is in quotes try to get it anyway, as a numeric or
+* string attribute. Perhaps the user is looking for a file attribute named 
+* the same as one of our pseudo-attribute names 
+* (Logic for case-sensitive searching will go here...)
+
+                 slen = TM_LENSTR1(attname)
+                 IF (attname(1:1) .EQ. "'" .AND. 
+     .               attname(slen:slen) .EQ. "'" ) THEN
+
+	            CALL ATTRIB_VALS (memory( 1, mr_blk1(mr)), 
+     .                 size, n, dset, varid, varname, attname, status)
+                    IF (status .NE. ferr_ok ) CALL ATTRIB_STRING (cx, mr, 
+     .	                      dset, varid,  varname, attname, status)
+                 ENDIF
+
+              ENDIF
+ 500          CONTINUE
+
+        ELSE  ! variable name is not '.'
+
+           CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+           IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .        attid, aname, attype, attlen, attoutflag, status )
+
+           IF (status .NE. ferr_ok) THEN
+
+* See if it is a pseudo-attribute attnames, ndims, etc.
+              CALL CD_GET_VAR_INFO (dset, varid, name, vartype,
+     .                nvdims, vdims, nvatts, coordvar, all_outflag, 
+     .                status)
+
+              IF (STR_SAME(attname, 'attnames') .EQ. 0 ) THEN
+                 IF (nvatts .GT. 0) THEN
+
+	           CALL INIT_C_STRING_ARRAY( nvatts,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+                   n = 0
+                   DO 600 iatt = i1, i2
+                      CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, name, 
+     .                    status)
+                      slen = TM_LENSTR1(name)
+                      CALL STORE_STRING(name(1:slen), mr, n, status)
+                      n = n + 1
+ 600               CONTINUE
+                ENDIF
+                got_it = .TRUE.
+
+             ELSE IF (STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+                IF (nvdims .GT. 0) THEN
+
+	           CALL INIT_C_STRING_ARRAY( nvdims,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+                   n = 0
+                   DO 700 idim = i1, i2
+                      CALL CD_GET_VAR_INFO (dset, vdims(idim), dname, 
+     .                   vartype, nd, vd, na, coordvar, all_outflag, 
+     .                   status)
+                      slen = TM_LENSTR1(dname)
+                      CALL STORE_STRING(dname(1:slen), mr, n, status)
+                      n = n + 1
+ 700               CONTINUE
+                ENDIF
+                got_it = .TRUE.
+
+             ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0 ) THEN
+                memory( 1, mr_blk1(mr)) = nvdims
+                got_it = .TRUE.
+
+             ELSE IF (STR_SAME(attname, 'nctype') .EQ. 0 ) THEN
+                memory( 1, mr_blk1(mr)) = vartype
+                got_it = .TRUE.
+
+             ELSE IF (STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+                memory( 1, mr_blk1(mr)) = nvatts
+                got_it = .TRUE.
+
+             ENDIF
+             IF (got_it) GOTO 1000
+
+* If the attribute name is in quotes remove them. Perhaps the user
+* is looking for a file attribute named the same as one of our pseudo-
+* attribute names 
+* (Logic for case-sensitive searching will go here...)
+
+             slen = TM_LENSTR1(attname)
+             IF (attname(1:1) .EQ. "'" .AND. attname(slen:slen) .EQ. "'" ) THEN
+                attname = attname(2:slen-1)
+                attname(slen-1:slen) = ""
+             ENDIF
+
+             CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+             IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, 
+     .          attid, aname, attype, attlen, attoutflag, status )
+
+             IF (status .EQ. ferr_ok) GOTO 1000
+
+           ELSE
+
+* Is it a regular attribute from the file or a definition
+
+ 900	      IF ( attype .EQ. NCCHAR ) THEN
+* ... set up FORTRAN-independent pointer
+	         CALL INIT_C_STRING_ARRAY( 1,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)    )
+
+* ... string
+	         CALL ATTRIB_STRING (cx, mr, dset, varid, varname, attname,
+     .			          status)
+	      ELSE
+* ... array of numbers
+	         CALL ATTRIB_VALS (memory( 1, mr_blk1(mr)), size, n, dset, 
+     .                varid, varname, attname, status)
+     
+                 indx = 1
+                 DO 800 i = i1, i2
+                    memory(indx, mr_blk1(mr)) = memory(i,mr_blk1(mr))
+                    indx = indx + 1
+800              CONTINUE
+                    
+
+	      ENDIF
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+
+        ENDIF
+* result is ready to return to the stack
+1000    CONTINUE
+        is_mr( isp ) = mr
+        mr_bad_data(mr) = cx_bad_data(cx)
+
+* got the requested component
+	RETURN 2
+
+! RETURN 1, which is to request a sub-component, is never used ...
+
+* error exit
+ 5000	RETURN
+ 5100   status = ferr_out_of_range
+        err_string = "invalid dataset attribute index"
+        CALL ERRMSG( status, status, err_string, *5000 )
+	END	
+
diff --git a/fer/stk/is_auxvar_regrid.F b/fer/stk/is_auxvar_regrid.F
new file mode 100644
index 0000000..b4e7870
--- /dev/null
+++ b/fer/stk/is_auxvar_regrid.F
@@ -0,0 +1,407 @@
+	SUBROUTINE IS_AUXVAR_REGRID( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine controls the fetching of auxiliary variables if more than
+* one; the determination of the curvilinier index region and fetching of
+* the target; and (optionally) performing the regridding.  The regridding
+* step is skipped when this routine is called under isact_aux_plot_vars
+*
+* regridding:  regrid the data from the source grid to the destination grid
+* using auxiliary variables to guide the numerics of the regrid
+* architype is a conversion from density to depth "TEMP[gz(depth)=zax]"
+* where "depth" is a field of depths defined on the same density axis
+* as the variable TEMP
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/2013 based upon IS_REGRID
+* for Ferret v685+
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xtext_info.cmn'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xalgebra.cmn'   ! with alg_regrid_code
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal exit is for error conditions
+* exit #1 is to signal completion of the activity at this stack level
+
+* internal variable declarations:
+	LOGICAL	ITS_UN_CACHED, not_reusable, first, aux_has_cell_pts
+	INTEGER TM_LENSTR1, CAXIS_LEN, AUX_AXIS_FROM_ARG,
+     .		i, j, icom, idim, mr, lo_cx, hi_cx, lo_isp, hi_isp, naxis,
+     .		aux_mr_list(nferdims), mr1, mr2, mr3,
+     .		aux_cx_list(nferdims), cx1, cx2, cx3,
+     .		isp_ptr, axis_list(nferdims),
+     .		dst_cx, src_cx, com_cx, dst_mr, src_mr, frame_bottom, impl_grid,
+     .		slen, s1, sn, naux, ptr
+	CHARACTER*128 VAR_CODE, src_name, com_name
+
+        EQUIVALENCE
+     .          ( aux_mr_list(1), mr1 ),
+     .          ( aux_mr_list(2), mr2 ),
+     .          ( aux_cx_list(1), cx1 ),
+     .          ( aux_mr_list(2), mr2 ),
+     .          ( aux_cx_list(2), cx2 ),
+     .          ( aux_mr_list(3), mr3 ),
+     .          ( aux_cx_list(3), cx3 )
+
+
+* this routine guides the regridding process through three phases:
+*  1) isphase_get_aux_var  - gets the needed auxiliary vars onto the cx stack
+*  2) isphase_get_source_var - gets the pre-regridded data field
+*  3) isphase_do_aux_regrid  - performs the regridding
+
+* RETURN 1 is to get another component
+* RETURN 2 is when the regridding is completed
+* normal RETURN is for errors
+
+* auxiliary regridding always requires at least 2 component variables:
+*	1 or more auxiliary variables  (e.g. xcoords, and ycoords for curvilinear regrid)
+* and   the source data to be regridded
+
+* for each components obtained, is_obj(isp) will retain a pointer to the
+* parent level -- the level at which regridding was requested (a.k.a. "lo_isp")
+
+* in all 3 phases the interp stack setup will look like this
+*	stack level		stack contents
+*       -----------		--------------
+*	isp+1	<--	level  of component just obtained
+*	...     <--     levels of components previously obtained
+*	lo_isp	<--	level at which regrid was requested
+* --- end of introductory code ---
+
+* initialize
+	IF ( is_phase(isp).EQ. isphase_get_aux_var
+     . .AND. is_sum(isp) .EQ. 1                     )  THEN
+* ... first time called.  Set up is_obj pointer
+	   lo_isp = isp
+	   is_obj(isp+1) = lo_isp ! so auxvar just obtained points to regrid op
+	ELSE
+	   lo_isp   = is_obj(isp)    ! the isp level of the regrid operation
+	ENDIF
+	lo_cx    = is_cx(lo_isp)
+	naxis    = cx_naux( lo_cx )
+	IF (cx_type(lo_cx) .EQ. ptype_string) GOTO 5010
+
+* set pointers to the auxiliary variables
+* (if we are have more aux variables to get some of these pointers will be wrong)
+* ... first pre-fill with known values
+	DO 5 i = 1, 3
+	   aux_mr_list(i) = dummy_mr
+	   aux_cx_list(i) = unspecified_int4 
+ 5	CONTINUE
+        i = 0
+        DO 10 idim = 1, nferdims
+           IF (cx_aux_var(idim,lo_cx) .NE. unspecified_int4) THEN
+              i = i + 1
+              isp_ptr = lo_isp + i 
+              axis_list(i) = idim
+              aux_mr_list(i) = is_mr(isp_ptr)  ! see equivs
+              aux_cx_list(i) = is_cx(isp_ptr)  ! see equivs
+          ENDIF
+ 10    CONTINUE
+* naxis should equal i at this point, but no need to confirm
+
+* sanity check
+        IF (naxis.GT.1) CALL ERRMSG(ferr_prog_limit, status,
+     .                       'for now only 1 aux var supported', *5000)
+*!        IF (naxis.GT.3) CALL ERRMSG(ferr_prog_limit, status,
+*!     .                       'more than 3 auxiliary regrid vars', *5000)
+
+	IF ( is_phase(lo_isp) .EQ. isphase_get_aux_var ) THEN 
+
+* we're in the initial phase getting the components needed
+	   CALL CREATE_NEW_CONTEXT( lo_cx, hi_cx, status )	! pushes stack
+
+* put isp up one so that the component just received stays on the stack
+	   isp = isp + 1
+
+	   IF (is_sum(lo_isp) .LT. naxis ) THEN
+*  *** SET UP TO GET THE NEXT AUXILIARY VARIABLE ***
+	      is_sum(lo_isp) = is_sum(lo_isp) + 1  ! the next auxvar
+	      CALL GET_AUX_VAR_CONTEXT( lo_cx, hi_cx, is_sum(lo_isp),
+     .					status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      is_axis(lo_isp) = AUX_AXIS_FROM_ARG(lo_cx, is_sum(lo_isp))
+
+	   ELSE
+* *** SET UP TO GET THE SOURCE DATA ***
+	      is_phase(lo_isp) = isphase_get_source_var
+
+* set up 4D array limits as unsubscripted variables in COMMON
+              CALL NON_ARRAY_SUBSC( aux_mr_list, naxis )
+
+* create the context for the source data needed to perform the regrid
+              CALL AUX_REGRID_LIMS( lo_cx, hi_cx, axis_list, naxis,
+     .                memory( 1, mr_blk1(mr1) ), mr1, cx1,
+     .                memory( 1, mr_blk1(mr2) ), mr2, cx2,
+     .                memory( 1, mr_blk1(mr3) ), mr3, cx3,
+     .                status )
+              IF (status .NE. ferr_ok) GOTO 5000
+	   ENDIF
+
+* go get the next component (the one just set up) via RETURN 1
+   	   CALL PUSH_INTERP_STACK( isp, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   is_cx ( isp ) = hi_cx
+	   is_obj( isp ) = lo_isp  ! points back to the regridded variable
+	   IF ( cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... setup to evaluate auxiliary var that is user-defined (uvar)
+	      is_uvar( isp ) = cx_variable( hi_cx )
+	   ENDIF
+	   RETURN 1
+
+	ELSEIF (  is_phase(lo_isp) .EQ. isphase_get_source_var ) THEN 
+ 
+* ***  TIME TO REGRID OR RETURN "3 ARGUMENTS" (2 for Z)  FOR PLOTTING****
+* ... we have all of the needed components.
+	   is_phase(lo_isp) = isphase_do_aux_regrid  ! (never used)
+
+* if the scenario is
+*       yes? LET TEMPZ = TEMP[gz(DEPTH)=zax]
+*       yes? LOAD TEMPZ
+*    then the interp stack setup at the time this is called is
+*
+*   stack level            stack contents
+*   ----- -----      -----------------------------------
+* hi_isp:isp+naux   variable on native grid (TEMP)
+*        isp        auxiliary variable (DEPTH)
+* lo_isp:isp-1      requested regrid result (TEMP[dz(DEPTH)=zax])
+*        isp-2      evaluating TEMPZ
+*        isp-3      evaluating EXP#
+
+
+  	   hi_isp = isp + cx_naux(lo_cx)   ! the source data (just obtained)
+	   src_cx = is_cx(hi_isp)
+	   dst_cx = lo_cx
+	   src_mr = is_mr(hi_isp)
+
+*******************************
+* RETURN AUX VARS FOR "3 ARGUMENT" PLOTS
+* No regridding to do.
+* Transfer the isp stack contents of the component variable (hi_isp)
+* to the destination level (lo_isp) and reset the stack pointer
+* Park the auxiliary variables in the special parking area at the stack top
+* XXX TEMPORARY: tbd - also park a copy of their cx at the top of the cx stack?
+	   IF (is_act(lo_isp) .EQ. isact_aux_plot_vars) THEN
+* park the auxiliary variable(s) at the top of the isp stack
+	      i = 0
+	      DO idim = 1, nferdims
+	         IF (cx_aux_var(idim,lo_cx) .NE. unspecified_int4) THEN
+* XXX TEMPORARY - warn of same auxvar parked twice.  Better would be to ERROR
+*	when saved context regions and mr don't match btwn now and earlier
+	            ptr = is_aux_ptr(lo_isp) + idim
+	            IF (is_mr(ptr) .NE. unspecified_int4)
+     .			CALL WARN("is_auxvar_regrid dup auxvar parked")
+	            CALL TRANSFER_ISP(isp+i, ptr)		! save it
+	            is_axis(ptr) = idim			        ! bookkeeping
+* ... also park a copy of the aux var context at the top of the cx stack
+	            is_cx(ptr) = max_context+idim
+	            CALL TRANSFER_CONTEXT(is_cx(isp+i),is_cx(ptr))
+* ... set the aux axis limits to the limits required getting the target var
+	            CALL TRANSFER_AXIS(idim, src_cx, is_cx(ptr))
+	            i = i + 1
+	         ENDIF
+	      ENDDO
+	      IF (i .NE. cx_naux(lo_cx)) CALL WARN("is_auxvar_regrid crptn")
+* the component just obtained is *the* result (no regridding to do)
+	      CALL TRANSFER_CONTEXT( src_cx, dst_cx )
+	      is_mr(lo_isp) = src_mr
+	      CALL MR_IN_USE( src_mr )  ! hack cuz we will "un-use" it below
+	      GOTO 400     ! clean up the stack
+	   ENDIF
+*******************************
+
+* Make the destination context like the source data context on all except
+* the regrid axis.  That one keeps the user-requested size.
+* (Other axes may have been modified by information embedded within a
+* user-variable definition. 
+
+* (*sh* untested, simpler(?) alternative is to create the mr from dst_cx just
+* as it is, pre-fill with missing, and create cx_valid based on available
+* limits of the source data and the auxiliary variable)
+
+* insist that on the axes being regridded the size of the auxiliary fields is
+* either the same as the source data or +1 larger.  +1 indicates cell boundary
+* coordinates in the auxiliary variable(s).  Determine whether point locations
+* or bounds were provided.
+	   first = .TRUE.
+	   DO i = 1, naxis
+	      idim = axis_list(i)
+* ... check all relevant aux vars
+	      DO  j = 1, naxis 
+	         com_cx = aux_cx_list(j)
+	         IF (CAXIS_LEN(idim,com_cx) .NE. CAXIS_LEN(idim,src_cx)+1
+     .	       .AND. CAXIS_LEN(idim,com_cx) .NE. CAXIS_LEN(idim,src_cx) )
+     .									GOTO 5500
+	         IF ( first ) THEN
+	            aux_has_cell_pts = CAXIS_LEN(idim,com_cx)
+     .			          .EQ. CAXIS_LEN(idim,src_cx)
+	            first = .FALSE.
+	         ELSE
+	            IF (aux_has_cell_pts .NEQV. 
+     .			CAXIS_LEN(idim,com_cx).EQ.CAXIS_LEN(idim,src_cx) )
+     .									GOTO 5500
+	         ENDIF
+	      ENDDO
+	   ENDDO
+
+	   CALL TRANSFER_CONTEXT( src_cx, cx_buff )
+	   DO 300 i = 1, naxis 
+	      idim = axis_list(i)
+	      CALL TRANSFER_AXIS( idim, dst_cx, cx_buff )
+	      cx_regrid_trans( idim, cx_buff ) = cx_regrid_trans( idim, dst_cx )
+	      cx_delta(idim,cx_buff) = unspecified_val8
+ 300	   CONTINUE
+	   cx_unstand_grid( cx_buff ) = cx_unstand_grid( dst_cx )
+	   cx_grid        ( cx_buff ) = cx_grid        ( dst_cx )
+	   cx_impl_grid   ( cx_buff ) = cx_impl_grid   ( dst_cx )
+	   cx_naux        ( cx_buff ) = cx_naux        ( dst_cx )
+           DO 310 idim = 1, nferdims
+              cx_aux_var(idim, cx_buff) = cx_aux_var(idim, dst_cx)
+              cx_aux_cat(idim, cx_buff) = cx_aux_cat(idim, dst_cx)
+ 310       CONTINUE
+	   CALL TRANSFER_CONTEXT( cx_buff, dst_cx )  ! (nervous. is it ok to clobber this?)
+
+* create a space for the new result possibly with the edges flagged as bad
+	   CALL CREATE_MEM_VAR( dst_cx, dst_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_mr( lo_isp ) = dst_mr
+
+* auxiliary regridding often creates ragged edges, so pre-fill with missing values
+           CALL FILL_MEMORY ( memory, mr_blk1 (dst_mr),
+     .                        mr_nblks(dst_mr),
+     .                        mr_bad_data(dst_mr) )
+
+* diagnostic message ?
+	   IF (mode_diagnostic) THEN
+	      CALL DIAGNOSTIC_OUT('auxgrd ',dst_mr,  point_to_mr)
+	   ENDIF 
+
+* ... set up 4D array limits as unsubscripted variables in COMMON
+	   aux_mr_list(4) = src_mr
+	   aux_mr_list(5) = dst_mr
+           CALL NON_ARRAY_SUBSC( aux_mr_list, 5 )    ! 5 arguments to pass
+
+	   CALL DO_AUX_VAR_REGRID( memory, axis_list, naxis, aux_has_cell_pts,
+     .	   		memory(1,mr_blk1(src_mr )), src_mr,  src_cx,
+     .			memory(1,mr_blk1(dst_mr )), dst_mr,  dst_cx,
+     .			memory(1,mr_blk1(mr1)), mr1, cx1,
+     .			memory(1,mr_blk1(mr2)), mr2, cx2,
+     .			memory(1,mr_blk1(mr3)), mr3, cx3,
+     .			status )
+
+	   IF (status .NE. ferr_ok) GOTO 5000
+
+* clean up 
+ 400	   CONTINUE
+* (the following code was adapted from IS_DO_OP)
+
+* the "frame_bottom" is the isp level that will be left when the components of
+* the current calculation (1 to 3) are reduced to a single value.
+* on exit isp will point to the frame bottom and the result will be left there
+	   frame_bottom = lo_isp
+
+* ... if any components were un_cached we must uncache the result
+	   not_reusable = .FALSE.
+	   DO 410 icom = isp, frame_bottom, -1
+ 410	   IF ( ITS_UN_CACHED(is_mr(icom)) ) not_reusable = .TRUE.
+	   IF ( not_reusable ) CALL UN_CACHE( dst_mr )
+
+* ...release component cx stack space
+	   DO 420 isp = hi_isp, frame_bottom, -1
+	      IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) 'OP_STK??'	! temp
+	      cx_stack_ptr = cx_stack_ptr - 1
+	      mr  = is_mr( isp )
+	      IF ( mr_protected(mr) .EQ. mr_temporary
+     .	      .OR. mr_category (mr) .EQ. cat_temp_var ) THEN
+	         CALL DELETE_VARIABLE( mr )
+	      ELSE
+	         CALL MR_NOT_IN_USE( mr )
+	      ENDIF
+
+* ...deallocate dynamic grids from components
+	      com_cx = is_cx(isp)
+	      IF ( cx_has_impl_grid(com_cx) ) THEN
+	         impl_grid = cx_grid(com_cx)
+	         CALL DEALLO_DYN_GRID(impl_grid)
+	         cx_has_impl_grid(com_cx) = .FALSE.
+	      ENDIF
+ 420	   CONTINUE
+
+* collapse the interp stack frame
+	   isp = frame_bottom
+
+* save the result context at the cx level previously used by the 1st component (why?)
+	   cx_stack_ptr = cx_stack_ptr + 1
+	   CALL TRANSFER_CONTEXT( dst_cx, cx_stack_ptr )
+	   is_cx( isp ) = cx_stack_ptr
+
+	   RETURN 2
+	ENDIF
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .		'cant do auxiliary variable regridding on string variables',
+     .		 *5000)
+ 5500	com_name = VAR_CODE(cx_category(com_cx),
+     .                      cx_variable(com_cx) )
+        src_name = VAR_CODE(cx_category(src_cx),
+     .                      cx_variable(src_cx) )
+        i = TM_LENSTR1(com_name)
+        j = TM_LENSTR1(src_name)
+        CALL ERRMSG( ferr_invalid_command, status,
+     .          'auxiliary variable '//com_name(:i)//
+     .          ' has non-conformable length on '//ww_dim_name(idim)//
+     .          ' axis for regridding '//src_name(:j), *5000 )
+	END	
+
+
+
+
+
diff --git a/fer/stk/is_calc.F b/fer/stk/is_calc.F
new file mode 100644
index 0000000..bcc2d36
--- /dev/null
+++ b/fer/stk/is_calc.F
@@ -0,0 +1,191 @@
+	SUBROUTINE IS_CALC ( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a grid of "calculated" data - ie. a variable which does not exist on
+* disk but which can be computed from disk data by model-diagnostic code
+* ( eg computing heat advection from temperature and velocity fields )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/17/87
+* V200:  7/24/89 - 4D symmetric version based on ISP stack
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory(*)
+* normal exit is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+* V312: 5/94 - array "memory" as a calling argument
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* internal variable declarations:
+	LOGICAL	dummy_next, special_var, k_eq1
+	INTEGER hi_cx, lo_cx, lo_isp, cvar, nitem, item0, item, comp,
+     .		next_var, dset
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'instance_table.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+	include	'xprog_state.cmn'
+	include	'xdset_parms.cmn'
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of next activity ( component to get )
+*	 isp	<--	... ( current stack level )
+*	isp-1		...
+*	isp-2	<--	...	components of this cvar on stack
+*	isp-n		...
+*	lo_isp	<--	level controlling evaluation of cvar
+
+* --- end of introductory code ---
+
+* test to see if first time called - designate stack activity as algebra
+	IF ( is_act(isp) .EQ. isact_request ) THEN
+	   lo_isp = isp
+	   is_phase( lo_isp ) = 0
+	   is_act  ( lo_isp ) = isact_calculate
+	ELSE
+	   isp = isp + 1			! point to component just got
+	   lo_isp = is_obj( isp )
+	   hi_cx  = is_cx( isp )
+	ENDIF
+
+* convenience values
+	lo_cx  = is_cx( lo_isp )
+	cvar   = cx_variable( lo_cx )
+	dset   = cx_data_set( lo_cx )
+	nitem  = cvar_frame_length( cvar )
+	item0  = cvar_frame_start( cvar )
+
+* special needs for components of some variables
+	IF (cvar .GT. pcv_spec_flg) cvar = cvar - pcv_spec_flg
+* ... variables always requiring k=1 as lower Z limit
+	k_eq1 = cvar.EQ.pdpdx  .OR. cvar.EQ.pdpdy
+     .	   .OR. cvar.EQ.pw_u   .OR. cvar.EQ.pw_t
+
+* initialize stacks
+	IF ( is_phase( lo_isp ) .EQ. 0 ) THEN
+	   IF ( mode_diagnostic )
+     .			CALL DIAGNOSTIC_OUT( 'compute', lo_cx, point_to_cx )
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   hi_cx = cx_stack_ptr
+	ENDIF
+
+* set up to get next component
+ 100	is_phase(lo_isp) = is_phase(lo_isp) + 1
+	item = is_phase(lo_isp)			! points into cvar table
+	IF ( item .GT. nitem ) GOTO 1000
+	comp = item + item0
+
+* unravel the variable coding of the next component
+	next_var = cv_variable( comp )
+	special_var = next_var .GT. pcv_spec_flg
+	IF ( special_var ) next_var = next_var - pcv_spec_flg
+
+* the next component may be a dummy place holder
+	IF ( special_var ) THEN
+* this component was flagged for data-set-dependent special consideration
+* ... different action depending on what variable needs this component
+	   IF ( cvar .EQ. pqrad ) THEN
+	      dummy_next = dp_phil_qflux( dset )	! need SST ?
+	   ELSEIF ( cvar .EQ. pair ) THEN
+	      dummy_next = dp_const_air_sst( dset )	! need CAIR ?
+     .			.AND. cx_hi_ss(lo_cx,y_dim) .LT. 91
+	   ELSEIF ( cvar .EQ. pcair ) THEN
+	      dummy_next = .FALSE.
+	   ELSE
+	      CALL ERRMSG
+     .			( ferr_internal, status, 'cv_spec_flg', *5000 )
+	   ENDIF
+	ELSEIF ( cv_lo_d3(comp) .GT. pcv_keq1_flg ) THEN
+* component needed only at surface calculations
+* ... are we at the surface ?
+	   dummy_next = cx_lo_ss( lo_cx,z_dim ) .NE. 1
+	ELSE
+	   dummy_next = .FALSE.
+	ENDIF
+
+* process dummy place holder
+	IF ( dummy_next ) THEN
+	   isp = isp + 1
+	   is_mr(isp) = dummy_mr
+	   is_obj( isp ) = lo_isp	! claimed by this cvar calculation
+	   GOTO 100
+	ENDIF
+
+* create context for the next component needed
+	CALL CVAR_CONTEXT( lo_cx, hi_cx, comp, k_eq1, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* request this variable on the interpretation stack ( via RETURN 1 )
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx ( isp ) = hi_cx
+	is_obj( isp ) = lo_isp		! claimed by this cvar calculation
+	IF ( cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... special action if this component variable is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+	RETURN 1
+
+* all components are ready - do the calculation
+ 1000	CALL CALC_CVAR( memory,
+     .		        lo_cx, is_mr(lo_isp+1), is_mr(lo_isp), status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* pop off the stack space used by the components
+	isp = isp - nitem
+
+* pop off context used for components
+	IF ( hi_cx .NE. cx_stack_ptr ) WRITE (6, *) 'is_calc_stk' ! temp diag
+	cx_stack_ptr = cx_stack_ptr - 1
+	RETURN 2
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_const_var.F b/fer/stk/is_const_var.F
new file mode 100644
index 0000000..86610f2
--- /dev/null
+++ b/fer/stk/is_const_var.F
@@ -0,0 +1,90 @@
+	SUBROUTINE IS_CONST_VAR( memory, *, *, status )
+
+* create a constant valued array  "variable" in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500: 12/98 - based on IS_CONSTANT
+* V530:  8/00 *sh* - allow lists of strings
+* V533:  7/01 *sh* - allow single quoted strings
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+ 
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER	CGRID_SIZE,
+     .		mr, cx, size, uvar, item, start, end, n
+
+* --- end of introductory code ---
+* initialize
+	cx = is_cx( isp )
+	size = CGRID_SIZE(cx)
+
+* reserve and catalog space for the result
+* ... note: could create a lasting variable, but would need to make sure
+*     that when DELETE_VARIABLE is called it also purges all cat_const_var
+*     component variables. This approached seemed to add more complexity
+*     than value ...
+	CALL CREATE_TEMP_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('const_v',mr,point_to_mr)
+
+* parse and insert the constant array
+* ... note that the uvar number and item number of "{1,3,5}" are
+*     packed together in the cx_variable value
+	uvar = cx_variable(cx)/1000
+	item = cx_variable(cx) - 1000*uvar
+	start = uvar_item_start( item, uvar )
+	end   = uvar_item_end  ( item, uvar )
+
+	IF ( INDEX(uvar_text(uvar)(start:end), '"') .GT. 0
+     .	.OR. INDEX(uvar_text(uvar)(start:end), "'") .GT. 0 ) THEN
+* ... set up FORTRAN-independent pointer
+	   CALL INIT_C_STRING_ARRAY( size,
+     .				     memory(1,mr_blk1(mr)),
+     .				     mr_c_pointer(mr)      )
+
+* ... array of strings
+* NOTE: this routine will alter the context size and replace the mr
+* (allocating a larger block of memory) if the SYSTEM: syntax is used
+	   CALL PARSE_STRING_LIST(cx,
+     .				  uvar_text(uvar)(start:end),
+     .			          mr,
+     .			          status)
+	ELSE
+* ... array of numbers
+! ... as-of 12/98 limited to one block max array lentgh
+	   CALL PARSE_NUMBER_LIST(uvar_text(uvar)(start:end),
+     .			          memory( 1, mr_blk1(mr)),
+     .			          size,
+     .			          n,
+     .			          status)
+	ENDIF
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* set the bad data flag
+	mr_bad_data( mr ) = bad_val4
+
+* result is ready to return to the stack
+	is_mr( isp ) = mr
+
+* got the requested component
+	RETURN 2
+! RETURN 1, which is to request a sub-component, is never used ...
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_constant.F b/fer/stk/is_constant.F
new file mode 100644
index 0000000..7abd025
--- /dev/null
+++ b/fer/stk/is_constant.F
@@ -0,0 +1,93 @@
+	SUBROUTINE IS_CONSTANT( memory, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a constant value "variable" in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/28/87
+* revision 0.1 - 6/23/88 - set bad data flag to -2.1E34 so -1.E34 is valid
+* V200:  6/26/89 - just a single value
+*	11/30/89 - added diagnostic output
+* V312: 5/94 - array "memory" as a calling argument
+* V554  1/04 - *acm* remove VAX common statements.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+ 
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER	mr, cx
+
+* equivalences
+	REAL	cx_value( max_cx )
+	EQUIVALENCE ( cx_variable, cx_value )
+
+* --- end of introductory code ---
+* initialize
+	cx = is_cx( isp )
+
+* reserve and catalog space for the result
+	CALL CREATE_TEMP_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( isp ) = mr
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('constan',mr,point_to_mr)
+
+* insert the constant
+	memory( 1, mr_blk1(mr) ) = cx_value(cx)
+
+* set the bad data flag to an unusual number
+	mr_bad_data( mr ) = -2.1E34
+
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_counter_var.F b/fer/stk/is_counter_var.F
new file mode 100644
index 0000000..749194a
--- /dev/null
+++ b/fer/stk/is_counter_var.F
@@ -0,0 +1,115 @@
+	SUBROUTINE IS_COUNTER_VAR( var, memory, *, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* create a counter array  "variable" in memory
+
+* programmer - Ansley Manke, from is_const_var
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* Ferret v5.54 1/04
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+        include 'xcontrol.cmn'
+        include 'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	var, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER	mr, cx, csp1, idim
+	REAL    counter_const
+
+* initialize
+	cx = is_cx( isp )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('counter_v',mr,point_to_mr)
+
+* parse and insert the counter variable
+
+* cs_command has set cs_phase to point to the next value of the loop controller
+        
+        csp1 = csp_cvar(var)
+	counter_const = cs_phase( csp1 ) - cs_delta( csp1 )
+
+* reserve and catalog space for the result
+	CALL CREATE_TEMP_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( isp ) = mr
+        
+        idim = 1
+
+	cx_lo_ss    ( cx, idim ) = unspecified_int4
+	cx_hi_ss    ( cx, idim ) = unspecified_int4
+        cx_by_ss    ( idim, cx ) = .TRUE.
+
+	mr_lo_ss    ( cx, idim ) = unspecified_int4
+	mr_hi_ss    ( cx, idim ) = unspecified_int4
+
+	cx_trans    ( idim, cx ) = trans_no_transform
+	cx_trans_arg( idim, cx ) = bad_val4
+	if (idim .EQ. t_dim ) 
+     .      cx_calendar(cx) = .FALSE.
+
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('constan',mr,point_to_mr)
+
+* insert the constant
+	memory( 1, mr_blk1(mr) ) = counter_const
+
+* set context data
+	cx_bad_data( cx ) = bad_val4
+	cx_data_set( cx ) = pdset_irrelevant
+	cx_dset_gvn( cx ) = .FALSE.
+
+* set the bad data flag to an unusual number
+	mr_bad_data( mr ) = -2.1E34
+
+* got the requested value
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_dependencies.F b/fer/stk/is_dependencies.F
new file mode 100644
index 0000000..6ae060b
--- /dev/null
+++ b/fer/stk/is_dependencies.F
@@ -0,0 +1,351 @@
+	SUBROUTINE IS_DEPENDENCIES( *, *, work, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* this routine is derived from IS_UVAR_GRID
+* see that routine for a discussion of how it is implemented
+* instead of evaluating the grid of a uvar, this routine traces through the
+* same path and reports out the dependencies
+* It also handles dependencies created by
+*  o auxiliary variables used in uaxvar regridding
+*  o aggregated variables created using DEFINE AGGREGATION
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V690 9/13 *sh*  -- with provisions for aux variables tested and refined
+
+* calling argument declarations:
+	INTEGER	status
+	INTEGER work(*)
+* normal return is for error conditions
+* exit #1 is to request dependencies of a component ( stack has been pushed )
+* exit #2 is to signal that the dependencies of a uvar have been traced
+
+* internal variable declarations:
+	LOGICAL	ITSA_GCVAR, its_gc, 
+     .		get_aux_vars, delayed_by_auxvars, desist
+	INTEGER TM_LENSTR1, GCF_PARENT_UVAR, GCF_PARENT_CHAR, 
+     .		NCF_GET_AGG_COUNT,
+     .		iaux, auxcnt, hi_cx, lo_cx, aux_cx, start, iend,
+     .		i, dset, uvar, item, itype, idim, nitem, var, len_name, 
+     .          memb_cx, agg_dset, agg_len, var_status,
+     .		imemb, fer_uvar, memb_dset, memb_grid, iline, nv
+
+	CHARACTER VAR_CODE*128, name*512, varcode*128
+
+#include "netcdf.inc"
+	include	'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xdependency_tree.cmn'
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level to get grids for components
+*	 isp	<--	current level: evaluate uvar or var/auxvar dependencies
+
+* --- end of introductory code ---
+
+* initialize
+	lo_cx  = is_cx( isp )
+	uvar   = is_uvar( isp )
+	dset   = cx_data_set( lo_cx )
+	nitem  = uvar_num_items( uvar )
+	its_gc = ITSA_GCVAR(uvar)
+!	has_uvar_gc = has_uvar_gc .OR. its_gc  ! for repl_exprns fixing bug 1523
+* if aux var dependencies have just been reported, then we have to yet to 
+* report user variable dependencies
+* e.g.	in
+*   LET V = a + b
+*   SHOW VAR/DEP v[gz(depth)=zpts]
+* after reporting that V depends on depth, we need to report on "V=a+b"
+	delayed_by_auxvars = is_sum(isp) .NE. 0
+	IF (delayed_by_auxvars) is_phase(isp) = is_phase(isp) - 1
+
+****
+* Handle auxiliary variables
+	get_aux_vars = is_act(isp) .EQ. isact_auxvar_regrid
+	IF  ( get_aux_vars ) THEN
+ 10	   is_phase(isp) = is_phase(isp) + 1
+	   iaux = is_phase(isp)
+	   IF (iaux .GT. cx_naux(lo_cx) ) THEN
+	      is_sum(isp-1) = 1  ! signal completion of aux vars
+	      GOTO 1000  ! we have finished reporting aux vars
+	   ENDIF
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   aux_cx = cx_stack_ptr
+* ... in GET_VAR_CONTEXT valid_aux_var was set. Tells if aux varname is known
+	   IF (.NOT. cx_valid_aux(iaux, lo_cx) ) THEN
+* ... find the idim value where this aux var info is stored
+	      auxcnt = 0
+	      DO 12 idim = 1, nferdims
+	         IF ( cx_aux_arg_start(idim, hi_cx)
+     .		 .NE. unspecified_int4)  auxcnt = auxcnt + 1
+	         IF (auxcnt .EQ. iaux) GO to 14
+ 12	      CONTINUE
+	      CALL ERRMSG( ferr_internal, 'is_dependencies', *5000)
+* ... extract the start and end of the text string for the unknown auxvar
+ 14	      cx_variable(aux_cx) = cx_aux_arg_start(idim, hi_cx) 
+	      cx_category(aux_cx) = cx_aux_arg_end (idim, hi_cx) 
+	      status = ferr_unknown_auxvar
+	   ELSE
+* ... get full context for a known auxiliary variable
+	      CALL GET_AUX_VAR_CONTEXT( hi_cx, aux_cx, iaux, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+ 	   ENDIF
+	   CALL REPORT_AUX_DEPENDENCY( aux_cx, isp, uvar, item,
+     .				       work, status, desist     )
+           IF (.NOT.desist
+     .    .AND. cx_category(aux_cx) .EQ. cat_user_var) THEN
+* ... if its a uvar go show dependencies INSIDE of the aux variable definition
+              CALL PUSH_INTERP_STACK( isp, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              is_cx   ( isp ) = aux_cx
+              is_uvar ( isp ) = cx_variable( aux_cx )
+              is_act  ( isp ) = isact_algebra
+              RETURN 1
+	   ELSE
+	      cx_stack_ptr = cx_stack_ptr - 1
+	      GOTO 10	! do next aux var
+           ENDIF
+	ENDIF
+
+****
+* Handle aggregate variables
+	IF ( is_act(isp) .EQ. isact_aggregate_gather ) THEN
+	   agg_dset = dset
+	   status = NCF_GET_AGG_COUNT (agg_dset, agg_len)
+	   var = cx_variable(lo_cx)
+ 20	   is_phase(isp) = is_phase(isp) + 1
+	   imemb = is_phase(isp)
+	   IF (imemb .GT. agg_len ) THEN
+	      GOTO 1000  ! we have finished reporting aux vars
+	   ENDIF
+* .. set up a stack level w/ info about the next aggregation member
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   memb_cx = cx_stack_ptr
+	   CALL TRANSFER_CONTEXT(lo_cx, memb_cx)
+	   varcode = VAR_CODE(cat_aggregate_var, var)
+	   CALL CD_GET_AGG_VAR_INFO (agg_dset, varcode, imemb, 
+     .            fer_uvar, memb_dset, memb_grid, iline, nv, status)
+	   cx_category(memb_cx) = fer_uvar
+	   cx_data_set(memb_cx) = memb_dset
+	   cx_variable(memb_cx) = nv
+	   status = ferr_ok
+	   CALL REPORT_DEPENDENCY(memb_cx, isp, uvar, item,
+     .				  work, status, desist )
+           IF (.NOT.desist
+     .	  .AND. cx_category(memb_cx) .EQ. cat_user_var) THEN
+* ... if its a uvar go show dependencies
+              CALL PUSH_INTERP_STACK( isp, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              is_cx   ( isp ) = memb_cx
+              is_uvar ( isp ) = cx_variable( memb_cx )
+              is_act  ( isp ) = isact_algebra
+              RETURN 1
+	   ELSE
+	      cx_stack_ptr = cx_stack_ptr - 1
+	      GOTO 20	! do next aggregation member
+           ENDIF
+	ENDIF
+
+
+****
+* Handle user-defined variable (uvar)
+* is_act(isp) is equal to isact_aggregate_gather
+* process the next item in the expression from the uvar buffer (last to first)
+ 100	is_phase(isp) = is_phase(isp) + 1
+* ... for showing dependencies traverse in natural, forward order
+!	item = nitem - is_phase(isp)	+ 1	! reverse-ordered pointer
+	item = is_phase(isp)
+	IF ( item .GT. nitem ) GOTO 1000	! have processed entire def'n
+	itype = uvar_item_type ( item, uvar )
+	start = uvar_item_start( item, uvar )
+	iend   = uvar_item_end  ( item, uvar )
+	IF     ( itype .EQ. alg_pseudo_var  ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_const_var   ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_child_var   ) THEN
+	   GOTO 300
+	ELSEIF ( itype .EQ. alg_variable    ) THEN
+	   GOTO 305
+	ELSEIF ( itype .EQ. alg_attrib_val  ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_string      ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_constant    ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_counter_var   ) THEN
+	   GOTO 100
+	ELSEIF ( itype .EQ. alg_then_marker ) THEN  ! marks where the IF was
+	   GOTO 100
+	ELSE
+	   GOTO 100
+	ENDIF
+
+* ==================================
+
+ 300	CALL GCF_CHILD_VAR_NAME( GCF_PARENT_UVAR(uvar),
+     .				 GCF_PARENT_CHAR(uvar,start), name )
+	len_name = TM_LENSTR1(name)
+	GOTO 310
+
+* variable: parse name, get full expression context
+ 305	name = uvar_text(uvar)(start:iend)
+	len_name = iend-start+1
+ 310	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	hi_cx = cx_stack_ptr
+	CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				lo_cx,
+     .				hi_cx,
+     .				var_status )
+
+* have we returned here after reporting auxvar dependencies?
+* if so we have already reported this variable
+	IF (delayed_by_auxvars) THEN
+	   delayed_by_auxvars = .FALSE.
+	   is_sum(isp) = 0
+	   GOTO 900
+	ENDIF
+
+* report the variable just parsed -- known or unknown or with syntax errors
+*   note that auxvar errors are dealt with in the auxvar block above
+	IF ( var_status .NE. ferr_unknown_auxvar ) THEN
+	   CALL REPORT_DEPENDENCY( hi_cx, isp, uvar, item,
+     .				   work, var_status, desist )
+	ENDIF
+
+* if the variable used auxiliary variables for regridding set up new isp
+* level and go report them (before reporting on uvar dependencies)
+	IF  ( .NOT.desist
+     .	.AND. cx_unstand_grid(hi_cx)
+     .	.AND. cx_naux(hi_cx) .GT. 0 ) THEN
+	   CALL PUSH_INTERP_STACK( isp, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   is_phase( isp ) = 0
+	   is_cx   ( isp ) = hi_cx
+	   is_uvar ( isp ) = is_uvar(isp - 1)
+	   is_act  ( isp ) = isact_auxvar_regrid
+	   is_sum  ( isp ) = 0    ! set to 1 only when returning after auxvars
+	   RETURN 1
+	ELSEIF (var_status .EQ. ferr_unknown_variable ) THEN
+	   cx_stack_ptr = cx_stack_ptr - 1
+	   GOTO 100
+	ENDIF
+
+* if the variable is a uvar set up a new isp level and report the dependencies
+ 900	   IF (.NOT.desist
+     .	 .AND. cx_category(hi_cx) .EQ. cat_user_var) THEN
+	   IF (its_gc) is_phase(isp) = is_phase(isp) - 1  ! WILL NEED WORK!!
+* ... load the new variable info onto the IS stack
+	   CALL PUSH_INTERP_STACK( isp, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   is_cx   ( isp ) = hi_cx
+	   is_uvar ( isp ) = cx_variable( hi_cx )
+	   is_act  ( isp ) = isact_algebra
+	   is_sum  ( isp ) = 0    ! flag that we are not returning from auxvars
+	   RETURN 1
+* if the variable is an aggregation from multiple datasets set up new isp
+* level and report the ensemble members 
+	ELSEIF  ( .NOT.desist
+     .	    .AND. cx_category(hi_cx) .EQ. cat_aggregate_var ) THEN
+	   CALL PUSH_INTERP_STACK( isp, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   is_phase( isp ) = 0
+	   is_cx   ( isp ) = hi_cx
+	   is_uvar ( isp ) = is_uvar(isp - 1)
+	   is_act  ( isp ) = isact_aggregate_gather
+	   is_sum  ( isp ) = 0    ! set to 1 only when returning after auxvars
+	   RETURN 1
+* nothing more to do about the variable that was just reported
+	ELSE
+	   cx_stack_ptr = cx_stack_ptr - 1
+	   GOTO 100
+	ENDIF
+
+* more aggregate variable support
+!* grid for this aggregate dataset is not known.  Back to get_uvar_grid and call
+!* is_aggregate_grid to get it
+!* ... repeat this phase again when we get back
+! 990	is_phase(isp) = is_phase(isp) - 1
+!* load the new variable info onto the IS stack
+!	CALL PUSH_INTERP_STACK( isp, status )
+!	IF ( status .NE. ferr_ok ) RETURN
+!c	is_sum( isp ) = isalg_merge_n
+!
+!	is_cx   ( isp ) = hi_cx
+!	is_uvar ( isp ) = cx_variable( hi_cx )
+!	is_act  ( isp ) = isact_get_agg_grid	! get aggregate grid on return.
+!
+!	RETURN 1
+	
+* clean up: release context and isp stack space
+ 1000	CONTINUE
+	cx_stack_ptr = cx_stack_ptr - 1
+	isp = isp - 1
+
+! unclear -- is there special stuff to do for remote uvar definitions?
+* Is it a LET/REMOTE variable?
+* ! do we need to find a slot in rvar_uvar, and index the rvars with "rvar", 
+* !or just use same indexing as for regular user-vars?
+!        IF (uvar_remote(uvar)) THEN
+!
+!	   CALL CD_DSET_REMOTEOK(dset, ok_remote)
+!	   IF (ok_remote) THEN
+!	      uvar_remote(uvar) = .TRUE. 
+!	      rvar_uvar(uvar) = uvar  
+!	      rvar_dset(uvar) = dset
+!c	      rvar_on_server(uvar) = .FALSE. 
+!	   ELSE
+!	      uvar_remote(uvar) = .FALSE. 
+!	   ENDIF
+!	ENDIF
+
+	RETURN 2
+
+* error exit
+ 5000	CALL DEALLO_ALL_GRIDS
+	RETURN
+! 9000	CALL ERRMSG( ferr_internal, status, 'is_uvar_grid', *5000 )
+
+	END	
diff --git a/fer/stk/is_do_gc_fcn.F b/fer/stk/is_do_gc_fcn.F
new file mode 100644
index 0000000..6664b40
--- /dev/null
+++ b/fer/stk/is_do_gc_fcn.F
@@ -0,0 +1,347 @@
+	SUBROUTINE IS_DO_GC_FCN
+     .			( memory, uvar, alg_text, lo_isp, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* do bookkeeping and call up calculation to perform grid changing fcn
+* (which may be an externally-defined function)
+
+* V450:  1/97 - based on IS_DO_OP
+*        7/97 - added status and memory args to DO_INTERNAL_GC_FCN call
+*       7/25/97 - increase number of args allowed from 5 to 10
+* V500:  1/99 *sh* Trap as errors attempts to use string variables as
+*		arguments ti internal functions.
+*		Strings may be passed only to external functions
+* V530:  8/00 *sh* - check on string data type -- not category
+* V533:  6/01 *sh* - support for args that may be string or float
+* V540: *sh* 10/01 - use improved data typing general parameter parg_type_* defs
+* 1/03 *kob* g77 port requires risc buff for arbitrary string concats
+*  V6.0 *acm*  5/06 string results for external functions, set return type.
+* V6.2 *acm* 11/08 New function efcn_get_alt_type_fcn gets the name of a 
+*                  function to call if the arguments are of a different type 
+*                  than defined in the current function. e.g. this lets the 
+*                  user reference XCAT with string arguments and Ferret will 
+*                  run XCAT_STR
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*      *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V68   3/12 *KMS/ACM* see 6D branch: working on string bugs. Remove overloading
+*                   of argument/return-type variable and predimensional (data size)
+*                   array parameter (pointer size to one in double-precision Ferret).
+
+        IMPLICIT NONE
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+        include 'grid_chg_fcns.parm'
+	include	'rpn.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include	'xtext_info.cmn'
+	include	'xfr_grid.cmn'	! w/ mgrid_abstract
+	include 'xgrid_chg_fcns.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling arguments
+	INTEGER		uvar, lo_isp, status
+	REAL		memory( mem_blk_size, max_mem_blks )
+	CHARACTER*(*)	alg_text
+
+* local variables
+	LOGICAL	ITS_UN_CACHED, not_reusable, check_alt_fcn
+	INTEGER	GCF_FIND_FCN, GCF_NUM_ARGS, GCF_ARG_TYPE,
+     .		MGRID_SIZE_DELTA, GCF_ARG_EVAL_ORDER, EFCN_GET_RTN_TYPE,
+     .		ifcn, icom, iarg, num_com, mr, res_cx,
+     .		mr1, mr2, mr3, mr4, mr5, mr6, mr7, mr8, mr9, impl_grid,
+     .          typ1, typ2, typ3, typ4, typ5, typ6, typ7, typ8, typ9,
+     .          typr, pdim1, pdim2, pdim3, pdim4, pdim5, pdim6, pdim7,
+     .          pdim8, pdim9, pdimr, frame_bottom, com_cx, res_mr,
+     .          itype
+        CHARACTER*40 alt_name
+
+* convenience equivalences
+	INTEGER	com(10), typ(9), pdim(9)
+	EQUIVALENCE (com(1),mr1), (com(2),mr2), (com(3),mr3), (com(4),mr4),
+     .              (com(5),mr5),
+     .		    (com(6),mr6), (com(7),mr7), (com(8),mr8), (com(9),mr9),
+     .              (com(10),res_mr)
+	EQUIVALENCE (typ(1),typ1), (typ(2),typ2), (typ(3),typ3),
+     .		    (typ(4),typ4), (typ(5),typ5), (typ(6),typ6),
+     .		    (typ(7),typ7), (typ(8),typ8), (typ(9),typ9)
+        EQUIVALENCE (pdim(1),pdim1), (pdim(2),pdim2), (pdim(3),pdim3),
+     .              (pdim(4),pdim4), (pdim(5),pdim5), (pdim(6),pdim6),
+     .              (pdim(7),pdim7), (pdim(8),pdim8), (pdim(9),pdim9)
+
+* local parameter declarations
+* ... pfloat_words indicates that each float value in an array is 1 word
+* ... ptpr_words   indicates that each pointer     in an array is 2 word
+* These are assigned to pdim values
+	INTEGER	    pfloat_words, pptr_words
+#ifdef double_p
+	PARAMETER  (pfloat_words = 1,
+     .		    pptr_words   = 1 )
+#else
+	PARAMETER  (pfloat_words = 1,
+     .		    pptr_words   = 2 )
+#endif
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	 isp	<--	most recently obtained component for calculation
+*	isp-1		...
+*	isp-2	<--	...	other components of this expression on stack
+*	isp-n		...
+*	lo_isp	<--	level at which expression evaluation was called
+
+* the "frame_bottom" is the isp level that will be left when the components of
+* the current calculation (1 to 3) are reduced to a single value.
+* on exit isp will point to the frame bottom and the result will be left there
+
+* initialize all data types to default of FLOAT
+        DO icom = 1, 9
+          typ(icom) = parg_type_float
+          pdim(icom) = pfloat_words
+        ENDDO
+
+* identify the text of the particular function
+*	(internal or external GC fcn handled the same)
+	ifcn = GCF_FIND_FCN( alg_text )
+	IF ( ifcn .EQ. unspecified_int4 ) STOP ' bad GC fcn err'
+	num_com = GCF_NUM_ARGS( ifcn )
+
+* sanity check on stack contents
+	frame_bottom = isp - num_com + 1
+	IF ( frame_bottom .LE. lo_isp ) CALL ERRMSG
+     .		( ferr_syntax, status, 'RPN', *5000 )
+
+* trap attempts to pass arguments of the wrong type (1/99)
+
+        check_alt_fcn = .FALSE.
+	DO 100 icom = 1, num_com
+	   iarg = GCF_ARG_EVAL_ORDER(ifcn, icom)
+	   itype = GCF_ARG_TYPE(ifcn, iarg)
+	   com_cx  = is_cx(frame_bottom+icom-1)
+           IF ( cx_type(com_cx) .EQ. ptype_string ) THEN
+              typ(icom) = parg_type_string
+              pdim(icom) = pptr_words
+           ENDIF
+	   IF ( (cx_type(com_cx) .EQ. ptype_string)
+     .	        .NEQV. (itype .EQ. parg_type_string) ) THEN
+	      IF (itype .NE. parg_type_float_or_string)  
+     .           check_alt_fcn = .TRUE.
+	   ENDIF
+ 100	CONTINUE
+
+* Does the function designate an alternate function for strings?
+* If so, check the argument types for it.
+
+        IF (check_alt_fcn) THEN
+*          alt_name is blank-terminated (not null-terminated)
+*          and is unchanged if alt_type_fcn does not exist
+           alt_name = ' '
+	   CALL efcn_get_alt_type_fcn( ifcn, alt_name )  
+	   ifcn = GCF_FIND_FCN( alt_name )
+	   IF (ifcn .EQ. unspecified_int4) GOTO 5200
+
+* re-initialize all data types to default of FLOAT
+           DO icom = 1, 9
+             typ(icom) = parg_type_float
+             pdim(icom) = pfloat_words
+           ENDDO
+      	   DO 101 icom = 1, num_com
+	      iarg = GCF_ARG_EVAL_ORDER(ifcn, icom)
+	      itype = GCF_ARG_TYPE(ifcn, iarg)
+	      com_cx  = is_cx(frame_bottom+icom-1)
+              IF (cx_type(com_cx) .EQ. ptype_string) THEN
+                 typ(icom) = parg_type_string
+                 pdim(icom) = pptr_words
+              ENDIF
+	      IF ( (cx_type(com_cx) .EQ. ptype_string)
+     .	           .NEQV. (itype .EQ. parg_type_string) ) THEN
+	         IF (itype .NE. parg_type_float_or_string) 
+     .              GOTO 5200
+	      ENDIF
+ 101	   CONTINUE
+        ENDIF
+
+!* the merged context is already nearly complete
+	res_cx = is_big_cx(lo_isp)
+
+* determine data type of result - and set pdimr and typr
+        IF ( ifcn .LE. GFCN_NUM_INTERNAL ) THEN
+*          only truly-internal grid-changing functions get here
+*          Ferret already knows the return type since it may depend on argument type
+*          (under the get_uvar_grid - is_uvar_grid - merge_grid calling stack)
+           cx_type(res_cx) = uvar_data_type(uvar, cx_data_set(res_cx))
+           IF ( cx_type(res_cx) .EQ. ptype_string ) THEN
+              typr = pfcn_rtn_string
+              pdimr = pptr_words
+           ELSE IF ( cx_type(res_cx) .EQ. ptype_float ) THEN
+              typr = pfcn_rtn_float
+              pdimr = pfloat_words
+           ELSE
+              STOP 'IS_DO_GC_FCN cs_type(res_cx) is neither ptype_string nor ptype_float'
+           ENDIF
+        ELSE
+*          get the return type from the external function information
+*          this includes "external" functions internalized (statically linked in)
+           typr = EFCN_GET_RTN_TYPE (ifcn)
+           IF ( typr .EQ. pfcn_rtn_string ) THEN
+              cx_type(res_cx) = ptype_string
+              pdimr = pptr_words
+           ELSE IF ( typr .EQ. pfcn_rtn_float ) THEN
+              cx_type(res_cx) = ptype_float
+              pdimr = pfloat_words
+           ELSE
+              STOP 'IS_DO_GC_FCN typr is neither pfcn_rtn_string nor pfcn_rtn_float'
+           ENDIF
+           uvar_data_type(uvar, cx_data_set(res_cx)) = cx_type(res_cx) 
+        ENDIF
+
+* need to fill in those axes that the function "imposes"
+	CALL GCF_IMPOSE_RESULT_LIMS( ifcn, memory, is_mr(lo_isp+1),
+     .			 is_cx(lo_isp+1), res_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+        
+
+* allocate memory space for result
+	CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mr_category( res_mr ) = cat_temp_var
+	mr_variable( res_mr ) = res_mr	! cat_temp_var vars point to themselves
+	IF (cx_type(res_cx) .EQ. ptype_string) THEN
+	   CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(res_mr),
+     .                               memory(1, mr_blk1(res_mr)),
+     .                               mr_c_pointer(res_mr)      )
+	ENDIF
+
+* point to the memory resident components
+* (if fewer than 9 components default extras to dummy)
+	DO 300 icom = 1, num_com
+ 300	com(icom) = is_mr(frame_bottom+icom-1)
+	DO 310 icom = num_com+1, 9
+ 310	com(icom) = dummy_mr
+
+* set up 6D array limits as unsubscripted variables in COMMON
+	CALL NON_ARRAY_SUBSC( com, 10 )
+
+* perform the operation
+
+	IF (IFCN .LE. GFCN_NUM_INTERNAL) THEN
+
+	  CALL DO_INTERNAL_GC_FCN( memory,
+     .		ifcn, num_com, is_cx(frame_bottom),
+     .		memory(1, mr_blk1(mr1) ), mr1, pdim1, typ1,
+     .		memory(1, mr_blk1(mr2) ), mr2, pdim2, typ2,
+     .		memory(1, mr_blk1(mr3) ), mr3, pdim3, typ3,
+     .		memory(1, mr_blk1(mr4) ), mr4, pdim4, typ4,
+     .		memory(1, mr_blk1(mr5) ), mr5, pdim5, typ5,
+     .		memory(1, mr_blk1(mr6) ), mr6, pdim6, typ6,
+     .		memory(1, mr_blk1(mr7) ), mr7, pdim7, typ7,
+     .		memory(1, mr_blk1(mr8) ), mr8, pdim8, typ8,
+     .		memory(1, mr_blk1(mr9) ), mr9, pdim9, typ9,
+     .		memory(1, mr_blk1(res_mr)), res_mr, pdimr, typr,
+     .		res_cx, status )
+	  IF ( status .NE. ferr_ok ) GOTO 5100
+
+	ELSE 
+
+	  CALL DO_EXTERNAL_GC_FCN( memory,
+     .			ifcn, num_com, com, is_cx(frame_bottom),
+     .			memory(1, mr_blk1(mr1) ), mr1,
+     .			memory(1, mr_blk1(mr2) ), mr2,
+     .			memory(1, mr_blk1(mr3) ), mr3,
+     .			memory(1, mr_blk1(mr4) ), mr4,
+     .			memory(1, mr_blk1(mr5) ), mr5,
+     .			memory(1, mr_blk1(mr6) ), mr6,
+     .			memory(1, mr_blk1(mr7) ), mr7,
+     .			memory(1, mr_blk1(mr8) ), mr8,
+     .			memory(1, mr_blk1(mr9) ), mr9,
+     .			memory(1, mr_blk1(res_mr)), res_mr,
+     .			status )
+
+
+	ENDIF
+
+* clean up 
+ 
+* ... if any components were un_cached we must uncache the result
+	not_reusable = .FALSE.
+	DO 2050 icom = isp, frame_bottom, -1
+ 2050	IF ( ITS_UN_CACHED(is_mr(icom)) ) not_reusable = .TRUE.
+	IF ( not_reusable ) CALL UN_CACHE( res_mr )
+
+* ...release component cx stack space
+	DO 2100 isp = isp, frame_bottom, -1
+	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) 'OP_STK??'	! temp
+	   cx_stack_ptr = cx_stack_ptr - 1
+	   mr  = is_mr( isp )
+	   IF ( mr_protected(mr) .EQ. mr_temporary
+     .	   .OR. mr_category (mr) .EQ. cat_temp_var ) THEN
+	      CALL DELETE_VARIABLE( mr )
+	   ELSE
+	      CALL MR_NOT_IN_USE( mr )
+	   ENDIF
+* (9/95) deallocate dynamic grids from components
+	   com_cx = is_cx(isp)
+	   IF ( cx_has_impl_grid(com_cx) ) THEN
+	      impl_grid = cx_grid(com_cx)
+	      CALL DEALLO_DYN_GRID(impl_grid)
+	      cx_has_impl_grid(com_cx) = .FALSE.
+	   ENDIF
+ 2100	CONTINUE
+
+* collapse the interp stack frame
+	isp = frame_bottom
+	is_mr( isp ) = res_mr
+
+* save the result context at the cx level previously used by the 1st component
+	cx_stack_ptr = cx_stack_ptr + 1
+	CALL TRANSFER_CONTEXT( res_cx, cx_stack_ptr )
+	is_cx( isp ) = cx_stack_ptr
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL DELETE_VARIABLE(res_mr)
+	GOTO 5000
+* 1/03 *kob* g77 port requires risc buff for arbitrary string concats
+ 5200	CONTINUE
+* Could not match argument types
+        risc_buff = alg_text
+	CALL ERRMSG( ferr_invalid_command, status,
+     .		'string/numeric data type mix-up: '//risc_buff, *5000 )
+	END
+
diff --git a/fer/stk/is_do_op.F b/fer/stk/is_do_op.F
new file mode 100644
index 0000000..0d9a9ac
--- /dev/null
+++ b/fer/stk/is_do_op.F
@@ -0,0 +1,345 @@
+	SUBROUTINE IS_DO_OP( memory, alg_type, alg_text, lo_isp, 
+     ,                       ifv, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* do bookkeeping and call up calculation to perform op_num between
+* 0,1,2 or 3 grids
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 2/13/87 - based on ALG_DO_OP rev 1.0
+* revision 1.0 - 8/11/87 - allowed for expanding grids: lines to planes, etc.
+* revision 1.1 - 9/30/87 - added mr_perm_prot
+* revision 1.2 - 2/18/88 - bug fix: LOAD/i=lo:hi/j=j1/k=k1/l=lo:hi temp,salt
+*				    LIST/i=i1 temp salt +
+*				  --> dimension error: tries to expand temp,salt
+*				and check the data planes before GRID_OPERATIO*
+* revision 1.3 - 7/8/88  - make sure subscript limits are adequate
+* revision 1.4 - 1/31/89 - passed num_com to GRID_OPERATION
+* V200:  6/20/89 - re-worked user defined variable logic
+*	10/16/89 - set up adjustable array limits with NON_ARRAY_SUBSC
+*	11/27/89 - IF-THEN-ELSE logic
+* V230:   8/7/92 - upped to 4 the number of arguments a function can use
+* V312: 5/94 - array "memory" as a calling argument
+* V400: corrected bad type declaration of STR_MATCH (found by IBM compiler)
+* V420: 9/95 - deallocate dynamic grids from components that had 'em
+*       10/5 ... a subtle change required by this is that the result must not
+*	       explicitly require the same grid as the first component  (lest
+*	       the result get deleted when that grid is deallocated.  In
+*	       fact, the true result grid and context are created by the
+*	       individual mergers of each component ... never by examining
+*	       the grid that results from this routine.  Thus (experimentally)
+*	       we will always represent the output of this routine as being
+*	       on grid ABSTRACT.  Hopefully, there will be no side-effects.
+*	11/95 - if any of the components are non-reusabe ("un_cached") so
+*		must be the result
+* V500:  1/99 *sh* Trap as errors attempts to use string variables as
+*		arguments. Strings may be passed only to grid-changing
+*		functions (see IS_DO_GC_FC)
+* V530:  8/00 *sh* added support for string arrays
+* V533:  7/01 *sh* improved support for string arrays -- logical operations
+* V630:  9/09 *acm* Fix bug 1380: If the operation is a EQ,NE,LT,LE,GT,GE on 
+*                 string arguments, the result is numeric. Set cx_type(res_cx) 
+*                 accordingly, then compound conditinals will work.
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V68  3/12  *acm* The string operations EQ, NE, LT, etc return a float-type result.
+*                  Reset mr_type; it has already been set to string elsewhere.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'rpn.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include	'xtext_info.cmn'
+	include	'xfr_grid.cmn'	! w/ mgrid_abstract
+
+* calling arguments
+	LOGICAL		ifv
+	INTEGER		alg_type, lo_isp, status
+	REAL		memory( mem_blk_size, max_mem_blks )
+	CHARACTER*(*)	alg_text
+
+* local variables
+	LOGICAL	ITS_UN_CACHED, not_reusable, arg_types_matched,
+     .		numerical_op
+	INTEGER	CX_DIM_LEN, STR_MATCH, MGRID_SIZE_DELTA,
+     .		ifcn, iop, ilogic, icom, idim, num_com, mr, res_cx,
+     .		mr1, mr2, mr3, mr4, impl_grid, arg_type, i1,
+     .		frame_bottom, op_num, res_len, com_len, com_cx, res_mr
+
+* convenience equivalences
+	INTEGER	com(5)
+	EQUIVALENCE (com(1),mr1), (com(2),mr2), (com(3),mr3), (com(4),mr4),
+     .              (com(5),res_mr)
+
+* local parameter declarations
+	INTEGER	     p_log_op_first, p_log_op_last  ! see operate.F
+	PARAMETER  ( p_log_op_first = 8,
+     .		     p_log_op_last = 13 )
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	 isp	<--	most recently obtained component for calculation
+*	isp-1		...
+*	isp-2	<--	...	other components of this expression on stack
+*	isp-n		...
+*	lo_isp	<--	level at which expression evaluation was called
+*
+* eg. for tau ^ 2 as a part of the full expression
+*			level isp     will contain the constant 2
+*			level isp-1   will contain tau
+*		and the alg_type/alg_text will point to "^"
+
+* the "frame_bottom" is the isp level that will be left when the components of
+* the current calculation (1 to 3) are reduced to a single value.
+* on exit isp will point to the frame bottom and the result will be left there
+
+* identify the text of the particular item within the algebraic class
+* ... function
+	IF     ( alg_type .EQ. alg_function   ) THEN
+	   ifcn = STR_MATCH( alg_text, alg_fcn, num_functions )
+	   IF ( ifcn .EQ. atom_not_found ) STOP ' bad fcn err'
+	   num_com = alg_num_fcn_args( ifcn )
+	   op_num  = ifcn + offset_functions
+* ... operator
+	ELSEIF ( alg_type .EQ. alg_operator   ) THEN
+	   iop = STR_MATCH ( alg_text, alg_op, num_operators )
+	   IF ( iop .EQ. atom_not_found ) STOP ' bad op err'
+	   num_com = 2
+	   op_num  = iop
+* ... logic structure
+	ELSEIF ( alg_type .EQ. alg_log_struct .OR.
+     .           alg_type .EQ. alg_log_vstruct ) THEN
+	   ilogic = STR_MATCH (	alg_text, alg_struct, num_log_structs )
+	   IF ( ilogic .EQ. atom_not_found ) STOP ' bad if-then err'
+	   IF ( ilogic .EQ. pthen ) THEN
+	      num_com = 2	! IF ... THEN ...
+	   ELSEIF ( ilogic .EQ. pelse ) THEN
+	      num_com = 3	! IF ... THEN ... ELSE ...
+	   ELSE
+	      STOP 'bad if'
+	   ENDIF
+	   op_num  = ilogic + offset_logic_struc
+	   IF (alg_type .EQ. alg_log_vstruct) op_num = op_num + 2
+	ELSE
+	   STOP '??? fcn or op'
+	ENDIF
+	frame_bottom = isp - num_com + 1
+	IF ( frame_bottom .LE. lo_isp ) CALL ERRMSG
+     .		( ferr_syntax, status, 'RPN', *5000 )
+
+* classify the data type of the arguments
+* ... ignore type of "cond" in IF cond THEN result
+	IF ( alg_type .EQ. alg_log_struct .OR.
+     .       alg_type .EQ. alg_log_vstruct ) THEN
+	  i1 = 2 ! ignore "cond"
+	ELSE
+	  i1 = 1
+	ENDIF
+	arg_type =  cx_type(is_cx(frame_bottom+i1-1))
+	arg_types_matched = .TRUE.
+	DO 100 icom = i1, num_com
+	   com_cx  = is_cx(frame_bottom+icom-1)
+	   IF (arg_type .NE. cx_type(com_cx) ) THEN
+	     arg_types_matched = .FALSE.
+	     arg_type = ptype_float
+	   ENDIF
+ 100	CONTINUE
+
+* allocate context space for the result
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	res_cx = cx_stack_ptr
+
+* use first component context as the default
+	CALL TRANSFER_CONTEXT( is_cx(frame_bottom), res_cx )
+	cx_category( res_cx ) = cat_temp_var
+	cx_variable( res_cx ) = 1		! in case it is a constant
+	cx_grid    ( res_cx ) = mgrid_abstract	! see 10/5 notes above
+	cx_type    ( res_cx ) = arg_type
+
+* stretch sizes to maxes for all components on each axis
+* e.g. temp[k=1] + temp[K=1:3] needs 3 in the K direction
+* also - if there is a meaningful axis then use it
+* e.g. I[i=1] + J[j=1]   --> use the J axis although it is only length 1
+	DO 210 idim = 1, nferdims
+	   res_len = CX_DIM_LEN( idim, res_cx )
+	   DO 200 icom = 2, num_com
+	      com_cx  = is_cx(frame_bottom+icom-1)
+	      com_len = CX_DIM_LEN( idim, com_cx )
+	      IF ( com_len .GT. res_len
+     .	     .OR.  ( cx_lo_ww(idim,res_cx) .EQ. unspecified_val8
+     .	       .AND. cx_lo_ww(idim,com_cx) .NE. unspecified_val8 ) ) THEN
+	         CALL TRANSFER_AXIS( idim, com_cx, res_cx )
+	         res_len = com_len
+	      ENDIF
+ 200	   CONTINUE
+ 210	CONTINUE
+ 
+* allocate memory space for result
+	CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mr_variable( res_mr ) = res_mr	! cat_temp_var vars point to themselves
+
+* special HACK to support "a"+"b" (see MERGE_GRID)
+	IF ( mr_type(res_mr) .EQ. ptype_string ) THEN
+           CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(res_mr),
+     .                               memory(1, mr_blk1(res_mr)),
+     .                               mr_c_pointer(res_mr)      )
+	ENDIF
+
+* point to the memory resident components
+* (if fewer than 4 components default extras to dummy)
+	DO 300 icom = 1, num_com
+ 300	com(icom) = is_mr(frame_bottom+icom-1)
+	DO 310 icom = num_com+1, 4
+ 310	com(icom) = dummy_mr
+
+* set up 4D array limits as unsubscripted variables in COMMON
+	CALL NON_ARRAY_SUBSC( com, 5 )
+
+* operation relevant ONLY to numerical arguments? (neither "+" nor logical op)
+	numerical_op =  .NOT.
+     .	     (	(op_num.EQ.1)
+     .     .OR. (op_num.GE.p_log_op_first .AND. op_num.LE.p_log_op_last)
+     .     .OR. (op_num.GT.offset_logic_struc)   )
+
+* perform the operation
+	IF (.NOT.arg_types_matched
+     .	  .OR. (arg_type.EQ.ptype_string .AND. numerical_op) ) THEN 
+* ... inappropriate use of string arguments
+          CALL FILL_MEMORY ( memory, mr_blk1 (res_mr),
+     .                       mr_nblks(res_mr),
+     .                       mr_bad_data(res_mr) )
+
+	ELSEIF (arg_type.EQ.ptype_string) THEN
+	  IF (op_num .EQ. 1 ) THEN  ! "+"
+	    CALL STRING_CONCATENATE
+     .		       ( is_cx(frame_bottom),
+     .			 memory(1, mr_blk1(mr1) ),   mr1,
+     .			 memory(1, mr_blk1(mr2) ),   mr2,
+     .			 memory(1, mr_blk1(res_mr)), res_mr )
+	  ELSEIF (op_num .GT. offset_logic_struc) THEN
+	    CALL STRING_CONDITIONAL
+     .		       ( op_num-offset_logic_struc,
+     .			 num_com, is_cx(frame_bottom),
+     .			 memory(1, mr_blk1(mr1) ),   mr1,
+     .			 memory(1, mr_blk1(mr2) ),   mr2,
+     .			 memory(1, mr_blk1(mr3) ),   mr3,
+     .			 memory(1, mr_blk1(res_mr)), res_mr )
+	  ELSE  ! "EQ", "NE", "LT", ...
+	    CALL STRING_OPERATE
+     .		       ( op_num, is_cx(frame_bottom),
+     .			 memory(1, mr_blk1(mr1) ),   mr1,
+     .			 memory(1, mr_blk1(mr2) ),   mr2,
+     .			 memory(1, mr_blk1(res_mr)), res_mr )
+            cx_type(res_cx) = ptype_float
+            mr_type(res_mr) = ptype_float
+	  ENDIF
+	ELSE
+	  CALL OPERATE ( op_num, num_com, ifv, is_cx(frame_bottom),
+     .			 memory(1, mr_blk1(mr1) ),   mr1,
+     .			 memory(1, mr_blk1(mr2) ),   mr2,
+     .			 memory(1, mr_blk1(mr3) ),   mr3,
+     .			 memory(1, mr_blk1(mr4) ),   mr4,
+     .			 memory(1, mr_blk1(res_mr)), res_mr )
+	ENDIF
+
+* clean up 
+* ... deallocate result context space
+	cx_stack_ptr = cx_stack_ptr - 1
+
+* ... if any components were un_cached we must uncache the result
+	not_reusable = .FALSE.
+	DO 2050 icom = isp, frame_bottom, -1
+ 2050	IF ( ITS_UN_CACHED(is_mr(icom)) ) not_reusable = .TRUE.
+	IF ( not_reusable ) CALL UN_CACHE( res_mr )
+
+* ...release component cx stack space
+	DO 2100 isp = isp, frame_bottom, -1
+	   IF ( is_cx(isp) .NE. cx_stack_ptr ) WRITE (6,*) 'OP_STK??'	! temp
+	   cx_stack_ptr = cx_stack_ptr - 1
+	   mr  = is_mr( isp )
+	   IF ( mr_protected(mr) .EQ. mr_temporary
+     .	   .OR. mr_category (mr) .EQ. cat_temp_var ) THEN
+	      CALL DELETE_VARIABLE( mr )
+	   ELSE
+	      CALL MR_NOT_IN_USE( mr )
+	   ENDIF
+* (9/95) deallocate dynamic grids from components
+! instead make the result depend on grid ABSTRACT
+!* or, if the result requires
+!* the same grid, then pass responsibility for deallocating it later along to
+!* the result context. The use count is decremented (by calling DEALLO...)
+!* for each additional component that may have shared use of this dynamic grid.
+	   com_cx = is_cx(isp)
+	   IF ( cx_has_impl_grid(com_cx) ) THEN
+	      impl_grid = cx_grid(com_cx)
+!	      IF ( cx_grid(res_cx) .EQ. impl_grid ) THEN
+! 10/5	         IF ( cx_has_impl_grid(res_cx) )
+! idea    .				CALL DEALLO_DYN_GRID(impl_grid)
+!	         cx_has_impl_grid(res_cx) = .TRUE.	!inherit responsibility
+!	      ELSE
+	         CALL DEALLO_DYN_GRID(impl_grid)
+!	      ENDIF
+	      cx_has_impl_grid(com_cx) = .FALSE.
+	   ENDIF
+ 2100	CONTINUE
+
+* collapse the interp stack frame
+	isp = frame_bottom
+	is_mr( isp ) = res_mr
+
+* save the result context at the cx level previously used by the 1st component
+	cx_stack_ptr = cx_stack_ptr + 1
+	CALL TRANSFER_CONTEXT( res_cx, cx_stack_ptr )
+!	IF ( cx_has_impl_grid(res_cx) ) THEN
+! 10/5 	   cx_has_impl_grid(cx_stack_ptr) = .TRUE.
+! idea	   cx_has_impl_grid(res_cx)       = .FALSE.
+!	ENDIF
+	is_cx( isp ) = cx_stack_ptr
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+! 5100	CALL ERRMSG( ferr_invalid_command, status,
+!     .		'cannot use a string as an argument to: '//alg_text, *5000 )
+	END
diff --git a/fer/stk/is_gather.F b/fer/stk/is_gather.F
new file mode 100644
index 0000000..25e865e
--- /dev/null
+++ b/fer/stk/is_gather.F
@@ -0,0 +1,134 @@
+	SUBROUTINE IS_GATHER( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* bring together a full data grid from fragmentary pieces by requesting those
+* pieces one by one on the interpretation stack
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/8/89
+* V312: 5/94 - array "memory" as a calling argument
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for gathering )
+
+* internal variable declarations:
+	INTEGER com_mr, res_mr, com_cx, res_cx,	dflt_cx, com_isp, res_isp,
+     .		frag, idim, top
+
+
+* --- end of introductory code ---
+
+* initialize
+	res_isp    = isp
+	com_isp    = isp + 1
+	res_mr     = is_mr( res_isp )
+	com_mr     = is_mr( com_isp )
+	res_cx     = is_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	dflt_cx	   = is_big_cx( res_isp )
+	idim       = is_axis( res_isp )
+	frag	   = is_sum ( res_isp )
+
+* diagnostic mode output: " doing gather VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing',isact_class_gather, com_cx, idim )
+
+* create context and mem. res. space if this is the first component recieved
+	IF ( res_mr .EQ. unspecified_int4 ) THEN
+* ... use gathering axis from dflt_cx and everything else from component
+* ... (since all else may be altered during evaluation if its a user var)
+	   CALL TRANSFER_CONTEXT( com_cx, res_cx )
+	   CALL TRANSFER_AXIS( idim, dflt_cx, res_cx )
+	   CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_mr( res_isp ) = res_mr
+	ENDIF
+
+* copy data just received into the result
+	CALL COPY_INTO( memory(1,mr_blk1(com_mr)), com_mr, com_cx,
+     .			memory(1,mr_blk1(res_mr)), res_mr )
+
+* ... remove the component protection that signaled we needed it here
+	CALL MR_NOT_IN_USE( com_mr )
+
+* are we done ?
+	IF ( cx_hi_ss(com_cx,idim) .EQ. cx_hi_ss(dflt_cx,idim) ) THEN
+* ... yes - pop com_cx and dflt_cx from context stack
+	   IF ( dflt_cx .NE. cx_stack_ptr ) STOP 'GATH_STK_ERR'	! temp
+	   cx_stack_ptr = cx_stack_ptr - 2
+	   RETURN 2
+	ENDIF
+
+* no - set up com_cx to get the next component grid
+	top = cx_hi_ss(com_cx,idim)
+	CALL TRANSFER_CONTEXT( dflt_cx, com_cx )
+	cx_lo_ss(com_cx,idim) = top + 1
+	cx_hi_ss(com_cx,idim) = MIN( top+frag, cx_hi_ss(dflt_cx,idim)	)
+	cx_by_ss(idim,com_cx) = .TRUE.
+	CALL FLESH_OUT_AXIS( idim, com_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* push the interpretation stack and go get it
+	isp = com_isp
+	status = ferr_ok
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+	END	
+
diff --git a/fer/stk/is_grid_mode.F b/fer/stk/is_grid_mode.F
new file mode 100644
index 0000000..bb26e3e
--- /dev/null
+++ b/fer/stk/is_grid_mode.F
@@ -0,0 +1,105 @@
+	SUBROUTINE IS_GRID_MODE( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up interp stack to begin determining the grid of an algebraic expression
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/28/89
+* V420:  1/95 - need to init cx_delta since it is used by dynamic axes
+* V491:  12/97 - bug fix: need to initialize 
+* V510: *sh* 4/00 - initialize the grid that is allocated to 
+* V600  4/06 *acm* - misspelled variable found by Solaris compiler
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER	status
+
+* internal variable declarations:
+	INTEGER cx, big_cx, idim
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+#       include "tmap_dset.parm"
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* carve a space on the context stack for a "bland" (1:1,1:1,1:1,1:1,1:1,1:1) context
+	cx = cx_stack_ptr
+	cx_grid(cx) = unspecified_int4		! for pseudo_vars in pass 1
+	DO 100 idim = 1, nferdims
+	  cx_lo_ss(cx,idim) = 1
+	  cx_hi_ss(cx,idim) = 1
+	  cx_by_ss(idim,cx) = .TRUE.
+	  cx_trans(idim,cx) = trans_no_transform
+	  cx_given(idim,cx) = .FALSE.
+	  cx_lo_ww(idim,cx) = unspecified_val8
+	  cx_hi_ww(idim,cx) = unspecified_val8
+	  cx_delta(idim,cx) = unspecified_val8
+ 100	CONTINUE
+        cx_calendar(cx) = .FALSE.
+        cx_cal_id(cx) = unspecified_int4
+
+* diagnostic alert
+	IF ( mode_diagnostic )
+     .			CALL DIAGNOSTIC_OUT( 'getgrid', cx, point_to_cx )
+
+* initialize a level on the interpretion stack for the activity
+	is_phase( isp ) = 0
+
+* allocate another context for the "merged" grid
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	big_cx = cx_stack_ptr
+	is_big_cx( isp ) = big_cx
+	CALL ALLO_GRID( cx_grid(big_cx), status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	CALL INIT_GRID( cx_grid(big_cx), char_init16, mnormal )
+
+* set flag indicating that the first component grid has not yet been encountered
+	is_sum( isp ) = isalg_transfer
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END	
+
diff --git a/fer/stk/is_modulo.F b/fer/stk/is_modulo.F
new file mode 100644
index 0000000..d9f38cc
--- /dev/null
+++ b/fer/stk/is_modulo.F
@@ -0,0 +1,276 @@
+	SUBROUTINE IS_MODULO( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* pull together the pieces of a "modulo" (wrap-around) read along an axis by
+* inserting pieces obtained by non-modulo reads (within the base axis limits)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V320: 19/9/94
+* V420: 11/95 - added RECONCILE_COM_DST_CX for use in modulo regridding
+*	      - auto-modulo (stripped off in INTERP_STACK for all classes
+*		of variables) can no longer assume that the component data
+*		lies strictly in the base region
+*	      - If the result is "pathological" then flag it as "un-cached"
+*		so it will not be reused.
+* V533: *sh* 6/01 - allow modulo of variables with strides (cx_delta) 
+* V550: *sh* 2/02 - added support for subspan modulo axes
+*		    by CAXIS_LEN -> CAXIS_MODLEN
+*		  - pre-fill strings with null strings as with FILL_MEMORY
+* 560: *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for moduloing )
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO
+	INTEGER CAXIS_MODLEN, CX_DIM_LEN, MODULO_PARITY, MGRID_SIZE_DELTA,
+     .		CGRID_AXIS,
+     .		com_mr, res_mr, com_cx, res_cx,	com_isp, res_isp,
+     .		npts, idim, i, phase, res_lo, res_hi, xlate, nmod,
+     .		tmp_mr, nrepl, rqst_cx, idel, lo_parity
+
+
+* --- end of introductory code ---
+
+* this routine attempt to replicate **whatever** component data has been
+* supplied to form a modulo result.  Normally the component data will
+* lie within the base range, 1 to Npts, (length of modulo cycle).  However,
+* in odd cases the component data may be anywhere and of any size.  This
+* routine will base its modulo output on the first Npts of the component
+* data.  It will go back to get further component data only if instructed
+* to do so by IS_STRIP (i.e. phase==isphase_1)
+
+
+* |++++++++|--------|--------|--------|--------|   <-- replicated modulo axis
+*                              |-------------|	   <-- available component data
+*               |----------------|		   <-- requested region
+
+* Examples of the odd cases would be
+*   LIST/i=50:60 v5[i=30:40]    where v5 is on a 5 point modulo.
+*   (The incoming component to modulo i=50:60 will be i=30:40.)
+* or
+*   LET v = temp[g=gmod,L=big:really_big]  ! regrid non-modulo to a modulo axis
+*   LIST/L=1:48 v
+*   (The incoming component is non-modulo and located at big L values.) 
+
+* The special case in which IS_STRIP will supply data in two phases is when
+* a small modulo result is requested that crosses a modulo boundary:
+* |++++++++|--------|--------|--------|--------|   <-- replicated modulo axis
+*                |-----|		   	   <-- requested region
+*                 ^ | ^
+*	Phase:    1   2
+
+* initialize
+	res_isp    = isp
+	com_isp    = isp + 1
+	res_mr     = is_mr( res_isp )
+	com_mr     = is_mr( com_isp )
+	res_cx     = is_cx( res_isp )
+	rqst_cx    = is_big_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	idim       = is_axis( res_isp )
+	npts	   = CAXIS_MODLEN( idim, com_cx )
+	phase	   = is_phase(isp)
+	IF (cx_delta(idim,res_cx) .EQ. unspecified_val8) THEN
+	   idel = 1
+	ELSE
+	   idel = NINT(cx_delta(idim,res_cx))
+	ENDIF
+!	nonfactorstride = npts .NE. (npts/idel)*idel
+
+* diagnostic mode output: " doing modulo VAR_NAME[x=lo:hi,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing',isact_class_modulo, com_cx, idim )
+
+	IF (.NOT.(phase.EQ.isphase_allatonce
+     .	     .OR. phase.EQ.isphase_1.OR.phase.EQ.isphase_2) ) CALL ERRMSG
+     .		(ferr_internal, status, 'modulo_phase_err', *5000)
+
+	IF ( phase .NE. 2 ) THEN
+
+* 11/95 complete the result context in case it has some unspecified limits
+* (note: this never occurs on file variables because INTERP_STACK completes
+*	 the context to make memory caching more efficient)
+	   CALL RECONCILE_COM_DST_CX( com_cx, res_cx, idim )
+
+* create context and mem. res. space if this is the first component recieved
+	   CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_mr( res_isp ) = res_mr
+
+	   IF ( mr_type(res_mr) .EQ. ptype_string ) THEN
+	      CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(res_mr),
+     .                               memory(1, mr_blk1(res_mr)),
+     .                               mr_c_pointer(res_mr)      )
+	      CALL SET_NULL_C_STRING_ARRAY(mr_c_pointer(res_mr),
+     .                                     MGRID_SIZE_DELTA(res_mr) )
+	   ENDIF
+
+* 11/95: if there might be voids in the result pre-fill with missing data flags
+	   IF ( CX_DIM_LEN(idim,com_cx) .LT. npts
+     .	  .AND. mr_type(res_mr) .EQ. ptype_float  ) CALL FILL_MEMORY
+     .				( memory,mr_blk1(res_mr),mr_nblks(res_mr),
+     .                            mr_bad_data(res_mr) )
+
+	   ENDIF
+
+* If the component received (com_cx) does not match the component requested
+* (rqst_cx) then we can proceed with the modulo but other calculations
+* should not reuse it as it may have voids.  For example, if npts=10 then
+* the results of "list/i=1:15 v1[i=3:7]" should not be reused.
+	IF (cx_lo_ss(com_cx,idim) .NE. cx_lo_ss(rqst_cx,idim)
+     . .OR. cx_hi_ss(com_cx,idim) .NE. cx_hi_ss(rqst_cx,idim) ) 
+     .						CALL UN_CACHE(res_mr)
+
+* The internals of this routine require a dual look at the components that
+* are recieved:  in the view that arrives with the components they are located
+* within the base region (non-modulo, I=1:npts) of the variable.  In order to
+* copy into the result, however, they must also be viewable in the subscript
+* range(s) of the result.  For this purpose dual memory table entries are
+* created that will describe the component data.  The dual version will be
+* deleted before exiting this routine.
+	CALL FIND_MR_SLOT( com_cx, tmp_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5910
+	CALL ASSIGN_MR_CX( com_cx, tmp_mr )     ! affects diag output, only
+	DO 100 i = 1, nferdims
+	   mr_lo_ss(tmp_mr,i) = mr_lo_ss(com_mr,i)
+	   mr_hi_ss(tmp_mr,i) = mr_hi_ss(com_mr,i)
+ 100	CONTINUE
+	mr_blk1 (tmp_mr) = mr_blk1 (com_mr)    ! just for good house-keeping
+	mr_nblks(tmp_mr) = mr_nblks(com_mr)    ! just for good house-keeping
+	mr_protected(tmp_mr) = mr_table_entry_only
+
+* * * * *
+* Copy the component data into the result, replicating as we go
+* ... watch for delta not a factor of npts -- parity shifts at each replication
+	nrepl = (cx_hi_ss(res_cx,idim) - cx_lo_ss(res_cx,idim))
+     .		   / npts
+
+	res_hi = cx_lo_ss(res_cx,idim) - idel
+	DO 300 i = 1, nrepl + 1
+	   res_lo = res_hi + idel
+	   lo_parity = MODULO_PARITY(res_lo, npts, idel)
+	   res_hi = MIN(res_lo+(((npts-lo_parity)/idel)*idel),
+     .		        cx_hi_ss(res_cx,idim))
+	   CALL SHORT_MOD_COPY( memory,
+     .				res_lo, res_hi, idim,
+     .				com_cx, tmp_mr, res_cx, res_mr)
+ 300	CONTINUE
+* * * * *
+
+
+* Set up context to go back for data that is still needed
+	IF( phase .EQ. isphase_1 ) THEN
+* ... update the original rqst_cx to make new request
+*     note: the variable EX#N may have become category file variable in com_cx 
+
+* to support subspan modulo axes allow for void points at axis ends
+	   res_lo = cx_lo_ss(res_cx,idim)
+	   res_hi = cx_hi_ss(res_cx,idim)
+	   IF ( TM_ITS_SUBSPAN_MODULO(CGRID_AXIS(idim,res_cx)) ) THEN
+	      IF (MOD(res_lo,npts) .EQ. 0) res_lo = res_lo + 1
+	      IF (MOD(res_hi,npts) .EQ. 0) res_hi = res_hi - 1
+	   ENDIF
+
+* calculate modulo translation
+	   nmod = res_hi / npts
+	   IF ( res_hi .LE. 0 ) nmod = nmod - 1
+	   xlate = nmod * npts
+
+* set lo to the parity of the first point needed in the right hand modulo
+	   lo_parity = MODULO_PARITY(res_lo, npts, idel)
+	   i = res_lo+((npts-lo_parity)/idel+1)*idel
+	   IF ((res_lo/npts)*npts .EQ. res_lo) i = i - idel
+	   cx_lo_ss(rqst_cx, idim) = MODULO_PARITY(i, npts, idel)
+	   cx_hi_ss(rqst_cx, idim) = res_hi - xlate
+	   cx_by_ss(idim,rqst_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( idim, rqst_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5900
+
+* ... set up the request for the next component 
+	   CALL TRANSFER_CONTEXT( rqst_cx, com_cx )
+
+* ... remove the component protection that signaled we needed it here
+	   CALL MR_NOT_IN_USE( com_mr )
+	   CALL DELETE_VARIABLE( tmp_mr )  ! delete the extra table entry
+	   IF (mr_delta(idim,com_mr).NE.unspecified_val8)
+     .		 CALL DELETE_VARIABLE( com_mr )  ! invalid since using mr_delta
+
+* ... push the interpretation stack and go get the final component
+	   is_phase(isp) = isphase_2
+	   isp = com_isp
+	   status = ferr_ok
+	   RETURN 1
+
+* Successful completion of modulo operation
+	ELSE
+	   CALL MR_NOT_IN_USE( com_mr )	! remove memory protection on component
+	   CALL DELETE_VARIABLE( tmp_mr )  ! delete extra table entry
+	   IF (mr_delta(idim,com_mr).NE.unspecified_val8)
+     .		 CALL DELETE_VARIABLE( com_mr )  ! invalid since using mr_delta
+	   cx_stack_ptr = cx_stack_ptr - 1 ! pop rqst_cx from context stack
+	   cx_stack_ptr = cx_stack_ptr - 1 ! pop com_cx  from context stack
+	   status = ferr_ok
+	   RETURN 2
+	ENDIF
+
+* error exits
+ 5000	RETURN
+ 5900	CALL DELETE_VARIABLE( tmp_mr )  ! delete extra table entry
+ 5910	CALL DELETE_VARIABLE( res_mr )  ! delete invalid result
+	CALL MR_NOT_IN_USE( com_mr )
+	GOTO 5000
+	END	
diff --git a/fer/stk/is_pseudo.F b/fer/stk/is_pseudo.F
new file mode 100644
index 0000000..5c696e1
--- /dev/null
+++ b/fer/stk/is_pseudo.F
@@ -0,0 +1,98 @@
+	SUBROUTINE IS_PSEUDO( memory, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a gridded "pseudo-variable" (eg. "X" or "K")
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/2/87
+* V200:  6/26/89 - 4-D symmetric version
+*	10/16/89 - changed adj. array bounds for MAKE_PSEUDO_VAR call
+*	11/30/89 - added diagnostic output
+* V312: 5/94 - array "memory" as a calling argument
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER	mr, cx, idim
+
+* --- end of introductory code ---
+* initialize
+	cx = is_cx( isp )
+
+* remove regridding flag 
+* for pseudo-vars it just means the grid was explicitly specified - there
+* is no regridding)
+	cx_unstand_grid( cx ) = .FALSE.
+
+* reserve and catalog space for the result
+	CALL CREATE_TEMP_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( isp ) = mr
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('pseudo ',mr,point_to_mr)
+
+* fill the space with the desired data
+
+* Get the direction of the pseudo-variable.
+
+	idim = MOD( cx_variable(cx)-1, 6 ) + 1
+
+	CALL MAKE_PSEUDO_VAR( cx, idim, memory(1, mr_blk1(mr)), mr,
+     .			      mr_lo_ss(mr,idim), mr_hi_ss(mr,idim) )
+
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_pystat_var.F b/fer/stk/is_pystat_var.F
new file mode 100644
index 0000000..d50e8f9
--- /dev/null
+++ b/fer/stk/is_pystat_var.F
@@ -0,0 +1,182 @@
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*
+*  Copy a pystat variable in ferret memory
+*
+      SUBROUTINE IS_PYSTAT_VAR(memory, *, *, sts)
+
+      IMPLICIT NONE
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'
+      INCLUDE 'interp_stack.parm'
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+      INCLUDE 'xprog_state.cmn'
+      INCLUDE 'xpyvar_info.cmn'
+      INCLUDE 'xtext_info.cmn'
+
+*     Calling argument declarations
+      INTEGER sts
+      REAL    memory(mem_blk_size, max_mem_blks)
+
+*     Function declarations
+      CHARACTER*128 VAR_CODE
+
+*     Internal variable declarations
+      INTEGER cx, cx_var, pyvar, idim, mr_var, mr, sts2
+      LOGICAL newvar_needed, need_data
+
+*     Initialize
+      cx = is_cx(isp)
+      pyvar = cx_variable(cx)
+
+*     Create a context for reading exactly all the data in this variable
+      CALL STACK_PTR_UP(cx_stack_ptr, max_context, sts)
+      IF ( sts .NE. ferr_ok ) GOTO 5000
+      cx_var = cx_stack_ptr
+      CALL TRANSFER_CONTEXT(cx, cx_var)
+      cx_variable(cx_var) = pyvar
+      cx_grid(cx_var) = pyvar_grid_number(pyvar)
+      cx_bad_data(cx_var) = pyvar_missing_flag(pyvar)
+      DO 100 idim = 1,4
+         cx_lo_ss(cx_var, idim) = pyvar_grid_start(idim, pyvar)
+         cx_hi_ss(cx_var, idim) = pyvar_grid_end(idim, pyvar)
+         cx_by_ss(idim, cx_var) = .TRUE.
+         CALL CONFINE_AXIS(idim, cx_var, sts)
+         IF ( sts .NE. ferr_ok ) GOTO 4900
+         CALL FLESH_OUT_AXIS(idim, cx_var, sts)
+         IF ( sts .NE. ferr_ok ) GOTO 4900
+  100 CONTINUE
+
+*     Check the axis limits on the data requests.
+*     If the limits on the request data exceed the limits of the given
+*     data, do NOT issue errors or warnings, or trim the cx context.
+*     (So that getting it from cached data will have the same behavior.)
+*     Instead, create a variable filled with missing values matching
+*     the requested data and copy into it the given data where appropriate.
+      newvar_needed = .FALSE.
+      need_data = .TRUE.
+      DO 200 idim = 1,4
+         IF ( cx_lo_ss(cx,idim) .LT. cx_lo_ss(cx_var,idim) ) THEN
+*           Limits exceeded so new expanded variable needed
+            newvar_needed = .TRUE.
+            IF ( cx_hi_ss(cx,idim) .LT. cx_lo_ss(cx_var,idim) ) THEN
+*              Completely out of range so do not get or copy the given data
+               need_data = .FALSE.
+            ENDIF
+         ENDIF
+         IF ( cx_hi_ss(cx,idim) .GT. cx_hi_ss(cx_var,idim) ) THEN
+*           Limits exceeded so new expanded variable needed
+            newvar_needed = .TRUE.
+            IF ( cx_lo_ss(cx,idim) .GT. cx_hi_ss(cx_var,idim) ) THEN
+*              Completely out of range so do not get or copy the given data
+               need_data = .FALSE.
+            ENDIF
+         ENDIF
+  200 CONTINUE
+
+*     If needed, create a variable with all the given data
+      IF ( need_data ) THEN
+*        Reserve and catalog space for exactly all the given data
+         CALL CREATE_MEM_VAR(cx_var, mr_var, sts)
+         IF ( sts .NE. ferr_ok ) GOTO 4900
+*        diagnostic output
+         IF (mode_diagnostic) CALL DIAGNOSTIC_OUT(
+     .                        'copy pyvar data', mr_var, point_to_mr)
+*        Set the bad data flag
+         mr_bad_data(mr_var) = pyvar_missing_flag(pyvar)
+*        Get all the given data from the python data array object
+         CALL COPY_PYSTAT_DATA(memory(1, mr_blk1(mr_var)),
+     .                         pyvar_ndarray_obj(pyvar))
+      ENDIF
+
+
+*     If the limits on the requested data exceeded the limits
+*     on the actual data, create a new expanded variable; otherwise
+*     just use the variable created above.
+      IF ( newvar_needed ) THEN
+*        Reserve and catalog space for exactly the requested data
+         CALL CREATE_MEM_VAR(cx, mr, sts)
+         IF ( sts .NE. ferr_ok ) GOTO 4800
+*        diagnostic output
+         IF (mode_diagnostic) CALL DIAGNOSTIC_OUT(
+     .                        'expand pyvar data', mr, point_to_mr)
+*        Set the bad data flag
+         mr_bad_data(mr) = pyvar_missing_flag(pyvar)
+*        Fill completely with the missing value
+         CALL FILL_MEMORY(memory, mr_blk1(mr), mr_nblks(mr), 
+     .                    mr_bad_data(mr))
+         IF ( need_data ) THEN
+*           Trim the cx_lo_ss and cx_hi_ss limits in cx_var (given data)
+*           so they do not exceed the limits in cx (used to create mr)
+            DO 300 idim = 1,4
+               IF ( cx_lo_ss(cx_var,idim) .LT. cx_lo_ss(cx,idim) ) THEN
+                  cx_lo_ss(cx_var,idim) = cx_lo_ss(cx,idim)
+               ENDIF
+               IF ( cx_hi_ss(cx_var,idim) .GT. cx_hi_ss(cx,idim) ) THEN
+                  cx_hi_ss(cx_var,idim) = cx_hi_ss(cx,idim)
+               ENDIF
+  300       CONTINUE
+*           Copy over the given data where appropriate
+            CALL COPY_INTO(memory(1, mr_blk1(mr_var)), mr_var, cx_var,
+     .                     memory(1, mr_blk1(mr)),     mr)
+*           Delete the variable with the all the given data (cheap to recreate)
+            CALL DELETE_VARIABLE(mr_var)
+         ENDIF
+      ELSE
+*        The original data variable is acceptable 
+*        (if newvar_needed is .FALSE., need_data must be .TRUE.)
+         mr = mr_var
+      ENDIF
+
+*     cx_var no longer needed
+      CALL STACK_PTR_DN(cx_stack_ptr, cx_stack_ptr_base, sts)
+      IF ( sts .NE. ferr_ok ) THEN
+         CALL DELETE_VARIABLE(mr)
+         GOTO 5000
+      ENDIF
+
+*     Result is ready to return to the stack
+      is_mr(isp) = mr
+
+*     Got the requested data
+      RETURN 2
+
+*     RETURN 1, which is to request a sub-component, is never used ...
+
+*     Error exit
+ 4800 IF ( need_data ) CALL DELETE_VARIABLE(mr_var)
+ 4900 CALL STACK_PTR_DN(cx_stack_ptr, cx_stack_ptr_base, sts2)
+ 5000 RETURN
+      END       
diff --git a/fer/stk/is_read.F b/fer/stk/is_read.F
new file mode 100644
index 0000000..b43d8fb
--- /dev/null
+++ b/fer/stk/is_read.F
@@ -0,0 +1,146 @@
+	SUBROUTINE IS_READ ( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a grid of data from a system file
+* this routine merely looks at the class of data set to decide on the
+* appropriate underlying routine to actually get the data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/19/87
+* revision 0.1 - 9/11/87 - changed check of ds_format to ds_type 
+*			   and 'GT' --> '  GT' for new TMAP library
+* revision 0.2 - 11/2/88 - IS_READ_GT --> IS_READ_TM (ss-symmetrical)
+* V200: 10/25/89 - EZ data type added
+* 	 2/27/90 - unspecified limits are set with FLESH_OUT_AXIS
+* V230:  3/2/92 - added netCDF support
+* V312: 5/94 - array "memory" as a calling argument
+* V320: 2/95 - allow for category cat_file_rev (a file variable with
+*		reversed axes)
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line. used DATA statment rather than a
+*	        PARAMETER statement because variable was modified in code
+* 	      - Added a preprocessor include for tmap_dset.parm
+*	        because it needed a preprocessor.
+*  7/98 *js*  - Hacked to add support for permuted binary file reads
+* V530: *sh* 11/00 - delimited file reading added
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory(*)
+* normal exit is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+* internal variable declarations:
+	LOGICAL		reprimand
+	DATA       	reprimand/.TRUE./
+	INTEGER 	CGRID_AXIS, cx, dset_num, idim, cat
+
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+
+* --- end of introductory code ---
+
+* initialize
+	cx = is_cx( isp )
+	dset_num = cx_data_set( cx )
+
+* for the duration of this routine replace cat_revfile_var with cat_file_var
+* (since most routines cannot cope with cat_revfile_var)
+	cat = cx_category(cx)
+	cx_category(cx) = cat_file_var
+
+* ensure that all needed limits are known
+	DO 100 idim = 1, nferdims
+	   IF ( cx_lo_ss( cx, idim ) .NE. unspecified_int4 ) GOTO 100
+	   IF ( CGRID_AXIS( idim, cx ) .EQ. mnormal ) GOTO 100
+	   IF ( reprimand ) THEN
+	      CALL WARN
+     .		('FERRET is more efficient if regions are fully specified' )
+	      CALL WARN( ww_dim_name(idim)//
+     .		' axis limits are unspecified - possibly others, too' )
+	      reprimand = .FALSE.		! only remind them once
+	   ENDIF
+	   CALL FLESH_OUT_AXIS( idim, cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000		! should never happen
+!	   CALL ERRMSG( ferr_limits, status,
+!     .			ww_dim_name(idim)//' axis limits are unknown for '//
+!     .			VAR_CODE( cat_file_var, cx_variable(cx) ), *5000 )
+ 100	CONTINUE
+
+* choose the appropriate routine to read the data
+	IF ( ds_type( dset_num ) .EQ. pds_type_ez ) THEN
+* all stream formatted files now read with new fast binary reads
+	   IF ( ds_parm_text(1,dset_num)(:3) .eq. 'STR') THEN
+	      CALL READ_BINARY( memory, cx, is_mr(isp), status)
+	   ELSEIF ( ds_parm_text(1,dset_num)(:4) .eq. 'DELI') THEN
+	      CALL READ_DELIMITED( memory, cx, is_mr(isp), status)
+	   ELSEIF ( ds_parm_text(1,dset_num)(:4) .eq. 'PERL') THEN
+	      CALL READ_PERL( memory, cx, is_mr(isp), status)
+	   ELSE
+	      CALL READ_EZ( memory, cx, is_mr(isp), status )
+	   ENDIF
+	   IF ( status .EQ. ferr_ok ) GOTO 2
+	ELSE
+	   CALL READ_TM( memory, cx, is_mr(isp), status )
+	   IF ( status .EQ. ferr_ok ) GOTO 2
+	ENDIF
+
+* error exit
+ 5000	cx_category(cx) = cat
+ 	RETURN
+
+* never need components since TM IO library handles 4D accesses as of 11/88
+! 1	cx_category(cx) = cat
+!	RETURN 1
+
+* done - we got what was asked for
+ 2	cx_category(cx) = cat
+	RETURN 2
+	END	
diff --git a/fer/stk/is_read_remote.F b/fer/stk/is_read_remote.F
new file mode 100644
index 0000000..a2a8db6
--- /dev/null
+++ b/fer/stk/is_read_remote.F
@@ -0,0 +1,86 @@
+	SUBROUTINE IS_READ_REMOTE ( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a grid of data defined via LET/REMOTE from a remote F-TDS dataset
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermcal Modeling and Analysis Program
+*
+* revision 0.0 - 2/2013
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory(*)
+	REAL	baddat
+
+* normal exit is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+* internal variable declarations:
+	INTEGER cx, idim, ivar, cat
+
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* --- end of introductory code ---
+
+* initialize
+	cx = is_cx( isp )
+
+	cat = cx_category(cx)
+	cx_category(cx) = cat_user_var
+
+	CALL READ_REMOTE(memory, baddat, cx, is_mr(isp), status )
+        IF ( status .EQ. ferr_ok ) GOTO 2
+
+* error exit
+ 5000	cx_category(cx) = cat
+ 	RETURN
+
+* done - we got what was asked for
+ 2	cx_bad_data(cx) = baddat
+	cx_category(cx) = cat
+	RETURN 2
+	END	
diff --git a/fer/stk/is_reconcile.F b/fer/stk/is_reconcile.F
new file mode 100644
index 0000000..243ce33
--- /dev/null
+++ b/fer/stk/is_reconcile.F
@@ -0,0 +1,145 @@
+	SUBROUTINE IS_RECONCILE( memory, *, *, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* reconcile any conflicts between the component requested and the one received
+* for example, LIST/I=3:7  test[i=2:5]
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420: 11/95
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars 
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars 
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for moduloing )
+
+* internal variable declarations:
+	LOGICAL	by_ss(nferdims), given(nferdims)
+	INTEGER i, mr, com_cx, res_cx,	com_isp, res_isp,
+     .		com_lo, com_hi, res_lo(nferdims), res_hi(nferdims)
+	CHARACTER VAR_CODE*128, qual*1
+
+* --- end of introductory code ---
+
+* initialize
+	res_isp    = isp		! result (what the user requested)
+	com_isp    = isp + 1		! component (what we have received)
+	res_cx     = is_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	mr	   = is_mr( com_isp )
+
+* defaults
+	is_mr( res_isp ) = mr
+	is_cx( res_isp ) = res_cx
+
+* save the key ingredients from the requesting context (res_cx)
+* (FLESH_OUT_AXIS has already been applied so world coords need not be used)
+	DO 10 i = 1, nferdims
+	   res_lo(i) =  cx_lo_ss(res_cx,i)
+	   res_hi(i) =  cx_hi_ss(res_cx,i)
+	   by_ss(i)  =  cx_by_ss(i,res_cx)
+	   given(i)  =  cx_given(i,res_cx)
+ 10	CONTINUE
+
+* transfer the full context (which includes data set, etc.)
+	CALL TRANSFER_CONTEXT( com_cx, res_cx )
+
+* check each axis for possible reconciliation
+	DO 100 i = 1, nferdims
+	   IF ( given(i) ) THEN
+	      com_lo = cx_lo_ss(com_cx,i)
+	      com_hi = cx_hi_ss(com_cx,i)
+	      IF ( com_lo    .EQ. unspecified_int4
+     .	      .OR. res_lo(i) .EQ. unspecified_int4 ) GOTO 100
+	      IF (res_lo(i).NE.com_lo .OR. res_hi(i).NE.com_hi) THEN
+
+* unreconcilable limits
+	         IF (res_lo(i).GT.com_hi .OR. res_hi(i).LT.com_lo) THEN
+	            IF ( by_ss(i) ) THEN
+	               qual = ss_dim_name(i) 
+	            ELSE
+	               qual = ww_dim_name(i) 
+	            ENDIF
+	            CALL WARN('Invalid '//qual//
+     .			' axis limits ignored: '//
+     .			 VAR_CODE(cx_category(res_cx),cx_variable(res_cx)) )
+
+	         ELSE
+* diagnostic mode output: " doing reconcile VAR_NAME[x=lo:hi,D=#]"
+	            IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing',isact_class_reconcile, com_cx, i )
+
+* trim to limits that satisfy both component and result
+	            cx_lo_ss(res_cx,i) = MAX(com_lo, res_lo(i))
+	            cx_hi_ss(res_cx,i) = MIN(com_hi, res_hi(i))
+	            cx_by_ss(i, res_cx) = .TRUE.
+	            CALL FLESH_OUT_AXIS(i, res_cx, status )
+	            IF ( status .NE. ferr_ok ) GOTO 5000
+	         ENDIF
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+
+* success -- clean up
+	cx_stack_ptr = cx_stack_ptr - 1 ! pop com_cx  from context stack
+	CALL MR_NOT_IN_USE( mr )	! remove memory protection on component
+	RETURN 2
+
+* error exits
+ 5000	CALL MR_NOT_IN_USE( mr )	! remove memory protection on component
+	RETURN
+	END	
diff --git a/fer/stk/is_regrid.F b/fer/stk/is_regrid.F
new file mode 100644
index 0000000..46cab66
--- /dev/null
+++ b/fer/stk/is_regrid.F
@@ -0,0 +1,396 @@
+	SUBROUTINE IS_REGRID( memory, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* regrid thae data from the source grid to the destination grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/25/88
+* revision 0.1 -12/30/88 - eliminated P1 and Q1 from regrid call
+*			 - renamed DO_REGRID --> DO_LIN_REGRID
+* revision 0.2 -  1/9/89 - added xy average regridding
+* V200:  8/2/89 - 4D symmetrical version - usually 1 axis per regrid
+*	10/16/89 - set up adjustable array limits with NON_ARRAY_SUBSC
+*	 11/3/89 - if destination limits are unknown use full axis length
+*	 12/1/89 - allow XY average regridding - code split to RCVD_REGRID
+* V230:  8/22/92 - added @ASN and @AVE regridding
+* V300:  3/16/93 - allow regridding where the source range falls entirely
+*                  between points on the destination axis (all bad_data result)
+* V312: 5/94 - array "memory" as a calling argument
+* V420: 9/95	 - Support for implicit grids: deallocate after it is used
+*      11/95	 - added modulo (climatological) regridding
+*      12/95	 - added modngd, modmin, etc. (climatological) regridding
+*	1/96	 - bug check against attempt to regrid a compressed axis
+*	1/29/96	 - regridding @SUM and @NGD are not weighted
+*		   (done in ave_regrid_1_axis instead of window_regrid_1_axis)
+* V491: 10/97 *sh* - add G=@XACT
+* V500:  5/99 *sh* - check if implicit regridding was already done by netCDF
+*			read using strides (check cx_delta of src cx)
+*		     Allow for the possibility of multiple axes
+* V530:  3/01 *sh* - added g=ax at nrst
+* V530:	 3/01 *acm* return a status flag from rcvd_regrid, tests for
+*                   valid calendar axes.
+* V533:	 6/01 *sh* - some regridding ops not allowed for string arrays
+*		   - mr_delta changes the handling of stride regridding
+* v541:  2/02 *kob*- on hankin request add an initialization line for
+*                    cx_delta in loop 500
+* V541:  4/02 *sh* - bug fix: delta not removed from result despite 
+*                  the fact that result is on a new axis where the delta 
+*                  is implicit rather than explicit in the axis definition 
+*                  see err540_strides_rev.jnl 
+* V552:  4/04 *acm* - bug fix.  For @AVE and related transforms @SUM, etc.
+*                     send src_lo_ss and src_hi_ss for the range on the src
+*                     axis.  Previous use of mr_lo_ss and mr_hi_ss can result
+*                     in incorrect results when a larger then needed chunk
+*                     of source data is already in4/15/03 memory
+* V554:  3/04 *acm* Fix the check for done_by_strides.
+* V603 5/07  *acm* - added MODNBD modulo regridding statistic
+* V671:  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+*                    The XY linear regridding matches past Ferret behavior, 
+*                    not using bilinear regridding for now
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V68+ 4/12  *acm*   Fix ticket 1931: the work space for XY linear regridding
+*                    was computed incorrectly.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xprog_state.cmn'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xalgebra.cmn'   ! with alg_regrid_code
+
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal exit is for error conditions
+* exit #1 is to signal completion of the activity at this stack level
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_CDF,
+     .		xy_regrid, valid, valid_y, has_impl_save, done_by_strides,
+     .		itsa_string
+	INTEGER hi_isp, lo_isp, axis, cx_valid, idim,
+     .		rgrd_trans, mrlist(5), wk_size, wk_size2,
+     .		dst_cx, src_cx, dst_mr, src_mr, ngd_mr, ave_mr,
+     .		blk1, axis_list(nferdims), naxis, i, nbd_mr, nxsrc
+	CHARACTER dtype*4
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+2	<--	level of next activity
+*	hi_isp	<--	level at which component was obtained
+*	lo_isp	<--	level at which regrid was requested (current isp)
+* --- end of introductory code ---
+
+* initialize
+	lo_isp   = isp                     
+	hi_isp   = lo_isp + 1
+	src_mr   = is_mr( hi_isp )
+	dst_cx   = is_cx( lo_isp )
+	src_cx   = is_cx( hi_isp )
+	axis	 = is_axis( lo_isp )
+	naxis	 = 1
+	axis_list(1) = axis
+	itsa_string = cx_type(src_cx) .EQ. ptype_string
+
+* what is the regridding transformation for this axis ?
+	rgrd_trans = cx_regrid_trans( axis, dst_cx )
+	xy_regrid = ( (rgrd_trans .EQ. prgrd_xy_ave) .OR. 
+     .                (rgrd_trans .EQ. prgrd_xy_lin) )
+	IF ( xy_regrid ) THEN
+	   IF ( mode_diagnostic ) WRITE (ttout_lun,*) 'regrid XY'
+	   IF (axis.NE.x_dim) CALL ERRMSG
+     .		( ferr_internal, status, 'rgrd_xy_regrid', *5000 )	! diagnostic
+	   naxis = 2
+	   axis_list(2) = y_dim
+	ENDIF
+
+* bug check:  has someone attempted to regrid a compressed axis?
+* (possible bug in check ... could we have unspec limits for another reason?)
+	IF ( cx_category(src_cx) .EQ. cat_user_var
+     . .AND. cx_lo_ss(src_cx,axis) .EQ. unspecified_int4 ) THEN
+	   IF (  uvar_given(axis,cx_variable(src_cx))
+     .	    .NE. uvlim_irrelevant )			 CALL ERRMSG
+     .		( ferr_invalid_command, status,
+     .		 'attempt to regrid on a compressed axis', *5000 )
+	ENDIF
+
+* (5/99) for netCDF variables strides may have been used in READ_TM and
+* the regridding already performed there. The src cx then contains the
+* limits appropriate to netCDF ... not to Ferret. So, make the source cx
+* into a clone of the final result.
+
+* (3/04) do not check for has_impl_grid: when we have done a DEFINE GRID/like=var
+* for later comparisons, this grid was stored as a static grid, but we have still 
+* read the data using strides, and therefore do not need to do a regridding operation.
+
+	IF ( cx_category(dst_cx) .EQ. cat_file_var ) THEN
+	   done_by_strides = 
+     .		TM_ITS_CDF(cx_data_set(dst_cx), dtype )
+c     .    .AND. cx_has_impl_grid(dst_cx)
+     .	  .AND. cx_delta(axis,src_cx) .NE. unspecified_val8
+	ELSE
+	   done_by_strides = .FALSE.
+	ENDIF
+	IF (done_by_strides) THEN
+	   DO 400 idim = axis+1, nferdims
+	      IF (cx_delta(idim,src_cx) .NE. unspecified_val8) THEN
+	         naxis = naxis + 1
+	         axis_list(naxis) = idim
+	      ENDIF
+ 400	   CONTINUE
+	ENDIF
+
+* Make the destination context like the source data context on all except
+* the regrid axis.  That one keeps the user-requested size.
+* (Other axes may have been modified by information embedded within a
+* user-variable definition.  An alternative (untested 8/89) approach is to
+* call PASS_AMBIG_LI** for uvars)
+	CALL TRANSFER_CONTEXT( src_cx, cx_buff )
+	DO 500 i = 1, naxis 
+	   idim = axis_list(i)
+	   CALL TRANSFER_AXIS( idim, dst_cx, cx_buff )
+	   cx_regrid_trans( idim, cx_buff ) = cx_regrid_trans( idim, dst_cx )
+	   cx_delta(idim,cx_buff) = unspecified_val8
+ 500	CONTINUE
+	cx_grid( cx_buff ) = cx_grid( dst_cx )
+	cx_unstand_grid( cx_buff ) = .TRUE.
+	has_impl_save = cx_has_impl_grid(dst_cx)
+	CALL TRANSFER_CONTEXT( cx_buff, dst_cx )
+	cx_has_impl_grid(dst_cx) = has_impl_save	! preserve this flag
+
+* create a context with the limits that can actually be regridded
+* ... if limits were unspecified in request allow full axis size
+	IF (done_by_strides) THEN
+	   cx_valid = dst_cx
+	   valid = .TRUE.
+	ELSE
+	   cx_valid = cx_buff
+	   CALL RCVD_REGRID( src_cx, dst_cx, axis, wk_size,
+     .		 cx_lo_ss(cx_valid,axis), cx_hi_ss(cx_valid,axis), status )
+	   cx_by_ss( axis, cx_valid ) = .TRUE.
+           valid = cx_lo_ss(cx_valid,axis) .LE. cx_hi_ss(cx_valid,axis)  ! 3/93
+           IF ( valid ) THEN   ! 3/93
+	      CALL CONFINE_AXIS( axis, cx_valid, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+	   IF ( xy_regrid ) THEN
+	      CALL RCVD_REGRID( src_cx, dst_cx, y_dim, wk_size2,
+     .		cx_lo_ss(cx_valid,y_dim),cx_hi_ss(cx_valid,y_dim), status)
+	      cx_by_ss( y_dim, cx_valid ) = .TRUE.
+              valid_y = cx_lo_ss(cx_valid,y_dim)
+     .             .LE. cx_hi_ss(cx_valid,y_dim)
+              IF ( valid_y ) THEN
+	         CALL CONFINE_AXIS( y_dim, cx_valid, status )
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+              ENDIF
+              valid = valid .AND. valid_y
+	   ENDIF
+	ENDIF
+
+* create a space for the new result possibly with the edges flagged as bad
+	CALL NEW_MR_W_EDGES( memory, cx_valid, dst_cx, dst_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( lo_isp ) = dst_mr
+
+* cannot actually regrid if the ranges aren't valid -> all bad result
+        IF ( .NOT.valid ) GOTO 1000      ! 3/93
+
+* diagnostic message ?
+	IF (mode_diagnostic) THEN
+	   IF (done_by_strides) THEN
+	      CALL DIAGNOSTIC_OUT('nulrgd ',dst_mr,  point_to_mr)
+	   ELSE
+	      CALL DIAGNOSTIC_OUT('regrid ',dst_mr,  point_to_mr)
+	   ENDIF
+	ENDIF
+
+* set up 4D array limits as unsubscripted variables in COMMON
+	mrlist(1) = src_mr
+	mrlist(2) = dst_mr
+	CALL NON_ARRAY_SUBSC( mrlist, 2 )
+
+* reserve working array space
+	IF ( rgrd_trans .EQ. prgrd_xy_ave) THEN
+	   CALL GET_WORK_SPC( wk_size+wk_size2, blk1, status )
+	ELSEIF (rgrd_trans .EQ. prgrd_xy_lin) THEN
+	   nxsrc = cx_hi_ss(src_cx,x_dim)-cx_lo_ss(src_cx,x_dim) + 1
+	   CALL GET_WORK_SPC( nxsrc*wk_size2+2*(wk_size+wk_size2), blk1, status )
+	ELSE
+	   CALL GET_WORK_SPC( 2*wk_size, blk1, status )
+	ENDIF
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* do the regridding
+	IF ( done_by_strides ) THEN
+	   CALL COPY_GRID( memory(1,mr_blk1(src_mr)),  src_mr,
+     .			   memory(1,mr_blk1(dst_mr)),  dst_mr )
+	ELSEIF ( rgrd_trans .EQ. prgrd_linear_interp ) THEN
+	   IF ( itsa_string ) GOTO 5010
+	   CALL DO_LIN_REGRID( cx_valid, axis,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), wk_size+1, 2*wk_size )
+	ELSEIF ( rgrd_trans .EQ. prgrd_associate ) THEN
+	   CALL DO_ASN_REGRID( cx_valid, axis,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr )
+	ELSEIF ( rgrd_trans .EQ. prgrd_average
+     .	 .OR.    rgrd_trans .EQ. prgrd_variance
+     .	 .OR.    rgrd_trans .EQ. prgrd_sum
+     .	 .OR.    rgrd_trans .EQ. prgrd_good_pt ) THEN
+	   IF ( itsa_string ) GOTO 5010
+	   CALL DO_AVE_REGRID( cx_valid, axis, rgrd_trans,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), src_cx, dst_cx,
+     .                  wk_size+1 )
+	ELSEIF ( rgrd_trans .EQ. prgrd_xy_ave ) THEN
+	   IF ( itsa_string ) GOTO 5010
+	   CALL DO_XYAVE_REGRID( cx_valid,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), src_cx, dst_cx,
+     .                  wk_size+1, wk_size+wk_size2 )
+	ELSEIF ( rgrd_trans .EQ. prgrd_xy_lin ) THEN
+	   IF ( itsa_string ) GOTO 5010
+	   CALL DO_XYLIN_REGRID( cx_valid,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), src_cx, dst_cx,
+     .                  wk_size+1, 2*wk_size+1, 
+     .                  2*wk_size+wk_size2+1, 2*(wk_size+wk_size2)+1, 
+     .                  nxsrc*wk_size2+2*(wk_size+wk_size2) )
+	ELSEIF ( rgrd_trans.EQ.prgrd_min
+     .	   .OR. rgrd_trans.EQ.prgrd_max ) THEN
+	   IF ( itsa_string ) GOTO 5010
+	   CALL DO_WINDOW_REGRID( cx_valid, axis, rgrd_trans,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), wk_size+1)
+	ELSEIF ( rgrd_trans .EQ. prgrd_xact_pts ) THEN
+	   CALL DO_XACT_REGRID( cx_valid, axis,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), wk_size+1, 2*wk_size )
+	ELSEIF ( rgrd_trans .EQ. prgrd_nearest ) THEN
+	   CALL DO_NEAREST_REGRID( cx_valid, axis,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1, blk1), wk_size+1, 2*wk_size )
+* modulo regridding
+	ELSE
+	   IF ( itsa_string ) GOTO 5010
+* ... for all modulo regridding cases allocate a temp variable to contain
+* ... the modngd (number of valid points) result -- this is used in all
+* ... of the modulo calculations.
+* ... For modvar (variance) also allocate a temp space for the average
+* ... which is needed in the process of computing the variance
+* ... For modnbd (number of invalid points) also allocate a temp space for 
+* ... the count of number of bad values 
+	   ave_mr = dummy_mr	! component 3 default
+
+	   CALL CREATE_TEMP_MEM_VAR(cx_valid,ngd_mr,status)
+	   IF ( status .NE. ferr_ok ) GOTO 5200
+	   mr_regrid_trans ( axis, ngd_mr ) =  prgrd_modngd
+
+	   CALL CREATE_TEMP_MEM_VAR(cx_valid,nbd_mr,status)
+	   IF ( status .NE. ferr_ok ) GOTO 5300
+	   mr_regrid_trans ( axis, nbd_mr ) =  prgrd_modnbd
+
+	   IF ( rgrd_trans .EQ. prgrd_modvar ) THEN
+	      CALL NEW_MR_W_EDGES(memory,cx_valid,dst_cx,ave_mr,status)
+	      IF ( status .NE. ferr_ok ) GOTO 5100
+!	      mr_regrid_trans ( axis, ave_mr ) = prgrd_modulo	! bookkeeping
+	   ENDIF
+
+* set up 4D array limits and do the regridding
+	   mrlist(3) = ngd_mr
+	   mrlist(4) = nbd_mr
+	   mrlist(5) = ave_mr
+	   CALL NON_ARRAY_SUBSC( mrlist, 5 )
+	   CALL MODULO_REGRID( cx_valid, axis, rgrd_trans,
+     .			memory(1,mr_blk1(src_mr)), src_mr,
+     .			memory(1,mr_blk1(dst_mr)), dst_mr,
+     .			memory(1,mr_blk1(ngd_mr)), ngd_mr,
+     .			memory(1,mr_blk1(nbd_mr)), nbd_mr,
+     .			memory(1,mr_blk1(ave_mr)), ave_mr )
+
+* ... delete temporary variables
+	   CALL DELETE_VARIABLE( ngd_mr )
+	   CALL DELETE_VARIABLE( nbd_mr )
+	   IF ( rgrd_trans .EQ.  prgrd_modvar ) THEN
+	      CALL DELETE_VARIABLE( ave_mr )
+	   ENDIF
+
+	ENDIF
+	CALL RELEASE_WORK_SPC
+
+* indicate we are done with the component
+ 1000   CALL MR_NOT_IN_USE( src_mr )
+	IF (done_by_strides) CALL DELETE_VARIABLE( src_mr ) ! invalid lims in mr
+
+* intermediate grid ? deallocate grid space and delete intermediate data
+	IF ( is_phase( lo_isp ) .EQ. prgrd_from_ntrmed ) THEN
+	   CALL DEALLO_GRID( status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( mr_protected(src_mr) .EQ. mr_not_protected )
+     .			CALL DELETE_VARIABLE ( src_mr )
+	ENDIF
+
+* pop off context used by source grid
+        cx_stack_ptr = cx_stack_ptr - 1
+	RETURN 1
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .		'cant use this regrid transform on strings: @'
+     .		//alg_regrid_code(rgrd_trans), *5000)
+ 5100	CALL DELETE_VARIABLE( dst_mr )
+ 5200	CALL DELETE_VARIABLE( ngd_mr )
+ 5300	CALL DELETE_VARIABLE( nbd_mr )
+	GOTO 5000
+	END	
+
+
+
+
+
diff --git a/fer/stk/is_reverse.F b/fer/stk/is_reverse.F
new file mode 100644
index 0000000..2931f95
--- /dev/null
+++ b/fer/stk/is_reverse.F
@@ -0,0 +1,184 @@
+	SUBROUTINE IS_REVERSE( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* reverse the ordering of the data along the axes indicated in ds_ordering
+* and delete the (backwards) component data from memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V320: 2/16/95
+* V411: 9/11/95 (IBM port) array "reversed" is declared wrong type
+* V500: 7/99 *sh* is strides were applied to reversed axes need special
+*	handling of the limits
+* V541: 2/02 *sh* - bug fix -- 6/01 changes in the handling of delta strides
+*			(see read_tm.F) were not propagated to this routine
+* V602  8/06 *jli* chages for native strides 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+!        include 'tmap_errors.parm'
+!        include 'implicit.parm'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for moduloing )
+
+* internal variable declarations:
+	INTEGER TM_AXES_REVERSED, nrev,
+     .		com_mr, res_mr, com_cx, res_cx,	com_isp, res_isp,
+     .		axis, i, var, hi_ss, lo_ss, itmp, reversed(nferdims),
+     .          grid, line
+
+* --- end of introductory code ---
+
+* Routine IS_STRIP requests the reversed component data under
+* the special category cx_category=cat_revfile
+
+* initialize
+	res_isp    = isp
+	com_isp    = isp + 1
+	com_mr     = is_mr( com_isp )
+	res_cx     = is_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	axis       = is_axis( res_isp )
+	var	   = cx_variable(com_cx)
+
+* get the list of reversed axes
+	nrev = TM_AXES_REVERSED(var, reversed)
+
+* diagnostic mode output: " doing modulo VAR_NAME[x=lo:hi,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .				( 'doing',isact_class_reverse, res_cx, axis )
+
+!* strides indicated in cx_delta e.g. SST[I=110:180:10] ?
+!* If so, transfer this info to the stride array
+!        has_a_stride = .FALSE.
+!        DO 100 idim = 1, nferdims
+!           has_strides(idim) =  cx_delta(idim,res_cx) .NE. unspecified_val8
+!     .                   .AND.  cx_delta(idim,res_cx) .NE. 1 
+!           IF (has_strides(idim))  has_a_stride = .TRUE.
+! 100    CONTINUE
+
+!* if strides are invloved memory requirement is less ... (cloned from READ_TM)
+!* 2/02 -- no longer necessary or appropriate
+!        CALL TRANSFER_CONTEXT(res_cx, cx_buff)
+!        IF (has_a_stride) THEN
+!           DO 200 idim = 1, nferdims
+!              IF  (has_strides(idim)) THEN
+! 1  	cx_lo_ss( cx_buff, idim ) = 1 
+!               cx_hi_ss( cx_buff, idim ) = 
+!     .                (cx_hi_ss(res_cx,idim) - cx_lo_ss(res_cx,idim))
+!     .              / INT(cx_delta(idim,res_cx))  + 1
+!                 cx_delta(idim,res_cx) = unspecified_val8
+!              ENDIF
+! 200      CONTINUE
+!        ENDIF
+
+* create the space for the result in memory
+	CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+	is_mr( res_isp ) = res_mr
+
+* the component data thinks that its subscripts are from "the other end" of
+* the axis (from whence the data were read).  In order to prevent subscript
+* errors we will disabuse the data of that misconception atthis point
+	DO 300 i = 1, nrev
+	   axis = reversed(i)
+!	   IF (has_strides(axis)) GOTO 300	  ! already handled above
+
+
+	   CALL VAR_SS_LIMS( axis, res_cx, lo_ss, hi_ss )
+
+!      for a strided axis
+           grid = cx_grid(res_cx)
+           line = grid_line(axis,grid)
+           IF( line_parent(line) .NE. 0 ) THEN
+              lo_ss=line_dim(line)
+              hi_ss=1
+           ENDIF
+
+	   itmp = mr_lo_ss( com_mr, axis )
+	   mr_lo_ss(com_mr,axis) = hi_ss + lo_ss - mr_hi_ss(com_mr,axis)
+	   mr_hi_ss(com_mr,axis) = hi_ss + lo_ss - itmp
+ 
+	   itmp = cx_lo_ss( com_cx, axis )
+	   cx_lo_ss(com_cx,axis) = hi_ss + lo_ss - cx_hi_ss(com_cx,axis)
+	   cx_hi_ss(com_cx,axis) = hi_ss + lo_ss - itmp
+ 
+ 300	CONTINUE
+
+* copy the source data into the result
+	CALL COPY_INTO(
+     .    memory( 1, mr_blk1(com_mr) ), com_mr, com_cx,
+     .    memory( 1, mr_blk1(res_mr) ), res_mr   )
+
+* reverse the result along all of the required axes
+	DO 400 i = 1, nrev
+	   CALL REVERSE_GRID_AXIS
+     .		( reversed(i), res_cx, res_mr,memory(1, mr_blk1(res_mr)) )
+ 400	CONTINUE
+
+* successful completion of modulo operation
+ 1000	CALL MR_NOT_IN_USE( com_mr )	! remove memory protection on component
+	CALL DELETE_VARIABLE( com_mr )  ! delete reversed component data
+	cx_stack_ptr = cx_stack_ptr - 1 ! pop com_cx from context stack
+	status = ferr_ok
+	RETURN 2
+
+* error exits
+ 5000	RETURN
+ 5100	CALL MR_NOT_IN_USE( com_mr )
+	CALL DELETE_VARIABLE( com_mr )  ! delete reversed component data
+	GOTO 5000
+	END	
+
diff --git a/fer/stk/is_sample.F b/fer/stk/is_sample.F
new file mode 100644
index 0000000..9124e88
--- /dev/null
+++ b/fer/stk/is_sample.F
@@ -0,0 +1,228 @@
+	SUBROUTINE IS_SAMPLE( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This routine handles the I/O management logic for the SAMPLE* functions
+* When the user issues SAMPLEI({1,5,3,3,8},my_var) this routine will
+* compute the result in an "optimal" way -- probably by requesting 1:5 in
+* one I/O operation and 8:8 in a separate one and the merging the chunks
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 8/99
+*	 *sh* 2/00 (??) - correct improper handling of invalid indices
+* V533; *sh* 7/01 - add support for sampling of string variables
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for sampling )
+
+* internal variable declarations:
+	LOGICAL	all_at_once
+	INTEGER DENSE_CONTIG_REGION, MGRID_SIZE_DELTA
+	INTEGER chunk_mr, hold_mr, chunk_cx, hold_cx,
+     .		axis, n, phase, lo_cx_lim, hi_cx_lim, mr_sorted_indices,
+     .		mr_index_map, idim, chunk_isp, hold_isp, cat, var,
+     .		nvalid
+
+
+* --- end of introductory code ---
+
+* initialize
+	hold_isp   = isp
+	chunk_isp  = isp + 1
+	hold_mr    = is_mr( hold_isp )		! to be filled by chunks
+	chunk_mr   = is_mr( chunk_isp )		! each invidivual chunk
+	hold_cx    = is_cx( hold_isp )
+	chunk_cx   = is_cx( chunk_isp )
+!	dflt_cx	   = is_big_cx( hold_isp )
+	axis       = is_axis( hold_isp )
+	phase      = is_phase(hold_isp)
+	mr_index_map      = is_sum(hold_isp)/10000
+	mr_sorted_indices = is_sum(hold_isp) - 10000*mr_index_map
+	nvalid = mr_hi_ss( mr_index_map, t_dim )	! valid indices
+	cat = cx_category(chunk_cx)
+	var = cx_variable(chunk_cx)
+
+****  A NEW CHUNK OF DATA HAS JUST ARRIVED  ****
+*  Copy it into the result "holder"
+	IF ( phase .GT. 0 ) THEN
+
+* the context for the holder may be missing its limits on axes other than the
+* sampling axis
+	   DO 100 idim = 1, nferdims
+	      IF ( idim .NE. axis ) THEN
+	         CALL TRANSFER_AXIS( idim, chunk_cx, hold_cx )
+	      ENDIF
+ 100	   CONTINUE
+
+* create result space if this is the first chunk
+	   IF ( hold_mr .EQ. unspecified_int4 ) THEN
+	      CALL CREATE_TEMP_MEM_VAR( hold_cx, hold_mr, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      is_mr( hold_isp ) = hold_mr
+
+* pre-fill output with missing flags, in case a missing index was given
+	      IF ( mr_type(hold_mr) .EQ. ptype_string ) THEN
+	        CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(hold_mr),
+     .                                    memory(1, mr_blk1(hold_mr)),
+     .                                    mr_c_pointer(hold_mr)      )
+	        CALL SET_NULL_C_STRING_ARRAY(mr_c_pointer(hold_mr),
+     .					     MGRID_SIZE_DELTA(hold_mr) )
+
+	      ELSE
+	        CALL FILL_MEMORY ( memory, mr_blk1 (hold_mr),
+     .				   mr_nblks(hold_mr),
+     .				   mr_bad_data(hold_mr) )
+	      ENDIF
+
+	   ENDIF
+
+	   IF ( nvalid .GT. 0 ) THEN
+* for optimization, make sure we are using all of the source data that we can
+* the ADJUST_COPY_LIMITS routine will modify "phase" to use all available data
+	     n = phase
+	     CALL ADJUST_COPY_LIMITS(axis, chunk_mr,
+     .				     memory(1,mr_blk1(mr_sorted_indices)),
+     .				     phase, nvalid )
+	     IF (phase .GT. n) THEN
+* ... apply the optimization
+	        cx_hi_ss(chunk_cx, axis) = mr_hi_ss(chunk_mr,axis)
+	        cx_by_ss(axis,chunk_cx) = .TRUE.
+	        CALL FLESH_OUT_AXIS( axis, chunk_cx, status)
+	        IF (status .NE. ferr_ok) CALL ERRMSG( ferr_internal, status,
+     .		    'SAMPLE* optimization', *5000)
+	     ENDIF
+
+* copy data just received into the result
+	     CALL COPY_INTO_MAPPED(
+     .			memory(1,mr_blk1(chunk_mr)), chunk_mr, chunk_cx,
+     .			memory(1,mr_blk1(mr_sorted_indices)),
+     .			memory(1,mr_blk1(mr_index_map)), phase, axis,
+     .			memory(1,mr_blk1(hold_mr)), hold_mr )
+
+* ... remove the component protection that signaled we needed it here
+	   ENDIF
+	   CALL MR_NOT_IN_USE( chunk_mr )
+	ENDIF
+
+*********  SETUP TO GRAB THE NEXT CHUNK  **********
+
+* do we want to grab the entire input as a single sample?
+	IF (cat .EQ. cat_user_var) THEN
+* ... if limits are part of the uvar def'n, use 'em
+* ...  and if an indefinite integral is involved, do not break up computation
+	   all_at_once = uvar_given(axis,var) .LE. uvlim_gvn_xact
+     .		    .OR. uvar_given(axis,var) .EQ. uvlim_need_lo
+	ELSE
+	  all_at_once = cat .EQ. cat_const_var
+     .	           .OR. cat .EQ. cat_pseudo_var
+     .	           .OR. cat .EQ. cat_constant
+	ENDIF
+* ... if limits are explicit inside of the fcn call then use 'em
+	all_at_once = all_at_once .OR. cx_given(axis,chunk_cx)
+
+* total number of indices
+	n = mr_hi_ss( mr_index_map, x_dim )
+
+* determine next chunk to get
+	IF ( nvalid .EQ. 0 ) THEN
+	   IF (phase .EQ. 0) THEN
+	      lo_cx_lim = 1	! get any old point just so we can have
+	      hi_cx_lim = 1	! a complete context for the result
+	      is_phase(hold_isp) = 1
+	   ELSE
+	      is_phase(hold_isp) = -1  ! all done with sampling
+	   ENDIF   
+	ELSEIF ( all_at_once ) THEN
+	   IF (phase .EQ. 0) THEN
+	      is_phase(hold_isp) = nvalid
+	   ELSE
+	      is_phase(hold_isp) = -1  ! all done with sampling
+	   ENDIF
+	   lo_cx_lim = cx_lo_ss(chunk_cx,axis)  ! grab all of it at once
+	   hi_cx_lim = cx_hi_ss(chunk_cx,axis)
+	ELSE
+	   is_phase(hold_isp) = DENSE_CONTIG_REGION(
+     .				memory(1,mr_blk1(mr_sorted_indices)), 
+     .				phase+1, nvalid,
+     .				mr_bad_data(mr_sorted_indices),
+     .				lo_cx_lim, hi_cx_lim )
+	ENDIF
+
+* done?  Pop chunk_cx from context stack
+	IF ( is_phase(hold_isp) .LE. 0 ) THEN
+	   cx_stack_ptr = cx_stack_ptr - 1
+	   IF ( hold_cx .NE. cx_stack_ptr ) CALL WARN('SAMP_STK_ERR')
+* ... free the work space used for the sampling inddices
+	   CALL DELETE_VARIABLE(mr_index_map)
+	   CALL DELETE_VARIABLE(mr_sorted_indices)
+	   RETURN 2
+	ENDIF
+
+* no, more to get.  Set up chunk_cx to get the next slug of indices
+	cx_lo_ss(chunk_cx,axis) = lo_cx_lim 
+	cx_hi_ss(chunk_cx,axis) = hi_cx_lim
+	cx_by_ss(axis,chunk_cx) = .TRUE.
+	CALL FLESH_OUT_AXIS( axis, chunk_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* push the interpretation stack and go get it
+	isp = chunk_isp
+	status = ferr_ok
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+
+	END	
+
diff --git a/fer/stk/is_string.F b/fer/stk/is_string.F
new file mode 100644
index 0000000..54a77ed
--- /dev/null
+++ b/fer/stk/is_string.F
@@ -0,0 +1,76 @@
+	SUBROUTINE IS_STRING( memory, *, *, status )
+
+* create a string  "variable" in memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500:  1/99 - based on IS_CONST_VAR
+* V530:  8/00 *sh* - support for string arrays -- use dynamic memory alloc
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER	MGRID_SIZE, mr, cx, uvar, item, start, end
+
+* --- end of introductory code ---
+
+* NOTE: it is by historical accident that this routine exists at all.
+* To be fully consistent the string variables created by this routine should
+* be created by is_constant with a cx_type of ptype_string and a cx_category
+* of cat_constant. So it goes ...
+
+* This routine extracts the sring given in a user variable definition and
+* inserts it into a Ferret string variable. The string, itself, is stored
+* in dynamic storage via C. The pointer to the string is put into the
+* Ferret mr storage.
+
+* initialize
+	cx = is_cx( isp )
+
+* reserve and catalog space for the pointer(s) to the string
+	CALL CREATE_MEM_VAR( cx, mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( isp ) = mr
+
+* save the pointer array address in cx_c_pointer
+	CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mr),
+     .				  memory(1,mr_blk1(mr)),
+     .				  mr_c_pointer(mr)      )
+
+* determine the string to be stored
+	uvar = cx_variable(cx)/1000
+	item = cx_variable(cx) - 1000*uvar
+	start = uvar_item_start( item, uvar ) + 1  ! +1 skip quote
+	end   = uvar_item_end  ( item, uvar ) - 1  ! -1 skip quote
+
+* save the string in dynamic memory
+	CALL STORE_STRING(uvar_text(uvar)(start:end),
+     .			  mr, 0, status)
+	IF (status .NE. ferr_ok) GOTO 5000
+
+* diagnostic output
+	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT('string',mr,point_to_mr)
+
+* set the bad data flag
+	mr_bad_data( mr ) = bad_val4
+
+* got the requested component
+	status = ferr_ok
+	RETURN 2
+! RETURN 1, which is to request a sub-component, is never used ...
+
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/is_strip.F b/fer/stk/is_strip.F
new file mode 100644
index 0000000..ba13cde
--- /dev/null
+++ b/fer/stk/is_strip.F
@@ -0,0 +1,554 @@
+	SUBROUTINE IS_STRIP( act_class, idim, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* strip away the requirement for a transformation of a variable on the
+* interpretation stack by dedicating a stack level to the evaluation of that
+* transformation and putting a request for the first required component of the
+* calculation onto the stack.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/21/87
+* ... (many revisions) ... revision 1.0 - 7/25/88 - added re-gridding code
+* V200:  7/20/89 - 4D symmetrical - major re-write
+*	10/16/89 - correct bug in regrid code when axis=0
+*	 2/19/90 - corrected bug on RETURN when no regrid to do
+*	 2/27/90 - pass through unspecified regions to be handled later
+* V301:  2/24/94 - small change due to mode_arg as a 2D variable
+* V320:	 12/8/94 - add modulo operations on all file variables
+*	 2/21/95 - add support for reversed coordinate axes
+* V420:  9/97/95 - bug fix for index=0:npts ("GT" should be "GE")
+* 	   11/95 - strip of modulo wraps and allow gathering on modulo regrid
+*		 - also, only gather a calculation if mode despeerate is SET
+*		 - changed "csize" into "cxsize" to psych out a weird OSF bug
+*	 	 - added isact_class_reconcile for command qualifiers
+*		 - check for explicit limits with @ITP 
+* V430:     7/96 - incorporate 4D transformations:  AVE, VAR, DIN, NDG, NBD
+* V490:  9/97 - *sh* OFFSET_SS returns status
+*	     - *kob* replaced call to ISUBSCRIPT w/ call to ISUBSCR_CX in order
+*               to have access to context information - needed for negative
+*               time step processing
+* V510: *sh* 9/99 - remove warning about too-negative modulo. Change in
+*	TM_WORLD has hopefully made this a legitimate operation
+*	*sh* 1/00 - bug fix: @ITP failed to set subscripts if exact grid point
+* V533: *sh* 6/01 - support for combined netCDF strides (cx_delta) and modulo
+* V541: *sh* 2/02 - support for modulo axis lengtha
+* 560: *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+* V602  8/06 *jli* chages for native strides 
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V690+ 11/13 *sh* support for auxiliary var regridding: temp[gz(depth)=zax]
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xalgebra.cmn'
+	include	'xax_speed.cmn'
+        include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+	INTEGER	act_class, idim, status
+* RETURN 1 - goes back to strip off any remaining transformations
+
+* internal variable declarations:
+	LOGICAL	ITSA_MODULO_REGRID, TM_ITS_SUBSPAN_MODULO, NC_GET_ATTRIB,
+     .		itsa_uvar, modulo_dest_regrid, allatonce, attoutflag, got_it
+	INTEGER	CGRID_SIZE_MAX, CAXIS_LEN, CAXIS_MODLEN, CX_DIM_LEN, 
+     .		AUX_AXIS_FROM_ARG, CGRID_AXIS, POTENT_SIZE,
+     .		ISUBSCR_CX, TM_AXES_REVERSED, CGRID_SIZE, MODULO_PARITY,
+     .		nrev, reversed(nferdims), idel,
+     .		trans, grid, dset, lo_off, hi_off, aclass,
+     .		lo_cx, hi_cx, big_cx, lo_isp, i, axis,
+     .		cxsize, split_ax, split_ax_len, frag, var, ss, lo_ss,
+     .		hi_ss, nmod, nmodhi, npts, xlate, dup_cx, i4d,
+     .          line, imemb, imemb_dset, grids_dset, len, 
+     .		igrid, iline, varid, attlen, maxlen, fer_uvar, nv, memb_dset
+	REAL	ax_frac, vbad
+	REAL*8	TM_WORLD, ww_given, ww_nrst
+	CHARACTER*128 VAR_CODE, vname
+	CHARACTER*10 buff
+
+* --- end of introductory code ---
+* initiailize - ! temp:always called at bottom of stack frame for transform
+	aclass = act_class
+	lo_isp = isp
+	lo_cx  = is_cx( lo_isp )
+	grid   = cx_grid( lo_cx )
+	dset   = cx_data_set( lo_cx )
+	var    = cx_variable( lo_cx )
+	axis   = idim
+	is_phase( lo_isp ) = unspecified_int4	! diag housekeeping
+	is_sum  ( lo_isp ) = unspecified_int4	! diag housekeeping
+	itsa_uvar = cx_category(lo_cx) .EQ. cat_user_var
+	modulo_dest_regrid = .FALSE.		! if regrid requires modulo
+
+* set up a context buffer to be modified for various grids needed
+	CALL CREATE_NEW_CONTEXT( lo_cx, hi_cx, status )	! pushes stack
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+****************
+
+ 100	IF (aclass .EQ. isact_class_aggregate_gather) THEN
+
+* Set up to gather the components of an aggregate variable
+	   is_act( lo_isp ) = isact_aggregate_gather
+
+* Save the default context so it can be re-used for each aggregate member.
+	   CALL CREATE_NEW_CONTEXT(lo_cx, big_cx, status )  ! pushes stack
+ 	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_big_cx( lo_isp ) = big_cx
+
+* cancel result pointer to indicate no result yet
+	   is_mr( lo_isp ) = unspecified_int4
+
+* Set up context (hi_cx) to get the first requested aggregate member of M
+
+	   is_sum( lo_isp ) = cx_hi_ss(lo_cx, idim)
+	   is_phase( lo_isp ) = cx_lo_ss(lo_cx, idim)
+
+	   CALL TRANSFER_CONTEXT( big_cx, hi_cx )
+
+* Set limits on e-direction to be unspecified
+ 
+	   cx_lo_ss( hi_cx,e_dim ) = unspecified_int4
+	   cx_hi_ss( hi_cx,e_dim ) = unspecified_int4
+	   cx_by_ss( e_dim,hi_cx) = .TRUE.
+
+* Set the grid to the grid of the first aggregate component...
+	   imemb = is_phase( lo_isp )
+
+	   vname = VAR_CODE (cat_file_var, cx_variable(hi_cx))
+	   CALL CD_GET_AGG_VAR_INFO (dset, vname, imemb, fer_uvar, 
+     .                memb_dset, igrid, iline, nv, status)
+
+* Grid wasnt stored for this variable if its a LET/D variable in member dset
+* Let it be the agg grid ?? (or could set the grid to a number less than 
+* unspecified_int4 to call get_uvar_grid for this LET/D member var)
+
+	   IF (igrid .EQ. unspecified_int4) THEN 
+	      cx_data_set(hi_cx) = memb_dset
+	      cx_category(hi_cx) = cat_user_var
+	      cx_variable(hi_cx) = nv
+	   ELSE
+
+	      CALL CD_GET_VAR_ID (memb_dset, vname, varid, status)
+	      maxlen = 1
+	      got_it = NC_GET_ATTRIB( memb_dset, varid, 'missing_value',
+     .                .FALSE., vname, maxlen, attlen,
+     .                attoutflag, buff, vbad )
+     
+
+	      cx_grid( hi_cx ) = igrid
+	      cx_data_set(hi_cx) = memb_dset
+
+	      IF (fer_uvar .EQ. 3) THEN
+	         cx_category(hi_cx) = cat_user_var 
+	      ELSE
+	         cx_category(hi_cx) = cat_file_var 
+	         cx_bad_data(hi_cx) = vbad
+	      ENDIF
+	   ENDIF
+	   is_uvar(lo_isp) = cx_variable(hi_cx)
+
+	ELSEIF ( aclass .EQ. isact_class_trans) THEN
+
+* SET UP FOR A TRANSFORMATION
+	   trans  = cx_trans( axis, lo_cx )
+	   is_act( lo_isp ) = isact_trans_code + trans
+	   cx_trans    ( axis, hi_cx ) = trans_no_transform
+	   cx_trans_arg( axis, hi_cx ) = bad_val4
+
+* pass unspecified regions on through
+	   IF ( cx_lo_ss(hi_cx,idim) .EQ. unspecified_int4
+     .	 .AND.  trans .NE. trans_interpolate ) GOTO 200   ! 2/90
+
+* possibly need different limits for component than for result
+	   IF ( grid .NE. unspecified_int4 ) THEN
+	      IF ( trans .LT. trans_compress_code ) THEN
+	         CALL OFFSET_SS( axis, lo_cx, lo_off, hi_off, status )
+		 IF ( status .NE. ferr_ok ) GOTO 5000
+	         cx_lo_ss(hi_cx,axis) = cx_lo_ss(hi_cx,axis) + lo_off
+	         cx_hi_ss(hi_cx,axis) = cx_hi_ss(hi_cx,axis) + hi_off
+	         cx_by_ss(axis,hi_cx) = .TRUE.
+	         CALL CONFINE_AXIS( axis, hi_cx, status )
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+* set up for interpolation
+	      ELSEIF ( trans .EQ. trans_interpolate ) THEN
+* ... 11/95: allow explicit "@ITP" but only with explicit coord cuz
+*	when mode interp is cancelled coords get rounded early on
+	         IF ( .NOT.mode_interpolate
+     .		 .AND..NOT.cx_given(axis,lo_cx) ) CALL ERRMSG
+     .		( ferr_invalid_command, status, 
+     .                  '@ITP must be accompanied by explicit coord'
+     .			//pCR
+     .			//'e.g. "Z=@57 at ITP" is OK but "Z=@ITP" is not',
+     .								*5000 )
+	         ww_given = cx_lo_ww(axis,hi_cx)
+	         ss = ISUBSCR_CX(ww_given,grid,axis,hi_cx,round_dn)
+	         ww_nrst = TM_WORLD( ss, grid, axis, box_middle )
+	         CALL GRID_SUBSCRIPT_EXTREMES( lo_ss, hi_ss, grid, axis )
+	         cx_by_ss(axis,hi_cx) = .TRUE.
+	         IF ( ww_given .LT. ww_nrst ) THEN
+	            cx_lo_ss(hi_cx,axis) = MAX( ss-1, lo_ss )
+	            cx_hi_ss(hi_cx,axis) = ss
+	         ELSEIF( ww_given .GT. ww_nrst ) THEN
+	            cx_lo_ss(hi_cx,axis) = ss
+	            cx_hi_ss(hi_cx,axis) = MIN( ss+1, hi_ss )
+	         ELSE
+	            cx_lo_ss(hi_cx,axis) = ss
+	            cx_hi_ss(hi_cx,axis) = ss
+	         ENDIF
+	      ENDIF
+	   ENDIF
+
+* rebuild the axis now that we've messed with it
+ 200	   CALL FLESH_OUT_AXIS( axis, hi_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* do the same for other transformed axes if this is a 4D transformation
+	   DO 220 i4d = 1, num_4d_trans
+	      IF ( trans .EQ. alg_4d_trans(i4d) ) THEN
+	         DO 210 i = 1, nferdims 
+	            IF (  cx_trans( i, hi_cx ) .NE. trans ) GOTO 210
+	            IF ( i .EQ. idim ) GOTO 210  	! already done
+	            cx_trans	( i, hi_cx ) = trans_no_transform
+	            cx_trans_arg( i, hi_cx ) = bad_val4
+	            CALL FLESH_OUT_AXIS( i, hi_cx, status )
+	            IF ( status .NE. ferr_ok ) GOTO 5000
+ 210	         CONTINUE
+	      ENDIF
+ 220	   CONTINUE
+
+	ELSEIF( aclass .EQ. isact_class_regrid ) THEN
+* SET UP FOR REGRIDDING
+	   IF (cx_naux(lo_cx) .EQ. 0 ) THEN
+* ... normal regridding
+	      CALL REGRID_LIMS( lo_cx, hi_cx, axis, status, *6000 ) !ab ret->mod
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+* ... see if no regridding was required after all
+	      IF ( .NOT.cx_unstand_grid(lo_cx) ) THEN
+	         cx_stack_ptr = cx_stack_ptr - 1	
+	         RETURN 1					! mod 2/90
+	      ENDIF
+	      is_act ( lo_isp ) = isact_regrid
+	   ELSE
+* ... auxiliary variable regridding - set up to get the first aux var
+* TEMPORARY:  ONLY HAS LOGIC TO SUPPORT 1D AT THIS POINT.  Hard-coded "1"'s
+	      CALL GET_AUX_VAR_CONTEXT( lo_cx, hi_cx, 1, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+* ! temporary diagnostic check that grids of aux vars are found in get-grid phase
+	      IF ( cx_grid(hi_cx) .EQ. unspecified_int4 ) 
+     .		CALL ERRMSG(ferr_internal, status, 'auxvar grid??', *5000)
+	      axis = AUX_AXIS_FROM_ARG(lo_cx, 1)
+	      is_phase ( lo_isp ) = isphase_get_aux_var
+	      is_sum ( lo_isp ) = 1        ! get the first aux var named
+	      is_act ( lo_isp ) = isact_auxvar_regrid
+	   ENDIF
+	   aclass = isact_class_regrid
+
+
+	ELSEIF( aclass .EQ. isact_class_aux_plot_vars ) THEN
+* SET UP TO GET AUXILIARY ARGUMETS FOR 3-ARG PLOTS ONTO THE STACK
+* ...  set up to get the first aux var
+* NOTE:  ONLY HAS LOGIC TO SUPPORT 1D AT THIS POINT.  Hard-coded "1"'s
+	   CALL GET_AUX_VAR_CONTEXT( lo_cx, hi_cx, 1, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   axis = AUX_AXIS_FROM_ARG(lo_cx, 1)
+	   is_phase ( lo_isp ) = isphase_get_aux_var
+	   is_sum ( lo_isp ) = 1        ! get the first aux var named
+	   is_act ( lo_isp ) = isact_aux_plot_vars  ! a no-op place holder
+
+	ELSEIF( aclass .EQ. isact_class_modulo ) THEN    ! 12/94 addition
+* SET UP TO ASSEMBLE BASE COMPONENTS ONTO A MODULO AXIS
+!* Let this potentially fatal error slide through because it is often safe and
+!* it is a nuisance to the user to change ... I guess (???) *sh* 
+!	   IF ( cx_lo_ss(lo_cx,axis) .LE. (unspecified_int4+10) ) THEN
+!	      buff = VAR_TRANS(axis, lo_cx, i )
+! 	      CALL WARN('Modulo axis index is too negative: '//
+!     .		buff(:i))
+!	      CALL WARN('This can crash FERRET!!!'//
+!     .		' --> Use higher coordinate values.')
+!	   ENDIF
+* shift the requested range into the base modulo (1:n) limits
+	   npts	   = CAXIS_MODLEN( axis, hi_cx )
+	   nmod = ( cx_lo_ss(lo_cx, axis) - 1 ) / npts
+	   IF ( cx_lo_ss(lo_cx, axis) .LE. 0 ) nmod = nmod - 1
+	   xlate = npts * nmod
+	   cx_lo_ss(hi_cx, axis) = cx_lo_ss(lo_cx, axis) - xlate
+	   cx_hi_ss(hi_cx, axis) = cx_hi_ss(lo_cx, axis) - xlate
+* for subspan modulo axis do not request the fictitious "n+1" point
+	   IF ( TM_ITS_SUBSPAN_MODULO(CGRID_AXIS(axis, lo_cx)) ) THEN
+	     IF (cx_lo_ss(hi_cx,axis).EQ.npts) THEN
+	       IF (cx_hi_ss(hi_cx,axis).GT.npts) THEN
+* ... improper translation was based upon void start point
+	         nmod = nmod + 1
+	         cx_lo_ss(hi_cx,axis) = 1
+	         cx_hi_ss(hi_cx,axis) = cx_hi_ss(hi_cx,axis) - npts
+	       ELSE
+* ... only a void point was requested, hack is to request the last valid point
+	         cx_lo_ss(hi_cx,axis) = npts - 1
+	         cx_hi_ss(hi_cx,axis) = npts - 1
+	       ENDIF
+	     ENDIF
+	     IF (cx_hi_ss(hi_cx,axis) .GE. npts)
+     .	        cx_hi_ss(hi_cx,axis) = npts - 1
+	   ELSE
+* trim the (first) request to the limits of the data
+	     IF (cx_hi_ss(hi_cx,axis) .GT. npts)
+     .	        cx_hi_ss(hi_cx,axis) = npts
+	   ENDIF
+	   IF (cx_lo_ss(hi_cx,axis) .GT. cx_hi_ss(hi_cx,axis))
+     .	     cx_lo_ss(hi_cx,axis) = cx_hi_ss(hi_cx,axis)
+
+* if requested span exceeds axis length we can modulo from one request
+* note that with strides the parity may shift in the right hand replication
+*      regrid_lims only lets those cases thru to here if rqsted span le npts
+	   allatonce = cx_hi_ss(lo_cx,axis)-cx_lo_ss(lo_cx,axis)
+     .		  .GE. CAXIS_LEN(axis,lo_cx)
+	   IF ( allatonce ) THEN
+	     IF (cx_delta(axis,lo_cx) .EQ. unspecified_val8) THEN
+	        cx_lo_ss(hi_cx, axis) = 1
+	     ELSE
+	        idel = NINT(cx_delta(axis,lo_cx))
+	        cx_lo_ss(hi_cx, axis) = MODULO_PARITY(cx_lo_ss(lo_cx,axis),
+     .					npts, idel)
+	        allatonce = npts .EQ. (npts/idel)*idel   ! parity shift?
+	     ENDIF
+	   ENDIF
+* ... always request full base region for modulo regridding
+	   IF ( modulo_dest_regrid ) THEN
+	      cx_lo_ss(hi_cx, axis) = unspecified_int4  ! implying "1"
+	      cx_hi_ss(hi_cx, axis) = unspecified_int4  ! implying "npts"
+!	      cx_lo_ss(hi_cx, axis) = 1
+!	      cx_hi_ss(hi_cx, axis) = npts
+	      cx_given(axis,hi_cx)  = .FALSE. !"explicit" lims f*ck PASS_AMBIG_
+	   ENDIF
+* ... rebuild the axis now that we've messed with it
+	   cx_by_ss(axis,hi_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( axis, hi_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+* ... clone the entire context to be requested (for sanity check in IS_MODULO)
+	   CALL CREATE_NEW_CONTEXT( hi_cx,dup_cx,status ) ! pushes stack
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_big_cx(lo_isp) = hi_cx
+	   hi_cx = dup_cx		! hi_cx on top for easier sanity checks
+* ... prepare to assemble the modulo pieces
+* ... only a single access needed (see IS_MODULO for logic details)
+	   is_act ( lo_isp ) = isact_modulo
+	   IF ( cx_hi_ss(lo_cx, axis) .GE. 1 ) THEN
+	      nmodhi = ( cx_hi_ss(lo_cx, axis) - 1 ) / npts
+	   ELSE
+	      nmodhi = cx_hi_ss(lo_cx, axis) / npts - 1
+	   ENDIF
+	   IF ( allatonce .OR. nmod.EQ.nmodhi 		) THEN
+	      is_phase ( lo_isp ) = isphase_allatonce
+	   ELSE
+	      is_phase ( lo_isp ) = isphase_1
+	   ENDIF
+	   aclass = isact_class_modulo
+
+	ELSEIF( aclass .EQ. isact_class_subspan_fill ) THEN
+* SET UP TO INSERT PHANTOM POINT INTO VOID AT END OF SUBSPAN MODULO AXIS
+* ... update the axis, omitting the top point
+	   npts	= CAXIS_LEN( axis, lo_cx )
+	   IF (cx_hi_ss(hi_cx, axis) .NE. npts+1) CALL ERRMSG
+     .		( ferr_internal, status, 'subspan_fill_not_N+1', *5000 )
+	   cx_hi_ss(hi_cx, axis) = npts
+	   IF ( cx_lo_ss(hi_cx, axis) .GT. npts )
+     .			     cx_lo_ss(hi_cx, axis) = npts ! was void pt, alone
+	   cx_by_ss(axis,hi_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( axis, hi_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_act ( lo_isp ) = isact_subspan_fill
+	   aclass = isact_class_subspan_fill
+
+	ELSEIF( aclass .EQ. isact_class_reconcile ) THEN
+* SET UP TO RECONCILE POSSIBLE DIFFERENCES BETWEEN REQUEST AND WHAT IS RECEIVED
+	   is_act ( lo_isp ) = isact_reconcile
+	   aclass = isact_class_reconcile
+	   axis = 1	! kludge: prevents crash calling ITSA_MODULO_REGRID
+!			! below because FORTRAN isn't smart like C about .AND.
+	ELSEIF( aclass .EQ. isact_class_reverse ) THEN    ! 2/95 addition
+* The data to be read are reversed on disk -- possibly along multiple axes
+* Set up here to read the data raw (reversed) under category cat_file_rev
+* in its reversed ordering.  Remember that it may only be a hyperslab of
+* the full data on disk so use ds_grid_start/end instead of 1 to N.
+* The data values will eventually be reversed in IS_REVERSE
+	   cx_category(hi_cx) = cat_file_rev
+	   nrev = TM_AXES_REVERSED(var,reversed) 
+	   DO 250 i = 1, nrev
+	      axis = reversed(i)
+	      CALL VAR_SS_LIMS( axis, lo_cx, lo_ss, hi_ss )
+	      xlate = cx_lo_ss(hi_cx, axis)
+
+!             for a strided axis
+              line = grid_line(axis,grid)
+              IF(line_parent(line) .NE. 0) THEN 
+                  hi_ss = line_dim(grid_line(axis,grid))
+                  lo_ss = 1
+              ENDIF
+
+	      cx_lo_ss(hi_cx, axis) = hi_ss + lo_ss - cx_hi_ss(hi_cx,axis) 
+	      cx_hi_ss(hi_cx, axis) = hi_ss + lo_ss - xlate
+
+* ... don't rebuild the axis: the world coords are for unreversed axis
+	      cx_by_ss(axis,hi_cx) = .TRUE.
+ 250	   CONTINUE	         
+* ... prepare to read the raw,reversed data
+	   is_act ( lo_isp ) = isact_reverse
+	   aclass = isact_class_reverse
+
+	ELSE
+	   WRITE (6,*) 'unsupported act class',aclass
+	ENDIF
+
+* GATHER CHECK !!!
+* if the grid we are about to request (hi_cx) is going to exceed reasonable
+* size limits then try to split the calculation into fragments.
+* For example, TEMP[I=1:100 at DIN,J=1:100 at AVE,K=1:25 at AVE,L=1:100 at AVE]
+* the required data is 100x100x25x100 - TOO BIG !!
+* after the L and K transforms have been split off we will have
+* TEMP[I=1:100 at DIN,J=1:100 at AVE,K=1:25,L=1:100] which is a reasonable 2500 pts.
+* after the next strip, however, the request will be 100 times larger.  At this
+* time we would be better to split up the context, say, along the L axis so
+* that each requested component is a manageable size.
+* 11/95: similarly, modulo regrids may involve source data greatly in excess
+* of the result
+ 300	IF ( aclass.EQ.isact_class_trans
+     .		.AND. trans.GT.trans_compress_code
+     . .OR.  aclass.EQ.isact_class_regrid
+     .		.AND. ITSA_MODULO_REGRID(lo_cx, axis)		) THEN
+	   IF ( aclass.EQ.isact_class_trans ) THEN 
+	      cxsize = CGRID_SIZE( hi_cx )	! well tested of old (11/95)
+	   ELSE
+	      cxsize = CGRID_SIZE_MAX( hi_cx )	! unknown lims get len=line_dim
+	   ENDIF
+
+* do we have a size problem ?
+	   IF ( cxsize .LE. mode_arg( pmode_desperate,1 ) ) GOTO 800
+* yes, too big ! can we split the calculation along some axis ?
+*  ( try to split along a slow access axis of the data )
+	   DO 500 i = nferdims, 1, -1
+	      IF ( dset.GT.pdset_irrelevant .AND. dset.LE.maxdsets ) THEN
+	         split_ax = ds_ax_speed(i, dset)
+	      ELSE
+	         split_ax = i
+	      ENDIF
+	      IF ( cx_trans(split_ax,lo_cx) .NE. trans_no_transform ) GOTO 500
+	      IF ( ITSA_MODULO_REGRID(lo_cx,split_ax) ) GOTO 500
+* ... beware user-defined vars with limits specified in definition
+	      IF ( itsa_uvar ) THEN
+	         IF ( uvar_given(split_ax,var) .NE. uvlim_needed ) GOTO 500
+	      ENDIF
+	      split_ax_len = CX_DIM_LEN(split_ax,lo_cx)
+	      IF ( split_ax_len .EQ. 1 ) GOTO 500
+* ... in desparation, only, consider splitting along the fastest access axis
+	      IF ( i.EQ.1 .AND. .NOT.mode_desperate )  GOTO 500
+	      GOTO 510
+ 500	   CONTINUE	   
+* no way to split up the calculation
+	   GOTO 800
+* OK - lets divvie this baby up !
+ 510	   aclass = isact_class_gather
+	   is_act(lo_isp) = isact_gather
+	   axis = split_ax
+* save the default context so it can be re-used at each chunk
+	   CALL CREATE_NEW_CONTEXT( lo_cx, big_cx, status )	! pushes stack
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   is_big_cx( lo_isp ) = big_cx
+* cancel result pointer to indicate no result yet
+	   is_mr( lo_isp ) = unspecified_int4
+* determine the largest fragment satisfying the "desperate mode" argument
+* for compressing transforms consider here ALL of the axes that may expand 
+	   IF ( aclass.EQ.isact_class_trans ) cxsize = POTENT_SIZE(lo_cx)
+	   ax_frac = FLOAT(mode_arg(pmode_desperate,1)) / cxsize
+	   frag = MAX( 1, INT(split_ax_len*ax_frac) )
+	   is_sum( lo_isp ) = frag
+* set up context to get the first fragment
+	   CALL TRANSFER_CONTEXT( big_cx, hi_cx )
+	   cx_hi_ss(hi_cx,axis) = cx_lo_ss(hi_cx,axis) + frag - 1
+	   cx_by_ss(axis,hi_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( axis, hi_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* diagnostic mode output: "strip --> VAR_NAME[x=lo:hi at TRN:n,D=#]"
+ 800	IF ( mode_diagnostic ) 	CALL DIAG_OP('strip', aclass, lo_cx, axis)
+
+* push stack to go after the requested component
+	is_axis ( lo_isp ) = axis
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_cx( isp ) = hi_cx
+	IF (  is_act (lo_isp) .EQ. isact_auxvar_regrid
+     .	.AND. cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... setup to evaluate auxiliary var that is user-defined (uvar)
+	   is_uvar( isp ) = cx_variable( hi_cx )
+	ENDIF
+
+* successful completion
+ 1000	RETURN 1
+
+* error exit
+ 5000	RETURN
+
+* possible "kludge" jump point to switch from regridding to modulo
+* Note that this kludge is not actually used because adequate testing is
+* now (1/9/96) done in INTERP_STACK -- still retain this documentation here
+* to explain the subtleties:
+* This is needed to cover a subtlety that arises when pseudo-variables are
+* combined with modulo operations. For the expression "A=TEMP-TEMP+I" we would
+* like "I" to run from 1 to infinity -- not to modulo wrap at Nx
+* (see uvar_mod_pseudo in INTERP_STACK). For this reason modulo operations are
+* deferred on LET variables that contain pseudo-variables -- the modulo op
+* is performed separately on each of the components in the LET variable
+* definition allowing "I" to be evaluated on the full requested range.
+* The present "kludge" is to cope with LIST/I=1:BIG A[GI=@MOD]. What the user
+* presumably wants is to apply the I=1:BIG to the result of the GI=@MOD. So
+* in this case we will NOT defer the modulo -- we will set up the stack to do
+* the modulo right now.
+ 6000   aclass = isact_class_modulo
+	CALL WARN('Internal: unexpected modulo jump!')
+	modulo_dest_regrid = .TRUE.
+	GOTO 100
+
+	END
+
diff --git a/fer/stk/is_subspan_fill.F b/fer/stk/is_subspan_fill.F
new file mode 100644
index 0000000..7d36a56
--- /dev/null
+++ b/fer/stk/is_subspan_fill.F
@@ -0,0 +1,148 @@
+	SUBROUTINE IS_SUBSPAN_FILL( memory, *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* fill in the phantom "void" point that fills the gap between the length N
+* of a native subspan modulo axis, and the virtual length N+1
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V541: *sh* 2/02
+* V56: *acm* 4/04  If data was read using strides, then the axis having
+*                  a delta is ok.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal return is for error conditions
+* exit #1 is to request another grid ( stack has been pushed )
+* exit #2 is to signal completion of the activity at this stack level
+
+*   ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level of last activity ( component just computed )
+*	 isp	<--	current stack level (for moduloing )
+
+* internal variable declarations:
+	INTEGER CAXIS_MODLEN, MGRID_SIZE_DELTA,
+     .		com_mr, res_mr, com_cx, res_cx,	com_isp, res_isp,
+     .		npts, idim
+	LOGICAL	TM_ITS_CDF, done_by_strides
+        CHARACTER dtype*4
+
+* --- end of introductory code ---
+
+* initialize
+	res_isp    = isp
+	com_isp    = isp + 1
+	res_mr     = is_mr( res_isp )
+	com_mr     = is_mr( com_isp )
+	res_cx     = is_cx( res_isp )
+	com_cx     = is_cx( com_isp )
+	idim       = is_axis( res_isp )
+	npts	   = CAXIS_MODLEN( idim, com_cx )
+
+* Check if a stride was specified on the axis.
+* This is ok if data was read with strides
+
+        done_by_strides = cx_category(res_cx) .EQ. cat_file_var 
+     .    .AND. TM_ITS_CDF(cx_data_set(res_cx), dtype )
+     .	  .AND. cx_delta(idim,res_cx) .NE. unspecified_val8
+
+	IF (.NOT. done_by_strides .AND. 
+     .      cx_delta(idim,res_cx) .NE. unspecified_val8) THEN
+	  CALL ERRMSG( ferr_internal, status,
+     .		      'IS_SUBSPAN_FILL: delta found on axis', *5900) 
+	ENDIF
+
+* diagnostic mode output: " doing subspan void VAR_NAME[x=lo:hi,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .		( 'doing', isact_class_subspan_fill, com_cx, idim )
+
+
+* initialize the result
+* 11/95 complete the result context in case it has some unspecified limits
+* (note: this never occurs on file variables because INTERP_STACK completes
+*	 the context to make memory caching more efficient)
+	CALL RECONCILE_COM_DST_CX( com_cx, res_cx, idim )
+
+* create context and mem. res. space if this is the first component recieved
+	CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( res_isp ) = res_mr
+
+	IF ( mr_type(res_mr) .EQ. ptype_string ) THEN
+	   CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(res_mr),
+     .                               memory(1, mr_blk1(res_mr)),
+     .                               mr_c_pointer(res_mr)      )
+	   CALL SET_NULL_C_STRING_ARRAY(mr_c_pointer(res_mr),
+     .                                  MGRID_SIZE_DELTA(res_mr) )
+
+	ENDIF
+
+* 11/95: if there might be voids in the result pre-fill with missing data flags
+* to-do: could make this more efficient and fill only the "N+1" virtual point.
+	IF ( mr_type(res_mr) .EQ. ptype_float  ) CALL FILL_MEMORY
+     .				( memory,mr_blk1(res_mr),mr_nblks(res_mr),
+     .                            mr_bad_data(res_mr) )
+
+* Copy the component data into the result (unless the silly user
+*  requested the void point, alone
+	IF ( cx_lo_ss(res_cx, idim) .LT. npts ) CALL COPY_INTO
+     .		       ( memory(1, mr_blk1(com_mr)), com_mr, com_cx,
+     .			 memory(1, mr_blk1(res_mr)) ,res_mr )
+
+* Successful completion of modulo operation
+	CALL MR_NOT_IN_USE( com_mr )	! remove memory protection on component
+!	IF (mr_delta(idim,com_mr).NE.unspecified_val8)
+!     .		 CALL DELETE_VARIABLE( com_mr )  ! invalid since using mr_delta
+	cx_stack_ptr = cx_stack_ptr - 1 ! pop com_cx  from context stack
+	status = ferr_ok
+	RETURN 2
+
+* error exits
+ 5000	RETURN
+ 5900	CALL MR_NOT_IN_USE( com_mr )
+	GOTO 5000
+	END	
diff --git a/fer/stk/is_trans.F b/fer/stk/is_trans.F
new file mode 100644
index 0000000..73c4e74
--- /dev/null
+++ b/fer/stk/is_trans.F
@@ -0,0 +1,402 @@
+	SUBROUTINE IS_TRANS( memory, ROUTINE, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a complete context describing the result of the transformation
+* create a memory resident slot to receive the result and initiate the
+* transformation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/1/89 - (based on IS_PLANE_TRANS)
+*	10/16/89 - set up adjustable array limits with NON_ARRAY_SUBSC
+*	 1/21/90 - pass ss limits from component back to result if unknown
+* Unix/RISC port - 1/91 - need to declare "ROUTINE" external (???)
+* V230:   8/2/92 - add comment re: cx_valid
+*        9/10/92 - bypass error if interpolate is applied to a point
+* V312: 5/94 - array "memory" as a calling argument
+* V420: 11/95 - fix bug in explicit limits: LET A=TEMP[I=1:160]; STAT A[I=@MAX]
+*		... result has one valid and 159 invalid points		 
+* V430: 7/96 - incorporate 4D transformations
+* V440: 8/96 - allocate memory for COS(lat) array before calling ROUTINE
+* V450: 5/97 - fillers different from smoothers when component data is
+*		insufficient for result. Should return original data rather
+*		than an all-bad field.
+* V455:  9/97 - OFFSET_SS returns status
+*	11/13/97 - bug fix: @ITP component WW coords must bracket result
+*	        (11/18/97 - repaired bug introduced 11/13)
+* V491:  1/2/98 - component size can exceed result in case like
+*                       let vx = SIN(X[X=1:60:1])
+*                       list/i=13:18 vx[x=@sbx:3]
+*               As an easy (but not necessarily "correct") fix  we REDUCE
+*		the component size here to fit the result. We need to flag the
+*		result as not cache-retreivable because the uvar_given value
+*		indicates the result size is self-defined (Is this risky??)
+* V500:  1/99 *sh* Trap as errors attempts to apply transform to string
+*		variables
+* V530:  8/00 *sh* changed string trap to be based on data type, not category
+* V533:  7/01 *sh* transform @SHF supported for strings
+* v552   4/03 *acm* up VAR_TRANS to 150 characters (variables are up to 128, plus
+*                   space for the transformation specifier)
+* V600  10/05 *acm* Fis bug 899: rather than the ungraceful STOP, issue an error
+*                   message if a 4-D transform was requested but the dimensions 
+*                   are not available in the grid.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+	include	'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	status
+	REAL	memory( mem_blk_size, max_mem_blks )
+* normal exit is for error conditions
+* exit #1 is to signal completion of the activity at this stack level
+	INTEGER	ROUTINE		! (returns status )
+	EXTERNAL ROUTINE	! added for Unix/RISC/FORTRAN
+
+* internal variable declarations:
+* ... "res"="result" , "com"="component"
+	LOGICAL	ITSA_FILL_TRANS, its_4d, string_bad_good, string_com
+	INTEGER CX_DIM_LEN, MGRID_SIZE_DELTA, DO_4D_STRING_TRANS,
+     .		slen, cx_valid,
+     .		res_isp, com_isp, res_cx, com_cx, com_mr, res_mr, idim,
+     .		trans, grid, lo_off, hi_off, ss_lo, ss_hi, wksiz, wkblk,
+     .		mrlist(2), axes(nferdims), idim1, i, ndim
+	REAL	arg
+	REAL*8	TM_WORLD, ww, ww_lo, ww_hi
+	CHARACTER VAR_TRANS*150, buff*150
+
+* --- end of introductory code ---
+
+* initialize
+	res_isp	= isp
+	com_isp	= res_isp + 1
+	res_cx  = is_cx( res_isp )
+	com_cx  = is_cx( com_isp )
+	com_mr	= is_mr( com_isp )
+	idim1	= is_axis( res_isp )
+	trans	= cx_trans( idim1, res_cx )
+	arg	= cx_trans_arg( idim1, res_cx )
+	grid    = cx_grid( com_cx )
+	string_bad_good = .FALSE.
+	string_com = .FALSE.
+
+* determine if this is a 1D or a 4D (multiple axis) transformation
+	its_4d = .FALSE.
+	DO 110 i = 1, num_4d_trans
+           IF ( trans .EQ. alg_4d_trans(i) ) its_4d = .TRUE.
+ 110	CONTINUE
+
+* determine the axes to be transformed.
+	IF (its_4d) THEN
+	   ndim = 0
+	   DO 120 idim = 1, nferdims
+	     IF ( cx_trans(idim,res_cx) .EQ. trans ) THEN
+	       ndim = ndim + 1
+	       axes(ndim) = idim
+* ... odd nesting of transforms that may happen from implicit interpolation
+	       IF (cx_trans(idim,com_cx).NE.trans_no_transform) GOTO 5200
+	     ENDIF
+ 120	   CONTINUE
+	   IF (ndim.LE.1) GOTO 5400     !!  STOP 'is_trans:ndim = 0'
+	ELSE
+	   ndim = 1
+	   axes(1) = idim1
+* ... odd nesting of transforms that may happen from implicit interpolation
+	   IF ( cx_trans(idim1,com_cx) .NE. trans_no_transform ) GOTO 5200
+	ENDIF
+
+* error check: attempt to transform a single point ?
+* ( note: this won't catch a[k=1:5 at sbx] where a=u[k=5]
+* 	  but using CX_DIM_LEN rules out [Z=10:11 at ave] within a single point)
+	DO 200 i = 1, ndim
+	  idim = axes(i)
+	  IF ( cx_lo_ss(com_cx,idim) .EQ. unspecified_int4 ) THEN
+             IF ( trans .NE. trans_interpolate ) GOTO 5100
+	  ENDIF
+ 200	CONTINUE
+
+* *sh* 10/92 MODE INTERPOLATE has lead to @ITP applied to inappropriate limits
+*  errors were trapped mistakenly here for:
+*       LIST/X=5.5  5.0 
+*  and  LIST/X=5.5/Y=5.5 X  (err on Y axis)
+*  this patch returns the component data as the result
+        IF ( trans .EQ. trans_interpolate ) THEN
+	   IF ( cx_lo_ss(com_cx,idim1) .EQ. unspecified_int4 ) THEN
+              CALL TRANSFER_CONTEXT( com_cx, res_cx )
+              CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+              CALL COPY_GRID(
+     .           memory( 1, mr_blk1(com_mr) ) , com_mr,
+     .           memory( 1, mr_blk1(res_mr) ) , res_mr )
+              is_mr( res_isp ) = res_mr
+              GOTO 1000
+            ENDIF
+         ENDIF
+
+* create a result context based on the received component
+	cx_valid= cx_buff
+	CALL TRANSFER_CONTEXT( com_cx, cx_valid )
+		DO 300 i = 1, ndim
+	   idim = axes(i)
+* ... if the requested region was unknown use the component region
+	   IF ( cx_lo_ss(res_cx,idim).EQ.unspecified_int4
+     .	   .AND.cx_lo_ww(idim,res_cx).EQ.unspecified_val8 ) THEN
+* 11/95 - FLESH_OUT_AXIS cannot be trusted to flesh this out.
+*	  It puts responsibility for redundant limits onto the various interp
+*	  stack routines (I guess ...)
+	      CALL TRANSFER_AXIS( idim, com_cx, res_cx )
+	      cx_trans( idim, res_cx ) = trans
+	      cx_trans_arg( idim, res_cx ) = arg
+	      cx_by_ss(idim,res_cx) = .TRUE.
+	      IF ( trans  .GT. trans_compress_code ) THEN
+	         cx_lo_ss( res_cx, idim ) = unspecified_int4
+	         cx_hi_ss( res_cx, idim ) = unspecified_int4
+	         cx_by_ss( idim, res_cx ) = .FALSE.
+	      ENDIF
+! pre=11/95cx_lo_ss(res_cx,idim) = cx_lo_ss(com_cx,idim)
+!	      cx_hi_ss(res_cx,idim) = cx_hi_ss(com_cx,idim)
+!	      cx_by_ss(idim,res_cx) = .TRUE.
+
+* 11/95 - is interpolation the only case of a compressing transform
+* where the component ww range normally doesn't match the result?
+	   ELSEIF ( trans .EQ. trans_interpolate ) THEN
+* ... component range must **bracket** the result, however (11/97)
+	      ww    = cx_lo_ww(idim,res_cx)
+	      ss_lo = cx_lo_ss(com_cx,idim)
+	      ss_hi = cx_hi_ss(com_cx,idim)
+	      ww_lo = TM_WORLD( ss_lo, grid, idim, box_lo_lim )
+	      ww_hi = TM_WORLD( ss_hi, grid, idim, box_hi_lim )
+* ... allow ww_lo>ww_hi to accomodate time encodings
+	      IF ( (ww-ww_lo)*(ww-ww_hi) .GT. 0.0D0 ) GOTO 5300 
+
+* 11/95 - compressing transform where variable limits are in a nested def'n
+*    e.g.   list b[i=1:5] where b = a[i=@ave] and a = temp[i=1:100]
+* ... use the inner limits (i=1:100) for the transformation
+	   ELSEIF ( trans .GT. trans_compress_code
+     .      .AND. (cx_lo_ww(idim,res_cx).NE.cx_lo_ww(idim,com_cx)
+     .	    .OR.cx_hi_ww(idim,res_cx).NE.cx_hi_ww(idim,com_cx))   ) THEN
+	      CALL TRANSFER_AXIS( idim, com_cx, res_cx )
+	      cx_trans( idim, res_cx ) = trans
+	      cx_lo_ss( res_cx, idim ) = unspecified_int4
+	      cx_hi_ss( res_cx, idim ) = unspecified_int4
+	      cx_by_ss( idim, res_cx ) = .FALSE.
+	   ENDIF
+
+	   CALL TRANSFER_AXIS( idim, res_cx, cx_valid )
+	   CALL FLESH_OUT_AXIS( idim, cx_valid, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+ 300	CONTINUE
+
+* the context is ready - carve out memory space for it
+	CALL TRANSFER_CONTEXT( cx_valid, res_cx )
+	
+	IF ( cx_type(com_cx) .EQ. ptype_string ) THEN
+	   string_com = .TRUE.
+	   IF (trans .EQ. trans_good_pt    .OR.
+     .         trans .EQ. trans_bad_pt     .OR.
+     .         trans .EQ. trans_4d_good_pt .OR.
+     .         trans .EQ. trans_4d_bad_pt ) THEN
+              string_bad_good = .TRUE.
+              cx_type(res_cx) = ptype_float
+           ENDIF
+        ENDIF
+
+	CALL CREATE_MEM_VAR( res_cx, res_mr, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	is_mr( res_isp ) = res_mr
+	IF ( mr_type(res_mr) .EQ. ptype_string .AND.
+     .       (.NOT.string_bad_good)) THEN
+* ... only applicable to @SHF transformation; else will return a null string.
+           CALL INIT_C_STRING_ARRAY( MGRID_SIZE_DELTA(res_mr),
+     .                               memory(1, mr_blk1(res_mr)),
+     .                               mr_c_pointer(res_mr)      )
+	ENDIF
+
+!* diagnostic message ?
+!	IF (mode_diagnostic) CALL DIAGNOSTIC_OUT(
+!     .		'@'//ALG_TRANS_CODE(trans)//'   ', res_mr, point_to_mr )
+
+* component size may be inadequate for requested result
+* pre-fill result with missing data flag if component is inadequate
+* (7/96 - note that 4D transforms are always compressing transforms)
+	IF ( trans .LT. trans_compress_code ) THEN
+	   idim = idim1				! should be equal already
+	   IF ( ITSA_FILL_TRANS(trans) ) THEN	! 5/97 - filler are difrnt
+	      lo_off = 0
+	      hi_off = 0
+* 5/97: for fillers the DO_ routines handle result regions beyond the
+*	bounds of the component data 
+	   ELSE
+	      CALL OFFSET_SS( idim, res_cx, lo_off, hi_off, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+* ... computable limits from component
+* Note (8/92): when the requested limites are unknown the com_cx will be
+*              full-width along idim so subtracting the offset limits leaves
+*              cx_valid as beyond the possible range but no known crash results
+	   cx_lo_ss( cx_valid, idim ) = cx_lo_ss( com_cx, idim ) - lo_off
+	   cx_hi_ss( cx_valid, idim ) = cx_hi_ss( com_cx, idim ) - hi_off
+	   IF ( cx_lo_ss(cx_valid,idim) .GT. cx_hi_ss(cx_valid,idim) ) THEN
+* ... insufficient component data to compute anything
+	      IF ( mr_type(res_mr) .EQ. ptype_string ) THEN
+	        CALL SET_NULL_C_STRING_ARRAY(mr_c_pointer(res_mr),
+     .                                       MGRID_SIZE_DELTA(res_mr) )
+	      ELSE
+	        CALL FILL_MEMORY( memory,mr_blk1(res_mr),mr_nblks(res_mr),
+     .		  		  mr_bad_data(res_mr) )
+	      ENDIF
+	      GOTO 1000
+	   ELSEIF (  cx_lo_ss(res_cx,idim) .LT. cx_lo_ss(cx_valid,idim)
+     .		.OR. cx_hi_ss(res_cx,idim) .GT. cx_hi_ss(cx_valid,idim) ) THEN
+* ... insufficient component data to compute the entire requested region
+	      CALL BAD_EDGES( cx_valid, memory(1,mr_blk1(res_mr)), res_mr )
+	   ELSEIF (  cx_lo_ss(res_cx,idim) .GT. cx_lo_ss(cx_valid,idim)
+     .		.OR. cx_hi_ss(res_cx,idim) .LT. cx_hi_ss(cx_valid,idim) ) THEN
+* ... *1/98* component data is BIGGER than expected for requested result
+* ... reduce the apparent size of the component data (dangerous??)
+* e.g.                      let vx = SIN(X[X=1:60:1])
+*                           list/i=13:18 vx[x=@sbx:3]
+*     Note that this situation occurs when the component variable being xformed
+*	thinks that it has self-describing limits (uvar_given<uvlim_gvn_xact).
+*       Since the transformed version of the variable (the result) is getting
+*	its limits from elsewhere uncache the result so it won't be recalled.
+*	==> THIS IS A KLUDGE: The right solution is that the limits i=13:18
+*	should never get applied to vx ... but this is too difficult to
+*	implement in GET_VAR_CONTEXT and PARSE_VAR_NAME
+	      CALL UN_CACHE( res_mr )
+* ... fillers and smoothers are equivalent here ... so recompute offsets
+	      CALL OFFSET_SS( idim, res_cx, lo_off, hi_off, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF ( cx_lo_ss(res_cx,idim) .GT. cx_lo_ss(cx_valid,idim) )
+     .			cx_lo_ss(com_cx,idim) = cx_lo_ss(res_cx,idim) + lo_off
+	      IF ( cx_hi_ss(res_cx,idim) .LT. cx_hi_ss(cx_valid,idim) )
+     .			cx_hi_ss(com_cx,idim) = cx_hi_ss(res_cx,idim) + hi_off
+	      cx_by_ss(idim,res_cx) = .TRUE.
+	      CALL FLESH_OUT_AXIS( idim, com_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	ENDIF
+
+* set up 4D array limits as unsubscripted variables in COMMON
+	mrlist(1) = com_mr
+	mrlist(2) = res_mr
+	CALL NON_ARRAY_SUBSC( mrlist, 2 )
+
+* transformations applied to string arguments
+	IF ( string_com ) THEN
+	   IF (trans .EQ. trans_shift) THEN
+	      CALL DO_STRING_SHIFT ( idim, arg,
+     .		memory( 1, mr_blk1(com_mr) ), com_mr, com_cx, ! component
+     .		memory( 1, mr_blk1(res_mr) ), res_mr, res_cx) ! result
+	   ELSEIF (string_bad_good) THEN
+	   
+	      IF (its_4d) THEN
+	         status = DO_4D_STRING_TRANS( trans,
+     .		 memory( 1, mr_blk1(com_mr) ), com_mr, com_cx, ! component
+     .		 memory( 1, mr_blk1(res_mr) ), res_mr, res_cx) ! result
+	         IF ( status .NE. ferr_ok ) GOTO 5000
+              ELSE
+ 	         CALL DO_STRING_GOODBAD ( idim, trans,
+     .		 memory( 1, mr_blk1(com_mr) ), com_mr, com_cx, ! component
+     .		 memory( 1, mr_blk1(res_mr) ), res_mr, res_cx) ! result                            ! result
+	      ENDIF
+	   ELSE
+	     CALL SET_NULL_C_STRING_ARRAY(mr_c_pointer(res_mr),
+     .                                    MGRID_SIZE_DELTA(res_mr) )
+	   ENDIF
+	   GOTO 1000
+	ENDIF
+
+* reserve working space for the transformation
+* Note: this logic is a loose hodge-podge to get an upper bound size for all
+* the different cases: 4D, 1D, with arguments, etc.
+	wksiz = 1
+	DO 500 i = 1, ndim
+	   idim = axes(i)
+	   wksiz = wksiz + CX_DIM_LEN(idim,com_cx)
+ 500	CONTINUE
+* ... allow room for COS(lat) array during 4D transforms (8/96)
+	IF (ndim .GT. 1 )  wksiz = wksiz + CX_DIM_LEN(y_dim,com_cx)
+* ... set minimum work size
+	wksiz = MAX( iswksiz, wksiz )
+* ... for transforms like smoothers allow extra slop on each end 
+	IF ( arg .NE. bad_val4 )  wksiz =
+     .			MAX( wksiz, CX_DIM_LEN(idim1,res_cx)+INT(arg) )
+	CALL GET_WORK_SPC( wksiz, wkblk, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* do the transform
+
+	status = ROUTINE( idim, arg,
+     .		memory( 1, mr_blk1(com_mr) ), com_mr, com_cx, ! component
+     .		memory( 1, mr_blk1(res_mr) ), res_mr, res_cx, ! result
+     .		memory( 1, wkblk )			    ) ! work space
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* remove component protections that signaled this calculation needed it
+ 1000	CALL MR_NOT_IN_USE( com_mr )	
+
+* free the context stack space
+	cx_stack_ptr = cx_stack_ptr - 1
+
+* success
+	RETURN 1
+
+* error exit
+ 5000	RETURN
+ 5100	buff = VAR_TRANS( idim, res_cx, slen )
+	CALL ERRMSG( ferr_trans_nest, status,
+     .		     buff(:slen)//' applied to point', *5000 )
+ 5200	buff = VAR_TRANS( idim, com_cx, slen )
+	CALL ERRMSG( ferr_trans_nest, status, 'interpolation on '//
+     .		     buff(:slen)//'--> DEFINE a new variable', *5000 )
+ 5300	buff = VAR_TRANS( idim, res_cx, slen )
+	CALL ERRMSG( ferr_limits, status,
+     .		     buff(:slen)//' exceeds interpolation range',
+     .		     *5000 )
+ 5400	CALL ERRMSG( ferr_trans_nest, status,
+     .		     ' not all dimensions present on grid',
+     .		     *5000 )
+
+	END	
diff --git a/fer/stk/is_uvar_grid.F b/fer/stk/is_uvar_grid.F
new file mode 100644
index 0000000..d431c12
--- /dev/null
+++ b/fer/stk/is_uvar_grid.F
@@ -0,0 +1,805 @@
+	SUBROUTINE IS_UVAR_GRID( *, *, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* examine an algebraic evpression component by component on the 
+* interpretation stack in order to determine a defining grid for the overall
+* expression.
+* Detailed description of the underlying logic is in MERGE_CONTEXT
+* Note: When pseudo-variables are used (eg. LIST U/Z[K=1:3]) the grids for them
+*	may not be known until all other components are examined.  In this
+*	case a 2nd pass is required
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V200:  6/20/89
+* V230:  7/21/92 - separate error message for cvar grid unknown
+* V411  8/28/95 - variables defined with LET/D= need uvar_need_dset=TRUE
+* V420   9-11/95 - dynamic axes and grids
+*	 12/95	- set uvar_mod_pseudo if there is a pseudo-var dependency
+* V450:  1/97 - process alg_child_var
+*	      - and process grid-changing variables
+*        7/97 - generate child var name using GCF_PARENT_UVAR
+* V500: *sh* 12/98 - support for cat_const_var -- fixed arrays like "{1,3,5}"
+*       *sh*  2/99 - if ABSTRACT grid or normal axis then use XABSTRACT (or
+*                       YABSTRACT, ZABSTRACT, TABSTRACT)
+*		     A significant consequence of this is that 2 passes are
+*		     needed ANY TIME that pseudo-variables which do not state
+*		     their own axes are used, becuase they may be generating
+*		     abstract axes. For example, the grid of "SST+Z"
+* v500: *kob* 3/99 - fixed which crashed ferret when  let/d didn't have a 
+*                    dataset present
+*	*sh* 3/99 - bug fix: bug introduced with string arguments 
+*	*sh* 4/99 - bug fix: 2/99 2nd pass check "need_another_pass" state
+*		is lost is a component is fetched afterwards. Instead, save
+*		this state as a negative is_phase
+*       *kob* 4/99 - bug fix: using /d in the definition of a dataset
+*                    independent variable caused a crash.
+* V510: 8/99 *sh* - allow G=uvar on both uvars and pseudo-vars.
+*			If uvar grid is unknown, go get it!
+*	1/00 *sh* - bug fix for nested GC variables 
+*	4/00 *sh* - netCDF grids are now dynamic so 2nd pass check to deallo
+*			dynamic grid needs logic change
+* V530 10/00 *sh* - fixed bug that was revealed by new ability of
+*		    GCF_IMPOSE_AXES to take an error exit
+*	          - process string variables so that they may be obtained
+*		    by EFs during custom axis creation
+* V533 7/01 *sh* - save the data type of the result
+*	         - process alg_if_marker in support of IF cond THEN string
+* V540 10/01 *sh* - fix bug in IF-THEN hack when 2nd pass is required
+* V541  4/02 *sh* - fix bug in IF-THEN: err540_data_type.jnl
+*                   constants were not processed, so PLOT IF X GT 5 THEN 1
+*                   failed to pick up the data type of the constant 1
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+*                   (variables are up to 128, so **name** needs extra space
+*                   i.e. for a transformation specifier)
+* v552: 5/03 *acm*  Use just the current item when dealing w/ G=uvar with 
+*                   target grid not yet known (intermediate variable buff)
+* v554: 1/04 *acm* Counter variables for REPEAT/RANGE=/NAME=
+* V600 8/05 *acm* - Add variable type attrib_val for definitions of the form
+*                   varname.attname
+* V603 5/07 *acm* - Fix bug 1507: if start = end, then definition of name 
+*                   leaves name blank. assign a longer string to name and 
+*                   then just send the first character to GET_VAR_CONTEXT
+* V611 5/08 *acm*   Fix bug 1578; dataset specifiers applied correctly 
+*                   var[d=1].attname
+* V615 11/08*acm*    Fix bug 1421: if variable in expr is undefined call 
+*                   DEALLO_UNFORMED_GRID to correctly back out of the 
+*                   dynamic grid that was partially defined.
+* V615 11/08*acm* - fixing bug 1523. If the variable contains a grid-changing 
+*                   function, mark it as such for repl_exprns to get the 
+*                   correct size.
+* V615 11/08*acm*   For linux, pass dummy status flag to DEALLO_UNFORMED_GRID. 
+*                   The status flag that is passed back must remain set to 
+*                   non-ferr_ok to exit properly from the command.
+*       *acm* 3/12  Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V690 9/13-2/14 *sh*   support for auxiliary var regridding: temp[gz(depth)=zax]
+
+* calling argument declarations:
+	INTEGER	status
+* normal return is for error conditions
+* exit #1 is to request grid for a component ( stack has been pushed )
+* exit #2 is to signal that the grid has been obtained and stored in uvar_grid
+
+* internal variable declarations:
+	LOGICAL	ITSA_GCVAR, its_dynamic, its_gc, need_another_pass,
+     .		saved_ifthen_type, do_err, agg_has_uvar, ok_remote,
+     .		getting_aux_var
+	INTEGER KNOWN_GRID, STR_SAME,
+     .		TM_LENSTR1, GCF_PARENT_UVAR, GCF_PARENT_CHAR, 
+     .		NCF_GET_AGG_COUNT, iaux,
+     .		hi_cx, lo_cx, big_cx, aux_cx, start, end, grid,
+     .		i, dset, uvar, item, itype, idim, gnum, nitem, uv_grd,
+     .		var, len_name, pass_number, cx_save, this_dset,
+     .		ifthen_data_type, varid, alen, attype, attlen,
+     .          attoutflag, attid, bracket, dot, dsloc, endbracket,
+     .          status_deallo, agg_grid, agg_line, agg_len, agg_dset,
+     .		imemb, fer_uvar, memb_dset, memb_grid, iline, nv
+
+	CHARACTER VAR_CODE*4, name*512, buff*2048, varname*512, 
+     .            attname*128, aname*128, newname*512
+
+#include "netcdf.inc"
+	include	'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xfr_grid.cmn'
+	include	'xdset_parms.cmn'
+
+*        ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level to get grids for components
+*	 isp	<--	current level: evaluate user-variable grid
+
+* --- end of introductory code ---
+
+* initialize
+	lo_cx  = is_cx( isp )
+	big_cx = is_big_cx( isp )
+	grid   = cx_grid(big_cx)
+	uvar   = is_uvar( isp )
+	dset   = cx_data_set( lo_cx )
+	nitem  = uvar_num_items( uvar )
+	its_gc = ITSA_GCVAR(uvar)
+	its_gc = ITSA_GCVAR(uvar)
+	has_uvar_gc = has_uvar_gc .OR. its_gc  ! for repl_exprns fixing bug 1523
+* ... initialization to support 2/99 pass-2 changes
+	pass_number = 1
+! 4/99
+	need_another_pass = is_phase(isp) .LT. 0  ! saved from last time here
+	is_phase(isp) = ABS( is_phase(isp) )
+	cx_save = cx_stack_ptr		! restored on pass #2 (2/99)
+	saved_ifthen_type = .FALSE.
+	getting_aux_var = .FALSE.
+
+* process the next item in the expression from the uvar buffer (last to first)
+ 100	is_phase(isp) = is_phase(isp) + 1
+	item = nitem - is_phase(isp)	+ 1	! point into uvar_text
+	IF ( item .LT. 1 ) GOTO 1000		! have processed entire def'n
+	itype = uvar_item_type ( item, uvar )
+	start = uvar_item_start( item, uvar )
+	end   = uvar_item_end  ( item, uvar )
+	IF     ( itype .EQ. alg_pseudo_var  ) THEN
+	   GOTO 200
+	ELSEIF ( itype .EQ. alg_const_var   ) THEN
+	   GOTO 250
+	ELSEIF ( itype .EQ. alg_child_var   ) THEN
+	   GOTO 300
+	ELSEIF ( itype .EQ. alg_variable    ) THEN
+	   GOTO 305
+	ELSEIF ( itype .EQ. alg_attrib_val  ) THEN
+	   GOTO 359
+	ELSEIF ( itype .EQ. alg_string      ) THEN
+	   GOTO 400
+	ELSEIF ( itype .EQ. alg_constant    ) THEN
+	   GOTO 410
+	ELSEIF ( itype .EQ. alg_counter_var   ) THEN
+	   GOTO 420
+	ELSEIF ( itype .EQ. alg_then_marker ) THEN  ! marks where the IF was
+	   GOTO 450
+	ELSE
+	   GOTO 100
+	ENDIF
+
+* pseudo-variable: merge into grid if it has explicit grid info
+ 200	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+	CALL PSEUDO_VAR_CONTEXT( uvar_text(uvar)(start:end),
+     .				 lo_cx,
+     .				 hi_cx,
+     .				 idim,
+     .				 status )
+	IF ( status .NE. ferr_ok ) RETURN
+* 12/95: flag any axes of this uvar that depend on the pseudo-variable
+* (note XBOX probably doesn't need this but, hey, what the heck)
+	uvar_mod_pseudo(idim,uvar) = .TRUE.
+* did we get a grid for the pseudo-variable ?
+	IF ( cx_grid(hi_cx) .LT. unspecified_int4 ) THEN
+	   GOTO 800
+	ELSEIF ( cx_grid(hi_cx) .NE. unspecified_int4 ) THEN
+	   GOTO 500		! yup - merge it
+	ELSE
+* nope! Set flag indicating a 2nd pass is needed
+	   uvar_given( idim, uvar ) = uvlim_unknown  ! ?? irrelevant from 2/99
+	   need_another_pass = .TRUE.
+	   cx_stack_ptr = cx_stack_ptr - 1
+	ENDIF
+	GOTO 100
+
+* constant-array-variable (of type alg_const_var):
+ 250	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+        CALL CONST_VAR_CONTEXT ( uvar_text(uvar)(start:end),
+     .                           uvar,
+     .                           item,
+     .                           lo_cx,
+     .                           hi_cx,
+     .                           status )
+	IF ( status .NE. ferr_ok ) RETURN
+	GOTO 500		! go merge it
+
+* child variable: treat it just like a regular variable except that 
+* its name is not found in the text. Instead generate its name from
+* its position and its parent variable
+* see IS_ALGEBRA for example
+ 300	CALL GCF_CHILD_VAR_NAME( GCF_PARENT_UVAR(uvar),
+     .				 GCF_PARENT_CHAR(uvar,start), name )
+	len_name = TM_LENSTR1(name)
+	GOTO 310
+
+* variable: parse name, get full expression context
+ 305	name = uvar_text(uvar)(start:end)
+	len_name = end-start+1
+ 310	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	hi_cx = cx_stack_ptr
+	CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+	IF ( status .NE. ferr_ok ) THEN
+	   status_deallo = status
+	   CALL DEALLO_UNFORMED_GRID (status_deallo)
+	   GOTO 5000
+	ENDIF
+***
+* A digression from the usual grid-getting:
+* When regridding using auxiliary variable(s) has been requested, we have to
+* ensure that the grids of the aux variables are known as a part of the get-grid phase.
+* (Note that aux var grids do not get merged into the parent grid)
+	IF  ( cx_unstand_grid(hi_cx)
+     .	.AND. cx_naux(hi_cx) .GT. 0 ) THEN
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   aux_cx = cx_stack_ptr
+	   DO 330 iaux = 1, cx_naux(hi_cx)
+	      CALL GET_AUX_VAR_CONTEXT( hi_cx, aux_cx, iaux, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF ( cx_grid( aux_cx ) .EQ. unspecified_int4 ) THEN
+	         CALL TRANSFER_CONTEXT(aux_cx, hi_cx)
+	         cx_stack_ptr = cx_stack_ptr - 1
+	         GOTO 900   ! go get this aux var grid
+	      ENDIF
+ 330	   CONTINUE
+*  ... return now to normal grid determination for the variable being regridded
+	   cx_stack_ptr = cx_stack_ptr - 1
+	ENDIF
+***
+
+* handle variable regridded to a uvar which has unknown grid (8/99) 
+	IF ( cx_unstand_grid(hi_cx)
+     . .AND. cx_grid(hi_cx) .LT. unspecified_int4 ) GOTO 800
+* do we know the defining grid for the component ?
+* (not necessarily the same as the returned grid --> there may be a regrid )
+	IF ( cx_category(hi_cx) .EQ. cat_user_var ) THEN
+* ... 12/95: inherit the pseudo-variable flag from any component that has it
+	   var = cx_variable(hi_cx)
+	   DO 350 idim = 1, nferdims
+	      IF (uvar_mod_pseudo(idim,var))
+     .			uvar_mod_pseudo(idim,uvar) = .TRUE.
+ 350	   CONTINUE
+	   uv_grd = KNOWN_GRID( cx_data_set(hi_cx), cat_user_var, var )
+	   IF ( uv_grd .EQ. unspecified_int4 ) THEN
+	      GOTO 900	! uvar grid not known --> get it
+	   ELSE
+	      GOTO 500	! uvar grid known --> merge it
+	   ENDIF
+
+C What other cx info do we have here? Is the dataset the agg_dataset? Should be able to get the
+C lo and hi of the ensemble axis if so, and get all the grids.
+	ELSEIF ( cx_category(hi_cx).EQ. cat_aggregate_var  ) THEN
+
+	   agg_dset = dset
+	   status = NCF_GET_AGG_COUNT (agg_dset, agg_len)
+
+	   var = cx_variable(hi_cx)
+	   uv_grd = KNOWN_GRID( agg_dset, cat_aggregate_var, var )
+	   IF ( uv_grd .NE. unspecified_int4 ) THEN
+	      uvar_dset(uvar) = 0  ! now its a datset variable not user var
+	      GOTO 500	! uvar grid known --> merge it
+	   ENDIF
+
+	   DO 355 imemb = 1, agg_len
+	      CALL CD_GET_AGG_VAR_INFO (agg_dset, name, imemb, 
+     .            fer_uvar, memb_dset, memb_grid, iline, nv, status)
+	      IF (fer_uvar .EQ. cat_user_var) agg_has_uvar = .TRUE.
+ 355	   CONTINUE
+
+	   IF (agg_has_uvar) GOTO 990
+
+	   IF ( cx_grid(hi_cx) .NE. unspecified_int4 ) THEN
+	      GOTO 500	! know grid --> merge it
+	   ELSE
+	      GOTO 9000	! err: grid for non-user agg vars should always be known
+	   ENDIF
+
+	ELSEIF ( cx_grid(hi_cx) .NE. unspecified_int4 ) THEN
+	   GOTO 500	! know grid --> merge it
+	ELSEIF ( cx_category(hi_cx) .EQ. cat_calc_var ) THEN
+	   GOTO 9100	! err: grid for cvar may not be knowable
+	ELSE
+	   GOTO 9000	! err: grid for non-user vars should always be known
+	ENDIF
+
+* variable.attname: parse name, get needed parts of context for attribute
+
+ 359	name = uvar_text(uvar)(start:end)
+	len_name = end-start+1
+
+! If there is a region spec on the variable, ignore it. If the region spec
+! is after the attribute name, we will apply it to the attribute.
+! e.g. var[d=1,x=180:300].units, just return the units; x=180:300 is irrelevent
+!      var.special_params[i=1:3] want to return items 1 thru 3 of the attribute
+
+        bracket = INDEX(name, '[')
+        IF (bracket .GT. 0) THEN
+           dot = INDEX(name, '.')
+           IF (dot .GT. bracket) THEN
+              dsloc = MAX(INDEX(name, 'd='), INDEX(name, 'D=') )
+              IF (dsloc .GT. 0) THEN 
+                 DO 360 i = dsloc+1, len_name
+                    IF (name(i:i) .EQ. ',') GOTO 370
+                    IF (name(i:i) .EQ. ']') GOTO 370
+ 360             CONTINUE
+ 370             CONTINUE
+                 endbracket = INDEX(name, ']')
+                 newname = name(1:bracket)//'d='//name(dsloc+2:i-1)//']'//name(endbracket+1:len_name)
+                 len_name = TM_LENSTR1(newname)
+                 name = newname
+              ELSE
+                 endbracket = INDEX(name, ']')
+                 newname = name(1:bracket-1)//name(endbracket+1:len_name)
+                 len_name = TM_LENSTR1(newname)
+                 name = newname
+              ENDIF
+           ENDIF
+        ENDIF
+
+ 	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	hi_cx = cx_stack_ptr
+	CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+        dset = cx_data_set(hi_cx)
+        IF (dset .EQ. pdset_irrelevant) dset = -1
+        do_err = .TRUE.
+        varname = ' '
+        attname = ' '
+        CALL  BREAK_VARATTNAME (  name(:len_name), dset, varname, 
+     .                            attname, varid, do_err, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+        uvar_text(uvar) = name
+	uvar_item_start( item, uvar ) = 1
+	uvar_item_end  ( item, uvar ) = len_name
+
+* Get attribute type and length
+        
+* See if it is a pseudo-attribute attnames, ndims, etc.
+
+        attype = NCFLOAT
+
+        IF (STR_SAME(attname, 'attnames') .EQ. 0  .OR. 
+     .       STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+           attype = NCCHAR
+        ELSE IF (STR_SAME(attname, 'ndims') .EQ. 0  .OR.
+     .      STR_SAME(attname, 'type') .EQ. 0  .OR.
+     .      STR_SAME(attname, 'nvars') .EQ. 0  .OR.
+     .      STR_SAME(attname, 'nattrs') .EQ. 0 ) THEN
+           attype = NCFLOAT
+
+        ELSE IF (STR_SAME (varname, '.') .EQ. 0) THEN
+           IF (STR_SAME(attname, 'varnames') .EQ. 0   .OR.
+     .         STR_SAME(attname, 'dimnames') .EQ. 0 ) THEN
+              attype = NCCHAR
+
+           ELSE IF (STR_SAME(attname, 'attnames') .EQ. 0   .OR.
+     .           STR_SAME(attname, 'ndims') .EQ. 0  .OR.
+     .           STR_SAME(attname, 'nattrs') .EQ. 0  .OR.
+     .           STR_SAME(attname, 'nvars') .EQ. 0 ) THEN
+              attype = NCFLOAT
+           ENDIF
+
+* Otherwise get att type from the linked-list structure
+
+        ELSE
+           CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+           IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid,
+     .        attid, aname, attype, attlen, attoutflag, status )
+        ENDIF
+
+        IF (attype .EQ. NCCHAR) THEN
+           cx_type(hi_cx) = ptype_string
+	ELSE
+	   cx_type(hi_cx) = ptype_float
+	ENDIF
+
+* The attribute handling needed to know if this was a dataset variable (dset > 0) 
+* or a user-defined variable that depends on a dataset (dset=-1). Now reset the
+* dataset to the value from cx_data_set
+
+        dset = cx_data_set(hi_cx)
+        IF (dset .EQ. pdset_irrelevant) dset = -1
+        
+* set the X axis limits equal to the length of the array
+c	cx_lo_ss(hi_cx, x_dim) = 1
+c	cx_hi_ss(hi_cx, x_dim) = attlen !!
+        IF (attype .EQ. NCCHAR) cx_hi_ss(hi_cx, x_dim) = 1
+
+* The grid is abstract 
+
+	var = cx_variable(hi_cx)
+        uv_grd = KNOWN_GRID( cx_data_set(hi_cx), cat_attrib_val, var )
+
+	IF ( cx_unstand_grid(hi_cx)
+     . .AND. cx_grid(hi_cx) .LT. unspecified_int4 ) GOTO 800
+
+
+* do we know the defining grid for the component ?
+* (not necessarily the same as the returned grid --> there may be a regrid )
+
+	IF ( cx_grid(hi_cx) .NE. unspecified_int4 ) THEN
+	   GOTO 500	! know grid --> merge it
+	ELSE
+	   GOTO 9000	! err: grid for varname.attname is known
+	ENDIF
+
+        GOTO 500
+
+* string constant
+ 400	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	hi_cx = cx_stack_ptr
+        CALL STRING_CONTEXT (   uvar,
+     .                          item,
+     .                          lo_cx,
+     .                          hi_cx,
+     .                          status )
+        IF ( status .NE. ferr_ok ) RETURN
+	GOTO 500		! go merge it
+
+* constant (float)
+* this block is only for the purpose of setting the data type of the result
+* ... in case the result is only a constant (in an IF-THEN expression)
+! ... The grid is unspecified for a constant
+ 410	IF ( is_sum(isp) .EQ. isalg_transfer ) THEN
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   hi_cx = cx_stack_ptr
+           CALL CONSTANT_CONTEXT ( uvar_text(uvar)(start:end),
+     .                             lo_cx,
+     .                             hi_cx,
+     .                             status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   cx_type(big_cx) = cx_type(hi_cx)
+	   cx_stack_ptr = cx_stack_ptr - 1
+	ENDIF
+	GOTO 100
+
+* counter variable (repeat/range=)
+* this block is only for the purpose of setting the data type of the result
+! ... The grid is unspecified for a constant
+ 420	IF ( is_sum(isp) .EQ. isalg_transfer ) THEN
+	   CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   hi_cx = cx_stack_ptr
+           name = '1'
+           CALL CONSTANT_CONTEXT ( name,
+     .                             lo_cx,
+     .                             hi_cx,
+     .                             status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   cx_type(big_cx) = cx_type(hi_cx)
+	   cx_stack_ptr = cx_stack_ptr - 1
+	ENDIF
+	GOTO 100
+
+* "IF" marker in an "IF condition THEN result1 ELSE result2" structure
+* ... The data type of the result depends only on the result clauses
+* ... prepare to restore the data type after the "condition" is processed
+* ... Note: expressions are processed here from high item backwards so
+*           the "condition" is the last thing to be procesed 
+ 450	saved_ifthen_type = .TRUE.
+	ifthen_data_type = cx_type(big_cx)
+	GOTO 100
+
+* create, initialize buffer to receive the grid
+ 500	IF ( is_sum(isp) .EQ. isalg_transfer) THEN
+	   grid = cx_grid(big_cx)
+	   CALL INIT_EMPTY_CONTEXT( big_cx)
+	   CALL INIT_GRID(grid, 'UVAR', mnormal)
+	   cx_grid(big_cx) = grid
+	   is_sum( isp ) = isalg_merge_n
+	ENDIF
+
+* merge the newly acquired grid with the previously merged ones
+	grid = cx_grid(big_cx)
+	CALL MERGE_GRID( item, its_gc, uvar_text(uvar)(start:end),
+     .			 big_cx, hi_cx, uvar, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF (saved_ifthen_type) cx_type(big_cx) = ifthen_data_type
+
+* 1/97: For GC variables, the last GC function argument has just been merged.
+* Now we need to finish by imposing any axes that the function requires.
+* The context stack at this point has these contents
+* 	  default context (var=uvar, region=(1:1,1:1,1:1,1:1) for base var)
+* big_cx: the merged grid context
+*   -->	  argument N context
+*	  argument N-1 context
+*	  ...
+*	  argument 1 context
+* So big_cx+1 is passed as a pointer to the argument contexts  
+	IF (its_gc) THEN
+	   IF (item.EQ.1) THEN
+	      CALL GCF_IMPOSE_AXES( big_cx+1, big_cx, uvar, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	ENDIF
+	
+* release context stack space for component just merged
+* 1/97: release it if and only if it is not a grid-changing variable.
+* For grid changing variable we may need the list of contexts for all of the
+* arguments to the GC function in order to determine the imposed axes.
+* The depth of the stack needed for this should be 2+nargs
+* Note that nargs is always nitem-1 since grid-changing variabless always
+* compile to uvar_item_type = arg1 arg2 ... argn gc_function
+* BUT that this routine examines items in reverse order (why?) so item=1
+* is the key that we are evaluating the last argument for the GC variable.
+* Note that in principle there should be no problem handling the stack in
+* this manner (popping it only after all arguments are evaluated)
+* for all uvars; handling GC variables differently was a choice in
+* order to minimize changes to already working code
+	IF ( is_phase(isp).NE.0 ) THEN
+	   IF (.NOT.its_gc) THEN
+	      cx_stack_ptr = cx_stack_ptr - 1
+	   ENDIF
+	ENDIF
+	 
+	GOTO 100
+
+* deal with G=uvar with target grid not yet known -- get the target grid (8/99)
+ 800	CONTINUE
+* ... decode the character position of the "G=" target variable name
+* 5/03 bug fix acm: use buff here for just the current item, not the 
+*                   whole uvar_text(uvar) 
+* 
+        buff = uvar_text(uvar)(start:end)
+	end = (-cx_grid(hi_cx))/2000
+	start = (-cx_grid(hi_cx)) - 2000*end + unspecified_int4
+* 2/03 *kob* g77 port - need the '*' on call to errmsg to make it an
+*                       alternate return label, rather than passing
+*                       by reference
+	IF ( start .LT. 0
+     .  .OR. end   .LT. start
+     .	.OR. end   .GT. cmnd_buff_len ) CALL ERRMSG(
+     .			ferr_internal, status, 'G=uvar', *5000)
+
+	name = buff(start:end)
+	len_name = end - start + 1
+        
+* Fix bug 1507: if start = end, then the above assignment leaves name blank (!)
+        IF (len_name .EQ. 1) name = buff(start:end+1)
+
+* ... the context stack is already pushed from above
+	CALL GET_VAR_CONTEXT (  name(:len_name),
+     .				lo_cx,
+     .				hi_cx,
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+
+* grid for this component is not known.  Back to IS stack to get it
+* ... repeat this phase again when we get back
+ 900	is_phase(isp) = is_phase(isp) - 1
+	IF (need_another_pass) is_phase(isp) = -1 * is_phase(isp)  ! 4/99
+* load the new variable info onto the IS stack
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	is_cx   ( isp ) = hi_cx
+	is_uvar ( isp ) = cx_variable( hi_cx )
+	is_act  ( isp ) = isact_get_grid	! temp diagnostic
+	RETURN 1
+
+* grid for this aggregate dataset is not known.  Back to get_uvar_grid and call
+* is_aggregate_grid to get it
+* ... repeat this phase again when we get back
+ 990	is_phase(isp) = is_phase(isp) - 1
+* load the new variable info onto the IS stack
+	CALL PUSH_INTERP_STACK( isp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+c	is_sum( isp ) = isalg_merge_n
+
+	is_cx   ( isp ) = hi_cx
+	is_uvar ( isp ) = cx_variable( hi_cx )
+	is_act  ( isp ) = isact_get_agg_grid	! get aggregate grid on return.
+
+	RETURN 1
+	
+***  DONE - clean up
+ 1000	CONTINUE
+* for grid-changing vars all of the arguments contextx are still on the stack 
+	IF ( its_gc ) THEN
+	   DO 1010 i = 1, nitem - 1	! 3/99 - strings not on stack
+	      cx_stack_ptr = cx_stack_ptr - 1
+!	      IF (uvar_item_type(i,uvar).NE. alg_string)
+!     .			cx_stack_ptr = cx_stack_ptr - 1
+ 1010	   CONTINUE
+	ENDIF
+* have any variables been encountered ?
+* is this a completely abstract expression like X+Y*2 ?
+* ... 8/95 check uvar_dset: LET/D variable needs uvar_need_dset always true 
+	IF ( is_sum(isp) .EQ. isalg_transfer ) THEN
+	   IF ( uvar_dset(uvar).EQ.unspecified_int4 ) THEN
+	      uvar_need_dset(uvar) = .FALSE.
+	      uvar_grid(uvar, pdset_irrelevant) = mgrid_abstract
+	      uvar_data_type(uvar, pdset_irrelevant) = ptype_float
+	   ELSE		! defined with LET/D
+!	      uvar_need_dset(uvar) = .TRUE.	! always TRUE anyway
+* *kob* 4/99 bug fix - check to see if let/d is dataset independent
+	      IF (dset .EQ. unspecified_int4) THEN
+		 uvar_grid(uvar, pdset_irrelevant) = mgrid_abstract
+	         uvar_data_type(uvar, pdset_irrelevant) = ptype_float
+              ELSE
+                 uvar_grid(uvar, dset) = mgrid_abstract
+	         uvar_data_type(uvar, dset) = ptype_float
+	      ENDIF
+	   ENDIF
+	   gnum = mgrid_abstract
+	   CALL TM_USE_DYN_GRID( mgrid_abstract )
+	   GOTO 2000
+	ELSEIF (uvar_grid(uvar,pdset_irrelevant).EQ.mgrid_abstract) THEN
+* ... abstract grid after second pass
+* (2/99 comment this out since pseudo-vars now determine their own grids:
+*	XABSTRACT, YABSTRACT, ZABSTRACT, or TABSTRACT
+!	   GOTO 2000	! removed 2/99
+	ENDIF
+
+* catalog this result checking for matching previously existing grid
+	CALL TM_GET_LIKE_DYN_GRID(grid, its_dynamic, gnum, 
+     .				grd_stk_ptr, status )  
+	IF (status .NE. merr_ok) GOTO 5000
+	IF ( its_dynamic ) THEN
+	   IF ( mode_diagnostic )  CALL DIAG_OP
+     .	     ('allocate', isact_class_impl_grid, gnum, 0)
+	ENDIF
+
+* point uvar to its grid (possibly need different grid for each dset)
+* ... 8/95 check uvar_dset: LET/D variable needs uvar_need_dset always true 
+* ... 3/99 but LET/D ("default") needs uvar_need_dset FALSE 
+* ... 11/02 LET/D needs uvar_need_dset FALSE only when there is no dataset
+*           associated with the variable.  In the case where LET/D wants the
+*           default dataset associated with the variable, it should be true
+*           so remove the 3/99 additions - which fixed a bug which occured
+*           only when a let/d was done and no dataset was initialized.  This
+*           was the incorrect place to fix that bug.
+
+        IF ( uvar_dset(uvar).EQ.unspecified_int4 )
+     .            uvar_need_dset(uvar) = .NOT.cx_dset_gvn(big_cx)
+
+c        IF ( itype .EQ. alg_attrib_val  ) THEN
+c           uvar_dset(uvar) = dset
+c           uvar_need_dset(uvar) = .TRUE.
+c        ENDIF
+
+	IF ( uvar_need_dset(uvar) .AND. dset .NE. unspecified_int4) THEN
+	   this_dset = dset
+	ELSE
+	   this_dset = pdset_irrelevant
+	ENDIF
+
+* store the importenat stuff!
+	uvar_grid( uvar, this_dset ) = gnum
+	uvar_data_type(uvar, this_dset) = cx_type(big_cx)
+	DO  i = 1, nferdims
+	   uvar_aux_var (uvar, i, this_dset) = cx_aux_var (i, big_cx)
+	   uvar_aux_cat (uvar, i, this_dset) = cx_aux_cat (i, big_cx)
+	   uvar_aux_stat(uvar, i           ) = cx_aux_stat(i, big_cx)
+	ENDDO
+
+* * * SECOND PASS CHECK * * *
+* need a second pass to include pseudo_vars in calculation ?
+ 2000	IF ( need_another_pass ) THEN 
+* ... uvar_grid and data set info are NOT re-initialized
+	   IF ( pass_number .GT. 1 ) GOTO 9000	! caught in a loop ...
+	   DO 1110 i = 1, nferdims
+ 1110	   uvar_given(i,uvar) = uvlim_irrelevant
+	   uvar_grid( uvar, this_dset ) = unspecified_int4 ! 10/00
+	   uvar_data_type(uvar, this_dset) =  unspecified_int4 ! housekeeping
+	   is_phase( isp ) = 0
+	   is_sum( isp ) = isalg_transfer
+	   cx_stack_ptr = cx_save
+	   need_another_pass = .FALSE.
+	   pass_number = pass_number + 1
+	   saved_ifthen_type = .FALSE.
+	   cx_grid( lo_cx ) = gnum	! set default for pseudo-vars
+* ... deallocate the grid just obtained since it will be
+*     allocated again on the next pass
+! pre-4/00 IF (gnum .GT. max_grids ) CALL TM_DEALLO_DYN_GRID( gnum )
+	   CALL TM_DEALLO_DYN_GRID( gnum )
+* ... release the use-count hold that the temporary grid has on the axes
+*	since it will be re-asserted on the second pass
+*	We need to retain the grid, itself, because it is used on pass 2
+	   DO 1120 i = 1, nferdims
+	      CALL TM_DEALLO_DYN_LINE(grid_line(i,grid))
+ 1120	   CONTINUE
+	   IF ( mode_diagnostic ) THEN
+	      CALL DIAG_OP('dealloc ',isact_class_impl_grid,gnum,0)
+	      CALL DIAGNOSTIC_OUT( 'pass #2', lo_cx, point_to_cx )
+	   ENDIF
+	   GOTO 100
+	ENDIF
+
+* release context (lo_cx, big_cx), IS and grid stack space used in grid-getting
+	IF ( big_cx .NE. cx_stack_ptr
+     .	.OR. big_cx .NE. lo_cx+1 ) WRITE (6, *) 'uvar_stk_err' ! temp diag
+	cx_stack_ptr = cx_stack_ptr - 2
+	isp = isp - 1
+	CALL DEALLO_GRID( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+c        IF ( itype .EQ. alg_attrib_val  ) THEN
+c           uvar_dset(uvar) = unspecified_int4  ! or irrelevant??
+c        ENDIF
+
+* Is it a LET/REMOTE variable?
+* ! do we need to find a slot in rvar_uvar, and index the rvars with "rvar", 
+* !or just use same indexing as for regular user-vars?
+
+
+        IF (uvar_remote(uvar)) THEN 
+
+	   CALL CD_DSET_REMOTEOK(dset, ok_remote)
+	   IF (ok_remote) THEN
+	      uvar_remote(uvar) = .TRUE. 
+	      rvar_uvar(uvar) = uvar  
+	      rvar_dset(uvar) = dset
+c	      rvar_on_server(uvar) = .FALSE. 
+	   ELSE
+	      uvar_remote(uvar) = .FALSE. 
+	   ENDIF
+	ENDIF
+
+	RETURN 2
+
+* error exit
+ 5000	CALL DEALLO_ALL_GRIDS
+	RETURN
+ 9000	CALL ERRMSG( ferr_internal, status, 'is_uvar_grid', *5000 )
+ 9100   IF ( dset .LE. 0 ) GOTO 9000
+        CALL GET_SHORT_DSET_NAME( dset, name, i )
+        IF ( .NOT. (dp_phil_sieg(dset).OR.dp_cox(dset)) ) THEN
+           CALL WARN( name(:i)//' is not a GFDL model data set' ) 
+        ELSE
+           GOTO 9000
+        ENDIF
+ 	CALL ERRMSG( ferr_invalid_command, status,
+     .               'no grid for GFDL diagnostic variable '
+     .               //VAR_CODE(cat_calc_var, cx_variable(hi_cx)),
+     .               *5000 )
+
+	END	
diff --git a/fer/stk/its_auto_curvi.F b/fer/stk/its_auto_curvi.F
new file mode 100644
index 0000000..3ae9527
--- /dev/null
+++ b/fer/stk/its_auto_curvi.F
@@ -0,0 +1,66 @@
+	LOGICAL FUNCTION ITS_AUTO_CURVI(is_ptr, which_axes )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* do the contents of the stack level is_ptr indicate that a 3-arg style output
+* has been obtained?  If so, return the axes that are available.
+
+* V690: 2/2014 *sh*
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'interp_stack.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations
+	LOGICAL	which_axes(nferdims)
+	INTEGER is_ptr
+
+* internal variable declarations
+	INTEGER	frame_bottom, idim
+
+* initialize
+	frame_bottom = is_aux_ptr(is_ptr)
+	ITS_AUTO_CURVI = .FALSE.
+
+* count the stored auxiliary variables in the designated stack frame
+	DO idim = 1, nferdims
+	   which_axes(idim) = is_mr(frame_bottom+idim) .NE. unspecified_int4
+	   IF ( which_axes(idim) ) ITS_AUTO_CURVI = .TRUE.
+	ENDDO
+
+	RETURN
+	END
diff --git a/fer/stk/known_grid.F b/fer/stk/known_grid.F
new file mode 100644
index 0000000..db78df2
--- /dev/null
+++ b/fer/stk/known_grid.F
@@ -0,0 +1,120 @@
+	INTEGER FUNCTION KNOWN_GRID ( data_set, category, variable )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the defining grid for the given variable
+* if unknown - return unknown flag
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   7/6/89 - based on IGRID
+* V230:  7/21/92 - check for unspecified data set on calc_var
+* v554: 1/04 *acm* Counter variables for REPEAT/RANGE=/NAME=
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+	include	'tmap_dims.parm'
+#       include "tmap_dset.parm"
+	include	'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'ferret.parm'
+	include	'xvariables.cmn'
+	include	'xcalc_vars.cmn'
+        include 'xfr_grid.cmn'
+        INCLUDE 'xpyvar_info.cmn'
+
+* calling argument declarations:
+	INTEGER	data_set, category, variable
+
+* internal variable declarations:
+	INTEGER	dset
+
+* different procedure for determining grid from each category
+	IF     ( category .EQ. cat_file_var ) THEN
+
+	   KNOWN_GRID = ds_grid_number( variable )
+
+	ELSEIF ( category .EQ. cat_aggregate_var ) THEN
+
+	   KNOWN_GRID = ds_grid_number( variable )
+	   IF (ds_grid_number( variable ) .EQ. int4_init) 
+     .	      KNOWN_GRID = unspecified_int4
+
+        ELSEIF ( category .EQ. cat_pystat_var ) THEN
+
+           KNOWN_GRID = pyvar_grid_number( variable )
+
+	ELSEIF ( category .EQ. cat_calc_var ) THEN
+
+           IF ( data_set .EQ. unspecified_int4 ) THEN
+              KNOWN_GRID = unspecified_int4
+           ELSE
+	      KNOWN_GRID = cvar_grid( variable, data_set )
+           ENDIF
+
+
+	ELSEIF ( category .EQ. cat_user_var ) THEN
+
+* ... allow "abstract" expressions that don't depend on data set
+	   IF ( .NOT.uvar_need_dset(variable)
+     .	   .OR. data_set .EQ. unspecified_int4 ) THEN
+	      dset = pdset_irrelevant
+	   ELSE
+	      dset = data_set
+	   ENDIF
+	   KNOWN_GRID = uvar_grid( variable, dset )
+
+	ELSEIF ( category .EQ. cat_temp_var ) THEN
+
+	   KNOWN_GRID = mr_grid( variable )
+
+	ELSEIF ( category .EQ. cat_counter_var ) THEN
+
+	   KNOWN_GRID = mgrid_xabstract
+
+	ELSEIF ( category .EQ. cat_attrib_val ) THEN  
+
+	   KNOWN_GRID = mgrid_xabstract
+
+	ELSE
+
+	   STOP 'KNOWN_GR'
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/stk/make_pseudo_var.F b/fer/stk/make_pseudo_var.F
new file mode 100644
index 0000000..a03cecf
--- /dev/null
+++ b/fer/stk/make_pseudo_var.F
@@ -0,0 +1,104 @@
+	SUBROUTINE MAKE_PSEUDO_VAR ( cx, idim, pvar, mr, lo_ss, hi_ss )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a "pseudo-variable" - numerical grid of data based solely on the
+* underlying grid (not involving external data)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/2/87
+* V200:  6/20/89 - 4D-symmetrical version
+* V530   1/01 - *sh* - added XBOXLO, XBOXHI and family ...
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm*      more 4s that should have been nferdims
+*      *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include	'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, idim, lo_ss, hi_ss
+	REAL	pvar( lo_ss:hi_ss )
+
+* internal variable declarations:
+	INTEGER	grid, pv, i
+	REAL	BOX_SIZE
+	REAL*8	TM_WORLD
+
+* initialize
+
+* defining grid for output data
+	grid = cx_grid( cx )
+
+	pv = (mr_variable(mr)-1) / nferdims  + 1
+
+	IF ( pv .GT. nferdims+1 )  STOP 'MK_PSEUDO_VAR'	! diag
+
+	GOTO (  100, 200, 300, 400, 500 ) pv
+
+* "I", "J", "K", "L", "M", "N"
+ 100	DO 110 i = lo_ss, hi_ss
+ 110	pvar( i ) = i
+	RETURN
+
+* "X", "Y", "Z", "T", "E", "F"
+ 200	DO 210 i = lo_ss, hi_ss
+ 210	pvar( i ) = TM_WORLD( i,grid,idim,box_middle )
+	RETURN
+
+* "XBOX", "YBOX", "ZBOX", "TBOX", "EBOX", "FBOX"
+ 300	DO 310 i = lo_ss, hi_ss
+ 310	pvar( i ) = BOX_SIZE( i, grid, idim )
+	RETURN
+
+* "XBOXLO", "YBOXLO", "ZBOXLO", "TBOXLO", "EBOXLO", "FBOXLO"
+ 400	DO 410 i = lo_ss, hi_ss
+ 410	pvar( i ) =  TM_WORLD( i,grid,idim,box_lo_lim )
+	RETURN
+
+* "XBOXHI", "YBOXHI", "ZBOXHI", "TBOXHI", "EBOXHI", "FBOXHI"
+ 500	DO 510 i = lo_ss, hi_ss
+ 510	pvar( i ) =  TM_WORLD( i,grid,idim,box_hi_lim )
+	RETURN
+
+	END
diff --git a/fer/stk/non_array_subsc.F b/fer/stk/non_array_subsc.F
new file mode 100644
index 0000000..a76b7a8
--- /dev/null
+++ b/fer/stk/non_array_subsc.F
@@ -0,0 +1,67 @@
+	SUBROUTINE NON_ARRAY_SUBSC( mr_list, nmr )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer the lo:hi subscript information for the given list of memory-resident
+* variables to non-array storage where it can be used for adjustable array
+* dimensioning
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/20/89
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER nmr, mr_list(nmr)
+
+* internal variable declarations:
+	INTEGER idim, mr
+
+	DO 100 idim = 1, nferdims
+	DO 100 mr   = 1, nmr
+	   lo_ss( mr, idim ) = mr_lo_ss( mr_list(mr), idim )
+	   hi_ss( mr, idim ) = mr_hi_ss( mr_list(mr), idim )
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/stk/offset_ss.F b/fer/stk/offset_ss.F
new file mode 100644
index 0000000..f9c72ed
--- /dev/null
+++ b/fer/stk/offset_ss.F
@@ -0,0 +1,229 @@
+	SUBROUTINE OFFSET_SS( idim, cx, lo_off, hi_off, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine offsets to subscripts of the specified axis needed to request
+* a region of component data adequate to compute the result region
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/31/89 - based on CHG_PLANE_LIMS
+* for Unix/RISC port 9/91 - added SHN,SPZ,SWL
+* V230:  1/22/92 - added @WEQ and @RSUM
+*        3/23/92 - added @FLN, @FNR
+*         7/2/92 - changed @FLN, @FNR to off-edge (vs. window width)  
+* V455:  9/97 - trap illegal offset arguments, return status
+*	      - added transforms @CDA,CDB,CIA,CIB
+* V533:  *sh* 6/01 - added @EVNT
+* v552  4/03 *acm* up VAR_TRANS to 150 characters (variables are up to 128, plus
+*                  space for the transformation specifier)
+* V581: 3/05 *acm* Fix bug 1207: CDB, CIB, CDA, CIA are one-sided: return
+*                  offset only in one direction.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER idim, cx, lo_off, hi_off, status
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+
+* internal variable declarations:
+	LOGICAL	offset_supplied( 2:max_plane_transform )
+	INTEGER	ioff, trans, lout,
+     .		offset_lo   ( 2:max_plane_transform ),
+     .		offset_hi   ( 2:max_plane_transform )
+	REAL	arg
+	CHARACTER*150 VAR_TRANS, buff
+
+* pre-stored offsets needed for transformations
+	DATA offset_lo  	( trans_integ_indef )	/  0  /,
+     .	     offset_hi  	( trans_integ_indef )	/  0  /,
+     .	     offset_supplied	( trans_integ_indef )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_smth_box )	/ -1  /,
+     .	     offset_hi   	( trans_smth_box )	/ +1  /,
+     .	     offset_supplied	( trans_smth_box )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_max )	/ -1  /,
+     .	     offset_hi   	( trans_smth_max )	/ +1  /,
+     .	     offset_supplied	( trans_smth_max )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_median )	/ -1  /,
+     .	     offset_hi   	( trans_smth_median )	/ +1  /,
+     .	     offset_supplied	( trans_smth_median )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_min )	/ -1  /,
+     .	     offset_hi   	( trans_smth_min )	/ +1  /,
+     .	     offset_supplied	( trans_smth_min )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_deriv_cntr )	/ -1  /,
+     .	     offset_hi   	( trans_deriv_cntr )	/ +1  /,
+     .	     offset_supplied	( trans_deriv_cntr )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_deriv_fwrd )	/  0  /,
+     .	     offset_hi   	( trans_deriv_fwrd )	/ +1  /,
+     .	     offset_supplied	( trans_deriv_fwrd )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_deriv_bkwd )	/ -1  /,
+     .	     offset_hi   	( trans_deriv_bkwd )	/  0  /,
+     .	     offset_supplied	( trans_deriv_bkwd )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_subset )	/  0  /,
+     .	     offset_hi   	( trans_subset )	/  0  /,
+     .	     offset_supplied	( trans_subset )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_shift )		/ 1 /,
+     .	     offset_hi   	( trans_shift )		/ 1 /,
+     .	     offset_supplied	( trans_shift )		/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_fill_ave )	/ -1  /,
+     .	     offset_hi   	( trans_fill_ave )	/ +1  /,
+     .	     offset_supplied	( trans_fill_ave )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_binml )	/ -1  /,
+     .	     offset_hi   	( trans_smth_binml )	/ +1  /,
+     .	     offset_supplied	( trans_smth_binml )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_hanng )	/ -1  /,
+     .	     offset_hi   	( trans_smth_hanng )	/ +1  /,
+     .	     offset_supplied	( trans_smth_hanng )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_parzn )	/ -1  /,
+     .	     offset_hi   	( trans_smth_parzn )	/ +1  /,
+     .	     offset_supplied	( trans_smth_parzn )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_smth_welch )	/ -1  /,
+     .	     offset_hi   	( trans_smth_welch )	/ +1  /,
+     .	     offset_supplied	( trans_smth_welch )	/ .TRUE. /,
+     .
+     .       offset_lo  	( trans_run_sum )	/  0  /,
+     .	     offset_hi  	( trans_run_sum )	/  0  /,
+     .	     offset_supplied	( trans_run_sum )	/ .FALSE. /,
+     .
+     .       offset_lo  	( trans_wgted_eq )	/  0  /,
+     .	     offset_hi  	( trans_wgted_eq )	/  0  /,
+     .	     offset_supplied	( trans_wgted_eq )	/ .FALSE. /,
+     .
+     .	     offset_lo   	( trans_fill_interp )	/ -1  /,
+     .	     offset_hi   	( trans_fill_interp )	/ +1  /,
+     .	     offset_supplied	( trans_fill_interp )	/ .TRUE. /,
+     .
+     .	     offset_lo   	( trans_fill_near )	/ -1  /,
+     .	     offset_hi   	( trans_fill_near )	/ +1  /,
+     .	     offset_supplied	( trans_fill_near )	/ .TRUE. /
+
+	DATA offset_lo  	( trans_nrst_dist_abv )	/  -1 /,
+     .	     offset_hi  	( trans_nrst_dist_abv )	/  +1 /,
+     .	     offset_supplied	( trans_nrst_dist_abv )	/ .TRUE. /,
+     .
+     .	     offset_lo  	( trans_nrst_dist_blw )	/  -1 /,
+     .	     offset_hi  	( trans_nrst_dist_blw )	/  +1 /,
+     .	     offset_supplied	( trans_nrst_dist_blw )	/ .TRUE. /,
+     .
+     .	     offset_lo  	( trans_nrst_indx_abv )	/  -1 /,
+     .	     offset_hi  	( trans_nrst_indx_abv )	/  +1 /,
+     .	     offset_supplied	( trans_nrst_indx_abv )	/ .TRUE. /,
+     .
+     .	     offset_lo  	( trans_nrst_indx_blw )	/  -1 /,
+     .	     offset_hi  	( trans_nrst_indx_blw )	/  +1 /,
+     .	     offset_supplied	( trans_nrst_indx_blw )	/ .TRUE. /,
+     .
+     .	     offset_lo  	( trans_event_mask )	/  0 /,
+     .	     offset_hi  	( trans_event_mask )	/  0 /,
+     .	     offset_supplied	( trans_event_mask )	/ .FALSE. /
+
+* --- end of introductory code ---
+* initiailize
+	trans = cx_trans    ( idim, cx )
+	arg   = cx_trans_arg( idim, cx )
+	status = ferr_ok
+
+	IF ( offset_supplied(trans) .AND. arg.NE. bad_val4 ) THEN
+* offset given explicitly by user (eg @SHF:-1)
+	   ioff = INT( arg )
+	   IF ( trans .EQ. trans_smth_box
+     .	  . OR. trans .EQ. trans_smth_binml
+     .	  . OR. trans .EQ. trans_smth_hanng
+     .	  . OR. trans .EQ. trans_smth_max
+     .	  . OR. trans .EQ. trans_smth_median
+     .	  . OR. trans .EQ. trans_smth_min
+     .	  . OR. trans .EQ. trans_smth_parzn
+     .	  . OR. trans .EQ. trans_smth_welch
+     .	  . OR. trans .EQ. trans_fill_ave ) THEN
+	      IF (ioff .LE. 0) GOTO 5100
+	      hi_off = ioff / 2
+	      lo_off = -hi_off
+	   ELSEIF ( trans .EQ. trans_fill_interp
+     .         .OR. trans .EQ. trans_fill_near     ) THEN  ! number of points 
+	      IF (ioff .LE. 0) GOTO 5100
+              hi_off = ioff                                ! past edge
+              lo_off = -hi_off
+	   ELSEIF ( trans .EQ. trans_shift ) THEN
+	      hi_off = ioff
+	      lo_off = ioff
+	   ELSEIF ( trans .EQ. trans_nrst_dist_abv
+     .	     .OR.   trans .EQ. trans_nrst_indx_abv ) THEN
+	      IF (ioff .LE. 0) GOTO 5100
+              hi_off = ioff 
+              lo_off = 0
+	   ELSEIF ( trans .EQ. trans_nrst_dist_blw
+     .	      .OR.  trans .EQ. trans_nrst_indx_blw ) THEN
+	      IF (ioff .LE. 0) GOTO 5100
+              hi_off = 0
+              lo_off = -1*ioff
+	   ELSE
+! temp - for debugging
+	      WRITE (6,*) 'illegal plane transform', trans
+	   ENDIF
+
+	ELSE
+* use default or standard offsets
+	   lo_off = offset_lo( trans )
+	   hi_off = offset_hi( trans )
+	ENDIF
+
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5100	buff = VAR_TRANS(idim, cx, lout )
+	CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal transform argument: '//buff(:lout),
+     .               *5000 )
+ 
+	END
diff --git a/fer/stk/operate.F b/fer/stk/operate.F
new file mode 100644
index 0000000..09cc448
--- /dev/null
+++ b/fer/stk/operate.F
@@ -0,0 +1,1724 @@
+      SUBROUTINE OPERATE (	operation, num_com, ifv, com_cx,
+     .				com1, mr1,
+     .				com2, mr2,
+     .				com3, mr3,
+     .				com4, mr4,
+     .				res, mres )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform an operation involving portions of 0,1,2 or 3 input grids
+* and producing an entire result grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/20/89-8/3/89 - based on GRID_OPERATION
+*		 - 4-D symmetric where components may have differing dims
+*		 - eliminated derivatives (now "@" transformations)
+*		 - added IGNORE0 and EXP
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+*	10/26/89 - corrected bad flag bug by introducing bad_res
+*	11/28/89 - reordering of functions for change to in-fix notation
+*	 3/19/90 - added ATAN,ATAN2,ASIN,ACOS
+*	 3/29/90 - added RANDU,RANDN
+* Unix/RISC port - 10/91 - corrected improper calculation of MISSING func
+*                          for cases where arg1 was ok but arg2 was bad
+* V230:  8/5/92 - added new functions RHO_UN and THETA_UN
+*               - upped to 4 the number of function arguments allowed
+*       8/19/92 - LOG and LN args must be positive
+*                 EXP arg is limited to (approx.) 77
+*                 RHO salinity arg must be non-negative
+*	6/93	- correct subscript bug introduced 8/19/92
+* V320: 11/94   - added new function DAY1900(year, month, day)
+* Linux Port  12/96 *kob* - had to pass 0.0 to RANDU and RANDN rather 
+*			    than the 0 that was being passed. F90 
+*			    complained about inconsistent datatypes
+* v491: 4/98 *kob* - had to fix incorrect array references using i1,j1,k1 for
+*                    arrays com2, com3
+* V510 *sh* 1/00 - fixed argument checks on DAYS1900
+*                - allow pre-1900, forbid month>12
+*      5/00 *sh* - bug fix in line checking month>12
+* v5.40*acm* add comment: days1900 returns days since 1-jan-1900, STANDARD CALENDAR
+* V600 4/06  *acm*  return the result from days_from_day0 in dummy, for 64-bit build
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid.
+* V672 9/11  *acm* add RANDU2,RANDN2.  The way RANDN works, with SAVEd variables,
+*                  it's not going to work well as an external function.
+* V6.8 for double-precision Ferret do the RANDU calculation
+*      with a real*4 argument. Gives consistent results with single-p.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	LOGICAL ifv
+	INTEGER	operation, num_com, com_cx(4), mr1, mr2, mr3, mr4, mres
+	REAL    com1( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .		com2( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .		com3( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit,m3loe:m3hie,m3lof:m3hif ),
+     .		com4( m4lox:m4hix,m4loy:m4hiy,m4loz:m4hiz,m4lot:m4hit,m4loe:m4hie,m4lof:m4hif ),
+     .		 res( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,m5lot:m5hit,m5loe:m5hie,m5lof:m5hif )
+
+* internal variable declarations:
+	LOGICAL	first
+	INTEGER CX_DIM_LEN, op, i, j, k, l, m, n, icom, idim,
+     .		i1, j1, k1, l1, m1, n1, i2, j2, k2, l2, m2, n2, 
+     .		i3, j3, k3, l3, m3, n3, i4, j4, k4, l4, m4, n4, 
+     .		di1, dj1, dk1, dl1, dm1, dn1, 
+     .		di2, dj2, dk2, dl2, dm2, dn2,
+     .		di3, dj3, dk3, dl3, dm3, dn3, 
+     .		di4, dj4, dk4, dl4, dm4, dn4,
+     .		si1, sj1, sk1, sl1, sm1, sn1, 
+     .		si2, sj2, sk2, sl2, sm2, sn2,
+     .		si3, sj3, sk3, sl3, sm3, sn3, 
+     .		si4, sj4, sk4, sl4, sm4, sn4, 
+     .		inseed
+	REAL	RANDU, RANDN, RANDN2, RHO_UNESCO, THETA_FOFF,
+     .		DAYS_FROM_DAY0,
+     .          bad1, bad2, bad3, bad4, bad_res, dummy,
+     .          op_repl
+	REAL*4  R_IN
+
+* equivalence conveniences. Arrays are (idim, icom)
+* "inc" is the increments for each axis of each component 
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+	INTEGER	inc(nferdims,4), lo(nferdims,4)
+	EQUIVALENCE
+     .	(lo(1,1),si1), (lo(2,1),sj1), (lo(3,1),sk1), (lo(4,1),sl1), (lo(5,1),sm1), (lo(6,1),sn1), 
+     .	(lo(1,2),si2), (lo(2,2),sj2), (lo(3,2),sk2), (lo(4,2),sl2), (lo(5,2),sm2), (lo(6,2),sn2), 
+     .	(lo(1,3),si3), (lo(2,3),sj3), (lo(3,3),sk3), (lo(4,3),sl3), (lo(5,3),sm3), (lo(6,3),sn3), 
+     .	(lo(1,4),si4), (lo(2,4),sj4), (lo(3,4),sk4), (lo(4,4),sl4), (lo(5,4),sm4), (lo(6,4),sn4),
+     .	(inc(1,1),di1),(inc(2,1),dj1),(inc(3,1),dk1),(inc(4,1),dl1),(inc(5,1),dm1),(inc(6,1),dn1), 
+     .	(inc(1,2),di2),(inc(2,2),dj2),(inc(3,2),dk2),(inc(4,2),dl2),(inc(5,2),dm2),(inc(6,2),dn2), 
+     .	(inc(1,3),di3),(inc(2,3),dj3),(inc(3,3),dk3),(inc(4,3),dl3),(inc(5,3),dm3),(inc(6,3),dn3), 
+     .	(inc(1,4),di4),(inc(2,4),dj4),(inc(3,4),dk4),(inc(4,4),dl4),(inc(5,4),dm4),(inc(6,4),dn4)
+
+* internal parameter declarations:
+	REAL*8          pdays_by_1900
+	PARAMETER     ( pdays_by_1900 = 59958230400.0 / (60.*60.*24.) )
+
+* flag(s) for bad or missing values
+	bad1 = mr_bad_data ( mr1 )
+	bad2 = mr_bad_data ( mr2 )
+	bad3 = mr_bad_data ( mr3 )
+	bad4 = mr_bad_data ( mr4 )
+	bad_res = mr_bad_data( mres )
+
+* For operations, e.g.  IF var GT a THEN b, create a mask of 1's and 0's.
+* but for expressions using IFV, the mask needs to be 1's and bad-values.
+* If its an IFV expression then use the corresponding THEN and ELSE.
+
+        op = operation
+	op_repl = 0.
+	IF (ifv) THEN
+	   op_repl = bad_res
+	   IF (op .EQ. 45) op = 47
+	   IF (op .EQ. 46) op = 48
+        ENDIF
+
+* compute the delta increment for each axis of each component
+	DO 10 icom = 1, num_com
+	DO 10 idim = 1, nferdims
+	   IF ( CX_DIM_LEN(idim,com_cx(icom)) .EQ. 1 ) THEN
+	      inc(idim,icom) = 0
+	   ELSE
+	      inc(idim,icom) = 1
+	   ENDIF
+ 10	CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+	DO 20 icom = 1, num_com
+	DO 20 idim = 1, nferdims
+ 20	lo(idim,icom) = cx_lo_ss(com_cx(icom),idim) - inc(idim,icom)
+
+* operators, functions, logic structures
+	GOTO (   100, 200, 300, 400, 500, 600, 700, 800, 900,1000,
+     .		1100,1200,1300,1400,1500,1600,1700,1800,
+     .
+     .		1900,2000,
+     .		2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,
+     .		3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,
+     .		4100,4200,4300,
+     .
+     .		4400,4500,4600,4700,4800		   ) op
+
+* ----------------------------------------------------------------------------
+* ------- OPERATORS -------------
+*
+* "+"
+ 100	n1 = sn1
+	n2 = sn2
+	DO 110 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 110 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 110 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 110 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 110 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 110 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	        res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) + com2(i2,j2,k2,l2,m2,n2)
+	     ENDIF
+
+ 110	CONTINUE
+	RETURN
+
+* "-"
+ 200	n1 = sn1
+	n2 = sn2
+	DO 210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) - com2(i2,j2,k2,l2,m2,n2)
+	   ENDIF
+
+ 210	CONTINUE
+	RETURN
+* "*"
+ 300	n1 = sn1
+	n2 = sn2
+	DO 310 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 310 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 310 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 310 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 310 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 310 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) * com2(i2,j2,k2,l2,m2,n2)
+	   ENDIF
+
+ 310	CONTINUE
+	RETURN
+
+* "/"
+ 400	n1 = sn1
+	n2 = sn2
+	DO 410 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 410 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 410 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 410 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 410 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 410 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. 0.0   ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	        res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) / com2(i2,j2,k2,l2,m2,n2)
+	     ENDIF
+
+ 410	CONTINUE
+	RETURN
+
+* "^"
+ 500	n1 = sn1
+	n2 = sn2
+	DO 510 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 510 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 510 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 510 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 510 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 510 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2
+     .	     .OR.    ( com1(i1,j1,k1,l1,m1,n1) .EQ. 0.0
+     .	         .AND. com2(i2,j2,k2,l2,m2,n2) .LT. 0.0 ) ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSEIF ( com2(i2,j2,k2,l2,m2,n2).EQ.FLOAT(INT(com2(i2,j2,k2,l2,m2,n2))) ) THEN
+	        res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) ** INT(com2(i2,j2,k2,l2,m2,n2))
+	     ELSEIF ( com1(i1,j1,k1,l1,m1,n1) .LT. 0.0 )	THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	        res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1) ** com2(i2,j2,k2,l2,m2,n2)
+	     ENDIF
+
+ 510	CONTINUE
+	RETURN
+
+* "AND" - logical AND of 2 masks (any non-zero data regarded as .TRUE.)
+ 600    n1 = sn1
+	n2 = sn2
+	DO 610 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 610 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 610 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 610 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 610 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 610 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	        IF ( com1(i1,j1,k1,l1,m1,n1).NE.0.0
+     .	       .AND. com2(i2,j2,k2,l2,m2,n2).NE.0.0 ) THEN
+		   res(i,j,k,l,m,n) = 1.0
+	        ELSE
+	  	 res(i,j,k,l,m,n) = op_repl
+	        ENDIF
+	     ENDIF
+ 610	CONTINUE
+	RETURN
+
+* "OR" - logical OR of 2 masks (any non-zero data regarded as .TRUE.)
+ 700	n1 = sn1
+	n2 = sn2
+	DO 710 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 710 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 710 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 710 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 710 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 710 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	        IF ( com1(i1,j1,k1,l1,m1,n1).NE.0.0
+     .	        .OR. com2(i2,j2,k2,l2,m2,n2).NE.0.0 ) THEN
+	  	   res(i,j,k,l,m,n) = 1.0
+	        ELSE
+		   res(i,j,k,l,m,n) = op_repl
+	        ENDIF
+	     ENDIF
+ 710	CONTINUE
+	RETURN
+
+* "GT" - mask of 1's where grid 1 exceeds grid 2, 0's elsewhere
+* "GT" - mask of 1's where grid 1 exceeds grid 2, bad-val elsewhere
+ 800 	n1 = sn1
+	n2 = sn2
+	DO 810 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 810 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 810 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 810 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 810 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 810 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	     IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	        res(i,j,k,l,m,n) = bad_res
+	     ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .GT. com2(i2,j2,k2,l2,m2,n2) ) THEN
+	  	   res(i,j,k,l,m,n) = 1.0
+	        ELSE
+		   res(i,j,k,l,m,n) = op_repl
+	        ENDIF
+	     ENDIF
+ 810	CONTINUE
+	RETURN
+
+* "GE" - mask of 1's where grid 1 exceeds or equals grid 2, 0's elsewhere
+* "GE" - mask of 1's where grid 1 exceeds or equals grid 2, bad elsewhere
+ 900 	n1 = sn1
+	n2 = sn2
+	DO 910 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 910 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 910 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 910 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 910 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 910 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .GE. com2(i2,j2,k2,l2,m2,n2) ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = op_repl
+	      ENDIF
+	   ENDIF
+ 910	CONTINUE
+	RETURN
+
+* "LT" - mask of 1's where grid 1 is less than grid 2, 0's elsewhere
+* "LT" - mask of 1's where grid 1 is less than grid 2, bad elsewhere
+ 1000 	n1 = sn1
+	n2 = sn2
+	DO 1010 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 1010 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 1010 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 1010 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 1010 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 1010 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .LT. com2(i2,j2,k2,l2,m2,n2) ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = op_repl
+	      ENDIF
+	   ENDIF
+ 1010	CONTINUE
+	RETURN
+
+* "LE" - mask of 1's where grid 1 is less than or equal to grid 2, 0's elsewhere
+* "LE" - mask of 1's where grid 1 is less than or equal to grid 2, bad elsewhere
+ 1100	n1 = sn1
+	n2 = sn2
+	DO 1110 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 1110 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 1110 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 1110 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 1110 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 1110 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .LE. com2(i2,j2,k2,l2,m2,n2) ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = op_repl
+	      ENDIF
+	   ENDIF
+ 1110	CONTINUE
+	RETURN
+
+* "EQ" - mask of 1's where grids are equal, 0's elsewhere
+* "EQ" - mask of 1's where grids are equal, bad elsewhere
+ 1200	n1 = sn1
+	n2 = sn2
+	DO 1210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 1210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 1210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 1210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 1210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 1210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. com2(i2,j2,k2,l2,m2,n2) ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = op_repl
+	      ENDIF
+	   ENDIF
+ 1210	CONTINUE
+	RETURN
+
+* "NE" - mask of 1's where grids are not equal, 0's elsewhere
+ 1300	n1 = sn1
+	n2 = sn2
+	DO 1310 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 1310 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 1310 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 1310 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 1310 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 1310 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      IF ( com1(i1,j1,k1,l1,m1,n1) .NE. com2(i2,j2,k2,l2,m2,n2) ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = op_repl
+	      ENDIF
+	   ENDIF
+ 1310	CONTINUE
+	RETURN
+
+ 1400	CONTINUE
+ 1500	CONTINUE
+ 1600	CONTINUE
+ 1700	CONTINUE
+ 1800	CONTINUE
+	STOP 'OPERATOR NOT IMPLEMENTED'
+* -----------------------------------------------------------------------------
+* -------- FUNCTIONS ------------
+
+* "EXP" - exponential function
+ 1900	DO 1910 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 1910 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 1910 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 1910 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 1910 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 1910 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1
+     .     .OR. com1(i,j,k,l,m,n) .GT. 77.0 ) THEN    ! 8/92
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = EXP(com1(i,j,k,l,m,n))
+	   ENDIF
+ 1910	CONTINUE
+	RETURN
+
+* "LOG"
+ 2000	DO 2010 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2010 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2010 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  DO 2010 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2010 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2010 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1
+     .    .OR.  com1(i,j,k,l,m,n) .LE. 0.0 ) THEN    ! 8/92
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = LOG10( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2010	CONTINUE
+	RETURN
+
+* "MAX"
+ 2100	n1 = sn1
+	n2 = sn2
+	DO 2110 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 2110 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 2110 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 2110 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 2110 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 2110 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = MAX( com1(i1,j1,k1,l1,m1,n1), com2(i2,j2,k2,l2,m2,n2) )
+	   ENDIF
+
+ 2110	CONTINUE
+	RETURN
+
+* "MIN"
+ 2200	n1 = sn1
+	n2 = sn2
+	DO 2210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 2210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 2210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 2210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 2210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 2210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = MIN( com1(i1,j1,k1,l1,m1,n1), com2(i2,j2,k2,l2,m2,n2) )
+	   ENDIF
+ 2210	CONTINUE
+	RETURN
+
+* "INT"
+ 2300	DO 2310 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2310 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2310 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2310 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2310 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2310 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = INT( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2310	CONTINUE
+	RETURN
+
+* "ABS"
+ 2400	DO 2410 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2410 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2410 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2410 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2410 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2410 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = ABS( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2410	CONTINUE
+	RETURN
+
+* "SIN"
+ 2500	DO 2510 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2510 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2510 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2510 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2510 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2510 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = SIN( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2510	CONTINUE
+	RETURN
+
+* "COS"
+ 2600	DO 2610 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2610 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2610 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2610 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2610 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2610 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = COS( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2610	CONTINUE
+	RETURN
+
+* "TAN"
+ 2700	DO 2710 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2710 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2710 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2710 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2710 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2710 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = TAN( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2710	CONTINUE
+	RETURN
+
+* "LN"
+ 2800	DO 2810 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 2810 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 2810 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 2810 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 2810 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 2810 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1
+     .    .OR.  com1(i,j,k,l,m,n) .LE. 0.0 ) THEN    ! 8/92
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = LOG( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 2810	CONTINUE
+	RETURN
+
+* "MOD"
+ 2900	n1 = sn1
+	n2 = sn2
+	DO 2910 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 2910 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 2910 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 2910 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 2910 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 2910 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = MOD( com1(i1,j1,k1,l1,m1,n1), com2(i2,j2,k2,l2,m2,n2) )
+	   ENDIF
+ 2910	CONTINUE
+	RETURN
+
+* "MISSING" - replace missing value flag with values in grid 2
+ 3000	n1 = sn1
+	n2 = sn2
+	DO 3010 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 3010 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 3010 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 3010 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 3010 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 3010 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1 ) THEN
+              res(i,j,k,l,m,n) = com1(i1,j1,k1,l1,m1,n1)
+           ELSEIF ( com2(i2,j2,k2,l2,m2,n2) .NE. bad2 ) THEN
+              res(i,j,k,l,m,n) = com2(i2,j2,k2,l2,m2,n2)
+           ELSE
+              res(i,j,k,l,m,n) = bad_res
+           ENDIF
+
+ 3010	CONTINUE
+	RETURN
+
+* "IGNORE0" - replace zeros with bad flags
+ 3100	DO 3110 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3110 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3110 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3110 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3110 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3110 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSEIF ( com1(i,j,k,l,m,n) .EQ. 0 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = com1(i,j,k,l,m,n)
+	   ENDIF
+ 3110	CONTINUE
+	RETURN
+
+* "ATAN"
+ 3200	DO 3210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = ATAN( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 3210	CONTINUE
+	RETURN
+
+* "ATAN2" - 2 argument arc tangent
+ 3300	n1 = sn1
+	n2 = sn2
+	DO 3310 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 3310 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 3310 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 3310 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 3310 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 3310 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .	   .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSEIF ( com1(i1,j1,k1,l1,m1,n1) .EQ. 0.0
+     .	   .AND.    com2(i2,j2,k2,l2,m2,n2) .EQ. 0.0 ) THEN
+	      res(i,j,k,l,m,n) = bad_res	! indeterminant
+	   ELSE
+	      res(i,j,k,l,m,n) = ATAN2( com1(i1,j1,k1,l1,m1,n1),com2(i2,j2,k2,l2,m2,n2) )
+	   ENDIF
+
+ 3310	CONTINUE
+	RETURN
+
+* "ASIN"
+ 3400	DO 3410 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3410 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3410 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3410 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3410 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3410 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1
+     .     .OR. com1(i,j,k,l,m,n) .LT. -1.
+     .     .OR. com1(i,j,k,l,m,n) .GT. +1. ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = ASIN( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 3410	CONTINUE
+	RETURN
+
+* "ACOS"
+ 3500	DO 3510 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3510 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3510 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3510 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3510 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3510 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1
+     .     .OR. com1(i,j,k,l,m,n) .LT. -1.
+     .     .OR. com1(i,j,k,l,m,n) .GT. +1. ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      res(i,j,k,l,m,n) = ACOS( com1(i,j,k,l,m,n) )
+	   ENDIF
+ 3510	CONTINUE
+	RETURN
+
+* "RANDU" - random uniform
+* use the first value as the seed
+ 3600	first = .TRUE.
+	DO 3610 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3610 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3610 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3610 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3610 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3610 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSEIF ( first ) THEN
+* ... note: floating point representation is passed as seed integer
+              R_IN = REAL(com1(i,j,k,l,m,n))  ! for possibly double-prec. arg
+	      res(i,j,k,l,m,n) = RANDU( R_IN )
+	      first = .FALSE.
+	   ELSE
+              R_IN = 0.
+	      res(i,j,k,l,m,n) = RANDU(R_IN)			!kob 12/96
+	   ENDIF
+ 3610	CONTINUE
+	RETURN
+
+* "RANDN" - random normal
+* use the first value as the seed
+ 3700	first = .TRUE.
+	DO 3710 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 3710 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 3710 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 3710 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 3710 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 3710 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSEIF ( first ) THEN
+* ... note: floating point representation is passed as seed integer
+              R_IN = REAL(com1(i,j,k,l,m,n))  ! for possibly double-prec. arg
+	      res(i,j,k,l,m,n) = RANDN( R_IN )
+	      first = .FALSE.
+	   ELSE
+              R_IN = 0.
+	      res(i,j,k,l,m,n) = RANDN(R_IN)			!kob 12/96
+	   ENDIF
+ 3710	CONTINUE
+	RETURN
+
+* "RHO" - UNESCO equation of state:
+* rho = rho(salinity, temperature, pressure)
+* three components - each may be a different XYZT shape
+ 3800	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 3810 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	 DO 3810 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 3810 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	   DO 3810 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	    DO 3810 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    j3 = j3 + dj3
+	    i1 = si1
+	    i2 = si2
+	    i3 = si3
+	     DO 3810 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+	     i3 = i3 + di3
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2
+     .     .OR. com3(i3,j3,k3,l3,m3,n3) .EQ. bad3
+     .     .OR. com1(i1,j1,k1,l1,m1,n1) .LT. 0.0   ) THEN  ! salt>0 8/92
+              res(i,j,k,l,m,n) = bad_res
+           ELSE
+              res(i,j,k,l,m,n) = RHO_UNESCO( com1(i1,j1,k1,l1,m1,n1),
+     .                                   com2(i2,j2,k2,l2,m2,n2),
+     .                                   com3(i3,j3,k3,l3,m3,n3) )
+           ENDIF
+
+ 3810	CONTINUE
+	RETURN
+
+* "THETA" - potential temperature from BRYDEN,H.,1973,DEEP-SEA RES
+*           and FOFONOFF,N,M,1977,DEEP-SEA RES
+* theta = theta(salinity, temperature, pressure,reference_pressure)
+* three components - each may be a different XYZT shape
+ 3900	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	n4 = sn4
+	DO 3910 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	n4 = n4 + dn4
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	m4 = sm4
+	 DO 3910 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	 m4 = m4 + dm4
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  l4 = sl4
+	  DO 3910 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  l4 = l4 + dl4
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	  k4 = sk4
+	   DO 3910 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   k4 = k4 + dk4
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	   j4 = sj4
+	  DO 3910 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	  j1 = j1 + dj1
+	  j2 = j2 + dj2
+	  j3 = j3 + dj3
+	  j4 = j4 + dj4
+	  i1 = si1
+	  i2 = si2
+	  i3 = si3
+	  i4 = si4
+	   DO 3910 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	   i1 = i1 + di1
+	   i2 = i2 + di2
+	   i3 = i3 + di3
+	   i4 = i4 + di4
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2
+     .     .OR. com3(i3,j3,k3,l3,m3,n3) .EQ. bad3
+     .     .OR. com4(i4,j4,k4,l4,m4,n4) .EQ. bad4 ) THEN
+              res(i,j,k,l,m,n) = bad_res
+           ELSE
+              res(i,j,k,l,m,n) = THETA_FOFF( com1(i1,j1,k1,l1,m1,n1),
+     .                                   com2(i2,j2,k2,l2,m2,n2),
+     .                                   com3(i3,j3,k3,l3,m3,n3),
+     .                                   com4(i4,j4,k4,l4,m4,n4) )
+           ENDIF
+
+ 3910	CONTINUE
+	RETURN
+
+* "DAYS1900(year, month, day)" - number of days since 1900
+* three components - each may be a different XYZT shape
+* *** note: returns days since 1-jan-1900, on the STANDARD CALENDAR
+
+ 4000	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 4010 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	 DO 4010 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 4010 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	   DO 4010 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	    DO 4010 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    j3 = j3 + dj3
+	    i1 = si1
+	    i2 = si2
+	    i3 = si3
+	     DO 4010 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+	     i3 = i3 + di3
+
+* 4/98, 2nd references to com2, com3 incorrectly used i1,etc for array references
+*       fixed that up - kob
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .EQ. bad1
+     .     .OR. com2(i2,j2,k2,l2,m2,n2) .EQ. bad2
+     .     .OR. com3(i3,j3,k3,l3,m3,n3) .EQ. bad3
+     .     .OR. com2(i2,j2,k2,l2,m2,n2) .GT. 12.0
+     .     .OR. com2(i2,j2,k2,l2,m2,n2) .LT. 1.0
+     .     .OR. com3(i3,j3,k3,l3,m3,n3) .LT. 0.0    ) THEN
+              res(i,j,k,l,m,n) = bad_res
+           ELSE
+              res(i,j,k,l,m,n) = DAYS_FROM_DAY0( pdays_by_1900,
+     .					     INT(com1(i1,j1,k1,l1,m1,n1)),
+     .                                       INT(com2(i2,j2,k2,l2,m2,n2)),
+     .                                       INT(com3(i3,j3,k3,l3,m3,n3)),
+     .                                       dummy)
+           ENDIF
+
+ 4010	CONTINUE
+	RETURN
+
+
+* "RANDU2" - random uniform 
+* Call the gfortran RANDOM_SEED and RANDOM_SEED functions.
+* See ticket 1886 for discussions of RANDU
+*
+* iseed = 0   use previous seed - don't reinitialize
+* iseed = -1 initialize using system clock
+* iseed = integer > 0 initialize using that integer: results will be repeatable
+
+ 4100	CONTINUE
+	n2 = sn2
+	m2 = sm2
+	l2 = sl2
+	k2 = sk2
+	j2 = sj2
+	i2 = si2
+        inseed = INT(com2(i2,j2,k2,l2,m2,n2))
+        CALL INIT_RANDOM_SEED(inseed)
+	DO 4110 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 4110 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 4110 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 4110 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 4110 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 4110 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSE
+	      CALL RANDOM_NUMBER(res(i,j,k,l,m,n))
+	   ENDIF
+ 4110	CONTINUE
+	RETURN
+
+* "RANDN2" - random normal using gfortran RANDOM_SEED and RANDOM_SEED functions.
+* seed set as for RANDU2
+ 4200	CONTINUE
+	n2 = sn2
+	m2 = sm2
+	l2 = sl2
+	k2 = sk2
+	j2 = sj2
+	i2 = si2
+	first = .TRUE.
+        inseed = INT(com2(i2,j2,k2,l2,m2,n2))
+	DO 4210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 DO 4210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  DO 4210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 4210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	    DO 4210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	     DO 4210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	   IF ( com1(i,j,k,l,m,n) .EQ. bad1 ) THEN
+	      res(i,j,k,l,m,n) = bad_res
+	   ELSEIF ( first ) THEN
+	      res(i,j,k,l,m,n) = RANDN2( inseed )
+	      first = .FALSE.
+	   ELSE
+	      res(i,j,k,l,m,n) = RANDN2(0)
+	   ENDIF
+
+ 4210	CONTINUE
+	RETURN
+
+ 4300	CONTINUE
+	STOP 'FUNCTION NOT IMPLEMENTED'
+
+* ----------------------------------------------------------------------------
+* ------- LOGIC STRUCTURES -------------
+*
+ 4400	CONTINUE
+* "THEN" - comes from IF (condition) THEN (choice)   ... no "ELSE" given
+* component 1 is the condition.  component 2 is the choice
+ 4500	n1 = sn1
+	n2 = sn2
+	DO 4510 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 4510 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 4510 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 4510 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 4510 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 4510 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1
+     .	  .AND. com1(i1,j1,k1,l1,m1,n1) .NE. 0.0
+     .	  .AND. com2(i2,j2,k2,l2,m2,n2) .NE. bad2	 ) THEN
+	      res(i,j,k,l,m,n) = com2(i2,j2,k2,l2,m2,n2)
+	   ELSE
+	      res(i,j,k,l,m,n) = bad_res
+	   ENDIF
+
+ 4510	CONTINUE
+	RETURN
+* "ELSE" - comes from IF (condition) THEN (choice1) ELSE (choice2)
+* component 1 is the condition.  components 2 and 3 are the choices
+ 4600	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 4610 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	 DO 4610 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 4610 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	   DO 4610 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	    DO 4610 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    j3 = j3 + dj3
+	    i1 = si1
+	    i2 = si2
+	    i3 = si3
+	     DO 4610 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+	     i3 = i3 + di3
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1
+     .	  .AND. com1(i1,j1,k1,l1,m1,n1) .NE. 0.0 ) THEN
+	      IF ( com2(i2,j2,k2,l2,m2,n2) .NE. bad2 ) THEN
+	         res(i,j,k,l,m,n) = com2(i2,j2,k2,l2,m2,n2)
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+	   ELSE
+	      IF ( com3(i3,j3,k3,l3,m3,n3) .NE. bad3 ) THEN
+	         res(i,j,k,l,m,n) = com3(i3,j3,k3,l3,m3,n3)
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+	   ENDIF
+ 4610	CONTINUE
+	RETURN
+
+* "THEN" - comes from IFV (condition) THEN (choice)   ... no "ELSE" given
+* component 1 is the condition.  component 2 is the choice
+ 4700	n1 = sn1
+	n2 = sn2
+	DO 4710 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 4710 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 4710 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 4710 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 4710 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 4710 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1
+     .	  .AND. com2(i2,j2,k2,l2,m2,n2) .NE. bad2	 ) THEN
+	      res(i,j,k,l,m,n) = com2(i2,j2,k2,l2,m2,n2)
+	   ELSE
+	      res(i,j,k,l,m,n) = bad_res
+	   ENDIF
+
+ 4710	CONTINUE
+	RETURN
+* "ELSE" - comes from IFV (condition) THEN (choice1) ELSE (choice2)
+* component 1 is the condition.  components 2 and 3 are the choices
+ 4800	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 4810 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	 DO 4810 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 4810 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	   DO 4810 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	    DO 4810 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    j3 = j3 + dj3
+	    i1 = si1
+	    i2 = si2
+	    i3 = si3
+	     DO 4810 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+	     i3 = i3 + di3
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1 ) THEN
+	      IF ( com2(i2,j2,k2,l2,m2,n2) .NE. bad2 ) THEN
+	         res(i,j,k,l,m,n) = com2(i2,j2,k2,l2,m2,n2)
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+	   ELSE
+	      IF ( com3(i3,j3,k3,l3,m3,n3) .NE. bad3 ) THEN
+	         res(i,j,k,l,m,n) = com3(i3,j3,k3,l3,m3,n3)
+	      ELSE
+	         res(i,j,k,l,m,n) = bad_res
+	      ENDIF
+	   ENDIF
+ 4810	CONTINUE
+
+	RETURN
+
+* error exits
+! 9000	RETURN
+	END
diff --git a/fer/stk/pass_ambig_lims.F b/fer/stk/pass_ambig_lims.F
new file mode 100644
index 0000000..7d18981
--- /dev/null
+++ b/fer/stk/pass_ambig_lims.F
@@ -0,0 +1,249 @@
+	SUBROUTINE PASS_AMBIG_LIMS( cx, mr, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* for axes in which limits are fully contained in the definition the
+* requesting context limits are not necessarily complete or correct
+* when the variable is computed (via IS_ALGEBRA) the limits are
+* corrected and stored with the memory resident variable.
+* This routine functions to pass those corrected limits back to the
+* requesting context when that memory resident data is re-accessed.
+
+* In one case the limits are not restrictive (e.g. DEFINE VAR NEW=U[K=1:5]
+* which may be used via LOAD NEW[K=2:3] or LOAD NEW )
+* and the requesting context limits should be used if they are given explicitly
+* otherwise the full limits of the variable will be passed back.
+* This is the case of uvlim_gvn_gnl (a non-restrictive range given in def'n)
+
+* In a second case limits are restrictive (e.g. DEFINE VAR NEW=U[K=1:3 at AVE])
+* and the requesting context must be an exact hit if given explicitly.
+* This is the case of uvlim_gvn_xact (an exact range given in the def'n)
+
+* (uvlim_need_xact): Also, if a compressing transformation is specified
+* within user-defined variables but limits are not given.  For example,
+*	yes? DEFINE VAR KAVE = U[K=@AVE]
+*	yes? LIST/K=1:3 KAVE
+* The computed and stored context will have the correct Z world coord limits
+* but will have K=-9999:-9999 (since it has been reduced to a point)
+* The context used in searching will have K=1:3, incorrectly.
+* Thus, unpecified_int4 subscript values must be passed back.
+
+* Also, since data may be grabbed with limits completely unspecified
+* (determined automatically from the file limits) the context limits may
+* be unspecified although the mr variable limits are known.
+* Pass back the mr limits.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/22/89
+*	10/25/89 - allow unspecified context limits
+*	 5/16/90 - allow file data to come back with smaller limits than
+*		   requested --> context limits .GT. memory var. size
+* Unix/RISC port - 8/12/91 *sh*
+*     bug fix that needs to be applied to VMS version, too
+*     see "8/12/91" below
+*     8/28/91 - fix the 5/90 "kludge" so it cant result in lo>hi
+* V230:  6/10/92 - bug fix for err220_unspec_limits.jnl
+*                  CANCEL REGION;SET REG/K=1/L=1;STAT TEMP-TEMP[I=@AVE]
+*                  results in unspecified world coord limits on I axis
+*        11/4/92 - expanded variable name length
+* V420:  11/95 - error conditions loosened to match the documentation
+* V450:   1/97   - fix to never-observed bug: the check
+*		        "uvar_given(idim,var) .LE. uvlim_gvn_xact"
+*		   ignores the possibility of uvlim_irrelevant
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars 
+* V510: *sh* 12/99 - support for uvlim_hiddef (EF caching)
+* V530:  8/00 *sh* - added cx_type support
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+        include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER	cx, mr, status
+
+* local variable declarations
+	INTEGER		idim, uvar
+	CHARACTER	VAR_CODE*128
+
+* initialize
+	uvar = mr_variable( mr )
+
+* data set:
+* uvar data set is not necessarily the same as the searching context
+	IF ( .NOT.uvar_need_dset(uvar) ) cx_data_set(cx)=mr_data_set(mr)
+
+* take bad data flag from the memory resident result
+	cx_bad_data( cx ) = mr_bad_data( mr )
+	
+* take data type from the memory resident result
+	cx_type( cx ) = mr_type( mr )
+	
+* axis limits and subscripts:
+	DO 100 idim = 1, nferdims
+
+* error checks:
+	   IF ( cx_given(idim,cx) ) THEN
+	      IF ( uvar_given(idim,uvar) .EQ. uvlim_gvn_gnl
+     .	      .OR. uvar_given(idim,uvar) .EQ. uvlim_hidden ) THEN
+* ... suppose DEFINE VARIABLE NEW=TEMP[K=1:3]
+* ... then    LIST NEW[K=5] doesn't make sense
+	         IF ( mr_lo_ww(idim,mr).GT.cx_hi_ww(idim,cx)
+     .           .OR. mr_hi_ww(idim,mr).LT.cx_lo_ww(idim,cx) ) GOTO 5100
+!pre 11/95            IF ( mr_lo_ww(idim,mr).GT.cx_lo_ww(idim,cx)
+!pre 11/95 .           .OR. mr_hi_ww(idim,mr).LT.cx_hi_ww(idim,cx) ) GOTO 5100
+	      ELSEIF ( uvar_given(idim,uvar) .EQ. uvlim_gvn_xact ) THEN
+* ... suppose DEFINE VARIABLE NEW=TEMP[K=1:3 at AVE]
+* ... then    LIST NEW[K=1:2] doesn't make sense
+* 11/95 - not an error - just ignore the K=1:2 limits in the example
+	         IF ( mr_lo_ww(idim,mr).NE.cx_lo_ww(idim,cx)
+     .           .OR. mr_hi_ww(idim,mr).NE.cx_hi_ww(idim,cx) ) THEN
+	            cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+	            cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+	            cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+	            cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+	         ENDIF
+!pre 11/95      IF ( mr_lo_ww(idim,mr).NE.cx_lo_ww(idim,cx)
+!pre 11/95.    .OR. mr_hi_ww(idim,mr).NE.cx_hi_ww(idim,cx) ) GOTO 5100
+	      ENDIF
+	   ENDIF
+
+* pass limits back
+	   IF (   uvar_given(idim,uvar) .EQ. uvlim_gvn_xact
+     .	   .OR. ( ( uvar_given(idim,uvar) .EQ. uvlim_gvn_gnl
+     .	   .OR.     uvar_given(idim,uvar) .EQ. uvlim_hidden )
+     .		  .AND. .NOT.cx_given(idim,cx) )	    ) THEN
+
+	         cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+	         cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+	         cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+	         cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+
+	   ELSEIF ( uvar_given(idim,uvar) .EQ. uvlim_need_xact ) THEN
+	      cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+	      cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+! 6/92 bug fix: (possibly the IF test isn't needed - it's here to minimize
+!                impacts of this fix)
+              IF ( cx_lo_ww(idim,cx) .EQ. unspecified_val8
+     .       .AND. mr_lo_ww(idim,mr) .NE. unspecified_val8 ) THEN
+	         cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+	         cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+              ENDIF
+
+* all abstract variables live on grid ABSTRACT, however,
+* an expression like X+Y is normal to Z and T so they are flagged as irrelevant
+	   ELSEIF ( uvar_given(idim,uvar) .EQ. uvlim_irrelevant ) THEN
+	      cx_lo_ss(cx,idim) = unspecified_int4
+	      cx_hi_ss(cx,idim) = unspecified_int4
+	      cx_lo_ww(idim,cx) = unspecified_val8
+	      cx_hi_ww(idim,cx) = unspecified_val8
+* 9/97 *kob* cx_calendar must reflect these changes as well	  
+	      IF (idim .EQ. t_dim) 
+     .                cx_calendar(cx) = .FALSE.
+
+* context limits unspecified but untransformed data limits available anyway
+	   ELSEIF ( cx_lo_ss(cx,idim) .EQ. unspecified_int4 ) THEN
+	      cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+	      cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+	      cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+	      cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+
+	   ENDIF
+
+* 8/12/91 bug fix during Unix port
+* this is not known to be the perfect fix (kludge)...
+* User-defined variables that have explicit limits given in their definitions
+* need to pass that information to the context that is requesting them
+* in, for example:  LET MASK=TEMP[L=1]
+*                   STAT/L=2 MASK*TEMP
+* the expression needs to be evaluated as if it were MASK[L=1]*TEMP
+! 1/97 - check against uvlim_irrelevant just to be thorough
+           IF ( uvar_given(idim,uvar) .LE. uvlim_gvn_xact
+     .    .OR.  uvar_given(idim,uvar) .EQ. uvlim_irrelevant  )
+     .                               cx_given(idim,cx) = .TRUE.
+
+* a bit of a kludge ... for some expressions with @AVE, etc. the cx subscript
+* limits don't get set to unspecified.  Too lazy to find the "right" sol'n.
+	   IF ( mr_lo_ss(mr,idim) .EQ. unspecified_int4 ) THEN
+	      cx_lo_ss(cx,idim) = unspecified_int4
+	      cx_hi_ss(cx,idim) = unspecified_int4
+	   ENDIF
+
+* another kludge (5/90) file data may come back smaller than
+* requested --> calculated results from it will be smaller, too
+	   IF ( cx_lo_ss(cx,idim) .LT. mr_lo_ss(mr,idim) ) THEN
+	      cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+	      cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+*     8/28/91 - don't allow limits to be reversed: kludge patch
+              IF ( cx_lo_ss(cx,idim) .GT.cx_hi_ss(cx,idim) ) THEN
+                 cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+                 cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+              ENDIF
+	   ENDIF
+	   IF ( cx_hi_ss(cx,idim) .GT. mr_hi_ss(mr,idim) ) THEN
+	      cx_hi_ss(cx,idim) = mr_hi_ss(mr,idim)
+	      cx_hi_ww(idim,cx) = mr_hi_ww(idim,mr)
+*     8/28/91 - don't allow limits to be reversed: kludge patch
+              IF ( cx_lo_ss(cx,idim) .GT.cx_hi_ss(cx,idim) ) THEN
+                 cx_lo_ss(cx,idim) = mr_lo_ss(mr,idim)
+                 cx_lo_ww(idim,cx) = mr_lo_ww(idim,mr)
+              ENDIF
+	   ENDIF
+
+ 100	CONTINUE
+
+* success
+	status = ferr_ok
+	RETURN
+
+* error
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_limits, status,
+     .		ww_dim_name(idim)//
+     .		' axis limits don''t match variable def''n: '//
+     .		VAR_CODE( cat_user_var, uvar )//pCR//
+     .	'Are you giving explicit limits when SET REGION would suffice ?',
+     .	*5000 )
+	END
diff --git a/fer/stk/potent_size.F b/fer/stk/potent_size.F
new file mode 100644
index 0000000..6161682
--- /dev/null
+++ b/fer/stk/potent_size.F
@@ -0,0 +1,80 @@
+	INTEGER FUNCTION POTENT_SIZE ( cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the "potential" size of context cx - that is, the total number of
+* values that will need to be accessed in order to perform the indicated
+* compressing transformations (transf. that reduce axis to a point)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/8/89
+*	8/29/89 - special treatment of interpolation
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+ 
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx
+
+* internal variable declarations:
+	INTEGER	CGRID_SIZE, idim, status
+
+* make a copy of the context in a scratch buffer
+	CALL TRANSFER_CONTEXT( cx, cx_buff )
+
+* expand all the compressing transformations
+	DO 100 idim = 1, nferdims
+	   IF ( cx_trans(idim,cx) .EQ. trans_interpolate ) THEN
+	      cx_trans(idim,cx_buff) = trans_no_transform
+	      cx_lo_ss(cx_buff,idim) = 1
+	      cx_hi_ss(cx_buff,idim) = 2
+	   ELSEIF ( cx_trans(idim,cx) .GT. trans_compress_code ) THEN
+	      cx_trans(idim,cx_buff) = trans_no_transform
+	      cx_by_ss(idim,cx_buff) = .FALSE.
+	      CALL FLESH_OUT_AXIS( idim, cx_buff, status )	! ignore status
+	   ENDIF
+ 100	CONTINUE
+
+* now, what's the size of the result ?
+	POTENT_SIZE = CGRID_SIZE( cx_buff )
+
+	RETURN
+	END
diff --git a/fer/stk/push_interp_stack.F b/fer/stk/push_interp_stack.F
new file mode 100644
index 0000000..dd9255e
--- /dev/null
+++ b/fer/stk/push_interp_stack.F
@@ -0,0 +1,82 @@
+	SUBROUTINE PUSH_INTERP_STACK( level, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* push the interpretation stack pointer to the next higher level and copy
+* the most common objects to the new level
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 2/19/87
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* v690 2/2014 *sh* stack max limited to max_usable_intrp to fit aux frames at top
+ 
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER		level, status
+
+* internal variable declarations:
+	INTEGER	source_level
+
+* save level from which to copy stack info.
+	source_level = level
+
+* push the stack pointer
+	CALL STACK_PTR_UP( isp, max_usable_intrp, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* copy some stack info
+	is_obj    ( isp ) = is_obj      ( source_level )
+	is_uvar   ( isp ) = is_uvar     ( source_level )
+	is_cx     ( isp ) = is_cx       ( source_level )
+	is_aux_ptr( isp ) = is_aux_ptr  ( source_level )
+
+* ! temp - blank out rest of stack to avoid undetected bugs
+	is_act      ( isp ) = unspecified_int4
+	is_big_cx   ( isp ) = unspecified_int4
+	is_phase    ( isp ) = unspecified_int4
+	is_axis     ( isp ) = unspecified_int4
+	is_mr       ( isp ) = unspecified_int4
+	is_sum      ( isp ) = -777.
+
+	RETURN
+	END
diff --git a/fer/stk/randn.F b/fer/stk/randn.F
new file mode 100644
index 0000000..1b92685
--- /dev/null
+++ b/fer/stk/randn.F
@@ -0,0 +1,87 @@
+      REAL FUNCTION RANDN(jd)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute a quasi-random number with a standard normal distribution
+* based on the routine "GASDEV" on p.203 of Numerical Recipes
+* W.H.Press,B.P.Flannery,S.A.Teukolsky,W.T.Vetterling
+
+* uses routine RANDU to supply normal deviates
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  3/29/90
+* V6.8 for double-precision Ferret do the RANDU calculation
+*      with a real*4 argument. Gives consistent results with single-p.
+
+* calling argument declarations:
+	INTEGER	jd
+
+* internal variable declarations:
+	LOGICAL saved
+	REAL	RANDU, v1, v2, r, fac, rsave
+	REAL*4	rzero
+
+	rzero = 0.
+
+* initialize the uniform and this random generator
+	IF ( jd.NE.0 ) THEN
+	   v1 = RANDU(jd)
+	   saved = .FALSE.
+	ENDIF
+
+	IF ( saved ) THEN
+* ... use the one saved last time
+	   RANDN = rsave
+	   saved = .FALSE.
+
+	ELSE
+* ... compute 2 normal from 2 uniforms, return 1, save 1
+ 10	   v1 = 2. * RANDU(rzero) - 1.
+	   v2 = 2. * RANDU(rzero) - 1.
+	   r  = v1**2 + v2**2
+	   IF ( r .GE. 1 ) GOTO 10	! not inside unit circle ?
+	   fac = SQRT(-2.*LOG(r)/r)	   
+	   rsave = v1*fac
+	   RANDN = v2*fac
+	   saved = .TRUE.
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/stk/randn2.F b/fer/stk/randn2.F
new file mode 100644
index 0000000..49ebe5f
--- /dev/null
+++ b/fer/stk/randn2.F
@@ -0,0 +1,88 @@
+      REAL FUNCTION RANDN2(jd)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute a quasi-random number with a standard normal distribution
+* based on the routine "GASDEV" on p.203 of Numerical Recipes
+* W.H.Press,B.P.Flannery,S.A.Teukolsky,W.T.Vetterling
+
+* uses routine RANDU to supply normal deviates
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  3/29/90
+* 9/2011
+* Our old RANDU function could return 1. See ticket 1886
+* Replace calls to RANDU w/ gfortran RANDOM_SEED and RANDOM_NUMBER
+
+
+* calling argument declarations:
+	INTEGER	jd
+
+* internal variable declarations:
+	LOGICAL saved
+	REAL	r1, r2, v1, v2, r, fac, rsave
+
+* initialize the uniform and this random generator
+	IF ( jd.NE.0 ) THEN
+	   CALL INIT_RANDOM_SEED(jd)
+	   saved = .FALSE.
+	ENDIF
+
+	IF ( saved ) THEN
+* ... use the one saved last time
+	   RANDN2 = rsave
+	   saved = .FALSE.
+
+	ELSE
+* ... compute 2 normal from 2 uniforms, return 1, save 1
+ 10	   CALL RANDOM_NUMBER(r1)
+	   CALL RANDOM_NUMBER(r2)
+	   v1 = 2. * r1 - 1.
+	   v2 = 2. * r2 - 1.
+	   r  = v1**2 + v2**2
+	   IF ( r .GE. 1 ) GOTO 10	! not inside unit circle ?
+	   fac = SQRT(-2.*LOG(r)/r)	   
+	   rsave = v1*fac
+	   RANDN2 = v2*fac
+	   saved = .TRUE.
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/stk/randu.F b/fer/stk/randu.F
new file mode 100644
index 0000000..30730c5
--- /dev/null
+++ b/fer/stk/randu.F
@@ -0,0 +1,147 @@
+      REAL FUNCTION RANDU(JD)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* modified by steve hankin to contain explicit declarations
+* and renamed RANDU from "UNI" in its original version from CMLIB
+	INTEGER	JD,MDIG,I1MACH,M1,M2,JSEED,K0,K1,J0,J1,I,J,K
+
+C***BEGIN PROLOGUE  UNI
+C***DATE WRITTEN   810915
+C***REVISION DATE  830805
+C***CATEGORY NO.  L6A21
+C***KEYWORDS  RANDOM NUMBERS, UNIFORM RANDOM NUMBERS
+C***AUTHOR    BLUE, JAMES, SCIENTIFIC COMPUTING DIVISION, NBS
+C             KAHANER, DAVID, SCIENTIFIC COMPUTING DIVISION, NBS
+C             MARSAGLIA, GEORGE, COMPUTER SCIENCE DEPT., WASH STATE UNIV
+C
+C***PURPOSE  THIS ROUTINE GENERATES QUASI UNIFORM RANDOM NUMBERS ON [0,1
+C             AND CAN BE USED ON ANY COMPUTER WITH WHICH ALLOWS INTEGERS
+C             AT LEAST AS LARGE AS 32767.
+C***DESCRIPTION
+C
+C       THIS ROUTINE GENERATES QUASI UNIFORM RANDOM NUMBERS ON THE INTER
+C       [0,1).  IT CAN BE USED WITH ANY COMPUTER WHICH ALLOWS
+C       INTEGERS AT LEAST AS LARGE AS 32767.
+C
+C
+C   USE
+C       FIRST TIME....
+C                   Z = UNI(JD)
+C                     HERE JD IS ANY  N O N - Z E R O  INTEGER.
+C                     THIS CAUSES INITIALIZATION OF THE PROGRAM
+C                     AND THE FIRST RANDOM NUMBER TO BE RETURNED AS Z.
+C       SUBSEQUENT TIMES...
+C                   Z = UNI(0)
+C                     CAUSES THE NEXT RANDOM NUMBER TO BE RETURNED AS Z.
+C
+C
+C..................................................................
+C   NOTE: USERS WHO WISH TO TRANSPORT THIS PROGRAM FROM ONE COMPUTER
+C         TO ANOTHER SHOULD READ THE FOLLOWING INFORMATION.....
+C
+C   MACHINE DEPENDENCIES...
+C      MDIG = A LOWER BOUND ON THE NUMBER OF BINARY DIGITS AVAILABLE
+C              FOR REPRESENTING INTEGERS, INCLUDING THE SIGN BIT.
+C              THIS VALUE MUST BE AT LEAST 16, BUT MAY BE INCREASED
+C              IN LINE WITH REMARK A BELOW.
+C
+C   REMARKS...
+C     A. THIS PROGRAM CAN BE USED IN TWO WAYS:
+C        (1) TO OBTAIN REPEATABLE RESULTS ON DIFFERENT COMPUTERS,
+C            SET 'MDIG' TO THE SMALLEST OF ITS VALUES ON EACH, OR,
+C        (2) TO ALLOW THE LONGEST SEQUENCE OF RANDOM NUMBERS TO BE
+C            GENERATED WITHOUT CYCLING (REPEATING) SET 'MDIG' TO THE
+C            LARGEST POSSIBLE VALUE.
+C     B. THE SEQUENCE OF NUMBERS GENERATED DEPENDS ON THE INITIAL
+C          INPUT 'JD' AS WELL AS THE VALUE OF 'MDIG'.
+C          IF MDIG=16 ONE SHOULD FIND THAT
+C            THE FIRST EVALUATION
+C              Z=UNI(305) GIVES Z=.027832881...
+C            THE SECOND EVALUATION
+C              Z=UNI(0) GIVES   Z=.56102176...
+C            THE THIRD EVALUATION
+C              Z=UNI(0) GIVES   Z=.41456343...
+C            THE THOUSANDTH EVALUATION
+C              Z=UNI(0) GIVES   Z=.19797357...
+C
+C***REFERENCES  MARSAGLIA G., "COMMENTS ON THE PERFECT UNIFORM RANDOM
+C                 NUMBER GENERATOR", UNPUBLISHED NOTES, WASH S. U.
+C***ROUTINES CALLED  I1MACH,XERROR
+C***END PROLOGUE  UNI
+      INTEGER M(17)
+C
+      SAVE I,J,M,M1,M2
+C
+      DATA M(1),M(2),M(3),M(4),M(5),M(6),M(7),M(8),M(9),M(10),M(11),
+     1     M(12),M(13),M(14),M(15),M(16),M(17)
+     2                   / 30788,23052,2053,19346,10646,19427,23975,
+     3                     19049,10949,19693,29746,26748,2796,23890,
+     4                     29168,31924,16499 /
+      DATA M1,M2,I,J / 32767,256,5,17 /
+C***FIRST EXECUTABLE STATEMENT  UNI
+      IF(JD .EQ. 0) GO TO 3
+C  FILL
+      MDIG=I1MACH(8)+1
+C          BE SURE THAT MDIG AT LEAST 16...
+      IF(MDIG.LT.16)CALL XERROR('UNI--MDIG LESS THAN 16',22,1,2)
+      M1= 2**(MDIG-2) + (2**(MDIG-2)-1)
+      M2 = 2**(MDIG/2)
+      JSEED = MIN0(IABS(JD),M1)
+      IF( MOD(JSEED,2).EQ.0 ) JSEED=JSEED-1
+      K0 =MOD(9069,M2)
+      K1 = 9069/M2
+      J0 = MOD(JSEED,M2)
+      J1 = JSEED/M2
+      DO 2 I=1,17
+        JSEED = J0*K0
+        J1 = MOD(JSEED/M2+J0*K1+J1*K0,M2/2)
+        J0 = MOD(JSEED,M2)
+    2   M(I) = J0+M2*J1
+      I=5
+      J=17
+C  BEGIN MAIN LOOP HERE
+    3 K=M(I)-M(J)
+      IF(K .LT. 0) K=K+M1
+      M(J)=K
+      I=I-1
+      IF(I .EQ. 0) I=17
+      J=J-1
+      IF(J .EQ. 0) J=17
+!      UNI=FLOAT(K)/FLOAT(M1)
+      RANDU=FLOAT(K)/FLOAT(M1)
+      RETURN
+      END
diff --git a/fer/stk/rcvd_regrid.F b/fer/stk/rcvd_regrid.F
new file mode 100644
index 0000000..4f863e2
--- /dev/null
+++ b/fer/stk/rcvd_regrid.F
@@ -0,0 +1,284 @@
+	SUBROUTINE RCVD_REGRID( src_cx, dst_cx, axis, work, 
+     .				ok_min, ok_max, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given the reveived ("rcvd") source context (of actually available data) and
+* the requested output region determine the limits of the result that can be
+* calculated
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V200:  12/1/89 - extracted from IS_REGRID
+* 	 2/27/90 - if destination is unspecified set it from the source
+* V230:  8/22/92 - special bypass for regridding by association
+* V300:   5/5/93 - special check for source grid with only one point
+*	         - and use single precision check comparing world coords
+*	NOTE: sing. prec. check is risky - consistent w/ regridding algorithms?
+* V402:	 8/16/95 - bug fix: T axis was **assumed** to be calendar
+* V420:	   10/95 - determine regriddable limits for "window" transforms
+*			such as min, max, ...
+*	   11/95 - modulo regridding - source region independent of result
+*	 1/96    - shifted @SUM and @NGD to weighted calcs like @AVE
+* V490:9/97 *kob* - mods to include negative time axis processing
+*   10/6/97  *sh* - added g=@xact regridding 
+* V491:4/98  *sh* - bug fix: @ASN could lead to hi<lo limits
+* V500: 2/99 *sh* - modified behavior when dest region is unspecified -- 
+*		provide full dest axis limits rather than source-data driven
+* V510: 1/00 *sh* - bug fix: destination subscript limits chosen incorrectly
+*		for min, max, ave, etc.
+*		  - bigger work array for DO_WINDOW_REGRID
+* V530   3/01 *acm* alternative calendar axes:  Compare timesteps for source and
+*		    destination axes with respect to one of the calendars.
+* V530: 3/01 *sh* - added rgrd_nearest -- (unrestricted by source lims)
+* V550: 2/02 *sh* - did NOT change CAXIS_LEN to CAXIS_MODLEN
+*		    since subspan modulo default length is N not N+1
+* v580 *acm* 11/04 Store cal_id in cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP. Note the input 
+*                  argument "axis" in this routine is a dimension, 1, 2, ... 
+
+* calling argument declarations:
+	INTEGER	src_cx, dst_cx, axis, work, ok_min, ok_max, status
+
+* internal variable declarations:
+	LOGICAL GEOG_LABEL, ITSA_MODULO_REGRID, calendar, modulo,
+     .		need_margin_check
+	INTEGER ISUBSCRIPT, CAXIS_LEN, TM_GET_CALENDAR_ID,
+     .		dst_where_loest, dst_where_hiest, rgrd_trans,
+     .		src_where_loest, src_where_hiest,
+     .		dst_ss_min, dst_ss_max,
+     .		dst_grid, src_grid,
+     .		dst_lo_ss, dst_hi_ss,
+     .          src_taxis, dst_taxis, src_cal_id, dst_cal_id
+	REAL*8	TWORLD, TM_WORLD, SECS_TO_TSTEP,
+     .		src_lo_ww, src_hi_ww, dst_lo_ww, dst_hi_ww,
+     .          tmp_lo_ww, tmp_hi_ww, s2d_lo_ww, s2d_hi_ww
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+
+* initialize
+	status = ferr_ok
+	src_grid = cx_grid( src_cx )
+	dst_grid = cx_grid( dst_cx )
+* ... regrid calendar time axes? (src_grid was checked in rqst_regrid)
+	calendar = (axis.EQ.t_dim .OR. axis.EQ.f_dim) .AND. GEOG_LABEL(axis,dst_grid)
+	modulo = ITSA_MODULO_REGRID(dst_cx,axis)
+
+* what is the regridding transformation for this axis ?
+	rgrd_trans = cx_regrid_trans( axis, dst_cx )
+
+* easy bypass for regridding by association
+        IF ( rgrd_trans .EQ. prgrd_associate ) THEN
+           CALL GRID_SUBSCRIPT_EXTREMES(dst_ss_min, dst_ss_max,
+     .                                  dst_grid, axis)
+           dst_lo_ss = MAX( cx_lo_ss(src_cx,axis), dst_ss_min )
+           dst_hi_ss = MIN( cx_hi_ss(src_cx,axis), dst_ss_max )
+	   IF (dst_lo_ss .GT. dst_hi_ss) dst_hi_ss = dst_lo_ss	! 4/98
+           GOTO 500
+
+* ... and easy bypass for regridding by modulo
+* ... set default limits at 1 to n regardless
+* ... (cant use GRID_SS_EXTR because of line_modulo)
+        ELSEIF ( modulo ) THEN
+           dst_lo_ss = 1
+           dst_hi_ss = CAXIS_LEN(axis, dst_cx)
+           GOTO 500
+        ENDIF
+
+* for interpolation we need source points surrounding the destination points
+* for averaging     we need source area   surrounding the destination area
+* for "window"ing   we need source area   containing  the destination area
+* for exact match   we need source points aligning w/ the destination points
+* for nrst match    do as for averaging
+	IF ( rgrd_trans .EQ. prgrd_linear_interp
+     .      .OR. rgrd_trans .EQ. prgrd_xy_lin ) THEN
+	   dst_where_loest = box_middle
+	   dst_where_hiest = box_middle
+	   src_where_loest = box_middle
+	   src_where_hiest = box_middle
+	   need_margin_check = .TRUE.
+	ELSEIF ( rgrd_trans .EQ. prgrd_min
+     .	    .OR. rgrd_trans .EQ. prgrd_max ) THEN
+	   dst_where_loest = box_lo_lim
+	   dst_where_hiest = box_hi_lim
+	   src_where_loest = box_middle
+	   src_where_hiest = box_middle
+	   need_margin_check = .FALSE.
+	ELSEIF ( rgrd_trans .EQ. prgrd_xy_ave
+     .      .OR. rgrd_trans .EQ. prgrd_variance
+     .      .OR. rgrd_trans .EQ. prgrd_sum
+     .      .OR. rgrd_trans .EQ. prgrd_good_pt
+     .	    .OR. rgrd_trans .EQ. prgrd_average
+     .	    .OR. rgrd_trans .EQ. prgrd_nearest ) THEN
+	   dst_where_loest = box_lo_lim
+	   dst_where_hiest = box_hi_lim
+	   src_where_loest = box_lo_lim
+	   src_where_hiest = box_hi_lim
+	   need_margin_check = .FALSE.
+	ELSEIF ( rgrd_trans .EQ. prgrd_xact_pts
+     .	    .OR. rgrd_trans .EQ. prgrd_nearest ) THEN
+	   dst_where_loest = box_middle
+	   dst_where_hiest = box_middle
+	   src_where_loest = box_middle
+	   src_where_hiest = box_middle
+	   need_margin_check = .TRUE.
+	ENDIF
+
+* find the available source region for regridding
+* NOTE:  times expressed as seconds since BC
+	src_lo_ww = TWORLD(cx_lo_ss(src_cx,axis),src_grid,axis,
+     .			   src_where_loest)
+	src_hi_ww = TWORLD(cx_hi_ss(src_cx,axis),src_grid,axis,
+     .			   src_where_hiest)
+
+* find the corresponding subscripts on the destination grid
+* 9/97 *kob* convert time in secs since BC to time position on the 
+*             *source* time axis then call ISUBSCRIPT
+	IF ( calendar ) THEN	! fixed 8/95
+
+* 3/01 *acm* get timestep for source range relative to destination calendar.
+
+	   src_taxis = grid_line(axis, src_grid)
+	   src_cal_id = TM_GET_CALENDAR_ID (line_cal_name(src_taxis) )
+
+	   dst_taxis = grid_line(axis, dst_grid)
+	   dst_cal_id = TM_GET_CALENDAR_ID (line_cal_name(dst_taxis) )
+
+	   IF (src_cal_id .NE. dst_cal_id) THEN
+	      CALL reset_secs_from_bc (src_lo_ww, s2d_lo_ww, 
+     .                                 src_cal_id, dst_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL reset_secs_from_bc (src_hi_ww, s2d_hi_ww, 
+     .                                 src_cal_id, dst_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ELSE
+              s2d_lo_ww = src_lo_ww
+              s2d_hi_ww = src_hi_ww
+	   ENDIF
+
+	   tmp_lo_ww = SECS_TO_TSTEP(dst_grid, axis, s2d_lo_ww)
+	   tmp_hi_ww = SECS_TO_TSTEP(dst_grid, axis, s2d_hi_ww)
+
+	   dst_lo_ss = ISUBSCRIPT( tmp_lo_ww,dst_grid,axis,round_up )
+	   dst_hi_ss = ISUBSCRIPT( tmp_hi_ww,dst_grid,axis,round_dn )
+	ELSE
+	   dst_lo_ss = ISUBSCRIPT( src_lo_ww,dst_grid,axis,round_up )
+	   dst_hi_ss = ISUBSCRIPT( src_hi_ww,dst_grid,axis,round_dn )
+	ENDIF
+
+
+* determine whether destination edges can actually be regridded
+* changed to sing. prec 5/93
+	dst_lo_ww = TWORLD(dst_lo_ss,dst_grid,axis,dst_where_loest)
+	dst_hi_ww = TWORLD(dst_hi_ss,dst_grid,axis,dst_where_hiest)
+! 1/00 removed this check for G=@MIN, MAX, ...
+!      IS IT NEEDED AT ALL???
+	IF ( need_margin_check ) THEN
+
+* 3/01 *acm* If different calendars, do comparison wrt dst calendar...
+
+           IF (calendar .AND. src_cal_id .NE. dst_cal_id) THEN
+	      CALL reset_secs_from_bc (src_lo_ww, tmp_lo_ww, 
+     .                                 src_cal_id, dst_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL reset_secs_from_bc (src_hi_ww, tmp_hi_ww, 
+     .                                 src_cal_id, dst_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   ELSE
+	      tmp_lo_ww = src_lo_ww
+	      tmp_hi_ww = src_hi_ww
+	   ENDIF
+#ifdef double_p
+	   IF ( (dst_lo_ww) .LT. (tmp_lo_ww) )
+     .	                                dst_lo_ss = dst_lo_ss + 1
+	   IF ( (dst_hi_ww) .GT. (tmp_hi_ww) )
+     .                                  dst_hi_ss = dst_hi_ss - 1
+#else
+	   IF ( SNGL(dst_lo_ww) .LT. SNGL(tmp_lo_ww) )
+     .	                                dst_lo_ss = dst_lo_ss + 1
+	   IF ( SNGL(dst_hi_ww) .GT. SNGL(tmp_hi_ww) )
+     .                                  dst_hi_ss = dst_hi_ss - 1
+#endif
+	ENDIF
+	IF ( dst_lo_ss .GT. dst_hi_ss ) dst_hi_ss = dst_lo_ss  !bug chk 5/93
+
+* if destination limits were unspecified set them to the full axis span
+ 500    IF ( cx_hi_ss(dst_cx,axis) .EQ. unspecified_int4 ) THEN
+! pre 2/99 logic for unspecified limits
+!	   cx_lo_ss(dst_cx,axis) = dst_lo_ss
+!	   cx_hi_ss(dst_cx,axis) = dst_hi_ss
+	   cx_lo_ss(dst_cx,axis) = 1
+	   cx_hi_ss(dst_cx,axis) = CAXIS_LEN(axis, dst_cx)
+	   cx_lo_ww(axis,dst_cx) = TM_WORLD( dst_lo_ss,
+     .					     dst_grid, axis, box_lo_lim )
+	   cx_hi_ww(axis,dst_cx) = TM_WORLD( dst_hi_ss,
+     .					     dst_grid, axis, box_hi_lim )
+           cx_cal_id(dst_cx) = dst_cal_id
+	ENDIF
+
+* even with sufficient source data we shouldn't exceed the requested region
+        dst_ss_min = cx_lo_ss(dst_cx,axis)
+	dst_ss_max = cx_hi_ss(dst_cx,axis)
+
+* determine the limits that can actually be regridded
+	IF ( modulo ) THEN
+           ok_min = dst_ss_min		! can always regrid to full request
+	   ok_max = dst_ss_max
+	ELSE
+           ok_min = MAX( dst_lo_ss, dst_ss_min )
+	   ok_max = MIN( dst_hi_ss, dst_ss_max )
+	ENDIF
+
+* size of working arrays needed for later regridding
+* 1/00 times two to accomodate @MIN, @MAX needs
+	work = ( dst_hi_ss - dst_lo_ss + 2 ) * 2
+	RETURN
+* error exit
+ 5000	RETURN
+	END	
diff --git a/fer/stk/regrid_lims.F b/fer/stk/regrid_lims.F
new file mode 100644
index 0000000..9770336
--- /dev/null
+++ b/fer/stk/regrid_lims.F
@@ -0,0 +1,277 @@
+	SUBROUTINE REGRID_LIMS( dst_cx, src_cx, axis, status, * )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a context describing data to be regridded to a destination grid
+* - select one of the axes needing regridding
+* - create, if necessary, an intermediate grid that differs from the
+*	destination grid by only this single axis
+* - compute the region on the source grid (possibly the newly created
+*	intermediate grid) that will supply the re-griddable data
+* When called the source context should be a copy of the destination context 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  7/25/88
+* revision 0.1 -   9/1/89 - corrected bug in destination world limits
+*			  - added xy averaging
+* revision 0.2 -   6/2/89 - modified grid limits calc. for modulo axes
+* V200:  7/31/89 - 4D symmetrical version
+*		 - fixed bug following GRID_SUBSCRIPT_EXTREMES for modulo axes
+*	 11/3/89 - if destination limits are unknown flag error
+*	 12/1/89 - handles XY averaging - (uses RQST_REGRID)
+* V420: 10/95	 - Support for implicit axes: intermed. grids inherit
+*		   responsibilities (use counts) for implicit axes
+*	11/95	   check that destination axis is modulo for modulo regrid
+*		   and take abnormal return if it dest region is
+*		   modulo-wrapped
+* V440: 9/96	 - Bug: failed to call TM_USE_LINE for dynamic line in
+*		   intermediate grid (err430_deallo_dyn_line)
+*		   Also corrected undetected bug: in intermediate grid for
+*		   XY averaging need to deallo the y_dim not the "axis"
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars 
+*      *sh*  5/99 - incorporate logic for netCDF strides. Allow for multi-axes
+*		    use same framework to handle XY averaging
+*	*sh* 4/00 - all grids and axes now maintain use counts and have
+*			line_class available
+* V533 *sh* 6/01 - allow strides and modulo to be combined
+* V550 *sh*  2/02 - support for subspan modulo axes
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars 
+* v554 *acm* 3/04 - When a strides request is made, and a grid had been defined
+*                   for use in comparisons (define grid/like=var), the request 
+*                   got turned into a regrid instead of a stride. Change the test
+*                   for may_have_strides.
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	src_cx, axis, dst_cx, status
+
+* internal variable declarations:
+	LOGICAL	ITSA_MODULO_REGRID, ITSA_MODULO_AXIS,  TM_ITS_CDF,
+     .		xy_regrid, last_axis, may_have_strides, has_strides,
+     .		unacceptable_modulo
+	INTEGER	KNOWN_GRID, CAXIS_MODLEN, TM_AXIS_STRIDE, CX_DIM_LEN,
+     .		idim, axis_list(nferdims), naxis, var_grid, src_grid, dst_grid,
+     .		next_axis, dst_axis, var_axis, i, axlen, i1
+	REAL	fraction
+	CHARACTER VAR_CODE*128, dtype*4
+
+* initialize
+* this is a bit of a hack for implementing netCDF strides
+* Under circumstances listed near bottom we may abort the intention to use
+* strides In that case, we come back and do this routine over again.
+* We save a copy of the src_cx in case of this eventuality
+	CALL TRANSFER_CONTEXT(src_cx, cx_buff)
+
+* insert source grid ( defining grid for this variable )
+	dst_grid = cx_grid( dst_cx )
+	var_grid = KNOWN_GRID( cx_data_set(src_cx),
+     .			  cx_category(src_cx),
+     .			  cx_variable(src_cx)	)
+
+* initially select a single axis for regridding
+	DO 10 axis = 1, nferdims
+ 10	IF (grid_line(axis,dst_grid).NE.grid_line(axis,var_grid)) GOTO 20
+* ... signal calling routine that there's nothing to regrid
+	cx_unstand_grid( dst_cx ) = .FALSE.
+	status = ferr_ok
+	RETURN
+
+* special requirement for modulo regrid
+ 20	IF ( ITSA_MODULO_REGRID(dst_cx,axis) ) THEN
+	   IF ( .NOT.ITSA_MODULO_AXIS(dst_cx,axis) ) GOTO 5100
+* ... strip off the destination modulo wraps if any with abnormal return
+* (so we compute just the base limits, 1-N, of the modulo axis)
+	   IF ( cx_lo_ss(dst_cx,axis) .NE. unspecified_int4 ) THEN
+	      IF (cx_hi_ss(dst_cx,axis ) .GT. CAXIS_MODLEN(axis,dst_cx)
+     .       .OR. cx_lo_ss(dst_cx,axis ) .LT. 1 ) RETURN 1
+	   ENDIF
+	ENDIF
+
+* (5/99) should more than one axis be regridded at once?
+* yes if XY average regridding
+* yes if multiple axis strides in a netCDF file
+* for stride axes, we cannot have modulo and cannot have other
+* types of regridding needed also
+
+* If the regrid is of the form netCDFvar[i=lo:hi:del] then it is
+* currently represented as a regrid to a dynamic axis. Since the netCDF
+* library can do strides, we will allow it to as long as a variety
+* of conditions are met. The "flag" that will trigger strides in the netCDF
+* IO is the presence of a cx_delta value (see rqst_regrid.F and read_tm.F)
+* Note that modulo regrids cannot be handled with strides: suppose X axis
+* is 1:360 degrees by one degree, then V[I=1:720:7] will select different
+* points in the 1:360 range than in the 361:720 range.
+	may_have_strides =  cx_category(dst_cx) .EQ. cat_file_var
+
+	IF (may_have_strides) THEN
+!	   may_have_strides = TM_ITS_CDF(cx_data_set(dst_cx), dtype )
+!     .                  .AND. cx_has_impl_grid(dst_cx) 
+
+	   may_have_strides = TM_ITS_CDF(cx_data_set(dst_cx), dtype )
+
+	ENDIF
+ 50	naxis = 1
+	axis_list(1) = axis	
+	has_strides = .FALSE.
+	xy_regrid = (cx_regrid_trans(axis,src_cx) .EQ. prgrd_xy_ave).OR. 
+     .           (cx_regrid_trans(axis,src_cx) .EQ. prgrd_xy_lin)
+	IF ( xy_regrid)   THEN
+	   naxis = 2
+	   axis_list(2) = y_dim
+	ELSEIF ( may_have_strides ) THEN
+	  DO 100 idim = axis, nferdims
+	    dst_axis = grid_line(idim,dst_grid)
+	    var_axis = grid_line(idim,var_grid)
+	    IF (dst_axis.EQ.var_axis) GOTO 100
+	    IF (cx_regrid_trans(idim,dst_cx).EQ.prgrd_xact_pts
+     .     .OR. cx_regrid_trans(idim,dst_cx).EQ.prgrd_exact) THEN
+	      IF ( line_class(dst_axis) .EQ. pline_class_stride ) THEN
+	        IF (idim .NE. axis) naxis = naxis + 1
+	        axis_list(naxis) = idim
+	      ELSE
+	        GOTO 110	! abort
+	      ENDIF
+	    ELSE
+	      GOTO 110		! abort
+	    ENDIF
+ 100	  CONTINUE
+	  has_strides = .TRUE.  ! all axes meet the conditions
+ 110	  IF (.NOT.has_strides) naxis = 1
+	ENDIF
+
+* will there be more axes to regrid after this/these?
+	next_axis = axis_list(naxis) + 1
+	last_axis = .TRUE.
+	DO 200 idim = next_axis, nferdims
+ 200	IF ( grid_line(idim,dst_grid) .NE. grid_line(idim,var_grid) )
+     .							last_axis = .FALSE.
+	IF (.NOT.last_axis) has_strides = .FALSE.  ! (can never happen)
+
+* if its the last axis then the source data will be on its defining grid
+	IF ( last_axis ) THEN
+	   src_grid = var_grid
+	   cx_unstand_grid( src_cx ) = .FALSE.
+	   is_phase( isp )   = prgrd_from_source
+	ELSE		
+* we need an intermediate grid
+	   cx_unstand_grid( src_cx ) = .TRUE.
+	   CALL ALLO_GRID( src_grid,status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   CALL TM_COPY_GRID_W_LINE_USE( dst_grid, src_grid ) 
+	   grid_name( src_grid ) = ww_dim_name(axis)//'NTERMED'	! for diag out
+	   CALL TM_DEALLO_DYN_LINE(grid_line(axis,src_grid))
+	   grid_line( axis, src_grid ) = grid_line( axis, var_grid )
+	   CALL TM_USE_LINE(grid_line(axis,var_grid)) ! 9/96
+	   IF (xy_regrid) THEN
+! 9/96: changed DEALLO grid_line(axis,src_grid) to grid_line(y_dim,src_grid)
+	      CALL TM_DEALLO_DYN_LINE(grid_line(y_dim,src_grid))
+	      grid_line(y_dim,src_grid) = grid_line(y_dim,var_grid)
+	      CALL TM_USE_LINE(grid_line(y_dim,var_grid)) !9/96
+	   ENDIF
+	   is_phase( isp ) = prgrd_from_ntrmed
+	ENDIF
+	cx_grid( src_cx ) = src_grid
+
+* get limits to request
+	DO 300 idim = 1, naxis
+	   CALL RQST_REGRID( dst_cx, src_cx, axis_list(idim),
+     .			     has_strides, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+ 300	CONTINUE
+
+* if doing strides then we may decide to abort
+* 1) if it turns out to be a modulo stride operation (e.g. I=1:720:11 on
+*    a 360 point modulo longitude axis. Note that we could have checked for
+*    this above, but since RQST_REGRID does all the work, we waited
+* 2) if the complete source data is already in cache don't reread w/ strides
+	IF (has_strides) THEN
+	   unacceptable_modulo = .FALSE.
+	   DO 400 i = 1, naxis
+	      idim = axis_list(i)
+	      axlen = CAXIS_MODLEN(idim, src_cx)
+	      IF (CX_DIM_LEN(idim,src_cx) .GT. axlen) THEN
+*     ...  for multi-cycle modulo stride must be an integer factor of ax length
+	         fraction = FLOAT(axlen) /
+     .			    TM_AXIS_STRIDE(grid_line(idim,dst_grid), i1)
+	         unacceptable_modulo = unacceptable_modulo
+     .				 .OR.  fraction .NE. INT(fraction)
+	      ENDIF
+ 400	   CONTINUE
+! THE COMMENTED OUT CODE BELOW CAN BE USED TO TURN ON LOGIC THAT WILL REUSE
+! CACHED (NON_STRIDES) DATA RATHER THAN REREADING USING STRIDES. IT IS
+! COMMENTED OUT AS NOT ENTIRELY DESIRABLE: 1) IT CREATES MULTIPLE CODE PATHS
+! FOR THE SAME OPERATION; 2) IT CAN CAUSE UNACCEPTABLE MEMORY USAGE AS THE
+! NON-STRIDED BASE REGION GETS MODULO-REPLICATED BEFORE SUBSAMPLING
+* ... if full source region is already in memory without strides then
+*     do striding from it in memory -- no new IO needed (optimization)
+!	   CALL FIND_MEM_VAR( src_cx, mr, search_by_value )
+!           IF ( unacceptable_modulo .OR. mr.GT.mr_nonexist ) THEN
+           IF ( unacceptable_modulo ) THEN
+	      may_have_strides = .FALSE.
+	      CALL TRANSFER_CONTEXT( cx_buff, src_cx)
+	       IF (mode_diagnostic) THEN
+	        CALL WARN('Not using NetCDF strides for multi-cycle modulo')
+	        CALL WARN('Stride value not a factor of axis length')  
+	       ENDIF
+	      GOTO 50			! re-do w/out strides
+	   ENDIF
+	ENDIF
+
+* success
+        status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_regrid, status,
+     .          '@MOD regridding to a non-modulo axis: '
+     .          //VAR_CODE(cx_category(dst_cx),cx_variable(dst_cx)),
+     .		*5000)
+
+	END
diff --git a/fer/stk/rqst_regrid.F b/fer/stk/rqst_regrid.F
new file mode 100644
index 0000000..d8129cc
--- /dev/null
+++ b/fer/stk/rqst_regrid.F
@@ -0,0 +1,366 @@
+	SUBROUTINE RQST_REGRID( dst_cx, src_cx, axis, strides, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* given a destination context and an axis to be regridded
+* determine the source data limits that should be requested ("rqst")
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V200:  12/1/89 - extracted from REGRID_LIMS
+* 	 2/26/90 - repaired minor bug in error message
+* 	  3/2/90 - changed inequality conditions to allow endpoints exactly =
+* V230:  8/22/92 - allow regridding by association and by single axis averaging
+*        11/4/92 - expanded variable name length
+* V300:  3/16/93 - if destination region doesn't overlap the source region
+*                  then request a single point at the closest edge of the src
+*                  This allows bad data to be returned instead of an error.
+* V402:	 8/16/95 - bug fix: T axis was **assumed** to be calendar
+* V420: 10/25/95 - do not let subscript limits (src_lo/hi_ss) exceed bounds
+*	11/95	 - request unspec limits for modulo regrid (entire src region)
+*		   (1/96 - set cx_given to FALSE ... omitted earlier)
+*	 1/96    - shifted @SUM and @NGD to weighted calcs like @AVE
+*	 2/96    - issue warning that G=@NRS is not implemented
+* V490:  9/97 *kob* - mods to include negative time axis processing
+*     10/6/97 *sh*  - added g=@xact regridding 
+* V500:  2/99 *sh* - modified behavior when region is unspecified -- request
+*		full  dest axis limits of source rather than unspecified limts
+*  *kob* 3/99- up VAR_CODE  to 64 chars 
+*        5/99 *sh* for netCDF vars of form var[I=1:10:3] pass along the
+*		  delta value in cx_delta to be used as a "stride" in I/O 
+* V530   3/01 *acm* alternative calendar axes:  Compare timesteps for source and
+*		    destination axes with respect to one of the calendars.
+* V530:  3/01 *sh* - added prgrd_nearest
+*        6/01 *acm* remove redundant calendar=.FALSE. after line 134
+* V552 *acm* 4/03- up VAR_CODE  to 128 chars 
+* v580 *acm* 11/04 Store cal_id in cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+* V671  6/11 *acm*  New 2D linear xy regridding, fixing ticket 1862
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP. Note the input 
+*                  argument "axis" in this routine is a dimension, 1, 2, ... 
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include 'xrisc.cmn'
+	include	'xalgebra.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	LOGICAL strides
+	INTEGER	src_cx, dst_cx, status
+
+* internal variable declarations:
+	LOGICAL	GEOG_LABEL, ITSA_MODULO_REGRID,
+     .		last_axis, src_modulo, calendar
+	INTEGER	ISUBSCRIPT, CAXIS_LEN, axis, TM_GET_CALENDAR_ID, TM_LENSTR1,
+     .		dst_grid, src_grid, src_lo_ss, src_hi_ss,
+     .		src_min_ss, src_max_ss, line, src_line,
+     .		dst_lo_ss, dst_hi_ss, where_loest, where_hiest, rgrd_trans,
+     .	        dst_taxis, src_taxis, dst_cal_id, src_cal_id, dlen, slen
+	REAL*8	TWORLD, SECS_TO_TSTEP,
+     .		src_lo_ww, src_hi_ww, dst_lo_ww, dst_hi_ww,
+     .          tmp_lo_ww, tmp_hi_ww, d2s_lo_ww, d2s_hi_ww
+	CHARACTER	VAR_CODE*128, TM_SECS_TO_DATE*20, pdate*20
+
+* initialize
+	dst_grid = cx_grid( dst_cx )
+	src_grid = cx_grid( src_cx )
+
+* get regrid transform.  remove its flag from the source request
+	rgrd_trans = cx_regrid_trans( axis, dst_cx )
+	cx_regrid_trans(axis,src_cx) = prgrd_exact
+
+* ! temp kludge - allow regridding to higher dimensioned objects
+	IF ( grid_line(axis,src_grid) .EQ. mnormal ) GOTO 1000
+
+* determine if this is a calendar axis and trap illegal attempts
+* to regrid between calendar and non-calendar axes.  
+* 3/01 *acm* If calendar axis, get calendar id for dest and source calendars.
+
+	IF ( rgrd_trans.NE.prgrd_associate .AND. 
+     .       (axis.EQ.t_dim .OR. axis.EQ.f_dim) ) THEN
+	   calendar = GEOG_LABEL(axis,dst_grid)
+	   IF (GEOG_LABEL(axis,src_grid).NEQV.calendar) GOTO 5010
+	   IF (calendar) THEN
+	      src_taxis = grid_line(axis, src_grid)
+	      src_cal_id = TM_GET_CALENDAR_ID (line_cal_name(src_taxis) )
+	      dst_taxis = grid_line(axis, dst_grid)
+	      dst_cal_id = TM_GET_CALENDAR_ID (line_cal_name(dst_taxis) )
+	   ENDIF
+
+	ELSE
+	   calendar = .FALSE.
+	ENDIF
+
+* If this is a regridding between different calendars trap illegal attempts
+* to regrid with anything except @lin, @asn, or @near
+	IF ( calendar  .AND. 
+     .      (axis.EQ.t_dim .OR. axis.EQ.f_dim) ) THEN
+	   dst_taxis = grid_line(axis, dst_grid ) 
+	   src_taxis = grid_line(axis, src_grid )
+
+	   dst_cal_id = TM_GET_CALENDAR_ID (line_cal_name(dst_taxis))
+	   src_cal_id = TM_GET_CALENDAR_ID (line_cal_name(src_taxis))
+           IF (dst_cal_id .NE. src_cal_id) THEN
+               IF (rgrd_trans .NE. prgrd_linear_interp .AND. 
+     .		   rgrd_trans .NE. prgrd_xy_lin        .AND. 
+     .		   rgrd_trans .NE. prgrd_associate     .AND. 
+     .		   rgrd_trans .NE. prgrd_nearest )  GOTO 5020
+           ENDIF
+	ENDIF
+
+* modulo regridding always requests the entire source region
+	IF ( ITSA_MODULO_REGRID(dst_cx,axis) ) GOTO 1000
+
+* for interpolation we need source points surrounding the destination points
+* for averaging     we need source area   surrounding the destination area
+* for exact match   we need source points aligning w/ the destination points
+	IF ( rgrd_trans .EQ. prgrd_linear_interp
+     .	   .OR.  rgrd_trans.EQ.prgrd_xy_lin ) THEN
+	   where_loest = box_middle
+	   where_hiest = box_middle
+	ELSEIF ( rgrd_trans.EQ.prgrd_min
+     .	   .OR.  rgrd_trans.EQ.prgrd_max ) THEN
+	   where_loest = box_lo_lim			! unweighted
+	   where_hiest = box_hi_lim
+	ELSEIF ( rgrd_trans .EQ. prgrd_xy_ave 
+     .      .OR. rgrd_trans .EQ. prgrd_variance
+     .      .OR. rgrd_trans .EQ. prgrd_sum
+     .      .OR. rgrd_trans .EQ. prgrd_good_pt
+     .      .OR. rgrd_trans .EQ. prgrd_average ) THEN
+	   where_loest = box_lo_lim
+	   where_hiest = box_hi_lim
+	ELSEIF ( rgrd_trans .EQ. prgrd_associate ) THEN
+           CONTINUE
+	ELSEIF ( rgrd_trans .EQ. prgrd_xact_pts
+     .	    .OR. rgrd_trans .EQ. prgrd_nearest ) THEN
+	   where_loest = box_middle
+	   where_hiest = box_middle
+	ELSE
+	   CALL ERRMSG( ferr_internal, status, 'rgrd transf', *5000 )
+	ENDIF
+
+* locate the necessary destination region (time in secs since BC)
+	IF ( cx_lo_ss(dst_cx,axis) .EQ. unspecified_int4 ) THEN
+! 2/99 - commented out earlier versions of logic
+!* ... if unknown, hope they will get figured out later <-- current on 2/99
+!	   GOTO 1000
+!* ... error (for now) if limits are unspecified	<-- old on 2/99
+!!	   GOTO 5200
+* ... always try to fill the entire destination axis
+	   dst_lo_ss = 1
+	   dst_hi_ss = CAXIS_LEN(axis, dst_cx)
+	ELSE
+	   dst_lo_ss = cx_lo_ss(dst_cx,axis)
+	   dst_hi_ss = cx_hi_ss(dst_cx,axis)
+	ENDIF
+
+	CALL GRID_SUBSCRIPT_EXTREMES(src_min_ss, src_max_ss, src_grid, axis)
+        IF ( rgrd_trans .EQ. prgrd_associate ) THEN     ! 8/92
+* ... regridding by association bypasses all the hard stuff
+	   src_lo_ss = src_min_ss
+	   src_hi_ss = src_max_ss
+           IF     ( dst_lo_ss .GT. src_hi_ss ) THEN   ! 3/93
+              src_lo_ss = src_hi_ss                   ! 3/93 request top point
+           ELSEIF ( dst_hi_ss .LT. src_lo_ss ) THEN   ! 3/93
+              src_hi_ss = src_lo_ss        ! 3/93 request low point (possible?)
+           ELSE
+	      IF ( dst_lo_ss .GT. src_lo_ss ) src_lo_ss = dst_lo_ss
+	      IF ( dst_hi_ss .LT. src_hi_ss ) src_hi_ss = dst_hi_ss
+           ENDIF
+           GOTO 500
+        ELSE
+* NOTE:  times expressed as seconds since BC
+           dst_lo_ww = TWORLD( dst_lo_ss,dst_grid,axis,where_loest ) 
+	   dst_hi_ww = TWORLD( dst_hi_ss,dst_grid,axis,where_hiest )
+        ENDIF
+
+* check to make sure destination region overlaps the source region
+* (temporarily use src_**_ww for axis extremes)
+* 3/01 *acm* If different calendars, do comparison wrt source calendar...
+
+	src_modulo = line_modulo( grid_line(axis,src_grid) )
+	IF ( .NOT. src_modulo ) THEN
+	   CALL GRID_SUBSCRIPT_EXTREMES(src_lo_ss, src_hi_ss, src_grid, axis)
+	   src_lo_ww = TWORLD( src_lo_ss,src_grid,axis,where_loest )
+	   src_hi_ww = TWORLD( src_hi_ss,src_grid,axis,where_hiest )
+
+! (3/2)    IF ( dst_lo_ww.GE.src_hi_ww .OR. dst_hi_ww.LE.src_lo_ww ) GOTO 5100
+! (3/93)   IF ( dst_lo_ww.GT.src_hi_ww .OR. dst_hi_ww.LT.src_lo_ww ) GOTO 5100
+
+           IF (calendar .AND. src_cal_id .NE. dst_cal_id) THEN
+              CALL reset_secs_from_bc (dst_lo_ww, tmp_lo_ww, 
+     .                                 dst_cal_id, src_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL reset_secs_from_bc (dst_hi_ww, tmp_hi_ww, 
+     .                                 dst_cal_id, src_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ELSE
+	      tmp_lo_ww = dst_lo_ww
+	      tmp_hi_ww = dst_hi_ww
+	   ENDIF
+
+           IF     ( tmp_lo_ww .GT. src_hi_ww ) THEN   ! 3/93
+              src_lo_ss = src_hi_ss                   ! 3/93 request top point
+              GOTO 500                                ! 3/93
+           ELSEIF ( tmp_hi_ww .LT. src_lo_ww ) THEN   ! 3/93
+              src_hi_ss = src_lo_ss                   ! 3/93 request low point
+              GOTO 500                                ! 3/93
+           ENDIF
+	ENDIF
+
+* which source grid boxes contain the destination region
+
+* 9/97 *kob* convert time in secs since BC to time position on the 
+*             *source* time axis then call ISUBSCRIPT
+	IF ( calendar ) THEN
+
+* 3/01 *acm* Get timesteps for dst range wrt source calendar
+	   IF (dst_cal_id .NE. src_cal_id) THEN
+              CALL reset_secs_from_bc (dst_lo_ww, d2s_lo_ww, 
+     .                                 dst_cal_id, src_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+              CALL reset_secs_from_bc (dst_hi_ww, d2s_hi_ww, 
+     .                                 dst_cal_id, src_cal_id, status)
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ELSE
+	      d2s_lo_ww = dst_lo_ww
+	      d2s_hi_ww = dst_hi_ww
+	   ENDIF
+
+	   tmp_lo_ww = SECS_TO_TSTEP( src_grid, axis, d2s_lo_ww)
+	   tmp_hi_ww = SECS_TO_TSTEP( src_grid, axis, d2s_hi_ww)
+
+	   src_lo_ss = ISUBSCRIPT( tmp_lo_ww,src_grid,axis,round_dn )
+	   src_hi_ss = ISUBSCRIPT( tmp_hi_ww,src_grid,axis,round_up )
+	ELSE
+	   src_lo_ss = ISUBSCRIPT( dst_lo_ww,src_grid,axis,round_dn )
+	   src_hi_ss = ISUBSCRIPT( dst_hi_ww,src_grid,axis,round_up )
+	ENDIF
+* 9/97 *kob* now convert to ss values
+
+
+* determine the maximum regriddable region from this source data
+	src_lo_ww = TWORLD( src_lo_ss, src_grid, axis, where_loest )
+	src_hi_ww = TWORLD( src_hi_ss, src_grid, axis, where_hiest )
+
+* if this isn't sufficient, expand it
+* 10/95:  Avoid expanding beyond the axis limits.  This becomes necessary
+*  despite the call to CONFINE_AXIS because dynamic grids contexts are immune
+*  from CONFINE_CONTEXT as a result of uvar_given = uvlim_gvn_gnl
+
+* 3/01 *acm* If different calendars, do comparison wrt dst calendar...
+
+        IF (calendar .AND. dst_cal_id .NE. src_cal_id) THEN
+	   tmp_lo_ww = d2s_lo_ww
+	   tmp_hi_ww = d2s_hi_ww
+	ELSE
+	   tmp_lo_ww = dst_lo_ww
+	   tmp_hi_ww = dst_hi_ww
+	ENDIF
+
+	IF ( tmp_lo_ww .LT. src_lo_ww
+     . .AND. src_lo_ss .GT. src_min_ss ) src_lo_ss = src_lo_ss - 1
+	IF ( tmp_hi_ww .GT. src_hi_ww
+     . .AND. src_hi_ss .LT. src_max_ss ) src_hi_ss = src_hi_ss + 1
+
+* flesh out the resulting axis
+ 500    cx_by_ss( axis, src_cx ) = .TRUE.
+	cx_lo_ss( src_cx, axis ) = src_lo_ss
+	cx_hi_ss( src_cx, axis ) = src_hi_ss
+	CALL CONFINE_AXIS( axis, src_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	CALL FLESH_OUT_AXIS( axis, src_cx, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* (5/99) flag the use of netCDF strides by inserting cx_delta value
+	IF (strides) THEN
+	   line = grid_line(axis,dst_grid)
+	   IF (line_regular(line)) THEN
+	      src_line  = grid_line(axis,src_grid)
+	      cx_delta(axis,src_cx) = line_delta(line)
+     .				    / line_delta(src_line)
+	   ELSE
+	      cx_delta(axis,src_cx) = line_delta(line)
+	   ENDIF
+	ENDIF
+
+* success
+	RETURN
+
+* set axis region as still unknown at this stage
+ 1000	cx_lo_ss( src_cx, axis )	= unspecified_int4
+	cx_hi_ss( src_cx, axis )	= unspecified_int4
+	cx_lo_ww( axis, src_cx )	= unspecified_val8
+	cx_hi_ww( axis, src_cx )	= unspecified_val8
+	cx_given( axis, src_cx )	= .FALSE.
+* 9/97 *kob* - cx_calendar needs to also reflect these changes
+	IF (axis .eq. t_dim .OR. axis .eq. f_dim) THEN
+           cx_calendar(src_cx) = .FALSE.
+           cx_cal_id(src_cx) = unspecified_int4
+        ENDIF
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_regrid, status,
+     .		'only @ASN regridding between calendar and '//pCR
+     .		//'non-calendar axes: '//
+     .		VAR_CODE(cx_category(dst_cx),cx_variable(dst_cx)), *5000)
+ 5020	CONTINUE
+
+	slen = TM_LENSTR1 (line_cal_name(src_taxis))
+	dlen = TM_LENSTR1 (line_cal_name(dst_taxis))
+	WRITE (risc_buff, *) 'only @ASN, @LIN, or @NRST regridding ',
+     .		'between calendar types: ',
+     .		line_cal_name(src_taxis)(:slen),', ', 
+     .		line_cal_name(dst_taxis)(:dlen)
+	CALL ERRMSG( ferr_regrid, status, risc_buff, *5000)
+! 5100	CALL ERRMSG( ferr_limits, status,
+!     .		'regrid region outside source data '//ww_dim_name(axis)//
+!     .		' axis range: '//
+!     .		VAR_CODE(cx_category(dst_cx),cx_variable(dst_cx)), *5000)
+! 5200	CALL ERRMSG( ferr_limits, status,
+!     .		'regrid requires limits given on '//ww_dim_name(axis)//
+!     .		' axis of '//
+!     .		VAR_CODE(cx_category(dst_cx),cx_variable(dst_cx)), *5000)
+	END
diff --git a/fer/stk/setup_sample.F b/fer/stk/setup_sample.F
new file mode 100644
index 0000000..06afe56
--- /dev/null
+++ b/fer/stk/setup_sample.F
@@ -0,0 +1,175 @@
+	SUBROUTINE SETUP_SAMPLE( memory, cx_indices, mr_indices,
+     .				 ifcn, big_cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* This routine sets up for the SAMPLE* functions
+* When the user issues SAMPLEI({1,5,3,3,8},my_var) this routine will
+* sort and store the given indices and prepare for isact_sample activities 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 8/99 *sh*
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'grid_chg_fcns.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+
+* calling argument declarations:
+	INTEGER	cx_indices, ifcn, mr_indices, big_cx, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* ... interpretation stack setup at the time this is called ...
+*	stack level		stack contents
+*	isp+1	<--	level to request individual sample chunks
+*	 isp	<--	current stack level (for sampling )
+
+* internal variable declarations:
+	INTEGER CGRID_SIZE
+	INTEGER n, dims(nferdims), ndim, hold_isp, cx_holder,
+     .		min_ss, max_ss, res_grid,
+     .		mr_sorted_indices, mr_index_map, axis, nvalid
+
+* --- end of introductory code ---
+
+* initialize
+	hold_isp  = isp
+	cx_holder = is_cx( hold_isp )
+	res_grid  = cx_grid( cx_holder )
+
+* Check that index list is 1D.
+	CALL GET_CX_DIMS(cx_indices, ndim, dims)
+	IF (ndim .GT. 1) GOTO 5010
+
+* create memory managed work arrays for the sorted_indices and index_map
+	n = CGRID_SIZE(cx_indices)
+	CALL GET_WORK_MR(n,mr_sorted_indices, status)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	CALL GET_WORK_MR(n,mr_index_map, status)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+!	mr_hi_ss(mr_index_map,x_dim) = n	! done in GET_WORK_MR
+
+* extract the 1D list of indices to be obtained
+        CALL EXTRACT_LINE ( cx_indices,
+     .                      memory( 1, mr_blk1(mr_indices) ),
+     .                      mr_indices,
+     .                      memory( 1, mr_blk1(mr_sorted_indices) ),
+     .                      dims,
+     .                      ndim,
+     .                      n,
+     .                      status      )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+
+* which axis is the sampling along?
+	axis = ifcn - p_samplei + 1
+	is_axis( hold_isp ) = axis
+
+* sort the list of indices and store with a map of the sort
+	CALL GRID_SUBSCRIPT_EXTREMES(min_ss, max_ss, res_grid, axis)
+	CALL SORT_LIST(n, min_ss, max_ss,  
+     .			   mr_bad_data(mr_indices),
+     .			   mr_bad_data(mr_sorted_indices),
+     .			   memory(1,mr_blk1(mr_sorted_indices)),
+     .			   memory(1,mr_blk1(mr_index_map)), nvalid )
+
+* pass the number of valid points through the (irrelevant) T axis indices
+* of the (one-dimensional) mr_index_map array
+	mr_lo_ss( mr_index_map, t_dim ) = nvalid
+	mr_hi_ss( mr_index_map, t_dim ) = nvalid
+
+* encode both the sorted indices and the index map into the hold_isp stack
+	is_sum( hold_isp )  = mr_sorted_indices + 10000*mr_index_map
+
+* tell the interp stack what activity we are about
+	is_act ( hold_isp ) = isact_sample
+
+* tell IS_SAMPLE that we're just beginning
+	is_phase( hold_isp ) = 0
+
+* setup the next stack level to grab the individual chunks
+	CALL PUSH_INTERP_STACK( hold_isp, status )
+	IF ( status .NE. ferr_ok) GOTO 5000
+	is_obj( isp ) = hold_isp	! claimed by this level  (?ok?)
+
+* allocate a context that will be modified for each chunk requested
+	CALL STACK_PTR_UP( cx_stack_ptr, max_context, status )
+        IF ( status .NE. ferr_ok ) RETURN
+	CALL TRANSFER_CONTEXT( cx_holder, cx_stack_ptr )
+	is_cx( isp ) = cx_stack_ptr
+
+* now drop the isp pointer back down one, so that we will enter IS_SAMPLE
+* in the same state that we would had we just grabbed the first chunk
+* of sampled data
+	isp = hold_isp
+
+* the grid of the result is ABSTRACT on axis "axis". Need to correspondingly
+* modify the context of the result
+	cx_grid(cx_holder)     = cx_grid(big_cx)
+!?	IF (cx_grid(cx_holder) .GT. max_grids)
+!?     .			CALL TM_USE_DYN_GRID(cx_grid(cx_holder))
+	cx_category(cx_holder) = cat_temp_var
+	cx_has_impl_grid(cx_holder) = .FALSE.
+	cx_lo_ss(cx_holder,axis) = 1
+	cx_hi_ss(cx_holder,axis) = n
+	cx_by_ss(axis,cx_holder) = .TRUE.
+	CALL FLESH_OUT_AXIS( axis, cx_holder, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* other axes of the holder are not yet known. Result memory
+* space will be allocated after the first "chunk" has been obtained
+	is_mr( hold_isp ) = unspecified_int4
+
+* diagnostic mode output: " doing gather VAR_NAME[x=lo:hi at TRN:n,D=#]"
+	IF ( mode_diagnostic ) 	CALL DIAG_OP
+     .		('doing', isact_class_sample, cx_holder, axis)
+
+* success
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .          'list of indices supplied to SAMPLE* must be 1D ',
+     .          *5000)
+	END
+
diff --git a/fer/stk/stack_ptr_dn.F b/fer/stk/stack_ptr_dn.F
new file mode 100644
index 0000000..50cc880
--- /dev/null
+++ b/fer/stk/stack_ptr_dn.F
@@ -0,0 +1,65 @@
+	SUBROUTINE STACK_PTR_DN ( stack_ptr, min_stack, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* drop stack pointer by 1 and check for error
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/14/86
+* revision 0.1 - 5/22/87  - stack pointer is only decremented for non-error
+*			    calls to avoid subscript out of bounds in calling
+*			    routine
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+	INTEGER	stack_ptr, min_stack, status
+
+	IF ( stack_ptr .LE. min_stack ) CALL ERRMSG
+     .		( ferr_stack_undfl, status, ' ',*5000 )
+
+	stack_ptr = stack_ptr - 1
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/stk/stack_ptr_up.F b/fer/stk/stack_ptr_up.F
new file mode 100644
index 0000000..5cb4081
--- /dev/null
+++ b/fer/stk/stack_ptr_up.F
@@ -0,0 +1,63 @@
+	SUBROUTINE STACK_PTR_UP ( stack_ptr, max_stack, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/14/86
+* revision 0.1 - 5/22/87  - stack pointer is only incremented for non-error
+*			    calls to avoid subscript out of bounds in calling
+*			    routine
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+	INTEGER	stack_ptr, max_stack, status
+
+	IF ( stack_ptr .GE. max_stack ) CALL ERRMSG
+     .		( ferr_stack_ovfl, status, ' ',*5000 )
+
+	stack_ptr = stack_ptr + 1
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/stk/string_concatenate.F b/fer/stk/string_concatenate.F
new file mode 100644
index 0000000..2ea72fa
--- /dev/null
+++ b/fer/stk/string_concatenate.F
@@ -0,0 +1,137 @@
+      SUBROUTINE STRING_CONCATENATE (com_cx,
+     .				 com1, mr1,
+     .				 com2, mr2,
+     .				 res, mres )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a string concatenation operation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533 *sh* 7/01 - based upon OPERATE.F
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	com_cx(4), mr1, mr2, mres, m, n
+	REAL*8  com1( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .		com2( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+        REAL*8   res( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,m5lot:m5hit,m5loe:m5hie,m5lof:m5hif )
+
+* internal variable declarations:
+	INTEGER CX_DIM_LEN, COMPARE_C_STRINGS,
+     .          i, j, k, l, icom, idim,
+     .		i1, j1, k1, l1, m1, n1, i2, j2, k2, l2, m2, n2,
+     .		di1, dj1, dk1, dl1, dm1, dn1, 
+     .		di2, dj2, dk2, dl2, dm2, dn2,
+     .		si1, sj1, sk1, sl1, sm1, sn1, 
+     .		si2, sj2, sk2, sl2, sm2, sn2
+
+* internal parameter declaration
+        INTEGER num_com
+        PARAMETER (num_com = 2)
+
+* equivalence conveniences. Arrays are (idim, icom)
+* "inc" is the increments for each axis of each component
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+	INTEGER	inc(nferdims,4), lo(nferdims,4)
+	EQUIVALENCE
+     .	(lo(1,1),si1), (lo(2,1),sj1), (lo(3,1),sk1), (lo(4,1),sl1), (lo(5,1),sm1), (lo(6,1),sn1), 
+     .	(lo(1,2),si2), (lo(2,2),sj2), (lo(3,2),sk2), (lo(4,2),sl2), (lo(5,2),sm2), (lo(6,2),sn2), 
+     .	(inc(1,1),di1),(inc(2,1),dj1),(inc(3,1),dk1),(inc(4,1),dl1),(inc(5,1),dm1),(inc(6,1),dn1), 
+     .	(inc(1,2),di2),(inc(2,2),dj2),(inc(3,2),dk2),(inc(4,2),dl2),(inc(5,2),dm2),(inc(6,2),dn2)
+
+* compute the delta increment for each axis of each component
+	DO 2 icom = 1, num_com
+	DO 2 idim = 1, nferdims
+	   IF ( CX_DIM_LEN(idim,com_cx(icom)) .EQ. 1 ) THEN
+	      inc(idim,icom) = 0
+	   ELSE
+	      inc(idim,icom) = 1
+	   ENDIF
+ 2	CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+	DO 4 icom = 1, num_com
+	DO 4 idim = 1, nferdims
+ 4	lo(idim,icom) = cx_lo_ss(com_cx(icom),idim) - inc(idim,icom)
+
+	n1 = sn1
+	n2 = sn2
+	DO 200 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 200 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 200 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 200 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 200 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 200 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+             CALL C_STRCAT(com1(i1,j1,k1,l1,m1,n1),
+     .                     com2(i2,j2,k2,l2,m2,n2),
+     .                     res(i,j,k,l,m,n)      )
+
+ 200	CONTINUE
+
+	RETURN
+        END
diff --git a/fer/stk/string_conditional.F b/fer/stk/string_conditional.F
new file mode 100644
index 0000000..1eeb725
--- /dev/null
+++ b/fer/stk/string_conditional.F
@@ -0,0 +1,218 @@
+      SUBROUTINE STRING_CONDITIONAL (operation, num_com, com_cx,
+     .				 com1, mr1,
+     .				 com2, mr2,
+     .				 com3, mr3,
+     .				 res, mres )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a conditional choice on string variables
+!   IF cond THEN string1_array ELSE string2_array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533 *sh* 7/01 - based upon OPERATE.F
+* V67  *acm 3/11 - Fix bugs 1764,1795 (copy/paste errors in setting up 3rd component)
+* V671 7/11  *acm* Ticket 1868 IFV - masking expressions with ifValid, treating 
+*		   zero as valid. 
+*		   (String expressions with IFV are identical to behavior with IF.)
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	operation, num_com, com_cx(4), mr1, mr2, mr3, mres, i3, n2
+	REAL    com1( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+        REAL*8	com2( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m2loe:m2hie,m2lof:m2hif ),
+     .  	com3( m3lox:m3hix,m3loy:m3hiy,m3loz:m3hiz,m3lot:m3hit,m3loe:m3hie,m3lof:m3hif ),
+     .  	res( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,m5lot:m5hit,m5loe:m5hie,m5lof:m5hif )
+
+* internal variable declarations:
+	INTEGER CX_DIM_LEN,
+     .          i, j, k, l, m, n, icom, idim,
+     .		i1, j1, k1, l1, m1, n1, i2, j2, k2, l2, m2, n2
+     .		i3, j3, k3, l3, m3, n3,
+     .		di1, dj1, dk1, dl1, dm1, dn1, 
+     .		di2, dj2, dk2, dl2, dm2, dn2,
+     .		di3, dj3, dk3, dl3, dm3, dn3,
+     .		si1, sj1, sk1, sl1, sm1, sn1, 
+     .		si2, sj2, sk2, sl2, sm2, sn2,
+     .		si3, sj3, sk3, sl3, sm3, sn3, 
+     .          op
+        REAL    bad1
+
+* equivalence conveniences. Arrays are (idim, icom)
+* "inc" is the increments for each axis of each component
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+	INTEGER	inc(nferdims,4), lo(nferdims,4)
+	EQUIVALENCE
+     .	(lo(1,1),si1), (lo(2,1),sj1), (lo(3,1),sk1), (lo(4,1),sl1), (lo(5,1),sm1), (lo(6,1),sn1), 
+     .	(lo(1,2),si2), (lo(2,2),sj2), (lo(3,2),sk2), (lo(4,2),sl2), (lo(5,2),sm2), (lo(6,2),sn2), 
+     .	(lo(1,3),si3), (lo(2,3),sj3), (lo(3,3),sk3), (lo(4,3),sl3), (lo(5,3),sm3), (lo(6,3),sn3),
+     .	(inc(1,1),di1),(inc(2,1),dj1),(inc(3,1),dk1),(inc(4,1),dl1),(inc(5,1),dm1),(inc(6,1),dn1), 
+     .	(inc(1,2),di2),(inc(2,2),dj2),(inc(3,2),dk2),(inc(4,2),dl2),(inc(5,2),dm2),(inc(6,2),dn2), 
+     .	(inc(1,3),di3),(inc(2,3),dj3),(inc(3,3),dk3),(inc(4,3),dl3),(inc(5,3),dm3),(inc(6,3),dn3)
+
+* flag for bad or missing values
+        bad1 = mr_bad_data ( mr1 )
+
+* compute the delta increment for each axis of each component
+	DO 2 icom = 1, num_com
+	DO 2 idim = 1, nferdims
+	   IF ( CX_DIM_LEN(idim,com_cx(icom)) .EQ. 1 ) THEN
+	      inc(idim,icom) = 0
+	   ELSE
+	      inc(idim,icom) = 1
+	   ENDIF
+ 2	CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+	DO 4 icom = 1, num_com
+	DO 4 idim = 1, nferdims
+ 4	lo(idim,icom) = cx_lo_ss(com_cx(icom),idim) - inc(idim,icom)
+
+* operator number (1 thru 3 OK)
+        op = operation
+        IF (op .EQ. 5) op = 3  ! IFV works as for IF
+        IF (op.LT.1 .OR. op.GT.3) STOP 'STR OP?'
+
+        GOTO (100,200,300) op
+
+ 100	CONTINUE
+* "THEN" - comes from IF (condition) THEN (choice)   ... no "ELSE" given
+* component 1 is the condition.  component 2 is the choice
+ 200	n1 = sn1
+	n2 = sn2
+	DO 210 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 210 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 210 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 210 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 210 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 210 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1
+     .	  .AND. com1(i1,j1,k1,l1,m1,n1) .NE. 0.0       ) THEN
+              CALL COPY_C_STRING(com2(i2,j2,k2,l2,m2,n2), res(i,j,k,l,m,n))
+           ELSE
+              CALL SET_NULL_C_STRING(res(i,j,k,l,m,n))
+           ENDIF
+
+ 210	CONTINUE
+	RETURN
+
+* "ELSE" - comes from IF (condition) THEN (choice1) ELSE (choice2)
+* component 1 is the condition.  components 2 and 3 are the choices
+ 300	n1 = sn1
+	n2 = sn2
+	n3 = sn3
+	DO 310 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	n1 = n1 + dn1
+	n2 = n2 + dn2
+	n3 = n3 + dn3
+	m1 = sm1
+	m2 = sm2
+	m3 = sm3
+	 DO 310 m = mr_lo_s4(mres), mr_hi_s4(mres)
+	 m1 = m1 + dm1
+	 m2 = m2 + dm2
+	 m3 = m3 + dm3
+	  l1 = sl1
+	  l2 = sl2
+	  l3 = sl3
+	  DO 310 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  l3 = l3 + dl3
+	  k1 = sk1
+	  k2 = sk2
+	  k3 = sk3
+	   DO 310 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   k3 = k3 + dk3
+	   j1 = sj1
+	   j2 = sj2
+	   j3 = sj3
+	    DO 310 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    j3 = j3 + dj3
+	    i1 = si1
+	    i2 = si2
+	    i3 = si3
+	     DO 310 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+	     i3 = i3 + di3
+
+	   IF ( com1(i1,j1,k1,l1,m1,n1) .NE. bad1
+     .	  .AND. com1(i1,j1,k1,l1,m1,n1) .NE. 0.0       ) THEN
+              CALL COPY_C_STRING(com2(i2,j2,k2,l2,m2,n2), res(i,j,k,l,m,n))
+           ELSE
+              CALL COPY_C_STRING(com3(i3,j3,k3,l3,m3,n3), res(i,j,k,l,m,n))
+           ENDIF
+
+ 310	CONTINUE
+	RETURN
+
+        END
diff --git a/fer/stk/string_context.F b/fer/stk/string_context.F
new file mode 100644
index 0000000..e0b0fa0
--- /dev/null
+++ b/fer/stk/string_context.F
@@ -0,0 +1,49 @@
+	SUBROUTINE STRING_CONTEXT
+     .		      ( uvar,
+     .			item, 
+     .			default_cx,
+     .			string_cx,
+     .			status )
+
+* return in string_cx context information describing the string context
+* this is for a "cat_string" - a literal string embedded in a var defn
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500  1/99 *sh*  based on const_context
+* V530  8/00 *sh*  adding support for arrays of strings
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	INTEGER		default_cx, string_cx, uvar, item, status
+
+* internal variable declarations:
+	INTEGER		idim
+
+* initialize
+	CALL TRANSFER_CONTEXT ( default_cx, string_cx )
+	cx_category( string_cx ) = cat_string
+	cx_type    ( string_cx ) = ptype_string
+	cx_bad_data( string_cx ) = bad_val4
+	cx_data_set( string_cx ) = pdset_irrelevant
+	cx_dset_gvn( string_cx ) = .TRUE.
+	cx_variable( string_cx ) = 1000*uvar + item     ! packed info
+	cx_grid    ( string_cx ) = mgrid_abstract
+
+* flesh out context by removing all axes limits
+	DO 200 idim = 1, nferdims
+ 200	CALL DEL_CX_DIM( idim, string_cx )
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+	END
diff --git a/fer/stk/string_operate.F b/fer/stk/string_operate.F
new file mode 100644
index 0000000..00171f9
--- /dev/null
+++ b/fer/stk/string_operate.F
@@ -0,0 +1,189 @@
+      SUBROUTINE STRING_OPERATE (operation, com_cx,
+     .				 com1, mr1,
+     .				 com2, mr2,
+     .				 res, mres )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* perform a logical string operation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533 *sh* 7/01 - based upon OPERATE.F
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include 'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	operation, com_cx(4), mr1, mr2, mres, m, n
+	REAL*8  com1( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .		com2( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+        REAL    res( m5lox:m5hix,m5loy:m5hiy,m5loz:m5hiz,m5lot:m5hit,m5loe:m5hie,m5lof:m5hif )
+
+* internal variable declarations:
+	INTEGER CX_DIM_LEN, COMPARE_C_STRINGS,
+     .          i, j, k, l, icom, idim, comp, op,
+     .		i1, j1, k1, l1, m1, n1, i2, j2, k2, l2, m2, n2,
+     .		di1, dj1, dk1, dl1, dm1, dn1, 
+     .		di2, dj2, dk2, dl2, dm2, dn2,
+     .		si1, sj1, sk1, sl1, sm1, sn1, 
+     .		si2, sj2, sk2, sl2, sm2, sn2
+
+* internal parameter declaration
+        INTEGER num_com
+        PARAMETER (num_com = 2)
+
+* equivalence conveniences. Arrays are (idim, icom)
+* "inc" is the increments for each axis of each component
+* "lo"  is the starting subscript (minus 1) for each axis of each component
+	INTEGER	inc(nferdims,4), lo(nferdims,4)
+	EQUIVALENCE
+     .	(lo(1,1),si1), (lo(2,1),sj1), (lo(3,1),sk1), (lo(4,1),sl1), (lo(5,1),sm1), (lo(6,1),sn1), 
+     .	(lo(1,2),si2), (lo(2,2),sj2), (lo(3,2),sk2), (lo(4,2),sl2), (lo(5,2),sm2), (lo(6,2),sn2), 
+     .	(inc(1,1),di1),(inc(2,1),dj1),(inc(3,1),dk1),(inc(4,1),dl1),(inc(5,1),dm1),(inc(6,1),dn1), 
+     .  (inc(1,2),di2),(inc(2,2),dj2),(inc(3,2),dk2),(inc(4,2),dl2),(inc(5,2),dm2),(inc(6,2),dn2)
+
+* compute the delta increment for each axis of) each component
+	DO 2 icom = 1, num_com
+	DO 2 idim = 1, nferdims
+	   IF ( CX_DIM_LEN(idim,com_cx(icom)) .EQ. 1 ) THEN
+	      inc(idim,icom) = 0
+	   ELSE
+	      inc(idim,icom) = 1
+	   ENDIF
+ 2	CONTINUE
+
+* compute the starting subscript for each axis of each component
+* (pre-decrement by 1 delta for looping ahead)
+	DO 4 icom = 1, num_com
+	DO 4 idim = 1, nferdims
+ 4	lo(idim,icom) = cx_lo_ss(com_cx(icom),idim) - inc(idim,icom)
+
+* operator number (8 thru 13 OK)
+        op = operation - 7
+        IF (op.LT.1 .OR. op.GT.6) STOP 'STR OP?'
+
+	n1 = sn1
+	n2 = sn2
+	DO 200 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	 n1 = n1 + dn1
+	 n2 = n2 + dn2
+	 m1 = sm1
+	 m2 = sm2
+	  DO 200 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	  m1 = m1 + dm1
+	  m2 = m2 + dm2
+	  l1 = sl1
+	  l2 = sl2
+	  DO 200 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	  l1 = l1 + dl1
+	  l2 = l2 + dl2
+	  k1 = sk1
+	  k2 = sk2
+	   DO 200 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   k1 = k1 + dk1
+	   k2 = k2 + dk2
+	   j1 = sj1
+	   j2 = sj2
+	    DO 200 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	    j1 = j1 + dj1
+	    j2 = j2 + dj2
+	    i1 = si1
+	    i2 = si2
+	     DO 200 i = mr_lo_s1(mres), mr_hi_s1(mres)
+	     i1 = i1 + di1
+	     i2 = i2 + di2
+
+             comp = COMPARE_C_STRINGS(com1(i1,j1,k1,l1,m1,n1),
+     .                                com2(i2,j2,k2,l2,m2,n2) )
+
+             GOTO (10,20,30,40,50,60) op
+
+* op = 1 "GT"
+ 10          IF ( comp .GT. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+              GOTO 200
+
+* op = 2 "GE"
+ 20          IF ( comp .GE. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+              GOTO 200
+
+* op = 3 "LT"
+ 30          IF ( comp .LT. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+              GOTO 200
+
+* op = 4 "LE"
+ 40          IF ( comp .LE. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+              GOTO 200
+
+* op = 5 "EQ"
+ 50          IF ( comp .EQ. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+              GOTO 200
+
+* op = 6 "NE"
+ 60          IF ( comp .NE. 0 ) THEN
+		 res(i,j,k,l,m,n) = 1.0
+	      ELSE
+		 res(i,j,k,l,m,n) = 0.0
+	      ENDIF
+
+ 200	CONTINUE
+
+	RETURN
+        END
diff --git a/fer/stk/svar_context.F b/fer/stk/svar_context.F
new file mode 100644
index 0000000..921c618
--- /dev/null
+++ b/fer/stk/svar_context.F
@@ -0,0 +1,48 @@
+	SUBROUTINE STRING_CONTEXT
+     .		      ( uvar,
+     .			item, 
+     .			default_cx,
+     .			string_cx,
+     .			status )
+
+* return in string_cx context information describing the string context
+* this is for a "cat_string" - a literal string embedded in a var defn
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500  1/99 *sh*  based on const_context
+* V530  8/00 *sh*  adding support for arrays of strings
+	
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xalgebra.cmn'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations:
+	INTEGER		default_cx, string_cx, uvar, item, status
+
+* internal variable declarations:
+	INTEGER		idim
+
+* initialize
+	CALL TRANSFER_CONTEXT ( default_cx, string_cx )
+	cx_category( string_cx ) = cat_string
+	cx_type    ( string_cx ) = ptype_string
+	cx_bad_data( string_cx ) = bad_val4
+	cx_data_set( string_cx ) = pdset_irrelevant
+	cx_dset_gvn( string_cx ) = .TRUE.
+	cx_variable( string_cx ) = 1000*uvar + item     ! packed info
+	cx_grid    ( string_cx ) = mgrid_abstract
+
+* flesh out context by removing all axes limits
+	DO 200 idim = 1, nferdims
+ 200	CALL DEL_CX_DIM( idim, string_cx )
+
+	status = ferr_ok
+	RETURN
+
+* error exit
+	END
diff --git a/fer/stk/transfer_isp.F b/fer/stk/transfer_isp.F
new file mode 100644
index 0000000..53e07e6
--- /dev/null
+++ b/fer/stk/transfer_isp.F
@@ -0,0 +1,65 @@
+	SUBROUTINE TRANSFER_ISP ( source, dest )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer context of the ISP stack from one location to anothe
+
+* V690 2/14 *sh*
+
+	IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations
+	INTEGER	source, dest
+
+* internal declarations
+	INTEGER	idim, i
+
+	is_sum   ( dest ) = is_sum   ( source )
+	is_act	 ( dest ) = is_act   ( source )
+	is_cx	 ( dest ) = is_cx    ( source )
+	is_big_cx( dest ) = is_big_cx( source )
+	is_phase ( dest ) = is_phase ( source )
+	is_obj   ( dest ) = is_obj   ( source )
+	is_axis  ( dest ) = is_axis  ( source )
+	is_uvar  ( dest ) = is_uvar  ( source )
+	is_mr	 ( dest ) = is_mr    ( source )
+
+	RETURN
+	END
diff --git a/fer/stk/unprotect_cmnd_data.F b/fer/stk/unprotect_cmnd_data.F
new file mode 100644
index 0000000..6a6bb30
--- /dev/null
+++ b/fer/stk/unprotect_cmnd_data.F
@@ -0,0 +1,71 @@
+	SUBROUTINE UNPROTECT_CMND_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* unprotect (flag as not in use) the data from the most recent command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V230: 7/27/92 - removed code from GET_CMND_DATA
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations
+* ...
+
+* local variable declarations
+	INTEGER		nu, mr
+
+* remove protections from the data grids
+	DO 400 nu = 1, num_uvars_in_cmnd
+	   mr = is_mr( nu )
+	   IF ( mr_protected(mr) .NE. mr_deleted ) 
+     .                                CALL MR_NOT_IN_USE( mr )
+ 400	CONTINUE
+
+! temp diagnostic - last mem var fetched should never be in-use by this stage
+ 	IF ( mr_protected( mr ) .NE. mr_perm_protected
+     . .AND. mr_protected( mr ) .NE. mr_not_protected
+     . .AND. mr_protected( mr ) .NE. mr_temporary
+     . .AND. mr_protected( mr ) .NE. mr_deleted )
+     .			WRITE (6,*) 'get_cmnd_prot_err'
+
+ 	RETURN
+	END
diff --git a/fer/stk/xerror.F b/fer/stk/xerror.F
new file mode 100644
index 0000000..94097c9
--- /dev/null
+++ b/fer/stk/xerror.F
@@ -0,0 +1,45 @@
+	SUBROUTINE XERROR(MESSG,NMESSG,NERR,LEVEL)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* dummy error routine for CMLIB package
+* used to avoid changes to UNI.FOR
+
+	CHARACTER*(*) messg
+	INTEGER	NMESSG,NERR,LEVEL
+
+	STOP 'UNI error'
+	END
diff --git a/fer/utl/LIB_NAME b/fer/utl/LIB_NAME
new file mode 100644
index 0000000..34250b2
--- /dev/null
+++ b/fer/utl/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libutl.a 
diff --git a/fer/utl/Makefile b/fer/utl/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/utl/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/utl/SOURCE_FILES b/fer/utl/SOURCE_FILES
new file mode 100644
index 0000000..b760df6
--- /dev/null
+++ b/fer/utl/SOURCE_FILES
@@ -0,0 +1,168 @@
+SRCS_F = \
+add_2_grids.F\
+add_2_grids_sub.F\
+add_c_2_grid.F\
+adjust_copy_limits.F\
+allo_grid.F\
+allo_managed_axis.F\
+allo_managed_grid.F\
+arg_to_item.F\
+attrib_string.F\
+attrib_vals.F\
+axis_distance.F\
+axis_intervals.F\
+bkwd_axis.F\
+box_bounds.F\
+box_size.F\
+calendar_axis.F\
+cal_factr.F\
+caxis_len.F\
+caxis_modlen.F\
+check_neg_taxis.F\
+confine_axis.F\
+copy_2d_to_3d.F\
+copy_2d_to_3d_sub.F\
+copy_grid.F\
+copy_grid_sub.F\
+copy_grid_trans.F\
+copy_grid_trans_sub.F\
+copy_agg_into.F\
+copy_agg_into_sub.F\
+copy_agg_ptr_into_sub.F\
+copy_into.F\
+copy_into_mapped.F\
+copy_into_mapped_sub.F\
+copy_ptr_into_mapped_sub.F\
+copy_ptr_into_sub.F\
+copy_into_sub.F\
+copy_ptr_grid_sub.F\
+count_number_list.F\
+create_counter_list.F\
+cstring_insert.F\
+de_escape_string.F\
+deallo_all_axes.F\
+deallo_all_grids.F\
+deallo_grid.F\
+deallo_unformed_grid.F\
+decrement_plot_grid.F\
+dense_contig_region.F\
+depend_stat_var.F\
+depend_stat_var_sub.F\
+display_dependency.F\
+display_dependency_sub.F\
+extract_dp_line.F\
+extract_dp_line2.F\
+extract_line.F\
+extract_line_sub.F\
+extract_z_line.F\
+field_minmax.F\
+field_minmax_sub.F\
+gcf_arg_type.F\
+gcf_child_var_name.F\
+gcf_find_fcn.F\
+gcf_get_arg_lims.F\
+gcf_get_arg_parms.F\
+gcf_get_axis_srcs.F\
+gcf_get_imposed_axes.F\
+gcf_impose_arg_lim_dflts.F\
+gcf_impose_axes.F\
+gcf_impose_result_lims.F\
+gcf_name.F\
+gcf_num_args.F\
+gcf_parent_char.F\
+gcf_parent_uvar.F\
+gcf_rtn_type.F\
+geog_var.F\
+get_ave_lims.F\
+get_dependency_status.F\
+get_max_string_len.F\
+get_max_string_len_sub.F\
+get_string_element.F\
+get_unique_dset_name.F\
+get_window_lims.F\
+getunit.F\
+gname_from_number.F\
+go_file_input.F\
+grid_from_name.F\
+grid_from_name_xml.F\
+grid_subscript_extremes.F\
+grid_subscript_extremes_no_mod.F\
+grid_world_extremes.F\
+heap2.F\
+heap2_v.F\
+hunt_indices.F\
+hunt_r4.F\
+igrid.F\
+inherit_attrs.F\
+invalid_r8_to_i4.F\
+is_template.F\
+isubscr_cx.F\
+isubscript.F\
+itsa_fill_trans.F\
+itsa_gcvar.F\
+itsa_modulo_axis.F\
+itsa_modulo_gcf.F\
+itsa_modulo_regrid.F\
+itsa_pure_sum_var.F\
+legal_chars.F\
+make_axis.F\
+make_step_axis.F\
+match4.F\
+match_name.F\
+match_quoted_name.F\
+match_template.F\
+minmax.F\
+modulo_parity.F\
+mult_grid.F\
+ndig_coords.F\
+no_grid_range.F\
+no_line_range.F\
+open_show_file.F\
+pack_line_storage.F\
+parse_nam_dset_grd.F\
+parse_number_list.F\
+parse_string_list.F\
+permute.F\
+permute_ptr_sub.F\
+permute_sub.F\
+region_number.F\
+regularly_spaced.F\
+report_aux_dependency.F\
+report_dependency.F\
+reset_secs_from_bc.F\
+reverse_grid_axis.F\
+reverse_grid_axis_sub.F\
+secs_from_bc.F\
+secs_to_date.F\
+secs_to_date_c.F\
+secs_to_date_out.F\
+secs_to_tstep.F\
+set_auto_curvi_modes.F\
+sort_list.F\
+shellr.F\
+short_mod_copy.F\
+split_list.F\
+ss_neighbors.F\
+store_dependency.F\
+store_string.F\
+store_sys_strings.F\
+str_match.F\
+sub_2_grids.F\
+sub_2_grids_sub.F\
+t_deriv.F\
+tdest_world.F\
+tdest_world_init.F\
+transfer_axis.F\
+transfer_cx_axis_to_uv.F\
+transfer_grid.F\
+transfer_uv_axis_to_uv.F\
+true_or_false.F\
+tstep_to_date.F\
+tstep_to_secs.F\
+tworld.F\
+unit_chg_ax.F\
+update_attributes.F\
+upper_case.F\
+valid_grid.F\
+which_gcfcn.F \
+get_date_and_time.F
diff --git a/fer/utl/add_2_grids.F b/fer/utl/add_2_grids.F
new file mode 100644
index 0000000..e2dc69d
--- /dev/null
+++ b/fer/utl/add_2_grids.F
@@ -0,0 +1,79 @@
+	SUBROUTINE ADD_2_GRIDS( src, msrc, dst, mdst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* add data from one grid to another
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/30/86
+* revision 1.0 - 1/26/87 - rewritten using mr grid descriptions
+* V200:  7/26/89 - 4D symmetrical version
+*	10/12/89 - use ..._SUB - avoid adjustable dimensioning with array
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, mdst
+	REAL    src( * ), dst( * )
+
+* --- end of introductory code ---
+
+	CALL ADD_2_GRIDS_SUB(
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .				 mr_bad_data( msrc ),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst),
+     .				 mr_bad_data( mdst )			)
+
+
+	RETURN
+	END 
diff --git a/fer/utl/add_2_grids_sub.F b/fer/utl/add_2_grids_sub.F
new file mode 100644
index 0000000..367701a
--- /dev/null
+++ b/fer/utl/add_2_grids_sub.F
@@ -0,0 +1,88 @@
+	SUBROUTINE ADD_2_GRIDS_SUB (
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif, bad_src,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif, bad_dst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* add data from one grid to another
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/12/89
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+      INTEGER slox, shix, sloy, shiy, sloz, shiz, 
+     .	      slot, shit, sloe, shie, slof, shif,
+     .	      dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .	      dlot, dhit, dloe, dhie, dlof, dhif
+      REAL src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .     dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+      REAL bad_src, bad_dst
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	DO 100 n = dlof, dhif
+	DO 100 m = dloe, dhie
+	DO 100 l = dlot, dhit
+	DO 100 k = dloz, dhiz
+	DO 100 j = dloy, dhiy
+	DO 100 i = dlox, dhix
+
+	   IF (  src(i,j,k,l,m,n) .NE. bad_src
+     .	   .AND. dst  (i,j,k,l,m,n) .NE. bad_dst ) THEN
+
+	      dst(i,j,k,l,m,n) = dst(i,j,k,l,m,n) + src(i,j,k,l,m,n)
+
+	   ELSE
+
+	      dst(i,j,k,l,m,n) = bad_dst
+
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/add_c_2_grid.F b/fer/utl/add_c_2_grid.F
new file mode 100644
index 0000000..758fffa
--- /dev/null
+++ b/fer/utl/add_c_2_grid.F
@@ -0,0 +1,62 @@
+	SUBROUTINE ADD_C_2_GRID ( length, grid_data, addend )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* add a constant to a grid
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/25/87
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	length
+	REAL	grid_data( length ), addend
+
+* internal variable declarations:
+	INTEGER	i
+		
+	DO 100 i = 1, length
+ 100	IF (  grid_data(i) .NE. bad_val4 )
+     .			grid_data(i) = grid_data(i) + addend
+
+	RETURN
+	END
+
diff --git a/fer/utl/adjust_copy_limits.F b/fer/utl/adjust_copy_limits.F
new file mode 100644
index 0000000..1134e88
--- /dev/null
+++ b/fer/utl/adjust_copy_limits.F
@@ -0,0 +1,101 @@
+	SUBROUTINE ADJUST_COPY_LIMITS (axis, mchunk, sorted_indices,
+     .				       phase, max_phase)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* a "chunk" of source data is available. The variable sorted_indices contains
+* a list of subscript values to be pulled from that source data . The current
+* value of "phase" indicates the index of the highest sorted_index that
+* we intend to use from the chunk of source data. In this routine we
+* check to see if more source data might be available that was expected, and
+* if so, we adjust the phase upward to utilize all of what's available
+* ==> this routine is solely to optimize performance
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 10/99 *sh*
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+!	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER  axis, mchunk, phase, max_phase
+	REAL    sorted_indices(max_phase)
+
+
+* internal variable declarations
+	INTEGER max_available, lo_phase, hi_phase, test
+
+* A typical scenario for the use of this routine might be as follows:
+*   sorted list of subscripts at which to sample: {11,12,14,16,18,20}
+*   souce data along axis extends from 1:19
+*   current phase=3 (sorted_indices(phase)=14)
+*   so we should adjust phase to a new value of 5 (sorted_indices(phase)=18)
+
+* initialize
+	max_available = mr_hi_ss(mchunk,axis)
+
+* screen out obvious cases
+	IF (sorted_indices(phase) .GE. max_available) THEN
+* ... current phase is already as high as it can be
+	   RETURN   ! phase is OK as-is
+	ELSEIF (sorted_indices(max_phase) .LE. max_available) THEN
+* ... can utilize the entire chunk of data available
+	   phase = max_phase
+	   RETURN
+	ENDIF 
+
+* initialize search for max that can be used from the chunk
+	lo_phase = phase
+	hi_phase = max_phase
+
+* binary search 
+ 100	test = (lo_phase+hi_phase)/2
+	IF (sorted_indices(test) .GT. max_available) THEN
+	   hi_phase = test
+	   GOTO 100
+	ELSEIF (sorted_indices(test+1) .GT. max_available) THEN
+	   phase = test
+	   RETURN
+	ELSE
+	   lo_phase = test
+	   GOTO 100
+	ENDIF
+
+	END 
diff --git a/fer/utl/allo_grid.F b/fer/utl/allo_grid.F
new file mode 100644
index 0000000..2603e40
--- /dev/null
+++ b/fer/utl/allo_grid.F
@@ -0,0 +1,69 @@
+	SUBROUTINE ALLO_GRID( grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* allocate a scratch space in the grid COMMON to work on a grid definition
+* Space is allocated in high grid subscripts working down
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/22/89
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'errmsg.parm'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	grid, status
+
+	grid = grd_stk_ptr - 1
+
+	IF ( grid_name(grid) .NE. char_init16 ) CALL ERRMSG
+     .		( ferr_stack_ovfl, status, 'grid stack',*5000 )
+
+	grd_stk_ptr = grid
+
+	status = ferr_ok
+ 5000	RETURN
+	END
diff --git a/fer/utl/allo_managed_axis.F b/fer/utl/allo_managed_axis.F
new file mode 100644
index 0000000..d3b4a30
--- /dev/null
+++ b/fer/utl/allo_managed_axis.F
@@ -0,0 +1,88 @@
+	INTEGER*4 FUNCTION ALLO_MANAGED_AXIS ( islot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Locates an unused axis (line) slot and returns it.
+* This routine parallels TM_FIND_LINE_SLOT in function but whereas that
+* routine allocates from lower memory in grid common and leaves gaps
+* as axes are deleted this routine allocates from upper memory and uses
+* linked lists to maintain integrity.
+* If no axis slot is available this returns returns error.
+
+* This code is a temporary version that does NOT use linked lists.  Instead
+* it simply locates the first available axis slot starting from position one.
+* By contrast TM_FIND_LINE_SLOT locates the beginning of the upper contiguous
+* grid storage space
+
+* This routine functions as a part of the TMAP library
+
+* for FERRET version 4.00 8/94  *sh*
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* Arguments
+	INTEGER*4	islot
+*
+* Parameters and commons
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Local declarations
+	CHARACTER*13    TM_STRING
+	INTEGER status
+
+	DO 100 islot = 1, max_lines
+	  IF (line_name(islot) .EQ. char_init16) THEN
+	    ALLO_MANAGED_AXIS = merr_ok
+	    RETURN
+	  ENDIF
+  100	CONTINUE
+
+*
+* No slot available
+ 9000	CALL TM_ERRMSG (merr_linelim, status,
+     .	                'ALLO_MANAGED_AXIS', no_descfile, no_stepfile,
+     .	                'MAX='//TM_STRING(DBLE(max_lines)), 
+     .                   no_errstring,*9999)
+
+
+ 9999	ALLO_MANAGED_AXIS = status
+	RETURN
+	END
diff --git a/fer/utl/allo_managed_grid.F b/fer/utl/allo_managed_grid.F
new file mode 100644
index 0000000..df9b9e1
--- /dev/null
+++ b/fer/utl/allo_managed_grid.F
@@ -0,0 +1,89 @@
+	INTEGER*4 FUNCTION ALLO_MANAGED_GRID ( islot )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Locates an unused grid slot and returns it.
+* This routine parallels TM_FIND_GRID_SLOT in function but whereas that
+* routine allocates from lower memory in grid common and leaves gaps
+* as grids are deleted this routine allocates from upper memory and uses
+* linked lists to maintain integrity.
+* If no grid slot is available this returns returns error.
+
+* This code is a temporary version that does NOT use linked lists.  Instead
+* it simply locates the first available grid slot starting from position one.
+* By contrast TM_FIND_GRID_SLOT locates the beginning of the upper contiguous
+* grid storage space
+
+* This routine functions as a part of the TMAP library
+
+* for FERRET version 4.00 8/94  *sh*
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* Arguments
+	INTEGER*4	islot
+*
+* Parameters and commons
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xfr_grid.cmn'			! fr200
+*
+* Local declarations
+	CHARACTER*13	TM_STRING
+	INTEGER status
+
+	DO 100 islot = 1, grd_stk_ptr-1
+	  IF (grid_name(islot) .EQ. char_init16) THEN
+	     ALLO_MANAGED_GRID = merr_ok
+	     RETURN
+	  ENDIF
+  100	CONTINUE
+
+
+* No slot available
+ 9000	CALL TM_ERRMSG (merr_gridlim, status,
+     .	                'ALLO_MANAGED_GRID', no_descfile, no_stepfile,
+     .	                'MAX='//TM_STRING(DBLE(max_grids)), no_errstring,
+     .	                *9999)
+
+
+ 9999	ALLO_MANAGED_GRID = status
+	RETURN
+	END
diff --git a/fer/utl/arg_to_item.F b/fer/utl/arg_to_item.F
new file mode 100644
index 0000000..daa4b2d
--- /dev/null
+++ b/fer/utl/arg_to_item.F
@@ -0,0 +1,68 @@
+	SUBROUTINE ARG_TO_ITEM
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer the list of arguments into a list of items
+
+* this is a bit of a kludge recognizing that the Ferret command language
+* is confusing if it requires uses to recognize the difference between
+* "SHOW GRID A,B" and "SHOW GRID A B"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420:  4/96
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* internal variable declarations:
+	INTEGER	i
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xprog_state.cmn'
+
+* if the user did not separate items by commas then make it appear the he did
+
+	IF ( num_args.GT.1 .AND. num_items.EQ.1 ) THEN
+	   num_items = num_args
+	   DO 100 i = 1, num_args
+	      item_start(i) = arg_start(i)
+	      item_end(i)   = arg_end(i)
+ 100	   CONTINUE
+	ENDIF
+
+	RETURN
+	END	
diff --git a/fer/utl/attrib_string.F b/fer/utl/attrib_string.F
new file mode 100644
index 0000000..bab36d9
--- /dev/null
+++ b/fer/utl/attrib_string.F
@@ -0,0 +1,94 @@
+	SUBROUTINE ATTRIB_STRING (cx, mr, dset, varid, varname, attname,
+     .			          status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* get string attribute values
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 8/18/05
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		cx, mr, status
+	INTEGER		dset, varid
+	CHARACTER*(*)	varname, attname
+
+* internal variable declarations
+	LOGICAL		NC_GET_ATTRIB, got_em, do_warn
+	INTEGER 	TM_LENSTR1, attlen, n, vlen, alen, aflag
+	CHARACTER	buff*2048
+        REAL            vals
+
+* internal parameter declarations
+        INTEGER       maxlen  ! length of buff to store string value
+        PARAMETER     ( maxlen = 2048)
+
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xvariables.cmn'
+
+* initialize
+	n      = 1
+        do_warn = .FALSE.
+
+* Get float values 
+	got_em = NC_GET_ATTRIB ( dset, varid, attname,
+     .                           do_warn, varname, maxlen,
+     .                           attlen, aflag, buff, vals )
+        IF (.NOT. got_em) GOTO 5000
+
+c store in string variable
+	CALL STORE_STRING(buff(1:attlen), mr, n-1, status)
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+
+* syntax error
+ 4999	RETURN
+
+ 5000	vlen = TM_LENSTR1(varname)
+        alen = TM_LENSTR1(attname)
+        buff = varname(:vlen)//"."//attname(:alen)
+        vlen = vlen + alen + 1
+        CALL ERRMSG( ferr_unknown_attribute, status, 
+     .  'attribute not found:  '//buff(:vlen), *4999 )
+
+	END
diff --git a/fer/utl/attrib_vals.F b/fer/utl/attrib_vals.F
new file mode 100644
index 0000000..2cc37fd
--- /dev/null
+++ b/fer/utl/attrib_vals.F
@@ -0,0 +1,83 @@
+	SUBROUTINE ATTRIB_VALS( array, nmax, n, 
+     .			    dset, varid, varname, attname, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* get float attribute values
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 8/18/05
+* V670  2/11 *acm*   Fixes for inheriting attributes.
+
+* calling argument declarations
+	INTEGER		nmax, n, dset, varid, status
+	REAL		array(*)
+	CHARACTER*(*)	varname, attname
+
+* internal variable declarations
+        LOGICAL         NC_GET_ATTRIB, got_em, do_warn
+	INTEGER 	TM_LENSTR1, attlen, vlen, alen, aflag
+        CHARACTER*10    buff
+
+	include 'ferret.parm'
+        include 'errmsg.parm'
+
+* initialize
+	n = 0
+        do_warn = .FALSE.
+
+* Get float values 
+	got_em = NC_GET_ATTRIB ( dset, varid, attname,
+     .                           do_warn, varname, nmax,
+     .                           attlen, aflag, buff, array )
+        IF (.NOT. got_em) GOTO 5000
+	n = attlen
+
+
+* success
+ 	status = ferr_ok
+	RETURN
+
+* syntax error
+ 4999   RETURN
+ 5000	vlen = TM_LENSTR1(varname)
+        alen = TM_LENSTR1(attname)
+        buff = varname(:vlen)//"."//attname(:alen)
+        vlen = vlen + alen + 1
+        CALL ERRMSG( ferr_unknown_attribute, status, 
+     .  'attribute not found:  '//buff(:vlen), *4999 )
+
+	END
diff --git a/fer/utl/axis_distance.F b/fer/utl/axis_distance.F
new file mode 100644
index 0000000..01e4343
--- /dev/null
+++ b/fer/utl/axis_distance.F
@@ -0,0 +1,73 @@
+	REAL FUNCTION AXIS_DISTANCE ( lo_val, hi_val, idim, grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute the length of axis between the low and high limits given 
+* converted to uniform units ( m ) in x, y and z
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/12/87
+* revision 0.1 - 6/3/87  - changed km --> m as standard unit
+* revision 0.2 - 4/18/88 - passed grid to get unit conversion factor
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'xunits.cmn_text'
+	external xunits_data
+	include	'ferret.parm'
+
+* calling argument declarations:
+	REAL*8	lo_val, hi_val
+	INTEGER	idim, grid
+
+* internal variable declarations:
+	INTEGER	line, un
+
+* simplest length
+	AXIS_DISTANCE = hi_val - lo_val
+
+* convert to uniform units
+	line = grid_line(idim,grid)
+	un   = line_unit_code(line)
+	AXIS_DISTANCE = AXIS_DISTANCE * un_convert( un )
+
+	RETURN
+	END
diff --git a/fer/utl/axis_intervals.F b/fer/utl/axis_intervals.F
new file mode 100644
index 0000000..3f07247
--- /dev/null
+++ b/fer/utl/axis_intervals.F
@@ -0,0 +1,194 @@
+	SUBROUTINE AXIS_INTERVALS(
+     .				horiz_or_vert, mr, cx, idim, curvilinear,
+     .				axis, lo_ss, hi_ss, lo_world, hi_world,
+     .				n_regrid, d_regrid, regrid, irregular )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert required points of axis to single precision and determine
+* re-gridding needs for non-constant spaced points
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/23/87
+* revision 0.1 - 2/25/88 - added 2-direction Z-axis option
+* revision 0.1 - 9/20/88 - create axis with MAKE_AXIS
+* V200:  5/19/89 - reorder lo/hi_ss arguments
+*	10/16/89 - eliminated invalid adjustable array subscripts
+*        1/28/93 - allow axes of length 1
+* V450: 3/97 - support for curvilinear coordinate plots
+* V552: 5/03 - If the axis is known to be regular, dont do the test on 
+*              whether "regrid" is needed. (this flagged fine axes as
+*              irregular when in fact they arent).
+* V553: 6/03 - the calculation of d_regrid for regular axes was wrong if 
+*              theres a subspan-modulo void point
+* v553: 7/03 - The initial d_regrid does need to start with 
+*                axis( lo_cx + 1 ) - axis( lo_cx )
+*              or it may miss an irregular part of the grid; the calculation
+*              should be correct and not hit the subspan-modulo void point,
+*              (how to test this???)
+* V600  7/05  Fix for bug 900: If the axis is subspan modulo, and if the 
+*              region we are using extends beyond the core range of the 
+*              axis, then we need to set it to irregular within this routine.
+* V600  10/05  change to a comment only, added when fixing bug1347.
+* V603   5/07  Fixes for bug 900 and 1487. If the start or end point is the 
+*              modulo subspan void point, return the actual first or last axis 
+*              point instead.
+* V68    4/11  Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+        include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+        include 'xtm_grid.cmn_text'  
+
+* calling argument declarations:
+	LOGICAL	curvilinear, regrid, irregular
+	INTEGER	mr, cx, idim, lo_ss, hi_ss, n_regrid
+	REAL 	axis( lo_ss:hi_ss )
+	REAL 	lo_world, hi_world, d_regrid
+	CHARACTER*1 horiz_or_vert
+
+* internal variable declarations:
+	LOGICAL	BKWD_AXIS, TM_ITS_SUBSPAN_MODULO, TM_FPEQ, is_subspan,
+     .          void_at_start, void_at_end
+	INTEGER	CGRID_AXIS, TM_LENSTR1, lo_cx, hi_cx, grid, i, iaxis,
+     .          ilen, ier, ist
+        CHARACTER*20 buff
+
+* initialize
+	grid   = mr_grid( mr )
+	lo_cx = cx_lo_ss( cx, idim )
+	hi_cx = cx_hi_ss( cx, idim )
+
+* make a single precision axis corresponding to the subscript range of the
+* memory variable (mr)
+	IF ( curvilinear ) THEN
+* ... axis of index values (other command line args provide true coordinates)
+	   DO 100 i = lo_ss, hi_ss
+ 100	   axis(i) = i
+	ELSE
+	   CALL MAKE_AXIS( grid, idim, lo_ss, hi_ss, axis(lo_ss) )
+	ENDIF
+
+* single point?  Fake up some reasonable values.
+        IF ( lo_ss .EQ. hi_ss ) THEN
+           d_regrid = 1.
+           IF ( axis(lo_cx) .EQ. 0.0 ) THEN
+              lo_world = -1.
+              hi_world =  1.
+           ELSE
+              lo_world = axis(lo_cx) * 0.999
+              hi_world = axis(lo_cx) * 1.001
+	      IF ( TM_FPEQ(lo_world, hi_world) ) THEN 
+                 lo_world = axis(lo_cx) * 0.99
+                 hi_world = axis(lo_cx) * 1.01
+	      ENDIF
+           ENDIF
+           RETURN
+        ENDIF
+
+* determine if regridding is needed within the (cx) region to be plotted
+* ... and determine smallest grid interval
+	regrid = .FALSE.		! assume it's not needed
+        d_regrid = axis( lo_cx + 1 ) - axis( lo_cx )   
+
+        iaxis = CGRID_AXIS(idim,cx)
+        is_subspan = TM_ITS_SUBSPAN_MODULO( iaxis  )
+        void_at_start = is_subspan .AND. (lo_ss.EQ.0)
+        void_at_end  = is_subspan .AND. (hi_ss.EQ.line_dim(iaxis)+1 )
+
+        IF (irregular .OR. is_subspan) THEN
+	   DO 200 i = lo_cx+1, hi_cx-1
+* ... test within precision limits that may be visible in a plot
+
+	      IF (ABS((axis(i+1)-axis(i))/d_regrid - 1.0) .GT. 3.E-6) THEN
+		   d_regrid = MIN( d_regrid, axis(i+1)-axis(i) )
+		   regrid = .TRUE.
+
+*     If irregularity is found only because of the void point on the axis,
+*     set regrid flag back to false
+
+                   IF (is_subspan .AND. void_at_start .AND. i.EQ.lo_cx+1)
+     .                regrid = .FALSE.
+                   IF (is_subspan .AND. void_at_end .AND. i.EQ.hi_cx-1)
+     .                regrid = .FALSE.
+                   IF (is_subspan .AND. (i.EQ.-1 .OR. i.EQ.0) )
+     .                regrid = .FALSE.
+
+	      ENDIF
+ 200	   CONTINUE
+	ENDIF
+
+* regridding parameters
+	lo_world = axis(lo_cx)
+	hi_world = axis(hi_cx)
+
+* If the start or end point is the modulo subspan void point, return
+* the actual first or last axis point instead.
+
+        IF (is_subspan) THEN
+           IF (void_at_start) lo_world = axis(lo_cx+1)
+           IF (void_at_end  ) hi_world = axis(hi_cx-1)
+        ENDIF
+
+	n_regrid = INT( (hi_world - lo_world) / d_regrid ) + 1
+
+* plot vertical z axes upside down ?
+
+	buff = horiz_or_vert//'AXIS_REVERSED 0'
+	IF ( horiz_or_vert .EQ. 'Y' .AND. idim .EQ. z_dim ) THEN
+	   IF ( BKWD_AXIS(idim, grid) ) THEN
+	      lo_world = axis(hi_cx)
+	      hi_world = axis(lo_cx)
+	      d_regrid = -d_regrid
+	      regrid   = .TRUE.
+	      buff = horiz_or_vert//'AXIS_REVERSED 1'
+	   ENDIF
+	ENDIF
+
+* Write out *_REVERSED symbol: 1 if reversed, 0 otherwise
+	ilen = TM_LENSTR1(buff)
+	ier = 0
+	ist = 0
+	CALL SETSYM (buff, ilen, ier, ist)
+
+	RETURN
+      END
diff --git a/fer/utl/bkwd_axis.F b/fer/utl/bkwd_axis.F
new file mode 100644
index 0000000..a92e68f
--- /dev/null
+++ b/fer/utl/bkwd_axis.F
@@ -0,0 +1,81 @@
+	LOGICAL FUNCTION BKWD_AXIS( idim, grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular axis of a grid is backwards relative to
+* the normal sense of a right hand coordinate system
+* note: only backwards Z axes are supported
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/25/88
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER		idim, grid
+
+* internal variable declarations:
+	INTEGER		line
+	CHARACTER*2	line_code
+
+* check for program bug	! temp
+	IF ( grid .EQ. unspecified_int4 ) STOP 'no_grd_orient'
+
+* initialize
+	line = grid_line( idim, grid )
+	IF ( line .EQ. mnormal .OR. line .EQ. munknown ) THEN
+	   BKWD_AXIS = .FALSE.
+	   RETURN
+	ELSE
+	   line_code = line_direction( line )
+	ENDIF
+
+* see if it is an upside-down Z axis
+	IF ( line_code .EQ. 'UD' ) THEN
+	      BKWD_AXIS	   = .TRUE.
+	ELSE
+	      BKWD_AXIS	   = .FALSE.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/box_bounds.F b/fer/utl/box_bounds.F
new file mode 100644
index 0000000..bb49ecb
--- /dev/null
+++ b/fer/utl/box_bounds.F
@@ -0,0 +1,87 @@
+	SUBROUTINE BOX_BOUNDS( x_or_y, val1, n, bounds, valid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* PLOT+ routine for use inside FERRET:
+* Supply to PLOT+ the bounds of n grid boxes from X or Y axis of the contour
+* data currently in PLOT+.  Pointers to the appropriate FERRET axes are in
+* COMMON.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* for FERRET V2.00: 12/21/89
+* V3.00 changed REAL FUNCTION to SUBROUTINE (noticed by f77 3.2)
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+	include 'ferret.parm'
+	include 'xbox_bounds.cmn'
+
+* calling argument declarations:
+	LOGICAL		valid
+	INTEGER		n
+	REAL*4		val1, bounds(n+1)
+	REAL		wval
+	CHARACTER	x_or_y*1
+
+* internal variable declarations:
+	INTEGER	ISUBSCRIPT, i, idim, isub1, isub0
+	DOUBLE PRECISION TM_WORLD
+
+* initialize
+	IF ( x_or_y .EQ. 'X' ) THEN
+	   idim = bb_xaxis
+	ELSEIF ( x_or_y .EQ. 'Y' ) THEN
+	   idim = bb_yaxis
+	ENDIF
+
+* determine starting subscript
+	isub1 = ISUBSCRIPT ( DBLE(val1), bb_grid, idim, round_dn )
+	isub0 = isub1 - 1
+
+* pass back box edges
+	DO 100 i = 1, n
+	   wval =  TM_WORLD (isub0+i,bb_grid,idim,box_lo_lim)
+	   bounds(i) = wval
+ 100	CONTINUE
+	wval = TM_WORLD (isub0+n,bb_grid,idim,box_hi_lim)
+	bounds(n+1)  = wval
+
+* always (the appearance of) success
+	valid = .TRUE.
+	RETURN
+	END
diff --git a/fer/utl/box_size.F b/fer/utl/box_size.F
new file mode 100644
index 0000000..5191cab
--- /dev/null
+++ b/fer/utl/box_size.F
@@ -0,0 +1,155 @@
+	REAL FUNCTION BOX_SIZE( isubscript, grid, idim )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a subscript value on a grid and an axis return the length of the
+* grid box
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 - 12/9/86
+* revision 1.0 - 3/10/87 - line data stored in COMMON/~VARIABLES/
+* revision 0.2 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 0.3 - 2/18/88 - incorporated "regular" lines
+* revision 1.0 - 1/12/88 - new TM IO library stores box bounds, not sizes
+* Unix/RISC port - 1/91 - cant use "/star" in documentation
+*                  9/91 - incorporated (missing) modulo axis logic
+* V4.20 - 10/95 - remove references to line_mem to permit recursive line defs
+*	   1/96 - bug fix: only look at line_parent for dynamic lines
+*		           (code would be sweeter if ALL lines had line_parent)
+* V510 4/00 *sh* -- all lines now DO have line_parent
+*      6/00 *sh* -- bug fix: children of irregular modulo axes 
+* V533 6/01 *sh* -- using TM_AXIS_RECURSIVE
+* V541  2/02 *sh* -- support for subspan modulo axes
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	isubscript, grid, idim
+
+* internal variable declarations:
+	LOGICAL TM_AXIS_RECURSIVE, TM_ITS_SUBSPAN_MODULO,
+     .		recursive, modulo, regular
+	INTEGER	TM_MODULO_LINE_DIM, axis, isub0, llen
+	REAL*8	TM_WORLD, lo_point, hi_point
+
+* initialize
+	axis = grid_line( idim, grid )
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   BOX_SIZE = bad_val4
+	   RETURN
+	ENDIF
+
+* special consideration for sub-span modulo axis outside its core range
+	llen = TM_MODULO_LINE_DIM(axis)
+	IF (TM_ITS_SUBSPAN_MODULO(axis) ) THEN
+	   IF ( isubscript.LT.1 .OR. isubscript.GE.llen ) THEN
+	      regular = .FALSE.
+	   ELSE
+	      regular = line_regular( axis )
+	   ENDIF
+	ELSE
+	   regular = line_regular( axis )
+	ENDIF
+
+
+	IF ( regular ) THEN
+* regularly spaced points all have same grid box size
+#ifdef double_p
+	   BOX_SIZE = ( line_delta( axis ) )
+#else
+	   BOX_SIZE = SNGL( line_delta( axis ) )
+#endif
+
+	ELSE
+* irregularly spaced points
+* keep subscript within bounds ( between 1 and dimension of axis ) by ...
+           IF ( line_modulo( axis ) ) THEN
+* ... modulo-ing to the appropriate value
+              isub0 = MOD(isubscript-1,llen) + 1
+           ELSE
+* ... truncating to the appropriate value
+	      isub0 = MIN( llen, MAX( 1, isubscript ) )
+           ENDIF
+
+* only dynamic lines have the possibility of recursive definitions
+* (since FORTRAN doesn't protect "AND" clauses this test in 2 steps)
+	   recursive = TM_AXIS_RECURSIVE(axis)
+
+* use modulo logic if the parent line is modulo (6/00)
+	   modulo = line_modulo(axis)
+	   IF (recursive) THEN
+	      modulo = modulo .OR.
+     .		       line_modulo( line_parent(axis) )
+	   ENDIF
+
+* use TM_WORLD to compute BOX_SIZE for recursive defs (10/95)
+	   IF ( recursive ) THEN
+* ... every nth point from an irregular axis --> use midpoints as box bounds
+	      IF (isub0.EQ.1 .AND. .NOT.modulo ) THEN
+	         lo_point =  TM_WORLD(isub0,   grid, idim, box_lo_lim)
+	      ELSE
+	         lo_point = (TM_WORLD(isub0,   grid, idim, box_middle) 
+     .			  +  TM_WORLD(isub0-1, grid, idim, box_middle)) / 2
+	      ENDIF
+	      IF ( isub0.EQ.llen .AND. .NOT.modulo ) THEN
+	         hi_point =  TM_WORLD(isub0,   grid, idim, box_hi_lim)
+	      ELSE
+	         hi_point = (TM_WORLD(isub0,   grid, idim, box_middle) 
+     .			  +  TM_WORLD(isub0+1, grid, idim, box_middle)) / 2
+	      ENDIF
+#ifdef double_p
+	      BOX_SIZE = (hi_point - lo_point)
+#else
+	      BOX_SIZE = SNGL(hi_point - lo_point)
+#endif
+	   ELSE
+#ifdef double_p
+	      BOX_SIZE = ( TM_WORLD(isub0, grid, idim, box_hi_lim)
+     .		             - TM_WORLD(isub0, grid, idim, box_lo_lim) )
+#else
+	      BOX_SIZE = SNGL( TM_WORLD(isub0, grid, idim, box_hi_lim)
+     .		             - TM_WORLD(isub0, grid, idim, box_lo_lim) )
+#endif
+	   ENDIF
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/cal_factr.F b/fer/utl/cal_factr.F
new file mode 100644
index 0000000..31b6581
--- /dev/null
+++ b/fer/utl/cal_factr.F
@@ -0,0 +1,97 @@
+	REAL FUNCTION CAL_FACTR (cal_id)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Find factor to adjust time units for different calendar axes.
+
+* programmer - Ansley Manke
+*
+* revision 0.00 - 03-Mar-2001
+
+* V570 *acm* 5/04  Add the calendar ALL_LEAP = 366_DAY.
+
+* calling argument declarations:
+	INTEGER cal_id
+
+* local variable declarations
+	INTEGER cal_id_greg
+	REAL sec_per_year(6)
+
+	include 'tmap_dims.parm'
+	include 'xunits.cmn_text'
+
+	sec_per_year(1) = 31556952.
+        sec_per_year(2) = 31536000.
+        sec_per_year(3) = 31557600.
+        sec_per_year(4) = 31104000.
+        sec_per_year(5) = 31622400.
+
+	cal_id_greg = 1		! Default gregorian calendar
+	CAL_FACTR = sec_per_year(cal_id_greg) / sec_per_year(cal_id)
+
+
+c     1	'GREGORIAN',
+c     2  'NOLEAP',
+c     3  'JULIAN',
+c     4  '360_DAY',
+c     5  'ALL_LEAP'
+
+c from xunits_data.F:
+c
+c	DATA	un_convert( -1)	/ 1.0		/,
+c     .		un_convert( -2)	/ 60.		/,
+c     .		un_convert( -3)	/ 3600.		/, ! sec per hour
+c     .		un_convert( -4)	/ 86400.	/, ! sec per day
+c     .		un_convert( -5)	/ 2629746.	/, ! 1/12 of 365.2425 year
+c
+cc     .		un_convert( -6)	/ 31536000.	/, ! sec per 365 day year (OLD default)
+c     .		un_convert( -6)	/ 31556952.	/  ! sec per 365.2425 year
+c
+c     .		un_convert( -7)	/ 44712.	/, ! sec per M2 cycle
+c     .		un_convert( -8)	/ 31622400.	/, ! sec per 366 day year
+c     .		un_convert( -9)	/ 31104000.	/, ! sec per 360 day year
+c     .		un_convert(-10)	/ 31556952.	/  ! sec per 365.2425 year
+c
+c     .		un_convert(-11)	/ 31536000.	/ ! sec per 365.0 day year
+c     .		un_convert(-12)	/ 31557600.	/ ! sec per 365.25 day year
+c
+c     .		un_convert(-13)	/ 2628000.	/ ! 1/12 of sec per 365 day year
+c     .		un_convert(-14)	/ 2592000.	/ ! 1/12 of sec per 360 day year
+c     .		un_convert(-15)	/ 2629800.	/ ! 1/12 of sec per 365.25 day year
+c     .		un_convert(-16)	/ 2635200.	/ ! 1/12 of sec per 366 day year
+
+	RETURN
+	END
diff --git a/fer/utl/calendar_axis.F b/fer/utl/calendar_axis.F
new file mode 100644
index 0000000..087f1ef
--- /dev/null
+++ b/fer/utl/calendar_axis.F
@@ -0,0 +1,108 @@
+	SUBROUTINE CALENDAR_AXIS (idim, grid, cx, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+
+* Reset time step if axis is a different calendar than Gregorian.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+
+	INTEGER idim, grid, cx, status
+
+	REAL*8	SECS_FROM_BC, bc_to_t0, ww, lo_ww, hi_ww,
+     .		new_lo_ww, new_hi_ww
+	INTEGER TM_GET_CALENDAR_ID, axis, cal_id, prev_cal_id, istat
+
+* axis for this dimension
+	axis = grid_line( idim, grid )
+
+* Is it really a calendar axis? Might be an F axis in a grid with a 
+* calendar T axis.
+
+	IF (line_t0(axis) .EQ. char_init20) THEN
+	   istat = 2
+	   GOTO 5000
+	ENDIF
+
+	cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+	bc_to_t0 = SECS_FROM_BC(line_t0(axis), cal_id, istat)
+	IF (istat .NE. ferr_ok) GO TO 4000
+
+	prev_cal_id = cx_cal_id(cx)
+	IF (prev_cal_id .NE. cal_id) THEN
+	   CALL reset_secs_from_bc (-cx_lo_ww(idim,cx), 
+     .		     new_lo_ww, prev_cal_id, cal_id, istat)
+
+	   IF (istat .ne. ferr_ok) GO TO 5000
+	   CALL reset_secs_from_bc (-cx_hi_ww(idim,cx), 
+     .		     new_hi_ww, prev_cal_id, cal_id, istat)
+	   IF (istat.ne. ferr_ok) GO TO 5000
+	   cx_cal_id(cx) = cal_id
+	ELSE
+	   new_lo_ww = -1*cx_lo_ww(idim,cx)
+	   new_hi_ww = -1*cx_hi_ww(idim,cx)
+	ENDIF
+
+	cx_lo_ww(idim,cx) = (new_lo_ww-bc_to_t0)/line_tunit(axis)
+	cx_hi_ww(idim,cx) = (new_hi_ww-bc_to_t0)/line_tunit(axis)
+
+* also fix the world limits for cx_cmnd, if they were originally set 
+* using default calendar
+* Fix for bug 1365: if the limits for cx_cmnd were not set, do not set them here
+
+	IF ( (cx_lo_ww(idim,cx_cmnd) .NE. unspecified_val8)  .AND.
+     .             (cx_cal_id(cx_cmnd) .NE. unspecified_int4)  .AND.
+     .             (cal_id .NE. prev_cal_id) ) THEN   
+	   cx_lo_ww(idim,cx_cmnd) = -1*new_lo_ww
+	   cx_hi_ww(idim,cx_cmnd) = -1*new_hi_ww
+	   cx_cal_id(cx_cmnd) = cal_id
+	ENDIF
+
+ 4000	status = ferr_ok
+	RETURN
+ 5000   status = istat
+	RETURN
+	END
diff --git a/fer/utl/caxis_len.F b/fer/utl/caxis_len.F
new file mode 100644
index 0000000..57085b3
--- /dev/null
+++ b/fer/utl/caxis_len.F
@@ -0,0 +1,70 @@
+	INTEGER FUNCTION CAXIS_LEN ( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the length of the axis from a particular context
+
+* this routine is to minimize the need for TMAP COMMON areas in FERRET code
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V320 - 12/94
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	idim, cx
+
+* internal variable declarations:
+	INTEGER line
+
+* find the line number for the indicated axis of this grid
+	line = grid_line ( idim, cx_grid( cx ) )
+
+	IF ( line .EQ. mnormal ) THEN
+	   CAXIS_LEN = 1
+	ELSE
+	   CAXIS_LEN = line_dim( line )
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/caxis_modlen.F b/fer/utl/caxis_modlen.F
new file mode 100644
index 0000000..735b8f5
--- /dev/null
+++ b/fer/utl/caxis_modlen.F
@@ -0,0 +1,77 @@
+	INTEGER FUNCTION CAXIS_MODLEN ( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the length of the axis from a particular context
+* BUT if the axis is "subspan modulo", then return length+1, in order to create
+* the virtual point that fills the void between the end of the native axis
+* span and the modulo length
+
+* this routine is to minimize the need for TMAP COMMON areas in FERRET code
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V541 *sh*  2/02
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	idim, cx
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO
+	INTEGER line
+
+* find the line number for the indicated axis of this grid
+	line = grid_line ( idim, cx_grid( cx ) )
+
+	IF ( line .EQ. mnormal ) THEN
+	   CAXIS_MODLEN = 1
+	ELSE
+	   IF (TM_ITS_SUBSPAN_MODULO( line ) ) THEN
+	      CAXIS_MODLEN = line_dim( line ) + 1
+	   ELSE
+	      CAXIS_MODLEN = line_dim( line )
+	   ENDIF
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/check_neg_taxis.F b/fer/utl/check_neg_taxis.F
new file mode 100644
index 0000000..b19af4c
--- /dev/null
+++ b/fer/utl/check_neg_taxis.F
@@ -0,0 +1,99 @@
+	SUBROUTINE CHECK_NEG_TAXIS( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to make sure that the time axis of the data set doesn't have any
+* negative time step values
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/11/90
+* Unix/RISC port:  07/91 - allow normal time axis
+*                  10/91 - briefer warning
+* V230 - simplified (less intimidating) message
+*      7/20/92 - don't issue warning unless T0 is valid
+*              - (cleaned up unused variables)
+* V530  1/01 *acm* cal_id for alternative calendar axis types
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER	dset
+
+* internal variable declarations:
+        LOGICAL TM_DATE_OK
+	INTEGER	i, grid, line
+        INTEGER TM_GET_CALENDAR_ID, cal_id
+	DOUBLE PRECISION TM_WORLD
+
+	include 'ferret.parm'
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* base it on first variable in data set
+	DO 100 i = 1, maxvars
+ 100	IF ( ds_var_setnum(i) .EQ. dset ) GOTO 110
+	RETURN	! no vars in set
+
+* check lowest time step value on axis
+ 110	grid = ds_grid_number(i)
+        line = grid_line(t_dim, grid )
+
+* allow time-independent grids (7/91)
+        IF ( line .EQ. mnormal ) RETURN
+
+* no warning for non-date axes - this way time can be a regular ol' axis
+
+        cal_id = TM_GET_CALENDAR_ID (line_cal_name(line) )
+        IF ( .NOT.TM_DATE_OK( line_t0(line), cal_id) ) RETURN
+
+	IF ( TM_WORLD(1,grid,t_dim,box_middle) .LT. 0.0D0 ) THEN
+	   CALL WARN('Negative values in time axis'//
+     .               ' may not be formatted properly: '//
+     .		     ds_name(dset) )
+
+	ELSEIF ( TM_WORLD(1,grid,t_dim,box_lo_lim) .LT. 0.0D0 ) THEN
+	   CALL WARN('Negative values at start of time axis'//
+     .               ' may be improperly formatted: '//
+     .		     ds_name(dset) )
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/confine_axis.F b/fer/utl/confine_axis.F
new file mode 100644
index 0000000..cf88464
--- /dev/null
+++ b/fer/utl/confine_axis.F
@@ -0,0 +1,273 @@
+	SUBROUTINE CONFINE_AXIS( idim, cx, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a skeletal context with a known grid confine the context limits to
+* on the given axis within the grid limits
+* if date/time limits were specified convert to time steps here
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 5/26/89 - extracted from CONFINE_CONTEXT with improved error message
+*	12/4/89 - improved error reporting
+*	5/16/90 - further improved error reporting
+*	 8/6/90 - error processing bug: "status" --> istat in SECS_FROM_BC
+*       8/10/92 - don't eliminate transform because of lo=hi limits
+* V230: 11/4/92 - expanded variable name length
+* V420: 11/95 - change to philosophy of "explicit" contexts -- for
+*		LET A=I[i=1:5:1] (dynamic axis) the expression A[I=10] should
+*		be an error
+*	      - allow explicit Z=100 at ITP to pass through
+*       - add check on cx_calendar rather than cx_lo/hi_ww to indicate whether time
+*         is date or timesteps
+* V491: 4/98 - fix bug in check for itsa_uvar -- was bypassing ALL processing
+* V500 *kob* 3/99- up VAR_CODE  to 64 chars  and err_string from 48 to 64
+*                  and VAR_TITLE from 24 to 128
+* V520 *kob* 6/00 - had to had risc_buff text buffer for sgi output
+* V530 *acm* 1/01 - add cal_id for alternative calendar types
+* V552 *acm* 4/03- up VAR_CODE and err_str to 128 chars 
+* V553 *acm* 8/03 - write an error message if time origin or time limits 
+*                   were mis-defined.
+* V554 *acm* 11/03 -Fix bug in the change just above: if times requested
+*                   are outside the data bounds, give error message.
+* V561 *acm*  4/04 -Fix bug plotting a noleap time axis: cx_lo_ww and cx_hi_ww
+*                   are originally set without knowledge of calendar, so when
+*                   resetting time step here, also reset the limits for cx_cmnd
+* V580 *acm* 11/04  - Use cx_cal_id to keep track of which calendar 
+*                     used when cx_lo_ww and cx_hi_ww are computed.
+* V600 *acm* 11/05  - Fix for bug 1365; do not fix the world limits for cx_cmnd
+*                     unless they were already set.
+* V600 *acm*  4/06  - correct typo unspecified_val8
+*      *acm*  4/12 6D Ferret: time axis may be in t or f direction.
+* V680 *acm*  612  6D Ferret: Pull the calendar correction into a separate routine.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xtext_info.cmn'
+	include 'xrisc.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, idim, status
+
+* internal variable declarations:
+!	LOGICAL lim_redundant
+	LOGICAL its_irrelevant
+	INTEGER	ISUBSCRIPT, TM_LENSTR1, ss, min_ss, max_ss, lo_ss, hi_ss,
+     .		axis, grid, lenstr, slen, cat, var, istat
+	REAL*8	ww, min_ww, max_ww, lo_ww, hi_ww
+*                  and VAR_TITLE from 24 to 128
+	CHARACTER VAR_CODE*128, CX_DIM_STR*48, VAR_TITLE*128,
+     .		  buff*48, err_str*128, expr_num*1
+
+* internal parameter declarations:
+	LOGICAL     full_precision
+	INTEGER	    err_ss_lims, err_ww_lims
+	PARAMETER ( full_precision = .TRUE.,
+     .		    err_ss_lims = -77,
+     .		    err_ww_lims = -88 )
+
+* initialize
+
+	grid = cx_grid( cx )
+	cat  = cx_category(cx)
+	var  = cx_variable(cx)
+* (11/95) expressions such as "2+2"
+	IF (cat .EQ. cat_user_var) THEN
+	   its_irrelevant = uvar_given(idim,var)
+     .			.EQ. uvlim_irrelevant
+	ELSE
+	   its_irrelevant = .FALSE.
+	ENDIF
+
+* axis for this dimension
+	axis = grid_line( idim, grid )
+
+! 11/95: increased restrictions that limits must be within valid bounds
+!        even redundant limits must be fleshed out since they may be used at
+!	 higher levels to "reconcile" results
+!* check for special actions needed on user-defined variables
+!* ( e.g. how to handle U[K=5] - U[K=1:10] or PI=3.1415)
+!	IF ( cat .EQ. cat_user_var ) THEN
+!	   lim_redundant = uvar_given( idim, var ) .LE. uvlim_gvn_xact
+!	ELSE
+!	   lim_redundant = .FALSE.
+!	ENDIF
+
+* check for internal error left over from old TMAP library
+	IF ( axis .EQ. munknown ) THEN
+	   status = ferr_grid_definition
+	   GOTO 5010
+	
+* irrelevant normal axis  (was based on lim_redundant prior to 11/95)
+	ELSEIF ( axis .EQ. mnormal ) THEN
+	   GOTO 1000
+
+* (11/95) limits on a constant are irrelevant
+	ELSEIF ( cat .EQ. cat_constant ) THEN
+	   GOTO 1000
+
+* (11/95) expressions such as "2+2"
+	ELSEIF ( its_irrelevant ) THEN
+	   GOTO 1000
+
+* positions were specified by subscript
+	ELSEIF ( cx_by_ss( idim, cx ) ) THEN
+	   status = err_ss_lims	! in case of error
+* ... is there valid position data for this axis ?
+	   IF ( cx_lo_ss( cx ,idim ) .EQ. unspecified_int4 ) GOTO 1000
+* ... confine them to the limits of the defining grid
+	   CALL GRID_SUBSCRIPT_EXTREMES(min_ss, max_ss, grid, idim)
+	   lo_ss = MAX( min_ss, cx_lo_ss(cx,idim) )
+	   hi_ss = MIN( max_ss, cx_hi_ss(cx,idim) )
+* ... check for limit error
+	   IF ( lo_ss .GT. hi_ss ) GOTO 5010
+* ... success
+	   cx_lo_ss( cx, idim ) = lo_ss
+	   cx_hi_ss( cx, idim ) = hi_ss
+
+* positions were specified by world coordinates
+	ELSE
+	   status = err_ww_lims	! in case of error
+* ... is there valid position data for this axis ?
+	   IF ( cx_lo_ww( idim, cx ) .EQ. unspecified_val8 ) GOTO 1000
+* ... time/date strings are received as -1*(secs from BC)
+* 8/97 *kob* use cx_calender to check if time is date rather than time step
+* 2/01 *acm* reset time step if axis is a different calendar than Gregorian.
+* 8/03 *acm* write error message if time origin or limits were mis-defined.
+*11/04 *acm* reset time step only if axis is a different calendar than 
+*            the calendar originally used to compute world coordinates
+
+	   IF ( (idim .EQ. t_dim .OR. idim .EQ. f_dim) .AND.cx_calendar(cx) ) THEN
+
+	      CALL CALENDAR_AXIS (idim, grid, cx, istat)
+	      IF (istat .NE. 2) THEN
+	         IF (istat .EQ. -1) GOTO 5000
+	         IF (idim .EQ. t_dim .AND. grid_line(f_dim,grid) .NE. mnormal)THEN
+	            CALL CALENDAR_AXIS(f_dim, grid, cx, istat)
+     	            IF (istat .EQ. -1) GOTO 5000
+	         ENDIF
+	      ENDIF
+
+	      cx_calendar(cx) = .FALSE. 
+
+           ENDIF
+* ... confine values to the limits of the defining grid
+ 4000	   CALL GRID_WORLD_EXTREMES( min_ww, max_ww, grid, idim )
+	   lo_ww = MAX( cx_lo_ww( idim, cx ), min_ww )
+	   hi_ww = MIN( cx_hi_ww( idim, cx ), max_ww )
+* ... check for error in limits and possibly remove transformation
+	   IF ( lo_ww .GT. hi_ww ) THEN
+	      GOTO 5010
+! commented out 11/95 -- allow user's "@ITP" to pass through
+!	   ELSEIF ( lo_ww .EQ. hi_ww
+!     .	      .AND. cx_trans(idim,cx) .EQ. trans_interpolate ) THEN
+!! ... B4 8/92 was: .AND. cx_trans(idim,cx) .GT. trans_compress_code ) THEN
+!* ... remove transformation if irrevelent
+!	      cx_trans( idim, cx ) = trans_no_transform
+	   ENDIF
+* ... success
+	   cx_lo_ww( idim, cx ) = lo_ww
+	   cx_hi_ww( idim, cx ) = hi_ww
+
+	ENDIF
+
+* successful completion
+ 1000	status = ferr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+* prepare detailed error string: variable name and range along axis
+ 5010	err_str = VAR_CODE(cat,var)
+	IF ( INDEX( err_str,'#' ) .GT. 0 ) THEN
+	   err_str = '"'//VAR_TITLE( cx )
+	   lenstr  = TM_LENSTR1(err_str)
+	   IF ( lenstr .GT. 20 ) THEN
+	      err_str = err_str(:20)//'..."'
+	   ELSE
+	      err_str = err_str(:lenstr)//'"'
+	   ENDIF
+	ENDIF
+	lenstr = TM_LENSTR1(err_str)
+	IF ( cx_unstand_grid(cx) ) THEN
+	   err_str = err_str(:lenstr)//' on grid '//grid_name(cx_grid(cx))
+	   lenstr = TM_LENSTR1(err_str)
+	ENDIF
+	CALL TRANSFER_CONTEXT( cx, cx_buff )
+	cx_trans( idim, cx_buff ) = trans_no_transform
+	IF ( status .EQ. err_ss_lims ) THEN
+	   cx_lo_ss(cx_buff,idim) = min_ss
+	   cx_hi_ss(cx_buff,idim) = max_ss
+	   GOTO 5900
+	ELSEIF ( status .EQ. err_ww_lims ) THEN
+	   cx_lo_ww(idim,cx_buff) = min_ww
+	   cx_hi_ww(idim,cx_buff) = max_ww
+	   GOTO 5900
+	ELSEIF ( status .EQ. ferr_grid_definition ) THEN
+	   CALL ERRMSG( ferr_grid_definition, status,
+     .			err_str(:lenstr)//pCR//
+     .			'Unknown '//ww_dim_name(idim)//' axis in grid '//
+     .			grid_name(grid), *5000 )
+	ELSE
+!	   STOP 'CONFINE_AXIS'
+           GO TO 5000
+	ENDIF
+
+ 5900	buff = CX_DIM_STR(idim, cx, ':',full_precision,slen)
+	risc_buff = buff(:slen)
+        IF ( cx_hi_ss(cx,idim) .NE. cx_lo_ss(cx,idim) ) THEN
+	   CALL ERRMSG( ferr_limits, status,
+     .		err_str(:lenstr)//' is not in the range '//risc_buff//
+     .		pCR//'Axis extremes are '//CX_DIM_STR(idim, cx_buff, 
+     .					  ':',full_precision,slen), *5000 )
+
+        ELSE
+	   CALL ERRMSG( ferr_limits, status,
+     .		err_str(:lenstr)//' does not exist at '//risc_buff//
+     .		pCR//'Axis extremes are '//CX_DIM_STR(idim, cx_buff, 
+     .					  ':',full_precision,slen), *5000 )
+        ENDIF
+
+	END
diff --git a/fer/utl/copy_2d_to_3d.F b/fer/utl/copy_2d_to_3d.F
new file mode 100644
index 0000000..4aaa496
--- /dev/null
+++ b/fer/utl/copy_2d_to_3d.F
@@ -0,0 +1,72 @@
+	SUBROUTINE COPY_2D_TO_3D ( src, msrc, dst, mdst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from a 2D (XY and T) grid to a 3D grid and then replicate the
+* data along the Z axis of the dstination
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/1/89 - 4D symmetrical
+*	10/11/89 - use ..._SUB - avoid adjustable dimensioning with array
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* TODO: what changes to make for 6D Ferret?
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, mdst
+	REAL    src( * ), dst( * )
+
+* --- end of introductory code ---
+
+	CALL COPY_2D_TO_3D_SUB(
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst)	)
+
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_2d_to_3d_sub.F b/fer/utl/copy_2d_to_3d_sub.F
new file mode 100644
index 0000000..ce2be4d
--- /dev/null
+++ b/fer/utl/copy_2d_to_3d_sub.F
@@ -0,0 +1,88 @@
+	SUBROUTINE COPY_2D_TO_3D_SUB (
+     .		src, slox, shix, sloy, shiy,             slot, shit,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, dlot, dhit )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* support routine for COPY_2D_TO_3D with unsubscripted limits
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/12/89
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* TODO: what changes to make for 6D Ferret?
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER slox, shix, sloy, shiy,             slot, shit,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, dlot, dhit
+	REAL    src( slox:shix,sloy:shiy,          slot:shit ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, k1
+
+* --- end of introductory code ---
+
+* copy one XY plane to the dstination grid
+	k1 = dloz
+
+	DO 100 l = dlot, dhit
+	DO 100 j = dloy, dhiy
+	DO 100 i = dlox, dhix
+
+	   dst(i,j,k1,l) = src(i,j,l)
+
+ 100	CONTINUE
+
+* (no check for bad data - same flag assumed on source and destination)
+
+* now replicate along the Z axis
+	DO 210 k = k1+1, dhiz
+
+	   DO 200 l = dlot, dhit
+	   DO 200 j = dloy, dhiy
+	   DO 200 i = dlox, dhix
+ 200	   dst(i,j,k,l) = dst(i,j,k1,l)
+
+ 210	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_agg_into.F b/fer/utl/copy_agg_into.F
new file mode 100644
index 0000000..484c209
--- /dev/null
+++ b/fer/utl/copy_agg_into.F
@@ -0,0 +1,131 @@
+	SUBROUTINE COPY_AGG_INTO ( src, msrc, cxs, dst, mdst, mloc )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. destination grid is ASSUMED) big enough to hold data.
+* The source grid does not have an ensemble axis (dimension 5) but the
+* destination axis does.  Copy the ensemble member into e-axis location 
+* pointed to by index mloc.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+*
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, cxs, mdst, dcx, mloc
+	REAL    src( * ), dst( * )
+
+* internal variable declarations
+	INTEGER idim, soffset, doffset, mdel,
+     .		smlo(nferdims), smhi(nferdims),
+     .		dmlo(nferdims), dmhi(nferdims),
+     .		cxlo(nferdims), cxhi(nferdims)
+
+* set-up modified limits wherever delta is significant
+* cuz the FORTRAN dimensioned size can only have delta of 1 
+
+	DO idim = 1,nferdims
+	  IF (mr_delta(idim,msrc) .NE. unspecified_val8) THEN
+            mdel = NINT(mr_delta(idim,msrc))
+
+	    IF (mr_delta(idim,msrc).NE.mr_delta(idim,mdst)
+     .	   .OR. mr_delta(idim,msrc).NE.cx_delta(idim,cxs) ) CALL WARN
+     .		('Internl_delta_err')
+	    soffset = (mr_lo_ss(msrc,idim)-cx_lo_ss(cxs,idim))/
+     .			mdel  + 1
+	    doffset = (mr_lo_ss(mdst,idim)-cx_lo_ss(cxs,idim))/
+     .			mdel  + 1
+	    cxlo(idim) = 1
+
+	    cxhi(idim) = 1 + (cx_hi_ss(cxs,idim)-cx_lo_ss(cxs,idim))/
+     .			     mdel
+	    dmlo(idim) = doffset
+	    dmhi(idim) = doffset +
+     .			     (mr_hi_ss(mdst,idim)-mr_lo_ss(mdst,idim))/
+     .			     mdel
+	    smlo(idim) = soffset
+	    smhi(idim) = soffset + 
+     .			     (mr_hi_ss(msrc,idim)-mr_lo_ss(msrc,idim))/
+     .			     mdel
+	  ELSE
+	    cxlo(idim) = cx_lo_ss(cxs, idim)
+	    cxhi(idim) = cx_hi_ss(cxs, idim)
+	    dmlo(idim) = mr_lo_ss(mdst,idim)
+	    dmhi(idim) = mr_hi_ss(mdst,idim)
+	    smlo(idim) = mr_lo_ss(msrc,idim)
+	    smhi(idim) = mr_hi_ss(msrc,idim)
+	  ENDIF
+	ENDDO
+
+	IF (mr_type(msrc) .EQ. ptype_string ) THEN
+	   CALL COPY_AGG_PTR_INTO_SUB( mloc, cxlo, cxhi,
+     .			    src, smlo(1), smhi(1),
+     .				 smlo(2), smhi(2),
+     .				 smlo(3), smhi(3),
+     .				 smlo(4), smhi(4),
+     .				 smlo(5), smhi(5),
+     .				 smlo(6), smhi(6),
+     .			    dst, dmlo(1), dmhi(1),
+     .				 dmlo(2), dmhi(2),
+     .				 dmlo(3), dmhi(3),
+     .				 dmlo(4), dmhi(4),
+     .				 dmlo(5), dmhi(5),
+     .				 dmlo(6), dmhi(6) )
+	ELSE
+	   CALL COPY_AGG_INTO_SUB( mloc, cxlo, cxhi,
+     .			    src, smlo(1), smhi(1),
+     .				 smlo(2), smhi(2),
+     .				 smlo(3), smhi(3),
+     .				 smlo(4), smhi(4),
+     .				 smlo(5), smhi(5),
+     .				 smlo(6), smhi(6),
+     .			    dst, dmlo(1), dmhi(1),
+     .				 dmlo(2), dmhi(2),
+     .				 dmlo(3), dmhi(3),
+     .				 dmlo(4), dmhi(4),
+     .				 dmlo(5), dmhi(5),
+     .				 dmlo(6), dmhi(6),
+     .				 cx_bad_data(cxs),
+     .				 mr_bad_data(mdst) )
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_agg_into_sub.F b/fer/utl/copy_agg_into_sub.F
new file mode 100644
index 0000000..47d61c9
--- /dev/null
+++ b/fer/utl/copy_agg_into_sub.F
@@ -0,0 +1,86 @@
+	SUBROUTINE COPY_AGG_INTO_SUB( mloc, cxlo, cxhi,
+     .          src, slox, shix, sloy, shiy, sloz, shiz, 
+     .          slot, shit, sloe, shie, slof, shif,
+     .          dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .          dlot, dhit, dloe, dhie, dlof, dhif, 
+     .          bad_src, bad_dst   )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data.
+* Copy the ensemble member into e-axis location pointed to
+* by index mloc.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+*
+* calling argument declarations:
+	INTEGER mloc, cxlo(*), cxhi(*),
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .          slot, shit, sloe, shie, slof, shif, 
+     .          dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .          dlot, dhit, dloe, dhie, dlof, dhif
+
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .          dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif ),
+     .          bad_src, bad_dst
+
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	m = cxlo(5)
+        DO 100 n = cxlo(6), cxhi(6)
+	DO 100 l = cxlo(4), cxhi(4)
+	DO 100 k = cxlo(3), cxhi(3)
+	DO 100 j = cxlo(2), cxhi(2)
+	DO 100 i = cxlo(1), cxhi(1)
+
+	   IF (src(i,j,k,l,m,n) .NE. bad_src) THEN
+	      dst(i,j,k,l,mloc,n) = src(i,j,k,l,m,n)
+	   ELSE
+	      dst(i,j,k,l,mloc,n) = bad_dst
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_agg_ptr_into_sub.F b/fer/utl/copy_agg_ptr_into_sub.F
new file mode 100644
index 0000000..7969df5
--- /dev/null
+++ b/fer/utl/copy_agg_ptr_into_sub.F
@@ -0,0 +1,76 @@
+	SUBROUTINE COPY_AGG_PTR_INTO_SUB( mloc, cxlo, cxhi,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif  )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. destination grid is ASSUMED) big enough to hold data
+* Copy the aggregate member into e-axis location pointed to
+* by index mloc.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+*
+* calling argument declarations:
+	INTEGER mloc, cxlo(*), cxhi(*),
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	m = cxlo(5)
+        DO 100 n = cxlo(6), cxhi(6)
+	DO 100 l = cxlo(4), cxhi(4)
+	DO 100 k = cxlo(3), cxhi(3)
+	DO 100 j = cxlo(2), cxhi(2)
+	DO 100 i = cxlo(1), cxhi(1)
+
+	   CALL COPY_C_STRING( src(i,j,k,l,m,n), dst(i,j,k,l,mloc,n) )
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_grid.F b/fer/utl/copy_grid.F
new file mode 100644
index 0000000..f29f857
--- /dev/null
+++ b/fer/utl/copy_grid.F
@@ -0,0 +1,117 @@
+	SUBROUTINE COPY_GRID ( src, msrc, dst, mdst )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from one grid to another (using limits of destination grid)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 1/23/87
+* V200:  5/19/89 - 4D symmetrical
+*	10/11/89 - use COPY_GRID_SUB - avoid adjustable dimensioning with array
+* V530:  8/00 *sh* - handle C string arrays, too
+* V530:  8/00 *sh* - if input grid uses strides then copy based upon output
+*	             grid limits -- the axes MUST BE the same length
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, mdst
+	REAL    src( * ), dst( * )
+
+* internal variable declarations
+	INTEGER	MGRID_SIZE
+	INTEGER idim, lo_ss(nferdims), hi_ss(nferdims)
+
+* set-up modified source limits wherever delta is significant
+* cuz the FORTRAN dimensioned size can only have delta of 1 
+	DO idim = 1, nferdims
+	  IF (mr_delta(idim,msrc) .NE. unspecified_val8) THEN
+	    lo_ss(idim) = mr_lo_ss(mdst,idim)
+	    hi_ss(idim) = mr_hi_ss(mdst,idim)
+	  ELSE
+	    lo_ss(idim) = mr_lo_ss(msrc,idim)
+	    hi_ss(idim) = mr_hi_ss(msrc,idim)
+	  ENDIF
+	ENDDO
+
+	IF ( mr_type(msrc) .EQ. ptype_string ) THEN
+
+* set up the C pointer variable in the destination variable
+	   CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mdst),
+     .				     dst,
+     .				     mr_c_pointer(mdst)      )
+
+* copy the strings
+	   CALL COPY_PTR_GRID_SUB(
+     .			  src, lo_ss(1), hi_ss(1),
+     .			       lo_ss(2), hi_ss(2),
+     .			       lo_ss(3), hi_ss(3),
+     .			       lo_ss(4), hi_ss(4),
+     .			       lo_ss(5), hi_ss(5),
+     .			       lo_ss(6), hi_ss(6),
+     .			  dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .			       mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .			       mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .			       mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .			       mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .			       mr_lo_s6(mdst), mr_hi_s6(mdst) )
+
+	ELSE
+
+	   CALL COPY_GRID_SUB(
+     .			  src, lo_ss(1), hi_ss(1),
+     .			       lo_ss(2), hi_ss(2),
+     .			       lo_ss(3), hi_ss(3),
+     .			       lo_ss(4), hi_ss(4),
+     .			       lo_ss(5), hi_ss(5),
+     .			       lo_ss(6), hi_ss(6),
+     .			       mr_bad_data( msrc ),
+     .			  dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .			       mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .			       mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .			       mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .			       mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .			       mr_lo_s6(mdst), mr_hi_s6(mdst),
+     .			       mr_bad_data( mdst )			)
+
+	ENDIF
+
+ 5000	RETURN
+	END 
diff --git a/fer/utl/copy_grid_sub.F b/fer/utl/copy_grid_sub.F
new file mode 100644
index 0000000..4472840
--- /dev/null
+++ b/fer/utl/copy_grid_sub.F
@@ -0,0 +1,93 @@
+	SUBROUTINE COPY_GRID_SUB (
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif, bad_src,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif, bad_dst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* support routine for COPY_GRID with unsubscripted limits
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/12/89
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+	REAL	bad_src, bad_dst
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	DO 100 n = dlof, dhif
+	DO 100 m = dloe, dhie
+	DO 100 l = dlot, dhit
+	DO 100 k = dloz, dhiz
+	DO 100 j = dloy, dhiy
+	DO 100 i = dlox, dhix
+
+	   dst(i,j,k,l,m,n) = src(i,j,k,l,m,n)
+
+ 100	CONTINUE
+
+* check for differing bad data flags in an efficient way ...
+	IF ( bad_src .NE. bad_dst ) THEN
+	   DO 200 n = dlof, dhif
+	   DO 200 m = dloe, dhie
+	   DO 200 l = dlot, dhit
+	   DO 200 k = dloz, dhiz
+	   DO 200 j = dloy, dhiy
+	   DO 200 i = dlox, dhix
+
+	      IF ( src(i,j,k,l,m,n) .EQ. bad_src ) dst(i,j,k,l,m,n) = bad_dst
+
+ 200	   CONTINUE
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_grid_trans.F b/fer/utl/copy_grid_trans.F
new file mode 100644
index 0000000..09aa92f
--- /dev/null
+++ b/fer/utl/copy_grid_trans.F
@@ -0,0 +1,74 @@
+	SUBROUTINE COPY_GRID_TRANS ( md1, md2, src, msrc, dst, mdst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from one grid to another transposing dim1 and dim2 components
+* note: this routine could be eliminated using the more general PERMUTE
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/14/88 - from COPY_GRID ver. 0.0
+* V200:	10/11/89 - use *_SUB - avoid adjustable dimensioning with array
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER md1, md2, msrc, mdst
+	REAL    src( * ), dst( * )
+
+	CALL COPY_GRID_TRANS_SUB( md1, md2,
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .				 mr_bad_data( msrc ),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst),
+     .				 mr_bad_data( mdst )			)
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_grid_trans_sub.F b/fer/utl/copy_grid_trans_sub.F
new file mode 100644
index 0000000..5633f64
--- /dev/null
+++ b/fer/utl/copy_grid_trans_sub.F
@@ -0,0 +1,98 @@
+	SUBROUTINE COPY_GRID_TRANS_SUB( md1, md2,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif, bad_src,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif, bad_dst )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from one grid to another transposing dim1 and dim2 components
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V200:	10/16/89 - from COPY_GRID_TRANS
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+* note: dst has dimensions transposed
+	INTEGER md1, md2,
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( md2, md1 )
+	REAL	bad_src, bad_dst
+
+* internal variable declarations:
+	INTEGER	ii, jj, i, j, k, l, m, n 
+
+* --- end of introductory code ---
+
+	ii = 1
+	jj = 1
+	DO 100 n = dlof, dhif
+	DO 100 m = dloe, dhie
+	DO 100 l = dlot, dhit
+	DO 100 k = dloz, dhiz
+	DO 100 j = dloy, dhiy
+	DO 100 i = dlox, dhix
+
+	   dst(jj,ii) = src(i,j,k,l,m,n)
+
+	   ii = ii + 1
+	   IF ( ii .GT. md1 ) THEN
+	      ii = 1
+	      jj = jj + 1
+	   ENDIF
+
+ 100	CONTINUE
+
+* check for differing bad data flags in an efficient way ...
+	IF ( bad_src .NE. bad_dst ) THEN
+	   DO 200 ii = 1, md1
+	   DO 200 jj = 1, md2
+
+	      IF ( dst(jj,ii) .EQ. bad_src ) dst(jj,ii) = bad_dst
+
+ 200	   CONTINUE
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_into.F b/fer/utl/copy_into.F
new file mode 100644
index 0000000..aa9347c
--- /dev/null
+++ b/fer/utl/copy_into.F
@@ -0,0 +1,131 @@
+	SUBROUTINE COPY_INTO ( src, msrc, cxs, dst, mdst )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V200:  6/8/89
+*	10/16/89 - use *_SUB - avoid adjustable dimensioning with array
+* V533:  *sh* 6/01 - allow for the possibility that there is a delta value
+*		   - support for string arrays
+* 560: *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, cxs, mdst
+	REAL    src( * ), dst( * )
+
+* internal variable declarations
+	INTEGER idim, soffset, doffset, mdel,
+     .		smlo(nferdims), smhi(nferdims),
+     .		dmlo(nferdims), dmhi(nferdims),
+     .		cxlo(nferdims), cxhi(nferdims)
+
+* set-up modified limits wherever delta is significant
+* cuz the FORTRAN dimensioned size can only have delta of 1 
+
+	DO idim = 1,nferdims
+	  IF (mr_delta(idim,msrc) .NE. unspecified_val8) THEN
+            mdel = NINT(mr_delta(idim,msrc))
+
+	    IF (mr_delta(idim,msrc).NE.mr_delta(idim,mdst)
+     .	   .OR. mr_delta(idim,msrc).NE.cx_delta(idim,cxs) ) CALL WARN
+     .		('Internl_delta_err')
+	    soffset = (mr_lo_ss(msrc,idim)-cx_lo_ss(cxs,idim))/
+     .			mdel  + 1
+	    doffset = (mr_lo_ss(mdst,idim)-cx_lo_ss(cxs,idim))/
+     .			mdel  + 1
+	    cxlo(idim) = 1
+
+	    cxhi(idim) = 1 + (cx_hi_ss(cxs,idim)-cx_lo_ss(cxs,idim))/
+     .			     mdel
+	    dmlo(idim) = doffset
+	    dmhi(idim) = doffset +
+     .			     (mr_hi_ss(mdst,idim)-mr_lo_ss(mdst,idim))/
+     .			     mdel
+	    smlo(idim) = soffset
+	    smhi(idim) = soffset + 
+     .			     (mr_hi_ss(msrc,idim)-mr_lo_ss(msrc,idim))/
+     .			     mdel
+	  ELSE
+	    cxlo(idim) = cx_lo_ss(cxs, idim)
+	    cxhi(idim) = cx_hi_ss(cxs, idim)
+	    dmlo(idim) = mr_lo_ss(mdst,idim)
+	    dmhi(idim) = mr_hi_ss(mdst,idim)
+	    smlo(idim) = mr_lo_ss(msrc,idim)
+	    smhi(idim) = mr_hi_ss(msrc,idim)
+	  ENDIF
+	ENDDO
+
+	IF (mr_type(msrc) .EQ. ptype_string ) THEN
+	   CALL COPY_PTR_INTO_SUB( cxlo, cxhi,
+     .			    src, smlo(1), smhi(1),
+     .				 smlo(2), smhi(2),
+     .				 smlo(3), smhi(3),
+     .				 smlo(4), smhi(4),
+     .				 smlo(5), smhi(5),
+     .				 smlo(6), smhi(6),
+     .			    dst, dmlo(1), dmhi(1),
+     .				 dmlo(2), dmhi(2),
+     .				 dmlo(3), dmhi(3),
+     .				 dmlo(4), dmhi(4),
+     .				 dmlo(5), dmhi(5),
+     .				 dmlo(6), dmhi(6) )
+	ELSE
+	   CALL COPY_INTO_SUB( cxlo, cxhi,
+     .			    src, smlo(1), smhi(1),
+     .				 smlo(2), smhi(2),
+     .				 smlo(3), smhi(3),
+     .				 smlo(4), smhi(4),
+     .				 smlo(5), smhi(5),
+     .				 smlo(6), smhi(6),
+     .			    dst, dmlo(1), dmhi(1),
+     .				 dmlo(2), dmhi(2),
+     .				 dmlo(3), dmhi(3),
+     .				 dmlo(4), dmhi(4),
+     .				 dmlo(5), dmhi(5),
+     .				 dmlo(6), dmhi(6) )
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_into_mapped.F b/fer/utl/copy_into_mapped.F
new file mode 100644
index 0000000..b056e5b
--- /dev/null
+++ b/fer/utl/copy_into_mapped.F
@@ -0,0 +1,105 @@
+	SUBROUTINE COPY_INTO_MAPPED ( src, msrc, cxs,
+     .				      sorted_indices, index_map, hilim,
+     .				      axis, dst, mdst )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using sorted_indices
+* and index_map to guide the copy subscripts along axis "axis"
+* The dstination grid is assumed big enough to hold the data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 8/99 *sh* - based on COPY_INTO
+* V533: 7/01 *sh* - added string support
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER msrc, cxs, mdst, axis, hilim
+	REAL    sorted_indices( * ), index_map( * ), src( * ), dst( * )
+
+* A typical scenario for the use of this routine might be as follows:
+*   requested list of subscripts at which to sample: {17, 13, 15, 13}
+*   sorted indices (derived from above):	      13, 13, 15, 17
+*   index map -- from sorted to original:	      2, 4, 3, 1  
+
+* The source data might contain VAR[I=13:15]  ("axis" = I)
+* with "hilim" equal to 3 -- pointing to the upper limit in the sorted indices
+*		and index map of the source data
+ 
+* The job of this routine would be to copy I=15 of source into I=3 of result 
+*	then throw away I=14
+*	then copy I=13 of source into both I=4 and I=2 or result
+
+	IF (mr_type(msrc) .EQ. ptype_string ) THEN
+	  CALL COPY_PTR_INTO_MAPPED_SUB( cxs, axis, hilim,
+     .			    sorted_indices, index_map,
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst) )
+	ELSE
+	  CALL COPY_INTO_MAPPED_SUB( cxs, axis, hilim,
+     .			    sorted_indices, index_map,
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst) )
+	ENDIF
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_into_mapped_sub.F b/fer/utl/copy_into_mapped_sub.F
new file mode 100644
index 0000000..7d5e566
--- /dev/null
+++ b/fer/utl/copy_into_mapped_sub.F
@@ -0,0 +1,300 @@
+	SUBROUTINE COPY_INTO_MAPPED_SUB( cxs, axis, hilim,
+     .		sorted_indices, index_map,
+     .          src, slox, shix, sloy, shiy, sloz, 
+     .          shiz, slot, shit, sloe, shie, slof, shif,
+     .          dst, dlox, dhix, dloy, dhiy, dloz, 
+     .          dhiz, dlot, dhit, dloe, dhie, dlof, dhif)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V510: 8/99 *sh*
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cxs, axis, hilim,
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .          slot, shit, sloe, shie, slof, shif, 
+     .          dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .          dlot, dhit, dloe, dhie, dlof, dhif
+	REAL	sorted_indices(hilim), index_map(hilim)
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .          dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, pointer, src_index, dst_index, isorted,
+     .		src_index_2
+
+* --- end of introductory code ---
+
+
+* initialize
+* ... skip missing value flags at the upper end of the sorted_indices
+	DO 10 pointer = hilim, 1, -1
+	   IF (sorted_indices(pointer) .NE. bad_val4) GOTO 50
+ 10	CONTINUE
+	RETURN	! all of the indices are missing values
+
+
+**** Mapped copy along X axis
+ 50	IF ( axis .EQ. x_dim ) THEN
+
+* ... initialize
+	   src_index = cx_hi_s1(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 100	   CONTINUE	! find where src_index belongs in the result
+	   DO 150 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 110 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 110 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 110 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 110 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 110 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+ 110		 dst(dst_index,j,k,l,m,n) = src(src_index,j,k,l,m,n)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s1(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 100
+	         ENDIF
+	      ENDIF
+ 150	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+**** Mapped copy along Y axis
+
+* ... initialize
+	   src_index = cx_hi_s2(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 200	   CONTINUE	! find where src_index belongs in the result
+	   DO 250 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 210 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 210 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 210 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 210 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 210 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 210		 dst(i,dst_index,k,l,m,n) = src(i,src_index,k,l,m,n)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s2(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 200
+	         ENDIF
+	      ENDIF
+ 250	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+**** Mapped copy along Z axis
+
+* ... initialize
+	   src_index = cx_hi_s3(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 300	   CONTINUE	! find where src_index belongs in the result
+	   DO 350 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 310 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 310 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 310 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 310 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 310 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 310		 dst(i,j,dst_index,l,m,n) = src(i,j,src_index,l,m,n)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s3(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 300
+	         ENDIF
+	      ENDIF
+ 350	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+**** Mapped copy along T axis
+
+* ... initialize
+	   src_index = cx_hi_s4(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 400	   CONTINUE	! find where src_index belongs in the result
+	   DO 450 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 410 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 410 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 410 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 410 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 410 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 410		 dst(i,j,k,dst_index,m,n) = src(i,j,k,src_index,m,n)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s4(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 400
+	         ENDIF
+	      ENDIF
+ 450	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+**** Mapped copy along E axis
+
+* ... initialize
+	   src_index = cx_hi_s5(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 500	   CONTINUE	! find where src_index belongs in the result
+	   DO 550 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 510 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 510 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 510 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 510 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 510 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 510		 dst(i,j,k,l,dst_index,n) = src(i,j,k,l,src_index,n)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s5(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 500
+	         ENDIF
+	      ENDIF
+ 550	   CONTINUE
+
+
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+**** Mapped copy along F axis
+
+* ... initialize
+	   src_index = cx_hi_s6(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 600	   CONTINUE	! find where src_index belongs in the result
+	   DO 650 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 610 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 610 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 610 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 610 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 610 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 610		 dst(i,j,k,l,m,dst_index) = src(i,j,k,l,m,src_index)
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s6(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 600
+	         ENDIF
+	      ENDIF
+ 650	   CONTINUE
+
+
+	ELSE
+	   STOP 'COPY_INTO_MAPPED_SUB: axis!!'
+
+	ENDIF
+
+* success
+* the index map has been completely traversed -- destination var is complete
+	RETURN
+	END 
diff --git a/fer/utl/copy_into_sub.F b/fer/utl/copy_into_sub.F
new file mode 100644
index 0000000..2481def
--- /dev/null
+++ b/fer/utl/copy_into_sub.F
@@ -0,0 +1,81 @@
+	SUBROUTINE COPY_INTO_SUB( cxlo, cxhi,
+     .          src, slox, shix, sloy, shiy, sloz, shiz, 
+     .          slot, shit, sloe, shie, slof, shif,
+     .          dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .          dlot, dhit, dloe, dhie, dlof, dhif   )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/16/89 - from COPY_INTO
+* V533 *sh* 6/01 - allowing delta values in mrs
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER cxlo(*), cxhi(*),
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .          slot, shit, sloe, shie, slof, shif, 
+     .          dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .          dlot, dhit, dloe, dhie, dlof, dhif
+
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .          dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+        DO 100 n = cxlo(6), cxhi(6)
+        DO 100 m = cxlo(5), cxhi(5)
+	DO 100 l = cxlo(4), cxhi(4)
+	DO 100 k = cxlo(3), cxhi(3)
+	DO 100 j = cxlo(2), cxhi(2)
+	DO 100 i = cxlo(1), cxhi(1)
+
+	   dst(i,j,k,l,m,n) = src(i,j,k,l,m,n)
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_ptr_grid_sub.F b/fer/utl/copy_ptr_grid_sub.F
new file mode 100644
index 0000000..1e27601
--- /dev/null
+++ b/fer/utl/copy_ptr_grid_sub.F
@@ -0,0 +1,76 @@
+	SUBROUTINE COPY_PTR_GRID_SUB (
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		     slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		     dlot, dhit, dloe, dhie, dlof, dhif )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* support routine for COPY_GRID with unsubscripted limits
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V533: 6/01 *sh*
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	DO 100 n = dlof, dhif
+	DO 100 m = dloe, dhie
+	DO 100 l = dlot, dhit
+	DO 100 k = dloz, dhiz
+	DO 100 j = dloy, dhiy
+	DO 100 i = dlox, dhix
+
+	   CALL COPY_C_STRING( src(i,j,k,l,m,n), dst(i,j,k,l,m,n))
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/copy_ptr_into_mapped_sub.F b/fer/utl/copy_ptr_into_mapped_sub.F
new file mode 100644
index 0000000..ed03194
--- /dev/null
+++ b/fer/utl/copy_ptr_into_mapped_sub.F
@@ -0,0 +1,302 @@
+	SUBROUTINE COPY_PTR_INTO_MAPPED_SUB( cxs, axis, hilim,
+     .		sorted_indices, index_map,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif  )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy string data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533 *sh* 6/01
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cxs, axis, hilim,
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif 
+	REAL	sorted_indices(hilim), index_map(hilim)
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, pointer, src_index, dst_index, isorted,
+     .		src_index_2
+
+* --- end of introductory code ---
+
+* initialize
+* ... skip missing value flags at the upper end of the sorted_indices
+	DO 10 pointer = hilim, 1, -1
+	   IF (sorted_indices(pointer) .NE. bad_val4) GOTO 50
+ 10	CONTINUE
+	RETURN	! all of the indices are missing values
+
+
+**** Mapped copy along X axis
+ 50	IF ( axis .EQ. x_dim ) THEN
+
+* ... initialize
+	   src_index = cx_hi_s1(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 100	   CONTINUE	! find where src_index belongs in the result
+	   DO 150 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 110 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 110 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 110 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 110 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 110 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+ 110		 CALL COPY_C_STRING( src(src_index,j,k,l,m,n),
+     .				     dst(dst_index,j,k,l,m,n) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s1(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 100
+	         ENDIF
+	      ENDIF
+ 150	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+**** Mapped copy along Y axis
+
+* ... initialize
+	   src_index = cx_hi_s2(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 200	   CONTINUE	! find where src_index belongs in the result
+	   DO 250 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 210 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 210 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 210 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 210 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 210 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 210		 CALL COPY_C_STRING( src(i,src_index,k,l,m,n),
+     .				     dst(i,dst_index,k,l,m,n) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s2(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 200
+	         ENDIF
+	      ENDIF
+ 250	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+**** Mapped copy along Z axis
+
+* ... initialize
+	   src_index = cx_hi_s3(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 300	   CONTINUE	! find where src_index belongs in the result
+	   DO 350 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 310 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 310 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 310 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 310 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 310 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 310		 CALL COPY_C_STRING( src(i,j,src_index,l,m,n),
+     .				     dst(i,j,dst_index,l,m,n) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s3(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 300
+	         ENDIF
+	      ENDIF
+ 350	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+**** Mapped copy along T axis
+
+* ... initialize
+	   src_index = cx_hi_s4(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 400	   CONTINUE	! find where src_index belongs in the result
+	   DO 450 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 410 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 410 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 410 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 410 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 410 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 410		 CALL COPY_C_STRING( src(i,j,k,src_index,m,n),
+     .				     dst(i,j,k,dst_index,m,n) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s4(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 400
+	         ENDIF
+	      ENDIF
+ 450	   CONTINUE
+
+	ELSEIF ( axis .EQ. e_dim ) THEN
+**** Mapped copy along E axis
+
+* ... initialize
+	   src_index = cx_hi_s5(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 500	   CONTINUE	! find where src_index belongs in the result
+	   DO 550 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 510 n = cx_lo_s6(cxs), cx_hi_s6(cxs)
+	         DO 510 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 510 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 510 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 510 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 510		 CALL COPY_C_STRING( src(i,j,k,l,src_index,n),
+     .				     dst(i,j,k,l,dst_index,n) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s5(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 500
+	         ENDIF
+	      ENDIF
+ 550	   CONTINUE
+
+	ELSEIF ( axis .EQ. f_dim ) THEN
+**** Mapped copy along F axis
+
+* ... initialize
+	   src_index = cx_hi_s6(cxs)
+* ... if the input data has no range (-999:-999) then match on sorted_indices=1
+	   IF (src_index .EQ. unspecified_int4) THEN
+	      src_index_2 = 1
+	   ELSE
+	      src_index_2 = src_index
+	   ENDIF
+
+ 600	   CONTINUE	! find where src_index belongs in the result
+	   DO 650 isorted = pointer, 1, -1
+	      IF (src_index_2 .EQ. sorted_indices(isorted)) THEN
+* ... copy a source point to the destination
+	         dst_index = index_map(isorted)
+	         DO 610 m = cx_lo_s5(cxs), cx_hi_s5(cxs)
+	         DO 610 l = cx_lo_s4(cxs), cx_hi_s4(cxs)
+	         DO 610 k = cx_lo_s3(cxs), cx_hi_s3(cxs)
+	         DO 610 j = cx_lo_s2(cxs), cx_hi_s2(cxs)
+	         DO 610 i = cx_lo_s1(cxs), cx_hi_s1(cxs)
+ 610		 CALL COPY_C_STRING( src(i,j,k,l,m,src_index),
+     .				     dst(i,j,k,l,m,dst_index) )
+	      ELSEIF (src_index .GT. sorted_indices(isorted)) THEN
+	         src_index   = src_index   - 1
+	         src_index_2 = src_index_2 - 1
+	         IF ( src_index .LT. cx_lo_s6(cxs) ) THEN
+	            RETURN	! that's all this comonent is gonna supply
+	         ELSE
+	            pointer = isorted	! (just for efficiency)
+	            GOTO 600
+	         ENDIF
+	      ENDIF
+ 650	   CONTINUE
+
+	ELSE
+	   STOP 'COPY_INTO_MAPPED_SUB: axis!!'
+
+	ENDIF
+
+* success
+* the index map has been completely traversed -- destination var is complete
+	RETURN
+	END 
diff --git a/fer/utl/copy_ptr_into_sub.F b/fer/utl/copy_ptr_into_sub.F
new file mode 100644
index 0000000..6622826
--- /dev/null
+++ b/fer/utl/copy_ptr_into_sub.F
@@ -0,0 +1,75 @@
+	SUBROUTINE COPY_PTR_INTO_SUB( cxlo, cxhi,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif  )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy data from source grid into dstination grid using limits of source
+* context (i.e. dstination grid is ASSUMED) big enough to hold data
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533 *sh* 6/01
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER cxlo(*), cxhi(*),
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	DO 100 n = cxlo(6), cxhi(6)
+	DO 100 m = cxlo(5), cxhi(5)
+	DO 100 l = cxlo(4), cxhi(4)
+	DO 100 k = cxlo(3), cxhi(3)
+	DO 100 j = cxlo(2), cxhi(2)
+	DO 100 i = cxlo(1), cxhi(1)
+
+	   CALL COPY_C_STRING( src(i,j,k,l,m,n), dst(i,j,k,l,m,n) )
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/count_number_list.F b/fer/utl/count_number_list.F
new file mode 100644
index 0000000..f9182d2
--- /dev/null
+++ b/fer/utl/count_number_list.F
@@ -0,0 +1,128 @@
+	SUBROUTINE COUNT_NUMBER_LIST( string, n )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* count the number of values in a list of the form "{ 1, 3,5,7, 9}"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500: *sh* 12/98
+* V510: *sh* 10/99 bug fix: single character {3} gave n=0
+* V530:  8/00 *sh* - added support for arrays of strings
+* V530:  7/01 *sh* - allow single quoted strings
+* V540:  9/01 *sh* - change "SYSTEM:" to "SPAWN:"
+*       *acm* 3/12   add disclaimer
+
+* calling argument declarations
+	INTEGER		n
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		in_quote, doub_quote, no_chars_yet
+	INTEGER 	TM_LENSTR1, STR_CASE_BLIND_COMPARE,
+     .			i, start, slen, vax_code
+	CHARACTER*1	c
+
+!* internal parameter declarations
+!	CHARACTER*1     tab
+!	PARAMETER     ( tab = CHAR(9) )
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+
+* initialize
+	n = 1
+	slen = TM_LENSTR1( string )
+	start = 1
+	no_chars_yet = .TRUE.
+
+* trim around the enclosing "{}" brackets
+	IF ( string(slen:slen) .EQ. '}' ) slen = slen - 1
+	IF ( string (1:1) .EQ. '{' ) start = start + 1
+	IF (start .GT. slen) RETURN 
+
+* loop through the text counting commas
+* (poor man's FORTRAN DO-WHILE loop)
+	in_quote = .FALSE.
+	i = start - 1
+ 100	i = i + 1
+	   c = string(i:i)
+	   IF (in_quote) THEN
+
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+              IF (c .EQ. '\') THEN
+#else
+              IF (c .EQ. '\\') THEN
+#endif
+	         i = i + 1   ! skip processing of next character 
+	      ELSEIF  (     doub_quote .AND. c.EQ.'"'
+     .	          .OR. .NOT.doub_quote .AND. c.EQ."'" ) THEN
+	         in_quote = .FALSE.
+	      ELSE
+	         CONTINUE   ! skip over anything inside of quotations
+	      ENDIF
+	   ELSEIF (c .EQ. '"') THEN
+	      in_quote = .TRUE.
+	      doub_quote = .TRUE.
+	   ELSEIF (c .EQ. "'") THEN
+	      in_quote = .TRUE.
+	      doub_quote = .FALSE.
+	   ELSEIF (c .EQ. ',') THEN
+	      n = n+1
+	   ELSEIF (c.EQ.'s' .OR. c.EQ.'S' ) THEN
+	      IF ( i+7 .GT. slen ) CONTINUE  ! trap syntax error later
+	      vax_code = STR_CASE_BLIND_COMPARE(string(i:i+5), 'SPAWN:')
+	      IF( vax_code .NE. vms_str_success ) CONTINUE ! trap syntax later
+	      i = i + 5
+	      n = n + 2000 - 1   ! allow default memory for 2000 strings 
+	   ELSE
+	      CONTINUE   ! ignore the text, itself
+	   ENDIF
+!	   IF (no_chars_yet) THEN
+!	      IF (c .NE. ','
+!     .	    .AND. c .NE. ' '
+!     .	    .AND. c .NE. tab ) no_chars_yet = .FALSE.
+!	   ENDIF
+	IF ( i .LT. slen ) GOTO 100
+
+!* if there were any digits at all then the count of numbers is the
+!* count of commas plus 1
+!	IF (.NOT.no_chars_yet) n = n + 1
+
+* success
+	RETURN
+
+	END
diff --git a/fer/utl/create_counter_list.F b/fer/utl/create_counter_list.F
new file mode 100644
index 0000000..4452c2a
--- /dev/null
+++ b/fer/utl/create_counter_list.F
@@ -0,0 +1,107 @@
+	SUBROUTINE CREATE_COUNTER_LIST( string, array, nmax, status )
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* return a list of values for a counter (REPEAT/RANGE=string ) where
+! string is the string, e.g. 10:1000:100
+
+* ACM
+* As in counter_var_context, without error checking since it has
+* already been done in that routine.
+* V554: *acm* 1/4
+
+* calling argument declarations
+	INTEGER		nmax, status
+	REAL		array(nmax)
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+
+        INTEGER		TM_LENSTR, ATOM_POS,  slen, 
+     .                  colon_pos, colon2_pos, lo_start, lo_end, hi_start, 
+     .                  hi_end, dum, xlo, xhi, n
+        LOGICAL         colon, colon2, fmat, use_subscripts
+        REAL*8          ss_answer		
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* set the limits
+
+        slen = TM_LENSTR(string)
+
+* ... ":"
+        lo_start = 1
+        colon = .FALSE.
+	colon_pos = ATOM_POS( string, ':' )
+	lo_end	 = colon_pos - 1
+
+*  ... second ":"
+
+        colon2 = .FALSE.
+	colon2_pos = ATOM_POS(string( colon_pos+1:slen ), ':' )
+	colon2 = colon2_pos .NE. atom_not_found
+	IF ( colon2 ) THEN
+	   colon2_pos = colon2_pos + colon_pos
+           hi_end     = colon2_pos - 1
+	ELSE
+	   hi_end     = slen
+        ENDIF
+	hi_start      = colon_pos + 1
+
+* Call translate_limit to check syntax and set ss limits
+
+        use_subscripts = .TRUE.
+        dum = 1
+
+	CALL TRANSLATE_LIMIT
+     .		      (  string(lo_start:lo_end), x_dim,
+     .			use_subscripts,
+     .			ss_answer, fmat, dum, status )
+        xlo = INT(ss_answer)
+
+	CALL TRANSLATE_LIMIT
+     .		      (  string(hi_start:hi_end), x_dim,
+     .			use_subscripts,
+     .			ss_answer, fmat, dum, status )
+        xhi = INT(ss_answer)
+
+        DO 100 n = xlo, xhi
+           array(n) = n
+  100   CONTINUE
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+        END
diff --git a/fer/utl/cstring_insert.F b/fer/utl/cstring_insert.F
new file mode 100644
index 0000000..a3576c7
--- /dev/null
+++ b/fer/utl/cstring_insert.F
@@ -0,0 +1,92 @@
+	SUBROUTINE CSTRING_INSERT( fstring, flen, cstring, clen, insert_pt)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Insert a FORTRAN character string into a "C" string (a character array)
+* using a carriage return followed by null as the terminator.
+* Return with the insertion point pointing to the null.
+
+* V400:  8/94
+
+* Note that insert_pt is both input and output - it will be returned at the
+* correct position for the next insert
+
+* If insert_pt>clen upon return that means the buffer has overflowed
+
+* calling argument declarations:
+	INTEGER	flen, clen, insert_pt
+	CHARACTER fstring*(*)
+#ifdef sun
+        BYTE      cstring(clen) ! c-type Hollerith string buffer
+#else
+        INTEGER*1 cstring(clen) ! c-type Hollerith string buffer
+#endif
+
+* internal variable declarations:
+
+* internal parameter declarations:
+#ifdef sun
+        BYTE      CR, NULL, STAR
+#else
+        INTEGER*1 CR, NULL, STAR
+#endif
+	PARAMETER ( CR   = 13,
+     .		    NULL =  0,
+     .		    STAR = 42 )	
+
+	IF ( insert_pt + flen + 2 .LE. clen ) THEN
+
+* insert the new string
+	  CALL TM_FTOC_STRNG( fstring(:flen), cstring(insert_pt), clen )
+	  insert_pt = insert_pt + flen
+
+* insert the terminators
+	  cstring(insert_pt) = CR
+	  insert_pt = insert_pt + 1
+	  cstring(insert_pt) = NULL      ! overwritten by next
+	
+	ELSE
+
+* ERROR: insufficient room to append this text
+	  DO 100 insert_pt = insert_pt, clen-1
+ 100	  cstring(insert_pt) = STAR
+	  cstring(clen) = NULL
+	  insert_pt = clen + 1
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/de_escape_string.F b/fer/utl/de_escape_string.F
new file mode 100644
index 0000000..9357139
--- /dev/null
+++ b/fer/utl/de_escape_string.F
@@ -0,0 +1,84 @@
+	SUBROUTINE DE_ESCAPE_STRING ( string, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* remove one set of backslash-escapes from a string thereby "exposing" the
+* chat=racter that follows each backslash
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/4/86
+* Unix/RISC port - 2/13/91 - .AND. always produces a logical result
+
+* V510: 3/00 *sh*
+
+* calling argument declarations
+	CHARACTER string*(*)
+
+* internal variable declarations
+	INTEGER	TM_LENSTR1, slen, iin, iout
+
+! initialize
+	slen = TM_LENSTR1(string)
+	iin = 1
+	iout = iin
+
+! a DO-WHILE loop
+ 10	IF ( iin .GT. slen ) GOTO 50
+
+!    ... do not copy a slash -- but always copy the character that follows it
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+        IF (string(iin:iin) .EQ. '\' ) iin = iin + 1
+#else
+        IF (string(iin:iin) .EQ. '\\') iin = iin + 1
+#endif
+	
+	IF ( iin .LE. slen ) THEN
+	   string(iout:iout) = string(iin:iin)
+	   iin = iin + 1
+	   iout = iout + 1
+	   GOTO 10
+	ENDIF
+
+!   blank out any remaining characters
+ 50	DO 100 iin = iout, slen
+ 100	string(iin:iin) = " " 
+	slen = MAX(iout-1, 1)	! new string length
+	RETURN
+
+	END
diff --git a/fer/utl/deallo_all_axes.F b/fer/utl/deallo_all_axes.F
new file mode 100644
index 0000000..0093f8b
--- /dev/null
+++ b/fer/utl/deallo_all_axes.F
@@ -0,0 +1,114 @@
+
+	SUBROUTINE DEALLO_ALL_AXES
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Deallocates all axis (line) slots defined by user 
+* Does not deallocate the first group of "protected" axes.
+* ACM 6/11/2002
+*
+* V5.41 7/30/02 ACM Deallocate irregular dynamic axes defined by files too,
+*               by calling PACK_LINE_STORAGE.
+* V5.42 10/31/02 ACM Check to see if axes are in use, and if so dont remove!
+* V5.42 11/06/02 ACM line_keep_flag(islot) is a logical, use .FALSE. not 0.
+* V600 10/28/05 ACM Fix bug 1354: cancel data should recover coordinate storage
+
+* Parameters and commons
+
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_errors.parm'
+        include 'xtm_grid.cmn_text'
+        include 'ferret.parm'
+	include 'errmsg.parm'
+
+* Local declarations
+
+        LOGICAL all_gone
+	INTEGER TM_GET_LINENUM, TM_GET_GRID_OF_LINE,
+     .          islot, grid, status, num_protected_axes
+
+* Remove axis names
+
+	num_protected_axes = TM_GET_LINENUM( 'EZ' )  ! top protected axis
+
+        IF (num_protected_axes .EQ. unspecified_int4 .OR.
+     .      num_protected_axes .LE. 0) num_protected_axes = 1
+
+        all_gone = .TRUE.
+        DO 100 islot = num_protected_axes+1, line_ceiling
+           IF (line_name(islot) .NE. char_init16) THEN
+
+	      line_keep_flag(islot) = .FALSE.  ! see xeq_cancel.F
+              IF (line_use_cnt(islot) .LE. 0) THEN
+	         IF ( islot .LE. max_lines ) THEN
+                    IF (.NOT. line_regular(islot)) 
+     .                  CALL PACK_LINE_STORAGE(islot)
+		    line_name(islot) = char_init16
+	         ELSE
+	            CALL TM_DEALLO_DYN_LINE(islot)
+	         ENDIF
+              ELSE
+
+*     ... cannot delete - in use.  Locate the grid that is using it.
+
+	         grid = TM_GET_GRID_OF_LINE( islot )
+	         CALL WARN( 'Not deleted: '//line_name(islot))
+	         IF ( grid .NE. unspecified_int4 ) THEN
+	            CALL WARN( 
+     .		      'Axis is in use by grid '//grid_name(grid))
+	         ELSE
+	            CALL ERRMSG(ferr_internal, status,
+     .				'axis use count err', *5000)
+	         ENDIF
+                 all_gone = .FALSE.
+	      ENDIF
+
+           ENDIF
+
+  100	CONTINUE
+
+* If all axes were deleted sucessfully, then reset the pointer into coordinate
+* storage.
+
+        IF (all_gone) next_line_mem_pos = pline_mem_init
+
+	RETURN
+
+* error exits
+ 5000	RETURN
+
+	END
diff --git a/fer/utl/deallo_all_grids.F b/fer/utl/deallo_all_grids.F
new file mode 100644
index 0000000..a01b2ad
--- /dev/null
+++ b/fer/utl/deallo_all_grids.F
@@ -0,0 +1,92 @@
+	SUBROUTINE DEALLO_ALL_GRIDS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate all scratch space from the grid COMMON stack
+* (9/95) also deallocate any dynamic grids that were in progress
+* (used following error conditions)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/22/89
+* V230:  7/24/92 - bug fix: loop index (igrid)  wasn't used inside loop
+*                           grd_stk_ptr was!
+* V420:  9/20/95 - deallocate dynamic grids, too
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'interp_stack.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xfr_grid.cmn'
+
+* internal variable declarations
+	INTEGER	igrid, i, cx, status
+
+* deallocate the temporary grids from the upper grid stack
+* (see documentation in tm_allo_dyn_grid)
+* this may occasionally also deallocate associated dynamic axes
+	DO 100 igrid = grd_stk_ptr, max_grids-1
+	   CALL DEALLO_GRID(status)
+	   IF ( status .NE. ferr_ok ) THEN	
+	      grd_stk_ptr = max_grids
+	      GOTO 150			! internal error!!
+	   ENDIF
+ 100	CONTINUE
+
+* Deallocate any dynamic grid (and associated memory vars) the need for which
+* has been terminated by this error condition.
+* A record of all of the dynamic grids in progress is implicitly available
+* on the interpretation stack.
+ 150 	DO 200 cx = cx_stack_ptr, cx_stack_ptr_base, -1
+	   IF ( cx_has_impl_grid(cx) .AND. cx_grid(cx).GT.max_grids) THEN
+	      CALL DEALLO_DYN_GRID(cx_grid(cx))
+	      cx_has_impl_grid(cx) = .FALSE.
+	   ENDIF
+ 200	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/deallo_grid.F b/fer/utl/deallo_grid.F
new file mode 100644
index 0000000..48c26a2
--- /dev/null
+++ b/fer/utl/deallo_grid.F
@@ -0,0 +1,81 @@
+	SUBROUTINE DEALLO_GRID( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate a scratch space from the grid COMMON stack
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  6/22/89
+* V420: 10/95 - deallocate any dynamic lines that were used by this grid
+* Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V510 *sh* 4/00 - deallocation of axes applies to all -- not just dynamic
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	status
+
+* internal declarations:
+	INTEGER	idim
+
+* clean out the grid deallocating any dynamic lines that this used
+	DO 100 idim = 1, nferdims
+	   CALL TM_DEALLO_DYN_LINE(grid_line(idim,grd_stk_ptr) )
+	   grid_line(idim,grd_stk_ptr) = unspecified_int4
+ 100	CONTINUE
+	grid_name(grd_stk_ptr) = char_init16
+
+* remove the stack slot
+	grd_stk_ptr = grd_stk_ptr + 1
+
+	IF ( grd_stk_ptr .GT. max_grids ) CALL ERRMSG
+     .		( ferr_stack_ovfl, status, 'deallo_grid',*5000 )
+
+	status = ferr_ok
+
+ 5000	RETURN
+	END
diff --git a/fer/utl/deallo_unformed_grid.F b/fer/utl/deallo_unformed_grid.F
new file mode 100644
index 0000000..c1d5b02
--- /dev/null
+++ b/fer/utl/deallo_unformed_grid.F
@@ -0,0 +1,74 @@
+	SUBROUTINE DEALLO_UNFORMED_GRID( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate a scratch space from the grid COMMON stack
+* The axes of this grid were never allocated, so it is an "unformed" grid
+
+* V520 *sh* 6/00 - new based on DEALLO_GRID
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xfr_grid.cmn'
+
+* calling argument declarations
+	INTEGER	status
+
+* internal declarations:
+	INTEGER	idim
+
+* clean out the grid deallocating any dynamic lines that this used
+	DO 100 idim = 1, nferdims
+	   grid_line(idim,grd_stk_ptr) = unspecified_int4
+ 100	CONTINUE
+	grid_name(grd_stk_ptr) = char_init16
+
+* remove the stack slot
+	grd_stk_ptr = grd_stk_ptr + 1
+
+	IF ( grd_stk_ptr .GT. max_grids ) CALL ERRMSG
+     .		( ferr_stack_ovfl, status, 'deallo_unformed_grid',
+     .						*5000 )
+
+	status = ferr_ok
+
+ 5000	RETURN
+	END
diff --git a/fer/utl/decrement_plot_grid.F b/fer/utl/decrement_plot_grid.F
new file mode 100755
index 0000000..aa6c503
--- /dev/null
+++ b/fer/utl/decrement_plot_grid.F
@@ -0,0 +1,51 @@
+	SUBROUTINE DECREMENT_PLOT_GRID
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* Ansley Manke NOAA/PMEL/TMAP 2/10/2014
+*
+*      Decrement the grid use count which was bumped up, saving the grid used
+*      in a SHADE/SET, FILL/SET, CONTOUR/SET or WIRE/SET command. See ticket 883.
+
+	include 'xbox_bounds.cmn'
+
+	INTEGER grid
+
+	grid = bb_grid
+	IF (bb_grid_inccount .GT. 0) CALL TM_DEALLO_DYN_GRID (grid)
+	bb_grid_inccount = 0
+
+	RETURN
+	END
diff --git a/fer/utl/dense_contig_region.F b/fer/utl/dense_contig_region.F
new file mode 100644
index 0000000..dffc742
--- /dev/null
+++ b/fer/utl/dense_contig_region.F
@@ -0,0 +1,84 @@
+	INTEGER FUNCTION DENSE_CONTIG_REGION(index_list, 
+     .				istart, n,
+     .				bad_flag, lo_cx_lim, hi_cx_lim )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Given a *sorted* list of indices, select the largest slug (starting at i=1)
+* that should be read as a contiguous region (a value between 1 and n)
+* For example 1,2,3,5 could be read efficiently as 1:5 (only 20% "waste")
+* but 1,5 should probably be read in 2 separate reads (60% "waste")
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 *sh* 8/99
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER n, istart, lo_cx_lim, hi_cx_lim
+	REAL index_list(n), bad_flag
+
+* internal variable declarations:
+	INTEGER i
+
+* interpal parameter declarations
+	REAL useful_fraction
+	PARAMETER (useful_fraction  = .6) !  1,3,5 ok, but 1,3,5,7 not
+
+
+* is there anything left in the index buffer?
+ 50	IF (istart .GT. n) THEN
+	   DENSE_CONTIG_REGION = 0
+	   RETURN
+	ENDIF
+
+* work from the back forward to get the largest possible region
+	DO 100 i = n, istart, -1
+	  IF ( ((i-istart+1) / (index_list(i)-index_list(istart)+1))
+     .		.GE. useful_fraction ) GOTO 1000
+ 100	CONTINUE
+
+* done
+* return the lo:hi limits of the region to be read
+ 1000	lo_cx_lim = index_list(istart)
+	hi_cx_lim = index_list(i)
+
+* return the pointer to the hi index of the region to be read
+	DENSE_CONTIG_REGION = i
+	RETURN
+
+	END
diff --git a/fer/utl/depend_stat_var.F b/fer/utl/depend_stat_var.F
new file mode 100644
index 0000000..0d690a5
--- /dev/null
+++ b/fer/utl/depend_stat_var.F
@@ -0,0 +1,60 @@
+	SUBROUTINE DEPEND_STAT_VAR( work, string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a string describing the variable that was the source of the dependency tree
+* status flag
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685+  *sh* 9/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations:
+	INTEGER	work(dependency_max_recs, dependency_nfields)
+	CHARACTER(*) string
+
+	CALL DEPEND_STAT_VAR_SUB( string,
+     .			work(1,1), work(1,2), work(1,3), work(1,4), 
+     .			work(1,5), work(1,6), work(1,7), work(1,8) )
+
+
+	RETURN
+	END
diff --git a/fer/utl/depend_stat_var_sub.F b/fer/utl/depend_stat_var_sub.F
new file mode 100644
index 0000000..d4495ef
--- /dev/null
+++ b/fer/utl/depend_stat_var_sub.F
@@ -0,0 +1,93 @@
+	SUBROUTINE DEPEND_STAT_VAR_SUB ( string,
+     .			next,         level,      flag,      dataset,
+     .			var_or_start, cat_or_end, parent_uv, uv_item )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a string describing the variable that was the source of the dependency tree
+* status flag
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685+  *sh* 11/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations:
+	INTEGER	next         (dependency_max_recs),
+     .		level        (dependency_max_recs),
+     .		flag         (dependency_max_recs),
+     .		dataset      (dependency_max_recs),
+     .		var_or_start (dependency_max_recs),
+     .		cat_or_end   (dependency_max_recs),
+     .		parent_uv    (dependency_max_recs),
+     .		uv_item      (dependency_max_recs)
+	CHARACTER(*) string
+
+*	next         - forward link connecting starts of trees 
+*	level        - the child generation level in the tree
+*	flag         - special conditions (see xdependency_tree parameters
+*	var_or_start - variable number if known variable
+*                      or start character of uvar item if unknown
+*	cat_or_end   - category number if known variable
+*                      or end   character of uvar item if unknown
+*	parent_uv    - uvar number of parent variable (used when unknown var)
+*	uv_item      - uvar item number within parent (used when unknown var)
+
+
+* internal variable declarations:
+	INTEGER	row, uvar, istart, iend
+	CHARACTER VAR_CODE*128
+
+* initialize
+	row    = dependency_status_rec
+	uvar   = parent_uv(row)
+	istart = var_or_start(row)
+	iend   = cat_or_end(row)
+
+* get the string showing the cause of the error
+	IF (flag(row) .EQ. df_recursion_error) THEN
+	   string = VAR_CODE(iend, istart)    ! (cat, var)
+	ELSE
+	   string = uvar_text(uvar)(istart:iend)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/display_dependency.F b/fer/utl/display_dependency.F
new file mode 100644
index 0000000..9f83bbc
--- /dev/null
+++ b/fer/utl/display_dependency.F
@@ -0,0 +1,60 @@
+	SUBROUTINE DISPLAY_DEPENDENCY(work)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display a line describing a single variable of a dependency tree
+* with indentation to communicate tree structure
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685+  *sh* 9/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations:
+	INTEGER work(dependency_max_recs, dependency_nfields)
+	    
+* save the item in the dependency tree
+	CALL DISPLAY_DEPENDENCY_SUB(
+     .		work(1,1), work(1,2), work(1,3), work(1,4), 
+     .		work(1,5), work(1,6), work(1,7), work(1,8), work(1,9) )
+
+
+	RETURN
+	END
diff --git a/fer/utl/display_dependency_sub.F b/fer/utl/display_dependency_sub.F
new file mode 100644
index 0000000..dd9b79d
--- /dev/null
+++ b/fer/utl/display_dependency_sub.F
@@ -0,0 +1,342 @@
+	SUBROUTINE DISPLAY_DEPENDENCY_SUB (
+     .            next, level, flag, dataset, var_or_start, cat_or_end,
+     .            parent_uv, uv_item, is_done )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display the dependency tree structure that is stored in a memory work array
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685  *sh* 11/13 
+* V690  *sh* 11/13 - minor adjustments to support auxiliary regridding variables 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+
+* calling argument declarations:
+        INTEGER next         (dependency_max_recs),
+     .          level        (dependency_max_recs),
+     .          flag         (dependency_max_recs),
+     .          dataset      (dependency_max_recs),
+     .          var_or_start (dependency_max_recs),
+     .          cat_or_end   (dependency_max_recs),
+     .          parent_uv    (dependency_max_recs),
+     .          uv_item      (dependency_max_recs)
+	LOGICAL is_done      (dependency_max_recs)
+
+
+* internal variable declarations:
+	LOGICAL tell_dset, dup, state_dflt_dataset, valid_var
+	INTEGER	TM_LENSTR1,rec, ntrees, size, tree_size, tree_rec1,
+     .		var, cat, tree_level, dset, uvar, item, ndone,
+     .		blanks, llen, istart, iend, len2, dnamlen, tree, i
+	CHARACTER*1024 GET_UNIQUE_DSET_NAME, VAR_CODE, VAR_TITLE, line_buff,
+     .		dsetname
+
+* initialize
+	IF (  dependency_tree_show_fvars
+     .	.AND. .NOT.dependency_tree_show_uvars ) GOTO 2000  ! show file var list only
+* ... traverse forward linked list to count the number and set all as not yet displayed
+	rec = 1
+	ntrees = 0
+ 10	IF (next(rec) .GT. rec) THEN
+	   ntrees = ntrees + 1
+	   is_done(rec) = .FALSE.
+	   rec = next(rec)
+	   GOTO 10
+	ENDIF
+	ndone = 0
+
+* do we need to announce the default dataset
+	state_dflt_dataset = dependency_dflt_dset .NE. pdset_irrelevant
+
+	DO 1000 tree = 1, ntrees
+
+* find the largest tree not yet displayed
+	   rec = 1
+	   tree_size = 0
+ 20	   IF (next(rec) .GT. rec) THEN
+	      size = next(rec) - rec
+	      IF (.NOT.is_done(rec) .AND. (size.GT.tree_size)) THEN
+	         tree_size = size
+	         tree_rec1 = rec    ! starting record of the largest tree
+	      ENDIF
+	      rec = next(rec)
+	      GOTO 20
+	   ENDIF
+
+* decide if this tree has already been displayed
+	   rec = 1
+ 30	   IF (next(rec) .GT. rec) THEN
+	      IF (is_done(rec)) THEN
+	         DO 50 i = rec, next(rec)-1
+	            valid_var = flag(i) .EQ. df_valid_var
+     .		          .OR.  flag(i) .EQ. df_valid_aux_var
+	            IF (.NOT.valid_var) GOTO 50
+!                    dup = flag        (i) .EQ. flag        (tree_rec1)   ! unneeded test??
+                    dup = 
+     .                    dataset     (i) .EQ. dataset     (tree_rec1)
+     .              .AND. var_or_start(i) .EQ. var_or_start(tree_rec1)
+     .              .AND. cat_or_end  (i) .EQ. cat_or_end  (tree_rec1)
+	            IF (dup) GOTO 900    ! already displayed as part of a previous tree
+ 50		 CONTINUE
+	      ENDIF
+	      rec = next(rec)
+	      GOTO 30
+	   ENDIF
+
+* display one tree, record by record
+	   DO 500 rec = tree_rec1, tree_rec1+tree_size-1
+
+* initialize this record
+	      tree_level = level(rec)
+	      var  = var_or_start(rec)
+	      cat  = cat_or_end  (rec)
+	      dset = dataset(rec)
+	      uvar = parent_uv(rec)
+	      item = uv_item(rec)
+	      line_buff = ' '
+	      blanks = 2 * (tree_level-1)
+
+* prepare the dataset name if it needs to be documented
+	      tell_dset = dset .NE. pdset_irrelevant
+     .	            .AND. dset .NE. dependency_dflt_dset
+	      IF ( tell_dset ) THEN
+	         dsetname = '[d='
+	         dsetname(4:) = GET_UNIQUE_DSET_NAME( dset )
+	         dnamlen = TM_LENSTR1(dsetname)
+	         dsetname(dnamlen:dnamlen) = ']'
+	      ENDIF
+
+* document this variable
+	      IF ( flag(rec) .EQ. df_unknown_var ) THEN
+	         istart = uvar_item_start(item, uvar)
+	         iend   = uvar_item_end  (item, uvar)
+	         line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	         llen = (iend-istart+1) + blanks
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) =
+     .			' ??                           <== UNKNOWN VARIABLE ******'
+	      ELSEIF ( flag(rec) .EQ. df_unknown_dataset ) THEN
+	         istart = uvar_item_start(item, uvar)
+	         iend   = uvar_item_end  (item, uvar)
+	         line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	         llen = (iend-istart+1) + blanks
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = 
+     .			' ??                           <== UNKNOWN DATASET ******'
+	      ELSEIF ( flag(rec) .EQ. df_unknown_grid ) THEN
+	         istart = uvar_item_start(item, uvar)
+	         iend   = uvar_item_end  (item, uvar)
+	         line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	         llen = (iend-istart+1) + blanks
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = '   (unknown grid)'
+	      ELSEIF ( flag(rec) .EQ. df_syntax_error ) THEN
+	         istart = uvar_item_start(item, uvar)
+	         iend   = uvar_item_end  (item, uvar)
+	         line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	         llen = (iend-istart+1) + blanks
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = '   *** WARNING: ERROR IN DEFINITION'
+	      ELSEIF ( flag(rec) .EQ. df_unknown_auxvar ) THEN
+	         istart = uvar_item_start(item, uvar) + var - 1
+	         iend   = uvar_item_start(item, uvar) + cat - 1
+	         line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	         llen = (iend-istart+1) + blanks
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = '   (unknown auxiliary variable)'
+	      ELSEIF (flag(rec) .EQ. df_defined_earlier) THEN
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = ' =  (defined above)'
+	      ELSEIF (flag(rec) .EQ. df_recursion_error) THEN
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = ' =   *** WARNING: RECURSIVE DEFINITION.  See above'
+	      ELSEIF (cat .EQ. cat_user_var) THEN
+	         IF (.NOT.dependency_tree_show_uvars) GOTO 500
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = ' = ' //uvar_text(var)
+	      ELSEIF (cat .EQ. cat_aggregate_var ) THEN
+	         IF (.NOT. dependency_tree_show_uvars) GOTO 500
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = '   (aggregate variable)'
+	      ELSEIF (cat .EQ. cat_file_var ) THEN
+	         IF (.NOT.dependency_tree_show_fvars) GOTO 500
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	      ELSE
+* ... does this ever happen?
+	         line_buff(blanks+1:) = VAR_CODE(cat, var)
+	         llen = TM_LENSTR1(line_buff)
+	         IF (tell_dset) THEN
+	            line_buff(llen+1:) = dsetname
+	            llen = llen + dnamlen
+	         ENDIF
+	         line_buff(llen+1:) = ' = ' //VAR_TITLE( cat )
+	      ENDIF
+   
+* name the default dataset just once
+	IF (state_dflt_dataset) THEN
+	   dsetname = GET_UNIQUE_DSET_NAME( dependency_dflt_dset )
+	   CALL SPLIT_LIST( pttmode_explct, show_lun, 
+     .		'   in default dataset '//dsetname, 0)
+	   state_dflt_dataset = .FALSE.
+	ENDIF
+
+* display a line of the tree
+	      CALL SPLIT_LIST( pttmode_explct, show_lun, 
+     .	      	'   '//line_buff, 0)
+
+ 500	   CONTINUE
+
+
+! signal that this tree has been displayed
+ 900	   is_done(tree_rec1) = .TRUE.
+
+ 1000	CONTINUE
+	RETURN
+
+**************************
+* special display mode to show only a simple list of unique file variables
+ 2000	DO 2100 rec = 1, dependency_nrows
+
+	   var  = var_or_start(rec)
+	   cat  = cat_or_end  (rec)
+	   dset = dataset(rec)
+	   uvar = parent_uv(rec)
+	   item = uv_item(rec)
+	   valid_var = flag(rec) .EQ. df_valid_var 
+     .	          .OR. flag(rec) .EQ. df_valid_aux_var 
+
+* format one record
+	   IF     ( valid_var
+     .	 .AND.      cat       .EQ. cat_user_var       ) THEN
+	      GOTO 2100					! skip user variables
+	   ELSEIF ( flag(rec) .EQ. df_defined_earlier
+     .	  .OR.      flag(rec) .EQ. df_recursion_error ) THEN
+	      GOTO 2100					! skip irrelevant flags
+	   ELSEIF ( valid_var
+     .	 .AND.      cat       .EQ. cat_file_var       ) THEN
+* valid file variable
+* ... if this record has already been displayed do not do so again
+	      DO 2050 i = 1, rec-1
+                 dup = (flag(rec) .EQ. df_valid_var 
+     .	           .OR. flag(rec) .EQ. df_valid_aux_var )
+     .           .AND. dataset     (i) .EQ. dataset     (rec)
+     .           .AND. var_or_start(i) .EQ. var_or_start(rec)
+     .           .AND. cat_or_end  (i) .EQ. cat_or_end  (rec)
+	         IF (dup) GOTO 2100
+ 2050	      CONTINUE
+	      line_buff = VAR_CODE(cat,var)		! valid file variable
+	      llen = TM_LENSTR1(line_buff)
+	      dsetname = '[d='
+	      dsetname(4:) = GET_UNIQUE_DSET_NAME( dset )
+	      dnamlen = TM_LENSTR1(dsetname) + 1
+	      dsetname(dnamlen:dnamlen) = ']'
+	      line_buff = line_buff(:llen)//dsetname
+	   ELSEIF ( flag(rec) .EQ. df_unknown_var ) THEN
+	      istart = uvar_item_start(item, uvar)
+	      iend   = uvar_item_end  (item, uvar)
+	      line_buff = uvar_text(uvar)(istart:iend)//'  (unknown variable)'
+	   ELSEIF ( flag(rec) .EQ. df_unknown_dataset ) THEN
+	      istart = uvar_item_start(item, uvar)
+	      iend   = uvar_item_end  (item, uvar)
+	      line_buff = uvar_text(uvar)(istart:iend)//'  (unknown dataset)'
+	   ELSEIF ( flag(rec) .EQ. df_unknown_grid ) THEN
+	      istart = uvar_item_start(item, uvar)
+	      iend   = uvar_item_end  (item, uvar)
+	      line_buff = uvar_text(uvar)(istart:iend)//'  (unknown grid)'
+	   ELSEIF ( flag(rec) .EQ. df_syntax_error ) THEN
+	      istart = uvar_item_start(item, uvar)
+	      iend   = uvar_item_end  (item, uvar)
+	      line_buff = uvar_text(uvar)(istart:iend)//'   *** WARNING: SYNTAX ERROR'
+	   ELSEIF ( flag(rec) .EQ. df_unknown_auxvar ) THEN
+	      istart = uvar_item_start(item, uvar) + var - 1
+	      iend   = uvar_item_start(item, uvar) + cat - 1
+	      line_buff = uvar_text(uvar)(istart:iend)//'  (unknown auxiliary variable)'
+	   ENDIF
+
+	   CALL SPLIT_LIST( pttmode_explct, show_lun, '   '//line_buff, 0)
+
+
+ 2100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/extract_dp_line.F b/fer/utl/extract_dp_line.F
new file mode 100644
index 0000000..aa41198
--- /dev/null
+++ b/fer/utl/extract_dp_line.F
@@ -0,0 +1,78 @@
+	SUBROUTINE EXTRACT_DP_LINE( cx, grid_data, dp_line, idim, nout )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* extract a single line of data from a memory variable grid along axis idim
+* no error checking is done
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  9/20/89 - 4D symmetrical
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mv, idim, nout
+	REAL grid_data( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif )
+	REAL*8	dp_line(nout)
+
+* internal variable declarations:
+	INTEGER	iout, i, j, k, l, m, n
+
+* extract the line
+	iout = 0
+	DO 200 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	DO 200 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	DO 200 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	DO 200 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	DO 200 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	DO 200 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	   iout = iout + 1
+	   dp_line( iout ) = grid_data( i,j,k,l,m,n )
+
+ 200	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/extract_dp_line2.F b/fer/utl/extract_dp_line2.F
new file mode 100644
index 0000000..a20d9d9
--- /dev/null
+++ b/fer/utl/extract_dp_line2.F
@@ -0,0 +1,78 @@
+	SUBROUTINE EXTRACT_DP_LINE2( cx, grid_data, dp_line, idim, nout )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* extract a single line of data from memory variable #2, grid along axis idim
+* no error checking is done
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* from extract_dp_line.F
+*
+* V570 - reading 2nd line for bounds on a DEFINE AXIS/BOUNDS
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xmem_subsc.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mv, idim, nout
+	REAL    grid_data( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m1loe:m1hie,m1lof:m1hif )
+	REAL*8	dp_line(nout)
+
+* internal variable declarations:
+	INTEGER	iout, i, j, k, l, m, n
+
+* extract the line
+	iout = 0
+	DO 200 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	DO 200 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	DO 200 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	DO 200 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	DO 200 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	DO 200 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	   iout = iout + 1
+	   dp_line( iout ) = grid_data( i,j,k,l,m,n )
+
+ 200	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/extract_line.F b/fer/utl/extract_line.F
new file mode 100644
index 0000000..3bf9f9b
--- /dev/null
+++ b/fer/utl/extract_line.F
@@ -0,0 +1,98 @@
+	SUBROUTINE EXTRACT_LINE( cx, src, msrc, line, idim, ndim, nout, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* extract a single line of data from a memory variable grid.  Determine
+* which line to extract from the given context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/8/87
+* V200:  5/19/89 - 4D symmetrical
+*	10/16/89 - modified array declarations using call to *_SUB
+*	  5/9/90 - allow a multi-dimensional region as a line for PLOT/VS
+*	         - return number of dims
+* v580 *acm* 11/04 Fix bug 1009. Distinguish between axes which really have one 
+*                  point, and those for which the hi and lo subscripts on the axes 
+*                  are undefined. When undefined return zero from CX_DIM_LEN_ZERO in
+*                  GET_CX_DIMS_ZERO. These axes are listed last in the heirarchy in 
+*                  array plot_axis().  This means we can plot a variable with just 
+*                  one point in their range (if /HLIMITS or /VLIMITS are used to give 
+*                  PPLUS a range to draw).
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, msrc, idim, ndim, n, nout, status
+	REAL    src(*), line(*)
+
+* internal variable declarations:
+	INTEGER	CGRID_SIZE, dim(nferdims)
+
+* determine 6D shape of context
+	CALL GET_CX_DIMS_ZERO( cx, ndim, dim )
+
+* have we been given a reasonable context ?
+! eliminated 5/90
+!	IF ( ndim .NE. 1 ) CALL ERRMSG
+!     .		( ferr_dim_underspec, status, 'can only PLOT lines', *5000 )
+
+* determine the axis orientation and length
+	idim = dim(1)
+	nout = CGRID_SIZE( cx )
+
+* extract the line
+	CALL EXTRACT_LINE_SUB(	cx, line, src,
+     .				mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				mr_lo_s6(msrc), mr_hi_s6(msrc)  )
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+! 5000	RETURN
+	END
diff --git a/fer/utl/extract_line_fast.F b/fer/utl/extract_line_fast.F
new file mode 100644
index 0000000..acc3079
--- /dev/null
+++ b/fer/utl/extract_line_fast.F
@@ -0,0 +1,94 @@
+	SUBROUTINE EXTRACT_LINE_FAST( axis, block, bad_flag, i, j, l, m, n,
+     .		cxloz, cxhiz,
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		zline, klo, khi )
+
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Extract a single line of data from a memory variable grid.
+* Identify contiguously valid data region and report in klo, khi
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V690:  12/13 *sh* derived from EXTRACT_Z_LINE
+
+* calling argument declarations:
+	INTEGER axis,
+     .		slox, shix, sloy, shiy, sloz, shiz, slot, shit,
+     .		sloe, shie, slof, shif, i, j, l, m, n, 
+     .		klo, khi, cxloz, cxhiz
+	REAL    bad_flag,
+     .		block( slox:shix,sloy:shiy,sloz:shiz,
+     .		       slot:shit,sloe:shie,slof:shif ),
+     .		zline(cxloz:cxhiz)
+
+* internal variable declarations:
+	LOGICAL	searching_for_valid
+	INTEGER k
+
+* initialize
+	searching_for_valid = .TRUE.
+
+* initialize
+	klo = 0		! if unchanged at end signals no valid data found
+	khi = 0
+
+* extract the line
+	DO 100 k = cxloz, cxhiz
+ 100	zline(k) = block(i,j,k,l,m,n)
+
+* find the start and end of valid data
+	DO 200 k = cxloz, cxhiz
+
+* ... skip invalid values at start of line
+	   IF ( searching_for_valid ) THEN
+	      IF (zline(k) .EQ. bad_flag) GOTO 200
+	      searching_for_valid = .FALSE.
+	      klo = k
+* ... terminate if invalid point encountered after valid points
+	   ELSEIF ( zline(k) .EQ. bad_flag ) THEN
+	      khi = k-1
+	      GOTO 300
+	   ENDIF
+
+ 200	CONTINUE
+	khi = cxhiz
+
+* successful completion
+ 300	RETURN
+	END
diff --git a/fer/utl/extract_line_sub.F b/fer/utl/extract_line_sub.F
new file mode 100644
index 0000000..b781a9b
--- /dev/null
+++ b/fer/utl/extract_line_sub.F
@@ -0,0 +1,78 @@
+	SUBROUTINE EXTRACT_LINE_SUB( cx, line,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* extract a single line of data from a memory variable grid.  Determine
+* which line to extract from the given context
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  10/16/89 - based on EXTRACT_LINE
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		line(*)
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, iout
+
+* extract the line
+	iout = 0
+	DO 200 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	DO 200 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	DO 200 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	DO 200 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	DO 200 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	DO 200 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	   iout = iout + 1
+	   line( iout ) = src( i,j,k,l,m,n )
+
+ 200	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/extract_z_line.F b/fer/utl/extract_z_line.F
new file mode 100644
index 0000000..f07608f
--- /dev/null
+++ b/fer/utl/extract_z_line.F
@@ -0,0 +1,97 @@
+	SUBROUTINE EXTRACT_Z_LINE( block, bad_flag, i, j, l, m, n,
+     .		cxloz, cxhiz,
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		zline, klo, khi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Extract a single Z line of data from a memory variable grid.
+* Identify contiguously valid data region and report in klo, khi
+* Return values in buffer that always starts with the first valid value
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450:  11/12/97
+* V491:  16/4/98 - added cx_lo/hiz to limit extraction by context limits
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER slox, shix, sloy, shiy, sloz, shiz, slot, shit,
+     .		sloe, shie, slof, shif, i, j, l, m, n, 
+     .		klo, khi, cxloz, cxhiz
+	REAL    bad_flag,
+     .		block( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		zline(shiz-sloz+1)
+
+* internal variable declarations:
+	LOGICAL	searching_for_valid
+	INTEGER k
+
+* initialize
+	searching_for_valid = .TRUE.
+
+* initialize
+	klo = 0		! if unchanged at end signals no valid data found
+	khi = 0
+
+* extract the line
+	DO 100 k = cxloz, cxhiz
+
+* ... skip invalid values at start of line
+	   IF ( searching_for_valid ) THEN
+	      searching_for_valid = block(i,j,k,l,m,n) .EQ. bad_flag
+	      IF (searching_for_valid) GOTO 100
+	      klo = k
+* ... terminate if invalid point encountered after valid points
+	   ELSEIF ( block(i,j,k,l,m,n) .EQ. bad_flag ) THEN
+	      khi = k-1
+	      GOTO 300
+	   ENDIF
+
+* ... transfer point to output
+	   zline(k-klo+1) = block(i,j,k,l,m,n)
+
+ 100	CONTINUE
+	khi = cxhiz
+
+* successful completion
+* reference returned limits to 1, so that klo=0 reliably signals no data
+ 300	klo = klo - cxloz + 1
+	khi = khi - cxloz + 1
+	RETURN
+	END
diff --git a/fer/utl/field_minmax.F b/fer/utl/field_minmax.F
new file mode 100644
index 0000000..e11a9ee
--- /dev/null
+++ b/fer/utl/field_minmax.F
@@ -0,0 +1,65 @@
+	SUBROUTINE FIELD_MINMAX( arr, mr, cx, lo, hi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the max and min of a memory within context bounds array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER mr, cx
+	REAL    arr(*), lo, hi
+
+	CALL FIELD_MINMAX_SUB(  arr, cx,
+     .				mr_lo_s1(mr), mr_hi_s1(mr),
+     .				mr_lo_s2(mr), mr_hi_s2(mr),
+     .				mr_lo_s3(mr), mr_hi_s3(mr),
+     .				mr_lo_s4(mr), mr_hi_s4(mr),
+     .				mr_lo_s5(mr), mr_hi_s5(mr),
+     .				mr_lo_s6(mr), mr_hi_s6(mr),
+     .				mr_bad_data(mr), lo, hi )
+
+
+	RETURN
+	END 
diff --git a/fer/utl/field_minmax_sub.F b/fer/utl/field_minmax_sub.F
new file mode 100644
index 0000000..f7ee40e
--- /dev/null
+++ b/fer/utl/field_minmax_sub.F
@@ -0,0 +1,82 @@
+	SUBROUTINE FIELD_MINMAX_SUB ( arr, cx,
+     .		slox, shix, sloy, shiy, sloz, shiz, slot, shit,
+     .		sloe, shie, slof, shif, bad, lo, hi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* support routine for FIELD_MINMAX with unsubscripted limits
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 3/97
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER cx, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif
+	REAL    arr( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		bad, lo, hi
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+* initialize
+	hi = arbitrary_small_val4
+	lo = arbitrary_large_val4
+
+	DO 100 n = cx_lo_s6(cx), cx_hi_s6(cx)
+	DO 100 m = cx_lo_s5(cx), cx_hi_s5(cx)
+	DO 100 l = cx_lo_s4(cx), cx_hi_s4(cx)
+	DO 100 k = cx_lo_s3(cx), cx_hi_s3(cx)
+	DO 100 j = cx_lo_s2(cx), cx_hi_s2(cx)
+	DO 100 i = cx_lo_s1(cx), cx_hi_s1(cx)
+
+	   IF (arr(i,j,k,l,m,n) .NE. bad) THEN
+	      IF (arr(i,j,k,l,m,n) .LT. lo) lo = arr(i,j,k,l,m,n)
+	      IF (arr(i,j,k,l,m,n) .GT. hi) hi = arr(i,j,k,l,m,n)
+	   ENDIF
+	   
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/gcf_arg_type.F b/fer/utl/gcf_arg_type.F
new file mode 100644
index 0000000..54bd874
--- /dev/null
+++ b/fer/utl/gcf_arg_type.F
@@ -0,0 +1,33 @@
+	INTEGER FUNCTION GCF_ARG_TYPE( gcfcn, iarg )
+
+* return the argument type required for this argument
+
+* V500:  1/99
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		gcfcn, iarg
+
+* internal variable declarations
+	INTEGER		iptr
+	INTEGER efcn_get_arg_type
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'grid_chg_fcns.parm'   ! for place-holder behavior
+	include 'xgrid_chg_fcns.cmn'
+
+
+	IF ( gcfcn .GT. gfcn_num_internal ) THEN
+* ... external function
+	   GCF_ARG_TYPE = efcn_get_arg_type(gcfcn, iarg)
+
+	ELSE
+* ... internal grid-changing function
+	   iptr = gfcn_arg_ptr(gcfcn)
+	   GCF_ARG_TYPE = gfcn_arg_type(iptr+iarg-1)
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/gcf_child_var_name.F b/fer/utl/gcf_child_var_name.F
new file mode 100644
index 0000000..6748d74
--- /dev/null
+++ b/fer/utl/gcf_child_var_name.F
@@ -0,0 +1,75 @@
+	SUBROUTINE GCF_CHILD_VAR_NAME( parent_uvar, char1, name )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the (hidden) name of a child variable constructed from
+* the number of its parent variable and the start character of the
+* grid-changing reference within the parent definition
+
+* For example, in the definition
+*     yes? LET var = 2 * GC_FUNCT( a,b,c )
+* the string "GC_FUNCT( a,b,c )" would become a child variable with a name
+* based on the uvar number of "var" and a start char of 5 (following "2 * ")
+
+* V450: 12/96
+*        7/7/97 - revert to one name in all cases -- use DIAGNOSTIC_OUT
+*                 to make diagnostic output more readable
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		parent_uvar, char1
+	CHARACTER	name*(*)
+
+* internal variable declarations
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+
+* sanity check
+	IF ( LEN(name) .LT. 11 ) THEN
+	   STOP 'GCF_CHILD_VAR_NAME'
+	ENDIF
+
+!	IF ( char1.LT.100 .AND. parent_uvar.LT.100) THEN
+!	   WRITE (name, 3000) char1, parent_uvar
+! 3000	   FORMAT ('(C',I2.2,',V',I2.2,')')	! e.g. "(C12,V02)"
+!	ELSE
+	   WRITE (name, 3100) char1, parent_uvar
+ 3100	   FORMAT ('(C',I3.3,',V',I3.3,')')	! e.g. "(C112,V002)"
+!	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/gcf_find_fcn.F b/fer/utl/gcf_find_fcn.F
new file mode 100644
index 0000000..64749c5
--- /dev/null
+++ b/fer/utl/gcf_find_fcn.F
@@ -0,0 +1,106 @@
+	INTEGER FUNCTION GCF_FIND_FCN( name )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the ID number of a grid changing function based on its name 
+
+* V450: 12/96
+*       97.07.16 *jc* adding code to allow call to efcn_get_id()
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	CHARACTER name*(*)
+
+* internal variable declarations
+	INTEGER         STR_MATCH, llen, TM_LENSTR1
+	INTEGER efcn_scan, efcn_get_id, efcn_already_have_internals
+
+* internal parameter declarations:
+        INTEGER      slen
+        PARAMETER  ( slen = 40 )
+ 
+#ifdef sun
+        BYTE      fhol(slen)    ! c-type Hollerith string buffer
+#else
+        INTEGER*1 fhol(slen)    ! c-type Hollerith string buffer
+#endif
+
+ 
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xgrid_chg_fcns.cmn'
+
+* check the internal grid changing functions first
+
+	GCF_FIND_FCN = STR_MATCH ( name,
+     .                               gfcn_name, gfcn_num_internal )
+
+        IF ( GCF_FIND_FCN .NE. atom_not_found ) THEN
+	   RETURN
+	ENDIF
+
+
+* no match. so check external functions
+	IF ( efcn_scan(gfcn_num_internal) .EQ. 0 ) THEN
+
+	   GCF_FIND_FCN = unspecified_int4
+	   RETURN
+
+	ELSE
+
+*       true string length
+*       convert to a null-terminated Hollerith
+*       call the external functions library routine to see if it is external
+
+	   llen = TM_LENSTR1( name )
+	   CALL TM_FTOC_STRNG( name(:llen), fhol, slen )
+	   GCF_FIND_FCN = efcn_get_id( fhol )
+
+	   IF (GCF_FIND_FCN .EQ. ATOM_NOT_FOUND ) THEN
+	      GCF_FIND_FCN = unspecified_int4
+	   ELSE
+*       chances are we're going to want to do something with this function
+	      if ( efcn_already_have_internals(gcf_find_fcn) .eq. 0 ) then
+		 call efcn_gather_info(gcf_find_fcn)
+	      endif
+	   ENDIF
+
+	ENDIF	   
+	
+	RETURN
+
+	END
+ 
diff --git a/fer/utl/gcf_get_arg_lims.F b/fer/utl/gcf_get_arg_lims.F
new file mode 100644
index 0000000..3b790ec
--- /dev/null
+++ b/fer/utl/gcf_get_arg_lims.F
@@ -0,0 +1,145 @@
+	SUBROUTINE GCF_GET_ARG_LIMS (gcfcn, arg, cx_arg, res_grd,
+     .				     lo_off,  hi_off, action, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return guidance for the passing of context information between 
+* argument "arg" and the result (downstream) or default (upstream) context.
+* This guidance is determined primarily from the user-specified parameters of
+* the GC function (as returned by GCF_GET_ARG_PARMS), but we also watch
+* here for the possibility that a dynamically imposed
+* axis of the result might happen to match the axis of argument "arg".
+* If so, we do pass the context information (normally no context information
+* is passed for imposed axes).
+
+* For example, in
+*	LET a = RESHAPE( temp4d, out_grid )
+* the result grid may share no axes in common with temp4d or (as is commonly
+* the case) the result grid may differ in T and Z but match in X and Y. If
+* this is the case then we do want to pass context information both upstream
+* and down between the result and temp4d (just as if the axis parameter of
+* the GC function  had been pgc_axis_implied_by_args and the "arg" had been
+* gfcn_axis_implied_from = .TRUE. Concrete examples are
+*	LIST a[x=180:160w,y=0:10n,l=1:100]
+* which should pass the XY limits upstream from "a" to "temp4d" when component
+* data is requested by IS_ALGEBRA. And
+*	LET a2 = RESHAPE( temp4d[x=180:160w,y=0:10n], out_grid )
+*	LIST a2[l=1:100]
+* which should pass the XY limits of "temp4d" downstream to the result "a".
+
+* V450: 2/97
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+	include 'xgrid_chg_fcns.cmn'
+	include 'xfr_grid.cmn'       ! w/ mgrid_abstract
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	INTEGER	gcfcn, arg, cx_arg, res_grd,
+     .		lo_off(*),  hi_off(*), action(*), status
+
+* internal variable declarations
+	LOGICAL implied_lims(nferdims)
+	INTEGER	CGRID_AXIS, TM_LENSTR1,
+     .		idim, res_ax, axis_source(nferdims), nlen, mabstract
+	CHARACTER GCF_NAME*40, name*40
+
+* get the axis number for the abstract axis
+	mabstract = grid_line( x_dim, mgrid_abstract )
+
+* get the constant parameters for the GC function
+
+c	CALL GCF_GET_AXIS_SRCS( gcfcn, 1, axis_source )
+	CALL GCF_GET_AXIS_SRCS( gcfcn, arg, axis_source )
+
+* get the constant parameters for this argument of the function
+	CALL GCF_GET_ARG_PARMS
+     .			(gcfcn, arg, lo_off,  hi_off, implied_lims)
+
+* loop through the axes
+	DO 500 idim = 1,nferdims
+
+	   res_ax  = grid_line(idim,res_grd)
+
+	   IF (    axis_source(idim).EQ.pgc_ignore_axis) THEN
+	      action(idim) = pset_to_unspec
+	   ELSEIF (axis_source(idim).EQ.pgc_impose_axis) THEN
+
+	      IF ( res_ax.EQ.mnormal
+     .	      .OR. res_ax.EQ.mabstract ) THEN
+	         action(idim) = pset_to_unspec
+
+* ... We have a pgc_axis_supplied_herein axis (special axis imposed by the fcn)
+	      ELSE
+
+*     If the axis of the arg and the result don't match, don't pass context
+	         IF ( res_ax .NE. CGRID_AXIS(idim,cx_arg) ) THEN
+	            action(idim) = pset_to_unspec
+
+	         ELSEIF ( implied_lims(idim) ) THEN
+	            action(idim) = ppass_along
+
+	         ELSE
+	            action(idim) = pset_to_unspec
+
+	         ENDIF
+	      ENDIF
+
+	   ELSEIF ( axis_source(idim).EQ.pgc_merge_axis) THEN
+	      action(idim) = ppass_along
+
+	   ELSE
+	      name = GCF_NAME( gcfcn )
+	      nlen = TM_LENSTR1( name )
+	      CALL ERRMSG( ferr_internal, status,
+     .			'function '//name(:nlen)
+     .			//' has corrupted specs on axis '
+     .			//ww_dim_name(idim), *5000 )
+	   ENDIF
+
+ 500	CONTINUE
+
+	RETURN
+
+* error exits
+ 5000	RETURN
+	END
diff --git a/fer/utl/gcf_get_arg_parms.F b/fer/utl/gcf_get_arg_parms.F
new file mode 100644
index 0000000..066eaf6
--- /dev/null
+++ b/fer/utl/gcf_get_arg_parms.F
@@ -0,0 +1,99 @@
+	SUBROUTINE GCF_GET_ARG_PARMS
+     .			(gcfcn, iarg, lo_off,  hi_off, implied_lims)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return parameters about the grid changing function, gcfcn, on how the
+* limits of the argument, iarg, should be determined relative to the
+* default limits of the grid changing variable
+
+* For example, in
+*	LET a = GCFCN( b )
+*	LIST a[i=1:5]
+* we need to know if the limits i=1:5 should be passed along to b and if they
+* should be increased or decreased by offsets supplied by the function.
+
+* V450: 1/97
+*       97.07.16 *jc* adding code to query external functions
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+
+	include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	include 'ferret.parm'
+	include 'xgrid_chg_fcns.cmn'
+
+* calling argument declarations
+	LOGICAL	implied_lims(nferdims)
+	INTEGER	gcfcn, iarg, lo_off(nferdims),  hi_off(nferdims)
+
+* internal variable declarations
+	INTEGER	idim, iptr, ip
+
+* check the internal grid changing functions first
+        IF (gcfcn .LT. 0 ) THEN
+
+           STOP 'gcf_get_arg_parms'
+
+        ELSEIF (gcfcn .LE. gfcn_num_internal) THEN
+
+* is this a valid argument number?
+	   IF (iarg .LT. 1
+     .    .OR. iarg .GT. gfcn_num_reqd_args(gcfcn) )
+     .					STOP 'gcf_cx_merge_arg_1'
+
+* determine location of information in argument arrays
+	   iptr = gfcn_arg_ptr(gcfcn) + iarg - 1
+
+* return information about argument iarg
+
+	   DO 100 idim = 1, nferdims
+
+	      lo_off(idim) = gfcn_arg_extend_lo(idim, iptr)
+	      hi_off(idim) = gfcn_arg_extend_hi(idim, iptr)
+	      implied_lims(idim) = gfcn_axis_implied_from(idim, iptr)
+ 100	   CONTINUE
+
+	ELSE
+
+	   call efcn_get_axis_extend_lo(gcfcn, iarg, lo_off)
+	   call efcn_get_axis_extend_hi(gcfcn, iarg, hi_off)
+	   call efcn_get_axis_implied_from(gcfcn, iarg, implied_lims)
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/gcf_get_axis_srcs.F b/fer/utl/gcf_get_axis_srcs.F
new file mode 100644
index 0000000..119b2d9
--- /dev/null
+++ b/fer/utl/gcf_get_axis_srcs.F
@@ -0,0 +1,128 @@
+	SUBROUTINE GCF_GET_AXIS_SRCS(ifcn, iarg, axis_source)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return instructions to Ferret on how this particular argument will
+* get merged into the joint context of a grid-changing function
+
+* V450: 1/97
+*	7/97 - slight reorg for external functions
+*   8/97 - type mismatch on axis_implied_from caught by 
+*              linux/aix compilers *kob*
+* V63  *acm* 10/09 Changes for gfortran build
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+
+	include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	include 'ferret.parm'
+	include 'xgrid_chg_fcns.cmn'
+	include 'xfr_grid.cmn'	! w/ mgrid_abstract
+
+* calling argument declarations
+	INTEGER	ifcn, iarg, axis_source(nferdims)
+
+* internal variable declarations
+	INTEGER	idim, iptr1,
+     .		axis_will_be(nferdims)
+	INTEGER efcn_get_num_reqd_args
+	LOGICAL axis_implied_from(nferdims)
+
+* initialize
+        IF (ifcn .LT. 0 .OR. iarg .LT. 1) THEN
+
+           STOP 'gcf_get_axis_srcs'
+
+        ELSEIF (ifcn .LE. gfcn_num_internal) THEN
+
+* check the internal grid changing functions first
+* is this a valid argument number?
+	   IF (iarg .GT. gfcn_num_reqd_args(ifcn) )
+     .	       STOP 'gcf_get_axis_srcs'
+
+* store info in local arrays to blur distinction between internal and external
+* ... determine pointer to argument information
+	   iptr1 = gfcn_arg_ptr(ifcn)
+	   DO 10 idim = 1, nferdims
+	      axis_will_be(idim) = gfcn_axis_will_be(idim,ifcn)
+	      axis_implied_from(idim) =
+     .			gfcn_axis_implied_from(idim,iptr1+iarg-1)
+ 10	   CONTINUE
+
+	ELSE
+
+	   IF (iarg .GT. efcn_get_num_reqd_args(ifcn) )
+     .	       STOP 'gcf_get_axis_srcs'
+
+	   call efcn_get_axis_will_be(ifcn, axis_will_be)
+	   call efcn_get_axis_implied_from(ifcn, iarg, axis_implied_from)
+
+	ENDIF
+
+* return information about argument iarg
+*    axis_source may be returned as
+*	pgc_impose_axis
+*	pgc_merge_axis
+*    or	pgc_ignore_axis
+
+	DO 100 idim = 1, nferdims
+
+	   IF (axis_will_be(idim) .EQ. pgc_axis_is_abstract)	THEN
+	      axis_source(idim) = pgc_impose_axis
+
+	   ELSEIF (axis_will_be(idim) .EQ. pgc_axis_is_normal) THEN
+	      axis_source(idim) = pgc_impose_axis
+
+	   ELSEIF (axis_will_be(idim) .EQ. pgc_axis_supplied_herein) THEN
+	      axis_source(idim) = pgc_impose_axis
+
+	   ELSEIF (axis_will_be(idim) .EQ. pgc_axis_implied_by_args) THEN
+
+	      IF (axis_implied_from(idim)) THEN
+	         axis_source(idim) = pgc_merge_axis
+	      ELSE
+	         axis_source(idim) = pgc_ignore_axis
+	      ENDIF
+
+	   ELSE
+	      STOP 'Invalid axis merging information in GC func'
+
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/gcf_get_imposed_axes.F b/fer/utl/gcf_get_imposed_axes.F
new file mode 100644
index 0000000..bab87a7
--- /dev/null
+++ b/fer/utl/gcf_get_imposed_axes.F
@@ -0,0 +1,247 @@
+      SUBROUTINE GCF_GET_IMPOSED_AXES( gcfcn, cx_base, axes, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* supply the axes for those axes of the grid changing function which
+* are "imposed" by the function
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_IMPOSE_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+* V450: 1/97
+*	7/97 - slight reorg for external functions
+* V491: 1/98 - make test function TIMES2 impose its T axis
+*       2/99 changed UNRAVEL to XUNRAVEL. Added YUNRAVEL, ZUNRAVEL, TUNRAVEL
+* V500: 7/99 *sh* - use of "grid_line(1,mgrid_abstract)" changed to
+*               "grid_line(1,mgrid_xabstract)" since mgrid_abstract changes
+*               with SET GRID
+* V530: 10/00 *sh* - bug fix: need to pass an *array* of argument contexts
+*       to the C routine efcn_get_custom_axes
+*                  - changed EFCN_GET_CUSTOM_AXES so it returns a status
+* V541: 2/02 *sh* - support for modulo length
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+	include 'EF_Util.parm'
+	include 'xgrid_chg_fcns.cmn'
+	include 'xtext_info.cmn'	! w/ ww_dim_name
+	include 'xfr_grid.cmn'       ! w/ mgrid_abstract
+	include 'xcontext.cmn'       ! for TIMES2
+	include 'xvariables.cmn'     ! for TIMES2
+
+* calling argument declarations
+	INTEGER	gcfcn, cx_base, axes(*), status
+
+* internal variable declarations
+	LOGICAL known_limits
+	INTEGER	CGRID_AXIS, TM_LENSTR1, CX_DIM_LEN, CAXIS_LEN,
+     .          EFCN_GET_NUM_REQD_ARGS,
+     .		cx, i, idim, axis_will_be(nferdims), n, grid, modulo
+	REAL*8	TM_WORLD, dlo, dhi, del
+	CHARACTER*40 GCF_NAME, buff, unit
+        INTEGER EF_cx_list(EF_MAX_ARGS), narg
+
+* Upon entry to this routine the context stack should be organized as
+*	 	  default context (for this uvar)
+*	 big_cx:  the merged grid context
+* -->	cx_base:  argument N context
+*		  argument N-1 context
+*		  ...
+*		  argument 1 context
+
+* initialize
+* ... consolidate info about function into local array to blur distinctions
+*     between internal and external functions
+	IF ( gcfcn .LE. gfcn_num_internal ) THEN
+	   DO 10 idim = 1, nferdims
+ 10	   axis_will_be(idim) = gfcn_axis_will_be(idim,gcfcn)
+	ELSE
+	   call efcn_get_axis_will_be(gcfcn, axis_will_be)
+	ENDIF
+
+* process what axes we can: either "merged" (determined by grid stack logic),
+*	NORMAL, and ABSTRACT ... but not IMPOSED ("supplied herein")
+	DO 100 idim = 1, nferdims
+	   IF (axis_will_be(idim) .EQ. pgc_axis_is_abstract) THEN
+	      axes(idim) = grid_line(1,mgrid_xabstract)         ! 7/99 mod
+	   ELSEIF (axis_will_be(idim) .EQ. pgc_axis_is_normal) THEN
+	      axes(idim) = mnormal
+	   ELSEIF (axis_will_be(idim) .EQ. pgc_axis_implied_by_args) 
+     .             THEN
+	      axes(idim) = unspecified_int4   ! ... determined elsewhere
+           ELSEIF (axis_will_be(idim) .EQ. pgc_axis_supplied_herein) 
+     .             THEN
+* nothing to do here
+	   ELSE	      
+	      buff = GCF_NAME( gcfcn )
+	      CALL ERRMSG(ferr_internal, status,
+     .			'illegal axis merging parameter: '
+     .			//ww_dim_name(idim)//' axis  of '
+     .			//buff(:TM_LENSTR1(buff)), *5000 )
+	   ENDIF
+ 100	CONTINUE
+
+* *** XUNRAVEL, YUNRAVEL, ZUNRAVEL, TUNRAVEL, EUNRAVEL, FUNRAVEL functions ***
+* The result of these functions are grids of ABSTRACT and NORMAL axes
+*   .... 7/97 changes -- handled entirely within "typical" cases above
+
+	IF ( gcfcn .EQ. p_reshape ) THEN
+* *** RESHAPE function ***
+* The second argument contains the desired grid. (It cannot simply be merged,
+* however, because the result limits have no obvious relation to the inputs)
+	   cx = cx_base 	! component 2: the reshaping grid
+	   DO 210 idim = 1, nferdims
+	      axes(idim) = CGRID_AXIS ( idim, cx )
+ 210	   CONTINUE
+
+	ELSEIF ( gcfcn .EQ. p_times2 ) THEN
+* *** TIMES2 (debugging) function ***
+	   cx = cx_base 	! the argument context
+
+	   IF ( CGRID_AXIS(t_dim,cx) .EQ. mnormal
+     .	   .OR. CGRID_AXIS(t_dim,cx) .EQ. unspecified_int4 )
+     .		CALL ERRMSG(ferr_unknown_arg, status,
+     .			'arg of TIMES2(v) must have a T axis',*5000)
+
+	   grid = cx_grid(cx)
+
+* Note: This routine is called during the "getgrid" pass of Ferret.
+* During the "getgrid" pass the context limits of the argument are not reliably
+* available. For example, in "TIMES2(V)" the limits of V will appear
+* to be cx_lo/hi_ss=1:1. Even in the case of TIMES2(V[L=1:4]) at this
+* stage it will appear that V has limits L=1:4 but the actual arg
+* that will be obtained later may differ (example: the definition of V may be
+* LET V = V2[L=5:10]). The best that we can do about this situation is
+* 1. check cx_given to determine if the limits were explicit. If not,
+*	then use the limits of the full axis
+* 2. in GCF_IMPOSE_RESULT_LIMS and again in the function, itself, double
+*	check the axis we have defined against the actual argument recieved.
+*	If the axis is inappropriate then flag an error and coach the user
+*	that the argument limits are ambiguous or contradictory.
+
+* compute the lo/hi/delta of the new custom (regular) axis
+
+* are the argument's limits along this axis known ?
+	known_limits = cx_given(t_dim, cx)	! given right in fcn arg list
+	IF ( cx_category(cx) .EQ. cat_user_var ) THEN
+* ... user variables may contain limits embedded in its definition
+	   known_limits = known_limits .OR.
+     .          uvar_given(t_dim,cx_variable(cx))
+     .          .LE. uvlim_gvn_xact
+	ENDIF
+        IF ( known_limits ) THEN
+* ... limits of arg are explicit -- use 'em
+
+           n = CX_DIM_LEN(t_dim, cx)
+           dlo = TM_WORLD(cx_lo_ss(cx,t_dim), cx_grid(cx), t_dim,
+     .          box_middle )
+           dhi = TM_WORLD(cx_hi_ss(cx,t_dim), cx_grid(cx), t_dim,
+     .          box_middle )
+	   ELSE
+* ... limits of arg are not explicit -- use axis lims (and hope for the best!)
+	      n = CAXIS_LEN(t_dim, cx)
+	      dlo = TM_WORLD(1, cx_grid(cx), t_dim, box_middle )
+	      dhi = TM_WORLD(n, cx_grid(cx), t_dim, box_middle )
+	   ENDIF
+	   IF ( n .EQ. 1 ) THEN
+	      del = 1.D0
+	   ELSE
+	      del = (dhi-dlo)/(n-1)
+	   ENDIF
+
+*	Create and set the custom axis
+* NOTE: It is important that **somewhere** inside of Ferret TM_MAKE_DYN_LINE
+*	is called -- else it will not be linked in and available to the
+*	external functions 
+* Use TM_GET_LIKE_DYN_LINE to create axes which are children of an argument ax
+	   CALL TM_MAKE_DYN_LINE(t_dim, dlo, dhi, del,
+     .                                  'Hertz', .FALSE., 0.0D0,
+     .                                  axes(t_dim), status)
+	   IF (status .NE. ferr_ok) GOTO 5000
+
+
+**************
+*     FOR EXTERNAL FUNCTIONS
+
+
+	ELSEIF (gcfcn .GT. gfcn_num_internal ) THEN
+
+*   ... create a context list array
+           narg = EFCN_GET_NUM_REQD_ARGS(gcfcn)
+           DO 300 i = 1, narg
+              EF_cx_list(i) = cx_stack_ptr - i + 1
+ 300       CONTINUE
+
+           IF (axis_will_be(1) .EQ. pgc_axis_supplied_herein
+     .          .OR. axis_will_be(2) .EQ. pgc_axis_supplied_herein
+     .          .OR. axis_will_be(3) .EQ. pgc_axis_supplied_herein
+     .          .OR. axis_will_be(4) .EQ. pgc_axis_supplied_herein
+     .          .OR. axis_will_be(5) .EQ. pgc_axis_supplied_herein
+     .          .OR. axis_will_be(6) .EQ. pgc_axis_supplied_herein) THEN
+              CALL EFCN_GET_CUSTOM_AXES(gcfcn, EF_cx_list, status)
+              IF (status .NE. ferr_ok) CALL ERRMSG
+     .                          ( status, status, ' ', *5000) 
+           ENDIF
+
+           DO 400 idim = 1, nferdims
+
+              IF (axis_will_be(idim) .EQ. pgc_axis_supplied_herein) THEN
+                 CALL EFCN_GET_CUSTOM_AXIS(gcfcn, idim, dlo, dhi, del,
+     .                unit, modulo)
+                 CALL TM_MAKE_DYN_LINE(idim, dlo, dhi, del,
+     .                unit, modulo, 0.0D0, axes(idim), status)
+                 IF (status .NE. ferr_ok) GOTO 5000
+              ENDIF
+
+
+ 400       CONTINUE
+
+	ENDIF
+
+* successful completion
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/gcf_impose_arg_lim_dflts.F b/fer/utl/gcf_impose_arg_lim_dflts.F
new file mode 100644
index 0000000..58cdae5
--- /dev/null
+++ b/fer/utl/gcf_impose_arg_lim_dflts.F
@@ -0,0 +1,234 @@
+	SUBROUTINE GCF_IMPOSE_ARG_LIM_DFLTS( vname, arg,
+     .					     cx_in, cx_out, uvar, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This routine is used in setting the context used for **obtaining**
+* the component arguments to a grid changing function.
+* This is the so-called "upstream" passing of context.
+
+* The input context, cx_in, is the limits requested for the result.
+* For example, in
+*	LET a = GCFCN( b )
+*	LIST/I=1:5 a[J=5:10]
+* the input context would contain I=1:5 and J=5:10.
+* The decision of what defaults to set when requesting the argument ("b")
+* is the business of this routine.
+
+* V450: 1/97
+* V500: 10/98 - *jc* We need to remove the @RDC transform from
+*       contexts when the parent is also a grid changing variable.
+* V490: 11/97 - bug fix: when wiping out context axis wipe ww lims, too
+* V491:  3/98 - bug fix: crashed because pseudo-variables did not have
+*		valid grids when this routine was called. Changed to use
+*		**result** grid to convert world coords to subscripts when
+*		offsets need to be applied -- argument grid not needed.
+*		Hugely simplified this routine!
+* v580 *acm* 11/04 Reset cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+* v581 *acm*  2/05 for axis_expand, if the requested offset is given as 
+*                  unspecified_int4 then use the full axis range, or if 
+*                  the axis is modulo, then one full modulo repetition
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+*	Note: the "offset" code in this routine is largely untested!
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+	include	'xcontext.cmn'
+
+
+* calling argument declarations
+	INTEGER		arg, cx_in, cx_out, uvar, status
+	CHARACTER*(*)	vname		! unused after 3/98
+
+* local variable declarations
+	INTEGER	TM_LENSTR1, ISUBSCRIPT, KNOWN_GRID,
+     .		gcfcn, idim, arg_grd, mods_cx, tmp_var_cx,
+     .		lo_off(nferdims), hi_off(nferdims), action(nferdims), uvgrid,
+     .          WHICH_GCFCN, lo, hi, ss_mid, cx_mid
+       LOGICAL ss_fix
+
+* initialize
+	CALL TRANSFER_CONTEXT ( cx_in, cx_out )
+
+* 10/98 fix
+	DO 10 idim = 1, nferdims
+           IF ( cx_trans(idim, cx_out) .EQ. trans_reduced ) THEN
+              cx_trans(idim, cx_out) = trans_no_transform
+           ENDIF
+ 10     CONTINUE
+
+* which grid changing function does this uvar have?
+	gcfcn = WHICH_GCFCN(uvar)
+
+* get the grid of the result of this function (user variable)
+	uvgrid = KNOWN_GRID(cx_data_set(cx_in), cat_user_var, uvar)
+
+* What did the function creator specify about this argument?
+	CALL GCF_GET_ARG_LIMS( gcfcn, arg, cx_out, uvgrid,
+     .				lo_off, hi_off, action, status)
+	IF ( status .NE. ferr_ok ) RETURN
+
+* loop through the axes
+	DO 500 idim = 1,nferdims
+
+	   IF ( action(idim) .EQ. pset_to_unspec ) THEN
+* set the axis limits to unspecified
+	      cx_lo_ss(cx_out,idim)      = unspecified_int4
+	      cx_hi_ss(cx_out,idim)      = unspecified_int4
+	      cx_by_ss(idim,cx_out)      = .TRUE.
+	      cx_given(idim,cx_out)      = .FALSE.	! needed ?
+	      cx_lo_ww(idim,cx_out)      = unspecified_val8	! 11/97
+	      cx_hi_ww(idim,cx_out)      = unspecified_val8	! 11/97
+	      cx_cal_id(cx_out)          = unspecified_int4
+!	      cx_trans (idim,cx_out)     = trans_no_transform
+!	      cx_trans_arg(idim,cx_out)  = bad_val4  
+	      IF (idim .EQ. t_dim) 
+     .                cx_calendar(cx_out) = .FALSE.
+
+	   ELSEIF (lo_off(idim).NE.0 .OR. hi_off(idim).NE.0) THEN
+* pass along the axis limits 
+                 
+              IF (lo_off(idim) .EQ. unspecified_int4 .OR.
+     .            hi_off(idim) .EQ. unspecified_int4)  
+     .           CALL GRID_SUBSCRIPT_EXTREMES_NO_MOD
+     .                             (lo, hi, uvgrid, idim)
+                 ss_mid = (hi - lo + 1)/ 2.
+
+
+	      IF ( cx_by_ss(idim,cx_out) ) THEN
+* ... expand the subscript range by the offsets requested. If the
+*     requested offset is unspecified_int4 then use the full axis range,
+*     or if modulo, then use either 
+*    1) one full modulo repitition, centered on the output range, or
+*    2) the requested range, if it is larger than one modulo repetitionpetition
+
+	         IF ( cx_hi_ss(cx_out,idim).NE.unspecified_int4 ) THEN
+
+* special fix for modulo axes.
+                    ss_fix = ( cx_lo_ss(cx_out,idim) .LT. lo .OR.
+     .                      cx_hi_ss(cx_out,idim) .GT. hi )  ! special fix for modulo axes
+
+                    cx_mid = (1 + cx_hi_ss(cx_out,idim) +
+     .                            cx_lo_ss(cx_out,idim))/2.
+                    IF (lo_off(idim) .EQ. unspecified_int4 )  THEN
+                       IF (ss_fix) THEN
+                          cx_lo_ss(cx_out,idim) =  MIN(cx_mid - ss_mid,
+     .                                cx_lo_ss(cx_out,idim))
+                       ELSE
+                          cx_lo_ss(cx_out,idim) = lo
+                       ENDIF
+                    ELSE
+	               cx_lo_ss(cx_out,idim) = cx_lo_ss(cx_out,idim)
+     .					  + lo_off(idim)
+                    ENDIF
+                    IF (hi_off(idim) .EQ. unspecified_int4 )  THEN
+                       IF (ss_fix) THEN
+                          cx_hi_ss(cx_out,idim) = MAX(cx_mid + ss_mid, 
+     .                                cx_hi_ss(cx_out,idim) )
+                       ELSE
+                          cx_hi_ss(cx_out,idim) = hi
+                       ENDIF
+                    ELSE
+ 	               cx_hi_ss(cx_out,idim) = cx_hi_ss(cx_out,idim)
+     .					  + hi_off(idim)
+                    ENDIF
+		 ENDIF
+	      ELSE
+* ... convert the world coordinate range to subscript limits. Then
+* ... expand the subscript range by the offsets requested
+	         IF ( cx_hi_ww(idim,cx_out).NE.unspecified_val8 ) THEN
+                 
+	            cx_lo_ss(cx_out,idim) =
+     .				ISUBSCRIPT(cx_lo_ww(idim,cx_out),
+     .		 			   uvgrid, idim, round_up)
+                    cx_hi_ss(cx_out,idim) = 
+     .				ISUBSCRIPT(cx_hi_ww(idim,cx_out),
+     .					   uvgrid, idim, round_dn)
+
+* special fix for modulo axes. 
+                    ss_fix = ( cx_lo_ss(cx_out,idim) .LT. lo .OR.
+     .                      cx_hi_ss(cx_out,idim) .GT. hi )  
+                    cx_mid = (1 + cx_hi_ss(cx_out,idim) +
+     .                            cx_lo_ss(cx_out,idim))/2.
+
+                    IF (lo_off(idim) .EQ. unspecified_int4 )  THEN
+                       IF (ss_fix) THEN
+                          cx_lo_ss(cx_out,idim) = MIN(cx_mid - ss_mid,
+     .                                cx_lo_ss(cx_out,idim))
+                       ELSE
+                          cx_lo_ss(cx_out,idim) = lo
+                       ENDIF
+                    ELSE
+	               cx_lo_ss(cx_out,idim) = cx_lo_ss(cx_out,idim)
+     .					  + lo_off(idim)
+                    ENDIF
+
+                    IF (hi_off(idim) .EQ. unspecified_int4 )  THEN
+                       IF (ss_fix) THEN
+                          cx_hi_ss(cx_out,idim) = MAX(cx_mid + ss_mid, 
+     .                                cx_hi_ss(cx_out,idim) )
+                       ELSE
+                          cx_hi_ss(cx_out,idim) = hi
+                       ENDIF
+                    ELSE
+	               cx_hi_ss(cx_out,idim) = cx_hi_ss(cx_out,idim)
+     .					  + hi_off(idim)
+                    ENDIF
+
+		 ENDIF
+	         cx_by_ss(idim,cx_out) = .TRUE.
+	      ENDIF
+	   ENDIF
+
+ 500	CONTINUE
+
+* successfully merged
+	status = ferr_ok
+	RETURN
+
+* error exit
+! 5000	RETURN
+	END
+
diff --git a/fer/utl/gcf_impose_axes.F b/fer/utl/gcf_impose_axes.F
new file mode 100644
index 0000000..a20b1fe
--- /dev/null
+++ b/fer/utl/gcf_impose_axes.F
@@ -0,0 +1,148 @@
+	SUBROUTINE GCF_IMPOSE_AXES( cx_base, mrg_cx, uvar, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* at this point a grid has been determined which lacks only those
+* axes which are to be imposed by a grid changing variable. This routine
+* completes that grid and the uvar_given associated with it.
+
+* V4500: 10/98 - *jc* logic for context passing
+* V450: 1/97
+* V510: *sh* 12/99 - bug fixes to uvar_given associated with GC variables
+*	- 1) imposing an axis always makes limits on that axis uvlim_irrelevant
+*	- 2) context limits on axes that do inherit must match exactly (cuz
+*			we have no idea what goes on inside the EF)
+*	*sh*  4/00 - all axes now maintain use counts, not just dynamic
+* V533: *sh* 7/01 - improve caching of some functions -- like SPAWN that
+*	            should have uvlim_hidden behavior equivalent to FFTA
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'grid_chg_fcns.parm'
+	include 'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xgrid_chg_fcns.cmn'
+
+* calling argument declarations
+	INTEGER		cx_base, mrg_cx, uvar, status
+
+* local variable declarations
+	INTEGER WHICH_GCFCN
+	INTEGER	gcfcn, idim, imp_ax, mrg_ax, mrg_grd, uvg,
+     .		axis_source(nferdims), imposed_axes(nferdims), 
+     .		axis_reduction(nferdims)
+
+
+* initialize
+* which grid changing variable?
+	gcfcn = WHICH_GCFCN(uvar)
+
+* which axes are involved?
+	CALL GCF_GET_AXIS_SRCS( gcfcn, 1, axis_source )
+
+* get the axis_reduction information
+	IF ( gcfcn .GT. gfcn_num_internal ) THEN
+       CALL EFCN_GET_AXIS_REDUCTION(gcfcn, axis_reduction)
+	ENDIF
+
+* get the replacement axes
+	CALL GCF_GET_IMPOSED_AXES( gcfcn, cx_base, imposed_axes,
+     .       status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* get the current grid
+	mrg_grd = cx_grid( mrg_cx )
+
+
+* loop through the axes
+	DO 500 idim = 1, nferdims
+
+	   mrg_ax  = grid_line ( idim, mrg_grd )
+
+	   IF (    axis_source(idim).EQ.pgc_ignore_axis) THEN
+	      GOTO 500
+	   ELSEIF (axis_source(idim).EQ.pgc_impose_axis) THEN
+	      imp_ax = imposed_axes(idim)
+* ... since new axis is imposed old axis need not be allocated to result
+	      CALL TM_USE_LINE(imp_ax)
+	      CALL TM_DEALLO_DYN_LINE(mrg_ax)
+	      grid_line( idim, mrg_grd ) = imp_ax
+* ... imposing an axis implies that the gcvar doesn't depend on the axis cx
+	      IF ( imp_ax .EQ. mnormal ) THEN
+	         uvar_given(idim,uvar) = uvlim_irrelevant
+	      ELSEIF ( gcfcn .GT. gfcn_num_internal ) THEN
+	         uvar_given(idim,uvar) = uvlim_hidden	! 12/99
+	      ELSEIF ( gcfcn .EQ. p_spawn ) THEN
+	         uvar_given(idim,uvar) = uvlim_hidden   ! 7/01
+	      ELSE
+* ... allows XSEQUENCE, etc. context to be determined w/out full evaluation
+*     This can make some scripts more efficient ... others maybe less because
+*     uvlim_hidden would make caching more effective.  Example like
+*       "let a = XSEQUENCE(J[j=1:5]); say `a[i=100:200],return=isize`"
+*     can actually yield a wrong answer
+	         uvar_given(idim,uvar) = uvlim_needed ! for fcns like RESHAPE
+	      ENDIF
+	   ELSE
+* ... it is evidently, a mergible axis ... continue on
+	      CONTINUE
+	   ENDIF	      
+
+* For grid-changing functions (that may perform operations analagous to
+* averaging) a cache hit requires an exact match on all relevant limits
+* (Note: this is over-kill for some functions, but has
+* impacts only on cache efficiency)
+           IF ( gcfcn .GT. gfcn_num_internal ) THEN
+                 uvg = uvar_given(idim,uvar)
+                 IF (    uvg.GE.uvlim_gvn_gnl    .AND.
+     .                uvg.LE.uvlim_gvn_xact) THEN
+                    uvar_given(idim,uvar) = uvlim_gvn_xact
+                 ELSEIF (uvg.GE.uvlim_needed .AND.
+     .                   uvg.LE.uvlim_need_xact) THEN
+                    uvar_given(idim,uvar) = uvlim_need_xact
+                 ENDIF
+           ENDIF
+
+ 500	CONTINUE
+
+* successfully merged
+	status = ferr_ok
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/gcf_impose_result_lims.F b/fer/utl/gcf_impose_result_lims.F
new file mode 100644
index 0000000..4b6a0d8
--- /dev/null
+++ b/fer/utl/gcf_impose_result_lims.F
@@ -0,0 +1,422 @@
+      SUBROUTINE GCF_IMPOSE_RESULT_LIMS( gcfcn, memory, mr_list,
+     .     cx_list, res_cx, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Complete the context for the result of a grid-changing function.
+* Fill in the limits for those axes of the grid changing function which
+* were "imposed" by the function.
+* Reconcile the limits of the arguments with the limits of the result where
+* offsets are imposed.
+
+* the addition (or major modification) of an internal grid-changing function
+* requires changes to these routines:
+*	grid_chg_fcns.parm	- parameters to number the functions
+*	XGRID_CHG_FCNS_DATA	- description of the function and args
+*	DO_INTERNAL_GC_FCN	- code to execute the function
+* (opt)	GCF_GET_IMPOSED_AXES	- return the "imposed" axes, if any
+* (opt)	GCF_IMPOSE_RESULT_LIMS	- fill in limits of "imposed" axes, if any
+
+* V450: 1/97
+* *jc* 12/97 adding external function capabilities
+* V491: 1/98 - added TIMES2, which imposes its T axis
+* *jc* 01/98 put includes first
+* V491+ 10/98 *sh* - the RESHAPE function failed to "confine" axes at end
+*                see err491_reshape_limits.jnl
+* V500:  1/99 *sh* remove test code regarding function TIMES2
+*       a.k.a. "ECHO"  now used for string argument testing
+*       2/99 changed UNRAVEL to XUNRAVEL. Added YUNRAVEL, ZUNRAVEL, TUNRAVEL
+* V510: 9/99 *sh* - added SAMPLE* functions
+*       1/00 *sh* - RESHAPE behavior to inherit explicit cx lims from arg 2
+* V530: 10/00 *sh* - added return status to efcn_get_result_lims
+* V533: 7/01 *sh* - added SPAWN function
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+* V6.8  *acm* 5/12 Add EUNRAVEL, FUNRAVEL
+
+* debug declarations for TIMES2
+!	INTEGER	n_com1, n_grid, com1_grid
+!	REAL*8	TM_WORLD, dlo_com1, dlo_grid, dhi_com1, dhi_grid
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'grid_chg_fcns.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xgrid_chg_fcns.cmn'
+
+* calling argument declarations
+	INTEGER	gcfcn, cx_list(*), mr_list(*), res_cx, status
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations
+	LOGICAL fix_me(nferdims)
+	INTEGER	CGRID_SIZE, CAXIS_LEN, CGRID_AXIS, CX_DIM_LEN,
+     .		com1_cx, com2_cx, idim, filled, size, uvar,
+     .		res_grd, outlen(nferdims), accum(2:nferdims),
+     .		lo_off(nferdims),  hi_off(nferdims), action(nferdims),
+     .		axis_will_be(nferdims), lo_lim, hi_lim
+
+* initialize
+	uvar = cx_variable(res_cx)
+	res_grd = cx_grid(res_cx)
+
+* get "axis_will_be()" for external functions
+	IF (gcfcn .GT. gfcn_num_internal ) THEN
+	   CALL EFCN_GET_AXIS_WILL_BE(gcfcn, axis_will_be)
+	ENDIF
+
+* Fill in the limits for those axes of the grid changing function which
+* were "imposed" by the function.
+
+* (1/98)  *** all CUSTOM axes ***
+* If the function creates and imposes a custom axis (see GCF_GET_IMPOSED_AXES)
+*     then result lims are assumed BY DEFAULT to fill the limits of that axis
+* The function itself may over-ride this assumption and impose other limits
+*     or detect an error.
+	DO 100 idim = 1, nferdims
+	   IF (gcfcn .LE. gfcn_num_internal ) THEN
+* ... internal function imposing custom axis?
+	     IF (  gfcn_axis_will_be(idim,gcfcn)
+     .	      .NE. pgc_axis_supplied_herein) GOTO 100	! 100 if not custom
+	   ELSE
+* ... external function imposing custom axis?
+              IF (  axis_will_be(idim) .NE.
+     .             pgc_axis_supplied_herein) GOTO 100 ! 100 if not custom
+	   ENDIF
+
+* get size of custom output axis
+	   size = CAXIS_LEN ( idim, res_cx )
+
+* impose full length on result
+	   cx_lo_ss(res_cx, idim) = 1
+	   cx_hi_ss(res_cx, idim) = size
+	   cx_by_ss(idim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( idim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+ 100	CONTINUE
+
+* *** XSEQUENCE function ***
+	IF ( gcfcn .EQ. p_xunravel ) THEN
+* X axis is imposed as ABSTRACT
+* size of output on X is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,x_dim) = 1
+	   cx_hi_ss(res_cx,x_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(x_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( x_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	
+* *** YSEQUENCE function ***
+	ELSEIF ( gcfcn .EQ. p_yunravel ) THEN
+* Y axis is imposed as ABSTRACT
+* size of output on Y is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,y_dim) = 1
+	   cx_hi_ss(res_cx,y_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(y_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( y_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+
+* *** ZSEQUENCE function ***
+	ELSEIF ( gcfcn .EQ. p_zunravel ) THEN
+* Z axis is imposed as ABSTRACT
+* size of output on Z is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,z_dim) = 1
+	   cx_hi_ss(res_cx,z_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(z_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( z_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+
+* *** TSEQUENCE function ***
+	ELSEIF ( gcfcn .EQ. p_tunravel ) THEN
+* T axis is imposed as ABSTRACT
+* size of output on T is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,t_dim) = 1
+	   cx_hi_ss(res_cx,t_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(t_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( t_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* *** ESEQUENCE function ***
+	ELSEIF ( gcfcn .EQ. p_eunravel ) THEN
+* E axis is imposed as ABSTRACT
+* size of output on E is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,e_dim) = 1
+	   cx_hi_ss(res_cx,e_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(e_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( e_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* *** FSEQUENCE function ***
+	ELSEIF ( gcfcn .EQ. p_funravel ) THEN
+* F axis is imposed as ABSTRACT
+* size of output on F is total size of input of component
+	   com1_cx = cx_list(1) 	! only one argument to function
+	   cx_lo_ss(res_cx,f_dim) = 1
+	   cx_hi_ss(res_cx,f_dim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(f_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( f_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* *** SPAWN function ***
+	ELSEIF ( gcfcn .EQ. p_spawn ) THEN
+* X axis is imposed as ABSTRACT
+* size of output on X is the number of strings to come from the Unix system
+* command -- an unknown value at this point. Arbitrarily we assume 2000
+* here and revise if necessary in STORE_SYS_STRINGS
+	   cx_lo_ss(res_cx,x_dim) = 1
+	   cx_hi_ss(res_cx,x_dim) = 2000 ! arbitrary
+	   cx_by_ss(x_dim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( x_dim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+
+* *** SAMPLE* functions ***
+	ELSEIF ( gcfcn .GE. p_samplei 
+     .    .AND.  gcfcn .LE. p_samplen ) THEN
+* specified axis is imposed as ABSTRACT
+* size of output on that axis is total size of component 1, the index list
+	   com1_cx = cx_list(1) 	! only one argument to function
+           idim =  gcfcn - p_samplei + 1
+	   cx_lo_ss(res_cx,idim) = 1
+	   cx_hi_ss(res_cx,idim) = CGRID_SIZE(com1_cx)
+	   cx_by_ss(idim, res_cx) = .TRUE.
+	   CALL FLESH_OUT_AXIS( idim, res_cx, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	
+
+* *** TIMES2 (debug) function ***
+! commented out with ifdef 1/99 *sh*
+! old test code for internal gc func TIMES2 - generate custom t axis
+*	ELSEIF ( gcfcn .EQ. p_times2 ) THEN
+
+* T axis gets custom-inserted
+*	   com1_cx = cx_list(1) 	! only one argument to function
+*	   com1_grid = cx_grid(com1_cx)
+
+* check that result axis limits match the argument
+* ... argument range
+*	   n_com1   = CX_DIM_LEN(t_dim, com1_cx)
+*	   dlo_com1 = TM_WORLD(cx_lo_ss(com1_cx,t_dim), com1_grid, t_dim,
+*     .						box_middle )
+*	   dhi_com1 = TM_WORLD(cx_hi_ss(com1_cx,t_dim), com1_grid, t_dim,
+*     .						box_middle )
+
+* ... custom axis range
+*	   n_grid   = CAXIS_LEN(t_dim, res_cx)
+*	   dlo_grid = TM_WORLD(1,      res_grd, t_dim, box_middle )
+*	   dhi_grid = TM_WORLD(n_grid, res_grd, t_dim, box_middle )
+*
+* sanity checking -- messages to help with debugging
+*	   IF (n_com1   .NE. n_grid  )
+*     .			CALL WARN('TIMES2 grid size mismatch')
+*	   IF (dlo_com1 .NE. dlo_grid)
+*     .			CALL WARN('TIMES2 low limit mismatch')
+*	   IF (dhi_com1 .NE. dhi_grid)
+*     .			CALL WARN('TIMES2 high limit mismatch')
+
+
+* *** RESHAPE function ***
+* Determine how far the input data will fill the result grid
+* Note that for those axes where the result axis is the same as the comp 1 axis
+* the arg 1 limits should be preserved
+* e.g. RESHAPE(SST,G_Z12_TYEAR) should preserve the X and Y limits
+	ELSEIF ( gcfcn .EQ. p_reshape ) THEN
+	   com1_cx = cx_list(1) 	! the input data
+	   size = CGRID_SIZE(com1_cx)
+
+* ... get "action" which tells which result axes inherit the comp 1 limits
+	   CALL GCF_GET_ARG_LIMS (gcfcn, 1, com1_cx, res_grd,
+     .		lo_off,  hi_off, action, status)
+	   IF ( status .NE. ferr_ok) GOTO 5000
+
+* ... determine the size of the output "container"
+	   com2_cx = cx_list(2) 	! the reshaping grid
+	   DO 310 idim = 1, nferdims
+              IF ( action(idim) .EQ. ppass_along ) THEN
+	         outlen(idim) = CX_DIM_LEN(idim, com1_cx)
+	      ELSE
+                 outlen(idim) = CX_DIM_LEN(idim, com2_cx) ! inherit if explicit
+              ENDIF
+ 310	   CONTINUE
+
+        
+
+* set default limits: full ax len or match com1 depending on "action"
+	   DO 320 idim = 1, nferdims
+	      fix_me(idim) = CGRID_AXIS(idim, res_cx) .NE. mnormal
+	      IF ( fix_me(idim) ) THEN
+	        IF ( action(idim) .EQ. ppass_along ) THEN
+	           cx_lo_ss(res_cx,idim) = cx_lo_ss(com1_cx,idim)
+	           cx_hi_ss(res_cx,idim) = cx_hi_ss(com1_cx,idim)
+	        ELSE
+	           cx_lo_ss(res_cx,idim) = cx_lo_ss(com2_cx,idim)
+	           cx_hi_ss(res_cx,idim) = cx_hi_ss(com2_cx,idim)
+	        ENDIF
+	      ELSE
+	         cx_lo_ss(res_cx,idim) = unspecified_int4
+	         cx_hi_ss(res_cx,idim) = unspecified_int4
+	      ENDIF
+* ... all axes of length 1 provide no opportunity for adjusting output
+	      IF (outlen(idim) .EQ. 1) fix_me(idim) = .FALSE.
+ 320	   CONTINUE
+
+* accumulate the axis lengths to help with calculation
+* Note: this can cause integer overflow for grid with ABSTRACT axes
+*	a cheap fix (7/97) checks for size above 9999999
+	   accum(2) = outlen(1)
+	   DO 330 idim = 3, nferdims
+	      IF (accum(idim-1) .GE. 9999999
+     .	     .OR. outlen(idim-1) .GE. 9999999 ) THEN
+	         accum(idim) = 9999999
+	      ELSE
+	         accum(idim) = accum(idim-1) * outlen(idim-1)
+	      ENDIF
+ 330	   CONTINUE
+* figure out how high the input data really fills the output grid
+* Note that the input data may not fit into an integer number of output
+* rows and columns. If not, round up to allow room, and fill bad flags in
+* DO_INTERNAL_GC_FCN, to complete the unfinished rows.
+	   DO 340 idim = nferdims, 2, -1
+	      filled = size/accum(idim)   ! integer arithmatic
+	      IF ( filled.GT.0 .AND. fix_me(idim) ) THEN
+	         IF ( size .GT. filled*accum(idim) ) filled = filled + 1
+	         cx_hi_ss(res_cx,idim) = MIN(outlen(idim), filled) +
+     .					 cx_lo_ss(res_cx,idim) - 1
+	         GOTO 360	! break from loop
+	      ELSE
+	         cx_hi_ss(res_cx,idim) = cx_lo_ss(res_cx,idim)
+	      ENDIF
+ 340	   CONTINUE
+* ... it all fits into the lowest order row (which may not be the X axis)
+	   DO 350 idim = 1, nferdims
+	      IF (fix_me(idim)) THEN
+	         cx_hi_ss(res_cx,idim) = cx_lo_ss(res_cx,idim) - 1
+     .				       + size
+	         GOTO 360
+	      ENDIF
+ 350	   CONTINUE
+
+* flesh out the axes
+ 360       DO 370 idim = 1, nferdims
+              CALL CONFINE_AXIS( idim, res_cx, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000  ! added 10/98 *sh*
+	      cx_by_ss(idim, res_cx) = .TRUE.
+	      CALL FLESH_OUT_AXIS( idim, res_cx, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+ 370	   CONTINUE
+
+*
+* THIS NEXT SECTION DEALS WITH EXTERNAL FUNCTIONS
+*
+
+	ELSEIF ( gcfcn .GT. gfcn_num_internal ) THEN
+
+* ... does the external function need to impose special size limits
+*     onto the result? (perhaps a parameter of the function determines this?)
+* ... If so, impose 'em here
+
+           IF (axis_will_be(1) .EQ. pgc_axis_is_abstract
+     .          .OR. axis_will_be(2) .EQ. pgc_axis_is_abstract
+     .          .OR. axis_will_be(3) .EQ. pgc_axis_is_abstract
+     .          .OR. axis_will_be(4) .EQ. pgc_axis_is_abstract
+     .          .OR. axis_will_be(5) .EQ. pgc_axis_is_abstract
+     .          .OR. axis_will_be(6) .EQ. pgc_axis_is_abstract)	THEN
+              CALL EFCN_GET_RESULT_LIMITS(gcfcn, memory, mr_list, 
+     .             cx_list, status)
+              IF (status .NE. ferr_ok) CALL ERRMSG
+     .                          ( status, status,' ', *5000 )
+           ENDIF
+
+	   DO 450 idim = 1, nferdims
+
+
+* If the axis is abstract ... 
+*   get the lo and hi limits for this axis
+*   create one as in *SEQUENCE above
+
+	      IF (axis_will_be(idim) .EQ. pgc_axis_is_abstract)	THEN
+
+		 CALL EFCN_GET_AXIS_LIMITS(gcfcn, idim, lo_lim, hi_lim)
+		 cx_lo_ss(res_cx,idim) = lo_lim
+		 cx_hi_ss(res_cx,idim) = hi_lim
+		 cx_by_ss(idim, res_cx) = .TRUE.
+		 CALL FLESH_OUT_AXIS( idim, res_cx, status )
+		 IF ( status .NE. ferr_ok ) GOTO 5000
+
+
+* If the axis is normal ... nothing needs to be done
+
+*	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_is_normal) THEN
+*       do nothing
+
+
+* If the axis is custom
+
+	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_supplied_herein)
+     .                THEN
+* do nothing.  accept the limits defined at the top.
+
+*		 CALL ERRMSG( ferr_internal, status,
+*     .                'gcf_impose_result_lims: external function'// 
+*     .                'custom axes not supported', *5000 )
+
+
+* If the axis is implied_by_args ... nothing needs to be done
+
+*	      ELSEIF (axis_will_be(idim) .EQ. pgc_axis_implied_by_args)
+*     .             THEN
+*       do nothing
+
+	      ENDIF
+
+ 450	   CONTINUE
+
+	ELSE
+
+	   CONTINUE	! this function does not impose any limits
+
+	ENDIF
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/gcf_name.F b/fer/utl/gcf_name.F
new file mode 100644
index 0000000..913f3e3
--- /dev/null
+++ b/fer/utl/gcf_name.F
@@ -0,0 +1,91 @@
+	CHARACTER*(*) FUNCTION GCF_NAME( ifcn )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the name of a grid changing function from its ID number
+
+* V450: 1/97
+*       97.07.16 *jc* adding code to allow call to efcn_get_name()
+* V500: 3/99 *jc* convert external function names to upper case
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER ifcn
+
+* internal variable declarations
+        INTEGER STR_UPCASE, status
+	CHARACTER text*40
+
+* internal parameter declarations:
+        INTEGER      slen
+        PARAMETER  ( slen = 40 )
+ 
+#ifdef sun
+        BYTE      fhol(slen)    ! c-type Hollerith string buffer
+#else
+        INTEGER*1 fhol(slen)    ! c-type Hollerith string buffer
+#endif
+ 
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xgrid_chg_fcns.cmn'
+
+* check the internal grid changing functions first
+	IF (ifcn .LT. 0 ) THEN
+
+	   CALL ERRMSG( ferr_internal, status, 'gcf_name', *5000)
+
+	ELSEIF (ifcn .LE. gfcn_num_internal) THEN
+
+	   GCF_NAME = gfcn_name(ifcn)
+
+	ELSE
+
+	   CALL EFCN_GET_NAME(ifcn, fhol)
+	   CALL TM_CTOF_STRNG( fhol, text, slen)
+           status =  STR_UPCASE(gcf_name,text)
+
+	ENDIF	   
+	
+* success
+	RETURN
+
+* error exit
+ 5000	GCF_NAME = 'ILLEGAL NAME'
+	RETURN
+
+	END
diff --git a/fer/utl/gcf_num_args.F b/fer/utl/gcf_num_args.F
new file mode 100644
index 0000000..46ed95f
--- /dev/null
+++ b/fer/utl/gcf_num_args.F
@@ -0,0 +1,67 @@
+	INTEGER FUNCTION GCF_NUM_ARGS( ifcn )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the number of arguments to this grid changing function
+* variable argument functions return a negative value with the
+* ABS() equal to the number of **required** arguments
+
+* V450: 12/96
+*       97.07.16 *jc* adding code to query external functions
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		ifcn
+	INTEGER efcn_scan, efcn_get_num_reqd_args
+
+* internal variable declarations
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xgrid_chg_fcns.cmn'
+
+	IF ( ifcn .GT. gfcn_num_internal ) THEN
+
+	   GCF_NUM_ARGS = efcn_get_num_reqd_args(ifcn)
+
+	ELSE
+
+	   GCF_NUM_ARGS = gfcn_num_reqd_args(ifcn)
+
+	ENDIF
+	RETURN
+
+	END
diff --git a/fer/utl/gcf_parent_char.F b/fer/utl/gcf_parent_char.F
new file mode 100644
index 0000000..31f80bb
--- /dev/null
+++ b/fer/utl/gcf_parent_char.F
@@ -0,0 +1,84 @@
+	INTEGER FUNCTION GCF_PARENT_CHAR( child_uvar, start )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Given the starting character number of this uvar within it immediate parent
+* return the starting character number of this uvar within its ancestor
+
+*    Note that the ancestor may be a grand-parent or great-grand
+*    For example, in the expression
+*        A = FCN1(v1+v2) + B
+*    where FCN1 is a grid changing function then "FCN1(v1+v2)" will be a
+*    child of "A" and "v1+v2" will be a grand-child. The routine INIT_UVAR
+*    will have designated "A" as the parent of "v1+v2". The purpose of
+*    this routine would be to return the uvar of "A" when given the child_uvar
+*    whose definition is "v1+v2"
+
+* V510: *sh* 1/00
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		start, child_uvar
+
+* internal variable declarations
+	INTEGER   uvar, c, offset
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* initialize
+	uvar = child_uvar
+	c = start
+
+	IF (uvar_parent(uvar) .NE. 0) THEN
+	   
+* compute the character address of this function within its parent
+	   READ (uvar_name_code(uvar)(3:5),'(I3)',ERR=5000) offset
+	   c = c + offset - 1
+
+	ENDIF
+
+* end of the lineage -- this parent has no parent
+	GCF_PARENT_CHAR = c
+	RETURN
+
+* funky error exit
+ 5000	 GCF_PARENT_CHAR = 0	! will generate an error downstream
+
+	   RETURN
+
+	END
diff --git a/fer/utl/gcf_parent_uvar.F b/fer/utl/gcf_parent_uvar.F
new file mode 100644
index 0000000..066c568
--- /dev/null
+++ b/fer/utl/gcf_parent_uvar.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION GCF_PARENT_UVAR( child_uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return the uvar number of the ancestor of this (child) uvar
+*    Note that the ancestor may be a grand-parent or great-grand
+*    For example, in the expression
+*        A = FCN1(v1+v2) + B
+*    where FCN1 is a grid changing function then "FCN1(v1+v2)" will be a
+*    child of "A" and "v1+v2" will be a grand-child. The routine INIT_UVAR
+*    will have designated "A" as the parent of "v1+v2". The purpose of
+*    this routine would be to return the uvar of "A" when given the child_uvar
+*    whose definition is "v1+v2"
+
+* V450: 7/7/97
+* V510: *sh* 1/00 -- simply corrected documentation
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		child_uvar
+
+* internal variable declarations
+	INTEGER   uvar
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* initialize
+	uvar = child_uvar
+
+ 100	CONTINUE
+	IF (uvar_parent(uvar) .NE. 0) THEN
+* ... get the parent of this uvar
+	   uvar = uvar_parent(uvar)       ! a child becomes a parent
+	   GOTO 100
+	ELSE
+* ... end of the line -- this uvar has no parent
+	   GCF_PARENT_UVAR = uvar
+	   RETURN
+	ENDIF
+
+	END
diff --git a/fer/utl/gcf_rtn_type.F b/fer/utl/gcf_rtn_type.F
new file mode 100644
index 0000000..83a9e88
--- /dev/null
+++ b/fer/utl/gcf_rtn_type.F
@@ -0,0 +1,99 @@
+	INTEGER FUNCTION GCF_RTN_TYPE( gcfcn, arg1_cx )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* return the data type of the result of this function call
+
+* V533: *sh* 6/01
+* V620: *acm* 3/09 hook up the call to EFCN_GET_RTN_TYPE to get back
+*             the type of string functions (see bug 1621)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'grid_chg_fcns.parm'   ! for place-holder behavior
+        include 'EF_Util.parm'
+	include 'xcontext.cmn'
+	include 'xgrid_chg_fcns.cmn'
+
+* Upon entry to this routine the context stack should be organized as
+*         default context (var=uvar, region=(1:1,1:1,1:1,1:1) for base var)
+* big_cx: the merged grid context
+*         argument N context
+*         argument N-1 context
+*         ...
+*   -->   argument 1 context
+
+* calling argument declarations
+	INTEGER		gcfcn, arg1_cx
+
+* internal variable declarations
+!	INTEGER	GCF_ARG_EVAL_ORDER
+	INTEGER	EFCN_GET_NUM_REQD_ARGS, EFCN_GET_RTN_TYPE,
+     .          iarg, cx, i, itype
+        INTEGER EF_cx_list(EF_MAX_ARGS), narg
+
+	IF ( gcfcn .LE. gfcn_num_internal ) THEN
+
+* internal grid-changing function
+	   GCF_RTN_TYPE = gfcn_rtn_type(gcfcn)
+
+* ... inherit the return type from the indicated argument
+	   IF (GCF_RTN_TYPE .LT. 0) THEN
+	     iarg = ABS(GCF_RTN_TYPE)
+!	     cx = arg1_cx-(GCF_ARG_EVAL_ORDER(gcfcn,iarg)-1)
+	     cx = arg1_cx-(iarg-1)
+	     IF (cx_type(cx) .EQ. ptype_string) THEN
+	       GCF_RTN_TYPE = pfcn_rtn_string
+	     ELSE
+	       GCF_RTN_TYPE = pfcn_rtn_float
+	     ENDIF
+	   ENDIF
+
+	ELSE
+
+* external function
+*   ... create a context list array
+           narg = EFCN_GET_NUM_REQD_ARGS(gcfcn)
+           DO 300 i = 1, narg
+              EF_cx_list(i) = cx_stack_ptr - i + 1
+ 300       CONTINUE
+
+	   itype = EFCN_GET_RTN_TYPE (gcfcn)
+	   GCF_RTN_TYPE = itype
+
+	ENDIF
+
+	RETURN
+
+	END
diff --git a/fer/utl/geog_var.F b/fer/utl/geog_var.F
new file mode 100644
index 0000000..4858b99
--- /dev/null
+++ b/fer/utl/geog_var.F
@@ -0,0 +1,89 @@
+	LOGICAL FUNCTION GEOG_VAR( idim, cx )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular axis of a VARIABLE represents geographical
+* locations (lat.,long., etc.) requiring special label formatting
+
+* V450: 3/97 - based on GEOG_LABEL
+* *acm* 12/00 cleanup: TM_DATE_OK declared but not called
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+        include 'tmap_errors.parm'
+	external xgt_grid_data
+        include 'xunits.cmn_text'
+        external xunits_data
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+	include 'xprog_state.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER		idim, cx
+
+* internal variable declarations:
+	INTEGER		TM_UNIT_ID, units
+	CHARACTER*80	VAR_UNITS
+
+* initialize
+	GEOG_VAR = .FALSE.	! default
+
+* see if labeling modes are disabled, first
+	IF ( .NOT.ax_fmt(idim) )  RETURN
+
+* get the "units" that goes with the variable (context)
+	units = TM_UNIT_ID( VAR_UNITS(cx) )
+
+* do these units imply a formatt-ible axis
+	IF ( (idim.EQ.t_dim .OR. idim.EQ.f_dim) .AND.
+     .        (units.LT.pun_1st_time.OR.units.GT.pun_last_time)) THEN
+	   GEOG_VAR = .FALSE.
+!	   GEOG_VAR = .TRUE.		! where to get T0 ???
+	ELSEIF ( (idim.EQ.x_dim.OR.idim.EQ.y_dim) .AND.
+     .		units .EQ. pun_degrees ) THEN
+	   GEOG_VAR = .TRUE.
+	ELSEIF ( (idim.EQ.z_dim) .AND.
+     .          ( units .EQ. pun_millibars
+     .          .OR. units .EQ. pun_decibars
+     .          .OR. units .EQ. pun_meters )  ) THEN
+	   GEOG_VAR = .TRUE.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/get_ave_lims.F b/fer/utl/get_ave_lims.F
new file mode 100644
index 0000000..7da7a6b
--- /dev/null
+++ b/fer/utl/get_ave_lims.F
@@ -0,0 +1,112 @@
+	SUBROUTINE GET_AVE_LIMS( src_lo, src_hi, src_grid,
+     .				 dst_lo, dst_hi, dst_grid,
+     .				 idim, subsc )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* for regridding axis idim from source grid to destination grid:
+* determine source grid boxes containing destination box edges
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 -  1/9/89
+* V230: 8/23/92 - bug fix: time axes require special treatment
+* V312:	 6/7/94 - use TDST_WORLD for simpler, faster date conversions
+* V510: *sh* 1/00 - modify axis end point behavior so that partially filled
+*		destination cells also get processed
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER src_lo, src_hi, dst_lo, dst_hi, src_grid, dst_grid, idim
+	INTEGER subsc(dst_lo:dst_hi+1)
+
+* internal variable declarations:
+	INTEGER	ISUBSCRIPT, ii, status
+	REAL*8	TM_WORLD, TDEST_WORLD, xdst, xmin, xmax
+
+* initialize
+	IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+*	  TDST_WORLD gives dates from the source axis as they would be
+*	  encoded on the destination axis 
+*   ==>	  ALL TIME/DATE CALCULATIONS ARE DONE IN THE SOURCE AXIS ENCODING
+	   CALL TDEST_WORLD_INIT ( dst_grid, src_grid, idim, status ) ! src<->dst
+	   IF ( status .NE. ferr_ok ) RETURN   ! note - status not passed!!!
+	ENDIF
+	xmin = TM_WORLD( src_lo, src_grid, idim, box_lo_lim )
+	xmax = TM_WORLD( src_hi, src_grid, idim, box_hi_lim )
+
+* find lower bounds of destination grid boxes on source axis
+	DO 100 ii = dst_lo, dst_hi
+
+	   xdst = TDEST_WORLD( ii, dst_grid, idim, box_lo_lim )
+
+	   IF ( xdst .LT. xmin .OR. xdst .GT. xmax ) THEN
+
+* ... destination point doesn't lie within source grid bounds
+	      subsc( ii ) = unspecified_int4
+
+	   ELSE
+
+	      subsc(ii) = ISUBSCRIPT( xdst, src_grid, idim, round_up)
+
+	   ENDIF
+
+ 100	CONTINUE
+
+* correct first destination point if has a partial fill
+	IF ( subsc(dst_lo) .EQ. unspecified_int4 ) THEN
+	   xdst = TDEST_WORLD( dst_lo, dst_grid, idim, box_hi_lim )
+	   IF ( xmin .LT. xdst )  THEN
+	      subsc( dst_lo ) = src_lo
+	   ENDIF
+	ENDIF
+
+
+* find upper bound of top destination grid box on source axis
+	   xdst = TDEST_WORLD( dst_hi, dst_grid, idim, box_lo_lim )
+	   IF ( xdst .GE. xmax ) THEN
+	      subsc( dst_hi+1 ) = unspecified_int4
+           ELSE
+	      subsc( dst_hi+1 ) = src_hi
+	   ENDIF
+
+	RETURN
+	END	
diff --git a/fer/utl/get_date_and_time.F b/fer/utl/get_date_and_time.F
new file mode 100644
index 0000000..82ff5de
--- /dev/null
+++ b/fer/utl/get_date_and_time.F
@@ -0,0 +1,57 @@
+      SUBROUTINE GET_DATE_AND_TIME (tdate, ttime)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Y2K replacement function for fortran DATE.  Call FDATE and split 
+* result into todays_date and todays_time that Ferret wants.
+* *kob* 2/4/99
+
+* calling arguments
+      CHARACTER*(*) tdate
+      CHARACTER*(*) ttime
+
+* local variables
+      CHARACTER*24 returned_date
+
+
+      CALL FDATE(returned_date)
+
+      tdate = returned_date(9:10)//'-'//returned_date(5:7)//
+     .            '-'//returned_date(23:24)
+
+      ttime = returned_date(12:18)
+
+      return
+      end
+
diff --git a/fer/utl/get_dependency_status.F b/fer/utl/get_dependency_status.F
new file mode 100644
index 0000000..b9cd973
--- /dev/null
+++ b/fer/utl/get_dependency_status.F
@@ -0,0 +1,98 @@
+	SUBROUTINE GET_DEPENDENCY_STATUS ( memory, expr, status_string, slen, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set up the xdependency_tree COMMON area by running the dependency crawl
+* return a line describing the outcome
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685+  *sh* 11/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+* calling argument declarations:
+	INTEGER status, slen
+	INTEGER	memory(mem_blk_size, max_mem_blks )
+	CHARACTER*(*) expr, status_string
+
+* internal variable declarations:
+	INTEGER TM_LENSTR1, base_isp, base_cx
+
+        base_isp = 8
+        base_cx = 8
+        CALL INIT_DEPENDENCIES( cx_last, .TRUE., base_isp, status )
+        IF (status.NE. ferr_ok) GOTO 5000
+
+        CALL CRAWL_DEPENDENCIES (memory, expr, base_cx, status)
+        IF (status .NE. ferr_ok) GOTO 5000
+
+	IF (    dependency_status .EQ. df_valid_var) THEN
+	   status_string = 'AVAILABLE'
+        ELSEIF (dependency_status .EQ. df_unknown_auxvar) THEN
+	   status_string = 'UNKNOWN AUXILIARY VARIABLE'
+	ELSEIF (dependency_status .EQ. df_unknown_var) THEN
+	   status_string = 'UNKNOWN VARIABLE'
+	ELSEIF (dependency_status .EQ. df_unknown_grid) THEN
+	   status_string = 'UNKNOWN GRID'
+	ELSEIF (dependency_status .EQ. df_syntax_error) THEN
+	   status_string = 'ERROR IN EXPRESSION'
+	ELSEIF (dependency_status .EQ. df_unknown_dataset) THEN
+	   status_string = 'UNKNOWN DATASET'
+	ELSEIF (dependency_status .EQ. df_recursion_error) THEN
+	   status_string = 'ILLEGAL RECURSIVE VARIABLES'
+	ELSE
+	   STOP 'repl_exprns_depend_tree'
+	ENDIF
+	slen = TM_LENSTR1(status_string)
+
+* if status incicates a problem, append a substring from the variable definitions
+	IF (dependency_status .NE. df_valid_var ) THEN
+	   status_string(slen+1:slen+2) = ': '
+	   CALL DEPEND_STAT_VAR( memory(1,dependency_block1),
+     .					status_string(slen+3:) )
+	   slen = TM_LENSTR1(status_string)
+	ENDIF
+
+ 5000	CALL RELEASE_WORK_SPC
+	RETURN
+	END
+
diff --git a/fer/utl/get_max_string_len.F b/fer/utl/get_max_string_len.F
new file mode 100644
index 0000000..d61e6fb
--- /dev/null
+++ b/fer/utl/get_max_string_len.F
@@ -0,0 +1,65 @@
+	INTEGER FUNCTION GET_MAX_STRING_LEN(cx, mr, grid_data )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the length of the longest string in this context
+
+* V530: 8/00 *sh*
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* calling argument declarations
+	INTEGER  cx, mr
+	REAL*8	grid_data(*)
+
+* internal variable declarations
+	INTEGER	smax
+
+* pass in mr array dimensions
+	CALL GET_MAX_STRING_LEN_SUB( cx, grid_data,
+     .				     mr_lo_s1(mr), mr_hi_s1(mr),
+     .				     mr_lo_s2(mr), mr_hi_s2(mr),
+     .				     mr_lo_s3(mr), mr_hi_s3(mr),
+     .				     mr_lo_s4(mr), mr_hi_s4(mr),
+     .				     mr_lo_s5(mr), mr_hi_s5(mr),
+     .				     mr_lo_s6(mr), mr_hi_s6(mr),
+     .				     smax )
+
+	GET_MAX_STRING_LEN = smax
+	RETURN
+
+	END
+ 
diff --git a/fer/utl/get_max_string_len_sub.F b/fer/utl/get_max_string_len_sub.F
new file mode 100644
index 0000000..23944a4
--- /dev/null
+++ b/fer/utl/get_max_string_len_sub.F
@@ -0,0 +1,92 @@
+	SUBROUTINE GET_MAX_STRING_LEN_SUB(cx, grid_data, 
+     .		lox, hix, loy, hiy, loz, hiz, lot, hit, 
+     .		loe, hie, lof, hif, smax )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the length of the longest string in this context
+
+* V530: 8/00 *sh*
+* v554: 12/04 *acm* Get the shape of the region for the context of the data;
+*                   these are the indices to use in looping through grid_data.
+*                   (fixes bug 617, listing string and numeric data together)
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+        include 'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER  cx, smax, lox, hix, loy, hiy, loz, hiz, 
+     .		 lot, hit, loe, hie, lof, hif
+	REAL*8 grid_data( lox:hix,loy:hiy,loz:hiz,lot:hit,loe:hie,lof:hif )
+
+* internal variable declarations:
+	INTEGER  GET_C_STRING_LEN, i, j, k, l, m, n, slen, 
+     .         sslo(nferdims), sshi(nferdims),
+     .         ndim, cxperm(nferdims)
+
+* initialize
+	smax = 1
+
+        CALL get_cx_dims (cx,ndim,cxperm)
+
+        sslo(1) = cx_lo_s1(cx)
+        sslo(2) = cx_lo_s2(cx)
+        sslo(3) = cx_lo_s3(cx)
+        sslo(4) = cx_lo_s4(cx)
+        sslo(5) = cx_lo_s5(cx)
+        sslo(6) = cx_lo_s6(cx)
+
+        sshi(1) = cx_hi_s1(cx)
+        sshi(2) = cx_hi_s2(cx)
+        sshi(3) = cx_hi_s3(cx)
+        sshi(4) = cx_hi_s4(cx)
+        sshi(5) = cx_hi_s5(cx)
+        sshi(6) = cx_hi_s6(cx)
+
+	DO 100 n = sslo(cxperm(6)), sshi(cxperm(6))
+	DO 100 m = sslo(cxperm(5)), sshi(cxperm(5))
+	DO 100 l = sslo(cxperm(4)), sshi(cxperm(4))
+	DO 100 k = sslo(cxperm(3)), sshi(cxperm(3))
+	DO 100 j = sslo(cxperm(2)), sshi(cxperm(2))
+	DO 100 i = sslo(cxperm(1)), sshi(cxperm(1))
+
+	   slen = GET_C_STRING_LEN( grid_data(i,j,k,l,m,n) )
+	   IF ( slen .GT. smax ) smax = slen
+           
+ 100	CONTINUE
+
+	RETURN
+	END
+ 
diff --git a/fer/utl/get_string_element.F b/fer/utl/get_string_element.F
new file mode 100644
index 0000000..45c9dcc
--- /dev/null
+++ b/fer/utl/get_string_element.F
@@ -0,0 +1,88 @@
+	CHARACTER*(*) FUNCTION GET_STRING_ELEMENT(
+     .			lox,hix,loy,hiy,loz,hiz,
+     .			lot,hit,loe,hie,lof,hif,
+     .			ptr_array, i, j, k, l, m, n,
+     .			maxlen, slen)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Return the string stored at the indicated i,j,k,l,m,n, subscript
+* The horse-pucky about the lo:hi subscripts is required because the pointer
+* array needs to be dimensioned as 8-byte quantities
+
+* V530: 8/00 *sh*
+* V540: 1/02 *kob* - fix bug in which character array risc_buff was being
+*                    passed to tm_ctof_string, which expects an integer array
+*                    rather than a character array.  replace risc_buff and 
+*                    size_rbuff with int_buff and size_ibuff which is 
+*                    pulled from EF_Util.parm.
+* V553: 9/03 *kob* - increase locbuff to 512 from 100 - it was cutting strings
+*                    short*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       3/12 *kms*   int_buff and size_ibuff declared locally
+
+        IMPLICIT NONE
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'EF_Util.parm'
+
+* calling argument declarations
+	INTEGER  lox,hix,loy,hiy,loz,hiz,lot,hit,loe,hie,lof,hif,
+     .		 i, j, k, l, m, n, maxlen, slen
+	REAL*8	 ptr_array(lox:hix,loy:hiy,loz:hiz,lot:hit,loe:hie,lof:hif)
+
+* internal variable declarations
+	INTEGER  GET_C_STRING_LEN, flen
+	CHARACTER*512 locbuff
+        INTEGER size_ibuff
+        PARAMETER ( size_ibuff = 2048 )
+        INTEGER*2 int_buff(size_ibuff/2)
+
+* get the string
+        slen = GET_C_STRING_LEN(ptr_array(i,j,k,l,m,n))
+
+* get the a null-terminated C string
+        CALL GET_C_STRING(ptr_array(i,j,k,l,m,n), int_buff, slen+1)
+
+* the longest length we can use ...
+        flen = MIN(slen, size_ibuff)
+
+* copy it into the FORTRAN string
+        CALL TM_CTOF_STRNG (int_buff,locbuff, flen )
+
+	
+	GET_STRING_ELEMENT = locbuff(:flen)
+	RETURN
+
+
+	END
+ 
diff --git a/fer/utl/get_unique_dset_name.F b/fer/utl/get_unique_dset_name.F
new file mode 100644
index 0000000..c265c8f
--- /dev/null
+++ b/fer/utl/get_unique_dset_name.F
@@ -0,0 +1,82 @@
+	CHARACTER*(*) FUNCTION GET_UNIQUE_DSET_NAME ( dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return the short datset name, unless there is another dataset open with
+* the identical name. In that case return the full name with path or url.
+
+*  ACM 10/2013
+
+        include 'tmap_errors.parm'      ! error codes
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'        ! data set dimensions
+        include 'xdset_info.cmn_text'   ! data set common
+        external xdset_info_data
+
+* argument
+	INTEGER dset
+
+* local variable definitions
+	INTEGER STR_SAME, slen, iset, ic
+	CHARACTER*2048  dset_name
+
+
+* get the short name of this dataset
+
+	 dset_name = ds_name(dset)
+
+* If no name, return.
+
+	 GET_UNIQUE_DSET_NAME = dset_name
+	 IF ( ds_name(dset) .EQ. char_init40 ) GOTO 120
+
+         DO 110 iset = 1,maxdsets
+           IF (ds_name(iset) .EQ. char_init1024) GOTO 110
+	   IF (iset .EQ. dset) GOTO 110
+	   ic = STR_SAME (dset_name, ds_name(iset))
+           IF (ic .EQ. 0) THEN
+	       GET_UNIQUE_DSET_NAME = ds_des_name(dset)
+               GOTO 120
+	   ENDIF
+           
+  110   CONTINUE
+
+        GET_UNIQUE_DSET_NAME = dset_name
+
+  120   CONTINUE
+	RETURN
+	END
+
diff --git a/fer/utl/get_window_lims.F b/fer/utl/get_window_lims.F
new file mode 100644
index 0000000..b2f3b5b
--- /dev/null
+++ b/fer/utl/get_window_lims.F
@@ -0,0 +1,92 @@
+	SUBROUTINE GET_WINDOW_LIMS( src_lo, src_hi, src_grid,
+     .				 dst_lo, dst_hi, dst_grid,
+     .				 idim, sslo, sshi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* for regridding axis idim from source grid to destination grid:
+* determine source grid points contained within the destination boxes
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 - *sh* 1/00 -- drawn from GET_AVE_LIMS
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER src_lo, src_hi, dst_lo, dst_hi, src_grid, dst_grid, idim
+	INTEGER sslo(dst_lo:dst_hi+1),sshi(dst_lo:dst_hi+1)
+
+* internal variable declarations:
+	INTEGER	ISUBSCRIPT, ii, dst_ss, status
+	REAL*8	TDEST_WORLD, src_ww
+
+* initialize
+        IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+*         TDST_WORLD gives dates from the destination axis as they would be
+*         encoded on the source axis 
+*   ==>   ALL TIME/DATE CALCULATIONS ARE DONE IN THE DESTINATION AXIS ENCODING
+           CALL TDEST_WORLD_INIT ( src_grid, dst_grid, idim, status ) ! src<->dst
+           IF ( status .NE. ferr_ok ) RETURN   ! note - status not passed!!!
+        ENDIF
+
+* pre-set the output to reflect no source points in any destination cell
+	DO 10 ii = dst_lo, dst_hi
+	   sslo(ii) = src_hi+1
+	   sshi(ii) = src_lo-1
+ 10	CONTINUE
+
+* loop through the source points identifying which cell each belongs in
+	DO 100 ii = src_lo, src_hi
+
+* ... find the destination cell containing the source point
+	   src_ww = TDEST_WORLD( ii, src_grid, idim, box_middle )
+	   dst_ss = ISUBSCRIPT( src_ww, dst_grid, idim, round_up)
+
+	   IF ( dst_lo.LE.dst_ss .AND. dst_ss.LE.dst_hi ) THEN
+	      sslo(dst_ss) = MIN(sslo(dst_ss), ii)
+	      sshi(dst_ss) = ii   ! MAX() not needed -> ii strictly increasing
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END	
diff --git a/fer/utl/getunit.F b/fer/utl/getunit.F
new file mode 100644
index 0000000..147bfe6
--- /dev/null
+++ b/fer/utl/getunit.F
@@ -0,0 +1,73 @@
+	SUBROUTINE GETUNIT (lun, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Find an available unit number.
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/28/90 - Extracted from Don Denbo's PPLUS code, 4 May 90, N. Soreide.
+*		   modified for FERRET by Steve Hankin
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER	lun, status
+
+* internal variable declarations:
+	LOGICAL lopen
+
+* initialize
+	lun=10
+
+*  if the unit is not opened, then it is available.
+200	INQUIRE(UNIT=lun,OPENED=lopen)
+	IF (lopen) THEN
+	   lun=lun+1
+	   IF (lun.gt.60) CALL ERRMSG( ferr_internal, status,
+     .		     			'too many IO channels', *5000)
+	   GOTO 200
+	ENDIF
+
+* success
+	status = ferr_OK
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/gname_from_number.F b/fer/utl/gname_from_number.F
new file mode 100644
index 0000000..af13676
--- /dev/null
+++ b/fer/utl/gname_from_number.F
@@ -0,0 +1,106 @@
+	CHARACTER*(*) FUNCTION GNAME_FROM_NUMBER( dset, grid, len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a grid number return the name of the first file variable in this dset
+* that is defined on this grid.  If the variable is from a different
+* data set than the one passed in the call qualify the variable name with
+* [D=name]
+* If no variables are defined on this grid then return the name of the grid
+* itself.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/1/88
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include	'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER		dset, grid, len
+
+* local variable declarations:
+	LOGICAL	in_set
+	INTEGER	TM_LENSTR1, var, dset2, slen
+
+* search for a file variable on both the right grid and data set
+	DO 100 var = 1, maxvars
+	   IF ( ds_var_setnum (var) .EQ. set_not_open ) GOTO 100
+
+	   IF ( ds_grid_number(var) .EQ. grid
+     .	  .AND. ds_var_setnum (var) .EQ. dset ) GOTO 400
+
+ 100	CONTINUE
+
+* no luck - search for a file variable on the right grid in another data set
+	DO 200 var = 1, maxvars
+	   IF ( ds_var_setnum (var) .EQ. set_not_open ) GOTO 200
+
+	   IF ( ds_grid_number(var) .EQ. grid ) GOTO 300
+
+ 200	CONTINUE
+
+		         
+* no luck again - no file variables are defined on this grid - return grid name
+	GNAME_FROM_NUMBER = grid_name( grid )
+	GOTO 500
+
+* right grid but another data set
+ 300	dset2 = ds_var_setnum(var)
+        CALL string_array_get_strlen1(ds_var_code_head, var, slen)
+	GNAME_FROM_NUMBER = 
+     .           ds_var_code(var)(:slen)//
+     .		'[D='//ds_name(dset2)(:TM_LENSTR1(ds_name(dset2)))//']'
+	GOTO 500
+
+* right grid and variable
+ 400	GNAME_FROM_NUMBER = ds_var_code(var)
+
+* measure the string	   
+ 500	len = TM_LENSTR1( GNAME_FROM_NUMBER )
+	RETURN
+	END
diff --git a/fer/utl/go_file_input.F b/fer/utl/go_file_input.F
new file mode 100644
index 0000000..3f21759
--- /dev/null
+++ b/fer/utl/go_file_input.F
@@ -0,0 +1,60 @@
+      LOGICAL FUNCTION GO_FILE_INPUT()
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  v5.42 *kob* - Return a true if somewhere in the command stack the program
+*                is under command file control
+
+
+	include 'command.parm'
+	include 'xcontrol.cmn'
+
+
+        INTEGER i
+
+        DO 100 i = csp,1,-1
+           IF ( cs_cmnd_num(i) .EQ. cmnd_go) THEN
+              GO_FILE_INPUT= .TRUE.
+              RETURN
+           ENDIF
+ 100    CONTINUE
+           
+        GO_FILE_INPUT = .FALSE. 
+        RETURN
+        
+        END
+
+        
diff --git a/fer/utl/grid_from_name.F b/fer/utl/grid_from_name.F
new file mode 100644
index 0000000..73a4d81
--- /dev/null
+++ b/fer/utl/grid_from_name.F
@@ -0,0 +1,99 @@
+	INTEGER FUNCTION GRID_FROM_NAME(lc_name, dflt_cx, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a name which may be the name of a grid or the name of a variable
+* with possible data set and grid name modifiers return a grid number
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/29/88
+* V200:  4/27/90 - bug fix: status not set on successful return
+* Unix/RISC port - 11/1/91: bug fix: status not checked returning from
+*                           PARSE_NAM_DSET_GRD.  "SHOW GRID T" blew up.
+* V300: 2/93 - return unspecified if error exit (caught by f77 3.2)
+* V500 7/98 *sh* - allow case-sensitive variable names in single quotes 
+*      3/99 *sh* - disallow implicit grids (e.g. "Z[gz=zax]")
+* V532 5/01 *sh* - use EVAL_CONTEXT to get grid of expression
+* 1/03 *kob* g77 port requires risc buff for arbitrary string concats
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling argument declarations:
+	INTEGER		dflt_cx, status
+	CHARACTER*(*)	lc_name
+
+* local variable declarations:
+	INTEGER		STR_UPCASE, TM_GET_GRIDNUM,
+     .			vax_code, grid
+	CHARACTER	name*128
+
+* change it to upper case
+	vax_code = STR_UPCASE( name, lc_name )
+
+* try to identify it first as a grid name
+	grid = TM_GET_GRIDNUM( name )
+	IF ( grid .NE. unspecified_int4 ) GOTO 1000
+	
+* prepare a clean context to work from
+	CALL INIT_EMPTY_CONTEXT(cx_buff)
+	cx_data_set( cx_buff ) = cx_data_set( cx_last )
+
+* get the grid for a variable or expression
+	CALL EVAL_CONTEXT ( cx_buff, lc_name, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	grid = cx_grid(is_cx(1))
+
+* success
+ 1000	GRID_FROM_NAME = grid
+	status = ferr_ok
+	RETURN
+
+* error exit(s)
+ 5000	GRID_FROM_NAME = unspecified_int4     ! added 2/93
+  	RETURN
+ 5100	risc_buff = lc_name
+	CALL ERRMSG(ferr_invalid_command, status,
+     .			'disallowed usage of '//risc_buff, *5000)
+
+	END
diff --git a/fer/utl/grid_from_name_xml.F b/fer/utl/grid_from_name_xml.F
new file mode 100644
index 0000000..a3f6835
--- /dev/null
+++ b/fer/utl/grid_from_name_xml.F
@@ -0,0 +1,101 @@
+	INTEGER FUNCTION GRID_FROM_NAME_XML(lc_name, dflt_cx, cx_expr, 
+     .       status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a name which may be the name of a grid or the name of a variable
+* with possible data set and grid name modifiers return a grid number
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/29/88
+* V200:  4/27/90 - bug fix: status not set on successful return
+* Unix/RISC port - 11/1/91: bug fix: status not checked returning from
+*                           PARSE_NAM_DSET_GRD.  "SHOW GRID T" blew up.
+* V300: 2/93 - return unspecified if error exit (caught by f77 3.2)
+* V500 7/98 *sh* - allow case-sensitive variable names in single quotes 
+*      3/99 *sh* - disallow implicit grids (e.g. "Z[gz=zax]")
+* V532 5/01 *sh* - use EVAL_CONTEXT to get grid of expression
+* 1/03 *kob* g77 port requires risc buff for arbitrary string concats
+* v552: 4/03 *acm*  Increase length of variable names to 128 characters
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include 'xrisc_buff.cmn'
+
+* calling argument declarations:
+	INTEGER		dflt_cx, cx_expr, status
+	CHARACTER*(*)	lc_name
+
+* local variable declarations:
+	INTEGER		STR_UPCASE, TM_GET_GRIDNUM,
+     .			vax_code, grid
+	CHARACTER	name*128
+
+* change it to upper case
+	vax_code = STR_UPCASE( name, lc_name )
+
+* try to identify it first as a grid name
+	grid = TM_GET_GRIDNUM( name )
+	IF ( grid .NE. unspecified_int4 ) GOTO 1000
+	
+* prepare a clean context to work from
+	CALL INIT_EMPTY_CONTEXT(cx_buff)
+	cx_data_set( cx_buff ) = cx_data_set( cx_last )
+
+* get the grid for a variable or expression
+	CALL EVAL_CONTEXT ( cx_buff, lc_name, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	grid = cx_grid(is_cx(1))
+        cx_expr = is_cx(1)
+
+* success
+ 1000	GRID_FROM_NAME_XML = grid
+	status = ferr_ok
+	RETURN
+
+* error exit(s)
+ 5000	GRID_FROM_NAME_XML = unspecified_int4     ! added 2/93
+  	RETURN
+ 5100	risc_buff = lc_name
+	CALL ERRMSG(ferr_invalid_command, status,
+     .			'disallowed usage of '//risc_buff, *5000)
+
+	END
diff --git a/fer/utl/grid_subscript_extremes.F b/fer/utl/grid_subscript_extremes.F
new file mode 100644
index 0000000..63507a7
--- /dev/null
+++ b/fer/utl/grid_subscript_extremes.F
@@ -0,0 +1,88 @@
+	SUBROUTINE GRID_SUBSCRIPT_EXTREMES ( lo, hi, grid, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the extreme bounds of the indicated grid on the indicated axis
+* in SUBSCRIPT values
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/16/86
+* revision 0.1 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 0.2 - 2/6/89  - added modulo axes of arbitrary length
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	INTEGER	lo,hi
+
+* local variable declarations
+	INTEGER line_num
+
+	line_num = grid_line( idim, grid )
+
+	IF     ( line_num .EQ. mnormal  ) THEN
+
+	   lo = unspecified_int4
+	   hi = unspecified_int4
+
+	ELSEIF ( line_num .EQ. munknown ) THEN
+
+	   lo = unspecified_int4
+	   hi = unspecified_int4
+
+	ELSEIF ( line_modulo(line_num) ) THEN
+
+	   lo = arbitrary_small_int4
+	   hi = arbitrary_large_int4
+
+	ELSE
+
+	   lo = 1
+	   hi = line_dim(line_num)
+
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/utl/grid_subscript_extremes_no_mod.F b/fer/utl/grid_subscript_extremes_no_mod.F
new file mode 100644
index 0000000..5ac2a23
--- /dev/null
+++ b/fer/utl/grid_subscript_extremes_no_mod.F
@@ -0,0 +1,81 @@
+	SUBROUTINE GRID_SUBSCRIPT_EXTREMES_NO_MOD ( lo, hi, grid, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the extreme bounds of the indicated grid on the indicated axis
+* in SUBSCRIPT values
+* like GRID_SUBSCRIPT_EXTREMES but return actual length of modulo axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 12/99 *sh* - based on GRID_SUBSCRIPT_EXTREMES
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	INTEGER	lo,hi
+
+* local variable declarations
+	INTEGER line_num
+
+	line_num = grid_line( idim, grid )
+
+	IF     ( line_num .EQ. mnormal  ) THEN
+
+	   lo = unspecified_int4
+	   hi = unspecified_int4
+
+	ELSEIF ( line_num .EQ. munknown ) THEN
+
+	   lo = unspecified_int4
+	   hi = unspecified_int4
+
+	ELSE
+
+	   lo = 1
+	   hi = line_dim(line_num)
+
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/utl/grid_world_extremes.F b/fer/utl/grid_world_extremes.F
new file mode 100644
index 0000000..3cee85f
--- /dev/null
+++ b/fer/utl/grid_world_extremes.F
@@ -0,0 +1,103 @@
+	SUBROUTINE GRID_WORLD_EXTREMES ( lo, hi, grid, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the extreme bounds of the indicated grid on the indicated axis
+* in WORLD coordinates
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/16/86
+* revision 1.0 - 3/10/87  - changed to axis data stored in COMMON/~VARIABLES/
+*			    and changed time axis dependence
+* revision 1.1 - 2/18/88  - incorporated "regular" axes
+* revision 1.2 - 20/12/88 - incorporated new TM IO library (no box sizes)
+* revision 1.3 - 2/6/89   - added modulo axes of arbitrary length
+* Unix/RISC port - 7/91   - eliminated unneeded *variables common
+* V4.20 - 10/95 - remove references to line_mem to permit recursive line defs
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations
+	INTEGER	grid, idim
+	REAL*8	lo,hi
+
+* local variable declarations
+	INTEGER line_num, line_len
+	REAL*8	TM_WORLD
+
+	line_num = grid_line( idim, grid )
+	line_len = line_dim( line_num )
+
+	IF     ( line_num .EQ. mnormal  ) THEN
+
+	   lo = unspecified_val8
+	   hi = unspecified_val8
+
+	ELSEIF ( line_num .EQ. munknown ) THEN
+
+	   lo = arbitrary_small_val8
+	   hi = arbitrary_large_val8
+
+	ELSEIF ( line_modulo(line_num) ) THEN
+
+	   lo = arbitrary_small_val8
+	   hi = arbitrary_large_val8
+
+	ELSE
+
+	   IF ( line_regular( line_num ) ) THEN
+	      lo = line_start( line_num ) - line_delta( line_num )/2.
+	      hi = lo + line_delta( line_num ) * line_dim( line_num )
+
+	   ELSE
+* ... lo limit of bottom box; hi limit of top box
+	      lo = TM_WORLD(       1, grid, idim, box_lo_lim)
+	      hi = TM_WORLD(line_len, grid, idim, box_hi_lim)
+
+
+	   ENDIF
+
+	ENDIF
+
+	RETURN
+	END
+
diff --git a/fer/utl/heap2.F b/fer/utl/heap2.F
new file mode 100644
index 0000000..0c8e08c
--- /dev/null
+++ b/fer/utl/heap2.F
@@ -0,0 +1,111 @@
+      SUBROUTINE HEAP2 (RA, IB, BAD, N)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C  Ansley Manke
+C  From Numerical Recipes, Heapsort subroutine SORT2
+C  with change noted below for the case where N=1
+* V6.74 3/12 *acm* cleanup, add disclaimer
+
+      INTEGER N
+      REAL RA(*), IB(*), BAD
+
+      INTEGER L, IR, J, I, NGD
+      REAL RRA, IIB
+
+* From SHELLR
+* since the input array may be large but sparse, begin by sorting
+* the missing value flags to the end of the list
+
+      ngd = 0
+      DO j = 1, n
+         IF (RA(j) .NE. bad) THEN
+            ngd = ngd + 1
+            RA(ngd) = RA(j)
+            IB(ngd) = IB(j)
+          ENDIF 
+      END DO
+
+      DO j = ngd+1, n
+         RA(j) = bad
+         IB(j) = 0.0  ! just for house-keeping
+      END DO
+
+      L = NGD/2 + 1
+      IR = NGD
+
+      IF (NGD .LT. 1) RETURN
+
+   10 CONTINUE
+         IF (L .GT. 1) THEN
+            L = L - 1
+            RRA = RA(L)
+            IIB = IB(L)
+         ELSE
+            RRA = RA(IR)
+            IIB = IB(IR) 
+            RA(IR) = RA(1)
+            IB(IR) = IB(1)
+            IR = IR - 1
+            IF (IR .LE. 1) THEN	! *acm* Num Recipes has .EQ. here,
+				!       but this fails in the case where	
+				!       the loop starts with L=1
+               RA(1) = RRA
+               IB(1) = IIB
+               RETURN
+            ENDIF
+          ENDIF
+
+          I = L
+          J = L + L
+   20     IF (J .LE. IR) THEN
+             IF (J .LT. IR) THEN
+                IF (RA(J) .LT. RA(J+1)) J = J + 1
+             ENDIF
+             IF (RRA .LT. RA(J)) THEN
+                RA(I) = RA(J)
+                IB(I) = IB(J)
+                I = J
+                J = J + J
+             ELSE
+                J = IR + 1
+             ENDIF
+             GO TO 20
+          ENDIF
+
+          RA(I) = RRA
+          IB(I) = IIB
+      GO TO 10
+
+      END
diff --git a/fer/utl/heap2_v.F b/fer/utl/heap2_v.F
new file mode 100644
index 0000000..c3262e9
--- /dev/null
+++ b/fer/utl/heap2_v.F
@@ -0,0 +1,105 @@
+      SUBROUTINE HEAP2_V (RA, BAD, N)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C  Ansley Manke
+C  From Numerical Recipes, Heapsort subroutine SORT2
+C  with change noted below for the case where N=1
+* V6.74 3/12 *acm* cleanup, add disclaimer
+
+C Return only the data not the indices.
+
+      INTEGER N
+      REAL RA(*), BAD
+
+      INTEGER L, IR, J, I, NGD
+      REAL RRA
+
+* From SHELLR
+* since the input array may be large but sparse, begin by sorting
+* the missing value flags to the end of the list
+
+      ngd = 0
+      DO j = 1, n
+         IF (RA(j) .NE. bad) THEN
+            ngd = ngd + 1
+            RA(ngd) = RA(j)
+          ENDIF 
+      END DO
+
+      DO j = ngd+1, n
+         RA(j) = bad
+      END DO
+
+      L = NGD/2 + 1
+      IR = NGD
+
+      IF (NGD .LT. 1) RETURN
+
+   10 CONTINUE
+         IF (L .GT. 1) THEN
+            L = L - 1
+            RRA = RA(L)
+         ELSE
+            RRA = RA(IR)
+            RA(IR) = RA(1)
+            IR = IR - 1
+            IF (IR .LE. 1) THEN	! *acm* Num Recipes has .EQ. here,
+				!       but this fails in the case where	
+				!       the loop starts with L=1
+               RA(1) = RRA
+               RETURN
+            ENDIF
+          ENDIF
+
+          I = L
+          J = L + L
+   20     IF (J .LE. IR) THEN
+             IF (J .LT. IR) THEN
+                IF (RA(J) .LT. RA(J+1)) J = J + 1
+             ENDIF
+             IF (RRA .LT. RA(J)) THEN
+                RA(I) = RA(J)
+                I = J
+                J = J + J
+             ELSE
+                J = IR + 1
+             ENDIF
+             GO TO 20
+          ENDIF
+
+          RA(I) = RRA
+      GO TO 10
+
+      END
diff --git a/fer/utl/hunt_indices.F b/fer/utl/hunt_indices.F
new file mode 100644
index 0000000..df6494f
--- /dev/null
+++ b/fer/utl/hunt_indices.F
@@ -0,0 +1,217 @@
+	SUBROUTINE HUNT_INDICES (src, ksmin, ksmax,
+     .				 bad_src, targ,
+     .				 indices, coefs, kdmin, kdmax,
+     .				 kdlo_ok, kdhi_ok, ascnd )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+*       Note that the SRC array may be either ascending or descending order
+*       but the TARG array is always ascending
+
+* variable naming:
+*	's' refers to the source array -- the incoming list of values
+*	'd' refers to the destination arrays -- the outgoing indices and coefs
+*	min/max refer to the dimensioned limits of arrays
+*	_ok refers to to limits within which the arrays contain valid values
+
+* V690 *sh* 12/13 - derived from Ferret source routine HUNT_R4
+*             compute an entire array of indices and coefficient (frac)
+*             in a single call.  If exact match, insist on frac=1.0 case.
+*             IF reversed (.not.ascnd) return the index and coef for the
+*	      lower *coordinate value* point, not the lower index as before
+
+	include 'ferret.parm'
+
+	integer		ksmin, ksmax, kdmin, kdmax, indices(kdmin:kdmax),
+     .			kslo_ok,kshi_ok,ndx_lo,ndx_mid,ndx_hi,inc, k,
+     .			kdlo_ok, kdhi_ok
+
+	real		src(ksmin:ksmax),
+     .			targ(kdmin:kdmax), coefs(kdmin:kdmax),
+     .			bad_src, frac
+
+	logical		find_1st_ok, ascnd
+
+*******************************************************************************
+* initialize
+	kdlo_ok = kdmin
+	kdhi_ok = kdmax
+
+*       FIND A CONTIGUOUS BLOCK OF VALID VALUES IN THE src ARRAY
+	find_1st_ok = .TRUE.  ! here refers to the input values src
+	DO 50 k = ksmin, ksmax
+* ... skip invalid values at start of line
+	   IF ( find_1st_ok ) THEN
+	      IF (src(k) .EQ. bad_src) GOTO 50
+	      find_1st_ok = .FALSE.
+	      kslo_ok = k
+* ... terminate if invalid point encountered after valid points
+	   ELSEIF ( src(k) .EQ. bad_src ) THEN
+	      kshi_ok = k-1
+	      GOTO 60
+	   ENDIF
+ 50	CONTINUE
+	IF (find_1st_ok) THEN
+	   kdlo_ok = unspecified_int4    !  no input values to hunt among
+	   kdhi_ok = unspecified_int4
+	   RETURN
+	ELSE
+	   kshi_ok = ksmax
+	ENDIF
+
+*       DEGENERATE CASE? (ONLY A SINGLE POINT TO 'hunt' AMONG)
+ 60	IF (kshi_ok .EQ. kslo_ok) THEN
+	   DO 100 k = kdmin, kdmax
+	      indices(k) = kslo_ok
+	      IF (targ(k) .eq. src(kslo_ok)) THEN
+	         coefs  (k) = 1.0
+	         kdlo_ok = k
+	         kdhi_ok = k
+	      ELSE
+	         coefs  (k) = bad_val4
+	      ENDIF
+ 100	   CONTINUE
+	   RETURN
+	ENDIF
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = src(kshi_ok) .gt. src(kslo_ok)
+
+* set initial guess for index from array src
+	ndx_lo = kslo_ok
+	find_1st_ok = .TRUE.  ! now refers to the output coefs
+
+	DO 1000 k = kdmin, kdmax
+
+! this should never happen, givin the initialization value
+!*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+!	    if (ndx_lo .lt. kslo_ok .or. ndx_lo .gt. kshi_ok) then
+!	       ndx_lo = kslo_ok - 1
+!	       ndx_hi = kshi_ok + 1
+!	       goto 3
+!	    end if
+ 
+ 	    inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	   if (targ(k) .ge. src(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	      ndx_hi = ndx_lo + inc
+	      
+	      if (ndx_hi .gt. kshi_ok) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	         ndx_hi = kshi_ok + 1
+	      else if (targ(k) .gt. src(ndx_hi) .eqv. ascnd) then
+	         ndx_lo = ndx_hi
+	         inc    = inc + inc
+	         goto 1
+	      end if
+	   else
+*	   HUNT DOWN FOR PLACEMENT
+	      ndx_hi = ndx_lo
+2	      ndx_lo = ndx_hi - inc
+
+	      if (ndx_lo .lt. kslo_ok) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	         ndx_lo = kslo_ok - 1
+	      else if (targ(k) .lt. src(ndx_lo) .eqv. ascnd) then
+	         ndx_hi = ndx_lo
+	         inc = inc + inc
+	         goto 2
+	      end if	
+	   end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	   IF (ndx_hi - ndx_lo .eq. 1) THEN
+
+* return result -- including interpolation fraction
+
+	      IF (ndx_lo.GE.kslo_ok .AND. ndx_lo.LT.kshi_ok) THEN
+	         IF (targ(k) .EQ. src(ndx_lo)) THEN
+	            frac = 1.0
+	         ELSEIF (targ(k) .EQ. src(ndx_hi)) THEN
+	            ndx_lo = ndx_hi		! 11/13 addition
+	            frac = 1.0
+	         ELSEIF (.NOT.ascnd) THEN	! 12/13 adtn - reverse-ordered
+	            frac = (src(ndx_lo)-targ(k)) / (src(ndx_lo)-src(ndx_hi))
+	            ndx_lo = ndx_hi		! hi index is lo position
+	         ELSE
+	            frac = (src(ndx_hi)-targ(k)) / (src(ndx_hi)-src(ndx_lo))
+	         ENDIF
+	         find_1st_ok = .FALSE.
+	      ELSE    
+	         frac = bad_val4
+* ... the "ok" limits can include only valid coefficient values
+	         IF (find_1st_ok) THEN
+	            kdlo_ok = k + 1
+	         ELSE
+	            IF (k .LE. kdhi_ok) kdhi_ok = k - 1
+	         ENDIF
+	      ENDIF
+
+* store the result just found
+	      indices(k) = ndx_lo
+	      coefs(k) = frac
+
+	      GOTO 900
+	   ENDIF
+
+	   ndx_mid = (ndx_hi + ndx_lo)/2
+	   if (targ(k) .gt. src(ndx_mid) .eqv. ascnd) then
+	      ndx_lo = ndx_mid
+	   else
+	      ndx_hi = ndx_mid
+	   end if
+   
+   	   goto 3
+
+* prepare for next hunt
+ 900	   IF     (ndx_lo .LT. kslo_ok) THEN
+	      ndx_lo = kslo_ok
+	   ELSEIF (ndx_lo .GT. kshi_ok) THEN
+	      ndx_lo = kshi_ok
+	   ENDIF
+
+ 1000	CONTINUE
+
+	RETURN
+	end
diff --git a/fer/utl/hunt_r4.F b/fer/utl/hunt_r4.F
new file mode 100644
index 0000000..d5cdbf6
--- /dev/null
+++ b/fer/utl/hunt_r4.F
@@ -0,0 +1,126 @@
+	SUBROUTINE HUNT_R4 (x1,lo_dim,hi_dim,x2,ndx_lo, frac)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+* V450:  7/97 - new, cloned from double prec. version hunt.F
+*             - also return "frac" - the interpolation factor for ndx_lo 
+* V690 *sh* 11/13 - ensure that if exact match, the frac=1.0 case is always used
+
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real		x1(lo_dim:hi_dim),x2, frac
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(hi_dim) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+	   else if (x2 .gt. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	IF (ndx_hi - ndx_lo .eq. 1) THEN
+
+* return result -- including interpolation fraction
+
+	   IF (ndx_lo.GE.lo_dim .AND. ndx_lo.LT.hi_dim) THEN
+	      IF (x2 .EQ. x1(ndx_lo)) THEN
+	         frac = 1.0
+	      ELSEIF (x2 .EQ. x1(ndx_hi)) THEN
+	         ndx_lo = ndx_hi		! 11/13 addition
+	         frac = 1.0
+	      ELSE
+	         frac = (x1(ndx_hi)-x2) / (x1(ndx_hi)-x1(ndx_lo))
+	      ENDIF
+	   ELSE    
+	      frac = -999.0
+	   ENDIF
+	   return
+	ENDIF
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/fer/utl/igrid.F b/fer/utl/igrid.F
new file mode 100644
index 0000000..8a650e1
--- /dev/null
+++ b/fer/utl/igrid.F
@@ -0,0 +1,112 @@
+	INTEGER FUNCTION IGRID ( data_set, category, variable, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* find the defining grid for the given variable
+* if unknown - go get it
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/23/86
+* revision 0.6 - 11/22/88- new TM IO library var_gridber --> ds_grid_number
+* V200:   7/6/89 - most guts removed to KNOWN_GRID
+*	 8/29/89 - trap pseudo-variable grid requests
+*	 3/26/90 - improved error messages
+* V230:  7/21/92 - improved error message for unknown GFDL diagnostic var
+* V510:  8/99 *sh* - bug uncovered allowing DEFINE GRID/LIKE=user_var
+*		     if GET_UVAR_GRID is called the dset returned may be 0
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xalgebra.cmn'
+
+* calling argument declarations:
+	INTEGER	data_set, category, variable, status
+
+* internal variable declarations:
+	INTEGER	KNOWN_GRID, TM_LENSTR1, dset
+
+* only user variables have a status issue
+	status = ferr_ok
+
+* check for pseudo-variable
+	IF ( category .EQ. cat_pseudo_var ) CALL ERRMSG
+     .		( ferr_invalid_command, status,	'pseudo-variable '
+     .		//alg_pvar(variable)(:TM_LENSTR1(alg_pvar(variable)))
+     .		//' cannot be used this way',
+     .		*5000 )
+
+	IGRID = KNOWN_GRID( data_set, category, variable )
+
+	IF ( IGRID .NE. unspecified_int4 ) RETURN
+
+* grid unknown
+	IF ( category .EQ. cat_calc_var ) THEN
+	   CALL ERRMSG( ferr_invalid_command, status,
+     .		'unknown data set for GFDL diagnostic variable',
+     .          *5000 )
+	ELSEIF ( category .NE. cat_user_var ) THEN
+	   CALL ERRMSG( ferr_internal, status, 'IGRID', *5000 )
+	ENDIF
+
+* allow "abstract" expressions that don't depend on data set
+* Note (8/99): since GET_UVAR_GRID has not yet been called, we cannot assume
+*   that uvar_need_dset(variable) is known at this time. Recheck below. 
+	IF ( .NOT.uvar_need_dset(variable)
+     .	   .OR. data_set .EQ. unspecified_int4 ) THEN
+	   dset = pdset_irrelevant
+	ELSE
+	   dset = data_set
+	ENDIF
+
+	CALL GET_UVAR_GRID( variable, dset, status )
+
+* the variable definition may contain its data set info internally -- in which
+*  case, the dset to use is pdset_irrelevant
+	IF ( .NOT.uvar_need_dset(variable) )  dset = pdset_irrelevant
+
+	IGRID = uvar_grid( variable, dset )
+
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/inherit_attrs.F b/fer/utl/inherit_attrs.F
new file mode 100644
index 0000000..8174281
--- /dev/null
+++ b/fer/utl/inherit_attrs.F
@@ -0,0 +1,187 @@
+      SUBROUTINE INHERIT_ATTRS (varname1, varname2, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+* Get all attributes from varname1, a variable in dataset dset1, and assign to the 
+* variable in varname2, dataset dset2.  dset2 has been determined in xeq_set.F
+* V600  4/06 *acm*   attribute handling
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V670  2/11 *acm*   Fixes for inheriting attributes.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'errmsg.parm'      
+      INCLUDE 'xprog_state.cmn'
+      INCLUDE 'xvariables.cmn'
+      INCLUDE 'xcontext.cmn'
+
+* Argument declarations
+      CHARACTER varname1*(*), varname2*(*)
+      INTEGER status
+
+* Local variable declarations
+      LOGICAL coordvar
+      INTEGER TM_LENSTR, slen, tlen, dset1, dset2, 
+     .  varid1, varid2, vtype, nvdims, nvatts1, nvatts2,
+     .  vdims(8), iatt, first_quote, next_quote, dot, mr, cx, 
+     .  all_outflag, cat, iflag
+      CHARACTER*128 attname, buff1, buff2
+
+* Check that neither buffer contains varname.attname (If it is in 
+* quotations then the dot is part of the variable name.)
+
+      tlen = TM_LENSTR(varname1) 
+      first_quote = INDEX(varname1(1:tlen), "'" )
+      next_quote = INDEX(varname1(2:tlen), "'" )
+
+      IF (INDEX(varname1,'.') .NE. 0 ) THEN
+         dot = INDEX(varname1,'.')
+         IF (dot .GT. first_quote .AND. dot .LT. next_quote) GOTO 5010
+      ENDIF
+
+* and now for varname2
+      tlen = TM_LENSTR(varname2) 
+
+      first_quote = INDEX(varname2(1:tlen), "'" )
+      next_quote = INDEX(varname2(2:tlen), "'" )
+
+      IF (INDEX(varname2,'.') .NE. 0 ) THEN
+         dot = INDEX(varname2,'.')
+         IF (dot .GT. first_quote .AND. dot .LT. next_quote) GOTO 5010
+      ENDIF
+
+* Do the varnames contain dataset specifications?
+* evaluate the context without computing the expression to get the dataset
+
+      CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+      IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+      CALL EVAL_CONTEXT ( cx_cmnd, varname1, status )
+      IF ( status .NE. ferr_ok ) GOTO 5000
+
+      mr = is_mr( 1 )
+      cx = is_cx( 1 )
+
+      dset1 = cx_data_set(cx) 
+      IF (dset1 .EQ. pdset_irrelevant) dset1 = cx_data_set(cx_last) 
+
+      cat = cx_category(cx)
+      IF (cat .EQ. cat_user_var) dset1 = -1
+
+      CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+      IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+      CALL EVAL_CONTEXT ( cx_cmnd, varname2, status )
+      IF ( status .NE. ferr_ok ) GOTO 5000
+
+      mr = is_mr( 1 )
+      cx = is_cx( 1 )
+
+      dset2 = cx_data_set(cx) 
+      IF (dset2 .EQ. pdset_irrelevant) dset2 = cx_data_set(cx_last) 
+
+      cat = cx_category(cx)
+      IF (cat .EQ. cat_user_var) dset2 = -1
+
+* Get varid for each variable.
+      CALL CD_GET_VAR_ID (dset1, varname1, varid1, status)
+      IF (status .NE. ferr_ok) GOTO 5050
+      CALL CD_GET_VAR_ID (dset2, varname2, varid2, status)
+      IF (status .NE. ferr_ok) GOTO 5060
+
+* Get number of attributes for variables
+
+      CALL CD_GET_VAR_INFO (dset1, varid1, varname1, vtype, nvdims, vdims,
+     .       nvatts1, coordvar, all_outflag, status)
+      IF (coordvar) GOTO 5020
+
+      CALL CD_GET_VAR_INFO (dset2, varid2, varname2, vtype, nvdims, vdims,
+     .       nvatts2, coordvar, all_outflag, status)
+      IF (coordvar) GOTO 5020
+
+* Remove attributes from variable 2
+
+      DO 100 iatt = 1, nvatts2
+         CALL CD_GET_VAR_ATT_NAME (dset2, varid2, iatt, attname, status)
+         CALL CD_DELETE_ATTRIBUTE (dset2, varid2, attname, status)
+         IF (status .NE. ferr_ok) GOTO 5030
+ 100  CONTINUE
+
+* Get attribute information from variable 1 and put onto variable 2.
+* Do this in the c library so we dont have to define a fixed string for
+* string type attributes.
+
+      iflag = 1
+      DO 200 iatt = 1, nvatts1
+         CALL CD_TRANSFER_ATTRIBUTE (dset1, varid1, iatt, 
+     .        dset2, varid2, status)
+         IF (status .NE. ferr_ok) GOTO 5040
+         CALL CD_GET_VAR_ATT_NAME (dset1, varid1, iatt, attname, status)
+	 CALL CD_SET_ATT_FLAG (dset2, varid2, attname, iflag, status)
+ 200  CONTINUE
+
+* Update attribute information used by plotting etc (ds_units, ...)
+
+        CALL UPDATE_ATTRIBUTES (dset2, varid2)
+
+ 5000 RETURN
+
+ 5010 CALL ERRMSG( ferr_invalid_command, status,
+     .  'Use SET ATT/LIKE=var2 var1 without attribute names', *5000 )
+
+ 5020 CALL ERRMSG (ferr_invalid_command, status,
+     . 'Cannot inherit attributes to/from coordinate variables', *5000)
+
+ 5030 buff2 = varname2
+      CALL ERRMSG (ferr_internal, status,
+     . 'Error removing attributes from '//buff2(:tlen), *5000)
+
+ 5040  slen = TM_LENSTR(varname1)
+       buff1 = varname1
+       CALL ERRMSG (ferr_internal, status,
+     . 'Error transferring attributes from '//buff1(:slen)//' to '//
+     .  buff2(:tlen), *5000)
+
+ 5050  slen = TM_LENSTR(varname1)
+       buff1 = varname1
+       CALL ERRMSG (ferr_var_not_in_set, status,
+     . varname1(:slen),*5000)
+
+ 5060  slen = TM_LENSTR(varname1)
+       buff1 = varname1
+       CALL ERRMSG (ferr_var_not_in_set, status,
+     . varname1(:slen),*5000)
+
+      END
diff --git a/fer/utl/invalid_r8_to_i4.F b/fer/utl/invalid_r8_to_i4.F
new file mode 100644
index 0000000..dbb839c
--- /dev/null
+++ b/fer/utl/invalid_r8_to_i4.F
@@ -0,0 +1,64 @@
+	LOGICAL FUNCTION INVALID_R8_TO_I4 ( value )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if the given REAL*8 value is convertible to an INTEGER*4
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/17/86
+* V230:  6/26/92 - changed vax_machine.parm to accomodate limitations
+*                  of Macintosh Language Systems FORTRAN:  DBLE cannot be used
+*                  in a parameter definition
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'vax_machine.parm'
+
+
+	REAL*8	value
+
+* max and min INTEGER*4 expressed as REAL*8
+	REAL*8		test_neg
+	PARAMETER     ( test_neg = -( r8_int4_max + 1 ) )
+
+	INVALID_R8_TO_I4 = ( value .LT. test_neg )
+     .                .OR. ( value .GT. r8_int4_max )
+
+	RETURN
+	END
+	
diff --git a/fer/utl/is_template.F b/fer/utl/is_template.F
new file mode 100644
index 0000000..ba2fed0
--- /dev/null
+++ b/fer/utl/is_template.F
@@ -0,0 +1,54 @@
+	LOGICAL FUNCTION IS_TEMPLATE (string)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if the string is a template - i.e. it contains "*" or "?"
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420  4/18/96
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+* ...	
+
+	IS_TEMPLATE = INDEX(string,'*') .GT. 0
+     .		 .OR. INDEX(string,'?') .GT. 0
+	RETURN
+
+	END
diff --git a/fer/utl/isubscr_cx.F b/fer/utl/isubscr_cx.F
new file mode 100644
index 0000000..4fd7f64
--- /dev/null
+++ b/fer/utl/isubscr_cx.F
@@ -0,0 +1,289 @@
+	INTEGER FUNCTION ISUBSCR_CX ( world_coord, grid, idim, 
+     .                                cx ,round_code )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 9/97 *kob*   - NEW ROUTINE
+*              - needed in order to implement new method of handling negative
+*                time steps.  this routine is nearly identicle to ISUBSCRIPT 
+*                except it will use cx_calendar to determine if t dimension
+*                is a date or a time step.
+* V541: *sh* 2/02 - added support for subspan modulo axes
+* V600: *acm*6/06 - fix bug1419. for modulo axes, index at the end of the last 
+*                   cell may round up to the next modulo replication 
+* V600 *acm* 6/06 - fix declarations, found by solaris compiler
+* V612 *acm* 8/08 - Bug 1594. For 64-bit, when translating to within axis 
+*                   limits, the comparison IF (wcoord .GT. aend) yielded FALSE 
+*                   when in fact the coordinate values should be equal. Use 
+*                   TM_FFPEQ to test for equality first.
+* V673: *acm* 10/11 Bug 1888. Single-precision calculations in the block starting
+*                   * quick sol'n if axis points are regularly spaced
+*                   did not give enough accuracy for axes defined in terms of 
+*                   seconds.  Convert all this to double-precision calculations.
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+* V683: *acm* 10/12 Fix ticket 1973. If the coordinate value is on the boundary
+*                   of the grid cell, precicision could cause the wrong index 
+*                   to be returned.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+	include 'tmap_dims.parm'
+#      include "tmap_dset.parm"
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	grid, idim, round_code, cx
+	REAL*8	world_coord
+
+* internal variable declarations:
+	LOGICAL	TM_DFPEQ, TM_ITS_SUBSPAN_MODULO, TM_FPEQ_SNGL, 
+     .		is_regular, calendar
+	INTEGER	lo_look, hi_look, axis, ibot, itop, look,
+     .		line_len, isubsc, num_mod
+	REAL*8	SECS_TO_TSTEP, TM_WORLD, TM_WW_AXLEN,
+     .		wwindex, wcoord, half_way, start, aend, span, 
+     .		first, last, dsubsc
+	REAL*4  delsubsc, half
+
+* initialize
+        isubsc = 0
+
+* which axis are we on ?
+	axis    = grid_line ( idim, grid )
+	line_len = line_dim( axis )
+
+* check for peculiar calls
+	IF (  axis .EQ. mnormal
+     .	 .OR. axis .EQ. munknown ) THEN
+	   ISUBSCR_CX = axis
+	   RETURN
+	ELSEIF ( world_coord .EQ. unspecified_val8 ) THEN
+	   ISUBSCR_CX = unspecified_int4
+	   RETURN
+	ENDIF
+
+* time expressed as seconds since BC ?
+	calendar = (idim .EQ. t_dim .OR. idim .EQ. f_dim) .AND. cx_calendar(cx) 
+	IF (idim.EQ.f_dim .AND. (line_t0(axis) .EQ. char_init20)) calendar = .FALSE.
+
+	IF ( calendar ) THEN
+* no negative needeed on world_coord, because it is not being passed 
+* in as negative *kob*  9/97
+	   wcoord = SECS_TO_TSTEP( grid, idim, world_coord )
+	ELSE
+	   wcoord = world_coord
+	ENDIF
+
+* special consideration for sub-span modulo axis outside its core range
+	IF (TM_ITS_SUBSPAN_MODULO(axis) ) THEN
+	   CALL TM_WW_AX_1_N(axis, start, aend)
+	   IF ( wcoord.LT.start .OR. wcoord.GT.aend ) THEN
+	      line_len = line_len + 1
+	      is_regular = .FALSE.
+	   ELSE
+	      is_regular = line_regular( axis )
+	   ENDIF
+	ELSE
+	   is_regular = line_regular( axis )
+	ENDIF
+
+* initialize pointers for axes with irregularly spaced points
+	IF ( .NOT.is_regular ) THEN
+	   ibot  = 1
+	   itop  = line_len
+	ENDIF
+
+* Modulo axis: translate world coord to within axis range
+	IF ( line_modulo( axis ) ) THEN
+* ... begin by computing axis limits as outer edges of end boxes
+	   span = TM_WW_AXLEN(axis)
+	   CALL TM_WW_AXLIMS(axis, start, aend)
+	   IF (TM_ITS_SUBSPAN_MODULO(axis)) THEN
+	      span = line_modulo_len(axis)
+	      aend = start + span
+	   ENDIF
+
+* ... now translate to within axis limits saving modulo number
+
+           IF (.NOT.TM_DFPEQ(wcoord, aend) .AND. (wcoord .GT. aend)) THEN
+	      num_mod = ( wcoord - start ) / span
+! 10/92 bug fix: if wcoord is an exact multiple of length (e.g. wccord=24.
+!       start=0., span=12.) then modulo remap to top of ax rather than bottom
+              IF ( wcoord .EQ. start+num_mod*span )
+     .                          num_mod = num_mod - 1
+	   ELSEIF ( wcoord .LT. start ) THEN
+	      num_mod = ( wcoord - aend  ) / span		! (negative)
+	   ELSE
+	      num_mod = 0
+	   ENDIF
+	   wcoord = wcoord - num_mod*span
+	ENDIF
+
+* get positions of first and last points on axis
+        
+        IF ( is_regular ) THEN
+	   first = line_start( axis )
+	   last  = first + line_delta(axis) * (line_len-1) !4/94 was *line_len
+        ELSE
+           first = TM_WORLD(       1, grid, idim, box_middle)
+           last  = TM_WORLD(line_len, grid, idim, box_middle)
+	ENDIF
+
+* immediate solutions for given point beyond axis ends
+	IF ( wcoord .LE. first .AND. (.NOT.line_modulo(axis)) ) THEN
+	   isubsc = 1
+	ELSEIF ( wcoord .GE. last .AND. (.NOT.line_modulo(axis)) ) THEN
+	   isubsc = line_len
+
+* quick sol'n if axis points are regularly spaced
+* Fixing bug 1973 - See if the input was the box_lo or box_hi 
+* using a test, is the computed index location halfway between 
+* two integers, and if so return the correct index.
+
+	ELSEIF ( is_regular ) THEN
+	   dsubsc = (wcoord-first)/line_delta(axis)
+	   isubsc = INT( dsubsc )
+
+	   half_way = line_delta(axis)/2.
+	   half = 0.5
+
+	   IF ( round_code .EQ. round_up ) THEN
+	      delsubsc = ABS( REAL(dsubsc)-FLOAT(isubsc) )
+	      IF ( TM_FPEQ_SNGL(delsubsc, half) )
+     .         dsubsc = (wcoord+half_way-first)/line_delta(axis)
+	   ENDIF  
+	   IF ( round_code .EQ. round_dn ) THEN
+	      delsubsc = ABS( REAL(dsubsc)-FLOAT(isubsc) )
+	      IF ( TM_FPEQ_SNGL(delsubsc, half) )
+     .         dsubsc = (wcoord-half_way-first)/line_delta(axis)
+	   ENDIF  
+
+	   dsubsc = dsubsc + .5  ! to get the right result from INT()
+	   isubsc = INT( dsubsc )
+
+	   IF ( TM_DFPEQ(dsubsc,DBLE( isubsc )) ) THEN
+* ...... value is on box boundary
+	      IF     ( round_code .EQ. round_up ) THEN
+	         isubsc = isubsc + 1
+	      ELSEIF ( round_code .EQ. round_dn ) THEN
+	         CONTINUE
+	      ELSE
+	         STOP 'ISUBSCR_CX round code'
+	      ENDIF
+	   ELSE
+* ...... value is not on box boundary
+	      isubsc = isubsc + 1
+	   ENDIF
+
+	ELSE
+* binary search if axis points are irregularly spaced
+* initialize search
+	   lo_look  = ibot - 1
+	   hi_look  = itop + 1	
+	   look     = ( lo_look + hi_look ) / 2
+
+* top of search loop
+ 100       wwindex = TM_WORLD(look, grid, idim, box_middle)
+	   IF ( wcoord .GE. wwindex ) THEN
+
+* answer is somewhere above current "look" position
+* keep looking at higher values setting this as new low limit for search
+	      lo_look = look
+	      look = ( look + hi_look + 1 ) / 2
+
+	   ELSE
+* answer is somewhere below current "look" position
+* keep looking at lower values setting this as new high limit for search
+	      hi_look = look
+	      look = ( look + lo_look ) / 2
+
+	   ENDIF
+
+* have we narrowed it to a 1 point range ?
+	   IF ( hi_look - lo_look .LE. 1 ) THEN
+
+* yes - we found it - choose box containing it
+* ... box boundary between lo_look and hi_look
+	      half_way = TM_WORLD(hi_look, grid, idim, box_lo_lim)
+
+* value on box boundary ?
+	      IF ( TM_DFPEQ( half_way, wcoord ) ) THEN
+	         IF     ( round_code .EQ. round_up ) THEN
+		    isubsc = hi_look
+	         ELSEIF ( round_code .EQ. round_dn ) THEN
+		    isubsc = lo_look
+	         ELSE
+	            STOP 'ISUBSCR_CX round code'
+	         ENDIF
+
+* no. value in upper half of box ?
+	      ELSEIF ( wcoord .GE. half_way ) THEN
+	         isubsc = hi_look
+
+* no. value must be in lower half of box
+	      ELSE
+	         isubsc = lo_look
+
+	      ENDIF
+	   ELSE
+
+* no - keep looking
+	      GOTO 100
+	   ENDIF
+	ENDIF
+
+* add modulo axis correction
+	IF ( line_modulo(axis) ) THEN
+	   ISUBSCR_CX = isubsc + num_mod*line_len
+	ELSE
+	   ISUBSCR_CX = isubsc
+           IF (isubsc .GT. line_len) ISUBSCR_CX = line_len
+	ENDIF
+        
+* If still not found, apply quick solutions for given point beyond axis ends
+        IF (isubsc .EQ. 0) THEN
+	   IF ( wcoord .LE. first ) THEN
+	      ISUBSCR_CX = 1
+	   ELSEIF ( wcoord .GE. last) THEN
+	      ISUBSCR_CX = line_len
+	   ENDIF
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/isubscript.F b/fer/utl/isubscript.F
new file mode 100644
index 0000000..17480a5
--- /dev/null
+++ b/fer/utl/isubscript.F
@@ -0,0 +1,246 @@
+	INTEGER FUNCTION ISUBSCRIPT ( world_coord, grid, idim, round_code )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a "world" coordinate into the subscript value on an axis of the grid
+* box containing this value.  When the coordinate lies directly on the boundary
+* use round_code to resolve the ambiguity.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/16/86
+* revision 1.0 - 3/10/86 - grid lines stored in COMMON/~VARIABLES/
+* revision 1.2 - 3/23/87 - added new TMAP library: time axes, file var. names
+* revision 1.3 - 2/18/88 - incorporated "regular" axes; trapped "unspecified"
+*			    world coordinate input
+* revision 1.4 - 7/28/88 - interpret negative times as seconds since 1-JAN-0000
+* revision 1.5 -12/14/88 - incorporate new IO library with grid box lower bounds
+*			   instead of box sizes
+* revision 2.0 - 2/3/89  - incorporated modulo axes and reorganized
+* Unix/RISC port - 1/91 - cant use "/star" in comment lines on Unix
+*                  7/91 - eliminated unneeded common *variables and errmsg.parm
+*                 10/92 - bug fix for modulo axis point that lies exactly on a
+*                         multiple of the axis length (search "10/92")
+* V301: 2/7/94 - bug in calculation of "last"for regular axes.  This bug never
+*		 showed up in program behavior - possibly because
+*		 GRID_WORLD_EXTREMES is always called first (?)
+* V420: 10/95 - for axes which are children of others avoid direct use of
+*		line_mem -- instead use TM_WORLD
+*	 1/96 - bug fix: many references to sub0 remained despite 10/95 chgs
+* 9/97 *kob* - w/ negative time axis capablities, this routine will not have
+*	      to worry about date strings...
+* V541: *sh* 2/02 - added support for subspan modulo axes
+* V673: *acm* 10/11 Bug 1888. Single-precision calculations in the block starting
+*                   * quick sol'n if axis points are regularly spaced
+*                   did not give enough accuracy for axes defined in terms of 
+*                   seconds.  Convert all this to double-precision calculations.
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	grid, idim, round_code
+	REAL*8	world_coord
+
+* internal variable declarations:
+	LOGICAL	TM_DFPEQ, TM_ITS_SUBSPAN_MODULO, regular
+	INTEGER	lo_look, hi_look, axis, ibot, itop, look,
+     .		line_len, isubsc, num_mod
+	REAL*8	TM_WORLD, TM_WW_AXLEN, 
+     .		wwindex, wcoord, half_way, start, aend, span, 
+     .		first, last, dsubsc
+
+* which axis are we on ?
+	axis    = grid_line ( idim, grid )
+	line_len = line_dim( axis )
+
+* check for peculiar calls
+	IF (  axis .EQ. mnormal
+     .	 .OR. axis .EQ. munknown ) THEN
+	   ISUBSCRIPT = axis
+	   RETURN
+	ELSEIF ( world_coord .EQ. unspecified_val8 ) THEN
+	   ISUBSCRIPT = unspecified_int4
+	   RETURN
+	ENDIF
+
+	   wcoord = world_coord
+
+* special consideration for sub-span modulo axis outside its core range
+	IF (TM_ITS_SUBSPAN_MODULO(axis) ) THEN
+	   CALL TM_WW_AX_1_N(axis, start, aend)
+	   IF ( wcoord.LT.start .OR. wcoord.GT.aend ) THEN
+	      line_len = line_len + 1
+	      regular = .FALSE.
+	   ELSE
+	      regular = line_regular( axis )
+	   ENDIF
+	ELSE
+	   regular = line_regular( axis )
+	ENDIF
+
+* initialize pointers for axes with irregularly spaced points
+	IF ( .NOT.regular ) THEN
+	   ibot  = 1
+	   itop  = line_len
+	ENDIF
+
+* Modulo axis: translate world coord to within axis range
+	IF ( line_modulo( axis ) ) THEN
+* ... begin by computing axis limits as outer edges of end boxes
+	   span = TM_WW_AXLEN(axis)
+	   CALL TM_WW_AXLIMS(axis, start, aend)
+	   IF (TM_ITS_SUBSPAN_MODULO(axis)) THEN
+	      span = line_modulo_len(axis)
+	      aend = start + span
+	   ENDIF
+
+* ... now translate to within axis limits saving modulo number
+	   IF (.NOT.TM_DFPEQ(wcoord, aend) .AND. (wcoord .GT. aend)) THEN
+	      num_mod = ( wcoord - start ) / span
+! 10/92 bug fix: if wcoord is an exact multiple of length (e.g. wccord=24.
+!       start=0., span=12.) then modulo remap to top of ax rather than bottom
+              IF ( wcoord .EQ. start+num_mod*span )
+     .                          num_mod = num_mod - 1
+	   ELSEIF ( wcoord .LT. start ) THEN
+	      num_mod = ( wcoord - aend  ) / span		! (negative)
+	   ELSE
+	      num_mod = 0
+	   ENDIF
+	   wcoord = wcoord - num_mod*span
+	ENDIF
+
+* get positions of first and last points on axis
+	IF ( regular ) THEN
+	   first = line_start( axis )
+	   last  = first + line_delta(axis) * (line_len-1) !4/94 was *line_len
+        ELSE
+           first = TM_WORLD(       1, grid, idim, box_middle)
+           last  = TM_WORLD(line_len, grid, idim, box_middle)
+	ENDIF
+
+* immediate solutions for given point beyond axis ends
+	IF ( wcoord .LE. first ) THEN
+	   isubsc = 1
+	ELSEIF ( wcoord .GE. last) THEN
+	   isubsc = line_len
+
+* quick sol'n if axis points are regularly spaced
+	ELSEIF ( regular ) THEN
+	   dsubsc = (wcoord-first)/line_delta(axis) + .5
+	   isubsc = INT( dsubsc )
+	   IF ( TM_DFPEQ(dsubsc,DBLE( isubsc )) ) THEN
+* ...... value is on box boundary
+	      IF     ( round_code .EQ. round_up ) THEN
+	         isubsc = isubsc + 1
+	      ELSEIF ( round_code .EQ. round_dn ) THEN
+	         CONTINUE
+	      ELSE
+	         STOP 'ISUBSCRIPT round code'
+	      ENDIF
+	   ELSE
+* ...... value is not on box boundary
+	      isubsc = isubsc + 1
+	   ENDIF
+
+	ELSE
+* binary search if axis points are irregularly spaced
+* initialize search
+	   lo_look  = ibot - 1
+	   hi_look  = itop + 1	
+	   look     = ( lo_look + hi_look ) / 2
+
+* top of search loop
+ 100       wwindex = TM_WORLD(look, grid, idim, box_middle)
+	   IF ( wcoord .GE. wwindex ) THEN
+
+* answer is somewhere above current "look" position
+* keep looking at higher values setting this as new low limit for search
+	      lo_look = look
+	      look = ( look + hi_look + 1 ) / 2
+
+	   ELSE
+* answer is somewhere below current "look" position
+* keep looking at lower values setting this as new high limit for search
+	      hi_look = look
+	      look = ( look + lo_look ) / 2
+
+	   ENDIF
+
+* have we narrowed it to a 1 point range ?
+	   IF ( hi_look - lo_look .LE. 1 ) THEN
+
+* yes - we found it - choose box containing it
+* ... box boundary between lo_look and hi_look
+	      half_way = TM_WORLD(hi_look, grid, idim, box_lo_lim)
+
+* value on box boundary ?
+	      IF ( TM_DFPEQ( half_way, wcoord ) ) THEN
+	         IF     ( round_code .EQ. round_up ) THEN
+		    isubsc = hi_look
+	         ELSEIF ( round_code .EQ. round_dn ) THEN
+		    isubsc = lo_look
+	         ELSE
+	            STOP 'ISUBSCRIPT round code'
+	         ENDIF
+
+* no. value in upper half of box ?
+	      ELSEIF ( wcoord .GE. half_way ) THEN
+	         isubsc = hi_look
+
+* no. value must be in lower half of box
+	      ELSE
+	         isubsc = lo_look
+
+	      ENDIF
+	   ELSE
+
+* no - keep looking
+	      GOTO 100
+	   ENDIF
+	ENDIF
+
+* add modulo axis correction
+	IF ( line_modulo(axis) ) THEN
+	   ISUBSCRIPT = isubsc + num_mod*line_len
+	ELSE
+	   ISUBSCRIPT = isubsc
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_fill_trans.F b/fer/utl/itsa_fill_trans.F
new file mode 100644
index 0000000..cdd3d1b
--- /dev/null
+++ b/fer/utl/itsa_fill_trans.F
@@ -0,0 +1,56 @@
+	LOGICAL FUNCTION ITSA_FILL_TRANS( trans )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* is the indicated transformation a filler?
+
+* V450: 5/97
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations
+	INTEGER	trans
+
+* internal variable declarations
+
+	include 'ferret.parm'
+
+
+	ITSA_FILL_TRANS =    trans .EQ. trans_fill_ave
+     .			.OR. trans .EQ. trans_fill_interp
+     .			.OR. trans .EQ. trans_fill_near
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_gcvar.F b/fer/utl/itsa_gcvar.F
new file mode 100644
index 0000000..aecc437
--- /dev/null
+++ b/fer/utl/itsa_gcvar.F
@@ -0,0 +1,60 @@
+	LOGICAL FUNCTION ITSA_GCVAR( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* is the indicated variable one which is contains a grid changing function?
+
+* V450: 1/97
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER	uvar
+
+* internal variable declarations
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+
+* in reverse Polish order the final item of a grid changing variable will
+* always be a grid changing function
+
+	ITSA_GCVAR = uvar_item_type( uvar_num_items(uvar), uvar )
+     .		.EQ. alg_grid_chg_fcn
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_modulo_axis.F b/fer/utl/itsa_modulo_axis.F
new file mode 100644
index 0000000..c6ef09a
--- /dev/null
+++ b/fer/utl/itsa_modulo_axis.F
@@ -0,0 +1,63 @@
+	LOGICAL FUNCTION ITSA_MODULO_AXIS( cx, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular context grid axis is a modulo one
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+	INTEGER	cx, idim
+
+* internal variable declarations:
+	INTEGER axis
+
+	axis = grid_line(idim, cx_grid(cx))
+
+	ITSA_MODULO_AXIS = line_modulo(axis)
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_modulo_gcf.F b/fer/utl/itsa_modulo_gcf.F
new file mode 100644
index 0000000..dfb9532
--- /dev/null
+++ b/fer/utl/itsa_modulo_gcf.F
@@ -0,0 +1,81 @@
+	LOGICAL FUNCTION ITSA_MODULO_GCF( cx, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular axis of a grid changing variable should have
+* modulo applied to the RESULT of the function rather than to the arguments,
+* as is normal for non-GC uvars
+
+* This function ASSUMES that the passed context refers to a grid-changing uvar
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 2/97
+*       97.07.16 *jc* adding code to query external functions
+* V63  *acm* 10/09 Changes for gfortran build
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xgrid_chg_fcns.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, idim, axis_will_be(nferdims)
+
+* internal variable declarations:
+	INTEGER	 WHICH_GCFCN, gcfcn
+
+* get grid-changing function
+	gcfcn = WHICH_GCFCN( cx_variable(cx) )
+
+* get axis sources
+	IF ( gcfcn .GT. gfcn_num_internal ) THEN
+
+	   call efcn_get_axis_will_be(gcfcn, axis_will_be)
+	   ITSA_MODULO_GCF = axis_will_be(idim)
+     .	           .EQ. pgc_axis_supplied_herein 
+
+	ELSE
+
+	   ITSA_MODULO_GCF = gfcn_axis_will_be(idim,gcfcn)
+     .	           .EQ. pgc_axis_supplied_herein 
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_modulo_regrid.F b/fer/utl/itsa_modulo_regrid.F
new file mode 100644
index 0000000..f49a54c
--- /dev/null
+++ b/fer/utl/itsa_modulo_regrid.F
@@ -0,0 +1,61 @@
+	LOGICAL FUNCTION ITSA_MODULO_REGRID( cx, idim )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a particular regridding transformation is a modulo one
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+	INTEGER	cx, idim
+
+* internal variable declarations:
+
+	ITSA_MODULO_REGRID = cx_regrid_trans(idim,cx) .GE. prgrd_modulo
+     .		       .AND. cx_regrid_trans(idim,cx) .LE. prgrd_modmax
+
+	RETURN
+	END
diff --git a/fer/utl/itsa_pure_sum_var.F b/fer/utl/itsa_pure_sum_var.F
new file mode 100644
index 0000000..00cf302
--- /dev/null
+++ b/fer/utl/itsa_pure_sum_var.F
@@ -0,0 +1,126 @@
+	LOGICAL FUNCTION ITSA_PURE_SUM_VAR( uvar )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* is the indicated variable of the form a + b + c ?
+* Variables of this type may return a string result if all of the summands
+* are strings.
+
+
+* V533 *sh* 7/01
+* v554: 1/04 *acm* Counter variables for REPEAT/RANGE=/NAME=
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER	uvar
+
+* internal variable declarations
+	INTEGER i, i1, ii, itype
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+* This routine should never be called for GC vars -- it is to handle "legacy"
+* variables in Ferret.
+* Expressions like
+*      LET a = STRING_FUNCTION(c+d) + "b" + {"a","b","c"}
+* are acceptable because INIT_UVAR will have decomposed them and removed GC
+* function calls such as  STRING_FUNCTION(c+d).  The only function calls that
+* could remain would be numeric functions (e.g. SIN(x)). A uvar containing
+* a numeric function call is NOT "pure_sum"
+
+* Further "subleties" (aka hacks) added to support IF cond THEN "a" ELSE "b"
+* In this case the "cond" logic does not bear on the data type of the result
+* so we do not consider it in our search
+
+* initialize - start testinging after the "alg_then_marker" (if exists)
+* (probably will be buggy for nested IFs)
+	DO i1 =  1, uvar_num_items(uvar)
+	  itype = uvar_item_type(i1,uvar)
+	  IF ( itype .EQ. alg_then_marker ) GOTO 10
+	ENDDO
+	i1 = 1
+
+* test the "purity" of the expression
+ 10	DO 100 i = i1, uvar_num_items(uvar)
+
+	  itype = uvar_item_type(i,uvar)
+
+* constants and pseudo-variables are known to be numeric
+	  IF   ( itype .EQ. alg_constant   
+     .	  .OR.   itype .EQ. alg_pseudo_var 
+     .	  .OR.   itype .EQ. alg_counter_var ) THEN
+	     GOTO 1000
+
+	  ELSEIF (
+     .		 itype .EQ. alg_child_var   
+     .	  .OR.   itype .EQ. alg_variable   
+     .	  .OR.   itype .EQ. alg_grid_chg_fcn 
+     .	  .OR.   itype .EQ. alg_const_var
+     .	  .OR.   itype .EQ. alg_string    
+     .	  .OR.   itype .EQ. alg_attrib_val  ) THEN
+	     GOTO 100
+
+	  ELSEIF ( itype .EQ. alg_if_marker
+     .    .OR.     itype .EQ. alg_then_marker
+     .	      .OR. itype .EQ. alg_log_struct
+     .	      .OR. itype .EQ. alg_log_vstruct) THEN
+	     GOTO 100
+
+	  ELSEIF ( itype .EQ. alg_function  ) THEN
+	     GOTO 1000
+
+	  ELSEIF ( itype .EQ. alg_operator  ) THEN
+	     ii = uvar_item_start( i, uvar )
+	     IF ( uvar_text(uvar)(ii:ii).EQ.'+' ) THEN
+	       GOTO 100
+	     ELSE
+	       GOTO 1000
+	     ENDIF
+
+	  ELSE
+	     STOP 'unknown_alg_cat'
+	  ENDIF
+ 100	CONTINUE
+
+* yes
+	ITSA_PURE_SUM_VAR = .TRUE.
+	RETURN
+
+* no
+ 10000	ITSA_PURE_SUM_VAR = .FALSE.
+	RETURN
+
+	END
diff --git a/fer/utl/legal_chars.F b/fer/utl/legal_chars.F
new file mode 100644
index 0000000..4e49274
--- /dev/null
+++ b/fer/utl/legal_chars.F
@@ -0,0 +1,72 @@
+	CHARACTER*(*) FUNCTION LEGAL_CHARS( string, leg_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* remove all non-character (non-digit) data from a string - return final length
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/26/87
+
+* calling argument declarations
+	CHARACTER*(*)	string
+	INTEGER		leg_len
+
+* local variable declarations:
+	INTEGER TM_LENSTR, mlen, slen, s
+	CHARACTER char1*1
+
+* initialize
+	slen	= TM_LENSTR( string )
+	mlen	= LEN( LEGAL_CHARS )
+	leg_len	= 0
+
+* loop through input string character by character
+	DO 100 s = 1, slen
+	   char1 = string(s:s)
+	   IF ( char1 .GE. '0' .AND. char1 .LE. '9'
+     .	   .OR. char1 .GE. 'A' .AND. char1 .LE. 'Z'
+     .	   .OR. char1 .GE. 'a' .AND. char1 .LE. 'z' ) THEN
+	      leg_len = leg_len + 1
+	      LEGAL_CHARS( leg_len:leg_len ) = char1
+	      IF ( leg_len .EQ. mlen ) RETURN
+	   ENDIF
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/make_axis.F b/fer/utl/make_axis.F
new file mode 100644
index 0000000..f97624a
--- /dev/null
+++ b/fer/utl/make_axis.F
@@ -0,0 +1,67 @@
+	SUBROUTINE MAKE_AXIS( grid, idim, lo_ss, hi_ss, axis )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a REAL*4 array of world coordinates over a range of subscripts along
+* axis IDIM of grid GRID.  Begin the axis at subscript 1 of AXIS.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/20/88
+* revision 0.1 -11/28/88 - new TM IO library: WORLD --> TM_WORLD
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	grid, idim, lo_ss, hi_ss
+	REAL    axis(*)
+
+* internal variable declarations:
+	INTEGER	ito, i
+	REAL*8	TM_WORLD
+
+	ito = 0
+
+	DO 100 i = lo_ss, hi_ss
+	   ito = ito + 1
+	   axis(ito) = TM_WORLD( i, grid, idim, box_middle )
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/make_step_axis.F b/fer/utl/make_step_axis.F
new file mode 100644
index 0000000..e025c03
--- /dev/null
+++ b/fer/utl/make_step_axis.F
@@ -0,0 +1,85 @@
+	SUBROUTINE MAKE_STEP_AXIS( grid, idim, inc, lo_ss, hi_ss, axis )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a REAL*4 array of world coordinates over a range of subscripts along
+* axis IDIM of grid GRID.  Begin the axis at subscript 1 of AXIS.
+* If argument "inc" is 2 then output lo/hi limits for each point
+* If "inc" is 3 then do lo/hi limits and duplicate upper limit
+
+* programmer - steve hankin
+* V530 *sh* 1/01 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	grid, idim, inc, lo_ss, hi_ss
+	REAL    axis(*)
+
+* internal variable declarations:
+	INTEGER	ito, i
+	REAL*8	TM_WORLD
+
+	ito = 0
+
+	IF (inc .EQ. 1) THEN
+* make a simple axis - 1 output point per axis point
+	   DO i = lo_ss, hi_ss
+	      ito = ito + 1
+	      axis(ito) = TM_WORLD( i, grid, idim, box_middle )
+	   END DO
+
+	ELSEIF (inc .EQ. 2) THEN
+* make a 2-point "step" axis - output lo and hi points at each axis point
+	   DO i = lo_ss, hi_ss
+	      axis(ito+1) = TM_WORLD( i, grid, idim, box_lo_lim )
+	      axis(ito+2) = TM_WORLD( i, grid, idim, box_hi_lim )
+	      ito = ito + 2
+	   END DO
+
+	ELSE
+* make a 3-point "step" axis - lo then hi twice
+	   DO i = lo_ss, hi_ss
+	      axis(ito+1) = TM_WORLD( i, grid, idim, box_lo_lim )
+	      axis(ito+2) = TM_WORLD( i, grid, idim, box_hi_lim )
+	      axis(ito+3) = axis(ito+2)
+	      ito = ito + 3
+	   END DO
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/match4.F b/fer/utl/match4.F
new file mode 100644
index 0000000..e37a075
--- /dev/null
+++ b/fer/utl/match4.F
@@ -0,0 +1,85 @@
+	LOGICAL FUNCTION MATCH4 (test_string,len_test,model_string,len_model)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if test string is same as model string for as many characters
+* as it is given (to a max of 4)
+* model string must be all upper case - test string ignores case
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/24/86
+*
+* V5.80 *acm* 7/6/04 If either string is a single blank character, then
+*                    len_to_test = 0 and MATCH4 was set true for all values 
+*                    of the other string.  Check for lengths of zero.
+
+	INTEGER		TM_LENSTR, len_model, len_test, len_to_test, i
+
+	CHARACTER*1	UPPER_CASE
+	CHARACTER*4	model_string
+	CHARACTER*(*)	test_string
+        LOGICAL         result
+
+*	len_model = TM_LENSTR( model_string )
+*	len_test  = TM_LENSTR( test_string(1:LEN(test_string)) )
+
+* if model string is fewer than 4 characters the test string must not be longer
+	IF (      len_model .LT. 4
+     .	    .AND. len_test  .GT. len_model ) GOTO 200
+
+        IF (len_test .EQ. 0 .AND. len_model .NE. 0) GOTO 200 
+        IF (len_test .NE. 0 .AND. len_model .EQ. 0) GOTO 200 
+
+	len_to_test = MIN( len_test, len_model )
+
+*	DO 100 i = 1,len_to_test
+*	IF ( model_string(i:i) .NE. UPPER_CASE( test_string(i:i) ) ) GOTO 200
+* 100	CONTINUE
+        CALL tm_match_captial_name(test_string, model_string, 
+     .          len_to_test, result)
+
+        IF(.NOT.result) GOTO 200
+* it matches
+	MATCH4 = .TRUE.
+	RETURN
+
+* it doesn't match
+ 200	MATCH4 = .FALSE.
+	RETURN
+
+	END
diff --git a/fer/utl/match_name.F b/fer/utl/match_name.F
new file mode 100644
index 0000000..33c3021
--- /dev/null
+++ b/fer/utl/match_name.F
@@ -0,0 +1,81 @@
+	LOGICAL FUNCTION MATCH_NAME ( test_string, len_test, model_string, len_model_chars)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if test string is same as model string to full length of model
+* string
+* model string must be all upper case - test string ignores case
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/1/86
+* revision 0.1 - 12/9/86 - allowed model_string of arbitrary length
+* ywei  05/04 changed function prototype to allow speed up
+*              before calling this function, make sure
+*              len_test = TM_LENSTR(test_string)
+*              len_model_chars = TM_LENSTR(model_string)
+
+* calling argument declarations:
+	CHARACTER*(*)	model_string
+	CHARACTER*(*)	test_string
+        INTEGER         len_test
+        INTEGER         len_model_chars
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR, len_model, i
+        LOGICAL         result
+
+	len_model	= LEN( model_string )
+
+* test string cannot be shorter than model or longer than fully terminated model
+	IF (   len_test        .LT. len_model_chars
+     .	 .OR.( len_model_chars .LT. len_model		! fully terminated ?
+     .	 .AND. len_test	       .GT. len_model_chars )	) GOTO 200
+
+        CALL tm_match_captial_name(test_string, model_string, 
+     .          len_model_chars, result)
+
+        IF(.NOT.result) GOTO 200
+* it matches
+	MATCH_NAME = .TRUE.
+	RETURN
+
+* it doesn't match
+ 200	MATCH_NAME = .FALSE.
+	RETURN
+
+	END
diff --git a/fer/utl/match_quoted_name.F b/fer/utl/match_quoted_name.F
new file mode 100644
index 0000000..5bcabc8
--- /dev/null
+++ b/fer/utl/match_quoted_name.F
@@ -0,0 +1,100 @@
+	LOGICAL FUNCTION MATCH_QUOTED_NAME ( test_string, len_test, model_string, len_model_chars)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if test string is same as model string to full length of model
+* string
+* model string must be all upper case - test string ignores case
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/1/86
+* revision 0.1 - 12/9/86 - allowed model_string of arbitrary length
+* V495: 7/7/98 - *sh* if test name is in single quotes use case-sensitive comp.
+*     : 9/30/98 - NAG F90 (linux) received error on above change.  
+*                 need to put single  tick between double quotes  *kob*
+* ywei 05/04   changed function prototype to allow speed up
+*              before calling this function, make sure
+*              len_test = TM_LENSTR(test_string)
+*              len_model_chars = TM_LENSTR(model_string)
+
+* calling argument declarations:
+	CHARACTER*(*)	model_string
+	CHARACTER*(*)	test_string
+        INTEGER         len_test
+        INTEGER         len_model_chars
+
+* internal variable declarations:
+	LOGICAL         is_quoted
+	INTEGER		len_model, i, len_test1
+        LOGICAL         result
+
+	len_model	= LEN( model_string )
+
+* (7/98) is test string in quotations?
+
+	is_quoted = test_string(1:1) .EQ. "'" 
+	IF (is_quoted) is_quoted = test_string(len_test:len_test) .EQ. "'"
+	IF (is_quoted) THEN
+           len_test1 = len_test - 2
+        ELSE
+           len_test1 = len_test
+        ENDIF
+
+* test string cannot be shorter than model or longer than fully terminated model
+	IF (   len_test1        .LT. len_model_chars
+     .	 .OR.( len_model_chars .LT. len_model		! fully terminated ?
+     .	 .AND. len_test1       .GT. len_model_chars )	) GOTO 200
+
+
+	IF (is_quoted) THEN
+	   IF (model_string(1:len_model_chars) .NE. test_string(2:len_model_chars+1)) GOTO 200
+	ELSE
+           CALL tm_match_captial_name(test_string, model_string, 
+     .          len_model_chars, result)
+           IF(.NOT.result) GOTO 200	   
+	ENDIF
+
+* it matches
+	MATCH_QUOTED_NAME = .TRUE.
+	RETURN
+
+* it doesn't match
+ 200	MATCH_QUOTED_NAME = .FALSE.
+	RETURN
+
+	END
diff --git a/fer/utl/match_template.F b/fer/utl/match_template.F
new file mode 100644
index 0000000..9c9d5e2
--- /dev/null
+++ b/fer/utl/match_template.F
@@ -0,0 +1,134 @@
+	LOGICAL FUNCTION MATCH_TEMPLATE (name, template)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if the name matches the template
+* the template may contain
+*	"*" which matches 0 or more of any characters 
+*	"?" which match any single character
+
+* Note: this routine IS case sensitive so make sure to UPCASE strings as
+*	needed prior to calling this
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420  4/18/96
+
+* calling argument declarations:
+	CHARACTER*(*)	template
+	CHARACTER*(*)	name
+
+* internal variable declarations:
+	LOGICAL		star_skip, was_star_skip
+	INTEGER		TM_LENSTR1, in, it, nlen, tlen, instart
+	CHARACTER*1	ch
+
+* initialize
+	nlen	= TM_LENSTR1( name )
+	tlen	= TM_LENSTR1( template )
+	star_skip = .FALSE.
+	was_star_skip = .FALSE.
+
+* This lets us search for the template later in the
+* name string; fixes bug 1632.
+
+	instart = 0
+  600   CONTINUE
+        instart = instart + 1
+	IF (instart .GT. nlen) GOTO 1000
+
+	in = instart
+
+* LOOP through the characters of the template
+* (advance the char ptr for name, "in", as needed)
+	DO 500 it = 1, tlen
+
+	  ch = template(it:it)		! next character to match
+
+	  IF ( ch .EQ. '*' ) THEN
+	    star_skip = .TRUE.
+	    was_star_skip = .TRUE.	! search involves a star
+	    GOTO 500
+
+	  ELSEIF ( ch .EQ. '?' ) THEN
+	    IF ( star_skip ) THEN
+	      GOTO 500			! "*?" matches same as "*"
+	    ELSE
+	      GOTO 400
+	    ENDIF
+
+	  ELSEIF ( star_skip ) THEN
+	    DO 100 in = in, nlen
+	      IF ( name(in:in) .EQ. ch ) THEN
+	        star_skip = .FALSE.
+	        GOTO 400
+	      ENDIF
+ 100	    CONTINUE
+	    GOTO 1000			! no match for char after "*"
+
+	  ELSEIF ( in .GT. nlen ) THEN
+	    GOTO 1000			! no more name chars available
+
+	  ELSEIF ( ch .EQ. name(in:in) ) THEN
+	    GOTO 400
+
+	  ELSE
+	    IF (was_star_skip) THEN
+	       GOTO 600
+	    ELSE
+	       GOTO 1000
+	    ENDIF
+
+	  ENDIF
+
+* advance to next character of name
+ 400	  IF ( (it.EQ.tlen) ) THEN
+	    IF ( (in.NE.nlen) ) GOTO 1000  ! too many chars in name
+	  ENDIF
+	  in = in + 1
+
+ 500	CONTINUE
+
+* success - we've passed through the entire template with no error
+	MATCH_TEMPLATE = .TRUE.
+	RETURN
+
+* something doesn't match
+ 1000	MATCH_TEMPLATE = .FALSE.
+	RETURN
+
+	END
diff --git a/fer/utl/minmax.F b/fer/utl/minmax.F
new file mode 100644
index 0000000..9740d1d
--- /dev/null
+++ b/fer/utl/minmax.F
@@ -0,0 +1,70 @@
+	SUBROUTINE MINMAX( array, n, bad_flag, lo, hi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the minimum and maximum values within a REAL*4 array
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/20/88
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	n
+	REAL    array(n), bad_flag, lo, hi
+
+* internal variable declarations:
+	INTEGER	i
+
+* initialize
+	lo = arbitrary_large_val4
+	hi = arbitrary_small_val4
+
+* search
+	DO 100 i = 1, n
+
+	   IF ( array(i) .EQ. bad_flag ) GOTO 100
+	   IF ( array(i) .LT. lo ) lo = array(i)
+	   IF ( array(i) .GT. hi ) hi = array(i)
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/modulo_parity.F b/fer/utl/modulo_parity.F
new file mode 100644
index 0000000..ec9e1ca
--- /dev/null
+++ b/fer/utl/modulo_parity.F
@@ -0,0 +1,62 @@
+	INTEGER FUNCTION MODULO_PARITY(ss1, modlen, delta)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the "parity" that is associated with the starting subscript ss1
+* given a modulo length of lenmod and a stride value of delta
+* for example, if the modulo length is 10
+*	i=1:10:3  - parity = 1  ... ditto i=4:10:3
+*	i=2:10:3  - parity = 2  ... ditto i=5:10:3
+*	i=3:10:3  - parity = 3  ... ditto i=6:10:3
+* Although i=11 would seem to be parity=2, it is the starting index of the
+* next modulo replication so it is parity=1. i=12 is parity=2, etc.
+
+* V533: *sh* 6/01
+* V56: *acm* 3/04 Fix bugs that occur when ss1 is negative.
+
+* calling argument declarations
+	INTEGER	ss1, modlen, delta
+
+* internal variable declarations
+	INTEGER TM_MOD, nmod
+
+	nmod = (ss1-1)/modlen  ! number of modulo replications preceding ss1
+
+* Start at the bottom of the modulo replication preceding ss1
+        IF (ss1 .LT. 0 .AND. nmod*modlen .NE. ss1-1) nmod = nmod - 1
+
+	MODULO_PARITY = TM_MOD(ss1-1-(nmod*modlen), delta) + 1
+
+	RETURN
+	END
diff --git a/fer/utl/mult_grid.F b/fer/utl/mult_grid.F
new file mode 100644
index 0000000..d61d605
--- /dev/null
+++ b/fer/utl/mult_grid.F
@@ -0,0 +1,58 @@
+	SUBROUTINE MULT_GRID ( length, grid_data, factor )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* multiply a grid by a constant factor
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/23/86
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'ferret.parm'
+
+	INTEGER	length, i
+	REAL	grid_data( length ), factor
+	
+	DO 100 i = 1, length
+ 100	IF (  grid_data(i) .NE. bad_val4 )
+     .			grid_data(i) = grid_data(i) * factor
+
+	RETURN
+	END
+
diff --git a/fer/utl/ndig_coords.F b/fer/utl/ndig_coords.F
new file mode 100644
index 0000000..254f13e
--- /dev/null
+++ b/fer/utl/ndig_coords.F
@@ -0,0 +1,98 @@
+      SUBROUTINE NDIG_COORDS (grid, ax, lo, hi, del, bad_data, ndig, ndig_default)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Compute the number of digits needed to list the coordinates along
+* an axis with enough resolution to distinguish them.
+* Called by list_cmnd_data.F
+*
+* Ferret v5.80 9/02/2004  ACM
+* V600:  1/06 *acm*  prevent values of LOG10(0.0)
+
+      INCLUDE 'ferret.parm'
+
+* calling argument declarations
+      INTEGER grid, ax, lo, hi, del, ndig, ndig_default
+      REAL bad_data
+
+* Internal variable declarations
+      REAL*8 TM_WORLD, val8, val_last, diff_min, diff_ave, count
+      LOGICAL TM_DFPEQ
+      INTEGER i
+
+* Special formatting codes for time axes etc.
+
+      IF (ndig_default .LE. 0) THEN
+         ndig = ndig_default
+         RETURN
+      ENDIF
+
+* Get number of decimal places for formatting the coordinates
+
+      val_last = bad_data
+      diff_min = ABS(bad_data)
+      diff_ave = 0.D0
+      count = 0.
+
+* Find the smallest difference from one coordinate to the next.
+* also compute the average difference, in case two coordinates
+* are very close together.
+
+      DO 310 i = lo, hi, del
+         val8 = TM_WORLD( i, grid, ax, box_middle )
+
+         IF (val8 .NE. bad_data .AND. val_last .NE. bad_data) THEN
+            diff_min = MIN(diff_min, ABS(val8-val_last) )
+            diff_ave = diff_ave + ABS(val8-val_last)
+            count = count + 1
+         ENDIF
+
+         val_last = val8
+ 310  CONTINUE
+      
+      IF (count .GT. 0) THEN
+         diff_ave = diff_ave/count
+         IF ( TM_DFPEQ(diff_min,0.D0) ) diff_min = diff_ave
+         IF (diff_min .NE. 0) THEN 
+            ndig = 1 - INT(LOG10(diff_min))
+         ELSE
+            ndig = 1
+         ENDIF
+         ndig = MAX(ndig, ndig_default )
+      ELSE
+         ndig = ndig_default
+      ENDIF
+
+      RETURN
+      END
diff --git a/fer/utl/no_grid_range.F b/fer/utl/no_grid_range.F
new file mode 100644
index 0000000..add7e5e
--- /dev/null
+++ b/fer/utl/no_grid_range.F
@@ -0,0 +1,84 @@
+	LOGICAL FUNCTION NO_GRID_RANGE( grid, n, mg, val1 )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if all the data indicated are of the same value
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/2/88
+* V200:  5/19/89 - 4D symmetrical
+* V68    4/11  Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+
+* calling argument declarations:
+	INTEGER	n, mg
+	REAL 	val1, grid( n )
+
+* internal variable declarations:
+	INTEGER	i
+	REAL	bad_flag
+
+* initialize
+	bad_flag = mr_bad_data( mg )
+
+* comparison value (ends up as first non-bad value)
+	val1 = bad_flag
+
+* check all data within the indicated context
+	DO 100 i = 1, n
+	   IF ( grid(i) .NE. val1 ) THEN
+	      IF     ( val1       .EQ. bad_flag ) THEN
+	         val1 = grid(i)
+	      ELSEIF ( grid(i) .NE. bad_flag .OR. n.EQ.1 ) THEN
+	         NO_GRID_RANGE = .FALSE.
+	         RETURN
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+
+* they were all identical - val1=bad_flag if they were all bad
+	NO_GRID_RANGE = .TRUE.
+	RETURN
+	END
diff --git a/fer/utl/no_line_range.F b/fer/utl/no_line_range.F
new file mode 100644
index 0000000..ce1cfc7
--- /dev/null
+++ b/fer/utl/no_line_range.F
@@ -0,0 +1,77 @@
+	LOGICAL FUNCTION NO_LINE_RANGE( array, npts, bad_flag, val1 )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if all the data indicated are of the same value
+* if true val1=bad_flag if all points are bad-data flags
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/2/88
+* revision 0.1 - 9/22/88 - bug fix.  start at subscript 1
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	npts
+	REAL 	array( npts ), bad_flag, val1
+
+* internal variable declarations:
+	INTEGER	i
+
+* comparison value
+	val1 = bad_flag
+
+* check all data within the indicated context
+	DO 100 i = 1, npts
+	   IF ( array( i ) .NE. val1 ) THEN
+	      IF     ( val1       .EQ. bad_flag ) THEN
+	         val1 = array( i )
+	      ELSEIF ( array( i ) .NE. bad_flag ) THEN
+	         NO_LINE_RANGE = .FALSE.
+	         RETURN
+	      ENDIF
+	   ENDIF
+ 100	CONTINUE
+
+* they were all identical --> val1 contains bad_flag if they were all bad
+	NO_LINE_RANGE = .TRUE.
+
+	RETURN
+	END
diff --git a/fer/utl/open_show_file.F b/fer/utl/open_show_file.F
new file mode 100644
index 0000000..d4c6e0a
--- /dev/null
+++ b/fer/utl/open_show_file.F
@@ -0,0 +1,144 @@
+	SUBROUTINE OPEN_SHOW_FILE ( lun, sho_file,  
+     .                             clobber, append, status)
+
+
+	
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* OPEN the output file for SHOW xx/OUTFILE=  or MESSAGE/OUTFILE= 
+
+* programmer - Ansley Manke TMAP
+* 3/2010
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* Argument declarations:
+	LOGICAL clobber, append
+	INTEGER sho_file, lun, status
+
+* local parameter declarations:
+	LOGICAL fexist
+	INTEGER TM_LENSTR1, slen, flen
+	CHARACTER filename*2048, raw_name*2048, fformatted*12,
+     .            fstatus*8, faccess*12, fposition*12
+
+* set up the output device
+
+	fformatted = 'FORMATTED'
+* ... get full file name - from SHOW/OUTFILE= or from SET SHOW/OUTFILE
+	raw_name = ' '
+
+* ... sho_file is from qual_given(slash_show_axis_file) or
+*     qual_given(slash_show_data_file) etc.
+
+* preserve case of filename
+
+	CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(sho_file):qual_end(sho_file)),
+     .                  raw_name, status )
+
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( raw_name .EQ. ' ') THEN
+
+* ... use default from SET SHOW/outfile= command
+	   raw_name = show_file
+	   IF ( raw_name .EQ. ' ') GOTO 5100
+	ENDIF
+
+	slen = TM_LENSTR1(raw_name)
+	IF (slen .GT. 256 ) GOTO 5200
+	INQUIRE( FILE = raw_name, NAME = filename, EXIST = fexist )
+
+	flen = TM_LENSTR1( filename )
+
+	IF ( fexist ) THEN    
+	   IF ( append ) THEN
+
+#ifdef NO_ACCESS_APPEND
+	      faccess = 'SEQUENTIAL'
+#else
+	      faccess = 'APPEND'
+	      fposition = 'APPEND'
+#endif
+	      fstatus = 'OLD'
+	   ELSEIF ( clobber ) THEN
+	      faccess = 'SEQUENTIAL'
+	      fstatus = 'REPLACE'
+#ifdef F90_OPEN_FILE_CLOBBER
+	      fposition = 'ASIS'
+#endif
+	   ELSE
+	      GOTO 5050	 !attempt to clobber a file
+	   ENDIF
+	ELSE
+	   faccess = 'SEQUENTIAL'
+	   fstatus = 'NEW'
+	   fposition = 'asis'
+	ENDIF
+* ... open or create it
+
+	OPEN( UNIT	= default_list_lun,
+     .	      FILE	= raw_name,
+     .	      FORM	= fformatted,
+#ifdef F90_OPEN_FILE_APPEND
+     .	      POSITION    = fposition,
+#else
+     .	      ACCESS	= faccess,
+#endif
+     .	      STATUS	= fstatus,
+     .	      ERR		= 5010 )
+
+	lun = default_list_lun
+
+* error exit
+ 5000	RETURN
+ 
+ 5010	CALL ERRMSG( ferr_erreq,status,filename(:flen),*5000 )
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		'SHOW /FILE= what name?', *5000 )
+ 5050	CALL ERRMSG( ferr_invalid_command, status,
+     .			'/CLOBBER not specified and file exists: '
+     .			//raw_name, *5000 )
+ 5200	CALL ERRMSG( ferr_prog_limit, status,
+     .  'Cannot write to file w/ name longer than 256 characters: '//pCR//
+     .  'Limitation of Fortran INQUIRE and OPEN calls '	
+     .			, *5000 )
+
+	END
+
diff --git a/fer/utl/pack_line_storage.F b/fer/utl/pack_line_storage.F
new file mode 100644
index 0000000..d8d2188
--- /dev/null
+++ b/fer/utl/pack_line_storage.F
@@ -0,0 +1,110 @@
+
+	SUBROUTINE PACK_LINE_STORAGE (axis)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* For a line (axis) that has been deallocated, pack the coordinate memory array.
+
+* ACM 6/11/2002
+* V5.41 7/30/02 ACM Fix def of npoints. Also, move the pointer into 
+*                   line_mem array when the coordinates in line_mem have
+*                   been changed. 
+* V600 10/28/05 ACM Fix bug 1354: We were moving way more coord data than needed
+* V600 10/31/05 ACM Renamed from REMOVE_AXIS.F
+*                   
+
+* Parameters and commons
+
+	include	'tmap_dims.parm'
+#	include	"tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+        include 'ferret.parm'
+
+* Argument declaration
+
+        INTEGER axis
+
+* Local declarations
+	INTEGER  TM_GET_LINENUM, iaxis, imem, first_pt, last_pt, 
+     .           npoints, n_to_move, num_protected_axes
+
+	num_protected_axes = TM_GET_LINENUM( 'EZ' )  ! top protected axis
+
+        IF (num_protected_axes .EQ. unspecified_int4 .OR.
+     .      num_protected_axes .LE. 0) num_protected_axes = 1
+
+* First index in this line, number of points in line
+
+        first_pt = line_subsc1 ( axis )
+
+*  Recover space in line_mem array that defines point locations, box sizes.
+*  If this line is the last in the coordinate storage, move the pointer only.
+
+        IF (first_pt .NE. unspecified_int4  .AND. 
+     .      first_pt .NE. int4_init) THEN
+
+           npoints = 2*line_dim(axis) + 1
+           last_pt = first_pt + npoints
+
+           n_to_move = next_line_mem_pos - last_pt
+
+           IF (last_pt  .LT. next_line_mem_pos) THEN
+              DO 200 imem = 1, n_to_move 
+                 line_mem(first_pt+imem-1) = line_mem(last_pt+imem-1)
+  200         CONTINUE
+           ENDIF
+
+*  For all axes whose line_mem entries were moved, also move the pointer 
+*  into line_mem
+
+           DO 300 iaxis = num_protected_axes+1, line_ceiling 
+              IF ( (.NOT. line_regular(iaxis) ) .AND. 
+     .              (line_subsc1(iaxis) .NE. unspecified_int4) ) THEN
+
+                 IF (line_subsc1(iaxis) .GT. first_pt) 
+     .            line_subsc1(iaxis) = line_subsc1(iaxis) - npoints
+
+              ENDIF
+  300      CONTINUE
+  
+           line_subsc1(axis) = unspecified_int4
+
+           next_line_mem_pos = first_pt + n_to_move 
+
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/parse_nam_dset_grd.F b/fer/utl/parse_nam_dset_grd.F
new file mode 100644
index 0000000..8873f02
--- /dev/null
+++ b/fer/utl/parse_nam_dset_grd.F
@@ -0,0 +1,91 @@
+	SUBROUTINE PARSE_NAM_DSET_GRD( full_var_name, default_cx,
+     .				       dset, grid, cat, var, 
+     .				       made_impl_grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a full variable specification of the form:
+*			(eg.) TEMP[D=n,G=gname] (with optional region info)
+* return context information describing variable, data set and  grid
+* ... if necessary determine the grid in the process
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 7/27/88 - based on GET_VAR_CONTEXT and PARSE_VAR_NAME
+* revision 0.1 - 3/14/89 - check to see if default data set is known
+* V200:   8/9/89 - eliminated unknown data set error
+* V402: 7/95 - Allow nested [] of the form vname1[G=vname2[D=dset]]
+*	     - Guts of routine extracted to PARSE_NAM_DSET
+* V500 *sh* 3/99 - added argument made_impl_grid so calling program can
+*		   manage implicit grids (from GET_CONTEXT_MODS by "Z[gz=ax]")
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations:
+	LOGICAL		made_impl_grid
+	INTEGER		default_cx, dset, grid, cat, var, status
+	CHARACTER*(*)	full_var_name
+
+* internal variable declarations:
+	INTEGER		IGRID, mods_cx
+
+* most of the work extracted to this routine (7/95)
+	dset = unspecified_int4		! no prejudices ??? (7/95)
+	CALL PARSE_NAM_DSET( full_var_name, default_cx,
+     .			     dset, cat, var, mods_cx, status )
+
+* did we just create an implicit grid?
+	made_impl_grid = cx_has_impl_grid(mods_cx)
+
+* determine the defining grid
+* (although mods_cx has been deallocated nothing has over-written it yet)
+	IF ( var .NE. munknown_var_name ) THEN
+	   IF ( cx_unstand_grid( mods_cx ) ) THEN
+	      grid = cx_grid( mods_cx )
+	   ELSE
+	      grid = IGRID( dset, cat, var, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+	ENDIF
+
+* error exit
+ 5000	RETURN
+	END
diff --git a/fer/utl/parse_number_list.F b/fer/utl/parse_number_list.F
new file mode 100644
index 0000000..1401af5
--- /dev/null
+++ b/fer/utl/parse_number_list.F
@@ -0,0 +1,117 @@
+	SUBROUTINE PARSE_NUMBER_LIST( string, array, nmax, n, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* return an array of floating point values from a list of the form
+* "{ 1, 3,5,7, 9}"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500: *sh* 12/98
+*	   2/99 - bug fix - 2 commas together
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files. Add disclaimer.
+
+* calling argument declarations
+	INTEGER		nmax, n, status
+	REAL		array(nmax)
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	INTEGER 	comma_pos, last_comma_pos, slen
+	CHARACTER	buff*64
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* initialize
+	n = 0
+	slen	  = LEN( string )
+	last_comma_pos = 0
+
+* trim around the enclosing "{}" brackets
+	IF ( string(slen:slen) .EQ. '}' ) slen = slen - 1
+	IF ( string (1:1) .EQ. '{' ) last_comma_pos = 1
+	IF (last_comma_pos .GE. slen) GOTO 2000
+
+* loop through the comma list decoding and returning values
+ 100	CONTINUE
+	IF (last_comma_pos .GE. slen) THEN
+	   comma_pos = 0	! last item
+	ELSE
+	   comma_pos = INDEX( string(last_comma_pos+1:slen), ',' )
+	ENDIF
+	n = n + 1
+	If ( n .GT. nmax ) GOTO 5100   ! should never happen
+	IF ( comma_pos .EQ. 0 ) THEN
+*  ... last item in list
+	   IF (last_comma_pos .GE. slen) THEN
+	       array(n) = bad_val4			! comma as last item
+	   ELSE
+	      buff = string(last_comma_pos+1:slen)
+	      IF ( buff .EQ. ' ' ) THEN
+	         array(n) = bad_val4
+	      ELSE
+	         READ ( buff, *, ERR=5000 ) array(n)
+	      ENDIF
+	   ENDIF
+	   GOTO 1000
+	ELSEIF ( comma_pos .EQ. 1 ) THEN
+	   array(n) = bad_val4				! 2 commas together
+	ELSE
+* ... read another value
+	   buff = string(last_comma_pos+1:last_comma_pos+comma_pos-1)
+	   IF ( buff .EQ. ' ' ) THEN
+	      array(n) = bad_val4
+	   ELSE
+	      READ ( buff, *, ERR=5000 ) array(n)
+	   ENDIF
+	ENDIF
+	last_comma_pos = last_comma_pos + comma_pos
+	GOTO 100
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+
+* null brackets
+ 2000	n = 1
+	array(1) = bad_val4
+	GOTO 1000
+
+* syntax error
+ 4999	RETURN
+ 5000	CALL ERRMSG( ferr_syntax, status, string(last_comma_pos+1:),
+     .							*4999 )
+ 5100	CALL ERRMSG( ferr_internal, status, string, *4999 )
+	END
diff --git a/fer/utl/parse_string_list.F b/fer/utl/parse_string_list.F
new file mode 100644
index 0000000..3970bd1
--- /dev/null
+++ b/fer/utl/parse_string_list.F
@@ -0,0 +1,165 @@
+	SUBROUTINE PARSE_STRING_LIST( cx, string, mr, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* return an array of strings from a list of the form
+* { "string 1", "string 2", "string 3"}
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530: *sh*  8/00
+* V533: *sh*  7/01 - allow single quoted strings
+*		   - save null strings for missing values
+* V540:  9/01 *sh* - change "SYSTEM:" to "SPAWN:"
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an octal constant instead 
+* 2/07 *acm* - fix bug 1488; if the last item is a missing string, save that.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER		cx, mr, status
+	CHARACTER*(*)	string
+
+* internal variable declarations
+	LOGICAL		stored, in_quote, doub_quote, do_system_cmnd
+	INTEGER 	TM_LENSTR1, STR_CASE_BLIND_COMPARE,
+     .			i, n, nnew, spos, slen, str_start, vax_code, istat
+	CHARACTER	c*1
+
+* internal parameter declarations
+	CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xvariables.cmn'
+
+* initialize
+	n      = 1
+	spos   = 1
+	slen   = TM_LENSTR1( string )
+	stored    = .FALSE.
+	in_quote  = .FALSE.
+	do_system_cmnd = .FALSE.
+
+* trim around the enclosing "{}" brackets
+	IF ( string(slen:slen) .EQ. '}' ) slen = slen - 1
+
+* dont process trailing blanks
+        i = slen
+        DO WHILE ( string(i:i) .EQ. ' ' ) 
+           slen = slen - 1
+           i = i-1
+        ENDDO
+
+	IF ( string (1:1) .EQ. '{' ) spos = 2
+	IF ( spos .GE. slen ) GOTO 5000
+
+* loop through the text counting commas
+* (poor man's FORTRAN DO-WHILE loop)
+	i = spos - 1
+ 100	i = i + 1
+	   c = string(i:i)
+	   IF (in_quote) THEN
+#ifdef NO_DOUBLE_ESCAPE_SLASH
+              IF (c .EQ. '\') THEN
+#else
+              IF (c .EQ. '\\') THEN
+#endif
+	         i = i + 1   ! skip processing of next character 
+	      ELSEIF  (c .EQ. '"' .AND. doub_quote
+     .		 .OR.  c .EQ. "'" .AND. .NOT.doub_quote ) THEN
+* ... end of quotated string -- save the string
+	         in_quote = .FALSE.
+	         IF (str_start .LT. i) THEN
+	            IF ( do_system_cmnd ) THEN
+	               CALL STORE_SYS_STRINGS(string(str_start:i-1),
+     .					       cx, mr, n, nnew, status)
+	               n = n + nnew - 1
+	            ELSE
+	               CALL STORE_STRING(string(str_start:i-1),
+     .				         mr, n-1, status)
+	            ENDIF
+	         ELSE
+	            CALL SAVE_C_STRING(0,0,mr_c_pointer(mr),n-1,istat) ! NULL
+	         ENDIF
+	         IF (status .NE. ferr_ok) GOTO 5000
+	         stored = .TRUE.
+	         do_system_cmnd = .FALSE.
+	      ELSE
+	         CONTINUE   ! skip over anything inside of quotations
+	      ENDIF
+	   ELSEIF (c.EQ.'"' .OR. c.EQ."'") THEN
+	      IF (stored) GOTO 5000
+	      in_quote = .TRUE.
+	      doub_quote = c.EQ.'"'
+	      str_start = i + 1
+	   ELSEIF (c .EQ. ',') THEN
+	      IF (.NOT.stored) THEN
+	        CALL SAVE_C_STRING(0,0,mr_c_pointer(mr),n-1,istat) ! NULL
+	      ENDIF
+	      IF (i.EQ.slen) THEN     ! missing string at the end of the list
+	        CALL SAVE_C_STRING(0,0,mr_c_pointer(mr),n,istat) ! NULL
+	      ENDIF
+	      n = n+1
+	      stored = .FALSE.
+	      do_system_cmnd = .FALSE.
+	   ELSEIF (c.EQ.'s' .OR. c.EQ.'S' ) THEN
+	      IF ( i+6 .GT. slen ) GOTO 5000
+	      vax_code = STR_CASE_BLIND_COMPARE(string(i:i+5), 'SPAWN:')
+	      IF( vax_code .NE. vms_str_success ) GOTO 5000
+	      i = i + 5
+	      do_system_cmnd = .TRUE.
+	   ELSE
+	      IF (c .NE. ' '
+     .	    .AND. c .NE. tab ) GOTO 5000
+	   ENDIF
+	IF ( i .LT. slen ) GOTO 100
+	IF (in_quote) GOTO 5000
+
+* success
+ 1000	status = ferr_ok
+	RETURN
+
+* syntax error
+ 4999	RETURN
+ 5000	CALL ERRMSG( ferr_syntax, status, string(i:), *4999 )
+
+	END
diff --git a/fer/utl/permute.F b/fer/utl/permute.F
new file mode 100644
index 0000000..5a4230d
--- /dev/null
+++ b/fer/utl/permute.F
@@ -0,0 +1,98 @@
+	SUBROUTINE PERMUTE( src_cx, src, msrc, dst, mdst, perm )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* permute the 4D data from the source grid into the destination grid
+* - 24 possible permutations  (!4)  
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/31/89
+*	10/16/89 - modified array declarations using *_SUB call
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER src_cx, msrc, mdst, perm(nferdims)
+	REAL    src( * ),dst( * )
+
+* local variable declarations:
+	INTEGER  MGRID_SIZE
+
+	IF ( mr_type(msrc) .EQ. ptype_string ) THEN
+
+* ... set up the C pointer variable in the destination variable
+           CALL INIT_C_STRING_ARRAY( MGRID_SIZE(mdst),
+     .                               dst,
+     .                               mr_c_pointer(mdst)      )
+
+	   CALL PERMUTE_PTR_SUB (    src_cx, perm,
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst) )
+
+	ELSE	
+	   CALL PERMUTE_SUB (    src_cx, perm,
+     .			    src, mr_lo_s1(msrc), mr_hi_s1(msrc),
+     .				 mr_lo_s2(msrc), mr_hi_s2(msrc),
+     .				 mr_lo_s3(msrc), mr_hi_s3(msrc),
+     .				 mr_lo_s4(msrc), mr_hi_s4(msrc),
+     .				 mr_lo_s5(msrc), mr_hi_s5(msrc),
+     .				 mr_lo_s6(msrc), mr_hi_s6(msrc),
+     .			    dst, mr_lo_s1(mdst), mr_hi_s1(mdst),
+     .				 mr_lo_s2(mdst), mr_hi_s2(mdst),
+     .				 mr_lo_s3(mdst), mr_hi_s3(mdst),
+     .				 mr_lo_s4(mdst), mr_hi_s4(mdst),
+     .				 mr_lo_s5(mdst), mr_hi_s5(mdst),
+     .				 mr_lo_s6(mdst), mr_hi_s6(mdst)  )
+	ENDIF
+
+ 5000	RETURN
+	END 
diff --git a/fer/utl/permute_ptr_sub.F b/fer/utl/permute_ptr_sub.F
new file mode 100644
index 0000000..1a20124
--- /dev/null
+++ b/fer/utl/permute_ptr_sub.F
@@ -0,0 +1,98 @@
+	SUBROUTINE PERMUTE_PTR_SUB( src_cx, perm,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* permute the 4D data from the source grid into the destination grid
+* - 24 possible permutations  (!4)
+* note: can probably be done in a more condensed form using EQUIVALENCES and
+* perm to set up the loop indices. PERMUTE_SUB, likewise.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V533: 6/01 *sh*
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER src_cx, perm(nferdims),
+     .		slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL*8  src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	loi, loj, lok, lol, lom, lon, 
+     .		hii, hij, hik, hil, him, hin, 
+     .		i, j, k, l, m, n, idim
+	INTEGER	lo(nferdims), hi(nferdims), ii(nferdims)
+	EQUIVALENCE
+     .		(lo(1), loi), (hi(1), hii), (ii(1), i),
+     .		(lo(2), loj), (hi(2), hij), (ii(2), j),
+     .		(lo(3), lok), (hi(3), hik), (ii(3), k),
+     .		(lo(4), lol), (hi(4), hil), (ii(4), l),
+     .		(lo(5), lom), (hi(5), him), (ii(5), m),
+     .		(lo(6), lon), (hi(6), hin), (ii(6), n)
+
+* --- end of introductory code ---
+
+* initialize - save loop limits as unsubscripted variables
+	DO 100 idim = 1, nferdims
+	   lo(idim) = cx_lo_ss(src_cx,idim)
+	   hi(idim) = cx_hi_ss(src_cx,idim)
+ 100	CONTINUE
+
+	DO 200  n = lon, hin
+	DO 200  m = lom, him
+	DO 200  l = lol, hil
+	DO 200  k = lok, hik
+	DO 200  j = loj, hij
+	DO 200  i = loi, hii
+	   CALL COPY_C_STRING( src(i,j,k,l,m,n),
+     .		dst(ii(perm(1)),ii(perm(2)),ii(perm(3)),ii(perm(4)),
+     .		ii(perm(5)),ii(perm(6))))
+ 200	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/permute_sub.F b/fer/utl/permute_sub.F
new file mode 100644
index 0000000..662ecce
--- /dev/null
+++ b/fer/utl/permute_sub.F
@@ -0,0 +1,121 @@
+	SUBROUTINE PERMUTE_SUB( src_cx, perm,
+     .		src, slox, shix, sloy, shiy, sloz, shiz, 
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dst, dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* permute the 4D data from the source grid into the destination grid
+* - 24 possible permutations  (!4)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/16/89 - extracted from PERMUTE
+*	 3/16/90 - fixed bug: "src(i,j,l,k)" --> "src(i,j,k,l)"
+*
+* v541: 3/02 - *kob* need to replace ifdef 0 because IRIX preprocessor
+*                    didn't like it
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*	           restore code that was ifdef'd out due to a DEC compiler error
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER src_cx, perm(nferdims),
+     .		slox, shix, sloy, shiy, sloz, shiz,
+     .		slot, shit, sloe, shie, slof, shif,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+
+	REAL    src( slox:shix,sloy:shiy,sloz:shiz,slot:shit,sloe:shie,slof:shif ),
+     .		dst( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	loi, loj, lok, lol, lom, lon, hii, hij, 
+     .		hik, hil, him, hin, i, j, k, l, m, n, idim
+	INTEGER	lo(nferdims), hi(nferdims), ii(nferdims)
+	EQUIVALENCE
+     .		(lo(1), loi), (hi(1), hii),
+     .		(lo(2), loj), (hi(2), hij),
+     .		(lo(3), lok), (hi(3), hik),
+     .		(lo(4), lol), (hi(4), hil),
+     .		(lo(5), lom), (hi(5), him),
+     .		(lo(6), lon), (hi(6), hin)
+
+* local parameter declarations
+	INTEGER	i_ax, j_ax, k_ax, l_ax, m_ax, n_ax
+	PARAMETER  (i_ax=1, j_ax=2, k_ax=3, l_ax=4, m_ax=5, n_ax=6)
+
+* 1/00 *kob* -  the below code was used to upgrade permute_sub.F for
+*		v5.30.  However, a bug in the DEC optimizer caused the
+*		loop to be unrolled incorrectly, leading to improper
+*		results.  It's in included here so as not to lose it, 
+*		but stuck in an ifdef which shouldn't be accessed.
+* 3/12 * resurrect this code. Much simpler than the replacement code.
+
+	EQUIVALENCE
+     .		(ii(1), i),
+     .		(ii(2), j),
+     .		(ii(3), k),
+     .		(ii(4), l),
+     .		(ii(5), m),
+     .		(ii(6), n)
+
+* initialize - save loop limits as unsubscripted variables
+	DO 100 idim = 1, nferdims
+	   lo(idim) = cx_lo_ss(src_cx,idim)
+	   hi(idim) = cx_hi_ss(src_cx,idim)
+ 100	CONTINUE
+
+	DO 200  n = lon, hin
+	DO 200  m = lom, him
+	DO 200  l = lol, hil
+	DO 200  k = lok, hik
+	DO 200  j = loj, hij
+	DO 200  i = loi, hii
+	   dst(ii(perm(1)),ii(perm(2)),ii(perm(3)),ii(perm(4)),
+     .	       ii(perm(5)),ii(perm(6))) =
+     .		src(i,j,k,l,m,n)
+ 200	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/region_number.F b/fer/utl/region_number.F
new file mode 100644
index 0000000..212ba51
--- /dev/null
+++ b/fer/utl/region_number.F
@@ -0,0 +1,74 @@
+	INTEGER FUNCTION REGION_NUMBER( reg_name )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the named region
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	CHARACTER*(*)	reg_name
+
+* internal variable declarations:
+	INTEGER	STR_CASE_BLIND_COMPARE, ict, vax_code
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'gfdl_vms.parm'
+	include 'xcontext.cmn'
+* revision 0.0 - 6/25/86
+
+* search the predefined context names
+	DO 10 ict = 0, min_context, -1
+	   vax_code = STR_CASE_BLIND_COMPARE( reg_name, cx_name( ict ) )
+
+	   IF ( vax_code .EQ. vms_str_success ) THEN
+	      REGION_NUMBER = ict
+	      RETURN
+	   ENDIF
+
+ 10	CONTINUE
+
+* given region name doesn't match possible options
+	REGION_NUMBER = unspecified_int4
+	RETURN
+
+	END
diff --git a/fer/utl/regularly_spaced.F b/fer/utl/regularly_spaced.F
new file mode 100644
index 0000000..2224bb8
--- /dev/null
+++ b/fer/utl/regularly_spaced.F
@@ -0,0 +1,55 @@
+      LOGICAL FUNCTION REGULARLY_SPACED (ax, npts)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  ACM 12/4/02 Determine if an array is equally spaced.
+*              For shade_sub.F, disp_set_up.F
+
+      REAL ax(*), del1, del
+      INTEGER npts, i  
+      LOGICAL TM_FPEQ    
+
+      REGULARLY_SPACED = .TRUE.
+      del1 = ABS(ax(2) - ax(1))
+
+      DO 30 i = 2, npts - 1
+         del = ABS(ax(i+1) - ax(i))
+         IF (.NOT. TM_FPEQ(del, del1) ) GO TO 100
+   30 CONTINUE
+
+      RETURN
+
+  100 REGULARLY_SPACED = .FALSE.
+
+      RETURN
+      END
diff --git a/fer/utl/report_aux_dependency.F b/fer/utl/report_aux_dependency.F
new file mode 100644
index 0000000..1de4688
--- /dev/null
+++ b/fer/utl/report_aux_dependency.F
@@ -0,0 +1,90 @@
+	SUBROUTINE REPORT_AUX_DEPENDENCY
+     .		( cx, isp_stk_lev,  uvar, item, work, cx_status, desist )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* store a line describing a single variable of a dependency tree
+* this routine is identical to REPORT_DEPENDENCY except that it passes a special
+* flag to indicate that it is not a full-fledged dependency of definition.
+* The key difference is that the parent of the aux variable is not being *defined*
+* when this reference to the aux var occurs, so the check for recursive
+* definitions should not look further up the tree
+
+* for example, in
+*let depth = z[g=temp]+ 0*temp[k=1]
+*    LET tempz = temp[gz(depth)=zpts]
+*    VTREE=all
+*       TEMPZ = TEMP[GZ(DEPTH)=ZPTS]
+*         TEMP
+*           DEPTH = Z[G=TEMP]+ 0*TEMP[K=1]
+*             TEMP
+* The final line is an identical reference to TEMP repeated, but not a recursion
+
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V690  *sh* 11/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+
+* calling argument declarations:
+	LOGICAL desist
+	INTEGER cx, isp_stk_lev, uvar, item, cx_status, device
+	INTEGER	work(dependency_max_recs, dependency_nfields)
+
+* internal variable declarations
+	INTEGER	tree_level, its_aux
+
+	PARAMETER (its_aux = .TRUE.)
+
+* initialize
+	tree_level = isp_stk_lev - dependency_root_level
+
+* save the item in the dependency tree
+	CALL STORE_DEPENDENCY(its_aux, cx, tree_level,  uvar, item, cx_status,
+     .			work(1,1), work(1,2), work(1,3), work(1,4), 
+     .			work(1,5), work(1,6), work(1,7), work(1,8), desist )
+
+
+	RETURN
+	END
diff --git a/fer/utl/report_dependency.F b/fer/utl/report_dependency.F
new file mode 100644
index 0000000..a59d937
--- /dev/null
+++ b/fer/utl/report_dependency.F
@@ -0,0 +1,173 @@
+	SUBROUTINE REPORT_DEPENDENCY
+     .		( cx, isp_stk_lev,  uvar, item, work, cx_status, desist )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display a line describing a single variable of a dependency tree
+* with indentation to communicate tree structure
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685+  *sh* 9/13 
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+
+* calling argument declarations:
+	LOGICAL desist
+	INTEGER cx, isp_stk_lev, uvar, item, cx_status, device
+	INTEGER	work(dependency_max_recs, dependency_nfields)
+
+* internal variable declarations:
+	LOGICAL initialize, tell_dset, its_aux
+	INTEGER TM_LENSTR1, llen, cat, var, dset, blanks, 
+     .		istart, iend, len2, dnamlen
+	CHARACTER*1024 GET_UNIQUE_DSET_NAME, VAR_CODE, VAR_TITLE, line_buff,
+     .		dsetname
+
+	INTEGER tree_level
+
+	PARAMETER (its_aux = .FALSE.)
+
+* initialize
+	tree_level = isp_stk_lev - dependency_root_level
+
+! left as ifdef in case it is useful to turn this code on for future debugging
+# ifdef debug_dependency_tree
+	cat  = cx_category(cx)
+	var  = cx_variable(cx)
+	dset = cx_data_set(cx)
+	IF (dset .EQ. unspecified_int4) dset = pdset_irrelevant
+	line_buff = ' '
+	blanks = 2 * (tree_level-1)
+	initialize = tree_level .EQ. 1
+
+* announce the default dataset at the outset
+	IF (initialize .AND. dset .NE. pdset_irrelevant) THEN
+	   dsetname = GET_UNIQUE_DSET_NAME( dset )
+	   CALL SPLIT_LIST( pttmode_explct, show_lun, 
+     .		'   in default dataset '//dsetname, 0)
+	ENDIF
+
+* prepare the dataset name if it needs to be documented
+	tell_dset = dset .NE. pdset_irrelevant
+     .	      .AND. dset .NE. dependency_dflt_dset
+	IF ( tell_dset ) THEN
+	   dsetname = '[d='
+	   dsetname(4:) = GET_UNIQUE_DSET_NAME( dset )
+	   dnamlen = TM_LENSTR1(dsetname)
+	   dsetname(dnamlen:dnamlen) = ']'
+	ENDIF
+
+* document this variable
+	IF ( cx_status .EQ. ferr_unknown_variable ) THEN
+	   istart = uvar_item_start(item, uvar)
+	   iend   = uvar_item_end  (item, uvar)
+	   line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	   llen = (iend-istart+1) + blanks
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	   line_buff(llen+1:) = '   (unknown variable)'
+	ELSEIF ( cx_status .EQ. ferr_unknown_data_set ) THEN
+	   istart = uvar_item_start(item, uvar)
+	   iend   = uvar_item_end  (item, uvar)
+	   line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	   llen = (iend-istart+1) + blanks
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	   line_buff(llen+1:) = '   (unknown dataset)'
+	ELSEIF ( cx_status .EQ. ferr_unknown_auxvar ) THEN
+	   istart = uvar_item_start(item, uvar) + var - 1
+	   iend   = uvar_item_start(item, uvar) + cat - 1
+	   line_buff(blanks+1:) = uvar_text(uvar)(istart:iend)
+	   llen = (iend-istart+1) + blanks
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	   line_buff(llen+1:) = '   (unknown auxiliary variable)'
+	ELSEIF (cat .EQ. cat_user_var) THEN
+!	   line_buff(blanks+1:) = FULL_UVAR_NAME(var, llen)
+!	   llen = llen + blanks
+	   line_buff(blanks+1:) = VAR_CODE(cat, var)
+	   llen = TM_LENSTR1(line_buff)
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	   line_buff(llen+1:) = ' = ' //uvar_text(var)
+	ELSEIF (cat .EQ. cat_file_var
+     .	   .OR. cat .EQ. cat_aggregate_var ) THEN
+	   line_buff(blanks+1:) = VAR_CODE(cat, var)
+	   llen = TM_LENSTR1(line_buff)
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	ELSE
+* ... does this ever happen?
+	   line_buff(blanks+1:) = VAR_CODE(cat, var)
+	   llen = TM_LENSTR1(line_buff)
+	   IF (tell_dset) THEN
+	      line_buff(llen+1:) = dsetname
+	      llen = llen + dnamlen
+	   ENDIF
+	   line_buff(llen+1:) = ' = ' //VAR_TITLE( cat )
+	ENDIF
+
+	CALL SPLIT_LIST( pttmode_explct, show_lun, 
+     .		'   '//line_buff, 0)
+	    
+# endif
+
+* save the item in the dependency tree
+	CALL STORE_DEPENDENCY(its_aux, cx, tree_level,  uvar, item, cx_status,
+     .			work(1,1), work(1,2), work(1,3), work(1,4), 
+     .			work(1,5), work(1,6), work(1,7), work(1,8), desist )
+
+
+	RETURN
+	END
diff --git a/fer/utl/reset_secs_from_bc.F b/fer/utl/reset_secs_from_bc.F
new file mode 100644
index 0000000..2415c35
--- /dev/null
+++ b/fer/utl/reset_secs_from_bc.F
@@ -0,0 +1,83 @@
+	SUBROUTINE reset_secs_from_bc( tstep, new_tstep, 
+     .                                 old_cal_id, new_cal_id, 
+     .                                 status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a REAL*8 number giving the number of seconds since 1-JAN-0000:00:00
+* for tstep.  On input tstep is relative to calendar old_cal_id,
+* on output tstep is relative to the calendar indicated by new_cal_id
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 2/28/01
+* V5.53 *acm* 9/03 Set status flag to OK for case where calendar doesnt change
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* Calling argument declarations:
+	INTEGER		old_cal_id, new_cal_id, status
+	REAL*8		tstep, new_tstep
+
+* Local variable declarations:
+	INTEGER		year, month, day, hour, minute, second
+	REAL*8		TM_SECS_FROM_BC
+	CHARACTER*20	TM_SECS_TO_DATE, date
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+	IF (old_cal_id .EQ. new_cal_id ) THEN
+           new_tstep = tstep
+           status = ferr_ok
+        ELSE
+
+* Convert to date string
+	   date = TM_SECS_TO_DATE(tstep, old_cal_id)
+	   CALL TM_BREAK_DATE ( date, old_cal_id,
+     .			  year, month, day, hour, minute, second,
+     .			  status )
+	   IF (status .NE. ferr_ok) GO TO 9000
+
+* Find the offset from 01-JAN-0000 00:00:00 for this date and calendar
+
+	   new_tstep = TM_SECS_FROM_BC (new_cal_id, year, month, day,
+     .				     hour, minute, second, status)
+	ENDIF
+
+ 9000	RETURN
+	END
diff --git a/fer/utl/reverse_grid_axis.F b/fer/utl/reverse_grid_axis.F
new file mode 100644
index 0000000..58b3d25
--- /dev/null
+++ b/fer/utl/reverse_grid_axis.F
@@ -0,0 +1,89 @@
+	SUBROUTINE REVERSE_GRID_AXIS ( axis, cx, mr, dat )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* reverse the ordering of the data along the indicated axis
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V320:  2/16/95
+* V541:  2/02 *sh* - added support for delta strides
+* V560: 10/03 *acm* - fix bug 537, when use/order=x-y and strides, 
+*                     need to reset the indices to apply to the data
+*                     as it has been read, after the strides applied, 
+*                     e.g. reset 4:360:3 to 1:119:1
+* 560: *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+* 2/12 *acm* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER axis, cx, mr
+	REAL    dat( * )
+
+* local variable declarations
+	INTEGER idim, ilo(nferdims), ihi(nferdims), idel(nferdims)
+
+* get the delta values
+	DO idim = 1, nferdims
+	  ilo (idim) = cx_lo_ss(cx,idim)
+	  ihi (idim) = cx_hi_ss(cx,idim)
+	  IF (cx_delta(idim,cx) .EQ. unspecified_val8 ) THEN
+	    idel(idim) = 1
+	  ELSE
+	    idel(idim) = NINT(cx_delta(idim,cx))
+     
+c	    ihi(idim) = 1 + (ihi(idim) - ilo(idim)) / idel(idim)
+c	    ilo(idim) = 1
+	    ihi(idim) = ilo(idim) + (ihi(idim) - ilo(idim)) / idel(idim)
+            idel(idim) = 1
+
+	  ENDIF
+	ENDDO
+
+	CALL REVERSE_GRID_AXIS_SUB( axis, dat,
+     .				    ilo(axis), ihi(axis), idel(axis),
+     .			            ilo(1), ihi(1),
+     .			            ilo(2), ihi(2),
+     .			            ilo(3), ihi(3),
+     .			            ilo(4), ihi(4),
+     .			            ilo(5), ihi(5),
+     .			            ilo(6), ihi(6) )
+
+	RETURN
+	END 
diff --git a/fer/utl/reverse_grid_axis_sub.F b/fer/utl/reverse_grid_axis_sub.F
new file mode 100644
index 0000000..2fcc740
--- /dev/null
+++ b/fer/utl/reverse_grid_axis_sub.F
@@ -0,0 +1,133 @@
+	SUBROUTINE REVERSE_GRID_AXIS_SUB( axis, dat, ddlo, ddhi, ddel,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* reverse the grid indexing along the indicated axis
+* the passed indices are correct for the *result* of the reversal
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V320: 2/16/89
+* V541:  2/02 *sh* - added support for delta strides
+* 2/12 *acm* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER axis, ddlo, ddhi, ddel,
+     .		dlox, dhix, dloy, dhiy, dloz, dhiz, 
+     .		dlot, dhit, dloe, dhie, dlof, dhif
+	REAL    dat( dlox:dhix,dloy:dhiy,dloz:dhiz,dlot:dhit,dloe:dhie,dlof:dhif )
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n, turn_pt, hiplo
+	REAL tmp
+
+* --- end of introductory code ---
+
+* initialize
+	turn_pt = ddlo + (ddhi-ddlo-1)/2
+	hiplo = ddlo + ddhi
+
+* reverse the data along the appropriate axis
+
+	IF ( axis .EQ. x_dim ) THEN
+	   DO 100 n = dlof, dhif
+	   DO 100 m = dloe, dhie
+	   DO 100 l = dlot, dhit
+	   DO 100 k = dloz, dhiz
+	   DO 100 j = dloy, dhiy
+	   DO 100 i = dlox, turn_pt
+
+	      tmp = dat(i,j,k,l,m,n)
+	      dat(      i,j,k,l,m,n) = dat(hiplo-i,j,k,l,m,n)
+	      dat(hiplo-i,j,k,l,m,n) = tmp
+
+ 100	   CONTINUE
+
+	ELSEIF ( axis .EQ. y_dim ) THEN
+	   DO 200 n = dlof, dhif
+	   DO 200 m = dloe, dhie
+	   DO 200 l = dlot, dhit
+	   DO 200 k = dloz, dhiz
+	   DO 200 j = dloy, turn_pt
+	   DO 200 i = dlox, dhix
+
+	      tmp = dat(i,j,k,l,m,n)
+	      dat(i,      j,k,l,m,n) = dat(i,hiplo-j,k,l,m,n)
+	      dat(i,hiplo-j,k,l,m,n) = tmp
+
+ 200	   CONTINUE
+
+	ELSEIF ( axis .EQ. z_dim ) THEN
+	   DO 300 n = dlof, dhif
+	   DO 300 m = dloe, dhie
+	   DO 300 l = dlot, dhit
+	   DO 300 k = dloz, turn_pt
+	   DO 300 j = dloy, dhiy
+	   DO 300 i = dlox, dhix
+
+	      tmp = dat(i,j,k,l,m,n)
+	      dat(i,j,      k,l,m,n) = dat(i,j,hiplo-k,l,m,n)
+	      dat(i,j,hiplo-k,l,m,n) = tmp
+
+ 300	   CONTINUE
+
+	ELSEIF ( axis .EQ. t_dim ) THEN
+	   DO 400 n = dlof, dhif
+	   DO 400 m = dloe, dhie
+	   DO 400 l = dlot, turn_pt
+	   DO 400 k = dloz, dhiz
+	   DO 400 j = dloy, dhiy
+	   DO 400 i = dlox, dhix
+
+	      tmp = dat(i,j,k,l,m,n)
+	      dat(i,j,k,      l,m,n) = dat(i,j,k,hiplo-l,m,n)
+	      dat(i,j,k,hiplo-l,m,n) = tmp
+
+ 400	   CONTINUE
+* TODO: REVERSE_GRID_AXIS_SUB along E and F axes?
+
+* ALONG UNSUPPORTED AXIS
+        ELSE
+           STOP '**ERROR: REVERSE_GRID_AXIS_SUB on an unsupported axis'
+        ENDIF
+
+	RETURN
+	END 
+
+
diff --git a/fer/utl/secs_from_bc.F b/fer/utl/secs_from_bc.F
new file mode 100644
index 0000000..bad1546
--- /dev/null
+++ b/fer/utl/secs_from_bc.F
@@ -0,0 +1,82 @@
+	REAL*8 FUNCTION SECS_FROM_BC( date, cal_id, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return a REAL*8 number giving the number of seconds since 1-JAN-0000:00:00
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 4/7/88
+* revision 0.1 1/18/89 - BREAK_DATE --> TM_BREAK_DATE
+* V300: 2/93 - return **something** even if error exit (caught by f77 3.2)
+* V530: *acm* 12/00 add calendar types; cal_id
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* Calling argument declarations:
+	INTEGER		cal_id, status
+	CHARACTER*(*)	date
+
+* Local variable declarations:
+	INTEGER		year, month, day, hour, minute, second
+	REAL*8		TM_SECS_FROM_BC
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+
+* Break up the date string to it's various components
+
+	CALL TM_BREAK_DATE ( date, cal_id,
+     .			  year, month, day, hour, minute, second,
+     .			  status )
+	IF ( status .NE. ferr_ok ) THEN
+           SECS_FROM_BC = -999
+           RETURN               ! err not reported
+        ENDIF
+
+* Find the offset from 01-JAN-0000 00:00:00 for this date and calendar
+	SECS_FROM_BC = TM_SECS_FROM_BC (cal_id, year, month, day,
+     .				     hour, minute, second, status)
+
+	IF ( status .NE. ferr_ok ) THEN
+           SECS_FROM_BC = -999
+           RETURN               ! err not reported
+        ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/secs_to_date.F b/fer/utl/secs_to_date.F
new file mode 100644
index 0000000..bd8dfb2
--- /dev/null
+++ b/fer/utl/secs_to_date.F
@@ -0,0 +1,72 @@
+	CHARACTER*(*) FUNCTION SECS_TO_DATE ( num_secs, cal_id )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Convert secs since 01-JAN-0000 00:00:00 to a date of the form
+* $_-mm-dd hh:mm:ss
+* difference from TM_SECS_TO_DATE: if year=0 or 1 then blank year field 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - code pulled from TM_SECS_TO_DATE
+* revision 1.0 - 2/22/89 - calls TM_SECS_TO_DATE
+* V530: *acm* 12/00 add calendar types; cal_id
+
+* Calling argument declarations:
+	REAL*8		num_secs
+	INTEGER		cal_id
+
+* internal variable declarations
+	INTEGER		year
+	CHARACTER	TM_SECS_TO_DATE*20, temp_str*20
+
+* convert to date string always including year
+	temp_str = TM_SECS_TO_DATE( num_secs, cal_id )
+
+* determine year from dd-mmm-$_:hh:mm:ss
+	READ ( temp_str, '(7X,I4)', ERR=5000 ) year
+
+* blank out year if 0000 or 0001
+	IF ( year .LE. 1 ) temp_str(7:11) = ' '
+
+* done
+	SECS_TO_DATE = temp_str
+	RETURN
+
+* internal error
+ 5000	STOP 'SECS_TO_DATE'
+	END
diff --git a/fer/utl/secs_to_date_c.F b/fer/utl/secs_to_date_c.F
new file mode 100644
index 0000000..43572b2
--- /dev/null
+++ b/fer/utl/secs_to_date_c.F
@@ -0,0 +1,76 @@
+	SUBROUTINE secs_to_date_c( bcsecs, hdate )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* C-callable routine to convert the number of seconds since BC to a date string
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* v5.33 *acm* SECS_TO_DATE needs arg cal_id. Use Gregorian - these calls
+*             are used in converting today's date for labels, etc.  See
+*             gui/Utility.c and gui/JC_Utility.c
+
+* V400: 11/94 
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	REAL*8 bcsecs
+#ifdef sun
+        BYTE hdate(*)
+#else
+        INTEGER*1 hdate(*)
+#endif
+
+* local variable declarations
+	INTEGER	  TM_LENSTR1, slen, cal_id
+	CHARACTER SECS_TO_DATE*20, temp_str*20
+
+	cal_id = 1	! Gregorian (default) calendar
+
+* do the conversion using FORTRAN CHARACTER variables
+	temp_str = SECS_TO_DATE(bcsecs, cal_id)
+
+* now convert the result into a C string
+	slen = TM_LENSTR1( temp_str )
+	CALL TM_FTOC_STRNG( temp_str, hdate, slen )
+
+	RETURN
+	END
+
diff --git a/fer/utl/secs_to_date_out.F b/fer/utl/secs_to_date_out.F
new file mode 100644
index 0000000..074345a
--- /dev/null
+++ b/fer/utl/secs_to_date_out.F
@@ -0,0 +1,149 @@
+	CHARACTER*(*) FUNCTION SECS_TO_DATE_OUT ( num_secs, cal_id, 
+     .            modulo, prec )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Convert secs since 01-JAN-0000 00:00:00 to a date of the form
+* yyyy-mm-dd hh:mm:ss
+* difference from TM_SECS_TO_DATE: if year=0 or 1 then blank year field 
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - code pulled from TM_SECS_TO_DATE
+* revision 1.0 - 2/22/89 - calls TM_SECS_TO_DATE
+* V530: *acm* 12/00 add calendar types; cal_id
+* V610: *acm*  2/08 Fix bug 762: if the axis is not modulo, always list the
+*                   year (previously never listed year 0 or year 1)
+
+* Calling argument declarations:
+	REAL*8		num_secs
+	INTEGER		cal_id, prec
+
+* internal variable declarations
+        LOGICAL         modulo
+	INTEGER		year, month, day, hour, minute, second, status
+	CHARACTER	TM_SECS_TO_DATE*20, temp_str*20
+        CHARACTER*3     month_names(12)
+        DATA month_names/
+     .	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+* convert to date string always including year
+	temp_str = TM_SECS_TO_DATE( num_secs, cal_id )
+        CALL TM_BREAK_DATE (temp_str, cal_id, year, month, day,
+     .		             hour, minute, second, status)
+
+* Select the requested precision and form the string.  If year = 0000 
+* or 0001 and the axis is modulo, do not write the year
+
+	IF ( prec .GE. 6 ) THEN		! full precision
+
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1000,ERR=5000) day, month_names(month), 
+     .               year, hour, minute, second
+           ELSE
+              WRITE (temp_str,1010,ERR=5000) day, month_names(month), 
+     .               hour, minute, second
+           ENDIF
+
+1000       FORMAT(I2.2,'-',A3,'-',I4.4,' ',2(I2.2,':'),I2.2)
+1010	   FORMAT(I2.2,'-',A3,' ',2(I2.2,':'),I2.2)
+
+
+	ELSEIF ( prec .EQ. 5 ) THEN	! dd-mmm-yyyy hh:mm
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1020,ERR=5000) day, month_names(month), 
+     .               year, hour, minute
+           ELSE
+              WRITE (temp_str,1030,ERR=5000) day, month_names(month), 
+     .               hour, minute
+
+           ENDIF
+1020       FORMAT(I2.2,'-',A3,'-',I4.4,' ',I2.2,':',I2.2)
+1030	   FORMAT(I2.2,'-',A3,' ',I2.2,':',I2.2)
+
+	ELSEIF ( prec .EQ. 4 ) THEN	! dd-mmm-yyyy hh
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1040,ERR=5000) day, month_names(month), 
+     .               year, hour
+           ELSE
+              WRITE (temp_str,1050,ERR=5000) day, month_names(month), 
+     .               hour
+
+           ENDIF
+1040       FORMAT(I2.2,'-',A3,'-',I4.4,' ',I2.2)
+1050	   FORMAT(I2.2,'-',A3,' ',I2.2)
+
+	ELSEIF ( prec .EQ. 3 ) THEN	! dd-mmm-yyyy
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1060,ERR=5000) day, month_names(month), 
+     .               year
+           ELSE
+              WRITE (temp_str,1070,ERR=5000) day, month_names(month)
+
+           ENDIF
+1060       FORMAT(I2.2,'-',A3,'-',I4.4)
+1070	   FORMAT(I2.2,'-',A3)
+
+	ELSEIF ( prec .EQ. 2 ) THEN	! mmm-yyyy
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1080,ERR=5000) month_names(month), year
+           ELSE
+              WRITE (temp_str,1090,ERR=5000) month_names(month)
+
+           ENDIF
+1080       FORMAT(A3,'-',I4.4)
+1090	   FORMAT(A3)
+
+	ELSE				! yyyy
+	   IF (year .GT. 1 .OR. .NOT.modulo) THEN
+              WRITE (temp_str,1100,ERR=5000) year
+           ELSE
+              temp_str = ' '
+
+           ENDIF
+1100       FORMAT(I4.4)
+	ENDIF
+
+* done
+        SECS_TO_DATE_OUT = temp_str
+	RETURN
+
+* internal error
+ 5000	STOP 'SECS_TO_DATE'
+	END
+
diff --git a/fer/utl/secs_to_tstep.F b/fer/utl/secs_to_tstep.F
new file mode 100644
index 0000000..6e18a96
--- /dev/null
+++ b/fer/utl/secs_to_tstep.F
@@ -0,0 +1,89 @@
+	DOUBLE PRECISION FUNCTION SECS_TO_TSTEP( grid, idim, secs )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert an absolute time measured in seconds from 1-JAN-0000:00:00:00
+* into a time step value relevant on a particular grid, "grid"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/27/88
+* V530: *acm* 12/00 add calendar types; cal_id
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. The time 
+*                  dimension is now an arg to SECS_TO_TSTEP.
+
+	include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+        include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	grid, idim
+	REAL*8	secs
+
+* internal variable declarations:
+	INTEGER		TM_GET_CALENDAR_ID, axis, cal_id, status
+	CHARACTER*20	date
+	REAL*8		SECS_FROM_BC, bc_to_t0
+
+* determine time axis of grid
+	axis = grid_line( idim, grid )
+
+* valid time axis ?
+	IF ( line_direction( axis ) .EQ. 'TI' .OR. 
+     .       line_direction( axis ) .EQ. 'FI' ) THEN
+
+* get calendar type
+
+	   cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+
+* seconds from BC to start of time axis
+	   bc_to_t0 = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* convert to units used on this time axis
+	   SECS_TO_TSTEP = ( secs - bc_to_t0 ) / line_tunit(axis)
+
+	ELSE
+
+* not a valid time axis
+	   SECS_TO_TSTEP = secs		! no conversion possible
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/utl/set_auto_curvi_modes.F b/fer/utl/set_auto_curvi_modes.F
new file mode 100644
index 0000000..d40ae54
--- /dev/null
+++ b/fer/utl/set_auto_curvi_modes.F
@@ -0,0 +1,73 @@
+	SUBROUTINE SET_AUTO_CURVI_MODES( auto_auxvar_changed )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* process /CURVILINEAR qualifiers from all commands
+
+* *sh* 12/13
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include	'slash.parm'
+	include 'xcommand.cmn'
+	include 'xprog_state.cmn'
+
+* internal variable declarations
+	LOGICAL	auto_auxvar_changed
+
+
+* TEMPORARY PLACE_HOLDER CODE.
+*  will need to support /CURVI qualifiers on many commands
+
+	mode_auto_curvi_last = mode_auto_curvi
+	mode_auto_curvi  = mode_state(pmode_curvilinear,1)
+     .		  .OR. (  (cmnd_num .EQ. cmnd_list)
+     .	             .AND. qual_given(slash_list_curvi).GT.0 )
+
+	mode_auto_sigma_last = mode_auto_sigma
+	mode_auto_sigma = mode_state(pmode_sigma,1)
+     .		  .OR. (  (cmnd_num .EQ. cmnd_list)
+     .	             .AND. qual_given(slash_list_sigma).GT.0 )
+
+
+	auto_auxvar_changed =
+     .	     mode_auto_curvi .NEQV. mode_auto_curvi_last
+     . .OR.  mode_auto_sigma .NEQV. mode_auto_sigma_last
+
+
+	RETURN
+	END
diff --git a/fer/utl/shellr.F b/fer/utl/shellr.F
new file mode 100644
index 0000000..1598d3b
--- /dev/null
+++ b/fer/utl/shellr.F
@@ -0,0 +1,86 @@
+      SUBROUTINE SHELLR(SDAT, IDAT, BAD, N)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*from http://www.cs.mcgill.ca/~ratzer/progs15_6.html  23-APR-1998
+*  Gerald Ratzer, McGill school of Computer Science, McGill University,
+*  Montreal, Quebec, Canada
+
+* Changed data to REAL. Added IDAT, to sort along with SDAT.  
+* Removed NCOUNTS, NCOMP, NSWAP.
+
+* V530 *sh* - based on SHELL (also in Ferret)
+* optimized for missing value flags in input (sort to end of list)
+
+
+
+      REAL     SDAT(*),IDAT(*), BAD, tmp
+      INTEGER  N, M
+      INTEGER  I, J, ngd
+
+* since the input array may be large but sparse, begin by sorting
+* the missing value flags to the end of the list
+        ngd = 0
+        DO j = 1, n
+           IF (sdat(j) .NE. bad) THEN
+              ngd = ngd + 1
+              sdat(ngd) = sdat(j)
+              idat(ngd) = idat(j)
+           ENDIF 
+        END DO
+
+        DO j = ngd+1, n
+           sdat(j) = bad
+           idat(j) = 0.0  ! just for house-keeping
+        END DO
+
+* now sort only the valid (non-BAD) inputs
+      M=ngd
+      DO WHILE (M .gt. 1)
+         M=(M+2)/3
+         DO I=M+1,ngd
+            DO J=I,M+1,-M
+               IF (SDAT(J-M).GE. SDAT(J)) THEN
+                 tmp = sdat(j)
+                 sdat(j) = sdat(j-m)
+                 sdat(j-m) = tmp
+                 tmp = idat(j)
+                 idat(j) = idat(j-m)
+                 idat(j-m) = tmp
+               ENDIF
+            END DO 
+         END DO 
+      END DO
+      RETURN
+      END
+
diff --git a/fer/utl/short_mod_copy.F b/fer/utl/short_mod_copy.F
new file mode 100644
index 0000000..abba080
--- /dev/null
+++ b/fer/utl/short_mod_copy.F
@@ -0,0 +1,184 @@
+	SUBROUTINE SHORT_MOD_COPY( memory, res_lo, res_hi, idim,
+     .				   tcom_cx, tcom_mr, res_cx, res_mr)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* copy into the result over the range lo:hi from the component data
+* the range lo:hi is assumed to be not more than Nmod points
+
+* copying takes place in 2 stages ... with possible voids before,between,
+* and after.
+
+* the "t" in tcom_cx and tcom_mr refer to the fact that these are temporary
+* information -- they may be modified
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420: 11/95 - to accomodate modulo stripped on the main INTERP_STACK
+*	12/95 - fixed bug for negative subscripts
+* V533: *sh* 6/01 - added logic to cope with strides
+* V541: *sh*  2/02 - support for subspan modulo axes
+*	See NOTE in code below
+* 560: *acm* 4/04 - stride/modulo fixes: use NINT to convert REAL*8 to integer
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xprog_state.cmn'
+	include	'xtext_info.cmn'
+
+* calling argument declarations:
+	INTEGER	res_lo, res_hi, idim, tcom_cx, tcom_mr, res_cx, res_mr
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	INTEGER CAXIS_MODLEN, MODULO_PARITY,
+     .		npts, com_lo, com_hi, com_nshf, res_nshf,
+     .		nshift, xlate, uplim, idel,
+     .		cx_lo_sav, cx_hi_sav, mr_lo_sav, mr_hi_sav
+
+
+* --- end of introductory code ---
+
+* The diagram below illustrates the component and result regions relative
+* to the modulo axis replications
+
+* |++++++++|--------|--------|--------|--------|   <-- replicated modulo axis
+*                |--------|			   <-- component received
+*                                 |-----|	   <-- result requested
+
+* The copy takes place in two steps.
+
+* Step 1: The component is shifted so that the start of the result
+*	  region lies within the component span (if possible)
+*	  As much data as is possible contiguously is then copied
+* |++++++++|--------|--------|--------|--------|   <-- replicated modulo axis
+*                         |--------|		   <-- shifted component
+*                                 |-----|	   <-- result requested
+
+* Step 2: The component is shifted so that the start of the component
+*	  region lies within the result span (if possible)
+*	  As much data as is possible contiguously is then copied
+* |++++++++|--------|--------|--------|--------|   <-- replicated modulo axis
+*                                  |--------|	   <-- shifted component
+*                                 |-----|	   <-- result requested
+
+* save to restore at end
+	cx_lo_sav = cx_lo_ss(tcom_cx, idim)
+	cx_hi_sav = cx_hi_ss(tcom_cx, idim)
+	mr_lo_sav = mr_lo_ss(tcom_mr, idim)
+	mr_hi_sav = mr_hi_ss(tcom_mr, idim)
+
+* initialize
+	npts = CAXIS_MODLEN( idim, tcom_cx )	! length of modulo axis
+	com_lo = cx_lo_ss(tcom_cx, idim)
+	com_hi = MIN( cx_hi_ss(tcom_cx,idim), com_lo+npts-1 )	
+	IF (cx_delta(idim,res_cx) .EQ. unspecified_val8) THEN
+	   idel = 1
+	ELSE
+	   idel = NINT(cx_delta(idim,res_cx))
+	ENDIF
+
+* initialize the modulo shifting
+	IF ( com_lo .GT. 0 ) THEN
+	   com_nshf = (com_lo - 1) / npts
+	ELSE
+	   com_nshf = (com_lo / npts ) - 1
+	ENDIF
+	IF ( res_lo .GT. 0 ) THEN
+	   res_nshf = (res_lo - 1) / npts
+	ELSE
+	   res_nshf = (res_lo / npts) - 1
+	ENDIF
+	nshift = res_nshf - com_nshf
+
+* STEP 1
+* shift component so the start of the result lies within the component range
+	xlate = npts * nshift
+	IF ( res_lo.GT.com_hi+xlate ) xlate = xlate - npts
+	IF ( res_lo.LT.com_lo+xlate ) xlate = xlate + npts
+	IF ( res_lo.GE.com_lo+xlate .AND. res_lo.LE.com_hi+xlate ) THEN
+* ... copy the region (if the parity matches)
+	   uplim = MIN( res_hi, com_hi+xlate )
+	   cx_lo_ss(tcom_cx, idim) = res_lo
+	   cx_hi_ss(tcom_cx, idim) = uplim
+	   mr_lo_ss(tcom_mr, idim) = mr_lo_sav + xlate
+	   mr_hi_ss(tcom_mr, idim) = mr_hi_sav + xlate
+	   IF ( MODULO_PARITY(cx_lo_sav,             npts,idel)
+     .	   .EQ. MODULO_PARITY(cx_lo_ss(tcom_cx,idim),npts,idel) ) THEN
+	      CALL COPY_INTO( memory(1,mr_blk1(tcom_mr)), tcom_mr,
+     .			      tcom_cx,
+     .			      memory(1,mr_blk1(res_mr)), res_mr )
+	   ENDIF
+* NOTE:  it is KNOWN that sometimes this routine needlessle copies the same
+*	 region of component into the same region of result at both STEP 1
+*	 and STEP 2.  This has not been debugged because the consequences
+*	 are negligible (*sh* 11/02)
+	   IF (uplim .EQ. res_hi) GOTO 1000	! STEP 2 not needed
+	ENDIF
+
+* STEP 2
+* shift component so the start of the component lies within the result range
+	xlate = npts * nshift
+	IF ( com_lo+xlate.GT.res_hi ) xlate = xlate - npts
+	IF ( com_lo+xlate.LT.res_lo ) xlate = xlate + npts
+	IF ( com_lo+xlate.GE.res_lo .AND. com_lo+xlate.LE.res_hi ) THEN
+* ... copy the region
+	   uplim = MIN( res_hi, com_hi+xlate )
+	   cx_lo_ss(tcom_cx, idim) = com_lo + xlate
+	   cx_hi_ss(tcom_cx, idim) = uplim
+	   mr_lo_ss(tcom_mr, idim) = mr_lo_sav + xlate
+	   mr_hi_ss(tcom_mr, idim) = mr_hi_sav + xlate
+	   IF ( MODULO_PARITY(cx_lo_sav,             npts,idel)
+     .	   .EQ. MODULO_PARITY(cx_lo_ss(tcom_cx,idim),npts,idel) ) THEN
+	      CALL COPY_INTO( memory(1,mr_blk1(tcom_mr)), tcom_mr,
+     .			   tcom_cx,
+     .			   memory(1,mr_blk1(res_mr)), res_mr )
+	   ENDIF
+	ENDIF
+
+* clean up - restore as before this call
+ 1000	cx_lo_ss(tcom_cx, idim) = cx_lo_sav
+	cx_hi_ss(tcom_cx, idim) = cx_hi_sav
+	mr_lo_ss(tcom_mr, idim) = mr_lo_sav
+	mr_hi_ss(tcom_mr, idim) = mr_hi_sav
+
+	RETURN	
+	END	
+
diff --git a/fer/utl/sort_list.F b/fer/utl/sort_list.F
new file mode 100644
index 0000000..7646ad1
--- /dev/null
+++ b/fer/utl/sort_list.F
@@ -0,0 +1,89 @@
+	SUBROUTINE SORT_LIST(n, valid_min, valid_max,
+     .			     bad_flag_in, bad_flag_out,
+     .			     list, indices, nvalid)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Sort an input list of values returning both the sorted list and the
+* map vector (as floats)
+* if there are missing values in the index list, sort em as if they are BIG
+
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 *sh* 8/99
+* V530 *sh* use sorting routine SHELL for improved performance
+* V530 *acm* 1/23/01 replace shell sort with HEAPSORT for even 
+*	better performance.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'errmsg.parm'
+
+* calling argument declarations:
+	INTEGER n, valid_min, valid_max, nvalid
+	REAL bad_flag_in, bad_flag_out, list(n), indices(n)
+
+* internal variable declarations:
+	INTEGER i
+
+* initialize
+	DO 10 i = 1,n
+ 10	indices(i) = i
+
+* replace indices that are out of range with missing value flags
+	DO 20 i = 1, n
+	  IF (list(i) .GT. valid_max
+     .   .OR. list(i) .LT. valid_min ) list(i) = bad_flag_in
+ 20	CONTINUE
+
+* shell sort
+c	CALL SHELLR(list,indices,bad_flag_in,n)
+	CALL HEAP2(list, indices, bad_flag_in, n)
+
+* count valid points
+ 300	nvalid = n
+	DO 400 i = 1,n
+	   IF ( list(i) .EQ. bad_flag_in ) nvalid = nvalid - 1
+ 400	CONTINUE
+
+* reconcile bad flags and count valid points
+	IF ( bad_flag_in .NE. bad_flag_out ) THEN
+	   DO 500 i = 1,n
+	      IF ( list(i).EQ.bad_flag_in ) list(i) = bad_flag_out
+ 500	   CONTINUE
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/split_list.F b/fer/utl/split_list.F
new file mode 100644
index 0000000..6a058c7
--- /dev/null
+++ b/fer/utl/split_list.F
@@ -0,0 +1,122 @@
+	SUBROUTINE SPLIT_LIST( mode, out_lun, next_line, line_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* depending on the state of mode_gui either write this string to the
+* out_lun unit number or send it to the GUI
+
+* Note that line_len=0 means this routine will determine the line length
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V320:  11/9/94
+*	 12/29/94 - added "mode" argument
+* V400:	  6/20/95 - bug fix: LIST/FILE output sent to "default_list_lun"
+*			should go to disk file, not to screen
+* V6.6  *kms* 5/10 - monitor redirect_*_flags for stdout/stderr redirection.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include 'ferret.parm'
+        include 'gui.parm'
+	include 'xprog_state.cmn'
+        include 'xgui.cmn'
+
+* calling arguments
+	INTEGER	      mode, out_lun, line_len
+	CHARACTER*(*) next_line
+
+*internal variable declarations:
+        INTEGER slen
+        PARAMETER  ( slen = 255 )
+#ifdef sun
+        BYTE      fhol(slen)	! c-type Hollerith string buffer
+#else
+        INTEGER*1 fhol(slen)	! c-type Hollerith string buffer
+#endif
+	INTEGER	TM_LENSTR1, llen
+
+* determine line length if not supplied
+	IF ( line_len .LE. 0 ) THEN
+	   llen = TM_LENSTR1(next_line)
+	ELSE
+	   llen = line_len
+	ENDIF
+
+* output to the desired device
+!	IF ( mode_gui ) THEN    ! 6/20 - kludge
+	IF ( mode_gui .AND. out_lun.NE.default_list_lun ) THEN
+	   CALL TM_FTOC_STRNG( next_line(:llen), fhol, slen )
+	   CALL FERRET_LIST_IN_WINDOW( fhol, ftxout_append )
+        ELSE IF ( (out_lun .EQ. ttout_lun) .AND.
+     .            (redirect_stdout_flags .NE. redirect_none) ) THEN
+           IF ( (redirect_stdout_flags .EQ. redirect_journal_tee) .OR.
+     .          (redirect_stdout_flags .EQ. redirect_journal) ) THEN
+              IF (mode_journal .AND. jrnl_lun.NE.unspecified_int4) THEN
+                 WRITE ( jrnl_lun, '(A,A)' ) '!', next_line(:llen)
+              ENDIF
+           ENDIF
+           IF ( (redirect_stdout_flags .EQ. redirect_file_tee) .OR.
+     .          (redirect_stdout_flags .EQ. redirect_file) ) THEN
+              WRITE ( redirect_stdout_lun, '(A)' ) next_line(:llen)
+           ENDIF
+           IF ( (redirect_stdout_flags .EQ. redirect_journal_tee) .OR.
+     .          (redirect_stdout_flags .EQ. redirect_file_tee) ) THEN
+              WRITE ( out_lun, '(A)' ) next_line(:llen)
+           ENDIF
+        ELSE IF ( (out_lun .EQ. err_lun) .AND.
+     .            (redirect_stderr_flags .NE. redirect_none) ) THEN
+           IF ( (redirect_stderr_flags .EQ. redirect_journal_tee) .OR.
+     .          (redirect_stderr_flags .EQ. redirect_journal) ) THEN
+              IF (mode_journal .AND. jrnl_lun.NE.unspecified_int4) THEN
+                 WRITE ( jrnl_lun, '(A,A)' ) '!', next_line(:llen)
+              ENDIF
+           ENDIF
+           IF ( (redirect_stderr_flags .EQ. redirect_file_tee) .OR.
+     .          (redirect_stderr_flags .EQ. redirect_file) ) THEN
+              WRITE ( redirect_stderr_lun, '(A)' ) next_line(:llen)
+           ENDIF
+           IF ( (redirect_stderr_flags .EQ. redirect_journal_tee) .OR.
+     .          (redirect_stderr_flags .EQ. redirect_file_tee) ) THEN
+              WRITE ( out_lun, '(A)' ) next_line(:llen)
+           ENDIF
+	ELSE
+	   WRITE ( out_lun, '(A)' ) next_line(:llen)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/ss_neighbors.F b/fer/utl/ss_neighbors.F
new file mode 100644
index 0000000..093335a
--- /dev/null
+++ b/fer/utl/ss_neighbors.F
@@ -0,0 +1,269 @@
+	SUBROUTINE SS_NEIGHBORS ( world_coord, grid, idim,
+     .				  extrapolate, sslo, sshi, factor )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* locate the subscript values immediately surrounding the given world
+* coordinate on the indicated axis.
+* Return also the linear interpolation factor with respect to the first
+* subscript.
+* When the value is out of range unspecified_int4 is returned.
+* If the value is before the beginning or after the end of the axis but
+* still inside the limits of the end grid box then both high and low
+* subscripts will be set to this subscript and "extrapolate" will
+* be set to true indicating that this is a questionable value.
+* The values sslo and sshi are both input and output values.  On input they
+* are used to optimize the search on the assumption that the next point
+* is likely to be close to the last.
+* If the indicated axis is modulo then the subscript value on the "root"
+* axis is returned.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V301 - 2/94 - based on ISUBSCRIPT
+* V420 - 10/95 - allow line defs to be recursive (dynamic lines) by avoiding
+*		 direct use of line_mem
+* V541 - *sh* 2/02 - added support for subspan modulo axes
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+* calling argument declarations:
+	LOGICAL extrapolate
+	INTEGER	grid, idim, sslo, sshi
+	REAL	world_coord, factor
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO, regular
+	INTEGER	lo_look, hi_look, axis, ibot, itop, look,
+     .		isub0, line_len, isubsc, num_mod, point
+	REAL 	subsc
+	REAL*8	TM_WORLD,  TM_WW_AXLEN, 
+     .		wcoord, start, aend, span, first, last, wwindex
+
+* initialize 
+	wcoord = world_coord	! switch to REAL*8
+	extrapolate = .FALSE.
+
+* which axis are we on ?
+	axis    = grid_line ( idim, grid )
+	line_len = line_dim( axis )
+
+* check for peculiar calls
+	IF (  axis .EQ. mnormal
+     .	 .OR. axis .EQ. munknown ) THEN
+	   sslo = unspecified_int4
+	   RETURN
+	ENDIF
+
+* special consideration for sub-span modulo axis outside its core range
+	CALL TM_WW_AX_1_N(axis, first, last)
+	IF (TM_ITS_SUBSPAN_MODULO(axis) ) THEN
+	   IF ( wcoord.LT.first .OR. wcoord.GT.last ) THEN
+	      line_len = line_len + 1
+	      last = TM_WORLD(line_len, grid, idim, box_middle)
+	      regular = .FALSE.
+	   ELSE
+	      regular = line_regular( axis )  ! optimization - simple treatment
+	   ENDIF
+	ELSE
+	   regular = line_regular( axis )
+	ENDIF
+
+* initialize pointers for axes with irregularly spaced points
+	IF ( .NOT.regular ) THEN
+	   isub0 = line_subsc1( axis ) - 1
+	   ibot  = isub0 + 1
+	   itop  = isub0 + line_len
+	ENDIF
+
+* ***** SOLUTIONS WHEN GIVEN POINT BEYOND AXIS ENDS
+	IF ( wcoord .LT. first .OR. wcoord .GT. last ) THEN
+* ... begin by computing axis limits as outer edges of end boxes
+	   span = TM_WW_AXLEN(axis)
+	   CALL TM_WW_AXLIMS(axis, start, aend)
+	   IF (TM_ITS_SUBSPAN_MODULO(axis)) THEN
+	      span = line_modulo_len(axis)
+	      aend = start + span
+	   ENDIF
+
+* Modulo axis: translate world coord to within axis range
+	   IF ( regular ) THEN
+* ... now translate to within axis limits saving modulo number
+	      IF     ( wcoord .GT. aend  ) THEN
+	         num_mod = ( wcoord - start ) / span
+! 10/92 bug fix: if wcoord is an exact multiple of length (e.g. wccord=24.
+!       start=0., span=12.) then modulo remap to top of ax rather than bottom
+                 IF ( wcoord .EQ. start+num_mod*span )
+     .                          num_mod = num_mod - 1
+	      ELSEIF ( wcoord .LT. start ) THEN
+	         num_mod = ( wcoord - aend  ) / span		! (negative)
+	      ELSE
+	         num_mod = 0
+	      ENDIF
+	      wcoord = wcoord - num_mod*span
+	   ENDIF
+
+* ... three cases: modulo (always solution), exrapolate(maybe sol'n), or
+*     not extrap. (nexer solution)
+	   IF ( wcoord .LT. first ) THEN
+	      IF ( line_modulo(axis) ) THEN
+	         sslo = 1
+	         sshi = line_len
+	         factor = 1. - (first-wcoord)/(first+span-last)
+	         RETURN
+	      ELSEIF ( wcoord .GE. start ) THEN
+	         point = 1
+	         extrapolate = .TRUE.
+	         GOTO 1100
+	      ELSE
+	         GOTO 1000		! no solution
+	      ENDIF
+	   ELSEIF ( wcoord .GT. last ) THEN
+	      IF ( line_modulo(axis) ) THEN
+	         sslo = 1
+	         sshi = line_len
+	         factor = (wcoord-last)/(first+span-last)
+	         RETURN
+
+	      ELSEIF ( wcoord .LE. aend ) THEN
+	         point = line_len
+	         extrapolate = .TRUE.
+	         GOTO 1100
+	      ELSE
+	         GOTO 1000		! no solution
+	      ENDIF
+	   ELSEIF ( wcoord .EQ. first ) THEN	! possibly unnecessary test
+	      point = 1
+	      GOTO 1100		! exact point   
+	   ELSEIF ( wcoord .EQ. last ) THEN	! possibly unnecessary test
+	      point = line_len
+	      GOTO 1100
+	   ENDIF
+	ENDIF
+* ***** END OF SOLUTIONS BEYOND AXIS ENDS
+
+* ***** AXIS POINTS ARE REGULARLY SPACED --> QUICK CALCULATION!
+	IF ( regular ) THEN
+	   subsc = (wcoord-first)/line_delta(axis)
+	   isubsc = INT( subsc )
+	   IF ( subsc .EQ. FLOAT(isubsc) ) THEN
+	      point = isubsc + 1
+	      GOTO 1100
+	   ELSE
+	      sslo = isubsc + 1
+	      sshi = isubsc + 2
+	      factor = 1. - (subsc - FLOAT(isubsc))	      
+	   ENDIF
+	   RETURN
+* ***** END OF REGULARLY SPACED SOLUTIONS
+
+	ELSE			! AXIS POINTS ARE IRREGULAR !!!!
+
+* ***** END OF PRE-SCAN NEIGHBORING POINTS
+
+* binary search if axis points are irregularly spaced
+* initialize search
+	   lo_look  = ibot - 1
+	   hi_look  = itop + 1	
+	   look     = ( lo_look + hi_look ) / 2
+
+* top of search loop
+ 100	   wwindex = TM_WORLD(look-isub0, grid, idim, box_middle)
+	   IF ( wcoord .GT. wwindex ) THEN
+
+* answer is somewhere above current "look" position
+* keep looking at higher values setting this as new low limit for search
+	      lo_look = look
+	      look = ( look + hi_look + 1 ) / 2
+
+* answer is identically equal to the current "look" position
+	   ELSEIF ( wcoord .EQ. wwindex ) THEN
+	      point = look - isub0
+	      GOTO 1100
+
+	   ELSE
+* answer is somewhere below current "look" position
+* keep looking at lower values setting this as new high limit for search
+	      hi_look = look
+	      look = ( look + lo_look ) / 2
+
+	   ENDIF
+
+* have we narrowed it to a 1 point range ?
+	   IF ( hi_look - lo_look .LE. 1 ) THEN
+
+* yes - we found it
+	      sslo = lo_look - isub0
+	      sshi = hi_look - isub0
+	      IF ( sslo .EQ. sshi ) THEN
+	         factor = 0.0
+	      ELSE
+	         wwindex = TM_WORLD(hi_look-isub0,grid, idim, box_middle)
+#ifdef double_p
+		 factor = (wwindex - wcoord)
+     .			/ (wwindex-
+     .			  TM_WORLD(lo_look-isub0,grid, idim, box_middle))
+#else
+	         factor = SNGL(wwindex - wcoord)
+     .			/ SNGL(wwindex-
+     .			  TM_WORLD(lo_look-isub0,grid, idim, box_middle))
+#endif
+	      ENDIF
+	      RETURN
+	   ELSE
+
+* no - keep looking
+	      GOTO 100
+	   ENDIF
+	ENDIF
+
+* special conclusions
+* ... NO SOLUTION
+ 1000	sslo = unspecified_int4
+	sshi = unspecified_int4
+	RETURN
+
+* ... SOLUTION IS SINGLE POINT
+ 1100	sslo = point
+	sshi = point
+	factor = 0.0
+	RETURN
+
+	END
diff --git a/fer/utl/store_dependency.F b/fer/utl/store_dependency.F
new file mode 100644
index 0000000..1add054
--- /dev/null
+++ b/fer/utl/store_dependency.F
@@ -0,0 +1,254 @@
+	SUBROUTINE STORE_DEPENDENCY
+     .		( its_aux, cx, tree_lev,  uvar, item, cx_status,
+     .		  next, level, flag, dataset, var_or_start, cat_or_end,
+     .		  parent_uv, uv_item, desist )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* store a line describing a single variable of a dependency tree
+* and send feedback if a duplication or a recursion has been detected that
+* indicates further analysis of this tree level should desist
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* V685  *sh* 10/13 
+* V690  *sh* 11/13 - fixed problem in aux regridding variable dependencies
+*                    by adding a new calling arg
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xdependency_tree.cmn'
+
+
+* calling argument declarations:
+	LOGICAL	its_aux, desist
+	INTEGER cx, tree_lev, uvar, item, cx_status
+	INTEGER	next         (dependency_max_recs),
+     .		level        (dependency_max_recs),
+     .		flag         (dependency_max_recs),
+     .		dataset         (dependency_max_recs),
+     .		var_or_start (dependency_max_recs),
+     .		cat_or_end   (dependency_max_recs),
+     .		parent_uv    (dependency_max_recs),
+     .		uv_item      (dependency_max_recs)
+
+*	next         - forward link connecting starts of trees 
+*	level        - the child generation level in the tree
+*	flag         - special conditions (see xdependency_tree parameters
+*	var_or_start - variable number if known variable
+*                      or start character of uvar item if unknown
+*	cat_or_end   - category number if known variable
+*                      or end   character of uvar item if unknown
+*	parent_uv    - uvar number of parent variable (used when unknown var)
+*	uv_item      - uvar item number within parent (used when unknown var)
+
+
+* internal variable declarations:
+	LOGICAL	known_var, dup, in_target_defn, direct_parentage, aux_broken_chain
+	INTEGER	var, cat, dset, df_flag, row, current_lev, i,
+     .		this_flag
+
+* initialize
+	cat    = cx_category(cx)
+	var    = cx_variable(cx)
+	dset   = cx_data_set(cx)
+	IF (dset .EQ. unspecified_int4) dset = pdset_irrelevant
+	desist = .FALSE.
+	known_var = cx_status .EQ. ferr_ok
+!     .	      .OR.  cx_status .EQ. ferr_unknown_auxvar  ! ???
+
+* increment pointer to the next item to be stored
+	row = dependency_nrows + 1
+	dependency_nrows = row
+
+* store the things that are always valid
+	next (row) = 0		! for clean housekeeping, not used
+	level(row) = tree_lev
+	dataset (row) = dset
+
+* determine flag to save
+	IF (     cx_status .EQ. ferr_unknown_variable ) THEN
+	   this_flag = df_unknown_var
+	ELSEIF ( cx_status .EQ. ferr_unknown_data_set ) THEN
+	   this_flag = df_unknown_dataset
+	ELSEIF ( cx_status .EQ. ferr_unknown_auxvar ) THEN
+	   this_flag = df_unknown_auxvar
+	ELSEIF ( cx_status .EQ. ferr_unknown_grid ) THEN
+	   this_flag = df_unknown_grid
+	ELSEIF ( cx_status .NE. ferr_ok ) THEN
+	   this_flag = df_syntax_error
+	ELSEIF ( its_aux ) THEN
+	   this_flag = df_valid_aux_var
+	ELSE
+	   this_flag = df_valid_var
+	ENDIF
+	flag(row) = this_flag
+	 
+* store things differently depending upon whether variable is known
+	IF ( cx_status .EQ. ferr_unknown_auxvar ) THEN
+	   var_or_start(row) = uvar_item_start(item, uvar)
+     .					  + var - 1
+	   cat_or_end  (row) = uvar_item_start(item, uvar)
+     .					  + cat - 1
+	   parent_uv   (row) = uvar
+	   uv_item     (row) = item
+	ELSEIF ( cx_status .NE. ferr_ok ) THEN
+	   var_or_start(row) = uvar_item_start(item, uvar)
+	   cat_or_end  (row) = uvar_item_end  (item, uvar)
+	   parent_uv   (row) = uvar
+	   uv_item     (row) = item
+	ELSE
+	   var_or_start(row) = var
+	   cat_or_end  (row) = cat
+	   parent_uv   (row) = unspecified_int4
+	   uv_item     (row) = unspecified_int4
+	ENDIF
+
+* check for duplications:
+* 1. in-line duplication
+*  Where there are multiple references to any var in same definition as in
+*    LET target = b + b 
+*  it is not necessary to report the variable b twice
+* 2. back-reference duplication
+*  Where there are multiple references to a user-defined vaiable in separate
+*  definitions as in
+*    LET target = b + c
+*    LET b = c
+*    LET c = d
+*    LET d = 1
+*  it is not necessry to report the dependencies of c twice.  The variable
+*  in_target_defn is used to track case 2 duplication (this) versus case 1
+* 3. recursion
+*  The existence of recursion is apparent through a duplicated defnition
+*    that lies in the direct line of decent from another, as in this example
+*    where "P" indicates a parent and "S" indicates a sibling variable
+*    LET P0 = P1 + S1
+*    LET P1 = P2 + S2
+*    LET P2 = P3 + S3
+*  LET P3 = S1 would not create a recursion, but LET P3 = P1 would
+*  As we look backwards in the dependency tree the direct descendent parent is
+*  always the very first one at the next lower level.
+	IF (  known_var
+     .	.AND. row .GT. dependency_current_tree_start ) THEN
+
+* look for case 1:  twin sibling var that need not be reported
+	   DO 100 i = row-1, dependency_current_tree_start, -1
+	      IF     ( level(i) .GT. tree_lev ) THEN
+	         GOTO 100                 ! inside of a child variable - ignore
+	      ELSEIF ( level(i) .LT. tree_lev ) THEN
+	         GOTO 110		  ! gone beyond start of this variable
+	      ENDIF
+* ...  flag cannot be used in the dup test because it gets reset for df_defined_earlier
+*      since parent_uv is set to unspecified_int4 only for df_valid_var it serves
+*      as a signal that the flag had been valid before it was reset to defined_earlier
+	      dup =   parent_uv(i)    .EQ. parent_uv(row)
+     .          .AND. dataset(i)      .EQ. dataset(row)
+     .		.AND. var_or_start(i) .EQ. var_or_start(row)
+     .		.AND. cat_or_end  (i) .EQ. cat_or_end  (row)
+	      IF (dup) THEN
+* ... found a twin -- do not report it
+	         desist = .TRUE.
+	         row = row - 1
+	         dependency_nrows = row
+	         GOTO 500
+	      ENDIF
+ 100	   CONTINUE
+
+* look for cases 1 and 3
+ 110	   in_target_defn = .NOT.its_aux    ! TRUE while we are inside the defn of target
+	   aux_broken_chain = .FALSE.
+	   current_lev = tree_lev
+	   DO 200 i = row-1, dependency_current_tree_start, -1
+	      IF ( flag(i) .EQ. df_valid_aux_var ) THEN
+	         aux_broken_chain = .TRUE.    ! the chain of dependency stops at an aux var dependency
+	         direct_parentage = .FALSE.
+	      ENDIF
+	      IF ( level(i) .LT. current_lev ) THEN
+	         in_target_defn = .FALSE.
+! doesnt this need to break the direct_parentage line permanently for all above?
+! finding recursion through an aux var connection is still a problem, even if the parent is a uservar
+! XXXXXXXXXXX   FIX PROBLEM:  FALSE RECURSIONS FROM AUX VAR DIRECT PARENTAGE
+	         IF (.NOT.aux_broken_chain) direct_parentage = .TRUE.
+	         current_lev = level(i)
+	      ELSE
+	         direct_parentage = .FALSE.  ! never true while in_target_defn
+	      ENDIF
+* ...  flag cannot be used in the dup test because it gets reset for df_defined_earlier
+*      since parent_uv is set to unspecified_int4 only for df_valid_var it serves
+*      as a signal that the flag had been valid before it was reset to defined_earlier
+	      dup =   parent_uv(i)    .EQ. parent_uv(row)
+     .          .AND. dataset(i)      .EQ. dataset(row)
+     .		.AND. var_or_start(i) .EQ. var_or_start(row)
+     .		.AND. cat_or_end  (i) .EQ. cat_or_end  (row)
+	      IF (dup) THEN
+* ... the row we are adding is already in the dependency tree
+*     so desist in the analysis of this variable
+	         IF (in_target_defn .AND. level(i).EQ.tree_lev) THEN
+* ... case 1: twin sibling var need not be reported
+*	SHOULD NEVER ARRIVE HERE
+	            CALL WARN("crptn_store_dep")
+	         ELSEIF (direct_parentage) THEN
+* ... case 3: a recursive definition has been found
+	            flag(row) = df_recursion_error
+	            desist = .TRUE.
+	            GOTO 500
+	         ELSEIF (cat_or_end(i) .EQ. cat_user_var) THEN
+* ... case 2: uvar used in separate vars needs only a cross-ref the second time
+	            flag(row) = df_defined_earlier
+	            desist = .TRUE.
+	            GOTO 500
+	         ENDIF
+	      ENDIF
+ 200	   CONTINUE
+
+	ENDIF
+
+* maintain the forward link pointer
+ 500	next (dependency_current_tree_start) = row+1
+	next (row+1) = row+1
+
+* maintain global flag for status of tree
+	IF (flag(row) .GT. dependency_status) THEN
+	   dependency_status     = flag(row)
+	   dependency_status_rec = row
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/store_string.F b/fer/utl/store_string.F
new file mode 100644
index 0000000..044a0b3
--- /dev/null
+++ b/fer/utl/store_string.F
@@ -0,0 +1,82 @@
+	SUBROUTINE STORE_STRING( text, mr, offset, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* Store a given FORTRAN character string into dynamic memory
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530:  8/00 *sh*
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER	mr, offset, status
+!	REAL    memory( mem_blk_size, max_mem_blks )
+	CHARACTER*(*) text
+
+* internal variable declarations:
+	INTEGER	clen, istat
+
+* --- end of introductory code ---
+
+* length of string to be stored
+	clen = LEN(text)
+
+* convert to a null-terminated C string
+! instead we are using the assumption that FORTRAN character arrays are
+! passed with the correct starting address
+!	CALL GET_WORK_SPC( 1+clen/4, wrk1, status )
+!	IF (status .NE. ferr_ok) RETURN
+
+!	CALL TM_FTOC_STRNG (text,
+!     .			    memory(1,wrk1), clen )
+
+* allocate dynamic storage and save the pointer in the Ferret grid
+	CALL SAVE_C_STRING(text, clen,
+     .			   mr_c_pointer(mr), offset, istat )
+	IF (istat .NE. 0) THEN
+	   CALL ERRMSG(ferr_insuff_memory, status,
+     .			'dynamic memory for string', *5000)
+	ELSE
+	   status = ferr_ok
+	ENDIF
+
+ 5000	RETURN
+	END	
diff --git a/fer/utl/store_sys_strings.F b/fer/utl/store_sys_strings.F
new file mode 100644
index 0000000..4b73390
--- /dev/null
+++ b/fer/utl/store_sys_strings.F
@@ -0,0 +1,112 @@
+	SUBROUTINE STORE_SYS_STRINGS( cmnd_text, cx, mr,
+     .				      pos, nlines, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* Execute a shell command and save the resulting strings in the variable mr
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530:  9/00 *sh*
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include	'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'xvariables.cmn'
+	include	'xcontext.cmn'
+	include	'xrisc.cmn'
+
+* calling argument declarations:
+	INTEGER	cx, mr, pos, nlines, status
+	CHARACTER*(*) cmnd_text
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1,clen, old_len, istat, new_mr
+	REAL*8	 ADD_C_POINTER, sysout_ptr
+
+* --- end of introductory code ---
+
+* length of string to be stored
+	clen = TM_LENSTR1(cmnd_text)
+
+* convert command to a null-terminated C string
+	CALL TM_FTOC_STRNG (cmnd_text,
+     .			    risc_buff, size_rbuff )
+
+* execute the shell command
+	CALL GET_SYS_CMND(sysout_ptr, nlines, risc_buff, istat)
+	IF (istat .NE. 0) THEN
+	   CALL ERRMSG(ferr_insuff_memory, status,
+     .			'dynamic memory for string', *5000)
+	ELSE
+	   status = ferr_ok
+	ENDIF
+
+
+* enlarge the context to accomodate the new strings
+* ... It is OK to modify cx in this blase way since the Ferret syntax doesnt
+*     support "{stuff}[cx mods]". cx mods can be applied to a system output
+*     string list only via "LET var={stuff}" and then using "var[cx mods]"
+	old_len = cx_hi_ss(cx, x_dim)
+! note: the "2000" in this line matches the same in COUNT_NUMBER_LIST.F
+	cx_hi_ss(cx, x_dim) = cx_hi_ss(cx, x_dim) + nlines - 2000
+	cx_hi_ww(x_dim, cx) = cx_hi_ss(cx, x_dim)
+
+* do we need to allocate a larger block of memory?
+	IF ( cx_hi_ss(cx, x_dim) .GT. mr_nblks(mr)*mem_blk_size ) THEN
+	   CALL CREATE_TEMP_MEM_VAR( cx, new_mr, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   mr_c_pointer(new_mr) = ADD_C_POINTER(mr_c_pointer(mr), 0,
+     .				(mr_blk1(new_mr)-mr_blk1(mr))*mem_blk_size)
+	   CALL XFER_C_PTRS( mr_c_pointer(mr),     1, 0,
+     .			     mr_c_pointer(new_mr), 1, 0, old_len )
+	   mr_type(mr) = ptype_float ! a trick so that C strings are not freed
+	   CALL DELETE_VARIABLE(mr)  ! when DELETE_VARIABLE is called
+	   mr = new_mr
+	ELSE
+	   mr_hi_ss(mr, x_dim) = cx_hi_ss(cx, x_dim)
+	   mr_hi_ww(x_dim, mr) = cx_hi_ss(cx, x_dim)
+ 	ENDIF
+
+* transfer the strings into this mr (and free the pointer)
+	CALL XFER_C_PTRS(sysout_ptr,0,0,mr_c_pointer(mr),1,pos-1,nlines)
+	CALL FREE_C_POINTER( sysout_ptr )
+
+* success
+	status = ferr_ok
+
+ 5000	RETURN
+	END	
diff --git a/fer/utl/str_match.F b/fer/utl/str_match.F
new file mode 100644
index 0000000..236c85f
--- /dev/null
+++ b/fer/utl/str_match.F
@@ -0,0 +1,70 @@
+	INTEGER FUNCTION STR_MATCH( test, list, n )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the test string by finding it in the given list
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/20/87
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER		n
+	CHARACTER*(*)	test, list(n)
+
+* internal variable declarations:
+	INTEGER		STR_CASE_BLIND_COMPARE, i, vax_code
+
+	include 'ferret.parm'
+	include 'gfdl_vms.parm'
+
+* look through the list of possibilities
+	DO 100 i = 1, n
+	   vax_code = STR_CASE_BLIND_COMPARE( test, list(i) )
+	   IF ( vax_code .EQ. vms_str_success ) THEN
+	      STR_MATCH = i
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* no luck - we didn't find it
+	STR_MATCH = atom_not_found
+
+	RETURN
+	END
diff --git a/fer/utl/sub_2_grids.F b/fer/utl/sub_2_grids.F
new file mode 100644
index 0000000..74befd4
--- /dev/null
+++ b/fer/utl/sub_2_grids.F
@@ -0,0 +1,84 @@
+	SUBROUTINE SUB_2_GRIDS( plus, mplus, mnus, mmnus, rslt, mrslt )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* subtract 2 grids producing a third
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 6/25/87
+* V200:  7/26/89 - 4D symmetrical version
+*	10/12/89 - use ..._SUB - avoid adjustable dimensioning with array
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include	'xvariables.cmn'
+
+* calling argument declarations:
+	INTEGER mplus, mmnus, mrslt
+	REAL    plus( * ), mnus( * ), rslt( * )
+
+* --- end of introductory code ---
+
+	CALL SUB_2_GRIDS_SUB(
+     .			  plus, mr_lo_s1(mplus), mr_hi_s1(mplus),
+     .				mr_lo_s2(mplus), mr_hi_s2(mplus),
+     .				mr_lo_s3(mplus), mr_hi_s3(mplus),
+     .				mr_lo_s4(mplus), mr_hi_s4(mplus),
+     .				mr_lo_s5(mplus), mr_hi_s5(mplus),
+     .				mr_lo_s6(mplus), mr_hi_s6(mplus),
+     .				mr_bad_data( mplus ),
+     .			  mnus, mr_lo_s1(mmnus), mr_hi_s1(mmnus),
+     .				mr_lo_s2(mmnus), mr_hi_s2(mmnus),
+     .				mr_lo_s3(mmnus), mr_hi_s3(mmnus),
+     .				mr_lo_s4(mmnus), mr_hi_s4(mmnus),
+     .				mr_lo_s5(mmnus), mr_hi_s5(mmnus),
+     .				mr_lo_s6(mmnus), mr_hi_s6(mmnus),
+     .				mr_bad_data( mmnus ),
+     .			  rslt, mr_lo_s1(mrslt), mr_hi_s1(mrslt),
+     .				mr_lo_s2(mrslt), mr_hi_s2(mrslt),
+     .				mr_lo_s3(mrslt), mr_hi_s3(mrslt),
+     .				mr_lo_s4(mrslt), mr_hi_s4(mrslt),
+     .				mr_lo_s5(mrslt), mr_hi_s5(mrslt),
+     .				mr_lo_s6(mrslt), mr_hi_s6(mrslt),
+     .				mr_bad_data( mrslt )			)
+
+
+	RETURN
+	END 
diff --git a/fer/utl/sub_2_grids_sub.F b/fer/utl/sub_2_grids_sub.F
new file mode 100644
index 0000000..f01f1f7
--- /dev/null
+++ b/fer/utl/sub_2_grids_sub.F
@@ -0,0 +1,94 @@
+	SUBROUTINE SUB_2_GRIDS_SUB (
+     .		plus, plox, phix, ploy, phiy, ploz, phiz, plot, phit, 
+     .		ploe, phie, plof, phif, bad_plus,
+     .		mnus, mlox, mhix, mloy, mhiy, mloz, mhiz, mlot, mhit, 
+     .		mloe, mhie, mlof, mhif, bad_mnus,
+     .		rslt, rlox, rhix, rloy, rhiy, rloz, rhiz, rlot, rhit, 
+     .		rloe, rhie, rlof, rhif, bad_rslt )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* subtract 2 grids producing a third
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200: 10/12/89
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	plox, phix, ploy, phiy, ploz, phiz, plot, phit, 
+     .		ploe, phie, plof, phif,
+     .		mlox, mhix, mloy, mhiy, mloz, mhiz, mlot, mhit, 
+     .		mloe, mhie, mlof, mhif,
+     .		rlox, rhix, rloy, rhiy, rloz, rhiz, rlot, rhit, 
+     .		rloe, rhie, rlof, rhif
+	REAL    plus( plox:phix,ploy:phiy,ploz:phiz,plot:phit,ploe:phie,plof:phif ),
+     .		mnus( mlox:mhix,mloy:mhiy,mloz:mhiz,mlot:mhit,mloe:mhie,mlof:mhif ),
+     .		rslt( rlox:rhix,rloy:rhiy,rloz:rhiz,rlot:rhit,rloe:rhie,rlof:rhif )
+	REAL	bad_plus, bad_mnus, bad_rslt
+
+* internal variable declarations:
+	INTEGER	i, j, k, l, m, n
+
+* --- end of introductory code ---
+
+	DO 100 n = rlof, rhif
+	DO 100 m = rloe, rhie
+	DO 100 l = rlot, rhit
+	DO 100 k = rloz, rhiz
+	DO 100 j = rloy, rhiy
+	DO 100 i = rlox, rhix
+
+	   IF (  plus(i,j,k,l,m,n) .NE. bad_plus
+     .	   .AND. mnus(i,j,k,l,m,n) .NE. bad_mnus ) THEN
+
+	      rslt(i,j,k,l,m,n) = plus(i,j,k,l,m,n) - mnus(i,j,k,l,m,n)
+
+	   ELSE
+
+	      rslt(i,j,k,l,m,n) = bad_rslt
+
+	   ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END 
diff --git a/fer/utl/t_deriv.F b/fer/utl/t_deriv.F
new file mode 100644
index 0000000..9bfb399
--- /dev/null
+++ b/fer/utl/t_deriv.F
@@ -0,0 +1,147 @@
+	SUBROUTINE T_DERIV( com, mcom, res, mres, dt, reg )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compute centered derivative of component along axis t_dim
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/1/89 - based on DO_DERIV_CNTR
+*	10/11/89 - modified array declarations using XMEM_SUBSC.CMN
+* 2/12 *acm* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'errmsg.parm'
+	include	'interp_stack.parm'
+	include	'xcontext.cmn'
+	include	'xvariables.cmn'
+	include	'xmem_subsc.cmn'
+	include	'xprog_state.cmn'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	LOGICAL reg
+	INTEGER	mcom, mres
+	REAL	   dt,
+     .   com( m1lox:m1hix,m1loy:m1hiy,m1loz:m1hiz,m1lot:m1hit,m1loe:m1hie,m1lof:m1hif ),
+     .   res( m2lox:m2hix,m2loy:m2hiy,m2loz:m2hiz,m2lot:m2hit,m2loe:m2hie,m2lof:m2hif )
+
+* internal variable declarations:
+	INTEGER i, j, k, l, m, n, grid, lo_l, hi_l, lm1, lp1
+	REAL	bad_com, bad_res, lo_com, hi_com, box, box1
+	REAL*8	TM_WORLD
+
+* initialize
+	grid    = mr_grid( mres )
+	bad_com = mr_bad_data( mres )
+	bad_res = mr_bad_data( mcom )
+
+* fill in edges if not computable
+	lo_l = mr_lo_s4(mres)
+	IF ( mr_lo_s4(mcom) .EQ. mr_lo_s4(mres) ) THEN
+	   DO 100 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	   DO 100 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	   DO 100 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 100 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   DO 100 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	   DO 100 i = mr_lo_s1(mres), mr_hi_s1(mres)
+ 100	   res(i,j,k,lo_l,m,n) = bad_res
+	   lo_l = lo_l + 1
+	ENDIF
+	hi_l = mr_hi_s4(mres)
+	IF ( mr_hi_s4(mcom) .EQ. mr_hi_s4(mres) ) THEN
+	   DO 200 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	   DO 200 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	   DO 200 l = mr_lo_s4(mres), mr_hi_s4(mres)
+	   DO 200 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   DO 200 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	   DO 200 i = mr_lo_s1(mres), mr_hi_s1(mres)
+ 200	   res(i,j,k,hi_l,m,n) = bad_res
+	   hi_l = hi_l - 1
+	ENDIF
+	   
+* loop through all computable points
+	DO 1000 l = lo_l, hi_l
+
+	lm1 = l-1
+	lp1 = l+1
+
+* time box size
+	   box = TM_WORLD( lp1, grid, t_dim, box_middle )
+     .	       - TM_WORLD( lm1, grid, t_dim, box_middle )
+
+* all T spacings the same ?
+	   IF ( l .EQ. lo_l ) THEN
+	      box1 = box
+	      reg  = .TRUE.
+	   ELSE
+	      IF ( box .NE. box1 ) reg = .FALSE.
+	   ENDIF
+
+	   DO 500 n = mr_lo_s6(mres), mr_hi_s6(mres)
+	   DO 500 m = mr_lo_s5(mres), mr_hi_s5(mres)
+	   DO 500 k = mr_lo_s3(mres), mr_hi_s3(mres)
+	   DO 500 j = mr_lo_s2(mres), mr_hi_s2(mres)
+	   DO 500 i = mr_lo_s1(mres), mr_hi_s1(mres)
+
+	      lo_com = com(i,j,k,lm1,m,n)
+	      hi_com = com(i,j,k,lp1,m,n)
+	      IF ( lo_com.EQ.bad_res .OR. hi_com.EQ.bad_res ) THEN
+	         res(i,j,k,l,m,n) = bad_res
+	      ELSE
+	         res(i,j,k,l,m,n) = (hi_com-lo_com) / box
+	      ENDIF
+
+ 500	   CONTINUE
+ 1000	CONTINUE
+
+* compute delta t
+	IF ( reg ) THEN
+	   dt = box
+	ELSE
+	   box = TM_WORLD( hi_l+1, grid, t_dim, box_middle )
+     .	       - TM_WORLD( lo_l-1, grid, t_dim, box_middle )
+	   dt = box / (hi_l-lo_l+1)
+	ENDIF
+
+	RETURN
+	END	
diff --git a/fer/utl/tdest_world.F b/fer/utl/tdest_world.F
new file mode 100644
index 0000000..d150fc1
--- /dev/null
+++ b/fer/utl/tdest_world.F
@@ -0,0 +1,99 @@
+	DOUBLE PRECISION FUNCTION TDEST_WORLD
+     .			( subsc, grid, idim, where_in_box )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a subscript value on a grid into a "world" coordinate
+* if the axis is a valid time axis then a second level conversion will convert
+* the time step value on the source grid into the equivalent time step on a
+* destination grid.  That grid must have been previously specified with
+* a call to TDST_WORLD_INIT.
+
+* This routine exists to optimize performance in converting between time axes
+
+* The conversion process is simply based on the fact that each time axis is
+* a slope (units) and an intercept (T0)
+* Let
+*	A - absolute time (seconds since BC)
+*	U - units (slope)
+*	T - axis-relative time
+* so that
+*	AT0src - is the absolute time of T0 on the source axis
+*	AT0dst - equivalently on the destination axis
+* Then
+*	Tsrc = (A-AT0src) / Usrc
+*	Tdst = (A-AT0dst) / Udst
+* from which
+*	Tdst = Tsrc*(Usrc/Udst) + (AT0src-AT0dst)/Udst 
+* or in terms of the COMMON variables
+*	Tdst = Tscr*tcnvrt_slope + tcnvrt_intercept
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V312:  6/2/94
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xregrid.cmn'
+
+* calling argument declarations:
+	INTEGER	subsc, grid, idim, where_in_box
+
+* internal variable declarations:
+        INTEGER status
+	REAL*8	TM_WORLD, ww
+
+* standard conversion into world coordinates
+	ww = TM_WORLD( subsc, grid, idim, where_in_box )
+	TDEST_WORLD = ww
+
+* special treatment of calendar time axis
+	IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+           IF ( tcnvrt_ok  ) THEN
+	      IF ( grid .NE. cnvrt_src_grid ) THEN
+	         CALL ERRMSG( ferr_internal, status,
+     .				'TDEST_WORLD not initialized', *5000 )
+	      ELSE	
+	         TDEST_WORLD = ww * tcnvrt_slope + tcnvrt_intercept 	         
+	      ENDIF
+	   ENDIF
+	ENDIF		
+
+ 5000	RETURN
+	END
diff --git a/fer/utl/tdest_world_init.F b/fer/utl/tdest_world_init.F
new file mode 100644
index 0000000..ce51592
--- /dev/null
+++ b/fer/utl/tdest_world_init.F
@@ -0,0 +1,137 @@
+	SUBROUTINE TDEST_WORLD_INIT ( src_grid, dst_grid, idim, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize COMMON in preparation for time coordinate conversion calls to
+* TDEST_WORLD (see detailed docs in tdest_world.F)
+
+* This routine exists to optimize performance in converting between time axes
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V312:  6/2/94
+* V530: *acm* 12/00 alternative calendar types; cal_id
+*             return source and dest cal_ids for get_linear_coef
+* V673: *acm*  2/12 see ticket 1915. All computations of these factors need 
+*             to be done in DOUBLE prcision.
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'xregrid.cmn'
+
+* calling argument declarations:
+	INTEGER	src_grid, dst_grid, idim, status
+
+* internal variable declarations:
+	LOGICAL TM_DATE_OK
+	INTEGER	TM_GET_CALENDAR_ID ,
+     .          src_line, dst_line, src_cal_id, dst_cal_id
+	REAL	CAL_FACTR
+	REAL*8  SECS_FROM_BC, at0src, at0dst, usrc, udst, factor
+
+* initialize
+	tcnvrt_ok = .FALSE.
+	cnvrt_src_grid = src_grid
+	status = ferr_ok
+
+* first check to see if calendar-based regridding between these two grids
+* is possible
+	IF ( src_grid .EQ. unspecified_int4
+     .	.OR. dst_grid .EQ. unspecified_int4 ) STOP 'TDEST_WORLD_INIT'
+
+	src_line = grid_line( idim, src_grid )
+	dst_line = grid_line( idim, dst_grid )
+
+        src_cal_id = TM_GET_CALENDAR_ID ( line_cal_name(src_line) )
+        dst_cal_id = TM_GET_CALENDAR_ID ( line_cal_name(dst_line) )
+
+
+	IF ( src_line .EQ. mnormal .OR. src_line .EQ. munknown
+     .	.OR. dst_line .EQ. mnormal .OR. dst_line .EQ. munknown )
+     .		CALL ERRMSG( ferr_internal, status,
+     .				'date regrid on missing T axis', *5000 )
+	IF ( line_direction(src_line) .NE. 'TI'
+     .	.OR. line_direction(dst_line) .NE. 'TI' ) THEN
+	   IF ( line_direction(src_line) .NE. 'FI'
+     .	   .OR. line_direction(dst_line) .NE. 'FI' ) RETURN
+        ENDIF
+
+	IF ( .NOT. (TM_DATE_OK(line_t0(src_line), src_cal_id) 
+     .	       .AND.TM_DATE_OK(line_t0(dst_line), dst_cal_id)) ) RETURN
+
+* determine the units and absolute T0 for the two axes
+	usrc = un_convert( line_unit_code(src_line) )
+	udst = un_convert( line_unit_code(dst_line) )
+
+	at0src = SECS_FROM_BC( line_t0(src_line), src_cal_id, status )
+	IF ( status .NE. ferr_ok ) RETURN
+	at0dst = SECS_FROM_BC( line_t0(dst_line), dst_cal_id, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+        IF (dst_cal_id .NE. 1) THEN
+           factor = CAL_FACTR (dst_cal_id)
+	   udst = udst* factor
+	   at0dst = at0dst* factor
+	ENDIF
+
+        IF (src_cal_id .NE. 1) THEN
+	   factor = CAL_FACTR (src_cal_id)
+	   usrc = usrc* factor
+	   at0src = at0src* factor
+	ENDIF
+
+* determine the slope and intercept to be used in TDST_WORLD regridding
+	tcnvrt_slope = usrc/udst
+	tcnvrt_intercept = (at0src-at0dst) / udst
+
+* success
+	tcnvrt_ok = .TRUE.
+	RETURN
+
+* error exit
+ 5000	RETURN
+	END
+
+
+
+
diff --git a/fer/utl/transfer_axis.F b/fer/utl/transfer_axis.F
new file mode 100644
index 0000000..91ef2dc
--- /dev/null
+++ b/fer/utl/transfer_axis.F
@@ -0,0 +1,76 @@
+	SUBROUTINE TRANSFER_AXIS ( idim, source, dest )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer region and transformation information about one axis from one
+* context buffer to another
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  5/31/89 - extracted from TRANSFER_CONTEXT
+* $Id: transfer_axis.F 15054 2012-10-22 20:21:29Z ksmith $ 
+*       - *kob* need to now copy cx_calender as well
+* v580 *acm* 11/04 transfer cx_cal_id, the calendar ID used when  
+*                  computing world coordinates
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+* V683  *acm*10/12 Improve handling of F axes and info about the calendar of the grid.
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+
+	INTEGER	source, dest, idim
+
+	cx_lo_ss ( dest, idim )   = cx_lo_ss ( source, idim )
+	cx_hi_ss ( dest, idim )   = cx_hi_ss ( source, idim )
+	cx_lo_ww ( idim, dest )   = cx_lo_ww ( idim, source )
+	cx_hi_ww ( idim, dest )   = cx_hi_ww ( idim, source )
+	cx_trans ( idim, dest )   = cx_trans ( idim, source )
+	cx_by_ss ( idim, dest )   = cx_by_ss ( idim, source )
+	cx_given ( idim, dest )   = cx_given ( idim, source )
+	cx_trans_arg(idim, dest)  = cx_trans_arg(idim, source)
+* 8/97 *kob* 	
+	IF (idim .EQ. t_dim) THEN
+           cx_calendar(dest) = cx_calendar(source)
+           cx_cal_id(dest) = cx_cal_id(source)
+        ENDIF
+
+
+	RETURN
+	END
diff --git a/fer/utl/transfer_cx_axis_to_uv.F b/fer/utl/transfer_cx_axis_to_uv.F
new file mode 100644
index 0000000..1e09e62
--- /dev/null
+++ b/fer/utl/transfer_cx_axis_to_uv.F
@@ -0,0 +1,59 @@
+	SUBROUTINE TRANSFER_CX_AXIS_TO_UV ( idim, source, uvar )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+**
+* transfer region information about one axis from a
+* context to a uver variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 *sh*
+* $Id: transfer_cx_axis_to_uv.F 14336 2012-07-10 23:31:50Z ksmith $ 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+
+	INTEGER	source, uvar, idim
+
+	uvar_lo_ss ( uvar, idim )   = cx_lo_ss ( source, idim )
+	uvar_hi_ss ( uvar, idim )   = cx_hi_ss ( source, idim )
+	uvar_lo_ww ( idim, uvar )   = cx_lo_ww ( idim, source )
+	uvar_hi_ww ( idim, uvar )   = cx_hi_ww ( idim, source )
+	uvar_by_ss ( idim, uvar )   = cx_by_ss ( idim, source )
+
+	RETURN
+	END
diff --git a/fer/utl/transfer_grid.F b/fer/utl/transfer_grid.F
new file mode 100644
index 0000000..426064f
--- /dev/null
+++ b/fer/utl/transfer_grid.F
@@ -0,0 +1,64 @@
+	SUBROUTINE TRANSFER_GRID ( source_grid, dest_grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* transfer a complete description of a grid from one slot in COMMON to another
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 10/14/86
+* revision 0.1 -  3/23/87 - eliminated grid_origin as not useful
+* 2/12 *acm* Add E and F dimensions (use nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+	INTEGER	source_grid, dest_grid, idim
+
+	grid_name     ( dest_grid )	= 'unknown'
+	grid_rotation ( dest_grid )	= grid_rotation( source_grid )
+
+	DO 100 idim = 1, nferdims
+	   grid_line    (idim, dest_grid) = grid_line    (idim, source_grid)
+	   grid_out_prod(idim, dest_grid) = grid_out_prod(idim, source_grid)
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fer/utl/transfer_uv_axis_to_uv.F b/fer/utl/transfer_uv_axis_to_uv.F
new file mode 100644
index 0000000..e4aa2f2
--- /dev/null
+++ b/fer/utl/transfer_uv_axis_to_uv.F
@@ -0,0 +1,59 @@
+	SUBROUTINE TRANSFER_UV_AXIS_TO_UV ( idim, source, uvar )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+**
+* transfer region information about one axis from a
+* context to a uver variable
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V510 *sh*
+* $Id: transfer_uv_axis_to_uv.F 14336 2012-07-10 23:31:50Z ksmith $ 
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+
+	INTEGER	source, uvar, idim
+
+	uvar_lo_ss ( uvar, idim )   = uvar_lo_ss ( source, idim )
+	uvar_hi_ss ( uvar, idim )   = uvar_hi_ss ( source, idim )
+	uvar_lo_ww ( idim, uvar )   = uvar_lo_ww ( idim, source )
+	uvar_hi_ww ( idim, uvar )   = uvar_hi_ww ( idim, source )
+	uvar_by_ss ( idim, uvar )   = uvar_by_ss ( idim, source )
+
+	RETURN
+	END
diff --git a/fer/utl/true_or_false.F b/fer/utl/true_or_false.F
new file mode 100644
index 0000000..89bc274
--- /dev/null
+++ b/fer/utl/true_or_false.F
@@ -0,0 +1,104 @@
+	LOGICAL FUNCTION TRUE_OR_FALSE (string, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see if the string represents a TRUE condition or a FALSE one
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V420  4/25/96
+*	7/96 - minor compiler bug fix -- eliminate unuser RETURN
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER		status
+	CHARACTER*(*)	string
+
+	include	'ferret.parm'
+	include 'errmsg.parm'
+
+* local parameter declarations
+	INTEGER nyes, nno
+	PARAMETER (nyes = 4,
+     .		   nno  = 6)
+
+* local variable declarations
+	LOGICAL TM_DIGIT
+	INTEGER	STR_MATCH, i
+	REAL	value
+	CHARACTER*8 yes_strings(nyes), no_strings(nno)
+
+	DATA (yes_strings(i),i=1,nyes)/'TRUE','T','Y','YES'/
+	DATA (no_strings(i),i=1,nno)/'FALSE','F','N','NO','BAD','MISSING'/
+	
+* initialize
+	status = ferr_ok
+
+* a blank string is a "false"
+	IF ( string .EQ. ' ' ) GOTO 2000
+
+* if the string is numerical then "0" is false, all other is true
+	IF ( TM_DIGIT(string) ) THEN
+	   READ ( string, *, ERR=5100) value
+	   IF ( value .EQ. 0.0 ) THEN
+	      GOTO 2000
+	   ELSE
+	      GOTO 1000
+	   ENDIF
+
+* if the string is non-numerical then try matching
+	ELSE
+	   i = STR_MATCH( string, yes_strings, nyes )
+	   IF ( i .NE. atom_not_found ) GOTO 1000	! a valid TRUE
+	   i = STR_MATCH( string, no_strings,  nno  )
+	   IF ( i .NE. atom_not_found ) GOTO 2000	! a valid FALSE
+	   GOTO 5100					! syntax err
+
+	ENDIF
+
+* return TRUE
+ 1000	TRUE_OR_FALSE = .TRUE.
+	RETURN
+
+* return FALSE
+ 2000	TRUE_OR_FALSE = .FALSE.
+	RETURN
+
+
+* error exit
+ 5100	TRUE_OR_FALSE = .FALSE.		! included for whiny OSF compiler
+        CALL ERRMSG( ferr_syntax, status, string, *2000 )
+	END
diff --git a/fer/utl/tstep_to_date.F b/fer/utl/tstep_to_date.F
new file mode 100644
index 0000000..8d8b859
--- /dev/null
+++ b/fer/utl/tstep_to_date.F
@@ -0,0 +1,138 @@
+	SUBROUTINE TSTEP_TO_DATE ( grid, idim, tstep, precision, date )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return a string giving the date for a particular timestep
+* This is done by figuring the offset from
+* 01-JAN-0000 00:00:00 in seconds, and then calculating the date.
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* rev. 0.0 3/17/88 - based on TM_STEP_TO_DATE by *mv*
+* rev. 0.1 - 2/16/89 - TM_SECS_TO_DATE --> SECS_TO_DATE
+* V300 4/93 - crash if precision exceeds 6
+* V530: *acm* 12/00 add calendar types; cal_id
+* V600 - SECS_TO_DATE --> SECS_TO_DATE_OUT for better formatting
+* V610: *acm*  2/08 Fix bug 762: if the axis is not modulo, always list the
+*                   year (previously never listed year 0 or year 1)
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 6D Ferret: Add E and F dimensions 
+*                  A time axis may be a T axis or F axis.
+
+* Arguments:
+*	grid	 - grid containing a time axis
+*	tstep    - time step
+*	precision- precision (1 to 6 for day,mon,yr,hr,min,sec, respectively )
+*			(use ABS(precision) - neg. indicates truncate left 0's)
+*	date	 - returned string containing date in ASCII form
+*
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+	include 'xtext_info.cmn'
+
+* calling argument declarations
+	CHARACTER*(*)	date
+	INTEGER		grid, idim, precision
+	REAL*8		tstep
+*
+* Local definitions
+        LOGICAL         modulo
+	CHARACTER*20	SECS_TO_DATE_OUT, buff, dms
+	INTEGER		axis, status, prec,
+     .                  TM_GET_CALENDAR_ID, cal_id
+	REAL*8		start_secs, offset_secs, this_secs
+	REAL*8		SECS_FROM_BC
+
+!	REAL*8		start_secs, offset_secs, this_secs, prec_fact(6)
+!	DATA	prec_fact	/  31536000.,  2628000.,  86400.,  3600.,
+!     .				   60., 1./
+
+* initialize
+	prec = ABS(precision)
+
+* get the axis number
+#ifdef double_p
+	axis = grid_line( idim, grid )
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   WRITE ( date, * ) (tstep)
+	   RETURN
+	ELSEIF ( (line_direction(axis).NE.'TI') .AND.
+     .           (line_direction(axis).NE.'FI')  ) THEN
+	   WRITE ( date, * ) (tstep)
+	   RETURN
+	ENDIF
+#else	
+	axis = grid_line( idim, grid )
+	IF ( axis .EQ. mnormal .OR. axis .EQ. munknown ) THEN
+	   WRITE ( date, * ) SNGL(tstep)
+	   RETURN
+	ELSEIF ( (line_direction(axis).NE.'TI') .AND.
+     .           (line_direction(axis).NE.'FI')  ) THEN
+	   WRITE ( date, * ) SNGL(tstep)
+	   RETURN
+	ENDIF
+#endif
+        modulo = line_modulo(axis)
+
+* get the calendar type
+
+        cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+	start_secs = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* Find the number of seconds since start of data set for this time step
+	offset_secs = tstep*line_tunit( axis )
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	this_secs = start_secs + offset_secs
+
+* round off date instead of truncating 
+* ( people don't normally view dates this way )
+!	this_secs = ( DNINT(this_secs/prec_fact(prec)) + 0.5 ) * prec_fact(prec)
+
+* Convert to date
+	date = SECS_TO_DATE_OUT(this_secs, cal_id, modulo, prec)
+
+
+* Finished
+	RETURN
+	END
diff --git a/fer/utl/tstep_to_secs.F b/fer/utl/tstep_to_secs.F
new file mode 100644
index 0000000..83a88f2
--- /dev/null
+++ b/fer/utl/tstep_to_secs.F
@@ -0,0 +1,118 @@
+	DOUBLE PRECISION FUNCTION TSTEP_TO_SECS( grid, idim, tstep )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a time step value relevant on a particular grid, "grid" into an
+* absolute time measured in seconds from 1-JAN-0000:00:00:00
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/27/88
+* V320: 12/94 - bug fix: not based on TSTEP_TODATE because the returned
+*	"date" string blanks out years 0000 and 0001 ==> cannot distinguish
+* V530: *acm* 12/00 add calendar types; cal_id
+*       *acm* 3/12 6D Ferret: Add E and F dimensions 
+*                  A time axis may be a T axis or F axis, so idim is now an arg.
+
+	include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+        include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	grid, idim
+	REAL*8	tstep
+
+* internal variable declarations:
+	INTEGER		TM_GET_CALENDAR_ID, axis, status, cal_id,
+     .                  prev_cal_id
+!	CHARACTER*20	date
+	REAL*8		SECS_FROM_BC, start_secs, offset_secs,
+     .                  tstep_new
+
+* internal parameter declarations:
+	INTEGER		seconds
+	PARAMETER     ( seconds = 6 )
+
+* determine time axis of grid
+	axis = grid_line( idim, grid )
+
+* valid time axis ?
+	IF ( line_direction( axis ) .EQ. 'TI'. OR.  
+     .       line_direction( axis ) .EQ. 'FI' ) THEN
+
+* determine time axis of grid
+
+	   cal_id = TM_GET_CALENDAR_ID ( line_cal_name(axis) )
+
+! pre 12/94 algorithm
+!* convert time step to date of format dd-mmm-yyyy:hh:mm:ss
+!	   CALL TSTEP_TO_DATE ( grid, tstep, seconds, date )
+!
+!* convert date to seconds since 1-JAN-0000:00:00:00
+!	   TSTEP_TO_SECS = SECS_FROM_BC( date, status )
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+	   start_secs = SECS_FROM_BC( line_t0(axis), cal_id, status )
+
+* If the tstep is negative, it was computed in default calendar
+c (looked at this as part of fix to 1365, but it it correct in general?)
+c           prev_cal_id = 1
+c           tstep_new = tstep
+c           IF (tstep .LT. 0) THEN
+c              IF (prev_cal_id .NE. cal_id) 
+c     .            CALL reset_secs_from_bc (-tstep, 
+c     .		     tstep_new, prev_cal_id, cal_id, status)
+c           ENDIF
+
+* Find the number of seconds since start of data set for this time step
+
+c	   offset_secs = tstep_new*line_tunit( axis )
+	   offset_secs = tstep*line_tunit( axis )
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	   TSTEP_TO_SECS = start_secs + offset_secs
+
+	ELSE
+
+* not a valid time axis
+	   TSTEP_TO_SECS = tstep
+
+	ENDIF
+	RETURN
+	END
diff --git a/fer/utl/tworld.F b/fer/utl/tworld.F
new file mode 100644
index 0000000..7aef2b9
--- /dev/null
+++ b/fer/utl/tworld.F
@@ -0,0 +1,81 @@
+	DOUBLE PRECISION FUNCTION TWORLD( subsc, grid, idim, where_in_box )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a subscript value on a grid into a "world" coordinate
+* if the axis is a valid time axis then convert the time step value into
+* seconds from jan-1-0000:00:00 so that all time axes are on an absolute scale
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/26/88
+* revision 0.1 -12/30/88 - added where_in_box
+* V230:  7/20/92 - check for valid time axis T0
+* V530: *acm* 12/00 alternative calendar types; cal_id
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret: Add E and F dimensions 
+*                  A time axis may be a T axis or F axis, so idim is 
+*                  now an arg to TSTEP_TO_SECS
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+
+* calling argument declarations:
+	INTEGER	subsc, grid, idim, where_in_box, 
+     .          TM_GET_CALENDAR_ID, cal_id
+
+* internal variable declarations:
+        LOGICAL TM_DATE_OK
+        INTEGER line
+	REAL*8	TM_WORLD, TSTEP_TO_SECS, ww
+
+* standard conversion into world coordinates
+	ww = TM_WORLD( subsc, grid, idim, where_in_box )
+	TWORLD = ww
+
+* special treatment of calendar time axis
+	IF ( idim .EQ. t_dim .OR. idim .EQ. f_dim ) THEN
+           line = grid_line( idim, grid )
+           cal_id = TM_GET_CALENDAR_ID ( line_cal_name(line) )
+           IF ( TM_DATE_OK( line_t0(line), cal_id )  )
+     .     TWORLD = TSTEP_TO_SECS( grid, idim, ww )
+	ENDIF
+	RETURN
+	END
diff --git a/fer/utl/unit_chg_ax.F b/fer/utl/unit_chg_ax.F
new file mode 100644
index 0000000..f05ad48
--- /dev/null
+++ b/fer/utl/unit_chg_ax.F
@@ -0,0 +1,91 @@
+	LOGICAL FUNCTION UNIT_CHG_AX( cx, idim, trans )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* if a transformation has changed the units of this variable return the info
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:   1/12/90
+* V420: send back the transformation that has been applied
+* V603 5/07  *acm* - added MODNBD modulo regridding statistic
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'xcontext.cmn'
+
+* calling argument declarations
+	INTEGER	cx, idim, trans
+
+* internal variable declarations
+* ...
+
+* transformations are performed from x to t order.
+* It is the LAST transformation that determines the units (at least so far)
+* (probably a very imperfect test ... 11/95)
+	DO 100 idim = nferdims, 1, -1
+	   IF ( cx_trans(idim,cx) .EQ. trans_locate ) THEN
+	      trans = punit_mod_loc
+	      GOTO 200
+	   ELSEIF (cx_trans(idim,cx) .EQ. trans_variance
+     .	     .OR. ( cx_unstand_grid(cx)
+     .	      .AND. (cx_regrid_trans(idim,cx).EQ.prgrd_variance
+     .	        .OR. cx_regrid_trans(idim,cx).EQ.prgrd_modvar)  ) ) THEN
+	      trans = punit_mod_variance
+	      GOTO 200
+	   ELSEIF (cx_trans(idim,cx) .EQ. trans_bad_pt
+     .	      .OR. cx_trans(idim,cx) .EQ. trans_good_pt
+     .	      .OR. ( cx_unstand_grid(cx)
+     .	       .AND. (cx_regrid_trans(idim,cx).EQ.prgrd_good_pt
+     .		 .OR. cx_regrid_trans(idim,cx).EQ.prgrd_modngd
+     .		 .OR. cx_regrid_trans(idim,cx).EQ.prgrd_modnbd)  ) ) THEN
+	      trans = punit_mod_npoints
+	      GOTO 200
+	   ENDIF
+ 100	CONTINUE
+
+* no unit change
+	UNIT_CHG_AX = .FALSE.
+	RETURN
+	
+* yes, unit change
+ 200	UNIT_CHG_AX = .TRUE.
+	RETURN
+
+	END
diff --git a/fer/utl/update_attributes.F b/fer/utl/update_attributes.F
new file mode 100644
index 0000000..280e349
--- /dev/null
+++ b/fer/utl/update_attributes.F
@@ -0,0 +1,130 @@
+      SUBROUTINE UPDATE_ATTRIBUTES (dset, uvar)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V670  2/11 *acm*   Fixes for inheriting attributes.
+
+* Get the attribute information from the linked-list structure that is needed 
+* to do a plot.
+
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'ferret.parm'
+        include 'errmsg.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xtext_info.cmn'
+	include 'xdset_info.cmn_text'
+        include 'xdset_info.cd_equiv'
+	external xdset_info_data
+
+* Argument declarations
+
+      INTEGER uvar, dset
+
+* Local variable declarations
+      LOGICAL NC_GET_ATTRIB, coordvar, got_it, do_warn
+      INTEGER TM_LENSTR1, varid, vartyp, nvdim, vdims(8),
+     .        nvatts, attlen, attoutflag, status, vlen, maxlen, 
+     .        all_outflag
+      REAL tmp
+      CHARACTER*128 vname, buff
+
+      varid = cd_varid(uvar)
+      IF (dset .EQ. -1) varid = uvar
+
+* get the vital statistics for this variable
+
+      CALL CD_GET_VAR_INFO(dset, varid, vname, vartyp, 
+     .      nvdim, vdims, nvatts, coordvar, all_outflag, status)
+      vlen = TM_LENSTR1(vname)
+
+      do_warn = .TRUE.
+
+* Get long_name, units, missing_value
+
+      IF (dset .EQ. unspecified_int4) RETURN
+      IF (dset .GE. 1) THEN
+         maxlen = 128
+         got_it = NC_GET_ATTRIB( dset, varid, 'long_name',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_title(uvar), tmp )
+
+         maxlen = 128
+         got_it = NC_GET_ATTRIB( dset, varid, 'long_name_mod',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_titl_mod(uvar), tmp )
+
+         maxlen = 64
+         got_it = NC_GET_ATTRIB( dset, varid, 'units',
+     .                     do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_units(uvar), tmp )
+
+         maxlen = 1
+         got_it = NC_GET_ATTRIB( dset, varid, 'missing_value',
+     .                do_warn, vname(:vlen), maxlen, attlen,
+     .                attoutflag, buff, ds_bad_flag(uvar) )
+
+* For user variable update these in uvar_title, etc.
+
+       ELSE IF (dset .EQ. -1) THEN
+         maxlen = 128
+         got_it = NC_GET_ATTRIB( dset, varid, 'long_name',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, uvar_title(uvar), tmp )
+
+         maxlen = 64
+         got_it = NC_GET_ATTRIB( dset, varid, 'units',
+     .                     do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, uvar_units(uvar), tmp )
+
+         maxlen = 1
+         got_it = NC_GET_ATTRIB( dset, varid, 'missing_value',
+     .                do_warn, vname(:vlen), maxlen, attlen,
+     .                attoutflag, buff, uvar_bad_data(uvar) )
+
+      ENDIF
+
+* successful completion - variable attributes updated
+ 1000 status = ferr_ok
+      RETURN
+      END
diff --git a/fer/utl/upper_case.F b/fer/utl/upper_case.F
new file mode 100644
index 0000000..4e16aaa
--- /dev/null
+++ b/fer/utl/upper_case.F
@@ -0,0 +1,84 @@
+	CHARACTER*1 FUNCTION UPPER_CASE ( input_char )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert character string to upper case
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/4/86
+* Unix/RISC port - 2/13/91 - .AND. always produces a logical result
+
+* 5/95 *sh* - added ifdef for HP port
+* 12/96 *kob* - Linux port 
+*               - had to declare hex constants as implicit
+*                 integers in DATA statements.  Added a 
+*                 FORTRAN_90 ifdef to accomplish this. 
+*               - Needs to use IAND rather than AND
+* V63  *acm* 10/09 Changes for gfortran build
+
+
+	CHARACTER*1 input_char
+
+* kob 12/96
+#ifdef FORTRAN_90
+      INTEGER HEXDF
+      DATA HEXDF/Z'DF'/
+#endif
+
+	IF ( input_char .LT. 'a' .OR. input_char .GT. 'z' ) THEN
+	   upper_case = input_char
+	ELSE
+* modify if logic for linux - also vms needs iand - like that
+* matters anymore - just to keep it clean *kob* 12/96
+
+#if defined unix  && !defined NEED_IAND
+           upper_case = CHAR( AND('DF'X , ICHAR( input_char ) ) )
+#else
+#  ifdef FORTRAN_90 			
+	   upper_case = CHAR( IAND(HEXDF, ICHAR( input_char ) ) )
+# elif defined gfortran
+           upper_case = CHAR( AND('DF'X , ICHAR( input_char ) ) )
+#  else
+	   upper_case = CHAR( IAND('DF'X , ICHAR( input_char ) ) )
+#  endif
+#endif
+	ENDIF
+
+	RETURN
+	END
diff --git a/fer/utl/valid_grid.F b/fer/utl/valid_grid.F
new file mode 100644
index 0000000..cb940a9
--- /dev/null
+++ b/fer/utl/valid_grid.F
@@ -0,0 +1,68 @@
+	LOGICAL FUNCTION VALID_GRID( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check to see that all the axes of the given grid are well defined
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+** V200: 10/24/89
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations:
+	INTEGER	grid
+
+* internal variable declarations:
+	INTEGER	idim
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+
+	DO 100 idim = 1, nferdims
+	   IF ( grid_line(idim,grid) .EQ. munknown ) THEN
+* ... its bad
+	      VALID_GRID = .FALSE.
+	      RETURN
+	   ENDIF
+ 100	CONTINUE
+
+* its OK
+	VALID_GRID = .TRUE.
+	RETURN
+	END
diff --git a/fer/utl/which_gcfcn.F b/fer/utl/which_gcfcn.F
new file mode 100644
index 0000000..0957c38
--- /dev/null
+++ b/fer/utl/which_gcfcn.F
@@ -0,0 +1,65 @@
+	INTEGER FUNCTION WHICH_GCFCN( uvar )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* which grid-changing fuction is used by the indicated GC variable?
+
+* V450: 1/97
+* 2/12 *acm* 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+* calling argument declarations
+	INTEGER	uvar
+
+* internal variable declarations
+	INTEGER GCF_FIND_FCN, item
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xvariables.cmn'
+
+
+* in reverse Polish order the final item of a grid changing variable will
+* always be a grid changing function
+	item = uvar_num_items(uvar)
+
+* identify the function
+	WHICH_GCFCN = GCF_FIND_FCN( uvar_text(uvar)
+     .					(uvar_item_start(item,uvar)
+     .					:uvar_item_end  (item,uvar)) )
+
+	RETURN
+	END
diff --git a/fer/xeq/LIB_NAME b/fer/xeq/LIB_NAME
new file mode 100644
index 0000000..6ad5726
--- /dev/null
+++ b/fer/xeq/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libxeq.a
+ 
diff --git a/fer/xeq/Makefile b/fer/xeq/Makefile
new file mode 100644
index 0000000..c9dedd8
--- /dev/null
+++ b/fer/xeq/Makefile
@@ -0,0 +1,37 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/fer/xeq/SOURCE_FILES b/fer/xeq/SOURCE_FILES
new file mode 100644
index 0000000..1419a17
--- /dev/null
+++ b/fer/xeq/SOURCE_FILES
@@ -0,0 +1,28 @@
+SRCS_F = \
+xeq_cancel.F\
+xeq_contour.F\
+xeq_define.F\
+xeq_elif.F\
+xeq_else.F\
+xeq_endif.F\
+xeq_exit.F\
+xeq_frame.F\
+xeq_go.F\
+xeq_help.F\
+xeq_if.F\
+xeq_list.F\
+xeq_load.F\
+xeq_message.F\
+xeq_plot.F\
+xeq_polygon.F\
+xeq_pplus.F\
+xeq_query.F\
+xeq_repeat.F\
+xeq_set.F\
+xeq_shade.F\
+xeq_show.F\
+xeq_spawn.F\
+xeq_stat.F\
+xeq_vector.F\
+xeq_wire.F\
+xeq_write.F 
diff --git a/fer/xeq/xeq_cancel.F b/fer/xeq/xeq_cancel.F
new file mode 100644
index 0000000..d360752
--- /dev/null
+++ b/fer/xeq/xeq_cancel.F
@@ -0,0 +1,1252 @@
+	SUBROUTINE XEQ_CANCEL( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the CANCEL command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+* revision 0.1 - 12/15/86
+* revision 0.2 - 3/20/87 - changes for new TMAP library
+* revision 0.3 - 5/1/87  - added CANCEL MOVIE, CANCEL LIST/OUT, CANCEL REGION
+*			   and CANCEL EXPRESSION
+* revision 0.4 - 8/29/87 - updated CANCEL LIST for unformatted option
+* revision 0.5 - 9/11/87 - updated CANCEL LIST for BIBO option
+* revision 0.6 - 9/16/87 - added CANCEL GRID (not imp)
+* revision 0.7 - 9/23/87 - modified CANCEL REGION for predefined regions
+*			   and added CANCEL LIST/HEAD
+* revision 0.8 - 10/5/87 - modified CANCEL LIST to toggle SET LIST
+*			   and added CANCEL LIST/APPEND
+* revision 0.9 - 3/7/88  - added list_tmap
+* revision 1.0 - 6/29/88 - added CANCEL MEMORY
+*			 - CANCEL LIST returns filename to 'AUTO'
+*			 - added CANCEL WINDOW
+* revision 1.1 - 7/2/88  - CANCEL DATA now wipes out all memory variables that
+*			   depend on a climatological air temp. field
+* revision 1.2 - 8/2/88  - added mode wait
+* revision 1.3 - 9/1/88  - added CANCEL VIEWPORT name
+* revision 1.4 - 12/2/88 - bug fix: cancel mem only to max_mr_avail
+* revision 1.5 - 1/10/89 - added CANCEL MODE REJECT, corrected last_mode
+* revision 1.6 - 2/16/89 - ds_open --> ds_name.EQ.char_init30 to test open-ness
+* revision 1.7 - 2/17/89 - GT_CLOSE_SET --> TM_CLOSE_SET   
+* revision 1.8 - 4/1/89  - MODE WAIT directly sets PPLUS variable deflts
+* V200:  5/24/89 - layout changes, only
+* 		 - deleted variables are flagged in mr_protected
+*		 - added CANCEL VARIABLE
+*		 - CANCEL DATA purges all user defined variables
+*		 - added laser movie output
+*	10/20/89 - CANCEL DATA removed to CANCEL_DATA_SET, if only one set left
+*		 - then cancel data points to it
+*	  1/5/90 - added CANCEL MODE metafile
+*	 3/13/90 - call CANCEL_WINDOW even if in batch mode
+* Unix/RISC port - 4/25/91 *sh*: increased ds_name size
+*                              : bug fix in CANCEL MODE: mode_GKS --> pmode_GKS
+* V230:5/14/92 - REMOTE_X mode was replaced by the REFRESH mode
+*       6/8/92 - added CANCEL ALIAS
+*       6/9/92 - CANCEL LIST uses list_fmt_type
+*              - added tmap_diag_on to mode diagnostic
+*      8/25/92 - added CANCEL AXIS/MODULO
+*      11/4/92 - CANCEL VARIABLE to handle long names
+*     1/14/93  - gutted CANCEL MOVIE
+* V300:2/10/93 - CANCEL MODE META will also issue PPL CLSPLT 
+*      5/12/93 - added MODE PPLLIST and MODE JOURNAL filename
+*      5/24/93 - added CANCEL DATA/NOERROR
+*      6/16/93 - added CANCEL MODE GUI
+*      2/24/94 - incorporate a stack of past mode states
+* V312: 5/94 - array "memory" as a calling argument
+* V314:9/1/94 *kob* IBM port - Need to make logical comparisons with NEQ 
+*			       or NEQV
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/18/94 - check CANCEL MODE VERIFY for "ALWAYS" state
+*	 2/28/95 - update TMAP COMMON alt_messages when mode_gui is CANCELLED
+* V400:  6/22/95 - added CANCEL SYMBOL
+* V411:   9/1/95 - Added support for  CAN VAR/D=dset var
+*	  10/95  - buffer READ(*) for AIX port
+* V420:    4/96  - use arg_to_item to make comma-separated line blank sep
+*		 - templates in CANCEL VAR, SYMBOL, ALIAS, VIEW
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V450:    7/97  - update CANCEL VAR/ALL so it handles child vars and dynamic
+*                  grids/axes
+* V510: 5/00 *sh* - added CANCEL AXIS and CANCEL GRID
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01 remove VMS include statements
+* v541 *acm*  6/02 Add CANCEL AXIS/ALL
+*             6/02 For irregular axes, on CANCEL AXIS axname, recover line_mem
+*                  space with call to PACK_LINE_STORAGE
+* v541 *acm*  7/02 Capitalize routine names in CALL PACK_LINE_STORAGE, DEALLO_ALL_AXES.
+* v551 *acm*  1/03 Bug fix: datasets starting with digit not correctly cancelled.
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+*       *acm* 6/04 - CANCEL AXIS/DEPTH as inverse to SET AXIS/DEPTH
+* V600: *acm* 2/06 - fix bug 1392: cancel dataset whose name starts with digit.
+* V600 *acm* 10/05 CANCEL ATTRIBUTE[/ALL][/OUTPUT] varname.attname
+* V600 *acm* 5/06 MODE LINECOLORS User can change the number of line colors.
+* V600 *acm* 6/06 additional declarations found by Solaris compiler
+* V602 *jli* 7/06 added CANCEL AXIS/STRIDE
+* V601 *acm*11/06 Fix bug 1470: on a CANCEL AXIS/MODULO or CANCEL AXIS/DEPTH, change
+*                 values in the attribute structure for the axis.
+* V602: *acm* 1/07 Changes for metafile-batch mode: When in gif mode or batch mode, 
+*                  ignore CANCEL MODE META
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* v604 *acm* 7/07 increase length of
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V610  *acm* 3/08 Fixes for metafile batch mode
+* V63   *acm* 9/09 Fix bug 1691: deallocate use of dynamic axis when it is found in a grid.
+*                  If more than one grid uses the dyn axis, deallocate use of axis for each.
+* V66   *kms* 5/10 add CANCEL REDIRECT for stdout/stderr redirection
+* PyFr  *kms* 3/11 Add CANCEL PYVAR /ALL /DATASET
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 3/12 removing old calls to LASER_STATUS routine for movies
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+*       *acm* 4/12 Remove MODE FOURDEE, using _E, _F, _M, _N instead, throughout.
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* V683 *acm*  8/12 add new CANCEL LIST/OUTTYPE=  
+* V685 *acm*  4/13 Changes for ensemble datasets, correctly handle flag for hiding 
+*                  ensemble members 
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+* V690 *sh* 1/14 add CAN VAR/SIGMA
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdiag_ctrl.cmn_text'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+	include 'xalt_messages.cmn_text'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'movies.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xfr_grid.cmn'
+	include 'xvideo.cmn'
+	include 'xcommand.cmn'
+	include	'xcontrol.cmn'
+	include	'pltcom_dat.decl'	! with gksopn
+	include	'PLTCOM.DAT'	! with gksopn
+	include	'switch_inc.decl'	! with deflts
+	include	'SWITCH.INC'	! with deflts
+        include 'LUNITS.INC'          ! with lttout
+        include 'lunits_inc.decl'
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	INTEGER		REGION_NUMBER, FIND_DSET_NUMBER,
+     .                  TM_GET_LINENUM, TM_GET_GRIDNUM, 
+     .			TM_GET_GRID_OF_LINE, TM_LENSTR1, STR_UPCASE,
+     .                  STR_SAME, ITS_GIF_GRAPHICS, ITS_BATCH_GRAPHICS,
+     .			ivp, i, blen, ier, i1, num_protected_axes,
+     .			status, variable, category,
+     .			idim, iqual, iset, item, ivar, nth, mr,
+     .			mode, cx, axis, grid, mod_cx,
+     .                  TM_LENSTR, len_test, len_mchars, varid,
+     .                  dset, cat, var, mods_cx, iflag, loc, 
+     .                  nvdims, vdims(8), nvatts, vtype, all_outflag, 
+     .                  slen, iatt, igrd, iline, new_att_modulo_len,
+     .			cache_size, cache_nelems, cache_preemption
+	LOGICAL		MATCH4, TM_DIGIT_TEST, IS_TEMPLATE, MATCH_TEMPLATE,
+     .			report_error, slash_all, del_perm, del_temp,
+     .                  perm_var, all_dims, coordvar, do_err, 
+     .                  canout, new_att_modulo,
+     .                  redir_cancel_stdout, redir_cancel_stderr
+
+	CHARACTER	arg*4, buff*512, argsym*120, varname*512,
+     .                  attname*128, show_str*12, buff2*3, DUMMY*512
+
+* local parameter declarations:
+	INTEGER		slash_del_temp, slash_del_perm
+	PARAMETER     ( slash_del_temp = 1+1,
+     .			slash_del_perm = 2+1 )
+
+* command given with /ALL ?
+	slash_all = .FALSE.
+	DO 10 iqual = 1, num_qualifiers
+	IF ( qualifier_list( iqual ) .EQ. 1 ) slash_all = .TRUE.
+ 10	CONTINUE
+
+* if the user entered a blank-separated list insteas of comma-separated
+* then make it behave like a comma-separated list (4/96)
+	CALL ARG_TO_ITEM
+
+* select subcommand
+	GOTO ( 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
+     .        1100,1200,1300,1400,1500,1600,1700, 1800, 1900 ) 
+     .       subcmnd_num
+
+* CANCEL '    '
+* arrival at this point usually means an illegal subcommand was given
+* and was assumed to be an argument by the command parser
+ 100	IF ( num_args .GE. 1 ) THEN
+	   CALL ERRMSG( ferr_invalid_subcmnd,status,
+     .				cmnd_buff( arg_start(1):arg_end(1) ), *5000 )
+	ELSE
+	   GOTO 5010
+	ENDIF
+	RETURN
+
+* CANCEL WINDOW
+ 200	CALL CANCEL_WINDOW( status )
+	RETURN
+
+* CANCEL REGION[/ALL/X/Y/Z/T/E/F/I/J/K/L/M/N] [region_name]
+ 300	IF ( slash_all .AND.
+     .	     (num_args.GT.0 .OR. num_qualifiers.GT.1) ) GOTO 5310
+	all_dims = num_qualifiers .EQ. 0
+	IF ( slash_all ) THEN
+* ... CANCEL REGION/ALL
+	   DO 302 idim = 1, nferdims
+ 302	   CALL DEL_CX_DIM( idim, cx_last )
+	   DO 304 cx = 0, min_context, -1
+ 304	   cx_name( cx ) = unspecified_name4
+	ELSEIF ( num_args .EQ. 0 ) THEN
+* ... CANCEL REGION[/I/J/K/L/M/N]
+	   DO 310 idim = 1, nferdims
+	      IF ( all_dims
+     .	      .OR. qual_given(idim+1) .GT. 0		! /I/J/K/L/M or /N
+     .	      .OR. qual_given(idim+nferdims+1) .GT. 0 ) THEN	! /X/Y/Z/T/E or /F
+	         CALL DEL_CX_DIM( idim, cx_last )
+	      ENDIF
+ 310	   CONTINUE
+	ELSE
+* ... CANCEL REGION[/I/J/K/L/M/N] name
+	   DO 340 item = 1, num_items
+	      arg = cmnd_buff( item_start(item):item_end(item) )
+	      cx = REGION_NUMBER( arg )
+	      IF ( cx .EQ. unspecified_int4 ) CALL ERRMSG
+     .			( ferr_unknown_arg, status, arg, *5000 )
+	      IF ( all_dims ) THEN
+	         cx_name( cx ) = unspecified_name4
+	      ELSE
+	         DO 320 idim = 1, nferdims
+	            IF ( qual_given(idim+1) .GT. 0		! /I/J/K/L/M or /N
+     .	            .OR. qual_given(idim+nferdims+1) .GT. 0 ) THEN ! /X/Y/Z/T/E or /F
+	               CALL DEL_CX_DIM( idim, cx )
+	               cx_given( idim, cx ) = .FALSE.
+	            ENDIF
+ 320	         CONTINUE
+	      ENDIF	         
+ 340	   CONTINUE
+	ENDIF
+	RETURN
+
+* CANCEL MEMORY /ALL /TEMP[default] or /PERM
+ 400	del_perm = slash_all .OR. qual_given( slash_del_perm ) .GT. 0
+	del_temp = slash_all .OR. qual_given( slash_del_temp ) .GT. 0
+     .			     .OR. .NOT.del_perm
+	   DO 410 mr = 1,max_mr_avail
+	      IF ( mr_protected( mr ) .EQ. mr_deleted ) GOTO 410
+	      perm_var = mr_protected(mr) .EQ. mr_perm_protected
+	      IF ( del_perm .AND. perm_var
+     .	      .OR. del_temp .AND. .NOT.perm_var )
+     .				CALL DELETE_VARIABLE( mr )
+ 410	   CONTINUE
+	IF ( del_perm ) CALL SPLIT_LIST(pttmode_ops, err_lun, 
+     .			' PERMANENT data cleared from memory', 0)
+	IF ( del_temp ) CALL SPLIT_LIST(pttmode_ops, err_lun, 
+     .			' TEMPORARY data cleared from memory', 0) 
+	RETURN
+
+* CANCEL EXPRESSION
+ 500	CALL DELETE_OLD_EXPR
+	num_uvars_in_cmnd = cmnd_uvars_not_given
+	RETURN
+
+* CANCEL LIST
+ 600	IF ( slash_all .OR. qual_given( slash_canc_list_prec   ) .GT. 0 )
+     .	   list_digits = default_output_precision
+	IF ( slash_all .OR. qual_given( slash_canc_list_out ) .GT. 0 ) THEN
+	   list_file       = 'AUTO'
+	ENDIF
+	IF ( slash_all .OR. qual_given( slash_canc_list_append ) .GT. 0 )
+     .	   list_append = .FALSE.
+	IF ( slash_all .OR. qual_given( slash_canc_list_form ) .GT. 0 ) THEN
+	   list_format_given = .FALSE.
+	   list_fmt_type     = plist_default
+	ENDIF
+	IF ( slash_all .OR. qual_given( slash_canc_list_outtyp ) .GT. 0 ) THEN
+	   list_outtype = 'DFLT'
+	   list_fmt_type     = plist_default
+	ENDIF
+	IF ( qual_given( slash_canc_list_heading ) .GT. 0 ) THEN
+	   list_heading = .FALSE.
+	ELSEIF ( slash_all ) THEN
+	   list_heading = .TRUE.		! /ALL restores default state
+	ENDIF
+
+	IF (slash_all) CALL NETCDF4_CANCEL_SETTINGS
+	RETURN
+
+* CANCEL DATA_SET data_set_number1,number2,...
+ 700	report_error = qual_given(slash_canc_data_noerr) .LE. 0      ! 5/93
+ 	IF ( num_items .GT. 0 ) THEN
+	   DO 710 item = 1, num_items
+	      buff = cmnd_buff(item_start(item):item_end(item))
+	      blen = item_end(item)-item_start(item)+1
+* interpret and check the data set specified
+	      IF ( TM_DIGIT_TEST(buff) ) THEN
+	         argsym = buff(:blen)			! 10/95 for AIX
+
+*  (1/03 *acm*) See xeq_set
+#ifdef MANDATORY_FORMAT_WIDTHS
+	         READ ( argsym,*,ERR=610 ) iset
+#else
+	         READ ( argsym,'(I)',ERR=610 ) iset
+#endif
+
+* ... check for valid number given
+	         IF ( iset .LT. 1 .OR. iset .GT. maxdsets ) GOTO 5030
+	         IF (  ds_name( iset ) .EQ. char_init1024) THEN
+	            IF ( report_error ) THEN
+	               GOTO 5030
+	            ELSE
+	               GOTO 710
+	            ENDIF
+	         ENDIF
+	         GOTO 705
+
+*     argument starts with a number but is not a number.
+*     Check for a valid dataset name
+
+ 610	         iset = FIND_DSET_NUMBER( buff(:blen) )
+	         IF (  iset .EQ. unspecified_int4 )then
+	            IF ( report_error ) THEN
+	               GOTO 5030
+   	            ELSE
+	               GOTO 710
+	            ENDIF
+	         ENDIF
+
+	      ELSE
+  	         iset = FIND_DSET_NUMBER( buff(:blen) )
+	         IF (  iset .EQ. unspecified_int4 )then
+	            IF ( report_error ) THEN
+	               GOTO 5030
+	            ELSE
+	               GOTO 710
+	            ENDIF
+	         ENDIF
+	      ENDIF
+
+ 705	      CALL CANCEL_DATA_SET( iset, slash_all, status )
+ 710	   CONTINUE
+* ... if only one set remains then point to it
+	   iset = unspecified_int4
+	   DO 715 i = 1, maxdsets
+	     IF ( ds_name(i) .EQ. char_init1024) GOTO 715
+	     IF ( iset .EQ. unspecified_int4 ) THEN
+	         iset = i
+	     ELSE
+	         GOTO 790
+	     ENDIF
+ 715	   CONTINUE
+	   cx_data_set( cx_last ) = iset
+
+	ELSEIF ( slash_all ) THEN
+* First cancel any ensemble sets
+	   DO 718 iset = 1, maxdsets
+	      IF ( ds_name(iset) .EQ. char_init1024) GOTO 718
+	      IF ( ds_type(iset) .EQ. 'ENS') 
+     .		CALL CANCEL_DATA_SET( iset, slash_all, status )
+ 718	   CONTINUE
+* Now any others. 
+	   DO 720 iset = 1, maxdsets
+	      IF ( ds_name(iset) .EQ. char_init1024) GOTO 720
+	      CALL CANCEL_DATA_SET( iset, slash_all, status )
+ 720	   CONTINUE
+
+	ELSE
+	   GOTO 5010
+	ENDIF
+ 790	RETURN
+
+* CANCEL MODE mode_name
+* loop through the list of mode names given
+ 800	IF ( num_items .EQ. 0 ) GOTO 5010
+	DO 820 item = 1, num_items
+* identify the specified mode to CANCEL
+           len_test = TM_LENSTR(cmnd_buff( item_start(item):item_end(item) ))
+	   DO 810 mode = 1, max_modes
+              len_mchars = TM_LENSTR(mode_name( mode)(:4))
+	      IF ( MATCH4( cmnd_buff( item_start(item):item_end(item) ),
+     .			  len_test, mode_name( mode),len_mchars )) THEN
+	         IF ( mode.EQ.pmode_GKS .AND. gksopn ) GOTO 5820
+* ... ignore MODE VERIFY from a GO file if MODE VERIFY:ALWAYS is set
+	         IF ( mode.EQ.pmode_verify
+     .	        .AND. mode_arg(mode,1).EQ.3
+     .	        .AND. csp .GT. 0 ) GOTO 820
+* ... push the mode stack adding on a FALSE (because it's CANCEL)
+	         DO 806 i = mode_stack_size, 2, -1
+	            mode_state(mode,i) = mode_state(mode,i-1) 
+		    mode_arg  (mode,i) = mode_arg  (mode,i-1)
+ 806	         CONTINUE
+		 mode_state( mode,1 ) = .FALSE.
+* ... WAIT requires a string to communicate with PPLUS
+	         IF ( mode .EQ. pmode_wait ) THEN
+	            ppl_wait = 'NOWAIT'
+	            deflts(5) = .FALSE.
+* ... when REJECT is changed transformed and regridded variables may be wrong
+	         ELSEIF ( mode .EQ. pmode_reject
+     .		.AND. (mode_state(mode,1) .NEQV. mode_state(mode,2))) THEN
+	            CALL DELETE_TRANSFORMED_VARS( status )
+	            IF ( status .NE. ferr_ok ) RETURN
+* ... mode metafile may require immediate communication with PPLUS
+	         ELSEIF ( mode .EQ. pmode_metafile ) THEN
+                    mode_metafile = .FALSE.
+ 	            IF ( gksopn ) THEN
+                       CALL SEND_PLTYPE( mode_metafile )
+                       CALL PPLCMD ( from, line, 0, 'CLSPLT', 1, 1 )  ! 2/93
+                    ELSE
+                       CALL CANCEL_SAVEONEXIT
+                    ENDIF
+* ... mode REFRESH sends message to gnu READLINE routine to turn off refresh
+	         ELSEIF ( mode .EQ. pmode_Xwindows ) THEN
+	            CALL TM_SET_FREE_EVENT(0)
+* ... mode diagnostic sends message to TMAP library
+                 ELSEIF ( mode .EQ. pmode_diagnostic ) THEN
+                    tmap_diag_on = .FALSE.
+* ... mode journal - turn off journaling
+                 ELSEIF ( mode .EQ. pmode_journal ) THEN
+	            IF ( jrnl_lun .NE. unspecified_int4 )
+     .                  CLOSE( UNIT=jrnl_lun, ERR = 5830 )
+		    jrnl_lun = unspecified_int4
+* ... mode ppllist - restore PPLUS listings to screen
+                 ELSEIF ( mode .EQ. pmode_ppllist ) THEN
+	            IF ( jrnl_lun .NE. 6 )
+     .                  CLOSE( UNIT=lttout, ERR = 5830 )
+		    lttout = 6
+* ... mode graticule - turn off automatic graticules
+                 ELSEIF ( mode .EQ. pmode_grat ) THEN
+	            grat_on = .FALSE.
+                    mode_grat_buff = ' '
+* ... mode linecolors - resets number of line colors to 6
+*                       the mode itself is always .TRUE.
+                 ELSEIF ( mode .EQ. pmode_linecolors ) THEN
+                    num_linecolors  = 6
+		    mode_arg( mode,1 ) = num_linecolors
+		    mode_state( mode,1 ) = .TRUE.
+
+                    WRITE (show_str, 2000) mode_arg(pmode_linecolors, 1)
+ 2000               FORMAT (I3)
+                    IF (no_plot_yet) THEN
+                       CALL START_PPLUS(.FALSE.)
+                       CALL PPLCMD (from, line, 0, 
+     .                   'LINECOLORS '//show_str(1:3)//' 1', 1, 1)
+                       CALL DISP_RESET
+                    ELSE
+                       CALL PPLCMD (from, line, 0, 
+     .                   'LINECOLORS '//show_str(1:3)//' 0', 1, 1)
+                       CALL WARN ('New number of line colors will take '//
+     .                  'effect on next new window: SET WIN/NEW or '//
+     .                  'SET WIN/CLEAR')
+                    ENDIF
+
+* ... mode shrink_ylab allows the y-axis label to automatically shrink
+*     so it doesn't run off the page.
+                 ELSEIF ( mode .EQ. pmode_shrink_ylab ) THEN
+	            CALL PPLCMD ( from, line, 0, 'SHRINKY 0', 1, 1 )
+
+* ... mode pplgui - close reply pipe
+                 ELSEIF ( mode .EQ. pmode_gui ) THEN
+	            alt_messages = .FALSE.
+		    CONTINUE
+!	            CALL GUI_PIPE_CLOSE( status )
+!		    IF ( status .NE. ferr_ok ) GOTO 5000
+
+	         ENDIF
+		 GOTO 820
+	      ENDIF
+ 810	   CONTINUE
+* unidentifiable mode name
+	   GOTO 5020
+ 820	CONTINUE
+	RETURN
+
+* CANCEL MOVIE
+ 900	frame_on = .FALSE.
+	RETURN
+
+* CANCEL VIEWPORT
+ 1000	IF ( num_items .EQ. 0 ) THEN
+* return to default(full) viewport
+	   CALL SET_VIEWPORT( mvp_dflt )
+	ELSE
+* cancel a viewport definition
+	   DO 1050 item = 1, num_items
+	      i1 = STR_UPCASE(buff,
+     .			cmnd_buff(item_start(item):item_end(item)))
+	      DO 1040 ivp = 1, max_viewport
+	         IF ( vp_name(ivp).EQ.unspecified_name4 ) GOTO 1040
+	         IF ( MATCH_TEMPLATE(vp_name(ivp),buff) ) THEN
+	            IF (ivp.EQ.mvp_dflt) GOTO 5040
+	            vp_name( ivp ) = unspecified_name4
+	            IF ( vp_num .EQ. ivp ) vp_num = mvp_dflt
+	         ENDIF
+ 1040	      CONTINUE
+ 1050	   CONTINUE
+	ENDIF
+	RETURN
+
+* CANCEL VARIABLE
+* ... data set specified?
+* /D=xxx: has the user requested CANCEL VAR/D= ?
+ 1100	iqual = qual_given( slash_canc_var_data )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( buff .EQ. ' ' ) THEN
+	      iset = pdset_irrelevant	! "/D", alone for default-to-dset
+	      buff = 'No current data set'	! ... for error reporting
+	      IF ( iset .EQ. unspecified_int4) GOTO 5130
+	   ELSE
+	      iset = FIND_DSET_NUMBER( buff )
+	      IF ( iset .EQ. unspecified_int4) GOTO 5130
+	   ENDIF
+	ELSE
+	   iset = unspecified_int4
+	ENDIF
+
+* /SIGMA
+	IF (qual_given(slash_canc_var_sigma) .GT. 0) THEN 
+	   IF (slash_all) CALL TM_NOTE('/ALL ignored when /SIGMA is specified.',
+     .				        err_lun)
+	   IF (num_args .EQ. 0) GOTO 5010
+	   DO item = 1, num_args
+	      i1 = STR_UPCASE(buff,
+     .			cmnd_buff(item_start(item):item_end(item)))
+	      dset = unspecified_int4    ! to be determined during parse
+	      CALL PARSE_NAM_DSET( buff, cx_last, dset,
+     .			        category, variable, mod_cx, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      IF ( variable .EQ. munknown_var_name ) GOTO 5110
+* ... not sure ... how are LET/D vars found?
+	      IF (category .EQ. cat_user_var) dset = -1  ! signals a uvar ??
+	      CALL CD_GET_VAR_ID (dset, buff, varid, status)
+              CALL CD_DELETE_ATTRIBUTE (dset, varid, patnam_sigma, status )
+	      CALL PURGE_ALL_UVARS
+	   ENDDO
+	   RETURN
+	ENDIF
+
+* /ALL
+	IF ( slash_all
+     .	.OR. (num_items.EQ.0 .AND. iset.NE.unspecified_int4) ) THEN
+	   CALL PURGE_ALL_UVARS
+	   DO 1110 ivar = 1, max_uvar
+	   IF (iset.EQ.unspecified_int4 .OR. iset.EQ.uvar_dset(ivar))
+     .				CALL DELETE_USER_VAR(ivar)     ! 7/97
+ 1110	   CONTINUE
+	   num_uvars_in_cmnd = cmnd_uvars_not_given  ! renders EX#n deleted 
+	ELSE
+	   IF (num_items .EQ. 0) GOTO 5010	   
+	   DO 1120 item = 1, num_items
+	      i1 = STR_UPCASE(buff,
+     .			cmnd_buff(item_start(item):item_end(item)))
+* ... decode specified variable name of form VNAME[D=iset] (9/95)
+* ... Note: an "odd" behavior for the user will occur if the variable "A"
+*	    is defined BOTH as a LET (global) and LET/D (global).  In this
+*	    case CAN VAR A will delete only the LET definition.  CAN VAR A
+*	    given twice will cancel both.  I regard this as acceptable -- the
+*	    case described here is pretty pathological, anyway.
+	      IF ( IS_TEMPLATE(buff) ) THEN
+	         DO 1115 ivar = 1, max_uvar
+	            IF ( uvar_name_code(ivar)(1:3) .NE. 'EX#'
+     .	   .AND. (iset.EQ.unspecified_int4.OR.iset.EQ.uvar_dset(ivar)))
+     .								THEN
+		       IF (MATCH_TEMPLATE(uvar_name_code(ivar),buff)) THEN
+* ... note: calling PURGE_ALL_UVARS for each individual deleted uvar is
+*		inefficient ... but cautious. (minimum labor implementation)
+	                  CALL PURGE_ALL_UVARS
+			  CALL DELETE_USER_VAR(ivar)         ! 7/97
+	               ENDIF
+	            ENDIF
+1115	         CONTINUE
+	      ELSE
+	         CALL PARSE_NAM_DSET( buff, cx_last, iset,
+     .			     category, variable, mod_cx, status )
+	         IF ( status .NE. ferr_ok ) RETURN
+	         IF ( variable .EQ. munknown_var_name ) GOTO 5110
+	         IF ( category .NE. cat_user_var ) GOTO 5120
+	         CALL PURGE_ALL_UVARS
+		 CALL DELETE_USER_VAR(variable)         ! 7/97
+	      ENDIF
+ 1120	   CONTINUE
+	ENDIF
+	RETURN
+
+* CANCEL AXIS/MODULO
+ 1200	IF ( qual_given(slash_canc_axis_modulo) .GT. 0 ) THEN
+
+           new_att_modulo = .FALSE.
+           new_att_modulo_len = 0.
+
+	   DO 1220 item = 1, num_items
+              axis = TM_GET_LINENUM(
+     .				cmnd_buff(item_start(item):item_end(item)) )
+              IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+              IF ( line_modulo(axis) ) THEN
+                 line_modulo( axis ) = .FALSE.
+* ... wipe memory clear of stored variables - this could change all definitions
+*      ( could be more selective for efficiency by checking to see where this
+*      axis gets used )
+                 DO 1210 i = 1,max_mr_avail
+ 1210            IF ( mr_protected( i ) .NE. mr_deleted ) 
+     .                                CALL DELETE_VARIABLE( i )
+              ENDIF
+ 1220	   CONTINUE
+
+* CANCEL AXIS/ALL
+
+        ELSE IF ( qual_given(slash_canc_axis_all) .GT. 0 ) THEN 	
+	   CALL DEALLO_ALL_AXES
+
+* CANCEL AXIS/DEPTH
+
+        ELSE IF ( qual_given(slash_canc_axis_depth) .GT. 0 ) THEN 
+        
+	   DO 1222 item = 1, num_items
+              axis = TM_GET_LINENUM(
+     .				cmnd_buff(item_start(item):item_end(item)) )
+              IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+              IF ( line_direction(axis) .EQ. 'UD' ) THEN
+                 line_direction(axis) = 'DU'
+              ENDIF
+
+ 1222	   CONTINUE
+
+* CANCEL AXIS/STRIDE
+        ELSE IF ( qual_given(slash_canc_axis_stride) .GT. 0 ) THEN
+           
+* ...   Elimate all cached memory
+           CALL PURGE_ALL_MEMORY
+
+* ...   Eliminate all memory-resident user-defined vars and their
+*       uvar_grid 's 
+           CALL PURGE_ALL_UVARS
+* ...   
+           DO 1223 item = 1, num_items 
+              axis = TM_GET_LINENUM(
+     .                          cmnd_buff(item_start(item):item_end(item)) )
+
+* ...   Check it is legal to issue CANCEL AXIS/STRIDE
+              IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+ 
+*       not legal if axis no longer exists
+              IF( line_name(axis) .EQ. char_init16) GOTO 6310
+
+*       not legal if this is not a strided axis
+              IF( line_parent(axis) .EQ. 0) GOTO 6320
+
+              igrd = 0
+              iline= 0
+
+* ...   Loop through all dynamic grids and find which uses this axis
+
+ 6001         CALL TM_NEXT_DYN_GRID( igrd, *6199)
+
+                 DO 6002 idim = 1, nferdims
+                    iline = grid_line(idim,igrd)
+
+                    IF ( iline .EQ. axis ) THEN
+
+* ...   Reinsert the native axis (the parent of this axis)
+                       grid_line(idim,igrd) = line_parent(axis)
+
+* ...   Deallocate this axis
+                       line_keep_flag(axis) = .FALSE. 
+                       CALL TM_DEALLO_DYN_LINE(axis)
+
+                    ENDIF
+ 6002            CONTINUE
+
+
+              GOTO 6001
+ 6199         CONTINUE 
+
+
+ 1223      CONTINUE 
+
+        ELSE
+
+* ... CANCEL AXIS
+	   num_protected_axes = TM_GET_LINENUM( 'EZ' )  ! top protected axis
+	   DO 1230 item = 1, num_items
+              axis = TM_GET_LINENUM(
+     .				cmnd_buff(item_start(item):item_end(item)) )
+              IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+	      IF ( axis .LE. num_protected_axes ) GOTO 6212
+	      line_keep_flag(axis) = .FALSE.  ! see tm_garb_col_grids.F
+	      IF (line_use_cnt(axis) .LE. 0) THEN
+	         IF ( axis .LE. max_lines ) THEN
+                    IF (.NOT. line_regular(axis))
+     .                  CALL PACK_LINE_STORAGE(axis)
+		    line_name(axis) = char_init16
+	         ELSE
+	            CALL TM_DEALLO_DYN_LINE(axis)
+	         ENDIF
+	      ELSE
+*     ... cannot delete - in use.  Locate the grid that is using it.
+	         grid = TM_GET_GRID_OF_LINE( axis )
+	         CALL WARN( 'Not deleted: '//line_name(axis))
+	         IF ( grid .NE. unspecified_int4 ) THEN
+	            CALL WARN( 
+     .		      'Axis is in use by grid '//grid_name(grid))
+	         ELSE
+	            CALL ERRMSG(ferr_internal, status,
+     .				'axis use count err', *5000)
+	         ENDIF
+	      ENDIF
+ 1230	   CONTINUE
+        ENDIF
+
+* ... Check the attribute structure for this axis name and change 
+*     attribute values as needed.
+
+        buff2 = ' '
+        IF (line_name(axis) .NE. char_init16) THEN
+           CALL RESET_AX_ATT (line_name(axis), buff2, 
+     .           buff2, buff2, new_att_modulo,
+     .           new_att_modulo_len, line_direction(axis), 
+     .           line_regular(axis) )
+        ENDIF
+
+	RETURN
+
+* CANCEL GRID
+ 1300   CONTINUE
+	DO 1330 item = 1, num_items
+           grid = TM_GET_GRIDNUM(
+     .			cmnd_buff(item_start(item):item_end(item)) )
+           IF (grid .EQ. unspecified_int4) GOTO 6215
+* ... clear out any user variable dependencies and warn if used by a dataset
+	   IF (grid_use_cnt(grid) .GE. 1 .OR. grid .LE. mgrid_fabstract) THEN
+	      CALL PURGE_MR_GRID(grid, status)
+	      IF ( status .NE. ferr_ok ) THEN
+	          CALL WARN( 'Not deleted: '//grid_name(grid))
+	          RETURN
+	      ENDIF
+* ... grids created by data sets without associated vars may get deleted by
+*     PURGE_MR_GRID (e.g. handled as climatological_axes.cdf handles axes)
+	      IF (grid_name(grid) .EQ. char_init16) RETURN
+	   ENDIF
+* ... remove the grid if possible
+	   IF (grid_use_cnt(grid) .LE. 0) THEN
+	      IF ( grid .LE. max_grids ) THEN
+	         grid_name(grid) = char_init16
+	         DO 1310 idim = 1, nferdims
+ 1310		 CALL TM_DEALLO_DYN_LINE( grid_line(idim,grid))
+	      ELSE
+	         CALL TM_DEALLO_DYN_GRID(grid)
+	      ENDIF
+	   ELSE
+*     ... cannot delete - in use.
+	      CALL WARN( 'Not deleted: '//grid_name(grid))
+	   ENDIF
+ 1330	CONTINUE
+	RETURN
+
+
+* CANCEL ATTRIBUTE  /OUTPUT[=all]
+ 1400	 IF ( num_args .LT. 1 ) GOTO 5010
+
+!
+* ... get dset number if present:  CANCEL ATT/D=dset ...
+	iqual = qual_given( slash_canc_attr_data ) 
+        IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      show_str, status )  ! show_str is just a buffer
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( show_str .NE. ' ' ) THEN
+	      dset = FIND_DSET_NUMBER( show_str )
+	      IF ( dset .EQ. unspecified_int4) THEN
+	         CALL WARN('Unknown data set: '
+     .		 //show_str(:TM_LENSTR1(show_str)))
+	         RETURN
+	      ENDIF
+	   ENDIF
+
+        ELSE  ! get dataset from context or from [d=]
+           buff = cmnd_buff(item_start(1):item_end(1))
+
+           CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+           IF (buff(1:1) .EQ. '(') THEN
+              dset = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+              CALL ISIT_COORD_VAR ( buff, dset, 
+     .              varname, coordvar, status )
+              IF ( status .NE. ferr_ok ) THEN 
+                 dset = -2  ! a user-defined axis (coordinate variable)
+                 CALL ISIT_COORD_VAR ( buff, dset, 
+     .              varname, coordvar, status )
+                 IF ( status .NE. ferr_ok ) THEN
+                    dset = cx_data_set(cx_cmnd)
+                    GOTO 5920
+                 ENDIF
+              ENDIF
+
+           ELSE
+
+* Get the dataset if given as [d=]
+
+	      IF ( INDEX(buff,'[') .GT. 0 ) THEN
+                 dset = pdset_irrelevant	! default (not used ...)
+                 CALL PARSE_NAM_DSET(buff, cx_last, dset, cat, var,
+     .                 mods_cx, status)
+              ELSE
+                 cx = is_cx( 1 )
+                 IF (cx .EQ. 0 .OR. cx .EQ. unspecified_int4)
+     .                cx = cx_cmnd
+                dset = cx_data_set(cx)
+             ENDIF
+	   ENDIF
+        ENDIF
+
+!---------
+
+* /OUTPUT
+
+* ... CANCEL ATT/OUTPUT varname.attname
+
+        loc = qual_given( slash_canc_attr_output ) 
+        canout = ( loc .GT. 0 )
+
+       IF ( canout ) 
+     .   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			    buff2, status )
+
+* Get varname.attname and see if a dataset is specified
+
+        buff = cmnd_buff(item_start(1):item_end(1))
+
+!! get dataset from varname.attname
+* ... evaluate the context without computing the expression to get the dataset
+
+	CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+        IF (buff(1:1) .EQ. '(') THEN
+           dset = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+           CALL ISIT_COORD_VAR ( buff, dset, 
+     .            varname, coordvar, status )
+           IF ( status .NE. ferr_ok ) THEN 
+              dset = -2  ! a user-defined axis (coordinate variable)
+              CALL ISIT_COORD_VAR ( buff, dset, 
+     .              varname, coordvar, status )
+              IF ( status .NE. ferr_ok ) THEN
+                 dset = cx_data_set(cx_cmnd)
+                 GOTO 5920
+              ENDIF
+           ENDIF
+        ENDIF
+c
+c        ELSE
+c
+c* Get the dataset if given as [d=]
+c
+c	   IF ( INDEX(buff,'[') .GT. 0 ) THEN
+c               dset = pdset_irrelevant	! default (not used ...)
+c               CALL PARSE_NAM_DSET(buff, cx_last, dset,
+c     .				     cat, var, mods_cx, status)
+c           ELSE
+c              cx = is_cx( 1 )
+c              IF (cx .EQ. 0 .OR. cx .EQ. unspecified_int4)
+c     .             cx = cx_cmnd
+c             dset = cx_data_set(cx)
+c          ENDIF
+c	ENDIF
+
+        IF (dset .EQ. pdset_irrelevant .OR. dset .EQ. unspecified_int4)
+     .        dset = cx_data_set(cx_cmnd) 
+        IF (dset .EQ. unspecified_int4) dset = -1
+
+* Check that the variable exists in the dataset
+
+        IF (INDEX(buff, '.') .EQ. 0) THEN
+           varname = buff
+           CALL CD_GET_VAR_ID (dset, varname, varid, status)
+        ELSE
+           CALL BREAK_VARNAME( buff, dset, varname, attname, 
+     .                         varid,  status )
+        ENDIF
+        IF (status .NE. ferr_ok) GOTO 6220
+
+* If cancel/output varname.attname, set the attribute output flag to 0
+
+        IF (canout) THEN
+           iflag = 0
+
+* Is the command CAN ATT/OUTPUT=all varname?
+           slen = TM_LENSTR(buff2)
+           IF (slen .GT. 0  .AND.  buff2(1:3) .EQ. 'ALL') THEN
+
+* It must be just a varname, not varname.attname.
+              CALL BREAK_VARATTNAME (buff, dset, varname, 
+     .           attname, i, .FALSE., status)
+              IF (attname .NE. '') GOTO 6240
+
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+
+* Set all attribute output flags to 0
+
+              DO 1410 iatt = 1, nvatts
+                 CALL CD_GET_VAR_ATT_NAME (dset, varid, iatt, attname, 
+     .                                     status)
+                 CALL CD_SET_ATT_FLAG(dset, varid, attname, iflag, status)
+ 1410         CONTINUE
+
+           ELSE
+* Not /OUT=ALL. For single attribute, see if it exists and if so change the 
+* flag. The user may be wanting to turn off writing of an attribute that 
+* Ferret creates, like the AXIS attribute, or bounds...
+           
+              CALL BREAK_VARATTNAME (buff, dset, varname, 
+     .           attname, i, .FALSE., status)
+
+              IF (attname .EQ. '') GOTO 6230
+
+              IF (status .NE. ferr_ok) THEN
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, 5, 1, iflag,
+     .              buff, 1., status)
+              ELSE
+
+* Reset an existing attribute output flag to 0
+                 CALL CD_SET_ATT_FLAG(dset, varid, attname, iflag, status)
+              ENDIF
+           ENDIF
+
+* canout is false. The command was CANCEL ATT varname.attname. Delete the attribute
+        ELSE
+
+* See if the attribute  exists for the variable
+           do_err = .TRUE.
+           dummy = varname  ! Save name for changing axis modulo or depth setting
+
+           CALL BREAK_VARATTNAME ( buff, dset, varname, 
+     .                 attname, varid, do_err, status )
+
+           IF (attname .EQ. '') GOTO 6230
+
+           IF (status .NE. ferr_ok) GOTO 6220 
+           CALL CD_DELETE_ATTRIBUTE (dset, varid, attname, status )
+
+* If this is an axis and we are changing modulo or depth setting, make the 
+* setting in the Ferret definition of the axis.
+
+           IF (coordvar) THEN
+              IF ( STR_SAME(attname, 'modulo') .EQ. 0) THEN
+                 new_att_modulo = .FALSE.
+                 new_att_modulo_len = 0.
+
+                 axis = TM_GET_LINENUM(dummy )
+                 IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+                 IF ( line_modulo(axis) ) THEN
+                    line_modulo( axis ) = .FALSE.
+* ... wipe memory clear of stored variables - this could change all definitions
+*      ( could be more selective for efficiency by checking to see where this
+*      axis gets used )
+                    DO 1420 i = 1,max_mr_avail
+ 1420               IF ( mr_protected( i ) .NE. mr_deleted ) 
+     .                                CALL DELETE_VARIABLE( i )
+                 ENDIF
+
+              ENDIF
+              IF ( STR_SAME(attname, 'depth') .EQ. 0) THEN
+
+	         axis = TM_GET_LINENUM(dummy )
+                 IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+                 IF ( line_direction(axis) .EQ. 'UD' ) THEN
+                    line_direction(axis) = 'DU'
+                 ENDIF
+              ENDIF
+           ENDIF   ! coordvar
+
+        ENDIF
+
+	RETURN
+        
+* CANCEL REDIRECT
+ 1500   redir_cancel_stdout = .FALSE.
+        redir_cancel_stderr = .FALSE.
+        IF ( num_args .GT. 0 ) THEN
+*          Get all the redirect sources to cancel
+           DO 1510 i = 1,num_args
+              IF ( MATCH4( cmnd_buff(arg_start(i):arg_end(i) ), 
+     .              arg_end(i) - arg_start(i) + 1, 'STDOUT', 6) ) THEN
+                 redir_cancel_stdout = .TRUE.
+              ELSE IF ( MATCH4( cmnd_buff(arg_start(i):arg_end(i) ), 
+     .              arg_end(i) - arg_start(i) + 1, 'STDERR', 6) ) THEN
+                 redir_cancel_stderr = .TRUE.
+              ELSE
+*                Unknown redirect source
+                 CALL WARN('Ignored cancel redirect of unknown source: '
+     .                   // cmnd_buff(arg_start(i):arg_end(i)) )
+              ENDIF
+ 1510      CONTINUE
+           IF ( redir_cancel_stdout .AND. 
+     .          (redirect_stdout_flags .EQ. redirect_none) ) THEN
+              CALL WARN('stdout is not redirected')
+              redir_cancel_stdout = .FALSE.
+           ENDIF
+           IF ( redir_cancel_stderr .AND. 
+     .          (redirect_stderr_flags .EQ. redirect_none) ) THEN
+              CALL WARN('stderr is not redirected')
+              redir_cancel_stderr = .FALSE.
+           ENDIF
+        ELSE
+*          Default: cancel all active redirects
+           IF ( redirect_stdout_flags .NE. redirect_none ) THEN
+              redir_cancel_stdout = .TRUE.
+           ENDIF
+           IF ( redirect_stderr_flags .NE. redirect_none ) THEN
+              redir_cancel_stderr = .TRUE.
+           ENDIF
+           IF ( (.NOT. redir_cancel_stdout) .AND. 
+     .          (.NOT. redir_cancel_stderr) ) THEN
+              CALL WARN('No active redirects to cancel')
+           ENDIF
+        ENDIF
+*
+        IF ( redir_cancel_stdout ) THEN
+           IF ( (redirect_stdout_flags .EQ. redirect_file) .OR.
+     .          (redirect_stdout_flags .EQ. redirect_file_tee) ) THEN
+*             Check if stdout and stderr are sent to the same LUN
+              IF ( (redirect_stderr_lun .NE. redirect_stdout_lun) .OR.
+     .             ((redirect_stderr_flags .NE. redirect_file) .AND.
+     .           (redirect_stderr_flags .NE. redirect_file_tee)) ) THEN
+                 CLOSE(UNIT=redirect_stdout_lun)
+              ENDIF
+              redirect_stdout_lun = -1
+           ENDIF
+           redirect_stdout_flags = redirect_none
+        ENDIF
+*
+        IF ( redir_cancel_stderr ) THEN
+           IF ( (redirect_stderr_flags .EQ. redirect_file) .OR.
+     .          (redirect_stderr_flags .EQ. redirect_file_tee) ) THEN
+*             Check if stdout and stderr are sent to the same LUN
+              IF ( (redirect_stdout_lun .NE. redirect_stderr_lun) .OR.
+     .             ((redirect_stdout_flags .NE. redirect_file) .AND.
+     .           (redirect_stdout_flags .NE. redirect_file_tee)) ) THEN
+                 CLOSE(UNIT=redirect_stderr_lun)
+              ENDIF
+              redirect_stderr_lun = -1
+           ENDIF
+           redirect_stderr_flags = redirect_none
+        ENDIF
+*
+        RETURN
+
+* CANCEL ALIAS
+ 1600	IF ( slash_all ) THEN
+           DO 1610 i = num_predefined_alias+1, total_num_alias
+ 1610      alias_name(i) = unspecified_name4
+        ELSE
+	   IF ( num_items .EQ. 0 ) GOTO 5010
+	   DO 1630 item = 1, num_items
+	      i1 = STR_UPCASE(buff,
+     .			cmnd_buff(item_start(item):item_end(item)))
+              DO 1620 i = 1, total_num_alias
+                 IF ( alias(i) .EQ. unspecified_name4 ) GOTO 1620
+                 IF ( MATCH_TEMPLATE(alias_name(i), buff) ) THEN
+                    alias_name(i) = unspecified_name4
+                 ENDIF
+ 1620         CONTINUE
+ 1630      CONTINUE
+        ENDIF
+	RETURN
+
+* CANCEL SYMBOL
+ 1700	IF ( slash_all ) THEN
+* cancel all symbols
+* (this lovely piece of code is borrowed from the PLOT+ routine getcmd.F)
+	   i=0
+ 1705      CALL LSTSYM(argsym,buff,blen,i,ier)	! get next symbol name (argsym)
+           IF(ier.EQ.0)THEN
+	      CALL DELSYM(argsym,ier)
+	      GOTO 1705
+	   ENDIF
+	   RETURN
+	ENDIF
+* cancel the template-specified symbol(s)
+	IF ( num_items .EQ. 0 ) GOTO 5010
+* (this lovely piece of code is borrowed from the PLOT+ routine getcmd.F)
+	i=0
+ 1710   CALL LSTSYM(argsym,buff,blen,i,ier)	! get next symbol name (argsym)
+        IF(ier.EQ.0)THEN
+* ... check the given templates 
+	   DO 1720 i1 = 1, num_items
+	      nth = STR_UPCASE(buff,
+     .			cmnd_buff(item_start(i1):item_end(i1)))
+	      IF ( MATCH_TEMPLATE(argsym,buff) ) CALL DELSYM(argsym,ier)
+ 1720	   CONTINUE
+           GOTO 1710
+	ENDIF
+	RETURN
+
+
+* CANCEL NCCACHE. Set all arguments of -1 to restore the default settings.
+
+ 1800	cache_size = -1
+	cache_nelems = -1
+	cache_preemption = -1
+	CALL CD_SET_CHUNK_CACHE (cache_size, cache_nelems, 
+     .     cache_preemption, status)
+	CALL SPLIT_LIST(pttmode_ops, err_lun,
+     .   ' Restoring default chunk cache settings', 0)
+
+	RETURN
+
+
+* CANCEL PYVAR
+* modeled after CANCEL VAR
+*       /D=xxx: has the user requested CANCEL PYVAR/D= ?
+ 1900   iqual = qual_given( slash_canc_var_data )
+        IF ( iqual .GT. 0 ) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) RETURN
+           IF ( buff .EQ. ' ' ) THEN
+              iset = pdset_irrelevant         ! "/D", alone for default-to-dset
+              buff = 'No current data set'    ! ... for error reporting
+              IF ( iset .EQ. unspecified_int4) GOTO 5130
+           ELSE
+              iset = FIND_DSET_NUMBER( buff )
+              IF ( iset .EQ. unspecified_int4) GOTO 5130
+           ENDIF
+        ELSE
+           iset = unspecified_int4
+        ENDIF
+        IF ( slash_all ) THEN
+           CALL PURGE_ALL_UVARS
+*          The following purges then deletes all pystat variables
+           CALL DELETE_ALL_PYSTAT_VARS()
+        ELSEIF ( (num_items .EQ. 0) .AND. 
+     .           (iset .NE. unspecified_int4) ) THEN
+           CALL PURGE_ALL_UVARS
+*          The following purges then deletes all pystat variables in a given dataset
+           CALL DELETE_PYSTAT_DSET_VARS(iset)
+        ELSE
+           IF (num_items .EQ. 0) GOTO 5010
+           DO 1920 item = 1, num_items
+              i1 = STR_UPCASE(buff,
+     .                 cmnd_buff(item_start(item):item_end(item)))
+*             Decode specified variable name of form VNAME[D=iset]
+              CALL PARSE_NAM_DSET( buff, cx_last, iset,
+     .                             category, variable, mod_cx, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( variable .EQ. munknown_var_name ) GOTO 5110
+              IF ( category .NE. cat_pystat_var ) GOTO 5140
+              CALL PURGE_ALL_UVARS
+              CALL PURGE_PYSTAT_VAR(variable)
+              CALL DELETE_PYSTAT_VAR(variable, buff, i1)
+ 1920      CONTINUE
+        ENDIF
+        RETURN
+
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .			'CANCEL what?', *5000 )
+ 5020	CALL ERRMSG( ferr_invalid_command, status,
+     .			'unknown mode:'//
+     .			cmnd_buff( item_start(item):item_end(item) ), *5000 )
+ 5030	CALL ERRMSG( ferr_unknown_data_set, status, buff(:blen), *5000 )
+ 5040	CALL ERRMSG( ferr_invalid_command, status,
+     .			'cannot cancel viewport:'//
+     .			cmnd_buff( item_start(item):item_end(item) ), *5000 )
+ 5090	CALL ERRMSG( ferr_ODR_error, status, buff, *5000 )
+ 5110	CALL ERRMSG( ferr_unknown_variable, status, buff(:8), *5000 )
+ 5120	CALL ERRMSG( ferr_invalid_command, status,
+     .		'can only CANCEL variables you DEFINE '//buff, *5000 )
+ 5130	CALL ERRMSG( ferr_unknown_data_set, status,
+     .			buff(:TM_LENSTR1(buff)), *5000 )
+ 5140	CALL ERRMSG( ferr_invalid_command, status,
+     .		'not a pyvar (variable from Python): '//buff, *5000 )
+ 5310	CALL ERRMSG( ferr_invalid_command, status,
+     .		'/ALL with named region or axis qualifier', *5000 )
+ 5400	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Unknown alias: '//
+     .           cmnd_buff(item_start(item):item_end(item)), *5000 )
+ 5820	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'MODE GKS cannot be modified after the first GKS plot',
+     .			*5000 )
+ 5830	CALL ERRMSG( ferr_erreq, status, 'Cannot close file', *5000 )
+ 5920   slen = TM_LENSTR(buff)
+        CALL ERRMSG( ferr_invalid_command, status,
+     .   'variable, axis, or attribute does not exist'//
+     .    buff(:slen), *5000 )
+ 6210	CALL ERRMSG( ferr_invalid_command, status, 'unknown axis: '//
+     .		     cmnd_buff(item_start(item):item_end(item)), *5000 )
+ 6212	CALL ERRMSG( ferr_invalid_command, status, 'protected axis: '//
+     .		     cmnd_buff(item_start(item):item_end(item)), *5000 )
+ 6215	CALL ERRMSG( ferr_unknown_grid, status,
+     .		     cmnd_buff(item_start(item):item_end(item)), *5000 )
+ 6220 CALL ERRMSG( ferr_unknown_variable, status, 
+     .               'unknown variable or attribute: '//
+     .		     cmnd_buff(item_start(1):item_end(1)), *5000 )
+ 6230	CALL ERRMSG( ferr_invalid_command, status,
+     .	    'CANCEL ATTRIBUTE given with no attribute: '//
+     .	    'Use CAN ATT/OUT=ALL varname, or CAN ATT[/OUT] varname.attname '
+     .			, *5000 )
+ 6240	CALL ERRMSG( ferr_invalid_command, status,
+     .	    'CANCEL ATTRIBUTE/ALL varname.attname: '//
+     .	    'cannot specify attribute name '
+     .			, *5000 )
+ 6310   CALL ERRMSG( ferr_invalid_command, status, 'axis no longer exists: '//
+     .               cmnd_buff(item_start(item):item_end(item)), *5000 )
+
+ 6320   CALL ERRMSG( ferr_invalid_command, status, 'not a strided axis: '//
+     .               cmnd_buff(item_start(item):item_end(item)), *5000 )
+ 
+	END
+
diff --git a/fer/xeq/xeq_contour.F b/fer/xeq/xeq_contour.F
new file mode 100644
index 0000000..4d928d5
--- /dev/null
+++ b/fer/xeq/xeq_contour.F
@@ -0,0 +1,620 @@
+	SUBROUTINE XEQ_CONTOUR( memory )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the CONTOUR command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/5/87 copied from rev. 0.0 of XEQ_PLOT (6/3/86) with changes
+*		 to allow multiple mrs in a single expression
+*		 and with separate subroutines for graphics set-up
+* revision 0.1 - 2/25/87 - changes for INTERPRETATION STACK
+* revision 0.2 - 6/24/87 - incorporated 90 degree in-plane transpose
+*			   and DISP_INIT separated from DISP_SET_UP
+* revision 0.3 - 7/8/87  - DISP_LABELS separated from DISP_SET_UP
+* revision 0.4 - 7/28/87 - added CALL DISP_PREP
+* revision 0.5 - ????    - plots not automatically transposed in XT plane
+* revision 0.6 - 3/2/88  - check for valid data range before PLOT+ auto-scaling
+* revision 0.7 - 4/14/88 - added /NOLABELS option and range check-->DISP_SET_UP
+* revision 0.8 - 4/28/88 - set up PPLUS LEV command if no data range
+* revision 0.9 - 8/2/88  - added MODE WAIT
+* revision 1.0 - 9/21/88 - do_labels --> no_labels: /NOLABEL processing chged
+* revision 1.1 - 1/25/89 - PPLUS interruptibility - chg for multiple plots
+* revision 1.2 - 5/1/89  - PPL LEVELS not cleared for no_range if /LEVELS_SAME
+* V200:  5/19/89 - 4D symmetrical
+*		 - obtain oversized data region to fill contours to edges
+*	  1/4/89 - using keys for labelling
+*	 3/13/90 - check status from DISP_PREP
+* V230:   6/8/92 - added CONTOUR/FILL/KEY/LINE/NOKEY
+*       10/22/92 - removed dependence on shade_vars.cmn using PPLCMND(SHAKEY)
+*        11/9/92 - protect colors before doing a color overlay
+*                - default for KEY is off on overlays
+* V300:  3/11/93 - added /SPECTRUM=
+* V301:	  1/7/94 - bug fix: (see DISP_DATA_SET_UP) must unprotect plot data
+*	 2/10/94 - added /PEN=
+* V312: 5/94 - array "memory" as a calling argument
+* V320:   1/20/94 - changes to SAVE_FRAME call reflecting C-based procedures
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V450:  5/29/97 - added /NOAXES qualifier (useful in curvilinear plots)
+* V491:  12.98   - added /PATTERN qualifier *jd*
+* V510 12/99 *sh* - allow plots of all-missing data
+*		  - added /SIZE=/SPACING=/SIGDIG= controls over contour labels
+*      5/00 *sh* - restored the /PEN qualifier (with "denigrated" remark
+* V530 *sh* 1/01 - change "denigrated" to "deprecated"
+*      *acm*6/01 - add arguments is_logh, is_logv to DISP_SET_UP call.
+*                  (only used for PLOT command)
+*      *acm* 7/01 - Add /AXES=TOP,BOT,LEFT,RIGHT
+*		    & call ax_on_off to implement /NOAXES.
+*      *acm* 10/01  remove VMS includes
+* V540 *acm*  2/02  restore persistence of PPL AXSET settings
+* V541 *acm*  3/02  Make PPL AXSET settings persist, but not settings
+*                   done with qualifiers /AXES= or /NOAXES
+*      *acm*  4/02  do not set is_logh, is_logv.  They arent used by CONTOUR.
+*      *acm*  4/02  If this is an overlay, and there is no valid data, 
+*                   do not put "No Valid Data" across the middle of the plot.
+*                   Instead (in disp_set_up) add this information to the
+*                   variable name in the key below the plot.
+* v541 *acm*  5/02 add option to control outline on the shade key boxes 
+*                   /KEY=continuous
+* V550: *acm*11/02 add argument is_shade to DISP_SET_UP call (not used by contour)
+* V552: *acm* 5/03 add argument use_cell to DISP_SET_UP call (not used by contour)
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* v580 *acm* 6/15/04 In the workaround which does a PPL LEV command for data with
+*                    a single value, need to give the PPL command the value with  
+*                    more precision. (single value data isnt contoured or filled,
+*                    but put this fix in as a parallel to what is done in shade
+*                    and polygon.)
+* V581 *acm* 5/05  fix bug 1249: /KEY=CONT. Need to use EQUAL_STR to get the
+*                  argument to /KEY, then compare to see if it equals uppercase 'CON'
+* V602 *acm* 11/06 Fix bug 1472: Where single-level color plot is requested, use levels (1) 
+*                  setting rather than sending the data value; avoids precision problems.
+* V603 *acm*  5/07 as in xeq_shade, for fix of bug 904: if FILL/LINE, then set iautoc and 
+*                  NLEV2 to re-use the contour levels from the shade plot. The bug does not
+*                  seem to occur on fill plots, but might as well not recompute levels.
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+* V614  *acm* 10/08 - add new MODE NODATA_LAB to control the NO VALID DATA label.
+*                  Put it on plots only when this mode is set.
+* V6.2  *acm* 11/08Fix bug 1609: If the plot is an overlay then do not process /AXES=
+*                  or /NOAXES. Axes are never drawn for overlays anyway.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis
+* V6.85 *acm* 3/13 Fix ticket 2049; check we can open palette file
+* PyFr  *kms*  6/13 EQUAL_COLOR now returns a color ID, and EQUAL_THICK 
+*                   returns a pen ID from a color ID and a thickness.
+* PyFr  *kms*  6/13 Added /THICK /OPACITY
+* PyFr  *kms*  7/13 Scale default lettering sizes by textscale;
+*                   use scaled label heights and spacings instead of 
+*                   hard-coded values.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xplot_state.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'plot_setup.parm'
+	include 'xplot_setup.cmn'
+        include 'parampl5_dat.decl'     ! with inclen
+        include 'PARAMPL5.DAT'  ! with inclen
+        include 'cont_inc.decl' ! with iautoc and nlev
+        include 'CONT.INC'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'    ! wsid
+	
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL	  no_range, overlay, transpz, no_labels, fill, usa_line,
+     .            do_key, spectrum, set_up, noaxes, axes, pattern, 
+     .		  no_data, is_logh, is_logv, inc_grid
+	INTEGER	  TM_LENSTR1, status, slen, sp, ipen, icolor,
+     .		  ax1_blks, ax1_start, loc, sigdig,
+     .		  ax2_blks, ax2_start, patt, i, nparm, num_it, 
+     .		  s1, s2, it_start(4), it_end(4), iax(4), density,
+     .            loch, locv
+        INTEGER   STR_UPCASE, i1
+	REAL	  vbuf, only_val, aspect, lab_size, lab_spacing
+        REAL*4    dfltthick, opacity
+	PARAMETER (aspect = 0.0)			!kob 12/96
+	CHARACTER TM_FMT*12, TM_INQ_PATH*2048, 
+     .                  fname*128, buff*25, sfile*2048
+
+* internal parameter declarations:
+	LOGICAL		norm_dims_only, not_vector, continuous_key, 
+     .                  is_shade, use_cell
+	PARAMETER     ( norm_dims_only  = .FALSE.,
+     .			not_vector	= .FALSE. )
+
+* set up the graphics environment
+
+	CALL START_PPLUS(.FALSE.)
+
+* get the data (possibly ?? on a slightly oversized region)
+!	cx_ovsiz(cx_last) = ovsiz_plane	! ... causes too many headaches !
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* initialize
+	overlay   = qual_given( slash_cont_over_plot ).GT.0 .AND. twodee_on
+	no_labels = qual_given( slash_cont_nolabels  ).GT.0
+	transpz   = qual_given( slash_cont_transpz   ).GT.0
+	set_up    = qual_given( slash_cont_set_up    ).GT.0
+	fill      = qual_given( slash_cont_fill      ).GT.0
+	noaxes    = qual_given( slash_noaxes         ).GT.0
+	axes      = qual_given( slash_cont_axes      ).GT.0
+        IF (overlay) THEN
+	   noaxes = .FALSE.
+	   axes = .FALSE.
+	ENDIF
+	is_logh   = .FALSE.
+	is_logv   = .FALSE.
+        sp        = qual_given( slash_cont_spectrum  )
+        spectrum  = sp .GT. 0 .AND. fill
+        is_shade  = .FALSE.
+        use_cell  = .FALSE.
+
+        patt     = qual_given( slash_cont_pattern  )
+        pattern  = patt .GT. 0 .AND. fill
+
+	usa_line  = .NOT.fill
+     .          .OR. qual_given( slash_cont_line      ).GT.0
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,is_cx,
+     .                                       num_uvars_in_cmnd)
+* ... default orientation for YT and ZT contours has time on horizontal
+	IF ( (plot_axis(2).EQ.t_dim .OR. plot_axis(2).EQ.f_dim) .AND. 
+     .		plot_axis(1).NE.x_dim ) transpz = .NOT.transpz
+
+* ... CONTOUR/SIZE=float
+	loc = qual_given( slash_cont_size )
+	IF ( loc .GT. 0  ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      vbuf, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( vbuf .NE. unspecified_val4 ) THEN
+	      IF ( vbuf.LE. 0.0 ) GOTO 5210
+	      lab_size = vbuf	
+	   ENDIF
+	ELSE
+	   lab_size = wn_con_hgt(wsid)
+	ENDIF
+* ... CONTOUR/SPACING=float
+	loc = qual_given( slash_cont_spacing )
+	IF ( loc .GT. 0  ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      vbuf, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( vbuf .NE. unspecified_val4 ) THEN
+	      IF ( vbuf .LE. 0.0 ) GOTO 5210
+	      lab_spacing = vbuf	
+	   ENDIF
+	ELSE
+	   lab_spacing = wn_con_labsp(wsid)
+	ENDIF
+* ... CONTOUR/SIGDIG=integer
+	loc = qual_given( slash_cont_sigdig )
+	IF ( loc .GT. 0  ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      vbuf, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( vbuf .NE. unspecified_val4 ) THEN
+	      IF ( vbuf.LE.0.5 ) GOTO 5210
+	      sigdig = NINT(vbuf)
+	   ENDIF
+	ELSE
+	   sigdig = 2
+	ENDIF
+* ... CONTOUR/COLOR=color name or pen number
+        dfltthick = 1.0
+	loc = MAX( qual_given(slash_pen), qual_given(slash_color))
+	IF ( loc .GT. 0 ) THEN
+	   IF (.NOT.denig_pen_msg_done .AND. qual_given(slash_pen).GT.0)
+     .									THEN
+	      CALL WARN( '/PEN is deprecated. Use /COLOR.')
+	      denig_pen_msg_done = .TRUE.
+	   ENDIF
+*          get the color ID and default thickness
+           CALL EQUAL_COLOR( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                       icolor, dfltthick, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	ELSE
+	   icolor = -1	! auto-select in DISP_SET_UP
+	ENDIF
+
+* ... CONTOUR/OPACITY=n
+        loc = qual_given( slash_cont_opacity )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_VAL(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    vbuf, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           IF ( (vbuf .LT. 0.0) .OR. (vbuf .GT. 100.0) ) GOTO 5500
+           opacity = vbuf / 100.0
+*          Assume the opacity is for the spectrum colors, 
+*          and not the pen, if fill is specified
+           IF ( icolor .GE. 0 .AND. .NOT. fill )
+     .        CALL DUP_COLOR_SET_OPACITY(wsid, icolor, opacity)
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ELSE
+*          overriding opacity not specififed
+           opacity = -1.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ENDIF
+
+* ... CONTOUR/THICKNESS=n
+        loc = qual_given( slash_cont_thick )
+        IF ( loc .GT. 0  ) THEN
+           IF ( icolor .GE. 0 ) THEN
+              CALL EQUAL_THICK(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                         dfltthick, icolor, ipen, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ELSE
+*             leave as the auto-select value (-1)
+              CALL WARN ('/THICKNESS ignored unless /COLOR (or /PEN) given')
+              ipen = icolor
+           ENDIF
+        ELSEIF ( icolor .GE. 0 ) THEN
+*          /THICK not given; convert color ID to pen ID using default thickness
+           CALL EQUAL_THICK(' ', dfltthick, icolor, ipen, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ELSE
+*          /THICK and /COLOR not given; leave as auto-select value (-1)
+           ipen = icolor
+        ENDIF
+
+* ... CONTOUR/hgrat[=dash or line] default is dash
+*     hgrat line type: 0=tics only, 1=dash, 2=line
+
+	loch = qual_given(slash_cont_hgrat)
+
+* ... CONTOUR/vgrat[=dash or line] default is dash
+*     vgrat line type: 0=tics only, 1=dash, 2=line
+
+	locv = qual_given(slash_cont_vgrat)
+
+        IF (loch .EQ. 0  .AND. locv .EQ. 0) THEN
+           loch = qual_given(slash_cont_grat)
+           locv = qual_given(slash_cont_grat)
+        ENDIF
+
+        CALL set_graticules(loch, locv, status)
+
+* set contour label details (3/00)
+* fix bug 
+	WRITE ( ppl_buff, 3100 ) lab_size, sigdig, lab_spacing
+	CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+ 3100	FORMAT('CONSET ',F8.3,',',I4,', , , , , ,',F7.2)
+
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+        density = 0	! not used; vec/flow needs it in set up
+
+* set up the axes and title and load the data into PPLUS
+	inc_grid = set_up
+	CALL DISP_SET_UP   ( 	memory,
+     . 			 	not_vector,
+     .				is_shade,
+     .				use_cell,
+     .				aspect,
+     .				overlay,
+     .				transpz,
+     .				no_labels,
+     .				no_range,
+     .				only_val,
+     .                          density,
+     .				is_logh, 
+     .				is_logv,
+     .				is_mr,		! pass list
+     .				num_uvars_in_cmnd,
+     .				is_cx,		! pass list
+     .				is_uvar,	
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				ipen,
+     .				inc_grid,
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* increment counter of line-style contours on screen
+	IF ( usa_line ) ncont_on = ncont_on + 1
+
+* is the no valid input data?
+        no_data =  no_range .AND. only_val.EQ.bad_val4
+
+
+* PPLUS blows up setting auto contour levels if all data have same value
+* But, do not let this be rounded off, or we cannot find the color when matching 
+* this value in get_ndx, called by fillpol.  ( although, if there is just
+* one level, the fill is not done.)
+
+* The initial fix below had precision problems when the value in only_val was
+* of high precision, sometimes causing polygons to go unfilled (bug 1472).  
+* Instead, make a ppl lev 1 setting, as is done in disp_prep.F
+
+c     IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 )
+c    .          CALL PPLCMD ( from, line, 0, 
+c    .          'LEV () ('//TM_FMT(only_val, 8, 20, slen)//')' , 1, 1 )
+
+      IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 ) THEN
+           iautoc = 1  
+c           nlev = 1
+      ENDIF
+
+* default key
+	   do_key =  (qual_given(slash_cont_key)  .GT. 0)
+     .		.OR. (.NOT.usa_line .AND. .NOT.overlay)
+	   IF ( no_data ) do_key = .FALSE.
+	   IF (qual_given(slash_cont_nokey) .GT. 0) do_key = .FALSE.
+           IF ( do_key ) THEN
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 1,1', 1, 1 )
+
+* ... /KEY=continouus ?
+              loc = qual_given( slash_cont_key )
+              IF ( loc .GT. 0) THEN
+	         CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         IF ( buff(1:3) .EQ. 'CON' ) THEN
+                    continuous_key = .TRUE.
+                    CALL PPLCMD (from, line, 0, 'S_KEY 1', 1, 1 )
+                 ENDIF
+              ENDIF
+
+           ELSE
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 0,1', 1, 1 )
+
+c when it's an overlay, 'No Valid Data' is part of the plot key,
+c done in disp_set_up. If mode_nodata_lab is false then leave this off.
+
+        IF (.NOT. overlay .AND. no_data .AND. mode_nodata_lab) 
+     .                  CALL PUT_LABEL( ppl_movlab, 0.5, 0.5,
+     .                  ppl_centered, dflt_letsize_title*textscale,
+     .                  'No Valid Data',
+     .                  lab_loc_axlen_times, lab_loc_axlen_times )
+           ENDIF
+
+* protect colors already on-screen before a color overlay
+*              PyFerret does not need to protect colors after using them
+*           IF ( overlay .AND. fill ) CALL PPL_SHASET( 'PROTECT' )
+
+* save old and reset to new color spectrum if requested
+           IF ( spectrum ) THEN
+              CALL EQUAL_STR_LC( cmnd_buff(qual_start(sp):qual_end(sp)),
+     .             fname, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( fname .EQ. ' ' ) fname = 'default'
+	      
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.spk',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+
+              CALL PPL_SHASET( 'SAVE' )
+              CALL PPL_SHASET( 'SPECTRUM='//fname(1:TM_LENSTR1(fname)) )
+           ENDIF
+
+* save old and set to new pattern if requested (a la spectrum)
+           IF ( pattern ) THEN
+              CALL EQUAL_STR_LC( 
+     .             cmnd_buff(qual_start(patt):qual_end(patt)),
+     .             fname, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( fname .EQ. ' ' ) fname = 'default'
+	      
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.pat',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+
+              CALL PPL_PATSET( 'SAVE' )
+              CALL PPL_PATSET( 'PATTERN='//fname(1:TM_LENSTR1(fname)) )
+           ENDIF
+
+
+* turn off axes? 
+	IF ( noaxes ) THEN 
+           DO 300 i = 1, 4
+              iax(i) = 0
+ 300       ENDDO
+        ENDIF
+
+* turn on (one or more) axes? (7/11/01)
+
+* ... PLOT/AXES=(TOP,BOTTOM,LEFT,RIGHT)
+	IF ( axes ) THEN
+           loc = qual_given( slash_cont_axes )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   IF ( buff .NE. ' ' ) THEN
+
+* Get arguments, if any.  Otherwise turn on all axes
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5440
+              ENDIF
+
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, 
+     .             num_it, it_start, it_end, status)
+
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN	! /AXES=()
+                 DO 400 i = 1, 4
+                    iax(i) = 0
+ 400             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5440
+              ELSE
+                 DO 500 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) iax(i)
+                    IF (iax(i) .LT. 0  .OR.  iax(i) .GT. 1) GOTO 5450
+ 500             CONTINUE
+              ENDIF
+           ELSE		! turn on all axes
+	      DO 600 i = 1, 4
+		 iax(i) = 1
+ 600	      CONTINUE
+           ENDIF
+              
+	ENDIF	
+
+*  Turn off or on axes, including time axes.
+        IF (axes .OR. noaxes) CALL ax_on_off (iax)
+
+* /set_up only requested ?
+	IF ( set_up ) GOTO 1000
+
+* contour it 
+        IF ( fill ) THEN
+* ... filled contours
+	   IF ( overlay ) THEN
+	      IF ( usa_line ) THEN
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'FILL/OVER/' //ppl_wait//' ' , 1, 1 )
+	         IF ( ppl_interrupted ) GOTO 1000
+	         iautoc = 0 ! reuse levels from last plot
+	         nlev = nlev2
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/OVER/' //ppl_wait//' ' , 1, 1 )
+	      ELSE
+	         CALL PPLCMD ( ' ', ' ', 0,
+     .			'FILL/OVER/' //ppl_wait//' ' , 1, 1 )
+	      ENDIF
+	   ELSE
+	      IF ( usa_line ) THEN
+	      
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'FILL/LATCH/'//ppl_wait//' ', 1, 1 )
+	         IF ( ppl_interrupted ) GOTO 1000
+	         iautoc = 0 ! reuse levels from last plot
+	         nlev = nlev2
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/OVER/' //ppl_wait//' ' , 1, 1 )
+	      ELSE
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'FILL/LATCH/'//ppl_wait//' ', 1, 1 )
+	      ENDIF
+	   ENDIF
+        ELSE
+* ... line-style contour
+
+	   IF (contour_fewer .EQ. 1) THEN
+	      iautoc = 1
+	      nlev = 10
+	   ENDIF
+	   IF ( overlay ) THEN
+	      CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/OVER/' //ppl_wait//' ' , 1, 1 )
+	   ELSE
+	      CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/LATCH/'//ppl_wait//' ', 1, 1 )
+	   ENDIF
+        ENDIF
+
+* protect the new colors and restore the original color spectrum
+           IF ( spectrum ) THEN
+*              PyFerret does not need to protect colors after using them
+*              CALL PPL_SHASET( 'PROTECT' )
+              CALL PPL_SHASET( 'SPECTRUM' )
+           ENDIF
+
+* restore the original pattern
+           IF ( pattern ) THEN
+              CALL PPL_PATSET( 'PATTERN' )
+           ENDIF
+
+* Mark the levels as set; if we used histogram levels it is 0
+
+          IF (need_histo) iautoc = 1
+
+* clear the overriding opacity
+        opacity = -1.0
+        CALL SET_OVERRIDE_OPACITY(opacity)
+
+* restore axes? (5/29/97  revised 3/2002 
+
+c        IF ( axes .or. noaxes ) CALL PPL_AXES_RESTORE
+
+* restore default (non-continuous) key style?
+        IF (continuous_key ) CALL PPLCMD (from, line, 0, 'S_KEY 0', 1, 1 )
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ? (discontinued with v6.6)
+	IF ( qual_given( slash_cont_frame ) .GT. 0 ) THEN
+	   CALL SAVE_FRAME( frame_file, "HDF", status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* release the memory used for axis buffers
+ 1000 	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+! 5200   CALL ERRMSG( ferr_out_of_range, status,
+!     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+!     .          'Legal range is 1 to '//LEFINT(limit,slen), *1000 )
+ 5210	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Value must be positive', *1000 )
+ 5300   CALL ERRMSG (ferr_file_not_found, status, 
+     .          'unable to open "' //
+     .	fname(:slen)//'.spk" to set plot colors or pattern.', *1000)
+ 5440	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'AXES[=(TOP,BOTTOM,LEFT,RIGHT)] takes 4 arguments or no argument', *1000 )
+ 5450	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'AXES arguments must be 0 or 1', *1000 )
+ 5500   CALL ERRMSG( ferr_out_of_range, status,
+     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .          'Value from 0 to 100 must be given', *1000 )
+
+	END
diff --git a/fer/xeq/xeq_define.F b/fer/xeq/xeq_define.F
new file mode 100644
index 0000000..78e26f7
--- /dev/null
+++ b/fer/xeq/xeq_define.F
@@ -0,0 +1,2380 @@
+ 	SUBROUTINE XEQ_DEFINE( memory )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the DEFINE command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/22/87
+* revision 1.0 - 7/27/88 - added DEFINE GRID and DEFINE AXIS code
+* revision 1.1 - 8/31/88 - added DEFINE VIEWPORT
+* revision 1.2 -11/21/88 - new TM library: FIND_LIKE_GRID-->TM_FIND_LIKE_GRID
+*					   TRANSFER_GRID --> TM_COPY_GRID
+*					   READ_GRIDFILE --> TM_READ_GRIDFILE
+*					         UNIT_ID --> TM_UNIT_ID
+*					  FIND_LIKE_AXIS -->TM_FIND_LIKE_LINE
+*                                       FIND_LINE_NUMBER --> TM_GET_LINENUM
+*					      BREAK_DATE --> TM_BREAK_DATE
+*			using TM_FIND_LINE_SLOT and TM_FIND_GRID_SLOT
+*			and include files XUNITS and XGRID are from TMAP_FORMAT
+* revision 1.3 - 1/15/89 - changed default T0 for time axes from 1-JAN-1800 to
+*			   15-JAN-1901 for PPLUS WHOI format limitations
+* V200:  6/29/89 - reordered lo/hi_ss arguments
+*		 - added DEFINE VARIABLE
+*		 - DEFINE AX: allow calendar time axis using time steps
+*		 - added DEFINE AXIS/FROM_VARIABLE
+*		 - DEFINE AXIS&GRID check for legal name
+*		 - DEFINE VARIABLE accepts infix notation
+*	 3/19/90 - fixed logic bugs when redefining axes and grids
+*		 - eliminated warnings for duplicated definitions
+*	 3/22/90 - don't check axis units if units are unknown
+*	 4/24/90 - DEFINE VAR bug for var names of >8 chars
+*	  5/2/90 - DEFINE REG/DX= name tried to work from cx_last instead of
+*		   previous region "name"
+* Unix/RISC 3/12/91 (incidental) LET/TITLE now preserves lower case letters
+*                - DEFINE GRID/FILE=name changed to case sensitive name
+* V230:   6/8/92 - added DEFINE ALIAS (bug fixes 7/29)
+*         7/6/92 - added DEFINE AXIS/DEPTH (units="m" used to determine up/dn)
+*        7/24/92 - bug fix: DEFINE REGION was behaving like /DEFAULT always
+*                - delete uvars and uvar grids when @ regions are redefined
+*       10/22/92 - added units on uvars
+*       11/12/92 - added qualifiers /TEXT, /XLIMITS, /YLIMITS to DEFINE VIEW
+*                  and made it auto-scale the axes
+*	 3/29/93 - restore the old-style functioning of DEFINE VIEW/SIZE
+* V300:  4/22/93 - fix handling of enclosing quotes on DEFINE ALIAS
+* V301:	11/03/93 - added DEFINE AXIS/NPOINTS
+*	11/25/93 - bug fix: DEFINE AXIS/FROM/T0= expr
+*	 1/19/94 - added DEFINE VARIABLE/QUIET
+* V313:  ?? *kob* - IBM port shortened a couple lines and removed a couple tabs
+*	11/06/94 *sh* - inserted the bug fixes that had already been made in
+*		   the checked out version of this routine as follows:
+* V320: 5/94 - array "memory" as a calling argument
+*	8/94 - replaced calls to TM_FIND_LINE_SLOT and TM_FIND_GRID_SLOT with
+*		ALLO_MANAGED_GRID/AXIS to that deleted slots would be reused
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V400:  6/22/95 - added DEFINE SYMBOL name = value
+* V420:  7/95 - Added support for  LET/D=dset var = ...
+*	 11/95 - check to see if DEFINE AXIS/FROM actually has REGULAR points
+*	       - default for T0 set at start of start century (not always 1900)
+*	  2/96 - allow color to separate lo/high viewport limits (bug 2/12)
+*	  2/96 - fixed bug introduced 11/96. Code used a non-existent variable
+*		 called "regular" which was not caught by the compiler
+*      2/29/96 - bug: same var name couldn't be used in multiple dsets
+*	  4/96 - bug: tabs around "=" not handled right in LET A = expr
+* V430:7/10/96 - allow axes with units that contradict their orientations
+*		 Issue a warning
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V450:  11/96 - Using reformulated version of INIT_UVAR (RPN not called
+*		 from here). Part of changes to support external function.
+*	  1/97 - Issue warning if DEFINE AXIS/UNIT=MONTH is used
+*       - add check on cx_calendar rather than cx_lo/hi_ww to indicate whether time
+*         is date or timesteps
+* V491+ - 7/98 *sh* - allow case-sensitive var name in DEFINE GRID/LIKE=varname
+* V500 - 4/16/99 *sh* use DELETE_USER_VAR to delete old definition when uvar
+*	name is redefined ... else child vars to not get removed
+*	 4/20/99 *sh* added DEFINE AXIS/EDGES
+*	 4/28/99 *sh* allow DEFINE AXIS with repeated values -> microadjust
+*	 7/99 *sh* - changed def'n of "month" so change warning message
+* V510 - 8/99 *sh* - allow DEFINE GRID /LIKE=user_var /X=user_var (bump use
+*			counts on dynamic axes
+*	12/99 *sh* - allow new syntax DEFINE AXIS name=expression
+*			infer units from formatted (say) X=130e:80W
+*		and use routine name_equal_string in multiple places
+*	2/00 *sh* - on LET cmnd when replacing an existing variable definition
+*		allow for possible child vars ==> delete old BEFORE init_uvar
+*		is called on new
+*	3/00 *sh* - remove backslash escape characters from DEFINE SYMBOL
+*	     *sh* - allow automatic generation of T0=1-jan-0000
+*	4/00 *sh* - set use counts when defining grids and axes
+*	5/00 *sh* - support for LET/BAD=
+* V530: *sh* 9/00 - added initial data type support in get_cmnd_data 
+* v530  *acm* 2/01 - DEFINE AXIS/CALENDAR  calendar name for alternative 
+*                    calendar types.
+*	*sh* 4/01 - bug fix: DEFINE AXIS/FROM_DATA must check if n=1
+* V531: *sh* 5/01 - changed text of "unknown axis units" message
+*		  - during DEFINE GRID defer purging duplicate-name grid
+*		    until after new static one is defined -- else dynamic
+*		    axes that are needed can get wiped out
+*	*sh* 6/01 - increase buff1 size for DEFINE AXIS/LIKE=expr
+* V540:	*sh* 9/01 - added DEFINE VIEWPORT/AXES
+* V540: *acm*12/01 -bug fix: consolidate arguments broken up by command parser 
+*                   back into a single arg with call to all_1_arg
+* V541: *acm*8/02  Changes to recover line_mem storage when irregular
+*                  axis is cancelled; redefine line_mem pointer before 
+*                  call to purge_mr_axis.
+* V542: *sh* 7/02 - added support for sub-span modulo axes
+* V550: *acm*10/02- Change reg_name to char*24, to match cx_name
+* V551: *acm*  2/03 - On DEFINE AXIS/x name=expr, only reset num_args when
+*                     the expression is a const array {  }  (fixes bug w/ more
+*                     complex expr, for example "DEF AX/X  xax = a/2 + b/2")
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead 
+* v552: *acm* 4/03 Bug Fix: checking length of variable name. Length now 128
+* V553  *acm* 6/03 Use 'XX' or 'YY' for line_direction for non-lat/lon axes. 
+* v554 *acm* 11/03 reg_name had NOT been changed to *24, to match cx_name
+* v554 *acm* 11/03 Adjust definition of npoints, checking to see if the upper
+*                  limit of the axis is include in the upper grid box. (bug 673)
+* v554 *acm* 11/03 def axis/units=yr  was not the same as def axis/units=year
+*                  Change this so yr and year mean a year in whatever calendar 
+*                  we are using.
+* v554 *acm* 3/4   The adjustment in definition of npoints needs fuzzy comparison
+*                  not strict .GE. (under g77 linux)
+* V570 *acm* 5/04  Add the calendar name 365_DAY as equivalent for NOLEAP, and add 
+*                  the calendar ALL_LEAP = 366_DAY.
+* V570 *acm* 5/05  Changes for CF bounds 
+*                  syntax for user-specified bounds:
+*                  DEFINE AXIS/X/BOUNDS xax={1,2,5}, {0.5,1.5,1.5,3,3,6}
+*                  DEFINE AXIS/Z/BOUNDS zax=zcoord,zbnd
+* V580 *acm* 10/05 correct misspelling in statement 5582
+* V580 *acm* 11/04 Use cx_cal_id to keep track of which calendar used
+*                  when cx_lo_ww and cx_hi_ww are computed.
+* V581 *acm*  3/05 Catch case where errors in def axis/start:lo:del, before
+*                  trying to call RESET_SECS_FROM_BC (bug1203)
+* V581 *acm*  5/05 For OPeNDAP HDF files, do not check whether axis name is legal.
+*                  If it was given in quotes, skip the quotes when finding it in
+*                  the list of axis names.
+* V600 *acm* 3/06  fixing bugs 439&1390, new arg to get_new_cx.
+* V600 *acm* 3/06  Fix bug 1400: Add more convenient syntax for user-specified bounds:
+*                  Bounds can be either 2*N or N+1 values, or three lists of length N:
+*                  coords, lo_bound, hi_bound
+*                  DEFINE AXIS/X/BOUNDS xax={1,2,5}, {0.5,1.5,3,6}
+*                  DEFINE AXIS/Z/BOUNDS zax=zcoord, zbnd
+*                  DEFINE AXIS/Z/BOUNDS zax={1,2,5}, {0.5,1.5,3}, {1.5,3,6}
+*                  
+* V600 *acm* 3/06  Fix bug 1401: See the comment: a single point is always "regular" --
+*                  causes incorrect treatment of the axis if the axis has BOUNDS!!
+* V600 *acm*  8/05 DEFINE ATTRIBUTE[/type=][/D=] varname[d=].attname = <numeric scalar or 
+*                  vector, or string>
+* V600 *acm*  9/06 Fixes to bug 1443; tm_check_bnds is changed so it works differently
+*                  for a regular axis. Here we need to set line_regular to false when
+*                  defining the axis from data. It may later be set to true if the data is
+*                  in fact regular.
+* V601 *acm* 9/06  fixing bug 1439 long symbol values; change length of err_string to 2048
+* V601 *acm*11/06 Fix bug 1470: on a DEFINE AXIS command which is redefining an axis, change
+*                 values in the attribute structure for the axis.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V603  5/07 *acm* Fix bug 1511: if DEFINE AXIS or DEFINE ATT change a time
+*                  origin, include the origin in the units attribute as "since t0"
+*                  If units attribute is changed for a time axis, get the time
+*                  origin if it exists and append it to the units string.
+* V606  8/07 *acm* DEFINE AXIS/QUIET
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V62   2/09 *acm* Pass the original upper/lowercase spelling of user-defined variable
+*                  names to init_uvar; name to be saved in the attribute structure, for 
+*                  use when writing out user-defined variables when MODE UPCASE_OUTPUT 
+*                  is cancelled.
+* V62 *acm*  2/09 - Save original upper/lowercase spelling of axis names 
+*                   in line_name_orig for CANCEL MODE UPCASE
+* V62 *acm*  3/09  Fix bug 1645: Define an axis with a very large number of NPOINTS.
+*                  This works if the value of NPOINTS can be specified as an integer.
+* V64 *acm* 11/09  Fix to bug 1511 slightly wrong: dont use line_t0 from
+*                  a previous definition of a time axis.
+* V65 *acm*  2/10  Minor change to error message
+* V664  8/10 *kms* Add DEFINE PYFUNC /NAME=<alias> python.module.name
+* V67   1/11 *acm* User-defined attributes are set to /OUTPUT=1  by default.
+*                  Write the calendar attribute, even if its the default Gregorian
+* V68 *acm* 1/12   Use the same micro-adjusting scheme as we are implementing for 
+*                  reading netCDF files (ticket 1910). Reset micro-adjust size if needed.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+* V68  *acm* 5/12  Add DEFINE DATA/AGGREGATE
+* V683 *acm*11/12  If DEFINE AXIS data not monotonic, add the index location 
+*                  to the error message
+* V685 *acm* 1/13  Fix ticket 2026: dont automatically mark a 1-point longitude
+*                  axis as modulo.
+* V685 *adm*  1/13 DEFINE VARIABLE/REMOTE. Require /D= to accompany /REMOTE.
+* V685 *acm*  4/13 Add /HIDDEN on DEF DATA/AGG
+* V685 *acm* 10/13 Fix ticket 2096, DEFINE GRID with check on units
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+* V687 *acm*  1/14 Fixing ticket 2135; grid_use_cnt on DEFINE DATA/AGG datasets
+* V690 *sh*   1/14 Formatting improvement to DEFINE ATTRIB error message
+
+	include	'tmap_errors.parm'
+#	include	"tmap_dset.parm"
+	include	'tmap_dims.parm'
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'rpn.parm'
+	include 'gfdl_vms.parm'	
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xtext_info.cmn'
+	include 'xcommand.cmn'
+        include 'xgrid_chg_fcns.cmn'
+	include 'calendar.decl'
+	include 'calendar.cmn'	
+        include 'netcdf.inc'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC' ! wsid
+
+* local parameter declarations:
+	INTEGER	    slash_dflt,
+     .		    slash_file,
+     .		    slash_like,
+     .		    slash_units,
+     .		    slash_x0,
+     .		    slash_t0,
+     .		    slash_name,
+     .		    slash_from,
+     .		    slash_depth,
+     .		    slash_modulo,
+     .		    slash_npoints,
+     .		    slash_edges,
+     .		    slash_calendar,
+     .		    slash_text,
+     .		    slash_xlimits,
+     .		    slash_ylimits,
+     .		    slash_size,
+     .		    slash_origin,
+     .		    slash_clip,
+     .		    slash_let_title,
+     .		    slash_let_units,
+     .		    slash_let_quiet,
+     .		    slash_let_dset,
+     .		    slash_let_bad,
+     .		    slash_let_remote,
+     .		    slash_define_vp_by_ax,
+     .              slash_bounds,
+     .              slash_def_att_type,
+     .              slash_def_att_dset,
+     .              slash_def_att_output,
+     .              slash_def_att_quiet,
+     .              slash_def_ax_quiet,
+     .              slash_pyfunc_name,
+     .              slash_def_aggregate,
+     .              slash_def_agg_title,
+     .              slash_def_agg_quiet,
+     .              slash_def_agg_e,
+     .              slash_def_agg_f,
+     .              slash_def_agg_hide
+
+	LOGICAL	    explct_defn
+	PARAMETER ( slash_dflt   = 1 + 12,
+     .		    slash_file   = 1 + 6,
+     .		    slash_like   = 1 + 7,
+     .		    slash_units  = 1 + 7,
+     .		    slash_x0     = 0,	! slash_x minus 1
+     .		    slash_t0     = 1 + 8,
+     .		    slash_name	 = 1 + 9,
+     .		    slash_from	 = 1 + 10,
+     .		    slash_depth	 = 1 + 11,
+     .		    slash_modulo = 1 + 12,
+     .		    slash_npoints= 1 + 13,
+     .		    slash_edges  = 1 + 14,
+     .		    slash_calendar = 1 + 15,
+     .              slash_bounds     = 1+16,
+     .              slash_def_ax_quiet = 1+17,
+     .              slash_text   = 1 + 0,
+     .		    slash_xlimits= 1 + 1,
+     .		    slash_ylimits= 1 + 2,
+     .		    slash_size   = 1 + 3,
+     .		    slash_origin = 1 + 4,
+     .		    slash_clip   = 1 + 5,
+     .		    slash_let_title  = 1 + 0,
+     .		    slash_let_units  = 1 + 1,
+     .		    slash_let_quiet  = 1 + 2,
+     .		    slash_let_dset   = 1 + 3,
+     .		    slash_let_bad    = 1 + 4,
+     .		    slash_let_remote = 1 + 5,
+     .		    slash_define_vp_by_ax = 1 + 6,
+     .              slash_def_att_type    = 1 + 1,
+     .              slash_def_att_dset    = 1 + 0,
+     .              slash_def_att_output  = 1 + 2,
+     .              slash_def_att_quiet   = 1 + 3,
+     .              slash_pyfunc_name = 1,
+     .              slash_def_aggregate = 1 + 0,
+     .              slash_def_agg_e     = 1 + 5,
+     .              slash_def_agg_f     = 1 + 6,
+     .              slash_def_agg_title = 1 + 7,
+     .              slash_def_agg_quiet = 1 + 8,
+     .              slash_def_agg_hide  = 1 + 9,
+     .		    explct_defn  = .FALSE. )
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	LOGICAL	  TM_DIGIT, TM_LEGAL_NAME, TM_LINE_MATCH, TM_GRID_MATCH,
+     .		  TM_FPEQ, TM_DFPEQ, TM_CHECK_BNDS, MATCH_NAME,
+     .            NC_GET_ATTRIB, TM_LENSTR, TM_LEGAL_NAME_OP, TM_HAS_STRING,
+     .            dup_name, delta_given, create, irreg, its_reg, its_edges, 
+     .            its_calendar, its_modulo, has_repeated, has_bounds,
+     .            new_att, new_att_modulo, got_it, orient_t, agg_quiet, agg_e,
+     .            letdset, its_remote, agg_hide, def_att_quiet, purge_all
+	INTEGER   REGION_NUMBER, GRID_FROM_NAME, VIEWPORT_NUMBER, STR_UPCASE,
+     .		  CX_DIM_LEN, ALIAS_ID, EFCN_SCAN,
+     .		  TM_GET_LINENUM, TM_LENSTR1,
+     .		  TM_GET_GRIDNUM, TM_UNIT_ID,
+     .		  ALLO_MANAGED_AXIS, ALLO_MANAGED_GRID, FIND_DSET_NUMBER,
+     .            TM_GET_CALENDAR_ID, STR_SAME,
+     .		  tmap_status, npoints, i, 
+     .		  status, idim, vax_code, islot, iunit, iline, cat, var,
+     .		  orient, mods_cx, cx, mr, n, i1, i2, i3, i4, i5, i6, pos,
+     .		  grid, iqual, ax_grid, ivp, qp, iseg, uvar, dset, slen, s1,
+     .		  old_line, old_grid, frst_pt, dim(nferdims), ndim, natom,
+     .		  at_type  (maxatoms), at_id  (maxatoms),
+     .		  at_start (maxatoms), at_end (maxatoms), cal_id, 
+     .            dflt_cal_id, nmonths, ndays, d_before_mon(12), 
+     .            mon_by_d(366), d_in_mon(12), len_cal, n2, n3, s2len,
+     .            prev_cal_id, j, num_indices, varid, attype_spec,
+     .            attoutflag, attlen, coordvar, 
+     .            dset_to_add, dir, type, attype, attid, ibuff, i0,  
+     .            agg_dim, ivar
+
+	REAL	  rbuff, bad_flag, yeardays, 
+     .            val, dummy, val_buf
+
+	REAL*4	  r4_unspec, scale, xlovp, ylovp,  xhivp, yhivp,
+     .            xoei,  yoei,   xcei,  ycei
+	REAL*8	  SECS_FROM_BC, TM_WW_AXLEN,
+     .		  bc_to_t0, start, new_ww, delta, end, secs2start,
+     .            micro_adj, axwwlen, rmod_len, secsperyear, small, 
+     .            new_att_modulo_len, madj
+	CHARACTER TM_FMT*16, 
+     .            reg_name*24, buff1*128, buff2*128, buff3*128, 
+     .            buffsym*120, cal_name*32, buff*512,
+     .            basic_orients(nferdims)*2, err_string*2048, replmsg*24,
+     .		  mon_names(12)*3, varname*512, attname*128, t2*2,
+     .            new_att_units*128, new_att_calendar*128,
+     .            new_att_t0*128, dcode*2, axdir*1, t0string*128, 
+     .            ustring*128
+
+        CHARACTER*1 tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+	DATA	  basic_orients / 'WE','SN','UD','TI','E','F' /,
+     .		  replmsg/'Replacing definition of '/
+* statement function - value between 0 and 1
+	REAL x, vx, vy
+	LOGICAL OUTSIDE_0_1
+	OUTSIDE_0_1( x ) = x.LT.0.0 .OR. x.GT.1.0
+
+* select subcommand
+	GOTO ( 100,200,300,400,500,600,700,800,900,1000,1100 ) subcmnd_num
+
+* DEFINE  '    ' - (no action)
+* arrival at this point usually means an illegal subcommand was given
+* and was assumed to be an argument by the command parser
+ 100	IF ( num_args .GE. 1 ) THEN
+	   CALL ERRMSG( ferr_invalid_subcmnd, status,
+     .			cmnd_buff( arg_start(1):arg_end(1) ), *5000 )
+	ELSE
+	   CALL ERRMSG( ferr_invalid_command, status,
+     .			'DEFINE what ?', *5000 )
+	ENDIF
+
+**************************************************************************
+* DEFINE REGION
+* ... command syntax ok ?
+ 200	IF ( num_args .EQ. 0 ) THEN
+	   CALL ERRMSG( ferr_invalid_command, status,
+     .			'DEFINE what region ?', *5000 )
+	ENDIF
+
+* get the name of the region to be defined
+	reg_name = cmnd_buff(arg_start(1):arg_end(1))
+
+* is this region already defined ?
+	islot = REGION_NUMBER( reg_name )
+        create = islot .EQ. unspecified_int4
+
+* delta context specifiers (DX=,DY=, etc), if any
+	CALL GET_DELTA_CONTEXT( 14, delta_given, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+	IF ( delta_given .AND. .NOT.create ) THEN
+* modify a previously defined region
+* minor bug: normal non-delta location qualifiers are ignored in this case
+	   CALL TRANSFER_CONTEXT( islot, cx_buff )
+	   CALL APPLY_DELTA_CONTEXT( cx_buff, reg_name, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+	ELSE
+* assemble the context based on the last command context
+	   CALL GET_NEW_CX( cx_last, cx_buff, .TRUE., status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* ... apply delta limits to the default from last command
+	   IF ( delta_given ) THEN
+	      CALL APPLY_DELTA_CONTEXT( cx_buff, 'DEFAULT', status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+
+* ... if this region was not previously defined find a slot
+	   IF ( create ) THEN
+	      DO 240 islot = 0, min_context, -1
+	         IF ( cx_name(islot) .EQ. unspecified_name4 ) GOTO 245!fix 7/92
+ 240	      CONTINUE
+* ... no free slots
+	      CALL ERRMSG( ferr_prog_limit,status,
+     .			   'Cancel or redefine a region',*5000 )
+	   ENDIF
+
+* ... if "/DEFAULT" was implied or given then flag for saving all dimensions
+*     that are defined
+ 245       IF ( num_qualifiers .EQ. 0 
+     .     .OR. qual_given( slash_dflt ) .GT. 0 ) THEN
+	      DO 210 idim = 1, nferdims
+	         IF (cx_by_ss(idim,cx_buff)
+     .		   .AND. cx_lo_ss(cx_buff,idim) .NE. unspecified_int4
+     .	        .OR..NOT.cx_by_ss(idim,cx_buff)
+     .		   .AND. cx_lo_ww(idim,cx_buff) .NE. unspecified_val8)
+     .				cx_given( idim, cx_buff ) = .TRUE.
+ 210	      CONTINUE
+* ... else flag only the dimensions named
+	   ENDIF
+	ENDIF
+
+* all unmodified axes must be set to unspecified
+	DO 230 idim = 1, nferdims
+ 230	IF ( .NOT.cx_given(idim,cx_buff) ) CALL DEL_CX_DIM( idim, cx_buff )
+
+* LET-defined variables may involve now-redefined @regions so wipe out
+* previously computed values and grids that may be obsolete(7/92)
+        IF ( .NOT.create ) THEN
+           CALL PURGE_ALL_UVARS
+           CALL DELETE_ALL_UVAR_GRIDS
+        ENDIF
+
+* save it for posterity
+ 	CALL TRANSFER_CONTEXT( cx_buff, islot )
+	cx_name( islot ) = reg_name
+	RETURN
+
+**************************************************************************
+* DEFINE GRID
+* ... DEFINE GRID/X/Y/Z/T/E/F /FILE /LIKE
+ 300	iqual = qual_given( slash_file )
+	IF ( iqual .GT. 0 ) THEN
+* ... note "err_string" is used to save space - this is not an error
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      err_string, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL TM_READ_GRIDFILE( err_string, tmap_status )
+	   IF ( tmap_status .NE. merr_ok ) GOTO 5305
+	   RETURN
+	ENDIF
+
+* DEFINE GRID gridname - what is "gridname" ?
+	IF ( num_args .NE. 1 ) GOTO 5300
+
+* must be a unique name
+	vax_code = STR_UPCASE( buff3, cmnd_buff(arg_start(1):arg_end(1)) ) 
+	IF ( .NOT.TM_LEGAL_NAME(buff3) ) GOTO 5100
+	old_grid = TM_GET_GRIDNUM( buff3 ) 
+	dup_name = old_grid .NE. unspecified_int4
+	IF (dup_name .AND. old_grid .GT. max_grids ) GOTO 5310
+
+* was a /LIKE= given ? ... set up a grid template
+	iqual = qual_given( slash_like )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff1, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   grid = GRID_FROM_NAME( buff1, cx_last, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL TM_COPY_GRID( grid, mgrid_buff )
+	ELSE
+	   DO 310 idim = 1, nferdims
+	      grid_line    (idim, mgrid_buff) = mnormal
+              grid_out_prod(idim, mgrid_buff) = .TRUE.
+ 310	   CONTINUE	
+	   grid_rotation( mgrid_buff ) = 0.0
+	ENDIF
+
+* axes named with /X=line_grid_or_var, /Y= ...
+	DO 320 idim = 1, nferdims
+	   iqual = qual_given( idim )
+	   IF ( iqual .GT. 0 ) THEN
+	      CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .				 buff1, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      iline = TM_GET_LINENUM( buff1 )
+	      IF ( iline .NE. unspecified_int4 ) THEN
+* ... line given by name - don't allow inappropriate units
+ 	         orient_t = idim.EQ.t_dim .OR. idim.EQ.f_dim
+		 iunit = line_unit_code ( iline )
+ 	         IF ( iunit.NE.0 ) THEN
+ 	            IF ( (  orient_t .AND.
+     .		     (iunit.LT.pun_1st_time .OR. iunit.GT.pun_last_time) )
+     .	            .OR. (  (.NOT.orient_t) .AND.
+     .		     (iunit.LT.pun_1st_len  .OR. iunit.GT.pun_last_len ) )
+     .	            .OR. (  idim.EQ.z_dim .AND.
+     .	              iunit.EQ.pun_degrees )     ) GOTO 5330
+	         ENDIF
+	         grid_line(idim, mgrid_buff) = iline
+	      ELSE
+* ... line implied through grid or variable name
+	         ax_grid = GRID_FROM_NAME( buff1, cx_last, status )
+	         IF ( status .NE. ferr_ok ) RETURN
+	         IF ( ax_grid .EQ. unspecified_int4 ) GOTO 5320
+	         grid_line(idim, mgrid_buff) = grid_line( idim, ax_grid )
+	      ENDIF
+	   ENDIF
+ 320	CONTINUE
+
+* check for repeated definitions and illegal redefinitions
+	IF ( dup_name ) THEN
+	   IF ( TM_GRID_MATCH( old_grid,mgrid_buff ) ) THEN
+	      RETURN					! dup name/dup def
+	   ENDIF
+	ENDIF
+
+* find a slot to store the new grid
+	status = ALLO_MANAGED_GRID( grid )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* save the grid and name it (8/99 - also bump use counts of dynamic axes)
+ 340	CALL TM_COPY_GRID_W_LINE_USE( mgrid_buff, grid )
+	grid_name( grid ) = buff3
+
+* purge old duplicate-name grid.  We deferred until after new static grid
+* was defined so new dynamic axes weren't wiped out
+	IF ( dup_name ) THEN
+* ... redefinition makes all past assumptions incorrect
+	   CALL SPLIT_LIST(pttmode_ops, err_lun,
+     .			replmsg//'grid '//grid_name(old_grid), 0)
+	   CALL PURGE_MR_GRID( old_grid, status )
+	   IF ( status .NE. merr_ok ) GOTO 5000
+* ... deallocate dynamic axes used in previous definition of this grid
+	   DO 350 idim = 1,nferdims
+	      CALL TM_DEALLO_DYN_LINE( grid_line(idim,old_grid) )
+ 350	   CONTINUE
+	   grid_name( old_grid ) = char_init16
+	ENDIF
+
+	RETURN
+
+**************************************************************************
+* DEFINE VARIABLE
+* find name to define
+* 2 syntaxes are allowed: "DEFINE VAR NAME=TEXT", "DEFINE VAR NAME TEXT"
+* in the latter be careful that "TEXT" may contain "="
+ 400	purge_all = .FALSE.  ! initialize
+        IF ( num_args .LT. 1 ) GOTO 5300
+	CALL NAME_EQUAL_STRING( buff1, pos, status )
+	CALL NAME_EQUAL_STRING_LC( varname, pos, status )
+	IF ( status .NE. ferr_ok )  GOTO 5000
+	IF ( pos .EQ. 0 ) GOTO 5400
+	IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5410
+	IF ( .NOT.TM_LEGAL_NAME_OP(buff1) ) GOTO 5430
+        IF ( TM_LENSTR1(buff1) .GT. 128 ) GOTO 5410
+	CALL FIND_VAR_NAME ( pdset_irrelevant, buff1, cat, var )
+	IF (  var .NE. munknown_var_name
+     .	.AND. cat .EQ. cat_pseudo_var    ) GOTO 5420
+
+* /D=xxx: has the user requested a data-set-specific definition?
+	iqual = qual_given( slash_let_dset )
+	letdset = ( iqual .GT. 0 ) 
+	IF (letdset) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff3, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( buff3 .EQ. ' ' ) THEN
+	      dset = pdset_irrelevant	! "/D", alone for default-to-dset
+	      buff3 = 'No current data set'	! ... for error reporting
+	      IF ( dset .EQ. unspecified_int4) GOTO 5470
+	   ELSE
+	      dset = FIND_DSET_NUMBER( buff3 )
+	      IF ( dset .EQ. unspecified_int4) GOTO 5470
+	   ENDIF
+	ELSE
+	   dset = unspecified_int4
+	ENDIF
+
+* title given ?  (preserves lower case via EQUAL_STR_LC 3/91)
+	buff3 = ' '
+	iqual = qual_given( slash_let_title )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff3, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* units given ?
+	buff2 = ' '
+	iqual = qual_given( slash_let_units )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* bad flag given ?
+	iqual = qual_given( slash_let_bad )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .                     bad_flag, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   bad_flag = bad_val4
+	ENDIF
+
+* LET/REMOTE ?
+
+	its_remote = .FALSE.
+	iqual = qual_given( slash_let_remote )
+	IF ( iqual .GT. 0 ) THEN
+	   IF (.NOT. letdset) GOTO 5480
+	   its_remote = .TRUE.
+	ENDIF
+
+* break the expression into atoms and identify them
+
+        t2 = cmnd_buff(pos:pos+1)
+        IF (t2 .EQ. '..') cmnd_buff(pos:pos+1) = 'aa'
+	CALL ALG_BREAK_UP( cmnd_buff(pos:len_cmnd),at_start,at_end,natom,
+     .			   err_string,status )
+        cmnd_buff(pos:pos+1) = t2
+
+	IF ( status .NE. ferr_ok ) GOTO 5440
+
+* cannot use [d= in the remote var-- the expression is evaluated on the
+* remote server; same dsets not open there.
+	IF (its_remote.AND. TM_HAS_STRING(cmnd_buff(pos:len_cmnd), 'd=') ) GOTO 5490
+
+	CALL ALG_ID( cmnd_buff(pos:len_cmnd), natom, at_start, at_end,
+     .		     at_type, at_id, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* if this definition replaces a variable of the same name in this data set
+* then purge cached calculations (8/95)
+	IF ( dset .GT. pdset_irrelevant ) THEN
+	   CALL FIND_VAR_NAME ( dset, buff1, cat, var )
+	   IF ( ( (cat .EQ. cat_file_var) .OR.
+     .            (cat .EQ. cat_pystat_var) ) .AND.
+     .          (var .NE. munknown_var_name) ) CALL PURGE_ALL_UVARS
+	ENDIF
+
+* if this is a global forground definition that replaces any variable
+* then purge cached calculations (8/95)
+	IF ( dset .EQ. unspecified_int4 ) THEN
+	   CALL FIND_VAR_NAME ( dset, buff1, cat, var )
+	   IF ( var .NE. munknown_var_name ) CALL PURGE_ALL_UVARS
+	ENDIF
+
+* do we need to delete a previous definition of this same-named var ?
+* Note: need to purge old defs ALSO if the same name is now redefined in a 
+*	new data set -- expressions using this name chg interpretation  
+*	DO 410 i1 = 1, max_uvar
+*	   IF ( uvar_num_items(i1) .EQ. uvar_deleted ) GOTO 410
+*	   vax_code = STR_CASE_BLIND_COMPARE( uvar_name_code(i1), buff1 )
+*	   IF ( vax_code .EQ. vms_str_success ) THEN
+        CALL string_array_find_caseblind(uvar_name_code_head,
+     .                                   buff1,
+     .                                   LEN(buff1),
+     .                                   string_array_result(1),
+     .                                   max_uvar,
+     .                                   num_indices)        
+        DO 410 j = 1, num_indices
+              i1 = string_array_result(j)
+              IF ( uvar_num_items(i1) .EQ. uvar_deleted ) GOTO 410
+* ... delete only if same name in same data set
+	      IF ( uvar_dset(i1) .EQ. dset ) THEN
+	         CALL DELETE_USER_VAR(i1)
+	      ENDIF
+* ... reuse of name  makes all stored uvars possibly invalid
+*     Also invalidates any memory-cached results that used aux of this name
+	      purge_all = .TRUE.
+*	   ENDIF
+ 410	CONTINUE
+
+* if this name is used as the target of an aux (curvilinear) coordinate var
+* (re)defining it may invalidate cached results
+        CALL GET_FVARS_LIST_BY_ATTNAME_AND_VAL
+     .	  (patnam_sigma, buff1, max_uvar,
+     .     string_array_result, deleted_list_result, num_indices)
+        purge_all = purge_all .OR. (num_indices .GT. 0)
+        IF (.NOT.purge_all) THEN
+           CALL GET_UVARS_LIST_BY_ATTNAME_AND_VAL
+     .	        (patnam_sigma, buff1, max_uvar,
+     .           string_array_result, deleted_list_result, num_indices)
+           purge_all = purge_all .OR. (num_indices .GT. 0)
+        ENDIF
+
+* purge user variables and aux var dependencies if needed
+        IF (purge_all) CALL PURGE_ALL_UVARS !not done above for pdset_irrelevant
+
+* now file the expression in the user-defined variable area
+	CALL INIT_UVAR ( buff1, cmnd_buff(pos:len_cmnd), buff3, buff2, dset,
+     .			 bad_flag, explct_defn, uvar,
+     .			 at_type, at_id, at_start, at_end,
+     .			 natom, 1, len_cmnd-pos+1, varname, 
+     .			 its_remote, status )
+	IF ( status .NE. ferr_ok ) RETURN
+
+* is there at least one slot blank ?
+	DO 430 i1 = 1, max_uvar
+ 430	IF ( uvar_num_items(i1) .EQ. uvar_deleted ) RETURN
+
+* no - not allowed to fill the last slot !
+*	uvar_num_items(uvar) = uvar_deleted
+        CALL deleted_list_modify(uvar_num_items_head, uvar,
+     .                       uvar_deleted )
+	CALL ERRMSG( ferr_prog_limit, status,
+     .		'too many user-defined variables'//pCR//
+     .		'cancel or redefine some variables', *5000 )
+
+**************************************************************************
+* DEFINE AXIS
+* ... /FILE=
+ 500	IF ( qual_given( slash_file ) .GT. 0 ) GOTO 300 ! like DEFINE GRID/FILE
+
+* DEFINE AXIS - what is "axisname" ?
+	iqual = qual_given( slash_name )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff3, status )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      varname, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   pos = arg_start(1)	! cmnd arg is the expression to eval
+	ELSE	   
+	   IF ( num_args .LT. 1 ) GOTO 5300
+	   CALL NAME_EQUAL_STRING( buff3, pos, status )
+	   CALL NAME_EQUAL_STRING_LC( varname, pos, status )
+
+	   IF ( status .NE. ferr_ok )  GOTO 5000
+
+	   IF ( pos .GT. 0 ) THEN
+
+* consolidate arguments broken up by command parser back into a single arg
+
+              IF (cmnd_buff(pos:pos) .EQ. '{') THEN
+                 CALL all_1_arg
+	         num_args = 1	 ! used by GET_CMND_DATA
+              ENDIF
+	      arg_start(1) = pos ! skip over "name ="
+	   ELSE
+	      CONTINUE ! pos=0 signals that no expression was given
+	   ENDIF
+	ENDIF
+
+* DEFINE AXIS - modulo ?
+	iqual = qual_given( slash_modulo )
+        new_att_modulo = .FALSE.
+        new_att_modulo_len = -1.
+	its_modulo = iqual .GT. 0 
+	IF ( its_modulo ) THEN
+           new_att_modulo = .TRUE.
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      rbuff, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF (rbuff .EQ.  unspecified_val4) THEN
+	      rmod_len = 0.0D0
+	   ELSE
+	      rmod_len = ABS(rbuff)  ! ABS to tolerate negatives
+              new_att_modulo_len = rmod_len
+	   ENDIF
+	ELSE
+	   rmod_len = 0.0D0
+	ENDIF
+
+* is this to be a regular or irregular definition?
+	irreg = qual_given(slash_name) .GT. 0
+     .	  .OR. (qual_given(slash_name) .EQ. 0
+     .		.AND. pos .GT. 0)	! /NAME=XXX or "NAME= expression"
+
+* must be a unique name
+c	IF ( .NOT.TM_LEGAL_NAME( buff3 ) ) GOTO 5100
+        slen = TM_LENSTR1( buff3)
+        s1 = 1
+        IF (buff3(1:1) .EQ. "'" .AND. buff3(slen:slen) .EQ. "'") THEN
+           s1 = 2
+           slen = slen - 1
+        ENDIF
+	old_line = TM_GET_LINENUM( buff3(s1:slen) )
+	dup_name = old_line .NE. unspecified_int4
+
+* get the X,Y,Z,T,E,F regions
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS( mods_cx )
+	CALL GET_CONTEXT_MODS (	cx_last,
+     .				cmnd_buff,
+     .				mods_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				unknown_qual_ok,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* orientation must be uniquely defined
+
+	orient = unspecified_int4
+	DO 510 idim = 1, nferdims
+	   IF ( qual_given(slash_x0+idim) .GT. 0 ) THEN   !!!!!!!!
+	      IF ( orient .NE. unspecified_int4 ) GOTO 5510
+	      orient = idim
+	   ENDIF
+ 510	CONTINUE
+	IF ( irreg ) THEN
+* ... orientation may be inferred from clues if irregular coord syntax is used
+	    IF ( qual_given(slash_depth) .GT. 0 ) orient = z_dim
+	    IF ( qual_given(slash_T0)    .GT. 0 ) orient = t_dim
+	ENDIF
+        IF ( qual_given(slash_depth) .GT. 0
+     . .AND. orient .NE. z_dim            ) GOTO 5505
+
+* if orientation is unclear then assume it is X
+	IF ( orient .EQ. unspecified_int4 ) THEN
+	   CALL WARN (
+     .	     "Orientation not specified via /X,/Y,/Z,/T,/E, or /F. X assumed.")
+	   orient = x_dim
+	ENDIF
+	orient_t = orient.EQ.t_dim .OR. orient.EQ.f_dim
+
+* release context stack space
+	CALL STACK_PTR_DN ( cx_stack_ptr, cx_stack_ptr_base, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* /EDGES?
+	its_edges =  qual_given( slash_edges ) .GT. 0
+
+* /BOUNDS?
+	has_bounds =  qual_given( slash_bounds ) .GT. 0
+        IF (has_bounds .AND. its_edges) GOTO 5730
+
+* /UNITS = DEGREES,METERS, ... SECONDS (or supply defaults)
+        buff1 = ' '
+        new_att_units = ' ' 
+	iqual = qual_given( slash_units )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff1, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+           new_att_units = buff1
+
+	ELSEIF ( cx_formatted(orient)
+     .	   .AND. (orient.EQ.x_dim .OR. orient.EQ.y_dim) ) THEN
+	   buff1 = 'degrees'	! infer from input like "X=130E:80W"
+	ELSEIF ( orient_t
+* 8/97 *kob* use cx_calender to check if time is date rather than time step
+     .  .AND.  (     qual_given(slash_T0) .GT. 0
+     .		.OR. cx_calendar(mods_cx))) THEN
+	   buff1 = 'HOURS'
+	ELSE
+	   buff1 = 'NONE'
+	ENDIF
+
+* is it a calendar axis definition?
+	its_calendar =  orient_t .AND. cx_calendar(mods_cx)
+
+* *acm* other calendar names* /CALENDAR = GREGORIAN, NOLEAP, JULIAN, 360_DAY, ALL_LEAP
+*       Gregorian is the default, also may be called STANDARD.
+*       NOLEAP may also be called 365_DAY.
+*       ALL_LEAP may also be called 366_DAY
+
+        cal_name = 'GREGORIAN'		! default
+        new_att_calendar = " "
+        dflt_cal_id = TM_GET_CALENDAR_ID (cal_name)
+	iqual = qual_given( slash_calendar )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      cal_name, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+           new_att_calendar = cal_name
+	ELSEIF ( orient .EQ. t_dim  .AND.  
+     .         ( qual_given(slash_T0) .GT. 0  .OR. 
+     .           cx_calendar(mods_cx)) ) THEN
+	   cal_name = 'GREGORIAN'
+	ENDIF
+
+* 9/01 CF conventions have adopted the name 360_day for a 360-day year.
+
+        IF (cal_name .EQ. '360') cal_name = '360_DAY' 
+        IF (cal_name .EQ. 'D360') cal_name = '360_DAY' 
+        IF (cal_name .EQ. 'STANDARD') cal_name = 'GREGORIAN' 
+        IF (cal_name(1:6) .EQ. 'COMMON') cal_name = 'NOLEAP' 
+        IF (cal_name(1:6) .EQ. '365_DA') cal_name = 'NOLEAP' 
+        IF (cal_name(1:6) .EQ. '366_DA') cal_name = 'ALL_LEAP' 
+        cal_id = TM_GET_CALENDAR_ID (cal_name)
+	IF (cal_id .LE. 0  .OR. cal_id .GT. max_calendars ) GO TO 5720
+        CALL TM_GET_CALENDAR_ATTRIBUTES (cal_id, nmonths, 
+     .                 ndays, yeardays, mon_names, d_in_mon, 
+     .                 d_before_mon, mon_by_d)
+        IF (new_att_calendar .NE. " ") new_att_calendar = cal_name
+
+* interpret the line units
+	IF ( buff1 .EQ. 'NONE' .OR. buff1 .EQ. ' ' ) THEN
+	   buff1 = ' '
+	   iunit = 0
+	ELSE
+	   iunit = TM_UNIT_ID( buff1 )
+	   IF ( iunit .EQ. 0 ) THEN
+	       CALL WARN('(fyi) units are not subject to auto-conversion: '
+     .			//buff1)
+
+C /calendar=/unit=year gets length of year in that calendar.
+           ELSEIF (iunit .EQ. -6 .OR. iunit .EQ. -10) THEN  
+	      IF (cal_id .EQ. d360) iunit = -9
+	      IF (cal_id .EQ. julian) iunit = -12
+	      IF (cal_id .EQ. noleap) iunit = -11
+	      IF (cal_id .EQ. all_leap) iunit = -8
+
+C /units=months  is 1/12 of the length of the year
+	   ELSEIF (iunit .EQ. -5) THEN    ! 1/97: "-5" is "MONTHS"
+              IF (cal_id .eq. GREGORIAN) THEN
+                 WRITE (err_string,3544) yeardays
+              ELSE
+                 WRITE (err_string,3540) yeardays
+                 IF (cal_id .eq. 2) THEN	! noleap
+                    iunit = -13
+                 ELSE IF (cal_id .eq. 3) THEN	! Julian
+		    iunit = -15
+		 ELSE IF (cal_id .eq. 4) THEN	! 360_DAY
+		    iunit = -14
+		 ELSE IF (cal_id .eq. 5) THEN	! ALL_LEAP
+		    iunit = -16
+	         ENDIF
+*  Append calendar name to units string.
+		 slen = TM_LENSTR1 (buff1)
+		 len_cal = TM_LENSTR1 (cal_name)
+		 buff1 = buff1(:slen)//'('//cal_name(:len_cal)//')'
+              ENDIF
+	      
+ 3540         FORMAT 
+     .        ('/UNIT=MONTHS  ... using 1/12 of ',F6.2,' days')
+ 3544         FORMAT 
+     .        ('/UNIT=MONTHS is ambiguous ... using 1/12 of ',F8.4,' days')
+	         CALL WARN (err_string) 
+	   ELSE
+* ... Issue warning for inappropriate units like HOURS on X ax
+*     and render the units unconvertible
+ 	      IF ( (  orient_t .AND.
+     .		   ( iunit.LT.pun_1st_time .OR. iunit.GT.pun_last_time ) )
+     .	      .OR. (  .NOT.orient_t .AND.
+     .		   ( iunit.LT.pun_1st_len  .OR. iunit.GT.pun_last_len  ) )
+     .	      .OR. (  orient.EQ.z_dim .AND.
+     .	             iunit.EQ.pun_degrees )  ) THEN	! 7/96
+	         CALL WARN
+     .		   ('Units appear to conflict with orientation:'
+     .			//' no conversions possible')
+	         iunit = 0
+	      ENDIF	      
+	   ENDIF
+ 	ENDIF
+
+* find a space to catalog it
+	status = ALLO_MANAGED_AXIS( iline )
+	IF ( status .NE. merr_ok ) GOTO 5000
+
+* was /NPOINTS given ?
+* Read as an INTEGER then it can be really large and retain accuracy.
+	iqual = qual_given( slash_npoints )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_val_int( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      ibuff, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( ibuff .LE. 0 ) GOTO 5582
+	   npoints = ibuff
+	ELSE
+	   npoints = unspecified_int4
+	ENDIF
+
+* GET THE AXIS POINTS: IRREGULAR (from_variable) or regular
+	IF ( irreg ) THEN
+           line_regular( iline ) = .FALSE.  ! this may be reset to true later.
+* ... get axis points from a memory variable
+	   CALL GET_CMND_DATA ( memory, cx_last, ptype_float, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+           IF ( num_uvars_in_cmnd .NE. 1 .AND.
+     .         (.NOT. has_bounds) )GOTO 5580
+           cx = is_cx(1)
+* ... make sure it's an line (not a point,plane,etc.) of data
+	   CALL GET_CX_DIMS( cx, ndim, dim )
+	   IF ( ndim .GT. 1 ) GOTO 5580
+	   idim = dim(1)
+	   n    = CX_DIM_LEN( idim, cx )
+
+* ... Checks on the bounds specification
+           IF (has_bounds) THEN
+              its_reg = .FALSE.
+	      IF ( num_uvars_in_cmnd .LT. 2 .OR. 
+     .             num_uvars_in_cmnd .GT. 3) GOTO 5580
+              cx = is_cx(2)
+	      mr = is_mr(2)
+* ... make sure it's an line (not a point,plane,etc.) of data
+	      CALL GET_CX_DIMS( cx, ndim, dim )
+	      IF ( ndim .GT. 1 ) GOTO 5580
+* ... check dimension if given as coords, lo_bnds, hi_bnds
+              cx = is_cx(3)
+	      mr = is_mr(3)
+	      CALL GET_CX_DIMS( cx, ndim, dim )
+	      IF ( ndim .GT. 1 ) GOTO 5580
+* ... make sure the bounds have dimension 2*N or N+1
+              idim = dim(1)
+              n2   = CX_DIM_LEN( idim, is_cx(2) )
+              IF (num_uvars_in_cmnd .EQ. 3) 
+     .           n3 = CX_DIM_LEN( idim, is_cx(3) )
+              IF (n2 .EQ. 2*n) THEN
+                 n2 = 2*n
+              ELSEIF (n2 .EQ. n+1) THEN
+                 n2 = n+1
+              ELSEIF (num_uvars_in_cmnd .EQ. 3) THEN
+                 IF (n2 .NE. n3) GOTO 5745
+                 IF (n2 .NE. n) GOTO 5745
+              ELSE
+                 GOTO 5740
+              ENDIF
+	   ENDIF
+
+* ... reset cx to read the coordinates first
+           cx = is_cx(1)
+	   mr = is_mr(1)
+	   CALL GET_CX_DIMS( cx, ndim, dim )
+	   idim = dim(1)
+	   n    = CX_DIM_LEN( idim, cx )
+
+* ... original start of free line memory
+	   frst_pt = next_line_mem_pos
+* ... allocate some storage for the coordinates
+	   IF (frst_pt+3*n .GT. maxlinestore) GOTO 5590
+
+* ... store coordinate positions (error status already checked)
+           IF (has_bounds) THEN
+              CALL NON_ARRAY_SUBSC( is_mr, 2 )
+           ELSE
+              CALL NON_ARRAY_SUBSC( mr, 1 )
+           ENDIF
+
+	   IF (its_edges) THEN
+* ... "/edges" definition - 4/99
+	      n = n - 1  ! edges array is one longer than points
+	      IF (n .LE. 0) GOTO 5520
+	      CALL EXTRACT_DP_LINE( cx, memory(1, mr_blk1(mr)),
+     .				 line_mem(frst_pt+n), idim, n+1 )
+	      npoints = n
+	      micro_adj = 1E-6 *
+     .		(line_mem(frst_pt+n+n) - line_mem(frst_pt+n))
+* ... are there repeated values?
+	      has_repeated = .FALSE.
+	      DO 515 i1 = frst_pt+1, frst_pt+n
+	         IF      (line_mem(i1+n-1) .GT. line_mem(i1+n)) THEN
+	           GOTO 5570
+	         ELSEIF  (line_mem(i1+n-1) .EQ. line_mem(i1+n)) THEN
+	           has_repeated = .TRUE.
+		 ENDIF
+ 515	      CONTINUE
+* ... make micro-adjustments if axis has repeated values (4/99)
+	      IF ( has_repeated ) THEN
+	         CALL WARN('Axis has repeated values -- micro-adjusting ...')
+	         IF (micro_adj .EQ. 0.D0) GOTO 5560
+		 i0 = frst_pt+n
+	         DO 526  i1 = frst_pt+n+1, frst_pt+n+n
+	             IF  (line_mem(i1-1) .EQ. line_mem(i1)) THEN
+*    ... locate end of repeating block
+	                DO 520 i2 = i1, frst_pt+n+n
+	                   IF (line_mem(i2) .GT. line_mem(i1)) GOTO 521
+ 520		        CONTINUE
+	                i2 =  frst_pt+n+n+1    ! one beyond last value
+                        i0 = i1 - 2
+		        i3 = i2 - 1
+*    ... micro-adjust repeating values and edges from i1 to i2-1
+ 521		        CONTINUE
+                        IF (line_mem(i2) .GT. line_mem(i1)) THEN
+                           i0 = i1-1
+                           i3 = i2
+                        ENDIF
+
+                        madj = micro_adj
+                        IF (micro_adj*(i2-i1+1) .GT. 
+     .	                     line_mem(i3) - line_mem(i0) ) THEN
+     	                   madj = (line_mem(i3) - line_mem(i0))/(i2-i1+1)
+			   IF (madj .EQ. 0.D0) GOTO 5560
+                        ENDIF
+  		        DO 522 i3 = i1, i2-1
+	                   line_mem(i3) = line_mem(i3) +
+     .	                     (i3-i1+1)* madj
+ 522		        CONTINUE
+	                IF ( i2 .LE. frst_pt+n+n
+     .		       .AND. (line_mem(i2-1) .GE. line_mem(i2))) GOTO 5560
+	             ENDIF
+ 526	          CONTINUE
+	      ENDIF
+* ... store points: midway between box boundaries ...
+	      has_repeated = .FALSE.
+	      DO 528 i1 = frst_pt+1, frst_pt+n
+	         line_mem(i1-1) = (line_mem(i1+n-1)+line_mem(i1+n)) * 0.5
+ 528	      CONTINUE
+	      its_reg = .TRUE.	! until proven otherwise
+	      start = line_mem(frst_pt+n)
+              delta = line_mem(frst_pt+n+1) - start
+              DO 530 i1 = frst_pt+n+2,frst_pt+n+n+1
+#ifdef double_p
+		 IF (.NOT.TM_FPEQ( (delta),
+     .               (line_mem(i1)-line_mem(i1-1))) )
+     .						its_reg = .FALSE.
+#else
+                 IF (.NOT.TM_FPEQ( SNGL(delta),
+     .               SNGL(line_mem(i1)-line_mem(i1-1))) )
+     .						its_reg = .FALSE.
+#endif
+ 530	      CONTINUE
+
+	   ELSE
+
+* NOT EDGES -- POINTS
+
+	      CALL EXTRACT_DP_LINE( cx, memory(1, mr_blk1(mr)),
+     .				 line_mem(frst_pt), idim, n )
+	      IF ( npoints .EQ. unspecified_int4 ) npoints = n
+* ... a single point is always "regular" (unless definition has BOUNDS!!)
+	      IF (n .EQ. 1 .AND. .NOT.has_bounds) THEN
+	         start = line_mem(frst_pt)
+	         delta = 1
+	         its_reg = .TRUE.
+	         GOTO 560
+	      ENDIF
+	      micro_adj = 1E-6 *
+     .		(line_mem(frst_pt+n-1) - line_mem(frst_pt))
+* ... are there repeated values?
+	      has_repeated = .FALSE.
+	      DO 532 i1 = frst_pt+1, frst_pt+npoints-1
+	         IF      (line_mem(i1-1) .GT. line_mem(i1)) THEN
+	            GOTO 5570
+	         ELSEIF  (line_mem(i1-1) .EQ. line_mem(i1)) THEN
+	            has_repeated = .TRUE.
+	         ENDIF
+ 532	      CONTINUE
+* ... make micro-adjustments if axis has repeated values (4/99)
+	      IF ( has_repeated ) THEN
+	         CALL WARN('Axis has repeated values -- micro-adjusting ...')
+	         IF (micro_adj .EQ. 0.D0) GOTO 5560
+
+		 i0 = frst_pt
+	         DO 538  i1 = frst_pt+1, frst_pt+npoints-1
+	            IF  (line_mem(i1-1) .EQ. line_mem(i1)) THEN
+*    ... locate end of repeating block
+	               DO 534 i2 = i1, frst_pt+npoints-1
+	                  IF (line_mem(i2) .GT. line_mem(i1)) GOTO 535
+ 534		       CONTINUE
+	               i2 = frst_pt+npoints    ! one beyond last value
+                       i0 = i1 - 2
+		       i3 = i2 - 1
+*    ... micro-adjust repeating values from i1 to i2-1
+ 535		       CONTINUE
+                       IF (line_mem(i2) .GT. line_mem(i1)) THEN
+		          i0 = i1-1
+		          i3 = i2
+		       ENDIF
+                       madj = micro_adj
+                       IF (micro_adj*(i2-i1+1) .GT. 
+     .	                     line_mem(i3) - line_mem(i0) ) THEN
+     	                  madj = (line_mem(i3)-line_mem(i0))/(i2-i1+1)
+                       IF (madj .EQ. 0.D0) GOTO 5560
+                       ENDIF
+  		       DO 536 i3 = i1, i2-1
+	                  line_mem(i3) = line_mem(i3) +
+     .	                    (i3-i1+1)* madj
+ 536		       CONTINUE
+	               IF ( i2 .LT. frst_pt+npoints .AND. 
+     .		       (line_mem(i2-1) .GE. line_mem(i2))) GOTO 5560
+	            ENDIF
+ 538	         CONTINUE
+	      ENDIF
+
+* Bounds specified by user
+
+              IF (has_bounds) THEN
+
+                 cx = is_cx(2)
+                 mr = is_mr(2)
+
+	         CALL EXTRACT_DP_LINE2( cx, memory(1, mr_blk1(mr)),
+     .	  	    line_mem(next_line_mem_pos + n), idim, n2 )
+
+* If given as coords, lo_bounds, hi_bounds, then
+* 1) check that lo_bounds{i+1} = hi_bounds{i}
+* 2) If ok, add the upper high bound to the list and treat 
+*    this as the case where we give the bounds as N+1 values
+
+                 IF (num_uvars_in_cmnd .EQ. 3) THEN
+                    cx = is_cx(3)
+                    mr = is_mr(3)
+                    CALL EXTRACT_DP_LINE2( cx, memory(1, mr_blk1(mr)),
+     .	 	       line_mem(next_line_mem_pos + n+n2), idim, n3 )
+                    DO i = 1, n3-1
+                       IF (line_mem(next_line_mem_pos + n+i) .NE.
+     .                      line_mem(next_line_mem_pos + 2*n+i-1) ) 
+     .                     GOTO 5750
+                    ENDDO
+                    line_mem(next_line_mem_pos + 2*n) = 
+     .                    line_mem(next_line_mem_pos + 3*n-1)
+                    n2 = n+1
+                 ENDIF
+
+* Check that bounds enclose points, and that they are contiguous
+	         line_subsc1 ( iline ) = frst_pt
+                 line_dim    ( iline ) = npoints
+                 IF (.NOT. TM_CHECK_BNDS (iline, n2, buff3) ) GO TO 5750
+
+              ELSE
+
+*... create bounds equidistant between grid points
+
+*    ... store initial box lower bound (start of axis)
+	         line_mem(frst_pt+npoints) = line_mem(frst_pt) -
+     .			0.5 * ( line_mem(frst_pt+1) - line_mem(frst_pt) )
+*    ... mid-axis box boundaries ...
+	         DO 539 i1 = frst_pt+1, frst_pt+npoints-1
+	            line_mem(i1+npoints) = (line_mem(i1-1)+line_mem(i1)) * 0.5
+ 539	         CONTINUE
+*    ... upper-most box bound (end of axis)
+	         i2 = frst_pt+npoints-1	! last box point
+	         line_mem(i2+npoints+1) = line_mem(i2) +
+     .			0.5 * ( line_mem(i2) - line_mem(i2-1) )
+	         its_reg = .TRUE.	! until proven otherwise
+	         start = line_mem(frst_pt)
+                 delta = line_mem(frst_pt+1) - start
+                 DO 550 i1 = frst_pt+2,frst_pt+npoints-1
+#ifdef double_p
+                    IF (.NOT.TM_FPEQ( (delta),
+     .                  (line_mem(i1)-line_mem(i1-1))) )
+     .                       its_reg = .FALSE.
+#else
+		    IF (.NOT.TM_FPEQ( SNGL(delta),
+     .                  SNGL(line_mem(i1)-line_mem(i1-1))) )
+     .                       its_reg = .FALSE.
+#endif
+ 550	         CONTINUE
+              ENDIF
+
+	   ENDIF
+
+* ... check to see if it was regularly spaced after all
+ 560	   IF ( its_reg ) THEN
+	      line_start    ( iline ) = start
+	      line_delta    ( iline ) = delta
+	      line_regular  ( iline ) = .TRUE.
+	      line_subsc1   ( iline ) = unspecified_int4
+	   ELSE	      
+* ... save irregular line data
+	      line_subsc1 ( iline ) = frst_pt
+	      line_start  ( iline ) = line_mem(frst_pt)
+	      line_delta  ( iline ) = unspecified_val8
+              line_dim    ( iline ) = npoints   ! need this here so TM_CHECK_BNDS works.
+	      line_regular( iline ) = .FALSE.
+
+	   ENDIF
+	ELSE
+
+* ... start,end,delta specification for a REGULAR axis.  
+* acm These are properties of the line, so reset according to the calendar.
+*     Need to do this only when it came in as a date string; these are flagged
+*     as negative in TRANSLATE_LIMIT
+
+	   start = cx_lo_ww(orient,mods_cx)
+	   end   = cx_hi_ww(orient,mods_cx)
+           prev_cal_id = cx_cal_id(mods_cx)
+           IF (prev_cal_id .EQ. unspecified_int4) prev_cal_id = 1
+
+	   IF ( orient_t  .AND.  cal_id .NE. prev_cal_id .AND.
+     .          start .LT. 0.  .AND.  start .NE. unspecified_val8.AND.
+     .          end   .LT. 0.  .AND.  end   .NE. unspecified_val8) THEN
+	      CALL RESET_SECS_FROM_BC (-start, new_ww, prev_cal_id, 
+     .                                 cal_id, status)
+	      start = -1. * new_ww
+
+	      CALL RESET_SECS_FROM_BC (-end, new_ww, prev_cal_id, 
+     .                                 cal_id, status)
+	      IF ( status .NE. ferr_ok ) RETURN
+
+	      end = -1. * new_ww
+              cx_cal_id(mods_cx) = cal_id
+	   ENDIF
+
+	   IF ( its_edges ) THEN
+	     IF ( npoints .EQ. unspecified_int4 ) THEN
+	       delta = cx_delta (orient,mods_cx)
+	       IF ( delta.EQ.unspecified_val8 .OR. delta.LE.0.D0) GOTO 5520
+	       IF ( .NOT.its_calendar ) THEN
+	          npoints = ( (end - start) / delta ) + 0.9999
+	       ENDIF
+	     ELSE
+	       delta = (end - start) / npoints
+	       IF (its_calendar) delta = -1 * delta/un_convert(iunit)
+	       IF ( delta .LE. 0.0D0 ) GOTO 5520
+	     ENDIF
+	     IF ( its_calendar ) THEN
+	       start = start - delta/2.0*un_convert(iunit)
+	       end   = end   + delta/2.0*un_convert(iunit)
+	     ELSE
+	       start = start + delta/2.0
+	       end   = end   - delta/2.0
+	     ENDIF
+	   ELSE
+	     IF ( npoints .EQ. unspecified_int4 ) THEN
+	       delta = cx_delta (orient,mods_cx)
+	       IF ( delta.EQ.unspecified_val8 .OR. delta.LE.0.D0) GOTO 5520
+	       IF ( .NOT.its_calendar ) THEN
+	          npoints = INT(( (end - start) / delta ) + 1.9999)
+                  small = MIN(1.e-9, delta)
+		  IF (start + delta* (npoints-1) - 0.5*delta .GT. end+small) 
+     .              npoints = npoints-1
+	       ENDIF
+	     ELSEIF ( npoints .EQ. 1 ) THEN
+	       IF ( end .NE. start ) GOTO 5530
+	       delta = 1.D0
+	     ELSE
+	       delta = (end - start) / (npoints-1)
+	       IF (its_calendar) delta = -1 * delta/un_convert(iunit)
+	       IF ( delta .LE. 0.0D0 ) GOTO 5520
+	     ENDIF
+	   ENDIF
+
+	   line_start    ( iline ) = start
+	   line_delta    ( iline ) = delta
+	   line_regular  ( iline ) = .TRUE.
+	   line_subsc1   ( iline ) = unspecified_int4
+	ENDIF
+
+* /T0 = date (or supply default)
+	iqual = qual_given( slash_T0 )
+        new_att_t0 = " "
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   CALL TM_BREAK_DATE( buff2, cal_id, i1,i2,i3,i4,i5,i6, 
+     .                         status )
+	   IF ( buff2 .EQ. ' ' .OR. status .NE. ferr_ok ) GOTO 5540
+           new_att_t0 = buff2
+	ELSE
+	   WRITE (buff2,3550) mon_names(1)
+ 3550      FORMAT ('15-', A3, '-1901')		! default
+	   IF (its_calendar ) THEN
+	      i1 = 20
+ 580	      bc_to_t0 = SECS_FROM_BC( buff2, cal_id, status )      
+	      IF ( status .NE. ferr_ok ) GOTO 5540
+	      IF ( bc_to_t0 + start .GT. 0 ) THEN	! start is before T0?
+	         IF ( i1 .LT. 0 ) GOTO 5540
+	         i1 = i1 - 1
+	         WRITE (buff2,3560) mon_names(1), i1
+ 3560	         FORMAT('01-',A3,'-',I2.2,'00')
+	         GOTO 580
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* Combine new attribute units and/or time origin to express
+* the units attribute as units since time-origin
+
+        IF (orient_t) THEN
+           IF (new_att_units .NE. ' ') THEN
+              i1 = TM_LENSTR1(new_att_units)
+              IF (new_att_t0 .NE. ' ') 
+     .            new_att_units = new_att_units(1:i1)//' since ' 
+     .            // new_att_t0
+           ENDIF
+        ENDIF
+
+* save the line in memory - but don't catalog its name
+	line_dim      ( iline ) = npoints
+	line_units    ( iline ) = buff1	   
+	line_t0       ( iline ) = buff2
+	line_cal_name ( iline ) = cal_name
+	line_unit_code( iline ) = iunit
+	line_direction( iline ) = 'NA'
+	IF ( orient_t ) line_tunit(iline) = un_convert( iunit )
+
+* is it a formattable axis ?
+	IF ( orient .EQ. x_dim ) THEN
+	   line_direction( iline ) = 'XX'
+           IF (iunit .EQ. pun_degrees) THEN
+	      line_direction( iline ) = 'WE'
+	      line_units( iline ) = 'degrees_east'
+	   ENDIF
+
+	ELSEIF ( orient .EQ. y_dim  ) THEN
+           line_direction( iline ) = 'YY'
+	   IF (iunit .EQ. pun_degrees) THEN
+	      line_direction( iline ) = 'SN'
+	      line_units( iline ) = 'degrees_north'
+	   ENDIF
+
+	ELSEIF ( orient .EQ. z_dim ) THEN
+           IF ( qual_given( slash_depth ) .GT. 0 ) THEN
+	      line_direction( iline ) = 'UD'    ! GEOG_LABEL requires "meters"
+           ELSE
+	      line_direction( iline ) = 'DU'
+           ENDIF
+
+	ELSEIF ( orient .EQ. e_dim ) THEN
+           line_direction( iline ) = 'EE'
+
+* TODO: let  F axes have time units
+	ELSEIF ( orient .EQ. f_dim ) THEN
+           line_direction( iline ) = 'FF'
+	   IF (.NOT.irreg  .AND. its_calendar ) THEN
+	      line_direction(iline) = 'FI'
+	      bc_to_t0 = SECS_FROM_BC( line_t0(iline), cal_id, status)
+	      line_dim  (iline) = (start-end) / (line_tunit(iline)*delta) + 1.9999
+	      line_start(iline) = (-line_start(iline)-bc_to_t0)/line_tunit(iline)
+	   ENDIF
+	   IF ( qual_given(slash_T0).GT.0 ) line_direction(iline) = 'FI'
+
+* ... time axis specified as date strings  (ELSEIF mod 11/93 *sh*)
+	ELSEIF (.NOT.irreg  .AND. its_calendar ) THEN
+	   line_direction(iline) = 'TI'
+	   bc_to_t0 = SECS_FROM_BC( line_t0(iline), cal_id, status)
+	   line_dim  (iline) = (start-end) / (line_tunit(iline)*delta) + 1.9999
+	   line_start(iline) = (-line_start(iline)-bc_to_t0)/line_tunit(iline)
+
+* ... time axis specified as time step values with T0 given
+	ELSEIF ( orient.EQ.t_dim .AND. qual_given(slash_T0).GT.0 ) THEN
+	   line_direction(iline) = 'TI'
+	ELSEIF ( orient.EQ.t_dim .AND. line_direction(iline) .EQ. 'NA') THEN
+	   line_direction(iline) = 'TT'
+	ENDIF
+
+* ... coordinate pointer for next line to save
+* Bounds are stored as edges, so increase by N coordinates and N+1 edges
+
+* acm move this to before purge_mr_axis, which also resets next_line_mem_pos
+*     after it deletes old_line.
+
+	IF (irreg .AND. .NOT.line_regular(iline))
+     .			next_line_mem_pos = frst_pt + 2*n+1
+
+* automatic longitude modulo
+	axwwlen = TM_WW_AXLEN(iline)
+	IF (line_direction(iline) .EQ. 'WE' ) THEN
+	  IF (axwwlen .LE. 360.D0 .AND. (npoints.GT.1)) THEN
+	     its_modulo = .TRUE.
+	     IF (rmod_len .EQ. 0.0D0)  rmod_len = 360.D0
+	     new_att_modulo = .TRUE.
+	     new_att_modulo_len = rmod_len
+
+	  ENDIF
+*  automatic calendar modulo
+	ELSEIF (line_direction(iline) .EQ. 'TI' .OR.
+     .          line_direction(iline) .EQ. 'FI' ) THEN
+	  secsperyear = DBLE(cals_yeardays(cal_id)) * (24.D0 * 60.D0 * 60.D0)
+	  bc_to_t0 = SECS_FROM_BC( line_t0(iline), cal_id, status)
+	  CALL TM_WW_AX_1_N(iline, start, end)
+	  secs2start = bc_to_t0 + start*line_tunit(iline)
+	  IF ( (secs2start .LE. secsperyear)
+     .	 .AND. (axwwlen*line_tunit(iline) .LE. secsperyear) ) THEN
+	     its_modulo = .TRUE.
+	     IF (rmod_len .EQ. 0.0D0)  rmod_len =
+     .				       secsperyear/line_tunit(iline)
+	     new_att_modulo = .TRUE.
+	     new_att_modulo_len = rmod_len
+	  ENDIF
+	ENDIF
+* set modulo and sanity check it
+	line_modulo( iline) = its_modulo
+	line_modulo_len( iline ) = rmod_len
+	IF (rmod_len .NE. 0.0D0) THEN
+	   IF (axwwlen .GT. rmod_len) THEN
+             IF (TM_DFPEQ(axwwlen, rmod_len)) THEN
+	       line_modulo_len( iline ) = 0.0D0
+             ELSE
+               GOTO 5525
+	     ENDIF
+           ENDIF
+	ENDIF
+
+* check for redefinitions
+	IF ( dup_name ) THEN
+	   IF ( TM_LINE_MATCH( old_line, iline ) ) THEN
+	      RETURN					! dup name/dup def
+	   ELSE
+* ... redefinition makes all past assumptions incorrect
+
+* Dont write message if DEF AX/QUIET
+            IF (qual_given( slash_def_ax_quiet ) .EQ. 0 )
+     .	      CALL SPLIT_LIST(pttmode_ops, err_lun,
+     .			replmsg//'axis '//line_name( old_line ), 0)
+
+* ... Check the attribute structure for this axis name and change 
+*     attribute values as needed.  
+
+	      CALL REDEFINE_AX_ATT (line_name(old_line), new_att_units, 
+     .           new_att_t0, new_att_calendar, new_att_modulo,
+     .           new_att_modulo_len, line_direction(iline), 
+     .           line_regular(iline) )
+
+	      CALL PURGE_MR_AXIS( old_line, iline, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      CALL TM_DEALLO_DYN_LINE( old_line )
+
+	   ENDIF
+
+        ELSE
+
+* add newly defined axis to the user-variable dset of the linked-list strucure
+           
+           dset_to_add = -2  ! user-defined coordinate variable dataset.
+
+           err_string = buff3
+           type = NCDOUBLE
+           coordvar = 1
+           varid = 0        ! Will be returned with variable ID
+           bad_flag = bad_val4   ! coord vars dont have missing, but set to something
+           CALL CD_ADD_COORD_VAR( dset_to_add, buff3, varid,  
+     .         line_units(iline), type, coordvar, bad_flag, status)
+           IF ( status .NE. ferr_ok ) GOTO 5600
+         
+* Get direction (also used to set axis direction, below). Set the
+* point_spacing attribute. If the axis is a time axis, by default this
+* is not written to the file as the axis may be the record axis.
+
+           dcode = line_direction(iline)
+           IF (dcode .EQ. 'XX' .OR. dcode .EQ. 'WE') dir = 1
+           IF (dcode .EQ. 'YY' .OR. dcode .EQ. 'SN') dir = 2
+           IF (dcode .EQ. 'ZZ' .OR. dcode .EQ. 'UD' .OR. dcode .EQ. 'DU') dir = 3
+           IF (dcode .EQ. 'TT' .OR. dcode .EQ. 'TI') dir = 4
+           IF (dcode .EQ. 'EE') dir = 5
+           IF (dcode .EQ. 'FF' .OR. dcode .EQ. 'FI') dir = 6
+
+           attname = 'point_spacing'
+           attype = NCCHAR
+           attoutflag = 1
+           IF ( line_regular(iline) ) THEN
+              attlen = 4
+              CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .        attype, attlen, attoutflag, 'even', dummy, status) 
+           ELSE
+              attlen = 6
+              CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .        attype, attlen, attoutflag, 'uneven', dummy, status) 
+           ENDIF
+
+* Axis attribute, with coordinate direction
+
+           attname = 'axis'
+           attype = NCCHAR
+           attoutflag = 1
+
+           dcode = line_direction(iline)
+           IF (dcode .EQ. 'XX' .OR. dcode .EQ. 'WE') axdir = 'X'
+           IF (dcode .EQ. 'YY' .OR. dcode .EQ. 'SN') axdir = 'Y'
+           IF (dcode .EQ. 'ZZ' .OR. dcode .EQ. 'UD' .OR. 
+     .                              dcode .EQ. 'DU') axdir = 'Z'
+           IF (dcode .EQ. 'TT' .OR. dcode .EQ. 'TI') axdir = 'T'
+           IF (dcode .EQ. 'EE') axdir = 'E'
+           IF (dcode .EQ. 'FF' .OR. dcode .EQ. 'FI') axdir = 'F'
+           attlen = 1
+           CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .           attype, attlen, attoutflag, axdir, dummy, status) 
+
+* Set the axis direction
+
+           dir = 0
+           IF (axdir .EQ. 'X') dir = 1
+           IF (axdir .EQ. 'Y') dir = 2
+           IF (axdir .EQ. 'Z') dir = 3
+           IF (axdir .EQ. 'T') dir = 4
+           IF (axdir .EQ. 'E') dir = 5
+           IF (axdir .EQ. 'F') dir = 6
+           CALL CD_SET_ATT_AXDIR (dset_to_add, varid, dir, status)
+
+* Bounds on irregular axis output by default.
+
+           IF (irreg) THEN
+              attname = 'bounds'
+              attype = NCCHAR
+              attoutflag = 1
+
+              attlen = TM_LENSTR1(buff3)
+              attlen = attlen + 5
+              buff2 = buff3(:slen)//'_bnds'
+              CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .           attype, attlen, attoutflag, buff2, dummy, status) 
+           ENDIF
+
+* Modulo attribute
+
+           IF ( line_modulo(iline) ) THEN
+              attname = 'modulo'
+              attype = NCDOUBLE
+              attoutflag = 1
+              attlen = 1
+              CALL CD_PUT_NEW_ATTR_DP (dset_to_add, varid, attname, 
+     .           attype, attlen, attoutflag, buff1, line_modulo_len(iline), status) 
+           ENDIF
+
+* Positive down. 
+
+           IF (line_direction(iline) .EQ. 'UD') THEN
+              attname = 'positive'
+              attype = NCCHAR
+              attoutflag = 1
+              attlen = 4
+              CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .           attype, attlen, attoutflag, 'down', dummy, status) 
+           ENDIF
+
+* Do not write positive=up. This is the default Ferret behavior
+           IF (line_direction(iline) .EQ. 'DU') THEN
+              attname = 'positive'
+              attype = NCCHAR
+              attoutflag = 0
+              attlen = 2
+              CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .           attype, attlen, attoutflag, 'up', dummy, status) 
+           ENDIF
+
+           IF (line_direction(iline)(1:1) .EQ. 'T' .OR.
+     .         line_direction(iline)(1:1) .EQ. 'F') THEN
+              IF (its_calendar) THEN
+                 attname = 'calendar'
+                 attype = NCCHAR
+                 attoutflag = 1
+                 attlen = TM_LENSTR1(cal_name)
+
+                 CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .             attype, attlen, attoutflag, cal_name, 
+     .             dummy, status) 
+
+                 attname = 'time_origin'
+                 attype = NCCHAR
+                 attoutflag = 1
+                 attlen = TM_LENSTR1(line_t0(iline))
+                 CALL CD_PUT_NEW_ATTR (dset_to_add, varid, attname, 
+     .               attype, attlen, attoutflag, line_t0(iline), 
+     .               dummy, status) 
+
+              ENDIF
+ 
+           ENDIF
+
+	ENDIF
+
+* now catalog it in memory by saving its name
+	line_name( iline ) = buff3
+	line_name_orig( iline ) = varname
+	RETURN
+
+**************************************************************************
+* DEFINE VIEWPORT
+ 600	IF ( num_args .NE. 1 ) GOTO 5300
+ 
+	r4_unspec = unspecified_val4
+* check out viewport name
+	buff1 = cmnd_buff( arg_start(1):arg_end(1) )
+	ivp = VIEWPORT_NUMBER( buff1 )
+	IF ( ivp .EQ. unspecified_int4 ) THEN
+* ... new name - find an unused slot
+	   DO 610 ivp = 1, max_viewport
+ 610	   IF ( vp_name(ivp) .EQ. unspecified_name4 ) GOTO 620
+	   GOTO 5610	! no free slots
+	ELSE
+* ... name in use - flag segments in this viewport as deleted
+	   IF ( ivp .EQ. mvp_dflt ) GOTO 5640
+	   CALL SPLIT_LIST(pttmode_ops, err_lun,
+     .			'Re-defining viewport '//vp_name(ivp), 0)
+	   DO 614 iseg = vp_seg0(ivp)+1 , vp_segn(ivp)
+ 614	   CALL FGD_GDSG( iseg ) 
+	   vp_seg0 ( ivp ) = 0
+	   vp_segn ( ivp ) = 0
+*          make sure the change is immediately seen
+           CALL FGD_GUWK(wsid, 1)
+	ENDIF
+
+* pre-set all values to defaults
+ 620	vp_size ( ivp ) = 1.0
+	vp_xorg ( ivp ) = 0.0
+	vp_yorg ( ivp ) = 0.0
+	vp_xclip( ivp ) = r4_unspec   ! old style  3/29/93
+	vp_yclip( ivp ) = r4_unspec   ! old style  3/29/93
+	vp_seg0 ( ivp ) = 0
+	vp_segn ( ivp ) = 0
+
+* /AXES
+* 10/01 *kob* - add ".GT. 0" in below logical check
+	vp_by_axis(ivp) = qual_given( slash_define_vp_by_ax ) .GT. 0
+
+***************** OLD CODE (retained for greater upwards compatibility)
+* /ORIGIN = x,y
+	qp = qual_given( slash_origin )
+	IF ( qp .GT. 0 ) THEN
+	   IF (vp_by_axis(ivp)) GOTO 5660
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( .NOT.TM_DIGIT(buff2) .OR. INDEX(buff2,',').EQ.0 ) GOTO 5630
+	   READ ( buff2, *, ERR=5630 ) vp_xorg(ivp), vp_yorg(ivp)
+	   vx = vp_xorg(ivp)
+	   vy = vp_yorg(ivp)
+	   IF ( OUTSIDE_0_1(vx) .OR. OUTSIDE_0_1(vy) )
+     .	      							   GOTO 5620
+	ENDIF
+
+* /SIZE=q
+	qp = qual_given( slash_size )
+	IF ( qp .GT. 0 ) THEN
+	   IF (vp_by_axis(ivp)) GOTO 5660
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   val_buf, status )
+	   vp_size(ivp) = val_buf
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( val_buf .LT. 0.0 ) GOTO 5620
+           vp_size(ivp) = -1. * vp_size(ivp)    ! flag for old-style viewports
+           CALL WARN (
+     .          'The /SIZE qualifier will force Ver. 2.2 behavior'
+     .	        //' for DEFINE VIEWPORT')
+	ENDIF
+
+* /CLIP = x,y
+	qp = qual_given( slash_clip )
+	IF ( qp .GT. 0 ) THEN
+	   IF (vp_by_axis(ivp)) GOTO 5660
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( .NOT.TM_DIGIT(buff2) .OR. INDEX(buff2,',').EQ.0 ) GOTO 5630
+	   READ ( buff2, *, ERR=5630 ) vp_xclip(ivp), vp_yclip(ivp)
+	   IF ( vp_xclip(ivp).LE.vp_xorg(ivp) .OR. vp_xclip(ivp).GT.1.0
+     .	   .OR. vp_yclip(ivp).LE.vp_yorg(ivp) .OR. vp_yclip(ivp).GT.1.0 )
+     .	      							   GOTO 5620
+	ENDIF
+
+***************** END OF OLD CODE (retained for greater upwards compatibility)
+
+* default clipping at 1,1 in new style viewports  (immaterial, I think ...)
+	IF ( qual_given(slash_size) .EQ. 0 ) THEN
+	   IF ( vp_xclip(ivp).EQ.r4_unspec) THEN
+	      vp_xclip(ivp) = 1.0
+	      vp_yclip(ivp) = 1.0
+	   ENDIF
+	ENDIF
+
+* /XLIMITS = xlow,xhigh 
+	qp = qual_given( slash_xlimits )
+	IF ( qp .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   i1 = TM_LENSTR1(buff2)
+	   pos = MAX( INDEX(buff2,','), INDEX(buff2,':') )
+	   IF ( pos.LE.1 .OR. pos.EQ.i1 ) GOTO 5630
+	   IF (.NOT.TM_DIGIT(buff2) )  GOTO 5630
+	   READ ( buff2(1:pos-1), *, ERR=5630 ) vp_xorg(ivp)
+	   IF (.NOT.TM_DIGIT(buff2(pos+1:i1))  ) GOTO 5630
+	   READ ( buff2(pos+1:i1), *, ERR=5630 ) vp_xclip(ivp)
+	   vx = vp_xorg(ivp)
+	   vy = vp_xclip(ivp)
+	   IF ( OUTSIDE_0_1(vx) .OR. OUTSIDE_0_1(vy)
+     .     .OR. vp_xorg(ivp) .GE. vp_xclip(ivp) )  GOTO 5620
+	ENDIF
+
+* /YLIMITS = ylow,yhigh 
+	qp = qual_given( slash_ylimits )
+	IF ( qp .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   pos = MAX( INDEX(buff2,','), INDEX(buff2,':') )
+	   i1 = TM_LENSTR1(buff2)
+	   IF ( pos.LE.1 .OR. pos.EQ.i1 ) GOTO 5630
+	   IF (.NOT.TM_DIGIT(buff2) )  GOTO 5630
+	   READ ( buff2(:pos-1), *, ERR=5630 ) vp_yorg(ivp)
+	   IF (.NOT.TM_DIGIT(buff2(pos+1:i1))  ) GOTO 5630
+	   READ ( buff2(pos+1:i1), *, ERR=5630 ) vp_yclip(ivp)
+	   vx = vp_yorg(ivp)
+	   vy = vp_yclip(ivp)
+	   IF ( OUTSIDE_0_1(vx) .OR. OUTSIDE_0_1(vy)
+     .     .OR. vp_yorg(ivp) .GE. vp_yclip(ivp) )  GOTO 5620
+	ENDIF
+
+* /TEXT=q 
+	qp = qual_given( slash_text )
+	IF ( qp .GT. 0 ) THEN
+	   IF ( qual_given(slash_size) .GT. 0 ) GOTO 5650
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .			   val_buf, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   vp_size(ivp) = val_buf
+	   IF ( val_buf .LT. 0.001 ) GOTO 5620
+	ELSEIF ( qual_given(slash_size) .EQ. 0 ) THEN     ! auto-sizing
+           vp_size(ivp) = SQRT( (vp_xclip(ivp)-vp_xorg(ivp))
+     .                        * (vp_yclip(ivp)-vp_yorg(ivp)) )
+	   IF (vp_by_axis(ivp)) THEN
+* ... vieport size is inferred from users axis limits and depends upon scale
+* ... iterate a few times to approximate the correct scale factor
+	      DO i1 = 1, 3
+	        scale = 1.0 / SQRT( ABS(vp_size(ivp)) )
+                xoei = wn_xwhitelo(wsid)  ! ppl xorigin
+                yoei = wn_ywhitelo(wsid)  ! ppl yorigin
+                xcei = wn_xwhitehi(wsid)  ! white space to right of X axis
+                ycei = wn_ywhitehi(wsid)  ! white space for docmtn at top of plot
+	        CALL VP_AXLIM2LIM( scale,
+     .				   vp_xorg(ivp),  vp_yorg(ivp),
+     .				   vp_xclip(ivp), vp_yclip(ivp),
+     .                             xlovp, ylovp,  xhivp, yhivp,
+     .                             xoei,  yoei,   xcei,  ycei )
+	        vp_size(ivp) = SQRT((xhivp-xlovp) * (yhivp-ylovp))
+	     ENDDO
+	   ENDIF
+	ENDIF
+
+* successfully defined viewport
+	vax_code = STR_UPCASE( vp_name(ivp), buff1 )
+
+* if re-defining the current viewport then it takes immediate effect
+	IF ( ivp .EQ. vp_num ) CALL SET_VIEWPORT( ivp )
+	RETURN
+
+**************************************************************************
+* DEFINE ALIAS
+ 700	IF ( num_args .LT. 1 ) GOTO 5300
+	CALL NAME_EQUAL_STRING( buff1, pos, status )
+	IF ( status .NE. ferr_ok )  GOTO 5000
+	IF ( pos .EQ. 0 ) GOTO 5400
+	IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5410
+
+* find a slot to save this alias
+        i1 = ALIAS_ID( buff1 )
+        IF ( i1 .EQ. unspecified_int4 ) THEN
+	   DO 710 i1 = num_predefined_alias+1, total_num_alias
+	      IF ( alias_name(i1) .EQ. unspecified_name4 ) GOTO 720
+ 710	   CONTINUE
+           GOTO 5710
+        ENDIF
+
+* save the alias
+ 720    vax_code = STR_UPCASE( alias_name(i1), buff1 ) 
+        alias(i1) = cmnd_buff(pos:arg_end(num_args))
+        alias_len(i1) = TM_LENSTR1( alias(i1) )
+	RETURN
+
+
+**************************************************************************
+* DEFINE SYMBOL
+ 800	IF ( num_args .LT. 1 ) GOTO 5300
+	CALL NAME_EQUAL_STRING( buff1, pos, status )
+	IF ( status .NE. ferr_ok )  GOTO 5000
+	IF ( pos .EQ. 0 ) GOTO 5400
+	IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5410
+
+* if this symbol already exists then delete it
+        buffsym = buff1
+	CALL GETSYM( buffsym, err_string, i2, i1 )
+	IF ( i1 .EQ. 0 ) CALL DELSYM(buffsym,i1)
+
+* remove backslash escape characters 
+! OLD COMMENT: exactly 255 for PPL; no longer the case as of Ferret v6.01
+	err_string = cmnd_buff(pos:arg_end(num_args))   
+	CALL DE_ESCAPE_STRING( err_string, slen )
+
+* define the symbol
+	CALL PUTSYM( buffsym, err_string, slen, i2)
+! ... no check on returned error code (could be "internal error")
+	RETURN
+
+**************************************************************************
+* DEFINE ATTRIBUTE /D= /TYPE= /OUTPUT /QUIET
+ 900	IF ( num_args .LT. 1 ) GOTO 5900
+	CALL NAME_EQUAL_STRING_VATT ( buff1, pos, status )
+	IF ( status .NE. ferr_ok )  GOTO 5000
+	IF ( pos .EQ. 0 ) GOTO 5400
+	IF ( INDEX(buff1,'..') .EQ. 1 ) THEN
+           ivar = 0  ! global attr.
+           varname = '.'
+	ELSE
+           IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5100
+        ENDIF
+
+* ... get dset number if present:  DEF ATT/D=dset ...
+	iqual = qual_given( slash_def_att_dset ) 
+        IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff2, status )  
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( buff2 .NE. ' ' ) THEN
+	      dset = FIND_DSET_NUMBER( buff2 )
+	      IF ( dset .EQ. unspecified_int4) THEN
+	         CALL WARN('Unknown data set: '
+     .		 //buff2(:TM_LENSTR1(buff2)))
+	         RETURN
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+*...DEF ATT/TYPE=string or float  get attribute type if present 
+*   (??? or other types on output?)
+	iqual = qual_given( slash_def_att_type) 
+        attype_spec = ptype_unknown
+        IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff2, status )  
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( STR_SAME (buff2, 'string') .EQ. 0) THEN
+	      attype_spec = ptype_string
+           ELSE IF (STR_SAME (buff2, 'float') .EQ. 0) THEN
+              attype_spec = ptype_float
+           ELSE 
+              GO TO 5940
+	   ENDIF
+	ENDIF
+
+* ... DEFINE ATT/OUTPUT varname.attname.  By default output flag is set to 1
+      attoutflag = 1
+      iqual = qual_given( slash_def_att_output ) 
+      IF ( iqual .GT. 0 ) attoutflag = 1 
+
+* ... DEFINE ATT/QUIET varname.attname
+      attoutflag = 1
+      def_att_quiet = qual_given( slash_def_att_quiet ) .GT. 0
+
+* get the requested data somehow
+
+        IF (arg_start(1) .LT. pos) arg_start(1) = pos
+	CALL GET_PROT_CMND_DATA ( memory, cx_last, ptype_native, status )
+        mr = is_mr(1)
+
+        IF ( status .NE. ferr_ok ) THEN      ! 8/6/92
+           list_fmt_type = plist_default ! restore for next command
+	   list_format_given = .FALSE.
+           RETURN
+        ENDIF
+
+!! ?? get dataset from varname.attname
+* ... evaluate the context without computing the expression to get the dataset
+
+        buff = cmnd_buff(item_start(1):item_end(1)) ! same as buff1?
+
+	CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+        IF (buff(1:1) .EQ. '(') THEN
+           dset = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+           CALL ISIT_COORD_VAR ( buff, dset, varname, coordvar, status )
+           IF ( status .NE. ferr_ok ) THEN 
+              dset = -2  ! a user-defined axis (coordinate variable)
+              CALL ISIT_COORD_VAR ( buff, dset, varname, 
+     .              coordvar, status )
+              IF ( status .NE. ferr_ok ) THEN
+                 dset = cx_data_set(cx_cmnd)
+                 GOTO 5920
+              ENDIF
+           ENDIF
+        ELSE
+
+* Get the dataset if given as [d=]
+            IF (iqual .EQ. 0) iqual = 1
+	    IF ( INDEX(buff,'[') .GT. 0 ) THEN
+               dset = pdset_irrelevant	! default (not used ...)
+               CALL PARSE_NAM_DSET(buff,
+     .			 cx_last, dset, cat, var, mods_cx, status)
+            ELSE
+              cx = is_cx( 1 )
+              IF (cx .EQ. 0 .OR. cx .EQ. unspecified_int4)
+     .             cx = cx_cmnd
+             dset = cx_data_set(cx)
+          ENDIF
+	ENDIF
+
+* See if the variable is a user-defined variable.
+        IF (dset .EQ. pdset_irrelevant .OR. 
+     .     dset .EQ. unspecified_int4) THEN
+
+           varname = buff1(1:INDEX(buff1,".")-1)
+           CALL FIND_VAR_NAME(pdset_irrelevant, varname, cat, var)
+           IF (  var .NE. munknown_var_name .AND.
+     .           cat .EQ. cat_user_var) THEN
+              dset = -1
+           ELSE
+              dset = cx_data_set(cx_cmnd) 
+           ENDIF
+        ENDIF
+
+*  break up varname.attname.  
+
+        CALL BREAK_VARNAME( buff1, dset, varname, attname, 
+     .                               varid, status )
+        IF (status .NE. ferr_ok) goto 5920
+
+        CALL ADD_ATTRIBUTE(  memory(1, mr_blk1(mr)), mr, 
+     .         buff1, dset, attype_spec, attoutflag, new_att, status )
+
+* Change attribute value
+        IF (.NOT. new_att) THEN
+           CALL EDIT_ATTRIBUTE(  memory(1, mr_blk1(mr)), mr, 
+     .               buff1, dset, attype_spec, def_att_quiet, status )
+        ENDIF
+
+
+* If the time origin was changed or added, also change units to say
+* "units since time origin" using the new time origin info.
+        
+        iline = TM_GET_LINENUM( varname )
+
+        IF (iline .NE. unspecified_int4) THEN
+           slen = TM_LENSTR1(attname)
+           IF (MATCH_NAME (attname,  slen, 'TIME_ORIGIN', 11)  .AND.
+     .            ( line_direction(iline)(1:1) .EQ. 'T' .OR.
+     .              line_direction(iline)(1:1) .EQ. 'F' ) ) THEN
+              CALL CD_GET_VAR_ATT_ID (dset, varid, 'UNITS', attid, status)
+              IF (status .NE. ferr_ok) GOTO 5960
+              got_it = NC_GET_ATTRIB ( dset, varid, 'units',
+     .                                 .TRUE., varname, 128,
+     .                                 attlen, attoutflag, ustring, 
+     .                                 val_buf )
+              got_it = NC_GET_ATTRIB ( dset, varid, 'time_origin',
+     .                                 .TRUE., varname, 128,
+     .                                 attlen, attoutflag, t0string, 
+     .                                 val_buf )
+              vax_code = STR_UPCASE (buff2, ustring)
+              slen = INDEX(buff2, 'SINCE')
+              IF (slen .GT. 0) THEN
+                 slen = slen - 2
+              ELSE
+                 slen = TM_LENSTR1(ustring)
+              ENDIF
+              buff3 = ustring(1:slen) // ' since ' // t0string
+              attlen = TM_LENSTR1(buff3)
+   
+              ustring = 'units'
+              CALL CD_REPLACE_ATTR (dset, varid, ustring, NCCHAR, 
+     .            attlen, buff3, val_buf, status)
+           ENDIF
+
+* If the units were changed on a time axis, add "since time origin"
+           
+           slen = TM_LENSTR1(attname)
+           IF (MATCH_NAME (attname,  slen, 'UNITS', 5)  .AND.
+     .        ( line_direction(iline)(1:1) .EQ. 'T' .OR.
+     .          line_direction(iline)(1:1) .EQ. 'F' ) ) THEN
+              CALL CD_GET_VAR_ATT_ID (dset, varid, 'TIME_ORIGIN', 
+     .                 attid, status)
+              IF (status .EQ. ferr_ok) THEN 
+                 got_it = NC_GET_ATTRIB ( dset, varid, 'time_origin',
+     .                                   .TRUE., varname, 128,
+     .                                   attlen, attoutflag, t0string, 
+     .                                   val_buf )
+                 got_it = NC_GET_ATTRIB ( dset, varid, 'units',
+     .                                   .TRUE., varname, 128,
+     .                                   attlen, attoutflag, ustring, 
+     .                                   val_buf )
+   
+                 vax_code =  STR_UPCASE (buff2, ustring)
+                 slen = INDEX(buff2, 'SINCE')
+                 IF (slen .GT. 0) THEN
+                    slen = slen - 2
+                 ELSE
+                    slen = TM_LENSTR1(ustring)
+                 ENDIF
+                 buff3 = ustring(1:attlen) // ' since ' // t0string
+                 attlen = TM_LENSTR1(buff3)
+   
+                 CALL CD_REPLACE_ATTR (dset, varid, attname, NCCHAR, 
+     .               attlen, buff3, val_buf, status)
+           ENDIF
+        ENDIF
+        ENDIF ! (axis .NE. unspecified_int4)
+
+* Update attribute information used by plotting etc (ds_units, ...)
+            CALL FIND_VAR_NAME (dset, varname, cat, uvar)
+            IF ( (cat .EQ. cat_user_var) .OR.
+     .           (cat .EQ. cat_file_var) .OR.
+     .           (cat .EQ. cat_pystat_var) )
+     .           CALL UPDATE_ATTRIBUTES (dset, uvar)
+
+
+	RETURN
+
+**************************************************************************
+* DEFINE PYFUNC /NAME=<alias> python.module.name
+
+ 1000   IF ( num_args .LT. 1 ) GOTO 6000
+        IF ( num_args .GT. 1 ) GOTO 6010
+
+        iqual = qual_given(slash_pyfunc_name)
+        IF ( iqual .GT. 0 ) THEN
+*           get the function name from /name=<alias>
+            CALL EQUAL_STRING(cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .                        buff1, status)
+            IF ( status .NE. ferr_ok ) GOTO 5000
+            IF ( .NOT. TM_LEGAL_NAME(buff1) ) GOTO 6020
+        ELSE
+*           create the function name from the last component of python.module.name
+            i1 = 0
+ 1010       i2 = INDEX(cmnd_buff(arg_start(1)+i1:arg_end(1)), '.')
+            IF ( i2 .GT. 0 ) THEN
+               i1 = i1 + i2
+               GOTO 1010
+            ENDIF
+            vax_code = STR_UPCASE(buff1, 
+     .                       cmnd_buff(arg_start(1)+i1:arg_end(1)))
+        ENDIF
+
+*       Make sure the scan for standard external functions has been performed
+        IF ( EFCN_SCAN(gfcn_num_internal) .LT. 0 ) GOTO 6040
+
+        i1 = TM_LENSTR1(buff1)
+        buff = cmnd_buff(arg_start(1):arg_end(1))
+        i2 = arg_end(1) - arg_start(1) + 1
+        CALL CREATE_PYEFCN(buff1, i1, buff, i2, err_string, slen)
+        IF ( SLEN .GT. 0 ) GOTO 6030
+
+        RETURN
+
+	
+**************************************************************************
+* DEFINE DATA /AGGREGATE /TITLE= /QUIET
+* find name to define
+* DEFINE DATA/AGGREGATE/TITLE ENSNAME=D1,D2,D3
+* where D1,D2 can be already-open Ferret dataset numbers, or dataset specs
+* that would allow Ferret to open the datset.
+
+1100	IF ( num_args .LT. 1 ) GOTO 5300
+
+
+* define data valid only with /AGGREGATE
+	iqual = qual_given( slash_def_aggregate )
+        IF ( iqual .EQ. 0 ) GOTO 6100
+
+* Did they say /QUIET
+
+	iqual = qual_given( slash_def_agg_quiet )
+        agg_quiet = ( iqual .GT. 0 )
+
+* Is there a /TITLE ?
+	iqual = qual_given( slash_def_agg_title )
+	buff2 = char_init
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      buff2, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+* Is there a /E ? (later other directions)
+* This is NOT YET passed around to routines that need it.
+        agg_e = qual_given( slash_def_agg_e ) .GT. 0
+	IF (agg_e) agg_dim = 5
+
+* define data/hide
+
+	agg_hide = qual_given( slash_def_agg_hide ) .GT. 0
+
+* Get the name of the dataset we are creating
+	CALL NAME_EQUAL_STRING( buff1, pos, status )
+
+	IF ( status .NE. ferr_ok )  GOTO 5000
+	IF ( pos .EQ. 0 ) GOTO 5400
+	IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5410
+	IF ( .NOT.TM_LEGAL_NAME_OP(buff1) ) GOTO 5430
+        IF ( TM_LENSTR1(buff1) .GT. 128 ) GOTO 5410
+
+	CALL INIT_AGGREGATE_DSET (buff1, buff2, dset, agg_quiet, agg_hide, status)
+
+	IF (status .NE. ferr_ok) GOTO 6110
+
+* Make this the current dataset
+	cx_data_set( cx_last ) =  dset
+
+	RETURN
+**************************************************************************
+
+* error exit
+ 5000	RETURN
+ 5100 	CALL ERRMSG( ferr_syntax,status,'illegal name: '//buff3,*5000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status,
+     .		'DEFINE what name?', *5000 )
+ 5305	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5000 )
+ 5310	CALL ERRMSG( ferr_grid_definition, status,
+     .		'name already in use:'//buff3(:TM_LENSTR1(buff3)), *5000 )
+ 5320	CALL ERRMSG( ferr_grid_definition, status,
+     .		'unknown grid or axis:'//buff1(:TM_LENSTR1(buff1)), *5000 )
+ 5330	CALL ERRMSG( ferr_grid_definition, status,
+     .		'inappropriate orientation for '//ww_dim_name(idim)//
+     .		' axis:'//buff1(:TM_LENSTR1(buff1)), *5000 )
+ 5400 	CALL ERRMSG( ferr_syntax, status,
+     .			buff1(:TM_LENSTR1(buff1))//' = ???', *5000 )
+ 5410   CALL ERRMSG( ferr_syntax,status,'illegal name: '//buff1,*5000 )
+ 5420   CALL ERRMSG( ferr_syntax,status,'cannot define: '//buff1,*5000 )
+ 5430   CALL ERRMSG( ferr_syntax,status,'illegal name, matches an operator: '
+     .			//buff1,*5000 )
+ 5440	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff(pos:len_cmnd)//pCR//err_string, *5000 )
+ 5470	CALL ERRMSG( ferr_unknown_data_set, status,
+     .			buff3(:TM_LENSTR1(buff3)), *5000 )
+ 5480   CALL ERRMSG( ferr_syntax,status,
+     .	  '/REMOTE variable definition must also specify /D=',*5000 )
+ 5490   CALL ERRMSG( ferr_syntax,status,
+     .	  '/REMOTE variable expression may not contain [d= ',*5000 )
+ 5505	CALL ERRMSG( ferr_invalid_command, status,
+     .		'DEFINE AXIS/DEPTH needs /Z=lo:hi:del', *5000 )
+ 5510	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Conflicting /X,/Y,/Z or /T axis orientations given',
+     .								*5000 )
+ 5520	CALL ERRMSG( ferr_grid_definition, status,
+     .			'error in start,end,delta', *5000 )
+ 5525	CALL ERRMSG( ferr_grid_definition, status,
+     .			'Axis length exceeds modulo length', *5000 )
+ 5530	CALL ERRMSG( ferr_grid_definition, status,
+     .			'NPOINTS=1 incompatible with limits given', *5000 )
+ 5540	CALL ERRMSG( ferr_grid_definition, status,
+     .		'/T0='//buff2(:TM_LENSTR1(buff2)), *5000 )
+ 5550	CALL ERRMSG( ferr_grid_definition, status,
+     .		'inappropriate units:'//buff1(:TM_LENSTR1(buff1)), *5000 )
+ 5560	CALL ERRMSG( ferr_grid_definition, status,
+     .		'unrepairable repeated axis coords', *5000 )
+ 5570	buff1 = TM_FMT(FLOAT(i1-frst_pt+1), 14, 16, slen)
+	CALL ERRMSG( ferr_grid_definition, status,
+     .		'data for DEFINE AXIS/FROM_VARIABLE is not monotonic at index '
+     .		//buff1(:slen), *5000 )
+ 5580	CALL ERRMSG( ferr_grid_definition, status,
+     .		'data for DEFINE AXIS/FROM_VARIABLE is ambiguous', *5000 )
+ 5582	CALL ERRMSG( ferr_grid_definition, status,
+     .		'illegal argument for DEFINE AXIS/NPOINTS', *5000 )
+ 5590	CALL ERRMSG( ferr_prog_limit, status,
+     .		'axis coordinate storage exhausted - restart FERRET', *5000 )
+ 5600   slen = TM_LENSTR1(buff3)
+        CALL ERRMSG( ferr_syntax, status,
+     .               'error initializing '//buff3(:slen), *5000 )
+ 5610	CALL ERRMSG( ferr_prog_limit, status,
+     .		'redefine or cancel an existing viewport', *5000 )
+ 5620 	CALL ERRMSG( ferr_out_of_range, status,
+     .			cmnd_buff(qual_start(qp):qual_end(qp)), *5000 )
+ 5630 	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff(qual_start(qp):qual_end(qp)), *5000 )
+ 5640 	CALL ERRMSG( ferr_invalid_command, status,
+     .			'cannot re-define FULL viewport', *5000 )
+ 5650 	CALL ERRMSG( ferr_syntax, status,
+     .	'DEFINE VIEWPORT/SIZE and /TEXT are mutually exclusive', *5000 )
+
+ 5660 	CALL ERRMSG( ferr_syntax, status,
+     .	'DEFINE VIEWPORT/AXES cannot be used with obsolete /ORIGIN'
+     .  //', /CLIP/ or /SIZE', *5000 )
+
+ 5710	CALL ERRMSG( ferr_prog_limit, status,
+     .		'use CANCEL ALIAS to reclaim space', *5000 )
+ 5720	err_string = 'Invalid calendar name. Names are'
+        DO 5721 i1=1, max_calendars
+           len_cal = TM_LENSTR1(err_string)
+           slen = TM_LENSTR1(allowed_calendars(i1))
+           err_string = err_string(:len_cal)//', '//
+     .                   allowed_calendars(i1)(:slen)
+           len_cal = len_cal + slen
+ 5721   CONTINUE
+        CALL ERRMSG( ferr_syntax, status,err_string, *5000 )
+
+5730	CALL ERRMSG( ferr_syntax,status,
+     .     'cannot have /BOUNDS and /EDGES together ',*5000 )
+
+5740	buff1 = TM_FMT(FLOAT( n), 14, 16, slen)
+        buff2 = TM_FMT(FLOAT(n2), 14, 16, s2len)
+        CALL ERRMSG( ferr_grid_definition, status,
+     .     'dimension of bounds ('// buff2(:s2len)//
+     .     ') must be 2*N or N+1, N=number of axis coordinates ('//
+     .     buff1(:slen) //')', *5000 )
+5745	buff1 = TM_FMT(FLOAT( n), 14, 16, slen)
+        buff2 = TM_FMT(FLOAT(n2), 14, 16, s2len)
+        CALL ERRMSG( ferr_grid_definition, status,
+     .     'dimension of upper&lower bounds ('// buff2(:s2len)//
+     .     ') must be N, N=number of axis coordinates ('//
+     .     buff1(:slen) //')', *5000 )
+
+5750	CALL ERRMSG( ferr_grid_definition, status,
+     .   'BOUNDS specified do not correctly enclose coordinate points', 
+     .   *5000 )
+
+5900	CALL ERRMSG( ferr_invalid_command, status,
+     .		'DEFINE what name.attribute?', *5000 )
+5920    slen = TM_LENSTR1(varname)
+
+        IF (dset .GT. 0) THEN
+           CALL ERRMSG( ferr_invalid_command, status,
+     .		'variable or axis undefined or not in dataset '//
+     .            varname(:slen), *5000 )
+        ELSE
+           CALL ERRMSG( ferr_invalid_command, status,
+     .		'variable or axis does not exist '//
+     .           varname(:slen), *5000 )
+        ENDIF
+           
+5930    buff1 = 'string'
+        IF (at_type(1) .EQ.ptype_float) buff1 = 'float'
+        slen = 6
+        buff2 = 'string'
+        if (attype_spec .EQ. ptype_float) buff2 = 'float'
+        CALL ERRMSG( ferr_invalid_command, status,
+     .		'TYPE specified does not match type of values'//
+     .           cmnd_buff(pos:len_cmnd)//' is '// buff1(:slen)//
+     .           'TYPE given is '// buff2(:slen), *5000 )
+
+5940  slen = TM_LENSTR1(buff2)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .	buff2(:slen)//' not allowed as argument of DEF ATT/TYPE='//pCR//
+     .  'Must be STRING or FLOAT ',*5000 )
+
+5960  slen = TM_LENSTR1(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'cannot set T0 unless Units are also set'//
+     .    buff1(:slen), *5000 )
+
+ 6000 CALL ERRMSG(ferr_invalid_command, status,
+     .  'No Python module named in DEFINE PYFUNC command', *5000)
+
+ 6010 CALL ERRMSG(ferr_invalid_command, status,
+     .  'More than one Python module named in DEFINE PYFUNC command',
+     .   *5000)
+
+ 6020 CALL ERRMSG(ferr_syntax, status, 'illegal name: '//buff1, *5000)
+
+ 6030 CALL ERRMSG(ferr_invalid_command,status,err_string(1:slen),*5000)
+
+ 6040 CALL ERRMSG(ferr_invalid_command,status,'EFCN_SCAN failed',*5000)
+
+ 6100 CALL ERRMSG(ferr_syntax, status, 
+     .    'DEFINE DATA valid only with /AGGREGATE: ', *5000)
+
+ 6110 CALL ERRMSG(ferr_aggregate_error, status, 
+     .    'Aggregate dataset not defined', *5000)
+
+	END
diff --git a/fer/xeq/xeq_elif.F b/fer/xeq/xeq_elif.F
new file mode 100644
index 0000000..9b75250
--- /dev/null
+++ b/fer/xeq/xeq_elif.F
@@ -0,0 +1,111 @@
+	SUBROUTINE XEQ_ELIF
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Process the intermediate logic of an ELIF ("ELSEIF") statement in a
+* multi-line IF compound statement
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420:  4/96
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+	include 'xprog_state.cmn'
+
+* local variable declarations
+	LOGICAL TRUE_OR_FALSE, condition
+	INTEGER	STR_CASE_BLIND_COMPARE,
+     .		vax_code, status
+
+* initial sanity checks
+	IF ( .NOT.if_conditional ) GOTO 5010
+
+* is this the end of the clause that has been executing?
+	IF ( if_doing(ifstk) .EQ. pif_doing_clause ) THEN
+	   if_doing(ifstk) = pif_skip_to_endif
+	   RETURN
+	ENDIF
+
+* more sanity checks
+* (not the best error message ... but this is an internal never-happen error
+* since pif_skip_to_endif is supposed to be trapped outside of this)
+	IF ( if_doing(ifstk) .NE. pif_skip_to_clause ) GOTO 5010
+
+* check that something was given to "if" on
+	IF ( num_args .LT. 2 ) GOTO 5100
+
+* optional "THEN" at end of line is OK
+	IF ( num_args .GT. 1 ) THEN
+	   IF ( num_args .GT. 2 ) GOTO 5300
+	   vax_code = STR_CASE_BLIND_COMPARE(
+     .				cmnd_buff(arg_start(2):arg_end(2)),
+     .				'THEN' )
+	   IF (vax_code .NE. vms_str_success) GOTO 5300
+	ENDIF
+
+* determine if the condition is true or false
+	condition = TRUE_OR_FALSE(cmnd_buff(arg_start(1):arg_end(1)),
+     .				  status)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* say which IF clause to execute
+	IF ( condition ) THEN
+	   if_doing(ifstk) = pif_doing_clause	! ELIF TRUE THEN (do it)
+	ELSE
+	   if_doing(ifstk) = pif_skip_to_clause	! ELIF FALSE THE (keep looking)
+	ENDIF
+
+	RETURN
+	
+* error exit
+* ... control stack pointer, CSP, corrected in GFD_ERROR_HANDLER
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .		'ELIF can only be used between IF and ENDIF', *5000)
+ 5100	CALL ERRMSG( ferr_syntax, status, 'ELIF what ?', *5000)
+ 5300	CALL ERRMSG( ferr_syntax, status,
+     .		'Entire ELIF statement should be "ELIF expr THEN"'//
+     .			pCR//cmnd_buff(:len_cmnd), *5000 )
+	END
diff --git a/fer/xeq/xeq_else.F b/fer/xeq/xeq_else.F
new file mode 100644
index 0000000..b26d33f
--- /dev/null
+++ b/fer/xeq/xeq_else.F
@@ -0,0 +1,84 @@
+	SUBROUTINE XEQ_ELSE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Process the ELSE in a multi-line IF compound statement
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420:  4/96
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+
+* local variable declarations
+	INTEGER	status
+
+* initial sanity checks
+	IF ( .NOT.if_conditional ) GOTO 5010
+
+* check that something was given to "if" on
+	IF ( num_args .GE. 1 ) GOTO 5100
+
+* is this the end of the clause that has been executing?
+	IF ( if_doing(ifstk) .EQ. pif_doing_clause ) THEN
+	   if_doing(ifstk) = pif_skip_to_endif
+
+* or the start of the clause to execute
+	ELSEIF ( if_doing(ifstk) .EQ. pif_skip_to_clause ) THEN
+	   if_doing(ifstk) = pif_doing_clause
+
+* anything else is an internal error
+	ELSE
+	   GOTO 5200
+	ENDIF
+
+	RETURN
+	
+* error exit
+* ... control stack pointer, CSP, corrected in GFD_ERROR_HANDLER
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_invalid_command, status,
+     .		'ELSE can only be used between IF and ENDIF', *5000)
+ 5100	CALL ERRMSG( ferr_syntax, status,
+     .		'ELSE statement stands alone. Continue on next line"'//
+     .			pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5200	CALL ERRMSG( ferr_internal, status, 'IF-ELSE', *5000)
+	END
diff --git a/fer/xeq/xeq_endif.F b/fer/xeq/xeq_endif.F
new file mode 100644
index 0000000..5f80659
--- /dev/null
+++ b/fer/xeq/xeq_endif.F
@@ -0,0 +1,84 @@
+	SUBROUTINE XEQ_ENDIF
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Process the ENDIF statement in a multi-line IF compound statement
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420:  4/96
+* V6.31 10/09 *acm*  Fixing bug 1706, by properly fixing # 1681. ENDIF inside a REPEAT 
+*              loop with semicolon-separated commands. 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+	include 'xprog_state.cmn'
+
+* local variable declarations
+	INTEGER	status
+
+* initial sanity checks
+	IF ( .NOT.if_conditional ) GOTO 5100
+
+* check that something was given to "if" on
+	IF ( num_args .GT. 0 ) GOTO 5300
+
+* pop the IF stack
+	IF (ifstk .LT. 1 ) GOTO 5400
+	ifstk = ifstk - 1
+	IF ( ifstk .EQ. 0 ) bumped = .FALSE.  ! see process_if
+	IF ( ifstk .EQ. 0 ) if_conditional = .FALSE.
+
+	RETURN
+	
+* error exit
+* ... control stack pointer, CSP, corrected in GFD_ERROR_HANDLER
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		'ENDIF can only be used in an IF clause', *5000)
+ 5300	CALL ERRMSG( ferr_syntax, status,
+     .		'Trash on ENDIF statement"'//
+     .			pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5400	CALL ERRMSG( ferr_internal, status, 'ENDIF ifstk??', *5000)
+	END
+
diff --git a/fer/xeq/xeq_exit.F b/fer/xeq/xeq_exit.F
new file mode 100644
index 0000000..d07b15b
--- /dev/null
+++ b/fer/xeq/xeq_exit.F
@@ -0,0 +1,183 @@
+	SUBROUTINE XEQ_EXIT( * , * )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the EXIT command
+* if program is not under interactive control the /COMMAND_FILE qualifier is
+* required
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+* revision 1.0 - 4/30/87 - EXIT in middle of command file will work
+* revision 1.1 - 4/23/87 - flag arguments given as errors
+* V312: 5/94 - use abnormal return for final program exit
+* V314: 8/24/94 *kob* IBM port: slash_command_file should be declared as 
+*				logical
+* V510: *sh* 12/99 - close TMAP data sets when exiting
+* V533: *kob* 8/01 - add checks for new EXIT qualifiers:
+*	                 exit/loop
+*			 exit/script
+*                        exit/prompt
+*			 exit/program
+*                     With these new qualifiers, the routine has been
+*                     reworked as well.
+* V540: *sh* 11/01 - bug fix to logic in V5.33 change:
+*	  "quit" in a command file was ignored
+* V542: *kob* 11/02 - bug fix - check to make sure an exit w/ no qualifiers
+*                               wasn't being called from a command file before
+*                               completely exiting out of Ferret
+* V581: *acm*  5/05 - fix bug 1233: exit/script needs to check whether there is
+*                     an IF or REPEAT in the command stack
+* V581: *acm*  5/05 - add EXIT/CYCLE to skip remaining commands in current 
+*                     repetition of the loop
+* V602: *acm*  3/07 - Fix bug 1304. If a script is executed with a loop, and
+*                     exit/script is called, then exit just out of the script,
+*                     not all the way back up out of the loop.
+* V6.11 *acm*  4/08 - Fis bug 1566; EXIT/SCRIPT and IF blocks.
+* V664  *kms*  8/10 - Add EXIT/TOPYTHON and second alternate return to exit the 
+*                     ferret_dispatch loop but just re-enter the loop if not under pyferret
+* V685+ 12/13    - *acm*  bounds checking; dont refer to cs_cmnd_num(csp) if csp = 0
+
+        include 'tmap_dims.parm'
+	include 'command.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xcontrol.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+
+	INTEGER status
+	INTEGER i, pop, ifloop
+	LOGICAL GO_FILE_INPUT
+
+* make sure no arguments were given
+	IF ( num_args .GT. 0 ) CALL ERRMSG( ferr_invalid_subcmnd, 
+     .			status, cmnd_buff(arg_start(1):len_cmnd), *5000 )
+
+	IF (qual_given(slash_exit_cycle) .GT. 0) THEN
+* Skip to end of current repeat loop
+	   pop=0
+	   DO 100 i = csp,1,-1
+	      IF ( cs_cmnd_num(i) .EQ. cmnd_repeat) GOTO 400
+	      pop = pop + 1 
+ 100	   CONTINUE
+	   RETURN        ! not in repeat loop, no need to move down stack
+
+	ELSE IF (qual_given(slash_exit_loop) .GT. 0) THEN
+* Exit from current repeat loop
+	   pop=1
+	   DO 200 i = csp,1,-1
+	      IF ( cs_cmnd_num(i) .EQ. cmnd_repeat) GOTO 400
+	      pop = pop + 1 
+ 200	   CONTINUE
+	   RETURN        ! not in repeat loop, no need to move down stack
+	ELSE IF (qual_given(slash_exit_script) .GT. 0) THEN
+
+* Exit from current script.  Need to do check to make sure this
+* wasn't executed from waiting Ferret prompt, ie not in a script
+* Fix bug 1304 here; count pop up to the *GO current script*
+* Fix bug 1566 here; multi-linen IFs are not listed in cs_cmnd_num()
+* instead we need to check if_cs
+
+	   IF (csp .GT. 0) THEN
+              pop = 1
+              DO 300 i = csp, 1, -1
+                 IF (cs_cmnd_num(i) .EQ. cmnd_repeat) pop = pop + 1
+                 IF (cs_cmnd_num(i) .EQ. cmnd_if) pop = pop + 1
+                 
+! Pop out of possibly nested if in current script (fixes bug 1566)
+                 IF (ifstk .GT. 0) THEN 
+                 IF (if_cs(ifstk) .EQ. i) THEN 
+                    DO WHILE (if_cs(ifstk) .EQ. i .AND. ifstk.GT.1)
+                       ifstk = ifstk - 1
+                    ENDDO
+!!!                    ifstk = ifstk + 1  ! ifstk will be popped once by POP_CS 
+                 ENDIF
+                 ENDIF
+
+                 IF (cs_cmnd_num(i) .EQ. cmnd_semicolon) pop = pop + 1
+                 IF (cs_cmnd_num(i) .EQ. cmnd_go) GOTO 400  ! Reached the next GO level(fixes bug 1566)
+ 300	      CONTINUE
+              GOTO 400
+	   ENDIF
+        ELSE IF ( (qual_given(slash_exit_prompt) .GT. 0) .OR.
+     .            (qual_given(slash_exit_topython) .GT. 0) ) THEN
+* Exit to Ferret prompt or out of the ferret_dispatch loop
+	   pop = csp
+	   GOTO 400
+	ELSE IF (qual_given(slash_exit_topython) .GT. 0) THEN
+* Exit to the dispatch loop
+	   pop = csp
+	   GOTO 400
+	ELSE IF (qual_given(slash_exit_program) .GT. 0    .OR.
+     .  	  (qual_given(slash_exit_command) .GT. 0) .OR. 
+     .            .NOT. GO_FILE_INPUT()) THEN
+* Exit program completely 
+* *kob* new call to GO_FILE_INPUT to make sure were not in command file
+	   CALL CLSPPL		! close PLOT5
+           pplus_started = .FALSE.
+	   CALL TM_EXIT		! close TMAP data sets
+	   RETURN 1
+!	   IF ( frame_on ) CALL MOVIE_CLOSE( frame_lun, status )! end movie
+	ELSE
+* no qualifier supplied on a "quit" in a command file: Exit current script
+	   CALL POP_CS
+	   IF (csp .EQ. 0) RETURN
+	   IF (cs_cmnd_num(csp+1) .EQ. cmnd_if .AND. cs_cmnd_num(csp) .EQ. cmnd_go) CALL POP_CS 
+	   RETURN
+	ENDIF
+
+* Here is where we'll pop the stack once for each level we need to move down
+ 400	IF (pop .GT. 0) then
+	   DO 500 i = 1,pop
+	      CALL POP_CS
+ 500	   CONTINUE
+	ENDIF
+
+* Use the second alternate return to exit out of the ferret_dispatch loop
+* but just re-enter the loop if not under pyferret
+        IF ( qual_given(slash_exit_topython) .GT. 0 ) RETURN 2
+
+* error exit
+ 5000	RETURN
+
+	END
+
+
+
+
+
diff --git a/fer/xeq/xeq_frame.F b/fer/xeq/xeq_frame.F
new file mode 100644
index 0000000..2c0bf23
--- /dev/null
+++ b/fer/xeq/xeq_frame.F
@@ -0,0 +1,218 @@
+        SUBROUTINE XEQ_FRAME(memory)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the FRAME command
+* make a movie frame of the current output graphics
+
+* FRAME/FILM        - to trigger actual movie frame
+* FRAME/BITMAP        - to store the current workstation screen contents
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 5/7/87
+* V200:  11/14/89 - guts moved to SAVE_FRAME - laser output, too
+* V320: 5/94 - array "memory" as a calling argument
+*         8/94 - added qualifiers /FORMAT and /FRAME to permit direct capture
+*                of GIF images
+* V320: 1/95 - use gif_frame routine for both HDF and GIF
+*        call TM_PARK_LAST_VERSION for names
+* V500: 4/99 *sh* increased filename string length from 128 to 255
+* V602: *acm* 1/07 Changes for metafile-batch mode: Ignore FRAME in 
+*                  batch mode, except when in batch GIF mode.
+* V6.2  *acm* 5/08 new qualifier FRAME/TRANSPARENT
+* PyFr  *kms* 11/11 changes for saving using the graphics delegate
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* PyFr  *kms*  7/13 Add /XPIXELS, /YPIXELS, /XINCHES, /YINCHES to FRAME
+* PyFr  *kms*  8/13 Add /ANNOTATE to FRAME; declare memory argument 
+*                   now needed for SAVE_FRAME
+
+        IMPLICIT NONE
+        include 'tmap_dims.parm'
+        include 'ferret.parm'
+        include 'errmsg.parm'
+        include 'slash.parm'
+        include 'xprog_state.cmn'
+        include 'xplot_state.cmn'
+        include 'xplot_setup.cmn'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'      ! wsid
+
+        REAL memory(*)
+
+* internal function return value declarations:
+        INTEGER   TM_LENSTR1
+
+* internal variable declarations:
+        REAL      val
+        REAL*4    xinches, yinches
+        INTEGER   sts, loc, flen, xloc, yloc,
+     .            xpixels, ypixels
+        CHARACTER annovar*1028, fformat*5, filename*1028
+
+* decode the qualifiers, if any
+
+* FRAME /XINCHES=... xor /YINCHES=...
+        xloc = qual_given( slash_frame_xinches )
+        yloc = qual_given( slash_frame_yinches )
+        IF ( (xloc .GT. 0) .AND. (yloc .GT. 0) ) THEN
+            GOTO 5010
+        ELSEIF ( xloc .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(xloc):qual_end(xloc)), 
+     .                     val, sts)
+            IF ( sts .NE. ferr_ok ) RETURN
+            IF ( sts .EQ. unspecified_val4 ) GOTO 5020
+            IF ( val .LT. 1.25 ) GOTO 5030
+            xinches = val
+            yinches = val * wn_yinches(wsid) / wn_xinches(wsid)
+        ELSEIF ( yloc .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(yloc):qual_end(yloc)), 
+     .                     val, sts)
+            IF ( sts .NE. ferr_ok ) RETURN
+            IF ( sts .EQ. unspecified_val4 ) GOTO 5040
+            IF ( val .LT. 1.25 ) GOTO 5050
+            yinches = val
+            xinches = val * wn_xinches(wsid) / wn_yinches(wsid)
+        ELSE
+            xinches = wn_xinches(wsid)
+            yinches = wn_yinches(wsid)
+        ENDIF
+
+* FRAME /XPIXELS=... xor /YPIXELS=...
+        xloc = qual_given( slash_frame_xpixels )
+        yloc = qual_given( slash_frame_ypixels )
+        IF ( (xloc .GT. 0) .AND. (yloc .GT. 0) ) THEN
+            GOTO 5015
+        ELSEIF ( xloc .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(xloc):qual_end(xloc)), 
+     .                     val, sts)
+            IF ( sts .NE. ferr_ok ) RETURN
+            IF ( sts .EQ. unspecified_val4 ) GOTO 5025
+            IF ( val .LT. 128 ) GOTO 5035
+            xpixels = NINT(val)
+            ypixels = NINT(val * wn_ypixels(wsid) / wn_xpixels(wsid))
+        ELSEIF ( yloc .GT. 0 ) THEN
+            CALL EQUAL_VAL(cmnd_buff(qual_start(yloc):qual_end(yloc)), 
+     .                     val, sts)
+            IF ( sts .NE. ferr_ok ) RETURN
+            IF ( sts .EQ. unspecified_val4 ) GOTO 5045
+            IF ( val .LT. 128 ) GOTO 5055
+            ypixels = NINT(val)
+            xpixels = NINT(val * wn_xpixels(wsid) / wn_ypixels(wsid))
+        ELSE
+            xpixels = NINT(wn_xpixels(wsid))
+            ypixels = NINT(wn_ypixels(wsid))
+        ENDIF
+
+* FRAME/ANNOTATE=...
+        loc = qual_given( slash_frame_annotate )
+        IF ( loc .GT. 0 ) THEN
+            CALL EQUAL_STR_LC(
+     .              cmnd_buff(qual_start(loc):qual_end(loc)), 
+     .              annovar, sts)
+            IF ( sts .NE. ferr_ok ) RETURN
+            IF ( annovar .EQ. ' ' ) GOTO 5060
+        ELSE
+            annovar = ' '
+        ENDIF
+
+* FRAME/TRANSPARENT
+
+        transparent = 0
+        loc = qual_given( slash_frame_transp )
+        IF (loc .GT. 0 .AND. .NOT. animate) THEN
+           transparent = 1
+        ENDIF
+
+* FRAME/FORMAT=...
+        loc = qual_given( slash_frame_format )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_STR_LC(
+     .          cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    fformat, sts )
+           IF ( sts .NE. ferr_ok ) GOTO 5000
+        ELSE
+           fformat = ''
+        ENDIF
+
+* FRAME/FILE=filename
+        loc = qual_given( slash_frame_file )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_STR_LC(
+     .          cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    filename, sts )
+           IF ( sts .NE. ferr_ok ) GOTO 5000
+        ELSEIF ( fformat .NE. '' ) THEN
+           filename = 'ferret.' // fformat
+        ELSE
+           filename = frame_file        ! saved SET MOVIE/FILE name
+        ENDIF
+        flen = TM_LENSTR1(filename)
+
+* rename previous versions of this file using a version number scheme
+        CALL TM_PARK_LAST_VERSION(filename(:flen), sts)
+
+* save that baby
+        CALL SAVE_FRAME(memory, filename(:flen), fformat, annovar,
+     .                  xinches, yinches, xpixels, ypixels, sts)
+
+ 5000   RETURN
+
+* error exits
+ 5010   CALL ERRMSG( ferr_invalid_command, sts,
+     .       'Only one of /XINCHES and /YINCHES can be given', *5000 )
+ 5015   CALL ERRMSG( ferr_invalid_command, sts,
+     .       'Only one of /XPIXELS and /YPIXELS can be given', *5000 )
+ 5020   CALL ERRMSG( ferr_syntax, sts, '/XINCHES=?', *5000 )
+ 5025   CALL ERRMSG( ferr_syntax, sts, '/XPIXELS=?', *5000 )
+ 5030   CALL ERRMSG( ferr_out_of_range, sts, 
+     .       '/XINCHES must be at least 1.25', *5000)
+ 5035   CALL ERRMSG( ferr_out_of_range, sts, 
+     .       '/XPIXELS must be at least 128', *5000)
+ 5040   CALL ERRMSG( ferr_syntax, sts, '/YINCHES=?', *5000 )
+ 5045   CALL ERRMSG( ferr_syntax, sts, '/YPIXELS=?', *5000 )
+ 5050   CALL ERRMSG( ferr_out_of_range, sts, 
+     .       '/YINCHES must be at least 1.25', *5000)
+ 5055   CALL ERRMSG( ferr_out_of_range, sts, 
+     .       '/YPIXELS must be at least 128', *5000)
+ 5060   CALL ERRMSG( ferr_syntax, sts, '/ANNOTATE=?', *5000 )
+
+        END
+
diff --git a/fer/xeq/xeq_go.F b/fer/xeq/xeq_go.F
new file mode 100644
index 0000000..8b1b881
--- /dev/null
+++ b/fer/xeq/xeq_go.F
@@ -0,0 +1,202 @@
+	SUBROUTINE XEQ_GO
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the GO command
+* GO filename	indicates that the commands in file filename are to be executed
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/8/86
+* revision 1.0 - 4/29/87 - added ability to nest GO commmands
+*			 - eliminated pretenses of batch mode
+* revision 1.1 - 7/22/88 - enhanced error message for no filename given
+* Unix/RISC port - change OPEN statement for Unix
+* V300: 4/93 - implemented arguments to GO commands (save command string here)
+*	6/93 - bug fix to arguments when filename is in quotes
+* V314 8/24/94 *kob* IBM port - READONLY not allowed in open statements on
+*				IBM
+*			      - SHARED not allowed in open statementson IBM..
+*				add an ifdef NO_OPEN_SHARED
+* V320: 10/94 - added GO/HELP filename
+*	12/94 - added definition of PLOT+ symbol 'GO_FILE' if PLOT+ is running
+*		and the GO command is given from the keyboard
+*    12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V411: 9/11/95 (IBM port) variable go_help assigned to integer expression
+* V510 *sh* 3/00 -- increase allowed path name length
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V610  2/08 *acm* Always define a symbol LAST_GO_FILE with the name of the jnl script.
+* V618  1/09 *acm* The last character of symbol LAST_GO_FILE was chopped off. Fix this.
+* V66   *kms* 5/10 LIB_GET_LUN is a subroutine, not a function
+* V687  *ACM* 3/14 for ticket 2044 write note !Enter_GO with script and arguments, only 
+*                  if SET REDIRECT is turned on.
+
+! Note: A known "bug" of the 12/94 GO_FILE symbol is that the PLOT+ symbol
+!	GO_FILE gets defined only **after** PLOT+ has already placed a window
+!	on the screen and a GO command is executed.  This means that if the
+!       GO file to create a plot contains the first command that opens
+!       an output window the symbol GO_FILE will **not** be defined.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+        include 'tmap_errors.parm'
+	include 'ferret.parm'
+	include 'command.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'		! 12/94
+	include 'xcontrol.cmn'
+	include 'xrisc.cmn'
+
+* internal variable declarations:
+	LOGICAL	go_help
+	INTEGER	TM_LENSTR1,
+     .		temp_lun, status, TMAP_status,
+     .          file_opened, ier, ist, len_string, slen
+        CHARACTER TM_INQ_PATH*2048, cbuff*2048
+
+* internal parameter declarations
+	INTEGER     slash_go_help
+	PARAMETER ( slash_go_help = 0 + 1 )
+	
+* was /HELP given ?
+	go_help = qual_given( slash_go_help ) .GT. 0	! added ".GT. 0" 9/95
+
+* check syntax
+	IF     ( num_args .EQ. 0 ) THEN
+	   IF (go_help) THEN
+	      CALL SPLIT_LIST(pttmode_help, err_lun,
+     .			' Use the GO command to name a file of FERRET'//
+     .			' commands to be executed.', 0)
+	      CALL SPLIT_LIST(pttmode_help, err_lun,
+     .			 '     e.g.   yes? GO filename', 0)
+	      CALL SPLIT_LIST(pttmode_help, err_lun, ' ', 1)
+	      CALL SPLIT_LIST(pttmode_help, err_lun,
+     .			' Use "GO/HELP filename" to read documentation in '//
+     .			' the file to be executed.', 0)
+	      RETURN
+	   ELSE
+	      CALL ERRMSG( ferr_unknown_arg, status,
+     .			cmnd_buff(:len_cmnd)//': What file ?', *5000 )
+	   ENDIF
+	ENDIF
+
+* check path list to find the "GO" file
+        cbuff = TM_INQ_PATH( cmnd_buff(arg_start(1):arg_end(1)),
+     .                   'FER_GO', '.jnl', .TRUE., TMAP_status )
+        IF ( TMAP_status .NE. merr_ok ) GOTO 5100
+
+* kob 1/2006 - need this after backing out of yonghua's changes 
+*get a logical unit number and open the command file
+	CALL LIB_GET_LUN( temp_lun )
+
+* display HELP lines using the "more" command on the system
+	IF (go_help) THEN
+	   CALL SPLIT_LIST(pttmode_help, err_lun,
+     .		' Full path name: '//cbuff(:TM_LENSTR1(cbuff)), 0) 
+
+	   CALL SYSTEM( 'more -d '//cbuff(:TM_LENSTR1(cbuff)) )
+	   RETURN
+	ENDIF
+
+* OPEN the file in preparation for reading commands from it
+	OPEN(	UNIT=temp_lun,
+     .		FILE=cbuff,
+#ifdef READONLY_ALLOWED
+     .		READONLY,
+#endif
+#ifdef NO_OPEN_SHARED
+#else
+     .		SHARED,
+#endif
+     .		STATUS='OLD',
+     .		ERR=5010 )
+
+*  back out of yonghua's routine call because of 64bit problems *kob**     
+*        my_cbuff = cbuff
+*        CALL my_open(temp_lun,cbuff,LEN(cbuff),file_opened)
+*        if(file_opened.EQ.0) goto 5010
+* inform the control stack that it has taken control at a new level
+	CALL STACK_PTR_UP( csp, cs_max, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	cs_in_control = .TRUE.
+	cs_cmnd_num( csp ) = cmnd_go
+	cs_lun( csp ) = temp_lun
+	cmnd_lun = temp_lun
+	input_source = input_from_file
+
+* GO line will be parsed by DOLLAR_ARG - un-do parsing of PARSE_COMMAND
+	CALL ALL_1_ARG
+	cs_text( csp ) = cmnd_buff(arg_start(1):arg_end(1))
+	
+* ... Write note with script and arguments, only if SET REDIRECT is turned on.
+        IF (redirect_stdout_flags .NE. redirect_none) THEN
+	   risc_buff = '! Enter_GO '//cs_text(csp)(:TM_LENSTR1(cs_text(csp)) )
+	   slen = 0
+	   CALL SPLIT_LIST(pttmode_explct, ttout_lun, risc_buff, slen)
+	ENDIF
+
+* define the PLOT+ symbol 'GO_FILE' if PLOT+ is running and the GO command
+* was given at the keyboard
+* (Note: we check for csp.eq.1 instead of 0 because csp was just pushed)
+	IF ( pplus_started .AND. csp.EQ.1 ) CALL PPLCMD
+     .		( from, line, 0, 'SET GO_FILE '//cbuff, 1, 1 )
+
+* define the symbol 'LAST_GO_FILE' no matter what...
+
+	ier = 0
+	ist = 0
+	len_string = TM_LENSTR1( cbuff )
+
+	CALL SETSYM ('LAST_GO_FILE '//cbuff, 13+len_string, 
+     .                 ier, ist)
+
+* successful completion
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_erreq, status,
+     .		cmnd_buff(arg_start(1):arg_end(1)), *5000)
+ 5100	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5000)
+ 5200	CALL ERRMSG( ferr_out_of_range, status, 'GO/HELP=#-of_lines',
+     .		*5000)
+	END
+
diff --git a/fer/xeq/xeq_help.F b/fer/xeq/xeq_help.F
new file mode 100644
index 0000000..0cf656c
--- /dev/null
+++ b/fer/xeq/xeq_help.F
@@ -0,0 +1,84 @@
+	SUBROUTINE XEQ_HELP
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the HELP command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86 - dummy version
+* revision 1.0 - 5/13/87 - calls VMS utility routines
+* revision 1.1 - 3/7/88  - changed help file name to logical name
+* revision 1.2 - 4/26/88 - added PUT_OUTPUT/GET_INPUT
+* revision 1.3 - 6/22/88 - changed GFDL_HELP --> FERRET_HELP
+* revision 1.4 - 8/3/88  - Top level of help library, "FERRET", removed
+* V230: 8/26/92 - added Unix version - entirely separate from VMS
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* V5.0: 1/1/99 - Start up appropriate Web browser on PC
+* v500: 1/26/99 - *kob* update help to reflect current options
+
+* V5.6  3/2004 - update help to point only to web resources and SHOW commands
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+        include 'ferret.parm'
+        include 'xprog_state.cmn'
+
+
+	CALL SPLIT_LIST(pttmode_help, err_lun,
+     .   ' Detailed help is available online at http://ferret.pmel.noaa.gov'
+     .								, 0)
+
+	CALL SPLIT_LIST(pttmode_help, err_lun,
+     .   ' To obtain a list of FERRET commands type    SHOW COMMANDS'
+     .								, 0)
+
+	CALL SPLIT_LIST(pttmode_help, err_lun,
+     .' To obtain a list of FERRET functions type    SHOW FUNCTIONS'
+     .								, 0)
+
+	CALL SPLIT_LIST(pttmode_help, err_lun,
+     .' To obtain a list of FERRET transforms type    SHOW TRANSFORM'
+     .								, 0)
+
+        RETURN
+
+	END
+
diff --git a/fer/xeq/xeq_if.F b/fer/xeq/xeq_if.F
new file mode 100644
index 0000000..f4a1578
--- /dev/null
+++ b/fer/xeq/xeq_if.F
@@ -0,0 +1,232 @@
+	SUBROUTINE XEQ_IF
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sets up the control stack (COMMON/~CONTROL/) to handle single line
+* conditional "IF" or the IF-stack (ifstk) to handle multiple line IF
+* Single line IF (e.g. IF cond THEN command1 ELSE command2 ENDIF)
+* or a multi-line IF -- e.g.
+*	IF cond THEN
+*	   commands ...
+*	ELIF cond2 THEN
+*	   commands ...
+*	ELSE
+*	   commands ...
+*	ENDIF
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* V420:  4/96
+*        5/96 - allow for multi-line IF clause inside of skipped clause
+* V500:  6/99 - bug fix for final quote in IF 1  THEN SAY "I is too big" ENDIF
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include 'errmsg.parm'
+	include 'gfdl_vms.parm'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+	include 'xprog_state.cmn'
+
+* local variable declarations
+	LOGICAL TRUE_OR_FALSE, condition, has_false_clause,
+     .		non_executed_if
+	INTEGER	STR_CASE_BLIND_COMPARE, STR_UPCASE,
+     .		vax_code, if_type, iarg,
+     .		true_clause_start, true_clause_end, false_clause_start,
+     .		false_clause_end, status, csp1, tmp_stat, end
+
+* 6/96: Are we really going to process this IF or merely register that
+* a (skipped) IF clause has been opened?
+* e.g. in this example the first ENDIF is ignorable
+*       IF yes THEN
+*	  do stuff
+*       ELSE
+*         IF condition THEN
+*           do stuff
+*         ENDIF			! <=== must be skipped
+*       ENDIF
+	IF (if_conditional) THEN				! nested IF?
+	   IF (if_doing(ifstk).NE.pif_doing_clause) THEN	! skipped IF?
+	      IF ( num_args .LE. 2 ) THEN		! multi-line nested IF?
+* ...       bump the IF stack - set up to skip this entire IF clause
+	         IF ( ifstk .GE. max_ifstk ) GOTO 5400
+	         ifstk = ifstk + 1
+	         if_doing(ifstk) = pif_skip_to_endif
+	         if_cs(ifstk) = if_cs(ifstk-1)
+	      ENDIF
+	      RETURN
+	   ENDIF
+	ENDIF
+
+* check that something was given to "if" on
+	IF ( num_args .LT. 2 ) GOTO 5100
+
+* determine if the condition is true or false
+	condition = TRUE_OR_FALSE(cmnd_buff(arg_start(1):arg_end(1)),
+     .				  status)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* whether single line or multi the second argument should be "THEN"
+	vax_code = STR_CASE_BLIND_COMPARE(
+     .				cmnd_buff(arg_start(2):arg_end(2)),
+     .				'THEN' )
+	IF (vax_code .NE. vms_str_success) GOTO 5200
+
+* determine the nature of the IF clause -- single line or multi
+	IF ( num_args .GT. 2 ) THEN
+
+* ***** process a single line IF *****
+* Single line logic is handled on the control stack since input for dependent
+* clauses comes from internal control
+* allocate next spot for the IF control on the control stack
+	   CALL STACK_PTR_UP( csp, cs_max, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   csp1 = csp
+
+* save the full command string converted to upper case
+	   vax_code = STR_UPCASE( cs_text( csp ), cmnd_buff )
+
+
+* pattern: *** IF condition THEN true_clause ELSE false_clause (ENDIF) ***
+	   true_clause_start = 3
+* try to find "ELSE"
+	   DO 100 iarg = 3, num_args
+	      IF (cs_text(csp)(arg_start(iarg):arg_end(iarg))
+     .						.EQ. 'ELSE' ) THEN
+		 has_false_clause   = .TRUE.
+	         true_clause_end    = iarg - 1
+	         false_clause_start = iarg + 1		         
+	         GOTO 200
+	      ENDIF
+ 100	   CONTINUE
+	   has_false_clause = .FALSE.
+
+* is there an implicit or an explicit "ENDIF"?
+ 200	   DO 300 iarg = num_args, 3, -1
+	      IF (cs_text(csp)(arg_start(iarg):arg_end(iarg))
+     .						.EQ. 'ENDIF' ) THEN
+	         IF (iarg .NE. num_args ) GOTO 5300
+	         IF (has_false_clause) THEN
+	            false_clause_end = num_args - 1
+	         ELSE
+	            true_clause_end  = num_args - 1
+	         ENDIF
+	         GOTO 400
+	      ENDIF
+ 300	   CONTINUE
+* ... no - there is no terminating "ENDIF"	   
+	   IF (has_false_clause) THEN
+	      false_clause_end = num_args
+	   ELSE
+	      true_clause_end  = num_args
+	   ENDIF
+
+* prepare the clause to be executed
+ 400	   IF ( condition ) THEN
+* ... 6/99 bug fix (hack) -- final quotation mark missed in
+*	IF 1 THEN SAY "I is too big" ENDIF
+*     because arg_start/arg_end are pre-trimmed wrt enclosing quotes
+	      end =  arg_end(true_clause_end)
+	      IF (end .LT. len_cmnd) THEN
+	         IF (cmnd_buff(end+1:end+1).EQ.'"') end = end + 1
+	      ENDIF
+	      cs_text(csp) = cmnd_buff(arg_start(true_clause_start):
+     .				       end)
+	   ELSEIF ( has_false_clause ) THEN
+* ... 6/99 bug fix (hack) -- final quotation mark missed in
+*	IF 1 THEN SAY "I is too big" ENDIF
+*     because arg_start/arg_end are pre-trimmed wrt enclosing quotes
+	      end =  arg_end(false_clause_end)
+	      IF (end .LT. len_cmnd) THEN
+	         IF (cmnd_buff(end+1:end+1).EQ.'"') end = end + 1
+	      ENDIF
+	      cs_text(csp) = cmnd_buff(arg_start(false_clause_start):
+     .				       end)
+	   ELSE
+* ... false condition and no ELSE clause
+	      CALL STACK_PTR_DN( csp, 0, tmp_stat )
+	      RETURN
+	   ENDIF
+
+* tell 'em who owns this level
+	   cs_cmnd_num( csp ) = cmnd_if
+
+* only for a single command, though
+	   cs_phase(csp) = 0
+
+* tell 'em we've taken over and start workin'
+	   cs_in_control = .TRUE.
+	   input_source  = input_from_cs
+	ELSE
+
+* ***** process a multi-line IF *****
+* bump the IF stack
+	   IF ( ifstk .GE. max_ifstk ) GOTO 5400
+	   ifstk = ifstk + 1
+
+* say which IF clause to execute
+	   IF ( condition ) THEN
+	      if_doing(ifstk) = pif_doing_clause	! IF TRUE THEN xxx
+	   ELSE
+	      if_doing(ifstk) = pif_skip_to_clause	! IF FALSE ... ELSE xxx
+	   ENDIF
+
+* save where we are in the control stack for error checking
+	   if_cs(ifstk) = csp
+	   if_conditional = .TRUE.
+
+	ENDIF
+
+	RETURN
+	
+* error exit
+* ... control stack pointer, CSP, corrected in GFD_ERROR_HANDLER
+ 4999	CALL STACK_PTR_DN( csp, 0, tmp_stat )
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_syntax, status, 'IF what ?', *5000)
+* ... need to pop stack for errors below here
+ 5200	CALL ERRMSG( ferr_syntax, status, 'IF without THEN'//
+     .			pCR//cmnd_buff(:len_cmnd), *4999 )
+ 5300	CALL ERRMSG( ferr_syntax, status, 'Trash after ENDIF'//
+     .			pCR//cmnd_buff(:len_cmnd), *4999 )
+ 5400	CALL ERRMSG( ferr_invalid_command, status, 'IFs nested too deep',
+     .							*5000 )
+	END
diff --git a/fer/xeq/xeq_list.F b/fer/xeq/xeq_list.F
new file mode 100644
index 0000000..7b84980
--- /dev/null
+++ b/fer/xeq/xeq_list.F
@@ -0,0 +1,734 @@
+	SUBROUTINE XEQ_LIST( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the LIST command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/16/86
+* revision 0.1 - 1/5/87	 - changes to accomodate multiple mrs in expression
+* revision 0.2 - 2/25/87 - changes for INTERPRETATION STACK
+* revision 0.3 - 8/29/87 - changes for unformatted LIST: OPEN file in this rout.
+* revision 0.4 - 9/9/87  - added DSF_LIST call (Denbo's BIBO output)
+* revision 0.5 - 9/16/87 - added want_cmnd_data to CALL GET_CMND_DATA
+* revision 0.6 - 9/26/87 - added AUTO filename option and headers automatically
+*			   for /APPEND when file doesn't exist
+* revision 0.7 - 10/5/87 - revamped SET LIST logicals
+* revision 0.8 - 3/7/88  - added list_TMAP
+* revision 0.9 - 6/24/88 - use LIST/FILE[/APPEND] to direct output to file
+*			 - allow multiple variables in a /FORMAT=GT list
+* revision 1.0 - 2/22/89 - check for interrupts after each variable
+* V200:  5/18/89 - minor changes for 4D-symmetrical
+*		 - context passed in is_cx instead of is_big_cx
+*		 - list_unformatted and list_format_given are cancelled at end
+*	10/16/89 - set up adjustable array limits with NON_ARRAY_SUBSC
+*		 - permutable listing order
+*	12/19/89 - corrected bug in LIST/FORM=TMAP
+*	 3/20/90 - eliminated forced heading for /APPEND when file doesn't exist
+*	 4/27/90 - unformatted output types without a /FILE generate an error
+*	 5/15/90 - DSF (BIBO) output neede to call AUTO_FILENAME, too
+*	  7/2/90 - allow multiple variables per line, numerous style changes
+*		 - interrupt checking inside list routines
+*	 7/31/90 - added EPIC format and MULTI lists use work arrays
+* Unix/RISC port - changed OPEN syntax for Unix filesystem
+*                - changed /FILE= to preserve lower case
+* SUN port 3/92 *sh* - unformatted record length in bytes
+*                    - discovered "perm" is unitialized if not specified
+* V230:  6/9/92 - added netCDF output including changes to the use of
+*                 XPROG_STATE variables dealing w/ format type
+*                 SET LIST is now effective only for the NEXT list
+*       7/27/92 - don't remove protections from "command data" until AFTER
+*                 listing because permutation requires memory management
+*        8/6/92 - CDF was using is_mr instead of mr_perm (minimum reqsted reg.)
+*           and - error during GET_PROT_CMND_DATA left /FORMAT= set
+*      10/14/92 - bug fix: wrong GOTO following EQUAL_FORMAT error
+* V300:    5/93 - error message bug: filename truncated
+*	  10/93 - ALPHA port - explicit error message if file exists because
+*		  OSF/1 error message is "Bad magic number"
+* V314:	8/24/94 *kob* IBM port - RECORDTYPE not allowed in open statments under
+*				 AIX fortran.  Add ifdef 1.
+*	11/3/94 *sh* IBM port - ACCESS=APPEND isn't allowed but STATUS=OLD
+*				defaults to this behavior
+*	11/5/94 *sh* IBM port - disable GT format output on IBM.  Unable to
+*			append on unformatted file (not checked thoroughly)
+* V320:  5/94 - array "memory" as a calling argument
+*	10/94 - added code for /HEADING=enhanced
+*	11/94 - trap LIST/FORMAT without /FILE in GUI mode as an error
+*	11/94 - added SAVE/HEADING="title"
+*	12/94 - added /FORMAT=stream
+*    12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*     1/17/95 - increased output filename length from 100 characters to 200
+*     1/25/95 - added /TITLE= and /HEADING=enhanced (and unenhanced) for netCDF
+* V420   9/95 - added /FORMAT=comma and tab delimited
+* Linux Port 5/97 *kob* - had to add ifdef F90_OPEN_FILE_APPEND because f90
+*			  uses "POSITION" instead of "ACCESS" to specify 
+*			  opening a file for append.  I also had to create a
+*			  new variable called "fposition", which stores the 
+*			  open position of the file, either "append" or "asis".
+*			  this had to be done in order for a new file to have 
+*			  a valid "position" for f90 opens.
+* V430	 7/96 - *kob* reclen_in_bytes not appropriate for sgi..added 
+*		      "ifndef sgi" to prevent 1 being set
+* V450	11/96 - added LIST/CLOBBER
+*		added pcdf_mode_cache for DODS caching
+*       7/98 *js* Changed size of perm to 5 to support parsing of 
+*                 xyztv permutations (unsupported for now)
+*      12/98 *js* Disable listing to files if in secure mode
+* V500  2/99  - *kob* added LIST/QUIET
+*	5/99 - *sh- added arguments to EQUAL_PERMUTE
+* V530  8/00 *sh* - bug fix of /CLOBBER with /FORM=STREAM
+*		  - set reclen correctly for string output
+*       *sh* 9/00  - added initial data type support in get_cmnd_data 
+*	*sh* 11/00 - fixed bug: permutation for all vars written was determined
+*		     from context of first var, only
+*       *sh8 1/01  - bug fix to 11/00 bug fix!
+* v542  *kob* 10/02 - add F90_OPEN_FILE_CLOBBER option to make sure that the F90 
+*                     OPEN POSITION directive is not blank when opening an 
+*                     existing file for rewrite.  This causes an F90 OPEN error
+* V554 *acm* 9/03  Add output in /DODS binary format for list/format=DODS, 
+*                  see the flag do_dods
+* V581 *acm* 3/05  Increase length of string buff so that title can be longer.
+* V600: *acm* 8/05 - make multi-variable tab and comma-delimited listings of
+*                    multiple variables like free-format listings, rather than 
+*                    like LIST/SINGLY. (bug 1273)
+* V600  *acm* 4/06 change how mr_perm is passed to LIST_CMND_DATA,due to 64-bit problems  
+* V602  *acm* 1/07 Use risc_buff rather than the local variable buff for reading inputs 
+*                  and for the title - fixing bug 1482
+* V604  *acm* 7/07 Dataset names have been increased to 1024, but on output this runs into
+*                  conflicts with Fortran INQUIRE and OPEN calls. Disallow output names
+*                  longer than 256 characters.
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V62  *acm*  2/09 - Fix bug 1634: allow SAVE/KEEP_AXISNAMES so that child axis names
+*                    arent written. They can get too long for OPeNDAP library calls
+* V62  *acm*  2/09 - Fix bug 1644: Dataset title was stored in risc_buff but if mode diag
+*                    is turned on, the string was overwritten. Go back to a local buffer
+*                    to store the title
+* V6.5  *acm* 1/10 new qualifiers for LIST netCDF4: NCFORMAT,
+*                  XCHUNK,YCHUNK,ZCHUNK,TCHUNK,COMPRESSION,SHUFFLE,ENDIAN
+* V6.7  *acm* 3/11 Remove warning deprecating /RIGID. There are still valid reasons
+*                  to want to set the time axis to NOT be the record axis.
+* V68  *acm*  1/12 ifdef double_p for double-precision ferret.
+* V683 *acm*  8/12 add new SAVE/OUTTYPE=  
+* V685 *acm*  6/13 new qualifier SAVE/NOBOUNDS
+* V685 *acm*  6/13 Dont add SAVE/NOCOORDS
+* V690 *sh*   1/14 Automated 3-argument auxiliary (curvilinear) plotting
+
+	include 'tmap_dims.parm'
+        include 'tmap_errors.parm'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'interp_stack.parm'
+        include 'gfdl_vms.parm'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xprog_state.cmn'
+	include 'xinterrupt.cmn'
+        include 'xrisc.cmn'
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations
+	LOGICAL		is_secure
+	LOGICAL		ITS_AUTO_CURVI,
+     .			normal_file, fexist, heading, list_to_tty, do_multi,
+     .			do_epic, do_cdf, do_unform, do_stream,
+     .			do_comma_del, do_tab_del, do_dods, do_xml,
+     .			permute, all_at_once, list_at_eof, head_enh,
+     .			clobber, quiet, have_outtype, curvi_axes(nferdims)
+
+	INTEGER		TM_LENSTR1, CX_DIM_LEN, STR_CASE_BLIND_COMPARE,
+     .                  STR_UPCASE, GET_MAX_STRING_LEN,
+     .			status, mr, cx, inext, ilist, wsize, vax_code,
+     .			rlen, flen, reclen, i, cx1, qfile, idim,
+     .			ndim, wkblk, perm(7), mr_perm(max_intrp),
+     .                  npermuted, recsofar, do_stream_phase, nvars,
+     .                  edges_flag, keepax_flag, nn, slen, do_bounds,
+     .			my_mr(max_intrp), my_cx(max_intrp), frame_bottom,
+     .			nvars2list
+
+	CHARACTER	AUTO_FILENAME*2048, filename*2048, raw_name*2048, 
+     .			buff*2048, fstatus*8, faccess*12, fformatted*12,
+     .			cdf_recax*1, fposition*12, out_type*6
+
+* local parameter declarations
+* *kob* 2/99 - add entries for quiet qualifier 
+	INTEGER		slash_file, slash_append, slash_permute, slash_format,
+     .			slash_seqntl, slash_rigid, slash_clobber, 
+     .                  slash_quiet
+	PARAMETER     (	slash_seqntl  = 15+1,
+     .			slash_file    = 16+1,
+     .			slash_append  = 17+1,
+     .			slash_permute = 18+1,
+     .			slash_format  = 19+1,
+     .			slash_rigid   = 22+1,
+     .			slash_clobber = 35+1,
+     .                  slash_quiet   = 36+1)
+
+* formatting information given ?
+	i = qual_given( slash_format )
+	IF ( i .GT. 0 ) THEN
+	   CALL EQUAL_FORMAT( cmnd_buff(qual_start(i):qual_end(i)), status )
+	   IF ( status .NE. ferr_ok ) GOTO 4999
+	ENDIF
+
+* did the user request to clobber previous output file versions
+	clobber = qual_given( slash_clobber ) .GT. 0
+
+* *kob* 2/99 - did the user request a quiet listing
+	quiet = qual_given( slash_quiet ) .GT. 0
+
+* special trap to create DODS cache version of NetCDF file
+        IF ( list_fmt_type .EQ. plist_cdf_cache ) THEN
+	   list_fmt_type = plist_default ! restore for next command
+	   num_uvars_in_cmnd = 0	 ! wipe out past memory of expressions
+	   CALL CDF_PREP_CACHE( cx_last, filename, nvars,
+     .			  memory, is_mr, is_cx, clobber, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+           edges_flag = 0
+           do_bounds = 0
+	   keepax_flag = 0
+	   out_type = "DFLT"
+	   CALL CDF_LIST( memory, filename( 1:TM_LENSTR1(filename)), 
+     .                    .FALSE., 'N', nvars, is_mr, is_cx,
+     .			   ' ', .TRUE., pcdf_mode_cache, clobber, 
+     .                    edges_flag, do_bounds, keepax_flag, out_type,  
+     .                    status )
+	   CALL DELETE_MRS_IN_PROGRESS		! remove temporary vars
+	   RETURN
+	ENDIF
+
+* initialize
+	list_at_eof  = list_append .OR. qual_given( slash_append ) .GT. 0
+	do_epic	     = list_fmt_type .EQ. plist_epic
+	do_cdf	     = list_fmt_type .EQ. plist_cdf
+        do_unform    = list_fmt_type .EQ. plist_unformatted
+        do_dods      = list_fmt_type .EQ. plist_dods
+        do_stream    = list_fmt_type .EQ. plist_stream
+        do_tab_del   = list_fmt_type .EQ. plist_tab_del
+        do_comma_del = list_fmt_type .EQ. plist_comma_del
+        do_stream_phase = 0		! for multi-variable stream
+        do_xml       = list_fmt_type .EQ. plist_xml
+	list_to_tty  = qual_given( slash_file ) .EQ. 0
+     .            .AND. .NOT.(do_epic.OR.do_unform
+     .			  .OR.do_cdf.OR.do_stream .OR. do_dods)
+	normal_file  = .NOT.( list_to_tty .OR. do_epic .OR. do_cdf
+     .			 .OR. do_stream .OR. do_dods) 
+	permute      = qual_given( slash_permute ) .GT. 0
+        npermuted    = 0
+	recsofar     = 0
+	
+* Verboten to list to file if in secure mode
+	IF (is_secure() .AND. .NOT. list_to_tty) then
+	   call SPLIT_LIST(pttmode_help, err_lun,
+     1	        'This command is not allowed.', 0)
+	   return
+	ENDIF
+
+* in GUI mode you cannot use LIST/FORMAT without /FILE
+	IF ( mode_gui.AND.list_format_given.AND.list_to_tty ) GOTO 5070
+
+	IF ( do_stream .AND. list_at_eof ) CALL ERRMSG
+     .		( ferr_not_implemented, status,
+     .			'cannot /APPEND with STREAM format', *4999)
+
+* /RIGID for netCDF ?
+        i = qual_given( slash_rigid )
+        IF ( i .GT. 0 ) THEN
+           cdf_recax = 'N'   ! no record axis
+        ELSE
+           cdf_recax = 'T'   ! "T" is record axis
+        ENDIF
+
+* /KEEP_AXISNAMES for netCDF ?
+        i = slash_list_keepax
+        i = qual_given( slash_list_keepax )
+	keepax_flag = 0
+        IF ( i .GT. 0 ) THEN
+           keepax_flag = 1
+        ENDIF
+
+* /EDGES for netCDF ?
+        edges_flag = 0
+        IF ( qual_given(slash_list_edges) .GT. 0) edges_flag = 1
+        IF ( qual_given( slash_rigid ) .GT. 0) edges_flag = 2 
+
+* /BOUNDS for netCDF ?
+	do_bounds = 0
+        IF (qual_given( slash_list_bounds ) .GT. 0) do_bounds = 1
+        IF (qual_given( slash_list_nobounds ) .GT. 0) do_bounds = -1
+ 
+* only for cdf, and not both edges and bounds.  Use BOUNDS if both specified.
+
+        IF (do_bounds .GT. 0) THEN
+           IF (.NOT. do_cdf) CALL WARN(
+     .          '/BOUNDS is valid only for NetCDF output. Ignored')
+           IF (edges_flag .GT. 0) THEN
+             IF (qual_given( slash_list_edges ) .GT. 0)
+     .            CALL WARN('Cannot have both /BOUNDS and /EDGES '//
+     .           'Ignoring /EDGES')
+             IF (qual_given( slash_rigid ) .GT. 0)
+     .            CALL WARN('Cannot have both /BOUNDS and /RIGID '//
+     .           'Ignoring /RIGID')
+              cdf_recax = 'T'   ! "T" is record axis
+              edges_flag = 0
+           ENDIF
+        ENDIF
+
+* get the requested data somehow
+* (leave the variables flagged as "in-use" 7/92)
+	CALL GET_PROT_CMND_DATA ( memory, cx_last, ptype_native, status )
+	IF ( status .NE. ferr_ok ) THEN      ! 8/6/92
+           list_fmt_type = plist_default ! restore for next command
+	   list_format_given = .FALSE.
+           RETURN
+        ENDIF
+	do_multi     = qual_given(slash_seqntl) .EQ. 0
+     .		 .AND. num_uvars_in_cmnd .GT. 1
+     .		 .AND. .NOT.do_stream
+c     .		 .AND. .NOT.do_tab_del
+c     .		 .AND. .NOT.do_comma_del
+
+	all_at_once  = do_multi.OR.do_epic.OR.do_cdf
+
+* permutation requested ?
+        DO 10 idim = 1, 7 ! 3/92 SUN port addition
+ 10     perm(idim) = idim
+	IF ( permute ) THEN
+* ... user-specified permutation
+	   i = qual_given( slash_permute )
+	   CALL EQUAL_PERMUTE( cmnd_buff(qual_start(i):qual_end(i)),
+     .			       .TRUE., .FALSE., .FALSE., perm, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* consolidate the given variables and the aux vars they depend on into one list
+	inext = 0
+	DO i = 1, num_uvars_in_cmnd 
+	   inext = inext + 1
+	   my_mr(inext) = is_mr(i)
+	   my_cx(inext) = is_cx(i)
+* ... now put its aux vars into the list
+	   IF ( ITS_AUTO_CURVI(i,curvi_axes) ) THEN
+* TEMPORARY: need to ensure that 'coordinates' attributes are written to point
+*	     variables to their auxiliary variables
+*	     For uvars there may be no __SigmaRef_. Just uvar_aux_cat/var 
+	      DO idim = 1, nferdims
+	         IF (curvi_axes(idim)) THEN
+	            inext = inext + 1
+	            frame_bottom = is_aux_ptr(i)
+	            my_mr(inext) = is_mr(frame_bottom+idim)
+	            my_cx(inext) = is_cx(frame_bottom+idim)
+	         ENDIF
+	      ENDDO
+	   ENDIF
+	ENDDO
+	nvars2list = inext   ! equals num_uvars_in_cmnd plus aux vars
+
+* set up possible loop - if variable by variable output is requested
+* this loop will be used - else all variables are output at once
+	inext = 1
+ 100	mr = my_mr( inext )
+	cx = my_cx( inext )
+
+* ... determine heading request
+	heading  = list_heading    ! default from SET LIST
+	risc_buff = ' '
+	IF ( qual_given( slash_list_nohead ) .GT. 0 ) heading = .FALSE.
+* did they request an "enhanced" heading?
+	i = qual_given( slash_list_head )
+	IF ( i .GT. 0 ) THEN
+	   heading = .TRUE.
+	   CALL EQUAL_STRING(
+     .                  cmnd_buff(qual_start(i):qual_end(i)),
+     .                  risc_buff, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   head_enh = INDEX(risc_buff,"ENH") .GT. 0
+	   IF ( .NOT.head_enh .AND. risc_buff.NE.' ' ) THEN
+	      CALL WARN('Unrecognized option /'//
+     .		         cmnd_buff(qual_start(i):qual_end(i)) )
+	      CALL WARN('Valid option is /HEADING=ENHANCED')
+	   ENDIF
+* Enhanced heading is not consistent with KEEP_AXISNAMES flag
+	   IF (keepax_flag .EQ. 1) THEN
+	      CALL WARN
+     .     ('/KEEP_AXISNAMES ignored. Inconsistent w/ enhanced heading.')
+              keepax_flag = 0
+	   ENDIF
+	      
+	ELSE
+	   head_enh = .FALSE.
+	ENDIF
+	IF ( head_enh .AND. qual_given(slash_format).EQ.0 ) GOTO 5060
+	IF ( head_enh .AND. (do_comma_del.OR.do_tab_del)  ) GOTO 5060
+
+* did they request a title?
+	i = qual_given( slash_list_title )
+	IF ( i .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC(
+     .                  cmnd_buff(qual_start(i):qual_end(i)),
+     .                  buff, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ELSE
+	   buff = ' '
+	ENDIF
+
+* did they set an output type?
+	out_type = "DFLT"
+	i = qual_given( slash_list_outtype )
+	IF ( i .GT. 0 ) THEN
+           IF (.NOT. do_cdf) THEN
+	      CALL WARN('/OUTTYPE is valid only for NetCDF output. Ignored')
+	   ELSE
+	      have_outtype = .FALSE.
+	      CALL EQUAL_STRING(
+     .                  cmnd_buff(qual_start(i):qual_end(i)),
+     .                  out_type, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      have_outtype = ( INDEX(out_type,'DOU') .GT. 0 .OR.
+     .                    INDEX(out_type,'FLO') .GT. 0 .OR. 
+     .                    INDEX(out_type,'INT') .GT. 0 .OR.
+     .                    INDEX(out_type,'SHO') .GT. 0 .OR.
+     .                    INDEX(out_type,'BYT') .GT. 0 )
+	      IF (.NOT. have_outtype) GOTO 5100
+           ENDIF
+	ENDIF
+
+* Get any settings for netcdf-4 output
+
+        CALL NETCDF4_LIST_SETTINGS (status)
+        IF ( status .NE. ferr_ok ) GOTO 5000
+
+* set up the output device
+	IF ( list_to_tty ) THEN
+* ... output to screen
+	   list_lun = ttout_lun
+	ELSE
+* ... output to a file
+	   IF ( do_unform ) THEN
+	      fformatted = 'UNFORMATTED'
+	   ELSE
+	      fformatted = 'FORMATTED'
+	   ENDIF
+* ... get full file name - from LIST/FILE= or from SET LIST/FILE=
+           raw_name = ' '
+           qfile = qual_given( slash_file )
+           IF ( qfile .GT. 0 ) THEN
+#ifdef unix
+* preserve case of filename for unix
+              CALL EQUAL_STR_LC(
+     .			cmnd_buff(qual_start(qfile):qual_end(qfile)),
+     .                  raw_name, status )
+#else
+* VMS filenames in upper case always
+              CALL EQUAL_STRING(
+     .			cmnd_buff(qual_start(qfile):qual_end(qfile)),
+     .                  raw_name, status )
+#endif
+           ENDIF
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( raw_name .EQ. ' ' .AND. do_stream_phase.EQ.0 ) THEN
+* ... use default from SET LIST command
+              vax_code = STR_CASE_BLIND_COMPARE(list_file(1:4),'AUTO')
+	      IF ( vax_code .EQ. vms_str_success ) THEN
+                 vax_code = STR_UPCASE( list_file, list_file )
+	         raw_name = AUTO_FILENAME( list_file, cx, mr, rlen )
+	      ELSE
+	         raw_name = list_file
+	      ENDIF
+	   ELSEIF ( STR_CASE_BLIND_COMPARE(raw_name(1:4),'AUTO')
+     .         .EQ. vms_str_success ) THEN
+              vax_code = STR_UPCASE( raw_name, raw_name )
+	      raw_name = AUTO_FILENAME( raw_name, cx, mr, rlen )
+	   ENDIF
+!	   rlen = TM_LENSTR1( raw_name )      ! ever used ???
+           slen = TM_LENSTR1(raw_name)
+           IF (slen .GT. 256 ) GOTO 5090
+	   INQUIRE( FILE = raw_name, NAME = filename, EXIST = fexist )
+
+	   flen = TM_LENSTR1( filename )
+* ... forced heading ?
+! (3/90)	   IF ( .NOT.fexist .AND. list_at_eof ) heading = .TRUE.
+* ... append or not ?
+	   IF ( fexist ) THEN    ! 10/93 logic change
+	      IF ( list_at_eof ) THEN
+
+#ifdef NO_ACCESS_APPEND
+	         faccess = 'SEQUENTIAL'
+#else
+	         faccess = 'APPEND'
+		 fposition = 'APPEND'
+#endif
+	         fstatus = 'OLD'
+	      ELSEIF (do_stream) THEN
+	         IF ( do_stream_phase .EQ. 0 ) THEN
+
+	            IF ( clobber ) THEN
+	               fstatus = 'OLD'
+	            ELSE
+	               CALL ERRMSG
+     .		   ( ferr_invalid_command,  status,
+     .              'file already exists: '//raw_name,
+     .              *1000 )
+	            ENDIF
+	         ENDIF
+	      ELSEIF ( clobber ) THEN	! 11/96
+	         faccess = 'SEQUENTIAL'
+	         fstatus = 'REPLACE'
+#ifdef F90_OPEN_FILE_CLOBBER
+		 fposition = 'ASIS'
+#endif
+	      ELSE
+	         GOTO 5050	! attempt to clobber a file
+	      ENDIF
+	   ELSE
+	      faccess = 'SEQUENTIAL'
+	      fstatus = 'NEW'
+	      fposition = 'asis'
+	   ENDIF
+* ... open or create it
+* only output listing message if user didn't specify quiet *kob* 2/99
+* For dods output, file is opened in the C routine called by write_dods_fmt.
+
+           IF (.NOT.(do_EPIC) .AND. do_stream_phase.EQ.0 
+     .                    .AND. .NOT.(quiet) )
+     . 	          CALL SPLIT_LIST(pttmode_bull, err_lun,
+     .		  ' LISTing to file '//raw_name(1:TM_LENSTR1(raw_name))
+     .								,0)
+
+	   IF ( normal_file ) THEN
+	      OPEN( UNIT	= default_list_lun,
+     .		    FILE	= raw_name,
+     .		    FORM	= fformatted,
+#ifdef F90_OPEN_FILE_APPEND
+     .		    POSITION    = fposition,
+#else
+     .		    ACCESS	= faccess,
+#endif
+     .		    STATUS	= fstatus,
+     .		    ERR		= 5010 )
+	   ELSEIF ( do_stream .AND. do_stream_phase.EQ.0 ) THEN	! 12/94
+	      reclen = 1  ! in bytes
+	      DO 60 i = 1, nvars2list
+	         IF ( mr_type(my_mr(i)) .EQ. ptype_string ) THEN
+	            reclen = MAX(reclen,
+     .			GET_MAX_STRING_LEN(my_cx(i), my_mr(i),
+     .					   memory(1,mr_blk1(my_mr(i))))+1 )
+	         ELSE
+	            reclen = MAX(reclen,4)
+	         ENDIF
+		 
+#ifdef double_p
+	         reclen = reclen * 2
+#endif
+
+ 60	      CONTINUE
+	      OPEN( UNIT	= default_list_lun,
+     .		    FILE	= raw_name,
+     .		    FORM	= 'UNFORMATTED',
+     .		    ACCESS	= 'DIRECT',
+     .		    STATUS	= fstatus,
+#ifdef reclen_in_bytes
+     .	            RECL	= reclen,
+#else
+     .	            RECL	= reclen/4,
+#endif
+     .		    ERR		= 5010 )
+	      do_stream_phase = 1		! for multi-variables
+	   ENDIF
+	   list_lun = default_list_lun
+	ENDIF
+
+* reserve working arrays (different needs for each listing type)
+	IF ( do_epic ) THEN
+	   wsize = 1
+	   DO 110 ilist = 1, nvars2list
+ 110	   wsize = MAX ( wsize, CX_DIM_LEN(t_dim,my_cx(ilist)) )
+	   wsize = 3. * wsize
+	ELSEIF ( do_multi ) THEN
+	   wsize = nvars2list* (2*nferdims+6)
+	ELSEIF ( all_at_once ) THEN
+	   wsize = nvars2list
+	ELSE
+* ... allocate enough space for the longest axis
+	   wsize = 1
+	   DO 112 idim = 1, nferdims
+ 112	   wsize = MAX( wsize, CX_DIM_LEN(idim,cx))
+	   IF (do_dods)THEN
+              wsize = 1
+              DO 113 idim = 1, nferdims
+ 113	        IF (CX_DIM_LEN(idim,cx) .GE. 1) 
+     .             wsize = wsize * CX_DIM_LEN(idim,cx)
+	   ENDIF
+	ENDIF
+	CALL GET_WORK_SPC( wsize, wkblk, status )
+	IF ( status .NE. ferr_ok ) GOTO 1000
+
+* special handling of EPIC data - no permutations
+	IF ( do_epic ) THEN
+	   CALL EPIC_LIST( raw_name, my_mr, my_cx, 
+     .			   memory(1, wkblk), wsize, status )
+	   GOTO 1000
+	ENDIF
+
+* permute data to the desired output order
+	IF ( all_at_once ) THEN
+* ... if no axis order was specified determine the permutation
+c bug fix: see err540_write_order.jnl move inside loop:
+c	   IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+	   DO 200 ilist = 1, nvars2list
+	      IF (.NOT.permute) CALL GET_CX_DIMS(my_cx(ilist),ndim,perm)
+	      CALL CREATE_PERMUTATION(	memory,
+     .					my_cx  (ilist),
+     .					my_mr  (ilist),
+     .					perm,
+     .					mr_perm(ilist), status )
+	      IF ( status .NE. ferr_ok ) GOTO 500
+              npermuted = npermuted + 1
+ 200	   CONTINUE
+
+* w/ the above fix, mr_perm is correct but perm needs to be reset.
+	   IF (.NOT.permute) CALL GET_CX_DIMS(cx,ndim, perm )
+	ELSE
+* ... if no axis order was specified use the first variable as default
+           IF ( .NOT.permute ) THEN
+	      CALL GET_CX_DIMS( cx, ndim, perm )
+* ... default listing for a line of data is a column
+	      IF (ndim.EQ.1) THEN
+	         i = perm(1)
+	         perm(1) = perm(2)
+	         perm(2) = i
+	      ENDIF
+	   ENDIF
+	   CALL CREATE_PERMUTATION(memory,cx,mr,perm,mr_perm,status)
+	   IF ( status .NE. ferr_ok ) GOTO 500
+           npermuted = npermuted + 1
+	ENDIF
+
+* list it
+!jli: for list in xml
+	IF (do_xml) THEN
+*           CALL NON_ARRAY_SUBSC( mr_perm, 1 )
+*           nn = mr_perm(1)
+*           CALL LIST_CMND_DATA_XML( memory(1, mr_blk1(mr_perm(1))),
+*     .                          nn, cx, memory(1, wkblk), 
+*     .                          heading, head_enh, recsofar, perm, 
+*     .                          clobber, raw_name, status)
+
+	ELSEIF ( do_cdf ) THEN
+	   CALL CDF_LIST( memory, raw_name( 1:TM_LENSTR1(raw_name)), 
+     .                    list_at_eof, cdf_recax, nvars2list,
+     .			  mr_perm, my_cx, buff, head_enh,
+     .			  pcdf_mode_normal, clobber, edges_flag, do_bounds,
+     .                    keepax_flag, out_type, status )
+
+	ELSEIF( all_at_once ) THEN
+	   CALL LIST_MULTI( memory, mr_perm, my_cx, heading, perm,
+     .			    wsize, memory(1, wkblk), status )
+	ELSE
+	   CALL NON_ARRAY_SUBSC( mr_perm, 1 )
+           nn = mr_perm(1)
+	   CALL LIST_CMND_DATA( memory(1, mr_blk1(mr_perm(1))),
+     .                          nn, cx, memory(1, wkblk), 
+     .                          heading, head_enh, recsofar, perm, 
+     .                          clobber, raw_name, status)
+	ENDIF
+
+* EXIT sequence
+* ... relinquish working space
+ 500	CALL RELEASE_WORK_SPC
+
+* ... close any special output device
+	IF ( normal_file ) CLOSE ( UNIT = list_lun, ERR = 5010 )
+
+* ... delete permuted data if it was created
+	DO 510 ilist = 1, npermuted
+	   mr = mr_perm(ilist)
+	   IF ( mr_protected(mr) .EQ. mr_temporary
+     .	   .OR. mr_protected(mr) .EQ. mr_table_entry_only )
+     .					CALL DELETE_VARIABLE( mr )
+	   IF ( .NOT.all_at_once ) THEN
+* ... loop back for next variable if appropriate
+	      inext = inext + 1
+	      IF ( do_stream) do_stream_phase = do_stream_phase + 1
+	      IF ( status.EQ.ferr_OK .AND. inext.LE.nvars2list ) THEN
+	         GOTO 100
+	      ELSE
+	         GOTO 1000
+	      ENDIF
+	   ENDIF
+ 510	CONTINUE
+
+ 1000   list_fmt_type = plist_default ! restore for next command
+	list_format_given = .FALSE.
+        CALL UNPROTECT_CMND_DATA
+	IF ( do_stream .AND. do_stream_phase.GT.0)
+     .			CLOSE ( UNIT = list_lun, ERR = 4999 )
+ 4999   RETURN
+
+* error exit(s)
+ 5000   GOTO 1000
+ 5010	CALL ERRMSG( ferr_erreq,status,filename(:flen),*1000 )
+ 5040	CALL ERRMSG( ferr_invalid_command, status,
+     .			'/EXTEND only allowed with CDF format', *1000 )
+ 5050	CALL ERRMSG( ferr_invalid_command, status,
+     .			'/CLOBBER not specified and file exists: '
+     .			//raw_name, *1000 )
+ 5060	CALL ERRMSG( ferr_invalid_command, status,
+     .		'LIST/HEADING=enhanced needs a /FORMAT qualifier'//pCR//
+     .		'	(format cannot be tab or comma)', *1000 )
+ 5070	CALL ERRMSG( ferr_invalid_command, status,
+     .		'In GUI mode LIST/FORMAT reguires a named /FILE=', *1000 )
+ 5080	CALL ERRMSG( ferr_invalid_command, status,
+     .			'/ORDER not allowed with V permutation (yet)', *1000 )
+     
+ 5090	CALL ERRMSG( ferr_prog_limit, status,
+     .  'Cannot write to file w/ name longer than 256 characters: '//pCR//
+     .  'Limitation of Fortran INQUIRE and OPEN calls '	
+     .			, *5000 )
+     
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Unrecognized option/'//
+     .          cmnd_buff(qual_start(i):qual_end(i)) //pCR//
+     .		' Valid options are /OUTTYPE=DOUBLE,FLOAT,INT,SHORT,or BYTE', *1000 )
+	END
+
+
diff --git a/fer/xeq/xeq_load.F b/fer/xeq/xeq_load.F
new file mode 100644
index 0000000..d7c5730
--- /dev/null
+++ b/fer/xeq/xeq_load.F
@@ -0,0 +1,139 @@
+	SUBROUTINE XEQ_LOAD( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the LOAD command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/4/87
+* revision 0.1 - 9/16/87 - added want_cmnd_data to GET_CMND_DATA call
+* revision 2.0 - 3/10/88 - added LOAD/NAME=
+* revision 2.1 - 3/23/88 - enlarged cx_DIM_STR to accomodate date/time strings
+* revision 2.2 - 8/15/88 - changed /NAME= re-cataloging procedure for new
+*			   memory management routines
+* revision 2.3 - 10/7/88 - remove in-plane transforms, too and re-catalog
+* revision 2.4 -11/21/88 - new TM IO library GET_LIKE_GRID --> TM_GET_LIKE_GRID
+*					     TRANSFER_GRID --> TM_COPY_GRID
+* V200:  6/9/89 - deleted variables flagged in mr_protected
+*		- /NAME= eliminated
+*	12/15/89- fixed error check for LOAD/PERM expression
+*	  5/1/90- added code so LOAD/TEMP works
+*		  still flawed: doesn't detect region gt requested
+*		- and bixed del_flink/blink bug in LOAD/PERM
+* V230: 8/11/92 - double load of /PERMANENT got subscript error
+* V312: 5/94 - array "memory" as a calling argument
+* V530: *sh* 9/00 - added initial data type support in get_cmnd_data 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* local parameter definitions:
+	INTEGER	slash_perm, slash_temp, slash_name
+	PARAMETER     ( slash_temp = 1,		! (default)
+     .			slash_perm = 2,
+     .			slash_name = 16 )
+
+* calling argument declarations:
+	REAL	memory(*)
+
+* local variable declarations:
+	LOGICAL		EXPLICIT_UVAR, permanent, named, temp
+	INTEGER		status, iload, mr, next, prev, last_head
+
+* initialize
+	named	  = qual_given( slash_name ) .GT. 0
+	permanent = qual_given( slash_perm ) .GT. 0
+	temp	  = qual_given( slash_temp ) .GT. 0
+
+* save the data under a given name
+	IF ( named ) CALL ERRMSG( ferr_invalid_command, status,
+     .		'/NAME= no longer supported - use DEFINE VARIABLE', *5000 )
+	
+* get the requested data somehow
+	CALL GET_CMND_DATA ( memory, cx_last, ptype_native, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* set protections as indicated (check for already protected 8/92)
+	IF ( permanent ) THEN
+	   DO 400 iload = 1, num_uvars_in_cmnd
+	      mr = is_mr( iload )
+	      IF ( mr_category( mr ) .EQ. cat_user_var ) THEN
+	         IF ( .NOT.EXPLICIT_UVAR(mr_variable(mr)) ) CALL ERRMSG
+     .			( ferr_invalid_command, status,
+     .			'Cannot LOAD/PERM "expression".  Use DEFINE VARIABLE',
+     .			 *5000 )
+	      ENDIF
+              IF ( mr_protected(mr) .NE. mr_perm_protected ) THEN  ! 8/92
+	         mr_protected( mr ) = mr_perm_protected
+* ... remove from deletion priority chain
+	         prev = mr_del_blink(mr)
+	         next = mr_del_flink(mr)
+	         mr_del_flink(prev) = next
+	         mr_del_blink(next) = prev
+	         mr_del_flink( mr ) = unspecified_int4	! temp diag
+	         mr_del_blink( mr ) = unspecified_int4	! temp diag
+              ENDIF
+ 400	   CONTINUE
+
+* LOAD/TEMPORARY - explicitly specified to reverse /PERMANENT
+	ELSEIF ( temp ) THEN
+	   DO 500 iload = 1, num_uvars_in_cmnd
+	      mr = is_mr( iload )
+	      IF ( mr_protected( mr ) .EQ. mr_perm_protected ) THEN
+	         mr_protected( mr ) = mr_not_protected
+* ... restore at head of deletion priority chain
+	         last_head = mr_del_flink(0)
+	         mr_del_blink(mr) = 0
+	         mr_del_flink(mr) = last_head
+	         mr_del_flink(0)  = mr
+	         mr_del_blink(last_head) = mr
+	      ENDIF
+ 500	   CONTINUE
+
+	ENDIF
+
+	RETURN
+
+* error exit(s)
+ 5000	RETURN
+	END
diff --git a/fer/xeq/xeq_message.F b/fer/xeq/xeq_message.F
new file mode 100644
index 0000000..28881c9
--- /dev/null
+++ b/fer/xeq/xeq_message.F
@@ -0,0 +1,175 @@
+	SUBROUTINE XEQ_MESSAGE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the MESSAGE command
+
+* MESSAGE text of message	- displays message, prompts for <CR> and waits
+* MESSAGE/QUIET text		- displays message and waits for <CR>
+* MESSAGE/CONTINUE text		- displays message and continues
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 9/10/86
+* V230:  7/30/92 - bug fix: avoid final quote ("hello" comes out 'hello"' now)
+*        8/11/92 - allow blank messages (blank line on output)
+*       12/15/92 - pause w/ TM_FRIENDLY_READ so SGI's w/out backing store work
+*                - and fix non-functioning of /QUIET on Unix (was .NOT.integer)
+* V300:  4/22/93 - fix treatment of enclosing quotes with ALL_1_ARG
+*	 6/16/93 - different prompts, etc. for GUI control
+*		 - interrupt if GUI interrupt sequence is received
+* V314	8/25/94 *kob* IBM port - need to correct syntax error
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 2/28/95 - SPLIT_GUI_MESSAGE --> TM_SPLIT_MESSAGE
+* Linux Port - *kob* 12/96 - had to put single quotes around hello 
+*			     in comment up above - linux f90 freaked out.
+*       10.28.98 *js* Don't pause for messages if in server mode
+* V510 5/00 *sh* - added MESSAGE/JOURNAL
+* V520 6/00 *sh* - added MESSAGE/ERROR
+* V650 3/10 *acm - added MESSAGE//OUTFILE= /APPEND /CLOBBER
+
+	include 'ferret.parm'
+	include 'tmap_dims.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+        include 'xrisc.cmn'
+        include 'xgui.cmn'
+	include 'xplot_state.cmn'
+
+* local parameter declarations
+	INTEGER		slash_continue, slash_quiet, slash_journal,
+     .			slash_error, slash_file, slash_append, 
+     .			slash_clobber
+	PARAMETER     (	slash_continue	  = 1,
+     .			slash_quiet	  = 2,
+     .			slash_journal	  = 3,
+     .			slash_error	  = 4,
+     .			slash_file	  = 5,
+     .			slash_append	  = 6,
+     .			slash_clobber	  = 7)
+	
+* local variable declarations
+	LOGICAl append, clobber
+	INTEGER status, wsid, slen, rlen, sho_file
+	PARAMETER (slen=1024)
+	CHARACTER tmpfile*1024
+#ifdef sun
+        BYTE      ctmpfile(slen)
+#else
+        INTEGER*1 ctmpfile(slen)
+#endif
+	LOGICAL IS_SERVER
+
+* treat all text as a single argument
+	CALL ALL_1_ARG
+
+* write the message if one has been supplied
+	IF ( num_args .EQ. 1 ) THEN
+
+* ... message to stderr
+	   IF ( qual_given( slash_error ) .GT. 0 ) THEN
+	      WRITE (err_lun, '(A)')
+     .				cmnd_buff(arg_start(1):arg_end(1))
+	      RETURN
+
+* ... message to a named file
+	   ELSEIF ( qual_given( slash_file ) .GT. 0 ) THEN
+	      sho_file = qual_given( slash_file )
+	      clobber = qual_given( slash_clobber ) .GT. 0
+	      append = qual_given( slash_append ) .GT. 0
+
+	      IF (sho_file .GT. 0) CALL OPEN_SHOW_FILE (show_lun, 
+     .                       sho_file, clobber, append, status)
+	      IF (status .NE. ferr_ok ) GOTO 2000
+	      CALL TM_SPLIT_MESSAGE( show_lun,
+     .				cmnd_buff(arg_start(1):arg_end(1)) )
+     
+* ... close the file
+	      CLOSE ( UNIT = show_lun, ERR = 2000 )
+	      
+* ... message logged in journal file
+	   ELSEIF ( qual_given( slash_journal ) .GT. 0 ) THEN
+	      IF (mode_journal .AND. jrnl_lun.NE.unspecified_int4) THEN
+	         WRITE (jrnl_lun, '(A)')
+     .				cmnd_buff(arg_start(1):arg_end(1))
+	         RETURN
+	      ELSE
+	         RETURN   ! journal file isn't open
+	      ENDIF
+
+* ... message to operator
+	   ELSE
+	      CALL TM_SPLIT_MESSAGE( ttout_lun,
+     .				cmnd_buff(arg_start(1):arg_end(1)) )
+
+	   ENDIF
+
+* no message supplied. Just send a CR
+        ELSEIF ( qual_given(slash_continue) .GT. 0
+     .	 .AND.  .NOT.mode_gui ) THEN
+              WRITE ( ttout_lun, * ) 
+        ENDIF
+
+* continue or wait ?
+	IF ( qual_given( slash_continue ) .GT. 0
+     .	.OR. mode_gui) RETURN
+
+* do not wait if in server mode
+        IF  (IS_SERVER()) then
+           RETURN
+        ENDIF
+
+* pausing, so make sure the graphics (if any) are updated
+        CALL FGD_CONSIDER_UPDATE(.TRUE.)
+
+* prompt for <CR> ?
+* (in gui mode ferret_dispatch will send a flag back to the GUI)
+	IF ( qual_given( slash_quiet ) .EQ. 0 ) THEN
+	   WRITE ( ttout_lun, * ) ' Hit Carriage Return to continue'
+	ENDIF
+
+* wait for continue signal (use TM_FRIENDLY_READ 12/92)
+        CALL TM_FRIENDLY_READ(' ', risc_buff, *1000 )
+
+* check for interrupt character signal "^>"
+ 1000	IF ( risc_buff(1:1) .EQ. gui_char
+     . .AND. risc_buff(2:2) .EQ. '>' )  CALL ERRMSG( ferr_interrupt,
+     .						     status, ' ', *2000 )
+
+ 2000	RETURN
+	END
diff --git a/fer/xeq/xeq_plot.F b/fer/xeq/xeq_plot.F
new file mode 100644
index 0000000..1a09f9c
--- /dev/null
+++ b/fer/xeq/xeq_plot.F
@@ -0,0 +1,752 @@
+	SUBROUTINE XEQ_PLOT( memory )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the plot command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 7/8/87  - based on XEQ_CONTOUR rev. 0.3
+* revision 0.1 - 7/28/87 - added CALL DISP_PREP
+* revision 0.2 - 3/2/88  - added safety check for data range prior to plotting
+* revision 0.3 - 4/12/88 - added /NOLABELS
+* revision 0.4 - 4/28/88 - moved rev. 0.2 check to PLOT_SET_UP
+* revision 0.5 - 8/2/88  - added mode wait
+* revision 1.0 - 9/21/88 - do_labels --> no_labels: /NOLABEL processing chged
+* V200:   1/8/89 - using keys - major rewrite
+*	 3/13/90 - check status from DISP_PREP
+*	  5/8/90 - allow PLOT/VS to overlay 2D fields
+* V230:  7/23/92 - when /LINE_STYLE is given /SYMBOLS must default to OFF
+* V301:	  1/7/94 - bug fix: (see DISP_DATA_SET_UP) must unprotect plot data
+*        1/27/94 - raise limit on /LINE=# from num_plain (6) to num_fancy_lines
+* V312: 5/94 - array "memory" as a calling argument
+* V320:   1/20/94 - changes to SAVE_FRAME call reflecting C-based procedures
+*	  1/27/95 - default style for /VS is now /SYMBOLS_ONLY
+* V450:  5/29/97 - added /NOAXES qualifier
+* V500   4.27.99 - *jd* NLINES command added to clean up after/before POLYGON
+* V510 *sh* 3/00 - added PLOT/COLOR=/SIZE= qualifiers
+* V521 6/00 *sh* - bug fix: PLOT/LINE/SYM should auto-select colors
+* V530 *sh* 1/01 - added PLOT/STEP
+* V530 *acm* 5/01 - added PLOT/DASH
+*	            and PLOT/SYMBOL=dot
+* V533 *acm* 6/01 - add arguments is_logh, is_logv to PLOT_SET_UP call, 
+*                  set log axes, inverse log axes and log depth axes with
+*                  /VLOG or /HLOG
+*      *acm* 7/01 - Add /AXES=TOP,BOT,LEFT,RIGHT
+*		    & call ax_on_off to implement /NOAXES.
+*      *acm* 10/01  remove VMS includes
+* V540 *acm*  2/02  restore persistence of PPL AXSET settings
+* V541 *acm*  3/02  Make PPL AXSET settings persist, but not settings
+*                   done with qualifiers /AXES= or /NOAXES
+* V541 *acm*  3/02  Allow PLOT/VS/LINE/DASH
+* V541 *ACM*  8/02  Remove the call with dot_sym=99 for PLOT/SYM=DOT-- need
+*                      to resolve PPLUS issues with polymark first.
+* V550 *acm* 12/02  Restore dot_sym = 99 and warnings that /THICK and /SIZE 
+!                    do not apply to DOT
+* v554 *acm* 11/03  Bug fix: plot/sym/size=  didnt change the size; the size
+*                   was always being reset to the default, not just on sym=dot.
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* V580: *acm*11/04 add PLOT/NOKEY qualifier (bug 1089)
+* V580 *acm*11/04  (bug 1085) Allow JFness to be set when cycling through colors 
+*                  automatically. In call to line_style, when color = -11  then 
+*                  thin line, color=-21 then JF=2, when color=-31 then thick=3
+* V581 *acm* 5/05  fix bug 1250: step=connected. Need to use EQUAL_STR to get the
+*                  argument to /STEP, then compare to see if it equals uppercase 'CON'
+* V600 *acm* 5/06  increase length of buff, for longer arugments to /DASH=
+* V600 *acm* 5/06  with MODE LINECOLORS, number of lines not limited to num_fancy_lines
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+* V612 *acm*  8/08 Fixing bug 1038. No Valid Data labeled as on 2D plots. If 
+*                  there is no valid data, get the info from plot_set_up and add 
+*                  a to the plot. If this is an overlay, that is added to the label
+*                  in plot_set_up.
+* V612 *acm* 10/08 No Valid Data labeled If there is no valid data, only add this
+*                  information to the label in plot_set_up. (see bugs 1038 and 1565)
+* V6.2  *acm* 11/08Fix bug 1609: If the plot is an overlay then do not process /AXES=
+*                  or /NOAXES. Axes are never drawn for overlays anyway.
+* V6.2  *acm& 2/09 Fix choice of color settings with /PEN and /THICK when we have 
+*                  increased the num of colors with MODE linecolors
+* V6.85 *acm* 3/13 Fix ticket 2049; check we can open palette file
+* PyFr  *kms* 7/13 EQUAL_COLOR now returns a color ID, and EQUAL_THICK 
+*                  returns a pen ID from a color ID and a thickness.
+* PyFr  *kms* 7/13 Added /OPACITY
+* V6.85 *acm* 9/13 New qualifier PLOT/%%%%%%% for first color in multi-line plot
+* http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2013/msg00536.html
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'PPLDAT.INC'
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'    ! wsid
+	
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL		overlay, transpz, versus,
+     .			no_labels, set_up, noaxes, axes, use_line,
+     .			is_logh, is_logv, nokey, no_data, no_range,
+     .			continuous_key, do_key, spectrum
+	INTEGER		TM_LENSTR1, STR_UPCASE, STR_SAME,
+     .                  symbol, icolor, ipen, icolor1, ipen1, status,
+     .			loc, limit, slen, thick, step_inc,
+     .			ax1_blks, ax1_start,
+     .			ax2_blks, ax2_start,
+     .			do_dash, s1, s2, it_start(4), it_end(4),
+     .			nparm, dot_sym, num_it, i, iax(4), i1,
+     .                  loch, locv
+	REAL		val, sym_size, dashstyle(4), only_val
+        REAL*4          thickness, opacity
+	CHARACTER	LEFINT*4, buff*128
+	
+	CHARACTER	TM_FMT*12, TM_INQ_PATH*2048, sfile*2048
+	INTEGER ncolors
+
+* internal parameter declarations
+	PARAMETER (dot_sym=99)
+
+* set up the graphics environment and get the data
+	CALL START_PPLUS(.FALSE.)
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+        ncolors = mode_arg(pmode_linecolors,1)
+
+* Initialize the lines buffer in PPL before setting up
+	overlay   = qual_given( slash_plot_over_plot ).GT.0
+	if (overlay) SOVER = .true.
+
+	if (sover) then
+CC      *jd* NLINES initializes SOVER, and resets MIN/MAX. Don't execute. 
+CC       => Set values here instead.
+	   LINEN=0
+	   IBASE=1
+	   PBUF=0
+	   LNUM=1
+	else
+	   CALL PPLCMD ( from, line, 0, 'NLINES', 1, 1 )
+	endif
+
+* initialize
+	no_labels = qual_given( slash_plot_nolabels  ).GT.0
+	transpz   = qual_given( slash_plot_transpz   ).GT.0
+	versus    = qual_given( slash_plot_vs	     ).GT.0
+	set_up	  = qual_given( slash_plot_set_up    ).GT.0
+	noaxes    = qual_given( slash_noaxes         ).GT.0
+	axes      = qual_given( slash_plot_axes      ).GT.0
+        IF (overlay) THEN
+	   noaxes = .FALSE.
+	   axes = .FALSE.
+	ENDIF
+	is_logh   = qual_given( slash_is_logh        ).GT.0
+	is_logv   = qual_given( slash_is_logv        ).GT.0
+
+	symbol	  = unspecified_int4
+	sym_size  = 0.08	! default plot mark size
+	thick	  = 1		! default thickness
+	icolor    = qual_on	! automatic selection as default
+	step_inc  = 1
+        do_dash   = 0		! default no dashes
+
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,is_cx,num_uvars_in_cmnd)
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* change default style to symbols, only if PLOT/VS (1/27/95)
+	IF ( versus ) THEN
+	   symbol = qual_on
+	   use_line = .FALSE.
+	ELSE
+	   use_line = .TRUE.
+	ENDIF
+
+* decode qualifiers
+* ... PLOT/SYMBOL=n
+	loc = qual_given( slash_plot_symb )
+	IF ( loc .GT. 0  ) THEN
+
+*  Is it SYMBOL=DOT?
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF (buff .EQ. 'DOT') THEN
+              symbol = dot_sym
+           ELSE
+
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      val, status )	! syntax check
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+
+	      IF ( val .NE. unspecified_val4 ) THEN
+	         limit = max_sym 
+	         IF ( val.LE. 0.0 .OR. val.GT.limit ) GOTO 5200
+	         symbol = NINT( val )	! user-specified symbol
+	      ELSE
+	         symbol = qual_on		! auto selection of symbols
+	      ENDIF
+           ENDIF
+	   use_line = .FALSE.		! default to no line w/ symbol
+	ENDIF
+* ... PLOT/SYM_SIZE=float
+	loc = qual_given( slash_plot_symsize )
+	IF ( loc .GT. 0  ) THEN
+	   IF ( symbol .EQ. unspecified_int4 ) THEN
+	       symbol = qual_on		! turn on symbols if needed
+	       use_line = .FALSE.
+	       icolor = 1
+	   ENDIF
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      val, status )	! syntax check
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( val .NE. unspecified_val4 ) THEN
+	      IF ( val.LE. 0.0 ) GOTO 5210
+	      sym_size = val		! user-specified symbol
+              IF ( symbol .EQ. dot_sym) THEN
+                 CALL WARN ('/SIZE= ignored  on /SYMBOL=DOT ')
+                 sym_size = 0.08
+              ENDIF
+	   ENDIF
+	ENDIF
+* ... PLOT/COLOR[=n]
+        icolor1 = 1
+        thickness = 1.0
+	loc = qual_given( slash_plot_color )
+	IF ( loc .GT. 0  ) THEN
+	   icolor1 = icolor
+	   CALL EQUAL_COLOR( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                       icolor, thickness, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           s1 = INDEX( cmnd_buff(qual_start(loc):qual_end(loc)), '=' )	   
+           IF ( s1 .EQ. 0 ) THEN
+	      icolor = icolor1
+	      icolor1 = 2
+	      IF ( overlay ) GOTO 5510  ! /COLOR w/o argument not allowed for overlay
+	   ENDIF
+	ENDIF
+* ... PLOT/OPACITY=n
+        loc = qual_given( slash_plot_opacity )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_VAL(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    val, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           IF ( (val .LT. 0.0) .OR. (val .GT. 100.0) ) GOTO 5500
+           opacity = val / 100.0
+           IF ( icolor .GE. 0 )
+     .        CALL DUP_COLOR_SET_OPACITY(wsid, icolor, opacity)
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ELSE
+*          overriding opacity not specififed
+           opacity = -1.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ENDIF
+* ... PLOT/THICKNESS=n
+ 	loc = qual_given( slash_plot_thick )
+	IF ( loc .GT. 0  ) THEN
+           IF ( symbol .EQ. dot_sym) THEN
+              CALL WARN ('/THICKNESS ignored  on /SYMBOL=DOT ')
+*             convert the color ID into a (thin) pen ID
+*             note that thickness is explicitly REAL*4 (not REAL)
+              thickness = 1.0
+              CALL EQUAL_THICK(' ', thickness, icolor, ipen, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ELSE
+              CALL EQUAL_THICK(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                         thickness, icolor, ipen, status)
+              IF ( status .NE. ferr_ok ) GOTO 5000
+           ENDIF
+        ELSE
+*          /THICK not given; convert color ID to pen ID using default thickness
+           CALL EQUAL_THICK(' ', thickness, icolor, ipen, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ENDIF
+* ... PLOT/LINE_STYLE=n
+	loc = qual_given( slash_plot_line )
+	IF ( loc .GT. 0  ) THEN
+	   use_line = .TRUE.
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      val, status )	! syntax check
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( val .NE. unspecified_val4 ) THEN
+              limit = 3*mode_arg(pmode_linecolors,1)
+	      ipen = NINT( val )	! user-specified line style
+	      IF ( ipen .LT. 1 .OR. ipen .GT. limit ) GOTO 5200
+              IF ( opacity .GE. 0.0 )
+     .           CALL DUP_STD_PEN_SET_OPACITY(wsid, ipen, opacity)
+	   ENDIF
+* ... default to no symbols when /LINE_STYLE, alone, is given
+* 	or for PLOT/VS/LINE  (1/27/95)
+           IF ( symbol .EQ. unspecified_int4
+     .	   .OR. (versus.AND.qual_given(slash_plot_symb).EQ.0) ) 
+     .							symbol = qual_off
+	ENDIF
+
+* ... PLOT/RIBBON  for multi-colored "ribbon" line 
+*     3-agument plot/vs/lev xpts, ypts, var
+
+	ribbon_plot = .FALSE.
+	loc = qual_given( slash_plot_ribbon )
+	IF ( loc .GT. 0  ) THEN
+c	   IF (.NOT.versus)  GOTO 5470
+
+	   IF (versus) THEN
+	      IF (num_uvars_in_cmnd .LT. 3) GOTO 5480
+	      IF (num_uvars_in_cmnd .GT. 3)
+     .         CALL WARN (
+     .         'PLOT/RIBBON/VS uses just 3 variables. Ignoring extra variables.')
+           ELSE
+	      IF (num_uvars_in_cmnd .LT. 2) GOTO 5480
+	      IF (num_uvars_in_cmnd .GT. 2)
+     .         CALL WARN (
+     .         'PLOT/RIBBON/LEVELS uses just 2 variables. Ignoring extra variables.')
+           ENDIF
+
+* If a color was given, that's not valid for Ribbon plots.
+	   loc = qual_given( slash_plot_color )
+	   IF ( loc .GT. 0  ) GOTO 5490
+
+* If a thickness is given, set pen number to the thickness, pen=1,2,or 3
+
+	   ipen = 1
+ 	   loc = qual_given( slash_plot_thick )
+	   IF ( loc .GT. 0  ) THEN
+
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   val, status )
+
+	      IF ( val .NE. unspecified_val4 ) THEN
+	         thick = NINT( val )	! user-specified line style
+	      ELSE
+	         thick = 2  ! default if no value is specified
+	      ENDIF
+	      ipen = thick 
+	   ENDIF
+	   
+	   ribbon_plot = .TRUE.
+	ENDIF
+
+* Style: fast for one-color per point, default is to interpolate
+* colors between points
+
+           loc = qual_given( slash_plot_fast  )
+           IF ( loc.GT.0 ) THEN
+     		CALL PPLCMD ( from, line, 0, 'RIBFAST 1', 1, 1 )
+           ELSE
+     		CALL PPLCMD ( from, line, 0, 'RIBFAST 0', 1, 1 )
+           ENDIF
+
+* Missing: how to represent missing color-values. Default is
+* thin black line. Can request /missing=dash, /missing=blank, 
+* /missing= color-palette (e.g. gray_light). The color palette 
+* will typically be a one-color plot, or if a multicolor palette 
+* is given its first color will be used.
+
+* (call this BEFORE setting the main color palette for ribbon plot; so that
+* the setting for palette type: percent, by_level, or by_value is set for the
+* specified palette.)
+
+           loc = qual_given( slash_plot_missing  )
+           IF ( loc.GT.0 ) THEN
+              CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .             buff, status )
+              IF ( status .NE. ferr_ok ) RETURN
+
+	      IF (STR_SAME (buff(1:4), 'blan') .EQ. 0) THEN
+                 CALL PPLCMD ( from, line, 0, 'RIBMISS BLANK', 1, 1 )
+              ELSEIF ( buff .EQ. ' ' ) THEN
+                 CALL PPLCMD ( from, line, 0, 'RIBMISS DEFAULT', 1, 1 )
+	      ELSE
+                 CALL PPLCMD ( from, line, 0, 'RIBMISS SPECTRUM='//buff, 1, 1 )
+	      ENDIF
+           ELSE
+	      CALL PPLCMD ( from, line, 0, 'RIBMISS DEFAULT', 1, 1 )
+           ENDIF
+
+* ... PLOT/PALETTE=  for multi-colored "ribbon" line 
+*     3-agument plot/lev/palette xpts, ypts, var
+
+* save old and reset to new color spectrum if requested
+
+        IF (ribbon_plot) THEN
+           loc = qual_given( slash_plot_spectrum  )
+           IF ( loc.GT.0 ) THEN
+              CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .             buff, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( buff .EQ. ' ' ) buff = 'default'
+
+	      slen = TM_LENSTR1(buff)
+              sfile = TM_INQ_PATH (buff(:slen),'FER_PALETTE','.spk',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+
+              CALL PPL_SHASET( 'SAVE' )
+              CALL PPL_SHASET( 'SPECTRUM='//buff(1:TM_LENSTR1(buff)) )
+	      spectrum = .TRUE.
+
+           ENDIF
+
+
+* default key
+	   do_key =  (qual_given(slash_plot_key)  .GT. 0)
+     .		.OR. ( (qual_given(slash_plot_key) .EQ. 0)
+     .           .AND. .NOT.overlay
+     .           .AND. .NOT.no_data )
+	   IF (qual_given(slash_plot_nokey) .gt. 0) do_key = .FALSE.
+           IF ( do_key ) THEN
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 1,1', 1, 1 )
+
+* ... /KEY[=continouus] ?
+              loc = qual_given( slash_plot_key )
+
+              IF ( loc .GT. 0) THEN
+	         CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         IF ( buff(1:3) .EQ. 'CON' ) THEN
+                    continuous_key = .TRUE.
+                    CALL PPLCMD (from, line, 0, 'S_KEY 1', 1, 1 )
+                 ENDIF
+              ENDIF
+
+           ELSE
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 0,1', 1, 1 )
+           ENDIF
+
+
+	ENDIF  ! ribbon plot
+
+
+* ... PLOT/STEP[=CONNECTED]
+	loc = qual_given( slash_plot_step )
+	IF ( loc .GT. 0  .AND. .NOT.versus ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( buff(1:3) .EQ. 'CON' ) THEN
+	      step_inc = 2	    
+	   ELSEIF ( buff(1:3) .EQ. ' ' ) THEN
+	      step_inc = 3
+	   ELSE
+	      GOTO 5220
+	   ENDIF
+	ENDIF	   
+
+* ... PLOT/DASH=(dn1,up1,dn2,up2)
+*     3/02 No reason we can't do PLOT/VS/DASH 
+
+	loc = qual_given( slash_plot_dash )
+c	IF ( loc .GT. 0  .AND. .NOT.versus ) THEN
+	IF ( loc .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           do_dash = 1
+
+           DO 100 i = 1, 4
+              dashstyle(i) = 0.
+ 100       ENDDO
+
+	   IF ( buff .NE. ' ' ) THEN
+* Check for optional parentheses
+
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5420
+              ENDIF
+
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, num_it,
+     .             it_start, it_end, status)
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN
+                 DO 200 i = 1, 4
+                    dashstyle(i) = 0.
+ 200             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5420
+              ELSE
+                 DO 300 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) dashstyle(i)
+                    IF (dashstyle(i) .LT. 0.) GOTO 5430
+ 300             CONTINUE
+              ENDIF
+           ENDIF
+              
+	ENDIF	   
+
+
+* ... PLOT/hgrat[=dash or line, color=, JF[=] ] default is line
+*     hgrat line type: 0=tics only, 1=dash 2=line
+
+	loch = qual_given(slash_plot_hgrat)
+
+* ... PLOT/vgrat[=dash or line, color=, JF[=] ] default is line
+*     vgrat line type: 0=tics only, 1=dash 2=line
+
+	locv = qual_given(slash_plot_vgrat)
+
+        IF (loch .EQ. 0  .AND. locv .EQ. 0) THEN
+           loch = qual_given(slash_plot_grat)
+           locv = qual_given(slash_plot_grat)
+        ENDIF
+
+        CALL set_graticules(loch, locv, status)
+
+* ... PLOT/NOKEY  (default is key on)
+
+	nokey = qual_given(slash_plot_nokey) .GT. 0
+
+* set up the axes and title and load the data into PPLUS
+
+	CALL PLOT_SET_UP   ( 	memory,
+     .				overlay,
+     .				transpz,
+     .				versus,
+     .				no_labels,
+     .				symbol,
+     .				sym_size,
+     .				ipen,
+     .				icolor1,
+     .				use_line,
+     .				step_inc,
+     .				do_dash,
+     .				dashstyle,
+     .				is_logh, 
+     .				is_logv,
+     .                          nokey,
+     .				no_range,
+     .				only_val,
+     .				is_mr,
+     .				is_cx,
+     .				num_uvars_in_cmnd,
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+c when it's an overlay, 'No Valid Data' is part of the plot key,
+c done in plot_set_up.
+
+* is the no valid input data?
+              no_data =  no_range .AND. only_val.EQ.bad_val4
+
+* turn off axes? 
+	IF ( noaxes ) THEN 
+           DO 400 i = 1, 4
+              iax(i) = 0
+ 400       ENDDO
+        ENDIF
+
+* turn on (one or more) axes? (7/11/01)
+
+* ... PLOT/AXES=(TOP,BOTTOM,LEFT,RIGHT)
+	IF ( axes ) THEN
+           loc = qual_given( slash_plot_axes )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   IF ( buff .NE. ' ' ) THEN
+
+* Get arguments, if any.  Otherwise turn on all axes
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5440
+              ENDIF
+
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, 
+     .             num_it, it_start, it_end, status)
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN	! /AXES=()
+                 DO 500 i = 1, 4
+                    iax(i) = 0
+ 500             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5440
+              ELSE
+                 DO 600 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) iax(i)
+                    IF (iax(i) .LT. 0  .OR.  iax(i) .GT. 1) GOTO 5450
+ 600             CONTINUE
+              ENDIF
+           ELSE		! turn on all axes
+	      DO 700 i = 1, 4
+		 iax(i) = 1
+ 700	      CONTINUE
+           ENDIF
+              
+	ENDIF
+
+*  Turn off or on axes, including time axes.
+        IF (axes .OR. noaxes) CALL ax_on_off (iax)
+
+* /set_up only requested ?
+	IF ( set_up ) GOTO 1000
+
+* plot it 
+	IF (ribbon_plot) THEN
+	   IF ( overlay ) THEN
+	      CALL PPLCMD ( ' ', ' ', 0, 'RIBBON/OVER/' //ppl_wait//' ', 1, 1 )
+	   ELSE
+	      CALL PPLCMD ( ' ', ' ', 0, 'RIBBON/LATCH/'//ppl_wait//' ', 1, 1 )
+	   ENDIF
+ 
+	ELSE
+	
+	   IF ( overlay ) THEN
+	      CALL PPLCMD ( ' ', ' ', 0, 'PLOT/OVER/' //ppl_wait//' ', 1, 1 )
+	   ELSE
+	      CALL PPLCMD ( ' ', ' ', 0, 'PLOT/LATCH/'//ppl_wait//' ', 1, 1 )
+	   ENDIF
+	ENDIF
+
+* clear the overriding opacity
+        opacity = -1.0
+        CALL SET_OVERRIDE_OPACITY(opacity)
+
+* restore axes? (5/29/97  revised 3/2002
+c        IF ( axes .or. noaxes ) CALL PPL_AXES_RESTORE
+
+* restore dash settings? (5/29/97  revised 3/2002
+        IF ( do_dash .EQ. 1 ) CALL PPL_DASH_RESTORE
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ?
+	IF ( qual_given( slash_plot_frame ) .GT. 0 ) THEN
+	   CALL SAVE_FRAME( frame_file, "HDF", status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+*  Save log axis state
+
+	IF (overlay) THEN
+	   is_logh = h_logaxis
+	   is_logv = v_logaxis
+	ELSE
+	   h_logaxis= is_logh
+	   v_logaxis = is_logv 
+	ENDIF
+	
+* Ribbon plot? protect the new colors and restore the original color spectrum
+           IF ( spectrum ) THEN
+*              PyFerret does not need to protect colors after using them
+*              CALL PPL_SHASET( 'PROTECT' )
+              CALL PPL_SHASET( 'SPECTRUM' )
+           ENDIF
+
+
+* release the memory used for axis buffers
+ 1000	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+ 5200	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Legal range is 1 to '//LEFINT(limit,slen), *1000 )
+ 5210	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Symbol size must be positive ', *1000 )
+ 5220	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'optionally /STEP=connected', *1000 )
+ 5300   CALL ERRMSG (ferr_file_not_found, status, 
+     .          'unable to open "' //
+     .	buff(:slen)//'.spk" to set ribbon-plot colors.', *1000)
+ 5400	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Legal range is 1 to 3', *1000 )
+ 5420	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'DASH[=(dn1,up1,dn2,up2)] takes 4 arguments or no argument', *1000 )
+ 5430	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'DASH arguments must be positive', *1000 )
+ 5440	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'AXES[=(TOP,BOTTOM,LEFT,RIGHT)] takes 4 arguments or no argument', *1000 )
+ 5450	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'AXES arguments must be 0 or 1', *1000 )
+ 5470	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'Ribbon plot PLOT/LEVELS valid only with /VS', *1000 )
+ 5480	IF (versus) THEN
+           CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	   'PLOT/VS/LEVELS ribbon plot needs 3 arguments', *1000 )
+	ELSE
+           CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	   'PLOT/LEVELS ribbon plot needs 2 arguments', *1000 )
+	ENDIF
+ 5490	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'/COLOR not valid for PLOT/LEVELS ribbon plot', *1000 )
+ 5500   CALL ERRMSG( ferr_out_of_range, status,
+     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .          'Value from 0 to 100 must be given', *1000 )
+ 5510	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'/COLOR must have an argument for PLOT/OVERLAY', *1000 )
+	END
diff --git a/fer/xeq/xeq_polygon.F b/fer/xeq/xeq_polygon.F
new file mode 100644
index 0000000..ced72eb
--- /dev/null
+++ b/fer/xeq/xeq_polygon.F
@@ -0,0 +1,549 @@
+	SUBROUTINE XEQ_POLYGON( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the POLYGON command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500:  *sh* and *jd*
+*        *jd  fix for v5.01 for fill if /patt or /pal given 6.7.99
+*        *sh* 6/99 -- suppress color key for 2-argument version of command
+* V510:  *sh* 3/00 -- change to how line specifications are passed
+
+* V533 *acm*6/01 - add arguments is_logh, is_logv to PLOT_SET_UP call, 
+*                  set log axes, inverse log axes and log depth axes with
+*                  PLOT/VLOG or PLOT/HLOG
+* V541 *acm*  3/02  Make PPL AXSET settings persist, but not settings
+*                   done with qualifiers /AXES= or /NOAXES.
+* v541 *acm*  5/02 add option to control outline on the shade key boxes 
+*                   /KEY=continuous
+* v554 *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* v580 *acm* 6/15/04 In the workaround which does a PPL LEV command for data with
+*                    a single value, need to give the PPL command the value with  
+*                    more precision.
+* V581 *acm* 5/05  fix bug 1249: /KEY=CONT. Need to use EQUAL_STR to get the
+*                  argument to /KEY, then compare to see if it equals uppercase 'CON'
+* V600 *acm* 5/06  with MODE LINECOLORS, number of lines not limited to num_fancy_lines
+* V602 *acm* 11/06 Fix bug 1472: Where single-level color plot is requested, use levels (1) 
+*                  setting rather than sending the data value; avoids precision problems.
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+* V6.2  *acm* 11/08Fix bug 1609: If the plot is an overlay then do not process /AXES=
+*                  or /NOAXES. Axes are never drawn for overlays anyway.
+* V6.2  *acm* 2/09 Fix choice of color settings with /PEN and /THICK when we have 
+*                  increased the num of colors with MODE linecolors
+* V6.83 *acm*12/12 Add POLYGON/MODULO qualifier, for curvilienar coordinate plots, 
+*                  as is done for SHADE and CONTOUR plots
+* PyFr  *kms* 7/13 EQUAL_COLOR now returns a color ID, and EQUAL_THICK 
+*                  returns a pen ID from a color ID and a thickness.
+* PyFr  *kms* 7/13 Added /OPACITY
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'PPLDAT.INC'
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'cont_inc.decl' ! with iautoc and nlev
+        include 'CONT.INC'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'    ! wsid
+
+	
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+        LOGICAL         no_range, do_key, spectrum, pattern, use_line
+	LOGICAL		overlay, transpz, no_labels, set_up, noaxes, axes
+	LOGICAL         fill_it, is_logh, is_logv, no_data, is_modx,
+     .			do_mod_minus, do_mod_plus
+	INTEGER         sp, patt, TM_LENSTR1, STR_UPCASE
+	INTEGER		symbol, icolor, ipen, status,
+     .			loc, limit, slen, coord_ax,
+     .			ax1_blks, ax1_start,
+     .			ax2_blks, ax2_start,
+     .			s1, s2, it_start(4), it_end(4),
+     .			nparm,  num_it, i, iax(4), i1, loch, locv
+	REAL		val, only_val, sym_size, add_lon
+        REAL*4          thickness, opacity
+	CHARACTER	LEFINT*4, TM_FMT*20, fname*128, poly_opt*10,
+     .                  buff*25
+
+* internal parameter declarations
+	INTEGER ncolors
+        LOGICAL continuous_key
+
+* set up the graphics environment and get the data
+	CALL START_PPLUS(.FALSE.)
+
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* Initialize the lines buffer in PPL before setting up
+	overlay   = qual_given( slash_shad_over_plot ).GT.0
+	if (overlay) SOVER = .true.
+
+	if (sover) then
+CC      *jd* NLINES initializes SOVER, and resets MIN/MAX. Do not execute. 
+CC       => Set values here instead.
+	   LINEN=0
+	   IBASE=1
+	   PBUF=0
+	   LNUM=1
+	else
+	   CALL PPLCMD ( from, line, 0, 'NLINES', 1, 1 )
+	endif
+
+* initialize
+	transpz   = qual_given( slash_shad_transpz   ).GT.0
+	no_labels = qual_given( slash_shad_nolabels  ).GT.0
+	set_up	  = qual_given( slash_shad_set_up    ).GT.0
+	noaxes    = qual_given( slash_noaxes         ).GT.0
+	axes      = qual_given( slash_polygon_axes   ).GT.0
+        IF (overlay) THEN
+	   noaxes = .FALSE.
+	   axes = .FALSE.
+	ENDIF
+	coord_ax  = qual_given( slash_polygon_coord  )		! integer
+	is_logh   = qual_given( slash_is_logh        ).GT.0
+	is_logv   = qual_given( slash_is_logv        ).GT.0 
+
+	symbol	  = qual_off	! or ??unspecified_int4??
+	sym_size  = 0.08	! default plot mark size
+        thickness = 1.0         ! default thickness
+	icolor	  = unspecified_int4
+        sp        = qual_given( slash_cont_spectrum  )
+
+        spectrum  = sp .GT. 0 
+        patt      = qual_given( slash_shad_pattern   )
+        pattern   = patt .GT. 0
+	add_lon	  = 0.
+
+        ncolors = mode_arg(pmode_linecolors,1)
+
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,is_cx,num_uvars_in_cmnd)
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* decide on line or fill or both
+        use_line   = ( qual_given(slash_polygon_color) .GT. 0 ) .OR.
+     .               ( qual_given(slash_polygon_thick) .GT. 0 ) .OR.
+     .               ( qual_given(slash_polygon_line)  .GT. 0 )
+
+	if (use_line) then
+	   fill_it = qual_given(slash_polygon_fill) .gt. 0 
+     .               .or. spectrum .or. pattern
+	else
+	   fill_it   = .true.
+	end if
+
+	if (use_line .and. fill_it) then
+	   poly_opt = '/LINE/FILL'
+	else if (use_line .and. .not. fill_it) then
+	   poly_opt = '/LINE'
+	else
+	   poly_opt = ' '
+	end if
+
+* decode qualifiers
+* ... POLYGON/COLOR=n
+	loc = qual_given( slash_polygon_color )
+	IF ( loc .GT. 0  ) THEN
+*          get the color ID
+           CALL EQUAL_COLOR(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                      icolor, thickness, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ELSEIF ( qual_given( slash_polygon_thick) .GT. 0 ) THEN
+           icolor = 1  ! /THICK -> "BLACK" if color not given
+	ENDIF
+
+* ... CONTOUR/OPACITY=n
+        loc = qual_given( slash_polygon_opacity )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_VAL(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    val, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           IF ( (val .LT. 0.0) .OR. (val .GT. 100.0) ) GOTO 5500
+           opacity = val / 100.0
+*          Assume the opacity is for the spectrum colors, 
+*          and not the pen, if filling is going to be done
+           IF ( icolor .NE. unspecified_int4 .AND. .NOT. fill_it )
+     .        CALL DUP_COLOR_SET_OPACITY(wsid, icolor, opacity)
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ELSE
+*          overriding opacity not specififed
+           opacity = -1.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ENDIF
+
+* ... POLYGON/THICKNESS=n
+ 200	loc = qual_given( slash_polygon_thick )
+	IF ( loc .GT. 0  ) THEN
+*          From above, icolor will be specified
+*          convert the color ID into a pen ID using the specified thickness
+           CALL EQUAL_THICK(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                      thickness, icolor, ipen, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ELSEIF ( icolor .NE. unspecified_int4 ) THEN
+*          convert the color ID into a pen ID using the default thickness
+           CALL EQUAL_THICK(' ', thickness, icolor, ipen, status)
+        ELSE
+*          set ipen to unspecified_int4
+           ipen = icolor
+        ENDIF
+
+* ... POLYGON/LINE_STYLE=n
+	loc = qual_given( slash_polygon_line )
+	IF ( loc .GT. 0  ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      val, status )	! syntax check
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   IF ( val .NE. unspecified_val4 ) THEN
+	      ipen = NINT( val )	! user-specified line style
+              limit = 3*mode_arg(pmode_linecolors,1)
+	      IF ( ipen .LT. 1 .OR. ipen .GT. limit ) GOTO 5200
+              IF ( opacity .GE. 0.0 )
+     .           CALL DUP_STD_PEN_SET_OPACITY(wsid, ipen, opacity)
+	   ELSEIF ( icolor .EQ. unspecified_int4 ) THEN
+	      ipen = qual_on		! auto selection of line style
+	   ENDIF
+	ENDIF
+
+* ... POLYGON/hgrat[=dash or line] default is dash
+*     hgrat line type: 0=tics only, 1=dash 2=line
+
+	loch = qual_given(slash_polygon_hgrat)
+
+* ... POLYGON/vgrat[=dash or line] default is dash
+*     vgrat line type: 0=tics only, 1=dash 2=line
+
+	locv = qual_given(slash_polygon_vgrat)
+        
+        IF (loch .EQ. 0  .AND. locv .EQ. 0) THEN
+           loch = qual_given(slash_polygon_grat)
+           locv = qual_given(slash_polygon_grat)
+        ENDIF
+
+        CALL set_graticules(loch, locv, status)
+
+	
+* default key
+
+	do_key =  (qual_given(slash_polygon_key)  .GT. 0)
+     .          .OR. (fill_it
+     .		     .AND. .NOT.overlay
+     .		     .AND. num_uvars_in_cmnd.GT.2)
+	IF (qual_given(slash_polygon_nokey) .gt. 0) do_key = .FALSE.
+	
+
+* Double check: is there no valid input data?
+	IF ( no_data ) do_key = .FALSE.
+	IF ( do_key ) THEN
+	   CALL PPLCMD ( from, line, 0, 'SHAKEY 1,1', 1, 1 )
+
+* ... /KEY=continouus ?
+              loc = qual_given(slash_polygon_key )
+              IF ( loc .GT. 0) THEN
+	         CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         IF ( buff(1:3) .EQ. 'CON' ) THEN
+                    continuous_key = .TRUE.
+                    CALL PPLCMD (from, line, 0, 'S_KEY 1', 1, 1 )
+                 ENDIF
+              ENDIF
+
+	ELSE
+	   CALL PPLCMD ( from, line, 0, 'SHAKEY 0,1', 1, 1 )
+	ENDIF
+
+* Do a /MODULO operation for curvilinear coordinates?
+
+	is_modx = qual_given(slash_polygon_mod) .GT. 0
+
+	if (overlay) sover = .true.
+* set up the axes and title and load the data into PPLUS
+
+ 220	CONTINUE 
+	CALL POLYGON_SET_UP   ( memory,
+     .				overlay,
+     .				transpz,
+     .				coord_ax,
+     .				no_labels,
+     .				no_range,
+     .				only_val,
+     .				symbol,
+     .				ipen,
+     .				use_line,
+     .				is_logh, 
+     .				is_logv,
+     .				is_mr,
+     .				is_cx,
+     .				num_uvars_in_cmnd,
+     .				is_modx,
+     .				do_mod_minus, 
+     .				do_mod_plus,
+     .				add_lon,
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* is there no valid input data?
+	no_data =  no_range .AND. only_val.EQ.bad_val4
+
+* PPLUS blows up setting auto contour levels if all data have same value
+* But, do not let this be rounded off, or we cannot find the color when matching 
+* this value in get_ndx, called by fillpol
+
+* The initial fix below had precision problems when the value in only_val was
+* of high precision, sometimes causing polygons to go unfilled (bug 1472).  
+* Instead, make a ppl lev 1 setting, as is done in disp_prep.F
+
+c     IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 )
+c    .          CALL PPLCMD ( from, line, 0, 
+c    .          'LEV () ('//TM_FMT(only_val, 8, 20, slen)//')' , 1, 1 )
+
+      IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 ) THEN
+           iautoc = 1  
+c           nlev = 1   
+      ENDIF
+
+* protect colors already on-screen before a color overlay
+*        PyFerret does not need to protect colors after using them
+*        IF ( overlay ) CALL PPL_SHASET( 'PROTECT' )
+
+* save old and reset to new color spectrum if requested
+	IF ( spectrum ) THEN
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(sp):qual_end(sp)),
+     .             fname, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( fname .EQ. ' ' ) fname = 'default'
+	   CALL PPL_SHASET( 'SAVE' )
+	   CALL PPL_SHASET( 'SPECTRUM='//fname(1:TM_LENSTR1(fname)) )
+	ENDIF
+
+* save old and set to new pattern if requested (a la spectrum)
+	IF ( pattern ) THEN
+	   CALL EQUAL_STR_LC( 
+     .             cmnd_buff(qual_start(patt):qual_end(patt)),
+     .             fname, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( fname .EQ. ' ' ) fname = 'default'
+	   CALL PPL_PATSET( 'SAVE' )
+	   CALL PPL_PATSET( 'PATTERN='//fname(1:TM_LENSTR1(fname)) )
+	ENDIF
+
+* turn off axes? 
+	IF ( noaxes ) THEN 
+           DO 300 i = 1, 4
+              iax(i) = 0
+ 300       ENDDO
+        ENDIF
+
+* turn on (one or more) axes? (7/11/01)
+
+* ... PLOT/AXES=(TOP,BOTTOM,LEFT,RIGHT)
+	IF ( axes ) THEN
+           loc = qual_given( slash_polygon_axes )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   IF ( buff .NE. ' ' ) THEN
+
+* Get arguments, if any.  Otherwise turn on all axes
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5440
+              ENDIF
+
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, 
+     .             num_it, it_start, it_end, status)
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN	! /AXES=()
+                 DO 400 i = 1, 4
+                    iax(i) = 0
+ 400             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5440
+              ELSE
+                 DO 500 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) iax(i)
+                    IF (iax(i) .LT. 0  .OR.  iax(i) .GT. 1) GOTO 5450
+ 500             CONTINUE
+              ENDIF
+           ELSE		! turn on all axes
+	      DO 600 i = 1, 4
+		 iax(i) = 1
+ 600	      CONTINUE
+           ENDIF
+              
+	ENDIF
+
+*  Turn off or on axes, including time axes.
+        IF (axes .OR. noaxes) CALL ax_on_off (iax)
+
+* /set_up only requested ?
+	IF ( set_up ) GOTO 1000
+
+* polygon it 
+	   IF ( overlay ) THEN
+	      CALL PPLCMD ( ' ', ' ', 0,
+     .          'FILLPOL/OVER/'//ppl_wait//poly_opt//' ' , 1, 1 )
+	   ELSE
+	      CALL PPLCMD ( ' ', ' ', 0,
+     .		'FILLPOL/'//ppl_wait//poly_opt//' ', 1, 1 )
+	   ENDIF
+
+* Is a modulo replication set up?  If so go do it, no labels, no axes, no key,
+* same levels (which were computed with all the data, just not shown on orig. plot)
+	   IF (is_modx) THEN
+	      add_lon = 0.
+	      IF (do_mod_minus) THEN
+	         add_lon = -360.
+		 do_mod_minus = .FALSE.
+	      ELSEIF (do_mod_plus) THEN
+	         add_lon = 360.
+		 do_mod_plus = .FALSE.
+	      ENDIF
+	      IF (add_lon .NE. 0) THEN
+		 sover = .TRUE.
+		 overlay = .TRUE.
+		 noaxes = .TRUE.
+		 no_labels = .TRUE.
+		 do_key = .FALSE.
+		 iautoc = 1 ! Mark the levels as set
+C Reset pplus lines
+		 LINEN=0
+		 IBASE=1
+		 PBUF=0
+		 LNUM=1
+
+		 GOTO 220
+	      ENDIF
+	   ENDIF
+
+* protect the new colors and restore the original color spectrum
+           IF ( spectrum ) THEN
+*              PyFerret does not need to protect colors after using them
+*              CALL PPL_SHASET( 'PROTECT' )
+              CALL PPL_SHASET( 'SPECTRUM' )
+           ENDIF
+
+* restore the original pattern
+           IF ( pattern ) THEN
+              CALL PPL_PATSET( 'PATTERN' )
+           ENDIF
+
+* Mark the levels as set; if we used histogram levels it is 0
+
+          IF (need_histo) iautoc = 1
+
+* clear the overriding opacity
+        opacity = -1.0
+        CALL SET_OVERRIDE_OPACITY(opacity)
+
+* restore axes? (5/29/97) revised 3/02
+c	IF ( axes .or. noaxes ) CALL PPL_AXES_RESTORE
+
+* restore default (non-continuous) key style?
+        IF (continuous_key ) CALL PPLCMD (from, line, 0, 'S_KEY 0', 1, 1 )
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ?
+	IF ( qual_given( slash_shad_frame ) .GT. 0 ) THEN
+	   CALL SAVE_FRAME( frame_file, "HDF", status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+*  Save log axis state
+
+	IF (overlay) THEN
+	   is_logh = h_logaxis
+	   is_logv = v_logaxis
+	ELSE
+	   h_logaxis= is_logh
+	   v_logaxis = is_logv 
+	ENDIF
+
+* release the memory used for axis buffers
+ 1000	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+ 5200	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Legal range is 1 to '//LEFINT(limit,slen), *1000 )
+ 5400	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Legal range is 1 to 3', *1000 )
+ 5440	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .'AXES[=(TOP,BOTTOM,LEFT,RIGHT)] takes 4 arguments or no argument', 
+     .		*1000 )
+ 5450	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'AXES arguments must be 0 or 1', *1000 )
+ 5500   CALL ERRMSG( ferr_out_of_range, status,
+     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .          'Value from 0 to 100 must be given', *1000 )
+	END
diff --git a/fer/xeq/xeq_pplus.F b/fer/xeq/xeq_pplus.F
new file mode 100644
index 0000000..d13340c
--- /dev/null
+++ b/fer/xeq/xeq_pplus.F
@@ -0,0 +1,205 @@
+	SUBROUTINE XEQ_PPLUS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* access program PPLUS ( the underlying graphics package ) directly - either
+* by sending a single command to it or by entering the PPLUS command interpreter
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/7/87
+* revision 0.1 - 9/8/88 - added /RESET option
+* revision 0.2 - 1/31/89 - added PPLUS interruptibility
+* Unix/RISC port - 10/9/91 - check to see if user changes ylen or yorg
+* V500 *sh* 6/99 - for commands %LABEL and %WHERE define PLOT+ symbols
+*			mode verify output, and journal file comments
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+* V6.85 *acm* 3/13 Fix ticket 2049; check we can open palette file
+* PyFr  *kms*  7/13 Reset scaling with PPL /RESET
+* V6.86 *acm* 1/14 In above fix, let there be spaces before the file spec.
+
+        IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include	'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+	include 'xgrinpt.cmn'	 ! mouse input
+        include 'axis_inc.decl'
+        include 'AXIS.INC'       ! ylen,yorg
+        include 'plt_inc.decl'
+        include 'PLT.INC'        ! width, height
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'	 ! wsid
+        INCLUDE 'fgrdel.cmn'     ! windowdpix, windowdpiy
+
+* local variable declarations:
+	LOGICAL	ver_out, jnl_out
+	INTEGER TM_LENSTR1, STR_UPCASE, i, slen, start, status
+        REAL temp_ylen, temp_yorg
+	CHARACTER*16 vbuff
+	CHARACTER TM_INQ_PATH*2048, fname*128, sfile*2048
+        REAL*4 scl
+
+* local parameter declarations:
+	INTEGER		slash_reset
+	PARAMETER     ( slash_reset = 0+1 )
+
+* turn on PLOT+ ?
+	CALL START_PPLUS(.FALSE.)
+
+* save ylen and yorg in case the user manually changes those values in PLOT+
+* 10/9/91 addition 
+        temp_ylen = ylen
+        temp_yorg = yorg
+
+* Check for a PPL SHASET SPECTRUM command, and verify the palette file can be opened.
+	IF ( num_args .GT. 0 ) THEN
+           IF ( INDEX(cmnd_buff(arg_start(1):len_cmnd),'SPECTRUM') .GT. 0 ) THEN
+	      start = INDEX(cmnd_buff,'SPECTRUM=') + 10
+              fname = cmnd_buff(start:len_cmnd)
+              CALL TM_PACK_STRING( fname, fname, 1, 128, slen )
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.spk',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+           ENDIF
+
+           IF ( INDEX(cmnd_buff(arg_start(1):len_cmnd),'PATTERN') .GT. 0 ) THEN
+	      start = INDEX(cmnd_buff,'PATTERN=') + 9
+              fname = cmnd_buff(start:len_cmnd)
+              CALL TM_PACK_STRING( fname, fname, 1, 128, slen )
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.pat',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+           ENDIF
+
+        ENDIF
+
+	IF ( qual_given( slash_reset ) .GT. 0 ) THEN
+* ... reset plot environment to defaults
+	   CALL DISP_RESET
+*          set the default scaling factor for the scene - SQRT(0.7)
+           scl = dflt_imgscale
+           wn_xpixels(wsid) = wn_xinches(wsid) * windowdpix(wsid) * scl
+           wn_ypixels(wsid) = wn_yinches(wsid) * windowdpiy(wsid) * scl
+           CALL FGD_SEND_IMAGE_SCALE(wsid, scl)
+	ELSEIF ( num_args .GT. 0 ) THEN
+* ... pass a single command to PLOT5
+	   CALL PPLCMD (' ',' ',0,cmnd_buff(arg_start(1):len_cmnd),1,1)
+	ELSE
+* ... enter PPLUS interactively
+	   CALL PPLCMD ( '/dev/tty', ' ', 0, ' ', 1, 0 )
+	   ppl_interrupted = .FALSE.			! since interactive
+	ENDIF
+
+* check to see if mouse input was done -- take action if so (6/99)
+	IF (has_new_mouse) THEN
+	   jnl_out = mode_journal .AND. jrnl_lun .NE. unspecified_int4
+	   ver_out = mode_verify 
+* ... define symbols and output them as comments to user and journal file
+	   vbuff = ' '
+	   WRITE ( vbuff, '(1PG16.7)' ) xmouse
+           WRITE ( ppl_buff, 3100 ) 'X', vbuff
+           CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3200 ) 'X', vbuff
+	   slen = TM_LENSTR1(ppl_buff)
+           IF (jnl_out) WRITE (jrnl_lun,'(A)') ppl_buff(:slen)
+	   IF (ver_out) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .					ppl_buff, slen )
+
+	   vbuff = ' '
+	   WRITE ( vbuff, '(1PG16.7)' ) ymouse
+           WRITE ( ppl_buff, 3100 ) 'Y', vbuff
+           CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3200 ) 'Y', vbuff
+	   slen = TM_LENSTR1(ppl_buff)
+           IF (jnl_out) WRITE (jrnl_lun,'(A)') ppl_buff(:slen)
+	   IF (ver_out) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .					ppl_buff, slen )
+     
+
+	   vbuff = ' '
+	   WRITE ( vbuff, '(I3)' ) wmouse
+           WRITE ( ppl_buff, 3100 ) 'W', vbuff
+           CALL PPLCMD ( from, line, 0, ppl_buff, 1, 1 )
+	   WRITE ( ppl_buff, 3200 ) 'W', vbuff
+	   slen = TM_LENSTR1(ppl_buff)
+           IF (jnl_out) WRITE (jrnl_lun,'(A)') ppl_buff(:slen)
+	   IF (ver_out) CALL SPLIT_LIST(pttmode_ops, ttout_lun,
+     .					ppl_buff, slen )
+
+* ... house-keeping
+	   has_new_mouse = .FALSE.		! RESET !!
+	   IF (jnl_out) THEN
+#ifdef AIX_XLF
+              CALL FLUSH(jrnl_lun)
+#endif
+#ifdef solaris
+              CALL FLUSH(jrnl_lun)
+#endif
+	   ENDIF
+	ENDIF
+
+	i = STR_UPCASE( vbuff, cmnd_buff(arg_start(1):arg_end(1)))
+	IF (( INDEX(vbuff,'SHADE')   .GT. 0 ) .OR.
+     .      ( INDEX(vbuff,'CONTOUR') .GT. 0 ) .OR.
+     .      ( INDEX(vbuff,'FILL')    .GT. 0 ).OR.
+     .      ( INDEX(vbuff,'WIRE')    .GT. 0 )    ) THEN
+	   CALL DECREMENT_PLOT_GRID  ! see ticket 883
+	ENDIF
+
+* check to see if ylen or yorg has been changed
+* if so, parameters saved prior to distorting yaxis are invalidated
+        IF ( ylen .NE. temp_ylen ) ppl_saved_yaxlen = ylen
+        IF ( yorg .NE. temp_yorg ) ppl_saved_yorg   = yorg
+
+ 1000	RETURN
+
+ 3100   FORMAT('SET ',A1,'MOUSE ', A)       ! "SET ?MOUSE position_string"
+ 3200	FORMAT(' !-> DEFINE SYMBOL ',A1,'MOUSE = ',A)
+ 
+ 5300   CALL ERRMSG (ferr_file_not_found, status, 
+     .          'unable to open "' //
+     .	fname(:slen)//'.spk" to set plot colors or pattern.', *1000)
+
+	END
diff --git a/fer/xeq/xeq_query.F b/fer/xeq/xeq_query.F
new file mode 100644
index 0000000..0ef44c1
--- /dev/null
+++ b/fer/xeq/xeq_query.F
@@ -0,0 +1,149 @@
+    	SUBROUTINE XEQ_QUERY
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the QUERY command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* for FERRET V300: 6/16/93
+* V301:	11/05/93 - changed QUERY/PIPE to QUERY/IGNORE (a NO-OP)
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V66   *kms* 5/10 LIB_GET_LUN is a subroutine, not a function
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+        include 'tmap_dims.parm'
+#       include "tmap_dset.parm"
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'xprog_state.cmn'
+	include 'xcommand.cmn'
+	include 'xgui.cmn'
+
+* local parameter declarations:
+	INTEGER	    slash_all, slash_file, slash_ignore
+	PARAMETER ( slash_all  = 1 + 0,
+     .		    slash_file = 1 + 1,
+     .		    slash_ignore = 1 + 2 )
+	CHARACTER*1 NO_TAG
+	PARAMETER ( NO_TAG = " " )
+
+* local variable declarations:
+	LOGICAL	do_all, fileout, its_ppl
+	INTEGER	TM_LENSTR1, STR_UPCASE, vax_code,
+     .		chout, flen, qfile, status, i, query, n
+	CHARACTER fname*132, qry4*4
+
+
+* initialize
+	fileout = .FALSE.
+	status = ferr_ok
+        qfile = qual_given( slash_file )
+
+* is this a QUERY/IGNORE NO-OP ?
+	IF ( qual_given( slash_ignore ) .GT. 0 ) RETURN
+
+* query given ?
+	IF ( num_args .EQ. 0 ) GOTO 5300
+
+* command given with /ALL ?
+	do_all = qual_given( slash_all ) .GT. 0
+
+* identify the query - if it starts with 'P' it is a PLOT+ query
+	qry4 = cmnd_buff(arg_start(1):arg_end(1))
+	vax_code = STR_UPCASE( qry4,
+     .		   cmnd_buff(arg_start(1):arg_end(1)) )
+	its_ppl = qry4(1:1) .EQ. 'P'
+	IF ( .NOT. its_ppl ) THEN
+	   DO 10 query = 1, max_queries
+	      IF ( queries(query) .EQ. unspecified_name4 ) GOTO 10
+	      IF ( qry4 .EQ. queries(query)(:4) )          GOTO 20
+ 10	   CONTINUE
+	   GOTO 5100
+	ENDIF
+
+* command given with /FILE  - open output channel
+ 20        IF ( qfile .GT. 0 ) THEN
+	   CALL EQUAL_STR_LC(
+     .                  cmnd_buff(qual_start(qfile):qual_end(qfile)),
+     .                  fname, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   flen = TM_LENSTR1(fname)
+	   IF ( fname.NE.' ' ) THEN
+	      CALL LIB_GET_LUN( chout ) 
+	      OPEN ( UNIT = chout,
+     .		     FILE = fname,
+     .		     STATUS = 'UNKNOWN',
+     .		     ERR = 5200 ) 
+	      fileout = .TRUE.
+	   ENDIF
+
+	ELSE
+	   chout = ttout_lun
+	ENDIF
+
+* do it
+	IF ( its_ppl ) THEN
+!	   QRY_PPL( chout, gui_fmt1, qry4, status ) 	   
+	ELSE
+	   CALL DO_QUERY( chout, gui_fmt1, query, NO_TAG, status )
+	ENDIF
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	
+* exit
+ 1000	IF ( fileout ) THEN
+	   WRITE ( chout, '(40A1)' ) ('=',i=1,40) 
+	   CLOSE ( UNIT = chout, ERR = 5000 )
+	ENDIF
+	RETURN
+ 3000	FORMAT (I4, 2X, A4)
+
+* error exits
+ 5000	RETURN
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'unknown QUERY: '//cmnd_buff(arg_start(1):arg_end(1)),
+     .		     *1000 )
+ 5200	CALL ERRMSG( ferr_erreq, status, fname(1:flen), *1000 )
+ 5300	CALL ERRMSG( ferr_invalid_command, status, 'QUERY what?', *5000 )
+	END
+
diff --git a/fer/xeq/xeq_repeat.F b/fer/xeq/xeq_repeat.F
new file mode 100644
index 0000000..be4e6f2
--- /dev/null
+++ b/fer/xeq/xeq_repeat.F
@@ -0,0 +1,441 @@
+	SUBROUTINE XEQ_REPEAT
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* sets up the control stack (COMMON/~CONTROL/) to repeat the indicated
+* command for a range of default contexts
+* eg. "REPEAT/T=27740:35000:10 CONTOUR/@N/K=1 TEMP"
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/29/87
+* revision 0.1 - 9/16/87 - unknown_qual_bad moved to FERRET.PARM
+* revision 0.2 - 9/25/87 - added "d" notation for REPEAT limits
+* revision 0.3 - 4/11/88 - special checks on T axis for calendar notation
+* revision 0.4 - 7/27/88 - added default context to GET_CONTEXT_MODS call
+* revision 0.5 -10/31/88 - limits reversed for negative delta
+* V200:  6/15/89 - eliminated "d" notation and "relative" logic
+* Unix/RISC port - 1/91 - cant use "/star" in documentation
+* V230:  7/23/92 - added cs_save_* to restore context after REPEAT loops
+*       - add check on cx_calendar rather than cx_lo/hi_ww to indicate 
+*         whether time is date or timesteps
+* 12/97 *kob* - use new logical cs_is_calendar
+* V554 1/04 *acm* - additions for /RANGE repeat loop control
+* V56  3/04 *acm* - initialize cat flag before error checks; change messages when
+*                   user attempts to use a pseudo-variables for /NAME=
+*      6/04 ywei  - changed MATCH_NAME to allow optimization
+* V57  6/04 *acm* - clean up declarations
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction.
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include	'command.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xcontrol.cmn'
+	include 'xprog_state.cmn'
+	include 'xtext_info.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+	include	'gkscm1_inc.decl'	! with gks common
+	include	'GKSCM1.INC'            ! with gks common
+        include 'rpn.parm'              ! with maxatoms
+        include 'xalgebra.cmn'
+        include 'xvariables.cmn'
+
+* local variable declarations
+	LOGICAL	by_date, report_unknown, range
+	INTEGER	INDEX, i, idim, limits_cx, status, csp1, rlo, rhi, rdel
+	REAL*8	temp
+ 
+	INTEGER STR_UPCASE, TM_LENSTR1, loc, equal_pos, last_pos, 
+     .          cvar, istart, iflag, locr, cat, var, slen,
+     .          j, num_indices
+	REAL val
+	CHARACTER counter_name*128
+	LOGICAL loop
+
+* check that something was given to repeat
+	IF ( num_args .EQ. 0 ) CALL ERRMSG
+     .			( ferr_invalid_command, status, 'REPEAT what ?', *5000 )
+
+
+* Did they specify /NAME without /RANGE=?
+
+          loc = qual_given(slash_repeat_name) 
+          IF (loc .GT. 0) THEN
+             locr = qual_given(slash_repeat_range) 
+
+	     IF (locr .LE. 0) GO TO  5100
+
+          ENDIF
+
+*acm 1/01 check to see if we are using /RANGE=
+       loc = qual_given(slash_repeat_range) 
+       range = (qual_given(slash_repeat_range) .GT. 0)
+       IF (range) THEN
+          idim = 1
+
+           last_pos = qual_end(loc)
+           equal_pos = 
+     .          INDEX(cmnd_buff(qual_start(loc):last_pos), '=') +
+     .          qual_start(loc) - 1
+
+
+* Did they specify /RANGE and also /I/J/K/L/M/N/X/Y/Z/T/E/F ?
+	   report_unknown = .FALSE.
+	   limits_cx = cx_stack_ptr_base + 1
+	   CALL INIT_CONTEXT_MODS ( limits_cx )
+	   CALL GET_CONTEXT_MODS ( cx_last,
+     .				cmnd_buff,
+     .				limits_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				report_unknown,
+     .				status	)
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   DO 100 i = 1, nferdims
+	      IF ( cx_given(i,limits_cx) ) GOTO 5300
+ 100	   CONTINUE
+
+* Are we using a name for the repeat counter?
+          counter_name = 'REPCOUNT'
+
+          loc = qual_given(slash_repeat_name) 
+          IF (loc .GT. 0) THEN
+
+	     CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        counter_name, status )
+
+             IF ( status .NE. ferr_ok ) GOTO 5000
+
+* Check for legal name: not already defined, not a pseudo-var
+* Only check for pseudo_vars I,J,K,L,M,N, X,Y,Z,T,E,F.  These cannot
+* be used as counter vars.
+
+             cat = 0
+	     CALL FIND_VAR_NAME ( pdset_irrelevant, counter_name, 
+     .                            cat, var )
+             IF ( cat .EQ. cat_pseudo_var   ) THEN
+
+	         CALL string_array_find(alg_pvar_head,
+     .                           counter_name,
+     .                           LEN(counter_name),
+     .                           string_array_result(1),
+     .                           max_uvar,
+     .                           num_indices)
+                 IF(num_indices.GT.0) THEN
+                    var=string_array_result(1)
+                    IF(var.LE.9)THEN
+                        GOTO 5200
+                    ELSE
+                        GOTO 5250
+                    ENDIF
+                 ENDIF
+             ENDIF
+             IF ( cat .EQ. cat_counter_var   ) GOTO 5400
+
+          ENDIF
+
+* allocate next spot for the given limits on the control stack
+* ... but leave the stack in place in case of errors in this routine
+
+	   CALL STACK_PTR_UP( csp, cs_max, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   csp1 = csp
+	   CALL STACK_PTR_DN( csp, 0, status )
+
+* File the expression and name in the counter-variable area and set up the
+* context so the command stack can be loaded 
+
+           istart = 1
+	   CALL INIT_COUNTER_VAR ( counter_name, cmnd_buff(equal_pos+1:last_pos), 
+     .             istart, last_pos-equal_pos, rlo, rhi, rdel, cvar, status )
+
+	   IF ( status .NE. ferr_ok ) RETURN
+
+* load the start and end limits and the increment
+
+           cs_by_ss( csp1 ) = .TRUE.
+	   cs_delta( csp1 ) = rdel
+	   cs_limit( csp1 ) = rhi
+	   cs_phase( csp1 ) = rlo
+	
+* error message if delta is 0
+
+           IF (cs_delta( csp1 ) .EQ. 0) CALL ERRMSG( ferr_invalid_command, status,
+     .			'Delta value on REPEAT must be nonzero', *5000 )
+
+* save the current context so it can be restored afterwards
+
+           cs_save_by_ss( csp1 ) = cx_by_ss(idim,cx_last)
+           IF ( cs_save_by_ss(csp1) ) THEN
+              cs_save_lo( csp1 ) = cx_lo_ss (cx_last,idim)
+              cs_save_hi( csp1 ) = cx_hi_ss (cx_last,idim)
+           ELSE
+              cs_save_lo( csp1 ) = cx_lo_ww (idim,cx_last)
+              cs_save_hi( csp1 ) = cx_hi_ww (idim,cx_last)
+              cs_save_cal( csp1) = cx_cal_id (cx_last)
+           ENDIF
+
+* Save name of REPEAT/RANGE variable
+
+           csp_cvar(cvar) = csp1
+           IF (counter_name .EQ. 'repcount') THEN
+              cs_repeatname( csp1 ) = 'REPCOUNT'
+           ELSE
+              iflag = STR_UPCASE( cs_repeatname( csp1 ), counter_name )
+           ENDIF
+
+* stack bump  ???
+	   CALL STACK_PTR_UP( csp, cs_max, status )
+
+* load the axis to which the limits apply
+	   cs_axis( csp ) = idim
+
+* load the command line to be repeatedly executed
+	   cs_text( csp ) = cmnd_buff( arg_start(1):len_cmnd )
+
+* and tell 'em who owns this level
+	   cs_cmnd_num( csp ) = cmnd_repeat
+
+* and set the default context in preparation for first call
+!	   CALL CS_SET_CONTEXT  !??? Not for REPEAT/RANGE
+
+* success - tell 'em we've taken over and start workin'
+	   cs_in_control = .TRUE.
+	   input_source  = input_from_cs
+
+* kob 1/01 - check to see if there is a loop in the repeat command.  if so, set
+*            cs_loop accordingly
+	   loc = qual_given(slash_repeat_loop)
+	   IF (loc .GT. 0) THEN
+	      loop = .TRUE.
+	      cs_start(csp1) = cs_phase(csp1)
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .	           val, status ) ! syntax check
+	      IF ( val .NE. unspecified_val4 .AND. val .NE. 0) THEN
+                 cs_loop(csp1) = INT(val)
+	      ELSE
+                  cs_loop(csp1) = 1
+	      ENDIF
+	   ENDIF
+*kob 1/01 check to see if we are in an animation repeat loop
+	   animate = qual_given(slash_repeat_animate) .GT. 0
+           IF (animate) THEN
+* set first_frame to true - we don't need to animate first frame - its
+*   already in the plot window
+	      first_frame = .TRUE. 
+	   ENDIF
+
+        ELSE  ! not /RANGE
+
+* get the limits for repeating
+*  eg. "REPEAT/X=160E:140W:10 LIST/X=-5D:+5D/Y=0D:5D TEMP"
+	   limits_cx = cx_stack_ptr_base + 1
+* *kob* 1/00 - dont report unknown command qualifiers
+	   report_unknown = .FALSE.
+	   CALL INIT_CONTEXT_MODS ( limits_cx )
+
+
+	   CALL GET_CONTEXT_MODS ( cx_last,
+     .				cmnd_buff,
+     .				limits_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				report_unknown,
+     .				status	)
+
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* determine the (unique) axis of REPEATing
+	   idim = unspecified_int4
+	   DO 200 i = 1, nferdims
+	      IF ( cx_given(i,limits_cx) ) THEN
+	         IF ( idim .EQ. unspecified_int4 ) THEN
+	            idim = i
+	         ELSE
+	            CALL ERRMSG( ferr_invalid_command, status,
+     .			'Use nested REPEAT for multiple axes', *5000 )
+	         ENDIF
+ 	      ENDIF
+ 200	   CONTINUE
+	   IF ( idim .EQ. unspecified_int4 ) CALL ERRMSG
+     .		(ferr_invalid_command,status,'REPEAT on which axis ?',*5000)
+
+* allocate next spot for the given limits on the control stack
+* ... but leave the stack in place in case of errors in this routine
+	   CALL STACK_PTR_UP( csp, cs_max, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   csp1 = csp
+	   CALL STACK_PTR_DN( csp, 0, status )
+
+* load the start and end limits and the increment
+
+	   cs_by_ss( csp1 ) = cx_by_ss( idim, limits_cx )
+           IF ( cx_delta( idim, limits_cx ) .EQ. unspecified_val8 ) THEN
+	      cs_delta( csp1 ) = 1
+	   ELSE
+	      cs_delta( csp1 ) = cx_delta( idim, limits_cx )
+	   ENDIF
+	   IF ( cs_by_ss( csp1 ) ) THEN
+	      cs_limit( csp1 ) = cx_hi_ss( limits_cx, idim )
+	      cs_phase( csp1 ) = cx_lo_ss( limits_cx, idim )
+	   ELSE
+	      cs_limit( csp1 ) = cx_hi_ww( idim, limits_cx )
+	      cs_phase( csp1 ) = cx_lo_ww( idim, limits_cx )
+           ENDIF
+
+* error message if delta is 0
+
+           IF (cs_delta( csp1 ) .EQ. 0) CALL ERRMSG( ferr_invalid_command, status,
+     .			'Delta value on REPEAT must be nonzero', *5000 )
+
+           cs_repeatname( csp1 ) = unspecified_name4
+
+* save the current context so it can be restored afterwards
+
+           cs_save_by_ss( csp1 ) = cx_by_ss(idim,cx_last)
+           IF ( cs_save_by_ss(csp1) ) THEN
+              cs_save_lo( csp1 ) = cx_lo_ss (cx_last,idim)
+              cs_save_hi( csp1 ) = cx_hi_ss (cx_last,idim)
+           ELSE
+              cs_save_lo( csp1 ) = cx_lo_ww (idim,cx_last)
+              cs_save_hi( csp1 ) = cx_hi_ww (idim,cx_last)
+              cs_save_cal(csp1 ) = cx_cal_id (cx_last)
+           ENDIF
+
+* special check for the validity of time axis limits: calendar dates are
+* stored as negative seconds since 1-jan-0000:00:00:00
+* 8/97 *kob* use cx_calender to check if time is date rather than time step
+* 12/97 *kob* set new logical cs_is_calendar now as well
+	   by_date = ( idim .EQ. t_dim .OR. idim .EQ. f_dim )
+     .	   .AND. ( .NOT.cx_by_ss(idim,limits_cx) )
+     .	   .AND. ( cx_calendar(limits_cx) )
+* ... delta value in hours: hours-->seconds (to add to secs from BC)
+	   IF ( by_date ) THEN
+               cs_delta(csp1) =  -3600. * cs_delta(csp1)
+	       cs_is_calendar(csp1) = .TRUE.
+               cs_cal_id(csp1) = 1
+	   ENDIF
+
+* reverse limits if negative delta is desired
+	   IF (( ( .NOT.by_date .AND. (cs_delta(csp1) .LT. 0.0D0) )
+     .   	.OR. (      by_date .AND. (cs_delta(csp1) .GT. 0.0D0) ) ) ) THEN
+	      temp = cs_phase(csp1)
+	      cs_phase(csp1) = cs_limit(csp1)
+	      cs_limit(csp1) = temp
+	   ENDIF
+
+* from here on no errors can occur so make the stack bump permanent
+	   CALL STACK_PTR_UP( csp, cs_max, status )
+
+* load the axis to which the limits apply
+	   cs_axis( csp ) = idim
+
+* load the command line to be repeatedly executed
+	   cs_text( csp ) = cmnd_buff( arg_start(1):len_cmnd )
+
+* and tell 'em who owns this level
+	   cs_cmnd_num( csp ) = cmnd_repeat
+
+* and set the default context in preparation for first call
+	   CALL CS_SET_CONTEXT
+
+* success - tell 'em we've taken over and start workin'
+   	   cs_in_control = .TRUE.
+	   input_source  = input_from_cs
+
+* kob 1/01 - check to see if there is a loop in the repeat command.  if so, set
+*            cs_loop accordingly
+	      loc = qual_given(slash_repeat_loop)
+	      IF (loc .GT. 0) THEN
+	         loop = .TRUE.
+	         cs_start(csp1) = cs_phase(csp1)
+	         CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .	              val, status ) ! syntax check
+	         IF ( val .NE. unspecified_val4 .AND. val .NE. 0) THEN
+	   	    cs_loop(csp1) = INT(val)
+	         ELSE
+		    cs_loop(csp1) = 1
+	         ENDIF
+	      ENDIF
+*kob 1/01 check to see if we are in an animation repeat loop
+	   animate = qual_given(slash_repeat_animate) .GT. 0
+           IF (animate) THEN
+* set first_frame to true - we don't need to animate first frame - its
+*   already in the plot window
+	     first_frame = .TRUE. 
+	   ENDIF
+
+        ENDIF  ! IF (range)
+
+	RETURN
+
+* error exit
+* ... control stack pointer, CSP, corrected in GFD_ERROR_HANDLER
+ 5000	RETURN
+
+ 5100	CALL ERRMSG( ferr_invalid_command, status,
+     .		'REPEAT/NAME requires /RANGE', *5000 )
+ 5200   CALL ERRMSG( ferr_syntax,status,
+     .  counter_name(1:1)//
+     . ' is a pseudo-variable; '
+     . //'cannot use with REPEAT/RANGE/NAME.'
+     . //' Instead use REPEAT/'//counter_name(1:1)//'=',*5000 )
+ 5250  slen = TM_LENSTR1(counter_name)
+       CALL ERRMSG( ferr_syntax,status,
+     .  counter_name(1:slen)//' is a pseudo-variable; '
+     . //'cannot use with REPEAT/RANGE/NAME=',*5000 )
+ 5300   CALL ERRMSG( ferr_syntax,status,
+     .  'REPEAT/RANGE cannot be used with an axis qualifier '//
+     .  cmnd_buff ,*5000 )
+
+ 5400   CALL ERRMSG( ferr_syntax,status,
+     .  'nested REPEAT loops with the same counter name '
+     .             //counter_name,*5000 )
+
+	END
+
+
diff --git a/fer/xeq/xeq_set.F b/fer/xeq/xeq_set.F
new file mode 100644
index 0000000..d83acde
--- /dev/null
+++ b/fer/xeq/xeq_set.F
@@ -0,0 +1,2098 @@
+	SUBROUTINE XEQ_SET( memory, reconfig )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SET command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+* revision 0.1 - 12/15/86 - implemented SET OUTPUT/FORMAT
+* revision 0.2 - 3/20/87  - changes for new TMAP library
+* revision 0.3 - 5/1/87   - added SET LIST/OUT/APPEND,
+*			    SET MOVIE/OUT=file/APPEND title,
+*			    SET REGION, SET EXPRESSION and 'SET what?' error
+* revision 0.4 - 8/29/87  - added SET LIST/FORM=UNFORMATTED
+* revision 0.5 - 9/9/87   - added SET LIST/FORM=BIBO
+* revision 0.6 - 9/16/87  - added SET GRID (not implemented)
+*			    moved unknown_qual_bad to FERRET.PARM
+* revision 0.7 - 9/23/87  - condensed SET REGION via GET_NEW_cx
+*			    and added SET LIST/HEAD
+* revision 0.8 - 10/5/87  - revamped SET LIST logicals
+* revision 0.9 - 10/22/87 - allowed SET DATA n
+* revision 1.0 - 2/15/88  - parameters read from .DES files in SET DATA
+* revision 1.1 - 3/18/88   - added list_tmap and SET MODE arguments
+* revision 1.2 - 4/15/88   - added SET MODE/LAST
+* revision 1.3 - 6/29/88 - allow SET LIST/FORMAT=GT equiv. to =TMAP
+*			 - corrected READ (lun,*) bug in SET DATA Tname
+*			 - added SET WINDOW
+* revision 1.4 - 8/2/88  - added SET MODE WAIT
+* revision 1.5 - 9/1/88  - added SET VIEWPORT
+* revision 2.0 -11/17/88 - incorporated new TMAP library (handling time series)
+* revision 2.1 - 1/10/89 - added SET MODE REJECT, corrected last_mode
+* revision 2.2 - 2/16/89 - ds_open --> ds_name.EQ.char_init30 to test open-ness
+* revision 2.3 - 2/17/89 - GT_CLOSE_SET --> TM_CLOSE_SET
+* revision 2.4 - 4/1/89  - MODE WAIT directly sets PPLUS variable deflts
+* V200:   9/1/89 - /FORMAT= code removed to EQUAL_FORMAT
+*	10/13/89 - added /LASER option to movie stuff
+*	10/23/89 - added SET DATA/EZ and SET VARIABLE
+*	11/30/89 - added SET GRID (default for abstract variables)
+*	 12/8/89 - added SET DATA/SAVE and /RESTORE
+*	12/20/89 - added SET MODE Xwindows
+*	  1/5/89 - added SET MODE metafile
+*	  5/2/89 - changed code for SET REGION/DX = (bug in DEFINE REGION)
+*	 6/11/90 - added CHECK_NEG_TAXIS to check for tstep<0
+*	 8/31/90 - added SET MOVIE/START=#
+* Unix/RISC port 4/25/91 *sh*: increased ds_name size
+*                            : bug fix in SET MODE: mode_GKS --> pmode_GKS
+* V230:  5/14/92 - REMOTE_X mode was replaced by the REFRESH mode
+*         6/9/92 - MODE DIAGNOSTIC turns on TMAP diagnostics
+*         6/?/92 - use list_fmt_type instead of list_unformatted
+*        6/12/92 - added SET DATA/FORM=CDF
+*        7/21/92 - /EZ optional if /FORMAT=unf or /FORMAT="()" given
+*        7/23/92 - SET LIST to be case sensitive
+*        8/25/92 - added SET AXIS/MODULO
+*        1/14/93 - HDF movies: SET MOVIE/APPEND --> SET MOVIE/COMPRESS
+* V300:  5/12/93 - file name args to SET MODE JOURNAL and SET MODE PPLLIST
+*	 6/16/93 - mode GUI to open reply channel
+* V301:  11/1/94 - bug: must open PLOT+ before MODE PPLLIST file is opened
+*		   bug: buff2 enlarged (was 24) cuz ppllist name was truncated
+*	 1/12/94 - SET MODE xxx pathname no longer requires quotes->"pathname"
+*		   but SET MODE accepts only a single MODE at a time
+*		   set mode meta will open PLOT+
+*	 1/24/94 - turn on metafiles in DISP_INIT instead of here
+*	           (resolve problem of metafiles created with wrong name)
+*	 2/14/94 - fixed bug introduced 1/12/94 for SET MODE CAL:DAYS
+*	 2/24/94 - incorporate a stack of past mode states
+* V312: 5/94 - array "memory" as a calling argument
+*	       added SET MEMORY mwords (and calling arg reconfig)
+* V314: 8/26/94 *kob* IBM port : Logicalv var mode_state needs to be compared
+*				 with NEQV instead of NE
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/18/94 - added SET MODE VERIFY:ALWAYS
+*	 1/29/95 - corrected error message about SET MEMORY/SIZE=
+*	 2/28/95 - update TMAP COMMON alt_messages when mode_gui is SET
+* V420:  9/27/95 - (for IBM/AIX compiler) eliminate READ(xxx,*) in SET DATA 
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+*	    4/97 *kob* - added ifdef for MANDATORY_FORMAT_WIDTHS on internal
+*			 read because linux/nag f90 needed a format width.
+*          12/98 *js* - Disallow set mem command is in secure mode
+* V500:  4/28/99 *sh* - added SET AXIS/DEPTH 
+*	    5/99 *sh* - implemented SET DATA/ORDER=
+*	    8/99 *sh* - bug fix: adjust grid_use_count
+* V510: 3/00 *sh* - remove check for negative values on time axis
+*		  - add qualifier /TREGULAR to SET DATA for netCDF data sets
+*	4/00 *sh* - documentation enhancement, only
+* V530:10/00 *sh* - added FILE/FORMAT=delimited/TYPE=/DELIMITERS=
+* V533 6/01 *sh* - bug fix "SET GRID" w/out arg didn't check for -111
+* v540 *acm* 10/01 increase length of ds_name
+* V542: *sh* 7/02 - added support for sub-span modulo axes
+* V550: *acm*10/02- Change arg to char*24, to match longer region names (cx_name)
+* v553: *kob* 8/03 - need to increase size of buff1 for long numeric dataset names
+*       *kob* 9/03 - add ich for character indicies for the internal_read_format_bug
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+*       *acm* 6/05 - add SET AXIS/CALENDAR /T0 /UNITS
+* V581: *acm*/3/05 - increase length of strings for datset title to 1024 (leave settings alone for MOVIE)
+* V600 *acm*  8/05 - Allow more digits in xrevision number
+* V600 *acm* 3/06  fixing bugs 439&1390, new arg to get_new_cx.
+* V600 *acm* 5/2006 MODE LINECOLORS User can change the number of line colors.
+*      *jli* 7/2006 added 'implicit.parm' for pline_class_stride
+*      *jli* added SET AXIS/STRIDE/OFFSET/
+* V601 *acm*11/06 Fix bug 1470: on a SET AXIS command which redefines attributes of an axis, change
+*                 values in the attribute structure for the axis.
+* V601 *acm*11/06 Fix bug 1438: A request for rediculously large memory results in an
+*                 overflow in setting reconfig, so it looks like a negative number of words 
+*                 requested. This should result in an error message.
+* V602: *acm* 1/07 Changes for metafile-batch mode: When in gif mode or batch mode, 
+*                  ignore CANCEL MODE META
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables
+*                  including changes to an attributes values and settings at the
+*                  same time, e.g. set att/output var.modulo = 300
+* V603  5/07 *acm* Fix bug 1511: if DEFINE AXIS or DEFINE ATT change a time
+*                  origin, include the origin in the units attribute as "since t0"
+*                  If units attribute is changed for a time axis, get the time
+*                  origin if it exists and append it to the units string.
+* v604 *acm* 7/07 increase length of ds_name
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V610  *acm* 3/08 Fixes for metafile batch mode
+* V613  *acm* 9/08 Correct for bug 1598: in SET ATTRIBUTE, initialize dataset number so a 
+*                  SET ATT command always computes the dataset number.
+* V63   *acm* 9/09 Fix bug 1689: definition of the offset in SET AXIS/STRIDE=/OFFSET
+*                  changes so that /OFF=0 implies 1st index=1; /OFF=1 implies 
+*                  1st index=2. Also check for and give err msg for illegal 
+*                  values STRIDE < 1 and OFFSET < 0.
+* V65   *acm* 2/10 Fix bug 1724: in metafile batch mode only, if some command
+*                  has opened the metafile but nothing plotted yet, and if
+*                  a SET MODE META:newname.plt is issued, just rename the metafile
+*                  that was opened.
+* V66   *acm* 3/10 Read qualifiers for netcdf4 SET LIST/NCFORMAT etc in call to
+*                  netcdf4_set_list_settings
+*       *kms* 5/10 add SET AXIS/REGULAR to force interpreting the axis as regular
+*       *kms* 5/10 add SET REDIRECT /TEE /JOURNAL /FILE /APPEND /CLOBBER
+*                  for stdout/stderr redirection
+* V66   *kms* 5/10 LIB_GET_LUN is a subroutine, not a function
+*       *kms* 2/11 return "mem_blk_size" instead of "mem_size" in reconfig
+* V68   *acm* 1/12 Implement micro-adjusting of repeated coordinates (ticket 1910).
+*                  To keep the previous behavior the user may specify USE/STRICT.
+* PyFr  *kms* 1/12 Add SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL
+*       *acm* 4/12 6D Ferret: time axis may be in t or f direction. 
+*       *acm* 4/12 Add new MODE FOURDEE to allow E,F,M,N,etc as user-vars
+*       *acm* 4/12 Remove MODE FOURDEE, using _E, _F, _M, _N instead, throughout.
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* V683 *acm*  8/12 add new SET LIST/OUTTYPE=  
+* PyFr  *kms* 1/13 Remove SET GRAPHICS /ENGINE /ANTIALIA /NOANTIAL;
+*                  Add /QUALITY= /AAlias /NoAAlias /ENGINE= to SET WINDOW
+* V685 *acm*  3/13 For Ensemble aggregations, call the ds_type 'ENS'
+* V685 *acm*  7/13 Added FILE/FORMAT=descriptor
+* V686 *acm*  1/14 Fix ticket 2126: set axis was messing up line_name storage
+* V687 *acm*  3/14 New SET AXIS/NAME=
+
+	include 'tmap_dims.parm'
+	include 'tmap_errors.parm'
+        include 'implicit.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdiag_ctrl.cmn_text'
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+        include 'xalt_messages.cmn_text'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'movies.parm'
+	include 'gfdl_vms.parm'
+	include 'plot_setup.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xrevision.cmn'
+	include 'xtoday.cmn'
+	include 'xvideo.cmn'
+	include	'xfr_grid.cmn'
+	include	'xcontrol.cmn'
+	include	'pltcom_dat.decl'	! with gksopn
+	include	'PLTCOM.DAT'		! with gksopn
+	include 'gkscm2.cmn'		! with first_meta
+	include	'switch_inc.decl'	! with deflts
+	include	'SWITCH.INC'	! with deflts
+        include 'LUNITS.INC'          ! with lttout
+        include 'lunits_inc.decl'
+	include 'xunits.cmn_text'
+        include 'calendar.decl'
+        include 'calendar.cmn'
+        include 'netcdf.inc'    ! with NCCHAR
+      
+* calling argument declarations:
+	INTEGER	reconfig
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	INTEGER		REGION_NUMBER, VIEWPORT_NUMBER, GRID_FROM_NAME,
+     .                  TM_GET_LINENUM, TM_LENSTR, TM_LENSTR1, 
+     .                  TM_UNIT_ID, TM_GET_CALENDAR_ID, 
+     .			FIND_DSET_NUMBER, STR_UPCASE, STR_SAME, 
+     .                  equal_pos, colon_pos, dset_num, ich, status,
+     .			tmap_status, mode, idim, iarg, item, lp, iv, 
+     .			cx, i, grid, axis, loc, perm(nferdims), buff_len, 
+     .                  cal_id, day, month, year, hour, minute, second,
+     .                  units, since_t0, len_test, len_mchars, slen, 
+     .                  len, attype_spec, pos, mr, varid, uvar, cat, 
+     .                  iflag, isetout, ivar, dot, strided_axis, igrd, 
+     .                  offset, attid, attype, attoutflag, attlen, i1, 
+     .                  dset, istat, cache_size, cache_nelems, 
+     .                  cache_preemption, numpts, redir_file_lun, 
+     .                  iline, iset
+        REAL*8          TM_WW_AXLEN, axwwlen, new_att_modulo_len
+        REAL*8          delta, dlo, dhi, firstval, lastval
+	REAL		val_buf, cache_size_mb
+	CHARACTER	TM_FMT*12, title*1024, subtitle*64, arg*24,
+     .			buff1*512, buff2*512, data_form*3, show_str*12,
+     .                  varname*512, attname*128, new_att_calendar*10, 
+     .                  new_att_t0*128, new_att_units*128, buff3*512,
+     .                  t0string*128, ustring*128, faccess*16, 
+     .                  fposition*16, fstatus*16, c1*1, typflag*10
+	LOGICAL		TM_LEGAL_UNIX_NAME, MATCH4, TM_DIGIT, 
+     .                  TM_DIGIT_ONLY,
+     .                  TM_HAS_STRING, TM_LEGAL_NAME, MATCH_NAME,
+     .                  NC_GET_ATTRIB, set_last, any_delta, dset_cdf,
+     .			do_laser_movie, past_laser_movie, start_frame,
+     .                  do_ez, tregular, its_changed, ok_cal,
+     .                  coordvar, new_att_modulo,
+     .                  got_it, redir_stdout, redir_stderr, redir_tee,
+     .                  redir_journal, redir_append, redir_clobber, 
+     .                  fexist, use_strict, is_nc, have_outtype, set_att_quiet
+
+* local parameter declarations:
+	INTEGER		slash_set_last
+	PARAMETER     ( slash_set_last = 1 )
+
+* functions
+	LOGICAL is_secure
+
+* initialize
+	reconfig = 0   	! zero signals NO memory reconfigure
+
+* select subcommand
+	GOTO ( 100,200,300,400,500,600,700,800,900,1000,
+     .        1100,1200,1300,1400,1500,1600,1700 ) subcmnd_num
+
+* SET '    ' 
+* arrival at this point usually means an illegal subcommand was given
+* and was assumed to be an argument by the command parser
+ 100	IF ( num_args .GE. 1 ) THEN
+	   CALL ERRMSG( ferr_invalid_subcmnd,status,
+     .				cmnd_buff( arg_start(1):arg_end(1) ), *5000 )
+	ELSE
+	   GOTO 5100
+	ENDIF
+	RETURN
+
+* SET WINDOW
+ 200	IF ( interactive ) CALL SET_WINDOW( status )
+	RETURN
+
+* SET REGION/I=ilow:ihigh/J=..., ... [reg_name]
+* completely replace "last" context if requested
+ 300	IF ( num_args .EQ. 1 ) THEN
+	   arg = cmnd_buff(arg_start(1):arg_end(1))
+	   cx = REGION_NUMBER( arg )
+	   IF ( cx .EQ. unspecified_int4 ) CALL ERRMSG
+     .					( ferr_unknown_arg, status, arg, *5000 )
+	   CALL TRANSFER_CONTEXT( cx, cx_last )
+	ENDIF
+
+* start with the default context from the last command
+	CALL GET_NEW_CX( cx_last, cx_buff, .TRUE., status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* apply delta context specifiers (DX=,DY=, etc) if any
+	CALL GET_DELTA_CONTEXT( 14, any_delta, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	IF ( any_delta ) THEN
+	   CALL APPLY_DELTA_CONTEXT( cx_buff, 'DEFAULT', status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* illegal delta given ?
+	DO 310 idim = 1, nferdims
+ 310	IF ( cx_given(idim,cx_buff)
+     . .AND. cx_delta(idim,cx_buff) .NE. unspecified_val8 ) GOTO 5320
+
+* wipe clean the history of the command defaults
+	CALL FORGET_PAST_CONTEXT_MODS ( cx_buff )
+
+* and since we completed with no errors - make it count
+	CALL TRANSFER_CONTEXT ( cx_buff, cx_last )
+
+	RETURN
+
+* SET VIEWPORT
+ 400	IF ( num_args .EQ. 0 ) GOTO 5100
+	item = 1
+	iv = VIEWPORT_NUMBER( cmnd_buff(item_start(1):item_end(1)) )
+	IF ( iv .EQ. unspecified_int4 ) GOTO 5020
+	CALL SET_VIEWPORT( iv )
+	RETURN
+
+* SET EXPRESSION var_name1, var_name2, ...
+ 500	IF ( num_args .EQ. 0 ) GOTO 5100
+	CALL DELETE_OLD_EXPR
+	CALL BREAK_UP_EXPR( cmnd_buff( arg_start(1):len_cmnd ),
+     .			    num_uvars_in_cmnd,
+     .			    status )
+	RETURN
+
+* SET LIST
+* ... SET LIST/PRECISION=#digits
+ 600	IF ( qual_given( slash_set_list_prec ) .GT. 0) THEN
+	   lp = qual_given( slash_set_list_prec )	! list pos.
+	   equal_pos = INDEX( cmnd_buff( qual_start(lp):qual_end(lp) ), '=' )
+	   IF ( equal_pos .EQ. 0 ) THEN
+	      list_digits = default_output_precision
+	   ELSE
+* syntax change 9/95 for IBM/AIX compatibility
+	      buff1 = cmnd_buff( equal_pos+qual_start(lp):qual_end(lp) )
+c *kob* 4/97
+#ifdef MANDATORY_FORMAT_WIDTHS
+	      READ ( buff1,*,ERR=5030 ) iv
+#else
+	      READ ( buff1,'(I)',ERR=5030 ) iv
+#endif
+	      list_digits = iv
+	   ENDIF
+	ENDIF
+* ... SET LIST/HEADING
+	IF ( qual_given( slash_set_list_heading ) .GT. 0 ) THEN
+	   list_heading = .TRUE.
+	ENDIF
+* ... SET LIST/FILE=filename
+        lp = qual_given( slash_set_list_out )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			      list_file, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	   IF ( list_file .EQ. ' ' ) list_file = 'AUTO'
+	ENDIF
+* ... SET LIST/APPEND
+	IF ( qual_given( slash_set_list_append ) .GT. 0 ) THEN
+	   list_append = .TRUE.
+	ENDIF
+*  ... SET LIST/FORMAT=(FORTRAN_FORMAT), 'UNFORMATTED', 'BIBO', 'TMAP', 'GT'
+	lp = qual_given( slash_set_list_form )
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_FORMAT( cmnd_buff(qual_start(lp):qual_end(lp)), status )
+	ENDIF
+
+*  ... SET LIST/OUTTYPE=(netcdf type), 'DOUBLE', 'FLOAT', 'INT', 'SHORT', 'BYTE'
+	lp = qual_given( slash_set_list_outtype )
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_STRING(
+     .                  cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                  list_outtype, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   have_outtype = ( INDEX(list_outtype,"DOU") .GT. 0 .OR.
+     .                    INDEX(list_outtype,"FLO") .GT. 0 .OR. 
+     .                    INDEX(list_outtype,"INT") .GT. 0 .OR.
+     .                    INDEX(list_outtype,"SHO") .GT. 0 .OR.
+     .                    INDEX(list_outtype,"BYT") .GT. 0 )
+	   IF (.NOT. have_outtype) GOTO 6810
+	ENDIF
+
+* Get and save any settings for netcdf-4 output
+
+        CALL NETCDF4_SET_LIST_SETTINGS (status)
+        IF ( status .NE. ferr_ok ) GOTO 5000
+
+	RETURN
+
+* SET DATA_SET data_set1, data_set2, ...
+ 700    ds_dset_type = ' '
+ 	IF ( qual_given(slash_set_data_save) .GT. 0
+     .	.OR. qual_given(slash_set_data_restore) .GT. 0 ) THEN
+	   IF ( num_items.GT.0 .OR. num_qualifiers.GT.1 ) GOTO 5710
+	   IF ( qual_given(slash_set_data_save) .GT. 0 )
+     .					saved_dset = cx_data_set(cx_last)
+	   IF ( qual_given(slash_set_data_restore) .GT. 0 ) 
+     .					cx_data_set(cx_last) = saved_dset
+	   RETURN
+	ENDIF
+
+* check for /BROWSE - dataset name comes from the browser
+        IF ( qual_given(slash_set_data_browse) .GT. 0 ) THEN
+           CALL GET_DATASET_NAME_FROM_BROWSER(status)
+           IF ( status .NE. ferr_ok ) RETURN
+        ENDIF
+
+* initialize an EZ data set
+* ... EZ may be implicit in /FORMAT="unformatted" or "(f77 format)"
+        loc = qual_given(slash_set_data_form )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   data_form, status )              
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           do_ez = data_form(:3) .EQ. 'UNF'
+     .       .OR.  data_form(:3) .EQ. 'FRE'
+     .       .OR.  data_form(:3) .EQ. 'DEL'
+     .       .OR.  ( INDEX( data_form, '(' ) .GT. 0 )
+        ELSE
+           do_ez = .FALSE.
+        ENDIF
+        do_ez = do_ez .OR. ( qual_given(slash_set_data_ez) .GT. 0 )
+	IF ( do_ez ) THEN
+	   IF ( num_items .EQ. 0 ) THEN
+	      CALL INIT_EZ_DSET( ' ', dset_num, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	   ELSE
+	     DO 710 item = 1, num_items
+	      CALL INIT_EZ_DSET( cmnd_buff(item_start(item):item_end(item)), 
+     .				 dset_num, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+* ... dummy calls to make EZ sets act like other sets
+	      CALL GET_DSET_PARMS( dset_num, status )
+	      CALL GET_AXIS_SPEED( dset_num )
+	      CALL MAKE_CVAR_GRIDS( dset_num, status )
+ 710	     CONTINUE
+	   ENDIF
+* ... make this data set current
+	   cx_data_set( cx_last )	=  dset_num
+	   RETURN
+	ENDIF
+
+* initialize all non-EZ data sets	
+	IF ( num_items .EQ. 0 ) GOTO 5100
+	IF ( qual_given(slash_set_data_var  ) .GT. 0 
+     .  .OR. qual_given(slash_set_data_grid ) .GT. 0 
+     .  .OR. qual_given(slash_set_data_skip ) .GT. 0 ) GOTO 5700
+
+* interpret the /TREGULAR qualifier (force reg T axis) for netCDF data sets
+        loc = qual_given(slash_set_data_tregular )
+	tregular = loc .GT. 0
+
+* interpret the /STRICT qualifier (do not micro-adjust axes with repeated 
+* coordinates) for netCDF data sets
+	use_strict = .FALSE.
+        loc = qual_given(slash_set_data_strict )
+	use_strict = loc .GT. 0
+
+* interpret the /ORDER permutation qualifier for a non-EZ data set
+	DO 720 idim = 1, nferdims
+ 720	perm(idim) = unspecified_int4 ! set default
+        loc = qual_given(slash_set_data_order )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_PERMUTE(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   .FALSE., .FALSE., .TRUE., perm, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+	DO 750 item = 1, num_items
+
+* check to see if data set was referred to by number
+* 9/95 - replaced "*" with "(I)" read from separate buffer
+* Just check the first character for a digit (ticket 1974)
+	   c1 = cmnd_buff(item_start(item):item_start(item))
+	   IF ( c1 .GE. '0' .AND. c1 .LE. '9' ) THEN
+	      buff1 = cmnd_buff(item_start(item):item_end(item))
+* *kob* 4/97
+#ifdef INTERNAL_READ_FORMAT_BUG
+* *kob* 9/03 kludge due to g77 internal read bug which does not correctly identify
+*            a character and signal an error when doing an internal read into an
+*            integer variable - e.g. 11111112_3.nc was being read as an integer so Ferret
+*            was trying to find dataset 11111112 and reporting an error
+	      buff_len = TM_LENSTR(buff1)
+              DO 730 ich = 1, buff_len
+		IF ( .NOT. TM_DIGIT(buff1(ich:ich))) GOTO 740
+ 730	      CONTINUE
+	      READ (buff1,*) dset_num
+#elif MANDATORY_FORMAT_WIDTHS
+	      READ (buff1,*,ERR=740) dset_num
+#else
+	      READ (buff1,'(I)',ERR=740) dset_num
+#endif
+* ... check for valid number given
+	      IF   ( dset_num .LT. 1
+     .	      .OR.   dset_num .GT. maxdsets
+     .	      .OR.   dset_num .GT. max_gfdl_dsets )		GOTO 5110
+	      IF ( ds_name( dset_num ) .EQ. char_init1024)	GOTO 5110
+	      GOTO 745
+	   ENDIF
+
+* no! it wasn't given by number so open the data set
+* is this a designated special format?
+ 740       loc = qual_given(slash_set_data_form )
+           IF ( loc .GT. 0 ) THEN
+              CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   data_form, status )              
+              IF ( status .NE. ferr_ok ) GOTO 5000
+              dset_cdf = data_form .EQ. 'CDF'
+              IF ( dset_cdf ) THEN
+                 ds_dset_type = 'CDF'   ! used and cleared in tm_init_dset
+              ELSEIF (data_form .EQ. 'DES') THEN
+	         ds_dset_type = ' MC'
+	      ELSE
+	         GOTO 5710
+	      ENDIF
+           ENDIF
+
+* initialize a TMAP-supported data set
+ 	   CALL TM_INIT_DSET( cmnd_buff( item_start(item):item_end(item) ),
+     .			      perm, dset_num, tregular, use_strict, tmap_status )
+	   IF ( tmap_status .EQ. merr_no_action ) THEN
+	      GOTO 745					! already init'ed
+	   ELSEIF ( tmap_status .NE. merr_ok )	  THEN
+	      GOTO 5090					! error in .DES file
+	   ENDIF
+
+* interpret special parameters in the descriptor
+	   CALL GET_DSET_PARMS( dset_num, status )
+	   IF ( status .NE. ferr_ok ) GOTO 790
+
+* determine relative access speeds along each axis
+	   CALL GET_AXIS_SPEED( dset_num )
+
+* check for negative time step values (warning, only)
+! 3/00	   CALL CHECK_NEG_TAXIS( dset_num )
+
+* build completed ( with time axis ) grids for computable variables
+	   CALL MAKE_CVAR_GRIDS( dset_num, status )
+	   IF ( status .NE. ferr_ok ) GOTO 790
+
+* make this data set current
+ 745	   cx_data_set( cx_last )	=  dset_num
+
+* 10/01 allow /TITLE for NetCDF or DODS datasets.
+           IF (qual_given(slash_set_data_title) .GT. 0) THEN
+              loc = qual_given(slash_set_data_title )
+              CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   title, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+              ds_title(dset_num) = title
+           ENDIF
+
+ 750	CONTINUE
+	RETURN
+
+
+* error in descriptor not detected by GT_INIT_DSET
+ 790	CALL TM_CLOSE_SET( dset_num, tmap_status )
+	RETURN
+
+* SET MODE mode_name argument  (or mode_name:argument)
+ 800	set_last = qual_given( slash_set_last ) .GT. 0
+	IF ( num_items .EQ. 0 ) GOTO 5100
+
+* identify the specified mode to SET
+* ... syntax can be SET MODE mode  or  SET MODE mode:arg  or  SET MODE mode arg
+* ... since "arg" may contain "/" for a path name treat all text after the end
+*     of the named mode as the argument  (modified this block 1/94)
+	item = 1
+
+	colon_pos = INDEX( cmnd_buff(item_start(1):item_end(1)), ':' )
+	IF ( colon_pos .GT. 0 ) THEN
+	   IF ( colon_pos .EQ. 1 ) GOTO 5010   ! colon as 1st character ???
+	   buff1 = cmnd_buff( item_start(1):item_start(1)+colon_pos-2)
+	   buff2 = cmnd_buff( item_start(1)+colon_pos:len_cmnd )
+	ELSEIF ( arg_end(1) .EQ. len_cmnd ) THEN     ! no argument given
+	   buff1 = cmnd_buff( item_start(1):item_end(1) )
+	   buff2 = ' '
+	ELSE
+	   buff1 = cmnd_buff( item_start(1):item_end(1) )
+	   buff2 = cmnd_buff( arg_end(1)+1:len_cmnd )
+	ENDIF
+	CALL LEFT_JUST( buff2, buff2, loc )
+* ... remove surrounding quotation marks on argument, if any
+	IF ( buff2(1:1) .EQ. '"' .AND. buff2(loc:loc) .EQ. '"'
+     .	.AND. loc .GT.2  	) buff2 = buff2(2:loc-1)
+* ... identify the mode name
+        len_test = TM_LENSTR(buff1)
+	DO 810 mode = 1, max_modes
+           len_mchars = TM_LENSTR(mode_name(mode)(:4))
+	   IF ( MATCH4( buff1, len_test,
+     .               mode_name( mode ),len_mchars )) THEN
+	      IF ( mode.EQ.pmode_GKS .AND. gksopn ) GOTO 5820
+* ... ignore MODE VERIFY from a GO file if MODE VERIFY:ALWAYS is set
+	      IF ( mode.EQ.pmode_verify
+     .	     .AND. mode_arg(mode,1).EQ.3
+     .	     .AND. csp .GT. 0 ) GOTO 820
+	      iarg = unspecified_int4
+	      CALL GET_MODE_ARG( mode, buff2, iarg, status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	      IF ( set_last ) THEN
+* ... pop the mode stack
+	         DO 804 i = 2, mode_stack_size
+	            mode_state(mode,i-1) = mode_state(mode,i) 
+		    mode_arg  (mode,i-1) = mode_arg  (mode,i)
+ 804	         CONTINUE
+	      ELSE
+* ... push the mode stack adding on a TRUE (because it is SET)
+	         DO 806 i = mode_stack_size, 2, -1
+	            mode_state(mode,i) = mode_state(mode,i-1) 
+		    mode_arg  (mode,i) = mode_arg  (mode,i-1)
+ 806	         CONTINUE
+	         mode_state( mode, 1 ) = .TRUE.
+	         IF ( iarg .NE. unspecified_int4 ) 
+     .					mode_arg( mode,1 ) = iarg
+	      ENDIF
+* ... WAIT requires a string to communicate with PPLUS
+	      IF ( mode .EQ. pmode_wait ) THEN
+		 deflts(5) = mode_wait	! set PPLUS wait state
+	         IF ( mode_wait ) THEN
+	            ppl_wait = 'WAIT'
+	         ELSE
+	            ppl_wait = 'NOWAIT'
+	         ENDIF
+* ... when REJECT is changed transformed and regridded variables may be wrong
+* *kob* mode_state needs to compared using NEQV because it is a logical 8/94
+	      ELSEIF ( mode .EQ. pmode_reject
+     .		    .AND. (mode_state(mode,1) .NEQV. mode_state(mode,2)) ) THEN
+	         CALL DELETE_TRANSFORMED_VARS( status )
+	         IF ( status .NE. ferr_ok ) RETURN
+* ... mode REFRESH send a message to the gnu readline routine
+	      ELSEIF ( mode .EQ. pmode_Xwindows ) THEN
+	         CALL TM_SET_FREE_EVENT(1)
+* ... mode metafile may require immediate communication with PPLUS
+	      ELSEIF ( mode .EQ. pmode_metafile ) THEN
+                 IF ( .NOT. pplus_started ) CALL START_PPLUS(.FALSE.)
+                 CALL PPLCMD(from, line, 0, 'PLTNME '//buff2, 1, 1)
+                 CALL WARN('the use of "SET MODE METAFILE" is deprecated;')
+                 CALL WARN('instead use "FRAME /FILE=... /FORMAT=..."')
+                 mode_metafile = .TRUE.
+* ... mode diagnostic sends message to TMAP library
+	      ELSEIF ( mode .EQ. pmode_diagnostic ) THEN
+	         tmap_diag_on = .TRUE.
+* ... mode journal opens a journal file
+	      ELSEIF ( mode .EQ. pmode_journal ) THEN
+                 IF ( jrnl_lun .NE. unspecified_int4 )
+     .                  CLOSE( UNIT=jrnl_lun, ERR = 5830 )
+	         CALL INIT_JOURNAL( status )
+                 IF ( status .NE. ferr_ok ) THEN
+                    mode_journal = .FALSE.
+		    GOTO 5840
+	         ENDIF
+* ... mode ppllist directs PLOT+ listings to a file
+	      ELSEIF ( mode .EQ. pmode_ppllist ) THEN
+	         IF ( .NOT.pplus_started ) CALL START_PPLUS(.FALSE.)
+                 IF ( lttout .NE. 6 )
+     .              CLOSE( UNIT=lttout, ERR = 5830 )
+                 CALL LIB_GET_LUN( lttout )
+                 OPEN ( FILE=ppllist_file,
+     .                  UNIT=lttout,
+     .                  STATUS='UNKNOWN',
+     .                  ERR = 5850 )
+* ... mode grat sets graticules on, and saves argument
+              ELSEIF ( mode .EQ. pmode_grat ) THEN
+	         grat_on = .TRUE.
+                 mode_grat_buff = buff2
+
+* ... mode linecolors sets the number of line colors on the next new window
+* If there is no plot drawn yet, go ahead reset the number of colors now.
+              ELSEIF ( mode .EQ. pmode_linecolors ) THEN
+
+                 WRITE (show_str, 2000) mode_arg(pmode_linecolors, 1)
+ 2000            FORMAT (I3)
+                 IF (no_plot_yet) THEN
+                    CALL START_PPLUS(.FALSE.)
+                    CALL PPLCMD (from, line, 0, 
+     .                'LINECOLORS '//show_str(1:3)//' 1', 1, 1)
+                    CALL DISP_RESET
+                 ELSE
+                    CALL PPLCMD (from, line, 0, 
+     .                'LINECOLORS '//show_str(1:3)//' 0', 1, 1)
+                    CALL WARN ('New # of line colors will take '//
+     .                'effect on next new window: SET WIN/NEW then '//
+     .                'define pen colors')
+                 ENDIF
+
+* ... mode nlevels sets the default number of contour intervals.
+              ELSEIF ( mode .EQ. pmode_nlevels ) THEN
+                 CALL SET_DEFAULT_NLEVELS( mode_arg(pmode_nlevels, 1) )
+
+* ... mode shrink_ylab allows the y-axis label to automatically shrink
+*     so it doesn't run off the page.
+              ELSEIF ( mode .EQ. pmode_shrink_ylab ) THEN
+	         CALL PPLCMD ( from, line, 0, 'SHRINKY 1', 1, 1 )
+
+	      ENDIF
+	      GOTO 820
+	   ENDIF
+ 810	CONTINUE
+	   GOTO 5020
+ 820	RETURN
+
+* SET MOVIE[/FILE=filename] [title]
+* Movies are discontinued with Ferret v6.6: NetCDF-4 / HDF5
+
+ 900	GOTO 5086
+        past_laser_movie = frame_file .EQ. plaser_flag
+	do_laser_movie = qual_given( slash_set_movie_laser ) .GT. 0
+	IF ( frame_on ) THEN
+	   IF ( past_laser_movie ) THEN
+	      CALL ODR_OP( 'RC', -1, -1 )	! clear record mode
+	      CALL LASER_STATUS( buff1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5085
+	      CALL ODR_QUIT
+	      CALL LASER_STATUS( buff1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5085
+	   ENDIF
+	ENDIF
+	frame_on = .FALSE.
+
+        lp = qual_given( slash_set_movie_out )
+	IF ( lp .GT. 0 ) THEN
+	   IF ( do_laser_movie ) GOTO 5082
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			      title(1:80), status )
+           IF ( status .NE. ferr_ok ) RETURN
+           IF ( .NOT. TM_LEGAL_UNIX_NAME(title(1:80)) ) GOTO 5083
+           frame_file = title(1:80)
+	ENDIF
+
+        lp = qual_given( slash_set_movie_start )
+	start_frame = lp .GT. 0
+	IF ( start_frame ) THEN
+	   IF (.NOT.do_laser_movie) GOTO 5082
+           CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			   val_buf, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ENDIF
+
+        lp = qual_given( slash_set_movie_compress )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                        buff1, status )
+           IF ( status .NE. ferr_ok ) RETURN
+           IF ( buff1(1:1) .EQ. 'N'
+     .     .OR. buff1(1:3) .EQ. 'OFF' ) THEN
+              frame_compress = ' '
+	   ELSEIF ( buff1 .EQ. ' '
+     .     .OR. buff1(1:2) .EQ. 'ON'
+     .     .OR. buff1(1:1) .EQ. 'Y' ) THEN
+	      frame_compress = 'RLE'
+           ELSE
+              GOTO 5084
+	   ENDIF
+        ENDIF
+	IF ( num_args .GT. 0 ) THEN
+	   title = cmnd_buff( arg_start(1) : len_cmnd )
+	ELSE
+	   title = 'GFDL movie output'
+	ENDIF
+        show_str = TM_FMT(revision_level, 5, 12, slen)
+	WRITE ( subtitle, 3000 ) program_name(1:len_program_name),
+     .				 progname_mod(1:len_progname_mod),
+     .				 show_str
+ 3000	FORMAT(' Program ',A,1X,A,'  version',A )
+
+	IF ( do_laser_movie ) THEN
+	      CALL ODR_INIT
+	      CALL LASER_STATUS( buff1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5085
+	      IF ( start_frame ) THEN
+	         CALL ODR_OP( 'SR', INT(val_buf), -1 )
+	         CALL LASER_STATUS( buff1, status )
+	         IF ( status .NE. ferr_OK ) GOTO 5085
+	      ENDIF
+	      CALL ODR_OP( 'RM', -1, -1 )	! record mode:arbitrary # frames
+	      CALL LASER_STATUS( buff1, status )
+	      IF ( status .NE. ferr_OK ) GOTO 5085
+	      frame_file = plaser_flag
+	ENDIF
+	frame_on = .TRUE.
+	RETURN
+
+* SET VARIABLE
+ 1000	IF ( num_items .NE. 1 ) GOTO 5100
+	CALL SET_VAR( cmnd_buff(item_start(1):item_end(1)), status )
+	RETURN
+
+* SET GRID
+* NOTE: for historical reasons mgrid_abstract is the name of the SET GRID
+ 1100	IF ( qual_given(slash_set_grid_save) .GT. 0 ) THEN
+	   saved_abstract_grid = mgrid_abstract
+	   RETURN
+	ENDIF
+	IF ( num_items .GT. 1 ) THEN
+	   GOTO 5100
+	ELSEIF ( num_items .EQ. 1 ) THEN
+	   grid = GRID_FROM_NAME( cmnd_buff(item_start(1):item_end(1)),
+     .			          cx_last, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ELSEIF ( qual_given(slash_set_grid_restore) .GT. 0 ) THEN
+	   IF ( saved_abstract_grid.EQ.unspecified_int4) GOTO 6110
+	   grid = saved_abstract_grid
+	ELSE
+* ... set the grid from last command
+	   cx = is_cx( 1 )
+	   IF ( cx.EQ.0 .OR. cx.EQ.unspecified_int4 )	GOTO 5120
+	   grid = cx_grid( cx )
+	   IF ( grid .EQ. unspecified_int4 )	GOTO 5120
+	ENDIF
+* ... adjust the use count
+	CALL TM_USE_DYN_GRID(grid)
+	CALL TM_DEALLO_DYN_GRID(mgrid_abstract)
+* ... eliminate all memory-resident user-defined vars and their uvar_grid 's
+	CALL PURGE_ALL_UVARS
+	mgrid_abstract = grid
+	RETURN
+
+* SET AXIS  /MODULO /DEPTH /CALENDAR /REGULAR /T0 /UNITS /OUTTYPE
+ 1200	axis = TM_GET_LINENUM( cmnd_buff(item_start(1):item_end(1)) )
+        IF ( axis .EQ. unspecified_int4 ) GOTO 6210
+* /MODULO
+        new_att_modulo = .FALSE.
+        new_att_modulo_len = 0.D0
+	lp = qual_given(slash_set_axis_modulo)
+	IF ( lp .GT. 0 ) THEN
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			      val_buf, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF (val_buf .EQ. unspecified_val4) THEN
+	      val_buf = 0.0
+	   ELSE
+	      val_buf = ABS(val_buf)  ! ABS to tolerate negatives
+	   ENDIF
+	   its_changed = .NOT.line_modulo(axis)
+     .		    .OR.  val_buf .NE. line_modulo_len(axis)
+           line_modulo( axis ) = .TRUE.
+	   line_modulo_len( axis ) = val_buf
+
+           new_att_modulo = .TRUE.
+           new_att_modulo_len = val_buf
+
+* ... wipe memory clear of stored variables - this could change all definitions
+*      ( could be more selective for efficiency by checking to see where this
+*      axis gets used )
+	   IF ( its_changed ) THEN
+              DO 1210 i = 1,max_mr_avail
+ 1210         IF ( mr_protected( i ) .NE. mr_deleted ) 
+     .                                CALL DELETE_VARIABLE( i )
+           ENDIF
+        ENDIF
+* /DEPTH
+	IF ( qual_given(slash_set_axis_depth) .GT. 0 ) THEN
+           IF ( line_direction(axis) .EQ. 'DU' ) THEN
+	      line_direction(axis) = 'UD'
+           ENDIF
+        ENDIF
+
+* /OUTTYPE= INTYPE, DOUBLE, FLOAT, INT, SHORT, or NONE
+	loc = qual_given(slash_set_axis_outtype )
+	IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      buff1, status )
+           IF ( status .NE. ferr_ok ) RETURN
+           i = STR_UPCASE (typflag, buff1)
+
+           IF (typflag(1:5) .EQ. 'INPUT'  ) THEN   ! input type
+              line_dattype(axis) = 99  ! do not change from incoming type
+           ELSE IF (typflag(1:3) .EQ. 'BYT' .OR. typflag(1:4) .EQ. 'INT1') THEN
+              line_dattype(axis) = 1   ! NC_BYTE
+           ELSE IF (typflag(1:3) .EQ. 'SHO' .OR. typflag(1:4) .EQ. 'INT2') THEN
+              line_dattype(axis) = 3   ! NC_SHORT
+           ELSE IF (typflag(1:3) .EQ. 'INT' .OR. typflag(1:4) .EQ. 'INT4') THEN
+              line_dattype(axis) = 4   ! NC_INT (4-byte integer)
+           ELSE IF (typflag(1:3) .EQ. 'FLO' .OR. typflag(1:3) .EQ. 'REA') THEN
+              line_dattype(axis) = 5   ! NC_FLOAT
+           ELSE IF (typflag(1:3) .EQ. 'DOU') THEN
+              line_dattype(axis) = 6   ! NC_DOUBLE
+           ELSE IF (typflag(1:3) .EQ. 'NON') THEN
+              line_dattype(axis) = -1  ! Flag for no-write
+           ELSE
+              GOTO 6900
+           ENDIF
+	ENDIF
+
+*/CALENDAR 
+        new_att_calendar = ' '
+	loc = qual_given(slash_set_axis_calendar) 
+        IF (loc .GT. 0) THEN
+           IF ( line_direction(axis) .EQ. 'TI' .OR. 
+     .          line_direction(axis) .EQ. 'FI' ) THEN
+
+	      CALL EQUAL_STRING(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff1, status )
+              IF ( status .NE. ferr_ok ) GOTO 6310
+
+              ok_cal = .FALSE.
+
+              IF (buff1(1:3) .EQ. '360') buff1 = '360_DAY' 
+              IF (buff1(1:3) .EQ. 'STA') buff1 = 'GREGORIAN' 
+              IF (buff1(1:3) .EQ. 'PRO') buff1 = 'GREGORIAN' 
+              IF (buff1(1:3) .EQ. 'COM') buff1 = 'NOLEAP' 
+              IF (buff1(1:3) .EQ. '365') buff1 = 'NOLEAP' 
+              IF (buff1(1:3) .EQ. '366') buff1 = 'ALL_LEAP' 
+
+              DO 1220 i = 1, mxcals
+                 IF (buff1(1:3) .EQ. allowed_calendars(i)(1:3) ) THEN
+                    ok_cal = .TRUE.
+                    line_cal_name(axis) = allowed_calendars(i)
+                 ENDIF
+ 1220         CONTINUE
+
+              IF (.NOT. ok_cal) GOTO 6320
+              new_att_calendar = line_cal_name(axis)
+
+           ENDIF
+
+        ENDIF
+
+*  /REGULAR
+        IF ( qual_given(slash_set_axis_regular) .GT. 0 ) THEN
+           IF ( .NOT. line_regular(axis) ) THEN
+*             ** Get first and last axis values (assumed to be valid)
+*                and number of points **
+              numpts = line_dim(axis)
+              i = line_subsc1(axis)
+              firstval = line_mem(i)
+              i = i + numpts - 1
+              lastval = line_mem(i)
+*             ** Free up memory used by the array of axis values **
+              CALL PACK_LINE_STORAGE(axis)
+*             ** Assign values for a regular axis **
+              line_start(axis) = firstval
+              line_delta(axis) = (lastval - firstval) / (numpts - 1.0)
+              line_regular(axis) = .TRUE.
+              CALL WARN('Axis reset to be regular (evenly-spaced): '
+     .                  //line_name(axis))
+           ELSE
+              CALL WARN('Axis is already regular: '//line_name(axis))
+           ENDIF
+        ENDIF
+
+*  /T0 
+        new_att_t0 = ' '
+	loc = qual_given(slash_set_axis_t0) 
+        IF (loc .GT. 0 ) THEN
+           IF ( line_direction(axis)(1:1) .EQ. 'T' .OR.
+     .          line_direction(axis)(1:1) .EQ. 'F' ) THEN
+
+	      CALL EQUAL_STRING(
+     .                cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                buff1, status )
+              IF ( status .NE. ferr_ok ) GOTO 6410
+
+              CALL TM_BREAK_DATE (buff1, 1, year, month, day,
+     .				  hour, minute, second,status)
+              IF ( status .NE. ferr_ok ) GOTO 6420
+              line_t0(axis) = buff1
+              new_att_t0 = buff1
+              IF (line_direction(axis)(1:1) .EQ. 'T') 
+     .          line_direction(axis) = 'TI'
+              IF (line_direction(axis)(1:1) .EQ. 'F') 
+     .          line_direction(axis) = 'FI'
+
+           ENDIF
+
+        ENDIF
+
+* /NAME
+
+	loc = qual_given(slash_set_axis_name) 
+	IF (loc .GT. 0 ) THEN
+	   IF ( num_args .EQ. 0 ) GOTO 6680
+
+	   CALL EQUAL_STR_LC(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff1, status )
+	   IF ( status .NE. ferr_ok ) GOTO 6680
+
+* check that the name isnt an already-defined axis
+
+	   iline = TM_GET_LINENUM (buff1)
+	   IF (iline .NE. unspecified_int4) GOTO 6690
+
+	   IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 6692
+
+* Replace the name in the linked-list structure.
+
+          iset = -2  ! stored info on user-defined axes
+          CALL CD_GET_VAR_ID (iset, line_name(axis), varid, status )
+	  IF (varid .GT. 0) CALL CD_RENAME_VAR(iset, varid, buff1, status)
+
+	   DO 1240 iset = 1, maxdsets
+	      IF ( ds_name(iset) .EQ. char_init1024) GOTO 1240
+	      CALL CD_GET_VAR_ID (iset, line_name(axis), varid, status )
+              IF (varid .GT. 0) CALL CD_RENAME_VAR(iset, varid, buff1, status)
+ 1240	   CONTINUE
+
+* Replace the name in Ferret's line storage.
+	   line_name(axis) = buff1
+
+        ENDIF
+
+
+
+*  /UNITS
+* Note we do not change line direction with a resetting of units; line
+* direction UD, DU, WE, SN stay as they were when they were input.
+
+        new_att_units = ' '
+	loc = qual_given(slash_set_axis_units) 
+        IF (loc .GT. 0 ) THEN
+           IF ( num_args .EQ. 0 ) GOTO 6410
+
+	   CALL EQUAL_STR_LC(
+     .                   cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                   buff1, status )
+           IF ( status .NE. ferr_ok ) GOTO 6510
+
+           since_T0 = MAX( INDEX(buff1,'since'), INDEX(buff1,'SINCE') )
+           IF (since_T0 .GT. 0) GOTO 6520
+
+           line_units(axis) = buff1
+           new_att_units = buff1
+
+* ... decode the units (code lifted from cd_get_1_axis)
+
+           units = TM_UNIT_ID( line_units(axis) )
+
+* Named calendar with unit=year gets length of year in that calendar.
+
+           cal_id = TM_GET_CALENDAR_ID (line_cal_name(axis))
+           IF (units .EQ. -6 .OR. units .EQ. -10) THEN
+              IF (cal_id .EQ. d360) units = -9
+              IF (cal_id .EQ. julian) units = -12
+              IF (cal_id .EQ. noleap) units = -11
+              IF (cal_id .EQ. all_leap) units = -8
+           ENDIF
+
+           line_unit_code(axis) = units
+           IF  ( units.EQ.0 .AND. line_units(axis) .NE. ' ' ) THEN
+              CALL WARN ('Units  not recognized: '//line_units(axis))
+              CALL WARN ('They will not be convertible:')
+           ENDIF
+           IF ( units .GE. 0 ) THEN
+              line_tunit(axis) = real4_init
+           ELSE
+              line_tunit(axis) = un_convert(line_unit_code(axis))
+           ENDIF
+
+* See if we are resetting from a generic XX or YY axis to a geographic one.
+
+           IF (line_direction(axis) .EQ. 'XX') THEN
+              IF ( units .EQ. 4 .AND. 
+     .              TM_HAS_STRING(line_units(axis), 'deg')
+     .             .OR. TM_HAS_STRING(line_units(axis), 'lon') ) THEN 
+                 line_direction(axis) = 'WE'
+
+* Should we set axis to modulo?
+                 axwwlen = TM_WW_AXLEN(axis)
+                 IF ( axwwlen .LE. 360.D0 ) THEN
+                    line_modulo(axis) = .TRUE.
+                    IF (line_modulo_len(axis) .EQ. 0.0D0)
+     .                    line_modulo_len(axis) = 360.D0
+                 ENDIF
+
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'YY') THEN
+              IF ( units .EQ. 4 .AND. 
+     .                  TM_HAS_STRING(line_units(axis), 'deg')
+     .             .OR. TM_HAS_STRING(line_units(axis), 'lat') ) THEN 
+                    line_direction(axis) = 'SN'
+              ENDIF
+           ENDIF
+
+* recheck units and see if we are resetting from a geographic axis to a 
+* non-geographic one or a calendar to non-calendar.
+
+           IF (line_direction(axis) .EQ. 'WE' .OR. 
+     .         line_direction(axis) .EQ. 'XX' ) THEN
+              IF ( units .NE. 4 ) THEN 
+                 line_direction(axis) = 'XX'
+                 IF (units .LT. 0) THEN
+                    CALL WARN ('Units  not recognized for X axis: '
+     .                 //line_units(axis))
+                    CALL WARN ('They will not be convertible')
+                 ENDIF
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'SN' .OR. 
+     .         line_direction(axis) .EQ. 'YY' ) THEN
+              IF ( units .NE. 4 ) THEN 
+                 line_direction(axis) = 'YY'
+                 IF (units .LT. 0) THEN
+                    CALL WARN ('Units  not recognized for Y axis: '
+     .                 //line_units(axis))
+                    CALL WARN ('They will not be convertible')
+                 ENDIF
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'DU' .OR. 
+     .         line_direction(axis) .EQ. 'UD' ) THEN
+               IF (units .LT. 0) THEN
+                 CALL WARN ('Units  not recognized for Z axis: '
+     .                 //line_units(axis))
+                 CALL WARN ('They will not be convertible')
+              ENDIF
+           ENDIF
+
+           IF (line_direction(axis) .EQ. 'TI' .OR. 
+     .         line_direction(axis) .EQ. 'TT' ) THEN
+              IF ( units .GE. 0 ) THEN 
+                 line_direction(axis) = 'TT'
+                 CALL WARN ('Units  not recognized for T axis: '
+     .                 //line_units(axis))
+                 CALL WARN ('They will not be convertible')
+              ENDIF
+           ENDIF
+           IF (line_direction(axis) .EQ. 'FI' .OR. 
+     .         line_direction(axis) .EQ. 'FF' ) THEN
+              IF ( units .GE. 0 ) THEN 
+                 line_direction(axis) = 'FF'
+                 CALL WARN ('Units  not recognized for F axis: '
+     .                 //line_units(axis))
+                 CALL WARN ('They will not be convertible')
+              ENDIF
+           ENDIF
+
+        ENDIF  ! set axis/units
+
+* Combine new attribute units and/or time origin to express the units
+* attribute as units since time-origin
+
+           IF (line_direction(axis)(1:1) .EQ. 'T' .OR. 
+     .         line_direction(axis)(1:1) .EQ. 'F' ) THEN
+              IF (new_att_units .NE. ' ') THEN
+              i1 = TM_LENSTR1(new_att_units)
+              new_att_units = new_att_units(1:i1)//' since ' 
+     .            // new_att_t0
+              IF (new_att_t0 .EQ. ' ') 
+     .            new_att_units = new_att_units(1:i1)//' since ' 
+     .            // line_t0(axis)
+           ELSE
+              IF (new_att_t0 .NE. ' ') THEN
+                 i1 = TM_LENSTR1(line_units(axis))
+                 new_att_units = line_units(axis)(1:i1)//' since ' 
+     .            // new_att_t0
+              ENDIF
+           ENDIF
+        ENDIF
+
+*  /STRIDE and /OFFSET
+
+        loc = qual_given(slash_set_axis_stride)
+        IF (loc .GT. 0 ) THEN
+
+*       Get the stride value
+           IF ( loc .GT. 0 ) THEN
+              CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                     val_buf, status )
+              IF ( status .NE. ferr_ok ) RETURN
+           ELSE
+              val_buf = 0
+           ENDIF
+
+* ...   STRIDE value must be positive
+           delta = val_buf
+           IF (delta .LT. 0) GOTO 6670  
+
+* ...   If STRIDE value is 1 -- ignore the command.                    (II.2.c)
+           IF( delta .EQ. 1) RETURN 
+
+* ...   Elimate all cached memory                                     (II.1)
+           CALL PURGE_ALL_MEMORY
+
+* ...   Eliminate all memory-resident user-defined vars and their 
+*       uvar_grid 's (II.1)
+           CALL PURGE_ALL_UVARS
+ 
+* ...   Check that it's legal to issue SET AXIS/STRIDE for this axis  (II.2.a)
+
+*       not legal if this is a non-dynamic axis
+           IF(axis .LE. max_lines) GOTO 6620           
+
+*       not legal if it is a child axis already
+           IF(line_parent(axis) .NE. 0) GOTO 6630
+
+* ...   Check that the /stride and /offset values given are legal      (II.2.b)
+           loc = qual_given(slash_set_axis_offset)
+           IF (loc .GT. 0) THEN
+              CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                     val_buf, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              offset = INT(val_buf)
+           ELSE
+              offset = 0
+           ENDIF
+
+* ...   offset must be less than the stride value
+           IF(offset .GE. delta) GOTO 6640 
+           IF(offset .LT. 0) GOTO 6660 
+
+* ... Add 1 to the offset given by the user: SET AXIS/STRIDE= /OFFSET=0
+* ... now means start with index=1; etc. Different from orig. implementaion
+* ... which had /OFF=1 implies start with index=1.
+           offset = offset + 1
+
+* jli: is there a function to get the line orientation idim ?
+
+            igrd=0
+ 6300      CALL TM_NEXT_DYN_GRID( igrd, *6399)
+              DO 6301 i=1, nferdims
+                 IF ( grid_line(i, igrd) .EQ. axis ) THEN
+                    idim=i
+                 ENDIF
+ 6301         CONTINUE
+           GOTO 6300
+ 6399      CONTINUE
+
+* ...   Check that this native axis is used only for variables from 
+*       netCDF datasets                                                (II.3)  
+
+*       loop through all dynamic grids
+
+           igrd = 0
+ 6000      CALL TM_NEXT_DYN_GRID( igrd, *6099)
+              IF ( grid_line(idim, igrd) .EQ. axis ) THEN
+*       loop through all of the file variables
+                 DO 6010 i = 1, maxvars
+                    IF (ds_grid_number(i) .EQ. igrd) THEN 
+		       is_nc = (ds_type(ds_var_setnum(i)).EQ.'CDF') .OR.
+     .                         (ds_type(ds_var_setnum(i)).EQ.'ENS')
+                       IF (.NOT. is_nc)  
+     .                   GOTO 6088
+                    ENDIF
+ 6010            CONTINUE
+              ENDIF
+           GOTO 6000
+ 6099      CONTINUE
+
+* ...   Define the new strided axis                                    (II.4)
+
+           dlo = offset      
+           dhi = line_dim(axis)
+ 
+           CALL TM_GET_LIKE_DYN_LINE( idim,
+     .                                 dlo,
+     .                                 dhi,
+     .                                 delta,
+     .                                 axis,   ! original axis
+     .                                 pline_class_stride,
+     .                                 strided_axis,  ! your new native-stride axis 
+     .                                 status)
+            IF ( status .NE. ferr_ok ) GOTO 6650
+
+        line_offset(strided_axis) = offset
+
+        line_reversed(strided_axis) = .FALSE.
+
+*       Check if the native axis is reversed
+        IF( (perm(idim) .LT. 0) .AND. 
+     .      (perm(idim) .NE. unspecified_int4) ) THEN
+            line_reversed(strided_axis) = .TRUE. 
+        ENDIF
+
+*       set modulo property
+        IF(line_modulo(axis)) THEN
+           IF(MOD(dhi,delta) .EQ. 0) THEN
+              line_modulo(strided_axis) = .TRUE.
+              line_modulo_len(strided_axis) = line_modulo_len(axis) 
+           ELSE
+
+              CALL WARN(
+     . 'Stride value not an integer factor of axis length: '//
+     . 'Axis loses modulo property')
+           ENDIF
+        ENDIF
+
+* ...   Replace the original axis with the new dynamic axis in 
+*       all grids where it is used                                      (II.5)
+
+*       loop through all dynamic grids  
+
+           igrd = 0
+
+ 6001      CALL TM_NEXT_DYN_GRID( igrd, *6199)
+               IF ( grid_line(idim, igrd) .EQ. axis ) THEN
+                  grid_line(idim,igrd) = strided_axis
+                  CALL TM_USE_LINE(strided_axis)
+*                   DO 6011 i = 1, maxvars
+*                    IF(ds_grid_number(i) .EQ. igrd) THEN
+*                        ds_grid_end(idim,i) = 18
+*                    ENDIF
+* 6011              CONTINUE
+               ENDIF
+           GOTO 6001        
+ 6199      CONTINUE
+       ENDIF
+
+* ... Check the attribute structure for this axis name and change 
+*     attribute values as needed.
+
+       buff2 = line_name(axis)
+       CALL RESET_AX_ATT (buff2, new_att_units, 
+     .           new_att_t0, new_att_calendar, new_att_modulo,
+     .           new_att_modulo_len, line_direction(axis), 
+     .           line_regular(axis) )
+
+	RETURN
+
+* SET MEMORY/MWORDS=megawords
+ 1300	IF ( num_args .GT. 0 ) GOTO 5800
+	if (is_secure()) then
+	   call SPLIT_LIST(pttmode_help, err_lun,
+     1	        'This command is not allowed.', 0)
+	   return
+	endif
+        lp = qual_given( slash_set_memory_words )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			   val_buf, status )
+           IF ( status .NE. ferr_ok ) RETURN
+	ELSE
+	   val_buf = 0
+	ENDIF
+	IF ( val_buf .GT. 0.0 ) THEN
+* for neatness make mem_blk_size always be a multiple of 100
+* If val_buf is small, make it the minimum size for the block size
+* When val_buf is large, the calculation can overflow.
+* Check for this...
+
+	   reconfig = INT(val_buf*1E6/(max_mem_blks*100))
+	   IF (reconfig .EQ. 0) reconfig = 1
+	   reconfig = reconfig * 100
+
+           IF (reconfig .LT. 0) THEN
+              reconfig = 0
+              CALL WARN('internal overflow expressing '//
+     .          cmnd_buff(qual_start(lp)+4:qual_end(lp))//
+     .		' Mwords as words. Restoring previous memory size.')
+           ENDIF
+	ENDIF
+* clear the current contents of memory
+	DO 1310 i = 1,max_mr_avail
+	   IF ( mr_protected(i) .NE. mr_deleted ) CALL DELETE_VARIABLE(i)
+ 1310	CONTINUE
+	CALL SPLIT_LIST(pttmode_ops, err_lun,
+     .			' Cached data cleared from memory', 0)
+
+        RETURN
+
+* SET ATTRIBUTE/TYPE= /DATASET= /OUTPUT[=] /LIKE= /QUIET
+ 1400 IF ( num_args .LT. 1 ) GOTO 5900
+      CALL NAME_EQUAL_STRING_VATT ( buff1, pos, status )
+      IF ( status .NE. ferr_ok )  GOTO 5000
+      dset_num = unspecified_int4
+
+      loc = qual_given( slash_set_attr_like ) 
+
+*     Inherit all attributes from another variable.
+* ... SET ATT/LIKE=var1 var2
+      loc = qual_given( slash_set_attr_like ) 
+      IF ( loc .GT. 0 ) THEN
+	 CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      buff2, status )
+         CALL INHERIT_ATTRS (buff2, buff1, status)
+
+         RETURN
+      ENDIF
+
+
+* ... SET ATT/OUTPUT varname.attname
+* ... SET ATT/OUTPUT=all varname
+* ... SET ATT/OUTPUT=default varname
+* ... SET ATT/OUTPUT=none varname
+
+      buff2 = ' '
+      loc = qual_given( slash_set_attr_output ) 
+      IF ( loc .GT. 0 ) THEN
+	 CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      buff2, status )
+         GOTO 1410
+      ENDIF
+
+      IF ( pos.EQ.0) GOTO 5100
+      IF ( INDEX(buff1,'..') .EQ. 1 ) THEN
+         ivar = 0  ! global attr.
+	 varname = '.'
+      ELSE
+         IF ( .NOT.TM_LEGAL_NAME(buff1) ) GOTO 5100
+      ENDIF
+
+      set_att_quiet = qual_given( slash_set_attr_quiet ) .GT. 0
+
+* SET ATRIBUTE/TYPE=  varname.attname
+* types are: BYTE, CHAR or STRING, SHORT or INT2, INT or INT4, FLOAT, DOUBLE
+* From netcdf.inc:
+*   typedef enum {
+*   	NC_NAT =	0,	/* NAT = 'Not A Type' (c.f. NaN) */
+*   	NC_BYTE =	1,	/* signed 1 byte integer */
+*   	NC_CHAR =	2,	/* ISO/ASCII character */
+*   	NC_SHORT =	3,	/* signed 2 byte integer */
+*   	NC_INT =	4,	/* signed 4 byte integer */
+*   	NC_FLOAT =	5,	/* single precision floating point number */
+*   	NC_DOUBLE =	6	/* double precision floating point number */
+*   } nc_type;
+
+      attype_spec = ptype_unknown
+      loc = qual_given(slash_set_attr_type)
+      IF ( loc .GT. 0 ) THEN
+         CALL EQUAL_STRING(
+     .      cmnd_buff(qual_start(loc):qual_end(loc)),
+     .             buff2, status )
+         IF ( status .NE. ferr_ok ) RETURN
+
+         IF (buff2(1:4) .EQ. 'BYTE'  .OR.  
+     .       buff2(1:4) .EQ. 'INT1') THEN
+            attype_spec = ptype_int1
+         ELSE IF (buff2(1:4) .EQ. 'SHOR' .OR. 
+     .            buff2(1:4) .EQ. 'INT2') THEN
+            attype_spec = ptype_int2
+         ELSE IF (buff2(1:4) .EQ. 'INT4' .OR.
+     .       (buff2(1:3) .EQ. 'INT' .AND. 
+     .        TM_LENSTR(buff2) .EQ. 3) ) THEN
+            attype_spec = ptype_int4
+         ELSE IF (buff2(1:4) .EQ. 'FLOA') THEN
+            attype_spec = ptype_float
+         ELSE IF (buff2(1:4) .EQ. 'DOUB') THEN
+            attype_spec = ptype_double
+         ELSE IF (buff2(1:4) .EQ. 'STRI' .OR.  
+     .            buff2(1:4) .EQ. 'CHAR') THEN
+             attype_spec = ptype_string
+         ENDIF
+      ENDIF
+
+* ... get dset number if present:  SET ATT/D=dset varname.attname
+        dset_num = pdset_irrelevant
+	loc = qual_given( slash_set_attr_dset ) 
+        IF ( loc .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			      buff2, status )  
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( buff2 .NE. ' ' ) THEN
+	      dset_num = FIND_DSET_NUMBER( buff2 )
+	      IF ( dset_num .EQ. unspecified_int4) THEN
+	         CALL WARN('Unknown data set: '
+     .		 //buff2(:TM_LENSTR(buff2)))
+	         RETURN
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* get dataset from varname.attname
+* evaluate the context without computing the expression to get the dataset
+
+ 1410   CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+        IF ( status .NE. ferr_ok ) GOTO 5000
+ 
+        IF (buff1(1:1) .EQ. '(') THEN
+           dset_num = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+           CALL ISIT_COORD_VAR ( buff1, dset_num, 
+     .            varname, coordvar, status )
+     
+           IF ( status .NE. ferr_ok ) THEN 
+              dset_num = -2  ! a user-defined axis (coordinate variable)
+              CALL ISIT_COORD_VAR ( buff1, dset_num, varname, 
+     .              coordvar, status )
+              IF ( status .NE. ferr_ok ) THEN
+                 dset = cx_data_set(cx_cmnd)
+                 GOTO 5910
+              ENDIF
+           ENDIF
+
+        ELSEIF (buff1(1:1) .EQ. '.') THEN
+           dset_num = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+
+        ELSE
+* See if the variable is a user-defined variable.
+
+           varname = buff1
+           dot = INDEX(buff1,'.')
+           IF (dot .GT. 0) varname = buff1(1:dot-1)
+           CALL FIND_VAR_NAME(pdset_irrelevant, varname, cat, ivar)
+           IF (  ivar .NE. munknown_var_name .AND.
+     .           cat .EQ. cat_user_var) THEN
+              dset_num = -1
+           ENDIF
+    
+           IF (dset_num .EQ. pdset_irrelevant .OR. 
+     .         dset_num .EQ. unspecified_int4) THEN
+              CALL EVAL_CONTEXT ( cx_cmnd, buff1, status )
+              IF ( status .NE. ferr_ok ) GOTO 5000
+              cx = is_cx( 1 )
+              dset_num = cx_data_set(cx) 
+           ENDIF
+
+	ENDIF
+
+        IF (buff1(1:1) .EQ. '.') dset_num = cx_data_set(cx_cmnd)
+
+        IF (dset_num .EQ. pdset_irrelevant) THEN
+           dset_num = cx_data_set(cx_last) 
+           cx = cx_last
+        ENDIF
+
+        IF (dset_num .EQ. unspecified_int4) dset_num = -1 ! user variables
+
+* change an existing attribute output flag and/or value of the attr
+
+        iflag = 0
+        isetout = 0
+        IF (qual_given( slash_set_attr_output ) .GT. 0) THEN
+           iflag = 1
+           isetout = 1
+        ENDIF
+
+* get the data for the new value
+        
+        IF (arg_start(1) .LT. pos) arg_start(1) = pos
+        IF ( (iflag .EQ. 1 .AND. arg_end(1) .LT. len_cmnd) .OR. 
+     .       (isetout .EQ. 0) ) THEN
+           CALL GET_PROT_CMND_DATA ( memory, cx_last, ptype_native, 
+     .              status )
+           IF ( status .NE. ferr_ok ) THEN      ! 8/6/92
+              list_fmt_type = plist_default ! restore for next command
+              list_format_given = .FALSE.
+              RETURN
+           ENDIF
+        ENDIF
+
+* Process SET ATT/OUTPUT=all varname, SET ATT/OUTPUT=default varname, SET ATT/OUTPUT=none varname
+* flag = 0 output no attributes, 
+*        1 check individual attribute output flags (default)
+*        2 write all attributes
+*        3 reset attr flags to Ferret netcdf defaults
+
+        slen = TM_LENSTR(buff2)
+        IF (slen .GT. 0) THEN
+           iflag = 1
+           IF (buff2(1:3) .EQ. 'NON') iflag = 0
+           IF (buff2(1:3) .EQ. 'ALL') iflag = 2
+           IF (buff2(1:3) .EQ. 'DEF') iflag = 3 
+           IF (INDEX(varname,'.') .NE. 0) THEN 
+              IF (iflag.EQ.0 .OR.iflag.EQ.2) GOTO 5930
+           ENDIF
+        ELSE
+           iflag = 1  
+        ENDIF
+
+* break up varname.attname.  Check that varname is in the dset
+
+        varid = 0
+
+        CALL BREAK_VARNAME( buff1, dset_num, varname, attname, 
+     .                         varid,  status )
+        IF (status .NE. ferr_ok) goto 5910
+
+        IF (varid .EQ. 0) CALL CD_GET_VAR_ID (dset_num, varname, varid,
+     .       status )
+        IF (status .NE. ferr_ok) goto 5910
+
+* Changing the attribute output flag
+
+        IF (qual_given( slash_set_attr_output ) .GT. 0) THEN
+
+           CALL CD_SET_ATT_FLAG(dset_num, varid, attname, iflag, status)
+
+* If it is the offset or scale attribute, set the output flag for both
+
+           slen = TM_LENSTR1(attname)
+           IF (MATCH_NAME (attname,  slen, 'ADD_OFFSET', 10) ) THEN
+              CALL CD_SET_ATT_FLAG(dset_num, varid, 'ADD_OFFSET', 
+     .               iflag, status)
+              CALL CD_SET_ATT_FLAG(dset_num, varid, 'SCALE_FACTOR', 
+     .               iflag, status)
+           ENDIF
+
+           IF (MATCH_NAME (attname,  slen, 'SCALE_FACTOR', 10) ) THEN
+              CALL CD_SET_ATT_FLAG(dset_num, varid, 'ADD_OFFSET', 
+     .               iflag, status)
+              CALL CD_SET_ATT_FLAG(dset_num, varid, 'SCALE_FACTOR', 
+     .               iflag, status)
+           ENDIF
+
+        ENDIF
+
+* Change attribute value
+
+        IF ( (iflag .EQ. 1 .AND. arg_end(1) .LT. len_cmnd) .OR.
+     .       (isetout .EQ. 0) ) THEN 
+           mr = is_mr( 1 )
+           CALL EDIT_ATTRIBUTE(  memory(1, mr_blk1(mr)), mr, 
+     .               buff1, dset_num, attype_spec, set_att_quiet, status )
+  
+! errmsg already called in edit_attribute so just exit
+           IF (status .NE. ferr_ok) GOTO 5000
+
+* If the time origin was changed, also change units to say
+* "units since time origin" using the new time origin info.
+           
+           axis = TM_GET_LINENUM( varname )
+           IF (axis .NE. unspecified_int4) THEN
+              slen = TM_LENSTR1(attname)
+              IF ( MATCH_NAME (attname,  slen, 'TIME_ORIGIN', 11) .AND.
+     .            ( line_direction(axis)(1:1) .EQ. 'T' .OR.
+     .              line_direction(axis)(1:1) .EQ. 'F' ) ) THEN
+                 CALL CD_GET_VAR_ATT_ID (dset_num, varid, 'UNITS', attid, status)
+                 IF (status .NE. ferr_ok) GOTO 5950
+   
+                  got_it = NC_GET_ATTRIB ( dset_num, varid, 'time_origin',
+     .                                      .TRUE., varname, 128,
+     .                                         attlen, attoutflag, t0string, 
+     .                                   val_buf )
+                  got_it = NC_GET_ATTRIB ( dset_num, varid, 'units',
+     .                                      .TRUE., varname, 128,
+     .                                      attlen, attoutflag, ustring, 
+     .                                      val_buf )
+                  istat =  STR_UPCASE (buff2, ustring)
+                  slen = INDEX(buff2, 'SINCE')
+                  IF (slen .GT. 0) THEN
+                     slen = slen - 2
+                  ELSE
+                     slen = TM_LENSTR1(ustring)
+                  ENDIF
+                  buff3 = ustring(1:slen) // ' since ' // t0string
+                  attlen = TM_LENSTR1(buff3)
+   
+                  ustring = 'units'
+                  CALL CD_REPLACE_ATTR (dset_num, varid, ustring, 
+     .               NCCHAR, attlen, buff3, val_buf, status)
+               ENDIF
+
+* If the units were changed on a time axis, add "since time origin"
+           
+              slen = TM_LENSTR1(attname)
+              IF (MATCH_NAME (attname,  slen, 'units', 5)  .AND.
+     .            ( line_direction(axis)(1:1) .EQ. 'T' .OR.
+     .              line_direction(axis)(1:1) .EQ. 'F' ) ) THEN
+                 CALL CD_GET_VAR_ATT_ID (dset_num, varid, 'time_origin', 
+     .                 attid, status)
+                 IF (status .EQ. ferr_ok) THEN 
+
+                    got_it = NC_GET_ATTRIB ( dset_num, varid, 'time_origin',
+     .                                      .TRUE., varname, 128,
+     .                                      attlen, attoutflag, t0string, 
+     .                                      val_buf )
+                    got_it = NC_GET_ATTRIB ( dset_num, varid, 'units',
+     .                                      .TRUE., varname, 128,
+     .                                      attlen, attoutflag, ustring, 
+     .                                      val_buf )
+                    istat = STR_UPCASE (buff2, ustring)
+                    slen = INDEX(buff2, 'SINCE')
+                    IF (slen .GT. 0) THEN
+                       slen = slen - 2
+                    ELSE
+                       slen = TM_LENSTR1(ustring)
+                    ENDIF
+                    buff3 = ustring(1:slen) // ' since ' // t0string
+                    attlen = TM_LENSTR1(buff3)
+   
+                    CALL CD_REPLACE_ATTR (dset_num, varid, attname, 
+     .                  NCCHAR, attlen, buff3, val_buf, status)
+                  ENDIF
+               ENDIF
+            ENDIF ! (axis .NE. unspecified_int4)
+
+* Update attribute information used by plotting etc (ds_units, ...)
+            CALL FIND_VAR_NAME (dset_num, varname, cat, uvar)
+            IF ( (cat .EQ. cat_user_var) .OR.
+     .           (cat .EQ. cat_file_var) .OR.
+     .           (cat .EQ. cat_pystat_var) )
+     .           CALL UPDATE_ATTRIBUTES (dset_num, uvar)
+
+        ENDIF
+	RETURN
+
+* SET NCCACHE/SIZE=bytes/cache_nelems/cache_preemption
+ 1500	IF ( num_args .GT. 0 ) GOTO 5200
+        cache_size = -1
+        cache_nelems = -1
+        cache_preemption = -1
+
+        lp = qual_given( slash_set_nccache_size )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_VAL( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			   cache_size_mb, status )
+           IF ( status .NE. ferr_ok ) RETURN 
+	   IF (cache_size_mb .LT. 0) GOTO 6700
+	   cache_size = INT(cache_size_mb* 1.e6)  ! Mbytes to bytes
+
+	ENDIF
+
+        lp = qual_given( slash_set_nccache_nelem )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_VAL_INT( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			   cache_nelems, status )
+           IF ( status .NE. ferr_ok ) RETURN 
+	   IF (cache_nelems .LT. 0) GOTO 6710
+	ENDIF
+
+        lp = qual_given( slash_set_nccache_preemp )
+	IF ( lp .GT. 0 ) THEN
+           CALL EQUAL_VAL_INT( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .			   cache_preemption, status )
+           IF ( status .NE. ferr_ok ) RETURN 
+	   IF (cache_preemption.LT.0 .OR. 
+     .         cache_preemption.GT.1) GOTO 6720
+	ENDIF
+
+        CALL CD_SET_CHUNK_CACHE (cache_size, cache_nelems, 
+     .     cache_preemption, status)
+
+	RETURN
+
+* SET REDIRECT /TEE /JOURNAL /FILE= /APPEND /CLOBBER [stdout] [stderr]
+ 1600   redir_stdout = .FALSE.
+        redir_stderr = .FALSE.
+*
+*       Determine all the sources to redirect
+        IF ( num_args .GT. 0 ) THEN
+           DO 1610 i = 1,num_args
+              IF ( MATCH4( cmnd_buff(arg_start(i):arg_end(i) ), 
+     .              arg_end(i) - arg_start(i) + 1, 'STDOUT', 6) ) THEN
+*                Redirect stdout with these settings
+                 redir_stdout = .TRUE.
+              ELSE IF ( MATCH4( cmnd_buff(arg_start(i):arg_end(i) ), 
+     .              arg_end(i) - arg_start(i) + 1, 'STDERR', 6) ) THEN
+*                Redirect stderr with these settings
+                 redir_stderr = .TRUE.
+              ELSE
+*                Unknown source to redirect
+                 CALL ERRMSG( ferr_invalid_command, status, 
+     .                   'unknown redirect source: ' //
+     .                   cmnd_buff( arg_start(i):arg_end(i) ), *5000 )
+              ENDIF
+ 1610      CONTINUE
+        ELSE
+*          Default: redirect stdout, but not stderr, with these settings
+           redir_stdout = .TRUE.
+        ENDIF
+*
+*       Make sure any the specified redirect sources are not already redirected
+        IF ( redir_stdout .AND. 
+     .       (redirect_stdout_flags .NE. redirect_none) ) THEN
+           CALL ERRMSG( ferr_invalid_command, status, 
+     .                  'stdout is already redirected', *5000)
+        ENDIF
+        IF ( redir_stderr .AND. 
+     .       (redirect_stderr_flags .NE. redirect_none) ) THEN
+           CALL ERRMSG( ferr_invalid_command, status, 
+     .                  'stderr is already redirected', *5000)
+        ENDIF
+*
+*       Process the qualifiers
+        redir_tee = .FALSE.
+        redir_journal = .FALSE.
+        redir_append = .FALSE.
+        redir_clobber = .FALSE.
+*
+*       /TEE
+        lp = qual_given( slash_set_redirect_tee )
+        IF ( lp .GT. 0 ) redir_tee = .TRUE.
+*
+*       /JOURNAL
+        lp = qual_given( slash_set_redirect_journal )
+        IF ( lp .GT. 0 ) redir_journal = .TRUE.
+*
+*       /APPEND
+        lp = qual_given( slash_set_redirect_append )
+        IF ( lp .GT. 0 ) redir_append = .TRUE.
+*
+*       /CLOBBER
+        lp = qual_given( slash_set_redirect_clobber )
+        IF ( lp .GT. 0 ) redir_clobber = .TRUE.
+        IF ( redir_journal .AND. redir_clobber ) THEN
+           CALL ERRMSG( ferr_invalid_command, status, 
+     .             '/CLOBBER cannot be used with /JOURNAL', *5000 )
+        ENDIF
+*
+*       /FILE=
+        lp = qual_given( slash_set_redirect_file )
+        IF ( lp .GT. 0 ) THEN
+           IF ( redir_journal ) THEN
+              CALL ERRMSG( ferr_invalid_command, status,
+     .           'Only one of /JOURNAL or /FILE= can be given', *5000 )
+           ENDIF
+*
+*          /FILE= was given; get the filename
+           CALL EQUAL_STR_LC( cmnd_buff(qual_start(lp):qual_end(lp)),
+     .                        title, status )
+           IF ( status .NE. ferr_ok ) RETURN
+           IF ( title .EQ. ' ' ) THEN
+              CALL ERRMSG( ferr_invalid_command, status,
+     .                     'SET REDIRECT /FILE= what name?', *5000 )
+           ENDIF
+           IF ( .NOT. TM_LEGAL_UNIX_NAME(title) ) THEN
+              CALL ERRMSG( ferr_invalid_command, status, 
+     .            'Illegal file name: ' // title, *5000 )
+           ENDIF
+*
+*          Open or create the file
+           INQUIRE( FILE = title, EXIST = fexist )
+           IF ( fexist ) THEN    
+              IF ( redir_append ) THEN
+#ifdef NO_ACCESS_APPEND
+                 faccess = 'SEQUENTIAL'
+#else
+                 faccess = 'APPEND'
+                 fposition = 'APPEND'
+#endif
+                 fstatus = 'OLD'
+              ELSE IF ( redir_clobber ) THEN
+                 faccess = 'SEQUENTIAL'
+                 fstatus = 'REPLACE'
+#ifdef F90_OPEN_FILE_CLOBBER
+                 fposition = 'ASIS'
+#endif
+              ELSE
+                 CALL ERRMSG( ferr_invalid_command, status,
+     .                   'neither /CLOBBER nor /APPEND specified ' //
+     .                   'and file exists: ' // title, *5000 )
+              ENDIF
+           ELSE
+*             new file
+              faccess = 'SEQUENTIAL'
+              fstatus = 'NEW'
+              fposition = 'ASIS'
+           ENDIF
+           CALL LIB_GET_LUN( redir_file_lun )
+           OPEN( UNIT = redir_file_lun,
+     .           FILE = title,
+     .           FORM = 'FORMATTED',
+#ifdef F90_OPEN_FILE_APPEND
+     .           POSITION = fposition,
+#else
+     .           ACCESS = faccess,
+#endif
+     .           STATUS = fstatus,
+     .           ERR    = 6800 )
+*
+*          Assign the file redirection variables
+           IF ( redir_stdout ) THEN
+              IF ( redir_tee ) THEN
+                 redirect_stdout_flags = redirect_file_tee
+              ELSE
+                 redirect_stdout_flags = redirect_file
+              ENDIF
+              redirect_stdout_lun = redir_file_lun
+           ENDIF
+           IF ( redir_stderr ) THEN
+              IF ( redir_tee ) THEN
+                 redirect_stderr_flags = redirect_file_tee
+              ELSE
+                 redirect_stderr_flags = redirect_file
+              ENDIF
+              redirect_stderr_lun = redir_file_lun
+           ENDIF
+*
+        ELSE IF ( redir_journal ) THEN
+*
+*          /JOURNAL was given - redirect to the journal
+           IF ( redir_stdout ) THEN
+              IF ( redir_tee ) THEN
+                 redirect_stdout_flags = redirect_journal_tee
+              ELSE
+                 redirect_stdout_flags = redirect_journal
+              ENDIF
+*             Use the current jrnl_lun (in case it changes) when writing
+              redirect_stdout_lun = -1
+           ENDIF
+           IF ( redir_stderr ) THEN
+              IF ( redir_tee ) THEN
+                 redirect_stderr_flags = redirect_journal_tee
+              ELSE
+                 redirect_stderr_flags = redirect_journal
+              ENDIF
+*             Use the current jrnl_lun (in case it changes) when writing
+              redirect_stderr_lun = -1
+           ENDIF
+*
+        ELSE
+*
+*          Neither /JOURNAL nor /FILE was given
+           CALL ERRMSG( ferr_invalid_command, status, 
+     .             'Either /JOURNAL or /FILE= must be given', *5000 )
+        ENDIF
+        RETURN
+
+* SET GIFFILE
+ 1700   IF ( num_args .EQ. 0 ) GOTO 5100
+
+* *kms* with the graphics delegate, treat it the same as set mode meta:"filename"
+        buff2 = cmnd_buff(item_start(1):item_end(1))
+        IF ( .NOT. pplus_started ) CALL START_PPLUS(.FALSE.)
+        CALL PPLCMD(from, line, 0, 'PLTNME ' // buff2, 1, 1)
+        CALL WARN('the use of "SET GIFFILE" is deprecated;')
+        CALL WARN('instead use "FRAME /FILE=... /FORMAT=..."')
+        mode_metafile = .TRUE.
+        RETURN
+
+* error exits
+ 5000	RETURN
+ 5010	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff( item_start(item):item_end(item) ), *5000 )
+ 5020	CALL ERRMSG( ferr_invalid_command, status,
+     .			'Unknown argument:'//
+     .			cmnd_buff( item_start(item):item_end(item) ), *5000 )
+ 5030	CALL ERRMSG( ferr_syntax, status,
+     .			cmnd_buff( qual_start(lp):qual_end(lp) ), *5000 )
+ 5060	CALL ERRMSG( ferr_erreq, status, list_file,  *5000 )
+ 5070	CALL ERRMSG( ferr_erreq, status, frame_file, *5000 )
+ 5080	CALL ERRMSG( status, status, frame_file, *5000 )
+ 5082	CALL ERRMSG( ferr_invalid_command, status,
+     .			'laser movie or on-disk movie?', *5000 )
+ 5083	CALL ERRMSG( ferr_invalid_command, status, 
+     .            'illegal file name: '//
+     .            cmnd_buff(qual_start(lp):qual_end(lp)), *5000 )
+ 5084	CALL ERRMSG( ferr_invalid_command, status,
+     .			'Unknown compression type: ON or OFF only', *5000 )
+ 5085	CALL ERRMSG( status, status, buff1, *5000 )
+ 5086	CALL ERRMSG( ferr_invalid_command, status, 
+     .     'Movies are discontinued as of Ferret v6.6', *5000 )
+ 5090	CALL ERRMSG( ferr_TMAP_error, status, ' ', *5000 )
+ 5100	CALL ERRMSG( ferr_invalid_command, status, 
+     .			'SET what?', *5000 )
+ 5110	CALL ERRMSG( ferr_unknown_data_set, status,
+     .			cmnd_buff( item_start(item):item_end(item) ), *5000 )
+ 5120	CALL ERRMSG( ferr_unknown_grid, status, 
+     .			'nothing saved from past commands', *5000 )
+ 5200	CALL ERRMSG( ferr_syntax, status,
+     .		     'To set CACHE CHUNK size use SET CCACHE/SIZE=megabytes'
+     .		     //pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5210	CALL ERRMSG( ferr_syntax, status,
+     .		     'To set CACHE CHUNK size use SET CCACHE/SIZE=megabytes'
+     .		     //pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5320	CALL ERRMSG( ferr_invalid_command, status,
+     .			'delta value not permitted on SET REGION'//
+     .			pCR//'check '//ww_dim_name(idim)//' axis', *5000 )
+ 5700	CALL ERRMSG( ferr_invalid_command, status,
+     .			'qualifier(s) valid only with SET DATA/EZ command',
+     .			*5000 )
+ 5710	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'illegal qualifier or argument'//pCR//cmnd_buff(:len_cmnd),
+     .			*5000 )
+ 5720	CALL ERRMSG( ferr_invalid_command, status,
+     .		     '/ORDER must be permutation of XYZT (with minus signs)'//
+     .			pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5800	CALL ERRMSG( ferr_syntax, status,
+     .		     'To reconfigure use SET MEMORY/SIZE=megawords'
+     .		     //pCR//cmnd_buff(:len_cmnd), *5000 )
+ 5810	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'SET MODE REMOTE_X requires a node name argument',
+     .			*5000 )
+ 5820	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'MODE GKS cannot be modified after the first GKS plot',
+     .			*5000 )
+ 5830	CALL ERRMSG( ferr_erreq, status, 'Unable to close file', *5000 )
+ 5840	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'Unable to open journal file: '//journal_file,
+     .			*5000 )
+ 5850	CALL ERRMSG( ferr_erreq, status, 
+     .               'Unable to open '//ppllist_file,
+     .			*5000 )
+ 6088   CALL ERRMSG( ferr_invalid_command, status,
+     .           'it is not a netcdf dataset',
+     .               *5000 )
+ 6110	CALL ERRMSG( ferr_invalid_command, status,
+     .		     'no grid has been saved', *5000 )
+ 6210	CALL ERRMSG( ferr_invalid_command, status,
+     .		 'unknown axis: '//cmnd_buff(item_start(1):item_end(1)),
+     .               *5000 )
+ 6310	CALL ERRMSG( ferr_invalid_command, status,
+     .	         'SET AXIS/CALENDAR=what? ', 
+     .               *5000 )
+ 6320	CALL ERRMSG( ferr_invalid_command, status,
+     .	         'invalid calendar name: '
+     .           //cmnd_buff(item_start(1):item_end(1)), 
+     .               *5000 )
+ 6410	CALL ERRMSG( ferr_invalid_command, status,
+     .	         'SET AXIS/t0= what? ', 
+     .               *5000 )
+ 6420	CALL ERRMSG( ferr_syntax, status,
+     .	         'invalid date string: '
+     .           //cmnd_buff(item_start(1):item_end(1)), 
+     .               *5000 )
+ 6510	CALL ERRMSG( ferr_invalid_command, status,
+     .	         'SET AXIS/UNITS= what? ', 
+     .               *5000 )
+ 6520	CALL ERRMSG( ferr_syntax, status,
+     .	         'specify SET AXIS/T0 separately from /UNITS ',
+     .               *5000 )
+ 6610   CALL ERRMSG( ferr_invalid_command, status,
+     .           'SET AXIS/stride= what? ',
+     .               *5000 )
+ 6620   CALL ERRMSG( ferr_invalid_command, status,
+     .           'illegal operation for a non-dynamic axis',
+     .               *5000 )
+ 6630   CALL ERRMSG( ferr_invalid_command, status,
+     .           'it is a child axis already',
+     .               *5000 )
+ 6640   CALL ERRMSG( ferr_invalid_command, status,
+     .           'offset must be less than stride value',
+     .               *5000 )
+ 6650   CALL ERRMSG( ferr_invalid_command, status,
+     .           'fail to create a strided axis',
+     .               *5000 )
+ 6660   CALL ERRMSG( ferr_invalid_command, status,
+     .           'offset must be greater than or equal to zero',
+     .               *5000 )
+ 6670   CALL ERRMSG( ferr_invalid_command, status,
+     .           'stride must be greater than zero',
+     .               *5000 )
+     
+ 
+ 6680	CALL ERRMSG( ferr_invalid_command, status,
+     .	         'SET AXIS/NAME= what? ', 
+     .               *5000 )
+
+ 6690	CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal new name. Axis '
+     .			//buff1(:TM_LENSTR1(buff1))//' is already defined ',
+     .                                                          *5000 )
+ 6692	CALL ERRMSG( ferr_invalid_command, status,
+     .               'illegal new name given for axis '
+     .			//buff1(:TM_LENSTR1(buff1)),
+     .               						*5000 )
+ 
+ 
+ 5900 CALL ERRMSG( ferr_invalid_command, status,
+     .		'SET what name.attribute?', *5000 )
+ 5910 slen = TM_LENSTR(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'variable, axis, or attribute does not exist'//
+     .    buff1(:slen), *5000 )
+ 5920 slen = TM_LENSTR(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'attribute name missing. SET ATT varname.attname'//
+     .    buff1(:slen), *5000 )
+ 5930 slen = TM_LENSTR(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'SET ATT/OUT=[all or none] varname should NOT '//
+     .   'include attribute. '//
+     .    buff1(:slen), *5000 )
+ 5940 slen = TM_LENSTR(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'error editing attribute'//
+     .    buff1(:slen), *5000 )
+ 5950 slen = TM_LENSTR(buff1)
+      CALL ERRMSG( ferr_invalid_command, status,
+     .   'cannot set T0 unless Units are also set'//
+     .    buff1(:slen), *5000 )
+ 6700   CALL ERRMSG( ferr_invalid_command, status,
+     .           'cache chunk size must be greater than zero',
+     .               *5000 )
+ 6710   CALL ERRMSG( ferr_invalid_command, status,
+     .           'cache nelems must be greater than zero',
+     .               *5000 )
+ 6720   CALL ERRMSG( ferr_invalid_command, status,
+     .           'cache preemption must be 0 or 1',
+     .               *5000 )
+ 6800   CALL ERRMSG( ferr_erreq, status, title, *5000 )
+ 6810	CALL ERRMSG( ferr_invalid_command, status,
+     .		'Unrecognized option/'//
+     .          cmnd_buff(qual_start(i):qual_end(i)) //pCR//
+     .		' Valid options are /OUTTYPE=DOUBLE,FLOAT,INT,SHORT,or BYTE', *1000 )
+     
+ 6900	CALL ERRMSG( ferr_unknown_arg, status,
+     .'Can SET AXIS/OUTTYPE=INPUT, DOUBLE, FLOAT, INT, SHORT, BYTE, or NONE',
+     .               						*5000 )
+	END
diff --git a/fer/xeq/xeq_shade.F b/fer/xeq/xeq_shade.F
new file mode 100644
index 0000000..3c66ea8
--- /dev/null
+++ b/fer/xeq/xeq_shade.F
@@ -0,0 +1,491 @@
+ 	SUBROUTINE XEQ_SHADE( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SHADE command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/2/88 - dummy template version
+* revision 0.1 - 8.29.88 J Davison
+*              - Modification of XEQ_CONTOUR version 0.9
+* revision 0.2 - 9/21/88 - *sh* /NOLABEL processing changed:
+*		 do_labels(in DISP_SET_UP) --> no_labels(in PUT_LABEL)
+* revision 0.3 - 5/1/89  - PPL LEVELS not cleared for no_range if /LEVELS_SAME
+*		 - this logic, do_key and vertical_key moved before /SET_UP
+* V200:  5/19/89 - 4D symmetrical
+*	  1/4/89 - using keys for labelling
+*	 3/13/90 - check status from DISP_PREP
+* Unix/RISC port - 2/26/91 - changed an INCLUDE statement to upper case
+*       10/22/92 - removed dependence on shade_vars.cmn using PPLCMND(SHAKEY)
+* V230:  11/9/92 - protect colors before doing a color overlay
+*                - default for KEY is off on overlays
+* V300:  3/11/93 - added /SPECTRUM=
+* V301:	  1/7/94 - bug fix: (see DISP_DATA_SET_UP) must unprotect plot data
+* 	 1/10/94 - change to DISP_SET_UP call to accomodate CONTOUR/PEN
+* V312: 5/94 - array "memory" as a calling argument
+* V320:   1/20/94 - changes to SAVE_FRAME call reflecting C-based procedures
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V450:  5/29/97 - added /NOAXES qualifier (useful in curvilinear plots)
+* V491:  12.98   - added /PATTERN qualifier *jd*
+* V510 12/99 *sh* - allow all-missing data plots
+* V530: *acm*6/01 - add arguments is_logh, is_logv to DISP_SET_UP call.
+*                  (only used for PLOT command)
+*      *acm* 7/01 - Add /AXES=TOP,BOT,LEFT,RIGHT
+*		    & call ax_on_off to implement /NOAXES.
+*      *acm* 10/01  remove VMS includes
+* V540 *acm*  2/02  restore persistence of PPL AXSET settings
+* V541 *acm*  3/02  Make PPL AXSET settings persist, but not settings
+*                   done with qualifiers /AXES= or /NOAXES
+*      *acm*  4/02  If this is an overlay, and there is no valid data, 
+*                   do not put "No Valid Data" across the middle of the plot.
+*                   Instead (in disp_set_up) add this information to the
+*                   variable name in the key below the plot.
+* v541 *acm*  5/02 add option to control outline on the shade key boxes 
+*                   /KEY=continuous
+* V550: *acm*11/02 add argument is_shade to DISP_SET_UP call, allocate
+*                  PPLUS memory for cells array in cellarray calls.
+* V552: *acm* 5/03 add argument use_cell to DISP_SET_UP call, so it can be
+*                  passed on to PPLUS
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* v580 *acm* 6/15/04 In the workaround which does a PPL LEV command for data with
+*                    a single value, need to give the PPL command the value with  
+*                    more precision.
+* V581 *acm* 5/05  fix bug 1249: /KEY=CONT. Need to use EQUAL_STR to get the
+*                  argument to /KEY, then compare to see if it equals uppercase 'CON'
+* V602 *acm* 11/06 Fix bug 1472: Where single-level color plot is requested, use levels (1) 
+*                  setting rather than sending the data value; avoids precision problems.
+* V603 *acm*  5/07 Fix bug 904: if SHADE/LINE, then set iautoc and NLEV2 to re-use the
+*                  contour levels from the shade plot.
+* V609: *acm* 2/08 - add SHADE/TRIM
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+* V614  *acm* 10/08 - add new MODE NODATA_LAB to control the NO VALID DATA label.
+*                  Put it on plots only when this mode is set.
+* V6.2  *acm* 11/08Fix bug 1609: If the plot is an overlay then do not process /AXES=
+*                  or /NOAXES. Axes are never drawn for overlays anyway.
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis
+* V6.85 *acm* 3/13 Fix ticket 2049; check we can open palette file
+* PyFr  *kms*  6/13 Added /OPACITY
+* PyFr  *kms*  7/13 Scale default lettering sizes by textscale
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+        include 'parampl5_dat.decl'     ! with inclen
+        include 'PARAMPL5.DAT'  ! with inclen
+        include 'cont_inc.decl' ! with iautoc and nlev
+        include 'CONT.INC'
+
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL	  no_range, overlay, transpz, no_labels, do_key,
+     .            spectrum, set_up, noaxes, axes, pattern, no_data,
+     .		  is_logh, is_logv, is_shade, use_cell, inc_grid
+
+	INTEGER	  TM_LENSTR1, STR_UPCASE, status, slen, sp, patt,
+     .		  ax1_blks, ax1_start,
+     .		  ax2_blks, ax2_start, i, nparm, num_it, 
+     .		  loc, s1, s2, it_start(4), it_end(4), iax(4),
+     .            density, i1, loch, locv, grid, mvx
+	REAL	  only_val, aspect, vbuf
+        REAL*4    opacity
+	PARAMETER ( aspect = 0.0)			!kob 12/96
+
+	CHARACTER TM_FMT*12, TM_INQ_PATH*2048, 
+     .                  fname*128, buff*25, sfile*2048
+
+* internal parameter declarations:
+	LOGICAL		norm_dims_only, not_vector, continuous_key
+	PARAMETER     ( norm_dims_only  = .FALSE.,
+     .			not_vector	= .FALSE. )
+
+* set up the graphics environment and get the data
+	CALL START_PPLUS(.FALSE.)
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* initialize
+	overlay   = qual_given( slash_shad_over_plot ).GT.0 .AND. twodee_on
+	no_labels = qual_given( slash_shad_nolabels  ).GT.0
+	transpz   = qual_given( slash_shad_transpz   ).GT.0
+        sp        = qual_given( slash_cont_spectrum  )
+	set_up	  = qual_given( slash_shad_set_up    ).GT.0
+	noaxes    = qual_given( slash_noaxes         ).GT.0
+	axes      = qual_given( slash_shad_axes      ).GT.0
+        IF (overlay) THEN
+	   noaxes = .FALSE.
+	   axes = .FALSE.
+	ENDIF
+	is_logh   = .FALSE.
+	is_logv   = .FALSE.
+        spectrum  = sp .GT. 0 
+        patt      = qual_given( slash_shad_pattern   )
+        pattern   = patt .GT. 0
+        shade_trim = qual_given( slash_shad_trim   ) .GT.0
+	
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,is_cx,num_uvars_in_cmnd)
+* ... default orientation for YT and ZT contours has time on horizontal
+	IF ( (plot_axis(2).EQ.t_dim .OR. plot_axis(2).EQ.f_dim) .AND. 
+     .		plot_axis(1).NE.x_dim ) transpz = .NOT.transpz
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+        is_shade = .TRUE.
+        density = 0	! not used; vec/flow needs it in set up
+
+
+* ... SHADE/hgrat[=dash or line] default is dash
+*     hgrat line type: 0=tics only, 1=dash 2=line
+
+	loch = qual_given(slash_shad_hgrat)
+
+* ... SHADE/vgrat[=dash or line] default is dash
+*     vgrat line type: 0=tics only, 1=dash 2=line
+
+	locv = qual_given(slash_shad_vgrat)
+
+        IF (loch .EQ. 0  .AND. locv .EQ. 0) THEN
+           loch = qual_given(slash_shad_grat)
+           locv = qual_given(slash_shad_grat)
+        ENDIF
+
+        CALL set_graticules(loch, locv, status)
+
+* ... SHADE/OPACITY=n
+        loc = qual_given( slash_shad_opacity )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_VAL(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    vbuf, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           IF ( (vbuf .LT. 0.0) .OR. (vbuf .GT. 100.0) ) GOTO 5500
+           opacity = vbuf / 100.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ELSE
+*          overriding opacity not specififed
+           opacity = -1.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ENDIF
+
+
+* set up the axes and title and load the data into PPLUS
+	inc_grid = set_up
+	CALL DISP_SET_UP   (    memory,
+     .				not_vector,
+     .				is_shade,
+     .				use_cell,
+     .				aspect,
+     .				overlay,
+     .				transpz,
+     .				no_labels,
+     .				no_range,
+     .				only_val,
+     .                          density,
+     .				is_logh,
+     .				is_logv,
+     .				is_mr,
+     .				num_uvars_in_cmnd,
+     .				is_cx,
+     .				is_uvar,
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				-1, 			! auto pen select,
+     .				inc_grid,
+     .				status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+
+* is there no valid input data?
+           no_data =  no_range .AND. only_val.EQ.bad_val4
+
+* PPLUS blows up setting auto contour levels if all data have same value
+* But, do not let this be rounded off, or we cannot find the color when matching 
+* this value in get_ndx, called by fillpol
+
+* The initial fix below had precision problems when the value in only_val was
+* of high precision, sometimes causing polygons to go unfilled (bug 1472).  
+* Instead, make a ppl lev 1 setting, as is done in disp_prep.F
+
+c	   IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 )
+c    .          CALL PPLCMD ( from, line, 0, 
+c    .          'LEV () ('//TM_FMT(only_val, 8, 20, slen)//')' , 1, 1 )
+
+	   IF ( no_range .AND. qual_given( slash_shad_lev_same ) .EQ. 0 ) THEN
+              iautoc = 1  
+c              nlev = 1
+	   ENDIF
+
+* default key
+	   do_key =  (qual_given(slash_shad_key)  .GT. 0)
+     .		.OR. ( (qual_given(slash_shad_line) .EQ. 0)
+     .           .AND. .NOT.overlay
+     .           .AND. .NOT.no_data )
+	   IF (qual_given(slash_shad_nokey) .gt. 0) do_key = .FALSE.
+	   
+* Double check: is there no valid input data?
+	   IF ( no_data ) do_key = .FALSE.
+
+           IF ( do_key ) THEN
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 1,1', 1, 1 )
+
+* ... /KEY[=continouus] ?
+              loc = qual_given( slash_shad_key )
+
+              IF ( loc .GT. 0) THEN
+	         CALL EQUAL_STRING( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+                 IF ( status .NE. ferr_ok ) GOTO 5000
+	         IF ( buff(1:3) .EQ. 'CON' ) THEN
+                    continuous_key = .TRUE.
+                    CALL PPLCMD (from, line, 0, 'S_KEY 1', 1, 1 )
+                 ENDIF
+              ENDIF
+
+           ELSE
+              CALL PPLCMD ( from, line, 0, 'SHAKEY 0,1', 1, 1 )
+
+c when it's an overlay, 'No Valid Data' is part of the plot key,
+c done in disp_set_up. If mode_nodata_lab is false then leave this off.
+
+              IF (.NOT. overlay .AND. no_data .AND. mode_nodata_lab) 
+     .                  CALL PUT_LABEL( ppl_movlab, 0.5, 0.5,
+     .                  ppl_centered, dflt_letsize_title*textscale,
+     .                  'No Valid Data',
+     .                  lab_loc_axlen_times, lab_loc_axlen_times )
+           ENDIF
+
+* protect colors already on-screen before a color overlay
+*           PyFerret does not need to protect colors after using them
+*           IF ( overlay ) CALL PPL_SHASET( 'PROTECT' )
+
+* save old and reset to new color spectrum if requested
+           IF ( spectrum ) THEN
+              CALL EQUAL_STR_LC( cmnd_buff(qual_start(sp):qual_end(sp)),
+     .             fname, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( fname .EQ. ' ' ) fname = 'default'
+	      
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.spk',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+
+              CALL PPL_SHASET( 'SAVE' )
+              CALL PPL_SHASET( 'SPECTRUM='//fname(1:TM_LENSTR1(fname)) )
+           ENDIF
+
+* save old and set to new pattern if requested (a la spectrum)
+           IF ( pattern ) THEN
+              CALL EQUAL_STR_LC( 
+     .             cmnd_buff(qual_start(patt):qual_end(patt)),
+     .             fname, status )
+              IF ( status .NE. ferr_ok ) RETURN
+              IF ( fname .EQ. ' ' ) fname = 'default'
+	      
+	      slen = TM_LENSTR1(fname)
+              sfile = TM_INQ_PATH (fname(:slen),'FER_PALETTE','.pat',
+     .        	 .false.,status)
+              IF (status .NE. ferr_ok) go to 5300 
+
+              CALL PPL_PATSET( 'SAVE' )
+              CALL PPL_PATSET( 'PATTERN='//fname(1:TM_LENSTR1(fname)) )
+           ENDIF
+
+* turn off axes? 
+	IF ( noaxes ) THEN 
+           DO 300 i = 1, 4
+              iax(i) = 0
+ 300       ENDDO
+        ENDIF
+
+* turn on (one or more) axes? (7/11/01)
+
+* ... PLOT/AXES=(TOP,BOTTOM,LEFT,RIGHT)
+	IF ( axes ) THEN
+           loc = qual_given( slash_shad_axes )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   IF ( buff .NE. ' ' ) THEN
+
+* Get arguments, if any.  Otherwise turn on all axes
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5440
+              ENDIF
+
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, 
+     .             num_it, it_start, it_end, status)
+
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN	! /AXES=()
+                 DO 400 i = 1, 4
+                    iax(i) = 0
+ 400             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5440
+              ELSE
+                 DO 500 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) iax(i)
+                    IF (iax(i) .LT. 0  .OR.  iax(i) .GT. 1) GOTO 5450
+ 500             CONTINUE
+              ENDIF
+           ELSE		! turn on all axes
+	      DO 600 i = 1, 4
+		 iax(i) = 1
+ 600	      CONTINUE
+           ENDIF
+              
+	ENDIF
+
+*  Turn off or on axes, including time axes.
+        IF (axes .OR. noaxes) CALL ax_on_off (iax)
+
+* /set_up only requested ?
+	   IF ( set_up ) GOTO 1000
+
+* shade it 
+	   IF ( overlay ) THEN
+	      if (qual_given(slash_shad_line) .gt. 0) then
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'SHADE/OVER/' //ppl_wait//' ' , 1, 1 )
+	         IF ( ppl_interrupted ) GOTO 1000
+	         iautoc = 0 ! reuse levels from last plot
+	         nlev = nlev2
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/OVER/' //ppl_wait//' ' , 1, 1 )
+	      else
+	         CALL PPLCMD ( ' ', ' ', 0,
+     .			'SHADE/OVER/' //ppl_wait//' ' , 1, 1 )
+	      end if
+	   ELSE
+              IF (use_cell) CALL PPLCMD (' ', ' ', 0, 'S_CELL 1', 1,1 )
+	      if (qual_given(slash_shad_line) .gt. 0) then
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'SHADE/LATCH/'//ppl_wait//' ', 1, 1 )
+	         IF ( ppl_interrupted ) GOTO 1000
+	         iautoc = 0 ! reuse levels from last plot
+	         nlev = nlev2
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'CONTOUR/OVER/' //ppl_wait//' ' , 1, 1 )
+	      else
+		 CALL PPLCMD ( ' ', ' ', 0,
+     .			'SHADE/LATCH/'//ppl_wait//' ', 1, 1 )
+	      end if
+              IF (use_cell) CALL PPLCMD (' ', ' ', 0, 'S_CELL 0', 1,1 )
+
+	   ENDIF
+
+* clear the overriding opacity
+        opacity = -1.0
+        CALL SET_OVERRIDE_OPACITY(opacity)
+
+* protect the new colors and restore the original color spectrum
+           IF ( spectrum ) THEN
+*              PyFerret does not need to protect colors after using them
+*              CALL PPL_SHASET( 'PROTECT' )
+              CALL PPL_SHASET( 'SPECTRUM' )
+           ENDIF
+
+* restore the original pattern
+           IF ( pattern ) THEN
+              CALL PPL_PATSET( 'PATTERN' )
+           ENDIF
+
+* Mark the levels as set; if we used histogram levels it is 0
+
+          IF (need_histo) iautoc = 1
+
+* restore axes? (5/29/97  revised 3/2002
+
+c        IF ( axes .or. noaxes ) CALL PPL_AXES_RESTORE
+
+* restore default (non-continuous) key style?
+        IF (continuous_key ) CALL PPLCMD (from, line, 0, 'S_KEY 0', 1, 1 )
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ? Well, OK...
+	   IF ( qual_given( slash_shad_frame ) .GT. 0 ) THEN
+	      CALL SAVE_FRAME( frame_file, "HDF", status )
+	      IF ( status .NE. ferr_ok ) GOTO 5000
+	   ENDIF
+
+
+* release the memory used for axis buffers
+ 1000 	CONTINUE
+ 
+
+	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+ 5300   CALL ERRMSG (ferr_file_not_found, status, 
+     .          'unable to open "' //
+     .	fname(:slen)//'.spk" to set plot colors or pattern.', *1000)
+ 5440	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'AXES[=(TOP,BOTTOM,LEFT,RIGHT)] takes 4 arguments or no argument', *1000 )
+ 5450	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'AXES arguments must be 0 or 1', *1000 )
+ 5500   CALL ERRMSG( ferr_out_of_range, status,
+     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .          'Value from 0 to 100 must be given', *1000 )
+	END
+
diff --git a/fer/xeq/xeq_show.F b/fer/xeq/xeq_show.F
new file mode 100644
index 0000000..2681306
--- /dev/null
+++ b/fer/xeq/xeq_show.F
@@ -0,0 +1,2059 @@
+    	SUBROUTINE XEQ_SHOW( memory )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the SHOW command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 4/3/86
+* revision 0.1 - 12/15/86
+* revision 0.2 - 3/20/87 - changes for new TMAP library
+* revision 0.3 - 5/1/87  - added SHOW MOVIE,SHOW LIST/OUT,
+*			   SHOW EXPRESSION and SHOW REGION and "(default)" on
+*			   SHOW DATA
+* revision 0.4 - 5/1/87  - added SHOW VARIABLES/... and SHOW COMMANDS
+* revision 0.5 - 6/30/87 - added variable subscript limits to SHOW VARI/DISK
+* revision 0.6 - 7/15/87 - corrected arg 1 match on SHOW COMMAND name
+* revision 0.7 - 8/29/87 - SHOW LIST updated for unformatted option
+* revision 0.8 - 9/10/87 - SHOW LIST updated for BIBO option
+* revision 0.9 - 9/16/87 - SHOW VAR --> SHOW DATA & SHOW MEMORY /added SHOW GRID
+* revision 1.0 - 9/23/87 - SHOW REGION generalized to work with DEFINE REGION
+* 			   and LIST heading option added
+* revision 1.1 - 10/5/87 - revamped SHOW LIST logicals
+* revision 1.2 - 2/18/88 - check for unspecified grid in SHOW GRID
+* revision 1.3 - 3/25/88 - added list_TMAP, mode arguments and interrupts
+* revision 1.4 - 4/7/88  - created sub. SHOW_DATA_SET - allow specified dset #
+* revision 1.5 - 4/29/88 - allow specified variable in SHOW VAR
+* revision 1.6 -  7/2/88 - modified SHOW LIST output
+*			 - added SHOW WINDOWS
+*			 - permitted SHOW MODE mode (named mode)
+* revision 1.7 - 7/22/88 - added SHOW MEMORY/FREE using CHECK_MEMORY
+* revision 1.8 - 7/28/88 - allow SHOW GRID to take grid or variable name with
+*			   variable names having D= qualifiers
+*			   SHOW DATA to accept name as well as number - default
+*			   to /BRIEF
+* revision 1.9 - 8/15/88 - added SHOW DATA/FILES
+* revision 2.0 -  9/1/88 - added SHOW VIEWPORT
+* revision 2.1 -11/23/88 - new TM IO library: FIND_LINE_NUMBER-->TM_GET_LINENUM
+* revision 2.2 - 1/10/89 - SHOW GRID/ALL displays grid names, only
+*			 - SHOW DATA defaults to name and variable list
+* revision 2.3 - 2/16/89 - ds_open --> ds_name.EQ.char_init30 to test open-ness
+* V200:  6/13/89 - SHOW_MEM_VARS doesn't require work space
+*	10/20/89 - SHOW VARIABLES defaults to user-defined vars
+*	10/29/89 - viewport 0 not showable
+*	11/30/89 - SHOW GRID shows default and last
+*	 12/6/89 - added mode_gks
+* Unix/RISC port 4/25/91 *sh*: increased ds_name and xwind_node sizes
+*                9/24/91 - increased size of "arg" to 8 characters for SHOW VAR
+*                11/1/91 - 2 bug fixes: SHOW GRID
+*                          1) check for unknown grid
+*                          2) don't use comma item_list - it's used inside
+* V230: 1/3/92 - added SHOW TRANSFORMS
+*      5/14/92 - REMOTE_X mode was replaced by the REFRESH mode
+*       6/8/92 - added SHOW ALIAS (allow arguments 7/29)
+*       6/9/92 - SHOW LIST uses list_fmt_type
+*      6/26/92 - commands, subcommands, and qualifiers 4-->8 characters
+*     10/22/92 - added units on uvars, increased uvar name length
+*     11/4+/92 - changed qualifiers and length of name on SHOW VIEWPORTS
+*      11/9/92 - eliminate arguments from MODE GKS and MODE META
+*      1/14/93 - updated SHOW MOVIE
+* V300: 2/3/93 - added MODE VERIFY arguments
+*      4/19/93 - old style vp's have negative vp_size and clip limits unknown
+*      5/12/93 - added MODE PPLLIST and MODE JOURNAL filename
+*      6/16/93 - added SHOW QUERIES
+*       9/2/93 - reordered SHOW TRANSFORMS to group transforms better
+* V301:1/12/94 - show MODE METAFILE filename
+*      2/24/94 - incorporate a stack of past mode states
+* V310:5/12/94 - fixed bug revealed by adding /ORDER to SET DATA (70th char)
+* V320:5/17/94 - array "memory" is passed as argument
+*	       - SHOW MEMORY now shows memory size, only
+*     12/29/94 - added /FORMAT=STREAM to SHOW LIST 
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/19/95 - explain "megaword" in SHOW MEMORY 
+* V400:   2/6/95 - added SHOW SYMBOL
+* V411:  7/95 - Added SHOW VAR output for  LET/D var = ...
+* V420:  9/95 - added SHOW GRID/DYNAMIC
+*	      - and SHOW LIST (tab and comma delimited formats)
+*	11/95 - SHOW TRANSFORMS moved to 2 routines: SHOW_TRANSFORMS and
+*						     SHOW_REGRID_TRANSFORMS
+*	 4/96 - use arg_to_item to make comma-separated line blank sep
+*	      - allow templates in SHOW VAR, GRID, AXIS, SYMBOL, ALIAS, VIEW
+*		by using (case-sensitive) MATCH_TEMPLATE
+*	      - changed SHOW VIEW and ALIAS from comma-separated to blank sep
+*	      - added multi-argument capability to SHOW AXIS
+*Linux Port 1/97 *kob* - Added a preprocessor include for tmap_dset.parm
+*			  because it needed a preprocessor.
+* V420:  1/97 - bug fix: SHOW MEMORY/ALL is ignoring /ALL
+* V450:  7/97 - don't show child variables in SHOW VARIABLE
+*             - added SHOW FUNCTION -- with template matching (7/22)
+* 97.07.31 *jc* - added external function code to SHOW FUNCTIONS
+* *kob*  10/97 - added check for string length of zero at 1750.  This error
+*                caught by new DEC f77 version
+* V500 -3/99 *jc*  - added a blank line between internal and external functions
+*                   - added /EXTERNAL qualifier to SHOW FUNCTION
+*                   - fixed EFCN_MATCH_TEMPLATE to behave like MATCH_TEMPLATE
+*                     so that multiple functions are shown
+*       4/99 *sh* - added MODE STUPID:weak_cache
+*       4/99 *sh* - added SHOW AXIS/lims=lo:hi
+* V510 4/00 *sh* - netCDF grids are now dynamic
+*      5/00 *sh* - added SHOW FUNC/DETAILS
+* V522 7/00 *sh* - SHOW SYMBOLS now shows special symbols, too
+* V530 8/00 *sh* - bug fix to SHOW SYMBOLS - avoid accidental PPL$XPIXEL eval
+* V540 9/01 *sh* - SHOW VIEWPORT to show state of /AXES
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm*  1/02 Change SHOW FUNC so that shared object files are 
+*                  not listed on the command: SHO FUNC/INTERNAL func_name
+* V554 *acm* 8/03  New calls to make XML-style output for SHOW DATA, SHOW DATA/VAR
+*                  SHOW AXIS, SHOW GRID
+* V554 *acm* 9/03  Add output for SHOW AXIS in /DODS binary format, 
+*                  see the flag do_dods
+* V570: *acm* 5/04 - add MODE GRATICULE[:argument] 
+* V580: *acm* 10/04 - add xml tags <datasets>  </datasets>, dataset name and title
+*                     <axes>  </axes> for SHOW AXIS/XML
+* V580: *acm* 10/04 - Add xml output for global and dataset variables. SHOW_1_UVAR_XML
+* V600: *acm*  7/05 Fix bug 1186: SHOW FUNC with * properly matches patterns for
+*                   external functions as well as internally linked functions.
+*                   call MATCH_TEMPLATE for all comparisons.
+* V600  *acm*  8/05 Allow more digits in xrevision number
+* V600: *acm*  6/05 - Attribute control: SHOW ATT varname[d=].attname SHOW ATT/ALL varname[d=]
+*                     SHOW DATA/ATTR [d=]
+* 9/06 *acm* 6.01  fixing bug 1439 long symbol values; change length of show_str to 2048
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* v604 *acm* 7/07 increase length of ds_name
+* V604  *acm* 7/07 Dataset names have been increased to 1024, but on output this runs into
+*                  conflicts with Fortran INQUIRE and OPEN calls. Disallow output names
+*                  longer than 256 characters.
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out, but not
+*                  the outputs of SHOW commands. These go to std out.
+* V631 11/09 *acm* For XML-formatted output check for and replace the strings < > and &
+*                  with < etc.
+* V65   3/10 *acm* Remove unused SHOW AXIS in /DODS binary format
+* V65   3/10 *acm* SHOW/OUTFILE=  writes the output to a file rather than std out.
+*                  Implemented so far only for SHOW AXIS, SHOW DATA, SHOW VAR, SHOW GRID,
+*                  to be implemented for all SHOW subcommands in the future
+* V67   *acm* 3/11 - Fix for ticket 1819, size of arg for MODE DESPERATE
+* V67   *acm* 3/11 - Fix for ticket 1825, call cd_get_var_id instead of cd_get_var_seq
+* v675  *acm  4/12 Fix ticket 1934, simpler SHOW ATTRIBUTE syntax.
+
+*       *acm* 3/12 removing use of old GT and TS data formats
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm
+* v675  *acm  4/12 Fix ticket 1934, simpler SHOW ATTRIBUTE syntax.
+* V6.8  acm  6/12 Implement mode_6d_lab, set by default. If canceled, the 
+*                 various SHOW commnands will not list info for E,F dimensions.
+*                 SHOW with 6D variable and mode_6d_lab cancelled, is an error.
+* V683 *acm*  8/12 On SHOW LIST, show the output-type setting from SET LIST/OUTTYPE=  
+* V685 *acm*  2/13 LET/REMOTE changes: show internally-defined climatological axes
+*                  in xml output.
+* V685 *acm*  6/13 Fixes for SHOW VAR/D= on file variables.
+* PyFr *kms*  7/13 Add additional information to SHOW WINDOWS
+* V685 *sh*  9/13 Added SHOW VARIABLE/TREE  (a.k.a. /DEPENDENCIES)
+* V690 *sh* 12/13 Added SHOW TRANSFORMS of auxiliary variable regridding
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+* V690 *sh* 1/14 Add SHOW VAR/SIGMA
+
+        IMPLICIT NONE
+
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'gkscm2.cmn'
+	include	'ferret.parm'
+	include	'slash.parm'
+	include 'errmsg.parm'
+	include 'movies.parm'
+	include 'gfdl_vms.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xvariables.cmn'
+	include 'xcontext.cmn'
+	include 'xtext_info.cmn'
+	include 'xcommand.cmn'
+	include 'xrevision.cmn'
+	include 'xinterrupt.cmn'
+	include	'xfr_grid.cmn'
+	include	'xgks_devices.cmn'
+	include	'xalgebra.cmn'
+	include	'xdependency_tree.cmn'
+	include	'xgrid_chg_fcns.cmn'
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+        include 'EF_Util.cmn'
+        include 'netcdf.inc'
+        INCLUDE 'fgrdel.cmn'
+
+* local parameter declarations:
+	LOGICAL	    brief
+	INTEGER	    len_show_str,
+     .		    slash_mem_free,
+     .		    slash_mem_temp,
+     .		    slash_mem_perm,
+     .		    slash_brief,
+     .		    slash_full,
+     .		    slash_vars,
+     .		    slash_file,
+     .		    slash_att,
+     .		    slash_grid_dyn,
+     .		    slash_var_dset,
+     .		    slash_external,
+     .		    slash_internal,
+     .		    slash_xml,
+     .		    slash_attr,
+     .              slash_grid_xml,
+     .              slash_axis_xml,
+     .              slash_attr_dset,
+     .              slash_attr_output
+     .              
+	PARAMETER ( len_show_str = 2048,		! length of output line buffer
+     .		    brief	 = .TRUE.,
+     .		    slash_mem_temp = 1 + 2,
+     .		    slash_mem_perm = 1 + 3,
+     .		    slash_mem_free = 1 + 4,
+     .		    slash_brief    = 1 + 1,
+     .		    slash_full     = 1 + 2,
+     .		    slash_vars     = 1 + 3,
+     .		    slash_file     = 1 + 4,
+     .		    slash_att      = 1 + 5,
+     .		    slash_grid_dyn = 1 + 13,
+     .		    slash_var_dset = 1 + 1,
+     .		    slash_external = 1 + 2,
+     .		    slash_internal = 1 + 3,
+     .		    slash_xml      = 1 + 5,
+     .		    slash_attr     = 1 + 6,
+     .		    slash_grid_xml = 1 + 14,
+     .		    slash_axis_xml = 1 + 13,
+     .		    slash_attr_dset = 1 + 1,
+     .		    slash_attr_output = 1 + 2)
+
+* calling argument declarations:
+	REAL memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	LOGICAL	MATCH4, MATCH_TEMPLATE, IS_TEMPLATE, TM_HAS_STRING,
+     .		NC_GET_ATTRIB, slash_all, limited_show, 
+     .		nothing, sdetail, only_1, done_1, sfull, svars, sfile, 
+     .		sbrief, first, sxml, clobber, append, firstxml, got_it, 
+     .		coordvar, sattr, do_err, sho_out, sh_att_dset,
+     .		lineok, sho_tree
+	INTEGER TM_LENSTR1, TM_LENSTR, UVAR_NUMBER, STR_UPCASE,
+     .		REGION_NUMBER, GRID_FROM_NAME, FIND_DSET_NUMBER,
+     .		EFCN_MATCH_TEMPLATE, TM_GET_LINENUM, STR_SAME,
+     .		category, mods_cx, v1_blk1, v1_nblks, grid, cx,
+     .		status, iqual, mode, iset, i, icmnd, isub, n,
+     .		len, len0, iuvar, ivar, dset, line, ivp, i1, i2,
+     .		rqst_dset, tmp_grid, num_predefined_axes, 
+     .          flen, wsize, wkblk, len_test, len_mchars, outlist_file,
+     .          j, num_indices, varid, attlen, maxlen, attype,
+     .          vtype, nvdims, vdims(8), nvatts, iatt, dset_last,
+     .          llen, loc, cat, var, attoutflag, all_outflag, dot, brkt,
+     .          vseq, attid, save_deleted_list_result(max_uvar),
+     .          cache_size, cache_nelems, cache_preemption,
+     .          sho_file, idim, ndims, nvars, ngatts, recdim, npts,
+     .          vartype, outflag, num_clim_1, num_clim_n,
+     .          base_cx, base_isp
+        INTEGER saved_num_indices, saved_index_list(max_uvar),
+     .                             arr_buff(max_uvar)
+	REAL	xtemp, ytemp, attvals(100), cache_mb, cache_n, cache_p
+	CHARACTER EXPR_NAME*8, TM_FMT*12, VAR_CODE*128,
+     .		default*10, show_str*2048, arg*128, name*128, argsym*120
+	CHARACTER	varatt*641, varname*512, attname*128,
+     .			efname*40, upname*40, aname*128, outstring*2048,
+     .                  dname*128, actstr*1, aastr*3, qualstr*6, 
+     .                  dispstr*3
+   
+* 10/01 *kob* had to change decl of axesOrCorner for picky f95
+        CHARACTER*6 axesOrCorner(2)
+
+	INTEGER efcn_scan
+
+* local data declarations
+        DATA axesOrCorner(1)/'axes '/,
+     .       axesOrCorner(2)/'edges'/
+
+* for string passing to C function in SHOW MODE FUNCTION
+      INTEGER      slen, dlen
+      PARAMETER  ( slen = ef_max_description )
+#ifdef sun
+      BYTE      fhol(slen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(slen)      ! c-type Hollerith string buffer
+#endif
+
+* initialize
+	show_lun = ttout_lun
+	sxml = .FALSE.
+
+* command given with /ALL ?
+	risc_buff = ' '
+	slash_all = .FALSE.
+	DO 10 iqual = 1, num_qualifiers
+	IF ( qualifier_list( iqual ) .EQ. 1 ) slash_all = .TRUE.
+ 10	CONTINUE
+	limited_show = subcmnd_num .NE. 1 .OR. .NOT. slash_all
+
+* if the user entered a blank-separated list insteas of comma-separated
+* then make it behave like a comma-separated list (4/96)
+	CALL ARG_TO_ITEM
+
+* select subcommand
+	GOTO ( 100, 200, 300, 400, 500, 600, 700, 800, 900,1000,
+     .        1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,
+     .	      2100,2200 )
+     .								subcmnd_num
+
+* SHOW '    ' - (no action)
+* arrival at this point usually means an illegal subcommand was given
+* and was assumed to be an argument by the command parser
+ 100	IF ( num_args .GE. 1 )
+     .		CALL ERRMSG( ferr_invalid_subcmnd,status,
+     .			cmnd_buff( arg_start(1):arg_end(1) ), *5000 )
+	IF ( limited_show ) RETURN
+
+* SHOW WINDOWS
+ 200	nothing = .TRUE.
+	CALL SPLIT_LIST(pttmode_explct, show_lun, 
+     .  ' OPEN  ACTIVE  ANTIALIAS  QUALITY  DISPLAY  THICKEN  TEXTPROM', 
+     .  61)
+ 201    FORMAT(I4,6X,A1,7X,A3,5X,A6,5X,A3,6X,F4.2,5X,F4.2)
+	DO 210 i = 1, max_windows
+	   IF ( wn_open(i) ) THEN
+	      nothing = .FALSE.
+	      IF ( wn_active(i) ) THEN
+                 actstr = '*'
+              ELSE
+                 actstr = ' '
+              ENDIF
+              IF ( antialias(i) ) THEN
+                 aastr = 'YES'
+              ELSE
+                 aastr = ' NO'
+              ENDIF
+              IF ( enginename(i) .EQ. 'Cairo' ) THEN
+                 qualstr = '  HIGH'
+                 dispstr = ' NO'
+              ELSEIF ( enginename(i) .EQ. 'PipedViewerPQ' ) THEN
+                 qualstr = '  HIGH'
+                 dispstr = 'YES'
+              ELSEIF ( enginename(i) .EQ. 'PipedImager' ) THEN
+                 qualstr = ' DRAFT'
+                 dispstr = 'YES'
+              ELSE
+                 qualstr = 'CUSTOM'
+                 dispstr = ' ? '
+              ENDIF
+              risc_buff = ' '
+              WRITE ( risc_buff, 201 ) i, actstr, aastr, qualstr, 
+     .          dispstr, thickfactor(i), wn_textscale(i)/wn_pplscale(i)
+              CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+              risc_buff = ' '
+	   ENDIF
+ 210	CONTINUE
+	IF ( nothing ) CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'   no windows open', 0) 
+	IF ( limited_show ) RETURN
+
+* SHOW REGION reg1,reg2,...,regn
+ 300	CONTINUE
+* show default region
+	IF ( num_args .EQ. 0 .OR. slash_all ) CALL SHOW_REGION( cx_last )
+* show requested regions
+	IF ( num_items .GE. 1 ) THEN
+	   DO 320 i = 1, num_items
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	      arg = cmnd_buff( item_start(i):item_end(i) )
+	      cx = REGION_NUMBER( arg )
+	      IF ( cx .EQ. unspecified_int4 ) CALL ERRMSG
+     .				( ferr_unknown_arg, status, arg, *5000 )
+	      CALL SHOW_REGION( cx )
+ 320	   CONTINUE
+	ELSEIF ( slash_all ) THEN
+* show all user-defined and pre-defined regions
+	   DO 330 cx = 0, min_context, -1
+	      IF ( cx_name( cx ) .NE. unspecified_name4 )
+     .			CALL SHOW_REGION( cx )
+ 330	   CONTINUE
+	ENDIF
+	IF ( limited_show ) RETURN
+
+* SHOW AXIS
+* show a particular named axis
+
+400	IF ( num_args .EQ. 0 .AND. .NOT.slash_all ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, err_lun,
+     .			'SHOW what axis ?', 0)
+	   RETURN
+	ENDIF
+ 	sxml  = qual_given( slash_axis_xml  ) .GT. 0 
+        IF (sxml) firstxml = .TRUE.
+
+* 	SHOW AXIS/FILE=[/APPEND][/CLOBBER]
+
+        sho_file = qual_given( slash_show_axis_file )
+	clobber = qual_given( slash_show_axis_clobber ) .GT. 0
+	append = qual_given( slash_show_axis_append ) .GT. 0
+
+	IF (sho_file .GT. 0) THEN
+	   CALL OPEN_SHOW_FILE (show_lun, sho_file,  
+     .                          clobber, append, status)
+	   IF (status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* decode the limit qualifiers
+	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+	CALL INIT_CONTEXT_MODS( mods_cx )
+	CALL GET_CONTEXT_MODS (	cx_last,
+     .				cmnd_buff,
+     .				mods_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				unknown_qual_ok,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* "allocate" (use) scratch grid
+        tmp_grid =  max_grids-2  ! see docs in TM_ALLO_DYN_GRID.F
+        CALL INIT_GRID( tmp_grid, char_init16, mnormal )
+
+* write column headings
+        IF (.NOT.sxml) THEN
+	   WRITE ( risc_buff, 3000 )
+ 3000	   FORMAT ( T2,'name',T13,'axis',T31,'# pts',T39,
+     .           'start',T60,'end' )
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ENDIF
+	risc_buff = ' '
+	IF ( num_args .GT. 0 ) THEN
+
+	   DO 420 i = 1, num_items
+* show the named line(s)
+	      i1 = STR_UPCASE(name,cmnd_buff(item_start(i):item_end(i)))
+*  ... first show the static lines
+	      DO 410 line = 1, max_lines
+	         IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	         IF ( line_name(line) .EQ. char_init16 ) GOTO 410
+	         IF ( line_name(line)(1:1) .EQ. '(' ) GOTO 410
+	         IF (MATCH_TEMPLATE(line_name(line),name)) THEN
+                   IF (sxml) THEN
+                      IF (firstxml) THEN
+                         risc_buff = '<axes>'
+                         CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .                                risc_buff, 0)
+                         firstxml = .FALSE.
+                      ENDIF
+                      CALL SHOW_LINE_XML( show_lun, line)
+
+                   ELSE
+                      CALL SHOW_LINE( line, .NOT.brief )
+	              DO 405 i2 = 1, nferdims
+	                IF (qual_given( slash_show_grid_x0+i2).GT.0
+     .                 .OR. qual_given( slash_show_grid_i0+i2).GT.0)THEN
+                         grid_line(i2,tmp_grid) = line
+                         CALL SHOW_LINE_COORDS( tmp_grid, mods_cx, i2 )
+                        ENDIF
+ 405                  CONTINUE
+                   ENDIF
+
+                 ENDIF
+ 410	      CONTINUE
+*  ... then show the dynamic lines
+              line = 0
+ 414          CALL TM_NEXT_DYN_LINE( line, *416)
+	         IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	         IF (MATCH_TEMPLATE(line_name(line),name)) THEN
+
+                   IF (sxml) THEN
+                      IF (firstxml) THEN
+                         risc_buff = '<axes>'
+                         CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .                                risc_buff, 0)
+                         firstxml = .FALSE.
+                      ENDIF
+                      CALL SHOW_LINE_XML( show_lun, line)
+
+                   ELSE
+                      CALL SHOW_LINE( line, .NOT.brief )
+	              DO 412 i2 = 1, nferdims
+	                IF (qual_given( slash_show_grid_x0+i2).GT.0
+     .              .OR. qual_given( slash_show_grid_i0+i2).GT.0) THEN
+                         grid_line(i2,tmp_grid) = line
+                         CALL SHOW_LINE_COORDS( tmp_grid, mods_cx, i2 )
+                       ENDIF
+ 412                 CONTINUE
+                   ENDIF
+
+                 ENDIF
+	         GOTO 414
+ 416          CONTINUE
+ 420	   CONTINUE
+	ELSE
+
+* show all the defined axes
+*  ... first show the static lines (for XML output skip pre-defined axes)
+           num_predefined_axes = TM_GET_LINENUM('EZ')
+           num_clim_1 = TM_GET_LINENUM('MONTH_IRREG')
+           num_clim_n = TM_GET_LINENUM('ABSTRACT') - 1
+	   DO 450 line = 1, max_lines
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	      IF ( line_name(line) .EQ. char_init16) GOTO 450
+              IF (.NOT.sxml) THEN
+                 CALL SHOW_LINE( line, brief )
+              ENDIF
+	      lineok = ( line.GT.num_predefined_axes )
+c	      lineok = ( line.GT.num_predefined_axes .OR.
+c     .           (line.GE.num_clim_1 .AND. line.LE.num_clim_n) )
+              IF (sxml .AND. lineok) THEN
+                 IF (firstxml) THEN
+                    risc_buff = '<axes>'
+                    CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .                              risc_buff, 0)
+                    firstxml = .FALSE.
+                 ENDIF
+                 CALL SHOW_LINE_XML( show_lun, line)
+              ENDIF
+
+ 450	   CONTINUE
+*  ... then show the dynamic lines
+           line = 0
+ 460       CALL TM_NEXT_DYN_LINE( line, *470)
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+              IF (sxml) THEN
+                 IF (firstxml) THEN
+                    risc_buff = '<axes>'
+                    CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .                              risc_buff, 0)
+                    firstxml = .FALSE.
+                 ENDIF
+                 CALL SHOW_LINE_XML( show_lun, line)
+
+              ELSE
+	         CALL SHOW_LINE( line, brief )
+              ENDIF
+              GOTO 460
+ 470       CONTINUE
+
+	ENDIF
+        IF (.NOT. firstxml .AND. sxml) THEN
+           risc_buff = '</axes>'
+           CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ENDIF
+	IF ( limited_show ) RETURN
+
+* SHOW EXPRESSION
+ 500	IF ( num_uvars_in_cmnd .EQ. cmnd_uvars_not_given ) THEN
+	   WRITE ( risc_buff, '(8X,A)' ) 
+     .				'SET EXPRESSION has not been given or implied'
+	   CALL SPLIT_LIST(pttmode_explct, err_lun, risc_buff, 0)
+	   risc_buff = ' '
+	ELSE
+	   WRITE ( risc_buff, '(8X,A)' ) 'current output expression(s):'
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+	   DO 510 i = 1, num_uvars_in_cmnd
+	      iuvar = UVAR_NUMBER( EXPR_NAME(i) )
+	      IF ( iuvar .NE. unspecified_int4 ) THEN
+	         WRITE (risc_buff,'(8X,A)')
+     .			 uvar_text(iuvar)(:TM_LENSTR1(uvar_text(iuvar)))
+	         CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	         risc_buff = ' '
+	      ENDIF
+ 510	   CONTINUE
+	ENDIF
+	IF ( limited_show ) RETURN
+
+* SHOW LIST
+ 600	WRITE ( risc_buff, 3600 ) '/PRECISION =', list_digits
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3600	FORMAT ( 8X,'SET LIST',A,I4 )
+        IF ( list_fmt_type .EQ. plist_unformatted ) THEN
+	   WRITE ( risc_buff, 3605 ) 'UNFORMATTED'
+	ELSEIF ( list_fmt_type .EQ. plist_epic ) THEN
+	   WRITE ( risc_buff, 3605 ) 'EPIC'
+	ELSEIF ( list_fmt_type .EQ. plist_cdf )   THEN
+	   WRITE ( risc_buff, 3605 ) 'CDF'
+	ELSEIF ( list_fmt_type .EQ. plist_stream )   THEN
+	   WRITE ( risc_buff, 3605 ) 'STREAM'
+	ELSEIF ( list_fmt_type .EQ. plist_comma_del )   THEN
+	   WRITE ( risc_buff, 3605 ) 'COMMA_DELIMITED'
+	ELSEIF ( list_fmt_type .EQ. plist_tab_del )   THEN
+	   WRITE ( risc_buff, 3605 ) 'TAB_DELIMITED'
+	ELSEIF ( list_format_given )	THEN
+	   WRITE ( risc_buff, 3605 ) list_format(1:TM_LENSTR1(list_format))
+	ELSE
+	   WRITE ( risc_buff, 3605 ) '[Default]'
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3605	FORMAT ( 8X,'SET LIST/FORMAT = ',A )
+	IF ( list_heading ) THEN
+	   WRITE ( risc_buff, 3608 ) 'EN'
+	ELSE
+	   WRITE ( risc_buff, 3608 ) 'DIS'
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3608	FORMAT ( 8X,'SET LIST/HEADING is ',A,'ABLED' )
+	IF ( list_append ) THEN
+	   WRITE ( risc_buff, 3609 ) 'EN'
+	ELSE
+	   WRITE ( risc_buff, 3609 ) 'DIS'
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3609	FORMAT ( 8X,'SET LIST/APPEND is ',A,'ABLED' )
+	IF ( list_file(1:4) .EQ. 'AUTO' ) THEN
+	   WRITE ( risc_buff, 3620 ) list_file(1:TM_LENSTR1(list_file))//
+     .							' [created by program]'
+	ELSE
+	   WRITE ( risc_buff, 3620 ) list_file(1:TM_LENSTR1(list_file))
+	ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3620	FORMAT (8X,'SET LIST/FILE=',A,' ( when LIST/FILE is used )' )
+	IF ( list_outtype(1:3) .EQ. 'DOU') WRITE ( risc_buff, 3630 ) 'Double'
+	IF ( list_outtype(1:3) .EQ. 'FLO') WRITE ( risc_buff, 3630 ) 'Float'
+	IF ( list_outtype(1:3) .EQ. 'INT') WRITE ( risc_buff, 3630 ) 'Int'
+	IF ( list_outtype(1:3) .EQ. 'SHO') WRITE ( risc_buff, 3630 ) 'Short'
+	IF ( list_outtype(1:3) .EQ. 'BYT') WRITE ( risc_buff, 3630 ) 'Byte'
+	IF ( list_outtype(1:3) .EQ. 'DFL') WRITE ( risc_buff, 3630 ) '[Default]'
+
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3630	FORMAT ( 8X,'SET LIST/OUTTYPE = ',A )
+
+        CALL NETCDF4_SHOW_LIST_SETTINGS 
+	IF ( limited_show ) RETURN
+
+* SHOW DATA_SET
+ 700 	CALL SHOW_DATA(dset, status) 
+        IF (status .NE. ferr_ok) GOTO 5000
+	IF ( dset .EQ. unspecified_int4 ) GOTO 5071
+
+	IF ( limited_show ) RETURN
+
+* SHOW MODE mode
+ 800	WRITE ( risc_buff, 3800 )
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3800	FORMAT( T7,'MODE',T23,'STATE',T36,'ARGUMENT' )
+	slash_all = slash_all .OR. num_items .EQ. 0
+	DO 850 mode = 1, max_modes
+	   IF ( mode_name ( mode ) .EQ. pmode_unused ) GOTO 850
+* show this mode ?
+	   IF ( .NOT. slash_all ) THEN
+              len_mchars = TM_LENSTR(mode_name(mode)(:4))
+	      DO 810 i = 1, num_items
+	         name = cmnd_buff( item_start(i):item_end(i) )
+                 len_test = TM_LENSTR(name)
+	         IF ( MATCH4( name, len_test,
+     .             mode_name( mode),len_mchars )) GOTO 820
+ 810	      CONTINUE
+	      GOTO 850	! no match
+	   ENDIF
+ 820	   show_str = '      '//mode_name( mode )
+	   IF ( mode_state( mode, 1 ) ) THEN
+	      show_str(24:) = 'SET'
+	   ELSE
+	      show_str(21:) = 'CANCELLED'
+	   ENDIF
+	   IF ( mode .EQ. pmode_time_lab ) THEN
+	      show_str(36:) = date_labels( ABS(ax_dec_pt(t_dim)) )
+	   ELSEIF ( mode .EQ. pmode_verify ) THEN
+	      show_str(36:) = verify_modes(mode_arg(mode,1))
+	   ELSEIF ( mode .EQ. pmode_journal ) THEN
+	      show_str(36:) = journal_file
+	   ELSEIF ( mode .EQ. pmode_ppllist ) THEN
+	      show_str(36:) = ppllist_file
+	   ELSEIF ( mode .EQ. pmode_metafile ) THEN
+	      show_str(36:) = meta_file			! from GKSCM2  1/94
+	   ELSEIF ( mode .EQ. pmode_STUPID ) THEN
+	      IF (mode_arg(mode,1).EQ.1) show_str(36:) = 'weak_cache'
+	   ELSEIF ( mode .EQ. pmode_grat ) THEN
+              dlen = TM_LENSTR1(mode_grat_buff)
+	      show_str(36:) = mode_grat_buff(:dlen)
+	   ELSEIF ( mode_arg( mode,1 ) .NE. unspecified_int4 ) THEN
+	      WRITE ( show_str(36:42), '(I7)' ) mode_arg( mode,1 )
+	      IF (STR_SAME(show_str(36:42), '*******') .EQ. 0) 
+     .		 WRITE ( show_str(36:47), '(I11)' ) mode_arg( mode,1 )
+	   ENDIF
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			show_str(:TM_LENSTR1(show_str)), 0)
+ 850	CONTINUE
+	IF ( limited_show ) RETURN
+
+* SHOW MOVIE
+* Movies are discontinued with Ferret v6.6: NetCDF-4 / HDF5
+ 900    CONTINUE
+        CALL WARN ( 'Movies are discontinued as of Ferret v6.6' )
+	RETURN
+        IF ( frame_file .EQ. ' ' ) THEN
+           WRITE ( risc_buff, 3905 ) 'There is no SET MOVIE file name'
+        ELSE
+           WRITE ( risc_buff, 3905 ) 'SET MOVIE/FILE = '//
+     .     frame_file(1:TM_LENSTR1(frame_file))
+        ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 	IF ( frame_file .eq. plaser_flag ) THEN
+	   IF ( frame_on ) THEN
+	      WRITE ( risc_buff, 3910 ) 'MOVIE', 'EN'
+	   ELSE
+	      WRITE ( risc_buff, 3910 ) 'MOVIE', 'DIS'
+	   ENDIF
+        ELSE
+           IF ( frame_compress .EQ. 'RLE' ) THEN
+              WRITE ( risc_buff, 3920 ) 'ON'
+           ELSE
+              WRITE ( risc_buff, 3920 ) 'OFF'
+           ENDIF
+        ENDIF
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+ 3905	FORMAT (8X,A)
+ 3910	FORMAT (8X,'SET ',A,' is ',A,'ABLED')
+ 3920	FORMAT (8X,'compression is ',A)
+	IF ( limited_show ) RETURN
+
+* SHOW VARIABLES
+
+ 1000   sxml  = qual_given(slash_show_var_xml) .GT. 0 
+        IF (sxml) firstxml = .TRUE.
+
+* get dset number if appropriate:  SHOW VAR/D=dset ...
+	rqst_dset = unspecified_int4	
+	iqual = qual_given( slash_var_dset )
+	IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			   show_str, status )  ! show_str is just a buffer
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( show_str .NE. ' ' ) THEN
+	      rqst_dset = FIND_DSET_NUMBER( show_str )
+	      IF ( rqst_dset .EQ. unspecified_int4) THEN
+	         CALL WARN('Unknown data set: '
+     .			//show_str(:TM_LENSTR1(show_str)))
+	         RETURN
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* ... SHOW VARIABLE/SIGMA varname [,varname2, ...]
+	IF (qual_given(slash_show_var_sigma) .GT. 0) THEN
+	   IF (slash_all .OR. num_args.EQ.0) THEN
+*    ... get list of varIDs of all variables that have __SigmaRef_ attribute
+              CALL GET_FVARS_LIST_BY_ATTNAME_AND_VAL
+     .            (patnam_sigma, unspecified_name4, max_uvar,
+     .             arr_buff, saved_index_list, num_indices)
+              CALL GET_UVARS_LIST_BY_ATTNAME_AND_VAL
+     .	          (patnam_sigma, unspecified_name4, max_uvar-num_indices,
+     .             arr_buff(num_indices+1),
+     .             saved_index_list(num_indices+1), n )
+              num_indices = num_indices + n
+              IF (num_indices.EQ.0) RETURN
+           ELSE
+*    ... get list of varIDs of all variables requested
+              num_indices = num_items
+	      DO i1 = 1, num_indices
+	         i2 = STR_UPCASE(varname,
+     .			         cmnd_buff(item_start(i1):item_end(i1)))
+                 len = item_end(i1) - item_start(i1) + 1
+	         dset = unspecified_int4    ! to be determined during parse
+	         CALL PARSE_NAM_DSET( varname, cx_last, dset,
+     .			              cat, var, mods_cx, status )
+	         IF ( status .NE. ferr_ok ) RETURN
+	         IF ( var .EQ. munknown_var_name ) THEN
+                    arg = varname
+                    GOTO 5100    ! unknown variable
+                 ENDIF
+* get the variable ID in the linked list  (user vars stored under dset=-1?)
+	         IF (cat .EQ. cat_user_var) THEN
+                    rqst_dset = -1  ! signals a uvar in linked list calls?
+                 ELSE
+                    rqst_dset = dset
+                 ENDIF
+* NOTE: if dset=-1 signals uvar, it would seem that we'll see a bug if
+*       the same varname is used for LET/D definitions in two datasets
+	         CALL CD_GET_VAR_ID (rqst_dset, varname, varid, status)!status?
+                 arr_buff(i1) = varid
+                 saved_index_list(i1) = rqst_dset
+              ENDDO
+           ENDIF
+* loop through the requested variables displaying sigma info
+           DO i1 = 1, num_indices
+* get the attribute value of '__SigmaRef_' (patnam_sigma)
+              varid = arr_buff(i1)
+              dset  = saved_index_list(i1)
+              maxlen = size_rbuff
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+              len = TM_LENSTR1(varname)
+              got_it = NC_GET_ATTRIB ( dset, varid, patnam_sigma,
+     .                                 .TRUE., varname, maxlen,
+     .                                 attlen, attoutflag, risc_buff,
+     .                                 attvals )
+              IF (.NOT.got_it) THEN
+* ... we only arrive here if request was for named vars: SH VAR/SIG a, b, c
+* ... no explicit sigma reference defined for this variable
+                 show_str =
+     .         '  No variable holds vertical (sigma) coordinates of '
+     .                // varname(:len)
+
+* look for inherited sigma dependencies 
+	         dset = unspecified_int4    ! to be determined during parse
+	         CALL PARSE_NAM_DSET( varname, cx_last, dset,
+     .			              cat, var, mods_cx, status )
+                 IF (cat .EQ. cat_user_var) THEN
+* ... trigger grid-getting, which also gets sigma associations
+	           grid = GRID_FROM_NAME
+     .                    (cmnd_buff(item_start(i1):item_end(i1)),
+     .			  cx_last, status )
+                   IF (uvar_aux_stat(var, z_dim).EQ.paux_stat_conflict) THEN
+                      show_str = '   Components in the definition of ' // 
+     .                  varname(:len) //
+     .                  ' have conflicting SIGMA references'
+                   ELSEIF (uvar_aux_stat(var,z_dim).EQ.paux_stat_passed
+     .                .OR. uvar_aux_stat(var,z_dim).EQ.paux_stat_needed) THEN
+                      risc_buff = VAR_CODE(uvar_aux_cat(var,z_dim,dset),
+     .                                     uvar_aux_var(var,z_dim,dset))
+                      attlen = TM_LENSTR1(risc_buff)
+                      show_str = '  ' // risc_buff(:attlen) //
+     .                  ' holds the vertical (sigma) coordinates of ' //
+     .                  varname(:len)
+                   ELSEIF (uvar_aux_stat(var,z_dim).EQ.paux_stat_used) THEN
+                      show_str = '  The definition of ' // 
+     .                  varname(:len) //
+     .                  ' contains explicit regrids of'//
+     .                  ' its SIGMA coordinates'
+                   ENDIF 
+                 ENDIF
+              ELSE
+* ... show the explicit __sigma_ref_ attribute value
+                show_str = '  ' // risc_buff(:attlen) //
+     .         ' holds the designated vertical (sigma) coordinates of ' //
+     .          varname(:len)
+              ENDIF
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, show_str, 0)
+           ENDDO
+           RETURN
+	ENDIF
+
+* 	SHOW VARIABLES/FILE=[/APPEND][/CLOBBER]
+
+        sho_file  = qual_given( slash_show_var_file    )
+	clobber   = qual_given( slash_show_var_clobber ) .GT. 0
+	append    = qual_given( slash_show_var_append  ) .GT. 0
+        sho_tree  = qual_given( slash_show_var_tree    ) .GT. 0
+
+	IF (sho_file .GT. 0) THEN
+	   CALL OPEN_SHOW_FILE (show_lun, sho_file, 
+     .                          clobber, append, status)
+	   IF (status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* ... SHOW VARIABLES/DIAGNOSTIC
+        IF ( (slash_all .AND. .NOT.sho_tree)
+     .  .OR. qual_given(slash_show_var_diag) .GT. 0 ) THEN
+	   IF ( num_args .GT. 0 ) THEN
+	      arg = cmnd_buff(arg_start(1):arg_end(1))
+	   ELSE
+	      arg = unspecified_name4
+	   ENDIF
+	   CALL GET_MEMORY( max_mrs, v1_blk1, v1_nblks, status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	   CALL SHOW_DIAG_VARS( arg, memory(1,v1_blk1) )
+	   CALL FREE_MEMORY( v1_blk1, v1_nblks )
+	ENDIF
+
+* ... SHOW VARIABLE/TREE [expr]
+        IF ( sho_tree ) THEN 
+*     /TREE=USER and /TREE=FILE
+	   iqual = qual_given( slash_show_var_tree )
+	   CALL EQUAL_STRING(cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			   show_str, status )  ! show_str is just a buffer
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF     ( show_str(1:1) .EQ. 'A'
+     .     .OR.     slash_all             ) THEN
+             dependency_tree_show_uvars = .TRUE.  ! show all vars
+             dependency_tree_show_fvars = .TRUE.
+	   ELSEIF ( show_str(1:1) .EQ. ' '
+     .         .OR. show_str(1:1) .EQ. 'U') THEN
+             dependency_tree_show_uvars = .TRUE.  ! show user vars only
+             dependency_tree_show_fvars = .FALSE.
+	   ELSEIF ( show_str(1:1) .EQ. 'F' ) THEN
+             dependency_tree_show_uvars = .FALSE. ! show file vars only
+             dependency_tree_show_fvars = .TRUE.
+           ELSE
+              GOTO 5150
+           ENDIF
+           base_isp = 8
+           base_cx = 8
+           CALL INIT_DEPENDENCIES( cx_last, .TRUE., base_isp, status )
+           IF (status.NE. ferr_ok) GOTO 5050
+           IF (slash_all .OR. num_args.EQ.0) THEN
+*       SHOW VAR/TREE  [no expression] with or without /ALL -- shows all uvars
+              CALL DELETE_OLD_EXPR
+              CALL deleted_list_get_undel(uvar_num_items_head, 
+     .                          deleted_list_result(1),
+     .                          max_uvar, num_indices )
+              IF (num_indices .EQ. 0) GOTO 1010
+* ... we need to save a private copy of the index list, else it gets corrupted
+*       by a call to delete_list_get_undel in INIT_DEPENDENCIES
+              saved_num_indices = num_indices
+              DO 1007 i = 1, saved_num_indices
+ 1007         saved_index_list(i) = deleted_list_result(i)
+              DO 1008 i = 1, saved_num_indices
+                 CALL CRAWL_DEPENDENCIES
+     .                          ( memory,
+     .                          uvar_name_code(saved_index_list(i)), 
+     .                          base_cx, status )
+                 IF (status .NE. ferr_ok) GOTO 5050
+ 1008         CONTINUE
+	   ELSE
+*       SHOW VAR/TREE  expr1, expr2, ...
+*  ... multiplicity of items is handled by BREAK_UP_EXPR in CRAWL_DEPENDENCIES
+              CALL CRAWL_DEPENDENCIES
+     .                   ( memory,
+     .                     cmnd_buff(item_start(1):item_end(num_items)), 
+     .                     base_cx, status )
+              IF (status .NE. ferr_ok) GOTO 5050
+           ENDIF
+           CALL DISPLAY_DEPENDENCY( memory(1,dependency_block1) )
+ 1010      CALL EXIT_DEPENDENCY_MODE
+           RETURN
+        ENDIF
+
+* ... SHOW VARIABLES/USER
+	IF ( slash_all .OR. qual_given(slash_show_var_diag) .EQ. 0 ) THEN
+* ... get dset number if appropriate:  SHOW VAR/USER/D=dset ...
+	   iqual = qual_given( slash_var_dset )
+	   IF ( iqual .GT. 0 ) THEN
+	      CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      show_str, status )  ! show_str is just a buffer
+	      IF ( status .NE. ferr_ok ) RETURN
+	      IF ( show_str .EQ. ' ' ) THEN
+	         rqst_dset = pdset_irrelevant	! global variables
+	      ELSE
+	         rqst_dset = FIND_DSET_NUMBER( show_str )
+	         IF ( rqst_dset .EQ. unspecified_int4) THEN
+	            CALL WARN('Unknown data set: '
+     .			//show_str(:TM_LENSTR1(show_str)))
+	            RETURN
+	         ENDIF
+	      ENDIF
+	   ELSE
+	      rqst_dset = unspecified_int4	! all variables
+	   ENDIF
+* ... SHOW VAR specific_var ... various cases of how to show:
+*	SHOW VAR name		- show ALL user variables of this name
+*	SHOW VAR name[D=n]	- show only variable from named data set
+*	SHOW VAR/D=n name	- show only variable from named data set
+
+	   IF ( num_args .GT. 0 ) THEN
+	      DO 1020 i = 1, num_items
+	         i1 = STR_UPCASE(arg,cmnd_buff(item_start(i):item_end(i)))
+
+	         IF ( INDEX(arg,'[') .GT. 0 ) THEN
+* ... bug (minor): square brackets **may** not contain D=dset information
+* 	a work-around: pass a context with data set info (instead of cx_last)
+		    dset = pdset_irrelevant	! default (not used ...)
+                    CALL PARSE_NAM_DSET(arg, cx_last, dset,
+     .				     category, ivar, mods_cx, status)
+                    IF (dset .EQ. pdset_irrelevant .AND. 
+     .                  rqst_dset .NE. unspecified_int4)
+     .                         dset = rqst_dset
+	            IF (status .EQ. ferr_ok) THEN 
+                       IF (category .EQ. cat_user_var) THEN
+                          IF (sxml) THEN
+	                     CALL SHOW_1_UVAR_XML 
+     .                         (show_lun,ivar,show_str,firstxml)
+                          ELSE
+	                    CALL SHOW_1_UVAR
+     .                      (show_lun,ivar,show_str,' ',.TRUE.)
+                          ENDIF
+
+*  if not a user var, see if its a dataset variable from a nc file.
+                       ELSE
+                         len = INDEX(arg,'[') - 1
+                         IF (INDEX(arg,'.') .NE. 0) GOTO 5100
+			 CALL CD_GET_VAR_ID (dset, arg(:len), varid, status)
+                         IF (status .EQ. ferr_ok) THEN
+			    CALL SHOW_1_DSVAR (show_lun, dset, arg, varid)
+                         ENDIF
+                       ENDIF
+
+                    ENDIF
+	         ELSEIF (  rqst_dset .NE. unspecified_int4) THEN
+		    CALL FIND_VAR_NAME(rqst_dset,arg,category,ivar)
+	            IF ( ivar .EQ. munknown_var_name
+     .		        .OR. category .NE. cat_user_var ) THEN
+     
+*  if not a user var, see if its a dataset variable from a nc file.
+                       len = TM_LENSTR1(arg)
+                       IF (INDEX(arg,'.') .NE. 0) GOTO 5100
+                       CALL CD_GET_VAR_ID (rqst_dset, arg(:len), varid, status)
+                       IF (status .EQ. ferr_ok)  THEN
+		          CALL SHOW_1_DSVAR (show_lun, rqst_dset, arg, varid)
+                       ELSE 
+                          GOTO 5100
+                       ENDIF
+                    ELSE
+                       IF (sxml) THEN
+	                  CALL SHOW_1_UVAR_XML 
+     .                      (show_lun,ivar,show_str,firstxml)
+                       ELSE
+	                 CALL SHOW_1_UVAR
+     .                      (show_lun,ivar,show_str,' ',.TRUE.)
+                       ENDIF
+                    ENDIF
+	         ELSE
+* ... show ALL user variables matching this name (or name template 4/96)
+*	            DO 1015 ivar = 1, max_uvar
+*	               IF (uvar_num_items(ivar).EQ.uvar_deleted) GOTO 1015
+                    CALL deleted_list_get_undel(uvar_num_items_head,
+     .                                         deleted_list_result(1),
+     .                                         max_uvar, num_indices )
+                    DO 1012, i2 = 1, max_uvar
+                      save_deleted_list_result(i2) = 
+     .                       deleted_list_result(i2)
+ 1012	            CONTINUE
+                    DO 1015 j = 1, num_indices
+                       ivar = save_deleted_list_result(j)
+	               IF ( uvar_parent(ivar).NE.0
+     .		      .AND. .NOT.mode_diagnostic   ) GOTO 1015     ! 7/97
+!	               IF (MATCH_NAME(arg,uvar_name_code(ivar)))
+
+                       IF (MATCH_TEMPLATE(uvar_name_code(ivar),arg))THEN
+                         IF (sxml) THEN
+     			    CALL SHOW_1_UVAR_XML
+     .                         (show_lun,ivar,show_str,firstxml)
+                         ELSE
+     			    CALL SHOW_1_UVAR
+     .				(show_lun, ivar, show_str,' ',.TRUE.)
+                         ENDIF
+                      ENDIF
+ 1015	            CONTINUE
+	         ENDIF
+ 1020	      CONTINUE
+	   ELSEIF (rqst_dset .NE. unspecified_int4) THEN
+* ... show user variables belonging to the specified data set
+*	      DO 1030 i = 1, max_uvar
+*	         IF (uvar_num_items(i) .EQ. uvar_deleted  ) GOTO 1030
+              CALL deleted_list_get_undel(uvar_num_items_head,
+     .                                    deleted_list_result(1),
+     .                                    max_uvar, num_indices )
+              DO 1022, i2 = 1, max_uvar
+                save_deleted_list_result(i2) = deleted_list_result(i2)
+ 1022         CONTINUE
+              DO 1030 j = 1, num_indices
+                 i = save_deleted_list_result(j)
+	         IF (uvar_name_code(i)(1:3) .EQ. 'EX#'    ) GOTO 1030
+	         IF ( rqst_dset .NE. uvar_dset(i)	  ) GOTO 1030
+	         IF ( uvar_parent(i).NE.0
+     .		 .AND. .NOT.mode_diagnostic		  ) GOTO 1030  ! 7/97
+                 IF (sxml) THEN
+                    CALL SHOW_1_UVAR_XML 
+     .                      (show_lun,i,show_str,firstxml)
+                 ELSE
+                    CALL SHOW_1_UVAR
+     .                 (show_lun,i,show_str,'     ',.TRUE.)
+                 ENDIF
+ 1030	      CONTINUE
+	   ELSE
+* ... show ALL user variables of every stripe
+* ... 8/95 sorted by data set
+	      IF (.NOT. sxml) CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			' Created by DEFINE VARIABLE:', 0)
+* ... locate the highest data set number in use
+	      DO 1035 i1 = maxdsets, 1, -1
+	         IF ( ds_name(i1) .NE. char_init1024) GOTO 1040
+ 1035	      CONTINUE
+ 1040	      DO 1060 dset = 1, i1
+* ... loop through the currently initialized data sets
+*	         DO 1050 i = 1, max_uvar
+*	            IF (uvar_num_items(i) .EQ. uvar_deleted  ) GOTO 1050
+                 CALL deleted_list_get_undel(uvar_num_items_head,
+     .                                      deleted_list_result(1),
+     .                                      max_uvar, num_indices )
+     
+                 DO 1042, i2 = 1, max_uvar
+                    save_deleted_list_result(i2) = 
+     .		      deleted_list_result(i2)
+ 1042            CONTINUE
+                 DO 1050 j = 1, num_indices
+                    i = save_deleted_list_result(j)
+	            IF (uvar_name_code(i)(1:3) .EQ. 'EX#'    ) GOTO 1050
+	            IF ( dset .NE. uvar_dset(i)		     ) GOTO 1050
+	            IF ( uvar_parent(i).NE.0
+     .		    .AND. .NOT.mode_diagnostic		     ) GOTO 1050 ! 7/97
+
+                    IF (sxml) THEN
+                       CALL SHOW_1_UVAR_XML
+     .                      (show_lun,i,show_str,firstxml)
+                    ELSE
+                       CALL SHOW_1_UVAR
+     .                    (show_lun,i,show_str,'     ',.TRUE.)
+                    ENDIF
+
+ 1050	         CONTINUE
+ 1060	      CONTINUE
+* ... global variables defined without /D
+
+	      first = .TRUE.
+
+              CALL deleted_list_get_undel(uvar_num_items_head,
+     .                                    deleted_list_result(1),
+     .                                    max_uvar, num_indices )
+              DO 1062, i2 = 1, max_uvar
+                    save_deleted_list_result(i2) = 
+     .		      deleted_list_result(i2)
+ 1062         CONTINUE
+              DO 1070 j = 1, num_indices
+                 i = save_deleted_list_result(j)
+	         IF (uvar_name_code(i)(1:3) .EQ. 'EX#'    ) GOTO 1070
+	         IF ( uvar_dset(i) .NE. unspecified_int4  ) GOTO 1070
+	         IF ( uvar_parent(i).NE.0
+     .		 .AND. .NOT.mode_diagnostic		  ) GOTO 1070  ! 7/97
+
+                 IF (sxml) THEN
+                    CALL SHOW_1_UVAR_XML
+     .                      (show_lun,i,show_str,firstxml)
+                 ELSE
+		    IF ( first ) THEN
+	               CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .	  ' >>> Definitions that replace any file variable of same name:'
+     .    , 0)
+	               first = .FALSE.	            
+	            ENDIF
+                    CALL SHOW_1_UVAR
+     .                 (show_lun,i,show_str,'     ',.TRUE.)
+                 ENDIF
+
+ 1070	      CONTINUE
+* ... global variables defined with /D
+	      first = .TRUE.
+*	      DO 1080 i = 1, max_uvar
+*	         IF (uvar_num_items(i) .EQ. uvar_deleted  ) GOTO 1080
+              CALL deleted_list_get_undel(uvar_num_items_head,
+     .                                    deleted_list_result(1),
+     .                                    max_uvar, num_indices )
+              DO 1072, i2 = 1, max_uvar
+                    save_deleted_list_result(i2) = 
+     .		      deleted_list_result(i2)
+ 1072         CONTINUE
+              DO 1080 j = 1, num_indices
+                 i = save_deleted_list_result(j)
+	         IF (uvar_name_code(i)(1:3) .EQ. 'EX#'    ) GOTO 1080
+	         IF ( uvar_dset(i) .NE. pdset_irrelevant  ) GOTO 1080
+	         IF ( uvar_parent(i).NE.0
+     .		 .AND. .NOT.mode_diagnostic		  ) GOTO 1080  ! 7/97
+
+                 IF (sxml) THEN
+                    CALL SHOW_1_UVAR_XML
+     .                      (show_lun,i,show_str,firstxml)
+                 ELSE
+		    IF ( first ) THEN
+	               CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .	' >>> Definitions used if no file variable of this name exists:'
+     .    , 0)
+	               first = .FALSE.	            
+	            ENDIF
+                    CALL SHOW_1_UVAR
+     .                 (show_lun,i,show_str,'     ',.TRUE.)
+                 ENDIF
+
+
+
+ 1080	      CONTINUE
+	   ENDIF
+ 4010	FORMAT (1x,A,' = ',A)
+ 4020	FORMAT (T20,'"',A,'"')
+	ENDIF
+        IF (.NOT. firstxml .AND. sxml) THEN
+           risc_buff = '</global>'
+           CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+        ENDIF
+
+	IF ( limited_show ) RETURN
+
+* SHOW COMMAND [name]
+ 1100	only_1 = num_args .GT. 0
+	done_1 = .FALSE.
+	IF ( .NOT.only_1 ) THEN
+           show_str = TM_FMT(revision_level, 5, 12, dlen)
+	   WRITE (risc_buff, 4100)
+     .				program_name(1:len_program_name),
+     .				progname_mod (1:len_progname_mod),
+     .				show_str(1:dlen)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 4100	   FORMAT(' Commands in Program ',A,1X,A,' version',A,':')
+	ENDIF
+* ... loop through commands
+        len_test = TM_LENSTR(cmnd_buff(arg_start(1):arg_end(1)))
+	DO 1130 icmnd = 1, total_num_commands
+	   IF ( commands(icmnd)(:4) .EQ. '****' ) GOTO 1130
+	   IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+* ... if  only 1 command is of interest is this it ?
+           len_mchars = TM_LENSTR(commands(icmnd)(:4))
+	   IF ( only_1 .AND. .NOT.MATCH4(cmnd_buff(arg_start(1):arg_end(1)),
+     .		len_test,commands(icmnd),len_mchars) ) GOTO 1130
+	   done_1 = .TRUE.
+	   len0 = TM_LENSTR1( commands(icmnd) )
+* ... and for each command, its subcommands
+	   DO 1120 isub = subcommand_pointer(icmnd),
+     .			  subcommand_pointer(icmnd)+num_subcommands(icmnd)-1
+	      IF ( subcommands(isub)(:4) .EQ. '****' ) GOTO 1120
+	      show_str = commands(icmnd)(:len0) // ' ' // subcommands(isub)
+	      len = TM_LENSTR1( show_str )
+* ... and for each subcommand, its qualifiers
+	      DO 1110 iqual =   qualifier_pointer(isub),
+     .				qualifier_pointer(isub)+num_qualifs(isub)-1
+	         IF ( qualifiers(iqual)(:4) .EQ. '****' ) GOTO 1110
+	         show_str = show_str(1:len) // '/' // qualifiers(iqual)
+	         len = len + 1 + TM_LENSTR1( qualifiers(iqual) )
+	         IF ( len .GE. 70 ) THEN
+	            CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				' '//show_str, len+1)
+	            show_str = ' '
+	            len = len0 + 2
+	         ENDIF
+ 1110	      CONTINUE
+ 1115	      IF ( show_str .NE. ' ' ) CALL SPLIT_LIST
+     .			(pttmode_explct, show_lun, ' '//show_str, len+1)
+ 1120	   CONTINUE
+ 1130	CONTINUE
+	IF ( only_1 .AND. .NOT.done_1 ) THEN
+	   WRITE (risc_buff, 4150)
+     .					cmnd_buff( arg_start(1):len_cmnd )
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 4150	   FORMAT(' Not a recognized command: ',A)
+	ENDIF
+	IF ( .NOT.(only_1.AND.done_1) ) THEN
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,' ', 1)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		' Use SHOW ALIAS to see alternative command names', 0)
+	ENDIF
+ 1199	IF ( limited_show ) RETURN
+
+* SHOW MEMORY
+ 1200   show_str = TM_FMT( FLOAT(mem_blk_size) * 
+     .                     FLOAT(max_mem_blks) / 1.E6, 3, 12, len)
+	WRITE (risc_buff, *)
+     .	   'Current size of FERRET memory cache: '
+     .		//show_str(:len)//' MegaWords  (1 word = 4 bytes)'
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+	IF ( qual_given( slash_mem_free ) .GT. 0 ) THEN
+	   CALL CHECK_MEMORY( show_lun )
+	ELSEIF( slash_all
+     .     .OR. qual_given(slash_mem_temp) .GT. 0
+     .	   .OR. qual_given(slash_mem_perm) .GT. 0 ) THEN
+	   CALL SHOW_MEM_VARS
+	ENDIF
+	IF ( limited_show ) RETURN
+
+* SHOW GRID grid_or_var1 grid_or_var2 ... grid_or_varN
+* first examine the context info ( /X ... etc. )
+ 1300	CALL STACK_PTR_UP ( cx_stack_ptr, max_context, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	mods_cx = cx_stack_ptr
+ 	sxml  = qual_given( slash_grid_xml  ) .GT. 0 
+
+
+* 	SHOW GRID/FILE=[/APPEND][/CLOBBER]
+        sho_file = qual_given( slash_show_grid_file )
+	clobber = qual_given( slash_show_grid_clobber ) .GT. 0
+	append = qual_given( slash_show_grid_append ) .GT. 0
+
+	IF (sho_file .GT. 0) THEN
+	   CALL OPEN_SHOW_FILE (show_lun, sho_file,  
+     .                          clobber, append, status)
+	   IF (status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+	CALL INIT_CONTEXT_MODS( mods_cx )
+	CALL GET_CONTEXT_MODS (	cx_last,
+     .				cmnd_buff,
+     .				mods_cx,
+     .				max_qual_list,
+     .				num_qualifiers,
+     .				qual_start,
+     .				qual_end,
+     .				unknown_qual_ok,
+     .				status	)
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+	IF ( num_args .GE. 1 ) THEN
+
+* loop through the variables named 
+! bug fix: 11/91 *sh* : changed comma list to blank-separated argument list
+!	    4/96: *sh* used ARG_TO_ITEM to harmonize
+	   DO 1350 ivar = 1, num_items
+	      i1 = STR_UPCASE(arg,cmnd_buff(item_start(ivar):item_end(ivar)))
+	      IF ( IS_TEMPLATE( arg ) ) THEN
+*    ... first check static grids
+	         DO 1340 grid = 1, max_grids
+	            IF ( grid_name(grid) .EQ. char_init16 ) GOTO 1340
+	            IF (MATCH_TEMPLATE(grid_name(grid) ,arg)) THEN
+	               WRITE ( risc_buff, 4220 ) '  '//grid_name(grid)
+	               CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				risc_buff, 0)
+	               risc_buff = ' '
+	            ENDIF
+ 1340	         CONTINUE
+*    ... then check dynamic grids
+                 grid = 0
+ 1344            CALL TM_NEXT_DYN_GRID( grid, *1346 )
+	            IF (MATCH_TEMPLATE(grid_name(grid) ,arg)) THEN
+	               WRITE ( risc_buff, 4220 ) '  '//grid_name(grid)
+	               CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .				risc_buff, 0)
+	               risc_buff = ' '
+	            ENDIF
+	            GOTO 1344
+ 1346               CONTINUE
+	      ELSE
+	         grid = GRID_FROM_NAME
+     .                    ( cmnd_buff(item_start(ivar):item_end(ivar)),
+     .			  cx_last, status )
+	         IF ( status .NE. ferr_ok ) GOTO 1350
+                 IF ( grid .EQ. unspecified_int4 ) GOTO 5300
+	         IF (sxml) THEN 
+                    CALL SHOW_GRID_XML(show_lun, grid, unspecified_int4 )
+                 ELSE
+	            WRITE ( risc_buff, 4210 ) grid_name( grid )
+		    IF (dset.NE.unspecified_int4 .AND. dset.NE.pdset_irrelevant) THEN
+	            IF ( TM_HAS_STRING(ds_type(dset), 'ENS') ) THEN
+		       dlen = TM_LENSTR1(grid_name(grid) )
+		       WRITE ( risc_buff, 4211) grid_name(grid)(:dlen)
+		    ENDIF
+		    ENDIF
+	            CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+
+	            risc_buff = ' '
+	            CALL SHOW_GRID( grid, mods_cx, status )
+		    IF (status .NE. ferr_ok) GOTO 5000
+	         ENDIF
+	      ENDIF
+ 1350	   CONTINUE
+ 4210	   FORMAT ( 4X,'GRID ',A)
+ 4211	   FORMAT ( 4X,'GRID ',A, '  Ferret-defined Ensemble Grid')
+
+	ELSEIF( qual_given(slash_grid_dyn) .GT. 0 ) THEN
+	   CALL SHOW_DYN_GRIDS(mods_cx)
+	ELSEIF ( slash_all ) THEN
+	   WRITE ( risc_buff, 4215 ) grid_name(mgrid_abstract)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 4215	   FORMAT(' Default grid for DEFINE VARIABLE is ',A)
+* show 'em all the names
+	   WRITE ( risc_buff, 4220 ) '** GRIDS NAMES **'
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+	   DO 1360 grid = 1, max_grids
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	      IF ( grid_name( grid ) .EQ. char_init16 ) GOTO 1360
+	      WRITE ( risc_buff, 4220 ) '  '//grid_name( grid )
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	      risc_buff = ' '
+ 4220	      FORMAT (4X,A)
+ 1360	   CONTINUE
+*    ... then check dynamic grids
+           grid = 0
+ 1370      CALL TM_NEXT_DYN_GRID( grid, *1379 )
+	      IF ( grid_name(grid)(1:1) .EQ. '(' ) GOTO 1370
+	      WRITE ( risc_buff, 4220 ) '  '//grid_name( grid )
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	      risc_buff = ' '
+	      GOTO 1370
+ 1379      CONTINUE
+
+	ELSE
+	   WRITE ( risc_buff, 4215 ) grid_name(mgrid_abstract)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+* display the grid from last command
+	   cx = is_cx( 1 )
+	   IF ( cx.EQ.0 .OR. cx.EQ.unspecified_int4 )	GOTO 1390
+	   grid = cx_grid( cx )
+	   IF ( grid .EQ. unspecified_int4 ) 		GOTO 1390
+	   WRITE ( risc_buff, 4200 ) grid_name(grid)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+	   WRITE ( risc_buff, 4210 ) grid_name(grid)
+	   CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	   risc_buff = ' '
+ 4200	   FORMAT (' Last successful data access was on grid ',A)
+	   CALL SHOW_GRID( grid, mods_cx, status )
+	   IF (status .NE. ferr_ok) GOTO 5000
+	ENDIF
+
+* release context stack space
+	CALL STACK_PTR_DN ( cx_stack_ptr, cx_stack_ptr_base, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* successful completion
+ 1390 	RETURN
+
+* SHOW VIEWPORT view1,view2,...
+* column headings
+ 1400	WRITE ( risc_buff, 3142 )
+	CALL SPLIT_LIST(pttmode_explct, show_lun, ' ', 1)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, ' ', 1)
+	risc_buff = ' '
+ 
+	IF ( num_args .GE. 1 ) THEN
+* ... loop through the viewports named
+	   DO 1420 i = 1, num_items
+* ... identify the viewport number from the template (or name)	      
+	      i1 = STR_UPCASE(arg,cmnd_buff(item_start(i):item_end(i)))
+	      DO 1410 ivp = 1, max_viewport
+	         IF ( vp_name(ivp).EQ.unspecified_name4 ) GOTO 1410
+	         IF ( MATCH_TEMPLATE(vp_name(ivp), arg) ) THEN 
+		    IF ( vp_xclip(ivp) .EQ. unspecified_val4 ) THEN
+		       xtemp = 0.0
+		       ytemp = 0.0
+		    ELSE
+		       xtemp = vp_xclip(ivp)
+		       ytemp = vp_yclip(ivp)
+		    ENDIF
+                    IF (vp_by_axis(ivp)) THEN
+                      i2 = 1
+                    ELSE
+                      i2 = 2
+                    ENDIF
+	            WRITE (risc_buff,3146) vp_name(ivp), vp_size(ivp),
+     .					   vp_xorg(ivp), xtemp,
+     .					   vp_yorg(ivp), ytemp,
+     .                                     axesOrCorner(i2)
+	            CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	            risc_buff = ' '
+	         ENDIF
+ 1410	      CONTINUE
+ 1420	   CONTINUE
+	ELSE
+* ... show 'em all
+	   DO 1450 ivp = 1,max_viewport
+	      IF ( vp_name(ivp).NE.unspecified_name4 ) THEN
+		 IF ( vp_xclip(ivp) .EQ. unspecified_val4 ) THEN
+		    xtemp = 0.0
+		    ytemp = 0.0
+		 ELSE
+		    xtemp = vp_xclip(ivp)
+		    ytemp = vp_yclip(ivp)
+		 ENDIF		 
+                 IF (vp_by_axis(ivp)) THEN
+                   i2 = 1
+                 ELSE
+                   i2 = 2
+                 ENDIF
+	         WRITE (risc_buff,3146)	vp_name(ivp), vp_size(ivp),
+     .					vp_xorg(ivp), xtemp,
+     .					vp_yorg(ivp), ytemp,
+     .                                  axesOrCorner(i2)
+	         CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	         risc_buff = ' '
+	      ENDIF
+ 1450	   CONTINUE
+	ENDIF
+* tell what's current
+	WRITE ( risc_buff, 3148 ) vp_name(vp_num)
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+
+ 	RETURN
+ 3142	FORMAT(' name',T19,'text',T27,'xlimits',T39,'ylimits',T50,'mode')
+ 3146	FORMAT(1X,A,T18,F5.2,T26,F4.2,',',F4.2,T38,F4.2,',',F4.2,T50,A)
+ 3148	FORMAT( T4,'current viewport is ',A)
+
+* SHOW TRANSFORMS
+ 1500   CONTINUE
+	CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .		'variable transforms e.g.SST[T=1-jan:15-mar at DDC]', 47)
+	CALL SHOW_TRANSFORMS
+	CALL SPLIT_LIST(pttmode_explct, show_lun, ' ', 1)	! blank line
+	CALL SHOW_REGRID_TRANSFORMS
+	IF ( limited_show ) RETURN
+
+* SHOW ALIAS
+ 1600   WRITE (risc_buff, 3160) 'Alias', 'Command'
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+        WRITE (risc_buff, 3160) '-----', '-------'
+	CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	risc_buff = ' '
+        IF ( num_args .EQ. 0 .OR. slash_all ) THEN
+	   DO 1610 i = 1, total_num_alias
+	      IF ( alias_name(i) .EQ. unspecified_name4 ) GOTO 1610
+	      WRITE ( risc_buff, 3160 ) alias_name(i), alias(i)
+	      CALL SPLIT_LIST(pttmode_explct, show_lun, risc_buff, 0)
+	      risc_buff = ' '
+ 1610	   CONTINUE
+        ELSE
+           DO 1630 i1 = 1, num_items
+	      i2 = STR_UPCASE(arg,cmnd_buff(item_start(i1):item_end(i1)))
+	      DO 1620 i = 1, total_num_alias    
+	         IF ( alias(i) .EQ. unspecified_name4 ) GOTO 1620
+	         IF ( MATCH_TEMPLATE(alias_name(i), arg) ) THEN 
+                    WRITE ( risc_buff, 3160 ) alias_name(i), alias(i)
+	            CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .					risc_buff, 0)
+	            risc_buff = ' '
+                 ENDIF
+ 1620	      CONTINUE
+ 1630      CONTINUE
+        ENDIF
+ 3160   FORMAT (T4,A,T16,A)
+	IF ( limited_show ) RETURN
+
+* SHOW SYMBOLS sym1 sym2 ...
+*           or SHOW SYMBOL/ALL
+ 1700	slash_all = slash_all .OR. num_args .EQ. 0
+* SPECIAL SYMBOLS
+	i1=0
+ 1702   i1 = i1 + 1
+        CALL SPECIAL_SYMBOL(i1, argsym,show_str,len) ! get next symbol namees
+	len0 = TM_LENSTR1(argsym)
+        IF(argsym .NE. ' ')THEN
+	   IF ( num_args .GE. 1 ) THEN
+* ... check the names specified by template matching 
+	      DO 1703 i = 1, num_items
+	         n = STR_UPCASE(arg,
+     .			cmnd_buff(item_start(i):item_end(i)))
+	         IF ( MATCH_TEMPLATE(argsym(:len0),arg) ) GOTO 1705
+ 1703         CONTINUE
+	      GOTO 1702			! no match
+	   ENDIF
+* ... display the symbol definition
+ 1705      CALL SPECIAL_SYMBOL(0, argsym,show_str,len) ! get the sym value
+           CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			argsym(:len0)//' = "'//show_str(:len)//'"', 0)
+           GOTO 1702
+	ENDIF
+
+* PLOT+ SYMBOLS
+ 1709   i1=0
+ 1710   CALL LSTSYM(argsym,show_str,len,i1,i2)	! get next symbol
+	len0 = TM_LENSTR1(argsym)
+        IF(i2.EQ.0)THEN
+	   IF ( num_args .GE. 1 ) THEN
+* ... check the names specified by template matching 
+	      DO 1720 i = 1, num_items
+	         n = STR_UPCASE(arg,
+     .			cmnd_buff(item_start(i):item_end(i)))
+	         IF ( MATCH_TEMPLATE(argsym(:len0),arg) ) GOTO 1750
+ 1720	      CONTINUE
+	      GOTO 1710			! no match
+	   ENDIF
+* ... display the symbol definition
+* *kob* 10/97 added check for len = 0
+ 1750	   IF ( len .GT. 0 ) THEN
+	       CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			argsym(:len0)//' = "'//show_str(:len)//'"', 0)
+	   ELSE 
+               CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			argsym(:len0)//' = ""', 0)
+	   ENDIF
+           GOTO 1710
+	ENDIF
+
+* successful completion
+ 	RETURN
+
+* SHOW ATTRIBUTE
+ 1800   CONTINUE
+
+* 
+* ... SHOW ATT varname.att ... various cases of how to show:
+*       SHOW ATT/ALL varname    - show all attributes for var in current dset
+*       SHOW ATT/ALL varname[D=n]
+*	SHOW ATT varname.attrib	- show attrib on variable in current dset
+*	SHOW ATT name[D=n]	- show attrib on variable from named data set
+*	SHOW ATT/D=n varname.attrib - show attrib on variable from named data set
+*	SHOW ATT/OUTPUT also list the output flag for the attribute
+
+        sho_out = qual_given( slash_attr_output )  .GT. 0
+
+        dset = cx_data_set(cx_last)
+        dset_last = pdset_irrelevant
+
+* ... get dset number if present:  SHOW ATT/D=dset ...
+	iqual = qual_given( slash_attr_dset ) 
+        IF ( iqual .GT. 0 ) THEN
+	   CALL EQUAL_STRING( cmnd_buff(qual_start(iqual):qual_end(iqual)),
+     .			      show_str, status )  ! show_str is just a buffer
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( show_str .NE. ' ' ) THEN
+	      dset = FIND_DSET_NUMBER( show_str )
+	      IF ( dset .EQ. unspecified_int4) THEN
+	         CALL WARN('Unknown data set: '
+     .		 //show_str(:TM_LENSTR1(show_str)))
+	         RETURN
+	      ENDIF
+	   ENDIF
+
+        ELSE  ! get dataset from context or from [d=]
+           show_str = cmnd_buff(item_start(1):item_end(1))
+
+           CALL GET_NEW_CX( cx_last, cx_cmnd, .TRUE., status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+           coordvar = .FALSE.
+           IF (show_str(1:1) .EQ. '(') THEN
+              dset = cx_data_set(cx_cmnd)   ! initial value to try; will return dset
+              CALL ISIT_COORD_VAR ( show_str, dset, 
+     .              varname, coordvar, status )
+
+              IF ( status .NE. ferr_ok ) THEN 
+                 dset = -2  ! a user-defined axis (coordinate variable)
+                 CALL ISIT_COORD_VAR ( show_str, dset, 
+     .              varname, coordvar, status )
+                    IF ( status .NE. ferr_ok ) THEN
+                    dset = cx_data_set(cx_cmnd)
+                    GOTO 5920
+                 ENDIF
+              ENDIF
+
+           ELSE
+
+* Get the dataset if given as [d=]
+
+	      IF ( INDEX(show_str,'[') .GT. 0 ) THEN
+                 dset = pdset_irrelevant	! default (not used ...)
+                 CALL PARSE_NAM_DSET(show_str, cx_last, dset, cat, var,
+     .                 mods_cx, status)
+              ELSE
+                 cx = is_cx( 1 )
+                 IF (cx .EQ. 0 .OR. cx .EQ. unspecified_int4)
+     .                cx = cx_cmnd
+                dset = cx_data_set(cx)
+              ENDIF
+	   ENDIF
+
+* See if the variable is a user-defined variable.
+
+           varname = show_str
+           dot = INDEX(show_str,'.')
+	   brkt = INDEX(show_str,'[')
+	   IF ( brkt .GT. 0 ) varname = show_str(1:brkt-1)
+           IF (dot .GT. 0) varname = show_str(1:dot-1)
+           CALL FIND_VAR_NAME(dset, varname, cat, var)
+           IF (  var .NE. munknown_var_name .AND.
+     .           cat .EQ. cat_user_var) dset = -1
+
+* Or use command context to get data set
+
+           IF (dset .EQ. pdset_irrelevant .OR. 
+     .        dset .EQ. unspecified_int4) dset = cx_data_set(cx_cmnd) 
+
+	ENDIF
+
+	IF ( num_args .EQ. 0  ) GOTO 5060
+
+* Is it show att dataset-name or dataset-number?
+
+        sh_att_dset = var .EQ. munknown_var_name
+	IF (coordvar) sh_att_dset = .FALSE.       ! var not set for (coordvar) syntax
+	IF (dot.GT.0) sh_att_dset = .FALSE.       ! it is show att varname.attname
+                                                  ! it is show att . for global atts.
+	IF ((dot.GT.0) .AND. TM_LENSTR(show_str) .EQ. 1) THEN
+	   sh_att_dset = .FALSE. 
+	   slash_all = .TRUE.
+	ENDIF
+
+	IF (sh_att_dset) THEN                    ! Do as for SHOW DAT/ATT
+	   qual_given( slash_attr  ) = 1
+	   CALL SHOW_DATA (dset, status)
+
+        ELSE  ! It is show att for variable
+
+        IF ( slash_all .OR. dot.EQ.0) THEN  ! SHOW ATT/ALL varname (/ALL optional)
+
+           DO 1820 i = 1, num_items
+
+	      varname = cmnd_buff( item_start(i):item_end(i) )
+              IF(TM_HAS_STRING(varname, '.') ) THEN
+                 varid = 0
+                 CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+              ENDIF
+
+              IF (dset .EQ. pdset_irrelevant .OR. 
+     .            dset .EQ. unspecified_int4) GO TO 5072
+
+              CALL CD_GET_VAR_ID (dset, varname, varid, status)
+              IF (status .NE. ferr_ok .OR. dset .EQ. unspecified_int4 .OR.
+     .           (varid .EQ. 0 .AND.
+     .           .NOT.TM_HAS_STRING(varname, '.')) ) GOTO 5200
+
+* Header line
+
+              IF (.NOT. sxml) THEN
+                 IF (dset .NE. dset_last ) THEN
+                    IF (dset .EQ. -1) THEN
+                       risc_buff = 
+     .                   '     attributes for user-defined variables'
+                    ELSE IF (dset .EQ. -2) THEN
+                       risc_buff = 
+     .                   '     attributes for coordinate axis'
+                    ELSE
+                       llen = TM_LENSTR1(ds_des_name(dset))
+                       WRITE ( risc_buff, 4800 ) ds_des_name(dset)(:llen)
+                    ENDIF
+                    CALL SPLIT_LIST(pttmode_explct, show_lun, 
+     .                     risc_buff, 0) 
+                 ENDIF
+                 dset_last = dset
+              ENDIF
+
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+
+              DO 1810 iatt = 1, nvatts
+
+                 CALL CD_GET_VAR_ATT_INFO (dset, varid, iatt, aname, 
+     .               attype, attlen, attoutflag, status )
+
+                 IF (status .NE. ferr_ok) GOTO 1810
+
+                 maxlen = size_rbuff
+                 IF (attype .NE. NCCHAR) maxlen = 10
+                 got_it = NC_GET_ATTRIB ( dset, varid, aname,
+     .                                   .TRUE., varname, maxlen,
+     .                                   attlen, attoutflag, risc_buff, 
+     .                                   attvals )
+
+                 IF (got_it) THEN
+                    IF (.NOT. sxml) 
+     .                 CALL SHOW_ATTRIBUTE (varname, coordvar, aname, 
+     .                              attype, attlen, risc_buff, attvals, 
+     .                              attoutflag, sho_out)  
+
+                 ENDIF
+1810          CONTINUE
+
+1820       CONTINUE 
+
+        ELSE  ! SHOW ATT varname.attname
+
+	   DO 1830 i = 1, num_items
+	      IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+
+	      varatt = cmnd_buff( item_start(i):item_end(i) )
+
+              IF (INDEX(varatt,'.') .EQ. 0) GOTO 5070
+
+              IF ( INDEX(varatt,'[') .GT. 0 ) THEN
+
+* ... bug (minor): square brackets **may** not contain D=dset information
+* 	a work-around: pass a context with data set info (instead of cx_last)
+
+                 dset = pdset_irrelevant	! default (not used ...)
+                 CALL PARSE_NAM_DSET(varatt, cx_last, dset,
+     .				     category, ivar, mods_cx, status)   
+
+                 IF (dset .EQ. pdset_irrelevant .OR. 
+     .               dset .EQ. unspecified_int4) THEN
+                       varname = varatt
+                       GO TO 5072
+                  ENDIF
+              ENDIF
+
+* do_err: issue error message if attrib does not exist on varname.attname
+              do_err = .TRUE.  
+              CALL BREAK_VARATTNAME ( varatt, dset, varname, 
+     .                  attname, varid, do_err, status )
+
+              IF(TM_HAS_STRING(varname, '.') ) THEN
+                 varid = 0
+                 CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+              ENDIF
+
+
+              IF (status .NE. ferr_ok) GOTO 5000
+
+* get var name in the same case as in the file, and get coordvar,
+* flag for whether the var is a coordinate axis
+
+              CALL CD_GET_VAR_INFO (dset, varid, varname, vtype,
+     .                              nvdims, vdims, nvatts, coordvar, 
+     .                              all_outflag, status)
+
+* Write header line
+              IF (.NOT. sxml) THEN
+                 IF (dset .NE. dset_last ) THEN
+                    llen = TM_LENSTR1(ds_des_name(dset))
+                    WRITE (risc_buff, 4800) ds_des_name(dset)(:llen)
+                    CALL SPLIT_LIST(pttmode_explct, show_lun, 
+     .                     risc_buff, 0) 
+                 ENDIF
+                 dset_last = dset
+              ENDIF
+
+              CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid,
+     .               status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid,
+     .               attid, aname, attype, attlen, attoutflag, status )
+
+              maxlen = size_rbuff
+              IF (attype .NE. NCCHAR) maxlen = 10
+              got_it = NC_GET_ATTRIB ( dset, varid, aname,
+     .                        .TRUE., varname, maxlen,
+     .                        attlen, attoutflag, risc_buff, 
+     .                        attvals )
+
+              IF (varid .EQ. 0) THEN
+              loc = INDEX(varatt, ".") - 1
+                 varname = varatt(1:loc)
+              ENDIF
+
+              IF (got_it) CALL SHOW_ATTRIBUTE (varname, coordvar, aname,
+     .                       attype, attlen, risc_buff, attvals, 
+     .                       attoutflag, sho_out)
+
+1830	   CONTINUE 
+        ENDIF
+
+        ENDIF  ! sh att dataset vs sho att variable
+
+4800	FORMAT (T6,'attributes for dataset: ', A)
+
+* successful completion
+ 	RETURN
+
+* SHOW NCCACHE
+ 1900   CALL CD_GET_CHUNK_CACHE (cache_size, cache_nelems, 
+     .    cache_preemption, status)
+        cache_mb = cache_size/1.e6
+	name = TM_FMT(cache_mb, 6, 12, dlen)
+        show_str = 'Current NCDF Chunk Cache size '//name(1:dlen)
+	len = TM_LENSTR1(show_str)
+
+        cache_n = cache_nelems
+	name = TM_FMT(cache_n, 6, 12, dlen)
+
+	show_str = show_str(1:len)//' MB, n_elems = '//name(1:dlen)
+	len = TM_LENSTR1(show_str)
+
+        cache_p = cache_preemption
+	name = TM_FMT(cache_p, 6, 12, dlen)
+
+	show_str = show_str(1:len)//', preemption = '//name(1:dlen)
+	len = TM_LENSTR1(show_str)
+
+	CALL SPLIT_LIST(pttmode_explct, ttout_lun,
+     .			show_str(1:len), 0)
+	IF ( limited_show ) RETURN
+
+* SHOW GIFFILE
+ 2000   CALL GET_METAFILE_NAME(outstring)
+        len = TM_LENSTR1(outstring)
+        IF ( len .GT. 0 ) THEN
+           show_str = 'Current default filename: ' //outstring(1:len)
+        ELSE
+           show_str = 'No current default filename'
+        ENDIF
+        len = TM_LENSTR1(show_str)
+        CALL SPLIT_LIST(pttmode_explct, ttout_lun, show_str(1:len), 0)
+        RETURN
+
+* SHOW FUNCTIONS
+ 2100   CONTINUE
+* /BRIEF or full description?
+ 	sbrief  = qual_given( slash_brief ) .GT. 0 
+ 	sdetail = qual_given( slash_show_func_detail ) .GT. 0 
+
+* show a whole list or named functions, only?
+	IF ( num_args .GT. 0 ) THEN
+
+* ... one or more functions were explicitly named
+	   DO 2110 i = 1, num_items
+           i1 = STR_UPCASE(arg,cmnd_buff(item_start(i):item_end(i)))
+	      len0 = item_end(i) - item_start(i) + 1
+* ... identify the named function
+* ... first try internal, non-grid-changing functions ...
+	      DO 2104 i2 = 1, num_functions
+	         IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+	         IF (MATCH_TEMPLATE(alg_fcn(i2),arg(:len0)))
+     .           CALL SHOW_1_FUNCTION(show_lun, .FALSE.,
+     .                                sbrief, sdetail, i2)
+ 2104         CONTINUE
+* ... second try internal, grid-changing functions
+	      DO 2106 i2 = 1, gfcn_num_internal
+	         IF ( interrupted ) CALL ERRMSG
+     .			( ferr_interrupt, status, ' ', *5000 )
+              IF ( MATCH_TEMPLATE(gfcn_name(i2),arg(:len0)) ) CALL
+     .                SHOW_1_FUNCTION(show_lun, .TRUE.,
+     .                                sbrief, sdetail, i2)
+ 2106         CONTINUE
+* ... third try external functions
+              IF (qual_given(slash_internal) .EQ. 0) THEN
+ 	         DO 2108 i2 = gfcn_num_internal+1, gfcn_num_internal+
+     .                efcn_scan(gfcn_num_internal)
+	            IF ( interrupted ) CALL ERRMSG
+     .			   ( ferr_interrupt, status, ' ', *5000 )
+
+                 CALL EFCN_GET_NAME (i2, fhol)
+                 CALL TM_CTOF_STRNG( fhol, efname, slen )
+                 i1 = STR_UPCASE(upname, efname)
+
+                 IF ( MATCH_TEMPLATE(upname,arg(:len0) )) CALL
+     .               SHOW_1_FUNCTION(show_lun, .TRUE.,
+     .                               sbrief, sdetail, i2)
+
+c                 CALL TM_FTOC_STRNG( arg(:len0), fhol, slen )
+c                 IF ( EFCN_MATCH_TEMPLATE(i2,fhol) .EQ. 1) CALL
+c     .               SHOW_1_FUNCTION(show_lun, .TRUE.,
+c     .                               sbrief, sdetail, i2)
+
+ 2108            CONTINUE  
+              ENDIF
+ 2110      CONTINUE
+
+
+* show lists of functions
+	ELSE
+
+* ... show all the internal functions (omit for SHOW FUNC/EXTERN)
+	   IF ( qual_given(slash_external) .EQ. 0 ) THEN
+* ... internal non-grid-changing functions
+	      CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .			'Functions internal to Ferret:', 0)
+	      DO 2120 i = 1, num_functions
+	         IF ( alg_fcn(i) .NE. unspecified_name4 ) CALL
+     .                SHOW_1_FUNCTION(show_lun, .FALSE.,
+     .                  sbrief, sdetail, i)
+ 2120         CONTINUE
+* ... internal grid-changing functions
+	      DO 2130 i = 1, gfcn_num_internal
+	         CALL SHOW_1_FUNCTION(show_lun, .TRUE.,
+     .                  sbrief, sdetail, i)
+ 2130         CONTINUE
+	   ENDIF
+
+* ... show all the external functions
+* 3/24/99 *kob* clean up duty - change below to blank space rather than
+*               null string
+	   IF ( qual_given(slash_internal) .EQ. 0 ) THEN
+              CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .             ' ', 0)       ! Print a blank line
+              CALL SPLIT_LIST(pttmode_explct, show_lun,
+     .           'Externally defined functions available to Ferret:',
+     .             0)
+	      DO 2140 i = gfcn_num_internal+1, gfcn_num_internal+
+     .             efcn_scan(gfcn_num_internal)
+	         CALL SHOW_1_FUNCTION(show_lun, .TRUE.,
+     .                  sbrief, sdetail, i)
+ 2140	      CONTINUE
+	   ENDIF
+
+	ENDIF
+	IF ( limited_show ) RETURN
+
+* SHOW QUERIES
+ 2200   CONTINUE
+	DO 2210 i = 1, max_queries
+	   IF ( queries(i) .NE. unspecified_name4 )CALL SPLIT_LIST
+     .			(pttmode_explct, show_lun, queries(i), 0)
+ 2210	CONTINUE
+	IF ( limited_show ) RETURN
+
+
+* error exit
+ 5050   CALL RELEASE_WORK_SPC
+ 5000	RETURN
+ 5071	CALL ERRMSG( ferr_unknown_data_set, status,
+     .			name(:TM_LENSTR1(name)), *5000 )
+ 5072	CALL ERRMSG( ferr_invalid_command, status,
+     .         'dataset not found for varname.attname '//
+     .          varname(:TM_LENSTR1(varname)), *5000 )
+ 5100   CALL ERRMSG( ferr_unknown_variable, status, arg, *5000)
+ 5150   CALL ERRMSG( ferr_unknown_qualifier, status,
+     .          'SHOW VAR/TREE= may take arguments ALL, FILE, and USER (default)',
+     .          *5000)
+ 5200	CALL ERRMSG( ferr_unknown_variable, status, varname, *5000 )
+ 5300   CALL ERRMSG( ferr_invalid_command, status, 'grid for '//
+     .              cmnd_buff(item_start(ivar):item_end(ivar))
+     .              //' is not available.'//pCR//
+     .              '(LOAD this variable and try SHOW GRID again.)',
+     .              *5000  )
+ 5060	CALL ERRMSG( ferr_invalid_command, status,
+     .			'SHOW ATTRIBUTE given with no argument '
+     .			, *5000 )
+ 5070	CALL ERRMSG( ferr_invalid_command, status,
+     .	    'SHOW ATTRIBUTE given with no attribute: '//
+     .	    'Use SHOW ATT/ALL varname, or SHOW ATT varname.attname '
+     .			, *5000 )
+ 5080	CALL ERRMSG( ferr_prog_limit, status,
+     .  'Cannot append to file w/ name longer than 256 characters: '//pCR//
+     .  'Limitation of Fortran INQUIRE and OPEN calls '	
+     .			, *5000 )
+ 5920	llen = TM_LENSTR(show_str)
+	CALL ERRMSG( ferr_invalid_command, status,
+     .   'variable, axis, or attribute does not exist'//
+     .    show_str(:llen), *5000 )
+
+
+ 5930	CALL ERRMSG( ferr_invalid_command, status,
+     .		'SHOW/FILE= what name?', *5000 )
+
+ 5090	CALL ERRMSG( ferr_prog_limit, status,
+     .  'Cannot write to file w/ name longer than 256 characters: '//pCR//
+     .  'Limitation of Fortran INQUIRE and OPEN calls '	
+     .			, *5000 )
+
+	END
diff --git a/fer/xeq/xeq_spawn.F b/fer/xeq/xeq_spawn.F
new file mode 100644
index 0000000..7a5c39d
--- /dev/null
+++ b/fer/xeq/xeq_spawn.F
@@ -0,0 +1,87 @@
+	SUBROUTINE XEQ_SPAWN
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* SPAWN a subprocess to VMS DCL level
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 8/2/88
+* v200: Unix/RISC port - 3/12/91 - coach for "^z" on Unix
+* V230 6/92 - allow "system" calls for unix
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+* 10.28.98 *js* Disable command if secure mode set
+* V500:  1/99 - correct the handing of qutes as in SPAWN "date"
+*		with call to ALL_1_ARG
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+
+	LOGICAL IS_SECURE
+
+	CALl ALL_1_ARG
+	IF ( num_args .GT. 0 ) THEN
+	   if (IS_SECURE()) then
+	      call SPLIT_LIST(pttmode_help, err_lun,
+     1	        'This command is not allowed.', 0)
+	   else
+*             Flush Fortran stdout and stderr so that any output from
+*             the system command will appear in the appropriate place.
+              CALL FLUSH(ttout_lun)
+              CALL FLUSH(err_lun)
+	      call system( cmnd_buff(arg_start(1):arg_end(1)) )
+	   end if
+	ELSE
+* user can get choice of shells with "SPAWN csh", or whatever.
+	   CALL SPLIT_LIST(pttmode_help, err_lun,
+     .    	' Use "^Z" for shell prompt.  Type "fg" to return.', 0)
+	   CALL SPLIT_LIST(pttmode_help, err_lun,
+     .    	' Or type "SPAWN csh" (or shell of your choice) '
+     .    	//'and "exit" to return', 0)
+	ENDIF
+
+	RETURN
+
+	END
+
diff --git a/fer/xeq/xeq_stat.F b/fer/xeq/xeq_stat.F
new file mode 100644
index 0000000..e7f8dc3
--- /dev/null
+++ b/fer/xeq/xeq_stat.F
@@ -0,0 +1,88 @@
+	SUBROUTINE XEQ_STAT( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the STAT command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/25/88
+* V200:  5/19/89 - 4D symmetrical
+*	10/16/89 - set up adjustable array limits with NON_ARRAY_SUBSC
+* V312: 5/94 - array "memory" as a calling argument
+*       10/26/94 - changed "STAT" to "VAR_STAT" for IBM/AIX
+* V420	 2/7/96  - added STAT/BRIEF
+* V530: *sh* 9/00 - added initial data type support in get_cmnd_data 
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'slash.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	LOGICAL	full
+	INTEGER	mv, cx, istat, status
+	
+* decode the qualifiers
+	full = qual_given( slash_stat_brief ) .EQ. 0
+
+* get the requested data somehow
+	CALL GET_CMND_DATA ( memory, cx_last, ptype_native, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* compute and display the results
+  	DO 400 istat = 1, num_uvars_in_cmnd
+	   mv = is_mr( istat )
+	   cx = is_cx( istat )
+	   CALL NON_ARRAY_SUBSC( mv, 1 )
+	   CALL VAR_STAT( memory(1, mr_blk1(mv)), mv, cx,
+     .			  ttout_lun, full, status )
+           IF (status .NE. ferr_ok) GOTO 5000
+ 400	CONTINUE
+
+	RETURN
+
+* error exit(s)
+ 5000	RETURN
+	END
diff --git a/fer/xeq/xeq_user_command.F b/fer/xeq/xeq_user_command.F
new file mode 100644
index 0000000..f48f68a
--- /dev/null
+++ b/fer/xeq/xeq_user_command.F
@@ -0,0 +1,103 @@
+	SUBROUTINE XEQ_USER_COMMAND( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the USER_COMMAND command
+* this is a template routine that can be modified to include any code of
+* a user's choice, thereby customizing the FERRET program
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  1/21/90
+* V301:  11/93 - bug fix:  was passing element 2 of var 2 element 3 of 3, etc.
+*			: command string decoded by user routines
+*         1/94 - need to pass at least 5 arguments for COMMAND=SAMPLE
+* V312: 5/94 - array "memory" as a calling argument
+*	(and passed to USER_SUB - fixed 6/1/94)
+* V530: *sh* 9/00 - added initial data type support in get_cmnd_data 
+
+#ifdef unix
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+#else
+	INCLUDE	'FERRET_CMN:FERRET.PARM'
+	INCLUDE 'FERRET_CMN:ERRMSG.PARM'
+	INCLUDE 'FERRET_CMN:XVARIABLES.CMN'
+	INCLUDE 'FERRET_CMN:XPROG_STATE.CMN'
+#endif
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+	INTEGER	ivar, mr_list(6), cx_list(6), status
+	
+* get the requested data somehow - possibly several grids of data
+	CALL GET_CMND_DATA ( memory, cx_last, ptype_float, status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* set up dummies if fewer than 4 components
+	DO 100 ivar = 1, num_uvars_in_cmnd
+	  mr_list(ivar) = is_mr(ivar)
+	  cx_list(ivar) = is_cx(ivar)
+ 100	CONTINUE
+	DO 110 ivar = num_uvars_in_cmnd+1, 6    ! 4->6 2/25 bug found on SUN
+	  mr_list(ivar) = dummy_mr
+	  cx_list(ivar) = cx_buff
+ 110	CONTINUE
+
+* compute and display the results
+	CALL NON_ARRAY_SUBSC( mr_list, num_uvars_in_cmnd )
+
+* pass control to the user's routine
+	CALL USER_SUB(    memory,
+     .			  memory(1, mr_blk1(mr_list(1))), 
+     .			  memory(1, mr_blk1(mr_list(2))), 
+     .			  memory(1, mr_blk1(mr_list(3))), 
+     .			  memory(1, mr_blk1(mr_list(4))), 
+     .			  memory(1, mr_blk1(mr_list(5))), 
+     .			  memory(1, mr_blk1(mr_list(6))), 
+     .			  mr_list, cx_list, num_uvars_in_cmnd,
+     .			  ttout_lun, status )
+	RETURN
+
+* error exit(s)
+ 5000	RETURN
+	END
diff --git a/fer/xeq/xeq_vector.F b/fer/xeq/xeq_vector.F
new file mode 100644
index 0000000..056b7c1
--- /dev/null
+++ b/fer/xeq/xeq_vector.F
@@ -0,0 +1,579 @@
+	SUBROUTINE XEQ_VECTOR( memory )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the VECTOR command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer uvnder VMS operating system
+*
+* revision 0.0 - 1/7/87
+* revision 0.1 - 2/25/87 - changes for INTERPRETATION STACK
+* revision 0.2 - 6/24/87 - provisions to permit 90 degree data-plane transpose
+*			   and to separate DISP_INIT from DISP_SET_UP
+* revision 0.3 - 7/8/87  - DISP_LABELS separated from DISP_SET_UP
+* revision 0.4 - 7/28/87 - added CALL DISP_PREP
+* revision 0.5 - 8/11/87 - VECKEY relocates according to title position
+* revision 0.6 - 8/26/87 - dont transpose on XT plots
+* revision 0.7 - 3/2/88  - check for valid data range before loading
+* revision 0.8 - 4/14/88 - added /NOLABELS and range check --> DISP_SET_UP
+* revision 0.9 - 4/28/88 - added only_x to DISP_SET_UP
+* revision 1.0 - 6/22/88 - compute axis aspect correction using PPLUS AXIS.INC
+*			   axis lengths
+* revision 1.1 - 8/1/88  - corrected bug: x_skip said "Y" and visa versa
+*			   added MODE WAIT
+* revision 1.2 - 9/21/88 - do_labels --> no_labels: /NOLABEL processing chged
+* V200:  5/19/89 - 4D symmetrical
+*	  1/4/89 - using keys for labelling
+*	 3/13/90 - check status from DISP_PREP
+* V301: 12/8/93  - added VECTOR/XSKIP/YSKIP
+* 	  1/7/94 - bug fix: (see DISP_DATA_SET_UP) must unprotect plot data
+*	 2/10/94 - added /PEN=
+* V312: 5/94 - array "memory" as a calling argument
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*	 1/20/94 - changes to SAVE_FRAME call reflecting C-based procedures
+* V450:  5/29/97 - added /NOAXES qualifier (eventually for curvilinear plots)
+* V510 *sh* 12/99 - allow plots of all-missing data
+*		  - replace /PEN qualifier with /COLOR, supporting named colors
+*      5/00 *sh* - restored the /PEN qualifier (with "denigrated" remark
+*      10/00 *AM* - added VECTOR/FLOWLINE (alias FLOWLINE)
+* V530 *sh* 1/01 - change "denigrated" to "deprecated"
+*      *acm*6/01 - add arguments is_logh, is_logv to DISP_SET_UP call.
+*                  (only used for PLOT command)
+*      *acm* 7/01 - Add VECTOR/AXES=TOP,BOT,LEFT,RIGHT
+*      *acm* 7/01 - Add /AXES=TOP,BOT,LEFT,RIGHT
+*		    & call ax_on_off to implement /NOAXES.
+*      *acm* 10/01  remove VMS includes
+* V540 *acm*  2/02  restore persistence of PPL AXSET settings
+* V541 *acm*  3/02  Make PPL AXSET settings persist, but not settings
+*                   done with qualifiers /AXES= or /NOAXES
+*      *acm*  4/02  If this is an overlay, and there is no valid data, 
+*                   do not put "No Valid Data" across the middle of the plot.
+*                   Instead (in disp_set_up) add this information to the
+*                   variable name in the key below the plot.
+*      *acm*  5/02  Add /NOKEY option.  Also, if /NOLAB specifed, do not
+*                   plot a key.
+* V550: *acm*11/02 add argument is_shade to DISP_SET_UP call (not used by vector)
+* V552: *acm* 5/03 add argument use_cell to DISP_SET_UP call (not used by vector)
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* V606  8/07 *acm* Send informational and error messages that are returned from 
+*                  commands via SPLIT_LIST to std error rather than std out.
+* V6.11 4/08 *acm* Fixes for bug 1571; call to PPL_AXES_RESTORE moved to DISP_INIT
+* V614  *acm* 10/08 - add new MODE NODATA_LAB to control the NO VALID DATA label.
+*                  Put it on plots only when this mode is set.
+* V6.2  *acm* 11/08Fix bug 1609: If the plot is an overlay then do not process /AXES=
+*                  or /NOAXES. Axes are never drawn for overlays anyway.
+* V6.2  *acm& 2/09 Fix choice of color settings with /PEN and /THICK when we have 
+*                  increased the num of colors with MODE linecolors
+* V6.63 *acm* 7/10 Save symbols PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the 
+*                  Vector XSKIP and YSKIP values.
+* V6.63 *acm* 7/10 Save symbols PPL_VEC_XSKIP, PPL_VEC_YSKIP containing the 
+*                  Vector XSKIP and YSKIP values. (PPL_VECLEN is saved in vecfld)
+* V6.63 *acm* 7/10 Add VECTOR/KEY to force key even if /NOLAB
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis
+* PyFr  *kms*  6/13 EQUAL_COLOR now returns a color ID, and EQUAL_THICK 
+*                   returns a pen ID from a color ID and a thickness.
+* PyFr  *kms*  6/13 Added /OPACITY
+* PyFr  *kms*  7/13 Scale default lettering sizes by textscale
+
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include	'plot_setup.parm'
+	include	'slash.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+	include 'xpplus.cmn'
+        include 'axis_inc.decl'       ! with axis lengths	
+        include 'AXIS.INC'       ! with axis lengths	
+	include 'xrisc.cmn'          ! 12/94 SPLIT_LIST buffer
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'    ! wsid
+
+
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL		overlay, transpz, no_labels, no_x_rng,
+     .			set_up, noaxes, axes, no_data, flows, 
+     .			is_logh, is_logv, no_key, yes_key,
+     .			is_shade, use_cell, inc_grid
+	INTEGER		TM_LENSTR1, status, cx, 
+     .			loc, icolor, ipen,
+     .			dim1, dim2, asp,
+     .			ax1_blks, ax1_start,
+     .			ax2_blks, ax2_start,
+     .			x_skip, y_skip,
+     .                  density, slen, i, nparm, num_it, 
+     .			s1, s2, it_start(4), it_end(4), iax(4),
+     .                  loch, locv, ier, ist
+        INTEGER   STR_UPCASE, i1
+	REAL		only_x, aspect, vbuf, xloc, yloc
+        REAL*4          thickness, opacity
+	CHARACTER	buff*25
+
+
+* internal parameter declarations:
+	LOGICAL		norm_dims_only, vector
+	PARAMETER     ( norm_dims_only  = .FALSE.,
+     .			vector		= .TRUE.)
+	INTEGER ncolors
+
+* set up the graphics environment and get the data
+	CALL START_PPLUS(.FALSE.)
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* make sure the number of expressions given is even ( x and y components )
+	IF ( MOD( num_uvars_in_cmnd, 2 ) .NE. 0 ) CALL ERRMSG
+     .		(ferr_invalid_command,status,
+     .		 'VECTOR requires paired components',*5000)
+
+* initialize
+	overlay   = qual_given( slash_vect_over_plot ).GT.0 .AND. twodee_on
+	no_labels = qual_given( slash_vect_nolabels  ).GT.0
+	transpz   = qual_given( slash_vect_transpz   ).GT.0
+	set_up	  = qual_given( slash_shad_set_up    ).GT.0
+	noaxes    = qual_given( slash_noaxes         ).GT.0
+	axes      = qual_given( slash_vect_axes      ).GT.0
+        IF (overlay) THEN
+	   noaxes = .FALSE.
+	   axes = .FALSE.
+	ENDIF
+	flows     = qual_given( slash_vect_flowline  ).GT.0
+	is_logh   = .FALSE.  ! Not valid quals
+	is_logv   = .FALSE.  ! for vector
+
+	no_key = .FALSE.
+        IF (no_labels) no_key = .TRUE.
+
+	IF (qual_given( slash_vect_nokey ).GT.0)  no_key    = .TRUE.
+
+	! for vector, key even if /NOLAB
+	IF (qual_given( slash_vect_key) .GT.0) THEN
+	   no_key    = .FALSE.
+	   yes_key   = .TRUE.  ! to override settings where no key would be drawn.
+	ENDIF
+
+        is_shade  = .FALSE.
+        use_cell  = .FALSE.
+        ncolors = mode_arg(pmode_linecolors,1)
+
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,is_cx,num_uvars_in_cmnd)
+* ... default orientation for YT and ZT VECTORs has time on horizontal
+	IF ( (plot_axis(2).EQ.t_dim .OR. plot_axis(2).EQ.f_dim) .AND. 
+     .		plot_axis(1).NE.x_dim ) transpz = .NOT.transpz
+
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* possibly transpose the axes
+	IF ( transpz ) THEN
+	   dim2 = plot_axis(1)
+	   dim1 = plot_axis(2)
+	ELSE
+	   dim1	= plot_axis(1)
+	   dim2	= plot_axis(2)
+	ENDIF
+
+* scale-ratio correction requested ?
+	IF ( qual_given( slash_vect_aspect ) .GT. 0 ) THEN
+	   asp = qual_given( slash_vect_aspect )
+	   CALL EQUAL_VAL( cmnd_buff(qual_start(asp):qual_end(asp)),
+     .			   aspect, status )
+	   IF ( status .NE. ferr_ok ) RETURN
+	   IF ( aspect .EQ. unspecified_val4 ) aspect = ylen/xlen
+	   IF ( aspect .LE. 0.0 ) CALL ERRMSG( ferr_out_of_range,
+     .		status, cmnd_buff(qual_start(asp):qual_end(asp)), *5000 )
+	ELSE
+	   aspect = 0.0
+	ENDIF
+
+* user-specified pen color ?  (2/94)
+        thickness = 1.0
+	loc = MAX( qual_given(slash_pen), qual_given(slash_color))
+	IF ( loc .GT. 0 ) THEN
+	   IF (.NOT.denig_pen_msg_done .AND. qual_given(slash_pen).GT.0)
+     .									THEN
+	      CALL WARN( '/PEN is deprecated. Use /COLOR.')
+	      denig_pen_msg_done = .TRUE.
+	   ENDIF
+*          get the color ID
+           CALL EQUAL_COLOR(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                      icolor, thickness, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ELSE IF ( qual_given( slash_vect_thick ) .GT. 0 ) THEN
+           icolor = 1  ! /THICK alone means "BLACK" if color not specified
+        ELSE
+           icolor = -1  ! auto-select in DISP_SET_UP
+	ENDIF
+
+* ... CONTOUR/OPACITY=n
+        loc = qual_given( slash_vect_opacity )
+        IF ( loc .GT. 0 ) THEN
+           CALL EQUAL_VAL(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                    vbuf, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+           IF ( (vbuf .LT. 0.0) .OR. (vbuf .GT. 100.0) ) GOTO 5500
+           opacity = vbuf / 100.0
+           IF ( icolor .GE. 0 )
+     .        CALL DUP_COLOR_SET_OPACITY(wsid, icolor, opacity)
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ELSE
+*          overriding opacity not specififed
+           opacity = -1.0
+           CALL SET_OVERRIDE_OPACITY(opacity)
+        ENDIF
+
+* ... VECTOR/THICKNESS=n
+	loc = qual_given( slash_vect_thick )
+	IF ( loc .GT. 0  ) THEN
+*          From above, icolor will be specified
+*          convert the color ID into a pen ID using the specified thickness
+           CALL EQUAL_THICK(cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                      thickness, icolor, ipen, status)
+           IF ( status .NE. ferr_ok ) GOTO 5000
+        ELSEIF ( icolor .GE. 0 ) THEN
+*          convert the color ID into a pen ID using the default thickness
+           CALL EQUAL_THICK(' ', thickness, icolor, ipen, status)
+        ELSE
+*          set ipen to auto-select
+           ipen = icolor
+        ENDIF
+
+* for flowline plots, get the density
+        density = 0
+        IF (flows) THEN 
+	   loc = qual_given( slash_vect_density )
+	   IF ( loc .GT. 0 ) THEN
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   vbuf, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      IF ( vbuf .EQ. unspecified_val4 ) THEN
+	         density = 1.
+	      ELSE
+	         density = ABS(vbuf)
+	      ENDIF
+           ELSE
+              density = 5
+           ENDIF
+        ENDIF
+
+* ... VECTOR/hgrat[=dash or line] default is dash
+*     hgrat line type: 0=tics only, 1=dash 2=line
+
+	loch = qual_given(slash_vect_hgrat)
+
+* ... VECTOR/vgrat[=dash or line] default is dash
+*     vgrat line type: 0=tics only, 1=dash 2=line
+
+	locv = qual_given(slash_vect_vgrat)
+        
+        IF (loch .EQ. 0  .AND. locv .EQ. 0) THEN
+           loch = qual_given(slash_vect_grat)
+           locv = qual_given(slash_vect_grat)
+        ENDIF
+
+        CALL set_graticules(loch, locv, status)
+
+* set up title and load the x component data into PPLUS
+
+	inc_grid = .FALSE.
+	CALL DISP_SET_UP   ( 	memory,
+     . 			 	vector,
+     .				is_shade,
+     .				use_cell,
+     .				aspect,
+     .				overlay,
+     .				transpz,
+     .				no_labels,
+     .				no_x_rng,
+     .				only_x,
+     .                          density,
+     .				is_logh, 
+     .				is_logv,
+     .				is_mr,
+     .				num_uvars_in_cmnd,
+     .				is_cx,
+     .				is_uvar,	
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				ipen,
+     .				inc_grid,
+     .				status )
+
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* is there no valid input data?
+        no_data =  no_x_rng .AND. only_x.EQ.bad_val4
+
+c when it's an overlay, 'No Valid Data' is part of the plot key,
+c done in disp_set_up. If mode_nodata_lab is false then leave this off.
+
+        IF (.NOT. overlay .AND. no_data .AND. mode_nodata_lab) 
+     .                  CALL PUT_LABEL( ppl_movlab, 0.5, 0.5,
+     .                  ppl_centered, dflt_letsize_title*textscale,
+     .                  'No Valid Data',
+     .                  lab_loc_axlen_times, lab_loc_axlen_times )
+
+* increment counter of vector fields on the screen
+	nvect_on = nvect_on + 1
+
+* special set-up required only for the VECTOR command
+        IF (no_data) no_key  = .TRUE.  ! regardless of /KEY or /NOKEY setting
+
+         IF ( .NOT.overlay .AND. .NOT.no_data .AND. .NOT.no_key) THEN
+* ... vector length key below plot title (overlay written as key)
+            xloc = (xlen/2.) - 0.5
+            yloc = -1.*yorg + 0.2
+            WRITE ( ppl_buff, '(2F6.1)' ) xloc, yloc
+            CALL PPLCMD (' ',' ',0,'VECKEY/NOUSER '//ppl_buff, 1, 1 )
+         ENDIF   
+
+	IF ( overlay .AND. yes_key ) THEN  ! force key in the middle under the title.
+* ... vector length key below plot title (overlay written as key)
+           xloc = (xlen/2.) - 0.5
+           yloc = -1.*yorg + 0.2
+	   WRITE ( ppl_buff, '(2F6.1)' ) xloc, yloc
+	   CALL PPLCMD (' ',' ',0,'VECKEY/NOUSER '//ppl_buff, 1, 1 )
+	ENDIF	
+
+	IF (no_key) THEN
+* ... no vector-length key.  
+	   CALL PPLCMD (' ',' ',0,'VECKEY 0', 1, 1 )
+	ENDIF	
+
+* turn off axes? 
+	IF ( noaxes ) THEN 
+           DO 300 i = 1, 4
+              iax(i) = 0
+ 300       ENDDO
+        ENDIF
+
+* turn on (one or more) axes? (7/11/01)
+
+* ... PLOT/AXES=(TOP,BOTTOM,LEFT,RIGHT)
+	IF ( axes ) THEN
+           loc = qual_given( slash_vect_axes )
+	   CALL EQUAL_STR_LC( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .                        buff, status )
+           IF ( status .NE. ferr_ok ) GOTO 5000
+
+	   IF ( buff .NE. ' ' ) THEN
+
+* Get arguments, if any.  Otherwise turn on all axes
+              slen = TM_LENSTR1(buff)
+              s1 = 1
+              s2 = slen
+              IF (buff(1:1) .EQ. '(' )THEN
+                  s1 = 2
+                  s2 = slen-1
+                  IF ( buff(slen:slen) .NE. ')' ) GOTO 5440
+              ENDIF
+              nparm = 4
+              CALL parse_comma_list ( buff, s1, s2, nparm, 
+     .             num_it, it_start, it_end, status)
+
+              IF (status .EQ. ferr_ok .AND. it_start(1) .GT. it_end(1)) THEN	! /AXES=()
+                 DO 400 i = 1, 4
+                    iax(i) = 0
+ 400             ENDDO
+              ELSE IF (status .NE. ferr_ok .OR. num_it .LT. nparm) THEN
+                 GOTO 5440
+              ELSE
+                 DO 500 i = 1, nparm
+                    READ (buff(it_start(i):it_end(i)), *) iax(i)
+                    IF (iax(i) .LT. 0  .OR.  iax(i) .GT. 1) GOTO 5450
+ 500             CONTINUE
+              ENDIF
+           ELSE		! turn on all axes
+	      DO 600 i = 1, 4
+		 iax(i) = 1
+ 600	      CONTINUE
+           ENDIF
+
+       	ENDIF	
+
+*  Turn off or on axes, including time axes.
+        IF (axes .OR. noaxes) CALL ax_on_off (iax)
+
+* done now if /set_up, only
+	IF ( set_up) GOTO 1000
+
+* sub-sample the vectors to make a cleaner plot ?
+* *ACM 10/00*  do not subsample if its a flowline plot
+
+        IF (.NOT. flows) THEN
+	   cx   = is_cx( 1 )
+	   loc = qual_given( slash_vect_xskip )
+	   IF ( loc .GT. 0 ) THEN
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   vbuf, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      IF ( vbuf .EQ. unspecified_val4 ) THEN
+	         x_skip = 1.
+	      ELSE
+	         x_skip = ABS(vbuf)
+	      ENDIF
+	   ELSE
+	      x_skip = ( cx_hi_ss(cx,dim1)-cx_lo_ss(cx,dim1) )
+     .		 / max_x_vec + 1
+	      IF ( x_skip .NE. 1 ) THEN
+	         risc_buff = ' '	         
+	         WRITE ( risc_buff, 3000 ) x_skip, 'X'
+	         CALL SPLIT_LIST(pttmode_explct, err_lun, risc_buff, 0)
+	      ENDIF
+	   ENDIF
+	   loc = qual_given( slash_vect_yskip )
+	   IF ( loc .GT. 0 ) THEN
+	      CALL EQUAL_VAL( cmnd_buff(qual_start(loc):qual_end(loc)),
+     .			   vbuf, status )
+	      IF ( status .NE. ferr_ok ) RETURN
+	      IF ( vbuf .EQ. unspecified_val4 ) THEN
+	         y_skip = 1.
+	      ELSE
+	         y_skip = ABS(vbuf)
+	      ENDIF
+	   ELSE
+	      y_skip = ( cx_hi_ss(cx,dim2)-cx_lo_ss(cx,dim2) )
+     .	   	    / max_y_vec + 1
+	      IF ( y_skip .NE. 1 ) THEN 
+	         risc_buff = ' '	         
+	         WRITE ( risc_buff, 3000 ) y_skip, 'Y'
+	         CALL SPLIT_LIST(pttmode_explct, err_lun, risc_buff, 0)
+	      ENDIF
+	   ENDIF
+ 3000	   FORMAT (' Using every ',I3,'th vector in the ',
+     .            A1,' direction')
+	   WRITE ( ppl_buff, '(2I4)' ) x_skip, y_skip
+
+* plot it with vector arrows
+	   IF (  overlay ) THEN
+	      CALL PPLCMD (' ',' ',0,
+     .		'VECTOR/OVER/' //ppl_wait//' '//ppl_buff, 1, 1 )
+	   ELSE
+	      CALL PPLCMD (' ',' ',0,
+     .		'VECTOR/LATCH/'//ppl_wait//' '//ppl_buff, 1, 1 )
+	   ENDIF
+
+C   Save the skip values in a symbol PPL_VEC_XSKIP, PPL_VEC_YSKIP
+
+	   WRITE ( ppl_buff, 3010 ) x_skip
+ 3010	   FORMAT ('PPL_VEC_XSKIP', i4)
+	   ier = 0
+	   ist = 0
+	   CALL SETSYM (ppl_buff, 17, ier, ist)
+
+	   WRITE ( ppl_buff, 3020 ) y_skip
+ 3020	   FORMAT ('PPL_VEC_YSKIP', i4)
+	   ier = 0
+	   ist = 0
+	   CALL SETSYM (ppl_buff, 17, ier, ist)
+
+        ELSE  
+
+* plot it with flowlines
+
+           CALL flow_set_up (is_mr, is_cx, transpz)
+
+* special set-up required only for the VECTOR/FLOW command
+	IF ( .NOT.overlay .AND. .NOT.no_data ) THEN
+* ... vector length key below plot title (overlay written as key)
+           xloc = (xlen/2.) - 0.5
+           yloc = -1.*yorg + 0.2
+	   WRITE ( ppl_buff, '(2F6.1)' ) xloc, yloc
+	   CALL PPLCMD (' ',' ',0,'VECKEY/NOUSER '//ppl_buff, 1, 1 )
+
+           IF (no_key) THEN
+	      CALL PPLCMD (' ',' ',0,'VECKEY 0', 1, 1 )
+	   ENDIF	
+
+	ENDIF	
+
+           WRITE (ppl_buff, '(I4)') density
+	   IF (  overlay ) THEN
+	      CALL PPLCMD (' ',' ',0,
+     .		'FLOWLINE/OVER/' //ppl_wait//' '//ppl_buff, 1, 1 )
+
+	   ELSE
+	      CALL PPLCMD (' ',' ',0,
+     .		'FLOWLINE/LATCH/'//ppl_wait//' '//ppl_buff, 1, 1 )
+	   ENDIF
+        ENDIF
+
+* restore axes? (5/29/97  revised 3/2002
+c        IF ( axes .or. noaxes ) CALL PPL_AXES_RESTORE
+
+* clear the overriding opacity
+        opacity = -1.0
+        CALL SET_OVERRIDE_OPACITY(opacity)
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ?
+	IF ( qual_given( slash_vect_frame ) .GT. 0 ) THEN
+	   CALL SAVE_FRAME( frame_file, "HDF", status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* release the memory used for axis buffers
+ 1000 	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+ 5400	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'Legal range is 1 to 3', *5000 )
+ 5440	CALL ERRMSG( ferr_syntax, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .	'AXES[=(TOP,BOTTOM,LEFT,RIGHT)] takes 4 arguments or no argument', *1000 )
+ 5450	CALL ERRMSG( ferr_out_of_range, status, 
+     .		cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .		'AXES arguments must be 0 or 1', *1000 )
+ 5500   CALL ERRMSG( ferr_out_of_range, status,
+     .          cmnd_buff(qual_start(loc):qual_end(loc))//pCR//
+     .          'Value from 0 to 100 must be given', *1000 )
+	END
diff --git a/fer/xeq/xeq_wire.F b/fer/xeq/xeq_wire.F
new file mode 100644
index 0000000..7fbbbee
--- /dev/null
+++ b/fer/xeq/xeq_wire.F
@@ -0,0 +1,215 @@
+	SUBROUTINE XEQ_WIRE( memory )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the WIRE (3D wireframe) command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V230  6/8/92 - for new command, WIRE: this routine based on XEQ_CONTOUR
+*       10/22/92 - removed unnecessary shade_vars.cmn
+*       12/2/92  - added /ZSCALE qualifier
+* V301:	  1/7/94 - bug fix: (see DISP_DATA_SET_UP) must unprotect plot data
+* 	 1/10/94 - change to DISP_SET_UP call to accomodate CONTOUR/PEN
+* V312: 5/94 - array "memory" as a calling argument
+* V320:   1/20/94 - changes to SAVE_FRAME call reflecting C-based procedures
+* 12/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V530: *acm*6/01 - add arguments is_logh, is_logv to DISP_SET_UP call.
+*                  (only used for PLOT command)
+* V550: *acm*11/02 add argument is_shade to DISP_SET_UP call (not used by wire)
+*                  remove VMS includes.
+* V552: *acm* 5/03 add argument use_cell to DISP_SET_UP call (not used by wire)
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*                  A time axis may be a T axis or F axis
+
+	include 'tmap_dims.parm'
+	include	'ferret.parm'
+	include 'errmsg.parm'
+	include 'plot_setup.parm'
+	include 'slash.parm'
+	include 'xcontext.cmn'
+	include 'xvariables.cmn'
+	include 'xprog_state.cmn'
+	include 'xplot_state.cmn'
+	include 'xplot_setup.cmn'
+
+	
+* calling argument declarations:
+	REAL	memory( mem_blk_size, max_mem_blks )
+
+* internal variable declarations:
+	LOGICAL	  no_range, overlay, no_labels, transpz, got_vpoint,
+     .		  is_logh, is_logv, is_shade, use_cell, set_up, inc_grid
+	INTEGER	  status, qp,
+     .		  ax1_blks, ax1_start,
+     .		  ax2_blks, ax2_start, density
+	REAL	  only_val, aspect
+	PARAMETER (aspect = 0.0) 		!kob 12/96
+	CHARACTER vpoint*24, zlims*24, zscale*24
+
+* internal parameter declarations:
+	LOGICAL		norm_dims_only, not_vector
+	PARAMETER     ( norm_dims_only  = .FALSE.,
+     .			not_vector	= .FALSE.)
+
+* set up the graphics environment
+	CALL START_PPLUS(.FALSE.)
+
+* get the data (possibly ?? on a slightly oversized region)
+	CALL DISP_DATA_SET_UP( memory,
+     .		ax1_start, ax1_blks, ax2_start, ax2_blks, status )
+	IF ( status .NE. ferr_ok ) GOTO 5100
+
+* initialize
+	overlay   = qual_given( slash_wire_over      ).GT.0 .AND. twodee_on
+	no_labels = qual_given( slash_wire_nolabels  ).GT.0
+	transpz   = qual_given( slash_wire_transpz   ).GT.0
+	is_logh   = qual_given( slash_is_logh        ).GT.0 ! Not valid quals
+	is_logv   = qual_given( slash_is_logv        ).GT.0 ! for wire fill
+        is_shade  = .FALSE.
+        use_cell  = .FALSE.
+
+	IF ( .NOT.overlay ) CALL DISP_INIT(no_labels,
+     .                                     is_cx, num_uvars_in_cmnd)
+* ... default orientation for YT and ZT contours has time on horizontal
+	IF ( (plot_axis(2).EQ.t_dim .OR. plot_axis(2).EQ.f_dim) .AND. 
+     .		plot_axis(1).NE.x_dim ) transpz = .NOT.transpz
+
+* get wire frame parameters (just get 'em as text strings)
+* /VIEW = x,y,z
+        vpoint = ' '
+        qp = qual_given( slash_wire_view )
+        got_vpoint = qp .GT. 0
+        IF ( got_vpoint ) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                     vpoint, status )
+           IF ( status .NE. ferr_ok ) RETURN
+        ENDIF
+* /ZLIMITS = lo,hi
+        zlims = ' '
+        qp = qual_given( slash_wire_zlimits )
+        IF ( qp .GT. 0 ) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                     zlims, status )
+           IF ( status .NE. ferr_ok ) RETURN
+        ENDIF
+* /ZSCALE=scale
+        zscale = ' '
+        qp = qual_given( slash_wire_zscale )
+        IF ( qp .GT. 0 ) THEN
+           CALL EQUAL_STRING( cmnd_buff(qual_start(qp):qual_end(qp)),
+     .                     zscale, status )
+           IF ( status .NE. ferr_ok ) RETURN
+        ENDIF
+
+* prepare PLOT+ environment
+	CALL DISP_PREP( status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+	
+* /set_up only requested ?
+	set_up    = qual_given( slash_cont_set_up    ).GT.0
+
+        density = 0	! not used; vec/flow needs it in set up
+
+* set up the axes and title and load the data into PPLUS
+
+	inc_grid = set_up
+	CALL DISP_SET_UP   ( 	memory,
+     .				not_vector,
+     .                          is_shade,
+     .                          use_cell,
+     .				aspect,
+     .				overlay,
+     .				transpz,
+     .				no_labels,
+     .				no_range,
+     .				only_val,
+     .                          density,
+     .				is_logh, 
+     .				is_logv,
+     .				is_mr,		! pass list
+     .				num_uvars_in_cmnd,
+     .				is_cx,		! pass list
+     .				is_uvar,	
+     .				memory( 1, ax1_start ),
+     .				memory( 1, ax2_start ),
+     .				-1, 			! auto pen select
+     .				set_up,
+     .				status )
+	IF ( status .NE. ferr_ok ) GOTO 5000
+
+* change "window" state in PLOT+
+	CALL PPLCMD ( from, line, 0, 'WINDOW OFF', 1, 1 )
+
+* set the view point
+        IF ( got_vpoint ) 
+     .       CALL PPLCMD ( from, line, 0, 'VPOINT '//vpoint, 1, 1 )
+
+* /set_up only requested ?
+	IF ( set_up ) GOTO 1000
+
+* draw it 
+	IF ( overlay ) THEN
+	   CALL PPLCMD ( ' ', ' ', 0,
+     .	                 'VIEW/OVER/' //ppl_wait//' '
+     .                                //zscale//',,'//zlims, 1, 1 )
+	ELSE
+	   CALL PPLCMD ( ' ', ' ', 0,
+     .			'VIEW/LATCH/'//ppl_wait//' '
+     .                               //zscale//',,'//zlims, 1, 1 )
+	ENDIF
+
+* interrupt occurred during plot ?
+	IF ( ppl_interrupted ) GOTO 1000
+
+* capture the bit map ?
+	IF ( qual_given( slash_wire_frame ) .GT. 0 ) THEN
+	   CALL SAVE_FRAME( frame_file, "HDF", status )
+	   IF ( status .NE. ferr_ok ) GOTO 5000
+	ENDIF
+
+* release the memory used for axis buffers
+ 1000 	CALL FREE_MEMORY( ax2_start, ax2_blks )
+ 	CALL FREE_MEMORY( ax1_start, ax2_blks )
+	CALL UNPROTECT_CMND_DATA			! 1/94
+ 5100	RETURN
+
+* error exits
+ 5000	GOTO 1000
+	END
diff --git a/fer/xeq/xeq_write.F b/fer/xeq/xeq_write.F
new file mode 100644
index 0000000..41fd67f
--- /dev/null
+++ b/fer/xeq/xeq_write.F
@@ -0,0 +1,50 @@
+	SUBROUTINE XEQ_WRITE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* execute the WRITE command
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/3/86
+
+	write (6,*) 'WRITE command not implemented'
+
+	RETURN
+	END
+
diff --git a/ferretmagic.py b/ferretmagic.py
new file mode 100644
index 0000000..94d1a33
--- /dev/null
+++ b/ferretmagic.py
@@ -0,0 +1,398 @@
+# -*- coding: utf-8 -*-
+"""
+===========
+ferretmagic
+===========
+
+Magics for interacting with ferret via pyferret.
+
+.. note::
+
+  The ``pyferret`` module needs to be installed first
+
+Usage
+=====
+
+``%%ferret``
+
+{ferret_DOC}
+
+``%ferret_run``
+
+{ferret_RUN_DOC}
+
+``%ferret_getdata``
+
+{ferret_GETDATA_DOC}
+
+``%ferret_putdata``
+
+{ferret_PUTDATA_DOC}
+
+"""
+
+#-----------------------------------------------------------------------------
+#  Patrick.Brockmann at lsce.ipsl.fr
+#  Started 2013/08/28 then put on github.com 2013/09/06
+#
+#-----------------------------------------------------------------------------
+
+import os.path
+import tempfile
+import math
+import pyferret
+from shutil import rmtree
+
+from IPython.core.displaypub import publish_display_data
+from IPython.core.magic import Magics, magics_class, line_magic, cell_magic, needs_local_scope
+from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring
+from IPython.utils.py3compat import unicode_to_str
+from pexpect import ExceptionPexpect
+
+_PUBLISH_KEY = 'ferretMagic.ferret'
+_DEFAULT_PLOTSIZE = '756.0,612.0'
+_DEFAULT_MEMSIZE = 400.0
+
+#----------------------------------------------------
+class ferretMagicError(Exception):
+    pass
+
+ at magics_class
+class ferretMagics(Magics):
+    """
+    A set of magics useful for interactive work with ferret via pyferret.
+    """
+#----------------------------------------------------
+    def __init__(self, shell):
+        """
+        Parameters
+        ----------
+        shell : IPython shell
+        """
+        super(ferretMagics, self).__init__(shell)
+        try:
+            pyferret.start(memsize=(_DEFAULT_MEMSIZE/8.0), verify=False, journal=False, unmapped=True, quiet=True)
+        except ExceptionPexpect:
+            raise ferretMagicError('pyferret cannot be started')
+
+#----------------------------------------------------
+    def ferret_run_code(self, args, code):
+        """
+        Parameters
+        ----------
+        args : control arguments for running (py)ferret
+        code : ferret commands to run
+        """
+
+        # Temporary directory; create under the current directory 
+        # so PDF link files are accessible
+        temp_dir = tempfile.mkdtemp(dir='.', prefix='ipyferret_').replace('\\', '/')
+
+        # Redirect stdout and stderr to file
+        out_filename = temp_dir + '/output.txt' 
+        (errval, errmsg) = pyferret.run('set redirect /clobber /file="%s" stdout stderr' % out_filename)
+
+        # Filename for saving the final plot (if any)
+        if args.plotname:
+            plot_filename = str(args.plotname)
+            if args.pdf:
+                if not plot_filename.endswith('.pdf'):
+                    plot_filename += '.pdf'
+            else:
+                if not plot_filename.endswith('.png'):
+                    plot_filename += '.png'
+        elif args.pdf:
+            plot_filename = temp_dir + '/image.pdf'
+        else:
+            plot_filename = temp_dir + '/image.png'
+
+
+        # Make it quiet by default
+        (errval, errmsg) = pyferret.run('cancel mode verify')
+
+        if args.memory:
+            # Reset memory size in megabytes
+            mem_size = float(args.memory)
+            if mem_size > 0.0:
+                (errval, errmsg) = pyferret.run('set memory /size=%f' % (mem_size/8.0))
+
+        # Get image size and aspect ratio
+        if args.size:
+            plot_size = args.size.split(',')
+        else:
+            plot_size = _DEFAULT_PLOTSIZE.split(',')
+        plot_width  = float(plot_size[0])
+        plot_height = float(plot_size[1])
+        plot_aspect = plot_height / plot_width
+
+        # Set window size with the required aspect ratio; 
+        # always anti-alias with windows of these sizes
+        if args.bigger:
+            # Double the size (both width and height) of the standard window 
+            # and add some extra (0.5) thickness to lines
+            canvas_width = 2.0 * math.sqrt(10.5 * 8.5 / plot_aspect)
+            line_thicken = 2.0
+        else:
+            # Use a standard-size window with usual line thickness
+            canvas_width = math.sqrt(10.5 * 8.5 / plot_aspect)
+            line_thicken = 1.0
+        (errval, errmsg) = pyferret.run('set window /xinches=%f /thick=%f /aspect=%f 1' % \
+                                        (canvas_width, line_thicken, plot_aspect))
+
+        # Run code
+        pyferret_error = False
+        for input in code:
+            # Ignore blank lines
+            if input:
+                input = unicode_to_str(input)
+                (errval, errmsg) = pyferret.run(input)
+                if errval != pyferret.FERR_OK:
+                    publish_display_data(_PUBLISH_KEY, {'text/html': 
+                        '<pre style="background-color:#F79F81; border-radius: 4px 4px 4px 4px; font-size: smaller">' +
+                        'yes? %s\n' % input +
+                        '** (LAST) ERROR MESSAGE: %s' % errmsg +
+                        '</pre>' 
+                    })
+                    pyferret_error = True
+                    break
+
+        # Create the image file; if no final image, no image file will be created.
+        # Any existing image with that filename will be versioned away ('.~n~' appended)
+        if not pyferret_error:
+            if args.pdf:
+                (errval, errmsg) = pyferret.run('frame /xinch=%f /file="%s" /format=PDF' % (plot_width/72.0, plot_filename) )
+            else:
+                (errval, errmsg) = pyferret.run('frame /xpixel=%f /file="%s" /format=PNG' % (plot_width, plot_filename))
+            if errval != pyferret.FERR_OK:
+                pyferret_error = True
+
+        # Close the window
+        (errval, errmsg) = pyferret.run('cancel window 1')
+
+        # Close the stdout and stderr redirect file
+        (errval, errmsg) = pyferret.run('cancel redirect')
+
+        #-------------------------------
+
+        # Publish
+        display_data = []
+
+        # Publish captured stdout text, if any
+        if os.path.isfile(out_filename) and (os.path.getsize(out_filename) > 0): 
+            try:
+                text_outputs = []
+                text_outputs.append('<pre style="background-color:#ECF6CE; border-radius: 4px 4px 4px 4px; font-size: smaller">')
+                f = open(out_filename, "r")
+                for line in f:
+                    text_outputs.append(line)
+                f.close()
+                text_outputs.append("</pre>")
+                text_output = "".join(text_outputs)
+                display_data.append((_PUBLISH_KEY, {'text/html': text_output}))
+            except:
+                pass
+
+        # Publish image if present
+        if not pyferret_error:
+           if args.pdf:
+               if os.path.isfile(plot_filename):
+                   # Create link to pdf; file visible from cell from files directory
+                   text_outputs = []
+                   text_outputs.append('<pre style="background-color:#F2F5A9; border-radius: 4px 4px 4px 4px; font-size: smaller">')
+                   text_outputs.append('Message: <a href="files/%s" target="_blank">%s</a> created.' % (plot_filename, plot_filename))
+                   text_outputs.append('</pre>')
+                   text_output = "".join(text_outputs)
+                   display_data.append((_PUBLISH_KEY, {'text/html': text_output}))
+                   # If the user did not provide the PDF filename, 
+                   # do not delete the temporary directory since the PDF is in there.
+                   if args.plotname:
+                       rmtree(temp_dir)
+               else:
+                   # Delete temporary directory - nothing to preserve
+                   rmtree(temp_dir)
+           else:
+               # Display the image in the notebook
+               try:
+                   f = open(plot_filename, 'rb')
+                   image = f.read().encode('base64')
+                   f.close()
+                   display_data.append((_PUBLISH_KEY, {'text/html': '<div class="myoutput">' + 
+                       '<img src="data:image/png;base64,%s"/></div>' % image}))
+               except:
+                   pass
+               # Delete temporary directory - PNG encoded in the string
+               rmtree(temp_dir)
+
+        # Publication
+        for source, data in display_data:
+              publish_display_data(source, data)
+
+
+#----------------------------------------------------
+    @magic_arguments()
+    @argument(
+        '-m', '--memory', type=float,
+        help='Memory, in megabytes, to be used by ferret henceforth. Startup default is %s' % str(_DEFAULT_MEMSIZE)
+        )
+    @argument(
+        '-s', '--size',
+        help='Pixel size of PNG images, or point size of PDF images, as "width,height". Default is ' + _DEFAULT_PLOTSIZE
+        )
+    @argument(
+        '-b', '--bigger', default=False, action='store_true',
+        help='Produce a sharper plot by doubling the standard plot window size before scaling'
+        )
+    @argument(
+        '-p', '--pdf', default=False, action='store_true',
+        help='Generate the output plot as a PDF file.'
+        )
+    @argument(
+        '-f', '--plotname',
+        help='Name of the image file to create.  If not given, a name will be generated.'
+        )
+    @cell_magic
+    def ferret(self, line, cell):
+        '''
+            In [10]: %%ferret
+               ....: let a=12
+               ....: list a
+
+        The size of output plots can be specified:
+            In [18]: %%ferret -s 800,600 
+                ...: plot i[i=1:100]
+
+        '''
+        args = parse_argstring(self.ferret, line)
+        code = cell.split('\n')
+        self.ferret_run_code(args, code)
+
+#----------------------------------------------------
+    @magic_arguments()
+    @argument(
+        '-m', '--memory', type=float,
+        help='Memory, in megabytes, to be used by ferret henceforth. Startup default is %s' % str(_DEFAULT_MEMSIZE)
+        )
+    @argument(
+        '-s', '--size',
+        help='Pixel size of PNG images, or point size of PDF images, as "width,height". Default is ' + _DEFAULT_PLOTSIZE
+        )
+    @argument(
+        '-b', '--bigger', default=False, action='store_true',
+        help='Produce a sharper plot by doubling the standard plot window size before scaling'
+        )
+    @argument(
+        '-p', '--pdf', default=False, action='store_true',
+        help='Generate the output plot as a PDF file.'
+        )
+    @argument(
+        '-f', '--plotname',
+        help='Name of the image file to create.  If not given, a name will be generated.'
+        )
+    @argument(
+        'string',
+        nargs='*'
+        )
+    @line_magic
+    def ferret_run(self, line):
+        '''
+        Line-level magic to run a command in ferret. 
+
+            In [12]: for val in [100,500,1000]:
+               ....:     %ferret_run -s 400,400 -b 'plot sin(i[i=1:%(val)s]*0.1)' % locals()
+
+        '''
+        args = parse_argstring(self.ferret_run, line)
+        code = [self.shell.ev(" ".join(args.string))]
+        self.ferret_run_code(args, code)
+
+#----------------------------------------------------
+    @magic_arguments()
+    @argument(
+        '--create_mask', default=False, action='store_true',
+        help='The data array associated with the "data" key will be a MaskedArray NumPy array instead an ordinary NumPy array.'
+        )
+    @argument(
+        'code',
+        nargs='*'
+        )
+    @line_magic
+    def ferret_getdata(self, line):
+        '''
+        Line-level magic to get data from ferret.
+
+            In [18]: %%ferret
+               ....: use levitus_climatology
+            In [19]: %ferret_getdata tempdict = temp
+           ....: Message: tempdict is now available in python as a dictionary containing the variable's metadata and data array.
+            In [20]: print tempdict.keys()
+           ....: ['axis_coords', 'axis_types', 'data_unit', 'axis_units', 'title', 'axis_names', 'missing_value', 'data']
+
+        '''
+
+        args = parse_argstring(self.ferret_getdata, line)
+
+        code = unicode_to_str(args.code[0])
+        pythonvariable = code.split('=')[0]
+        ferretvariable = code.split('=')[1]
+        exec('%s = pyferret.getdata("%s", %s)' % (pythonvariable, ferretvariable, args.create_mask) )
+        self.shell.push("%s" % pythonvariable)
+        publish_display_data('ferretMagic.ferret', {'text/html': 
+            '<pre style="background-color:#F2F5A9; border-radius: 4px 4px 4px 4px; font-size: smaller">' +
+            'Message: ' + pythonvariable + " is now available in python as a dictionary containing the variable's metadata and data array."
+            '</pre>' 
+        })
+
+#----------------------------------------------------
+    @magic_arguments()
+    @argument(
+        '--axis_pos', default=None, 
+        help='Order of the axes. Default mode uses a reasonable guess from examining the axis types.'
+        )
+    @argument(
+        'code',
+        nargs='*'
+        )
+    @line_magic
+    def ferret_putdata(self, line):
+        '''
+        Line-level magic to put data to ferret.
+
+            In [31]: import numpy as np
+               ....: b = {}
+               ....: b['name']='myvar'
+               ....: b['name']='myvar'
+               ....: x=np.linspace(-np.pi*4, np.pi*4, 500)
+               ....: b['data']=np.sin(x)/x
+               ....: b.keys()
+            Out[31]: ['data', 'name']
+        In [32]: %ferret_putdata --axis_pos (1,0,2,3,4,5) b
+           ....: Message: b is now available in ferret as myvar
+
+        '''
+        args = parse_argstring(self.ferret_putdata, line)
+
+        ferretvariable = unicode_to_str(args.code[0])
+        if args.axis_pos:
+            axis_pos_variable = eval(args.axis_pos)
+        else:
+            axis_pos_variable = None
+        pyferret.putdata(self.shell.user_ns[ferretvariable], axis_pos=axis_pos_variable)
+        publish_display_data('ferretMagic.ferret', {'text/html': 
+            '<pre style="background-color:#F2F5A9; border-radius: 4px 4px 4px 4px; font-size: smaller">' +
+            'Message: ' + ferretvariable + ' is now available in ferret as ' + self.shell.user_ns[ferretvariable]['name'] + 
+            '</pre>' 
+        })
+
+
+#----------------------------------------------------
+__doc__ = __doc__.format(
+    ferret_DOC = ' '*8 + ferretMagics.ferret.__doc__,
+    ferret_RUN_DOC = ' '*8 + ferretMagics.ferret_run.__doc__,
+    ferret_GETDATA_DOC = ' '*8 + ferretMagics.ferret_getdata.__doc__,
+    ferret_PUTDATA_DOC = ' '*8 + ferretMagics.ferret_putdata.__doc__
+    )
+
+def load_ipython_extension(ip):
+    """Load the extension in IPython."""
+    ip.register_magics(ferretMagics)
+
diff --git a/fmt/cmn/NCF_Util.h b/fmt/cmn/NCF_Util.h
new file mode 100644
index 0000000..bc501a1
--- /dev/null
+++ b/fmt/cmn/NCF_Util.h
@@ -0,0 +1,159 @@
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granteHd the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+/* NC_Util.h
+ *
+ * Ansley Manke
+ * Ferret V600 April 2005
+/* *acm*  5/12 Additions for creating aggregate datasets
+ *
+ * This is the header file to be included by routines which
+ * are part of the Ferret NetCDF attribute handling library.
+ * V683 10/10*acm* New NC_INTERRUPT for user-interrupt reading netCDF/OPeNDAP data
+ *
+ */
+
+/* .................... Defines ..................... */
+
+#define TRUE  1
+#define FALSE 0
+#define YES   1
+#define NO    0
+
+#define LO    0
+#define HI    1
+
+#define ATOM_NOT_FOUND 0  /* This should match the atom_not_found parameter in ferret.parm. */
+#define FERR_OK 3  /* This should match the ferr_ok parameter in errmsg.parm. */
+#define NC_GLOBAL -1  /* This should match the NC_GLOBAL parameter in netcdf.h */
+
+/* Ferret-defined "netcdf error status" when a read was interrupted by Crtl-C */
+/* match nc_interrupt with nf_interrupt in tmap_errors.parm */
+#define NC_INTERRUPT 900
+
+#define MAX_PATH_NAME	2048	 /* max length of a path */
+#define MAX_FER_SETNAME	256	 /* max length of a path */
+#define MAX_FER_SETNAME	256	 /* max length of a path */
+
+
+/* .................... Typedefs .................... */
+
+
+/* dataset */
+/*
+typedef struct  {			
+    char fername[MAX_FER_SETNAME];
+	int fer_dsetnum;
+} ncdset;
+*/
+
+typedef struct  {			/* dimension */
+    char name[NC_MAX_NAME];
+    size_t size;
+} ncdim;
+
+typedef struct  {
+	char fullpath[MAX_PATH_NAME];
+	char fername[MAX_FER_SETNAME];
+	LIST *dsetvarlist;
+	ncdim dims[NC_MAX_DIMS];
+	int ndims;
+	int ngatts;
+	int recdim;
+	int nvars;
+	int vars_list_initialized;
+	int fer_dsetnum;
+	int fer_current;
+	int its_epic;
+	int its_agg;
+	int num_agg_members;
+	LIST *agg_dsetlist;
+	int agg_list_initialized;
+} ncdset;
+
+typedef struct  {          /* variable */
+	char name[NC_MAX_NAME];
+	LIST *varattlist;
+	nc_type type;
+	int outtype;
+	int ndims;
+	int dims[MAX_VAR_DIMS];
+	int natts;
+	int varid;
+	int is_axis;           /* coordinate variable */
+	int axis_dir;          /* coordinate direction 1,2,3,4, for X,Y,Z,T, etc*/
+	int has_fillval;
+	int all_outflag;       /* 0 write no attrs, 
+	                          1 check individual attr flags
+	                          2 write all attrs,
+	                          3 reset attr flags to Ferret defaults */
+	double fillval;
+	int attrs_list_initialized;
+	LIST *varagglist;      /* if an aggregate dataset, for each var,
+	                          list the members of the aggregate components. */
+	int agg_list_initialized;
+	int nmemb;
+} ncvar;
+
+typedef struct {			/* attribute */
+	char name[NC_MAX_NAME];
+	nc_type type;
+	int outtype;
+	int attid;
+	int outflag;        /* 1 to write this attr, 0 to not write */
+	int len;
+	void *inval;        /* for inputting attributes of all types*/
+	char *string;       /* for text attributes (type = NC_CHAR) */
+	double *vals;       /* for numeric attributes of all types */
+} ncatt;
+
+typedef struct {			/* aggregate member-dataset */
+	int dsetnum;			/* Ferret dataset number */
+} ncagg;
+
+typedef struct {			/* for var in aggregate member-dataset: */
+	int imemb;		        /* for members of the aggregate, member sequence number */
+	int vtype;		        /* for members of the aggregate, type: user-var or file-var */
+	int datid;		        /* for members of the aggregate, Ferret dataset id */
+	int gnum;               /* Ferret grid numbers */
+	int iline;              /* Ferret line number for the aggregate dimension */
+	int nv;                 /* Ferret sequence # in ds_var_code or uvar_name_code */
+} ncagg_var_descr;
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
diff --git a/fmt/cmn/cd_lib.parm b/fmt/cmn/cd_lib.parm
new file mode 100644
index 0000000..69c47a6
--- /dev/null
+++ b/fmt/cmn/cd_lib.parm
@@ -0,0 +1,24 @@
+* CD_LIB.PARM
+* netCDF special parameters for TMAP library
+
+* revision 0.00 - 18/03/92 - by Steve Hankin for PMEL/TMAP
+
+	CHARACTER pcdf_global*10
+	PARAMETER ( pcdf_global = '%%GLOBAL%%' )
+
+	INTEGER     pcdf_recdim
+        PARAMETER ( pcdf_recdim = 0 )
+
+	INTEGER     pcdf_yes, pcdf_no, pcdf_undefined
+        PARAMETER ( pcdf_yes = 1,
+     .	            pcdf_undefined = 0,
+     .	            pcdf_no = -1 )
+
+	INTEGER     pcdf_full_span, pcdf_sub_span, pcdf_child_span
+        PARAMETER ( pcdf_full_span  = 1,
+     .	            pcdf_sub_span   = 2,
+     .	            pcdf_child_span = 3 )
+
+
+
+
diff --git a/fmt/cmn/cdf_tmap.parm b/fmt/cmn/cdf_tmap.parm
new file mode 100644
index 0000000..bbeb4a3
--- /dev/null
+++ b/fmt/cmn/cdf_tmap.parm
@@ -0,0 +1,26 @@
+* cdf_tmap.parm
+* special TMAP parameters needed for netCDF files
+
+
+	INTEGER pcd_mode_data,
+     .		pcd_mode_define,
+     .          pcd_reset_data,
+     .		pcd_reset_define
+
+	PARAMETER (
+     .		pcd_mode_data    = 1,
+     .		pcd_mode_define  = 2,
+     .          pcd_reset_data   = -pcd_mode_data,
+     .		pcd_reset_define = -pcd_mode_define )
+
+	INTEGER
+     .		pcd_defer_init,
+     .		pcd_defer_points,
+     .		pcd_defer_edges,
+     .		pcd_defer_bounds
+	PARAMETER (
+     .		pcd_defer_init = 0,
+     .		pcd_defer_points = 1,
+     .		pcd_defer_edges = 2,
+     .		pcd_defer_bounds = 3 )
+
diff --git a/fmt/cmn/cpu.parm b/fmt/cmn/cpu.parm
new file mode 100644
index 0000000..1b61929
--- /dev/null
+++ b/fmt/cmn/cpu.parm
@@ -0,0 +1,12 @@
+* CPU.PARM
+*
+* defines codes for cpu types
+* used to control floating point and integer conversions
+
+	INTEGER	cptype_vax, cptype_dec, cptype_sun
+
+* "dec" = DECstation/MIPS
+
+	PARAMETER	(cptype_vax = 0,
+     .			 cptype_dec = 1,
+     .			 cptype_sun = 2 )
diff --git a/fmt/cmn/descript.def b/fmt/cmn/descript.def
new file mode 100644
index 0000000..cd7f3d0
--- /dev/null
+++ b/fmt/cmn/descript.def
@@ -0,0 +1,48 @@
+* "FORMAT RECORD"
+	CHARACTER*4	d_type, d_format, d_prog_rev
+	CHARACTER*16	d_source_class, d_source, d_subsource
+
+* "BACKGROUND RECORD"
+	CHARACTER*4	d_expnum, d_modnum, d_aux_modnum(num_aux)
+	CHARACTER*16	d_forcing_set, d_who_ranit, d_who_madeit
+	CHARACTER*20	d_t0time, d_time_run, d_time_made, d_caltype
+	CHARACTER*80    d_add_parm(num_parm),
+     .			d_grid_filename(num_gridfiles)
+	CHARACTER*1024	d_title, d_mod_title
+	INTEGER*4	d_ntuple
+	LOGICAL		d_time_modulo
+	REAL		d_time_unit, d_ntegrate_tstep
+
+* "MESSAGE RECORD"
+	LOGICAL*2	d_alert_on_open, d_alert_on_output
+	CHARACTER*80	d_message
+
+* "VARIABLE RECORD (one record per file variable)
+	CHARACTER*2	d_ordering(nferdims)
+	CHARACTER*8	d_var_code, d_grid_name
+	CHARACTER*12	d_precision
+	CHARACTER*24	d_var_units
+	CHARACTER*40	d_var_title, d_var_titl_mod
+	REAL		d_missing_flag, d_bad_flag
+	INTEGER*4	d_grid_start(nferdims),d_grid_end(nferdims), d_aux_set_num,
+     .			d_var_tstart, d_var_tend, d_var_tdelta,
+     .			d_ndataperrec
+
+* "EXTRA RECORD"
+	CHARACTER*80	d_extra_des_info
+
+* Information for set files in descriptor
+* "STEPFILE RECORD"
+* *kob* 11/00 Increase size of s_filename to accomodate large file names for
+*	      DODS multi-mc files
+	CHARACTER*5	s_regvarflag
+	CHARACTER*23	s_index
+	CHARACTER*512	s_filename
+	INTEGER*4	s_aux_set_num, s_num_of_files
+	REAL*8		s_start, s_end, s_delta
+
+* Information for var files in descriptor
+* "VARFILE RECORD"
+	CHARACTER*4	v_firstvar, v_lastvar
+	CHARACTER*23	v_index
+	CHARACTER*60	v_filename
diff --git a/fmt/cmn/encode_strings.cmn b/fmt/cmn/encode_strings.cmn
new file mode 100644
index 0000000..8664dd5
--- /dev/null
+++ b/fmt/cmn/encode_strings.cmn
@@ -0,0 +1,13 @@
+* encode_strings.cmn - Reserved characters to encode,
+* and their encodings. 
+
+	INTEGER nencode
+	PARAMETER (nencode=24)
+	CHARACTER*1 reschar(nencode)    ! Reserved chars to encode
+	CHARACTER*3 subencode(nencode)  ! The corresponding encoding
+	INTEGER nsubencode(nencode)     ! The length of the substituted string
+
+	COMMON /encode_cmn/
+     .		reschar,
+     .		subencode,
+     .		nsubencode
diff --git a/fmt/cmn/ez_delimited_read.h b/fmt/cmn/ez_delimited_read.h
new file mode 100644
index 0000000..9a4682e
--- /dev/null
+++ b/fmt/cmn/ez_delimited_read.h
@@ -0,0 +1,82 @@
+/* delimitedRead.h
+ *
+ * Steve Hankin
+ * October 2000
+ *
+ * Header file information needed for spreadsheet-style delimited reads
+ * by the Ferret program
+ * v600 *acm* change call to days_from_day0 needed for 64-bit build
+ *
+ *  *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret.
+
+ */
+#include "ferretmacros.h"
+
+#define FTYP_MISSING 1
+#define FTYP_NUMERIC 2
+#define FTYP_CHARACTER 3
+#define FTYP_LAT 4
+#define FTYP_LON 5
+#define FTYP_DATE 6
+#define FTYP_EURODATE 7
+#define FTYP_TIME 8
+
+#define FANAL_OK 0
+#define FANAL_HAS_MISSING 1
+
+
+typedef struct _DelimFileInfo {
+  int nfields;              /* number of variables to read in this file */
+  int *fieldType;           /* field type of each variable */
+  char *delim;              /* character array of delimiters */
+} DelimFileInfo;
+
+
+char *nexstrtok(char *s1, char *s2);
+void analRec(char *recptr, char *delims, int* nfields, int field_type[],
+	    int max_fields);
+
+#ifdef double_p
+int decodeRec(char *recptr, char *delims, int* nfields, int field_type[],
+	      int nrec,
+	      double** numeric_fields, char*** text_fields, double bad_flags[]);
+int decode_file (char* fname, char *recptr, char *delims, int* skip,
+	       int *maxrec, int* reclen, int* nfields, int field_type[],
+	       int* nrec,
+	       double** numeric_fields, char*** text_fields, double bad_flags[]);
+
+double FORTRAN(days_from_day0) (double *days1900, int* iyr, int* imon, int* iday, double* rdum);
+
+void FORTRAN(decode_file_jacket)
+		( char* fname, char *recptr, char *delims, int *skip,
+		  int* maxrec, int* reclen, int* nfields,
+		  int field_type[], int* nrec,
+		  int mrlist[], double *memptr, int mr_blk1[], int* mblk_size,
+		  double mr_bad_flags[], char ***mr_c_ptr);
+#else
+int decodeRec(char *recptr, char *delims, int* nfields, int field_type[],
+	      int nrec,
+	      float** numeric_fields, char*** text_fields, float bad_flags[]);
+int decode_file (char* fname, char *recptr, char *delims, int* skip,
+	       int *maxrec, int* reclen, int* nfields, int field_type[],
+	       int* nrec,
+	       float** numeric_fields, char*** text_fields, float bad_flags[]);
+
+float FORTRAN(days_from_day0) (double *days1900, int* iyr, int* imon, int* iday, float* rdum);
+
+void FORTRAN(decode_file_jacket)
+		( char* fname, char *recptr, char *delims, int *skip,
+		  int* maxrec, int* reclen, int* nfields,
+		  int field_type[], int* nrec,
+		  int mrlist[], float *memptr, int mr_blk1[], int* mblk_size,
+		  float mr_bad_flags[], char ***mr_c_ptr);
+#endif
+
+int FORTRAN(anal_file) (char *fname, char *recptr, char *delims, int *skip,
+	     int *maxrec, int* reclen, int* nfields, int field_type[],
+	     int *max_fields);
+void FORTRAN(save_delimited_info) (int *nfields, int field_type[],
+				   char *delims, DelimFileInfo **ptr);
+void FORTRAN(get_delimited_info) (int *nfields, int field_type[],
+				   char *delim, DelimFileInfo **ptr);
+void FORTRAN(delete_delimited_info) (DelimFileInfo **ptr);
diff --git a/fmt/cmn/ez_lib.parm b/fmt/cmn/ez_lib.parm
new file mode 100644
index 0000000..87901a6
--- /dev/null
+++ b/fmt/cmn/ez_lib.parm
@@ -0,0 +1,38 @@
+* EZ_LIB.PARM
+*
+* revision 0.00 - 08/07/89 - by Mark Verschell for PMEL/TMAP
+* 7/92 *sh*:
+* increased parameter limits flagging the changes with "xarmchg date" ("x"="p")
+* so that automatic procedures can select which group of parameters to choose
+* 2/95 *sh* increased maxezvars from 10 to 20
+* V530 - 10/00 *sh* ==> added field type parameters for delimited reads
+*		        and maxezfreefmtvars
+
+* EZ lib parameters
+	INTEGER*4	maxezvars, maxezinput, maxezfreefmtvars
+	PARAMETER     ( maxezvars  = 100 )
+	PARAMETER     ( maxezinput = 1000 ) ! *parmchg: now
+	PARAMETER     ( maxezfreefmtvars = 20 ) ! was previously maxezvars
+
+* field type parameters for delimited reads
+	INTEGER	FTYP_NUM_TYPES,
+     .		FTYP_MISSING,
+     .		FTYP_NUMERIC,
+     .		FTYP_CHARACTER,
+     .		FTYP_LAT,
+     .		FTYP_LON,
+     .		FTYP_DATE,
+     .		FTYP_EURODATE,
+     .		FTYP_TIME,
+     .		FTYP_ANAL_MISSING
+	PARAMETER ( FTYP_NUM_TYPES = 8,
+     .		FTYP_MISSING = 1,
+     .		FTYP_NUMERIC = 2,
+     .		FTYP_CHARACTER = 3,
+     .		FTYP_LAT = 4,
+     .		FTYP_LON = 5,
+     .		FTYP_DATE = 6,
+     .		FTYP_EURODATE = 7,
+     .		FTYP_TIME = 8,
+     .		FTYP_ANAL_MISSING = -FTYP_MISSING )
+
diff --git a/fmt/cmn/ferretmacros.h b/fmt/cmn/ferretmacros.h
new file mode 100644
index 0000000..b295a27
--- /dev/null
+++ b/fmt/cmn/ferretmacros.h
@@ -0,0 +1,27 @@
+/* ferretmacros.h in fmt/cmn 
+
+   Define macros for handling underscores on c-to-fortran calls
+   and the ifdef for double-precision Ferret.
+/* acm 12/2012 */
+
+/* Easier way of handling FORTRAN calls with underscore/no underscore */
+#ifndef FORTRAN
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+#endif
+
+/* Easier way of handling single/double floating-point declarations */
+
+#ifdef double_p
+#define DFTYPE double
+#else
+#define DFTYPE float
+#endif
+
+/* Also define the max number of dimensions in Ferret grids */
+
+#define NFERDIMS 6
+#define NFERDIMSP1 7
diff --git a/fmt/cmn/gt_lib.parm b/fmt/cmn/gt_lib.parm
new file mode 100644
index 0000000..c01b291
--- /dev/null
+++ b/fmt/cmn/gt_lib.parm
@@ -0,0 +1,98 @@
+* GT_LIB.PARM
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 1.00 - 05/26/88 - added numerical constants
+* revision 1.10 - 11/29/88 - mpsunkn,mpsnorm changed values to munknown,mnormal
+* revision 1.11 - 12/07/89 - unspecified_int4 changed to -111 from -9999
+* revision 1.12 - 2/17/99 - radius changed from 6370.E5 to 6366.707E5
+* 
+* V50 *kob* 8/99 -   Changed FOR agreement with GDFL/MOM3. The previous 
+*                    (BETA) definition, based on conversion between degrees 
+*		     and nautical miles, was not accurate since conversion 
+*                    from degrees to nautical mile is not well definied 
+*                    due to the non-spherical earth
+* V600 *acm* 5/05    Attribute control: Add atom_not_found, must match the value 
+*                    in netcdf.h and ferret.parm.
+* V602 *acm* 11/06 - Change unspecified_int4 to -999. Fixes bug 1463 where
+*                    where an index value of -111 was confused with this flag
+* V685 *acm* 3/13 - add climatological axes to the pre-defined axes.
+
+* Function return codes
+	INTEGER*4	str_match, atom_not_found
+	PARAMETER	(str_match = 0, atom_not_found = 0)
+
+* numerical constants
+        REAL            deg2rad, radius, deg2km, deg2m, m_radius
+        PARAMETER     ( deg2rad = 3.141592 / 180,
+     .                  radius = 6371.E5,               ! cm  8/99 *kob*
+     .                  m_radius = radius / 100.,       ! meters
+     .                  deg2km = deg2rad * radius * 1.E-5,
+     .                  deg2m  = deg2km * 1000.  )
+
+* names of dimensions
+	INTEGER		  x_dim,   y_dim,   z_dim,   t_dim,   e_dim,   f_dim
+	PARAMETER	( x_dim=1, y_dim=2, z_dim=3, t_dim=4, e_dim=5, f_dim=6 )
+
+* Unspecified values
+	REAL*8		  unspecified_val8
+	INTEGER		  unspecified_int4
+	PARAMETER	( unspecified_val8	= -2E34)
+	PARAMETER	( unspecified_int4	= -999)
+
+* pre-defined grids:.....
+* define "lines" (1 dimensional components of which grids are assembled)
+* parameter definitions are pointers to the lines
+*			("m" indicates parameter, "ps"=Philander/Seigal)
+
+	INTEGER		mpsunkn, mpsnorm, mpsxt, mpsxu, mpsyt, mpsyu,
+     .			mpszt, mpszw, clmirr, clmreg, clseas, clmgrg,
+     .			clmnol, clm360, clmall
+	PARAMETER (	mpsunkn	= -1,		! must match FERRET munknown
+     .			mpsnorm	=  0,		! must match FERRET mnormal
+     .			mpsxt	=  1,
+     .			mpsxu	=  2,
+     .			mpsyt	=  3,
+     .			mpsyu	=  4,
+     .			mpszt	=  5,
+     .			mpszw	=  6,
+     .			clmirr	=  7,	! month irregular
+     .			clmreg	=  8,	! month regular
+     .			clseas	=  9,	! seasonal
+     .			clmgrg	= 10,	! month Gregorian
+     .			clmnol	= 11,	! month noleap
+     .			clm360	= 12,	! month 360-day
+     .			clmall	= 13)	! month all-leap
+
+* define grids, themselves...
+* grids are formed of "outer products" (rectangular arrays) or "inner products"
+*	(ordered tuples) of lines.  (To use inner products the lines must be of
+*	the same length.)
+
+	INTEGER		mps2dt, mps2du, mps3dt, mps3du, mps3dw
+	PARAMETER (	mps2dt	= 1,	! 2D temp(erature) grid
+     .			mps2du	= 2,	! 2D taux,tauy grid
+     .			mps3dt	= 3,	! 3D temp/salt grid
+     .			mps3du	= 4,	! 3d u/v grid
+     .			mps3dw	= 5 )	! 3D w grid
+
+* codes for special grid features...
+* flag values stored in parameters
+	INTEGER		box_lo_lim, box_middle, box_hi_lim
+	PARAMETER     ( box_lo_lim =  1 )
+	PARAMETER     ( box_middle =  2 )
+	PARAMETER     ( box_hi_lim =  3 )
+
+* codes for special time/date formats
+	INTEGER pdate_vax, pdate_numslashnum
+	PARAMETER (pdate_vax = 1,
+     .		   pdate_numslashnum = 2 )
+
+* OS dependent stuff
+	CHARACTER EnvSeparator
+	CHARACTER PathSeparator
+#ifdef __CYGWIN__
+	PARAMETER (EnvSeparator=';', PathSeparator='\')
+#else
+	PARAMETER (EnvSeparator=' ', PathSeparator='/')
+#endif
+
diff --git a/fmt/cmn/implicit.parm b/fmt/cmn/implicit.parm
new file mode 100644
index 0000000..c795ca7
--- /dev/null
+++ b/fmt/cmn/implicit.parm
@@ -0,0 +1,12 @@
+* implicit.PARM
+*
+* 10/95 *sh* - parameters for dynamic lines
+
+* codes for dynamic lines (axes)
+	INTEGER pline_class_basic, pline_class_stride,  pline_class_midpt,
+     .	        pline_class_foreign, pline_class_fft
+	PARAMETER     (	pline_class_basic   = 0,
+     .			pline_class_stride  = 1,
+     .			pline_class_midpt   = 2,
+     .			pline_class_foreign = 3,
+     .			pline_class_fft     = 4 )
diff --git a/fmt/cmn/netcdf_declareUnderscore.inc b/fmt/cmn/netcdf_declareUnderscore.inc
new file mode 100644
index 0000000..68f0eb4
--- /dev/null
+++ b/fmt/cmn/netcdf_declareUnderscore.inc
@@ -0,0 +1,35 @@
+! The ones without trailing underscore are declared in netcdf.inc
+#ifdef usingDODSf2cUnderscore
+      INTEGER NF_CLOSE_
+      INTEGER NF_CREATE_
+      INTEGER NF_DEF_DIM_
+      INTEGER NF_DEF_VAR_
+      INTEGER NF_DEF_VAR_CHUNKING_
+      INTEGER NF_DEF_VAR_DEFLATE_
+      INTEGER NF_ENDDEF_
+      INTEGER NF_GET_ATT_DOUBLE_
+      INTEGER NF_GET_ATT_INT_
+      INTEGER NF_GET_ATT_INT1_
+      INTEGER NF_GET_ATT_INT2_
+      INTEGER NF_GET_ATT_REAL_
+      INTEGER NF_GET_ATT_TEXT_
+      INTEGER NF_GET_CHUNK_CACHE_
+      INTEGER NF_GET_VAR1_DOUBLE_
+      INTEGER NF_GET_VARA_DOUBLE_
+      INTEGER NF_INQ_
+      INTEGER NF_INQ_ATT_
+      INTEGER NF_INQ_DIM_
+      INTEGER NF_INQ_DIMID_
+      INTEGER NF_INQ_DIMLEN_
+      INTEGER NF_INQ_VAR_
+      INTEGER NF_INQ_VARID_
+      INTEGER NF_NOERR_
+      INTEGER NF_OPEN_
+      INTEGER NF_PUT_ATT_DOUBLE_
+      INTEGER NF_PUT_ATT_INT_
+      INTEGER NF_PUT_ATT_TEXT_
+      INTEGER NF_PUT_VAR1_DOUBLE_
+      INTEGER NF_PUT_VARA_DOUBLE_
+      INTEGER NF_REDEF_
+      CHARACTER*1024 NF_STRERROR_
+#endif 
diff --git a/fmt/cmn/tmap_dims.parm b/fmt/cmn/tmap_dims.parm
new file mode 100644
index 0000000..dcc6799
--- /dev/null
+++ b/fmt/cmn/tmap_dims.parm
@@ -0,0 +1,79 @@
+* TMAP_DIMS.PARM
+*
+* revision 0.00	- 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 0.10 - 02/14/88 - changed maxstepfiles,maxvars,maxvarfiles,maxaux,
+*			     max_axis_orients; removed avgvars, avgaux
+* 7/92 *sh*: 
+* increased parameter limits flagging the changes with "xarmchg date" ("x"="p")
+* so that automatic procedures can select which group of parameters to choose
+
+* 9/95 *sh* : added dynamic grid creation
+*		To preserve compatibility with older code a new area for
+*		dynamic grids was created **above** max_grids
+* 10/95 *sh* : added dynamic line creation in a similar style
+* 11/95 *sh* : increased max_grids from 200 to 500
+* 7/97 *sh*  : increased maxvars, max_lines, and maxlinestore
+* V500 7/99 *kob* : double maxlinestore - this was done before for Ned C. but 
+*              somehow didn't get into the official cvs area
+*      7/99 *sh*: increased maxlinestore, max_grids, and max_lines
+* V510 7/99 *kob* : bump maxlinestore again -- to 800K!! (6.4 Mbytes!)
+*		==> retored the previous size: this added 6Mbytes to the exe!!
+*	*sh* 3/00 - create line_ceiling and grid_ceiling to allow netCDF files
+*		    to be using dynamic objects
+*	*sh* 5/00 - bump num_dyn_grids from 100 to 500
+* v5.50 *acm*9/02 - up maxdsets from 30 to 100 
+*       *acm*12/02  up maxstepfiles from 500 to 1000
+* v552  *acm* 3/03  increase maxstepfiles to 5000)
+
+* for TMAP formatted files:
+	INTEGER	nrec_codes,ngrid_prenamed,nvari_prenamed,maxdsets,
+     .		maxstepfiles,maxvars,maxaux,max_grids,max_lines,
+     .		maxlinestore, maxgridfiles, max_axis_orients,
+     .		num_aux, num_parm, num_gridfiles, maxvarfiles,
+     .		num_dyn_grids, max_dyn_grids, num_dyn_lines,
+     .		max_dyn_lines, line_ceiling, grid_ceiling,
+     .		tmp_line_hook, tmp_grid_hook, nferdims, maxvar2
+
+* parameters used for dimensioning arrays
+	PARAMETER (nrec_codes = 11)	! # of different record codes
+	PARAMETER (ngrid_prenamed=11)	! # of pre-defined grids
+	PARAMETER (nvari_prenamed=7)	! # of pre-named variables
+	PARAMETER (maxdsets = 100)	! maximum # of data sets simultaneously
+	PARAMETER (maxstepfiles = 5000)	! # of files with time step data (up from 500 12/02)
+	PARAMETER (maxvars = 2000)	! max # of ALL vars *parmchg: now
+	PARAMETER (maxvar2 = 2*maxvars)	! max # *2, for dimension equivalenced to real*8 arrays
+	PARAMETER (maxvarfiles = 500)	! # of files with time step data
+	PARAMETER (maxaux = 50)		! max # of ALL auxiliary sets
+!	PARAMETER (max_grids = 60)	! max # of grids *parmchg: pre 7/92
+!	PARAMETER (max_grids = 200)	! max # of grids *parmchg: pre 11/95
+!	PARAMETER (max_grids = 500)	! max # of **static** grids: pre 7/99
+!	PARAMETER (max_grids = 1000)	! max # of **static** grids: pre 3/00
+	PARAMETER (max_grids = 500)	! max # of **static** grids
+!	PARAMETER (num_dyn_grids = 100)! max # of "implicit" grids: pre 5/00
+	PARAMETER (num_dyn_grids = 500)! max # of "implicit" grids
+	PARAMETER (max_dyn_grids = max_grids + num_dyn_grids)
+	PARAMETER (tmp_grid_hook = max_dyn_grids + 1)
+	PARAMETER (grid_ceiling  = tmp_grid_hook )
+!	PARAMETER (max_lines = 100)	! max # of lines *parmchg: pre 7/92
+!	PARAMETER (max_lines = 200)	! max # of lines *parmchg: pre 7/97
+!	PARAMETER (max_lines = 500)	! max # of lines: pre 7/99
+!	PARAMETER (max_lines = 2500)	! max # of lines: pre 3/00
+	PARAMETER (max_lines = 1000)	! max # of *static* lines
+!	PARAMETER (num_dyn_lines = 100)! max # of *dynamic* lines: pre 3/00
+	PARAMETER (num_dyn_lines = 1500)! max # of *dynamic* lines
+	PARAMETER (max_dyn_lines = max_lines + num_dyn_lines)
+	PARAMETER (tmp_line_hook = max_dyn_lines + 1)
+	PARAMETER (line_ceiling  = tmp_line_hook )
+!	PARAMETER (maxlinestore = 10000)! max # of coords *parmchg: pre 7/92
+!	PARAMETER (maxlinestore = 20000)! max # of coords *parmchg: pre 10/95
+!	PARAMETER (maxlinestore = 50000)! max # of coords *parmchg: pre 7/97
+!	PARAMETER (maxlinestore = 100000)! max # of coords : pre 7/99
+!	PARAMETER (maxlinestore = 250000)! max # of coords 
+!	PARAMETER (maxlinestore = 500000)! max # of coords : temporary!!!
+	PARAMETER (maxlinestore = 750000)! max # of coords 
+	PARAMETER (maxgridfiles = 10)	! maximum number of grids
+	PARAMETER (max_axis_orients = 9)! maximum number of axis orients
+	PARAMETER (num_aux = 6)		! number of aux_modnum's in descriptor
+	PARAMETER (num_parm = 15)	! number of add_parm's in descriptor
+	PARAMETER (num_gridfiles = 6)	! number of grid_filenames in descript.
+	PARAMETER (nferdims = 6)	! number of dimensions in Ferret grids.
diff --git a/fmt/cmn/tmap_dset.parm b/fmt/cmn/tmap_dset.parm
new file mode 100644
index 0000000..a52706c
--- /dev/null
+++ b/fmt/cmn/tmap_dset.parm
@@ -0,0 +1,184 @@
+*TMAP_DSET.PARM
+*
+* parameters used in "TMAP-formatted" data sets
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 0.01 - 11/21/88 - Changed variable initialization to char_initXX
+* revision 0.02 - 3/99 - *kob* added char_init64
+* revision 0.03 - 4/99 - *kob* added char_init256
+* V500 - 7/99 *sh* ==> changed char_init to "%%" so that all of the
+*			char_init*N are effectively the same definition
+* V581 - 3/05 *acm* add char_init_1024
+* V68  *acm* 1/12 Real variables should be declared REAL (conversion to double prec.)
+
+
+* codes for data sets
+	INTEGER		set_not_open,set_open,file_not_open
+	PARAMETER      (set_not_open = -9)	! shows available set storage
+	PARAMETER      (set_open = -19)		! shows available set storage
+	PARAMETER      (file_not_open = -7)	! shows data file not open
+
+* codes for end of namelist blocks
+	CHARACTER*4	end_of_aux
+	CHARACTER*8	end_of_variables
+	CHARACTER*40	end_of_stepfiles, end_of_varfiles
+	CHARACTER*60	end_of_grids
+	PARAMETER	(end_of_variables = '**END OF VARS**')
+	PARAMETER	(end_of_aux = '**END OF AUX**')
+	PARAMETER	(end_of_stepfiles = '**END OF STEPFILES**')
+	PARAMETER	(end_of_varfiles = '**END OF VARFILES**')
+	PARAMETER	(end_of_grids = '**END OF GRIDS**')
+
+* codes for common block initialization
+	CHARACTER*80	char_init
+	CHARACTER*20	sevens
+	CHARACTER	char_init01*01, char_init02*02, char_init04*04,
+     .			char_init08*08,	char_init12*12, char_init16*16,
+     .			char_init20*20,	char_init23*23, char_init24*24,
+     .			char_init30*30, char_init40*40, char_init60*60,
+     .			char_init64*64, char_init80*80, char_init128*128,
+     .                  char_init256*256, char_init512*512, 
+     .                  char_init1024*1024
+	INTEGER*2	int2_init
+	INTEGER*4	int4_init
+	REAL		real4_init
+	REAL*8		real8_init
+	PARAMETER	(sevens = '77777777777777777777')
+! changed this definition because use of char_init and char_initN was
+! inconsistent in the code. This way makes all the definitions the same
+! (except char_init01)
+!	PARAMETER	(char_init = sevens//sevens//sevens//sevens)
+	PARAMETER	(char_init = '%%')
+	PARAMETER	(char_init01 = char_init)
+	PARAMETER	(char_init02 = char_init)
+	PARAMETER	(char_init04 = char_init)
+	PARAMETER	(char_init08 = char_init)
+	PARAMETER	(char_init12 = char_init)
+	PARAMETER	(char_init16 = char_init)
+	PARAMETER	(char_init20 = char_init)
+	PARAMETER	(char_init23 = char_init)
+	PARAMETER	(char_init24 = char_init)
+	PARAMETER	(char_init30 = char_init)
+	PARAMETER	(char_init40 = char_init)
+	PARAMETER	(char_init60 = char_init)
+	PARAMETER	(char_init64 = char_init)
+	PARAMETER	(char_init80 = char_init)
+	PARAMETER	(char_init128= char_init)
+	PARAMETER	(char_init256= char_init)
+	PARAMETER	(char_init512= char_init)
+	PARAMETER	(char_init1024= char_init)
+	PARAMETER	(int2_init = -7777)
+	PARAMETER	(int4_init = -7777)
+	PARAMETER	(real4_init = -7.77E-07)
+	PARAMETER	(real8_init = -7.77E-07)
+	
+* record length parameters
+	INTEGER		default_reclen,max_reclen,max_tapereclen
+	PARAMETER      (default_reclen = 162,	! for GFDL Phil/Seig output
+     .			max_reclen = 4095,	! VMS restriction
+     .			max_tapereclen = 2499)	! VMS restriction
+
+* bad/missing data indicators
+	REAL		bad_r4
+	REAL*8		bad_r8
+	PARAMETER	(bad_r4 = -1.E34 , bad_r8 = -1.E34)
+
+* zero representations
+#ifdef ACCEPTS_BYTE_DECLARATION
+	BYTE			i1zero
+#else
+	INTEGER*1		i1zero
+#endif
+	INTEGER		i4zero
+	PARAMETER	(i1zero = 0, i4zero = 0)
+
+* file format codes
+	INTEGER		GFDL_3D,pacific_grids,model_output
+	CHARACTER*2	grids_at_times,time_series
+	CHARACTER*4	pds_type_gt,pds_type_ts,pds_type_ez
+#ifdef ACCEPTS_BYTE_DECLARATION
+	BYTE			regular,irregular
+#else
+	INTEGER*1		regular,irregular
+#endif
+	PARAMETER	(grids_at_times = 'GT',
+     .			 time_series = 'TS',
+     .			 model_output = 1,
+     .			 GFDL_3D = 1,
+     .			 pacific_grids = 1,
+     .			 regular = 1,
+     .			 irregular = 2,
+     .			 pds_type_gt = '  GT',
+     .			 pds_type_ts = '  TS',
+     .			 pds_type_ez = '  EZ' )
+
+* codes for heading records
+	INTEGER		plogo,ptitl,pform,pback,pmess,psumm,pvari,
+     .			pgrid,pcomm,pindx,pxtra,nbefore_vari
+	PARAMETER      (plogo = 1,
+     .			ptitl = 2,
+     .			pform = 3,
+     .			pback = 4,
+     .			pmess = 5,
+     .			psumm = 6,
+     .			pvari = 7,
+     .			pcomm = 8,
+     .			pgrid = 9,
+     .			pindx = 10,
+     .			pxtra = 11)
+	PARAMETER	(nbefore_vari = 6)	! records preceeding VARI recs
+
+* codes for variables
+	INTEGER		ptemp,psalt,pu,pv,pw,ptaux,ptauy,ppsi,pairt,
+     .			ptstar_s, ptstar_n, psstar_s, psstar_n
+	PARAMETER      (ptemp = 1,
+     .			psalt = 2,
+     .			pu    = 3,
+     .			pv    = 4,
+     .			pw    = 5,
+     .			ptaux = 6,
+     .			ptauy = 7,
+     .			ppsi  = 8,
+     .			pairt = 9,
+     .			ptstar_s = 10,
+     .			ptstar_n = 11,
+     .			psstar_s = 12,
+     .			psstar_n = 13 )
+
+* codes for standard grids and "No defining grid error"
+	INTEGER		pps1dxt,pps1dyt,pps1dzb,pps3dtemp,pps3duv,
+     .			pps3dw,	pps1dxv,pps1dyv,pps1dz, pps2dtemp,
+     .			pps2duv
+	INTEGER		no_grid_err
+	PARAMETER      (pps1dxt   = 1,
+     .			pps1dyt   = 2,
+     .			pps1dzb   = 3,
+     .			pps1dxv   = 4,
+     .			pps1dyv   = 5,
+     .			pps1dz    = 6,
+     .			pps3dtemp = 7,
+     .			pps3duv   = 8,
+     .			pps3dw    = 9,
+     .			pps2dtemp = 10,
+     .			pps2duv   = 11)
+	PARAMETER      (no_grid_err = -1)
+
+* codes used at time steps
+	CHARACTER*4	step_code
+	INTEGER		nintro_recs
+	PARAMETER	(nintro_recs = 1 , step_code = 'STEP')
+
+* codes used for time<->date conversion
+	INTEGER		to_year, to_month, to_day, to_hour, to_minute,
+     .			to_second, full_prec
+	PARAMETER	(to_year	= 6,
+     .			 to_month	= 5,
+     .			 to_day		= 4,
+     .			 to_hour	= 3,
+     .			 to_minute	= 2,
+     .			 to_second	= 1,
+     .			 full_prec	= 2)
+
+* codes for auxiliary data sets
+	INTEGER		main_set
+	PARAMETER	(main_set	= 0)
diff --git a/fmt/cmn/tmap_dtypes.parm b/fmt/cmn/tmap_dtypes.parm
new file mode 100644
index 0000000..8d18ca1
--- /dev/null
+++ b/fmt/cmn/tmap_dtypes.parm
@@ -0,0 +1,21 @@
+* V530 *sh* 11/00 - data types (more general than needed at time of writing)
+
+* these must identically match the declarations in ferret.parm
+
+* data types
+        INTEGER         ptype_native,
+     .                  ptype_float,
+     .                  ptype_int4,
+     .                  ptype_int2,
+     .                  ptype_int1,
+     .                  ptype_char,
+     .                  ptype_string,
+     .                  ptype_double
+        PARAMETER     ( ptype_native = 0,
+     .                  ptype_float = 1,
+     .                  ptype_int4 = 2,
+     .                  ptype_int2 = 3,
+     .                  ptype_int1 = 4,
+     .                  ptype_char = 5,
+     .                  ptype_string = 6,
+     .                  ptype_double = 7 )
diff --git a/fmt/cmn/tmap_errors.parm b/fmt/cmn/tmap_errors.parm
new file mode 100644
index 0000000..1612b16
--- /dev/null
+++ b/fmt/cmn/tmap_errors.parm
@@ -0,0 +1,111 @@
+* TMAP_ERRORS.PARM
+*
+* error code PARAMETERS pertaining to TMAP file formats
+* error coding:
+*	pspecial+1--> pregular	           - errors requiring special action
+*       pregular+1--> pregular+num_regular - regular error messages
+*	pcdferr+1 --> pcdferr+pcdferrmax   - netCDF error messages
+
+! huh ? *sh* 2/92 - leftover, incorrect coding description, below ??
+!*	pspecial+1--> pnofile	- error codes requiring special action
+!*	pnofile+1 --> pwfile	- error codes without associated filenames
+!*	pwfile +1 --> ...	- error codes with    associated filenames
+*
+* revision 0.00 - 05/07/87 - By Mark Verschell for PMEL/TMAP
+* revision 0.01 - 05/04/88 - *sh* added merr_no_action
+* V600 6/06 *acm* Attribute control. Add new merr_attalready
+* V600 6/06 *acm* Attribute control. Add new merr_badfileatt
+* V600 7/06 *acm* New merr_nc_open for errors opening NC datasets
+* V604 6/07 *acm* New merr_remote_open for errors opening remote datasets
+* V683 10/10*acm* New merr_read_interrupt for user-interrupt reading netCDF/OPeNDAP data
+
+* internally used PARAMETERS:
+	INTEGER		num_special,num_regular,pspecial,pregular,
+     .			no_stepfile, no_varfile, no_descfile, no_varid,
+     .	                pcdferr, pcdferrmax, nf_interrupt
+	CHARACTER*1	no_errstring
+	PARAMETER      (num_special	= 3,
+     .			num_regular	= 47,
+     .			pspecial	= 2,	! avoid 0,1 as too special
+     .			pregular	= 200,
+     .			pcdferr		= 1000,
+     .			pcdferrmax	= 500,
+     .			no_errstring	= ' ',
+     .			no_stepfile	= -991,
+     .			no_varfile	= -991,
+     .			no_varid	= -9,
+     .			no_descfile	= -999,
+     .			nf_interrupt	= 900)  ! match this with NC_INTERRUPT in NCF_Util.h
+
+* special errors
+	INTEGER		 merr_ok,  merr_erreq,  merr_interrupt, merr_no_action
+	PARAMETER      (merr_ok		= 1 + pspecial,
+     .			merr_erreq	= 1 + merr_ok,
+     .			merr_interrupt	= 1 + merr_erreq,
+     .			merr_no_action	= 1 + merr_interrupt )
+
+* regular errors
+	INTEGER		merr_notsupport, merr_filpos, merr_tstep,
+     .			merr_expnum, merr_modnum, merr_notmounted,
+     .			merr_stepform, merr_eof, merr_nmlerr,
+     .			merr_unkvar, merr_unkgrid, merr_unkline,
+     .			merr_stpmtch, merr_filim, merr_nostep,
+     .			merr_dsetlim, merr_varlim, merr_outofgrid,
+     .			merr_badsubscr, merr_auxlim, merr_grfillim,
+     .			merr_gridlim, merr_linelim, merr_keynf,
+     .			merr_gridpredef, merr_lineundef, merr_linepredef,
+     .			merr_badgriddef, merr_badlinedef,
+     .			merr_linstorlim, merr_nocoordlin, merr_unktype,
+     .			merr_syntax, merr_undefline,merr_notimeinfo,
+     .			merr_varform, merr_varmtch, merr_badtimedef,
+     .			merr_dsetnf, merr_stepnf, merr_badcolmn,
+     .                  merr_attalready, merr_badfileatt, merr_nc_open,
+     .                  merr_remote_open, merr_chunk_spec, merr_read_interrupt
+	PARAMETER      (merr_notsupport	= 1 + pregular,
+     .			merr_filpos	= 1 + merr_notsupport,
+     .			merr_tstep	= 1 + merr_filpos,
+     .			merr_expnum	= 1 + merr_tstep,
+     .			merr_modnum	= 1 + merr_expnum,
+     .			merr_notmounted	= 1 + merr_modnum,
+     .			merr_stepform   = 1 + merr_notmounted,
+     .			merr_eof	= 1 + merr_stepform,
+     .			merr_nmlerr	= 1 + merr_eof,
+     .			merr_unkvar	= 1 + merr_nmlerr,
+     .			merr_unkgrid	= 1 + merr_unkvar,
+     .			merr_unkline	= 1 + merr_unkgrid,
+     .			merr_stpmtch	= 1 + merr_unkline,
+     .			merr_filim	= 1 + merr_stpmtch,
+     .			merr_nostep	= 1 + merr_filim,
+     .			merr_dsetlim	= 1 + merr_nostep,
+     .			merr_varlim     = 1 + merr_dsetlim,
+     .			merr_outofgrid	= 1 + merr_varlim,
+     .			merr_badsubscr  = 1 + merr_outofgrid,
+     .			merr_auxlim	= 1 + merr_badsubscr,
+     .			merr_grfillim	= 1 + merr_auxlim,
+     .			merr_gridlim	= 1 + merr_grfillim,
+     .			merr_linelim	= 1 + merr_gridlim,
+     .			merr_keynf	= 1 + merr_linelim )
+	PARAMETER (
+     .			merr_gridpredef	= 1 + merr_keynf,
+     .			merr_lineundef	= 1 + merr_gridpredef,
+     .			merr_linepredef	= 1 + merr_lineundef,
+     .			merr_badgriddef	= 1 + merr_linepredef,
+     .			merr_badlinedef	= 1 + merr_badgriddef,
+     .			merr_badtimedef	= 1 + merr_badlinedef,
+     .			merr_linstorlim	= 1 + merr_badtimedef,
+     .			merr_nocoordlin	= 1 + merr_linstorlim,
+     .			merr_unktype	= 1 + merr_nocoordlin,
+     .			merr_syntax	= 1 + merr_unktype,
+     .			merr_undefline	= 1 + merr_syntax,
+     .			merr_notimeinfo	= 1 + merr_undefline,
+     .			merr_varform	= 1 + merr_notimeinfo,
+     .			merr_varmtch	= 1 + merr_varform,
+     .			merr_dsetnf	= 1 + merr_varmtch,
+     .			merr_stepnf	= 1 + merr_dsetnf,
+     .			merr_badcolmn	= 1 + merr_stepnf,
+     .			merr_attalready	= 1 + merr_badcolmn,
+     .			merr_badfileatt = 1 + merr_attalready,
+     .                  merr_nc_open    = 1 + merr_badfileatt,
+     .                  merr_remote_open = 1 + merr_nc_open,
+     .                  merr_chunk_spec = 1 + merr_remote_open,
+     .                  merr_read_interrupt = 1 + merr_chunk_spec)
diff --git a/fmt/cmn/xalt_messages.cmn b/fmt/cmn/xalt_messages.cmn
new file mode 100644
index 0000000..337ea56
--- /dev/null
+++ b/fmt/cmn/xalt_messages.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XALT_MESSAGES.CMN_TEXT'
+
+	EXTERNAL	XALT_MESSAGES_DATA
diff --git a/fmt/cmn/xalt_messages.cmn_text b/fmt/cmn/xalt_messages.cmn_text
new file mode 100644
index 0000000..83af830
--- /dev/null
+++ b/fmt/cmn/xalt_messages.cmn_text
@@ -0,0 +1,9 @@
+	COMMON /XALT_MESSAGES / alt_messages, alt_nlines, alt_text
+
+* parameter definition:
+	INTEGER	max_alt_text
+	PARAMETER ( max_alt_text = 15 )
+
+	LOGICAL	alt_messages
+	INTEGER	alt_nlines
+	CHARACTER*200	alt_text(max_alt_text)
diff --git a/fmt/cmn/xbuild_grids.cmn b/fmt/cmn/xbuild_grids.cmn
new file mode 100644
index 0000000..408481e
--- /dev/null
+++ b/fmt/cmn/xbuild_grids.cmn
@@ -0,0 +1,26 @@
+* common xbuild_grids.cmn
+
+* common to assist with processing new grid definitions
+* this could be folded into xgrid.cmn
+
+* V510 -- grid building is now donw with dynamic grids and axes
+
+	INTEGER     max_temp_grid
+	PARAMETER ( max_temp_grid = 100 )
+
+
+
+!	INTEGER firstax, lastax, firstgrid, lastgrid, orig_line_mem
+	INTEGER orig_line_mem,
+     .		num_tmp_grids,
+     .		tmp_nam_ptr(max_grids:grid_ceiling)
+
+	COMMON /XBUILD_GRIDS/
+!     .		firstax,
+!     .		lastax,
+!     .		firstgrid,
+!     .		lastgrid,
+     .		orig_line_mem,
+     .		num_tmp_grids,
+     .		tmp_nam_ptr
+
diff --git a/fmt/cmn/xcdferror.cmn b/fmt/cmn/xcdferror.cmn
new file mode 100644
index 0000000..5514868
--- /dev/null
+++ b/fmt/cmn/xcdferror.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XCDFERROR.CMN_TEXT'
+
+	EXTERNAL	XCDFERROR_DATA
diff --git a/fmt/cmn/xcdferror.cmn_text b/fmt/cmn/xcdferror.cmn_text
new file mode 100644
index 0000000..d8c5cb1
--- /dev/null
+++ b/fmt/cmn/xcdferror.cmn_text
@@ -0,0 +1,8 @@
+* error messages for netCDF error codes
+* *sh* 3/92
+* Changed range of cdferrmsg to -128:128 to account
+* for v3 change in netCDF parameters. Sigh.
+* *js* 1.99
+
+	CHARACTER*36 cdferrmsg(-128:128)
+	COMMON / XCDFERROR / cdferrmsg
diff --git a/fmt/cmn/xdefer_coords.cmn b/fmt/cmn/xdefer_coords.cmn
new file mode 100644
index 0000000..df19791
--- /dev/null
+++ b/fmt/cmn/xdefer_coords.cmn
@@ -0,0 +1,32 @@
+* common xdefer_coords.cmn
+
+* common to assist with deferred writing of axis coordinate
+* (performance issue for netCDF writes)
+
+* V530 *sh* 12/00
+
+
+*** NOTE: parameter max_deferred_axes should be approx 2X  the value of
+*	the Ferret parameter max_exp
+
+	INTEGER     max_deferred_axes
+	PARAMETER ( max_deferred_axes = 400 )
+
+	INTEGER
+     .		dfr_num,
+     .		dfr_cdaxis,
+     .		dfr_grid,
+     .		dfr_idim,
+     .		dfr_lo,
+     .		dfr_hi,
+     .		dfr_axis_type
+
+	COMMON /XDEFER_COORDS/
+     .		dfr_num,
+     .		dfr_cdaxis(max_deferred_axes),
+     .		dfr_grid(max_deferred_axes),
+     .		dfr_idim(max_deferred_axes),
+     .		dfr_lo(max_deferred_axes),
+     .		dfr_hi(max_deferred_axes),
+     .		dfr_axis_type(max_deferred_axes)
+
diff --git a/fmt/cmn/xdiag_ctrl.cmn b/fmt/cmn/xdiag_ctrl.cmn
new file mode 100644
index 0000000..c5a57e8
--- /dev/null
+++ b/fmt/cmn/xdiag_ctrl.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XDIAG_CTRL.CMN_TEXT'
+
+	EXTERNAL	XDIAG_CTRL_DATA
diff --git a/fmt/cmn/xdiag_ctrl.cmn_text b/fmt/cmn/xdiag_ctrl.cmn_text
new file mode 100644
index 0000000..6a9e858
--- /dev/null
+++ b/fmt/cmn/xdiag_ctrl.cmn_text
@@ -0,0 +1,5 @@
+* variables to control TMAP diagnostic messages
+* *sh* 2/92 added ds_dset_type 
+	COMMON /XDIAG_CTRL/ tmap_diag_on, ds_dset_type
+	LOGICAL tmap_diag_on
+	CHARACTER*4 ds_dset_type
diff --git a/fmt/cmn/xdset_info.cd_equiv b/fmt/cmn/xdset_info.cd_equiv
new file mode 100644
index 0000000..4bada60
--- /dev/null
+++ b/fmt/cmn/xdset_info.cd_equiv
@@ -0,0 +1,28 @@
+* equivalences to COMMON/XDSET_INFO/ used by netCDF files 
+
+* revision 0.00 - 2/92 - by Steve Hankin for  PMEL/TMAP
+* 2/93 *sh* added cd_what_isit for EPIC compatibility
+* 9/95 *kob* added mc_init_stepfile for mutli-file capability
+* 10/04*acm* fix for bug 982; same var name in multiple MC datasets
+*            mc_init_stepfile needs to know which file it is from.
+
+	LOGICAL     cd_scaled(maxvars)
+	INTEGER     cd_varid(maxvars),
+     .	            cd_stepfile(maxdsets),
+     .		    mc_init_stepfile(maxdsets)
+	REAL	    cd_add_offset(maxvars),
+     .	            cd_scale_factor(maxvars)	  
+	CHARACTER*4 cd_dset_code(maxdsets)   ! unique code made from dset name
+	CHARACTER*4 cd_what_isit(num_aux, maxdsets)
+    
+	EQUIVALENCE (cd_scaled,        ds_ndataperrec),
+     .	            (cd_varid,         ds_aux_set_num),
+     .	            (cd_add_offset,    ds_nrecpervar ),
+     .	            (cd_scale_factor,  ds_nrecb4var  ),
+     .		    (cd_stepfile,      ds_ntuple     ),
+     .		    (cd_dset_code,     ds_prog_rev   ),
+     .		    (cd_what_isit,     ds_aux_modnum ),
+     .		    (mc_init_stepfile, ds_aux_modnum )
+
+* still available: INTEGER*2 ds_npospervar(maxvars)
+*          and     cd_what_isit(*,dset) - only (1,dset) used by EPIC
diff --git a/fmt/cmn/xdset_info.cmn b/fmt/cmn/xdset_info.cmn
new file mode 100644
index 0000000..6c36f91
--- /dev/null
+++ b/fmt/cmn/xdset_info.cmn
@@ -0,0 +1,5 @@
+* information obtained from reading of the descriptor files of data sets
+
+	INCLUDE		'TMAP_FORMAT:XDSET_INFO.CMN_TEXT'
+
+	EXTERNAL	 XDSET_INFO_DATA
diff --git a/fmt/cmn/xdset_info.cmn_text b/fmt/cmn/xdset_info.cmn_text
new file mode 100644
index 0000000..aa5ea92
--- /dev/null
+++ b/fmt/cmn/xdset_info.cmn_text
@@ -0,0 +1,131 @@
+* information obtained from reading of the descriptor files of data sets
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for  PMEL/TMAP
+* revision 0.01 - 07/07/87 - removed revision and increased size of type/format
+* revision 1.00 - 08/18/87 - completely redone
+* revision 1.01 - 10/30/87 - removed ds_make_dscrp_rev
+* revision 1.02 - 02/08/89 - removed ds_var_modline
+* revision 1.03 - 04/24/91 - *sh* increased ds_name and ds_des_name lengths
+*	                   - moved real*8 vars to beginning for alignment
+* revision 1.04 - 05/11/92 - *sh* increased ds_var_code string length
+* revision 1.05 - 3/99 - *kob* increase ds_var_code and ds_var_units to
+*			       length 64 and ds_var_title to 128
+* revision 1.06 - 4/99 - *kob* increase size of ds_des_name for lengthy DODS
+*			  datasets
+* V530 *sh* 10/00 - added ds_var_type and ds_file_info_ptr
+* revision 1.07 - 12/00 - *acm* add line_cal_name for alternate calendar axes.	
+* V540 *acm 10/01 - increase length of ds_name 
+* V552 *acm* 5/03 increase ds_var_code to 128 characters
+*                 NOTE this is the max: NetCDF parameter NC_MAX_NAME = 128
+* V581 *acm* 3/05 increase ds_title, ds_mod_title to 1024
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* v62  *acm*10/08 increase length of ds_message 
+* V68 *acm*1/12 increase ds_name, ds_des_name to 2048
+* V68  *acm* 1/12 Real variables should be declared REAL (conversion to double prec.)
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+*                 need tmap_dims.param with the definition of nferdims.
+
+	COMMON/XDSET_INFO/
+     .		ds_1step(maxdsets),ds_lastep(maxdsets),
+     .		ds_delstep(maxdsets),
+     .		ds_file_info_ptr(maxdsets),
+     .		ds_type(maxdsets),ds_format(maxdsets),
+     .		ds_source_class(maxdsets),ds_source(maxdsets),
+     .		ds_subsource(maxdsets),ds_prog_rev(maxdsets),
+**************************************************************************
+     .		ds_expnum(maxdsets),ds_modnum(maxdsets),
+     .		ds_title(maxdsets),ds_mod_title(maxdsets),
+     .		ds_forcing_set(maxdsets),ds_t0time(maxdsets),
+     .		ds_time_unit(maxdsets),ds_time_modulo(maxdsets),
+     .		ds_ntegrate_tstep(maxdsets),ds_ntuple(maxdsets),
+     .		ds_time_run(maxdsets),ds_aux_modnum(num_aux,maxdsets),
+     .		ds_parm_name(num_parm,maxdsets),
+     .		ds_parm_text(num_parm,maxdsets),
+     .		ds_cal_name(maxdsets),
+**************************************************************************
+     .		ds_alert_on_open(maxdsets),ds_alert_on_output(maxdsets),
+     .		ds_message(maxdsets),
+**************************************************************************
+     .
+     .          ds_var_code_head,
+     .          ds_var_code_padding,
+     .		ds_var_code(maxvars),
+     .
+     .          ds_var_title(maxvars),
+     .		ds_var_titl_mod(maxvars),ds_var_units(maxvars),
+     .		ds_grid_number(maxvars),ds_missing_flag(maxvars),
+     .          ds_var_scale(maxvars), ds_var_off(maxvars),
+     .		ds_bad_flag(maxvars),ds_ordering(nferdims,maxvars),
+     .		ds_grid_start(nferdims,maxvars),ds_grid_end(nferdims,maxvars),
+     .	 	ds_var_type(maxvars),
+     .		ds_precision(maxvars),
+**************************************************************************
+     .		ds_aux_set_num(maxvars), ds_var_scaleit(maxvars),
+     .          is_mc,
+**************************************************************************
+     .		min_ds_tstart,max_ds_tend,ds_tdelta,
+**************************************************************************
+     .		ds_des_name(maxdsets),ds_name(maxdsets),
+     .		ds_open(maxdsets),
+     .		ds_accepts_remote(maxdsets), 
+     .		ds_hide(maxdsets), 
+     .		ds_regsteps(maxdsets), ds_basic_axes(6,maxdsets),
+     .		ds_time_axis(maxdsets),
+**************************************************************************
+     .		ds_ndataperrec(maxvars),ds_nrecpervar(maxvar2),
+     .		ds_nrecb4var(maxvar2),ds_var_setnum(maxvars),
+     .		ds_npospervar(maxvars),
+**************************************************************************
+     .          string_array_result1(maxvars)
+
+* "FORMAT RECORD"
+	CHARACTER*4	ds_type,ds_format,ds_prog_rev
+	CHARACTER*16	ds_source_class,ds_source,ds_subsource
+
+* "BACKGROUND RECORD"
+	CHARACTER*4	ds_expnum,ds_modnum,ds_aux_modnum
+	CHARACTER*16	ds_forcing_set
+	CHARACTER*20	ds_t0time,ds_time_run,ds_parm_name
+	CHARACTER*80	ds_parm_text
+	CHARACTER*1024	ds_title,ds_mod_title
+	INTEGER*4	ds_ntuple
+	LOGICAL		ds_time_modulo
+	REAL		ds_time_unit,ds_ntegrate_tstep
+	CHARACTER*32	ds_cal_name
+
+* "MESSAGE RECORD"
+	LOGICAL*2	ds_alert_on_open,ds_alert_on_output
+	CHARACTER*1024	ds_message
+
+* "VARIABLE RECORD (one record per file variable)
+	CHARACTER*1	ds_precision
+	CHARACTER*128	ds_var_code !NOTE this is the max: NetCDF param NC_MAX_NAME=128
+	CHARACTER*64	ds_var_units
+	CHARACTER*128	ds_var_title,ds_var_titl_mod
+	INTEGER*4	ds_grid_start,ds_grid_end,ds_grid_number,
+     .			ds_ordering
+	REAL		ds_bad_flag,ds_missing_flag
+*    - only in GT sets
+	INTEGER*4	ds_aux_set_num
+*    - only in TS sets
+	INTEGER*4	min_ds_tstart,max_ds_tend,ds_tdelta
+	INTEGER*4	ds_var_type
+        INTEGER         ds_var_code_head,
+     .                  ds_var_code_padding,
+     .                  string_array_result1
+
+* additional calculated or derived values pertaining to data sets
+	CHARACTER*2048	ds_name
+	CHARACTER*2048	ds_des_name
+	INTEGER*4	ds_open,ds_basic_axes,ds_time_axis
+	LOGICAL		ds_regsteps, ds_var_scaleit, is_mc, 
+     .			ds_accepts_remote, ds_hide
+	REAL*8		ds_1step,ds_lastep,ds_delstep,
+     .			ds_file_info_ptr
+        REAL            ds_var_scale, ds_var_off
+
+
+* additional calculated or derived values pertaining to variables
+	INTEGER*4	ds_ndataperrec,ds_nrecpervar,ds_nrecb4var,
+     .			ds_var_setnum
+	INTEGER*2	ds_npospervar
diff --git a/fmt/cmn/xerror_text.cmn b/fmt/cmn/xerror_text.cmn
new file mode 100644
index 0000000..e080658
--- /dev/null
+++ b/fmt/cmn/xerror_text.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XERROR_TEXT.CMN_TEXT'
+
+	EXTERNAL	XERROR_TEXT_DATA
diff --git a/fmt/cmn/xerror_text.cmn_text b/fmt/cmn/xerror_text.cmn_text
new file mode 100644
index 0000000..a2e20b0
--- /dev/null
+++ b/fmt/cmn/xerror_text.cmn_text
@@ -0,0 +1,4 @@
+	COMMON /XERROR_TEXT/		! text of error messages
+     .		msg_special(num_special),
+     .		msg_regular(num_regular)
+	CHARACTER*50 msg_special, msg_regular
diff --git a/fmt/cmn/xez_info.cmn b/fmt/cmn/xez_info.cmn
new file mode 100644
index 0000000..9cd62cc
--- /dev/null
+++ b/fmt/cmn/xez_info.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XEZ_INFO.CMN_TEXT'
+
+	EXTERNAL	XEZ_INFO_DATA
diff --git a/fmt/cmn/xez_info.cmn_text b/fmt/cmn/xez_info.cmn_text
new file mode 100644
index 0000000..25fd642
--- /dev/null
+++ b/fmt/cmn/xez_info.cmn_text
@@ -0,0 +1,9 @@
+* V530 *sh* 11/00 - added ftyp_name
+
+	COMMON/XEZ_INFO/
+     .			ez_mods,
+     .			ftyp_name
+
+	LOGICAL  ez_mods(maxdsets)
+
+	CHARACTER*16 ftyp_name(FTYP_NUM_TYPES)
diff --git a/fmt/cmn/xez_order.cmn_text b/fmt/cmn/xez_order.cmn_text
new file mode 100644
index 0000000..50881bc
--- /dev/null
+++ b/fmt/cmn/xez_order.cmn_text
@@ -0,0 +1,4 @@
+* Needs tmap_dims.parm for definition of nferdims
+	
+	INTEGER	eznn, ezii, ezorder
+	COMMON /XEZ_ORDER/ eznn(nferdims), ezii(nferdims), ezorder(nferdims)
diff --git a/fmt/cmn/xio.cmn b/fmt/cmn/xio.cmn
new file mode 100644
index 0000000..8c38d25
--- /dev/null
+++ b/fmt/cmn/xio.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XIO.CMN_TEXT'
+
+	EXTERNAL	XIO_DATA
diff --git a/fmt/cmn/xio.cmn_text b/fmt/cmn/xio.cmn_text
new file mode 100644
index 0000000..64398d5
--- /dev/null
+++ b/fmt/cmn/xio.cmn_text
@@ -0,0 +1,9 @@
+
+	COMMON/XIO/tohdlu,fmhdlu,fmhd2lu,tooplu,fmoplu,lunit_errors
+	INTEGER  tohdlu,fmhdlu,fmhd2lu,tooplu,fmoplu,lunit_errors
+* naming scheme:"to"=output unit
+*		"fm"=input unit("from")
+*		"hd"=heading file
+*		"op"=operator
+*		"lu"=logical unit
+
diff --git a/fmt/cmn/xio.parm b/fmt/cmn/xio.parm
new file mode 100644
index 0000000..cd0769e
--- /dev/null
+++ b/fmt/cmn/xio.parm
@@ -0,0 +1,8 @@
+* XIO.PARM
+*
+* XIO defines logical units for datainput/output
+
+	INTEGER	tooplu,fmoplu
+
+	PARAMETER	(tooplu  = 6)		!output to operator
+	PARAMETER	(fmoplu  = 5)		!input from operator
diff --git a/fmt/cmn/xmachine_byte.cmn b/fmt/cmn/xmachine_byte.cmn
new file mode 100644
index 0000000..dc1a877
--- /dev/null
+++ b/fmt/cmn/xmachine_byte.cmn
@@ -0,0 +1,24 @@
+* COMMON with information about the type of CPU which is currently active
+
+* note: since DECstation uses INTEGER*1 whereas VAX uses BYTE these declarations
+* are in different files for different machine types.
+* *kob* 2/92 (based on xmachine.cmn_text) - for SUN port
+
+* defines codes for cpu types
+* used to control floating point and integer conversions
+* "dec" = DECstation/MIPS
+
+	INTEGER	cptype_vax, cptype_dec, cptype_sun
+	PARAMETER	(cptype_vax = 0,
+     .			 cptype_dec = 1,
+     .			 cptype_sun = 2 )
+
+
+	COMMON /XMACHINE/
+     .				active_cpu	! local machine type
+
+!	INTEGER*1 active_cpu
+	BYTE      active_cpu
+
+
+
diff --git a/fmt/cmn/xmachine_int1.cmn b/fmt/cmn/xmachine_int1.cmn
new file mode 100644
index 0000000..c4d62a6
--- /dev/null
+++ b/fmt/cmn/xmachine_int1.cmn
@@ -0,0 +1,24 @@
+* COMMON with information about the type of CPU which is currently active
+
+* note: since DECstation uses INTEGER*1 whereas VAX uses BYTE these declarations
+* are in different files for different machine types.
+* *kob* 2/92 (based on xmachine.cmn_text) - for SUN port
+
+* defines codes for cpu types
+* used to control floating point and integer conversions
+* "dec" = DECstation/MIPS
+
+	INTEGER	cptype_vax, cptype_dec, cptype_sun
+	PARAMETER	(cptype_vax = 0,
+     .			 cptype_dec = 1,
+     .			 cptype_sun = 2 )
+
+
+	COMMON /XMACHINE/
+     .		active_cpu	! local machine type
+
+	INTEGER*1 active_cpu
+!	BYTE      active_cpu
+
+
+
diff --git a/fmt/cmn/xrisc_buff.cmn b/fmt/cmn/xrisc_buff.cmn
new file mode 100644
index 0000000..cb9bf8b
--- /dev/null
+++ b/fmt/cmn/xrisc_buff.cmn
@@ -0,0 +1,13 @@
+* XRISC - *sh* 2/1/91
+* RISC/FORTRAN compiler can't handle CHARACTER*(*) variables used in
+* character string concatenations ("//")
+* this common declares a buffer with a fixed length string in which to copy
+* the CHAR*(*) string
+
+	INTEGER     size_rbuff
+*	PARAMETER ( size_rbuff = 256 )
+	PARAMETER ( size_rbuff = 2048 )  ! Increased ferret 6.01 8/2006
+
+	COMMON/ XRISC_BUFF / len_rbuff, risc_buff
+	CHARACTER  risc_buff*(size_rbuff)
+	INTEGER    len_rbuff
diff --git a/fmt/cmn/xstep_files.cmn b/fmt/cmn/xstep_files.cmn
new file mode 100644
index 0000000..aef7de4
--- /dev/null
+++ b/fmt/cmn/xstep_files.cmn
@@ -0,0 +1,5 @@
+* COMMON with information about the files with data at time steps
+
+	INCLUDE		'TMAP_FORMAT:XSTEP_FILES.CMN_TEXT'
+
+	EXTERNAL	XSTEP_FILES_DATA
diff --git a/fmt/cmn/xstep_files.cmn_text b/fmt/cmn/xstep_files.cmn_text
new file mode 100644
index 0000000..c6d9e10
--- /dev/null
+++ b/fmt/cmn/xstep_files.cmn_text
@@ -0,0 +1,59 @@
+* COMMON with information about the files with data at time steps
+*
+* Also shares storage with info about VAR_FILES for timesteps.
+*
+* *sh* 3/91 - Unix/RISC port: added fp_convert and compress
+*      4/91 - increased size of sf_name to accomodate full path name
+* *kob*4/99 - further increase size of sf_name to accomodate full DODS
+*             path names
+* v5.81 *acm* 4/2005  Add sf_ndxs and sf_ndxe to use indices rather than timesteps
+*                     for indexing mc datasets in mc_read.
+
+	COMMON /XSTEP_FILES/
+     .				sf_name   	(maxstepfiles),	! names of 'em
+     .				sf_setnum 	(maxstepfiles),	! dataset #'s
+     .				sf_aux_set_num 	(maxstepfiles), ! aux set #'s
+     .				sf_nrecperstep	(maxstepfiles), ! # recs in step
+     .				sf_skip   	(maxstepfiles),	! leading recs
+     .				sf_1step  	(maxstepfiles),	! 1st time step
+     .				sf_lastep 	(maxstepfiles),	! last time step
+     .				sf_delta  	(maxstepfiles),	! del. time step
+     .				sf_reclen 	(maxstepfiles),	! record length
+     .				sf_valid  	(maxstepfiles),	! file ok flag
+     .				sf_lunit  	(maxstepfiles),	! unit # if open
+     .				sf_index  	(maxstepfiles),	! index
+     .				sf_regvars	(maxstepfiles),	! const # vars ?
+     .				sf_regtimes	(maxstepfiles),	! reg time inc ?
+     .				sf_cpu_type	(maxstepfiles),	! ieee ? vax ?
+     .				sf_compress	(maxstepfiles),	! compressed ?
+     .				vf_firstvar	(maxvarfiles),	! 1st var in set
+     .				vf_lastvar	(maxvarfiles),	! lst var in set
+     .				sf_ndxs  	(maxstepfiles),	! 1st time index
+     .				sf_ndxe 	(maxstepfiles)	! last time index
+
+	CHARACTER*2048	sf_name         ! same as s_filename in descript.def
+	CHARACTER*23	sf_index
+	INTEGER		sf_setnum,sf_aux_set_num,sf_skip,sf_lunit,
+     .			sf_reclen,sf_nrecperstep,sf_cpu_type,sf_ndxs,sf_ndxe
+	REAL*8		sf_1step,sf_lastep,sf_delta
+	LOGICAL*1	sf_valid,sf_regvars,sf_regtimes,
+     .			sf_compress
+
+	CHARACTER*512	vf_name(maxvarfiles)         ! ???same as s_filename in descript.def
+	CHARACTER*23	vf_index(maxvarfiles)
+	INTEGER		vf_setnum(maxvarfiles),vf_firstvar,
+     .			vf_lastvar,vf_skip(maxvarfiles),
+     .			vf_lunit(maxvarfiles),vf_reclen(maxvarfiles),
+     .                  vf_cpu_type(maxvarfiles)
+	LOGICAL*1	vf_valid(maxvarfiles),
+     .			vf_compress(maxvarfiles)
+
+	EQUIVALENCE	(sf_name,vf_name)
+	EQUIVALENCE	(sf_setnum,vf_setnum)
+	EQUIVALENCE	(sf_skip,vf_skip)
+	EQUIVALENCE	(sf_reclen,vf_reclen)
+	EQUIVALENCE	(sf_valid,vf_valid)
+	EQUIVALENCE	(sf_lunit,vf_lunit)
+	EQUIVALENCE	(sf_index,vf_index)
+	EQUIVALENCE	(sf_cpu_type,vf_cpu_type)
+	EQUIVALENCE	(sf_compress,vf_compress)
diff --git a/fmt/cmn/xsys_names.cmn b/fmt/cmn/xsys_names.cmn
new file mode 100644
index 0000000..32125ee
--- /dev/null
+++ b/fmt/cmn/xsys_names.cmn
@@ -0,0 +1,3 @@
+	INCLUDE		'TMAP_FORMAT:XSYS_NAMES.CMN_TEXT'
+
+	EXTERNAL	XSYS_NAMES_DATA
diff --git a/fmt/cmn/xsys_names.cmn_text b/fmt/cmn/xsys_names.cmn_text
new file mode 100644
index 0000000..169b957
--- /dev/null
+++ b/fmt/cmn/xsys_names.cmn_text
@@ -0,0 +1,7 @@
+* names of system-wide logicals or environment variables
+	COMMON /XSYS_NAMES/ tmap_sets, tmap_tsteps, tmap_grids,
+     .                      tmap_model_runs
+
+	CHARACTER*12 tmap_sets, tmap_tsteps, tmap_grids
+	CHARACTER*16 tmap_model_runs
+
diff --git a/fmt/cmn/xtm_grid.cmn b/fmt/cmn/xtm_grid.cmn
new file mode 100644
index 0000000..4f107a8
--- /dev/null
+++ b/fmt/cmn/xtm_grid.cmn
@@ -0,0 +1,4 @@
+* pre-defined and user-defined grids for PROGRAM GFDL
+	INCLUDE		'TMAP_FORMAT:XTM_GRID.CMN_TEXT'
+
+	EXTERNAL	XGT_GRID_DATA
diff --git a/fmt/cmn/xtm_grid.cmn_text b/fmt/cmn/xtm_grid.cmn_text
new file mode 100644
index 0000000..896a08b
--- /dev/null
+++ b/fmt/cmn/xtm_grid.cmn_text
@@ -0,0 +1,103 @@
+* 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
+
+	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_has_edges, line_keep_flag,
+     .			line_keep_flag, line_shift_origin, line_fixname, line_write
+	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_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
+
diff --git a/fmt/cmn/xunits.cmn b/fmt/cmn/xunits.cmn
new file mode 100644
index 0000000..66e531a
--- /dev/null
+++ b/fmt/cmn/xunits.cmn
@@ -0,0 +1,4 @@
+* COMMON with units and units_codes and translations
+	INCLUDE		'TMAP_FORMAT:XUNITS.CMN_TEXT'
+
+	EXTERNAL	XUNITS_DATA
diff --git a/fmt/cmn/xunits.cmn_text b/fmt/cmn/xunits.cmn_text
new file mode 100644
index 0000000..3deb7b3
--- /dev/null
+++ b/fmt/cmn/xunits.cmn_text
@@ -0,0 +1,48 @@
+* XUNITS.CMN - unit names and conversion factors
+*
+* revision 0.00 - 04/15/88 - 
+* added pun_millibars and pun_decibars 12/19/94
+*
+
+* 9/26/95: interchanged pun_meters (was 3) with pun_millibars (was 9)
+*	   because TM_UNIT_ID was interpreting "mbar" as "mters"
+*	   ==> required changes to xunits_data.F, too
+* 3/5/01 acm  add  more units for alternative calendar types:
+*             secs per 365.25 days (change xunits_data.F too)
+*             also add all types of months: 1/12 of seconds/year 
+
+	INTEGER		pun_1st_time,
+     .			pun_last_time,
+     .			pun_1st_len,
+     .			pun_last_len,
+     .			pun_1st_unit,
+     .			pun_last_unit,
+     .			pun_num_alt,
+     .			pun_degrees,
+     .			pun_meters,
+     .			pun_millibars,
+     .			pun_decibars
+
+	PARAMETER     ( pun_1st_time  = -16,
+     .			pun_last_time = -1,
+     .			pun_1st_len   = 1,
+     .			pun_last_len  = 15, 
+     .			pun_1st_unit  = pun_1st_time,
+     .			pun_last_unit = pun_last_len,
+     .			pun_num_alt   = 20,
+     .			pun_degrees   = 4,
+     .			pun_meters    = 9,	! formerly 3
+     .			pun_millibars = 3,	! formerly 9
+     .			pun_decibars  = 10 )
+
+
+	
+	INTEGER		un_alt_subsc( pun_num_alt )
+	REAL		un_convert  ( pun_1st_unit:pun_last_unit )
+	CHARACTER*12	un_name     ( pun_1st_unit:pun_last_unit ),
+     .			un_alt_name ( pun_num_alt )
+
+	COMMON/ XUNIT /	un_alt_subsc,		! subscripts of unit names
+     .			un_convert,		! conversion factors
+     .			un_name,		! unit names
+     .			un_alt_name		! alternative unit names
diff --git a/fmt/src/LIB_NAME b/fmt/src/LIB_NAME
new file mode 100644
index 0000000..68af70c
--- /dev/null
+++ b/fmt/src/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libtmap.a 
diff --git a/fmt/src/Makefile b/fmt/src/Makefile
new file mode 100644
index 0000000..a0ed906
--- /dev/null
+++ b/fmt/src/Makefile
@@ -0,0 +1,38 @@
+# make TMAP library
+# ver 0.0 3/14/91 *sh*  NOAA/PMEL/TMAP
+# ver 0.1 10/11/91 kob  Jisao/pmel/tmap
+# ver 1.0 2/3/93  *kob*
+#        whole makefile revamped to implement recursive makes
+# 10/27/94 *sh* changes for AIX: include -Dsun on the pre-processor pass
+# define variables
+# 8/22/95 - *kob* only have tmap_lib now, for both debug and non-debug
+# 12/20/95 - # ifdef NINT_WRITE_UNMATCH added
+#             to the routine TM_FMT.
+#	     For now we should **not** use NINT_WRITE_UNMATCH during
+#	     compilation anywhere -- the code that needed it was
+#            applicable to VAX FORTRAN.  However, if we see odd
+#            behavior from TM_FMT in the future we may need to use
+#            D=NINT_WRITE_UNMATCH.
+# 6/28/96  - *kob*  modify linux entry for an actual linux machine
+#		    with fortran
+# 11/12/96 - *kob* - modify makefile so by default it will create both a
+#		   - non-debug and debug version of the tmap libray
+# 11/14/96 - *kob* - Add Linux entry similar to that of AIX - linux f77
+#		     doesn't use pre-processor
+# 08/19/97 - *kob* - added "-Dreclen_in_bytes" to aix flags
+# 06/05/12 - *kms* - change name to libtmap.a to simplify linking
+
+include ../../site_specific.mk
+include ../../platform_specific.mk.$(BUILDTYPE)
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+OBJS= $(SRCS_F:.F=.o) $(SRCS_C:.c=.o)
+
+$(LIB): $(OBJS)
+	ar r $(LIB) $(OBJS)
+	$(RANLIB) $(LIB)
+
+clean:
+	rm -f *.o $(LIB)
+
diff --git a/fmt/src/NCF_Util.c b/fmt/src/NCF_Util.c
new file mode 100644
index 0000000..3e146a8
--- /dev/null
+++ b/fmt/src/NCF_Util.c
@@ -0,0 +1,3696 @@
+
+
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granteHd the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+/* NCF_Util.c
+ *
+ * Ansley Manke
+ * Ferret V600 April 26, 2005
+ * V5600 *acm* fix declarations of fillc and my_len as required by solaris compiler
+ *
+ * This file contains all the utility functions which Ferret
+ * needs in order to do attribute handling. Based on code for EF's.
+ * calls are made to nc_ routines from netcdf library.
+ *
+ *
+ * *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build
+ * *acm  10/06 v601 - Fix by Remik for bug 1455, altix. For string attributes,
+ *                    allocate one more than the att.len, presumably for the null
+ *                    terminator for the string. Also double check the string length
+ *                    that is returned from the call to nc_inq_att, and make sure
+ *                    we allocate the correct amount of memory for the string.
+ *
+ * *acm  11/06 v601 - ncf_delete_var_att didnt reset the attribute id's.  Fix this.
+ *
+ * *acm  11/06 v601 - new routine ncf_add_var_num_att_dp
+ * *acm  11/06 v601 - new routine ncf_repl_var_att_dp
+ * *acm  11/06 v601 - in ncf_init_other_dset, set the name of the global attribute
+ *                    to history, and define its attribute type and outflag.
+ * *acm  11/06 v601 - new routine ncf_rename_var, for fix of bug 1471
+ * *acm  11/06 v601 - in ncf_delete_var_att, renumber the attid for the remaining attributes.
+ * *acm* 12/06 v602 - new attribute assigned to coordinate vars on input, orig_file_axname
+ * *acm*  2/07 V602 - Fix bug 1492, changing attributes of coordinate variables; use pseudo-dataset
+ *                       of user-defined axes to keep track of attributes.
+ * *acm* 10 07      - Patches for memory-leak fixes from Remiz Ziemlinski
+ * *acm* 10/07      - Further fixes by Remik, initializing att.vals, att.string to NULL,
+ *                      set var.ndims = 0 in ncf_init_other_dset
+ * *acm*  3/08      - Fix bug 1534; needed to initialize attribute output flag for
+ *                    the bounds attribute on coordinate axes.
+ * *acm*  1/09      - If adding a new global attribute, also increment ngatts.
+ * *acm*  1/09      - Fix bug 1620; In ncf_add_var, which is used when defining user
+ *                    variables, and also for reading in EZ datasets, I had the default
+ *                    attribute type for missing_value attribute set to NC_DOUBLE. There's no
+ *                    reason for this as these variables are always single precision.
+ * *acm*  5/09      - Fix bug 1664. For user variables, varid matches the uvar from Ferret.
+ *                    therefore it may be larger than nc_ptr->nvars
+ * *acm*  3/11      - Fix bug 1825. Routine ncf_get_var_seq no longer called
+ * *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *                    definition of macro DFTYPE in ferretmacros.h.
+ * *acm*  5/12 V6.8 - Additions for creating aggregate datasets
+ * *acm*  8/13	      Fix bug 2089. Mark the scale_factor and add_offset attributes  
+ *                    to-be-output when writing variables.
+ * *acm*  8/13        Fix bug 2091. If a string variable has the same name as a dimension,
+ *                    DO NOT mark it as an axis.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include "ferretmacros.h"
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <unistd.h>		/* for convenience */
+#include <stdlib.h>		/* for convenience */
+#include <stdio.h>		/* for convenience */
+#include <string.h>		/* for convenience */
+#include <fcntl.h>		/* for fcntl() */
+#include <assert.h>
+#include <sys/types.h>	        /* required for some of our prototypes */
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include "ferretmacros.h"
+
+#include "netcdf.h"
+#include "nc.h"
+#include "list.h"  /* locally added list library */
+#include "NCF_Util.h"
+
+/* ................ Global Variables ................ */
+
+static LIST  *GLOBAL_ncdsetList;
+static int list_initialized = FALSE;
+
+/* ............. Function Declarations .............. */
+/*
+ * Note that all routines called directly from Ferret,
+ * ie. directly from Fortran, should be all lower case,
+ * be of type 'void', pass by reference and should end with 
+ * an underscore.
+ */
+
+
+/* .... Functions called by Ferret .... */
+int  FORTRAN(ncf_inq_ds)( int *, int *, int *, int *, int *);
+int  FORTRAN(ncf_inq_ds_dims)( int *, int *, char *, int *, int *);
+int  FORTRAN(ncf_inq_var) (int *, int *, char *, int *, int *, int *, int *, int *, int *, int * );
+
+int  FORTRAN(ncf_inq_var_att)( int *, int *, int *, char *, int *, int *, int *, int *);
+
+void FORTRAN(ncf_free_attlist)(ncvar*);
+
+int  FORTRAN(ncf_get_dsnum)( char * );
+int  FORTRAN(ncf_get_dsname)( int *, char *);
+int  FORTRAN(ncf_get_dim_id)( int *, char *);
+
+int  FORTRAN(ncf_get_var_name)( int *, int *, char *);
+int  FORTRAN(ncf_get_var_id)( int *, int*, char *); 
+int  FORTRAN(ncf_get_var_id_case)( int *, int*, char *); 
+int  FORTRAN(ncf_get_var_axflag)( int *, int *, int *, int *); 
+int  FORTRAN(ncf_get_var_attr_name) (int *, int *, int *, int *, char*);
+int  FORTRAN(ncf_get_var_attr_id) (int *, int *, char* , int*);
+int  FORTRAN(ncf_get_var_attr_id_case) (int *, int *, char* , int*);
+int  FORTRAN(ncf_get_var_attr) (int *, int *, char* , char* , int *, double *);
+int  FORTRAN(ncf_get_var_attr) (int *, int *, char* , char* , int *, double *);
+int  FORTRAN(ncf_get_attr_from_id) (int *, int *, int * , int *, double* );
+
+int  FORTRAN(ncf_get_var_outflag) (int *, int *, int *);
+int  FORTRAN(ncf_get_var_outtype) (int *, int *,  int *);
+
+int  FORTRAN(ncf_init_uvar_dset)( int *);
+int  FORTRAN(ncf_init_uax_dset)( int *);
+int  FORTRAN(ncf_add_dset)( int *, int *, char *, char *);
+int  FORTRAN(ncf_init_other_dset)( int *, char *, char *);
+int  FORTRAN(ncf_delete_dset)( int *);
+int  FORTRAN(ncf_delete_var_att)( int *, int *, char *);
+int  FORTRAN(ncf_delete_var)( int *, char *);
+
+int  FORTRAN(ncf_add_var)( int *, int *, int *, int *, char *, char *, char *, double *);
+int  FORTRAN(ncf_add_coord_var)( int *, int *, int *, int *, char *, char *, double *);
+
+int  FORTRAN(ncf_add_var_num_att)( int *, int *, char *, int *, int *, int *, DFTYPE *);
+int  FORTRAN(ncf_add_var_num_att_dp)( int *, int *, char *, int *, int *, int *, double *);
+int  FORTRAN(ncf_add_var_str_att)( int *, int *, char *, int *, int *, int *, char *);
+
+int  FORTRAN(ncf_rename_var)( int *, int *, char *);
+int  FORTRAN(ncf_repl_var_att)( int *, int *, char *, int *, int *, DFTYPE *, char *);
+int  FORTRAN(ncf_repl_var_att_dp)( int *, int *, char *, int *, int *, double *, char *);
+int  FORTRAN(ncf_set_att_flag)( int *, int *, char *, int *);
+int  FORTRAN(ncf_set_var_out_flag)( int *, int *, int *);
+int  FORTRAN(ncf_set_var_outtype)( int *, int *, int *);
+int  FORTRAN(ncf_set_axdir)(int *, int *, int *);
+int  FORTRAN(ncf_transfer_att)(int *, int *, int *, int *, int *);
+ 
+int  FORTRAN(ncf_init_agg_dset)( int *, char *);
+int  FORTRAN(ncf_add_agg_member)( int *, int *);
+int  FORTRAN(ncf_get_agg_count)( int *, int *);
+int  FORTRAN(ncf_get_agg_member)( int *, int *, int *);
+int  FORTRAN(ncf_get_agg_var_info)( int *, int *, int *, int *, int *, int *, int *, int *);
+int  FORTRAN(ncf_put_agg_memb_grid)( int *, int *, int *, int *);
+
+/* .... Functions called internally .... */
+
+ncdset *ncf_ptr_from_dset(int *);
+LIST *ncf_get_ds_varlist( int *);
+LIST *ncf_get_ds_agglist( int *);
+LIST *ncf_get_ds_var_attlist (int *, int *);
+LIST *ncf_get_ds_var_gridlist (int *, int *);
+
+static int initialize_output_flag (char *, int);
+int NCF_ListTraverse_FoundDsetName( char *, char * );
+int NCF_ListTraverse_FoundDsetID( char *, char * );
+int NCF_ListTraverse_FoundVarName( char *, char * );
+int NCF_ListTraverse_FoundVarNameCase( char *, char * );
+int NCF_ListTraverse_FoundVarID( char *, char * );
+int NCF_ListTraverse_FoundVarAttName( char *, char * );
+int NCF_ListTraverse_FoundVarAttNameCase( char *, char * );
+int NCF_ListTraverse_FoundVarAttID( char *, char * );
+int NCF_ListTraverse_FoundVariMemb( char *, char * );
+int NCF_ListTraverse_FoundDsMemb( char *, char * );
+int NCF_ListTraverse_FoundDsMemb( char *, char * );
+
+/*
+ * Find a dataset based on its integer ID and return the scalar information:
+ * ndims, nvars, ngatts, recdim.
+ */
+
+int FORTRAN(ncf_inq_ds)( int *dset, int *ndims, int *nvars, int *ngatts, int *recdim )
+{
+  ncdset *nc_ptr=NULL;
+  int return_val;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+
+  *ndims = nc_ptr->ndims;
+  *nvars = nc_ptr->nvars;
+  *ngatts = nc_ptr->ngatts;
+
+/* dimension for Fortran, add 1 */
+  *recdim = nc_ptr->recdim+1;
+
+  return_val = FERR_OK; 
+  return return_val; 
+}
+
+/* ----
+ * Find a dataset based on its integer ID and return the dimension info for
+ * dimension given.
+ */
+int  FORTRAN(ncf_inq_ds_dims)( int *dset, int *idim, char dname[], int *namelen, int *dimsize)
+{
+  ncdset *nc_ptr=NULL;
+  int return_val;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+  
+  strcpy (dname, nc_ptr->dims[*idim-1].name);
+  *namelen = strlen(dname);
+  *dimsize = nc_ptr->dims[*idim-1].size;
+
+  return_val = FERR_OK; 
+  return return_val; 
+}
+
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable id. Return the variable name (in its original upper/lower 
+   case form), type, nvdims, vdims, nvatts.
+ */
+
+ int FORTRAN(ncf_inq_var) (int *dset, int *varid, char newvarname[], int *len_newvarname, int *vtype, int *nvdims,
+     int *nvatts, int* coord_var, int *outflag, int *vdims)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int i, ivar;
+  int ndx;
+  int the_dim;
+  int outdims;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+	LIST_ELEMENT *lp;
+
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+
+  var_ptr=(ncvar *)list_curr(varlist); 	
+
+  strcpy(newvarname, var_ptr->name);
+  *len_newvarname = strlen(newvarname);
+  *vtype = var_ptr->type;
+  *nvdims = var_ptr->ndims;
+  *nvatts = var_ptr->natts;
+  *outflag = var_ptr->all_outflag;
+  *coord_var = var_ptr->is_axis;
+
+   for (i=0; i <var_ptr->ndims ;i++ )
+  {
+	  the_dim =  var_ptr->dims[i];
+	  vdims[i] = the_dim ;
+  }
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable id. Return the variable output type.
+ */
+
+ int FORTRAN(ncf_get_var_outtype) (int *dset, int *varid,  int *outtype)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+
+  return_val = ATOM_NOT_FOUND;
+
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+  *outtype = var_ptr->outtype;
+   
+  return_val = FERR_OK;
+  return return_val;
+}
+ 
+
+/* ----
+ * Find a variable attribute based on its variable ID and dataset ID, and attribute name
+ * Return the attribute name, type, length, and output flag
+ */
+int  FORTRAN(ncf_inq_var_att)( int *dset, int *varid, int *attid, char attname[], int *namelen, int *attype, int *attlen, int *attoutflag)
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+	LIST_ELEMENT* lp;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, (char *) attid, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+  strcpy(attname, att_ptr->name);
+  *namelen = strlen(attname);
+  *attype = att_ptr->type; 
+  *attlen = att_ptr->len;
+  *attoutflag = att_ptr->outflag;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a dataset based on its name and
+ * return the ferret dataset number.
+ */
+
+int FORTRAN(ncf_get_dsnum)( char name[] )
+{
+  ncdset *nc_ptr=NULL;
+  int status=LIST_OK;
+
+  static int return_val=0; /* static because it needs to exist after the return statement */
+
+  /*
+   * Find the dataset.
+   */
+
+  status = list_traverse(GLOBAL_ncdsetList, name, NCF_ListTraverse_FoundDsetName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  /*
+   * If the search failed, set the dset to ATOM_NOT_FOUND.
+   */
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+
+  nc_ptr=(ncdset *)list_curr(GLOBAL_ncdsetList); 
+
+  return_val = nc_ptr->fer_dsetnum;
+  return return_val;
+}
+
+/* ----
+ * Find a dataset based on its integer ID and return the name.
+ */
+
+int FORTRAN(ncf_get_dsname)( int *dset, char name[] )
+{
+  ncdset *nc_ptr=NULL;
+  int return_val;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+
+  strcpy(name, nc_ptr->fername);
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a dataset based on its integer ID and a dimension name. Return the dimension ID.
+ */
+int FORTRAN(ncf_get_dim_id)( int *dset, char dname[])
+{
+  ncdset *nc_ptr=NULL;
+  int return_val;
+  int idim;
+  int sz;
+  int szdim;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+  
+  for (idim = 0; idim < nc_ptr->ndims; idim++) {
+	sz = strlen(dname);
+	szdim = strlen(nc_ptr->dims[idim].name);
+    if ( (sz == szdim) &&
+		 (nc_ptr->dims[idim].size !=0) && 
+		 (strncmp(dname, nc_ptr->dims[idim].name, sz) == 0) )
+    { return_val = idim + 1;
+	  return return_val;
+    } 
+  }
+  return return_val;
+}
+
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable id. Return the variable name.
+ */
+ int FORTRAN(ncf_get_var_name) (int *dset, int* ivar, char* string)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int i;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+  LIST *dummy;
+
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  dummy = list_mvfront(varlist);
+  var_ptr=(ncvar *)list_front(varlist); 
+
+  for (i = 0; i < *ivar; i++) {
+     strcpy(string, var_ptr->name); 
+     dummy = list_mvnext(varlist);
+     var_ptr=(ncvar *)list_curr(varlist);  
+  }
+  
+  free(dummy);
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable name. Return the variable id, or NOT FOUND if it does not exist
+ */
+ int FORTRAN(ncf_get_var_id) (int *dset, int *varid, char string[])
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, string, NCF_ListTraverse_FoundVarName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  var_ptr=(ncvar *)list_curr(varlist); 
+  *varid = var_ptr->varid;
+  return_val = FERR_OK;
+
+  return return_val;
+}
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable name. Return the variable id, or NOT FOUND if it does not exist
+ */
+ int FORTRAN(ncf_get_var_id_case) (int *dset, int *varid, char string[])
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, string, NCF_ListTraverse_FoundVarNameCase, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  var_ptr=(ncvar *)list_curr(varlist); 
+  *varid = var_ptr->varid;
+  return_val = FERR_OK;
+
+  return return_val;
+}
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable ID. Return the coordinate-axis flag.
+ */
+ int FORTRAN(ncf_get_var_axflag) (int *dset, int *varid, int* coord_var, int* ax_dir)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int i;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+  return_val = FALSE;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  var_ptr=(ncvar *)list_curr(varlist); 
+  
+  *coord_var = var_ptr->is_axis;
+  *ax_dir = var_ptr->axis_dir;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable in a dataset based on the dataset integer ID and 
+ * variable ID. Return the variable all_outflag for attributes
+ */
+ int FORTRAN(ncf_get_var_outflag) (int *dset, int *varid, int *iflag)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int i;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+  return_val = 0;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables and the variable based on its id
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  var_ptr=(ncvar *)list_curr(varlist); 
+  *iflag = var_ptr->all_outflag;
+
+  return FERR_OK;
+}
+
+/* ----
+ * Find a variable attribute based on the dataset ID and variable ID and attribute name
+ * Return the attribute ID
+ */
+ int FORTRAN(ncf_get_var_attr_id) (int *dset, int *varid, char* attname, int* attid)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+  LIST *dummy;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset. find attname.
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+  att_ptr=(ncatt *)list_curr(varattlist); 
+  *attid = att_ptr->attid;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable attribute based on the dataset ID and variable ID and attribute name
+ * Return the attribute ID
+ */
+ int FORTRAN(ncf_get_var_attr_id_case) (int *dset, int *varid, char* attname, int* attid)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+  LIST *dummy;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset. find attname.
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttNameCase, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+  att_ptr=(ncatt *)list_curr(varattlist); 
+  *attid = att_ptr->attid;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable attribute based on the dataset ID and variable ID and attribute ID.
+ * Return the attribute name.
+ */
+ int FORTRAN(ncf_get_var_attr_name) (int *dset, int *varid, int* attid, int *namelen, char* attname)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+  LIST *dummy;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  dummy = list_mvfront(varattlist);
+  att_ptr=(ncatt *)list_front(varattlist); 
+
+  for (i = 0; i < *attid; i++) {
+     strcpy(attname, att_ptr->name);
+	 dummy = list_mvnext(varattlist);
+     att_ptr=(ncatt *)list_curr(varattlist);  
+  }
+  
+  
+  *namelen = strlen(attname);
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/*----
+ * Find a variable attribute based on the dataset ID and variable ID and attribute name.
+ * On input, len is the max len to load.
+ * Return the attribute, len, and its string or numeric value.
+ */
+ int FORTRAN(ncf_get_var_attr) (int *dset, int *varid, char* attname, char* string, int *len, double* val)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+  
+  strcpy(string, "");
+  val[0] = NC_FILL_DOUBLE;
+
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+  if (att_ptr->type == NC_CHAR)
+  { 
+
+	  strncpy(string, att_ptr->string, *len); 
+  }
+  else 
+  { for (i = 0; i < att_ptr->len; i++) {
+	  val[i] = att_ptr->vals[i]; }
+  }
+  *len = att_ptr->len;
+  return_val = FERR_OK;
+  return return_val;
+}
+
+
+/*----
+ * Find a numeric attribute based on the dataset ID and variable ID and attribute id.
+ * On input, len is the max len to load.
+ * Return the attribute, len, and or numeric value.
+ */
+ int FORTRAN(ncf_get_attr_from_id) (int *dset, int *varid, int *attid, int *len, double* val)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+   * Get the list of attributes for the variable in the dataset. 
+   * Find the attribute from its ID
+   */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, (char *) attid, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+  
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+  val[0] = NC_FILL_DOUBLE;
+  if (att_ptr->type == NC_CHAR)
+	{
+	  fprintf(stderr, "ERROR: ncf_get_attr_from_id: Atribute is CHAR. This function only for numberic.\n");
+	  return_val = -1;
+	  return return_val; 
+          }
+  else 
+  { for (i = 0; i < att_ptr->len; i++) {
+	  val[i] = att_ptr->vals[i]; }
+  }
+  *len = att_ptr->len;
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Initialize new dataset to contain user variables and 
+ * save in GLOBAL_ncdsetList for attribute handling 
+ */
+
+int FORTRAN(ncf_init_uvar_dset)(int *setnum)
+
+{
+  ncdset nc; 
+  static int return_val=FERR_OK; /* static because it needs to exist after the return statement */
+  
+    int i;				/* loop controls */
+	int ia;
+	int iv;
+    int nc_status;		/* return from netcdf calls */
+    ncatt att;			/* attribute */
+    ncvar var;			/* variable */
+		att.vals = NULL;
+		att.string = NULL;
+    strcpy(nc.fername, "UserVariables");
+    strcpy(nc.fullpath, " ");
+    nc.fer_dsetnum = *setnum;
+
+    nc.ngatts = 1;
+    nc.nvars = 0;
+	nc.recdim = -1;   /* never used, but initialize anyway*/
+	nc.ndims = 6;     /* never used, but initialize anyway*/
+	nc.its_agg = 0;
+	nc.num_agg_members = 0;
+    nc.vars_list_initialized = FALSE;
+
+   /* set one global attribute, treat as pseudo-variable . the list of variables */
+
+       strcpy(var.name, ".");
+
+       var.attrs_list_initialized = FALSE;
+
+       var.type = NC_CHAR;
+       var.outtype = NC_CHAR;
+       var.varid = 0;
+	   var.natts = nc.ngatts;
+       var.has_fillval = FALSE;
+	   var.fillval = NC_FILL_FLOAT;
+	   var.all_outflag = 1;
+	   var.is_axis = FALSE;
+	   var.axis_dir = 0;
+
+	   var.attrs_list_initialized = FALSE; 
+
+		 att.outflag = 1;
+		 att.type = NC_CHAR;
+		 att.outtype = NC_CHAR;
+		 att.len = 21;
+		 strcpy(att.name, "FerretUserVariables" );
+		 att.string = (char*)malloc(2*sizeof(char));
+		 strcpy(att.string, " ");
+
+      /*Save attribute in linked list of attributes for variable .*/	
+       if (!var.attrs_list_initialized) {
+          if ( (var.varattlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize GLOBAL attributes list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          var.attrs_list_initialized = TRUE;
+	  }
+
+       list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+
+       /* global attributes list complete */
+
+      /*Save variable in linked list of variables for this dataset */	
+       if (!nc.vars_list_initialized) {
+          if ( (nc.dsetvarlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize variable list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.vars_list_initialized = TRUE;
+        }
+
+       list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+
+/* Add dataset to global nc dataset linked list*/ 
+  if (!list_initialized) {
+    if ( (GLOBAL_ncdsetList = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize GLOBAL_ncDsetList.\n");
+      return_val = -1;
+      return return_val; 
+	}
+    list_initialized = TRUE;
+  }
+
+  list_insert_after(GLOBAL_ncdsetList, (char *) &nc, sizeof(ncdset));
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Initialize new dataset to contain user-defined coordinate variables and 
+ * save in GLOBAL_ncdsetList for attribute handling 
+ */
+
+int FORTRAN(ncf_init_uax_dset)(int *setnum)
+
+{
+  ncdset nc; 
+  static int return_val=FERR_OK; /* static because it needs to exist after the return statement */
+  
+    int i;				/* loop controls */
+	int ia;
+	int iv;
+    int nc_status;		/* return from netcdf calls */
+    ncatt att;			/* attribute */
+    ncvar var;			/* variable */
+		att.vals = NULL;
+		att.string = NULL;
+    strcpy(nc.fername, "UserCoordVariables");
+    strcpy(nc.fullpath, " ");
+    nc.fer_dsetnum = *setnum;
+
+    nc.ngatts = 1;
+    nc.nvars = 0;
+	nc.recdim = -1;   /* never used, but initialize anyway*/
+	nc.its_agg = 0;
+    nc.vars_list_initialized = FALSE;
+
+   /* set one global attribute, treat as pseudo-variable . the list of variables */
+
+       strcpy(var.name, "."); /*is this a legal name?*/
+
+       var.attrs_list_initialized = FALSE;
+
+       var.type = NC_CHAR;
+       var.outtype = NC_CHAR;
+       var.varid = 0;
+	   var.natts = nc.ngatts;
+       var.has_fillval = FALSE;
+       var.fillval = NC_FILL_FLOAT;
+	   var.all_outflag = 1;
+	   var.is_axis = FALSE;
+	   var.axis_dir = 0;
+
+	   var.attrs_list_initialized = FALSE; 
+
+		 att.outflag = 1;
+		 att.type = NC_CHAR;
+		 att.outtype = NC_CHAR;
+		 att.len = 21;
+		 strcpy(att.name, "FerretUserCoordVariables" );
+     att.string = (char*)malloc(2*sizeof(char));
+		 strcpy(att.string, " ");
+
+      /*Save attribute in linked list of attributes.*/	
+       if (!var.attrs_list_initialized) {
+          if ( (var.varattlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_uax_dset: Unable to initialize GLOBAL attributes list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          var.attrs_list_initialized = TRUE;
+	  }
+
+       list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+
+       /* global attributes list complete */
+
+      /*Save variable in linked list of variables for this dataset */	
+       if (!nc.vars_list_initialized) {
+          if ( (nc.dsetvarlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_uax_dset: Unable to initialize variable list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.vars_list_initialized = TRUE;
+        }
+
+       list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+
+/* Add dataset to global nc dataset linked list*/ 
+  if (!list_initialized) {
+    if ( (GLOBAL_ncdsetList = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_init_uax_dset: Unable to initialize GLOBAL_ncDsetList.\n");
+      return_val = -1;
+      return return_val; 
+	}
+    list_initialized = TRUE;
+  }
+
+  list_insert_after(GLOBAL_ncdsetList, (char *) &nc, sizeof(ncdset));
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Get file info for a dataset and save in GLOBAL_ncdsetList for attribute handling 
+ */
+
+int FORTRAN(ncf_add_dset)(int *ncid, int *setnum, char name[], char path[])
+
+{
+  ncdset nc; 
+  static int return_val=FERR_OK; /* static because it needs to exist after the return statement */
+	
+	/* code lifted liberally from ncdump.c Calls in nc library.*/
+	
+	char fillc;
+	int i;				/* loop controls */
+	int ia;
+	int iv;
+	int ilen;
+	int nc_status;		/* return from netcdf calls */
+	ncdim fdims;		/* name and size of dimension */
+	ncatt att;			/* attribute */
+	ncatt att0;			/* initialize attribute */
+	ncvar var;			/* variable */
+	int bad_file_attr = 243; /* matches merr_badfileatt in tmap_errors.parm*/
+	size_t len;
+
+	att.vals = NULL;
+	att.string = NULL;
+	strcpy(nc.fername, name);
+	strcpy(nc.fullpath, path);
+	nc.fer_dsetnum = *setnum;
+	nc.its_agg = 0;
+	nc.num_agg_members = 0;
+	
+	/* Set attribute with initialization values*/
+	
+	strcpy(att0.name, " ");
+	att0.type = NC_CHAR;
+	att0.outtype = NC_CHAR;
+	att0.attid = 0;
+	att0.outflag = 0;
+	att0.len = 1;
+	att0.string = (char *) malloc((att0.len+1)* sizeof(char*));
+	strcpy (att0.string," ");
+	att0.vals = (double *) malloc(1 * sizeof(double));
+	att0.vals[0] = 0;
+	
+	/*
+	 * get number of dimensions, number of variables, number of global
+	 * atts, and dimension id of unlimited dimension, if any
+	 */
+	nc_status = nc_inq(*ncid, &nc.ndims, &nc.nvars, &nc.ngatts, &nc.recdim) ;
+	if (nc_status != NC_NOERR) return nc_status;
+	
+	/* get dimension info */
+	if (nc.ndims > 0) {
+		for (i = 0; i < nc.ndims; i++) {
+			nc_status = nc_inq_dim(*ncid, i, fdims.name, &fdims.size); 
+			if (nc_status != NC_NOERR) return nc_status;
+			
+			if (nc_status != NC_NOERR) return nc_status;
+			strcpy (nc.dims[i].name, fdims.name);
+			nc.dims[i].size = fdims.size;
+		}
+	}
+	
+	nc.vars_list_initialized = FALSE;
+	nc_status = NC_NOERR;
+	
+	/* get info on global attributes, treat as pseudo-variable . list of attributes*/
+	
+	
+	/* get global attributes */
+	
+	if (nc.ngatts > 0)
+		{
+			strcpy(var.name, ".");
+			
+			var.attrs_list_initialized = FALSE;
+			
+			var.type = NC_CHAR;
+			var.outtype = NC_CHAR;
+			var.varid = 0;
+			var.natts = nc.ngatts;
+			var.ndims = 1;
+			var.dims[0] = 1;
+			var.has_fillval = FALSE;
+			var.fillval = NC_FILL_FLOAT;
+			var.all_outflag = 1;
+			var.is_axis = FALSE;
+			var.axis_dir = 0;
+			
+			var.attrs_list_initialized = FALSE;
+			for (i = 0; i < nc.ngatts; i++)
+				{
+					
+					/* initialize 
+						 att = att0;*/
+					
+          nc_status = nc_inq_attname(*ncid, NC_GLOBAL, i, att.name);            
+					/*		  if (nc_status != NC_NOERR) fprintf(stderr, " ***NOTE: error reading global attribute id %d from file %s\n", i, nc.fullpath);  */
+          if (nc_status == NC_NOERR) {
+						
+            att.attid = i+1;
+            nc_status = nc_inq_att(*ncid, NC_GLOBAL, att.name, &att.type, &len);
+						att.len = (int)len;
+
+						/*            if (nc_status != NC_NOERR) fprintf(stderr, " ***NOTE: error reading global attribute %s from file %s\n",att.name, nc.fullpath); */
+            if (nc_status == NC_NOERR) {
+							
+							/* Set output flag. By default only the global history attribute is written.
+							 *  For string attributes, allocate one more than the att.len, 
+							 *  presumably for the null terminator for the string (?) */
+							
+							att.outflag = 0;
+							if (strcmp(att.name,"history")==0)
+								{att.outflag = 1;
+								}
+							
+              if (att.len == 0) {	/* show 0-length attributes as empty strings */
+								att.type = NC_CHAR;
+								att.outtype = NC_CHAR;
+								att.len = 1;
+								att.string = (char *) malloc(2* sizeof(char));
+								strcpy (att.string," ");
+              }
+              switch (att.type) {
+              case NC_CHAR:
+								att.string = (char *) malloc((att.len+1)* sizeof(char));
+								
+								nc_status = nc_get_att_text(*ncid, NC_GLOBAL, att.name, att.string );
+								if (nc_status != NC_NOERR) return nc_status;
+								
+								break;
+              default:
+								att.vals = (double *) malloc(att.len * sizeof(double));
+								
+								nc_status = nc_get_att_double(*ncid, NC_GLOBAL, att.name, att.vals );
+								if (nc_status != NC_NOERR) return nc_status;
+								
+								break;
+              }
+							
+						}  /* end of the  if (nc_status == NC_NOERR) */
+					}
+					/*Save attribute in linked list of attributes for variable . (global attributes)*/	
+					if (!var.attrs_list_initialized) {
+						if ( (var.varattlist = list_init()) == NULL ) {
+							fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize GLOBAL attributes list.\n");
+							return_val = -1;
+							return return_val; 
+						}
+            var.attrs_list_initialized = TRUE;
+  	      }
+					
+					list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+				}    /* global attributes list complete */
+			
+      /*Save variable in linked list of variables for this dataset */	
+			if (!nc.vars_list_initialized) {
+				if ( (nc.dsetvarlist = list_init()) == NULL ) {
+					fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize variable list.\n");
+					return_val = -1;
+					return return_val; 
+				}
+				nc.vars_list_initialized = TRUE;
+			}
+			
+			list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+			
+		}    
+	
+	/* get info on variables */
+	
+	if (nc.nvars > 0)
+		for (iv = 0; iv < nc.nvars; iv++)
+			{
+				nc_status = nc_inq_var(*ncid, iv, var.name, &var.type, &var.ndims,
+															 var.dims, &var.natts);
+				if (nc_status != NC_NOERR) return nc_status;
+				
+				var.varid = iv+1;  
+				var.outtype = NC_FLOAT;
+				if (var.type == NC_CHAR) var.outtype = NC_CHAR;
+				var.outtype = var.type;  /* ?? */
+				
+				/* is this a coordinate variable? If not a string, set the flag.
+				 */
+				if (nc.ndims > 0) {
+					var.is_axis = FALSE;
+					var.axis_dir = 0;
+					i = 0;
+					while (i < nc.ndims && var.is_axis == FALSE) {
+						if  (strcasecmp(var.name, nc.dims[i].name) == 0) var.is_axis = TRUE;
+						if  (var.type == NC_CHAR) var.is_axis = FALSE;
+						i = i + 1;
+					}
+				}
+				
+				/* get _FillValue attribute */
+				
+				nc_status =  nc_inq_att(*ncid,iv,"_FillValue",&att.type, &len);
+				att.len = (int)len;
+				
+				if(nc_status == NC_NOERR &&
+					 att.type == var.type && att.len == 1) {
+					
+					att.outflag = 1;
+					att.outtype = var.type;
+					var.has_fillval = TRUE;
+					if(var.type == NC_CHAR) {
+						att.outtype = NC_CHAR;
+						nc_status = nc_get_att_text(*ncid, iv, "_FillValue",
+																				&fillc );
+						if (nc_status != NC_NOERR)  /* on error set attr to empty string */
+							{ att.type = NC_CHAR;
+								att.outtype = NC_CHAR;
+								att.len = 1;
+								att.string = (char *) malloc((att.len+1)* sizeof(char));
+								strcpy (att.string," ");
+								att.vals = (double *) malloc(1 * sizeof(double));
+								att.vals[0] = 0;
+								return_val = bad_file_attr;
+							}
+					} else {
+						nc_status = nc_get_att_double(*ncid, iv, "_FillValue",
+																					&var.fillval ); }
+					att.string = (char *) malloc(2*sizeof(char));
+					strcpy(att.string," ");
+		    }
+				else  /* set to default NC value*/ 
+					{
+						var.has_fillval = FALSE;
+						switch (var.type) {
+						case NC_BYTE:
+							/* don't do default fill-values for bytes, too risky */
+							var.has_fillval = 0;
+							break;
+						case NC_CHAR:
+							var.fillval = NC_FILL_CHAR;
+							break;
+						case NC_SHORT:
+							var.fillval = NC_FILL_SHORT;
+							break;
+						case NC_INT:
+							var.fillval = NC_FILL_INT;
+							break;
+						case NC_FLOAT:
+							var.fillval = NC_FILL_FLOAT;
+							break;
+						case NC_DOUBLE:
+							var.fillval = NC_FILL_DOUBLE;
+							break;
+						default:
+							break;
+							att.string = (char *) malloc(2*sizeof(char));
+							strcpy (att.string, " ");
+						}
+					}
+				
+				var.all_outflag = 1;
+				
+				/* get all variable attributes 
+				 *  For string attributes, allocate one more than the att.len, 
+				 *  presumably for the null terminator for the string. See Netcdf User's Guide, nc_get_att_text.
+				 */
+				var.attrs_list_initialized = FALSE;
+				
+				ia = 0;
+				if (var.natts > 0)
+          {
+						for (ia = 0; ia < var.natts; ia++)
+							
+							{
+								
+								/* initialize
+									 att = att0; */
+								
+								nc_status = nc_inq_attname(*ncid, iv, ia, att.name);
+								/*		  if (nc_status != NC_NOERR) fprintf(stderr, " ***NOTE: error reading attribute id %d for variable %s, file %s\n", ia, var.name, nc.fullpath); */
+								if (nc_status == NC_NOERR) {
+									att.attid = ia+1;
+									
+									nc_status = nc_inq_att(*ncid, iv, att.name, &att.type, &len);
+									att.len = (int)len;
+
+									/*            if (nc_status != NC_NOERR) fprintf(stderr, " ***NOTE: error reading attribute %s for variable %s, file %s\n",att.name, var.name, nc.fullpath); */
+									if (nc_status == NC_NOERR) {
+										
+										if (att.len == 0) {	/* set 0-length attributes to empty strings */
+											att.type = NC_CHAR;
+											att.outtype = NC_CHAR;
+											att.len = 1;
+											att.string = (char *) malloc(2*sizeof(char));
+											strcpy (att.string," ");
+										}
+										switch (att.type) {
+										case NC_CHAR:
+											/* Plus one for end-of-string delimiter. */
+											att.string = (char *) malloc((att.len+1)*sizeof(char));
+											strcpy (att.string, " ");
+											nc_status = nc_get_att_text(*ncid, iv, att.name, att.string );											
+											
+											if (nc_status != NC_NOERR) /* on error set attr to empty string*/
+												{att.type = NC_CHAR;
+													att.outtype = NC_CHAR;
+													att.len = 1;
+													att.string = (char *) malloc((att.len+1)*sizeof(char));
+													strcpy (att.string, " ");
+													return_val = bad_file_attr;
+												} else {
+												/* Ensure end-of-string delimiter because Netcdf API doesn't store automatically; it's up to the file's author. */
+												att.string[att.len] = '\0';
+												
+												/* Check the actual string length (one example file has
+													 attribute units="m" but gets att.len = 128 from nc_inq_att above) because user probably used some arbitrarily large string buffer and partially populated the string leaving the remainder filled with '\0'.
+												*/
+												ilen = strlen(att.string);
+												if (ilen < att.len)
+													{ 
+														att.len = ilen;
+													}											
+											}
+											
+											att.vals = (double *) malloc(1 * sizeof(double));
+											att.vals[0] = 0;
+											
+											break;
+										default:
+#ifdef double_p
+											att.outtype = NC_DOUBLE;
+#else
+											att.outtype = NC_FLOAT;
+#endif
+											att.vals = (double *) malloc(att.len * sizeof(double));
+											
+											nc_status = nc_get_att_double(*ncid, iv, att.name, att.vals );
+											if (nc_status != NC_NOERR) /* on error set attr to empty string*/
+												{att.type = NC_CHAR;
+													att.outtype = NC_CHAR;
+													att.len = 1;
+													att.string = (char *) malloc((att.len+1)* sizeof(char));
+													strcpy (att.string, " ");
+													return_val = bad_file_attr;
+												}
+											att.string = (char *) malloc(2*sizeof(char));
+											strcpy(att.string, " ");
+											break;
+										}
+										
+										/* Initialize output flag. Attributes written by default by Ferret
+											 will be set to outflag = 1. 
+										*/
+										att.outflag = initialize_output_flag (att.name, var.is_axis);
+										
+									} /* end of the if (nc_status == NC_NOERR)  */
+								}
+								/*Save attribute in linked list of attributes for this variable */	
+								if (!var.attrs_list_initialized) {
+									if ( (var.varattlist = list_init()) == NULL ) {
+										fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize variable attributes list.\n");
+										return_val = -1;
+										return return_val; 
+									}
+									var.attrs_list_initialized = TRUE;
+								}
+								
+								list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+							}    /* variable attributes from file complete */
+					}  /* if var.natts > 0*/ 
+				
+/*                    /* If this is a coordinate variable, add an attribute orig_file_axname which 
+/*				          contains the axis name, and is used to preserve the original name if 
+/*						  Ferret detects a duplicate axis name and changes the axis name.*/
+					if (var.is_axis)
+					{
+
+
+						/* initialize
+									 att = att0; */
+								
+						var.natts = var.natts + 1;
+						strcpy (att.name, "orig_file_axname");
+						att.attid = ia+1;
+						att.type = NC_CHAR;
+						att.len = strlen(var.name);
+						att.string = (char *) malloc((att.len+1)*sizeof(char));
+
+						strcpy (att.string,var.name);
+		                                
+						/* Ensure end-of-string delimiter because Netcdf API doesn't store automatically; it's up to the file's author. */
+						att.string[att.len] = '\0';
+											
+						att.vals = (double *) malloc(1 * sizeof(double));
+						att.vals[0] = 0;
+								
+						/* Output flag always false for this attribute */
+						att.outflag = -1;
+	
+						/*Save attribute in linked list of attributes for this variable */	
+						if (!var.attrs_list_initialized) 
+							{
+							if ( (var.varattlist = list_init()) == NULL ) 
+								{
+								fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize variable attributes list.\n");
+								return_val = -1;
+								return return_val; 
+								}
+							var.attrs_list_initialized = TRUE;
+							}
+								
+							list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+					}
+
+				/*Save variable in linked list of variables for this dataset */	
+				if (!nc.vars_list_initialized) {
+          if ( (nc.dsetvarlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize variable list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.vars_list_initialized = TRUE;
+        }
+				
+				list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+				
+			}    /* variables list complete */
+	
+	/* Add dataset to global nc dataset linked list*/ 
+  if (!list_initialized) {
+    if ( (GLOBAL_ncdsetList = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_add_dset: Unable to initialize GLOBAL_ncDsetList.\n");
+      return_val = -1;
+      return return_val; 
+		}
+    list_initialized = TRUE;
+  }
+	
+  list_insert_after(GLOBAL_ncdsetList, (char *) &nc, sizeof(ncdset));
+  return return_val;
+}
+
+/* ----
+ * Initialize new dataset to contain a non-netcdf dataset 
+ * save in GLOBAL_ncdsetList for attribute handling 
+ */
+
+int FORTRAN(ncf_init_other_dset)(int *setnum, char name[], char path[])
+
+{
+  ncdset nc; 
+  static int return_val=FERR_OK; /* static because it needs to exist after the return statement */
+  
+    int i;				/* loop controls */
+	int ia;
+	int iv;
+    int nc_status;		/* return from netcdf calls */
+    ncatt att;			/* attribute */
+    ncvar var;			/* variable */
+		att.vals = NULL;
+		att.string = NULL;
+    strcpy(nc.fername, name);
+    strcpy(nc.fullpath, path);
+    nc.fer_dsetnum = *setnum;
+
+    nc.ngatts = 1;
+    nc.nvars = 0;
+	nc.recdim = -1;   /* not used, but initialize anyway*/
+	nc.ndims = 6;
+	nc.its_agg = 0;
+	nc.num_agg_members = 0;
+    nc.vars_list_initialized = FALSE;
+
+   /* set up pseudo-variable . the list of variables */
+
+       strcpy(var.name, ".");
+
+       var.attrs_list_initialized = FALSE;
+
+       var.type = NC_CHAR;
+       var.outtype = NC_CHAR;
+       var.varid = 0;
+	   var.natts = nc.ngatts;
+       var.has_fillval = FALSE;
+#ifdef double_p
+	   var.fillval = NC_FILL_DOUBLE;
+#else
+	   var.fillval = NC_FILL_FLOAT;
+#endif
+	   var.all_outflag = 1;
+	   var.is_axis = FALSE;
+	   var.axis_dir = 0;		
+		 var.ndims = 0;
+	   var.attrs_list_initialized = FALSE; 
+
+   /* set one global attribute, history */
+
+		  att.outflag = 1;
+          att.type = NC_CHAR;
+          att.outtype = NC_CHAR;
+          att.outflag = 0;
+          att.attid = 1;
+		  att.len = strlen(name);
+          strcpy(att.name, "history" );
+
+	      att.string = (char *) malloc((att.len+1)* sizeof(char));
+		  strcpy(att.string, name );
+
+      /*Save attribute in linked list of attributes for variable .*/	
+       if (!var.attrs_list_initialized) {
+          if ( (var.varattlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_other_dset: Unable to initialize GLOBAL attributes list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          var.attrs_list_initialized = TRUE;
+	  }
+
+       list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+
+       /* global attributes list complete */
+
+      /*Save variable in linked list of variables for this dataset */	
+       if (!nc.vars_list_initialized) {
+          if ( (nc.dsetvarlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize variable list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.vars_list_initialized = TRUE;
+        }
+
+       list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+
+/* Add dataset to global nc dataset linked list*/ 
+  if (!list_initialized) {
+    if ( (GLOBAL_ncdsetList = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize GLOBAL_ncDsetList.\n");
+      return_val = -1;
+      return return_val; 
+	}
+    list_initialized = TRUE;
+  }
+
+  list_insert_after(GLOBAL_ncdsetList, (char *) &nc, sizeof(ncdset));
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Find a dataset based on an integer id and return the nc_ptr.
+ */
+ncdset *ncf_ptr_from_dset(int *dset)
+{
+  static ncdset *nc_ptr=NULL;
+  int status=LIST_OK;
+
+  status = list_traverse(GLOBAL_ncdsetList, (char *) dset, NCF_ListTraverse_FoundDsetID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+
+  /*
+   * If the search failed, print a warning message and return.
+   */
+  if ( status != LIST_OK ) {
+    /* fprintf(stderr, "\nERROR: in ncf_ptr_from_dset: No dataset of id %d was found.\n\n", *dset); */
+    return NULL;
+  }
+
+  nc_ptr=(ncdset *)list_curr(GLOBAL_ncdsetList); 
+  
+  return nc_ptr;
+}
+
+/* ----
+ * Find a dataset based on its integer ID and return a pointer to its variable list
+ */
+
+LIST *ncf_get_ds_varlist( int *dset)
+{
+  ncdset *nc_ptr=NULL;
+  static LIST *list_ptr=NULL;
+
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return NULL; }
+
+  list_ptr=nc_ptr->dsetvarlist; 
+  return list_ptr;
+}
+
+/* ----
+ * Find a variable based on its dataset and variable IDs 
+ * and return a pointer to its attribute list
+ */
+
+LIST *ncf_get_ds_var_attlist( int *dset, int *varid)
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  static LIST *varlist=NULL;
+  static LIST *att_ptr=NULL;
+  int status;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return NULL;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+  att_ptr=var_ptr->varattlist; 
+  return att_ptr;
+}
+
+/* ----
+ * Find a dataset based on its integer ID and return a pointer to its aggregate member list
+ */
+
+LIST *ncf_get_ds_agglist( int *dset)
+{
+  ncdset *nc_ptr=NULL;
+  static LIST *list_ptr=NULL;
+
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return NULL; }
+
+  list_ptr=nc_ptr->agg_dsetlist; 
+  return list_ptr;
+}
+
+/* ----
+ * Find a variable based on its dataset and variable IDs 
+ * and return a pointer to its aggregate-grid list
+ */
+
+LIST *ncf_get_ds_var_gridlist( int *dset, int *varid)
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  static LIST *varlist=NULL;
+  static LIST *grids_ptr=NULL;
+  int status;
+
+   /*
+   * Get the list of variables.  
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return NULL;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+  grids_ptr=var_ptr->varagglist; 
+  return grids_ptr;
+}
+
+/* ----
+/*
+ * Deallocates ncatts for a ncvar.
+ */
+void ncf_free_attlist(ncvar* varptr)
+{
+	LIST_ELEMENT *lp, *prev;
+	int status = TRUE;
+	ncatt* att;
+
+	if (varptr == NULL) 
+		return;
+
+	/* Traverse list */
+	lp = varptr->varattlist->front;
+
+	if (lp == NULL) 
+		return;
+
+	while(status) {		
+		att = (ncatt*) lp->data;
+
+		if (att->string != NULL) {
+		 	free(att->string);
+	 	}
+
+ 		if (att->vals != NULL) {
+	 		free(att->vals);
+		}
+
+		if (lp->next  == NULL) {
+			status = FALSE;
+		} else {
+			lp = lp->next;
+		}
+	}
+}
+
+/* ----
+ * Remove a dataset from the global dataset list
+ */
+
+int FORTRAN(ncf_delete_dset)(int *dset)
+{
+
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  static int return_val;
+  LIST *varlist;
+  LIST *dummy;
+  int ivar;
+	LIST_ELEMENT *lp;
+
+/* Find the dataset
+ */ 
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+
+  /* For each variable, deallocate the list of attributes, 
+   * and remove the variable from the dataset list
+   */
+
+  varlist = ncf_get_ds_varlist(dset);
+  var_ptr=(ncvar *)list_front(varlist); 
+  for (ivar = 0; ivar< nc_ptr->nvars ;ivar ++ )
+  {  
+/*	 list_free(var_ptr->varattlist, LIST_DEALLOC); */ /* removed here just for testing...*/
+     list_remove_curr(varlist);
+
+     /* Point to next variable */
+     dummy = list_mvnext(varlist);
+     var_ptr=(ncvar *)list_curr(varlist); 
+  }
+
+	/* Remove dataset from dataset list */
+  list_remove_curr(GLOBAL_ncdsetList);
+
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Add a new variable to the pseudo (user-variable) dataset.
+ */
+int  FORTRAN(ncf_add_var)( int *dset, int *varid, int *type, int *coordvar, char *varname, char title[], char units[], double *bad)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncatt att;
+  ncvar var;
+  ncagg_var_descr vdescr;
+  int status=LIST_OK;
+  static int return_val;
+  int *i;
+  int newvar;
+  int my_len;
+  LIST *vlist=NULL;
+	ncvar* var_ptr;
+	LIST_ELEMENT *lp;
+	ncatt* att_ptr;
+	att.vals = NULL;
+	att.string = NULL;
+
+   /*
+   * Get the dataset pointer.  
+   */
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  See if this variable already exists.
+   */
+  newvar = FALSE;
+  vlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(vlist, varname, NCF_ListTraverse_FoundVarName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    newvar = TRUE;
+  }
+
+  if (newvar != TRUE) {
+		/* If this variable is not new, remove the old definition of it		 */
+		FORTRAN(ncf_delete_var)(dset, varname);
+  }
+	
+	nc_ptr->nvars = nc_ptr->nvars + 1;
+
+   /*
+    * Set variable structure and insert the new variable at the end of the 
+	* variable list. The type is not known at this time.
+    */
+
+  strcpy(var.name,varname);
+  var.type = *type;
+  var.outtype = *type;
+  var.ndims = 6;
+  var.natts = 0;  
+  var.varid = *varid;
+  var.is_axis = *coordvar;
+  var.axis_dir = 0;
+  var.has_fillval = FALSE;
+  var.all_outflag = 1;
+  var.fillval = 0;  /* initialize this */
+  var.attrs_list_initialized = FALSE;
+
+  if ( (var.varattlist = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_add_var: Unable to initialize attributes list.\n");
+      return_val = -1;
+      return return_val; 
+      }
+  var.attrs_list_initialized = TRUE;
+
+   /* Set up initial set of attributes*/
+
+/*  Save the long_name, all variables
+ *  For string attributes, allocate one more than the att.len, 
+ *  presumably for the null terminator for the string (?) */
+
+    var.natts = var.natts+1;
+    strcpy(att.name, "long_name");    
+	att.type = NC_CHAR; 
+	att.outtype = NC_CHAR;
+    att.attid = var.natts;
+    att.outflag = 1;
+    att.len = strlen(title);
+    att.string = (char *) malloc((att.len+1)* sizeof(char));
+    strcpy(att.string, title);
+	
+    att.vals = (double *) malloc(1 * sizeof(double));
+    att.vals[0] = 0; 
+
+    /*Save attribute in linked list of attributes for variable .*/
+    list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+
+/*  Now the units, if given
+ *  For the units string, allocate one more than the att.len, 
+ *  presumably for the null terminator for the string (?)*/
+
+    if (strlen(units) > 0 )
+		{
+		var.natts = var.natts+1;
+
+		att.attid = var.natts;
+		strcpy(att.name, "units");
+		att.len = strlen(units);
+		att.outflag = 1;
+		att.type = NC_CHAR;
+		att.outtype = NC_CHAR;
+		att.string = (char *) malloc((att.len+1)* sizeof(char));
+		strcpy(att.string, units);
+
+        my_len = 1;
+	    att.vals = (double *) malloc(my_len * sizeof(double)); 
+        att.vals[0] = 0;
+
+
+/*Save attribute in linked list of attributes for this variable */	
+	  list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+		}
+
+
+/* Now the missing_value, for numeric variables*/
+/*    if (*type != NC_CHAR)
+    { */
+		var.natts = var.natts+1;
+        var.fillval = *bad;
+
+		att.attid = var.natts;
+		strcpy(att.name,"missing_value");
+		att.len = 1;
+		att.string = NULL;
+#ifdef double_p
+		att.type = NC_FLOAT;
+		att.outtype = NC_FLOAT;
+#else
+		att.type = NC_DOUBLE;
+		att.outtype = NC_DOUBLE;
+#endif
+		att.vals = (double *) malloc(att.len * sizeof(double));
+		att.vals[0] = *bad;
+
+    /* Initialize output flag. Attributes written by default by Ferret
+	   will be set to outflag = 1. 
+	*/
+          att.outflag = initialize_output_flag (att.name, var.is_axis);
+
+      /*Save attribute in linked list of attributes for this variable */	
+
+       list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+ /* 
+
+    /* If this is an aggregate dataset, initialize the list of member-info
+	    for the variable. The values will be filled in later. */
+
+       var.agg_list_initialized = FALSE;
+
+         if ( (var.varagglist = list_init()) == NULL ) {
+             fprintf(stderr, "ERROR: ncf_add_var: Unable to initialize aggregate info list.\n");
+             return_val = -1;
+             return return_val; 
+             }
+         var.agg_list_initialized = TRUE;
+
+         vdescr.imemb = 0;
+         vdescr.gnum = 0;
+         list_insert_after(var.varagglist, (char *) &vdescr, sizeof(ncatt));
+
+/*Save variable in linked list of variables for this dataset */
+
+  list_insert_after(nc_ptr->dsetvarlist, (char *) &var, sizeof(ncvar));
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Add a new variable to the pseudo user-defined coordinate variable dataset.
+ */
+int  FORTRAN(ncf_add_coord_var)( int *dset, int *varid, int *type, int *coordvar, char varname[], char units[], double *bad)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncatt att;
+  ncvar var;
+  int status=LIST_OK;
+  static int return_val;
+  int *i;
+  int newvar;
+  int my_len;
+  LIST *vlist=NULL;
+	att.vals = NULL;
+	att.string = NULL;
+   /*
+   * Get the dataset pointer.  
+   */
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables.  See if this variable already exists.
+   */
+  newvar = FALSE;
+  vlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(vlist, varname, NCF_ListTraverse_FoundVarName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    newvar = TRUE;
+  }
+  nc_ptr->nvars = nc_ptr->nvars + 1;
+
+  if (newvar == TRUE)
+  {
+  }
+  else
+   /* If this variable is not new, remove the old definition of it
+   */
+  {
+  list_remove_curr(vlist);
+
+  }
+  
+/*
+   * initialize the variable definition.
+   */
+       strcpy(var.name, " ");
+
+       var.attrs_list_initialized = FALSE;
+
+       var.type = NC_CHAR;
+       var.outtype = NC_CHAR;
+       var.varid = 0;
+	   var.natts = 0;
+       var.has_fillval = FALSE;
+       var.fillval = NC_FILL_FLOAT;
+	   var.all_outflag = 1;
+	   var.is_axis = FALSE;
+	   var.axis_dir = 0;
+
+
+   /*
+    * Set variable structure and insert the new variable at the end of the 
+	* variable list.
+    */
+
+  strcpy(var.name,varname);
+  var.type = *type;
+  var.outtype = *type;
+  var.ndims = 6;
+  var.natts = 0;  
+  var.varid = nc_ptr->nvars;
+  *varid = nc_ptr->nvars;
+  var.is_axis = *coordvar;
+  var.axis_dir = 0;
+  var.has_fillval = FALSE;
+  var.all_outflag = 1;
+  var.fillval = *bad;
+  var.attrs_list_initialized = FALSE;
+
+  if ( (var.varattlist = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_add_coord_var: Unable to initialize attributes list.\n");
+      return_val = -1;
+      return return_val; 
+      }
+  var.attrs_list_initialized = TRUE;
+
+   /* Set up initial set of attributes*/
+
+/*  Units, if given
+ *  For the units string, allocate one more than the att.len, 
+ *  presumably for the null terminator for the string (?)*/
+
+    if (strlen(units) > 0 )
+		{
+		var.natts = var.natts+1;
+
+		att.attid = var.natts;
+		strcpy(att.name, "units");
+		att.len = strlen(units);
+		att.outflag = 1;
+		att.type = NC_CHAR;
+		att.outtype = NC_CHAR;
+		att.string = (char *) malloc((att.len+1)* sizeof(char));
+		strcpy(att.string, units);
+
+        my_len = 1;
+	    att.vals = (double *) malloc(my_len * sizeof(double)); 
+        att.vals[0] = 0;
+
+      /*Save attribute in linked list of attributes for this variable */	
+
+          var.attrs_list_initialized = TRUE;
+          list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+        }
+
+ /*   } */
+
+/*Save variable in linked list of variables for this dataset */
+
+    list_insert_after(nc_ptr->dsetvarlist, (char *) &var, sizeof(ncvar));
+  
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable based on its variable ID and dataset ID
+ * Add a new numeric attribute.
+ */
+int  FORTRAN(ncf_add_var_num_att)( int *dset, int *varid, char attname[], 
+int *attype, int *attlen, int *outflag, DFTYPE *vals)
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt att;
+  int status=LIST_OK;
+  static int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+	att.vals = NULL;
+	att.string = NULL;
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+    /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is already defined, return -1* attid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status == LIST_OK ) {
+    att_ptr=(ncatt *)list_curr(varattlist); 
+    return_val = -1* att_ptr->attid; 
+    return return_val;
+    }
+
+   /* Increment number of attributes.  
+   */
+
+  var_ptr->natts = var_ptr->natts + 1;
+
+   /*
+    * Set attribute structure and insert the new attribute at 
+	* the end of the attribute list. 
+    */
+
+  strcpy(att.name,attname);
+  att.attid = var_ptr->natts;
+  att.type = *attype;
+#ifdef double_p
+  att.outtype = NC_FLOAT;
+#else
+  att.outtype = NC_DOUBLE;
+#endif
+  att.len = *attlen;
+  att.outflag = *outflag;
+	att.string = NULL;
+  att.vals = (double *) malloc(*attlen * sizeof(double));
+
+  for (i = 0; i<*attlen;i++ )
+  {att.vals[i] = vals[i];
+  }
+
+   /*Save attribute in linked list of attributes for this variable */	
+
+  list_insert_after(var_ptr->varattlist, (char *) &att, sizeof(ncatt));
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable based on its variable ID and dataset ID
+ * Add a new numeric attribute.
+ */
+int  FORTRAN(ncf_add_var_num_att_dp)( int *dset, int *varid, char attname[], int *attype, int *attlen, int *outflag, double *vals)
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt att;
+  int status=LIST_OK;
+  static int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+	att.vals = NULL;
+	att.string = NULL;
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+    /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is already defined, return -1* attid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status == LIST_OK ) {
+    att_ptr=(ncatt *)list_curr(varattlist); 
+    return_val = -1* att_ptr->attid; 
+    return return_val;
+    }
+
+   /* Increment number of attributes.  
+   */
+
+  var_ptr->natts = var_ptr->natts + 1;
+
+   /*
+    * Set attribute structure and insert the new attribute at 
+	* the end of the attribute list. 
+    */
+
+  strcpy(att.name,attname);
+  att.attid = var_ptr->natts;
+  att.type = *attype;
+  att.outtype = NC_DOUBLE;
+  att.len = *attlen;
+  att.outflag = *outflag;
+	att.string = NULL;
+  att.vals = (double *) malloc(*attlen * sizeof(double));
+
+  for (i = 0; i<*attlen;i++ )
+  {att.vals[i] = vals[i];
+  }
+
+   /*Save attribute in linked list of attributes for this variable */	
+
+  list_insert_after(var_ptr->varattlist, (char *) &att, sizeof(ncatt));
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable  based on its variable ID and dataset ID
+ * Add a new string attribute.
+ */
+int  FORTRAN(ncf_add_var_str_att)( int *dset, int *varid, char attname[], int *attype, int *attlen, int *outflag, char attstring[])
+
+{
+  ncdset *nc_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt att;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+	att.vals = NULL;
+	att.string = NULL;
+
+   /*
+   * Get the dataset pointer.  
+   */
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  
+    /*
+    * here if natts < 1 we should initialize the list!
+    */
+      /*Save attribute in linked list of attributes for variable */	
+  if (!var_ptr->attrs_list_initialized) {
+    if ( (var_ptr->varattlist = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: add_var_str_att: Unable to initialize attributes list.\n");
+      return_val = -1;
+      return return_val; 
+     }
+    var_ptr->attrs_list_initialized = TRUE;
+  }
+
+    /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is already defined, return -1* attid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status == LIST_OK ) {
+    att_ptr=(ncatt *)list_curr(varattlist); 
+    return_val = -1* att_ptr->attid; 
+
+    return return_val;
+    }
+
+   /* Increment number of attributes.  
+   */
+  if (*varid == 0)
+  { nc_ptr->ngatts = nc_ptr->ngatts + 1; 
+  }
+
+  var_ptr->natts = var_ptr->natts + 1;
+
+   /*
+    * Set attribute structure and insert the new attribute at 
+	* the end of the attribute list. 
+	
+    *  For string attributes, allocate one more than the att.len, 
+    *  presumably for the null terminator for the string (?)
+    */
+
+  strcpy(att.name,attname);
+  att.attid = var_ptr->natts;
+  att.type = *attype;
+  att.outtype = NC_CHAR;
+  att.len = *attlen;
+  att.outflag = *outflag;
+  att.string = (char *) malloc((att.len+1)* sizeof(char));
+  strcpy(att.string, attstring);
+
+      /*Save attribute in linked list of attributes for this variable */	
+
+
+ list_insert_after(var_ptr->varattlist, (char *) &att, sizeof(ncatt));
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a variable based on its variable ID and dataset ID
+ * Replace the variable name with the new one passed in.
+ */
+
+int  FORTRAN(ncf_rename_var)( int *dset, int *varid, char newvarname[])
+
+{
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+  /* Insert the new name. */
+  strcpy( var_ptr->name, newvarname); 
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find an attribute based on its variable ID and dataset ID
+ * Replace the type, length, and/or value(s).
+ */
+int  FORTRAN(ncf_repl_var_att)( int *dset, int *varid, char attname[], int *attype, int *attlen, DFTYPE *vals, char attstring[])
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is not defined, return
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+   /*
+    * Get the attribute.
+    */
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+   /*
+    * Free the memory used by the string or values 
+    */
+  if (att_ptr->type == NC_CHAR)
+  {
+	  /*free(att_ptr->string);
+  }
+  else
+  {
+	  free(att_ptr->vals);*/
+  }
+  
+
+   /*
+    * Keep the name and ID. Reset type, length, and values
+    *  For string attributes, allocate one more than the att.len, 
+    *  presumably for the null terminator for the string (?)
+    */
+
+  att_ptr->type = *attype;
+  att_ptr->outtype = NC_FLOAT;
+  att_ptr->len = *attlen;
+
+  if (*attlen == 0) /* set 0-length attributes to empty strings */
+	  {
+		  att_ptr->type = NC_CHAR;
+		  att_ptr->outtype = NC_CHAR;
+		  att_ptr->len = 1;
+			att_ptr->string = (char *) malloc(2*sizeof(char));
+		  strcpy(att_ptr->string," ");
+	  }
+   else
+	  {
+	   switch (*attype) 
+		   {
+		   case NC_CHAR:
+			   i = (*attlen+1);   /* this line for debugging*/
+	        att_ptr->string = (char *) malloc((*attlen+1)* sizeof(char));
+            strcpy(att_ptr->string,attstring);
+            break;
+			
+		   default:
+            att_ptr->vals = (double *) malloc(*attlen * sizeof(double));
+	        for (i = 0; i<*attlen;i++ )
+            {
+				att_ptr->vals[i] = vals[i];
+            }
+            break;
+         }
+	  }
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find an attribute based on its variable ID and dataset ID
+ * Replace the type, length, and/or value(s).
+ */
+int  FORTRAN(ncf_repl_var_att_dp)( int *dset, int *varid, char attname[], int *attype, int *attlen, double *vals, char attstring[])
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is not defined, return
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+   /*
+    * Get the attribute.
+    */
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+   /*
+    * Free the memory used by the string or values 
+    */
+  /*
+  if (att_ptr->type == NC_CHAR)
+  {
+	  free(att_ptr->string);
+  }
+  else
+  {
+	  free(att_ptr->vals);
+  }
+  */
+  
+
+   /*
+    * Keep the name and ID. Reset type, length, and values
+    *  For string attributes, allocate one more than the att.len, 
+    *  presumably for the null terminator for the string (?)
+    */
+
+  att_ptr->type = *attype;
+#ifdef double_p
+  att_ptr->outtype = NC_DOUBLE;
+#else
+  att_ptr->outtype = NC_FLOAT;
+#endif
+  att_ptr->len = *attlen;
+
+  if (*attlen == 0) /* set 0-length attributes to empty strings */
+	  {
+		  att_ptr->type = NC_CHAR;
+		  att_ptr->outtype = NC_CHAR;
+		  att_ptr->len = 1;
+			att_ptr->string = (char *) malloc(2* sizeof(char));
+		  strcpy(att_ptr->string," ");
+	  }
+   else
+	  {
+	   switch (*attype) 
+		   {
+		   case NC_CHAR:
+			   i = (*attlen+1);   /* this line for debugging*/
+	        att_ptr->string = (char *) malloc((*attlen+1)* sizeof(char));
+            strcpy(att_ptr->string,attstring);
+            break;
+			
+		   default:
+            att_ptr->vals = (double *) malloc(*attlen * sizeof(double));
+	        for (i = 0; i<*attlen;i++ )
+            {
+				att_ptr->vals[i] = vals[i];
+            }
+            break;
+         }
+	  }
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * Find an attribute based on its variable ID and dataset ID
+ * Delete it.
+ */
+int  FORTRAN(ncf_delete_var_att)( int *dset, int *varid, char attname[])
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  int att_to_remove;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is not defined, return
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+   /*
+    * Get the attribute.
+    */
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+	  att_ptr=(ncatt *)list_curr(varattlist); 
+      att_to_remove = att_ptr->attid;
+
+  /* 
+   * reset the attribute id for remaining attributes
+   */
+
+  for (i = 1; i <= var_ptr->natts; i++ )
+	  {
+
+	  status = list_traverse(varattlist, (char *) &i, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+	  if ( status != LIST_OK ) 
+		  {
+		  return_val = ATOM_NOT_FOUND;
+		  return return_val;
+		  }
+
+	  att_ptr=(ncatt *)list_curr(varattlist); 
+
+	  /*
+	  * Reset the attribute id?
+	  */
+
+	  if (i > att_to_remove) att_ptr->attid = att_ptr->attid -1;
+
+	  }  /* end of iatt loop*/   
+
+   /*
+    * Now get and remove the attribute.
+    */
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+  list_remove_curr(varattlist);
+  
+   /* Decrement number of attributes for the variable.  
+   */
+
+  var_ptr->natts = var_ptr->natts - 1;
+
+
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ---- 
+ * Find an attribute based on its variable ID and dataset ID
+ * Change its output flag: 1=output it, 0=dont.
+ */
+int  FORTRAN(ncf_set_att_flag)( int *dset, int *varid, char attname[], int *attoutflag)
+
+{
+  ncatt *att_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+  if (var_ptr->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+    * Get the list of attributes for the variable in the dataset
+    * If the attribute is not defined, return
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  status = list_traverse(varattlist, attname, NCF_ListTraverse_FoundVarAttName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+   /*
+    * Get the attribute.
+    */
+  att_ptr=(ncatt *)list_curr(varattlist); 
+
+   /*
+    * Keep the attribute as is, but reset its output flag.
+    */
+
+  att_ptr->outflag = *attoutflag;
+
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * Find variable based on its variable ID and dataset ID
+ * Change the variable flag: 
+ * 1=output no attributes, 
+   0=check individual attribute output flags,
+   2=write all attributes, except any internal Ferret
+     attributes, marked with outflag=-1.
+*  3=reset attr flags to defaults
+ */
+int  FORTRAN(ncf_set_var_out_flag)( int *dset, int *varid, int *all_outflag)
+
+{
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  int *iatt;
+  LIST *varlist;
+  LIST *varattlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+   /*
+    * Keep the default if there are no attributes
+    */
+
+  if (var_ptr->natts < 1)
+  {
+	  var_ptr->all_outflag = 1;
+	  return FERR_OK;
+  }
+
+   /*
+    * Reset the variable output flag.
+    */
+  var_ptr->all_outflag = *all_outflag;
+  if (*all_outflag == 0)
+
+  {
+   /*
+    * Get the list of attributes for the variable varid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  /* 
+   * reset the output flag for each attribute
+   */
+  for (i = 1; i <= var_ptr->natts; i++ )
+	  {
+	  /* *iatt = i; */
+
+	  status = list_traverse(varattlist, (char *) &i, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+	  if ( status != LIST_OK ) 
+		  {
+		  return_val = ATOM_NOT_FOUND;
+		  return return_val;
+		  }
+
+   /*
+    * Get the attribute.
+    */
+	  att_ptr=(ncatt *)list_curr(varattlist); 
+
+	  /*
+	  * Reset the attribute output flag.
+	  */
+
+	  att_ptr->outflag = 0;
+
+	  }  /* end of iatt loop*/   
+
+  }
+
+
+  else if (*all_outflag == 2)
+
+  {
+   /*
+    * Get the list of attributes for the variable varid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  /* 
+   * reset the output flag for each attribute
+   */
+
+  for (i = 1; i <= var_ptr->natts; i++ )
+ {
+	 /* *iatt = i; */
+	 status = list_traverse(varattlist, (char *) &i, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+	  if ( status != LIST_OK ) 
+		  {
+		  return_val = ATOM_NOT_FOUND;
+		  return return_val;
+		  }
+
+   /*
+    * Get the attribute.
+    */
+
+	  att_ptr=(ncatt *)list_curr(varattlist); 
+
+	  /*
+	  * Reset the attribute output flag.
+	  */
+
+	  if (att_ptr->outflag != -1) att_ptr->outflag = 1;
+
+
+	  }  /* end of iatt loop*/   
+
+ }
+
+  else if  (*all_outflag == 3)
+
+  {
+
+   /*
+    * Get the list of attributes for the variable varid
+    */
+  varattlist = ncf_get_ds_var_attlist(dset, varid);
+
+  /* 
+   * reset the output flag for each attribute to the default Ferret value 
+   */
+  for (i = 1; i <= var_ptr->natts; i++ )
+	  {
+	  /* *iatt = i; */
+	  status = list_traverse(varattlist, (char *) &i, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+	  if ( status != LIST_OK ) {
+	    return_val = ATOM_NOT_FOUND;
+	    return return_val;
+	  }
+
+   /*
+    * Get the attribute.
+    */
+	  att_ptr=(ncatt *)list_curr(varattlist); 
+
+	  /*
+	  * Reset the attribute output flag to the Ferret default value
+	    (output missing flag, etc, but not nonstd attributes from
+		the input file or user definitions.)
+	  */
+
+	  att_ptr->outflag = initialize_output_flag(att_ptr->name, var_ptr->is_axis);
+
+	  }  /* end of iatt loop*/   
+  }
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * Find variable based on its variable ID and dataset ID
+ * Change the variable output type.
+ */
+int  FORTRAN(ncf_set_var_outtype)( int *dset, int *varid, int *outtype)
+
+{
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+   /*
+    * Reset the variable output type.
+    */
+  var_ptr->outtype = *outtype;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * Find variable based on its variable ID and dataset ID
+ * Check that its a coordinate variable and set the axis direction.
+ */
+
+int  FORTRAN(ncf_set_axdir)( int *dset, int *varid, int *axdir)
+
+{
+  ncvar *var_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+  varlist = ncf_get_ds_varlist(dset);
+
+  return_val = ATOM_NOT_FOUND;
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+   /*
+    * Reset the variable output type.
+    */
+  return_val = ATOM_NOT_FOUND;
+  if (var_ptr->is_axis)
+  {
+	 var_ptr->axis_dir = *axdir;
+	 return_val = FERR_OK;
+  }
+
+  return return_val;
+}
+
+/* ---- 
+ * Find an attribute based on its dataset ID, variable ID and attribute ID
+ * Add the attribute to variable 2 in dataset 2
+ */
+int  FORTRAN(ncf_transfer_att)(int *dset1, int *varid1, int *iatt, int *dset2, int *varid2)
+
+{
+  ncatt *att_ptr1=NULL;
+  ncatt att;
+  ncvar *var_ptr1=NULL;
+  ncvar *var_ptr2=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int i;
+  LIST *varlist1;
+  LIST *varlist2;
+  LIST *varattlist1;
+  LIST *varattlist2;
+	att.vals = NULL;
+	att.string = NULL;
+   /*
+    * Get the list of variables in dset1, find pointer to variable varid1.
+    */
+  varlist1 = ncf_get_ds_varlist(dset1);
+
+  status = list_traverse(varlist1, (char *) varid1, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr1=(ncvar *)list_curr(varlist1); 
+  if (var_ptr1->natts < 1) return ATOM_NOT_FOUND;
+
+   /*
+    * Get the list of attributes for the variable varid1
+    * If the attribute is not defined, return
+    */
+  varattlist1 = ncf_get_ds_var_attlist(dset1, varid1);
+
+  status = list_traverse(varattlist1, (char *) iatt, NCF_ListTraverse_FoundVarAttID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+    }
+
+   /*
+    * Get the attribute.
+    */
+  att_ptr1=(ncatt *)list_curr(varattlist1); 
+
+   /*
+    * Get the list of variables in dset2, find pointer to variable varid2
+    */
+  varlist2 = ncf_get_ds_varlist(dset2);
+
+  status = list_traverse(varlist2, (char *) varid2, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr2=(ncvar *)list_curr(varlist2); 
+  
+   /*
+    * Get the list of attributes for the variable varid2
+    */
+  varattlist2 = ncf_get_ds_var_attlist(dset2, varid2);
+
+   /* Increment number of attributes for varid2
+   */
+
+  var_ptr2->natts = var_ptr2->natts + 1;
+
+   /*
+    * Set attribute structure and insert the new attribute at 
+	* the end of the attribute list. 
+    *  For string attributes, allocate one more than the att.len, 
+    *  presumably for the null terminator for the string (?)
+    */
+  strcpy(att.name, att_ptr1->name);
+  att.attid = var_ptr2->natts;
+  att.type = att_ptr1->type;
+  att.outtype = att_ptr1->type;
+  att.len = att_ptr1->len;
+  att.outflag = att_ptr1->outflag;
+  
+  if (att_ptr1->type == NC_CHAR)
+  {
+	  att.string = (char *) malloc((att_ptr1->len+1)* sizeof(char)); 
+	  strcpy(att.string, att_ptr1->string);
+  }
+  else
+  {
+	  att.vals = (double *) malloc(att_ptr1->len * sizeof(double));
+	  for (i = 0; i<att_ptr1->len;i++ )
+		  {att.vals[i] = att_ptr1->vals[i];
+		  }
+  }
+
+  /*Save attribute in linked list of attributes for this variable */	
+
+  list_insert_after(var_ptr2->varattlist, (char *) &att, sizeof(ncatt));
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * Find variable based on the dataset ID and variable name
+ * Delete it.
+ */
+int  FORTRAN(ncf_delete_var)( int *dset, char *varname)
+
+{
+  ncdset *nc_ptr=NULL;
+  ncvar *var_ptr=NULL;
+  ncatt *att_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+	LIST_ELEMENT *lp;
+
+ /* Find the dataset based on its integer ID 
+ */
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+   /*
+   * Get the list of variables. Find varname in the dataset.
+   */
+  varlist = ncf_get_ds_varlist(dset);
+  status = list_traverse(varlist, varname, NCF_ListTraverse_FoundVarName, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  /* Deallocate the list of attributes, and remove the 
+   * variable from the dataset list */
+	lp = varlist->curr;
+	var_ptr = (ncvar*)lp->data;
+	/* Free the attributes for this var (list data). */
+	ncf_free_attlist(var_ptr);
+	/* Free the list. */
+	list_free(var_ptr->varattlist, LIST_DEALLOC);
+
+	list_remove_curr(varlist);
+  free(var_ptr);
+   /* Decrement number of variables in the dataset.  
+    */
+
+  nc_ptr->nvars = nc_ptr->nvars - 1;
+
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Initialize new dataset to contain an aggregate dataset 
+ * save in GLOBAL_ncdsetList for attribute handling 
+ */
+
+int FORTRAN(ncf_init_agg_dset)(int *setnum, char name[])
+
+{
+  ncdset nc; 
+  static int return_val=FERR_OK; /* static because it needs to exist after the return statement */
+  
+    int i;				/* loop controls */
+	int ia;
+	int iv;
+    ncatt att;			/* attribute */
+    ncvar var;			/* variable */
+	ncagg agg;			/* list of aggregate datset members */
+	att.vals = NULL;
+	att.string = NULL;
+    strcpy(nc.fername, name);
+    nc.fer_dsetnum = *setnum;
+
+    nc.ngatts = 1;
+    nc.nvars = 0;
+	nc.recdim = -1;
+	nc.ndims = 6;
+	nc.its_agg = 1;
+	nc.num_agg_members = 0;
+    nc.vars_list_initialized = FALSE;
+    nc.agg_list_initialized = FALSE;
+
+   /* set up pseudo-variable . the list of variables */
+
+       strcpy(var.name, ".");
+
+       var.attrs_list_initialized = FALSE;
+
+       var.type = NC_CHAR;
+       var.outtype = NC_CHAR;
+       var.varid = 0;
+	   var.natts = nc.ngatts;
+       var.has_fillval = FALSE;
+#ifdef double_p
+	   var.fillval = NC_FILL_DOUBLE;
+#else
+	   var.fillval = NC_FILL_FLOAT;
+#endif
+	   var.all_outflag = 1;
+	   var.is_axis = FALSE;
+	   var.axis_dir = 0;		
+	   var.ndims = 0;
+	   var.attrs_list_initialized = FALSE; 
+
+   /* set global attribute, aggregate name */
+
+		  att.outflag = 1;
+          att.type = NC_CHAR;
+          att.outtype = NC_CHAR;
+          att.outflag = 0;
+          att.attid = 1;
+		  att.len = strlen(name);
+          strcpy(att.name, "aggregate name" );
+
+	      att.string = (char *) malloc((att.len+1)* sizeof(char));
+		  strcpy(att.string, name );
+
+      /*Save attribute in linked list of attributes for variable .*/	
+       if (!var.attrs_list_initialized) {
+          if ( (var.varattlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_agg_dset: Unable to initialize GLOBAL attributes list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          var.attrs_list_initialized = TRUE;
+       }
+
+		  list_insert_after(var.varattlist, (char *) &att, sizeof(ncatt));
+
+       /* global attributes list complete */
+
+   /* Initialize linked list of variables for this dataset */	
+       if (!nc.vars_list_initialized) {
+          if ( (nc.dsetvarlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_agg_dset: Unable to initialize variable list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.vars_list_initialized = TRUE;
+        }
+
+       list_insert_after(nc.dsetvarlist, (char *) &var, sizeof(ncvar));
+
+  /*Initialize list of aggregate members for this dataset */	
+       if (!nc.agg_list_initialized) {
+          if ( (nc.agg_dsetlist = list_init()) == NULL ) {
+            fprintf(stderr, "ERROR: ncf_init_agg_dset: Unable to initialize aggregate list.\n");
+            return_val = -1;
+            return return_val; 
+          }
+          nc.agg_list_initialized = TRUE;
+        }
+       
+
+/* Add dataset to global nc dataset linked list*/ 
+  if (!list_initialized) {
+    if ( (GLOBAL_ncdsetList = list_init()) == NULL ) {
+      fprintf(stderr, "ERROR: ncf_init_uvar_dset: Unable to initialize GLOBAL_ncDsetList.\n");
+      return_val = -1;
+      return return_val; 
+	}
+    list_initialized = TRUE;
+  }
+
+  list_insert_after(GLOBAL_ncdsetList, (char *) &nc, sizeof(ncdset));
+  return_val = FERR_OK;
+  return return_val;
+  }
+
+/* ----
+ * Add a new aggregate member to an aggregate dataset.
+ */
+int  FORTRAN(ncf_add_agg_member)( int *dset, int *member_dset)
+
+{
+  ncdset *nc_ptr=NULL;
+  int status=LIST_OK;
+  static int return_val;
+  LIST *elist=NULL;
+  ncagg agg_ptr;
+  int i;
+
+   /*
+   * Get the dataset pointer.  
+   */
+  return_val = ATOM_NOT_FOUND;  
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL )return return_val;
+
+  /*Save aggregate member number in linked list of aggregate members for this dataset */	
+
+   /*
+   * Get the list of aggregate members. Put the new info at the end.
+   */
+  elist = ncf_get_ds_agglist(dset);
+  agg_ptr.dsetnum = *member_dset;
+
+  list_insert_after(nc_ptr->agg_dsetlist, (char *) &agg_ptr, sizeof(agg_ptr));
+
+  nc_ptr->num_agg_members = nc_ptr->num_agg_members + 1;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ * Find a dataset based on its integer ID and return the 
+ * number of aggregate member datasets
+ */
+
+int  FORTRAN(ncf_get_agg_count)( int *dset, int *num_agg_dsets)
+{
+  ncdset *nc_ptr=NULL;
+  int return_val;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+
+  *num_agg_dsets = nc_ptr->num_agg_members;
+
+  return_val = FERR_OK; 
+  return return_val; 
+}
+
+
+/* ----
+ * Find a dataset based on its integer ID and for a given member number
+ * return the Ferret dataset number
+ * 
+ */
+
+int  FORTRAN(ncf_get_agg_member)( int *dset, int *imemb, int *membset)
+{
+  ncdset *nc_ptr=NULL;
+  ncagg *agg_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  int num_agg_dsets;
+  
+  LIST *agglist;
+
+  return_val = ATOM_NOT_FOUND;
+  if ( (nc_ptr = ncf_ptr_from_dset(dset)) == NULL ) { return return_val; }
+
+   /*
+   * Get the list of aggregation members.  
+   */
+
+  agglist = ncf_get_ds_agglist(dset);
+
+  status = list_traverse(agglist, (char *) imemb, NCF_ListTraverse_FoundDsMemb, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) {
+    return_val = ATOM_NOT_FOUND;
+    return return_val;
+  }
+  
+  agg_ptr=(ncagg *)list_curr(agglist); 
+
+  *membset = agg_ptr->dsetnum;
+
+  return_val = FERR_OK; 
+  return return_val; 
+}
+
+
+/* ----
+ * Add description for variable in aggregate dataset.
+ * Given the aggregate dataset, and the varid of the variable, and 
+ * the aggregate sequence-number, save the variable type (1=file-variable, 
+ * 3=user-var), the Ferret datset id, the grid, the Ferret line number
+ * for the aggregate dimension, and the sequence number in ds_var_code 
+ * or uvar_name_code.
+ */
+int  FORTRAN(ncf_add_agg_var_info)( int *dset, int *varid, int *imemb,
+int *vtype, int *datid, int *igrid, int *iline, int *nv)
+
+{
+  ncvar *var_ptr=NULL;
+  ncagg_var_descr vdescr;
+  int status=LIST_OK;
+  static int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varagglist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+    /*
+    * Get the list of members for the variable in the dataset
+    */
+  varagglist = ncf_get_ds_var_gridlist(dset, varid);
+
+  vdescr.imemb = *imemb;
+  vdescr.vtype = *vtype;
+  vdescr.datid = *datid;
+  vdescr.gnum  = *igrid;
+  vdescr.iline  = *iline;
+  vdescr.nv    = *nv;
+
+   /* Increment number of grid values saved.  
+   */
+
+  var_ptr->nmemb = var_ptr->nmemb + 1;
+
+   /*Save grid number in linked list of grid for this variable */	
+
+  list_insert_after(var_ptr->varagglist, (char *) &vdescr, sizeof(ncagg_var_descr));
+
+
+  return_val = FERR_OK;
+  return return_val;
+}
+	  
+/* ----
+ * For a variable in aggregate aggregate dataset, store its grid.
+ * Given the aggregate dataset, the varid of the variable, and 
+ * the aggregate sequence-number, save the grid of the variable.
+ */
+int  FORTRAN(ncf_put_agg_memb_grid)( int *dset, int *varid, int *imemb, int *igrid)
+
+{
+  ncvar *var_ptr=NULL;
+  ncagg_var_descr vdescr;
+  int status=LIST_OK;
+  static int return_val;
+  int i;
+  LIST *varlist;
+  LIST *varagglist;
+
+   /*
+    * Get the list of variables, find pointer to variable varid.
+    */
+
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+    /*
+    * Get the list of members for the variable in the dataset. Reset grid number.
+    */
+  varagglist = ncf_get_ds_var_gridlist(dset, varid);
+  vdescr.gnum  = *igrid;
+
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ----
+ *
+ * Given the aggregate dataset, varid, and member number, return the 
+ * variable type (1=file-variable, 3=user-var), the Ferret datset id, 
+ * the grid and the sequence number in ds_var_code or uvar_name_code.
+ */
+int  FORTRAN(ncf_get_agg_var_info)( int *dset, int *varid, int *imemb, int* vtype, 
+ int* datid, int *igrid, int *iline, int *nv)
+
+{
+	
+  ncvar *var_ptr=NULL;
+  ncagg_var_descr *vdescr_ptr=NULL;
+  int status=LIST_OK;
+  int return_val;
+  LIST *varlist;
+  LIST *varagglist;
+
+   /*
+   * Get the list of variables, find variable varid.
+   */
+  varlist = ncf_get_ds_varlist(dset);
+
+  status = list_traverse(varlist, (char *) varid, NCF_ListTraverse_FoundVarID, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  var_ptr=(ncvar *)list_curr(varlist); 
+
+   /*
+   * Get the list of aggregate-grids for the variable in the dataset
+   */
+  varagglist = ncf_get_ds_var_gridlist(dset, varid);
+
+  status = list_traverse(varagglist, (char *) imemb, NCF_ListTraverse_FoundVariMemb, (LIST_FRNT | LIST_FORW | LIST_ALTR));
+  if ( status != LIST_OK ) return ATOM_NOT_FOUND;
+
+  vdescr_ptr=(ncagg_var_descr *)list_curr(varagglist); 
+
+  *vtype = vdescr_ptr->vtype;
+  *datid = vdescr_ptr->datid;
+  *igrid = vdescr_ptr->gnum;
+  *iline = vdescr_ptr->iline;
+  *nv    = vdescr_ptr->nv;
+  return_val = FERR_OK;
+  return return_val;
+}
+
+/* ---- 
+ * For attributes that Ferret always writes, set the output flag to 1
+   All others are not written by default. The flag can be set to 1 by the user.
+   The modulo flag is set to 0. This will be overriden ni the Ferret code
+   depending on the value of the modulo attribute.
+  */
+
+static int initialize_output_flag (char *attname, int is_axis)
+{
+	int return_val;
+    return_val = 0;
+
+    /* attributes on coordinate variables */
+	if (strcmp(attname,"axis")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"units")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"calendar")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"positive")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"point_spacing")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"modulo")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"time_origin")==0)
+	{return_val = 1;
+	}
+    /* attributes on variables */
+	if (strcmp(attname,"missing_value")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"_FillValue")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"long_name")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"title")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"history")==0)
+	{return_val = 1;
+	}
+	if (strcmp(attname,"bounds")==0)
+	{return_val = 1;
+	}
+    /* write scale attributes on non-coordinate variables */
+	if (is_axis==0)
+	{
+	   if (strcmp(attname,"scale_factor")==0)
+	   {return_val = 1;
+	   }
+	   if (strcmp(attname,"add_offset")==0)
+	   {return_val = 1;
+	   }
+	}
+	return return_val;
+
+}
+
+/* ---- 
+ * See if the name in data matches the ferret dset name in 
+ * curr. Ferret always capitalizes everything so be case INsensitive.
+ */
+int NCF_ListTraverse_FoundDsetName( char *data, char *curr )
+{
+  ncdset *nc_ptr=(ncdset *)curr; 
+
+  if ( !strcasecmp(data, nc_ptr->fername) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the dataset id in data matches the ferret dset id in curr.
+ */
+int NCF_ListTraverse_FoundDsetID( char *data, char *curr )
+{
+  ncdset *nc_ptr=(ncdset *)curr; 
+  int ID=*((int *)data);
+
+  if ( ID == nc_ptr->fer_dsetnum ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the name in data matches the variable name in 
+ * curr. Ferret always capitalizes everything so be case INsensitive,
+ * unless the string has been passed in inside single quotes.
+ */
+int NCF_ListTraverse_FoundVarName( char *data, char *curr )
+{
+  ncvar *var_ptr=(ncvar*)curr;
+
+  if ( !strcasecmp(data, var_ptr->name) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the name in data matches the variable name in 
+ * curr. Make the string comparison case-sensive.
+ */
+int NCF_ListTraverse_FoundVarNameCase( char *data, char *curr )
+{
+  ncvar *var_ptr=(ncvar*)curr;
+
+  if ( !strcmp(data, var_ptr->name) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the ID in data matches the variable ID in curr. 
+ */
+int NCF_ListTraverse_FoundVarID( char *data, char *curr )
+{
+  ncvar *var_ptr=(ncvar*)curr; 
+  int ID=*((int *)data);
+
+   if ( ID == var_ptr->varid)  {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the name in data matches the attribute name in curr.
+ */
+int NCF_ListTraverse_FoundVarAttName( char *data, char *curr )
+{
+  ncatt *att_ptr=(ncatt *)curr;
+
+  if ( !strcasecmp(data, att_ptr->name) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if the name in data matches the attribute name in curr. 
+ * Make the string comparison case-sensive.
+ */
+int NCF_ListTraverse_FoundVarAttNameCase( char *data, char *curr )
+{
+  ncatt *att_ptr=(ncatt *)curr;
+
+  if ( !strcmp(data, att_ptr->name) ) {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+/* ---- 
+ * See if there is an ID in data matches the attribute id in curr.
+ */
+int NCF_ListTraverse_FoundVarAttID( char *data, char *curr )
+{
+  ncatt *att_ptr=(ncatt *)curr;
+  int ID=*((int *)data);
+
+  if ( ID== att_ptr->attid)  {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+/* ---- 
+ * See if there is an ID in data matches the dset-member id.
+ */
+int NCF_ListTraverse_FoundVariMemb( char *data, char *curr )
+{
+  ncagg_var_descr *vdescr_ptr=(ncagg_var_descr *)curr;
+  int ID=*((int *)data);
+
+  if ( ID== vdescr_ptr->imemb)  {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
+
+
+/* ---- 
+ * See if there is an ID in data matches the dset-member id.
+ */
+int NCF_ListTraverse_FoundDsMemb( char *data, char *curr )
+{
+
+  ncagg *agg_ptr=(ncagg *)curr;
+  int ID=*((int *)data);
+
+  if ( ID== agg_ptr->dsetnum)  {
+    return FALSE; /* found match */
+  } else
+    return TRUE;
+}
diff --git a/fmt/src/SOURCE_FILES b/fmt/src/SOURCE_FILES
new file mode 100644
index 0000000..388d087
--- /dev/null
+++ b/fmt/src/SOURCE_FILES
@@ -0,0 +1,340 @@
+SRCS_F = \
+cd_abort_grids.F\
+cd_add_coord_var.F\
+cd_add_agg_var_info.F\
+cd_add_var.F\
+cd_assoc_grids.F\
+cd_axis_name.F\
+cd_axis_outname.F\
+cd_axlen.F\
+cd_childax_name.F\
+cd_clean_grids.F\
+cd_close_set.F\
+cd_consistent_axis_orient.F\
+cd_conventions_out.F\
+cd_defer_coord_write.F\
+cd_delete_attribute.F\
+cd_dods_control.F\
+cd_dset_remoteok.F\
+cd_encode_url.F\
+cd_get_1_axis.F\
+cd_get_1_dep_var.F\
+cd_get_agg_dset_info.F\
+cd_get_agg_dset_member.F\
+cd_get_attrib.F\
+cd_get_attval.F\
+cd_get_attvalc.F\
+cd_get_attval_l.F\
+cd_get_bounds.F\
+cd_get_chunk_cache.F\
+cd_get_dim_id.F\
+cd_get_ds_dims.F\
+cd_get_ds_info.F\
+cd_get_agg_var_info.F\
+cd_get_generic_bounds.F\
+cd_get_generic_grids.F\
+cd_get_line_direction.F\
+cd_get_missing_flag.F\
+cd_get_parent_grids.F\
+cd_get_time_axis.F\
+cd_get_tmap_parms.F\
+cd_get_var_att_id.F\
+cd_get_var_att_info.F\
+cd_get_var_att_name.F\
+cd_get_var_id.F\
+cd_get_var_info.F\
+cd_get_var_outflag.F\
+cd_get_var_outtype.F\
+cd_init_dset.F\
+cd_init_agg_dset.F\
+cd_isit_another_dset.F\
+cd_isit_epic.F\
+cd_isit_recdim.F\
+cd_load_dset_attrs.F\
+cd_make_var.F\
+cd_ncclose.F\
+cd_ncopen.F\
+cd_nf_get_bad.F\
+cd_nf_get_varid.F\
+cd_nf_get_var_grid.F\
+cd_open_dset.F\
+cd_open_out.F\
+cd_put_agg_memb_grid.F\
+cd_put_new_attr.F\
+cd_put_new_attr_dp.F\
+cd_rd_ep_1.F\
+cd_rd_ep_arr.F\
+cd_rd_r8_1.F\
+cd_rd_r8_arr.F\
+cd_rd_r8_bnds.F\
+cd_rd_ymd_1.F\
+cd_rd_ymd_arr.F\
+cd_read.F\
+cd_read_remote.F\
+cd_rec_synch.F\
+cd_rename_var.F\
+cd_replace_attr.F\
+cd_replace_attr_dp.F\
+cd_scan_vars.F\
+cd_set_att_axdir.F\
+cd_set_att_flag.F\
+cd_set_chunk_cache.F\
+cd_set_compress.F\
+cd_set_mode.F\
+cd_set_var_type.F\
+cd_stamp_out.F\
+cd_store_dset.F\
+cd_store_dset_attrs.F\
+cd_transfer_attribute.F\
+cd_translate_error.F\
+cd_use_recdim.F\
+cd_write_attrib.F\
+cd_write_attval.F\
+cd_write_attval_dp.F\
+cd_write_axis.F\
+cd_write_bndsdim.F\
+cd_write_defer_coord.F\
+cd_write_grid.F\
+cd_write_strdim.F\
+cd_write_var.F\
+encode_strings_data.F\
+ez_init_dset.F\
+ez_init_permute.F\
+ez_mod_dset.F\
+ez_mod_vars.F\
+ez_permuted_index.F\
+ez_read.F\
+ez_update_var.F\
+gt_get_time_axis.F\
+lib_free_lun.F\
+lib_get_lun.F\
+mc_init_dset.F\
+mc_read.F\
+remote_read.F\
+str_case_blind_compare.F\
+str_dncase.F\
+str_same.F\
+str_upcase.F\
+nc_get_attrib.F\
+nc_get_attrib_dp.F\
+nc_get_attrib_float.F\
+nc_get_attrib_string.F\
+tm_abstract_axis.F\
+tm_add_message.F\
+tm_allo_dyn_grid.F\
+tm_allo_dyn_line.F\
+tm_allo_dyn_grid_sub.F\
+tm_allo_dyn_line_sub.F\
+tm_allo_tmp_grid.F\
+tm_allo_tmp_line.F\
+tm_alternate_note.F\
+tm_axes_reversed.F\
+tm_axis_direction.F\
+tm_axis_order.F\
+tm_axis_recursive.F\
+tm_axis_stride.F\
+tm_break_date.F\
+tm_break_fmt_date.F\
+tm_break_lines.F\
+tm_break_str.F\
+tm_check_box_loc.F\
+tm_check_bnds.F\
+tm_check_bnds_attrib.F\
+tm_check_bnds_centered.F\
+tm_check_edges_attrib.F\
+tm_choose_read.F\
+tm_clean_filename.F\
+tm_close_set.F\
+tm_close_step.F\
+tm_cmprss.F\
+tm_conv_to_r4.F\
+tm_conv_to_r8.F\
+tm_copy_grid.F\
+tm_copy_grid_w_line_use.F\
+tm_copy_line.F\
+tm_ctof_strng.F\
+tm_date.F\
+tm_date_ok.F\
+tm_date_reformat.F\
+tm_date_time.F\
+tm_date_to_step.F\
+tm_deallo_dyn_grid.F\
+tm_deallo_dyn_grid_sub.F\
+tm_deallo_dyn_line.F\
+tm_deallo_dyn_line_sub.F\
+tm_dfpeq.F\
+tm_dfpeq_tol.F\
+tm_digit.F\
+tm_digit_test.F\
+tm_dset_number.F\
+tm_dset_deallo_grids.F\
+tm_dset_use_grids.F\
+tm_errmsg.F\
+tm_exit.F\
+tm_exp_code.F\
+tm_f7721bug_inquire.F\
+tm_ferret_vartype.F\
+tm_fill.F\
+tm_find_like_dyn_grid.F\
+tm_find_like_dyn_line.F\
+tm_find_like_grid.F\
+tm_find_like_line.F\
+tm_find_line_slot.F\
+tm_firm_axis_orient.F\
+tm_fmt.F\
+tm_fmt_sngl_digits.F\
+tm_fmt_sngl.F\
+tm_fp_convert.F\
+tm_fpeq_eps.F\
+tm_fpeq.F\
+tm_fpeq_sngl.F\
+tm_friendly_read.F\
+tm_ftoc_strng.F\
+tm_garb_col_grids.F\
+tm_get_205_run_line.F\
+tm_get_205_run_parm.F\
+tm_get_cal.F\
+tm_get_calendar_attributes.F\
+tm_get_calendar_id.F\
+tm_get_calendar_name.F\
+tm_get_f_cal.F\
+tm_get_gridnum.F\
+tm_get_grid_of_line.F\
+tm_get_like_dyn_grid.F\
+tm_get_like_dyn_line.F\
+tm_get_like_grid.F\
+tm_get_like_line.F\
+tm_get_linematch.F\
+tm_get_linematch_sub.F\
+tm_get_linenum.F\
+tm_get_varnum.F\
+tm_grid_match.F\
+tm_has_string.F\
+tm_hash_name.F\
+tm_init_dset.F\
+tm_init_dyn_grids.F\
+tm_inq_path.F\
+tm_int2_swap.F\
+tm_int4_swap.F\
+tm_irregax_mid.F\
+tm_its_cdf.F\
+tm_its_subspan_modulo.F\
+tm_itsa_model_run.F\
+tm_lefint.F\
+tm_legal_name.F\
+tm_legal_name_op.F\
+tm_legal_unix_name.F\
+tm_lenstr.F\
+tm_lenstr1.F\
+tm_line_match.F\
+tm_loc_string.F\
+tm_lonw2lone.F\
+tm_load_calendar.F\
+tm_make_4d_grids.F\
+tm_make_basic_axis.F\
+tm_make_dyn_line.F\
+tm_make_fmt_date.F\
+tm_mod.F\
+tm_modulo_axlen.F\
+tm_modulo_line_dim.F\
+tm_new_grid_name.F\
+tm_new_line_name.F\
+tm_next_dyn_grid.F\
+tm_next_tmp_grid.F\
+tm_next_dyn_line.F\
+tm_next_tmp_line.F\
+tm_next_ver_name.F\
+tm_note.F\
+tm_number.F\
+tm_only1_step.F\
+tm_pack_string.F\
+tm_park_last_version.F\
+tm_parse_string.F\
+tm_path_list.F\
+tm_purge_tmp_grids.F\
+tm_re_allo_tmp_grid.F\
+tm_re_allo_tmp_line.F\
+tm_read.F\
+tm_read_gridfile.F\
+tm_rename.F\
+tm_same_grid_def.F\
+tm_same_line_def.F\
+tm_scale.F\
+tm_scale_all.F\
+tm_scale_nobad.F\
+tm_secs_from_bc.F\
+tm_secs_to_date.F\
+tm_set_current_calendar.F\
+tm_split_message.F\
+tm_step_to_date.F\
+tm_string.F\
+tm_subsc.F\
+tm_translate_axis.F\
+tm_translate_lat_long.F\
+tm_unit_id.F\
+tm_use_dyn_grid.F\
+tm_use_line.F\
+tm_world.F\
+tm_world_ax.F\
+tm_ww_ax_1_n.F\
+tm_ww_axlen.F\
+tm_ww_axlims.F\
+tm_ymd_time_convrt.F\
+xalt_messages_data.F\
+xdiag_ctrl_data.F\
+xdset_info_data.F\
+xerror_text_data.F\
+xez_info_data.F\
+xgt_grid_data.F\
+xio_data.F\
+xmachine_data.F\
+xstep_files_data.F\
+xsys_names_data.F\
+xunits_data.F 
+
+SRCS_C = \
+cd_rd_r8_as_r4.c\
+cd_read_scale.c\
+cd_read_sub.c\
+cd_write_att_sub.c\
+cd_write_att_dp_sub.c\
+cd_write_var_sub.c\
+deleted_list_clear.c\
+deleted_list_get_del.c\
+deleted_list_get_undel.c\
+deleted_list_init.c\
+deleted_list_modify.c\
+ez_delimited_read.c\
+NCF_Util.c\
+str_dncase_sub.c\
+str_case_blind_compare_sub.c\
+str_upcase_sub.c\
+string_array_clear.c\
+string_array_find.c\
+string_array_find_caseblind.c\
+string_array_find_exact.c\
+string_array_find_quoted.c\
+string_array_get_strlen.c\
+string_array_get_strlen1.c\
+string_array_hash.c\
+string_array_init.c\
+string_array_modify.c\
+string_array_modify_upcase.c\
+tm_blockify_ferret_strings.c\
+tm_break_fmt_date_c.c\
+tm_c_rename.c\
+tm_dfp_convert.c\
+tm_ep_time_convrt.c\
+tm_ftoc_readline.c\
+tm_get_strlen.c\
+tm_make_relative_ver.c\
+tm_match_capital_name.c\
+tm_number_sub.c\
+tm_set_free_event.c\
+tm_unblockify_ferret_strings.c\
+tm_unix_versions.c\
+tm_world_recur.c \
+tm_check_inf.c\
+tm_check_nan.c\
+tm_switch_nan.c\
+urlencode.c
diff --git a/fmt/src/cd_abort_grids.F b/fmt/src/cd_abort_grids.F
new file mode 100644
index 0000000..194f8e1
--- /dev/null
+++ b/fmt/src/cd_abort_grids.F
@@ -0,0 +1,67 @@
+	SUBROUTINE CD_ABORT_GRIDS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Wipe out partially created grids and axes - a fatal error has occurred
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* V500: 7/99 *sh* - bug fix: need conosotent use of char_init16 on line_name
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+        include 'xbuild_grids.cmn'
+
+* local variable declarations
+	INTEGER status
+
+* remove temporary in-progress grids and all associated use counts
+	CALL TM_PURGE_TMP_GRIDS( status )	! ststus ignored!!
+
+* return line memory to unused state
+	next_line_mem_pos = orig_line_mem
+
+        RETURN
+	END
diff --git a/fmt/src/cd_add_agg_var_info.F b/fmt/src/cd_add_agg_var_info.F
new file mode 100644
index 0000000..d7d03eb
--- /dev/null
+++ b/fmt/src/cd_add_agg_var_info.F
@@ -0,0 +1,67 @@
+	SUBROUTINE CD_ADD_AGG_VAR_INFO (agg_dset, vname, imemb, 
+     .      vtype, mdset, igrid, iline, nv, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* Given aggregate datset, variable name in the set, aggregate member number,
+* add the member-variable information for the variable to the linked-list 
+* structrure.
+
+* for var in aggregate member-dataset:
+* for members of the aggregate, imemb (id= sequence number 1,2,3,...
+*   igrid    Ferret grid number
+*   iline    Ferret line number of aggregate dimension
+*   vtype    1=file-var, 3=user-var
+*   mdset    Ferret dataset number
+*   nv       sequence number in ds_var_code or uvar_name_code
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+* Argument declarations
+  
+	CHARACTER*(*) vname
+	INTEGER agg_dset, imemb, vtype, mdset, igrid, iline, nv, status
+	REAL bad
+
+* Local variable declarations
+	INTEGER NCF_ADD_AGG_VAR_INFO, varid
+
+	CALL CD_GET_VAR_ID (agg_dset, vname, varid, status)
+
+	status = NCF_ADD_AGG_VAR_INFO( agg_dset, varid, imemb, vtype,
+     .		mdset, igrid, iline, nv)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_add_coord_var.F b/fmt/src/cd_add_coord_var.F
new file mode 100644
index 0000000..edf2f3d
--- /dev/null
+++ b/fmt/src/cd_add_coord_var.F
@@ -0,0 +1,91 @@
+      SUBROUTINE CD_ADD_COORD_VAR (dset, varname, varid, units, 
+     .                       type, coordvar, bad, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Add a coordinate variable to the linked list structure.  dset = -2 will be the 
+* pseudo-dset containing attribute info for user-defined axes (coordinate variables).
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+* include files
+
+      INCLUDE "tmap_dtypes.parm"
+      INCLUDE "netcdf.inc"
+
+* Argument declarations
+
+      CHARACTER*(*) varname, units
+      INTEGER dset, varid, type, coordvar, status
+      REAL bad
+
+* Internal declarations
+
+      INTEGER TM_LENSTR1, TM_LENSTR, NCF_ADD_VAR, NCF_ADD_COORD_VAR, 
+     .        slen, flen, dset_num
+      REAL*8 badd
+      CHARACTER*2048 buff
+
+      PARAMETER (flen=2048)
+#ifdef sun
+      BYTE      vhol(flen)      ! c-type Hollerith string buffer
+      BYTE      uhol(flen)
+#else
+      INTEGER*1 vhol(flen)      ! c-type Hollerith string buffer
+      INTEGER*1 uhol(flen)
+#endif 
+
+* translate strings for C routine
+
+      buff = varname
+      slen = TM_LENSTR1( buff )
+      CALL TM_FTOC_STRNG( buff(1:slen), vhol, flen )
+
+      buff = units
+      slen = TM_LENSTR( buff )
+      CALL TM_FTOC_STRNG( buff(1:slen), uhol, flen )
+
+* attribute structure has missing data flag as double precision
+
+      badd = bad
+
+      dset_num = dset
+      status = NCF_ADD_COORD_VAR( dset_num, varid, type, coordvar,
+     .                      vhol, uhol, badd)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_add_var.F b/fmt/src/cd_add_var.F
new file mode 100644
index 0000000..7ed9cc1
--- /dev/null
+++ b/fmt/src/cd_add_var.F
@@ -0,0 +1,97 @@
+      SUBROUTINE CD_ADD_VAR (dset, varname, varid, title, units, 
+     .                       type, coordvar, bad, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Add a variable to the linked list structure.  dset = -1 will be the 
+* pseudo-dset containing attribute info for user variables.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+*
+* include files
+
+      INCLUDE "tmap_dtypes.parm"
+      INCLUDE "netcdf.inc"
+
+* Argument declarations
+      LOGICAL coordvar
+
+      CHARACTER*(*) varname, title, units
+      INTEGER dset, varid, type, status
+      REAL bad
+
+* Internal declarations
+
+      INTEGER TM_LENSTR1, TM_LENSTR, NCF_ADD_VAR, slen, flen, dset_num
+      REAL*8 badd
+      CHARACTER*2048 buff
+
+      PARAMETER (flen=2048)
+#ifdef sun
+      BYTE      vhol(flen)      ! c-type Hollerith string buffer
+      BYTE      thol(flen)
+      BYTE      uhol(flen)
+#else
+      INTEGER*1 vhol(flen)      ! c-type Hollerith string buffer
+      INTEGER*1 thol(flen)
+      INTEGER*1 uhol(flen)
+#endif 
+
+* translate strings for C routine
+
+      buff = varname
+      slen = TM_LENSTR1( buff )
+      CALL TM_FTOC_STRNG( buff(1:slen), vhol, flen )
+
+      buff = title
+      slen = TM_LENSTR1( buff )
+      CALL TM_FTOC_STRNG( buff(1:slen), thol, flen )
+
+      buff = units
+      slen = TM_LENSTR( buff )
+      CALL TM_FTOC_STRNG( buff(1:slen), uhol, flen )
+
+* attribute structure has missing data flag as double precision
+
+      badd = bad
+
+      dset_num = dset
+      status = NCF_ADD_VAR( dset_num, varid, type, coordvar,
+     .                      vhol, thol, uhol, badd)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_assoc_grids.F b/fmt/src/cd_assoc_grids.F
new file mode 100644
index 0000000..0eada26
--- /dev/null
+++ b/fmt/src/cd_assoc_grids.F
@@ -0,0 +1,254 @@
+	SUBROUTINE CD_ASSOC_GRIDS (dset, reversed, 
+     .				   temp_axnams, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Creates the association of the FERRET variables with their parent grids
+* within a netCDF file
+* Checks that all variables in the data set have associated grids.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* 2/95 - added support for reverse-ordered coordinate axes
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* V500:  4/99 *kob* - increase size of temp_axnams and vname from 16 to 64
+* V510 *sh* 3/00 - convert to use of dynamic grids and axes
+* V533 *sh* 6/01 - support for string variables
+* V552:  3/03 *acm* - increase size of vname to 128
+* V600 *ACM* attribute control. 
+*             NCVINQ replaced by CD_GET_VAR_INFO
+*             NCDINQ replaced by CD_GET_DS_DIMS
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* TODO: initially leave this as 4D -- what to do with old files that have 4 slab min/max?
+
+* argument definitions:
+*       dset        - TMAP data set pointer
+*       reversed    - logical array to record which axes have reversed coords
+*       temp_axnams - temporary storage of axis names to construct grids
+*	status	    - return status
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xbuild_grids.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	        include 'xdset_info.cd_equiv'
+
+* argument declarations
+	INTEGER	 dset, status
+        LOGICAL  reversed(max_lines:line_ceiling)
+* 4/99 *kob* 
+	CHARACTER*128 temp_axnams(nferdims,max_temp_grid)
+
+* local parameter definitions:
+      INTEGER     str_eq
+      PARAMETER ( str_eq = 0 )
+
+* local variable declarations:
+* move do_warn assignment to paramater for linux *kob*
+      LOGICAL NC_GET_ATTRIB,
+     .        got_it, do_warn
+      PARAMETER (do_warn = .TRUE.)
+      INTEGER STR_CASE_BLIND_COMPARE,
+     .        igrid, iaxis, istat, tmvar, ivar, ndim, idim,
+     .        maxlen, attlen, attoutflag, all_outflag
+      REAL    tmp
+      CHARACTER*16 gname
+* variables for final (unnecessary?) check
+      CHARACTER TM_STRING*13, vname*128, buff*128
+      INTEGER TM_LENSTR1,
+     .        vartyp, nvdim, vdims(8), nvatts, dim, npts, vlen
+      LOGICAL coordvar
+
+* *kob* explicit definitions not allowed on decl line in linux...moved it to parameter line
+      CHARACTER*1     dimnam(nferdims)
+      DATA dimnam/'I', 'J', 'K', 'L', 'M', 'N'/
+
+* loop through each variable in this TMAP data set
+* if it has a "parent_grid" then associate it with that grid
+* if not then make sure it has a grid associated
+
+        DO 1000 tmvar = 1,maxvars
+           IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 1000
+           ivar = cd_varid(tmvar)
+
+* does it point explicitly to a parent grid ?
+          maxlen = 16  !gridnamlen
+          got_it = NC_GET_ATTRIB( dset, ivar, 'parent_grid',
+     .                         .NOT.do_warn, ' ', maxlen, attlen,
+     .                         attoutflag, gname, tmp )  
+          IF ( .NOT.got_it ) THEN
+* ... check that it is a current temporary grid -- should ALWAYS be true
+	     IF (ds_grid_number(tmvar) .LT. max_grids    ) GOTO 5100
+	     IF (tmp_nam_ptr(ds_grid_number(tmvar)).EQ.0 ) GOTO 5100
+             GOTO 1000
+          ENDIF
+
+* locate the grid it points to
+	  igrid = 0	! to get start of linked list
+ 100	  CALL TM_NEXT_TMP_GRID( igrid, *5100)
+             istat = STR_CASE_BLIND_COMPARE(gname, grid_name(igrid))
+             IF ( istat .EQ. str_eq ) THEN
+                ds_grid_number(tmvar) = igrid
+                GOTO 110
+             ENDIF
+	  GOTO 100
+
+* set ds_ordering if not explicitly given in file
+* e.g. map X NORMAL Z T to 1 3 4 0
+ 110      IF ( ds_ordering(1,tmvar) .EQ. unspecified_int4 ) THEN
+             DO 190 idim = 1, nferdims
+ 190         ds_ordering(idim,tmvar) = 0
+             ndim = 0
+             DO 200 idim = 1, 4
+                IF ( grid_line(idim,igrid) .EQ. mpsnorm ) GOTO 200
+                ndim = ndim + 1
+                ds_ordering(ndim,tmvar) = idim
+ 200         CONTINUE
+          ENDIF
+
+* count the number of axes in the grid
+          ndim = 0
+          DO 220 idim = 1, 4
+             IF ( grid_line(idim,igrid).NE.mpsnorm ) ndim = ndim + 1
+ 220      CONTINUE
+          
+* set ds_grid_start if not explicitly given in file
+          IF ( ds_grid_start(1,tmvar) .EQ. unspecified_int4 ) THEN
+             DO 300 idim = 1, 4
+ 300         ds_grid_start(idim,tmvar) = 1
+          ENDIF
+	  
+* set ds_grid_end if not explicitly given in file
+          IF ( ds_grid_end(1,tmvar) .EQ. unspecified_int4 ) THEN
+             DO 400 idim = 1, 4
+                iaxis = grid_line(idim,igrid)
+                IF ( iaxis .EQ. mpsnorm ) THEN
+                   ds_grid_end(idim,tmvar) = 1
+                ELSE
+                   ds_grid_end(idim,tmvar) = line_dim(iaxis)
+                ENDIF
+ 400         CONTINUE
+          ENDIF
+
+* TODO won't need this after implementing full 6D treatment here.
+          DO 410 idim = 5, nferdims
+             ds_grid_start(idim,tmvar) = 1
+ 410         ds_grid_end(idim,tmvar) = 1
+
+* check that the parent lo/hi limits are consistent with the variable slab size
+
+          CALL CD_GET_VAR_INFO (dset, ivar, vname, vartyp, nvdim, vdims,
+     .                 nvatts, coordvar, all_outflag, istat)
+          vlen = TM_LENSTR1(vname)
+
+* ... if a string variable, the first dimension is the string axis (ignore it)
+	  IF (vartyp .EQ. NF_CHAR) THEN
+	     nvdim = nvdim - 1
+	     DO idim = 1, nvdim
+	        vdims(idim) = vdims(idim+1)
+	     ENDDO
+	  ENDIF
+          IF ( ndim .NE. nvdim ) GOTO 5300 
+          DO 500 idim = 1, 4
+             dim = ds_ordering(idim,tmvar)
+             IF ( dim .EQ. 0 ) GOTO 500
+!             IF ( dim .EQ. unspecified_int4 ) dim = idim
+             CALL CD_GET_DS_DIMS ( dset, vdims(idim), buff, npts, istat )
+             IF ( npts .NE.
+     .          ds_grid_end(dim,tmvar)-ds_grid_start(dim,tmvar)+1 )
+     .               GOTO 5200
+ 500      CONTINUE
+
+* flag (negative) the axes that have reverse-ordered coordinates
+	  DO 610 idim = 1, 4
+	     dim = ds_ordering(idim,tmvar)
+             IF ( dim .EQ. 0 ) GOTO 610
+* At this stage the axis pointers have not yet been inserted into the
+* parent grid definitions (we still have to check for duplicate def'ns, etc.)
+* So we need to check by name (among the axes defined in this data set)
+* to find this axis and see if this axis is reversed.
+	     IF ( grid_line(dim,igrid) .EQ. unspecified_int4 ) THEN
+	       vname = temp_axnams(dim, tmp_nam_ptr(igrid))
+	       iaxis = 0	! to get start of linked list
+* ... search the linked list of axes defined in this dtaa set
+ 600	       CALL TM_NEXT_TMP_LINE( iaxis, *610)
+                 IF ( vname .EQ. line_name(iaxis) ) THEN
+	           IF (reversed(iaxis)) ds_ordering(idim,tmvar) = -1*dim
+                   GOTO 610
+                 ENDIF
+	       GOTO 600
+	    ENDIF
+ 610	  CONTINUE
+
+ 1000   CONTINUE
+
+* successful completion
+ 	status = merr_ok
+        RETURN
+
+* error messages
+ 5100   CALL TM_ERRMSG(merr_unkgrid, status, 'CD_ASSOC_GRIDS',
+     .       dset, no_stepfile,
+     .       'CDF grid name: '//gname, no_errstring, *5900)
+
+ 5200   CALL TM_ERRMSG(merr_badsubscr, status, 'CD_ASSOC_GRIDS',
+     .       dset, no_stepfile, 'CDF variable "'//vname(:vlen)//
+     .       '" on '//dimnam(dim)//'='//
+     .       TM_STRING(DBLE(ds_grid_start(dim,tmvar)))//'-'//
+     .       TM_STRING(DBLE(ds_grid_end  (dim,tmvar))),
+     .       no_errstring, *5900)
+
+ 5300   CALL TM_ERRMSG(merr_gridpredef, status, 'CD_ASSOC_GRIDS',
+     .       dset, no_stepfile,
+     .       '# of dims in variable '//vname(:vlen)//
+     .       ' does not match grid '//gname, no_errstring, *5900)
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_axis_name.F b/fmt/src/cd_axis_name.F
new file mode 100644
index 0000000..c5e669d
--- /dev/null
+++ b/fmt/src/cd_axis_name.F
@@ -0,0 +1,121 @@
+	CHARACTER*(*) FUNCTION CD_AXIS_NAME ( dset, grid, idim, nlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the netCDF name to use for the indicated axis of this grid
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/92
+* V4.20  11/95 - remove parentheses surrounding dynamic axis names
+* V600  *acm* 6/05 Attribute control. Get information from linked-list structure.
+* V602 11/06*acm* Instead of looking to see if the Ferret axis name and the
+*                 axis name in the attribute structure differ because Ferret
+*                 needed to rename an axis on file initialization for uniqueness;
+*                 we use the Ferret name throughout, restoring it only on output.
+
+* argument definitions:
+*     dset    - dset (if netcdf file, for getting name and attribute 
+*               info from linked-list structure  
+*     grid    - TMAP grid id
+*     idim    - axis orientation (1-nferdims)
+*     nlen    - length of name
+
+* include files
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* argument declarations
+      INTEGER dset, grid, idim, nlen
+
+* local variable declarations:
+      LOGICAL TM_ABSTRACT_AXIS, coordvar
+      INTEGER TM_LENSTR1, iaxis, varid, vartype, nvdims, vdims(8), 
+     .        nvatts, status, llen, ic, all_outflag
+
+      CHARACTER*1 ww_dim_name(nferdims), c
+      CHARACTER*130 buff
+      DATA ww_dim_name/'X', 'Y', 'Z', 'T', 'E', 'F'/
+
+* initialize
+      iaxis = grid_line(idim, grid)
+
+* basic name straight from the grid
+      CD_AXIS_NAME = line_name(iaxis)
+      nlen = TM_LENSTR1( CD_AXIS_NAME )
+
+* Get information, if it exists, from linked-list structure, including
+* original upper/lowercase form of axis name. Also restore the original
+* name if the axis name was changed on inupt. (If name matched an existing 
+* line name, then Ferret appends a digit to the name.)
+
+      CALL CD_GET_VAR_ID (dset, CD_AXIS_NAME, varid, status)  ! is it in the linked-list for dset
+
+      IF (status .NE. merr_ok) THEN
+         nlen = TM_LENSTR1( CD_AXIS_NAME )
+
+      ELSE
+
+* Get axis name into original upper/lowercase form.
+
+         CALL CD_GET_VAR_INFO (dset, varid, CD_AXIS_NAME, vartype, 
+     .       nvdims, vdims, nvatts, coordvar, all_outflag,status) 
+
+      ENDIF
+
+100   CONTINUE
+
+* if it's an abstract axis make a special name
+      IF ( TM_ABSTRACT_AXIS( iaxis ) ) THEN
+         CD_AXIS_NAME = ww_dim_name(idim)//'AX'
+         nlen = 3
+
+* if it's a dynamic axis remove the parentheses
+      ELSEIF ( line_name(iaxis)(1:1) .EQ. '(' ) THEN
+	 IF ( nlen .LE. 2) nlen = 3			! should never happen
+         CD_AXIS_NAME = line_name(iaxis)(2:nlen-1)
+	 nlen = nlen - 2
+      ENDIF
+
+      nlen = TM_LENSTR1( CD_AXIS_NAME )
+
+      RETURN
+      END
diff --git a/fmt/src/cd_axis_outname.F b/fmt/src/cd_axis_outname.F
new file mode 100644
index 0000000..260d842
--- /dev/null
+++ b/fmt/src/cd_axis_outname.F
@@ -0,0 +1,156 @@
+	CHARACTER*(*) FUNCTION CD_AXIS_OUTNAME ( dset, grid, idim, nlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the netCDF name to use for writing the indicated axis of this grid
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 11/06
+* V62   2/09 *acm* When writing user-defined variables and when MODE UPCASE_OUTPUT is
+*                  cancelled, get the original upper/lowercase spelling of the axis name.
+* V63   9/09 *acm* Fixing bug 1686: if line_name_orig is not set, use line_name
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.85+ 12/13*acm* catch up to 6-D Ferret
+
+* argument definitions:
+*     dset    - dset (if netcdf file, for getting name and attribute 
+*               info from linked-list structure  
+*     grid    - TMAP grid id
+*     idim    - axis orientation (1-nferdims)
+*     nlen    - length of name
+
+* include files
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+        include 'netcdf.inc'
+
+* argument declarations
+      INTEGER dset, grid, idim, nlen
+
+* local variable declarations:
+      LOGICAL TM_ABSTRACT_AXIS, NC_GET_ATTRIB, coordvar, got_it
+      INTEGER TM_LENSTR1, STR_SAME, iaxis, varid, nvatts, status, 
+     .  attlen, maxlen, attoutflag, alen
+      REAL val
+
+      CHARACTER*1 ww_dim_name(nferdims)
+      CHARACTER varname*130, buff*128, attname*128
+      DATA ww_dim_name/'X', 'Y', 'Z', 'T', 'E', 'F'/
+
+* initialize
+      iaxis = grid_line(idim, grid)
+      buff = ' '
+
+* basic name straight from the grid
+
+      varname = line_name(iaxis)
+      nlen = TM_LENSTR1( varname )
+
+* Get information, if it exists, from linked-list structure, including
+* original upper/lowercase form of axis name. Also restore the original
+* name if the axis name was changed on inupt. (If name matched an existing 
+* line name, then Ferret has changed the name for uniqueness.)
+
+* Do not try to get the axis name if its in parentheses. These names are
+* dynamic axis names.
+
+      status = merr_ok + 1
+      IF (varname(1:1) .NE. '(') 
+     .   CALL CD_GET_VAR_ID (dset, varname, varid, status)  
+     
+      got_it = .FALSE.
+      IF (status .EQ. merr_ok) THEN
+         attname = 'orig_file_axname' 
+         alen = 18
+
+         maxlen = 128
+         got_it = NC_GET_ATTRIB(dset, varid, attname(1:alen),
+     .                       .FALSE., varname(1:nlen), maxlen, attlen, 
+     .                       attoutflag, buff, val)
+
+         IF ( got_it ) THEN
+            CD_AXIS_OUTNAME = buff
+            nlen = TM_LENSTR1( buff )
+         ELSE 
+            CD_AXIS_OUTNAME = line_name_orig(iaxis)
+	    IF (STR_SAME(line_name_orig(iaxis), char_init) .EQ. 0) 
+     .        CD_AXIS_OUTNAME = line_name(iaxis)
+            nlen = TM_LENSTR1( CD_AXIS_OUTNAME )
+	    IF (nlen .LE. 1  .OR.  varname(1:1) .EQ. '(' ) THEN
+               CD_AXIS_OUTNAME = varname
+	       nlen = TM_LENSTR1( CD_AXIS_OUTNAME )
+	    ENDIF
+         ENDIF
+
+      ELSE
+
+         CD_AXIS_OUTNAME = line_name_orig(iaxis)
+         IF (STR_SAME(line_name_orig(iaxis), char_init) .EQ. 0) 
+     .        CD_AXIS_OUTNAME = line_name(iaxis)
+         nlen = TM_LENSTR1( CD_AXIS_OUTNAME )
+	 IF (nlen .LE. 1  .OR.  varname(1:1) .EQ. '(' ) THEN
+            CD_AXIS_OUTNAME = varname
+	    nlen = TM_LENSTR1( CD_AXIS_OUTNAME )
+	 ENDIF
+
+      ENDIF
+
+* if it's an abstract axis make a special name
+      IF ( TM_ABSTRACT_AXIS( iaxis ) ) THEN
+         CD_AXIS_OUTNAME = ww_dim_name(idim)//'AX'
+         nlen = 3
+
+* if it's a dynamic axis and if we didnt recover the 
+* original name from the linked-list information,
+* remove the parentheses
+
+      ELSEIF ( line_name(iaxis)(1:1) .EQ. '(' .AND.
+     .         .NOT.got_it ) THEN
+	 IF ( nlen .LE. 2) nlen = 3			! should never happen
+         CD_AXIS_OUTNAME = line_name(iaxis)(2:nlen-1)
+	 nlen = nlen - 2
+      ENDIF
+
+      nlen = TM_LENSTR1( CD_AXIS_OUTNAME )
+
+      RETURN
+      END
diff --git a/fmt/src/cd_axlen.F b/fmt/src/cd_axlen.F
new file mode 100644
index 0000000..c180db5
--- /dev/null
+++ b/fmt/src/cd_axlen.F
@@ -0,0 +1,110 @@
+	INTEGER FUNCTION CD_AXLEN ( cdfid, dimid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get the length of an axis (netCDF coordinate variable)
+* the axis is presumed to exist and to be a 1D variable
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* 4/94 *sh*,*kob* inserted return value for error exit case - avoid
+*		  compiler error msg
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	- netCDF id number for already opened CDF file
+*       dimid   - dimension id of coordinate variable in netCDF file
+*       status  - returned status code
+
+* argument declarations
+      INTEGER	    cdfid, dimid, status
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...moved it to parameter line
+      LOGICAL CD_GET_ATTVAL, got_it, do_warn
+      PARAMETER (do_warn = .TRUE.)
+      INTEGER TM_LENSTR1, cdfstat, nval, npts, nlen, axid
+      CHARACTER*128 axname
+      REAL rlen
+
+* initialize in case of error exit (4/94)
+      CD_AXLEN = 0
+
+* get the basic information about this dimension
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_DIM_( cdfid, dimid, axname, npts )
+#else
+      cdfstat = NF_INQ_DIM( cdfid, dimid, axname, npts )
+#endif
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+* get the basics about the axis by the same name
+      nlen = TM_LENSTR1( axname )
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VARID_( cdfid, axname(:nlen), axid )
+#else
+      cdfstat = NF_INQ_VARID( cdfid, axname(:nlen), axid )
+#endif
+
+* check "true_size" in case this is a condensed axis representation
+      got_it = CD_GET_ATTVAL( cdfid, axid, 'true_size',
+     .                        do_warn, axname(:nlen), rlen, 1, nval)
+      IF (got_it) npts = rlen
+
+* successful completion
+      CD_AXLEN = npts
+      status = merr_ok
+      RETURN
+
+* error exit
+ 5000 RETURN
+ 5100 CALL TM_ERRMSG( cdfstat+pcdferr, status, 'CD_AXLEN', cdfid,
+     .                no_varid, no_errstring, no_errstring, *5000 )
+      END
diff --git a/fmt/src/cd_childax_name.F b/fmt/src/cd_childax_name.F
new file mode 100644
index 0000000..2b56fcf
--- /dev/null
+++ b/fmt/src/cd_childax_name.F
@@ -0,0 +1,92 @@
+	CHARACTER*(*) FUNCTION CD_CHILDAX_NAME( axname, lo, hi, tlen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the name to use for a "child axis" (sub-region) of a parent axis
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+* 1/95 - allow negative subscripts.  Substitute "N" for "-"
+* v4.91 - *kob* - 12/97 - added checks for axis name length
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*     axis    - original axis name
+*     lo      - lo subscript
+*     hi      - hi subscript
+*     slen    - returned length of name
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* argument declarations
+      INTEGER lo, hi, tlen
+      CHARACTER*(*) axname
+
+* local variable declarations:
+      INTEGER TM_LENSTR1, slen
+      CHARACTER TM_LEFINT*8, int_buff*8
+* 12/97
+      INTEGER maxlen
+
+      maxlen = LEN(CD_CHILDAX_NAME)
+
+* generate "axis_nameLO_HI"
+* append the low subscript limit
+      tlen = TM_LENSTR1(axname)
+      IF (tlen .GT. maxlen) tlen = maxlen    ! hack to prevent crash
+      int_buff = TM_LEFINT(lo,slen)
+      IF (int_buff(1:1) .EQ. '-') int_buff(1:1) = 'N'
+      CD_CHILDAX_NAME = axname(:tlen)//int_buff
+      tlen = tlen+slen
+      IF (tlen .GT. maxlen) tlen = maxlen    ! hack to prevent crash
+
+
+* append the high subscript limit
+      int_buff = TM_LEFINT(hi,slen)
+      IF (int_buff(1:1) .EQ. '-') int_buff(1:1) = 'N'
+      CD_CHILDAX_NAME = CD_CHILDAX_NAME(:tlen)//'_'//int_buff
+      tlen = tlen+slen+1
+      IF (tlen .GT. maxlen) tlen = maxlen    ! hack to prevent crash
+      RETURN
+      END
diff --git a/fmt/src/cd_clean_grids.F b/fmt/src/cd_clean_grids.F
new file mode 100644
index 0000000..6768434
--- /dev/null
+++ b/fmt/src/cd_clean_grids.F
@@ -0,0 +1,276 @@
+	SUBROUTINE CD_CLEAN_GRIDS ( dset, cdfid, temp_axnams, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check for errors and eliminate duplication from newly defined grids and axes
+* When the routine exits there will be no duplicate axis names although there
+* will be holes in line_memory from deleted axes.
+* When the routine exits there will still be duplicate grid names among the
+* newly defined grids.  These may be eliminated after variables are associated.
+* Finally, determine the "record" axis of this data set,
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* v500 - 3/99 *kob* - up length of variable vname to correspond w/ increased
+*                     size of line_name
+*      - 4/99 *kob* - need to increase size of temp_axnams as well
+*      - 7/99 *sh* - bug fix: need conosotent use of char_init16 on line_name
+* V510 *sh* 3/00 - convert to use of dynamic grids and axes
+*		 - use TM_GET_LINEMATCH to ensure that renamed axes also match
+* V552 *acm* 5/03   increase vname and buff to 128 chars 
+* V600 *ACM* attribute control. 
+*             Replace NCDINQ with CD_GET_DS_DIMS
+* V601 *acm* 11/06 If there is a new axis name, save the original axis name of 
+*                  the axis as an attribute of the coordinate variable in the 
+*                  linked-list attribute structure, and change the axis name itself
+*                  in the attribute structure.
+* V602 *acm* 12/06 When replacing or resetting an axis, test for the existence of
+*                  the attribute orig_file_axname. If it already exists, call the
+*                  routine to replace the attribute rather than trying to add a new
+*                  attribute.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*	cdfid	- netCDF id number for already opened CDF file
+*       temp_axnams - temporary storage of axis names to construct grids
+*       temp_grid_ptr - points from temporary name storage to actual grid
+*	status	- return status
+
+* include files
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xbuild_grids.cmn'
+	include 'xtm_grid.cmn_text'
+	include 'xdset_info.cmn_text'
+        include 'netcdf.inc'
+
+
+* argument declarations
+	INTEGER	 dset, cdfid, status
+*4/99 *kob*
+        CHARACTER*128 temp_axnams(nferdims,max_temp_grid)
+
+* local parameter definitions:
+      INTEGER     max_grd_per_cdf
+      PARAMETER ( max_grd_per_cdf = 40 )
+
+* local variable declarations:
+      LOGICAL TM_SAME_GRID_DEF, 
+     .        dup_name, dup_guts
+      INTEGER TM_GET_LINEMATCH,  TM_GET_LINENUM, TM_GET_GRIDNUM, 
+     .        TM_LENSTR1, STR_SAME,
+     .        igrid, iaxis, count, idim, i_dup, ivar,
+     .        npts, istat,  reused(max_lines:line_ceiling),
+     .        varid, attid, attype, attlen, attoutflag, len 
+* upped vname to 64 - also removed the *24 from the CHARACTER
+* upped vname to 128 
+      CHARACTER vname*128, buff*128, attname*128
+      REAL dummy
+
+***** AXES ******
+* check for duplicate name / guts of axes
+* if completely identical (name and guts) then eliminate the new one
+* if new definition with already used name then flag this
+	iaxis = 0	! to get start of linked list
+ 100	CALL TM_NEXT_TMP_LINE( iaxis, *110)
+	  reused(iaxis) = TM_GET_LINEMATCH( iaxis, dup_name, dup_guts )
+	  IF ( dup_name .AND. .NOT.dup_guts ) THEN
+	     line_fixname(iaxis) = .TRUE.	  ! new definition reuses old name
+	  ELSE
+	     line_fixname(iaxis) = .FALSE.
+	  ENDIF
+	GOTO 100  ! like  100   CONTINUE
+
+* check that all the grids point to real axes
+ 110	igrid = 0		! to get start of linked list
+ 250	CALL TM_NEXT_TMP_GRID( igrid, *260)
+	   count = tmp_nam_ptr(igrid)
+           DO 240 idim = 1, nferdims 
+              vname = temp_axnams(idim, count)
+!              IF ( vname .EQ. 'RECORD' ) THEN
+!* ... the CDF term "RECORD" is the last dim'ed axis (like "UNKNOWN" for GT)
+!                 grid_line(idim, igrid) = mpsunkn
+              IF ( vname .EQ. 'NORMAL' ) THEN
+                 grid_line(idim, igrid) = mpsnorm
+              ELSE
+* ... first choose from the axis names just defined
+	         iaxis = 0	! to get start of linked list
+ 200	         CALL TM_NEXT_TMP_LINE( iaxis, *202)
+                    IF ( vname .EQ. line_name(iaxis) ) THEN
+	               IF (reused(iaxis) .EQ. unspecified_int4 ) THEN
+                          grid_line(idim, igrid) = iaxis
+	               ELSE
+                          grid_line(idim, igrid) = reused(iaxis)
+	               ENDIF
+                       GOTO 240
+                    ENDIF
+	         GOTO 200
+* ... not found? then this name was a duplicate definition. Reuse older defn
+ 202		 grid_line(idim, igrid) = reused(iaxis)
+	         IF (reused(iaxis) .EQ. unspecified_int4)
+     .						STOP 'cd_clean_crptn'
+              ENDIF
+ 240       CONTINUE
+	GOTO 250
+                 
+* check for duplicate grid name / guts
+ 260	igrid = 0		! to get start of linked list
+ 300	CALL TM_NEXT_TMP_GRID( igrid, *301)
+
+* ... eliminate this grid name to look for duplicates
+           vname = grid_name(igrid)   ! temporary storage
+           grid_name(igrid) = char_init
+           i_dup = TM_GET_GRIDNUM( vname )
+           dup_name = i_dup .NE. unspecified_int4
+
+           IF ( dup_name ) THEN
+              dup_guts = TM_SAME_GRID_DEF( i_dup, igrid )
+           ELSE
+              dup_guts = .FALSE. ! ... well not necessarily but who cares ?
+           ENDIF
+
+* Save the grid if it's unique
+          IF ( .NOT.dup_name ) THEN
+             grid_name(igrid) = vname
+
+* Throw away this duplicate but make sure variables point to the original
+          ELSEIF ( dup_guts ) THEN
+             grid_name(igrid) = char_init   ! throw it away
+             DO 290 ivar = 1, maxvars
+ 290         IF ( ds_grid_number(ivar) .EQ. igrid )
+     .               ds_grid_number(ivar) = i_dup
+
+* Duplicate name - differing guts / make the grid name unique
+          ELSE
+             grid_name(igrid) = vname
+             CALL TM_NEW_GRID_NAME( grid_name(igrid), vname )
+             grid_name(igrid) = vname
+          ENDIF
+
+	GOTO 300	! like 300    CONTINUE
+
+* destroy any axis names that are duplicates both in name and defn
+* make unique any axis names that are duplicates but with new guts
+
+* If there is a new name, save the original axis name of the axis as an
+* attribute of the coordinate variable in the linked-list attribute structure,
+* and change the axis name itself.
+
+ 301	iaxis = 0		! to get start of linked list
+ 400	CALL TM_NEXT_TMP_LINE( iaxis, *402)
+          vname = line_name(iaxis)
+          len = TM_LENSTR1(vname)
+          CALL CD_GET_VAR_ID (dset, vname, varid, status)
+
+	  IF ( reused(iaxis) .NE. unspecified_int4 ) THEN
+	    line_name(iaxis) = char_init16   ! destroy new duplicate defn
+	    line_fixname(iaxis) = .FALSE.  
+            
+            buff = line_name(reused(iaxis))
+
+            IF (status .EQ. merr_ok .AND. 
+     .          STR_SAME(vname, buff) .NE. 0) THEN
+               CALL CD_RENAME_VAR (dset, varid, buff, status)
+               
+* Replace or add the orig_file_axname attribute
+               attname = 'orig_file_axname'
+               CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .              status)
+               IF (attid .GT. 0) THEN 
+                  CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname,
+     .               attype, attlen, attoutflag, status)
+                  CALL CD_REPLACE_ATTR (dset, varid, attname, NF_CHAR, 
+     .               len, vname, dummy, status)
+               ELSE
+                  CALL CD_PUT_NEW_ATTR (dset, varid, 'orig_file_axname',
+     .               NF_CHAR, len, -1, vname, dummy, status)
+               ENDIF
+            ENDIF
+
+          ELSEIF ( line_fixname(iaxis) ) THEN
+            CALL TM_NEW_LINE_NAME( line_name(iaxis), buff )
+            line_name(iaxis) = buff
+
+            IF (status .EQ. merr_ok .AND. 
+     .          STR_SAME(vname, buff) .NE. 0) THEN
+               CALL CD_RENAME_VAR (dset, varid, buff, status)
+
+* Replace or add the orig_file_axname attribute
+               attname = 'orig_file_axname'
+               CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, 
+     .              status)
+               IF (attid .GT. 0) THEN 
+                  CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, attname,
+     .               attype, attlen, attoutflag, status)
+                  CALL CD_REPLACE_ATTR (dset, varid, attname, NF_CHAR, 
+     .               len, vname, dummy, status)
+               ELSE
+                  CALL CD_PUT_NEW_ATTR (dset, varid, 'orig_file_axname',
+     .                NF_CHAR, len, -1, vname, dummy, status)
+               ENDIF
+            ENDIF
+
+          ENDIF
+	GOTO 400	! like  400    CONTINUE
+
+* determine the "record" axis
+ 402	IF ( ds_time_axis(dset) .LT. 1 ) THEN
+             ds_time_axis(dset) = unspecified_int4
+        ELSE
+           CALL CD_GET_DS_DIMS( dset, ds_time_axis(dset), vname, 
+     .                          npts, istat )
+           ds_time_axis(dset) = TM_GET_LINENUM( vname )
+        ENDIF
+
+* successful completion
+ 	status = merr_ok
+        RETURN
+
+* error messages
+ 5100	buff = 'axis: '//vname//' grid: '//grid_name(igrid)
+ 	CALL TM_ERRMSG (merr_lineundef, status, 'CD_CLEAN_GRIDS',
+     .			no_descfile, no_stepfile,
+     .			buff, no_errstring, *5900)
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_close_set.F b/fmt/src/cd_close_set.F
new file mode 100644
index 0000000..46754bf
--- /dev/null
+++ b/fmt/src/cd_close_set.F
@@ -0,0 +1,85 @@
+	SUBROUTINE CD_CLOSE_SET ( cdfid, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Close a netCDF file 
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/92
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       cdfid   - returned pointer to open CDF file
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      cdfid, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+      INTEGER cdfstat
+
+* close the netCDF file
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_CLOSE_( cdfid )
+#else
+        cdfstat = NF_CLOSE( cdfid )
+#endif
+	IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+* successful completion
+        status = merr_ok
+        RETURN
+
+* error exit
+ 5000   RETURN
+ 5100   CALL TM_ERRMSG(pcdferr+pcdferrmax,
+     .         status, 'CD_CLOSE_SET', cdfid, -999,
+     .         no_errstring, no_errstring, *5000 )
+	END
diff --git a/fmt/src/cd_consistent_axis_orient.F b/fmt/src/cd_consistent_axis_orient.F
new file mode 100644
index 0000000..b63c8f0
--- /dev/null
+++ b/fmt/src/cd_consistent_axis_orient.F
@@ -0,0 +1,358 @@
+      SUBROUTINE CD_CONSISTENT_AXIS_ORIENT (dset, reversed, perm, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Checks that axis orientation is the same for all grids in the dataset
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+
+* revision 0.0 - 1/11 
+* V67 1/11 *acm*  Ticket 1774. Changes for making sure axes have the same direction
+*                 in all  grids of a dataset.
+* V672 8/11 *acm* When reordering axes, dont wipe out an existing axis that is not being moved.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*      dset        - TMAP data set pointer
+*      reversed    - logical array to record which axes have reversed coords
+*      perm        - user-specified permutation (e.g. "YXZT"=2,1,3,4)
+*      status       - return status
+
+* include files
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+      include 'xbuild_grids.cmn'
+      include 'xdset_info.cmn_text'
+      external xdset_info_data
+      include 'xio.cmn_text'
+      external xio_data
+      include 'xtm_grid.cmn_text'
+            include 'xunits.cmn_text'
+      external xunits_data
+      include 'xdset_info.cd_equiv'
+
+* argument declarations
+      LOGICAL  reversed(max_lines:line_ceiling), already_noted(max_lines:line_ceiling)
+      INTEGER dset, perm(*), status
+
+* local variable declarations:
+
+      INTEGER TM_LENSTR1, i, j, igrid, igrid_min, igrid_max, idim, iaxis, 
+     .        disordered, reordered, n_in_grid,  
+     .        grid_save(nferdims), igrid1, ipos1, igrid2, ipos2, kk, 
+     .        iaxis_last, iax, iorder, tmvar, ivar, vartyp, nvdims, 
+     .        vdims(8), nvatts, vlen, istat, lastdim, tmplines(nferdims), 
+     .        i1, i2, iter, ndim, isave_order, ncheck
+      LOGICAL shift_ok, need_iterate, coordvar, all_outflag, permuted
+      REAL axes_out_of_order(100)
+      CHARACTER vname*128
+
+      INTEGER grid_ndims (max_grids:grid_ceiling), 
+     .        line_use_dir(0:3000)
+
+      INTEGER copy_of_grids (nferdims, 1001)
+
+      iter = 0
+      reordered = 0
+
+      DO igrid = 501, grid_ceiling
+      DO idim = 1, nferdims
+         copy_of_grids(idim, igrid-500) = grid_line(idim, igrid)
+      ENDDO
+      ENDDO
+
+      DO i = max_lines,line_ceiling
+         already_noted = .FALSE.
+      ENDDO
+
+      DO i = 1, 100
+         axes_out_of_order(i) = 0.
+      ENDDO
+
+      DO i = 0, line_ceiling
+         line_use_dir(i) = 0
+      ENDDO
+      DO i = max_grids, grid_ceiling
+         grid_ndims(i) = 0
+      ENDDO
+
+ 1000 CONTINUE
+      disordered = 0
+
+      need_iterate = .FALSE.  ! is this the right place to set this?
+
+* Loop over the grids created for this dataset
+
+      igrid = 0               ! to get start of linked list
+  10  CALL TM_NEXT_TMP_GRID( igrid, *19)
+
+      DO 100 idim = 1, nferdims
+         iaxis = grid_line(idim, igrid)
+
+         IF (iaxis  .GT. 0) THEN
+            IF (line_use_dir (iaxis) .EQ. 0) THEN
+               line_use_dir(iaxis) = idim
+            ELSE
+               IF ( line_use_dir(iaxis) .NE. idim) THEN
+                  disordered = disordered + 1
+                  axes_out_of_order(disordered) = FLOAT(iaxis)
+               ENDIF
+            ENDIF
+         ENDIF
+  100 CONTINUE
+
+      GOTO 10
+  19  CONTINUE
+      
+      IF (disordered .EQ. 0) GOTO 2000
+
+      CALL HEAP2_V (axes_out_of_order, 0., disordered)
+
+! Count dimensions of the grids.
+
+      igrid = 0 
+  20  CALL TM_NEXT_TMP_GRID( igrid, *29)
+      grid_ndims(igrid) = 0
+      DO 110 idim = 1, nferdims
+         IF (grid_line(idim,igrid) .GT. 0) 
+     .            grid_ndims(igrid) = grid_ndims(igrid) + 1 
+  110 CONTINUE
+      GOTO 20
+  29  CONTINUE  ! counting dimensions
+
+      iaxis_last = 0
+      iorder = 0
+      DO 220 i = 1, disordered
+         iorder = iorder + 1
+         iaxis = INT(axes_out_of_order(iorder))
+	 IF (iaxis.EQ.iaxis_last .OR. iaxis.EQ.0) GOTO 220
+         iaxis_last = iaxis
+
+C Axis marked with a direction but is in inconsistent position in grids?
+         IF (line_direction(iaxis).NE.'NA' .AND. .NOT.already_noted(iaxis)) THEN
+	    vlen = TM_LENSTR1(line_name(iaxis)) 
+            CALL TM_NOTE( 'Axis '//line_name(iaxis)(1:vlen)//' marked as '//
+     .          line_direction(iaxis), lunit_errors )
+            CALL TM_NOTE(
+     .          'but it has different directions in grids. '//
+     .          'Axes in grids may be inconsistent.', lunit_errors)
+            already_noted(iaxis) = .TRUE.
+         ELSE
+
+c Find the grid which contains this axis and has the most dimensions.
+            igrid1 = 0
+            ipos1 = 0
+            n_in_grid = 0
+	    
+            igrid = 0 
+  40        CALL TM_NEXT_TMP_GRID( igrid, *49)
+            DO 130 idim = 1, nferdims
+               IF (grid_line(idim, igrid) .EQ. iaxis .AND. 
+     .             grid_ndims(igrid) .GT. n_in_grid) THEN
+                  igrid1 = igrid
+                  ipos1 = idim
+                  n_in_grid = grid_ndims(igrid)
+               ENDIF
+  130        CONTINUE
+
+            GOTO 40
+  49        CONTINUE  ! Grid with this axis and most dimensions
+
+* Adjust grids based on position already determined for the grid with most axes.
+
+            igrid = 0               ! Loop over all grids comparing with grid1
+  90        CALL TM_NEXT_TMP_GRID( igrid, *99)
+            IF (igrid .NE. igrid1) THEN
+               ipos2 = 0
+               igrid2 = 0
+               DO 150 idim = 1, nferdims
+                  IF (grid_line(idim, igrid).EQ. iaxis .AND. 
+     .                 idim .NE. ipos1)  THEN
+                     igrid2 = igrid
+                     ipos2 = idim
+                  ENDIF
+  150          CONTINUE
+
+               IF (igrid2 .NE. 0) THEN
+                  i1 = MIN(ipos1, ipos2)
+                  i2 = MAX(ipos1, ipos2)
+                  shift_ok = .FALSE.
+                  DO 160 idim = i1, i2
+                         iax = grid_line(idim,igrid2)
+
+                         IF (grid_line(idim,igrid2) .LE. 0 .OR.
+     .                       line_direction(iax) .EQ. 'NA') 
+     .                       shift_ok = .TRUE.
+  160             CONTINUE
+                  IF (shift_ok) THEN
+                     DO 170 idim = 1, nferdims
+                        grid_save(idim) = grid_line(idim,igrid2)
+  170                CONTINUE
+
+                     grid_line(ipos1,igrid2) = grid_line(ipos1,igrid1)
+                     line_use_dir(grid_line(ipos1,igrid1)) = ipos1
+                     grid_line(ipos2,igrid2) = mpsnorm
+
+                     DO 180 idim = ipos2+1, nferdims
+                        IF (grid_save(idim-1).NE.mpsnorm) THEN
+                           grid_line(idim-1,igrid2) = grid_save(idim)
+			   need_iterate = .TRUE.
+			ENDIF
+  180                CONTINUE
+
+                     reordered = reordered + 1
+                  ELSE
+                     vlen = TM_LENSTR1(line_name(iaxis)) 
+
+                     CALL TM_NOTE('Could not adjust grid containing axis '// 
+     .                       line_name(iaxis)(1:vlen), lunit_errors)
+
+                     CALL TM_NOTE('Axes in grids may be inconsistent.',
+     .                         lunit_errors)
+                  ENDIF
+                  
+               ENDIF  ! igrid2 .ne. 0
+            ENDIF
+             
+            GOTO 90
+  99        CONTINUE  ! Loop over all grids comparing with grid1
+
+          ENDIF
+  220 CONTINUE ! disordered
+
+      iter = iter + 1
+      IF (iter .LT. 10) GOTO 1000
+* Here loop back if need_iterate is true.
+
+* Reset ds_grid_start and ds_grid_end
+
+ 2000 CONTINUE 
+      IF (reordered .GT. 0) THEN
+* * * * loop through each variable in this TMAP data set * * *
+      DO 250 tmvar = 1,maxvars
+         IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 250
+         igrid = ds_grid_number(tmvar)
+
+* Check.  Did we wind up with a different number of axes after
+* attempt to fix the grids?
+
+         ncheck = 0
+         DO 200 idim = 1, nferdims
+	       IF (grid_line(idim,igrid) .GT. 0) ncheck = ncheck + 1
+  200     CONTINUE 
+
+         IF (ncheck .NE. grid_ndims(igrid)) THEN
+* Issue warnings
+            ivar = cd_varid(tmvar)
+            CALL CD_GET_VAR_INFO(dset, ivar, vname, vartyp, nvdims,
+     .                 vdims, nvatts, coordvar, all_outflag, istat)
+            vlen = TM_LENSTR1(vname) 
+            CALL TM_NOTE(' ', lunit_errors)
+            CALL TM_NOTE('Could not adjust grid for variable '// 
+     .                 vname(1:vlen), lunit_errors)
+            CALL TM_NOTE('Axes in grids may be inconsistent.',
+     .                 lunit_errors)
+* Restore grids as they were read. At least the data can be viewed
+* and perhaps used to fix the file.
+
+            DO 210 idim = 1, nferdims
+	       grid_line(idim,igrid) = copy_of_grids(idim,igrid-500)
+  210       CONTINUE 
+ 
+         ENDIF
+
+	 ndim = 0
+	 DO 230 idim = 1, nferdims
+	    iaxis = grid_line(idim, igrid)
+	    ds_grid_start(idim,tmvar) = 1
+	    ds_grid_end(idim,tmvar) = 1
+            IF (iaxis .EQ. 0) THEN
+	       ds_ordering(idim,tmvar) = 0
+	    ELSE
+	       ds_grid_end(idim,tmvar) = line_dim(iaxis)
+	       ndim = ndim + 1
+	       isave_order = ds_ordering(ndim,tmvar)  ! want to keep the sign
+	       ds_ordering(ndim,tmvar) = idim
+
+	       IF ( reversed(iaxis) ) THEN
+	          ds_ordering(ndim,tmvar)
+     .			      = -1 * ds_ordering(ndim,tmvar)
+               ELSE
+	          IF ( perm(idim).NE.unspecified_int4 .AND. perm(idim).LT.0) THEN
+		  ds_ordering(ndim,tmvar) = -1 * ds_ordering(ndim,tmvar)
+                  ELSE   ! if already had a reversed coord indicated, save that.
+                     IF ( (ABS(isave_order) .EQ. ABS(ds_ordering(ndim,tmvar)) )
+     .	                 .AND.(isave_order .NE. ds_ordering(ndim,tmvar)) )
+     .	               ds_ordering(ndim,tmvar) = isave_order
+                  ENDIF
+               ENDIF
+	    ENDIF
+
+  230    CONTINUE 
+
+* Now apply user-supplied ordering and reversals
+	 permuted  = .FALSE.
+
+        lastdim = 0
+        DO 240 idim = 1, nferdims
+           tmplines(idim) = ds_ordering(idim,tmvar)
+
+           IF (perm(idim).EQ.0 .OR. perm(idim).EQ.unspecified_int4) GOTO 240
+           IF ( ABS(perm(idim)) .LE. lastdim ) permuted = .TRUE.
+           IF ( perm(idim).NE.unspecified_int4 .AND. perm(idim).LT.0 )
+     .		   permuted = .TRUE.
+           lastdim = ABS(perm(idim))
+ 240     CONTINUE
+
+* get the variable name
+         IF (permuted) THEN
+            ivar = cd_varid(tmvar)
+            CALL CD_GET_VAR_INFO(dset, ivar, vname, vartyp, nvdims,
+     .                 vdims, nvatts, coordvar, all_outflag, istat)
+
+            vlen = TM_LENSTR1(vname)
+            CALL TM_AXIS_ORDER(tmplines, perm, ds_ordering(1,tmvar),
+     .                           nvdims, vname(:vlen))
+         ENDIF
+
+  250 CONTINUE
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/cd_conventions_out.F b/fmt/src/cd_conventions_out.F
new file mode 100644
index 0000000..17af6fc
--- /dev/null
+++ b/fmt/src/cd_conventions_out.F
@@ -0,0 +1,94 @@
+	SUBROUTINE CD_CONVENTIONS_OUT(append, cdfid, string, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Put a "conventions" attribute into the current netCDF output file
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* 7/2007 from CD_STAMP_OUT
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       append  - logical control to create or append
+*       cdfid   - returned pointer to open CDF file
+*       string  - conventions string to add
+*	status	- return status
+
+* argument declarations:
+        LOGICAL  append
+	INTEGER	 cdfid, status
+        CHARACTER*(*) string
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+        include 'cd_lib.parm'
+
+* local variable declarations:
+
+      INTEGER TM_LENSTR1, clen, slen
+      LOGICAL CD_GET_ATTRIB, got_it, do_warn
+      PARAMETER (do_warn = .TRUE. )
+      CHARACTER*132 buff
+
+* initialize
+      slen = MIN( TM_LENSTR1(string), 120 )
+
+* update (or create) conventions record
+      got_it = CD_GET_ATTRIB( cdfid, NCGLOBAL, 'Conventions',
+     .                     .NOT.do_warn, ' ', buff, clen, 132 )
+
+* is the last conventions stamp the same as this ?
+      IF ( clen .GE. slen ) THEN
+         IF ( buff(clen-slen+1:clen) .EQ. string(:slen) ) RETURN
+      ENDIF
+
+* insert new attribute
+      CALL CD_WRITE_ATTRIB(cdfid, pcdf_global, 'Conventions',
+     .                     string(:slen), append, status )
+      IF ( status .NE. merr_ok ) GOTO 5000
+
+* successful completion
+      status = merr_ok
+*      RETURN
+
+* error exit
+ 5000 RETURN
+	END
diff --git a/fmt/src/cd_defer_coord_write.F b/fmt/src/cd_defer_coord_write.F
new file mode 100644
index 0000000..e4efbe0
--- /dev/null
+++ b/fmt/src/cd_defer_coord_write.F
@@ -0,0 +1,79 @@
+	SUBROUTINE CD_DEFER_COORD_WRITE(cdaxis, grid, idim, lo, hi,
+     .				        axis_type)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set variables to perform writing of netCDF axis coordinates at a later time
+* (required for performance since switching between DEFINE and DATA modes
+* can be so costly)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530 *sh* - 12/00
+
+* argument declarations:
+	INTEGER cdaxis, grid, idim, lo, hi, axis_type
+
+* include files
+        include 'cdf_tmap.parm'
+        include 'xdefer_coords.cmn'
+	include 'xio.cmn_text'
+
+* local variable declarations:
+
+	IF ( axis_type .EQ. pcd_defer_init ) THEN
+* initialize the list of deferred axes
+	  dfr_num = 0
+
+	ELSE
+* store info for a deferred axis coord points write
+	  dfr_num = dfr_num + 1
+	  dfr_cdaxis(dfr_num) = cdaxis
+	  dfr_grid(dfr_num) = grid
+	  dfr_idim(dfr_num) = idim 
+	  dfr_lo(dfr_num) = lo
+	  dfr_hi(dfr_num) = hi
+	  dfr_axis_type(dfr_num) = axis_type
+	ENDIF
+
+	RETURN
+	END
+
+
+
+
+
+
diff --git a/fmt/src/cd_delete_attribute.F b/fmt/src/cd_delete_attribute.F
new file mode 100644
index 0000000..265c289
--- /dev/null
+++ b/fmt/src/cd_delete_attribute.F
@@ -0,0 +1,71 @@
+      SUBROUTINE CD_DELETE_ATTRIBUTE (dset, ivar, attname, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Access the linked list structure for netcdf variables. 
+* given dset, ivar, attribute name, remove that attribute.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 10/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+
+* Argument declarations
+
+      CHARACTER*(*) attname
+      INTEGER dset, ivar, status
+
+* Internal declarations
+
+      INCLUDE 'tmap_errors.parm'
+
+      INTEGER NCF_DELETE_VAR_ATT, TM_LENSTR1, slen, flen, dset_num
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      slen = TM_LENSTR1( attname )
+      CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_DELETE_VAR_ATT(dset_num, ivar, fhol)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_dods_control.F b/fmt/src/cd_dods_control.F
new file mode 100644
index 0000000..a6b39a8
--- /dev/null
+++ b/fmt/src/cd_dods_control.F
@@ -0,0 +1,163 @@
+	SUBROUTINE CD_DODS_CONTROL ( dset, cdfid, remote_dods_id, cdfstat )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Remote DODS file open has just been simulated using a local cache
+* Now pass control over to the remote file to create the illusion that
+* it was legitimately opened
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 11/96
+* Linux Port - 6/97 - reorder if def logic when setting cd_data_type to 
+*		      BYTE or INTEGER*1
+*		    - use a cpp include for tmap_dset.parm
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*    dset - data set number
+*    cdfid -  NetCDF open id for cache file
+*    remote_dods_id - NetCDF open id for remote DODS file
+*    cdfstat - return cdfstat
+
+* argument declarations:
+	INTEGER	dset, cdfid, remote_dods_id, cdfstat
+
+* include files
+        include 'netcdf.inc'
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+	include 'xtm_grid.cmn_text'
+	include 'xstep_files.cmn_text'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* special equivalence (not in tmap_format/xdset_info.cd_equiv because "BYTE"
+* isn't supported on DECstation)
+* reorder loop logic because linux cpp didn't like it *kob* 10/96
+
+#  ifdef NEED_BYTE
+      BYTE cd_data_type(maxvars)
+#   else
+      INTEGER*1 cd_data_type(maxvars)
+#   endif
+
+	EQUIVALENCE ( ds_precision, cd_data_type )
+
+* local variable declarations:
+	LOGICAL CD_GET_ATTRIB, CD_GET_ATTVAL,
+     .	got_it, do_warn
+	INTEGER tmvar, grid, idim, line, istep, attlen
+	REAL	val
+
+* local data initialization
+	DATA do_warn/ .TRUE. /
+
+* loop through the variables in this data set
+	DO 100 tmvar = 1, maxvars
+	   IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 100
+
+* get the correct NetCDF data type from attributes in the cache file
+	   got_it = CD_GET_ATTVAL( cdfid, cd_varid(tmvar),
+     .			'netcdf_data_type', do_warn, ' ', val, 1, cdfstat )
+	   IF ( .NOT. got_it ) GOTO 5100
+	   cd_data_type(tmvar) = val
+
+* get the correct NetCDF variable id from attributes in the cache file
+	   got_it = CD_GET_ATTVAL( cdfid, cd_varid(tmvar),
+     .			'netcdf_var_id', do_warn, ' ', val, 1, cdfstat )
+	   IF ( .NOT. got_it ) GOTO 5100
+	   cd_varid(tmvar) = val
+
+* restore the full span of the grids to the variables
+	   grid = ds_grid_number(tmvar)
+	   DO 50 idim = 1, 4
+	      line = grid_line(idim,grid)
+	      IF (line .NE. mpsnorm) ds_grid_end(idim,tmvar)
+     .				     = line_dim( line )
+ 50	   CONTINUE
+
+ 100	CONTINUE
+
+* get the full URL back again (cache name was substituted in ds_des_name)
+	got_it = CD_GET_ATTRIB( cdfid, NF_GLOBAL, 'DODS_URL',
+     .                     do_warn, ' ', ds_des_name(dset), attlen, 128 )
+	IF ( .NOT. got_it ) GOTO 5100
+
+* close the cache file and substitute the remote file in its place
+
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_CLOSE_( cdfid )
+#else
+	cdfstat = NF_CLOSE ( cdfid )
+#endif
+
+* insert the remote file info in place of the cache info
+	istep = cd_stepfile(dset)
+	sf_lunit(istep) = remote_dods_id
+	cdfid = remote_dods_id
+	sf_name(istep) = ds_des_name(dset)
+
+* successful completion
+      cdfstat = merr_ok
+      RETURN
+
+* error exit
+ 5100	CALL TM_ERRMSG( merr_dsetnf, cdfstat, 'CD_DODS_CONTROL',
+     .                   dset, no_stepfile,
+     .                   'DODS cache file lacks necessary attributes',
+     .                   no_errstring, *5900)
+ 5900	CALL CD_ABORT_GRIDS
+
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_CLOSE_( remote_dods_id )
+#else
+	cdfstat = NF_CLOSE ( remote_dods_id )
+#endif
+ 5990	RETURN
+	END
diff --git a/fmt/src/cd_dset_remoteok.F b/fmt/src/cd_dset_remoteok.F
new file mode 100644
index 0000000..db529a9
--- /dev/null
+++ b/fmt/src/cd_dset_remoteok.F
@@ -0,0 +1,126 @@
+	  SUBROUTINE CD_DSET_REMOTEOK(dset, ok_remote)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+C Check whether we can define a LET/REMOTE variable in this dataset.
+* Sets the flag  ds_accepts_remote for the dataset.
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xdset_info.cd_equiv'
+
+	INTEGER dset
+	LOGICAL ok_remote
+
+	LOGICAL TM_HAS_STRING
+	INTEGER TM_LENSTR1, slen, vlen, ivar, cdfid, cdfstat, status
+	CHARACTER vname*128, buff*3000, ebuff*3000
+
+* Already checked? 
+	IF (ds_accepts_remote(dset)) GOTO 5000
+
+* If not an opendap set, then it does not accept remote definitions
+	IF ( ds_des_name(dset)(1:7) .NE. 'http://') GOTO 5100
+
+	DO 100 ivar = 1, maxvars
+	   IF (ds_var_setnum(ivar) .EQ. dset) GOTO 110
+ 100	CONTINUE
+        GOTO 5000	 !no variables in the datset, so return FALSE
+ 110	CONTINUE
+
+	slen = TM_LENSTR1(ds_des_name(dset))
+
+* If its already a datset with f-tds variable in it, it cannot be used.
+* (depending on where we're calling this, there should be a message).
+
+	IF (TM_HAS_STRING(ds_des_name(dset)(1:slen), 'letdeq1')) GOTO 5000
+
+* Name of first variable, use it to define a variable name.
+
+	vname = ds_var_code(ivar)
+	vlen = TM_LENSTR1(vname)
+
+* Construct a url which is the original url, with a variable defined,
+* LET varname_1_NEW = 7
+	
+	buff = '{}{letdeq1 '//vname(:vlen)//'1_new=7}'
+	slen = TM_LENSTR1(buff)
+
+* Encode the variable definition, set up the full url, 
+* and try to open it.
+
+	CALL CD_ENCODE_URL ( buff, ebuff, status)
+
+	slen = TM_LENSTR1(ds_des_name(dset))
+	vlen = TM_LENSTR1(ebuff)
+	buff = ds_des_name(dset)(:slen)//'_expr_'//ebuff(:vlen)
+
+#ifdef usingDODSf2cUnderscore 
+	cdfstat = NF_OPEN_(buff, NF_NOWRITE, cdfid) 
+#else
+	cdfstat = NF_OPEN(buff, NF_NOWRITE, cdfid) 
+#endif
+
+* If it could be opened, we can make remote-variable definitions.
+
+	IF (cdfstat .EQ. NF_NOERR) THEN
+	   ds_accepts_remote(dset) = .TRUE.
+
+* close the url with f-tds var - we were just testing here.
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_CLOSE_( cdfid )
+#else
+	   cdfstat = NF_CLOSE( cdfid )
+#endif
+
+	ELSE
+	   ds_accepts_remote(dset) = .FALSE.
+	   CALL WARN ('dataset does not accept REMOTE variable definitions')
+	ENDIF
+
+ 5000	ok_remote = ds_accepts_remote(dset)
+	RETURN
+
+ 5100	CONTINUE
+	ds_accepts_remote(dset) = .FALSE.
+	CALL WARN ('dataset does not accept REMOTE variable definitions')
+	END
+
diff --git a/fmt/src/cd_encode_url.F b/fmt/src/cd_encode_url.F
new file mode 100644
index 0000000..c3baba1
--- /dev/null
+++ b/fmt/src/cd_encode_url.F
@@ -0,0 +1,83 @@
+	SUBROUTINE CD_ENCODE_URL ( urlbuff, ebuff, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+
+* 
+* V6.85 2/13 
+* argument definitions:
+*       urlbuff - url to encode
+*       ebuff   - result enocded url
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      status
+	CHARACTER*(*) urlbuff, ebuff
+
+	INTEGER url_encode
+
+
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+
+
+        INTEGER   TM_LENSTR1, llen, slen
+        PARAMETER (slen=2048)
+
+#ifdef sun
+        BYTE        fhol_url(slen)      ! c-type Hollerith string buffer
+	BYTE      fhol_eurl(slen)
+#else
+	INTEGER*1 fhol_url(slen)      ! c-type Hollerith string buffer
+	INTEGER*1 fhol_eurl(slen)
+#endif
+
+* Save dataset info in GLOBAL_NCdsetList for attribute handling
+
+        llen = TM_LENSTR1( urlbuff )
+        CALL TM_FTOC_STRNG( urlbuff(1:llen), fhol_url, slen )
+
+        status = url_encode(fhol_url, fhol_eurl, llen)         
+        IF (status .EQ. 0) THEN
+           CALL TM_CTOF_STRNG (fhol_eurl, ebuff, llen) 
+	   status = merr_ok
+	ENDIF
+
+* successful completion
+	
+	RETURN
+	END
diff --git a/fmt/src/cd_get_1_axis.F b/fmt/src/cd_get_1_axis.F
new file mode 100644
index 0000000..d13c68e
--- /dev/null
+++ b/fmt/src/cd_get_1_axis.F
@@ -0,0 +1,1347 @@
+        SUBROUTINE CD_GET_1_AXIS(dset, cdfid, ivar, iaxis, its_epic,
+     .                           reversed, tregular, use_strict, 
+     .                           bad_bndsid, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*.
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Load the common block XGRID with a single axis definition from a
+* netCDF file
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+*   8/19/92: search for "LAT" in axis units was setup wrong
+*  10/20/92: a more systematic approach to identifying the axis orientation
+*  11/30/92:  changed Z axis orientation "UP" to "DU"
+* 12/92: use TM_FPEQ_EPS to test regularity of axes
+*  1/93: special error message for npts=0 (for UNLIMITED time axis in CDL)
+*  2/93: allow zero length axis and out of order axes by substituting dummies
+*  3/93: added EPIC support
+*  4/93: bug fix: set default units if time_origin is read
+* 10/93: EPIC longitudes now use "degree_east".  Allow west-encoded longitudes
+*        for any data set using units like "degree west" or "positive=west".
+*  8/94: for out of order coordinates 1) issue a max # of messages and 2)
+*        allow strictly DECREASING coordinates by multiplying by -1
+* 12/94: millibar and decibar (and all pressure) units should be UD 
+*        allow "height" as a DU axis name
+*  2/95: interpret time units like "hours since 1982-12-01 12:52:00"
+*  2/95: note reverse-ordered coordinate axes in array "reversed"
+*        and reverse the coordinates as saved
+*        Also allow CDC-style yyyymmdd time format
+* 10/95: if a longitude axis has 360 degrees then default to MODULO
+* 11/95: recognize units "degrees_north" as a latitude
+*  4/96: bug: millibar and decibar units identified by wrong constants
+*  8/97: bug: X axis with "y" in axis name is mis-identified 
+* 5/98 *kob* : mod so that CDC datafiles w/ two day offsets are compatible
+*              w/ ferret.  
+* V500 3/99 *sh*: instead of erroring out, simply return iaxis=0 for an
+*       invalid coordinate axis -- to be handled by calling program
+* V500 4/99 *kob*:  increase vname and vupcase from 24 to 64 chars 
+* V510 *sh* 3/00 - added tregular argument
+*                - convert to dynamic grids and axes
+* V530 *sh* 1/01 - automatically flag as modulo any time axis that ends before
+*                  year 0002
+* V530 *acm* 12/00 attribute for different calendar types
+*      *acm*  7/12/2001  correct for conflicts between prev two versions,
+*                        somehow checked into CVS w/o proper merging
+* V533 *acm*  8/30/01  change calendar name 360 to 360_day
+*      *acm* 10/01  remove VMS includes
+* V550 *sh*  2/02 - added support for line_modulo_len
+*      *sh* 11/02 - automatically detect subspan modulo longitude and time axes
+* V550 *acm*12/02 - AXIS and CARTESIAN_AXIS attributes, and modifications to
+*                   order of precedence for axis orientation.
+* V550 *acm* 1/03 - Account for differences in behavior of CD_GET_ATTVALC
+*                   under OSF and PC.
+* V552 *acm* 1/03 - error checking on value of calendar attribute.
+* V552 *acm* 5/03 - increase vname and vupcase to 128 chars 
+* V552 *acm* 6/03 - If AXIS attribute is set, put XX or YY in line_direction
+*                   at first, then determine if the axis is longitude/latitude
+* V552 *acm* 6/03 - calculate secsperyear using double precision arithmetic.
+* V553 *acm* 7/03 - New code to read files with time axis encodings of:
+*                      units: "days since -4713-01-01 00:00:00"
+*                   The code detects the -4713 and replaces the time origin
+*                   with 1-jan-1901.  Then subtract the correct number of days
+*                   from the time coordinates: 2415386.  This is a file made
+*                   by Matlab, which uses this "Julian" astromical date
+*                   convention (different from our Julian calendar).  The 
+*                   simple conversion is that May 23,1968 equals
+*                   2440000 days.
+* V554  *acm 12/03 Restore the last-ditch determination of line_direction
+*                        using the starting letter of the axis.
+* V570 *acm* 4/04  Add the calendar "all_leap", 366 days every year.
+*                  also the name "365_DAY" as an equivalent to "NOLEAP" 
+* V570 *acm* 5/04  Allow "bounds" attribute for defining an irregular axis.  Store
+*                  all irregular axis intervals as Nx2 bounds rather than Nx1 edges.
+*      *acm* 6/04  for compiler on rh7, need to pass dimensions of array into cd_rd_r8_bnds 
+*                  as scalar integers not array elements.
+*            6/18/04 Change order of operations so axes with edges are read the same as 
+*                  in previous versions.  Also treat 1-point axes having bounds correctly
+* V580 *acm* 10/04 Add a comment only, describing the hack to deal with CDC files starting 
+*                  in 1-1-1 00:00:00
+* V580 *acm* 11/04 Fix bug 1042 If bounds attribute has a problem found by TM_CHECK_BNDS_ATTRIB,
+*                  just skip applying the bounds. The edges have been defined by putting them
+*                  midway between coordinates; use this definition. If there is only one point 
+*                  on the axis, then set it to be a regular axis.  
+* V580 *acm* 11/04 further fixes for when there is just one point on an axis having bounds
+*                  first_delta is meaningless and should not be used.
+* V581 *acm*  1/05 Fixes for irreg axes with bounds: tm_check_bnds_centered now checks
+*                  whether the coordinates are centered in the bound boxes, and whether
+*                  the boxes are equal sized. Also fix def of d2e for reading axis bounds.
+* V581 *acm*  2/05 Fix bug 1179: axis_dir .EQ. 'z' needs to be done as a case-insensitve
+*                  comparison, in section testing positive=down.
+* V581 *acm*  5/05 Fix bug 1231: check 'TT and 'TI' when applying tregular
+* V581 *acm*  5/05 Fix bug 1232: if tregular, then dont try to use bounds
+* V581*acm*  6/05  Fix for bug 1271, add flag line_shift_origin marking hack to shift axes 
+*                   starting on 1-1-0001 (CDC files)
+* V600 *acm* 10/05 TM_CHECK_BNDS_ATTRIB and TM_CHEC_EDGES_ATTRIB should not have 
+*                  npts as an argument; npts from axis length was being reset
+*                  as npts bounds or edges, which is npts+1
+* V600 *acm* 11/05 Fix bug 1363: As is already done for years, named calendar with unit=month 
+*                  gets assigned the length of month in that calendar.
+* V600 *acm*  2/06 Fix bug 1394: if the time units contain a "since" but the remainder of
+*                  the string is not a date, keep the whole units string.
+* V600 *acm* 3/06  Fix bug 1400: Change in the call to TM_CHECK_BNDS
+* V600 *acm* 8/05  attribute control. 
+*                  Replace NCVID with CD_GET_VAR_ID
+*                  Replace NCVINQ for variables, with CD_GET_VAR_INFO
+*                  Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from 
+*                  linked list structure
+*                  CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*                  strings or real values according to attrib type
+* V600 *acm* 6/06  use TM_FPEQ_EPS to compare coordinates.
+* V601 *acm* 9/19  Fix bug 1443; MAXLEN of bounds name should be NF_MAX_NAME from netcdf.inc
+* V601 *acm* 9/19  Fix bug 1434; check bounds for regularly-spaced axes 
+* V602 *acm* 1/07  Fix bug 1483; checking for irregularly spaced axis failed if the delta-coordinates
+*                  on the axis varied by orders of magnitude.
+* V602  2/07 *acm* Check upper and lowercase versions of axis (coordinate_axis) attribute
+* V604  6/07 *acm* Further fixes for finely-spaced axes (see bug 1483); compute only one epsilion23
+*                  for checking regularity of axes. For checking axis length of 360, use TM_FPEQ
+*                  to allow for numerical accuracy of bounds for axes of exactly length360.
+* V61   1/08 *acm* Fix bug 1559: Sanity-checking the modulo length can run into precision
+*                  problems, in particular if the axis coordinates in the file are single-precision.
+* V612  8/08 *acm* If the file has a point-spacing=uneven attribute, mark the axis as irreg
+*                  and do not do all the testing for regular axis.
+* V62  10/08 *acm* Add PROLEPTIC_GREGORIAN to the calendars recognized; same as GREGORIAN
+* 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.
+* V63   7/09 *acm* Fix bug 1676 Reversed axis with EDGES 
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+*      *kms* 5/10  Fix scaling/offset bug: using iaxis instead of i inside loops 334 and 336
+*
+* V67 *acm* 1/11   WE, SN, not XX, YY in line_direction
+* V68 *acm* 1/12   Implement micro-adjusting of repeated coordinates (ticket 1910).
+*                  To keep the previous behavior the user may specify USE/STRICT.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.83 12/12 *acm* ticket 1996: NOTE if reversing an axis
+* V685 *acm* 1/13  Fix ticket 2026: dont automatically treat a 1-point longitude
+*                  axis as modulo.
+* V685 *acm* 8/13  Fix ticket 2088: Report the correct index location in axis when
+*                  unrepairable repeated axis coords on axis
+* V685 *acm* 8/13  Fix ticket 2090: If there is enough coord storage to read just the coords
+*                  but not bounds, still read and check coordiantes for regular spacing.
+* V685 *acm* 9/13  Move the NOTE about reversing a decreasing-ordered axis, so that
+*                  it shows up for regularly spaced ones.
+* V685 *acm* 11/13 REALLY make the check for axis length in single precision when the
+*                  coordinate variable came in as a single-precision variable.
+* V6.87 4/14 *acm* ticket 2146: if invalid bounds, make the bounds a dependent variale.
+
+* argument definitions:
+*       cdfid    - netCDF id number for already opened CDF file  (to go away with new attr. hanling)
+*       dset     - dataset number for already opened CDF file
+*       ivar     - netCDF variable id number
+*       iaxis    - returned pointer to the axis created
+*       its_epic - flags an EPIC netCDF data set
+*       reversed    - logical array to record which axes have reversed coords
+*       status   - return status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xbuild_grids.cmn'
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+        include 'xio.cmn_text'
+        external xio_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+        include 'xunits.cmn_text'
+        external xunits_data
+        include 'calendar.decl'
+        include 'calendar.cmn'
+        include 'errmsg.parm'
+
+* argument declarations
+        LOGICAL  its_epic, reversed(max_lines:line_ceiling), tregular, 
+     .           use_strict
+        INTEGER  cdfid, dset, ivar, iaxis, bad_bndsid, status
+
+* local parameter definitions:
+      INTEGER     str_eq
+      PARAMETER ( str_eq = 0 )
+      REAL epsilon_23
+      REAL*8 depsilon_46, depsilon, dlast_coord, dfirs_coord,
+     .       dfirst_delta, ddelta
+
+* local variable declarations:
+      LOGICAL NC_GET_ATTRIB, CD_GET_ATTVAL, TM_CHECK_BOX_LOC,
+     .        TM_HAS_STRING, TM_FPEQ_EPS, TM_DFPEQ, CD_GET_ATTVALC, 
+     .        CD_GET_ATTVAL_L, TM_CHECK_BNDS, TM_CHECK_BNDS_CENTERED, 
+     .        TM_FPEQ, TM_DFPEQ_TOL, NC_GET_ATTRIB_DP,
+     .        got_it, got_torg, do_warn,
+     .        epic_time, west_lon, yyyymmdd_time, 
+     .        got_mod, mod_tf, setmodfalse, ok_cal, ok,
+     .        got_edges, got_bnds, coordvar, its_irregular, 
+     .        do_scale, do_offset, scale_is_dp, 
+     .        has_repeated, misordered
+
+      INTEGER TM_UNIT_ID, TM_LENSTR1,TM_GET_CALENDAR_ID,      
+     .        STR_CASE_BLIND_COMPARE, STR_UPCASE, 
+     .        soft_err, 
+     .        ipt1, ipte, vartype, vback, npts, vlen, cdfstat, istat,
+     .        nvdims, vdims(8), nvatts, i, units, npts_cdf, elen, 
+     .        edgid, spacing_atlen, epic_t2var, since_T0,
+     .        cal_id, year, month, day, hour, minute, second, slen, nc,
+     .        blen, bndid, startpts(2), numpts(2), next_line_storage,
+     .        d1s, d1e, d2s, d2e, len_cal, attoutflag, maxlen,
+     .        all_outflag, dir, attlen, itop, irev, attype, iatt, ibx1,
+     .        i1, i2, i3, i0
+
+      REAL    rbuff, delta, first_delta, val, epsilon, lm_len, 
+     .        scale, offset
+      REAL*4  r4delta
+      REAL*8  TM_LONW2LONE, TM_WW_AXLEN, tmp8, axwwlen, 
+     .        dscale, doffset,  micro_adj, madj
+      CHARACTER*12 TM_LEFINT
+      CHARACTER vname*128, ename*128, vupcase*128, words(8)*24,
+     .        spacing_attr*14, bname*128
+      CHARACTER*13 TM_STRING
+      CHARACTER*1 axis_dir
+      CHARACTER*50 allcals
+      CHARACTER*3 dbuf
+      CHARACTER*2 dcode
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+      INTEGER bufflen
+      PARAMETER (bufflen = 256)
+      CHARACTER*256 buff
+      REAL*8   TM_SECS_FROM_BC, first, secs2firststep, secs1590,
+     .         t0_secs, last_coord, firs_coord, secsperyear, secs2start,
+     .         days_neg4713, days_1901_may68, secs_to_1901, secs_to_1968 
+
+* parameter declarations
+        REAL*8          psecs_per_day
+        PARAMETER     ( psecs_per_day = 60.*60.*24. )
+
+* initialize for EPIC
+      do_warn = .NOT.its_epic     ! EPIC files can get away with anything
+      west_lon = .FALSE.          ! assume longitudes are positive east
+      iaxis = 0
+
+* gen; initialization
+ 
+      got_torg = .FALSE.
+      days_neg4713 = 0.D0
+      next_line_storage = next_line_mem_pos
+      bad_bndsid = 0
+
+* (From Wikipedia on precision:)
+* Single precision, called "float" in the C language family, and "real" 
+* or "real*4" in Fortran. This is a binary format that occupies 32 bits (4 bytes) 
+* and its significand has a precision of 24 bits (about 7 decimal digits).
+* Double precision, called "double" in the C language family, and "double precision" 
+* or "real*8" in Fortran. This is a binary format that occupies 64 bits (8 bytes) 
+* and its significand has a precision of 53 bits (about 16 decimal digits).
+
+      epsilon_23 =  2.**(-23) 
+      depsilon_46 =  2.**(-52)
+      depsilon_46 =  2.**(-46) 
+
+* get the vital statistics of the axis 
+
+      CALL CD_GET_VAR_INFO (dset, ivar, vname, vartype, 
+     .            nvdims, vdims, nvatts, coordvar, all_outflag, status)
+
+      IF (status .NE. merr_ok) GOTO 5100
+      vlen = TM_LENSTR1(vname)
+      istat = STR_UPCASE( vupcase, vname )
+!      IF ( nvdims .NE. 1 ) CALL TM_ERRMSG
+!     .     ( cdfstat+pcdferrmax, status, 'CD_GET_1_AXIS', cdfid, ivar,
+!     .     vname(:vlen), 'not a 1D variable', *5900 )
+
+* get axis length:
+
+      CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts_cdf, status)
+      IF (status .NE. ferr_ok) GOTO 5100
+
+! removed 3/93          IF ( npts_cdf .EQ. 0 ) GOTO 5150
+      npts = npts_cdf      ! differ only if "true_size" is used
+
+* grab a temporary dynamic axis slot for it
+      CALL TM_ALLO_TMP_LINE(iaxis, status)
+      IF (status .NE. merr_ok) GOTO 5900
+
+* Store the data type of the axis
+
+      line_dattype(iaxis) = vartype
+
+* Are there scale_factor and/or add_offset attributes?  If so need to unpack
+* the coordinate values
+
+      scale = 1.
+      dscale = 1.D0
+      offset = 0.
+      doffset = 0.D0
+      maxlen = bufflen
+      do_scale = NC_GET_ATTRIB(dset, ivar, 'scale_factor',
+     .                       do_warn, vname(:vlen), maxlen, attlen, 
+     .                       attoutflag, buff, scale)
+     
+      scale_is_dp = .FALSE.
+
+      IF ( do_scale ) THEN
+         CALL CD_GET_VAR_ATT_ID (dset, ivar, 'scale_factor', iatt, 
+     .              status)
+         IF (iatt .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, ivar, 
+     .              iatt, buff, attype, attlen, attoutflag, istat )
+
+         IF (attype .EQ. nf_double) THEN
+             got_it = NC_GET_ATTRIB_DP(dset, ivar, 'scale_factor',
+     .                       do_warn, vname(:vlen), attlen, 
+     .                       attoutflag, dscale)
+             scale_is_dp = .TRUE.
+	 ENDIF
+      ENDIF
+
+      maxlen = bufflen
+      do_offset = NC_GET_ATTRIB(dset, ivar, 'add_offset',
+     .                       do_warn, vname(:vlen), maxlen, attlen, 
+     .                       attoutflag, buff, offset)
+
+      IF ( do_offset ) THEN
+         CALL CD_GET_VAR_ATT_ID (dset, ivar, 'add_offset', iatt, 
+     .              status)
+         IF (iatt .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, ivar, 
+     .              iatt, buff, attype, attlen, attoutflag, istat )
+
+         IF (attype .EQ. nf_double) THEN
+            got_it = NC_GET_ATTRIB_DP(dset, ivar, 'add_offset',
+     .                       do_warn, vname(:vlen), attlen, 
+     .                       attoutflag, doffset)
+            IF (do_scale .AND. (.NOT. scale_is_dp))  GOTO 5400
+     	 ELSE
+	    IF (do_scale .AND. scale_is_dp)  GOTO 5400
+     	 ENDIF
+
+      ENDIF
+      do_scale = do_scale .OR. do_offset
+ 
+* optional point spacing parameter: even, uneven, disordered
+      IF ( its_epic ) THEN
+         spacing_attr = 'type'          ! type = "EVEN" or ="E"
+         spacing_atlen = 4
+      ELSE
+         spacing_attr = 'point_spacing' ! point_spacing = "even"
+         spacing_atlen = 13
+      ENDIF
+
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB(dset, ivar, spacing_attr(1:spacing_atlen),
+     .                       do_warn, vname(:vlen), maxlen, attlen, 
+     .                       attoutflag, buff, val)
+
+      line_regular(iaxis) = .FALSE.
+      its_irregular = .FALSE.
+      IF ( got_it ) THEN
+         line_regular(iaxis) = buff(1:1).EQ.'e' .OR. buff(1:1).EQ.'E'
+         its_irregular = .NOT.line_regular(iaxis)
+      ELSE
+         line_regular(iaxis) = .FALSE. ! default
+      ENDIF
+
+* Bounds or edges attribute?
+
+      maxlen = 128
+      got_bnds = NC_GET_ATTRIB( dset, ivar, 'bounds',
+     .                       do_warn, vname(:vlen), maxlen, 
+     .                       attlen, attoutflag, bname, val)
+     
+      got_edges = NC_GET_ATTRIB( dset, ivar, 'edges',
+     .                       do_warn, vname(:vlen), maxlen,
+     .                       attlen, attoutflag, ename, val)
+
+* optional "true_size" parameter for 2 point representations of even axes
+      IF ( line_regular(iaxis) ) THEN
+
+         got_it = NC_GET_ATTRIB( dset, ivar, 'true_size', 
+     .                          do_warn, vname(:vlen), maxlen, 
+     .                          attlen, attoutflag, buff, val)
+         IF ( got_it ) THEN
+            IF ( npts_cdf .NE. 2 ) THEN
+               soft_err = 1
+               GOTO 5000
+            ENDIF
+            npts = val
+         ENDIF
+      ENDIF
+      line_dim( iaxis ) = npts
+
+      IF (npts .LT. 2) line_regular(iaxis) = .TRUE.
+
+* *ACM get the calendar name.
+
+      line_cal_name(iaxis) = 'GREGORIAN'   ! default
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset, ivar, 'calendar', do_warn,
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      IF (got_it) then
+         istat = STR_UPCASE (buff, buff)
+
+         IF (buff(1:3) .EQ. '360') buff = '360_DAY' 
+         IF (buff .EQ. 'STANDARD') buff = 'GREGORIAN' 
+         IF (buff .EQ. 'PROLEPTIC_GREGORIAN') buff = 'GREGORIAN' 
+         IF (buff(1:6) .EQ. 'COMMON') buff = 'NOLEAP' 
+         IF (buff(1:3) .EQ. '365') buff = 'NOLEAP' 
+         IF (buff(1:3) .EQ. '366') buff = 'ALL_LEAP' 
+
+         ok_cal = .FALSE.
+         nc = 1
+         allcals = ' '
+
+         DO 100 i = 1, mxcals
+  111       FORMAT (a9,' ')
+            slen = TM_LENSTR1( allowed_calendars(i)(1:9) )
+            write (allcals(nc:nc+9), 111) allowed_calendars(i)
+            nc = nc + 10
+
+            IF (buff(1:3) .EQ. allowed_calendars(i)(1:3) ) THEN
+               ok_cal = .TRUE.
+               line_cal_name(iaxis) = allowed_calendars(i)
+            ENDIF
+  100    CONTINUE
+         IF (.NOT. ok_cal) THEN
+            slen = TM_LENSTR1(buff)
+            CALL TM_NOTE('calendar attribute on axis "'//vupcase(:vlen)//
+     .                '" is not recognized: '//buff(1:slen), tt)
+            CALL TM_NOTE('Valid calendars are '//allcals, tt)
+            CALL TM_NOTE(
+     .             'A dummy axis of subscripts will be used', tt)
+            GOTO 1000
+         ENDIF
+      ENDIF
+      cal_id = TM_GET_CALENDAR_ID (line_cal_name(iaxis))
+
+* optional units for axis (may contain "tunits since T0_date" 2/95)
+      line_units(iaxis) = ' '   ! default
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset, ivar, 'units', do_warn,
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      since_T0 = MAX( INDEX(buff,'since'), INDEX(buff,'SINCE') )
+      yyyymmdd_time = buff(1:15) .EQ. 'yyyymmddhhmmss'
+
+      IF ( since_T0 .GT. 2 ) THEN
+         line_units(iaxis) = buff(:since_T0-1)  ! just the "tunits" part 
+
+         istat = STR_UPCASE( dbuf, buff(1:3) )
+
+         slen = TM_LENSTR1(buff)
+         IF ( slen .GT. since_T0 + 5) THEN
+            IF (buff(since_T0+6:since_T0+10) .EQ. '-4713' .AND.
+     .          dbuf .EQ. 'DAY')  THEN
+
+c  This is the simple conversion; but we will reset the origin to 1901.
+c               buff = 'DAYS since 1968-05-23 00:00:00'
+c               days_neg4713 = 2440000.D0
+
+               buff = 'DAYS since 1901-01-15 00:00:00'
+               secs_to_1901 = TM_SECS_FROM_BC 
+     .                        (GREGORIAN, 1901,1,15,0,0,0,status)
+               secs_to_1968 = TM_SECS_FROM_BC 
+     .                        (GREGORIAN, 1968,5,23,0,0,0,status)
+               days_1901_may68 = (secs_to_1968 - secs_to_1901)/
+     .                             psecs_per_day
+               days_neg4713 = 2440000.D0 - days_1901_may68
+
+            ENDIF
+            got_torg = .TRUE.
+            CALL TM_DATE_REFORMAT(buff(since_T0+6:),pdate_numslashnum,
+     .                            cal_id, line_t0(iaxis), 
+     .                            pdate_vax, .FALSE., status )
+
+c fix for bug 1394
+c If the part after since is not a date/time, just keep the whole
+c string as the units.  i.e., "days_since_event".
+
+c           IF ( status .NE. merr_ok ) GOTO 1000        ! 3/99 soft error 
+
+            IF ( status .NE. merr_ok ) THEN   
+               line_units(iaxis) = buff(1:slen)
+               got_torg = .FALSE.
+               since_t0 = 0
+               status = merr_ok
+            ENDIF
+         ELSE
+            since_t0 = 0        ! flag that no T0 was present
+         ENDIF
+      ELSEIF ( yyyymmdd_time ) THEN
+         line_units(iaxis) = 'days'
+         line_t0(iaxis) = ' ' ! to be determined when coords are read
+         got_torg = .TRUE.
+      ELSE
+         IF (got_it) line_units(iaxis) = buff
+         got_torg = .FALSE.
+      ENDIF
+
+* EPIC time axes are encoded as 2 integers in variables TIME and TIME2
+      IF ( its_epic .AND.  vupcase .EQ. 'TIME' ) THEN
+         CALL CD_GET_VAR_ID ( dset, 'time2', epic_t2var, status)
+         epic_time  = epic_t2var .NE. atom_not_found
+      ELSE
+         epic_time  = .FALSE.
+      ENDIF
+      IF ( epic_time ) line_units(iaxis) = 'Days'     ! arbitrary
+
+* ... decode the units
+
+      units = TM_UNIT_ID( line_units(iaxis) )
+
+* Named calendar with unit=year gets length of year in that calendar.
+
+      IF (units .EQ. -6 .OR. units .EQ. -10) THEN
+         IF (cal_id .EQ. d360) units = -9
+         IF (cal_id .EQ. julian) units = -12
+	 IF (cal_id .EQ. noleap) units = -11
+	 IF (cal_id .EQ. all_leap) units = -8
+      ENDIF
+
+* Named calendar with unit=month gets length of month in that calendar.
+
+      IF (units .EQ. -5) THEN
+         IF (cal_id .EQ. d360) units = -14
+         IF (cal_id .EQ. julian) units = -15
+	 IF (cal_id .EQ. noleap) units = -13
+      ENDIF
+
+      line_unit_code(iaxis) = units
+      IF  ( units.EQ.0 .AND. line_units(iaxis) .NE. ' ' ) THEN
+         CALL TM_NOTE('Units on axis "'//vname(:vlen)//
+     .                '" are not recognized: '//line_units(iaxis), tt)
+         CALL TM_NOTE('They will not be convertible:', tt)
+      ENDIF
+      IF ( units .GE. 0 ) THEN
+         line_tunit(iaxis) = real4_init
+      ELSE
+         line_tunit(iaxis) = un_convert(line_unit_code(iaxis))
+      ENDIF
+
+* optional "modulo" flag (and optionally the associated length)
+      
+      rbuff = 0.
+
+*  **ACM** Note that under OSF (and PC? ) CD_GET_ATTVALC returns TRUE 
+*      when the value of the attribute is, say, "F".  Under Solaris and 
+*      Linux, returns FALSE  Reads a value from a character buffer if 
+*      the value of the modulo attribute is type character. For solaris, 
+*      linux, if the value of the attribue is non-numeric string, returns 
+*      false, and rbuff=0. For OSF, returns true and rbuff = 0 or -1.
+
+      line_modulo(iaxis) = CD_GET_ATTVALC( dset, ivar, 'modulo',
+     .                             do_warn, vname(:vlen), rbuff, 0.0 )
+      line_modulo_len(iaxis) = rbuff
+      IF (line_modulo_len(iaxis) .LT. 0.) line_modulo_len(iaxis) = 0.
+
+* See if there is a logical modulo attrib, with yes, true, false, etc.
+
+      got_mod = .FALSE.
+      mod_tf = .TRUE.
+
+      IF (.NOT. line_modulo(iaxis) .OR. 
+     .     line_modulo_len(iaxis) .LE. 0.) THEN
+         got_mod = CD_GET_ATTVAL_L( dset, ivar, 'modulo',
+     .                             do_warn, vname(:vlen),mod_tf)
+         IF (got_mod) line_modulo(iaxis) = mod_tf
+
+      ENDIF
+      setmodfalse = (.NOT.mod_tf  .AND. got_mod)
+
+* optional time_origin and time_unit values for time axis
+* (time origin could have been set by the units "... since time_origin")
+      maxlen = 20
+      IF (.NOT.got_torg) got_torg = NC_GET_ATTRIB( dset, ivar,
+     .          'time_origin', do_warn, vname(:vlen), maxlen, attlen, 
+     .          attoutflag, line_t0(iaxis), val)
+      IF ( .NOT.got_torg ) THEN
+         IF ( epic_time ) THEN
+            line_t0(iaxis) = '15-JAN-1901' ! arbitrary
+         ELSEIF (since_t0 .LT. 2) THEN
+            line_t0(iaxis) = char_init20
+         ENDIF
+      ENDIF
+
+* a user can impose non-standard time units by setting the time_unit attribute
+* (not fully tested, I suspect - *sh* 4/93)
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset,ivar,'time_unit',
+     .           do_warn, vname(:vlen), maxlen, attlen, attoutflag, 
+     .           buff, line_tunit(iaxis))
+
+*!      got_it = NC_GET_ATTRIB( dset,ivar,'month_lengths',do_warn,
+
+* if a time_origin was given then some units are required (4/93)
+* default to "seconds" if no units were specified
+      IF ( got_torg .AND. line_tunit(iaxis).EQ.real4_init ) THEN
+           line_units(iaxis) = 'seconds'
+           line_unit_code(iaxis) = TM_UNIT_ID( line_units(iaxis) )
+           line_tunit(iaxis) = un_convert(line_unit_code(iaxis))
+      ENDIF
+
+* Use attributes to try to determine the orientation and 
+* direction of the axis
+
+      buff = line_units(iaxis)
+      CALL CD_GET_LINE_DIRECTION (dset, ivar, iaxis, vname, 
+     .   line_units(iaxis), do_warn)
+
+* longitude axes may be encoded "west" (discontinuous at 180, East negative,
+* West positive) or "east" (standard - 0->360 east from Greenwhich)
+
+      got_it = NC_GET_ATTRIB( dset, ivar, 'positive', do_warn, 
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      IF ( got_it .AND. STR_CASE_BLIND_COMPARE('west',buff(:4))
+     .                  .EQ.str_eq) THEN
+            line_direction(iaxis) = 'WE'
+            west_lon = .TRUE.                        ! convert encodings below
+      ENDIF
+
+      west_lon = west_lon 
+     .  .OR.    ( line_direction(iaxis) .EQ. 'WE'
+     .      .AND. TM_HAS_STRING(buff,'west') )
+     .  .OR.    ( its_epic
+     .      .AND. (INDEX(vupcase, 'LON') .GT. 0)
+     .      .AND. .NOT.TM_HAS_STRING(buff,'east') )
+
+* was a regular time axis forced on us by the user?
+      IF (tregular) THEN
+        IF (line_direction(iaxis).EQ."TI" .OR.
+     .      line_direction(iaxis).EQ."TT" ) line_regular(iaxis) = .TRUE.
+        got_bnds = .FALSE.
+      ENDIF
+
+* get the axis coordinates - none, regular, or irregular
+      IF ( npts .EQ. 0 ) THEN
+* create a dummy one point axis
+         CALL TM_NOTE('Axis "'//vname(:vlen)//
+     .                '" has no coordinates', tt)
+         CALL TM_NOTE('A dummy value of 1 will be used', tt)
+         line_start  (iaxis) = 1.0D0
+         line_delta  (iaxis) = 1.0D0
+         line_subsc1 (iaxis) = unspecified_int4
+         line_regular(iaxis) = .TRUE.
+         line_dim    (iaxis) = 11
+         last_coord          = 1.0D0
+         firs_coord          = 1.0D0
+
+* start/n/delta representation for "regular axes"
+* (no check is made on validity of the regularity claim)
+* read the start and end - compute delta     
+      ELSEIF ( line_regular(iaxis) ) THEN
+         IF ( epic_time ) THEN
+            CALL CD_RD_EP_1( cdfid, ivar,  epic_t2var, line_t0(iaxis),
+     .                       line_tunit(iaxis), 1, 
+     .                       line_start(iaxis), status )
+            IF ( status .NE. merr_ok ) GOTO 1000        ! 3/99 soft error
+            CALL CD_RD_EP_1( cdfid, ivar,  epic_t2var, line_t0(iaxis),
+     .                       line_tunit(iaxis), npts_cdf, 
+     .                       line_delta(iaxis), status )
+         ELSEIF ( yyyymmdd_time ) THEN
+            CALL CD_RD_YMD_1( cdfid, ivar, line_t0(iaxis),
+     .                       line_tunit(iaxis), 1, 
+     .                       line_start(iaxis), status )
+            IF ( status .NE. merr_ok ) GOTO 1000        ! 3/99 soft error
+            CALL CD_RD_YMD_1( cdfid, ivar,  line_t0(iaxis),
+     .                       line_tunit(iaxis), npts_cdf, 
+     .                       line_delta(iaxis), status )
+         ELSE
+            CALL CD_RD_R8_1( cdfid, ivar,   1, vartype, vname(:vlen),
+     .                       line_start(iaxis), status )
+            IF ( status .NE. merr_ok ) GOTO 1000        ! 3/99 soft error
+            CALL CD_RD_R8_1( cdfid,ivar,npts_cdf,vartype,vname(:vlen),
+     .                       line_delta(iaxis), status )
+         ENDIF
+         IF ( status .NE. merr_ok ) GOTO 1000   ! 3/99 soft error
+	 IF (do_scale) THEN
+	    IF (scale_is_dp) THEN
+	       line_start(iaxis) = line_start(iaxis)*dscale + doffset
+	       line_delta(iaxis) = line_delta(iaxis)*dscale + doffset
+	    ELSE
+	       line_start(iaxis) = line_start(iaxis)*scale + offset
+	       line_delta(iaxis) = line_delta(iaxis)*scale + offset
+	    ENDIF
+	 ENDIF
+
+         IF ( west_lon ) THEN
+            line_start(iaxis) = TM_LONW2LONE( line_start(iaxis) ) 
+            line_delta(iaxis) = TM_LONW2LONE( line_delta(iaxis) ) 
+         ENDIF
+         IF ( npts .GT. 1 ) THEN
+* ... allow for reverse ordering of axis coordinates on regular-spaced axes
+*     (the variable line_delta actually contains line_end at this moment)
+            reversed(iaxis) = line_delta(iaxis) .LT. line_start(iaxis)
+            IF ( reversed(iaxis) ) THEN
+               tmp8 = line_delta(iaxis)
+               line_delta(iaxis) =
+     .           (line_start(iaxis)-line_delta(iaxis))/DBLE(npts-1)
+               line_start(iaxis) = tmp8
+            ELSE
+               line_delta(iaxis) =
+     .           (line_delta(iaxis)-line_start(iaxis))/DBLE(npts-1)
+            ENDIF
+         ELSE
+            reversed(iaxis) = .FALSE.
+            line_delta(iaxis) = 1
+         ENDIF
+         line_subsc1(iaxis) = unspecified_int4
+         last_coord = line_start(iaxis) + DBLE(npts-1)*line_delta(iaxis)
+         firs_coord = line_start(iaxis)
+
+
+* ============= START OF IRREGULAR AXIS PROCESSING ========================
+      ELSE 
+* adequate storage for the irregular coordinates and box edges ?
+* 2*npts + 1 for edges plus coordinate values.
+
+* First, just require npts amount of storage. Read the coords and 
+* test for regular spacing. If regular then we're good.  If not, then
+* check that there's enough to store the grid cell bounds.
+
+         line_start(iaxis) = unspecified_val8
+         line_delta(iaxis) = unspecified_val8
+         IF ((next_line_mem_pos+ npts+1).GT.maxlinestore) GOTO 5300
+
+* read the CDF coordinate values into double precision axis storage
+         ipt1 = next_line_mem_pos
+         ipte = ipt1 + npts - 1
+         IF ( epic_time ) THEN
+            CALL CD_RD_EP_ARR( cdfid, ivar, epic_t2var,
+     .                         line_t0(iaxis), line_tunit(iaxis),
+     .                         npts_cdf, line_mem(ipt1), status )
+         ELSEIF ( yyyymmdd_time ) THEN
+            CALL CD_RD_YMD_ARR( cdfid, ivar,
+     .                         line_t0(iaxis), line_tunit(iaxis),
+     .                         npts_cdf, line_mem(ipt1), status )
+         ELSE
+            CALL CD_RD_R8_ARR( cdfid, ivar, 1, npts_cdf, vartype,
+     .                         vname(:vlen), line_mem(ipt1), status )
+            IF (days_neg4713 .NE. 0.) THEN
+               DO 330 i = ipt1,ipte
+                  line_mem(i) = line_mem(i) - days_neg4713
+ 330           CONTINUE
+            ENDIF
+         ENDIF
+         IF ( status .NE. merr_ok ) GOTO 1000   ! 3/99 soft error
+	 
+	 IF (do_scale) THEN
+	    IF (scale_is_dp) THEN
+	       DO 334 i=ipt1,ipte
+ 334            line_mem(i) = line_mem(i)*dscale + doffset
+	    ELSE
+	       DO 336 i=ipt1,ipte
+ 336            line_mem(i) = line_mem(i)*scale + offset
+	    ENDIF
+	 ENDIF
+
+         IF ( west_lon ) THEN
+            DO 340 i=ipt1,ipte
+ 340        line_mem(i) = TM_LONW2LONE( line_mem(i) ) 
+         ENDIF
+
+* if the coordinates are decreasing-ordered then reverse them
+
+         IF (npts .GT. 1) THEN
+            first_delta = line_mem(ipt1+1) - line_mem(ipt1)
+            reversed(iaxis) = first_delta .LT. 0.0
+         ENDIF
+         IF ( reversed(iaxis) ) THEN
+            DO 345 i=ipt1,ipt1+npts/2-1
+               tmp8 = line_mem(i)
+               line_mem(i) = line_mem(ipte+ipt1-i)
+               line_mem(ipte+ipt1-i) = tmp8
+ 345        CONTINUE
+ 
+         ENDIF
+
+* If repeated values, apply micro-adjusting. 
+* Or report as a warning if the user requested /STRICT.
+
+         misordered = .FALSE.
+         DO 350 i=ipt1+1,ipte
+           IF (line_mem(i) .LT. line_mem(i-1) ) 
+     .	      misordered = .TRUE.
+	   IF (use_strict .AND. (line_mem(i) .LE. line_mem(i-1)) )
+     .	      misordered = .TRUE.
+
+* out of order axis coordinates.
+* If reversed above, remove that designation to 
+* just hand the user the original data
+
+	   IF (misordered) THEN
+              words(1) = TM_LEFINT(i-ipt1+1, istat)
+              CALL TM_NOTE(
+     .             'Coordinates out of order or missing on axis '//
+     .           vname(:vlen)//' at subscript '//words(1), tt)
+              CALL TM_NOTE(
+     .             'A dummy axis of subscripts will be used', tt)
+              reversed(iaxis) = .FALSE.
+              GOTO 1000
+           ENDIF
+  350   CONTINUE
+
+         misordered = .FALSE.
+
+         micro_adj = 1E-7 *
+     .		(line_mem(ipte) - line_mem(ipt1))
+
+* ... are there repeated values?
+         has_repeated = .FALSE.
+         DO 532 i1 = ipt1+1, ipte
+            IF (line_mem(i1-1) .EQ. line_mem(i1)) has_repeated = .TRUE.
+ 532     CONTINUE
+
+* ... make micro-adjustments if axis has repeated values (4/99)
+         IF ( has_repeated ) THEN
+            IF (micro_adj .EQ. 0.D0) THEN
+	       i1 = ipt1+1
+	       misordered = .TRUE.
+	       GOTO 540
+	    ENDIF
+
+            i0 = ipt1
+            DO 538  i1 = ipt1+1, ipte
+               IF  (line_mem(i1-1) .EQ. line_mem(i1)) THEN
+*    ... locate end of repeating block
+                  DO 534 i2 = i1, ipte
+                     IF (line_mem(i2) .GT. line_mem(i1)) GOTO 535
+ 534              CONTINUE
+                  i2 = ipte + 1    ! one beyond last value
+                  i0 = i1 - 2
+                  i3 = i2 - 1
+*    ... micro-adjust repeating values from i1 to i2-1
+ 535              CONTINUE
+
+                  IF (line_mem(i2) .GT. line_mem(i1)) THEN
+                     i0 = i1-1
+                     i3 = i2
+                  ENDIF
+
+* Check and readjust the size of micro_adj if too small
+                  madj = micro_adj
+                  IF (micro_adj*(i2-i1+1) .GT. 
+     .                line_mem(i3) - line_mem(i0) ) THEN
+                     madj = (line_mem(i3)-line_mem(i0))/(i2-i1+1)
+                     IF (madj .EQ. 0.D0)  THEN
+	                misordered = .TRUE.
+	                GOTO 540
+	             ENDIF
+                  ENDIF
+                  DO 536 i3 = i1, i2-1
+                     line_mem(i3) = line_mem(i3) + (i3-i1+1)* madj
+ 536              CONTINUE
+                  IF ( i2 .LT. ipte .AND. 
+     .		       (line_mem(i2-1) .GE. line_mem(i2)))  THEN
+	             misordered = .TRUE.
+	             GOTO 540
+                  ENDIF
+               ENDIF
+ 538        CONTINUE
+         ENDIF
+
+         IF ( has_repeated .AND. .NOT.misordered ) THEN
+            CALL TM_NOTE('Axis has repeated values -- micro-adjusting '//
+     .           vname(:vlen), tt)
+         ENDIF
+
+ 540	 IF (misordered) THEN
+	    words(1) = TM_LEFINT(i1-ipt1+1, istat)
+	    CALL TM_NOTE(
+     .           'unrepairable repeated axis coords on axis '//
+     .           vname(:vlen)//' at subscript '//words(1), tt)
+	    CALL TM_NOTE(
+     .           'A dummy axis of subscripts will be used', tt)
+	    GOTO 1000
+	 ENDIF
+
+* Check if axis is actually regularly spaced (though not flagged as "even")
+* Fix bug 1483; look at each delta rather than trying to compare with first delta.
+
+        IF (its_irregular) GOTO 380  ! If the file says its irreg, treat it at such
+
+* See if double-precision coordinates are regularly-spaced
+	epsilon = 0.
+	depsilon = 0.
+        IF (vartype .EQ. ncdouble) THEN
+           dlast_coord = line_mem(ipte)
+           dfirs_coord = line_mem(ipt1)
+           dfirst_delta = line_mem(ipt1+1) - line_mem(ipt1)
+           depsilon = depsilon_46 * 2.*(ABS(line_mem(ipte)) / first_delta )
+           depsilon = depsilon_46 * 2.*(ABS(line_mem(ipt1)) / first_delta )
+
+           DO 355 i=ipt1+2,ipte
+              ddelta = line_mem(i) - line_mem(i-1)
+              IF (.NOT. TM_DFPEQ_TOL(dfirst_delta, ddelta, depsilon) ) GOTO 380
+  355      CONTINUE
+
+* See if single-precision (or integer??) coordinates are regularly-spaced
+        ELSE
+           last_coord = line_mem(ipte)
+           firs_coord = line_mem(ipt1)
+           first_delta = line_mem(ipt1+1) - line_mem(ipt1)
+           epsilon = epsilon_23 * 2.*(ABS(line_mem(ipte)) / first_delta )
+           epsilon = epsilon_23 * 2.*(ABS(line_mem(ipt1)) / first_delta )
+
+           DO 360 i=ipt1+2,ipte
+              delta = line_mem(i) - line_mem(i-1)
+              IF (.NOT. TM_FPEQ_EPS(epsilon, first_delta, delta) ) GOTO 380
+  360      CONTINUE
+        ENDIF
+
+* yes, it's actually regular - save it as such
+        line_regular(iaxis) = .TRUE.
+        line_start  (iaxis) = line_mem(ipt1)
+        line_delta  (iaxis) = 
+     .              (line_mem(ipte)-line_mem(ipt1))/DBLE(npts-1)
+        line_subsc1 (iaxis) = unspecified_int4
+        last_coord = line_start(iaxis) + DBLE(npts-1)*line_delta(iaxis)
+        firs_coord = line_start(iaxis)
+
+        GOTO 390
+
+* Compute the default locations of boundaries between grid boxes (midpoints)
+* Note: this may be modified by a subsequent "EDGES" or "BOUNDS" definition
+
+* Here is where we need to require 2*npts amount of available coordinate storage.
+
+ 380    CONTINUE
+        IF ((next_line_mem_pos+2*npts+1).GT.maxlinestore) GOTO 5300
+ 
+        CALL TM_IRREGAX_MID( ipt1, npts )
+      ENDIF
+
+      IF (got_bnds .AND. npts .EQ. 1) THEN
+         line_regular(iaxis) = .FALSE.
+         ipt1 = next_line_mem_pos
+         ipte = next_line_mem_pos
+         line_mem(ipt1) = line_start(iaxis)
+      ENDIF
+
+* ============= END OF IRREGULAR AXIS PROCESSING ========================
+
+
+ 390  CONTINUE
+
+* Notify user of reversal
+* Dont issue the note if west_lon. 
+
+      IF ( reversed(iaxis) .AND. (.NOT.west_lon)) THEN
+         CALL TM_NOTE('Axis coordinates are decreasing-ordered. '//
+     .         'Reversing ordering for axis '//vname(:vlen), tt)
+      ENDIF
+
+* hack to cope with Gregorian/Julian calendar ambiguities (used by NOAA/CDC)
+* Comments from Roland Schweitzer about CDC files:
+* These CDCfiles have units of the form: days since 1-1-1 00:00:00 or
+* hours since 1-1-1 00:00:00.  Any of these files that encode dates
+* after 1590 will look to Ferret as if they are offset by 2 days.  The 
+* CDC axes shift around the time axis at various historical breaks as the
+* UDUNITS package does. Ferret uses a proleptic Gregorian calendar - same
+* for all time without these shifts. (Ferret uses udunits for units 
+* definitions only.) Also note there are CDC files which decode to 
+* fall entirely within year 0001.  These files represent a climatology,
+* and Ferret deals with them correctly.
+
+      IF ( (since_T0.GT.2)
+     .  .AND.(line_t0(iaxis).EQ.'01-JAN-0001 00:00:00') 
+     .  .AND.(cal_id .EQ. GREGORIAN) ) THEN
+
+* ... get time step of L=1
+           IF ( line_regular(iaxis) ) THEN
+              first = line_start(iaxis)   
+           ELSE
+              first = line_mem(ipt1)
+           ENDIF
+
+* ... compute seconds from 1-jan-0001
+           secs2firststep = un_convert(line_unit_code(iaxis)) * first
+* compute seconds from 1590
+           secs1590 = TM_SECS_FROM_BC (GREGORIAN, 1590,1,1,0,0,0,status)
+            IF ( status .NE. merr_ok ) GOTO 5900
+
+* ... correct axis if crosses 1590 threshhold
+           IF (secs2firststep .GT. secs1590) THEN
+              line_t0(iaxis) = '30-DEC-0000 00:00:00'
+              line_shift_origin(iaxis) = .TRUE.
+           ENDIF
+        ENDIF
+
+*  See if there are box edges or bounds in the file.
+
+****************************************************************************
+*                              BOX EDGES                                   *
+****************************************************************************
+
+* the attribute "edges=name" may point to a list of box boundaries
+      IF ( .NOT.got_edges ) GOTO 500
+      IF ( line_regular(iaxis) ) THEN
+         CALL TM_NOTE(
+     .           'Evenly spaced axis has edges definition: '//
+     .           vname(:vlen)//' - ignored', tt )
+         GOTO 500
+      ENDIF
+
+* Cannot have both "edges" and "bounds" atrtributes
+      IF ( got_bnds )THEN
+         CALL TM_NOTE(
+     .     'Axis has both edges and bounds attributes: '//
+     .      vname(:vlen)//' - edges definition ignored', tt )
+         GOTO 500
+      ENDIF
+
+      CALL TM_CHECK_EDGES_ATTRIB (cdfid, iaxis, vname, vlen, ename, 
+     .        edgid, status)
+
+      IF (status .EQ. pcdferr) GO TO 5100
+      IF (status .NE. merr_ok) THEN
+         CALL TM_IRREGAX_MID( next_line_mem_pos,
+     .                          line_dim   (iaxis) )
+         GO TO 600
+      ENDIF
+
+* read the (npts+1) box edge values into double precision storage
+
+        ipt1 = next_line_mem_pos
+        line_subsc1(iaxis) = next_line_mem_pos
+        CALL CD_RD_R8_ARR( cdfid, edgid, 1, npts+1, vartype,
+     .                     vname(:vlen), line_mem(ipt1+npts), status )
+        IF ( status .NE. merr_ok ) GOTO 1000    ! 3/99 soft error
+
+* if the coordinates were reversed then the box edges must be, too
+         IF ( reversed(iaxis) .AND.  npts .GT. 1) THEN
+	    itop = (ipt1+npts)+npts/2-1
+	    irev = ipt1 + 2*npts
+            DO 450 i=ipt1+npts,itop
+               tmp8 = line_mem(i)
+	       line_mem(i) = line_mem(irev)
+	       line_mem(irev) = tmp8
+	       irev = irev - 1
+ 450        CONTINUE
+
+         ENDIF
+
+* check to see that each data point is contained inside its box
+        IF (.NOT.TM_CHECK_BOX_LOC(iaxis)) THEN
+           CALL TM_NOTE('Error in Edges "'//ename(:elen)//
+     .         '"or edges do not enclose point on axis '//
+     .         vname(:vlen), tt)
+           CALL TM_NOTE('Substituting coordinate midpoints', tt)
+           CALL TM_IRREGAX_MID( next_line_mem_pos,
+     .                          line_dim   (iaxis) )
+           bad_bndsid = edgid
+        ENDIF
+
+****************************************************************************
+*                              BOX BOUNDS                                  *
+****************************************************************************
+
+* the attribute "bounds=name" may point to a list of box boundaries
+
+500     maxlen = 128
+        IF ( .NOT.got_bnds ) GOTO 600
+
+* Check the bounds variable, issue any warnings.
+        CALL TM_CHECK_BNDS_ATTRIB (dset, iaxis, vname, vlen, bname,
+     .                             bndid, status)
+        IF (status .EQ. pcdferr) GO TO 5100
+        IF (status .NE. merr_ok) THEN
+           IF (npts .EQ. 1) THEN  ! save as a regular axis, no bounds.
+              line_regular(iaxis) = .TRUE.
+              line_start  (iaxis) = line_mem(ipt1)
+              line_delta(iaxis) = 1
+              line_subsc1 (iaxis) = unspecified_int4
+              last_coord = line_start(iaxis) 
+              firs_coord = line_start(iaxis)
+           ENDIF
+              ! If npts not 1 then we have already set the boundaries
+              ! at statement 380  CALL TM_IRREGAX_MID( ipt1, npts )
+           GO TO 600
+        ENDIF
+
+* read the (npts*2) box edge values into double precision storage 
+
+        line_subsc1(iaxis) = next_line_mem_pos
+        ipt1 = next_line_mem_pos
+        startpts(1) = 1
+        startpts(2) = 1
+        numpts(1) = 2
+        numpts(2) = npts
+
+        d1s = startpts(1)
+        d1e = numpts(1)
+        d2s = startpts(2)
+        d2e = numpts(2)
+
+        blen = TM_LENSTR1(bname)
+        CALL CD_RD_R8_BNDS( cdfid, bndid, startpts, numpts, vartype, 
+     .                    bname(:blen), line_mem(ipt1+npts),  
+     .                    d1s, d1e, d2s, d2e, status )
+        IF ( status .NE. merr_ok ) GOTO 1000    ! 3/99 soft error
+
+* if the coordinates were reversed then the box bounds must be, too 
+        IF ( first_delta .LT. 0.0  .AND.  npts .GT. 1) THEN
+	   itop = (ipt1+npts)+npts
+	   irev = (ipt1+npts)+2*npts-1
+           DO 550 i=ipt1+npts,itop
+               tmp8 = line_mem(i)
+	       line_mem(i) = line_mem(irev)
+	       line_mem(irev) = tmp8
+	       irev = irev - 1
+ 550       CONTINUE
+        ENDIF
+
+* check to see that each data point is contained inside its box,
+* and if the bounds are contiguous, warning user if not. Change
+* the storage from N*2 bounds to N+1 edges.    
+
+        IF (.NOT. TM_CHECK_BNDS(iaxis, 2*npts, vname) ) THEN  
+
+           CALL TM_NOTE('Error in bounds "'//bname(:blen)//
+     .         '" or bounds do not enclose point on axis '//
+     .         vname(:vlen), tt)
+           CALL TM_NOTE('Substituting coordinate midpoints', tt)
+           CALL TM_IRREGAX_MID( next_line_mem_pos,
+     .                          line_dim   (iaxis) )
+           bad_bndsid = bndid
+      
+        ENDIF
+
+* For axes specified with BOUNDS, check whether coordinates are also 
+* centered in the boxes, and whether the size of the boxes are equal.
+* If there is one point, use upper and lower bound as given in the file 
+* to determine line_delta.
+
+        IF (TM_CHECK_BNDS_CENTERED(iaxis)) THEN
+* It's actually regular - save it as such
+           IF (.NOT. line_regular(iaxis)) THEN
+              line_regular(iaxis) = .TRUE.
+              line_start  (iaxis) = line_mem(ipt1)
+              IF (npts .GT. 1) THEN
+                 line_delta  (iaxis) = 
+     .               (line_mem(ipte)-line_mem(ipt1))/DBLE(npts-1)
+              ELSE
+	         ibx1 = ipt1 + npts
+                 line_delta(iaxis) = line_mem(ibx1+1)-line_mem(ibx1)
+              ENDIF
+              line_subsc1 (iaxis) = unspecified_int4
+              last_coord = line_start(iaxis) + 
+     .               DBLE(npts-1)*line_delta(iaxis)
+              firs_coord = line_start(iaxis)
+           ENDIF
+        ELSE
+           line_regular(iaxis) = .FALSE.
+        ENDIF
+
+ 600    CONTINUE
+
+* Save the axis name (upper case) and memory storage.  For all irregular axes, 
+* we have saved N+1 edges for the axis cells. Increment the pointer.   
+
+        line_name(iaxis) = vupcase
+        line_name_orig(iaxis) = vname
+        IF ( .NOT.line_regular(iaxis) ) THEN
+           line_subsc1(iaxis) = next_line_mem_pos
+           next_line_mem_pos =  next_line_storage + 2*npts+1 
+        ENDIF
+
+* if it is a longitude axis of 360 degrees or less let it default to MODULO
+* unless user has set it explicitly to false.
+        
+ 400    axwwlen = 0.
+        axwwlen = TM_WW_AXLEN(iaxis)
+
+        IF ( line_direction(iaxis).EQ.'WE'
+     .       .AND. units.EQ.4
+     .       .AND. (.NOT.setmodfalse)
+     .       .AND. npts.GT.1 ) THEN
+
+           r4delta = axwwlen ! single precision
+           delta = r4delta
+           IF (TM_FPEQ(delta, 360.0) .OR. delta .LT. 360.0) THEN
+              line_modulo(iaxis) = .TRUE.
+              IF (line_modulo_len(iaxis).EQ.0.0D0)
+     .                    line_modulo_len(iaxis) = 360.D0
+           ENDIF
+
+	   IF (vartype.NE.ncdouble .AND. .NOT.line_modulo(iaxis) .AND. epsilon.NE.0.) THEN	      
+              IF (TM_FPEQ_EPS(epsilon, delta, 360.0) .OR. delta.LT.360.0) THEN
+                 line_modulo(iaxis) = .TRUE.
+                 IF (line_modulo_len(iaxis).EQ.0.0D0)
+     .                    line_modulo_len(iaxis) = 360.D0
+              ENDIF
+           ENDIF
+
+        ENDIF
+
+* if it is a calendar time axis and the first point is in year 0000 or 0001
+* then it is implicitly MODULO
+
+        IF (got_torg) THEN
+           IF (line_direction(iaxis)(1:1).EQ.'T') line_direction(iaxis) = 'TI'
+           IF (line_direction(iaxis)(1:1).EQ.'F') line_direction(iaxis) = 'FI'
+c           secsperyear = cals_yeardays(cal_id)* 24*60*60
+           tmp8 = cals_yeardays(cal_id)
+           secsperyear = tmp8 * (24.D0*60.D0*60.D0)
+
+           CALL TM_BREAK_DATE(line_t0(iaxis), cal_id, year, month, day,
+     .                       hour, minute, second, istat)
+           t0_secs = TM_SECS_FROM_BC (cal_id, year, month, day,
+     .                               hour, minute, second, status)
+           CALL TM_WW_AX_1_N(iaxis, first, tmp8)
+ 	   secs2start = t0_secs + first*line_tunit(iaxis)
+           IF ( (secs2start .LE.  2*secsperyear)
+     .	    .AND. (axwwlen*line_tunit(iaxis) .LE. secsperyear) ) THEN
+              line_modulo(iaxis) = .TRUE.
+              IF (line_modulo_len(iaxis).EQ.0.0D0)
+     .          line_modulo_len(iaxis) = secsperyear/line_tunit(iaxis)
+           ENDIF
+        ENDIF
+
+* sanity check the modulo length
+* a whisker too small is assumed a precision error
+* a whisker larger is assumed to be deliberate
+* ACM 1/08 
+* If a whisker too large, this may be a precision error 
+* In particular this happens converting single float coordinates to
+* double coordinate storage. If coords are single precision do the 
+* check in single precision.
+
+        IF (line_modulo(iaxis).AND.line_modulo_len(iaxis).NE.0.D0) THEN
+           IF (line_modulo_len(iaxis) .LT. axwwlen) THEN
+c             line_modulo_len(iaxis) = 0.0D0
+             IF (vartype .EQ. ncdouble) THEN
+                ok = TM_DFPEQ(axwwlen, line_modulo_len(iaxis)) 
+             ELSE
+	        lm_len = line_modulo_len(iaxis)
+                delta = axwwlen ! single precision
+		IF (vartype.NE.ncdouble) delta = r4delta
+                ok = TM_FPEQ(delta, lm_len)
+             ENDIF
+             IF (.NOT.  ok)
+     .          CALL TM_NOTE(
+     .          'Ignored modulo length exceeding axis length: '
+     .          //vname(:vlen), tt )
+           ENDIF
+        ENDIF
+
+* Save the line direction in the linked-list structure for the coordinate variable
+
+         dir = 0
+         dcode = line_direction(iaxis)
+         IF (dcode .EQ. 'XX' .OR. dcode .EQ. 'WE') dir = 1
+         IF (dcode .EQ. 'YY' .OR. dcode .EQ. 'SN') dir = 2
+         IF (dcode .EQ. 'ZZ' .OR. dcode .EQ. 'UD' .OR. dcode .EQ. 'DU') dir = 3
+         IF (dcode .EQ. 'TT' .OR. dcode .EQ. 'TI') dir = 4
+         IF (dcode .EQ. 'EE') dir = 5
+         IF (dcode .EQ. 'FF' .OR. dcode .EQ. 'FI') dir = 6
+         CALL CD_SET_ATT_AXDIR (dset, ivar, dir, status)
+
+* successful completion
+        status = merr_ok
+        RETURN
+
+* 3/99-style "soft" error - invalid axis but CDF file need not be rejected
+ 1000   CALL TM_DEALLO_DYN_LINE(iaxis)
+
+        iaxis = 0
+        status = merr_ok
+        RETURN
+
+* error messages
+ 5000   CALL TM_NOTE( 'netCDF parent axis definition error', tt )
+        IF ( soft_err .EQ. 1 ) THEN
+           CALL TM_NOTE(
+     .    '"true_size" attribute must have only max/min axis coords: '
+     .       //vname(:vlen), tt )
+        ELSEIF ( soft_err .EQ. 11 ) THEN
+           CALL TM_NOTE('Edges definition "'//ename(:elen)//
+     .                   '" points to no existing axis', tt )
+        ELSEIF ( soft_err .EQ. 12 ) THEN
+           CALL TM_NOTE('Edges definition "'//ename(:elen)//
+     .                   '" is not 1D', tt )
+        ELSEIF ( soft_err .EQ. 13 ) THEN
+           CALL TM_NOTE('Edges "'//ename(:elen)//
+     .          '" must be 1 pt longer than '//vname(:vlen), tt )
+        ENDIF
+        IF ( soft_err .LE. 10 ) THEN
+           CALL TM_NOTE( 'Axis definition ignored', tt )
+        ELSE
+           CALL TM_NOTE( 'Edge definitions ignored', tt )
+        ENDIF
+        GOTO 400
+
+ 5100   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_GET_1_AXIS', cdfid, ivar,
+     .       no_errstring, no_errstring, *5900 )
+
+ 5300   CALL TM_ERRMSG (merr_linstorlim, status, 'CD_GET_1_AXIS',
+     .                  no_descfile, no_stepfile,
+     .                  'MAX='//TM_STRING(DBLE(maxlinestore)),
+     .                  no_errstring, *1000)          ! 3/99 soft error
+
+
+ 5400   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_GET_1_AXIS', cdfid, ivar,
+     .       'Scale and offset attributes not of the same type', 
+     .       no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+        END
diff --git a/fmt/src/cd_get_1_dep_var.F b/fmt/src/cd_get_1_dep_var.F
new file mode 100644
index 0000000..87c23fe
--- /dev/null
+++ b/fmt/src/cd_get_1_dep_var.F
@@ -0,0 +1,403 @@
+	SUBROUTINE CD_GET_1_DEP_VAR ( dset, cdfid, ivcd, las_pos, global_bad, 
+     .				      ivtm, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Loads common blocks XDSET_INFO and XSTEP_FILES with vital system and
+* background information for a single dependent variable from a netCDF file
+* It processes FERRET special attributes without regard to whether variables
+* are "generic" or "FERRET"
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500 3/99 *sh* -- new with code extracted from cd_scan_vars.F
+*      4/99 *kob*: increase size of vname from 24 to 64 chars
+* V533 6/01 *sh* -- set the variables data type
+* V542 11/02*acm*  For 4-D string NetCDF files, allow nvdim to be 5 when
+*                  code checks for "Unsupported netCDF # of axes".
+* V552 5/03 *acm*: increase size of vname from 64 to 128 chars
+* V600 *ACM* attribute control. 
+*             Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from 
+*               linked list structure
+*             CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*               strings or real values according to attrib type
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V600  6/06 *acm*   CD_GET_VAR_ATT_INFO uses varid and attid rather than attname.
+* V62   2/09 *acm* - allow for string-type missing and fill attributes to be read.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V663 *acm* 7/10  If neither missing_flag nor _FillValue attribute, use NaN.
+*                  but set an output attribute containing the Ferret default.
+* v67   2/11 *acm* Do the notes about no missing/fillvalue for each variable,
+*             when in diagnostic mode. So move that back to cd_get_1_dep_var.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*	cdfid   - id of currently open CDF file
+*	ivcd	- variable id in netCDF file
+*	las_pos  - TMAP variable pointer for last variable stored (for optimization, only - "1" OK) 
+*	global_bad - a global bad value flag for all vars in dada set
+
+*	ivtm	- returned TMAP variable pointer for the new variable (0 if unsuccessful)
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, cdfid, ivcd, las_pos, ivtm, status
+	REAL	      global_bad
+
+* include files
+
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+        include 'xio.cmn_text'
+        external xio_data
+	include 'xdiag_ctrl.cmn_text'
+	external xdiag_ctrl_data
+
+      LOGICAL NC_GET_ATTRIB_FLOAT, NC_GET_ATTRIB_STRING, 
+     .        NC_GET_ATTRIB, CD_GET_BOUNDS,
+     .        got_it, got_bad, got_missing, tf2,
+     .        do_warn, coordvar
+      PARAMETER (do_warn = .TRUE. )
+      INTEGER TM_LENSTR1, TM_FERRET_VARTYPE, 
+     .        cdfstat, idim,
+     .        vartyp, nvdim, vdims(8), nvatts, vlen,
+     .        recdim, istat, lasdim, attype, attlen, attoutflag, 
+     .        maxlen, all_outflag, attid
+      REAL    val
+* 4/99 *kob* increase size of vname
+      CHARACTER    vname*128, aname*128, buff*128
+      CHARACTER*13 TM_STRING
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+
+* special equivalence (cannot include in tmap_format/xdset_info.cd_equiv because "BYTE"
+* isn't supported on DECstation
+* reorder loop logic because linux cpp didn't like it *kob* 10/96
+
+
+#ifdef NEED_BYTE
+      BYTE cd_data_type(maxvars)
+#else
+      INTEGER*1 cd_data_type(maxvars)
+#endif
+
+
+      EQUIVALENCE ( ds_precision, cd_data_type )
+
+* get the vital statistics for this variable
+
+           CALL CD_GET_VAR_INFO(dset, ivcd, vname, vartyp, 
+     .                 nvdim, vdims, nvatts, coordvar, 
+     .                 all_outflag, status)
+           IF ( status .NE. merr_ok ) GOTO 5200
+           vlen = TM_LENSTR1(vname)
+
+* find the next storage position in TMAP common
+	  DO 150 ivtm = las_pos,maxvars
+	    IF (ds_var_setnum(ivtm) .EQ. set_not_open) GOTO 151
+  150     CONTINUE
+* oops - no room left for new variables
+	  GOTO 5100
+
+* set obvious defaults for this variable
+ 151	  cd_varid(ivtm)        = ivcd ! netCDF variable ID
+          ds_var_setnum(ivtm  ) = dset
+          ds_var_title(ivtm)    = ' '
+          ds_var_titl_mod(ivtm) = ' '
+          ds_var_units(ivtm)    = ' '
+	  ds_missing_flag(ivtm)	= global_bad
+	  ds_bad_flag(ivtm)	= ds_missing_flag(ivtm)
+	  ds_precision(ivtm)	= 'SINGLE'
+          cd_scale_factor(ivtm) = 1.0
+          cd_add_offset(ivtm)   = 0.0
+          cd_scaled(ivtm)       = .FALSE.
+	  DO 160 idim = 1, nferdims
+             ds_grid_start(idim,ivtm)= unspecified_int4
+             ds_grid_end  (idim,ivtm)= unspecified_int4
+  	     ds_ordering(idim,ivtm)= unspecified_int4
+ 160      CONTINUE
+
+* is it a supported data type ?
+          cd_data_type(ivtm) = vartyp
+	  ds_var_type(ivtm) = TM_FERRET_VARTYPE(vartyp)  ! 6/01
+
+* is it a supported dimensionality ?
+          IF ( nvdim .GT. nferdims+1 ) THEN
+             CALL TM_NOTE('Unsupported netCDF # of axes for variable '
+     .             //vname(:vlen), tt )
+             GOTO 200
+          ENDIF
+
+C Can get chunking, deflate, etc. for vars in file.
+c#ifdef usingDODSf2cUnderscore 
+c           cdfstat = NF_INQ_FORMAT_(cdfid, cdfformat)
+c#else
+c           cdfstat = NF_INQ_FORMAT (cdfid, cdfformat) 
+c#endif
+c        IF (cdfformat .EQ. NF_FORMAT_NETCDF4) THEN
+c           cdfstat = NF_INQ_VAR_DEFLATE(cdfid, ivcd, shuffle,
+c     .                 deflate, deflate_level)
+c           cdfstat = NF_INQ_VAR_CHUNKING(cdfid, ivcd, contiguous, 
+c     .                 chunks)
+c        ENDIF
+
+* see what generic attributes can be read: long_name, units, missing_value
+* If no long_name, then see if this is an F-TDS url with a ferret_definition
+* attribute and use that for the title.
+
+          IF (nvatts .GT. 0) THEN
+             maxlen = 128
+             got_it = NC_GET_ATTRIB_STRING( dset, ivcd, 'long_name',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_title(ivtm))
+
+             IF (.NOT. got_it) THEN  !an F-TDS URL may have ferret_definition
+	        
+                got_it = NC_GET_ATTRIB_STRING( dset, ivcd, 
+     .                     'ferret_definition',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_title(ivtm))
+             ENDIF
+
+             maxlen = 128
+             got_it = NC_GET_ATTRIB_STRING( dset, ivcd, 'long_name_mod',
+     .                     .NOT.do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_titl_mod(ivtm))
+
+             maxlen = 64
+             got_it = NC_GET_ATTRIB_STRING( dset, ivcd, 'units',
+     .                     do_warn, vname(:vlen), maxlen, attlen, 
+     .                     attoutflag, ds_var_units(ivtm))
+
+             got_it = NC_GET_ATTRIB_FLOAT( dset, ivcd, 'scale_factor',
+     .                     do_warn, vname(:vlen), attlen, 
+     .                     attoutflag, cd_scale_factor(ivtm))
+
+             tf2    = NC_GET_ATTRIB_FLOAT( dset, ivcd, 'add_offset',
+     .                     do_warn, vname(:vlen), attlen, 
+     .                     attoutflag, cd_add_offset(ivtm))
+
+             cd_scaled(ivtm) = got_it .OR. tf2
+
+* netCDF files may use "standard" attributes missing_value and/or
+* _FillValue to flag bad data
+* For the NOAA COOP standard the missing_value flag must be stored in the
+* packed data type.  If so it must be unpacked.  (2/95)
+	     
+	     CALL CD_GET_VAR_ATT_ID (dset, ivcd, 'missing_value', 
+     .                  attid, istat)
+	     IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                 ivcd, attid, aname, attype, attlen, attoutflag, 
+     .                 istat)
+     
+             IF (attype .NE. NF_CHAR) THEN
+                got_bad = NC_GET_ATTRIB_FLOAT( dset, ivcd, 
+     .                'missing_value',
+     .                do_warn, vname(:vlen), attlen,
+     .                attoutflag, ds_bad_flag(ivtm))
+             ELSE
+  	        maxlen = 128
+                got_bad = NC_GET_ATTRIB( dset, ivcd, 'missing_value',
+     .                do_warn, vname(:vlen), maxlen, attlen,
+     .                attoutflag, buff,  ds_bad_flag(ivtm))
+             ENDIF
+
+
+	     
+	     CALL CD_GET_VAR_ATT_ID (dset, ivcd, '_FillValue', 
+     .                  attid, istat)
+	     IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                 ivcd, attid, aname, attype, attlen, attoutflag, 
+     .                 istat)
+     
+             IF (attype .NE. NF_CHAR) THEN
+                got_missing = NC_GET_ATTRIB_FLOAT( dset, ivcd, 
+     .                '_FillValue',
+     .                do_warn, vname(:vlen), attlen,
+     .                attoutflag, ds_missing_flag(ivtm))
+             ELSE
+  	        maxlen = 128
+                got_missing = NC_GET_ATTRIB( dset, ivcd, '_FillValue',
+     .                do_warn, vname(:vlen), maxlen, attlen,
+     .                attoutflag, buff,  ds_bad_flag(ivtm))
+             ENDIF
+
+* ... need to unpack the missing_value flag?
+*
+* The CF standard says: 
+* The missing values of a variable with scale_factor and/or add_offset 
+* attributes (see section Section 8.1, �Packed Data�) are interpreted 
+* relative to the variable's external values, i.e., the values stored 
+* in the netCDF file. Applications that process variables that have 
+* attributes to indicate both a transformation (via a scale and/or 
+* offset) and missing values should first check that a data value is 
+* valid, and then apply the transformation. Note that values that are 
+* identified as missing should not be transformed. 
+* This means that the missing_value and _FillValue are in packed-type,
+* and to test unpacked data against the bad value, they need to be unpacked.
+*
+*     (note that the netCDF library insists on _FillValue's data type)
+             IF ( vartyp.LE.NF_INT .AND. cd_scaled(ivtm) ) THEN
+                IF ( got_bad ) THEN
+                   CALL CD_GET_VAR_ATT_ID (dset, ivcd, 'missing_value', 
+     .                  attid, istat)
+                   IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                 ivcd, attid, aname, attype, attlen, attoutflag, 
+     .                 istat)
+	           IF ( attype .EQ. vartyp ) ds_bad_flag(ivtm) =
+     .			ds_bad_flag(ivtm)*cd_scale_factor(ivtm)
+     .			+ cd_add_offset(ivtm)
+	        ENDIF
+
+* ... *kob* Also need to see about unpacking _FillValue
+                IF ( got_missing ) THEN
+                   CALL CD_GET_VAR_ATT_ID (dset, ivcd, '_FillValue', 
+     .                  attid, istat)
+                   IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, 
+     .                  ivcd, attid, aname, attype, attlen, attoutflag, 
+     .                  istat )
+	           IF ( attype .EQ. vartyp ) ds_missing_flag(ivtm) =
+     .	   		ds_missing_flag(ivtm)*cd_scale_factor(ivtm)
+     .			+ cd_add_offset(ivtm)
+	        ENDIF
+             ENDIF
+             IF ( got_bad .AND. .NOT.got_missing )
+     .           ds_missing_flag(ivtm) =  ds_bad_flag(ivtm)
+             IF ( got_missing .AND. .NOT.got_bad )
+     .           ds_bad_flag(ivtm) =  ds_missing_flag(ivtm)
+	        
+* if neither missing flag nor _FillValue was defined, use NaN.
+             IF ( .NOT.got_missing .AND. .NOT.got_bad) THEN
+                CALL SET_NAN (ds_missing_flag(ivtm))
+		CALL SWITCH_NAN(ds_bad_flag(ivtm), ds_missing_flag(ivtm) )
+		IF (do_warn .AND. tmap_diag_on) CALL WARN(
+     .'No missing_value or _FillValue attribute. Using NaN for variable: ' 
+     . //vname(:vlen)) 
+
+             ENDIF
+
+*  *kob* call SWITCH_NAN to make sure if NaN exisits, its in ds_missing_flag
+	     CALL SWITCH_NAN(ds_bad_flag(ivtm), ds_missing_flag(ivtm))
+
+* see what special FERRET attributes can be read: axis ordering and
+* sub-hyperslab bounds
+             maxlen = nferdims
+             got_it = NC_GET_ATTRIB( dset, ivcd, 'axis_order',
+     .                do_warn, vname(:vlen), maxlen, attlen, 
+     .                attoutflag, buff, val)
+             lasdim = 0
+             IF (got_it) THEN
+                DO 170 idim = 1, nferdims
+                   IF ( buff(idim:idim) .EQ. ' ' ) THEN
+                     ds_ordering(idim,ivtm) = 0
+                     GOTO 170
+                  ELSEIF ( buff(idim:idim) .EQ. 'T' ) THEN
+                     ds_ordering(idim,ivtm) = 4
+                  ELSE
+                     ds_ordering(idim,ivtm) = ICHAR(buff(idim:idim))-87 ! XYZ->123
+                  ENDIF
+                  IF ( ds_ordering(idim,ivtm) .LT. 0
+     .            .OR. ds_ordering(idim,ivtm) .GT. nferdims ) THEN 
+                     CALL TM_NOTE(
+     .                     'Illegal netCDF "axis_order" for variable '
+     .                     //vname(:vlen), tt )
+		     GOTO 200
+                   ENDIF
+                   IF ( ds_ordering(idim,ivtm) .LE. lasdim ) THEN
+                      CALL TM_NOTE(
+     .                     '"axis_order" permutations not supported: '
+     .                        //vname(:vlen), tt )
+                      GOTO 200
+                   ENDIF
+                   lasdim = ds_ordering(idim,ivtm)
+ 170            CONTINUE
+             ENDIF
+
+* does this variable have a FERRET "parent grid" ?
+* if so check for explicit hyperslab limits
+             buff = ' '   ! problems from characters beyond 16
+             maxlen = 16 !gridnamlen
+             got_it = NC_GET_ATTRIB( dset, ivcd, 'parent_grid',
+     .                           do_warn, vname(:vlen), maxlen, attlen, 
+     .                           attoutflag, buff, val)
+             IF ( got_it ) THEN
+                got_it = CD_GET_BOUNDS(cdfid, ivcd, 
+     .                     ds_grid_start(1,ivtm), ds_grid_end(1,ivtm), 
+     .                     recdim, status )
+                IF ( status .NE. merr_ok ) GOTO 5900
+             ENDIF
+
+          ENDIF ! nvatts > 0
+
+* officially claim this variable slot
+* 7/98 - save in case-sensitive form at this point -- will check over later
+*        ds_var_code(ivtm) = vname
+         CALL string_array_modify(ds_var_code_head, ivtm, 
+     .                            vname, LEN(vname))
+
+* successful completion - variable cataloged
+ 1000	status = merr_ok
+	RETURN
+
+* no variable created
+ 200	ivtm = 0	! flag for no success
+	GOTO 1000
+
+* ERROR MESSAGES
+ 5100	CALL TM_ERRMSG ( merr_varlim, status, 'CD_GET_1_DEP_VAR',
+     .			 dset, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxvars)),
+     .			 no_errstring, *5900)
+
+ 5200   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_GET_1_DEP_VAR', cdfid,
+     .        no_varid, no_errstring, no_errstring, *5900 )
+
+* error exit
+ 5900	ivtm = 0
+	RETURN
+	END
diff --git a/fmt/src/cd_get_agg_dset_info.F b/fmt/src/cd_get_agg_dset_info.F
new file mode 100644
index 0000000..61e105f
--- /dev/null
+++ b/fmt/src/cd_get_agg_dset_info.F
@@ -0,0 +1,52 @@
+	SUBROUTINE CD_GET_AGG_DSET_INFO (agg_dset, nmemb, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V685 3/13 *acm* More functionality for DEFINE DATA/AGGREGATE
+*
+* Given aggregate datset, return number of member datasets.
+*
+* Argument declarations
+
+	INTEGER agg_dset, nmemb, status
+
+* Local variable declarations
+	INTEGER NCF_GET_AGG_COUNT
+
+	status = NCF_GET_AGG_COUNT( agg_dset, nmemb)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_get_agg_dset_member.F b/fmt/src/cd_get_agg_dset_member.F
new file mode 100644
index 0000000..890f9dd
--- /dev/null
+++ b/fmt/src/cd_get_agg_dset_member.F
@@ -0,0 +1,53 @@
+	SUBROUTINE CD_GET_AGG_DSET_MEMBER (agg_dset, imemb, membset, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V685 3/13 *acm* More functionality for DEFINE DATA/AGGREGATE
+*
+* Given aggregate datset and member number, return the Ferret dataset 
+* sequence number for that member
+*
+* Argument declarations
+
+	INTEGER agg_dset, imemb, membset, status
+
+* Local variable declarations
+	INTEGER NCF_GET_AGG_MEMBER
+
+	status = NCF_GET_AGG_MEMBER( agg_dset, imemb, membset)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_get_agg_var_info.F b/fmt/src/cd_get_agg_var_info.F
new file mode 100644
index 0000000..280d189
--- /dev/null
+++ b/fmt/src/cd_get_agg_var_info.F
@@ -0,0 +1,66 @@
+	SUBROUTINE CD_GET_AGG_VAR_INFO (agg_dset, vname, imemb,
+     .      vtype, mdset, igrid, iline, nv, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+*
+* Given aggregate datset, variable name in the set, aggregate sequence number,
+* return the Ferret datset id, grid number and variable type for the variable 
+* in that member set.
+*
+* for var in aggregate member-dataset:
+* for members of the aggregate, imemb (id= sequence number 1,2,3,...
+*   igrid    Ferret grid number
+*   iline    Ferret line number of aggregate dimension
+*   vtype    1=file-var, 3=user-var
+*   mdset    Ferret dataset number
+*   nv       sequence number in ds_var_code or uvar_name_code
+
+* Argument declarations
+
+	CHARACTER*(*) vname
+	INTEGER agg_dset, imemb, vtype, mdset, igrid, iline, nv, status
+
+* Local variable declarations
+	INTEGER NCF_GET_AGG_VAR_INFO, varid
+
+	CALL CD_GET_VAR_ID (agg_dset, vname, varid, status)
+	status = NCF_GET_AGG_VAR_INFO( agg_dset, varid, imemb, vtype, 
+     .		mdset, igrid, iline, nv)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_get_attrib.F b/fmt/src/cd_get_attrib.F
new file mode 100644
index 0000000..6db5878
--- /dev/null
+++ b/fmt/src/cd_get_attrib.F
@@ -0,0 +1,157 @@
+	LOGICAL FUNCTION CD_GET_ATTRIB ( cdfid, varid, attrib,
+     .                                   do_warn, vname,
+     .                                   string, attlen, slen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get an attribute string from a netCDF file if the attribute exists and
+* is of the right data type
+* the netCDF file is assumed to be open
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+*              - 8/92: fixed garbled error message text
+* V420 - 11/95 *sh* - only issue warning if non-blanks are truncated
+*		    - increase reading buffer size to 256
+* V581 -  5/05 *acm - increase reading buffer size to 1024.  Newer netCDF 
+*                     libraries have apparently lifted the restriction.
+*                     This lets us increase the size of e.g. the title attribute.
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V62  6/08 *acm* Increase reading buffer size to 2048 and check the status flag when
+*            reading the attribute values.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*                - warnings are never issued if attribute doesn't exits
+*       vname    - name of variable owning attribute (used in error msgs)
+*       string   - array into which to return result
+*       attlen   - returned length of return string
+*       slen     - maximum allowable return string
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    cdfid, varid, attlen, slen
+      CHARACTER*(*) attrib, vname, string
+
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+      LOGICAL too_long
+      INTEGER TM_LENSTR1, lena, lenb, attype, cdfstat, i
+      CHARACTER*2048 buff
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* initialize
+       string(:slen) = ' '
+       too_long = .FALSE.
+
+* inquire about the attribute by name
+! 11/95 note:  NCAINQ appears not to return a meaningful attlen -- always 256
+      lena = TM_LENSTR1( attrib )
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_ATT_(cdfid, varid, attrib(:lena), attype, attlen )
+#else
+      cdfstat = NF_INQ_ATT (cdfid, varid, attrib(:lena), attype, attlen )
+#endif
+      IF ( cdfstat .NE. NF_NOERR ) THEN
+         attlen = 0
+         CD_GET_ATTRIB = .FALSE.
+         RETURN  ! doesn't exist
+      ENDIF
+
+      IF ( attype.NE.NF_CHAR .AND. attype.NE.NF_BYTE ) THEN
+         buff = 'attribute must be a string'
+         CD_GET_ATTRIB = .FALSE.
+         GOTO 5000
+      ELSE
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_GET_ATT_TEXT_(cdfid, varid, attrib, buff)
+#else
+         cdfstat = NF_GET_ATT_TEXT (cdfid, varid, attrib, buff)
+#endif
+	 IF (cdfstat .NE. NF_NOERR ) THEN
+            CD_GET_ATTRIB = .FALSE.
+            GOTO 5000
+         ELSE
+* ... f77 vs c bug:
+* ... replace trailing nulls with blanks for FORTRAN strings
+            DO 100 i = attlen, 1, -1
+               IF ( ICHAR(buff(i:i)) .EQ. 0 ) THEN
+               buff(i:i) = ' '
+               ENDIF
+ 100        CONTINUE
+            CD_GET_ATTRIB = .TRUE.
+            string = buff
+            IF ( TM_LENSTR1(buff(:attlen)) .GT. slen ) THEN
+               too_long = .TRUE.
+               buff = 'attribute truncated'	! warning msg
+               GOTO 5000
+            ENDIF
+
+	 ENDIF
+      ENDIF
+
+      RETURN
+
+* warning exits
+ 5000 lenb = TM_LENSTR1( buff )
+      lena = TM_LENSTR1( attrib )
+      buff = buff(:lenb)//': "'//attrib(:lena)//
+     .             '" in netCDF variable: '//vname
+      lenb = TM_LENSTR1( buff )
+      IF ( do_warn ) CALL TM_NOTE( buff(:lenb), tt )
+      IF ( do_warn.AND.too_long ) WRITE (tt,'(1X,A,I4)')
+     .                              'Maximum characters: ',slen
+      RETURN
+
+      END
diff --git a/fmt/src/cd_get_attval.F b/fmt/src/cd_get_attval.F
new file mode 100644
index 0000000..354850d
--- /dev/null
+++ b/fmt/src/cd_get_attval.F
@@ -0,0 +1,193 @@
+	LOGICAL FUNCTION CD_GET_ATTVAL ( cdfid, varid, attrib,
+     .                                   do_warn, vname,
+     .                                   val, vlen, vback )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get numerical attributes from a netCDF file if the attribute exists
+* convert all attribute values to floating point
+* the netCDF file is assumed to be open
+* Note: this routine is "quick and dirty" - long arrays of non-float type
+*       or high double precision exponents may blow it up
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+*
+* 11/96 *kob*  - Linux Port
+*	       - had to add an real*4 buffer to the buff equivalence.  
+*		 Linux f77 complained aobut inconsistent datatypes
+*
+* 4/98  *kob*  - fix bug introduced by above.  Linux f90 compiler will not allow
+*                r8 buff to be passed to NCAGT, complaining of inconsistent 
+*                datatypes.  SO, r4buff is passed to NCAGT, but really only as the
+*                address pointer.  then, when the values are actually used, r8buff
+*                is the buffer from which they are read.  this allows dp attribute
+*                values to be used correctly.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*       vname    - name of variable owning attribute (used in error msgs)
+*       val      - array into which to return result
+*       vlen     - maximum allowable return array len
+*       vback    - number of elements in return array
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    cdfid, varid, vlen, vback
+      CHARACTER*(*) attrib, vname
+      REAL val(vlen)
+
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+#  ifdef sun
+      BYTE i1buff(132)
+#  else
+      INTEGER*1 i1buff(132)
+#  endif
+
+* internal variable declarations:
+      INTEGER TM_LENSTR1, lena, attype, cdfstat, i
+      CHARACTER*132 buff
+
+* equivalent buffer arrays for various data types
+      INTEGER*2 i2buff(64)
+      INTEGER*4 i4buff(32)
+      REAL*4 	r4buff(32)		!kob 11/96
+      REAL*8    r8buff(16)
+      EQUIVALENCE (buff,i1buff),
+     .            (buff,i2buff),
+     .            (buff,i4buff),
+     .            (buff,r4buff),	!kob 11/96
+     .            (buff,r8buff)
+
+* inquire about the attribute by name
+      lena = TM_LENSTR1( attrib )
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_ATT_(cdfid, varid, attrib(:lena), attype, vback )
+#else
+      cdfstat = NF_INQ_ATT (cdfid, varid, attrib(:lena), attype, vback )
+#endif
+      IF ( cdfstat .EQ. NF_NOERR ) THEN
+         IF ( vback .GT. vlen ) THEN
+            buff = 'too many values in attribute "'//attrib(:lena)//
+     .             '" in netCDF file variable: '//vname
+            lena = TM_LENSTR1( buff )
+            IF ( do_warn ) CALL TM_NOTE( buff(:lena), lunit_errors )
+            CD_GET_ATTVAL = .FALSE.
+         ELSEIF (attype.EQ.NF_FLOAT) THEN
+#ifdef usingDODSf2cUnderscore
+	    cdfstat = NF_GET_ATT_REAL_(cdfid, varid, attrib, r4buff)
+#else
+	    cdfstat = NF_GET_ATT_REAL (cdfid, varid, attrib, r4buff)
+#endif
+	    CD_GET_ATTVAL = .TRUE.
+         ELSEIF (attype.EQ.NF_DOUBLE) THEN
+#ifdef usingDODSf2cUnderscore
+	    cdfstat = NF_GET_ATT_DOUBLE_(cdfid, varid, attrib, r4buff)
+#else
+	    cdfstat = NF_GET_ATT_DOUBLE (cdfid, varid, attrib, r4buff)
+#endif
+            CD_GET_ATTVAL = .TRUE.
+         ELSEIF (attype.EQ.NF_INT1) THEN
+#ifdef usingDODSf2cUnderscore
+	    cdfstat = NF_GET_ATT_INT1_(cdfid, varid, attrib, r4buff)
+#else
+	    cdfstat = NF_GET_ATT_INT1 (cdfid, varid, attrib, r4buff)
+#endif
+            CD_GET_ATTVAL = .TRUE.
+         ELSEIF (attype.EQ.NF_INT2) THEN  ! SHORT same as INT2
+#ifdef usingDODSf2cUnderscore
+	    cdfstat = NF_GET_ATT_INT2_(cdfid, varid, attrib, r4buff)
+#else
+	    cdfstat = NF_GET_ATT_INT2 (cdfid, varid, attrib, r4buff)
+#endif
+            CD_GET_ATTVAL = .TRUE.
+         ELSEIF (attype.EQ.NF_INT) THEN  ! INT prev. also called LONG
+#ifdef usingDODSf2cUnderscore
+	    cdfstat = NF_GET_ATT_INT_(cdfid, varid, attrib, r4buff)
+#else
+	    cdfstat = NF_GET_ATT_INT (cdfid, varid, attrib, r4buff)
+#endif
+            CD_GET_ATTVAL = .TRUE.
+         ELSE
+            CD_GET_ATTVAL = .FALSE.
+            vback = 0
+	 ENDIF
+	 
+* convert data types
+         IF (CD_GET_ATTVAL) THEN
+            IF (attype.EQ.NF_BYTE .OR. attype.EQ.NF_CHAR ) THEN
+               DO 100 i = 1, vback
+ 100           val(i) = i1buff(i)
+            ELSEIF (attype.EQ.NF_INT2) THEN
+               DO 200 i = 1, vback
+ 200           val(i) = i2buff(i)
+            ELSEIF (attype.EQ.NF_INT ) THEN
+               DO 300 i = 1, vback
+ 300           val(i) = i4buff(i)
+            ELSEIF (attype.EQ.NF_FLOAT ) THEN
+               DO 400 i = 1, vback
+ 400           val(i) = r4buff(i)  
+            ELSE
+               DO 500 i = 1, vback
+ 500           val(i) = r8buff(i)  
+! 500           val(i) = r4buff(i)   ! kob 4/98
+            ENDIF
+	 ENDIF
+
+      ELSE
+         CD_GET_ATTVAL = .FALSE.
+         vback = 0
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_attval_l.F b/fmt/src/cd_get_attval_l.F
new file mode 100644
index 0000000..0f48f86
--- /dev/null
+++ b/fmt/src/cd_get_attval_l.F
@@ -0,0 +1,162 @@
+	LOGICAL FUNCTION CD_GET_ATTVAL_L ( dset, varid, attrib,
+     .                                     do_warn, vname, val )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This routine is like cd_attvalc except it checks for a yes-or-no result.
+* It can return only a single value, of type LOGICAL.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* 12/02  *acm*
+* V550 *acm* 1/03 - Check for value of attribute " ", return TRUE if so.
+* 
+* 1/03 - *kob* g77 port - need to use risc_buff and also local var 
+*                         tmp_buff for arbitrary  string concats 
+* V600 *ACM* attribute control. 
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+
+*             Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from 
+*               linked list structure
+*             CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*               strings or real values according to attrib type
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	dset	 - dataset number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*       vname    - name of variable owning attribute (used in error msgs)
+*       val      - logical result, if modulo = "T" or "NO", etc was set.
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid
+      CHARACTER*(*) attrib, vname
+      LOGICAL       val
+
+      include 'xio.cmn_text'
+      external xio_data
+      include 'netcdf.inc'
+      include 'xrisc_buff.cmn'         !1/03 *kob*
+      include 'tmap_errors.parm'
+
+* internal variable declarations:
+      LOGICAL NC_GET_ATTRIB
+      INTEGER TM_LENSTR1, lena, attype, attlen, attoutflag,
+     .        attid, status
+      REAL tmp
+      CHARACTER buff*132, upbuff*132, aname*128
+      CHARACTER tmp_buff*2048          !1/03 *kob*	
+
+* inquire about the attribute by name and id
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid,
+     .                  aname, attype, attlen, attoutflag, status )
+
+      lena = TM_LENSTR1( aname )
+
+      IF ( status .EQ. merr_ok ) THEN
+
+	IF (attype .EQ. NF_CHAR) THEN
+
+* get a text attribute
+
+	   CD_GET_ATTVAL_L = NC_GET_ATTRIB(dset, varid, aname(:lena),
+     .                            do_warn, vname, 132, attlen,
+     .                            attoutflag, buff, tmp)
+
+	   IF (.NOT.CD_GET_ATTVAL_L) THEN
+	     RETURN
+
+	   ELSE
+
+             CALL STR_UPCASE (upbuff, buff)	     
+
+             IF ( upbuff .EQ. 'Y' .OR. upbuff .EQ. 'YES' .OR.
+     .            upbuff .EQ. 'T' .OR. upbuff .EQ. 'TRUE' .OR.
+     .            upbuff .EQ. 'ON' .OR. upbuff .EQ. ' ') THEN
+	       CD_GET_ATTVAL_L = .TRUE.
+               val = .TRUE.
+
+             ELSE IF ( upbuff .EQ. 'N' .OR. upbuff .EQ. 'NO' .OR.
+     .                 upbuff .EQ. 'F' .OR. upbuff .EQ. 'FALSE'.OR.
+     .                 upbuff .EQ. 'OFF' ) THEN
+	       CD_GET_ATTVAL_L = .TRUE.
+               val = .FALSE.
+
+             ELSE
+               GOTO 5000
+
+             ENDIF
+           ENDIF
+
+	 ELSE  ! not a char type
+
+	   CD_GET_ATTVAL_L = .FALSE.
+	 ENDIF
+
+      ELSE ! no attribute found
+
+	 CD_GET_ATTVAL_L = .FALSE.
+      ENDIF
+
+      RETURN
+
+* error exit
+ 5000 CONTINUE
+ 
+* *kob* 1/03 - add risc_buff - needed for g77 port
+      IF (do_warn) THEN
+        lena = TM_LENSTR1( attrib )
+	risc_buff = attrib(:lena)
+	tmp_buff = vname
+	CALL WARN('Undecipherable value of netCDF attribute '//
+     .        risc_buff(:TM_LENSTR1(risc_buff))//' on variable '//
+     .        tmp_buff)
+        CALL WARN('modulo = "'//buff(:TM_LENSTR1(buff))//'"')
+
+      ENDIF
+
+      CD_GET_ATTVAL_L = .FALSE.
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_attvalc.F b/fmt/src/cd_get_attvalc.F
new file mode 100644
index 0000000..595d4c6
--- /dev/null
+++ b/fmt/src/cd_get_attvalc.F
@@ -0,0 +1,139 @@
+	LOGICAL FUNCTION CD_GET_ATTVALC ( dset, varid, attrib,
+     .                                    do_warn, vname,
+     .                                    val, blank_val )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This routine is like cd_attval except that it allows for the possibility
+* that the required numerical value is stored in a character attribute
+* and it can return only a single value
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* 2/02  *sh*
+* 1/03 **ACM** add this note: (no code changes)
+*      Note that under OSF (and PC? ) CD_GET_ATTVALC returns TRUE when 
+*      the value of the attribute contains a non-numeric string, say "F".  
+*      Under Solaris and Linux, returns FALSE. If the value of the modulo 
+*      attribute is type character, this function tries to read a numeric 
+*      value from a character buffer . For solaris, linux, this read:
+*
+*      	     READ (buff,*,ERR=5000) val  ! convert text to value
+*
+*      returns an error and goes to 5000 if the contents of buff is not  
+*      a number.  For OSF, reads anyway, returning -1 when the character 
+*      string is T, or 0 for all other characters. 
+* V600 *ACM* attribute control. 
+*             Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from linked list structure
+*             CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*               strings or real values according to attrib type
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	dset	 - dataset id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*       vname    - name of variable owning attribute (used in error msgs)
+*       val      - array into which to return result
+*       blank_val- if a blank character attribute, then return this default
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid
+      CHARACTER*(*) attrib, vname
+      REAL	    val, blank_val
+
+      include 'xio.parm'
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+* internal variable declarations:
+      LOGICAL NC_GET_ATTRIB
+      INTEGER attlen, attoutflag
+      INTEGER TM_LENSTR1, lena, attype, attid, status
+      REAL tmp
+      CHARACTER buff*132, aname*132
+
+* inquire about the attribute by name, getting its id number
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .                  aname, attype, attlen, attoutflag, status )
+      lena = TM_LENSTR1( aname )
+
+      IF ( status .EQ. merr_ok ) THEN
+	IF (attype .EQ. NF_CHAR) THEN
+* get a text attribute as a value
+
+	   CD_GET_ATTVALC = NC_GET_ATTRIB(dset,varid,aname(:lena),
+     .                            do_warn,vname,132, attlen,  
+     .                            attoutflag, buff, tmp )
+	   IF (.NOT.CD_GET_ATTVALC) THEN
+	     RETURN
+	   ELSEIF (buff .EQ. ' ') THEN
+	     val = blank_val
+	   ELSE
+	     READ (buff,*,ERR=5000) val  ! convert text to value
+	   ENDIF 
+	 ELSE
+* get a value attribute
+	   CD_GET_ATTVALC = NC_GET_ATTRIB(dset, varid, aname(:lena),
+     .                                    do_warn, vname, 1, attlen,
+     .                                    attoutflag,  buff, val )
+	 ENDIF
+      ELSE
+* didnt get nothin
+	 CD_GET_ATTVALC = .FALSE.
+      ENDIF
+
+      RETURN
+
+* error exit
+ 5000 CONTINUE
+c      IF (do_warn) THEN
+c       lena = TM_LENSTR1( aname )
+c	CALL TM_NOTE('Undecipherable value of netCDF attribute '//
+c     .		      attrib(:lena)//' on variable '//vname, lunit_errors)
+c	CALL TM_NOTE('"buff(:TM_LENSTR1(buff))"', lunit_errors)
+c      ENDIF
+      CD_GET_ATTVALC = .FALSE.
+      RETURN
+      END
diff --git a/fmt/src/cd_get_bounds.F b/fmt/src/cd_get_bounds.F
new file mode 100644
index 0000000..ab34786
--- /dev/null
+++ b/fmt/src/cd_get_bounds.F
@@ -0,0 +1,219 @@
+	LOGICAL FUNCTION CD_GET_BOUNDS ( cdfid, ivar, lo, hi, tmrecdim,
+     .                                   status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the bounds of the hyperslab of the given netCDF variable relative
+* to its parent grid in the TMAP Common
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*
+* 15apr94 *kob* Need to initialzie cd_get_bounds in case of error 
+*		exit
+*
+* 2jun94 *kob* cd_get_bounds needs to be initialazed with boolean .FALSE.
+* 		instead of 0.
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V500 4/99 *kob*: increase size of vname and buff from 24 to 64
+* V533 *sh* 6/01 - add support for string variables (NF_CHAR)
+* V500 4/99 *kob*: increase size of vname and buff from 24 to 64
+* V552 *acm* 5/03   increase vname and buff to 128 chars 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* TODO: initially leave this as 4D -- what to do with old files that have 4 slab min/max?
+
+* argument definitions:
+*	cdfid   - id of currently open CDF file
+*       ivar    - CDF variable ID of the desired variable
+*       lo      - array of (nferdims) lower bounds subscripts
+*       hi      - array of (nferdims) upper bounds subscripts
+*       tmrecdim- returned axis (1-nferdims) which is CDF record dimension (or 0)
+*       status  - returned TMAP status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include 'cd_lib.parm'
+        include 'xio.cmn_text'
+        external xio_data
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+
+* argument declarations:
+	INTEGER	 cdfid, ivar, lo(nferdims), hi(nferdims), tmrecdim, status
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      LOGICAL CD_GET_ATTVAL, got_lo, got_hi,
+     .        do_warn
+      PARAMETER (do_warn = .TRUE. )
+      INTEGER TM_LENSTR1,
+     .        ndims, nvars, cdfstat, vbacklo, vbackhi, idim,
+     .        vartyp, nvdim, vdims(8), nvatts, vlen,
+     .        ngatts, npts, recdim
+      REAL    r4_lo(nferdims), r4_hi(nferdims)
+      CHARACTER vname*128, buff*128
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* initialize
+        tmrecdim = 0   ! may be changed, below
+* ibm compiler didn't like initializing cd_get_bounds to 0, so *kob* 
+* changed it to .false.  2jun94
+	CD_GET_BOUNDS = .FALSE.     !in case of error exit
+* get the vital statistics for the CDF file
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_( cdfid, ndims, nvars, ngatts, recdim)
+#else
+        cdfstat = NF_INQ( cdfid, ndims, nvars, ngatts, recdim)
+#endif
+
+* if it is a character variable, then the first dimension of it is the strlen
+        IF (vartyp .EQ. NF_CHAR) THEN
+	   DO idim = 1, 5
+	      vdims(idim) = vdims(idim+1)
+	   ENDDO
+	   nvdim = nvdim - 1
+	ENDIF
+
+* get the vital statistics for this variable
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VAR_(cdfid, ivar, vname, vartyp, nvdim,
+     .              vdims, nvatts)
+#else
+        cdfstat = NF_INQ_VAR (cdfid, ivar, vname, vartyp, nvdim,
+     .              vdims, nvatts)
+#endif
+        vlen = TM_LENSTR1(vname)
+
+
+* get the lower bounds
+        got_lo = CD_GET_ATTVAL( cdfid, ivar, 'slab_min_index',
+     .           do_warn,vname(:vlen),r4_lo,nferdims,vbacklo )
+        IF ( got_lo ) THEN
+          DO 100 idim = 1, 4
+ 100      lo(idim) = r4_lo(idim) !fp->int
+	  IF (nferdims .GT. 4) THEN
+          DO 110 idim = 5, nferdims
+ 110         lo(idim) = unspecified_int4
+	  ENDIF
+        ENDIF
+
+* get the upper bounds
+        got_hi = CD_GET_ATTVAL( cdfid, ivar, 'slab_max_index',
+     .           do_warn,vname(:vlen),r4_hi, nferdims, vbackhi )
+
+        IF ( got_hi ) THEN
+          DO 200 idim = 1, 4
+ 200      hi(idim) = r4_hi(idim) !fp->int
+	  IF (nferdims .GT. 4) THEN
+             DO 220 idim = 5, nferdims
+ 220         hi(idim) = unspecified_int4
+	  ENDIF
+        ENDIF
+
+* check for consistency
+        IF ( got_lo .NEQV. got_hi ) GOTO 5200
+        IF ( got_lo .AND. (vbacklo.NE.4.OR.vbackhi.NE.4) ) GOTO 5300
+        IF ( .NOT.got_lo ) GOTO 1000
+        IF ( recdim .EQ. -1 ) GOTO 1000     ! no record axis in file ?
+
+* the record dimension of the variable may have a flag, only
+* if so substitute the full size of the record dimension
+        DO 300 idim = 1, 4
+           IF ( hi(idim) .EQ. pcdf_recdim ) THEN
+              IF ( tmrecdim .NE. 0 ) GOTO 5100
+              tmrecdim = idim
+           ENDIF
+ 300    CONTINUE
+        IF ( tmrecdim .NE. 0 ) THEN
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_INQ_DIM_( cdfid, recdim, buff, npts )
+#else
+	   cdfstat = NF_INQ_DIM( cdfid, recdim, buff, npts )
+#endif
+	   lo(tmrecdim) = 1
+           hi(tmrecdim) = npts
+        ENDIF
+
+* check for reasonable slab limits
+        DO 400 idim = 1, 4
+           IF ( idim .EQ. tmrecdim ) GOTO 400
+           IF ( lo(idim).LE.0 .OR. hi(idim).LE.0
+     .     .OR. lo(idim) .GT. hi(idim) )           GOTO 5400
+ 400    CONTINUE
+
+* successful completion
+ 1000   CD_GET_BOUNDS = got_lo
+        status = merr_ok
+        RETURN
+
+* error exits
+ 5100   CALL TM_ERRMSG(pcdferr+pcdferrmax,
+     .         status, 'CD_GET_BOUNDS', cdfid, ivar, 
+     .         'More than one record dimension in "slab_min_index": '
+     .         //vname(:vlen), no_errstring, *5000 )
+
+ 5200    CALL TM_ERRMSG(pcdferr+pcdferrmax,
+     .         status, 'CD_GET_BOUNDS', cdfid, ivar,
+     .         'Must give both min and max "slab_m**_index" values: '
+     .         //vname(:vlen),  no_errstring, *5000 )
+
+ 5300    CALL TM_ERRMSG(pcdferr+pcdferrmax,
+     .         status, 'CD_GET_BOUNDS', cdfid, ivar,
+     .         'Must be exactly 4 "slab_m**_index" values: '
+     .         //vname(:vlen),  no_errstring, *5000 )
+
+ 5400    CALL TM_ERRMSG(pcdferr+pcdferrmax,
+     .         status, 'CD_GET_BOUNDS', cdfid, ivar,
+     .         'Non-positive or disordered "slab_m**_index" values: '
+     .         //vname(:vlen),  no_errstring, *5000 )
+
+ 5000   RETURN
+	END
+
diff --git a/fmt/src/cd_get_chunk_cache.F b/fmt/src/cd_get_chunk_cache.F
new file mode 100644
index 0000000..540b729
--- /dev/null
+++ b/fmt/src/cd_get_chunk_cache.F
@@ -0,0 +1,80 @@
+      SUBROUTINE CD_GET_CHUNK_CACHE (cache_size, cache_nelems, 
+     .    cache_preemption, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get current chunk cache settings. 
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* revision 0.0 - 1/2010
+
+      INCLUDE 'netcdf.inc'
+      INCLUDE 'netcdf4_settings.cmn'
+      INCLUDE 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations:
+      INTEGER cache_size, cache_nelems, cache_preemption, status
+
+* local variable declarations:
+      INTEGER cdfstat
+
+C Get the cache size for the files to be opened in this session.
+
+C Get chunk cache sizes.
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_CHUNK_CACHE_(cache_size, cache_nelems, 
+     .     cache_preemption)
+#else
+      cdfstat = NF_GET_CHUNK_CACHE(cache_size, cache_nelems, 
+     .     cache_preemption)
+#endif
+
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100 
+
+C If it hasnt been done yet, save the default value
+      IF (default_cache_size .EQ. 0) default_cache_size = cache_size
+
+      status = merr_ok
+ 5000 RETURN
+ 5100 CALL TM_ERRMSG (cdfstat+pcdferr, status, 'CD_SET_CHUNK_CACHE',
+     .     no_descfile, no_stepfile, 
+     .    'Getting chunk cache settings',
+     .     no_errstring, *5000 )
+      END
diff --git a/fmt/src/cd_get_dim_id.F b/fmt/src/cd_get_dim_id.F
new file mode 100644
index 0000000..562b248
--- /dev/null
+++ b/fmt/src/cd_get_dim_id.F
@@ -0,0 +1,75 @@
+      SUBROUTINE CD_GET_DIM_ID (dset, dname, dimid)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset and dimension name return dimension id
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+#include "gt_lib.parm"
+
+* Argument declarations
+
+      CHARACTER*(*) dname
+      INTEGER dset, dimid
+
+* Internal declarations
+      INCLUDE 'netcdf.inc'
+
+      INTEGER TM_LENSTR1, NCF_GET_DIM_ID, slen, flen, dset_num
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+      slen = TM_LENSTR1( dname )
+      CALL TM_FTOC_STRNG( dname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      dimid = NCF_GET_DIM_ID(dset_num, fhol)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_ds_dims.F b/fmt/src/cd_get_ds_dims.F
new file mode 100644
index 0000000..e0c0972
--- /dev/null
+++ b/fmt/src/cd_get_ds_dims.F
@@ -0,0 +1,72 @@
+      SUBROUTINE CD_GET_DS_DIMS (dset, idim, dname, npts, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf dimension information: 
+* given dset and idim return dimension name and length.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+*          replaces calls to NCDINQ
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) dname
+      INTEGER dset, idim, npts, status
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      INTEGER NCF_INQ_DS_DIMS, slen, flen, dset_num
+      PARAMETER (flen=128)      ! size of axis name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_INQ_DS_DIMS ( dset_num, idim, fhol, slen, npts )
+      slen = MIN(slen, flen)
+      CALL TM_CTOF_STRNG ( fhol, dname, slen )
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_ds_info.F b/fmt/src/cd_get_ds_info.F
new file mode 100644
index 0000000..d49ca3e
--- /dev/null
+++ b/fmt/src/cd_get_ds_info.F
@@ -0,0 +1,63 @@
+      SUBROUTINE CD_GET_DS_INFO (dset, ndims, nvars, ngatts,
+     .  recdim, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf dataset information: 
+* given dset, return number of dimensions, variables, global 
+* attributes, and the record axis.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      INTEGER dset,ndims, nvars, ngatts, recdim, status
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      INTEGER NCF_INQ_DS, dset_num
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_INQ_DS ( dset_num, ndims, nvars, ngatts, recdim )
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_generic_bounds.F b/fmt/src/cd_get_generic_bounds.F
new file mode 100644
index 0000000..1865060
--- /dev/null
+++ b/fmt/src/cd_get_generic_bounds.F
@@ -0,0 +1,235 @@
+	SUBROUTINE CD_GET_GENERIC_BOUNDS
+     .       ( cdfid, ivar, grid, tmlo, cdflo, cdfhi, tmrecdim, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Get the bounds of the hyperslab of the given netCDF variable
+* from its (generic) dimension limits
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*  1/95 *sh*: synchronize the start coordinates of the axes in the CDF file
+*		with the coordinates from the grid being written
+*  11/96 *kob* - Linux Port - had to use F90 intrinsic function TRANSFER
+*			    - to properly pass cvdim variable (not array)
+*		   	      to the NCVINQ routine.
+* V500 4/99 *kob*: increase size of vname and axnam from 24 to 64
+*	- for wacky DODS variables
+* V533 *sh* 6/01 - add support for string variables (NF_CHAR)
+* V500 4/99 *kob*: increase size of vname and axnam from 24 to 64
+* V552 *acm* 5/03   increase vname to 128 chars 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V686 4/13 *acm* Fix ticket 2064: use single-precision comparisons
+
+* argument definitions:
+*	cdfid   - id of currently open CDF file
+*       ivar    - CDF variable ID of the desired variable
+*       grid    - TMAP grid number
+*       tmlo    - lo subscript limits from TMAP grid
+*       cdflo   - array of (nferdims) lower bounds subscripts (returned)
+*       cdfhi   - array of (nferdims) upper bounds subscripts
+*       tmrecdim- returned axis (1-nferdims) which is CDF record dimension (or 0)
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+        include 'cd_lib.parm'
+        include 'xio.cmn_text'
+        external xio_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations:
+	INTEGER	 cdfid, ivar, grid, tmlo(*), cdflo(*), cdfhi(*),
+     .		tmrecdim, status
+
+* local variable declarations:
+      LOGICAL CD_USE_RECDIM, TM_FPEQ_SNGL, no_file_coords
+      INTEGER TM_LENSTR1, TM_SUBSC, 
+     .        idim, vartyp, nvdim,
+     .        ndims, cdfstat, vdims(8), nvatts,
+     .	      cvartyp, ncvdims, cvdim, npts, alen, axid, offset
+* 4/99 *kob* 
+      CHARACTER vname*128, axnam*128
+      REAL*8 TM_WORLD, file_val, mem_val
+      REAL*4 sfval, smval
+
+* determine if this variable uses the record dimension
+        IF ( CD_USE_RECDIM( cdfid, ivar, status ) ) THEN
+            tmrecdim = t_dim
+         ELSE
+            tmrecdim = 0
+         ENDIF
+
+* get the vital statistics for this variable
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VAR_(cdfid, ivar, vname, vartyp, nvdim,
+     .              vdims, nvatts)
+#else
+        cdfstat = NF_INQ_VAR (cdfid, ivar, vname, vartyp, nvdim,
+     .              vdims, nvatts)
+#endif
+
+* if it is a character variable, then the first dimension of it is the strlen
+        IF (vartyp .EQ. NF_CHAR) THEN
+	   DO idim = 1, nferdims+1
+	      vdims(idim) = vdims(idim+1)
+	   ENDDO
+	   nvdim = nvdim - 1
+	ENDIF
+
+* get the lo/hi bounds
+        ndims = 0
+        DO 100 idim = 1, nferdims
+           IF ( grid_line(idim,grid) .NE. mpsnorm
+     .    .AND. tmlo(idim) .NE. unspecified_int4  ) THEN
+              ndims = ndims + 1
+!              cdfhi(idim) = CD_AXLEN( cdfid, vdims(ndims), status )
+* 1/95: get info about the coordinate variable (previously w/ CD_AXLEN)
+* and then synchronize the start subscript in the output file with the axis
+* position on the grid being written (this permits writing into files that
+* lack the cdfhi/max_limits machinery)
+
+* ... get the size and name of the dimension
+#ifdef usingDODSf2cUnderscore
+              cdfstat = NF_INQ_DIM_( cdfid, vdims(ndims), axnam, npts )
+#else
+	      cdfstat = NF_INQ_DIM ( cdfid, vdims(ndims), axnam, npts )
+#endif
+	      alen = TM_LENSTR1( axnam )
+
+* ... time axis as a record axis will be synchronized in another routine
+	      IF ( idim .EQ. tmrecdim ) THEN
+	          cdflo(idim) = 1
+	          cdfhi(idim) = npts
+	          GOTO 100
+	      ENDIF
+
+* ... find the coordinate variable by this name
+#ifdef usingDODSf2cUnderscore
+              cdfstat = NF_INQ_VARID_( cdfid, axnam(:alen), axid )
+#else
+              cdfstat = NF_INQ_VARID ( cdfid, axnam(:alen), axid )
+#endif
+	      no_file_coords = cdfstat .NE. NF_NOERR
+
+* ... determine the first coordinate value
+              IF ( no_file_coords ) THEN
+	         file_val = 1.0D0	! like abstract axis
+	      ELSE
+* ... get the vital statistics of the coordinate variable
+#ifdef usingDODSf2cUnderscore
+                 cdfstat = NF_INQ_VAR_(cdfid, axid, axnam, 
+     .			cvartyp, ncvdims,
+#else
+		 cdfstat = NF_INQ_VAR(cdfid, axid, axnam, 
+     .			cvartyp, ncvdims,
+#endif
+#ifdef FORTRAN_90
+     .			TRANSFER(cvdim,cvdim,1), nvatts)
+#else
+     .                  cvdim, nvatts)
+#endif
+* ... read the first coordinate
+                 CALL CD_RD_R8_1( cdfid, axid, 1, cvartyp,
+     .                      'axis: '//axnam(:alen), file_val, status )
+	         IF ( status .NE. merr_ok ) GOTO 5000
+	      ENDIF
+
+* ... locate the first file coordinate on the TMAP grid axis
+	      offset = TM_SUBSC ( file_val, grid, idim, 1 )
+
+* ... check that the starting alignment is "exact"
+	      mem_val = TM_WORLD ( offset, grid, idim, box_middle )
+
+	      sfval = SNGL(file_val)
+	      smval = SNGL(mem_val)
+	      IF (.NOT.TM_FPEQ_SNGL(sfval, smval)) GOTO 5100
+
+* .. here are the synchronized subscripts
+              cdflo(idim) = offset
+              cdfhi(idim) = offset + npts - 1
+
+* ... safety check - make sure the upper axis limit is also exact
+*     (no check is made for points in between)
+	      IF ( no_file_coords ) THEN
+	         file_val = npts
+	      ELSE
+                 CALL CD_RD_R8_1( cdfid, axid, npts, cvartyp,
+     .                      'axis: '//axnam(:alen), file_val, status )
+	         IF ( status .NE. merr_ok ) GOTO 5000
+	      ENDIF
+	      offset = TM_SUBSC ( file_val, grid, idim,  cdfhi(idim) )
+	      mem_val = TM_WORLD ( offset, grid, idim, box_middle )
+	      
+	      sfval = SNGL(file_val)
+	      smval = SNGL(mem_val)
+	      IF (.NOT.TM_FPEQ_SNGL(sfval, smval)) GOTO 5100
+
+           ELSE
+              cdflo(idim) = 1
+              cdfhi(idim) = 1
+           ENDIF
+ 100    CONTINUE
+
+* successful completion
+	status = merr_ok
+        RETURN
+
+* error exits
+ 5000	RETURN
+ 5100  CALL TM_ERRMSG
+     .      ( merr_badlinedef, status, 'CD_GET_GENERIC_BOUNDS',
+     .	      no_descfile, no_stepfile,
+     .       'file coords dont match variable coords on axis '
+     .       //axnam(:alen),
+     .       no_errstring , *5000 )
+
+	END
+
diff --git a/fmt/src/cd_get_generic_grids.F b/fmt/src/cd_get_generic_grids.F
new file mode 100644
index 0000000..9207ecd
--- /dev/null
+++ b/fmt/src/cd_get_generic_grids.F
@@ -0,0 +1,363 @@
+	SUBROUTINE CD_GET_GENERIC_GRIDS (dset,cdfid,temp_axnams,reversed,
+     .					 perm, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Loads the common block XGRID with implicitly given grid definitions from a
+* netCDF file - i.e. grid definitions for variables that lack a 
+* "parent_grid = name" attribute
+* also initialize grid limits (lo hi bounds on each axis) for these variables
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* 2/95 - added support for reverse-ordered coordinate axes
+* 7/96 - increase "name" from 16 to 24 characters for consistence
+*	(still dimension names cannot be 24 chars --> line names in COMMON)
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V500: 3/99 *sh* - if an axis doesn't exist matching the dimension name, then
+*	create a 1,2,3...n axis without error message
+*       4/99 *kob* - increase size of temp_axnams, vname and name to 64
+* *sh*  6/99 - added "perm" (permutation) argument
+* V510: *sh* 1/00 - when a "BASIC" axis is created cuz the file has no
+*			coords that axis needs to bump "lastax" to get
+*			checked for dup names later
+*	     3/00 - convert to dynamic grids and axes
+* V533: *sh* 6/01 - support for string variable input
+* V552 *acm* 5/03   increase vname to 128 chars 
+* V600 *ACM* attribute control. 
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib 
+*             from linked list structure
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V683 10/12*acm* If T and F dimensions, and if both are calendar axes, insist that
+*                 the calendars match.
+* V685 5/13 *acm* Discrete Sampling Geometries files: if there is a variable with
+*                 a cf_role attribute, assign its axis to the E direction. (If the
+*                 file has coordinate variables with assigned axes, keep the 
+*                 direction assigned in the file.)
+
+* argument definitions:
+*       dset        - TMAP data set pointer
+*	cdfid	    - netCDF id number for already opened CDF file
+*       temp_axnams - nferdims axis names per grid: temp until grids are assembled
+*       reversed    - logical array to record which axes have reversed coords
+*       perm        - user-specified permutation (e.g. "YXZT"=2,1,3,4)
+*	status	    - return status
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xbuild_grids.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xio.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+	        include 'xdset_info.cd_equiv'
+
+* argument declarations
+	LOGICAL  reversed(max_lines:line_ceiling)
+	INTEGER	 dset, cdfid, perm(nferdims), status
+	CHARACTER*128 temp_axnams(nferdims,max_temp_grid)
+
+* local parameter definitions:
+      INTEGER     str_eq
+      PARAMETER ( str_eq = 0 )
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved them to parameter line 10/96
+      LOGICAL NC_GET_ATTRIB,
+     .        got_it, do_warn, centers, coordvar
+      PARAMETER (do_warn = .TRUE. )
+      PARAMETER (centers = .TRUE. )
+      INTEGER TM_LENSTR1, TM_FIND_GRID_SLOT, STR_CASE_BLIND_COMPARE,
+     .        STR_SAME, igrid, iaxis, grid_cnt, istat, idim,
+     .        ivar, vartyp, nvdims, vdims(8), nvatts, vlen, idim2,
+     .        tmvar, tmpgrid, npts, dim, tmplines(nferdims), ndim,
+     .	      grid_dims(nferdims), trans(nferdims), indices(nferdims),
+     .        i, maxlen, attlen,attoutflag, all_outflag, axid, iaxis5,
+     .        attid, eax, cfrole_dim
+      REAL    tmp
+      CHARACTER name*128, vname*128, linunits*16
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* initialize temporary grid name pointer
+	num_tmp_grids = 0
+	DO 5 i = max_grids, grid_ceiling
+ 5	   tmp_nam_ptr(i) = 0
+
+* * * * loop through each variable in this TMAP data set * * *
+* Check for cf_role attribute. If present, its grid is in the E direction.
+
+	cfrole_dim = 0 
+	
+        DO 25 tmvar = 1,maxvars
+           IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 25
+	   eax = 0
+           ivar = cd_varid(tmvar)
+
+* get the vital statistics for this variable
+           CALL CD_GET_VAR_INFO(dset, ivar, vname, vartyp, nvdims,
+     .                 vdims, nvatts, coordvar, all_outflag, istat)
+
+           IF (istat.NE.merr_ok) CALL TM_ERRMSG
+     .     ( istat+pcdferr,status,'CD_GET_GENERIC_GRIDS',cdfid,ivar,
+     .       no_errstring, no_errstring, *5900 )
+           vlen = TM_LENSTR1(vname)
+
+* if a string variable, the first dimension is the string axis (ignore it)
+	   IF (vartyp .EQ. NF_CHAR) THEN
+	      nvdims = nvdims - 1
+	      DO idim = 1, nvdims
+	         vdims(idim) = vdims(idim+1)
+	      ENDDO
+	   ENDIF
+
+* if it has a cf_role attribute, we'll put its axis in the E direction.
+*  trajectory:cf_role = "trajectory_id" (or var w/ "profile_id", or "timeseries_id")
+* (IF there is a instance_dimension attribute, it's value is the the instance axis,
+* to be put in the E direction. If there is a sample_dimension attribute on some variable, its value is the obs 
+* dimension, to be put in the X direction.) 
+
+	   CALL  CD_GET_VAR_ATT_ID (dset, ivar, "cf_role", attid, status)
+	   IF (status .EQ. merr_ok) THEN
+	      eax = vdims(1)
+
+* find the instance dimension
+
+              DO 15 idim = 1, nvdims
+	         IF (idim .EQ. eax) cfrole_dim = idim
+ 15          CONTINUE
+             GOTO 35  ! only one cf_role attribute recognized
+
+	   ENDIF
+
+ 25       CONTINUE
+
+ 35       CONTINUE
+
+* * * * loop through each variable in this TMAP data set * * *
+* if it doesn't have a grid pointer create a suitable one and point to it
+        DO 500 tmvar = 1,maxvars
+           IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 500
+           ivar = cd_varid(tmvar)
+
+* does it point explicitly to a parent grid ?
+          maxlen = 16   !linenamlen
+          got_it = NC_GET_ATTRIB( dset, ivar, 'parent_grid',
+     .                       .NOT.do_warn, ' ', maxlen, attlen, 
+     .                       attoutflag, name, tmp )
+          IF ( got_it ) GOTO 500  ! yes - already has a pointer
+
+* get the vital statistics for this variable
+           CALL CD_GET_VAR_INFO(dset, ivar, vname, vartyp, nvdims,
+     .                 vdims, nvatts, coordvar, all_outflag, istat)
+
+           IF (istat.NE.merr_ok) CALL TM_ERRMSG
+     .     ( istat+pcdferr,status,'CD_GET_GENERIC_GRIDS',cdfid,ivar,
+     .       no_errstring, no_errstring, *5900 )
+           vlen = TM_LENSTR1(vname)
+
+* if a string variable, the first dimension is the string axis (ignore it)
+	   IF (vartyp .EQ. NF_CHAR) THEN
+	      nvdims = nvdims - 1
+	      DO idim = 1, nvdims
+	         vdims(idim) = vdims(idim+1)
+	      ENDDO
+	   ENDIF
+
+* use the next grid building slot to build a grid for this variable
+           tmpgrid = num_tmp_grids + 1
+
+* initialize the axis names in case there are fewer than nferdims from CDF variable
+           DO 10 idim = 1, nferdims
+              tmplines(idim) = unspecified_int4
+              temp_axnams(idim,tmpgrid)='NORMAL'
+ 10        CONTINUE
+
+* find the axis names from the CDF file
+           DO 200 idim = 1, nvdims
+
+* ... get name of dimension
+              CALL CD_GET_DS_DIMS( dset, vdims(idim), name, npts, istat )
+              IF (istat.NE.merr_ok) CALL TM_ERRMSG
+     .     ( istat+pcdferr,status,'CD_GET_GENERIC_GRIDS',cdfid,ivar,
+     .       vname(:vlen), 'cant get dimensions', *5900 )
+ 
+* ... locate the axis by that name (processed in CD_GET_AXES)
+	      iaxis = 0
+ 100	      CALL TM_NEXT_TMP_LINE(iaxis, *120)  ! 120 if no more
+	         istat = STR_CASE_BLIND_COMPARE(name, line_name(iaxis))
+	         IF ( istat .EQ. str_eq ) GOTO 150  ! got a match
+	      GOTO 100
+
+* ... axis doesn't exist - perhaps it is a dimension with no variable defn
+* *sh* 3/99: or perhaps a 2D variable with name matching the dimension name
+*  either way -- not an error condition if we need to synthesize an axis ...
+ 120	      CALL TM_MAKE_BASIC_AXIS( name, 1.0D0, 1.0D0, npts,
+     .                                 iaxis, status )
+              IF ( status .NE. merr_ok ) GOTO 5900
+
+* Are there attributes that tell us the direction?  If so apply them.
+* for the user's convenience, an invalid T axis is still in the T direction.
+* The routine will get and use basic info about the units.
+
+* axis ID
+	      CALL CD_GET_VAR_ID (dset, name, axid, status)
+	      linunits = char_init16
+	      IF (idim .EQ. cfrole_dim) THEN
+	         line_direction(iaxis) = 'EE'
+		 cfrole_dim = 0  ! reset. Just one axis will have this role.
+		 eax = 0
+	      ELSE
+	         CALL CD_GET_LINE_DIRECTION (dset, axid, iaxis, 
+     .                name, linunits, do_warn)
+	      ENDIF
+
+* save a pointer to the axis just found
+ 150          IF (idim.LE.nferdims) tmplines(idim) = iaxis
+
+ 200       CONTINUE
+
+* reorder the axes into the most likely order if not explicitly given
+           IF ( ds_ordering(1,tmvar) .EQ. unspecified_int4 ) THEN
+              CALL TM_AXIS_ORDER(tmplines, perm, ds_ordering(1,tmvar),
+     .                           nvdims, vname(:vlen))
+           ENDIF
+
+* ... make a sorted list of the relevant axes in grid_dims
+*     and a list of the index ordering of the axes in indices
+	ndim = 0
+	DO 210 idim = 1, nferdims
+	   trans(idim) =  ABS(ds_ordering(idim,tmvar))
+	   grid_dims(idim) = trans(idim)
+	   indices(idim) = idim
+	   IF (trans(idim) .NE. 0 ) THEN
+	      ndim = ndim + 1
+	   ENDIF
+ 210	CONTINUE
+	DO 220 idim = 1, ndim
+	   DO 215 idim2 = idim+1, ndim
+	      IF (grid_dims(idim) .GT. grid_dims(idim2)) THEN
+	         dim = grid_dims(idim)
+	         grid_dims(idim ) = grid_dims(idim2)
+	         grid_dims(idim2) = dim
+	      ENDIF
+ 215	   CONTINUE
+ 220	CONTINUE
+	DO 230 idim = 1, ndim
+	   i = 1
+	   DO 225 idim2 = 1, ndim
+	      IF (trans(idim2) .LT. trans(idim)) i = i + 1
+ 225	   CONTINUE
+	   indices(idim) = i
+ 230	CONTINUE
+
+* save the axis names in the proper order
+           DO 240 idim = 1, nferdims
+              ds_grid_start(idim,tmvar) = 1
+              ds_grid_end  (idim,tmvar) = 1
+ 240       CONTINUE
+           DO 250 idim = 1, ndim
+              dim = trans(idim)
+              iaxis = tmplines(indices(idim))
+	      idim2 = grid_dims(idim)
+              temp_axnams(idim2,tmpgrid) = line_name(iaxis)
+              ds_grid_end(idim2,tmvar)   = line_dim(iaxis)
+* ... flag reverse-ordered coordinate axis of variable (2/95)
+	      IF ( reversed(iaxis) ) ds_ordering(idim,tmvar)
+     .			      = -1 * ds_ordering(idim,tmvar)
+ 250       CONTINUE
+
+* ... If there is a T and an F axis, check for matching calendars
+           idim = 5
+	   iaxis5 = tmplines(indices(idim))
+	   IF (iaxis5 .NE. unspecified_int4) THEN
+	     IF (STR_SAME(line_cal_name(iaxis), line_cal_name(iaxis5)) .NE. 0) 
+     .        CALL TM_ERRMSG
+     .        ( istat+pcdferr,status,'CD_GET_GENERIC_GRIDS',cdfid,ivar,
+     .        vname(:vlen), 'Calendar definitions on T and F axes must match', *5900 )
+	   ENDIF
+* is the temporary grid we just created unique ?
+	   igrid = 0
+ 300	   CALL TM_NEXT_TMP_GRID( igrid, *320)
+	      grid_cnt = tmp_nam_ptr(igrid)
+              DO 310 idim = 1, nferdims
+                 IF ( temp_axnams(idim,tmpgrid )
+     .          .NE.  temp_axnams(idim,grid_cnt) ) GOTO 300
+ 310          CONTINUE
+* ... not unique - exact match with one that already exists
+              GOTO 350
+ 320	   CONTINUE
+ 
+
+* allocate a new grid
+* find next location to store info; if too many grids - give error
+	  CALL TM_ALLO_TMP_GRID(igrid, status)
+	  IF (status .NE. merr_ok) GOTO 5900
+
+* make up a unique grid name "GXXnn" where XX is hashed from data set name
+          grid_name(igrid) = 'G'//cd_dset_code(dset)(:2)
+          CALL TM_NEW_GRID_NAME( grid_name(igrid), name )
+          grid_name(igrid) = name
+
+* basic defaults
+          grid_rotation(igrid) = 0.0
+          DO 340 idim = 1, nferdims
+ 340      grid_out_prod(idim,igrid) = .TRUE.
+
+* save a pointer to this grid for the TMAP variable
+ 350      ds_grid_number(tmvar) = igrid
+
+ 500   CONTINUE
+
+* successful completion
+ 	status = merr_ok
+        RETURN
+
+* error exit
+ 5900	RETURN
+
+	END
diff --git a/fmt/src/cd_get_line_direction.F b/fmt/src/cd_get_line_direction.F
new file mode 100644
index 0000000..2e54a87
--- /dev/null
+++ b/fmt/src/cd_get_line_direction.F
@@ -0,0 +1,526 @@
+      SUBROUTINE CD_GET_LINE_DIRECTION (dset, ivar, iaxis,
+     .     vname, linunits, do_warn)
+     
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  code to determine the direction of a coordinate axis. Pulled out of cd_get_1_axis
+*  V683 ACM 9/2012
+*
+*      include files: 
+      
+        IMPLICIT NONE
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+        include 'xunits.cmn_text'
+        external xunits_data
+        include 'errmsg.parm'
+
+
+* calling arguments
+      LOGICAL do_warn
+      INTEGER dset, ivar, iaxis, idir
+      CHARACTER*(*) vname, linunits
+
+* local declarations
+      LOGICAL TM_HAS_STRING, NC_GET_ATTRIB, got_it, yyyymmdd_time
+      CHARACTER*1 axis_dir*1, vupcase*128
+
+      INTEGER STR_UPCASE, STR_CASE_BLIND_COMPARE, TM_LENSTR1, 
+     .	      TM_UNIT_ID, i, units, attlen, attoutflag, attype, iatt,  
+     .        vlen, slen,maxlen, istat, since_T0, epic_t2var, status
+
+      REAL val, dummy
+
+      INTEGER bufflen
+      PARAMETER (bufflen = 256)
+      CHARACTER*256 buff, upbuff
+      INTEGER     str_eq
+      PARAMETER ( str_eq = 0 )
+
+* (could check for the record axis and if so, set it to T)
+
+* Use attributes to try to determine the orientation and 
+* direction of the axis
+
+      line_direction(iaxis) = 'NA'
+
+      vlen = TM_LENSTR1(vname)
+
+* ... First check for an AXIS attribute
+
+      axis_dir = char_init01
+      maxlen = 1
+      got_it = NC_GET_ATTRIB(dset, ivar, 'axis',
+     .             do_warn, vname(:vlen), maxlen, attlen, 
+     .             attoutflag, axis_dir, val)
+      IF (got_it) THEN
+         CALL CD_GET_VAR_ATT_ID (dset, ivar, 'axis', iatt, status)
+         CALL CD_GET_VAR_ATT_INFO (dset, ivar, iatt, buff, attype, 
+     .     attlen, attoutflag, status )
+         IF (attype .NE. NCCHAR) got_it = .FALSE.
+      ENDIF
+      IF (got_it) THEN
+         istat = STR_UPCASE( axis_dir, axis_dir )
+         IF (axis_dir.EQ.'T' .OR. axis_dir.EQ.'L' .OR.
+     .             axis_dir.EQ.'t' .or. axis_dir.eq.'l') THEN 
+            line_direction(iaxis) = 'TI'  ! time
+          ELSE IF (axis_dir.EQ.'X' .OR. axis_dir.EQ.'I' .OR.
+     .             axis_dir.eq.'x' .or. axis_dir.eq.'i') THEN
+            line_direction(iaxis) = 'XX'
+         ELSE IF (axis_dir.EQ.'Y' .OR. axis_dir.EQ.'J' .OR.
+     .            axis_dir.eq.'y' .or. axis_dir.eq.'j') THEN
+            line_direction(iaxis) = 'YY'
+         ELSE IF (axis_dir.EQ.'Z' .OR. axis_dir.EQ.'K' .OR.
+     .            axis_dir.eq.'z' .or. axis_dir.eq.'k') THEN
+            line_direction(iaxis) = 'DU'
+         ELSE IF (axis_dir.EQ.'E' .OR. axis_dir.EQ.'M' .OR.
+     .            axis_dir.eq.'e' .or. axis_dir.eq.'m') THEN
+            line_direction(iaxis) = 'EE'
+         ELSE IF (axis_dir.EQ.'F' .OR. axis_dir.EQ.'N' .OR.
+     .            axis_dir.eq.'f' .or. axis_dir.eq.'n') THEN
+            line_direction(iaxis) = 'FF'
+         ENDIF
+      ELSE
+         axis_dir = char_init01
+      ENDIF
+
+
+* ... check for a CARTESIAN_AXIS attribute, if still undetermined
+
+      IF (line_direction(iaxis) .EQ. 'NA') THEN
+
+         maxlen = 1
+         got_it = NC_GET_ATTRIB(dset, ivar, 'cartesian_axis',
+     .              do_warn, vname(:vlen), maxlen, attlen, 
+     .              attoutflag, axis_dir, val)
+         IF (got_it) THEN
+            CALL CD_GET_VAR_ATT_ID (dset, ivar, 'cartesian_axis', iatt, status)
+            CALL CD_GET_VAR_ATT_INFO (dset, ivar, iatt, buff, attype, 
+     .     attlen, attoutflag, status )
+            IF (attype .NE. NCCHAR) got_it = .FALSE.
+         ENDIF
+
+         IF (got_it) THEN
+            IF (axis_dir.EQ.'T' .OR. axis_dir.EQ.'L' .OR.
+     .          axis_dir.EQ.'t' .or. axis_dir.eq.'l') THEN 
+               line_direction(iaxis) = 'TI'  ! time
+            ELSE IF (axis_dir.EQ.'X' .OR. axis_dir.EQ.'I' .OR.
+     .               axis_dir.eq.'x' .or. axis_dir.eq.'i') THEN
+            line_direction(iaxis) = 'WE'
+            ELSE IF (axis_dir.EQ.'Y' .OR. axis_dir.EQ.'J' .OR.
+     .               axis_dir.eq.'y' .or. axis_dir.eq.'j') THEN
+             line_direction(iaxis) = 'SN'
+            ELSE IF (axis_dir.EQ.'Z' .OR. axis_dir.EQ.'K' .OR.
+     .               axis_dir.eq.'z' .or. axis_dir.eq.'k') THEN
+               line_direction(iaxis) = 'DU'
+            ELSE IF (axis_dir.EQ.'E' .OR. axis_dir.EQ.'M' .OR.
+     .            axis_dir.eq.'e' .or. axis_dir.eq.'m') THEN
+               line_direction(iaxis) = 'EE'
+            ELSE IF (axis_dir.EQ.'F' .OR. axis_dir.EQ.'N' .OR.
+     .            axis_dir.eq.'f' .or. axis_dir.eq.'n') THEN
+               line_direction(iaxis) = 'FF'
+            ENDIF
+         ELSE
+            axis_dir = char_init01
+         ENDIF
+      ENDIF
+
+* ... check for a _CoordinateAxisType attribute, if still undetermined
+
+      IF (line_direction(iaxis) .EQ. 'NA') THEN
+
+         maxlen = 20
+         got_it = NC_GET_ATTRIB(dset, ivar, '_CoordinateAxisType',
+     .              do_warn, vname(:vlen), maxlen, attlen, 
+     .              attoutflag, buff, val)
+         IF (got_it) THEN
+            CALL CD_GET_VAR_ATT_ID (dset, ivar,
+     .        '_CoordinateAxisType', iatt, status)
+            CALL CD_GET_VAR_ATT_INFO (dset, ivar, iatt, upbuff, attype, 
+     .        attlen, attoutflag, status )
+            IF (attype .NE. NCCHAR) got_it = .FALSE.
+         ENDIF
+
+         IF (got_it) THEN
+	    i = STR_UPCASE(upbuff, buff)
+            IF (upbuff.EQ.'TIME') THEN 
+               line_direction(iaxis) = 'TI'  ! time
+            ELSE IF (upbuff.EQ.'LON' .OR. upbuff.EQ.'GEOX') THEN
+            line_direction(iaxis) = 'WE'
+            ELSE IF (upbuff.EQ.'LAT' .OR. upbuff.EQ.'GEOY') THEN
+             line_direction(iaxis) = 'SN'
+            ELSE IF (upbuff.EQ.'HEIGHT') THEN
+               line_direction(iaxis) = 'UD'
+            ELSE IF (upbuff.EQ.'PRESSURE') THEN
+               line_direction(iaxis) = 'DU'
+            ELSE IF (upbuff.EQ.'ENSEMBLE') THEN
+               line_direction(iaxis) = 'EE'
+            ELSE IF (upbuff.EQ.'RUNTIME') THEN
+               line_direction(iaxis) = 'FF'
+            ENDIF
+	 
+	    IF (upbuff.EQ.'HEIGHT' .OR. 
+     .               upbuff.EQ.'PRESSURE') THEN
+               maxlen = 20
+               got_it = NC_GET_ATTRIB(dset, ivar, 
+     .              'CoordinateZisPositive',
+     .              do_warn, vname(:vlen), maxlen, attlen, 
+     .              attoutflag, buff, val)
+               IF (got_it) THEN
+	          i = STR_UPCASE(upbuff, buff)
+	          IF (upbuff.EQ.'UP')
+     .             line_direction(iaxis) = 'DU'
+	          IF (upbuff.EQ.'DOWN')
+     .             line_direction(iaxis) = 'UD'
+               ENDIF
+            ENDIF
+         ENDIF
+
+      ENDIF
+
+* ... next check units
+               
+* If this is called by cd_get_1_axis, we have incoming units from 
+* line_units(iaxis) already. Otherwise, get basic units.
+
+* Time ax may contain "tunits since T0_date"
+
+      IF (linunits .EQ. char_init16) THEN
+
+         linunits = ' '   ! default
+         maxlen = bufflen
+         got_it = NC_GET_ATTRIB( dset, ivar, 'units', do_warn,
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+         since_T0 = MAX( INDEX(buff,'since'), INDEX(buff,'SINCE') )
+         yyyymmdd_time = buff(1:15) .EQ. 'yyyymmddhhmmss'
+
+         IF ( since_T0 .GT. 2 ) THEN
+            linunits = buff(:since_T0-1)  ! just the "tunits" part 
+         ELSEIF ( yyyymmdd_time ) THEN
+            linunits = 'days'
+         ELSE
+            IF (got_it) linunits = buff
+         ENDIF
+
+* EPIC time axes are encoded as 2 integers in variables TIME and TIME2
+         IF ( vupcase .EQ. 'TIME' ) THEN
+            CALL CD_GET_VAR_ID ( dset, 'time2', epic_t2var, status)
+	    IF ( status .EQ. merr_ok ) linunits = 'Days'     ! arbitrary
+         ENDIF
+      ENDIF
+      
+* ... decode the units
+
+      units = TM_UNIT_ID( linunits )
+      istat = STR_UPCASE( vupcase, vname )
+
+
+      IF (line_direction(iaxis) .EQ. 'NA' .OR. 
+     .    line_direction(iaxis) .EQ. 'XX' .OR.
+     .    line_direction(iaxis) .EQ. 'YY' .OR.
+     .    line_direction(iaxis) .EQ. 'FF') THEN
+
+      IF ( units .LT. 0 ) THEN
+	 IF (line_direction(iaxis) .EQ. 'FF') THEN
+	    line_direction(iaxis) = 'FI'  ! forecast time
+	 ELSE
+            line_direction(iaxis) = 'TI'  ! time
+	 ENDIF
+
+      ELSEIF ( units .EQ. 4 ) THEN     ! degrees
+        IF  ( TM_HAS_STRING(linunits, 'NORTH')
+     .   .OR. TM_HAS_STRING(linunits, 'SOUTH')
+     .   .OR. TM_HAS_STRING(linunits, 'degreeN')   ! Check all CF_compliant 
+     .   .OR. TM_HAS_STRING(linunits, 'degreesN')  ! options
+     .   .OR. TM_HAS_STRING(linunits, 'degree_N')  ! Case independent
+     .   .OR. TM_HAS_STRING(linunits, 'degrees_N')
+c     .   .OR. TM_HAS_STRING(linunits, 'degreesS') ! But this matches all degrees
+     .   .OR. TM_HAS_STRING(linunits, 'degree_S')
+     .   .OR. TM_HAS_STRING(linunits, 'degrees_S')
+     .   .OR. TM_HAS_STRING(linunits, 'LAT') ) THEN 
+            line_direction(iaxis) = 'SN'
+        ELSEIF ( TM_HAS_STRING(linunits, 'EAST')
+     .   .OR. TM_HAS_STRING(linunits, 'WEST')
+     .   .OR. TM_HAS_STRING(linunits, 'degreeE')
+     .   .OR. TM_HAS_STRING(linunits, 'degreesE')
+     .   .OR. TM_HAS_STRING(linunits, 'degree_E')
+     .   .OR. TM_HAS_STRING(linunits, 'degrees_E')
+     .   .OR. TM_HAS_STRING(linunits, 'degreeW')
+     .   .OR. TM_HAS_STRING(linunits, 'degreesW')
+     .   .OR. TM_HAS_STRING(linunits, 'degree_W')
+     .   .OR. TM_HAS_STRING(linunits, 'degrees_W')
+     .   .OR. TM_HAS_STRING(linunits, 'LON') ) THEN 
+            line_direction(iaxis) = 'WE'
+        ELSEIF ( line_direction(iaxis) .EQ. 'XX') THEN
+                        line_direction(iaxis) = 'WE'
+        ELSEIF ( line_direction(iaxis) .EQ. 'YY') THEN
+                        line_direction(iaxis) = 'SN'
+        ENDIF
+
+      ELSEIF ( units .EQ. pun_millibars
+     .   .OR.  units .EQ. pun_decibars ) THEN 
+         line_direction(iaxis) = 'UD'
+      ELSEIF ( units .EQ. 14
+     .   .OR.  units .EQ. 15   ) THEN         ! layer or level
+         line_direction(iaxis) = 'UD'
+* ... then check stray clues
+         ELSEIF ( TM_HAS_STRING(linunits, 'LAT') ) THEN
+         line_direction(iaxis) = 'SN'
+      ELSEIF ( TM_HAS_STRING(linunits, 'LON') ) THEN
+         line_direction(iaxis) = 'WE'
+      ENDIF
+      ENDIF
+
+      IF (units .EQ. 4) THEN    ! degrees
+         IF (line_direction(iaxis) .EQ. 'NA' ) THEN
+            IF ( vupcase(1:1) .EQ. 'Y'
+     .      .OR. INDEX(vupcase, 'LAT') .GT. 0 ) THEN
+               line_direction(iaxis) = 'SN'
+            ELSEIF ( vupcase(1:1) .EQ. 'X'
+     .      .OR. INDEX(vupcase, 'LON') .GT. 0 ) THEN
+               line_direction(iaxis) = 'WE'
+! 8/97: "Y" anywhere in name as a last ditch attempt to id it
+            ELSEIF ( INDEX(vupcase, 'Y')   .GT. 0 ) THEN
+               line_direction(iaxis) = 'SN'
+            ELSE
+               line_direction(iaxis) = 'WE'
+            ENDIF
+         ENDIF
+	 IF (line_direction(iaxis) .EQ. 'WE') THEN
+	    linunits = 'degrees_east'
+	    slen = TM_LENSTR1(linunits)
+	    dummy = 1.
+	    CALL CD_REPLACE_ATTR (dset, ivar, 'units', NF_CHAR, slen,
+     .            linunits, dummy, status)
+	 ENDIF
+	 IF (line_direction(iaxis) .EQ. 'SN') THEN
+	    linunits = 'degrees_north'
+	    slen = TM_LENSTR1(linunits)
+	    dummy = 1.
+	    CALL CD_REPLACE_ATTR (dset, ivar, 'units', NF_CHAR, slen,
+     .            linunits, dummy, status)
+	 ENDIF
+      ENDIF
+
+! See if the long-name contains a string that indicates a z axis
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset,ivar,'long_name',
+     .           do_warn, vname(:vlen), maxlen, attlen, attoutflag, 
+     .           buff, val)
+      IF ( got_it .AND. line_direction(iaxis) .EQ. 'NA' ) THEN
+         IF (STR_CASE_BLIND_COMPARE('elev',buff(:4)) .EQ. str_eq) 
+     .           line_direction(iaxis) = 'DU'
+         IF (STR_CASE_BLIND_COMPARE('height',buff(:6)) .EQ. str_eq) 
+     .           line_direction(iaxis) = 'DU'
+         IF (STR_CASE_BLIND_COMPARE('level',buff(:5)) .EQ. str_eq) 
+     .           line_direction(iaxis) = 'DU'
+         IF (STR_CASE_BLIND_COMPARE('layer',buff(:5)) .EQ. str_eq) 
+     .           line_direction(iaxis) = 'DU'
+         IF (STR_CASE_BLIND_COMPARE('depth',buff(:5)) .EQ. str_eq) 
+     .           line_direction(iaxis) = 'UD'
+      ENDIF
+
+* the attribute "positive=down", etc. may help
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset, ivar, 'positive', do_warn, 
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      IF ( got_it ) THEN
+         IF (STR_CASE_BLIND_COMPARE('west',buff(:4))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'WE'
+         ELSEIF( STR_CASE_BLIND_COMPARE('east',buff(:4))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'WE'
+         ELSEIF( STR_CASE_BLIND_COMPARE('up',buff(:2))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ELSEIF( STR_CASE_BLIND_COMPARE('down',buff(:4))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF
+      ENDIF
+
+
+* Basic standard names
+* Look for time, longitude, latitude, depth and height names.
+* Forecast time axes have a standard-name attribute "forecast_reference_time"
+
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset, ivar, 'standard_name', do_warn, 
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      IF ( got_it ) THEN
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'time',buff(:4))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'TI'
+         ENDIF 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'longitude',buff(:0))          .EQ.str_eq .OR. 
+     .      STR_CASE_BLIND_COMPARE(
+     .      'grid_longitude',buff(:19))    .EQ.str_eq) THEN
+            line_direction(iaxis) = 'WE'
+         ENDIF 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'latitude',buff(:8))           .EQ.str_eq .OR.
+     .      STR_CASE_BLIND_COMPARE(
+     .      'grid_latitude',buff(:18))     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'SN'
+         ENDIF 
+	 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'depth',buff(:5))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF 
+	 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'altitude',buff(:8))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'forecast_reference_time',buff(:24))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'FI'
+         ENDIF 
+      ENDIF
+
+
+* Standard_names indicating a sigma-axis in Z, and standard names 
+* for geophysical axes, longitude, latitude, altitude etc. Note 
+* that there seem to be some standard names related to sigma
+* coordinates that may not indicate a vertical axis, so simply 
+* matching sigma and coordinate is probably not safe.
+
+      maxlen = bufflen
+      got_it = NC_GET_ATTRIB( dset, ivar, 'standard_name', do_warn, 
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, val)
+      IF ( got_it ) THEN
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_hybrid_height_coordinate',buff(:35))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF 
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_hybrid_sigma_pressure_coordinate',buff(:43))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_hybrid_height_coordinate',buff(:35))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_ln_pressure_coordinate',buff(:33))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_sigma_coordinate',buff(:27))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'atmosphere_sleve_coordinate',buff(:27))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'land_ice_sigma_coordinate',buff(:25))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'DU'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'ocean_s_coordinate',buff(:19))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'ocean_sigma_coordinate',buff(:22))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'ocean_sigma_z_coordinate',buff(:24))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF
+         IF (STR_CASE_BLIND_COMPARE(
+     .      'ocean_double_sigma_coordinate',buff(:29))
+     .                                     .EQ.str_eq) THEN
+            line_direction(iaxis) = 'UD'
+         ENDIF
+
+      ENDIF  ! end of std names
+
+* Still punting on axis names. If it's single-letter X, Y, Z, T,
+* or starts with XAX, YAX, etc. then give it that direction.
+
+      IF (line_direction(iaxis) .EQ. 'NA' .AND. vlen .EQ. 1) THEN
+         IF ( vupcase(1:1) .EQ. 'X') line_direction(iaxis) = 'XX'
+         IF ( vupcase(1:1) .EQ. 'Y') line_direction(iaxis) = 'YY'
+         IF ( vupcase(1:1) .EQ. 'Z') line_direction(iaxis) = 'DU'
+         IF ( vupcase(1:1) .EQ. 'T') line_direction(iaxis) = 'TI'
+      ENDIF
+      IF (line_direction(iaxis).EQ.'NA') THEN
+         IF (vupcase(1:3).EQ.'XAX') line_direction(iaxis) = 'XX'
+         IF (vupcase(1:3).EQ.'YAX') line_direction(iaxis) = 'YY'
+         IF (vupcase(1:3).EQ.'ZAX') line_direction(iaxis) = 'DU'
+         IF (vupcase(1:3).EQ.'TAX') line_direction(iaxis) = 'TI'
+      ENDIF
+
+      IF (line_direction(iaxis).EQ.'NA') THEN
+         IF (vupcase(1:3).EQ.'LON') line_direction(iaxis) = 'WE'
+         IF (vupcase(1:3).EQ.'LAT') line_direction(iaxis) = 'SN'
+         IF (vupcase(1:3).EQ.'TIME') line_direction(iaxis) = 'TI'
+         IF (vupcase(1:3).EQ.'DATE') line_direction(iaxis) = 'TI'
+         IF (vupcase(1:3).EQ.'DEP') line_direction(iaxis) = 'UD'
+         IF (vupcase(1:3).EQ.'ALT') line_direction(iaxis) = 'DU'
+         IF (vupcase(1:3).EQ.'ELEV') line_direction(iaxis) = 'DU'
+         IF (vupcase(1:3).EQ.'HEI') line_direction(iaxis) = 'DU'
+         IF (vupcase(1:3).EQ.'LAYER') line_direction(iaxis) = 'DU'
+         IF (vupcase(1:3).EQ.'LEVEL') line_direction(iaxis) = 'DU'
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_missing_flag.F b/fmt/src/cd_get_missing_flag.F
new file mode 100644
index 0000000..a212211
--- /dev/null
+++ b/fmt/src/cd_get_missing_flag.F
@@ -0,0 +1,135 @@
+      SUBROUTINE CD_GET_MISSING_FLAG (cdfid, varid, vname, do_warn, 
+     .        flag, cdfstat)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+
+* Argument declarations
+      LOGICAL do_warn
+      INTEGER cdfid, varid, cdfstat
+      REAL*8 flag
+      CHARACTER*(*) vname
+
+* Local declarations
+      LOGICAL CD_GET_ATTVAL, got_bad, got_missing, scaled, got_it, tf2
+      INTEGER TM_LENSTR1, vartyp, nvdim, vdims(8), nvatts, vlen, i,
+     .        attype
+     
+      REAL missing_flag, bad_flag, scale_factor, add_offset
+
+      cdfstat = merr_ok
+
+* get the vital statistics for this variable
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VAR_(cdfid, varid, vname, vartyp, nvdim, vdims,
+     .                 nvatts)
+#else
+      cdfstat = NF_INQ_VAR (cdfid, varid, vname, vartyp, nvdim, vdims,
+     .                 nvatts)
+#endif
+
+      vlen = TM_LENSTR1(vname)
+
+      got_it = CD_GET_ATTVAL( cdfid, varid, 'scale_factor',
+     .             do_warn,vname(:vlen), scale_factor, 1, cdfstat )
+      tf2    = CD_GET_ATTVAL( cdfid, varid, 'add_offset',
+     .             do_warn,vname(:vlen), add_offset, 1, cdfstat )
+      scaled = got_it .OR. tf2
+
+* netCDF files may use "standard" attributes missing_value and/or
+* _FillValue to flag bad data
+* For the NOAA COOP standard the missing_value flag must be stored in the
+* packed data type.  If so it must be unpacked. 
+
+      got_bad = CD_GET_ATTVAL( cdfid, varid, 'missing_value',
+     .         do_warn, vname(:vlen), bad_flag, 1, cdfstat )
+      got_missing = CD_GET_ATTVAL( cdfid, varid, '_FillValue',
+     .         do_warn, vname(:vlen), missing_flag, 1, cdfstat)
+
+* ... need to unpack the missing_value flag?
+*     (note that the netCDF library insists on _FillValue's data type)
+
+      IF ( vartyp.LE.NF_INT .AND. scaled ) THEN
+         IF ( got_bad ) THEN
+#ifdef usingDODSf2cUnderscore
+	     cdfstat = NF_INQ_ATT_(cdfid, varid, 'missing_value', 
+     .             attype, i )
+#else
+	     cdfstat = NF_INQ_ATT (cdfid, varid, 'missing_value', 
+     .             attype, i )
+#endif
+		IF ( attype .EQ. vartyp ) bad_flag =
+     .			bad_flag*scale_factor+ add_offset
+	     ENDIF
+
+* ... *kob* Also need to see about unpacking _FillValue
+
+         IF ( got_missing ) THEN
+#ifdef usingDODSf2cUnderscore
+	        cdfstat = NF_INQ_ATT_(cdfid, varid, '_FillValue',
+     .             attype, i )
+#else
+	        cdfstat = NF_INQ_ATT(cdfid, varid, '_FillValue',
+     .             attype, i )
+#endif
+	        IF ( attype .EQ. vartyp ) missing_flag =
+     .			missing_flag*scale_factor+ add_offset
+	     ENDIF
+      ENDIF
+
+*  Return missing flag if it exists, else bad_flag
+
+      IF (got_missing) THEN
+         flag =  missing_flag
+      ELSE 
+         IF ( got_bad ) THEN
+            flag =  bad_flag
+         ELSE
+            flag = 0.
+            cdfstat = 0
+         ENDIF
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_parent_grids.F b/fmt/src/cd_get_parent_grids.F
new file mode 100644
index 0000000..ec411d3
--- /dev/null
+++ b/fmt/src/cd_get_parent_grids.F
@@ -0,0 +1,231 @@
+	SUBROUTINE CD_GET_PARENT_GRIDS (dset,temp_axnams,status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Loads the common block XGRID with explicitly given grid definitions from a
+* netCDF file - i.e. grid definitions for variables that have a
+* "parent_grid = name" attribute
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92 - adds a new data set format to TMAP libraries
+*              - based on TM_READ_GRIDFILE
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V500: 4/99 *kob* - increase size of temp_axnams and vname to 64
+* V510 *sh* 3/00 - convert to use of dynamic grids and axes
+* V552 *acm* 5/03   increase vnameto 128 chars 
+* V600 *ACM* attribute control. 
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from 
+*               linked list structure
+*             CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*               strings or real values according to attrib type
+*             Replace NCINQ with NCF_INQ_DS
+*             Replace NCVINQ for variables, with CD_GET_VAR_INFO
+*             Replace NCDINQ with CD_GET_DS_DIMS
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* TODO: initially leave this as 4D -- what to do with old files that have 4 slab min/max?
+
+* argument definitions:
+*	dset	       - Ferret dataset number for already opened CDF file
+*       temp_axnams    - 4 axis names per grid: temp until grids are assembled
+*	status	       - return status
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xbuild_grids.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xio.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+		include 'xunits.cmn_text'
+	external xunits_data
+
+* argument declarations
+	INTEGER	 dset, status
+* 4/99 *kob*
+        CHARACTER*128 temp_axnams(nferdims,max_temp_grid)
+
+* local parameter definitions:
+      INTEGER     str_eq
+      PARAMETER ( str_eq = 0 )
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      LOGICAL NC_GET_ATTRIB, 
+     .        got_it, do_warn, centers, coordvar
+      PARAMETER (do_warn = .TRUE. ) 
+      PARAMETER (centers = .TRUE. )
+      INTEGER TM_LENSTR1,
+     .        STR_CASE_BLIND_COMPARE, STR_UPCASE, NCF_INQ_DS,
+     .        ndims, nvars, ngatts, recdim, igrid, 
+     .        ivar, vartyp, nvdims, vdims(8), nvatts, vlen,
+     .        grid_cnt, istat, idim, npts, maxlen, attlen,
+     .        attoutflag, all_outflag, dset_num
+      REAL    tmp
+* 4/99 *kob*
+      CHARACTER vname*128, words(8)*24
+      CHARACTER*132 TM_CMPRSS, buff
+      CHARACTER*1024 cbuff
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* get the vital statistics for the data set 
+
+        dset_num = dset
+        IF (dset_num .LT. -2) dset_num = -2
+        istat = NCF_INQ_DS (dset_num, ndims, nvars, ngatts, recdim )
+
+        IF ( istat .NE. merr_ok ) CALL TM_ERRMSG
+     .     ( istat+pcdferr, status, 'CD_GET_PARENT_GRIDS', dset,
+     .        no_varid, no_errstring, no_errstring, *5900 )
+
+* * * * loop through all variables in the net CDF file * * *
+        DO 500 ivar = 1,nvars
+      
+* get the vital statistics about this variable
+
+           CALL CD_GET_VAR_INFO (dset, ivar, vname, vartyp, nvdims,
+     .                 vdims, nvatts, coordvar, all_outflag, istat)
+           IF ( istat .NE. merr_ok ) CALL TM_ERRMSG
+     .     ( istat+pcdferr,status,'CD_GET_PARENT_GRIDS',dset,ivar,
+     .       no_errstring, no_errstring, *5900 )
+           vlen = TM_LENSTR1(vname)
+
+* is it a definition for a parent grid ? (1D based on 'grid_definition' )
+          IF ( nvdims .NE. 1 ) GOTO 500
+
+          CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts, istat)
+
+          istat = STR_CASE_BLIND_COMPARE('grid_definition', buff(:15) )
+          IF ( istat .NE. str_eq ) GOTO 500
+
+* find next location to store info; if too many grids - give error
+	  CALL TM_ALLO_TMP_GRID(igrid, status)
+	  IF (status .NE. merr_ok) GOTO 5900
+
+* get the mandatory list of axis names for this grid
+          maxlen = 132
+          got_it = NC_GET_ATTRIB( dset, ivar, 'axes', do_warn, 
+     .                          vname(:vlen), maxlen, attlen, 
+     .                          attoutflag, buff, tmp)
+          IF ( .NOT.got_it ) THEN
+             CALL TM_NOTE(
+     .            '"axes" attribute missing from grid definition', tt)
+             CALL TM_NOTE('grid defintion ignored: '//vname(:vlen), tt)
+             GOTO 500
+          ENDIF
+
+* store grid name (upper case)
+          istat = STR_UPCASE( grid_name(igrid), vname )
+
+* parse the list and store the axis names in the temporary grid definition
+	  grid_cnt = num_tmp_grids    ! temporary name holder pointer
+	  cbuff = TM_CMPRSS(buff)
+	  DO 180 idim =1, 4
+ 180      words(idim) = ' '
+	  CALL TM_BREAK_STR(cbuff, words, 4)
+          DO 185 idim = 1, 4
+ 185      istat = STR_UPCASE( temp_axnams(idim,grid_cnt), words(idim) )
+
+* flag the axes that are normal in the grid so grid associations can be made
+          DO 186 idim = 1, 4
+             IF ( temp_axnams(idim,grid_cnt) .EQ. 'NORMAL' ) THEN
+                grid_line(idim, igrid) = mpsnorm
+             ELSE
+                grid_line(idim, igrid) = unspecified_int4
+             ENDIF
+ 186      CONTINUE
+
+* get optional rotation parameter (not a string parameter)
+          maxlen = 1
+          got_it = NC_GET_ATTRIB( dset, ivar,  'rotation', do_warn, 
+     .                          vname(:vlen), maxlen, attlen, attoutflag, 
+     .                          buff, grid_rotation(igrid))
+
+          IF ( got_it .AND. grid_rotation(igrid).NE.0.0) THEN
+             CALL TM_NOTE ('rotated grids not supported - using 0.0: '
+     .                      //vname(:vlen), tt)
+             grid_rotation(igrid) = 0.0
+          ELSE
+             grid_rotation(igrid) = 0.0    ! default
+          ENDIF
+
+* get optional inner/outer product list
+          maxlen = 132
+          got_it = NC_GET_ATTRIB( dset, ivar, 'axis_assn', do_warn, 
+     .                        vname(:vlen), maxlen, attlen, attoutflag, 
+     .                        buff, tmp)
+          IF ( got_it ) THEN
+* ... parse the inner/outer list and store it in the grid definition
+	     cbuff = TM_CMPRSS(buff)
+	     DO 190 idim =1, 4
+ 190         words(idim) = ' '
+	     CALL TM_BREAK_STR(cbuff, words, 4)
+             DO 200 idim = 1, 4
+                istat = STR_CASE_BLIND_COMPARE('OUTER',words(idim))
+                IF ( istat .EQ. str_eq ) THEN
+                   grid_out_prod(idim,igrid) = .TRUE.
+                ELSE
+                   CALL TM_NOTE ('inner product grids not supported: '
+     .                         //vname(:vlen), tt )
+                   grid_out_prod(idim,igrid) = .TRUE.
+                ENDIF
+ 200         CONTINUE
+          ELSE
+             DO 210 idim = 1, 4
+ 210         grid_out_prod(idim,igrid) = .TRUE.    ! default
+          ENDIF
+
+ 500    CONTINUE
+
+* successful completion
+ 	status = merr_ok
+        RETURN
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_get_time_axis.F b/fmt/src/cd_get_time_axis.F
new file mode 100644
index 0000000..9ea6093
--- /dev/null
+++ b/fmt/src/cd_get_time_axis.F
@@ -0,0 +1,123 @@
+	SUBROUTINE CD_GET_TIME_AXIS(dset, recdim, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine the designated "time axis" for this data set
+* and save its lo/hi limits in stepfile common
+* This is needed for compatibility with GT and TS formats
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*
+* 7/95 *kob* - added check for MC dataset to prevent clobbering of
+*	       stepfile time data already stored
+* 4/03 *acm* - Use STR_SAME to compare strings
+
+* argument definitions:
+*       dset        - TMAP data set pointer
+*       recdim      - orientation of "time axis" (usually t_dim)
+*	status	    - return status
+
+* include files
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+        include 'xdset_info.cd_equiv'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+
+* argument declarations
+	INTEGER	 dset, recdim, status
+
+* local variable declarations:
+      REAL*8  TM_WORLD
+      INTEGER STR_SAME, tmvar, istep, grid, taxis
+
+* locate the step file that belongs to this data set
+      DO 100 istep = 1,maxstepfiles
+         IF (sf_setnum(istep) .EQ. dset) GOTO 190
+ 100  CONTINUE
+* No step file allocated
+      RETURN    ! can never happen
+      
+* locate the first variable with a valid time axis.  This will be 
+* regarded as THE time axis for the data set
+ 190  DO 200 tmvar = 1,maxvars
+        IF ( ds_var_setnum(tmvar) .NE. dset ) GOTO 200
+        grid = ds_grid_number( tmvar )
+        taxis = grid_line(t_dim, grid)
+        IF ( taxis .NE. mpsnorm ) GOTO 300
+ 200  CONTINUE
+
+* no variables with time axes in the data set
+* *kob* 12/00 no need to do the below for MC datasets
+
+      IF ( STR_SAME(ds_type(dset), '  MC') .NE. 0 ) THEN
+	 ds_time_axis(dset) = mpsnorm 
+	 sf_1step(istep)    = unspecified_val8
+	 sf_lastep(istep)   = unspecified_val8
+      ENDIF
+      GOTO 1000
+
+* save the time axis and its limits
+* add check for MC datasets....their sf_1step and sf_lastep are already
+* set...dont want to clobber them
+ 300  IF ( STR_SAME(ds_type(dset), '  MC') .NE. 0) then
+         ds_time_axis(dset) = taxis
+         sf_1step(istep)    = TM_WORLD( ds_grid_start(t_dim,tmvar),
+     .                               grid, recdim, box_lo_lim )
+         sf_lastep(istep)   = TM_WORLD( ds_grid_end(t_dim,tmvar),
+     .                               grid, recdim, box_hi_lim )
+      ENDIF
+
+* successful completion
+ 1000   status = merr_ok
+        RETURN
+
+* error(s)
+* 5000   RETURN
+* 5100   CALL TM_ERRMSG ( merr_varform, status, 'CD_GET_TIME_AXIS',
+*     .       unspecified_int4, unspecified_int4,
+*     .       'no variables in netCDF file', no_errstring, *5000 )
+	END
diff --git a/fmt/src/cd_get_tmap_parms.F b/fmt/src/cd_get_tmap_parms.F
new file mode 100644
index 0000000..070843b
--- /dev/null
+++ b/fmt/src/cd_get_tmap_parms.F
@@ -0,0 +1,165 @@
+	SUBROUTINE CD_GET_TMAP_PARMS ( dset, cdfid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read special TMAP global attributes from the open netCDF file
+* these attributes are:
+* TMAP_expnum = "0056"
+* TMAP_slice = "  SA"
+* TMAP_source = "PHIL/SEIG"
+* TMAP_subsource = "TROPICAL PACIFIC"
+* TMAP_**anything_else**  = auxiliary parameter
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V600 *ACM* attribute control. 
+*             Replace NCINQ with NCF_INQ_DS
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib 
+*             from linked list structure
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*       cdfid   - returned pointer to open CDF file
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, cdfid, dset_num, status
+
+* include files
+
+
+        include 'netcdf.inc'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xio.cmn_text'
+        external xio_data
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      LOGICAL NC_GET_ATTRIB, got_it, do_warn
+      PARAMETER (do_warn = .TRUE.)
+
+      INTEGER NCF_INQ_DS,
+     .        nparm, iatt,  ndims, nvars, ngatts, recdim, 
+     .        i, varid, maxlen, attlen, attoutflag
+      CHARACTER*13 TM_STRING
+      CHARACTER    name*128, tmap_att*128, buff*2048
+      REAL vals(10)
+
+      INTEGER tt                ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* initialize
+        nparm = 0
+        DO 10 i = 1, num_parm
+           ds_parm_name(i, dset) = ' '
+           ds_parm_text(i, dset) = ' '
+ 10     CONTINUE
+	ds_source_class(dset)	= ' '
+	ds_source(dset)		= ' '
+	ds_subsource(dset)	= ' '
+	ds_expnum(dset)		= ' '
+	ds_modnum(dset)		= ' '
+
+* get number of global attributes from stored linked list structure
+
+        dset_num = dset
+        IF (dset_num .LT. -2) dset_num = -2
+        status = NCF_INQ_DS (dset_num, ndims, nvars, ngatts, recdim )
+
+* get global attribute pseudo-variable id
+
+        IF (ngatts .GT. 0) THEN
+           CALL CD_GET_VAR_ID (dset, '.', varid, status)
+
+* loop through global attributes looking for ones beginning with TMAP
+           DO 100 iatt = 1, ngatts
+
+* get global attribute name
+              name = ' '
+              CALL CD_GET_VAR_ID (dset, '.', varid, status )
+              CALL CD_GET_VAR_ATT_NAME( dset, varid, iatt, name, status)
+              IF ( name(:5) .NE. 'TMAP_' ) GOTO 100
+
+* get its value
+              maxlen = 2048
+              got_it = NC_GET_ATTRIB ( dset, varid, name, do_warn, 
+     .                      '.', maxlen, attlen, attoutflag, 
+     .                      buff, vals)
+
+* what is it ?
+              tmap_att = name(6:)
+              IF ( tmap_att(:6) .EQ. 'expnum' ) THEN
+                 ds_expnum(dset) = buff
+              ELSEIF ( tmap_att(:5) .EQ. 'slice' ) THEN    ! "modnum" in GT sets
+                 ds_modnum(dset) = buff
+              ELSEIF ( tmap_att(:6) .EQ. 'source' ) THEN
+                 ds_source(dset) = buff
+              ELSEIF ( tmap_att(:9) .EQ. 'subsource' ) THEN
+                 ds_subsource(dset) = buff
+              ELSE
+                 nparm = nparm + 1
+                 IF ( nparm .GT. num_parm ) GOTO 5100
+                 ds_parm_name(nparm, dset) = tmap_att
+                 ds_parm_text(nparm, dset) = buff
+              ENDIF
+
+ 100       CONTINUE
+        ENDIF
+
+* successful completion
+ 1000   status = merr_ok
+        RETURN
+
+* error exit
+ 5100      CALL TM_NOTE( 'maximum number of TMAP CDF attributes '
+     .          //'exceeded: '//TM_STRING(DBLE(num_parm)), tt )
+           GOTO 1000   ! not fatal
+ 5200      CALL TM_NOTE( 'dataset not found', tt )
+           RETURN
+
+           END
diff --git a/fmt/src/cd_get_var_att_id.F b/fmt/src/cd_get_var_att_id.F
new file mode 100644
index 0000000..4e25e97
--- /dev/null
+++ b/fmt/src/cd_get_var_att_id.F
@@ -0,0 +1,123 @@
+      SUBROUTINE CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset, variable id, and attribute name return attribute id
+* Test the attribute name in a case-insensitve manner.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+*      6/06 *acm* missing declarations of ncf functions
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+#include "gt_lib.parm"
+      INCLUDE "tmap_errors.parm"
+
+* Argument declarations
+
+      CHARACTER*(*) attname
+      INTEGER dset, varid, attid, status
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      CHARACTER*512 abuff
+      LOGICAL coordvar
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ID, NCF_GET_VAR_ATTR_ID, 
+     .        NCF_GET_VAR_ATTR_ID_CASE, STR_SAME, 
+     .        slen, flen, dset_num
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      attid = 0
+      status = atom_not_found
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      abuff = ""
+      abuff = attname
+
+      slen = TM_LENSTR1( abuff )
+
+* If the name is a pseudo-name for describing attributes then return attid=0.
+* If a file contains one of these names as an attribute, it can be accessed
+* by putting it in quotes.
+
+      IF (STR_SAME(abuff(:slen), 'varnames') .EQ. 0 ) THEN
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'nvars') .EQ. 0 ) THEN
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'attnames') .EQ. 0 ) THEN 
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'nattrs') .EQ. 0 ) THEN
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'dimnames') .EQ. 0 ) THEN
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'ndims') .EQ. 0 ) THEN
+         RETURN
+      ELSE IF (STR_SAME(abuff(:slen), 'nctype') .EQ. 0 ) THEN
+         RETURN
+      ENDIF
+
+* If the name is in quotes, remove them and do a case-sensive search
+* for the name.
+
+      slen = TM_LENSTR1( abuff )
+      IF (abuff(1:1) .EQ. "'" .AND. abuff(slen:slen) .EQ. "'" ) THEN
+         abuff = abuff(2:slen-1)
+         abuff(slen-1:slen) = ""
+         slen = slen - 2
+         CALL TM_FTOC_STRNG( abuff(1:slen), fhol, flen )
+         status = NCF_GET_VAR_ATTR_ID_CASE(dset_num, varid, fhol, attid)
+      ELSE 
+         CALL TM_FTOC_STRNG( abuff(1:slen), fhol, flen )
+         status = NCF_GET_VAR_ATTR_ID(dset_num, varid, fhol, attid)
+      ENDIF
+      
+      dset = dset_num  ! if changed above, then dset=-1 is correct
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_get_var_att_info.F b/fmt/src/cd_get_var_att_info.F
new file mode 100644
index 0000000..e29d67b
--- /dev/null
+++ b/fmt/src/cd_get_var_att_info.F
@@ -0,0 +1,84 @@
+      SUBROUTINE CD_GET_VAR_ATT_INFO (dset, varid, attid, attname, attype, 
+     .     attlen, attoutflag, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset, varid, and attid, return attribute name, type, and dimensions
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602 2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V604 6/07 *acm* Translate attname to hollerith before NCF_INQ_VAR_ATT 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname
+      INTEGER dset, varid, attid, attype, attlen, attoutflag, 
+     .        slen, status
+
+* Internal declarations
+
+c        include 'netcdf.inc'
+         include 'tmap_errors.parm'
+
+      INTEGER TM_LENSTR1, NCF_INQ_VAR_ATT,
+     .        i, dset_num, alen, flen
+
+      PARAMETER (flen=128)      ! size of attribute name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      DO i = 1, flen
+         fhol(i) = 0
+      ENDDO
+
+      status = NCF_INQ_VAR_ATT(dset_num, varid, attid, fhol, alen, attype, 
+     .    attlen, attoutflag)
+
+      attname = ' '
+      IF (status .EQ. merr_ok) CALL TM_CTOF_STRNG (fhol, attname, alen)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_var_att_name.F b/fmt/src/cd_get_var_att_name.F
new file mode 100644
index 0000000..94780bd
--- /dev/null
+++ b/fmt/src/cd_get_var_att_name.F
@@ -0,0 +1,74 @@
+      SUBROUTINE CD_GET_VAR_ATT_NAME (dset, ivar, iatt, attname, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset, ivar, iatt return attribute name
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+
+* Argument declarations
+
+      CHARACTER*(*) attname
+      INTEGER dset, ivar, iatt, alen, status
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+      INTEGER NCF_GET_VAR_ATTR_NAME, flen, dset_num
+
+      PARAMETER (flen=128)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      status = NCF_GET_VAR_ATTR_NAME(dset_num, ivar, iatt, alen, fhol)
+      attname = ' '
+      
+      IF (status .EQ. merr_ok) CALL TM_CTOF_STRNG (fhol, attname, alen)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_get_var_id.F b/fmt/src/cd_get_var_id.F
new file mode 100644
index 0000000..4da2935
--- /dev/null
+++ b/fmt/src/cd_get_var_id.F
@@ -0,0 +1,145 @@
+      SUBROUTINE CD_GET_VAR_ID (dset, vname, varid, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset and variable name return variable id
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+*      6/06 *acm* missing declarations of ncf functions
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+*           *acm* Get rid of call to isit_coord_var, which could get us in 
+*                 an endless loop (isit_coord_var calls cd_get_var_id).
+* V611  5/08 *acm* Fix bug 1578, dataset specifier on the variable var[d=1].attr
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+#include "gt_lib.parm"
+      INCLUDE "tmap_errors.parm"
+
+* Argument declarations
+
+      CHARACTER*(*) vname
+      INTEGER dset, varid, status
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      CHARACTER*512 buff
+      LOGICAL coordvar
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ID, NCF_GET_VAR_ID_CASE,
+     .        NCF_GET_VAR_AXFLAG, slen, flen, dir, dset_num, bkt1, bkt2
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      varid = 0
+      status = atom_not_found
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      buff = vname
+
+* Deal with coordinate variable names inside parenthese
+
+      IF (vname(1:1) .EQ. '(' ) THEN
+         slen = INDEX(buff,')') - 1 
+         IF (slen .LE. 0) slen = TM_LENSTR1(buff)
+         buff = vname(2:slen)
+         buff(slen:slen) = ""
+         slen = slen - 1
+       
+         CALL TM_FTOC_STRNG( buff(1:slen), fhol, flen )
+         status = NCF_GET_VAR_ID(dset_num, varid, fhol)
+         IF (status.NE.merr_ok .AND.
+     .       INDEX(vname,'[') .GT. 0) GOTO 4000
+         status = NCF_GET_VAR_AXFLAG (dset, varid, coordvar, dir)
+         IF (.NOT. coordvar) GOTO 5000
+
+* If theres also a dataset spec (xax)[d=1] on the orig variable name, 
+* add that
+ 4000    CONTINUE
+         IF ( INDEX(vname,'[') .GT. 0 ) THEN
+            bkt1 = INDEX(vname, '[')
+            bkt2 = INDEX(vname, ']')
+            slen = TM_LENSTR1(buff)
+            buff = buff(1:slen)//vname(bkt1:bkt2)
+         ENDIF
+
+      ENDIF 
+       
+* If there is a dataset spec, see if the variable is in that dataset.
+
+      IF ( INDEX(buff,'[') .GT. 0 ) THEN
+         CALL CD_ISIT_ANOTHER_DSET (buff, dset_num, buff, status)
+         IF (status .NE. merr_ok) THEN 
+      
+            IF ( INDEX(vname,'[') .GT. 0 ) THEN
+               bkt1 = INDEX(vname, '[')
+               bkt2 = INDEX(vname, ']')
+               buff = buff//vname(bkt1:bkt2)
+               CALL CD_ISIT_ANOTHER_DSET (buff, dset_num, buff, status)
+            ENDIF
+         ENDIF
+         IF (status .NE. merr_ok) GOTO 5000
+      ENDIF
+
+* If the name is in quotes, remove them and do a case-sensive search
+* for the name.
+
+      slen = TM_LENSTR1( buff )
+      IF (buff(1:1) .EQ. "'" .AND. buff(slen:slen) .EQ. "'" ) THEN
+         buff = buff(2:slen-1)
+         buff(slen-1:slen) = ""
+         slen = slen - 2
+       
+         CALL TM_FTOC_STRNG( buff(1:slen), fhol, flen )
+         status = NCF_GET_VAR_ID_CASE(dset_num, varid, fhol)
+      ELSE
+         CALL TM_FTOC_STRNG( buff(1:slen), fhol, flen )
+         status = NCF_GET_VAR_ID(dset_num, varid, fhol)
+      ENDIF
+      dset = dset_num
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_get_var_info.F b/fmt/src/cd_get_var_info.F
new file mode 100644
index 0000000..ab104e5
--- /dev/null
+++ b/fmt/src/cd_get_var_info.F
@@ -0,0 +1,106 @@
+      SUBROUTINE CD_GET_VAR_INFO (dset, ivar, vname, vartype, 
+     .            nvdims, vdims, nvatts, coordvar, outflag, cdfstat)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: given
+* dset and ivar return variable name (in its original upper/lowercase 
+* form), type, dimensions, number of attributes
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+* Argument declarations
+
+      CHARACTER*(*) vname
+      INTEGER dset, ivar, vartype, nvdims, vdims(*), nvatts, 
+     .        outflag, cdfstat, dset_num
+      LOGICAL coordvar
+
+* Internal declarations
+
+#include "gt_lib.parm"
+      INCLUDE 'netcdf.inc'
+
+      INTEGER TM_LENSTR1, NCF_INQ_VAR, slen, flen, rev(8), i, ndx, istat
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      nvdims = 0
+      nvatts = 0
+      coordvar = .FALSE.
+      cdfstat = atom_not_found
+
+      IF (dset .EQ. unspecified_int4) RETURN
+      IF (ivar .LT. 0) RETURN
+
+      slen = TM_LENSTR1( vname )
+      CALL TM_FTOC_STRNG( vname(1:slen), fhol, flen )
+
+      dset_num = dset
+      cdfstat = NCF_INQ_VAR(dset_num, ivar, fhol, slen, vartype, 
+     .            nvdims, nvatts, coordvar, outflag, rev)
+      slen = MIN(slen, flen)
+
+* Return vname in original upper/lower case
+      CALL TM_CTOF_STRNG ( fhol, vname, slen )
+
+* These dims are 0,1,2,3. For Fortran want 1,2,3,4, so add 1
+* Also, the dims are in C order t,z,y,x. Reverse the order, for 
+* opposite array ordering of Fortran vs c
+
+      DO 100 i = 1, nvdims
+	  ndx = nvdims - i + 1
+	  vdims(i) = rev(ndx) + 1
+ 100  CONTINUE   
+
+5000  RETURN
+      END
+
+c   for (i=0; i <var_ptr->ndims ;i++ )
+c  {
+c	  ndx = var_ptr->ndims - i - 1; 
+c	  the_dim =  var_ptr->dims[i];
+c	  vdims[ var_ptr->ndims - i - 1] = the_dim + 1;
+c  }
diff --git a/fmt/src/cd_get_var_outflag.F b/fmt/src/cd_get_var_outflag.F
new file mode 100644
index 0000000..dd03ae4
--- /dev/null
+++ b/fmt/src/cd_get_var_outflag.F
@@ -0,0 +1,66 @@
+      SUBROUTINE CD_GET_VAR_OUTFLAG (dset, varid, iflag, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset and variable id return its outflag for outputting attributes
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 12/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+
+* include files
+#include "gt_lib.parm"
+      INCLUDE "tmap_errors.parm"
+
+* Argument declarations
+
+      INTEGER dset, varid, iflag
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      INTEGER NCF_GET_VAR_OUTFLAG, dset_num, status
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_GET_VAR_OUTFLAG(dset_num, varid, iflag)
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_get_var_outtype.F b/fmt/src/cd_get_var_outtype.F
new file mode 100644
index 0000000..d29c131
--- /dev/null
+++ b/fmt/src/cd_get_var_outtype.F
@@ -0,0 +1,71 @@
+      SUBROUTINE CD_GET_VAR_OUTTYPE (dset, varid, outtype, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset and variable id return its output type
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 2/06 *acm* Attribute control.
+* V602 2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V62+ 5/09 *acm* Fix bug 1664, initialize outtype = 0 so we dont get an
+*                 incorrect type for user variables.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+#include "gt_lib.parm"
+      INCLUDE "tmap_errors.parm"
+
+* Argument declarations
+
+      INTEGER dset, varid, outtype
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      INTEGER NCF_GET_VAR_OUTTYPE, dset_num, status
+
+* Initialize
+
+      outtype = 0
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_GET_VAR_OUTTYPE(dset_num, varid, outtype)
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_init_agg_dset.F b/fmt/src/cd_init_agg_dset.F
new file mode 100644
index 0000000..8cee40c
--- /dev/null
+++ b/fmt/src/cd_init_agg_dset.F
@@ -0,0 +1,74 @@
+	SUBROUTINE CD_INIT_AGG_DSET (dset, dname, status)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize an aggregate dataset in linked list structure.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*       name    - string, name of the dataset
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, status
+	CHARACTER*(*) dname
+
+
+* local variable declarations:
+	INTEGER NCF_INIT_AGG_DSET, TM_LENSTR1
+	INTEGER llen, slen1, slen2
+	PARAMETER (slen1=2048)      ! size of ds_name string
+
+#ifdef sun
+	BYTE      fhol_dsname(slen1)      ! c-type Hollerith string buffer
+#else
+	INTEGER*1 fhol_dsname(slen1)      ! c-type Hollerith string buffer
+#endif
+
+* Save dataset info in GLOBAL_NCdsetList for attribute handling
+
+	llen = TM_LENSTR1( dname )
+	CALL TM_FTOC_STRNG( dname(1:llen), fhol_dsname, slen1 )
+	status = NCF_INIT_AGG_DSET (dset, fhol_dsname) 
+
+* successful completion
+	
+	RETURN
+	END
diff --git a/fmt/src/cd_init_dset.F b/fmt/src/cd_init_dset.F
new file mode 100644
index 0000000..bd1b7f1
--- /dev/null
+++ b/fmt/src/cd_init_dset.F
@@ -0,0 +1,189 @@
+	SUBROUTINE CD_INIT_DSET ( dset, perm, tregular, use_strict, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize a netCDF file so it behaves like a TMAP GT or TS data set
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* 2/95 - added support for reverse-ordered coordinate axes
+* *sh* 11/12/96 - changes to accomodate caching of DODS data 
+* Linux Port - 6/97 *kob*  - use a cpp include for tmap_dset.parm
+* argument definitions:
+*    dset   - pointer to TMAP data set
+*    status - return status
+* 11/97 *kob* - added a close on the cdfid for the netcdf file for
+*               mc datasets only.  
+* 4/98 *kob* - need to explicitely declare istat
+* 5/98 *kob* - make sure that the sf_lunit is reset to file_not_open
+*              when cdf file is closed - for mc datasets only
+* V500 *sh* 3/99 - consolidated cd_scan_vars and cd_get_axes
+*     *kob* 4/99 - increase size of temp_axnams to 64
+*     *sh*  6/99 - added "perm" (permutation) argument
+* V510 *sh* 3/00 - added tregular argument
+*	    3/00 - convert to using dynamic grids and axes
+* 4/03 *acm* - Use STR_SAME to compare strings
+* V600 *acm* 6/05 - Attribute control. Get information from linked-list structure.
+* V601 *acm* 6/06 - Fix bug 1459: when closing a stepfile that may be open,
+*                   reset the sf_lunit flag for cd_stepfile(dset), not for dset.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V68  *acm* 1/12- added use_strict argument for ticket 1910: micro-adjusting on 
+*                  repeated coordinates in netCDF/OPeDNAP datasets
+
+
+* include files
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+#	include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+        include 'xbuild_grids.cmn'
+* add below *kob* 5/98
+	include 'xstep_files.cmn_text'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+
+* argument declarations:
+	LOGICAL tregular, use_strict
+	INTEGER	dset, perm(*), status
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+        INCLUDE 'netcdf.inc'
+#include "netcdf_declareUnderscore.inc"
+
+
+* local variable declarations:
+      INTEGER STR_SAME, cdfid, remote_dods_id,istat
+* 4/99 *kob* increase temp_axnams
+      CHARACTER*128 temp_axnams(nferdims,max_temp_grid)
+      LOGICAL reversed(max_lines:line_ceiling), shifted
+
+* open the netCDF data file and save global information
+      CALL CD_OPEN_DSET ( dset, cdfid, remote_dods_id, status )
+      IF ( status .NE. merr_ok ) GOTO 5990
+
+* Save netcdf file attribs in linked list structure
+
+      CALL CD_STORE_DSET_ATTRS ( dset, cdfid, status )
+      IF ( status .NE. merr_ok ) GOTO 5990
+
+* Use the dataset/variable/attribute data structure to load what was
+* previously done in cd_open_dset.
+
+      CALL CD_LOAD_DSET_ATTRS (dset, cdfid, status)
+
+* get "TMAP" special parameters
+      CALL CD_GET_TMAP_PARMS ( dset, cdfid, status )
+      IF ( status .NE. merr_ok ) GOTO 5980
+
+* read through the netCDF variables to read variable attributes
+* and  load the TMAP axes
+      CALL CD_SCAN_VARS( dset, cdfid, reversed, tregular, use_strict, status )
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* build grids for variables w/out parent grids and associate with variables
+      CALL CD_GET_GENERIC_GRIDS (dset,cdfid,temp_axnams,reversed,
+     .				 perm, status)
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* build grids for variables with parent grids
+      CALL CD_GET_PARENT_GRIDS (dset,temp_axnams,status)
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* associate the parent grids with data set variables      
+      CALL CD_ASSOC_GRIDS (dset, reversed, temp_axnams, status)
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* replace name linkages between axes and grids with pointers.  Delete dups
+
+      CALL CD_CLEAN_GRIDS ( dset, cdfid, temp_axnams, status )
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+      CALL CD_CONSISTENT_AXIS_ORIENT (dset, reversed, perm, status)
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* set use counts and clean up temporary grids and axes
+      CALL TM_GARB_COL_GRIDS (dset)
+
+* summarize the special axes in the data set
+      CALL CD_GET_TIME_AXIS( dset, t_dim, status )
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* if using a DODS cache then create the illusion of remote access
+      IF (remote_dods_id .NE. -1) THEN
+         CALL CD_DODS_CONTROL( dset, cdfid, remote_dods_id, status )
+         IF ( status .NE. merr_ok ) GOTO 5900
+      ENDIF
+
+! for multiple files ... maybe
+! *kob* 11/97 - close cdf files which are a part of a multi-file netcdf set
+!* close the netCDF file
+! 5/98 *kob* - reset sf_lunit as well
+! 10/06 *acm*  bug 1459 sf_lunit of the correct stepfile...
+! 11/06 *acm   no... It turns out that sf_lunit is set in cd_load_dset_attrs 
+!              only if the dataset is NOT a mc dataset; it's a "place-holder" 
+!              setting for single-file datasets. sf_lunit should NOT be reset
+!              here for mc datasets at all.
+
+      IF (STR_SAME(ds_type(dset), '  MC') .EQ. 0) THEN
+#ifdef usingDODSf2cUnderscore
+        istat = NF_CLOSE_( cdfid )
+#else
+        istat = NF_CLOSE( cdfid )
+#endif
+c        sf_lunit(dset) = file_not_open
+c        sf_lunit( cd_stepfile(dset) ) = file_not_open
+      ENDIF
+* successful completion
+      status = merr_ok
+      RETURN
+
+* error exit
+ 5900 CALL CD_ABORT_GRIDS
+ 5980 CONTINUE
+#ifdef usingDODSf2cUnderscore
+      IF (remote_dods_id .NE. 0) istat = NF_CLOSE_( remote_dods_id )
+#else
+      IF (remote_dods_id .NE. 0) istat = NF_CLOSE( remote_dods_id )
+#endif
+ 5990 RETURN
+      END
diff --git a/fmt/src/cd_isit_another_dset.F b/fmt/src/cd_isit_another_dset.F
new file mode 100644
index 0000000..a4396c6
--- /dev/null
+++ b/fmt/src/cd_isit_another_dset.F
@@ -0,0 +1,78 @@
+      SUBROUTINE CD_ISIT_ANOTHER_DSET (expression, dset, varname,status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Look for [d=n] within an expression, and reset dset to match the dataset number
+* or name. varname is returned without the [d=] expression.
+
+* V600 6/05 *acm* Attribute control.
+
+	INCLUDE	'ferret.parm'
+	INCLUDE 'errmsg.parm'
+
+* calling argument declarations
+
+      INTEGER dset, status
+      CHARACTER*(*) expression, varname
+
+* local variable declarations
+      INTEGER TM_LENSTR1, slen, elen, llen, ivar, mods_cx, category
+
+      llen = TM_LENSTR1(expression)
+      varname = expression
+
+      IF ( INDEX(expression,'[') .GT. 0 ) THEN
+
+         CALL PARSE_NAM_DSET(expression, cx_last, dset, category, 
+     .                       ivar, mods_cx, status)
+         IF (status .NE. ferr_ok) THEN
+            dset = pdset_irrelevant	! default (not used ...)
+            CALL PARSE_NAM_DSET(expression, cx_last, dset, category, 
+     .                       ivar, mods_cx, status)
+         ENDIF
+         IF (status .NE. ferr_ok) GOTO 5010
+         slen = INDEX(expression,'[') 
+         elen = INDEX(expression,']')
+         varname = expression(1:slen-1)
+         IF (llen .GT. elen) 
+     .      varname = expression(1:slen-1)//expression(elen+1:llen)
+ 
+      ENDIF
+
+5000  RETURN
+
+5010  IF (dset .EQ. pdset_irrelevant .OR. 
+     .       dset .EQ. unspecified_int4) status = ferr_syntax
+
+      RETURN
+      END
diff --git a/fmt/src/cd_isit_epic.F b/fmt/src/cd_isit_epic.F
new file mode 100644
index 0000000..4041e27
--- /dev/null
+++ b/fmt/src/cd_isit_epic.F
@@ -0,0 +1,96 @@
+	LOGICAL FUNCTION CD_ISIT_EPIC ( dset, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if this netCDF file is an EPIC file
+* the following approach is taken to determine if this is an EPIC file:
+* 1) locate one of the axes, "time" or "lat"
+* 2) check for the attribute "epic_code"
+
+* the common variable cd_what_isit is modified only if it is EPIC
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/93
+* V600 *ACM* attribute control. 
+*             Replace NCVID with CD_GET_VAR_ID
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	dset	- dataset pointer for already opened CDF file
+
+* argument declarations
+      INTEGER dset, status
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'tmap_dims.parm'
+      include 'xdset_info.cmn_text'
+      external xdset_info_data
+      include 'xdset_info.cd_equiv'
+
+* internal variable declarations:
+      INTEGER i, axid, attype, attlen, attoutflag, attid
+      INTEGER axnamlen(2)
+      CHARACTER*4 axname(2)
+
+* internal data statements
+      DATA axname(1)/'time'/, axnamlen(1)/4/, 
+     .     axname(2)/'lat' /, axnamlen(2)/3/
+
+* initialize
+      status = merr_ok
+
+* locate an axis that's in the file
+      DO 100 i = 1, 2
+         CALL CD_GET_VAR_ID ( dset, axname(i)(1:axnamlen(i)), 
+     .         axid, status )
+         IF ( axid .GT. 0 ) GOTO 200
+ 100  CONTINUE
+
+* axis not found - it must not be EPIC
+      CD_ISIT_EPIC = .FALSE.
+      RETURN
+
+* check for "epic_code" attribute
+ 200  CALL CD_GET_VAR_ATT_ID (dset, axid, 'epic_code', attid, status)
+
+      CD_ISIT_EPIC =  status .EQ. merr_ok
+
+* successful completion (always)
+      RETURN
+      END
diff --git a/fmt/src/cd_isit_recdim.F b/fmt/src/cd_isit_recdim.F
new file mode 100644
index 0000000..e360fba
--- /dev/null
+++ b/fmt/src/cd_isit_recdim.F
@@ -0,0 +1,137 @@
+	INTEGER FUNCTION CD_ISIT_RECDIM( cdfid, dset, grid, idim,
+     .     mode_upcase_output, keepax_flag, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Is the indicated is the indicated axis of the grid the netCDF record axis?
+* Or can it never become the record axis ?
+* Or are both it and the record axis as-yet undefined?
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/92
+* V500 *kob* 3/99 - up lengths of CD_AXIS_NAME and name to correspond w/ 
+*                   longer line_name
+* V600 *acm* 6/05 - Attribute control. Get information from linked-list structure.
+* V602 *acm*12/06 - Bug 1478: Correct the treatment of uppercasing names.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+* argument definitions:
+*       dset    - dset (if netcdf file, for getting name and attribute 
+*                 info from linked-list structure  
+*       cdfid   - returned pointer to open CDF file
+*       grid    - TMAP grid number
+*       idim    - axis number (1-4)
+*	status	- return status
+
+* argument declarations:
+
+	LOGICAL	mode_upcase_output
+	INTEGER cdfid, dset, grid, idim, keepax_flag, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+        include 'cd_lib.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+      LOGICAL this_ax_exists, recax_exists, coordvar
+      INTEGER ndims, nvars, ngatts, recdim, cdfstat, nlen, dimid,
+     .        varid, vartype, nvdims, vdims(8), nvatts, all_outflag
+      CHARACTER CD_AXIS_OUTNAME*128, CD_AXIS_NAME*128, name*128, name_in*128
+
+* get the axis name
+         name = CD_AXIS_NAME( dset, grid, idim, nlen )
+         IF (keepax_flag .EQ. 1)  name = CD_AXIS_OUTNAME( dset, grid, idim, nlen )
+
+* If mode upcase_output is set, then the axis name
+* has been written to the file upcased.
+
+         IF (mode_upcase_output) THEN
+            name_in = name
+            CALL STR_UPCASE( name, name_in)
+         ENDIF
+
+* is there a dimension by this name?
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_DIMID_( cdfid, name(:nlen), dimid )
+#else
+        cdfstat = NF_INQ_DIMID ( cdfid, name(:nlen), dimid )
+#endif
+
+        this_ax_exists = cdfstat .EQ. NF_NOERR
+
+* get vital statistics of file
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_( cdfid, ndims, nvars, ngatts, recdim )
+#else
+        cdfstat = NF_INQ ( cdfid, ndims, nvars, ngatts, recdim )
+#endif
+!        IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+        recax_exists = recdim .NE. -1
+
+* so what's the answer?
+        IF ( .NOT.(this_ax_exists .OR. recax_exists) ) THEN
+           CD_ISIT_RECDIM = pcdf_undefined    ! both undefined as yet
+        ELSEIF ( this_ax_exists
+     .     .AND. recax_exists
+     .     .AND. (dimid .EQ. recdim) ) THEN
+           CD_ISIT_RECDIM = pcdf_yes          ! both defined and equal
+        ELSE
+           CD_ISIT_RECDIM = pcdf_no           ! at least one exists unequal
+        ENDIF
+
+* successful completion
+ 1000   status = merr_ok
+        RETURN
+
+* error exit
+!5100   CALL TM_ERRMSG
+!    .     ( cdfstat+pcdferr, status, 'CD_USE_RECDIM', cdfid,
+!    .        no_varid, no_errstring, no_errstring, *5900 )
+!5900   RETURN
+	END
diff --git a/fmt/src/cd_load_dset_attrs.F b/fmt/src/cd_load_dset_attrs.F
new file mode 100644
index 0000000..d3cda03
--- /dev/null
+++ b/fmt/src/cd_load_dset_attrs.F
@@ -0,0 +1,252 @@
+	SUBROUTINE CD_LOAD_DSET_ATTRS ( dset, cdfid, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get attribute information from linked lists, and store in TMAP XDSET_INFO common
+* (based on cd_open_dset)
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+* V600 6/05 *acm* Attribute control.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.83 11/12 *acm* If there are multiple global atts including a 
+*                   message attribute, issue the message just once.
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, cdfid, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+#include "tmap_dset.parm"
+	include 'xstep_files.cmn_text'
+        external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xio.cmn_text'
+        external xio_data
+        include 'xdset_info.cd_equiv'
+! kob 7/95
+	include 'xsys_names.cmn_text'	            
+
+
+* local variable declarations:
+      INTEGER TM_HASH_NAME, TM_LENSTR1, STR_SAME,
+     .        ndims, nvars, ngatts, recdim, cdfstat, 
+     .        i, istep, varid, iatt, attlen, attoutflag, maxlen
+      CHARACTER    TM_STRING*13, name*128
+      REAL val
+      LOGICAL CD_ISIT_EPIC, NC_GET_ATTRIB, got_it, do_warn
+      PARAMETER (do_warn = .TRUE. )
+
+#ifdef FORTRAN_90
+	INTEGER HEX40
+	DATA HEX40/Z'40'/
+#endif
+
+* Default contents as per TMAP "Background record"
+* if this is a MC data set, we don't want to reset these values
+        IF (STR_SAME(ds_type(dset), '  MC') .NE. 0) THEN
+		ds_title(dset)		= ' '
+		ds_mod_title(dset)	= ' '
+		ds_forcing_set(dset)	= ' '
+		ds_t0time(dset)		= ' '
+		ds_ntegrate_tstep(dset)	= 1
+		ds_time_run(dset)	= ' '
+		DO 120 i = 1,num_aux
+  120		cd_what_isit(i,dset)= ' '
+	ENDIF
+
+* time axis
+	ds_time_axis(dset) = unspecified_int4
+
+* Load message record
+	ds_alert_on_open(dset) 	= .FALSE.
+	ds_alert_on_output(dset)= .FALSE.
+	ds_message(dset)	= ' '
+
+* initialize incidental variables
+        ds_basic_axes(1,dset) = mpsxt
+        ds_basic_axes(2,dset) = mpsxu
+        ds_basic_axes(3,dset) = mpsyt
+        ds_basic_axes(4,dset) = mpsyu
+        ds_basic_axes(5,dset) = mpszt
+        ds_basic_axes(6,dset) = mpszw
+
+* save the "record" axis
+
+        CALL NCF_INQ_DS (dset, ndims, nvars, ngatts, recdim )
+        ds_time_axis(dset) = recdim
+
+* does it have a (readable) title ?
+
+* get global attribute from linked list structure
+* loop through global attributes looking for title, title_mod
+
+* get global attribute pseudo-variable id
+
+        IF (ngatts .GT. 0) THEN
+           CALL CD_GET_VAR_ID (dset, '.', varid, status)
+
+           DO 100 iatt = 1, ngatts
+
+              name = ' '
+              CALL CD_GET_VAR_ATT_NAME( dset, varid, iatt, name, status)
+
+* *kob* 6/96 - don't do this if we have a mc dataset - title comes
+*	       from the descriptor rather than the cdf file
+
+              IF (STR_SAME(ds_type(dset), '  MC') .NE. 0) THEN
+                 maxlen = LEN(ds_title(dset))
+                 IF (name .EQ. 'title' .OR. name .EQ. 'TITLE')
+     .              got_it = NC_GET_ATTRIB ( dset, varid, name, do_warn, 
+     .                 '.', maxlen, attlen, attoutflag, ds_title(dset), 
+     .                 val)
+              ENDIF
+
+* title modifier ?
+
+              maxlen = LEN(ds_mod_title(dset))
+              IF (name .EQ. 'title_mod' .OR. name .EQ. 'TITLE_MOD')
+     .           got_it = NC_GET_ATTRIB ( dset, varid, name, do_warn, 
+     .              '.', maxlen, attlen, attoutflag, 
+     .              ds_mod_title(dset), val)
+     
+* does it have a message to display upon opening ?
+
+* does it have a message to display upon opening ?
+              ds_alert_on_output(dset) = .FALSE.
+              maxlen = LEN(ds_message(dset))
+              IF (name .EQ. 'message' .OR. name .EQ. 'MESSAGE')
+     .           ds_alert_on_open(dset) = NC_GET_ATTRIB ( dset, varid, 
+     .                    name, do_warn, '.', maxlen, attlen, 
+     .                    attoutflag, ds_message(dset), val)
+  
+* holler the message
+              IF ( ds_alert_on_open(dset) ) THEN
+	         CALL TM_NOTE('regarding '//
+     .	   	   ds_des_name(dset)(:TM_LENSTR1(ds_des_name(dset)))
+     .		   //' ...', lunit_errors)
+	         CALL TM_NOTE(ds_message(dset), lunit_errors)
+		 ds_alert_on_open(dset) = .FALSE.  ! Don't keep hollering for all global atts.
+              ENDIF
+ 100       CONTINUE
+
+        ENDIF  ! ngatts gt 0
+
+* special TMAP parameters ?
+* ... read global attributes beginning with "TMAP"
+
+* Default contents as per TMAP "Format record" (is it EPIC? 3/93)
+* -kob- only set ds_type to cdf if it isn't already set to MC 7/95
+
+        IF ( ds_des_name(dset)(1:7) .EQ. 'http://') THEN
+           ds_type(dset) = 'CDF'
+        ELSEIF ( CD_ISIT_EPIC(dset, status) ) THEN
+           ds_type(dset) = 'ECDF'
+        ELSEIF ( ds_type(dset) .NE. '  MC' ) THEN
+           ds_type(dset) = 'CDF'
+        ENDIF
+	ds_format(dset)	= '  1A'
+
+* "unique" 2 letter code for this data set
+        ds_prog_rev(dset) = ' '
+        i = TM_HASH_NAME( ds_name(dset), 26*26-1 )
+#ifdef FORTRAN_90
+        ds_prog_rev(dset)(1:1) = CHAR( IOR(HEX40,i/26 + 1  ) )
+        ds_prog_rev(dset)(2:2) = CHAR( IOR(HEX40,MOD(i,26) + 1 ) )
+#else
+        ds_prog_rev(dset)(1:1) = CHAR( IOR('40'X,i/26 + 1  ) )
+        ds_prog_rev(dset)(2:2) = CHAR( IOR('40'X,MOD(i,26) + 1 ) )
+#endif
+* Allocate a "step file" slot to save CDF id and filename
+* Find the next storage position for stepfiles in common
+* only if the file is not a multi-file netcdf dataset
+        IF (STR_SAME(ds_type(dset), '  MC') .NE. 0) THEN
+c commented out diagnostic write statements
+c	  write(6,*) 'sf_setnum......',sf_setnum(1)
+c	  write(6,*) 'set_not_open...',set_not_open
+          DO 190 istep = 1,maxstepfiles
+            IF (sf_setnum(istep) .EQ. set_not_open) GOTO 200
+ 190      CONTINUE
+* No room left for new stepfiles
+          GOTO 5200
+
+ 200      sf_lunit ( istep ) = cdfid
+          sf_setnum( istep ) = dset
+          sf_name  ( istep ) = ds_des_name(dset) 
+          cd_stepfile( dset ) = istep    ! step file containing desired data
+          ds_open  ( dset )   = istep    ! which step file is currently open
+	ENDIF
+
+* successful completion
+	status = merr_ok
+	RETURN
+
+* error messages
+ 5100   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_OPEN_DSET', cdfid,
+     .        no_varid, 'is this a CDF file ?', no_errstring, *5900 )
+
+ 5150   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_OPEN_DSET', cdfid,
+     .        no_varid, 'Unable to access remote URL', no_errstring,
+     .		*5900 )
+
+ 5200   CALL TM_ERRMSG ( merr_filim, status, 'CD_OPEN_DSET',
+     .                     dset, no_stepfile,
+     .                     'MAX='//TM_STRING(DBLE(maxstepfiles)),
+     .                     no_errstring, *5900)
+
+*kob* 9/18
+ 5300  CALL TM_ERRMSG (merr_notmounted,status, 'CD_OPEN_DSET',dset,
+     .                     no_stepfile,
+     .                    'No files on-line from data set',
+     .			   no_errstring,
+     .                     *5900)
+* erase any record of tampering with this data set
+ 5900   CALL TM_CLOSE_SET( dset, i )
+
+* error exit
+	RETURN
+	END
diff --git a/fmt/src/cd_make_var.F b/fmt/src/cd_make_var.F
new file mode 100644
index 0000000..5412e1c
--- /dev/null
+++ b/fmt/src/cd_make_var.F
@@ -0,0 +1,516 @@
+	SUBROUTINE CD_MAKE_VAR ( cdfid, dset, varname, type, maxstrlen,
+     .                           grid, lo, hi, recdim, enhead, new, 
+     .                           edges_flag, do_bounds, mode_upcase_output,
+     .                           keepax_flag, netcdf4_type, xchunk_size, 
+     .                           ychunk_size, zchunk_size, tchunk_size, 
+     .                           deflate_lev, shuffle_flag, endian_code,
+     .                           stringdimname, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Define a variable for the current output netCDF file
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92: set into define mode before creating variable
+*  1/25/95 - *sh* added argument enhead.  If NOT enhead then don't call
+*	      cd_make_grid and do make ALL necessary axes when making the
+*	      child axes
+*   11/95 - *sh* use CD_AXIS_NAME rather than line_name for dynamic lines
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+*  5/97 *kob* - had to use DATA rather than PARAMATER statements for character
+* 		strings, ie 'ijkl', for linux f90....
+* v4.91 *kob* - increase size of CD_CHILDAX_NAME,CD_AXIS_NAME lname from
+*               16 to 24
+* v500 *kob*  3/99 - change lengths of CD_CHILDAX_NAME, CD_AXIS_NAME, lname,
+*          cdfname, vname and gname to 64 from 24 to match longer line_name
+* V533 *sh* 6/01 - added support for netCDF output string variables
+*		 - check for consistency of data type on APPEND operations
+* V552 *acm* 5/03   increase vname to 128 chars 
+* V600 *acm* 6/05 - Attribute control. Get information from linked-list structure.
+* V600 *acm* 6/06 - New MODE upcase_output controls whether axis names and variable in
+*                   names are upcased cdf output.
+* V601 *acm* 11/06 - Fix bug 1471; new routine CD_AXIS_OUTNAME gets correct 
+*                    output axis name.
+* V602 *acm*12/06 - Bug 1478: cd_isit_recdim needs mode_upcase_output.
+* V62  *acm*  2/09 - Fix bug 1634: allow SAVE/KEEP_AXISNAMES so that child axis names
+*                    arent written. They can get too long for OPeNDAP library calls
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V66  *acm* 3/10  Settings for NetCDF-4 files. 
+* V66  *acm* 3/10  Check: If chunk size given is larger than grid size in that
+*                  direction, then its an error.
+* V67  *acm* 3/11  Fix bug 1750. Revert to older behavior: if grid uses same axis
+*                  name but different contents, write both to file with the name
+*                  Ferret uses internally.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V685 6/13 *acm* Dont add SAVE/NOCOORDS
+* V686 12/13*acm* For string variables from datasets, keep the string-dimension name and length
+*                 from the original dataset on output.
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     varname - name of variable
+*     type    - data type for variable
+*    maxstrlen- if a string variable, longest string len
+*     grid    - defining grid for variable
+*     lo      - low indices of variable hyperslab
+*     hi      - high indices of variable hyperslab
+*     recdim  - which axis (1-4 or 0) is to be the CDF record axis
+*     enhead  - make enhanced heading?  (with parent grid machinery)
+*     new     - have we just created a new variable ?
+*     netcdf4_type	- netcdf format: 4=netcdf4, 3=netcdf3(=classic), 6=64-bit
+*     xchunk_size     - chunk size in X direction
+*     ychunk_size     - chunk size in Y direction
+*     zchunk_size     - chunk size in Z direction
+*     tchunk_size     - chunk size in T direction
+*     deflate_lev     - deflate_lev level (0 for no deflate_lev)
+*     shuffle_flag    - shuffle - 0 or 1
+*     endian_code     - native=0, little=1, big=0 match nf_endian_* params
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+        include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+	include 'cd_lib.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+		include 'xio.cmn_text'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      LOGICAL enhead, new, edges_flag, mode_upcase_output
+      INTEGER cdfid, dset, type, maxstrlen, grid, lo(nferdims), hi(nferdims),
+     .        recdim, keepax_flag, do_bounds, netcdf4_type, xchunk_size, 
+     .        ychunk_size, zchunk_size, tchunk_size, 
+     .        deflate_lev, shuffle_flag, endian_code, status
+      CHARACTER*(*) varname, stringdimname
+
+* local variable declarations:
+      LOGICAL TM_ABSTRACT_AXIS, CD_USE_RECDIM, 
+     .        itsa_slab, need_child(nferdims), itsa_strvar, name_from_grid(nferdims)
+      INTEGER TM_LENSTR1, CD_ISIT_RECDIM, CD_WRITE_STRDIM,
+     .        dimid(8), iaxis, cdfstat, dims, idim, varid, vartyp,
+     .        nvdims, vdims(8), nvatts, nlen, glen, vlen, ax_type,
+     .        lo2(nferdims), hi2(nferdims), what_recdim, strdim, dimsize,
+     .        chunk_set
+      REAL    val
+* *kob*  - change lengths of CD_CHILDAX_NAME, CD_AXIS_NAME, lname,
+*          cdfname, vname and gname to 64 from 24
+* acm* vname to 128
+      CHARACTER CD_CHILDAX_NAME*128, CD_AXIS_OUTNAME*128, CD_AXIS_NAME*128, 
+     .		lname*128, cdfname*128, vname*128, gname*64, buff*128, 
+     .		DIMDIR*1, TM_FMT*12, c_str*12, d_str*12
+
+      INTEGER dlen, clen
+      INTEGER chunks(nferdims)  
+
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      CHARACTER*1     dimnam(nferdims)
+      CHARACTER*1     ww_dim_nam(nferdims)
+      DATA dimnam/'I', 'J', 'K', 'L', 'M', 'N'/
+      DATA ww_dim_nam/'X', 'Y', 'Z', 'T', 'E', 'F'/
+
+* has the variable already been created ?
+      vname = varname    ! Ultrix f77 is fussy about CHAR*(*) vars
+      vlen = TM_LENSTR1( vname )
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VARID_(cdfid, vname(:vlen), varid)
+#else
+      cdfstat = NF_INQ_VARID(cdfid, vname(:vlen), varid)
+#endif
+
+      itsa_strvar = type .EQ. NF_CHAR
+
+      new = cdfstat .NE. NF_NOERR
+
+
+* already exists: limited consistency check - size of each axis, only
+      IF ( .NOT.new ) THEN
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_VAR_(cdfid, varid, vname, vartyp, 
+     .                 nvdims, vdims, nvatts)
+#else
+         cdfstat = NF_INQ_VAR (cdfid, varid, vname, vartyp, 
+     .                 nvdims, vdims, nvatts)
+#endif
+         IF ( CD_USE_RECDIM( cdfid, varid, status ) ) THEN
+            recdim = t_dim
+         ELSE
+            recdim = 0
+         ENDIF
+         IF ( status .NE. merr_ok ) GOTO 5900
+	 IF (type .NE. vartyp) GOTO 5050
+* ... first dimension of string variable is actually max string len
+	 IF (itsa_strvar) THEN
+	   maxstrlen = vdims(1)
+	   DO 10 idim = 1, 5
+ 10	   vdims(idim) = vdims(idim+1)
+	   nvdims = nvdims - 1
+	 ENDIF
+         dims = 0
+         DO 100 idim = 1, nferdims
+            IF ( grid_line(idim,grid) .EQ. mpsnorm
+     .      .OR. lo(idim) .EQ. unspecified_int4    ) GOTO 100
+            dims = dims + 1
+            IF ( dims .GT. nvdims ) GOTO 5100
+! this check removed to cd_write_var to enable over-writing partial hyperslabs
+!            IF ( idim .NE. recdim ) THEN
+!               npts = CD_AXLEN( cdfid, vdims(dims), status )
+!               IF ( status .NE. merr_ok ) GOTO 5900
+!               IF ( npts .NE. hi(idim)-lo(idim)+1 ) GOTO 5300
+!            ENDIF
+ 100     CONTINUE
+         IF ( dims .NE. nvdims ) GOTO 5100    ! number of dimensions match ?
+         GOTO 1000
+      ENDIF
+
+* if the time axis of this variable has already been created IT will 
+* determine whether this variable uses the record dimension.  The request
+* from the user will be over-ruled
+      what_recdim = CD_ISIT_RECDIM( cdfid, dset, grid, t_dim, 
+     .               mode_upcase_output, keepax_flag, status )
+      IF ( what_recdim .EQ. pcdf_yes ) THEN
+         recdim = t_dim
+      ELSEIF ( what_recdim .EQ. pcdf_no ) THEN
+         recdim = 0
+      ELSE
+* ... the dimension has yet to be defined - user request remains
+         CONTINUE
+      ENDIF
+
+* determine if this variable needs parent/child axes
+      itsa_slab = .FALSE.
+      DO 200 idim = 1, nferdims
+         need_child(idim) = .FALSE.
+         IF ( idim .EQ. recdim ) GOTO 200
+         iaxis = grid_line(idim,grid)
+         IF ( iaxis .EQ. mpsnorm ) GOTO 200
+         IF ( lo(idim) .EQ. unspecified_int4 ) GOTO 200
+         IF ( TM_ABSTRACT_AXIS( iaxis ) ) GOTO 200
+         need_child(idim) = lo(idim) .NE. 1
+     .                 .OR. hi(idim) .NE. line_dim(iaxis)
+         IF ( need_child(idim) ) THEN
+	    itsa_slab = .TRUE.
+	    IF ( enhead .AND.
+     .	     (lo(idim).LT.1 .OR. hi(idim).GT.line_dim(iaxis))) THEN
+		CALL TM_NOTE( 'Modulo '//ww_dim_nam(idim)//
+     .		' axis is incompatible with enhanced netCDF heading'
+     .							,lunit_errors )
+		CALL TM_NOTE( 'Output file may not be readable by FERRET'
+     .							,lunit_errors)
+	    ENDIF
+ 	ENDIF
+ 200  CONTINUE
+
+      IF ( enhead ) THEN
+* create the parent grid needed for this variable
+         CALL CD_WRITE_GRID( cdfid, dset, grid, lo, hi, recdim, itsa_slab,
+     .                       gname,  edges_flag, do_bounds, 
+     .                       mode_upcase_output, keepax_flag, 
+     .                       status )
+         IF ( status .NE. merr_ok ) RETURN
+
+* create child axes where this variable doesn't run full-span on an axis
+         DO 250 idim = 1, nferdims
+            IF ( need_child(idim) ) THEN
+               CALL CD_WRITE_AXIS( cdfid, dset, grid, idim, .FALSE.,
+     .                   lo(idim), hi(idim), pcdf_child_span, 
+     .                   .FALSE., .FALSE., mode_upcase_output, 
+     .                   keepax_flag, name_from_grid(idim), status)
+               IF ( status .NE. merr_ok ) GOTO 5900
+            ENDIF
+ 250     CONTINUE
+	 IF (itsa_strvar) strdim = CD_WRITE_STRDIM(cdfid, maxstrlen, stringdimname, status)
+         IF ( status .NE. merr_ok ) GOTO 5900
+      ELSE
+* 1/95 - create the full-span or sub-span axes as appropriate
+         DO 260 idim = 1, nferdims
+	    IF ( grid_line(idim, grid) .NE. mpsnorm
+     .      .AND. lo(idim) .NE. unspecified_int4     ) THEN
+	      IF (need_child(idim)) THEN
+	         ax_type = pcdf_sub_span
+	      ELSE
+	         ax_type = pcdf_full_span
+	      ENDIF
+              CALL CD_WRITE_AXIS( cdfid, dset, grid, idim, 
+     .			       idim.EQ.recdim, lo(idim), hi(idim), 
+     .			       ax_type, edges_flag, do_bounds, 
+     .                         mode_upcase_output, keepax_flag, 
+     .                         name_from_grid(idim), status )
+              IF ( status .NE. merr_ok ) GOTO 5900
+	    ENDIF
+ 260     CONTINUE
+	 IF (itsa_strvar) strdim = CD_WRITE_STRDIM(cdfid, maxstrlen, stringdimname, status)
+         IF ( status .NE. merr_ok ) GOTO 5900
+      ENDIF
+
+      do idim = 1, nferdims+1
+	 dimid(idim) = 0
+      enddo
+
+* determine the netCDF dimension id's to use for the variable
+      IF (itsa_strvar) THEN
+	dimid(1) = strdim   ! 1st dim of string array is character axis
+	dims = 1
+      ELSE
+        dims = 0
+      ENDIF 
+
+* get axis name. If mode upcase_output is set, then upcase the name.
+
+      DO 300 idim = 1, nferdims
+         iaxis = grid_line(idim,grid)
+         buff = CD_AXIS_NAME( dset, grid, idim, nlen )
+         IF (keepax_flag .EQ. 1) buff = CD_AXIS_OUTNAME( dset, grid, idim, nlen )
+
+	 IF (name_from_grid(idim)) THEN 
+* using the basic name straight from the grid
+            buff = line_name(iaxis)
+	 ENDIF
+         lname = buff
+         IF (mode_upcase_output) CALL STR_UPCASE( lname, buff)
+
+         IF ( iaxis .EQ. mpsnorm
+     .   .OR. lo(idim) .EQ. unspecified_int4 ) GOTO 300
+         dims = dims + 1
+         IF ( TM_ABSTRACT_AXIS( iaxis ) ) THEN
+! ... could probably use lname here, too *sh* 11/95
+            cdfname = lname
+            IF (keepax_flag .EQ. 0) 
+     .       cdfname = CD_CHILDAX_NAME( lname,
+     .                                 lo(idim), hi(idim), nlen )
+         ELSEIF ( idim .NE. recdim
+     .  .AND. ( lo(idim) .NE. 1
+     .    .OR.  hi(idim) .NE. line_dim(iaxis) ) ) THEN
+            cdfname = lname
+            IF (keepax_flag .EQ. 0) 
+     .       cdfname = CD_CHILDAX_NAME( lname,
+     .                                 lo(idim), hi(idim), nlen )
+         ELSE
+            cdfname = lname
+         ENDIF
+         nlen = TM_LENSTR1( cdfname )
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_DIMID_( cdfid, cdfname(:nlen), dimid(dims) )
+#else
+         cdfstat = NF_INQ_DIMID ( cdfid, cdfname(:nlen), dimid(dims) )
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5200  ! it must already exist
+
+         chunk_set = 0
+         IF (netcdf4_type .EQ. 4) THEN
+            IF (line_direction(iaxis) .EQ. 'WE' .OR.  
+     .              line_direction(iaxis) .EQ. 'XX') THEN
+               chunks(dims) = xchunk_size
+	       DIMDIR = 'X'
+	       dimsize = hi(idim) - lo(idim) + 1
+	       IF (chunks(dims) .GT. dimsize ) GOTO 5700
+	       IF (xchunk_size .GT. 0) chunk_set = 1
+            ELSEIF (line_direction(iaxis) .EQ. 'SN' .OR.  
+     .              line_direction(iaxis) .EQ. 'YY') THEN
+               chunks(dims) = ychunk_size
+	       DIMDIR = 'Y'
+	       dimsize = hi(idim) - lo(idim) + 1
+	       IF (chunks(dims) .GT. dimsize ) GOTO 5700
+	       IF (ychunk_size .GT. 0) chunk_set = 1
+            ELSEIF (line_direction(iaxis) .EQ. 'DU' .OR.  
+     .              line_direction(iaxis) .EQ. 'UD') THEN
+               chunks(dims) = zchunk_size
+	       DIMDIR = 'Z'
+	       dimsize = hi(idim) - lo(idim) + 1
+	       IF (chunks(dims) .GT. dimsize ) GOTO 5700
+	       IF (zchunk_size .GT. 0) chunk_set = 1
+            ELSEIF (line_direction(iaxis) .EQ. 'TI' .OR.  
+     .              line_direction(iaxis) .EQ. 'TT') THEN
+               chunks(dims) = tchunk_size
+	       DIMDIR = 'T'
+	       dimsize = hi(idim) - lo(idim) + 1
+	       IF (chunks(dims) .GT. dimsize ) GOTO 5700
+	       IF (tchunk_size .GT. 0) chunk_set = 1
+	    ENDIF
+
+         ENDIF ! netcdf4
+
+ 300  CONTINUE
+
+* If any chunk was set, then all must be set for the dimensions that are present.
+
+      IF (chunk_set .GT. 0) THEN
+         DO 350 idim = 1, nferdims
+            IF (dimid(idim) .GT. 0 .AND. chunks(idim) .EQ. 0) GOTO 5600
+ 350     CONTINUE
+      ENDIF
+
+* put CDF into define mode so attributes can be written
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* create the new variable
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_DEF_VAR_(cdfid, vname(:vlen), type, dims, dimid, varid)
+#else
+      cdfstat = NF_DEF_VAR(cdfid, vname(:vlen), type, dims, dimid, varid)
+#endif
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5400
+
+C     Turn on deflate_lev and chunking
+
+      IF (netcdf4_type .EQ. 4) THEN
+         IF (deflate_lev .GT. 0) CALL CD_SET_COMPRESS (cdfid, varid, vname,
+     .         dimid, deflate_lev, chunks, shuffle_flag, endian_code, status)
+      ENDIF ! netcdf4
+
+* if the "unlimited" record dimension is in use place no limits on that axis
+      DO 400 idim = 1, nferdims
+         IF ( lo(idim) .EQ. unspecified_int4 ) THEN
+            lo2(idim) = 1
+            hi2(idim) = 1
+         ELSE
+            lo2(idim) = lo(idim)
+            hi2(idim) = hi(idim)
+         ENDIF
+ 400  CONTINUE
+      IF  (  recdim .GT. 0 ) THEN
+         lo2(recdim) = 0
+         hi2(recdim) = 0
+      ENDIF
+ 
+* assign attributes if this is a hyperslab of the parent grid
+* TODO: the whole mechanism of parent grids needs developing with 6D
+
+      IF ( itsa_slab .AND. enhead) THEN
+         glen = TM_LENSTR1( gname )
+
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_PUT_ATT_TEXT_( cdfid, varid, 'parent_grid', glen,
+     .                gname(:glen) )
+         cdfstat = NF_PUT_ATT_INT_( cdfid, varid, 'slab_min_index', 
+     .                NF_INT, 4, lo2 )
+         cdfstat = NF_PUT_ATT_INT_( cdfid, varid, 'slab_max_index', 
+     .                NF_INT, 4, hi2 )
+#else
+         cdfstat = NF_PUT_ATT_TEXT( cdfid, varid, 'parent_grid', glen,
+     .                gname(:glen) )
+         cdfstat = NF_PUT_ATT_INT( cdfid, varid, 'slab_min_index', 
+     .                NF_INT, 4, lo2 )
+         cdfstat = NF_PUT_ATT_INT( cdfid, varid, 'slab_max_index', 
+     .                NF_INT, 4, hi2 )
+#endif
+      ENDIF
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+* error messages
+ 5050 CALL TM_ERRMSG
+     . ( merr_badgriddef, status, 'CD_MAKE_VAR', unspecified_int4,
+     .   unspecified_int4,
+     .   'data type of variable '//vname(:vlen)//
+     .   ' is inconsist. w/ CDF file',
+     .   no_errstring, *5900 )
+
+ 5100 CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_MAKE_VAR', unspecified_int4,
+     .   unspecified_int4,
+     .   '# of dims in variable '//vname(:vlen)//
+     .   ' is inconsist. w/ CDF file',
+     .   no_errstring, *5900 )
+
+ 5200 CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_MAKE_VAR', unspecified_int4,
+     .   unspecified_int4,
+     .  'axis '//cdfname(:nlen)//' of grid for '
+     .   //vname(:vlen)//' doesnt match CDF file',
+     .   no_errstring, *5900 )
+
+! 5300 CALL TM_ERRMSG
+!     . ( merr_linepredef, status, 'CD_MAKE_VAR', unspecified_int4,
+!     .   unspecified_int4,
+!     .   dimnam(idim)//' axis length of '//vname(:vlen)//
+!     .   ' inconsist. w/ CDF file',
+!     .   no_errstring, *5900 )
+
+ 5400       CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_MAKE_VAR', cdfid,
+     .       unspecified_int4, 'Failed creating variable '
+     .       //vname(:vlen), no_errstring, *5900 )
+
+* error exit
+ 5500  vlen = TM_LENSTR1( vname )
+       WRITE (buff, 1010) ww_dim_nam(idim), vname(:vlen), dlen
+ 1010  FORMAT ('chunk size too large for ', A,' axis of grid for ',
+     .   A,' must be less than axis length written', I8)
+       CALL TM_ERRMSG
+     . ( merr_chunk_spec, status, 'CD_MAKE_VAR', unspecified_int4,
+     .   unspecified_int4, buff, no_errstring, *5900 )
+
+ 5600  CALL TM_ERRMSG
+     .     ( merr_syntax, status, 'CD_MAKE_VAR', unspecified_int4, 
+     .     unspecified_int4, 
+     .     'If ChunkSize is set for any dimension'//
+     .     ' of var, must set for all its dimensions', ' ', *5900 )
+
+ 5700  val = chunks(idim)
+       c_str = TM_FMT(val, 5, 12, clen)
+       val = dimsize
+       d_str = TM_FMT(val, 5, 12, dlen)
+       WRITE (buff, 1020) DIMDIR, c_str(1:clen), d_str(1:dlen)
+ 1020  FORMAT (A1,'ChunkSize ', A, 
+     .         ' is larger than dimension length ', A)
+       CALL TM_ERRMSG
+     . ( merr_chunk_spec, status, 'CD_MAKE_VAR', unspecified_int4,
+     .   unspecified_int4, buff, no_errstring, *5900 )
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_ncclose.F b/fmt/src/cd_ncclose.F
new file mode 100644
index 0000000..230133b
--- /dev/null
+++ b/fmt/src/cd_ncclose.F
@@ -0,0 +1,59 @@
+	SUBROUTINE CD_NCCLOSE ( dset, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Just do an nc_close on the ncid for the dataset. We're going to 
+* re-open it with F-TDS variable definitions, so leave all the
+* dataset initialization information in place.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 2/2013  Ferret v6.85
+*
+* arguments:
+*	dset	- data set number 
+
+
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+* Argument variable declarations
+	INTEGER   dset, status
+
+	CALL CD_CLOSE_SET( sf_lunit(dset), status )
+	
+	RETURN
+	END
diff --git a/fmt/src/cd_ncopen.F b/fmt/src/cd_ncopen.F
new file mode 100644
index 0000000..7cc378c
--- /dev/null
+++ b/fmt/src/cd_ncopen.F
@@ -0,0 +1,87 @@
+	SUBROUTINE CD_NCOPEN ( urlstring, dset, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Just do an nc_close on the ncid for the dataset. We're going to 
+* re-open it with F-TDS variable definitions, so leave all the
+* dataset initialization information in place.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 2/2013  Ferret v6.85
+*
+* arguments:
+*	dset	- data set number 
+
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+* Argument variable declarations
+	INTEGER   dset, status
+	CHARACTER*(*) urlstring
+
+* Local variable declarations
+	INTEGER cdfid
+	CHARACTER*500 errbuff
+
+
+#ifdef usingDODSf2cUnderscore 
+	status = NF_OPEN_(urlstring, NF_NOWRITE, cdfid) 
+#else
+	status = NF_OPEN(urlstring, NF_NOWRITE, cdfid) 
+#endif
+	
+	IF ( status .NE. NF_NOERR ) GOTO 5100
+	sf_lunit(dset) = cdfid
+
+* successful completion
+        status = merr_ok
+ 5000	RETURN
+
+* error messages
+ 5100   CONTINUE
+
+        errbuff = 
+     .    'Unable to open URL with REMOTE variable definitions: '
+
+        CALL TM_ERRMSG
+     .     ( merr_nc_open, status, 'CD_NCOPEN', dset,
+     .        no_stepfile, errbuff, no_errstring, *5000 )
+
+
+	END
diff --git a/fmt/src/cd_nf_get_bad.F b/fmt/src/cd_nf_get_bad.F
new file mode 100644
index 0000000..0e07750
--- /dev/null
+++ b/fmt/src/cd_nf_get_bad.F
@@ -0,0 +1,91 @@
+	SUBROUTINE CD_NF_GET_BAD ( dset, varid, baddat, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Just do an nf_get_varid for a variable that has been defined with LET/REMOTE.
+* Call this after the dataset has been redefined with the encoded variable
+* definitions.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 2/2013  Ferret v6.85
+*
+* arguments:
+*	dset	- data set number 
+
+
+* Argument variable declarations
+	INTEGER   dset, varid, status
+	REAL	  baddat
+
+* Local variable declarations
+	INTEGER cdfid
+	CHARACTER*500 buff
+
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+	cdfid = sf_lunit(dset)
+
+#ifdef usingDODSf2cUnderscore 
+	status = NF_GET_ATT_DOUBLE_ 
+     .            (cdfid, varid, '_FillValue', baddat)
+
+#else
+	status = NF_GET_ATT_DOUBLE 
+     .            (cdfid, varid, '_FillValue', baddat)
+#endif
+	
+	IF ( status .NE. NF_NOERR ) GOTO 5100
+
+* successful completion
+        status = merr_ok
+ 5000	RETURN
+
+* error messages
+ 5100   CONTINUE
+        CALL CD_TRANSLATE_ERROR (status, buff)
+
+        buff = 'Unable to get bad-value for LET/REMOTE variable: '//
+     .    buff
+
+        CALL TM_ERRMSG
+     .     ( merr_badfileatt, status, 'CD_NF_GET_BAD', dset,
+     .        no_stepfile, buff, no_errstring, *5000 )
+	END
diff --git a/fmt/src/cd_nf_get_var_grid.F b/fmt/src/cd_nf_get_var_grid.F
new file mode 100644
index 0000000..9cf1def
--- /dev/null
+++ b/fmt/src/cd_nf_get_var_grid.F
@@ -0,0 +1,120 @@
+	SUBROUTINE CD_NF_GET_VAR_GRID ( dset, vname, gridlines, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Just do an nf_get_varid for a variable that has been defined with LET/REMOTE.
+* Call this after the dataset has been redefined with the encoded variable
+* definitions.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 2/2013  Ferret v6.85
+*
+* arguments:
+*	dset	- data set number 
+
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+        include 'xtm_grid.cmn_text'
+
+
+* Argument variable declarations
+	INTEGER   dset, gridlines(*), status
+	CHARACTER*(*) vname
+
+* Local variable declarations
+	INTEGER STR_SAME, TM_LENSTR1, 
+     .		cdfid, varid, ndims, dimids(nferdims),
+     .		idim, igrid, dimlen, outgrid(nferdims), slen
+	CHARACTER*500 buff, errbuff
+
+	cdfid = sf_lunit(dset)
+
+#ifdef usingDODSf2cUnderscore 
+	status = NF_INQ_VARID_(cdfid, vname, varid) 
+	status = NF_INQ_VARNDIMS_(cdfid, varid, ndims) 
+	status = NF_INQ_VARDIMID _(cdfid, varid, dimids) 
+#else
+	status = NF_INQ_VARID(cdfid, vname, varid)
+	status = NF_INQ_VARNDIMS(cdfid, varid, ndims)
+	status = NF_INQ_VARDIMID (cdfid, varid, dimids)
+#endif
+	
+	IF ( status .NE. NF_NOERR ) GOTO 5100
+
+	DO 100 igrid = 1, nferdims
+	   outgrid(igrid) = 0
+  100	CONTINUE
+
+	DO 300 idim = 1, ndims
+#ifdef usingDODSf2cUnderscore 
+	   status = NF_INQ_DIMNAME_(cdfid, dimids(idim), buff)
+	   status = NF_INQ_DIMLEN_ (cdfid, dimids(idim), dimlen)
+#else
+	   status = NF_INQ_DIMNAME (cdfid, dimids(idim), buff)
+	   status = NF_INQ_DIMLEN  (cdfid, dimids(idim), dimlen)
+#endif
+	   DO 200 igrid = 1, nferdims
+	      IF (STR_SAME ( buff, line_name_orig(gridlines(igrid)) ) .EQ. 0) THEN
+     	        outgrid(igrid) = gridlines(igrid)
+	      ENDIF
+  200	   CONTINUE
+  300	CONTINUE
+
+	DO 400 igrid = 1, nferdims
+	   gridlines(igrid) = outgrid(igrid)
+  400	CONTINUE
+
+* successful completion
+        status = merr_ok
+ 5000	RETURN
+
+* error messages
+ 5100   CONTINUE
+
+        CALL CD_TRANSLATE_ERROR (status, errbuff)
+	slen = TM_LENSTR1(errbuff)
+
+        buff = 'Unable to get varid for LET/REMOTE variable: '//
+     .    errbuff(:slen)
+
+        CALL TM_ERRMSG
+     .     ( merr_badfileatt, status, 'CD_NF_GET_VAR_GRID', dset,
+     .        no_stepfile, buff, no_errstring, *5000 )
+	END
diff --git a/fmt/src/cd_nf_get_varid.F b/fmt/src/cd_nf_get_varid.F
new file mode 100644
index 0000000..2443163
--- /dev/null
+++ b/fmt/src/cd_nf_get_varid.F
@@ -0,0 +1,89 @@
+	SUBROUTINE CD_NF_GET_VARID ( dset, vname, varid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Just do an nf_get_varid for a variable that has been defined with LET/REMOTE.
+* Call this after the dataset has been redefined with the encoded variable
+* definitions.
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 2/2013  Ferret v6.85
+*
+* arguments:
+*	dset	- data set number 
+
+
+* Argument variable declarations
+	INTEGER   dset, varid, status
+	CHARACTER*(*) vname
+
+* Local variable declarations
+	INTEGER TM_LENSTR1, cdfid, slen
+	CHARACTER*500 errbuff, buff
+
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+	cdfid = sf_lunit(dset)
+
+#ifdef usingDODSf2cUnderscore 
+	status = NF_INQ_VARID_(cdfid, vname, varid) 
+#else
+	status = NF_INQ_VARID(cdfid, vname, varid)
+#endif
+	
+	IF ( status .NE. NF_NOERR ) GOTO 5100
+
+* successful completion
+        status = merr_ok
+ 5000	RETURN
+
+* error messages
+ 5100   CONTINUE
+        CALL CD_TRANSLATE_ERROR (status, errbuff)
+	slen = TM_LENSTR1(errbuff)
+
+        buff = 'Unable to get varid for LET/REMOTE variable: '//
+     .    errbuff(:slen)
+
+        CALL TM_ERRMSG
+     .     ( merr_badfileatt, status, 'CD_NF_GET_VARID', dset,
+     .        no_stepfile, buff, no_errstring, *5000 )
+	END
diff --git a/fmt/src/cd_open_dset.F b/fmt/src/cd_open_dset.F
new file mode 100644
index 0000000..c79046e
--- /dev/null
+++ b/fmt/src/cd_open_dset.F
@@ -0,0 +1,302 @@
+	SUBROUTINE CD_OPEN_DSET ( dset, cdfid, remote_dods_id, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Open a netCDF file and stores preliminaries in TMAP XDSET_INFO common
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* 2/93 - ds_aux_modnum replaced by cd_what_isit (equivalenced (but unused))
+* 3/93 - initialize ds_type for PMEL EPIC CDF file
+* 11/94 - ignore the global "history" attribute.  Use "title_mod" instead.
+* *sh* 3/2/95 - informative messages issued through TM_NOTE (for GUI)
+*
+* *kob* 7/95 - added logic for multi-file netcdf datasets
+* *kob* 3/21/96 - add in changes originally made 7/21/95 by -sh- to 
+*		 initialize ds_basic_axes as per TMAP model output
+* *kob* 6/4/96	- prevent title from being overwritten for mc datasets
+* *kob* 6/18/96 - bug fix in mc loop - loop w/ maxstepfiles rather than
+*		  maxdsets.  Also reorganize loop for efficiency
+*		- clarify error message at 5300
+* 10/96 *kob* - Linux port 
+*		- had to move variable assignments off of
+*		  declaration line.
+*		- hsd to declare hex constants as implicit
+*		  integers in DATA statements.  Added a 
+*		  FORTRAN_90 ifdef to accomplish this.
+* *sh* 11/12/96 - changes to accomodate caching of DODS data 
+* *kob* 4/99 - increase size of TM_INQ_PATH, cdf_file and raw_file 
+*              to accomodate lenghty DODS dataset names
+* 4/03 *acm* - Use STR_SAME to compare strings
+* 9/04 *acm* - Fix bug 982 If same variable name in multiple descriptor files, 
+*              mc_init_stepfile needs to know which file its from.
+* V581: *acm*/3/05 - increase length of strings for dataset title to 1024 
+* V600 *acm* 6/05 - Attribute control. just open the dataset here; getting info
+*                   is done in cd_load_dset_attrs. See sequence of calls in 
+*                   cd_init_dset.
+* V600 *acm* 7/06 - To return correct netCDF error messages, call NF_OPEN and
+*                   NF_STRERROR instead of NCOPN. Requires DODS library v3.5.2 or
+*                   higher.
+* V604 *acm* 6/07 Allow longer strings for OPeNDAP file-open errors.
+* v604 *acm* 7/07 increase length of ds_des_name
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V65  *acm* 1/10  Call CD_TRANSLATE_ERROR rather than individual calls to NF_STRERROR
+* V65  *acm* 1/10  Dont add the note **OPeNDAP/netCDF Error code** - that is now
+*                  done only in CD_TRANSLATE_ERROR 
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*       cdfid   - returned pointer to open CDF file (or cache)
+*       remote_dods_id   - returned pointer to open remote URL (or zero)
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, cdfid, remote_dods_id, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+#include "tmap_dset.parm"
+	include 'xstep_files.cmn_text'
+        external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xio.cmn_text'
+        external xio_data
+        include 'xdset_info.cd_equiv'
+! kob 7/95
+	include 'xsys_names.cmn_text'	            
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+
+      LOGICAL TM_HAS_STRING, got_it,
+     .        do_warn, file_exists
+      PARAMETER (do_warn = .TRUE. )
+      REAL val
+      INTEGER TM_HASH_NAME, TM_LENSTR1, STR_SAME, STR_UPCASE,
+     .        ndims, nvars, ngatts, recdim, cdfstat, i, istep, 
+     .        err_status, i1, i2
+      INTEGER len, iin, iout, ilast, dlen
+      CHARACTER ch*1
+* *kob* 4/99
+* *kob* 11/00 - increase size of below to accomidate DODS files in mc sets
+      CHARACTER*2048 TM_INQ_PATH, cdf_file, raw_file
+      CHARACTER*10 TM_FMT, errcode
+      CHARACTER*1024 buff, upstr  ! for nf_ error message
+      CHARACTER*30 buff30
+
+#ifdef FORTRAN_90
+	INTEGER HEX40
+	DATA HEX40/Z'40'/
+#endif
+
+        buff = ' '
+        upstr = ' '
+        errcode = ' '
+        err_status = merr_nc_open
+
+****** DODS *********
+* If this is a DODS remote file - see if it is cached (11/96)
+	remote_dods_id = -1	! the default: "NO"
+	IF ( ds_des_name(dset)(1:7) .EQ. 'http://') THEN
+
+	   err_status = merr_remote_open
+
+* ... have they specifically indicated "(no cache)"
+	   IF ( TM_HAS_STRING(ds_des_name(dset),'(no cach') ) THEN
+* ... do not use cache!
+* ... crude parse: remove everything beyond last "("
+	      dlen = TM_LENSTR1(ds_des_name(dset))
+	      DO 5 iin = dlen, 1, -1
+	         IF (ds_des_name(dset)(iin:iin) .NE. '(' ) THEN
+	            ds_des_name(dset)(iin:iin) = ' '
+	         ELSE
+	            ds_des_name(dset)(iin:iin) = ' '
+	            GOTO 50
+	         ENDIF
+ 5	      CONTINUE
+	   ENDIF
+
+* ... create the full file name path for the cache file
+	   dlen = TM_LENSTR1(ds_des_name(dset))
+	   raw_file = ' '
+	   iout = 1				
+	   DO 10 iin = 8, dlen			! just past the "http://"
+	      ch = ds_des_name(dset)(iin:iin)	
+	      IF ( ch .EQ. PathSeparator ) THEN
+	         raw_file(iout:iout) = '_'
+	      ELSE
+	         raw_file(iout:iout) = ch
+	      ENDIF
+	      iout = iout + 1
+ 10	   CONTINUE
+
+* ... does it exist?
+	   cdf_file = TM_INQ_PATH( raw_file, 'FER_DODS_CACHE_DIR',
+     .		' ', .FALSE., status )
+	   IF ( status .EQ. merr_notmounted ) GOTO 50
+	   IF ( status .NE. merr_ok ) GOTO 5900		! syntax err
+
+* ... open the remote URL in order to initialize the DODS client libraries
+* This time penalty is unavoidable (though HTTP caching may eliminate it)
+* Using the cache file will remove the need to read remote coordinates
+	   CALL TM_NOTE( 'Using cache '//cdf_file, lunit_errors)
+	   
+* ---
+* Define a symbol CACHE_FILE
+* if this symbol already exists then delete it
+        buff30 = 'CACHE_FILE'	
+	CALL GETSYM( 'CACHE_FILE', buff, i2, i1 )
+	IF ( i1 .EQ. 0 ) CALL DELSYM(buff30,i1)
+
+* define the symbol
+	dlen = TM_LENSTR1(cdf_file)
+	CALL PUTSYM( buff30, cdf_file, dlen, i2)
+* ---
+
+
+#ifdef usingDODSf2cUnderscore
+           cdfstat = NF_OPEN_(ds_des_name(dset), NF_NOWRITE, remote_dods_id) 
+#else
+           cdfstat = NF_OPEN(ds_des_name(dset), NF_NOWRITE, remote_dods_id) 
+#endif
+	   IF ( cdfstat .NE. NF_NOERR ) THEN
+              GOTO 5150
+           ENDIF
+           
+           ds_des_name(dset) = cdf_file	! replace remote with cache!
+	ENDIF
+****** END DODS *********
+
+* open the netCDF file and get its vital statistics. 
+* NCPOPT  Call not used in Netcdf3, 4 
+ 50     CONTINUE
+* check for mutli-file netcdf datasets then loop through the list
+* of stepfiles to find the first one that is on line    *kob* 7/95
+* * kob*  bug fix in loop logic 9/18/96
+        IF (STR_SAME(ds_type(dset), '  MC') .EQ. 0) THEN
+ 		DO 100 i=1,maxstepfiles
+                     err_status = merr_nc_open
+
+		     IF (sf_setnum(i) .NE. dset) GOTO 100
+		     cdf_file = TM_INQ_PATH(sf_name(i),tmap_tsteps,
+     .                                      ' ',.FALSE., status)
+		     IF (status .EQ. merr_ok)  THEN
+#ifdef usingDODSf2cUnderscore
+			 cdfstat = NF_OPEN_(cdf_file, NF_NOWRITE, cdfid) 
+#else
+			 cdfstat = NF_OPEN(cdf_file, NF_NOWRITE, cdfid) 
+#endif
+                         IF ( cdf_file(1:7) .EQ. 'http://')
+     .                        err_status = merr_remote_open
+
+			 mc_init_stepfile(dset) = i
+			 IF ( cdfstat .EQ. NF_NOERR) GOTO 110
+		     ENDIF
+ 100	        CONTINUE
+
+* error exit now.....no file on line found after looping through
+* all stepfiles
+		GOTO 5300
+                
+	ELSE
+               
+#ifdef usingDODSf2cUnderscore 
+           cdfstat = NF_OPEN_(ds_des_name(dset), NF_NOWRITE, cdfid) 
+#else
+           cdfstat = NF_OPEN(ds_des_name(dset), NF_NOWRITE, cdfid) 
+#endif
+
+	ENDIF
+	        IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+ 110   CONTINUE
+
+       status = merr_ok
+
+       RETURN
+
+* error messages
+ 5100   CONTINUE
+        CALL CD_TRANSLATE_ERROR (cdfstat, buff)
+
+        i = STR_UPCASE(upstr,buff)
+        IF (STR_SAME(upstr(1:13), 'UNKNOWN ERROR') .EQ. 0) THEN
+           buff = 'Unable to access remote URL: Data server '//
+     .    'unavailable or file cannot be opened'
+        ENDIF
+
+        dlen = TM_LENSTR1(buff)
+
+        CALL TM_ERRMSG
+     .     ( err_status, status, 'CD_OPEN_DSET', dset,
+     .        no_stepfile, buff, no_errstring, *5900 )
+
+ 5150   CALL TM_ERRMSG
+     .     ( err_status, status, 'CD_OPEN_DSET', dset,
+     .        no_varid, 'Unable to access remote URL', no_errstring,
+     .		*5900 )
+*kob* 9/18
+ 5300   CONTINUE
+        CALL CD_TRANSLATE_ERROR (cdfstat, buff)
+
+        dlen = TM_LENSTR1(buff)
+
+        CALL TM_ERRMSG (merr_notmounted,status, 'CD_OPEN_DSET',dset,
+     .    no_stepfile,
+     .    'No files on-line from data set. '//buff(1:dlen),
+     .    no_errstring,
+     .    *5900)
+* erase any record of tampering with this data set
+ 5900   CALL TM_CLOSE_SET( dset, i )
+
+* error exit
+	RETURN
+	END
diff --git a/fmt/src/cd_open_out.F b/fmt/src/cd_open_out.F
new file mode 100644
index 0000000..ab00afa
--- /dev/null
+++ b/fmt/src/cd_open_out.F
@@ -0,0 +1,145 @@
+	SUBROUTINE CD_OPEN_OUT(cdfname, append, cdfid, clobber, 
+     .                          netcdf4_type, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Open a netCDF file for output
+* if appending then the file must already exist
+* leave it in definition mode
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92 - leave mode as opened (report via CD_SET_MODE)
+* V450 11/96 - added argument "clobber" *sh*
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V67  *acm* 4/11  Fix ticket 1832, open file correctly for NetCDF4.1.2 and higher.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       cdfname - desired output file name
+*       append  - logical control to create or append
+*       cdfid   - returned pointer to open CDF file
+*	clobber	- Boolean to say if existing file can be clobbered
+*	status	- return status
+
+* argument declarations:
+        LOGICAL  append, clobber
+        INTEGER	 cdfid, netcdf4_type, status
+        CHARACTER*(*) cdfname
+	
+
+* include files
+        include 'netcdf.inc'
+        include 'cdf_tmap.parm'
+        include 'tmap_errors.parm'
+#include "gt_lib.parm"
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+      LOGICAL file_exists, do_append
+      INTEGER cstat, clobber_mode, cdfstat, cdftype
+
+* initialize netCDF
+* does it exist already ?
+      INQUIRE ( FILE = cdfname, EXIST = file_exists )
+      do_append = append .AND. file_exists
+
+* open or create the file
+      IF ( do_append ) THEN
+#ifdef usingDODSf2cUnderscore
+	 cdfstat = NF_OPEN_( cdfname, NF_WRITE, cdfid )
+#else
+	 cdfstat = NF_OPEN( cdfname, NF_WRITE, cdfid )
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+         CALL CD_SET_MODE( cdfid, pcd_reset_data, status )
+         IF ( status .NE. merr_ok ) RETURN
+      ELSE
+	 IF (clobber) THEN
+	   clobber_mode =   NF_CLOBBER
+	 ELSE
+	   clobber_mode =   NF_NOCLOBBER
+	 ENDIF
+
+* ... let netCDF detect the error if the file already exists
+
+         IF (netcdf4_type .EQ. 3) THEN 
+	    cdftype = NF_CLASSIC_MODEL
+
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_CREATE_(cdfname, clobber_mode, cdfid)
+#else
+            cdfstat = NF_CREATE(cdfname, clobber_mode, cdfid)
+#endif
+         ELSE
+
+            IF (netcdf4_type .EQ. 4) cdftype = NF_NETCDF4
+            IF (netcdf4_type .EQ. 6) cdftype = NF_64BIT_OFFSET
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_CREATE_(cdfname, OR(clobber_mode,cdftype), cdfid)
+#else
+            cdfstat = NF_CREATE(cdfname, OR(clobber_mode,cdftype), cdfid)
+#endif
+
+         ENDIF
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+         CALL CD_SET_MODE( cdfid, pcd_reset_define, status )
+         IF ( status .NE. merr_ok ) RETURN
+      ENDIF
+
+* successful completion
+	status = merr_ok
+	RETURN
+
+* error messages
+ 5100 CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_OPEN_OUT', unspecified_int4,
+     .     no_varid, 'could not open CDF output file: ',
+     .     cdfname, *5000 )
+
+* error exit
+ 5000 RETURN
+	END
diff --git a/fmt/src/cd_put_agg_memb_grid.F b/fmt/src/cd_put_agg_memb_grid.F
new file mode 100644
index 0000000..ff625d2
--- /dev/null
+++ b/fmt/src/cd_put_agg_memb_grid.F
@@ -0,0 +1,63 @@
+	SUBROUTINE CD_PUT_AGG_MEMB_GRID (agg_dset, vname, imemb, igrid, status)
+*  
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+*
+* Given aggregate datset, variable name in the set, aggregate member number,
+* store a new grid number.
+
+* for var in aggregate member-dataset:
+* for members of the aggregate, imemb (id= sequence number 1,2,3,...
+*   igrid    Ferret grid number
+*   iline    Ferret line number of aggregate dimension
+*   vtype    1=file-var, 3=user-var
+*   mdset    Ferret dataset number
+*   nv       sequence number in ds_var_code or uvar_name_code
+* V680 5/12 *acm* 6D Ferret, changes for DEFINE DATA/AGGREGATE
+
+* Argument declarations
+  
+	CHARACTER*(*) vname
+	INTEGER agg_dset, imemb, igrid, status
+
+* Local variable declarations
+	INTEGER NCF_ADD_AGG_VAR_INFO, NCF_PUT_AGG_MEMB_GRID, varid
+
+	CALL CD_GET_VAR_ID (agg_dset, vname, varid, status)
+
+	status = NCF_PUT_AGG_MEMB_GRID( agg_dset, varid, imemb, igrid)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_put_new_attr.F b/fmt/src/cd_put_new_attr.F
new file mode 100644
index 0000000..f827549
--- /dev/null
+++ b/fmt/src/cd_put_new_attr.F
@@ -0,0 +1,115 @@
+      SUBROUTINE CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .   attlen, attoutflag, string, vals, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Add an attribute to a variable in the linked list structure for netcdf 
+* variable information: given dset, varid, attribute specification
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname, string
+      INTEGER dset, varid, attype, attlen, attoutflag, status
+      REAL vals(*)
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      LOGICAL cv
+      INTEGER TM_LENSTR1, NCF_ADD_VAR_NUM_ATT, NCF_ADD_VAR_STR_ATT,
+     .        flen, slen, wlen, vdims(8), vartype, nvdims, nvatts, 
+     .        all_outflag, dset_num
+
+      CHARACTER*128 vname
+
+      PARAMETER (flen=size_rbuff)      ! size of attribute string
+
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+      slen = TM_LENSTR1( attname )
+      CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      IF (attype .NE. NF_CHAR) THEN
+
+         status = NCF_ADD_VAR_NUM_ATT(dset_num, varid, fhol, attype, 
+     .           attlen, attoutflag, vals)
+         IF (status .LT. 0) GOTO 5300
+
+      ELSE
+         slen = TM_LENSTR1( string)
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         status = NCF_ADD_VAR_STR_ATT(dset_num, varid, fhol, attype, 
+     .           slen, attoutflag, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ENDIF
+
+5000  RETURN
+
+! Error
+ 5300 CALL CD_GET_VAR_INFO (dset_num, varid, vname, vartype, nvdims, 
+     .   vdims, nvatts, cv, all_outflag, status)
+      slen = TM_LENSTR1( attname )
+      wlen = TM_LENSTR1( vname )
+      risc_buff(1:slen) = attname
+      risc_buff(slen+1:slen+14) = ' for variable '
+      risc_buff(slen+15:slen+15+wlen) = vname
+      CALL TM_ERRMSG (merr_attalready, status, 'CD_PUT_NEW_ATTR',
+     .           dset_num, no_stepfile, 
+     .           risc_buff(1:slen+15+wlen),
+     .           no_errstring, *5000)
+      END
diff --git a/fmt/src/cd_put_new_attr_dp.F b/fmt/src/cd_put_new_attr_dp.F
new file mode 100644
index 0000000..e99d587
--- /dev/null
+++ b/fmt/src/cd_put_new_attr_dp.F
@@ -0,0 +1,115 @@
+      SUBROUTINE CD_PUT_NEW_ATTR_DP (dset, varid, attname, attype, 
+     .   attlen, attoutflag, string, vals, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Add an attribute to a variable in the linked list structure for netcdf 
+* variable information: given dset, varid, attribute specification
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V601 11/06 *acm* Attribute control, adding double precision attribute value
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname, string
+      INTEGER dset, varid, attype, attlen, attoutflag, status
+      REAL*8 vals(*)
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      LOGICAL cv
+      INTEGER TM_LENSTR1, NCF_ADD_VAR_NUM_ATT_DP, NCF_ADD_VAR_STR_ATT,
+     .        flen, slen, wlen, vdims(8), vartype, nvdims, nvatts, 
+     .        all_outflag, dset_num
+
+      CHARACTER*128 vname
+
+      PARAMETER (flen=size_rbuff)      ! size of attribute string
+
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+      slen = TM_LENSTR1( attname )
+      CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      IF (attype .NE. NF_CHAR) THEN
+
+         status = NCF_ADD_VAR_NUM_ATT_DP(dset_num, varid, fhol, attype, 
+     .           attlen, attoutflag, vals)
+         IF (status .LT. 0) GOTO 5300
+
+      ELSE
+         slen = TM_LENSTR1( string)
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         status = NCF_ADD_VAR_STR_ATT(dset_num, varid, fhol, attype, 
+     .           slen, attoutflag, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ENDIF
+
+5000  RETURN
+
+! Error
+ 5300 CALL CD_GET_VAR_INFO (dset_num, varid, vname, vartype, nvdims, 
+     .   vdims, nvatts, cv, all_outflag, status)
+      slen = TM_LENSTR1( attname )
+      wlen = TM_LENSTR1( vname )
+      risc_buff(1:slen) = attname
+      risc_buff(slen+1:slen+14) = ' for variable '
+      risc_buff(slen+15:slen+15+wlen) = vname
+      CALL TM_ERRMSG (merr_attalready, status, 'CD_PUT_NEW_ATTR',
+     .           dset_num, no_stepfile, 
+     .           risc_buff(1:slen+15+wlen),
+     .           no_errstring, *5000)
+      END
diff --git a/fmt/src/cd_rd_ep_1.F b/fmt/src/cd_rd_ep_1.F
new file mode 100644
index 0000000..31442b8
--- /dev/null
+++ b/fmt/src/cd_rd_ep_1.F
@@ -0,0 +1,142 @@
+	SUBROUTINE CD_RD_EP_1(cdfid,t1id,t2id,t0,tunit,index,dval,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a single time value from a 2-integer EPIC time axis
+* and return it as a double precision time relative to t0
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+* V5.0 2/99 *sh* - corrected declaration error - "sec" is float
+*		Note that fractional seconds are lost!
+* V530 1/01 *acm* add calendar_id in TM_BREAK_DATE, TM_SECS_FROM_BC
+*		  calendar is assumed Gregorian for epic data
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V66+ *acm* 4/10  Made incorrect call to NF_GET_VAR1_DOUBLE, should have becn
+*                  NF_GET_VAR1_INT.
+* V665 *acm* 11/10 Fix arguments to second call to NF_GET_VAR1_INT. 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       t1id     - netCDF variable id of "time"
+*       t2id     - netCDF variable id of "time2"
+*       t0       - T0 string for the time axis
+*       tunit    - number of seconds per axis time unit
+*       index    - subscript of time axis to return
+*       dval     - double precision value returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, t1id, t2id, index, status
+      REAL tunit
+      REAL*8  dval
+      CHARACTER*(*) t0
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+      INTEGER jday, msec, cdfstat, mon, day, yr, hour, min,
+     .        t0year, t0mon, t0day, t0hour, t0min, t0sec
+      INTEGER 	cal_id
+	REAL	      sec					! 2/99
+      REAL*8          TM_SECS_FROM_BC
+      REAL*8          date_secs, start_secs, offset_secs
+
+* break apart the T0 offset date.  Hardwire the calendar type to Gregorian.
+      cal_id = 1
+      CALL TM_BREAK_DATE (t0, cal_id, t0year, t0mon,
+     .                      t0day, t0hour, t0min, t0sec, status)
+      IF (status .NE. merr_ok) GO TO 5000
+
+* read the 2 integer values
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VAR1_INT_(cdfid, t1id, index, jday)
+
+#else
+      cdfstat = NF_GET_VAR1_INT (cdfid, t1id, index, jday)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_EP_TIME', cdfid, t1id,
+     .       'EPIC time', no_errstring, *5000 )
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VAR1_INT_(cdfid, t2id, index, msec)
+#else
+      cdfstat = NF_GET_VAR1_INT(cdfid, t2id, index, msec)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_EP_TIME', cdfid, t2id,
+     .       'EPIC time2', no_errstring, *5000 )
+
+* convert the 2 EPIC integers to a date
+      CALL TM_EP_TIME_CONVRT( jday, msec,
+     .                        mon, day, yr, hour, min, sec)
+
+* determine seconds from BC for each part
+      start_secs = TM_SECS_FROM_BC (cal_id, t0year, t0mon, t0day,
+     .                              t0hour, t0min, t0sec,status)
+      IF (status .NE. merr_ok) GO TO 5000
+      date_secs  = TM_SECS_FROM_BC (cal_id, yr  , mon, day,
+     .                              hour, min, NINT(sec),status)  ! NINT 2/99
+      IF (status .NE. merr_ok) GO TO 5000
+
+* Find the number of seconds since T0
+      offset_secs = date_secs - start_secs
+
+* Divide by time step increment to get # of time step
+      dval = offset_secs/tunit
+
+      status = merr_ok
+      RETURN
+
+* error exit
+ 5000 RETURN
+
+      END
+
+
diff --git a/fmt/src/cd_rd_ep_arr.F b/fmt/src/cd_rd_ep_arr.F
new file mode 100644
index 0000000..7c216f1
--- /dev/null
+++ b/fmt/src/cd_rd_ep_arr.F
@@ -0,0 +1,85 @@
+	SUBROUTINE CD_RD_EP_ARR(cdfid,t1id,t2id,t0,tunit,n,darr,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read an array of time values from a 2-integer EPIC time axis
+* and return it as double precision time relative to t0
+
+* NOTE:  This routine could be grestly optimized for performance.
+*     This version calls CD_RD_EP_1 for each point.
+*     Instead it could break apart T0 only once and use array reads to read
+*     The double integers directly into the returned double precision array
+*     The integers could then be re-arranged into pairs and converted to 
+*     TMAP times in place.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       t1id     - netCDF variable id of "time"
+*       t2id     - netCDF variable id of "time2"
+*       t0       - T0 string for the time axis
+*       tunit    - number of seconds per axis time unit
+*       n        - number of time values to return
+*       darr     - double precision array returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, t1id, t2id, n, status
+      REAL tunit
+      REAL*8  darr(n)
+      CHARACTER*(*) t0
+
+#ifdef unix
+      include 'tmap_errors.parm'
+#else
+      INCLUDE 'TMAP_FORMAT:TMAP_ERRORS.PARM'
+#endif
+
+* internal variable declarations:
+      INTEGER i
+
+      DO 100 i = 1, n
+ 100  CALL CD_RD_EP_1(cdfid,t1id,t2id,t0,tunit,i,darr(i),status)
+
+      RETURN
+
+      END
+
+
diff --git a/fmt/src/cd_rd_r8_1.F b/fmt/src/cd_rd_r8_1.F
new file mode 100644
index 0000000..856470f
--- /dev/null
+++ b/fmt/src/cd_rd_r8_1.F
@@ -0,0 +1,89 @@
+	SUBROUTINE CD_RD_R8_1(cdfid,varid,index,dtype,errstr,dval,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a single value from a netCDF variable and return it as a double prec.
+* The variable must be a simple array (e.g. an axis)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       index    - subscript of array to return
+*	dtype    - data type of variable
+*       errstr   - identifying string to be printed with error messages
+*       vname    - name of variable owning attribute (used in error msgs)
+*       dval     - double precision value returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, varid, index, dtype, status
+      REAL*8  dval
+      CHARACTER*(*) errstr
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+      INTEGER cdfstat
+
+* read the value
+* NF_ routines convert to desired output data type.
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VAR1_DOUBLE_(cdfid, varid, index, dval)
+#else
+      cdfstat = NF_GET_VAR1_DOUBLE(cdfid, varid, index, dval)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_R8_1', cdfid, varid,
+     .       errstr, no_errstring, *5000 )
+
+      status = merr_ok
+
+ 5000 RETURN
+
+      END
diff --git a/fmt/src/cd_rd_r8_arr.F b/fmt/src/cd_rd_r8_arr.F
new file mode 100644
index 0000000..84c9616
--- /dev/null
+++ b/fmt/src/cd_rd_r8_arr.F
@@ -0,0 +1,97 @@
+	SUBROUTINE CD_RD_R8_ARR( cdfid, varid, start, n, dtype, errstr,
+     .                           dvals, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a series of values from a netCDF variable and return them as 
+* double prec.
+* The variable must be a simple array (e.g. an axis)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* V6.1 3/08 ACM If the data type is double and we return without converting 
+*           the data, we still need to set status to merr_ok.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       start    - start subscript of netCDF variable to return
+*       n        - number of values to return
+*	dtype    - data type of variable
+*       errstr   - identifying string to be printed with error messages
+*       dvals    - double precision values returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, varid, start, n, dtype, status
+      REAL*8  dvals(n)
+      CHARACTER*(*) errstr
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+
+* internal variable declarations:
+      INTEGER cdfstat
+
+* read the value
+* NF_ routines convert to desired output data type.
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VARA_DOUBLE_(cdfid, varid, start, n, dvals)
+#else
+      cdfstat = NF_GET_VARA_DOUBLE(cdfid, varid, start, n, dvals)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_R8_ARR', cdfid, varid,      
+     .       errstr, no_errstring, *5000 )
+
+      status = merr_ok
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_rd_r8_as_r4.c b/fmt/src/cd_rd_r8_as_r4.c
new file mode 100644
index 0000000..b52c5e8
--- /dev/null
+++ b/fmt/src/cd_rd_r8_as_r4.c
@@ -0,0 +1,118 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*  V674 2/12 *acm* 6D Ferret: use NFERDIMS rather than 4 for dimension indexing */
+
+
+
+/* Read a DOUBLE hyperslab from a netCDF file into a FLOAT array.
+   Since the array to be read is bigger than the amount of memory
+   we can count on being available in the calling program buffer
+   we will allocate temporary storage and use it to buffer the read.
+*/
+
+/* compilation may require "-I/usr/local/include" (to find netcdf.h) */
+
+/* Call from FORTRAN using
+
+     CALL CD_RD_R8_AS_R4( cdfid, varid, start, count, ndim, array, cdfstat )
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t  gfortran on linux rh5*/
+#include <netcdf.h>      /* usually in /usr/local/include */
+/* Suns need to include stdio.h to get definition for NULL */
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build */
+#include <stdlib.h> 
+#include <stdio.h>
+#include "ferretmacros.h"  /* with NFERDIMS */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+void cd_rd_r8_as_r4(cdfid,
+#else
+void cd_rd_r8_as_r4_(cdfid,
+#endif
+		    varid,
+		    start,
+		    count,
+		    ndim,
+		    values,
+		    cdfstat)
+
+int *cdfid;
+int *varid;
+int start[NFERDIMS];
+int count[NFERDIMS];
+int *ndim;
+float *values;
+int *cdfstat;/*returns one of: ncnoerr, netCDF status, or -1 (malloc failed)*/ 
+
+{
+
+  int  idim, i, npts, rcode;
+  long cstart[NFERDIMS], ccount[NFERDIMS];
+  double *dvals;
+
+/* change the start/count values to C ordering and the start to zero offset */
+  for (idim=0; idim<*ndim; idim++){
+    cstart[idim] = (long) (start[(*ndim)-1-idim] - 1);
+    ccount[idim] = (long) (count[(*ndim)-1-idim]);
+  }
+/* the total number of data points */
+  for (npts=1,idim=0; idim<*ndim; idim++) npts *= count[idim];
+
+/* allocate memory for the double precision hyperslab */
+  dvals = (double *) malloc(8*npts);
+  if ( dvals == NULL ) {
+    *cdfstat = -1;
+    return;
+  }
+
+/* read the data */
+  rcode = ncvarget(*cdfid,*varid-1,cstart,ccount,dvals);
+  if ( rcode == -1 ) {
+    free(dvals);
+    *cdfstat = ncerr;     /* global var from netcdf.h */
+    return;
+  }
+  
+/* convert to single precision */
+  for (i=0; i<npts; i++) values[i] = (float) dvals[i];
+
+/* successful completion */
+  free(dvals);
+  *cdfstat = NC_NOERR;
+  return;
+}
diff --git a/fmt/src/cd_rd_r8_bnds.F b/fmt/src/cd_rd_r8_bnds.F
new file mode 100644
index 0000000..27e477f
--- /dev/null
+++ b/fmt/src/cd_rd_r8_bnds.F
@@ -0,0 +1,101 @@
+	SUBROUTINE CD_RD_R8_BNDS( cdfid, varid, start, npts, dtype, errstr,
+     .                           dvals, d1s, d1e, d2s, d2e, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a series of values from a netCDF variable and return them as 
+* double prec.
+* The variable must be a simple array (e.g. an axis)
+
+* From cd_rd_r8_arr.F
+* 6/2004
+* 6/04  *acm* for compiler on rh7, need to pass dimensions of array dvals 
+*        into this routine as scalar integers not array elements.
+* V6.1 3/08 ACM If the data type is double and we return without converting 
+*           the data, we still need to set status to merr_ok.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       varid    - variable id in netCDF file
+*       start    - start subscript of netCDF variable to return
+*       n        - number of values to return
+*	dtype    - data type of variable
+*       errstr   - identifying string to be printed with error messages
+*       dvals    - double precision values returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, varid, start(2), npts(2), dtype, status,
+     .        d1s, d1e, d2s, d2e
+      REAL*8  dvals( d1s:d1e, d2s:d2e )
+      CHARACTER*(*) errstr
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+      INTEGER cdfstat, n
+
+* read the values
+* NF_ routines convert to desired output data type.
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VARA_DOUBLE_(cdfid, varid, start, npts, dvals)
+#else
+      cdfstat = NF_GET_VARA_DOUBLE(cdfid, varid, start, npts, dvals)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_R8_ARR', cdfid, varid,      
+     .       errstr, no_errstring, *5000 )
+
+      n = (npts(1)-start(1)+1) * (npts(2)-start(2)+1)
+
+* convert data types
+
+      status = merr_ok
+
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_rd_ymd_1.F b/fmt/src/cd_rd_ymd_1.F
new file mode 100644
index 0000000..cea3519
--- /dev/null
+++ b/fmt/src/cd_rd_ymd_1.F
@@ -0,0 +1,146 @@
+	SUBROUTINE CD_RD_YMD_1(cdfid,t1id,t0,tunit,index,dval,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read a single time value from a "yymmddhhmmss" time axis
+* if T0 is not yet known determine an appropriate value
+* return time value as a double precision time relative to t0
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/95  -- specifically for accessing CDC files
+* V530 *acm* 1/01 add calendar ID in TM_BREAK_DATE, TM_SECS_FROM_BC
+*	    	  calendar is assumed Gregorian
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       t1id     - netCDF variable id of "time"
+*       t0       - T0 string for the time axis
+*       tunit    - number of seconds per axis time unit
+*       index    - subscript of time axis to return
+*       dval     - double precision value returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, t1id, index, status
+      REAL tunit
+      REAL*8  dval
+      CHARACTER*(*) t0
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* internal variable declarations:
+      INTEGER cdfstat, mon, day, yr, hour, min, sec,
+     .        t0year, t0mon, t0day, t0hour, t0min, t0sec
+
+      INTEGER cal_id
+      REAL*8  TM_SECS_FROM_BC
+      REAL*8  yymmdd, date_secs, start_secs, offset_secs
+
+* internal parameter declarations
+      REAL*8      p1900, p0010
+      PARAMETER ( p1900 = 693961. * 24 * 60 * 60,
+     .		  p0010 = 3653.   * 24 * 60 * 60 )
+
+* read the yymmdd value
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_VAR1_DOUBLE_(cdfid, t1id, index, yymmdd)
+#else
+      cdfstat = NF_GET_VAR1_DOUBLE(cdfid, t1id, index, yymmdd)
+#endif
+
+      IF ( cdfstat .NE. NF_NOERR ) CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_RD_YMD_1', cdfid, t1id,
+     .       'yymmdd time', no_errstring, *5000 )
+
+* convert the 2 EPIC integers to a date
+      CALL TM_YMD_TIME_CONVRT( yymmdd,
+     .                         mon, day, yr, hour, min, sec)
+
+* determine seconds from BC. 
+* For this routine set the calendar ID to gregorian always...
+
+      cal_id = 1
+      date_secs  = TM_SECS_FROM_BC (cal_id, yr  , mon, day,
+     .                              hour, min, sec, status)
+      IF (status .ne. merr_ok) GO TO 5000
+
+* determine the T0 value to use
+      IF ( t0 .EQ. ' ' ) THEN 
+         IF ( date_secs .GT. p1900 ) THEN
+            t0 = '1-JAN-1900'
+         ELSEIF ( date_secs .LT. p0010 ) THEN
+            t0 = '1-JAN-0000'
+         ELSE
+	    t0 = '1-JAN-1700'
+         ENDIF
+      ENDIF
+
+* break apart the T0 offset date 
+      CALL TM_BREAK_DATE (t0, cal_id, t0year, t0mon,
+     .                    t0day, t0hour, t0min, t0sec, status)
+      IF (status .ne. merr_ok) GO TO 5000
+
+      start_secs = TM_SECS_FROM_BC (cal_id, t0year, t0mon, t0day,
+     .                              t0hour, t0min, t0sec, status)
+      IF (status .ne. merr_ok) GO TO 5000
+
+* Find the number of seconds since T0
+      offset_secs = date_secs - start_secs
+
+* Divide by time step increment to get # of time step
+      dval = offset_secs/tunit
+
+      status = merr_ok
+      RETURN
+
+* error exit
+ 5000 RETURN
+
+      END
+
+
diff --git a/fmt/src/cd_rd_ymd_arr.F b/fmt/src/cd_rd_ymd_arr.F
new file mode 100644
index 0000000..1f82b7d
--- /dev/null
+++ b/fmt/src/cd_rd_ymd_arr.F
@@ -0,0 +1,85 @@
+	SUBROUTINE CD_RD_YMD_ARR(cdfid,t1id,t0,tunit,n,darr,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* read an array of time values from a "yymmddhhmmss" time axis
+* if T0 is not yet known determine an appropriate value
+* return time values as a double precision time relative to t0
+
+* NOTE:  This routine could be grestly optimized for performance.
+*     This version calls CD_RD_ARR_1 for each point.
+*     Instead it could break apart T0 only once and use array reads to read
+*     The double integers directly into the returned double precision array
+*     The integers could then be re-arranged into pairs and converted to 
+*     TMAP times in place.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/95
+
+* argument definitions:
+*	cdfid	 - netCDF id number for already opened CDF file
+*       t1id     - netCDF variable id of "time"
+*       t0       - T0 string for the time axis
+*       tunit    - number of seconds per axis time unit
+*       n        - number of time values to return
+*       darr     - double precision array returned
+*       status   - TMAP library return status
+
+* argument declarations
+      INTEGER cdfid, t1id, n, status
+      REAL tunit
+      REAL*8  darr(n)
+      CHARACTER*(*) t0
+
+#ifdef unix
+      include 'tmap_errors.parm'
+#else
+      INCLUDE 'TMAP_FORMAT:TMAP_ERRORS.PARM'
+#endif
+
+* internal variable declarations:
+      INTEGER i
+
+      DO 100 i = 1, n
+ 100  CALL CD_RD_YMD_1(cdfid,t1id,t0,tunit,i,darr(i),status)
+
+      RETURN
+
+      END
+
+
diff --git a/fmt/src/cd_read.F b/fmt/src/cd_read.F
new file mode 100644
index 0000000..f373c8d
--- /dev/null
+++ b/fmt/src/cd_read.F
@@ -0,0 +1,431 @@
+	SUBROUTINE CD_READ ( dset, ivar,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride,
+     .		var, sf_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Reads a 4D block of data (lower D being a degenerate case with dimensions
+* being 1 point thick) from a netCDF file
+*
+* replaced "elif" syntax with
+*       else
+*          if
+*  for SGI port  - kob 4/8/92
+*
+* written 2/92 by Steve Hankin for PMEL/TMAP
+
+* bug fix 10/92 - modulo reads require use_lo/hi .NE. dimensioned lo/hi
+*         11/92 - allow 24 character variable names
+* 5/94 - allow reading of DOUBLE variables using routine cd_rd_r8_as_r4.c
+* 8/94 - modulo error message (5400) prints wrong axis
+* 2/95 - small change to allow negative ds_ordering to represent reversed axis
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* 5/99 *sh* (V5.0) - implement strides, reversals, and permutations 
+* 3/00 *kob* (v5.1) - use netcdf v3 calls to read double precision data
+*		rather than having to call cd_rd_r8_as_r4 
+* V510 6/00 *sh* - remove obsolete code left behind by 3/00 fix
+*		 - if variable is scalar fill in trans and grid_dims
+* V521 7/00 *kob* - modify calculation of totsize to take any striding into
+*                   account.
+* v531 5/01 *kob* - fix erroneous error report referencing cd_rd_r8_as_r4
+* v552 4/03 *acm* - Changes for SET VAR/SCALEFAC/OFFSET: apply new scale
+*                   and offset.
+* V600 11/05 *acm*  Fix bug 491 properly -- send missing value to tm_scale
+*                   so that missing data is NOT scaled by scale and offset attrs.
+* V600  6/06 *acm*  needed call to CD_GET_VAR_INFO to define vname for NC_GET_ATTRIB
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V67  *acm* 1/11  Choose between routinesi from the NetCDF API: varm if permutations,
+*                  vars if strides but no perm, var if no strides or perm.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'		! data set dimension
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'	! data set info common
+	external xdset_info_data
+	include 'xstep_files.cmn_text'	! step file common
+	external xstep_files_data
+        include 'xdset_info.cd_equiv'
+#ifdef sun
+        include 'xmachine_byte.cmn'
+#else
+        include 'xmachine_int1.cmn'
+#endif
+
+
+* arguments:
+*	dset        - internal data set # (from GT_INIT_DSET)
+*	ivar        - position in common of variable information
+*       actual_dims - "a_" full dimensions of data_grid array passed
+*	use_lo      - low indices of model data block desired
+*	use_hi      - high indices of model data block desired
+*	stride	    - every nth point to be read from disk file
+*	var         - array containing model data (output)
+*	sf_num      - stepfile number (returned from GT_FIND_TSTEP (output)
+*	status      - error status upon completion (output)
+*
+	INTEGER		dset, ivar, sf_num, status, ndim,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo(nferdims), use_hi(nferdims), stride(nferdims)
+	REAL     	var(a_lo_x:a_hi_x,
+     .                      a_lo_y:a_hi_y,
+     .                      a_lo_z:a_hi_z,
+     .                      a_lo_t:a_hi_t,
+     .                      a_lo_e:a_hi_e,
+     .                      a_lo_f:a_hi_f)
+
+
+* local definitions
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+	LOGICAL      NC_GET_ATTRIB, 
+     .               do_warn, already_scaled, got_it, tf2, 
+     .               coordvar
+        INTEGER      TM_LENSTR1,
+     .               cdfid, varid, idim, lasdim, cdfstat, dim, idim2,
+     .               start(nferdims), filsize(nferdims), totsize, 
+     .               dim_lo(nferdims),dim_hi(nferdims), imap(nferdims), 
+     .		     trans(nferdims), memsize(nferdims), count(nferdims),
+     .		     grid_dims(nferdims), fildim, memdim, filstride(nferdims),
+     .               maxlen, attlen, attoutflag, vtype, nvdims, nvatts, 
+     .               outflag, dlen, err_status, i, permuted, strided
+        REAL vdims(10), val
+	CHARACTER*1	dimnam(nferdims)
+	CHARACTER*13	TM_STRING
+        CHARACTER*128   buff, vname
+	DATA  		dimnam/'I','J','K','L','M','N'/
+	CHARACTER*1024 ebuff, upstr  ! for nf_ error message
+	CHARACTER*10 TM_FMT, errcode
+
+* special equivalence (cannot include in tmap_format/xdset_info.cd_equiv 
+* because "BYTE" isn't supported on DECstation)
+* 10/96 reorder the if def because linux cpp didn't like it
+
+#ifdef unix
+#ifdef sun
+      BYTE cd_data_type(maxvars)
+#else
+      INTEGER*1 cd_data_type(maxvars)
+#endif
+#else
+      BYTE cd_data_type(maxvars)
+#endif
+      EQUIVALENCE ( ds_precision, cd_data_type )
+
+* initialize
+        cdfid = sf_lunit(sf_num)
+        varid = cd_varid(ivar)
+        dim_lo(1) = a_lo_x
+        dim_lo(2) = a_lo_y
+        dim_lo(3) = a_lo_z
+        dim_lo(4) = a_lo_t
+        dim_lo(5) = a_lo_e
+        dim_lo(6) = a_lo_f
+        dim_hi(1) = a_hi_x
+        dim_hi(2) = a_hi_y
+        dim_hi(3) = a_hi_z
+        dim_hi(4) = a_hi_t
+        dim_hi(5) = a_hi_e
+        dim_hi(6) = a_hi_f
+	permuted  = 0
+	strided  = 0
+        do_warn = .TRUE.
+
+* check for error conditions
+        DO 10 idim = 1, nferdims
+	   IF ( use_lo(idim) .LT. ds_grid_start(idim,ivar) .OR.
+     .	        use_hi(idim) .GT. ds_grid_end(idim,ivar) ) GOTO 5200
+	   IF ( use_lo(idim) .GT. use_hi(idim)
+     .    .OR.  use_lo(idim) .LT. dim_lo(idim)
+     .    .OR.  use_hi(idim) .GT. dim_hi(idim) ) GOTO 5300
+ 10     CONTINUE
+
+* summarize the axis permutation specification in ds_order
+        lasdim = 0
+	ndim = 0
+        DO 20 idim = 1, nferdims
+           IF ( ds_ordering(idim,ivar) .EQ. 0 ) GOTO 20
+	   ndim = ndim + 1
+           IF ( ABS(ds_ordering(idim,ivar)) .LE. lasdim )
+     .          permuted = 1
+           lasdim = ABS(ds_ordering(idim,ivar))
+ 20     CONTINUE
+* ... sort the list of relevant axes into grid_dims
+	DO 30 idim = 1, nferdims
+	   trans(idim) =  ABS(ds_ordering(idim,ivar))
+	   grid_dims(idim) = trans(idim)
+ 30	CONTINUE
+	IF ( trans(1) .EQ. 0 ) THEN
+* ... trap for scalar (no dimension) netCDF variables
+	   trans(1) = 1
+	   grid_dims(1) = 1
+	ENDIF
+	DO 34 idim = 1, ndim
+	   DO 32 idim2 = idim+1, ndim
+	      IF (grid_dims(idim) .GT. grid_dims(idim2)) THEN
+	         dim = grid_dims(idim)
+	         grid_dims(idim ) = grid_dims(idim2)
+	         grid_dims(idim2) = dim
+	      ENDIF
+ 32	   CONTINUE
+ 34	CONTINUE
+
+* check for an attempt to read into a sub-portion of a grid
+* (fully supported in GT and TS libs but only partially supported here)
+* it is supported if the sub-region is contiguous - i.e. the sub-limits
+* are along the slowest axis of non-unity size
+        DO 60 idim = 1, nferdims
+           IF ( dim_lo(idim) .NE. use_lo(idim)
+     .     .OR. dim_hi(idim) .NE. use_hi(idim) ) THEN
+              DO 50 idim2 = idim+1, nferdims
+ 50           IF ( dim_lo(idim2) .NE. dim_hi(idim2) ) GOTO 5400
+           ENDIF
+ 60     CONTINUE
+
+* determine size from the low/hi limits requested
+* and compute lower corner relative to the hyper slab in the  netCDF file
+* skip unused dimensions resulting from NORMAL axes
+        DO 100 idim = 1, ndim
+           fildim = trans(idim)
+	   memdim = grid_dims(idim)
+           filsize(fildim) = use_hi(memdim) - use_lo(memdim) + 1
+	   count(fildim)   = (filsize(fildim)-1)/stride(memdim) + 1
+           start(fildim)   = use_lo(memdim) - 
+     .                         ds_grid_start(memdim,ivar) + 1
+	   filstride(fildim) = stride(memdim)
+           IF (stride(memdim) .GT. 1) strided = 1
+ 100    CONTINUE
+
+*  compute the memory array size (for cases where strides are used)
+*  note: transposed compared to filsize
+* *kob* 7/00 - totsize calculation now takes striding into account
+	totsize = 1
+	DO 200 idim = 1, nferdims
+	   memsize(idim) =  (use_hi(idim)-use_lo(idim))/stride(idim) + 1
+	   totsize = totsize * memsize(idim)
+ 200	CONTINUE
+
+* compute the map vector (for strides, reversals, and permutations)
+	DO 210 idim = 1, nferdims
+ 210	imap(idim) = 0
+* for netCDF V3 the imap array is set up in number of array elements, not bytes
+	imap(trans(1)) = 1
+
+	DO 220 idim = 2,ndim
+	   imap(trans(idim)) = imap(trans(idim-1))
+     .			     * (1 + (memsize(grid_dims(idim-1))-1))
+ 220	CONTINUE
+* ... compress the gaps out of the map -- e.g. XYT ==> has a zero in imap(3)
+*     and other arrays
+	idim2 = 0
+	DO 225 idim = 1, nferdims
+	   IF (imap(idim) .EQ. 0) GOTO 225
+	   idim2 = idim2 + 1
+	   imap(idim2)      = imap(idim)
+	   filsize(idim2)   = filsize(idim)
+	   start(idim2)     = start(idim)
+	   count(idim2)     = count(idim)
+	   filstride(idim2) = filstride(idim)
+ 225	CONTINUE
+
+* read the data
+* v5.1 *kob* - Major revision.  Use nc v3 call to read data and convert values
+*              to real/float.  Should work for all datatypes.
+* v5.11 *kob* - add ifdef to check whether or not to append an underscore
+*               to the v3 routine name.  This necessary because DODS netcdf
+*               fortran jackets were configured assuming f2c, which appends
+*               an additional underscore to routine names already containing
+*               and underscore.  The real solution is to configure dods 
+*               correctly, but for now, this kludge is applied
+* v5.33 *sh* - actual reading is buried in a C subroutine
+* V600  *acm*- Fix bug 419 (incompletely fixed before) send missing data
+*              flag to TM_SCALE so that bad data is not scaled.
+* V600  *acm* -Hack to let us read double precision data to be used to 
+*              create an axis, by specifying an offset and reading the
+*              data as double precision, applying the offset and THEN
+*              converting to single precision.
+*      ... when compiling as double precision, the data is read as double
+*      ... and it will be scaled below.  So we just skip this hack.
+
+        already_scaled = .FALSE.
+        status = merr_ok
+#ifndef double_p 
+
+        IF (ds_var_scaleit( ivar ) ) THEN   ! reads data as double precision, if available.
+           CALL CD_READ_SCALE(cdfid, varid, ndim, 
+     .             ds_var_off(ivar), ds_var_scale(ivar), 
+     .             ds_bad_flag(ivar),
+     .             start, count,
+     .		   filstride, imap,
+     .             var(use_lo(1),
+     .                 use_lo(2),
+     .                 use_lo(3),
+     .                 use_lo(4),
+     .                 use_lo(5),
+     .                 use_lo(6)), 
+     .             permuted, strided, already_scaled, cdfstat, status)
+           IF ( cdfstat .NE. NF_NOERR ) GOTO 5500           
+
+           IF (status .NE. merr_ok) THEN   ! try to read as single precision floats
+           
+	      CALL CD_READ_SUB(cdfid, varid, ndim, start, count,
+     .		   filstride, imap,
+     .             var(use_lo(1),
+     .                 use_lo(2),
+     .                 use_lo(3),
+     .                 use_lo(4),
+     .                 use_lo(5),
+     .                 use_lo(6)), permuted, strided, cdfstat)
+	      IF ( cdfstat .NE. NF_NOERR ) GOTO 5500
+           ENDIF
+
+        ELSE
+#endif
+	   CALL CD_READ_SUB(cdfid, varid, ndim, start, count,
+     .		   filstride, imap,
+     .             var(use_lo(1),
+     .                 use_lo(2),
+     .                 use_lo(3),
+     .                 use_lo(4),
+     .                 use_lo(5),
+     .                 use_lo(6)), permuted, strided, cdfstat)
+	   IF ( cdfstat .NE. NF_NOERR ) GOTO 5500
+#ifndef double_p
+        ENDIF
+#endif
+
+* if data has mean or range removed rescale it.
+* Do not scale missing data.
+
+* Check for the scale factors again here (done on SET DATA in cd_get_1_dep_var,
+* but the user may have reset the attributes by now.) If this is a file in a 
+* descriptor file, and if scaling values exist for the variable, then do not reset 
+* scale factors again here.
+* Ticket 1980: initialize the scale attributes in case they don't exist.
+
+        IF (.NOT.is_mc .OR. .NOT.cd_scaled(ivar)) THEN
+           maxlen = 2
+	   cd_scale_factor(ivar) = 1.
+           CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims,
+     .         vdims, nvatts, coordvar, outflag, status)
+           got_it = NC_GET_ATTRIB( dset, varid, 'scale_factor',
+     .                     do_warn, vname, maxlen, attlen, 
+     .                     attoutflag, buff, cd_scale_factor(ivar))
+           maxlen = 2
+	   cd_add_offset(ivar) = 0.
+           tf2    = NC_GET_ATTRIB( dset, varid, 'add_offset',
+     .                     do_warn, vname, maxlen, attlen, 
+     .                     attoutflag, buff, cd_add_offset(ivar))
+
+           cd_scaled(ivar) = got_it .OR. tf2
+        ENDIF
+
+        IF ( cd_scaled( ivar ) ) CALL TM_SCALE(
+     .       cd_scale_factor(ivar), cd_add_offset(ivar),
+     .       ds_bad_flag(ivar), var, totsize )
+
+* if user has asked for new offset and/or scale, apply those, but
+* not to any missing data.
+
+        IF ( ds_var_scaleit(ivar) .AND. (.NOT. already_scaled) )
+     .    CALL TM_SCALE_NOBAD(
+     .       ds_var_scale(ivar), ds_var_off(ivar), var, totsize,
+     .       ds_bad_flag(ivar), ds_missing_flag(ivar) )
+
+* successful completion
+	status = merr_ok
+	RETURN
+
+* error messages
+ 5100      CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_READ', cdfid,
+     .       varid, 'Failed attempting READ', no_errstring, *5900 )
+
+ 5200      CALL TM_ERRMSG (merr_outofgrid, status, 'CD_READ',
+     .     dset, no_stepfile, 'variable '//
+     .     ds_var_code(ivar)(:TM_LENSTR1(ds_var_code(ivar)))//
+     .     ' requested '//
+     .	   dimnam(idim)//'='//TM_STRING(DBLE(use_lo(idim)))//'-'//
+     .	   TM_STRING(DBLE(use_hi(idim))), no_errstring, *5900)
+
+ 5300      CALL TM_ERRMSG(merr_badsubscr, status, 'CD_READ',
+     .     dset, no_stepfile, 'for requested '//dimnam(idim)//
+     .     ' subscripts', no_errstring, *5900)
+
+ 5400      CALL TM_ERRMSG(merr_notsupport, status, 'CD_READ',
+     .     dset, no_stepfile,
+     .     'modulo or random access on netCDF mid-dimension: '//
+     .     dimnam(idim), ' ', *5900)
+
+ 5500	IF ( status .EQ. -1 ) THEN
+ 
+	   CALL TM_ERRMSG( cdfstat+pcdferr, status, 'CD_READ',
+     .	             cdfid, varid,
+     .		    'unable to allocate memory for doub. prec. read',
+     .		     no_errstring, *5900 )
+	ELSE
+	
+           IF (cdfstat .LT. NF_NOERR) THEN
+	      err_status = merr_nc_open 
+	      CALL CD_TRANSLATE_ERROR (cdfstat, ebuff)
+           ELSE IF (cdfstat .EQ. nf_interrupt) THEN
+	      err_status = merr_read_interrupt
+      
+	      CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims,
+     .          vdims, nvatts, coordvar, outflag, status)
+
+	      ebuff = 'Reading variable '//vname(:TM_LENSTR1(vname))//
+     .          ', interrupted from command line'
+           ENDIF
+
+           CALL TM_ERRMSG
+     .     ( err_status, status, 'CD_READ', dset,
+     .        no_stepfile, ebuff, no_errstring, *5900 )
+
+	ENDIF
+
+ 5900	RETURN
+	END
diff --git a/fmt/src/cd_read_remote.F b/fmt/src/cd_read_remote.F
new file mode 100644
index 0000000..509cf87
--- /dev/null
+++ b/fmt/src/cd_read_remote.F
@@ -0,0 +1,318 @@
+	SUBROUTINE CD_READ_REMOTE ( dset, rvar_varid,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride, grid_start, 
+     .		grid_end, grid_order, var, sf_num, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Reads a N-D block of data (3D, 2D being degenerate cases w/ 1 dimension being
+* 1 time series) from TMAP data sets with LET/REMOTE definition.
+*
+* written 2/2013 by Ansley Manke PMEL/TMAP, from TM_CHOOSE_READ and CD_READ
+*                     
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_dims.parm'                ! data set dimension
+        include 'tmap_errors.parm'              ! err code parm defs
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'             ! grid info
+        external xgt_grid_data
+        include 'xdset_info.cmn_text'   ! data set info common
+        external xdset_info_data
+        include 'xdset_info.cd_equiv'
+	include 'xstep_files.cmn_text'	! step file common
+	external xstep_files_data
+
+* arguments:
+*	dset        - internal data set # (from GT_INIT_DSET)
+*       rvar_varid  - varid in ftds dataset to read
+*       actual_dims - "a_" full dimensions of data_grid array passed
+*	use_lo      - low indices of model data block desired
+*	use_hi      - high indices of model data block desired
+*	stride	    - every nth point to be read from disk file
+*       gridlines   - lists the line ids that are part of the remote-variable grid
+*	var         - array containing model data (output)
+*	sf_num      - stepfile number (returned from GT_FIND_TSTEP (output)
+*	status      - error status upon completion (output)
+*
+	INTEGER		dset, rvar_varid, sf_num, status, ndim,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo(*), use_hi(*), stride(*), 
+     .		grid_start(*), grid_end(*), grid_order(*)
+	REAL     	var(a_lo_x:a_hi_x,
+     .                      a_lo_y:a_hi_y,
+     .                      a_lo_z:a_hi_z,
+     .                      a_lo_t:a_hi_t,
+     .                      a_lo_e:a_hi_e,
+     .                      a_lo_f:a_hi_f),
+     .			baddat
+
+
+* local definitions
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+	LOGICAL      NC_GET_ATTRIB, 
+     .               do_warn, already_scaled, got_it, tf2, 
+     .               coordvar
+        INTEGER      TM_LENSTR1,
+     .               cdfid, varid, idim, lasdim, cdfstat, dim, idim2,
+     .               start(nferdims), filsize(nferdims), totsize, 
+     .               dim_lo(nferdims),dim_hi(nferdims), imap(nferdims), 
+     .		     trans(nferdims), memsize(nferdims), count(nferdims),
+     .		     grid_dims(nferdims), fildim, memdim, filstride(nferdims),
+     .               maxlen, attlen, attoutflag, vtype, nvdims, nvatts, 
+     .               outflag, dlen, err_status, i, permuted, strided
+        REAL vdims(10), val
+	CHARACTER*1	dimnam(nferdims)
+	CHARACTER*13	TM_STRING
+        CHARACTER*128   buff, vname
+	DATA  		dimnam/'I','J','K','L','M','N'/
+	CHARACTER*1024 ebuff, upstr  ! for nf_ error message
+	CHARACTER*10 TM_FMT, errcode
+
+* special equivalence (cannot include in tmap_format/xdset_info.cd_equiv 
+* because "BYTE" isn't supported on DECstation)
+* 10/96 reorder the if def because linux cpp didn't like it
+
+#ifdef unix
+#ifdef sun
+      BYTE cd_data_type(maxvars)
+#else
+      INTEGER*1 cd_data_type(maxvars)
+#endif
+#else
+      BYTE cd_data_type(maxvars)
+#endif
+      EQUIVALENCE ( ds_precision, cd_data_type )
+
+* initialize
+        cdfid = sf_lunit(dset)
+        varid = rvar_varid
+        dim_lo(1) = a_lo_x
+        dim_lo(2) = a_lo_y
+        dim_lo(3) = a_lo_z
+        dim_lo(4) = a_lo_t
+        dim_lo(5) = a_lo_e
+        dim_lo(6) = a_lo_f
+        dim_hi(1) = a_hi_x
+        dim_hi(2) = a_hi_y
+        dim_hi(3) = a_hi_z
+        dim_hi(4) = a_hi_t
+        dim_hi(5) = a_hi_e
+        dim_hi(6) = a_hi_f
+	permuted  = 0
+	strided  = 0
+        do_warn = .TRUE.
+
+* check for error conditions
+	DO 10 idim = 1, nferdims
+	      IF ( use_lo(idim) .LT. grid_start(idim) .OR.
+     .	        use_hi(idim) .GT. grid_end(idim) ) GOTO 5200
+	      IF ( use_lo(idim) .GT. use_hi(idim)
+     .       .OR.  use_lo(idim) .LT. dim_lo(idim)
+     .       .OR.  use_hi(idim) .GT. dim_hi(idim) ) GOTO 5300
+ 10     CONTINUE
+* summarize the axis permutation specification in ds_order
+
+        lasdim = 0
+	ndim = 0
+        DO 20 idim = 1, nferdims
+           IF ( grid_order(idim) .EQ. 0 ) GOTO 20
+	   ndim = ndim + 1
+           IF ( ABS(grid_order(idim)) .LE. lasdim )
+     .          permuted = 1
+           lasdim = ABS(grid_order(idim))
+ 20     CONTINUE
+
+* ... compress the list of relevant axes into grid_dims
+	DO 30 idim = 1, nferdims
+	   trans(idim) = grid_order(idim)
+	   grid_dims(idim) = trans(idim)
+ 30	CONTINUE
+
+	IF ( trans(1) .EQ. 0 ) THEN
+* ... trap for scalar (no dimension) netCDF variables
+	   trans(1) = 1
+	   grid_dims(1) = 1
+	ENDIF
+	DO 34 idim = 1, ndim
+	   DO 32 idim2 = idim+1, ndim
+	      IF (grid_dims(idim) .GT. grid_dims(idim2)) THEN
+	         dim = grid_dims(idim)
+	         grid_dims(idim ) = grid_dims(idim2)
+	         grid_dims(idim2) = dim
+	      ENDIF
+ 32	   CONTINUE
+ 34	CONTINUE
+
+* check for an attempt to read into a sub-portion of a grid
+* (fully supported in GT and TS libs but only partially supported here)
+* it is supported if the sub-region is contiguous - i.e. the sub-limits
+* are along the slowest axis of non-unity size
+        DO 60 idim = 1, nferdims
+           IF ( dim_lo(idim) .NE. use_lo(idim)
+     .     .OR. dim_hi(idim) .NE. use_hi(idim) ) THEN
+              DO 50 idim2 = idim+1, nferdims
+ 50           IF ( dim_lo(idim2) .NE. dim_hi(idim2) ) GOTO 5400
+           ENDIF
+ 60     CONTINUE
+
+* determine size from the low/hi limits requested
+* and compute lower corner relative to the hyper slab in the  netCDF file
+* skip unused dimensions resulting from NORMAL axes
+        DO 100 idim = 1, ndim
+           fildim = trans(idim)
+	   memdim = grid_dims(idim)
+           filsize(fildim) = use_hi(memdim) - use_lo(memdim) + 1
+	   count(fildim)   = (filsize(fildim)-1)/stride(memdim) + 1
+           start(fildim)   = use_lo(memdim) 
+	   filstride(fildim) = stride(memdim)
+           IF (stride(memdim) .GT. 1) strided = 1
+ 100    CONTINUE
+
+*  compute the memory array size (for cases where strides are used)
+*  note: transposed compared to filsize
+* *kob* 7/00 - totsize calculation now takes striding into account
+	totsize = 1
+	DO 200 idim = 1, nferdims
+	   memsize(idim) =  (use_hi(idim)-use_lo(idim))/stride(idim) + 1
+	   totsize = totsize * memsize(idim)
+ 200	CONTINUE
+
+* compute the map vector (for strides, reversals, and permutations)
+	DO 210 idim = 1, nferdims
+ 210	imap(idim) = 0
+* for netCDF V3 the imap array is set up in number of array elements, not bytes
+	imap(trans(1)) = 1
+
+	DO 220 idim = 2,ndim
+	   imap(trans(idim)) = imap(trans(idim-1))
+     .			     * (1 + (memsize(grid_dims(idim-1))-1))
+ 220	CONTINUE
+* ... compress the gaps out of the map -- e.g. XYT ==> has a zero in imap(3)
+*     and other arrays
+	idim2 = 0
+	DO 225 idim = 1, nferdims
+	   IF (imap(idim) .EQ. 0) GOTO 225
+	   idim2 = idim2 + 1
+	   imap(idim2)      = imap(idim)
+	   filsize(idim2)   = filsize(idim)
+	   start(idim2)     = start(idim)
+	   count(idim2)     = count(idim)
+	   filstride(idim2) = filstride(idim)
+ 225	CONTINUE
+
+* read the data
+
+        already_scaled = .FALSE.
+        status = merr_ok
+
+        CALL CD_READ_SUB(cdfid, varid, ndim, start, count,
+     .		filstride, imap,
+     .		var(use_lo(1),
+     .              use_lo(2),
+     .              use_lo(3),
+     .              use_lo(4),
+     .              use_lo(5),
+     .              use_lo(6)), permuted, strided, cdfstat)
+        IF ( cdfstat .NE. NF_NOERR ) GOTO 5500
+
+* Data from F-TDS data reads should not be scaled. If it were,
+* handle that here...
+
+
+* successful completion
+
+	status = merr_ok
+	RETURN
+
+* error messages
+ 5100	CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_READ', cdfid,
+     .       varid, 'Failed attempting READ', no_errstring, *5900 )
+
+ 5200   CONTINUE 
+	CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims,
+     .          vdims, nvatts, coordvar, outflag, status)
+	CALL TM_ERRMSG (merr_outofgrid, status, 'CD_READ_REMOTE',
+     .     dset, no_stepfile, 'variable '//
+     .     vname(:TM_LENSTR1(vname))//
+     .     ' requested '//
+     .	   dimnam(idim)//'='//TM_STRING(DBLE(use_lo(idim)))//'-'//
+     .	   TM_STRING(DBLE(use_hi(idim))), no_errstring, *5900)
+
+ 5300	CALL TM_ERRMSG(merr_badsubscr, status, 'CD_READ',
+     .     dset, no_stepfile, 'for requested '//dimnam(idim)//
+     .     ' subscripts', no_errstring, *5900)
+
+ 5400	CALL TM_ERRMSG(merr_notsupport, status, 'CD_READ',
+     .     dset, no_stepfile,
+     .     'modulo or random access on netCDF mid-dimension: '//
+     .     dimnam(idim), ' ', *5900)
+
+ 5500	IF ( status .EQ. -1 ) THEN
+ 
+	   CALL TM_ERRMSG( cdfstat+pcdferr, status, 'CD_READ',
+     .	             cdfid, varid,
+     .		    'unable to allocate memory for doub. prec. read',
+     .		     no_errstring, *5900 )
+	ELSE
+	
+           IF (cdfstat .LT. NF_NOERR) THEN
+	      err_status = merr_nc_open 
+	      CALL CD_TRANSLATE_ERROR (cdfstat, ebuff)
+           ELSE IF (cdfstat .EQ. nf_interrupt) THEN
+	      err_status = merr_read_interrupt
+      
+	      CALL CD_GET_VAR_INFO (dset, varid, vname, vtype, nvdims,
+     .          vdims, nvatts, coordvar, outflag, status)
+
+	      ebuff = 'Reading variable '//vname(:TM_LENSTR1(vname))//
+     .          ', interrupted from command line'
+           ENDIF
+
+           CALL TM_ERRMSG
+     .     ( err_status, status, 'CD_REMOTE_READ', dset,
+     .        no_stepfile, ebuff, no_errstring, *5900 )
+
+	ENDIF
+
+ 5900	RETURN
+	END
diff --git a/fmt/src/cd_read_scale.c b/fmt/src/cd_read_scale.c
new file mode 100644
index 0000000..fa765e0
--- /dev/null
+++ b/fmt/src/cd_read_scale.c
@@ -0,0 +1,242 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*   
+    cd_read_scale.c -- from cd_read_sub.c to read data as double
+    precision, if that is how they are in the file, and apply the
+    scale and offset values before converting to single precision.
+    
+  v6.01 9/06 *acm* use a malloc rather than a fixed buffer -> the data
+              does not need to be 1-D
+*/ 
+/* *acm   2/11 v67  - Call nc_get_varm only if strides and permuted.
+                      Call nc_get_vars if strided, and nc_get_vara if neither permuted
+					  nor strided. */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *					 definition of macro DFTYPE in ferretmacros.h. */
+/*  V674 2/12 *acm* 6D Ferret: use NFERDIMS rather than 4 for dimension indexing */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <netcdf.h>
+
+#include "ferretmacros.h"
+#include "list.h"
+#include "NCF_Util.h"
+
+
+/* prototype */
+void tm_scale_buffer(DFTYPE *dat, double *dbuff,
+			   DFTYPE *offset, DFTYPE *scale, DFTYPE *bad,
+			   int ntotal);
+
+void FORTRAN(cd_read_scale) (int *cdfid, int *varid, int *dims, 
+			   DFTYPE *offset, DFTYPE *scale, DFTYPE* bad,
+			   int *tmp_start, int *tmp_count, 
+			   int *tmp_stride, int *tmp_imap,
+			   void *dat, int *permuted, int *strided, int *already_scaled,
+			   int *cdfstat, int *status)
+
+{
+
+  /* convert FORTRAN-index-ordered, FORTRAN-1-referenced ids, count,
+     and start to C equivalent
+
+     *kob* need start,count,stride and imap variables of the same type
+           as is predfined for each O.S.
+  */
+
+  size_t start[NFERDIMSP1], count[NFERDIMSP1];
+  ptrdiff_t stride[NFERDIMSP1], imap[NFERDIMSP1];
+
+  int tmp, i, maxstrlen, ndimsp, *dimids;
+  size_t bufsiz;
+  int ndim = *dims - 1; /* C referenced to zero */
+  int vid = *varid;
+  nc_type vtyp;
+  int n_sections;
+  int ntotal;
+  int scale_it;
+  double *data_double;
+
+  /* cast passed in int values (from fortran) to proper types, which can
+     be different depending on o.s       *kob* 11/01 */
+  ntotal = 1;
+  for (i=0; i<=ndim; i++) {
+    start[i] = (size_t)tmp_start[i];
+    count[i] = (size_t)tmp_count[i];
+	ntotal = ntotal * count[i];
+    stride[i] = (ptrdiff_t)tmp_stride[i];
+    imap[i] = (ptrdiff_t)tmp_imap[i];
+  }
+
+
+  /* change FORTRAN indexing and offsets to C */
+  vid--;
+  for (i=0; i<=ndim; i++)
+    start[i]--;
+  for (i=0; i<=ndim/2; i++) {
+    tmp = count[i];
+    count[i] = count[ndim-i];
+    count[ndim-i] = tmp;
+    tmp = start[i];
+    start[i] = start[ndim-i];
+    start[ndim-i] = tmp;
+    tmp = stride[i];
+    stride[i] = stride[ndim-i];
+    stride[ndim-i] = tmp;
+    tmp = imap[i];
+    imap[i] = imap[ndim-i];
+    imap[ndim-i] = tmp;
+  }
+
+  /* get the type of the variable on disk */
+  *cdfstat = nc_inq_vartype(*cdfid, vid, &vtyp);
+  if (*cdfstat != NC_NOERR) {
+      return;
+  }
+
+  *status = 3;  /* merr_ok*/
+
+
+  if (vtyp == NC_CHAR) 
+	{
+	  *status = 111;
+	  return;
+	}
+
+  scale_it = 0;
+  if (*offset != 0 || *scale != 1)
+  { scale_it = 1;
+  }
+  if (vtyp == NC_DOUBLE && scale_it) 
+  {
+
+    /* Read into a buffer area as double precision,
+	   and apply the scaling before converting to single precision 
+	   in variable dat
+    */
+
+      data_double = (double *) malloc(ntotal * sizeof(double));
+      if ( data_double == NULL )
+          abort();
+
+      if (*permuted > 0)
+      {
+      *cdfstat = nc_get_varm_double (*cdfid, vid, start,
+				  count, stride, imap, data_double);
+      }
+	  else if (*strided > 0)
+	  {
+      *cdfstat = nc_get_vars_double (*cdfid, vid, start,
+				  count, stride, data_double);
+      }
+	  else
+	  {
+      *cdfstat = nc_get_vara_double (*cdfid, vid, start,
+				  count, data_double);
+	  }
+
+
+      tm_scale_buffer ((DFTYPE*) dat, data_double, offset,
+         scale, bad, ntotal);
+	  *already_scaled = 1;
+
+	  free(data_double);
+                  
+  }
+   
+  /* read float data */
+  else
+  {
+      if (*permuted > 0)
+	  {
+#ifdef double_p
+    *cdfstat = nc_get_varm_double (*cdfid, vid, start,
+     count, stride, imap, (double*) dat); 
+	  }
+	  else if (*strided > 0)
+	  {
+    *cdfstat = nc_get_vars_double (*cdfid, vid, start,
+     count, stride, (double*) dat);
+      }
+	  else
+	  { 
+    *cdfstat = nc_get_vara_double (*cdfid, vid, start,
+     count, (double*) dat);
+#else
+    *cdfstat = nc_get_varm_float (*cdfid, vid, start,
+     count, stride, imap, (float*) dat); 
+	  }
+	  else if (*strided > 0)
+	  {
+    *cdfstat = nc_get_vars_float (*cdfid, vid, start,
+     count, stride, (float*) dat);
+      }
+	  else
+	  { 
+    *cdfstat = nc_get_vara_float (*cdfid, vid, start,
+     count, (float*) dat);
+#endif
+	  }
+  }
+
+  return;
+}
+
+/*  */
+void tm_scale_buffer(DFTYPE *dat, double *dbuff,
+                     DFTYPE *offset, DFTYPE *scale, DFTYPE *bad,
+                     int ntotal)
+
+{
+        int j;
+        double dbad;
+
+        dbad = (double)*bad;
+        for (j=0; j<ntotal; j++ )
+        {
+                if (dbuff[j] == dbad)
+                        { dat[j] = *bad;
+                        }
+                else
+                        {dat[j] = dbuff[j] * *scale + *offset;
+                }
+        }
+    return;
+}
diff --git a/fmt/src/cd_read_sub.c b/fmt/src/cd_read_sub.c
new file mode 100644
index 0000000..9551cd2
--- /dev/null
+++ b/fmt/src/cd_read_sub.c
@@ -0,0 +1,253 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*   
+    cd_read_sub.c -- this routine hides the call to netCDF routine
+    NF_GET_VARM_<type> allowing last minute modifications to the
+    call arguments for Ferret interactive data analysis program
+
+    programmer - steve hankin
+    NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+    revision history:
+    V533: 6/01 *sh* - original
+
+    v540: 11/01 *kob* - change passed in values for start,count,stride
+                        and imap to temp variables which are declared
+			compatibly with the passed in types from the 
+			fortran routine CD_READ.F.  Once in, need to 
+			convert these to the proper type that the 
+			netcdf c routines expect.  This may vary from
+			o.s. to o.s. depending on what, for example,
+			size_t and ptrdiff_t are typdef'd as.  They are
+			typedef'd as different things under solaris and 
+			compaq Tru64, for example
+
+
+     V542: 11/02 *acm*  Need start and count to be length [5] to allow for
+			string dimension.  Same for stride[5], imap[5]
+
+    compile this with
+    cc -c -g -I/opt/local/netcdf-3.4/include cd_read_sub.c
+*/ 
+
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build
+                      Other changes to correctly deal with the scalar case dim=0 */ 
+/* *acm   2/11 v67  - Call nc_get_varm only if strides and permuted.
+                      Call nc_get_vars if strided, and nc_get_vara if neither permuted
+					  nor strided. */
+/*  *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*                                        definition of macro DFTYPE in ferretmacros.h. */
+/*  V674 2/12 *acm* 6D Ferret: use NFERDIMS rather than 4 for dimension indexing */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdlib.h>
+#include <netcdf.h>
+#include "ferretmacros.h"
+#include "list.h"
+#include "NCF_Util.h"
+
+
+/* prototype */
+void tm_unblockify_ferret_strings(void *dat, char *pbuff,
+				int bufsiz, int outstrlen);
+
+void FORTRAN(cd_read_sub) (int *cdfid, int *varid, int *dims, 
+			   int *tmp_start, int *tmp_count, 
+			   int *tmp_stride, int *tmp_imap,
+			   double *dat, int *permuted, int *strided,
+			   int *cdfstat )
+{
+
+  /* convert FORTRAN-index-ordered, FORTRAN-1-referenced ids, count,
+     and start to C equivalent
+
+     *kob* need start,count,stride and imap variables of the same type
+           as is predfined for each O.S.
+  */
+  size_t start[7], count[7];
+  ptrdiff_t stride[7], imap[7], tmp_ptrdiff_t;
+
+  int i, ndimsp, *dimids;
+  size_t bufsiz, tmp, tmpstride, maxstrlen;
+  char *pbuff;
+  int ndim = 0;
+  int indim = *dims;
+  int vid = *varid;
+  nc_type vtyp;
+
+	if (*dims > 0)
+		ndim = *dims - 1; /* C referenced to zero */
+
+  /* cast passed in int values (from fortran) to proper types, which can
+     be different depending on o.s       *kob* 11/01 */
+  for (i=0; i<7; i++) {
+    start[i] = (size_t)tmp_start[i];
+    count[i] = (size_t)tmp_count[i];
+    stride[i] = (ptrdiff_t)tmp_stride[i];
+    imap[i] = (ptrdiff_t)tmp_imap[i];
+  }
+
+  /* change FORTRAN indexing and offsets to C */
+  vid--;
+  for (i=0; i<=ndim; i++)
+		{
+			if (start[i] > 0)
+				start[i]--;
+		}
+
+	if (ndim > 0)
+		{
+			for (i=0; i<=ndim/2; i++) 
+				{
+					tmp = count[i];
+					count[i] = count[ndim-i];
+					count[ndim-i] = tmp;
+					tmp = start[i];
+					start[i] = start[ndim-i];
+					start[ndim-i] = tmp;
+					
+					tmp_ptrdiff_t = stride[i];
+					stride[i] = stride[ndim-i];
+					stride[ndim-i] = tmp_ptrdiff_t;
+					tmp_ptrdiff_t = imap[i];
+					imap[i] = imap[ndim-i];
+					imap[ndim-i] = tmp_ptrdiff_t;
+				}
+		}
+
+  /* get the type of the variable on disk */
+  *cdfstat = nc_inq_vartype(*cdfid, vid, &vtyp);
+  if (*cdfstat != NC_NOERR) {
+      return;
+  }
+  /* write out the data */
+  if (vtyp == NC_CHAR) {
+    /* Read into a buffer area with the multi-dimensiona array of strings
+       packed into a block. Unpack it into "dat".
+       The "dat" variables is a pointer to an array of string pointers
+       where the string pointers are spaced 8 bytes apart
+    */
+      *cdfstat = nc_inq_varndims (*cdfid, vid, &ndimsp);
+      if (*cdfstat != NC_NOERR) {
+          return;
+      }
+      dimids = (int *) malloc(sizeof(int) * ndimsp);
+      if ( dimids == NULL )
+          abort();
+      ndimsp--;
+      *cdfstat = nc_inq_vardimid (*cdfid, vid, dimids);
+      if (*cdfstat != NC_NOERR) {
+          return;
+      }
+      *cdfstat = nc_inq_dimlen (*cdfid, dimids[ndimsp], &bufsiz);
+      if (*cdfstat != NC_NOERR) {
+          return;
+      }
+      free(dimids);
+      maxstrlen = bufsiz;
+      if (indim > 0) {
+         for (i=0; i<=ndim; i++) bufsiz *= count[i];
+	 }
+      pbuff = (char *) malloc(sizeof(char) * bufsiz);
+      if ( pbuff == NULL )
+         abort();
+      /* update variable dimensions to include string dimension */
+      start[ndimsp]  = 0;
+      count[ndimsp]  = maxstrlen;
+      stride[ndimsp] = 1;
+      for (i=0; i<=ndim; i++) imap[i] *= (ptrdiff_t)maxstrlen;      
+      imap[ndimsp] = 1;
+
+      if (*permuted > 0)
+      {
+      *cdfstat = nc_get_varm_text (*cdfid, vid, start,
+                                    count, stride, imap, pbuff);
+      }
+	  else if (*strided > 0)
+	  {
+      *cdfstat = nc_get_vars_text (*cdfid, vid, start,
+                                    count, stride, pbuff);
+      }
+	  else
+	  {
+      *cdfstat = nc_get_vara_text (*cdfid, vid, start,
+                                    count, pbuff);
+	  }
+
+      tm_unblockify_ferret_strings(dat, pbuff, bufsiz, (int)maxstrlen);
+      free(pbuff);
+
+  /* Numeric data. Read as double or float */
+  } else
+#ifdef double_p	  
+      if (*permuted > 0)
+	  {
+    *cdfstat = nc_get_varm_double (*cdfid, vid, start,
+     count, stride, imap, (double*) dat); 
+	  }
+	  else if (*strided > 0)
+	  {
+    *cdfstat = nc_get_vars_double (*cdfid, vid, start,
+     count, stride, (double*) dat);
+      }
+	  else
+	  { 
+    *cdfstat = nc_get_vara_double (*cdfid, vid, start,
+     count, (double*) dat);
+	  }
+#else
+      if (*permuted > 0)
+	  {
+    *cdfstat = nc_get_varm_float (*cdfid, vid, start,
+     count, stride, imap, (float*) dat); 
+	  }
+	  else if (*strided > 0)
+	  {
+    *cdfstat = nc_get_vars_float (*cdfid, vid, start,
+     count, stride, (float*) dat);
+      }
+	  else
+	  { 
+    *cdfstat = nc_get_vara_float (*cdfid, vid, start,
+     count, (float*) dat);
+	  }
+#endif
+
+  return;
+}
+
diff --git a/fmt/src/cd_rec_synch.F b/fmt/src/cd_rec_synch.F
new file mode 100644
index 0000000..7ce0b7d
--- /dev/null
+++ b/fmt/src/cd_rec_synch.F
@@ -0,0 +1,350 @@
+	SUBROUTINE CD_REC_SYNCH ( cdfid, lo, hi, tmrecax, grid,
+     .                            start, axid, vartyp, reset, 
+     .                            old_box_hi, new_box_lo, do_bounds,
+     .                            status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine where along the record axis to write data in a netCDF
+* output file
+* Extend the record axis if the coordinates given fit into the
+* axis ordering
+* Check carefully (and laboriously!) to determina if axis point spacing is
+* regular
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+* note: commented out references to line 1000 are to support disordered axes
+* 10/92: bug fix: use TM_FPEQ to check time words
+*        performance: write time data outside to avoid multiple ncendf calls
+* 12/92: pass back vartyp so data type is correct in cd_write_var axis appends
+* 1/97:  issues a one-time warning if an irregular time axis is extended
+*	 (since the box bounds will not be saved)
+* 6/97:  changed "STATIC" to SAVE for f90 compatibility
+*	 also moved var assignments off of declaration line *kob*
+
+* V570  *acm* 5/04 Do not issue the warning about irregular record axis,
+*                  Bounds are used rather than edges for defining irregular 
+*                  axis cell boundaries.  Check whether there is a gap
+*                  between the high box-bound of the existing axis and
+*                  the low box-bound of the new axis to be appended.
+*      *acm* 6/04  for compiler on rh7, need to pass dimensions of array into cd_rd_r8_bnds 
+*                  as scalar integers not array elements.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     lo      - lowest index from variable grid on record axis
+*     hi      - highest index from variable grid on record axis
+*     tmrecax - axis number (1-nferdims) of record axis in grid (for errmsg, only)
+*     grid    - defining grid for variable
+*     start   - file record number for next write (returned)
+*     axid    - CDF var no of coordinate variable for record axis
+
+* include files
+        include 'netcdf.inc'
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+        include 'cd_lib.parm'
+        include 'tmap_errors.parm'
+        include 'xio.cmn_text'
+        external xio_data
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      LOGICAL do_bounds
+      INTEGER cdfid, lo, hi, tmrecax, start, axid, grid, vartyp, 
+     .        reset, status
+
+* local variable declarations:
+      LOGICAL CD_GET_ATTRIB, TM_DFPEQ, got_bnds
+      INTEGER TM_LENSTR1, 
+     .        alen, look, hi_look, lo_look,
+     .        ndims, nvars, cdfstat,
+     .        nvdim, vdims(8), nvatts,
+     .        ngatts, npts, recdim, blen, bndid,
+     .        startpts(2), numpts(2),  d1s, d1e, d2s, d2e
+      CHARACTER axnam*128, buff*16, bname*30
+      CHARACTER*1     dimnam(nferdims)
+      DATA dimnam/'I','J','K','L','M','N'/
+      CHARACTER*13 TM_STRING
+
+      REAL*8 TM_WORLD, new_coord, hi_val, lo_val, val,
+     .       new_box_lo, old_box_hi, hi_val_1
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* local parameter declarations
+      LOGICAL     append, do_warn
+      INTEGER     str_eq
+      REAL        unspecified_val4
+      PARAMETER ( str_eq = 0,
+     .            unspecified_val4 = -2E34,
+     .            append = .TRUE., do_warn=.TRUE. )
+
+* get the vital statistics for the CDF file
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_INQ_(cdfid, ndims, nvars, ngatts, recdim)
+#else
+	cdfstat = NF_INQ (cdfid, ndims, nvars, ngatts, recdim)
+#endif
+
+* get the name of the record axis
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_DIM_( cdfid, recdim, axnam, npts )
+#else
+        cdfstat = NF_INQ_DIM ( cdfid, recdim, axnam, npts )
+#endif
+
+        alen = TM_LENSTR1( axnam )
+
+* is there a coordinate variable by this name ?  If not, error (for now)
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VARID_( cdfid, axnam(:alen), axid )
+#else
+        cdfstat = NF_INQ_VARID ( cdfid, axnam(:alen), axid )
+#endif
+
+        IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+* get the vital statistics of the coordinate variable
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VAR_(cdfid, axid, buff, vartyp, nvdim, vdims,
+     .                nvatts)
+#else
+        cdfstat = NF_INQ_VAR (cdfid, axid, buff, vartyp, nvdim, vdims,
+     .                nvatts)
+#endif
+
+* locate the new coordinate values at end of coordinate axis ?
+* see if the first of the new coordinates exceeds the last already in the file
+        new_coord = TM_WORLD( lo, grid, tmrecax, box_middle )
+        new_box_lo = 0.D0
+        old_box_hi = 0.D0
+        reset = 0
+
+        IF ( npts .GT. 0 ) THEN
+           CALL CD_RD_R8_1( cdfid, axid, npts, vartyp,
+     .                      'axis: '//axnam(:alen), hi_val, cdfstat )
+           IF ( cdfstat .NE. merr_ok ) GOTO 5900
+           CALL CD_RD_R8_1( cdfid, axid, 1, vartyp,
+     .                      'axis: '//axnam(:alen), lo_val, cdfstat )
+           IF ( cdfstat.NE.merr_ok ) GOTO 5900
+* 4/99 *kob* - call to new routine tm_dfpeq for double precision compares
+           IF ( TM_DFPEQ(new_coord,hi_val) ) THEN
+              start = npts
+              GOTO 4000
+           ELSEIF ( new_coord .GT. hi_val ) THEN
+              start = npts + 1
+              GOTO 1000
+           ENDIF
+        ELSE
+           hi_val = unspecified_val8
+           start = 1
+           GOTO 4000
+        ENDIF
+
+* binary search to locate new coordinate in file
+* ... initialize search with coordinate of first point
+        IF ( TM_DFPEQ(new_coord, lo_val) ) THEN
+           start = 1
+           GOTO 4000
+        ELSEIF ( new_coord .LT. lo_val ) THEN
+           GOTO 5200 
+        ENDIF
+        lo_look = 0
+        hi_look = npts + 1
+        look = ( lo_look + hi_look ) / 2
+
+* top of search loop
+ 100    CALL CD_RD_R8_1( cdfid, axid, look, vartyp,
+     .                   'axis: '//axnam(:alen), val, cdfstat )
+        IF ( cdfstat.NE.merr_ok ) GOTO 5900
+        IF ( TM_DFPEQ(new_coord, val) ) THEN
+* ... found it
+           start = look
+           GOTO 1000
+        ELSEIF ( hi_look - lo_look .LE. 1 ) THEN
+* ... value not on axis
+           GOTO 5200
+        ELSEIF ( new_coord .GT. val ) THEN
+* ... look higher
+           IF ( look .EQ. hi_look ) GOTO 5200
+           lo_look = look
+           lo_val = val
+           look = ( look + hi_look + 1 ) / 2
+        ELSE
+* ... look lower
+           IF ( look .EQ. lo_look ) GOTO 5200
+           hi_look = look
+           hi_val = val
+           look = ( look + lo_look + 1 ) / 2
+        ENDIF
+        GOTO 100
+
+ 1000   CONTINUE
+
+* is there a bounds attribute for this axis? 
+
+       got_bnds = CD_GET_ATTRIB( cdfid, axid, 'bounds',
+     .                       do_warn, axnam(:alen), bname, blen, 30 )
+
+       IF (got_bnds) THEN
+
+* Always write bounds when appending to axis which has bounds
+
+          do_bounds = .TRUE.  
+
+* Get upper bound of last box on existing axis
+
+#ifdef usingDODSf2cUnderscore
+          cdfstat = NF_INQ_VARID_( cdfid, bname(:blen), bndid )
+#else
+          cdfstat = NF_INQ_VARID ( cdfid, bname(:blen), bndid )
+#endif
+
+          startpts(1) = 2  ! get uppper bound, 1 point
+          numpts(1) = 1
+
+* get upper bound of last point to be used on existing axis
+          startpts(2) = start-1  
+          numpts(2) = 1
+
+          d1s = startpts(1)
+          d1e = numpts(1)
+          d2s = startpts(2)
+          d2e = numpts(2)
+          CALL CD_RD_R8_BNDS( cdfid, bndid, startpts, numpts, vartyp, 
+     .                    bname(:blen), old_box_hi, d1s, d1e, d2s, d2e,  
+     .                    status )
+
+* Get lower bound of first point to be output
+
+          new_box_lo = TM_WORLD( lo, grid, tmrecax, box_lo_lim )
+
+* Reconcile upper bound of last point on existing axis with lower bound of new axis
+* reset = 0  no change to bounds is needed
+*       = 1  gap between old_hi and new_lo, so add a void point with these as bounds
+*       = 2  need to reset new_lo to match old_hi
+
+          IF (TM_DFPEQ(old_box_hi, new_box_lo) ) THEN 
+*  no need to adjust; bounds line up.
+              reset = 0
+
+          ELSE IF (old_box_hi .LT. new_box_lo) THEN
+*  need to add a void point, with bounds [old_box_hi , new_box_lo]
+              reset = 1
+
+          ELSE   !  (old_box_hi .GT. new_box_lo) 
+             IF (old_box_hi .LT. new_coord) THEN 
+*  old_box_hi is between new_box_lo and new_coord, so use old_box_hi for new_box_lo
+                reset = 2
+                new_box_lo = old_box_hi
+
+             ELSE IF (old_box_hi .GE. new_coord) THEN
+                IF (new_box_lo .GT. hi_val) THEN 
+*  Issue an error message: high bound of last point of existing axis greater than
+*  the first coordinate of points being appended; cannot reset old_box_hi
+                   GO TO 5300
+                ELSE   
+*  new_box_lo is < hi_val, so use old_box_hi for new_box_lo
+                   reset = 2
+                   new_box_lo = old_box_hi
+                ENDIF
+             ENDIF
+          ENDIF
+
+       ELSE   ! (not got_bnds)
+
+* Check whether we are outputting the next point on a regularly spaced axis.
+* If we are skipping points, issue a warning.
+
+          IF (new_coord .GT. hi_val .AND. npts .GT. 1) THEN  
+
+              CALL CD_RD_R8_1( cdfid, axid, npts-1, vartyp,
+     .              'axis: '//axnam(:alen), hi_val_1, cdfstat )
+              IF (.NOT. TM_DFPEQ(hi_val-hi_val_1, new_coord-hi_val) ) THEN
+                 CALL WARN( 
+     . 'Appending to NetCDF record axis which has no bounds attribute.')
+                 CALL WARN( 
+     . 'This will result in incorrect box sizes on record axis: '
+     .             // axnam(:alen))
+                 CALL WARN( 
+     . 'Write the data initially with the /BOUNDS qualifier')
+              ENDIF
+           ENDIF
+
+       ENDIF
+
+* successful completion
+ 4000   status = merr_ok
+        RETURN
+
+* error exits
+ 5100  CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_REC_SYNCH', cdfid, axid,
+     .       'axis: '//axnam(:alen), no_errstring, *5900 )
+ 5200  CALL TM_ERRMSG
+     .      ( merr_badlinedef, status, 'CD_REC_SYNCH', no_descfile,
+     .        no_stepfile,
+     .       'disordered output coordinate value:'
+     .       //TM_STRING(new_coord)//' Axis: '//axnam(:alen),
+     .       no_errstring , *5900 )
+ 5300  CALL TM_ERRMSG     
+     .      ( merr_badlinedef, status, 'CD_REC_SYNCH', no_descfile,
+     .        no_stepfile,
+     . 'output coordinate is inside upper bound of existing axis cell:'
+     .       //TM_STRING(new_coord)//' Axis: '//axnam(:alen),
+     .       no_errstring , *5900 )
+ 5900  CONTINUE
+#ifdef usingDODSf2cUnderscore	
+       cdfstat = NF_REDEF_( cdfid ) ! back into define mode
+#else
+       cdfstat = NF_REDEF( cdfid ) ! back into define mode
+#endif
+
+       RETURN
+       END
diff --git a/fmt/src/cd_rename_var.F b/fmt/src/cd_rename_var.F
new file mode 100644
index 0000000..33e75fb
--- /dev/null
+++ b/fmt/src/cd_rename_var.F
@@ -0,0 +1,81 @@
+      SUBROUTINE CD_RENAME_VAR (dset, varid, newvarname, status)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Read the linked list structure for netcdf variable information: 
+* given dset and variable id, replace name of variable with new name.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 6/11 *acm* 
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+#include "gt_lib.parm"
+      INCLUDE "tmap_errors.parm"
+
+* Argument declarations
+
+      CHARACTER*(*) newvarname
+      INTEGER dset, varid, status
+
+* Internal declarations
+
+      INCLUDE 'netcdf.inc'
+
+      INTEGER TM_LENSTR1, NCF_RENAME_VAR,
+     .        slen, flen, dset_num
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      status = atom_not_found
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      slen = TM_LENSTR1( newvarname )
+      CALL TM_FTOC_STRNG( newvarname(1:slen), fhol, flen )
+
+      status = NCF_RENAME_VAR(dset_num, varid, fhol)
+      
+ 5000 RETURN
+      END
diff --git a/fmt/src/cd_replace_attr.F b/fmt/src/cd_replace_attr.F
new file mode 100644
index 0000000..f2190c2
--- /dev/null
+++ b/fmt/src/cd_replace_attr.F
@@ -0,0 +1,119 @@
+      SUBROUTINE CD_REPLACE_ATTR (dset, varid, attname, attype, 
+     .                            attlen, string, vals, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Replace an attribute type and/or value in the linked list structure for netcdf 
+* Inputs: dset, varid, attribute specification
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 9/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname, string
+      INTEGER dset, varid, attype, attlen, status
+      REAL vals(*)
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      LOGICAL cv
+      INTEGER TM_LENSTR1, NCF_REPL_VAR_ATT,
+     .        flen, slen, wlen, vdims(8), vartype, nvdims, nvatts, 
+     .        all_outflag, dset_num
+      CHARACTER*128 vname
+
+      PARAMETER (flen=size_rbuff)      ! size of attribute string
+
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+      slen = TM_LENSTR1( attname )
+      CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      IF (attype .NE. NF_CHAR) THEN
+
+         slen = 1
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         status = NCF_REPL_VAR_ATT(dset_num, varid, fhol, attype, 
+     .           attlen, vals, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ELSE
+         slen = TM_LENSTR1( string)
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         vals(1) = 1.
+         status = NCF_REPL_VAR_ATT(dset_num, varid, fhol, attype, 
+     .           slen, vals, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ENDIF
+
+5000  RETURN
+
+
+! Error
+ 5300 CALL CD_GET_VAR_INFO (dset_num, varid, vname, vartype, nvdims, 
+     .   vdims, nvatts, cv, all_outflag, status)
+      slen = TM_LENSTR1( attname )
+      wlen = TM_LENSTR1( vname )
+      risc_buff(1:slen) = attname
+      risc_buff(slen+1:slen+14) = ' for variable '
+      risc_buff(slen+15:slen+15+wlen) = vname
+      CALL TM_ERRMSG (merr_attalready, status, 'CD_PUT_NEW_ATTR',
+     .           dset_num, no_stepfile, 
+     .           risc_buff(1:slen+15+wlen),
+     .           no_errstring, *5000)
+      END
diff --git a/fmt/src/cd_replace_attr_dp.F b/fmt/src/cd_replace_attr_dp.F
new file mode 100644
index 0000000..c3cd6b8
--- /dev/null
+++ b/fmt/src/cd_replace_attr_dp.F
@@ -0,0 +1,118 @@
+      SUBROUTINE CD_REPLACE_ATTR_DP (dset, varid, attname, attype, 
+     .                            attlen, string, vals, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Replace an attribute type and/or value in the linked list structure for netcdf 
+* Inputs: dset, varid, attribute specification
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V601 11/06 *acm* Attribute control, adding double precision attribute value
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V604  6/07 *acm* Declare VALS as double precision! 
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname, string
+      INTEGER dset, varid, attype, attlen, status
+      REAL*8 vals(*)
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      LOGICAL cv
+      INTEGER TM_LENSTR1, NCF_REPL_VAR_ATT_DP, NCF_REPL_VAR_ATT, 
+     .        flen, slen, wlen, vdims(8), vartype, nvdims, nvatts, 
+     .        all_outflag, dset_num
+      CHARACTER*128 vname
+
+      PARAMETER (flen=size_rbuff)      ! size of attribute string
+
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+
+      slen = TM_LENSTR1( attname )
+      CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+      IF (attype .EQ. NCDOUBLE) THEN
+
+         slen = 1
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         status = NCF_REPL_VAR_ATT_DP(dset_num, varid, fhol, attype, 
+     .           attlen, vals, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ELSE
+         slen = TM_LENSTR1( string)
+         CALL TM_FTOC_STRNG( string(1:slen), ghol, flen )
+         
+         vals(1) = 1.
+         status = NCF_REPL_VAR_ATT(dset_num, varid, fhol, attype, 
+     .           slen, vals, ghol)
+         IF (status .LT. 0) GOTO 5300
+
+      ENDIF
+
+5000  RETURN
+
+
+! Error
+ 5300 CALL CD_GET_VAR_INFO (dset_num, varid, vname, vartype, nvdims, 
+     .   vdims, nvatts, cv, all_outflag, status)
+      slen = TM_LENSTR1( attname )
+      wlen = TM_LENSTR1( vname )
+      risc_buff(1:slen) = attname
+      risc_buff(slen+1:slen+14) = ' for variable '
+      risc_buff(slen+15:slen+15+wlen) = vname
+      CALL TM_ERRMSG (merr_attalready, status, 'CD_REPLACE_ATTR_DP',
+     .           dset_num, no_stepfile, 
+     .           risc_buff(1:slen+15+wlen),
+     .           no_errstring, *5000)
+      END
diff --git a/fmt/src/cd_scan_vars.F b/fmt/src/cd_scan_vars.F
new file mode 100644
index 0000000..55d008a
--- /dev/null
+++ b/fmt/src/cd_scan_vars.F
@@ -0,0 +1,489 @@
+	SUBROUTINE CD_SCAN_VARS(dset,cdfid,reversed,tregular,use_strict,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user5/4/2005
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Loads common blocks XDSET_INFO, XSTEP_FILES, and grid COMMON with vital
+* system and background information from a netCDF file
+* It processes FERRET special attributes without regard to whether variables
+* are "generic" or "FERRET"
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92 - adds a new data set format to TMAP libraries
+*              - based loosely on EZ_INIT_DSET
+*      4/18/92 - replaced "elif" syntax with
+*                   else
+*                     if
+*                for sgi port   *kob*
+*      8/18/92 - variable name with attribute error messages
+*       3/4/93 - read global bad data flag (for EPIC files)
+*              - don't process EPIC variable 'time2'
+*	  5/94 - added support for DOUBLE variables
+*	 11/94 - ignore the "history" attribute.  Use "long_name_mod" instead.
+*	  2/95 - check data type of missing_value.  Possibly convert
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* 7/98 *sh* - allow broader flexibility in variable names through retaining
+*             original case when appropriate
+* 1/99 *sh* - fixed bug introduced in 7/98 changes -- blows up when file has
+*		only coord variables (e.g. climatological_axes)
+* 2/99 *kob* - adding call to SWITCH_NAN for NaN recognition
+* V500 3/99 *sh* -- most of this routine removed to cd_get_1_dep_var
+*	and this routine consolidated with cd_get_axes. The consolidation
+*	allows us to process invalid axes as dependent variables rather than
+*	rejecting the netCDF file 
+* 3/99 *kob* - make sure to pass the correct string length for newly upped
+*              parameter values
+* V510 *sh* 3/00: added tregular argument
+*		- convert to dynamic grid and axis management
+* V552 5/03 *acm*: increase size of vname from 64 to 128 chars
+* V600 8/05 *amc*  Fix bug 1318, wrong string length of bname in last arg to CD_GET_ATTRIB
+* V600 *ACM* attribute control. 
+*             Change call to CD_GET_ATTRIB to NC_GET_ATTRIB - get attrib from 
+*               linked list structure
+*             CD_GET_ATTVAL replaced by NC_GET_ATTRIB, which now returns  
+*               strings or real values according to attrib type
+*             Replace NCINQ with NCF_INQ_DS
+*             Replace NCVINQ for variables, with CD_GET_VAR_INFO
+*             Replace NCDID with CD_GET_DIM_ID
+*             Replace NCDINQ with CD_GET_DS_DIMS
+* V601 *acm*  Fix bug 1445: if there were no global attributes, then the flag 
+*             global_bad was not set (defaulted to 0). so for a netcdf file 
+*             without global attributes, variables having no missing value 
+*             flags got bad-flag of 0.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V67   1/11 *acm* Fix ticket 1777. If a coordinate variale is STRING, issue notes.
+* V67   1/11 *acm* Fix ticket 1794. If no missing/fillvalue, issue a warning ONLY
+*             when diagnostic mode is set.
+* v67   2/11 *acm* Do the notes about no missing/fillvalue for each variable,
+*             when in diagnostic mode. So move that back to cd_get_1_dep_var.
+* V68   4/11 *acm* fix 1848: skip vars with dim>4 or string vars with dim>5
+* V68  *acm* 1/12- added use_strict argument for ticket 1910: micro-adjusting on 
+*                  repeated coordinates in netCDF/OPeDNAP datasets
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.87 4/14 *acm* ticket 2146: if invalid bounds, make the bounds a dependent variale.
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*	cdfid   - id of currently open CDF file
+*	reversed    - logical array to record which axes have reversed coords
+*	status	- return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xbuild_grids.cmn'
+
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+        include 'xio.cmn_text'
+
+* argument declarations:
+	LOGICAL        reversed(max_lines:line_ceiling), tregular, use_strict
+	INTEGER	      dset, cdfid, status
+
+* local parameter definitions:
+	LOGICAL	    do_warn
+	INTEGER     str_eq
+	PARAMETER ( str_eq = 0,
+     .		    do_warn = .TRUE. )
+
+* local variable declarations:
+*  ivtm - TMAP library variable ID
+*  ivcd - netCDF file variable ID
+      LOGICAL NC_GET_ATTRIB, 
+     .        TM_LEGAL_NAME, MATCH_NAME,
+     .        got_it, got_bad, its_epic, 
+     .        got_a_variable, failed_axis, 
+     .        coordvar
+      INTEGER STR_UPCASE, STR_CASE_BLIND_COMPARE, TM_LENSTR1, 
+     .        TM_LENSTR, NCF_INQ_DS, 
+     .        nvars,  ndims, ngatts, recdim, 
+     .        cdfstat, las_pos, first_pos, iaxis,
+     .        ivcd, ivtm, vartyp, nvdim, vdims(8), nvatts, i, vlen,
+     .        istat, npts, epic_t2,
+     .        nbvar, ivar, len_test, len_mchars, 
+     .        attype, attlen, attoutflag, maxlen, iatt, 
+     .        varid, all_outflag, dset_num, attid, bad_bndsid
+
+      REAL vals  ! potential numerical attributes
+      CHARACTER*128 aname
+
+* ?? how many bounds variables (bname) might there be ??
+
+      INTEGER max_vnamelen
+      PARAMETER (max_vnamelen = 128)
+      CHARACTER    vname*128, name*16, buff*128
+      CHARACTER*128 bname(30)
+      REAL global_bad
+      REAL dg_bad
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+* special equivalence (cannot include in tmap_format/xdset_info.cd_equiv because "BYTE"
+* isn't supported on DECstation
+* reorder loop logic because linux cpp didn't like it *kob* 10/96
+
+#ifdef unix
+#ifdef sun
+      BYTE cd_data_type(maxvars)
+#else
+      INTEGER*1 cd_data_type(maxvars)
+#endif
+#else
+      BYTE cd_data_type(maxvars)
+#endif
+
+
+      EQUIVALENCE ( ds_precision, cd_data_type )
+
+* initialize: save the state of grid memory prior to any new definitions
+* ... save original start of free line memory
+	orig_line_mem = next_line_mem_pos
+
+* ... flag all axes as non-reversed as the default
+	DO 10 i = max_lines, line_ceiling
+ 10	reversed(i) = .FALSE.
+
+!* ... how many grid spaces used before we start ?
+!	status = TM_FIND_GRID_SLOT ( firstgrid )
+!        lastgrid = firstgrid - 1
+!	IF (status .NE. merr_ok) GOTO 5900
+!
+!* ... how many line spaces used before we start ?
+!	status = TM_FIND_LINE_SLOT ( firstax )
+!        lastax = firstax - 1
+!	IF (status .NE. merr_ok) GOTO 5900
+
+* get the vital statistics for the data set 
+
+        dset_num = dset
+        IF (dset_num .LT. -2) dset_num = -2
+        istat = NCF_INQ_DS (dset_num, ndims, nvars, ngatts, recdim )
+
+        its_epic = ds_type(dset) .EQ. 'ECDF'
+
+* set the  default value of the global_bad flag (used by EPIC but sometimes missing)
+        IF ( its_epic ) THEN
+           global_bad = 1.E35     ! default for EPIC
+        ELSE
+           global_bad = -1.E34    ! default for FERRET
+        ENDIF
+
+* See fi there is a global attribute missing_value in the file
+
+        IF (ngatts .GT. 0) THEN
+           CALL CD_GET_VAR_ID (dset, '.', varid, status)
+
+* loop through global attributes looking for missing-value attrib
+           DO 20 iatt = 1, ngatts
+
+* get global attribute name
+              name = ' '
+              CALL CD_GET_VAR_ID (dset, '.', varid, status)
+              CALL CD_GET_VAR_ATT_NAME( dset, varid, iatt, name, status)
+              maxlen = 128
+              IF ( name .EQ. 'missing_value' .OR. 
+     .             name .EQ. 'MISSING_VALUE')
+     .           got_bad = NC_GET_ATTRIB ( dset, varid, name, do_warn, 
+     .                       '.', maxlen, attlen, attoutflag, 
+     .                       buff, dg_bad)
+
+              IF (got_bad) THEN
+                 global_bad = dg_bad
+              ENDIF
+  20       CONTINUE
+
+        ENDIF
+
+*   * * * loop through all variables in the net CDF file * * *
+*  Get any bounds attribute for each axis, save the bounds
+*  name.  Then these names do not need to be processed as dependent 
+*  variables.
+
+        nbvar = 0
+        DO 2000 ivcd = 1,nvars
+
+* get the vital statistics for this variable
+
+           CALL CD_GET_VAR_INFO (dset, ivcd, vname, vartyp,
+     .                 nvdim, vdims, nvatts, coordvar, 
+     .                 all_outflag, status)
+           IF ( status .NE. merr_ok ) GOTO 5200
+           vlen = TM_LENSTR1(vname)
+
+* If it is marked as a coordinate variable but is of string type, then
+* issue a message. The variable of the same name will contain the strings.
+
+	   IF (coordvar .AND. vartyp.EQ.NF_CHAR) THEN 
+	      CALL TM_NOTE(
+     .           'Coordinate variable '//
+     .           vname(:vlen)//' is of type STRING.', lunit_errors )
+              status = STR_UPCASE( buff, vname )
+              CALL TM_NOTE(
+     .           'A dummy axis of subscripts will be used. '// 
+     .           'Variable '//buff(:vlen)//' contains the strings', 
+     .           lunit_errors )
+              GOTO 400
+	   ENDIF   
+	    
+*** DECIDE IF IT IS AN AXIS OR A DEPENDENT VARIABLE
+* if it is not 1D it must be a dependent variable (3/99)
+
+	   IF ( nvdim .NE. 1 ) GOTO 400
+
+* if var name doesn't match a dim name it isn't a coordinate var
+           CALL CD_GET_DIM_ID (dset, vname(:vlen), i)
+           IF (i .EQ. atom_not_found) GOTO 400
+
+* See if it has a bounds attribute 
+
+           maxlen = 128
+           got_it = NC_GET_ATTRIB( dset, ivcd, 'bounds',
+     .              do_warn, vname(:vlen), maxlen, attlen, attoutflag, 
+     .              bname(nbvar+1), vals )
+
+           IF (got_it ) THEN
+
+              CALL CD_GET_VAR_ATT_ID (dset, ivcd, 'bounds', attid, 
+     .              status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, ivcd, 
+     .              attid, aname, attype, attlen, attoutflag, istat )
+
+              IF (attype .EQ. nf_char) THEN
+                 nbvar = nbvar + 1
+                 istat = STR_UPCASE( bname(nbvar), bname(nbvar) )
+              ENDIF
+           ENDIF
+
+  400      CONTINUE
+ 2000   CONTINUE
+
+*   * * * loop through all variables in the net CDF file * * *
+
+* classify each as a coordinate variable (axis) or as a dependent
+* variable. If a coordinate variable then TRY to interpret it,
+* (in cd_get_1_axis) but if it proves to be invalid, then process
+* it, instead, as a dependent variable
+	las_pos  = 1    ! reduces redundant search for space
+	got_a_variable = .FALSE.
+	
+	DO 1000 ivcd = 1,nvars
+
+* initialize
+	   failed_axis = .FALSE.
+
+* get the vital statistics for this variable
+
+           CALL CD_GET_VAR_INFO (dset, ivcd, vname, vartyp, nvdim,
+     .                 vdims, nvatts, coordvar, all_outflag, status)
+           IF ( status .NE. merr_ok ) GOTO 5200
+           vlen = TM_LENSTR1(vname)
+
+*** CHECK A NUMBER OF REASONS TO IGNORE THIS VARIABLE
+* is the dimension name "grid_definition" ? If so, handled elsewhere
+
+           CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts, istat)
+           IF ( istat .NE. merr_ok ) GOTO 5200
+
+           istat = STR_CASE_BLIND_COMPARE('grid_definition', buff(:15) )
+           IF ( istat .EQ. str_eq ) GOTO 1000
+
+* or is it milliseconds for an an EPIC time axis? If so, handled with "time"
+           IF ( its_epic .AND. vname(:vlen).EQ.'time2' ) GOTO 1000
+
+* Is it an edge definition ? If so, process w/ corresponding axis
+           maxlen = max_vnamelen 
+           got_it = NC_GET_ATTRIB( dset, ivcd, 'edges', do_warn, 
+     .                            vname(:vlen), maxlen, attlen,
+     .                            attoutflag, buff, vals)
+
+           IF ( got_it .AND. buff.EQ.' ' ) GOTO 1000
+
+* or is it really a child axis (avail for. generic CDF apps but not needed) ?
+           maxlen = 16  !linenamlen
+           got_it = NC_GET_ATTRIB( dset, ivcd, 'child_axis',
+     .                            do_warn, vname(:vlen), maxlen, attlen,
+     .                            attoutflag, name, vals ) 
+           IF ( got_it ) GOTO 1000
+
+* or is it really a bounds variable for an axis?  If so it is processed with the axis.
+
+           len_test = TM_LENSTR(vname)
+           IF (nbvar .GT. 0) then 
+              DO 30 ivar = 1, nbvar
+                 len_mchars = TM_LENSTR(bname(ivar))
+                 IF (MATCH_NAME(vname, len_test, bname(ivar), len_mchars )) GOTO 1000
+   30         CONTINUE
+           ENDIF
+
+* is it a supported dimensionality (6d, strings have extra dimension) ?
+          IF ( nvdim .GT. nferdims+1 ) THEN
+             CALL TM_NOTE('Unsupported netCDF # of axes for variable. Ignoring '
+     .             //vname(:vlen), tt )
+             GOTO 1000
+          ENDIF
+
+* is it a supported dimensionality (numeric can be 6D)?
+          IF ( nvdim .GT. nferdims .AND. vartyp.NE. NCCHAR ) THEN
+             CALL TM_NOTE('Unsupported netCDF # of axes for variable. Ignoring '
+     .             //vname(:vlen), tt )
+             GOTO 1000
+          ENDIF
+
+*** DECIDE IF IT IS AN AXIS OR A DEPENDENT VARIABLE
+* if it is not 1D it must be a dependent variable (3/99)
+	   IF ( nvdim .NE. 1 ) GOTO 500
+
+* if for some reason it is desirable for an axis name not to match its dim
+* name then the "parent_axis" attribute can flag that it is a parent axis 
+           maxlen = 16  !linenamlen
+           got_it = NC_GET_ATTRIB( dset, ivcd, 'parent_axis',
+     .                            do_warn, vname(:vlen), maxlen,
+     .                            attlen, attoutflag, name, vals )
+
+           IF ( got_it ) GOTO 100
+
+* if var name doesn't match a dim name it isn't a coordinate var
+           CALL CD_GET_DIM_ID (dset, vname(:vlen), i)
+           IF (i .EQ. atom_not_found) GOTO 500
+
+* PROCESS AN AXIS	   
+ 100        CALL CD_GET_1_AXIS(dset, cdfid, ivcd, iaxis,
+     .                         its_EPIC, reversed, tregular, use_strict, 
+     .                         bad_bndsid, status)
+           IF ( status .NE. merr_ok ) GOTO 5900
+
+* invalid bounds or edges found. Make the bounds a dependent variable
+	   IF (bad_bndsid .GT. 0) THEN
+	     CALL CD_GET_1_DEP_VAR ( dset, cdfid, bad_bndsid, las_pos, global_bad, 
+     .				   ivtm, status )
+             GOTO 501
+           ENDIF
+
+	   IF (iaxis .NE. 0) GOTO 1000		! iaxis>0 if axis was made
+	   failed_axis = .TRUE.			! go on and treat as a dep. var
+
+* PROCESS A DEPENDENT VARIANLE
+ 500	   CALL CD_GET_1_DEP_VAR ( dset, cdfid, ivcd, las_pos, global_bad, 
+     .				   ivtm, status )
+
+ 501       IF (status .NE. merr_ok) GOTO 5900
+	   IF ( ivtm .NE. 0 ) THEN
+	      las_pos = ivtm	! optimizes next hunt for slot
+	      IF (.NOT.got_a_variable) THEN
+	         first_pos = ivtm
+	         got_a_variable = .TRUE.
+	      ENDIF
+	   ENDIF
+	   IF ( failed_axis ) ds_var_titl_mod(ivtm) = 
+     .				'invalid coordinate axis'
+           
+	   IF (bad_bndsid .GT. 0) THEN
+	      ds_var_titl_mod(ivtm) = 'invalid axis bounds'
+	      bad_bndsid = 0
+	   ENDIF
+
+* EPIC KLUDGE: if an EPIC file has an invalid "TIME" axis we want, not only
+* "TIME" as a dependent variable, but also "TIME2"
+	   IF ( its_epic .AND. vname(:vlen).EQ.'time' ) THEN
+	      CALL CD_GET_VAR_ID ( dset, 'time2', epic_t2, status )
+	      IF ( epic_t2 .GT. 0 ) THEN
+	        CALL CD_GET_1_DEP_VAR (dset,cdfid, epic_t2,
+     .			las_pos, global_bad, ivtm, status )
+	        IF (status .NE. merr_ok) GOTO 5900
+	        IF ( ivtm .NE. 0 ) THEN
+	          las_pos = ivtm	! optimizes next hunt for slot
+	          IF (.NOT.got_a_variable) THEN
+	            first_pos = ivtm
+	            got_a_variable = .TRUE.
+	          ENDIF
+	        ENDIF
+	         ds_var_titl_mod(ivtm) = 'invalid EPIC time axis'
+	     ENDIF
+	   ENDIF
+
+ 1000    CONTINUE
+*   * * * * * * * * * * * * * * * * * * * * * * * * 
+
+* pass through the variable names making sure that case-sensitive
+* duplicates (e.g. 'var' and 'VAR') retain case and that names which
+* would be illegal variable names to Ferret are retained in original form
+
+
+	IF (got_a_variable) THEN
+	  DO 310 ivtm = first_pos,las_pos
+	    IF (ds_var_setnum(ivtm) .NE. dset) GOTO 310
+	    IF (.NOT.TM_LEGAL_NAME(ds_var_code(ivtm))) GOTO 310  ! leave as-is
+* ... see if this name case-blind duplicates any other in the data set
+	    DO 300 i = first_pos,las_pos
+* ... *kob* v541 8/02 - need to also check and make sure we are still dealing with the
+*     same dataset.  if not, when variables from different data sets are interleaved 
+*     in ds_var_code this can cause Ferret to not properly upcase variables from 
+*     one dset that have the same name as variables in another dset. 
+	      IF ( i .EQ. ivtm .OR. ds_var_setnum(i) .NE. dset) GOTO 300
+	      istat = STR_CASE_BLIND_COMPARE(ds_var_code(ivtm),
+     .                                       ds_var_code(i)    )
+	      IF ( istat .EQ. str_eq ) GOTO 310                  ! leave as-is
+ 300	    CONTINUE
+* ... (finally) upcase the name
+*	  istat = STR_UPCASE( ds_var_code(ivtm), ds_var_code(ivtm) )
+          CALL string_array_modify_upcase(ds_var_code_head,ivtm,
+     .                                    ds_var_code(ivtm),
+     .                                    LEN(ds_var_code(ivtm)))
+ 310    CONTINUE
+	ENDIF
+
+* successful completion
+	status = merr_ok
+	RETURN
+
+* ERROR MESSAGES
+ 5200   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_SCAN_VARS', cdfid,
+     .        no_varid, no_errstring, no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_set_att_axdir.F b/fmt/src/cd_set_att_axdir.F
new file mode 100644
index 0000000..8171034
--- /dev/null
+++ b/fmt/src/cd_set_att_axdir.F
@@ -0,0 +1,62 @@
+      SUBROUTINE CD_SET_ATT_AXDIR (dset, varid, axdir, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set the axis direction in the linked-list structure
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 12/05 *acm* Attribute control.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+
+* Argument declarations
+
+      INTEGER dset, varid, axdir, status
+
+* Internal declarations
+
+      INTEGER NCF_SET_AXDIR, dset_num
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+* set axis direction for this coordinate variable 
+* (ncf_set_axdir double checks that it is a coord)
+
+      status = NCF_SET_AXDIR( dset_num, varid, axdir)
+      
+      RETURN
+      END
diff --git a/fmt/src/cd_set_att_flag.F b/fmt/src/cd_set_att_flag.F
new file mode 100644
index 0000000..0b06fd9
--- /dev/null
+++ b/fmt/src/cd_set_att_flag.F
@@ -0,0 +1,121 @@
+      SUBROUTINE CD_SET_ATT_FLAG (dset, varid, attname, iflag, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set the attribute output flag to iflag (1 or 0)
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 12/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      CHARACTER*(*) attname
+      INTEGER dset, varid, iflag, status
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      LOGICAL cv
+      INTEGER TM_LENSTR, NCF_SET_ATT_FLAG, NCF_SET_VAR_OUT_FLAG, 
+     .        flen, slen, wlen, 
+     .        i, vtype, nvdims, nvatts, vdims(8), all_outflag, dset_num
+      CHARACTER*128 vname
+
+      PARAMETER (flen=size_rbuff)      ! size of attribute string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+* set output flag for this variable and attribute
+
+      slen = TM_LENSTR( attname )
+      IF (slen .GT. 0) THEN
+      
+         CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+         status = NCF_SET_ATT_FLAG( dset_num, varid, fhol, iflag)
+
+         IF (status .LT. 0) GOTO 5300
+
+      ELSE     ! SET ATT/OUT=all or SET ATT/OUT=default
+
+         status = NCF_SET_VAR_OUT_FLAG( dset_num, varid, iflag)
+
+c* set flag for all attributes of this variable
+c
+c         CALL CD_GET_VAR_INFO (dset, varid, vname, vtype,
+c     .                              nvdims, vdims, nvatts, cv, 
+c     .                              all_outflag, status)
+c         DO 100 i = 1, nvatts
+c            CALL CD_GET_VAR_ATT_NAME (dset, varid, i, attname, status )
+c
+c            slen = TM_LENSTR( attname )
+c            CALL TM_FTOC_STRNG( attname(1:slen), fhol, flen )
+c         
+c            status = NCF_SET_ATT_FLAG( dset, varid, fhol, iflag)
+c            IF (status .LT. 0) GOTO 5300
+c 100     CONTINUE
+      ENDIF
+
+5000  RETURN
+
+
+! Error message, 
+ 5300 CALL CD_GET_VAR_INFO (dset, varid, vname, vtype,
+     .                              nvdims, vdims, nvatts, cv, 
+     .                              all_outflag, status)
+      slen = TM_LENSTR( attname )
+      wlen = TM_LENSTR( vname )
+      risc_buff(1:slen) = attname
+      risc_buff(slen+1:slen+14) = ' for variable '
+      risc_buff(slen+15:slen+15+wlen) = vname
+      CALL TM_ERRMSG (merr_attalready, status, 'CD_SET_ATT_FLAG',
+     .           dset_num, no_stepfile, 
+     .           risc_buff(1:slen+15+wlen),
+     .           no_errstring, *5000)
+      END
diff --git a/fmt/src/cd_set_chunk_cache.F b/fmt/src/cd_set_chunk_cache.F
new file mode 100644
index 0000000..3185465
--- /dev/null
+++ b/fmt/src/cd_set_chunk_cache.F
@@ -0,0 +1,136 @@
+      SUBROUTINE CD_SET_CHUNK_CACHE (cache_size, cache_nelems, 
+     .     cache_preemption, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set a new chunk cache size, nelems and/or preemption. User specifies 
+* cache size in bytes, counts.  If any was unspecified it will come in with a negative
+* value and should remain unchanged.
+* If all arguments are -1, restore the default from the netcdf library.
+* If any individual argument comes in as -1, use the current value;
+* e.g. the user will probably set the cache size but leave other values 
+* unchanged.
+
+* From the netcdf-4 docs:
+* sizep
+*    The total size of the raw data chunk cache. 
+* nelemsp
+*    The number of chunk slots in the raw data chunk cache hash table 
+* preemptionp
+*    The preemtion value is between 0 and 1 inclusive and indicates 
+*    how much chunks that have been fully read are favored for preemption. 
+*    A value of zero means fully read chunks are treated no differently 
+*    than other chunks (the preemption is strictly LRU) while a value of 
+*    one means fully read chunks are always preempted before other chunks. 
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* revision 0.0 - 1/2010
+
+* argument definitions:
+*       cache_mbytes  - Cache size to set
+*	status         - return status
+
+      INCLUDE 'netcdf.inc'
+      INCLUDE 'netcdf4_settings.cmn'
+      INCLUDE 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations:
+      REAL cache_mbytes
+      INTEGER cache_size, cache_nelems, 
+     .     cache_preemption, status
+
+* local variable declarations:
+      INTEGER cdfstat, c_size_in, c_nelems_in, c_preemp_in
+      INTEGER default_preemp_size, default_nelems_size
+
+C Set the cache size for the files created/opened in this session.
+
+C Get current settings ( get cache_nelems, cache_preemption which 
+C are not currently settable by the user.)
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_GET_CHUNK_CACHE_(c_size_in, c_nelems_in, c_preemp_in)
+#else
+      cdfstat = NF_GET_CHUNK_CACHE(c_size_in, c_nelems_in, c_preemp_in)
+#endif
+
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100 
+
+C If it hasnt been done yet, save the default values
+      IF (default_cache_size .EQ. 0) default_cache_size = c_size_in
+      IF (default_nelems_size .EQ. 0) default_nelems_size = c_nelems_in
+      IF (default_preemp_size .EQ. 0) default_preemp_size = c_preemp_in
+
+C If this routine called with all the args set to -1, (cancel NCCACHE)
+C then set to the library default sizes.
+
+      IF (cache_size.LT.0 .AND. cache_nelems.LT.0 .AND. 
+     .                          cache_preemption.LT.0) THEN
+         cache_size = default_cache_size
+         cache_nelems = default_nelems_size
+         cache_preemption = default_preemp_size
+      ENDIF
+
+C If any individual argument comes in as -1, use the current value.
+
+      IF (cache_size .LT. 0) cache_size = c_size_in
+      IF (cache_nelems .LT. 0) cache_nelems = c_nelems_in
+      IF (cache_preemption .LT. 0) cache_preemption = c_preemp_in
+
+C Make the setting.
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_SET_CHUNK_CACHE_(cache_size, cache_nelems, 
+     .     cache_preemption)
+#else 
+      cdfstat = NF_SET_CHUNK_CACHE(cache_size, cache_nelems, 
+     .     cache_preemption)
+#endif
+
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100 
+
+      status = merr_ok
+ 5000 RETURN
+ 5100 CALL TM_ERRMSG (cdfstat+pcdferr, status, 'CD_SET_CHUNK_CACHE',
+     .     no_descfile, no_stepfile, 
+     .    'Setting chunk cache size',
+     .     no_errstring, *5000 )
+      END
+
diff --git a/fmt/src/cd_set_compress.F b/fmt/src/cd_set_compress.F
new file mode 100644
index 0000000..99cb4fd
--- /dev/null
+++ b/fmt/src/cd_set_compress.F
@@ -0,0 +1,140 @@
+      SUBROUTINE CD_SET_COMPRESS (cdfid, varid, vname, dimid, deflate,
+     .                            chunks, shuffle, endian_code, status)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set the netCDF compression for a variable
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* Netcdf-4 with HDF chunking and compression
+* revision 0.0 - 12/09
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*   cdfid   - returned pointer to open CDF file
+*   varid   - variable id
+*   dimid   - id of dimensions
+*   deflate - deflate level (level 1 is recommended)
+*   chunks  - chunking corrresponding to dimid (if all 0 then no set chunking)
+*   shuffle - 0 or 1 to turn on shuffle in NF_DEF_VAR_DEFLATE
+*   endian_code - native=0, little=1, big=0 Values match nf_endian_*
+*   status  - return status
+
+* argument declarations:
+	INTEGER cdfid, varid, dimid(*), deflate, chunks(*), 
+     .          shuffle, endian_code, status
+	CHARACTER*(*) vname
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_dims.parm'
+        include 'cdf_tmap.parm'
+        include 'tmap_errors.parm'
+
+* Declare netcdf function names. 
+* The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+
+* local variable declarations:
+
+      INTEGER cdfstat, idim, vlen
+      INTEGER do_deflate, do_chunk, cdfformat
+
+      CHARACTER*1     ww_dim_nam(nferdims)
+      DATA ww_dim_nam/'X', 'Y', 'Z', 'T', 'E', 'F'/
+
+* Called from CD_MAKE_VAR. We are in define mode
+
+      IF (deflate .GT. 0) do_deflate = 1
+
+* Dataset needs to have been opened with netcdf4 mode, e.g.
+* see cd_open_out NF_CREATE(cdfname, NF_NETCDF4, cdfid)
+* Check this via a call to NF_INQ_FORMAT
+
+#ifdef usingDODSf2cUnderscore 
+           cdfstat = NF_INQ_FORMAT_(cdfid, cdfformat)
+#else
+           cdfstat = NF_INQ_FORMAT (cdfid, cdfformat) 
+#endif
+
+      IF (cdfformat .NE. NF_FORMAT_NETCDF4) GOTO 5200
+
+* Has the user set chunking values?
+
+      do_chunk = 0
+      DO 100 idim = 1, nferdims
+         do_chunk = MAX(do_chunk, chunks(idim) ) 
+  100 CONTINUE
+
+      IF (do_chunk .GT. 0) THEN
+         cdfstat = NF_DEF_VAR_CHUNKING(cdfid, varid, NF_CHUNKED, chunks)
+         IF (cdfstat .NE. NF_NOERR) GOTO 5100
+      ENDIF
+
+* Set output endian-ness. (default is whatever is native to
+* writing machine, NF_ENDIAN_NATIVE).
+      cdfstat = NF_DEF_VAR_ENDIAN(cdfid, varid, endian_code)
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100
+
+      cdfstat = NF_DEF_VAR_DEFLATE(cdfid, varid, shuffle, 
+     .          deflate, do_deflate)
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100
+
+* Turn on fletcher32 checksum for the var
+      cdfstat = NF_DEF_VAR_FLETCHER32(cdfid, varid, NF_FLETCHER32)
+      IF (cdfstat .NE. NF_NOERR) GOTO 5100
+
+
+* successful completion
+      status = merr_ok
+      RETURN
+
+* error messages
+ 5100 CONTINUE
+      CALL TM_ERRMSG
+     .     ( status+pcdferr, status, 'CD_SET_COMPRESS', cdfid,
+     .     no_varid, 'could not set compression', ' ', *5000 )
+
+ 5200 CONTINUE
+      CALL TM_ERRMSG
+     .     ( merr_syntax, status, 'CD_SET_COMPRESS', cdfid,no_varid, 
+     .     'Cannot compress variable: dataset not netcdf4 format', 
+     .     ' ', *5000 )
+
+* error exit
+ 5000 RETURN
+	END
diff --git a/fmt/src/cd_set_mode.F b/fmt/src/cd_set_mode.F
new file mode 100644
index 0000000..578bb42
--- /dev/null
+++ b/fmt/src/cd_set_mode.F
@@ -0,0 +1,111 @@
+	SUBROUTINE CD_SET_MODE(cdfid, mode, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set the netCDF mode to DATA or DEFINE
+* but first check to see if it is already in the desired mode
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 10/92
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       cdfid   - returned pointer to open CDF file
+*       mode    - parameter value from cdf_tmap.parm
+*	status	- return status
+
+* argument declarations:
+	INTEGER	 cdfid, mode, status
+
+* include files
+        include 'netcdf.inc'
+        include 'cdf_tmap.parm'
+        include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+      INTEGER cdf_mode, cdfstat
+
+* must be remembered between calls
+      SAVE cdf_mode
+
+      IF ( mode .EQ. cdf_mode ) THEN
+         status = merr_ok
+         RETURN      ! no change requested
+      ELSEIF ( mode .EQ. pcd_mode_define ) THEN
+* ... enter define mode
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_REDEF_( cdfid )
+#else
+         cdfstat = NF_REDEF( cdfid )
+#endif
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+      ELSEIF ( mode .EQ. pcd_mode_data ) THEN
+* ... enter data mode
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_ENDDEF_( cdfid )
+#else
+         cdfstat = NF_ENDDEF( cdfid )
+#endif
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+      ENDIF
+
+* save the specified mode (the only action taken when mode < 0)
+      cdf_mode = ABS( mode ) 
+
+* successful completion
+      status = merr_ok
+      RETURN
+
+* error messages
+ 5100 CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_SET_MODE', cdfid,
+     .     no_varid, 'could not change CDF mode', ' ', *5000 )
+
+* error exit
+ 5000 RETURN
+	END
diff --git a/fmt/src/cd_set_var_type.F b/fmt/src/cd_set_var_type.F
new file mode 100644
index 0000000..bc42822
--- /dev/null
+++ b/fmt/src/cd_set_var_type.F
@@ -0,0 +1,65 @@
+      SUBROUTINE CD_SET_VAR_TYPE (dset, varid, iflag, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Set the variable type to iflag 
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 2/06 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Argument declarations
+
+      INTEGER dset, varid, iflag, status
+
+* Internal declarations
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+      INTEGER NCF_SET_VAR_OUTTYPE, dset_num
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+
+* set type flag for this variable
+
+      status = NCF_SET_VAR_OUTTYPE( dset_num, varid, iflag)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_stamp_out.F b/fmt/src/cd_stamp_out.F
new file mode 100644
index 0000000..662524a
--- /dev/null
+++ b/fmt/src/cd_stamp_out.F
@@ -0,0 +1,104 @@
+	SUBROUTINE CD_STAMP_OUT(append, cdfid, string, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Put a "history" stamp into the current netCDF output file
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       append  - logical control to create or append
+*       cdfid   - returned pointer to open CDF file
+*       string  - history string to add
+*	status	- return status
+
+* argument declarations:
+        LOGICAL  append
+	INTEGER	 cdfid, status
+        CHARACTER*(*) string
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+        include 'cd_lib.parm'
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      INTEGER TM_LENSTR1, STR_SAME, hlen, slen
+      LOGICAL CD_GET_ATTRIB, got_it, do_warn, append_flag
+      PARAMETER (do_warn = .TRUE. )
+      CHARACTER*2048 history
+
+* initialize
+      slen = MIN( TM_LENSTR1(string), 120 )
+
+* update (or create) history record
+      got_it = CD_GET_ATTRIB( cdfid, NCGLOBAL, 'history',
+     .                     .NOT.do_warn, ' ', history, hlen, 2048 )
+
+* is the last history stamp the same as this ?
+      IF ( hlen .GE. slen ) THEN
+         IF (STR_SAME( history(hlen-slen+1:hlen), string(:slen) ) 
+     .      .EQ. 0) RETURN
+      ENDIF
+
+* is the last history stamp just a FERRET Vxx  date?
+* If so just replace with the current FERRET Vxxx ...
+      append_flag = append
+      IF ( STR_SAME (history(1:8), 'FERRET V') .EQ.0 .AND.
+     .     hlen .LE. 30 ) append_flag = .FALSE.
+
+* insert new signature
+      CALL CD_WRITE_ATTRIB(cdfid, pcdf_global, 'history', string(:slen),
+     .                     append_flag, status )
+      IF ( status .NE. merr_ok ) GOTO 5000
+
+* successful completion
+      status = merr_ok
+      RETURN
+
+* error exit
+ 5000 RETURN
+	END
diff --git a/fmt/src/cd_store_dset.F b/fmt/src/cd_store_dset.F
new file mode 100644
index 0000000..a37d190
--- /dev/null
+++ b/fmt/src/cd_store_dset.F
@@ -0,0 +1,93 @@
+	SUBROUTINE CD_STORE_DSET ( dset, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* After a non- netCDF file is open, store dataset, variables, and attribute 
+* information in linked list structure.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+
+* V600 6/05 *acm* Attribute control.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+        external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+
+* local variable declarations:
+      INTEGER NCF_INIT_OTHER_DSET, TM_LENSTR1
+
+* For saving dataset information in linked list
+
+      INTEGER NCF_GET_DSNUM, llen, slen1, slen2
+      PARAMETER (slen1=2048)      ! size of ds_name string
+      PARAMETER (slen2=2048)      ! size of ds_des_name string (should this be even longer??)
+
+#ifdef sun
+      BYTE      fhol_dsname(slen1)      ! c-type Hollerith string buffer
+      BYTE      fhol_dspath(slen2)
+#else
+      INTEGER*1 fhol_dsname(slen1)      ! c-type Hollerith string buffer
+      INTEGER*1 fhol_dspath(slen2)
+#endif
+
+* Save dataset info in GLOBAL_NCdsetList for attribute handling
+
+      llen = TM_LENSTR1( ds_name(dset) )
+      CALL TM_FTOC_STRNG( ds_name(dset)(1:llen), fhol_dsname, slen1 )
+      llen = TM_LENSTR1( ds_des_name(dset) )
+      CALL TM_FTOC_STRNG( ds_des_name(dset)(1:llen), fhol_dspath, slen2 )
+
+      status = NCF_INIT_OTHER_DSET (dset, fhol_dsname, fhol_dspath) 
+
+* successful completion
+	
+	RETURN
+	END
diff --git a/fmt/src/cd_store_dset_attrs.F b/fmt/src/cd_store_dset_attrs.F
new file mode 100644
index 0000000..5827d51
--- /dev/null
+++ b/fmt/src/cd_store_dset_attrs.F
@@ -0,0 +1,112 @@
+	SUBROUTINE CD_STORE_DSET_ATTRS ( dset, cdfid, status)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* After a netCDF file is open, get dataset, variable, and attribute information
+* storing in linked list structure.
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP 
+
+* V600 6/05 *acm* Attribute control.
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* v62  *acm* 6/08 cleanup; no need for the variable called buff.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*       dset    - pointer to TMAP data set
+*       cdfid   - returned pointer to open CDF file (or cache)
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      dset, cdfid, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+        external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+        include 'xdset_info.cd_equiv'
+
+* local variable declarations:
+      INTEGER NCF_ADD_DSET, TM_LENSTR1, i, j, cdfstat
+
+* For saving dataset information in linked list
+
+      INTEGER NCF_GET_DSNUM, llen, slen1, slen2
+      PARAMETER (slen1=2048)      ! size of ds_name string
+      PARAMETER (slen2=2048)      ! size of ds_des_name string (should this be even longer??)
+
+#ifdef sun
+      BYTE      fhol_dsname(slen1)      ! c-type Hollerith string buffer
+      BYTE      fhol_dspath(slen2)
+#else
+      INTEGER*1 fhol_dsname(slen1)      ! c-type Hollerith string buffer
+      INTEGER*1 fhol_dspath(slen2)
+#endif
+
+* Successfully opened the dataset (stepfile). 
+* Save dataset info in GLOBAL_NCdsetList for attribute handling
+
+      llen = TM_LENSTR1( ds_name(dset) )
+      CALL TM_FTOC_STRNG( ds_name(dset)(1:llen), fhol_dsname, slen1 )
+      llen = TM_LENSTR1( ds_des_name(dset) )
+      CALL TM_FTOC_STRNG( ds_des_name(dset)(1:llen), fhol_dspath, slen2 )
+
+      cdfstat = NCF_ADD_DSET (cdfid, dset, fhol_dsname, fhol_dspath) 
+      IF ( cdfstat .EQ. merr_badfileatt ) THEN
+         CALL WARN (
+     .   'attribute type mismatch or other attribute reading error '//
+     .    ds_des_name(dset)(1:llen)) 
+      ELSE IF ( cdfstat .NE. merr_ok ) THEN
+         GOTO 5100
+      ENDIF
+
+* successful completion
+	status = merr_ok
+	RETURN
+
+* error messages
+ 5100   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_STORE_DSET_ATTRS', cdfid,
+     .        no_varid, 'is this a CDF file ?', no_errstring, *5900 )
+* erase any record of tampering with this data set
+ 5900   CALL TM_CLOSE_SET( dset, i )
+
+* error exit
+	RETURN
+	END
diff --git a/fmt/src/cd_transfer_attribute.F b/fmt/src/cd_transfer_attribute.F
new file mode 100644
index 0000000..4e55ed2
--- /dev/null
+++ b/fmt/src/cd_transfer_attribute.F
@@ -0,0 +1,62 @@
+      SUBROUTINE CD_TRANSFER_ATTRIBUTE (dset1, varid1, iatt, 
+     .        dset2, varid2, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Access the linked list structure for netcdf variable information: 
+* Transfer attribute iatt from variable 1 in dataset 1 to variable 2 in
+* dataset 2
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - TMAP
+
+* V600 10/05 *acm* Attribute control.
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+
+* Argument declarations
+
+      INTEGER NCF_TRANSFER_ATT,
+     .        dset1, varid1, iatt, dset2, varid2, 
+     .        dset_num_1, dset_num_2, status
+
+      
+      dset_num_1 = dset1
+      IF (dset_num_1 .LT. -2) dset_num_1 = -2
+      dset_num_2 = dset2
+      IF (dset_num_2 .LT. -2) dset_num_2 = -2
+      status = NCF_TRANSFER_ATT(dset_num_1, varid1, iatt,
+     .   dset_num_2, varid2)
+
+      RETURN
+      END
diff --git a/fmt/src/cd_translate_error.F b/fmt/src/cd_translate_error.F
new file mode 100644
index 0000000..92d0454
--- /dev/null
+++ b/fmt/src/cd_translate_error.F
@@ -0,0 +1,87 @@
+	SUBROUTINE CD_TRANSLATE_ERROR (cdfstat, ebuff)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Call NF_STRERROR to get the error translation from netCDF library.
+* The length of the string is set in netcdf.inc at 512.
+*
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+c Argument definitions
+
+	INTEGER cdfstat
+	CHARACTER*(*) ebuff
+
+c Local declararations
+        INTEGER	TM_LENSTR1, STR_SAME, STR_UPCASE, 
+     .		dlen, i
+	REAL	val
+	CHARACTER*512 upstr
+	CHARACTER*10 TM_FMT, errcode
+
+
+#ifdef usingDODSf2cUnderscore 
+        upstr =  NF_STRERROR_(cdfstat)
+#else
+        upstr =  NF_STRERROR(cdfstat)
+#endif
+
+        ebuff = upstr
+
+        upstr = ' '
+        errcode = ' '
+
+        i = STR_UPCASE(upstr,ebuff)
+        IF (STR_SAME(upstr(1:13), 'UNKNOWN ERROR') .EQ. 0) THEN
+           ebuff = 'Unknown error reading from remote dataset '
+        ENDIF
+
+        dlen = TM_LENSTR1(ebuff)
+
+        val = cdfstat
+        errcode = TM_FMT(val, 0, 10, i)
+        ebuff(dlen+2:)  = '(OPeNDAP/netCDF Error code '//
+     .      errcode(1:TM_LENSTR1(errcode))//') '
+        dlen = TM_LENSTR1(ebuff)
+
+	RETURN
+	END
diff --git a/fmt/src/cd_use_recdim.F b/fmt/src/cd_use_recdim.F
new file mode 100644
index 0000000..681224a
--- /dev/null
+++ b/fmt/src/cd_use_recdim.F
@@ -0,0 +1,133 @@
+	LOGICAL FUNCTION CD_USE_RECDIM( cdfid, varid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Does the indicated variable use the netCDF record dim ?
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 6/92
+* 15apr94 *kob* Need to initialzie cd_use_recdim in case of error 
+*		exit
+*
+* 2jun94 *kob* initialization of cd_use_recdim needs to be boolean .FALSE
+* 		instead of 0
+* V500 4/99 *kob*: increase size of vname from32 to 64
+* V552 *acm* 5/03   increase vname to 128 chars 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+
+* argument definitions:
+*       cdfid   - returned pointer to open CDF file
+*       varid   - netCDF variable id
+*	status	- return status
+
+* argument declarations:
+	INTEGER	      cdfid, varid, status
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+      INTEGER ndims, nvars, ngatts, recdim, cdfstat, vartyp, nvdims,
+     .        vdims(8), nvatts
+      CHARACTER vname*128
+
+*initialize
+* 2jun94 *kob* changed initialization from 0 to .FALSE.
+	CD_USE_RECDIM = .FALSE. 		!in case of error exit
+
+* get vital statistics of file
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_(cdfid, ndims, nvars, ngatts, recdim)
+#else
+        cdfstat = NF_INQ (cdfid, ndims, nvars, ngatts, recdim)
+#endif
+        IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+* is there a record dimension
+        IF ( recdim .EQ. -1 ) THEN
+           CD_USE_RECDIM = .FALSE.
+           GOTO 1000
+        ENDIF
+
+* get the statistics for the given variable
+
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VAR_(cdfid, varid, vname, vartyp, nvdims, 
+     .              vdims, nvatts)
+#else
+        cdfstat = NF_INQ_VAR(cdfid, varid, vname, vartyp, nvdims, 
+     .              vdims, nvatts)
+#endif
+
+        IF (cdfstat.NE.NF_NOERR) GOTO 5100
+
+* does it use the record axis?
+
+* acm 3/14/02 if its a scalar, NF_INQ_VAR returns nvdims=0, so set CD_USE_RECDIM =F
+
+        IF (nvdims .EQ. 0) THEN
+           CD_USE_RECDIM = .FALSE.
+        ELSE
+
+           IF ( vdims(nvdims) .EQ. recdim ) THEN
+              CD_USE_RECDIM = .TRUE.
+           ELSE
+              CD_USE_RECDIM = .FALSE.
+           ENDIF
+        ENDIF
+
+* successful completion
+ 1000   status = merr_ok
+        RETURN
+
+* error exit
+ 5100   CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_USE_RECDIM', cdfid,
+     .        no_varid, no_errstring, no_errstring, *5900 )
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_att_dp_sub.c b/fmt/src/cd_write_att_dp_sub.c
new file mode 100644
index 0000000..e4090e0
--- /dev/null
+++ b/fmt/src/cd_write_att_dp_sub.c
@@ -0,0 +1,110 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*   
+    cd_write_att_dp_sub.c
+	(from cd_write_var_sub.c) -- write attribute which comes into the routine
+	                             as type double
+
+    compile this with
+    cc -c -g -I/opt/local/netcdf-3.4/include cd_write_var_sub.c
+*/ 
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <netcdf.h>
+#include <assert.h>
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+void FORTRAN(cd_write_att_dp_sub) (int *cdfid, int *varid, char* attname, int *attype,
+				                   int *nval, void *val, int *status )
+
+{
+  /*
+     V600:  2/06 *acm* Write correct atttr type to netcdf files : Note that compiler
+                       warnings may be seen about data type inconsistencies in the
+                       calls to nc_put_att_double. This is ok; netcdf library does conversion.
+     PyFr   7/12 *kms* Leave off the recasts of the void * since it does nothing except
+                       raise compiler warnings.
+					   
+  */
+  
+  int vid = *varid;
+  vid--;
+
+  /* write out the data */
+
+
+  switch (*attype) {
+
+  /* DOUBLE attr */
+  case NC_DOUBLE:
+      *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* FLOAT attr */
+  case NC_FLOAT:
+      *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* INT attr */
+  case NC_INT:
+	  *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* SHORT attr */
+  case NC_SHORT:
+	  *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* Byte attr */
+  case NC_BYTE:
+	  *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  default:
+  break;
+  }
+
+  return;
+}
diff --git a/fmt/src/cd_write_att_sub.c b/fmt/src/cd_write_att_sub.c
new file mode 100644
index 0000000..246d1d9
--- /dev/null
+++ b/fmt/src/cd_write_att_sub.c
@@ -0,0 +1,134 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*   
+    cd_write_att_sub.c
+	(from cd_write_var_sub.c) -- this routine hides the call to netCDF routine
+    NCVPT allowing last minute modifications to the call arguments
+
+
+    for Ferret interactive data analysis program
+
+    programmer - steve hankin
+    NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+    revision history:
+    V533: 6/01 *sh* - original
+
+    v540: 11/01 *kob* - change passed in values for start and count
+                        to temp variables which are declared
+			compatibly with the passed in types from the 
+			fortran routine CD_READ.F.  Once in, need to 
+			convert these to the proper type that the 
+			netcdf c routines expect.  This may vary from
+			o.s. to o.s. depending on what, for example,
+			size_t and ptrdiff_t are typdef'd as.  They are
+			typedef'd as different things under solaris and 
+			compaq Tru64, for example
+
+
+
+    compile this with
+    cc -c -g -I/opt/local/netcdf-3.4/include cd_write_var_sub.c
+*/ 
+
+/*  *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*                                        definition of macro DFTYPE in ferretmacros.h. */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <netcdf.h>
+#include <assert.h>
+#include "ferretmacros.h"
+
+void FORTRAN(cd_write_att_sub) (int *cdfid, int *varid, char* attname, int *attype,
+				                int *nval, void *val, int *status )
+
+{
+  /*
+     V600:  2/06 *acm* Write correct atttr type to netcdf files : Note that compiler
+                       warnings may be seen about data type inconsistencies in the
+                       calls to nc_put_att_float. This is ok; netcdf library does conversion.
+     PyFr   7/12 *kms* Leave off the recasts of the void * since it does nothing except
+                       raise compiler warnings.
+  */
+  
+  int vid = *varid;
+  vid--;
+
+  /* write out the data */
+
+
+  switch (*attype) {
+
+  /* DOUBLE attr */
+  case NC_DOUBLE:
+#ifdef double_p
+     *status= nc_put_att_double (*cdfid, vid, attname, *attype, *nval, val);
+#else
+     *status= nc_put_att_float (*cdfid, vid, attname, *attype, *nval, val);
+#endif
+
+  break;
+
+  /* FLOAT attr */
+  case NC_FLOAT:
+      *status= nc_put_att_float (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* INT attr */
+  case NC_INT:
+	  *status= nc_put_att_float (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* SHORT attr */
+  case NC_SHORT:
+	  *status= nc_put_att_float (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  /* Byte attr */
+  case NC_BYTE:
+	  *status= nc_put_att_float (*cdfid, vid, attname, *attype, *nval, val);
+  break;
+
+  default:
+  break;
+  }
+
+  return;
+}
diff --git a/fmt/src/cd_write_attrib.F b/fmt/src/cd_write_attrib.F
new file mode 100644
index 0000000..3cd2645
--- /dev/null
+++ b/fmt/src/cd_write_attrib.F
@@ -0,0 +1,216 @@
+	SUBROUTINE CD_WRITE_ATTRIB(cdfid,vname,att,string,append,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write a character string attribute to a netCDF file
+* If the variable is equal to the parameter pcdf_global then make it a
+* global attribute.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92: set into define mode
+* 10/2005 NOTE: do not change this for the attribute-access changes. 
+*               This routine accesses the newly-created file using 
+*               netcdf calls as always. The values sent in come from
+*               the linked-list structure but output is all the same.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     vname   - name of previously created netCDF variable
+*     att     - name of attribute
+*     string  - what the attribute is set equal to
+*     append  - append to or replace the existing string, if any
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+	include 'cd_lib.parm'
+        include 'xio.cmn_text'
+        external xio_data
+        include 'xrisc_buff.cmn'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      LOGICAL append
+      INTEGER cdfid, status
+      CHARACTER*(*) vname, att, string
+
+* local variable declarations:
+      INTEGER TM_LENSTR1, 
+     .        vlen, alen, slen, cdfstat, varid, attype, attlen, len_app
+      CHARACTER buff*2048
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+* initialize
+      vlen = TM_LENSTR1( vname )
+      alen = TM_LENSTR1( att )
+      slen = LEN( string )
+      attype = 0 
+      attlen = 0 
+      cdfstat = NF_NOERR
+      
+* locate the variable id
+      IF ( vname .EQ. pcdf_global ) THEN
+         varid = NF_GLOBAL
+      ELSE
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_VARID_(cdfid, vname(:vlen), varid)
+#else
+         cdfstat = NF_INQ_VARID(cdfid, vname(:vlen), varid)
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+      ENDIF
+
+* does the attribute already exist ?
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_ATT_(cdfid, varid, att(:alen), attype, attlen)
+#else
+      cdfstat = NF_INQ_ATT(cdfid, varid, att(:alen), attype, attlen)
+#endif
+
+      IF ( cdfstat .EQ. NF_NOERR ) THEN
+         IF ( attype.NE.NF_BYTE .AND. attype.NE.NF_CHAR ) GOTO 5200
+         IF ( attlen+slen .GT. 2048 .AND. append ) THEN
+            buff = att
+            CALL TM_NOTE( 'CDF attribute '//buff(:alen)//
+     .           ' is too long', tt )
+            IF ( attlen .GT. 2046 ) THEN
+               CALL TM_NOTE( 'no text could be appended', tt )
+               GOTO 1000
+            ELSE
+               CALL TM_NOTE( 'it may be truncated', tt )
+            ENDIF
+         ENDIF
+         IF ( attlen .GT. 2048 .AND. (.NOT.append) ) THEN
+            buff = att
+            CALL TM_NOTE( 'CDF attribute '//buff(:alen)//
+     .           ' is too long', tt )
+            CALL TM_NOTE( 'it may be truncated', tt )
+         ENDIF
+      ENDIF
+
+* put CDF into define mode so attributes can be written
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+      IF ( cdfstat.EQ.NF_NOERR .AND. append ) THEN
+* append to the attribute
+#ifdef usingDODSf2cUnderscore
+	 cdfstat = NF_GET_ATT_TEXT_(cdfid, varid, att(:alen), buff)
+#else
+	 cdfstat = NF_GET_ATT_TEXT (cdfid, varid, att(:alen), buff)
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) THEN
+            buff = att
+            CALL TM_NOTE( 'Error getting CDF attribute in existing file '
+     .        , tt)
+            GOTO 1000
+         ENDIF
+            
+         risc_buff = string
+         len_app = 2048 - attlen - 1
+#ifdef usingDODSf2cUnderscore
+         IF (len_app .GT. 0) THEN
+            cdfstat = NF_PUT_ATT_TEXT_(cdfid, varid, att(:alen),
+     .             attlen+slen, buff(:attlen)//risc_buff(1:len_app))
+         ELSE
+            cdfstat = NF_PUT_ATT_TEXT_(cdfid, varid, att(:alen),
+     .             attlen+slen, buff(:attlen))
+         ENDIF
+#else
+         IF (len_app .GT. 0) THEN
+            cdfstat = NF_PUT_ATT_TEXT (cdfid, varid, att(:alen),
+     .             attlen+slen, buff(:attlen)//risc_buff(1:len_app))
+         ELSE
+            cdfstat = NF_PUT_ATT_TEXT (cdfid, varid, att(:alen),
+     .             attlen+slen, buff(:attlen))
+         ENDIF
+#endif
+      ELSE
+* write the attribute
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_PUT_ATT_TEXT_(cdfid, varid, att(:alen),
+     .             slen, string)
+#else
+         cdfstat = NF_PUT_ATT_TEXT (cdfid, varid, att(:alen),
+     .             slen, string)
+#endif
+      ENDIF
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+ 5100 CALL TM_ERRMSG
+     . ( merr_unkvar, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4,
+     .  'variable doesnt exist in CDF file',
+     .  vname(:vlen), *5900 )
+
+ 5200 WRITE (risc_buff, *) 'incompatible data type of CDF attribute ',
+     .                      att(:alen)
+      alen = TM_LENSTR1(risc_buff)
+      CALL TM_ERRMSG
+     . ( merr_gridpredef, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4, risc_buff(:alen), 
+     .   no_errstring, *5900 )
+
+ 5300 CALL TM_ERRMSG
+     . ( cdfstat+pcdferr, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     . no_varid, 'cannot write to CDF output file',
+     . no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_attval.F b/fmt/src/cd_write_attval.F
new file mode 100644
index 0000000..13bdbb6
--- /dev/null
+++ b/fmt/src/cd_write_attval.F
@@ -0,0 +1,169 @@
+	SUBROUTINE CD_WRITE_ATTVAL ( cdfid, vname, att, val, nval,
+     .                               type, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write a numerical attribute to a netCDF file
+* If the variable is equal to the parameter pcdf_global then make it a
+* global attribute.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92: set into define mode
+* 10/2005 NOTE: do not change this for the attribute-access changes. 
+*               This routine accesses the newly-created file using 
+*               netcdf calls as always. The values sent in come from
+*               the linked-list structure but output is all the same.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     vname   - name of previously created netCDF variable
+*     att     - name of attribute
+*     val     - value(s) for the attribute
+*     nval    - number of attribute values
+*     type    - data type of the attribute
+*     status  - return status
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+        include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+	include 'cd_lib.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      INTEGER cdfid, nval, type, i4(10), i, status
+      INTEGER*2 i2(10)
+      BYTE i1
+      CHARACTER*(*) vname, att
+      REAL val(*)
+
+* local variable declarations:
+      INTEGER TM_LENSTR1,
+     .        vlen, alen, cdfstat, varid, attype, attlen, flen      
+      CHARACTER*128 abuff     ! needed because of fussy compilers and // concatenation
+
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+* For error message
+      CHARACTER*9 typnam(6)
+      DATA typnam/'NC_BYTE', 'NC_CHAR', 'NC_SHORT', 'NC_INT', 
+     .            'NC_FLOAT', 'NC_DOUBLE'/
+
+* initialize
+      vlen = TM_LENSTR1( vname )
+      alen = TM_LENSTR1( att )
+      
+* locate the variable id
+      IF ( vname .EQ. pcdf_global ) THEN
+         varid = NF_GLOBAL
+      ELSE
+#ifdef usingDODSf2cUnderscore
+	 cdfstat = NF_INQ_VARID_(cdfid, vname(:vlen), varid)
+#else
+	 cdfstat = NF_INQ_VARID(cdfid, vname(:vlen), varid)
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+      ENDIF
+
+* does the attribute already exist ?
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_ATT_(cdfid, varid, att(:alen), attype, attlen)
+#else
+      cdfstat = NF_INQ_ATT (cdfid, varid, att(:alen), attype, attlen)
+#endif
+      IF ( cdfstat.EQ.NF_NOERR .AND. attype.NE.type ) GOTO 5200
+
+* put CDF into define mode so attributes can be written
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* Convert to the requested type and write the attribute
+
+      CALL TM_FTOC_STRNG( att(1:alen), fhol, flen )
+
+      status = merr_ok
+      CALL CD_WRITE_ATT_SUB(cdfid, varid, fhol, type, nval, val, status)
+
+      IF ( status .EQ. -60) GOTO 5300
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+ 5100 CALL TM_ERRMSG
+     . ( merr_unkvar, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4,
+     .  'variable doesnt exist in CDF file',
+     .  vname(:vlen), *5900 )
+
+ 5200 CALL TM_ERRMSG
+     . ( merr_gridpredef, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4,
+     .  'incompatible data type of CDF attribute',
+     .  att(:alen), *5900 )
+
+ 5300  abuff = att
+       CALL TM_ERRMSG (status+pcdferr, status, 'CD_WRITE_ATTVAL',
+     .     no_descfile, no_stepfile, 
+     .    'data in attribute '//abuff(:alen)//
+     .    ' not representable in output type '//typnam(type),
+     .     no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_attval_dp.F b/fmt/src/cd_write_attval_dp.F
new file mode 100644
index 0000000..dfc90d4
--- /dev/null
+++ b/fmt/src/cd_write_attval_dp.F
@@ -0,0 +1,167 @@
+	SUBROUTINE CD_WRITE_ATTVAL_DP ( cdfid, vname, att, val, nval,
+     .                                  type, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write a double precision attribute to a netCDF file
+* If the variable is equal to the parameter pcdf_global then make it a
+* global attribute.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92: set into define mode
+* 10/2005 NOTE: do not change this for the attribute-access changes. 
+*               This routine accesses the newly-created file using 
+*               netcdf calls as always. The values sent in come from
+*               the linked-list structure but output is all the same.
+* V600  4/06 *acm* - additional declarations found by Solaris compiler
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     vname   - name of previously created netCDF variable
+*     att     - name of attribute
+*     val     - value(s) for the attribute
+*     nval    - number of attribute values
+*     type    - data type of the attribute
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+        include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+	include 'cd_lib.parm'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      INTEGER cdfid, nval, type, status
+      CHARACTER*(*) vname, att
+      REAL*8 val(*)
+
+* local variable declarations:
+      INTEGER TM_LENSTR1, i, 
+     .        vlen, alen, cdfstat, varid, attype, attlen, flen    
+      CHARACTER*128 abuff     ! needed because of fussy compilers and // concatenation
+
+      PARAMETER (flen=512)      ! size of variable name string
+
+#ifdef sun
+      BYTE      fhol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen)      ! c-type Hollerith string buffer
+#endif 
+
+* For error message
+      CHARACTER*9 typnam(6)
+      DATA typnam/'NC_BYTE', 'NC_CHAR', 'NC_SHORT', 'NC_INT', 
+     .            'NC_FLOAT', 'NC_DOUBLE'/
+
+* initialize
+      vlen = TM_LENSTR1( vname )
+      alen = TM_LENSTR1( att )
+      
+* locate the variable id
+      IF ( vname .EQ. pcdf_global ) THEN
+         varid = NF_GLOBAL
+      ELSE
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_VARID_(cdfid, vname(:vlen), varid)
+#else
+         cdfstat = NF_INQ_VARID(cdfid, vname(:vlen), varid)
+#endif
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+      ENDIF
+
+* does the attribute already exist ?
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_ATT_( cdfid, varid, att(:alen), attype, attlen )
+#else
+      cdfstat = NF_INQ_ATT( cdfid, varid, att(:alen), attype, attlen )
+#endif
+      IF ( cdfstat.EQ.NF_NOERR .AND. attype.NE.type ) GOTO 5200
+
+* put CDF into define mode so attributes can be written
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* Convert to the requested type and write the attribute
+
+      CALL TM_FTOC_STRNG( att(1:alen), fhol, flen )
+
+      status = merr_ok
+      CALL CD_WRITE_ATT_DP_SUB(cdfid, varid, fhol, type, nval, 
+     .  val, status)
+
+      IF ( status .EQ. -60) GOTO 5300
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+ 5100 CALL TM_ERRMSG
+     . ( merr_unkvar, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4,
+     .  'variable doesnt exist in CDF file',
+     .  vname(:vlen), *5900 )
+
+ 5200 CALL TM_ERRMSG
+     . ( merr_gridpredef, status, 'CD_WRITE_ATTRIB', unspecified_int4,
+     .   unspecified_int4,
+     .  'incompatible data type of CDF attribute',
+     .  att(:alen), *5900 )
+
+ 5300  abuff = att
+       CALL TM_ERRMSG (status+pcdferr, status, 'CD_WRITE_ATTVAL',
+     .     no_descfile, no_stepfile, 
+     .    'data in attribute '//abuff(:alen)//
+     .    ' not representable in output type '//typnam(type),
+     .     no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_axis.F b/fmt/src/cd_write_axis.F
new file mode 100644
index 0000000..63e58b9
--- /dev/null
+++ b/fmt/src/cd_write_axis.F
@@ -0,0 +1,1069 @@
+	SUBROUTINE CD_WRITE_AXIS ( cdfid, dset, grid, idim, recdim,
+     .                           loss, hiss, ax_type,  edges_flag, 
+     .                           do_bounds, mode_upcase_output,  
+     .                           keepax_flag, name_from_grid, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write an axis definition out to the current output netCDF file
+* May be a full "parent" definition, a sub_axis, or a "child" (a sub-axis
+* which points to the full axis)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*   10/92: for performance reasons the "point_spacing" attribute will not be
+*          maintained on the record axis (see cd_rec_synch)
+*        - and CD_SET_MODE used to put into define mode before writing attribs
+*   12/92: write axes in double precision (esp. for time axis issues) 
+*    3/93: check error status after creating dimension
+*    4/93: check "line_direction" in determining if time_origin is needed
+*    1/95: change logical argument into integer "ax_type"
+*    2/95: write NOAA COOP-compliant files: "days since 1992-02-28",
+*	   "degrees_east", "degrees_north"
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* v4.91 *kob* 12/97 - added maxchildlen paramater for the max length of 
+*                     a child axis
+* v500 *kob*  3/99 - change lengths of CD_CHILDAX_NAME, CD_AXIS_NAME,
+*                    name to 64 from 24 to match longer line_name
+* V530 *sh* 12/00 - avoid performance problems of switching between netCDF
+*	DEFINE and DATA mode by deferring actual coordinate writes until later
+* v530 *acm* 1/01  calendar axes: write the calendar name if non-Gregorian
+* v541 *sh* 2/02 - added support for line_modulo_len
+* V550 *ACM* 12/02 Write AXIS attribute to output files.
+* V570 *acm*  5/04 write bounds attribute and bounds 2xN coordinates to NetCDF files
+* V581 *acm* 6/05 - Fix for bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600 *acm* 2/06 - Fix for bug 1394, send do_err flag to TM_DATE_REFORMAT
+* V600 *acm* 6/06 attribute control.
+* V601 *acm* 9/06 Fix bug 1440: Remove stray "IF (attid .GT. 0) " before call to 
+*                 CD_GET_VAR_ATT_INFO just after DO 200
+* V602 *acm*11/06 Fix bug 1471; new routine CD_AXIS_OUTNAME
+* V602 *acm*12/06 Correct the setting of got_calendar 
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V61+  3/08 *acm* (After fixing bug 1534), check for attoutflag on bounds 
+*                  attribute before writing bounds attribute and values.
+* V61_ 5/08 *acm*  Fix bug1574: If the axis is a user-defined axis, get its
+*                  information from the attribute structure; previously only
+*                  did this for user variables.
+* V62  *acm*  2/09 - Fix bug 1634: allow SAVE/KEEP_AXISNAMES so that child axis names
+*                    arent written. They can get too long for OPeNDAP library calls
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V67  *acm* 3/11  Fix bug 1750. Revert to older behavior: if grid uses same axis
+*                  name but different contents, write both to file with the name
+*                  Ferret uses internally.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V683 9/12 *acm* Ticket 1968, If there is a _FillValue attributes on axes, refuse to write it.
+* V685 5/13 *acm* When appending, if dimension of that name in the file but not a coord var,
+*                 just check the length. See ticket 2075.
+* V685 5/13 *acm* Allow specifying data type for axis
+* V685 6/13 *acm* new qualifier SAVE/NOBOUNDS
+* V685 6/13 *acm* Dont add SAVE/NOCOORDS
+* V686 1/14 *acm* When appending to a file with a dimension but no coord var, to not write
+*                 a NOTE. They just clutter things up.
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+* argument definitions:
+*     dset    - dset (if netcdf file, for getting name and attribute 
+*               info from linked-list structure  
+*     cdfid   - netCDF id number for already opened CDF file
+*     grid    - TMAP grid id
+*     idim    - axis orientation (1-nferdims)
+*     recdim  - is this to be the CDF record axis ? (input)
+*     loss    - lo subscript (child axis, only)
+*     hiss    - hi subscript (child axis, only)
+*     status  - return status
+
+* include files
+
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+        include 'cd_lib.parm'
+        include 'xdset_info.cmn_text'
+        external xdset_info_data
+        include 'xtm_grid.cmn_text'
+        external xgt_grid_data
+        include 'xunits.cmn_text'
+	include 'xio.cmn_text'
+        external xio_data
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+
+* argument declarations
+      LOGICAL recdim, mode_upcase_output, name_from_grid
+      INTEGER cdfid, dset, grid, idim, loss, hiss, ax_type, 
+     .        edges_flag, keepax_flag, do_bounds, status
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      LOGICAL TM_ABSTRACT_AXIS, TM_DATE_OK, MATCH_NAME, NC_GET_ATTRIB,
+     .       abstract, do_warn, got_modulo, got_calendar, got_units, 
+     .       got_positive, got_spacing, got_axis, got_cartesian, got_it,
+     .       coordvar, do_off, do_scale
+      PARAMETER (do_warn = .TRUE. )
+      INTEGER TM_LENSTR1, CD_AXLEN, STR_SAME, STR_DNCASE,
+     .        dimid, iaxis, axid, cdfstat, lo, hi,
+     .        nlen, elen, axlen, slen, edgid, bndid, npts, dim2d(2)
+      INTEGER TM_GET_CALENDAR_ID, CD_WRITE_BNDSDIM, cal_id, varid,
+     .        llen, vartype, nvdims, nvatts, iatt, attype, attlen,
+     .        attoutflag, istat, maxlen, vdims(8), newid, all_outflag,
+     .        attid, dset_num, outtype, axis_packed, dlen, vlen
+      REAL vals(100)
+
+!      LOGICAL condensed
+!      REAL rlen
+* *kob* 3/99 - change lengths of CD_CHILDAX_NAME, CD_AXIS_NAME,
+*                    name to 64 from 24 to match longer line_name
+* *acm* 6/06 - change axis name lengths to 128
+      CHARACTER CD_CHILDAX_NAME*128, CD_AXIS_NAME*128, CD_AXIS_OUTNAME*128, 
+     .       TM_FMT*12,
+     .       name*128, name_in*128, units*48, datebuff*40, 
+     .       buff*140, buff2*140, attname*128, dimstr*12, varstr*12
+
+!      REAL*8 val8_cdf, val8_tmap
+* 12/97
+      INTEGER maxchildlen
+      PARAMETER (maxchildlen = 24)
+
+* initialize
+      iaxis = grid_line(idim, grid)
+      dset_num = dset
+
+      name = CD_AXIS_NAME( dset_num, grid, idim, nlen )
+      IF (keepax_flag .EQ. 1)  name = CD_AXIS_OUTNAME( dset_num, grid, idim, nlen )
+      name_in = name
+
+      npts = line_dim(iaxis)
+      abstract = TM_ABSTRACT_AXIS( iaxis )
+      
+      name_from_grid = .FALSE.
+
+* If mode upcase_output is set, then upcase both name and name_in which is 
+* being stored for later use.
+
+      IF (mode_upcase_output) THEN
+         CALL STR_UPCASE( name_in, name)
+         CALL STR_UPCASE( name, name_in)
+      ENDIF
+
+
+* determine lo/hi limits of the axis to be written
+      IF ( abstract ) THEN
+         lo = loss
+         hi = hiss
+      ELSEIF ( ax_type .EQ. pcdf_full_span ) THEN
+         lo = 1
+         hi = line_dim(iaxis)
+      ELSE
+         lo = loss
+         hi = hiss
+      ENDIF
+
+* dimension and size for this axis
+      axlen = hi - lo + 1
+      IF ( abstract .OR. ax_type.NE.pcdf_full_span ) THEN
+         IF (keepax_flag .EQ. 0) 
+     .       name = CD_CHILDAX_NAME( name, lo, hi, nlen )
+* *kob* 12/9/97 - use new paramater maxchildlen in length check
+         nlen = MIN(nlen,maxchildlen)
+      ENDIF
+
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_DIMID_( cdfid, name(:nlen), dimid)
+#else
+      cdfstat = NF_INQ_DIMID( cdfid, name(:nlen), dimid)
+#endif
+
+* already defined ? (limited consistency checking)
+      IF ( cdfstat .EQ. NF_NOERR ) THEN
+
+* ... is there a coordinate variable by the same name ?
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_VARID_( cdfid, name(:nlen), axid )
+#else
+         cdfstat = NF_INQ_VARID( cdfid, name(:nlen), axid )
+#endif
+
+* The dimension matches but there is no coord var. Just return.
+* This lets us append variables to a DSG file.
+
+	 IF (cdfstat .EQ. nf_enotvar) THEN
+	    name = line_name_orig(iaxis)
+	    nlen = TM_LENSTR1( name )
+	    
+	    ! Do we want this warning? 
+c	    CALL WARN ('Dimension '//name(:nlen)//
+c     .        ' found. No corresponding coordinate variable.'//
+c     .        ' Writing with dimension only.')
+	    GOTO 1000  
+	 ENDIF
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+	 IF (.NOT. recdim) THEN 
+            slen = CD_AXLEN( cdfid, dimid, status )
+            IF ( status .NE. merr_ok ) GOTO 5900
+            IF ( keepax_flag .NE. 1 .AND. .NOT.abstract) THEN
+
+* ... check the length. 
+               IF ( axlen .NE. slen ) THEN
+	          IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+
+* use the basic name straight from the grid
+                  name = line_name(iaxis)
+                  nlen = TM_LENSTR1( name )
+		        name_in = name   ! ??
+
+* If mode upcase_output is set, then upcase name
+
+                  IF (mode_upcase_output) THEN
+                     CALL STR_UPCASE( buff, name)
+                  ENDIF
+
+                  npts = line_dim(iaxis)
+                  abstract = TM_ABSTRACT_AXIS( iaxis )
+
+                  bndid = -1
+
+* determine lo/hi limits of the axis to be written
+                  IF ( abstract ) THEN
+                     lo = loss
+                     hi = hiss
+                  ELSEIF ( ax_type .EQ. pcdf_full_span ) THEN
+                     lo = 1
+                     hi = line_dim(iaxis)
+                  ELSE
+                     lo = loss
+                     hi = hiss
+                  ENDIF
+
+* dimension and size for this axis
+                  axlen = hi - lo + 1
+
+* Yes, use the basic name straight from the grid
+	          name_from_grid = .TRUE.
+                  
+	       ENDIF
+            ELSE 
+               IF (axlen .NE. slen ) GOTO 5100
+               GOTO 1000
+            ENDIF
+	 ENDIF
+	 IF (.NOT. name_From_grid) GOTO 1000
+      ENDIF
+
+* Check that the axis type is set. User may have reset the type and then
+* asked for SET AX/OUTTYPE=INTYPE.  If so need to re-get the orig type.
+* If its a static line, set to double, and store that in line_dattype. If
+* its an axis from a netcdf dataset, get the type from initializing the dataset.
+
+      outtype = line_dattype(iaxis)
+
+      CALL CD_GET_VAR_ID (dset_num, line_name(iaxis), varid, status)
+      CALL CD_GET_VAR_INFO (dset_num, varid, buff, vartype, 
+     .            nvdims, vdims, nvatts, coordvar, all_outflag, status)
+
+      IF (outtype.LT.NF_BYTE .OR.  outtype.GT.NF_DOUBLE) THEN
+         IF (iaxis .LE. max_lines) THEN
+	    outtype = NF_DOUBLE  ! static lines - user-defined or Ferret internal
+	    line_dattype(iaxis) = NF_DOUBLE
+	 ELSE
+	    outtype = vartype
+         ENDIF
+      ENDIF
+
+* If axis came in packed we are not going to re-pack it on output (for now).
+* write it as double and add a note.
+
+      axis_packed = 0
+      attname = 'add_offset'
+      CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, status)
+      IF (attid .GT. 0) axis_packed = 1
+      attname = 'scale_factor'
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+      IF (attid .GT. 0) axis_packed = 1
+
+      IF (axis_packed .EQ. 1) THEN	    
+         outtype = NF_DOUBLE
+      ENDIF
+
+      npts = line_dim(iaxis)
+      abstract = TM_ABSTRACT_AXIS( iaxis )
+
+      bndid = -1
+
+
+* put CDF into define mode so axis can be defined
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* define the dimension
+      IF ( recdim ) THEN
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_DEF_DIM_( cdfid, name(:nlen), NF_UNLIMITED, dimid )
+      ELSE
+         cdfstat = NF_DEF_DIM_( cdfid, name(:nlen), axlen, dimid )
+#else
+         cdfstat = NF_DEF_DIM( cdfid, name(:nlen), NF_UNLIMITED, dimid )
+      ELSE
+         cdfstat = NF_DEF_DIM( cdfid, name(:nlen), axlen, dimid )
+#endif
+
+      ENDIF
+
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5200
+
+* create the coordinate variable (12/92 -> double precision)
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_DEF_VAR_(cdfid, name(:nlen), outtype, 1, dimid, axid)
+#else
+      cdfstat = NF_DEF_VAR(cdfid, name(:nlen), outtype, 1, dimid, axid)
+#endif
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5200
+
+* check: can we get the coord var id back??
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_INQ_VARID_( cdfid, name(:nlen), newid )
+#else
+         cdfstat = NF_INQ_VARID( cdfid, name(:nlen), newid )
+#endif
+
+* assign its attributes
+      IF (ax_type .EQ. pcdf_child_span) THEN
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_PUT_ATT_TEXT_(cdfid, axid, 'child_axis', 1, ' ')
+#else
+         cdfstat = NF_PUT_ATT_TEXT (cdfid, axid, 'child_axis', 1, ' ')
+#endif
+      ENDIF
+!      IF ( condensed ) THEN
+#ifdef usingDODSf2cUnderscore
+!         cdfstat = NF_PUT_ATT_DOUBLE _(cdfid, axid, 'true_size',
+!     .         1, npts)
+#else
+!         cdfstat = NF_PUT_ATT_DOUBLE (cdfid, axid, 'true_size',
+!     .         1, npts)
+#endif
+!      ENDIF
+
+      got_modulo = .FALSE.
+      got_calendar = .FALSE.
+      got_units = .FALSE.
+      got_positive = .FALSE.
+      got_spacing = .FALSE.
+      got_axis = .FALSE.
+      got_cartesian = .FALSE.
+
+! get whatever attributes are available in the linked-list structure.
+! use the name of the parent axis.
+
+      CALL CD_GET_VAR_ID (dset_num, name_in, varid, status)
+
+* If the axis is a user-defined axis, we still dont have its info. Look in 
+* the pseudo-dataset of user-defined coordinate variables.
+
+      IF (varid .EQ. 0 .AND. .NOT.abstract) THEN
+         dset_num = -2
+         CALL CD_GET_VAR_ID (dset_num, name_in, varid, status)
+      ENDIF
+      
+      IF (varid .GT. 0) THEN
+
+* Get axis name into original upper/lowercase form, and get nvatts.
+
+         CALL CD_GET_VAR_INFO (dset_num, varid, buff, vartype, 
+     .                   nvdims, vdims, nvatts, coordvar, 
+     .                   all_outflag, status) 
+
+* If mode upcase_output is set, then upcase the name.
+
+         name_in = buff
+         IF (mode_upcase_output) CALL STR_UPCASE( name_in, buff)
+
+         DO 200 iatt = 1, nvatts
+            attoutflag = 0
+            CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .               iatt, attname, attype, attlen, attoutflag, status )
+
+            maxlen = 140
+            got_it = NC_GET_ATTRIB ( dset_num, varid, attname, 
+     .               do_warn, name_in, maxlen, attlen, attoutflag, 
+     .               buff, vals)
+
+* If the user has not asked for bounds and if its a regular axis then
+*  do not write bounds attribute. (The bounds themselves arent written.)
+         IF ( (STR_SAME(attname, 'bounds') .EQ. 0) .AND. 
+     .        ((line_regular(iaxis)) .AND. do_bounds.LE.0) ) 
+     .               attoutflag = 0
+
+* If they asked for /NOBOUNDS, dont write bounds even if the axis is irregular.
+         IF ( (STR_SAME(attname, 'bounds') .EQ. 0) .AND. 
+     .        ( do_bounds.LT.0) ) attoutflag = 0
+
+* If there is a _FillValue attributes on axes, refuse to write it.
+
+            IF (MATCH_NAME (attname,  TM_LENSTR1(attname), 
+     .           '_FILLVALUE', 10) ) attoutflag = 0
+		
+* Write the attribute, but skip this for the point-spacing attr on record axis.
+
+            IF ( MATCH_NAME (attname,  TM_LENSTR1(attname), 
+     .           'MODULO', 6) ) THEN
+               IF (attype .NE. NF_CHAR .AND. vals(1) .EQ. 0.) THEN
+! Write line_modulo_len 
+                  vals(1) = line_modulo_len(iaxis)
+                  IF (attoutflag .EQ. 1) attype = NF_FLOAT
+               ENDIF
+            ENDIF
+
+            IF ( recdim  .AND. 
+     .           MATCH_NAME (attname,  TM_LENSTR1(attname), 
+     .           'POINT_SPACING', 13) ) THEN
+               got_spacing = .TRUE.
+            ELSE
+               IF (attype .EQ. NF_CHAR .AND. attoutflag .EQ. 1) THEN
+		  IF (MATCH_NAME (attname,  5, 'UNITS', 5) ) THEN
+                     buff2 = buff
+                     status = STR_DNCASE(buff, buff2)
+		  ENDIF
+                  llen = TM_LENSTR1(buff)
+                  CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .                               buff(:llen), .FALSE., status )
+               ELSE IF (attoutflag .EQ. 1) THEN
+                  CALL CD_WRITE_ATTVAL(cdfid, name(:nlen), attname,
+     .                                 vals, attlen, attype, status )
+               ENDIF
+            ENDIF
+
+            slen = TM_LENSTR1(attname)
+            IF (MATCH_NAME (attname,  slen, 'UNITS', 5 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_units = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'CALENDAR', 8 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_calendar = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'MODULO', 6 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_modulo = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'POSITIVE', 8 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_positive = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'POINT_SPACING', 13) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_spacing = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'AXIS', 4 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_axis = .TRUE.
+            IF (MATCH_NAME (attname,  slen, 'CARTESIAN_AXIS', 14 ) .AND. 
+     .          attoutflag .EQ. 1)
+     .                got_cartesian = .TRUE.
+
+ 200     CONTINUE
+      ENDIF
+
+* write modulo, t0, etc as attributes if they exist in Ferret 
+* variables line_modulo etc. This is consistent with previous Ferret behavior.
+
+      attoutflag = 1  
+
+* May want to add since t0 
+
+      IF ( line_direction(iaxis) .EQ. 'TI' ) THEN
+         cal_id = TM_GET_CALENDAR_ID (line_cal_name(iaxis))
+         IF (TM_DATE_OK( line_T0(iaxis),cal_id ) ) got_units = .FALSE.
+      ENDIF
+
+      IF ( line_units(iaxis) .NE. ' ' .AND. (.NOT.got_units) ) THEN
+	 units = line_units(iaxis)	 
+
+	 IF ( line_direction(iaxis) .EQ. 'WE'
+     .	.AND. line_unit_code(iaxis) .EQ. pun_degrees ) THEN
+	    units = 'degrees_east'
+	 ELSEIF ( line_direction(iaxis) .EQ. 'SN'
+     .	.AND. line_unit_code(iaxis) .EQ. pun_degrees ) THEN
+	    units = 'degrees_north'
+	ELSEIF ( line_direction(iaxis) .EQ. 'TI'
+     . .AND. TM_DATE_OK( line_T0(iaxis),cal_id )    ) THEN
+            slen = TM_LENSTR1( line_units(iaxis) )
+	    units = line_units(iaxis)(:slen)//' since '
+            IF (line_shift_origin(iaxis)) THEN
+               datebuff = '01-JAN-0001 00:00:00'
+            ELSE
+ 	       datebuff = line_T0(iaxis)
+            ENDIF
+            CALL TM_DATE_REFORMAT(datebuff,pdate_vax,cal_id,
+     .				  units(slen+8:),pdate_numslashnum,
+     .				  .TRUE., status )
+	    IF ( status .NE. merr_ok ) GOTO 5900
+
+            buff2 = units
+            status = STR_DNCASE(units, buff2)
+
+	ENDIF
+        slen = TM_LENSTR1( units )
+
+        attname = 'units' 
+        IF (varid .GT. 0) THEN
+           CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, 
+     .                 status)
+           IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .         attid, attname,  attype, attlen, attoutflag, istat )
+        ELSE
+           attoutflag = 1
+        ENDIF
+
+        IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .     cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       slen, units(:slen) )
+#else
+     .     cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       slen, units(:slen) )
+#endif
+
+      ENDIF
+      IF ( idim .EQ. t_dim .AND. (.NOT.got_calendar) ) THEN                  ! 4/93 update
+        cal_id = TM_GET_CALENDAR_ID (line_cal_name(iaxis))
+	IF ( line_direction(iaxis) .EQ. 'TI'
+     . .AND. TM_DATE_OK( line_T0(iaxis), cal_id )    ) THEN
+
+            IF (line_shift_origin(iaxis)) THEN
+               datebuff = '01-JAN-0001 00:00:00'
+            ELSE
+ 	       datebuff = line_T0(iaxis)
+            ENDIF
+
+            slen = TM_LENSTR1( datebuff )
+            
+            attname = 'time_origin' 
+            IF (varid .GT. 0) THEN
+               CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, 
+     .                 status)
+               IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .             attid, attname, attype, attlen, attoutflag, istat )
+            ELSE 
+               attoutflag = 1
+            ENDIF
+
+            IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .         cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       slen, datebuff(:slen) )
+#else
+     .         cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       slen, datebuff(:slen) )
+#endif
+	ENDIF
+
+!  Write the calendar name
+
+        IF (cal_id .NE. 1) THEN
+          slen = TM_LENSTR1( line_cal_name(iaxis) )
+
+          attname = 'calendar' 
+          IF (varid .GT. 0) THEN
+             CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, status)
+             IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .                attid, attname, attype, attlen, attoutflag, istat )
+          ELSE
+             attoutflag = 1
+          ENDIF
+
+          IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .      cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       slen, line_cal_name(iaxis)(:slen))
+#else
+     .      cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       slen, line_cal_name(iaxis)(:slen))
+#endif
+        ENDIF
+      ENDIF
+
+
+      IF ( line_modulo(iaxis) .AND. (.NOT.got_modulo) ) THEN
+	 IF (line_modulo_len(iaxis) .EQ. 0.0D0 ) THEN
+           attname = 'modulo' 
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID(dset_num, varid, attname, attid,status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat )
+           ELSE
+              attoutflag = 1
+           ENDIF
+           IF (attoutflag .EQ. 1)
+#ifdef usingDODSf2cUnderscore 
+     .       cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       1, ' ' )
+#else
+     .       cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       1, ' ' )
+#endif
+	 ELSE
+           attname = 'modulo' 
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID(dset_num, varid, attname, attid,status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .               attid, attname, attype, attlen, attoutflag, istat )
+           ELSE
+              attoutflag = 1
+           ENDIF
+           IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .      cdfstat = NF_PUT_ATT_DOUBLE_( cdfid, axid, attname,
+     .        	       outtype, 1, line_modulo_len(iaxis) )
+#else
+     .      cdfstat = NF_PUT_ATT_DOUBLE( cdfid, axid, attname,
+     .        	       outtype, 1, line_modulo_len(iaxis) )
+#endif
+	 ENDIF
+
+! Check if user want to write modulo=false to the file
+      ELSE IF (got_modulo .AND. (varid .GT. 0) .AND.
+     .         .NOT.line_modulo(iaxis)  ) THEN 
+            attname = 'modulo'
+            CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, status)
+            IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat )
+
+            maxlen = 140
+            got_it = NC_GET_ATTRIB ( dset_num, varid, attname, 
+     .               do_warn, name_in, maxlen, attlen, attoutflag, 
+     .               buff, vals)
+
+            IF (attype .EQ. NF_CHAR .AND. attoutflag .EQ. 1) THEN
+               llen = TM_LENSTR1(buff)
+               CALL CD_WRITE_ATTRIB(cdfid, name(:nlen), attname,
+     .                               'false', .FALSE., status )
+            ELSE IF (attoutflag .EQ. 1) THEN
+               CALL CD_WRITE_ATTVAL(cdfid, name(:nlen), attname,
+     .                              vals, attlen, attype, status )
+            ENDIF
+
+
+      ENDIF
+
+      IF ( idim.EQ.z_dim .AND. line_direction(iaxis).EQ.'UD' .AND.
+     .     (.NOT.got_positive) ) THEN
+           attname = 'positive' 
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID(dset_num, varid, attname, attid,status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat )
+           ELSE
+              attoutflag = 1
+           ENDIF
+           IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .      cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       4, 'down' )
+#else
+     .      cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       4, 'down' )
+#endif
+      ENDIF
+
+* record axis (time, usually) doesn't get coordinate spacing or any
+* coordinates inserted at creation time
+      IF ( recdim ) THEN
+
+         CONTINUE
+      ELSE
+        IF (.NOT. got_spacing) THEN
+        IF ( line_regular(iaxis) ) THEN
+           attname = 'point_spacing' 
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID(dset_num, varid, attname, attid,status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat )
+           ELSE
+              attoutflag = 1
+           ENDIF
+           IF (attoutflag .EQ. 1) 
+#ifdef usingDODSf2cUnderscore
+     .      cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       4, 'even' )
+#else
+     .      cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       4, 'even' )
+#endif
+        ELSE
+* sub-span axis may not have irregular spacing just cuz parent does
+* 12/00 NO. ... regular appearing coordinates are not necessarily regular --
+*       for example 2 points extracted from an irregular axis will always
+*	appear to be regular, but their box limits are not necessarily so
+           IF ( ax_type .EQ. pcdf_full_span
+     .     .OR. ax_type .EQ. pcdf_sub_span ) THEN
+              attname = 'point_spacing' 
+              IF (varid .GT. 0) THEN
+                 CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, 
+     .                  attid, status)
+                 IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .               attid, attname, attype, attlen, attoutflag, istat )
+              ELSE 
+                 attoutflag = 1
+              ENDIF
+              IF (attoutflag .EQ. 1)
+#ifdef usingDODSf2cUnderscore 
+     .      cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname,
+     .        	       6, 'uneven' )
+#else
+     .      cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname,
+     .        	       6, 'uneven' )
+#endif
+           ENDIF
+        ENDIF
+        ENDIF  ! got_spacing
+
+* set up for deferred writing of coordinate values (12/00)
+	CALL CD_DEFER_COORD_WRITE(axid, grid, idim, lo, hi,
+     .				  pcd_defer_points)
+
+      ENDIF
+
+* Write AXIS attribute
+
+      IF (.NOT. got_axis) THEN
+
+           attname = 'axis' 
+           IF (varid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid,
+     .                  status)
+              IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset_num, varid,
+     .             attid, attname, attype, attlen, attoutflag, istat )
+           ELSE
+              attoutflag = 1
+           ENDIF
+            
+#ifdef usingDODSf2cUnderscore
+          IF (idim .eq. x_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'X' )
+          ELSE IF (idim .eq. y_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'Y' )
+          ELSE IF (idim .eq. z_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'Z' )
+          ELSE IF (idim .eq. t_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'T' )
+          ELSE IF (idim .eq. e_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'E' )
+          ELSE IF (idim .eq. f_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT_
+     .        	     ( cdfid, axid, attname, 1, 'F' )
+          ENDIF
+#else
+          IF (idim .eq. x_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'X' )
+          ELSE IF (idim .eq. y_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'Y' )
+          ELSE IF (idim .eq. z_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'Z' )
+          ELSE IF (idim .eq. t_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'T' )
+          ELSE IF (idim .eq. e_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'E' )
+          ELSE IF (idim .eq. f_dim) THEN
+             IF (attoutflag .EQ. 1) cdfstat = NF_PUT_ATT_TEXT
+     .        	     ( cdfid, axid, attname, 1, 'F' )
+          ENDIF
+#endif
+       ENDIF
+
+* If the axis is a know geophysical direction write the standard name 
+* attribute for it.
+
+      attname = 'standard_name'
+      IF ( line_direction(iaxis) .EQ. 'WE') THEN
+         buff = 'longitude'
+	 llen = TM_LENSTR1(buff)
+         CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .        buff(:llen), .FALSE., status )
+      ENDIF
+      IF ( line_direction(iaxis) .EQ. 'SN') THEN
+         buff = 'latitude'
+	 llen = TM_LENSTR1(buff)
+         CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .        buff(:llen), .FALSE., status )
+      ENDIF
+      IF ( line_direction(iaxis) .EQ. 'UD') THEN
+         buff = 'depth'
+	 llen = TM_LENSTR1(buff)
+         CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .        buff(:llen), .FALSE., status )
+      ENDIF
+      IF ( line_direction(iaxis) .EQ. 'DU') THEN
+         buff = 'altitude'
+	 llen = TM_LENSTR1(buff)
+         CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .        buff(:llen), .FALSE., status )
+      ENDIF
+      IF ( line_direction(iaxis) .EQ. 'TI') THEN
+         buff = 'time'
+	 llen = TM_LENSTR1(buff)
+         CALL CD_WRITE_ATTRIB (cdfid, name(:nlen), attname,
+     .        buff(:llen), .FALSE., status )
+      ENDIF
+
+* If the axis came in scaled, and the users asked for scaling on output
+* then return a note.
+
+       IF (varid .GT. 0) THEN
+          do_scale = .FALSE.
+	  do_off = .FALSE.
+          attname = 'scale_factor' 
+          CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid,
+     .               status)
+          IF (attid .GT. 0) THEN
+	     CALL CD_GET_VAR_ATT_INFO (dset_num, varid,
+     .          attid, attname, attype, attlen, attoutflag, istat )
+             IF (attoutflag .EQ. 1) do_scale = .TRUE.
+          ENDIF
+
+          attname = 'add_offset' 
+          CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid,
+     .               status)
+          IF (attid .GT. 0) THEN
+             CALL CD_GET_VAR_ATT_INFO (dset_num, varid,
+     .          attid, attname, attype, attlen, attoutflag, istat )
+             IF (attoutflag .EQ. 1) do_off = .TRUE.
+          ENDIF
+ 
+          IF (do_scale .OR. do_off .OR. (axis_packed .EQ. 1) )  
+     .    CALL WARN(name(1:nlen)//
+     .      ': Writing scaled coordinates not implemented. Suggest '//
+     .      'using nco operators on output file to pack coord values')
+       ENDIF
+            
+* does it need axis bounds definitions ?
+
+* Has the user explicitly asked not to write bounds attribute for the variable? 
+* If so mark this with the value attoutflag = 2
+
+      attname = 'bounds' 
+      attoutflag = 0
+      IF (varid .GT. 0) THEN
+         CALL CD_GET_VAR_ATT_ID(dset_num, varid, attname, attid, status)
+         IF (attid .GT. 0) THEN
+            CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .      attid, attname, attype, attlen, attoutflag, istat )
+            IF (attoutflag .EQ. 0) attoutflag = 2
+         ENDIF
+      ENDIF
+
+* If they said /NOBOUNDS on the SAVE command, do not write bounds
+* even if the axis is irregular.
+
+      IF (do_bounds .EQ. -1) attoutflag = 2
+
+      IF (  (ax_type.EQ.pcdf_full_span .OR. ax_type.EQ.pcdf_sub_span)
+     .  .AND. ( .NOT.line_regular(iaxis) .OR. do_bounds.EQ.1) 
+     .  .AND. ( edges_flag .EQ. 0) 
+     .  .AND. ( attoutflag .NE. 2) ) THEN
+
+         name = name(:nlen)//'_bnds'
+         elen = nlen + 5
+
+* ... define the first dimension of bounds variable (what about record axis??)
+
+         dim2d(2) = dimid    ! Dimension already defined above for coordinates
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5200
+
+* ... second dimension of bounds coordinate variable is 2
+         dim2d(1) = CD_WRITE_BNDSDIM(cdfid, status)
+
+* ... create the bounds variable, if it has not been created.
+#ifdef usingDODSf2cUnderscore
+         IF (bndid .EQ. -1) cdfstat = NF_DEF_VAR_(cdfid, 
+     .    name(:elen), outtype, 2, dim2d, bndid)
+#else
+         IF (bndid .EQ. -1) cdfstat = NF_DEF_VAR(cdfid, 
+     .    name(:elen), outtype, 2, dim2d, bndid)
+#endif
+
+         IF ( cdfstat .NE. NF_NOERR ) GOTO 5220
+
+* ... point to it from axis coordinates definition
+
+         attname = 'bounds' 
+         IF (varid .GT. 0) THEN
+            CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, status)
+            IF (attid .GT. 0) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat)
+            ELSE
+               attoutflag = 1
+            ENDIF 
+         ELSE
+            attoutflag = 1
+         ENDIF
+
+         IF (attoutflag .EQ. 1) THEN
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_ATT_TEXT_(cdfid, axid, attname,
+     .                elen, name(:elen))
+#else
+            cdfstat = NF_PUT_ATT_TEXT (cdfid, axid, attname,
+     .                elen, name(:elen))
+#endif
+
+* set up for deferred writing of bounds coordinate values (12/00)
+* Record axis and bounds are written when variable written.
+
+           IF ( .NOT.recdim ) 
+     .       CALL CD_DEFER_COORD_WRITE(bndid, grid, idim, lo, hi,
+     .				  pcd_defer_bounds)
+         ENDIF
+
+      ENDIF
+
+* does it need axis box edge definitions ?  
+* edges_flag = 1 if requested with /EDGES qualifier
+* edges_flag = 2 if requested with /RIGID qualifier
+
+      IF (  (ax_type.EQ.pcdf_full_span .OR. ax_type.EQ.pcdf_sub_span)
+     . .AND. ((edges_flag.EQ.1) .OR.
+     .        (edges_flag.EQ.2 .AND.
+     .         .NOT.line_regular(iaxis) .AND. 
+     .         .NOT.recdim)) ) THEN
+
+         name = name(:nlen)//'edges'
+         elen = nlen + 5
+#ifdef usingDODSf2cUnderscore
+         cdfstat = NF_DEF_DIM_( cdfid, name(:elen), axlen+1, dimid )
+         cdfstat = NF_DEF_VAR_(cdfid, name(:elen), outtype, 1, 
+     .           dimid, edgid)
+#else
+         cdfstat = NF_DEF_DIM( cdfid, name(:elen), axlen+1, dimid )
+         cdfstat = NF_DEF_VAR(cdfid, name(:elen), outtype, 1, 
+     .           dimid, edgid)
+#endif
+         attname = 'edges' 
+         IF (varid .GT. 0) THEN
+            CALL CD_GET_VAR_ATT_ID (dset_num, varid, attname, attid, status)
+            IF (attid .GT. 0) THEN
+               CALL CD_GET_VAR_ATT_INFO (dset_num, varid, 
+     .              attid, attname, attype, attlen, attoutflag, istat)
+               IF (edges_flag .GT. 0) attoutflag = 1
+            ELSE
+               attoutflag = 1
+            ENDIF 
+         ELSE
+            attoutflag = 1
+         ENDIF
+         IF (attoutflag .EQ. 1) THEN
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_ATT_TEXT_( cdfid, edgid, attname, 1, ' ' )
+* ... point to it from axis coordinates definition
+            cdfstat = NF_PUT_ATT_TEXT_( cdfid, axid, attname, elen,
+     .                name(:elen) )
+#else
+            cdfstat = NF_PUT_ATT_TEXT( cdfid, edgid, attname, 1, ' ' )
+* ... point to it from axis coordinates definition
+            cdfstat = NF_PUT_ATT_TEXT( cdfid, axid, attname, elen,
+     .                name(:elen) )
+#endif
+
+* set up for deferref writing of edge coordinate values (12/00)
+	    CALL CD_DEFER_COORD_WRITE(edgid, grid, idim, lo, hi,
+     .				  pcd_defer_edges)
+         ENDIF
+
+      ENDIF
+
+* successful completion
+ 1000 status = merr_ok
+
+      RETURN
+
+* error messages
+ 5100 CONTINUE
+      IF (keepax_flag .EQ. 1) THEN
+         CALL WARN ("Writing a subset of data with original axis names")
+         CALL WARN 
+     . ("  Axis was already written with a different set of coordinates")
+      ENDIF
+      CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_WRITE_AXIS', unspecified_int4,
+     .   unspecified_int4,
+     .  'axis '//name(:nlen)//' doesnt match CDF file',
+     .  no_errstring, *5900 )
+
+ 5200 CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_WRITE_AXIS', cdfid,
+     .       unspecified_int4, 'Failed creating coord variable '
+     .       //name(:nlen), no_errstring, *5900 )
+
+ 5220 CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_WRITE_AXIS', cdfid,
+     .       unspecified_int4, 
+     .       'Failed creating bounds for coord variable '
+     .       //name(:nlen), no_errstring, *5900 )
+
+ 5300 dimstr = TM_FMT(FLOAT(slen), 8, 12, dlen)
+      varstr = TM_FMT(FLOAT(axlen), 8, 12, vlen)
+      CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_WRITE_AXIS', unspecified_int4,
+     .   unspecified_int4,
+     .  'Length of file dimension '//name(:nlen)//' is '//dimstr(:dlen)
+     .  //'. Variable axis length '//varstr(:vlen)
+     .  //' must match.',
+     .  no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_bndsdim.F b/fmt/src/cd_write_bndsdim.F
new file mode 100644
index 0000000..355d678
--- /dev/null
+++ b/fmt/src/cd_write_bndsdim.F
@@ -0,0 +1,133 @@
+	INTEGER FUNCTION CD_WRITE_bndsdim ( cdfid, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Create a netCDF dimension for the second dimension of a bounds 
+* coordinate variable
+
+* Programmer Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* (from cd_write_strdim.F)
+
+* V570 *acm* 5/04 
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      INTEGER cdfid, status
+
+* local variable declarations:
+      CHARACTER dimname*128
+      INTEGER cdfstat, clen, nlen, dimid, nbnds
+
+* initialize
+      dimname = 'bnds'
+      nbnds = 2
+      nlen = 4
+
+* is the dimension already defined ?
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_DIMID_(cdfid, dimname(:nlen), dimid )
+#else
+      cdfstat = NF_INQ_DIMID (cdfid, dimname(:nlen), dimid )
+#endif
+
+      IF ( cdfstat .EQ. NF_NOERR ) THEN
+* ... yes. make sure defn is consistent
+
+* v5.40 *kob* - add ifdef to check whether or not to append an underscore
+*               to the v3 routine name.  This necessary because DODS netcdf
+*               fortran jackets can be configured assuming f2c, which appends
+*               an additional underscore to routine names already containing
+*               and underscore.  The real solution is to configure dods 
+*               correctly, but the below may be necessary when linked with
+*               unidata-built dods libraries
+
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_INQ_DIMLEN_(cdfid, dimid, clen)
+#else
+	cdfstat = NF_INQ_DIMLEN(cdfid, dimid, clen)
+#endif
+	IF (clen .NE. nbnds) GOTO 5100
+      ELSE
+* ... no. define it
+        CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+        IF ( status .NE. merr_ok ) RETURN
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_DEF_DIM_( cdfid, dimname(:nlen), nbnds, dimid )
+#else
+        cdfstat = NF_DEF_DIM( cdfid, dimname(:nlen), nbnds, dimid )
+#endif
+
+        IF ( cdfstat .NE. NF_NOERR ) GOTO 5200
+      ENDIF
+
+* successful completion
+      status = merr_ok
+      CD_WRITE_BNDSDIM = dimid
+      RETURN
+
+* error messages
+ 5100 CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_WRITE_BNDSDIM', unspecified_int4,
+     .   unspecified_int4,
+     .  'dimension '//dimname(:nlen)//' doesnt match CDF file',
+     .  no_errstring, *5900 )
+
+ 5200        CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_WRITE_BNDSDIM', cdfid,
+     .       unspecified_int4, 'Failed creating dimension '
+     .       //dimname(:nlen), no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_defer_coord.F b/fmt/src/cd_write_defer_coord.F
new file mode 100644
index 0000000..744c7d5
--- /dev/null
+++ b/fmt/src/cd_write_defer_coord.F
@@ -0,0 +1,167 @@
+	SUBROUTINE CD_WRITE_DEFER_COORD( cdfid, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write (deferred) netCDF axis coordinates based upon infermation stored
+* in COMMON
+* (required for performance since switching between DEFINE and DATA modes
+* can be so costly)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530 *sh* - 12/00
+*	    -  1/01 bug fix -- upper box bound of last coord wrong
+* V570 *acm*   5/04 For irregular axes, write bounds coordinate variable, 
+*                   dimensioned 2xN
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+
+* argument declarations:
+	INTEGER cdfid, status
+
+* include files
+        include 'netcdf.inc'
+        include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+        include 'tmap_errors.parm'
+	include 'xio.cmn_text'
+        include 'xdefer_coords.cmn'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local variable declarations:
+	INTEGER	 iax, i, i1000, hilim, cdfstat, box_loc,
+     .           start(2), count(2)
+	REAL*8   buff(1000)
+	REAL*8   TM_WORLD
+
+
+* put CDF into data mode so coordinates can be written
+        CALL CD_SET_MODE(cdfid, pcd_mode_data, status)
+        IF ( status .NE. merr_ok ) RETURN
+
+* loop over all of the deferred axes
+	DO 500 iax = 1, dfr_num
+
+*   write the coordinates -- buffer 1000 at a time
+	  IF (dfr_axis_type(iax) .EQ. pcd_defer_points) THEN
+	    box_loc = box_middle
+	  ELSEIF (dfr_axis_type(iax) .EQ. pcd_defer_edges) THEN
+	    box_loc = box_lo_lim
+	  ELSEIF (dfr_axis_type(iax) .NE. pcd_defer_bounds) THEN
+	    CALL TM_NOTE( '***IntrnlERR - CD_DEFER_COORD_WRITE',
+     .				lunit_errors)
+	  ENDIF
+
+
+* Write coordinates or edges as N by 1 or N+1 by 1
+
+          IF (dfr_axis_type(iax) .EQ. pcd_defer_points .OR.
+     .        dfr_axis_type(iax) .EQ. pcd_defer_edges) THEN
+             DO 110 i1000 = dfr_lo(iax), dfr_hi(iax), 1000
+               hilim = MIN((i1000-1)+1000, dfr_hi(iax))
+               DO 100 i = i1000, hilim
+ 100           buff(i-i1000+1) = TM_WORLD(i, dfr_grid(iax), 
+     .			              dfr_idim(iax), box_loc)
+#ifdef usingDODSf2cUnderscore
+               cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, dfr_cdaxis(iax), 
+     .		       i1000-dfr_lo(iax)+1, hilim-i1000+1, buff)
+#else
+               cdfstat = NF_PUT_VARA_DOUBLE (cdfid, dfr_cdaxis(iax), 
+     .		       i1000-dfr_lo(iax)+1, hilim-i1000+1, buff)
+#endif
+               IF (cdfstat .NE. NF_NOERR) GOTO 5010
+ 110         CONTINUE
+
+* ... for edge defn tag on the upper bound of the top grid box
+	     IF (dfr_axis_type(iax) .EQ. pcd_defer_edges) THEN
+                buff(1) = TM_WORLD(dfr_hi(iax), dfr_grid(iax), 
+     .			       dfr_idim(iax), box_hi_lim)
+#ifdef usingDODSf2cUnderscore
+               cdfstat = NF_PUT_VAR1_DOUBLE_(cdfid, dfr_cdaxis(iax),
+     .			dfr_hi(iax)-dfr_lo(iax)+2, buff)
+#else
+               cdfstat = NF_PUT_VAR1_DOUBLE (cdfid, dfr_cdaxis(iax),
+     .			dfr_hi(iax)-dfr_lo(iax)+2, buff)
+#endif
+               IF (cdfstat .NE. NF_NOERR) GOTO 5010
+	     ENDIF
+
+* Write bounds as N by 2, 1000 sets buffered at a time.
+
+          ELSEIF (dfr_axis_type(iax) .EQ. pcd_defer_bounds) THEN
+             DO 210 i1000 = dfr_lo(iax), dfr_hi(iax), 500
+                hilim = MIN((i1000-1)+500, dfr_hi(iax))
+                buff(1) = TM_WORLD(i1000, dfr_grid(iax), 
+     .			              dfr_idim(iax), box_lo_lim)
+                DO 200 i = i1000, hilim
+                   buff(2*(i-i1000+1)-1) = TM_WORLD(i, dfr_grid(iax), 
+     .			              dfr_idim(iax), box_lo_lim)
+ 200               buff(2*(i-i1000+1)) = TM_WORLD(i, dfr_grid(iax), 
+     .			              dfr_idim(iax), box_hi_lim)
+
+
+                start(1) = 1
+                count(1) = 2
+                start(2) = i1000-dfr_lo(iax)+1
+                count(2) =  hilim-i1000+1
+
+#ifdef usingDODSf2cUnderscore
+                cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, dfr_cdaxis(iax), start,
+     .		          count, buff)
+#else
+                cdfstat = NF_PUT_VARA_DOUBLE (cdfid, dfr_cdaxis(iax), start,
+     .		          count, buff)
+#endif
+               IF (cdfstat .NE. NF_NOERR) GOTO 5010
+ 210           CONTINUE
+           ENDIF
+
+ 500	CONTINUE
+
+	dfr_num = 0   ! just house-keeping to be on the safe side
+
+	RETURN
+ 5010   status = cdfstat
+        RETURN
+	END
diff --git a/fmt/src/cd_write_grid.F b/fmt/src/cd_write_grid.F
new file mode 100644
index 0000000..7814493
--- /dev/null
+++ b/fmt/src/cd_write_grid.F
@@ -0,0 +1,218 @@
+	SUBROUTINE CD_WRITE_GRID ( cdfid, dset, grid, lo, hi, recdim, 
+     .                           itsa_slab, gname, edges_flag, 
+     .                           do_bounds, mode_upcase_output, 
+     .                           keepax_flag, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write a grid definition out to the current output netCDF file
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*               10/92 - put into netCDF into define mode before writing attribs
+*		1/95  - change in "parent" argument to cd_write_axis (now int)
+*   11/95 - *sh* use CD_AXIS_NAME rather than line_name for dynamic lines
+*    2/96 - *sh* same deal for dynamic grids ... a quick fix right here
+* v500 *kob*  3/99 - change lengths of CD_CHILDAX_NAME, CD_AXIS_NAME,
+*                    lname to 64 from 24 to match longer line_name
+* v570 *acm*  6/04 - changes to use bounds attribute
+* V602 *acm* 11/06 - Fix bug 1471; new routine CD_AXIS_OUTNAME gets correct 
+*                    output axis name.
+* V62  *acm*  2/09 - Fix bug 1634: allow SAVE/KEEP_AXISNAMES so that child axis names
+*                    arent written. They can get too long for OPeNDAP library calls
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V67  *acm* 3/11  Fix bug 1750. Revert to older behavior: if grid uses same axis
+*                  name but different contents, write both to file with the name
+*                  Ferret uses internally.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V685 6/13 *acm* new qualifier SAVE/NOBOUNDS
+* V685 6/13 *acm* Dont add SAVE/NOCOORDS
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     grid    - TMAP grid id
+*     lo      - low indices of variable hyperslab
+*     hi      - high indices of variable hyperslab
+*     recdim  - which axis (1-4) is to be the CDF record axis
+*     itsa_slab- does the underlying variable need a formal grid defn
+*     gname   - the name of the parent grid created
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+        include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+        include 'cd_lib.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      LOGICAL itsa_slab, mode_upcase_output
+      INTEGER cdfid, dset, grid, lo(nferdims), hi(nferdims), recdim, 
+     .        edges_flag, keepax_flag, do_bounds, status
+      CHARACTER*(*) gname
+
+* local variable declarations:
+      LOGICAL gmod, name_from_grid
+      INTEGER TM_LENSTR1, 
+     .        defid, defdim, nlen, slen, cdfstat, iaxis, idim, glen, i
+      CHARACTER CD_CHILDAX_NAME*132, CD_AXIS_OUTNAME*132, CD_AXIS_NAME*132,
+     .		names*132, lname*132
+      CHARACTER*1 ww_dim_name(nferdims)
+      DATA ww_dim_name/'X', 'Y', 'Z', 'T', 'E', 'F'/
+
+* are the axes, alone, enough of a grid definition
+      IF ( .NOT.itsa_slab ) GOTO 100
+
+* put CDF into define mode so attributes can be written
+      CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* create "grid_definition" dimension name if not already in the file
+#ifdef usingDODSf2cUnderscore
+       	cdfstat = NF_INQ_DIMID_( cdfid, 'grid_definition', defdim)
+      IF ( cdfstat .NE. NF_NOERR ) cdfstat = NF_DEF_DIM_ 
+     .     ( cdfid, 'grid_definition', 1, defdim )
+#else
+       	cdfstat = NF_INQ_DIMID( cdfid, 'grid_definition', defdim)
+      IF ( cdfstat .NE. NF_NOERR ) cdfstat = NF_DEF_DIM 
+     .     ( cdfid, 'grid_definition', 1, defdim )
+#endif
+
+
+* create an output grid name that reflects axes which have been averaged, etc.
+* and a string with a list of the axis names (starting w/ 2 blanks)
+      gname = grid_name(grid)
+      glen = TM_LENSTR1( gname )
+! 2/96 - strip parentheses from dynamic grid name
+      IF ( gname(1:1).EQ.'(' .AND. glen.GT.2 ) THEN
+	gname = gname(2:glen-1)
+	glen = glen - 2
+      ENDIF
+! 2/96 - end of insertion
+      gmod = .FALSE.
+      names = ' '
+      nlen = 1
+      DO 50 idim = 1, nferdims
+         iaxis = grid_line(idim, grid)
+
+         lname = CD_AXIS_NAME( dset, grid, idim, slen )
+         IF (keepax_flag .EQ. 1)  lname = 
+     .        CD_AXIS_OUTNAME( dset, grid, idim, slen )
+
+         IF ( iaxis .EQ. mpsnorm ) THEN
+            names = names(:nlen)//' '//'NORMAL'
+         ELSEIF ( lo(idim) .EQ. unspecified_int4 ) THEN
+            names = names(:nlen)//' '//'NORMAL'
+            IF ( gmod ) THEN
+               gname = gname(:glen)//ww_dim_name(idim)
+               glen = glen + 1
+            ELSE
+               gname = gname(:glen)//'_N'//ww_dim_name(idim)
+               gmod = .TRUE.
+               glen = glen + 3
+            ENDIF
+
+         ELSEIF ( lname .EQ. 'ABSTRACT' .AND. (keepax_flag.EQ.0)) THEN
+            names = names(:nlen)//' '//
+     .           CD_CHILDAX_NAME( ww_dim_name(idim)//'AX',
+     .                            lo(idim), hi(idim), i )
+         ELSE
+            names = names(:nlen)//' '//lname
+         ENDIF
+         nlen = TM_LENSTR1(names)
+ 50   CONTINUE
+
+* does this grid already exist ? (no consistency check if so)
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VARID_( cdfid, gname(:glen), defid )
+#else
+      cdfstat = NF_INQ_VARID ( cdfid, gname(:glen), defid )
+#endif
+      IF ( cdfstat .EQ. NF_NOERR ) GOTO 1000
+
+* create a dummy variable for this grid definition
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_DEF_VAR_( cdfid, gname(:glen), NF_CHAR, 1,
+     .                defdim, defid )
+#else
+      cdfstat = NF_DEF_VAR ( cdfid, gname(:glen), NF_CHAR, 1,
+     .                defdim, defid )
+#endif
+
+* write the axis list as an attribute of the grid
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_PUT_ATT_TEXT_( cdfid, defid, 'axes', nlen-2,
+     .             names(3:))
+#else
+      cdfstat = NF_PUT_ATT_TEXT ( cdfid, defid, 'axes', nlen-2,
+     .             names(3:))
+#endif
+
+* create the parent axes
+ 100  DO 200 idim = 1, nferdims
+         IF ( grid_line(idim, grid) .NE. mpsnorm
+     .  .AND. lo(idim) .NE. unspecified_int4     ) THEN
+            CALL CD_WRITE_AXIS( cdfid, dset, grid, idim, 
+     .           idim.EQ.recdim,
+     .           lo(idim), hi(idim), pcdf_full_span, 
+     .           edges_flag, do_bounds, mode_upcase_output,
+     .           keepax_flag, name_from_grid, status ) 
+
+            IF ( status .NE. merr_ok ) GOTO 5900
+         ENDIF
+ 200  CONTINUE
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_strdim.F b/fmt/src/cd_write_strdim.F
new file mode 100644
index 0000000..731f132
--- /dev/null
+++ b/fmt/src/cd_write_strdim.F
@@ -0,0 +1,128 @@
+	INTEGER FUNCTION CD_WRITE_STRDIM ( cdfid, maxstrlen, dimname, status )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Create a netCDF dimension for the axis of the character strings
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V533 *sh* 6/01 
+*     *kob* 6/01 - remove redundant declaration NF_INQ_DIMLEN
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V686 12/13*acm* For string variables from datasets, keep the string-dimension name and length
+*                 from the original dataset on output.
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     maxstrlen - number of characters that can be stored in file
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'cdf_tmap.parm'
+#include "gt_lib.parm"
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+
+      CHARACTER*(*) dimname
+      INTEGER cdfid, maxstrlen, status
+
+* local variable declarations:
+      CHARACTER CD_CHILDAX_NAME*128
+      INTEGER TM_LENSTR, cdfstat, clen, nlen, dimid
+
+* initialize
+      
+      nlen = TM_LENSTR(dimname)
+      IF (nlen .LT. 1) 
+     .    dimname = CD_CHILDAX_NAME('STRING', 1, maxstrlen, nlen )
+
+* is the dimension already defined ?
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_DIMID_( cdfid, dimname(:nlen), dimid )
+#else
+      cdfstat = NF_INQ_DIMID ( cdfid, dimname(:nlen), dimid )
+#endif
+      IF ( cdfstat .EQ. NF_NOERR ) THEN
+* ... yes. make sure defn is consistent
+
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_INQ_DIMLEN_(cdfid, dimid, clen)
+#else
+	cdfstat = NF_INQ_DIMLEN(cdfid, dimid, clen)
+#endif
+	IF (clen .NE. maxstrlen) GOTO 5100
+      ELSE
+* ... no. define it
+        CALL CD_SET_MODE(cdfid, pcd_mode_define, status)
+        IF ( status .NE. merr_ok ) RETURN
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_DEF_DIM_(cdfid, dimname(:nlen), maxstrlen, dimid)
+#else
+	cdfstat = NF_DEF_DIM (cdfid, dimname(:nlen), maxstrlen, dimid)
+#endif
+
+        IF ( cdfstat .NE. NF_NOERR ) GOTO 5200
+      ENDIF
+
+* successful completion
+      status = merr_ok
+      CD_WRITE_STRDIM = dimid
+      RETURN
+
+* error messages
+ 5100 CALL TM_ERRMSG
+     . ( merr_linepredef, status, 'CD_WRITE_STRDIM', unspecified_int4,
+     .   unspecified_int4,
+     .  'dimension '//dimname(:nlen)//' doesnt match CDF file',
+     .  no_errstring, *5900 )
+
+ 5200        CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'CD_WRITE_STRDIM', cdfid,
+     .       unspecified_int4, 'Failed creating dimension '
+     .       //dimname(:nlen), no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
diff --git a/fmt/src/cd_write_var.F b/fmt/src/cd_write_var.F
new file mode 100644
index 0000000..af5d9f7
--- /dev/null
+++ b/fmt/src/cd_write_var.F
@@ -0,0 +1,551 @@
+	SUBROUTINE CD_WRITE_VAR ( memory, cdfid, dset, vname, grid, lo,
+     .                            hi, dat, edges_flag, do_bounds, 
+     .                            scalefac, addoff, bad, mode_upcase_output, 
+     .                            keepax_flag, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Write a hyperslab of data into the current output netCDF file
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/92
+*  performance: 10/92 consolidated record axis data writes under 1 ncendf call
+*                     and use CD_SET_MODE to change between data & define modes
+*  12/92: coordinate variables -> double precision
+*   1/95: use cd_get_generic_bounds to synchronize output in files without
+*	  the slab_(min/max)_limits machinery 
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+*	      - had to use F90 Intrinsic function TRANSFER to properly
+*		pass single values to NCVPT as arrays of 1 element
+* 6/97	*kob* - fix introduced bug in call to NCVPT
+* V533 *sh* 6/01 - add support for string variables (NF_CHAR)
+* V552 *acm* 5/03   increase vbuff to 128 chars 
+* V570 *acm*  5/04 write bounds 2xN coordinates when record axis is irregular.
+* V600 *acm*  6/05 Attribute control. Get info from linked-list structure.
+* V601 *acm* 10/06 Fix bug 1461: bounds variable was created for output in cd_write_axis
+*                  with an upcased variable name, e.g. TIME_bnds. Here we need to upcase
+*                  as well when finding bndid (if mode upcase_output is set).
+* V602 *acm* 11/06 - Fix bug 1471; new routine CD_AXIS_OUTNAME gets correct 
+*                    output axis name.
+* V63  *acm   9/09 Fix bug 1692: issue an error message if we try to append irreg timesteps
+*                  to a previously-regular axis that didn't have a bounds attribute.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library. 
+* V641 *acm* 1/10  Fix bug 1715 and output of packed data.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+*      4/12 *acm* fix for finding the record axis, never axes 5 or 6.
+* V685 6/13 *acm* new qualifier SAVE/NOBOUNDS
+* V685 6/13 *acm* Dont add SAVE/NOCOORDS
+* V687 3/14 *acm* Fix ticket 1750. Write Ferret-internal axis names to cdf files, unless
+*                 the user has said /KEEP_AXISNAMES
+
+* argument definitions:
+*     cdfid   - netCDF id number for already opened CDF file
+*     dset    - dset (if netcdf file, for getting name and attribute 
+*               info from linked-list structure  
+*     vname   - name of variable
+*     grid    - defining grid for variable
+*     lo      - low indices of variable hyperslab
+*     hi      - high indices of variable hyperslab
+*     dat     - data values to write
+*     status  - return status
+
+* include files
+        include 'netcdf.inc'
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+        include 'cdf_tmap.parm'
+        include 'ferret.parm'
+        include 'xvariables.cmn'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      LOGICAL mode_upcase_output
+      INTEGER cdfid, dset, grid, lo(nferdims), hi(nferdims), 
+     .        edges_flag, do_bounds, keepax_flag, status
+      CHARACTER*(*) vname
+      REAL dat(*), bad
+      REAL*8 scalefac, addoff
+      REAL memory( mem_blk_size, max_mem_blks )
+
+* local variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      INTEGER TM_LENSTR1, 
+     .        start(nferdims), count(nferdims), idim, iaxis, cdfstat, vlen,
+     .        slab_min(nferdims), slab_max(nferdims), tmrecax, cdrecax, dims, varid,
+     .        hilim, i100, i, j, k, l, m, n, recaxvar, lorec, hirec, rectyp,
+     .	      vartyp, nvdim, vdims(8), nvatts, bndstart(2), bndcount(2),
+     .        mblk1, nblks, npts, savecount
+      LOGICAL CD_GET_BOUNDS, TM_ABSTRACT_AXIS, TM_DFPEQ, 
+     .        got_it, scaled, writebounds
+      CHARACTER*13 TM_STRING
+      CHARACTER*1  dimnam(nferdims)
+      DATA  	   dimnam/'I','J','K','L','M','N'/
+      CHARACTER*128 vbuff     ! needed because of fussy f772.1 DEC compiler
+      REAL   r_scale, r_offset, scaled_bad
+      REAL*8 r100_8(200)
+      REAL*8 TM_WORLD
+      
+      INTEGER bndid, nlen, elen, reset
+      CHARACTER name*128, buff*128, CD_AXIS_OUTNAME*128, CD_AXIS_NAME*128
+
+      REAL*4 r100_4(200)
+      REAL*8 new_box_lo, old_box_hi, reset_bnd_lo, missflag
+c      EQUIVALENCE (r100_8, r100_4)
+
+* For error message
+      CHARACTER*9 typnam(6)
+      DATA typnam/'NC_BYTE', 'NC_CHAR', 'NC_SHORT', 'NC_INT', 
+     .            'NC_FLOAT', 'NC_DOUBLE'/
+
+* initialize
+      vlen = TM_LENSTR1( vname )
+      writebounds = do_bounds .GT. 0
+
+* get the variable id
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VARID_(cdfid, vname(:vlen), varid)
+#else
+      cdfstat = NF_INQ_VARID(cdfid, vname(:vlen), varid)
+#endif
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5100
+
+* get the vital statistics for this variable
+#ifdef usingDODSf2cUnderscore
+      cdfstat = NF_INQ_VAR_(cdfid, varid, vbuff, vartyp, nvdim,
+     .             vdims, nvatts)
+#else
+      cdfstat = NF_INQ_VAR (cdfid, varid, vbuff, vartyp, nvdim,
+     .             vdims, nvatts)
+#endif
+
+* enter data mode so data can be read and written
+* (CD_GET_GENERIC_BOUNDS needs to read coordinate values)
+      CALL CD_SET_MODE(cdfid, pcd_mode_data, status)
+      IF ( status .NE. merr_ok ) RETURN
+
+* get the hyperslab limits of this variable as stored in the file
+      got_it = CD_GET_BOUNDS( cdfid, varid, slab_min, slab_max,
+     .                        tmrecax, status )
+      IF ( status .NE. merr_ok ) GOTO 5900
+    
+      IF (.NOT.got_it) CALL CD_GET_GENERIC_BOUNDS
+     . ( cdfid, varid, grid, lo, slab_min, slab_max, tmrecax, status )
+
+      IF ( status .NE. merr_ok ) GOTO 5900
+
+* special check for abstract axes (kludge!) - length, only
+* if i=5:15 overwrites i=1:10 it will be detected but
+* if i=6:15 overwrite i=1:10 it still will not be detected resulting in an
+* unhelpful error message, below
+	 
+         DO 10 idim = 1, nferdims
+            IF ( idim .EQ. tmrecax ) GOTO 10
+            iaxis = grid_line(idim, grid)
+            IF ( TM_ABSTRACT_AXIS(iaxis)
+     .     .AND. lo(idim).NE.unspecified_int4) THEN
+               IF ( hi(idim)-lo(idim)
+     .         .GT. slab_max(idim)-slab_min(idim) ) GOTO 5250
+               slab_min(idim) = lo(idim)
+               slab_max(idim) = hi(idim)
+            ENDIF
+ 10      CONTINUE
+* ... possible unnecessary record axis check
+         IF ( lo(t_dim).EQ.unspecified_int4 ) tmrecax = 0
+
+* check for valid limits (must be consistent with first time write)
+* When reading a 4D file with 6D Ferret, skip checks when slab_min, 
+* slab_max have been set to  unspecified_int4
+
+      DO 100 idim = 1, nferdims
+         IF ( idim .EQ. tmrecax ) GOTO 100
+	 IF (slab_min(idim) .EQ. unspecified_int4 ) GOTO 100
+         IF ( lo(idim) .EQ. unspecified_int4 ) THEN
+            IF ( slab_min(idim) .NE. 1 ) GOTO 5200
+         ELSE
+            IF ( lo(idim) .LT. slab_min(idim)
+     .      .OR. hi(idim) .GT. slab_max(idim) ) GOTO 5200
+         ENDIF
+ 100  CONTINUE
+
+* determine the start and count as netCDF will want them
+* and determine which axis (cdrecax = 1-4) of THIS (possibly less than 4D)
+* variable is the record axis.  
+* 4/2012 6D Ferret: Note that dimensions 5 and 6 will NOT
+* be the record axis. 
+
+* (the complex logic for this is to allow future record axes not to be T)
+      cdrecax = tmrecax
+      dims = 0
+      DO 200 idim = 1, nferdims
+         iaxis = grid_line(idim, grid)
+         IF ( iaxis.EQ.mnormal .OR. lo(idim).EQ.unspecified_int4) THEN
+* TODO: this logic is NOT ok for 6D, it assumes rec ax # is larger than other axes. 
+*       Wind up with cdrecax = 0...
+            IF ( dims.LE.tmrecax .AND. idim.LE.4 ) cdrecax = cdrecax - 1   ! logic ok ??
+         ELSE
+            dims = dims + 1
+            start(dims) = lo(idim) - slab_min(idim) + 1
+            count(dims) = hi(idim) - lo(idim) + 1
+         ENDIF
+ 200  CONTINUE
+
+* synchronize with data already in the file along the record dimension
+* then write the coordinate values to the file
+
+* is record axis involved in this variable (e.g. time-independent) ?
+      IF ( tmrecax .NE. 0 ) THEN
+         lorec = lo(tmrecax)
+         hirec = hi(tmrecax)
+      ELSE
+         lorec = unspecified_int4
+      ENDIF
+      IF ( lorec .NE. unspecified_int4 ) THEN
+
+         CALL CD_REC_SYNCH( cdfid, lorec, hirec, tmrecax,
+     .               grid, start(cdrecax), recaxvar, rectyp, 
+     .               reset, old_box_hi, new_box_lo, writebounds,
+     .               status )
+
+         IF ( status .NE. merr_ok ) GOTO 5900
+
+* RESET flag: need to adjust box limits and possibly add a void point between the 
+* last cell of the existing axis and the lower bound of the axis being appended
+
+        IF (reset .NE. 0) THEN    
+            IF (reset .EQ. 2) THEN  ! just need to adjust low bound of new axis.
+               reset_bnd_lo = new_box_lo
+
+            ELSE IF (reset .EQ. 1) THEN  ! write a void point
+
+               savecount = count(cdrecax)
+               count(cdrecax) = 1
+
+**************************************
+
+* Write out  an extra point on the axis; NC library 
+* writes fill-missflagged data for the extra point?  
+
+
+               r100_8(1) = (old_box_hi + new_box_lo)/2.D0
+
+#ifdef FORTRAN_90
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, recaxvar, 
+     .                 TRANSFER(start(cdrecax),start,1),
+     .                 TRANSFER(1,count,1), 
+     .		       TRANSFER(r100_8,r100_4))
+#else
+            cdfstat = NF_PUT_VARA_DOUBLE(cdfid, recaxvar, 
+     .                 TRANSFER(start(cdrecax),start,1),
+     .                 TRANSFER(1,count,1), 
+     .		       TRANSFER(r100_8,r100_4))
+#endif
+#else
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, recaxvar,
+     .                 start(cdrecax), 1, r100_8)
+#else
+	    cdfstat = NF_PUT_VARA_DOUBLE(cdfid, recaxvar,
+     .                 start(cdrecax), 1, r100_8)
+#endif
+#endif
+            IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+
+
+* Now write the bounds for this point
+
+            r100_8(1) = old_box_hi
+            r100_8(2) = new_box_lo
+
+            bndstart(1) = 1
+            bndcount(1) = 2
+            bndstart(2) = start(cdrecax)
+            bndcount(2) = 1
+
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, bndid, bndstart,
+     .		           bndcount, r100_8)
+#else
+            cdfstat = NF_PUT_VARA_DOUBLE(cdfid, bndid, bndstart,
+     .		           bndcount, r100_8)
+#endif
+            IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+
+* Write a time-step slab containing missing data
+            npts = 1
+            DO 220  idim = 1, nferdims
+               IF ( idim .EQ. tmrecax ) GOTO 220
+               IF ( count(idim) .GT. 0 ) npts = npts* count(idim)
+ 220        CONTINUE
+
+* allocate memory for missing-data
+
+            CALL GET_MEMORY( npts*4, mblk1, nblks, status )
+            IF ( status .NE. merr_ok ) GOTO 5900
+
+            CALL CD_GET_MISSING_FLAG (cdfid, varid, vname, .TRUE., 
+     .           missflag, status)
+            IF (status .EQ. 0) missflag = unspecified_val4
+
+            npts = 1
+            memory(npts, mblk1) = missflag
+            DO 240 i = 1, MAX(count(1),1)
+            DO 240 j = 1, MAX(count(2),1)
+            DO 240 k = 1, MAX(count(3),1)
+            DO 240 l = 1, MAX(count(4),1)
+            DO 240 m = 1, MAX(count(5),1)
+            DO 240 n = 1, MAX(count(6),1)
+               memory(npts, mblk1) = missflag
+               npts = npts + 1
+ 240        CONTINUE
+
+            CALL CD_WRITE_VAR_SUB( cdfid, varid, vartyp, dims, start,
+     .             count, vdims(1), memory(1, mblk1), cdfstat )
+ 
+            CALL FREE_MEMORY( mblk1, nblks )
+            start(cdrecax) = start(cdrecax) + 1
+            count(cdrecax) = savecount
+         ENDIF
+
+      ENDIF  ! Reset
+**************************************
+
+* write the record axis coords (buffer 100 at a time) (12/92 REAL*8 option)
+* (code lifted from CD_REC_SYNCH 10/92)
+         DO 310 i100 = lorec, hirec, 100
+            hilim = MIN(i100+99, hirec)
+            DO 300 i = i100, hilim
+               r100_8(i-i100+1) = TM_WORLD(i,grid,tmrecax,box_middle)
+               IF ( rectyp .EQ. NF_FLOAT ) r100_4(i-i100+1)
+     .                                  = r100_8(i-i100+1)
+ 300        CONTINUE
+
+#ifdef FORTRAN_90
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, recaxvar, 
+     .                 TRANSFER(i100-lorec+start(cdrecax),start,1),
+     .                 TRANSFER(hilim-i100+1,count,1), 
+     .		       TRANSFER(r100_8,r100_4) )
+#else
+	    cdfstat = NF_PUT_VARA_DOUBLE(cdfid, recaxvar, 
+     .                 TRANSFER(i100-lorec+start(cdrecax),start,1),
+     .                 TRANSFER(hilim-i100+1,count,1), 
+     .		       TRANSFER(r100_8,r100_4) )
+#endif
+#else
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, recaxvar, 
+     .                 i100-lorec+start(cdrecax),
+     .                 hilim-i100+1, r100_8)
+#else
+	    cdfstat = NF_PUT_VARA_DOUBLE(cdfid, recaxvar, 
+     .                 i100-lorec+start(cdrecax),
+     .                 hilim-i100+1, r100_8)
+#endif
+#endif
+            IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+ 310     CONTINUE
+
+* Now write the bounds, if record axis is irregular, or if /BOUNDS was requested.
+
+         iaxis = grid_line(tmrecax, grid)
+
+	 IF (do_bounds .GE. 0) THEN
+         IF ( (.NOT.line_regular(iaxis) .OR. writebounds) 
+     .         .AND. (edges_flag .EQ. 0) ) THEN
+
+            name = CD_AXIS_NAME( dset, grid, tmrecax, nlen )
+            IF (keepax_flag .EQ. 1) name = CD_AXIS_OUTNAME( dset, grid, tmrecax, nlen )
+
+* If mode upcase_output is set, then upcase axis name.
+
+            IF (mode_upcase_output) THEN
+               CALL STR_UPCASE( buff, name)
+               name = buff
+            ENDIF
+
+            name = name(:nlen)//'_bnds'
+            elen = nlen + 5
+#ifdef usingDODSf2cUnderscore
+            cdfstat = NF_INQ_VARID_(cdfid, name(:elen),  bndid)
+#else
+	    cdfstat = NF_INQ_VARID(cdfid, name(:elen),  bndid)
+#endif
+	    IF (cdfstat .NE. NF_NOERR ) GOTO 5400
+
+            DO 330 i100 = lorec, hirec, 100
+               hilim = MIN(i100+99, hirec)
+               r100_8(1) = TM_WORLD(i100,grid,tmrecax,box_lo_lim)
+               DO 320 i = i100, hilim
+                  j = 2*(i-i100+1)-1
+                  r100_8(2*(i-i100+1)-1) = TM_WORLD(i,grid,tmrecax,box_lo_lim)
+                  r100_8(2*(i-i100+1)) = TM_WORLD(i,grid,tmrecax,box_hi_lim)
+                  IF ( rectyp .EQ. NF_FLOAT ) r100_4(i-i100+1)
+     .                                  = r100_8(i-i100+1)
+ 320           CONTINUE
+
+               bndstart(1) = 1
+               bndstart(2) = i100-lorec+start(cdrecax)
+               bndcount(1) = 2
+               bndcount(2) =  hilim-i100+1
+
+               IF (reset_bnd_lo .NE. 0.D0) THEN
+                  r100_8(i100-lorec+start(cdrecax)) = reset_bnd_lo
+                  reset_bnd_lo = 0.D0
+               ENDIF
+
+#ifdef usingDODSf2cUnderscore
+               cdfstat = NF_PUT_VARA_DOUBLE_(cdfid, bndid, bndstart,
+     .		           bndcount, r100_8)
+#else
+	       cdfstat = NF_PUT_VARA_DOUBLE(cdfid, bndid, bndstart,
+     .		           bndcount, r100_8)
+#endif
+               IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+ 330        CONTINUE
+         ENDIF
+         ENDIF
+
+      ENDIF
+
+* if data was scaled on input, rescale it. This also rescales data containing
+* the missing value flag, as on input.
+
+* Scale the bad data too... on input to netCDF we scale all the data,
+* compute the missing flag for internal use as indat*inscale + inoff
+* and insert that internal missing flag.
+*
+* To write scaled data, scale all of it by ferretdat(1./inscale) - (inoff/inscale)
+* the scaling to be used is sent into this routine.
+
+
+      IF ( .NOT. TM_DFPEQ(scalefac, 1.D0) .OR. 
+     .     .NOT. TM_DFPEQ(addoff, 0.D0) ) THEN
+
+         IF (.NOT. TM_DFPEQ(scalefac, 0.D0) ) r_scale = 1.D0/scalefac
+         r_offset = -1.D0* addoff* r_scale
+
+         npts = 1
+         DO 250  idim = 1, nferdims
+            IF ( count(idim) .GT. 0 ) npts = npts* count(idim)
+ 250     CONTINUE
+         CALL TM_SCALE_ALL ( r_scale, r_offset, dat, vartyp, npts )
+
+         scaled = .TRUE.
+      ENDIF
+
+* write the slab
+      CALL CD_WRITE_VAR_SUB( cdfid, varid, vartyp, dims, start, count, 
+     .	vdims(1), dat, cdfstat )
+
+* If rescaled above, restore it to previous values
+
+      IF ( scaled ) THEN
+         r_scale = scalefac
+         r_offset = addoff
+         scaled_bad = bad* r_scale + r_offset
+         CALL TM_SCALE( r_scale, r_offset, scaled_bad, dat, npts )
+      ENDIF
+
+      IF ( cdfstat .EQ. -60) GOTO 5260
+      IF ( cdfstat .NE. NF_NOERR ) GOTO 5300
+
+* successful completion
+ 1000 status = merr_ok
+      RETURN
+
+* error messages
+ 5100 CALL TM_ERRMSG
+     . ( merr_unkvar, status, 'CD_WRITE_VAR', unspecified_int4,
+     .   unspecified_int4,
+     .   'variable was never created in CDF file',
+     .   vname(:vlen), *5900 )
+
+ 5200 vbuff = vname   ! needed because of fussy DEC f77 v2.1 compiler
+      CALL TM_ERRMSG (merr_outofgrid, status, 'CD_WRITE_VAR',
+     .     no_descfile, no_stepfile,
+     .     vbuff(:vlen)//'['//dimnam(idim)//'='//
+     .     TM_STRING(DBLE(lo(idim)))//':'//
+     .     TM_STRING(DBLE(hi(idim)))//']',
+     .     vbuff(:vlen)//'['//dimnam(idim)//'='//
+     .     TM_STRING(DBLE(slab_min(idim)))//':'//
+     .     TM_STRING(DBLE(slab_max(idim)))//']',
+     .     *5900)
+
+ 5250 vbuff = vname 
+      CALL TM_ERRMSG (merr_outofgrid, status, 'CD_WRITE_VAR',
+     .     no_descfile, no_stepfile, 
+     .    'inconsistent '//dimnam(idim)//' axis length for '//
+     .     vbuff(:vlen), no_errstring, *5900 )
+     
+
+ 5260 vbuff = vname 
+      CALL TM_ERRMSG (cdfstat+pcdferr, status, 'CD_WRITE_VAR',
+     .     no_descfile, no_stepfile, 
+     .    'data in variable '//vbuff(:vlen)//
+     .    ' not representable in output type '//typnam(vartyp),
+     .     no_errstring, *5900 )
+
+ 5300 CALL TM_ERRMSG
+     . ( cdfstat+pcdferr, status, 'CD_WRITE_VAR', unspecified_int4,
+     . no_varid, 'failure writing to CDF output file',
+     . no_errstring, *5900 )
+
+ 5400  CALL TM_ERRMSG
+     . ( cdfstat+pcdferr, status, 'CD_WRITE_VAR', 
+     .   no_descfile, no_stepfile, name(:elen)//' not found. '//
+     . 'Attempt to append irregular coordinates to NetCDF '//
+     . 'axis which has no bounds attribute. Write data originally with '//
+     . 'the /BOUNDS qualifier.',
+     . no_errstring, *5900 )
+
+* error exit
+ 5900   RETURN
+	END
+
diff --git a/fmt/src/cd_write_var_sub.c b/fmt/src/cd_write_var_sub.c
new file mode 100644
index 0000000..eaafbff
--- /dev/null
+++ b/fmt/src/cd_write_var_sub.c
@@ -0,0 +1,225 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/*   
+    cd_write_var_sub.c -- this routine hides the call to netCDF routine
+    NCVPT allowing last minute modifications to the call arguments
+
+
+    for Ferret interactive data analysis program
+
+    programmer - steve hankin
+    NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+    revision history:
+    V533: 6/01 *sh* - original
+
+    v540: 11/01 *kob* - change passed in values for start and count
+                        to temp variables which are declared
+			compatibly with the passed in types from the 
+			fortran routine CD_READ.F.  Once in, need to 
+			convert these to the proper type that the 
+			netcdf c routines expect.  This may vary from
+			o.s. to o.s. depending on what, for example,
+			size_t and ptrdiff_t are typdef'd as.  They are
+			typedef'd as different things under solaris and 
+			compaq Tru64, for example
+
+
+
+    compile this with
+    cc -c -g -I/opt/local/netcdf-3.4/include cd_write_var_sub.c
+*/ 
+
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build */ 
+/*                      Other changes to correctly deal with the scalar case dim=0 */ 
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the */ 
+/*					 definition of macro DFTYPE in ferretmacros.h. */ 
+/*  V674 2/12 *acm* 6D Ferret: use NFERDIMS rather than 4 for dimension indexing */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <netcdf.h>
+#include <assert.h>
+#include "ferretmacros.h"
+
+
+/* prototype */
+void tm_blockify_ferret_strings(void *dat, char *pbuff,
+				int bufsiz, int outstrlen);
+
+void FORTRAN(cd_write_var_sub) (int *cdfid, int *varid, int *vartyp,
+				int *dims, int *tmp_start, int *tmp_count, 
+				int *strdim, void *dat, int *cdfstat )
+
+{
+  /* convert FORTRAN-index-ordered, FORTRAN-1-referenced ids, count,
+     and start to C equivalent
+
+     *kob*  11/01 need start and count  variables of the same type
+                  as is predfined for each O.S.
+
+     V542: 11/02 *acm*  Need start and count to be length [5] to allow for
+			string dimension.
+
+     V600:  2/06 *acm* Write more data types to netcdf files : Note that compiler
+                       warnings may be seen about data type inconsistencies in the
+					   calls to nc_put_vara_float. This is ok; see the comments at
+					   the end of this file
+  */
+
+  size_t start[NFERDIMSP1], count[NFERDIMSP1], tmp;
+  int i;
+  size_t bufsiz, maxstrlen;
+  char *pbuff;
+  int ndim = 0;
+  int indim = *dims;
+  int vid = *varid;
+  int did = *strdim;
+  vid--;
+  did--;
+
+	if (*dims > 0)
+		ndim = *dims - 1; /* C referenced to zero */  
+
+  /* cast passed in int values (from fortran) to proper types, which can
+     be different depending on o.s       *kob* 11/01 */
+  for (i=0;i<NFERDIMSP1;i++) {
+    start[i] = (size_t)tmp_start[i];
+    count[i] = (size_t)tmp_count[i];
+  }
+
+  for (i=0; i<=ndim; i++)
+		{
+			if (start[i] > 0)
+				start[i]--;
+		}
+
+	if (ndim > 0)
+		{
+			for (i=0; i<=ndim/2; i++) {
+				tmp = count[i];
+				count[i] = count[ndim-i];
+				count[ndim-i] = tmp;
+
+				tmp = start[i];
+				start[i] = start[ndim-i];
+				start[ndim-i] = tmp;
+			}
+		}
+
+  /* write out the data */
+  if (*vartyp == NC_CHAR)
+		{
+
+    /* Create a buffer area with the multi-dimensiona array of strings
+       packed into a block.
+       The "dat" variables is a pointer to an array of string pointers
+       where the string pointers are spaced 8 bytes apart
+    */
+      *cdfstat = nc_inq_dimlen (*cdfid, did, &bufsiz);
+      if (*cdfstat != NC_NOERR) return;
+      maxstrlen = bufsiz;
+      if (indim > 0) {
+         for (i=0; i<=ndim; i++) bufsiz *= count[i];
+       }
+      pbuff = (char *) malloc(sizeof(char) * bufsiz);
+      if ( pbuff == NULL )
+         abort();
+      tm_blockify_ferret_strings(dat, pbuff, (int)bufsiz, (int)maxstrlen);
+
+      /* update variable dimensions to include string dimension */
+      start[*dims] = (size_t)0;
+      count[*dims] = maxstrlen;
+
+      *cdfstat = nc_put_vara_text(*cdfid, vid,
+				 start, count, pbuff);
+      free(pbuff);
+		} else
+		{
+			/* FLOAT data */
+#ifdef double_p
+			*cdfstat = nc_put_vara_double(*cdfid, vid,
+				 start, count, (DFTYPE*) dat);
+#else
+			*cdfstat = nc_put_vara_float(*cdfid, vid,
+				 start, count, (float*) dat);
+#endif
+		}
+
+  return;
+}
+
+/*
+From a netcdf man page found on-line at
+
+http://129.89.70.230/cgi-bin/IMT/wwwman?topic=netcdf(3)&msection=1
+
+  int nc_put_vara_text(int ncid,  int  varid,  const  size_t  start[],	const
+       size_t count[], const char out[])
+
+  int nc_put_vara_uchar(int ncid, int  varid,  const  size_t  start[],	const
+       size_t count[], const unsigned char out[])
+
+  int nc_put_vara_schar(int ncid, int  varid,  const  size_t  start[],	const
+       size_t count[], const signed char out[])
+
+  int nc_put_vara_short(int ncid, int  varid,  const  size_t  start[],	const
+       size_t count[], const short out[])
+
+  int nc_put_vara_int(int ncid, int varid, const size_t start[], const size_t
+       count[], const int out[])
+
+  int nc_put_vara_long(int ncid,  int  varid,  const  size_t  start[],	const
+       size_t count[], const long out[])
+
+  int nc_put_vara_float(int ncid, int  varid,  const  size_t  start[],	const
+       size_t count[], const float out[])
+
+  int nc_put_vara_double(int ncid, int varid,  const  size_t  start[],	const
+       size_t count[], const double out[])
+
+       Writes an array section of values into a netCDF variable	 of  an	 open
+       netCDF  dataset,	 which	must  be  in data mode.	 The array section is
+       specified by the start and count vectors, which give the starting  in-
+       dex  and	 count	of values along each dimension of the specified vari-
+       able.  The type of the data is specified in the function name  and  is
+       converted to the external type of the specified variable, if possible,
+       otherwise an NC_ERANGE error is returned.
+
+*/
diff --git a/fmt/src/deleted_list.h b/fmt/src/deleted_list.h
new file mode 100644
index 0000000..ef698bb
--- /dev/null
+++ b/fmt/src/deleted_list.h
@@ -0,0 +1,65 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance
+ */
+
+
+#ifndef _DELETED_LIST_H
+#define _DELETED_LIST_H
+
+
+   struct Deleted_List_Node {
+      int index;
+      struct Deleted_List_Node * prev;
+      struct Deleted_List_Node * next;
+   };
+   typedef struct Deleted_List_Node DL_Node;
+
+   struct Deleted_List_Header {
+      int head;
+      int array_size;
+      int deleted_value;
+      DL_Node ** ptr_table;
+      DL_Node * deleted_list_head;
+      DL_Node * undel_list_head;
+      int * int_array;
+   };
+   typedef struct Deleted_List_Header DLHead;
+
+#endif /*_DELETED_LIST_H*/
+
diff --git a/fmt/src/deleted_list_clear.c b/fmt/src/deleted_list_clear.c
new file mode 100644
index 0000000..0941dbd
--- /dev/null
+++ b/fmt/src/deleted_list_clear.c
@@ -0,0 +1,60 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance. This function is for cleaning up
+                 the data structure.
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "deleted_list.h"
+
+void deleted_list_clear_(void * deleted_list_header)
+{
+   int i,j;
+   int array_size;
+   DLHead * head;
+
+   head = *((DLHead**)deleted_list_header);
+   array_size = head->array_size;
+   if(head){
+       for(j=1;j<=array_size;j++)
+         free(head->ptr_table[j-1]);
+       free(head->ptr_table);
+   }
+   *((int*)deleted_list_header)=0;
+}
+
diff --git a/fmt/src/deleted_list_get_del.c b/fmt/src/deleted_list_get_del.c
new file mode 100644
index 0000000..872646d
--- /dev/null
+++ b/fmt/src/deleted_list_get_del.c
@@ -0,0 +1,72 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance. This function is to get the deleted
+                 list
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "deleted_list.h"
+
+void deleted_list_get_del_( void *deleted_list_header,
+                             int *result_array,
+                             int *result_array_size,
+                             int *num_indices
+                           )
+{
+   int j=0;
+   int array_size; 
+   DLHead * head;
+   DL_Node *p;
+
+   head = *((DLHead**)deleted_list_header);
+   if(head){
+      array_size = *result_array_size;
+
+      for(p=head->deleted_list_head; p; p=p->next) {
+	if(j<array_size){
+	   result_array[j] = p->index;
+           j++;
+	}
+        else 
+	   break;
+      }
+   }
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/deleted_list_get_undel.c b/fmt/src/deleted_list_get_undel.c
new file mode 100644
index 0000000..f36bed1
--- /dev/null
+++ b/fmt/src/deleted_list_get_undel.c
@@ -0,0 +1,72 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance. This function is to get the undeleted
+                 list.
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "deleted_list.h"
+
+void deleted_list_get_undel_( void *deleted_list_header,
+                             int *result_array,
+                             int *result_array_size,
+                             int *num_indices
+                           )
+{
+   int j=0;
+   int array_size; 
+   DLHead * head;
+   DL_Node *p;
+
+   head = *((DLHead**)deleted_list_header);
+   if(head){
+      array_size = *result_array_size;
+
+      for(p=head->undel_list_head; p; p=p->next) {
+	if(j<array_size){
+	   result_array[j] = p->index;
+           j++;
+	}
+        else 
+	   break;
+      }
+   }
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/deleted_list_init.c b/fmt/src/deleted_list_init.c
new file mode 100644
index 0000000..0bfaf3a
--- /dev/null
+++ b/fmt/src/deleted_list_init.c
@@ -0,0 +1,95 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance. This function is to initialize the 
+                 data structure.
+ */
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build*/ 
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "deleted_list.h"
+
+void deleted_list_init_(void *deleted_list_header,
+                         int *int_array,
+			 int *int_array_size,
+                         int *deleted_value 
+                        )
+{
+   int i,j;
+   int array_size;
+   DLHead * head;
+   DL_Node * p;
+
+   head = (DLHead*)malloc(sizeof(DLHead));
+   *((DLHead**)deleted_list_header) = head;
+   head->int_array = int_array;
+   head->array_size = *int_array_size;
+   head->deleted_value = *deleted_value;
+   array_size = head->array_size;
+
+   head->ptr_table = (DL_Node**)malloc(array_size*sizeof(DL_Node*));
+   memset((void *)head->ptr_table, 0, array_size*sizeof(DL_Node*));
+   head->deleted_list_head = NULL;
+   head->undel_list_head = NULL;
+
+   for(j=array_size;j>=1;j--) {
+       head->ptr_table[j-1] = (DL_Node*)malloc(sizeof(DL_Node));
+       p = head->ptr_table[j-1];
+       p->index = j;
+
+       if(head->int_array[j-1]==head->deleted_value){
+          p->prev = NULL;
+          p->next = head->deleted_list_head;
+          head->deleted_list_head = p;
+          if(p->next){
+ 	     p->next->prev = p;
+          }
+       }
+       else{
+          p->prev = NULL;
+          p->next = head->undel_list_head;
+          head->undel_list_head = p;
+          if(p->next){
+ 	     p->next->prev = p;
+          }
+       }
+   }
+}
+
diff --git a/fmt/src/deleted_list_modify.c b/fmt/src/deleted_list_modify.c
new file mode 100644
index 0000000..f4b58cc
--- /dev/null
+++ b/fmt/src/deleted_list_modify.c
@@ -0,0 +1,99 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to keep two lists  deleted list and undeleted list)
+                 for better performance. This function is to modify a variable
+                 in an array and keep the two lists updated.
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "deleted_list.h"
+
+void deleted_list_modify_(void *deleted_list_header,
+                           int  *index,
+                           int  *new_value){
+   DLHead * head;
+   DL_Node * p;
+   int old_value;
+
+   head = *((DLHead**) deleted_list_header);
+
+   if(head){
+      old_value = head->int_array[*index-1];
+      head->int_array[*index-1]=*new_value;
+      p = head->ptr_table[*index-1];
+
+      if(old_value==head->deleted_value
+         && *new_value!=head->deleted_value){
+          if(p->prev){
+	     p->prev->next = p->next;
+          }
+          if(p->next){
+	     p->next->prev = p->prev;
+          }
+          if(head->deleted_list_head == p){
+	     head->deleted_list_head = p->next;
+          }
+
+          p->prev = NULL;
+          p->next = head->undel_list_head;
+          head->undel_list_head = p;
+          if(p->next){
+ 	      p->next->prev = p;
+          }
+      } 
+      else if(old_value!=head->deleted_value
+	      && *new_value==head->deleted_value){
+          if(p->prev){
+	     p->prev->next = p->next;
+          }
+          if(p->next){
+	     p->next->prev = p->prev;
+          }
+          if(head->undel_list_head == p){
+	     head->undel_list_head = p->next;
+          }
+
+          p->prev = NULL;
+          p->next = head->deleted_list_head;
+          head->deleted_list_head = p;
+          if(p->next){
+ 	      p->next->prev = p;
+          }
+      }
+   }
+}
+
diff --git a/fmt/src/emacs_keymap.h b/fmt/src/emacs_keymap.h
new file mode 100644
index 0000000..4be1940
--- /dev/null
+++ b/fmt/src/emacs_keymap.h
@@ -0,0 +1,474 @@
+/* emacs_keymap.c -- the keymap for emacs_mode in readline (). */
+
+/* Copyright (C) 1988,1989 Free Software Foundation, Inc.
+
+   This file is part of GNU Readline, a library for reading lines
+   of text with interactive input and history editing.
+
+   Readline is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 1, or (at your option) any
+   later version.
+
+   Readline is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Readline; see the file COPYING.  If not, write to the Free
+   Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <Python.h> /* make sure Python.h is first */
+
+#ifndef BUFSIZ
+#include <stdio.h>
+#endif /* BUFSIZ */
+
+#include <readline/readline.h>
+
+/* An array of function pointers, one for each possible key.
+   If the type byte is ISKMAP, then the pointer is the address of
+   a keymap. */
+
+KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
+
+  /* Control keys. */
+  { ISFUNC, (Function *)0x0 },		/* Control-@ */
+  { ISFUNC, rl_beg_of_line },		/* Control-a */
+  { ISFUNC, rl_backward },		/* Control-b */
+  { ISFUNC, (Function *)0x0 },		/* Control-c */
+  { ISFUNC, rl_delete },		/* Control-d */
+  { ISFUNC, rl_end_of_line },		/* Control-e */
+  { ISFUNC, rl_forward },		/* Control-f */
+  { ISFUNC, rl_abort },			/* Control-g */
+  { ISFUNC, rl_rubout },		/* Control-h */
+  { ISFUNC, rl_complete },		/* Control-i */
+  { ISFUNC, rl_newline },		/* Control-j */
+  { ISFUNC, rl_kill_line },		/* Control-k */
+  { ISFUNC, rl_clear_screen },		/* Control-l */
+  { ISFUNC, rl_newline },		/* Control-m */
+  { ISFUNC, rl_get_next_history },	/* Control-n */
+  { ISFUNC, (Function *)0x0 },		/* Control-o */
+  { ISFUNC, rl_get_previous_history },	/* Control-p */
+  { ISFUNC, rl_quoted_insert },		/* Control-q */
+  { ISFUNC, rl_reverse_search_history }, /* Control-r */
+  { ISFUNC, rl_forward_search_history }, /* Control-s */
+  { ISFUNC, rl_transpose_chars },	/* Control-t */
+  { ISFUNC, rl_unix_line_discard },	/* Control-u */
+  { ISFUNC, rl_quoted_insert },		/* Control-v */
+  { ISFUNC, rl_unix_word_rubout },	/* Control-w */
+  { ISKMAP, (Function *)emacs_ctlx_keymap },	/* Control-x */
+  { ISFUNC, rl_yank },			/* Control-y */
+  { ISFUNC, (Function *)0x0 },		/* Control-z */
+  { ISKMAP, (Function *)emacs_meta_keymap }, /* Control-[ */
+  { ISFUNC, (Function *)0x0 },		/* Control-\ */
+  { ISFUNC, (Function *)0x0 },		/* Control-] */
+  { ISFUNC, (Function *)0x0 },		/* Control-^ */
+  { ISFUNC, rl_undo_command },		/* Control-_ */
+
+  /* The start of printing characters. */
+  { ISFUNC, rl_insert },	/* SPACE */
+  { ISFUNC, rl_insert },	/* ! */
+  { ISFUNC, rl_insert },	/* " */
+  { ISFUNC, rl_insert },	/* # */
+  { ISFUNC, rl_insert },	/* $ */
+  { ISFUNC, rl_insert },	/* % */
+  { ISFUNC, rl_insert },	/* & */
+  { ISFUNC, rl_insert },	/* ' */
+  { ISFUNC, rl_insert },	/* ( */
+  { ISFUNC, rl_insert },	/* ) */
+  { ISFUNC, rl_insert },	/* * */
+  { ISFUNC, rl_insert },	/* + */
+  { ISFUNC, rl_insert },	/* , */
+  { ISFUNC, rl_insert },	/* - */
+  { ISFUNC, rl_insert },	/* . */
+  { ISFUNC, rl_insert },	/* / */
+
+  /* Regular digits. */
+  { ISFUNC, rl_insert },	/* 0 */
+  { ISFUNC, rl_insert },	/* 1 */
+  { ISFUNC, rl_insert },	/* 2 */
+  { ISFUNC, rl_insert },	/* 3 */
+  { ISFUNC, rl_insert },	/* 4 */
+  { ISFUNC, rl_insert },	/* 5 */
+  { ISFUNC, rl_insert },	/* 6 */
+  { ISFUNC, rl_insert },	/* 7 */
+  { ISFUNC, rl_insert },	/* 8 */
+  { ISFUNC, rl_insert },	/* 9 */
+
+  /* A little more punctuation. */
+  { ISFUNC, rl_insert },	/* : */
+  { ISFUNC, rl_insert },	/* ; */
+  { ISFUNC, rl_insert },	/* < */
+  { ISFUNC, rl_insert },	/* = */
+  { ISFUNC, rl_insert },	/* > */
+  { ISFUNC, rl_insert },	/* ? */
+  { ISFUNC, rl_insert },	/* @ */
+
+  /* Uppercase alphabet. */
+  { ISFUNC, rl_insert },	/* A */
+  { ISFUNC, rl_insert },	/* B */
+  { ISFUNC, rl_insert },	/* C */
+  { ISFUNC, rl_insert },	/* D */
+  { ISFUNC, rl_insert },	/* E */
+  { ISFUNC, rl_insert },	/* F */
+  { ISFUNC, rl_insert },	/* G */
+  { ISFUNC, rl_insert },	/* H */
+  { ISFUNC, rl_insert },	/* I */
+  { ISFUNC, rl_insert },	/* J */
+  { ISFUNC, rl_insert },	/* K */
+  { ISFUNC, rl_insert },	/* L */
+  { ISFUNC, rl_insert },	/* M */
+  { ISFUNC, rl_insert },	/* N */
+  { ISFUNC, rl_insert },	/* O */
+  { ISFUNC, rl_insert },	/* P */
+  { ISFUNC, rl_insert },	/* Q */
+  { ISFUNC, rl_insert },	/* R */
+  { ISFUNC, rl_insert },	/* S */
+  { ISFUNC, rl_insert },	/* T */
+  { ISFUNC, rl_insert },	/* U */
+  { ISFUNC, rl_insert },	/* V */
+  { ISFUNC, rl_insert },	/* W */
+  { ISFUNC, rl_insert },	/* X */
+  { ISFUNC, rl_insert },	/* Y */
+  { ISFUNC, rl_insert },	/* Z */
+
+  /* Some more punctuation. */
+  { ISFUNC, rl_insert },	/* [ */
+  { ISFUNC, rl_insert },	/* \ */
+  { ISFUNC, rl_insert },	/* ] */
+  { ISFUNC, rl_insert },	/* ^ */
+  { ISFUNC, rl_insert },	/* _ */
+  { ISFUNC, rl_insert },	/* ` */
+
+  /* Lowercase alphabet. */
+  { ISFUNC, rl_insert },	/* a */
+  { ISFUNC, rl_insert },	/* b */
+  { ISFUNC, rl_insert },	/* c */
+  { ISFUNC, rl_insert },	/* d */
+  { ISFUNC, rl_insert },	/* e */
+  { ISFUNC, rl_insert },	/* f */
+  { ISFUNC, rl_insert },	/* g */
+  { ISFUNC, rl_insert },	/* h */
+  { ISFUNC, rl_insert },	/* i */
+  { ISFUNC, rl_insert },	/* j */
+  { ISFUNC, rl_insert },	/* k */
+  { ISFUNC, rl_insert },	/* l */
+  { ISFUNC, rl_insert },	/* m */
+  { ISFUNC, rl_insert },	/* n */
+  { ISFUNC, rl_insert },	/* o */
+  { ISFUNC, rl_insert },	/* p */
+  { ISFUNC, rl_insert },	/* q */
+  { ISFUNC, rl_insert },	/* r */
+  { ISFUNC, rl_insert },	/* s */
+  { ISFUNC, rl_insert },	/* t */
+  { ISFUNC, rl_insert },	/* u */
+  { ISFUNC, rl_insert },	/* v */
+  { ISFUNC, rl_insert },	/* w */
+  { ISFUNC, rl_insert },	/* x */
+  { ISFUNC, rl_insert },	/* y */
+  { ISFUNC, rl_insert },	/* z */
+
+  /* Final punctuation. */
+  { ISFUNC, rl_insert },	/* { */
+  { ISFUNC, rl_insert },	/* | */
+  { ISFUNC, rl_insert },	/* } */
+  { ISFUNC, rl_insert },	/* ~ */
+  { ISFUNC, rl_rubout }		/* RUBOUT */
+};
+
+KEYMAP_ENTRY_ARRAY emacs_meta_keymap = {
+
+  /* Meta keys.  Just like above, but the high bit is set. */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-@ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-a */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-b */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-c */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-d */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-e */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-f */
+  { ISFUNC, rl_abort },		/* Meta-Control-g */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-h */
+  { ISFUNC, rl_tab_insert },	/* Meta-Control-i */
+  { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-j */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-k */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-l */
+  { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-m */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-n */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-o */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-p */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-q */
+  { ISFUNC, rl_revert_line },	/* Meta-Control-r */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-s */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-t */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-u */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-v */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-w */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-x */
+  { ISFUNC, rl_yank_nth_arg },	/* Meta-Control-y */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-z */
+
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-[ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-\ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-] */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-^ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-Control-_ */
+
+  /* The start of printing characters. */
+  { ISFUNC, (Function *)0x0 },	/* Meta-SPACE */
+  { ISFUNC, (Function *)0x0 },	/* Meta-! */
+  { ISFUNC, (Function *)0x0 },	/* Meta-" */
+  { ISFUNC, (Function *)0x0 },	/* Meta-# */
+  { ISFUNC, (Function *)0x0 },	/* Meta-$ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-% */
+  { ISFUNC, (Function *)0x0 },	/* Meta-& */
+  { ISFUNC, (Function *)0x0 },	/* Meta-' */
+  { ISFUNC, (Function *)0x0 },	/* Meta-( */
+  { ISFUNC, (Function *)0x0 },	/* Meta-) */
+  { ISFUNC, (Function *)0x0 },	/* Meta-* */
+  { ISFUNC, (Function *)0x0 },	/* Meta-+ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-, */
+  { ISFUNC, rl_digit_argument }, /* Meta-- */
+  { ISFUNC, (Function *)0x0 },	/* Meta-. */
+  { ISFUNC, (Function *)0x0 },	/* Meta-/ */
+
+  /* Regular digits. */
+  { ISFUNC, rl_digit_argument }, /* Meta-0 */
+  { ISFUNC, rl_digit_argument }, /* Meta-1 */
+  { ISFUNC, rl_digit_argument }, /* Meta-2 */
+  { ISFUNC, rl_digit_argument }, /* Meta-3 */
+  { ISFUNC, rl_digit_argument }, /* Meta-4 */
+  { ISFUNC, rl_digit_argument }, /* Meta-5 */
+  { ISFUNC, rl_digit_argument }, /* Meta-6 */
+  { ISFUNC, rl_digit_argument }, /* Meta-7 */
+  { ISFUNC, rl_digit_argument }, /* Meta-8 */
+  { ISFUNC, rl_digit_argument }, /* Meta-9 */
+
+  /* A little more punctuation. */
+  { ISFUNC, (Function *)0x0 },		/* Meta-: */
+  { ISFUNC, (Function *)0x0 },		/* Meta-; */
+  { ISFUNC, rl_beginning_of_history },	/* Meta-< */
+  { ISFUNC, (Function *)0x0 },		/* Meta-= */
+  { ISFUNC, rl_end_of_history },	/* Meta-> */
+  { ISFUNC, rl_possible_completions },	/* Meta-? */
+  { ISFUNC, (Function *)0x0 },		/* Meta-@ */
+
+  /* Uppercase alphabet. */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-A */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-B */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-C */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-D */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-E */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-F */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-G */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-H */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-I */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-J */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-K */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-L */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-M */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-N */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-O */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-P */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-Q */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-R */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-S */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-T */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-U */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-V */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-W */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-X */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-Y */
+  { ISFUNC, rl_do_lowercase_version },	/* Meta-Z */
+
+  /* Some more punctuation. */
+  { ISFUNC, rl_arrow_keys },	/* Meta-[ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-\ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-] */
+  { ISFUNC, (Function *)0x0 },	/* Meta-^ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-_ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-` */
+
+  /* Lowercase alphabet. */
+  { ISFUNC, (Function *)0x0 },	/* Meta-a */
+  { ISFUNC, rl_backward_word },	/* Meta-b */
+  { ISFUNC, rl_capitalize_word }, /* Meta-c */
+  { ISFUNC, rl_kill_word },	/* Meta-d */
+  { ISFUNC, (Function *)0x0 },	/* Meta-e */
+  { ISFUNC, rl_forward_word },	/* Meta-f */
+  { ISFUNC, (Function *)0x0 },	/* Meta-g */
+  { ISFUNC, (Function *)0x0 },	/* Meta-h */
+  { ISFUNC, (Function *)0x0 },	/* Meta-i */
+  { ISFUNC, (Function *)0x0 },	/* Meta-j */
+  { ISFUNC, (Function *)0x0 },	/* Meta-k */
+  { ISFUNC, rl_downcase_word },	/* Meta-l */
+  { ISFUNC, (Function *)0x0 },	/* Meta-m */
+  { ISFUNC, (Function *)0x0 },	/* Meta-n */
+  { ISFUNC, rl_arrow_keys },	/* Meta-o */
+  { ISFUNC, (Function *)0x0 },	/* Meta-p */
+  { ISFUNC, (Function *)0x0 },	/* Meta-q */
+  { ISFUNC, rl_revert_line },	/* Meta-r */
+  { ISFUNC, (Function *)0x0 },	/* Meta-s */
+  { ISFUNC, rl_transpose_words }, /* Meta-t */
+  { ISFUNC, rl_upcase_word },	/* Meta-u */
+  { ISFUNC, (Function *)0x0 },	/* Meta-v */
+  { ISFUNC, (Function *)0x0 },	/* Meta-w */
+  { ISFUNC, (Function *)0x0 },	/* Meta-x */
+  { ISFUNC, rl_yank_pop },	/* Meta-y */
+  { ISFUNC, (Function *)0x0 },	/* Meta-z */
+
+  /* Final punctuation. */
+  { ISFUNC, (Function *)0x0 },	/* Meta-{ */
+  { ISFUNC, (Function *)0x0 },	/* Meta-| */
+  { ISFUNC, (Function *)0x0 },	/* Meta-} */
+  { ISFUNC, (Function *)0x0 },	/* Meta-~ */
+  { ISFUNC, rl_backward_kill_word } /* Meta-rubout */
+};
+
+KEYMAP_ENTRY_ARRAY emacs_ctlx_keymap = {
+
+  /* Control keys. */
+  { ISFUNC, (Function *)0x0 },		/* Control-@ */
+  { ISFUNC, (Function *)0x0 },		/* Control-a */
+  { ISFUNC, (Function *)0x0 },		/* Control-b */
+  { ISFUNC, (Function *)0x0 },		/* Control-c */
+  { ISFUNC, (Function *)0x0 },		/* Control-d */
+  { ISFUNC, (Function *)0x0 },		/* Control-e */
+  { ISFUNC, (Function *)0x0 },		/* Control-f */
+  { ISFUNC, rl_abort },			/* Control-g */
+  { ISFUNC, (Function *)0x0 },		/* Control-h */
+  { ISFUNC, (Function *)0x0 },		/* Control-i */
+  { ISFUNC, (Function *)0x0 },		/* Control-j */
+  { ISFUNC, (Function *)0x0 },		/* Control-k */
+  { ISFUNC, (Function *)0x0 },		/* Control-l */
+  { ISFUNC, (Function *)0x0 },		/* Control-m */
+  { ISFUNC, (Function *)0x0 },		/* Control-n */
+  { ISFUNC, (Function *)0x0 },		/* Control-o */
+  { ISFUNC, (Function *)0x0 },		/* Control-p */
+  { ISFUNC, (Function *)0x0 },		/* Control-q */
+  { ISFUNC, rl_re_read_init_file },	/* Control-r */
+  { ISFUNC, (Function *)0x0 },		/* Control-s */
+  { ISFUNC, (Function *)0x0 },		/* Control-t */
+  { ISFUNC, rl_undo_command },		/* Control-u */
+  { ISFUNC, (Function *)0x0 },		/* Control-v */
+  { ISFUNC, (Function *)0x0 },		/* Control-w */
+  { ISFUNC, (Function *)0x0 },		/* Control-x */
+  { ISFUNC, (Function *)0x0 },		/* Control-y */
+  { ISFUNC, (Function *)0x0 },		/* Control-z */
+  { ISFUNC, (Function *)0x0 },		/* Control-[ */
+  { ISFUNC, (Function *)0x0 },		/* Control-\ */
+  { ISFUNC, (Function *)0x0 },		/* Control-] */
+  { ISFUNC, (Function *)0x0 },		/* Control-^ */
+  { ISFUNC, (Function *)0x0 },		/* Control-_ */
+
+  /* The start of printing characters. */
+  { ISFUNC, (Function *)0x0 },		/* SPACE */
+  { ISFUNC, (Function *)0x0 },		/* ! */
+  { ISFUNC, (Function *)0x0 },		/* " */
+  { ISFUNC, (Function *)0x0 },		/* # */
+  { ISFUNC, (Function *)0x0 },		/* $ */
+  { ISFUNC, (Function *)0x0 },		/* % */
+  { ISFUNC, (Function *)0x0 },		/* & */
+  { ISFUNC, (Function *)0x0 },		/* ' */
+  { ISFUNC, rl_start_kbd_macro },	/* ( */
+  { ISFUNC, rl_end_kbd_macro  },	/* ) */
+  { ISFUNC, (Function *)0x0 },		/* * */
+  { ISFUNC, (Function *)0x0 },		/* + */
+  { ISFUNC, (Function *)0x0 },		/* , */
+  { ISFUNC, (Function *)0x0 },		/* - */
+  { ISFUNC, (Function *)0x0 },		/* . */
+  { ISFUNC, (Function *)0x0 },		/* / */
+
+  /* Regular digits. */
+  { ISFUNC, (Function *)0x0 },		/* 0 */
+  { ISFUNC, (Function *)0x0 },		/* 1 */
+  { ISFUNC, (Function *)0x0 },		/* 2 */
+  { ISFUNC, (Function *)0x0 },		/* 3 */
+  { ISFUNC, (Function *)0x0 },		/* 4 */
+  { ISFUNC, (Function *)0x0 },		/* 5 */
+  { ISFUNC, (Function *)0x0 },		/* 6 */
+  { ISFUNC, (Function *)0x0 },		/* 7 */
+  { ISFUNC, (Function *)0x0 },		/* 8 */
+  { ISFUNC, (Function *)0x0 },		/* 9 */
+
+  /* A little more punctuation. */
+  { ISFUNC, (Function *)0x0 },	/* : */
+  { ISFUNC, (Function *)0x0 },	/* ; */
+  { ISFUNC, (Function *)0x0 },	/* < */
+  { ISFUNC, (Function *)0x0 },	/* = */
+  { ISFUNC, (Function *)0x0 },	/* > */
+  { ISFUNC, (Function *)0x0 },	/* ? */
+  { ISFUNC, (Function *)0x0 },	/* @ */
+
+  /* Uppercase alphabet. */
+  { ISFUNC, rl_do_lowercase_version },	/* A */
+  { ISFUNC, rl_do_lowercase_version },	/* B */
+  { ISFUNC, rl_do_lowercase_version },	/* C */
+  { ISFUNC, rl_do_lowercase_version },	/* D */
+  { ISFUNC, rl_do_lowercase_version },	/* E */
+  { ISFUNC, rl_do_lowercase_version },	/* F */
+  { ISFUNC, rl_do_lowercase_version },	/* G */
+  { ISFUNC, rl_do_lowercase_version },	/* H */
+  { ISFUNC, rl_do_lowercase_version },	/* I */
+  { ISFUNC, rl_do_lowercase_version },	/* J */
+  { ISFUNC, rl_do_lowercase_version },	/* K */
+  { ISFUNC, rl_do_lowercase_version },	/* L */
+  { ISFUNC, rl_do_lowercase_version },	/* M */
+  { ISFUNC, rl_do_lowercase_version },	/* N */
+  { ISFUNC, rl_do_lowercase_version },	/* O */
+  { ISFUNC, rl_do_lowercase_version },	/* P */
+  { ISFUNC, rl_do_lowercase_version },	/* Q */
+  { ISFUNC, rl_do_lowercase_version },	/* R */
+  { ISFUNC, rl_do_lowercase_version },	/* S */
+  { ISFUNC, rl_do_lowercase_version },	/* T */
+  { ISFUNC, rl_do_lowercase_version },	/* U */
+  { ISFUNC, rl_do_lowercase_version },	/* V */
+  { ISFUNC, rl_do_lowercase_version },	/* W */
+  { ISFUNC, rl_do_lowercase_version },	/* X */
+  { ISFUNC, rl_do_lowercase_version },	/* Y */
+  { ISFUNC, rl_do_lowercase_version },	/* Z */
+
+  /* Some more punctuation. */
+  { ISFUNC, (Function *)0x0 },		/* [ */
+  { ISFUNC, (Function *)0x0 },		/* \ */
+  { ISFUNC, (Function *)0x0 },		/* ] */
+  { ISFUNC, (Function *)0x0 },		/* ^ */
+  { ISFUNC, (Function *)0x0 },		/* _ */
+  { ISFUNC, (Function *)0x0 },		/* ` */
+
+  /* Lowercase alphabet. */
+  { ISFUNC, (Function *)0x0 },		/* a */
+  { ISFUNC, (Function *)0x0 },		/* b */
+  { ISFUNC, (Function *)0x0 },		/* c */
+  { ISFUNC, (Function *)0x0 },		/* d */
+  { ISFUNC, rl_call_last_kbd_macro },	/* e */
+  { ISFUNC, (Function *)0x0 },		/* f */
+  { ISFUNC, (Function *)0x0 },		/* g */
+  { ISFUNC, (Function *)0x0 },		/* h */
+  { ISFUNC, (Function *)0x0 },		/* i */
+  { ISFUNC, (Function *)0x0 },		/* j */
+  { ISFUNC, (Function *)0x0 },		/* k */
+  { ISFUNC, (Function *)0x0 },		/* l */
+  { ISFUNC, (Function *)0x0 },		/* m */
+  { ISFUNC, (Function *)0x0 },		/* n */
+  { ISFUNC, (Function *)0x0 },		/* o */
+  { ISFUNC, (Function *)0x0 },		/* p */
+  { ISFUNC, (Function *)0x0 },		/* q */
+  { ISFUNC, (Function *)0x0 },		/* r */
+  { ISFUNC, (Function *)0x0 },		/* s */
+  { ISFUNC, (Function *)0x0 },		/* t */
+  { ISFUNC, (Function *)0x0 },		/* u */
+  { ISFUNC, (Function *)0x0 },		/* v */
+  { ISFUNC, (Function *)0x0 },		/* w */
+  { ISFUNC, (Function *)0x0 },		/* x */
+  { ISFUNC, (Function *)0x0 },		/* y */
+  { ISFUNC, (Function *)0x0 },		/* z */
+
+  /* Final punctuation. */
+  { ISFUNC, (Function *)0x0 },		/* { */
+  { ISFUNC, (Function *)0x0 },		/* | */
+  { ISFUNC, (Function *)0x0 },		/* } */
+  { ISFUNC, (Function *)0x0 },		/* ~ */
+  { ISFUNC, rl_backward_kill_line }	/* RUBOUT */
+};
diff --git a/fmt/src/encode_strings_data.F b/fmt/src/encode_strings_data.F
new file mode 100644
index 0000000..aeb964c
--- /dev/null
+++ b/fmt/src/encode_strings_data.F
@@ -0,0 +1,106 @@
+	BLOCK DATA ENCODE_STRINGS_DATA
+
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 11/2009
+
+
+	INCLUDE 'encode_strings.cmn'
+
+* Reserved chars to encode
+
+	DATA reschar(1)  /'!'/
+	DATA reschar(2)  / '*'/
+	DATA reschar(3)  / '"'/
+	DATA reschar(4)  / ''''/
+	DATA reschar(5)  / '('/
+	DATA reschar(6)  / ')'/
+	DATA reschar(7)  / ';'/
+	DATA reschar(8)  / ':'/
+	DATA reschar(9)  / '@'/
+	DATA reschar(10) / '&'/
+	DATA reschar(11) / '+'/
+	DATA reschar(12) / '$'/
+	DATA reschar(13) / ','/
+	DATA reschar(14) / ','/
+	DATA reschar(15) / '?'/
+	DATA reschar(16) / '%'/
+	DATA reschar(17) / '#'/
+	DATA reschar(18) / '['/
+	DATA reschar(19) / ']'/
+	DATA reschar(20) / ' '/
+	DATA reschar(21) / '{'/
+	DATA reschar(22) / '}'/
+	DATA reschar(23) / '='/
+	DATA reschar(24) / '`'/
+	
+
+** examples break when I encode a /
+**	DATA reschar(14) / '/'/
+**	DATA subencode(14) /'%2F'/
+
+* The corresponding encoding
+	DATA subencode(1)  /'%21'/
+	DATA subencode(2)  /'%2A'/
+	DATA subencode(3)  /'%22'/
+	DATA subencode(4)  /'%27'/
+	DATA subencode(5)  /'%28'/
+	DATA subencode(6)  /'%29'/
+	DATA subencode(7)  /'%3B'/
+	DATA subencode(8)  /'%3A'/
+	DATA subencode(9)  /'%40'/
+	DATA subencode(10) /'%26'/
+	DATA subencode(11) /'%2B'/
+	DATA subencode(12) /'%24'/
+	DATA subencode(13) /'%2C'/
+	DATA subencode(14) /'%2C'/
+	DATA subencode(15) /'%3F'/
+	DATA subencode(16) /'%25'/
+	DATA subencode(17) /'%23'/
+	DATA subencode(18) /'%5B'/
+	DATA subencode(19) /'%5D'/
+	DATA subencode(20) /'%20'/
+	DATA subencode(21) /'%7B'/
+	DATA subencode(22) /'%7D'/
+	DATA subencode(23) /'%3D'/
+	DATA subencode(24) /'%60'/
+
+	DATA nsubencode /nencode*3/
+
+	END
diff --git a/fmt/src/ez_delimited_read.c b/fmt/src/ez_delimited_read.c
new file mode 100644
index 0000000..0db91ec
--- /dev/null
+++ b/fmt/src/ez_delimited_read.c
@@ -0,0 +1,786 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL
+,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+/* Revision history
+   V530 - *sh* added ability to read dates formatted as YYYYMMDD
+   V540 *sh* 10/01 - when analyzing a file insist on ENUF_IN_A_ROW records
+                     successfully evaluated
+   v542 *kob* 10/02 - fix up FTYP_DATE and FTYP_EURODATE so that it can
+                      handle four digit years.  Also allow date in euro
+		      format yyyyddmm to be acceptable
+   v600 *acm* 4/06   change call to days_from_day0 in DecodeRec becaues of
+                     problems with 64-bit build
+ *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+					 definition of macro DFTYPE in ferretmacros.h.
+ *acm*  5/13      - ticket 2066: For double-precision Ferret reading numeric data,
+                    sscanf needs %lf instead of %f, and dummy needs to be double prec.
+*/
+
+
+
+/*
+  Code to perform tab, comma, etc delimited reads from Ferret
+  Top level Routines are
+  anal_file_ - determines the number of fields and types of each field
+  decode_file_ - reads an entire file based upon analysis suppied
+
+  Support routines are
+  analRec  - performs analysis of a single record
+            ... possibly with missing fields
+  decodeRec - reads a single record of the input file
+  nexstrtok - breaks input into successive fields
+ */
+
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "ferretmacros.h"
+#include "ez_delimited_read.h"
+
+
+/*
+ *
+ decode_file - skip header & read an entire file based upon analysis suppied
+ decode_file_ arguments
+ fname - input filename (null terminated)
+ recptr - buffer to hold file records
+ reclen - size of record buffer
+ delims - string containing delimiter in file (note that blank is
+          considered a special delimiter representing any number of blanks)
+ skip - number of heading record in file to be skipped
+ maxrec - maximum number of records to read (beyond skipped header)
+ nrec - out number of records actually read
+ nfields - number of fields to decode on each record
+ field_types - type of each field (input)
+ mrlist - list of integers pointing to Ferret memory blocks
+ memptr - pointer to base of Ferret "heap" storage
+ mr_blk1 - memory chunk numbers indexed by mr_list
+ mblk_size - chunk size within Ferret heap
+ mr_bad_flags - missing value flags indexed by mr_list
+ *
+ */
+
+
+void FORTRAN(decode_file_jacket)
+		( char* fname, char *recptr, char *delims, int *skip,
+		  int* maxrec, int* reclen, int* nfields,
+		  int field_type[], int* nrec,
+		  int mrlist[], DFTYPE *memptr, int mr_blk1[], int* mblk_size,
+		  DFTYPE mr_bad_flags[], char ***mr_c_ptr)
+
+{
+
+  DFTYPE **numeric_fields  = (DFTYPE **) malloc(sizeof(DFTYPE*) * (*nfields));
+  DFTYPE *bad_flags        = (DFTYPE *)  malloc(sizeof(DFTYPE) * (*nfields));
+
+  char ***text_fields     = (char ***) malloc(sizeof(char**) * (*nfields));
+  int i, mr;
+  int pinc = 8/sizeof(char*);  /* pointers spaced 8 bytes apart */
+
+  for (i=0; i<(*nfields); i++)
+    {
+      mr = mrlist[i] - 1;  /* -1 for C indexing */
+      /* 
+	 compute separate pointer arrays for numeric and text fields
+      */
+
+      numeric_fields[i] = (DFTYPE *) NULL;
+      text_fields[i] = (char**) NULL;
+      
+      if (field_type[i] == FTYP_CHARACTER )
+	{
+	  /* *kob* make sure were using size of real*4 float */
+	  text_fields[i] = (char**) (memptr + ((mr_blk1[mr]-1)*(*mblk_size)*4)/sizeof(float));
+	  mr_c_ptr[mr*pinc] = text_fields[i];
+	}
+      else if (field_type[i] != FTYP_MISSING )
+	{
+	  numeric_fields[i] = memptr + (mr_blk1[mr]-1)*(*mblk_size);
+	  mr_c_ptr[mr*pinc] = (char**) NULL;
+	}
+      /*
+	isolate the bad data flags that correspond to the numeric fields
+      */
+      if ( (field_type[i]!=FTYP_MISSING) && (field_type[i]!=FTYP_CHARACTER) )
+	bad_flags[i] = mr_bad_flags[mr];
+      else
+	bad_flags[i] = 0.0;
+    }
+
+  /*
+    at last we actually read the file
+  */
+  decode_file (fname, recptr, delims, skip, 
+	       maxrec, reclen, nfields,
+	       field_type, nrec,
+	       numeric_fields, text_fields, bad_flags);
+
+  free(numeric_fields);
+  free(text_fields);
+  free(bad_flags);
+
+  return;
+}
+
+
+/*
+ *
+ decode_file - skip header & read an entire file based upon analysis suppied
+ decode_file_ arguments
+ fname - input filena0me
+ recptr - buffer to hold file records
+ reclen - size of record buffer
+ delims - string containing delimiter in file (note that blank is
+          considered a special delimiter representing any number of blanks)
+ skip - number of heading record in file to be skipped
+ maxrec - maximum number of records to read (beyond skipped header)
+ nrec - out number of records actually read
+ nfields - number of fields to decode on each record
+ field_types - type of each field (input)
+ numeric_fields - array to be filled with numeric field values
+                (2D - # of vareiables by # of records to read)
+ bad_flags - missing value flags (used for numeric fields, only) 
+ text_fields - array to be filled with string pointers
+ (2D - # of vareiables by # of records to read)
+ *
+ */
+
+
+int decode_file (char* fname, char *recptr, char *delims, int *skip, 
+			  int* maxrec, int* reclen, int* nfields,
+			  int field_type[], int* nrec, DFTYPE** numeric_fields,
+			  char*** text_fields, DFTYPE bad_flags[])
+
+{
+
+  FILE *fp;
+  int slen, i;
+  int pinc = 8/sizeof(char*);  /* pointers spaced 8 bytes apart */
+
+  *nrec = 0;
+
+  fp = fopen(fname,"r");
+
+  /* skip initial records */
+  for (i=0; i<*skip; i++)
+    {  
+      if ( fgets(recptr,*reclen,fp) == NULL )
+        break;
+    }
+
+  while (!feof(fp) && (*nrec)<(*maxrec))
+    {
+
+      if ( fgets(recptr,*reclen,fp) )
+	{
+	  /* skip leading blanks */
+	  while (*recptr==' ')
+	    recptr++;
+
+	  /* overwrite the newline record terminator with a NULL */
+	  if ((slen = strlen(recptr)) > 0)
+	    if (recptr[slen-1] == '\n')
+	      recptr[slen-1] = '\0';
+	  
+	  decodeRec(recptr, delims, nfields, field_type, *nrec,
+		    numeric_fields, text_fields, bad_flags);
+
+#ifdef diagnostic_output	  /* ************* */
+	  for (i=0; i<(*nfields); i++)
+	    if (field_type[i] == FTYP_CHARACTER )
+	      printf( "%d character: %s\n",i, (*(text_fields+i))[(*nrec)*pinc] );
+	    else if (field_type[i] != FTYP_MISSING)
+	      printf( "%d numeric: %f\n",i,(*(numeric_fields+i))[(*nrec)] );
+#endif                            /* ************* */
+
+	  (*nrec)++;
+	}
+    }
+
+  fclose(fp);
+
+  return 0; /* always OK ? */
+
+}
+/*
+ *
+ anal_file_ - determine the number of fields and types of each field
+          - if an input record has missing fields (e.g. ",,") then keep looking
+	  - if subsequent records produce differing analyses of a field then
+	    flag it as a CHARACTER fields
+ anal_file_ arguments
+ fname - input filena0me
+ recptr - buffer to hold file records
+ reclen - size of record buffer
+ delims - string containing delimiter in file (note that blank is
+          considered a special delimiter representing any number of blanks)
+ skip - number of heading record in file to be skipped
+ maxrec - maximum number of records to read (beyond skipped header)
+ nfields - (output) number of fields determined to be in file
+ field_types - (output)type of each field
+ max_fields - (input) maximum number of fields to consider
+ *
+ */
+
+int FORTRAN(anal_file) (char* fname, char *recptr, char *delims, int* skip,
+			int* maxrec, int* reclen, int* nfields,
+			int field_type[], int *max_fields)     
+{
+
+#define ENUF_IN_A_ROW 25  /* insist on this many successful record evals */
+  FILE *fp;
+  int slen, i, rec;
+  int nsuccess = 0;
+
+  fp = fopen(fname,"r");
+
+  /* skip initial records */
+  for (rec=0; rec<*skip; rec++)
+    {  
+      if ( fgets(recptr,*reclen,fp) == NULL )
+        break;
+    }
+
+  /* initially set all field types to missing (no information) */
+  for (i=0; i<(*max_fields); i++)
+    field_type[i] = FTYP_MISSING;
+  *nfields = 0;
+
+  rec = 0;
+  while ( !feof(fp) && rec<(*maxrec) )
+    {
+      if ( fgets(recptr,*reclen,fp) )
+	{
+	  rec++;
+
+	  /* skip leading blanks */
+	  while (*recptr==' ')
+	    recptr++;
+
+	  /* overwrite the newline record terminator with a NULL */
+	  if ((slen = strlen(recptr)) > 0)
+	    recptr[slen-1] = '\0';
+	  
+	  analRec(recptr, delims, nfields, field_type, *max_fields);
+
+	  /* check for unknown field types */
+	  i = 0;
+	  while ( i<*nfields && (field_type[i] != FTYP_MISSING) )
+	    i++;
+
+	  /* success at analyzing one full record */
+	  if (i == *nfields)
+	    nsuccess++;
+	  else
+	    nsuccess = 0;
+
+	  /* success at analyzing 25 records in a row is enough */
+	  if (nsuccess > ENUF_IN_A_ROW)
+	    {
+	      fclose(fp);
+	      return 0;
+	    }
+	}
+    }
+
+  /*
+    all records in file have been analyzed
+  */
+  fclose(fp);
+
+  /* only an incomplete analysis of the file was possible
+     Note that following 10/01 changes it is no longer certain that the
+     analysis contains fields of all missing values. See ENUF_IN_A_ROW
+  */
+  return FANAL_HAS_MISSING;
+
+}
+
+/*
+ *
+ decodeRec - parse and return values from a record based upon analysis suppied
+ decodeRec arguments
+ recptr - buffer holding file record
+ delims - string containing delimiter in file (note that blank is
+          considered a special delimiter representing any number of blanks)
+ nfields - number of fields to decode on each record
+ field_types - type of each field (input)
+ rec - (input) current record number (points to location in output arrays)
+ numeric_fields - array to be filled with numeric field values
+                (2D - # of vareiables by # of records to read)
+ bad_flags - missing value flags (used for numeric fields, only) 
+ text_fields - array to be filled with string pointers
+ (2D - # of vareiables by # of records to read)
+ *
+ */
+
+int decodeRec(char *recptr, char *delims, int* nfields, int field_type[],
+	      int rec,
+	      DFTYPE** numeric_fields, char*** text_fields, DFTYPE bad_flags[])
+{
+
+  char *p, *pnext, str1[2], errstr[2];
+  double dummy;
+  DFTYPE rdum;
+
+  int idummy1, idummy2, idummy3, i;
+  char blankstr[] = " ";
+  double days_1900 = 59958230400.0 / (60.*60.*24.); 
+/*  int days_1900 = 693961;  */
+
+  int pinc = 8/sizeof(char*);  /* pointers spacd 8 bytes apart */
+  int slen;     /* kob 12/01 needed to check for numberical string ending in e/E */
+  p = recptr;
+
+  for (i=0; i<*nfields; i++) {
+    pnext = nexstrtok(p, delims);
+    if ( field_type[i] == FTYP_MISSING ) {
+      /* do nothing -- a skipped field */
+      ;
+    } else if (p==NULL || *p == '\0') {
+      /* missing data field */
+      if ( field_type[i] == FTYP_CHARACTER ) {
+	(*(text_fields+i))[rec*pinc] = (char *) malloc(sizeof(char)*2);
+	strcpy( (*(text_fields+i))[rec*pinc], blankstr );
+      }
+      else {
+	(*(numeric_fields+i))[rec] = bad_flags[i];
+      }
+
+    } else {
+      switch (field_type[i]) {
+	
+	/* latitude */
+      case FTYP_LAT:
+	if (sscanf(p,"%lf%1[Nn]%1s",&dummy,str1,errstr) == 2)
+	  (*(numeric_fields+i))[rec] = dummy;
+	else if (sscanf(p,"%lf%1[Ss]",&dummy,str1) == 2)
+	  (*(numeric_fields+i))[rec] = -1 * dummy;
+	else if ( sscanf(p,"%lf%1s",&dummy,errstr ) != 1)
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	else if (p[strlen(p)-1] == 'e' || p[strlen(p)-1] == 'E') 
+	    (*(numeric_fields+i))[rec] = bad_flags[i];
+	else 
+	    (*(numeric_fields+i))[rec] = dummy;
+	break;
+	
+	/* longitude */
+      case FTYP_LON:
+	if (sscanf(p,"%lf%[Ee]%1s",&dummy,str1,errstr) == 2)
+	  (*(numeric_fields+i))[rec] = dummy;
+	else if (sscanf(p,"%lf%1[Ww]",&dummy,str1) == 2)
+	  (*(numeric_fields+i))[rec] = -1 * dummy;
+	/* *kob* 12/01 - need to check for a sting ending in e or E and set
+	   it to dummy, as above.  osf and linux compiler let such a string through as 
+	   a valid number, rather than a longitude */
+	else if (p[strlen(p)-1] == 'e' || p[strlen(p)-1] == 'E') 
+	    (*(numeric_fields+i))[rec] = dummy;
+	else if ( sscanf(p,"%lf%1s",&dummy,errstr ) != 1)
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	else 
+	    (*(numeric_fields+i))[rec] = dummy;
+	break;
+	
+	/* date */
+      case FTYP_DATE:
+	if (sscanf(p,"%d/%d/%d%1s",
+		   &idummy1,&idummy2,&idummy3,errstr) == 3) {
+	   
+      /*printf("%d %d %d \n", idummy1,idummy2,idummy3); */
+	  /* need to check for 4 digit year - mm/dd/yyyy *kob* */
+	  if (idummy3 < 100) {
+	    if (idummy3 < 20)   /* will break after 2019 or before 1920 */
+	      idummy3 += 2000;
+	    else
+	      idummy3 += 1900;
+	  }
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy3,&idummy1,&idummy2,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum;
+
+	  /* force dates with dashes "-" to be in yyyy-mm-dd format *kob* */
+	} else if (sscanf(p,"%4d-%2d-%2d%1s",
+			  &idummy1,&idummy2,&idummy3,errstr) == 3) {
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy1,&idummy2,&idummy3,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum;
+	  }
+	else if ( (sscanf(p,"%4d%2d%2d%1s",&idummy1,&idummy2,&idummy3,str1)==3)
+	      && idummy1>0
+	      && idummy2>=1 && idummy2<=12
+	      && idummy3>=1 && idummy3<=31 ) {
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy1,&idummy2,&idummy3,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum;
+	  }
+	else
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	break;
+	
+	/* date */
+      case FTYP_EURODATE:
+	if (sscanf(p,"%d/%d/%d%1s",&idummy1,&idummy2,&idummy3,errstr) == 3) {
+	  /* need to check to see if idummy3 which contains the year is in 
+	     the form YY or YYYY     *kob*  10/02  */
+	  if (idummy3 < 100) { 
+	    if (idummy3 < 20)   /* will break after 2019 or before 1920 */
+	      idummy3 += 2000;
+	    else
+	      idummy3 += 1900;
+	  }
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy3,&idummy2,&idummy1,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum;
+	  /* force dates with dashes "-" to be in yyyy-mm-dd format *kob* */
+	} else if (sscanf(p,"%4d-%2d-%2d%1s",
+			  &idummy1,&idummy2,&idummy3,errstr) == 3) {
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy1,&idummy2,&idummy3,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum; }
+	/* add check for yyyyddmm euro date *kob* */
+	else if ( (sscanf(p,"%4d%2d%2d%1s",&idummy1,&idummy2,&idummy3,str1)==3)
+	      && idummy1>0
+	      && idummy3>=1 && idummy3<=12
+	      && idummy2>=1 && idummy2<=31 ) {
+	  (*(numeric_fields+i))[rec] =
+	    days_from_day0_(&days_1900,&idummy1,&idummy3,&idummy2,&rdum);
+	  (*(numeric_fields+i))[rec] = rdum; }
+	else
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	break;
+	
+	/* time */
+      case FTYP_TIME:
+	if (sscanf(p,"%d:%d:%lf%1s",&idummy1,&idummy2,&dummy,errstr) == 3)
+	  (*(numeric_fields+i))[rec] = idummy1 + idummy2/60. + dummy/3600.;
+	else if (sscanf(p,"%d:%d%1s",&idummy1,&idummy2,errstr) == 2)
+	  (*(numeric_fields+i))[rec] = idummy1 + idummy2/60.;
+	else
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	break;
+	
+	/* generic numeric field */
+      case FTYP_NUMERIC:
+	if ( sscanf(p,"%lf%1s",&dummy,errstr ) != 1)
+	  (*(numeric_fields+i))[rec] = bad_flags[i];
+	/* *kob* 12/01 - need to check for a sting ending in e or E
+	   osf and linux compiler let such a string through as 
+	   a valid number, rather than a longitude */
+	else {
+	  (*(numeric_fields+i))[rec] = dummy;
+	  slen = strlen(p);
+	  if (p[slen-1] == 'e' || p[slen-1] == 'E') 
+	    (*(numeric_fields+i))[rec] = bad_flags[i];  
+	}
+	break;
+	
+	/* character field */
+      case FTYP_CHARACTER:
+	{
+	  /* remove surrounding quotations, if any */
+	  if (strlen(p)>1 && *p=='"' && *(p+strlen(p)-1)=='"') {
+	    *(p+strlen(p)-1) = '\0';
+	    p++;
+	  }
+	  (*(text_fields+i))[rec*pinc] =
+	    (char *) malloc(sizeof(char)*(strlen(p)+1));
+	  strcpy( (*(text_fields+i))[rec*pinc], p );
+	}
+	break;
+	
+      default:
+	printf("internal error: unknown field type");
+      }
+    }
+
+    p = pnext;
+    }
+}
+
+/*
+ *
+ analRec - determine the number of fields and types of each field on one rec
+	  - if subsequent records produce differing analyses of a field then
+	    flag it as a CHARACTER fields
+ analRec_ arguments
+ recptr - buffer holding file record
+ delims - string containing delimiter in file (note that blank is
+          considered a special delimiter representing any number of blanks)
+ nfields - (output) number of fields determined to be in file
+ field_types - (output)type of each field
+ max_fields - (input) maximum number of fields to consider
+ *
+ */
+
+void analRec(char *recptr, char *delims, int* nfields, int field_type[],
+	    int max_fields)
+{
+
+  char *p, *pnext, pstart[256], str1[2], latlon1[2];
+  double dummy;
+
+  int idummy1, idummy2, idummy3, i, nfields_in;
+
+  p = recptr;
+  nfields_in = *nfields;
+  *nfields = 0;
+
+  /* if information is available about a field for the first time, apply it
+     if the analysis differs from a previous then call it a character field */
+  while (p  != NULL) {
+    pnext = nexstrtok(p, delims);
+    if (*p == '\0')
+      /* null field like 2 commas in a row */
+      {
+	/* retain previous information */
+      } 
+    else if (sscanf(p,"%d/%d/%d%1s",&idummy1,&idummy2,&idummy3,str1) == 3)
+      /* date as mm/dd/yy */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_DATE;
+	else if (field_type[(*nfields)] != FTYP_DATE)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%d-%d-%d%1s",&idummy1,&idummy2,&idummy3,str1) == 3)
+      /* date as yyyy-mm-dd */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_DATE;
+	else if (field_type[(*nfields)] != FTYP_DATE)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if ( (sscanf(p,"%4d%2d%2d%1s",&idummy1,&idummy2,&idummy3,str1) == 3)
+	      && idummy1>=1800 && idummy1<2100
+	      && idummy2>=1 && idummy2<=12
+	      && idummy3>=1 && idummy3<=31 )
+      /* date as yyyymmdd */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_DATE;
+	else if (field_type[(*nfields)] != FTYP_DATE)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%d:%d:%lf%1s",&idummy1,&idummy2,&dummy,str1) == 3)
+      /* time as hh:mm:ss.s */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_TIME;
+	else if (field_type[(*nfields)] != FTYP_TIME)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%d:%d%1s",&idummy1,&idummy2,str1) == 2)
+      /* time as hh:mm */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_TIME;
+	else if (field_type[(*nfields)] != FTYP_TIME)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%lf%1[NnSs]%1s",&dummy,latlon1,str1) == 2
+	     && dummy>-90.1 && dummy<90.1 )
+      /* latitude */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING
+	    || field_type[(*nfields)] == FTYP_NUMERIC)
+	  field_type[(*nfields)] = FTYP_LAT;
+	else if (field_type[(*nfields)] != FTYP_LAT)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if ((sscanf(p,"%lf%1[EeWw]%1s",&dummy,latlon1,str1) == 2) 
+	     || p[(strlen(p))-1] == 'E' || p[(strlen(p))-1] == 'E' )
+      /* need above check for strings such as 120E - which some 
+	 compilers pass through as valid floating point number 
+         kob v5.41 - 4/02 */
+      /* But, fixing bug 1700, check whether the rest of the field
+	  is numeric before calling this Longitude. (The string ZAIRE
+	  was being marked as Longitude) 
+         acm v6.31 - 10/09 */
+       /* longitude */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING
+	    || field_type[(*nfields)] == FTYP_NUMERIC)
+	  field_type[(*nfields)] = FTYP_LON;
+	else if (field_type[(*nfields)] != FTYP_LON)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+	  idummy1 = (strlen(p))-1;
+	  strncpy(pstart,p,idummy1 );
+	if (sscanf(pstart,"%lf",&dummy) != 1)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%lf%1s",&dummy,str1) == 2)
+      /* digits followed by trash -- not a legal numeric field*/
+      {
+	field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else if (sscanf(p,"%lf",&dummy) == 1)
+      /* numeric field */
+      /* note that pure numeric fields may be lats or longs */
+      {
+	if (field_type[(*nfields)] == FTYP_MISSING)
+	  field_type[(*nfields)] = FTYP_NUMERIC;
+	else if (field_type[(*nfields)] == FTYP_LAT
+		 && dummy>-90.1 && dummy<90.1 )
+	  field_type[(*nfields)] = FTYP_LAT;
+	else if (field_type[(*nfields)] == FTYP_LON)
+	  field_type[(*nfields)] = FTYP_LON;
+	else if (field_type[(*nfields)] != FTYP_NUMERIC)
+	  field_type[(*nfields)] = FTYP_CHARACTER;
+      }
+    else
+      /* any other text */
+      field_type[(*nfields)] = FTYP_CHARACTER;
+      
+#ifdef diagnostic_output	  /* ************* */
+    printf("%d %s:  %d\n", *nfields, p, field_type[(*nfields)]);
+#endif                            /* ************* */
+
+    if ( *nfields < max_fields )
+      {    
+	(*nfields)++;
+	p = pnext;
+      }
+    else
+      break;  /* cannot look at all of the fields */
+
+    }
+
+  /* if records have unequal length, return the longest found */
+  *nfields = *nfields > nfields_in ? *nfields : nfields_in;
+
+  return;
+}
+
+/*
+ *
+ *
+ */
+
+char *nexstrtok(char *s1, char *s2)
+
+     /*
+       like strtok but sensitive to multiple (non-white space) delimiters
+       as significant. For example, 2 commas together indicate a missing field.
+     */
+
+     /* note - this routine will modify the s1 string */
+{
+  char *p2, *nex;
+
+  /* sanity check that we have a valid input record */
+  if (s1 == NULL)
+    return NULL;
+
+  /* find the next delimiter */
+  p2 = strpbrk( s1, s2 );
+
+  if (p2 == NULL)
+    return NULL;
+  else
+    {
+      nex = p2 + 1;
+
+      /* skip trailing blanks in this field */
+      while (*(p2-1)==' ')
+	p2--;
+      *p2 = '\0';
+
+      /* Skip leading blanks in next field */
+      while (*nex==' ')
+	nex++;
+
+      return nex;
+    }
+}
+
+/*
+ *
+ save_delimited_info - allocate struct memoro and save special info needed
+                       for delimited file reads
+	nfields - number of fields (variables) in file
+	field_type - field types for each variable
+	delim - list of delimiters to use when reading the file
+	ptr - returned pointer to structure
+ *
+ */
+void FORTRAN(save_delimited_info) (int *nfields, int field_type[],
+				   char *delim, DelimFileInfo **ptr)
+{
+  DelimFileInfo *fi = (DelimFileInfo *) calloc(1, sizeof(DelimFileInfo));
+  int* _field_type  = (int *) malloc(sizeof(int) * (*nfields));
+  char* _delim      = (char *) malloc(sizeof(char) * (int)strlen(delim));
+  int i;
+
+  for (i=0; i<*nfields; i++)
+    _field_type[i] = field_type[i];
+
+  strcpy(_delim, delim);
+
+  fi->nfields = *nfields;
+  fi->fieldType = _field_type;
+  fi->delim = _delim;
+
+  *ptr = fi;
+  return;
+}
+
+void FORTRAN(get_delimited_info) (int *nfields, int field_type[],
+				   char *delim, DelimFileInfo **ptr)
+{
+
+  int i,iout;
+  DelimFileInfo *fi = *ptr;
+
+  *nfields = fi->nfields;
+  for (i=0; i<*nfields; i++)
+    field_type[i] = (fi->fieldType)[i];
+  strcpy(delim, fi->delim);
+  return;
+}
+
+void FORTRAN(delete_delimited_info) (DelimFileInfo **ptr)
+{
+  DelimFileInfo *fi = *ptr;
+  free(fi->fieldType);
+  free(fi->delim);
+  free(fi);
+  return;
+}
+
diff --git a/fmt/src/ez_init_dset.F b/fmt/src/ez_init_dset.F
new file mode 100644
index 0000000..f75a2e1
--- /dev/null
+++ b/fmt/src/ez_init_dset.F
@@ -0,0 +1,498 @@
+	SUBROUTINE EZ_INIT_DSET (filename,ezform,variables,types,
+     .				 delims,skip,columns,dset,status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Subroutine takes arguments from call and turns it into an entry in the dataset
+* and stepfile subroutines. This will allow access to ASCII and unformatted non-
+* TMAP data files. This sets up a bare bones entry. All other initialization
+* occurs with EZ_MOD_DSET and EZ_READ.
+*
+* revision 0.00 - 08/03/89
+* revision 1.00 - 08/11/89 - Removed calculations involving items that are not
+*			     included on SET DATA command to EZ_READ command.
+* revision 1.10 - 10/27/89 - *sh* added columns
+* revision 1.11 - 01/25/90 - *sh* changed the default format to "FREE"
+* Unix/RISC port 3/11/91 *sh*: filename parsing changed (and longer names)
+* note: also changed VMS version to save filename extension as well as name
+*       (to differentiate snoopy.lis from snoopy.dat)
+* rev 1.2 *sh* 7/92 - check for valid, non-duplicated variable names
+* rev 1.3 *sh* 11/92 - allow 24 character variable names
+* 3/12/93(4?) - lifted restriction on max number of columns
+* 12/94 - lifted restriction that # columns must be multiple of # variables
+*	  to accomodate /FORMAT=STREAM
+* *sh* 3/2/95 - informative messages issued through TM_NOTE (for GUI)
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V530 10/00 *sh* - added delimited reads
+* V540 10/01 *sh* - auto-analysis of delimited files to tag MISSING fields
+*		    as FLOAT -- makes the file more intelligible to the user
+*		  - auto-analysis sets units and titles
+*	          - bug fix: if vars_gvn that determines analyzed num_types
+*      *acm* 10/01 increase length of ds_name
+*      *acm* 10/01  remove VMS include statements
+* 1/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead
+* V552 5/03 *acm*: increase size of var_name to 128 chars
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V608 *acm* 10/07 Fixes for memory leak; when initializing dataset this
+*                  routine was putting vars from other datasets into the
+*                  linked-list structure.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+	CHARACTER*4	ez_rev
+	CHARACTER*1	tab
+	PARAMETER 	(ez_rev = '1.11')
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+*
+* Arguments:
+*	filename	- name of data file
+*	variables	- names of variables (and "-" for skipped variables)
+*	columns		- number of columns to read (or int4_init)
+*	dset		- (output) data set number
+*	status		- (output)
+*
+	CHARACTER*(*)	filename, ezform, variables, types, delims
+	INTEGER*4	skip, columns, dset, status
+*
+* Include files
+	include 'xio.cmn_text'
+        external xio_data
+	include 'ez_lib.parm'
+	include 'tmap_dims.parm'
+	include 'tmap_dtypes.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xez_info.cmn_text'
+	external xez_info_data
+        include 'netcdf.inc'
+
+*
+* Local definitions
+        LOGICAL         TM_LEGAL_NAME, vars_gvn, its_delimited
+	CHARACTER*24	type_names(maxezvars)
+	CHARACTER*128	var_names(maxezvars)
+	INTEGER*4	TM_LENSTR1, STR_SAME,
+     .			set_cnt, bpos, epos, ncnt, var_pos, num_names,
+     .			nvar, jcnt, stp_cnt, nstp, field_type(maxezvars),
+     .			num_types, i, j, name_limit, idummy(maxezvars),
+     .			l1, l2, ivar, vartype, coordvar, varid
+	CHARACTER	TM_STRING*13, TM_LEFINT*4, buff*48, 
+     .			line_buff*2048
+
+*
+* Assign data set number, exiting if maximum number of data sets are open
+	DO 100 set_cnt = 1,maxdsets
+	  IF (ds_name(set_cnt) .EQ. char_init1024) THEN
+	    dset = set_cnt
+	    ds_des_name(dset) = filename
+* Parse input line to obtain just filename without directory or extension
+            epos = LEN(filename)
+#ifdef unix
+* Unix: find final pathname slash
+            DO 77 bpos = epos, 1, -1
+ 77         IF ( filename(bpos:bpos) .EQ. PathSeparator ) GOTO 78
+            bpos = 0    ! no slash
+ 78         bpos = bpos + 1
+#else
+* VMS: find the "]" separating the directory from the filename
+	    bpos = INDEX(filename,']') + 1
+! changed 3/11/91	    epos = bpos + INDEX(filename(bpos:),'.') - 2
+#endif
+	    ds_name(dset) = filename(bpos:epos)
+	    GOTO 110
+	  ENDIF
+  100	CONTINUE
+* Too many data sets are open
+	GOTO 9000
+*
+* Load Format record
+  110   ds_type(dset)		= '  EZ'
+	ds_format(dset)		= '  1A'
+	ds_source_class(dset)	= ' '
+	ds_source(dset)		= ' '
+	ds_subsource(dset)	= ' '
+	ds_prog_rev(dset)	= ez_rev
+*
+* Load Background record
+	WRITE (ds_expnum(dset),'(A2,I2.2)') 'EZ',dset
+	ds_modnum(dset)		= ' '
+	ds_title(dset)		= ' '
+	ds_mod_title(dset)	= ' '
+	ds_forcing_set(dset)	= ' '
+	ds_t0time(dset)		= ' '
+	ds_ntegrate_tstep(dset)	= 1
+	ds_time_run(dset)	= ' '
+	DO 120 ncnt = 1,num_aux
+  120	ds_aux_modnum(ncnt,dset)= ' '
+	ds_parm_name(1,dset)	= 'FORMAT'
+	ds_parm_text(1,dset)	= 'FREE'
+	DO 130 ncnt = 2,num_parm
+	  ds_parm_name(ncnt,dset)	= ' '
+	  ds_parm_text(ncnt,dset)	= ' '
+  130	CONTINUE
+*
+* time axis
+	ds_time_axis(dset) = unspecified_int4
+*
+* Load message record
+	ds_alert_on_open(dset) 	= .FALSE.
+	ds_alert_on_output(dset)= .FALSE.
+	ds_message(dset)	= ' '
+
+* much needed flag for delimited files
+	its_delimited = ezform(1:4) .EQ. 'DELI'
+	IF (its_delimited) THEN
+	   name_limit = maxezvars
+	ELSE
+	   name_limit = maxezfreefmtvars
+	ENDIF
+*
+* parse the supplied list of variable names
+	num_names = int4_init
+	vars_gvn = variables .NE. ' '
+	IF (vars_gvn) THEN
+	  CALL TM_Parse_string(variables,maxezvars,var_names,num_names)
+	  IF (num_names .GT. name_limit) THEN
+	    buff = ' '
+	    WRITE (buff,1000) num_names
+	    CALL WARN( buff ) 
+	    buff = ' '
+	    WRITE (buff,1002) name_limit
+	    CALL WARN( buff ) 
+ 1000	    FORMAT( 'attempt to initalize',I3,' variables')
+ 1002	    FORMAT( 'maximum allowed is',I3,' variables')
+	    num_names = name_limit
+	  ENDIF
+*         ... check for illegal and duplicate names (*sh* 7/92)
+          DO 510 ncnt = 1,num_names
+            IF ( var_names(ncnt) .EQ. '-' ) GOTO 510
+            IF ( .NOT.TM_LEGAL_NAME(var_names(ncnt)) ) GOTO 9400
+            DO 500 jcnt = 1, ncnt-1
+              IF ( var_names(jcnt) .EQ. '-' ) GOTO 500
+              IF ( var_names(jcnt) .EQ. var_names(ncnt) ) GOTO 9400
+ 500        CONTINUE
+ 510      CONTINUE
+	ENDIF
+
+* information needed for delimited file reads: nfields, types
+	IF (its_delimited) THEN
+	   IF (types  .NE. ' ') THEN
+*          ... parse users list of field types
+	     CALL TM_Parse_string(types,maxezvars,type_names,num_types)
+	     DO 530 i = 1, num_types
+	       DO 520 j = 1, FTYP_NUM_TYPES
+	         IF (type_names(i)(1:2) .EQ. ftyp_name(j)(1:2)) THEN
+	            l1 = TM_LENSTR1(type_names(i))
+	            l2 = TM_LENSTR1(ftyp_name (j))
+	            IF (l1.GT.l2 ) GOTO 9300  ! ilegal type name
+	            IF (type_names(i)(:l1) .NE. ftyp_name(j)(:l1)) GOTO 9300
+	            field_type(i) = j
+	            GOTO 530
+	         ENDIF	       
+ 520	       CONTINUE
+*              ... name not recognized
+	       GOTO 9300
+ 530	     CONTINUE
+*            ... if only a single type was given use that type for all vars
+	     IF (num_types .EQ. 1) THEN
+	       IF (vars_gvn) THEN
+	         DO 535 i = 2, num_names
+ 535	         field_type(i) = field_type(1)
+	         num_types = num_names
+	       ELSE
+*                ... analyze file for just to get number of fields
+*	         ... pass null terminated file name string in line_buff
+	         CALL TM_FTOC_STRNG( ds_des_name(dset)
+     .		     (:TM_LENSTR1(ds_des_name(dset))), line_buff, 2048 )
+	         CALL ANAL_FILE(line_buff, line_buff, delims, skip,
+     .	                       2000, 2048, num_types, idummy,
+     .			       maxezvars)
+	         DO i = 2, num_types
+	            field_type(i) = field_type(1)
+	         ENDDO
+	       ENDIF
+	     ENDIF
+	   ELSE
+*            ... analyze file for list of field types
+*	     ... pass null terminated file name string in line_buff
+	     CALL TM_FTOC_STRNG( ds_des_name(dset)
+     .		     (:TM_LENSTR1(ds_des_name(dset))), line_buff, 2048 )
+	     CALL ANAL_FILE(line_buff, line_buff, delims, skip,
+     .	                       2000, 2048, num_types, field_type,
+     .			       maxezvars)
+	     IF (vars_gvn) THEN
+	       IF (num_names .GT. num_types) THEN
+	         GOTO 9330
+	       ELSE
+	          num_types = num_names  ! use only fields requested by user
+	       ENDIF
+	     ENDIF
+*	     ... reset missing fields to ANAL_MISSING as flag for later treatment
+	     DO i = 1, num_types
+	       IF (field_type(i) .EQ. FTYP_MISSING)
+     .			field_type(i) = FTYP_ANAL_MISSING
+	     ENDDO
+	   ENDIF
+	   IF (vars_gvn) THEN
+	      DO 540 i = 1, num_names
+ 540	      IF (var_names(i).EQ.'-') field_type(i) = FTYP_MISSING
+	      IF (num_names .GT. num_types) THEN
+	        DO 545 i = num_types+1, num_names
+ 545		field_type(i) = FTYP_MISSING
+	      ENDIF
+	   ELSE
+*             ... synthesize names for fields
+	      num_names = num_types
+	      DO 550 i = 1, num_names
+	         IF (field_type(i) .EQ. FTYP_MISSING ) THEN
+	           var_names(i) = '-'
+	         ELSE
+	           var_names(i) = 'V'//TM_LEFINT(i,j)
+	         ENDIF
+ 550	      CONTINUE
+	   ENDIF
+	ELSE
+*       ... not a delimited read
+	   IF (.NOT.vars_gvn) THEN
+*             ... synthesize name for the one variable
+	      num_names = 1
+	      var_names(1) = 'V1'
+	   ENDIF
+	   DO 560 i = 1, num_names
+ 560	   field_type(i) = int4_init
+	ENDIF
+
+* Loop through all variable names
+	var_pos  = 1
+	DO 170 ncnt = 1,num_names
+*
+* Find the next storage position
+	  DO 140 nvar = var_pos,maxvars
+	    IF (ds_var_setnum(nvar) .EQ. set_not_open) GOTO 150
+  140     CONTINUE
+* No room left for new variables
+	  GOTO 9100
+*
+* Load variable record now
+  150     var_pos = nvar
+*	  ds_var_code(nvar)	= var_names(ncnt)
+          CALL string_array_modify(ds_var_code_head,
+     .                             nvar,
+     .                             var_names(ncnt),
+     .                             LEN(var_names(ncnt)))
+	  ds_var_title(nvar)	= var_names(ncnt)
+	  ds_var_titl_mod(nvar)	= ' '
+	  ds_var_units(nvar)	= ' '
+	  ds_missing_flag(nvar)	= -1.E34
+	  ds_bad_flag(nvar)	= -1.E34
+	  DO 160 jcnt = 1,nferdims
+  160	  ds_ordering(jcnt,nvar)     = jcnt
+	  ds_precision(nvar)	= 'SINGLE'
+	  ds_aux_set_num(nvar)	= 0
+* Other calculated or derived data pertaining to variables
+	  ds_ndataperrec(nvar)	= int4_init
+	  ds_nrecpervar(nvar)	= int4_init
+	  ds_nrecb4var(nvar)	= int4_init
+	  ds_var_setnum(nvar)	= dset
+	  ds_npospervar(nvar)	= 0
+* Delimited read field information
+	  IF (field_type(ncnt) .EQ. FTYP_CHARACTER) THEN
+	    ds_var_type(nvar) = ptype_string
+	  ELSE
+	    ds_var_type(nvar) = ptype_float
+	  ENDIF
+	  IF (its_delimited) THEN
+	    IF (field_type(ncnt) .EQ. FTYP_ANAL_MISSING) THEN
+	       ds_var_titl_mod(nvar) = 'all values missing'
+	       field_type(ncnt) = FTYP_NUMERIC
+	    ELSEIF (field_type(ncnt) .EQ. FTYP_EURODATE
+     .	       .OR. field_type(ncnt) .EQ. FTYP_DATE) THEN
+	       ds_var_titl_mod(nvar) = 'Julian days since 1-Jan-1900'
+	       ds_var_units(nvar) = 'days'
+	    ELSEIF (field_type(ncnt) .EQ. FTYP_TIME) THEN
+	       ds_var_titl_mod(nvar) = 'Time of day'
+	       ds_var_units(nvar) = 'hours'
+	    ELSEIF (field_type(ncnt) .EQ. FTYP_LAT) THEN
+	       ds_var_titl_mod(nvar) = 'Latitude'
+	       ds_var_units(nvar) = 'degrees_north'
+	    ELSEIF (field_type(ncnt) .EQ. FTYP_LON) THEN
+	       ds_var_titl_mod(nvar) = 'Longitude'
+	       ds_var_units(nvar) = 'degrees_east'
+	    ENDIF
+	  ENDIF
+
+  170	CONTINUE
+*
+* Save number of variable names (including "-") in data set
+	ds_basic_axes(1,dset)	= num_names
+
+* other available storage for later data set mods ...
+	ds_basic_axes(2,dset)	= int4_init
+	ds_basic_axes(3,dset)	= int4_init
+	ds_basic_axes(4,dset)	= int4_init
+	ds_basic_axes(5,dset)	= int4_init
+	ds_basic_axes(6,dset)	= int4_init
+
+* store number of columns to read
+	IF ( columns .EQ. int4_init ) THEN
+	   ds_ntuple(dset) 	= num_names
+	ELSE
+!	   IF ( MOD(columns,num_names).NE.0 ) GOTO 9300    ! removed 12/94
+	   ds_ntuple(dset) 	= columns
+	ENDIF
+*
+* Find the next storage position for stepfiles in common
+	DO 180 stp_cnt = 1,maxstepfiles
+	  IF (sf_setnum(stp_cnt) .EQ. set_not_open) THEN
+	    nstp = stp_cnt
+	    GOTO 190
+	  ENDIF
+  180	CONTINUE
+* No room left for new stepfiles
+	GOTO 9200
+*
+* Load stepfile record
+  190	sf_name(nstp)		= filename
+	sf_setnum(nstp)		= dset
+	sf_aux_set_num(nstp)	= 0
+	sf_nrecperstep(nstp)	= 1
+	sf_skip(nstp)		= 0
+	sf_regvars(nstp)	= .TRUE.
+
+*
+* save special info for delimited read files - struct ptr into ds_file_info_ptr
+	IF (its_delimited) THEN
+	  CALL SAVE_DELIMITED_INFO( num_names, field_type, delims,
+     .				    ds_file_info_ptr(dset)   )
+	ENDIF
+
+
+* Put the information into the linked-list strucure for the dataset
+* and its variables
+
+        CALL CD_STORE_DSET (dset, status)
+        coordvar = 0
+        varid = 0
+
+        DO 200 ivar = 1, maxvars
+           IF (ds_var_setnum(ivar) .EQ. set_not_open) GOTO 210
+           IF (ds_var_setnum(ivar) .EQ. dset .AND.
+     .         STR_SAME(ds_var_code(ivar) , '-' ) .NE. 0) THEN
+
+              varid = varid + 1
+	      IF (ds_var_type(ivar) .EQ. ptype_float) THEN
+	         vartype = NF_FLOAT
+	      ELSEIF  (ds_var_type(ivar) .EQ. ptype_string) THEN
+	         vartype = NF_CHAR
+	      ELSE
+                 vartype = NF_FLOAT
+              ENDIF
+        
+              CALL CD_ADD_VAR( dset, ds_var_code(ivar), varid, 
+     .          ds_var_title(ivar), ds_var_units(ivar), vartype,
+     .          coordvar, ds_bad_flag(ivar), status)
+           ENDIF
+  200   CONTINUE
+
+* All done
+  210   status = merr_ok
+	GOTO 9999
+*
+* ERROR MESSAGES
+ 9000	CALL TM_ERRMSG ( merr_dsetlim, status, 'EZ_INIT_DSET',
+     .			 no_descfile, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxdsets)),
+     .			 no_errstring, *9950)
+
+ 9100	CALL TM_ERRMSG ( merr_varlim, status, 'EZ_INIT_DSET',
+     .			 dset, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxvars)),
+     .			 no_errstring, *9950)
+
+ 9200	CALL TM_ERRMSG ( merr_filim, status, 'EZ_INIT_DSET',
+     .			 dset, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxstepfiles)),
+     .			 no_errstring, *9950)
+
+ 9300	CALL TM_ERRMSG ( merr_syntax, status, 'EZ_INIT_DSET',
+     .			 dset, no_stepfile,
+     .			 'Unrecognized field type: '//type_names(i),
+     .			 no_errstring, *9310)
+ 9310	line_buff = ftyp_name(1)
+	jcnt = 1   ! string length of list of field types
+	DO 9320 i = 2, FTYP_NUM_TYPES
+	   line_buff(jcnt+1:) = ','//ftyp_name(i)
+	   jcnt = jcnt + 1 + TM_LENSTR1(ftyp_name(i))
+ 9320	CONTINUE
+	CALL WARN('Valid types are: '//line_buff(:jcnt))
+	GOTO 9950
+
+ 9330	WRITE (line_buff,3100) num_names, num_types
+ 3100	FORMAT(I4,' var names but only',I3,' fields found in file scan')
+	i = TM_LENSTR1(line_buff)
+	CALL TM_ERRMSG ( merr_varlim, status, 'EZ_INIT_DSET',
+     .			 dset, no_stepfile,
+     .			 line_buff(:i),
+     .			 no_errstring, *9950)
+
+ 9400	CALL TM_ERRMSG ( merr_syntax, status, 'EZ_INIT_DSET',
+     .			 dset, no_stepfile,
+     .			 'illegal or duplicate variable name '
+     .                   //var_names(ncnt),
+     .			 no_errstring, *9950)
+
+ 9950	dset = unspecified_int4
+
+* get out
+ 9999	RETURN
+	END
diff --git a/fmt/src/ez_init_permute.F b/fmt/src/ez_init_permute.F
new file mode 100644
index 0000000..9ead523
--- /dev/null
+++ b/fmt/src/ez_init_permute.F
@@ -0,0 +1,85 @@
+	SUBROUTINE EZ_INIT_PERMUTE(varnum )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* work routine for EZ_READ when /ORDER is not the default X-Y-Z-T
+* Initialize the variables used to translate the permuted subscripts
+* into the 1D array index
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+
+* revision 0.00 -  5/94 *sh*
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* calling arguments:
+* varnum - the variable number in COMMON
+	INTEGER varnum
+
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'
+        include 'xdset_info.cmn_text'
+        include 'xez_order.cmn_text'
+
+* local variable definitions:
+	INTEGER idim, gridnum, line
+
+* initialize
+	gridnum = ds_grid_number(varnum)
+
+* ezii    - the "current" subscript, zero referenced
+* ezorder - the permuted ordering
+* eznn    - the length of each axis
+	DO 100 idim = 1, nferdims
+	   ezii(idim) = 0
+	   ezorder(idim) = ds_ordering(idim, varnum)
+	   line = grid_line(idim, gridnum)
+	   IF ( line .EQ. mpsnorm) THEN
+	      eznn(idim) = 1
+	   ELSE
+	      eznn(idim) = line_dim(line)
+	   ENDIF
+ 100	CONTINUE
+
+* decrement by 1 since EZ_READ pre-increments
+	ezii(ezorder(1)) = ezii(ezorder(1)) - 1
+	RETURN
+        END
diff --git a/fmt/src/ez_mod_dset.F b/fmt/src/ez_mod_dset.F
new file mode 100644
index 0000000..51a1f43
--- /dev/null
+++ b/fmt/src/ez_mod_dset.F
@@ -0,0 +1,124 @@
+	SUBROUTINE EZ_Mod_Dset (dset,title,ezform,grid,skip,order,status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* A routine to fill in the "missing" gaps in the XDSET_INFO entry for an EZ_
+* data set. All parameters (except dset) are optional, however, any unused
+* parameters must be filled with char_init, or int4_init depending on type.
+*
+* revision 0.00 - 08/14/89
+* revision 0.01 - 04/25/91 *sh* Unix/RISC port: longer des name
+* revision 1.0	- 1/10/94 *kob* file/order upgrade to allow specification
+*		  of axis permutations.
+* V530: change to xez_info.cmn requires ez_lib.parm first
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* V581 *acm*/3/05 - increase length of strings for dataset title to 1024 
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V685+ 12/13 *acm* 6D Ferret: passed-in array had fixed dimensino of 4
+
+* Arguments:
+*	dset	- data set number
+*	title	- data set title
+*	ezform	- reading format
+*	grid	- grid data is on (spread over all variables)
+*	skip	- number of heading records to skip
+* 	order   - array specifying data order	1/94 *kob*
+*	status	- (output)
+*
+	CHARACTER*(*)	title, ezform
+	INTEGER*4	dset, grid, skip, order(*), status,idim
+*
+* Include files
+	include 'tmap_dims.parm'  
+#include "tmap_dset.parm"  
+	include 'tmap_errors.parm'
+	include 'ez_lib.parm'
+	include 'xez_info.cmn_text'  
+	external xez_info_data
+	include 'xdset_info.cmn_text'  
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+*
+* Local definitions
+	INTEGER*4	vcnt, scnt
+*
+* Does data set exist?
+	IF (ds_name(dset) .EQ. char_init1024) GOTO 9000
+*
+* Defining title?
+	IF (title .NE. char_init1024) ds_title(dset) = title
+*
+* Defining reading format?
+	IF (ezform .NE. char_init16) THEN
+	  ds_parm_name(1,dset) = 'FORMAT'
+	  ds_parm_text(1,dset) = ezform
+	ENDIF
+*
+* Defining grid number? (fills in ALL variables)
+	IF (grid .NE. int4_init) THEN
+	  DO 100 vcnt = 1,maxvars
+	  IF (ds_var_setnum(vcnt) .NE. dset) GOTO 100
+	  ds_grid_number(vcnt) = grid
+* Fill in the data order  *kob* 1/94
+	  IF (order(1) .NE. int4_init) THEN
+	    DO 150 idim=1,nferdims
+	    ds_ordering(idim,vcnt) = order(idim) 
+ 150	  CONTINUE
+	  ENDIF
+	  CALL EZ_UPDATE_VAR(vcnt)
+ 100	  CONTINUE	  
+	ENDIF
+
+*
+* Defining skip header records?
+	IF (skip .NE. int4_init) THEN
+	  DO 200 scnt = 1,maxstepfiles
+  200	  IF (sf_setnum(scnt) .EQ. dset) sf_skip(scnt) = skip
+	ENDIF
+	status = merr_ok
+	GOTO 9990
+*
+* Error messages
+ 9000	CALL TM_ERRMSG( merr_dsetnf, status, 'EZ_MOD_DSET',
+     .			no_descfile, no_stepfile,
+     .			no_errstring, no_errstring, *9990)
+*
+* finished
+ 9990	RETURN
+	END
diff --git a/fmt/src/ez_mod_vars.F b/fmt/src/ez_mod_vars.F
new file mode 100644
index 0000000..7c9047e
--- /dev/null
+++ b/fmt/src/ez_mod_vars.F
@@ -0,0 +1,190 @@
+	SUBROUTINE EZ_Mod_Vars( dset, vpos, varid,
+     .			name, title, units, grid, bad, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* A routine to fill in the "missing" gaps in the XDSET_INFO entry for an EZ_
+* data set. All parameters (except dset and var) are optional, however, any
+* unused parameters must be filled with char_init, int4_init, or real4_init
+* depending on type.
+*
+* revision 0.00 - 08/14/89
+* revision 0.10 - 10/25/89 - *sh* immediate COMMON update via EZ_UPDATE_VAR
+* revision 0.11 - 04/25/91 *sh* Unix/RISC port: longer des name
+* V530: change to xez_info.cmn requires ez_lib.parm first
+* V532 5/01 *sh* - when the grid is modified must handle dynamic allocation
+* V533 6/01 *sh* - added argument "name"
+* V540 10/01 *sh* - when title is modified, reset titl_mod to blank
+*      *acm* 10/01 increase length of ds_name
+*      *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V616  1/09 *acm* - Fix ticket 1615, If doing SET VAR/UNITS, /TITLE, /BAD on a
+*                    var from an EZ dataset, set the appropriate attributes.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V68  *acm* 1/12 The variables should be declared REAL (conversion to double prec.)
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* Arguments:
+*	dset	- data set number
+*	vpos	- variable number within COMMON/XDSET_INFO
+*	name	- variable name
+*	title	- variable title
+*	units	- variable units
+*	grid	- grid data is on for this variable
+*	bad	- bad data flag
+*	status	- (output)
+*
+	CHARACTER*(*)	name, title, units
+	INTEGER*4	dset, vpos, grid, status
+	REAL		bad
+
+	INTEGER		TM_LENSTR1, 
+     .                  outtype_flag, varid, attid, attype, attlen, 
+     .			attoutflag
+	REAL		dummy
+	CHARACTER	varattname*512, varname*128, attname*128, buf*2
+*
+* Include files
+	include 'tmap_dims.parm'  
+	include 'ez_lib.parm'  
+#include "tmap_dset.parm"  
+#include "gt_lib.parm"
+	include 'xez_info.cmn_text'  
+	external xez_info_data
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'  
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+        include 'netcdf.inc'
+
+*
+* Local definitions
+*
+* Does data set exist?
+	IF (ds_name(dset) .EQ. char_init1024) GOTO 9100
+*
+* Defining variable title?
+	IF ( title .NE. char_init80 ) THEN
+           ds_var_title( vpos ) = title
+
+           attlen = TM_LENSTR1(title)
+           attname = 'long_name'
+           CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+           IF (attid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .          attname, attype, attlen, attoutflag, status )
+              CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .        title, dummy, status)
+           ENDIF
+	ENDIF
+*
+* Defining variable units?
+
+	IF ( units .NE. char_init16 ) THEN
+           ds_var_units( vpos ) = units
+
+           attlen = TM_LENSTR1(units)
+           attname = 'units'
+           CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+           IF (attid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+              CALL CD_REPLACE_ATTR (dset, varid, attname, attype, 
+     .           attlen, units, dummy, status)
+           ELSE
+                 attype = NF_CHAR
+                 attoutflag = 1
+                 CALL CD_PUT_NEW_ATTR (dset, varid, attname, attype, 
+     .              attlen, attoutflag, units, dummy, status )
+           ENDIF
+	ENDIF
+*
+* Defining variable name?
+*	IF (name .NE. char_init16) ds_var_code(vpos) = name
+	IF (name .NE. char_init16) 
+     .      CALL string_array_modify(ds_var_code_head,
+     .                               vpos, name, LEN(name))
+*
+* Defining grid number?
+	IF (grid .NE. int4_init) THEN
+	  CALL TM_USE_DYN_GRID(grid)	! allocate new as used by variable
+	  CALL TM_DEALLO_DYN_GRID( ds_grid_number(vpos) ) ! deallo old
+	  ds_grid_number(vpos) = grid
+	  CALL EZ_UPDATE_VAR(vpos)
+	ENDIF
+*
+* Defining bad data flag?
+
+	IF ( bad  .NE. real4_init  ) THEN
+	   CALL PURGE_FILE_VAR( vpos ) ! remove memory-resident variables
+	   CALL PURGE_ALL_UVARS	 ! delete (possibly dependent) uvars
+	   ds_missing_flag(vpos) = ds_bad_flag(vpos)	      
+	   ds_bad_flag    (vpos) = bad
+
+	   attlen = 1
+	   attname = 'missing_value'
+	   CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+	   IF (attid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+              CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+	   ENDIF
+	   attname = '_FillValue'
+	   CALL CD_GET_VAR_ATT_ID (dset, varid, attname, attid, status)
+	   IF (attid .GT. 0) THEN
+              CALL CD_GET_VAR_ATT_INFO (dset, varid, attid, 
+     .             attname, attype, attlen, attoutflag, status )
+              CALL CD_REPLACE_ATTR (dset, varid, attname, attype, attlen, 
+     .           buf, bad, status)
+	   ENDIF
+
+	status = merr_ok
+	ENDIF
+
+	GOTO 9990
+*
+* Error messages
+ 9100	CALL TM_ERRMSG( merr_dsetnf, status, 'EZ_MOD_DSET',
+     .			no_descfile, no_stepfile,
+     .			no_errstring, no_errstring, *9990)
+*
+* finished
+ 9990	RETURN
+	END
diff --git a/fmt/src/ez_permuted_index.F b/fmt/src/ez_permuted_index.F
new file mode 100644
index 0000000..a5f9801
--- /dev/null
+++ b/fmt/src/ez_permuted_index.F
@@ -0,0 +1,90 @@
+	INTEGER FUNCTION EZ_PERMUTED_INDEX( )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* work routine for EZ_READ when /ORDER is not the default X-Y-Z-T
+* Determine the single-dimensioned array index equivalent to the 4D
+* (i,j,k,l) of the "next" word to be stored
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+
+* revision 0.00 -  3/4/94 *sh*
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling arguments:
+* None - all indexing is done in COMMON to maximize speed (and because
+* algorithm is based on incrementing the last position rather than 
+* recomputing cold from arguments
+
+* internal variable declarations:
+
+	include 'tmap_dims.parm'
+        include 'xez_order.cmn_text'
+
+* convenience equivalences
+	INTEGER	nx, ny, nz,
+     .		 i,  j,  k,  l,
+     .		o1, o2, o3, o4
+	EQUIVALENCE (eznn(1),nx), (eznn(2),ny), (eznn(3),nz),
+     .		    (ezii(1),i),(ezii(2),j),(ezii(3),k),(ezii(4),l),
+     .		    (ezorder(1),o1), (ezorder(2),o2), 
+     .		    (ezorder(3),o3), (ezorder(4),o4) 
+
+
+* local variable definitions:
+
+* increment all 4 subscripts in appropriate permutation
+	ezii(o1) = ezii(o1) + 1
+	IF ( ezii(o1) .GE. eznn(o1) ) THEN
+	   ezii(o1) = 0
+	   ezii(o2) = ezii(o2) + 1
+	   IF ( ezii(o2) .GE. eznn(o2) ) THEN
+	      ezii(o2) = 0
+	      ezii(o3) = ezii(o3) + 1
+	      IF ( ezii(o3) .GE. eznn(o3) ) THEN
+	         ezii(o3) = 0
+	         ezii(o4) = ezii(o4) + 1
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+* compute the 1D index
+	EZ_PERMUTED_INDEX = ( nx*(ny*(nz*l + k) + j) + i ) + 1
+
+	RETURN
+
+      END
diff --git a/fmt/src/ez_read.F b/fmt/src/ez_read.F
new file mode 100644
index 0000000..94c5a96
--- /dev/null
+++ b/fmt/src/ez_read.F
@@ -0,0 +1,469 @@
+	SUBROUTINE EZ_READ ( dset, nread, ncol, columns, buff, status,
+     .	                      d0, d1, d2, d3, d4,
+     .	                      d5, d6, d7, d8, d9,
+     .	                      d10,d11,d12,d13,d14,
+     .	                      d15,d16,d17,d18,d19  )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 
+* Subroutine uses the COMMON info for the initalized EZ data set (ASCII and
+* unformatted non_TMAP data files) to read in the entire data file and transfer 
+* it to the variable arrays d0 .. d19.
+*
+* revision 0.00 - 08/04/89
+* revision 1.00 - 08/15/89 - Will initialize XDSET/XSTEP common variables as
+*			     necessary (first time, and if dset_mod is set)
+* revision 1.10 - 10/24/89 - *sh* eliminated EZ_UPDATE_COMMON call
+*			     added multi-column reads of same variable
+* revision 1.20 - 02/27/90 - Improved read error message by including record #
+* RISC/Unix port *sh* 1/91 - syntax changes to accomodate DEC RISC compiler
+*                     5/91 - corrected bug sf_valid(dset) --> sf_valid(sfcnt)
+* 3/12/93 *sh* : made "buff" into an argument in the call
+* IBM/AIX Port ---
+*       4/13/94 *kob* : Put definitions of cr and lf into Parameter statments
+*                     : Added "#ifdef READONLY_ALLOWED" because AIX compiler
+*                       didn't allow readonly in open statements
+* 5/94: *sh* major change to permit /ORDER= control over input
+*       converted internal logic to 1D (ncol*nread) instead of 2D (ncol,nread) 
+*	added /FORMAT=STREAM, as well, where the file is opened for direct
+*	access in longwords, /SKIP signifies the number of words to skip,
+*	and /COLUMNS signifies the number of words separating multiple
+*	variables in the file
+* 2/95:  increased from 10 arguments to 20
+* 9/95: *sh* & *kob* - changed error branch for STREAM reads
+* 9/95	kob*	- added ifdef for sgi to prevent setting reclen in words 
+*		  instead of bytes
+* 11/96 *kob* - Linux Port - had to move variable assignments off of
+*               declaration line.
+* V500 3/99 *kob* - Initialize buff at 610 to prevent use of previous values
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+*
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use character constant instead
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V68  *acm* 1/12 The variables should be declared REAL (conversion to double prec.)
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* Arguments:
+*	dset	- data set number
+*	nread	- (input/output) number of data records to read/actually read
+*	ncol    - number of values PER VARIABLE per record ("ngroups" in PLOT+)
+*	columns - number of VALUES per record
+*       buff    - buffer big enough to hold one record
+*	status	- (output)
+*	d0...d19- (output) variable arrays
+*
+	INTEGER*4	dset, nread, ncol, columns, status, nmax
+	REAL		d0(ncol*nread), d1(ncol*nread), d2(ncol*nread),
+     .			d3(ncol*nread), d4(ncol*nread), d5(ncol*nread), 
+     .			d6(ncol*nread), d7(ncol*nread), d8(ncol*nread), 
+     .			d9(ncol*nread),
+     .			d10(ncol*nread),d11(ncol*nread),d12(ncol*nread),
+     .                  d13(ncol*nread),d14(ncol*nread),d15(ncol*nread),
+     .                  d16(ncol*nread),d17(ncol*nread),d18(ncol*nread),
+     .                  d19(ncol*nread)
+        REAL buff(columns)
+
+*
+* Include files
+	include 'ez_lib.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xez_info.cmn_text'
+	external xez_info_data
+	include 'xez_order.cmn_text'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+*
+*internal parameter declarations *kob* 4apr94
+        CHARACTER*1     cr,lf
+#ifdef NO_INTRINSIC_IN_PARAMETER
+        PARAMETER       ( cr = o'015',
+     .                    lf = o'012')
+#else
+        PARAMETER       ( cr = CHAR(13),
+     .                    lf = CHAR(10))
+#endif
+
+* Local definitions
+	CHARACTER*11	file_format
+	CHARACTER*13	TM_STRING
+	CHARACTER*80	errbuff
+	CHARACTER*99	in_format
+	INTEGER		EZ_PERMUTED_INDEX
+	INTEGER*4	tpos, vpos, vcnt, sfcnt, lunit, scnt, rcnt, vfirst
+	INTEGER*4	skip_in, read_in, transloc, icol, nout, ncolmn
+	INTEGER*4	itemp, i, initloc, irec, ierr
+	INTEGER*4	trans(0:maxezvars-1)
+	DATA 		(trans(i),i=0,maxezvars-1) /maxezvars*-1/
+	LOGICAL		unformatted, file_exists, file_open,
+     .			permuted, stream
+	REAL		bad(0:maxezvars-1)
+
+
+
+* Does data set exist?
+	IF (ds_name(dset) .EQ. char_init1024) GOTO 9300
+*
+* Locate Step file entry
+	DO 10 sfcnt = 1,maxstepfiles
+	  IF (sf_setnum(sfcnt) .EQ. dset) GOTO 20
+  10	CONTINUE
+	GOTO 9400
+
+* Initialize
+ 20	nmax = ncol*nread
+*   get file format
+	stream = ds_parm_text(1,dset)(:3) .EQ. 'STR'
+	unformatted = ds_parm_text(1,dset)(:3) .EQ. 'UNF'
+	IF ( unformatted ) THEN
+	  file_format = 'UNFORMATTED'
+	ELSE
+	  file_format = 'FORMATTED'
+	  in_format = ds_parm_text(1,dset)		! Run time format info
+	ENDIF
+*   load transfer array. vpos will end up with number of variables to read in
+*   from file, tpos will be number of useful variables to transfer to variable
+*   arrays. '-' in ds_var_code indicates unused variable
+*   4/94 - also capture the var # of the first var in the data set, vfirst
+	tpos = 0
+	vpos = 0
+	DO 100 vcnt = 1,maxvars
+	  IF (ds_var_setnum(vcnt) .EQ. dset) THEN
+	    IF ( vpos .EQ. 0 ) vfirst = vcnt
+	    vpos = vpos + 1
+	    IF (Index(ds_var_code(vcnt),'-') .EQ. 0) THEN
+	      trans(tpos) = vpos
+	      tpos = tpos + 1
+	      bad(tpos) = ds_bad_flag(vcnt)    ! 4/94
+	    ENDIF
+	  ENDIF
+  100	CONTINUE
+
+* is the input permuted?
+	permuted = .FALSE.
+	DO 110 i = 1, 4
+	   IF ( ds_ordering(i,vfirst) .NE. i ) permuted = .TRUE.
+ 110	CONTINUE
+!	permuted = .TRUE.   ! debug statement
+	IF ( permuted ) CALL EZ_INIT_PERMUTE( vfirst )
+
+*   set up ASSIGN statements (for GOTO variable statements)
+	IF ( unformatted ) THEN
+	  ASSIGN 400 TO skip_in			! Goes to UNFORMATTED read
+	  ASSIGN 500 TO read_in			! Goes to UNFORMATTED read
+	ELSEIF ( in_format(:4) .EQ. 'FREE' ) THEN
+	  ASSIGN 450 TO skip_in			! Goes to FORMATTED read
+	  ASSIGN 610 TO read_in			! Goes to FORMATTED read
+	ELSEIF ( stream ) THEN			! "STREAM" direct access binary
+	  ASSIGN 499 TO skip_in
+	  ASSIGN 620 TO read_in
+	  irec = sf_skip(sfcnt) + 1     ! /SKIP=words
+	ELSE
+	  ASSIGN 450 TO skip_in			! Goes to FORMATTED read
+	  ASSIGN 600 TO read_in			! Goes to FORMATTED read
+	ENDIF
+	GOTO (150 ,151 ,152 ,153 ,154 ,155 ,156 ,157 ,158 ,159,
+     .	      1510,1511,1512,1513,1514,1515,1516,1517,1518,1519) tpos
+	ASSIGN 799 TO transloc			! transfers 0 variables
+	ASSIGN 390 TO initloc
+	GOTO 160
+  150	ASSIGN 790 TO transloc			! transfers 1 variable
+	ASSIGN 380 TO initloc
+	GOTO 160
+  151	ASSIGN 780 TO transloc			! transfers 2 variables
+	ASSIGN 381 TO initloc
+	GOTO 160
+  152	ASSIGN 770 TO transloc			! transfers 3 variables
+	ASSIGN 382 TO initloc
+	GOTO 160
+  153	ASSIGN 760 TO transloc			! transfers 4 variables
+	ASSIGN 383 TO initloc
+	GOTO 160
+  154	ASSIGN 750 TO transloc			! transfers 5 variables
+	ASSIGN 384 TO initloc
+	GOTO 160
+  155	ASSIGN 740 TO transloc			! transfers 6 variables
+	ASSIGN 385 TO initloc
+	GOTO 160
+  156	ASSIGN 730 TO transloc			! transfers 7 variables
+	ASSIGN 386 TO initloc
+	GOTO 160
+  157	ASSIGN 720 TO transloc			! transfers 8 variables
+	ASSIGN 387 TO initloc
+	GOTO 160
+  158	ASSIGN 710 TO transloc			! transfers 9 variables
+	ASSIGN 388 TO initloc
+	GOTO 160
+  159	ASSIGN 700 TO transloc			! transfers 10 variables
+	ASSIGN 389 TO initloc
+	GOTO 160
+ 1510	ASSIGN 7910 TO transloc			! transfers 11 variable
+	ASSIGN 3810 TO initloc
+	GOTO 160
+ 1511	ASSIGN 7810 TO transloc			! transfers 12 variables
+	ASSIGN 3811 TO initloc
+	GOTO 160
+ 1512	ASSIGN 7710 TO transloc			! transfers 13 variables
+	ASSIGN 3812 TO initloc
+	GOTO 160
+ 1513	ASSIGN 7610 TO transloc			! transfers 14 variables
+	ASSIGN 3813 TO initloc
+	GOTO 160
+ 1514	ASSIGN 7510 TO transloc			! transfers 15 variables
+	ASSIGN 3814 TO initloc
+	GOTO 160
+ 1515	ASSIGN 7410 TO transloc			! transfers 16 variables
+	ASSIGN 3815 TO initloc
+	GOTO 160
+ 1516	ASSIGN 7310 TO transloc			! transfers 17 variables
+	ASSIGN 3816 TO initloc
+	GOTO 160
+ 1517	ASSIGN 7210 TO transloc			! transfers 18 variables
+	ASSIGN 3817 TO initloc
+	GOTO 160
+ 1518	ASSIGN 7110 TO transloc			! transfers 19 variables
+	ASSIGN 3818 TO initloc
+	GOTO 160
+ 1519	ASSIGN 7010 TO transloc			! transfers 20 variables
+	ASSIGN 3819 TO initloc
+*
+* Check file validity if necessary
+  160	IF (.NOT. sf_valid(sfcnt)) THEN
+!	  INQUIRE (	FILE = sf_name(sfcnt),	! sf_name is too short 10/89
+	  INQUIRE (	FILE = ds_des_name(dset),
+     .			RECL = itemp,	! temporary var needed by DEC/RISC
+     .			EXIST = file_exists,
+     .			OPENED = file_open,
+     .			ERR = 9000)
+	  IF (.NOT. file_exists) GOTO 9100
+	  sf_reclen(sfcnt) = itemp
+* calculate RECL in longwords for unformatted (if not open)             
+          IF (.NOT. file_open .AND. unformatted )
+     .	                         sf_reclen(sfcnt) = sf_reclen(sfcnt)/4
+	  sf_valid(sfcnt) = .TRUE.      ! *sh* dset -> sfcnt 5/91
+        ENDIF                                                              
+*
+* get free VMS logical unit #   
+	CALL LIB_GET_LUN (lunit)
+*
+* open the file
+#ifdef sun 
+#  ifndef sgi
+#    define reclen_in_bytes
+#  endif
+#endif
+	IF ( stream ) THEN       ! 5/94
+	   OPEN	(UNIT = lunit,
+     .		 FILE = ds_des_name(dset),
+     .		 FORM = 'UNFORMATTED',
+     .		 ACCESS = 'DIRECT',
+#ifdef reclen_in_bytes
+     .		 RECL = 4,
+#else
+     .		 RECL = 1,
+#endif
+     .		 STATUS = 'OLD',
+     .		 ERR = 9000)
+	ELSE
+* added ifdef for READONLY_ALLOWED for IBM port *kob* 4apr94
+	   OPEN	(UNIT = lunit,
+     .		 FILE = ds_des_name(dset),
+     .		 FORM = file_format,
+     .		 ACCESS = 'SEQUENTIAL',
+     .		 STATUS = 'OLD',
+#ifdef READONLY_ALLOWED
+     .		 READONLY,
+#endif
+     .		 ERR = 9000)
+	ENDIF
+	sf_lunit(sfcnt) = lunit    ! *sh* dset -> sfcnt 5/91
+*
+* if input is to be permuted then it is essential to pre-fill the arrays
+* that will receive the data - this because a fragmentary read (less data in
+* the file then the grid dimensions would imply ) will end
+* at a point in the middle of the output arrays.
+	IF ( permuted ) THEN
+	   DO 390 nout = 1, nmax
+	      GOTO initloc
+ 3819	      d19(nout) = bad(trans(19))	      
+ 3818	      d18(nout) = bad(trans(18))	      
+ 3817	      d17(nout) = bad(trans(17))	      
+ 3816	      d16(nout) = bad(trans(16))	      
+ 3815	      d15(nout) = bad(trans(15))	      
+ 3814	      d14(nout) = bad(trans(14))	      
+ 3813	      d13(nout) = bad(trans(13))	      
+ 3812	      d12(nout) = bad(trans(12))	      
+ 3811	      d11(nout) = bad(trans(11))	      
+ 3810	      d10(nout) = bad(trans(10))	      
+ 389	      d9(nout) = bad(trans(9))	      
+ 388	      d8(nout) = bad(trans(8))	      
+ 387	      d7(nout) = bad(trans(7))	      
+ 386	      d6(nout) = bad(trans(6))	      
+ 385	      d5(nout) = bad(trans(5))	      
+ 384	      d4(nout) = bad(trans(4))	      
+ 383	      d3(nout) = bad(trans(3))	      
+ 382	      d2(nout) = bad(trans(2))	      
+ 381	      d1(nout) = bad(trans(1))	      
+ 380	      d0(nout) = bad(trans(0))	      
+ 390	   CONTINUE
+	ENDIF
+
+*
+* read "SKIP" records and initialize records read counter
+	GOTO skip_in
+  400	DO 425 scnt = 1,sf_skip(sfcnt)
+  425	READ (lunit,END=9200,ERR=9000)
+	GOTO 499
+  450	DO 475 scnt = 1,sf_skip(sfcnt)
+  475	READ (lunit,'(1X)',END=9200,ERR=9000)
+  499	nout = 0		! is number of values (per var) read so far
+	ncolmn = columns
+	IF ( stream ) ncolmn = vpos
+*
+* Read depending on format, nrec counts number of records read
+	GOTO read_in
+* ... binary data
+* Note: neither IOSTAT= nor ERR= branch is effective on binary read of ASCII
+*	file ???? (tested on OSF only)
+  500	READ (lunit,END=800,ERR=9500) (buff(rcnt),rcnt=1,ncolmn)
+* if statement commented out 3/22/95 *kob*
+*	IF ( ierr .NE. 0 ) GOTO 9500
+	GOTO 690
+* ... fixed format data
+  600	READ (lunit,in_format,END=800,ERR=9500) (buff(rcnt),rcnt=1,ncolmn)
+	GOTO 690
+* ... free format data
+* 3/99 *kob* - Initialize buff before reading to prevent use of previous values
+  610   do 611 rcnt = 1,ncolmn
+	   buff(rcnt) = -1.E34
+  611	continue
+	READ (lunit,*,END=800,ERR=9500) (buff(rcnt),rcnt=1,ncolmn)
+	GOTO 690
+* ... STREAM format data
+*       Normally there will be only a single variable read so vpos=1 but
+*       we are allowing multiple variables spaced apart in the file by
+*       /COLUMNS= words (stored in ds_ntuple(dset)) 
+* Note: neither IOSTAT= nor ERR= branch is effective on read past EOF ????
+*	(tested on OSF only) (ok after all? - branch to 9500 no good *sh* 9/95)
+  620	DO 622 vcnt = 1, vpos
+  622	READ (lunit,rec=irec+(vcnt-1)*ds_ntuple(dset),ERR=9600) buff(vcnt)
+	irec = irec + 1
+!	GOTO 690
+
+* Repeat the transfer operation if number of columns is a multiple of # vars
+ 690	DO 795 icol = 0, ncolmn-vpos, vpos
+	   IF ( permuted ) THEN
+	      nout = EZ_PERMUTED_INDEX()    ! increment permuted fashion
+	   ELSE
+	      nout = nout + 1
+	   ENDIF
+	   GOTO transloc
+*
+* Transfer to variable arrays depending on how many variables
+ 7010     d19(nout) = buff(trans(19)+icol)
+ 7110     d18(nout) = buff(trans(18)+icol)
+ 7210     d17(nout) = buff(trans(17)+icol)
+ 7310     d16(nout) = buff(trans(16)+icol)
+ 7410     d15(nout) = buff(trans(15)+icol)
+ 7510     d14(nout) = buff(trans(14)+icol)
+ 7610     d13(nout) = buff(trans(13)+icol)
+ 7710     d12(nout) = buff(trans(12)+icol)
+ 7810     d11(nout) = buff(trans(11)+icol)
+ 7910     d10(nout) = buff(trans(10)+icol)
+  700      d9(nout) = buff(trans(9)+icol)
+  710      d8(nout) = buff(trans(8)+icol)
+  720      d7(nout) = buff(trans(7)+icol)
+  730      d6(nout) = buff(trans(6)+icol)
+  740      d5(nout) = buff(trans(5)+icol)
+  750      d4(nout) = buff(trans(4)+icol)
+  760      d3(nout) = buff(trans(3)+icol)
+  770      d2(nout) = buff(trans(2)+icol)
+  780      d1(nout) = buff(trans(1)+icol)
+  790      d0(nout) = buff(trans(0)+icol)
+
+ 795	CONTINUE
+
+  799   IF (nout .GE. nmax) GOTO 800
+	GOTO read_in
+*
+* Finished, store records read and then exit
+  800	nread = nout / ncol
+	status = merr_ok
+	GOTO 9950
+*
+* Error message
+ 9000	CALL TM_ERRMSG( merr_erreq, status, 'EZ_READ',
+     .			dset, sfcnt, 'during SKIP reads',
+     .			no_errstring, *9999                 )
+
+ 9100	CALL TM_ERRMSG( merr_notmounted, status, 'EZ_READ',
+     .			dset, sfcnt, 'DATAFILE NOT FOUND',
+     .			no_errstring, *9999                 )
+
+ 9200	CALL TM_ERRMSG( merr_eof, status, 'EZ_READ',
+     .			dset, sfcnt,
+     .			'during SKIP reads', no_errstring, *9950   )
+
+ 9300	CALL TM_ERRMSG( merr_dsetnf, status, 'EZ_READ',
+     .			no_descfile, no_stepfile,
+     .			no_errstring, no_errstring, *9999)
+
+ 9400	CALL TM_ERRMSG( merr_stepnf, status, 'EZ_READ',
+     .			dset, no_stepfile,
+     .			no_errstring, no_errstring, *9999)
+
+ 9500	BACKSPACE lunit
+	READ (lunit,'(A)') errbuff
+	CALL TM_ERRMSG( merr_erreq, status, 'EZ_READ',
+     .			dset, sfcnt,
+     .		'Last or next-to-last record read:'//cr//lf//errbuff,
+     .			no_errstring, *9999                 )
+
+ 9600	CALL TM_ERRMSG( merr_erreq, status, 'EZ_READ',
+     .			dset, no_stepfile,
+     .			'error reading STREAM file', no_errstring, *9999)
+*
+* Close file and free lunit
+ 9950	CLOSE (lunit, ERR=9990)
+ 9990	CALL LIB_FREE_LUN (lunit)
+        sf_lunit(sfcnt) = file_not_open    ! *sh* added 5/91
+ 9999	RETURN
+	END
diff --git a/fmt/src/ez_update_var.F b/fmt/src/ez_update_var.F
new file mode 100644
index 0000000..c684599
--- /dev/null
+++ b/fmt/src/ez_update_var.F
@@ -0,0 +1,87 @@
+	SUBROUTINE EZ_UPDATE_VAR( var )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Subroutine will update the XDSET and XSTEP common entries for a single
+* variable of an EZ_ data set
+*
+* revision 0.00 - 10/24/89 - extracted from EZ_UPDATE_COMMON
+* 4/03 *acm* - Use STR_SAME to compare strings
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Arguments:
+*	var		- variable number in COMMON
+*
+	INTEGER		var
+*                                                 
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	
+
+* calling argument declarations:
+
+* Local definitions
+	INTEGER*4	STR_SAME, dset, lcnt, line
+*
+* Is it an EZ data set ?
+	dset = ds_var_setnum( var )
+        IF (STR_SAME(ds_type(dset), '  EZ') .NE. 0) GOTO 9000
+*
+* Update variable records
+	DO 100 lcnt = 1,nferdims
+	  line = grid_line(lcnt,ds_grid_number(var))		! temporary var
+	  IF (line .EQ. mpsnorm) THEN
+	    ds_grid_start(lcnt,var) = 1
+	    ds_grid_end(lcnt,var)   = 1
+	  ELSEIF (line .EQ. mpsunkn ) THEN
+	    GOTO 9000
+	  ELSE
+	    ds_grid_start(lcnt,var) = 1
+	    ds_grid_end(lcnt,var)   = line_dim(line)
+	  ENDIF
+  100	CONTINUE
+
+* All done
+	RETURN
+*
+* ERROR MESSAGES                   
+ 9000	STOP 'EZ_UPDATE_VAR'
+	END                        
diff --git a/fmt/src/fbits.h b/fmt/src/fbits.h
new file mode 100644
index 0000000..d860064
--- /dev/null
+++ b/fmt/src/fbits.h
@@ -0,0 +1,26 @@
+/*
+ *   Copyright 1995, University Corporation for Atmospheric Research
+ *   See top level COPYRIGHT file for copying and redistribution conditions.
+ */
+/* $Id: fbits.h 9399 2006-04-25 19:48:34Z ansley $ */
+
+#ifndef _FBITS_H_
+#define _FBITS_H_
+
+/*
+ * Macros for dealing with flag bits.
+ */
+#define fSet(t, f)       ((t) |= (f))
+#define fClr(t, f)       ((t) &= ~(f))
+#define fIsSet(t, f)     ((t) & (f))
+#define fMask(t, f)     ((t) & ~(f))
+
+/*
+ * Propositions
+ */
+/* a implies b */
+#define pIf(a,b) (!(a) || (b))
+/* a if and only if b, use == when it makes sense */
+#define pIff(a,b) (((a) && (b)) || (!(a) && !(b)))
+
+#endif /*!FBITS_H_*/
diff --git a/fmt/src/gt_get_time_axis.F b/fmt/src/gt_get_time_axis.F
new file mode 100644
index 0000000..8f3d143
--- /dev/null
+++ b/fmt/src/gt_get_time_axis.F
@@ -0,0 +1,287 @@
+	INTEGER*4 FUNCTION GT_GET_TIME_AXIS ( dset_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  Will use the information stored in XSTEP_FILES.CMN to construct a temporary
+*  time axis in XTM_GRID.CMN which will then be compared to pre-existing grids
+*  stored in common. If a match is found the temporary axis is deleted and the
+*  line number for the pre-existing axis is returned. If no match is found,
+*  the temporary axis is moved to permanent storage, and it's line number is
+*  returned.
+*
+*  Written 06/88 for PMEL/TMAP by M. Verschell
+*
+* revision 0.00 - 06/30/88
+* revision 0.01 - 11/21/88 - variable unused check is now a specific char_initXX
+* revision 0.10 - 12/12/88 - changed line slot location to last to first search,
+*			     free line memory slot gotten by next_line_mem_pos
+* revision 1.00 - 01/10/88 - Checks regularity of line before creating time axis
+*			     changed check of regularity to check to see if all
+*			     sf_delta's are equal. eliminated unused variables,
+*			     restructured code arund these changes. Line slot
+*			     now gotten by TM_FIND_LIKE_LINE.
+* revision 1.01 - 02/06/88 - line_modulo not initialized - corrected *sh*
+* revision 1.02 - 02/17/89 - Fixed next_line_mem_pos error(1 less than correct)
+* 6/24/92 *sh* & *ko* - bug fix: logic for line_regular if gap in step files
+*                     - fix to bug fix (8/92 *sh*) - prev_lastep was INTEGER 
+* 8/28/96 *kob*	      - bug fix: change type of "itt" to real*8
+*		      - bug fix: get rid of all bpos stuff and instead
+*				 call tm_irregax_mid to set up box
+*				 position stuff
+* 9/5/96 *kob*	      - bug fix: change of itt to real created a problem at
+*			         loop 110, because itt was being used as the
+*			         loop variable.  Not all of the timesteps in
+*				 each stepfile were being loaded into the 
+*				 line_mem array.  Loop now based on calculated
+*				 nteps_in_file.
+* 5/14/96 *kob*	       -Linux port - added an "INT" in calculating nsteps in the 
+*				     stepfile.  roundoff /dp differences were causing
+*				     a problem in linux/nag f90, so we added a small
+*				     number (dp_epsilon = 1.d-10) to make sure INT operation
+*			   	     would give the correct integer.
+* 12/00  *acm*		add cal_id for alternative calendar axes
+* V541  4/02 *acm*      Improved error message if T0 missing or bad
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+*            and restore original t0 on output
+* V600 *acm* 6/05 new flag line_fixname stores whether axis name is changed on input.
+* V62  *acm* 3/09 Save original name when axis name changed on input
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V663 *acm* 6/10 Fix bug where error message on bad time axis in des file 
+*                 overflows its text buffer
+* v67  *ACM* 5/11 lengthen string for error messages: long filenames overran string
+*      *acm* 3/12 not reading GT files any more but this routine is called for MC files.
+
+* CALLING ARGUMENTS
+*	dset_num - the data set fow which a time axis is desired
+*	status  - the returning status
+	INTEGER*4	dset_num, status
+*
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+	include 'xio.cmn_text'
+	external xio_data
+
+*
+* LOCAL DEFINITIONS
+	CHARACTER*1080	string
+	CHARACTER*13	TM_STRING
+        CHARACTER*20    buff
+	INTEGER*4	scr, nsteps, istp, cpos, cpos1, bpos, bpos0,
+     .			i1, i2, i3, i4, i5, i6, iunit, nline,
+     .			nsteps_in_file,i, lenb
+	INTEGER*4	TM_FIND_LIKE_LINE
+        INTEGER         TM_LENSTR1, TM_GET_CALENDAR_ID, cal_id
+	LOGICAL		TM_FPEQ, TM_CHECK_BOX_LOC
+	REAL*8		delta, prev_lastep, itt		!*kob* 8/96
+	REAL *8		dp_epsilon			!*kob* 5/97
+	PARAMETER 	( dp_epsilon = 1.D-10)
+	PARAMETER	( scr = 0 )
+
+* Determine the length and delta of the time axis, check regularity, and find
+* first timestep
+	nsteps = 0
+	delta = 0.
+        prev_lastep = unspecified_int4
+	line_regular(scr) = .TRUE.
+	line_start(scr) = unspecified_val8
+	DO 100 istp = 1, maxstepfiles
+	  IF ( sf_setnum(istp)      .EQ. dset_num .AND.
+     .	       sf_aux_set_num(istp) .EQ. 0              ) THEN
+* kob add INT and test for sf_lastep to below calculation for linux port
+	    IF (sf_lastep(istp) .GT. 0.0D0) THEN
+	      nsteps = nsteps +
+     .		     INT((sf_lastep(istp)-sf_1step(istp))/sf_delta(istp) 
+     .               + dp_epsilon) + 1
+	    ELSE 
+	      nsteps = nsteps +
+     .		     INT((sf_lastep(istp)-sf_1step(istp))/sf_delta(istp) - 
+     .               dp_epsilon) + 1
+	    ENDIF			
+	    IF (delta .EQ. 0) THEN
+	      delta = sf_delta(istp)
+	    ELSE IF (.NOT. TM_FPEQ(SNGL(delta),SNGL(sf_delta(istp)))) THEN
+	      line_regular(scr) = .FALSE.
+            ELSE IF ( prev_lastep .NE. unspecified_int4 ) THEN  ! *sh/ko* 6/92
+               IF ( .NOT.TM_FPEQ(SNGL(delta),
+     .                           SNGL(sf_1step(istp)-prev_lastep)))
+     .              line_regular(scr) = .FALSE.
+	    ENDIF
+	    IF (line_start(scr) .EQ. unspecified_val8) 
+     .	        line_start(scr) = sf_1step(istp)
+            prev_lastep = sf_lastep(istp)
+	  ENDIF
+  100	CONTINUE
+	line_dim(scr) = nsteps
+
+	IF (line_regular(scr)) THEN
+* ... regular
+	  line_delta(scr) = delta
+	  line_subsc1(scr) = unspecified_int4
+	ELSE
+* ... irregular
+* *kob* 8/96 removed all bpos and bpos0 stuff
+	  line_start(scr)   = unspecified_val8
+	  line_delta(scr)   = unspecified_val8
+	  line_subsc1(scr) = next_line_mem_pos
+	  cpos = line_subsc1(scr)
+	  cpos1 = cpos
+	  IF ((line_subsc1(scr)+2*line_dim(scr)) .GT. maxlinestore)
+     .	     GOTO 9000
+* Create the time axis and grid box list
+* kob - 8/96 - modify so loop not based on itt (now a real) but instead on
+*		nsteps_in_file
+	  DO 120 istp = 1,maxstepfiles
+	    IF ( sf_setnum(istp) .EQ. dset_num .AND.
+     .	         sf_aux_set_num(istp) .EQ. 0         ) THEN
+	      delta = sf_delta(istp)
+*add sanity check for delta *kob* 8/96
+	      IF (delta .EQ. 0 ) delta = 1
+	      nsteps_in_file = NINT((sf_lastep(istp)-
+     .                  sf_1step(istp))/delta) + 1
+	      itt = sf_1step(istp)
+	      DO 110 i = 1,nsteps_in_file
+	        line_mem(cpos) = itt
+	        cpos = cpos+1
+		itt = itt + delta
+  110	      CONTINUE
+	    ENDIF
+  120	  CONTINUE
+	  CALL TM_IRREGAX_MID(line_subsc1(scr),line_dim(scr))
+	ENDIF
+
+* Time axis created, fill in the missing pieces
+* ... name?
+        line_fixname(scr) = .FALSE.
+        IF (line_name(scr) .EQ. 'TIME') line_fixname(scr) = .TRUE.
+	CALL TM_NEW_LINE_NAME('TIME',line_name(scr))
+	IF (line_fixname(scr)) line_name_orig(scr) = 'TIME'
+
+* ... calendar name?
+	line_cal_name(scr) = ds_cal_name(dset_num)
+
+* ...Time_step units
+	line_t0(scr)        = ds_t0time(dset_num)
+	line_tunit(scr)     = ds_time_unit(dset_num)
+	DO 130 iunit = pun_1st_time, pun_last_time
+	  IF ( line_tunit(scr) .EQ. un_convert(iunit) ) THEN
+	    line_units(scr)     = un_name(iunit)
+	    line_unit_code(scr) = iunit
+	    GOTO 140
+	  ENDIF
+  130	CONTINUE
+	line_units(scr)     = ' '
+	line_unit_code(scr) = 0
+
+* ...Set modulo
+ 140	line_modulo(scr)    = .FALSE.
+
+* ...Check if time/date string conversion is possible
+
+        cal_id = TM_GET_CALENDAR_ID (line_cal_name(scr))
+        
+        IF (line_shift_origin(scr)) THEN
+           buff = '01-JAN-0001 00:00:00'
+        ELSE
+ 	   buff = line_T0(scr)
+        ENDIF
+
+	CALL TM_BREAK_DATE( buff,cal_id,
+     .                      i1,i2,i3,i4,i5,i6,status )
+	IF ( line_tunit(scr) .LE. 0       .OR.
+     .	     line_t0(scr)    .EQ. ' '     .OR.
+     .	     status          .NE. merr_ok      ) THEN
+	  line_direction(scr) = 'NA'
+	  lenb = TM_LENSTR1 (ds_name(dset_num))
+	  WRITE (string, 1000) ds_name(dset_num)(:lenb)
+ 1000	  FORMAT 
+     .   ('missing or improper date/time format for T0 in ',A) 
+         lenb = TM_LENSTR1( string )
+         CALL TM_NOTE( string(:lenb), lunit_errors )
+
+	ELSE
+	  line_direction(scr) = 'TI'
+	ENDIF
+
+* ...Compare this with existing axis
+	CALL TM_GET_LIKE_LINE(scr,line_name(scr),nline,status)
+	IF (status .NE. merr_ok) GOTO 9200
+* ...Warn about possible gaps in axis
+* Bug fix - change next statment from compound if to if then ---kob 10/8/91
+	IF (.NOT. line_regular(nline)) THEN
+           IF (.NOT. TM_CHECK_BOX_LOC(nline) ) GOTO 9100
+        ENDIF
+!	IF (.NOT. line_regular(nline) .AND.  
+!  .	 .NOT. TM_CHECK_BOX_LOC(nline) ) GOTO 9100
+
+* Time axis complete
+	GT_GET_TIME_AXIS = nline
+	line_cal_name(scr) = 'GREGORIAN'  ! Restore to the default
+
+* If necessary - find next free line memory storage position
+	IF (.NOT. line_regular(nline))
+     .	 next_line_mem_pos = next_line_mem_pos + 2*line_dim(nline) + 1
+	status = merr_ok
+	GOTO 9999
+
+ 9000	CALL TM_ERRMSG (merr_linstorlim, status,'GT_GET_TIME_AXIS',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(maxlinestore)),
+     .			no_errstring, *9999)
+
+ 9100	CALL TM_ERRMSG (merr_badlinedef, status, 'GT_GET_TIME_AXIS',
+     .			no_descfile, no_stepfile,
+     .			'A gap or overlap exists in time axis',
+     .			no_errstring, *9999)
+
+ 9200	CALL TM_ERRMSG (merr_linelim, status, 'GT_GET_TIME_AXIS',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(max_lines)), no_errstring,
+     .			*9999)
+
+* Exit subroutine
+ 9999	RETURN
+	END
diff --git a/fmt/src/lib_free_lun.F b/fmt/src/lib_free_lun.F
new file mode 100644
index 0000000..a82857d
--- /dev/null
+++ b/fmt/src/lib_free_lun.F
@@ -0,0 +1,50 @@
+	SUBROUTINE LIB_FREE_LUN (lun)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* dummy routine for Ultrix/VMS compatibility
+* this routine is paired with LIB_GET_LUN
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* Ver 1.0 1/17/91
+
+* calling argument declarations:
+	INTEGER	lun
+
+        RETURN
+        END
diff --git a/fmt/src/lib_get_lun.F b/fmt/src/lib_get_lun.F
new file mode 100644
index 0000000..513154b
--- /dev/null
+++ b/fmt/src/lib_get_lun.F
@@ -0,0 +1,62 @@
+	SUBROUTINE LIB_GET_LUN (lun)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Find an available unit number.
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  8/28/90 - Extracted from Don Denbo's PPLUS code, 4 May 90, N. Soreide.
+*		   modified for FERRET by Steve Hankin
+* Ultrix port 1/17/91: renamed from GETUNIT to LIB_GET_LUN
+*		     - replaced status return with STOP
+*		     - replaced GOTO loop with DO loop
+
+* calling argument declarations:
+	INTEGER	lun
+
+* internal variable declarations:
+	LOGICAL lopen
+
+*  if the unit is not opened, then it is available
+*	DO 100 lun = 10, 60         ! PLOT+ conflict ???
+	DO 100 lun = 61,120
+	   INQUIRE(UNIT=lun,OPENED=lopen)
+	   IF (.NOT.lopen) RETURN
+ 100	CONTINUE
+	STOP 'insufficient IO channels: LIB_GET_LUN'
+
+	END
diff --git a/fmt/src/mc_init_dset.F b/fmt/src/mc_init_dset.F
new file mode 100644
index 0000000..0856ca9
--- /dev/null
+++ b/fmt/src/mc_init_dset.F
@@ -0,0 +1,393 @@
+	SUBROUTINE MC_INIT_DSET(dset_num,lunit,perm,tregular,use_strict,status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Initialize a multifile (cdf) dataset.
+*    - read in stepfile information from descriptor
+*    - call cd_init_dset on first file of data set to set up all 
+*      common information for the dataset, such as variables, etc
+*    - read gridfile containg time axis definition and associate the
+*      time axis with the parent grids
+*
+* *kob* 6/95  - modified from gt_init_dset.F
+* *kob*	9/96  - uncommented check for delta = 0.  This should work and should
+*		indicate a file with only one timestep in it, and therefore
+*		a possible irregular data set.  At this time, this is not
+*		implemented, and instead a message is issued which tells
+*		the user to use 1 as the delta rather than 0.  
+*
+* *kob* 9/96  - it was decided by steve and myself that this code can not
+*		handle mc data sets of netcdf files which have irregular
+*		timesteps internally.  THis is because the timesteps are
+*		never read from the netcdf files, except for the first one.
+*		This opens up a can of worms, and we decided it would 
+*		probably be best to await the netcdf-library capability to
+*		access multiple netCDF files.
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+*
+* V500 *kob* 4/99 - removed unneeded variable_record namelista
+*	*sh* 7/99 - added perm argument needed for netCDF permutations
+* V510 *sh* 3/00 - added tregular argumant
+* v581 *acm* 4/2005  Add sf_ndxs and sf_ndxe to use indices rather than timesteps
+*                     for indexing mc datasets in mc_read.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V68  *acm* 1/12- added use_strict argument for ticket 1910: micro-adjusting on 
+*                  repeated coordinates in netCDF/OPeDNAP datasets
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V682 *acm* 9/12  Fix ticket 1969: stepfiles may have 3- or 4-digit extensions 
+*                  when listed under S_NUM_OF_FILES
+
+* arguments:
+*	dset_num	- number assigned to this data set (output)
+*			  ( 1 <= dset_num <= maxdsets - see COMMON XDSET_INFO)
+*	lunit		- logical unit descriptor is opened on
+*	perm		- permutation of data (unused for MC data sets)
+*	status		- return status
+*
+* 
+* Argument definitions
+			LOGICAL tregular, use_strict
+	INTEGER		dset_num, lunit, perm(*), status
+
+* Parameter and common files
+
+	include 'tmap_errors.parm'		! error codes
+#include "tmap_dset.parm"	
+	include 'tmap_dims.parm'		! data set dimensions
+#include "gt_lib.parm"
+	include 'xio.cmn_text'
+        external xio_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xdset_info.cmn_text'		! data set common
+	external xdset_info_data
+	include 'xstep_files.cmn_text'		! step file common
+	external xstep_files_data
+
+* Define variables from Set File namelist records
+
+	include 'descript.def'
+
+
+* Internal declarations
+*	CHARACTER*18	reading_nml
+*	INTEGER*4	stp_pos, min_file, max_file, file_num,
+*     .			cnt_stp, istat
+*        INTEGER*4       upstat
+*	INTEGER		TM_GET_GRIDNUM, TM_LENSTR, STR_UPCASE
+*	REAL		last_delta, file_trange, steps_in_file
+*	LOGICAL		TM_FPEQ
+
+        CHARACTER*11    temp_t0time
+	CHARACTER*13	TM_STRING
+	CHARACTER*18	reading_nml
+	CHARACTER*64    string
+	INTEGER*4	var_cnt, var_pos, ivar, npos, bypoint, byline,
+     .			byplane, l_ivar, stp_pos, min_file, max_file,
+     .			file_num, cnt_stp, nrecperstep, epos, first_file,
+     .			file_cnt, stp_cnt, min_pos, max_pos,istat, lcnt,
+     .			lline, file_reclen, prev_steps, lenb, dot, ic
+        INTEGER*4       upstat
+	INTEGER		TM_GET_GRIDNUM, TM_LENSTR, STR_UPCASE
+	REAL*8		last_delta, file_trange, steps_in_file
+	LOGICAL		TM_FPEQ
+
+
+* record 3 - required message 
+*
+	NAMELIST /MESSAGE_RECORD/d_alert_on_open,
+     .				d_alert_on_output,d_message
+*
+*
+*
+	NAMELIST /EXTRA_RECORD/ d_extra_des_info
+*
+	NAMELIST /STEPFILE_RECORD/s_filename,s_aux_set_num,s_start,
+     .				  s_end,s_delta,s_num_of_files,
+     .				  s_regvarflag,s_index
+
+
+	reading_nml = 'MESSAGE_RECORD'
+	READ (lunit, NML=MESSAGE_RECORD, END=5000, ERR=5100)
+	ds_alert_on_open(dset_num) = d_alert_on_open
+	ds_alert_on_output(dset_num) = d_alert_on_output
+	ds_message(dset_num) = d_message
+	IF (d_alert_on_open) THEN
+	   CALL WARN ('regarding '//
+     .	      ds_name(dset_num)(:TM_LENSTR(ds_name(dset_num)))
+     .	      //' ...')
+	   CALL WARN(d_message)
+	ENDIF
+
+* Last data set record - EXTRA_RECORD
+
+	reading_nml = 'EXTRA_RECORD'
+
+	READ (lunit, NML=EXTRA_RECORD, END=5000, ERR=5100)
+*	ds_extra_des_info(dset_num) = d_extra_des_info
+
+* initialize incidental variables
+	ds_basic_axes(1,dset_num) = mpsxt
+	ds_basic_axes(2,dset_num) = mpsxu
+	ds_basic_axes(3,dset_num) = mpsyt
+	ds_basic_axes(4,dset_num) = mpsyu
+	ds_basic_axes(5,dset_num) = mpszt
+	ds_basic_axes(6,dset_num) = mpszw
+
+
+* step records - one for each step file stored
+ 
+
+	stp_pos = 1
+	min_file = maxstepfiles
+	max_file = 0
+	file_num = 0
+*	ds_regsteps(dset_num) = .TRUE.
+	last_delta = -999.
+	cnt_stp = 1
+* kob 1/97 remove space between STEPFILE_RECORD and I2 and bump I2 up to
+*        I3.  this is needed to prevent error message when more than
+*        100 stepfiles are used.
+        WRITE (reading_nml(1:18),'(''STEPFILE_RECORD'',I3)') cnt_stp
+
+* Initialize some STEPFILE variables
+	s_aux_set_num = 0
+	s_regvarflag  = ' '
+	s_index       = ' '
+	s_delta	      = 0	! *sh* 9/90
+
+        prev_steps = 0
+
+  170	READ (lunit, NML=STEPFILE_RECORD, END=5000, ERR=5100)
+
+* check to see if this is last step record
+	IF (s_filename .EQ. end_of_stepfiles) GOTO 220
+
+* Check for unsupported features
+*kob* uncommented check for delta = 0.  This should be allowed in order to
+* indicate an irregular file or a file with one timestep in it, but this is
+* not supported as of now.  9/96
+	  IF (s_regvarflag .NE. ' ') CALL TM_ERRMSG
+     .		(merr_notsupport, status, 'MC_INIT_DSET',
+     .		 dset_num, no_stepfile,
+     .		 'Descriptor requests irregular variables',
+     .		 no_errstring, *9900)
+	  IF (s_delta .EQ. 0) CALL TM_ERRMSG
+     .		(merr_notsupport, status, 'MC_INIT_DSET',
+     .		 dset_num, no_stepfile,
+     .		 'Descriptor requests delta of 0, please use 1',
+     .		 no_errstring, *9900)
+	  IF (s_index .NE. ' ') CALL TM_ERRMSG
+     .		(merr_notsupport, status, 'MC_INIT_DSET',
+     .		 dset_num, no_stepfile, 
+     .		 'Descriptor requests INDEX files', no_errstring, *9900)
+
+	cnt_stp = cnt_stp + 1
+	WRITE (reading_nml(1:18),'(''STEPFILE_RECORD '',I2)') cnt_stp
+
+* calculate time range per file and check for even number per file
+	file_trange = (s_end+s_delta-s_start)/s_num_of_files
+	IF ( s_delta .GT. 0 ) THEN
+	   steps_in_file = file_trange / s_delta 
+	   IF (ABS(steps_in_file/NINT(steps_in_file)-1.0) .GT. 1.E-6) THEN
+              WRITE (string,1100)
+ 1100         FORMAT(' WARNING - NON-INTEGER NUMBER OF STEPS PER STEPFILE'/
+     .	         ' INDICATED IN DESCRIPTOR - TRYING TO CONTINUE ANYWAY')
+              lenb = TM_LENSTR( string )
+              CALL WARN( string(:lenb) )
+	   ENDIF
+	ENDIF
+
+
+* compute how many records in each time step (with no tuples/missing vars)
+	nrecperstep= nintro_recs
+	DO 180 ivar = 1,maxvars
+	  IF (ds_var_setnum(ivar) .NE. dset_num ) GOTO 180
+	  nrecperstep= nrecperstep+ds_nrecpervar(ivar)
+  180	CONTINUE
+
+* figure out if we should read filename for file number (read P.R.G)
+	IF (s_num_of_files .GT. 1) THEN
+	  epos = TM_LENSTR(s_filename)
+	  dot = 0
+	  do ic = epos, 1, -1
+	    IF (s_filename(ic:ic) .EQ. '.') GOTO 188
+	    dot = dot + 1
+	  enddo
+  188	  CONTINUE
+          dot = epos - dot + 1
+	  READ  (s_filename(dot:epos),1200) first_file
+ 1200	  FORMAT(I3)
+	ELSE
+	  first_file = file_num+1
+	ENDIF
+
+	DO 210 file_cnt = first_file, first_file+s_num_of_files-1
+	  file_num = file_cnt
+* Find the next storage position for stepfiles in common
+	  DO 190 stp_cnt = stp_pos,maxstepfiles
+	    IF (sf_setnum(stp_cnt) .EQ. set_not_open) GOTO 200
+  190	  CONTINUE
+* No room left for new stepfiles
+	  CALL TM_ERRMSG ( merr_filim, status, 'GT_INIT_DSET',
+     .			   dset_num, no_stepfile,
+     .			   'MAX='//TM_STRING(DBLE(maxstepfiles)),
+     .			   no_errstring, *9900)
+
+* smallest file number has smallest timestep (for ds_1step)
+  200	  IF (file_cnt .LT. min_file
+     .	      .AND. s_aux_set_num .EQ. main_set) THEN
+	    min_file = file_cnt
+	    min_pos  = stp_cnt
+	  ENDIF
+* largest file number has largest timestep (for ds_lastep)
+	  IF (file_cnt .GT. max_file
+     .	      .AND. s_aux_set_num .EQ. main_set) THEN
+	    max_file = file_cnt
+	    max_pos  = stp_cnt
+	  ENDIF
+
+* store values in common
+* Modified to check for time-independance of data.  If so, the 1st and last
+*   time steps are set to unspecified_val8 -----> 6/91 kob
+          sf_reclen(stp_cnt) = file_reclen   ! *sh* 3/91
+	  sf_name  (stp_cnt) = s_filename
+          upstat = STR_UPCASE(temp_t0time,ds_t0time(dset_num))  ! kob 6/91
+	  IF (s_num_of_files .GT. 1) THEN
+	     IF (file_cnt .LE. 999) THEN
+	        WRITE (sf_name(stp_cnt)(epos-3:epos),1300) file_cnt
+ 1300	        FORMAT('.',I3.3)
+             ELSE
+	        WRITE (sf_name(stp_cnt)(dot-1:dot+3),1301) file_cnt
+ 1301	        FORMAT('.',I4.4)
+             ENDIF
+
+ 	     sf_1step(stp_cnt) = s_start +
+     .				   file_trange*(file_cnt-first_file)
+	     sf_lastep(stp_cnt) = sf_1step(stp_cnt)+file_trange-s_delta
+
+	     sf_ndxs(stp_cnt) = 1 + steps_in_file* (file_cnt-first_file)
+	     sf_ndxe(stp_cnt) = sf_ndxs(stp_cnt) + steps_in_file - 1
+
+	  ELSEIF (INDEX(temp_t0time,'INDEPENDENT') .GT. 0) THEN  !
+             sf_1step(stp_cnt) =  unspecified_val8               ! kob -            
+             sf_lastep(stp_cnt) = unspecified_val8               ! 6/91
+             sf_ndxs(stp_cnt) =  unspecified_int4          
+             sf_ndxe(stp_cnt) = unspecified_int4 
+          ELSE  
+	     sf_1step (stp_cnt) = s_start
+	     sf_lastep(stp_cnt) = s_end
+	     sf_ndxs (stp_cnt) = 1 + prev_steps
+c	     sf_ndxe(stp_cnt) = steps_in_file + sf_ndxs(stp_cnt) - 1 
+	     sf_ndxe(stp_cnt) =INT(steps_in_file+0.5)+sf_ndxs(stp_cnt)-1   ! rounding wierdness
+
+	  ENDIF
+          prev_steps = sf_ndxe(stp_cnt)
+	  sf_delta(stp_cnt) = s_delta
+	  sf_setnum(stp_cnt) = dset_num
+	  sf_aux_set_num(stp_cnt) = s_aux_set_num
+	  sf_nrecperstep(stp_cnt) = nrecperstep
+	  sf_lunit(stp_cnt) = file_not_open
+	  sf_index(stp_cnt) = s_index
+	  IF (s_regvarflag .EQ. ' ') sf_regvars(stp_cnt) = .TRUE.
+	  IF (last_delta .EQ. -999.) last_delta = s_delta
+	  IF (s_delta .NE. 0) THEN
+	    sf_regtimes(stp_cnt) = .TRUE.
+	  ELSE
+	    sf_regtimes(stp_cnt) = .FALSE.
+	  ENDIF
+* removed SNGL function from evalutating last_delta because it isn't
+* a real*8   *kob* 14apr94
+* v51 - put it back in - last_delta IS a real*8
+#ifdef double_p
+	  ds_regsteps(dset_num) = ds_regsteps(dset_num) .AND.
+     .				  sf_regtimes(stp_cnt) .AND.
+     .		     TM_FPEQ((s_delta), (last_delta))
+#else
+	  ds_regsteps(dset_num) = ds_regsteps(dset_num) .AND.
+     .				  sf_regtimes(stp_cnt) .AND.
+     .		     TM_FPEQ(SNGL(s_delta), SNGL(last_delta))
+#endif
+	  stp_pos = stp_cnt
+  210	CONTINUE
+	GOTO 170
+
+* successful completion
+  220	ds_1step(dset_num)  = SNGL(sf_1step(min_pos))
+	ds_lastep(dset_num) = SNGL(sf_lastep(max_pos))
+	IF (ds_regsteps(dset_num)) THEN
+	  ds_delstep(dset_num)  = SNGL(sf_delta(min_pos))
+	ELSE
+	  ds_delstep(dset_num) = 0.
+	ENDIF
+	status = merr_ok
+	
+
+	CALL CD_INIT_DSET( dset_num, perm, tregular, use_strict, status)
+
+	GOTO 9990
+
+
+* errors
+ 5000	CALL TM_ERRMSG (merr_nmlerr, status, 'MC_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Didn''t find: '//reading_nml,
+     .			no_errstring, *9900)
+
+ 5100	CALL TM_ERRMSG (merr_nmlerr, status, 'MC_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Error in: '//reading_nml,
+     .			no_errstring, *9900)
+
+ 5200	CALL TM_ERRMSG (merr_nmlerr, status, 'MC_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Error in stepfile names '//reading_nml,
+     .			no_errstring, *9900)
+
+* get out from error
+ 9900	CALL TM_CLOSE_SET ( dset_num, istat )
+
+* get out
+ 9990	CLOSE (UNIT = lunit)
+	CALL LIB_FREE_LUN (lunit)
+	RETURN
+	END
+
+
+
+
diff --git a/fmt/src/mc_read.F b/fmt/src/mc_read.F
new file mode 100644
index 0000000..ab3019a
--- /dev/null
+++ b/fmt/src/mc_read.F
@@ -0,0 +1,427 @@
+	SUBROUTINE MC_READ ( dset, ivar,
+     .			a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .			a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo, use_hi, stride,
+     .			var, sf_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Reads a 4D block of data (lower D being a degenerate case with dimensions
+* being 1 point thick) from a multi-file netCDF dataset
+*
+* written 8/95 by kob for pmel/tmap
+* 11/96 *kob* - Linux Port
+* 	      - replace end_read_tstep with a_hi_t as a clue for tm_subsc
+* 7/97 *kob* - fix bug in which status is not being checked
+* 5/98 *kob* - fix bug in which step files were not being properly reset after 
+*              they were closed
+* V500 5/99 *kob* - 1) fixed bug occurring when correctly setting up variable
+*	               in common
+*                   2) minor mod to only open set entire path of cdf file if it
+*                      hasn't already been opened
+*           *sh* - added strides to CD_READ call
+* V510 *sh* 3/00 - increase allowable path name length
+* v522 *kob* 12/00 - added xprog_state common file in order to check for
+*                    mode diagnostic.  only do sanity checking on step
+*                    files if mode diag is turned on.
+* v531: *kob* 5/01 - fix erroneous error reporting at label 5100
+* V552 5/03 *acm*: increase size of vname to 128 chars
+* V570 4/04 *acm* when checking which stepfile to read from, use
+*                 TM_FPEQ_TOL to see if the timestep is equal (within tolerance)
+*                 to the start or end point of any of the files.
+* V580 9/04 *acm* - Fix bug 982 If same variable name in multiple descriptor files, 
+*                   mc_init_stepfile needs to know which file its from.
+* V580 10/04*acm* - Get values for scale and offset attributes in each individual 
+*                   step file.  Values returned by RETURN=nc_offset or RETURN=nc_scale 
+*                   will return the last value used.
+* v581 *acm* 4/2005  Add sf_ndxs and sf_ndxe to use indices rather than timesteps
+*                     for indexing mc datasets in mc_read.
+* v581 *acm* 7/2005  Fix bug in getting start and end indices.
+* V600 *acm* 8/2005  fix bug 1332, calls to  CD_GET_ATTVAL and  CD_GET_ATTVAL
+*                    need cd_varid(ivar) not cd_varid as the second argument.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* include files
+        include 'netcdf.inc'
+        include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'                ! data set dimension
+#include "gt_lib.parm"
+        include 'xdset_info.cmn_text'   ! data set info common
+        external xdset_info_data
+        include 'xstep_files.cmn_text'  ! step file common
+        external xstep_files_data
+        include 'xdset_info.cd_equiv'
+        include 'xtm_grid.cmn_text'
+        include 'xprog_state.cmn'
+#ifdef sun
+        include 'xmachine_byte.cmn'
+#else
+        include 'xmachine_int1.cmn'
+#endif
+        include 'xsys_names.cmn_text'
+
+
+* arguments:
+*	dset        - internal data set # (from GT_INIT_DSET)
+*	ivar        - position in common of variable information
+*       actual_dims - "a_" full dimensions of data_grid array passed
+*	use_lo      - low indices of model data block desired
+*	use_hi      - high indices of model data block desired
+*	var         - array containing model data (output)
+*	sf_num      - stepfile number (returned from GT_FIND_TSTEP (output)
+*	status      - error status upon completion (output)
+*
+	INTEGER		dset, ivar, sf_num, status, ndim,
+     .			a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .			a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo(nferdims), use_hi(nferdims), stride(nferdims)
+	REAL		var(a_lo_x:a_hi_x,
+     .                      a_lo_y:a_hi_y,
+     .                      a_lo_z:a_hi_z,
+     .                      a_lo_t:a_hi_t,
+     .                      a_lo_e:a_hi_e,
+     .                      a_lo_f:a_hi_f)
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* local definitions
+	INTEGER*4 tmp_lo(nferdims), tmp_hi(nferdims), 
+     .            start_read_lstep,end_read_lstep,
+     .            idim,sfcnt,nsteps_to_read,
+     .            grid, cdfstat, cdfid, l_sf1,offset,
+     .            hi_offset,a_lo_t_offset,
+     .            a_hi_t_offset, vartype, nvdims,vdims(8),nvatts,
+     .		  varid, varpos,ndims,nvars, natts, recdim,
+     .            npts, var_id,index, nsteps_in_file, vlen, end_lstep
+	REAL*8	  TM_WORLD,start_tstep, end_tstep, start_read_tstep,
+     .            end_read_tstep, epsilon
+	INTEGER   TM_SUBSC, TM_LENSTR1, prev_steps
+	LOGICAL   more_to_read, TM_FPEQ, TM_DFPEQ_TOL, CD_GET_ATTVAL, 
+     .            got_scale, got_off, do_warn
+        PARAMETER (do_warn = .TRUE. )
+        CHARACTER*2048   TM_INQ_PATH, tstep_file
+	CHARACTER*128 vname
+	CHARACTER*64 dim_name
+	INTEGER*4 STR_CASE_BLIND_COMPARE
+	REAL*8 r8buff
+	CHARACTER*13    TM_STRING
+
+        epsilon = 4.E-15   ! for TM_DFPEQ_TOL
+
+	start_tstep = TM_WORLD(a_lo_t,ds_grid_number(ivar),4,box_middle)
+	end_tstep   = TM_WORLD(a_hi_t,ds_grid_number(ivar),4,box_middle)
+	start_read_lstep = a_lo_t
+        end_lstep = a_hi_t
+	start_read_tstep = start_tstep
+	do 10 idim=1, nferdims
+		tmp_lo(idim) = use_lo(idim)
+		tmp_hi(idim) = use_hi(idim)
+ 10	continue
+
+	IF (grid_line(t_dim, ds_grid_number(ivar)) .EQ. mpsnorm) THEN
+* let's open the netcdf file now
+*first make sure we have the full path set
+          tstep_file = TM_INQ_PATH( sf_name(mc_init_stepfile(dset)), 
+     .                          tmap_tsteps, ' ',
+     .                          .TRUE., status )
+           IF ( status .NE. merr_ok ) GOTO 5000
+           sf_name(mc_init_stepfile(dset)) = tstep_file     ! save exact path
+*got the full path, let's open the file now
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_OPEN_(sf_name(mc_init_stepfile(dset)), 
+     .                 NF_NOWRITE, cdfid)
+#else
+	   cdfstat = NF_OPEN(sf_name(mc_init_stepfile(dset)), 
+     .                 NF_NOWRITE, cdfid)
+#endif
+
+	   IF (cdfstat .NE. NF_NOERR) GOTO 5100
+	   sf_lunit(mc_init_stepfile(dset)) = cdfid
+
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_INQ_VAR_(cdfid, cd_varid(ivar), vname, vartype, 
+     .          nvdims, vdims, nvatts)
+#else
+	   cdfstat = NF_INQ_VAR(cdfid, cd_varid(ivar), vname, vartype, 
+     .          nvdims, vdims, nvatts)
+#endif
+
+           vlen = TM_LENSTR1(vname)
+
+           got_scale = CD_GET_ATTVAL( cdfid, cd_varid(ivar), 'scale_factor',
+     .             do_warn,vname(:vlen),cd_scale_factor(ivar),1,status )
+           got_off = CD_GET_ATTVAL( cdfid, cd_varid(ivar), 'add_offset',
+     .             do_warn,vname(:vlen),cd_add_offset(ivar),1,status )
+
+*read the data
+	   CALL CD_READ( dset, ivar,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride,
+     .		var(a_lo_x, a_lo_y, a_lo_z,
+     .		a_lo_t, a_hi_e, a_hi_f),
+     .		mc_init_stepfile(dset), status)
+
+* 7/97 - *kob* error check as in tm_choose_read.F
+	   if (status .NE. merr_ok) GOTO 5000
+
+*close the netcdf file
+	   CALL CD_CLOSE_SET( cdfid, status)
+* 7/97 - *kob* error check as in tm_choose_read.F
+	   if (status .NE. merr_ok) GOTO 5000
+*5/98 - *kob* sf_lunit needs to reflect the above cdf close
+*12/00- *kob* bug - use mc_init_stepfile not sfcnt - latter not set yet
+	   sf_lunit(mc_init_stepfile(dset)) = file_not_open
+
+	ELSE
+* find correct file
+           prev_steps = 0
+ 20	   DO 30 sfcnt = 1,maxstepfiles
+	      IF (sf_setnum(sfcnt) .NE. dset) GOTO 30 ! right dataset?
+
+c	      IF ((sf_1step(sfcnt).GT. start_read_tstep) .OR. ! contains timestep
+c     .		   (sf_lastep(sfcnt) .LT. start_read_tstep)) GOTO 30
+
+! compare indices -- contains timestep
+	      IF ((sf_ndxs(sfcnt).LE. start_read_lstep) .AND. ! contains timestep
+     .		   (sf_ndxe(sfcnt) .GE. start_read_lstep)) GOTO 40
+
+
+ 30	   CONTINUE
+*       found it
+	   
+ 40	   grid = ds_grid_number(ivar)
+	   end_read_tstep = MIN(sf_lastep(sfcnt), end_tstep)
+	   end_read_lstep = TM_SUBSC (end_read_tstep, grid, t_dim,
+     .		a_hi_t)     !kob 11/96
+	   
+* correct indices, when there are multiple timesteps in sttepfiles/
+           end_read_lstep = MIN(end_read_lstep, sf_ndxe(sfcnt) ) 
+           end_read_lstep = MAX(start_read_lstep, end_read_lstep ) 
+
+	   nsteps_to_read = end_read_lstep - start_read_lstep + 1
+	   
+* determine the index within the file to start at
+c!c! uncomment this...
+        grid = ds_grid_number(ivar)
+	l_sf1 = TM_SUBSC (sf_1step(sfcnt), grid, t_dim,l_sf1)
+
+* let's open the netcdf file now
+*first make sure we have the full path set
+* 5/99 *kob* only need to do this if the file hasn't already been opened
+	   IF (.NOT. sf_valid(sfcnt)) THEN
+	      tstep_file = TM_INQ_PATH( sf_name(sfcnt), tmap_tsteps, ' ',
+     .                          .TRUE., status )
+	      IF ( status .NE. merr_ok ) GOTO 5000
+	      sf_name(sfcnt) = tstep_file ! save exact path
+	   ENDIF
+
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_OPEN_(sf_name(sfcnt), NF_NOWRITE, cdfid) 
+#else
+	   cdfstat = NF_OPEN(sf_name(sfcnt), NF_NOWRITE, cdfid) 
+#endif
+
+	   IF (cdfstat .NE. NF_NOERR) GOTO 5100
+	   sf_lunit(sfcnt) = cdfid
+
+* Verify that this is the correct variable, and if not, set it correctly
+* in common..
+* 2/2007 Check for success of this NF_INQ_VAR call - if the previous cd_varid
+*        saved from earlier file does not exist in this stepfile, then 
+*        we want to go check the other vars in the file 
+
+#ifdef usingDODSf2cUnderscore
+	   cdfstat = NF_INQ_VAR_(cdfid, cd_varid(ivar), vname, vartype, 
+     .		nvdims, vdims, nvatts)
+#else
+	   cdfstat = NF_INQ_VAR (cdfid, cd_varid(ivar), vname, vartype, 
+     .		nvdims, vdims, nvatts)
+#endif
+	   IF ( (cdfstat .NE. NF_NOERR) .OR. 
+     .          (STR_CASE_BLIND_COMPARE ( ds_var_code(ivar), vname) 
+     .		  .NE. str_match) ) THEN
+#ifdef usingDODSf2cUnderscore
+	      cdfstat = NF_INQ_(cdfid, ndims, nvars, natts, recdim)
+#else
+	      cdfstat = NF_INQ(cdfid, ndims, nvars, natts, recdim)
+#endif
+	      do 50 varpos=1,nvars
+* 5/99 - fix bug which was sending cd_varid(varps) to NF_INQ_VAR instead of varpos
+#ifdef usingDODSf2cUnderscore
+		 cdfstat = NF_INQ_VAR_(cdfid, varpos, vname, vartype, 
+     .		      nvdims, vdims, nvatts)
+#else
+		 cdfstat = NF_INQ_VAR (cdfid, varpos, vname, vartype, 
+     .		      nvdims, vdims, nvatts)
+#endif
+*5/99 - bug fix: need to test to see if sting is EQUAL rather than not equal *kob*
+		 IF (STR_CASE_BLIND_COMPARE ( ds_var_code(ivar), 
+     .		      vname) .EQ. str_match)	THEN
+		    cd_varid(ivar) = varpos
+		    goto 60 
+		 ENDIF
+ 50	      CONTINUE
+	   ENDIF	
+ 
+ 60	   offset = sf_ndxs(sfcnt) - prev_steps - 1
+	   nsteps_in_file = sf_ndxe(sfcnt) - sf_ndxs(sfcnt) + 1 
+
+*calculate offset used to read data into array, if neccessary
+	   a_lo_t_offset = start_read_lstep - offset
+	   a_hi_t_offset = end_read_lstep - offset
+
+* 12/00 *kob* do no sanity checking unless mode diagnostic is turned
+*             on.  This necessary for dods hdf-->nc translated files
+	   IF (.NOT. mode_diagnostic) THEN
+	      sf_valid(sfcnt) = .TRUE.
+*       now verify the timestep value in the netcdf file
+	   ELSE
+	      IF (.NOT. sf_valid(sfcnt)) THEN
+#ifdef usingDODSf2cUnderscore
+		 cdfstat = NF_INQ_DIM_( cdfid, vdims(nvdims), dim_name, 
+     .                           npts )
+		 cdfstat = NF_INQ_VARID_(cdfid, dim_name, var_id)
+* *kob* had to add an ncvinq to find out variable type of dimension because
+*		 NF_FLOAT dimensions were causing core dumps. 
+		 cdfstat = NF_INQ_VAR_(cdfid, var_id, dim_name, vartype, nvdims, 
+     .      	      vdims,nvatts)
+#else
+		 cdfstat = NF_INQ_DIM( cdfid, vdims(nvdims), dim_name, 
+     .                           npts )
+		 cdfstat = NF_INQ_VARID (cdfid, dim_name, var_id)
+* *kob* had to add an ncvinq to find out variable type of dimension because
+*		 NF_FLOAT dimensions were causing core dumps. 
+		 cdfstat = NF_INQ_VAR (cdfid, var_id, dim_name, vartype, nvdims, 
+     .      	      vdims,nvatts)
+#endif
+		 CALL CD_RD_R8_1(cdfid,var_id,a_lo_t_offset,vartype,'Error',
+     .      	      r8buff,status)
+		 IF ( status .NE. merr_ok) GOTO 5000
+		 
+		 IF ( vartype .EQ. NF_DOUBLE) THEN
+#ifdef usingDODSf2cUnderscore
+		    cdfstat = NF_GET_VAR1_DOUBLE_(cdfid, var_id,
+     .      	      a_lo_t_offset,r8buff)
+#else
+		    cdfstat = NF_GET_VAR1_DOUBLE(cdfid, var_id,
+     .      	      a_lo_t_offset,r8buff)
+#endif
+		 ELSE
+		 ENDIF
+*       if an error is found, announce to user but continue on	
+#ifdef double_p
+		 IF (.NOT. TM_FPEQ((r8buff), 
+     .                        (start_read_tstep))) THEN
+#else
+		 IF (.NOT. TM_FPEQ(SNGL(r8buff), 
+     .                        SNGL(start_read_tstep))) THEN
+#endif
+		    CALL TM_ERRMSG (merr_stpmtch, status, 'MC_READ',
+     .           	 sf_setnum(sfcnt), sfcnt,
+     .  		 TM_STRING(start_read_tstep), TM_STRING(r8buff),*70)
+*Now check to make sure that the number of files in this stepfile pulled 
+*from the descriptor agree with the number of points on the time axis
+		 ELSE IF ( npts .NE. nsteps_in_file) THEN
+		    sf_valid(sfcnt) = .FALSE.
+		 ELSE
+		    sf_valid(sfcnt) = .TRUE.
+		 ENDIF
+	      ENDIF
+	   ENDIF
+* determine local start and end indices
+ 70	   tmp_lo(4) = start_read_lstep -offset
+	   tmp_hi(4) = tmp_lo(4) + (end_read_lstep - start_read_lstep)
+
+* determine local scale and offset
+           vlen = TM_LENSTR1(vname)
+
+           got_scale = CD_GET_ATTVAL( cdfid, cd_varid(ivar), 'scale_factor',
+     .             do_warn,vname(:vlen),cd_scale_factor(ivar),1,status )
+           got_off = CD_GET_ATTVAL( cdfid, cd_varid(ivar), 'add_offset',
+     .             do_warn,vname(:vlen),cd_add_offset(ivar),1,status )
+
+           cd_scaled(ivar) = got_scale .OR. got_scale
+
+* let's read the data (finally)
+	   CALL CD_READ( dset, ivar,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t_offset, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t_offset, a_hi_e, a_hi_f, 
+     .	        tmp_lo, tmp_hi, stride,
+     .	        var(a_lo_x, a_lo_y, a_lo_z,
+     .	        a_lo_t+(start_read_lstep-use_lo(4)),
+     .	        a_lo_e, a_lo_f),
+     .		sfcnt, status)
+* 7/97 - *kob* error check as in tm_choose_read.F
+	   if (status .NE. merr_ok) GOTO 5000
+	  
+*close the netcdf file
+	   CALL CD_CLOSE_SET( cdfid, status)
+* 7/97 - *kob* error check as in tm_choose_read.F
+	   if (status .NE. merr_ok) GOTO 5000
+*5/98 - *kob* sf_lunit needs to reflect the above cdf close
+	   sf_lunit(sfcnt) = file_not_open
+
+* Check to see if done reading
+	   IF (end_read_lstep .LT. a_hi_t) THEN
+	      start_read_lstep = end_read_lstep + 1
+	      start_read_tstep = TM_WORLD(start_read_lstep,
+     .        ds_grid_number(ivar),4,box_middle)
+	      GOTO 20 
+	   ENDIF
+	   
+	ENDIF
+ 200	RETURN
+
+ 5100  CALL TM_ERRMSG
+     .     ( cdfstat+pcdferr, status, 'MC_READ', unspecified_int4,
+     .     no_varid, no_errstring,
+     .     no_errstring, *5000 )
+
+
+ 5000	RETURN
+
+
+	END
+
diff --git a/fmt/src/nc.h b/fmt/src/nc.h
new file mode 100644
index 0000000..c71de8e
--- /dev/null
+++ b/fmt/src/nc.h
@@ -0,0 +1,7 @@
+/*
+ *	Copyright 1996, University Corporation for Atmospheric Research
+ *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
+ */
+/* $Id: nc.h 14336 2012-07-10 23:31:50Z ksmith $ */
+
+/* this include is not needed with current netCDF libraries. */
diff --git a/fmt/src/nc_get_attrib.F b/fmt/src/nc_get_attrib.F
new file mode 100644
index 0000000..3bfa6bf
--- /dev/null
+++ b/fmt/src/nc_get_attrib.F
@@ -0,0 +1,202 @@
+	LOGICAL FUNCTION NC_GET_ATTRIB ( dset, varid, attrib,
+     .                                   do_warn, vname, maxlen,
+     .                                   attlen, attoutflag, string, 
+     .                                   vals )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get an attribute string or values from a netCDF data structure if the attribute exists
+* 
+* Based on CD_GET_ATTRIB
+* V600 -  5/05 *acm*  Attribute handling upgrade. Rework to read information 
+*                     from data strucure rather than the netCDF file.
+*                     Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*                     Replace NCAGTC with CD_GET_VAR_ATTR
+*                     This routine now returns both character and real results,
+*                     so it replaces CD_GET_ATTVAL.
+*         6/06 *acm*  replace istat with status
+*         8/06 *acm*  test for too_long should be .GT. IF (attlen .GT. maxlen) THEN
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.85 2/13 *acm* Fix ticket 2038: making warning message for too-long string
+*      *kms*  7/13 Increased the size of errmsg to match the increased size 
+*                  of maxlen (from show_data_set_attrs); added check for
+*                  this in the future.
+
+* argument definitions:
+*	dset	 - dataset number
+*       varid    - variable id 
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*                - warnings are never issued if attribute doesn't exit
+*       vname    - name of variable owning attribute (used in error msgs)
+*       maxlen   - maximum allowable return string
+*       attlen   - length of output (string length or number of values)
+*       attoutflag- 1 if attribute to be written to output files, 0 if not
+*       string   - array in which to return result if string type
+*       vals     - array in which to return result if numerical type
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid, maxlen, attlen, attoutflag
+      CHARACTER*(*) attrib, vname, string
+      REAL          vals(*)
+      real*8        dval(100)
+
+#include "gt_lib.parm"
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+* internal variable declarations:
+      LOGICAL too_long
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ATTR,
+     .        lena, lenb, attype, status, i, dset_num, attid
+      CHARACTER*128 aname
+      INTEGER errmsglen
+      PARAMETER (errmsglen = 2048)
+      CHARACTER*(errmsglen) errmsg
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+      INTEGER slen, flen
+      PARAMETER (flen=size_rbuff)        ! size of attribute string
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)     ! c-type Hollerith string buffer
+#endif 
+
+       IF ( maxlen .GT. errmsglen ) THEN
+*         programming error; thus the STOP
+          WRITE(*,*) 'maxlen = ', maxlen, 
+     .               '; errmsglen = ', errmsglen
+          STOP 'errmsg not large enough in NC_GET_ATTRIB'
+       ENDIF
+
+       NC_GET_ATTRIB = .FALSE.
+       IF (dset .EQ. unspecified_int4) RETURN
+       IF (varid .LT. 0) RETURN
+
+* initialize
+       string(:maxlen) = ' '
+       too_long = .FALSE.
+
+* inquire about the attribute by name, using its id number
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid,
+     .                   aname, attype, attlen, attoutflag, status )
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB = .FALSE.
+         RETURN  ! doesn't exist
+      ENDIF
+
+      lena = TM_LENSTR1( aname )
+      CALL TM_FTOC_STRNG (aname(:lena), ghol, flen)
+
+* Get attribute length and value
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      attlen = maxlen  ! for strings dont want to overrun the length
+      status = NCF_GET_VAR_ATTR(dset_num, varid, ghol, fhol, attlen, dval)
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB = .FALSE.
+         attlen = 0
+         attoutflag = 0
+         RETURN  
+      ENDIF
+
+      IF ( attype.EQ.NF_CHAR ) THEN
+
+         lena = attlen
+         IF (attlen .GT. maxlen) THEN
+            fhol(maxlen) = 0
+            lena = maxlen
+            too_long = .TRUE.
+         ENDIF
+
+         CALL TM_CTOF_STRNG ( fhol, string, lena )
+
+         NC_GET_ATTRIB = .TRUE.
+         IF ( too_long ) GOTO 5000
+
+      ELSE
+
+         NC_GET_ATTRIB = .TRUE.
+         DO 80 i = 1, attlen
+  80        vals(i) = dval(i)
+
+      ENDIF
+
+      RETURN
+
+* warning exit
+
+ 5000 lenb = TM_LENSTR1( string )
+ 
+      lena = TM_LENSTR1( attrib )
+      errmsg = string(:lenb)//'"'//attrib(:lena)//
+     .             '" attribute in netCDF variable: '//vname
+      lenb = TM_LENSTR1( errmsg )
+      IF ( do_warn ) CALL TM_NOTE( errmsg(:lenb), tt )
+      IF ( do_warn .AND. too_long ) THEN
+         IF (maxlen .GE. 3) WRITE (errmsg, 1000) maxlen
+         IF (maxlen .LT. 3) WRITE (errmsg, 1001) maxlen
+1000     FORMAT ('exceeds expected length. Maximum characters: ',I4, ' ')
+1001     FORMAT ('exceeds expected length. Maximum characters: ',I2, ' ')
+         lenb = TM_LENSTR1( errmsg )
+         CALL TM_NOTE( errmsg(:lenb), tt )
+         WRITE (errmsg, 1010) maxlen
+1010     FORMAT ('--TRUNCATED TO LENGTH ',I4, '--')
+         lenb = TM_LENSTR1( errmsg )
+	 CALL TM_CTOF_STRNG( fhol, errmsg(lenb+2:maxlen), (maxlen-lenb))
+	 attlen = maxlen
+      ENDIF
+      RETURN
+
+      END
diff --git a/fmt/src/nc_get_attrib_dp.F b/fmt/src/nc_get_attrib_dp.F
new file mode 100644
index 0000000..c07d220
--- /dev/null
+++ b/fmt/src/nc_get_attrib_dp.F
@@ -0,0 +1,136 @@
+	LOGICAL FUNCTION NC_GET_ATTRIB_DP ( dset, varid, attrib,
+     .                                   do_warn, vname, attlen, 
+     .                                   attoutflag, dvals )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get double-precision attribute values from a netCDF data structure if
+* the attribute exists
+* 
+* Based on CD_GET_ATTRIB
+* V600 -  5/05 *acm*  Attribute handling upgrade. Rework to read information 
+*                     from data strucure rather than the netCDF file.
+*                     Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*                     Replace NCAGTC with CD_GET_VAR_ATTR
+*                     This routine now returns both character and real results,
+*                     so it replaces CD_GET_ATTVAL.
+*         6/06 *acm*  replace istat with status
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V63  *acm* 10/09 Changes for gfortran build
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	dset	 - dataset number
+*       varid    - variable id 
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*                - warnings are never issued if attribute doesn't exit
+*       vname    - name of variable owning attribute (used in error msgs)
+*       attlen   - length of output (string length or number of values)
+*       attoutflag- 1 if attribute to be written to output files, 0 if not
+*       dvals    - array in which to return result if numerical type
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid, attlen, attoutflag
+      CHARACTER*(*) attrib, vname
+      real*8        dvals(*)
+
+#include "gt_lib.parm"
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+* internal variable declarations:
+      LOGICAL too_long
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ATTR,
+     .        lena, lenb, attype, status, i, dset_num, attid
+      CHARACTER*128 aname
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+      INTEGER slen, flen
+      PARAMETER (flen=size_rbuff)        ! size of attribute string
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)     ! c-type Hollerith string buffer
+#endif 
+
+       NC_GET_ATTRIB_DP = .FALSE.
+       IF (dset .EQ. unspecified_int4) RETURN
+       IF (varid .LT. 0) RETURN
+
+* initialize
+       too_long = .FALSE.
+
+* inquire about the attribute by name, using its id number
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid,
+     .                   aname, attype, attlen, attoutflag, status )
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_DP = .FALSE.
+         RETURN  ! doesn't exist
+      ENDIF
+
+      lena = TM_LENSTR1( aname )
+      CALL TM_FTOC_STRNG (aname(:lena), ghol, flen)
+
+* Get attribute length and value
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_GET_VAR_ATTR(dset_num, varid, ghol, fhol, attlen, dvals)
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_DP = .FALSE.
+         attlen = 0
+         attoutflag = 0
+         RETURN  
+      ENDIF
+
+      NC_GET_ATTRIB_DP = .TRUE.
+
+      RETURN
+
+      END
diff --git a/fmt/src/nc_get_attrib_float.F b/fmt/src/nc_get_attrib_float.F
new file mode 100644
index 0000000..cf5b5de
--- /dev/null
+++ b/fmt/src/nc_get_attrib_float.F
@@ -0,0 +1,193 @@
+	LOGICAL FUNCTION NC_GET_ATTRIB_FLOAT ( dset, varid, attrib,
+     .                                   do_warn, vname, attlen, 
+     .                                   attoutflag, vals )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a float values from attribute in a netCDF data structure if the attribute exists
+* 
+* Based on CD_GET_ATTRIB
+* V600 -  5/05 *acm*  Attribute handling upgrade. Rework to read information 
+*                     from data strucure rather than the netCDF file.
+*                     Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*                     Replace NCAGTC with CD_GET_VAR_ATTR
+*                     This routine now returns both character and real results,
+*                     so it replaces CD_GET_ATTVAL.
+*         6/06 *acm*  replace istat with status
+*         8/06 *acm*  test for too_long should be .GT. IF (attlen .GT. maxlen) THEN
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* v6.85+ 12/13 *acm* take more care with string length,needed when bounds checking
+
+* argument definitions:
+*	dset	 - dataset number
+*       varid    - variable id 
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*                - warnings are never issued if attribute doesn't exit
+*       vname    - name of variable owning attribute (used in error msgs)
+*       maxlen   - maximum allowable return string
+*       attlen   - length of output (string length or number of values)
+*       attoutflag- 1 if attribute to be written to output files, 0 if not
+*       string   - array in which to return result if string type
+*       vals     - array in which to return result if numerical type
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid, attlen, attoutflag
+      CHARACTER*(*) attrib, vname
+      REAL          vals(*)
+      real*8        dval(100)
+
+#include "gt_lib.parm"
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+* internal variable declarations:
+      LOGICAL too_long
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ATTR,
+     .        maxlen, lena, lenb, attype, status, i, dset_num, attid
+      CHARACTER*128 aname, string, buff
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+      INTEGER slen, flen
+      PARAMETER (flen=size_rbuff)        ! size of attribute string
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)     ! c-type Hollerith string buffer
+#endif 
+
+       NC_GET_ATTRIB_FLOAT = .FALSE.
+       IF (dset .EQ. unspecified_int4) RETURN
+       IF (varid .LT. 0) RETURN
+
+* initialize
+       maxlen = LEN(string)
+       string(:maxlen) = ' '
+       too_long = .FALSE.
+
+* inquire about the attribute by name, using its id number
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid,
+     .                   aname, attype, attlen, attoutflag, status )
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_FLOAT = .FALSE.
+         RETURN  ! doesn't exist
+      ENDIF
+
+      lena = TM_LENSTR1( aname )
+      CALL TM_FTOC_STRNG (aname(:lena), ghol, flen)
+
+* Get attribute length and value
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      status = NCF_GET_VAR_ATTR(dset_num, varid, ghol, fhol, attlen, dval)
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_FLOAT = .FALSE.
+         attlen = 0
+         attoutflag = 0
+         RETURN  
+      ENDIF
+
+      IF ( attype.EQ.NF_CHAR ) THEN
+
+         lena = attlen
+         IF (attlen .GT. maxlen) THEN
+            fhol(maxlen) = 0
+            lena = maxlen
+            too_long = .TRUE.
+         ENDIF
+
+         CALL TM_CTOF_STRNG ( fhol, string, lena )
+         READ (string, *, err=5000) vals(1)
+
+         NC_GET_ATTRIB_FLOAT = .TRUE.
+         GOTO 5010
+
+      ELSE
+
+         NC_GET_ATTRIB_FLOAT = .TRUE.
+         DO 80 i = 1, attlen
+  80        vals(i) = dval(i)
+
+      ENDIF
+
+      RETURN
+
+* Error exit
+
+ 5000 lena = TM_LENSTR1( attrib )
+      buff = 'Unexpected attribute type: attribute "'//attrib(:lena)//
+     .       '" string instead of float, in netCDF variable: '//vname
+      lenb = TM_LENSTR1( buff )
+      CALL TM_NOTE( buff(:lenb), tt )
+
+      buff = 'Unable to convert attribute value to float "'
+     .       //string(:lenb)//'"'
+      lenb = TM_LENSTR1( buff )
+      CALL TM_NOTE( buff(:lenb), tt )
+
+      CALL TM_ERRMSG
+     .     ( status+pcdferr, status, 'NC_GET_ATTRIB_FLOAT', dset,
+     .        no_varid, no_errstring, no_errstring, *5900 )
+
+ 5900 RETURN
+
+* warning exit - converted string to float
+ 5010 lenb = TM_LENSTR1( string )
+ 
+      lena = TM_LENSTR1( attrib )
+      buff = 'Unexpected attribute type: attribute "'//attrib(:lena)//
+     .       '" string instead of float, in netCDF variable: '//vname
+      lenb = TM_LENSTR1( buff )
+      IF ( do_warn ) CALL TM_NOTE( buff(:lenb), tt )
+      RETURN
+
+      END
diff --git a/fmt/src/nc_get_attrib_string.F b/fmt/src/nc_get_attrib_string.F
new file mode 100644
index 0000000..51cb0e4
--- /dev/null
+++ b/fmt/src/nc_get_attrib_string.F
@@ -0,0 +1,195 @@
+	LOGICAL FUNCTION NC_GET_ATTRIB_STRING ( dset, varid, attrib,
+     .                                   do_warn, vname, maxlen,
+     .                                   attlen, attoutflag, string)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a string attribute from a netCDF data structure if the attribute exists
+* 
+* Based on CD_GET_ATTRIB
+* V600 -  5/05 *acm*  Attribute handling upgrade. Rework to read information 
+*                     from data strucure rather than the netCDF file.
+*                     Replace NCAINQ with CD_GET_VAR_ATT_INFO
+*                     Replace NCAGTC with CD_GET_VAR_ATTR
+*                     This routine now returns both character and real results,
+*                     so it replaces CD_GET_ATTVAL.
+*         6/06 *acm*  replace istat with status
+*         8/06 *acm*  test for too_long should be .GT. IF (attlen .GT. maxlen) THEN
+* V602  2/07 *acm* Fix bug 1492, changing attributes of coordinate variables 
+* V602 *acm* make sure lena=length of attr name is defined before writing warning
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Make sure parameters values are consistent with 
+*                              whats in netcdf.inc from netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.85 2/13 *acm* Fix ticket 2038: making warning message for too-long string
+
+* argument definitions:
+*	dset	 - dataset number
+*       varid    - variable id 
+*       attrib   - attribute to search for
+*	do_warn	 - logical flag to issue warning if invalid attribute
+*                - warnings are never issued if attribute doesn't exit
+*       vname    - name of variable owning attribute (used in error msgs)
+*       maxlen   - maximum allowable return string
+*       attlen   - length of output (string length or number of values)
+*       attoutflag- 1 if attribute to be written to output files, 0 if not
+*       string   - array in which to return result if string type
+
+* argument declarations
+      LOGICAL       do_warn
+      INTEGER	    dset, varid, maxlen, attlen, attoutflag
+      CHARACTER*(*) attrib, vname, string
+      real*8        dval(40)
+
+#include "gt_lib.parm"
+      include 'netcdf.inc'
+      include 'xio.cmn_text'
+      include 'tmap_errors.parm'
+      include 'xrisc_buff.cmn'
+
+* internal variable declarations:
+      LOGICAL too_long
+      INTEGER TM_LENSTR1, NCF_GET_VAR_ATTR,
+     .        lena, lenb, attype, status, i, dset_num, attid
+      CHARACTER*128 aname, buff
+
+      INTEGER tt  ! nice short name
+      EQUIVALENCE (tt,lunit_errors)
+
+      INTEGER slen, flen
+      PARAMETER (flen=size_rbuff)        ! size of attribute string
+#ifdef sun
+      BYTE      fhol(flen), ghol(flen)      ! c-type Hollerith string buffer
+#else
+      INTEGER*1 fhol(flen), ghol(flen)     ! c-type Hollerith string buffer
+#endif 
+
+       NC_GET_ATTRIB_STRING = .FALSE.
+       IF (dset .EQ. unspecified_int4) RETURN
+       IF (varid .LT. 0) RETURN
+
+* initialize
+       string(:maxlen) = ' '
+       too_long = .FALSE.
+
+* inquire about the attribute by name, using its id number
+
+      CALL CD_GET_VAR_ATT_ID (dset, varid, attrib, attid, status)
+      IF (attid .GT. 0) CALL CD_GET_VAR_ATT_INFO (dset, varid, attid,
+     .                   aname, attype, attlen, attoutflag, status )
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_STRING = .FALSE.
+         RETURN  ! doesn't exist
+      ENDIF
+
+      lena = TM_LENSTR1( aname )
+      CALL TM_FTOC_STRNG (aname(:lena), ghol, flen)
+
+* Get attribute length and value
+
+      dset_num = dset
+      IF (dset_num .LT. -2) dset_num = -2
+      attlen = maxlen  ! for strings dont want to overrun the length
+      status = NCF_GET_VAR_ATTR(dset_num, varid, ghol, fhol, attlen, dval)
+
+      IF ( status .NE. merr_ok ) THEN
+         NC_GET_ATTRIB_STRING = .FALSE.
+         attlen = 0
+         attoutflag = 0
+         RETURN  
+      ENDIF
+
+      IF ( attype.EQ.NF_CHAR ) THEN
+
+         lena = attlen
+         IF (attlen .GT. maxlen) THEN
+            fhol(maxlen) = 0
+            lena = maxlen
+            too_long = .TRUE.
+         ENDIF
+
+         CALL TM_CTOF_STRNG ( fhol, string, lena )
+
+         NC_GET_ATTRIB_STRING = .TRUE.
+         IF ( too_long ) GOTO 5000
+
+      ELSE
+
+         NC_GET_ATTRIB_STRING = .TRUE.
+         WRITE (string, *) (dval(i), i=1,attlen)
+         GOTO 5010
+      ENDIF
+
+      RETURN
+
+* warning exit
+
+ 5000 lenb = TM_LENSTR1( string )
+ 
+      lena = TM_LENSTR1( attrib )
+      buff = string(:lenb)//'"'//attrib(:lena)//
+     .             '" in netCDF variable: '//vname
+      lenb = TM_LENSTR1( buff )
+      IF ( do_warn ) CALL TM_NOTE( buff(:lenb), tt )
+      IF ( do_warn .AND. too_long ) THEN
+         IF (maxlen .GE. 3) WRITE (buff, 1000) maxlen
+         IF (maxlen .LT. 3) WRITE (buff, 1001) maxlen
+1000     FORMAT ('exceeds expected length. Maximum characters: ',I4, ' ')
+1001     FORMAT ('exceeds expected length. Maximum characters: ',I2, ' ')
+         lenb = TM_LENSTR1( buff )
+         CALL TM_NOTE( buff(:lenb), tt )
+         WRITE (buff, 1010) maxlen
+1010     FORMAT ('--TRUNCATED TO LENGTH ',I4, '--')
+         lenb = TM_LENSTR1( buff )
+	 CALL TM_CTOF_STRNG( fhol, buff(lenb+2:maxlen), (maxlen-lenb))
+	 
+	 attlen = maxlen
+      ENDIF
+      RETURN
+
+* Note about unexpected attribute type
+ 5010 lenb = TM_LENSTR1( string )
+ 
+      lena = TM_LENSTR1( attrib )
+      buff = 'Unexpected attribute type: attribute "'//attrib(:lena)//
+     .       '" float instead of string, in netCDF variable: '//vname
+      lenb = TM_LENSTR1( buff )
+      IF ( do_warn ) CALL TM_NOTE( buff(:lenb), tt )
+      RETURN
+
+      END
diff --git a/fmt/src/ncconfig.h b/fmt/src/ncconfig.h
new file mode 100644
index 0000000..c92246d
--- /dev/null
+++ b/fmt/src/ncconfig.h
@@ -0,0 +1,6 @@
+/* libsrc/ncconfig.h.  Generated automatically by configure.  */
+/* libsrc/ncconfig.in.  Generated automatically from configure.in by autoheader.  */
+/* $Id: ncconfig.h 14336 2012-07-10 23:31:50Z ksmith $ */
+
+
+/* this include is not needed with current netCDF libraries. */
diff --git a/fmt/src/ncio.h b/fmt/src/ncio.h
new file mode 100644
index 0000000..57174fe
--- /dev/null
+++ b/fmt/src/ncio.h
@@ -0,0 +1,7 @@
+/*
+ *	Copyright 1996, University Corporation for Atmospheric Research
+ *	See netcdf/COPYRIGHT file for copying and redistribution conditions.
+ */
+/* $Id: ncio.h 14336 2012-07-10 23:31:50Z ksmith $ */
+
+/* this include is not needed with current netCDF libraries. */
\ No newline at end of file
diff --git a/fmt/src/remote_read.F b/fmt/src/remote_read.F
new file mode 100644
index 0000000..d27e30d
--- /dev/null
+++ b/fmt/src/remote_read.F
@@ -0,0 +1,255 @@
+	SUBROUTINE REMOTE_READ ( dset_num, vname, varid,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride, gridlines, 
+     .		grid_start, grid_end, grid_order,
+     .		data_grid, baddat, file_num, status )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* REMOTE_READ from TM_READ
+* Determines if a read request for a nferdims-D block of data (3D, 2D being degenerate
+* cases w/ 1 dimension being 1 time series) from TMAP data sets contains a 
+* modulo axis. Arranges calls to CD_READ_REMOTE accordingly.
+*
+* 2/2013 Ansley Manke
+*
+* include files
+	include 'tmap_dims.parm'		! data set dimension
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'		! err code parm defs
+	include 'xtm_grid.cmn_text'		! grid info
+	include 'xdset_info.cmn_text'	! data set info common
+	external xdset_info_data
+
+* arguments:
+*	dset_num    - internal data set # (from TM_INIT_DSET)
+*	varid       - varid in ftds dataset
+*	vname       - name of desired variable in data set
+*	actual_dims - "a_" full dimensions of data_grid array passed
+*	use_dims    - indices of model data block desired
+*	data_grid   - array containing model data (output)
+*	file_num    - file number (output)
+*	status      - error status upon completion (output)
+*
+	CHARACTER*(*)	vname
+	INTEGER		dset_num, varid, file_num, status
+	INTEGER		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f, 
+     .                  a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo(*), use_hi(*), stride(*), gridlines(*), 
+     .			grid_start(*), grid_end(*), grid_order(*)
+        REAL            data_grid(a_lo_x:a_hi_x,
+     .                            a_lo_y:a_hi_y,
+     .                            a_lo_z:a_hi_z,
+     .                            a_lo_t:a_hi_t,
+     .                            a_lo_e:a_hi_e,
+     .                            a_lo_f:a_hi_f),
+     .			baddat
+
+* local definitions
+        INTEGER         STR_UPCASE, TM_LENSTR1, n, num_indices
+
+	INTEGER		lcnt, modline, pcnt, istat,
+     .			i, j, k, l, in, jn, kn, ln, vargrid, thisline,
+     .			Dstart, Dend, Drange,
+     .			Rstart, Rend, Rrange,
+     .			Tstart, Tend, Trange
+	INTEGER		i_lo, j_lo, k_lo, l_lo, m_lo, n_lo, 
+     .			i_hi, j_hi, k_hi, l_hi, m_hi, n_hi,
+     .			iadj, jadj, kadj, ladj, madj, nadj
+	INTEGER		tmp_lo(nferdims), tmp_hi(nferdims), 
+     .			adj_lo(nferdims), adj_hi(nferdims),
+     .			adj(nferdims), actual_lo(nferdims), 
+     .			actual_hi(nferdims)
+        CHARACTER*128    upcase_var
+	EQUIVALENCE	(tmp_lo(1),i_lo),
+     .			(tmp_lo(2),j_lo),
+     .			(tmp_lo(3),k_lo),
+     .			(tmp_lo(4),l_lo),
+     .			(tmp_lo(5),m_lo),
+     .			(tmp_lo(6),n_lo)
+	EQUIVALENCE	(tmp_hi(1),i_hi),
+     .			(tmp_hi(2),j_hi),
+     .	  		(tmp_hi(3),k_hi),
+     .			(tmp_hi(4),l_hi),
+     .			(tmp_hi(5),m_hi),
+     .			(tmp_hi(6),n_hi)
+	EQUIVALENCE	(adj(1),iadj),
+     .			(adj(2),jadj),
+     .			(adj(3),kadj),
+     .			(adj(4),ladj),
+     .			(adj(5),madj),
+     .			(adj(6),nadj)
+
+* initialize
+
+	actual_lo(1) = a_lo_x
+	actual_lo(2) = a_lo_y
+	actual_lo(3) = a_lo_z
+	actual_lo(4) = a_lo_t
+	actual_lo(5) = a_lo_e
+	actual_lo(6) = a_lo_f
+	actual_hi(1) = a_hi_x
+	actual_hi(2) = a_hi_y
+	actual_hi(3) = a_hi_z
+	actual_hi(4) = a_hi_t
+	actual_hi(5) = a_hi_e
+	actual_hi(6) = a_hi_f
+        upcase_var = vname
+
+* Get the bad-flag
+	CALL CD_NF_GET_BAD (dset_num, varid, baddat, status )
+
+* Is it a Modulo set - If not call CD_READ_REMOTE w/o modification
+* if it is - get the modulo line, and make sure at this time there's only 1
+* axis needing a modulo read call.
+
+	modline = 0
+	
+	DO 120 lcnt = 1,nferdims
+	  thisline = gridlines(lcnt)
+	  IF (thisline .EQ. mpsunkn .OR. thisline .EQ. mpsnorm) GOTO 120
+	  IF (line_modulo(thisline)) THEN
+
+	    IF (use_lo(lcnt) .GE. 1 .AND.
+     .         use_hi(lcnt) .LE. grid_end(lcnt)) GOTO 120
+
+	    IF (modline .NE. 0) GOTO 9100
+	    modline = lcnt
+	  ENDIF
+  120	CONTINUE
+
+	IF (modline .EQ. 0) THEN
+	  CALL CD_READ_REMOTE ( dset_num, varid,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride, grid_start, grid_end, 
+     .		grid_order,
+     .		data_grid, file_num, status )
+	  IF (status .NE. merr_ok) GOTO 9999
+
+* It's modulo : Set-up
+* D = Defining Axis    : the axis that the data is stored on
+* R = Requested Axis   : the axis requested by the user (not necessarily in the
+*                        range of the Defining axis)
+* T = Transformed Axis : the R axis translated by a MOD function so that it
+*                        starts somewhere in the Defining axis
+	ELSE
+	  Dstart = 1
+	  Drange = line_dim(gridlines(modline))
+	  Dend = Drange - Dstart + 1
+	  Rstart = use_lo(modline)
+	  Rend = use_hi(modline)
+	  Rrange = Rend - Rstart + 1
+	  Tstart = MOD(Rstart-1,Drange) + 1
+	  IF (Tstart .LE. 0) Tstart = Tstart + Drange
+	  Tend = Tstart + Rrange - 1
+	  Trange = Rrange
+
+* Read #1 - always done
+	  DO 130 pcnt = 1,nferdims
+	    tmp_lo(pcnt) = use_lo(pcnt)
+	    tmp_hi(pcnt) = use_hi(pcnt)
+	    adj_lo(pcnt) = actual_lo(pcnt)
+	    adj_hi(pcnt) = actual_hi(pcnt)
+  130	  CONTINUE
+	  tmp_lo(modline) = Tstart
+	  tmp_hi(modline) = MIN(Dend,Tend)
+	  adj_lo(modline) = actual_lo(modline) - (Rstart - Tstart)
+	  adj_hi(modline) = actual_hi(modline) - (Rstart - Tstart)
+
+	  CALL CD_READ_REMOTE ( dset_num, varid,
+     .		adj_lo(1),adj_lo(2),adj_lo(3),adj_lo(4),adj_lo(5),adj_lo(6),
+     .		adj_hi(1),adj_hi(2),adj_hi(3),adj_hi(4),adj_hi(5),adj_hi(6),
+     .		tmp_lo, tmp_hi, stride, grid_start, grid_end, 
+     .		grid_order, data_grid, file_num, status )
+	  IF (status .NE. merr_ok) GOTO 9999
+
+* Read #2 - optional depending on length & position of Requested grid
+	  IF (Tend .GT. Dend .AND. Tstart .NE. 1) THEN
+	    tmp_lo(modline) = Dstart
+	    tmp_hi(modline) = MIN(Tstart-1,Tend-Drange)
+	    adj_lo(modline) = adj_lo(modline) - Drange
+	    adj_hi(modline) = adj_hi(modline) - Drange
+	    CALL CD_READ_REMOTE ( dset_num, varid,
+     .		adj_lo(1),adj_lo(2),adj_lo(3),adj_lo(4),adj_lo(5),adj_lo(6),
+     .		adj_hi(1),adj_hi(2),adj_hi(3),adj_hi(4),adj_hi(5),adj_hi(6),
+     .		tmp_lo, tmp_hi, stride, grid_start, grid_end, 
+     .		grid_order, data_grid, file_num, status )
+	    IF (status .NE. merr_ok) GOTO 9999
+	  ENDIF
+
+* Data duplication (NOTE: tmp_lo,tmp_hi are equivalenced with i,j,k,l _lo & _hi)
+*                  (NOTE: adj is equivalenced with i,j,k,l _adj)
+	  IF (Trange .GT. Drange) THEN
+	    tmp_lo(modline) = Rstart+Drange
+	    tmp_hi(modline) = Rend
+	    DO 140 pcnt = 1,nferdims
+	      adj(pcnt) = 0
+  140	    CONTINUE
+	    adj(modline) = Drange
+	    DO 180 ln = l_lo,l_hi
+	      l = ln - ladj
+	      DO 170 kn = k_lo,k_hi
+	        k = kn - kadj
+	        DO 160 jn = j_lo,j_hi
+	          j = jn - jadj
+	          DO 150 in = i_lo,i_hi
+	            i = in - iadj
+	            data_grid(in,jn,kn,ln,-999,-999) = 
+     .			   data_grid(i,j,k,l,-999,-999)	
+  150	          CONTINUE
+  160	        CONTINUE
+  170	      CONTINUE
+  180	    CONTINUE
+	  ENDIF
+	ENDIF
+	status = merr_ok
+	GOTO 9999
+
+* ERRORS
+* note: use upcase_var instead of "variable" to avoid RISC // prob. w/ CHAR*(*)
+ 9000   l = TM_LENSTR1(upcase_var)
+	CALL TM_ERRMSG (merr_unkvar, status, 'TM_READ',
+     .			dset_num, no_stepfile,
+     .			'VAR='//upcase_var(:l), no_errstring, *9999)
+Cf77     .			'VAR='//variable, no_errstring, *9999)
+ 9100	CALL TM_ERRMSG (merr_notsupport, status, 'TM_READ',
+     .			dset_num, no_stepfile,
+     .			'only 1 axis at a time can have a modulo read',
+     .			no_errstring, *9999)
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/str_case_blind_compare.F b/fmt/src/str_case_blind_compare.F
new file mode 100644
index 0000000..36b01bb
--- /dev/null
+++ b/fmt/src/str_case_blind_compare.F
@@ -0,0 +1,64 @@
+      INTEGER FUNCTION STR_CASE_BLIND_COMPARE( str1, str2 )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* FORTRAN-coded version of VAX runtime library
+* compare two strings disregarding case differences
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.0 -  1/20/91
+* 10/96 *kob* - Linux port 
+*		- had to declare hex constants as implicit
+*		  integers in DATA statements.  Added a 
+*		  FORTRAN_90 ifdef to accomplish this. 
+*		- Needs to use IAND rather than AND
+* 06/04 *ywei* - Optimized using c: call str_case_blind_compare_sub
+* calling argument declarations:
+         CHARACTER*(*) str1, str2
+
+* local variable declarations:
+         INTEGER   compare_result
+
+         CALL str_case_blind_compare_sub(str1,LEN(str1),
+     .                                   str2,LEN(str2),
+     .                                   compare_result)
+
+         STR_CASE_BLIND_COMPARE = compare_result
+
+         RETURN
+         END
diff --git a/fmt/src/str_case_blind_compare_sub.c b/fmt/src/str_case_blind_compare_sub.c
new file mode 100644
index 0000000..2d760a7
--- /dev/null
+++ b/fmt/src/str_case_blind_compare_sub.c
@@ -0,0 +1,113 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*  ywei: 05/04 created to speed up uppercase string matching
+*/
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+void str_case_blind_compare_sub_(char* test_name,
+                            int * len_test,
+                            char* model_name, 
+                            int * len_model, 
+                            int * result)
+{
+     int i, ltest=*len_test, lmod=*len_model;
+     char c1, c2;
+
+     *result=0;
+     if(ltest<lmod){
+         for(i=0; i<ltest;i++)
+         { 
+            c1 = test_name[i];
+            c2 = model_name[i];
+
+            if(c1!=c2) {
+	       if(c1>='a' && c1<='z'){
+ 		  c1&=0xDF;
+	       }
+               if(c2>='a' && c2<='z'){
+ 		  c2&=0xDF;
+	       }
+               if(c1<c2){
+                 *result=-1;
+	         return;
+	       }
+               else if(c1>c2){
+                 *result=1;
+                 return;
+	       }
+	    }                
+         }
+
+         for(i=ltest;i<lmod;i++){
+	     if(model_name[i]!=' '){
+	        *result=-1;
+                return;
+	     }
+	 }
+     }
+     else{
+         for(i=0; i<lmod;i++)
+         { 
+            c1 = test_name[i];
+            c2 = model_name[i];
+
+            if(c1!=c2) {
+	       if(c1>='a' && c1<='z'){
+ 		  c1&=0xDF;
+	       }
+               if(c2>='a' && c2<='z'){
+ 		  c2&=0xDF;
+	       }
+               if(c1<c2){
+                 *result=-1;
+                 return;
+               }
+               else if(c1>c2){
+                 *result=1;
+		 return;
+	       }
+	    }                
+         }
+
+         for(i=lmod;i<ltest;i++){
+	     if(test_name[i]!=' '){
+	        *result=1;
+                return;
+	     }
+	 }
+     }
+     return;
+}
diff --git a/fmt/src/str_dncase.F b/fmt/src/str_dncase.F
new file mode 100644
index 0000000..d9767e4
--- /dev/null
+++ b/fmt/src/str_dncase.F
@@ -0,0 +1,64 @@
+      INTEGER FUNCTION STR_DNCASE( str_out, str_in )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert string to lowercase
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  12/1/2011
+
+      CHARACTER*(*) str_out, str_in
+
+* local variable declarations:
+      INTEGER   slenout, slenin
+
+* local parameter declarations:
+      INTEGER     SS__NORMAL
+      PARAMETER ( SS__NORMAL = 1 )
+
+* initialize
+      slenout = LEN(str_out)
+      slenin  = LEN(str_in)
+
+      CALL str_dncase_sub(str_out,slenout, str_in, slenin)
+
+* successful return always
+      STR_DNCASE = SS__NORMAL
+      RETURN
+      END
diff --git a/fmt/src/str_dncase_sub.c b/fmt/src/str_dncase_sub.c
new file mode 100644
index 0000000..450424b
--- /dev/null
+++ b/fmt/src/str_dncase_sub.c
@@ -0,0 +1,52 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+ 12/11 *acm* Created for str_dncase
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <ctype.h>
+#include <stdio.h>
+
+void str_dncase_sub_(char *out_string, int *out_len, char *in_string, int* in_len)
+{
+    int min_len =(*out_len<*in_len)?(*out_len):(*in_len);
+    int i;
+    for(i=0;i<min_len;i++)
+      out_string[i]=tolower(in_string[i]);
+    if(*out_len>*in_len)
+      for(i=*in_len;i<*out_len;i++)
+	out_string[i]=' ';
+} 
diff --git a/fmt/src/str_same.F b/fmt/src/str_same.F
new file mode 100644
index 0000000..20af5be
--- /dev/null
+++ b/fmt/src/str_same.F
@@ -0,0 +1,83 @@
+      INTEGER FUNCTION STR_SAME( str1, str2 )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* compare two strings disregarding spaces and case differences
+
+* programmer - ANsley Manke (from str_case_blind_compare) 
+*
+* revision 0.0 -  4/02/03
+
+* calling argument declarations:
+      CHARACTER*(*) str1, str2
+
+* local variable declarations:
+      INTEGER      s1, s2, e1, e2
+      CHARACTER*1  c1, c2
+
+* local parameter declarations:
+      INTEGER     STR_CASE_BLIND_COMPARE
+
+
+* local parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+      e1 = LEN(str1)
+      e2 = LEN(str2)
+
+* skip leading blanks
+
+      DO 100 s1 = 1, LEN(str1)
+         c1 = str1(s1:s1)
+         IF ( c1 .NE. ' ' .AND. c1 .NE. tab ) GOTO 200
+ 100  CONTINUE
+ 200  CONTINUE
+
+      DO 300 s2 = 1, LEN(str2)
+         c2 = str2(s2:s2)
+         IF ( c2 .NE. ' ' .AND. c2 .NE. tab ) GOTO 400
+  300 CONTINUE
+  400 CONTINUE
+
+      STR_SAME = STR_CASE_BLIND_COMPARE (str1(s1:e1), str2(s2:e2) )
+
+      RETURN
+      END
diff --git a/fmt/src/str_upcase.F b/fmt/src/str_upcase.F
new file mode 100644
index 0000000..44aedd0
--- /dev/null
+++ b/fmt/src/str_upcase.F
@@ -0,0 +1,71 @@
+      INTEGER FUNCTION STR_UPCASE( str_out, str_in )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* FORTRAN-coded version of VAX runtime library
+* convert string to uppercase
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  5/ 6/91
+* 10/96 *kob* - Linux port 
+*		- had to declare hex constants as implicit
+*		  integers in DATA statements.  Added a 
+*		  FORTRAN_90 ifdef to accomplish this. 
+*		- Needs to use IAND rather than AND
+* 06/04 *ywei* - Optimized using C: call str_upcase_sub
+* calling argument declarations:
+      CHARACTER*(*) str_out, str_in
+
+* local variable declarations:
+      INTEGER   slenout, slenin
+
+* local parameter declarations:
+      INTEGER     SS__NORMAL
+      PARAMETER ( SS__NORMAL = 1 )
+
+* initialize
+      slenout = LEN(str_out)
+      slenin  = LEN(str_in)
+
+      CALL str_upcase_sub(str_out,slenout, str_in, slenin)
+
+* successful return always
+      STR_UPCASE = SS__NORMAL
+      RETURN
+      END
diff --git a/fmt/src/str_upcase_sub.c b/fmt/src/str_upcase_sub.c
new file mode 100644
index 0000000..6d7d30e
--- /dev/null
+++ b/fmt/src/str_upcase_sub.c
@@ -0,0 +1,53 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+ 06/04 *ywei* Created to speed up str_upcase
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+#define uppercase(a) ((a>='a'&&a<='z')?((a)&0xDF):(a))
+
+void str_upcase_sub_(char *out_string, int *out_len, char *in_string, int* in_len)
+{
+    int min_len =(*out_len<*in_len)?(*out_len):(*in_len);
+    int i;
+    for(i=0;i<min_len;i++)
+      out_string[i]=uppercase(in_string[i]);
+    if(*out_len>*in_len)
+      for(i=*in_len;i<*out_len;i++)
+	out_string[i]=' ';
+} 
diff --git a/fmt/src/string_array.h b/fmt/src/string_array.h
new file mode 100644
index 0000000..a1c0084
--- /dev/null
+++ b/fmt/src/string_array.h
@@ -0,0 +1,64 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* Created to implement hash table and store string length
+ */
+
+#ifndef _STRING_ARRAY_H
+#define _STRING_ARRAY_H
+
+   struct List_Node {
+      int index;
+      struct List_Node * prev;
+      struct List_Node * next;
+   };
+   typedef struct List_Node List_Node;
+
+   struct String_Array_Header {
+      int head;
+      int array_size;
+      int string_size;
+      List_Node ** ptr_array;
+      List_Node ** hash_table;
+      char * string_array;
+      int  * strlen_array;
+   };
+   typedef struct String_Array_Header SA_Head;
+
+#define uc(a) ((a>='a'&&a<='z')?((a)&0xDF):(a))
+
+#endif /*_STRING_ARRAY.H_*/
+
diff --git a/fmt/src/string_array_clear.c b/fmt/src/string_array_clear.c
new file mode 100644
index 0000000..7f54aa9
--- /dev/null
+++ b/fmt/src/string_array_clear.c
@@ -0,0 +1,61 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to clean the allocated memory used by string_array
+                 functiions
+    4/06 *kob*  change type of argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_clear_(double * string_array_header)
+{
+    int i;
+    SA_Head * head; 
+
+    if(*(SA_Head**)string_array_header){
+       head = *((SA_Head**)string_array_header);
+       for(i=0;i<head->array_size;i++) {
+	 free(head->ptr_array[i]);
+       }
+       free(head->ptr_array);
+       free(head->hash_table);
+       free(head);
+    }
+    *string_array_header = 0;
+}
+
diff --git a/fmt/src/string_array_find.c b/fmt/src/string_array_find.c
new file mode 100644
index 0000000..f8da88f
--- /dev/null
+++ b/fmt/src/string_array_find.c
@@ -0,0 +1,119 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to find a string name in a string array fast.
+                 The matching method is equivalent to MATCH_NAME:
+                 the model name is upper-cased, the test name can be
+                 upper or lower cased
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_find_(    double *string_array_header,
+			     char *test_string,
+                             int *test_len,
+                             int *result_array,
+                             int *result_array_size,
+                             int *num_indices
+                           )
+{
+   int i,j=0;
+   int true_test_len, true_model_len, array_size, 
+       string_size, hash_value, result_array_size1;
+   SA_Head * head;
+   List_Node *bucket, *p;
+   char * model_string;
+   int match=0;
+
+ 
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+ 
+      tm_get_strlen_(&true_test_len, test_len, test_string);
+ 
+ 
+      hash_value = string_array_hash(test_string, true_test_len, 0, array_size);
+      
+
+      if(true_test_len ==0){
+	 result_array_size1 = 5;
+      }
+      else {
+	 result_array_size1 = *result_array_size;
+      } 
+
+      bucket = head->hash_table[hash_value];
+
+      for(p=bucket; p; p=p->next) {
+	  model_string=&(head->string_array[(p->index-1)*string_size]);
+          string_array_get_strlen_(string_array_header, &(p->index), &true_model_len);
+
+          match = 0;
+
+          if(true_model_len == true_test_len){
+	     match = 1;
+	     for( i=0; i<true_model_len; i++){
+		 if(test_string[i]!=model_string[i]
+                        &&uc(test_string[i])!=model_string[i]){
+		    match = 0;
+                    break;
+		 }
+	     }
+	  }
+	  
+
+          if(match==1){
+	      if(j<result_array_size1){
+		 result_array[j]=p->index;
+                 j++;
+	      }
+              else{
+                 break;
+	      }
+	  }
+      }
+   }
+   else{
+       printf("\nString array not initialized yet!");
+   }
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/string_array_find_caseblind.c b/fmt/src/string_array_find_caseblind.c
new file mode 100644
index 0000000..4b2818c
--- /dev/null
+++ b/fmt/src/string_array_find_caseblind.c
@@ -0,0 +1,116 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* Created to find a string in a string array fast.
+                The matching method is case blind.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_find_caseblind_(  double *string_array_header,
+			            char *test_string,
+                                    int *test_len,
+                                    int *result_array,
+                                    int *result_array_size,
+                                    int *num_indices
+                                  )
+{
+   int i,j=0;
+   int true_test_len, true_model_len, array_size, 
+       string_size, hash_value, result_array_size1;
+   SA_Head * head;
+   List_Node *bucket, *p;
+   char * model_string;
+   int match=0, is_quoted=0;
+
+ 
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+ 
+      tm_get_strlen_(&true_test_len, test_len, test_string);
+ 
+ 
+      hash_value = string_array_hash(test_string, true_test_len, 0, array_size);
+      
+
+      if(true_test_len ==0){
+	 result_array_size1 = 5;
+      }
+      else {
+	 result_array_size1 = *result_array_size;
+      } 
+
+      bucket = head->hash_table[hash_value];
+
+      for(p=bucket; p; p=p->next) {
+	  model_string=&(head->string_array[(p->index-1)*string_size]);
+          string_array_get_strlen_(string_array_header, &(p->index), &true_model_len);
+
+          match = 0;
+
+          if(true_model_len == true_test_len){
+	     match = 1;
+	     for( i=0; i<true_model_len; i++){
+		 if(uc(test_string[i])!=uc(model_string[i])){
+		    match = 0;
+                    break;
+		 }
+	     }
+	  }
+	  
+
+          if(match==1){
+	      if(j<result_array_size1){
+		 result_array[j]=p->index;
+                 j++;
+	      }
+              else{
+                 break;
+	      }
+	  }
+      }
+   }
+   else{
+       printf("\nString array not initialized yet!");
+   }
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/string_array_find_exact.c b/fmt/src/string_array_find_exact.c
new file mode 100644
index 0000000..303f1f9
--- /dev/null
+++ b/fmt/src/string_array_find_exact.c
@@ -0,0 +1,116 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* Created to find a string in a string array fast.
+               The matching method is exactly equal.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_find_exact_(    double *string_array_header,
+			          char *test_string,
+                                  int *test_len,
+                                  int *result_array,
+                                  int *result_array_size,
+                                  int *num_indices
+                             )
+{
+   int i,j=0;
+   int true_test_len, true_model_len, array_size, 
+       string_size, hash_value, result_array_size1;
+   SA_Head * head;
+   List_Node *bucket, *p;
+   char * model_string;
+   int match=0;
+
+ 
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+ 
+      tm_get_strlen_(&true_test_len, test_len, test_string);
+ 
+ 
+      hash_value = string_array_hash(test_string, true_test_len, 0, array_size);
+      
+
+      if(true_test_len ==0){
+	 result_array_size1 = 5;
+      }
+      else {
+	 result_array_size1 = *result_array_size;
+      } 
+
+      bucket = head->hash_table[hash_value];
+
+      for(p=bucket; p; p=p->next) {
+	  model_string=&(head->string_array[(p->index-1)*string_size]);
+          string_array_get_strlen_(string_array_header, &(p->index), &true_model_len);
+
+          match = 0;
+
+          if(true_model_len == true_test_len){
+	     match = 1;
+	     for( i=0; i<true_model_len; i++){
+		 if(test_string[i]!=model_string[i]){
+		    match = 0;
+                    break;
+		 }
+	     }
+	  }
+	  
+
+          if(match==1){
+	      if(j<result_array_size1){
+		 result_array[j]=p->index;
+                 j++;
+	      }
+              else{
+                 break;
+	      }
+	  }
+      }
+   }
+   else{
+       printf("\nString array not initialized yet!");
+   }
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/string_array_find_quoted.c b/fmt/src/string_array_find_quoted.c
new file mode 100644
index 0000000..68ff4d6
--- /dev/null
+++ b/fmt/src/string_array_find_quoted.c
@@ -0,0 +1,143 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* -Created to find a string in a string array fast.
+                The matching method is the same as MATCH_QUOTED_NAME:
+                if the test name is quoted, then match should be exact;
+                if the test name is not quoted, then the test name can
+                be case blind, but the model name should be upper-case.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_find_quoted_(  double *string_array_header,
+			         char *test_string,
+                                 int *test_len,
+                                 int *result_array,
+                                 int *result_array_size,
+                                 int *num_indices
+                           )
+{
+   int i,j=0;
+   int true_test_len, true_model_len, array_size, 
+       string_size, hash_value, result_array_size1;
+   SA_Head * head;
+   List_Node *bucket, *p;
+   char * model_string;
+   int match=0, is_quoted=0;
+
+FILE *fp;
+   
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+ 
+      tm_get_strlen_(&true_test_len, test_len, test_string);
+ 
+      if(test_string[0]=='\''
+          &&test_string[true_test_len-1]=='\''
+	  &&true_test_len>=2){
+	 is_quoted = 1;
+         true_test_len -= 2; 
+      }
+
+      if(is_quoted == 1){
+         hash_value = string_array_hash(test_string+1, true_test_len, 0, array_size);
+      }
+      else {
+         hash_value = string_array_hash(test_string, true_test_len, 0, array_size);
+      }
+
+      if(true_test_len ==0){
+	 result_array_size1 = 5;
+      }
+      else {
+	 result_array_size1 = *result_array_size;
+      } 
+
+      bucket = head->hash_table[hash_value];
+
+      for(p=bucket; p; p=p->next) {
+
+          match = 0;
+	  model_string=&(head->string_array[(p->index-1)*string_size]);
+          string_array_get_strlen_(string_array_header, &(p->index), &true_model_len);
+          if(is_quoted == 1) {
+	      if(true_model_len == true_test_len){
+		  match = 1;
+	          for( i=0; i<true_model_len; i++){
+		      if(test_string[i+1]!=model_string[i]){
+		         match = 0;
+                         break;
+		      }
+	          }
+	      }
+	  }
+          else {
+              if(true_model_len == true_test_len){
+	          match = 1;
+	          for( i=0; i<true_model_len; i++){
+		      if(test_string[i]!=model_string[i]
+                             &&uc(test_string[i])!=model_string[i]){
+		         match = 0;
+                         break;
+		      }
+	          }
+	      }
+	  }
+          if(match==1){
+	      if(j<result_array_size1){
+		 result_array[j]=p->index;
+                 j++;
+	      }
+              else{
+                 break;
+	      }
+	  }
+      }
+
+   }
+   else{
+       printf("\nString array not initialized yet!");
+   }
+  
+   *num_indices = j;
+}
+
+
diff --git a/fmt/src/string_array_get_strlen.c b/fmt/src/string_array_get_strlen.c
new file mode 100644
index 0000000..1af09a2
--- /dev/null
+++ b/fmt/src/string_array_get_strlen.c
@@ -0,0 +1,61 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* -Created to get the string length fast.
+                The function is the same as TM_LENSTR.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_get_strlen_( double * string_array_header, 
+                                int * index,
+                                int * true_strlen )
+{
+   SA_Head * head;
+  
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**) string_array_header);
+      *true_strlen = head->strlen_array[*index-1];
+   }
+   else{
+      printf("\nString array not initialized yet!");
+      *true_strlen = -1;
+   }
+}
+
+
diff --git a/fmt/src/string_array_get_strlen1.c b/fmt/src/string_array_get_strlen1.c
new file mode 100644
index 0000000..82f7f02
--- /dev/null
+++ b/fmt/src/string_array_get_strlen1.c
@@ -0,0 +1,63 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* -Created to get the string length fast.
+                The function is the same as TM_LENSTR1.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_get_strlen1_( double * string_array_header, 
+                                int * index,
+                                int * true_strlen )
+{
+   SA_Head * head;
+  
+   if(*(SA_Head**)string_array_header){
+      head = *((SA_Head**) string_array_header);
+      *true_strlen = head->strlen_array[*index-1];
+      if(*true_strlen ==0)
+         *true_strlen = 1;
+   }
+   else{
+      printf("\nString array not initialized yet!");
+      *true_strlen = -1;
+   }
+}
+
+
diff --git a/fmt/src/string_array_hash.c b/fmt/src/string_array_hash.c
new file mode 100644
index 0000000..0eb1928
--- /dev/null
+++ b/fmt/src/string_array_hash.c
@@ -0,0 +1,170 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* -Created to calculate the hash value for a string.
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+typedef  unsigned long  int  ub4;   /* unsigned 4-byte quantities */
+typedef  unsigned       char ub1;   /* unsigned 1-byte quantities */
+
+#define hashsize(n) ((ub4)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+
+
+/*
+--------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+For every delta with one or two bits set, and the deltas of all three
+  high bits or all three low bits, whether the original value of a,b,c
+  is almost all zero or is uniformly distributed,
+* If mix() is run forward or backward, at least 32 bits in a,b,c
+  have at least 1/4 probability of changing.
+* If mix() is run forward, every bit of c will change between 1/3 and
+  2/3 of the time.  (Well, 22/100 and 78/100 for some 2-bit deltas.)
+mix() was built out of 36 single-cycle latency instructions in a 
+  structure that could supported 2x parallelism, like so:
+      a -= b; 
+      a -= c; x = (c>>13);
+      b -= c; a ^= x;
+      b -= a; x = (a<<8);
+      c -= a; b ^= x;
+      c -= b; x = (b>>13);
+      ...
+  Unfortunately, superscalar Pentiums and Sparcs can't take advantage 
+  of that parallelism.  They've also turned some of those single-cycle
+  latency instructions into multi-cycle latency instructions.  Still,
+  this is the fastest good hash I could find.  There were about 2^^68
+  to choose from.  I only looked at a billion or so.
+--------------------------------------------------------------------
+*/
+
+#define mix(a,b,c) \
+{ \
+  a -= b; a -= c; a ^= (c>>13); \
+  b -= c; b -= a; b ^= (a<<8); \
+  c -= a; c -= b; c ^= (b>>13); \
+  a -= b; a -= c; a ^= (c>>12);  \
+  b -= c; b -= a; b ^= (a<<16); \
+  c -= a; c -= b; c ^= (b>>5); \
+  a -= b; a -= c; a ^= (c>>3);  \
+  b -= c; b -= a; b ^= (a<<10); \
+  c -= a; c -= b; c ^= (b>>15); \
+}
+
+/*
+--------------------------------------------------------------------
+hash() -- hash a variable-length key into a 32-bit value
+  k       : the key (the unaligned variable-length array of bytes)
+  len     : the length of the key, counting by bytes
+  initval : can be any 4-byte value
+Returns a 32-bit value.  Every bit of the key affects every bit of
+the return value.  Every 1-bit and 2-bit delta achieves avalanche.
+About 6*len+35 instructions.
+
+The best hash table sizes are powers of 2.  There is no need to do
+mod a prime (mod is sooo slow!).  If you need less than 32 bits,
+use a bitmask.  For example, if you need only 10 bits, do
+  h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (ub1 **)k, do it like this:
+  for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
+
+By Bob Jenkins, 1996.  bob_jenkins at burtleburtle.net.  You may use this
+code any way you wish, private, educational, or commercial.  It's free.
+
+See http://burtleburtle.net/bob/hash/evahash.html
+Use for hash table lookup, or anything where one collision in 2^^32 is
+acceptable.  Do NOT use for cryptographic purposes.
+--------------------------------------------------------------------
+*/
+
+int string_array_hash( k, length, initval, range)
+register ub1 *k;        /* the key */
+register ub4  length;   /* the length of the key */
+register ub4  initval;  /* the previous hash, or an arbitrary value */
+register int range;
+{
+   register ub4 a,b,c,len;
+   register int result;
+
+   /* Set up the internal state */
+   len = length;
+   a = b = 0x9e3779b9;  /* the golden ratio; an arbitrary value */
+   c = initval;         /* the previous hash value */
+
+   /*---------------------------------------- handle most of the key */
+   while (len >= 12)
+   {
+      a += (uc(k[0]) +((ub4)uc(k[1])<<8) +((ub4)uc(k[2])<<16) +((ub4)uc(k[3])<<24));
+      b += (uc(k[4]) +((ub4)uc(k[5])<<8) +((ub4)uc(k[6])<<16) +((ub4)uc(k[7])<<24));
+      c += (uc(k[8]) +((ub4)uc(k[9])<<8) +((ub4)uc(k[10])<<16)+((ub4)uc(k[11])<<24));
+      mix(a,b,c);
+      k += 12; len -= 12;
+   }
+
+   /*------------------------------------- handle the last 11 bytes */
+   c += length;
+   switch(len)              /* all the case statements fall through */
+   {
+   case 11: c+=((ub4)uc(k[10])<<24);
+   case 10: c+=((ub4)uc(k[9])<<16);
+   case 9 : c+=((ub4)uc(k[8])<<8);
+      /* the first byte of c is reserved for the length */
+   case 8 : b+=((ub4)uc(k[7])<<24);
+   case 7 : b+=((ub4)uc(k[6])<<16);
+   case 6 : b+=((ub4)uc(k[5])<<8);
+   case 5 : b+=uc(k[4]);
+   case 4 : a+=((ub4)uc(k[3])<<24);
+   case 3 : a+=((ub4)uc(k[2])<<16);
+   case 2 : a+=((ub4)uc(k[1])<<8);
+   case 1 : a+=uc(k[0]);
+     /* case 0: nothing left to add */
+   }
+   mix(a,b,c);
+   /*-------------------------------------------- report the result */
+   result = ((int)c)%range;
+   if(result <0)
+       result += range;
+   
+   return result;
+}
+
+
+
diff --git a/fmt/src/string_array_init.c b/fmt/src/string_array_init.c
new file mode 100644
index 0000000..7aa81c4
--- /dev/null
+++ b/fmt/src/string_array_init.c
@@ -0,0 +1,93 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+  06/04 *ywei* -Created to initialize data structure for a string_array
+                function group.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build*/ 
+#include <Python.h> /* make sure Python.h is first */
+#include <stddef.h>  /* size_t, ptrdiff_t; gfortran on linux rh5*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "string_array.h"
+
+void string_array_init_( double *string_array_header,
+                         int  *array_size,
+                         int  *string_size,
+                         char *string_array
+                        )
+{
+   int i,j;
+   int true_len, hash_value;
+   SA_Head * head;
+   List_Node * p;
+   
+   head = (SA_Head*)malloc(sizeof(SA_Head));
+   *((SA_Head**)string_array_header) = head;
+   head->array_size = *array_size;
+   head->string_size = *string_size;
+   head->string_array = string_array;
+
+   head->ptr_array = (List_Node**)malloc(head->array_size*sizeof(List_Node*));
+
+   head->hash_table = (List_Node**)malloc(head->array_size*sizeof(List_Node*));
+   memset((void*)head->hash_table, 0, head->array_size*sizeof(List_Node*));
+
+   head->strlen_array = (int*)malloc(head->array_size*sizeof(int));
+
+   for(j=head->array_size;j>=1;j--) {
+       tm_get_strlen_(&true_len, &(head->string_size),
+		     &(head->string_array[(j-1)*head->string_size]));
+       head->strlen_array[j-1]=true_len;
+
+       hash_value = string_array_hash(&(head->string_array[(j-1)*head->string_size]),
+                       true_len, 0, head->array_size);
+
+       head->ptr_array[j-1] = (List_Node*)malloc(sizeof(List_Node));
+       p = head->ptr_array[j-1];
+       p->index = j;
+       p->prev = NULL;
+       p->next = head->hash_table[hash_value];
+       head->hash_table[hash_value] = p;
+
+       if(p->next)
+	  p->next->prev = p;
+   }
+
+}
+
diff --git a/fmt/src/string_array_modify.c b/fmt/src/string_array_modify.c
new file mode 100644
index 0000000..c1a27cd
--- /dev/null
+++ b/fmt/src/string_array_modify.c
@@ -0,0 +1,100 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to modify a string inside a string array.
+                 This function should be used to keep the hashtable
+                 up to date.
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_modify_(    double  *string_array_header,
+                              int  *index,
+                              char *new_string,
+                              int  *new_string_size){
+
+   int true_old_str_len, true_new_str_len,
+       array_size, string_size, old_hash_value,
+       new_hash_value;
+   SA_Head * head;
+   char * old_string;
+   int i;
+   List_Node * p;
+ FILE *fp;
+
+   if(*(SA_Head**)string_array_header) {
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+
+      old_string = &(head->string_array[(*index-1)*string_size]);
+      string_array_get_strlen_(string_array_header,index, &true_old_str_len);
+      old_hash_value = string_array_hash(old_string, true_old_str_len, 0, array_size);
+
+      tm_get_strlen_(&true_new_str_len, new_string_size, new_string);
+      if(true_new_str_len>string_size)
+	true_new_str_len = string_size;
+      new_hash_value = string_array_hash(new_string, true_new_str_len, 0, array_size);
+
+      if(old_hash_value != new_hash_value){
+
+	  p = head->ptr_array[*index-1];
+          if(head->hash_table[old_hash_value]==p)
+	     head->hash_table[old_hash_value] = p->next;
+          if(p->prev)
+	     p->prev->next = p->next;
+          if(p->next)
+	     p->next->prev = p->prev;
+
+          p->prev = NULL;
+          p->next = head->hash_table[new_hash_value];
+          head->hash_table[new_hash_value] = p;
+          if(p->next)
+	     p->next->prev = p;             
+      }
+
+      for(i=0;i<true_new_str_len;i++){
+	 old_string[i] = new_string[i];
+      }
+      for(i=true_new_str_len;i<string_size;i++){
+	 old_string[i] = ' ';
+      }
+      head->strlen_array[*index-1]=true_new_str_len;
+   }
+}
+
diff --git a/fmt/src/string_array_modify_upcase.c b/fmt/src/string_array_modify_upcase.c
new file mode 100644
index 0000000..9b3f588
--- /dev/null
+++ b/fmt/src/string_array_modify_upcase.c
@@ -0,0 +1,100 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+/*
+   06/04 *ywei* -Created to modify a string inside a string array
+                 and change the string to be upper-cased.
+                 This functiion should be used to keep hashtable updated
+    4/06 *kob*  change type of 1st argument to double, for 64-bit build
+ */
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "string_array.h"
+
+void string_array_modify_upcase_(double  *string_array_header,
+                                 int  *index,
+                                 char *new_string,
+                                 int  *new_string_size){
+
+   int true_old_str_len, true_new_str_len,
+       array_size, string_size, old_hash_value,
+       new_hash_value;
+   SA_Head * head;
+   char * old_string;
+   int i;
+   List_Node * p;
+FILE *fp;
+
+   if(*(SA_Head**)string_array_header) {
+      head = *((SA_Head**)string_array_header);
+      array_size = head->array_size;
+      string_size = head->string_size;
+
+      old_string = &(head->string_array[(*index-1)*string_size]);
+      string_array_get_strlen_(string_array_header,index, &true_old_str_len);
+      old_hash_value = string_array_hash(old_string, true_old_str_len, 0, array_size);
+
+      tm_get_strlen_(&true_new_str_len, new_string_size, new_string);
+      if(true_new_str_len>string_size)
+	true_new_str_len = string_size;
+      new_hash_value = string_array_hash(new_string, true_new_str_len, 0, array_size);
+
+      if(old_hash_value != new_hash_value){
+
+	  p = head->ptr_array[*index-1];
+          if(head->hash_table[old_hash_value]==p)
+	     head->hash_table[old_hash_value] = p->next;
+          if(p->prev)
+	     p->prev->next = p->next;
+          if(p->next)
+	     p->next->prev = p->prev;
+
+          p->prev = NULL;
+          p->next = head->hash_table[new_hash_value];
+          head->hash_table[new_hash_value] = p;
+          if(p->next)
+	    p->next->prev = p;
+      }
+
+      for(i=0;i<true_new_str_len;i++){
+	 old_string[i] = uc(new_string[i]);
+      }
+      for(i=true_new_str_len;i<string_size;i++){
+	 old_string[i] = ' ';
+      }
+      head->strlen_array[*index-1]=true_new_str_len;
+   }
+}
+
diff --git a/fmt/src/tm_abstract_axis.F b/fmt/src/tm_abstract_axis.F
new file mode 100644
index 0000000..9703c44
--- /dev/null
+++ b/fmt/src/tm_abstract_axis.F
@@ -0,0 +1,70 @@
+	LOGICAL FUNCTION TM_ABSTRACT_AXIS( iaxis )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* is this an axis that is so long it only the "used" portion of its
+* length should be represented under some circumstances
+* (an "abstract" axis in FERRET)
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 6/92
+*   5/93 *sh* The axis EZ is also an "abstract" axis
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+        INTEGER iaxis
+
+* internal variable declarations:
+
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'
+
+      IF ( iaxis .LT. 1 .OR. iaxis .GT. max_lines ) THEN
+         TM_ABSTRACT_AXIS = .FALSE.
+      ELSE
+         TM_ABSTRACT_AXIS = line_name( iaxis ) .EQ. 'ABSTRACT'
+     .	               .OR. line_name( iaxis ) .EQ. 'EZ'
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/tm_add_message.F b/fmt/src/tm_add_message.F
new file mode 100644
index 0000000..dc4b78d
--- /dev/null
+++ b/fmt/src/tm_add_message.F
@@ -0,0 +1,57 @@
+	SUBROUTINE TM_ADD_MESSAGE( next_line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* append a line of text to the alternate message buffer
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* 2/28/95
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+	include 'xalt_messages.cmn_text'
+
+* calling arguments
+	CHARACTER*(*) next_line
+
+	IF ( alt_nlines.LT.max_alt_text ) THEN
+	      alt_nlines = alt_nlines + 1
+	      alt_text(alt_nlines) = next_line
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_allo_dyn_grid.F b/fmt/src/tm_allo_dyn_grid.F
new file mode 100644
index 0000000..4cf0b2b
--- /dev/null
+++ b/fmt/src/tm_allo_dyn_grid.F
@@ -0,0 +1,53 @@
+	SUBROUTINE TM_allo_dyn_grid( grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Allocate a grid from the dynamic grid area (above max_grids)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00 - guts of routine in  TM_ALLO_DYN_GRID_SUB
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+* Argument definitions
+	INTEGER grid, status
+
+	CALL TM_ALLO_DYN_GRID_SUB( max_grids, grid, status )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_allo_dyn_grid_sub.F b/fmt/src/tm_allo_dyn_grid_sub.F
new file mode 100644
index 0000000..1f7180e
--- /dev/null
+++ b/fmt/src/tm_allo_dyn_grid_sub.F
@@ -0,0 +1,104 @@
+	SUBROUTINE TM_allo_dyn_grid_sub( hook, grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Allocate a grid from the dynamic grid area (above max_grids)
+
+* The grids in xtm_grid.cmn fall into three categories (ideally they could
+* and should all be category 3, but the development was historical)
+* category 1: explicit (static) grids
+*	these are located in the low indices of the grid common
+*	(e.g. grid_name(3)).  They are created by READ_GRIDFILE, CD_*_GRIDS,
+*	and by DEFINE GRID inside Ferret.  These are the grids that are
+*	returned by TM_FIND_GRID_SLOT.
+* category 2: temporary grids
+*	these are located beginning at max_grids-1 and descending.  They have
+*	only very temporary existence during the GET_UVAR_GRID process -- as
+*	holding areas while dynamic grids (category 3) are built.
+* category 3: dynamic grids
+*	these are in the upper indices: above max_grids.  They are managed
+*	efficiently with linked lists and usage counts.  They are used by
+*	Ferret to hold "implicit" grids -- implied by expressions such as
+*	SALT[GX=U] (the SALT grid with its X axis replaced from the U grid).
+*	They are deleted as necessary to ensure that new grid definitions and
+*	changes in user variable definitions do not corrupt memory. 
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* V510 *sh* added "hook" arg so this can be used for tmp grids, too
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xio.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER hook, grid, status
+
+* Local definitions
+	INTEGER next_free_grid
+
+* take a grid from the "free" list and put it at the start of the "used" list
+	IF ( grid_free_ptr .NE. 0 ) THEN
+* ... unhook from free list
+	   grid			= grid_free_ptr
+	   next_free_grid  	= grid_flink(grid)
+	   grid_free_ptr	= next_free_grid
+* ... hook onto front of used list
+	   grid_flink(grid)	= grid_flink(hook)
+	   grid_blink(grid)	= hook
+	   grid_flink(hook)= grid
+	   grid_blink(grid_flink(grid))	= grid
+	ELSE
+	   CALL TM_ERRMSG (merr_gridlim, status,
+     .                  'TM_ALLO_DYN_GRID', no_descfile, no_stepfile,
+     .                  no_errstring, no_errstring, *9999)
+	ENDIF
+
+* signal that it is in use by a single claimant
+	grid_use_cnt(grid) = 1
+
+* successful completion
+	status = merr_ok
+ 9999	RETURN
+
+	END
diff --git a/fmt/src/tm_allo_dyn_line.F b/fmt/src/tm_allo_dyn_line.F
new file mode 100644
index 0000000..d82d2d3
--- /dev/null
+++ b/fmt/src/tm_allo_dyn_line.F
@@ -0,0 +1,54 @@
+	SUBROUTINE TM_allo_dyn_line( line, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Allocate a line from the dynamic line area (above max_lines)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00 - guts of routine in  TM_ALLO_DYN_LINE_SUB
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+
+* Argument definitions
+	INTEGER line, status
+
+	CALL TM_ALLO_DYN_LINE_SUB( max_lines, line, status )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_allo_dyn_line_sub.F b/fmt/src/tm_allo_dyn_line_sub.F
new file mode 100644
index 0000000..7c65e24
--- /dev/null
+++ b/fmt/src/tm_allo_dyn_line_sub.F
@@ -0,0 +1,112 @@
+	SUBROUTINE TM_allo_dyn_line_sub( hook, line, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Allocate a line from the dynamic line area (above max_lines)
+
+* The lines in xtm_grid.cmn fall into two categories (ideally they could
+* and should all be category 2, but the development was historical)
+* category 1: explicit (static) lines
+*	these are located in the low indices of the grid common
+*	(e.g. line_name(3)).  They are created by READ_GRIDFILE, CD_*_GRIDS,
+*	and by DEFINE AXIS inside Ferret.  These are the lines that are
+*	returned by TM_FIND_LINE_SLOT.
+* category 2: dynamic lines
+*	these are in the upper indices: above max_lines.  They are managed
+*	efficiently with linked lists and usage counts.  They are used by
+*	Ferret to hold "implicit" lines -- implied by expressions such as
+*	SALT[GX=lo:hi:del] where an X axis is implied.
+*	They are deleted as necessary to ensure that new line definitions and
+*	changes in user variable definitions do not corrupt memory. 
+* Note: there is a difference in Ferret between the management of dynamic
+* grids and axes.  Namely, **ALL GRIDS** are regarded as a single "grid pool"
+* including both dynamic and static: when a static grid exists that matches
+* a need it will be used in preference to making a dynamic grid.  This is done
+* to ensure consistency -- at all stages of variable evaluation a given
+* must be associated with the same grid.  With lines, however, the challenge
+* is tracking "who" is using any given line.  Since this is not conveniently
+* knowable (too compute intensive to figure out every time it is of interest)
+* a greater separation is created between the static and dynamic lines.  This
+* is reflected in the differences between TM_GET_LIKE_DYN_LINE and
+* TM_GET_LIKE_DYN_GRID.
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 10/3/95 for Ferret version 4.2
+* V510 *sh* added "hook" arg so this can be used for tmp lines, too
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xio.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER hook, line, status
+
+* Local definitions
+	INTEGER next_free_line
+
+* take a line from the "free" list and put it on the "used" list
+	IF ( line_free_ptr .NE. 0 ) THEN
+* ... unhook from free list
+	   line			= line_free_ptr
+	   next_free_line  	= line_flink(line)
+	   line_free_ptr	= next_free_line
+* ... hook onto front of used list
+	   line_flink(line)	= line_flink(hook)
+	   line_blink(line)	= hook
+	   line_flink(hook)     = line
+	   line_blink(line_flink(line))	= line
+	ELSE
+	   CALL TM_ERRMSG (merr_linelim, status,
+     .                  'TM_ALLO_DYN_LINE', no_descfile, no_stepfile,
+     .                  no_errstring, no_errstring, *9999)
+	ENDIF
+
+* flag it as in NOT use - its use count gets bumbed when used by a grid or
+* a child axis
+	line_use_cnt(line) = 0
+
+* successful completion
+	status = merr_ok
+ 9999	RETURN
+
+	END
diff --git a/fmt/src/tm_allo_tmp_grid.F b/fmt/src/tm_allo_tmp_grid.F
new file mode 100644
index 0000000..1e633bf
--- /dev/null
+++ b/fmt/src/tm_allo_tmp_grid.F
@@ -0,0 +1,73 @@
+	SUBROUTINE TM_allo_tmp_grid( grid, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Allocate a temporary grid from the dynamic grid area (above max_grids)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00 - guts of routine in  TM_ALLO_DYN_GRID_SUB
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xbuild_grids.cmn'
+
+* Argument definitions
+	INTEGER grid, status
+
+* Local variable definitions
+	INTEGER	idim
+
+	CALL TM_ALLO_DYN_GRID_SUB( tmp_grid_hook, grid, status )
+	IF ( status .NE. merr_ok) RETURN
+
+* initialize grid to null state
+	grid_name(grid) = char_init16
+	grid_rotation (grid) = real4_init 
+	DO 100 idim = 1, nferdims
+	   grid_line(idim,grid) = int4_init
+	   grid_out_prod(idim,grid) = .FALSE.
+ 100	CONTINUE
+
+* save a pointer to temporary name storage needed during grid creation
+	num_tmp_grids = num_tmp_grids + 1
+	tmp_nam_ptr(grid) =  num_tmp_grids
+
+	RETURN
+	END
diff --git a/fmt/src/tm_allo_tmp_line.F b/fmt/src/tm_allo_tmp_line.F
new file mode 100644
index 0000000..9a3ea2b
--- /dev/null
+++ b/fmt/src/tm_allo_tmp_line.F
@@ -0,0 +1,76 @@
+	SUBROUTINE TM_allo_tmp_line( line, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Allocate a temporary line from the dynamic line area (above max_lines)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00 - guts of routine in  TM_ALLO_DYN_LINE_SUB
+* V581*acm*  6/05 For fix to bug 1271, add flag line_shift_origin
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+	include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+
+* Argument definitions
+	INTEGER line, status
+
+	CALL TM_ALLO_DYN_LINE_SUB( tmp_line_hook, line, status )
+	IF ( status .NE. merr_ok) RETURN
+
+* initialize the line to a null content
+	line_name(line)	     = char_init16
+        line_t0(line)        = char_init20
+        line_shift_origin(line) = .FALSE.
+        line_tunit(line)     = real4_init
+        line_parent(line)    = 0
+        line_regular(line)   = .TRUE.
+        line_class(line)     =  pline_class_basic
+        line_direction(line) = 'NA'
+        line_modulo(line)    = .FALSE.
+        line_units(line)     = char_init16
+	line_unit_code(line) = int4_init
+        line_start(line)     = real8_init
+        line_delta(line)     = real8_init
+        line_dim(line)       = int4_init
+
+	line_subsc1(line)    = int4_init
+
+	RETURN
+	END
diff --git a/fmt/src/tm_alternate_note.F b/fmt/src/tm_alternate_note.F
new file mode 100644
index 0000000..1fa19c9
--- /dev/null
+++ b/fmt/src/tm_alternate_note.F
@@ -0,0 +1,73 @@
+	SUBROUTINE TM_ALTERNATE_NOTE ( string, lunit )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* send a warning message to an alternative source
+* this routine can be replaced by a routine of choice as needed
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* *sh* 2/28/95
+
+* calling argument declarations:
+        INTEGER lunit
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR1, llen
+
+* internal parameter declarations:
+        INTEGER      slen 
+        PARAMETER  ( slen = 255 )
+
+#ifdef sun
+        BYTE      fhol(slen)	! c-type Hollerith string buffer
+#else
+        INTEGER*1 fhol(slen)	! c-type Hollerith string buffer
+#endif
+
+* true string length
+	llen = TM_LENSTR1( string )
+
+* convert to a null-terminated Hollerith
+	CALL TM_FTOC_STRNG( string(:llen), fhol, slen )
+
+* send the message to the alternative destination
+	CALL FERRET_WARN_IN_WINDOW( fhol, 1 )     ! 1="append"
+
+	RETURN
+	END
diff --git a/fmt/src/tm_axes_reversed.F b/fmt/src/tm_axes_reversed.F
new file mode 100644
index 0000000..8c2dc52
--- /dev/null
+++ b/fmt/src/tm_axes_reversed.F
@@ -0,0 +1,80 @@
+	INTEGER FUNCTION TM_AXES_REVERSED( var, axes )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* return an array of length nferdims indicating containing the axes that are reversed
+* and the value of the function is the number that are reversed
+
+* ... to hide TMAP COMMON from FERRET
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V320: 2/16/94
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+
+* calling argument declarations:
+* *kob* 8/95 - changed decl. of axes from LOGICAL to INTEGER
+	INTEGER	axes(nferdims)
+	INTEGER	var
+
+* internal variable declarations
+	INTEGER	i, number
+
+* initialze
+	number = 0
+
+* check all the axes
+* note that for netCDF files the array ds_ordering contains a list of only
+* those dimensions that are relevant to the variable.  For example, the
+* variable SST, which contains axes X (1), Y (2), and T (3) would have
+* ds_ordering(1-nferdims,SST_var) = 1,2,4,0
+	DO 100 i = 1, nferdims
+	   IF ( ds_ordering(i,var) .LT. 0 ) THEN
+	      number = number + 1
+	      axes(number) = ABS(ds_ordering(i,var))
+	   ENDIF
+ 100	CONTINUE	   
+
+	TM_AXES_REVERSED = number
+
+	RETURN
+	END
diff --git a/fmt/src/tm_axis_direction.F b/fmt/src/tm_axis_direction.F
new file mode 100644
index 0000000..f739bcb
--- /dev/null
+++ b/fmt/src/tm_axis_direction.F
@@ -0,0 +1,105 @@
+	INTEGER FUNCTION TM_AXIS_DIRECTION( iaxis )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* decode the "line_direction" to a simple axis
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 3/92 for TMAP library
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* v553 6/03 *acm*  cd_read_1_axis may assign 'XX' or 'YY' to line_direction
+*                  based on value of AXIS attribute. Or DEFINE_AXIS may 
+*                  use these for non-lat/lon axes. Assign the axis the 
+*                  corresponding direction.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'
+
+* calling argument declarations:
+      INTEGER  iaxis
+
+* internal variable declarations:
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+      INTEGER STR_UPCASE, idim, istat
+      CHARACTER*1 c1, ww_dim_name(nferdims) 
+      DATA  ww_dim_name/'X','Y','Z','T','E','F'/
+      CHARACTER*2 orient
+
+* initialize
+      orient = line_direction(iaxis)
+
+* check the obvious
+      DO 100 idim = 1, nferdims
+         IF ( orient .EQ. axis_orients(idim) ) THEN
+            TM_AXIS_DIRECTION = idim
+            RETURN
+         ENDIF
+ 100  CONTINUE
+
+* other previously determined orientations
+      IF ( orient .EQ. 'UD' ) THEN
+         TM_AXIS_DIRECTION = z_dim
+      ELSEIF (orient .EQ. 'EW' ) THEN
+         TM_AXIS_DIRECTION = x_dim
+      ELSEIF (orient .EQ. 'XX' ) THEN
+         TM_AXIS_DIRECTION = x_dim
+      ELSEIF (orient .EQ. 'YY' ) THEN
+         TM_AXIS_DIRECTION = y_dim
+      ELSEIF (orient .EQ. 'TT' ) THEN
+         TM_AXIS_DIRECTION = t_dim
+      ELSE
+         TM_AXIS_DIRECTION = 0
+      ENDIF
+
+* last ditch attempt based on axis name and units
+* ACM V6.8: Dont do this! Sets ETA to an E axis for instance.
+* See ticket 1955.
+
+c      IF ( TM_AXIS_DIRECTION .EQ. 0 ) THEN
+c         istat = STR_UPCASE( c1, line_name(iaxis)(1:1) )
+c         DO 200 idim = 1, nferdims
+c 200     IF ( c1 .EQ. ww_dim_name(idim) ) TM_AXIS_DIRECTION = idim
+c      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/tm_axis_order.F b/fmt/src/tm_axis_order.F
new file mode 100644
index 0000000..eb1fc42
--- /dev/null
+++ b/fmt/src/tm_axis_order.F
@@ -0,0 +1,297 @@
+	SUBROUTINE TM_AXIS_ORDER( lines_n, user_perm, order, ndim, vname )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* based on 1 to lines_n axes pointed to by lines_n try to determine how to place
+* this object in lines_n dimensional space
+* e.g. if the axes are X,Y and T then slot 3 should probably be NORMAL
+* suppose further that axis 2 has no units or clues to its orientation
+* then our problem is to map  3 dimensions "XNT" to an ordering of 1240
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 3/92 for TMAP library
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* V500 *sh*  6/99 - added user_perm (permutation) input argument allowing the
+*		user to coach this routine on the ordering of the axes
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+        include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'
+        include 'xio.cmn_text'
+        include 'xrisc_buff.cmn'
+
+        INTEGER tt  ! nice short name
+        EQUIVALENCE (tt,lunit_errors)
+
+* calling argument declarations:
+      INTEGER lines_n(nferdims), user_perm(nferdims), order(nferdims), ndim
+      CHARACTER*(*) vname
+
+* internal variable declarations:
+!      LOGICAL TM_FIRM_AXIS_ORIENT, present
+      LOGICAL var_perm
+      INTEGER TM_AXIS_DIRECTION, idim, lasdim, vlen, mdim, nuser,
+     .	      ax1, firm_dim, orient, i, ii, perm(nferdims), 
+     .	      new1, reorder(nferdims), imin, imax
+
+* initialize
+      DO 10 idim = 1, nferdims
+ 10   order(idim) = unspecified_int4
+      mdim =  MIN(nferdims, ndim)
+
+* number of user-specified axes?
+	nuser = 0
+	DO 20 idim = 1, nferdims
+	   IF (user_perm(idim) .NE.unspecified_int4) THEN
+	      nuser = nuser + 1
+	   ELSE
+	      GOTO 30
+	   ENDIF
+ 20	CONTINUE
+
+
+* nothing happens here!
+* arguably, one should permute the negatives so that they refer to
+* the axis in the file, rather than the axis in memory. But it was too
+* big a hassle (*sh*)
+ 30	DO 36 idim = 1, nferdims
+ 36	perm(idim) = user_perm(idim)
+
+
+	IF (nuser .EQ. 0) THEN
+	   ax1 = 0+1    ! user specified no axis orientations (typical)
+	ELSE
+
+****** user-specified axis order ******
+
+	   IF (nuser .EQ. mdim) THEN
+* ... all axes were specified by the user e.g. /ORDER=YXT for a 3D grid
+	      DO 50 idim = 1, mdim
+ 50	      order(idim) = perm(idim)
+	      ax1 = mdim + 1
+	   ELSEIF (nuser .LT. mdim) THEN
+* ... user gave list shorter than mdim -- apply list to initial axes
+*     e.g. /ORDER=YX on an XYT grid will first process X and Y
+	      DO 60 idim = 1, nuser
+ 60	      order(idim) = perm(idim)
+* ... now map the remaining axes
+* ... first map self-oriented axes if they match an unused orientation
+	      DO 62 idim = nuser+1, mdim
+	         orient = TM_AXIS_DIRECTION(lines_n(idim))
+	         IF (orient .NE. 0) THEN
+	            DO 61 i = 1, mdim
+ 61		    IF (ABS(order(i)).EQ.orient) GOTO 62
+	            nuser = nuser + 1
+	            order(nuser) = orient
+	         ENDIF
+ 62	      CONTINUE
+* ... then map any remaining axes to any unused orientations
+	      DO 66 idim = nuser+1, mdim
+* ... find unused orientation
+	         DO 64 orient = 1, nferdims
+	            DO 63 i = 1, idim
+ 63		    IF (ABS(order(i)) .EQ. orient) GOTO 64 ! in use
+		    GOTO 65   ! found a free one
+ 64		 CONTINUE
+	         CONTINUE   ! should never get here !!!
+* ... assign axis
+ 65		 order(idim) = orient
+ 66	      CONTINUE
+	      ax1 = mdim + 1
+	   ELSE
+* ... user gave list longer than mdim ... how to use this info? (messy)     
+*     e.g. /ORDER=YXT on a 2D grid of "?T" orientation should map to XT
+* ==> just use as much of the users mapping as applies
+	      DO 70 idim = 1, mdim
+ 70	      order(idim) = perm(idim)
+	      ax1 = mdim + 1
+
+!* this block of logic abandoned as making Ferret "too intellligent"
+!* because it has imperfection. For example /ORDER=TXYZ given for a
+!* firmly XYT grid maps to "XYZ" because Ferret identifies the "X" axis
+!* as "firm" first off
+!
+!*     Step 1: find the first axis of the grid whose orientation is
+!*     known with high certainty. Try to map this to a user-given axis
+!	      DO 76 firm_dim = 1, mdim
+!	         IF (TM_FIRM_AXIS_ORIENT(lines_n(firm_dim), orient)) THEN
+!*     ... check that this orientation is in the users list
+!	            DO 72 idim = 1, nuser 
+!	               IF (orient .EQ. ABS(perm(idim))) THEN
+!*     ... check that this orientation is possible to work with
+!*         e.g.  /ORDER=YXT with lines_n(1) of 2D grid matching "T" is bad
+!*	                or with lines_n(2) of 2D grid matching "Y" is bad
+!	                  IF ( (nuser-idim).GE.(mdim-firm_dim)
+!     .			 .AND.  idim .GE. firm_dim ) GOTO 80
+!	               ENDIF
+! 72		    CONTINUE
+!	         ENDIF
+! 76	      CONTINUE
+!*     ... nothing firmly known. Just start from first axis
+!	      firm_dim = 1
+!	      idim = 1
+!*     Step 2: map the orientations to the left and right of firm_dim
+! 80	      order(firm_dim) = perm(idim)
+!	      DO 84 i = firm_dim-1,1,-1
+! 84	      order(i) = perm(idim-(firm_dim-i))
+!	      DO 86 i = firm_dim+1,mdim
+! 86	      order(i) = perm(idim-(firm_dim-i))
+!	      ax1 = mdim + 1
+
+	   ENDIF
+	ENDIF
+
+****** automatic determination of axis order ******
+
+* ... pass 1:  e.g. map to 1 0 4 -111
+      imax = 0
+      imin = nferdims
+      DO 100 idim = ax1, mdim
+         order(idim) = TM_AXIS_DIRECTION(lines_n(idim))
+	 imax = MAX(imax, order(idim))
+	 IF (order(idim).GT.0) imin = MIN(imin, order(idim))
+ 100  CONTINUE
+* ..  pass 2: e.g. map "N" to "Y" to give 1 2 4 0
+
+* ..  Is there a dimension before the x dimension?
+*     If so create a permutation.
+
+      IF ( imax.GT.0 .AND. imin.EQ.1 .AND. order(1).EQ.0 ) THEN
+         var_perm = imax.GT.0 .AND. imin.EQ.1
+         IF (mdim .EQ. 2) THEN  ! simple case, put the dimension in slot 1.
+	    order(1) = MOD(imax,nferdims) + 1
+	    GOTO 160
+	 ENDIF
+
+         lasdim = 0  ! more than 2 dims, keep the order, put dimension afterwards.
+         DO 110 idim = 2, nferdims
+	    IF (order(idim) .EQ. unspecified_int4) THEN 
+	       order(idim) = MOD(imax,nferdims) + 1
+	       new1 = idim-1
+	       GOTO 120
+	    ENDIF
+ 110     CONTINUE
+ 120     CONTINUE
+         
+         DO 130 idim = ax1, mdim
+	    reorder(idim) = order(new1)
+	    new1 = new1 + 1
+	    IF (order(new1) .EQ. unspecified_int4 .OR. 
+     .          new1 .EQ. nferdims) new1 = 1
+	    IF (order(new1) .EQ. 0) new1 = new1 + 1
+ 130     CONTINUE
+         DO 140 idim = mdim+1, nferdims
+	    reorder(idim) = unspecified_int4
+ 140     CONTINUE
+         DO 150 idim = 1, nferdims
+	    order(idim) = reorder(idim)
+ 150     CONTINUE
+
+      ENDIF
+
+ 160  CONTINUE
+
+      lasdim = 0
+      DO 200 idim = 1, nferdims
+         IF ( order(idim).EQ.0 ) THEN
+*     need to use MOD to prevent more than nferdims dimensions...*kob* 5/02
+            lasdim = MOD(lasdim,nferdims) + 1
+            IF (var_perm) lasdim = MOD(imax,nferdims) + 1
+            order(idim) = lasdim
+         ELSEIF (order(idim).NE.unspecified_int4 ) THEN
+            lasdim = ABS(order(idim))
+         ELSE
+            order(idim) = 0
+         ENDIF
+ 200  CONTINUE
+
+* ... pass 3: if out of order (e.g. YXT given) a problem
+*             ==> remap to most basic
+* 6/99 - only REPEATED axes are a problem -- permutations OK
+      lasdim = 0
+      DO 310 idim = 1, nferdims
+	 DO 300 i = 1, idim-1
+            IF ( order(i) .NE. 0
+     .     .AND. ABS(order(i)) .EQ. ABS(order(idim)) ) GOTO 500
+ 300	 CONTINUE
+ 310  CONTINUE
+
+
+* remap the lines_n array to match TMAP nferdims-dimensional ordering instead of
+* netCDF file ordering. For example, change an XYT grid from current
+* line1, line2, line4, unspecified to line1, line2, unspecified, line4
+!	i = mdim
+!	DO 410 idim = nferdims, 1, -1
+!* ... is this axis present in the grid
+!	   present = .FALSE.
+!	   DO 400 ii = 1, nferdims
+!	      IF (ABS(order(ii)) .EQ. idim) present = .TRUE.
+! 400	   CONTINUE
+!	   IF (present) THEN
+!	      lines_n(idim) = lines_n(i)
+!	      i = i - 1
+!	   ELSE
+!	      lines_n(idim) = unspecified_int4
+!	   ENDIF
+! 410	CONTINUE
+
+* success
+      RETURN
+
+* failure - select most basic order
+ 500  DO 600 idim = 1, nferdims
+         IF ( idim .LE. mdim ) THEN
+            order(idim) = idim
+         ELSE
+            order(idim) = 0
+         ENDIF
+ 600  CONTINUE
+
+* sound a warning horn
+      risc_buff = vname
+      vlen = LEN(vname)
+      CALL TM_NOTE( 'Unspecified or unsupported ordering of axes in variable '
+     .               //risc_buff(:vlen), tt )
+      CALL TM_NOTE( 'The default ordering will be used', tt )
+
+      RETURN
+      END
diff --git a/fmt/src/tm_axis_recursive.F b/fmt/src/tm_axis_recursive.F
new file mode 100644
index 0000000..0f5a9ef
--- /dev/null
+++ b/fmt/src/tm_axis_recursive.F
@@ -0,0 +1,55 @@
+	LOGICAL FUNCTION TM_AXIS_RECURSIVE (axis)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return flag indicating if the parent axis definition is required in order
+* to evaluate coordinates on this axis
+
+
+* V533 *sh* 6/01
+
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+
+* internal variable declarations
+
+	TM_AXIS_RECURSIVE = line_parent(axis) .NE.0
+     .		      .AND. .NOT.line_regular(axis)
+
+	RETURN
+	END
diff --git a/fmt/src/tm_axis_stride.F b/fmt/src/tm_axis_stride.F
new file mode 100644
index 0000000..7951927
--- /dev/null
+++ b/fmt/src/tm_axis_stride.F
@@ -0,0 +1,73 @@
+	INTEGER FUNCTION TM_AXIS_STRIDE (axis, i1)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return the "stride" value and starting index for an axis that is the
+* child of another
+
+* V533 *sh* 6/01
+
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis, i1
+
+* internal variable declarations
+	REAL	parent_delta
+
+	IF ( line_class(axis) .EQ. pline_class_stride ) THEN
+
+	   IF ( line_regular(axis) ) THEN
+	      parent_delta = line_delta(line_parent(axis))
+	      TM_AXIS_STRIDE = INT( 1.001 * line_delta(axis)/
+     .			                    parent_delta )
+	      i1 = INT( 1.001 *
+     .			(line_start(axis) - line_start(line_parent(axis))) / 
+     .			parent_delta ) + 1
+	   ELSE
+	      TM_AXIS_STRIDE = INT( line_delta(axis) )
+	      i1 = INT( line_start(axis) )
+	   ENDIF
+
+	ELSE
+
+	   TM_AXIS_STRIDE = 1
+	   i1 = 1
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_blockify_ferret_strings.c b/fmt/src/tm_blockify_ferret_strings.c
new file mode 100644
index 0000000..cbb93b6
--- /dev/null
+++ b/fmt/src/tm_blockify_ferret_strings.c
@@ -0,0 +1,77 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+    The variable mr_blk1 is an array of pointers to strings
+    where the string pointers are spaced 8 bytes apart.
+
+    The variable pblock is a bufsiz-long character array of
+    string data (to be assigned) where each string uses
+    outstrlen characters and is null terminated if shorter
+    than outstrlen characters.
+
+    This function copies the strings from mr_blk1 to pblock.
+*/
+
+void tm_blockify_ferret_strings(char **mr_blk1, char *pblock,
+				int bufsiz, int outstrlen)
+{
+  int i;
+  char *poutchar, *poutstr, *pinchar, **pinstr;
+
+  /* prefill the output buffer with nulls 
+     *kob*  fix i<= bufsize bug - corrupted heap */
+  for (i=0; i<bufsiz; i++)
+     pblock[i] = '\0';
+
+  /* copy all the strings */
+  pinstr = mr_blk1;  /* points to each input  string in turn */
+  poutstr = pblock;   /* points to each output string in turn */
+  for (i=0; i<bufsiz/outstrlen; i++) {
+    poutchar = poutstr;             /* point to output characters  */
+    pinchar  = *pinstr;              /* point to input  characters  */
+    poutstr += outstrlen;           /* point to next output string */
+    pinstr += (8/sizeof(char**));   /* point to next input  string */
+
+    /* copy 1 string ... possibly truncated */
+    while ( (poutchar < poutstr) && (*pinchar != '\0') ) {
+      *poutchar = *pinchar;
+      poutchar++;
+      pinchar ++;
+    }
+
+  }
+
+}
diff --git a/fmt/src/tm_break_date.F b/fmt/src/tm_break_date.F
new file mode 100644
index 0000000..7d2b012
--- /dev/null
+++ b/fmt/src/tm_break_date.F
@@ -0,0 +1,313 @@
+	SUBROUTINE TM_BREAK_DATE (date, cal_id, year, month, day,
+     .				  hour, minute, second, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will take date string composed of DD-MMM-YYYY:HH:MM:SS with optional format:
+* DD-MMM:HH:MM:SS and break it up to it's various components.
+*
+* written 06/17/87 by Mark Verschell for PMEL/TMAP
+*
+* revision 0.00 - 06/17/87 - Initial Incarnation
+* revision 1.00 - 07/07/88 - More conclusive checking of date, bad dates are
+*			     trapped and flagged as errors
+* revision 1.01 - 01/13/89 - Allows : between day and time parts now
+* revision 1.10 - 02/08/89 - Allows year to be left off - defaults to 0000
+* revision 1.11 - 02/13/89 - Allows multiple blanks between date and hour
+* revision 1.12 - 02/20/89 - Allows dates of form "dd-mmm" - defaults to 0000
+* 3/22/95 - check for non-positive DAY value as an error
+* V530: *acm* 12/00 alternative calendar types; cal_id
+* V63  *acm* 10/09 Changes for gfortran build
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* ARGUMENT DEFINITIONS
+*  date  - date to process
+*  day, month, year, hour, minute, second - obvious
+*  status - returned status
+	CHARACTER*(*)	date
+	INTEGER*4	day, month, year, hour, minute, second, status,
+     .                  cal_id
+*
+* INCLUDE FILES
+	include 'tmap_errors.parm'
+        include 'calendar.decl'
+        include 'calendar.cmn'
+#include "gt_lib.parm"
+*
+* LOCAL DEFINITIONS
+	CHARACTER*20	fill_in
+	INTEGER*4	out_state(7,22), in_state, pos, istat, leapadj
+	INTEGER*4	STR_CASE_BLIND_COMPARE, Class
+	REAL		yeardays
+
+* Table gives output state based on input state (right hand column)
+*	A = alphabetic	N = numeric	b = blank	- = minus sign
+*	: = colon	* = asterik	E = end of date
+*		            A   N   b   -   :   *   E
+	DATA	out_state / 02, 03, 01, 24, 24, 24, 24,			! 1
+     .			    04, 24, 24, 24, 24, 24, 24,			! 2
+     .			    24, 09, 24, 10, 24, 24, 24,			! 3
+     .			    05, 24, 24, 24, 24, 24, 24,			! 4
+     .			    24, 24, 14, 06, 14, 24, 23,			! 5
+     .			    24, 07, 24, 24, 24, 24, 24,			! 6
+     .			    24, 08, 24, 24, 24, 24, 24,			! 7
+     .			    24, 12, 24, 24, 24, 24, 24,			! 8
+     .			    24, 12, 24, 11, 24, 24, 24,			! 9
+     .			    02, 24, 24, 24, 24, 24, 24,			!10
+     .			    02, 24, 24, 24, 24, 24, 24,			!11
+     .			    24, 13, 24, 24, 24, 24, 24,			!12
+     .			    24, 24, 14, 24, 14, 24, 23,			!13
+     .			    24, 15, 14, 24, 24, 24, 24,			!14
+     .			    24, 16, 24, 24, 24, 24, 24,			!15
+     .			    24, 24, 24, 24, 17, 24, 23,			!16
+     .			    24, 18, 24, 24, 24, 24, 24,			!17
+     .			    24, 19, 24, 24, 24, 24, 24,			!18
+     .			    24, 24, 24, 24, 20, 24, 23,			!19
+     .			    24, 21, 24, 24, 24, 24, 24,			!20
+     .			    24, 22, 24, 24, 24, 24, 24,			!21
+     .			    24, 24, 24, 24, 24, 24, 23/			!22
+
+* initialize
+	day = 0
+	month = 0
+	year = 0
+	hour = 0
+	minute = 0
+	second = 0
+	fill_in = '01-'//month_names(1)//'-0000:00:00:00'
+	in_state = 1
+	pos = 0
+
+* read in next char
+  100	pos = pos + 1
+* . Calc next state
+	in_state = out_state(Class(date,pos),in_state)
+* . Process next character unless this is a change of class, THEN output
+* STATUS       1   2   3   4   5   6   7   8   9   10  11  12  13  14
+	GOTO (100,100,100,100,120,100,100,100,100,130,140,100,150,100,
+     .	      100,160,100,100,170,100,100,180,190,9000) in_state
+* STATUS       15  16  17  18  19  20  21  22  23  24
+
+* month found
+120	fill_in(4:6) = date(pos-2:pos)
+	GOTO 100
+* 1 digit day found
+130	fill_in(2:2) = date(pos-1:pos-1)
+	GOTO 100
+* 2 digit day found
+140	fill_in(1:2) = date(pos-2:pos-1)
+	GOTO 100
+* year found
+150	fill_in(8:11) = date(pos-3:pos)
+	GOTO 100
+* hour found
+160	fill_in(13:14) = date(pos-1:pos)
+	GOTO 100
+* minute found
+170	fill_in(16:17) = date(pos-1:pos)
+	GOTO 100
+* second found
+180	fill_in(19:20) = date(pos-1:pos)
+	GOTO 100
+
+* End of string; break into parts
+190	READ (fill_in(1:2),'(I2)') day
+	READ (fill_in(8:11),'(I4)') year
+	READ (fill_in(13:14),'(I2)') hour
+	READ (fill_in(16:17),'(I2)') minute
+	READ (fill_in(19:20),'(I2)') second
+
+C  Get calendar attributes
+
+      CALL TM_GET_CALENDAR_ATTRIBUTES (cal_id, num_months, 
+     .                    num_days, yeardays, month_names, 
+     .                    days_in_month, days_before_month,
+     .                    month_by_day)
+	DO 200 month = 1,12
+	  istat = STR_CASE_BLIND_COMPARE( fill_in(4:6), 
+     .       month_names(month) )
+	  IF (istat .EQ. str_match) GOTO 210
+200	CONTINUE
+	GOTO 9000
+
+ 210	continue
+
+C       ***************************************
+C       ******* CHECK VALIDITY OF DATES *******
+C       ***************************************
+
+
+******************************************************************************
+* HANDLE GREGORIAN CALENDAR FIRST
+******************************************************************************
+        IF (cal_id .EQ. gregorian) THEN
+
+*          DAYS IN MONTH
+	   IF (month .EQ. 2) THEN
+	      IF (mod(year,400) .EQ. 0) THEN
+		 leapadj = 1
+	      ELSE IF (mod(year,4).EQ.0 .AND. mod(year,100).NE.0) THEN
+		 leapadj = 1
+	      ELSE
+		 leapadj = 0
+	      ENDIF
+	   ELSE
+	      leapadj = 0
+	   ENDIF
+	   IF (day .GT. days_in_month(month)+leapadj
+     .         .OR. day .le. 0   ) GOTO 9000
+
+*          HOURS IN DAY, MINUTES IN HOUR, SECONDS IN MINUTE
+	   IF (hour .GT. 23 .OR. minute .GT. 59 .OR. second .GT. 59)
+     .         GOTO 9000
+
+
+
+
+******************************************************************************
+* HANDLE JULIAN CALENDAR 
+******************************************************************************
+        ELSE IF (cal_id .EQ. julian) THEN
+
+*          DAYS IN MONTH
+	   IF (month .EQ. 2) THEN
+	      IF (mod(year,4) .EQ. 0) THEN
+		 leapadj = 1
+	      ELSE
+		 leapadj = 0
+	      ENDIF
+	   ELSE
+	      leapadj = 0
+	   ENDIF
+	   IF (day .GT. days_in_month(month)+leapadj
+     .         .OR. day .le. 0   ) GOTO 9000
+
+*          HOURS IN DAY, MINUTES IN HOUR, SECONDS IN MINUTE
+	   IF (hour .GT. 23 .OR. minute .GT. 59 .OR. second .GT. 59)
+     .         GOTO 9000
+
+
+******************************************************************************
+* ALL OTHER SUPPORTED AND REGULAR CALENDARS
+******************************************************************************
+
+	ELSE IF (cal_id .GT. gregorian   .AND.  cal_id .NE. julian .AND.
+     .           cal_id .LE. max_calendars) THEN
+
+
+*          DAYS IN MONTH
+	   IF (day .GT. days_in_month(month) 
+     .         .OR. day .le. 0) GOTO 9000
+
+*          HOURS IN DAY, MINUTES IN HOUR, SECONDS IN MINUTE
+	   IF (hour .GT. 23 .OR. minute .GT. 59 .OR. second .GT. 59)
+     .         GOTO 9000
+	ELSE
+           status = merr_syntax
+	   CALL ERRMSG (status, status, 
+     .       'Illegal calendar in tm_break_date()', *9999)
+        END IF
+
+	GOTO 9990
+
+* Syntax error
+
+ 9000	status = merr_syntax
+	GOTO 9999
+
+ 9990	status = merr_ok
+
+ 9999	RETURN
+	END
+
+	INTEGER*4 FUNCTION Class ( in_str, pos )
+*
+* Takes a character {in_str(pos:pos)}, and determines it's class:
+*  1 : A to Z
+*  2 : 0 to 9
+*  3 : blank (tab)
+*  4 : -
+*  5 : :
+*  6 : other
+*  7 : end of string
+*
+* ARGUMENTS
+*  in_str - input string
+*  pos    - character position in string
+	CHARACTER*(*)	in_str
+	INTEGER*4	pos
+*
+* LOCAL DEFINITIONS
+	CHARACTER*1	chr, blank, tab, hyphen, colon
+	INTEGER*4	slen
+	INTEGER*4	TM_LENSTR
+	DATA	blank	/ ' ' /
+	DATA	hyphen	/ '-' /
+	DATA	colon	/ ':' /
+		tab	= CHAR(9)
+
+* Determine length of string
+	slen = TM_LENSTR( in_str )
+* Is pos at end of string?
+	IF (pos .GT. slen) THEN
+	  class = 7
+	  RETURN
+	ENDIF
+
+* Get character
+	chr = in_str( pos:pos )
+* Alphabetic?
+	IF ( chr .GE. 'A' .AND. chr .LE. 'Z' .OR.
+     .	     chr .GE. 'a' .AND. chr .LE. 'z'      ) THEN
+	  class = 1
+* Numeric?
+	ELSE IF (chr .GE. '0' .AND. chr .LE. '9' ) THEN
+	  class = 2
+* Blank or tab?
+	ELSE IF (chr .EQ. blank .OR. chr .EQ. tab ) THEN
+	  class = 3
+* Hyphen?
+	ELSE IF (chr .EQ. hyphen) THEN
+	  class = 4
+* Colon?
+	ELSE IF (chr .EQ. colon) THEN
+	  class = 5
+* Everything ELSE
+	ELSE
+	  class = 6
+	ENDIF
+	RETURN
+	END
diff --git a/fmt/src/tm_break_fmt_date.F b/fmt/src/tm_break_fmt_date.F
new file mode 100644
index 0000000..911eaa2
--- /dev/null
+++ b/fmt/src/tm_break_fmt_date.F
@@ -0,0 +1,146 @@
+	SUBROUTINE TM_BREAK_FMT_DATE (form, date, cal_id, 
+     .                                year, month, day, hour, minute, 
+     .                                second, do_err, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will take date strings of various formats and break them into their
+* various components.
+
+* *sh* 2/13/95
+* V500 *sh* 7/99 - if numslashnum reading fails, try dd-mmm-yyyy (VAX)
+*		to support LDEA files with "months since 01-jan"
+* V530 *acm* 12/00 - add cal_id for alternative calendar axes
+* 
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+* V551 *acm*  2/03 - fix bug where seconds were wiped out. See cc comments
+* V600 *acm* 2/06 - Fix for bug 1394, do err msg only if do_err flag true
+* V67  *acm* 3/11 - If there is a T between the date and time in the unitsi 
+*                   string "months since yyyy-mm-ddThh:mm:ss (as in GRIB files) 
+*                   allow that. Replace T with a space. Ticket 1806.
+
+
+* ARGUMENT DEFINITIONS
+*  form  - code for the date string format
+*  date  - date to process
+*  cal_id  integer code for which calendar to use
+*  day, month, year, hour, minute, second - obvious
+*  status - returned status
+	CHARACTER*(*)	date
+	INTEGER	form, day, month, year, hour, minute, second, status,
+     .          cal_id
+*
+* INCLUDE FILES
+
+	include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xrisc_buff.cmn'
+
+
+* internal variable declarations:
+        LOGICAL do_err
+	INTEGER slen
+	PARAMETER ( slen = 32)
+	INTEGER TM_LENSTR1, TM_BREAK_FMT_DATE_C, dlen
+	REAL fsecond
+#ifdef sun
+	BYTE       dhol(slen)     !c-type Hollerith string buffers
+#else
+	INTEGER*1  dhol(slen)     !c-type Hollerith string buffers
+#endif
+
+	dlen = TM_LENSTR1( date)
+
+	IF ( form .EQ. pdate_vax ) THEN
+	    CALL TM_BREAK_DATE( date, cal_id, year, month, day,
+     .			hour, minute, second, status)
+	    RETURN
+
+	ELSEIF ( form .EQ. pdate_numslashnum ) THEN
+
+* ... note:  this is a quick and dirty kludge parser.  Use the udunits package
+*	     for a more robust approach
+* ... the format looks like (e.g.) 1992-10-8 15:15:42.5 
+
+*     If there is a T between the date and time (as in GRIB files) replace with a space.
+           IF (date(11:11) .EQ. 'T') date(11:11) = ' '
+
+	   CALL TM_FTOC_STRNG( date(:dlen), dhol, slen)
+	   status = TM_BREAK_FMT_DATE_C(dhol, year, month,
+     .				        day, hour, minute, fsecond)
+	   second = NINT(fsecond)	! information loss ...
+
+	   IF ( status .NE. 0 ) THEN
+* ... last attempt -- try VAX format
+	      CALL TM_BREAK_DATE( date, cal_id, year, month, day,
+     .			hour, minute, second, status)
+	      IF ( status .NE. merr_ok ) GOTO 5100
+	   ENDIF
+
+cc   Move this up after TM_BREAK_FMT_DATE_C -- if tm_break_fmt_date_c did 
+cc   not set fsecond, don't want to wipe out the seconds that were correctly
+cc   set by TM_BREAK_DATE
+
+cc	   second = NINT(fsecond)	! information loss ... 
+
+	ELSE
+	   STOP 'Unknown date format code'
+	ENDIF
+
+* successful translation
+	status = merr_ok
+	RETURN
+
+* error exits
+ 5000	RETURN
+ 5100	risc_buff = date(:dlen)
+        IF (do_err) THEN
+          CALL TM_ERRMSG (merr_badtimedef, status, 'TM_BREAK_FMT_DATE',
+     .			unspecified_int4, no_stepfile,
+     .			'syntax error in "'//risc_buff,
+     .			no_errstring, *5000)
+        ELSE
+           dlen = TM_LENSTR1(risc_buff)
+           CALL WARN (
+     .       'cannot parse "units since date", date= "'//
+     .        risc_buff(:dlen)//'"'//'; leaving units string')
+           status = merr_badtimedef
+        ENDIF
+          
+
+	END
+
diff --git a/fmt/src/tm_break_fmt_date_c.c b/fmt/src/tm_break_fmt_date_c.c
new file mode 100644
index 0000000..65db2f3
--- /dev/null
+++ b/fmt/src/tm_break_fmt_date_c.c
@@ -0,0 +1,113 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* *sh* 2/13/95
+
+ *sh* 1/97 - modified to accept 4-field date used by LLNL: "1992-10-8 0"
+
+break a date of the form yyyy-mm-dd  hh:mm:ss into its component pieces
+
+all fields are integer except seconds which is float
+
+hh:mm:ss are optional (defaulting to 00:00:00) or seconds, alone may be omitted
+
+  compile with
+       cc -c -g tm_break_fmt_date_c.c
+  on non-ANSI compilers also use:
+        -D_NO_PROTO
+
+ *kob* 5/22/95 - need to add an ifdef check for NO_ENTRY_NAME_UNDERSCORES for
+                 those machines (like hp) that don't need the underscore 
+		 appended at the end of a routine call....
+
+*/
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include "ferretmacros.h"
+
+#ifdef _NO_PROTO
+int FORTRAN(tm_break_fmt_date_c)(date,
+			year,
+			month,
+			day,
+			hour,
+			minute,
+			second)
+char *date;
+int *year, *month, *day, *hour, *minute;
+DFTYPE *second;
+
+#else
+int FORTRAN(tm_break_fmt_date_c)(char *date,
+			int *year,
+			int *month,
+			int *day,
+			int *hour,
+			int *minute,
+			DFTYPE *second)
+
+#endif
+{
+
+  int n;
+  double dblsec; /* pointer to double expected by %lf in sscanf */
+
+/* perform the conversion (e.g.) 1992-10-8 15:15:42.5  */
+  n = sscanf(date,"%d-%d-%d %d:%d:%lf",year,month,day,hour,minute,&dblsec);
+
+  if ( n == 3 ) {
+    *hour = 0;
+    *minute = 0;
+    *second = 0.0;
+  } else if ( n == 4 ) {
+    *minute = 0;
+    *second = 0.0;
+  } else if ( n == 5 ) {
+    *second = 0.0;
+  } else if ( n == 6 ) {
+    *second = (DFTYPE) dblsec;
+  } else {
+    return(1);
+  }
+
+  return(0);
+}
diff --git a/fmt/src/tm_break_lines.F b/fmt/src/tm_break_lines.F
new file mode 100644
index 0000000..937d05a
--- /dev/null
+++ b/fmt/src/tm_break_lines.F
@@ -0,0 +1,117 @@
+	SUBROUTINE TM_BREAK_LINES (instring,linestart,lineend,numlines)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* This subroutine will "break up" the variable instring into individual
+* strings and place them in the character array outstrings. The breaks
+* occur at the marker <NL>.  Return numlines, the number of lines found.
+*
+* based on tm_break_str.F
+* V685+ 12/13    - *acm*  bounds checking: dont refer to parts of the string outside its bounds.
+*
+* Arguments
+	INTEGER		numlines, linestart(*), lineend(*)
+	CHARACTER*(*)	instring
+       
+*
+        CHARACTER*4     newline, upstring
+	INTEGER		STR_UPCASE, TM_LENSTR1,
+     .                  icode, inlen, lincnt, nlin, i, nchar
+
+* Initialize
+	inlen  = TM_LENSTR1(instring)
+	lincnt = 0
+	nlin = 1
+        numlines = 1
+	linestart(numlines) = 1
+	lineend(numlines) = inlen
+
+* If the label ends in <NL> then ignore that.
+
+        IF (inlen .GE. 4) THEN
+           ICODE = str_upcase (newline, instring(inlen-3:inlen))  
+           IF (newline .EQ. '<NL>') inlen = inlen-3
+        ENDIF
+
+* Locate next character
+
+100	CONTINUE
+        DO 200 i = nlin, inlen
+	   nchar = i
+	   GOTO 300
+200	CONTINUE
+
+* no characters left
+
+	GOTO 9900
+
+* locate the next <NL> (end of a line)
+
+300	DO 400 i = nchar,inlen
+	  IF (instring(i:i) .EQ. '<') THEN
+
+* New line found?
+
+           IF (i.LT.inlen-3) THEN
+	      upstring = instring(i:i+3)
+	   ELSE
+	      upstring = instring(i:inlen)
+	   ENDIF
+	      
+           icode = STR_UPCASE (newline, upstring)  
+           IF (newline .EQ. '<NL>') THEN
+	      nlin = i + 4
+              GOTO 500
+            ENDIF
+	  ENDIF
+400	CONTINUE
+
+* more characters left
+
+	nlin = inlen + 1
+
+500	lincnt = lincnt + 1
+	linestart(lincnt) = nchar
+	lineend(lincnt) = max(nchar,nlin-5)
+	IF (nlin .LE. inlen) GOTO 100
+
+* if at end of string loop at 100 will catch it
+
+        numlines = lincnt
+        lineend(lincnt) = inlen 
+
+9900	RETURN
+	END
diff --git a/fmt/src/tm_break_str.F b/fmt/src/tm_break_str.F
new file mode 100644
index 0000000..322bb2e
--- /dev/null
+++ b/fmt/src/tm_break_str.F
@@ -0,0 +1,82 @@
+	SUBROUTINE TM_BREAK_STR ( instring, outstrings, numwords )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* This subroutine will "break up" the variable instring into 'numwords'
+* strings and place them in the character array outstrings. The breaks
+* occur at spaces and tabs.
+*
+* revision 0.00 - 05/15/87
+*
+* Arguments
+	INTEGER		numwords
+	CHARACTER*(*)	instring, outstrings(numwords)
+*
+	INTEGER		inlen, outlen, wcnt, nblnk, i, nchar
+
+	inlen  = LEN(instring)
+	outlen = LEN(outstrings(1))
+	wcnt = 0
+	nblnk = 1
+
+* Locate next non-blank character (start of a word)
+100	DO 200 i=nblnk,inlen
+	  IF (instring(i:i) .NE. ' ') THEN
+	    nchar = i
+	    GOTO 300
+	  ENDIF
+200	CONTINUE
+* no non-blank characters left
+	GOTO 9900
+
+* locate the next blank character (end of a word)
+300	DO 400 i = nchar,inlen
+	  IF (instring(i:i) .EQ. ' ') THEN
+* end of word found
+	    nblnk = i
+	    GOTO 500
+	  ENDIF
+400	CONTINUE
+* non blank characters left
+	nblnk = inlen + 1
+
+500	wcnt = wcnt + 1
+	outstrings(wcnt) = instring(nchar:nblnk-1)
+	IF (wcnt .LT. numwords) GOTO 100
+* if at end of string loop at 100 will catch it
+
+9900	RETURN
+	END
diff --git a/fmt/src/tm_c_rename.c b/fmt/src/tm_c_rename.c
new file mode 100644
index 0000000..506c415
--- /dev/null
+++ b/fmt/src/tm_c_rename.c
@@ -0,0 +1,70 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+
+
+/* tm_c_rename.c */
+/* make a Unix system call to rename a file */
+
+/*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* originally written for DECstation under Ultrix operating system
+* V1.0 5/6/91
+*/
+
+/* *kob* had to add ifdef for sake of AIX  10/94 */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+void tm_c_rename( oldname, newname, status )
+#else
+void tm_c_rename_( oldname, newname, status )
+#endif
+
+
+   char *oldname, *newname;
+   int *status;
+
+/* Unix system call to rename file */
+
+{
+   *status = rename ( oldname, newname );
+
+   return;
+}
diff --git a/fmt/src/tm_check_bnds.F b/fmt/src/tm_check_bnds.F
new file mode 100644
index 0000000..ff1f260
--- /dev/null
+++ b/fmt/src/tm_check_bnds.F
@@ -0,0 +1,213 @@
+	LOGICAL FUNCTION TM_CHECK_BNDS (nline, nb, vname)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Checks to make sure bounds are contiguous and the data points are 
+* enclosed by its bounds on an axis
+
+* 4/2004 ACM from tm_check_box_loc
+* V600 *acm* 3/06  Fix bug 1400: Add more convenient syntax for user-specified bounds:
+*                  Bounds can be either 2*N or N+1 values.
+* V601 *acm* 9/19  Fix bug 1434; check bounds for regularly-spaced axes 
+* V63  *acm* 10/09 Changes for gfortran build
+* V65  *acm*  2/10 Test for overlapping bounds
+* V66  *kms*  7/10 Initialize return value to .TRUE. (uninitialized bug for
+*                  N+1 bounds) and no need to check for gaps for N+1 bounds
+
+        INCLUDE 'xio.cmn_text'
+	INCLUDE 'tmap_dims.parm'
+        INCLUDE 'tmap_errors.parm'
+	INCLUDE 'xtm_grid.cmn_text'
+	EXTERNAL xgt_grid_data
+
+* Arguments
+	INTEGER nline, nb
+        CHARACTER*(*) vname
+
+* Internal definitions
+        LOGICAL TM_FPEQ, TM_DFPEQ, equal_ends, overlapping
+	INTEGER TM_LENSTR1, npts, ipt1, ibx1, i, ngap, vlen, status,
+     .          nothing
+        REAL*8 pt, del, bhi, blo
+        REAL blast
+        CHARACTER TM_STRING*13, vbuff*128
+
+	ipt1 = line_subsc1(nline)
+	npts = line_dim(nline)
+	ibx1 = ipt1 + npts
+        IF (ibx1 + nb .GT. maxlinestore) GOTO 5100
+
+        blast = REAL(line_mem(ibx1+1))  ! First box_hi
+        TM_CHECK_BNDS = .TRUE.
+        ngap = 0
+        overlapping = .FALSE.
+
+        IF (nb .EQ. 2*npts) THEN
+
+           IF (line_regular(nline)) THEN
+
+              pt = line_start(nline)
+              del = line_delta(nline)
+	      DO 100 i = 0, npts-1
+                 blo = line_mem(ibx1+2*i)
+                 bhi = line_mem(ibx1+2*i+1)
+	        IF ( (pt .LT. blo) .OR.  (pt .GT. bhi) ) THEN
+		
+                   IF (TM_DFPEQ(pt,blo) .OR. TM_DFPEQ(pt,bhi) ) THEN
+                      nothing = 0
+                   ELSE
+                      TM_CHECK_BNDS = .FALSE.
+		   ENDIF
+                   RETURN
+                ENDIF
+	        pt = line_start(nline) + FLOAT(i+1)* del
+
+  100           CONTINUE
+
+            ELSE ! (not line_regular)
+
+
+	      DO 200 i = 0, npts-1
+                pt = line_mem(ipt1+i)
+                blo = line_mem(ibx1+2*i)
+                bhi = line_mem(ibx1+2*i+1)
+	        IF ( (pt .LT. blo) .OR.  (pt .GT. bhi) ) THEN
+		
+                   IF (TM_DFPEQ(pt,blo) .OR. TM_DFPEQ(pt,bhi) ) THEN
+                      nothing = 0
+                   ELSE
+                      TM_CHECK_BNDS = .FALSE.
+		   ENDIF
+
+                   RETURN
+	        ENDIF
+                IF (i .GE. 1) THEN
+		   equal_ends = TM_FPEQ(blast, REAL(blo))
+		   IF (.NOT.equal_ends .AND. blo.LT.blast) THEN 
+		      overlapping = .TRUE.
+		      GOTO 330
+		   ENDIF
+                   IF (.NOT. equal_ends ) THEN
+                      ngap = ngap + 1
+                      line_mem(ibx1+2*i) = blast
+		   ENDIF
+                   blast = REAL(bhi)
+                ENDIF
+
+  200        CONTINUE
+           ENDIF ! line_regular
+
+*  Change from N*2 storage of bounds to N+1 edges.
+
+           DO 300 i = 0, npts-1
+              bhi = line_mem(ibx1+2*i+1)
+              line_mem(ibx1+i+1) = bhi
+  300      CONTINUE
+
+           IF (ngap .EQ. 0) THEN
+              TM_CHECK_BNDS = .TRUE.
+              RETURN
+           ELSE
+
+             vbuff = vname   
+             vlen = TM_LENSTR1(vbuff)
+             CALL WARN( 'Axis definition error on axis: ' 
+     .               //vbuff(:vlen))
+             CALL WARN(
+     .        'Bounds given describe non-contiguous axis cells ')
+             CALL WARN(
+     .         'Using the LOWER bound specified for each axis cell')
+             TM_CHECK_BNDS = .TRUE.
+
+           ENDIF
+  330      IF (overlapping) THEN
+              vbuff = vname   
+              vlen = TM_LENSTR1(vbuff)
+              CALL WARN( 'Axis definition error on axis: '
+     .        //vbuff(:vlen)//'. Bounds describe cells '//
+     .        'that overlap one another ')
+              TM_CHECK_BNDS = .FALSE.
+	   ENDIF
+
+
+       ELSE  ! bounds are already specified as N+1 values
+
+          IF (line_regular(nline)) THEN
+             pt = line_start(nline)
+             del = line_delta(nline)
+             DO 400 i = 0, npts-1
+                blo = line_mem(ibx1+i)
+                bhi = line_mem(ibx1+i+1)
+	        IF ( (pt .LT. blo) .OR.  (pt .GT. bhi) ) THEN
+                   IF (TM_DFPEQ(pt,blo) .OR. TM_DFPEQ(pt,bhi) ) THEN
+                      nothing = 0
+                   ELSE
+                      TM_CHECK_BNDS = .FALSE.
+		   ENDIF
+                   RETURN
+	        ENDIF
+                pt = line_start(nline) + FLOAT(i+1)* del
+
+  400        CONTINUE
+
+          ELSE ! line_regular
+  
+	     DO 500 i = 0, npts-1
+                pt = line_mem(ipt1+i)
+                blo = line_mem(ibx1+i)
+                bhi = line_mem(ibx1+i+1)
+	        IF ( (pt .LT. blo) .OR.  (pt .GT. bhi) ) THEN
+                   IF (TM_DFPEQ(pt,blo) .OR. TM_DFPEQ(pt,bhi) ) THEN
+                      nothing = 0
+                   ELSE
+                      TM_CHECK_BNDS = .FALSE.
+		   ENDIF
+                   RETURN
+	        ENDIF
+
+  500        CONTINUE
+          ENDIF ! line_regular
+
+       ENDIF
+
+ 5000  RETURN
+ 5100  TM_CHECK_BNDS = .FALSE.
+       CALL TM_ERRMSG (merr_linstorlim, status, 'TM_CHECK_BNDS',
+     .                  no_descfile, no_stepfile,
+     .                  'MAX='//TM_STRING(DBLE(maxlinestore)),
+     .                  no_errstring, *5000)
+
+      END
diff --git a/fmt/src/tm_check_bnds_attrib.F b/fmt/src/tm_check_bnds_attrib.F
new file mode 100644
index 0000000..ade4df4
--- /dev/null
+++ b/fmt/src/tm_check_bnds_attrib.F
@@ -0,0 +1,128 @@
+        SUBROUTINE TM_CHECK_BNDS_ATTRIB (dset, iaxis, vname, vlen, 
+     .                                   bname, bndid, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V570 5/2004 *acm*
+* Check the bounds attribute, issue any warnings
+* V600 *acm* 10/05 should not have npts as an argument; npts from cd_get_1_axis
+*                  was being reset  as npts bounds or edges, which is npts+1
+* V600 *ACM* attribute control. 
+*             Replace NCVID with CD_GET_VAR_ID
+*             Replace NCVINQ for variables, with CD_GET_VAR_INFO
+*             Replace NCDINQ with CD_GET_DS_DIMS
+
+
+	INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xtm_grid.cmn_text'
+        INCLUDE 'xio.cmn_text'
+        INCLUDE 'tmap_errors.parm'
+        INCLUDE 'errmsg.parm'
+
+* argument declarations
+
+      INTEGER dset, iaxis, vlen, bndid, status
+      CHARACTER*(*) bname, vname
+
+* Local variable declarations
+      LOGICAL coordvar
+      INTEGER TM_LENSTR1
+      INTEGER blen, soft_err, vartype, ivar, npts, 
+     .        nvdims, vdims(8), nvatts, all_outflag
+      CHARACTER*132 buff, vbuff
+
+* does the bounds variable pointed to really exist ?
+        blen = TM_LENSTR1(bname)
+        CALL CD_GET_VAR_ID (dset, bname, bndid, status)
+
+        IF (bndid .LE. 0) THEN
+           soft_err = 21
+           GOTO 6000
+        ENDIF
+
+* get the vital statistics of the bounds variable
+
+        CALL CD_GET_VAR_INFO (dset, bndid, bname, vartype, 
+     .            nvdims, vdims, nvatts, coordvar, all_outflag, status)
+
+        IF ( nvdims .NE. 2 ) THEN
+           soft_err = 22
+           GOTO 6000
+        ENDIF
+
+* get axis length: 
+        
+        CALL CD_GET_DS_DIMS (dset, vdims(1), buff, npts, status)
+        IF (status.NE.ferr_ok) GOTO 5100   ! should never happen
+
+* check for error conditions: bounds is 2 by N
+        IF ( npts .NE. 2 ) THEN
+           soft_err = 23
+           GOTO 6000
+        ENDIF
+        CALL CD_GET_DS_DIMS (dset, vdims(2), buff, npts, status)
+        IF (status.NE.ferr_ok) GOTO 5100   ! should never happen
+
+* check for error conditions: 2nd dimension of bounds is N
+        IF ( npts .NE. line_dim(iaxis) ) THEN
+           soft_err = 23
+           GOTO 6000
+        ENDIF
+
+        status = merr_ok
+        RETURN
+
+* error messages
+
+ 6000   CALL TM_NOTE( 'netCDF bounds variable definition error', lunit_errors )
+        buff = bname
+        vbuff = vname
+        IF ( soft_err .EQ. 21 ) THEN
+           CALL TM_NOTE('Bounds definition "'//buff(:blen)//
+     .                   '" points to no existing axis', lunit_errors )
+        ELSEIF ( soft_err .EQ. 22 ) THEN
+           CALL TM_NOTE('Bounds definition "'//buff(:blen)//
+     .                   '" is not 2D', lunit_errors )
+        ELSEIF ( soft_err .EQ. 23 ) THEN
+           CALL TM_NOTE('Bounds "'//buff(:blen)//
+     .          '" must be 2x dimension of '//vbuff(:vlen), lunit_errors )
+        ENDIF
+        CALL TM_NOTE( 'Ignoring BOUNDS attribute', lunit_errors )
+
+        status = merr_ok + 1
+        RETURN
+
+ 5100   status = pcdferr
+        RETURN
+
+        END
diff --git a/fmt/src/tm_check_bnds_centered.F b/fmt/src/tm_check_bnds_centered.F
new file mode 100644
index 0000000..37ab8b5
--- /dev/null
+++ b/fmt/src/tm_check_bnds_centered.F
@@ -0,0 +1,111 @@
+	LOGICAL FUNCTION TM_CHECK_BNDS_CENTERED (nline)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Checks whether data points are all centered within the bounds on an axis
+* Do this in single precision, as in the check for regular axis in cd_get_1_axis.
+
+* 4/2004 ACM 
+* V58+ *acm*  1/05 Fixes for irreg axes with bounds: This routine now checks
+*                  whether the coordinates are centered in the bound boxes, and 
+*                  whether the boxes are equal sized.
+* V601 *acm* 9/19  Fix bug 1434; check bounds for regularly-spaced axes 
+
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument declaration
+	INTEGER nline
+
+* Local variable declarations
+        LOGICAL TM_FPEQ
+	INTEGER ipt1, npts, ibx1, i
+        REAL diff_hi, diff_lo, diff_last
+        REAL pt, del
+
+	ipt1 = line_subsc1(nline)
+	npts = line_dim(nline)
+	ibx1 = ipt1 + npts
+
+        IF (line_regular(nline)) THEN
+           pt = line_start(nline)
+           del = line_delta(nline) 
+
+	   DO 100 i = 0, npts-1
+             diff_hi = line_mem(ibx1+i+1) - pt
+             diff_lo = pt - line_mem(ibx1+i)
+
+	     IF ( .NOT. TM_FPEQ(diff_lo, diff_hi) ) THEN
+	        TM_CHECK_BNDS_CENTERED = .FALSE.
+	        RETURN
+	     ENDIF
+
+             IF (i .GT. 0) THEN
+                IF (diff_hi .NE. diff_last) THEN
+	           TM_CHECK_BNDS_CENTERED = .FALSE.
+	           RETURN
+                ENDIF
+	     ENDIF
+             diff_last = diff_hi
+             pt = float(i+1) * del + line_start(nline)
+
+  100	   CONTINUE
+
+        ELSE  ! not line_regular
+   
+	   DO 200 i = 0, npts-1
+             diff_hi = line_mem(ibx1+i+1) - line_mem(ipt1+i)
+             diff_lo = line_mem(ipt1+i)- line_mem(ibx1+i)
+
+	     IF ( .NOT. TM_FPEQ(diff_lo, diff_hi) ) THEN
+	        TM_CHECK_BNDS_CENTERED = .FALSE.
+	        RETURN
+	     ENDIF
+
+             IF (i .GT. 0) THEN
+                IF (diff_hi .NE. diff_last) THEN
+	           TM_CHECK_BNDS_CENTERED = .FALSE.
+	           RETURN
+                ENDIF
+	     ENDIF
+             diff_last = diff_hi
+
+  200	   CONTINUE
+
+        ENDIF
+
+	TM_CHECK_BNDS_CENTERED = .TRUE.
+	RETURN
+	END
diff --git a/fmt/src/tm_check_box_loc.F b/fmt/src/tm_check_box_loc.F
new file mode 100644
index 0000000..0883cbd
--- /dev/null
+++ b/fmt/src/tm_check_box_loc.F
@@ -0,0 +1,75 @@
+	LOGICAL FUNCTION TM_Check_box_loc (nline)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Checks to make sure a data point is enclosed by its box on an axis
+*
+* revision 0.00 - 05/26/88 - by M. Verschell for PMEL/TMAP
+* V63  *acm* 10/09 Changes for gfortran build
+*
+* Argument
+	INTEGER*4	nline
+*
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+*
+	INTEGER*4	ipt1, npts, ibx1, i, nothing
+	LOGICAL		TM_DFPEQ
+	REAL*8 a,b1,b2
+*
+	ipt1 = line_subsc1(nline)
+	npts = line_dim(nline)
+	ibx1 = ipt1 + npts
+
+	DO 100 i=0,npts-1
+	  a = line_mem(ipt1+i)
+	  b1 = line_mem(ibx1+i)
+	  b2 = line_mem(ibx1+i+1)
+	  IF (a .LT. b1 .OR. a .GT. b2) THEN
+            IF (TM_DFPEQ(a,b1) .OR. TM_DFPEQ(a,b2) ) THEN
+               nothing = 0
+            ELSE
+	       TM_Check_box_loc = .FALSE.
+	    ENDIF
+	    RETURN
+	  ENDIF
+  100	CONTINUE
+
+	TM_Check_box_loc = .TRUE.
+	RETURN
+	END
diff --git a/fmt/src/tm_check_edges_attrib.F b/fmt/src/tm_check_edges_attrib.F
new file mode 100644
index 0000000..1540c39
--- /dev/null
+++ b/fmt/src/tm_check_edges_attrib.F
@@ -0,0 +1,140 @@
+        SUBROUTINE TM_CHECK_EDGES_ATTRIB (cdfid, iaxis, vname, vlen, 
+     .                                    ename, edgid, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V570 5/2004 *acm*
+* Check the edges attribute, issue any warnings
+* V600 *acm* 10/05 should not have npts as an argument; npts from cd_get_1_axis
+*                  was being reset  as npts bounds or edges, which is npts+1
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V65  *acm* 1/10  Add #ifdef usingDODSf2cUnderscore, for 32-bit linux build
+*                  linked with OPeNDAP library.
+
+        INCLUDE 'tmap_dims.parm'
+        INCLUDE 'xtm_grid.cmn_text'
+        INCLUDE 'xio.cmn_text'
+        INCLUDE 'tmap_errors.parm'
+        INCLUDE 'netcdf.inc'
+
+! Declare netcdf function names. 
+! The ones without trailing underscore are declared in netcdf.inc
+#include "netcdf_declareUnderscore.inc"
+
+* argument declarations
+      INTEGER cdfid, iaxis, vlen, edgid, status
+      CHARACTER*(*) ename, vname
+
+* Local variable declarations
+      INTEGER TM_LENSTR1
+      INTEGER elen, cdfstat, soft_err, vartype, nvdims,
+     .          vdims(8), nvatts, npts
+      CHARACTER*132 buff, vbuff
+
+* does the variable pointed to really exist ?
+
+        elen = TM_LENSTR1(ename)
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_INQ_VARID_(cdfid, ename(:elen), edgid)
+#else
+	cdfstat = NF_INQ_VARID(cdfid, ename(:elen), edgid)
+#endif
+
+        IF (cdfstat.NE.NF_NOERR) THEN
+           soft_err = 11
+           GOTO 5000
+        ENDIF
+
+* get the vital statistics of the edges variable
+#ifdef usingDODSf2cUnderscore
+        cdfstat = NF_INQ_VAR_(cdfid, edgid, ename(:elen), vartype,
+     .               nvdims, vdims, nvatts)
+#else
+        cdfstat = NF_INQ_VAR (cdfid, edgid, ename(:elen), vartype,
+     .               nvdims, vdims, nvatts)
+#endif
+        IF ( nvdims .NE. 1 ) THEN
+           soft_err = 12
+           GOTO 5000
+        ENDIF
+
+* get axis length:
+#ifdef usingDODSf2cUnderscore
+	cdfstat = NF_INQ_DIM_(cdfid, vdims, buff, npts)
+#else
+	cdfstat = NF_INQ_DIM (cdfid, vdims, buff, npts)
+#endif
+
+        IF (cdfstat.NE.NF_NOERR) GOTO 5100   ! should never happen
+
+* check for error conditions
+        IF ( npts .NE. line_dim(iaxis)+1 ) THEN
+           soft_err = 13
+           GOTO 5000
+        ENDIF
+
+        status = merr_ok
+        RETURN
+
+* error messages
+
+ 5000   CALL TM_NOTE( 'netCDF parent axis definition error', lunit_errors )
+        buff = ename
+        vbuff = vname
+        IF ( soft_err .EQ. 1 ) THEN
+           CALL TM_NOTE(
+     .    '"true_size" attribute must have only max/min axis coords: '
+     .       //vbuff(:vlen), lunit_errors )
+        ELSEIF ( soft_err .EQ. 11 ) THEN
+           CALL TM_NOTE('Edges definition "'//buff(:elen)//
+     .                   '" points to no existing axis', lunit_errors )
+        ELSEIF ( soft_err .EQ. 12 ) THEN
+           CALL TM_NOTE('Edges definition "'//buff(:elen)//
+     .                   '" is not 1D', lunit_errors )
+        ELSEIF ( soft_err .EQ. 13 ) THEN
+           CALL TM_NOTE('Edges "'//buff(:elen)//
+     .          '" must be 1 pt longer than '//vbuff(:vlen), lunit_errors )
+        ENDIF
+        IF ( soft_err .LE. 10 ) THEN
+           CALL TM_NOTE( 'Axis definition ignored', lunit_errors )
+        ELSE
+           CALL TM_NOTE( 'Edge definitions ignored', lunit_errors )
+        ENDIF
+        status = merr_ok + 1
+        RETURN
+
+ 5100   status = pcdferr
+        RETURN
+
+        END
diff --git a/fmt/src/tm_check_inf.c b/fmt/src/tm_check_inf.c
new file mode 100644
index 0000000..fcde956
--- /dev/null
+++ b/fmt/src/tm_check_inf.c
@@ -0,0 +1,57 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <math.h>
+#include "ferretmacros.h"
+
+/* tm_check_inf.c :
+ *  see if value is positive or negative Inf */
+
+/* *acm* - 11/03/05 */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+int FORTRAN(tm_check_inf)( DFTYPE *src )
+
+{
+  int result = 0;
+  
+  if  (isinf(*src)) result = 1;
+  return result;
+
+}
diff --git a/fmt/src/tm_check_nan.c b/fmt/src/tm_check_nan.c
new file mode 100644
index 0000000..c477b40
--- /dev/null
+++ b/fmt/src/tm_check_nan.c
@@ -0,0 +1,57 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <math.h>
+#include "ferretmacros.h"
+
+/* tm_check_nan.c :
+ *  see if value is NaN */
+
+/* *acm* - 11/04/04 */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+int FORTRAN(tm_check_nan)( DFTYPE *src )
+
+{
+  int result = 0;
+  
+  if  (isnan(*src)) result = 1;
+  return result;
+
+}
diff --git a/fmt/src/tm_choose_read.F b/fmt/src/tm_choose_read.F
new file mode 100644
index 0000000..7a10365
--- /dev/null
+++ b/fmt/src/tm_choose_read.F
@@ -0,0 +1,123 @@
+	SUBROUTINE TM_CHOOSE_READ ( dset_num, varpos,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride,
+     .		data_grid, file_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Reads a N-D block of data (3D, 2D being degenerate cases w/ 1 dimension being
+* 1 time series) from TMAP data sets.
+*
+* written 10/02/88 by M. Verschell for PMEL/TMAP
+*                     
+* revision 0.00 - 10/02/88 - initial incarnation
+* revision 0.10 - 11/01/88 - name change from TM_READ, passed var position in
+*			     common rather than variable name.
+* revision 0.20 - 12/06/89 - changed arrays for dimensions to single variables
+*   3/92 - added CDF file reads using CD_READ (calling arg list chgd 10/92)
+*   3/93 - treat ECDF (EPIC) like CDF
+* V500 5/99 *sh* - added strides to CD_READ call
+* 4/03 *acm* - Use STR_SAME to compare strings
+*       *acm* 3/12 removing use of old GT and TS data formats
+
+* include files
+        include 'tmap_dims.parm'                ! data set dimension
+        include 'tmap_errors.parm'              ! err code parm defs
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'             ! grid info
+        external xgt_grid_data
+        include 'xdset_info.cmn_text'   ! data set info common
+        external xdset_info_data
+        include 'xdset_info.cd_equiv'
+
+
+* arguments:
+*	dset_num    - internal data set # (from TM_INIT_DSET)
+*	varpos      - position in common of variable information
+* 	actual_dims - "a_" full dimensions of data_grid array passed
+*	use_dims    - indices of model data block desired
+*	data_grid   - array containing model data (output)
+*	file_num    - file number (output)
+*	status      - error status upon completion (output)
+*
+	INTEGER		dset_num, varpos, file_num, status,
+     .			a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .			a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo(nferdims), use_hi(nferdims), stride(nferdims)
+        REAL            data_grid(a_lo_x:a_hi_x,
+     .                            a_lo_y:a_hi_y,
+     .                            a_lo_z:a_hi_z,
+     .                            a_lo_t:a_hi_t,
+     .                            a_lo_e:a_hi_e,
+     .                            a_lo_f:a_hi_f)
+*
+* local definitions
+	INTEGER*4	STR_SAME, lcnt, lline, ivar, tcnt, pcnt
+	INTEGER*4	tmp_lo(nferdims), tmp_hi(nferdims)
+	REAL*8		tstep, TM_WORLD
+
+        is_mc = .FALSE.
+
+* Is it a MC data set?
+  	IF (STR_SAME(ds_type(dset_num), '  MC') .EQ. 0) THEN
+            is_mc = .TRUE.
+	    CALL MC_READ  ( dset_num, varpos,
+     .			a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .			a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo, use_hi, stride,
+     .			data_grid, file_num, status )
+	    IF (status .NE. merr_ok) GOTO 9999
+	ELSEIF (STR_SAME(ds_type(dset_num), 'CDF') .EQ. 0
+     .    .OR.  STR_SAME(ds_type(dset_num), 'ECDF') .EQ. 0) THEN
+* It's a CDF or an EPIC CDF data set
+          CALL CD_READ( dset_num, varpos,
+     .			a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .			a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .                  use_lo, use_hi, stride,
+     .                  data_grid, cd_stepfile(dset_num),status)
+	  IF (status .NE. merr_ok) GOTO 9999
+        ELSE
+
+          CALL TM_ERRMSG(merr_notsupport, status, 'TM_CHOOSE_READ',
+     .                  dset_num, no_stepfile,
+     .                  'Unknown data set type: '//ds_type(dset_num),
+     .                  no_errstring, *9999)
+	ENDIF
+	status = merr_ok
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_clean_filename.F b/fmt/src/tm_clean_filename.F
new file mode 100644
index 0000000..94885e1
--- /dev/null
+++ b/fmt/src/tm_clean_filename.F
@@ -0,0 +1,114 @@
+	CHARACTER*(*) FUNCTION TM_CLEAN_FILENAME ( pathname )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* remove the directory path and the extension from a full pathname leaving
+* only the filename
+
+*  written 6/92 by S.H. for PMEL/TMAP
+* 5/93 - *sh* modified so endings other than .cdf and .des are returned
+* v5.32 *kob* - CYGWIN Prob - when running under Win32/Cygwin, have to
+*  3/01         to check to see if file from which a clean filename is
+*               being extracted is a DODS file.  If it is, we have to use
+*               the "typical" unix path separator of "/" rather than the
+*               CYGWIN path separator of "\".  Otherwise we don't get a 
+*               clean filename extracted from the dataset.  This will 
+*               cause problems in find_dset_number and find_dset_name
+* 2/03 - *acm*  clean off .nc as well as .cdf and .des
+*               Note this may change the names of dynamic grids, which are
+*               generated from dataset names
+
+#include "gt_lib.parm"
+
+* argument
+	CHARACTER*(*) pathname
+
+* local variable
+        INTEGER idot, islash, plen
+* *kob* 3/01 Insert Cygwin specific variables
+#ifdef __CYGWIN__
+	CHARACTER DODSPathSeparator
+	LOGICAL DODS_file
+	PARAMETER (DODSPathSeparator='/')
+	DATA DODS_file  / .FALSE. /
+#endif
+
+* initialize
+        plen = LEN( pathname )
+
+* locate the last dot in the name
+        DO 100 idot = plen, 1, -1
+ 100    IF ( pathname(idot:idot) .EQ. '.' ) GOTO 190
+        idot = plen + 1    ! no dot
+ 190    idot = idot - 1
+
+* 5/93 other than .des or .cdf should not be cleaned off 
+	IF ( plen-idot .EQ. 4 ) THEN
+	   IF (   pathname(idot+1:plen) .NE. '.cdf'
+     .      .AND. pathname(idot+1:plen) .NE. '.des' ) idot = plen
+	ELSEIF ( plen-idot .EQ. 3 ) THEN
+	   IF (   pathname(idot+1:plen) .NE. '.nc' ) idot = plen
+	ELSE
+	   idot = plen
+	ENDIF
+
+* locate the last slash in the name
+* *kob* 3/01 - if under cygwin, have to check if the file is a DODS
+*              file - if so, use proper path separator
+#ifdef __CYGWIN__
+	DODS_file = INDEX(pathname,'://') .GT. 0
+        DO 200 islash = plen, 1, -1
+ 	   IF (DODS_file) THEN
+	      IF ( pathname(islash:islash) .EQ. DODSPathSeparator ) GOTO 290
+	   ELSE
+	      IF ( pathname(islash:islash) .EQ. PathSeparator ) GOTO 290
+ 200	   ENDIF
+	   islash = 0		! no slash
+ 290	   islash = islash + 1
+#else   
+        DO 200 islash = plen, 1, -1
+ 200    IF ( pathname(islash:islash) .EQ. PathSeparator ) GOTO 290
+        islash = 0    ! no slash
+ 290    islash = islash + 1
+#endif
+* check for pathological name
+        IF ( islash .GT. idot ) idot = plen
+	
+        TM_CLEAN_FILENAME = pathname(islash:idot)
+
+	RETURN
+	END
+
diff --git a/fmt/src/tm_close_set.F b/fmt/src/tm_close_set.F
new file mode 100644
index 0000000..328d10c
--- /dev/null
+++ b/fmt/src/tm_close_set.F
@@ -0,0 +1,237 @@
+	SUBROUTINE TM_CLOSE_SET ( ds_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Reclaim a data set by re-initializing all associated common variables.
+* Initialize all the variables with the set up values, except for:
+*	ds_var_setnum		= set_not_open
+*	ds_alert_on_open	= .FALSE.
+*	ds_alert_on_output	= .FALSE.
+*	ds_regsteps		= .TRUE.
+*	sf_setnum		= set_not_open
+*	sf_valid		= .FALSE.
+*	sf_lunit		= file_not_open	
+*	sf_regvars		= .TRUE.
+*	sf_regtimes		= .TRUE.
+*
+* programmer - mark verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 09/11/86 - based on TM_ONLY1_STEP
+* revision 1.00 - 03/19/87 - based on TM_CLOSE_SET by S. HANKIN
+* revision 1.10 - 05/07/87 - added clean up of grid, and integration_tstep
+* revision 1.11 - 07/07/87 - removed ds_revision
+* revision 1.12 - 10/30/87 - removed ds_make_dscrip_rev
+* revision 1.13 - 07/09/88 - aux_parm becomes parm_name and parm_text, and
+*			     aux_modnum, aux_parm(s) now initialized in do loop
+* revision 1.14 - 10/31/88 - added ds_var_modline
+* revision 1.15 - 11/21/88 - changed re-initialization to specific char_initXX
+* revision 1.16 - 02/08/89 - removed ds_var_modline
+* revision 1.20 - 02/15/89 - Renamed TM_CLOSE_SET - added var_file variables -
+*			     changed GT_CLOSE_STEP to TM_CLOSE_STEP, removed
+*			     ds_open
+* revision 1.21 - 04/24/91 - increased size of sf_name, ds_name and ds_des_name
+* netCDF support *sh* 6/92
+* EPIC netCDF *sh* 3/93
+* v500 - *kob* 3/99 -  initialize ds_var_code, ds_var_units, ds_var_title
+*                      and ds_var_titl_mod w/ char_inits of proper new value
+* v500 - *kob* 4/99 - increase size of sf_name and ds_des_name for lengthly
+*	              DODS filenames
+* V510 *sh* 4/00 - deallocate grids and axes used by variables in this data set
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01 remove VMS include statements
+* v552 *acm*  3/03 bug fix: If maxstepfiles > maxvarfiles, got error on closing dataset.
+* V552 *acm*  5/03 increase size of ds_var_code from 64 to 128 chars
+* V581 *acm*/3/05 - increase length of strings for dataset title to 1024 
+* V600 *acm* 6/05 - Attribute control.
+* V600 *acm* 2/06 - restore default values of ds_var_scale, ds_var_off, ds_var_scaleit
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V608 *acm* 10/07 Fixes for memory leak; call NCF_DELETE_DSET as a function
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* arguments:
+*	ds_num	- data set number (see COMMON /XSTEP_FILES/)
+
+	include 'tmap_errors.parm'	! error code parameter defs
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+* argument declarations
+	INTEGER ds_num, status
+
+* internal variable declarations
+        LOGICAL   its_cdf
+	INTEGER   NCF_DELETE_DSET, 
+     .            f_num,ivar, iparm, iaux, idim
+
+* initialize: do we have an open set?
+	IF (ds_name(ds_num) .EQ. char_init1024) GOTO 9000
+
+* save the data format
+        its_cdf = ds_type(ds_num) .EQ. 'CDF'
+     .     .OR.   ds_type(ds_num) .EQ. 'ENS'
+     .     .OR.   ds_type(ds_num) .EQ. 'ECDF' 
+
+* First clear variables associated only with data set number
+	ds_type(ds_num)			=	char_init04
+	ds_format(ds_num)		=	char_init04
+	ds_source_class(ds_num)		=	char_init16
+	ds_source(ds_num)		=	char_init16
+	ds_subsource(ds_num)		=	char_init16
+	ds_prog_rev(ds_num)		=	char_init04
+********************************************************************************
+	ds_expnum(ds_num)		=	char_init04
+	ds_modnum(ds_num)		=	char_init04
+	ds_title(ds_num)		=	char_init1024
+	ds_mod_title(ds_num)		=	char_init1024
+	ds_forcing_set(ds_num)		=	char_init16
+	ds_t0time(ds_num)		=	char_init20
+	ds_time_unit(ds_num)		=	real4_init
+	ds_ntegrate_tstep(ds_num)	=	real4_init
+	ds_ntuple(ds_num)		=	int4_init
+	ds_time_run(ds_num)		=	char_init20
+	DO 100 iaux = 1,num_aux
+	  ds_aux_modnum(iaux,ds_num)	=	char_init04
+  100	CONTINUE
+	DO 110 iparm = 1,num_parm
+	  ds_parm_name(iparm,ds_num)	=	char_init20
+	  ds_parm_text(iparm,ds_num)	=	char_init80
+  110	CONTINUE
+********************************************************************************
+	ds_alert_on_open(ds_num)	= 	.FALSE.
+	ds_alert_on_output(ds_num)	= 	.FALSE.
+	ds_message(ds_num)		=	char_init80
+********************************************************************************
+* Note that ds_basic_axes relate to the TMAP model output
+
+	ds_des_name(ds_num)		=	char_init1024
+	ds_name(ds_num)			=	char_init1024
+	ds_1step(ds_num)		=	real8_init
+	ds_lastep(ds_num)		=	real8_init
+	ds_delstep(ds_num)		=	real8_init
+	ds_regsteps(ds_num)		=	.TRUE.
+	ds_basic_axes(1,ds_num)		=	int4_init
+	ds_basic_axes(2,ds_num)		=	int4_init
+	ds_basic_axes(3,ds_num)		=	int4_init
+	ds_basic_axes(4,ds_num)		=	int4_init
+	ds_basic_axes(5,ds_num)		=	int4_init
+	ds_basic_axes(6,ds_num)		=	int4_init
+	ds_time_axis(ds_num)		=	int4_init
+	ds_accepts_remote(ds_num)	= 	.FALSE.
+
+* Next clear variables associated with variable in that data set.
+	DO 130 ivar = 1,maxvars
+	  IF (ds_var_setnum(ivar) .NE. ds_num) GOTO 130
+* ... deallocate grids and axes used by the dat aset
+	  CALL TM_DEALLO_DYN_GRID( ds_grid_number(ivar))
+*	  ds_var_code(ivar)		=	char_init128
+          CALL string_array_modify(ds_var_code_head, ivar,
+     .                             char_init128,
+     .                             LEN(char_init128))
+	  ds_var_title(ivar)		=	char_init1024
+	  ds_var_titl_mod(ivar)		=	char_init1024
+	  ds_var_units(ivar)		=	char_init64
+	  ds_grid_number(ivar)		=	int4_init
+	  ds_missing_flag(ivar)		=	real4_init
+	  ds_bad_flag(ivar)		=	real4_init
+	  DO 120 idim = 1, nferdims
+	     ds_ordering(idim,ivar)	=	int4_init
+	     ds_grid_start(idim,ivar)	=	int4_init
+	     ds_grid_end(idim,ivar)	=	int4_init
+  120	  CONTINUE
+	  ds_precision(ivar)		=	char_init01
+	  ds_aux_set_num(ivar)		=	int4_init
+********************************************************************************
+	  ds_ndataperrec(ivar)		=	int4_init
+	  ds_nrecpervar(ivar)		=	int4_init
+	  ds_nrecb4var(ivar)		=	int4_init
+	  ds_var_setnum(ivar) 		=	set_not_open
+	  ds_var_scaleit(ivar) 		=	.FALSE.
+	  ds_var_scale(ivar) 		=	1.0
+	  ds_var_off(ivar) 		=	0.0
+
+  130	CONTINUE
+
+* Now loop through stepfiles and initialize associated entries, closing files
+* if necessary
+
+	DO 140 f_num = 1, maxstepfiles
+	  IF (sf_setnum(f_num) .NE. ds_num) GOTO 140
+
+* close step file or CDF file ?
+	  IF ( sf_lunit (f_num) .NE. file_not_open) THEN	! open ?
+            IF ( its_cdf ) THEN
+               CALL CD_CLOSE_SET( sf_lunit(f_num), status )
+            ELSE
+	       CALL TM_CLOSE_STEP (f_num, status)
+            ENDIF
+	    IF (status .NE. merr_ok) GOTO 9900
+	  ENDIF
+
+* delete step file from tables
+	  sf_name(f_num)		=	char_init256    ! *kob* 4/99
+	  sf_setnum(f_num)		=	set_not_open
+	  sf_aux_set_num(f_num)		=	int4_init
+	  sf_nrecperstep(f_num)		=	int4_init
+	  sf_skip(f_num)		=	int4_init
+	  sf_1step(f_num)		=	real8_init
+	  sf_lastep(f_num)		=	real8_init
+	  sf_delta(f_num)		=	real8_init
+	  sf_reclen(f_num)		=	int4_init
+	  sf_valid(f_num)		=	.FALSE.
+	  sf_lunit(f_num)		=	file_not_open	
+	  sf_index(f_num)		=	char_init23
+	  sf_regvars(f_num)		=	.TRUE.
+	  sf_regtimes(f_num)		=	.TRUE.
+  140	CONTINUE
+
+        DO 150 f_num = 1, maxvarfiles
+	  vf_firstvar(f_num)		=	int4_init
+	  vf_lastvar(f_num)		=	int4_init
+  150   CONTINUE
+
+	status = NCF_DELETE_DSET(ds_num)
+        GOTO 9900
+
+ 9000	status = merr_ok
+
+ 9900	RETURN
+	END
diff --git a/fmt/src/tm_close_step.F b/fmt/src/tm_close_step.F
new file mode 100644
index 0000000..cb5e419
--- /dev/null
+++ b/fmt/src/tm_close_step.F
@@ -0,0 +1,79 @@
+	SUBROUTINE TM_CLOSE_STEP ( f_num, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* close a file of time step data
+* if called with a negative file number this subroutine returns without action
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/20/85
+* revision 0.10 - 02/04/85 - added freeing of logical unit after close
+* revision 0.20 - 02/15/89 - renamed TM_CLOSE_STEP, renamed sf_num to f_num
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* arguments:
+*	f_num	- number (in /XSTEP_FILES/) of file to close
+*	status	- error status on completion
+
+	include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+	INTEGER		f_num,status,lunit
+
+* initialize
+	status = merr_ok			! innocent until proven guilty
+
+* interpret a negative or zero f_num as a no-op
+	IF (f_num .LE. 0) RETURN
+
+* normal situation - close the file as requested and free the logical unit
+* number
+	lunit = sf_lunit(f_num)
+	CLOSE (UNIT = lunit, ERR = 5000)
+	CALL LIB_FREE_LUN (lunit)
+	sf_lunit(f_num) = file_not_open	! signals "closed"
+ 2000	RETURN
+
+* report ERR= error
+ 5000	CALL TM_ERRMSG ( merr_erreq, status, 'TM_CLOSE_STEP',
+     .			 sf_setnum(f_num), f_num,
+     .			 no_errstring, no_errstring , *2000)
+	END
diff --git a/fmt/src/tm_cmprss.F b/fmt/src/tm_cmprss.F
new file mode 100644
index 0000000..84a00d8
--- /dev/null
+++ b/fmt/src/tm_cmprss.F
@@ -0,0 +1,86 @@
+	CHARACTER*132 FUNCTION TM_CMPRSS( instring )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Takes multiple blanks and tabs in a string and replaces them with a
+* single blank.
+*
+*	written by M. Verschell  04/03/87 for PMEL/TMAP
+*
+* revision 0.00 - 04/03/87
+*
+* argument
+	CHARACTER*(*)	instring
+
+* local definitions
+	CHARACTER*1	tab
+	INTEGER		inlen, i, pos, nblnk, blnk
+
+	tab = CHAR(09)
+
+	TM_CMPRSS =  ' '
+	inlen = LEN(instring)
+	pos = 0
+	blnk = 1
+
+* Find next non-blank or non-tab character
+ 100	DO i = blnk,inlen
+	  IF (instring(i:i) .NE. ' ' .AND. instring(i:i) .NE. tab) THEN
+* Store postion of non-blank character in input string
+	    nblnk = i
+* Pos is where that character goes in output string
+	    pos = pos + 1
+	    GOTO 200
+	  ENDIF
+	ENDDO
+* If we get this far all that's left is trailing blanks (tabs)
+	GOTO 9990
+
+* transfer non-blank characters to output one-at-a-time until blank/tab
+ 200	DO i = nblnk,inlen
+	  IF (instring(i:i) .NE. ' ' .AND. instring(i:i) .NE. tab) THEN
+	    TM_CMPRSS(pos:pos) = instring(i:i)
+	    pos = pos + 1
+	  ELSE
+* first blank character
+	    TM_CMPRSS(pos:pos) = ' '
+	    blnk = i
+	    GOTO 100
+	  ENDIF
+	ENDDO
+* done with string
+9990	RETURN
+	END	    
diff --git a/fmt/src/tm_conv_to_r4.F b/fmt/src/tm_conv_to_r4.F
new file mode 100644
index 0000000..386ca38
--- /dev/null
+++ b/fmt/src/tm_conv_to_r4.F
@@ -0,0 +1,121 @@
+	SUBROUTINE TM_I4_TO_R4( input, vals, n)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert an array of INTEGER*4 values into REAL
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+*
+* argument declarations
+      INTEGER n
+      INTEGER*4 input(n)
+      REAL  vals(n)
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  vals(i) = input(i)
+
+      RETURN
+      END
+
+***************************************************************
+
+	SUBROUTINE TM_I2_TO_R4( input, vals, n)
+
+* convert an array of INTEGER*2 values into REAL
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+
+* argument declarations
+      INTEGER n
+      INTEGER*2 input(n)
+      REAL  vals(n)
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  vals(i) = input(i)
+
+      RETURN
+      END
+
+***************************************************************
+	SUBROUTINE TM_I1_TO_R4( input, vals, n)
+
+* convert an array of INTEGER*4 values into REAL
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+
+* argument declarations
+      INTEGER n
+      REAL  vals(n)
+#ifdef sun
+      BYTE input(n)
+#else
+#	if unix
+      		INTEGER*1 input(n)
+#	else
+      		BYTE input(n)
+#	endif
+#endif
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  vals(i) = input(i)
+
+      RETURN
+      END
diff --git a/fmt/src/tm_conv_to_r8.F b/fmt/src/tm_conv_to_r8.F
new file mode 100644
index 0000000..0e66c25
--- /dev/null
+++ b/fmt/src/tm_conv_to_r8.F
@@ -0,0 +1,144 @@
+	SUBROUTINE TM_I4_TO_R8( input, dvals, n)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert an array of INTEGER*4 values into REAL*8
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+
+* argument declarations
+      INTEGER n
+      INTEGER*4 input(n)
+      REAL*8  dvals(n)
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  dvals(i) = input(i)
+
+      RETURN
+      END
+
+***************************************************************
+	SUBROUTINE TM_R4_TO_R8( input, dvals, n)
+
+* convert an array of REAL*4 values into REAL*8
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+
+* argument declarations
+      INTEGER n
+      REAL*4  input(n)
+      REAL*8  dvals(n)
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  dvals(i) = input(i)
+
+      RETURN
+      END
+
+***************************************************************
+	SUBROUTINE TM_I2_TO_R8( input, dvals, n)
+
+* convert an array of INTEGER*2 values into REAL*8
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+
+* argument declarations
+      INTEGER n
+      INTEGER*2 input(n)
+      REAL*8  dvals(n)
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  dvals(i) = input(i)
+
+      RETURN
+      END
+
+***************************************************************
+	SUBROUTINE TM_I1_TO_R8( input, dvals, n)
+
+* convert an array of INTEGER*4 values into REAL*8
+* use backwards loop so input and output can be same array
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+
+* argument declarations
+      INTEGER n
+      REAL*8  dvals(n)
+#ifdef sun
+      BYTE input(n)
+#else
+#	if unix
+      		INTEGER*1 input(n)
+#	else
+      		BYTE input(n)
+#	endif
+#endif
+
+* local variable declarations
+      INTEGER i
+
+      DO 100 i = n, 1, -1
+ 100  dvals(i) = input(i)
+
+      RETURN
+      END
diff --git a/fmt/src/tm_copy_grid.F b/fmt/src/tm_copy_grid.F
new file mode 100644
index 0000000..d830425
--- /dev/null
+++ b/fmt/src/tm_copy_grid.F
@@ -0,0 +1,62 @@
+	SUBROUTINE TM_COPY_GRID ( source, dest )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Copies grid information from source to dest
+*
+* revision 0.00 - 11/22/88
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+*
+* Arguments
+	INTEGER*4	source, dest
+*
+* Parameters and commons
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+*
+* Local declarations
+	INTEGER*4	icnt
+*
+	grid_name(dest) = grid_name(source)
+	DO 100 icnt = 1,nferdims
+	  grid_line(icnt,dest) = grid_line(icnt,source)
+	  grid_out_prod(icnt,dest) = grid_out_prod(icnt,source)
+  100	CONTINUE
+	grid_rotation(dest) = grid_rotation(source)
+	RETURN
+	END
diff --git a/fmt/src/tm_copy_grid_w_line_use.F b/fmt/src/tm_copy_grid_w_line_use.F
new file mode 100644
index 0000000..eca8ac2
--- /dev/null
+++ b/fmt/src/tm_copy_grid_w_line_use.F
@@ -0,0 +1,66 @@
+	SUBROUTINE TM_COPY_GRID_W_LINE_USE ( source, dest )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Copies grid information from source to dest
+* and passes along responsibility for associated dynamic lines
+
+* 10/95 for Ferret V4.20
+* V510 4/00 *sh* - use counts now apply to ALL axes
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Arguments
+	INTEGER*4	source, dest
+*
+* Parameters and commons
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+*
+* Local declarations
+	INTEGER*4	icnt
+*
+
+* copy the grid
+	CALL TM_COPY_GRID( source, dest )
+
+* give the new grid responsibility for dynimic lines it has inherited
+	DO 100 icnt = 1,nferdims
+	   CALL TM_USE_LINE( grid_line(icnt,dest) )
+  100	CONTINUE
+	RETURN
+	END
diff --git a/fmt/src/tm_copy_line.F b/fmt/src/tm_copy_line.F
new file mode 100644
index 0000000..e02168e
--- /dev/null
+++ b/fmt/src/tm_copy_line.F
@@ -0,0 +1,85 @@
+	SUBROUTINE TM_COPY_LINE ( source, dest )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Copies line information from source to dest
+*
+* revision 0.00 - 11/22/88
+* 10/95 - check to see if a dynamic line -- some variables don't get copied
+*  1/96 - repaired bug (incomplete test) in 10/95 check
+*  1/01 - *acm* add line_cal_name parallel with treatment of line_t0
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V62  *acm* 3/09 - copy line_name_orig, used to keep original axis names 
+*                   for use with attribute structure, e.g. save/keep_axisname
+
+* Arguments
+	INTEGER*4	source, dest
+*
+* Parameters and commons
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+*
+	line_name(dest)      = line_name(source)
+	line_name_orig(dest) = line_name_orig(source)
+	line_dim(dest)       = line_dim(source) 
+	line_units(dest)     = line_units(source) 
+	line_unit_code(dest) = line_unit_code(source) 
+	line_direction(dest) = line_direction(source) 
+	line_regular(dest)   = line_regular(source) 
+	line_modulo(dest)    = line_modulo(source) 
+	line_start(dest)     = line_start(source) 
+	line_delta(dest)     = line_delta(source) 
+	line_t0(dest)        = line_t0(source) 
+	line_shift_origin(dest) = line_shift_origin(source) 
+	line_tunit(dest)     = line_tunit(source) 
+	line_cal_name(dest)  = line_cal_name(source) 
+
+	IF ( dest.LE.max_lines .AND. source.LE.max_lines) THEN
+* non-dynamic lines, only
+	   line_subsc1(dest)    = line_subsc1(source)
+	ELSEIF ( dest.GT.max_lines .AND. source.GT.max_lines) THEN! ELSEIF 1/96
+* dynamic lines, only
+	   line_class (dest)	= line_class (source)
+	   line_parent(dest)	= line_parent(source)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_ctof_strng.F b/fmt/src/tm_ctof_strng.F
new file mode 100644
index 0000000..0ffaa95
--- /dev/null
+++ b/fmt/src/tm_ctof_strng.F
@@ -0,0 +1,97 @@
+	SUBROUTINE TM_CTOF_STRNG ( cstrng, fstrng, clen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a null-terminated Hollerith (suitable for passing to a c routine) to
+* a FORTRAN-style character string 
+* normally the c string should be at least 1 byte longer than the FORTRAN
+*    string to accomodate the null terminator
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix operating system
+*
+* rev 0.0 -   5/6/91
+*  Sun Port 1/30/92 -kob-  added ifdef sun because uses BYTE where DECstation uses
+*                          INTEGER*1
+*
+* IBM PORT 14apr94 *kob* : IBM compiler fussy about argument types
+*
+* Linux port 10/96 *kob*: for some reason, cstrng was declared as a 
+*			  type byte even if the machine was not a 
+*			  sun...this is wrong and I changed it back
+* calling arguments:
+* cstrng - BYTE (INTEREG*1) string (passed by pointer)
+* fstrng - CHARACTER string (passed by descriptor)
+* clen   - length of passed Hollerith array
+
+#ifdef unix
+* calling argument declarations:
+        INTEGER clen
+        CHARACTER*(*) fstrng
+#ifdef sun
+        BYTE      cstrng(clen)
+#else
+	INTEGER*1 cstrng(clen)			!*kob* 10/96
+c	BYTE      cstrng(clen)			
+#endif
+
+* internal variable declarations:
+	INTEGER	i, flen
+#ifdef AIX_XLF
+	INTEGER one_char
+#endif
+
+* initialize
+        flen = LEN(fstrng)
+        fstrng = ' '
+
+* copy from null-terminated Hollerith to CHARACTER
+        DO 100 i = 1, MIN(clen, flen)
+           IF ( cstrng(i) .EQ. 0 ) RETURN
+#ifdef AIX_XLF
+*use temp storage for IBM fussy IBM compiler
+	one_char = cstrng(i)
+ 100	fstrng(i:i) = CHAR(one_char)
+#else
+ 100    fstrng(i:i) = CHAR(cstrng(i))
+#endif
+	RETURN
+#else
+        STOP 'TM_FTOC_STRNG is for Unix systems, only'
+#endif
+	END
+
diff --git a/fmt/src/tm_date.F b/fmt/src/tm_date.F
new file mode 100644
index 0000000..851b66b
--- /dev/null
+++ b/fmt/src/tm_date.F
@@ -0,0 +1,110 @@
+	LOGICAL FUNCTION TM_DATE( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* naive test to see if the given string may be a date
+* complete date format is dd-mmm-yy:hh:mm:ss where mmm is a string
+* naive test insists that
+*     1) first character is a digit
+*     2) contains : or -
+*     3) if "-" must be followed by 3 characters
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 3/12/91 needed for Unix/RISC port
+* 1/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead
+*
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER		i, ip, slen
+	CHARACTER*1	c
+	
+* local parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* initialize assuming failure
+	TM_DATE = .FALSE.
+
+* skip leading blanks
+        slen = LEN(string)
+	DO 100 i = 1, slen
+	   c = string(i:i)
+	   IF ( c .NE. ' ' .AND. c .NE. tab ) GOTO 200
+ 100	CONTINUE
+* string is blank
+	RETURN
+
+* is first character a digit ?
+* modified 6/92 -- kob
+* 200    IF ( c .LE. '0' .OR. c .GE. '9' ) RETURN
+ 200    IF ( c .LT. '0' .OR. c .GT. '9' ) RETURN
+
+* is there a colon ?
+        IF ( INDEX( string, ':') .GT. 0 ) THEN
+           TM_DATE = .TRUE.
+           RETURN
+        ENDIF
+
+* is there a dash ?
+        ip = INDEX( string, '-')
+        IF ( ip .EQ. 0 ) RETURN
+
+* do three letters follow the dash ?
+        IF ( slen .LT. ip+3 ) RETURN
+        DO 300 i = ip+1, ip+3
+           c = string(i:i)
+           IF ( ( c.GE.'A' .AND. c.LE.'Z' )
+     .    .OR.  ( c.GE.'a' .AND. c.LE.'z' ) ) GOTO 300
+* not a letter
+	   RETURN
+ 300    CONTINUE
+
+* it meets the requirements
+        TM_DATE = .TRUE.
+        RETURN
+
+        END
diff --git a/fmt/src/tm_date_ok.F b/fmt/src/tm_date_ok.F
new file mode 100644
index 0000000..2b587e2
--- /dev/null
+++ b/fmt/src/tm_date_ok.F
@@ -0,0 +1,64 @@
+	LOGICAL FUNCTION TM_DATE_OK( date, cal_id )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine whether a date string is acceptably formatted
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* 7/92 *sh* 
+* V530: *acm* 12/00 alternative calendar types; cal_id
+
+* calling argument declarations:
+      CHARACTER*(*) date
+      INTEGER cal_id
+
+* internal variable declarations:
+      INTEGER	yr, mth, day, hr, min, sec, status
+
+#ifdef unix
+        include 'tmap_errors.parm'
+#else
+        INCLUDE 'TMAP_FORMAT:TMAP_ERRORS.PARM'
+#endif
+
+      CALL TM_BREAK_DATE( date, cal_id,
+     .                   yr, mth, day, hr, min, sec, status )
+      TM_DATE_OK = status .EQ. merr_ok
+
+      RETURN
+      END
diff --git a/fmt/src/tm_date_reformat.F b/fmt/src/tm_date_reformat.F
new file mode 100644
index 0000000..7bfeaa8
--- /dev/null
+++ b/fmt/src/tm_date_reformat.F
@@ -0,0 +1,85 @@
+	SUBROUTINE TM_DATE_REFORMAT( indate,  inform, cal_id, 
+     .				     outdate, outform, do_err, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This function will convert a date in format inform into a date in
+* format outform
+
+* *sh* 2/13/95
+* *acm* needs cal_id to pass to tm_break_fmt_date
+* V600 *acm* 2/06 - Fix for bug 1394, send do_err flag to tm_break_date
+*
+* Arguments:
+*	indate	 - input date string
+*	inform	 - code for input format
+*       cal_id id for calendar type of input date
+*	outdate	 - output date string
+*	outform	 - code for output format
+*	status   - returning status
+*
+        LOGICAL         do_err
+	CHARACTER*(*)	indate, outdate
+	INTEGER		inform, outform, status, cal_id
+*
+* Inclusions
+*
+	include 'tmap_errors.parm'
+
+*
+* Local definitions
+*
+	INTEGER	year, month, day, hour, minute, second, dlen
+
+* Break up the input date string to its various components
+	CALL TM_BREAK_FMT_DATE ( inform, indate, cal_id, year, 
+     .                        month, day, hour, minute, second, 
+     .                        do_err, status )
+	IF ( status .NE. merr_ok ) GOTO 9000
+
+* and reassemble it into the desired output format
+	CALL TM_MAKE_FMT_DATE ( outform, outdate, year, month, day,
+     .				   hour, minute, second, dlen )
+
+* Finished
+	status = merr_ok
+	RETURN
+
+* Errors
+ 9000	RETURN
+	END
+
+
+
diff --git a/fmt/src/tm_date_time.F b/fmt/src/tm_date_time.F
new file mode 100644
index 0000000..d4cab3f
--- /dev/null
+++ b/fmt/src/tm_date_time.F
@@ -0,0 +1,51 @@
+	CHARACTER*21 FUNCTION TM_DATE_TIME ()
+	
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* V50 - 2/99 *kob* modifications for y2k preparedness.  call 
+*                  GET_DATE_AND_TIME which uses FDATE to get
+*                  date and time rather than DATE and TIME
+* 
+* V6.74 3/12 *acm* cleanup: add disclaimer
+
+
+	CHARACTER*8	mtime
+	CHARACTER*9	mdate
+* 2/99 *kob* modifications for y2k preparedness.  call GET_DATE_AND_TIME
+*            to get date and time
+	CALL GET_DATE_AND_TIME(mdate, mtime)
+	TM_DATE_TIME = mdate//' '//mtime
+	RETURN
+	END
diff --git a/fmt/src/tm_date_to_step.F b/fmt/src/tm_date_to_step.F
new file mode 100644
index 0000000..fa313d0
--- /dev/null
+++ b/fmt/src/tm_date_to_step.F
@@ -0,0 +1,116 @@
+	REAL*8 FUNCTION TM_DATE_TO_STEP ( dset_num, date, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This function will return a REAL*8 number giving the time step for a given
+* date for a particular data set. This is done by figuring the offset from
+* 01-JAN-0000 00:00:00 in seconds, and then calculating the timestep.
+*
+* written 06/17/87 by Mark Verschell for PMEL/TMAP
+*
+* revision 0.00	- 06/17/87 - initial incarnation
+* revision 0.01 - 07/08/88 - Returns status code, handles errors from
+*			     TM_BREAK_DATE
+* V5.3 *acm* 1/01  add cal_id for TM_BREAK_DATE
+** V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments:
+*	dset_num - data set number
+*	date	 - date of interest
+*	status   - returning status
+*
+	CHARACTER*20	date
+	INTEGER		dset_num, status
+*
+* Inclusions
+*
+
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+*
+* Local definitions
+*
+	INTEGER		year, month, day, hour, minute, second, istat,
+     .			t0year, t0mon, t0day, t0hour, t0min, t0sec
+
+	INTEGER		TM_GET_CALENDAR_ID, cal_id
+	REAL*8		date_secs, start_secs, offset_secs
+	REAL*8		TM_SECS_FROM_BC
+
+* Break up the date string to it's various components
+
+        cal_id = TM_GET_CALENDAR_ID (ds_cal_name(dset_num) )
+	CALL TM_BREAK_DATE ( date, cal_id, year, month, day, 
+     .	                     hour, minute, second, istat)
+	IF ( istat .NE. merr_ok ) GOTO 9000
+
+* Find the offset from 01-JAN-0000 00:00:00 for this date
+	date_secs = TM_SECS_FROM_BC (cal_id, year, month, day,
+     .				     hour, minute, second, status)
+	IF ( status .NE. merr_ok ) GOTO 9990
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+	CALL TM_BREAK_DATE (ds_t0time(dset_num), cal_id, t0year, 
+     .			    t0mon, t0day, t0hour, t0min, t0sec, istat)
+	IF ( istat .NE. merr_ok ) GOTO 9100
+	start_secs = TM_SECS_FROM_BC (cal_id, t0year, t0mon, t0day,
+     .				      t0hour, t0min, t0sec, status)
+	IF ( status .NE. merr_ok ) GOTO 9990
+
+* Find the number of seconds since start of data set for this date
+	offset_secs = date_secs - start_secs
+
+* Divide by time step increment to get # of time step
+	TM_DATE_TO_STEP = offset_secs/ds_time_unit(dset_num)
+
+* Finished
+	status = merr_ok
+	GOTO 9990
+
+* Errors
+ 9000	CALL TM_ERRMSG ( istat, status, 'TM_DATE_TO_STEP',
+     .	                 dset_num, no_stepfile,
+     .			 'DD-MMM-YYYY HH:MM:SS', date, *9990 )
+ 9100	CALL TM_ERRMSG ( istat, status, 'TM_DATE_TO_STEP',
+     .	                 dset_num, no_stepfile,
+     .			 'DD-MMM-YYYY HH:MM:SS',ds_t0time(dset_num),
+     .	                 *9990 )
+
+ 9990	RETURN
+	END
diff --git a/fmt/src/tm_deallo_dyn_grid.F b/fmt/src/tm_deallo_dyn_grid.F
new file mode 100644
index 0000000..69a152f
--- /dev/null
+++ b/fmt/src/tm_deallo_dyn_grid.F
@@ -0,0 +1,80 @@
+	SUBROUTINE TM_deallo_dyn_grid( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Deallocate a grid from the dynamic grid area (above max_grids)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* V510 *sh* 4/00 - remove actual deallocation of grid to tm_deallo_dyn_grid_sub
+*		 - this routine can now be called for static grids, too
+*		 - deallocate lines only for dynamic grids, since static grids
+*		   do not get deleted when their use count falls to zero
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+		include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER grid
+
+* Local definitions
+	INTEGER idim
+
+* deallocate the grid, itself
+	CALL TM_DEALLO_DYN_GRID_SUB(grid)
+
+* if the grid was actually removed, then also deallocate the axes that it used
+	IF ( grid .GT. max_grids
+     . .AND. grid_use_cnt(grid) .EQ. 0 ) THEN
+
+*release claim to any dynamic lines this may use
+	   DO 100 idim = 1, nferdims
+	      CALL TM_DEALLO_DYN_LINE( grid_line(idim,grid))
+ 100	   CONTINUE
+
+	ENDIF
+
+* successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_deallo_dyn_grid_sub.F b/fmt/src/tm_deallo_dyn_grid_sub.F
new file mode 100644
index 0000000..f3fa6f9
--- /dev/null
+++ b/fmt/src/tm_deallo_dyn_grid_sub.F
@@ -0,0 +1,99 @@
+	SUBROUTINE TM_deallo_dyn_grid_sub( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Deallocate a grid from the dynamic grid area (above max_grids)
+* Without regard to the axes used by the grid
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 4/00 - extracted from tm_deallo_dyn_grid
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER grid
+
+* Local definitions
+	INTEGER next_used_grid
+
+* screen out incoming garbage
+	IF ( grid.LT.1 .OR. grid.GT.max_dyn_grids ) RETURN
+
+* decrement the used count for this grid
+	grid_use_cnt(grid) = grid_use_cnt(grid) - 1
+	IF ( grid_use_cnt(grid) .LT. 0 ) grid_use_cnt(grid) = 0
+
+* if not a dynamic grid then we're done
+	IF ( grid .LE. max_grids ) THEN
+	   RETURN
+	ENDIF
+
+* does anyone still have a claim on this grid?
+	IF ( grid_use_cnt(grid) .GT. 0 ) THEN
+	   RETURN
+
+	ELSEIF ( grid_use_cnt(grid) .EQ. 0 ) THEN
+
+	   grid_name(grid) = char_init16
+
+* take this grid from the "used" list and put it on the "free" list
+* ... hook onto free list
+	   next_used_grid   = grid_flink(grid)
+	   grid_flink(grid) = grid_free_ptr  
+	   grid_free_ptr    = grid
+	   
+* ... unhook from used list
+	   grid_flink(grid_blink(grid)) = next_used_grid
+	   grid_blink(next_used_grid)   = grid_blink(grid)
+
+	ELSE
+* internal error -- the use count is negative!!
+	   CALL TM_NOTE('Intern err: TM_DEALLO_DYN_GRID:2 !!!', lunit_errors)
+	ENDIF
+
+* successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_deallo_dyn_line.F b/fmt/src/tm_deallo_dyn_line.F
new file mode 100644
index 0000000..4be40f9
--- /dev/null
+++ b/fmt/src/tm_deallo_dyn_line.F
@@ -0,0 +1,72 @@
+	SUBROUTINE TM_DEALLO_DYN_LINE( line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Deallocate a line from the dynamic line area (above max_lines)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 10/3/95 for Ferret version 4.2
+* V5.1 *sh* 4/00 - allow static lines to be deallocated, too
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Since FORTRAN is not recursive this routine implements a poor man's
+* recursion so that the deallocation can trace down the lineage of
+* parent lines deallocating the parents if the child gets snuffed out.
+
+* Argument definitions
+	INTEGER line
+
+* Local definitions
+	INTEGER TM_DEALLO_DYN_LINE_SUB, gonner
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+
+* initialize
+	gonner = line
+
+* quasi-recursive loop
+ 10	gonner = TM_DEALLO_DYN_LINE_SUB( gonner )
+	IF (gonner.NE.0) GOTO 10
+
+* successful completion
+	RETURN
+	END
diff --git a/fmt/src/tm_deallo_dyn_line_sub.F b/fmt/src/tm_deallo_dyn_line_sub.F
new file mode 100644
index 0000000..a278576
--- /dev/null
+++ b/fmt/src/tm_deallo_dyn_line_sub.F
@@ -0,0 +1,113 @@
+	INTEGER FUNCTION TM_DEALLO_DYN_LINE_SUB( line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Deallocate a line from the dynamic line area (above max_lines)
+* Called quasi-recursively by tm_deallo_dyn_line
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 10/3/95 for Ferret version 4.2
+* V510 *sh( 4/00 - allow deallocation of non-dynamic lines
+* V600 *acm* 10/05 Call PACK_LINE_STORAGE for irregular axes to reset coord storage.
+
+* Include files
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER line
+
+* Local definitions
+	INTEGER next_used_line
+
+* initialize
+	TM_DEALLO_DYN_LINE_SUB = 0
+
+* screen out garbage (may come from temporary grids)
+	IF ( line .LT. 1 .OR. line .GT. max_dyn_lines ) RETURN
+
+* decrement the used count for this line
+	line_use_cnt(line) = line_use_cnt(line) - 1
+	IF ( line_use_cnt(line) .LT. 0 ) line_use_cnt(line) = 0
+
+* if not a dynamic line or it is a "keeper" then we are done
+	IF ( line.LE.max_lines .OR. line_keep_flag(line) ) THEN
+	   RETURN
+	ENDIF
+
+* does anyone still have a claim on this line?
+	IF ( line_use_cnt(line) .GT. 0 ) THEN
+	   RETURN
+
+* a use count of -1 results from a line which was allocated and then promptly
+* deallocated without being used
+	ELSEIF ( line_use_cnt(line) .EQ. 0 ) THEN
+
+	   line_name(line) = char_init16
+
+* take this line from the "used" list and put it on the "free" list
+* ... hook onto free list
+	   next_used_line   = line_flink(line)
+	   line_flink(line) = line_free_ptr  
+	   line_free_ptr    = line
+	   
+* ... unhook from used list
+	   line_flink(line_blink(line)) = next_used_line
+	   line_blink(next_used_line)   = line_blink(line)
+
+	ELSE
+* internal error -- the use count is negative!!
+	   CALL TM_NOTE('Intern err: TM_DEALLO_DYN_LINE:2 !!!', lunit_errors)
+	ENDIF
+
+* Recover the coordinate storage used for an irregularly-spaced line.
+        IF ( .NOT. line_regular(line) ) CALL PACK_LINE_STORAGE (line)
+
+* return flag to indicate if the quasi-recursive descent ends here
+* ... zero or index of parent axis to deallocate
+	TM_DEALLO_DYN_LINE_SUB = line_parent(line)
+
+* successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_dfp_convert.c b/fmt/src/tm_dfp_convert.c
new file mode 100644
index 0000000..992db16
--- /dev/null
+++ b/fmt/src/tm_dfp_convert.c
@@ -0,0 +1,209 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* tm_dfp_convert_:
+ * convert VAX D or IEEE big/little endian double precision floating point */
+/* into the currently active CPU representation */
+/*** use the pre-processor to select the target word type ***   */
+
+/* *sh* - home brewed */
+/* rev. 0.0 2/14/92
+ * note: "_" is appended to TM_DFP1_CNVRT by f77 when calling this */
+/* replaced "elif" syntax with
+	else
+	   if
+  for SGI port	 - kob 4/8/92 */
+
+/* added ifdef check for underscore in routine name for aix *kob* 10/94 
+ * *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+ *					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include "ferretmacros.h"
+
+#define cptype_vax 0
+#define cptype_dec 1
+#define cptype_sun 2
+
+void FORTRAN(tm_dfp_convert)( dval, author_cpu )
+  double *dval;
+  int *author_cpu;
+  {
+
+/* internal variable declarations:   */
+/* e - exponent                      */
+/* f - fraction                      */
+/* f_shf - bits from f to be shifted */
+  char i1_tmp;
+  unsigned short int i2_tmp, e, f_shf, ieee_e;
+
+/* masks                                             */
+/* smsk        - sign bit mask                       */
+/* nsmsk       - sign bit removal mask               */
+/* vax_f1_msk  - f bits from INT*2 word 1 of VAX D   */
+/* vax_shf_msk - f bits to shift off right hand end  */
+/* for some reason, linux cc needed smsk and nsmsk declared
+     on seperate lines - 3/99 *kob* */
+  short int smsk =010000;
+  short int nsmsk=077777;
+  short int vax_f1_msk=0177, vax_shf_msk=07;
+        
+  union { double dum;
+	  unsigned short int i2[4];
+	  char i1[8];
+	} u;
+
+/* move the double precision word into the union */
+  u.dum = *dval;
+
+#ifdef sun
+/* SUN is the platform in use   */
+  if    ( *author_cpu == cptype_vax )           /* VAX -> SUN */
+/* pre-swap the bytes within each 16 bit word */   
+    {
+    i1_tmp   = u.i1[0];
+    u.i1[0]  = u.i1[1];
+    u.i1[1]  = i1_tmp;
+    i1_tmp   = u.i1[2];
+    u.i1[2]  = u.i1[3];
+    u.i1[3]  = i1_tmp;
+    i1_tmp   = u.i1[4];
+    u.i1[4]  = u.i1[5];
+    u.i1[5]  = i1_tmp;
+    i1_tmp   = u.i1[6];
+    u.i1[6]  = u.i1[7];
+    u.i1[7]  = i1_tmp;
+
+/* VAX 16-bit word 1 (with sign bit and exponent)   */
+    e = ((u.i2[0] & nsmsk)>>7) - 128;
+    ieee_e = (e + 1022)<<4;
+    i2_tmp = (u.i2[0] & vax_f1_msk)>>3;  /* bits from f that stay in word 1 */
+    f_shf  =  u.i2[0] & vax_shf_msk;     /* bits from f that shift to i2[2] */
+    u.i2[0]  = (u.i2[0] & smsk) | ieee_e | i2_tmp;
+
+/* 2nd VAX 16-bit word (all f bits - shift right by 3)   */
+    i2_tmp = ((u.i2[1])>>3) | f_shf<<13;
+    f_shf  = u.i2[1] & vax_shf_msk;
+    u.i2[1]  = i2_tmp;
+
+/* 3rd VAX 16-bit word (all f bits - shift right by 3)   */
+    i2_tmp = ((u.i2[2])>>3) | f_shf<<13;
+    f_shf  = u.i2[2] & vax_shf_msk;
+    u.i2[2]  = i2_tmp;
+
+/* 4th VAX 16-bit word 4 (all f bits - right bits drop off end)   */
+    u.i2[3]  = ((u.i2[3])>>3) | f_shf<<13;
+    }
+  else if ( *author_cpu == cptype_dec )         /* DECstation -> SUN */
+    {
+    i1_tmp   = u.i1[0];
+    u.i1[0]  = u.i1[7];
+    u.i1[7]  = i1_tmp;
+    i1_tmp   = u.i1[1];
+    u.i1[1]  = u.i1[6];
+    u.i1[6]  = i1_tmp;
+    i1_tmp   = u.i1[2];
+    u.i1[2]  = u.i1[5];
+    u.i1[5]  = i1_tmp;
+    i1_tmp   = u.i1[3];
+    u.i1[3]  = u.i1[4];
+    u.i1[4]  = i1_tmp;
+    }
+ 
+#else
+#if unix
+/* DECstation is the platform in use   */
+
+  if ( *author_cpu == cptype_vax )    /* VAX --> DECstation */
+    {
+/* VAX 16-bit word 1 (with sign bit and exponent)   */
+    e = ((u.i2[0] & nsmsk)>>7) - 128;
+    ieee_e = (e + 1022)<<4;
+    i2_tmp = (u.i2[0] & vax_f1_msk)>>3;  /* bits from f that stay in word 1 */
+    f_shf  =  u.i2[0] & vax_shf_msk;     /* bits from f that shift to i2[2] */
+    u.i2[0]  = (u.i2[0] & smsk) | ieee_e | i2_tmp;
+
+/* 2nd VAX 16-bit word (all f bits - shift right by 3)   */
+    i2_tmp = ((u.i2[1])>>3) | f_shf<<13;
+    f_shf  = u.i2[1] & vax_shf_msk;
+    u.i2[1]  = i2_tmp;
+
+/* 3rd VAX 16-bit word (all f bits - shift right by 3)   */
+    i2_tmp = ((u.i2[2])>>3) | f_shf<<13;
+    f_shf  = u.i2[2] & vax_shf_msk;
+    u.i2[2]  = i2_tmp;
+
+/* 4th VAX 16-bit word 4 (all f bits - right bits drop off end)   */
+    u.i2[3]  = ((u.i2[3])>>3) | f_shf<<13;
+
+/* post-swap the 16-bit word order   */
+    i2_tmp   = u.i2[0];
+    u.i2[0]  = u.i2[3];
+    u.i2[3]  = i2_tmp;
+    i2_tmp   = u.i2[1];
+    u.i2[1]  = u.i2[2];
+    u.i2[2]  = i2_tmp;
+    }
+  else if ( *author_cpu == cptype_sun )     /* SUN -> DECstation */
+    {
+    i1_tmp   = u.i1[0];
+    u.i1[0]  = u.i1[7];
+    u.i1[7]  = i1_tmp;
+    i1_tmp   = u.i1[1];
+    u.i1[1]  = u.i1[6];
+    u.i1[6]  = i1_tmp;
+    i1_tmp   = u.i1[2];
+    u.i1[2]  = u.i1[5];
+    u.i1[5]  = i1_tmp;
+    i1_tmp   = u.i1[3];
+    u.i1[3]  = u.i1[4];
+    u.i1[4]  = i1_tmp;
+    }
+
+#else
+/* VAX is the platform in use   */
+     /* not yet figgered out */
+#endif   /* decstation */
+#endif   /* sun */
+
+/* return the value   */
+  *dval = u.dum;
+
+  return ;
+  }
diff --git a/fmt/src/tm_dfpeq.F b/fmt/src/tm_dfpeq.F
new file mode 100644
index 0000000..8214aa7
--- /dev/null
+++ b/fmt/src/tm_dfpeq.F
@@ -0,0 +1,65 @@
+	LOGICAL FUNCTION TM_DFPEQ ( a, b )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if REAL*8 floating point numbers are equal to within
+* "reasonable" accuracy
+* Using 2.E-47 though it may not be the optimal precision level
+* NOAA/PMEL, Seattle, WA 
+*
+* V500 - New routine - taken from tm_fpeq.F  *kob*
+* V68  *acm* 1/12  minor changes for double-precision ferret.
+*      *kms*  3/12 modified to actually use the maximum absolute error
+*
+
+* calling arguments:
+	REAL*8	a, b
+
+* local parameters
+	REAL*8	   epsilon, eps
+	PARAMETER ( epsilon = 4.D-15 )
+
+* set the maximum relative error
+        eps = ABS(b) * epsilon
+* if close to zero, set the maximum absolute error
+        IF ( eps .LT. epsilon ) eps = epsilon
+
+* do the comparison
+
+	TM_DFPEQ = ( ABS(a-b) .LE. eps )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_dfpeq_tol.F b/fmt/src/tm_dfpeq_tol.F
new file mode 100644
index 0000000..3f82d48
--- /dev/null
+++ b/fmt/src/tm_dfpeq_tol.F
@@ -0,0 +1,63 @@
+	LOGICAL FUNCTION TM_DFPEQ_TOL ( a, b, epsilon )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if REAL*8 floating point numbers are equal to within
+* given accuracy
+* NOAA/PMEL, Seattle, WA 
+*
+* V500 
+* V570 - New routine - taken from tm_fpeq.F  *acm*
+*      - e.g. fix for bug 857, called from mc_read.F, use eps=4.e-15
+*     *kms*  3/12 modified to actually use the maximum absolute error
+*
+
+* calling arguments:
+	REAL*8 a, b, epsilon
+
+* local variables
+        REAL*8 abmin, eps
+
+* set the maximum relative error
+        abmin = MIN( ABS(a), ABS(b) )
+        eps = abmin * ABS(epsilon)
+* if close to zero, set the maximum absolute error
+        IF ( eps .LT. ABS(epsilon) ) eps = ABS(epsilon)
+
+	TM_DFPEQ_TOL = ( ABS(a-b) .LE. eps )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_digit.F b/fmt/src/tm_digit.F
new file mode 100644
index 0000000..3932e0b
--- /dev/null
+++ b/fmt/src/tm_digit.F
@@ -0,0 +1,105 @@
+	LOGICAL FUNCTION TM_DIGIT( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if the first character of "string" is the first character
+* of a number
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 06/24/88
+* 11/6/94 *sh* Kludge for AIX port (fixes to PLOT+ to avoid problems with
+*	FORTRAN READ ERR= branches):  check for "/" following "." since
+*	path names often begin with "./name"
+* 1/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead
+* V685+ 12/13    - *acm*  bounds checking: dont refer to parts of the string outside its bounds.
+
+#include "gt_lib.parm"
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER		i, slen
+	CHARACTER*1	c
+	
+* local parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+	slen = LEN(string)
+	IF (slen .EQ. 0) THEN
+	   TM_DIGIT = .FALSE.
+	   RETURN
+	ENDIF
+
+* skip leading blanks
+	DO 100 i = 1, slen
+	   c = string(i:i)
+	   IF ( c .NE. ' ' .AND. c .NE. tab ) GOTO 200
+ 100	CONTINUE
+
+* string is blank
+	TM_DIGIT = .FALSE.
+	
+* check first character
+ 200	TM_DIGIT =   c .EQ. '+'
+     .		.OR. c .EQ. '-'
+     .		.OR. c .EQ. '.'
+     .		.OR. c .GE. '0' .AND. c .LE. '9'
+
+* kludge check for "./name" (11/94 for AIX port)
+	IF (slen.GE.2 ) THEN
+	   IF (c.EQ.'.') TM_DIGIT = string(2:2) .NE. PathSeparator
+
+* Check for .. starting a string, dataset global attributes
+
+           IF (i .LT. slen) THEN
+              IF(c .EQ. '.' .AND. string(i+1:i+1) .EQ. '.') TM_DIGIT = .FALSE.
+	   ENDIF
+	
+	ENDIF
+
+	RETURN
+
+      END
diff --git a/fmt/src/tm_digit_test.F b/fmt/src/tm_digit_test.F
new file mode 100644
index 0000000..517b72e
--- /dev/null
+++ b/fmt/src/tm_digit_test.F
@@ -0,0 +1,120 @@
+	LOGICAL FUNCTION TM_DIGIT_TEST( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if the string can be read as a number
+
+* Ansley Manke 10/11/05
+* from tm_digit.F
+
+
+#include "gt_lib.parm"
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+        LOGICAl         maybe
+	INTEGER		TM_LENSTR1, i, j
+	CHARACTER*1	c
+	
+* local parameter declarations:
+        CHARACTER*1     tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* skip leading blanks
+	DO 100 i = 1, LEN(string)
+	   c = string(i:i)
+	   IF ( c .NE. ' ' .AND. c .NE. tab ) GOTO 200
+ 100	CONTINUE
+
+* string is blank
+	TM_DIGIT_TEST = .FALSE.
+	
+* check first character
+ 200	TM_DIGIT_TEST =   c .EQ. '+'
+     .		.OR. c .EQ. '-'
+     .		.OR. c .EQ. '.'
+     .		.OR. c .GE. '0' .AND. c .LE. '9'
+
+* kludge check for "./name" (11/94 for AIX port)
+	IF (c.EQ.'.' .AND. LEN(string).GE.2 )
+     .		TM_DIGIT_TEST = string(2:2) .NE. PathSeparator
+
+! dataset attributes ..attname
+        IF (INDEX(string, '..') .GT. 0) TM_DIGIT_TEST = .FALSE.  
+
+        IF (.NOT. TM_DIGIT_TEST) RETURN
+
+* Check further characters.  There may be an E for exponent or a D for a double precision 
+
+        IF (TM_LENSTR1(string) .LE. i) RETURN
+        maybe = .FALSE.
+	DO 300 j = i+1, TM_LENSTR1(string)
+	   c = string(j:j)
+           TM_DIGIT_TEST =   c .EQ. '+'
+     .		.OR. c .EQ. '-'
+     .		.OR. c .EQ. '.'
+     .		.OR. c .GE. '0' .AND. c .LE. '9'
+     .		.OR. c .EQ. 'E'
+     .		.OR. c .EQ. 'e'
+     .		.OR. c .EQ. 'D'
+     .		.OR. c .EQ. 'd'
+           IF (.NOT. TM_DIGIT_TEST) RETURN
+
+           IF (maybe) THEN  ! previously hit an E or D, see if this next char is numeric
+              TM_DIGIT_TEST =   c .EQ. '+'
+     .		.OR. c .EQ. '-'
+     .		.OR. c .EQ. '.'
+     .		.OR. c .GE. '0' .AND. c .LE. '9'
+              maybe = .FALSE.
+              IF (.NOT. TM_DIGIT_TEST) RETURN
+           ENDIF
+
+           maybe = c .EQ. 'E'
+     .		.OR. c .EQ. 'e'
+     .		.OR. c .EQ. 'D'
+     .		.OR. c .EQ. 'd'
+ 300	CONTINUE
+        IF (maybe) TM_DIGIT_TEST = .FALSE.   ! ended with D or E
+
+	RETURN
+
+      END
diff --git a/fmt/src/tm_dset_deallo_grids.F b/fmt/src/tm_dset_deallo_grids.F
new file mode 100644
index 0000000..d0b7478
--- /dev/null
+++ b/fmt/src/tm_dset_deallo_grids.F
@@ -0,0 +1,68 @@
+	SUBROUTINE TM_DSET_DEALLO_GRIDS( dset )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* deallocate all grids used by variables in this data set (and through them
+* all of the axes used, too)
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 4/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	include 'xtm_grid.cmn_text'
+
+* Argument definitions
+	INTEGER dset
+
+* Local definitions
+	INTEGER i
+
+* bump the use counts of grids used by variables in this data set
+	DO 50 i = 1, maxvars
+	   IF ( ds_var_setnum(i) .EQ. dset ) THEN
+	      CALL TM_DEALLO_DYN_GRID( ds_grid_number(i))
+	   ENDIF
+ 50	CONTINUE
+
+* always successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_dset_number.F b/fmt/src/tm_dset_number.F
new file mode 100644
index 0000000..e11e3a5
--- /dev/null
+++ b/fmt/src/tm_dset_number.F
@@ -0,0 +1,76 @@
+	INTEGER FUNCTION TM_DSET_NUMBER( path_name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Find the data set number of the given name
+* If the name does not match any initialized data sets return unspecified_int4
+*
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS
+*
+* revision 0.00 - 10/23/89 - code lifted from TM_INIT_DSET by Mark Verschell
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* arguments:
+*	path_name	- full path name of descriptor file
+
+* Argument definitions
+	CHARACTER*(*)	path_name
+
+* Parameter and common files
+	include 'tmap_errors.parm'		! error codes
+	include 'tmap_dims.parm'		! data set dimensions
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'		! data set common
+	external xdset_info_data
+
+* Internal declarations
+	INTEGER		set_cnt
+
+* check to see if this descriptor has already been initialized
+	DO 100 set_cnt = 1, maxdsets
+	    IF (ds_des_name(set_cnt) .EQ. path_name) THEN
+* ... found a match
+	      TM_DSET_NUMBER = set_cnt
+	      RETURN
+	    ENDIF
+  100	CONTINUE
+
+* no match (but no serious error)
+	TM_DSET_NUMBER = unspecified_int4
+	RETURN
+	END
diff --git a/fmt/src/tm_dset_use_grids.F b/fmt/src/tm_dset_use_grids.F
new file mode 100644
index 0000000..90f264c
--- /dev/null
+++ b/fmt/src/tm_dset_use_grids.F
@@ -0,0 +1,68 @@
+	SUBROUTINE TM_DSET_USE_GRIDS( dset )
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* bump the use counts on all grids used by variables in this data set
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 4/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	include 'xtm_grid.cmn_text'
+
+
+* Argument definitions
+	INTEGER dset
+
+* Local definitions
+	INTEGER i
+
+* bump the use counts of grids used by variables in this data set
+	DO 50 i = 1, maxvars
+	   IF ( ds_var_setnum(i) .EQ. dset ) THEN
+	      CALL TM_USE_DYN_GRID( ds_grid_number(i))
+	   ENDIF
+ 50	CONTINUE
+
+* always successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_ep_time_convrt.c b/fmt/src/tm_ep_time_convrt.c
new file mode 100644
index 0000000..a6c27c8
--- /dev/null
+++ b/fmt/src/tm_ep_time_convrt.c
@@ -0,0 +1,131 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* this routine extracted unmodified from the EPS library file fil_time.c
+   Replaces the earlier port of this routine under the name tm_ep_time_convrt_
+   which was FORTRAN-accessible.  This routine user, instead a FORTRAN jacket
+   *sh* 1/94
+*/
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include "ferretmacros.h"
+
+#define JULGREG   2299161
+
+void ep_time_to_mdyhms(time, mon, day, yr, hour, min, sec)
+     long *time;
+     int *mon, *day, *yr, *hour, *min;
+     DFTYPE *sec;
+{
+/*
+ * convert eps time format to mdy hms
+ */
+  long ja, jalpha, jb, jc, jd, je;
+
+  while(time[1] >= 86400000) { /* increament days if ms larger then one day */
+    time[0]++;
+    time[1] -= 86400000;
+  }
+
+  if(time[0] >= JULGREG) {
+    jalpha=((double) (time[0]-1867216)-0.25)/36524.25;
+    ja=time[0]+1+jalpha-(long)(0.25*jalpha);
+  } else
+    ja=time[0];
+
+  jb=ja+1524;
+  jc=6680.0+((double)(jb-2439870)-122.1)/365.25;
+  jd=365*jc+(0.25*jc);
+  je=(jb-jd)/30.6001;
+  *day=jb-jd-(int)(30.6001*je);
+  *mon=je-1;
+  if(*mon > 12) *mon -= 12;
+  *yr=jc-4715;
+  if(*mon > 2) --(*yr);
+
+  if(*yr <=0) --(*yr);
+
+  ja = time[1]/1000;
+  *hour = ja/3600;
+  *min = (ja - (*hour)*3600)/60;
+  *sec = (DFTYPE)(time[1] - ((*hour)*3600 + (*min)*60)*1000)/1000.0;
+}
+
+/* convert from eptime to mdyhms */
+/* FORTRAN-callable jacket extracted from file jackets.c
+   Note:  The entry point name has been changed from mdyhmstoeptime_
+   to tm_ep_time_convrt_ and the calling argument time[2] has been
+   changed to the *int args epjday and epmsec.  Also, the entry has 
+   re-written in prototyping format
+
+   calling arguments:
+      epjday (input) - integer
+      epmsec (input) - integer
+      mon, day, yr, hr, min (output) - integer
+      sec (output) - REAL*4
+
+   *sh* 1/94
+*/
+
+void FORTRAN(tm_ep_time_convrt)(epjday,
+			epmsec,
+			mon,
+			day,
+			yr,
+			hour,
+			min,
+			sec)
+
+/* prototypes not allowed on TMAP SUN cc compiler.  Need ANSI ?? */
+int *epjday, *epmsec, *mon, *day, *yr, *hour, *min;
+DFTYPE *sec;
+
+{
+/*  this block added by *sh* 1/94 */
+  long time[2];
+  time[0] = (long)*epjday;
+  time[1] = (long)*epmsec;
+
+  (void) ep_time_to_mdyhms(time, mon, day, yr, hour, min, sec);
+}
+
+
+
diff --git a/fmt/src/tm_errmsg.F b/fmt/src/tm_errmsg.F
new file mode 100644
index 0000000..70fdf18
--- /dev/null
+++ b/fmt/src/tm_errmsg.F
@@ -0,0 +1,330 @@
+	SUBROUTINE TM_ERRMSG ( 	status_in, status_out, routine,
+     .				 dset_num, sf_num, 
+     .				 expected, found, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display explanatory message of error and calling routine, transfers error
+* code to output variable, and always take alternate return to serve as error
+* branch in calling program
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/19/85
+* revision 1.00 - 04/01/87 - changes to calling statement to allow more
+*			     complete but concise messages. (MAV)
+* revision 1.10 - 06/01/87 - added "calling routine" parameter to call
+* revision 1.11 - 09/24/88 - printing of dset, sf based on flags only. Flags
+*			     now set to unspecified_int4 to facilitate this
+* Unix/RISC port - 3/12/91 - Unix system error messages via UNIX CALL GERROR
+*                          - TMAP_diag_on variable controls subroutine name out
+*                          - changed error message format to "**TMAP ERR"
+* added netCDF errors - 2/92 *sh*
+* all output to be directed through TM_SPLIT_MESSAGE for optional GUI
+* Linux Port - *kob* 5/97 - added call for linux_perror, which is a c 
+*			    routine, because the appropriate routine 
+*			    didn't exist in nag F90
+*			  - f90 doesnt accept "D" in col 1 as a debug thing
+*			    so ifdef around it
+* V500 - *kob* 7/99 - update error codes to handle netCDF V3.4 differences
+*
+* *acm* 11/05 V600  -- New symbol FER_LAST_ERROR contains all the text normally
+*                       written to std out. 
+* V600 *acm* 7/06 Using NetCDF-3 calls in cd_open_dset, if an error is found,
+*                 the correct error message is passed in here. Process these under
+*                 merr_nc_open, separately from other netcdf errors. Report the
+*                 netCDF / OPeNDAP error code.
+* V604 *acm* 6/07 Allow longer strings for OPeNDAP file-open errors. Call these
+*                 **Internet Data error 
+* V63  *acm* 10/09 Changes for gfortran build
+* V68  *acm*  4/11 Error codes for NetCDF-4 (HDF) errors are in the range -101 to -116
+
+
+* arguments:
+*	status_in	- error code from calling program
+*	status_out	- error code (echoed) back to calling program
+*	routine		- calling routine or program
+*	dset_num	- data set number
+*	sf_num		- step_file number
+*	expected	- expected value, except in case where a limit is
+*			  exceeded, in which case this is the limit. Or if
+*			  special error, this might have another value.
+*	found		- the value found when "expected" value was expected
+
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include 'xio.cmn_text'
+	external xio_data
+	include 'xerror_text.cmn_text'
+	external xerror_text_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xdiag_ctrl.cmn_text'
+	external xdiag_ctrl_data
+!	include 'xalt_messages.cmn_text'	! w/ alt_messages
+	external xalt_messages_data
+
+* argument definitions
+	CHARACTER*(*)	routine, expected, found
+	INTEGER		status_in, status_out, dset_num, sf_num
+
+* local definitions
+	CHARACTER*2048	TM_CMPRSS, expbuff, fndbuff
+	CHARACTER*2048	errbuf	! introduced for GUI-SPLIT messages
+        CHARACTER*2048  symbuf  ! for symbol FER_LAST_ERROR
+	INTEGER		sf_len, des_len, TM_LENSTR1, msg_len, exp_len,
+     .			fnd_len, rtn_len, len_symbuf, ier, ist, cdferr
+
+* initialize
+	status_out = status_in	! transfer error code to output
+	errbuf = ' '
+        expbuff = ' '
+        fndbuff = ' '
+
+* initialize string for symbol FER_LAST_ERROR
+
+         symbuf = ' '
+         len_symbuf = 1
+
+* print calling routine line to identify where error occured
+* (diagnostic, only - *sh* 3/15/91)
+* add ifdef check for f90 - no D on col 1 *kob*
+c#if defined unix  && ! defined FORTRAN_90   
+cD        TMAP_diag_on = .TRUE.     ! compile if "-d_lines"-----Emacs: 
+c#endif
+        IF ( TMAP_diag_on ) THEN
+	   rtn_len = TM_LENSTR1(routine)
+	   write (lunit_errors, *) ' ***** ERROR IN ',routine(:rtn_len),
+     .				   ' *****'
+        ENDIF
+
+* Handle special messages first:
+
+* error message from ERR= branch ?
+* fetch the system error codes for most recent error
+
+	IF ( status_in .EQ. merr_erreq ) THEN
+#ifdef unix
+#ifdef F90_SYSTEM_ERROR_CALLS
+	  call linux_perror(expbuff)
+#else
+          CALL GERROR(expbuff)       ! get system error message
+#endif
+	  msg_len = TM_LENSTR1(expbuff)
+	  WRITE (errbuf,1000) expbuff(:msg_len)
+	  CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+          msg_len = TM_LENSTR1(errbuf)
+          symbuf(len_symbuf:) = errbuf(:msg_len)
+          len_symbuf = len_symbuf + msg_len + 1
+#else
+* VMS code by Mark Renton
+	  CALL ERRSNS ( fnum, rmssts, rmsstv, iunit, condval )
+	  IF ( ( rmssts .EQ. 0 ) .AND. ( rmsstv .EQ. 0 ) ) THEN
+	    msgvec ( 1 ) = 1
+	    msgvec ( 2 ) = condval
+	    msgvec ( 3 ) = 0
+	  ELSE
+	    msgvec ( 1 ) = 1
+	    msgvec ( 2 ) = rmssts
+	    IF ( rmsstv .ne. 0 ) THEN
+	      msgvec ( 1 ) = 2
+	      msgvec ( 3 ) = rmsstv
+	    ENDIF
+	  ENDIF
+* output the message but, SYS_PUTMSG needs a <cr> sent afterword
+	  CALL SYS_PUTMSG ( msgvec, , , )
+	  WRITE (errbuf,1000) expbuff(:msg_len)
+	  CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+          msg_len = TM_LENSTR1(errbuf)
+          symbuf(len_symbuf:) = errbuf(:msg_len)
+          len_symbuf = len_symbuf + msg_len + 1
+
+#endif
+
+* Output the message for a regular error; errors from cd_open_dset
+* are treated here.
+	ELSE IF ( (status_in .GT. pregular) .AND.
+     .		  (status_in .LE. pregular + num_regular + 1) ) THEN
+
+          IF (status_in .EQ. merr_nc_open) THEN
+	     msg_len = TM_LENSTR1(expected)
+	     WRITE (errbuf,1001) 
+	     CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+             msg_len = TM_LENSTR1(errbuf)
+             symbuf(len_symbuf:) = errbuf(:msg_len)
+             len_symbuf = len_symbuf + msg_len + 1
+1001	     FORMAT(' **netCDF error')
+
+          ELSE IF (status_in .EQ. merr_remote_open) THEN
+	     msg_len = TM_LENSTR1(expected)
+	     WRITE (errbuf,1002) 
+	     CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+             msg_len = TM_LENSTR1(errbuf)
+             symbuf(len_symbuf:) = errbuf(:msg_len)
+             len_symbuf = len_symbuf + msg_len + 1
+1002	     FORMAT(' **Internet Data error')
+
+          ELSE
+
+             msg_len = TM_LENSTR1(msg_regular(status_in - pregular))
+             WRITE (errbuf,1000)
+     .		 msg_regular(status_in - pregular)(:msg_len)
+             CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+             msg_len = TM_LENSTR1(errbuf)
+             symbuf(len_symbuf:) = errbuf(:msg_len)
+             len_symbuf = len_symbuf + msg_len + 1
+
+1000	     FORMAT(' **TMAP ERR: ',A)
+          ENDIF
+
+
+* output a netCDF error (note: CDF uses error code -1)
+* *kob* 7/99 - Update for netCDF v3.4
+* acm 1/10 - CD_TRANSLATE_ERROR calls error translation routine.
+
+	ELSEIF ( (status_in .GE. pcdferr-120) .AND.
+     .		 (status_in .LE. pcdferr + pcdferrmax) ) THEN
+* xxxxx can we get filename from netCDF call ???           
+* xxxxx cdfid and varid are available as dset_num, sf_num
+           cdferr = status_in - pcdferr
+           CALL CD_TRANSLATE_ERROR (cdferr, errbuf)
+	   CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+
+           msg_len = TM_LENSTR1(errbuf)
+           symbuf(len_symbuf:) = errbuf(:msg_len)
+           len_symbuf = len_symbuf + msg_len + 1
+
+           IF (expected .NE. no_errstring) THEN
+	     errbuf = ' '
+	     WRITE (errbuf,*) expected
+	     CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+             msg_len = TM_LENSTR1(errbuf)
+             symbuf(len_symbuf:) = errbuf(:msg_len)
+             len_symbuf = len_symbuf + msg_len + 1
+	   ENDIF
+           IF (found .NE. no_errstring) THEN
+	     errbuf = ' '
+	     WRITE (errbuf,*) found
+	     CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)   
+             msg_len = TM_LENSTR1(errbuf)
+             symbuf(len_symbuf:) = errbuf(:msg_len)
+             len_symbuf = len_symbuf + msg_len + 1
+	   ENDIF
+
+           GOTO 4000   ! bypass normal error processing
+* unrecognized error code ?
+	ELSE
+	  WRITE (errbuf,1100) status_in
+	  CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+1100	  FORMAT(' *** Unknown error code:',I10,' *** ')
+          msg_len = TM_LENSTR1(errbuf)
+          symbuf(len_symbuf:) = errbuf(:msg_len)
+          len_symbuf = len_symbuf + msg_len + 1
+
+	END IF
+
+* Output any info in expected and found strings (if any present)
+	errbuf = ' '
+	IF (expected .NE. no_errstring) THEN
+cc	  expbuff = TM_CMPRSS(expected)
+	  exp_len = TM_LENSTR1(expected)
+          expbuff = expected(1:exp_len)
+
+	  exp_len = TM_LENSTR1(expbuff)
+	  IF (found .NE. no_errstring) THEN
+cc	    fndbuff = TM_CMPRSS(found)
+	    fnd_len = TM_LENSTR1(found)
+	    fndbuff = found(1:fnd_len)
+	    WRITE (errbuf,1200) expbuff(1:exp_len),
+     .				      fndbuff(1:fnd_len)
+	    CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+1200	    FORMAT(13X,'Expected: ',A,' Found: ',A)
+            msg_len = TM_LENSTR1(errbuf)
+            symbuf(len_symbuf:) = errbuf(:msg_len)
+            len_symbuf = len_symbuf + msg_len + 1
+	  ELSE
+	    WRITE (errbuf,1300) expbuff(1:exp_len)
+	    CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+ 1300       FORMAT(13X,A)
+            symbuf(len_symbuf:) = expbuff(:exp_len)
+            len_symbuf = len_symbuf + exp_len + 1
+	  ENDIF
+	ENDIF
+
+* output step file and descriptor file if asked for
+	IF ( dset_num .NE. no_descfile      .AND.
+     .	     dset_num .NE. unspecified_int4       ) THEN
+	  errbuf = ' '
+	  des_len = TM_LENSTR1(ds_des_name(dset_num))
+	  WRITE (errbuf,1300)
+     .		 'Data set: '//ds_des_name(dset_num)(:des_len)
+	  CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)             
+          msg_len = TM_LENSTR1(errbuf)
+          symbuf(len_symbuf:) = errbuf(:msg_len)
+          len_symbuf = len_symbuf + msg_len + 1
+	ENDIF
+
+	IF ( sf_num .NE. no_stepfile      .AND.
+     .	     sf_num .NE. unspecified_int4       ) THEN
+	  errbuf = ' '
+	  sf_len = TM_LENSTR1(sf_name(sf_num))
+	  WRITE (errbuf,1300)
+     .           'Data file: '//sf_name(sf_num)(:sf_len)
+	  CALL TM_SPLIT_MESSAGE(lunit_errors, errbuf)
+          msg_len = TM_LENSTR1(errbuf)
+          symbuf(len_symbuf:) = errbuf(:msg_len)
+          len_symbuf = len_symbuf + msg_len + 1
+	ENDIF
+
+* print blank line to set off error messages
+! 4000   IF ( .NOT.alt_messages) WRITE (lunit_errors, *)
+ 4000	CONTINUE
+
+* Generate symbol containing the whole error message
+
+         ier = 0
+         ist = 0
+         CALL SETSYM ('FER_LAST_ERROR '//symbuf, 14+len_symbuf, 
+     .                 ier, ist)
+
+* take alternate RETURN always
+	RETURN 1
+
+	END
diff --git a/fmt/src/tm_exit.F b/fmt/src/tm_exit.F
new file mode 100644
index 0000000..b99c8f0
--- /dev/null
+++ b/fmt/src/tm_exit.F
@@ -0,0 +1,81 @@
+	SUBROUTINE TM_EXIT ( )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+* exit the TMAP library, closing all open files as we do so
+* V510 - *sh* 12/99 -- needed for netCDF caching to work right
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+
+	include 'tmap_errors.parm'	! error code parameter defs
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+* internal variable declarations
+        LOGICAL   its_cdf
+	INTEGER   ds_num,status,f_num
+
+* loop over all data sets
+	DO 500 ds_num = 1, maxdsets
+	   IF (ds_name(ds_num) .EQ. char_init1024) GOTO 500
+
+* save the data format
+           its_cdf = ds_type(ds_num) .EQ. 'CDF'
+     .        .OR.   ds_type(ds_num) .EQ. 'ECDF' 
+
+* Now loop through stepfiles closing files
+	   DO 100 f_num = 1, maxstepfiles
+	     IF (sf_setnum(f_num) .NE. ds_num) GOTO 100
+
+* close step file or CDF file ?
+	    IF ( sf_lunit (f_num) .NE. file_not_open) THEN	! open ?
+               IF ( its_cdf ) THEN
+                  CALL CD_CLOSE_SET( sf_lunit(f_num), status )
+               ELSE
+	          CALL TM_CLOSE_STEP (f_num, status)
+               ENDIF
+	     ENDIF
+  100	   CONTINUE
+
+ 500	CONTINUE
+
+	RETURN
+	END
diff --git a/fmt/src/tm_exp_code.F b/fmt/src/tm_exp_code.F
new file mode 100644
index 0000000..ae287fa
--- /dev/null
+++ b/fmt/src/tm_exp_code.F
@@ -0,0 +1,133 @@
+	CHARACTER*6 FUNCTION TM_EXP_CODE ( ds_num )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  Returns a unique exp_code for use in looking at experiment documentation
+*  files. This code is based on ds_type and ds_expnum. This is 12222, where
+*  1 and 2 indicate one character of ds_type and ds_expnum respectively.
+*  E.g. "G0023". Special cases exist for GTBA011, GTMA011, and GTPA011.
+*  These will have B,M, or P appended as appropriate.
+*
+*  Arguments:
+*	ds_num - dataset number
+*
+*  Written 04/88 by M. Verschell for PMEL/TMAP (for VAX/VMS)
+*
+* revision 0.00 - 04/28/88 - 
+* revision 0.10 - 01/24/89 - Added patch so that TS data sets give G prefix
+* revision 0.11 - 02/15/89 - removed ds_open
+* Unix/RISC port 4/24/91 *sh*: increased ds_name size
+* MOM change - 4/92- *kob* : Allowed for M**** to be an acceptable exp num.
+* bug fix - 7/92- Check d_source instead of d_title for MOM data - oops*kob*
+* efficiency addition - 7/92-added a check for a modnum of BC which - *kob* 
+* 7/95 *sh* have "CDF" map into "M"
+* 9/95 *sh* - remove special "BURST" kludge of Ben Giese's - some of the recent
+*		runs contain the word "Burst" in their titles, too
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+
+*  Argument definitions
+	INTEGER*4	ds_num
+
+*  Include files
+	include	'tmap_errors.parm'
+	include 'xio.cmn_text'
+        external xio_data
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+*  Local definitions
+	CHARACTER*6	temp_code
+	CHARACTER*80	string
+	INTEGER*4	STR_UPCASE, TM_LENSTR1, lenb 
+	INTEGER*4	i, istat
+	LOGICAL		TM_HAS_STRING
+
+	temp_code(1:6) = ' '
+
+*  Is the requested data set initialized?
+	IF (ds_name(ds_num) .EQ. char_init1024) GOTO 9000
+
+*  If data set type is 'GT' then check for burst experiment
+* add a check for model runs using MOM (new, vibrant cray code) 4/92 kob
+	IF (TM_HAS_STRING(ds_type(ds_num),'GT')
+     .  .OR.TM_HAS_STRING(ds_type(ds_num),'CDF')) THEN		! 7/95
+!	  IF (TM_HAS_STRING(ds_title(ds_num),'BURST')) THEN
+!	     temp_code(1:1) = 'B'
+	  IF (TM_HAS_STRING(ds_source(ds_num),'MOM')) THEN
+             temp_code(1:1) = 'M'
+          ELSE
+	     temp_code(1:1) = 'G'
+	  ENDIF
+	ELSE
+	  DO i = 1,4
+	    IF (ds_type(ds_num)(i:i) .NE. ' ') THEN
+	      istat = STR_UPCASE(TEMP_CODE(1:1),ds_type(ds_num)(i:i))
+	      GOTO 100
+	    ENDIF
+	  ENDDO
+	ENDIF
+
+  100	istat = STR_UPCASE(temp_code(2:5),ds_expnum(ds_num))
+
+*  Special cases
+	IF (TM_HAS_STRING(ds_expnum(ds_num),'11')) THEN
+	  IF (TM_HAS_STRING(ds_modnum(ds_num),'BA')) temp_code(6:6)='B'
+	  IF (TM_HAS_STRING(ds_modnum(ds_num),'MA')) temp_code(6:6)='M'
+	  IF (TM_HAS_STRING(ds_modnum(ds_num),'PA')) temp_code(6:6)='P'
+	  IF (TM_HAS_STRING(ds_modnum(ds_num),'BC')) temp_code(6:6)='P'
+	ENDIF
+
+*  Time Series fix
+	IF (TM_HAS_STRING(ds_type(ds_num),'TS')) temp_code(1:1) = 'G'
+
+	TM_Exp_code = temp_code
+	GOTO 9999
+
+ 9000	CONTINUE
+ 
+	WRITE (string, *) 'Unknown data set ',ds_num
+	lenb = TM_LENSTR1( string )
+	CALL WARN( string(:lenb) )
+	TM_Exp_code = ' '
+	GOTO 9999
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_f7721bug_inquire.F b/fmt/src/tm_f7721bug_inquire.F
new file mode 100644
index 0000000..3dc6915
--- /dev/null
+++ b/fmt/src/tm_f7721bug_inquire.F
@@ -0,0 +1,71 @@
+	LOGICAL FUNCTION TM_F7721BUG_INQUIRE( fpath )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identical function to the INQUIRE EXIST=... statement from FORTRAN
+* this routine is provided only to compensate for a bug in f772.1
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 - 10/21/92 - used only on DEC
+
+* calling argument declarations
+	CHARACTER*(*)	fpath
+
+* local variable declarations
+	INTEGER	lunit
+
+* get free logical unit #
+        CALL LIB_GET_LUN (lunit)
+                                 
+* open the file as a test for its existance
+* any error will be interpreted as non-existance
+        OPEN ( UNIT = lunit,
+     .         STATUS = 'OLD',
+     .         FILE = fpath,
+     .         ERR = 5000)
+
+* we found it
+        CLOSE( UNIT=lunit )
+        TM_F7721BUG_INQUIRE = .TRUE.
+	RETURN
+
+* file doesn't exist (or other improperly-detected error)
+ 5000   TM_F7721BUG_INQUIRE = .FALSE.
+        RETURN
+	END
diff --git a/fmt/src/tm_ferret_vartype.F b/fmt/src/tm_ferret_vartype.F
new file mode 100644
index 0000000..094c62c
--- /dev/null
+++ b/fmt/src/tm_ferret_vartype.F
@@ -0,0 +1,75 @@
+	INTEGER FUNCTION TM_FERRET_VARTYPE (ncvtype)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Given a netCDF variable type return the corresponding Ferret parameter
+
+* V533 *sh* 6/01
+* V540 *acm* per SH email of 10/19/01  For datasets with datatype "short"
+*            Ferret translates the "short" to "float" but the new code 
+*            made it think that the variable is, indeed, of type short.
+* V65  *acm* 1/10  Change all netcdf2-style calls and parameter names to 
+*                  netcdf3-style calls, which are also consistent with netcdf4.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dtypes.parm'
+        include 'netcdf.inc'
+
+* input arguments
+	INTEGER	ncvtype
+
+	IF (ncvtype .EQ. NF_FLOAT) THEN
+	  TM_FERRET_VARTYPE =  ptype_float
+	ELSEIF (ncvtype .EQ. NF_CHAR) THEN
+	  TM_FERRET_VARTYPE =  ptype_string
+	ELSEIF (ncvtype .EQ. NF_DOUBLE) THEN
+	  TM_FERRET_VARTYPE =  ptype_double
+	ELSEIF (ncvtype .EQ. NF_INT) THEN
+	  TM_FERRET_VARTYPE =  ptype_int4
+	ELSEIF (ncvtype .EQ. NF_SHORT) THEN
+	  TM_FERRET_VARTYPE =  ptype_int2
+	ELSEIF (ncvtype .EQ. NF_BYTE) THEN
+	  TM_FERRET_VARTYPE =  ptype_int1
+	ELSE
+	  CALL WARN('Internal err: unknown data type')
+	  TM_FERRET_VARTYPE = ptype_float
+	ENDIF
+
+* full data type support not implemented as-of 10/01. 
+* cd_read will convert all numeric data to float
+
+       IF ( ncvtype .NE. NF_CHAR) TM_FERRET_VARTYPE =  ptype_float
+
+	RETURN
+	END
diff --git a/fmt/src/tm_fill.F b/fmt/src/tm_fill.F
new file mode 100644
index 0000000..9882061
--- /dev/null
+++ b/fmt/src/tm_fill.F
@@ -0,0 +1,73 @@
+	SUBROUTINE TM_FILL ( a_lo_x, a_lo_y, a_lo_z, a_lo_t,
+     .                       a_hi_x, a_hi_y, a_hi_z, a_hi_t,
+     .			     region, value )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Fill a 4D region of data with a single specified value
+
+* V500 *sh* 3/99 
+
+#include "gt_lib.parm"
+
+
+* calling argument declarations
+	INTEGER		a_lo_x, a_lo_y, a_lo_z, a_lo_t,
+     .                  a_hi_x, a_hi_y, a_hi_z, a_hi_t
+	REAL		value, 
+     .                  region(a_lo_x:a_hi_x,a_lo_y:a_hi_y,
+     .                      a_lo_z:a_hi_z,a_lo_t:a_hi_t,
+     .			    unspecified_int4:unspecified_int4,
+     .			    unspecified_int4:unspecified_int4)
+
+
+* internal variable declarations
+	INTEGER		i, j, k, l, m, n
+	INTEGER		a_lo_e, a_lo_f, a_hi_e, a_hi_f
+
+	DO 100 n = a_lo_f, a_hi_f
+	DO 100 m = a_lo_e, a_hi_e
+	DO 100 l = a_lo_t, a_hi_t
+	DO 100 k = a_lo_z, a_hi_z
+	DO 100 j = a_lo_y, a_hi_y
+	DO 100 i = a_lo_x, a_hi_x
+
+	    region(i,j,k,l,unspecified_int4,unspecified_int4) = value
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fmt/src/tm_find_like_dyn_grid.F b/fmt/src/tm_find_like_dyn_grid.F
new file mode 100644
index 0000000..c8fb427
--- /dev/null
+++ b/fmt/src/tm_find_like_dyn_grid.F
@@ -0,0 +1,85 @@
+	INTEGER*4 FUNCTION TM_FIND_LIKE_DYN_GRID( target )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Locate a grid from the dynamic grid area (above max_grids)
+* that matches the target grid
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xio.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER target
+
+* Local definitions
+	LOGICAL     TM_SAME_GRID_DEF
+	INTEGER specimen
+
+* initialize linked list search
+	specimen =  grid_flink(max_grids)
+
+* compare with the grids in the "used" list
+ 100	CONTINUE
+
+	IF ( specimen .EQ. max_grids ) THEN
+	   TM_Find_like_dyn_grid = unspecified_int4	! no match found
+	   RETURN
+
+	ELSEIF ( specimen .EQ. target ) THEN	
+	   specimen = grid_flink(specimen)		! skip over self
+
+	ELSEIF ( TM_SAME_GRID_DEF( target, specimen ) ) THEN
+	   TM_Find_like_dyn_grid = specimen
+	   RETURN					! success
+
+	ELSE
+	   specimen = grid_flink(specimen)		! keep looking
+
+	ENDIF
+
+	GOTO 100
+	END
diff --git a/fmt/src/tm_find_like_dyn_line.F b/fmt/src/tm_find_like_dyn_line.F
new file mode 100644
index 0000000..b9275d9
--- /dev/null
+++ b/fmt/src/tm_find_like_dyn_line.F
@@ -0,0 +1,86 @@
+	INTEGER*4 FUNCTION TM_FIND_LIKE_DYN_LINE( target )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Locate a line from the dynamic line area (above max_lines)
+* that matches the target line
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xio.cmn_text'
+	external xgt_grid_data
+
+
+* Argument definitions
+	INTEGER target
+
+* Local definitions
+	LOGICAL     TM_SAME_LINE_DEF
+	INTEGER specimen
+
+* initialize linked list search
+	specimen =  line_flink(max_lines)
+
+* compare with the lines in the "used" list
+ 100	CONTINUE
+
+	IF ( specimen .EQ. max_lines ) THEN
+	   TM_Find_like_dyn_line = unspecified_int4	! no match found
+	   RETURN
+
+	ELSEIF ( specimen .EQ. target ) THEN	
+	   specimen = line_flink(specimen)		! skip over self
+
+	ELSEIF ( TM_SAME_LINE_DEF( target, specimen ) ) THEN
+	   TM_Find_like_dyn_line = specimen
+	   RETURN					! success
+
+	ELSE
+	   specimen = line_flink(specimen)		! keep looking
+
+	ENDIF
+
+	GOTO 100
+	END
diff --git a/fmt/src/tm_find_like_grid.F b/fmt/src/tm_find_like_grid.F
new file mode 100644
index 0000000..536e811
--- /dev/null
+++ b/fmt/src/tm_find_like_grid.F
@@ -0,0 +1,77 @@
+	INTEGER*4 FUNCTION TM_FIND_LIKE_GRID ( gridnum )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Check to see if an existing grid is identical to the grid pointed to by
+* "gridnum".
+*
+* by M. Verschell PMEL/TMAP
+*
+* revision 0.00 - 05/18/88
+* revision 0.01 - 11/21/88 - variable used check changed to specific char_initXX
+* revision 1.0 - 2/92 *sh* - removed guts to TM_SAME_GRID_DEF
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+
+* Argument definitions
+	INTEGER*4   gridnum
+
+* Local definitions
+        LOGICAL     TM_SAME_GRID_DEF
+	INTEGER*4   j
+
+* Loop through the grids comparing the axis names
+	DO 100 j = 1, max_grids
+	  IF (grid_name(j).NE.char_init16 .AND. j.NE.gridnum) THEN
+             IF ( TM_SAME_GRID_DEF( gridnum, j ) ) THEN
+ 	        TM_Find_like_grid = j
+                RETURN
+             ENDIF
+          ENDIF
+  100	CONTINUE
+
+* matching grid doesn't exist
+	TM_Find_like_grid = unspecified_int4
+	RETURN
+
+	END
diff --git a/fmt/src/tm_find_like_line.F b/fmt/src/tm_find_like_line.F
new file mode 100644
index 0000000..8640ff2
--- /dev/null
+++ b/fmt/src/tm_find_like_line.F
@@ -0,0 +1,81 @@
+	INTEGER*4 FUNCTION TM_FIND_LIKE_LINE ( iline )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Check to see if an existing line is identical to the line pointed to by
+* "iline".
+*
+* by M. Verschell PMEL/TMAP
+*
+* revision 0.00 - 05/18/88
+* revision 0.01 - 11/21/88 - variable used check changed to specific char_initXX
+* revision 0.02 - 09/21/89 - *sh* irregular line coordinate comparison fixed
+* revision 0.02 - 2/92 - *sh* removed guts of routine to TM_SAME_LINE_DEF
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER*4	iline
+
+* Local definitions
+        LOGICAL         TM_SAME_LINE_DEF
+	INTEGER*4	i
+
+* Loop through defined lines
+	DO 100 i = 1, max_lines
+
+	  IF (i.NE.iline .AND. line_name(i).NE.char_init16) THEN
+
+             IF (TM_SAME_LINE_DEF( i, iline ) ) THEN
+	        TM_Find_like_line = i
+                RETURN
+	     ENDIF
+
+          ENDIF
+
+  100	CONTINUE
+
+* No identical line exists
+	TM_Find_like_line = unspecified_int4
+
+ 	RETURN
+	END
diff --git a/fmt/src/tm_find_line_slot.F b/fmt/src/tm_find_line_slot.F
new file mode 100644
index 0000000..a51f504
--- /dev/null
+++ b/fmt/src/tm_find_line_slot.F
@@ -0,0 +1,83 @@
+	INTEGER*4 FUNCTION TM_FIND_LINE_SLOT ( islot )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Locates an unused space in XGRID common for a new line. If no space available,
+* returns error.
+*
+* revision 0.00 - 11/22/88
+* revision 1.00 - 12/13/88 - changed to reverse order search
+* bug fix - 10/2/91 - inserted comma in statement 9000 right before the *9999.  This error was
+*                     caught by version 3 of f77, but not 2.1.    kob
+* Arguments
+	INTEGER*4	islot
+*
+* *kob* 10/96 	- Linux port.  Linux didn't like tabs between "include"
+*	          and what was being included.  removed them
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Parameters and commons
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+*
+* Local declarations
+	CHARACTER*13	TM_STRING
+	INTEGER*4	igrd
+*
+	DO 100 igrd = max_lines,1,-1
+	  IF (line_name(igrd) .NE. char_init16) THEN
+	    IF (igrd .EQ. max_lines) GOTO 9000
+	    islot = igrd + 1
+	    GOTO 200
+	  ENDIF
+  100	CONTINUE
+	islot = 1
+  200	TM_FIND_LINE_SLOT = merr_ok
+	GOTO 9999
+*
+* No slot available
+ 9000	CALL TM_ERRMSG (merr_linelim, TM_FIND_LINE_SLOT,
+     .	                'TM_FIND_LINE_SLOT', no_descfile, no_stepfile,
+     .	                'MAX='//TM_STRING(DBLE(max_lines)), 
+     .                   no_errstring,*9999)
+
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_firm_axis_orient.F b/fmt/src/tm_firm_axis_orient.F
new file mode 100644
index 0000000..b797c50
--- /dev/null
+++ b/fmt/src/tm_firm_axis_orient.F
@@ -0,0 +1,96 @@
+	LOGICAL FUNCTION TM_FIRM_AXIS_ORIENT(axis, orientation)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine if "axis" has a rock-firm orientation
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V500 *sh* 6/99 - new -- to help with SET DATA/ORDER=
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	axis	    - input:  axis in TMAP COMMON
+*	orientation - output: a value 1-nferdims if orientation is firm
+
+* include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+
+* argument declarations
+	INTEGER	 axis, orientation
+
+* local variable declarations:
+	LOGICAL TM_HAS_STRING
+	INTEGER units
+
+* initialize
+	units = line_unit_code(axis)
+
+* try to determine the orientation of the axis
+
+	IF ( units .LT. 0 ) THEN
+	  orientation = t_dim
+	ELSEIF ( units .EQ. 4 ) THEN     ! degrees
+	  IF  ( TM_HAS_STRING(line_units(axis), 'NORTH')
+     .     .OR. TM_HAS_STRING(line_units(axis), 'SOUTH')
+     .     .OR. TM_HAS_STRING(line_name(axis), 'LAT') ) THEN 
+	    orientation = y_dim
+	  ELSEIF ( TM_HAS_STRING(line_units(axis), 'EAST')
+     .	   .OR. TM_HAS_STRING(line_units(axis), 'WEST')
+     .     .OR. TM_HAS_STRING(line_name(axis), 'LON') ) THEN 
+            orientation = x_dim
+	  ENDIF
+	ELSEIF ( units .EQ. pun_millibars
+     .	 .OR.  units .EQ. pun_decibars
+     .   .OR.  units .EQ. 14
+     .   .OR.  units .EQ. 15                  ! layer or level
+     .   .OR. TM_HAS_STRING(line_name(axis), 'HEIGHT') 
+     .   .OR. TM_HAS_STRING(line_name(axis), 'ELEV') ) THEN 
+          orientation = z_dim
+	ELSE
+	  orientation = 0
+	ENDIF
+
+* set return value
+	TM_FIRM_AXIS_ORIENT = orientation .NE. 0
+  
+	RETURN
+	END
diff --git a/fmt/src/tm_fmt.F b/fmt/src/tm_fmt.F
new file mode 100644
index 0000000..9886b29
--- /dev/null
+++ b/fmt/src/tm_fmt.F
@@ -0,0 +1,337 @@
+	CHARACTER*(*) FUNCTION TM_FMT( val, digits, max_len, str_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert the value val to a formatted string, left justified, not exceeding
+* max_len in length and with the shortest possible format( unnecerssary zeros
+* eliminated )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 08/31/88
+* 	   0.10 - 7/21/89 - check if NINT increases digits
+*    1/27/95 - corrected tendency to put out tons of zeros to the right
+*    3/20/95 - the 1/27/95 correction causes this routine to blow up on
+*		OSF f77 **only** when compiled with -g
+* *sh* 9/95  - precision output bug for large values
+*     10/95  - fix missing leading zero on fixed point for some compilers (HP)
+*     12/95  - fix bug with 9.9995 displayed as 4 digits: one_m_eps made
+*		system dependent
+* *kob* 8/96 - check for a negative w/out a leading zero to prevent output
+*              looking like "0-.xxx" - for ibm and hp
+* *acm* 11/04  incoming value may be NaN (e.g. in a SHOW DATA/FULL if missing 
+*              flag is NaN)
+* *acm* 11/05  incoming value may be Inf (e.g. in a STAT, if data contains Inf)
+* *acm*  1/06  When val is 0, log10(aval) is infinite.  Causes crash on IRIX;
+*              take care of val=0 case individually.
+* *acm*  V6.1 3/08  further corrections to last fix when writing a value with 
+*              negative exponent
+* *acm*  V6.5 1/10 Fix bug 1717: If the format is going to be (I0) make it (I1)
+
+* calling arguments:
+* val		- REAL*4 value to be converted
+* digits	- IF >0 maximum number of significant digits desired
+*	        - ELSE  maximum number of decimal places desired
+* max_len	- longest allowable length for string to be returned
+* str_len	- (returned) actual length of the string generated
+
+* calling argument declarations:
+	INTEGER		digits, max_len, str_len
+	REAL		val
+
+* internal variable declarations:
+	LOGICAL		exp_fmt, negative, fixed_pt
+	INTEGER		slen, sig_left, sig_full, nleft, nright, full,
+     .			sig_max, full10, xtra, sig_needed, pow10,
+     .			chk10, chk10_save, waste, i, need_adjust, ind,
+     .			iloop
+	REAL		aval, l10
+	CHARACTER*10	fmt, outstring*25, strend*25
+
+* local parameters:
+	INTEGER		TM_CHECK_NAN, TM_CHECK_INF, TM_LENSTR1, 
+     .                  max_int_len, sig_min, added_pow10
+	REAL		eps, one_m_eps
+	PARAMETER     ( max_int_len = 8,
+     .			sig_min     = 1,		! minimum sig. digits
+     .			eps         = 0.6E-7,		! 1/95 - was 1.E-7
+     .			one_m_eps   = 1.0 - eps )
+
+* special treatment for exact zero
+	IF ( val .EQ. 0.0 ) GOTO 1000
+
+* initialize
+
+	negative = val .LT. 0.0
+	fixed_pt = digits .LE. 0
+	aval     = ABS( val )
+	outstring   = ' '
+	exp_fmt  = .FALSE.
+	added_pow10 = 0
+
+* maximum length of output string (at least 1 character long)
+	slen = MIN( LEN(TM_FMT), max_len )
+	slen = MAX( 1, slen )
+
+* If the value is NaN, set the string here
+        IF ( TM_CHECK_NAN(aval) .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              TM_FMT  = 'NaN'
+              str_len = 3
+           ELSE
+              TM_FMT = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* If the value is NaN, or Inf, set the string here
+        IF ( TM_CHECK_INF(val)  .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              outstring  = 'Inf'
+              str_len = 3
+           ELSE
+              outstring = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* location of leftmost digit (.01-->-1, 0.1-->0, 1.0-->1, etc.)
+ 10	l10      = LOG10(aval)
+        IF (aval .EQ. 0.) l10 = 0.
+	IF ( l10 .GE. 0.0 ) THEN
+	   pow10 = INT(l10) + 1
+	ELSE
+	   pow10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	ENDIF
+	chk10_save = pow10
+
+* compute total significant digits requested
+ 50	IF ( fixed_pt ) THEN
+	   sig_max = pow10 + ABS(digits)
+	ELSE
+	   sig_max = digits
+	ENDIF
+
+* significant digits to left of the decimal point
+	sig_left = MAX( pow10, 0 )
+
+* actual characters to the left of the decimal point
+	nleft = MAX( sig_left, 1 )
+	IF ( negative ) nleft = nleft + 1	! minus sign
+
+* compute "wasted" space needed for minus signs, left zeros and decimal points
+	waste = nleft - sig_left			! sign and left zero
+	IF ( sig_max .GT. sig_left ) waste = waste + 1	! decimal point
+	IF ( pow10 .LT. 0 ) waste = waste + ABS(pow10)	! leading zeros
+
+* modify # significant digits: cannot request more digits than the integer
+* word size or the "unwasted" string length
+* but at least sig_min digits.
+
+* For double-precision Ferret the code below that puts the digits into a 
+* integer would fail because integers cant be that large. Keep track of
+* the extra length and add it back later.
+
+        sig_full = MAX( sig_min, MIN( sig_max, slen-waste ) )
+	need_adjust = 0
+        IF (sig_full .GT. max_int_len) THEN
+	  need_adjust = sig_full - max_int_len
+	ENDIF
+        sig_full = MAX( sig_min, MIN( sig_max, max_int_len, slen-waste ) )
+
+* create an integer with all the possible digits
+* (1-eps factor is because VAX Fortran formats round 100.5-->100 whereas VAX 
+* NINT function rounds 100.5 -->101)
+* Note: On DEC/OSF f77 the integer calculation blows up when compiled with -g
+*       It was observed with sig_full=4, pow10=-6, aval=6.27833E-07
+* 	Kludge work-around is to use the floating point calculation for cases
+*	where sig_full+pow10 is too large (10 or larger crashes, expermentally)
+! pre-1/95	full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+! pre-3/95	full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+* 9/95 ... it turns out that for large values (e.g. 2.16E8) that pow10
+* can be larger than sig_full givin 10**(negative) --> zero (integer calc)
+* so the IF condition has had a check added for this
+! 12/95: The value 9.9995 displayed with 4 sig_full=4 generates (F5.3) and
+! blows up because 9.9995 rounds to 10.000 on OSF Fortran. This occurs because
+! full is computed to be 9999 when the one_m_eps factor is included. Since the
+! comments just above indicate that one_m_eps was included to fix a VAX bug
+! we have removed this logic to an ifdef: NINT_WRITE_UNMATCH
+
+# ifdef NINT_WRITE_UNMATCH
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+	ENDIF
+# else
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10))  )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10)  )
+	ENDIF
+# endif
+
+* special check: eg. 99.9 --> 100.0 , changing leftmost digit
+	IF ( full .EQ. 10**sig_full ) THEN
+	   pow10 = pow10 + 1
+	   added_pow10 = added_pow10 + 1  ! 
+
+	   GOTO 50
+	ENDIF
+
+* get number of digits remaining after trimming off right hand zeros
+	full10 = 10 ** (sig_full-sig_min)
+	DO 100 sig_needed = sig_min, sig_full
+	   IF ( MOD(full, full10) .EQ. 0 ) GOTO 200
+	   full10 = full10 / 10
+ 100	CONTINUE
+	sig_needed = sig_full
+
+* * * * CREATE A FORMAT STRING AND WRITE THE RESULT * * *
+* EXACT ZERO - fixed point numbers that would be 0.000...
+ 200	IF ( fixed_pt .AND. sig_min-pow10 .GT. slen-waste ) THEN
+	   GOTO 1000
+
+* EXPONENTIAL STRING
+* numbers too small for fixed point (eg. 0.0000025 represented as 0.0)
+* or too big for the string length  (eg. 150000 can't fit in 4 spaces)
+* or with integer parts big enuf to ovflow the integer size (eg.123456789.123)
+* must be written in exponential format
+	ELSEIF ( sig_min-pow10 .GT. slen-waste
+     .	.OR. nleft .GT. slen 
+     .	.OR. nleft .GT. max_int_len ) THEN
+	   IF ( negative ) THEN
+	      xtra = 6
+	   ELSE
+	      xtra = 5
+	   ENDIF
+	   IF ( slen .LE. xtra ) THEN
+	      outstring  = '******'
+	      str_len = slen
+	   ELSE
+	      str_len = MIN( slen, sig_needed+xtra)
+* Correct for too-small number of slots when writing a number w neg exponent.
+              IF (pow10 .LT. 0) str_len = str_len + sig_max
+              IF (str_len .GT. slen) str_len = slen
+              IF (str_len-(xtra+1) .LT. 0) xtra = 1
+	      WRITE ( fmt, 3000 ) str_len, str_len-(xtra+1)
+ 3000	      FORMAT( '(1PG',I2,'.',I2,')' )
+	      WRITE ( outstring, fmt ) val
+	   ENDIF
+
+* INTEGER STRING
+* numbers whose needed digits are all on the left (eg. -2.0001 in 4 characters)
+* or whose length is too long to add a decimal point (eg. 25.5 in 3 characters)
+* may/must be represented as integers
+	ELSEIF ( sig_left .GE. sig_needed .OR. nleft .GE. slen-1 ) THEN
+* ... check if nearest integer will alter formatting (e.g. 99.6-->100)
+
+	   aval = NINT(aval)
+	   l10      = LOG10(aval)
+           IF (aval .EQ. 0.) l10 = 0.
+	   IF ( l10 .GE. 0.0 ) THEN
+	      chk10 = INT(l10) + 1
+	   ELSE
+	      chk10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	   ENDIF
+	   IF ( chk10 .NE. chk10_save ) GOTO 10
+	   str_len = nleft - added_pow10
+	   iloop = 0
+ 9000	   IF (str_len .LE. 0) str_len = 1
+	   WRITE ( fmt, 3100 ) str_len
+ 3100	   FORMAT ( '(I',I2,')' )
+	   WRITE ( outstring, fmt ) NINT(val)
+	   IF (INDEX(outstring,'*') .EQ. 1) THEN
+	      str_len = str_len + 1
+	      iloop = iloop + 1
+	      IF (iloop .LT. 5) GOTO 9000
+	   ENDIF
+
+* FIXED POINT STRING
+	ELSE
+	   sig_needed = sig_needed + need_adjust
+	   nright = MIN( sig_needed-pow10, slen-(nleft+1) )
+	   str_len = nleft + nright + 1
+	   WRITE ( fmt, 3200 ) str_len, nright
+ 3200	   FORMAT ( '(F',I2,'.',I2,')' )
+	   WRITE ( outstring, fmt ) val
+	   IF (slen .GE. 3) THEN 
+	       IF (outstring(1:3) .EQ. ' -.') THEN
+		  outstring(1:3) = '-0.'	! 8/96 for aix&hp
+	       ELSEIF (outstring(1:1) .EQ. ' ') THEN
+                  outstring(1:1) = '0'
+	       ENDIF	
+	   ENDIF
+* Precision in computation of value of FULL can cause an extra
+* digit at the end, and so trailing 0s may still exist. Remove them.
+           slen = TM_LENSTR1( outstring )
+           DO 3300 i = slen,1,-1
+              IF (outstring(i:i) .EQ. '0') THEN
+                 outstring(i:i) = ' '
+                 str_len = str_len - 1
+              ELSE
+                 GOTO 3400
+              ENDIF
+ 3300      CONTINUE
+ 3400      CONTINUE
+
+	ENDIF
+
+	str_len = TM_LENSTR1( outstring )
+	IF (INDEX(outstring, '0E') .GT. 0) THEN
+	   ind = INDEX(outstring, '0E')
+	   DO WHILE (ind .GT. 0)
+	      strend = outstring(ind+1:str_len)
+	      outstring = outstring(1:ind-1)//strend
+	      ind = INDEX(outstring, '0E')
+	   ENDDO
+	ENDIF
+
+	TM_FMT = outstring
+	RETURN
+
+* return exact zero
+ 1000	TM_FMT  = '0'
+	str_len = 1
+	RETURN
+
+      END
diff --git a/fmt/src/tm_fmt_sngl.F b/fmt/src/tm_fmt_sngl.F
new file mode 100644
index 0000000..5a4ccea
--- /dev/null
+++ b/fmt/src/tm_fmt_sngl.F
@@ -0,0 +1,295 @@
+	CHARACTER*(*) FUNCTION TM_FMT_SNGL( val, digits, max_len, str_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert the value val to a formatted string, left justified, not exceeding
+* max_len in length and with the shortest possible format( unnecerssary zeros
+* eliminated )
+
+* programmer - Ansley Manke, from tm_fmt.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* 1/13/2012
+* Single-precision version of TM_FMT, to be called from PPLUS.
+
+
+* calling arguments:
+* val		- REAL*4 value to be converted
+* digits	- IF >0 maximum number of significant digits desired
+*	        - ELSE  maximum number of decimal places desired
+* max_len	- longest allowable length for string to be returned
+* str_len	- (returned) actual length of the string generated
+
+* calling argument declarations:
+	INTEGER		digits, max_len, str_len
+	REAL*4		val
+
+* internal variable declarations:
+	LOGICAL		exp_fmt, negative, fixed_pt
+	INTEGER		slen, sig_left, sig_full, nleft, nright, full,
+     .			sig_max, full10, xtra, sig_needed, pow10,
+     .			chk10, chk10_save, waste, i, iloop
+	REAL*4		aval, l10
+	CHARACTER*10	fmt
+
+* local parameters:
+	INTEGER		TM_CHECK_NAN, TM_CHECK_INF, TM_LENSTR1, 
+     .                  max_int_len, sig_min, added_pow10
+	REAL*4		eps, one_m_eps
+	PARAMETER     ( max_int_len = 8,
+     .			sig_min     = 1,		! minimum sig. digits
+     .			eps         = 0.6E-7,		! 1/95 - was 1.E-7
+     .			one_m_eps   = 1.0 - eps )
+
+* special treatment for exact zero
+	IF ( val .EQ. 0.0 ) GOTO 1000
+
+* initialize
+	negative = val .LT. 0.0
+	fixed_pt = digits .LE. 0
+	aval     = ABS( val )
+	TM_FMT_SNGL   = ' '
+	exp_fmt  = .FALSE.
+	added_pow10 = 0
+
+* maximum length of output string (at least 1 character long)
+	slen = MIN( LEN(TM_FMT_SNGL), max_len )
+	slen = MAX( 1, slen )
+
+* If the value is NaN, set the string here
+        IF ( TM_CHECK_NAN(aval) .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              TM_FMT_SNGL  = 'NaN'
+              str_len = 3
+           ELSE
+              TM_FMT_SNGL = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* If the value is NaN, or Inf, set the string here
+        IF ( TM_CHECK_INF(val)  .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              TM_FMT_SNGL  = 'Inf'
+              str_len = 3
+           ELSE
+              TM_FMT_SNGL = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* location of leftmost digit (.01-->-1, 0.1-->0, 1.0-->1, etc.)
+ 10	l10      = LOG10(aval)
+        IF (aval .EQ. 0.) l10 = 0.
+	IF ( l10 .GE. 0.0 ) THEN
+	   pow10 = INT(l10) + 1
+	ELSE
+	   pow10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	ENDIF
+	chk10_save = pow10
+
+* compute total significant digits requested
+ 50	IF ( fixed_pt ) THEN
+	   sig_max = pow10 + ABS(digits)
+	ELSE
+	   sig_max = digits
+	ENDIF
+
+* significant digits to left of the decimal point
+	sig_left = MAX( pow10, 0 )
+
+* actual characters to the left of the decimal point
+	nleft = MAX( sig_left, 1 )
+	IF ( negative ) nleft = nleft + 1	! minus sign
+
+* compute "wasted" space needed for minus signs, left zeros and decimal points
+	waste = nleft - sig_left			! sign and left zero
+	IF ( sig_max .GT. sig_left ) waste = waste + 1	! decimal point
+	IF ( pow10 .LT. 0 ) waste = waste + ABS(pow10)	! leading zeros
+
+* modify # significant digits: cannot request more digits than the integer
+* word size or the "unwasted" string length
+* but at lease sig_min digits
+	sig_full = MAX( sig_min, MIN( sig_max, max_int_len, slen-waste ) )
+
+* create an integer with all the possible digits
+* (1-eps factor is because VAX Fortran formats round 100.5-->100 whereas VAX 
+* NINT function rounds 100.5 -->101)
+* Note: On DEC/OSF f77 the integer calculation blows up when compiled with -g
+*       It was observed with sig_full=4, pow10=-6, aval=6.27833E-07
+* 	Kludge work-around is to use the floating point calculation for cases
+*	where sig_full+pow10 is too large (10 or larger crashes, expermentally)
+! pre-1/95	full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+! pre-3/95	full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+* 9/95 ... it turns out that for large values (e.g. 2.16E8) that pow10
+* can be larger than sig_full givin 10**(negative) --> zero (integer calc)
+* so the IF condition has had a check added for this
+! 12/95: The value 9.9995 displayed with 4 sig_full=4 generates (F5.3) and
+! blows up because 9.9995 rounds to 10.000 on OSF Fortran. This occurs because
+! full is computed to be 9999 when the one_m_eps factor is included. Since the
+! comments just above indicate that one_m_eps was included to fix a VAX bug
+! we have removed this logic to an ifdef: NINT_WRITE_UNMATCH
+
+# ifdef NINT_WRITE_UNMATCH
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+	ENDIF
+# else
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10))  )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10)  )
+	ENDIF
+# endif
+
+* special check: eg. 99.9 --> 100.0 , changing leftmost digit
+	IF ( full .EQ. 10**sig_full ) THEN
+	   pow10 = pow10 + 1
+	   added_pow10 = added_pow10 + 1  ! 
+
+	   GOTO 50
+	ENDIF
+
+* get number of digits remaining after trimming off right hand zeros
+	full10 = 10 ** (sig_full-sig_min)
+	DO 100 sig_needed = sig_min, sig_full
+	   IF ( MOD(full, full10) .EQ. 0 ) GOTO 200
+	   full10 = full10 / 10
+ 100	CONTINUE
+	sig_needed = sig_full
+
+* * * * CREATE A FORMAT STRING AND WRITE THE RESULT * * *
+* EXACT ZERO - fixed point numbers that would be 0.000...
+ 200	IF ( fixed_pt .AND. sig_min-pow10 .GT. slen-waste ) THEN
+	   GOTO 1000
+
+* EXPONENTIAL STRING
+* numbers too small for fixed point (eg. 0.0000025 represented as 0.0)
+* or too big for the string length  (eg. 150000 can't fit in 4 spaces)
+* or with integer parts big enuf to ovflow the integer size (eg.123456789.123)
+* must be written in exponential format
+	ELSEIF ( sig_min-pow10 .GT. slen-waste
+     .	.OR. nleft .GT. slen 
+     .	.OR. nleft .GT. max_int_len ) THEN
+	   IF ( negative ) THEN
+	      xtra = 6
+	   ELSE
+	      xtra = 5
+	   ENDIF
+	   IF ( slen .LE. xtra ) THEN
+	      TM_FMT_SNGL  = '******'
+	      str_len = slen
+	   ELSE
+	      str_len = MIN( slen, sig_needed+xtra)
+* Correct for too-small number of slots when writing a number w neg exponent.
+              IF (pow10 .LT. 0) str_len = str_len + sig_max
+              IF (str_len .GT. slen) str_len = slen
+              IF (str_len-(xtra+1) .LT. 0) xtra = 1
+	      WRITE ( fmt, 3000 ) str_len, str_len-(xtra+1)
+ 3000	      FORMAT( '(1PG',I2,'.',I2,')' )
+	      WRITE ( TM_FMT_SNGL, fmt ) val
+	   ENDIF
+
+* INTEGER STRING
+* numbers whose needed digits are all on the left (eg. -2.0001 in 4 characters)
+* or whose length is too long to add a decimal point (eg. 25.5 in 3 characters)
+* may/must be represented as integers
+	ELSEIF ( sig_left .GE. sig_needed .OR. nleft .GE. slen-1 ) THEN
+* ... check if nearest integer will alter formatting (e.g. 99.6-->100)
+
+	   aval = NINT(aval)
+	   l10      = LOG10(aval)
+           IF (aval .EQ. 0.) l10 = 0.
+	   IF ( l10 .GE. 0.0 ) THEN
+	      chk10 = INT(l10) + 1
+	   ELSE
+	      chk10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	   ENDIF
+	   IF ( chk10 .NE. chk10_save ) GOTO 10
+	   str_len = nleft - added_pow10
+	   iloop = 0
+ 9000	   IF (str_len .LE. 0) str_len = 1
+	   WRITE ( fmt, 3100 ) str_len
+ 3100	   FORMAT ( '(I',I2,')' )
+	   WRITE ( TM_FMT_SNGL, fmt ) NINT(val)
+	   IF (INDEX(TM_FMT_SNGL,'*') .EQ. 1) THEN
+	      str_len = str_len + 1
+	      iloop = iloop + 1
+	      IF (iloop .LT. 5) GOTO 9000
+	   ENDIF
+
+* FIXED POINT STRING
+	ELSE
+	   nright = MIN( sig_needed-pow10, slen-(nleft+1) )
+	   str_len = nleft + nright + 1
+	   WRITE ( fmt, 3200 ) str_len, nright
+ 3200	   FORMAT ( '(F',I2,'.',I2,')' )
+	   WRITE ( TM_FMT_SNGL, fmt ) val
+	   IF (slen .GE. 3) THEN 
+	       IF (TM_FMT_SNGL(1:3) .EQ. ' -.') THEN
+		  TM_FMT_SNGL(1:3) = '-0.'	! 8/96 for aix&hp
+	       ELSEIF (TM_FMT_SNGL(1:1) .EQ. ' ') THEN
+                  TM_FMT_SNGL(1:1) = '0'
+	       ENDIF	
+	   ENDIF
+* Precision in computation of value of FULL can cause an extra
+* digit at the end, and so trailing 0s may still exist. Remove them.
+           slen = TM_LENSTR1( TM_FMT_SNGL )
+           DO 3300 i = slen,1,-1
+              IF (TM_FMT_SNGL(i:i) .EQ. '0') THEN
+                 TM_FMT_SNGL(i:i) = ' '
+                 str_len = str_len - 1
+              ELSE
+                 GOTO 3400
+              ENDIF
+ 3300      CONTINUE
+ 3400      CONTINUE
+
+	ENDIF
+	RETURN
+
+* return exact zero
+ 1000	TM_FMT_SNGL  = '0'
+	str_len = 1
+	RETURN
+
+      END
diff --git a/fmt/src/tm_fmt_sngl_digits.F b/fmt/src/tm_fmt_sngl_digits.F
new file mode 100644
index 0000000..3304890
--- /dev/null
+++ b/fmt/src/tm_fmt_sngl_digits.F
@@ -0,0 +1,272 @@
+	CHARACTER*(*) FUNCTION TM_FMT_SNGL_DIGITS
+     .            ( val, digits, max_len, str_len )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert the value val to a formatted string, left justified, not exceeding
+* max_len in length and if digits < 0, have the number of digits after the
+* decimal point exactly specified by digits, e.g. for digits=-2, 0 is 0.00. 
+* For consistent labels on color keys, called by key.F
+
+* programmer - Ansley Manke, from tm_fmt_digits.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* 1/13/2012
+* Single-precision version of TM_FMT_DIGITS, to be called from PPLUS.
+
+
+* calling arguments:
+* val		- REAL*4 value to be converted
+* digits	- IF >0 maximum number of significant digits desired
+*	        - ELSE  EXACT number of decimal places desired
+* max_len	- longest allowable length for string to be returned
+* str_len	- (returned) actual length of the string generated
+
+* calling argument declarations:
+	INTEGER		digits, max_len, str_len
+	REAL*4		val
+
+* internal variable declarations:
+	LOGICAL		exp_fmt, negative, fixed_pt
+	INTEGER		slen, sig_left, sig_full, nleft, nright, full,
+     .			sig_max, full10, xtra, sig_needed, pow10,
+     .			chk10, chk10_save, waste
+	REAL*4		aval, l10
+	CHARACTER*10	fmt
+
+* local parameters:
+	INTEGER		TM_CHECK_NAN, TM_CHECK_INF, max_int_len, sig_min
+	REAL*4		eps, one_m_eps
+	PARAMETER     ( max_int_len = 8,
+     .			sig_min     = 1,		! minimum sig. digits
+     .			eps         = 0.6E-7,		! 1/95 - was 1.E-7
+     .			one_m_eps   = 1.0 - eps )
+
+* special treatment for exact zero
+	IF ( val .EQ. 0.0 .AND.  digits .GE. 0) GOTO 1000
+
+* initialize
+	negative = val .LT. 0.0
+	fixed_pt = digits .LE. 0
+	aval     = ABS( val )
+	TM_FMT_SNGL_DIGITS   = ' '
+	exp_fmt  = .FALSE.
+
+* maximum length of output string (at least 1 character long)
+	slen = MIN( LEN(TM_FMT_SNGL_DIGITS), max_len )
+	slen = MAX( 1, slen )
+
+* If the value is NaN, set the string here
+        IF ( TM_CHECK_NAN(aval) .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              TM_FMT_SNGL_DIGITS  = 'NaN'
+              str_len = 3
+           ELSE
+              TM_FMT_SNGL_DIGITS = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* If the value is NaN, or Inf, set the string here
+        IF ( TM_CHECK_INF(val)  .EQ. 1   ) THEN
+           IF (slen .GE. 3) THEN
+              TM_FMT_SNGL_DIGITS  = 'Inf'
+              str_len = 3
+           ELSE
+              TM_FMT_SNGL_DIGITS = '*'
+              str_len = 1
+           ENDIF
+	   RETURN
+        ENDIF
+
+* location of leftmost digit (.01-->-1, 0.1-->0, 1.0-->1, etc.)
+ 10	l10      = LOG10(aval)
+           IF (aval .EQ. 0.) l10 = 0.
+           IF ( l10 .GE. 0.0 ) THEN
+	   pow10 = INT(l10) + 1
+	ELSE
+	   pow10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	ENDIF
+	chk10_save = pow10
+
+* compute total significant digits requested
+ 50	IF ( fixed_pt ) THEN
+	   sig_max = pow10 + ABS(digits)
+	ELSE
+	   sig_max = digits
+	ENDIF
+
+* significant digits to left of the decimal point
+	sig_left = MAX( pow10, 0 )
+
+* actual characters to the left of the decimal point
+	nleft = MAX( sig_left, 1 )
+	IF ( negative ) nleft = nleft + 1	! minus sign
+
+* compute "wasted" space needed for minus signs, left zeros and decimal points
+	waste = nleft - sig_left			! sign and left zero
+	IF ( sig_max .GT. sig_left ) waste = waste + 1	! decimal point
+	IF ( pow10 .LT. 0 ) waste = waste + ABS(pow10)	! leading zeros
+
+* modify # significant digits: cannot request more digits than the integer
+* word size or the "unwasted" string length
+* but at lease sig_min digits
+	sig_full = MAX( sig_min, MIN( sig_max, max_int_len, slen-waste ) )
+
+* create an integer with all the possible digits
+* (1-eps factor is because VAX Fortran formats round 100.5-->100 whereas VAX 
+* NINT function rounds 100.5 -->101)
+* Note: On DEC/OSF f77 the integer calculation blows up when compiled with -g
+*       It was observed with sig_full=4, pow10=-6, aval=6.27833E-07
+* 	Kludge work-around is to use the floating point calculation for cases
+*	where sig_full+pow10 is too large (10 or larger crashes, expermentally)
+! pre-1/95	full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+! pre-3/95	full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+* 9/95 ... it turns out that for large values (e.g. 2.16E8) that pow10
+* can be larger than sig_full givin 10**(negative) --> zero (integer calc)
+* so the IF condition has had a check added for this
+! 12/95: The value 9.9995 displayed with 4 sig_full=4 generates (F5.3) and
+! blows up because 9.9995 rounds to 10.000 on OSF Fortran. This occurs because
+! full is computed to be 9999 when the one_m_eps factor is included. Since the
+! comments just above indicate that one_m_eps was included to fix a VAX bug
+! we have removed this logic to an ifdef: NINT_WRITE_UNMATCH
+
+# ifdef NINT_WRITE_UNMATCH
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10)) * one_m_eps )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10) * one_m_eps )
+	ENDIF
+# else
+	IF ( sig_full-pow10 .LT. 10
+     .	.AND. sig_full      .GT. pow10 ) THEN
+	   full = NINT( aval * (10**(sig_full-pow10))  )
+	ELSE
+	   full = NINT( aval * 10.**(sig_full-pow10)  )
+	ENDIF
+# endif
+
+* special check: eg. 99.9 --> 100.0 , changing leftmost digit
+	IF ( full .EQ. 10**sig_full ) THEN
+	   pow10 = pow10 + 1
+	   GOTO 50
+	ENDIF
+
+* get number of digits remaining after trimming off right hand zeros
+	full10 = 10 ** (sig_full-sig_min)
+	DO 100 sig_needed = sig_min, sig_full
+	   IF ( MOD(full, full10) .EQ. 0 ) GOTO 200
+	   full10 = full10 / 10
+ 100	CONTINUE
+	sig_needed = sig_full
+
+* * * * CREATE A FORMAT STRING AND WRITE THE RESULT * * *
+* EXACT ZERO - fixed point numbers that would be 0.000...
+ 200	IF ( fixed_pt .AND. sig_min-pow10 .GT. slen-waste ) THEN
+	   GOTO 1000
+
+* EXPONENTIAL STRING
+* numbers too small for fixed point (eg. 0.0000025 represented as 0.0)
+* or too big for the string length  (eg. 150000 can't fit in 4 spaces)
+* or with integer parts big enuf to ovflow the integer size (eg.123456789.123)
+* must be written in exponential format
+	ELSEIF ( sig_min-pow10 .GT. slen-waste
+     .	.OR. nleft .GT. slen 
+     .	.OR. nleft .GT. max_int_len ) THEN
+	   IF ( negative ) THEN
+	      xtra = 6
+	   ELSE
+	      xtra = 5
+	   ENDIF
+	   IF ( slen .LE. xtra ) THEN
+	      TM_FMT_SNGL_DIGITS  = '******'
+	      str_len = slen
+	   ELSE
+	      str_len = MIN( slen, sig_needed+xtra)
+	      WRITE ( fmt, 3000 ) str_len, str_len-(xtra+1)
+ 3000	      FORMAT( '(1PG',I2,'.',I2,')' )
+	      WRITE ( TM_FMT_SNGL_DIGITS, fmt ) val
+	   ENDIF
+
+* INTEGER STRING
+* numbers whose needed digits are all on the left (eg. -2.0001 in 4 characters)
+* or whose length is too long to add a decimal point (eg. 25.5 in 3 characters)
+* may/must be represented as integers
+	ELSEIF ( digits .GE. 0 .AND. 
+     .           (sig_left .GE. sig_needed .OR. nleft .GE. slen-1) ) THEN
+* ... check if nearest integer will alter formatting (e.g. 99.6-->100)
+	   aval = NINT(aval)
+	   l10      = LOG10(aval)
+           IF (aval .EQ. 0.) l10 = 0.
+	   IF ( l10 .GE. 0.0 ) THEN
+	      chk10 = INT(l10) + 1
+	   ELSE
+	      chk10 = INT( l10 * one_m_eps )  ! eps for machine round-off problems
+	   ENDIF
+	   IF ( chk10 .NE. chk10_save ) GOTO 10
+	   str_len = nleft
+	   IF (str_len .LE. 0) str_len = 1  ! as in tm_fmt.F just to be sure.
+	   WRITE ( fmt, 3100 ) str_len
+ 3100	   FORMAT ( '(I',I2,')' )
+	   WRITE ( TM_FMT_SNGL_DIGITS, fmt ) NINT(val)
+
+* FIXED POINT STRING
+	ELSE
+	   nright = MIN( sig_needed-pow10, slen-(nleft+1) )
+	   IF (digits .LT. 0) nright = MAX( nright, ABS(digits) )
+	   str_len = nleft + nright + 1
+	   WRITE ( fmt, 3200 ) str_len, nright
+ 3200	   FORMAT ( '(F',I2,'.',I2,')' )
+	   WRITE ( TM_FMT_SNGL_DIGITS, fmt ) val
+	   IF (slen .GE. 3) THEN 
+	       IF (TM_FMT_SNGL_DIGITS(1:3) .EQ. ' -.') THEN
+		  TM_FMT_SNGL_DIGITS(1:3) = '-0.'	! 8/96 for aix&hp
+	       ELSEIF (TM_FMT_SNGL_DIGITS(1:1) .EQ. ' ') THEN
+                  TM_FMT_SNGL_DIGITS(1:1) = '0'
+	       ENDIF	
+	   ENDIF
+	ENDIF
+	RETURN
+
+* return exact zero
+ 1000	TM_FMT_SNGL_DIGITS  = '0'
+	str_len = 1
+	RETURN
+
+      END
+ 
diff --git a/fmt/src/tm_fp_convert.F b/fmt/src/tm_fp_convert.F
new file mode 100644
index 0000000..67caaa6
--- /dev/null
+++ b/fmt/src/tm_fp_convert.F
@@ -0,0 +1,166 @@
+	SUBROUTINE TM_FP_CONVERT(buffer,ncnt,author_cpu)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert VAX or IEEE big/little endian into the currently active CPU
+* representation
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS, DEC Ultrix, and SUN
+*
+* revision 0.0 - 2/11/92 - based on code from Dave Borg-Breen
+*  (ref. VAX Professional, August '91)
+* bug fix *sh* 3/92 - need special check for exact zero
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+* *kob* 10/96 	- Linux port.  Linux didnt like tabs 
+*		  between "include"
+*	          and what was being included.  removed them
+
+* calling argument declarations:
+	INTEGER ncnt, author_cpu
+	REAL    buffer(ncnt)
+
+* internal variable declarations:
+        REAL*4    dum
+        INTEGER*4 idum, k
+
+#ifdef sun
+      include 'xmachine_byte.cmn'
+      BYTE bb(4),bdum
+#else
+                include 'xmachine_int1.cmn'
+      		INTEGER*1 bb(4),bdum
+#endif
+
+	EQUIVALENCE (bb(1),dum), (idum,dum)
+
+
+***********   CONVERT between machine types   **************
+*** use the pre-processor to select the target word type ***
+#ifdef sun
+* SUN is the platform in use
+      IF     ( author_cpu .EQ. cptype_vax ) THEN   ! VAX -> SUN
+	 DO 100 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 100 ! check for exact zero
+	    bdum = bb(1)
+	    bb(1) = bb(2)-1
+	    bb(2) = bdum
+	    bdum = bb(4)
+	    bb(4) = bb(3)
+	    bb(3) = bdum
+	    buffer(k) = dum
+ 100     CONTINUE
+      ELSEIF ( author_cpu .EQ. cptype_dec ) THEN   ! SUN <-> DECstation
+         DO 200 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 200 ! check for exact zero
+	    bdum = bb(1)
+	    bb(1) = bb(4)
+	    bb(4) = bdum
+	    bdum = bb(2)
+	    bb(2) = bb(3)
+	    bb(3) = bdum
+	    buffer(k) = dum
+ 200     CONTINUE
+      ENDIF
+
+#else
+#if unix
+* DECstation is the platform in use
+
+      IF     ( author_cpu .EQ. cptype_vax ) THEN  ! VAX -> DECstation
+	 DO 100 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 100 ! check for exact zero
+	    bdum = bb(1)
+	    bb(1) = bb(3)
+	    bb(3) = bdum
+	    bdum = bb(2)
+	    bb(2) = bb(4)
+	    bb(4) = bdum-1
+	    buffer(k) = dum
+ 100     CONTINUE
+      ELSEIF ( author_cpu .EQ. cptype_sun ) THEN  ! SUN <-> DECstation
+	 DO 200 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 200 ! check for exact zero
+	    bdum = bb(1)
+	    bb(1) = bb(4)
+	    bb(4) = bdum
+	    bdum = bb(2)
+	    bb(2) = bb(3)
+	    bb(3) = bdum
+	    buffer(k) = dum
+ 200     CONTINUE
+      ENDIF
+
+#else
+* VAX is the platform in use
+      IF     ( author_cpu .EQ. cptype_dec ) THEN    ! DECstation -> VAX
+	 DO 100 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 100 ! check for exact zero
+	    bdum = bb(1)
+	    bb(1) = bb(3)
+	    bb(3) = bdum
+	    bdum = bb(4)
+	    bb(4) = bb(2)
+	    bb(2) = bdum+1
+	    buffer(k) = dum
+ 100     CONTINUE
+      ELSEIF ( author_cpu .EQ. cptype_sun ) THEN    ! SUN -> VAX
+	 DO 200 k = 1, ncnt
+	    dum = buffer(k)
+            IF ( idum .EQ. 0 ) GOTO 200 ! check for exact zero
+	    bdum = bb(2)
+	    bb(2) = bb(1)+1
+	    bb(1) = bdum
+	    bdum = bb(4)
+	    bb(4) = bb(3)
+	    bb(3) = bdum
+	    buffer(k) = dum
+ 200     CONTINUE
+      ENDIF
+#endif
+#endif
+
+      RETURN
+      END
diff --git a/fmt/src/tm_fpeq.F b/fmt/src/tm_fpeq.F
new file mode 100644
index 0000000..635975e
--- /dev/null
+++ b/fmt/src/tm_fpeq.F
@@ -0,0 +1,77 @@
+	LOGICAL FUNCTION TM_FPEQ ( a, b )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if REAL*4 floating point numbers are equal to within
+* "reasonable" accuracy
+* REAL*4 (F_floating) machine error on the VAX is "approximately one part in
+* 2**23" or 1.2E-7.  Allow 4.E-7 as machine error after many typical roundoffs.
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/21/85
+* revision 0.10 - 10/23/87 - all variables explicitly declared
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+*      *kms*  3/12 modified to actually use the maximum absolute error
+*
+
+* calling arguments:
+	REAL	a, b
+
+* local parameters
+	LOGICAL    TM_DFPEQ
+	REAL	   VAX_epsilon, eps
+	PARAMETER (VAX_epsilon = 4.E-7)
+
+#ifdef double_p
+
+        TM_FPEQ = TM_DFPEQ(a, b)
+
+#else
+
+* determine the maximum relative error
+        eps = ABS(b) * VAX_epsilon
+* if close to zero, set the maximum absolute error
+        IF ( eps .LT. VAX_epsilon ) eps = VAX_epsilon
+
+* make the comparison
+        TM_FPEQ = ( ABS(a-b) .LE. eps )
+
+#endif
+
+	RETURN
+	END
diff --git a/fmt/src/tm_fpeq_eps.F b/fmt/src/tm_fpeq_eps.F
new file mode 100644
index 0000000..8e42e06
--- /dev/null
+++ b/fmt/src/tm_fpeq_eps.F
@@ -0,0 +1,69 @@
+	LOGICAL FUNCTION TM_FPEQ_EPS ( eps, a, b )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if REAL*4 floating point numbers are equal to within
+* "reasonable" accuracy
+* REAL*4 (F_floating) machine error on the VAX is "approximately one part in
+* 2**23" or 1.2E-7.  Allow 4.E-7 as machine error after many typical roundoffs.
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+*
+* revision 0.00 - 11/21/85
+* revision 0.10 - 10/23/87 - all variables explicitly declared
+*
+* 8/08 *acm* See Bug 1483
+*      *kms*  3/12 modified to actually use the maximum absolute error
+*
+
+* calling arguments:
+        REAL eps, a, b
+
+* local variables
+        REAL abmin, diffeps
+
+* determine the maximum relative error
+        abmin = MIN( ABS(a), ABS(b) )
+        diffeps = abmin * ABS(eps)
+* if close to zero, set the maximum absolute error
+        IF ( diffeps .LT. ABS(eps) ) diffeps = ABS(eps)
+
+        TM_FPEQ_EPS = ( ABS(a-b) .LE. diffeps )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_fpeq_sngl.F b/fmt/src/tm_fpeq_sngl.F
new file mode 100644
index 0000000..a27c05f
--- /dev/null
+++ b/fmt/src/tm_fpeq_sngl.F
@@ -0,0 +1,70 @@
+	LOGICAL FUNCTION TM_FPEQ_SNGL ( a, b )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration''s (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* test to see if REAL*4 floating point numbers are equal to within
+* "reasonable" accuracy
+* REAL*4 (F_floating) machine error on the VAX is "approximately one part in
+* 2**23" or 1.2E-7.  Allow 4.E-7 as machine error after many typical roundoffs.
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* programmer - Ansley Manke, from tm_fpeq.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* 1/13/2012
+* Single-precision version of TM_FPEQ, to be called from PPLUS.
+*      *kms*  3/12 modified to actually use the maximum absolute error
+*
+
+* calling arguments:
+	REAL*4 a, b
+
+* local parameters
+	REAL*4	   VAX_epsilon, eps
+	PARAMETER (VAX_epsilon = 4.E-7)
+
+* determine the maximum relative error
+        eps = ABS(b) * VAX_epsilon
+* if close to zero, set the maximum absolute error
+        IF ( eps .LT. VAX_epsilon ) eps = VAX_epsilon
+
+* make the comparison
+        TM_FPEQ_SNGL = ( ABS(a-b) .LE. eps )
+
+	RETURN
+	END
diff --git a/fmt/src/tm_friendly_read.F b/fmt/src/tm_friendly_read.F
new file mode 100644
index 0000000..efe46b3
--- /dev/null
+++ b/fmt/src/tm_friendly_read.F
@@ -0,0 +1,84 @@
+	SUBROUTINE TM_FRIENDLY_READ( prompt, buff, * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get a line of input allowing full gnu-readline line editing
+* take abnormal return if eof is encountered
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix and VMS operating systems
+*
+* rev 0.0 -   5/9/91
+*  Sun Port 1/30/92 -kob-  added ifdef sun because uses BYTE whereas
+*  DECstation uses  INTEGER*1
+* 1/94 *sh* increased max read buffer len (blen) from 256 to 512
+* 4/01 *sh* increased blen again -- to 2048
+
+* calling argument declarations:
+        CHARACTER*(*) prompt, buff
+
+#ifdef unix
+
+* internal variable declarations:
+! "blen" must exceed the longest read
+        INTEGER plen, blen
+        PARAMETER (plen = 8, blen = 2048 )
+
+#ifdef sun
+        BYTE      hprompt(plen), hbuff(blen)
+#else
+        INTEGER*1 hprompt(plen), hbuff(blen)
+#endif
+
+* translate to null-terminated c-type strings
+        CALL TM_FTOC_STRNG( prompt, hprompt, plen )
+
+* call c-written routine to get input line
+        CALL TM_FTOC_READLINE( hprompt, hbuff )
+
+* translate recieved input line to FORTRAN character array
+        CALL TM_CTOF_STRNG( hbuff, buff, blen )
+
+* null string returned means that EOF (^D) was entered
+        IF ( hbuff(1) .EQ. 4 ) RETURN 1     ! ^D passed
+
+#else
+        STOP 'TM_FRIENDLY_READ isn't used by VMS'
+#endif
+	RETURN
+	END
+
diff --git a/fmt/src/tm_ftoc_readline.c b/fmt/src/tm_ftoc_readline.c
new file mode 100644
index 0000000..cd80a56
--- /dev/null
+++ b/fmt/src/tm_ftoc_readline.c
@@ -0,0 +1,201 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+
+
+/* tm_ftoc_readline -- based on "manexamp.c" in the readline distribution. */
+/* c jacket  to make gnu readline callable from FORTRAN */
+
+/* had to add ifdef check for trailing underscore in routine name
+   for aix port *kob* 10/94 */
+
+/* Readline is very slow for piped I/O, so run w/o readline for Ferret server
+ * *js* 12/98
+ */
+
+/* v51 *kob* - upgraded to new version of readline, which is now seperate
+   from tmap library - modified readline include to that end */
+
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build*/
+/*
+ * *kms* 10/11 use a static memory line in server mode
+ *             (eliminate many small malloc/free calls);
+ *             make end-of-line clean-up cleaner and more portable;
+ *             do not add lines to readline history when in server mode.
+ * *kms* 10/11 change to using pyferret._readline to get the line
+ *             when not in server mode.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "pyferret.h"
+
+/* Easier way of handling FORTRAN calls with underscore/no underscore */
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+/* Static memory to contain the line read */
+#define STATIC_LINE_LEN 2048
+static char static_line[STATIC_LINE_LEN];
+
+/*
+ * Prompt the user, using the input argument prompt, for the next input
+ * line, then read and return that line.  Calls pyferret._readline, which
+ * uses the raw_input function in Python to do this so other Python
+ * operations are not blocked by our own call to a readline function.
+ * Returns NULL on error or EOF.
+ */
+static char *pyferret_readline(char *prompt)
+{
+    PyObject *resultobj;
+    char *resultstr;
+    int   resultstrlen;
+
+    /* call pyferret._readline - a NULL prompt turns into a Python None argument */
+    resultobj = PyObject_CallMethod(pyferret_module_pyobject, 
+                                    "_readline", "s", prompt);
+    if ( resultobj == NULL ) {
+        sprintf(static_line, "**ERROR pyferret_readline in tm_ftoc_readline.c: "
+                             "problems with the call to pyferret._readline: %s\n",
+                             pyefcn_get_error());
+        return NULL;
+    }
+
+    /* first check if None was returned == EOF */
+    if ( resultobj == Py_None ) {
+        Py_DECREF(resultobj);
+        return NULL;
+    }
+
+    /* get the string out of the result object */
+    resultstr = PyString_AsString(resultobj);
+    if ( resultstr == NULL ) {
+        sprintf(static_line, "**ERROR pyferret_readline in tm_ftoc_readline.c: "
+                             "problems interpreting the return value of pyferret._readline: %s\n",
+                             pyefcn_get_error());
+        Py_DECREF(resultobj);
+        return NULL;
+    }
+
+    /* just truncate if the string is too long */
+    resultstrlen = strlen(resultstr);
+    if ( resultstrlen >= STATIC_LINE_LEN )
+        resultstrlen = STATIC_LINE_LEN - 1;
+
+    /* trim off any trailing whitespace */
+    resultstrlen--;
+    while ( (resultstrlen >= 0) && isspace(resultstr[resultstrlen]) ) {
+        resultstrlen--;
+    }
+    resultstrlen++;
+
+    /* make a copy of the string since resultstr belongs to resultobj */
+    strncpy(static_line, resultstr, resultstrlen);
+    static_line[resultstrlen] = '\0';
+
+    /* done with resultobj */
+    Py_DECREF(resultobj);
+
+    /* return the static memory copy of the line */
+    return static_line;
+}
+
+
+/* Read a string, and return a pointer to it.  Returns NULL on EOF. */
+static char *do_gets(char *prompt)
+{
+    char *line_read;
+
+    /* Get a line from the user. */
+    if ( ! FORTRAN(is_server)() ) {
+        /* Use pyferret._readline to get user input */
+        line_read = pyferret_readline(prompt);
+    }
+    else {
+        /* Server mode - just read the next line directly */
+        int linelen;
+
+        /* Prompt the user */
+        fputs(prompt, stdout);
+        fflush(stdout);
+
+        /* Get the answer */
+        if ( fgets(static_line, STATIC_LINE_LEN - 1, stdin) == NULL )
+            return NULL;
+
+        /* Trim off any trailing whitespace */
+        linelen = strlen(static_line);
+        linelen--;
+        while ( (linelen >= 0) && isspace(static_line[linelen]) ) {
+            linelen--;
+        }
+        linelen++;
+        static_line[linelen] = '\0';
+
+        /* Set the line read to the static memory line */
+        line_read = static_line;
+    }
+
+    return line_read;
+}
+
+
+/* c jacket routine to make gnu readline callable from FORTRAN */
+void FORTRAN(tm_ftoc_readline)(char *prompt, char *buff)
+{
+    char *ptr;
+
+    /* invoke either gets or readline with line recall and editing */
+    ptr = do_gets(prompt);
+
+    /* copy the line into the buffer provided from FORTRAN */
+    if ( ptr != (char *) NULL ) {
+        strcpy(buff, ptr);
+    }
+    else {
+        buff[0] = '\004';   /* ^D  */
+        buff[1] = '\0';
+    }
+
+    return;
+}
+
diff --git a/fmt/src/tm_ftoc_strng.F b/fmt/src/tm_ftoc_strng.F
new file mode 100644
index 0000000..b78f913
--- /dev/null
+++ b/fmt/src/tm_ftoc_strng.F
@@ -0,0 +1,95 @@
+	SUBROUTINE TM_FTOC_STRNG ( fstrng, cstrng, clen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a FORTRAN-style character string to a null-terminated Hollerith
+* suitable for passing to a c routine
+* normally the c string should be at least 1 byte longer than the FORTRAN
+*    string to accomodate the null terminator
+* note:  if the FORTRAN string contains terminating blanks they WILL be passed
+*        to the c string.  Pass the FORTRAN string with its exact length if
+*        this is not desired.
+*   e.g. CALL TM_FTOC_STRNG ( fstrng(:flen), cstrng, clen )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix operating system
+*
+* rev 0.0 -   5/6/91
+*  Sun Port 1/30/92 -kob-  added ifdef sun because uses BYTE where DECstation uses
+*                          INTEGER*1
+*calling arguments:
+* fstrng - CHARACTER string (passed by descriptor)
+* cstrng - BYTE (INTEREG*1) string (passed by pointer)
+* clen   - length of passed Hollerith array
+
+#ifdef unix
+* calling argument declarations:
+        INTEGER clen
+        CHARACTER*(*) fstrng
+
+#ifdef sun
+        BYTE      cstrng(clen)
+#else
+	INTEGER*1 cstrng(clen)
+#endif
+
+* internal variable declarations:
+	INTEGER	i, flen
+
+* length of input string
+        flen = LEN(fstrng)
+
+* copy from CHARACTER to null-terminated Hollerith
+        IF ( clen .GT. flen ) THEN
+           DO 100 i = 1, flen
+ 100       cstrng(i) = ICHAR( fstrng(i:i) )
+           cstrng(flen+1) = 0
+
+        ELSE
+* ... may be prematurely truncated ...
+           DO 200 i = 1, clen-1
+ 200       cstrng(i) = ICHAR( fstrng(i:i) )
+           cstrng(clen) = 0
+
+        ENDIF
+
+	RETURN
+#else
+        STOP 'TM_FTOC_STRNG is for Unix systems, only'
+#endif
+	END
+
diff --git a/fmt/src/tm_garb_col_grids.F b/fmt/src/tm_garb_col_grids.F
new file mode 100644
index 0000000..59e4538
--- /dev/null
+++ b/fmt/src/tm_garb_col_grids.F
@@ -0,0 +1,133 @@
+	SUBROUTINE TM_GARB_COL_GRIDS (dset)
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* set use counts for grids and axes. Remove temporaries.
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* V5.0 *sh* 7/99 - with the change in definition to char_init this routine
+*		may **for the first time** be doing work!!
+*		Found a logic bug in the loop that re-assigns ds_grid_number
+* V5.1 *sh* 4/00 - using dynamic grids and axes
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*	dset - the current data set
+
+* include files
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	        include 'xdset_info.cmn_text'
+        external xdset_info_data
+
+* calling argument declarations:
+      INTEGER dset
+
+* local variable declarations:
+      INTEGER igrid, iaxis, idim
+
+* reset the use counts of all newly-created grids to zero
+* (They are set to 1 when allocated, but we set them to zero to put them
+*  on a par with grids not created by this dtaa set, but used by it)
+*  recatalog the grids defined by this data set
+	igrid = 0		! to get start of linked list
+ 10	CALL TM_NEXT_TMP_GRID( igrid, *19)
+	   grid_use_cnt(igrid) = 0
+	   GOTO 10
+ 19	CONTINUE
+
+* bump the use counts of grids used by variables in this data set
+	CALL TM_DSET_USE_GRIDS( dset )
+
+*  recatalog the grids defined by this data set
+ 100	igrid = 0		! to get start of linked list
+	   CALL TM_NEXT_TMP_GRID( igrid, *199)
+
+* ... bump use counts on all lines used by these grids
+	   IF ( grid_name(igrid) .NE. char_init ) THEN
+	      DO 110 idim = 1, nferdims
+ 110	      CALL TM_USE_LINE( grid_line(idim,igrid) )
+
+!* ... a use count of zero indicates that this explicit parent grid is not used
+!*	set its use count to 1 to indicate that it uses itself
+!	      IF ( grid_use_cnt(igrid) .EQ. 0 ) grid_use_cnt(igrid) = 1
+
+* ... recatalog as a valid dynamic grid
+	      CALL TM_RE_ALLO_TMP_GRID( igrid )
+
+	   ELSE
+	      CALL TM_USE_DYN_GRID( igrid )  ! to avoid error trap
+	      CALL TM_DEALLO_DYN_GRID_SUB( igrid )
+
+	   ENDIF
+
+	   GOTO 100
+ 199	CONTINUE
+
+
+* recatalog the axes defined by this data set -- use counts are zero so far
+ 300	iaxis = 0	! to get start of linked list
+	   CALL TM_NEXT_TMP_LINE( iaxis, *1000)
+
+* ... add to list of valid dynamic lines
+	   IF ( line_name(iaxis) .NE. char_init16 ) THEN
+
+* ... a use count of zero indicates that this axis was defined but never used
+*	(as, for example, in the file climatological_axes.cdf)
+*	Flag it is a keeper -- requiring explicit deletion
+	      IF ( line_use_cnt(iaxis) .EQ. 0 )
+     .					line_keep_flag( iaxis ) = .TRUE.
+
+	      CALL TM_RE_ALLO_TMP_LINE( iaxis )
+
+	   ELSE
+	      CALL TM_USE_LINE( iaxis )  ! to avoid error trap
+	      CALL TM_DEALLO_DYN_LINE( iaxis )
+
+	   ENDIF
+
+	GOTO 300
+
+
+* successful completion
+ 1000	RETURN
+
+	END
diff --git a/fmt/src/tm_garb_col_lines.F b/fmt/src/tm_garb_col_lines.F
new file mode 100644
index 0000000..91d065d
--- /dev/null
+++ b/fmt/src/tm_garb_col_lines.F
@@ -0,0 +1,142 @@
+	SUBROUTINE TM_GARB_COL_LINES ( first, last )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* garbage collect wasted space in newly defined lines (axes)
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+*
+* IBM PORT 14apr94 *kob* : Port to IBM revealed a transfer controll problem at 
+*			   around label 200.  A "goto" statment was passing
+*			   control to a continue statment.
+* V500: 7/99 *sh* - bug fix: need consistent use of char_init16 on line_name
+*		    bug fix: invalid branch at 4/94 fix -- was hidden all
+*			     this time because line_name check was invalid
+*			     so code was never executed
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* argument definitions:
+*       first   - highest number line to check
+*       last    - lowest number line to check
+* note: lines are allocated from high to low
+
+* include files
+
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	
+* argument declarations
+	INTEGER	 first, last
+
+* local variable declarations:
+      INTEGER iaxis, hiaxis, igrid, i, idim, next_mem, freed_mem
+
+* there is no way that grids can be using unnamed axes
+* delete 'em incrementing the grid axis pointers and compacting line memory
+
+* initialize axis loop
+!  like: DO 400 iaxis = first, last   but hiaxis keeps shifting down
+      iaxis = first
+      hiaxis = last
+      IF (first .GT. last) RETURN
+
+* is this a hole ?
+ 10     IF ( line_name(iaxis) .NE. char_init16 ) GOTO 400
+
+* modify axis pointer saved in the grids
+           DO 110 igrid = 1, max_grids
+              IF ( grid_name(igrid) .EQ. char_init ) GOTO 110
+              DO 100 idim = 1, nferdims
+                 IF ( grid_line(idim, igrid) .EQ. iaxis )
+     .         write (6,*) 'grid defns are garbled!: TM_GRID_GARBAGE' ! diag
+                 IF ( grid_line(idim, igrid) .GT. iaxis
+     .          .AND. grid_line(idim, igrid) .LE. hiaxis )
+     .                grid_line(idim,igrid) = grid_line(idim,igrid) - 1
+ 100          CONTINUE
+ 110       CONTINUE
+
+* is there line memory to free ?
+* this next goto was 200, but the IBM compiler wouldn't accept a 
+* transfer of control to a continue statment.  *kob* 14apr94
+* 7/99 *sh* for regular lines skip over line_subsc and line_mem code
+           IF ( line_regular(iaxis) ) GOTO 295	! was 205 pre 7/00 (bug)
+
+* look ahead to the next line with uneven point spacing 
+           DO 200 i = iaxis+1, hiaxis
+              IF ( .NOT.line_regular(i) ) THEN
+                 next_mem = line_subsc1(i)
+                 GOTO 210
+              ENDIF
+ 200       CONTINUE
+ 205       next_mem  = next_line_mem_pos
+ 210       freed_mem = next_mem - line_subsc1(iaxis)
+
+* shift this much line memory to fill the hole
+           DO 250 i = next_mem, next_line_mem_pos
+ 250       line_mem(i-freed_mem) = line_mem(i)
+
+* update line memory pointers
+           DO 280 i = iaxis+1, hiaxis
+              IF ( .NOT.line_regular(i) ) THEN
+                 line_subsc1(i) = line_subsc1(i) - freed_mem
+              ENDIF
+ 280       CONTINUE
+           next_line_mem_pos = next_line_mem_pos - freed_mem
+           
+* shift all the definitions back to fill the hole
+ 295	   DO 300 i = iaxis+1, hiaxis
+ 300       CALL TM_COPY_LINE( i, i-1 )
+
+* initialize new hole at end
+           line_name(hiaxis) = char_init16
+           line_subsc1(hiaxis) = unspecified_int4
+           hiaxis = hiaxis - 1
+           iaxis = iaxis - 1   ! nullify decrement below
+
+! like: 400    CONTINUE
+ 400    iaxis = iaxis + 1
+        IF ( iaxis .LE. hiaxis ) GOTO 10
+
+* successful completion
+        RETURN
+
+	END
diff --git a/fmt/src/tm_get_205_run_line.F b/fmt/src/tm_get_205_run_line.F
new file mode 100644
index 0000000..5cdf5e0
--- /dev/null
+++ b/fmt/src/tm_get_205_run_line.F
@@ -0,0 +1,141 @@
+	SUBROUTINE TM_GET_205_RUN_LINE ( filename, expno, col_head,
+     .					 table_row, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* This routine will read a row from a file storing information about the
+* model runs (and maybe other data sets). It will return column heading
+* names, the row of experiment information, and a status key.
+*
+* Arguments:
+*	filename  - file to read from
+*	expno     - experiment number for desired info
+*	col_head  - a string containing column information (Bottom line)
+*	table_row - a string containing experiment information
+*	status    - return status
+*
+* Written 04/26/88 by M. Verschell for PMEL/TMAP
+*
+* revision 0.00 - 04/27/88
+* revision 0.01 - 02/20/89 - Clarified error message 9100
+* revision 0.02 -  1/91 *sh* syntax changes to accomodate DEC RISC compiler
+*               - and added TM_INQ_PATH with TMAP_RUNS
+*
+* IBM Port 14apr94 *kob* : READONLY not allowed in file open statments.  Added
+*			   an "#ifdef READONLY_ALLOWED"
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_errors.parm'
+        include 'xsys_names.cmn_text'
+        external xsys_names_data
+
+* Argument definitions
+	CHARACTER*(*)	filename, expno, col_head, table_row
+	INTEGER*4	status
+
+* Local Definitions 
+	CHARACTER*132	TM_INQ_PATH, buffer
+	INTEGER*4	lunit, explen
+	INTEGER*4	TM_LENSTR1
+	integer		flen	!  for RISC compiler
+	character*4	buff4
+
+* for RISC compiler: can't concatenate with CHAR*(*) variable
+	flen = MIN( LEN(filename), 132 )	! 132 is buffer size
+
+* locate the data base file (use "buffer" to store the path name temporarily)
+        buffer = TM_INQ_PATH( filename, tmap_model_runs, ' ',
+     .                        .TRUE., status )
+        IF ( status .NE. merr_ok ) GOTO 9999
+
+* Get available logical unit
+	CALL LIB_GET_LUN ( lunit )
+
+* Look for filename and open it
+	OPEN	( UNIT=lunit,
+     .		  FILE=buffer,
+     .		  STATUS='OLD',
+#ifdef READONLY_ALLOWED
+     .		  READONLY,
+#endif
+     .		  ERR=9000 )
+
+* Now search for the bottom line of the column headings
+  100	READ	( lunit, '(A132)', END=9100 ) buffer
+	IF ( INDEX(buffer,'=====') .EQ. 0 ) THEN
+          col_head = buffer
+	  GOTO 100
+	ENDIF
+
+* We found the column headings, search for the experiment info
+	explen = TM_LENSTR1(expno)
+  110	READ	( lunit, '(A132)', END=9200 ) buffer
+	IF ( INDEX(buffer(1:10),expno(1:explen)) .EQ. 0 ) GOTO 110
+	table_row = buffer
+	GOTO 9900
+
+* ERROR - opening filename
+ 9000	buffer = filename
+	CALL TM_ERRMSG ( merr_erreq, status, 'TM_GET_205_RUN_LINE',
+     .			 no_descfile, no_stepfile, 'FILE='//buffer(:flen),
+     .			 no_errstring, *9999 )
+
+* ERROR - searching for column headings
+ 9100	buffer = filename
+	CALL TM_ERRMSG ( merr_eof, status, 'TM_GET_205_RUN_LINE',
+     .			 no_descfile, no_stepfile, 'FILE='//buffer(:flen)//
+     .			 '. File not a correct Parameter file.',
+     .			 no_errstring, *9990 )
+
+* ERROR - searching for column headings
+ 9200	buffer = filename
+	explen = MIN( explen, 4 )
+	buff4 = expno
+	CALL TM_ERRMSG ( merr_eof, status, 'TM_GET_205_RUN_LINE',
+     .			 no_descfile, no_stepfile,'FILE='//buffer(:flen)//
+     .			 ' Experiment "'//buff4(:explen)//'" not found',
+     .			 no_errstring, *9990 )
+
+* Status set
+ 9900	status = merr_ok
+
+* Close file
+ 9990	CLOSE	( lunit, ERR=9000 )
+
+* Bye bye
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_get_205_run_parm.F b/fmt/src/tm_get_205_run_parm.F
new file mode 100644
index 0000000..42509a2
--- /dev/null
+++ b/fmt/src/tm_get_205_run_parm.F
@@ -0,0 +1,119 @@
+	SUBROUTINE TM_GET_205_RUN_PARM ( column, col_head, table_row,
+     .					 entry, entry_len, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* This routine will use "column" as a search string in "col_head" to
+* locate "entry" in "table_row". "Col_head" and "Table_row" are read
+* from a file storing information about the model runs (and maybe other
+* data sets).
+*
+* Arguments:
+*	column    - string to search for in col_head
+*	col_head  - a string containing column information (Bottom line)
+*	table_row - a string containing experiment information
+*       entry     - value in table_row pointed to by location of column
+*		    in col_head
+*	entry_len - length of entry
+*	status    - return status
+*
+* Written 04/26/88 by M. Verschell for PMEL/TMAP
+*
+* revision 0.00 - 04/27/88
+* revision 1.00 - 12/02/88 - major changes (unable to document)
+* revision 1.01 -  1/91 *sh* syntax changes to accomodate DEC RISC compiler
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+
+	include 'tmap_errors.parm'
+
+* Argument definitions
+	CHARACTER*(*)	column, col_head, table_row, entry
+	INTEGER*4	entry_len, status
+
+* Local Definitions
+	CHARACTER*132	up_col,up_head
+	INTEGER*4	col_strt, col_end, collen, headlen, i, istat
+	INTEGER*4	TM_LENSTR1, STR_UPCASE
+	LOGICAL		TM_HAS_STRING
+
+* Initialize
+	collen = TM_LENSTR1(column)
+	headlen = TM_LENSTR1(col_head)
+	status = STR_UPCASE(up_col,column(1:collen))
+	status = STR_UPCASE(up_head,col_head(1:headlen))
+
+* Locate "column" in "col_head"
+	IF ( .NOT. TM_HAS_STRING(up_head(1:headlen),column(1:collen)) )
+     .		 GOTO 9000
+
+* Found it, let's get the column start and end locations
+	DO i=INDEX(up_head(1:headlen),up_col(1:collen)),1,-1
+	  IF (up_head(i:i) .EQ. ' ') THEN
+	    col_strt = i+1
+	    GOTO 100
+	  ENDIF
+	ENDDO
+	col_strt = 1
+  100	col_end  = INDEX(up_head(col_strt:),' ') + col_strt-2
+
+* Pull out the entry now
+	IF (col_end .GT. col_strt) entry = table_row(col_strt:col_end)
+
+* Left justify, and determine length of entry
+	DO i=1,LEN(entry)
+	  IF (entry(i:i) .NE. ' ' .AND. entry(i:i) .NE. '	') THEN
+	    entry = entry(i:)
+	    entry_len = TM_LENSTR1(entry)
+	    GOTO 9900
+	  ENDIF
+	ENDDO
+	entry_len = 1
+	GOTO 9900
+
+* ERROR - searching for "column" in column headings
+ 9000	up_col = Column		! RISC bug: cannot use CHAR*(*) in concat
+	CALL TM_ERRMSG ( merr_keynf, status, 'TM_GET_205_RUN_PARM',
+     .			 no_descfile, no_stepfile, 'Column='//up_col(:collen),
+     .			 no_errstring, *9999 )
+
+* Status set
+ 9900	status = merr_ok
+
+* Bye bye
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_get_cal.F b/fmt/src/tm_get_cal.F
new file mode 100644
index 0000000..c735f90
--- /dev/null
+++ b/fmt/src/tm_get_cal.F
@@ -0,0 +1,57 @@
+      CHARACTER*(*) FUNCTION TM_GET_CAL (grid)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Return the calendar name associated with a grid
+C     Ansley Manke 3/01
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+C  Calling argument declarations:
+      INTEGER grid
+
+C  Internal argument declarations:
+      INTEGER tax
+
+      tax = grid_line (t_dim, grid)
+
+      TM_GET_CAL = line_cal_name (tax)
+
+      RETURN
+      END
diff --git a/fmt/src/tm_get_calendar_attributes.F b/fmt/src/tm_get_calendar_attributes.F
new file mode 100644
index 0000000..ccabbbf
--- /dev/null
+++ b/fmt/src/tm_get_calendar_attributes.F
@@ -0,0 +1,117 @@
+      SUBROUTINE TM_GET_CALENDAR_ATTRIBUTES (cal_id, nmonths, 
+     .                 ndays, yeardays, mon_names, d_in_mon, 
+     .                 d_before_mon, mon_by_d)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Loads data for the calendar given  into common.  These values are
+C     accessed by the date/time functions for all calendar-using plots.
+C     Returns status = merr_ok success, merr_varlim failure
+C
+C     NOTE the current calendar name and id are NOT changed: for that see
+C     tm_set_current_calendar().  This permits Ferret queries of a particular
+C     calendar without losing knowledge of the calendar in use.
+C
+C  12/14/00  ACM  (from Jerry's tm_load_calendar)
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+C     0.00000000000000000000000000000000000000000000000000000000000000001
+
+      include 'calendar.decl'
+      include 'calendar.cmn'
+      include 'tmap_errors.parm'
+      include 'tmap_dims.parm'
+      include 'xtm_grid.cmn_text'
+
+* Argument declarations
+      INTEGER cal_id
+      INTEGER nmonths, ndays, d_before_mon(*), mon_by_d(*), d_in_mon(*)
+      REAL    yeardays
+      CHARACTER*3 mon_names(*)
+
+* Local variable declarations
+      INTEGER status, i, j, k, nline
+      CHARACTER*20  new_t0
+ 
+C     OK CALENDAR ID?
+      if (cal_id .lt. 1 .or. 
+     .    cal_id .gt. max_calendars) then 
+         status = merr_varlim
+         goto 1000
+      end if
+
+C     SET NMONTHS AND NDAYS IN CALENDAR
+
+      nmonths = cals_num_months(cal_id)
+
+      ndays = cals_num_days(cal_id)
+
+      yeardays = cals_yeardays(cal_id)
+
+C     SET MONTH NAMES
+
+      do 110 i = 1, nmonths
+         mon_names(i) = cals_month_names(i,cal_id)
+ 110  end do
+
+C     SET D_IN_MON
+
+      do 120 i = 1, nmonths
+         d_in_mon(i) = cals_days_in_month(i,cal_id)
+ 120  end do
+
+C     SET D_BEFORE_MON
+
+      d_before_mon(1) = 0
+      do 130 i = 2, nmonths
+         d_before_mon(i) = d_before_mon(i-1) 
+     .                            + d_in_mon(i-1)
+ 130  end do
+
+C     SET MON_BY_D
+      k = 0
+      do 150 j = 1, nmonths
+         do 140 i = 1, d_in_mon(j)
+            k = k + 1
+            mon_by_d(k) = j
+ 140     end do
+ 150  end do
+      if (cal_id .EQ. julian) mon_by_d(k+1) = mon_by_d(k)
+ 
+      status = merr_ok
+
+ 1000 return
+
+      end
+
+
diff --git a/fmt/src/tm_get_calendar_id.F b/fmt/src/tm_get_calendar_id.F
new file mode 100644
index 0000000..734c7ba
--- /dev/null
+++ b/fmt/src/tm_get_calendar_id.F
@@ -0,0 +1,86 @@
+      INTEGER FUNCTION TM_GET_CALENDAR_ID (cal_name)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Return the calendar id associated with cal_name, a calendar name
+C     Zero is returned if cal_name is not a valid calendar.
+C     J Davison 10.99
+C     V 1.0
+C
+C     0.00000000000000000000000000000000000000000000000000000000000000001
+
+C 2/13/01  ACM  test for the calendar names: 
+C 4/30/04       add 366_DAY, ALL_LEAP, and 365_DAY
+C	"STANDARD" which is equivalent to 'GREGORIAN'
+C	"COMMON_YEAR" and 365_DAY" for "NOLEAP"
+C	"D360"  or "360" for "360DAY"
+C	"366_DAY" for "ALL_LEAP"
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+      include 'calendar.decl'
+      include 'calendar.cmn'
+
+      integer         end,ndx
+      character*255   test_string
+
+      character*(*)   cal_name
+
+*************************************************************************
+
+C     MOVE INPUT STRING TO UPPER CASE
+      call upnsquish (cal_name,test_string,end)
+
+C  Allow STANDARD same calendar as GREGORIAN
+      IF (test_string(1:3) .EQ. 'STA')  test_string = 'GREGORIAN'
+      IF (test_string(1:3) .EQ. 'COM')  test_string = 'NOLEAP'
+      IF (test_string(1:3) .EQ. '365')  test_string = 'NOLEAP'
+      IF (test_string(1:3) .EQ. '366')  test_string = 'ALL_LEAP'
+      IF (test_string(1:3) .EQ. 'D36')  test_string = '360DAY'
+      IF (test_string(1:3) .EQ. '360')  test_string = '360DAY'
+
+C     LOCATE NAME IN CALENDAR TABLE
+      do 10 ndx = 1, max_calendars
+         if (test_string(1:3) .eq. allowed_calendars(ndx)(1:3))
+     .        goto 100
+ 10   end do
+
+C     ERROR: CALENDAR NOT FOUND
+      tm_get_calendar_id = 0
+      goto 1000
+
+C     CALENDAR FOUND, RETURN ID
+ 100  tm_get_calendar_id = ndx
+
+ 1000 return
+
+      end
diff --git a/fmt/src/tm_get_calendar_name.F b/fmt/src/tm_get_calendar_name.F
new file mode 100644
index 0000000..a1f1655
--- /dev/null
+++ b/fmt/src/tm_get_calendar_name.F
@@ -0,0 +1,52 @@
+      CHARACTER*32 FUNCTION TM_GET_CALENDAR_NAME (cal_id)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Return the calendar name associated with cal_id an integer code.
+C     'no_calendar is returned if cal_id is not a valid code
+C     Ansley Manke 1/01
+* v533 *acm* 8/01 - test for cal_id had .LT. max_calendars; needs .LE.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+      include 'calendar.decl'
+      include 'calendar.cmn'
+
+      INTEGER cal_id
+
+      tm_get_calendar_name = 'NO_CALENDAR'
+
+C     LOCATE NAME IN CALENDAR TABLE
+      IF (cal_id .GT. 0   .AND.  cal_id .LE. max_calendars)
+     .     tm_get_calendar_name = allowed_calendars(cal_id)
+
+      end
diff --git a/fmt/src/tm_get_f_cal.F b/fmt/src/tm_get_f_cal.F
new file mode 100644
index 0000000..9a4abee
--- /dev/null
+++ b/fmt/src/tm_get_f_cal.F
@@ -0,0 +1,57 @@
+      CHARACTER*(*) FUNCTION TM_GET_F_CAL (grid)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Return the calendar name associated with F axis of a grid
+C     Ansley Manke 3/01
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+      INCLUDE 'tmap_dims.parm'
+      INCLUDE 'xtm_grid.cmn_text'
+      INCLUDE 'ferret.parm'
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+C  Calling argument declarations:
+      INTEGER grid
+
+C  Internal argument declarations:
+      INTEGER fax
+
+      fax = grid_line (f_dim, grid)
+
+      TM_GET_F_CAL = line_cal_name (fax)
+
+      RETURN
+      END
diff --git a/fmt/src/tm_get_grid_of_line.F b/fmt/src/tm_get_grid_of_line.F
new file mode 100644
index 0000000..af81747
--- /dev/null
+++ b/fmt/src/tm_get_grid_of_line.F
@@ -0,0 +1,82 @@
+	INTEGER FUNCTION TM_GET_GRID_OF_LINE (line)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Searches the list of predefined and user-defined grid_names and returns the
+* number associated with the first grid using the given axis.
+* If no match is found the value unspecified_int4 is returned.
+
+* V510 *sh* 5/00 - based on TM_GET_GRIDNUM
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+# include "tmap_dset.parm"	
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'	! pre-defined grid common
+#include "gt_lib.parm"
+
+* input arguments
+	INTEGER		line
+
+* local argument declarations
+	INTEGER		igrd, idim
+
+* check the static grids
+	DO 100 igrd=1,max_grids
+	  IF (grid_name(igrd) .EQ. char_init16) GOTO 100
+	  DO 90 idim = 1, nferdims
+	    IF ( grid_line(idim, igrd) .EQ. line ) THEN
+	      TM_GET_GRID_OF_LINE = igrd
+	      GOTO 900 
+	    ENDIF
+ 90	  CONTINUE
+100	CONTINUE
+
+* check the dynamic grids
+	igrd = 0
+ 200	CALL TM_NEXT_DYN_GRID( igrd, *299)
+	  DO 190 idim = 1, nferdims
+	    IF ( grid_line(idim, igrd) .EQ. line ) THEN
+	      TM_GET_GRID_OF_LINE = igrd
+	      GOTO 900 
+	    ENDIF
+ 190	  CONTINUE
+	GOTO 200
+
+* not found
+ 299	TM_GET_GRID_OF_LINE = unspecified_int4
+
+* found
+ 900	RETURN
+	END
diff --git a/fmt/src/tm_get_gridnum.F b/fmt/src/tm_get_gridnum.F
new file mode 100644
index 0000000..3987ffa
--- /dev/null
+++ b/fmt/src/tm_get_gridnum.F
@@ -0,0 +1,84 @@
+	INTEGER FUNCTION TM_GET_GRIDNUM (user_grid)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Searches the list of predefined and user-defined grid_names and returns the
+* number associated with the grid_name given by the user. If no match is found
+* the value unspecified_int4 is returned.
+*
+* written 11/86 By M. Verschell for PMEL/TMAP
+*
+* revision 0.01 - 08/17/88 - changed name from GT_GET_GRIDNUM
+*
+* *kob* 10/96 	- Linux port.  Linux didn't like tabs between "include"
+*	          and what was being included.  removed them
+* V510 *sh* 4/00 - conversion to dynamic grids and axes -- check 'em
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+# include "tmap_dset.parm"	
+	include 'tmap_dims.parm'	! 
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'	! pre-defined grid common
+	external xgt_grid_data
+
+	CHARACTER*(*)	user_grid
+	INTEGER*4	ngrid, istat
+	INTEGER*4	STR_CASE_BLIND_COMPARE
+
+* check the static grids
+	DO 100 ngrid=1,max_grids
+	  istat = STR_CASE_BLIND_COMPARE(grid_name(ngrid),user_grid)
+	  IF (istat .EQ. str_match) THEN
+	    TM_GET_GRIDNUM = ngrid
+	    GOTO 900
+	  ENDIF
+ 100	CONTINUE
+
+* check the dynamic grids
+	ngrid = 0
+ 200	CALL TM_NEXT_DYN_GRID( ngrid, *299)
+	  istat = STR_CASE_BLIND_COMPARE(grid_name(ngrid),user_grid)
+	  IF (istat .EQ. str_match) THEN
+	    TM_GET_GRIDNUM = ngrid
+	    GOTO 900
+	  ENDIF
+	GOTO 200
+
+* not found
+ 299	TM_GET_GRIDNUM = unspecified_int4
+
+* found
+ 900	RETURN
+	END
diff --git a/fmt/src/tm_get_like_dyn_grid.F b/fmt/src/tm_get_like_dyn_grid.F
new file mode 100644
index 0000000..d69cc7c
--- /dev/null
+++ b/fmt/src/tm_get_like_dyn_grid.F
@@ -0,0 +1,106 @@
+	SUBROUTINE TM_GET_LIKE_DYN_GRID ( ingrid, its_dyn, outgrid,
+     .					  static_lim,  status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Will compare "ingrid" to other grid definitions in common. Unlike
+* tm_get_like_grid this will check both static and dynamic grids.
+* If there is a match then "outgrid" returns with the number of the match.
+* The variable its_dyn tells if it is dynamic
+* If there is no match, then a new dynamic grid is created.
+* "outgrid" returns with the number of the new dynamic grid and its_dyn
+* is .TRUE..
+
+* created 9/95 *sh*
+* 	 11/95 added argument static_lim - kludge because the TMAP library
+*	       routines do not know that the upper portion of the grid
+*	       COMMON is used as scratch space by Ferret when determining
+*	       grids for variables.  This argument prevents accidental
+*	       matches against those scratch grids
+
+* V511: 5/00 *sh* even static grids get "used" now
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments
+	LOGICAL		its_dyn
+	INTEGER		ingrid, outgrid, static_lim, status
+*
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+*
+* Local definitions
+	INTEGER		TM_FIND_LIKE_GRID, TM_FIND_LIKE_DYN_GRID
+
+* initialize
+	its_dyn = .TRUE.
+
+* does it exist already among the existing, static grids?
+	outgrid = TM_FIND_LIKE_GRID(ingrid)
+	IF (outgrid .NE. unspecified_int4
+     ..AND. outgrid .LT. static_lim       ) THEN
+* ... yes - it matches an explicit grid
+	   its_dyn = .FALSE.
+	   CALL TM_USE_DYN_GRID( outgrid )	! added 5/00
+	ELSE
+
+* does it exist already among the existing, dynamic grids?
+	   outgrid =  TM_FIND_LIKE_DYN_GRID( ingrid )
+	   IF (outgrid .NE. unspecified_int4) THEN
+* ... yes - it matches an existing dynamic grid - inc its use count
+	      CALL TM_USE_DYN_GRID( outgrid )
+	   ELSE
+
+* it shall be a new dynamic grid  "(Gnnn)"
+	      CALL TM_ALLO_DYN_GRID( outgrid, status )
+	      IF (status .NE. merr_ok) GOTO 9000
+	      CALL TM_COPY_GRID_W_LINE_USE( ingrid, outgrid )
+
+* name it "(Gnnn)"
+	      WRITE ( grid_name(outgrid), 3000 ) outgrid - max_grids
+ 3000	      FORMAT('(G',I3.3,')')		! restricted to 3 digits
+
+	   ENDIF
+	ENDIF
+
+* successful completion
+	status = merr_ok
+ 9000	RETURN
+	END
diff --git a/fmt/src/tm_get_like_dyn_line.F b/fmt/src/tm_get_like_dyn_line.F
new file mode 100644
index 0000000..923beb1
--- /dev/null
+++ b/fmt/src/tm_get_like_dyn_line.F
@@ -0,0 +1,216 @@
+	SUBROUTINE TM_GET_LIKE_DYN_LINE(idim, lo, hi, del, like, class,
+     .					outline, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Returns a line matching the input description.
+* Will create a line description based on the input arguments and
+* compare it to other line definitions in common. Unlike
+* tm_get_like_line (and unlike TM_GET_LIKE_DYN_GRID) this will check
+* dynamic lines (only).
+* If there is a match then "outline" returns with the number of the match.
+* If there is no match, then a new dynamic line is created.
+* "outline" returns with the number of the new dynamic line and its_dyn
+* is .TRUE..
+
+* created 9/95 *sh*
+* Linux Port 5/96 *kob* - Had to add NINT to calculation of line_dim
+*			  because the last value was sometimes getting
+*			  truncated on linux, ie x[.1:1:.1] only listed
+*			  nine rather than ten points.
+* V533 *sh* 6/01 - save line_parent for regular stride axes, too
+*		   else the stride and delta cannot be recovered 
+* V541 *sh* 2/02 - added support for parent modulo length less than axis length
+* V581*acm*  6/05 - For fix to bug 1271, add flag line_shift_origin
+
+* Arguments
+	INTEGER		idim, like, class, outline, status
+	REAL*8		lo, hi, del
+
+* argument description:
+* in	idim	  - axis orientation: 1-4
+* in	like	  - template line for creating the new one
+* in	class	  - line class
+* out	outline	  - returned line
+* in	lo,hi,del - description of line
+
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'implicit.parm'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+*
+* Local definitions
+	LOGICAL		TM_ITS_SUBSPAN_MODULO
+	INTEGER		inline
+	INTEGER		TM_FIND_LIKE_DYN_LINE
+
+*kob 5/97
+	REAL*8 		dp_epsilon
+	PARAMETER 	( dp_epsilon = 1.D-10)
+
+* allocate a scratch line 
+	CALL TM_ALLO_DYN_LINE( inline, status )
+	IF ( status .NE. merr_ok ) RETURN
+
+* create a scratch line matching the request
+	IF ( like .NE. unspecified_int4 ) THEN
+* ... copy the template
+* ... a child axis is usually regular if the parent is regular
+*     but for sub-span modulo only if the child doesnt cause modulo-ing
+	   CALL TM_COPY_LINE( like, inline )
+	   line_regular(inline) = line_regular(like) .AND.
+     .	        ( (.NOT.TM_ITS_SUBSPAN_MODULO(like)  )
+     .	     .OR. (lo.GE.1 .AND. hi.LE.line_dim(like)) )
+	ELSE
+* ... or initialize to defaults
+	   line_regular(inline)    = .TRUE.
+	   line_direction(inline) = axis_orients(idim)
+	   line_t0(inline)        = char_init20
+	   line_shift_origin(inline) = .FALSE.
+	   line_tunit(inline)     = 0
+	   line_units(inline)     = ' '
+	   line_unit_code(inline) = 0
+	ENDIF
+	line_name(inline) = 'scratch'
+	line_class(inline) = class
+	line_modulo(inline)     = .FALSE.	! modulo subset doesn't cut it
+	line_modulo_len(inline) = 0.0D0
+
+* set up the scratch line as per its class
+* Note: for computational efficiency axes with regularly-spaced points will
+*	be set up as "basic" axes wherever possible.  This will allow TM_WORLD
+* 	to access their coordinate information without recursively descending
+*	to the parent axis.  (Making potentially significant improvements
+*	to commonly used routines such as ISUBSCRIPT)
+
+	IF ( class .EQ. pline_class_basic ) THEN
+	   line_parent(inline)	  = 0
+	   line_regular(inline)   = .TRUE.
+	   line_start(inline)     = lo
+	   line_delta(inline)     = del 
+	   IF ( hi .GT. 0.0D0) THEN
+	     line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	   ELSE
+   	     line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	   ENDIF
+* ... every nth index of parent line
+	ELSEIF ( class .EQ. pline_class_stride ) THEN
+
+	   IF ( line_regular(inline) ) THEN
+	      line_parent(inline)    = like
+	      line_start(inline)     = line_start(like)
+     .				     + (lo-1)*line_delta(like)
+	      line_delta(inline)     = del * line_delta(like)
+	      IF ( hi .GT. 0.0D0) THEN
+	        line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	      ELSE
+   	        line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	      ENDIF
+	   ELSE
+	      line_parent(inline)    = like
+	      line_start(inline)     = lo			! integer
+	      line_delta(inline)     = del			! integer
+	      IF ( hi .GT. 0.0D0) THEN
+	        line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	      ELSE
+   	        line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+	      ENDIF
+	   ENDIF
+
+* ... midpoints from parent (entire) line
+	ELSEIF ( class .EQ. pline_class_midpt ) THEN	! midpoints
+	   line_dim(inline)       = line_dim(like)-1
+	   IF ( line_regular(like) ) THEN
+	      line_parent(inline)    = like
+	      line_start(inline)     = line_start(like)
+     .				     + 0.5*line_delta(like)
+	      line_delta(inline)     = line_delta(like)
+	   ELSE
+	      line_parent(inline)    = like
+	      line_start(inline)     = 1			! integer
+	      line_delta(inline)     = 1			! integer
+	   ENDIF
+
+	ELSE
+	   STOP 'LINE CLASS NOT IMPLEMENTED'
+	ENDIF
+
+* search for this line among the existing, dynamic lines
+	outline =  TM_FIND_LIKE_DYN_LINE( inline )
+
+	IF (outline .EQ. unspecified_int4) THEN
+* ... doesn't exist yet - make a new dynamic line  "(AXnnn)"
+	   CALL TM_ALLO_DYN_LINE( outline, status )
+	   IF (status .NE. merr_ok) GOTO 9000
+	   CALL TM_COPY_LINE( inline, outline )
+
+* ... make sure the parent line doesn't get deallocated while still in use
+	   IF ( line_parent(inline) .NE. 0 ) CALL TM_USE_LINE(like)
+
+* ... name it "(AXnnn)"
+	   WRITE ( line_name(outline), 3000 ) outline - max_lines
+ 3000	   FORMAT('(AX',I3.3,')')		! restricted to 3 digits
+
+	ENDIF
+
+
+! this block would apply if use count started at 1 at time of creation
+!	IF (outline .NE. unspecified_int4) THEN
+!* ... yes - it matches an existing dynamic line - inc its use count
+!	   CALL TM_USE_LINE( outline )
+!	ELSE
+!
+!* ... no - it shall be a new dynamic line  "(AXnnn)"
+!	   CALL TM_ALLO_DYN_LINE( outline, status )
+!	   IF (status .NE. merr_ok) GOTO 9000
+!	   CALL TM_COPY_LINE( inline, outline )
+!
+!* name it "(AXnnn)"
+!	   WRITE ( line_name(outline), 3000 ) outline
+! 3000	   FORMAT('(AX',I3.3,')')		! restricted to 3 digits
+!
+!	ENDIF
+
+* successful completion
+	status = merr_ok
+
+* error and normal exits
+ 9000   line_parent(inline) = 0		! avoid deallocating parent of scratch
+	CALL TM_DEALLO_DYN_LINE(inline)
+	RETURN
+	END
diff --git a/fmt/src/tm_get_like_grid.F b/fmt/src/tm_get_like_grid.F
new file mode 100644
index 0000000..166537a
--- /dev/null
+++ b/fmt/src/tm_get_like_grid.F
@@ -0,0 +1,83 @@
+	SUBROUTINE TM_GET_LIKE_GRID ( newgrid, newname, gridnum, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will compare "newgrid" to other grid definitions in common. If there is a
+* match then "gridnum" returns with the number of the match. If there is no
+* match, then a new slot is located and the name "newname" is used to name it,
+* and "gridnum" returns with the number of the new slot.
+*
+* revision 0.00 - 11/22/88
+* V510 *sh* 4/00 - use TM_COPY_GRID_W_LINE_USE
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments
+	INTEGER*4	newgrid, gridnum, status
+	CHARACTER*(*)	newname
+*
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+*
+* Local definitions
+	INTEGER*4	grid_match
+	INTEGER*4	TM_FIND_LIKE_GRID, TM_FIND_GRID_SLOT
+*
+* Check for match
+	grid_match = TM_FIND_LIKE_GRID ( newgrid )
+	IF (grid_match .NE. unspecified_int4) THEN
+	  gridnum = grid_match
+	  GOTO 9000
+	ENDIF
+*
+* No match, find empty slot for storage
+	status = TM_FIND_GRID_SLOT ( gridnum )
+	IF (status .NE. merr_ok) GOTO 9000
+*
+* Move everything over
+	CALL TM_COPY_GRID_W_LINE_USE( newgrid, gridnum )
+*
+* Name the new grid
+	grid_name(gridnum) = newname
+*
+	status = merr_ok
+ 9000	RETURN
+	END
diff --git a/fmt/src/tm_get_like_line.F b/fmt/src/tm_get_like_line.F
new file mode 100644
index 0000000..ee25d11
--- /dev/null
+++ b/fmt/src/tm_get_like_line.F
@@ -0,0 +1,82 @@
+	SUBROUTINE TM_GET_LIKE_LINE ( newline, newname, linenum, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will compare "newline" to other line definitions in common. If there is a
+* match then "linenum" returns with the number of the match. If there is no
+* match, then a new slot is located and the name "newname" is used to name it,
+* and "linenum" returns with the number of the new slot.
+*
+* revision 0.00 - 11/22/88
+* V541 set status to OK if we find a match.
+*
+* Arguments
+	INTEGER*4	newline, linenum, status
+	CHARACTER*(*)	newname
+*
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+*
+* Local definitions
+	INTEGER*4	line_match
+	INTEGER*4	TM_FIND_LIKE_LINE, TM_FIND_LINE_SLOT
+*
+* Check for match
+	line_match = TM_FIND_LIKE_LINE ( newline )
+	IF (line_match .NE. unspecified_int4) THEN
+	  linenum = line_match
+	  status = merr_ok
+	  GOTO 9000
+	ENDIF
+*
+* No match, find empty slot for storage
+	status = TM_FIND_LINE_SLOT ( linenum )
+	IF (status .NE. merr_ok) GOTO 9000
+*
+* Move everything over
+	CALL TM_COPY_LINE ( newline, linenum )
+*
+* Name the new line
+	line_name(linenum) = newname
+*
+	status = merr_ok
+ 9000	RETURN
+	END
diff --git a/fmt/src/tm_get_linematch.F b/fmt/src/tm_get_linematch.F
new file mode 100644
index 0000000..db8a3e8
--- /dev/null
+++ b/fmt/src/tm_get_linematch.F
@@ -0,0 +1,92 @@
+	INTEGER FUNCTION TM_GET_LINEMATCH (gvn_line, dup_name, dup_guts)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Searches the list of pre-defined line_name's and returns the number
+* associated with a "match" on lname. A match means that the the characters
+* of lname are all found plus, optionally, digits. If no match is found
+* the value unspecified_int4 is returned.
+
+* dup_name - returned TRUE if there is an identical name match OR (there
+*	     is a pattern name match AND the guts are identical)
+* dup_guts - returned TRUE if there is a pattern name match AND the guts
+*	     are identica
+
+
+* V510 *sh* 4/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+#include "tmap_dset.parm"	
+	include 'tmap_dims.parm'	! 
+#include "gt_lib.parm"
+
+* argument variables
+	LOGICAL		dup_name, dup_guts
+	INTEGER		gvn_line
+
+* local variable declarations
+	LOGICAL		xact_name
+	INTEGER*4	i
+
+* initialize
+	dup_name = .FALSE.
+
+* check the static axes
+	DO 100 i=1,max_lines
+	  CALL TM_GET_LINEMATCH_SUB(gvn_line, i, xact_name, dup_guts)
+	  IF (dup_guts) THEN
+	     TM_GET_LINEMATCH = i
+	     RETURN
+	  ELSEIF (xact_name) THEN
+	     dup_name = .TRUE.
+	  ENDIF
+ 100	CONTINUE
+ 
+* check the dynamic grids
+	i = 0
+ 200	CALL TM_NEXT_DYN_LINE( i, *299)
+	  CALL TM_GET_LINEMATCH_SUB(gvn_line, i, xact_name, dup_guts)
+	  IF (dup_guts) THEN
+	     TM_GET_LINEMATCH = i
+	     RETURN
+	  ELSEIF (xact_name) THEN
+	     dup_name = .TRUE.
+	  ENDIF
+	GOTO 200
+
+* not found
+ 299	TM_GET_LINEMATCH = unspecified_int4
+	RETURN
+	END
diff --git a/fmt/src/tm_get_linematch_sub.F b/fmt/src/tm_get_linematch_sub.F
new file mode 100644
index 0000000..e3ebc4b
--- /dev/null
+++ b/fmt/src/tm_get_linematch_sub.F
@@ -0,0 +1,96 @@
+	SUBROUTINE TM_GET_LINEMATCH_SUB (gvn, tst, dup_name, dup_guts)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Searches the list of pre-defined line_name's and returns the number
+* associated with a "match" on lname. A match means that the the characters
+* of lname are all found plus, optionally, digits. If no match is found
+* the value unspecified_int4 is returned.
+
+* dup_name - returned TRUE if there is an identical name match
+* dup_guts - returned TRUE if there is a pattern name match AND the guts
+*	     are identica
+
+
+* V510 *sh* 4/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+#include "tmap_dset.parm"	
+	include 'tmap_dims.parm'	! 
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'	! pre-defined grid common
+	external xgt_grid_data
+
+* argument variables
+	LOGICAL		dup_name, dup_guts
+	INTEGER		gvn, tst
+
+* local variable declarations
+	LOGICAL		TM_SAME_LINE_DEF
+	INTEGER*4	TM_LENSTR1, STR_CASE_BLIND_COMPARE
+	INTEGER*4	gvn_len, tst_len, istat, ic
+	CHARACTER	lname*128, c*1
+
+* initialize
+	dup_name = .FALSE.
+	dup_guts = .FALSE.
+	lname    = line_name(gvn)
+	gvn_len  = TM_LENSTR1(lname)
+
+* screen out obvious rejection criteria
+	IF ( tst .EQ. gvn ) GOTO 1000	! don't compare to self
+	IF ( line_name(tst)  .EQ. char_init16 ) GOTO 1000
+	tst_len = TM_LENSTR1( line_name(tst) )
+	IF ( tst_len .LT. gvn_len ) GOTO 1000
+
+* test for base name match
+	istat = STR_CASE_BLIND_COMPARE
+     .			(line_name(tst)(:gvn_len),lname(:gvn_len))
+	IF (istat .NE. str_match) GOTO 1000
+	IF (tst_len .EQ. gvn_len) dup_name = .TRUE.
+
+* test that only extra digits were added
+	DO 90 ic = gvn_len+1, tst_len
+	  c = line_name(tst)(ic:ic)
+	  IF (  c .LT. '0' .OR. c .GT. '9' ) GOTO 1000
+ 90	CONTINUE
+
+* found a name pattern match.  Now check if the guts match, too
+	dup_guts = TM_SAME_LINE_DEF( gvn, tst )
+
+* not a duplicate definition
+ 1000	RETURN
+
+	END
diff --git a/fmt/src/tm_get_linenum.F b/fmt/src/tm_get_linenum.F
new file mode 100644
index 0000000..1e177a0
--- /dev/null
+++ b/fmt/src/tm_get_linenum.F
@@ -0,0 +1,85 @@
+	INTEGER FUNCTION TM_GET_LINENUM (user_line)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Searches the list of pre-defined line_name's and returns the number
+* associated with the line_name given by the user. If no match is found
+* the value unspecified_int4 is returned.
+*
+* written 08/88 By M. Verschell for PMEL/TMAP
+*
+* revision 0.00 - 08/12/88
+*
+* *kob* 10/96 	- Linux port.  Linux didn't like tabs between "include"
+*	          and what was being included.  removed them
+* V510 *sh* 4/00 - conversion to dynamic grids and axes -- check 'em
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+#include "tmap_dset.parm"	
+	include 'tmap_dims.parm'	! 
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'	! pre-defined grid common
+	external xgt_grid_data
+
+	CHARACTER*(*)	user_line
+	INTEGER*4	nline, istat
+	INTEGER*4	STR_CASE_BLIND_COMPARE
+
+* check the static axes
+	DO 100 nline=1,max_lines
+	  istat = STR_CASE_BLIND_COMPARE(line_name(nline),user_line)
+	  IF (istat .EQ. str_match) THEN
+	    TM_GET_LINENUM = nline
+	    GOTO 900
+	  ENDIF
+ 100	CONTINUE
+
+* check the dynamic grids
+	nline = 0
+ 200	CALL TM_NEXT_DYN_LINE( nline, *299)
+	  istat = STR_CASE_BLIND_COMPARE(line_name(nline),user_line)
+	  IF (istat .EQ. str_match) THEN
+	    TM_GET_LINENUM = nline
+	    GOTO 900
+	  ENDIF
+	GOTO 200
+
+* not found
+ 299	TM_GET_LINENUM = unspecified_int4
+
+* found
+ 900	RETURN
+	END
diff --git a/fmt/src/tm_get_strlen.c b/fmt/src/tm_get_strlen.c
new file mode 100644
index 0000000..45d664f
--- /dev/null
+++ b/fmt/src/tm_get_strlen.c
@@ -0,0 +1,52 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*  ywei:05/04 created to speed up get fortran string length rountine 
+*/
+#include <Python.h> /* make sure Python.h is first */
+#include <assert.h>
+#include <stdio.h>
+
+void tm_get_strlen_(int * len_str, int * whole_len, char * in_string)
+{
+   int i;
+   assert(in_string);
+
+   for(i=*whole_len-1;i>=0;i--){
+      if(in_string[i]!=' ')
+         break;
+      }
+   *len_str=i+1;
+   return;
+} 
diff --git a/fmt/src/tm_get_varnum.F b/fmt/src/tm_get_varnum.F
new file mode 100644
index 0000000..91bc6d7
--- /dev/null
+++ b/fmt/src/tm_get_varnum.F
@@ -0,0 +1,83 @@
+	INTEGER FUNCTION TM_GET_VARNUM( vname, dset )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* given a variable name supposed to be in the indicated data set return the
+* TMAP variable ID
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/92
+* V500 4/99 *kob*: increase upcase_var from 24 to 64 chars - to match passed in vname
+* V552 5/03 *acm*: increase size of upcase_var from 64 to 128 chars
+* calling argument declarations
+
+	INTEGER		dset
+	CHARACTER*(*)	vname
+
+* include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+* local variable declarations:
+      INTEGER STR_UPCASE, TM_LENSTR1, istat, slen, ivar
+      CHARACTER upcase_var*128
+
+* convert to upper case
+      istat = STR_UPCASE( upcase_var, vname )     ! 4/91
+      slen  = TM_LENSTR1( vname )
+
+* locate the variable code among the variables in this data set
+      DO 100 ivar = 1,maxvars
+
+          IF ( ds_var_setnum(ivar) .NE. dset ) GOTO 100
+
+          IF ( ds_var_code(ivar)(:slen) .EQ. upcase_var(:slen) ) THEN
+            TM_GET_VARNUM = ivar
+            RETURN
+          ENDIF
+
+ 100  CONTINUE
+
+* not found
+      TM_GET_VARNUM = unspecified_int4
+      RETURN
+      END
diff --git a/fmt/src/tm_grid_match.F b/fmt/src/tm_grid_match.F
new file mode 100644
index 0000000..cea4add
--- /dev/null
+++ b/fmt/src/tm_grid_match.F
@@ -0,0 +1,78 @@
+	LOGICAL FUNCTION TM_Grid_match ( grid1, grid2 )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Check to see if grid1 is identical to grid2
+*
+* by M. Verschell PMEL/TMAP
+*
+* revision 0.00 - 10/19/88
+*
+* IBM port 14apr94 *kob* : Logical expressions need to be compared
+*			   using NEQV and EQV
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	
+* Argument definitions
+	INTEGER*4	grid1, grid2
+
+* Local definitions
+	INTEGER*4	i
+
+* Compare the axis names
+	DO 100 i=1,nferdims
+	  IF (grid_line(i,grid1) .NE. grid_line(i,grid2) .OR.
+     .	      (grid_out_prod(i,grid1) .NEQV. grid_out_prod(i,grid2)))
+     .	    GOTO 110
+  100	CONTINUE
+
+* All nferdims axis matched - check grid rotation
+	IF (grid_rotation(grid1) .NE. grid_rotation(grid2)) GOTO 110
+
+* A match - axis and rotation
+	TM_GRID_MATCH = .TRUE.
+	GOTO 9999
+
+* Doesn't match
+  110	TM_GRID_MATCH = .FALSE.
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_has_string.F b/fmt/src/tm_has_string.F
new file mode 100644
index 0000000..a100e33
--- /dev/null
+++ b/fmt/src/tm_has_string.F
@@ -0,0 +1,77 @@
+	LOGICAL FUNCTION TM_HAS_STRING( string, substring )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* check in a case-independent search to see if "substring" is in "string"
+* note: string and substring can be at most 2048 characters
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 02/11/88
+* revision 0.01 - 05/03/88 - made temp strings CHAR*255 (this is the max length
+*			     that will work correctly (MAV)
+* revision 0.10 - 01/20/91 - replaced VAX runtim library reference with INDEX
+*                            FORTRAN intrinsic function
+* V530 *sh* 11/00 - more graceful behavior if 255 max is exceeded
+* V553 *acm* 8/03 - allow up to 2048 characters in the strings.
+
+* calling argument declarations
+	CHARACTER*(*)	string, substring
+
+* local variable declarations
+	INTEGER	STR_UPCASE, TM_LENSTR1,
+     .		vms_stat, sublen, strlen
+	CHARACTER*2048 up_string, up_sub
+
+* length of substring
+	sublen = TM_LENSTR1( substring )
+	strlen = TM_LENSTR1( string )
+	IF (sublen .GT. 2048) THEN
+	   TM_HAS_STRING = .FALSE.
+	   RETURN
+	ENDIF
+
+* convert to upper case
+	vms_stat = STR_UPCASE( up_string, string )
+	vms_stat = STR_UPCASE( up_sub, substring(:sublen) )
+
+* find the substring
+	TM_HAS_STRING = INDEX( up_string, up_sub(:sublen) ) .GT. 0
+
+	RETURN
+	END
diff --git a/fmt/src/tm_hash_name.F b/fmt/src/tm_hash_name.F
new file mode 100644
index 0000000..9848a52
--- /dev/null
+++ b/fmt/src/tm_hash_name.F
@@ -0,0 +1,66 @@
+	INTEGER FUNCTION TM_HASH_NAME( name, npiles )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* produce a pseudo-random number between 1 and npiles from the given name
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 4/7/87
+
+* calling argument declarations
+	INTEGER		npiles
+	CHARACTER*(*)	name
+
+* local variable declarations
+	INTEGER	TM_LENSTR1, len_name, pile, i, new_char
+
+	len_name = TM_LENSTR1( name )
+
+* generate pseudo-random integer based on name
+	pile = 0
+	DO 100 i = 1, len_name
+	   new_char = MOD( 2107*ICHAR(name(i:i)), 531 )
+	   pile = IEOR( pile, new_char )
+ 100	CONTINUE
+
+* modulo to number of piles indicated
+	TM_HASH_NAME = MOD( pile, npiles ) + 1
+
+	RETURN
+	END
diff --git a/fmt/src/tm_init_dset.F b/fmt/src/tm_init_dset.F
new file mode 100644
index 0000000..d9c3f22
--- /dev/null
+++ b/fmt/src/tm_init_dset.F
@@ -0,0 +1,573 @@
+	SUBROUTINE TM_INIT_DSET(dset_name,perm,dset_num,tregular, use_strict,status)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize a TMAP data set:  GT, TS, or CDF
+* For GT and TS: opens dataset DESCRIPTOR/SET file,reads the FORMAT_RECORD and
+* BACKGROUND_RECORD, reads in any GRID files given, then determines correct
+* reading routine to load common blocks XDOtSET_INFO and XSTEP_FILES with vital
+* system and background information
+* For netCDF file allocates a data set slot and proceded to CD_ routines
+
+* Programmer Mark Verschell (from programs by Steve Hankin)
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS
+*
+* revision 0.00 - 06/23/88 - From GT_INIT_DSET version 1.20
+* revision 0.01 - 11/21/88 - variable not_used removed (wasn't used)
+* revision 0.02 - 12/12/88 - removed arguement dset_num from TM_READ_GRIDFILE
+* revision 0.03 - 02/15/89 - changed GT_CLOSE_SET to TM_CLOSE_SET, eliminated
+* revision 0.04 - 02/17/89 - Added initialization of D_TIME_MODULO
+* revision 0.05 - 04/17/89 - Added message in case file not descriptor file
+* revision 0.06 - 01/10/91 - added ifdef unix for default file *sh*
+* Unix/RISC port *sh* 3/91 - found bug: CLOSE called on error when lunit wasn't
+*                          - opened.  Added logical "opened" and "got_lun"
+*                          - use TM_INQ_PATH for (nearly) OS-independent access
+* SUN port   - 1/20/92 kob --- moved all NAMELIST definitions to immediately
+*                             after declarations.  SUN Fortran didn't like them
+*                             embedded in executable code
+* netCDF support *sh* 2/92 - added new calling argument dset_type
+*                          - added TM_CLEAN_FILENAME
+* 12/93 *sh* - bug fix: check for filename ending ".cdf" BEFORE determining
+*			    which path list to use
+*  4/94 *sh* - ... and if no match try the other choice (.des v.s..cdf) 
+*  5/94 *sh* - recognize URL-style names as netCDF names (DODS networking)
+*
+* 6/2/94 *kob* - IBM Port
+*		  Need to initialize d_time_modulo with .FALSE. instead of 0
+*		  Need ifdef READONLY_ALLOWED around readonly in open statemnt
+* *sh* 3/2/95 - informative messages issued through TM_NOTE (for GUI)
+* *sh* 11/96 - recognize .nc as a NetCDF file and ignore "(no cache)"
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* *kob* 7/97 - modification to eliminate unnecessary error messages when
+*              searching for files w/out extensions (ie ".cdf")
+* *kob* 4/99 - increase size of TM_INQ_PATH and des_name
+*              to accomodate lenghty DODS dataset names
+* *sh*  6/99 - added "perm" (permutation) argument
+* V510 *sh* 3/00 - added tregular argumant
+*	    4/00 - converted to dynamic grids -- bump use counts here
+* v530 *kob* 1/00 - minor mods for remote mc aggregations
+* v530 *acm* 1/01 - initialize ds_cal_name  calendar name
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v541 *acm*  4/02  New descriptor d_caltype for nonstandard calendar types.
+*                   **also changes to descript.def**
+*      *acm*  5/02  When extension not specified, try .nc as well as .des, .cdf
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+* 4/03 *acm* - Use STR_SAME to compare strings
+* 5/03 *acm* - Compare ds_name to char_init256 as that is its length...
+* V581 *acm* 3/05 allow "USE myfile.des"  previously this only worked if
+*                  the file extension was left off.
+* V581: *acm*/3/05 - increase length of strings for dataset title to 1024
+* V604: *acm*/7/07 - increase length of dataset names to 1024
+* V62 : *acm* 5/09 - Check for alternative allowed calendar names as in cd_get_1_axis
+*                    (e.g. standard, which is equivalent to Gregorian.)
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+* V68  *acm* 1/12- added use_strict argument for ticket 1910: micro-adjusting on 
+*                  repeated coordinates in netCDF/OPeDNAP datasets
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+* V683 9/12 *acm* Fix ticket 1531: nc is the default dataset type if not given 
+*                 with the command qualifier or the extension is not recognized.
+* V686 1/14 *acm* Fix ticket 2128: If USE is given without a file extension, check
+*                 for descriptor file too, after .nc and .cdf.
+* V686 1/14 *acm* Fix ticket 2129: A bug in the fix to 2128.
+* V686 1/27/14 *acm* further fix for 2129: make sure a search for a .nc or .cdf file is
+*                 done in path FER_DATA.
+
+* arguments:
+*	dset_name	- filename of DESCRIPTOR file (input)
+*	dset_num	- number assigned to this data set (output)
+*			  ( 1 <= dset_num <= maxdsets - see COMMON XDSET_INFO)
+*	dset_type	- coaching for data set type (GT,TS, or CDF)
+*                       - blank to determine based on filename extension
+*	status		- return status
+*
+
+* Argument definitions
+*	CHARACTER*(*)	dset_name, dset_type  removed 4/92 kob
+	LOGICAL		tregular, use_strict
+	INTEGER		perm(*), dset_num, status
+	CHARACTER*(*)	dset_name
+
+* Parameter and common files
+        include 'tmap_errors.parm'              ! error codes
+#include "tmap_dset.parm"
+        include 'tmap_dims.parm'                ! data set dimensions
+#include "gt_lib.parm"
+	include 'xio.cmn_text'
+        external xio_data
+        include 'xdset_info.cmn_text'   ! data set common
+        external xdset_info_data
+        include 'xsys_names.cmn_text'
+        external xsys_names_data
+        include 'xdiag_ctrl.cmn_text'
+        external xdiag_ctrl_data
+        include 'xrisc_buff.cmn'
+
+* Define variables from Set File namelist records
+	include 'descript.def'
+
+* Parameter for number of known types and number of format_revs
+	INTEGER*4	num_known, num_revs
+	PARAMETER	(num_known = 5)
+	PARAMETER	(num_revs  = 1)
+
+* Internal declarations
+	CHARACTER*4	known_type(num_known)
+	CHARACTER*4	format_rev(num_revs,num_known)
+	CHARACTER*13	TM_STRING
+	CHARACTER	def_ext*4, def_cdf*4, def_nc*3, def_des*4, ext*4, 
+     .                  cdf_path*12, path*12
+        CHARACTER*2048   TM_CLEAN_FILENAME
+	CHARACTER*42	reading_nml
+	CHARACTER*512   TM_INQ_PATH
+	CHARACTER*2048  des_name
+	INTEGER*4	set_cnt, lunit, cnt, aux_cnt, tcnt, dlen, dlen2,
+     .			rcnt, parm_cnt, grd_cnt, equal_pos, istat
+	INTEGER*4	TM_LENSTR, TM_LENSTR1, STR_SAME, STR_UPCASE, ic
+	LOGICAL		TM_HAS_STRING, match,
+     .			opened, got_lun, dods_url, nocache,
+     .                  explicit_ext                 ! 7/97
+	DATA		known_type/'  GT','  TS','  MC','  MG','  MT'/
+	DATA		format_rev/'  1C',
+     .				   '  1A',
+     .				   '    ',
+     .				   '    ',
+     .				   '    '/
+	DATA		def_ext  /'.nc'/, def_cdf/'.cdf'/
+        DATA            def_nc/'.nc'/, def_des/'.des'/
+
+        DATA            cdf_path/'FER_DATA'/
+
+* namelist declarations
+* record 1 - descriptor format record
+	NAMELIST /FORMAT_RECORD/d_type,d_format,d_source_class,
+     .				d_source,d_subsource,d_prog_rev
+* record 2 - file background record
+	NAMELIST /BACKGROUND_RECORD/d_expnum,d_modnum,d_title,
+     .				   d_mod_title,d_forcing_set,d_t0time,
+     .				   d_time_unit,d_time_modulo,
+     .				   d_ntegrate_tstep,d_ntuple,d_time_run,
+     .				   d_who_ranit,d_time_made,d_who_madeit,
+     .				   d_aux_modnum,d_add_parm,
+     .				   d_grid_filename,d_caltype
+
+* initialize
+        got_lun = .FALSE.    ! controls error clean-up
+        opened = .FALSE.     ! controls error clean-up
+	explicit_ext = .FALSE.  !controls missing file error reporting 7/97
+* is this a network data request based on a DODS URL?
+	dods_url = INDEX(dset_name,'://') .GT. 0
+	IF ( dods_url ) THEN
+	   nocache = TM_HAS_STRING( dset_name, 'no cache' )
+	ELSE
+	   nocache = .FALSE.
+	ENDIF
+	IF ( nocache ) THEN
+	   dlen = INDEX(dset_name,'(') - 1
+	   IF (dlen .LE. 0 ) GOTO 5300
+	   dlen = TM_LENSTR1( dset_name(:dlen) )	  ! length up to "(no cache)"
+	ELSE
+	   dlen = TM_LENSTR1( dset_name )
+	ENDIF
+
+* search for TMAP-formatted data set or NetCDF ?
+* (ds_dset_type may have been set externally to 'CDF' already)
+* 5/94: also recognize (e.g.) dods://dcz.gso.uri.edu/usr/data/gsc.nc
+* 11/96: also recognize ".nc" (and insist that "cdf" be at the name end
+* 7/97: Set explict_ext if there is an extension, and also check for
+*       a .des extension.  
+	IF ( dods_url ) ds_dset_type = 'CDF'
+	IF ( dlen .GT. 2 ) THEN
+	   IF (TM_HAS_STRING(dset_name(dlen-2:dlen), '.nc')) THEN
+     		ds_dset_type = 'CDF'
+	        explicit_ext = .TRUE.
+	   ENDIF
+	ENDIF
+	IF ( dlen .GT. 3 ) THEN
+	   IF (TM_HAS_STRING(dset_name(dlen-3:dlen), '.cdf')) THEN
+     		ds_dset_type = 'CDF'
+	        explicit_ext = .TRUE.
+	   ENDIF
+	   IF (TM_HAS_STRING(dset_name(dlen-3:dlen), '.des')) THEN
+     		ds_dset_type = ' MC'
+	        explicit_ext = .TRUE.
+	   ENDIF
+	   IF (TM_HAS_STRING(dset_name(dlen-2:dlen), '.mc')) THEN
+     		ds_dset_type = ' MC'
+	        explicit_ext = .TRUE.
+	   ENDIF
+	ENDIF
+        IF ( ds_dset_type .EQ. 'CDF' ) THEN
+           ext  = def_ext       ! default netCDF file extension
+           path = cdf_path
+        ELSE
+           ext  = def_ext       ! default TMAP file extension
+           path = cdf_path
+        ENDIF
+* if there is an explicit extension, we don't want to pass the default
+* extension on, because the error messages are misleading *kob*
+	IF ( explicit_ext ) ext = ' '    ! 7/97
+
+* Find full file specification using INQUIRE with dset_name
+* OS-independent path search
+	IF ( dods_url ) THEN
+	   des_name = dset_name
+	   status = merr_OK
+	ELSE
+* 7/97 *kob* pass explicit_ext into tm_inq_path to indicate whether
+*            or not an error message should be output in tm_path_list
+           des_name = TM_INQ_PATH(dset_name,path,ext,explicit_ext,
+     .                    status)
+	ENDIF
+	IF ( status .NE. merr_ok .AND. explicit_ext ) GOTO 9950
+	IF ( status .NE. merr_ok) THEN
+* interchange and try the other (.nc) extension
+	   IF ( ext .EQ. def_ext ) THEN
+	      ext  = def_cdf	! was .des
+	      path = cdf_path
+	      ds_dset_type = 'CDF'
+	   ELSE
+	      ext  = def_ext	! was .cdf
+	      path = cdf_path
+	      ds_dset_type = ' '
+	   ENDIF
+	   des_name = TM_INQ_PATH(dset_name,path,ext,.FALSE.,status)
+
+* 4/02 *acm* try .des extension
+	   IF ( status .NE. merr_ok ) THEN
+	      ext  = def_des
+	      path = tmap_sets
+	      ds_dset_type = ' MC'
+           ENDIF
+	   des_name = TM_INQ_PATH(dset_name,path,ext,.FALSE.,status)
+
+	   IF ( status .NE. merr_ok ) THEN
+	      ext  = def_nc
+	      path = tmap_sets
+	      ds_dset_type = 'CDF'
+           ENDIF
+	   des_name = TM_INQ_PATH(dset_name,path,ext,.FALSE.,status)
+
+
+
+* 7/97 *kob* check to see which error message should be output - don't
+*            want to output same error message twice.
+	   IF ( status .NE. merr_ok ) THEN
+
+	      IF (status .EQ. merr_syntax .OR. status .EQ. merr_erreq) THEN
+		 GOTO 9950
+	      ELSE 
+* 7/97 *kob* if file contains a path, only that path was searched, not all 
+*            default paths
+		 IF ( INDEX(dset_name,PathSeparator) .GT. 0 ) THEN
+		    GOTO 5500
+		 ELSE
+		    GOTO 5400
+		 ENDIF
+	      ENDIF
+	   ENDIF
+	ENDIF
+
+	IF (ds_dset_type .EQ. '  ') ds_dset_type = 'CDF'
+
+* check to see if this descriptor has already been initialized
+	DO 100 set_cnt = 1, maxdsets
+	   IF (nocache) THEN
+* ... imperfect logic: "abcd(no cache)" will match "abc"
+	      dlen2 = TM_LENSTR1(ds_des_name(set_cnt))
+	      match = dlen2 .EQ. dlen
+     .	        .AND. ds_des_name(set_cnt) .EQ. des_name(:dlen)
+	   ELSE
+	      match = ds_des_name(set_cnt) .EQ. des_name
+	   ENDIF
+	   IF ( match ) THEN
+	      dset_num = set_cnt
+	      status = merr_no_action
+	      GOTO 9999
+	    ENDIF
+  100	CONTINUE
+
+* Assign data set number, exiting if maximum number of data sets are open
+	DO 110 set_cnt = 1,maxdsets
+	  IF (ds_name(set_cnt) .EQ. char_init1024) THEN
+	    dset_num = set_cnt
+	    ds_des_name(dset_num) = des_name
+            ds_name(dset_num) = TM_CLEAN_FILENAME( dset_name )
+	    GOTO 120
+	  ENDIF
+  110	CONTINUE
+* Too many data sets are open
+	CALL TM_ERRMSG ( merr_dsetlim, status, 'TM_INIT_DSET',
+     .			 no_descfile, no_stepfile,
+     .			 'MAX='//TM_STRING(DBLE(maxdsets)),
+     .			 no_errstring, *9950)
+
+* netCDF file ?
+ 120    IF ( ds_dset_type .EQ. 'CDF' ) THEN
+           ds_dset_type = ' '     ! reset the coaching shared by outside world
+           CALL CD_INIT_DSET( dset_num, perm, tregular, use_strict, status )
+           IF ( status .NE. merr_ok ) GOTO 9900
+           RETURN
+        ENDIF
+
+* Get free VMS logical unit # for temporary open
+ 	CALL LIB_GET_LUN (lunit)
+        got_lun = .TRUE.
+
+* Open descriptor file for reading
+	OPEN   (UNIT		= lunit,
+     .		FILE		= des_name,
+#ifdef READONLY_ALLOWED
+     .		READONLY,
+#endif
+     .		STATUS		= 'OLD',
+     .		ERR 		= 5000)
+        opened = .TRUE.
+* record 1 - descriptor format record
+
+
+	reading_nml = 'FORMAT_RECORD; or file not descriptor file'
+	READ  (lunit, NML=FORMAT_RECORD, END=5100, ERR=5200)
+
+* check to see if we know how to handle this data descriptor
+	DO 130 tcnt = 1,num_known
+          ic = STR_SAME(d_type, known_type(tcnt))
+	  IF (ic .EQ. 0) THEN
+             d_type = known_type(tcnt)
+             GOTO 140
+          ENDIF
+  130	CONTINUE
+	CALL TM_ERRMSG (merr_unktype, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Type declared '//d_type,
+     .			no_errstring, *9900)
+
+  140	DO 150 rcnt = 1,num_revs
+	DO 155 tcnt = 1,num_known
+          ic = STR_SAME(d_format, format_rev(rcnt,tcnt))
+	  IF (ic .EQ. 0 ) THEN
+             d_format = format_rev(rcnt,tcnt)
+             GOTO 160
+          ENDIF
+  155	CONTINUE
+  150	CONTINUE
+* ... des_name used as a buffer ...
+	CALL TM_NOTE( 'BEWARE: Unrecognized descriptor format '//
+     .		   d_format, lunit_errors ) 
+!	WRITE (lunit_errors,1000) d_format, format_rev(1,tcnt)
+! 1000	FORMAT(' Unrecognized descriptor format ',A4,'.'/
+!     .	       ' Should be at least ',A4,'.'/
+!     .	       ' Routines may not work correctly')
+
+  160	ds_type(dset_num)         = d_type
+	ds_format(dset_num)       = d_format
+	ds_source_class(dset_num) = d_source_class
+	ds_source(dset_num)       = d_source
+	ds_subsource(dset_num)    = d_subsource
+	ds_prog_rev(dset_num)     = d_prog_rev
+
+
+
+* Initialize some BACKROUND variables
+	d_mod_title = ' '
+	d_ntuple    = 1
+* 6/94 initialize d_time_modulo with .FALSE instead of 0 for IBM *kob*
+	d_time_modulo = .FALSE.
+	DO 170 cnt = 1,num_aux
+  170	d_aux_modnum(cnt)    = ' '
+	DO 180 cnt = 1,num_parm
+  180	d_add_parm(cnt)      = ' '
+	DO 190 cnt = 1,num_gridfiles
+  190	d_grid_filename(cnt) = ' '
+
+
+        d_caltype       = 'GREGORIAN'
+
+	reading_nml = 'BACKGROUND_RECORD'
+	READ  (lunit, NML=BACKGROUND_RECORD, END=5100, ERR=5200)
+
+* Check for unsupported features
+	IF (d_ntuple .NE. 1.) CALL TM_ERRMSG
+     .		(merr_notsupport, status, 'TM_INIT_DSET',
+     .		 dset_num, no_stepfile,
+     .		 'D_NTUPLE in descriptor file must = 1',
+     .		 no_errstring, *9900)
+
+* Check for alternative allowed calendar names
+         status = STR_UPCASE( risc_buff, d_caltype )
+         IF (risc_buff(1:3) .EQ. '360') risc_buff = '360_DAY' 
+         IF (risc_buff .EQ. 'STANDARD') risc_buff = 'GREGORIAN' 
+         IF (risc_buff .EQ. 'PROLEPTIC_GREGORIAN') risc_buff = 'GREGORIAN' 
+         IF (risc_buff(1:6) .EQ. 'COMMON') risc_buff = 'NOLEAP' 
+         IF (risc_buff(1:3) .EQ. '365') risc_buff = 'NOLEAP' 
+         IF (risc_buff(1:3) .EQ. '366') risc_buff = 'ALL_LEAP' 
+	 d_caltype = risc_buff
+
+	ds_expnum(dset_num)         = d_expnum
+	ds_modnum(dset_num)         = d_modnum
+	ds_title(dset_num)          = d_title
+	ds_mod_title(dset_num)      = d_mod_title
+	ds_forcing_set(dset_num)    = d_forcing_set
+	ds_t0time(dset_num)         = d_t0time
+	ds_time_unit(dset_num)      = d_time_unit
+	ds_time_modulo(dset_num)    = d_time_modulo
+	ds_ntegrate_tstep(dset_num) = d_ntegrate_tstep
+	ds_ntuple(dset_num)         = d_ntuple
+	ds_time_run(dset_num)       = d_time_run
+        ds_cal_name(dset_num)       = d_caltype
+
+	DO 200 aux_cnt = 1,num_aux
+	  ds_aux_modnum(aux_cnt,dset_num)    = d_aux_modnum(aux_cnt)
+  200	CONTINUE
+
+* Break add_parm into parm_name and parm_text
+	DO 210 parm_cnt = 1, num_parm
+	  equal_pos = INDEX(d_add_parm(parm_cnt),'=')
+	  IF (equal_pos .EQ. 0) THEN
+	    IF (TM_LENSTR(d_add_parm(parm_cnt)) .GT. 0) THEN
+	      ds_parm_name(parm_cnt,dset_num) = d_add_parm(parm_cnt)
+	      ds_parm_text(parm_cnt,dset_num) = ' '
+	    ELSE
+	      ds_parm_name(parm_cnt,dset_num) = ' '
+	      ds_parm_text(parm_cnt,dset_num) = ' '
+	    ENDIF
+	  ELSE
+	    ds_parm_name(parm_cnt,dset_num) = 
+     .			d_add_parm(parm_cnt)(1:equal_pos-1)
+	    ds_parm_text(parm_cnt,dset_num) =
+     .			d_add_parm(parm_cnt)(equal_pos+1:)
+	  ENDIF
+  210	CONTINUE
+
+* Read in any gridfiles associated with data set
+	DO 220 grd_cnt = 1,num_gridfiles
+	  IF (d_grid_filename(grd_cnt) .NE. ' ') THEN
+	    CALL TM_READ_GRIDFILE(d_grid_filename(grd_cnt),status)
+	    IF ( status .EQ. merr_no_action ) GOTO 220
+	    IF ( status .NE. merr_ok) GOTO 9900
+	  ENDIF
+  220	CONTINUE
+
+* Call specific _INIT_DSET's now
+	IF (d_type .EQ. '  GT') THEN
+
+#ifdef double_p
+	GOTO 5600
+#endif
+	  CALL GT_INIT_DSET(dset_num, lunit, status)
+	  IF (status .NE. merr_ok) GOTO 9900
+	  CALL TM_MAKE_4D_GRIDS(dset_num, status)
+* ... bump the use counts on grids and axes used by variables in this data set
+	  CALL TM_DSET_USE_GRIDS( dset_num )
+	ELSE IF (d_type .EQ. '  TS') THEN
+
+#ifdef double_p
+	GOTO 5600
+#endif
+	  CALL TS_INIT_DSET(dset_num, lunit, status)
+	  IF (status .NE. merr_ok) GOTO 9900
+	  CALL TM_MAKE_4D_GRIDS(dset_num, status)
+* ... bump the use counts on grids and axes used by variables in this data set
+	  CALL TM_DSET_USE_GRIDS( dset_num )
+!*kob*
+	ELSE IF (d_type .EQ. '  MC') THEN
+	  CALL MC_INIT_DSET(dset_num, lunit, perm, tregular, 
+     .      use_strict, status)
+	  IF (status .NE. merr_ok) GOTO 9900
+	  CALL TM_MAKE_4D_GRIDS(dset_num,status)
+* 1/00 - need to do this for remote mc aggregations
+	  CALL TM_DSET_USE_GRIDS( dset_num )
+	ENDIF
+!	IF (d_type .EQ. '  MG') CALL MG_INIT_DSET(dset_num, lunit, status)
+!	IF (d_type .EQ. '  MT') CALL MT_INIT_DSET(dset_num, lunit, status)
+	IF (status .NE. merr_ok) GOTO 9900
+
+* success
+	GOTO 9990
+
+* errors
+ 5000	CALL TM_ERRMSG (merr_erreq, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			no_errstring, no_errstring, *9900)
+
+ 5100	CALL TM_ERRMSG (merr_nmlerr, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Didn''t find: '//reading_nml,
+     .			no_errstring, *9900)
+
+ 5200	CALL TM_ERRMSG (merr_nmlerr, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Error in: '//reading_nml,
+     .			no_errstring, *9900)
+
+ 5300	CALL TM_ERRMSG (merr_syntax, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			dset_name,
+     .			no_errstring, *9900)
+
+ 5400	risc_buff = dset_name
+ 	CALL TM_ERRMSG (merr_notmounted, status, 'TM_INIT_DSET',
+     .			unspecified_int4, no_stepfile,
+     .			'Searched $FER_DESCR and $FER_DATA for '
+     .                  //risc_buff(:TM_LENSTR1(risc_buff))//
+     .                  '('//def_ext//','//def_cdf//','//def_des//')',
+     .			no_errstring, *9950)
+
+ 5500	risc_buff = dset_name
+	CALL TM_ERRMSG (merr_notmounted, status, 'TM_INIT_DSET',
+     .			unspecified_int4, no_stepfile,
+     .			risc_buff(:TM_LENSTR1(risc_buff))
+     .                  //'('//def_ext//','//def_cdf//',.nc)',
+     .			no_errstring, *9950)
+
+ 5600	CALL TM_ERRMSG (merr_notsupport, status, 'TM_INIT_DSET',
+     .			dset_num, no_stepfile,
+     .			'Dataset type not supported for double-precision Ferret'
+     .			//dset_name,
+     .			no_errstring, *9900)
+
+* get out from error
+ 9900	CALL TM_CLOSE_SET ( dset_num, istat )
+ 9950	dset_num = unspecified_int4
+
+* get out
+ 9990	IF ( opened ) CLOSE (UNIT = lunit)
+	IF ( got_lun) CALL LIB_FREE_LUN (lunit)
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_init_dyn_grids.F b/fmt/src/tm_init_dyn_grids.F
new file mode 100644
index 0000000..969b480
--- /dev/null
+++ b/fmt/src/tm_init_dyn_grids.F
@@ -0,0 +1,105 @@
+	SUBROUTINE TM_init_dyn_grids
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Initialize machinery for dynamic grids and lines
+
+* Steve Hankin  NOAA/PMEL/TMAP
+*
+* 9/13/95 for Ferret version 4.2
+* V510 *sh* 3/00 - initialize "hooks" for managing temporary grids and lines
+*      *sh* 5/00 - set line_keep_flag everywhere to FALSE
+* V570 *acm*5/04 - remove line_has_edges flag; never used.
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'implicit.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+
+* Local definitions
+	INTEGER i
+
+
+***** GRIDS *****
+* grid(max_grids) is used as the chain start for the "in-use" grids
+	grid_flink(max_grids) = max_grids	! points to self: empty chain
+
+* grid(tmp_grid_hook) is used as the chain start for the "temporary" grids
+	grid_flink(tmp_grid_hook) = tmp_grid_hook  ! points to self: empty
+
+* no "dynamic" grids (above max_grids) are "used" (yet)
+	DO 100 i = 1, max_dyn_grids
+ 100	grid_use_cnt(i) = 0
+
+* all the "dynamic" grids (eq to or above max_grids) in the "free" linked list
+	grid_free_ptr = max_grids+1
+	DO 200 i = max_grids+1, max_dyn_grids
+ 200	grid_flink(i) = i+1
+	grid_flink(max_dyn_grids) = 0	! end of chain
+
+***** LINES *****
+* line(max_lines) is used as the chain start for the "in-use" lines
+	line_flink(max_lines) = max_lines	! points to self: empty chain
+
+* line(tmp_line_hook) is used as the chain start for the "temporary" lines
+	line_flink(tmp_line_hook) = tmp_line_hook  ! points to self: empty
+
+* no "dynamic" lines (above max_lines) are "used" (yet)
+	DO 300 i = 1, max_dyn_lines
+	   line_use_cnt  (i) = 0
+	   line_keep_flag(i) = .FALSE.
+ 300	CONTINUE
+	DO 310 i = max_lines+1, max_dyn_lines
+	   line_parent(i) = 0
+	   line_class (i) = pline_class_basic
+ 310	CONTINUE
+
+* all the "dynamic" lines (eq to or above max_lines) in the "free" linked list
+	line_free_ptr = max_lines+1
+	DO 400 i = max_lines+1, max_dyn_lines
+ 400	line_flink(i) = i+1
+	line_flink(max_dyn_lines) = 0	! end of chain
+
+	RETURN
+
+	END
+
+
diff --git a/fmt/src/tm_inq_path.F b/fmt/src/tm_inq_path.F
new file mode 100644
index 0000000..63e001e
--- /dev/null
+++ b/fmt/src/tm_inq_path.F
@@ -0,0 +1,224 @@
+      CHARACTER*(*)FUNCTION TM_INQ_PATH
+     .   ( fname, path, def_ext, do_errmsg, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Find the full path name of the given file
+* failure to find a file in a status of merr_not_mounted
+* depending on the logical do_errmsg an error message may be issued
+
+* using this routine is "nearly" OS-independent between VMS and UNIX
+* environment variables substitute for VMS logicals
+* the interpretation of the default extension is a little different
+* ... on UNIX it must be ".xxx" on VMS it can be name.xxx
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS
+
+* revision 0.00 - 10/23/89 - code lifted from TM_INIT_DSET by Mark Verschell
+* Unix/RISC FORTRAN port 3/7/91 *sh* - OS-specific file syntaxes
+*                          - generalized to promote VMS/Unix similarities
+* revision 1.00 - 10/17/91 - <kob>
+*                          - separate path (if it exists) from file name
+*                            and pass them to tm_path_list as two unique
+*                            variables.
+* revison 1.01  - 2/13/92  - increased size of TM_PATH_LIST, path_list to 512
+*  *sh* 2/12/93 - corrected bug due to increased path_list (2/13/92) - it was
+*		  equivalenced to "risc_buff" which was too short
+*
+*  *sh* 5/28/93 - if filename begins with $ then translate the environment var
+*		  (this is a partial sol'n - doesn't deal with embedded $'s)
+*
+* IBM port 14apr94 *kob* : IBM will only allow character string lengths
+*			    between 1 and 500.
+*			 : CHARACTER*(*) variables cannot be used in concatenations,
+*			   so I used risc_buff.
+* v530 *kob* 1/00 - minor mods for remote mc aggregations
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations.  Remove
+*                         ifdef AIX and just use risc_buff by default
+* 2/05 *acm* V58+  increase length of path_list string for FDS and other cases
+*                  where environment variables get very long (bug 1169)
+* V685+ 12/13    - *acm*  bounds checking: dont refer to parts of the string outside its bounds.
+
+* arguments:
+*	fname	   - filename - possibly lacking extension
+*                             - possibly including explicit path 
+*       path       - default logical or environment variable with path
+*	def_ext	   - default file extension
+*       do_errmsg  - give error message for file-not-found
+
+* Argument definitions
+        LOGICAL         do_errmsg
+	INTEGER		set_cnt, status
+	CHARACTER*(*)	fname, path, def_ext
+
+* Parameter and common files
+	include 'tmap_errors.parm'		! error codes
+#include "gt_lib.parm"
+	include 'xrisc_buff.cmn'
+
+
+* local valiable declarations
+#ifdef AIX_XLF
+        CHARACTER TM_PATH_LIST*8190, path_list*8190
+#else
+        CHARACTER TM_PATH_LIST*8192, path_list*8192
+#endif
+        INTEGER TM_LENSTR1, STR_SAME, plen,flen,i,postslash
+	LOGICAL is_http
+
+!!!! bug 2/93        EQUIVALENCE ( path_list, risc_buff )
+
+* path may be an environment variable (UNIX) with a path list or
+* a logical name (VMS).  Failing that, it is ignored.
+*
+
+* reset postslash to 0 every time code enters here. If not reset, it causes
+* a problem with the relative version numbers, cutting off first character
+* of filename.
+      postslash = 0
+      flen = TM_LENSTR1(fname)
+
+* Set up a logical. With strict bounds checking, a string of length 3
+* cant be used in  *** IF ( fname(1:4) .EQ. 'http') THEN ***
+
+       is_http = .FALSE.
+       IF (flen .GT. 3) THEN
+          is_http  = (fname(1:4) .EQ. 'http')
+       ENDIF
+
+* if a pathname exists, we want to extract it from the file name,  and
+* pass them to tm_path_list as two separate, but lovely, entities.
+* *** start of 5/93 addition
+      IF ( fname(1:1) .EQ. '$' ) THEN
+* ... translate "$" environment variable at beginning of filename
+	 postslash = INDEX( fname ,PathSeparator ) + 1
+	 IF ( postslash .EQ. 1 ) THEN
+	    CALL GETENV( fname(2:flen), path_list )
+	    postslash = flen + 1       ! entire filename from environment var
+	 ELSE
+	    CALL GETENV( fname(2:postslash-2), path_list )
+	 ENDIF		
+	 IF ( path_list .EQ. ' ' ) GOTO 5202
+	 plen = TM_LENSTR1( path_list )
+* ... transfer "morepath" info in the case of $ENVIRONMENT/morepath/filename
+	 DO 5 i = flen-1,postslash+1,-1
+	    IF ( fname(i:i) .EQ. PathSeparator ) THEN
+	       path_list = path_list(:plen)//PathSeparator
+     .              //fname(postslash:i-1)
+	       plen = TM_LENSTR1( path_list )
+	       postslash = i+1
+	       GOTO 6
+	    ENDIF
+ 5	 CONTINUE
+ 6	 IF ( plen .LT. LEN(path_list) ) THEN
+            plen = plen + 1                ! mandatory ' ' at end
+         ELSE
+            GOTO 5100
+         ENDIF
+* *** end of 5/93 addition
+      ELSEIF ( path .EQ. ' ' ) THEN
+         path_list = ' '
+         plen = 1
+* *kob* 11/00 Allow DODS files as MC sets - just use full http address
+      ELSEIF ( is_http ) THEN
+         TM_INQ_PATH=fname(:flen)
+         status = merr_ok
+         GOTO 9900
+      ELSEIF ( INDEX( fname ,PathSeparator ) .GT. 0 ) THEN
+         DO 10 i = flen-1,1,-1
+            IF ( fname(i:i) .EQ. PathSeparator ) THEN
+               postslash = i+1
+               GOTO 11
+         ENDIF
+ 10      continue
+ 11      path_list =   fname(:postslash-2)
+         plen = TM_LENSTR1(path_list)
+         plen = plen + 1
+* Otherwise, use the environment paths.
+      ELSE
+         CALL GETENV( path, path_list )    ! ' ' if no translation
+         plen = TM_LENSTR1( path_list )
+         IF ( plen .LT. LEN(path_list) ) THEN
+            plen = plen + 1                ! mandatory ' ' at end
+         ELSE
+            GOTO 5100
+         ENDIF
+      ENDIF
+
+* evaluate the path
+* Send path and filename seperately to tm_path_list.
+      IF (postslash .EQ. 0) postslash = 1
+
+! The INQUIRE statement inside TM_PATH_LIST fails on names longer 
+! than 256 chars causing a BUS error, so dont look in the DODS 
+! cache for the file.
+c
+c is the above still true?
+c
+      flen = TM_LENSTR1(fname)
+c      IF (flen .GT. 256 .AND.
+c     .  STR_SAME(path, 'FER_DODS_CACHE_DIR').EQ.0 ) THEN 
+c         status = merr_notmounted
+c
+c      ELSE
+         IF (postslash .LE. flen) THEN
+            TM_INQ_PATH = TM_PATH_LIST( path_list(:plen), 
+     .                               fname(postslash:),def_ext, 
+     .                               do_errmsg, status )
+         ELSE   ! this option if entire name is an environment var
+            TM_INQ_PATH = TM_PATH_LIST( path_list(:plen), 
+     .                               ' ',def_ext, 
+     .                               do_errmsg, status )
+         ENDIF
+c      ENDIF
+
+      RETURN
+
+* error exits
+ 5100 CALL TM_ERRMSG (merr_syntax, status, 'TM_INQ_PATH',
+     .			unspecified_int4, no_stepfile,
+     .			'path list too long',
+     .                  no_errstring, *9900)
+ 5202 risc_buff = fname
+      CALL TM_ERRMSG (merr_syntax, status, 'TM_INQ_PATH',
+     .			unspecified_int4, no_stepfile,
+     .			'unknown environment variable: '//risc_buff(1:flen),
+     .                  no_errstring, *9900)
+ 9900 RETURN
+      END
+
diff --git a/fmt/src/tm_int2_swap.F b/fmt/src/tm_int2_swap.F
new file mode 100644
index 0000000..ba89275
--- /dev/null
+++ b/fmt/src/tm_int2_swap.F
@@ -0,0 +1,96 @@
+	SUBROUTINE TM_INT2_SWAP(ival2, author_cpu)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* byte-swap a 2-byte quantity to achieve big/little endian conversion
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS, DEC Ultrix, and SUN
+*
+* revision 0.0 - 2/13/92
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+* bug fix -4/92- ival2 should be integer*2 declaration
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER*2 ival2
+	INTEGER author_cpu
+
+* internal variable declarations:
+        LOGICAL swap
+
+      include 'cpu.parm'
+#  ifdef sun
+      BYTE bb(2),bdum
+#  else
+      INTEGER*1 bb(2),bdum
+#  endif
+
+        INTEGER*2 dum
+	EQUIVALENCE (bb(1),dum)
+
+***********   CONVERT between machine types   **************
+*** use the pre-processor to select the target word type ***
+#ifdef sun
+* SUN is the platform in use
+      swap = author_cpu .EQ. cptype_vax
+     .  .OR. author_cpu .EQ. cptype_dec
+
+#else
+#	if unix
+* DECstation is the platform in use
+      		swap = author_cpu .EQ. cptype_sun
+
+#	else
+* VAX is the platform in use
+      		swap = author_cpu .EQ. cptype_sun
+#	endif
+#endif
+
+      IF (swap ) THEN
+         dum = ival2
+         bdum = bb(1)
+         bb(1) = bb(2)
+         bb(2) = bdum
+         ival2 = dum
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/tm_int4_swap.F b/fmt/src/tm_int4_swap.F
new file mode 100644
index 0000000..6e3eb90
--- /dev/null
+++ b/fmt/src/tm_int4_swap.F
@@ -0,0 +1,97 @@
+	SUBROUTINE TM_INT4_SWAP(ival4, author_cpu)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* byte-swap a 4-byte quantity to achieve big/little endian conversion
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX/VMS, DEC Ultrix, and SUN
+*
+* revision 0.0 - 2/13/92
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+	INTEGER ival4, author_cpu
+
+* internal variable declarations:
+        LOGICAL swap
+
+      include 'cpu.parm'
+#  ifdef sun
+      BYTE bb(4),bdum
+#  else
+      INTEGER*1 bb(4),bdum
+#  endif
+
+        INTEGER*4 dum
+	EQUIVALENCE (bb(1),dum)
+
+***********   CONVERT between machine types   **************
+*** use the pre-processor to select the target word type ***
+#ifdef sun
+* SUN is the platform in use
+      swap = author_cpu .EQ. cptype_vax
+     .  .OR. author_cpu .EQ. cptype_dec
+
+#else
+#	if unix
+* DECstation is the platform in use
+      		swap = author_cpu .EQ. cptype_sun
+
+#	else
+* VAX is the platform in use
+      		swap = author_cpu .EQ. cptype_sun
+#	endif
+#endif
+
+      IF (swap ) THEN
+         dum = ival4
+         bdum = bb(1)
+         bb(1) = bb(4)
+         bb(4) = bdum
+         bdum = bb(2)
+         bb(2) = bb(3)
+         bb(3) = bdum
+         ival4 = dum
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/tm_irregax_mid.F b/fmt/src/tm_irregax_mid.F
new file mode 100644
index 0000000..98ac46e
--- /dev/null
+++ b/fmt/src/tm_irregax_mid.F
@@ -0,0 +1,77 @@
+	SUBROUTINE TM_IRREGAX_MID( ipt1, npts )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Fill in the midpoint values as the default boundaries between grid
+* boxes
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/93 - code lifted from cd_get_1_axis
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	ipt1	- subscript of first coordinate for axis in line_memory
+*	npt	- length of axis
+
+* argument declarations
+	INTEGER	 ipt1, npts
+
+* internal variable declarations:
+        INTEGER i
+
+* include files
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include 'xio.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* compute midpoints lying between coordinates
+        DO 100 i = ipt1, ipt1+npts-2
+ 100    line_mem(i+npts+1) = (line_mem(i)+line_mem(i+1)) / 2.0D0 
+
+* lower bound of first box
+        line_mem(ipt1+npts)   = line_mem(ipt1)
+     .                        - (line_mem(ipt1+1)-line_mem(ipt1))/2.D0
+* upper bound of last box
+        line_mem(ipt1+npts+npts) = line_mem(ipt1+npts-1)
+     .            + (line_mem(ipt1+npts-1)-line_mem(ipt1+npts-2))/2.D0
+
+        RETURN
+	END
diff --git a/fmt/src/tm_its_cdf.F b/fmt/src/tm_its_cdf.F
new file mode 100644
index 0000000..2b86a45
--- /dev/null
+++ b/fmt/src/tm_its_cdf.F
@@ -0,0 +1,89 @@
+	LOGICAL FUNCTION TM_ITS_CDF ( dset, dtype )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine if this a netCDF data set
+* the common variable cd_what_isit is modified only if it is EPIC
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V5.0 5/99 *sh* (used for strides, reversals, and permutates of netCDF files)
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* argument definitions:
+*	dset	- data set number
+*       dtype - returns the ds_type string
+
+* argument declarations
+      INTEGER dset
+
+      include 'netcdf.inc'
+      include 'tmap_errors.parm'
+      include 'tmap_dims.parm'
+      include 'xdset_info.cmn_text'
+      external xdset_info_data
+      include 'xdset_info.cd_equiv'
+
+
+* internal variable declarations:
+        LOGICAL result
+        CHARACTER dtype*4
+
+* initialize
+        dtype = ' '
+
+* sanity check
+        IF ( dset.LE.0 .OR. dset.GT.maxdsets ) GOTO 1000
+
+* 'CDF', 'ECDF', and 'MC' (??) are all netCDF data sets
+! don't say yes for 'MC' as of 5/99 -- time axis requires special processing
+        dtype = ds_type(dset)
+        TM_ITS_CDF = dtype.EQ.'CDF' .OR. dtype.EQ.'ECDF'
+        RETURN
+
+* it is not netCDF
+ 1000   TM_ITS_CDF = .FALSE.
+        RETURN
+        END
+
+
+
+
+
+
+
+
diff --git a/fmt/src/tm_its_subspan_modulo.F b/fmt/src/tm_its_subspan_modulo.F
new file mode 100644
index 0000000..00caf76
--- /dev/null
+++ b/fmt/src/tm_its_subspan_modulo.F
@@ -0,0 +1,72 @@
+	LOGICAL FUNCTION TM_ITS_SUBSPAN_MODULO (axis)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return TRUE if the indicated axis is both modulo and has a modulo length
+* that is less than (or not equal to) its full span
+
+* V541 *sh* 2/02
+* V552 *acm*6/03  Too precise a test. When modulo_axlen is from a cdf file, 
+*                 it is single precision. When put into double prec, the last 
+*                 several digits have random stuff, so got a return of TRUE  
+*                 from this fcn when it wasnt.  Do single-precision comparison.
+
+	include 'tmap_dims.parm'
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+
+* internal variable declarations
+	REAL*8 TM_WW_AXLEN, TM_MODULO_AXLEN
+        LOGICAL TM_FPEQ
+        REAL wwlen, modlen
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	   TM_ITS_SUBSPAN_MODULO = .FALSE.
+	ELSEIF ( line_modulo(axis) ) THEN
+
+cc           TM_ITS_SUBSPAN_MODULO = TM_WW_AXLEN    (axis)
+cc     .                        .NE. TM_MODULO_AXLEN(axis)
+
+           wwlen = TM_WW_AXLEN(axis)
+           modlen = TM_MODULO_AXLEN(axis) 
+	   TM_ITS_SUBSPAN_MODULO = (.NOT. TM_FPEQ(wwlen, modlen) )
+
+	ELSE 
+	   TM_ITS_SUBSPAN_MODULO = .FALSE.
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_itsa_model_run.F b/fmt/src/tm_itsa_model_run.F
new file mode 100644
index 0000000..58e72ef
--- /dev/null
+++ b/fmt/src/tm_itsa_model_run.F
@@ -0,0 +1,96 @@
+	LOGICAL FUNCTION TM_ITSA_MODEL_RUN(name, source, expnum)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Determine if a particular data set represents a TMAP model run based on its
+* name, only.
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* *kob* 10/96 - Linux port - changed function type from integer to
+*                            logical
+* Include files
+
+* Argument definitions
+	CHARACTER*(*) name, source, expnum
+
+* Local definitions
+	LOGICAL	TM_DIGIT
+	INTEGER slen, ii, iiout
+	CHARACTER*3 expdig
+
+* initialize
+	slen = LEN(name)
+
+* name long enough to try decoding ("mtsa001" is minimal)?
+	IF ( slen .LT. 7 ) GOTO 1000
+
+* must start with "mt" or "mc"
+	IF ( name(1:2).NE.'mt'
+     . .AND. name(1:2).NE.'mc' ) GOTO 1000
+
+* skip 1 character following "mt" and then look for a non-digit.
+* (this kludge will work for "mtsa001" as well as "mt165w001" and "mt5n001")
+	DO 100 ii = 4,slen
+	  IF ( .NOT.TM_DIGIT(name(ii:ii)) ) GOTO 200
+ 100	CONTINUE
+	GOTO 1000	! all digits!!
+
+* there must be enough characters remaining for a 3-digit experiment code
+ 200	IF ( slen .LT. ii+3 ) GOTO 1000
+
+* the next 3 characters must be digits
+	iiout = 1
+	DO 300 ii = ii+1,ii+3
+	   IF ( TM_DIGIT(name(ii:ii)) ) THEN
+	      expdig(iiout:iiout) = name(ii:ii)
+	      iiout = iiout + 1
+	   ELSE
+	      GOTO 1000
+	   ENDIF
+ 300	CONTINUE
+
+* yes.  It's a TMAP MOM run
+	source = 'MOM'
+	expnum = '0'//expdig
+	TM_ITSA_MODEL_RUN = .TRUE.
+	RETURN
+
+* nope.  It ain't a TMAP model run
+ 1000	TM_ITSA_MODEL_RUN = .FALSE.
+	RETURN
+ 	END
diff --git a/fmt/src/tm_lefint.F b/fmt/src/tm_lefint.F
new file mode 100644
index 0000000..32461e8
--- /dev/null
+++ b/fmt/src/tm_lefint.F
@@ -0,0 +1,77 @@
+	CHARACTER*(*) FUNCTION TM_LEFINT( ival, llen )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* create a left-justified integer string from ival
+* typical usage:
+* i) declare length of function in calling routine 
+*	eg. CHARACTER*8 LEFINT
+* ii) use as a character variable
+*	eg. WRITE( 20,'(1X,A)') LEFINT( j )
+
+* note: no error checking is done to see that ival will fit into the declared
+*	field width of LEFINT.  The integer will be truncated on the right
+*	if the field is too small resulting in erroneous output.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written in transportable FORTRAN 77
+
+* revision 0.0 - 6/30/87
+* revision 0.1 - 9/28/87 - added llen
+
+* calling argument declarations:
+	INTEGER	ival, llen
+
+* internal variable declarations:
+	CHARACTER*16 buff16
+	INTEGER	     first
+
+* create right-justified string of up to 16 digits
+	WRITE ( buff16, '(I16)' ) ival
+
+* find left-most non-blank
+	DO 100 first = 1, 15
+	   IF ( buff16(first:first) .NE. ' ' ) GOTO 200
+ 100	CONTINUE
+	first = 16
+
+* insert left-justified string
+ 200	TM_LEFINT = buff16(first:16)
+	llen   = 17 - first
+	RETURN
+	END
+
diff --git a/fmt/src/tm_legal_name.F b/fmt/src/tm_legal_name.F
new file mode 100644
index 0000000..beb9728
--- /dev/null
+++ b/fmt/src/tm_legal_name.F
@@ -0,0 +1,104 @@
+	LOGICAL FUNCTION TM_LEGAL_NAME( name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* determine whether a particular string is a "legal" variable name
+*
+* programmer - steve hankin (mods by M. Verschell)
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V200:  07/07/89
+* TM_:	 12/06/89
+* IBM port 14apr94  *kob* : "Letter(c)=...." line to long for IBM compiler
+* 6/95 *sh* - allow "$" as a legal symbol since it is used by PLOT+ symbols
+* V600 6/05 *acm* Attribute control. Allow "." in a name, and allow ( ) for
+*                 the syntax (coordname).attname
+
+* calling argument declarations:
+	CHARACTER*(*) name
+*
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, slen, i
+	LOGICAL	LETTER, DIGIT, paren
+	CHARACTER c*1
+*
+* statement functions
+	LETTER( c ) = (c.GE.'A' .AND. c.LE.'Z') .OR. 
+     .                      (c.GE.'a' .AND. c.LE.'z')
+	DIGIT ( c ) = c.GE.'0' .AND. c.LE.'9'
+*
+* string length
+	slen = TM_LENSTR1( name )
+*
+* first character must be a letter (also catches 0 length strings)
+* First letter may be an opening parentheses for (coordname).attname
+
+	IF ( .NOT.LETTER(name(1:1)) ) THEN
+           IF ( name(1:1) .EQ. '(' ) THEN
+              IF ( INDEX(name(2:slen), '.' ) .EQ. 0) GOTO 5000
+              paren = .TRUE.
+           ELSE
+              GOTO 5000
+           ENDIF
+        ENDIF
+*
+* all other characters must be letters, digits, "_", or "$"
+* "." and ")" for attribute specifiers.
+	DO 100 i = 2, slen
+	   c = name(i:i)
+	   IF ( .NOT.(LETTER(c)
+     .	         .OR. DIGIT(c)
+     .	         .OR. c.EQ.'_'
+     .	         .OR. c.EQ.'$'
+     .	         .OR. c.EQ.')'
+     .	         .OR. c.EQ.'.')    ) GOTO 5000
+ 100	CONTINUE
+
+*  dot indicates an attribute. It cannot end the name.
+
+        IF (c .EQ. '.') GOTO 5000
+
+*
+* it's ok
+	TM_LEGAL_NAME = .TRUE.
+	RETURN
+*
+* it's bad
+ 5000	TM_LEGAL_NAME = .FALSE.
+	RETURN
+
+	END
diff --git a/fmt/src/tm_legal_name_op.F b/fmt/src/tm_legal_name_op.F
new file mode 100644
index 0000000..c44d195
--- /dev/null
+++ b/fmt/src/tm_legal_name_op.F
@@ -0,0 +1,73 @@
+	LOGICAL FUNCTION TM_LEGAL_NAME_OP( name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* determine whether a particular string is an operator or IF keyword.
+
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* 5/2012
+
+        include 'ferret.parm'
+        include 'errmsg.parm'
+        include 'xalgebra.cmn'
+
+* calling argument declarations:
+	CHARACTER*(*) name
+*
+* internal variable declarations:
+	INTEGER STR_MATCH
+	INTEGER	TM_LENSTR1, STR_SAME, slen, imatch
+	
+* string length
+	slen = TM_LENSTR1( name )
+
+* Is it an operator or IF or ELSE ? 
+        imatch = STR_MATCH ( name(:slen),
+     .                       alg_op, num_operators )
+        IF ( imatch .NE. atom_not_found ) GOTO 5000
+
+	IF ( STR_SAME (name, 'if') .EQ. 0) GOTO 5000	
+	IF ( STR_SAME (name, 'else') .EQ. 0) GOTO 5000
+
+* it's ok
+	TM_LEGAL_NAME_OP = .TRUE.
+	RETURN
+*
+* it's bad
+ 5000	TM_LEGAL_NAME_OP = .FALSE.
+	RETURN
+
+	END
diff --git a/fmt/src/tm_legal_unix_name.F b/fmt/src/tm_legal_unix_name.F
new file mode 100644
index 0000000..2517b12
--- /dev/null
+++ b/fmt/src/tm_legal_unix_name.F
@@ -0,0 +1,83 @@
+	LOGICAL FUNCTION TM_LEGAL_UNIX_NAME( name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* determine whether a particular string is a "legal" Unix path name
+*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* 1/93 - based on tm_legal_name
+*
+* 2jun94 *kob* - first statement function too long  - caught by ibm compiler
+#include "gt_lib.parm"
+
+* calling argument declarations:
+	CHARACTER*(*) name
+
+* internal variable declarations:
+	INTEGER	TM_LENSTR1, slen, i
+	LOGICAL	LETTER, DIGIT, PUNCT
+	CHARACTER c*1
+
+* statement functions
+	LETTER( c ) = (c.GE.'A' .AND. c.LE.'Z') .OR. 
+     .                    (c.GE.'a' .AND. c.LE.'z')
+	DIGIT ( c ) = c.GE.'0' .AND. c.LE.'9'
+	PUNCT ( c ) = c.EQ.'.' .OR. c.EQ.'_' .OR.  
+     .            c.EQ.PathSeparator
+
+* string length
+	slen = TM_LENSTR1( name )
+
+* blank name is not allowed
+	IF ( name .EQ. ' ' ) GOTO 5000
+
+* all characters must be letters, digits or punctuation
+	DO 100 i = 2, slen
+	   c = name(i:i)
+	   IF ( .NOT.(LETTER(c) .OR. DIGIT(c) .OR. PUNCT(c)) ) GOTO 5000
+ 100	CONTINUE
+
+* it's ok
+	TM_LEGAL_UNIX_NAME = .TRUE.
+	RETURN
+
+* it's bad
+ 5000	TM_LEGAL_UNIX_NAME = .FALSE.
+	RETURN
+
+	END
diff --git a/fmt/src/tm_lenstr.F b/fmt/src/tm_lenstr.F
new file mode 100644
index 0000000..f0be21d
--- /dev/null
+++ b/fmt/src/tm_lenstr.F
@@ -0,0 +1,57 @@
+	INTEGER FUNCTION TM_LENSTR (line)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the length of a character string as the position of the last 
+* non-blank character (return 0 if all blanks)
+* note: remember to declare function name INTEGER in calling program
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/21/85 - identical to LENSTR rev 0.00 apart from name
+* ywei - 05/04 call C tm_get_strlen function to speed up
+*
+* Argument definition
+	CHARACTER*(*)	line
+	INTEGER		mright, len_str
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(line)
+        CALL TM_GET_STRLEN(len_str, mright, line)
+        TM_LENSTR=len_str
+	RETURN
+	END
diff --git a/fmt/src/tm_lenstr1.F b/fmt/src/tm_lenstr1.F
new file mode 100644
index 0000000..372f5d6
--- /dev/null
+++ b/fmt/src/tm_lenstr1.F
@@ -0,0 +1,68 @@
+	INTEGER FUNCTION TM_LENSTR1 (line)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the length of a character string as the position of the last 
+* non-blank character
+* unlike TM_LENSTR this routine will return a length of 1 (vs. 0) if the string
+* is all blanks
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 05/05/87 - based on TM_LENSTR rev. 0.00
+* ywei - 05/04 call C tm_get_strlen function to speed up
+*
+* calling argument declarations:
+	CHARACTER*(*) line
+
+* internal variable declarations:
+	INTEGER	mright, len_str
+
+* initialize: find highest possible right hand limit of string
+	mright = LEN(line)
+
+        CALL TM_GET_STRLEN(len_str, mright, line)
+* for all blanks
+        IF(len_str .EQ. 0) THEN
+            TM_LENSTR1 = 1 
+        ELSE
+            TM_LENSTR1 = len_str
+        ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_line_match.F b/fmt/src/tm_line_match.F
new file mode 100644
index 0000000..7d67399
--- /dev/null
+++ b/fmt/src/tm_line_match.F
@@ -0,0 +1,134 @@
+	LOGICAL FUNCTION TM_Line_match ( line1, line2 )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Check to see if line1 is identical to line2
+*
+* by M. Verschell PMEL/TMAP
+*
+* revision 0.00 - 10/19/88
+* 5/5/93 - *sh* 2 bug fixes in coordinate compare of irregular axes
+*	 - 1) reversed logic; 2) convert args to SNGL
+*
+* IBM port 14apr94 *kob* : Logical expressions need to be compared
+*			   using NEQV and EQV
+* 1/96 *sh* "bug" fix: match was based on exactly identical unit strings
+*		this meant that "DEGREES" didn't match "LONGITUDE".
+* V541 *sh* 2/02 - check line_modulo_len
+* V551 *acm*2/03 - check calendar type
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+
+* Argument definitions
+	INTEGER*4	line1, line2
+
+* Local definitions
+	INTEGER*4	j, lc1, lc2
+	LOGICAL		TM_FPEQ
+
+* Same regularity/irregularity?
+	IF (line_regular(line1) .NEQV. line_regular(line2)) GOTO 110
+
+* Same modularity?
+	IF (line_modulo(line1) .NEQV. line_modulo(line2)) GOTO 110
+
+* Same modulo length?
+	IF (line_modulo(line1)) THEN
+	  IF (line_modulo_len(line1) .NE. line_modulo_len(line2))
+     .							  GOTO 110
+	ENDIF
+
+* Check length
+	IF (line_dim(line1) .NE. line_dim(line2)) GOTO 110
+
+* Check units
+	IF (line_unit_code(line1) .NE. line_unit_code(line2) ) GOTO 110
+* ... check actual string for unrecognizable units
+	IF ( line_unit_code(line1) .EQ. 0 ) THEN	
+	   IF (line_units(line1) .NE. line_units(line2)) GOTO 110
+	ENDIF
+
+* Check orientation
+	IF (line_direction(line1) .NE. line_direction(line2)) GOTO 110
+
+* Check calendar type
+	IF (line_direction(line1) .EQ. 'TI') THEN
+           IF (line_cal_name(line1) .NE. line_cal_name(line2)) GOTO 110
+        ENDIF
+
+* Check special values for time axis
+	IF (line_direction(line1) .EQ. 'TI') THEN
+	  IF (line_t0(line1) .NE. line_t0(line2)) GOTO 110
+	  IF (line_shift_origin(line1) .NEQV. line_shift_origin(line2)) 
+     .        GOTO 110
+	  IF (line_tunit(line1) .NE. line_tunit(line2)) GOTO 110
+	ENDIF
+
+* check coordinate and box locations
+	IF (line_regular(line1)) THEN
+	  IF (line_start(line1) .NE. line_start(line2)) GOTO 110
+	  IF (line_delta(line1) .NE. line_delta(line2)) GOTO 110
+	ELSE
+	  lc1 = line_subsc1(line1)
+	  lc2 = line_subsc1(line2)
+	  DO 100 j = 0,2*line_dim(line1)
+! added ".NOT." 5/93 *sh*
+#ifdef double_p
+	    IF (.NOT.TM_FPEQ( (line_mem(lc1+j)),
+     .			      (line_mem(lc2+j)) )) GOTO 110
+#else
+	    IF (.NOT.TM_FPEQ( SNGL(line_mem(lc1+j)),
+     .			      SNGL(line_mem(lc2+j)) )) GOTO 110
+#endif
+  100	  CONTINUE
+	ENDIF
+
+* Yes, lines match
+	TM_Line_match = .TRUE.
+	GOTO 9999
+
+* No, lines don't match
+  110	TM_Line_match = .FALSE.
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_load_calendar.F b/fmt/src/tm_load_calendar.F
new file mode 100644
index 0000000..9fb10f5
--- /dev/null
+++ b/fmt/src/tm_load_calendar.F
@@ -0,0 +1,106 @@
+      SUBROUTINE TM_LOAD_CALENDAR (cal_name, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Loads data for the calendar given  into common.  These values are
+C     accessed by the date/time functions for all calendar-using plots.
+C     Returns status = merr_ok success, merr_varlim failure
+C
+C     NOTE the current calendar name and id are NOT changed: for that see
+C     tm_set_current_calendar().  This permits Ferret queries of a particular
+C     calendar without losing knowledge of the calendar in use.
+C
+C     J Davison 10.99
+C     V 1.0
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files, add disclaimer
+
+C     0.00000000000000000000000000000000000000000000000000000000000000001
+
+      include 'calendar.decl'
+      include 'calendar.cmn'
+      include 'tmap_errors.parm'
+
+      integer         TM_GET_CALENDAR_ID, cal_id,status,i,j,k
+      character*(*)   cal_name
+
+*************************************************************************
+
+      cal_id = TM_GET_CALENDAR_ID (cal_name)
+
+C     OK CALENDAR ID?
+      if (cal_id .lt. 1 .or. 
+     .    cal_id .gt. max_calendars) then 
+         status = merr_varlim
+         goto 1000
+      end if
+
+C     SET NUM_MONTHS AND NUM_DAYS IN CALENDAR
+      num_months = cals_num_months(cal_id)
+      num_days = cals_num_days(cal_id)
+
+C     SET MONTH NAMES
+      do 110 i = 1, num_months
+         month_names(i) = cals_month_names(i,cal_id)
+ 110  end do
+
+C     SET DAYS_IN_MONTH
+      do 120 i = 1, num_months
+         days_in_month(i) = cals_days_in_month(i,cal_id)
+ 120  end do
+
+C     SET DAYS_BEFORE_MONTH
+      days_before_month(1) = 0
+      do 130 i = 2, num_months
+         days_before_month(i) = days_before_month(i-1) 
+     .                            + days_in_month(i-1)
+ 130  end do
+
+C     SET MONTH_BY_DAY
+      k = 0
+      do 150 j = 1, num_months
+         do 140 i = 1, days_in_month(j)
+            k = k + 1
+            month_by_day(k) = j
+ 140     end do
+ 150  end do
+
+C  IDENTIFY LOADED CALENDAR
+      calendar_id = cal_id
+
+      status = merr_ok
+
+ 1000 return
+
+      end
+
+
diff --git a/fmt/src/tm_loc_string.F b/fmt/src/tm_loc_string.F
new file mode 100644
index 0000000..31f1d56
--- /dev/null
+++ b/fmt/src/tm_loc_string.F
@@ -0,0 +1,91 @@
+	INTEGER FUNCTION TM_LOC_STRING( string, substring, ioc )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Case-independent search to find the "ioc"th occurrence of * "substring" 
+* in "string".  If there are fewer than "ioc" occurrences, return 0.
+
+* programmer - Ansley Manke, based on tm_has_string.F
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.00 - 03/17/03
+
+* calling argument declarations
+        INTEGER ioc
+	CHARACTER*(*)	string, substring
+
+* local variable declarations
+	INTEGER	STR_UPCASE, TM_LENSTR1,
+     .		vms_stat, sublen, strlen, i, loc
+	CHARACTER*512	up_string, up_sub, newstring
+
+* length of substring
+	sublen = TM_LENSTR1( substring )
+	strlen = TM_LENSTR1( string )
+
+        IF (ioc .LT. 1) ioc = 1
+
+        IF (ioc .GT. strlen) THEN
+	   TM_LOC_STRING = 0
+	   RETURN
+	ENDIF
+
+	IF (sublen .GT. 512) THEN
+	   TM_LOC_STRING = 0
+	   RETURN
+	ENDIF
+
+* convert to upper case
+	vms_stat = STR_UPCASE( up_string, string )
+	vms_stat = STR_UPCASE( up_sub, substring(:sublen) )
+
+* find the substring
+	TM_LOC_STRING = INDEX( up_string, up_sub(:sublen) ) 
+        IF (TM_LOC_STRING .GE. 1 .AND. ioc .GT. 1) THEN
+           DO 100 i = 2, ioc
+              loc = TM_LOC_STRING
+              IF (loc+1 .LT. strlen) THEN
+                 newstring = up_string(loc+1:strlen)
+                 TM_LOC_STRING = INDEX( newstring, 
+     .                               up_sub(:sublen) )
+                 IF (TM_LOC_STRING .NE. 0) TM_LOC_STRING = 
+     .                    TM_LOC_STRING + loc
+              ENDIF
+  100      CONTINUE
+        ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_lonw2lone.F b/fmt/src/tm_lonw2lone.F
new file mode 100644
index 0000000..ab08fff
--- /dev/null
+++ b/fmt/src/tm_lonw2lone.F
@@ -0,0 +1,54 @@
+	REAL*8 FUNCTION TM_LONW2LONE( lonw )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a longitude representation which has west positive, discontinuous
+* at the dateline (as in EPIC netCDF) to one which has east positive and is
+* discontinuous at Greenwhich
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 3/93
+
+* argument declarations
+      REAL*8  lonw
+
+      TM_LONW2LONE = -lonw
+      IF ( TM_LONW2LONE .LT. 0 ) TM_LONW2LONE = TM_LONW2LONE + 360.D0
+
+      RETURN
+      END
diff --git a/fmt/src/tm_make_4d_grids.F b/fmt/src/tm_make_4d_grids.F
new file mode 100644
index 0000000..5a5eb12
--- /dev/null
+++ b/fmt/src/tm_make_4d_grids.F
@@ -0,0 +1,245 @@
+	SUBROUTINE TM_MAKE_4D_GRIDS ( dnum, status )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will check a dataset to make sure it has no mpsunkn axis. If it has an
+* unknown time axis, it will create an axis using %%_GET_TIME_AXIS, then
+* construct a 4D grid from that. If it has other axis with mpsunkn, it will
+* issue an error.
+*
+* written 07/88 by M. Verschell for PMEL/TMAP
+*
+* revision 0.00 - 07/06/88
+* revision 0.10 - 07/28/88 - If GT data set calls GT_GET_TIME_AXIS, if TS data
+*			     set it calls TS_GET_TIME_AXIS.
+* revision 0.11 - 11/21/88 - is var used check changed to specific char_initXX
+* revision 0.12 - 11/29/88 - munknown changed to mpsunkn in grid_line check
+* revision 0.13 - 02/08/89 - added ds_time_modulo sets line_modulo on time axis
+* revision 0.20 -  9/12/90 - *sh* make auto time axis only if needed
+* Unix/RISC port - 3/12/91 *sh* - fixed bug: variable "new" not initialized
+* 6/91 - kob - Time independent data handling capability added.
+*            -  proc's STR_UPCASE and INDEX used to see if the
+*               word INDEPENDENT exists in t0_time, if so the
+*               the data is considered time independent
+* 12/92 - *sh* - set grid_out_prod when inserting time axis
+* 1/93  - *sh* - check for "-1:-1" limits given for an explicit T axis
+*
+* 7/95  - *kob*- added logic to add a time axis to a multi-file netcdf data
+*		 set based on the information in a descriptor
+
+* V510 5/00 *sh* - adapt to dynamic grids and axes for netCDF files
+*      6/00 *sh* bug fix: T axis ds_grid_start/end set only on first var using
+*		each grid
+* V530 1/00 *kob* - mods for aggregating time_independent files in an MC
+*                   context
+* V541 2/02 *sh* - minor change to support line_modulo_len
+* 4/03 *acm* - Use STR_SAME to compare strings
+*       *acm* 3/12 Add E and F dimensions (use nferdims in tmap_dims.parm)
+*       *acm* 3/12 removing use of old GT and TS data formats (routine 
+*	           GT_GET_TIME_AXIS is still used for MC datasets).
+
+* CALLING ARGUMENTS
+*	dnum - the data set fow which a time axis is desired
+*	status  - the returning status
+	INTEGER*4	dnum, status
+*
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+		include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+*
+* LOCAL DEFINITIONS
+* upstat, temp_t0time,STR_UPCASE added for implementation of time-independent
+* data ------------------> kob 6/91
+        CHARACTER*11    temp_t0time               ! kob-
+        INTEGER*4       upstat                    ! 6/91
+	LOGICAL		use_ext_tax
+	CHARACTER*13    TM_STRING
+	INTEGER*4	ivar, iv, ngrd, ilne, ngrid, ext_tax, sf
+	INTEGER*4	GT_GET_TIME_AXIS, 
+     .			TM_FIND_LIKE_GRID, STR_UPCASE
+* local parameter declarations:
+        INTEGER*4 STR_SAME, new
+        PARAMETER ( new = 0 )
+	LOGICAL all_normal
+
+* initialize
+	use_ext_tax = .TRUE.	! assume auto axis isn't needed
+
+* *kob* 12/00 - loop through all variables and check them all 
+*               for time indepedence.   
+	all_normal = .TRUE.
+	DO 50 ivar = 1,maxvars
+	   ngrd = ds_grid_number(ivar)
+	   IF (ds_var_setnum(ivar) .EQ. dnum) THEN
+	      IF ( grid_line(4,ngrd) .NE. mpsnorm) THEN
+		 all_normal = .FALSE.
+		 GOTO 70
+	      ENDIF
+	   ENDIF
+ 50	CONTINUE
+
+*       Loop through all variables
+ 70	DO 150 ivar = 1,maxvars
+	  IF (ds_var_setnum(ivar) .EQ. dnum) THEN
+
+* . Are any non-time axes defined as mpsunkn ?
+	    ngrd = ds_grid_number(ivar)
+	    DO 100 ilne = 1,3
+	      IF ( grid_line(ilne,ngrd) .EQ. mpsunkn ) GOTO 9100
+  100	    CONTINUE
+
+* .. If time axis unknown create an auto time axis (once, only)
+*	and build a new nferdims-D grid in position 0 with time info
+* *kob* 12/00 also do this if all the variables are time independent
+	    IF ( grid_line(4,ngrd) .EQ. mpsunkn .OR. 
+     .             ( (STR_SAME(ds_type(dnum), '  MC') .EQ. 0) .AND. 
+     .              grid_line(4,ngrd) .NE. mpsnorm) .OR.
+     .	            (STR_SAME(ds_type(dnum), '  MC') .eq. 0) .AND.
+     .		    all_normal ) THEN
+* ... create a time axis from the descriptor information (*sh* 9/90)
+* ... IF statement added to check for time-independent data ----> kob 6/91
+* ...   and to make sure time_axis is set to normal for time independent data
+	      IF ( use_ext_tax ) THEN
+	         use_ext_tax = .FALSE.
+                 upstat = STR_UPCASE(temp_t0time,ds_t0time(dnum))
+                 IF (INDEX(temp_t0time,'INDEPENDENT') .GT. 0) THEN   ! kob -
+                    ds_time_axis(dnum) = mpsnorm                     ! 6/91
+	         ELSEIF ((STR_SAME(ds_type(dnum), '  GT') .EQ. 0) .OR. 
+     .                   (STR_SAME(ds_type(dnum), '  MC') .EQ. 0) ) THEN
+	           ds_time_axis(dnum) = GT_GET_TIME_AXIS(dnum,status)
+	         ELSE
+	           GOTO 9200
+	         ENDIF
+	         IF (status .NE. merr_ok) GOTO 9999
+* Do not set line modulo if data is time-independent ----------> kob 6/91
+	         IF (ds_time_modulo(dnum) .AND. (INDEX(temp_t0time,
+     .                'INDEPENDENT') .EQ. 0))
+     .			     line_modulo(ds_time_axis(dnum)) = .TRUE.
+	         line_modulo_len(ds_time_axis(dnum)) = 0.0D0
+	      ENDIF
+
+* ... Transfer things to position 0 ("new") from old 3D grid
+	      CALL TM_COPY_GRID(ngrd,new)
+	      grid_line(4,new) = ds_time_axis(dnum)
+              grid_out_prod(4,new) = .TRUE.
+* ... Does this match an already existing grid?
+	      ngrid = TM_FIND_LIKE_GRID ( new )
+	      IF (ngrid .EQ. unspecified_int4) THEN
+*	... This is a new grid definition -- make sure name is unique
+	         grid_name(new) = grid_name(ngrd)
+	         grid_name(ngrd) = '%noexist%'
+	         CALL TM_NEW_GRID_NAME(grid_name(new), grid_name(new))
+	         grid_name(ngrd) = grid_name(new)
+*	... Keep the new grid with the time axis and "use" the time axis
+*	    Other vars defined on this grid will then bypass this code
+	         CALL TM_COPY_GRID( new, ngrd )
+	         CALL TM_USE_LINE( ds_time_axis(dnum) )
+	      ELSE
+*	... This duplicates a pre-existing grid definition -- reuse the older
+	         DO 110 iv =  1,maxvars
+	           IF (ds_var_setnum(ivar) .EQ. dnum) THEN
+	             IF (ds_grid_number(iv).EQ.ngrd)
+     .			 ds_grid_number(iv) = ngrid
+	           ENDIF
+ 110		 CONTINUE
+	         ngrd = ngrid
+	      ENDIF
+* ... Set the (previously unspecified) subscript limits for the variable
+* ... Check to see if data is time-independent, if it is, both
+* ...... grid start and end are set to 1 -----------> kob 6/91
+	      DO 120 iv =  1,maxvars
+	        IF (ds_var_setnum(ivar).EQ.dnum
+     .	     .AND.  ds_grid_number(iv) .EQ.ngrd  ) THEN
+	          ds_grid_start(4,iv) = 1
+                  IF (INDEX(temp_t0time,'INDEPENDENT') .GT. 0) THEN
+                    ds_grid_end(4,iv) = 1
+                  ELSE
+                    ds_grid_end  (4,iv) = line_dim( ds_time_axis(dnum) )
+                  ENDIF
+	        ENDIF
+ 120	      CONTINUE
+	    ELSE
+	      ext_tax = grid_line(4,ngrd)	! save external time ax #
+	    ENDIF
+
+	  ENDIF
+
+  150	CONTINUE
+
+* a few clean-up details for externally defined time axis (*sh* 9/90)
+* (uses time axis from last data set variable as data set default)
+	IF ( use_ext_tax ) THEN
+	   ds_time_axis  ( dnum ) = ext_tax
+	   ds_time_modulo( dnum ) = line_modulo( ext_tax )
+	   DO 160 sf = 1, maxstepfiles
+ 160	   IF ( sf_setnum(sf) .EQ. dnum ) sf_regtimes(sf) = .FALSE.
+* *sh* 1/93: check for "-1:-1" limits with an explicit time axis
+	   DO 170 ivar = 1,maxvars
+	      IF (ds_var_setnum(ivar) .EQ. dnum) THEN
+                 IF ( ds_grid_start(4,ivar) .LE. 0 )
+     .                 ds_grid_start(4,ivar) = 1
+                 IF ( ds_grid_end(4,ivar) .LE. 0 )
+     .                 ds_grid_end(4,ivar) =  line_dim( ext_tax )
+              ENDIF
+ 170       CONTINUE
+	ENDIF
+
+	GOTO 9990
+
+* error messages
+ 9000	CALL TM_ERRMSG (merr_gridlim, status, 'TM_MAKE_4D_GRIDS',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(max_grids)), no_errstring,
+     .			*9999)
+ 9100	CALL TM_ERRMSG (merr_undefline, status, 'TM_MAKE_4D_GRIDS',
+     .			dnum, no_stepfile,
+     .			'VARIABLE = '//ds_var_code(ivar), no_errstring,
+     .			*9999)
+ 9200	CALL TM_ERRMSG (merr_unktype, status, 'TM_MAKE_4D_GRIDS',
+     .			dnum, no_stepfile,
+     .			'Type declared '//ds_type(dnum),
+     .			no_errstring, *9999)
+ 9990	status = merr_ok
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_make_basic_axis.F b/fmt/src/tm_make_basic_axis.F
new file mode 100644
index 0000000..d077ec2
--- /dev/null
+++ b/fmt/src/tm_make_basic_axis.F
@@ -0,0 +1,103 @@
+	SUBROUTINE TM_MAKE_BASIC_AXIS( name, start,
+     .                                 delta, npts, iaxis, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Create a very basic 1 to n axis with no frills
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/92
+* V510 *sh* 3/00 - convert to dynamic grids and axes for netCDF files
+* V550 *sh* 11/02 - initialize line_modulo_len (just for good house keeping)
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V63  *acm* 9/09 - Fix bug 1686: set line_name_orig
+
+* argument definitions:
+*       name      - name for axis
+*       start     - starting value
+*	delta     - delta value
+*       npts      - number of points
+*       iaxis     - returned axis pointer in TMAP common
+*	status	  - return status
+
+* include files
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+
+* argument declarations
+	INTEGER	 npts, iaxis, status
+        REAL*8   start, delta
+        CHARACTER*(*) name
+
+* local variable declarations:
+      INTEGER STR_UPCASE,
+     .        istat
+
+* allocate a temporary slot for the axis
+	CALL TM_ALLO_TMP_LINE(iaxis, status)
+	IF (status .NE. merr_ok) GOTO 5900
+
+* build axis
+      istat = STR_UPCASE( line_name(iaxis), name )
+      line_name_orig(iaxis) = name
+      line_dim( iaxis)      = npts
+      line_start(iaxis)     = start
+      line_delta(iaxis)     = delta
+      line_regular(iaxis)   = .TRUE.
+      line_units(iaxis)     = ' '
+      line_unit_code(iaxis) = 0
+      line_modulo(iaxis)    = .FALSE.
+      line_modulo_len(iaxis)= 0.0D0
+      line_t0(iaxis)        = char_init20
+      line_shift_origin(iaxis) = .FALSE.
+      line_tunit(iaxis)     = real4_init
+      line_direction(iaxis) = 'NA'
+
+* successful completion
+      status = merr_ok
+
+ 5900 RETURN
+
+	END
diff --git a/fmt/src/tm_make_dyn_line.F b/fmt/src/tm_make_dyn_line.F
new file mode 100644
index 0000000..cad847a
--- /dev/null
+++ b/fmt/src/tm_make_dyn_line.F
@@ -0,0 +1,190 @@
+	SUBROUTINE TM_MAKE_DYN_LINE(idim, lo, hi, del,
+     .					units, modulo, mod_len,
+     .					outline, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Create a dynamic (always) line base on the input description
+* To create a dynamic line that is based on another line use
+* TM_GET_LIKE_DYN_LINE, instead
+* Will create a line description based on the input arguments and
+* compare it to other line definitions in common. Unlike
+* tm_get_like_line (and unlike TM_GET_LIKE_DYN_GRID) this will check
+* dynamic lines (only).
+* If there is a match then "outline" returns with the number of the match.
+* If there is no match, then a new dynamic line is created.
+* "outline" returns with the number of the new dynamic line.
+
+* created 1/98 *sh* - based on tm_get_like_dyn_line
+* V532 5/01 *sh* - eliminate (annoying) warning message about unknown units
+* V541 2/01 *sh* - added support for line_modulo_len
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+* V580 9/04 *acm* - if units not given, assign general X or Y direction rather 
+*                   than WE or SN
+* V600 *acm* 2/06 - Fix for bug 1394, send do_err flag to TM_DATE_REFORMAT
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Arguments
+	LOGICAL		modulo
+	INTEGER		idim, outline, status
+	REAL*8		lo, hi, del, mod_len
+	CHARACTER*(*)	units
+
+* argument description:
+* in	idim	  - axis orientation: 1-nferdims
+* in	units	  - units string for axis (max 16 characters)
+*		    used when labeling the axis
+*		    if creating a time axis format should be
+*		    "units since dd-mmm-yyyy:hh:mm:ss" with 
+*		    max of 16 characters for the unit string
+* in	modulo	  - if creating a modulo axis this is TRUE (untested on 1/98)
+* in	lo,hi,del - description of line (note REAL*8)
+* out	outline	  - returned line
+
+* INCLUDE FILES
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'implicit.parm'
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	include 'xunits.cmn_text'
+		include 'xrisc_buff.cmn'
+
+*
+* Local definitions
+	INTEGER		TM_FIND_LIKE_DYN_LINE,
+     .			TM_LENSTR1, TM_UNIT_ID,
+     .			inline, iunit, since_T0
+
+	REAL*8 		dp_epsilon
+	PARAMETER 	( dp_epsilon = 1.D-10)
+
+* allocate a scratch line 
+	CALL TM_ALLO_DYN_LINE( inline, status )
+	IF ( status .NE. merr_ok ) RETURN
+
+* initialize
+	line_t0(inline)        = char_init20
+	line_tunit(inline)     = 0
+
+* basic defaults on the line to be created
+	line_parent(inline)    = 0
+	line_regular(inline)   = .TRUE.
+	line_class(inline)     =  pline_class_basic
+	line_direction(inline) = axis_orients(idim)
+
+* set user-specified (boolean) modulo flag
+	line_modulo(inline)    = modulo		! "TRUE" untested 1/98 !!!
+	line_modulo_len(inline) = mod_len
+
+* set user-specified units -- attempting to interpret them (a pain!)
+	line_units(inline)     = units
+	IF ( idim .EQ. t_dim ) THEN
+* ... sloppy check for "since dd-mmm-yyyy" -- misses mixed case "Since"
+	   since_T0 = MAX( INDEX(units,'since'), INDEX(units,'SINCE') )
+	   IF ( since_T0 .GT. 2 ) THEN
+	     line_units(inline) = units(:since_T0-1) ! just the "units" part 
+	     IF ( TM_LENSTR1(units) .GT. since_T0 + 5 ) THEN
+	       CALL TM_DATE_REFORMAT(units(since_T0+6:),
+     .				     pdate_numslashnum, line_t0(inline),
+     .                               pdate_vax, .TRUE., status )
+	       IF ( status .NE. merr_ok ) GOTO 9000
+	     ENDIF
+	   ENDIF
+	ENDIF
+
+* decode the units - check the validity
+	line_unit_code(inline) = 0
+	IF ( units .NE. ' ' ) THEN
+           line_unit_code(inline) = TM_UNIT_ID( line_units(inline) )
+	   iunit = line_unit_code(inline)	
+           IF ( iunit .EQ. 0 ) THEN
+!	     CALL WARN('unknown axis units: '//units)
+
+             IF (line_direction(inline) .EQ. 'WE'  )
+     .           line_direction(inline) = 'XX'
+             IF (line_direction(inline) .EQ. 'SN' )
+     .           line_direction(inline) = 'YY'
+ 
+	     CONTINUE
+	   ELSEIF (iunit .EQ. -5) THEN    ! "-5" is "MONTHS"
+	       risc_buff = units
+               CALL WARN(risc_buff(:TM_LENSTR1(risc_buff))//
+     .			' is ambiguous ... using 1/12 of 365 days.') 
+           ELSEIF ( iunit .NE. 0 ) THEN
+* ... Issue warning for inappropriate units like HOURS on X ax
+*     and render the units unconvertible
+             IF (  ( idim.EQ.t_dim .AND.
+     .             ( iunit.LT.pun_1st_time.OR.iunit.GT.pun_last_time ) )
+     .        .OR. ( idim.NE.t_dim .AND.
+     .             ( iunit.LT.pun_1st_len .OR.iunit.GT.pun_last_len  ) )
+     .        .OR. ( idim.EQ.z_dim .AND.
+     .               iunit.EQ.pun_degrees )  ) THEN     ! 7/96
+		risc_buff = units
+		CALL WARN
+     .               (risc_buff(:TM_LENSTR1(risc_buff))
+     .                  //' appear to conflict with orientation:'
+     .                  //' no conversions possible')
+               line_unit_code(inline) = 0
+             ENDIF           
+           ENDIF
+	ENDIF
+
+* set start, delta, and N
+	line_start(inline)     = lo
+	line_delta(inline)     = del 
+	line_dim(inline)       = INT((hi-lo)/del +dp_epsilon) + 1
+
+* search for this line among the existing, dynamic lines
+	outline =  TM_FIND_LIKE_DYN_LINE( inline )
+
+	IF (outline .EQ. unspecified_int4) THEN
+* ... doesn't exist yet - make a new dynamic line  "(AXnnn)"
+	   CALL TM_ALLO_DYN_LINE( outline, status )
+	   IF (status .NE. merr_ok) GOTO 9000
+	   CALL TM_COPY_LINE( inline, outline )
+
+* ... name it "(AXnnn)"
+	   WRITE ( line_name(outline), 3000 ) outline - max_lines
+ 3000	   FORMAT('(AX',I3.3,')')		! restricted to 3 digits
+	ENDIF
+
+* successful completion
+	status = merr_ok
+
+* error and normal exits
+ 9000	CALL TM_DEALLO_DYN_LINE(inline)
+	RETURN
+	END
diff --git a/fmt/src/tm_make_fmt_date.F b/fmt/src/tm_make_fmt_date.F
new file mode 100644
index 0000000..1b0ccdd
--- /dev/null
+++ b/fmt/src/tm_make_fmt_date.F
@@ -0,0 +1,83 @@
+	SUBROUTINE TM_MAKE_FMT_DATE (form, date, year, month, day,
+     .				     hour, minute, second, dlen)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will take the components of a date and convert it to a string of the
+* requested date format
+
+* *sh* 2/13/95
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* ARGUMENT DEFINITIONS
+*  form  - code for the date string format
+*  date  - date to process
+*  day, month, year, hour, minute, second - obvious
+*  status - returned status
+	CHARACTER*(*)	date
+	INTEGER	form, day, month, year, hour, minute, second, dlen
+*
+* INCLUDE FILES
+	include 'tmap_errors.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+
+* internal variable declarations:
+	CHARACTER*20    tempstr
+	 CHARACTER*3    cmon(12)
+
+	DATA cmon /'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .             'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+
+	IF ( form .EQ. pdate_vax ) THEN
+* model date: 01-DEC-1982 12:52:00
+	   WRITE (date,1000) day, cmon(month), year, hour,
+     .  			minute, second
+1000       FORMAT(I2.2,'-',A3,'-',I4.4,' ',2(I2.2,':'),I2.2)
+	   dlen = 20
+	ELSEIF ( form .EQ. pdate_numslashnum ) THEN
+* model date: 1982-12-01 12:52:00
+	   WRITE (date,1100) year, month, day, hour,
+     .  			minute, second
+1100       FORMAT(I4.4,'-',I2.2,'-',I2.2,' ',2(I2.2,':'),I2.2)
+	   dlen = 19
+	ELSE
+	   STOP 'Unknown date format code'
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_make_relative_ver.c b/fmt/src/tm_make_relative_ver.c
new file mode 100644
index 0000000..c488171
--- /dev/null
+++ b/fmt/src/tm_make_relative_ver.c
@@ -0,0 +1,117 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* *kob* 10/03 v553 - gcc v3.x needs wchar.h included */
+/* *acm   9/06 v600 - add stdlib.h wherever there is stdio.h for altix build*/ 
+/* V63  *acm* 10/09 Changes for gfortran build */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <string.h>
+
+/* 
+
+  this routine takes the relative verson number passed to it (eg, .~-3~) and
+    calls high_ver_name (passing filename and path) to get the proper
+    version number for the file. (eq, ~12~)
+    It then returns this value.
+
+ version 0.0 -kob- 10/17/91
+
+*/
+
+/* had to add ifdef check for trailing underscore in routine name
+   for aix port *kob* 10/94 */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+char *tm_make_relative_ver(curr_ver, fname,path,real_ver)
+#else
+char *tm_make_relative_ver_(curr_ver, fname,path,real_ver)
+#endif
+char *curr_ver,*fname, *path;
+int *real_ver;
+
+/*
+
+ calling arguments :    
+            curr_ver --> contains the relative version num. (eg. .~-3~)
+	    real_ver --> will contain and pass back proper version num. (eq. ~12~)
+	    fname -----> filename; needed for routine high_ver_name
+	    path ------> path to file, also needed for routine high_ver_name
+
+*/
+
+{
+  int i,j,int_ver, high_ver, ver_len;
+  char temp_ver[20];
+
+/* get just the numeric part of the string, ignoring all else */
+  for (i=0,j=0; i<=strlen(curr_ver); i++)
+    {
+      if (*(curr_ver+i) != '.' && *(curr_ver+i) != '-' && *(curr_ver+i) != '~')
+	{
+	  *(temp_ver+j) = *(curr_ver+i);
+	  ++j;
+	}
+    }
+
+/* convert the string to an integer */ 
+  sscanf (temp_ver, "%d", real_ver);
+
+/* get the new version number by subtracting the relative version number -1
+     from the highest version number          */
+  *real_ver -= 1;
+  high_ver = high_ver_name (fname,path);
+  *real_ver = high_ver - *real_ver;
+
+  
+
+/* convert that from integer to character string 
+  sprintf (temp_ver, "%d", int_ver);
+
+ surround the new version number with tilda's 
+  strcat (real_ver, "~");
+  strcat (real_ver, temp_ver);
+  strcat (real_ver, "~");
+  
+ append a null to the string 
+  ver_len = strlen(real_ver);
+  *(real_ver+ver_len) = '\0';  */
+
+}
+
diff --git a/fmt/src/tm_match_capital_name.c b/fmt/src/tm_match_capital_name.c
new file mode 100644
index 0000000..e7edc46
--- /dev/null
+++ b/fmt/src/tm_match_capital_name.c
@@ -0,0 +1,62 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*  ywei: 05/04 created to speed up uppercase string matching
+*/
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+void tm_match_captial_name_(char* test_name, 
+                            char* model_name, 
+                            int * len_str, 
+                            int * result)
+{
+     int i, len=*len_str;
+     char c1, c2;
+
+     *result=1;
+     for(i=0; i<len;i++)
+     {
+        c1=test_name[i];
+        c2=model_name[i];
+
+        if(c1!=c2) {
+	  if(c1<'a' || c1>'z' || c1+'A'-'a'!=c2){
+	     *result=0;
+             break;
+	  }
+	}                
+     }
+     return;
+}
diff --git a/fmt/src/tm_mod.F b/fmt/src/tm_mod.F
new file mode 100644
index 0000000..1f5aba0
--- /dev/null
+++ b/fmt/src/tm_mod.F
@@ -0,0 +1,67 @@
+	INTEGER FUNCTION TM_MOD (n, modlen)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*   MOD function, where the first argument may be negative
+*   ... IF (arg LT 0 ) THEN <add mod cycle length to result>
+*
+*    I     MOD(I,3)    TM_MOD(I,3)
+*    -3     0            0
+*    -2    -2            1
+*    -1    -1            2
+*     0     0            0
+*     1     1            1
+*     2     2            2
+*     3     0            0
+
+* programmer - Ansley Manke
+* NOAA/PMEL, Seattle, WA *
+* 3/30/2004 
+*
+* calling argument declarations:
+      INTEGER n, modlen
+
+* Internal declarations
+      INTEGER npos
+
+      npos = MOD(n, modlen)
+
+      IF (npos .LT. 0) npos = npos + modlen
+
+      TM_MOD = npos
+
+      RETURN
+      END
diff --git a/fmt/src/tm_modulo_axlen.F b/fmt/src/tm_modulo_axlen.F
new file mode 100644
index 0000000..fb3a1b2
--- /dev/null
+++ b/fmt/src/tm_modulo_axlen.F
@@ -0,0 +1,61 @@
+	REAL*8 FUNCTION TM_MODULO_AXLEN (axis)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return length of an axis in world coordinates, ignoring its modulo character
+* If it has a modulo length specified, then return that. (unlike TM_WW_AXLEN)
+
+* V541 *sh* 2/02
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+
+* internal variable declarations
+	REAL*8	TM_WW_AXLEN
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	  TM_MODULO_AXLEN = unspecified_val8
+	ELSEIF ( line_modulo(axis)
+     .	   .AND. line_modulo_len(axis).GT. 0.0D0 ) THEN
+	  TM_MODULO_AXLEN = line_modulo_len(axis)
+	ELSE
+	  TM_MODULO_AXLEN = TM_WW_AXLEN(axis)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_modulo_line_dim.F b/fmt/src/tm_modulo_line_dim.F
new file mode 100644
index 0000000..4f09948
--- /dev/null
+++ b/fmt/src/tm_modulo_line_dim.F
@@ -0,0 +1,64 @@
+	INTEGER FUNCTION TM_MODULO_LINE_DIM (axis)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return TRUE if the indicated axis is both modulo and has a modulo length
+* that is less than (or not equal to) its full span
+
+* V541 *sh* 2/02
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+
+* internal variable declarations
+	LOGICAL	TM_ITS_SUBSPAN_MODULO
+	INTEGER ldim
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	   ldim = unspecified_int4
+	ELSE
+	   ldim = line_dim(axis)
+	   IF ( line_modulo(axis) ) THEN
+	     IF (TM_ITS_SUBSPAN_MODULO(axis)) ldim = ldim + 1
+	   ENDIF
+	ENDIF
+
+	TM_MODULO_LINE_DIM = ldim
+
+	RETURN
+	END
diff --git a/fmt/src/tm_new_grid_name.F b/fmt/src/tm_new_grid_name.F
new file mode 100644
index 0000000..05e09e3
--- /dev/null
+++ b/fmt/src/tm_new_grid_name.F
@@ -0,0 +1,97 @@
+	SUBROUTINE TM_NEW_GRID_NAME ( suggested_name, new_name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* If necessary creates a unique grid_name based on the suggested name by
+* appending a number to the end of the suggested name
+
+* Warning: if new_name is less than 5 characters this routine may STOP
+*
+* revision 0.00 - 11/22/88
+* V510 *sh* 4/00 - shift to dynamic grids -- check dynamic grid names
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments
+	CHARACTER*(*)	suggested_name, new_name
+*                                           
+* Parameters and commons                    
+
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'  
+	external xgt_grid_data
+*
+* Local declarations
+	REAL		newnum
+	INTEGER*4	suglen, outlen, addlen, uselen, igrd 
+	INTEGER*4	TM_LENSTR1
+	CHARACTER*4	TM_FMT, add_on
+*
+* initialize
+	suglen   = TM_LENSTR1(suggested_name)
+	outlen   = LEN( new_name )
+	new_name = suggested_name
+	newnum   = 0.
+
+* check for an identical name
+ 10	DO 100 igrd = 1, max_grids
+	   IF (grid_name(igrd) .EQ. new_name) GOTO 200
+ 100	CONTINUE
+
+* check among the dynamic grids
+	igrd = 0		! to get start of linked list
+ 110	CALL TM_NEXT_DYN_GRID( igrd, *199)
+	   IF (grid_name(igrd) .EQ. new_name) GOTO 200
+	GOTO 110
+
+* check among the newly-created grids
+ 199	igrd = 0		! to get start of linked list
+ 210	CALL TM_NEXT_TMP_GRID( igrd, *299)
+	   IF (grid_name(igrd) .EQ. new_name) GOTO 200
+	GOTO 210
+
+* clean bill of health - no name match
+ 299	RETURN
+*
+* yes there's a duplicate - try to "uniqueify" the name
+ 200	newnum = newnum + 1.
+	add_on = TM_FMT(newnum, 4, 4, addlen )
+	uselen  = MIN( suglen, outlen-addlen )
+	IF ( uselen .LE. 0 ) STOP 'TM_NEW_GRID_NAME'
+	new_name = suggested_name(:uselen)//add_on
+*
+* no danger of an infinite loop unless there are over 9999 names
+	GOTO 10
+	END
diff --git a/fmt/src/tm_new_line_name.F b/fmt/src/tm_new_line_name.F
new file mode 100644
index 0000000..f3d6573
--- /dev/null
+++ b/fmt/src/tm_new_line_name.F
@@ -0,0 +1,96 @@
+	SUBROUTINE TM_NEW_LINE_NAME ( suggested_name, new_name )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* If necessary creates a unique line_name based on the suggested name by
+* appending a number to the end of the suggested name
+
+* Warning: if new_name is less than 5 characters this routine may STOP
+*
+* revision 0.00 - 12/12/88
+* V510 *sh* 4/00 - shift to dynamic grids -- check dynamic line names
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments
+	CHARACTER*(*)	suggested_name, new_name
+*                                           
+* Parameters and commons                    
+        include 'tmap_dims.parm'
+        include 'xtm_grid.cmn_text'  
+	external xgt_grid_data
+
+* Local declarations
+	REAL		newnum
+	INTEGER*4	suglen, outlen, addlen, uselen, ilne 
+	INTEGER*4	TM_LENSTR1
+	CHARACTER*4	TM_FMT, add_on
+*
+* initialize
+	suglen   = TM_LENSTR1(suggested_name)
+	outlen   = LEN( new_name )
+	new_name = suggested_name
+	newnum   = 0.
+
+* check for an identical name
+  10	DO 100 ilne = 1, max_lines
+	  IF (line_name(ilne) .EQ. new_name) GOTO 200
+  100	CONTINUE
+
+* check among the dynamic lines
+	ilne = 0		! to get start of linked list
+ 110	CALL TM_NEXT_DYN_LINE( ilne, *199)
+	   IF (line_name(ilne) .EQ. new_name) GOTO 200
+	GOTO 110
+
+* check among the newly-created lines
+ 199	ilne = 0		! to get start of linked list
+ 210	CALL TM_NEXT_TMP_LINE( ilne, *299)
+	   IF (line_name(ilne) .EQ. new_name) GOTO 200
+	GOTO 210
+
+* clean bill of health - no name match
+ 299	RETURN
+*
+* yes there's a duplicate - try to "uniqueify" the name
+  200	newnum = newnum + 1.
+	add_on = TM_FMT(newnum, 4, 4, addlen )
+	uselen  = MIN( suglen, outlen-addlen )
+	IF ( uselen .LE. 0 ) STOP 'TM_NEW_LINE_NAME'
+	new_name = suggested_name(:uselen)//add_on
+*
+* no danger of an infinite loop unless there are over 9999 names
+	GOTO 10
+	END
diff --git a/fmt/src/tm_next_dyn_grid.F b/fmt/src/tm_next_dyn_grid.F
new file mode 100644
index 0000000..efc23f6
--- /dev/null
+++ b/fmt/src/tm_next_dyn_grid.F
@@ -0,0 +1,55 @@
+	SUBROUTINE TM_NEXT_DYN_GRID( grid, * )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Return next dynamic grid in list ... or RETURN 1 if no more
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+
+* Local variable definitions
+	INTEGER grid
+
+	IF ( grid .LE. 0 ) grid = max_grids
+	grid = grid_flink(grid)
+	IF (grid.EQ.max_grids) RETURN 1
+
+	RETURN
+	END
diff --git a/fmt/src/tm_next_dyn_line.F b/fmt/src/tm_next_dyn_line.F
new file mode 100644
index 0000000..49c4116
--- /dev/null
+++ b/fmt/src/tm_next_dyn_line.F
@@ -0,0 +1,55 @@
+	SUBROUTINE TM_NEXT_DYN_LINE( line, * )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Return next dynamic axis in list ... or RETURN 1 if no more
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+
+* Local variable definitions
+	INTEGER line
+
+	IF (line.LE.0) line = max_lines
+	line = line_flink(line)
+	IF (line.EQ.max_lines) RETURN 1
+
+	RETURN
+	END
diff --git a/fmt/src/tm_next_tmp_grid.F b/fmt/src/tm_next_tmp_grid.F
new file mode 100644
index 0000000..116f0b0
--- /dev/null
+++ b/fmt/src/tm_next_tmp_grid.F
@@ -0,0 +1,55 @@
+	SUBROUTINE TM_NEXT_TMP_GRID( grid, * )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Return next temporary grid in list ... or RETURN 1 if no more
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+
+* Local variable definitions
+	INTEGER grid
+
+	IF ( grid .LE. 0 ) grid = tmp_grid_hook
+	grid = grid_flink(grid)
+	IF (grid.EQ.tmp_grid_hook) RETURN 1
+
+	RETURN
+	END
diff --git a/fmt/src/tm_next_tmp_line.F b/fmt/src/tm_next_tmp_line.F
new file mode 100644
index 0000000..8273e53
--- /dev/null
+++ b/fmt/src/tm_next_tmp_line.F
@@ -0,0 +1,55 @@
+	SUBROUTINE TM_NEXT_TMP_LINE( line, * )
+
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* Return next temporary line in list ... or RETURN 1 if no more
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+
+
+* Local variable definitions
+	INTEGER line
+
+	IF (line.LE.0) line = tmp_line_hook
+	line = line_flink(line)
+	IF (line.EQ.tmp_line_hook) RETURN 1
+
+	RETURN
+	END
diff --git a/fmt/src/tm_next_ver_name.F b/fmt/src/tm_next_ver_name.F
new file mode 100644
index 0000000..c657af8
--- /dev/null
+++ b/fmt/src/tm_next_ver_name.F
@@ -0,0 +1,86 @@
+	SUBROUTINE TM_NEXT_VER_NAME ( name, vernam, path )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* determine the name for the next version of this file
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix and VMS operating systems
+*
+* rev 0.0 -   5/6/91
+* rev 1.0 -   10/17/91  -- <kob>
+*                      - modified to pass the specified path to tm_c_ver_name
+*                        to allow searching for files in directories other
+*                        than just the current one.
+*  Sun Port 1/30/92 -kob-  added 'ifdef sun' because SUN uses BYTE where DECstation uses
+*                          INTEGER*1
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+        CHARACTER*(*) name, vernam, path
+
+* internal variable declarations:
+	INTEGER	nlen
+        INTEGER TM_LENSTR1
+
+        include 'tmap_errors.parm'
+
+        INTEGER slen,plen
+        PARAMETER  ( slen = 128 )
+#ifdef sun
+        BYTE      nhol(slen), vhol(slen),phol(slen) ! c-type Hollerith string buffers
+#else
+        INTEGER*1 nhol(slen), vhol(slen),phol(slen) ! c-type Hollerith string buffers
+#endif
+
+* initialize
+        nlen = TM_LENSTR1(name)
+        plen = TM_LENSTR1(path)
+
+* translate to null-terminated c-type strings
+        CALL TM_FTOC_STRNG( name  (:nlen), nhol, slen )
+        CALL TM_FTOC_STRNG( path  (:plen), phol, slen)
+
+* call c-written routine to determine next version name from directory
+* pass in path so that search is not limited to current directory 10/17/91
+        CALL TM_C_VER_NAME( nhol, vhol, phol )
+
+* translate new version name to FORTRAN style
+        CALL TM_CTOF_STRNG( vhol, vernam, slen )
+
+	RETURN
+	END
+
diff --git a/fmt/src/tm_note.F b/fmt/src/tm_note.F
new file mode 100644
index 0000000..638c9e6
--- /dev/null
+++ b/fmt/src/tm_note.F
@@ -0,0 +1,77 @@
+	SUBROUTINE TM_NOTE ( string, lunit )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* display a warning message to the operator
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 2/92 for TMAP library (from FERRET rouitine "WARN")
+* *sh* 2/28/95 - allow message to be sent to alternative location
+* *js* 12.12.97- changed to use tm_split_list
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+
+
+* calling argument declarations:
+        INTEGER lunit
+	CHARACTER*(*)	string
+
+* internal variable declarations:
+	INTEGER		TM_LENSTR1, slen
+
+#ifdef unix
+	include 'xalt_messages.cmn_text'
+	include 'xrisc_buff.cmn'
+#else
+	INCLUDE 'TMAP_FORMAT:XALT_MESSAGES.CMN'
+#endif
+
+* string length
+	slen = TM_LENSTR1( string )
+
+* do it
+	IF ( alt_messages ) THEN
+	   CALL TM_ALTERNATE_NOTE( string, lunit )
+	ELSE
+c	   WRITE ( lunit, 3000 ) string(:slen)
+c 3000	   FORMAT ( ' *** NOTE: ',A )
+	   risc_buff = string
+	   call tm_split_message(lunit, ' *** NOTE: '//risc_buff)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_number.F b/fmt/src/tm_number.F
new file mode 100644
index 0000000..d5b46cf
--- /dev/null
+++ b/fmt/src/tm_number.F
@@ -0,0 +1,68 @@
+	logical function tm_number (string)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Test to see if a string is a valid number
+* J Davison 11.8.94
+
+	integer		length, tm_lenstr1
+	integer		result
+	
+#ifdef sun
+        byte      cstring(255)
+#else
+        integer*1 cstring(255)
+#endif
+
+	character*(*)	string
+	
+**********************************************************************
+
+* 	CONVERT TO VALID C STRING
+	length = tm_lenstr1 (string)
+	call tm_ftoc_strng (string, cstring, length+1)
+
+*	CALL C ROUTINE TO READ STRING -- RETURNS 0 IF NOT A NUMBER
+	call tm_number_sub (cstring, result)
+	
+	if (result .eq. 0) then
+	   tm_number = .false.
+	else
+	   tm_number = .true.
+	endif
+
+	return
+	end
diff --git a/fmt/src/tm_number_sub.c b/fmt/src/tm_number_sub.c
new file mode 100644
index 0000000..e1e85ef
--- /dev/null
+++ b/fmt/src/tm_number_sub.c
@@ -0,0 +1,75 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+
+
+/* Function called by tm_number to test if a string is a valid number
+ * Returns 0 if not OK, 1 if OK
+ *
+ * J Davison 11.8.94* 
+ *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+#include <stdio.h>
+#include "ferretmacros.h"
+
+#ifdef _NO_PROTO
+void FORTRAN(tm_number_sub)  (string, result) 
+
+char * string;
+int * result;
+#else /* NO_PROTO */
+void FORTRAN(tm_number_sub)  (char * string, int * result) 
+#endif  /* NO_PROTO */
+{
+  int num_read;
+  double rval;  /* pointer to double expected by %lf in sscanf */
+  char kval[255];
+
+  num_read = sscanf(string, "%lf%s", &rval, kval);
+ 
+  if (num_read == 1) 
+    *result = 1;
+  else
+    *result = 0;
+
+  return;
+}
+
+
diff --git a/fmt/src/tm_only1_step.F b/fmt/src/tm_only1_step.F
new file mode 100644
index 0000000..ba3a61f
--- /dev/null
+++ b/fmt/src/tm_only1_step.F
@@ -0,0 +1,77 @@
+	SUBROUTINE TM_ONLY1_STEP ( ds_num, f_num, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* close all step files in this data set except the one specified
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/22/85
+* revision 0.10 - 02/15/89 - renamed to TM_ONLY1_STEP and changed GT_CLOSE_STEP
+*			     to TM_CLOSE_STEP, renamed sf_num to f_num
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* arguments:
+*	ds_num	- data set number (see COMMON /XSTEP_FILES/)
+*	f_num	- file number within COMMON/XSTEP_FILES to leave open
+
+	include 'tmap_errors.parm'		! error code parameter defs
+#include "tmap_dset.parm"
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+	external xstep_files_data
+
+	INTEGER		ds_num,f_num,status,ierr,i
+
+* initialize error status
+	status = merr_ok	! innocent until proven guilty
+
+* loop through all step files
+	DO 100 i = 1,maxstepfiles
+
+	  IF ((sf_setnum(i) .EQ. ds_num) .AND.		! correct data set ?
+     .	      (sf_lunit (i) .NE. file_not_open) .AND.	! open ?
+     .	      (i  .NE. f_num))			 THEN	! leave requested 1 open
+
+	    CALL TM_CLOSE_STEP (i,ierr)
+	    IF (ierr .NE. merr_ok) status = ierr
+	  ENDIF
+
+ 100	CONTINUE
+
+	RETURN
+	END
diff --git a/fmt/src/tm_pack_string.F b/fmt/src/tm_pack_string.F
new file mode 100644
index 0000000..2462744
--- /dev/null
+++ b/fmt/src/tm_pack_string.F
@@ -0,0 +1,99 @@
+	SUBROUTINE TM_PACK_STRING(in_string,out_string,start,end,len_out)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* remove blanks and tabs from the designated portion of the string
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Thermal Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 03/04/87
+* 2/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead
+
+*
+* calling argument declarations:
+	INTEGER		start, end, len_out
+	CHARACTER*(*)	in_string, out_string
+
+* internal parameter declarations:
+	CHARACTER*1	tab
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+* internal variable declarations:
+	INTEGER	i_in, i_out, str_len, str_end
+
+* true string length
+	str_len = MIN( LEN(in_string), LEN(out_string) )
+	str_end = MIN( str_len, end )
+
+* transfer all characters until "start" to output string
+	DO 10 i_in = 1, start
+ 10	out_string( i_in:i_in ) = in_string( i_in:i_in )
+
+* pack the indicated region
+	i_out = start
+
+	DO 100 i_in = start, str_end
+* ... skip hole ?
+	   IF ( in_string( i_in:i_in ) .EQ. ' '
+     .	   .OR. in_string( i_in:i_in ) .EQ. tab ) GOTO 100
+
+* ... transfer character to output
+	   out_string( i_out:i_out ) = in_string( i_in:i_in )
+	   i_out = i_out + 1
+ 100	CONTINUE
+	   
+* transfer the remainder to the output
+	DO 200 i_in = str_end+1, str_len
+	   out_string( i_out:i_out ) = in_string( i_in:i_in )
+	   i_out = i_out + 1
+ 200	CONTINUE
+
+* length of packed output string
+	len_out = i_out - 1
+
+* blank out old shifted characters at right hand end
+	DO 300 i_out = i_out, str_len
+ 300	out_string(i_out:i_out) = ' '
+
+	RETURN
+	END
diff --git a/fmt/src/tm_park_last_version.F b/fmt/src/tm_park_last_version.F
new file mode 100644
index 0000000..011d759
--- /dev/null
+++ b/fmt/src/tm_park_last_version.F
@@ -0,0 +1,113 @@
+	SUBROUTINE TM_PARK_LAST_VERSION ( fname, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* rename any existing file of name fname to the current highest version of
+* that filename plus one
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix operating system
+*
+* rev 0.0 -   5/6/91
+* rev 1.0 -   10/17/91  -- <kob>
+*                        - extract path out of filename if it exists as part of
+*                           the filename. pass both filename and path to 
+*                           tm_next_ver_name.
+*SUN port - 2/92- kob-  ***Temporarily***
+*                         don't call tm_next_ver_name or tm_rename if running
+*                         on  a sun.  Merely append '.old' the the file
+*                         if it exists.  
+* 		comment out ifdef because posix version should work 3/92 kob
+* bug fix 1/94 *sh* - if path is included with file name then pass only the
+*			name as the first argument to TM_NEXT_VER_NAME
+*			Re-append path to the version name.
+*
+* IBM port 6/2/94 *kob* - Inherited length string concatenation error on IBM
+*			  aix compiler forces uses of risc_buff
+*
+* 1/03 - *kob* g77 port - Need to use risc_buff for arbitrary concatenations
+
+* calling argument declarations:
+      INTEGER       status
+      CHARACTER*(*) fname
+
+#ifdef unix
+      include 'tmap_errors.parm'
+#include "gt_lib.parm"
+      include 'xrisc_buff.cmn'
+
+* internal variable declarations:
+      LOGICAL there
+      CHARACTER*128  buff
+      INTEGER flen, TM_LENSTR1, i
+      INTEGER postslash
+* Initialize
+      status = merr_ok
+
+* does the file already exist ?
+      INQUIRE ( FILE=fname, EXIST=there )
+
+      IF ( .NOT.there ) RETURN
+
+* it already exists - rename it to the highest version
+* first extracting possible path out of filename  -- 10/91
+      IF ( INDEX( fname, PathSeparator) .GT. 0) THEN
+         flen = TM_LENSTR1(fname)
+         do 10 i = flen-1,1,-1
+            IF ( fname(i:i) .EQ. PathSeparator ) THEN
+               postslash = MIN(i+1,flen)     ! MIN if slash at end->dont crash
+               GOTO 11
+            ENDIF
+ 10      continue
+* ... next version with path name
+ 11      CALL TM_NEXT_VER_NAME( fname(postslash:), buff,
+     .			        fname(:postslash-1))
+  	 risc_buff = fname(:postslash-1)
+         CALL TM_RENAME( fname, risc_buff(:TM_LENSTR1(risc_buff))//buff, 
+     .                   status )
+      ELSE
+* ... next version in this directory
+         CALL TM_NEXT_VER_NAME(fname,buff,' ')
+         CALL TM_RENAME( fname, buff, status )
+      ENDIF
+
+      RETURN
+#else
+      STOP 'TM_PARK_LAST_VERSION is for Unix systems, only'
+#endif
+      END
+
diff --git a/fmt/src/tm_parse_string.F b/fmt/src/tm_parse_string.F
new file mode 100644
index 0000000..96df781
--- /dev/null
+++ b/fmt/src/tm_parse_string.F
@@ -0,0 +1,98 @@
+	SUBROUTINE TM_Parse_String ( instr, ndim, outary, nvals )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Will take the input string "instr" and separate the individual items at space,
+* tab, or commas. It will place the items in array outary, which is dimensioned
+* ndim, and then return number of items found in nvals. If more than ndim items
+* are found, then only ndim items will be saved, although total number of items
+* found will be reported in nvals.
+*
+* revision 0.00 - 08/14/89
+*
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+
+* Arguments:
+*	instr	- input string containing items to be parsed
+*	ndim	- dimension of outary
+*	outary	- array where individual items are stored
+*	nvals	- number of items found in instr
+*
+	INTEGER*4	ndim, nvals
+	CHARACTER*(*)	instr, outary(ndim)
+*
+* Local definitions
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+	CHARACTER*1	blank, comma, tab
+	PARAMETER      (blank = ' ',
+     .                  comma = ',',
+     .                	tab = 	'	')
+	INTEGER*4	ilen, pos, start
+*
+* Initialize
+	nvals = 0
+	ilen = LEN(instr)
+	pos = 1
+*
+* Locate non-blank, non-comma, non-tab
+  100	IF (pos .GT. ilen) GOTO 900
+	IF ( instr(pos:pos) .NE. blank .AND.
+     .	     instr(pos:pos) .NE. comma .AND.
+     .	     instr(pos:pos) .NE. tab         ) THEN
+	  start = pos
+	  GOTO 200
+	ENDIF
+	pos = pos + 1
+	GOTO 100
+*
+* Found start of item, find blank, comma, or tab to locate end of item
+  200	IF ( instr(pos:pos) .EQ. blank .OR.
+     .	     instr(pos:pos) .EQ. comma .OR.
+     .	     instr(pos:pos) .EQ. tab         ) GOTO 300
+	pos = pos + 1
+	IF (pos .GT. ilen) GOTO 300
+	GOTO 200
+*
+* Found end of item, store it.
+  300	nvals = nvals + 1
+	IF (nvals .LE. ndim) outary(nvals) = instr(start:pos-1)
+	GOTO 100
+*
+* End of string
+  900	RETURN
+	END
diff --git a/fmt/src/tm_path_list.F b/fmt/src/tm_path_list.F
new file mode 100644
index 0000000..0023ebb
--- /dev/null
+++ b/fmt/src/tm_path_list.F
@@ -0,0 +1,340 @@
+	CHARACTER*(*) FUNCTION TM_PATH_LIST( path_list, fname, 
+     .                               def_ext, do_errmsg, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* locate the file, filename, with default file extension, def_ext
+* (it is acceptable for fname to be blank with the full path given in
+*  path_list )
+
+* on unix systems path_list may be a list of directories separated be blanks
+* on VMS systems it may be a logical name terminated with a colon
+
+* append default file extension, def_ext, if file has none
+* (def_ext is assumed to begin with a ".")
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 3/9/91
+*
+* revision 1.0 - 10/17/91 <kob> Relative Version Numbers
+*
+*  Sun Port 1/30/92 -kob-  added 'ifdef sun' because SUN uses BYTE
+*                          where DECstation uses INTEGER*1
+*  10/21/92 *sh* changed INQUIRE to OPEN/CLOSE because of incompatibility
+*                bug between DEC f772.1 INQUIRE and Multinet VMS/nfs files 
+*                (search for "f772.1" to find patches)
+* 5/93 *sh* removed the INQUIRE bug fix - now on f77 3.0
+* 5/93 *sh* 2 weeks later - restore INQUIRE patch - bug still in f77 ?
+*          (PLOT+ fails to find default.spk)
+* 4/94 *sh* small change in error message to add " (.des)"
+* 11/96 *sh* changed ifdef sun to ifdef inquire_not_nfs_compatible
+*	     ... maybe the Muktinet problem has been resolved (??
+*	     The use of OPEN instead of INQUIRE fails to allow directories
+*	     as valid, existing files. This is a problem for Ferret's
+*	     LIST/FORMAT=cache/FILE=directory  (DODS caching)
+* 7/97 *kob* Minor modification to error reporting.  Don't want to output
+*            a default extension, if an explicit extension is used.
+* 12/97 - *kob* - added check for "~/xxx" because it was cashing core dump
+*  1/99 - js - on PC's, path separator is ';' rather than ' '
+* v5.41 5/02 *acm* - If there are .'s within the filename, the logic for adding
+*                    the extension is not adequate (statement 50). When file not
+*                    found, go back and see if adding the extension works.
+* v5.50 10/02 *acm*- path_buff longer to accomodate longer s_filename 
+*                    in descript.def
+* v5.42 10/02 *kob* - Increase size of temp_fname to 512
+* V6.04  7/07 *acm* - increase size of dataset names to 1024. 
+
+
+* calling argument declarations:
+      LOGICAL       do_errmsg
+      INTEGER       status
+      CHARACTER*(*) path_list, fname, def_ext
+
+**************************** UNIX **********************************
+
+* local variable declarations
+      LOGICAL TM_F7721BUG_INQUIRE   ! temporary bug fix for f772.1
+      INTEGER slen
+      PARAMETER ( slen = 1024)
+      INTEGER TM_LENSTR1, TM_LENSTR
+      INTEGER start, end, plen, flen, len_pbuff, postslash, i
+      INTEGER tilde, tilde_len, dot,path_len,lext           
+      INTEGER vers_int,vers_len,end_tilde,path_tries
+      LOGICAL file_exist,pos_ver,zero_ver
+      LOGICAL relative, dot_next_to_tilde, retry_ext
+      CHARACTER  ext*8, path_buff*1024,suffix*16,TM_LEFINT*8
+      CHARACTER  tilde_buff*8,vers_no*8,temp_fname*1024
+
+	
+*
+#ifdef sun
+      BYTE      nhol(slen), vhol(slen),fhol(slen),phol(slen)
+                                !c-type Hollerith string buffers
+#else
+      INTEGER*1 nhol(slen), vhol(slen),fhol(slen),phol(slen)
+                                !c-type Hollerith string buffers
+#endif
+*
+      include 'tmap_errors.parm'
+#include "gt_lib.parm"
+
+* initialize
+      retry_ext = .false.
+
+  60  CONTINUE
+*      end = 0          10/91
+      end = -1
+      path_tries = 0
+      plen = LEN( path_list )
+      flen = TM_LENSTR1( fname )
+      status = merr_erreq
+      pos_ver= .false.
+      zero_ver = .false.
+      dot_next_to_tilde = .false.
+
+* check for relative version number in file name. eg ferret.jnl.~nnn~
+* If nnn > or = 0 then relative is false, else it is true.
+*
+* scan the whole filename and set dot equal to the last period in
+* the filename. e.g. for ferret.jnl.~-1~ dot would be 11
+      dot = 0
+      do 5 i=1,flen
+         if (fname(i:i) .EQ. '.')
+     .        dot = i
+ 5              continue
+              
+* set the tilde buff to be either ".~nnn~" or blank. Also reset filename
+* length so that it doesn't include the ".~nnn~"
+*
+* kob 12/9/97 - "go ~/xxxx" caused a crash, and the reason is that in that 
+*                instance, fname is only length 1, so tilde+1 exceeds the 
+*                bounds - 
+      tilde = INDEX(fname,'~')
+      flen = LEN(fname)
+      IF (tilde .EQ. flen) THEN
+	 end_tilde = INDEX(fname(tilde:), '~')
+      ELSE
+	 end_tilde = INDEX(fname(tilde+1:), '~')
+      ENDIF
+      if (dot .EQ. tilde-1) dot_next_to_tilde = .true.
+
+* if tilde eq flen, then this isn't  a relative version issue *kob* 2/98
+      if (tilde .EQ. 0 .OR. tilde .EQ. flen) then
+         tilde_buff = ' '
+      elseif ((tilde .GT. 0) .AND. (dot_next_to_tilde)) THEN
+         flen = tilde - 2
+         tilde_buff = fname(tilde-1: )
+         path_buff = fname(:flen)
+      else
+         flen = tilde -1
+         tilde_buff = fname(tilde: )
+         path_buff = fname(:flen)
+      endif
+
+* set the relative flag accordingly
+      relative = .false.
+* if tilde eq flen, then this isn't  a relative version issue *kob* 2/98
+      if (tilde .EQ. 0 .OR. tilde .EQ. flen) then
+         goto 50
+      elseif (fname(tilde+1:tilde+1) .EQ. '0') then
+         zero_ver = .true.
+      elseif (fname(tilde+1:tilde+1) .NE. '-') then
+         pos_ver = .true.
+      else
+         relative = .true.
+      endif   
+
+* apply default extension if filename doesn't have one
+* must check if there is a "dot" but ...
+* avoid detecting "../path/name" as a significant "dot"
+
+ 50      IF ( INDEX( fname(:flen), '.' ) .GT. 0 .AND. 
+     .        .NOT. retry_ext)  THEN
+
+         lext = INDEX( fname(:flen), '.' )      ! just to see what this is...
+         ext = ' '
+         lext= 0
+      ELSE
+         ext = def_ext
+         lext = TM_LENSTR1(ext)
+      ENDIF
+
+* does the filename contain its own path ?
+
+      flen = TM_LENSTR1( fname )
+
+      IF ( path_list .EQ. ' ' ) THEN
+         IF ( fname .EQ. ' ' ) GOTO 1000   ! INQUIRE bug: blank name exists
+         path_buff = fname(:flen)//ext
+         end = plen    ! flag not to continue search after one try
+         GOTO 200
+      ENDIF
+
+* find start of next path text (non-blank)
+ 100  IF ( end .ge. plen - 2 ) GOTO 1000   ! possible path list truncation
+*      DO 101 start = end+1, plen            10/91
+      DO 101 start = end+2, plen
+ 101  IF ( path_list(start:start) .NE. EnvSeparator ) GOTO 110
+* no more paths
+      GOTO 1000
+
+* find end of path name (last non-blank) (note: mandatory blank at end)
+ 110  end = INDEX(path_list(start+1:plen), EnvSeparator) + start - 1
+      if (end .lt. start) then
+         end = plen-1
+      endif
+
+* check path name and file name
+* note: FORTRAN/RISC compiler doesn't permit // with character*(*)
+*      (yet it is working w/ fname(:flen) ... perhaps it requires explicit len
+      IF ( fname .EQ. ' ' ) THEN
+* ... filename is contained in the path list environment variable
+         path_buff = path_list(start:end)
+      ELSEIF ( pos_ver) then
+            IF (dot_next_to_tilde) then
+                path_buff = path_list(start:end)//PathSeparator
+     .           //fname(:flen)//ext(:lext)//tilde_buff
+            ELSE
+                 path_buff = path_list(start:end)//PathSeparator
+     .              //fname(:flen)//ext(:lext)//'.'//tilde_buff
+            ENDIF
+            IF (end_tilde .EQ. 0) THEN
+               len_pbuff = TM_LENSTR1( path_buff )
+               path_buff = path_buff(:len_pbuff)//'~'
+            ENDIF
+      ELSE
+         path_buff = path_list(start:end)//PathSeparator
+     .              //fname(:flen)//ext
+      ENDIF
+
+* for relative versions, we need to convert the tilde_buff, filename
+* and path list to c strings and pass them in to tm_make_relative_ver
+* which will return the proper version number for the file to open
+ 200  if ( relative) then
+            temp_fname = fname(:flen)//ext
+            path_len = TM_LENSTR1(temp_fname)
+            tilde_len = TM_LENSTR1( tilde_buff )
+            CALL TM_FTOC_STRNG( tilde_buff(:tilde_len), nhol, slen)
+            CALL TM_FTOC_STRNG(temp_fname(:path_len) , fhol, slen)
+            CALL TM_FTOC_STRNG(path_list(start:end),phol,slen)
+            call TM_MAKE_RELATIVE_VER(nhol, fhol,phol,vers_int)
+*            call TM_CTOF_STRNG( vhol, vers_no, slen)
+            vers_no =  TM_LEFINT(vers_int,vers_len)
+            path_len = TM_LENSTR1(path_buff)
+            path_buff = path_buff(:path_len)//'.'//'~'
+     .                      //vers_no(:vers_len)//'~'
+         endif
+      len_pbuff = TM_LENSTR1( path_buff )
+* INQUIRE bug check was added for f772.1 problem.
+* the INQUIRE check was commented out 5/13/93 for f77 3.2
+* but was restored May 28 cuz the bug was still there
+* on June 9 this comment was removed from the ifdef line
+* On 11/96 the ifdef sun was changed to ifdef inquire_not_nfs_compatible
+* (and the ifdef logic was reversed)
+* 7/2007 When increasing length of dataset names, in particular for long 
+* DODS file names. Apparently the first argument to INQUIRE cannot be 
+* longer than 256, it causes a bus error, overwriting other vars. This
+* is handled in the calling routine tm_inq_path.
+
+#ifdef inquire_not_nfs_compatible
+! temporary routine needed because of incompatibility between DEC f772.1 and
+! Multinet nfs-mounted files (files sometimes not found)  *sh* 10/21/92
+      file_exist = TM_F7721BUG_INQUIRE( path_buff( :len_pbuff ) )
+#else
+      INQUIRE ( FILE		= path_buff( :len_pbuff ) ,
+     .			EXIST		= file_exist,
+     .			ERR 		= 5000)
+* took out NAME statement because v3.0 of f77 didn't dig it ------kob 10/8/91
+*     .		   	NAME		= TM_PATH_LIST,
+#endif
+      IF ( file_exist ) GOTO 1100
+
+* try next path in list
+      path_tries = path_tries + 1
+      GOTO 100
+
+* file not found
+ 1000 CONTINUE
+
+* try forcing addition of the default extension -- if there are internal .'s 
+* in the filename, the IF test at Statement# 50 is not adequate.  Go back, 
+* reinitialize everything, and try again.
+
+      IF (.NOT. retry_ext) THEN
+         ext = def_ext
+         lext = TM_LENSTR1(ext)
+         retry_ext = .TRUE.
+         GO TO 60
+      ENDIF
+
+* file still not found
+
+      TM_PATH_LIST = ' '
+      status = merr_notmounted
+      IF ( do_errmsg ) THEN
+         GOTO 5000
+      ELSE
+         RETURN
+      ENDIF
+
+* successful exit
+* set TM_PATH_LIST to path_buff because v3.0 of f77 won't let this happen in INQUIRE -10/8/91
+ 1100 status = merr_ok
+      TM_PATH_LIST = path_buff( :len_pbuff)
+      RETURN
+
+* error exits
+* 7/97 *kob* mods to not include a default extension in error message if
+*            an explicit extension is used
+ 5000 lext = TM_LENSTR(def_ext)      !can now be zero 7/97
+      if (path_list(1:1) .EQ. '.' .OR. path_tries .GT. 1) then
+         path_buff = fname(:TM_LENSTR1(fname))
+	 if ( lext .GT. 0 ) path_buff = path_buff(:TM_LENSTR1(path_buff))
+     .				//' ('//def_ext(1:lext)//')' ! *sh* 4/94,11/94
+      else 
+         path_buff = path_list(:plen-1)//PathSeparator//fname
+      endif
+      len_pbuff = TM_LENSTR1(path_buff) ! *sh* 4/94
+      CALL TM_ERRMSG (status, status, 'TM_PATH_LIST',
+     .                unspecified_int4, no_stepfile,
+     .                path_buff(:len_pbuff), 
+     .                no_errstring, *9900)
+ 9900 RETURN
+
+      END
diff --git a/fmt/src/tm_purge_tmp_grids.F b/fmt/src/tm_purge_tmp_grids.F
new file mode 100644
index 0000000..e1b514b
--- /dev/null
+++ b/fmt/src/tm_purge_tmp_grids.F
@@ -0,0 +1,101 @@
+	SUBROUTINE TM_PURGE_TMP_GRIDS( status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* This routine is normally called only for error conditions that occur
+* in the midst of building grids and axes for netCDF files.
+* The goal is to throw away all of the in-progress work on grids and
+* axes, including allocations (use count increments) of axes that came
+* from other data sets.
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Include files
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+        include 'xtm_grid.cmn_text'
+        include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER status
+
+* Local variable declarations
+	INTEGER grid, line, idim
+
+
+* over temporary grids
+ 100	CONTINUE
+	   grid = 0	! to get start of list
+	   CALL TM_NEXT_TMP_GRID(grid, *300)
+
+* deallocate axes used by grid (NOTE: only dynamic axes are used by netCDF!)
+	   DO 200 idim = 1, nferdims
+	      IF ( grid_line(idim, grid) .GT. max_lines ) THEN
+	         CALL TM_DEALLO_DYN_LINE( grid_line(idim, grid) )
+	      ELSEIF (  grid_line(idim, grid) .NE. mpsnorm ) THEN
+	         CALL TM_NOTE('tm intern err: netCDF grid w/ static axis'
+     .			 ,lunit_errors)  ! should never happen
+	      ENDIF
+ 200	   CONTINUE
+
+	   CALL TM_DEALLO_DYN_GRID( grid )
+	GOTO 100
+
+* remove any stray lines that were never incorporated into grids
+ 300	CONTINUE
+	   line = 0		! to get start of list
+ 	   CALL TM_NEXT_TMP_LINE(line, *1000)
+
+* deallocate axes used by grid (NOTE: only dynamic axes are used by netCDF!)
+	   DO 400 idim = 1, nferdims
+	      IF ( line .GT. max_lines ) THEN
+	         IF (line_use_cnt(line) .GT. 1) CALL TM_NOTE(
+     .			'tm intern err: line over alloc.',lunit_errors)
+	         CALL TM_DEALLO_DYN_LINE( line )
+	      ELSEIF (  line .NE. mpsnorm ) THEN
+	         CALL TM_NOTE('intern err: netCDF static axis'
+     .			 ,lunit_errors)  ! should never happen
+	      ENDIF
+ 400	   CONTINUE
+
+	GOTO 300
+
+* successful completion
+ 1000	RETURN
+
+ 	END
diff --git a/fmt/src/tm_re_allo_tmp_grid.F b/fmt/src/tm_re_allo_tmp_grid.F
new file mode 100644
index 0000000..3f9b665
--- /dev/null
+++ b/fmt/src/tm_re_allo_tmp_grid.F
@@ -0,0 +1,85 @@
+	SUBROUTINE TM_re_allo_tmp_grid( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* The input grid is currently stored in the tmp linked list.
+*This routine shifts it to the dynamic grid list.
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER grid
+
+* Local definitions
+	INTEGER next_used_grid,  next_free_grid 
+
+* it is not necessary to do this in 2 stages, but it was simpler --
+* just hacked from well-tested code
+
+* take this grid from the "tmp" list and put it on the "free" list
+* ... hook onto free list
+	   next_used_grid   = grid_flink(grid)
+	   grid_flink(grid) = grid_free_ptr  
+	   grid_free_ptr    = grid
+	   
+* ... unhook from used list
+	   grid_flink(grid_blink(grid)) = next_used_grid
+	   grid_blink(next_used_grid)   = grid_blink(grid)
+
+* take off the "free" list and put it at the start of the "used" list
+* ... unhook from free list
+	   next_free_grid  	= grid_flink(grid)
+	   grid_free_ptr	= next_free_grid
+* ... hook onto front of used list
+	   grid_flink(grid)	 = grid_flink(max_grids)
+	   grid_blink(grid)	 = max_grids
+	   grid_flink(max_grids) = grid
+	   grid_blink(grid_flink(grid))	= grid
+
+	RETURN
+	END
+
diff --git a/fmt/src/tm_re_allo_tmp_line.F b/fmt/src/tm_re_allo_tmp_line.F
new file mode 100644
index 0000000..a6b81fd
--- /dev/null
+++ b/fmt/src/tm_re_allo_tmp_line.F
@@ -0,0 +1,85 @@
+	SUBROUTINE TM_re_allo_tmp_line( line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+* The input line is currently stored in the tmp linked list.
+* This routine shifts it to the dynamic line list.
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* V510 *sh* 3/00
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xio.cmn_text'
+
+* Argument definitions
+	INTEGER line
+
+* Local definitions
+	INTEGER next_used_line,  next_free_line 
+
+* it is not necessary to do this in 2 stages, but it was simpler --
+* just hacked from well-tested code
+
+* take this line from the "tmp" list and put it on the "free" list
+* ... hook onto free list
+	   next_used_line   = line_flink(line)
+	   line_flink(line) = line_free_ptr  
+	   line_free_ptr    = line
+	   
+* ... unhook from used list
+	   line_flink(line_blink(line)) = next_used_line
+	   line_blink(next_used_line)   = line_blink(line)
+
+* take off the "free" list and put it at the start of the "used" list
+* ... unhook from free list
+	   next_free_line  	= line_flink(line)
+	   line_free_ptr	= next_free_line
+* ... hook onto front of used list
+	   line_flink(line)	 = line_flink(max_lines)
+	   line_blink(line)	 = max_lines
+	   line_flink(max_lines) = line
+	   line_blink(line_flink(line))	= line
+
+	RETURN
+	END
+
diff --git a/fmt/src/tm_read.F b/fmt/src/tm_read.F
new file mode 100644
index 0000000..10eacd5
--- /dev/null
+++ b/fmt/src/tm_read.F
@@ -0,0 +1,290 @@
+	SUBROUTINE TM_READ ( dset_num, variable,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride,
+     .		data_grid, file_num, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* Determines if a read request for a nferdims-D block of data (3D, 2D being degenerate
+* cases w/ 1 dimension being 1 time series) from TMAP data sets contains a 
+* modulo axis. Arranges calls to TM_CHOOSE_READ accordingly.
+*
+* written 10/24/88 by M. Verschell for PMEL/TMAP
+*
+* revision 0.00	- 10/24/88 - initial incarnation
+* revision 0.01 - 12/15/88 - changed variable to *(*) from *8
+* revision 0.10 - 01/24/89 - Bug fixes to fully implement modulo axis
+* revision 0.11 - 02/08/89 - Bug fix to 2nd modulo read IF-test
+* revision 0.20 - 02/08/89 - TM_READ now finds modulo axis and checks for 1 only
+* revision 0.30 - 12/06/89 - changed arrays for dimensions to single variables
+* revision 0.40 - 02/27/90 - multiple modulo axis provided only 1 used in read
+* revision 0.41 - 4/91 *sh* Unix/RISC port: upcase the variable code and use
+*                           in error message
+* revision 0.5  - 11/92 *sh* increased variable name lengths to 24 characters
+* *sh* 7/98 V4.91 - want to allow case-sensitive variables in single quotes
+*       so dont upcase the variable name when comparing (why was it
+*       upcased, anyway??)
+* V500 4/99 *kob*: increase upcase_var 24 --> 64 chars matching passed vname
+*      5/99 *sh* - added strides to CD_READ call
+* V552 5/03 *acm*: increase size of upcase_var from 64 to 128 chars
+* V602 9/06 *jli*  Changes for native strides
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+*
+* include files
+	include 'tmap_dims.parm'		! data set dimension
+#include "gt_lib.parm"
+	include 'tmap_errors.parm'		! err code parm defs
+	include 'xtm_grid.cmn_text'		! grid info
+		include 'xdset_info.cmn_text'	! data set info common
+	external xdset_info_data
+
+* arguments:
+*	dset_num    - internal data set # (from TM_INIT_DSET)
+*	variable    - name of desired variable in data set
+*	actual_dims - "a_" full dimensions of data_grid array passed
+*	use_dims    - indices of model data block desired
+*	data_grid   - array containing model data (output)
+*	file_num    - file number (output)
+*	status      - error status upon completion (output)
+*
+	CHARACTER*(*)	variable
+	INTEGER		dset_num, file_num, status
+	INTEGER		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f, 
+     .                  a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .			use_lo(*), use_hi(*), stride(*)
+        REAL            data_grid(a_lo_x:a_hi_x,
+     .                            a_lo_y:a_hi_y,
+     .                            a_lo_z:a_hi_z,
+     .                            a_lo_t:a_hi_t,
+     .                            a_lo_e:a_hi_e,
+     .                            a_lo_f:a_hi_f)
+
+* local definitions
+        INTEGER         STR_UPCASE, TM_LENSTR1, n, num_indices
+
+	INTEGER		lcnt, modline, ivar, varpos, pcnt, istat,
+     .			i, j, k, l, in, jn, kn, ln, vargrid, thisline,
+     .			Dstart, Dend, Drange,
+     .			Rstart, Rend, Rrange,
+     .			Tstart, Tend, Trange
+	INTEGER		i_lo, j_lo, k_lo, l_lo, m_lo, n_lo, 
+     .			i_hi, j_hi, k_hi, l_hi, m_hi, n_hi,
+     .			iadj, jadj, kadj, ladj, madj, nadj
+	INTEGER		tmp_lo(nferdims), tmp_hi(nferdims), 
+     .			adj_lo(nferdims), adj_hi(nferdims),
+     .			adj(nferdims), actual_lo(nferdims), 
+     .			actual_hi(nferdims)
+        CHARACTER*128    upcase_var
+	EQUIVALENCE	(tmp_lo(1),i_lo),
+     .			(tmp_lo(2),j_lo),
+     .			(tmp_lo(3),k_lo),
+     .			(tmp_lo(4),l_lo),
+     .			(tmp_lo(5),m_lo),
+     .			(tmp_lo(6),n_lo)
+	EQUIVALENCE	(tmp_hi(1),i_hi),
+     .			(tmp_hi(2),j_hi),
+     .	  		(tmp_hi(3),k_hi),
+     .			(tmp_hi(4),l_hi),
+     .			(tmp_hi(5),m_hi),
+     .			(tmp_hi(6),n_hi)
+	EQUIVALENCE	(adj(1),iadj),
+     .			(adj(2),jadj),
+     .			(adj(3),kadj),
+     .			(adj(4),ladj),
+     .			(adj(5),madj),
+     .			(adj(6),nadj)
+
+* initialize
+
+	actual_lo(1) = a_lo_x
+	actual_lo(2) = a_lo_y
+	actual_lo(3) = a_lo_z
+	actual_lo(4) = a_lo_t
+	actual_lo(5) = a_lo_e
+	actual_lo(6) = a_lo_f
+	actual_hi(1) = a_hi_x
+	actual_hi(2) = a_hi_y
+	actual_hi(3) = a_hi_z
+	actual_hi(4) = a_hi_t
+	actual_hi(5) = a_hi_e
+	actual_hi(6) = a_hi_f
+!        istat = STR_UPCASE( upcase_var, variable )     ! 4/91
+        upcase_var = variable     ! 7/98
+
+* check for valid variable and get variable number
+*	DO 100 ivar = 1,maxvars
+*	  IF ((ds_var_setnum(ivar) .EQ. dset_num) .AND.
+*     .	    (ds_var_code(ivar) .EQ. upcase_var)) THEN
+*	    varpos = ivar
+*	    GOTO 110
+*	  ENDIF
+*  100	CONTINUE
+
+        CALL string_array_find_exact(ds_var_code_head,
+     .                               upcase_var,
+     .                               LEN(upcase_var),
+     .                               string_array_result1(1),
+     .                               maxvars,
+     .                               num_indices)
+        DO 100 n = 1, num_indices
+            ivar = string_array_result1(n)
+            IF ( ds_var_setnum(ivar) .EQ. dset_num) THEN
+	        varpos = ivar
+	        GOTO 110
+            ENDIF
+  100	CONTINUE
+	GOTO 9000
+
+* Is it a Modulo set - If not call TM_CHOOSE_READ w/o modification
+* if it is - get the modulo line, and make sure at this time there's only 1
+* axis needing a modulo read call.
+  110	vargrid = ds_grid_number(varpos)
+	modline = 0
+	DO 120 lcnt = 1,nferdims
+	  thisline = grid_line(lcnt,vargrid)
+	  IF (thisline .EQ. mpsunkn .OR. thisline .EQ. mpsnorm) GOTO 120
+	  IF (line_modulo(thisline)) THEN
+
+	    IF (use_lo(lcnt) .GE. 1 .AND.
+!     .	        use_hi(lcnt) .LE. line_dim(thisline)) GOTO 120
+     .         use_hi(lcnt) .LE. ds_grid_end(lcnt,varpos)) GOTO 120
+
+	    IF (modline .NE. 0) GOTO 9100
+	    modline = lcnt
+	  ENDIF
+  120	CONTINUE
+	
+	IF (modline .EQ. 0) THEN
+	  CALL TM_CHOOSE_READ ( dset_num, varpos,
+     .		a_lo_x, a_lo_y, a_lo_z, a_lo_t, a_lo_e, a_lo_f,
+     .		a_hi_x, a_hi_y, a_hi_z, a_hi_t, a_hi_e, a_hi_f,
+     .		use_lo, use_hi, stride,
+     .		data_grid, file_num, status )
+	  IF (status .NE. merr_ok) GOTO 9999
+
+* It's modulo : Set-up
+* D = Defining Axis    : the axis that the data is stored on
+* R = Requested Axis   : the axis requested by the user (not necessarily in the
+*                        range of the Defining axis)
+* T = Transformed Axis : the R axis translated by a MOD function so that it
+*                        starts somewhere in the Defining axis
+	ELSE
+	  Dstart = 1
+	  Drange = line_dim(grid_line(modline,vargrid))
+	  Dend = Drange - Dstart + 1
+	  Rstart = use_lo(modline)
+	  Rend = use_hi(modline)
+	  Rrange = Rend - Rstart + 1
+	  Tstart = MOD(Rstart-1,Drange) + 1
+	  IF (Tstart .LE. 0) Tstart = Tstart + Drange
+	  Tend = Tstart + Rrange - 1
+	  Trange = Rrange
+
+* Read #1 - always done
+	  DO 130 pcnt = 1,nferdims
+	    tmp_lo(pcnt) = use_lo(pcnt)
+	    tmp_hi(pcnt) = use_hi(pcnt)
+	    adj_lo(pcnt) = actual_lo(pcnt)
+	    adj_hi(pcnt) = actual_hi(pcnt)
+  130	  CONTINUE
+	  tmp_lo(modline) = Tstart
+	  tmp_hi(modline) = MIN(Dend,Tend)
+	  adj_lo(modline) = actual_lo(modline) - (Rstart - Tstart)
+	  adj_hi(modline) = actual_hi(modline) - (Rstart - Tstart)
+	  CALL TM_CHOOSE_READ ( dset_num, varpos,
+     .		adj_lo(1),adj_lo(2),adj_lo(3),adj_lo(4),adj_lo(5),adj_lo(6),
+     .		adj_hi(1),adj_hi(2),adj_hi(3),adj_hi(4),adj_hi(5),adj_hi(6),
+     .		tmp_lo, tmp_hi, stride,
+     .		data_grid, file_num, status )
+	  IF (status .NE. merr_ok) GOTO 9999
+
+* Read #2 - optional depending on length & position of Requested grid
+	  IF (Tend .GT. Dend .AND. Tstart .NE. 1) THEN
+	    tmp_lo(modline) = Dstart
+	    tmp_hi(modline) = MIN(Tstart-1,Tend-Drange)
+	    adj_lo(modline) = adj_lo(modline) - Drange
+	    adj_hi(modline) = adj_hi(modline) - Drange
+	    CALL TM_CHOOSE_READ ( dset_num, varpos,
+     .		adj_lo(1),adj_lo(2),adj_lo(3),adj_lo(4),adj_lo(5),adj_lo(6),
+     .		adj_hi(1),adj_hi(2),adj_hi(3),adj_hi(4),adj_hi(5),adj_hi(6),
+     .		tmp_lo, tmp_hi, stride,
+     .		data_grid, file_num, status )
+	    IF (status .NE. merr_ok) GOTO 9999
+	  ENDIF
+
+* Data duplication (NOTE: tmp_lo,tmp_hi are equivalenced with i,j,k,l _lo & _hi)
+*                  (NOTE: adj is equivalenced with i,j,k,l _adj)
+	  IF (Trange .GT. Drange) THEN
+	    tmp_lo(modline) = Rstart+Drange
+	    tmp_hi(modline) = Rend
+	    DO 140 pcnt = 1,nferdims
+	      adj(pcnt) = 0
+  140	    CONTINUE
+	    adj(modline) = Drange
+	    DO 180 ln = l_lo,l_hi
+	      l = ln - ladj
+	      DO 170 kn = k_lo,k_hi
+	        k = kn - kadj
+	        DO 160 jn = j_lo,j_hi
+	          j = jn - jadj
+	          DO 150 in = i_lo,i_hi
+	            i = in - iadj
+	            data_grid(in,jn,kn,ln,-999,-999) = 
+     .			   data_grid(i,j,k,l,-999,-999)	
+  150	          CONTINUE
+  160	        CONTINUE
+  170	      CONTINUE
+  180	    CONTINUE
+	  ENDIF
+	ENDIF
+	status = merr_ok
+	GOTO 9999
+
+* ERRORS
+* note: use upcase_var instead of "variable" to avoid RISC // prob. w/ CHAR*(*)
+ 9000   l = TM_LENSTR1(upcase_var)
+	CALL TM_ERRMSG (merr_unkvar, status, 'TM_READ',
+     .			dset_num, no_stepfile,
+     .			'VAR='//upcase_var(:l), no_errstring, *9999)
+Cf77     .			'VAR='//variable, no_errstring, *9999)
+ 9100	CALL TM_ERRMSG (merr_notsupport, status, 'TM_READ',
+     .			dset_num, no_stepfile,
+     .			'only 1 axis at a time can have a modulo read',
+     .			no_errstring, *9999)
+
+ 9999	RETURN
+	END
diff --git a/fmt/src/tm_read_gridfile.F b/fmt/src/tm_read_gridfile.F
new file mode 100644
index 0000000..8454a1a
--- /dev/null
+++ b/fmt/src/tm_read_gridfile.F
@@ -0,0 +1,656 @@
+	SUBROUTINE TM_READ_GRIDFILE ( gfile_name, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Reads in grid and line definitions and coordinates from a specified .GRD file
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 1.00 - 05/17/87 - by Mark Verschell for PMEL/TMAP
+* revision 1.10 - 08/17/88 - added removal of grid/lines defined by bad file
+* revision 1.11 - 08/18/88 - loops from max,1 to find empty storage
+* revision 1.12 - 08/20/88 - old name GT_READ_GRIDFILE, called from TM_INIT_DSET
+* revision 2.00 - 10/05/88 - new procedures for detection of duplicates
+*			     Duplicated name/defn is ignored.
+*			     Duplicated name, new defn is an error.
+* revision 2.10 - 10/25/88 - Modulo flag added for lines definitions
+* revision 2.11 - 11/21/88 - variable used checks changed to char_initXX
+* revision 2.20 - 11/22/88 - Removed references to dset_num.
+* revision 2.30 - 11/29/88 - True check for unknown and normal axis. Grid_line
+*			     now flagged with mpsunkn or mpsnorm.
+* revision 2.40 - 12/12/88 - Changes to make use of next_line_mem_pos, including
+*			     resetting it if error occurs, and incrementing it
+*			     only when line defined and checked for duplication.
+* revision 2.41 - 12/13/88 - Added call TM_FIND_*_SLOT to determine open space
+* revision 2.50 - 12/15/88 - Reads E/W as long. N/S as lat. for regular axis
+* revision 2.60 - 12/19/88 - Reads time axis info, added TIME definition to the
+*			     gridfile format to get t0 and tunit for timeaxis
+* revision 2.70 - 01/13/89 - Any line that isn't a GRID/LINE/TIME/COORD/Comment 
+*			     is not a warning message; doesn't read tunit from
+*			     TIME line - gets it from un_convert
+* revision 2.71 - 01/23/89 - Moved next_line_mem_pos save to before INQUIRE.
+* revision 2.72 - 02/17/89 - Fixed next_line_mem_pos error (1 less than correct)
+* revision 2.73 - 01/20/91 - added ifdef unix for default file
+* Unix/RISC port - 4/24/91 *sh*: uses TM_INQ_PATH to locate grid file
+*                              : changed "WARNING" to "Note"
+*                              : allowed axis units of "none" or "n/a"
+*                        10/91 : "grd" --> ".grd" for default extension
+* bug fix - 10/2/91 - commented out statments 9000 and 9710 because there were
+*                      no paths to these statements.  This was caught by ver.3
+*                      of f77, but not ver. 2.1  ---kob
+* bug fix - 6/24/92 - allow blank lines in gridfile
+* bug fix - 1/4/93 *sh* - many error exits closed the unopened lunit
+*                       - I added variable "opened"
+* IBM Port- 4apr94 *kob* : readonly not allowed in file open statement
+*			 : with IBM xlf compiler, added "ifdef" check
+* *sh* 3/2/95 - informative messages issued through TM_NOTE (for GUI)
+* *sh* 9/95 (for V420): axes need not have T0 to be valid.  Disable this check.
+* 10/96 *kob* - Linux port - had to move variable assignments off of
+*		declaration line.
+* V500: 7/99 *sh* - bug fix: need consistent use of char_init16 on line_name
+* V510: *sh* 8/99 bug fix: grid_out_prod not set for NORMAL axis
+*			(see err500_del_var_corruption)
+*	     4/00 - netCDF files now defining dynamic grids and axes. Need
+*		to check among these for previously defined objects
+* V541: *sh* 2/02 - minor change to set line_modulo_len
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V65  *acm* 2/10- all warnings and notes to std error not std out
+
+* arguments
+	CHARACTER*(*)	gfile_name
+	INTEGER*4	status
+
+        include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+	include 'xio.cmn_text'
+	external xio_data
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+	include 'xunits.cmn_text'
+	external xunits_data
+        include 'xsys_names.cmn_text'
+        external xsys_names_data
+
+
+* local definitions
+* *kob* explicit definitions not allowed on decl line in linux...
+*       moved it to parameter line 10/96
+	CHARACTER*6	grid_define, line_define, coords_define,
+     .			time_define, comment_char
+        CHARACTER       def_ext*4
+	CHARACTER*13	TM_STRING
+	CHARACTER*25	buff(11), newline
+	CHARACTER*80	def_error
+        CHARACTER*128   TM_INQ_PATH, gfile_path
+	CHARACTER*132	TM_CMPRSS, input_buf, cmprss_buf
+	INTEGER*4	lunit, i, j, ipt1, ipte, npts,
+     .			cline, tline, temp
+	PARAMETER	(temp = 0)		!kob 10/96
+	INTEGER*4	p_gname, p_gline(4), p_grot, p_lname, p_llen,
+     .			p_ldirect, ngrid, nline, istat, p_goutp(4),
+     .			p_lunits, p_lstart, p_ldelta, p_cform, p_lstore,
+     .			p_modulo, p_lbox0, p_t0, inner, outer, newgrid,
+     .			g_used, l_used, orig_line_mem_pos, dim
+	LOGICAL		reg_coords, irreg_coords
+	REAL*8		rdummy
+	INTEGER*4	TM_UNIT_ID, STR_CASE_BLIND_COMPARE,
+     .			TM_FIND_GRID_SLOT, TM_FIND_LINE_SLOT
+	LOGICAL		opened
+	LOGICAL		TM_HAS_STRING, TM_GRID_MATCH, TM_LINE_MATCH,
+     .			TM_CHECK_BOX_LOC
+
+	DATA		p_gline/4, 6, 8, 10/
+	DATA		p_goutp/5, 7, 9, 11/
+	DATA            def_ext/'.grd'/
+
+	PARAMETER	(grid_define	= 'GRID  ',
+     .			 line_define	= 'LINE  ',
+     .			 coords_define	= 'COORDS',
+     .			 time_define	= 'TIME  ',
+     .			 comment_char	= '*     ')
+
+	PARAMETER	(p_gname	= 2,
+     .			 p_grot		= 3,
+     .			 p_lname	= 2,
+     .			 p_llen		= 3,
+     .			 p_ldirect	= 4,
+     .			 p_lunits	= 5,
+     .			 p_lstore	= 6,
+     .			 p_lstart	= 7,
+     .			 p_ldelta	= 8,
+     .			 p_modulo	= 9,
+     .			 p_cform	= 3,
+     .			 p_lbox0	= 4,
+     .			 p_t0		= 3)
+
+* Store original start of free line memory
+	orig_line_mem_pos = next_line_mem_pos
+
+* Find full file specification
+        opened = .FALSE.       ! 1/93
+        gfile_path = TM_INQ_PATH( gfile_name, tmap_grids, def_ext,
+     .                             .TRUE., status )
+        IF ( status .NE. merr_ok ) GOTO 9999
+
+* Check to see if this gridfile has already been read
+  	DO 100 i = 1, maxgridfiles
+	  istat = STR_CASE_BLIND_COMPARE(grid_filename(i),gfile_path)
+	  IF (istat .EQ. str_match) THEN
+	    status = merr_no_action
+	    RETURN
+	  ENDIF
+  100	CONTINUE
+
+* Find locations to store info from this gridfile
+	DO 110 i = maxgridfiles,1,-1
+	  IF (grid_filename(i) .NE. char_init128) THEN
+	    IF (i .EQ. maxgridfiles) GOTO 9050     !Too many grid files to store
+	    newgrid = i + 1
+	    GOTO 120
+	  ENDIF
+  110	CONTINUE
+	newgrid = 1
+  120	grid_filename(newgrid) = gfile_path
+
+* How many grid spaces used 
+	status = TM_FIND_GRID_SLOT ( ngrid )
+	IF (status .NE. merr_ok) GOTO 9200
+	ngrid = ngrid - 1
+	g_used = ngrid
+
+* How many line spaces used 
+	status = TM_FIND_LINE_SLOT ( nline )
+	IF (status .NE. merr_ok) GOTO 9500
+	nline = nline - 1
+	l_used = nline
+
+* get a free logical unit #
+	CALL LIB_GET_LUN (lunit)
+
+* open grid filename
+	OPEN 	(UNIT = lunit,
+     .		 FILE = grid_filename(newgrid),
+#ifdef READONLY_ALLOWED
+     .		 READONLY,
+#endif
+     .		 STATUS = 'OLD',
+     .		 ERR = 9010)
+        opened = .TRUE.
+
+* read in record from grid file
+  170	READ	(lunit, '(A)',END=330,ERR=9010) input_buf
+* remove extraneous spaces and tabs
+	cmprss_buf = TM_CMPRSS(input_buf)
+* blank buff string
+	DO 180 i =1,11
+	  buff(i) = ' '
+  180	CONTINUE
+
+********************************************************************************
+*                                 GRID DEFINITION                              *
+********************************************************************************
+* Check if grid definition, and if so seperate necessary elements
+	IF (cmprss_buf(1:4) .EQ. grid_define) THEN
+	  CALL TM_BREAK_STR(cmprss_buf, buff, 11)
+
+* store info in common - temporary location 0
+	  READ  (buff(p_grot), *, ERR=9600) grid_rotation(temp)
+
+* check to see if line defined - if so: place in common - if not: error
+	  DO 210 i = 1,4
+	    newline = buff(p_gline(i))
+	    IF (STR_CASE_BLIND_COMPARE(newline(:7),'UNKNOWN') .EQ.
+     .		  str_match) THEN
+	      grid_line(i,temp) = mpsunkn
+	      GOTO 200
+	    ENDIF
+	    IF (STR_CASE_BLIND_COMPARE(newline(:6),'NORMAL')  .EQ.
+     .		  str_match) THEN
+	      grid_line(i,temp) = mpsnorm
+	      GOTO 200
+	    ENDIF
+* ... check among static axes to see if it already exists
+	    DO 190 j = 1, nline
+	      istat = STR_CASE_BLIND_COMPARE ( line_name(j), newline )
+	      IF (istat .EQ. str_match) THEN
+	        grid_line(i,temp) = j
+		GOTO 200
+	      ENDIF
+  190	    CONTINUE
+* Check among dynamic lines  to see if it already exists
+	    j = 0		! to get start of linked list
+ 195	    CALL TM_NEXT_DYN_LINE( j, *9300)   ! 9300 if doesn't exist
+	      istat = STR_CASE_BLIND_COMPARE( line_name(j), newline )
+	      IF (istat .EQ. str_match) THEN
+	        grid_line(i,temp) = j
+		GOTO 200
+	      ENDIF
+	    GOTO 195
+
+*  Inner or outer product?
+  200	    outer = STR_CASE_BLIND_COMPARE('OUTER',buff(p_goutp(i)))
+	    inner = STR_CASE_BLIND_COMPARE('INNER',buff(p_goutp(i)))
+	    IF (inner .EQ. str_match) THEN
+	      grid_out_prod(i,temp) = .FALSE.
+	    ELSE IF (outer .EQ. str_match) THEN
+	      grid_out_prod(i,temp) = .TRUE.
+	    ELSE
+	      GOTO 9610
+	    ENDIF
+  210	  CONTINUE
+
+* Check among static grids for unique grid name
+	  DO 220 i = 1, ngrid
+	    istat = STR_CASE_BLIND_COMPARE(grid_name(i),buff(p_gname))
+	    IF (istat .EQ. str_match) THEN
+	      IF (TM_GRID_MATCH(i,temp)) THEN
+	        GOTO 170		! Already defined - no need to re-store
+	      ELSE
+	        GOTO 9100		! Whoops - same name - different def.
+	      ENDIF
+	    ENDIF
+  220	  CONTINUE
+
+* Check among dynamic grids for unique grid name
+	i = 0		! to get start of linked list
+ 230	CALL TM_NEXT_DYN_GRID( i, *235)
+	    istat = STR_CASE_BLIND_COMPARE(grid_name(i),buff(p_gname))
+	    IF (istat .EQ. str_match) THEN
+	      IF (TM_GRID_MATCH(i,temp)) THEN
+	        GOTO 170		! Already defined - no need to re-store
+	      ELSE
+	        GOTO 9100		! Whoops - same name - different def.
+	      ENDIF
+	    ENDIF
+	GOTO 230
+
+* Name is unique .. Next location to store info; if too many grids - give error
+ 235	status = TM_FIND_GRID_SLOT ( ngrid )
+	  IF (status .NE. merr_ok) GOTO 9200
+
+* Seems ok - transfer to permanent spot
+	  CALL TM_COPY_GRID_W_LINE_USE ( temp, ngrid )
+* Store grid name as flag of completed grid definition
+	  grid_name(ngrid) = buff(p_gname)
+
+********************************************************************************
+*                                 LINE DEFINITION                              *
+********************************************************************************
+* Check if line definition, and if so seperate necessary elements
+	ELSE IF (cmprss_buf(1:4) .EQ. line_define) THEN
+	  CALL TM_BREAK_STR(cmprss_buf, buff, 9)
+
+* store info in common - temporary location 0
+	  READ  (buff(p_llen), *, ERR=9700) line_dim(temp)
+	  line_direction(temp) = buff(p_ldirect)
+	  line_units(temp) = buff(p_lunits)
+	  line_unit_code(temp) = TM_UNIT_ID(buff(p_lunits))
+	  line_subsc1(temp) = unspecified_int4  !coordinates given later?
+	  reg_coords = TM_HAS_STRING( buff(p_lstore), 'START')
+	  irreg_coords = TM_HAS_STRING( buff(p_lstore), 'GIVEN')
+	  line_modulo(temp) = TM_HAS_STRING( buff(p_modulo), 'MODULO')
+	  line_modulo_len(temp) = 0.0D0
+	  line_t0(temp) = char_init20
+	  line_shift_origin(temp) = .FALSE.
+	  line_tunit(temp) = real4_init
+	  IF (reg_coords) THEN
+	    IF (line_direction(temp) .EQ. 'WE') dim = x_dim
+	    IF (line_direction(temp) .EQ. 'SN') dim = y_dim
+	    IF (line_direction(temp) .EQ. 'UD') dim = z_dim
+	    IF (line_direction(temp) .EQ. 'TI') dim = t_dim
+	    CALL TM_TRANSLATE_AXIS(buff(p_lstart),dim,line_start(temp),
+     .	                           status)
+	    IF (status .NE. merr_ok) GOTO 9950		!error reported already
+	    READ  (buff(p_ldelta), *, ERR=9720) line_delta(temp)
+	    IF (line_delta(temp) .LE. 0.0D0) GOTO 9730
+	    line_regular(temp) = .TRUE.
+	  ELSE
+	    line_delta(temp) = unspecified_val8
+	    line_regular(temp) = .FALSE.
+	  ENDIF
+
+* Check for unknown units or orientation
+	  IF (line_unit_code(temp) .EQ. 0) THEN
+	     istat = STR_CASE_BLIND_COMPARE(line_units(temp),'none')
+	     IF (istat .EQ. str_match) THEN
+                line_units(temp) = ' '
+             ELSE
+	        input_buf = ' '
+                WRITE (input_buf, *) 'cannot convert axis units: ',
+     .				  line_units(temp)
+	        CALL TM_NOTE( input_buf, lunit_errors)
+             ENDIF
+          ENDIF
+	  DO 240 i = 1, max_axis_orients
+	    IF (line_direction (temp) .EQ. axis_orients( i ) ) GOTO 250
+  240	  CONTINUE
+	  input_buf = ' '
+	  WRITE (input_buf, *) 'UNKNOWN LINE ORIENTATION : ',
+     .	                    line_direction(temp),' on ',buff(p_lname)
+	  CALL TM_NOTE( input_buf, lunit_errors)
+
+* If line is irregular - store it now and check it later
+  250	  IF (reg_coords) THEN
+* Check among static lines for unique line name
+	    DO 260 i  = 1, nline
+	      istat = STR_CASE_BLIND_COMPARE(line_name(i),buff(p_lname))
+	      IF (istat .EQ. str_match) THEN
+* Check for unique definition
+	        IF (TM_LINE_MATCH(i,temp)) THEN
+	          GOTO 170		! Already defined - no need to re-store
+	        ELSE
+	          GOTO 9400		! Whoops - same name - different def.
+	        ENDIF
+	      ENDIF
+  260	    CONTINUE
+* Check among dynamic lines for unique line name
+	    i = 0		! to get start of linked list
+ 265	    CALL TM_NEXT_DYN_LINE( i, *266)
+	      istat = STR_CASE_BLIND_COMPARE(line_name(i),buff(p_lname))
+	      IF (istat .EQ. str_match) THEN
+* Check for unique definition
+	        IF (TM_LINE_MATCH(i,temp)) THEN
+	          GOTO 170		! Already defined - no need to re-store
+	        ELSE
+	          GOTO 9400		! Whoops - same name - different def.
+	        ENDIF
+	      ENDIF
+	    GOTO 265
+	  ENDIF
+
+* Name is unique .. Next location to store info; if too many lines - give error
+ 266	  status = TM_FIND_LINE_SLOT ( nline )
+	  IF (status .NE. merr_ok) GOTO 9500
+
+* Seems ok - transfer to permanent spot
+	  CALL TM_COPY_LINE ( temp, nline )
+* Store line name as a flag of completed line definition
+	  line_name(nline) = buff(p_lname)
+
+********************************************************************************
+*                                COORD DEFINITION                              *
+********************************************************************************
+* Check if coord definition, and if so seperate necessary elements
+	ELSE IF (cmprss_buf(1:6) .EQ. coords_define) THEN
+	  CALL TM_BREAK_STR(cmprss_buf, buff, 4)
+
+* Locate the line this defines - already defined must be dupl. name or error
+	  DO 270 i = l_used+1, nline
+	    IF (line_delta(i) .EQ. unspecified_val8) THEN
+	      istat = STR_CASE_BLIND_COMPARE(line_name(i),buff(p_lname))
+	      IF (istat .EQ. str_match) THEN
+* Make sure it hasn't been already defined
+	        IF (line_subsc1(i) .EQ. unspecified_int4) THEN
+	          cline = i
+	          GOTO 280
+	        ENDIF
+	      ENDIF
+	    ENDIF
+  270	  CONTINUE
+	  GOTO 9310 !No match found - error
+
+* Allocate some storage for the coordinates
+  280	  line_subsc1(cline) = next_line_mem_pos
+	    IF ((line_subsc1(cline)+2*line_dim(cline)) .GT.
+     .	        maxlinestore) GOTO 9800
+* Store initial box lower bound (start of axis)
+	  ipt1 = line_subsc1(cline)
+	  npts = line_dim(cline)
+	  ipte = ipt1 + npts-1
+	  READ (buff(p_lbox0), *, ERR=9740) line_mem(ipte+1)
+
+* Read line coords and box sizes from file
+	  READ  (lunit, buff(p_cform),ERR=9750)
+     .	   (line_mem(i),line_mem(i+npts+1),i=ipt1,ipte)
+
+* Check for invalid ordering of data or box sizes
+	  DO 290 i=ipt1+1,ipte
+	    IF (line_mem(i) .LE. line_mem(i-1)) GOTO 9760
+  290	  CONTINUE
+	  DO 300 i=ipt1,ipte
+	    IF (line_mem(i+npts+1) .LT. 0.0D0 ) GOTO 9770
+  300	  CONTINUE
+
+* Change box sizes to box locations
+	  DO 310 i=ipt1,ipte
+	    line_mem(i+npts+1) = line_mem(i+npts) + line_mem(i+npts+1)
+  310	  CONTINUE
+
+* Check to see that each data point is contained inside it's box
+	  IF (.NOT. TM_CHECK_BOX_LOC(cline)) GOTO 9780
+
+* Check for unique name
+	  DO 320 i  = 1, nline
+	    IF (i .EQ. cline) GOTO 320
+	    istat = STR_CASE_BLIND_COMPARE(line_name(i),line_name(cline))
+	    IF (istat .EQ. str_match) THEN
+* Check for unique definition
+	      IF (TM_LINE_MATCH(i,cline)) THEN
+	        line_name(cline) = ' '	! Already defined - no need to re-store
+	        GOTO 170
+	      ELSE
+	        GOTO 9400		! Whoops - same name - different def.
+	      ENDIF
+	    ENDIF
+  320	  CONTINUE
+
+* Store next line mem position - good line definition
+	  next_line_mem_pos = next_line_mem_pos + 2*line_dim(cline) + 1
+
+********************************************************************************
+*                             TIME LINE DEFINITION                             *
+********************************************************************************
+* Check if time line definition, and if so seperate necessary elements
+	ELSE IF (cmprss_buf(1:4) .EQ. time_define) THEN
+	  CALL TM_BREAK_STR(cmprss_buf, buff, 4)
+
+* Locate the line this defines - already defined must be dupl. name or error
+	  DO 370 i = l_used+1, nline
+	    IF (line_direction(i) .EQ. 'TI') THEN
+	      istat = STR_CASE_BLIND_COMPARE(line_name(i),buff(p_lname))
+	      IF (istat .EQ. str_match) THEN
+* Make sure it hasn't been already defined
+	        IF (line_t0(i) .EQ. char_init20) THEN
+	          tline = i
+	          GOTO 380
+	        ENDIF
+	      ENDIF
+	    ENDIF
+  370	  CONTINUE
+	  GOTO 9320 !No match found - error
+
+* Found available slot - let's store values
+  380	  CALL TM_TRANSLATE_AXIS(buff(p_t0),t_dim,rdummy,status)
+	  IF (status .NE. merr_ok) GOTO 9910
+	  line_t0(tline) = buff(p_t0)
+          line_shift_origin(tline) = .FALSE.
+	  line_tunit(tline) = un_convert(line_unit_code(tline))
+
+********************************************************************************
+*                                 COMMENT LINE                                 *
+********************************************************************************
+	ELSE IF (cmprss_buf(1:1) .EQ. ' ' ) THEN   ! allow blank lines 6/92
+           GOTO 170            
+	ELSE IF (cmprss_buf(1:1) .NE. comment_char) THEN
+	  input_buf = ' '
+	  WRITE (input_buf,*) 'Unrecognized line in gridfile',
+     .	                   grid_filename(newgrid)
+	  CALL TM_NOTE( input_buf, lunit_errors)
+	  CALL TM_NOTE( cmprss_buf(1:79), lunit_errors)
+	ENDIF
+	GOTO 170
+
+********************************************************************************
+*                                FINAL CLEAN-UP                                *
+********************************************************************************
+  330	DO 340 i = 1, nline
+	  IF  ( line_name(i) .NE. char_init16 ) THEN
+* Are there lines left without coordinates?
+	    IF (line_subsc1(i) .EQ. unspecified_int4 .AND.
+     .	        line_delta(i) .EQ. unspecified_val8 ) GOTO 9900
+* Are there time axis left without time info?
+! disabled T0 check 9/95
+!	    IF (line_direction(i) .EQ. 'TI' .AND.
+!     .	        line_t0(i) .EQ. char_init20 ) GOTO 9920
+	  ENDIF
+  340	CONTINUE
+	GOTO 9990
+
+* error messages
+! 9000	CALL TM_ERRMSG (merr_erreq, status, 'TM_READ_GRIDFILE',
+!     .			no_descfile, no_stepfile,
+!     .			'FILE='//grid_filename(newgrid),
+!     .			no_errstring, *9999)
+
+ 9010	CALL TM_ERRMSG (merr_erreq, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'FILE='//grid_filename(newgrid),
+     .			no_errstring, *9950)
+
+
+ 9050	CALL TM_ERRMSG ( merr_grfillim, status, 'TM_READ_GRIDFILE',
+     .	                 no_descfile, no_stepfile,
+     .	                 'MAX='//TM_STRING(DBLE(maxgridfiles)),
+     .	                 no_errstring, *9999)
+
+ 9100	CALL TM_ERRMSG (merr_gridpredef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'GRIDNAME='//buff(p_gname), no_errstring,
+     .			*9950)
+
+ 9200	CALL TM_ERRMSG (merr_gridlim, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(max_grids)), no_errstring,
+     .			*9950)
+
+ 9300	def_error = 'LINENAME='//newline//' GRIDNAME='//buff(p_gname)
+	GOTO 9399
+ 9310	def_error = 'LINENAME='//buff(p_lname)//' in COORD definition'
+	GOTO 9399
+ 9320	def_error = 'LINENAME='//buff(p_lname)//' in TIME definition'
+ 9399	CALL TM_ERRMSG (merr_lineundef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			def_error, no_errstring, *9950)
+
+ 9400	CALL TM_ERRMSG (merr_linepredef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'LINENAME='//buff(p_lname), no_errstring,
+     .			*9950)
+
+ 9500	CALL TM_ERRMSG (merr_linelim, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(max_lines)), no_errstring,
+     .			*9950)
+
+ 9600	def_error = 'Read error in grid rotation field.  '//
+     .	            'GRIDNAME='//buff(p_gname)
+	GOTO 9699
+ 9610	def_error = 'Inner/outer product flag must be INNER or OUTER'//
+     .	            'GRIDNAME='//buff(p_gname)
+ 9699	CALL TM_ERRMSG (merr_badgriddef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			def_error, no_errstring, *9950)
+
+ 9700	def_error = 'Read error in gridline length field.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+! 9710	def_error = 'Read error in gridline start field.  '//
+!     .	            'LINENAME='//buff(p_lname)
+!	GOTO 9799
+ 9720	def_error = 'Read error in gridline delta field.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9730	def_error = 'Gridline delta is negative or zero.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9740	def_error = 'Read error in initial box lower bound field.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9750	def_error = 'Read error in line coord. or box size field.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9760	def_error = 'Coord at (i) less than coord at (i-1).  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9770	def_error = 'Box size specified less than zero.  '//
+     .	            'LINENAME='//buff(p_lname)
+	GOTO 9799
+ 9780	def_error = 'A coordinate given is not enclosed by box.  '//
+     .	            'LINENAME='//buff(p_lname)
+ 9799	CALL TM_ERRMSG (merr_badlinedef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			def_error, no_errstring, *9950)
+
+ 9800	CALL TM_ERRMSG (merr_linstorlim, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'MAX='//TM_STRING(DBLE(maxlinestore)),
+     .			no_errstring, *9950)
+
+ 9900	CALL TM_ERRMSG (merr_nocoordlin, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			'LINENAME='//line_name(i), no_errstring,
+     .			*9950)
+
+ 9910   def_error = 'Read error for line_t0 - '//buff(p_t0)
+!	GOTO 9949
+! 9920	def_error = 'No t0 info for line '//line_name(i)   ! disabled 9/95
+ 9949	CALL TM_ERRMSG (merr_badtimedef, status, 'TM_READ_GRIDFILE',
+     .			no_descfile, no_stepfile,
+     .			def_error, no_errstring, *9950)
+
+* Reset memory locations if error occurs
+ 9950	grid_filename(newgrid) = char_init
+	IF (ngrid .GT. g_used) THEN
+	  DO 350 i = g_used+1, ngrid
+	    grid_name(i)   = char_init
+  350	  CONTINUE
+	ENDIF
+	IF (nline .GT. l_used) THEN
+	  DO 360 i = l_used+1, nline
+	    line_name(i)   = char_init16
+	    line_subsc1(i) = unspecified_int4
+  360	  CONTINUE
+	ENDIF
+	next_line_mem_pos = orig_line_mem_pos
+	GOTO 9999
+
+ 9990	status = merr_ok
+
+ 9999	IF ( opened ) CLOSE (UNIT = lunit)
+	RETURN
+	END
diff --git a/fmt/src/tm_rename.F b/fmt/src/tm_rename.F
new file mode 100644
index 0000000..967e778
--- /dev/null
+++ b/fmt/src/tm_rename.F
@@ -0,0 +1,81 @@
+	SUBROUTINE TM_RENAME ( oldname, newname, status )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* rename a file
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for DECstation computer under Ultrix and VMS operating systems
+*
+* rev 0.0 -   5/6/91
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling argument declarations:
+        INTEGER  status
+        CHARACTER*(*) oldname, newname
+
+* internal variable declarations:
+	INTEGER	olen, nlen
+        INTEGER TM_LENSTR1
+
+        include 'tmap_errors.parm'
+
+        INTEGER slen
+        PARAMETER  ( slen = 128 )
+        INTEGER oldhol(slen), newhol(slen)  ! c-type Hollerith string buffers
+
+* initialize
+        olen = TM_LENSTR1(oldname)
+        nlen = TM_LENSTR1(newname)
+
+* translate to null-terminated c-type strings
+        CALL TM_FTOC_STRNG( oldname(:olen), oldhol, slen )
+        CALL TM_FTOC_STRNG( newname(:nlen), newhol, slen )
+
+* call c-written routine to make system call
+        CALL TM_C_RENAME( oldhol, newhol, status )
+
+* translate Unix system error code to TMAP library form
+        IF ( status .EQ. 0 ) THEN
+           status = merr_ok
+        ELSE
+           status = merr_erreq
+        ENDIF
+
+	RETURN
+	END
+
diff --git a/fmt/src/tm_same_grid_def.F b/fmt/src/tm_same_grid_def.F
new file mode 100644
index 0000000..10655e3
--- /dev/null
+++ b/fmt/src/tm_same_grid_def.F
@@ -0,0 +1,78 @@
+	LOGICAL FUNCTION TM_SAME_GRID_DEF( grid1, grid2 )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Check to see if the guts of the two grids are identical
+
+* revision 0.00 - Steve Hankin - based on TM_FIND_LIKE_GRID by  M. Verschell
+* 12/3/92 *sh* - on mpsnorm axes ignore inner/outer
+* IBM port 14apr94 *kob* : Logical expressions need to be compared
+*			   using NEQV and EQV
+* V674 2/12 *acm* 6D Ferret: use nferdims rather than 4 for dimension indexing
+
+* Include files
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	
+* Argument definitions
+	INTEGER*4	grid1, grid2
+
+* Local definitions
+	INTEGER*4	i
+
+	DO 100 i=1,nferdims
+	  IF (grid_line(i,grid1) .NE. grid_line(i,grid2) ) GOTO 1000
+          IF ( grid_line(i,grid1) .NE. mpsnorm ) THEN           ! 12/3
+             IF (grid_out_prod(i,grid1) .NEQV. grid_out_prod(i,grid2))
+     .	                                                   GOTO 1000
+          ENDIF
+  100	CONTINUE
+
+* All nferdims axis matched - check grid rotation
+	IF (grid_rotation(grid1) .NE. grid_rotation(grid2)) GOTO 1000
+
+* they match
+  	TM_SAME_GRID_DEF = .TRUE.
+        RETURN
+
+* they don't match
+ 1000   TM_SAME_GRID_DEF = .FALSE.
+        RETURN
+
+	END
diff --git a/fmt/src/tm_same_line_def.F b/fmt/src/tm_same_line_def.F
new file mode 100644
index 0000000..be510cb
--- /dev/null
+++ b/fmt/src/tm_same_line_def.F
@@ -0,0 +1,211 @@
+	LOGICAL FUNCTION TM_SAME_LINE_DEF ( line1, line2 )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Check to see if two lines share an identical definition
+*
+* by M. Verschell PMEL/TMAP
+*
+* revision 0.00 - 2/92 *sh* - extracted from TM_FIND_LIKE_LINE by *mv*
+* netCDF support *sh* 6/92 - weakened precision of line_mem comparison
+* *sh* 12/92 (for netCDF) - use TM_FPEQ to weaken start/delta check, too
+*              (should probably use it in the irregular coords check, too??)
+* IBM port 14apr94 *kob* : Logical expressions need to be compared
+*			   using NEQV and EQV
+*			 : syntax error with "val**-5", it must be
+*			   "val**(-5)"
+* *sh* 2/24/95 - instead of comparing the units string compare the units code
+* *sh* 10/95 - slightly different check if a dynamic line
+* V510 4/00 *sh* - netCDF data sets using dynamic axes and grids
+* V530 10/00 *sh* - bug fix: since netCDF axes are now dynamic, the decision
+*		    to bypass coordinate checking on irregular axes must be
+*		    based on these be child axes, rather than being dynamic
+*		  - also switched to using TM_WORLD rather than direct refs
+*		    to line_mem
+*      3/01 *sh* - bug fix to 10/00 bug fix ... Still need to make sure
+*	            it is the *same* child of an irreg axis by checking
+*	            the lo/hi/delta
+* V541 2/02 *sh* - added support for line_modulo_len
+
+* V570 5/04 *acm* - Use TM_DFPEQ to weaken  irregular coords check
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V614 *acm* 10/08 - Fix bug 1595, comparisons of xx1 and -1*xx2 did
+*                   not take into account that the values may be zero.
+
+* Include files
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER*4	line1, line2
+
+* Local definitions
+        LOGICAL         TM_FPEQ, TM_FPEQ_SNGL, TM_DFPEQ, dynamic
+	INTEGER*4	j
+	REAL*8		TM_WORLD_AX, xx1, xx2
+	REAL*4  asingle, bsingle
+
+* local parameter declaration
+* ... all these are somewhat arbitrary
+	REAL*8	    haf_dp_eps, max_sp_compare
+	PARAMETER ( max_sp_compare = 2.**24,
+     .              haf_dp_eps = 10.D0**(-14) ) ! somewhat arbitrary
+	REAL	    haf_sp_eps
+	PARAMETER ( haf_sp_eps = 10.0**(-7) )	! somewhat arbitrary
+
+* Same regularity/irregularity?
+	  IF (line_regular(line1) .NEQV. line_regular(line2)) GOTO 1000
+
+* Same modulo?
+	  IF (line_modulo(line1) .NEQV. line_modulo(line2)) GOTO 1000
+
+* Same modulo length?
+	  IF (line_modulo(line1)) THEN
+	     IF (line_modulo_len(line1) .NE. line_modulo_len(line2))
+     .								GOTO 1000
+	  ENDIF
+
+* Check length
+	  IF (line_dim(line1) .NE. line_dim(line2)) GOTO 1000
+
+* Check units (2/95 - either a recognized unit code or identical strings)
+	  IF (line_unit_code(line1) .NE. line_unit_code(line2)) GOTO 1000
+	  IF (line_unit_code(line1) .EQ. 0 ) THEN
+	     IF (line_units(line1) .NE. line_units(line2)) GOTO 1000
+	  ENDIF
+* Check orientation
+	  IF (line_direction(line1) .NE. line_direction(line2)) GOTO 1000
+
+* Check special values for time axis
+	  IF (line_direction(line2) .EQ. 'TI') THEN
+	    IF (line_t0(line2) .NE. line_t0(line1)) GOTO 1000
+	    IF (line_shift_origin(line2) .NEQV. line_shift_origin(line1))
+     .           GOTO 1000
+	    IF (line_tunit(line2) .NE. line_tunit(line1)) GOTO 1000
+	    IF (line_cal_name(line1) .NE. line_cal_name(line2)) GOTO 1000
+	  ENDIF
+
+* dynamic line info
+	  dynamic = line1.GT.max_lines .OR. line2.GT.max_lines
+	  IF ( line_class (line1) .NE. line_class (line2) ) GOTO 1000
+	  IF ( line_parent(line1) .NE. line_parent(line2) ) GOTO 1000
+
+* check coordinate and box locations
+	  IF ( line_regular(line2)
+     .	.OR.   (line_class (line1) .EQ. pline_class_stride)
+     .	.OR.   (line_class (line1) .EQ. pline_class_midpt)   ) THEN
+	    asingle = SNGL(line_start(line1))
+	    bsingle = SNGL(line_start(line2))
+            IF ( .NOT. TM_FPEQ_SNGL( asingle, bsingle ) ) GOTO 1000
+	    asingle = SNGL(line_delta(line1))
+	    bsingle = SNGL(line_delta(line2))
+            IF ( .NOT. TM_FPEQ_SNGL( asingle, bsingle ) ) GOTO 1000
+	  ELSE
+* irregular lines
+	    DO 100 j = 1,line_dim(line1)
+* first check the grid points
+	      xx1 = TM_WORLD_AX(j, line1, box_middle)
+	      xx2 = TM_WORLD_AX(j, line2, box_middle)
+	      IF (.NOT. TM_DFPEQ(ABS(xx1), 0.D0) ) THEN
+	         IF ( TM_DFPEQ(ABS(xx1), -1*ABS(xx2)) ) GOTO 1000
+              ENDIF
+              IF ( ABS(xx2) .LT. max_sp_compare ) THEN
+* ... single precision comparison
+	         IF ( SNGL(xx2) .EQ. SNGL(xx1) ) GOTO 100
+* ... they're not equal but they may be within acceptable limits
+	         IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_sp_eps )
+     .							    GOTO 1000
+              ELSE
+* ... full precision comparison (needed for very large time words)
+	         IF ( xx1 .EQ. xx2 ) GOTO 100
+* ... they're not equal but they may be within machine accuracy
+	         IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_dp_eps )
+     .							    GOTO 1000
+              ENDIF
+
+* now the grid cell bounds
+	      xx1 = TM_WORLD_AX(j, line1, box_lo_lim)
+	      xx2 = TM_WORLD_AX(j, line2, box_lo_lim)
+	      IF (.NOT. TM_DFPEQ(ABS(xx1), 0.D0) )  THEN
+	         IF ( TM_DFPEQ(ABS(xx1), -1*ABS(xx2)) ) GOTO 1000
+              ENDIF
+              IF ( ABS(xx2) .LT. max_sp_compare ) THEN
+* ... single precision comparison
+	         IF ( SNGL(xx2) .EQ. SNGL(xx1) ) GOTO 100
+* ... they re not equal but they may be within acceptable limits
+	         IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_sp_eps )
+     .							    GOTO 1000
+              ELSE
+* ... full precision comparison (needed for very large time words)
+	         IF ( xx1 .EQ. xx2 ) GOTO 100
+* ... they're not equal but they may be within machine accuracy
+	         IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_dp_eps )
+     .							    GOTO 1000
+              ENDIF
+  100	    CONTINUE
+
+* finally the upper limit of the top cell
+	    xx1 = TM_WORLD_AX(j, line1, box_hi_lim)
+	    xx2 = TM_WORLD_AX(j, line2, box_hi_lim)
+	      IF (.NOT. TM_DFPEQ(ABS(xx1), 0.D0) )  THEN
+	         IF ( TM_DFPEQ(ABS(xx1), -1*ABS(xx2)) ) GOTO 1000
+              ENDIF
+            IF ( ABS(xx2) .LT. max_sp_compare ) THEN
+* ... single precision comparison
+	       IF ( SNGL(xx2) .EQ. SNGL(xx1) ) GOTO 500
+* ... they're not equal but they may be within acceptable limits
+	       IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_sp_eps )
+     .							    GOTO 1000
+              ELSE
+* ... full precision comparison (needed for very large time words)
+	       IF ( xx1 .EQ. xx2 ) GOTO 500
+* ... they're not equal but they may be within machine accuracy
+	       IF ( ABS((xx2-xx1)/(xx2+xx1)) .GT. haf_dp_eps )
+     .							    GOTO 1000
+            ENDIF
+
+	  ENDIF
+
+* the lines are identical
+ 500	  TM_SAME_LINE_DEF = .TRUE.
+        RETURN
+
+* the lines differ
+ 1000   TM_SAME_LINE_DEF = .FALSE.
+        RETURN
+	END
diff --git a/fmt/src/tm_scale.F b/fmt/src/tm_scale.F
new file mode 100644
index 0000000..e87838b
--- /dev/null
+++ b/fmt/src/tm_scale.F
@@ -0,0 +1,58 @@
+	SUBROUTINE TM_SCALE ( factor, offset, bad, array, n )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* rescale an array: multiply by a scale factor and add an offset
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 3/92 for TMAP library
+* V600 ACM fix bug 419: Do not scale bad values as prescribed by the CF standard(!) 
+
+* calling argument declarations:
+      INTEGER n
+      REAL factor, offset, bad, array(*)
+
+* internal variable declarations:
+      INTEGER i
+
+      DO 100 i = 1, n
+         IF (array(i) .NE. bad) array(i) = array(i)*factor + offset
+ 100  CONTINUE
+
+      RETURN
+      END
diff --git a/fmt/src/tm_scale_all.F b/fmt/src/tm_scale_all.F
new file mode 100644
index 0000000..e221983
--- /dev/null
+++ b/fmt/src/tm_scale_all.F
@@ -0,0 +1,87 @@
+	SUBROUTINE TM_SCALE_ALL ( factor, offset, array, vartyp, n  )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* rescale an array: multiply by a scale factor and add an offset
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* revision 0.0 1/2010 for TMAP library
+* Scale the bad data too... on input to netCDF we scale all the data,
+* compute the missing flag for internal use as indat*inscale + inoff
+*
+* To write scaled data, scale all of it by ferretdat(1./inscale) - (inoff/inscale)
+* the scaling to be used is sent into this routine.
+* v6.8 3/14/2012 *acm* fix for scaled SHORT data and double-precision Ferret.
+* v6.85 6/2012   *acm* The min size for a SHORT integer is -32768
+
+* include files
+      INCLUDE 'netcdf.inc'
+
+* calling argument declarations:
+      INTEGER n, vartyp
+      REAL factor, offset, array(*)
+
+* internal variable declarations:
+      LOGICAL TM_FPEQ_SNGL
+      INTEGER i
+      REAL*4 aa, sbad, sbadn
+
+* For short output datatype, the scaling and un-scaling
+* can result in data outside the range of SHORT on output.
+* FLOAT offset and scale factor are converted to DOUBLE, then
+* 1./scale is computed, and re-applied to the data.
+* This is a bit of a hack. 
+
+      IF (vartyp .EQ. NF_SHORT) THEN
+         sbad = 32767
+         sbadn = -32768
+         DO 100 i = 1, n
+	    array(i) = array(i)*factor + offset
+	    aa = array(i)
+	    IF (TM_FPEQ_SNGL(aa,sbad) ) array(i) = sbad
+	    IF (TM_FPEQ_SNGL(aa,sbadn) ) array(i) = sbadn
+ 100     CONTINUE
+
+      ELSE
+         DO 200 i = 1, n
+             array(i) = array(i)*factor + offset
+ 200     CONTINUE
+      ENDIF
+
+      RETURN
+      END
diff --git a/fmt/src/tm_scale_nobad.F b/fmt/src/tm_scale_nobad.F
new file mode 100644
index 0000000..257db18
--- /dev/null
+++ b/fmt/src/tm_scale_nobad.F
@@ -0,0 +1,60 @@
+	SUBROUTINE TM_SCALE_NOBAD( factor, offset, array, n, bad, miss )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* rescale an array: multiply by a scale factor and add an offset, skipping
+*    any missing data
+
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* from tm_scale.F  4/21/03
+
+
+* calling argument declarations:
+      INTEGER n
+      REAL factor, offset, array(n), bad, miss
+
+* internal variable declarations:
+      INTEGER i
+
+      DO 100 i = 1, n
+         IF (array(i) .NE. bad .AND. array(i) .NE. miss) 
+     .      array(i) = array(i)*factor + offset
+  100 CONTINUE
+
+      RETURN
+      END
diff --git a/fmt/src/tm_secs_from_bc.F b/fmt/src/tm_secs_from_bc.F
new file mode 100644
index 0000000..93e9c50
--- /dev/null
+++ b/fmt/src/tm_secs_from_bc.F
@@ -0,0 +1,222 @@
+	REAL*8 FUNCTION TM_SECS_FROM_BC ( cal_id,
+     .    year, month, day, hour, minute, second, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Will convert a date of yyyy-mm-dd hh:mm:ss to seconds since
+* 0000-01-01 00:00:00
+*
+* Written 6/16/87 By Mark Verschell for PMEL/TMAP
+*
+* revision 0.00 - 06/16/87 - Initial Incarnation
+* V530: *acm* 12/00 add calendar types; cal_id for time axes. This
+*                   routine is just Jerry's tm_calendars_secs_from_bc
+*       J Davison 10.20.99   Copied TM_SECS_FROM_BC() and modified to support
+*                            multiple calendars.
+*       *acm* 3/01  Treat Julian calendar as a separate case.
+*       *acm* 8/02  Fix bug in Julian calendar computations where leap day was
+*                   added twice for case where we are at the first year of a
+*                   century.
+* V63  *acm* 10/09 Changes for gfortran build
+
+* Include files
+        include 'calendar.decl'
+        include 'calendar.cmn'
+	include 'tmap_errors.parm'
+
+* Argument definition
+
+	INTEGER         cal_id,year, month, day, hour, minute, second,
+     .			status
+*
+* Local Definitions
+	INTEGER		secstat
+	REAL*8		secs_in_minute, secs_in_hour, secs_in_day,
+     .      secs_in_year, secs_in_century, total_secs,
+     .      leap_yr_days
+
+	PARAMETER	(secs_in_minute	 = 60.0,
+     .      secs_in_hour	 = secs_in_minute*60.0,
+     .      secs_in_day	 = secs_in_hour*24.0)
+
+
+*****************************************************************************
+*****************************************************************************
+
+
+*****************************************************************************
+* HANDLE GREGORIAN CALENDAR FIRST
+*****************************************************************************
+	if (cal_id .eq. gregorian) then
+
+*	   INITIALIZE
+	   leap_yr_days = cals_num_days(cal_id) + 1.0
+
+	   secs_in_year	 = secs_in_day*cals_num_days(cal_id)
+	   secs_in_century = 
+     .      secs_in_day*(76*cals_num_days(cal_id) + 24*leap_yr_days)
+
+*          ADD LOTS OF SECONDS FOR EACH CENTURY SINCE 0 DAY
+	   total_secs = secs_in_century * INT(year/100)
+
+*          ADD A DAY FOR EVERY 400 YEARS (LEAP YEAR AT CENTENNIAL)
+	   total_secs = total_secs + secs_in_day*INT(year/400.+0.9975)
+
+*          ADD A YEAR FOR EACH YEAR SINCE TURN OF CENTURY
+	   total_secs = total_secs + secs_in_year*MOD(year,100)
+
+*          ADD A DAY FOR EACH LEAP YEAR SINCE CENTENNIAL(EXCEPT FOR CENTENNIAL)
+	   total_secs = 
+     .      total_secs + secs_in_day*INT((MOD(year,100)-1)/4)
+
+*          ADD SECONDS FOR NUMBER OF MONTHS
+	   total_secs = total_secs +
+     .       cals_days_before_month(month,cal_id)*secs_in_day
+
+*          ADD 1 DAY WORTH OF SECONDS IF THIS IS LEAP YEAR AND PAST FEBRUARY
+	   if (month .GT. 2) then
+	      if (MOD(year,400) .EQ. 0) then
+     	         total_secs = total_secs + secs_in_day
+	      else
+		 if (MOD(year,4) .EQ. 0 .AND. MOD(year,100) .NE. 0)
+     .	             total_secs = total_secs + secs_in_day
+	      endif
+	   endif
+*          ADD SECONDS FOR NUMBER OF DAYS
+	   total_secs = total_secs + secs_in_day*(day-1)
+
+*          ADD SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs + secs_in_hour*(hour)
+
+*          ADD SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs + secs_in_minute*(minute)
+
+*          ADD SECONDS FOR NUMBER OF SECS FOR TOTAL NUMBER OF SECONDS
+	   total_secs = total_secs + second
+
+*****************************************************************************
+* HANDLE JULIAN CALENDAR 
+*****************************************************************************
+	ELSE IF (cal_id .eq. julian) then
+
+*	   INITIALIZE
+	   leap_yr_days = cals_num_days(cal_id) + 1.0
+
+	   secs_in_year	 = secs_in_day*cals_num_days(cal_id)
+	   secs_in_century = 
+     .      secs_in_day*(75*cals_num_days(cal_id) + 25*leap_yr_days)
+
+*          ADD LOTS OF SECONDS FOR EACH CENTURY SINCE 0 DAY
+	   total_secs = secs_in_century * INT(year/100+0.9975)
+
+*          ADD A YEAR FOR EACH YEAR SINCE TURN OF CENTURY
+	   total_secs = total_secs + secs_in_year*MOD(year,100)
+
+*          ADD A DAY FOR EACH LEAP YEAR SINCE CENTENNIAL, PLUS 1 DAY FOR 
+*          CENTENNIAL
+*          !! IF THIS IS CENTENNIAL YEAR, THIS YEARS LEAP SECONDS ADDED BELOW
+
+	   total_secs = 
+     .      total_secs + secs_in_day*(INT((MOD(year,100)-1)/4))
+	   IF (MOD(year,100) .NE. 0) total_secs = 
+     .      total_secs + secs_in_day
+
+*          ADD SECONDS FOR NUMBER OF MONTHS
+	   total_secs = total_secs +
+     .       cals_days_before_month(month,cal_id)*secs_in_day
+
+*          ADD 1 DAY WORTH OF SECONDS IF THIS IS LEAP YEAR AND PAST FEBRUARY
+
+	   if (month .GT. 2  .AND. MOD(year,4) .EQ. 0)
+     .             total_secs = total_secs + secs_in_day
+
+*          ADD SECONDS FOR NUMBER OF DAYS
+	   total_secs = total_secs + secs_in_day*(day-1)
+
+*          ADD SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs + secs_in_hour*(hour)
+
+*          ADD SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs + secs_in_minute*(minute)
+
+*          ADD SECONDS FOR NUMBER OF SECS FOR TOTAL NUMBER OF SECONDS
+	   total_secs = total_secs + second
+
+
+******************************************************************************
+
+******************************************************************************
+* ALL OTHER SUPPORTED AND REGULAR CALENDARS
+******************************************************************************
+	ELSE IF (cal_id .GT. gregorian   .AND.  cal_id .NE. julian .AND.
+     .           cal_id .LE. max_calendars) THEN
+
+*	   INITIALIZE
+	   secs_in_year	   = secs_in_day*cals_num_days(cal_id)
+	   if (cal_id .eq. julian) secs_in_year	   = secs_in_day*365.25
+	   secs_in_century = 100*secs_in_year
+
+*          ADD LOTS OF SECONDS FOR EACH CENTURY SINCE 0 DAY
+	   total_secs = secs_in_century * INT(year/100)
+
+*          ADD A YEAR FOR EACH YEAR SINCE TURN OF CENTURY
+	   total_secs = total_secs + secs_in_year*MOD(year,100)
+
+*          ADD SECONDS FOR NUMBER OF MONTHS
+	   total_secs = total_secs + 
+     .            cals_days_before_month(month,cal_id)*secs_in_day
+
+*          ADD SECONDS FOR NUMBER OF DAYS
+	   total_secs = total_secs + secs_in_day*(day-1)
+
+*          ADD SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs + secs_in_hour*(hour)
+
+*          ADD SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs + secs_in_minute*(minute)
+
+*          ADD SECONDS FOR NUMBER OF SECS FOR TOTAL NUMBER OF SECONDS
+	   total_secs = total_secs + second
+
+	ELSE
+           secstat = merr_syntax
+	   CALL ERRMSG (secstat, status, 
+     .       'Illegal calendar in tm_secs_from_bc()', *5000)
+	ENDIF
+
+*       FINISHED
+	tm_secs_from_bc = total_secs
+5000	return
+	end
diff --git a/fmt/src/tm_secs_to_date.F b/fmt/src/tm_secs_to_date.F
new file mode 100644
index 0000000..c7b274b
--- /dev/null
+++ b/fmt/src/tm_secs_to_date.F
@@ -0,0 +1,335 @@
+	CHARACTER*(*) FUNCTION TM_SECS_TO_DATE ( num_secs, cal_id )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Will convert secs since 01-JAN-0000 00:00:00 to a date of the form
+* yyyy-mm-dd hh:mm:ss
+*
+* Written 6/16/87 By Mark Verschell for PMEL/TMAP
+*
+* revision 0.00 - 06/16/87 - Initial Incarnation
+* revision 0.10 - 09/19/88 - changed function to CHAR*(*) from CHAR*20 and now
+*			     write to temp string to get around 20 character
+*			     minimum length needed for date output
+* revision 1.00 - 02/09/89 - Completely rewritten eliminating all if-tests,
+*			     loops, and goto's.
+* revision 2.00 - 02/20/89 - Rewritten - subtract year 0 - claculate from there
+*			     year 0 special case - readded logical leap test
+*			     Added some error handling (STOP's)
+
+* V510 5/00 *sh* - trap attempt to translate a date before 0000
+* V530: *acm* 12/00 add calendar types; cal_id.  This routine is from
+*       Jerry's tm_calendars_secs_to_date
+*       *acm* 3/01  Treat Julian calendar as a separate case.
+*       *ACm* 4/24/01 INT(tot_days/366. + 307./366.)  is 0 under linux,
+*                     when the expression is 1.  Use simple IF test on
+*		      tot_days instead to see if we're before or after day 59.
+* V63  *acm* 10/09 Changes for gfortran build
+
+* Argument definitions
+	REAL*8		num_secs
+	INTEGER		cal_id
+
+* Include files
+	include 'tmap_errors.parm'
+        include 'calendar.decl'
+        include 'calendar.cmn'
+
+*
+* Local Definition
+
+	CHARACTER*20	tempstr
+	INTEGER		year, month, day, hour,
+     .			minute, second, leapadj, cent_cnt, status,
+     .			year_cnt, cent4_cnt, year4_cnt, tot_days,
+     .			tmp_days, ge59
+	REAL		yeardays, a
+	REAL*8		secs_in_minute, secs_in_hour, secs_in_day,
+     .      secs_in_year, secs_in_4years, secs_in_cent,
+     .      secs_in_4cents, total_secs, leap_yr_days
+
+	PARAMETER	(secs_in_minute	= 60.0,
+     .      secs_in_hour   = secs_in_minute*60.0,
+     .      secs_in_day    = secs_in_hour*24.0)
+
+C       CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+* trap invalid input
+	IF ( num_secs .LT. 0 ) THEN
+	   TM_SECS_TO_DATE = '01-JAN-0000:00:00:00'
+	   RETURN
+	ENDIF
+
+C  Get calendar attributes
+        CALL TM_GET_CALENDAR_ATTRIBUTES (cal_id, num_months, 
+     .                      num_days, yeardays, month_names,
+     .                      days_in_month, days_before_month, 
+     .                      month_by_day)
+
+*******************************************************************************
+* HANDLE GREGORIAN CALENDAR FIRST  
+*******************************************************************************
+	if (cal_id .eq. gregorian) then
+
+*          INITIALIZE
+	   leap_yr_days = num_days + 1.0
+
+	   secs_in_year	  = secs_in_day*num_days
+	   secs_in_4years = 
+     .      secs_in_day*(3*num_days + leap_yr_days)
+	   secs_in_cent   = 
+     .      secs_in_day*(76*num_days + 24*leap_yr_days)
+	   secs_in_4cents = 4*secs_in_cent+secs_in_day
+	   total_secs = num_secs
+
+*          SUBTRACT YEAR 0 OFF (IT'S A LEAP YEAR)
+	   total_secs = total_secs - secs_in_year - secs_in_day
+
+*          MAKE SURE WE AREN'T WORKING IN YEAR 0
+	   IF (total_secs .GE. 0) THEN
+
+*             DECIDE WHICH CENTURY IT IS
+	      cent4_cnt = INT(total_secs/secs_in_4cents)
+	      total_secs = total_secs - cent4_cnt*secs_in_4cents
+	      cent_cnt = INT(total_secs/secs_in_cent)
+*             DEC 31 ON LEAP CENTURY TEST (YEARS 400,800,1200...)
+	      IF (cent_cnt .EQ. 4 .AND.
+     .         total_secs .GE. cent4_cnt-secs_in_day)   cent_cnt = 3
+	      total_secs = total_secs - cent_cnt*secs_in_cent
+	      year = 400*cent4_cnt + 100*cent_cnt
+	  
+*             DECIDE WHAT YEAR IT IS EXACTLY (1 YEAR FOR YEAR 0)
+	      year4_cnt = INT(total_secs/secs_in_4years)
+	      total_secs = total_secs - year4_cnt*secs_in_4years
+	      year_cnt = INT(total_secs/secs_in_year)
+*             DEC 31 ON LEAP YEAR TEST (YEARS 0,4,8,12...)
+	      IF (year_cnt .EQ. 4 .AND.
+     .         total_secs .GE. secs_in_4years-secs_in_day)   year_cnt = 3
+	      total_secs = total_secs - year_cnt*secs_in_year
+	      year = year + 4*year4_cnt + year_cnt + 1
+	      
+	   ELSE
+*             Year 0 stuff
+	      year = 0
+	      total_secs = total_secs + secs_in_year + secs_in_day
+	   ENDIF
+
+*          IS THIS A LEAP YEAR? (EVERY 4TH CENTURY IS, OTHERWISE CENTURY ISN'T)
+	   leapadj = 0
+	   IF (MOD(year,400) .EQ. 0) THEN
+	      leapadj = 1
+	   ELSE IF (MOD(year,4) .EQ. 0 .AND. MOD(year,100) .NE. 0) THEN
+	      leapadj = 1
+	   ENDIF
+
+*          HOW  MANY DAYS INTO YEAR IS THIS
+	   tot_days = INT(total_secs/secs_in_day)
+	   total_secs = total_secs - tot_days*secs_in_day
+	   
+*          DECIDE WHAT MONTH/DAY IT IS
+c acm  The following INT evaluates to 0 when tot_days=59 under Linux
+c acm  using FLOAT(tot_days) does not change this
+c acm  Use a simpler IF test instead.
+
+c acm	   tmp_days = tot_days - leapadj*INT(tot_days/366. + 307./366.)
+
+           ge59 = 0
+           IF (tot_days .GE. 59) ge59 = 1
+	   tmp_days = tot_days - leapadj* ge59
+	   IF (tmp_days .LT. 0) 
+     .      STOP 'negative subscript in TM_SECS_TO_DATE'
+	   month = month_by_day(tmp_days+1)
+	   leapadj = INT(month/12. +.75)*leapadj
+	   day = tot_days - (days_before_month(month)+leapadj) + 1
+	   
+*          CALCULATE NUMBER OF HOURS
+	   hour = INT(total_secs/secs_in_hour)
+*          SUBTRACT SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs - secs_in_hour*(hour)
+*          CALCULATE NUMBER OF MINUTES
+	   minute = INT(total_secs/secs_in_minute)
+*          SUBTRACT SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs - secs_in_minute*(minute)
+*          CALCULATE NUMBER OF SECONDS
+	   second = total_secs
+
+*******************************************************************************
+* HANDLE JULIAN CALENDAR   
+*******************************************************************************
+	ELSE IF (cal_id .eq. julian) then
+
+*          INITIALIZE
+	   leap_yr_days = num_days + 1.0
+
+	   secs_in_year	  = secs_in_day*num_days
+	   secs_in_4years = 
+     .      secs_in_day*(3*num_days + leap_yr_days)
+	   total_secs = num_secs
+
+*          SUBTRACT YEAR 0 OFF (IT'S A LEAP YEAR)
+	   total_secs = total_secs - secs_in_year - secs_in_day
+
+
+*          MAKE SURE WE AREN'T WORKING IN YEAR 0
+	   IF (total_secs .GE. 0) THEN
+
+	      year = 0
+	  
+*             DECIDE WHAT YEAR IT IS EXACTLY (1 YEAR FOR YEAR 0)
+	      year4_cnt = INT(total_secs/secs_in_4years)
+	      total_secs = total_secs - year4_cnt*secs_in_4years
+
+	      year_cnt = INT(total_secs/secs_in_year)
+*             DEC 31 ON LEAP YEAR TEST (YEARS 0,4,8,12...)
+	      IF (year_cnt .EQ. 4 .AND.
+     .         total_secs .GE. secs_in_4years-secs_in_day)   year_cnt = 3
+	      total_secs = total_secs - year_cnt*secs_in_year
+	      year = year + 4*year4_cnt + year_cnt + 1
+	      
+	   ELSE
+*             Year 0 stuff
+	      year = 0
+	      total_secs = total_secs + secs_in_year + secs_in_day
+	   ENDIF
+
+*          IS THIS A LEAP YEAR?
+	   leapadj = 0
+	   IF (MOD(year,4) .EQ. 0) leapadj = 1
+
+*          HOW  MANY DAYS INTO YEAR IS THIS
+	   tot_days = INT(total_secs/secs_in_day)
+	   total_secs = total_secs - tot_days*secs_in_day
+
+*          DECIDE WHAT MONTH/DAY IT IS
+
+c acm  The following INT evaluates to 0 when tot_days=59 under Linux
+c acm  using FLOAT(tot_days) does not change this
+c acm  Use a simpler IF test instead.
+
+c acm	   tmp_days = tot_days - leapadj*INT(tot_days/366. + 307./366.)
+
+           ge59 = 0
+           IF (tot_days .GE. 59) ge59 = 1
+	   tmp_days = tot_days - leapadj* ge59
+
+	   IF (tmp_days .LT. 0) 
+     .      STOP 'negative subscript in TM_SECS_TO_DATE'
+	   month = month_by_day(tmp_days+1)
+	   leapadj = INT(month/12. +.75)*leapadj
+	   day = tot_days - (days_before_month(month)+leapadj) + 1
+	   
+*          CALCULATE NUMBER OF HOURS
+	   hour = INT(total_secs/secs_in_hour)
+*          SUBTRACT SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs - secs_in_hour*(hour)
+*          CALCULATE NUMBER OF MINUTES
+	   minute = INT(total_secs/secs_in_minute)
+*          SUBTRACT SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs - secs_in_minute*(minute)
+*          CALCULATE NUMBER OF SECONDS
+	   second = total_secs
+
+******************************************************************************
+* ALL OTHER SUPPORTED AND REGULAR CALENDARS
+******************************************************************************
+	ELSE IF (cal_id .GT. gregorian   .AND.  cal_id .NE. julian .AND.
+     .           cal_id .LE. max_calendars) THEN
+
+*          INITIALIZE
+	   secs_in_year	= secs_in_day*num_days
+	   secs_in_cent = 100*secs_in_year
+	   total_secs = num_secs
+
+*          SUBTRACT YEAR 0 OFF
+	   total_secs = total_secs - secs_in_year
+
+*          MAKE SURE WE AREN'T WORKING IN YEAR 0
+	   IF (total_secs .GE. 0) THEN
+
+*             DECIDE WHICH CENTURY IT IS
+	      cent_cnt = INT(total_secs/secs_in_cent)
+	      total_secs = total_secs - cent_cnt*secs_in_cent
+	      year = 100*cent_cnt
+	  
+*             DECIDE WHAT YEAR IT IS EXACTLY (1 YEAR FOR YEAR 0)
+	      year_cnt = INT(total_secs/secs_in_year)
+	      total_secs = total_secs - year_cnt*secs_in_year
+	      year = year + year_cnt + 1
+	      
+	   ELSE
+*             Year 0 stuff
+	      year = 0
+	      total_secs = total_secs + secs_in_year
+	   ENDIF
+
+*          HOW  MANY DAYS INTO YEAR IS THIS
+	   tot_days = INT(total_secs/secs_in_day)
+	   total_secs = total_secs - tot_days*secs_in_day
+	   
+*          DECIDE WHAT MONTH/DAY IT IS
+	   month = month_by_day(tot_days+1)
+	   day = tot_days - days_before_month(month) + 1
+	   
+*          CALCULATE NUMBER OF HOURS
+	   hour = INT(total_secs/secs_in_hour)
+*          SUBTRACT SECONDS FOR NUMBER OF HOURS
+	   total_secs = total_secs - secs_in_hour*(hour)
+*          CALCULATE NUMBER OF MINUTES
+	   minute = INT(total_secs/secs_in_minute)
+*          SUBTRACT SECONDS FOR NUMBER OF MINUTES
+	   total_secs = total_secs - secs_in_minute*(minute)
+*          CALCULATE NUMBER OF SECONDS
+	   second = total_secs
+	ELSE
+	   stop 'Illegal calendar in tm_secs_to_date()'
+	END IF
+
+* Put it in a string
+	WRITE (tempstr,1000,ERR=5000) day, month_names(month), 
+     .      year, hour, minute, second
+
+1000	FORMAT(I2.2,'-',A3,'-',I4.4,' ',2(I2.2,':'),I2.2)
+	TM_SECS_TO_DATE = tempstr
+	GOTO 9990
+
+* Date syntax error
+ 5000	CALL TM_ERRMSG (merr_erreq, status, 'TM_SECS_TO_DATE',
+     .			no_descfile, no_stepfile,
+     .			no_errstring, no_errstring, *9000)
+ 9000	STOP
+
+* finished
+9990	RETURN
+	END
diff --git a/fmt/src/tm_set_current_calendar.F b/fmt/src/tm_set_current_calendar.F
new file mode 100644
index 0000000..3d3bf27
--- /dev/null
+++ b/fmt/src/tm_set_current_calendar.F
@@ -0,0 +1,87 @@
+      SUBROUTINE TM_SET_CURRENT_CALENDAR (set_name, status)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C     Set the current calendar name and id in common current_calendar
+C     and loads calendar info into common.
+C
+C     Returns merr_varlim if calendar is invalid, merr_ok successful completion
+C     J Davison 10.99
+C     V 1.0
+
+C  11/29/00  Ansley Manke  revise to match just 3 characters of allowed_calendars
+* V6.74 3/12 *acm* cleanup: add disclaimer
+
+C     0.00000000000000000000000000000000000000000000000000000000000000001
+
+#ifdef unix
+      include 'calendar.decl'
+      include 'calendar.cmn'
+      include 'tmap_errors.parm'
+#else
+      INCLUDE 'TMAP_FORMAT:TMAP_ERRORS.PARM'
+#endif 
+      integer         end, ndx, status
+      character*255   test_string
+
+      character*16    cal_name
+      character*(*)   set_name
+
+*************************************************************************
+
+C     Move input string to upper case
+      CALL upnsquish (set_name,test_string,end)
+
+C     LOCATE NAME IN CALENDAR TABLE
+      DO 10 ndx = 1, max_calendars
+         IF (test_string(1:3) .EQ. allowed_calendars(ndx)(1:3)) 
+     .        GOTO 100
+ 10   END DO
+
+C     error: calendar not found
+
+      status = merr_varlim
+      goto 1000
+
+C     calendar found, set current calendar
+
+c 100  cal_name = test_string(1:end)
+
+ 100  cal_name = allowed_calendars(ndx)
+
+      CALL tm_load_calendar (cal_name, status)
+
+ 1000 RETURN
+
+      END
+
diff --git a/fmt/src/tm_set_free_event.c b/fmt/src/tm_set_free_event.c
new file mode 100644
index 0000000..e0fb941
--- /dev/null
+++ b/fmt/src/tm_set_free_event.c
@@ -0,0 +1,66 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* this routine is called with either a 1 or a 0, and will set rl_event_hook
+   accordingly.  rl_event_hook is used by readline and is the procedure it
+   calls when waiting for input.  If this routine is called with a 0, 
+   rl_event_hook is set to NULL, and readline will not process any event
+   while it is waiting for input.  If the routine is called with a 1, 
+   rl_event_hook is set to free_time.  readline will process free_time. */
+
+/* had to add ifdef check for trailing underscore in routine name
+   for aix port *kob* 10/94 */
+/* 11/96 *kob* - Linux port - had to have double quotes around the STOP
+                              message */
+
+/*
+ * 10/11 *kms* - removed the contents of this function since the readline
+ *               method in the pyferret Python module (Python raw_input)
+ *               now used to read user input with readline functionality
+ */
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+void tm_set_free_event(n)
+#else
+void tm_set_free_event_(n)
+#endif
+int *n;
+{
+    ;
+}
+
diff --git a/fmt/src/tm_split_message.F b/fmt/src/tm_split_message.F
new file mode 100644
index 0000000..e846b07
--- /dev/null
+++ b/fmt/src/tm_split_message.F
@@ -0,0 +1,55 @@
+        SUBROUTINE TM_SPLIT_MESSAGE( chout, next_line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administrations (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* depending on the state of alt_messages either write this string to the
+* given unit number or save it in a GUI buffer
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V300:  6/16/93 - for prototype GUI interface
+* V6.7  *kms*  2/11  - call SPLIT_LIST to output the message appropriately
+
+* calling arguments
+        INTEGER chout
+        CHARACTER*(*) next_line
+
+*       first arg (mode) unused
+        CALL SPLIT_LIST(0, chout, next_line, 0)
+        
+        RETURN
+        END
diff --git a/fmt/src/tm_step_to_date.F b/fmt/src/tm_step_to_date.F
new file mode 100644
index 0000000..aea007a
--- /dev/null
+++ b/fmt/src/tm_step_to_date.F
@@ -0,0 +1,130 @@
+	SUBROUTINE TM_STEP_TO_DATE ( dset_num, tstep, prec,
+     .				     date, length, status )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* This function will return a string giving the date for a particular timestep
+* for a particular data set. This is done by figuring the offset from
+* 01-JAN-0000 00:00:00 in seconds, and then calculating the date.
+*
+* written 06/15/87 by Mark Verschell for PMEL/TMAP
+*
+* revision 0.00	- 06/15/87 - initial incarnation
+* revision 0.20	- 06/26/87 - changed to subroutine and added length, status
+* revision 0.21 - 07/15/88 - handles errors from TM_BREAK_DATE
+*
+* V530: *acm* 1/01 alternative calendar types; cal_id
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Arguments:
+*	dset_num - data set number
+*	tstep    - time step
+*	prec	 - precision (1 to 6 for seconds to years)
+*	date	 - returned string containing date in ASCII form
+*	length	 - length of date
+*	status	 - status at return time
+*
+	CHARACTER*(*)	date
+	INTEGER		dset_num, prec, length, status
+	REAL*8		tstep
+*
+* Inclusions
+*
+	include 'tmap_errors.parm'
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+	include 'xdset_info.cmn_text'
+	external xdset_info_data
+
+*
+* Local definitions
+*
+	CHARACTER*20	TM_SECS_TO_DATE
+	INTEGER		t0year, t0mon, t0day, t0hour, t0min, t0sec
+
+	INTEGER 	TM_GET_CALENDAR_ID, cal_id, istat
+
+	REAL*8		start_secs, offset_secs, this_secs, prec_fact(6)
+	REAL*8		TM_SECS_FROM_BC
+
+	DATA	prec_fact	/  1.,  60.,  3600.,  86400.,
+     .				   86400., 86400./
+
+* First find the offset from 01-JAN-0000 00:00:00 from the descriptor file
+
+        cal_id = TM_GET_CALENDAR_ID (ds_cal_name(dset_num))
+	CALL TM_BREAK_DATE (ds_t0time(dset_num), cal_id, t0year, 
+     .			    t0mon, t0day, t0hour, t0min, t0sec, istat)
+	IF (istat .NE. merr_ok) GOTO 9010
+	start_secs = TM_SECS_FROM_BC (cal_id, t0year, t0mon, t0day,
+     .				      t0hour, t0min, t0sec, istat)
+	IF (istat .NE. merr_ok) GOTO 9010
+
+* Find the number of seconds since start of data set for this time step
+	offset_secs = tstep*ds_time_unit(dset_num)
+
+* Total seconds to this time step since 01-JAN-0000 00:00:00
+	this_secs = start_secs + offset_secs
+
+* Adjust precision to desired amount by finding nearest multiple of precision
+* base (e.g. if precision = day; find closest integer divisible by 86400, which
+* is number of seconds in a day). If prec > 4 then find closest day and then
+* modify string
+	this_secs = DNINT(this_secs/prec_fact(prec)) * prec_fact(prec)
+
+* Convert to date
+	date = TM_SECS_TO_DATE(this_secs, cal_id, istat)
+	IF (istat .NE. merr_ok) GO TO 9010
+
+* Now if prec > 4 modify string
+	IF (prec .EQ. 5) date(1:2) = '00'
+	IF (prec .EQ. 6) date(1:6) = '00-   '
+
+* Now truncate string to desired length
+	IF (LEN(date) .GT. length) date(length+1:LEN(date)) = ' '
+
+* Finished
+	status = merr_ok
+	GOTO 9990
+
+* Errors
+ 9000	CALL TM_ERRMSG ( istat, status, 'TM_STEP_TO_DATE',
+     .	                 dset_num, no_stepfile,
+     .			 'DD-MMM-YYYY HH:MM:SS',ds_t0time(dset_num),
+     .	                 *9990 )
+
+ 9010	status = istat
+ 9990	RETURN
+	END
diff --git a/fmt/src/tm_string.F b/fmt/src/tm_string.F
new file mode 100644
index 0000000..d9b8c06
--- /dev/null
+++ b/fmt/src/tm_string.F
@@ -0,0 +1,66 @@
+	CHARACTER*13 FUNCTION TM_STRING ( dval )
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*  Will take a double precision real and output it as a string. It will be
+*  written as an integer if there is no fractional part and the value is
+*  under 1,000,000 , otherwise it will be written out in G format.
+*
+*  written 3/87 by M. Verschell for PMEL/TMAP
+*
+* revision 0.00 - 03/15/87
+* revision 0.10 - 02/15/89 - added temporary string
+* revision 0.20 - 07/14/89 - changed format from 1PG12.6 to 1PG12.5 to catch
+*			   - all real numbers
+*
+* argument
+	REAL*8	dval
+* local variable
+	CHARACTER*13	temp
+
+	temp(1:13) = ' '
+	IF (ABS(dval) .LT. 1D6) THEN
+	  IF (dval .EQ. DBLE(INT(dval))) THEN
+	    WRITE (temp(1:12),'(I12)') INT(dval)
+	    GOTO 999
+	  ENDIF
+	ENDIF
+
+	WRITE (temp(1:12),'(1PG12.5)') dval
+
+999	TM_STRING = temp
+	RETURN
+	END
diff --git a/fmt/src/tm_subsc.F b/fmt/src/tm_subsc.F
new file mode 100644
index 0000000..a02228b
--- /dev/null
+++ b/fmt/src/tm_subsc.F
@@ -0,0 +1,218 @@
+	INTEGER FUNCTION TM_SUBSC ( world_coord, grid, idim, clue )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a "world" coordinate into the subscript value on an axis by finding
+* the grid box that contains the world coordinate.
+* A clue may be provided to speed processing of irregular axes
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  12/9/90 - based on FERRET's TM_SUBSC version 2.00
+* NOTE: as of 9/90 regular axes have NOT been tested
+* 1/95 *sh* inserted support for modulo axes from FERRET's ISUBSCRIPT
+* 10/95 - use TM_WORLD instead of direct line_mem to support recursive cases
+*  1/96 - many references to isub0 remained despite 10/95 changes
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* V542 2/02 *sh* - added support for modulo length > axis length
+* V68  *acm* 1/12  ifdef double_p for double-precision ferret.
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* calling arguments:
+* world_coord	- coordinate vaule to be translated to subscript
+* grid		- underlying grid number
+* idim		- underlying axis number (1-4)
+* clue		- performance assist to code - check this as possible result
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+
+* calling argument declarations:
+	INTEGER	grid, idim, clue
+	REAL*8	world_coord
+
+* internal variable declarations:
+	LOGICAL	TM_ITS_SUBSPAN_MODULO, regular
+	INTEGER	lo_look, hi_look, ibot, itop, look, axis,
+     .		line_len, isubsc
+	INTEGER	num_mod
+	REAL 	subsc
+	REAL*8	TM_WORLD, TM_WW_AXLEN,
+     .		half_way, start, aend, span, first, last, wcoord, wwindex
+
+* we need to be able to modify the search value for modulo axes
+	wcoord = world_coord
+
+* which axis are we on ?
+	axis    = grid_line ( idim, grid )
+	line_len = line_dim( axis )
+
+* special consideration for sub-span modulo axis outside its core range
+	IF (TM_ITS_SUBSPAN_MODULO(axis) ) THEN
+	   CALL TM_WW_AX_1_N(axis, start, aend)
+	   IF ( wcoord.LT.start .OR. wcoord.GT.aend ) THEN
+	      line_len = line_len + 1
+	      regular = .FALSE.
+	   ELSE
+	      regular = line_regular( axis )
+	   ENDIF
+	ELSE
+	   regular = line_regular( axis )
+	ENDIF
+
+* initialize pointers for axes with irregularly spaced points
+	IF ( .NOT.regular ) THEN
+	   IF ( clue.GE.1 .AND. clue.LE.line_len ) THEN
+	      wwindex = TM_WORLD(clue, grid, idim, box_middle)
+* ... check clue - (clue accepted only for exact equality of coordinates)
+	      IF ( wcoord .EQ. wwindex ) THEN
+	         TM_SUBSC = clue
+	         RETURN
+	      ENDIF
+	   ENDIF
+	   ibot  = 1
+	   itop  = line_len
+	ENDIF
+
+* Modulo axis: translate world coord to within axis range
+        IF ( line_modulo( axis ) ) THEN
+* ... begin by computing axis limits as outer edges of end boxes
+	   span = TM_WW_AXLEN(axis)
+	   CALL TM_WW_AXLIMS(axis, start, aend)
+	   IF (TM_ITS_SUBSPAN_MODULO(axis)) THEN
+	      span = line_modulo_len(axis)
+	      aend = start + span
+	   ENDIF
+
+* ... now translate wcoord to within axis limits saving modulo number
+           IF     ( wcoord .GT. aend  ) THEN
+              num_mod = ( wcoord - start ) / span
+! 10/92 bug fix: if wcoord is an exact multiple of length (e.g. wccord=24.
+!       start=0., span=12.) then modulo remap to top of ax rather than bottom
+              IF ( wcoord .EQ. start+num_mod*span )
+     .                          num_mod = num_mod - 1
+           ELSEIF ( wcoord .LT. start ) THEN
+              num_mod = ( wcoord - aend  ) / span               ! (negative)
+           ELSE
+              num_mod = 0
+           ENDIF
+           wcoord = wcoord - num_mod*span
+        ENDIF
+
+* get positions of first and last points on axis
+	IF ( regular ) THEN
+	   first = line_start( axis )
+	   last  = first + line_delta( axis ) * line_len
+        ELSE
+           first = TM_WORLD(       1, grid, idim, box_middle)
+           last  = TM_WORLD(line_len, grid, idim, box_middle)
+	ENDIF
+
+* immediate solutions for given point beyond axis ends
+	IF ( wcoord .LE. first ) THEN
+	   isubsc = 1
+	ELSEIF ( wcoord .GE. last) THEN
+	   isubsc = line_len
+
+* quick sol'n if axis points are regularly spaced
+	ELSEIF ( regular ) THEN
+#ifdef double_p
+	   subsc  = ( (wcoord-first)/line_delta(axis) ) + .5
+#else
+	   subsc  = SNGL( (wcoord-first)/line_delta(axis) ) + .5
+#endif
+	   isubsc = INT( subsc ) + 1		! round up if ambiguous
+
+	ELSE
+* binary search if axis points are irregularly spaced
+* initialize search
+	   lo_look  = ibot - 1
+	   hi_look  = itop + 1	
+	   look     = ( lo_look + hi_look ) / 2
+
+* top of search loop
+ 100       wwindex = TM_WORLD(look, grid, idim, box_middle)
+	   IF ( wcoord .GE. wwindex ) THEN
+
+* answer is somewhere above current "look" position
+* keep looking at higher values setting this as new low limit for search
+	      lo_look = look
+	      look = ( look + hi_look + 1 ) / 2
+
+	   ELSE
+* answer is somewhere below current "look" position
+* keep looking at lower values setting this as new high limit for search
+	      hi_look = look
+	      look = ( look + lo_look ) / 2
+
+	   ENDIF
+
+* have we narrowed it to a 1 point range ?
+	   IF ( hi_look - lo_look .LE. 1 ) THEN
+
+* yes - we found it - choose box containing it
+* ... box boundary between lo_look and hi_look
+	      half_way = TM_WORLD(hi_look, grid, idim, box_lo_lim)
+
+* no. value in upper half of box (or on the box boundary) ?
+	      IF ( wcoord .GE. half_way ) THEN
+	         isubsc = hi_look
+
+* no. value must be in lower half of box
+	      ELSE
+	         isubsc = lo_look
+
+	      ENDIF
+	   ELSE
+
+* no - keep looking
+	      GOTO 100
+	   ENDIF
+	ENDIF
+
+* insert modulo axis correction
+        IF ( line_modulo(axis) ) THEN
+           TM_SUBSC = isubsc + num_mod*line_len
+        ELSE
+           TM_SUBSC = isubsc
+        ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_switch_nan.c b/fmt/src/tm_switch_nan.c
new file mode 100644
index 0000000..e3c75e8
--- /dev/null
+++ b/fmt/src/tm_switch_nan.c
@@ -0,0 +1,66 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <math.h>
+#include "ferretmacros.h"
+
+#define bad_val4 1.0e-34
+
+/* tm_switch_nan :
+ *  check for a missing or bad value flag of NaN.  if either flag is Nan, */
+/*  then make sure it's ds_missing_flag and if both are NaN, make sure to */
+/*  set ds_bad_flag to bad_val4     */
+
+/* *kob* - 2/18/99 */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret, see the
+*					 definition of macro DFTYPE in ferretmacros.h.
+*/
+
+void FORTRAN(switch_nan)(bad, missing)
+     DFTYPE *bad;
+     DFTYPE *missing;
+{
+  if (isnan(*bad) || isnan(*missing))
+    { 
+      if (isnan(*bad)) 
+	{
+	  *missing = *bad;
+	  *bad = bad_val4;
+	}
+    }
+}
+
diff --git a/fmt/src/tm_translate_axis.F b/fmt/src/tm_translate_axis.F
new file mode 100644
index 0000000..cd46a5a
--- /dev/null
+++ b/fmt/src/tm_translate_axis.F
@@ -0,0 +1,115 @@
+	SUBROUTINE TM_TRANSLATE_AXIS (string, idim, answer, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* convert an ascii representation of an axis limit into a floating point 
+* representation using special format rules
+*
+* programmer - Mark Verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* V530: *acm* 12/00 add calendar types; cal_id for time axes
+
+* possible formats for world coordinate values:
+*   x coord:  #  or #E  or  #W  for East, East, and West respectively
+*   y coord:  #  or #S  or  #N  for South, South, and North respectively
+*   z coord:  #
+*   t coord:  #  or dd-mmm-yyyy at hh:mm:ss  eg 14-JAN-1986 at 11:15
+*
+* revision 0.00 - 12/13/88 - from TRANSLATE_LIMITS by Steve Hankin
+* V530: *acm* 12/00 add calendar types; cal_id 
+*
+* 1/03 *kob* - g77 port - g77 won't allow intrinsic functions in PARAMETER
+*                         statements.  use an character constant instead
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_errors.parm'
+#include "gt_lib.parm"
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+	INTEGER		status, idim
+	REAL*8		answer
+
+* internal variable declarations:
+	INTEGER*4	end_pos, dy, mnth, yr, hr, mnt, scnd
+	INTEGER*4	TM_LENSTR1
+	INTEGER		TM_GET_CALENDAR_ID, cal_id
+
+	REAL*8		TM_SECS_FROM_BC
+
+* internal parameter declarations:
+	CHARACTER*1     tab 
+#ifdef NO_INTRINSIC_IN_PARAMETER
+	PARAMETER     ( tab = o'011' )
+#else
+	PARAMETER     ( tab = CHAR(9))
+#endif
+
+
+	end_pos = TM_LENSTR1( string )
+
+	IF ( idim .NE. t_dim ) THEN
+* /X /Y or /Z
+	  CALL TM_TRANSLATE_LAT_LONG ( string(1:end_pos), idim, answer,
+     .	                               status )
+	  IF ( status .NE. merr_ok ) GOTO 9990		! already reported
+
+	ELSE
+* /T
+* ... is it a timestep?
+	  READ (string(1:end_pos),*,ERR=200) answer
+	  GOTO 1000
+* ... is it a date/time string? (store as seconds for further processing)
+
+  200	  CONTINUE
+	  cal_id = 1
+          CALL TM_BREAK_DATE(string, cal_id, dy, mnth, yr, hr, 
+     .                       mnt, scnd, status)
+
+	  IF ( status .NE. merr_ok ) GOTO 9990 		! Report in call routine
+	  answer = -1.D0*TM_SECS_FROM_BC(cal_id, 
+     .                                   dy,mnth,yr,hr,mnt,scnd,status)
+	  IF (status .NE. merr_ok) GOTO 9990
+	ENDIF
+
+* successful completion
+ 1000	status = merr_ok
+
+ 9990	RETURN
+	END
diff --git a/fmt/src/tm_translate_lat_long.F b/fmt/src/tm_translate_lat_long.F
new file mode 100644
index 0000000..5ad33f1
--- /dev/null
+++ b/fmt/src/tm_translate_lat_long.F
@@ -0,0 +1,112 @@
+	SUBROUTINE TM_TRANSLATE_LAT_LONG (string,idim,answer,status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+* convert an ascii representation of a latitude or longitude value into 
+* a floating point value using special format rules
+*
+* possible formats:
+*   x coord:  #  or #E  or  #W  for East  or West,  respectively
+*   y coord:  #  or #S  or  #N  for South or North, respectively
+*   z coord:  #
+*   t coord:  #  or dd-mmm-yyyy at hh-mm-ss  eg 14-JAN-1986 at 11:15
+*
+* programmer - Mark Verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 12/14/88 - from program by Steve Hankin
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* include files
+	include 'tmap_errors.parm'
+#include "gt_lib.parm"
+
+
+	CHARACTER*(*)	string
+	LOGICAL		n_given, s_given, e_given, w_given
+	INTEGER		n_pos, s_pos, e_pos, w_pos, end_pos, status, idim
+	REAL*8		answer
+
+* initialize
+	n_pos = MAX ( INDEX(string,'N'), INDEX(string,'n') )
+	s_pos = MAX ( INDEX(string,'S'), INDEX(string,'s') )
+	e_pos = MAX ( INDEX(string,'E'), INDEX(string,'e') )
+	w_pos = MAX ( INDEX(string,'W'), INDEX(string,'w') )
+
+	n_given = n_pos .GT. 0
+	s_given = s_pos .GT. 0
+	e_given = e_pos .GT. 0
+	w_given = w_pos .GT. 0
+
+* how much of the string is numeric ?
+	end_pos = LEN ( string )
+	IF ( n_given.OR.s_given.OR.e_given.OR.w_given )	end_pos = end_pos - 1
+
+* decode the value
+	READ ( string(1:end_pos), * , ERR=9000 ) answer
+
+* make corrections for latitude/longitude notation
+	IF  ( n_given ) THEN
+
+* latN - no change
+	  IF ( idim .NE. y_dim ) GOTO 9000
+	ELSEIF ( s_given ) THEN
+
+* latS - make negative
+	  IF ( idim .NE. y_dim ) GOTO 9000
+	  answer = -answer
+	ELSEIF ( e_given ) THEN
+
+* longE - no change
+	  IF ( idim .NE. x_dim ) GOTO 9000
+	ELSEIF ( w_given ) THEN
+
+* longW - convert	
+	  IF ( idim .NE. x_dim ) GOTO 9000
+	  answer = 360. - answer
+	ENDIF
+
+	status = merr_ok
+	GOTO 9990
+
+* errors
+ 9000	CALL TM_ERRMSG ( merr_syntax, status, 'TM_TRANSLATE_LAT_LONG',
+     .	                 no_descfile, no_stepfile, 
+     .			 string, no_errstring, *9990 )
+
+ 9990	RETURN
+	END
diff --git a/fmt/src/tm_unblockify_ferret_strings.c b/fmt/src/tm_unblockify_ferret_strings.c
new file mode 100644
index 0000000..8117f67
--- /dev/null
+++ b/fmt/src/tm_unblockify_ferret_strings.c
@@ -0,0 +1,100 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*/
+
+/* 
+    The variable mr_blk1 is an array of pointers to strings
+    (to be allocated and assigned) where the string pointers
+    are spaced 8 bytes apart.
+
+    The variable pblock is a bufsiz-long character array of
+    string data where each string uses filestrlen characters
+    and is null terminated if shorter than filestrlen
+    characters.
+
+    This function copies the strings from pblock into newly 
+    allocated strings and assigns them to mr_blk1.
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdlib.h>
+
+void tm_unblockify_ferret_strings(char **mr_blk1, char *pblock,
+				  int bufsiz, int filestrlen)
+{
+  int i, n;
+  char *pinchar, *pinstr, *poutchar, **poutstr;
+
+  poutstr = mr_blk1;  /* points to each output string pointer in turn */
+  pinstr  = pblock;   /* points to each input string in turn */
+
+  for (i=0; i<bufsiz/filestrlen; i++) {
+
+    /* measure the length of the string */
+    n = 0;
+    while ( (n < filestrlen) && (pinstr[n] != '\0') )
+       n++;
+
+    /* save the pointer to the first character in this string */
+    pinchar = pinstr;
+
+    /* increment pinstr to point to the next input string */
+    pinstr += filestrlen;
+
+    /* allocate memory for this string */
+    poutchar = (char *) malloc(sizeof(char) * (n+1));
+
+    /*
+     * Free any existing string in the output array and then
+     * assign this newly allocated memory to the output array.
+     */
+    if ( *poutstr != NULL )
+       free(*poutstr);
+    *poutstr = poutchar;
+
+    /* increment poutstr to point to the next output string pointer position */
+    poutstr += (8/sizeof(char**));
+
+    /* copy this input string into the newly allocated memory */
+    n = 0;
+    while ( (n < filestrlen) && (*pinchar != '\0') ) {
+      *poutchar = *pinchar;
+      poutchar++;
+      pinchar++;
+      n++;
+    }
+    *poutchar = '\0';
+
+  }
+}
diff --git a/fmt/src/tm_unit_id.F b/fmt/src/tm_unit_id.F
new file mode 100644
index 0000000..e19fe04
--- /dev/null
+++ b/fmt/src/tm_unit_id.F
@@ -0,0 +1,129 @@
+	INTEGER FUNCTION TM_UNIT_ID( string )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* identify the string as a known unit or return 0
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 04/15/88
+* revision 1.00 - 05/26/88 - to work with TMAP routines
+* revision 1.01 - 11/21/88 - variable used check changed to specific char_initXX
+* 7/96 *sh*: check that "deg" is not hiding "degrees C" or "deg K" ...
+* V5.1 *sh* 12/99 - changed logic for matching un_name to insist on exact
+*	match with possible final "s". It was matching "Kelvin" to "in"
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+* V6.85 6/13 *acm* fix bug#2080: the check for degrees_C etc.
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xunits.cmn_text'
+	external xunits_data
+
+* calling argument declarations:
+	CHARACTER*(*)	string
+
+* internal parameter declarations:
+	INTEGER		ndeg_temp
+	PARAMETER     ( ndeg_temp = 6 )
+
+* internal variable declarations:
+	INTEGER		iun, ideg
+	INTEGER         STR_CASE_BLIND_COMPARE, TM_LENSTR1, istat, slen
+	LOGICAL		TM_HAS_STRING, match
+	CHARACTER	deg_temp(ndeg_temp)*1
+
+* initialize characters that signal "degrees" is really temperature
+	DATA deg_temp / 'C', 'K', 'F', 'c', 'k', 'f' /	
+
+* check through alternate (long) names first to avoid ambiguity
+* eg. "m" is the un_name for "meters" but also exits in many other unit names
+	DO 110 iun = 1, pun_num_alt
+
+	   IF ( un_alt_name(iun) .EQ. char_init12 ) GOTO 200
+
+	   IF ( TM_HAS_STRING( string, un_alt_name(iun) ) ) THEN
+* ... check that "deg" is not hiding "degrees C" or "deg K" ...
+	      IF ( un_alt_subsc( iun ) .EQ. pun_degrees ) THEN
+	         DO 105 ideg = 1, ndeg_temp
+	            IF (TM_HAS_STRING(string,deg_temp(ideg))) GOTO 110
+ 105	         CONTINUE
+	      ENDIF
+	      TM_UNIT_ID = un_alt_subsc( iun )
+	      RETURN
+	   ENDIF
+
+ 110	CONTINUE
+
+* now it's safe to search the list of short abbreviations
+ 200	slen = TM_LENSTR1(string)
+	DO 210 iun = pun_1st_unit, pun_last_unit
+
+	   IF ( un_name(iun) .EQ. char_init12 .OR.
+     .	        un_name(iun) .EQ. ' '             ) GOTO 210
+
+* ... check for string match or possibly plural
+	   istat = STR_CASE_BLIND_COMPARE(string, un_name(iun))
+	   match = istat .EQ. str_match
+	   IF (.NOT.match .AND. slen.GT.1) THEN
+	      istat = STR_CASE_BLIND_COMPARE(string(:slen-1), un_name(iun))
+	      match = istat .EQ. str_match
+	      IF ( match ) match = string(slen:slen).EQ.'s'
+     .			      .OR. string(slen:slen).EQ.'S'
+	   ENDIF
+
+	   IF ( match ) THEN
+* ... check that "deg" is not hiding "degrees C" or "deg K" ...
+	      IF ( iun .EQ. pun_degrees ) THEN
+	         DO 205 ideg = 1, ndeg_temp
+	            IF (TM_HAS_STRING(string,deg_temp(ideg))) GOTO 210
+ 205	         CONTINUE
+	      ENDIF
+	      TM_UNIT_ID = iun
+	      RETURN
+	   ENDIF
+
+ 210	CONTINUE
+
+* not found
+	TM_UNIT_ID = 0
+	RETURN
+
+	END
diff --git a/fmt/src/tm_unix_versions.c b/fmt/src/tm_unix_versions.c
new file mode 100644
index 0000000..e01b37d
--- /dev/null
+++ b/fmt/src/tm_unix_versions.c
@@ -0,0 +1,186 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* tm_unix_versions.c */
+/* code to assist with the creation of file version numbers on Unix systems */
+/*
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* originally written for DECstation under Ultrix operating system
+* V1.0 5/6/91
+* v1.1 10/17/91  -- <kob>
+*  now pass a path name into high_ver_name to enable a search into another
+*    directory besides the current one.
+*/
+/* based on readdir man  pages */
+/* routines:
+   char *tm_c_ver_name_(name, next_name,path)
+       ... return the file name of the next version to create
+   int high_ver_name(name, path)
+       ... return the (integer) value of the highest existing version
+   int tilda_strcmp( rootnam, testnam )
+       ... compare to see if "test" name is a version of "root" name
+*/
+
+/* had to add ifdef check for trailing underscore in routine name
+   for aix port *kob* 10/94 */
+
+
+#include <Python.h> /* make sure Python.h is first */
+#include <sys/types.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+
+
+int tilda_strcmp( rootnam, testnam )
+
+   char rootnam[], testnam[];
+
+/* compare root name with test to see if they match apart from ".~nnn~"
+   If they do, return nnn (0 for identical match).
+   Else return -1  */
+
+{
+   int rlen, tlen, i, tilda;
+   char tbuff[4];
+
+   rlen = strlen(rootnam);
+   tlen = strlen(testnam);
+
+/* quick screen 1:
+   test name may be exact same length, or at least 4 chars (".~n~") longer */
+   if ( tlen != rlen && tlen < rlen+4 ) return (-1);
+    
+/* quick screen 2:
+   if test name is a version it must end in tilda */
+   if ( tlen != rlen && testnam[tlen-1] != '~' ) return (-1);
+
+/* root name must match test name for its full length */
+   for (i=0 ; (rootnam[i] != '\0') && (rootnam[i]==testnam[i]) ; i++) ;
+   if ( i != rlen ) return (-1);
+     
+/* identically the same name ? */
+   if ( rlen == tlen ) return 0;
+
+/* next two characters must be ".~" and last must be "~" */
+   if ( testnam[rlen]   != '.' ||  testnam[rlen+1] != '~' ) return (-1);
+
+/* intervening characters must be digits */
+   for (i=rlen+2; i<tlen-1; i++) {
+     if ( !isdigit(testnam[i]) ) return (-1);
+   }
+
+/* we have found a numbered version of the root file */
+/* decode the ~nnn~ value */
+   strncpy( tbuff, testnam+rlen+2, tlen-rlen-2 );
+   tbuff[tlen-rlen-3] = '\0';
+   sscanf(tbuff, "%d", &tilda );
+   return tilda;
+}
+
+
+int high_ver_name(name,path)
+  char name[], path[];
+/* find the highest numbered version of file "name" in the given directory */
+/* if no directory is given then the current directory is used.         */
+/* Also, if given path does not exist, then the procedure is exited  */
+/* modified 10/91 to do this        <kob> */
+
+
+{
+  int next, tilda=(-1);
+  struct dirent *dp;
+  DIR *dirp;
+  int closedir();
+
+/*  dirp = opendir("."); */
+
+  if (path[0] == '.' || path[0] == ' ')
+    dirp = opendir(".");
+  else
+    dirp = opendir(path);
+  if (dirp != NULL)  {
+    for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)){
+      next = tilda_strcmp( name, dp->d_name);
+      if ( next > tilda ) tilda = next;
+    }
+	     
+    closedir(dirp);
+  }
+
+  return tilda; 
+	    
+}
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+char *tm_c_ver_name(name, next_name,path)
+#else
+char *tm_c_ver_name_(name, next_name,path)
+#endif
+  char name[], next_name[], path[];
+/* generate the name for the next version of a file in this directory */
+
+{
+  int high, len;
+
+/* get value of current highest version */
+  high = high_ver_name(name,path);
+
+  if ( high == (-1) )
+/* ... no versions currently exist */
+    next_name[0] = '\0';
+
+  else {
+    strcpy ( next_name, name );
+    len = strlen(name);
+    next_name[len] = '.';
+    next_name[len+1] = '~';
+    sprintf( next_name+len+2, "%d", high+1 );
+    len = strlen(next_name);
+    next_name[len] = '~';
+    next_name[len+1] = '\0';
+  }
+
+  return next_name;
+}
+
+
+
diff --git a/fmt/src/tm_use_dyn_grid.F b/fmt/src/tm_use_dyn_grid.F
new file mode 100644
index 0000000..19d7985
--- /dev/null
+++ b/fmt/src/tm_use_dyn_grid.F
@@ -0,0 +1,59 @@
+	SUBROUTINE TM_use_dyn_grid( grid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Increment the usage count for this grid
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 9/13/95 for Ferret version 4.2
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER grid
+
+	grid_use_cnt(grid) = grid_use_cnt(grid) + 1
+
+	RETURN
+
+	END
diff --git a/fmt/src/tm_use_line.F b/fmt/src/tm_use_line.F
new file mode 100644
index 0000000..a969930
--- /dev/null
+++ b/fmt/src/tm_use_line.F
@@ -0,0 +1,64 @@
+	SUBROUTINE TM_use_line( line )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* increment the usage count on a line
+* see docs in tm_allo_dyn_line
+
+* Steve Hankin  NOAA/PMEL/TMAP
+
+* 10/3/95 for Ferret version 4.2
+* 5/00 *sh* - check to make sure the line is not munknown
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* Argument definitions
+	INTEGER line
+
+
+	IF (line.GT.0 .AND. line.LE.line_ceiling)
+     .		line_use_cnt(line) = line_use_cnt(line) + 1
+
+* always successful completion
+	RETURN
+
+	END
diff --git a/fmt/src/tm_world.F b/fmt/src/tm_world.F
new file mode 100644
index 0000000..5c93cd3
--- /dev/null
+++ b/fmt/src/tm_world.F
@@ -0,0 +1,94 @@
+	DOUBLE PRECISION FUNCTION TM_WORLD ( isubscript, grid_num, idim,
+     .					     where_in_box )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a subscript value on a grid into a "world" coordinate
+* position within the grid box corresponding to the given subscript is
+* determined by the value where_in_box
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+*
+* revision 0.00 - 04/16/86
+* revision 1.00 - 03/10/87 - line data in COMMON/*VARIABLES*/
+* revision 1.10 - 03/23/87 - added new TMAP library: time axes, file var. names
+* revision 1.20 - 02/18/88 - incorporated "regular" axes; trapped "unspecified"
+*			     subscripts
+* revision 1.30 - 08/09/88 - mod to reflect storage of box coords not sizes (mv)
+* revision 1.31 - 11/29/88 - munknown, mnormal changed to mpsnorm, mpsunkn (mv)
+* revision 2.00 - 12/12/88 - changed to reflect storage of box locations instead
+*			     of box sizes for irregular axis... (mv)
+* revision 2.10 - 01/25/89 - Added ability to handle regular modulo axis
+* revision 2.11 - 01/07/91 - added "*" to comment above for RISC compiler
+* 10/16/95 - for Ferret V4.20 - added recursive response for child axes of
+*			irregularly-spaced axes
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* *sh* 9/99 - allow input subscript to be unspecified_int4 as long as the
+*		underlying axis is modulo
+* V530 *sh* 10/00 - guts extracted into TM_WORLD_AX
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* Include files
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	isubscript, grid_num, idim, where_in_box
+
+* internal variable declarations:
+	INTEGER	iaxis
+	REAL*8	TM_WORLD_AX
+
+* initialize
+	iaxis    = grid_line( idim, grid_num )
+	IF ( iaxis .EQ. mpsnorm
+     .	.OR. iaxis .EQ. mpsunkn
+     .	.OR. (isubscript .EQ. unspecified_int4 
+     .	      .AND. .NOT.line_modulo(iaxis) )     ) THEN
+	  TM_WORLD = unspecified_val8
+	  RETURN
+	ENDIF
+
+	TM_WORLD = TM_WORLD_AX ( isubscript, iaxis, where_in_box )
+
+	RETURN
+	END
+
+
diff --git a/fmt/src/tm_world_ax.F b/fmt/src/tm_world_ax.F
new file mode 100644
index 0000000..8677eb2
--- /dev/null
+++ b/fmt/src/tm_world_ax.F
@@ -0,0 +1,165 @@
+	DOUBLE PRECISION FUNCTION TM_WORLD_AX( isubscript, iaxis,
+     .					       where_in_box )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert a subscript value on an axis into a "world" coordinate
+* position within the grid box corresponding to the given subscript is
+* determined by the value where_in_box
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V530 10/00 *sh* - extracted from tm_world so that it could be called from
+*		    routines that know the axis but not a container grid
+* V533 6/01 *sh* - using TM_AXIS_RECURSIVE
+*      10/01 *kob* - change TM_AXIS_RECURSIVE to proper logical type
+* V541 2/02 *sh* - added support for subspan modulo axes
+*		 - slight change to calculation for all modulo axes
+* V542 10/02 *sh* - bug fix for irregular, subspan modulo
+
+* Include files
+#include "gt_lib.parm"
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+	external xgt_grid_data
+
+* calling argument declarations:
+	INTEGER	isubscript, iaxis, where_in_box
+
+* internal variable declarations:
+	LOGICAL	TM_AXIS_RECURSIVE, TM_ITS_SUBSPAN_MODULO,
+     .		 recursive
+	INTEGER	TM_MODULO_LINE_DIM, isub, line_len, rmod
+	REAL*8	TM_WORLD_RECUR, TM_MODULO_AXLEN, 
+     .		midpoint, box_size, tempwld, lo, hi
+
+* initialize
+	line_len = TM_MODULO_LINE_DIM( iaxis )
+
+* if this is a child (e.g. every Nth point) of an irregularly-spaced
+* axis then use a recursive C routine to find the answer
+	recursive = iaxis .GT. max_lines
+	IF ( recursive ) THEN
+	  recursive = TM_AXIS_RECURSIVE(iaxis) 
+	  IF ( recursive ) THEN
+	    TM_WORLD_AX = TM_WORLD_RECUR(
+     .			isubscript,iaxis,where_in_box,max_lines,
+     .			line_mem,line_parent,line_class,line_dim,line_start,
+     .			line_delta,line_subsc1,line_modulo,
+     .			line_modulo_len,line_regular )
+	    RETURN
+	  ENDIF
+	ENDIF
+
+* force given subsc to data range as appropriate for modulo or non-modulo axes
+	IF ( line_modulo( iaxis ) ) THEN
+	  isub = MOD(isubscript-1,line_len) + 1
+	  IF (isub .LE. 0) isub = isub + line_len
+	ELSE
+	  isub = MIN( line_len, MAX( 1, isubscript ) )
+	ENDIF
+
+	IF ( TM_ITS_SUBSPAN_MODULO(iaxis) .AND. isub.EQ.line_len ) THEN
+* given index falls in the "void" region of a subspan modulo axis
+* ... get the box_hi_lim of the Nth point in the core region
+	  CALL TM_WW_AXLIMS(iaxis, lo, hi)
+* ... now where within the grid box ?
+	  IF ( where_in_box .EQ. box_lo_lim ) THEN
+	    tempwld = hi
+	  ELSEIF ( where_in_box .EQ. box_middle ) THEN
+	    tempwld = ((lo+line_modulo_len(iaxis)) + hi) / 2.
+	  ELSE
+	    tempwld = lo + line_modulo_len(iaxis)
+	  ENDIF
+	  IF (isubscript .LE. 0) THEN
+	    rmod = isubscript/line_len - 1
+	  ELSE
+	    rmod = (isubscript-1)/line_len
+	  ENDIF
+	  TM_WORLD_AX = tempwld + rmod*line_modulo_len(iaxis)
+
+	ELSEIF ( line_regular( iaxis ) ) THEN
+* regularly spaced points
+* ... calculate midpoint and box_size values
+	  midpoint = line_start(iaxis) + (isub-1)*line_delta(iaxis)
+	  box_size = line_delta(iaxis)
+* ... now where within the grid box ?
+	  IF ( where_in_box .EQ. box_lo_lim ) THEN
+	    tempwld = midpoint - ( box_size / 2. )
+	  ELSEIF ( where_in_box .EQ. box_middle ) THEN
+	    tempwld = midpoint
+	  ELSE
+	    tempwld = midpoint + ( box_size / 2. )
+	  ENDIF
+	  IF ( line_modulo( iaxis ) ) THEN
+	    IF (isubscript .LE. 0) THEN
+	      rmod = isubscript/line_len - 1
+	    ELSE
+	      rmod = (isubscript-1)/line_len
+	    ENDIF
+	    TM_WORLD_AX = tempwld + rmod*TM_MODULO_AXLEN(iaxis)
+	  ELSE
+	    TM_WORLD_AX = tempwld
+	  ENDIF
+
+	ELSE
+* irregularly spaced points
+* ... keep subscript within bounds ( between 1 and dimension of axis )
+	  isub  = isub + line_subsc1(iaxis) - 1
+* ... now where within the grid box ?
+	  IF ( where_in_box .EQ. box_lo_lim ) THEN
+	    tempwld = line_mem(isub+line_dim(iaxis))
+	  ELSEIF ( where_in_box .EQ. box_middle ) THEN
+	    tempwld = line_mem(isub)
+	  ELSE
+	    tempwld = line_mem(isub+line_dim(iaxis)+1)
+	  ENDIF
+	  IF ( line_modulo( iaxis ) ) THEN
+	    IF (isubscript .LE. 0) THEN
+	      rmod = isubscript/line_len - 1
+	    ELSE
+	      rmod = (isubscript-1)/line_len
+	    ENDIF
+	    TM_WORLD_AX = tempwld + rmod*TM_MODULO_AXLEN(iaxis)
+	  ELSE
+	    TM_WORLD_AX = tempwld
+	  ENDIF
+
+	ENDIF
+
+	RETURN
+	END
+
+
diff --git a/fmt/src/tm_world_recur.c b/fmt/src/tm_world_recur.c
new file mode 100644
index 0000000..1111977
--- /dev/null
+++ b/fmt/src/tm_world_recur.c
@@ -0,0 +1,303 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/*      tm_world_recur - recursive C routine to locate the value of a
+	coordinate from its index where the underlying axis is the child
+	of some other axis
+
+  See the FORTRAN routine
+	DOUBLE PRECISION FUNCTION TM_WORLD
+  as a reference
+
+  TMAP interactive data analysis program
+
+  programmer - steve hankin
+  NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+   revision history:
+   10/95 - original
+    5/99 *sh* - bug fix: modulo irregular axes get wrong memory subscript
+    V510: 4/00 *sh* - the arrays line_parent and line_class are now indexed
+                      from zero instead of from max_lines
+    V541: 2/02 *sh* - added support for subspan modulo axes
+                    - fixed bug in strides on modulo parent axis
+
+    V542: 10/02 *sh* - serious bug fixes in non-modulo subspan modulo
+
+   compile this with
+   cc -c -g tm_world_recur.c
+   (and use -D_NO_PROTO for non-ANSI compilers)
+*/ 
+
+/* local macro definitions */
+#define PLINE_CLASS_BASIC   0
+#define PLINE_CLASS_STRIDE  1
+#define PLINE_CLASS_MIDPT   2
+#define PLINE_CLASS_FOREIGN 3
+#define PLINE_CLASS_FFT     4
+#define BOX_LO_LIM          1
+#define BOX_MIDDLE          2
+#define BOX_HI_LIM          3
+
+#define MIN(x, y) (( (x) < (y)) ? (x) : (y))
+#define MAX(x, y) (( (x) < (y)) ? (y) : (x))
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+
+/* prototype for FORTRAN boolean function */
+int  FORTRAN(tm_its_subspan_modulo) (int *axis);
+void FORTRAN(tm_ww_axlims) (int *axis, double *lo, double *hi);
+double FORTRAN(tm_modulo_axlen) (int *axis);
+
+double FORTRAN(tm_world_recur)
+     ( int *isubscript, int *iaxis, int *where_in_box,
+       int *max_lines, double line_mem[], int line_parent[],
+       int line_class[], int line_dim[], 
+       double line_start[], double line_delta[],
+       int line_subsc1[], int line_modulo[], double line_modulo_len[],
+       int line_regular[] )
+
+{
+  double tempwld, tm_world;
+  int isub, rmod;
+  int axis = *iaxis;   /* these FORTRAN arrs start at 0 like C */
+  int line_len = line_dim[axis];
+
+/*
+   if this is a child (e.g. every Nth point) of an irregularly-spaced
+   axis then use a recursive C routine to find the answer
+*/
+  int recursive = axis > *max_lines;
+  if ( recursive ) {
+    recursive = line_parent[axis] != 0;    /* could use "&&" */
+    if ( recursive ) {
+      int new_ss, lo_ss, hi_ss, parent_len;
+      int new_where;
+      switch (line_class[axis]) {
+      case PLINE_CLASS_STRIDE:
+/* 5/99 - in irreg axis striding the box edges cannot simply be read from
+          the box edge array (think about it) So we have xtra logic here.
+*/
+	new_ss = (int)line_start[axis]
+	             +(*isubscript-1)*(int)line_delta[axis];
+	if ( line_regular[axis] || *where_in_box==BOX_MIDDLE ) {
+
+	  tm_world = FORTRAN(tm_world_recur)
+	    (&new_ss,
+	     &(line_parent[axis]),
+	     where_in_box,
+	     max_lines, line_mem, line_parent,
+	     line_class, line_dim,
+	     line_start, line_delta,
+	     line_subsc1, line_modulo, line_modulo_len,
+	     line_regular );
+
+	} else {   /*  !!!! EXTRA LOGIC FOR IRREGULAR AXIS STRIDES */
+	  /* cases to consider: interpolate to neighbor above or below
+	                        use lower or upper limit of entire axis
+	  */	  
+	  if (*where_in_box ==  BOX_LO_LIM) {
+	    lo_ss = (int)line_start[axis]
+	             +(*isubscript-2)*(int)line_delta[axis];
+	    hi_ss = new_ss;
+	  } else {
+	    lo_ss = new_ss;
+	    hi_ss =  (int)line_start[axis]
+	             +(*isubscript-0)*(int)line_delta[axis];
+	  }
+
+	  parent_len = line_dim[ line_parent[axis] ];
+	  if ( line_modulo[ line_parent[axis] ]   /* 2/02 bug fix */
+	       || (lo_ss>=1 && hi_ss<=parent_len) ) {  /* interpolate */
+	    new_where = BOX_MIDDLE;
+	    tm_world = 0.5 * (
+			      FORTRAN(tm_world_recur)
+			      (&lo_ss,
+			       &(line_parent[axis]),
+			       &new_where,
+			       max_lines, line_mem, line_parent,
+			       line_class, line_dim,
+			       line_start, line_delta,
+			       line_subsc1, line_modulo, line_modulo_len,
+			       line_regular)
+	                  +   
+			      FORTRAN(tm_world_recur)
+			      (&hi_ss,
+			       &(line_parent[axis]),
+			       &new_where,
+			       max_lines, line_mem, line_parent,
+			       line_class, line_dim,
+			       line_start, line_delta,
+			       line_subsc1, line_modulo, line_modulo_len,
+			       line_regular)
+			      );
+	  } else if (*where_in_box ==  BOX_LO_LIM) { /* lower axis edge */
+	    new_ss = 1;
+	    tm_world = FORTRAN(tm_world_recur)
+	      (&new_ss,
+	       &(line_parent[axis]),
+	       where_in_box,
+	       max_lines, line_mem, line_parent,
+	       line_class, line_dim,
+	       line_start, line_delta,
+	       line_subsc1, line_modulo, line_modulo_len, line_regular);
+	  } else {  /* upper axis edge */
+	    new_ss = parent_len;
+	    tm_world = FORTRAN(tm_world_recur)
+	      (&new_ss,
+	       &(line_parent[axis]),
+	       where_in_box,
+	       max_lines, line_mem, line_parent,
+	       line_class, line_dim,
+	       line_start, line_delta,
+	       line_subsc1, line_modulo, line_modulo_len, line_regular);
+	  }
+	}
+	break;
+
+      case PLINE_CLASS_MIDPT:
+	tm_world = FORTRAN(tm_world_recur)
+	  (isubscript,iaxis,where_in_box,
+	   max_lines, line_mem, line_parent,
+	   line_class, line_dim,
+	   line_start, line_delta,
+	   line_subsc1, line_modulo, line_modulo_len, line_regular);
+	break;
+      default:
+	tm_world = -999.;
+      }
+      return(tm_world);
+    }
+  }
+
+/* 
+   not a recursive access - return the same result that TM_WORLD would have.
+   Force given subsc to data range as appropriate for modulo or non-modulo axes
+*/
+  if ( FORTRAN(tm_its_subspan_modulo) (&axis) ) line_len++;  /* 2/02 mod */
+  if ( line_modulo[axis] ) {
+    isub = ((*isubscript-1)%line_len) + 1 ;  /* inserted "+1" 5/99 */
+    if (isub <= 0)
+      isub += line_len;
+  }
+  else
+      isub = MIN( line_len, MAX( 1, *isubscript ) );
+
+/*
+    the given index  falls in the "void" region of a subspan modulo axis
+    ... get the box_hi_lim of the Nth point in the core region
+*/
+  if  ( FORTRAN(tm_its_subspan_modulo) (&axis)
+	&& isub == line_len ) {
+    double lo, hi;
+    FORTRAN(tm_ww_axlims) (&axis,&lo, &hi);
+/* ... now where within the grid box ? */
+    if ( *where_in_box == BOX_LO_LIM )
+      tempwld = hi;
+    else if ( *where_in_box == BOX_MIDDLE )
+      tempwld = ( hi + (lo+line_modulo_len[axis]) )/2.;
+    else
+      tempwld = lo + line_modulo_len[axis];
+    
+    if (*isubscript <= 0)
+      rmod = *isubscript/line_len - 1;
+    else
+      rmod = (*isubscript-1)/line_len;
+    tm_world = tempwld + rmod*line_modulo_len[axis];
+	    
+
+/*
+   regularly spaced points
+*/
+    } else if ( line_regular[axis] ) {
+/* ... calculate midpoint and box_size values */
+    double midpoint = line_start[axis] + (isub-1)*line_delta[axis];
+    double box_size = line_delta[axis];
+/* ... now where within the grid box ? */
+    if ( *where_in_box == BOX_LO_LIM )
+      tempwld = midpoint - ( box_size / 2. );
+    else if ( *where_in_box == BOX_MIDDLE )
+      tempwld = midpoint;
+    else
+      tempwld = midpoint + ( box_size / 2. );
+    
+    if ( line_modulo[axis] ) {
+      if (*isubscript <= 0)
+	rmod = ( *isubscript/line_len - 1 );
+      else
+	rmod = ( (*isubscript-1)/line_len );
+      tm_world = tempwld + rmod * FORTRAN(tm_modulo_axlen) (&axis);
+    }
+    else
+      tm_world = tempwld;
+  }
+  else
+    {
+/*
+  irregularly spaced points
+*/
+/* ... xlate subscript to location in line_mem array */
+      isub  += line_subsc1[axis] - 1;
+      isub--;      /* 5/99 switch to C-style zero-referenced indexing */
+/* ... now, where within the grid box ? */
+      if      ( *where_in_box == BOX_LO_LIM )
+	tempwld = line_mem[isub+line_dim[axis]];
+      else if ( *where_in_box == BOX_MIDDLE )
+	tempwld = line_mem[isub];
+      else
+	tempwld = line_mem[isub+line_dim[axis]+1];
+      
+      if ( line_modulo[axis] ) {
+	if (*isubscript <= 0)
+	  rmod = *isubscript/line_len - 1;
+	else
+	  rmod = (*isubscript-1)/line_len;
+	
+	tm_world = tempwld + rmod * FORTRAN(tm_modulo_axlen) (&axis);
+      }
+      else
+	tm_world = tempwld;
+    }
+  return(tm_world);
+  
+}
+
diff --git a/fmt/src/tm_ww_ax_1_n.F b/fmt/src/tm_ww_ax_1_n.F
new file mode 100644
index 0000000..129235e
--- /dev/null
+++ b/fmt/src/tm_ww_ax_1_n.F
@@ -0,0 +1,66 @@
+	SUBROUTINE TM_WW_AX_1_N (axis, lo, hi)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return the coordinates of the first and Nth coordinate points of an axis
+* Modulo is ignored in this calculation
+
+* V541 *sh* 2/02
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+	REAL*8 lo, hi
+
+* internal variable declarations
+	INTEGER	isub1, llen
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	  lo = unspecified_val8
+	  hi = unspecified_val8
+	ELSEIF ( line_regular(axis) ) THEN
+	  lo = line_start(axis)
+	  hi = line_start(axis) + (line_dim(axis)-1)*line_delta(axis)
+	ELSE
+	  isub1 = line_subsc1(axis)
+	  llen = line_dim(axis)
+	  lo = line_mem(isub1)
+	  hi = line_mem(isub1 + llen - 1)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_ww_axlen.F b/fmt/src/tm_ww_axlen.F
new file mode 100644
index 0000000..609107a
--- /dev/null
+++ b/fmt/src/tm_ww_axlen.F
@@ -0,0 +1,59 @@
+	REAL*8 FUNCTION TM_WW_AXLEN (axis)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return length of an axis in world coordinates, ignoring its modulo character
+* If it has a modulo length specified, then return that.
+
+* V541 *sh* 2/02
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+
+* internal variable declarations
+	REAL*8 lo, hi
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	  TM_WW_AXLEN = unspecified_int4
+	ELSE
+	  CALL TM_WW_AXLIMS(axis, lo, hi)
+	  TM_WW_AXLEN = hi - lo
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_ww_axlims.F b/fmt/src/tm_ww_axlims.F
new file mode 100644
index 0000000..f2b5a7f
--- /dev/null
+++ b/fmt/src/tm_ww_axlims.F
@@ -0,0 +1,67 @@
+	SUBROUTINE TM_WW_AXLIMS (axis, lo, hi)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Return the lowest and highest points along the span of an axis
+* For a regular axis this will be 1/2 delta below/above the 1st/Nth coordinates
+* Modulo is ignored in this calculation
+
+* V541 *sh* 2/02
+
+	include 'tmap_dims.parm'
+#include "gt_lib.parm"
+	include	'xtm_grid.cmn_text'
+
+* calling argument declarations
+	INTEGER axis
+	REAL*8 lo, hi
+
+* internal variable declarations
+	INTEGER	isub1, llen
+
+	IF ( axis .LT. 0 .OR. axis .GT. line_ceiling ) THEN
+	  lo = unspecified_val8
+	  hi = unspecified_val8
+	ELSEIF ( line_regular(axis) ) THEN
+	  lo = line_start(axis) - 0.5D0*line_delta(axis)
+	  hi = lo + line_dim(axis)*line_delta(axis)
+	ELSE
+	  isub1 = line_subsc1(axis)
+	  llen = line_dim(axis)
+	  hi = line_mem(isub1 + 2*llen)
+	  lo = line_mem(isub1 +   llen)
+	ENDIF
+
+	RETURN
+	END
diff --git a/fmt/src/tm_ymd_time_convrt.F b/fmt/src/tm_ymd_time_convrt.F
new file mode 100644
index 0000000..a1b50db
--- /dev/null
+++ b/fmt/src/tm_ymd_time_convrt.F
@@ -0,0 +1,83 @@
+      SUBROUTINE TM_YMD_TIME_CONVRT( yymmdd,
+     .                               mon, day, yr, hr, min, sec)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* decode a double precision yyyymmddhhmmss into its component parts
+
+* Programmer Steve Hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* revision 0.0 - 2/95  -- specifically for accessing CDC files
+
+* argument definitions:
+*	yymmdd	 - double precision input
+*       mon, day, yr, hr, min, sec  - pieces of time !!
+
+* argument declarations
+      INTEGER mon, day, yr, hr, min, sec
+      REAL*8  yymmdd
+
+* internal variable declarations
+      INTEGER itmp, ymd, hms
+
+* split off the hhmmss fields
+      ymd = yymmdd/1000000		!yyyymmdd
+      hms = yymmdd - ymd*1000000.D0	!hhmmss
+
+      itmp = hms/100
+      sec  = hms - 100*itmp
+      hr   = itmp/100
+      min  = itmp - 100*hr
+
+      itmp = ymd/100
+      day  = ymd - 100*itmp
+      yr   = itmp/100
+      mon  = itmp - 100*yr
+
+* CDC uses a climatological month like "100000000" for January
+* here we shift the day=0 to day=15, arbitrarily
+      IF (day .EQ. 0) day = 15
+
+* to avoid the damn nit-picky stuff about negative times we will encode
+* the climatological dates as year 1
+      IF ( yr .EQ. 0 ) yr = 1
+
+
+      RETURN	
+      END
+
+
diff --git a/fmt/src/urlencode.c b/fmt/src/urlencode.c
new file mode 100644
index 0000000..efeade6
--- /dev/null
+++ b/fmt/src/urlencode.c
@@ -0,0 +1,109 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <string.h>
+
+/* Code from http://geekhideout.com/urlcode.shtml
+Comments:
+
+URL Encoding/Decoding in C
+Recently I had the need to encode and decode URL-encoded strings. After doing a 
+brief search of what was available, I found that most of the code I was seeing 
+wasn't terribly efficient and/or was rather poorly written. I decided to whip 
+up my own routines and am sharing them here.
+
+Public Domain
+
+To the extent possible under law, Fred Bulback has waived all copyright and 
+related or neighboring rights to URL Encoding/Decoding in C. This work is 
+published from: United States.
+
+ACM 2/2013: v6.85 For addition of LET/REMOTE qualifier. 
+url_encode was edited to send input string and output string as 
+arguments and to return the length of the encoded string.
+*/
+
+/* Converts a hex character to its integer value */
+char from_hex(char ch) {
+  return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
+}
+
+/* Converts an integer value to its hex character*/
+char to_hex(char code) {
+  static char hex[] = "0123456789abcdef";
+  return hex[code & 15];
+}
+
+/* Returns a url-encoded version of str */
+/* IMPORTANT: be sure to free() the returned string after use */
+void *url_encode_(char *str, char *outstr, int *outlen) {
+  char *pstr = str, *pbuf = outstr;
+  while (*pstr) {
+    if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~') 
+      *pbuf++ = *pstr;
+    else if (*pstr == ' ') 
+      *pbuf++ = '+';
+    else 
+      *pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15);
+    pstr++;
+  }
+  *outlen = strlen(outstr);
+  *pbuf = '\0';
+  return 0;
+}
+
+/* Returns a url-decoded version of str */
+/* IMPORTANT: be sure to free() the returned string after use */
+int *url_decode(char *str, char *outstr) {
+  char *pstr = str, *pbuf = outstr;
+  while (*pstr) {
+    if (*pstr == '%') {
+      if (pstr[1] && pstr[2]) {
+        *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
+        pstr += 2;
+      }
+    } else if (*pstr == '+') { 
+      *pbuf++ = ' ';
+    } else {
+      *pbuf++ = *pstr;
+    }
+    pstr++;
+  }
+  *pbuf = '\0';
+  return 0;
+}
+
diff --git a/fmt/src/xalt_messages_data.F b/fmt/src/xalt_messages_data.F
new file mode 100644
index 0000000..1a0005a
--- /dev/null
+++ b/fmt/src/xalt_messages_data.F
@@ -0,0 +1,56 @@
+	BLOCK DATA XALT_MESSAGES_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* 2/28/95
+
+#ifdef unix
+	include 'xalt_messages.cmn_text'
+#else
+	INCLUDE 'TMAP_FORMAT:XALT_MESSAGES.CMN_TEXT'
+#endif
+
+	DATA	alt_messages / .FALSE. /
+
+	DATA	alt_nlines / 0 /
+
+	END
diff --git a/fmt/src/xdiag_ctrl_data.F b/fmt/src/xdiag_ctrl_data.F
new file mode 100644
index 0000000..f89e0a0
--- /dev/null
+++ b/fmt/src/xdiag_ctrl_data.F
@@ -0,0 +1,54 @@
+	BLOCK DATA XDIAG_CTRL_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 -  3/15/91
+* 2/92 *sh* added ds_dset_type to support netCDF
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+* COMMON/XDIAG_CTRL.....variables to control diagnostic output
+
+	include 'xdiag_ctrl.cmn_text'
+
+      DATA	tmap_diag_on    /.FALSE./
+      DATA      ds_dset_type    /'    '/
+      END
diff --git a/fmt/src/xdset_info_data.F b/fmt/src/xdset_info_data.F
new file mode 100644
index 0000000..34da8f2
--- /dev/null
+++ b/fmt/src/xdset_info_data.F
@@ -0,0 +1,148 @@
+	BLOCK DATA XDSET_INFO_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* various pre-defined variables for COMMON/XDSET_INFO
+* programmer - mark verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 07/29/86
+* revision 0.10 - 05/07/87 - initializes new integration_tstep variable
+* revision 0.11 - 07/07/87 - removed revision and increased size of type/format
+* revision 0.20 - 08/30/87 - changed to reflect new layout of common
+* revision 0.21 - 10/30/87 - eliminated ds_make_dscrp_rev
+* revision 0.30 - 07/27/88 - added variables from TS descriptor type
+* revision 0.31 - 08/10/88 - made number of aux_parms a parameter, aux_parm now
+*			     2 vars ds_aux_name, ds_aux_text
+* revision 0.40 - 10/25/88 - Added modulo variables
+* revision 0.41 - 11/21/88 - variable initialization changed to char_initXX
+* revision 0.42 - 02/08/89 - removed ds_var_modline
+* revision 0.43 - 02/15/89 - removed ds_open
+* Unix/RISC port - 4/25/91 *sh*: increased ds_name and ds_des_name size
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* v500 - *kob* 3/99 -  initialize ds_var_code, ds_var_units, ds_var_title
+*                      and ds_var_titl_mod w/ char_inits of proper new value
+* v500 - *kob* 4/99 - initialize ds_des_name with char_init256	
+* v530 - *acm* 1/01 - add ds_cal_name
+* v540 *acm* 10/01 increase length of ds_name
+* v540 *acm* 10/01  remove VMS include statements
+* v552 *acm*  4/03 Initialize ds_var_off, ds_var_scale, ds_var_scaleit
+* v552 *acm*  5/03 change ds_var_code length to 128
+* v604 *acm* 7/07 increase length of ds_name, ds_des_name
+
+#include "tmap_dset.parm"		
+	include 'tmap_dims.parm'		! parameter definitions
+	include 'xdset_info.cmn_text'
+
+* local parameters
+	INTEGER		max6axes, maxnvars, maxdsets_aux, maxdsets_parm
+	PARAMETER	(max6axes = 6*maxdsets)
+	PARAMETER	(maxnvars = nferdims*maxvars)
+	PARAMETER	(maxdsets_aux = maxdsets*num_aux)
+	PARAMETER	(maxdsets_parm = maxdsets*num_parm)
+
+* Initialize variables associated with data set
+	DATA	ds_type			/maxdsets*char_init04/
+	DATA	ds_format		/maxdsets*char_init04/
+	DATA	ds_source_class		/maxdsets*char_init16/
+	DATA	ds_source		/maxdsets*char_init16/
+	DATA	ds_subsource		/maxdsets*char_init16/
+	DATA	ds_prog_rev		/maxdsets*char_init04/
+********************************************************************************
+	DATA	ds_expnum		/maxdsets*char_init04/
+	DATA	ds_modnum		/maxdsets*char_init04/
+	DATA	ds_title		/maxdsets*char_init80/
+	DATA	ds_mod_title		/maxdsets*char_init80/
+	DATA	ds_forcing_set		/maxdsets*char_init16/
+	DATA	ds_t0time		/maxdsets*char_init20/
+	DATA	ds_time_unit		/maxdsets*real4_init/
+	DATA	ds_time_modulo		/maxdsets*.FALSE./
+	DATA	ds_ntegrate_tstep	/maxdsets*real4_init/
+	DATA	ds_ntuple		/maxdsets*int4_init/
+	DATA	ds_time_run		/maxdsets*char_init20/
+	DATA	ds_aux_modnum		/maxdsets_aux*char_init04/
+	DATA	ds_parm_name		/maxdsets_parm*char_init20/
+	DATA	ds_parm_text		/maxdsets_parm*char_init80/
+	DATA	ds_cal_name		/maxdsets*'GREGORIAN'/
+********************************************************************************
+	DATA	ds_alert_on_open	/maxdsets*.FALSE./
+	DATA	ds_alert_on_output	/maxdsets*.FALSE./
+	DATA	ds_message		/maxdsets*char_init80/
+********************************************************************************
+	DATA	ds_des_name		/maxdsets*char_init1024/
+	DATA	ds_name			/maxdsets*char_init1024/
+	DATA	ds_1step		/maxdsets*real8_init/
+	DATA	ds_lastep		/maxdsets*real8_init/
+	DATA	ds_delstep		/maxdsets*real8_init/
+	DATA	ds_regsteps		/maxdsets*.TRUE./
+	DATA	ds_accepts_remote	/maxdsets*.FALSE./
+	DATA	ds_hide			/maxdsets*.FALSE./
+	DATA	ds_basic_axes		/max6axes*int4_init/
+	DATA	ds_time_axis		/maxdsets*int4_init/
+
+* Next clear variables associated with variable in that data set.
+        DATA    ds_var_code_head        / 0 /
+        DATA    ds_var_code_padding     / 0 /
+	DATA	ds_var_code		/maxvars*char_init128/
+	DATA	ds_var_title		/maxvars*char_init128/
+	DATA	ds_var_titl_mod		/maxvars*char_init128/
+	DATA	ds_var_units		/maxvars*char_init64/
+	DATA	ds_grid_number		/maxvars*int4_init/
+	DATA	ds_missing_flag		/maxvars*real4_init/
+	DATA	ds_bad_flag		/maxvars*real4_init/
+	DATA	ds_ordering		/maxnvars*int4_init/
+	DATA	ds_grid_start		/maxnvars*int4_init/
+	DATA	ds_grid_end		/maxnvars*int4_init/
+	DATA	ds_precision		/maxvars*char_init01/
+	DATA	ds_aux_set_num		/maxvars*int4_init/
+********************************************************************************
+	DATA	ds_ndataperrec		/maxvars*int4_init/
+	DATA	ds_nrecpervar		/maxvar2*int4_init/
+	DATA	ds_npospervar		/maxvars*int4_init/
+	DATA	ds_nrecb4var		/maxvar2*int4_init/
+	DATA	ds_var_setnum		/maxvars*set_not_open/
+********************************************************************************
+	DATA	min_ds_tstart		/int4_init/
+	DATA	max_ds_tend		/int4_init/
+	DATA	ds_tdelta		/int4_init/
+	DATA	ds_var_off		/maxvars*0.0/
+	DATA	ds_var_scale		/maxvars*1.0/
+	DATA	ds_var_scaleit		/maxvars*.FALSE./
+
+	END
diff --git a/fmt/src/xerror_text_data.F b/fmt/src/xerror_text_data.F
new file mode 100644
index 0000000..2cd0fe9
--- /dev/null
+++ b/fmt/src/xerror_text_data.F
@@ -0,0 +1,160 @@
+	BLOCK DATA XERROR_TEXT_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* error message strings
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 11/20/85
+* revision 0.10 - 05/07/87 - added error for Too may Grid files, and changed
+*			     end of file to include "BAD DESCRIPTOR"
+* revision 0.20 - 08/10/88 - Reworded error messages, and added some new ones
+* revision 0.21 - 12/15/88 - Added time line definition error
+* revision 0.22 - 01/06/89 - Removed merr_unkline, changed merr_lineundef,
+*                            removed references to "COMMON" in error messages
+* Unix/RISC port *sh* 3/15/91: changed text "not mounted" -> "not on line"
+* 3/12/92 *sh* : added netCDF support - changed text of merr_badsubscr
+*                                     - and merr_gridpredef
+* 3/12/93 *sh* : allow unlimited columns in EZ data set
+* 11/99 *sh* - change "grid lines" to "axes" in error message
+* V600 6/05 *acm* new error merr_attalready; attribute already defined
+* V604 6/07 *acm* New merr_remote_open for errors opening remote datasets
+
+	include 'tmap_errors.parm'		! parameter definitions
+	include 'xerror_text.cmn_text'	! common declaration
+
+* special error messages
+	DATA
+     .	msg_special(merr_interrupt - pspecial)
+     .		/'interrupted                                       '/
+
+* regular error messages
+	DATA
+     .	msg_regular(merr_notsupport - pregular)
+     .		/'Attempt to access unsupported feature             '/
+     .	msg_regular(merr_filpos - pregular)
+     .		/'record in incorrect position                      '/,
+     .	msg_regular(merr_tstep - pregular)
+     .		/'STEP record indicates incorrect time step         '/,
+     .	msg_regular(merr_expnum - pregular)
+     .		/'STEP record indicates incorrect run number        '/,
+     .	msg_regular(merr_modnum - pregular)
+     .		/'STEP record indicates incorrect mod number        '/,
+     .	msg_regular(merr_notmounted - pregular)
+     .		/'non-existent or not on line                       '/,
+     .  msg_regular(merr_stepform - pregular)
+     .		/'STEP record not found                             '/,
+     .  msg_regular(merr_eof - pregular)
+     .		/'End Of File encountered                           '/,
+     .  msg_regular(merr_nmlerr - pregular)
+     .		/'Error in namelist record                          '/,
+     .  msg_regular(merr_unkvar - pregular)
+     .		/'Unknown variable code                             '/,
+     .  msg_regular(merr_unkgrid - pregular)
+     .		/'Unknown grid specification                        '/,
+     .  msg_regular(merr_stpmtch - pregular)
+     .		/'1st timestep in datafile different from descriptor'/,
+     .	msg_regular(merr_filim - pregular)
+     .		/'file limit reached                                '/,
+     .	msg_regular(merr_nostep - pregular)
+     .		/'time step not found in data set                   '/,
+     .	msg_regular(merr_dsetlim - pregular)
+     .		/'limit on number of data sets has been reached     '/,
+     .	msg_regular(merr_varlim - pregular)
+     .		/'limit on number of variables has been reached     '/,
+     .	msg_regular(merr_outofgrid - pregular)
+     .		/'Requested data range is outside of data set limits'/,
+     .	msg_regular(merr_badsubscr - pregular)
+     .		/'Subscript limits dont make sense'/,
+     .	msg_regular(merr_auxlim - pregular)
+     .		/'limit on number of auxiliary sets has been reached'/,
+     .	msg_regular(merr_grfillim - pregular)
+     .		/'limit on number of grid files has been reached    '/,
+     .	msg_regular(merr_gridlim - pregular)
+     .		/'limit on number of grids has been reached         '/,
+     .	msg_regular(merr_linelim - pregular)
+     .		/'limit on number of axes has been reached          '/,
+     .	msg_regular(merr_keynf - pregular)
+     .		/'requested key not found in search list            '/,
+     .	msg_regular(merr_gridpredef - pregular)
+     .		/'attempt to redefine grid or attribute             '/
+* regular error messages - continued
+	DATA
+     .	msg_regular(merr_lineundef - pregular)
+     .		/'unknown line specification in grid file           '/,
+     .	msg_regular(merr_linepredef - pregular)
+     .		/'attempt to redefine line                          '/,
+     .	msg_regular(merr_badgriddef - pregular)
+     .		/'error in grid definition                          '/,
+     .	msg_regular(merr_badlinedef - pregular)
+     .		/'error in line definition                          '/,
+     .	msg_regular(merr_badtimedef - pregular)
+     .		/'error in time line definition                     '/,
+     .	msg_regular(merr_linstorlim - pregular)
+     .		/'limit on storage for coordinates has been reached '/,
+     .	msg_regular(merr_nocoordlin - pregular)
+     .		/'grid file defines line without giving coordinates '/,
+     .	msg_regular(merr_unktype - pregular)
+     .		/'unrecognized data type in FORMAT_RECORD           '/,
+     .	msg_regular(merr_syntax - pregular)
+     .		/'syntax error in string                            '/,
+     .	msg_regular(merr_undefline - pregular)
+     .		/'grid has unknown axis                             '/,
+     .	msg_regular(merr_notimeinfo - pregular)
+     .		/'Time axis info missing or incomplete for dataset  '/,
+     .  msg_regular(merr_varform - pregular)
+     .		/'VAR record not found                              '/,
+     .  msg_regular(merr_varmtch - pregular)
+     .		/'1st variable in datafile different from descriptor'/,
+     .	msg_regular(merr_dsetnf - pregular)
+     .		/'Data set requested is not initialized             '/,
+     .	msg_regular(merr_stepnf-pregular)
+     .		/'No stepfiles found for requested data set         '/,
+     .	msg_regular(merr_badcolmn-pregular)
+     .		/'# of columns not a multiple of # of vars          '/,
+     .	msg_regular(merr_attalready-pregular)
+     .		/'attribute already defined                         '/,
+     .	msg_regular(merr_badfileatt-pregular)
+     .		/'attribute reading error                           '/,
+     .	msg_regular(merr_nc_open-pregular)
+     .		/'error opening netCDF file                         '/,
+     .	msg_regular(merr_remote_open-pregular)
+     .		/'error opening remote data file                    '/,
+     .	msg_regular(merr_chunk_spec-pregular)
+     .		/'error specifying chunk sizes                      '/
+	END
diff --git a/fmt/src/xez_info_data.F b/fmt/src/xez_info_data.F
new file mode 100644
index 0000000..2fb3382
--- /dev/null
+++ b/fmt/src/xez_info_data.F
@@ -0,0 +1,63 @@
+	BLOCK DATA XEZ_INFO_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+* programmer - mark verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 08/14/89
+* V530 - 10/00 *sh* ==> added field type variable for delimited reads
+
+* COMMON/XEZ_INFO.....info for EZ_ data sets
+	include 'tmap_dims.parm'
+	include 'ez_lib.parm'
+	include 'xez_info.cmn_text'
+
+	DATA	ez_mods		/maxdsets*.TRUE./
+
+* note; order of entries must match delimitedRead.h in Ferret
+        DATA ftyp_name(1)/'-'/,
+     .       ftyp_name(2)/'NUMERIC'/,
+     .       ftyp_name(3)/'TEXT'/,
+     .       ftyp_name(4)/'LATITUDE'/,
+     .       ftyp_name(5)/'LONGITUDE'/,
+     .       ftyp_name(6)/'DATE'/,
+     .       ftyp_name(7)/'EURODATE'/,
+     .       ftyp_name(8)/'TIME'/
+
+	END
diff --git a/fmt/src/xgt_grid_data.F b/fmt/src/xgt_grid_data.F
new file mode 100644
index 0000000..d1f7ac0
--- /dev/null
+++ b/fmt/src/xgt_grid_data.F
@@ -0,0 +1,696 @@
+	BLOCK DATA XGT_GRID_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* names and sizes of predefined grids for program GFDL
+* And climatological axes
+
+* programmer - mark verschell (from a program by steve hankin)
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 05/07/87 - by Mark Verschell for PMEL/TMAP
+* revision 0.10 - 07/27/88 - Parameter name change, grid/lisne definition order
+*			     swapped, line now defined by box coord, midpt coord
+* revision 0.11 - 11/21/88 - variable initialization changed to char_initXX
+* revision 0.20 - 11/29/88 - removed NORMAL and UNKNOWN line definitions
+* revision 0.21 - 12/12/88 - added next_line_mem_pos initialization
+* revision 0.30 - 12/15/88 - SH changed box boundry coordinates for PSYT / PSYU
+*			     to correctly reflect location in GFDL model 
+* revision 0.31 - 02/17/89 - Fixed next_line_mem_pos error (1 less than correct)
+* revision 0.40 - 01/07/91 - eliminated multoply define line_mem for RISC
+*			     by defining and using pline_mem_next
+* revision 0.41 - 04/24/91 *sh* unix/RISC port: increased size of grid_filename
+* revision 0.42 - 7/2/92 *kob* commented out initialization of line_mem
+*			       to speed compilation and decrease mem needs.
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* V510 *sh* 3/00 - initialize through line/grid_ceiling -- for dynamic netCDF
+*			grid and line management
+* V530*acm* 1/01 - add line_cal_name for alternative calendar types.
+* V550 *sh* 11/02 - add initialize line_modulo_len
+* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
+* V62 *acm*  2/09 - Save original upper/lowercase spelling of axis names 
+*                   in line_name_orig for CANCEL MODE UPCASE
+*      4/12 *acm* - 6D Ferret, formatted F axis is direction FI
+* V685 *acm* 3/13 - add climatological axes to the pre-defined axes.
+* v685 *acm* 4/13 - Let Ferret compute the modulo lengths for clim. axes
+
+	include 'tmap_dims.parm'
+	include 'implicit.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xunits.cmn_text'
+	include 'xtm_grid.cmn_text'
+
+	INTEGER		ngrd_def, nlne_def, grids_left, lines_left,
+     .			grid_lines_left, i, j,
+     .			pline_mem_next, pline_mem_left, outtype
+
+	PARAMETER	(ngrd_def	= 5,
+     .			 nlne_def	= 13,
+     .			 grids_left	= grid_ceiling-ngrd_def,
+     .			 lines_left	= line_ceiling-nlne_def,
+     .			 grid_lines_left= 4*grids_left,
+     .                   pline_mem_next = 614,
+     .                   pline_mem_left = maxlinestore-pline_mem_next+1)
+
+	PARAMETER	(outtype	= 6)  ! netcdf type double, output axis type.
+
+* LAST LINE_MEM POSITION + 1
+	DATA	next_line_mem_pos  /pline_mem_next/
+        DATA    pline_mem_init / pline_mem_next/
+
+* DEFINE LINES FIRST
+	DATA
+     .		line_name	(mpsxt)	/ 'PSXT'	/,
+     .		line_name_orig	(mpsxt)	/ 'PSXT'	/,
+     .		line_subsc1	(mpsxt) / unspecified_int4 /,
+     .		line_dim	(mpsxt)	/ 160		/,
+     .		line_units	(mpsxt)	/ 'LONGITUDE'	/,
+     .		line_unit_code  (mpsxt) / pun_degrees   /,
+     .		line_direction	(mpsxt)	/ 'WE'		/,
+     .		line_regular	(mpsxt)	/ .TRUE.	/,
+     .		line_modulo	(mpsxt) / .TRUE.        /,
+     .		line_modulo_len	(mpsxt) / 360.0D0       /,
+     .		line_start	(mpsxt)	/ 130.5		/,
+     .		line_delta	(mpsxt)	/ 1.0		/,
+     .		line_tunit	(mpsxt)	/ real4_init /,
+     .		line_t0		(mpsxt)	/ char_init20 /,
+     .		line_cal_name	(mpsxt)	/'GREGORIAN'/
+	DATA
+     .		line_name	(mpsxu)	/ 'PSXU'	/,
+     .		line_name_orig	(mpsxu)	/ 'PSXU'	/,
+     .		line_subsc1	(mpsxu) / unspecified_int4 /,
+     .		line_dim	(mpsxu)	/ 160		/,
+     .		line_units	(mpsxu)	/ 'LONGITUDE'	/,
+     .		line_unit_code  (mpsxu) / pun_degrees   /,
+     .		line_direction	(mpsxu)	/ 'WE'		/,
+     .		line_regular	(mpsxu)	/ .TRUE.	/,
+     .		line_modulo	(mpsxu) / .TRUE.        /,
+     .		line_modulo_len	(mpsxu) / 360.0D0       /,
+     .		line_start	(mpsxu)	/ 131.0		/,
+     .		line_delta	(mpsxu)	/ 1.0		/,
+     .		line_tunit	(mpsxu)	/ real4_init /,
+     .		line_t0		(mpsxu)	/ char_init20 /,
+     .		line_cal_name	(mpsxu)	/'GREGORIAN'/
+	DATA
+     .		line_name	(mpsyt)	/ 'PSYT'	/,
+     .		line_name_orig	(mpsyt)	/ 'PSYT'	/,
+     .		line_subsc1	(mpsyt) / 2		/,
+     .		line_dim	(mpsyt)	/ 100		/,
+     .		line_units	(mpsyt)	/ 'LATITUDE'	/,
+     .		line_unit_code  (mpsyt) / pun_degrees   /,
+     .		line_direction	(mpsyt)	/ 'SN'		/,
+     .		line_regular	(mpsyt)	/ .FALSE.	/,
+     .		line_modulo	(mpsyt) / .FALSE.       /,
+     .		line_modulo_len	(mpsyt) / 0.0D0         /,
+     .		line_start	(mpsyt)	/ unspecified_val8 /,
+     .		line_delta	(mpsyt)	/ unspecified_val8 /,
+     .		line_tunit	(mpsyt)	/ real4_init /,
+     .		line_t0		(mpsyt)	/ char_init20 /,
+     .		line_cal_name	(mpsyt)	/'GREGORIAN'/
+	DATA
+     .		line_name	(mpsyu)	/ 'PSYU'	/,
+     .		line_name_orig	(mpsyu)	/ 'PSYU'	/,
+     .		line_subsc1	(mpsyu) / 203		/,
+     .		line_dim	(mpsyu)	/ 100		/,
+     .		line_units	(mpsyu)	/ 'LATITUDE'	/,
+     .		line_unit_code  (mpsyu) / pun_degrees   /,
+     .		line_direction	(mpsyu)	/ 'SN'		/,
+     .		line_regular	(mpsyu)	/ .FALSE.	/,
+     .		line_modulo	(mpsyu) / .FALSE.       /,
+     .		line_modulo_len	(mpsyu) / 0.0D0         /,
+     .		line_start	(mpsyu)	/ unspecified_val8 /,
+     .		line_delta	(mpsyu)	/ unspecified_val8 /,
+     .		line_tunit	(mpsyu)	/ real4_init /,
+     .		line_t0		(mpsyu)	/ char_init20 /,
+     .		line_cal_name	(mpsyu)	/'GREGORIAN'/
+	DATA
+     .		line_name	(mpszt)	/ 'PSZT'	/,
+     .		line_name_orig	(mpszt)	/ 'PSZT'	/,
+     .		line_subsc1	(mpszt) / 404		/,
+     .		line_dim	(mpszt)	/ 27		/,
+     .		line_units	(mpszt)	/ 'METERS'	/,
+     .		line_unit_code  (mpszt) / pun_meters   /,
+     .		line_direction	(mpszt)	/ 'UD'		/,
+     .		line_regular	(mpszt)	/ .FALSE.	/,
+     .		line_modulo	(mpszt) / .FALSE.       /,
+     .		line_modulo_len	(mpszt) / 0.0D0         /,
+     .		line_start	(mpszt)	/ unspecified_val8 /,
+     .		line_delta	(mpszt)	/ unspecified_val8 /,
+     .		line_tunit	(mpszt)	/ real4_init /,
+     .		line_t0		(mpszt)	/ char_init20 /,
+     .		line_cal_name	(mpszt)	/'GREGORIAN'/
+
+	DATA
+     .		line_name	(mpszw)	/ 'PSZW'	/,
+     .		line_name_orig	(mpszw)	/ 'PSZW'	/,
+     .		line_subsc1	(mpszw) / 459		/,
+     .		line_dim	(mpszw)	/ 27		/,
+     .		line_units	(mpszw)	/ 'METERS'	/,
+     .		line_unit_code  (mpszw) / pun_meters   /,
+     .		line_direction	(mpszw)	/ 'UD'		/,
+     .		line_regular	(mpszw)	/ .FALSE.	/,
+     .		line_modulo	(mpszw) / .FALSE.       /,
+     .		line_modulo_len	(mpszw) / 0.0D0         /,
+     .		line_start	(mpszw)	/ unspecified_val8 /,
+     .		line_delta	(mpszw)	/ unspecified_val8 /
+     .		line_tunit	(mpszw)	/ real4_init /,
+     .		line_t0		(mpszw)	/ char_init20 /,
+     .		line_cal_name	(mpszw)	/'GREGORIAN'/
+
+
+	DATA
+     .		line_name	(clmirr)	/ 'MONTH_IRREG'	/,
+     .		line_name_orig	(clmirr)	/ 'MONTH_IRREG'	/,
+     .		line_subsc1	(clmirr)	/ 514		/,
+     .		line_dim	(clmirr)	/ 12		/,
+     .		line_units	(clmirr)	/ 'DAYS'	/,
+     .		line_unit_code  (clmirr)	/ -4   /,
+     .		line_direction	(clmirr)	/ 'TI'		/,
+     .		line_regular	(clmirr)	/ .FALSE.	/,
+     .		line_modulo	(clmirr)	/ .TRUE.       /,
+     .		line_start	(clmirr)	/ unspecified_val8 /,
+     .		line_delta	(clmirr)	/ unspecified_val8 /,
+     .		line_tunit	(clmirr)	/ 86400 /,
+     .		line_t0		(clmirr)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clmirr)	/'GREGORIAN'/
+     
+	DATA
+     .		line_name	(clmreg)	/ 'MONTH_REG'	/,
+     .		line_name_orig	(clmreg)	/ 'MONTH_REG'	/,
+     .		line_subsc1	(clmreg)	/ unspecified_int4 /,
+     .		line_dim	(clmreg)	/ 12		/,
+     .		line_units	(clmreg)	/ 'hour'	/,
+     .		line_unit_code  (clmreg)	/ -3   /,
+     .		line_direction	(clmreg)	/ 'TI'		/,
+     .		line_regular	(clmreg)	/ .TRUE.	/,
+     .		line_modulo	(clmreg)	/ .TRUE.       /,
+     .		line_start	(clmreg)	/ 366. /,
+     .		line_delta	(clmreg)	/ 730.485 /,
+     .		line_tunit	(clmreg)	/ 3600 /,
+     .		line_t0		(clmreg)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clmreg)	/'GREGORIAN'/
+
+
+	DATA
+     .		line_name	(clseas)	/ 'SEASONAL_REG'	/,
+     .		line_name_orig	(clseas)	/ 'SEASONAL_REG'	/,
+     .		line_subsc1	(clseas)	/ unspecified_int4 /,
+     .		line_dim	(clseas)	/ 4		/,
+     .		line_units	(clseas)	/ 'HOURS'	/,
+     .		line_unit_code  (clseas)	/ -3   /,
+     .		line_direction	(clseas)	/ 'TI'		/,
+     .		line_regular	(clseas)	/ .TRUE.	/,
+     .		line_modulo	(clseas)	/ .TRUE.       /,
+     .		line_start	(clseas)	/ 1095.7275 /,
+     .		line_delta	(clseas)	/ 2191.455 /,
+     .		line_tunit	(clseas)	/ 3600 /,
+     .		line_t0		(clseas)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clseas)	/'GREGORIAN'/
+
+	DATA
+     .		line_name	(clmgrg)	/ 'MONTH_GREGORIAN' /,
+     .		line_name_orig	(clmgrg)	/ 'MONTH_GREGORIAN' /,
+     .		line_subsc1	(clmgrg)	/ 539		/,
+     .		line_dim	(clmgrg)	/ 12		/,
+     .		line_units	(clmgrg)	/ 'days'	/,
+     .		line_unit_code  (clmgrg)	/ -4   /,
+     .		line_direction	(clmgrg)	/ 'TI'		/,
+     .		line_regular	(clmgrg)	/ .FALSE.	/,
+     .		line_modulo	(clmgrg)	/ .TRUE.       /,
+     .		line_start	(clmgrg)	/ unspecified_val8 /,
+     .		line_delta	(clmgrg)	/ unspecified_val8 /,
+     .		line_tunit	(clmgrg)	/ 86400 /,
+     .		line_t0		(clmgrg)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clmgrg)	/'GREGORIAN'/
+     
+	DATA
+     .		line_name	(clmnol)	/ 'MONTH_NOLEAP' /,
+     .		line_name_orig	(clmnol)	/ 'MONTH_NOLEAP' /,
+     .		line_subsc1	(clmnol)	/ 564		/,
+     .		line_dim	(clmnol)	/ 12		/,
+     .		line_units	(clmnol)	/ 'days'	/,
+     .		line_unit_code  (clmnol)	/ -4   /,
+     .		line_direction	(clmnol)	/ 'TI'		/,
+     .		line_regular	(clmnol)	/ .FALSE.	/,
+     .		line_modulo	(clmnol)	/ .TRUE.       /,
+     .		line_start	(clmnol)	/ unspecified_val8 /,
+     .		line_delta	(clmnol)	/ unspecified_val8 /,
+     .		line_tunit	(clmnol)	/ 86400 /,
+     .		line_t0		(clmnol)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clmnol)	/'NOLEAP'/
+
+	DATA
+     .		line_name	(clm360)	/ 'MONTH_360_DAY' /,
+     .		line_name_orig	(clm360)	/ 'MONTH_360_DAY' /,
+     .		line_subsc1	(clm360)	/ unspecified_int4	/,
+     .		line_dim	(clm360)	/ 12		/,
+     .		line_units	(clm360)	/ 'days'	/,
+     .		line_unit_code  (clm360)	/ -4   /,
+     .		line_direction	(clm360)	/ 'TI'		/,
+     .		line_regular	(clm360)	/ .TRUE.	/,
+     .		line_modulo	(clm360)	/ .TRUE.       /,
+     .		line_start	(clm360)	/ 15. /,
+     .		line_delta	(clm360)	/ 30. /,
+     .		line_tunit	(clm360)	/ 86400 /,
+     .		line_t0		(clm360)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clm360)	/'360_DAY'/
+
+	DATA
+     .		line_name	(clmall)	/ 'MONTH_ALL_LEAP' /,
+     .		line_name_orig	(clmall)	/ 'MONTH_ALL_LEAP' /,
+     .		line_subsc1	(clmall)	/ 589	/,
+     .		line_dim	(clmall)	/ 12		/,
+     .		line_units	(clmall)	/ 'days'	/,
+     .		line_unit_code  (clmall)	/ -4   /,
+     .		line_direction	(clmall)	/ 'TI'		/,
+     .		line_regular	(clmall)	/ .FALSE.	/,
+     .		line_modulo	(clmall)	/ .TRUE.       /,
+     .		line_start	(clmall)	/ unspecified_val8 /,
+     .		line_delta	(clmall)	/ unspecified_val8 /,
+     .		line_tunit	(clmall)	/ 86400 /,
+     .		line_t0		(clmall)	/'01-JAN-0000 00:00:00'/,
+     .		line_cal_name	(clmall)	/'ALL_LEAP'/
+
+
+* 7/99 *kob* add in initialization for line_name and mpsnorm.  
+*            needed for v3.4 of netcdf use
+	DATA    line_name       (mpsnorm) /' '/
+	DATA    line_name_orig  (mpsnorm) /' '/
+
+* DEFINE GRIDS NEXT
+* 2 dimensional defining grid for wind stress magnitude
+	DATA	grid_name  (mps2dt)    / 'PS2DT'	/,
+     .		grid_rotation (mps2dt) / 0.0		/,
+     .		grid_line  (1, mps2dt) / mpsxt	/,
+     .		grid_line  (2, mps2dt) / mpsyt	/,
+     .		grid_line  (3, mps2dt) / mpsnorm	/,
+     .		grid_line  (4, mps2dt) / mpsunkn	/,
+     .		grid_out_prod (1, mps2dt) / .TRUE.   /,
+     .		grid_out_prod (2, mps2dt) / .TRUE.   /,
+     .		grid_out_prod (3, mps2dt) / .TRUE.   /,
+     .		grid_out_prod (4, mps2dt) / .TRUE.   /
+
+* 2 dimensional defining grid for taux and tauy
+	DATA	grid_name  (mps2du)    / 'PS2DU'	/,
+     .		grid_rotation (mps2du) / 0.0		/,
+     .		grid_line  (1, mps2du) / mpsxu	/,
+     .		grid_line  (2, mps2du) / mpsyu	/,
+     .		grid_line  (3, mps2du) / mpsnorm	/,
+     .		grid_line  (4, mps2du) / mpsunkn	/,
+     .		grid_out_prod (1, mps2du) / .TRUE.   /,
+     .		grid_out_prod (2, mps2du) / .TRUE.   /,
+     .		grid_out_prod (3, mps2du) / .TRUE.   /,
+     .		grid_out_prod (4, mps2du) / .TRUE.   /
+
+* 3 dimensional defining grid for temp and salt
+	DATA	grid_name  (mps3dt)    / 'PS3DT'	/,
+     .		grid_rotation (mps3dt) / 0.0		/,
+     .		grid_line  (1, mps3dt) / mpsxt	/,
+     .		grid_line  (2, mps3dt) / mpsyt	/,
+     .		grid_line  (3, mps3dt) / mpszt	/,
+     .		grid_line  (4, mps3dt) / mpsunkn	/,
+     .		grid_out_prod (1, mps3dt) / .TRUE.   /,
+     .		grid_out_prod (2, mps3dt) / .TRUE.   /,
+     .		grid_out_prod (3, mps3dt) / .TRUE.   /,
+     .		grid_out_prod (4, mps3dt) / .TRUE.   /
+
+* 3 dimensional defining grid for u and v
+	DATA	grid_name  (mps3du)    / 'PS3DU'	/,
+     .		grid_rotation (mps3du) / 0.0		/,
+     .		grid_line  (1, mps3du) / mpsxu	/,
+     .		grid_line  (2, mps3du) / mpsyu	/,
+     .		grid_line  (3, mps3du) / mpszt	/,
+     .		grid_line  (4, mps3du) / mpsunkn	/,
+     .		grid_out_prod (1, mps3du) / .TRUE.   /,
+     .		grid_out_prod (2, mps3du) / .TRUE.   /,
+     .		grid_out_prod (3, mps3du) / .TRUE.   /,
+     .		grid_out_prod (4, mps3du) / .TRUE.   /
+
+* 3 dimensional defining grid for w
+	DATA	grid_name  (mps3dw)    / 'PS3DW'	/,
+     .		grid_rotation (mps3dw) / 0.0		/,
+     .		grid_line  (1, mps3dw) / mpsxt	/,
+     .		grid_line  (2, mps3dw) / mpsyt	/,
+     .		grid_line  (3, mps3dw) / mpszw	/,
+     .		grid_line  (4, mps3dw) / mpsunkn	/,
+     .		grid_out_prod (1, mps3dw) / .TRUE.   /,
+     .		grid_out_prod (2, mps3dw) / .TRUE.   /,
+     .		grid_out_prod (3, mps3dw) / .TRUE.   /,
+     .		grid_out_prod (4, mps3dw) / .TRUE.   /
+
+* initialize the unused grid common locations
+	DATA	grid_filename	/maxgridfiles*char_init128/
+
+	DATA	(line_parent(i),i=1,line_ceiling)
+     .			/line_ceiling*0/
+
+	DATA	(line_class(i),i=1,line_ceiling)
+     .			/line_ceiling*pline_class_basic/
+
+	DATA	(line_name(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*char_init16/
+	DATA	(line_name_orig(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*char_init16/
+
+	DATA	(line_subsc1(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*int4_init/
+
+	DATA	(line_dim(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*int4_init/
+
+	DATA	(line_units(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*char_init16/
+
+	DATA	(line_unit_code(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*int4_init/
+
+	DATA	(line_direction(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*char_init02/
+
+	DATA	(line_start(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*real8_init/
+
+	DATA	(line_delta(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*real8_init/
+
+	DATA	(line_regular(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*.FALSE./
+
+	DATA	(line_t0(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*char_init20/
+
+	DATA	 line_cal_name(0)  /'GREGORIAN'/
+	DATA	(line_cal_name(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*'GREGORIAN'/
+
+	DATA	(line_shift_origin(i),i=1,line_ceiling)
+     .			/line_ceiling*.FALSE./
+
+	DATA	(line_tunit(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*real4_init/
+
+	DATA	(line_modulo(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*.FALSE./
+
+	DATA	(line_modulo_len(i),i=nlne_def+1,line_ceiling)
+     .			/lines_left*0.0D0/
+     
+	DATA	(line_dattype(i),i=1,line_ceiling)
+     .			/line_ceiling*outtype/
+
+c comment out to speed compilation and decrease mem needs *kob* 7/92
+c	DATA	(line_mem(i),i=pline_mem_next,maxlinestore)
+c     .			/pline_mem_left*real8_init/
+
+	DATA	(grid_name(i),i=ngrd_def+1,grid_ceiling)
+     .			/grids_left*char_init16/
+
+	DATA	((grid_line(i,j),i=1,4),j=ngrd_def+1,grid_ceiling)
+     .			/grid_lines_left*int4_init/
+
+	DATA	(grid_rotation(i),i=ngrd_def+1,grid_ceiling)
+     .			/grids_left*real4_init/
+
+	DATA	((grid_out_prod(i,j),i=1,4),j=ngrd_def+1,grid_ceiling)
+     .			/grid_lines_left*.FALSE./
+
+* DEFINE LINE AND BOX COORDS NEXT TO LAST
+*  COORDS FOR PSYT
+	DATA	(line_mem(i),i=2,101)
+     .	/-28.83607292175293, -26.52994918823242, -24.28807449340820, 
+     .	 -22.15015602111816, -20.15135765075684, -18.32076263427734,
+     .	 -16.68010330200195, -15.24281406402588, -14.01343536376953,
+     .	 -12.98742485046387, -12.15135097503662, -11.48348140716553,
+     .	 -10.95473194122314, -10.52993869781494, -10.16939353942871,
+     .	  -9.83332061767578,  -9.49998760223388,  -9.16665363311767,
+     .    -8.83331966400146,  -8.49998569488525,  -8.16665267944335,
+     .	  -7.83331871032714,  -7.49998474121093,  -7.16665124893188,
+     .	  -6.83331823348999,  -6.49998521804809,  -6.16665172576904,
+     .	  -5.83331823348999,  -5.49998521804809,  -5.16665172576904,
+     .	  -4.83331871032714,  -4.49998521804809,  -4.16665172576904,
+     .	  -3.83331871032714,  -3.49998521804809,  -3.16665172576904,
+     .	  -2.83331847190856,  -2.49998521804809,  -2.16665196418762,
+     .	  -1.83331859111785,  -1.49998521804809,  -1.16665184497833,
+     .	  -0.83331835269927,  -0.49998494982719,  -0.16665154695510,
+     .	   0.16668185591697,   0.50001525878906,   0.83334869146347,
+     .	   1.16668212413787,   1.50001549720764,   1.83334898948669,
+     .	   2.16668248176574,   2.50001597404480,   2.83334946632385,
+     .	   3.16668295860290,   3.50001621246337,   3.83334970474243,
+     .	   4.16668319702148,   4.50001621246337,   4.83334970474243,
+     .	   5.16668319702148,   5.50001621246337,   5.83334970474243,
+     .	   6.16668272018432,   6.50001621246337,   6.83334970474243,
+     .	   7.16668272018432,   7.50001668930053,   7.83335018157959,
+     .	   8.16668415069580,   8.50001811981201,   8.83335113525390,
+     .	   9.16668510437011,   9.50001907348632,   9.83335304260253,
+     .	  10.16793632507324,  10.51373767852783,  10.88928699493408,
+     .	  11.31389617919922,  11.80609893798828,  12.38336753845215,
+     .	  13.06183147430420,  13.85602283477783,  14.77865123748779,
+     .	  15.84039688110352,  17.04974937438965,  18.41287040710449,
+     .	  19.93349456787109,  21.61287307739258,  23.44975662231445,
+     .	  25.44040679931641,  27.57866477966309,  29.85604095458984,
+     .	  32.26185226440430,  34.78339004516602,  37.40612411499023,
+     .	  40.11392593383789,  42.88932037353516,  45.71377182006836,
+     .	  48.56797027587891/
+
+*  BOX BOUNDARIES FOR PSYT
+*   note: Box boundaries on the YT axis DO NOT lie midway between grid points
+*	  They are constructed to be consistent with the variables
+*	  PSIT and DYT of the Phil/Seigel model
+	DATA	(line_mem(i),i=102,202)/
+     .	 -30.00000059604645, -27.67214524745941, -25.38775503635406,
+     .	 -23.18839609622955, -21.11191737651825, -19.19079816341400,
+     .	 -17.45072722434997, -15.90948104858398, -14.57614636421204,
+     .	 -13.45072317123413, -12.52412497997284, -11.77857542037964,
+     .	 -11.18838566541672, -10.72107663750648, -10.33879896998405,
+     .	  -9.99998718500137,  -9.66665378212929,  -9.33332037925720,
+     .	  -8.99998697638512,  -8.66665357351303,  -8.33332017064095,
+     .	  -7.99998676776886,  -7.66665336489677,  -7.33331996202469,
+     .	  -6.99998655915260,  -6.66665315628052,  -6.33331975340843,
+     .	  -5.99998635053635,  -5.66665294766426,  -5.33331954479218,
+     .	  -4.99998614192009,  -4.66665273904800,  -4.33331933617592,
+     .	  -3.99998593330383,  -3.66665253043175,  -3.33331912755966,
+     .	  -2.99998572468758,  -2.66665232181549,  -2.33331891894340,
+     .	  -1.99998551607132,  -1.66665211319923,  -1.33331871032715,
+     .	  -0.99998530745506,  -0.66665190458298,  -0.33331850171089,
+     .	   0.00001490116119,   0.33334830403328,   0.66668170690537,
+     .	   1.00001510977745,   1.33334851264954,   1.66668191552162,
+     .	   2.00001531839371,   2.33334872126579,   2.66668212413788,
+     .	   3.00001552700996,   3.33334892988205,   3.66668233275414,
+     .	   4.00001573562622,   4.33334913849831,   4.66668254137039,
+     .	   5.00001594424248,   5.33334934711456,   5.66668274998665,
+     .	   6.00001615285874,   6.33334955573082,   6.66668295860291,
+     .	   7.00001636147499,   7.33334976434708,   7.66668316721916,
+     .	   8.00001657009125,   8.33334997296333,   8.66668337583542,
+     .	   9.00001677870751,   9.33335018157959,   9.66668358445168,
+     .	  10.00001698732376,  10.33585005998612,  10.69162029027939,
+     .	  11.08694973587990,  11.54083672165871,  12.07135620713234,
+     .	  12.69537439942360,  13.42828330397606,  14.28375723958016,
+     .	  15.27353766560555,  16.40724852681160,  17.69224312901497,
+     .	  19.13348940014839,  20.73349097371102,  22.49224796891213,
+     .	  24.40725651383400,  26.47354879975319,  28.68377104401588,
+     .	  31.02829995751381,  33.49539366364479,  36.07137742638588,
+     .	  38.74085965752602,  41.48697438836098,  44.29164591431618,
+     .	  47.13587656617165,  50.00004377961159/
+
+*  COORDS FOR PSYU
+	DATA	(line_mem(i),i=203,302)
+     .	/-27.67214393615723, -25.38775444030762, -23.18839454650879,
+     .	 -21.11191749572754, -19.19079780578613, -17.45072746276855,
+     .	 -15.90948104858398, -14.57614612579346, -13.45072364807129,
+     .	 -12.52412509918213, -11.77857589721680, -11.18838596343994,
+     .	 -10.72107696533203, -10.33879947662354,  -9.99998760223388,
+     .	  -9.66665458679199,  -9.33332061767578,  -8.99998664855957,
+     .	  -8.66665267944335,  -8.33331966400146,  -7.99998569488525,
+     .	  -7.66665172576904,  -7.33331823348999,  -6.99998474121093,
+     .	  -6.66665124893188,  -6.33331823348999,  -5.99998474121093,
+     .	  -5.66665172576904,  -5.33331823348999,  -4.99998474121093,
+     .	  -4.66665172576904,  -4.33331823348999,  -3.99998497962951,
+     .	  -3.66665172576904,  -3.33331847190856,  -2.99998521804809,
+     .	  -2.66665196418762,  -2.33331847190856,  -1.99998533725738,
+     .	  -1.66665184497833,  -1.33331847190856,  -0.99998503923416,
+     .	  -0.66665166616439,  -0.33331826329231,   0.00001515448275,
+     .	   0.33334857225418,   0.66668194532394,   1.00001537799835,
+     .	   1.33334875106811,   1.66668212413787,   2.00001549720764,
+     .	   2.33334898948669,   2.66668272018432,   3.00001621246337,
+     .	   3.33334970474243,   3.66668295860290,   4.00001621246337,
+     .	   4.33334970474243,   4.66668272018432,   5.00001621246337,
+     .	   5.33334922790527,   5.66668272018432,   6.00001621246337,
+     .	   6.33334922790527,   6.66668272018432,   7.00001573562622,
+     .	   7.33334970474243,   7.66668319702148,   8.00001716613769,
+     .	   8.33335113525390,   8.66668415069580,   9.00001811981201,
+     .	   9.33335208892822,   9.66668605804443,  10.00001907348633,
+     .	  10.33585262298584,  10.69162178039551,  11.08695220947266,
+     .	  11.54083919525146,  12.07135868072510,  12.69537734985352,
+     .	  13.42828655242920,  14.28376007080078,  15.27354145050049,
+     .	  16.40725135803223,  17.69224548339844,  19.13349342346191,
+     .	  20.73349571228027,  22.49225234985352,  24.40726089477539,
+     .	  26.47355461120605,  28.68377685546875,  31.02830314636230,
+     .	  33.49539947509766,  36.07138442993164,  38.74086761474609,
+     .	  41.48698425292969,  44.29165267944336,  47.13588333129883,
+     .	  50.00005340576172/
+
+*  BOX BOUNDARIES FOR PSYU
+*   note: Box boundaries on the YU axis DO lie midway between grid points
+	DATA	(line_mem(i),i=303,403)/
+     .	 -28.83607161045075, -26.52994883060456, -24.28807413578034,
+     .	 -22.15015542507172, -20.15135645866394, -18.32076144218445,
+     .	 -16.68010282516480, -15.24281239509583, -14.01343345642090,
+     .	 -12.98742270469666, -12.15134876966477, -11.48347908258438,
+     .	 -10.95472967624665, -10.52993631362915, -10.16939160227776,
+     .	  -9.83331900835038,  -9.49998560547829,  -9.16665220260620,
+     .	  -8.83331879973412,  -8.49998539686203,  -8.16665199398995,
+     .	  -7.83331859111786,  -7.49998518824578,  -7.16665178537369,
+     .	  -6.83331838250161,  -6.49998497962952,  -6.16665157675743,
+     .	  -5.83331817388535,  -5.49998477101326,  -5.16665136814118,
+     .	  -4.83331796526909,  -4.49998456239701,  -4.16665115952492,
+     .	  -3.83331775665284,  -3.49998435378075,  -3.16665095090866,
+     .	  -2.83331754803658,  -2.49998414516449,  -2.16665074229241,
+     .	  -1.83331733942032,  -1.49998393654824,  -1.16665053367615,
+     .	  -0.83331713080407,  -0.49998372793198,  -0.16665032505989,
+     .	   0.16668307781219,   0.50001648068428,   0.83334988355636,
+     .	   1.16668328642845,   1.50001668930053,   1.83335009217262,
+     .	   2.16668349504470,   2.50001689791679,   2.83335030078888,
+     .	   3.16668370366096,   3.50001710653305,   3.83335050940513,
+     .	   4.16668391227722,   4.50001731514930,   4.83335071802139,
+     .	   5.16668412089348,   5.50001752376556,   5.83335092663765,
+     .	   6.16668432950973,   6.50001773238182,   6.83335113525390,
+     .	   7.16668453812599,   7.50001794099807,   7.83335134387016,
+     .	   8.16668474674225,   8.50001814961433,   8.83335155248642,
+     .	   9.16668495535850,   9.50001835823059,   9.83335176110267,
+     .	  10.16793498396873,  10.51373663544655,  10.88928645849228,
+     .	  11.31389468908310,  11.80609792470932,  12.38336676359176,
+     .	  13.06183034181595,  13.85602176189422,  14.77864891290664,
+     .	  15.84039455652237,  17.04974728822708,  18.41286772489547,
+     .	  19.93349176645279,  21.61287111043930,  23.44975394010544,
+     .	  25.44040447473526,  27.57866197824478,  29.85603767633438,
+     .	  32.26184898614883,  34.78338772058487,  37.40612083673477,
+     .	  40.11391931772232,  42.88931232690811,  45.71376329660415,
+     .	  48.56796222925186,  51.43212944269180/
+
+*  COORDS FOR PSZT
+	DATA	(line_mem(i),i=404,430)
+     .	/    5.00,   15.00,   25.00,   35.00,   45.00,   55.00,   65.00,
+     .	    75.00,   85.00,   95.00,  106.25,  120.00,  136.25,  155.00,
+     .	   177.50,  205.00,  240.00,  288.50,  362.50,  483.50,  680.00,
+     .	   979.50, 1395.50, 1916.00, 2524.00, 3174.00, 3824.00/
+
+*  BOX BOUNDARIES FOR PSZT
+	DATA	(line_mem(i),i=431,458)
+     .	/    0.00,   10.00,   20.00,   30.00,   40.00,   50.00,   60.00,
+     .	    70.00,   80.00,   90.00,  100.00,  112.50,  127.50,  145.00,
+     .	   165.00,  190.00,  220.00,  260.00,  317.00,  408.00,  559.00,
+     .	   801.00, 1158.00, 1633.00, 2199.00, 2849.00, 3499.00, 4149.00/
+
+*  COORDS FOR PSZW
+	DATA	(line_mem(i),i=459,485)
+     .	/   10.00,   20.00,   30.00,   40.00,   50.00,   60.00,   70.00,
+     .	    80.00,   90.00,  100.00,  112.50,  127.50,  145.00,  165.00,
+     .	   190.00,  220.00,  260.00,  317.00,  408.00,  559.00,  801.00,
+     .	  1158.00, 1633.00, 2199.00, 2849.00, 3499.00, 4149.00/
+
+*  BOX BOUNDARIES FOR PSZW
+	DATA	(line_mem(i),i=486,513)
+     .	/    5.00,   15.00,   25.00,   35.00,   45.00,   55.00,   65.00,
+     .	    75.00,   85.00,   95.00,  106.25,  120.00,  136.25,  155.00,
+     .	   177.50,  205.00,  240.00,  288.50,  362.50,  483.50,  680.00,
+     .	   979.50, 1395.50, 1916.00, 2524.00, 3174.00, 3824.00, 4149.00/
+
+* MONTH_IRREG
+
+*  COORDS FOR MONTH_IRREG
+	DATA	(line_mem(i),i=514,525)
+     .	/     15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+     .	     196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425/
+
+*  BOX BOUNDARIES FOR MONTH_IRREG
+	DATA	(line_mem(i),i=526,538)
+     .	/     0.0, 31.0, 59.2425, 90.2425, 120.2425, 151.2425, 
+     .	    181.2425, 212.2425, 243.2425, 273.2425, 304.2425, 
+     .	    334.2425, 365.2425/
+     
+* MONTH_GREGORIAN
+     
+*  COORDS FOR MONTH_GREGORIAN
+	DATA	(line_mem(i),i=539,550)
+     .	/     15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 
+     .	     196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425/
+
+*  BOX BOUNDARIES FOR MONTH_GREGORIAN
+	DATA	(line_mem(i),i=551,563)
+     .	/     0.0, 31.0, 59.2425, 90.2425, 120.2425, 151.2425, 
+     .	    181.2425, 212.2425, 243.2425, 273.2425, 304.2425, 
+     .	    334.2425, 365.2425/
+
+* MONTH_NOLEAP
+     
+*  COORDS FOR MONTH_NOLEAP
+	DATA	(line_mem(i),i=564,575)
+     .	/     15.5,  45.0,  74.5, 105.0, 135.5, 166.0, 196.5, 
+     .	     227.5, 258.0, 288.5, 319.0, 349.5/
+
+*  BOX BOUNDARIES FOR MONTH_NOLEAP
+	DATA	(line_mem(i),i=576,588)
+     .	/     0.0, 31.0, 59.0, 90.0, 120.0, 151.0, 181.0, 
+     .      212.0, 243.0, 273.0, 304.0, 334.0, 365.0/
+
+* MONTH_ALL_LEAP
+     
+*  COORDS FOR MONTH_ALL_LEAP
+	DATA	(line_mem(i),i=589,600)
+     .	/     15.5, 45.5, 75.5, 106.0, 136.5, 167.0, 197.5, 
+     .       228.5, 259.0, 289.5, 320.0, 350.5/
+
+*  BOX BOUNDARIES FOR MONTH_ALL_LEAP
+	DATA	(line_mem(i),i=601,613)
+     .	/     0.0, 31.0, 60.0, 91.0, 121.0, 152.0, 182.0, 213.0, 
+     .      244.0, 274.0, 305.0, 335.0, 366.0/
+
+* Miscellaneous (axis orientations)
+
+	DATA 	axis_orients(  1 )	/ 'WE' /,   ! west to east
+     .          axis_orients(  2 )	/ 'SN' /,   ! south to north
+     .          axis_orients(  3 )	/ 'DU' /,   ! down to up
+     .          axis_orients(  4 )	/ 'TI' /,   ! time (always forward)
+     .          axis_orients(  5 )	/ 'EE' /,   ! Ensemble
+     .          axis_orients(  6 )	/ 'FI' /,   ! Forecast
+     .          axis_orients(  7 )	/ 'UD' /,   ! up to down
+     .          axis_orients(  8 )	/ 'NA' /,   ! not applicable
+     .          axis_orients(  9 )	/ 'NA' /    ! ... unused slot ...   
+
+	END
diff --git a/fmt/src/xio_data.F b/fmt/src/xio_data.F
new file mode 100644
index 0000000..4b207d7
--- /dev/null
+++ b/fmt/src/xio_data.F
@@ -0,0 +1,56 @@
+	BLOCK DATA XIO_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DoATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 10/08/85
+* error and warnings to std error.
+
+* COMMON/XIO.....logical unit numbers for I/O
+	include 'xio.cmn_text'
+
+	DATA	tohdlu		/20/,
+     .		fmhdlu		/21/,
+     .		fmhd2lu		/22/,
+     .		tooplu		/ 6/,
+     .		fmoplu		/ 5/,
+     .		lunit_errors	/ 0/
+
+	END
diff --git a/fmt/src/xmachine_data.F b/fmt/src/xmachine_data.F
new file mode 100644
index 0000000..f2377f3
--- /dev/null
+++ b/fmt/src/xmachine_data.F
@@ -0,0 +1,73 @@
+	BLOCK DATA XMACHINE_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* variables to assist with the conversion of binary representations
+* between differing cpu types
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* SUN port - 1/30/92 -kob-  use xmachine.cmn on SUN because it understands BYTE
+*                             and use xmachine.cmn_text for DECstation because
+*                             because it understands INTEGER*1
+* replaced "elif" syntax with
+*	else
+*	   if
+*  for SGI port	 - kob 4/8/92
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed themy
+
+* revision 0.00 - 03/25/91
+* V6.74 3/12 *acm* cleanup ifdefs and unnecessary include files
+
+#ifdef sun
+        include 'xmachine_byte.cmn'
+#else
+                include 'xmachine_int1.cmn'
+#endif
+
+#ifdef sun
+        DATA    active_cpu  /cptype_sun/    
+#else
+#	if unix
+        	DATA	active_cpu  /cptype_dec/   ! DECstation
+#	else
+        	DATA    active_cpu  /cptype_vax/   ! VAX
+#	endif
+#endif
+
+	END
diff --git a/fmt/src/xstep_files_data.F b/fmt/src/xstep_files_data.F
new file mode 100644
index 0000000..c4590eb
--- /dev/null
+++ b/fmt/src/xstep_files_data.F
@@ -0,0 +1,77 @@
+	BLOCK DATA XSTEP_FILES_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* various pre-defined variables for COMMON/Xstep_files
+* programmer - mark verschell
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 08/19/86
+* revision 0.10 - 07/22/88 - Added TS variables
+* revision 0.11 - 11/21/88 - variable initialization changed to char_initXX
+* revision 0.12 - 04/24/91 - *sh* unix/RISC port: increased sf_name size
+* Linux port -kob - 3/97 - Modify include for tmap_dset.parm to be a
+*			   preprocessor include for F90 - needed because
+*			   tmap_dset.parm contains an ifdef
+* v581 *acm* 4/2005  Add sf_ndxs and sf_ndxe to use indices rather than timesteps
+*                     for indexing mc datasets in mc_read.
+
+#include "tmap_dset.parm"		
+	include 'tmap_dims.parm'
+	include 'xstep_files.cmn_text'
+
+
+	DATA	sf_name			/maxstepfiles*char_init512/
+	DATA	sf_setnum		/maxstepfiles*set_not_open/
+	DATA	sf_aux_set_num		/maxstepfiles*set_not_open/
+	DATA	sf_nrecperstep		/maxstepfiles*int4_init/
+	DATA	sf_skip			/maxstepfiles*int4_init/
+	DATA	sf_1step		/maxstepfiles*real8_init/
+	DATA	sf_lastep		/maxstepfiles*real8_init/
+	DATA	sf_delta		/maxstepfiles*real8_init/
+	DATA	sf_reclen		/maxstepfiles*int4_init/
+	DATA	sf_valid		/maxstepfiles*.FALSE./
+	DATA	sf_lunit		/maxstepfiles*file_not_open/
+	DATA	sf_index		/maxstepfiles*char_init23/
+	DATA	sf_regvars		/maxstepfiles*.TRUE./
+	DATA	sf_regtimes		/maxstepfiles*.TRUE./
+	DATA	sf_ndxs 		/maxstepfiles*int4_init/
+	DATA	sf_ndxe 		/maxstepfiles*int4_init/
+	DATA	vf_firstvar		/maxvarfiles*int4_init/
+	DATA	vf_lastvar		/maxvarfiles*int4_init/
+
+	END
diff --git a/fmt/src/xsys_names_data.F b/fmt/src/xsys_names_data.F
new file mode 100644
index 0000000..0d5b679
--- /dev/null
+++ b/fmt/src/xsys_names_data.F
@@ -0,0 +1,57 @@
+	BLOCK DATA XSYS_NAMES_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* initialize data for indicated COMMON block
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 -  4/30/91
+
+#ifdef unix
+	include 'xsys_names.cmn_text'
+#else
+	INCLUDE 'TMAP_FORMAT:XSYS_NAMES.CMN_TEXT'
+#endif
+
+      DATA	tmap_sets        / 'FER_DESCR' /,
+     .          tmap_tsteps      / 'FER_DATA'  /,
+     .          tmap_grids       / 'FER_GRIDS' /,
+     .          tmap_model_runs  / 'FER_MODEL_RUNS' /
+
+      END
diff --git a/fmt/src/xunits_data.F b/fmt/src/xunits_data.F
new file mode 100644
index 0000000..f817660
--- /dev/null
+++ b/fmt/src/xunits_data.F
@@ -0,0 +1,217 @@
+	BLOCK DATA XUNITS_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* unit names and conversion factors
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.00 - 04/15/88
+* revision 0.01 - 11/21/88 - variable initialization changed to char_initXX
+* revision 0.02 - 01/12/90 - added mb (kludge - not really convertible) *sh*
+* revision 0.03 - 07/23/92 - added "layer" and "level" (unconvertible units)
+*             (to eliminate error msg for these commonly used units)
+* revision 0.04 - 12/19/94 - made mb non-convertible (1.0 instead of 0.01)
+*			     and added unconvertible decibars
+* 9/26/95 - interchanged the values (order) of pun_meters and pun_millibars
+*		because TM_UNIT_ID was incorrectly interpreting "mbar"
+* *kob* 10/96   - Linux port.  Linux didn't like tabs between "include"
+*                 and what was being included.  removed them
+* V5 *kob* 3/99 - add gregorian_ye[ar], year360, year366 units and also added
+*              year365 as an alternate unit to the common year.
+*    *sh* 7/99 - add alias "dbar" and change "month" definition to 1/12
+*		 of 365.2425 day year 
+*    *kob* 11/99 - add alternate unit "year" which is equal to a 
+*                  gregorian_year
+* *sh* 12/99 - add "degree" as an alternate name since exact match is now
+*	required on names
+* V510: 3/00 *sh* - added "minute" and "month"
+* V520: 6/00 *sh* bug fix: exact matching in TM_UNIT_ID broke "seconds" match
+*		         - add "hr" as an abbreviation for hours
+*       1 day later: ops -- "hour" should be the standard, not "hr"
+* V530: 2/01 *acm* add units for alternative calendars, secs per various
+*		   years and 1/12 of those for "month"
+* V532: 5/01 *sh* - added "metre"
+* V554: 2/04 *acm*  default year length is 365.2425 days
+* V570 *acm* 5/04  Add the calendar ALL_LEAP = 366_DAY, and units for the corresp. month.
+
+* local variable declarations
+!	INTEGER	i
+
+	include 'tmap_dims.parm'
+#include "tmap_dset.parm"
+#include "gt_lib.parm"
+	include 'xunits.cmn_text'
+
+
+	DATA	un_name   ( 0)	/ ' '	/,	! FOR UNIDENTIFIED UNITS
+     .		un_convert( 0)	/ 1.0 /
+
+	DATA	un_name( 1)	/ 'cm'		/,
+     .		un_name( 2)	/ 'km'		/,
+     .		un_name(pun_meters)	/ 'm'		/,
+     .		un_name(pun_degrees)	/ 'deg'		/,
+     .		un_name( 5)	/ 'ft'		/,
+     .		un_name( 6)	/ 'in'		/,
+     .		un_name( 7)	/ 'mile'	/,
+     .		un_name( 8)	/ 'mm'		/,
+     .		un_name(pun_millibars)	/ 'mb'		/,
+     .		un_name(pun_decibars)	/ 'dbar'	/,
+     .		un_name(11)	/ char_init12	/,
+     .		un_name(12)	/ char_init12	/,
+     .		un_name(13)	/ char_init12	/,
+     .		un_name(14)	/ 'level' 	/,
+     .		un_name(15)	/ 'layer'	/
+
+	DATA	un_name( -1)	/ 'sec'		/,
+     .		un_name( -2)	/ 'min'		/,
+     .		un_name( -3)	/ 'hour'	/,
+     .		un_name( -4)	/ 'day'		/,
+     .		un_name( -5)	/ 'mon'		/,
+     .		un_name( -6)	/ 'yr'		/,
+     .		un_name( -7)	/ 'M2 cycles'	/,
+     .		un_name( -8)	/ 'year366'     /,
+     .		un_name( -9)	/ 'year360'     /,
+     .		un_name(-10)	/ 'gregorian_ye'/
+     .		un_name(-11)	/ 'noleap_ye'/
+     .		un_name(-12)	/ 'julian_ye'/
+     .		un_name(-13)	/ 'mon_noleap'/
+     .		un_name(-14)	/ 'mon_360'/
+     .		un_name(-15)	/ 'mon_julian'/
+
+	DATA	un_convert( 1)	/ .01		/,
+     .		un_convert( 2)	/ 1000.		/,
+     .		un_convert(pun_meters)	/ 1.0		/,
+     .		un_convert( 4)	/ deg2m		/,
+     .		un_convert( 5)	/ 0.3048	/,
+     .		un_convert( 6)	/ 0.0254	/,
+     .		un_convert( 7)	/ 1609.		/,
+     .		un_convert( 8)	/ .001		/,
+     .		un_convert(pun_millibars)	/ 1.0 /,! not convertible 12/94
+     .		un_convert(pun_decibars)	/ 1.0 /,! kludge: not cnvertble
+     .		un_convert(11)	/ real4_init	/,
+     .		un_convert(12)	/ real4_init	/,
+     .		un_convert(13)	/ real4_init	/,
+     .		un_convert(14)	/ 1.0    	/, ! kludge for not convertible
+     .		un_convert(15)	/ 1.0    	/  ! kludge for not convertible
+
+	DATA	un_convert( -1)	/ 1.0		/,
+     .		un_convert( -2)	/ 60.		/,
+     .		un_convert( -3)	/ 3600.		/, ! sec per hour
+     .		un_convert( -4)	/ 86400.	/, ! sec per day
+     .		un_convert( -5)	/ 2629746.	/, ! 1/12 of 365.2425 year
+
+c     .		un_convert( -6)	/ 31536000.	/, ! sec per 365 day year (OLD default)
+     .		un_convert( -6)	/ 31556952.	/  ! sec per 365.2425 year
+
+     .		un_convert( -7)	/ 44712.	/, ! sec per M2 cycle
+     .		un_convert( -8)	/ 31622400.	/, ! sec per 366 day year
+     .		un_convert( -9)	/ 31104000.	/, ! sec per 360 day year
+     .		un_convert(-10)	/ 31556952.	/  ! sec per 365.2425 year
+
+     .		un_convert(-11)	/ 31536000.	/ ! sec per 365.0 day year
+     .		un_convert(-12)	/ 31557600.	/ ! sec per 365.25 day year
+
+     .		un_convert(-13)	/ 2628000.	/ ! 1/12 of sec per 365 day year
+     .		un_convert(-14)	/ 2592000.	/ ! 1/12 of sec per 360 day year
+     .		un_convert(-15)	/ 2629800.	/ ! 1/12 of sec per 365.25 day year
+     .		un_convert(-16)	/ 2635200.	/ ! 1/12 of sec per 366 day year
+
+	DATA	un_alt_name ( 1) / 'centim'	/,
+     .		un_alt_subsc( 1) / 1 /,
+     .
+     .		un_alt_name ( 2) / 'kilom'	/,
+     .		un_alt_subsc( 2) / 2 /,
+     .
+     .		un_alt_name ( 3) / 'milim'	/,
+     .		un_alt_subsc( 3) / 8 /,
+     .
+     .		un_alt_name ( 4) / 'lat'	/,
+     .		un_alt_subsc( 4) / pun_degrees /,
+     .
+     .		un_alt_name ( 5) / 'lon'	/,
+     .		un_alt_subsc( 5) / pun_degrees /,
+     .
+     .		un_alt_name ( 6) / 'feet'	/,
+     .		un_alt_subsc( 6) / 5 /,
+     .
+     .		un_alt_name ( 7) / 'foot'	/,
+     .		un_alt_subsc( 7) / 5 /,
+     .
+     .		un_alt_name ( 8) / 'meter'	/,! after all other "xxxxmeters"
+     .		un_alt_subsc( 8) / pun_meters /,
+     .
+     .		un_alt_name ( 9) / 'year365'/,
+     .		un_alt_subsc( 9) / -6 /,
+     .
+     .		un_alt_name (10) / 'millibar'	/,
+     .		un_alt_subsc(10) / pun_millibars /,
+     .
+     .		un_alt_name (11) / 'decibar'	/,
+     .		un_alt_subsc(11) / pun_decibars /,
+     .
+     .		un_alt_name (12) / 'common_year'/,
+     .		un_alt_subsc(12) / -6 /,
+     .
+     .		un_alt_name (13) / 'mbar'	/,
+     .		un_alt_subsc(13) / pun_millibars /,
+     .
+     .		un_alt_name (14) / 'year'	/,
+     .		un_alt_subsc(14) / -10 /,
+     .
+     .		un_alt_name (15) / 'degree'	/,
+     .		un_alt_subsc(15) / pun_degrees /,
+     .
+     .		un_alt_name (16) / 'month'	/,
+     .		un_alt_subsc(16) / -5 /,
+     .
+     .		un_alt_name (17) / 'minute'	/,
+     .		un_alt_subsc(17) / -2 /,
+     .
+     .		un_alt_name (18) / 'second'	/,
+     .		un_alt_subsc(18) / -1 /,
+     .
+     .		un_alt_name (19) / 'hr'		/,
+     .		un_alt_subsc(19) / -3 /,
+     .
+     .		un_alt_name (20) / 'metre'	/, ! those Brits ...
+     .		un_alt_subsc(20) /  pun_meters /
+!     .		un_alt_name (20) / char_init12	/,
+!     .		un_alt_subsc(20) / 0 /
+
+	END
diff --git a/gcircle.py b/gcircle.py
new file mode 100644
index 0000000..6f179cb
--- /dev/null
+++ b/gcircle.py
@@ -0,0 +1,637 @@
+"""
+Module of functions involving great circles
+(thus assuming spheroid model of the earth)
+with points given in longitudes and latitudes.
+"""
+
+import math
+import numpy
+import numpy.random
+
+# Equitorial radius of the earth in kilometers
+EARTH_ER = 6378.137
+
+# Authalic radius of the earth in kilometers
+EARTH_AR = 6371.007
+
+# Meridional radius of the earth in kilometers
+EARTH_MR = 6367.449
+
+# Polar radius of the earth in kilometers
+EARTH_PR = 6356.752
+
+DEG2RAD = math.pi / 180.0
+RAD2DEG = 180.0 / math.pi
+KM2MI = 0.6213712
+MI2KM = 1.609344
+
+
+def lonlatdistance(pt1lon, pt1lat, pt2lon, pt2lat):
+    """
+    Compute the great circle distance between two points
+    on a sphere using the haversine formula.
+
+    Arguments:
+        pt1lon - longitude(s) of the first point
+        pt1lat - latitude(s) of the first point
+        pt2lon - longitude(s) of the second point
+        pt2lat - latitude(s) of the second point
+    Returns:
+        The great circle distance(s) in degrees [0.0, 180.0]
+    """
+    lon1 = numpy.deg2rad(numpy.asarray(pt1lon, dtype=float))
+    lat1 = numpy.deg2rad(numpy.asarray(pt1lat, dtype=float))
+    lon2 = numpy.deg2rad(numpy.asarray(pt2lon, dtype=float))
+    lat2 = numpy.deg2rad(numpy.asarray(pt2lat, dtype=float))
+    dellat = numpy.power(numpy.sin(0.5 * (lat2 - lat1)), 2.0)
+    dellon = numpy.cos(lat1) * numpy.cos(lat2) * \
+             numpy.power(numpy.sin(0.5 * (lon2 - lon1)), 2.0)
+    dist = 2.0 * numpy.arcsin(numpy.power(dellon + dellat, 0.5))
+    return numpy.rad2deg(dist)
+
+
+def lonlatintersect(gc1lon1, gc1lat1, gc1lon2, gc1lat2,
+                    gc2lon1, gc2lat1, gc2lon2, gc2lat2):
+    """
+    Compute the intersections of two great circles.  Uses the line of
+    intersection between the two planes of the great circles.
+
+    Arguments:
+        gc1lon1 - longitude(s) of the first point on the first great circle
+        gc1lat1 - latitude(s) of the first point on the first great circle
+        gc1lon2 - longitude(s) of the second point on the first great circle
+        gc1lat2 - latitude(s) of the second point on the first great circle
+        gc2lon1 - longitude(s) of the first point on the second great circle
+        gc2lat1 - latitude(s) of the first point on the second great circle
+        gc2lon2 - longitude(s) of the second point on the second great circle
+        gc2lat2 - latitude(s) of the second point on the second great circle
+    Returns:
+        ( (pt1lon, pt1lat), (pt2lon, pt2lat) ) - the longitudes and latitudes
+                  of the two intersections of the two great circles.  NaN will
+                  be returned for both longitudes and latitudes if a great
+                  circle is not well-defined, or the two great-circles coincide.
+    """
+    # Minimum acceptable norm of a cross product
+    # arcsin(1.0E-7) = 0.02" or 0.64 m on the Earth
+    MIN_NORM = 1.0E-7
+    # Convert longitudes and latitudes to points on a unit sphere
+    # The "+ 0.0 * ptlonr" is to broadcast gcz if needed
+    ptlonr = numpy.deg2rad(numpy.asarray(gc1lon1, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(gc1lat1, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    gc1xyz1 = numpy.array([gcx, gcy, gcz])
+    #
+    ptlonr = numpy.deg2rad(numpy.asarray(gc1lon2, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(gc1lat2, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    gc1xyz2 = numpy.array([gcx, gcy, gcz])
+    #
+    ptlonr = numpy.deg2rad(numpy.asarray(gc2lon1, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(gc2lat1, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    gc2xyz1 = numpy.array([gcx, gcy, gcz])
+    #
+    ptlonr = numpy.deg2rad(numpy.asarray(gc2lon2, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(gc2lat2, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    gc2xyz2 = numpy.array([gcx, gcy, gcz])
+    # Get the unit-perpendicular to the plane going through the
+    # origin and the two points on each great circle.  If the
+    # norm of the cross product is too small, the great circle
+    # is not well-defined, so zero it out so NaN is produced.
+    gc1pp = numpy.cross(gc1xyz1, gc1xyz2, axis=0)
+    norm = (gc1pp[0]**2 + gc1pp[1]**2 + gc1pp[2]**2)**0.5
+    if len(norm.shape) == 0:
+        if numpy.fabs(norm) < MIN_NORM:
+            norm = 0.0
+    else:
+        norm[ numpy.fabs(norm) < MIN_NORM ] = 0.0
+    gc1pp /= norm
+    gc2pp = numpy.cross(gc2xyz1, gc2xyz2, axis=0)
+    norm = (gc2pp[0]**2 + gc2pp[1]**2 + gc2pp[2]**2)**0.5
+    if len(norm.shape) == 0:
+        if numpy.fabs(norm) < MIN_NORM:
+            norm = 0.0
+    else:
+        norm[ numpy.fabs(norm) < MIN_NORM ] = 0.0
+    gc2pp /= norm
+    # The line of intersection of the two planes is perpendicular
+    # to the two plane-perpendiculars and goes through the origin.
+    # Points of intersection are the points on this line one unit
+    # from the origin.  If the norm of the cross product is too
+    # small, the two planes are practically indistiguishable from
+    # each other (coincide).
+    pt1xyz = numpy.cross(gc1pp, gc2pp, axis=0)
+    norm = (pt1xyz[0]**2 + pt1xyz[1]**2 + pt1xyz[2]**2)**0.5
+    if len(norm.shape) == 0:
+        if numpy.fabs(norm) < MIN_NORM:
+            norm = 0.0
+    else:
+        norm[ numpy.fabs(norm) < MIN_NORM ] = 0.0
+    pt1xyz /= norm
+    pt2xyz = -1.0 * pt1xyz
+    # Convert back to longitudes and latitudes
+    pt1lats = numpy.rad2deg(numpy.arcsin(pt1xyz[2]))
+    pt1lons = numpy.rad2deg(numpy.arctan2(pt1xyz[1], pt1xyz[0]))
+    pt2lats = numpy.rad2deg(numpy.arcsin(pt2xyz[2]))
+    pt2lons = numpy.rad2deg(numpy.arctan2(pt2xyz[1], pt2xyz[0]))
+    return ( (pt1lons, pt1lats), (pt2lons, pt2lats) )
+
+
+def lonlatfwdpt(origlon, origlat, endlon, endlat, fwdfact):
+    """
+    Find the longitude and latitude of a point that is a given factor
+    times the distance along the great circle from an origination point
+    to an ending point.
+
+    Note that the shorter great circle arc from the origination point
+    to the ending point is always used.
+
+    If O is the origination point, E is the ending point, and P is
+    the point returned from this computation, a factor value of:
+        0.5: P bisects the great circle arc between O and E
+        2.0: E bisects the great circle arc between O and P
+       -1.0: O bisects the great circle arc between P and E
+
+    Arguments:
+        origlon - longitude(s) of the origination point
+        origlat - latitude(s) of the origination point
+        endlon  - longitude(s) of the ending point
+        endlat  - latitude(s) of the ending point
+        fwdfact - forward distance factor(s)
+
+    Returns:
+        (ptlon, ptlat) - longitude and latitude of the computed point(s).
+                         NaN will be returned for both the longitude and
+                         latitude if the great circle is not well-defined.
+    """
+    # Minimum acceptable norm of a cross product
+    # arcsin(1.0E-7) = 0.02" or 0.64 m on the Earth
+    MIN_NORM = 1.0E-7
+    # Convert longitudes and latitudes to points on a unit sphere
+    # The "+ 0.0 * ptlonr" is to broadcast gcz if needed
+    ptlonr = numpy.deg2rad(numpy.asarray(origlon, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(origlat, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    origxyz = numpy.array([gcx, gcy, gcz])
+    #
+    ptlonr = numpy.deg2rad(numpy.asarray(endlon, dtype=float))
+    ptlatr = numpy.deg2rad(numpy.asarray(endlat, dtype=float))
+    gcz = numpy.sin(ptlatr) + 0.0 * ptlonr
+    coslat = numpy.cos(ptlatr)
+    gcy = coslat * numpy.sin(ptlonr)
+    gcx = coslat * numpy.cos(ptlonr)
+    endxyz = numpy.array([gcx, gcy, gcz])
+    # Determine the rotation matrix about the origin that takes
+    # origxyz to (1,0,0) (equator and prime meridian) and endxyz
+    # to (x,y,0) with y > 0 (equator in eastern hemisphere).
+    #
+    # The first row of the matrix is origxyz.
+    #
+    # The third row of the matrix is the normalized cross product
+    # of origxyz and endxyz.  (The great circle plane perpendicular.)
+    # If the norm of this cross product is too small, the great
+    # circle is not well-defined, so zero it out so NaN is produced.
+    gcpp = numpy.cross(origxyz, endxyz, axis=0)
+    norm = (gcpp[0]**2 + gcpp[1]**2 + gcpp[2]**2)**0.5
+    if len(norm.shape) == 0:
+        if numpy.fabs(norm) < MIN_NORM:
+            norm = 0.0
+    else:
+        norm[ numpy.fabs(norm) < MIN_NORM ] = 0.0
+    gcpp /= norm
+    # The second row of the matrix is the cross product of the
+    # third row (gcpp) and the first row (origxyz).  This will
+    # have norm 1.0 since gcpp and origxyz are perpendicular
+    # unit vectors.
+    fwdax = numpy.cross(gcpp, origxyz, axis=0)
+    # Get the coordinates of the rotated end point.
+    endtrx = origxyz[0] * endxyz[0] + origxyz[1] * endxyz[1] + origxyz[2] * endxyz[2]
+    endtry = fwdax[0]   * endxyz[0] + fwdax[1]   * endxyz[1] + fwdax[2]   * endxyz[2]
+    # Get the angle along the equator of the rotated end point, multiply
+    # by the given factor, and convert this new angle back to coordinates.
+    fwdang  = numpy.arctan2(endtry, endtrx)
+    fwdang *= numpy.asarray(fwdfact, dtype=float)
+    fwdtrx  = numpy.cos(fwdang)
+    fwdtry  = numpy.sin(fwdang)
+    # Rotate the new point back to the original coordinate system
+    # The inverse rotation matrix is the transpose of that matrix.
+    fwdx = origxyz[0] * fwdtrx + fwdax[0] * fwdtry
+    fwdy = origxyz[1] * fwdtrx + fwdax[1] * fwdtry
+    fwdz = origxyz[2] * fwdtrx + fwdax[2] * fwdtry
+    # Convert the point coordinates into longitudes and latitudes
+    ptlat = numpy.rad2deg(numpy.arcsin(fwdz))
+    ptlon = numpy.rad2deg(numpy.arctan2(fwdy, fwdx))
+    return (ptlon, ptlat)
+
+
+def equidistscatter(min_lon, min_lat, max_lon, max_lat, min_gcdist, dfactor=5.0):
+    """
+    Create a roughly equidistance set of points in a specified region.
+
+    This is done by creating a dense "grid" of points, then repeatedly
+    randomly selecting a point from that collection and eliminating
+    points too close to that selected point.  For the special cases
+    where min_lon and max_lon, or min_lat and max_lat, are very close
+    relative to min_gcdist, the maximum number of evenly spaced points
+    that can be put on the line described is computed and assigned.
+
+    Arguments:
+        min_lon - minimum longitude of the region
+        min_lat - minimum latitude of the region
+        max_lon - maximum longitude of the region
+        max_lat - maximum latitude of the region
+        min_gcdist - minimum distance, in great circle degrees,
+                  between returned points
+        dfactor - the number of axis points in the dense "grid"
+                  compared to the desired "grid".  Larger value will
+                  generally increase the uniformity of the returned
+                  points but will also increase the time required
+                  for the calculation.
+    Returns:
+        (pt_lons, pt_lats) - ptlons is an array of longitudes and ptlats
+                  is an array of latitudes of (somewhat random) points in
+                  the specified region that are roughly equidistance from
+                  each other but not closer than min_gcdist to each other.
+    """
+    lonmin = float(min_lon)
+    lonmax = float(max_lon)
+    if math.fabs(lonmax - lonmin) > 180.0:
+        raise ValueError("Difference between max_lon and min_lon is more than 180.0")
+    latmin = float(min_lat)
+    if math.fabs(latmin) > 90.0:
+        raise ValueError("min_lat is not in [-90.0,90.0]")
+    latmax = float(max_lat)
+    if math.fabs(latmax) > 90.0:
+        raise ValueError("max_lat is not in [-90.0,90.0]")
+    mindeg = float(min_gcdist)
+    if (mindeg <= 0.0) or (mindeg >= 90.0):
+        raise ValueError("min_gcdist is not in (0.0,90.0)")
+    dfact = float(dfactor)
+    if dfact < 1.0:
+        raise ValueError("dfactor is less than one");
+
+    # If lonmin is relatively close to lonmax, directly
+    # compute the points.  Distance on a meridian is the
+    # differnce in latitudes.
+    if math.fabs(lonmax - lonmin) < (0.05 * mindeg):
+        lon = 0.5 * (lonmax + lonmin)
+        dellat = mindeg
+        numlats = int( (math.fabs(latmax - latmin) + dellat) / dellat )
+        if latmax < latmin:
+            dellat *= -1.0
+        hdiff = 0.5 * ( (latmax - latmin) - (numlats - 1) * dellat )
+        latvals = numpy.linspace(latmin + hdiff, latmax - hdiff, numlats)
+        lonvals = numpy.ones((numlats,), dtype=float) * lon
+        return (lonvals, latvals)
+
+    # If latmin is relatively close to latmax, directly
+    # compute the points.  Distance depends on the latitude
+    # as well as the differnce in longitudes.
+    if math.fabs(latmax - latmin) < (0.05 * mindeg):
+        lat = 0.5 * (latmax + latmin)
+        numer = math.sin(0.5 * DEG2RAD * mindeg)
+        denom = math.cos(lat * DEG2RAD)
+        if numer < denom:
+            dellon = math.asin(numer / denom) * 2.0 * RAD2DEG
+            numlons = int( (math.fabs(lonmax - lonmin) + dellon) / dellon )
+        else:
+            # everything too close to a pole - just select one point
+            dellon = 180.0
+            numlons = 1
+        if lonmax < lonmin:
+            dellon *= -1.0
+        hdiff = 0.5 * ( (lonmax - lonmin) - (numlons - 1) * dellon )
+        lonvals = numpy.linspace(lonmin + hdiff, lonmax - hdiff, numlons)
+        latvals = numpy.ones((numlons,), dtype=float) * lat
+        return (lonvals, latvals)
+
+    # Get the number of latitudes for the dense grid
+    # Always use latmin and latmax, even if they are too close
+    dellat = mindeg / dfact
+    numlats = int( (math.fabs(latmax - latmin) + dellat) / dellat )
+    if numlats < 2:
+         numlats = 2
+    latvals = numpy.linspace(latmin, latmax, numlats)
+
+    # Create the dense grid of longitudes and latitudes
+    denslons = [ ]
+    denslats = [ ]
+    numer = math.sin(0.5 * DEG2RAD * mindeg / dfact)
+    for lat in latvals:
+        # Get the number of longitudes for the dense grid
+        # Always use lonmin and lonmax, even if they are too close
+        denom = math.cos(lat * DEG2RAD)
+        if numer < denom:
+            dellon = math.asin(numer / denom) * 2.0 * RAD2DEG
+            numlons = int( (math.fabs(lonmax - lonmin) + dellon) / dellon )
+            if numlons < 2:
+                numlons = 2
+        else:
+            # too close to a pole
+            numlons = 2
+        lonvals = numpy.linspace(lonmin, lonmax, numlons)
+        # Add each lon,lat pair to the dense grid
+        for lon in lonvals:
+            denslons.append(lon)
+            denslats.append(lat)
+    denslons = numpy.asarray(denslons)
+    denslats = numpy.asarray(denslats)
+
+    # create a random permutation of the indices to use for the selection order
+    availinds = numpy.random.permutation(len(denslats))
+    selectinds = [ ]
+    while len(availinds) > 0:
+        # Get the index of the next available point
+        ind = availinds[0]
+        selectinds.append(ind)
+        # Compute the distance of the available points to the selected point
+        gcdists = lonlatdistance(denslons[ind], denslats[ind],
+                                 denslons[availinds], denslats[availinds])
+        # Remove indices of any available points too close to this point
+        availinds = availinds[ gcdists >= mindeg ]
+    # sort the selected indices so the longitudes and latitudes have some order
+    selectinds = numpy.sort(selectinds)
+    # get the selected longitudes and latitudes
+    selectlons = denslons[selectinds]
+    selectlats = denslats[selectinds]
+    # return the selected longitudes and latitudes arrays
+    return (selectlons, selectlats)
+
+#
+# The following is just for testing "by-hand" and to serve as examples.
+#
+
+if __name__ == "__main__":
+    # Test lonlatdistance
+    tenten = numpy.linspace(0.0,90.0,10)
+    # On the equator, distance = delta longitude
+    dists = lonlatdistance(0.0, 0.0, tenten, 0.0)
+    if not numpy.allclose(dists, tenten):
+        raise ValueError("Equatorial distances FAIL; expect: %s; found: %s" % (str(tenten), str(dists)))
+    print "Equatorial distance: PASS"
+    print
+
+    # On any meridian, distance = delta latitude
+    dists = lonlatdistance(20.0, 0.0, 20.0, tenten)
+    if not numpy.allclose(dists, tenten):
+        raise ValueError("Meridional distances FAIL; expect: %s; found: %s" % (str(tenten), str(dists)))
+    print "Meridional distance: PASS"
+    print
+
+    # Play with some distances between cities (deg W, deg N)
+    seattle =  (122.0 + (20.0 / 60.0), 47.0 + (37.0 / 60.0))
+    portland = (122.0 + (41.0 / 60.0), 45.0 + (31.0 / 60.0))
+    spokane =  (117.0 + (26.0 / 60.0), 47.0 + (40.0 / 60.0))
+    austin =   ( 97.0 + (45.0 / 60.0), 30.0 + (15.0 / 60.0))
+    houston =  ( 95.0 + (23.0 / 60.0), 29.0 + (46.0 / 60.0))
+    dallas =   ( 96.0 + (48.0 / 60.0), 32.0 + (47.0 / 60.0))
+
+    lons = ( seattle[0], portland[0], spokane[0] )
+    lons1, lons2 = numpy.meshgrid(lons, lons)
+    lats = ( seattle[1], portland[1], spokane[1] )
+    lats1, lats2 = numpy.meshgrid(lats, lats)
+    dists = lonlatdistance(lons1, lats1, lons2, lats2)
+    dists *= DEG2RAD * EARTH_MR * KM2MI
+    expected = [ [   0, 146, 228 ],
+                 [ 146,   0, 290 ],
+                 [ 228, 290,   0 ] ]
+    if not numpy.allclose(dists, expected, rtol=0.01):
+        raise ValueError("Seattle, Portland, Spokane distance matrix in miles\n" \
+                         "    expect: %s\n"
+                         "    found:  %s" % (str(expected), str(dists)))
+    print "Seattle, Portland, Spokane distance matrix: PASS"
+    print
+
+    lons = ( austin[0], houston[0], dallas[0] )
+    lons1, lons2 = numpy.meshgrid(lons, lons)
+    lats = ( austin[1], houston[1], dallas[1] )
+    lats1, lats2 = numpy.meshgrid(lats, lats)
+    dists = lonlatdistance(lons1, lats1, lons2, lats2)
+    dists *= DEG2RAD * EARTH_MR * KM2MI
+    expected = [ [   0, 145, 184 ],
+                 [ 145,   0, 224 ],
+                 [ 184, 224,   0 ] ]
+    if not numpy.allclose(dists, expected, rtol=0.01):
+        raise ValueError("Austin, Houston, Dallas distance matrix in miles\n" \
+                         "    expect: %s\n"
+                         "    found:  %s" % (str(expected), str(dists)))
+    print "Austin, Houston, Dallas distance matrix: PASS"
+    print
+
+    # Test lonlatintersect
+    # Intersections of the equator with meridians
+    ((pt1lons, pt1lats), (pt2lons, pt2lats)) = \
+            lonlatintersect(0.0, 0.0, tenten, 0.0, \
+                            0.0, -90.0, tenten, tenten)
+    # First of the first great circle and last of the second great circle are not well-defined
+    expvalid = numpy.array([ True ] + ([ False ]*8) + [ True ])
+    validity = numpy.isnan(pt1lons)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of pt1lons: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    validity = numpy.isnan(pt1lats)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of pt1lats: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    validity = numpy.isnan(pt2lons)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of pt2lons: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    validity = numpy.isnan(pt2lats)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of pt2lats: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    if not numpy.allclose(pt1lons[1:-1], tenten[1:-1]):
+        raise ValueError("Valid pt1lons: expect: %s, found: %s" %\
+                          (str(tenten[1:-1]), str(pt1lons[1:-1])))
+    if not numpy.allclose(pt1lats[1:-1], 0.0):
+        raise ValueError("Valid pt1lats: expect: all zeros, found: %s" %\
+                          str(pt1lats[1:-1]))
+    if not numpy.allclose(pt2lons[1:-1], tenten[1:-1]-180.0):
+        raise ValueError("Valid pt2lons: expect: %s, found %s" %\
+                          (str(tenten[1:-1]-180.0), str(pt2lons[1:-1])))
+    if not numpy.allclose(pt2lats[1:-1], 0.0):
+        raise ValueError("Valid pt2lats: expect: all zeros, found %s" %\
+                          str(pt2lats[1:-1]))
+    print "Equator/meridian intersections: PASS"
+    print
+
+    ((pt1lons, pt1lats), (pt2lons, pt2lats)) = \
+            lonlatintersect( 0.0, 89.99, 180.0, 89.99,
+                            90.0, 89.99, -90.0, 89.99)
+    # longitudes could actually be anything, but this algorithm gives 45.0 and -135.0
+    if (abs(pt1lons -  45.0) > 1.0E-8) or (abs(pt1lats - 90.0) > 1.0E-8) or \
+       (abs(pt2lons + 135.0) > 1.0E-8) or (abs(pt2lats + 90.0) > 1.0E-8):
+        raise ValueError("Mini north pole cross intersections: expect: %s, found %s" % \
+                         (str([45.0, 90.0, 135.0, -90.0]),
+                          str([float(pt1lons), float(pt1lats),
+                               float(pt2lons), float(pt2lats)])))
+    print "Mini north pole cross intersections: PASS"
+    print
+
+
+    # Test lonlatfwdpt
+    lons, lats = lonlatfwdpt(portland[0], portland[1], spokane[0], spokane[1], 0.0)
+    if not ( numpy.allclose(lons, portland[0]) and numpy.allclose(lats, portland[1]) ):
+        raise ValueError("Zero forward from portland to spokane: expect %s, found %s" % \
+                         (str(portland), str((lons, lats))))
+    print "Zero forward: PASS"
+    print
+
+    lons, lats = lonlatfwdpt(portland[0], portland[1], spokane[0], spokane[1], 1.0)
+    if not ( numpy.allclose(lons, spokane[0]) and numpy.allclose(lats, spokane[1]) ):
+        raise ValueError("One forward from portland to spokane: expect %s, found %s" % \
+                         (str(spokane), str((lons, lats))))
+    print "One forward: PASS"
+    print
+
+    lons, lats = lonlatfwdpt(0.0, 0.0, tenten, 0.0, 3.0)
+    expectlons = 3.0 * tenten
+    expectlons[ expectlons > 180.0 ] -= 360.0
+    # The first great circle is not well-defined
+    expvalid = numpy.array([ True ] + ([ False ]*9))
+    validity = numpy.isnan(lons)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of fwd equator lons: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    validity = numpy.isnan(lats)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of fwd equator lats: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    if not numpy.allclose(lons[1:], expectlons[1:]):
+        raise ValueError("Valid fwd equator lons: expect: %s, found: %s" %\
+                          (str(expectlons[1:]), str(lons[1:])))
+    if not numpy.allclose(lats[1:], 0.0):
+        raise ValueError("Valid fwd equator lats: expect: all zeros, found: %s" %\
+                          str(lats[1:]))
+    print "Fwd equator: PASS"
+    print
+
+    lons, lats = lonlatfwdpt(0.0, -90.0, 0.0, tenten, 2.0)
+    # First longitude could be anything, but this algorithm gives 0.0
+    expectlats = 90.0 - 2.0 * tenten
+    # The last great circle is not well-defined
+    expvalid = numpy.array(([ False ]*9) + [ True ])
+    validity = numpy.isnan(lons)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of fwd prime meridian lons: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    validity = numpy.isnan(lats)
+    if not numpy.allclose(validity, expvalid):
+        raise ValueError("Validity of fwd prime meridian lats: expect: %s, found: %s" % \
+                          (str(expvalid), str(validity)))
+    # First longitude could be anything so ignore it
+    # Others should be either 180 == -180
+    poslons = lons[:]
+    poslons[ poslons < 0.0 ] += 360.0
+    if not numpy.allclose(lons[1:-1], 180.0):
+        raise ValueError("Valid fwd prime meridian lons: expect: all 180.0 or -180.0, found: %s" %\
+                          str(lons[1:-1]))
+    if not numpy.allclose(lats[:-1], expectlats[:-1]):
+        raise ValueError("Valid fwd prime meridian lats: expect: %s, found: %s" %\
+                          (str(expectlats[:-1]), str(lats[:-1])))
+    print "Fwd prime meridian: PASS"
+    print
+
+    lons, lats = lonlatfwdpt(0.0, 0.0, 45.0, 45.0, (2.0, 3.0, 4.0, 5.0))
+    expectlons = [ 135.0, 180.0, -135.0, -45.0 ]
+    expectlats = [  45.0,   0.0,  -45.0, -45.0 ]
+    if not numpy.allclose(lons, expectlons):
+        raise ValueError("Fwd diagonal lons: expect: %s, found: %s" %\
+                          (str(expectlons), str(lons)))
+    if not numpy.allclose(lats, expectlats):
+        raise ValueError("Fwd diagonal lats: expect: %s, found: %s" %\
+                          (str(expectlats), str(lats)))
+    print "Fwd diagonal: PASS"
+    print
+
+    # Test equdistscatter
+    lons, lats = equidistscatter(0.0, 0.0, 0.0, 0.0, 1.0)
+    if (lons.shape != (1,)) or (lons[0] != 0.0) or \
+       (lats.shape != (1,)) or (lats[0] != 0.0):
+        raise ValueError("Equidistscatter single-point FAIL; \n" \
+                         "  expect: ([0.0],[0.0]), \n" \
+                         "  found (%s,%s)" % (str(lons), str(lats)))
+    print "Equidistscatter single-point PASS"
+    print
+
+    lons, lats = equidistscatter(0.0, 90.0, 90.0, 90.0, 1.0)
+    if (lons.shape != (1,)) or (lons[0] != 45.0) or \
+       (lats.shape != (1,)) or (lats[0] != 90.0):
+        raise ValueError("Equidistscatter pole-point FAIL; \n" \
+                         "  expect: ([45.0],[90.0]), \n" \
+                         "  found (%s,%s)" % (str(lons), str(lats)))
+    print "Equidistscatter pole-point PASS"
+    print
+
+    lons, lats = equidistscatter(0.0, 0.0, 90.0, 0.0, 1.0)
+    if not numpy.all( lats == 0.0 ):
+        raise ValueError("Equidistscatter equitorial FAIL; \n" \
+                         "  expect: all zero latititudes, \n" \
+                         "  found %s" % str(lats))
+    deltas = lons[1:] - lons[:-1]
+    if not numpy.all( deltas >= 1.0 ):
+        raise ValueError("Equidistscatter equitorial FAIL; \n" \
+                         "  expect: longitudes monotonic increasing by at least 1.0 degrees, \n" \
+                         "  found %s" % str(lons))
+    if not numpy.all( deltas < 1.0001 ):
+        raise ValueError("Equidistscatter equitorial FAIL; \n" \
+                         "  expect: longitudes monotonic increasing by less than 1.0001 degrees, \n" \
+                         "  found %s" % str(lons))
+    print "Equidistscatter equitorial PASS"
+    print
+
+    lons, lats = equidistscatter(0.0, 0.0, 0.0, 90.0, 1.0)
+    if not numpy.all( lons == 0.0 ):
+        raise ValueError("Equidistscatter meridional FAIL; \n" \
+                         "  expect: all zero longitudes, \n" \
+                         "  found %s" % str(lons))
+    deltas = lats[1:] - lats[:-1]
+    if not numpy.all( deltas >= 1.0 ):
+        raise ValueError("Equidistscatter meridional FAIL; \n" \
+                         "  expect: latitudes monotonic increasing by at least 1.0 degrees, \n" \
+                         "  found %s" % str(lats))
+    if not numpy.all( deltas < 1.0001 ):
+        raise ValueError("Equidistscatter meridional FAIL; \n" \
+                         "  expect: latitudes monotonic increasing by less than 1.0001 degrees, \n" \
+                         "  found %s" % str(lats))
+    print "Equidistscatter meridional PASS"
+    print
+
+    lons, lats = equidistscatter(0.0, 0.0, 90.0, 90.0, 5.0, 15.0)
+    nndists = [ ]
+    for j in xrange(len(lons)):
+        gcdists = lonlatdistance(lons[j], lats[j], lons, lats)
+        gcdists[j] = 180.0
+        if not numpy.all( gcdists >= 5.0 ):
+            raise ValueError("Equidistscatter region FAIL; \n" \
+                             "  expect distances[%d] >= 2.0, \n" \
+                             "  found %s" % (j, str(gcdists)))
+        nndists.append(gcdists.min())
+    nndists = numpy.array(nndists)
+    if not numpy.all( nndists < 10.0 ):
+        raise ValueError("Equidistscatter region FAIL; \n" \
+                         "  expect nearest neighbor distances < 10.0, \n" \
+                         "  found %s" % str(nndists))
+    print "Nearest neighbor distances: \n" \
+          "    min = %f, max = %f, mean = %f, stdev = %f" % \
+          (nndists.min(), nndists.max(), nndists.mean(), nndists.std())
+
+    print "Equidistscatter region PASS"
+    print
diff --git a/jnls/contrib/TS_section.jnl b/jnls/contrib/TS_section.jnl
new file mode 100644
index 0000000..5db7965
--- /dev/null
+++ b/jnls/contrib/TS_section.jnl
@@ -0,0 +1,85 @@
+! Draws T-S plot for a data_file_name
+
+! Programed by E. D. Cokelet, 3 Aug 2004
+! Last modified 10 Mar 2005
+
+! Plot a TS diagram with potential density contours.  You may choose your 
+! reference pressure for your potential density.  The script was written 
+! for Arctic work, so it plots water mass boundaries appropriate for the 
+! Arctic along with the freezing point line.  You may alter or remove this 
+! part of the code.
+
+
+
+define symbol data_file_name = $1
+define symbol temp_rng = -2.0:6.0
+define symbol sal_rng = 32.9:35.2
+define symbol ref_pres = 0
+
+
+! Plot T-S diagram with density contours
+
+define axis/x=($sal_rng)/npoints=20/units="psu" s_ax
+define axis/y=($temp_rng)/npoints=20/units="deg C" theta_ax
+
+define grid/x=s_ax/y=theta_ax st_grd
+
+let sal_plt  = x[g=st_grd]
+let theta_plt = y[g=st_grd]
+
+set variable/title=Salinity/units=psu sal_plt
+set variable/title="Potential Temperature"/units="deg C" theta_plt
+
+let temp_IPTS_68 = 1.00024*theta_plt	! Convert to IPTS-68 scale to use eqn. of state
+
+let sigma = rho_un( sal_plt, temp_IPTS_68, ($ref_pres)) - 1000
+set variable/title="sigma_($ref_pres)"/units="kg/m**3" sigma
+
+set window/size=2
+
+contour/title="TS referred to ($ref_pres) dbar, ($data_file_name)" sigma,sal_plt,theta_plt
+
+
+! Add freezing point line
+
+let t_f = (-0.0575*sal_plt) + 1.710523e-3*sal_plt^1.5 - 2.154996e-4*sal_plt^2
+let t_f_IPTS_68 = 1.00024*t_f
+
+plot/over/line/vs/nolabel/color=black/thickness=2 sal_plt,t_f_IPTS_68
+
+label/user 33.64 -1.75 0 0 0.15 @P7F.P.
+
+
+! Add lines for water mass types
+
+plot/over/line/vs/nolabel/color=black/thick=2 {34.88,34.88,35.2},{6.0,2.0,2.0}		! AW
+plot/over/line/vs/nolabel/color=black/thick=2 {34.88,34.88,35.2},{-2.0,2.0,2.0}		! LAIW
+plot/over/line/vs/nolabel/color=black/thick=2 {34.88,35.0,35.0},{-1.2,-1.2,-2.0}	! DW
+plot/over/line/vs/nolabel/color=black/thick=2 {34.7,34.7,34.88},{-2.0,1.0,1.0}		! UAIW
+plot/over/line/vs/nolabel/color=black/thick=2 {34.4,34.4,34.7},{-2.0,0.0,0.0}		! PIW
+plot/over/line/vs/nolabel/color=black/thick=2 {32.9,34.4,34.4},{0.0,0.0,-2.0}		! PW
+
+label/user 35.20 4.0 1 0 0.15 @P7AW
+label/user 35.05 0.0 0 0 0.15 @P7LAIW
+label/user 34.94 -1.5 0 0 0.15 @P7DW
+label/user 34.79 -0.5 0 0 0.15 @P7UAIW
+label/user 34.56 -1.0 0 0 0.15 @P7PIW
+label/user 33.0 -0.5 0 0 0.15 @P7PW
+label/user 34.0 3.0 0 0 0.15 @P7ASW
+
+
+! Plot T-S profiles from CTD data on T-S plot
+
+use ($data_file_name)
+
+let ii = i[gx=temp]
+let imax = ii[i=@max]
+
+let pres = z[gz=temp]
+
+let/title="Potential Temperature"/units="deg C" theta = theta_fo( sal, 1.00024*temp, pres, ($ref_pres))/1.00024	! Compute potential temperature
+
+repeat/i=1:`imax` (plot/over/vs/line sal,theta)
+
+sp \rm TS_($data_file_name).gif
+frame/format=gif/file=TS_($data_file_name).gif
diff --git a/jnls/contrib/TernaryDiagram.jnl b/jnls/contrib/TernaryDiagram.jnl
new file mode 100644
index 0000000..37e2e6f
--- /dev/null
+++ b/jnls/contrib/TernaryDiagram.jnl
@@ -0,0 +1,40 @@
+! TernaryDiagram : plotting mixtures of 3 variables in a triangular/ternary diagram
+!
+! define horizontal and vertical axes on which to draw triangle (2 wide;root3 high)
+!
+! Contributed by Mick Spillane, 8/2007
+! See his note in the Ferret Users List for an example plot 17-Aug-2007
+!
+!             A (1,root3)
+!           / | \             A point P lies at the intersection of three lines
+!          /  |/ \            that are parallel to the sides of the triangle ABC.
+!         /   /   \           The fractions Fa, Fb, Fc at P are the fractional
+!        /   /|    \          distances of each of these lines from its vertex,
+!       /   / |     \         with 100% at the vertex and 0% at the opposite side.
+!      / \ /  |      \        With vertices drawn as shown and P=(x,y):
+!     /---P---|-------\              Fa = y/root3
+!    /   / \  |        \             Fb = 1 - x'/root3, x'=xcos30-ysin30
+!   B___/___\_|_________C            Fc = 1-Fa-Fb
+! (0,0)               (2,0)   A triangular mask for the region is defined by:
+!                                      if(y < root3*(1-abs(x-1))then 1
+
+! choose a suitable resolution to represent the region
+let root3=3^0.5 ; def axis/y=0:2/npoints=201 yax
+def axis/x=0:2/npoints=201 xax ; def grid/x=xax/y=yax grd
+
+let mask=if(y[g=grd] le root3*(1-abs(x[g=grd]-1)))then 1
+let Fa=mask*y[g=grd]/root3
+let Fb=1-0.5*mask*(x[g=grd]+y[g=grd]/root3)
+let Fc=1-Fa-Fb
+
+! demo plot - first fix aspect ratio and turn off axes
+ppl axlen,5,5 ; ppl axset,0,0,0,0
+! ... then shade Fa and add Fb, Fd as contours
+shade/nolab Fa ; cont/o/nolab/spacing=0.8 Fb ; cont/o/nolab/spacing=0.8 Fc
+! add frame and vertex labels
+plot/o/nolab/vs/line=7 {0,2,1,0},{0,0,`root3`,0}
+label  1.0 `root3+0.05` 0 0 0.2 A
+label -0.1    0        -1 0 0.2 B
+label  2.1    0         1 0 0.2 C
+
+quit
diff --git a/jnls/contrib/bering_coast.dat b/jnls/contrib/bering_coast.dat
new file mode 100644
index 0000000..6ce9a8a
--- /dev/null
+++ b/jnls/contrib/bering_coast.dat
@@ -0,0 +1,13467 @@
+51.96944 177.54860
+51.95164 177.60805
+51.92305 177.59248
+51.92194 177.53831
+51.90805 177.48193
+51.93166 177.43832
+51.90498 177.36722
+51.86110 177.33888
+51.82860 177.30859
+51.86777 177.25916
+51.89806 177.24443
+51.92110 177.30249
+51.95860 177.35193
+51.98082 177.42943
+51.99110 177.50748
+99.00000 999.00000
+51.63277 178.74361
+51.63026 178.79111
+51.61998 178.85056
+51.60555 178.92027
+51.58249 178.97249
+99.00000 999.00000
+51.52332 178.97832
+51.54915 178.91388
+51.56972 178.85443
+51.57414 178.77277
+51.59639 178.70749
+51.62526 178.64998
+51.65749 178.67331
+99.00000 999.00000
+51.97110 178.57664
+51.92860 178.59860
+51.89610 178.54443
+51.91914 178.48164
+51.95332 178.47249
+51.98305 178.50305
+99.00000 999.00000
+51.54332 179.02081
+51.50471 179.07027
+51.47527 179.13165
+51.45639 179.20389
+51.41193 179.24277
+51.40277 179.28331
+51.40277 179.34639
+51.39055 179.41554
+51.36499 179.46388
+51.37415 179.40305
+51.35582 179.32889
+51.34999 179.24554
+51.38748 179.23915
+51.40915 179.16888
+51.43665 179.10472
+51.46915 179.04721
+99.00000 999.00000
+51.96664 179.75638
+51.93304 179.74443
+51.89665 179.71388
+51.86722 179.64972
+51.88388 179.57166
+51.91081 179.50581
+51.95277 179.50026
+51.97972 179.53389
+99.00000 999.00000
+51.82332 181.23666
+51.77805 181.27026
+51.74472 181.21333
+51.77110 181.14667
+51.81915 181.15750
+99.00000 999.00000
+51.64305 181.99001
+51.65721 181.93027
+51.69888 181.90944
+51.70444 181.98833
+99.00000 999.00000
+51.79166 181.94443
+51.82664 181.89444
+51.84915 181.82167
+51.88248 181.79776
+51.91138 181.86250
+51.91331 181.96388
+99.00000 999.00000
+51.89055 182.10138
+51.85638 182.12500
+51.83221 182.16583
+51.83998 182.24583
+51.84109 182.32056
+51.83722 182.37917
+51.81415 182.31833
+51.79639 182.23555
+51.76805 182.22917
+51.72581 182.18694
+51.67831 182.17471
+51.68138 182.11749
+51.63388 182.08693
+51.59389 182.08443
+51.63805 182.04417
+99.00000 999.00000
+51.71416 182.02834
+51.76471 182.04472
+99.00000 999.00000
+51.87582 182.93027
+51.84164 182.88388
+51.79472 182.87193
+51.74361 182.87109
+51.69998 182.83611
+51.69666 182.78806
+51.67444 182.72166
+51.69998 182.67276
+51.72610 182.60609
+51.70860 182.52888
+51.69388 182.45917
+51.68832 182.36943
+51.65472 182.33360
+51.69638 182.31000
+51.72443 182.34610
+51.72139 182.41859
+51.73610 182.48610
+51.75139 182.53943
+51.76332 182.61583
+51.77693 182.70526
+51.80331 182.77388
+51.85027 182.80222
+51.91110 182.80917
+51.93721 182.86250
+51.91443 182.93138
+99.00000 999.00000
+51.96722 183.44749
+51.91554 183.45610
+51.89389 183.38693
+51.85388 183.37222
+51.83139 183.40222
+51.82889 183.47250
+51.83888 183.50972
+51.82472 183.57693
+51.77638 183.57527
+51.73027 183.57027
+51.74388 183.51971
+51.72693 183.46944
+51.68610 183.42500
+51.68944 183.36693
+51.68138 183.30026
+51.64139 183.28999
+51.63081 183.26054
+51.60416 183.20193
+51.63998 183.19917
+51.68111 183.16527
+51.70110 183.16167
+51.65388 183.12750
+51.60889 183.09027
+51.59027 183.03806
+51.63638 183.03389
+51.67805 183.05917
+51.70526 183.11444
+51.74081 183.13889
+51.77193 183.17667
+51.77277 183.09555
+51.81276 183.11777
+51.78777 183.16110
+51.78360 183.25444
+51.79610 183.26305
+51.83638 183.21944
+51.84776 183.29639
+51.88193 183.24722
+51.93138 183.21777
+51.95805 183.28555
+51.95915 183.37054
+51.98581 183.43639
+99.00000 999.00000
+51.83665 183.70110
+51.82832 183.67500
+51.82166 183.71027
+51.78526 183.72472
+51.75000 183.71277
+51.73694 183.68333
+51.73248 183.63943
+51.75581 183.60193
+51.81639 183.59250
+51.84999 183.58221
+51.86221 183.66693
+99.00000 999.00000
+51.87277 183.84416
+51.83777 183.88722
+51.84943 183.95639
+51.80972 183.99388
+51.82193 183.93222
+51.80194 183.91138
+51.82332 183.86638
+51.77443 183.86084
+51.80666 183.82666
+51.84027 183.78806
+51.87889 183.79443
+99.00000 999.00000
+51.98915 183.97166
+51.96304 183.93639
+51.98915 183.87027
+99.00000 999.00000
+52.99915 172.84999
+52.97832 172.91193
+52.98360 172.99860
+99.00000 999.00000
+52.75221 172.95027
+52.76805 172.90610
+52.78581 172.85664
+52.77859 172.80165
+52.81110 172.77638
+52.86360 172.79277
+52.88248 172.78165
+52.87610 172.69194
+52.87332 172.63193
+52.91943 172.66026
+52.92139 172.57248
+52.91666 172.50276
+52.94276 172.51138
+52.97139 172.57193
+99.00000 999.00000
+52.98639 173.07472
+52.98389 173.15222
+52.94081 173.17415
+52.91222 173.16832
+52.94165 173.23831
+52.92331 173.30138
+52.88222 173.29999
+52.85860 173.29944
+52.85138 173.38914
+52.82915 173.43388
+52.82304 173.34193
+52.81194 173.31276
+52.84360 173.25415
+52.82388 173.19777
+52.79694 173.18443
+52.78888 173.13193
+52.82860 173.08472
+52.80249 173.01305
+99.00000 999.00000
+52.43332 173.51222
+52.46860 173.56749
+52.50165 173.62222
+52.50748 173.68748
+52.50555 173.78305
+52.47305 173.72916
+52.42471 173.71664
+52.36861 173.74193
+52.35248 173.67610
+52.37138 173.62860
+52.39499 173.59193
+52.38055 173.50665
+52.38832 173.42998
+52.41026 173.38582
+52.44110 173.44914
+99.00000 999.00000
+52.10999 177.66777
+52.06860 177.65749
+52.02582 177.62082
+99.00000 999.00000
+52.00665 177.51389
+52.05859 177.53581
+52.10248 177.56555
+52.11861 177.63860
+99.00000 999.00000
+52.00526 179.56972
+52.02832 179.64276
+99.00000 999.00000
+52.06972 183.98389
+99.00000 999.00000
+52.01138 183.96944
+99.00000 999.00000
+52.03665 183.81139
+52.08556 183.83221
+52.10277 183.89526
+99.00000 999.00000
+52.06082 184.00250
+99.00000 999.00000
+52.01694 184.03139
+99.00000 999.00000
+52.00305 184.95221
+99.00000 999.00000
+52.00444 184.84305
+52.00526 184.75693
+52.00722 184.67526
+52.02554 184.71638
+52.03110 184.79944
+52.04749 184.88026
+52.02609 184.90416
+52.03110 184.97055
+52.05777 184.97250
+99.00000 999.00000
+52.40805 185.85750
+52.38332 185.92667
+52.35609 185.99222
+99.00000 999.00000
+52.27306 185.97804
+52.22693 185.94250
+52.22443 185.85361
+52.20665 185.80499
+52.16943 185.85110
+52.13472 185.90610
+52.11444 185.87639
+52.11638 185.81110
+52.08943 185.78334
+52.10971 185.71777
+52.11139 185.65472
+52.10248 185.56471
+52.09415 185.61638
+52.04610 185.59444
+52.06471 185.54889
+52.07498 185.49834
+52.06555 185.48917
+52.04472 185.49722
+52.04193 185.45833
+52.02943 185.40610
+52.03526 185.32889
+52.02943 185.30556
+52.00305 185.27026
+52.02388 185.20250
+52.03777 185.11333
+52.02972 185.03027
+99.00000 999.00000
+52.05611 185.01222
+52.07277 185.06888
+52.10805 185.10083
+52.09943 185.13167
+52.09389 185.20444
+52.09138 185.25110
+52.10889 185.28693
+52.10248 185.36194
+52.11055 185.42334
+52.13222 185.44167
+52.14888 185.49001
+52.17360 185.44527
+52.18082 185.52110
+52.17499 185.59500
+52.21193 185.55333
+52.20389 185.64166
+52.20389 185.67610
+52.21416 185.72556
+52.25249 185.77472
+52.27777 185.70360
+52.31221 185.65500
+52.27666 185.63583
+52.29860 185.55888
+52.31221 185.60944
+52.34805 185.66083
+52.36972 185.71417
+52.39693 185.78110
+99.00000 999.00000
+52.12027 186.01833
+52.13361 186.10333
+52.11026 186.13638
+52.09222 186.18750
+52.12277 186.23584
+52.13332 186.32056
+52.13998 186.38971
+52.14305 186.44527
+52.11722 186.45805
+52.11139 186.53084
+52.11194 186.59193
+52.09776 186.64194
+52.10248 186.69667
+52.09610 186.78027
+52.09555 186.85333
+52.09332 186.91638
+52.07721 186.99500
+52.06860 186.90805
+52.05443 186.82277
+52.06248 186.75360
+52.05611 186.68250
+52.03027 186.61444
+52.03526 186.52193
+52.02943 186.47501
+52.05026 186.43527
+52.05415 186.35249
+52.06332 186.31555
+52.04639 186.23944
+52.03915 186.15610
+52.05666 186.07388
+52.08943 186.03917
+99.00000 999.00000
+52.08722 187.03555
+99.00000 999.00000
+52.36722 187.60167
+52.35056 187.68721
+52.31082 187.67694
+52.28581 187.60693
+52.27527 187.54805
+52.24722 187.48334
+52.24832 187.40109
+52.29166 187.38472
+52.32944 187.43250
+52.35638 187.49055
+52.38889 187.54889
+99.00000 999.00000
+52.52388 188.74971
+52.48721 188.79694
+52.45221 188.74583
+52.45915 188.68610
+52.51193 188.70583
+99.00000 999.00000
+52.67943 189.41527
+52.63914 189.43138
+52.59082 189.39444
+52.58943 189.31110
+52.56581 189.24167
+52.53860 189.19443
+52.57721 189.16138
+52.62639 189.18889
+52.65582 189.25000
+52.67972 189.31276
+52.69194 189.36861
+99.00000 999.00000
+52.76971 189.94110
+52.72638 189.91554
+52.72194 189.83026
+52.76443 189.82417
+52.78749 189.86693
+99.00000 999.00000
+52.83443 189.99361
+99.00000 999.00000
+52.82277 190.32249
+52.78165 190.29333
+52.79305 190.23860
+52.81139 190.15776
+52.80331 190.10667
+52.78581 190.03500
+99.00000 999.00000
+52.84999 190.02443
+52.84665 190.11000
+52.87389 190.16388
+52.87971 190.24306
+52.86555 190.31221
+99.00000 999.00000
+52.84082 190.96417
+52.81749 190.89667
+52.84581 190.94917
+99.00000 999.00000
+52.96664 191.31805
+52.94748 191.27361
+52.93889 191.21971
+52.90665 191.21500
+52.91110 191.16583
+52.88914 191.11084
+52.86638 191.03888
+52.88609 191.03110
+52.93498 191.05667
+52.95277 191.13138
+99.00000 999.00000
+53.11139 160.00722
+99.00000 999.00000
+53.12526 160.05222
+53.19556 160.03806
+53.26305 160.01582
+99.00000 999.00000
+53.00000 172.72331
+53.00526 172.80804
+99.00000 999.00000
+53.30832 191.96860
+53.28360 191.89806
+53.26138 191.82500
+53.24638 191.74167
+53.21332 191.68250
+53.17249 191.65416
+53.14665 191.62639
+53.11165 191.58417
+53.06526 191.54694
+53.04277 191.49026
+53.02582 191.41638
+99.00000 999.00000
+53.01277 191.14417
+53.04193 191.20416
+53.09082 191.23000
+53.13638 191.20860
+53.17888 191.23666
+53.20389 191.29388
+53.23277 191.33804
+53.27306 191.38805
+53.24609 191.45860
+53.27248 191.52777
+53.24971 191.58638
+53.27805 191.64583
+53.31110 191.62917
+53.33832 191.58501
+53.39110 191.60193
+53.43776 191.61444
+53.47360 191.66722
+53.50276 191.73193
+53.53305 191.79555
+53.54665 191.87666
+53.55472 191.96500
+99.00000 999.00000
+53.47276 192.19556
+53.43776 192.13860
+53.38582 192.14861
+53.35777 192.08888
+53.33305 192.01833
+99.00000 999.00000
+53.53389 192.03360
+53.51889 192.12526
+53.50665 192.20471
+99.00000 999.00000
+53.42694 192.94693
+53.41666 192.85834
+53.38805 192.79193
+53.36693 192.71693
+53.33055 192.68138
+53.33360 192.59584
+53.30305 192.54555
+53.26277 192.50110
+53.27193 192.43889
+53.25777 192.37721
+53.24306 192.33388
+53.27415 192.27167
+53.28806 192.19859
+53.31555 192.17334
+53.34749 192.23389
+53.37888 192.29584
+53.37860 192.35555
+53.37498 192.41110
+53.38693 192.44472
+53.37694 192.51277
+53.41611 192.50751
+53.42249 192.57584
+53.43832 192.61026
+53.40414 192.66972
+53.44331 192.67250
+53.47026 192.69693
+53.45915 192.78471
+53.47972 192.84000
+53.51971 192.81776
+53.50722 192.91888
+53.52443 192.99916
+53.52722 192.92000
+53.55556 192.86166
+53.59888 192.83888
+53.63138 192.89139
+53.59665 192.94611
+53.62054 192.97472
+99.00000 999.00000
+53.65749 192.94501
+53.69888 192.96359
+99.00000 999.00000
+53.75389 192.96111
+53.78831 192.90250
+53.82166 192.86806
+53.85944 192.85222
+53.90443 192.89751
+53.93665 192.95860
+99.00000 999.00000
+53.96222 193.74417
+53.91193 193.73389
+53.92249 193.78583
+53.87721 193.75110
+53.87109 193.67833
+53.84831 193.64333
+53.82832 193.57083
+53.79805 193.55167
+53.78499 193.47026
+53.76360 193.49443
+53.72581 193.43971
+53.68555 193.45000
+53.72276 193.50084
+53.70305 193.52972
+53.75082 193.56110
+53.73277 193.61833
+53.74860 193.62694
+53.77165 193.67943
+53.72472 193.70166
+53.68388 193.72638
+53.66582 193.64751
+53.65332 193.58972
+53.63527 193.52722
+53.62109 193.44943
+53.58305 193.48109
+53.59082 193.43193
+53.53860 193.40889
+53.57304 193.37193
+53.57359 193.34084
+53.52498 193.36526
+53.54721 193.29054
+53.50972 193.34193
+53.49193 193.31555
+53.52277 193.25221
+53.56360 193.21083
+53.51527 193.21111
+53.47360 193.25360
+53.45471 193.21222
+53.43776 193.17471
+53.47472 193.12193
+53.43889 193.07805
+53.44360 193.04555
+53.44582 193.01833
+99.00000 999.00000
+53.54111 193.02277
+99.00000 999.00000
+53.70665 193.01527
+53.70471 193.10555
+53.65776 193.13667
+53.65138 193.15610
+53.63193 193.19917
+53.67998 193.17999
+53.68665 193.22221
+53.71056 193.21860
+53.72081 193.28722
+53.73277 193.18666
+53.75331 193.10304
+53.76999 193.01833
+99.00000 999.00000
+53.96748 193.05693
+53.97055 193.13138
+53.98749 193.18443
+99.00000 999.00000
+53.97194 193.25583
+99.00000 999.00000
+53.99165 193.38472
+53.95248 193.39166
+53.90498 193.37193
+53.87305 193.38667
+53.84526 193.39751
+53.85027 193.43472
+53.88165 193.49722
+53.88527 193.54388
+53.93889 193.55693
+53.97722 193.59666
+53.97665 193.63638
+53.94360 193.66583
+53.97415 193.72722
+99.00000 999.00000
+53.80556 193.86972
+53.76860 193.86526
+53.75331 193.82527
+53.72360 193.77693
+53.72194 193.75084
+53.76138 193.70360
+53.78249 193.73222
+53.80276 193.76750
+53.80249 193.78833
+53.83081 193.82944
+53.84888 193.89000
+99.00000 999.00000
+54.14943 160.02472
+54.20415 160.10222
+54.23831 160.20694
+54.28806 160.30582
+54.34389 160.37749
+54.39638 160.46860
+54.44859 160.56027
+54.49748 160.67139
+54.53389 160.76915
+54.56444 160.89972
+99.00000 999.00000
+54.58443 161.02722
+54.58859 161.14806
+54.54277 161.21582
+54.49332 161.29555
+54.50276 161.41777
+54.50998 161.53888
+54.51305 161.65443
+54.51999 161.75943
+54.58026 161.80331
+54.63026 161.90555
+54.68248 161.99306
+99.00000 999.00000
+54.71388 162.03860
+54.76776 162.11777
+54.83305 162.13443
+54.88306 162.10027
+54.94859 162.04082
+99.00000 999.00000
+54.97581 166.17360
+54.91777 166.24664
+54.86388 166.31998
+54.83139 166.39777
+54.81749 166.49777
+54.75888 166.52859
+54.70915 166.61388
+54.70332 166.64610
+54.77165 166.65332
+54.84305 166.64581
+54.90694 166.57944
+54.94139 166.48109
+54.99664 166.39638
+99.00000 999.00000
+54.80666 167.45749
+54.75916 167.54639
+54.71944 167.64139
+54.66527 167.72748
+54.64194 167.83276
+54.59665 167.92249
+54.57582 167.99777
+54.64415 167.92444
+54.68889 167.83665
+54.73389 167.74664
+54.78139 167.66527
+54.80222 167.55804
+54.85472 167.51944
+99.00000 999.00000
+54.54166 168.00499
+54.50000 168.09694
+54.54776 168.05055
+99.00000 999.00000
+54.00777 193.24083
+54.00806 193.33943
+54.03806 193.96860
+54.07332 193.93889
+54.10915 193.88583
+54.15332 193.90639
+54.18721 193.96001
+99.00000 999.00000
+54.10388 194.32834
+54.07664 194.26222
+54.07056 194.18527
+54.05249 194.13222
+54.04915 194.09389
+54.06555 194.02638
+99.00000 999.00000
+54.21582 194.03693
+54.20998 194.11806
+54.16611 194.14194
+54.17055 194.19360
+54.14526 194.25555
+54.12971 194.17722
+54.11916 194.26277
+54.12471 194.34305
+99.00000 999.00000
+54.05611 194.75444
+54.04082 194.69611
+54.07056 194.63943
+54.06860 194.54359
+54.08443 194.56667
+54.08443 194.65388
+54.07138 194.99083
+99.00000 999.00000
+54.06721 194.91306
+54.08055 194.84027
+54.10193 194.79193
+54.11806 194.85304
+54.12498 194.91167
+54.11331 194.98027
+99.00000 999.00000
+54.27805 194.49306
+54.24165 194.44417
+54.21359 194.48500
+54.20027 194.57472
+54.18056 194.55638
+54.15749 194.51360
+54.13664 194.45360
+54.11331 194.39888
+54.15109 194.38916
+54.19138 194.36555
+54.22331 194.42610
+54.23164 194.36472
+54.25916 194.33055
+54.29082 194.38527
+54.26971 194.42583
+99.00000 999.00000
+54.08110 195.04776
+99.00000 999.00000
+54.12444 195.02361
+54.12694 195.06084
+99.00000 999.00000
+54.61998 195.90500
+54.59915 195.80667
+54.57304 195.74527
+54.53806 195.68472
+54.48972 195.67305
+54.44943 195.62694
+54.41888 195.55417
+54.40971 195.45555
+54.39082 195.35472
+54.39722 195.26334
+54.40999 195.17917
+54.45221 195.12666
+54.49026 195.10083
+54.53915 195.06360
+54.59444 195.06000
+54.62109 195.14000
+54.63805 195.23750
+54.67221 195.30026
+54.71609 195.34027
+54.76082 195.37639
+54.80527 195.41138
+54.84888 195.44917
+54.89389 195.48277
+54.92444 195.55251
+54.91666 195.62971
+54.89055 195.70055
+54.88998 195.78943
+54.93138 195.80167
+54.96582 195.86417
+54.96889 195.95193
+99.00000 999.00000
+54.99193 196.86501
+54.96832 196.93860
+54.92305 196.93250
+54.89555 196.85249
+54.86055 196.79193
+54.83194 196.72084
+54.80943 196.64667
+54.85664 196.61417
+54.89055 196.67722
+54.92139 196.71500
+54.92972 196.64777
+54.96277 196.68694
+54.94998 196.75084
+54.98972 196.72000
+99.00000 999.00000
+54.95776 196.54805
+54.90332 196.58443
+54.84888 196.58417
+54.79610 196.62222
+54.75806 196.67917
+54.76138 196.77943
+54.76971 196.83943
+54.72665 196.89027
+54.68111 196.93610
+54.66055 196.89861
+54.67249 196.85001
+54.69638 196.84555
+54.68359 196.76666
+54.70305 196.69859
+54.75276 196.65944
+54.73471 196.57639
+54.67943 196.56943
+54.65305 196.50166
+54.62665 196.43388
+54.61276 196.35222
+54.62694 196.26889
+54.63306 196.17500
+54.62860 196.07056
+99.00000 999.00000
+54.97331 197.43027
+54.97472 197.39972
+99.00000 999.00000
+54.99306 197.29889
+54.94804 197.26443
+54.93472 197.17194
+54.94859 197.09084
+54.98639 197.03555
+99.00000 999.00000
+54.92776 197.76721
+54.87749 197.74609
+54.83415 197.70694
+54.85165 197.63609
+54.88860 197.57805
+54.93748 197.58749
+54.96889 197.65694
+54.97722 197.74026
+99.00000 999.00000
+54.40776 197.59193
+54.38026 197.62833
+54.37582 197.54860
+54.41498 197.52638
+99.00000 999.00000
+54.47472 197.29277
+54.45471 197.37000
+54.42915 197.43944
+54.37971 197.44611
+54.39082 197.35889
+54.36748 197.36888
+54.39055 197.29555
+54.41222 197.22026
+54.45110 197.16554
+54.49832 197.17360
+99.00000 999.00000
+54.96664 199.87389
+54.93111 199.82666
+54.88248 199.80000
+54.90138 199.75526
+54.93832 199.80667
+54.98277 199.83917
+99.00000 999.00000
+54.98305 200.65500
+54.94972 200.60083
+54.95831 200.55527
+54.97998 200.59193
+99.00000 999.00000
+54.92249 200.75861
+54.89665 200.77554
+54.86693 200.70500
+54.90749 200.67833
+54.93056 200.67027
+99.00000 999.00000
+55.05443 161.90831
+55.11693 161.84581
+55.17526 161.79388
+55.24915 161.76248
+55.32222 161.73526
+55.39331 161.71860
+55.46193 161.71748
+55.52943 161.72443
+55.59415 161.74554
+55.65665 161.77748
+55.71777 161.81831
+55.77332 161.89027
+55.83748 161.91388
+55.89861 161.95526
+99.00000 999.00000
+55.35722 165.97777
+55.32498 165.90721
+55.29805 165.77943
+55.27498 165.80832
+55.24472 165.91055
+55.20499 165.97221
+99.00000 999.00000
+55.31860 166.19832
+55.33556 166.08693
+99.00000 999.00000
+55.16998 166.02472
+55.09444 166.08415
+55.03415 166.11026
+99.00000 999.00000
+55.03194 166.38138
+55.09277 166.31471
+55.15860 166.24388
+55.23277 166.22276
+55.29082 166.27998
+99.00000 999.00000
+55.07138 196.99277
+55.10304 196.92722
+55.09277 196.83804
+55.12694 196.87971
+55.13110 196.80777
+55.08472 196.79222
+55.07304 196.76860
+55.03860 196.77943
+55.00026 196.83417
+99.00000 999.00000
+55.05556 196.70277
+55.10388 196.68694
+55.13416 196.70555
+55.16165 196.78722
+55.18414 196.88055
+55.21971 196.94026
+55.23277 196.98805
+55.19582 196.93277
+55.17471 196.97527
+99.00000 999.00000
+55.02943 196.06833
+55.03471 196.15889
+55.05527 196.24026
+55.04166 196.32555
+55.04831 196.43388
+55.02972 196.45277
+99.00000 999.00000
+55.42694 196.87250
+55.39806 196.82860
+55.43944 196.83611
+99.00000 999.00000
+55.22748 197.95583
+55.17555 197.98334
+99.00000 999.00000
+55.08472 197.97250
+55.08693 197.90138
+55.11998 197.88583
+55.16611 197.89999
+55.14194 197.81776
+55.09999 197.77554
+55.04831 197.80583
+55.01694 197.74083
+55.05693 197.68639
+55.03581 197.64500
+55.03831 197.54584
+55.07582 197.48833
+55.11832 197.50610
+55.09164 197.57666
+55.11081 197.61777
+55.14526 197.55667
+55.18860 197.50583
+55.24889 197.47693
+55.26971 197.40167
+55.29971 197.41472
+55.28360 197.32359
+55.24026 197.28471
+55.19331 197.30917
+55.16943 197.38306
+55.12389 197.40443
+55.10777 197.36722
+55.06165 197.36555
+55.04831 197.39693
+99.00000 999.00000
+55.00555 197.34334
+55.02859 197.38277
+55.03665 197.32193
+99.00000 999.00000
+55.00916 197.03389
+55.02443 197.05777
+55.24498 197.00221
+99.00000 999.00000
+55.17055 197.04750
+55.19443 197.13083
+55.23805 197.15971
+55.25581 197.10583
+55.27165 197.16527
+55.30331 197.21916
+55.31888 197.29083
+55.35222 197.34084
+55.35805 197.36693
+55.34109 197.44722
+55.37444 197.51193
+55.42805 197.49889
+55.43472 197.43304
+55.40472 197.38055
+55.44472 197.42110
+55.47777 197.48721
+55.51776 197.53526
+55.55638 197.58611
+55.59471 197.63860
+55.63026 197.69804
+55.67305 197.73944
+55.70415 197.81055
+55.73305 197.88750
+55.77165 197.93776
+99.00000 999.00000
+55.43805 198.99222
+55.40749 198.92055
+55.38222 198.83667
+55.35222 198.76277
+55.35832 198.67667
+55.37694 198.59776
+55.35777 198.51584
+55.39972 198.49693
+55.45082 198.51666
+55.50110 198.53917
+55.54222 198.58388
+55.57193 198.64000
+55.53471 198.69777
+55.52415 198.78917
+55.53305 198.86139
+55.54831 198.77583
+55.58276 198.71388
+55.60416 198.63609
+55.63361 198.56805
+55.62639 198.45860
+55.59805 198.39000
+55.55498 198.34943
+55.51805 198.29359
+55.47472 198.30472
+55.42194 198.28943
+55.37665 198.26944
+55.33638 198.22221
+55.29498 198.17805
+55.25806 198.12250
+55.21056 198.09389
+55.21915 198.08139
+55.15944 198.00917
+99.00000 999.00000
+55.10999 198.04193
+99.00000 999.00000
+55.80138 198.03943
+55.83582 198.10361
+55.87054 198.16554
+55.89777 198.24971
+55.90639 198.34250
+55.92665 198.43500
+55.94693 198.53416
+55.96527 198.63889
+55.98860 198.72943
+55.98277 198.74750
+55.95943 198.65666
+55.95055 198.70277
+55.94914 198.78972
+55.95805 198.86888
+55.93610 198.94360
+99.00000 999.00000
+55.12639 198.34389
+55.08998 198.31389
+55.06389 198.26971
+55.07359 198.20139
+55.11638 198.22556
+55.15054 198.19055
+55.09831 198.17667
+55.12776 198.11166
+55.16331 198.13443
+55.16527 198.22722
+99.00000 999.00000
+55.78581 199.99193
+55.75972 199.94501
+55.71664 199.95888
+55.70610 199.91777
+55.70943 199.87750
+55.70776 199.85583
+55.65721 199.84138
+55.66138 199.75333
+55.63443 199.69943
+55.64693 199.62860
+55.63277 199.57249
+55.60248 199.63472
+55.57166 199.57001
+55.53749 199.53667
+55.48639 199.51555
+55.49081 199.44972
+55.54582 199.41443
+55.60304 199.41167
+55.57111 199.37054
+55.54527 199.30804
+55.52972 199.23193
+55.51860 199.32056
+55.47081 199.33556
+55.45164 199.25693
+55.46111 199.17000
+55.50832 199.17084
+55.51555 199.07944
+55.47748 199.02693
+99.00000 999.00000
+55.96304 199.02472
+55.98526 199.09109
+55.96359 199.13609
+55.93694 199.10805
+55.92805 199.01416
+99.00000 999.00000
+55.87555 199.06055
+55.83556 199.05388
+55.79860 199.10443
+55.75331 199.15222
+55.71082 199.20389
+55.75055 199.22917
+55.71582 199.28860
+55.71443 199.32472
+55.75194 199.30276
+55.78331 199.23944
+55.84471 199.22667
+55.87831 199.23138
+55.85472 199.30750
+55.86194 199.40916
+55.85832 199.50000
+55.81471 199.52251
+55.80777 199.57721
+55.78139 199.64751
+55.76944 199.73833
+55.79915 199.70667
+55.83139 199.73584
+55.85332 199.71722
+55.87860 199.64360
+55.90248 199.56776
+55.92998 199.49693
+55.93805 199.43916
+55.98526 199.46388
+99.00000 999.00000
+55.43277 199.84500
+55.37498 199.84250
+55.40443 199.78334
+55.39806 199.71193
+55.42249 199.65889
+55.45915 199.71359
+55.44331 199.77527
+55.45332 199.84444
+99.00000 999.00000
+55.04805 199.99055
+55.01222 199.95084
+99.00000 999.00000
+55.02582 199.89417
+55.04915 199.85277
+55.06831 199.88138
+55.10138 199.82304
+55.11555 199.86026
+55.09831 199.93027
+55.14082 199.87889
+55.13582 199.93222
+55.10722 199.99417
+55.16081 199.96443
+55.19914 199.96138
+99.00000 999.00000
+55.33305 199.67276
+55.27388 199.67694
+55.25499 199.63583
+55.28444 199.57916
+55.29639 199.50417
+55.33276 199.50026
+55.34138 199.55722
+55.36165 199.62944
+99.00000 999.00000
+55.39943 199.31194
+55.35027 199.34416
+55.30859 199.30388
+55.32166 199.35609
+55.34277 199.39751
+55.38748 199.42500
+55.35027 199.46609
+55.31110 199.41611
+55.26164 199.45084
+55.22832 199.42751
+55.20139 199.49554
+55.17860 199.50444
+55.17471 199.46805
+55.13998 199.46805
+55.16055 199.42110
+55.15971 199.33638
+55.20499 199.32472
+55.18944 199.24554
+55.14389 199.21138
+55.13693 199.17583
+55.18805 199.17084
+55.23665 199.15694
+55.28943 199.14999
+55.34277 199.16499
+55.38416 199.20917
+55.40527 199.28610
+99.00000 999.00000
+55.90277 200.99167
+55.90831 200.94110
+55.91415 200.86194
+55.89027 200.79639
+55.87471 200.71056
+55.87831 200.66167
+55.84499 200.59750
+55.79305 200.58859
+55.81749 200.53305
+55.87222 200.52417
+55.89194 200.48833
+55.85555 200.45694
+55.79805 200.48776
+55.74332 200.47722
+55.69888 200.43971
+55.65027 200.44611
+55.61665 200.39084
+55.57193 200.36833
+55.56332 200.28000
+55.59694 200.30083
+55.60860 200.25861
+55.60388 200.34416
+55.64139 200.37250
+55.66165 200.29250
+55.69221 200.36026
+55.73055 200.32971
+55.77554 200.34610
+55.81749 200.37193
+55.84109 200.29584
+55.85056 200.20110
+55.82082 200.14500
+55.77998 200.10417
+55.81499 200.04305
+55.77554 200.02554
+99.00000 999.00000
+55.24277 200.14360
+55.21248 200.08972
+55.16472 200.08917
+55.14832 200.11638
+55.18304 200.16777
+55.13248 200.15666
+55.09776 200.10916
+55.12444 200.04889
+55.08472 200.03777
+55.06444 200.00305
+99.00000 999.00000
+55.18193 200.04834
+55.21138 200.06943
+55.25581 200.07222
+55.28581 200.12138
+99.00000 999.00000
+55.19998 200.45972
+55.16914 200.49527
+55.11638 200.47722
+55.05972 200.48555
+55.04248 200.47777
+55.08693 200.43027
+55.04527 200.40359
+55.04805 200.34610
+55.08777 200.38916
+55.12776 200.34888
+55.10498 200.41360
+55.14027 200.41333
+55.15749 200.42334
+55.18889 200.41777
+55.21555 200.45444
+99.00000 999.00000
+55.03471 200.62526
+99.00000 999.00000
+55.00777 200.57777
+55.01082 200.52306
+55.05249 200.54750
+55.05611 200.61777
+99.00000 999.00000
+55.96416 201.33388
+55.94998 201.26471
+55.98109 201.26360
+99.00000 999.00000
+55.95943 201.09471
+55.92027 201.06972
+99.00000 999.00000
+55.89139 201.19859
+55.85582 201.25861
+55.83498 201.26721
+55.85304 201.18555
+55.84305 201.12416
+55.80804 201.15443
+55.83194 201.08749
+55.87610 201.12360
+99.00000 999.00000
+55.86472 204.42694
+55.80722 204.44417
+55.77415 204.38805
+55.78331 204.30499
+55.82082 204.27110
+55.84888 204.32417
+55.89444 204.36139
+55.92082 204.42833
+99.00000 999.00000
+56.04111 162.03777
+56.10081 162.08611
+56.14915 162.19556
+56.18056 162.32664
+56.21527 162.45831
+56.24693 162.53331
+56.30582 162.53305
+56.35527 162.46304
+56.39915 162.40555
+56.42915 162.48999
+56.44081 162.59332
+56.48999 162.67915
+56.46832 162.79027
+56.42998 162.89276
+56.49138 162.92444
+56.54749 162.98526
+99.00000 999.00000
+56.40860 162.91972
+56.36972 162.81749
+56.33388 162.71971
+56.27306 162.67694
+56.23193 162.57889
+56.22249 162.58943
+56.16748 162.68056
+56.09915 162.75610
+56.05276 162.85165
+56.02998 162.96111
+99.00000 999.00000
+56.70665 162.93332
+56.74416 162.83832
+56.81943 162.78581
+56.88860 162.78194
+56.95305 162.80527
+99.00000 999.00000
+56.53638 163.01582
+56.52722 163.09749
+56.46777 163.06165
+99.00000 999.00000
+56.02248 163.04498
+56.08081 163.10165
+56.13222 163.18665
+56.17331 163.30498
+56.23610 163.33026
+56.30777 163.32166
+56.37610 163.32332
+56.44221 163.25638
+56.50610 163.25276
+56.57443 163.25415
+56.64748 163.21999
+56.71056 163.23555
+56.73610 163.15610
+56.73581 163.04332
+99.00000 999.00000
+56.60860 190.32666
+56.60638 190.43250
+56.60027 190.51889
+56.56915 190.47194
+56.53693 190.40889
+56.56389 190.33026
+56.58888 190.25583
+56.61806 190.23972
+99.00000 999.00000
+56.00638 199.43555
+56.04944 199.47667
+56.08916 199.52609
+56.14360 199.53917
+56.19055 199.57056
+56.23749 199.60193
+56.26999 199.63251
+56.30498 199.69360
+56.33722 199.76222
+56.37749 199.81084
+56.40889 199.88083
+56.43304 199.97055
+99.00000 999.00000
+56.46138 200.03638
+56.49971 200.09000
+56.53444 200.14943
+56.56276 200.22833
+56.58888 200.31166
+56.61110 200.40500
+56.63582 200.49167
+56.62610 200.46388
+56.61888 200.47833
+56.63498 200.57721
+56.66360 200.65388
+56.68304 200.73334
+56.69638 200.75610
+56.73138 200.77138
+56.76305 200.84138
+56.78915 200.92416
+56.82056 200.99193
+56.78831 200.98750
+99.00000 999.00000
+56.58139 201.95305
+56.55498 201.87776
+56.53221 201.91667
+56.49693 201.99805
+99.00000 999.00000
+56.50832 201.90305
+56.48831 201.84138
+56.46248 201.86583
+56.45581 201.77888
+56.46860 201.70221
+56.45694 201.63251
+56.42749 201.55833
+56.38416 201.50972
+56.34526 201.48639
+56.31638 201.41110
+56.28165 201.34972
+56.25276 201.40860
+56.26389 201.44833
+56.30777 201.46277
+56.33888 201.53276
+56.31471 201.57193
+56.30305 201.61055
+56.30888 201.68500
+56.29388 201.77417
+56.25555 201.75806
+56.23055 201.67444
+56.23193 201.60834
+56.20444 201.60722
+56.19722 201.68304
+56.17888 201.69472
+56.20499 201.77554
+56.23555 201.84666
+56.21664 201.83360
+56.18111 201.77722
+56.15805 201.71167
+56.13110 201.64250
+56.16193 201.61194
+56.14777 201.57666
+56.11693 201.56888
+56.06721 201.58777
+56.10472 201.55194
+56.08638 201.50667
+56.04305 201.51054
+56.04498 201.53722
+56.00943 201.58000
+56.02943 201.51109
+56.00665 201.46472
+56.03831 201.47084
+56.04443 201.45110
+56.06139 201.39999
+56.09972 201.39861
+56.13914 201.44638
+56.17276 201.49417
+56.19415 201.48416
+56.19388 201.38527
+56.17360 201.39861
+56.14943 201.40666
+56.11110 201.35277
+56.14806 201.32056
+56.10443 201.30222
+56.06610 201.34084
+56.04248 201.26500
+56.02609 201.34055
+99.00000 999.00000
+56.86249 201.06610
+56.89331 201.13805
+56.86194 201.07001
+56.82777 201.00667
+99.00000 999.00000
+56.81276 201.01917
+56.83055 201.07277
+56.79138 201.12917
+56.77777 201.21805
+56.78777 201.31917
+56.77554 201.35722
+56.83415 201.35083
+56.88193 201.30638
+56.94026 201.31250
+56.99722 201.31027
+99.00000 999.00000
+56.87471 202.95139
+56.82805 202.91667
+56.84389 202.84666
+56.82721 202.84250
+56.77832 202.83194
+56.78888 202.75221
+56.81972 202.68666
+56.85388 202.62555
+56.84943 202.54971
+56.80222 202.55583
+56.76332 202.59389
+56.75415 202.53305
+56.73860 202.46193
+56.72276 202.40277
+56.68639 202.43916
+56.67331 202.51471
+56.62526 202.53943
+56.61972 202.45055
+56.60999 202.34860
+56.64139 202.28305
+56.67831 202.22388
+56.65138 202.14693
+56.63416 202.06416
+56.60110 202.00388
+99.00000 999.00000
+56.57277 202.08388
+56.54749 202.15944
+56.49860 202.14999
+56.47194 202.09584
+56.49332 202.01500
+99.00000 999.00000
+56.58305 202.84055
+56.57693 202.94417
+99.00000 999.00000
+56.53943 202.98389
+56.54944 202.88834
+56.53221 202.81555
+56.52777 202.72166
+56.54472 202.69221
+56.58165 202.74834
+99.00000 999.00000
+56.97916 203.43359
+56.99498 203.34222
+99.00000 999.00000
+56.97026 203.21805
+56.92082 203.20471
+56.90610 203.15334
+56.95526 203.11250
+56.97527 203.03917
+56.92305 203.05305
+99.00000 999.00000
+56.55194 203.00888
+99.00000 999.00000
+56.74248 205.99110
+56.75389 205.92221
+56.75082 205.85388
+56.79721 205.89110
+56.84389 205.92860
+56.99889 205.96138
+99.00000 999.00000
+56.96332 205.90359
+56.99138 205.84250
+56.94498 205.82388
+56.92860 205.76694
+56.90166 205.74500
+56.90971 205.71500
+56.86581 205.71527
+56.87054 205.75110
+56.86081 205.69083
+56.91638 205.69026
+56.95110 205.62833
+56.97638 205.55110
+56.99638 205.46805
+99.00000 999.00000
+56.50082 205.90443
+56.52609 205.90054
+56.54639 205.95667
+99.00000 999.00000
+56.57915 205.93304
+56.57388 205.92250
+56.53831 205.90277
+56.51360 205.83722
+56.50082 205.74306
+56.52165 205.66000
+56.55748 205.66805
+56.59694 205.71944
+56.60443 205.81334
+56.60805 205.91499
+99.00000 999.00000
+56.54665 205.59721
+56.53806 205.56721
+56.54472 205.54388
+56.59222 205.54443
+56.57582 205.47417
+56.52748 205.50000
+56.49860 205.46388
+56.47360 205.38251
+56.43776 205.32388
+56.39832 205.27306
+56.42722 205.20750
+56.47499 205.24083
+56.51776 205.28500
+56.54944 205.35555
+56.58139 205.42250
+56.60304 205.50583
+99.00000 999.00000
+56.96222 206.41306
+56.93277 206.34305
+56.96555 206.31334
+56.90944 206.29527
+56.89027 206.22556
+56.87526 206.26750
+56.85582 206.28806
+56.83638 206.21138
+56.82056 206.15916
+56.78444 206.10027
+56.74582 206.04584
+99.00000 999.00000
+56.89276 206.02722
+56.92249 206.09917
+56.95415 206.16750
+56.99026 206.22667
+56.97249 206.16667
+56.99860 206.17027
+99.00000 999.00000
+56.96056 206.09250
+56.98277 206.03610
+99.00000 999.00000
+56.98805 206.69333
+99.00000 999.00000
+56.52805 206.10777
+56.50221 206.02859
+99.00000 999.00000
+56.55305 206.07167
+99.00000 999.00000
+57.96248 161.99609
+99.00000 999.00000
+57.03831 162.82639
+57.10999 162.80888
+57.18610 162.76639
+57.25806 162.75026
+57.32443 162.76248
+57.37332 162.76414
+57.42221 162.84831
+57.46777 162.95499
+99.00000 999.00000
+57.87805 162.93582
+57.91722 162.83110
+57.95581 162.72610
+57.95164 162.62305
+57.92165 162.51193
+57.86139 162.46498
+57.79248 162.46722
+57.72972 162.43443
+57.68472 162.34610
+57.74110 162.39276
+57.79388 162.40388
+57.80249 162.28082
+57.83722 162.17331
+57.88222 162.07693
+99.00000 999.00000
+57.51944 163.08888
+57.58165 163.12471
+57.62082 163.20526
+57.68694 163.21832
+57.74248 163.28389
+57.82082 163.22221
+57.83443 163.11472
+99.00000 999.00000
+57.16165 189.82472
+57.13498 189.74944
+57.11526 189.71722
+57.14444 189.70917
+57.14471 189.64610
+57.18111 189.58693
+57.20110 189.65610
+57.20888 189.73972
+57.22360 189.83360
+57.23831 189.89693
+99.00000 999.00000
+57.00806 201.31389
+57.05331 201.35110
+57.08748 201.38860
+57.12694 201.44026
+57.16638 201.49193
+57.20694 201.54083
+57.24638 201.59277
+57.28389 201.65027
+57.32027 201.70943
+57.34665 201.78389
+57.35805 201.88472
+57.37639 201.93167
+57.40805 201.94110
+99.00000 999.00000
+57.48138 202.04388
+57.50916 202.12360
+57.54082 202.19221
+57.56027 202.27167
+57.54498 202.31334
+57.49416 202.34360
+57.48222 202.38333
+57.47527 202.48610
+57.48277 202.54111
+57.51277 202.60638
+57.54971 202.60388
+57.53888 202.55110
+57.49332 202.57971
+57.50471 202.48389
+57.49361 202.40277
+57.54999 202.41499
+57.61026 202.40083
+57.62526 202.36555
+57.61555 202.30972
+57.67415 202.29305
+57.73332 202.29027
+57.77415 202.32001
+57.82693 202.34084
+57.87971 202.36194
+57.93805 202.37000
+57.99498 202.38083
+99.00000 999.00000
+57.55110 203.96834
+57.53305 203.93555
+57.51610 203.93971
+57.46832 203.95943
+57.43222 203.93359
+57.45860 203.86000
+57.47081 203.78500
+57.43332 203.73917
+57.40860 203.65443
+57.37193 203.59584
+57.33722 203.53583
+57.31581 203.45416
+57.27472 203.45667
+57.29555 203.55222
+57.30943 203.65027
+57.26944 203.65359
+57.24138 203.60138
+57.22055 203.58472
+57.18582 203.64305
+57.14194 203.63167
+57.12222 203.53917
+57.08331 203.54721
+57.08249 203.50194
+57.04388 203.45084
+57.06860 203.38805
+57.04944 203.36000
+57.01054 203.41638
+99.00000 999.00000
+57.03915 203.28722
+57.03749 203.20917
+99.00000 999.00000
+57.95471 204.93250
+57.92831 204.90138
+57.88609 204.92555
+57.86665 204.83667
+57.87831 204.75250
+57.83777 204.76610
+57.83582 204.67221
+57.79776 204.67555
+57.77722 204.67610
+57.73444 204.68889
+57.71805 204.60388
+57.75000 204.53583
+57.78027 204.46555
+57.78415 204.38361
+57.73138 204.36638
+57.68971 204.41167
+57.65639 204.35889
+57.64165 204.26250
+57.62193 204.26694
+57.56581 204.26334
+57.54359 204.21167
+57.58026 204.17999
+57.55222 204.10777
+57.53415 204.04305
+99.00000 999.00000
+57.03526 205.99249
+99.00000 999.00000
+57.00526 205.87000
+57.05026 205.90500
+57.08638 205.96417
+99.00000 999.00000
+57.12444 205.93584
+57.14499 205.85500
+57.15138 205.75833
+57.14806 205.66750
+57.12082 205.59000
+57.10971 205.51555
+57.05832 205.54610
+57.04915 205.63277
+57.09109 205.67943
+57.11832 205.75722
+57.11748 205.86722
+57.08055 205.89276
+57.02832 205.86722
+99.00000 999.00000
+57.01915 205.47388
+57.07860 205.48416
+57.13498 205.47333
+57.19443 205.45193
+57.24055 205.40805
+57.26527 205.33611
+57.27277 205.26277
+57.28806 205.21388
+57.32555 205.22917
+57.35915 205.21693
+57.33556 205.29527
+57.37360 205.28777
+57.42581 205.27834
+57.45471 205.35333
+57.50055 205.35638
+57.53389 205.41972
+57.51889 205.47917
+57.55443 205.47972
+57.56972 205.54054
+57.57472 205.56943
+57.60860 205.59833
+57.64526 205.65167
+57.65776 205.73721
+57.65665 205.82472
+57.65222 205.93555
+99.00000 999.00000
+57.55026 205.97139
+57.53665 205.91277
+99.00000 999.00000
+57.96915 206.82971
+57.94527 206.91333
+57.92415 206.99777
+99.00000 999.00000
+57.45305 206.97638
+57.43971 206.99277
+99.00000 999.00000
+57.31776 206.91943
+57.33415 206.84305
+57.31194 206.82472
+57.29111 206.89610
+57.29555 206.98860
+99.00000 999.00000
+57.21638 206.93304
+57.21999 206.83026
+57.22777 206.73972
+57.19138 206.68359
+57.20221 206.60777
+57.15860 206.60944
+57.11943 206.55638
+57.14943 206.52193
+57.17415 206.46249
+57.16306 206.49916
+57.11331 206.48389
+57.06305 206.49110
+57.08221 206.40359
+57.06276 206.32359
+57.04332 206.24110
+57.04527 206.33276
+57.03415 206.41472
+57.01694 206.34084
+57.00388 206.41251
+99.00000 999.00000
+57.00861 206.14139
+99.00000 999.00000
+57.02972 206.07249
+57.07359 206.11555
+57.10193 206.19083
+57.13081 206.26222
+57.14693 206.19110
+57.11276 206.12776
+57.07805 206.06471
+57.04332 206.00305
+99.00000 999.00000
+57.11665 206.01109
+99.00000 999.00000
+57.58665 206.01721
+57.54555 206.02167
+57.50581 206.07610
+57.44194 206.09084
+57.39389 206.13167
+57.35832 206.19276
+57.31305 206.23305
+57.28665 206.30943
+57.27805 206.36221
+57.30638 206.28833
+57.34888 206.23833
+57.39665 206.19749
+57.45721 206.18472
+57.51414 206.19250
+57.56139 206.15054
+57.56526 206.18584
+57.54166 206.26750
+57.55498 206.29944
+57.57639 206.21417
+57.61276 206.15388
+57.65388 206.13777
+57.64915 206.25110
+57.63443 206.34750
+57.60222 206.39555
+57.63443 206.39471
+57.66722 206.32860
+57.68860 206.24306
+57.70055 206.14166
+57.73109 206.07167
+57.79388 206.06721
+57.83556 206.11276
+57.86693 206.17500
+57.89722 206.24777
+57.88664 206.32777
+57.85332 206.35944
+57.82527 206.43443
+57.76555 206.44833
+57.70888 206.45027
+57.65027 206.47388
+57.64972 206.50221
+57.70415 206.47250
+57.69360 206.53250
+57.71971 206.53777
+57.75693 206.49805
+57.76721 206.57916
+57.71693 206.61638
+57.72581 206.68472
+57.76305 206.62610
+57.78915 206.55777
+57.83943 206.52083
+57.82664 206.60693
+57.80081 206.68527
+57.78831 206.78693
+57.73109 206.78693
+57.71527 206.81139
+57.77055 206.81027
+57.83748 206.80693
+57.88638 206.76750
+57.88638 206.82693
+57.84972 206.88693
+57.83139 206.95166
+57.86806 206.90860
+57.90555 206.85361
+57.94305 206.79472
+57.97110 206.71971
+99.00000 999.00000
+57.12526 206.98138
+57.09639 206.92305
+57.09277 206.85417
+57.06332 206.78110
+57.01248 206.77055
+99.00000 999.00000
+57.02998 206.68193
+57.06555 206.67888
+57.06139 206.63138
+57.08139 206.61417
+57.10832 206.64444
+57.12721 206.64027
+57.16582 206.69472
+57.20248 206.74583
+57.18555 206.79916
+57.15082 206.80611
+57.14861 206.82527
+57.17581 206.90250
+57.16415 206.97804
+99.00000 999.00000
+57.94859 206.59389
+57.92055 206.66888
+57.88971 206.73888
+57.84164 206.77943
+57.81499 206.75110
+57.83276 206.67334
+57.85832 206.63860
+57.88138 206.55388
+57.91582 206.49001
+57.95831 206.47667
+99.00000 999.00000
+57.99832 207.22833
+57.99693 207.13638
+99.00000 999.00000
+57.98694 207.05333
+99.00000 999.00000
+57.94666 207.01917
+57.93166 207.10944
+57.90665 207.19026
+57.87831 207.11388
+57.86415 207.12416
+57.81639 207.08804
+57.76889 207.07527
+57.72693 207.12360
+57.78082 207.14000
+57.84027 207.15193
+57.84999 207.22055
+57.83026 207.27750
+57.88055 207.30833
+57.85638 207.37971
+57.90860 207.36943
+57.92055 207.42139
+57.91026 207.49055
+57.87415 207.55251
+57.83804 207.56389
+57.82889 207.62109
+57.81415 207.67360
+57.78499 207.59972
+57.75471 207.52722
+57.71748 207.46971
+57.70277 207.48222
+57.71971 207.54639
+57.66888 207.52693
+57.66443 207.54388
+57.67749 207.59166
+57.62526 207.57083
+57.61972 207.60834
+57.62694 207.69501
+57.62389 207.78860
+57.60027 207.84360
+57.56165 207.78860
+57.52722 207.72556
+57.48526 207.67722
+57.42638 207.66333
+57.43527 207.56860
+57.43889 207.54027
+57.46277 207.50055
+57.44859 207.44804
+57.47610 207.39000
+57.47360 207.30472
+57.50943 207.25360
+57.50998 207.16417
+57.51277 207.07860
+57.50415 207.05110
+57.47832 207.06084
+99.00000 999.00000
+57.46193 207.02805
+57.47139 207.14166
+57.45499 207.23360
+57.42027 207.29610
+57.39526 207.37555
+57.35944 207.39861
+57.31776 207.36610
+57.27972 207.31055
+57.30693 207.26917
+57.27805 207.19667
+57.29193 207.14722
+57.31194 207.09888
+57.34277 207.10249
+57.33249 207.01193
+99.00000 999.00000
+57.25943 207.04610
+99.00000 999.00000
+57.12498 207.08722
+99.00000 999.00000
+57.17444 207.00999
+57.16165 207.09943
+99.00000 999.00000
+58.01639 161.95860
+58.08665 161.94611
+58.14972 161.97832
+99.00000 999.00000
+58.20581 162.00916
+58.26831 162.04388
+58.33276 162.06694
+58.39305 162.11360
+58.45581 162.14638
+58.51277 162.21472
+58.56915 162.28581
+58.62610 162.35443
+58.68527 162.41331
+58.73831 162.50388
+58.78194 162.61806
+58.82860 162.74748
+58.85332 162.77110
+58.85332 162.68138
+58.89027 162.74664
+58.93805 162.83527
+58.96416 162.91554
+58.93582 162.88943
+99.00000 999.00000
+58.52138 163.40414
+58.47777 163.46527
+58.53749 163.51443
+58.58582 163.60638
+58.63193 163.71832
+58.68414 163.81082
+58.72055 163.92998
+99.00000 999.00000
+58.95110 163.80943
+58.89276 163.74971
+58.82555 163.74222
+58.76360 163.70415
+58.70721 163.63527
+58.64722 163.58556
+58.59305 163.50305
+58.56055 163.38860
+99.00000 999.00000
+58.79054 164.09860
+58.81526 164.20581
+58.84332 164.30972
+58.86943 164.43138
+58.86972 164.56499
+58.90498 164.67998
+58.97748 164.66055
+99.00000 999.00000
+58.62082 197.94611
+58.63889 197.85916
+58.66026 197.88110
+58.67665 197.95694
+99.00000 999.00000
+58.84305 198.97084
+58.81389 198.88889
+58.79111 198.80943
+58.80249 198.71971
+58.79193 198.68694
+58.77998 198.77805
+58.76332 198.70055
+58.72638 198.64055
+58.67694 198.61417
+58.67471 198.67638
+58.64998 198.58305
+58.63055 198.47472
+58.60304 198.40138
+58.57527 198.32001
+58.55722 198.23666
+58.59915 198.28389
+58.64389 198.25110
+58.59277 198.23917
+58.62498 198.18916
+58.62555 198.07666
+99.00000 999.00000
+58.67722 198.02388
+58.64638 198.07750
+58.67665 198.15666
+58.72388 198.15222
+58.76027 198.21472
+58.76721 198.30611
+58.80888 198.33749
+58.81082 198.26027
+58.79831 198.23639
+58.84860 198.22026
+58.90694 198.20526
+58.96304 198.21249
+99.00000 999.00000
+58.56194 198.98167
+58.57443 198.91638
+58.62471 198.91722
+58.66859 198.86305
+58.67831 198.84776
+58.64943 198.91333
+58.69972 198.93694
+99.00000 999.00000
+58.88388 199.98860
+58.87971 199.90944
+58.87138 199.83693
+58.92110 199.82193
+58.90138 199.74722
+58.94415 199.72888
+58.96527 199.69026
+58.99722 199.73833
+99.00000 999.00000
+58.96860 199.38638
+58.93748 199.31000
+58.90388 199.24001
+58.86331 199.19000
+58.82748 199.16110
+58.87610 199.14806
+58.87665 199.04971
+99.00000 999.00000
+58.77748 199.28139
+58.73499 199.23584
+58.69026 199.19667
+58.64555 199.15750
+58.60110 199.11555
+58.56027 199.06610
+99.00000 999.00000
+58.73193 199.02693
+58.75082 199.13583
+58.78027 199.21609
+58.81165 199.29193
+99.00000 999.00000
+58.43665 200.93222
+58.44914 200.93694
+58.48109 200.90860
+58.51749 200.85249
+58.56805 200.80859
+58.60805 200.76054
+58.65610 200.71443
+58.70305 200.66554
+58.74805 200.61472
+58.78998 200.55750
+58.82277 200.48833
+58.83472 200.41693
+58.84972 200.35222
+58.89305 200.39638
+58.95248 200.37277
+58.93414 200.26639
+58.90665 200.24750
+58.85971 200.23833
+58.84360 200.17999
+58.79776 200.16777
+58.76971 200.09055
+58.81332 200.03638
+58.86693 200.01109
+99.00000 999.00000
+58.63055 201.94527
+58.60971 201.84526
+58.62082 201.75139
+58.64972 201.67526
+58.70444 201.66333
+58.75526 201.62167
+58.77888 201.53860
+58.80055 201.45305
+58.84305 201.45027
+58.88582 201.49583
+58.94360 201.50417
+58.97194 201.58000
+58.98360 201.52609
+99.00000 999.00000
+58.97665 201.88971
+58.93498 201.93584
+58.88889 201.95610
+58.89748 201.99554
+58.93193 201.96472
+58.98415 201.93472
+99.00000 999.00000
+58.97026 201.42917
+58.92555 201.38805
+58.89194 201.31917
+58.88498 201.24472
+58.93222 201.26193
+58.96609 201.22501
+58.99165 201.24916
+58.96582 201.18083
+58.92415 201.23444
+58.86777 201.22638
+58.81415 201.20667
+58.75722 201.20943
+58.72556 201.13916
+58.76915 201.13055
+58.80305 201.19501
+58.80165 201.11250
+58.77722 201.09776
+58.71915 201.09666
+58.66693 201.13693
+58.61026 201.17027
+58.56332 201.21805
+58.50388 201.24277
+58.47581 201.27609
+58.43527 201.22583
+58.41249 201.19722
+58.39693 201.09305
+58.41055 201.00360
+99.00000 999.00000
+58.04639 202.39055
+58.10388 202.39999
+58.14915 202.43333
+58.16306 202.50471
+58.18694 202.59500
+58.20888 202.67526
+58.19415 202.76860
+58.16638 202.84360
+58.19972 202.82889
+58.21498 202.73416
+58.23915 202.65584
+58.21498 202.56943
+58.23610 202.49944
+58.27888 202.45610
+58.32166 202.43610
+58.37694 202.44501
+58.42610 202.47527
+58.47527 202.50526
+58.51360 202.56166
+58.54111 202.64417
+58.58415 202.68916
+58.62222 202.74583
+58.65805 202.80859
+58.69139 202.87721
+58.70998 202.97527
+58.72943 202.93167
+58.78331 202.94167
+58.82388 202.99306
+58.87305 202.97388
+99.00000 999.00000
+58.95082 202.95750
+58.89777 202.93666
+58.86693 202.86166
+58.84360 202.77722
+58.82889 202.66193
+58.80138 202.57860
+58.78165 202.47638
+58.75471 202.39221
+58.73499 202.29277
+58.70860 202.20721
+58.68027 202.12471
+58.65665 202.03194
+99.00000 999.00000
+58.72638 203.02499
+58.73332 203.01443
+99.00000 999.00000
+58.91498 203.01584
+58.96165 203.05305
+58.99055 203.13388
+99.00000 999.00000
+58.98055 203.03583
+99.00000 999.00000
+58.00861 204.96222
+99.00000 999.00000
+58.48555 205.90305
+58.43414 205.91693
+58.39998 205.98250
+58.36081 205.95305
+58.35165 205.86110
+58.34526 205.81610
+58.32193 205.72749
+58.28915 205.66251
+58.25194 205.63971
+58.27055 205.72221
+58.29277 205.77693
+58.31276 205.84222
+58.27222 205.87971
+58.26054 205.77417
+58.24193 205.82860
+58.19859 205.81694
+58.19611 205.72221
+58.16331 205.74167
+58.12665 205.74889
+58.15332 205.67139
+58.11165 205.67027
+58.08943 205.64055
+58.12639 205.58777
+58.17555 205.54750
+58.17471 205.52167
+58.11722 205.53806
+58.09277 205.50221
+58.11998 205.42860
+58.09610 205.42776
+58.04915 205.44972
+58.02693 205.38388
+58.06860 205.34334
+58.04193 205.27026
+58.00221 205.21722
+58.02498 205.13638
+58.02914 205.04639
+99.00000 999.00000
+58.99138 206.42694
+58.99554 206.52499
+58.96443 206.59193
+58.93166 206.66055
+58.88527 206.69556
+58.86499 206.64722
+58.86331 206.74277
+58.84943 206.67776
+58.81721 206.62389
+58.76414 206.59888
+58.71860 206.55693
+58.69472 206.48555
+58.66472 206.41083
+58.62749 206.35138
+58.61139 206.24638
+58.61444 206.13916
+58.58498 206.11110
+58.53972 206.07916
+58.52277 206.04054
+58.49443 206.05167
+99.00000 999.00000
+58.04639 206.97443
+58.09055 206.93027
+58.11221 206.89333
+58.12193 206.82359
+58.16306 206.77055
+58.21165 206.80251
+58.20221 206.89055
+58.18915 206.98027
+99.00000 999.00000
+58.22276 206.98389
+58.25110 206.90834
+58.28998 206.93610
+99.00000 999.00000
+58.12831 206.75305
+58.09248 206.81471
+58.08498 206.90610
+58.03555 206.94417
+99.00000 999.00000
+58.00693 206.89751
+58.02666 206.80777
+58.06776 206.75471
+58.06694 206.72888
+58.04527 206.68417
+58.05249 206.59555
+58.08693 206.63222
+58.13055 206.67500
+99.00000 999.00000
+58.00055 206.74805
+99.00000 999.00000
+58.93443 207.81389
+58.91306 207.73138
+58.91914 207.64751
+58.95915 207.67139
+58.95164 207.75276
+58.94221 207.83859
+99.00000 999.00000
+58.55388 207.62917
+58.52361 207.57721
+58.48109 207.52916
+58.48415 207.44110
+58.51164 207.36417
+58.55194 207.35971
+58.57248 207.42917
+58.60138 207.50610
+58.62498 207.56084
+58.63138 207.64861
+99.00000 999.00000
+58.35472 207.90639
+58.30638 207.87027
+58.25000 207.85027
+58.25943 207.88222
+58.31110 207.91167
+58.27832 207.94360
+58.32388 207.98526
+99.00000 999.00000
+58.19998 207.95500
+58.15999 207.92610
+58.16138 207.85583
+58.18915 207.79694
+58.23776 207.77554
+58.25832 207.73389
+58.23471 207.67943
+58.19305 207.70305
+58.19693 207.63251
+58.15749 207.67027
+58.12776 207.72556
+58.10472 207.65944
+58.12193 207.58693
+58.12332 207.52193
+58.08943 207.46222
+58.12999 207.44360
+58.18860 207.43944
+58.18582 207.40443
+58.12694 207.40359
+58.07860 207.37360
+58.04971 207.29805
+58.07222 207.22749
+58.01860 207.24083
+99.00000 999.00000
+58.01414 207.07944
+58.18582 207.00139
+99.00000 999.00000
+58.16638 207.08472
+58.19693 207.04860
+99.00000 999.00000
+58.29111 207.04054
+58.28415 207.12054
+58.27609 207.22166
+58.28221 207.25000
+58.33360 207.23526
+58.35555 207.23888
+58.38248 207.16083
+58.40831 207.14693
+58.42526 207.23972
+58.44888 207.29167
+58.44693 207.32333
+58.47527 207.37860
+58.46332 207.43333
+58.44415 207.49249
+58.40971 207.51443
+58.36360 207.52055
+58.37526 207.57056
+58.32805 207.58693
+58.34776 207.62471
+58.39722 207.64751
+58.41498 207.68971
+58.39748 207.73639
+58.36305 207.74805
+58.36081 207.82001
+58.39581 207.88306
+58.36026 207.90889
+99.00000 999.00000
+58.00331 207.08417
+99.00000 999.00000
+58.31526 208.03555
+58.26999 208.03276
+58.22472 208.01721
+99.00000 999.00000
+58.20776 208.19638
+58.16666 208.14526
+58.20305 208.11194
+58.25110 208.13554
+58.25276 208.19917
+99.00000 999.00000
+59.68414 160.94527
+59.62776 160.86916
+59.59444 160.73999
+59.56581 160.59526
+59.53249 160.47443
+59.46832 160.45110
+59.40915 160.39360
+59.35193 160.32388
+59.32166 160.19832
+59.26582 160.11693
+59.21277 160.01860
+99.00000 999.00000
+59.95305 161.35416
+59.89555 161.28693
+59.83777 161.21971
+59.78415 161.13638
+59.74055 161.02972
+99.00000 999.00000
+59.05666 162.95860
+59.12805 162.87639
+59.16193 162.95139
+99.00000 999.00000
+59.15915 163.02055
+59.11249 163.08638
+59.06805 163.17749
+59.04776 163.18721
+59.11499 163.19582
+59.18138 163.12694
+59.21832 163.07056
+59.27998 163.11055
+59.28693 163.23027
+59.25943 163.24722
+59.25693 163.29388
+59.32222 163.31248
+59.38805 163.32889
+59.45248 163.25555
+59.50722 163.16331
+59.55194 163.18193
+59.58249 163.28555
+59.62305 163.38554
+59.69388 163.37054
+59.76389 163.36249
+59.82388 163.36026
+59.86499 163.46027
+59.90248 163.56194
+59.89027 163.69026
+59.94998 163.74193
+59.99306 163.75499
+59.98555 163.66193
+99.00000 999.00000
+59.03027 163.89693
+59.02554 163.76027
+59.01582 163.72998
+59.00331 163.86305
+99.00000 999.00000
+59.98444 164.14276
+59.96056 164.14526
+59.90721 164.07277
+59.86806 164.08388
+59.85999 164.18498
+59.91638 164.09831
+59.97165 164.17499
+59.98694 164.32304
+99.00000 999.00000
+59.94081 164.73471
+59.86444 164.77609
+59.79082 164.80081
+59.81332 164.89888
+99.00000 999.00000
+59.01332 164.69081
+59.08249 164.66888
+59.14915 164.61305
+59.20389 164.57832
+59.22276 164.49693
+59.17444 164.38306
+59.12138 164.29582
+59.08556 164.14276
+58.98334 163.98334
+99.00000 999.00000
+59.89194 165.06555
+59.94888 165.13165
+99.00000 999.00000
+59.93776 166.12248
+59.87109 166.10805
+59.81526 166.13777
+59.84222 166.29359
+59.89555 166.37860
+59.94998 166.45639
+99.00000 999.00000
+59.95639 170.16026
+59.90944 170.24889
+59.95082 170.37999
+99.00000 999.00000
+59.85193 193.94917
+59.84222 193.88693
+59.85971 193.79971
+59.83305 193.73805
+59.81972 193.83472
+59.79027 193.90721
+59.75471 193.86638
+59.77943 193.79388
+59.81526 193.72861
+59.83804 193.64444
+59.85361 193.54417
+59.85443 193.47417
+59.85971 193.37222
+59.88889 193.28943
+59.91666 193.20750
+59.94748 193.12917
+59.97499 193.04138
+99.00000 999.00000
+59.98222 194.38805
+59.98109 194.45444
+59.94443 194.43138
+59.91081 194.41110
+59.90138 194.31972
+59.92276 194.25722
+59.89638 194.19777
+59.87389 194.11333
+59.89806 194.02277
+59.86665 194.00888
+99.00000 999.00000
+59.82860 195.91750
+59.85971 195.84250
+59.91554 195.80000
+59.96388 195.81389
+59.98248 195.89693
+99.00000 999.00000
+59.88472 196.97276
+59.85805 196.87917
+59.84082 196.76360
+59.82166 196.64751
+59.81221 196.52193
+59.80110 196.40138
+59.79555 196.28943
+59.80026 196.18027
+59.80777 196.07417
+99.00000 999.00000
+59.18138 197.99834
+59.23972 197.96249
+59.28665 197.97556
+59.28389 197.96693
+59.23610 197.96916
+99.00000 999.00000
+59.84972 197.95221
+59.89861 197.90222
+59.95499 197.89806
+59.98749 197.82750
+99.00000 999.00000
+59.98305 197.42084
+59.98471 197.30583
+59.97415 197.26109
+59.93860 197.19417
+59.91777 197.08221
+99.00000 999.00000
+59.04472 198.16638
+59.02081 198.23027
+59.04860 198.31667
+59.07999 198.39500
+59.11610 198.41917
+59.13138 198.35693
+59.10971 198.25610
+59.11415 198.14722
+59.07414 198.12750
+59.07056 198.10167
+59.10805 198.05055
+59.15694 198.00194
+99.00000 999.00000
+59.26193 198.02943
+59.31665 198.03833
+59.37555 198.03777
+59.40414 198.10693
+59.42665 198.15639
+59.47276 198.19194
+59.48082 198.27277
+59.52110 198.25861
+59.56555 198.21388
+59.60971 198.15805
+59.66193 198.12555
+59.71138 198.09805
+59.76027 198.04860
+59.81415 198.00833
+99.00000 999.00000
+59.02943 199.69083
+59.05722 199.64194
+59.04277 199.55611
+59.01164 199.47943
+99.00000 999.00000
+59.01694 201.55556
+59.03610 201.64583
+59.01776 201.73776
+59.00415 201.83611
+99.00000 999.00000
+59.02832 201.87054
+59.04138 201.77361
+59.05582 201.67610
+59.07472 201.58527
+59.11026 201.52000
+59.15721 201.47166
+59.13943 201.45334
+59.09972 201.49834
+59.05972 201.55693
+59.03110 201.47527
+99.00000 999.00000
+59.01527 203.14888
+59.07138 203.14833
+59.11861 203.18443
+59.15138 203.22084
+59.11916 203.15750
+59.07222 203.12138
+59.01389 203.12109
+99.00000 999.00000
+59.40860 204.93721
+59.42665 204.84109
+59.41832 204.75194
+59.38609 204.67999
+59.36861 204.58833
+59.34055 204.50667
+59.31998 204.40750
+59.31860 204.29333
+59.32166 204.17667
+59.35027 204.10027
+59.41388 204.08083
+59.47693 204.07388
+59.52277 204.11444
+59.55527 204.18610
+59.59222 204.24777
+59.62415 204.32111
+59.62944 204.43304
+59.63416 204.54388
+59.63498 204.66611
+59.64471 204.78833
+59.66110 204.89194
+59.66582 204.99609
+99.00000 999.00000
+59.38388 205.93222
+59.37138 205.86221
+59.34665 205.94472
+59.33110 205.97084
+59.30388 205.88805
+59.25444 205.85527
+59.20860 205.87416
+59.17831 205.82167
+59.15639 205.77888
+59.12109 205.76334
+59.10472 205.82805
+59.06776 205.80194
+59.02388 205.84471
+59.05943 205.90584
+59.07805 205.98222
+99.00000 999.00000
+59.69943 205.93333
+59.67972 205.83221
+59.67139 205.72026
+59.66666 205.59444
+59.64165 205.50526
+59.61998 205.40916
+59.59332 205.35304
+59.56389 205.42917
+59.53444 205.44667
+59.55055 205.49722
+59.51360 205.43584
+59.53082 205.36166
+59.51332 205.26805
+59.49361 205.31139
+59.45749 205.37054
+59.49306 205.43472
+59.46805 205.46249
+59.43166 205.43222
+59.43889 205.32860
+59.44415 205.21167
+59.43498 205.09000
+99.00000 999.00000
+59.69165 205.08611
+59.73193 205.14000
+59.76831 205.20305
+59.77943 205.32167
+59.77443 205.42999
+59.79082 205.53555
+59.79082 205.65305
+59.80305 205.75667
+59.79860 205.85277
+59.76721 205.79250
+59.77306 205.87222
+59.77388 205.95943
+99.00000 999.00000
+59.88277 206.94611
+59.86665 206.84222
+59.84943 206.75110
+59.81526 206.74083
+59.81998 206.83305
+59.83165 206.92221
+59.79111 206.99944
+99.00000 999.00000
+59.73999 206.96860
+59.69859 206.91667
+59.66832 206.84888
+59.64305 206.76167
+59.67831 206.69833
+59.63165 206.68805
+59.64499 206.59444
+59.67749 206.61693
+59.72081 206.65889
+59.73831 206.62027
+59.77998 206.56555
+59.74944 206.54417
+59.69832 206.54834
+59.64777 206.51694
+59.63889 206.43639
+59.68555 206.39861
+59.66527 206.37776
+59.63777 206.29776
+59.62555 206.37666
+59.59109 206.43472
+59.55138 206.38193
+59.55249 206.27888
+59.54831 206.20221
+59.54332 206.14722
+59.52055 206.23500
+59.47415 206.28084
+59.43414 206.24193
+59.42749 206.13609
+59.39943 206.05859
+59.39638 206.00500
+99.00000 999.00000
+59.35582 206.04472
+99.00000 999.00000
+59.07027 206.05667
+59.05972 206.15944
+59.06110 206.23277
+59.05859 206.31694
+59.01498 206.36693
+99.00000 999.00000
+59.38664 206.63000
+59.34499 206.62750
+59.32944 206.53084
+59.34610 206.44583
+59.38860 206.49249
+59.40915 206.57527
+99.00000 999.00000
+59.76082 206.07027
+59.72665 206.00194
+99.00000 999.00000
+59.99081 207.34334
+59.94443 207.30194
+59.90694 207.24083
+59.87999 207.15555
+59.87831 207.05026
+99.00000 999.00000
+59.28471 208.97084
+59.28415 208.89833
+59.30666 208.80888
+59.29831 208.73277
+59.27805 208.82610
+59.24609 208.89693
+59.20888 208.85805
+59.21609 208.75999
+59.22139 208.68083
+59.25415 208.61360
+59.23776 208.53276
+59.21638 208.52167
+59.19998 208.45667
+59.18111 208.40805
+59.16832 208.36861
+59.16249 208.25388
+59.21638 208.24443
+59.20915 208.15750
+59.23639 208.10916
+59.26138 208.04889
+59.31139 208.01917
+59.35027 208.07721
+59.35332 208.18750
+59.38582 208.11693
+59.42360 208.13777
+59.44582 208.22972
+59.46582 208.29860
+59.47748 208.39667
+59.47139 208.51443
+59.44221 208.59109
+59.46832 208.61444
+59.50499 208.55055
+59.54332 208.61110
+59.55777 208.70526
+59.59639 208.76083
+59.61276 208.82111
+59.65443 208.83055
+59.69443 208.88609
+59.73776 208.93500
+59.78722 208.99889
+99.00000 999.00000
+59.77972 208.90639
+59.75249 208.82443
+59.72165 208.74916
+59.69110 208.67444
+59.66554 208.58859
+59.62944 208.52777
+59.60555 208.58276
+59.63416 208.50444
+59.64998 208.40193
+59.66914 208.30611
+59.68999 208.22749
+59.72305 208.15776
+59.77306 208.11943
+59.82111 208.15776
+59.87610 208.18193
+59.92305 208.22333
+59.97443 208.25471
+99.00000 999.00000
+59.63165 209.99167
+59.67027 209.94972
+59.69498 209.87083
+59.64581 209.90639
+59.59332 209.91055
+59.57693 209.84000
+59.56055 209.80222
+59.52859 209.79027
+59.50249 209.75276
+59.47804 209.69360
+59.47638 209.62054
+59.50444 209.65694
+59.54665 209.65359
+59.58415 209.71417
+59.63277 209.73694
+59.68193 209.76083
+59.71443 209.76054
+59.67221 209.70805
+59.62305 209.67055
+59.57915 209.62222
+59.53139 209.58221
+59.48694 209.53555
+59.48415 209.50305
+59.52138 209.44722
+59.56805 209.48694
+59.59776 209.47305
+59.56360 209.40584
+59.53806 209.36444
+59.49748 209.41917
+59.46248 209.37277
+59.42776 209.38554
+59.42165 209.27777
+59.37444 209.23584
+59.34526 209.15834
+59.31749 209.07860
+59.27277 209.11194
+59.23915 209.06055
+59.20610 209.03751
+99.00000 999.00000
+59.77222 209.00333
+99.00000 999.00000
+59.42055 209.68860
+59.43555 209.62639
+59.39861 209.56776
+59.44693 209.59000
+59.46027 209.68555
+99.00000 999.00000
+59.35332 209.37750
+59.31444 209.32027
+59.31915 209.23167
+59.35971 209.26971
+59.40555 209.31305
+59.38081 209.39027
+99.00000 999.00000
+59.98248 210.96971
+59.97194 210.89555
+99.00000 999.00000
+59.97748 210.79834
+59.93193 210.76305
+59.89110 210.74306
+59.89139 210.71027
+59.95332 210.70193
+59.99915 210.68805
+99.00000 999.00000
+59.96359 210.55583
+59.92915 210.51555
+59.90694 210.43860
+59.85722 210.40250
+59.81165 210.38417
+59.78360 210.45055
+59.73972 210.46916
+59.72916 210.43359
+59.75499 210.38750
+59.77972 210.35527
+59.82664 210.33527
+59.88472 210.35638
+59.93582 210.32805
+59.95639 210.26277
+59.89638 210.26750
+59.84055 210.24527
+59.85498 210.17305
+59.82222 210.17027
+59.78471 210.23138
+59.72748 210.25000
+59.66554 210.25638
+59.68332 210.19388
+59.72360 210.14943
+59.76443 210.09500
+59.78693 210.00667
+99.00000 999.00000
+59.72360 210.04750
+59.68555 210.06084
+59.64389 210.00806
+99.00000 999.00000
+59.96443 211.57472
+59.97499 211.53250
+99.00000 999.00000
+59.97888 211.44250
+59.94360 211.42027
+59.92526 211.33749
+59.95027 211.30556
+59.95665 211.21277
+59.93414 211.12971
+59.97331 211.07083
+99.00000 999.00000
+59.94859 211.98193
+59.98332 211.98250
+99.00000 999.00000
+59.97472 211.92166
+59.94249 211.85001
+59.94556 211.77499
+59.97165 211.79971
+59.99110 211.82111
+59.98138 211.89055
+99.00000 999.00000
+59.99889 212.63361
+99.00000 999.00000
+59.97221 212.60138
+59.94638 212.51971
+59.90498 212.55499
+59.85860 212.50888
+59.86388 212.40971
+59.83305 212.34055
+59.81276 212.26277
+59.78888 212.18083
+59.78665 212.09471
+59.83638 212.10193
+59.86998 212.17110
+59.89389 212.25888
+59.91582 212.19859
+59.95471 212.25610
+59.97998 212.32500
+99.00000 999.00000
+59.98193 212.09222
+59.95581 212.00833
+99.00000 999.00000
+59.96832 215.70500
+59.93527 215.63333
+59.89748 215.57056
+59.86110 215.50555
+59.82277 215.44443
+59.82721 215.41917
+59.87526 215.46417
+59.90999 215.53276
+59.94832 215.59416
+59.98389 215.66083
+99.00000 999.00000
+59.79610 218.94722
+59.81665 218.84277
+59.84277 218.75194
+59.86331 218.64722
+59.88498 218.54555
+59.92305 218.57472
+59.89082 218.55388
+59.91306 218.63417
+59.93639 218.71750
+59.99582 218.74306
+99.00000 999.00000
+59.97777 218.43027
+59.95972 218.33443
+59.96359 218.23750
+59.99582 218.16277
+99.00000 999.00000
+59.76332 219.93083
+59.73944 219.84666
+59.71082 219.76944
+59.69972 219.66583
+59.70110 219.54417
+59.70998 219.44110
+59.72026 219.31500
+59.73721 219.20027
+59.75610 219.09694
+59.78165 219.00500
+99.00000 999.00000
+60.96582 160.34999
+60.91193 160.32056
+60.89276 160.24138
+60.85388 160.19110
+60.79082 160.21748
+60.72581 160.20972
+60.68915 160.13582
+60.62305 160.13609
+60.60056 160.19998
+60.65665 160.27943
+60.70389 160.35248
+60.75526 160.40776
+60.71555 160.45888
+60.75415 160.57138
+60.75555 160.62749
+60.74805 160.73639
+60.76831 160.80138
+60.83026 160.84138
+60.89082 160.88943
+60.93193 160.98694
+99.00000 999.00000
+60.42276 161.91443
+60.35832 161.89276
+60.32664 161.90305
+60.26831 161.92943
+60.21027 161.86555
+60.15610 161.77693
+60.11081 161.65610
+60.06776 161.54776
+60.02914 161.44527
+99.00000 999.00000
+60.77888 162.95415
+60.73499 162.86055
+60.67831 162.78915
+60.63306 162.69777
+60.61610 162.56444
+60.59193 162.45972
+60.54749 162.35332
+60.53139 162.20444
+60.47777 162.11194
+99.00000 999.00000
+60.99443 163.52998
+99.00000 999.00000
+60.96138 163.64777
+60.92276 163.73915
+60.86722 163.66914
+60.86526 163.53305
+60.82664 163.38554
+60.76944 163.31831
+60.71944 163.31055
+60.77609 163.29054
+60.81332 163.24609
+60.79639 163.12277
+60.76360 163.05556
+99.00000 999.00000
+60.04027 163.62665
+60.04665 163.75722
+60.04472 163.86581
+60.03444 163.91638
+99.00000 999.00000
+60.02165 164.35304
+60.09055 164.32138
+60.10165 164.39832
+60.09444 164.52554
+60.02582 164.61331
+99.00000 999.00000
+60.00276 165.19276
+99.00000 999.00000
+60.06555 165.13638
+60.06860 165.04999
+60.12471 165.00777
+60.12444 165.11555
+60.15665 165.18915
+60.09943 165.17749
+60.12665 165.27805
+60.17194 165.40860
+60.23749 165.43082
+60.21359 165.48555
+60.24277 165.62721
+60.28638 165.76582
+60.33943 165.85361
+60.38055 165.99693
+60.38193 165.94472
+99.00000 999.00000
+60.38609 166.00388
+99.00000 999.00000
+60.43332 166.09915
+60.44331 166.17165
+60.41306 166.03027
+99.00000 999.00000
+60.44972 166.06389
+60.48082 166.22305
+60.48109 166.33888
+60.45555 166.34972
+60.39444 166.32777
+60.37639 166.25055
+60.30388 166.26749
+60.23415 166.27527
+60.16914 166.25888
+60.11610 166.17360
+60.05055 166.14998
+99.00000 999.00000
+60.01360 166.55859
+60.06915 166.63193
+60.12415 166.70998
+60.17805 166.79138
+60.23305 166.86555
+60.28331 166.90831
+60.31444 166.99193
+99.00000 999.00000
+60.35277 167.04498
+60.42638 167.02498
+60.38193 167.10222
+60.35443 167.22139
+60.40332 167.29166
+60.40639 167.37610
+60.46693 167.35165
+60.42276 167.45471
+60.44472 167.50638
+60.45831 167.64806
+60.49138 167.76889
+60.53915 167.78276
+60.51971 167.90027
+99.00000 999.00000
+60.54944 168.03055
+60.57777 168.17415
+60.59526 168.32889
+60.59526 168.47221
+60.56665 168.59055
+60.55638 168.70776
+60.55998 168.84555
+60.56194 168.99055
+99.00000 999.00000
+60.56139 169.11943
+60.58276 169.15222
+60.61777 169.22055
+60.59193 169.34164
+60.56194 169.29359
+60.53471 169.31555
+60.49582 169.42471
+60.46138 169.53777
+60.42972 169.64471
+60.37415 169.71277
+60.30360 169.73610
+60.24748 169.81165
+60.24527 169.92415
+60.22055 169.90776
+60.17499 169.84444
+60.10443 169.91277
+60.05110 169.99332
+99.00000 999.00000
+60.02248 170.09581
+99.00000 999.00000
+60.03998 170.43056
+60.10748 170.44611
+60.17581 170.45943
+60.24193 170.48222
+60.29388 170.56721
+60.34109 170.66388
+60.38693 170.61971
+60.42888 170.53415
+60.44415 170.60609
+60.42722 170.70581
+60.47610 170.78610
+60.50832 170.73776
+60.50638 170.82860
+60.52332 170.98665
+99.00000 999.00000
+60.55972 171.09055
+60.56082 171.18304
+60.60472 171.29749
+60.65889 171.36665
+60.72081 171.40831
+60.77554 171.41972
+60.71748 171.46664
+60.70444 171.44832
+60.72916 171.57748
+60.78360 171.59332
+60.79889 171.59193
+60.83665 171.70193
+60.83249 171.79082
+60.84305 171.93056
+60.90277 171.93915
+60.93971 171.98444
+99.00000 999.00000
+60.90971 172.00806
+99.00000 999.00000
+60.86610 172.07138
+60.92915 172.10971
+60.96664 172.20055
+99.00000 999.00000
+60.49277 186.96277
+60.52888 186.96472
+60.56639 186.99583
+99.00000 999.00000
+60.53972 187.08833
+60.49582 187.13583
+60.46527 187.21359
+60.43665 187.29555
+60.41138 187.38472
+60.38832 187.47972
+60.39722 187.59027
+60.36581 187.66611
+60.33305 187.73860
+60.30693 187.76471
+60.32693 187.68666
+60.34082 187.58000
+60.33139 187.46527
+60.33722 187.37000
+60.36526 187.28693
+60.40222 187.22417
+60.43414 187.14917
+60.46304 187.06860
+99.00000 999.00000
+60.57693 187.01639
+60.59915 187.08693
+99.00000 999.00000
+60.01721 192.83305
+60.05556 192.77251
+60.06610 192.73666
+60.10138 192.68222
+60.14748 192.64722
+60.18555 192.58804
+60.20581 192.58360
+60.22665 192.67526
+60.22276 192.76750
+60.22527 192.86693
+60.21971 192.94917
+99.00000 999.00000
+60.39027 193.89861
+60.34526 193.93971
+99.00000 999.00000
+60.21304 193.06972
+60.20471 193.16083
+60.24971 193.20694
+60.29111 193.22417
+60.31943 193.30360
+60.31221 193.39777
+60.35361 193.43500
+60.37582 193.50888
+60.37248 193.59471
+60.34749 193.62776
+60.37999 193.70055
+60.39221 193.79971
+60.38416 193.86305
+60.43027 193.85193
+99.00000 999.00000
+60.31998 194.03110
+60.34138 194.11084
+60.33388 194.21193
+60.31221 194.29500
+60.28331 194.31360
+60.23999 194.28305
+60.19777 194.31166
+60.15944 194.28416
+60.12639 194.32527
+60.07721 194.29443
+60.05415 194.33305
+60.01610 194.36972
+99.00000 999.00000
+60.36916 194.95305
+60.41360 194.89389
+60.44722 194.88361
+60.46999 194.97972
+99.00000 999.00000
+60.54610 194.95972
+60.51944 194.86084
+60.49722 194.76277
+60.50943 194.66251
+60.54054 194.58611
+60.57999 194.62416
+60.59138 194.72917
+60.62471 194.80638
+60.65665 194.88443
+60.68999 194.95776
+99.00000 999.00000
+60.76805 194.97388
+99.00000 999.00000
+60.90999 194.96277
+60.92139 194.86472
+60.96638 194.80527
+99.00000 999.00000
+60.00249 195.88834
+99.00000 999.00000
+60.02609 195.80222
+60.04971 195.71750
+60.07555 195.63583
+60.10805 195.56221
+60.15472 195.50888
+60.19556 195.47638
+60.22556 195.39806
+60.26610 195.33693
+60.30611 195.32584
+60.32111 195.32889
+60.29027 195.24667
+60.30722 195.15250
+60.32610 195.06139
+99.00000 999.00000
+60.50888 195.02000
+99.00000 999.00000
+60.71248 195.01027
+99.00000 999.00000
+60.79831 195.03444
+60.82944 195.11917
+60.87332 195.09138
+60.91611 195.04359
+60.89722 195.10609
+60.86972 195.18555
+60.90414 195.25888
+60.90138 195.36861
+60.86081 195.31526
+60.81998 195.34416
+60.81749 195.45639
+60.80859 195.55527
+60.79166 195.64638
+60.77277 195.73694
+60.73055 195.76584
+60.68443 195.77805
+60.65776 195.67943
+60.61665 195.63943
+60.57889 195.59222
+60.55556 195.60417
+60.59471 195.66222
+60.63527 195.71555
+60.65222 195.80360
+60.68056 195.88834
+60.72861 195.91888
+60.76471 195.98610
+99.00000 999.00000
+60.85915 195.90971
+60.86777 195.80499
+60.86110 195.69000
+60.86444 195.57610
+60.85081 195.44250
+60.89055 195.41693
+60.92888 195.36305
+60.92499 195.25777
+60.90305 195.18443
+60.94888 195.13083
+60.94276 195.02388
+99.00000 999.00000
+60.78027 196.04222
+60.77026 196.14722
+60.72722 196.19583
+60.67998 196.17055
+60.63693 196.16499
+60.58139 196.20055
+60.58527 196.31860
+60.61499 196.40584
+60.64943 196.47804
+60.68277 196.55417
+60.73248 196.56444
+60.74664 196.57417
+60.77277 196.52888
+60.80556 196.45471
+60.82472 196.36166
+60.84222 196.26666
+60.84694 196.15388
+60.85777 196.09027
+60.88388 196.18944
+60.86499 196.28276
+60.87889 196.40027
+60.91249 196.42471
+60.92276 196.33388
+60.93860 196.24055
+60.96416 196.30167
+60.99110 196.28555
+60.97110 196.19888
+60.93748 196.14751
+60.89693 196.09305
+60.85555 196.04222
+99.00000 999.00000
+60.02748 197.78888
+60.08415 197.76360
+60.12971 197.80083
+60.18027 197.76944
+60.20082 197.81221
+60.23694 197.82944
+60.23055 197.80360
+60.21527 197.73500
+60.23109 197.70389
+60.19055 197.70943
+60.15166 197.70721
+60.14082 197.64972
+60.18971 197.65639
+60.23944 197.63750
+60.27527 197.56750
+60.30998 197.56110
+60.34526 197.62917
+60.39165 197.66499
+60.44221 197.68805
+60.48526 197.73389
+60.52722 197.77333
+60.57527 197.77888
+60.61026 197.84943
+60.64276 197.92805
+99.00000 999.00000
+60.67581 197.96971
+60.67638 197.92250
+60.71582 197.86055
+60.71222 197.83638
+60.67027 197.88499
+60.63693 197.81667
+60.60805 197.72804
+60.55582 197.70972
+60.50916 197.67526
+60.46609 197.62944
+60.42972 197.58139
+60.38693 197.58360
+60.37860 197.53888
+60.36610 197.49443
+60.33081 197.44333
+60.32056 197.40054
+60.29443 197.41917
+60.25388 197.43639
+60.26360 197.33417
+60.24361 197.35609
+60.22832 197.45334
+60.20139 197.53389
+60.15332 197.53139
+60.10388 197.50833
+60.04776 197.52306
+60.00026 197.49083
+99.00000 999.00000
+60.65665 198.05804
+60.69139 198.10027
+60.70139 198.04971
+99.00000 999.00000
+60.30611 206.96193
+60.27306 206.89027
+60.29166 206.96472
+99.00000 999.00000
+60.67165 207.95110
+60.62749 207.91333
+60.59389 207.85417
+60.56055 207.78250
+60.51999 207.71834
+60.47888 207.66417
+60.42165 207.67917
+60.39389 207.75751
+60.36722 207.67194
+60.33194 207.60527
+60.28665 207.56027
+60.26389 207.46638
+60.22472 207.41138
+60.24416 207.33110
+60.23082 207.24249
+60.25139 207.15359
+60.25861 207.19583
+60.25055 207.11360
+60.30556 207.09639
+99.00000 999.00000
+60.29277 207.01167
+60.25581 207.06471
+60.21609 207.12083
+60.19498 207.21500
+60.16498 207.29222
+60.12498 207.32834
+60.09444 207.40388
+60.04388 207.41055
+60.00972 207.37360
+99.00000 999.00000
+60.03027 208.29167
+60.07304 208.34166
+60.10915 208.40721
+60.14555 208.47139
+60.18304 208.53305
+60.22581 208.58360
+60.27998 208.61026
+60.32777 208.61250
+60.37639 208.64500
+60.41638 208.70166
+60.47722 208.71472
+60.53915 208.72472
+60.58165 208.67000
+60.63805 208.64250
+60.68582 208.60001
+60.73305 208.60777
+60.75026 208.71359
+60.77832 208.79666
+60.78555 208.92416
+60.81749 208.99916
+99.00000 999.00000
+60.96999 208.40250
+60.93304 208.33804
+60.91638 208.25693
+60.87222 208.21304
+60.81749 208.20471
+60.77110 208.25221
+60.72331 208.28999
+60.73305 208.19693
+60.74306 208.13750
+60.71832 208.07277
+99.00000 999.00000
+60.84749 209.07834
+60.88055 209.15054
+60.91222 209.22583
+60.94472 209.30000
+60.97638 209.37555
+99.00000 999.00000
+60.95581 209.72888
+60.92998 209.81360
+60.91165 209.91667
+60.92665 209.99277
+99.00000 999.00000
+60.03444 210.94943
+60.05110 210.89221
+60.01471 210.82805
+99.00000 999.00000
+60.02026 210.68694
+60.06194 210.65889
+60.11581 210.63110
+60.08611 210.56471
+60.02609 210.57193
+99.00000 999.00000
+60.93359 210.03500
+60.95665 210.12833
+60.97026 210.21860
+60.95221 210.32304
+60.93694 210.41306
+60.92305 210.52167
+60.90831 210.62694
+60.89471 210.73526
+60.88193 210.85056
+60.85748 210.94139
+60.87498 210.96138
+60.91498 210.90359
+60.94666 210.82834
+60.93860 210.71083
+60.94249 210.62222
+60.97139 210.54083
+60.98749 210.43500
+99.00000 999.00000
+60.93359 211.98471
+60.96693 211.98277
+99.00000 999.00000
+60.98305 211.58221
+99.00000 999.00000
+60.97443 211.78943
+60.95555 211.71916
+60.95110 211.69501
+60.90527 211.71111
+60.84555 211.69360
+60.85472 211.60693
+60.81776 211.66554
+60.82832 211.59027
+60.83415 211.48776
+60.81888 211.38026
+60.78972 211.30026
+60.79971 211.39333
+60.80360 211.48222
+60.78998 211.53777
+60.77498 211.43027
+60.74222 211.35722
+60.69139 211.32584
+60.67360 211.34750
+60.70831 211.41611
+60.75055 211.46417
+60.75916 211.55167
+60.77138 211.62389
+60.73526 211.61501
+60.68304 211.60555
+60.64444 211.56860
+60.65166 211.60944
+60.69388 211.65222
+60.73555 211.70750
+60.76414 211.77083
+60.71138 211.74417
+60.66443 211.78777
+60.61194 211.78917
+60.57664 211.72139
+60.53444 211.66777
+60.55276 211.61000
+60.58139 211.54305
+60.55249 211.46359
+60.51971 211.39110
+60.48138 211.32971
+60.45360 211.34109
+60.48888 211.40916
+60.51414 211.46472
+60.54111 211.54834
+60.51776 211.62639
+60.49693 211.65889
+60.48639 211.69305
+60.45389 211.73027
+60.47221 211.78139
+60.52277 211.77859
+60.54721 211.82584
+60.49554 211.82584
+60.55110 211.85417
+60.59749 211.89999
+60.56860 211.95833
+60.54138 211.96222
+99.00000 999.00000
+60.40694 211.97777
+60.41611 211.90610
+60.40332 211.87889
+60.39777 211.84109
+60.35388 211.86360
+60.37389 211.78999
+60.34526 211.73444
+60.32498 211.78583
+60.28194 211.73360
+60.25555 211.66859
+60.28415 211.61084
+60.23831 211.64305
+60.20082 211.58026
+60.18610 211.61139
+60.21722 211.68750
+60.25165 211.75555
+60.23860 211.77834
+60.21664 211.79111
+60.17139 211.80222
+60.17665 211.82472
+60.22916 211.85805
+60.19748 211.89471
+60.15109 211.84805
+60.12138 211.77055
+60.14471 211.70721
+60.16972 211.67000
+60.11972 211.63306
+60.06110 211.62444
+60.02722 211.55833
+99.00000 999.00000
+60.00888 211.50526
+60.01248 211.46584
+99.00000 999.00000
+60.91498 211.99777
+99.00000 999.00000
+60.79166 211.90721
+60.83582 211.86777
+60.87665 211.91083
+60.91249 211.89333
+99.00000 999.00000
+60.75305 211.87000
+60.70665 211.87555
+60.66026 211.89250
+60.65749 211.83221
+60.69859 211.77693
+60.74388 211.80333
+60.75610 211.86166
+99.00000 999.00000
+60.28749 211.97610
+60.29831 211.88417
+60.33443 211.88472
+60.37248 211.94667
+99.00000 999.00000
+60.00471 211.97139
+99.00000 999.00000
+60.02914 211.97305
+99.00000 999.00000
+60.06027 211.94722
+60.03471 211.93193
+99.00000 999.00000
+60.01305 211.85805
+60.06110 211.90054
+60.09888 211.96193
+99.00000 999.00000
+60.15776 211.94611
+60.10527 211.91277
+60.05998 211.86777
+60.02554 211.79971
+60.02554 211.69556
+60.03665 211.78943
+60.04610 211.73639
+60.06360 211.76471
+60.08331 211.77000
+60.10527 211.75471
+60.13277 211.83583
+60.12526 211.89055
+60.16888 211.93027
+99.00000 999.00000
+60.99388 212.98138
+60.99055 212.95416
+99.00000 999.00000
+60.96805 212.85167
+60.95831 212.80000
+60.99055 212.75194
+60.97194 212.72777
+60.92555 212.73222
+60.90222 212.67110
+60.90915 212.62083
+60.91249 212.55750
+60.95998 212.59943
+60.97665 212.58667
+60.97610 212.54721
+99.00000 999.00000
+60.97194 212.51138
+60.91443 212.49138
+60.94139 212.46527
+60.99805 212.46249
+99.00000 999.00000
+60.95776 212.39305
+60.90305 212.39610
+60.85748 212.38860
+60.87831 212.32944
+60.88527 212.28055
+60.93498 212.28276
+60.92831 212.24417
+60.88971 212.22888
+60.86026 212.23360
+60.82166 212.21277
+60.84305 212.11444
+60.89389 212.08110
+60.92221 212.01805
+99.00000 999.00000
+60.51443 212.03583
+60.46971 212.00250
+60.45581 212.06416
+60.43166 212.00276
+99.00000 999.00000
+60.21582 212.95750
+60.18388 212.88443
+60.15414 212.80722
+60.11581 212.74609
+60.07472 212.69055
+60.03139 212.63889
+99.00000 999.00000
+60.01164 212.34500
+60.04027 212.42389
+60.07027 212.50026
+60.10081 212.57555
+60.14555 212.62471
+60.18277 212.66888
+60.22443 212.71111
+60.24165 212.80083
+60.28943 212.79111
+60.33249 212.81555
+60.36972 212.84250
+60.36499 212.90167
+60.34581 212.93472
+60.32332 212.96304
+60.28526 212.90138
+60.28722 212.96111
+99.00000 999.00000
+60.41306 212.31972
+60.38026 212.28276
+60.39139 212.37639
+60.34109 212.34084
+60.29332 212.30026
+60.24889 212.26109
+60.20526 212.27193
+60.16443 212.21527
+60.18915 212.16055
+60.23415 212.20917
+60.22888 212.12027
+60.26414 212.12526
+60.28943 212.11444
+60.30859 212.20721
+60.33638 212.21333
+60.33221 212.12416
+60.35056 212.18359
+60.37915 212.18277
+60.40665 212.21359
+60.41331 212.17667
+60.46582 212.21083
+60.44305 212.22749
+60.43222 212.27251
+60.48526 212.27888
+60.48944 212.31972
+60.47055 212.37526
+60.42749 212.38193
+99.00000 999.00000
+60.66138 212.63583
+60.66055 212.68056
+60.64415 212.61472
+60.62971 212.55055
+60.65776 212.54027
+60.67526 212.55276
+60.70415 212.57333
+99.00000 999.00000
+60.71609 212.13138
+60.68138 212.11360
+60.66888 212.05110
+60.71193 212.00055
+99.00000 999.00000
+60.71999 212.04443
+60.73082 212.05917
+60.73749 212.10609
+99.00000 999.00000
+60.87915 212.06471
+60.82971 212.08667
+60.82248 212.03833
+99.00000 999.00000
+60.35915 212.01917
+99.00000 999.00000
+60.04915 212.17610
+99.00000 999.00000
+60.00444 212.12917
+99.00000 999.00000
+60.03194 212.06360
+60.07056 212.12389
+60.05666 212.18193
+99.00000 999.00000
+60.09277 212.10472
+60.06943 212.01527
+99.00000 999.00000
+60.15305 212.03276
+60.12305 212.07359
+99.00000 999.00000
+60.67249 213.98000
+60.65166 213.90193
+60.63306 213.80305
+60.65999 213.74889
+60.69276 213.82138
+60.71971 213.90443
+60.74248 213.96638
+60.78415 213.97000
+60.76971 213.92194
+60.73831 213.84639
+60.76109 213.82111
+60.72610 213.75360
+60.75499 213.69250
+60.76360 213.67667
+60.72139 213.62109
+60.69221 213.54222
+60.69611 213.47110
+60.68944 213.37944
+60.72972 213.32610
+60.73639 213.36026
+60.76248 213.40805
+60.74748 213.48360
+60.76971 213.46638
+60.76999 213.56500
+60.78860 213.66527
+60.81110 213.75667
+60.82832 213.75999
+60.84581 213.83943
+60.84164 213.88971
+60.87389 213.81471
+60.87776 213.74472
+60.83498 213.69026
+60.81694 213.59805
+60.83498 213.58333
+60.81639 213.48416
+60.84999 213.42722
+60.82944 213.36861
+60.88055 213.37833
+60.87944 213.30777
+60.92610 213.26584
+60.96082 213.27083
+60.94194 213.34389
+60.94943 213.40250
+60.97081 213.30305
+99.00000 999.00000
+60.98027 213.13693
+60.94722 213.06471
+99.00000 999.00000
+60.98444 213.01860
+99.00000 999.00000
+60.48389 213.93750
+60.46915 213.83276
+60.45526 213.72667
+60.49416 213.67943
+60.51639 213.75722
+60.52222 213.86833
+60.53915 213.89526
+60.56027 213.98860
+99.00000 999.00000
+60.37888 213.82193
+60.34389 213.75417
+60.34499 213.66277
+60.31998 213.57666
+60.29138 213.49750
+60.25360 213.43527
+60.25388 213.36055
+60.29555 213.33443
+60.32414 213.41360
+60.35277 213.49554
+60.35999 213.45334
+60.36861 213.39055
+60.34471 213.38388
+60.35165 213.29721
+60.40222 213.29111
+60.44194 213.35083
+60.48109 213.41055
+60.46082 213.46693
+60.46304 213.56055
+60.46693 213.64583
+60.41472 213.63583
+60.41972 213.72943
+60.43527 213.83276
+60.41222 213.84555
+60.40248 213.87639
+99.00000 999.00000
+60.28305 213.05777
+60.23831 213.00806
+99.00000 999.00000
+60.30443 213.07777
+99.00000 999.00000
+60.50555 214.96417
+60.45805 214.91805
+60.41777 214.85889
+60.38277 214.79111
+60.35110 214.71722
+60.36388 214.60361
+60.39276 214.52138
+60.43388 214.47139
+60.45694 214.37584
+60.47194 214.27055
+60.45665 214.16667
+60.46527 214.06750
+60.48749 214.12193
+60.52138 214.19194
+60.55693 214.26054
+60.60081 214.31276
+60.64638 214.36221
+60.66722 214.33556
+60.63971 214.25194
+60.62164 214.15305
+60.64331 214.18250
+60.65027 214.13417
+60.69026 214.16472
+60.66693 214.10138
+60.62999 214.03667
+60.65999 214.03471
+60.70360 214.08501
+60.68056 214.00500
+99.00000 999.00000
+60.35277 214.88000
+60.30443 214.85860
+60.31526 214.76471
+60.34499 214.74110
+60.37360 214.82027
+60.40944 214.88693
+99.00000 999.00000
+60.56389 214.18750
+60.53638 214.10583
+60.51248 214.01776
+99.00000 999.00000
+60.57359 214.04359
+60.59193 214.11861
+60.60999 214.21722
+60.59665 214.22833
+99.00000 999.00000
+60.02832 215.99193
+99.00000 999.00000
+60.03221 215.87167
+60.02972 215.75417
+60.03249 215.86472
+60.03249 215.99138
+60.07111 215.94888
+60.10638 215.88193
+60.13832 215.80777
+60.15721 215.75026
+60.19249 215.81721
+60.19081 215.73389
+60.19556 215.62109
+60.17276 215.56055
+60.20776 215.52638
+60.18860 215.45972
+60.20082 215.37167
+60.21582 215.33972
+60.24748 215.33501
+60.28305 215.26889
+60.29027 215.19917
+60.29027 215.11194
+60.31776 215.07443
+60.36221 215.10638
+60.39915 215.12750
+60.43166 215.15083
+60.46915 215.20416
+60.47499 215.17583
+60.49165 215.12109
+60.53471 215.17276
+60.58804 215.18555
+60.62749 215.24638
+60.66972 215.25333
+60.65805 215.34109
+60.69998 215.38750
+60.70471 215.31667
+60.67415 215.24001
+60.63110 215.18527
+60.59055 215.12694
+60.55026 215.06750
+99.00000 999.00000
+60.00388 215.73860
+99.00000 999.00000
+60.07777 216.97305
+60.06526 216.86806
+60.06110 216.77750
+60.05832 216.65694
+60.05165 216.54250
+60.04054 216.43417
+60.03471 216.32249
+60.01971 216.22194
+99.00000 999.00000
+60.00777 216.03389
+99.00000 999.00000
+60.02972 217.95416
+60.04498 217.83611
+60.06110 217.72388
+60.06831 217.59555
+60.08498 217.48471
+60.10027 217.36777
+60.11055 217.24417
+60.09999 217.13667
+60.08611 217.03416
+99.00000 999.00000
+60.02832 218.73222
+60.06360 218.70833
+60.09277 218.64833
+60.13722 218.62109
+60.12222 218.52417
+60.07304 218.55167
+60.03831 218.62000
+60.00748 218.55527
+99.00000 999.00000
+60.01471 218.10110
+99.00000 999.00000
+61.83804 160.00055
+99.00000 999.00000
+61.88332 160.12444
+61.92526 160.25276
+61.93610 160.33943
+61.87749 160.34639
+61.81165 160.35027
+61.74860 160.34444
+61.69611 160.23610
+61.63609 160.23109
+61.56998 160.23360
+61.51776 160.14305
+61.47693 160.04805
+61.44249 160.07277
+61.38081 160.03055
+99.00000 999.00000
+61.03777 160.10361
+61.04639 160.24498
+61.05832 160.38277
+61.01305 160.38638
+99.00000 999.00000
+61.04831 161.19666
+61.08249 161.31749
+61.12888 161.41666
+61.18166 161.44443
+61.20110 161.54971
+61.24971 161.60609
+61.27138 161.64249
+61.31860 161.76305
+61.38081 161.80055
+61.37444 161.88693
+61.42194 161.90639
+61.39331 161.96138
+99.00000 999.00000
+61.44305 162.03665
+61.48694 162.11388
+61.53943 162.21416
+61.58943 162.28749
+61.62082 162.33998
+61.67444 162.41611
+61.65831 162.54831
+61.61139 162.65944
+61.61693 162.76332
+61.65749 162.65082
+61.70471 162.72331
+61.70888 162.86832
+61.65248 162.89806
+61.60498 162.88832
+61.56165 162.95555
+99.00000 999.00000
+61.79944 162.95110
+61.85416 162.99222
+99.00000 999.00000
+61.54582 163.08194
+61.61221 163.08498
+61.61665 163.21138
+61.65915 163.27859
+61.72305 163.29776
+61.75331 163.17526
+61.76999 163.04305
+99.00000 999.00000
+61.90749 163.04388
+61.95444 163.03943
+99.00000 999.00000
+61.63914 163.85110
+61.57248 163.84027
+61.51277 163.78860
+61.45055 163.75000
+61.44693 163.83026
+61.43082 163.96165
+99.00000 999.00000
+61.29332 163.94832
+61.22832 163.92749
+61.18889 163.79414
+61.15332 163.66972
+61.09581 163.61221
+61.05165 163.52193
+61.00665 163.49638
+99.00000 999.00000
+61.95915 164.06998
+61.88998 164.06998
+61.82472 164.05110
+61.75610 164.05276
+61.69305 164.01831
+99.00000 999.00000
+61.33638 164.01944
+99.00000 999.00000
+61.02748 172.12471
+61.07860 172.03581
+61.07414 172.08498
+61.04193 172.19832
+61.01443 172.31638
+61.03693 172.43999
+61.07138 172.45972
+61.09972 172.35722
+61.13388 172.24248
+61.12222 172.35915
+61.15443 172.39444
+61.22249 172.34360
+61.20193 172.46472
+61.18665 172.58388
+61.22581 172.66859
+61.27388 172.77332
+61.32472 172.67499
+61.31055 172.76555
+61.27722 172.88165
+61.32414 172.93304
+61.37776 172.86499
+61.41222 172.74971
+61.44943 172.78194
+61.45776 172.89943
+61.41554 172.99748
+99.00000 999.00000
+61.38832 173.10527
+61.43304 173.22139
+61.48581 173.30556
+61.54944 173.34222
+61.55611 173.48915
+61.62721 173.47055
+61.69026 173.50998
+61.75082 173.55943
+61.71472 173.67389
+61.68889 173.79889
+61.66693 173.85222
+61.70639 173.95915
+99.00000 999.00000
+61.75276 174.03082
+61.76944 174.05832
+61.82527 174.03888
+61.83722 174.14471
+61.79831 174.16055
+61.81110 174.29193
+61.83582 174.38081
+61.80638 174.44722
+61.83388 174.60722
+61.87776 174.71832
+61.93304 174.65776
+61.98164 174.60944
+61.95248 174.73222
+61.91805 174.76498
+61.95221 174.85472
+99.00000 999.00000
+61.98109 175.00249
+99.00000 999.00000
+61.53749 193.96111
+61.50665 193.92667
+61.49748 193.87222
+61.55249 193.82584
+61.60332 193.81084
+61.65610 193.82333
+61.70888 193.83583
+61.68304 193.85056
+61.63472 193.87471
+61.64972 193.99889
+99.00000 999.00000
+61.77527 193.94250
+61.81805 193.92305
+99.00000 999.00000
+61.00444 194.86833
+61.01443 194.98972
+99.00000 999.00000
+61.05666 194.97388
+61.08055 194.88693
+61.11194 194.83527
+61.14915 194.86388
+61.19498 194.89722
+61.22748 194.90639
+61.23805 194.87054
+61.20665 194.88860
+61.15971 194.85583
+61.15694 194.75084
+61.19055 194.67583
+61.21860 194.66499
+61.25722 194.72667
+61.27943 194.79610
+61.32999 194.78334
+61.34610 194.77834
+61.37888 194.83276
+61.41666 194.87305
+61.43694 194.94722
+61.47165 194.99777
+99.00000 999.00000
+61.46999 194.95750
+61.43222 194.92444
+61.42860 194.83360
+61.37888 194.80917
+61.34471 194.73360
+61.31027 194.75055
+61.27972 194.77277
+61.25806 194.69250
+61.22331 194.61888
+61.17749 194.61667
+61.13777 194.64777
+61.09555 194.63361
+61.07222 194.57083
+61.08276 194.46777
+61.11806 194.39500
+61.17860 194.36194
+61.22556 194.35583
+61.26082 194.38222
+61.29166 194.34610
+61.30777 194.24834
+61.31805 194.14333
+61.37193 194.09360
+61.42165 194.10500
+61.44415 194.20277
+61.48639 194.23584
+61.53555 194.17972
+61.55472 194.08527
+99.00000 999.00000
+61.65472 194.04111
+61.67444 194.16917
+61.68944 194.19083
+61.70055 194.08556
+61.72722 194.00026
+99.00000 999.00000
+61.82610 194.09639
+61.81915 194.20776
+61.84805 194.29584
+61.85110 194.41055
+61.88889 194.36139
+61.92638 194.28972
+61.98610 194.24693
+99.00000 999.00000
+61.01360 195.05251
+61.07027 195.05305
+61.07777 195.12666
+61.09776 195.20277
+61.11110 195.17776
+61.11388 195.06721
+99.00000 999.00000
+61.47998 195.00861
+61.49277 195.12167
+61.52748 195.17722
+61.55722 195.26027
+61.59555 195.30417
+61.62694 195.23750
+61.59193 195.20526
+61.54915 195.15805
+61.51222 195.09471
+99.00000 999.00000
+61.18277 208.99055
+61.14610 208.92471
+61.10081 208.87805
+61.05331 208.83859
+61.03749 208.73444
+61.01222 208.64500
+61.01498 208.53610
+99.00000 999.00000
+61.00693 209.48250
+61.03249 209.57111
+61.02388 209.67166
+99.00000 999.00000
+61.15082 209.94305
+61.19859 209.96860
+99.00000 999.00000
+61.24748 209.90584
+61.25499 209.78194
+61.27248 209.69917
+61.25000 209.66499
+61.24889 209.53526
+61.28055 209.45943
+61.33998 209.44276
+61.35555 209.42084
+61.30026 209.41611
+61.29915 209.35777
+61.27055 209.31276
+61.23665 209.24083
+61.21498 209.14305
+61.20888 209.04944
+99.00000 999.00000
+61.00610 210.33194
+61.03415 210.24889
+61.06638 210.17833
+61.09305 210.09193
+61.12694 210.02110
+99.00000 999.00000
+61.20888 210.05527
+61.24889 210.11388
+61.29860 210.15388
+61.33804 210.21417
+61.36722 210.28444
+61.40109 210.35056
+61.41998 210.45389
+61.44138 210.55167
+61.46889 210.63667
+61.48471 210.74609
+61.49527 210.66472
+61.50861 210.58305
+61.49609 210.46777
+61.48415 210.35001
+61.45526 210.26805
+61.41722 210.20471
+61.38582 210.12721
+61.33748 210.08556
+61.27609 210.07111
+61.24026 210.00417
+99.00000 999.00000
+61.02193 211.95084
+61.04999 211.89000
+61.10027 211.85472
+61.09471 211.81194
+61.07889 211.71027
+61.06194 211.60889
+61.03305 211.62721
+61.00026 211.63110
+99.00000 999.00000
+61.03749 211.69527
+61.06526 211.77916
+61.04665 211.83472
+99.00000 999.00000
+61.00331 212.89027
+99.00000 999.00000
+61.00555 212.57222
+99.00000 999.00000
+61.01694 212.48109
+61.06415 212.49889
+61.10527 212.48805
+61.15109 212.48721
+61.12332 212.42833
+61.07111 212.42276
+61.01915 212.38638
+61.00998 212.37167
+99.00000 999.00000
+61.02193 212.05388
+61.07138 212.07277
+61.10805 212.11638
+61.14471 212.18277
+61.18443 212.24222
+61.22305 212.30194
+61.22415 212.24500
+61.27026 212.29250
+61.25610 212.23610
+61.21138 212.18584
+61.17055 212.12750
+61.13277 212.06389
+61.08582 212.01833
+99.00000 999.00000
+61.01749 213.32056
+61.02805 213.40109
+61.05194 213.39360
+61.08249 213.39833
+61.08388 213.50917
+61.08693 213.62444
+61.08556 213.75638
+61.12415 213.71388
+61.12915 213.60222
+61.12639 213.50250
+61.12555 213.39861
+61.08972 213.33083
+61.05305 213.26334
+61.02361 213.18527
+99.00000 999.00000
+62.06110 163.16693
+62.10527 163.10222
+62.16859 163.09776
+62.23471 163.09222
+62.29472 163.14389
+62.33165 163.22722
+62.36499 163.35388
+62.39444 163.23415
+62.44472 163.16443
+62.50331 163.22443
+62.55110 163.31221
+62.56194 163.46193
+62.59055 163.61888
+62.61722 163.78665
+62.61055 163.91972
+99.00000 999.00000
+62.66805 164.14998
+62.69666 164.30305
+62.70415 164.44276
+62.69110 164.58194
+62.62415 164.66415
+62.56805 164.76360
+62.55165 164.90082
+99.00000 999.00000
+62.41666 164.97665
+62.43498 164.84277
+62.47026 164.72165
+62.46638 164.57056
+62.41888 164.46027
+62.36526 164.36943
+62.32832 164.22665
+62.27722 164.12054
+62.21359 164.09055
+62.14415 164.09749
+62.07832 164.07664
+62.01027 164.07582
+99.00000 999.00000
+62.50777 165.08943
+62.50499 165.23610
+62.49388 165.37776
+62.47388 165.51054
+62.45277 165.64249
+62.44693 165.57222
+62.46165 165.43388
+62.47665 165.29694
+62.47472 165.14665
+62.42581 165.14389
+62.38138 165.25139
+62.31581 165.32999
+62.36110 165.24138
+62.40472 165.13026
+99.00000 999.00000
+62.03526 175.22360
+62.10138 175.25249
+62.15999 175.26971
+62.11165 175.33331
+62.08665 175.35138
+62.09415 175.36305
+62.13860 175.47722
+62.17749 175.61388
+62.21472 175.75526
+62.24860 175.91193
+99.00000 999.00000
+62.27638 176.05582
+62.30415 176.22861
+62.34915 176.33972
+62.40305 176.41748
+62.44110 176.55611
+62.46944 176.60664
+62.52415 176.64110
+62.51360 176.69249
+62.51610 176.79971
+62.54332 176.97832
+99.00000 999.00000
+62.66832 176.92638
+62.71999 176.98415
+99.00000 999.00000
+62.84694 176.97638
+99.00000 999.00000
+62.55194 177.05331
+62.56805 177.23444
+62.58638 177.15388
+62.60081 177.02026
+99.00000 999.00000
+62.77026 177.03665
+99.00000 999.00000
+62.83498 177.04138
+62.78888 177.14748
+62.71860 177.13777
+62.71693 177.26222
+62.77972 177.29527
+62.81499 177.41498
+62.77888 177.42805
+62.75555 177.33026
+62.68388 177.33110
+62.62332 177.27805
+62.57889 177.32248
+62.57248 177.44722
+62.57805 177.61581
+62.56998 177.76805
+62.55388 177.90999
+99.00000 999.00000
+62.54138 178.04166
+62.51109 178.16666
+62.47581 178.28389
+62.45610 178.42110
+62.42499 178.54359
+62.40527 178.68193
+62.37971 178.81139
+62.35944 178.94748
+99.00000 999.00000
+62.31581 179.03693
+62.30972 179.12305
+62.37944 179.13332
+62.44415 179.10777
+62.49722 179.17139
+62.49777 179.32971
+62.55138 179.40776
+62.61832 179.43832
+62.63582 179.56389
+62.70027 179.60443
+62.77972 179.56998
+62.85110 179.52722
+62.88693 179.40805
+62.92194 179.28888
+99.00000 999.00000
+62.96472 190.24777
+99.00000 999.00000
+62.98526 190.45027
+62.95471 190.36833
+99.00000 999.00000
+62.02609 194.24722
+62.07443 194.27638
+62.12193 194.30750
+62.16055 194.37054
+62.19914 194.43359
+62.24222 194.48109
+62.28276 194.53751
+62.32414 194.59027
+62.36026 194.66443
+62.40610 194.69417
+62.44611 194.75276
+62.48248 194.82417
+62.51889 194.89693
+62.53749 194.99889
+99.00000 999.00000
+62.53139 195.10249
+62.50610 195.13472
+62.46777 195.18111
+62.45164 195.28305
+62.43248 195.38055
+62.40498 195.32277
+62.37193 195.24805
+62.39194 195.33194
+62.42221 195.41722
+62.45610 195.37222
+62.48831 195.33972
+62.50194 195.32860
+62.48805 195.27000
+62.48665 195.16110
+62.52998 195.20833
+62.56526 195.14500
+62.59471 195.24026
+62.62471 195.33388
+62.66277 195.39917
+62.69415 195.44055
+62.73248 195.50751
+62.73415 195.47000
+62.69777 195.39888
+62.66360 195.31917
+62.62332 195.26109
+62.63609 195.18167
+62.69943 195.15639
+62.74306 195.13443
+62.78555 195.11806
+62.78415 195.21388
+62.80748 195.16833
+62.84665 195.14276
+62.89665 195.16693
+62.94276 195.20555
+62.98665 195.25166
+99.00000 999.00000
+62.99554 196.21138
+99.00000 999.00000
+63.31998 178.92526
+63.34193 178.81721
+63.40193 178.85110
+63.34555 178.94249
+63.35582 178.95998
+63.42221 178.88193
+63.49306 178.80943
+63.57498 178.77914
+63.55415 178.74416
+63.47556 178.79610
+63.41277 178.79498
+63.38748 178.66026
+63.42581 178.63498
+63.47693 178.72388
+63.53415 178.72388
+63.56139 178.67305
+63.57748 178.52914
+63.53749 178.42526
+63.53389 178.30943
+63.58972 178.29472
+63.62138 178.39471
+63.59665 178.50998
+63.63832 178.54555
+63.58582 178.62999
+63.62277 178.71027
+63.66249 178.59526
+63.65332 178.69748
+63.64748 178.75777
+63.72665 178.74332
+63.81082 178.70888
+63.88998 178.69415
+63.97443 178.65305
+63.94693 178.65999
+63.97165 178.54359
+63.97221 178.37694
+63.98776 178.47665
+99.00000 999.00000
+63.00972 179.23444
+63.06055 179.32332
+63.08249 179.41331
+63.15305 179.38860
+63.20860 179.29721
+63.23665 179.17415
+63.26721 179.06831
+99.00000 999.00000
+62.98334 178.98334
+99.00000 999.00000
+63.42972 188.94139
+63.43056 188.92000
+63.40527 188.83167
+63.38693 188.72443
+63.33998 188.67416
+63.31776 188.57304
+63.32915 188.47084
+63.34499 188.39360
+63.37027 188.30110
+63.40222 188.23526
+63.44305 188.17526
+63.49832 188.15527
+63.55222 188.15834
+63.60027 188.19443
+63.64221 188.20805
+63.68414 188.25583
+63.73860 188.28084
+63.79222 188.27306
+63.77805 188.36250
+63.73164 188.35860
+63.68805 188.39861
+63.66193 188.49667
+63.64139 188.59084
+63.64110 188.48416
+63.61972 188.49193
+63.60889 188.55972
+63.61472 188.67776
+63.63248 188.63417
+63.62360 188.76416
+63.60472 188.88138
+63.60555 188.86000
+63.59193 188.89777
+63.58832 188.98805
+99.00000 999.00000
+63.18414 189.92805
+63.18721 189.85417
+63.19638 189.73860
+63.23499 189.78416
+63.28555 189.75444
+63.30943 189.65027
+63.34305 189.57277
+63.37498 189.48972
+63.39777 189.38834
+63.41388 189.30055
+63.43359 189.18610
+63.45694 189.11026
+63.42998 189.01222
+63.41805 189.14638
+63.39693 189.25777
+63.37721 189.37222
+63.35361 189.47360
+63.32166 189.55638
+63.28610 189.63083
+63.24664 189.69333
+63.26999 189.65971
+63.30693 189.59027
+63.34109 189.51416
+63.36806 189.41805
+63.38832 189.30527
+63.41026 189.19583
+63.42526 189.07249
+99.00000 999.00000
+63.57748 189.02026
+63.58611 189.11276
+63.61110 189.20500
+63.64748 189.27805
+63.67943 189.35944
+63.68138 189.45583
+63.70248 189.55583
+63.69443 189.65971
+63.66832 189.74889
+63.63222 189.81610
+63.60722 189.91472
+63.55943 189.94527
+63.50888 189.95500
+63.49277 189.95166
+99.00000 999.00000
+63.01109 190.25139
+63.05527 190.28943
+63.08804 190.22943
+63.12888 190.17110
+63.15277 190.07417
+63.13693 190.06166
+63.09972 190.13167
+63.06360 190.19110
+63.04498 190.21138
+63.08582 190.15167
+63.12415 190.08667
+63.15639 190.00500
+99.00000 999.00000
+63.47055 190.10583
+63.44722 190.21167
+63.44305 190.16000
+63.43443 190.26889
+63.42805 190.37027
+63.38832 190.43250
+63.35056 190.49944
+63.35999 190.56583
+63.37164 190.48860
+63.35999 190.62721
+63.34248 190.74277
+63.30276 190.79971
+63.30748 190.91554
+63.33026 190.84109
+63.34277 190.84109
+63.34444 190.97804
+99.00000 999.00000
+63.18056 190.87526
+63.17860 190.74083
+63.17055 190.69472
+63.18665 190.80360
+63.20389 190.80305
+63.18832 190.69250
+63.15332 190.61777
+63.11888 190.57527
+63.09277 190.48416
+63.04805 190.42751
+63.00000 190.44305
+99.00000 999.00000
+63.33026 191.10333
+63.31139 191.21222
+63.29054 191.29916
+63.25360 191.28084
+63.20581 191.23860
+63.16110 191.18056
+63.15999 191.06416
+99.00000 999.00000
+63.01109 195.28583
+63.02972 195.39555
+63.01776 195.50500
+63.02527 195.56610
+63.00499 195.66417
+63.04805 195.65388
+63.07277 195.57249
+63.08498 195.46555
+63.12831 195.41026
+63.15915 195.49417
+63.19777 195.55917
+63.22693 195.65666
+63.24805 195.77859
+63.25665 195.90222
+99.00000 999.00000
+63.25249 196.01138
+63.22943 196.10638
+63.21748 196.21443
+63.19194 196.28526
+63.15277 196.35609
+63.11194 196.34416
+63.13998 196.42084
+63.10915 196.42722
+63.06998 196.36501
+63.03972 196.27277
+63.00555 196.19276
+63.02859 196.27472
+63.05472 196.38138
+63.09665 196.43472
+63.09721 196.53777
+63.06332 196.61638
+63.02193 196.65834
+63.04388 196.76083
+63.05388 196.90138
+63.08415 196.98972
+99.00000 999.00000
+63.11693 197.05527
+63.14998 197.13805
+63.19693 197.16417
+63.21832 197.25221
+63.24443 197.35083
+63.28389 197.41306
+63.32359 197.47360
+63.36581 197.52693
+63.40776 197.57277
+63.44666 197.63722
+63.48193 197.71277
+63.52832 197.69472
+63.53693 197.77388
+63.51498 197.86888
+63.48831 197.95639
+63.46527 197.92999
+63.43555 197.83667
+63.43665 197.93584
+99.00000 999.00000
+63.43860 198.02026
+63.45305 198.11110
+63.45248 198.22638
+63.46582 198.35001
+63.45277 198.45943
+63.45915 198.54083
+63.47499 198.65584
+63.49165 198.78305
+63.52582 198.86194
+63.56305 198.93193
+63.60915 198.97360
+99.00000 999.00000
+63.63332 199.05026
+63.67499 199.10667
+63.71248 199.17555
+63.75581 199.22194
+63.81139 199.23444
+63.87444 199.21860
+63.93027 199.17444
+63.98332 199.12584
+99.00000 999.00000
+64.71193 174.92331
+64.67331 174.77361
+64.66693 174.60971
+64.67972 174.45639
+64.68056 174.56221
+64.68222 174.73389
+64.71805 174.89665
+99.00000 999.00000
+64.88860 175.98248
+64.82944 175.92305
+64.78110 175.81639
+64.75139 175.64444
+64.75415 175.48749
+64.73082 175.29749
+64.73860 175.13693
+99.00000 999.00000
+64.75943 175.03360
+64.75360 175.19305
+64.75389 175.33026
+64.78471 175.51248
+64.77777 175.67471
+64.81332 175.82332
+64.86249 175.92471
+64.91914 175.99498
+99.00000 999.00000
+64.66693 176.90443
+64.61165 176.82777
+64.56389 176.73389
+64.63332 176.66026
+64.67805 176.54749
+64.67110 176.41805
+64.62054 176.32166
+64.60304 176.18582
+64.54639 176.11610
+64.58943 176.11360
+64.64305 176.19666
+64.67221 176.36444
+64.72110 176.38722
+64.77361 176.30138
+64.83693 176.23248
+64.89249 176.13971
+64.92499 176.00221
+99.00000 999.00000
+64.92249 176.09915
+64.89722 176.23860
+64.86472 176.36888
+64.80498 176.42860
+64.83305 176.55165
+64.86165 176.65889
+64.84248 176.80638
+64.80249 176.92276
+99.00000 999.00000
+64.22888 177.92194
+64.25916 177.79138
+64.29944 177.67415
+64.35555 177.58165
+64.40776 177.48027
+64.47527 177.39915
+64.55748 177.36110
+64.61832 177.41722
+64.68472 177.44804
+64.74971 177.48444
+64.77472 177.36555
+64.74416 177.22861
+64.71971 177.07472
+99.00000 999.00000
+64.77332 177.06694
+64.79721 177.21693
+64.84389 177.27332
+64.89806 177.22804
+64.95248 177.13110
+64.99416 177.02888
+99.00000 999.00000
+64.93999 177.24332
+64.93138 177.40582
+64.86777 177.46555
+64.82832 177.39806
+64.79860 177.50026
+64.76109 177.59164
+64.71722 177.62749
+64.70110 177.77554
+64.69832 177.94582
+99.00000 999.00000
+64.01610 178.39221
+64.06555 178.48360
+64.03888 178.58415
+64.10498 178.50360
+64.17499 178.43111
+64.25722 178.37915
+64.33305 178.31110
+64.40472 178.23694
+64.42027 178.19276
+64.40889 178.24081
+64.33722 178.26332
+64.28415 178.18027
+64.23749 178.08916
+64.20221 178.15944
+64.66582 178.01582
+99.00000 999.00000
+64.67888 178.15222
+64.65359 178.26360
+64.66249 178.33472
+64.67665 178.51860
+64.69777 178.69194
+64.65277 178.72443
+64.62222 178.56998
+64.58916 178.54111
+64.62694 178.68472
+64.66859 178.81332
+64.71359 178.92943
+99.00000 999.00000
+64.75331 179.03555
+64.79138 179.17805
+64.81555 179.34389
+64.81415 179.46693
+64.86722 179.55138
+64.91693 179.64888
+64.96472 179.72581
+99.00000 999.00000
+64.98499 184.15834
+64.94527 184.27333
+64.90359 184.38916
+64.85138 184.48250
+64.83360 184.54527
+64.78305 184.53000
+64.78555 184.70110
+64.77638 184.86806
+64.81360 184.97276
+64.82721 184.99609
+99.00000 999.00000
+64.80832 185.00500
+99.00000 999.00000
+64.78165 185.14139
+64.74664 185.26971
+64.70665 185.38693
+64.67555 185.51971
+64.66415 185.67555
+64.62721 185.66859
+64.58665 185.78471
+64.53972 185.88971
+64.46748 185.91972
+64.40971 185.99805
+99.00000 999.00000
+64.39027 186.13138
+64.35777 186.26222
+64.35416 186.42000
+64.39665 186.53806
+64.45221 186.61417
+64.51999 186.63417
+64.59610 186.58556
+64.59248 186.63333
+64.53860 186.70084
+64.46971 186.69804
+64.42415 186.71805
+64.38306 186.60361
+64.31888 186.57222
+64.28693 186.70193
+64.25693 186.82472
+64.28055 186.98639
+99.00000 999.00000
+64.49889 186.98000
+99.00000 999.00000
+64.65831 186.92055
+64.83859 186.99388
+99.00000 999.00000
+64.79111 186.89194
+64.79248 186.82944
+64.83859 186.90584
+99.00000 999.00000
+64.28749 187.01389
+64.33832 187.10472
+64.41554 187.09750
+64.47194 187.07500
+99.00000 999.00000
+64.50972 187.06389
+64.50055 187.18333
+64.44388 187.21638
+64.40749 187.28999
+64.40027 187.43167
+64.42444 187.58583
+64.44556 187.67722
+64.49527 187.57916
+64.55832 187.50471
+64.58388 187.36166
+64.61444 187.22749
+64.60805 187.08667
+64.60889 187.05443
+64.66249 187.13277
+64.67221 187.02554
+99.00000 999.00000
+64.71472 187.13693
+64.76639 187.21609
+64.80914 187.14610
+64.84555 187.02193
+99.00000 999.00000
+64.86110 187.12250
+64.86832 187.26222
+64.90109 187.40750
+64.91693 187.52138
+64.96082 187.63609
+99.00000 999.00000
+64.72221 187.33360
+64.71555 187.47000
+64.73277 187.63609
+64.76721 187.77638
+64.79527 187.82889
+64.83804 187.71666
+64.86139 187.57527
+64.82971 187.43610
+64.76999 187.37555
+64.73164 187.32443
+99.00000 999.00000
+64.57388 193.89055
+64.59109 193.78221
+64.61998 193.69167
+64.65138 193.60388
+64.70110 193.54167
+64.75526 193.51471
+64.80582 193.53250
+64.83804 193.61444
+64.87222 193.58583
+64.91306 193.57971
+64.94804 193.49916
+64.91748 193.52222
+64.91582 193.52499
+64.95110 193.44221
+64.97998 193.35001
+99.00000 999.00000
+64.44388 194.97139
+64.46222 194.86555
+64.48109 194.76109
+64.49664 194.65138
+64.51138 194.54083
+64.52193 194.42389
+64.53471 194.31055
+64.54443 194.19250
+64.55888 194.08110
+99.00000 999.00000
+64.56444 195.98222
+64.57111 195.85834
+64.57472 195.73277
+64.56665 195.63277
+64.58443 195.71500
+64.56610 195.58749
+64.53831 195.47972
+64.50888 195.37776
+64.48444 195.26222
+64.51471 195.34389
+64.52248 195.22749
+64.49277 195.12584
+64.52693 195.08833
+64.50110 195.03999
+64.46777 195.10500
+64.46443 195.17194
+64.45943 195.19221
+64.44666 195.05443
+99.00000 999.00000
+64.55998 196.96193
+64.59943 196.91943
+64.63609 196.84360
+64.65332 196.76721
+64.61832 196.68610
+64.58638 196.62334
+64.55556 196.70776
+64.53444 196.81027
+64.51971 196.90610
+64.49138 196.95639
+64.45389 196.88499
+64.40889 196.83972
+64.44194 196.75638
+64.49026 196.69638
+64.51944 196.60667
+64.54999 196.51889
+64.56915 196.41388
+64.57582 196.29222
+64.58916 196.17805
+64.57166 196.05194
+99.00000 999.00000
+64.70972 197.94221
+64.70110 197.92000
+64.68555 197.82111
+64.64415 197.76277
+64.60722 197.68971
+64.57915 197.58527
+64.54831 197.48888
+64.51277 197.41083
+64.46248 197.38333
+64.41110 197.35944
+64.37444 197.29359
+64.33693 197.22194
+64.38582 197.18222
+64.44472 197.16055
+64.48665 197.14777
+64.51305 197.10500
+64.55276 197.03194
+99.00000 999.00000
+64.28249 198.94804
+64.32166 198.87526
+64.36194 198.80194
+64.39165 198.77554
+64.40776 198.81250
+64.41972 198.70360
+64.42610 198.61417
+64.41249 198.50417
+64.40027 198.47360
+64.44666 198.51750
+64.50249 198.53027
+64.53693 198.61166
+64.51694 198.71609
+64.50249 198.83000
+64.50693 198.96971
+64.53360 198.93359
+64.55138 198.99916
+99.00000 999.00000
+64.87389 198.92610
+64.91443 198.85443
+64.91081 198.92943
+64.94139 198.96138
+64.93472 198.86917
+64.90805 198.79666
+64.87415 198.71222
+64.83026 198.66167
+64.78471 198.61667
+64.76248 198.49388
+64.76889 198.44083
+64.78777 198.33360
+64.81721 198.24638
+64.80138 198.23694
+64.77748 198.22250
+64.75194 198.11777
+64.71609 198.06776
+64.74805 198.15834
+64.73888 198.15721
+64.70581 198.07056
+99.00000 999.00000
+64.02248 199.09360
+64.07999 199.05750
+64.14276 199.04333
+64.19943 199.05167
+64.25110 199.01917
+99.00000 999.00000
+64.57304 199.06972
+64.60443 199.16110
+64.64861 199.20694
+64.70526 199.21609
+64.75165 199.16888
+64.80582 199.12054
+64.83693 199.03194
+99.00000 999.00000
+65.02110 176.97804
+65.03943 176.83527
+65.00276 176.68138
+99.00000 999.00000
+65.03915 176.43472
+65.05110 176.32193
+65.08665 176.42082
+65.04414 176.53831
+65.03722 176.67888
+65.07304 176.82443
+65.06139 176.97665
+99.00000 999.00000
+65.03610 177.08194
+99.00000 999.00000
+65.00000 179.76360
+99.00000 999.00000
+65.04527 179.87749
+99.00000 999.00000
+65.08055 180.03000
+65.12639 180.14194
+65.15665 180.28444
+65.21416 180.35333
+65.26860 180.43277
+65.34389 180.43472
+65.41527 180.45471
+65.46638 180.54776
+65.51471 180.65167
+65.57777 180.64276
+65.63582 180.65222
+65.67471 180.52859
+65.72305 180.41972
+65.77248 180.31194
+65.83221 180.22722
+65.91138 180.18359
+65.98749 180.18472
+99.00000 999.00000
+65.97861 181.10304
+65.91277 181.09888
+65.86139 181.19972
+65.79971 181.28751
+65.75777 181.35834
+65.74554 181.51694
+65.67972 181.52306
+65.61722 181.47139
+65.55888 181.47139
+65.50471 181.47388
+65.47693 181.61444
+65.48749 181.80472
+65.47638 181.97194
+99.00000 999.00000
+65.48027 182.14110
+65.47804 182.31943
+65.48831 182.51860
+65.52888 182.64861
+65.57805 182.74834
+65.60805 182.91055
+99.00000 999.00000
+65.59860 183.06360
+65.58194 183.22417
+65.56027 183.37555
+65.52777 183.50888
+65.49609 183.64389
+65.47832 183.80388
+65.46443 183.93083
+99.00000 999.00000
+65.42471 184.03305
+65.35999 184.06139
+65.29805 184.09500
+65.23499 184.13777
+65.16777 184.21249
+65.10056 184.18222
+65.03555 184.13609
+99.00000 999.00000
+65.00360 187.72777
+99.00000 999.00000
+65.05138 187.83139
+65.09193 187.83777
+65.12277 187.76027
+65.15138 187.80251
+65.20805 187.71555
+65.21527 187.56139
+65.21777 187.37610
+65.26749 187.31416
+65.24277 187.43443
+65.26776 187.59471
+65.24193 187.73666
+65.29305 187.75972
+65.36581 187.75722
+65.43193 187.80472
+65.49498 187.85083
+65.44972 187.74083
+65.42499 187.58360
+65.47916 187.57500
+65.49777 187.64194
+65.55582 187.56416
+65.60027 187.54277
+65.61499 187.37360
+65.66165 187.34444
+65.67165 187.18277
+65.68639 187.23584
+65.68832 187.38527
+65.67610 187.54776
+65.64276 187.63222
+65.58748 187.71138
+65.55804 187.72388
+65.55556 187.84109
+65.53276 187.96359
+99.00000 999.00000
+65.48415 187.97221
+99.00000 999.00000
+65.52972 188.15527
+65.49638 188.07860
+65.49222 188.10583
+65.51222 188.29111
+65.52888 188.48639
+65.52832 188.66833
+65.48805 188.78777
+65.48972 188.94250
+65.56194 188.97388
+65.61610 188.90193
+65.64665 188.76250
+65.69415 188.65639
+65.73027 188.67194
+65.76944 188.54944
+65.82971 188.46805
+65.81721 188.57971
+65.77277 188.69221
+65.71555 188.77916
+65.68694 188.92250
+99.00000 999.00000
+65.65610 189.04193
+65.62109 189.16859
+65.60889 189.34500
+65.65639 189.44888
+65.72693 189.47084
+65.79359 189.45639
+65.85277 189.43889
+65.87082 189.43944
+65.91638 189.54916
+65.95639 189.67805
+65.99748 189.79388
+99.00000 999.00000
+65.78972 190.91499
+65.82111 190.97166
+99.00000 999.00000
+65.75832 190.95888
+99.00000 999.00000
+65.99777 190.23416
+99.00000 999.00000
+65.57777 191.94527
+65.62665 191.88834
+65.67860 191.88417
+65.71555 191.96417
+99.00000 999.00000
+65.67638 191.95084
+65.63498 191.97194
+99.00000 999.00000
+65.39165 192.91611
+65.40166 192.79472
+65.40749 192.67389
+65.41722 192.55388
+65.44388 192.45667
+65.47693 192.38443
+65.51109 192.29721
+65.52998 192.18916
+65.55943 192.09444
+99.00000 999.00000
+65.73109 192.01750
+65.76027 192.13026
+65.73193 192.11833
+65.70221 192.00751
+99.00000 999.00000
+65.66748 192.09444
+65.70139 192.18694
+65.71111 192.26109
+65.71999 192.40805
+65.75415 192.49916
+65.78526 192.42888
+65.80527 192.51889
+65.82527 192.48167
+65.85860 192.57721
+65.89389 192.66638
+65.88110 192.74388
+65.85693 192.84721
+65.88306 192.97166
+99.00000 999.00000
+65.02666 193.29834
+65.07056 193.23500
+65.09581 193.13750
+65.14194 193.06860
+65.19972 193.03972
+65.24805 193.07001
+65.28389 193.14417
+65.24193 193.10417
+65.19722 193.06305
+65.14249 193.08527
+65.12444 193.17999
+65.11665 193.30222
+65.12888 193.44722
+65.16888 193.51334
+65.21889 193.51193
+65.25331 193.59860
+65.25861 193.68639
+65.25305 193.81027
+65.23860 193.90805
+65.26610 193.91527
+65.29831 193.82555
+65.31415 193.71193
+65.30081 193.61888
+65.33305 193.53027
+65.35443 193.42610
+65.36832 193.31139
+65.37694 193.18944
+65.37944 193.06250
+65.35582 193.16360
+65.34222 193.27834
+65.33943 193.29860
+65.34805 193.17667
+65.36748 193.07001
+99.00000 999.00000
+65.90915 193.05000
+65.94305 193.11472
+65.97331 193.03500
+65.99248 193.12666
+65.99026 193.20055
+99.00000 999.00000
+65.97777 198.11610
+65.99361 198.19749
+99.00000 999.00000
+66.03943 180.21750
+66.11026 180.23500
+66.16972 180.29805
+66.15610 180.40359
+66.14139 180.35472
+66.11861 180.41972
+66.13138 180.60417
+66.17555 180.72638
+66.23277 180.71609
+66.28777 180.61972
+66.33276 180.59750
+66.29388 180.71971
+66.30859 180.82639
+66.37971 180.81583
+66.38971 180.87000
+66.30859 180.92027
+66.24748 180.87500
+66.19472 180.93750
+99.00000 999.00000
+66.16859 181.06084
+66.20332 181.21111
+66.26360 181.27110
+66.31805 181.34805
+66.37082 181.38499
+66.40277 181.48305
+66.33360 181.49138
+66.26749 181.47026
+66.20444 181.45444
+66.14526 181.43916
+66.11055 181.32304
+66.04332 181.28943
+99.00000 999.00000
+66.00415 181.15555
+66.04860 181.03943
+99.00000 999.00000
+66.67110 184.99971
+99.00000 999.00000
+66.99361 185.80583
+66.94693 185.91554
+66.87749 185.94026
+66.81276 185.96584
+99.00000 999.00000
+66.67526 185.99138
+99.00000 999.00000
+66.63832 185.86501
+66.59888 185.73471
+66.55777 185.75888
+66.53610 185.91026
+99.00000 999.00000
+66.21805 185.97861
+66.26164 185.91388
+66.33110 185.94833
+99.00000 999.00000
+66.41277 185.96277
+99.00000 999.00000
+66.48499 185.93527
+66.47139 185.77834
+66.43111 185.79054
+66.38860 185.66722
+66.34305 185.63583
+66.29889 185.58167
+66.33916 185.50583
+66.37639 185.51944
+66.44194 185.48639
+66.45581 185.57222
+66.51193 185.53360
+66.56444 185.43666
+66.59222 185.28917
+66.61444 185.13167
+66.66026 185.01555
+66.70721 185.09833
+66.75000 185.20610
+66.74443 185.24722
+66.82443 185.23277
+66.89415 185.19917
+66.93472 185.22527
+66.97972 185.10805
+99.00000 999.00000
+66.94415 186.92000
+66.99193 186.82584
+66.93166 186.75999
+66.90332 186.78999
+66.84831 186.83333
+66.83888 186.64751
+66.89471 186.65443
+66.95027 186.64526
+99.00000 999.00000
+66.99748 186.75471
+99.00000 999.00000
+66.68388 186.03194
+99.00000 999.00000
+66.51443 186.08888
+66.46748 186.19611
+66.40776 186.21638
+66.35081 186.17250
+66.32498 186.08388
+66.29027 186.08221
+99.00000 999.00000
+66.34860 186.01694
+99.00000 999.00000
+66.97331 187.99889
+99.00000 999.00000
+66.96082 187.83388
+66.96638 187.63834
+66.98499 187.51027
+99.00000 999.00000
+66.99971 187.51527
+99.00000 999.00000
+66.98360 187.32584
+66.96222 187.48944
+66.92722 187.51389
+66.93111 187.36501
+66.90805 187.19917
+66.92805 187.03360
+99.00000 999.00000
+66.56639 188.89638
+66.60777 188.77472
+66.65082 188.65666
+66.70776 188.56444
+66.77026 188.58943
+66.79472 188.43639
+66.83972 188.31888
+66.90555 188.29666
+66.95915 188.24055
+66.95860 188.07693
+99.00000 999.00000
+66.00249 189.80417
+99.00000 999.00000
+66.03471 189.95305
+99.00000 999.00000
+66.15305 189.97166
+66.16306 189.83972
+66.16360 189.72556
+66.19026 189.73555
+66.20639 189.86444
+66.26193 189.77417
+66.30638 189.66805
+66.27888 189.50333
+66.23471 189.38750
+66.27026 189.44026
+66.30498 189.49971
+66.33611 189.53583
+66.36916 189.39777
+66.42444 189.30611
+66.47499 189.20389
+66.52248 189.09526
+99.00000 999.00000
+66.03139 190.04500
+99.00000 999.00000
+66.00998 190.24722
+66.07248 190.30888
+66.14027 190.24889
+66.16805 190.10056
+66.17805 190.04916
+66.14555 190.01776
+99.00000 999.00000
+66.00610 193.19055
+66.04639 193.25693
+66.08081 193.34805
+66.10693 193.44943
+66.13443 193.56776
+66.16415 193.67776
+66.17943 193.80055
+66.15498 193.90054
+66.14194 193.84776
+66.12027 193.95444
+99.00000 999.00000
+66.12164 194.08194
+66.10304 194.19333
+66.11861 194.32249
+66.14499 194.43500
+66.16472 194.47026
+66.18999 194.36861
+66.21277 194.26305
+66.21915 194.13277
+66.25777 194.13193
+66.29915 194.19417
+66.33443 194.28110
+66.36388 194.38750
+66.39110 194.50250
+66.41498 194.62805
+66.42860 194.76527
+66.44221 194.89360
+66.39915 194.95166
+99.00000 999.00000
+66.46582 195.06721
+66.49498 195.16943
+66.52777 195.26666
+66.55804 195.36166
+66.57664 195.51443
+66.59526 195.66193
+66.60110 195.80943
+66.60248 195.95583
+99.00000 999.00000
+66.20915 195.90639
+66.18860 195.82249
+66.19081 195.96805
+99.00000 999.00000
+66.60748 196.09334
+66.59972 196.22527
+66.58026 196.33833
+66.56776 196.29776
+66.58611 196.18333
+66.58081 196.06194
+66.56665 196.18304
+66.52472 196.24193
+66.47194 196.22250
+66.43498 196.14250
+66.38664 196.11055
+66.32860 196.11166
+66.27693 196.14555
+66.23888 196.07056
+99.00000 999.00000
+66.19165 196.00917
+66.20805 196.07805
+66.16388 196.10971
+66.11221 196.16917
+66.08331 196.26500
+66.07277 196.38693
+66.08804 196.51666
+66.08722 196.65750
+66.06998 196.77251
+66.07138 196.90860
+99.00000 999.00000
+66.09305 197.02138
+66.09305 197.14999
+66.09555 197.24277
+66.05859 197.32193
+66.00888 197.31139
+66.03693 197.35777
+66.05055 197.48639
+66.04027 197.56972
+66.03972 197.69804
+66.06749 197.80833
+66.06415 197.91222
+99.00000 999.00000
+66.58443 197.98610
+66.62332 197.90584
+66.67555 197.84860
+66.71332 197.76610
+66.72943 197.64667
+66.73526 197.50888
+66.79277 197.47443
+66.83748 197.41251
+66.88110 197.36139
+66.91306 197.44833
+66.95248 197.51027
+66.92499 197.59055
+66.95721 197.67583
+66.91081 197.73833
+66.85944 197.79776
+66.81139 197.86583
+66.78331 197.96666
+66.73888 197.96083
+66.69055 197.92194
+66.64305 197.95776
+99.00000 999.00000
+66.98776 197.56055
+99.00000 999.00000
+66.04860 198.02834
+66.02388 198.04443
+66.01639 198.10056
+99.00000 999.00000
+66.03055 198.18277
+66.06776 198.26027
+66.07860 198.21805
+66.11832 198.28610
+66.16026 198.34639
+66.20694 198.38916
+66.25444 198.43056
+66.26915 198.55638
+66.24915 198.63860
+66.22194 198.73750
+66.23915 198.86417
+66.21693 198.90750
+66.16611 198.90639
+66.12860 198.84666
+66.12248 198.90889
+66.16722 198.96056
+66.21664 198.99500
+99.00000 999.00000
+66.28305 198.95027
+66.33026 198.88609
+66.35498 198.78110
+66.37749 198.67334
+66.38860 198.54443
+66.40222 198.42110
+66.40443 198.27859
+66.37471 198.17444
+66.34389 198.08638
+66.30472 198.11276
+66.27443 198.09000
+66.32832 198.04527
+66.37665 198.07001
+66.42221 198.11861
+66.47748 198.13193
+66.53526 198.09389
+66.57472 198.01334
+99.00000 999.00000
+66.57971 198.05443
+66.53471 198.12360
+66.50221 198.21443
+66.47693 198.31750
+66.44666 198.41193
+66.46332 198.55859
+66.48888 198.66693
+66.52110 198.73833
+66.51999 198.82527
+66.49165 198.92027
+66.44998 198.99472
+99.00000 999.00000
+66.64748 198.85971
+66.60498 198.79944
+66.55638 198.76639
+66.53360 198.64943
+66.53276 198.51805
+66.56415 198.42805
+66.59665 198.40527
+66.62277 198.30305
+66.66415 198.22722
+66.69888 198.14000
+66.74498 198.12250
+66.79999 198.11166
+66.83748 198.18916
+66.89415 198.19888
+66.92943 198.28500
+66.95610 198.33472
+66.95110 198.44611
+66.98721 198.48305
+99.00000 999.00000
+66.23860 199.00139
+99.00000 999.00000
+66.41832 199.07167
+66.38554 199.16083
+66.37305 199.28638
+66.37305 199.41360
+66.38498 199.53777
+66.39610 199.67638
+66.41415 199.77777
+66.47165 199.78667
+66.53055 199.78638
+66.57555 199.71860
+66.61888 199.68971
+66.64415 199.75972
+66.63805 199.64055
+66.62889 199.57304
+66.59749 199.48305
+66.59581 199.36943
+66.62248 199.26833
+66.65860 199.18388
+66.66331 199.04277
+99.00000 999.00000
+67.88609 183.92610
+67.91748 183.77943
+67.95499 183.64389
+67.99332 183.50972
+99.00000 999.00000
+67.46609 184.93834
+67.40027 184.91527
+67.35056 184.81305
+67.34055 184.64751
+67.39082 184.68083
+67.44331 184.77251
+67.51027 184.75221
+67.49664 184.84305
+67.53831 184.78334
+67.59526 184.68860
+67.65860 184.64055
+67.68472 184.63693
+67.71971 184.49805
+67.75972 184.36610
+67.79860 184.23416
+67.83943 184.10583
+99.00000 999.00000
+67.09639 185.96388
+67.10332 185.77277
+67.10277 185.56805
+67.08110 185.36888
+67.06332 185.45250
+67.06665 185.56055
+67.03331 185.43584
+67.04860 185.62305
+67.03139 185.73639
+99.00000 999.00000
+67.02998 185.06972
+67.10027 185.04443
+67.16859 185.08055
+67.24081 185.08722
+67.30777 185.12888
+67.31221 185.21860
+67.38943 185.16251
+67.40498 185.04305
+67.45277 185.00276
+99.00000 999.00000
+67.02693 186.96277
+99.00000 999.00000
+67.02055 186.74693
+67.05638 186.71889
+67.05777 186.87389
+67.07832 186.70694
+67.07889 186.53972
+67.05055 186.46333
+67.10304 186.46167
+67.13248 186.31416
+67.08888 186.19221
+67.09499 186.00166
+99.00000 999.00000
+67.01776 187.24583
+67.01360 187.36526
+67.01054 187.45416
+67.03082 187.28806
+67.04193 187.10388
+99.00000 999.00000
+67.02415 187.05638
+99.00000 999.00000
+67.91081 194.98389
+67.94582 194.89055
+67.98222 194.79805
+99.00000 999.00000
+67.55138 195.97194
+67.59721 195.89917
+67.63165 195.80693
+67.66222 195.70776
+67.68999 195.60417
+67.72194 195.50722
+67.76389 195.42972
+67.79860 195.35805
+67.83276 195.27026
+67.80748 195.25722
+67.82027 195.22250
+67.85555 195.13333
+67.89027 195.04054
+99.00000 999.00000
+67.03471 196.94943
+67.05194 196.83026
+67.06332 196.70193
+67.07777 196.57693
+67.09248 196.45360
+67.10277 196.32333
+67.13693 196.23555
+67.19832 196.22221
+67.25693 196.21944
+67.30748 196.20277
+67.37109 196.16306
+67.42526 196.10472
+67.48360 196.05305
+99.00000 999.00000
+67.03972 197.99083
+67.02165 197.83833
+67.02415 197.74138
+67.06888 197.70250
+67.02722 197.68527
+67.00276 197.63138
+99.00000 999.00000
+67.04222 197.56805
+67.08943 197.61110
+67.13554 197.65834
+67.16222 197.59389
+67.13332 197.62027
+67.09164 197.55693
+67.04889 197.49750
+67.00888 197.43193
+67.01443 197.33167
+67.05360 197.26805
+67.04305 197.13693
+67.03027 197.04721
+67.00415 197.15083
+67.01944 197.04222
+99.00000 999.00000
+67.01555 198.33804
+67.01498 198.26222
+67.04831 198.17110
+67.04332 198.02110
+99.00000 999.00000
+68.52222 160.86360
+68.56165 160.75555
+68.55388 160.92526
+99.00000 999.00000
+68.96277 161.56555
+68.89888 161.54776
+68.84471 161.44331
+68.79248 161.31943
+68.72972 161.29222
+68.67694 161.27527
+68.61888 161.20555
+68.56082 161.13609
+99.00000 999.00000
+68.55443 161.02638
+68.61081 161.11221
+68.66888 161.18193
+68.73109 161.21527
+68.79555 161.22556
+68.85472 161.28610
+68.91249 161.36555
+68.97331 161.40999
+99.00000 999.00000
+68.91554 161.50916
+68.98055 161.51665
+99.00000 999.00000
+68.94832 161.46915
+68.89139 161.40805
+99.00000 999.00000
+68.78276 169.86777
+68.77443 169.67139
+68.80666 169.52055
+68.87027 169.43776
+68.93915 169.43721
+99.00000 999.00000
+68.99889 170.91805
+99.00000 999.00000
+68.95526 170.76222
+68.90027 170.71111
+68.82832 170.72748
+68.83943 170.68971
+68.91138 170.65999
+68.87498 170.49498
+68.82860 170.49055
+68.78331 170.55611
+68.76498 170.56721
+68.80249 170.42331
+68.81389 170.25082
+99.00000 999.00000
+68.98193 179.86748
+99.00000 999.00000
+68.99498 179.88443
+99.00000 999.00000
+68.78972 180.92860
+68.81749 180.78360
+68.82527 180.60277
+68.86888 180.65944
+68.92276 180.54834
+68.94276 180.45500
+68.90639 180.37389
+68.92972 180.21249
+68.95998 180.05667
+99.00000 999.00000
+68.46498 181.94305
+68.50305 181.80583
+68.53998 181.66638
+68.51860 181.69804
+68.47972 181.83360
+68.44138 181.97055
+99.00000 999.00000
+68.27554 181.94167
+99.00000 999.00000
+68.40610 181.98471
+68.44638 181.85167
+68.47665 181.72110
+68.50139 181.56360
+68.52026 181.39166
+68.55388 181.25833
+68.61806 181.26639
+68.66360 181.27777
+68.61331 181.39360
+68.59055 181.50139
+68.64082 181.38554
+68.68805 181.26360
+68.73944 181.14888
+68.77248 181.00139
+99.00000 999.00000
+68.15860 182.90277
+68.12831 182.83026
+68.17943 182.76805
+68.19556 182.83305
+68.23164 182.69777
+68.24582 182.56555
+68.20888 182.42555
+68.21388 182.38361
+68.25026 182.24472
+68.28860 182.37193
+68.28693 182.50055
+68.30832 182.42055
+68.35416 182.29834
+68.39777 182.17166
+68.43610 182.03526
+68.39998 182.10138
+68.36165 182.23776
+68.32388 182.23055
+68.29694 182.08276
+68.29831 182.00305
+99.00000 999.00000
+68.35193 182.01389
+99.00000 999.00000
+68.02693 183.38750
+68.06943 183.26054
+68.10638 183.12334
+67.98334 182.98334
+99.00000 999.00000
+68.21443 193.93472
+68.24889 193.83888
+68.28305 193.74306
+68.30804 193.63193
+68.32304 193.50500
+68.33804 193.37776
+68.34332 193.23584
+68.36388 193.24083
+68.38805 193.38722
+68.41388 193.52499
+68.39861 193.44055
+68.37360 193.29860
+68.35361 193.31027
+68.35443 193.45917
+68.39221 193.53777
+68.39693 193.60860
+68.39861 193.65666
+68.43304 193.65083
+68.47249 193.68666
+68.52638 193.70000
+68.56776 193.76944
+68.62415 193.77193
+68.67555 193.79500
+68.73082 193.80194
+68.78638 193.80888
+68.85193 193.77055
+68.88306 193.84584
+68.87694 193.99055
+99.00000 999.00000
+68.02638 194.67805
+68.05556 194.57443
+68.07777 194.46001
+68.09415 194.33583
+68.10555 194.20555
+68.12831 194.09193
+68.16527 194.00055
+99.00000 999.00000
+68.86832 194.13138
+68.85722 194.26944
+68.86165 194.43222
+68.86194 194.58777
+68.87248 194.75806
+68.88055 194.92776
+99.00000 999.00000
+68.89221 195.08194
+68.90527 195.25444
+68.92139 195.40805
+68.92581 195.57249
+68.93748 195.74417
+68.96388 195.87860
+99.00000 999.00000
+69.11026 160.96222
+99.00000 999.00000
+69.36194 160.98526
+69.42998 160.94638
+69.49664 160.93582
+69.55722 160.97998
+99.00000 999.00000
+69.64139 160.91306
+69.65138 160.75276
+69.67499 160.58498
+69.68193 160.40305
+69.67831 160.32138
+69.72221 160.20776
+69.70776 160.16943
+69.74582 160.02055
+99.00000 999.00000
+69.53194 161.84805
+69.48944 161.70332
+69.43248 161.62332
+69.38554 161.44611
+69.32805 161.46722
+69.28305 161.45805
+69.22415 161.39610
+69.16193 161.46082
+69.09694 161.47888
+69.02943 161.55666
+99.00000 999.00000
+69.02722 161.31276
+69.05611 161.15388
+69.13889 161.00082
+99.00000 999.00000
+69.20082 161.03444
+69.26610 161.02306
+99.00000 999.00000
+69.57414 161.00581
+99.00000 999.00000
+69.41165 161.48944
+69.45221 161.62193
+69.51831 161.60527
+69.58165 161.62721
+69.63582 161.51332
+69.59610 161.42972
+69.53526 161.42526
+69.46944 161.42776
+69.41165 161.35527
+99.00000 999.00000
+69.04639 161.44472
+69.11581 161.38609
+69.18166 161.38361
+69.24693 161.32498
+69.30748 161.37332
+69.37332 161.34471
+69.43832 161.33748
+69.49860 161.38609
+69.53581 161.30943
+69.48944 161.16498
+69.43472 161.06581
+69.36499 161.12915
+69.29694 161.15831
+69.23471 161.12776
+69.17082 161.11415
+69.10332 161.13110
+69.06248 161.25444
+69.02554 161.39943
+99.00000 999.00000
+69.67055 162.90305
+69.65082 162.71777
+69.67831 162.55415
+69.68222 162.36832
+69.65665 162.31444
+69.63222 162.16748
+69.58777 162.08221
+69.53806 162.00748
+99.00000 999.00000
+69.72888 163.87248
+69.68776 163.68332
+69.68414 163.48972
+69.71359 163.32805
+69.70831 163.13638
+99.00000 999.00000
+69.58276 164.95389
+69.58638 164.76665
+69.59665 164.58693
+69.62109 164.42110
+69.66914 164.27888
+69.72055 164.13943
+69.76749 164.01443
+99.00000 999.00000
+69.56943 165.86526
+69.58556 165.69110
+69.58472 165.49664
+69.59082 165.30415
+69.59555 165.11610
+99.00000 999.00000
+69.50832 166.96527
+69.49832 166.79277
+69.51665 166.67860
+69.51721 166.48721
+69.51443 166.30804
+69.51389 166.11194
+99.00000 999.00000
+69.62999 167.97722
+69.68166 167.98415
+99.00000 999.00000
+69.74361 167.88165
+69.77138 167.72305
+69.72748 167.57443
+69.67526 167.46693
+69.62694 167.32971
+69.57721 167.20305
+69.53331 167.02805
+99.00000 999.00000
+69.91554 167.89526
+69.86139 167.79971
+69.80110 167.79527
+69.77388 167.95860
+99.00000 999.00000
+69.16972 168.90776
+69.20360 168.75638
+69.21082 168.57277
+69.21664 168.38805
+69.26277 168.25055
+69.33249 168.22861
+69.40443 168.20139
+69.46722 168.23665
+69.53249 168.25806
+69.58331 168.13193
+69.69081 168.01443
+99.00000 999.00000
+69.92249 168.95749
+69.94943 168.79277
+69.97832 168.63055
+69.99693 168.45526
+99.00000 999.00000
+69.95860 168.00194
+99.00000 999.00000
+69.71527 168.12332
+69.67415 168.26332
+69.64276 168.41331
+69.61748 168.57777
+69.58611 168.73471
+69.56749 168.90694
+99.00000 999.00000
+69.03249 169.40915
+69.09027 169.31055
+69.10138 169.13222
+99.00000 999.00000
+69.82889 169.44943
+69.88306 169.34332
+69.90555 169.17389
+99.00000 999.00000
+69.56998 169.18527
+69.62471 169.27859
+69.69221 169.28389
+69.75777 169.27498
+99.00000 999.00000
+69.93527 170.51944
+69.86249 170.55498
+69.79359 170.55611
+69.73972 170.46165
+69.72472 170.27332
+69.67165 170.17331
+69.60999 170.12389
+69.58888 170.29359
+69.60748 170.50665
+69.55666 170.63748
+69.48248 170.67860
+69.41748 170.73944
+69.35889 170.81998
+69.29166 170.91193
+69.22026 170.92471
+69.16193 170.91888
+99.00000 999.00000
+69.04776 170.95749
+99.00000 999.00000
+69.99472 171.97610
+99.00000 999.00000
+69.07277 171.00555
+69.04277 171.14499
+69.03139 171.01389
+99.00000 999.00000
+69.88971 172.89305
+69.94388 172.77998
+69.97777 172.66998
+69.95888 172.50110
+69.97221 172.32944
+69.99165 172.15414
+99.00000 999.00000
+69.86415 173.97443
+69.86638 173.83498
+69.84526 173.77110
+69.86665 173.68639
+69.91222 173.60277
+69.95248 173.45860
+69.92943 173.23694
+69.87889 173.17749
+69.89998 173.30582
+69.85388 173.44194
+69.79805 173.41693
+69.78082 173.23389
+69.82332 173.22276
+69.85582 173.06694
+99.00000 999.00000
+69.85081 174.90889
+69.85138 174.70444
+69.86055 174.51332
+69.88193 174.34082
+69.88248 174.14915
+99.00000 999.00000
+69.89331 175.99193
+99.00000 999.00000
+69.90027 175.82027
+69.89722 175.61638
+69.86081 175.46832
+69.84639 175.25581
+69.86748 175.21889
+69.88055 175.31721
+69.85416 175.09109
+99.00000 999.00000
+69.64276 176.92915
+69.66498 176.75861
+69.71332 176.62999
+69.74944 176.48138
+69.76999 176.30777
+69.79776 176.28221
+69.85498 176.17915
+69.89276 176.03249
+99.00000 999.00000
+69.49748 177.88026
+69.53471 177.73499
+69.55305 177.61638
+69.57359 177.60081
+69.60304 177.44194
+69.61832 177.26443
+69.62471 177.06721
+99.00000 999.00000
+69.29414 178.91666
+69.27832 178.72388
+69.33472 178.65831
+69.36360 178.68721
+69.35277 178.85555
+69.31972 178.96111
+99.00000 999.00000
+69.38248 178.87360
+69.41943 178.72861
+69.44859 178.57027
+69.47139 178.40527
+69.47388 178.28665
+69.44943 178.18694
+69.47777 178.03581
+99.00000 999.00000
+69.04555 179.65582
+69.10248 179.55194
+69.07721 179.67581
+69.02277 179.78777
+99.00000 999.00000
+69.01694 179.87277
+69.06721 179.75360
+69.11972 179.63777
+69.16360 179.50665
+69.21222 179.38165
+69.26776 179.26999
+69.28860 179.09860
+99.00000 999.00000
+69.01277 196.08859
+69.04944 196.17917
+69.08249 196.28555
+69.11806 196.38110
+69.15776 196.45888
+69.20139 196.52138
+69.24110 196.59972
+69.28444 196.66693
+69.32498 196.74138
+69.37444 196.78000
+69.42249 196.82555
+69.37999 196.80611
+69.33165 196.76305
+69.29721 196.75500
+69.33998 196.82056
+69.38472 196.87971
+69.43889 196.88860
+69.49332 196.89777
+69.53998 196.92860
+69.58582 196.88554
+69.61081 196.91888
+69.64806 196.94556
+69.68721 196.94943
+99.00000 999.00000
+69.74805 196.99055
+99.00000 999.00000
+69.69748 197.06416
+99.00000 999.00000
+69.75471 197.02277
+69.79639 197.08472
+69.83665 197.16360
+69.87027 197.26250
+69.90831 197.35110
+69.94611 197.44026
+69.98944 197.50667
+99.00000 999.00000
+69.99832 214.83388
+99.00000 999.00000
+69.98360 214.99609
+99.00000 999.00000
+69.98055 215.10944
+69.98360 215.17888
+69.97331 215.34389
+99.00000 999.00000
+69.98805 217.39389
+69.97610 217.48109
+69.95471 217.49001
+69.92331 217.57443
+69.88527 217.65639
+69.84860 217.73083
+69.85027 217.88860
+69.80998 217.96333
+99.00000 999.00000
+69.78972 218.04639
+69.79277 218.13388
+69.77248 218.27943
+69.74026 218.38750
+69.70694 218.49083
+69.66277 218.55499
+69.63332 218.67305
+69.66443 218.77222
+69.69110 218.69417
+69.67331 218.84584
+69.64806 218.97888
+99.00000 999.00000
+69.63222 219.10138
+69.63361 219.18388
+69.61276 219.33360
+69.59943 219.51167
+69.59665 219.68776
+69.60860 219.83305
+69.61360 219.98555
+99.00000 999.00000
+70.23860 160.08972
+70.30305 160.09389
+70.37138 160.05556
+99.00000 999.00000
+70.09305 170.95943
+70.09694 170.76471
+70.12054 170.59499
+70.12389 170.41388
+70.09360 170.53888
+70.02972 170.53415
+99.00000 999.00000
+70.00832 171.83305
+70.02832 171.65889
+70.04944 171.48555
+70.06581 171.30582
+70.08081 171.12444
+99.00000 999.00000
+70.80331 178.83498
+70.84610 178.98471
+99.00000 999.00000
+70.92722 178.71138
+70.85999 178.76471
+99.00000 999.00000
+70.87665 179.18805
+70.88081 179.39165
+70.88832 179.60638
+70.92860 179.76805
+70.97722 179.88805
+99.00000 999.00000
+70.99722 180.07027
+70.96609 180.23526
+70.93915 180.40776
+70.91972 180.57777
+70.90776 180.72556
+99.00000 999.00000
+70.96805 181.09833
+70.99165 181.33638
+99.00000 999.00000
+70.01582 197.52055
+70.05443 197.58777
+70.08556 197.65138
+70.12639 197.69360
+70.16026 197.80026
+70.20139 197.87721
+70.24193 197.95667
+99.00000 999.00000
+70.19026 197.97749
+70.15555 197.87917
+99.00000 999.00000
+70.31888 198.10834
+70.28998 198.14333
+70.27998 198.22305
+70.25055 198.27055
+70.25806 198.12167
+70.23305 198.20500
+70.21999 198.14526
+70.17581 198.11555
+99.00000 999.00000
+70.16498 198.02277
+70.17249 198.16360
+70.19221 198.28806
+70.22331 198.32249
+70.25249 198.41443
+70.25526 198.57805
+70.26498 198.73860
+70.29222 198.87222
+70.31055 198.97833
+99.00000 999.00000
+70.29498 199.05417
+70.33415 199.08221
+70.36610 199.19611
+70.40222 199.29666
+70.43555 199.40443
+70.41611 199.28389
+70.38722 199.19638
+70.42082 199.30417
+70.44914 199.43250
+70.48222 199.54305
+70.51860 199.64027
+70.55472 199.73776
+70.59526 199.81917
+70.57582 199.87694
+99.00000 999.00000
+70.51555 199.97861
+70.47972 199.88889
+70.46304 199.86777
+99.00000 999.00000
+70.42499 199.99777
+70.37610 199.95444
+70.33472 199.87805
+70.33693 199.94527
+99.00000 999.00000
+70.62193 199.93584
+70.63055 199.88722
+70.66611 199.98776
+99.00000 999.00000
+70.57693 200.07359
+70.53360 200.08026
+99.00000 999.00000
+70.48444 200.02859
+70.45972 200.02916
+99.00000 999.00000
+70.36722 200.04721
+70.31721 200.07472
+70.27582 200.13277
+70.22665 200.19972
+70.20860 200.22943
+70.25777 200.17638
+70.31526 200.14777
+70.36861 200.13110
+70.42360 200.13167
+70.47305 200.17722
+70.47415 200.23555
+70.47888 200.37305
+70.50972 200.49193
+70.50499 200.59917
+70.53331 200.70305
+70.51694 200.55388
+70.51360 200.42943
+70.49554 200.32359
+70.52666 200.21722
+70.57582 200.14526
+70.62526 200.08110
+99.00000 999.00000
+70.68304 200.04167
+70.70805 200.18417
+70.73972 200.22360
+70.78165 200.30000
+70.81360 200.41360
+70.83693 200.56194
+70.86415 200.69667
+70.87555 200.83388
+70.85777 200.66833
+70.84360 200.73805
+70.83081 200.85805
+70.81110 200.71001
+70.78055 200.58943
+70.75610 200.63443
+70.73721 200.67917
+70.69611 200.76527
+70.72888 200.73972
+70.76360 200.77667
+70.76749 200.93277
+99.00000 999.00000
+70.80972 200.91388
+99.00000 999.00000
+70.78110 201.01334
+70.79498 201.11221
+70.78806 201.27055
+70.79944 201.42805
+70.80222 201.56833
+70.81805 201.61166
+70.84055 201.48027
+70.83305 201.60193
+70.82472 201.76500
+70.82999 201.95555
+99.00000 999.00000
+70.85027 202.09000
+70.87860 202.21333
+70.91249 202.32083
+70.94556 202.43111
+70.97998 202.53693
+99.00000 999.00000
+70.96860 203.94139
+70.94527 203.98639
+70.92722 203.85388
+70.92110 203.92526
+70.89722 203.95416
+99.00000 999.00000
+70.98555 204.18333
+70.97305 204.02443
+99.00000 999.00000
+70.86638 204.04417
+70.81721 204.01416
+70.76054 204.01889
+70.78860 204.08693
+70.83026 204.11917
+70.83916 204.29860
+70.85165 204.34444
+70.83804 204.40500
+70.88277 204.46971
+70.94331 204.48360
+70.98082 204.57693
+99.00000 999.00000
+70.96416 205.36472
+70.90944 205.32889
+70.89249 205.21167
+70.88248 205.28139
+70.85027 205.36749
+70.82721 205.48833
+70.82832 205.66333
+70.79111 205.74777
+70.78665 205.85860
+70.82277 205.95583
+99.00000 999.00000
+70.85748 206.03722
+70.89305 206.13722
+70.89165 206.32333
+70.87915 206.48055
+70.89638 206.62277
+70.92638 206.74110
+70.90610 206.87054
+70.90721 206.97055
+99.00000 999.00000
+70.87860 207.07027
+70.86998 207.16110
+70.85582 207.22417
+70.81055 207.29860
+70.86221 207.33139
+70.88554 207.31221
+70.87805 207.48860
+70.85915 207.63306
+70.83194 207.75806
+70.80222 207.73250
+70.75943 207.65359
+70.72665 207.58804
+70.69388 207.49249
+70.63554 207.52306
+70.60498 207.63527
+70.59471 207.77916
+70.58055 207.92751
+70.58331 207.81055
+70.57860 207.65388
+70.58777 207.49805
+70.56444 207.36972
+70.54332 207.49889
+70.55276 207.64861
+70.55331 207.80138
+70.56194 207.95334
+99.00000 999.00000
+70.56305 208.07193
+70.56055 208.24083
+70.51999 208.21584
+70.50360 208.18721
+70.48721 208.13222
+70.45389 208.02693
+70.43860 208.15222
+70.44556 208.31972
+70.43721 208.49222
+70.42027 208.64139
+70.38609 208.74306
+70.39027 208.80859
+70.44249 208.82001
+70.44498 208.90971
+99.00000 999.00000
+70.45471 209.02333
+70.46860 209.15305
+70.47804 209.24277
+70.50110 209.29222
+70.50444 209.45639
+70.47693 209.54111
+70.46860 209.63333
+70.41638 209.58443
+70.42776 209.70389
+70.43971 209.83777
+70.46222 209.95360
+99.00000 999.00000
+70.48915 210.04584
+70.50665 210.14417
+70.50499 210.24443
+70.50555 210.40277
+70.51582 210.52527
+70.48776 210.59666
+70.50139 210.66917
+70.49081 210.82527
+70.46527 210.95250
+99.00000 999.00000
+70.42860 211.02693
+70.43027 211.11305
+70.41472 211.24609
+70.39861 211.39276
+70.36221 211.48833
+70.31471 211.50526
+70.31694 211.65860
+70.35443 211.75084
+70.34694 211.88777
+70.30498 211.96584
+99.00000 999.00000
+70.29665 212.03084
+70.30165 212.15639
+70.25998 212.20221
+70.22388 212.25250
+70.20749 212.40334
+70.19498 212.56221
+70.18889 212.69221
+70.17888 212.79805
+70.16498 212.94055
+99.00000 999.00000
+70.17749 213.07083
+70.18443 213.15889
+70.18304 213.32889
+70.19443 213.46138
+70.18555 213.60667
+70.17471 213.76527
+70.15305 213.90222
+99.00000 999.00000
+70.15138 214.04834
+70.14972 214.12721
+70.15472 214.18944
+70.11888 214.28583
+70.08582 214.39221
+70.09055 214.43639
+70.05972 214.52916
+70.03055 214.64166
+70.04193 214.77193
+70.00555 214.71359
+99.00000 999.00000
+70.01332 215.48471
+70.03888 215.60527
+70.03998 215.78110
+70.06415 215.90167
+70.00998 215.93527
+70.05194 215.97360
+70.08556 215.99193
+99.00000 999.00000
+70.07222 216.08556
+70.09360 216.19972
+70.08582 216.30833
+70.10304 216.43776
+70.09665 216.49944
+70.10889 216.65138
+70.05443 216.68333
+70.07277 216.69859
+70.11055 216.73694
+70.08722 216.85916
+70.08249 216.98833
+99.00000 999.00000
+70.06749 217.07277
+70.05943 217.17722
+70.02972 217.29472
+99.00000 999.00000
+71.21222 178.86249
+71.16277 178.81888
+71.11415 178.69693
+71.05638 178.62109
+99.00000 999.00000
+71.53415 179.95499
+71.48555 179.84027
+71.45610 179.72055
+71.43359 179.51694
+71.38222 179.40831
+71.33804 179.27805
+71.29305 179.14610
+99.00000 999.00000
+71.58360 180.81139
+71.55804 180.66193
+71.57111 180.46056
+71.57222 180.28722
+71.55804 180.13583
+71.53555 180.05000
+99.00000 999.00000
+71.01389 181.68250
+71.03526 181.90027
+99.00000 999.00000
+71.41914 181.96500
+71.46332 181.91777
+71.48555 181.74388
+71.50388 181.74055
+71.53777 181.58667
+71.56555 181.41083
+71.58388 181.21249
+99.00000 999.00000
+71.06860 182.15776
+71.09749 182.30305
+71.14444 182.42416
+71.19638 182.52888
+71.25581 182.50751
+71.27943 182.39888
+71.31915 182.24971
+71.36722 182.11749
+99.00000 999.00000
+71.00638 202.60249
+71.04193 202.70444
+71.08110 202.79305
+71.12444 202.86806
+71.17055 202.93666
+99.00000 999.00000
+71.24915 203.09084
+71.29193 203.16722
+71.32860 203.26694
+71.35944 203.38722
+71.39389 203.49443
+71.39139 203.58943
+71.38777 203.56526
+71.36916 203.46805
+71.33331 203.43056
+71.29555 203.51666
+71.26164 203.58276
+71.26414 203.76334
+71.24165 203.89861
+71.20415 203.95444
+71.17221 203.92555
+99.00000 999.00000
+71.20248 204.02333
+71.19388 204.10027
+71.19888 204.25471
+71.17694 204.39084
+71.12305 204.44777
+71.07304 204.41472
+71.03722 204.31444
+99.00000 999.00000
+71.00360 204.61276
+71.02859 204.72610
+99.00000 999.00000
+71.03555 204.80888
+71.07527 204.71722
+71.11444 204.79277
+71.08859 204.87721
+71.13026 204.88638
+71.13138 204.96027
+71.07166 204.95526
+71.02277 204.90860
+71.03665 204.98138
+71.09665 204.99500
+99.00000 999.00000
+71.11081 205.05777
+71.10056 205.15500
+71.06471 205.25555
+71.02914 205.35750
+99.00000 999.00000
+30.18694 120.95248
+30.16055 120.90415
+30.13582 120.85471
+30.12138 120.79639
+30.12055 120.72694
+30.12971 120.67165
+30.13081 120.64165
+30.09555 120.68248
+30.09415 120.74972
+30.06610 120.79415
+30.08055 120.74972
+30.08027 120.68110
+30.10471 120.62305
+30.14581 120.59055
+30.19444 120.57082
+30.24472 120.55415
+30.29138 120.53165
+30.31194 120.47498
+30.29248 120.42081
+30.25082 120.38943
+30.21777 120.34693
+30.23748 120.29082
+30.26498 120.24360
+30.22165 120.20972
+30.19527 120.16972
+30.20915 120.16499
+30.24776 120.20305
+30.28722 120.24026
+30.29332 120.29998
+30.29943 120.35277
+30.35388 120.37331
+30.37971 120.42194
+30.39360 120.48110
+30.39415 120.54971
+30.39805 120.61415
+30.38972 120.68472
+30.35722 120.73027
+30.33027 120.78249
+30.34860 120.83165
+30.36805 120.88582
+30.39610 120.89610
+30.42776 120.93888
+30.48305 120.93639
+30.53748 120.96138
+99.00000 999.00000
+30.00277 121.62444
+30.04888 121.60889
+30.08221 121.56472
+30.11860 121.53360
+30.16165 121.50526
+30.19832 121.46582
+30.23331 121.42443
+30.26248 121.37360
+30.28999 121.31998
+30.30331 121.25722
+30.30360 121.18610
+30.28610 121.13055
+30.26305 121.07943
+30.23721 121.03777
+99.00000 999.00000
+30.57639 121.00639
+30.58832 121.06693
+30.59610 121.13081
+30.64082 121.16472
+30.66860 121.21194
+30.68610 121.26777
+30.69971 121.32639
+30.73472 121.36777
+30.77555 121.40443
+30.80665 121.44915
+30.82471 121.50443
+30.84360 121.55943
+30.85277 121.62193
+30.86138 121.68555
+30.85999 121.75694
+30.85110 121.82748
+30.87555 121.87777
+30.93526 121.88889
+30.98915 121.87832
+99.00000 999.00000
+30.04888 121.83331
+30.07748 121.87415
+30.04360 121.90582
+99.00000 999.00000
+30.10555 121.97527
+30.14610 121.97694
+99.00000 999.00000
+30.14165 122.05027
+30.14055 122.09998
+30.11943 122.15472
+30.09444 122.19276
+30.08110 122.24415
+30.06332 122.29027
+30.02305 122.32277
+99.00000 999.00000
+30.00665 122.09998
+30.00360 122.04055
+99.00000 999.00000
+30.47055 122.27110
+30.46748 122.31805
+30.47110 122.36388
+30.45055 122.40555
+30.41248 122.40860
+30.42999 122.35139
+30.42194 122.29221
+30.44860 122.27081
+99.00000 999.00000
+30.51610 130.98831
+30.45721 130.97777
+30.40165 130.97139
+30.37082 130.92998
+30.35498 130.87915
+30.40360 130.86249
+30.46360 130.86832
+30.50665 130.90414
+30.55610 130.93694
+30.61082 130.95055
+30.66222 130.94888
+30.71277 130.96527
+99.00000 999.00000
+30.42776 130.57832
+30.40193 130.63805
+30.36138 130.66832
+30.30415 130.65665
+30.26276 130.61998
+30.23888 130.57027
+30.24026 130.50305
+30.25777 130.43832
+30.30555 130.42027
+30.34721 130.38943
+30.39722 130.38722
+30.41805 130.43915
+30.45748 130.47861
+99.00000 999.00000
+30.82748 131.07138
+30.77444 131.07915
+30.71832 131.07610
+30.66555 131.05722
+30.60972 131.04582
+30.55972 131.01582
+99.00000 999.00000
+30.78249 131.00610
+30.83110 131.03972
+99.00000 999.00000
+30.47915 140.32915
+30.46972 140.30138
+99.00000 999.00000
+31.95693 119.97472
+31.97749 119.91360
+99.00000 999.00000
+31.74498 120.98777
+31.75110 120.92415
+31.75443 120.85415
+31.78055 120.79749
+31.80499 120.73832
+31.85194 120.71555
+31.82471 120.75360
+31.84805 120.77555
+31.89138 120.77305
+31.93415 120.74360
+31.97998 120.71888
+31.99081 120.65443
+31.99165 120.59776
+99.00000 999.00000
+31.96722 120.43165
+31.95248 120.37248
+31.93777 120.31305
+31.91444 120.26138
+31.90082 120.20222
+31.90555 120.12915
+31.92860 120.06693
+31.94610 120.00277
+99.00000 999.00000
+31.96748 120.04555
+31.94389 120.10610
+31.93498 120.18027
+31.94027 120.24776
+31.96443 120.29888
+99.00000 999.00000
+31.99472 120.83998
+31.95527 120.87498
+31.91389 120.90694
+31.88026 120.95139
+31.84055 120.96194
+99.00000 999.00000
+31.01221 121.86665
+31.05415 121.83610
+31.10249 121.81610
+31.14860 121.79221
+31.19331 121.76638
+31.23638 121.73805
+31.27776 121.70638
+31.31248 121.66305
+31.34305 121.61360
+31.36138 121.54415
+31.39055 121.50443
+31.41860 121.45110
+31.45665 121.41389
+31.47888 121.35110
+31.50943 121.30165
+31.55582 121.27832
+31.59665 121.24555
+31.63194 121.20443
+31.65998 121.15082
+31.69331 121.10582
+31.71471 121.04749
+99.00000 999.00000
+31.83055 121.00915
+31.85777 121.05777
+31.84721 121.12222
+31.83722 121.18360
+31.85805 121.23748
+31.86915 121.29971
+31.84832 121.36555
+31.83165 121.43805
+31.80472 121.49332
+31.77139 121.53831
+31.74610 121.59665
+31.71360 121.64332
+31.69638 121.71471
+31.68888 121.78471
+31.67527 121.85860
+31.71082 121.89555
+31.76610 121.88693
+31.81055 121.85915
+31.86277 121.84582
+31.91389 121.83027
+31.95026 121.78915
+31.98777 121.75082
+99.00000 999.00000
+31.37331 121.80331
+31.36305 121.86943
+31.31026 121.87610
+31.29221 121.83027
+31.33638 121.80360
+99.00000 999.00000
+31.81222 121.22527
+31.81776 121.29221
+31.80582 121.35222
+31.78110 121.41138
+31.75165 121.46305
+31.71498 121.47722
+31.67915 121.49026
+31.66305 121.55777
+31.62665 121.58943
+31.60305 121.65027
+31.58888 121.71888
+31.56665 121.77860
+31.54915 121.84555
+31.50639 121.87498
+31.46498 121.83860
+31.45915 121.77832
+31.48415 121.72221
+31.48888 121.68581
+31.51027 121.62610
+31.52805 121.56165
+31.55582 121.50722
+31.58665 121.45860
+31.60527 121.39332
+31.63499 121.34277
+31.66888 121.29860
+31.71249 121.27081
+31.74972 121.23222
+31.78415 121.18915
+99.00000 999.00000
+31.67332 129.68443
+31.72415 129.71222
+31.75110 129.76082
+31.78610 129.78915
+31.73915 129.78943
+31.69749 129.75249
+31.64055 129.72888
+31.64443 129.67749
+99.00000 999.00000
+31.99360 130.17027
+31.95055 130.19888
+31.89944 130.19943
+31.84888 130.19693
+31.81498 130.23222
+31.81026 130.18443
+31.75665 130.18248
+31.72665 130.23444
+31.69027 130.27582
+31.65055 130.31110
+31.60665 130.33748
+31.56443 130.33221
+31.50581 130.32027
+31.44638 130.29971
+31.41360 130.25526
+31.38194 130.21277
+31.41721 130.17360
+31.40832 130.12193
+31.37527 130.16110
+31.33915 130.20332
+31.29555 130.21860
+31.24610 130.23415
+31.25581 130.29443
+31.24360 130.35304
+31.23693 130.42415
+31.22888 130.49248
+31.18415 130.50998
+31.16305 130.55498
+31.17027 130.60081
+31.19943 130.64444
+31.25443 130.66222
+31.28722 130.61581
+31.32027 130.56776
+31.36998 130.55249
+31.41527 130.52748
+31.46722 130.51721
+31.52888 130.53444
+31.58165 130.55998
+31.62389 130.59415
+31.68082 130.61415
+31.71665 130.65665
+31.71498 130.71889
+31.69998 130.78276
+31.65472 130.80693
+31.59805 130.79359
+31.55748 130.75499
+31.58276 130.72026
+31.61943 130.67915
+31.60222 130.62389
+31.56277 130.60582
+31.54332 130.66998
+31.50888 130.69914
+31.46055 130.71722
+31.42305 130.75638
+31.37693 130.77859
+31.32748 130.79359
+31.27193 130.79665
+31.21165 130.78555
+31.15498 130.76138
+31.11138 130.72443
+31.07805 130.68056
+31.02026 130.67444
+99.00000 999.00000
+31.01415 130.71472
+31.04832 130.75806
+31.06443 130.81360
+31.09444 130.86055
+31.11055 130.91611
+31.13693 130.96472
+31.18581 130.99443
+99.00000 999.00000
+31.22082 131.03055
+31.23972 131.08443
+31.26943 131.13110
+31.29443 131.09831
+31.33276 131.08415
+31.34665 131.01498
+31.38915 131.02472
+31.43748 131.05582
+31.45805 131.10889
+31.46332 131.17055
+31.44221 131.21832
+31.39665 131.24110
+31.38443 131.29054
+31.36832 131.33360
+31.41193 131.36276
+31.47193 131.37582
+31.51138 131.38664
+31.54888 131.38332
+31.58638 131.41805
+31.62331 131.44914
+31.68055 131.46138
+31.73499 131.47305
+31.79472 131.49277
+31.83110 131.45082
+31.88055 131.44693
+31.92831 131.46582
+31.98222 131.48555
+99.00000 999.00000
+32.01027 119.86777
+32.07082 119.86860
+32.09998 119.81721
+32.12860 119.76498
+32.18055 119.77915
+32.20693 119.74305
+32.23665 119.69248
+32.19555 119.65582
+32.19943 119.60915
+32.23193 119.65332
+32.28582 119.67860
+32.32860 119.65276
+32.35471 119.62415
+32.33110 119.67831
+32.32055 119.73331
+32.31805 119.79639
+32.28889 119.84776
+32.24555 119.87665
+32.19472 119.89332
+32.18998 119.91915
+32.13248 119.90555
+32.08915 119.93443
+32.05027 119.96165
+32.00943 119.99415
+99.00000 999.00000
+32.01389 120.52693
+32.01805 120.45860
+99.00000 999.00000
+32.00388 120.33694
+32.03277 120.38472
+32.06665 120.42776
+32.09415 120.47610
+32.09860 120.54305
+32.09360 120.60194
+32.07639 120.66555
+32.05722 120.73360
+32.03055 120.78944
+99.00000 999.00000
+32.58722 120.93805
+32.61694 120.88665
+32.64665 120.83527
+32.68526 120.83248
+32.70555 120.83888
+32.71082 120.85610
+32.76527 120.85139
+32.79694 120.87915
+32.84138 120.90638
+32.89526 120.89498
+32.95388 120.89110
+99.00000 999.00000
+32.00332 121.73638
+32.03498 121.68860
+32.06443 121.63693
+32.09082 121.58027
+32.11639 121.52193
+32.11555 121.46665
+32.14360 121.43472
+32.16972 121.39055
+32.21972 121.37193
+32.23943 121.39860
+32.27139 121.41165
+32.32860 121.40777
+32.37943 121.39777
+32.41331 121.35332
+32.44665 121.30805
+32.46665 121.24665
+32.47777 121.18748
+32.50415 121.13915
+32.51610 121.10027
+32.54165 121.04332
+99.00000 999.00000
+32.72498 128.64360
+32.77776 128.64943
+32.76221 128.70139
+32.74944 128.72832
+32.77472 128.76555
+32.79722 128.81139
+32.76693 128.82915
+32.71915 128.84860
+32.68138 128.88805
+32.64332 128.88805
+32.64165 128.82359
+32.63915 128.77165
+32.58665 128.77277
+32.60027 128.72026
+32.59527 128.65944
+32.61860 128.60110
+32.66527 128.62222
+32.64388 128.64331
+32.69193 128.65109
+99.00000 999.00000
+32.95638 129.93832
+32.90332 129.94693
+32.85889 129.97305
+32.83027 129.97556
+32.85831 129.91527
+32.82999 129.87665
+32.83443 129.83777
+32.86581 129.80638
+32.90165 129.79305
+32.92722 129.80859
+32.92055 129.82971
+32.97443 129.82277
+99.00000 999.00000
+32.97805 129.64360
+32.92722 129.64555
+32.88332 129.67276
+32.83443 129.68971
+32.79722 129.72998
+32.80888 129.77609
+32.76888 129.80165
+32.73248 129.82748
+32.71110 129.85971
+32.66415 129.82999
+32.61526 129.79639
+32.58055 129.75276
+32.56776 129.78221
+32.59388 129.83194
+32.63194 129.87332
+32.66805 129.91331
+32.71915 129.94249
+32.73943 129.97943
+99.00000 999.00000
+32.97915 129.11943
+32.99860 129.17415
+32.95139 129.15999
+32.93526 129.10832
+32.87888 129.09248
+32.84248 129.07082
+32.83665 129.05026
+32.89388 129.05859
+32.93110 129.02055
+99.00000 999.00000
+32.35415 129.97081
+32.40388 129.98749
+99.00000 999.00000
+32.24638 129.95526
+32.28194 129.99832
+99.00000 999.00000
+32.75360 130.01721
+32.77527 130.07082
+32.77748 130.13332
+32.77081 130.18443
+32.72276 130.20305
+32.68082 130.16443
+32.65193 130.13416
+32.61055 130.16859
+32.59610 130.19666
+32.61860 130.24889
+32.64360 130.29944
+32.67110 130.34805
+32.72305 130.36748
+32.78222 130.37389
+32.82665 130.34805
+32.86555 130.30943
+32.86248 130.24332
+32.83498 130.19472
+32.83527 130.13026
+32.86972 130.10304
+32.89138 130.15610
+32.92860 130.19832
+32.97248 130.21111
+99.00000 999.00000
+32.98582 130.42555
+32.93055 130.43082
+32.89722 130.47472
+32.86055 130.51639
+32.82888 130.56581
+32.79138 130.60555
+32.73972 130.59389
+32.69998 130.62694
+99.00000 999.00000
+32.68748 130.56110
+32.66082 130.51164
+32.63610 130.46111
+32.61943 130.48082
+32.62638 130.54388
+32.63360 130.60693
+32.64415 130.66331
+32.59888 130.62944
+32.55943 130.58888
+32.52610 130.56998
+32.50138 130.57777
+32.47027 130.56805
+32.42055 130.55110
+32.38110 130.51054
+32.32999 130.51082
+32.34998 130.46582
+32.29581 130.46277
+32.25471 130.42389
+32.21498 130.38693
+32.16805 130.35472
+32.13026 130.32693
+32.09499 130.28638
+32.12527 130.24361
+32.10527 130.18999
+32.06194 130.19722
+32.01305 130.16360
+99.00000 999.00000
+32.47971 130.26915
+32.50805 130.31721
+32.51943 130.37471
+32.51360 130.42749
+32.51193 130.45694
+32.46498 130.42194
+32.40915 130.39276
+32.37444 130.35472
+32.41693 130.33888
+32.40610 130.28249
+32.40305 130.23055
+32.44805 130.21248
+99.00000 999.00000
+32.20638 130.10999
+32.20693 130.15443
+32.17693 130.19556
+32.12998 130.17027
+32.12165 130.12582
+32.17415 130.11638
+99.00000 999.00000
+32.45610 130.01610
+32.50722 130.02222
+32.52721 130.02306
+32.52388 130.07166
+32.53915 130.12415
+32.53165 130.17915
+32.48360 130.19859
+32.42582 130.19556
+32.37610 130.21111
+32.32305 130.19666
+32.30110 130.15498
+32.25805 130.12138
+32.22276 130.07832
+32.19498 130.02998
+99.00000 999.00000
+32.28915 130.03389
+32.30527 130.03610
+99.00000 999.00000
+32.46388 131.66693
+32.46610 131.71388
+32.50805 131.71638
+32.53305 131.68332
+32.58193 131.69748
+32.59721 131.75055
+32.64888 131.76805
+32.68082 131.81389
+32.69805 131.84943
+32.74582 131.87389
+32.77998 131.90222
+32.78415 131.95193
+32.81110 131.99860
+99.00000 999.00000
+32.82748 131.95221
+32.86221 131.99638
+99.00000 999.00000
+32.94110 131.95581
+32.97055 131.90109
+99.00000 999.00000
+32.01415 131.51109
+32.07555 131.52306
+32.13943 131.54193
+32.18332 131.54831
+32.23638 131.57304
+32.28722 131.59389
+32.32610 131.61748
+32.37805 131.62639
+32.41777 131.66777
+99.00000 999.00000
+32.91389 132.03249
+32.93305 132.06276
+32.92610 132.00806
+99.00000 999.00000
+32.84748 132.96832
+32.79971 132.96748
+99.00000 999.00000
+32.71194 132.98749
+32.75082 132.95665
+32.77415 132.89832
+32.77248 132.86581
+32.74081 132.81972
+32.74776 132.75221
+32.78055 132.70888
+32.75832 132.65665
+32.78277 132.64139
+32.83389 132.66138
+32.87082 132.70415
+32.90110 132.69611
+32.90665 132.63943
+32.91721 132.59193
+32.92081 132.56805
+32.91748 132.52306
+32.88805 132.51639
+32.92415 132.48027
+32.96110 132.48665
+32.99443 132.49248
+99.00000 999.00000
+32.95582 133.00610
+32.90165 133.01164
+99.00000 999.00000
+32.76360 133.01109
+32.71388 133.02527
+99.00000 999.00000
+33.01722 120.89332
+33.01693 120.83832
+33.06165 120.81582
+33.10638 120.79332
+33.15110 120.79248
+33.18472 120.74748
+33.22305 120.74055
+33.26472 120.75193
+33.28498 120.70248
+33.32082 120.66555
+33.37555 120.65472
+33.42999 120.64388
+33.47860 120.62360
+33.50832 120.58694
+33.55055 120.55610
+33.59638 120.53082
+33.63388 120.49222
+33.66721 120.50694
+33.72832 120.50581
+33.76777 120.46999
+33.80943 120.44805
+33.85222 120.41805
+33.89138 120.41165
+33.94331 120.39693
+33.99194 120.37638
+99.00000 999.00000
+33.52415 126.87082
+33.50055 126.91693
+33.46665 126.94555
+33.44027 126.93332
+33.38776 126.91582
+33.34638 126.87722
+33.30638 126.83749
+33.29082 126.77943
+33.27026 126.72527
+33.25777 126.66472
+33.23693 126.61055
+33.23138 126.54498
+33.22138 126.48248
+33.23472 126.42471
+33.22639 126.36082
+33.21305 126.30527
+33.19693 126.25610
+33.22943 126.20721
+33.26665 126.16721
+33.31831 126.16110
+33.36332 126.19665
+33.39249 126.24443
+33.43082 126.28498
+33.45582 126.33610
+33.47665 126.39055
+33.48665 126.44943
+33.50832 126.50388
+33.51472 126.56915
+33.52972 126.62805
+33.53999 126.68915
+33.54639 126.75415
+33.55055 126.82138
+99.00000 999.00000
+33.44360 129.98027
+33.47581 129.94777
+33.51749 129.94832
+33.53110 129.89748
+33.51777 129.85889
+33.46638 129.85693
+33.43998 129.84555
+33.46305 129.80832
+33.42277 129.81415
+33.39722 129.86693
+33.35305 129.86110
+33.29749 129.84164
+33.29193 129.82359
+33.33832 129.80165
+33.35638 129.77081
+33.33832 129.71638
+33.37610 129.68805
+33.35693 129.63832
+33.35972 129.58139
+33.30527 129.57359
+33.26055 129.58081
+33.20721 129.56389
+33.19305 129.62082
+33.16805 129.65359
+33.12748 129.68860
+33.10194 129.67415
+33.13388 129.70943
+33.11888 129.73665
+33.11110 129.76694
+33.07332 129.74110
+33.05665 129.78499
+33.04860 129.82639
+33.04694 129.86194
+33.01888 129.91611
+99.00000 999.00000
+33.04472 129.76332
+33.06776 129.72665
+33.06415 129.67555
+33.00639 129.65915
+99.00000 999.00000
+33.79248 129.79222
+33.76276 129.79414
+33.72943 129.77361
+33.69915 129.72638
+33.73472 129.69139
+33.75915 129.66666
+33.78415 129.67776
+33.83389 129.68776
+33.84832 129.72581
+33.82526 129.77443
+99.00000 999.00000
+33.28055 129.51971
+33.23748 129.50499
+33.19610 129.46609
+33.17139 129.41498
+33.17471 129.36444
+33.19221 129.40138
+33.21888 129.42915
+33.26582 129.42139
+33.30638 129.44748
+33.33998 129.48944
+33.35277 129.52165
+33.37582 129.54222
+33.37805 129.56972
+33.32471 129.55276
+99.00000 999.00000
+33.06110 129.11943
+33.00110 129.09943
+99.00000 999.00000
+33.00388 129.07277
+33.05888 129.08804
+33.10582 129.10081
+33.12860 129.11888
+33.07748 129.12694
+99.00000 999.00000
+33.79305 130.97916
+33.82748 130.96999
+33.88110 130.98222
+99.00000 999.00000
+33.93777 130.96472
+33.89332 130.92694
+33.88582 130.86610
+33.91055 130.82277
+33.91110 130.76471
+33.93639 130.70389
+33.90555 130.65694
+33.87193 130.61331
+33.88139 130.54582
+33.84582 130.50331
+33.81388 130.46805
+33.77193 130.45915
+33.72110 130.45639
+33.69193 130.40831
+33.66444 130.35889
+33.63972 130.35304
+33.66472 130.40414
+33.62055 130.41193
+33.58527 130.36806
+33.57805 130.30443
+33.60388 130.26555
+33.64471 130.23248
+33.62777 130.19081
+33.59499 130.14943
+33.57388 130.09555
+33.54110 130.11472
+33.53805 130.16914
+33.50860 130.12109
+33.49081 130.06638
+33.44777 130.02805
+99.00000 999.00000
+33.02582 130.17860
+33.06693 130.14471
+33.10999 130.11581
+33.11415 130.15915
+33.15555 130.19443
+33.18360 130.24165
+33.15749 130.28610
+33.13665 130.34164
+33.10610 130.37694
+33.08221 130.41693
+33.03305 130.42389
+99.00000 999.00000
+33.98027 130.98444
+33.95055 130.93639
+33.91805 130.89722
+33.94693 130.90054
+99.00000 999.00000
+33.06498 131.98999
+33.08110 131.94943
+33.06944 131.90582
+33.08555 131.87999
+33.12222 131.90248
+33.11138 131.84555
+33.13943 131.83055
+33.18222 131.86777
+33.22943 131.89027
+33.25388 131.87498
+33.23360 131.82082
+33.23582 131.75139
+33.25639 131.68721
+33.24831 131.62471
+33.25027 131.55556
+33.28638 131.51193
+33.33777 131.50082
+33.34165 131.55138
+33.36277 131.60416
+33.38998 131.63722
+33.41860 131.66415
+33.42305 131.70888
+33.48055 131.72943
+33.54277 131.74138
+33.58832 131.71693
+33.62415 131.69249
+33.65971 131.64748
+33.67999 131.58998
+33.66972 131.53693
+33.64055 131.49026
+33.58860 131.45749
+33.56498 131.40472
+33.56693 131.33777
+33.57110 131.26805
+33.59555 131.21416
+33.60831 131.15082
+33.61998 131.08777
+33.66331 131.05914
+33.70443 131.02638
+33.75082 131.00388
+99.00000 999.00000
+33.90943 131.97998
+33.94472 131.93694
+33.97555 131.88165
+99.00000 999.00000
+33.98998 131.82805
+33.96110 131.80804
+33.98027 131.77582
+99.00000 999.00000
+33.97971 131.58026
+33.99498 131.52777
+99.00000 999.00000
+33.97665 131.43889
+33.97694 131.40248
+99.00000 999.00000
+33.97888 131.34888
+33.94110 131.30777
+33.91888 131.25444
+33.94943 131.21555
+33.93832 131.16777
+33.98415 131.14415
+99.00000 999.00000
+33.01221 132.48471
+33.03138 132.44360
+33.05027 132.43359
+33.06498 132.47665
+33.10388 132.45860
+33.12582 132.48860
+33.14498 132.43776
+33.16610 132.44748
+33.18248 132.40277
+33.18332 132.40472
+33.17638 132.46472
+33.19582 132.51193
+33.24722 132.52748
+33.25665 132.47804
+33.28748 132.50998
+33.29722 132.47249
+33.29082 132.41055
+33.32665 132.37831
+33.36388 132.41693
+33.38055 132.38609
+33.42360 132.39082
+33.44777 132.39305
+33.45472 132.35443
+33.45610 132.31694
+33.42944 132.26971
+33.40694 132.21693
+33.38026 132.16722
+33.34915 132.12054
+33.36722 132.08665
+33.33665 132.03915
+33.35471 132.04332
+33.38499 132.09082
+33.40193 132.14581
+33.42222 132.17694
+33.44165 132.22777
+33.46915 132.27443
+33.48638 132.33026
+33.51472 132.37999
+33.54749 132.42581
+33.59222 132.46359
+33.61972 132.51305
+33.63776 132.56860
+33.66193 132.62054
+33.70055 132.66249
+33.75222 132.69582
+33.81139 132.70110
+33.86610 132.70499
+33.89138 132.75471
+33.95277 132.77498
+99.00000 999.00000
+33.95776 132.18582
+33.94498 132.14055
+33.89888 132.13361
+33.85249 132.15555
+33.81915 132.12082
+33.78638 132.07498
+33.78305 132.03915
+33.82193 132.07138
+33.84082 132.10889
+33.88165 132.07555
+33.89722 132.01443
+99.00000 999.00000
+33.77360 132.27026
+33.76472 132.23082
+33.79193 132.19194
+99.00000 999.00000
+33.89999 132.42831
+33.87638 132.37999
+33.84582 132.35582
+33.87472 132.32527
+33.85722 132.27859
+33.85388 132.21527
+33.89722 132.18721
+33.94331 132.20805
+33.93998 132.27138
+33.91193 132.31444
+33.90527 132.35860
+33.93138 132.40915
+33.93665 132.46693
+33.89639 132.42888
+99.00000 999.00000
+33.43360 133.95943
+33.47415 133.92499
+33.49139 133.85332
+33.50000 133.78581
+33.51665 133.72388
+33.51472 133.65749
+33.50138 133.59888
+33.46777 133.55305
+33.44749 133.49889
+33.42471 133.45164
+33.39193 133.41914
+33.38472 133.35944
+33.34610 133.32138
+33.36415 133.28249
+33.31889 133.24748
+33.26943 133.26248
+33.21777 133.25331
+33.17194 133.21748
+33.14610 133.21027
+33.12360 133.16611
+33.07471 133.13081
+33.02360 133.10805
+33.02277 133.04805
+99.00000 999.00000
+33.98165 133.05972
+33.93943 133.09055
+33.91222 133.14943
+33.92471 133.20888
+33.95472 133.25693
+33.97581 133.29860
+33.98082 133.34415
+33.97665 133.39194
+33.96915 133.46472
+33.96610 133.53444
+99.00000 999.00000
+33.99026 134.60081
+33.97777 134.65054
+33.93888 134.68915
+33.88748 134.69221
+33.85277 134.64861
+33.84555 134.69110
+33.82305 134.68527
+33.82915 134.74722
+33.80138 134.70972
+33.78165 134.65498
+33.75777 134.60332
+33.72749 134.55804
+33.69027 134.51471
+33.66277 134.46527
+33.63860 134.41331
+33.60638 134.38165
+33.55943 134.35138
+33.53222 134.31194
+33.49527 134.27859
+33.44248 134.24527
+33.37915 134.21915
+33.31527 134.19972
+33.25694 134.19443
+33.26221 134.15889
+33.29277 134.10693
+33.33138 134.06860
+33.37444 134.03943
+99.00000 999.00000
+33.64665 135.97194
+33.60360 135.94139
+33.58165 135.96555
+33.54639 135.92221
+33.51888 135.87389
+33.49722 135.82082
+33.45388 135.79277
+33.43722 135.75943
+33.46582 135.72804
+33.48638 135.66222
+33.49555 135.59389
+33.51610 135.52609
+33.53777 135.46582
+33.57027 135.41222
+33.61610 135.38998
+33.65027 135.34027
+33.67665 135.36249
+33.70889 135.39331
+33.73665 135.33748
+33.76610 135.27998
+33.79360 135.22804
+33.81972 135.18332
+33.86332 135.15555
+33.87555 135.09694
+33.89277 135.07248
+33.92722 135.09222
+33.96055 135.08722
+33.98943 135.12610
+99.00000 999.00000
+33.97527 136.27609
+33.97998 136.23721
+33.96055 136.21304
+33.93860 136.21056
+33.91360 136.17526
+33.88805 136.13361
+33.85415 136.08777
+33.80082 136.05666
+33.73693 136.03221
+33.69110 136.00055
+99.00000 999.00000
+33.11332 139.81082
+33.09305 139.87027
+33.04639 139.84305
+33.05248 139.78638
+33.09415 139.75389
+33.14193 139.74805
+99.00000 999.00000
+33.86665 139.62498
+33.83415 139.59749
+33.88499 139.59610
+99.00000 999.00000
+34.42722 119.99249
+34.45248 119.93305
+34.45831 119.86388
+34.47305 119.79110
+34.50888 119.74889
+34.52776 119.68110
+34.55415 119.61665
+99.00000 999.00000
+34.58749 119.56776
+34.62082 119.52110
+34.65777 119.48165
+34.69444 119.47248
+34.73777 119.45443
+34.75000 119.38610
+34.76860 119.33443
+34.74889 119.27721
+34.74805 119.21693
+34.71888 119.19082
+34.75748 119.19193
+34.80638 119.19082
+34.85139 119.16331
+34.89999 119.19305
+34.96055 119.19610
+99.00000 999.00000
+34.01443 120.37305
+34.06194 120.35055
+34.11749 120.34138
+34.16805 120.32360
+34.20972 120.29055
+34.25665 120.26693
+34.30998 120.25388
+34.33221 120.18943
+34.35748 120.12998
+34.38165 120.06889
+34.41331 120.01971
+99.00000 999.00000
+34.75471 125.94527
+34.71693 125.91193
+34.76389 125.89388
+34.77582 125.95582
+99.00000 999.00000
+34.64860 125.96360
+34.68082 125.91555
+34.71277 125.95610
+34.70748 125.99443
+99.00000 999.00000
+34.97082 126.34582
+34.95360 126.31055
+34.91943 126.33805
+34.95139 126.37472
+34.98360 126.39360
+34.96277 126.42722
+34.92498 126.40221
+34.88889 126.42055
+34.84388 126.41582
+34.80499 126.37472
+34.78944 126.40971
+34.79888 126.45248
+34.79694 126.49527
+34.77888 126.51498
+34.83527 126.53526
+34.88415 126.53860
+34.89277 126.58555
+34.84165 126.57165
+34.81860 126.61665
+34.80527 126.64972
+34.77943 126.61581
+34.79694 126.55444
+34.75471 126.53082
+34.75415 126.48998
+34.75498 126.43360
+34.74222 126.37389
+34.73277 126.41389
+34.72498 126.47694
+34.69193 126.52638
+34.65360 126.56472
+34.62415 126.62027
+34.62777 126.55693
+34.61694 126.54110
+34.63527 126.47998
+34.67360 126.45277
+34.69444 126.40971
+34.65971 126.38831
+34.63721 126.42139
+34.60139 126.45360
+34.57888 126.44415
+34.60139 126.38582
+34.64138 126.35915
+34.68888 126.34915
+34.73472 126.32832
+34.72860 126.28582
+34.67081 126.26527
+34.62444 126.28889
+34.60748 126.30082
+34.56805 126.31277
+34.56638 126.35831
+34.53082 126.38889
+34.53526 126.43526
+34.55472 126.48721
+34.56555 126.53693
+34.52444 126.51888
+34.50832 126.50165
+34.47332 126.46194
+34.44998 126.47665
+34.41805 126.51582
+34.38110 126.49472
+34.34277 126.49305
+34.31026 126.52248
+34.29777 126.55138
+34.31222 126.60249
+34.36415 126.62360
+34.40638 126.65749
+34.43443 126.69693
+34.45026 126.70721
+34.47221 126.75138
+34.50888 126.73415
+34.53777 126.76027
+34.58555 126.77748
+34.54694 126.80444
+34.48610 126.80027
+34.44082 126.82526
+34.41555 126.88443
+34.45165 126.90193
+34.46110 126.94415
+34.50415 126.95943
+34.54888 126.98805
+99.00000 999.00000
+34.90971 126.09444
+34.85915 126.07415
+34.86165 126.01915
+99.00000 999.00000
+34.90527 126.02610
+34.92305 126.07526
+99.00000 999.00000
+34.49388 126.37998
+34.44165 126.36777
+34.40472 126.33138
+34.39722 126.30582
+34.36972 126.25639
+34.35332 126.19915
+34.36694 126.14305
+34.39999 126.13026
+34.39193 126.10388
+34.43581 126.12222
+34.46194 126.16721
+34.50193 126.19998
+34.50805 126.24498
+34.54915 126.26722
+34.56998 126.25860
+34.53805 126.30915
+34.53138 126.34998
+34.49165 126.38110
+99.00000 999.00000
+34.61443 127.01305
+34.63748 127.06610
+34.66472 127.11639
+34.68222 127.17249
+34.71360 127.21777
+34.75999 127.24610
+34.72332 127.28831
+34.73777 127.33832
+34.68748 127.34972
+34.65027 127.30888
+34.69472 127.28805
+34.66972 127.24222
+34.62305 127.25805
+34.56944 127.24222
+34.58415 127.19860
+34.63305 127.20165
+34.58582 127.17110
+34.55499 127.12527
+34.51610 127.15360
+34.53388 127.19943
+34.52081 127.23915
+34.49081 127.28471
+34.44832 127.31305
+34.45193 127.33138
+34.46999 127.38332
+34.51055 127.41888
+34.54165 127.40221
+34.55832 127.35555
+34.58971 127.36694
+34.57972 127.42165
+34.57138 127.48444
+34.60555 127.50777
+34.62748 127.45582
+34.64498 127.48055
+34.67693 127.42944
+34.71305 127.38889
+34.75443 127.38998
+34.77499 127.36443
+34.79305 127.42165
+34.81776 127.36165
+34.82027 127.42415
+34.83248 127.48582
+34.87998 127.51055
+34.84193 127.52693
+34.79832 127.54443
+34.76305 127.57193
+34.72193 127.56665
+34.66193 127.55415
+34.63638 127.60165
+34.62888 127.64138
+34.67415 127.63248
+34.71888 127.64665
+34.71777 127.68998
+34.72749 127.74776
+34.78138 127.75860
+34.83805 127.77388
+34.84165 127.71722
+34.81388 127.66748
+34.83722 127.61555
+34.87915 127.58360
+34.92527 127.57748
+34.91888 127.61221
+34.90888 127.66527
+34.93665 127.71498
+34.98305 127.71972
+34.95776 127.75860
+34.94582 127.81998
+34.94027 127.86388
+34.96305 127.91777
+99.00000 999.00000
+34.98444 127.94472
+34.97971 127.98721
+99.00000 999.00000
+34.45332 127.24415
+34.41943 127.19915
+34.42027 127.13360
+34.46027 127.11138
+34.47443 127.16499
+34.48360 127.22276
+99.00000 999.00000
+34.50222 127.78665
+34.48360 127.77527
+34.51360 127.73165
+34.53889 127.74139
+99.00000 999.00000
+34.63805 127.81055
+34.58165 127.80665
+34.59388 127.75360
+34.63998 127.73693
+34.68248 127.76971
+34.71693 127.78055
+34.67498 127.78693
+99.00000 999.00000
+34.90998 127.93222
+34.86388 127.90777
+34.82277 127.94221
+34.81026 127.98138
+99.00000 999.00000
+34.70472 127.96777
+34.75555 127.95360
+34.73555 127.91472
+34.71693 127.86665
+34.76443 127.86193
+34.80832 127.83443
+34.86082 127.82999
+34.90527 127.86443
+34.92999 127.91527
+99.00000 999.00000
+34.98305 128.05556
+34.93388 128.05443
+34.91832 128.11638
+34.88776 128.14526
+34.89443 128.20665
+34.93415 128.23471
+34.90138 128.27777
+34.93581 128.31831
+34.92110 128.34888
+34.89555 128.32166
+34.86555 128.36081
+34.86082 128.41805
+34.83360 128.40305
+34.85249 128.45415
+34.89915 128.45721
+34.90332 128.43582
+34.96027 128.44527
+34.98360 128.44081
+34.99831 128.50026
+99.00000 999.00000
+34.80832 128.06915
+34.75526 128.06526
+34.70638 128.06248
+34.70805 128.02026
+99.00000 999.00000
+34.92027 128.73222
+34.87389 128.72722
+34.86082 128.74527
+34.82693 128.71693
+34.78165 128.74193
+34.80138 128.68665
+34.76082 128.65555
+34.72415 128.68555
+34.70721 128.62915
+34.71138 128.59389
+34.74555 128.59943
+34.75443 128.56444
+34.78471 128.58998
+34.83498 128.59776
+34.82443 128.55165
+34.82277 128.51360
+34.86888 128.49055
+34.90138 128.53415
+34.90610 128.58527
+34.88693 128.64360
+34.92498 128.60664
+34.95248 128.64110
+34.98082 128.69055
+99.00000 999.00000
+34.68526 129.47388
+34.64639 129.49805
+34.61305 129.47472
+34.59665 129.47415
+34.54110 129.47832
+34.49139 129.44472
+34.45222 129.40332
+34.40415 129.37831
+34.38332 129.39888
+34.33610 129.38443
+34.29665 129.35277
+34.31944 129.32193
+34.33582 129.35748
+34.34110 129.33139
+34.37498 129.32498
+34.34138 129.28860
+34.35665 129.24527
+34.39277 129.27638
+34.42999 129.30222
+34.44555 129.29222
+34.49860 129.30388
+34.53277 129.33081
+34.56860 129.30582
+34.62888 129.33165
+34.62860 129.38498
+34.66777 129.42665
+34.68472 129.47305
+99.00000 999.00000
+34.20222 129.31471
+34.14805 129.30443
+34.10332 129.27026
+34.07360 129.22221
+34.10388 129.18359
+34.16165 129.18332
+34.21999 129.19998
+34.27860 129.20471
+34.31889 129.22972
+34.29443 129.26414
+34.28972 129.30888
+34.27998 129.34943
+99.00000 999.00000
+34.03777 130.90694
+34.07722 130.87248
+34.12638 130.87248
+34.15971 130.91805
+34.20748 130.91081
+34.25415 130.88914
+34.29888 130.88248
+34.34972 130.90054
+34.35722 130.95610
+99.00000 999.00000
+34.39138 130.98749
+34.38998 130.93443
+34.42693 130.97081
+99.00000 999.00000
+34.00332 131.80804
+34.03526 131.79498
+34.05027 131.73444
+34.03889 131.67389
+34.01722 131.62138
+34.01610 131.58804
+99.00000 999.00000
+34.02444 131.49388
+34.00277 131.45805
+99.00000 999.00000
+34.00777 131.11249
+34.03471 131.05249
+34.01443 131.00305
+99.00000 999.00000
+34.40555 131.01471
+34.41915 131.07443
+34.39639 131.12888
+34.36694 131.17027
+34.41193 131.16638
+34.42915 131.21944
+34.41055 131.26414
+34.40332 131.21527
+34.37832 131.22748
+34.37722 131.28998
+34.40276 131.34138
+34.41721 131.40027
+34.44943 131.40138
+34.47998 131.44914
+34.52610 131.46860
+34.54860 131.52081
+34.59721 131.55194
+34.62082 131.58943
+34.65582 131.62305
+34.66248 131.68082
+34.67194 131.73222
+34.68498 131.79222
+34.70443 131.84776
+34.74665 131.88472
+34.77693 131.93304
+34.81110 131.97777
+99.00000 999.00000
+34.00888 132.81082
+34.03638 132.86055
+34.05860 132.91388
+34.09721 132.91331
+34.11694 132.92694
+34.10831 132.96971
+99.00000 999.00000
+34.31721 132.98944
+34.31831 132.92055
+34.29443 132.86832
+34.30860 132.82304
+34.27165 132.78665
+34.24194 132.77722
+34.22665 132.72194
+34.20776 132.67165
+34.20499 132.61638
+34.18943 132.57056
+34.21915 132.56415
+34.25471 132.52110
+34.30165 132.50276
+34.33998 132.52914
+34.34748 132.47194
+34.35693 132.42139
+34.35610 132.36249
+34.32581 132.31444
+34.28665 132.27388
+34.24638 132.23222
+34.19638 132.23193
+34.14277 132.23831
+34.09998 132.20055
+34.04722 132.20360
+99.00000 999.00000
+34.86832 132.04472
+34.91138 132.08139
+34.94860 132.12498
+34.97777 132.17389
+99.00000 999.00000
+34.15110 132.53915
+34.10805 132.55331
+34.08665 132.57304
+34.07943 132.53831
+34.07639 132.47748
+34.10665 132.48444
+34.14526 132.49944
+34.18165 132.53638
+99.00000 999.00000
+34.06415 133.00610
+34.02277 133.03915
+99.00000 999.00000
+34.01777 133.58194
+34.05276 133.62665
+34.11248 133.64165
+34.17027 133.64555
+34.21138 133.61194
+34.24527 133.56221
+34.23527 133.61499
+34.21638 133.66554
+34.24081 133.71748
+34.27776 133.76054
+34.30138 133.81305
+34.32222 133.86722
+34.36749 133.90277
+34.36888 133.96165
+99.00000 999.00000
+34.60527 133.98944
+34.58443 133.93498
+34.55248 133.94666
+34.58638 133.99248
+99.00000 999.00000
+34.50277 133.96832
+34.45110 133.93832
+34.45915 133.87332
+34.44971 133.81694
+34.44165 133.78665
+34.49026 133.76944
+34.51722 133.72443
+34.51276 133.66805
+34.48748 133.61665
+34.45972 133.57414
+34.43888 133.51915
+34.42360 133.46527
+34.45499 133.50722
+34.48832 133.49248
+34.47055 133.43610
+34.43055 133.41498
+34.38443 133.37999
+34.34972 133.34665
+34.32332 133.29610
+34.33888 133.27582
+34.36749 133.31499
+34.37777 133.25610
+34.41888 133.26971
+34.39388 133.23444
+34.34832 133.20360
+34.32193 133.20499
+34.27527 133.18665
+34.27610 133.13443
+34.24915 133.08360
+34.28972 133.06860
+34.32193 133.09499
+34.31860 133.11499
+34.34832 133.14276
+34.36193 133.15915
+34.38110 133.10582
+34.34888 133.08221
+34.32110 133.03471
+99.00000 999.00000
+34.06805 134.60472
+34.01248 134.59999
+99.00000 999.00000
+34.34748 134.05443
+34.37027 134.09805
+34.38527 134.12888
+34.35027 134.15860
+34.32999 134.19081
+34.34110 134.22861
+34.31194 134.26555
+34.27277 134.29805
+34.24305 134.35777
+34.23027 134.40944
+34.20026 134.46555
+34.21805 134.52222
+34.22639 134.58443
+34.21305 134.60248
+34.22082 134.63277
+34.19276 134.63998
+34.17055 134.62999
+34.12638 134.61665
+99.00000 999.00000
+34.63165 134.98027
+34.66082 134.92027
+34.69527 134.87082
+34.72498 134.81082
+34.75665 134.76248
+34.77499 134.68665
+34.77110 134.62109
+34.76110 134.56499
+34.75694 134.50499
+34.77444 134.47331
+34.73610 134.43694
+34.73360 134.38527
+34.71498 134.34581
+34.70388 134.30527
+34.72165 134.23915
+34.70693 134.23389
+34.68915 134.24944
+34.65193 134.20581
+34.62971 134.15776
+34.61581 134.17471
+34.58472 134.12721
+34.57999 134.06888
+34.60610 134.01639
+99.00000 999.00000
+34.58165 134.04472
+34.54248 134.01193
+99.00000 999.00000
+34.50443 134.98915
+34.46305 134.94804
+34.41805 134.90915
+34.35610 134.89499
+34.31194 134.92165
+34.26915 134.95164
+34.24081 134.90248
+34.22055 134.84721
+34.19415 134.79665
+34.19360 134.73749
+34.24472 134.72638
+34.23998 134.67249
+34.29110 134.66388
+34.31610 134.71555
+34.36610 134.75110
+34.41805 134.78610
+34.45776 134.82832
+34.50165 134.86777
+34.52832 134.91859
+34.56693 134.96138
+99.00000 999.00000
+34.04221 135.14777
+34.06610 135.09222
+34.10748 135.13332
+34.13110 135.17471
+34.16193 135.17389
+34.20165 135.14221
+34.24249 135.10805
+34.27582 135.06915
+34.31388 135.10915
+34.32999 135.16554
+34.34776 135.22194
+34.37582 135.27138
+34.41110 135.31665
+34.44693 135.36221
+34.49805 135.39305
+34.53055 135.43999
+34.58472 135.45444
+34.63582 135.45164
+34.67915 135.42276
+34.68998 135.37277
+34.71638 135.32138
+34.69498 135.26694
+34.67471 135.21222
+34.64360 135.17389
+34.63165 135.11499
+34.61749 135.05638
+99.00000 999.00000
+34.80389 136.99472
+34.85277 136.97943
+34.91082 136.98581
+34.87888 136.95665
+34.82805 136.92471
+34.77026 136.91859
+34.72915 136.95305
+34.68248 136.97360
+34.70582 136.90971
+34.73832 136.85472
+34.79498 136.86221
+34.84222 136.85056
+34.88665 136.82472
+34.94498 136.83194
+34.98915 136.87193
+99.00000 999.00000
+34.97498 136.65388
+34.92110 136.65498
+34.86082 136.64249
+34.81388 136.60332
+34.77388 136.56055
+34.72305 136.52859
+34.66693 136.52443
+34.61832 136.53831
+34.58915 136.58194
+34.57693 136.64581
+34.54332 136.69472
+34.51082 136.74971
+34.48721 136.80972
+34.47276 136.86305
+34.42915 136.89082
+34.40555 136.92165
+34.38081 136.88306
+34.34638 136.90414
+34.30165 136.88998
+34.26110 136.88248
+34.24222 136.82721
+34.26860 136.77361
+34.25915 136.83832
+34.28110 136.85498
+34.30972 136.81221
+34.30165 136.77415
+34.28889 136.71498
+34.31748 136.71748
+34.33331 136.68359
+34.30805 136.66582
+34.27527 136.62971
+34.26749 136.58194
+34.26027 136.54388
+34.24194 136.50555
+34.22581 136.47777
+34.21222 136.42998
+34.19276 136.37971
+34.17415 136.32805
+34.13222 136.29027
+34.08722 136.31276
+34.09582 136.26222
+34.07332 136.22249
+34.03972 136.25276
+33.98333 135.98334
+99.00000 999.00000
+34.65193 137.93582
+34.63972 137.87610
+34.63388 137.81276
+34.64249 137.74554
+34.65360 137.67110
+34.66888 137.60222
+34.66277 137.54166
+34.65498 137.47943
+99.00000 999.00000
+34.64805 137.40860
+34.64027 137.34639
+34.62444 137.28806
+34.60693 137.23164
+34.58832 137.17610
+34.57249 137.11861
+34.56776 137.05443
+34.59305 137.03499
+34.63998 137.06998
+34.61805 137.12109
+34.65082 137.16554
+34.66943 137.22139
+34.69331 137.27388
+34.70555 137.33331
+34.73444 137.32472
+34.78165 137.30804
+34.79138 137.25638
+34.78222 137.20164
+34.76665 137.14777
+34.75498 137.08777
+34.76082 137.02388
+99.00000 999.00000
+34.66138 138.98305
+34.65610 138.96359
+34.62610 138.92110
+34.60027 138.86971
+34.60415 138.80748
+34.64693 138.78249
+34.68443 138.74472
+34.73138 138.76915
+34.77832 138.76555
+34.83248 138.77248
+34.88110 138.76527
+34.91665 138.78055
+34.96471 138.77222
+99.00000 999.00000
+34.97193 138.52472
+34.94415 138.47415
+34.92748 138.41832
+34.90165 138.36693
+34.85165 138.32971
+34.80082 138.33888
+34.75526 138.29915
+34.72915 138.24777
+34.67555 138.21277
+34.62110 138.19998
+34.58193 138.22581
+34.60277 138.15193
+34.62582 138.07555
+99.00000 999.00000
+34.94444 139.96832
+34.90360 139.93582
+34.89082 139.87665
+34.91444 139.82443
+34.94943 139.77388
+34.96805 139.80859
+34.98915 139.86305
+99.00000 999.00000
+34.96915 139.10638
+34.93360 139.14972
+34.87472 139.13860
+34.84527 139.08916
+34.78999 139.07332
+34.74860 139.03471
+99.00000 999.00000
+34.39581 139.30026
+34.33998 139.28526
+34.34055 139.25055
+34.39471 139.27110
+34.39972 139.30194
+99.00000 999.00000
+34.75110 139.45055
+34.69915 139.45776
+34.67471 139.41998
+34.70139 139.36472
+34.75360 139.35860
+34.78498 139.40277
+99.00000 999.00000
+34.06139 139.56888
+34.03222 139.51971
+34.06998 139.48222
+34.10999 139.52554
+34.08610 139.57248
+99.00000 999.00000
+35.05165 119.20998
+35.06555 119.26971
+35.08582 119.33055
+35.12222 119.37248
+35.18832 119.38194
+35.24889 119.40138
+35.30193 119.42388
+35.31638 119.46832
+35.34193 119.52110
+35.38889 119.55444
+35.44444 119.57888
+35.48138 119.60415
+35.53415 119.63110
+35.58694 119.65915
+35.61082 119.71277
+35.58582 119.74388
+35.60332 119.77610
+35.64526 119.81443
+35.62165 119.82860
+35.61526 119.88415
+35.65443 119.90110
+35.70139 119.93222
+35.74222 119.90722
+35.74110 119.95776
+99.00000 999.00000
+35.77472 120.02527
+35.83389 120.02721
+35.87582 120.06498
+35.90305 120.11581
+35.93027 120.16499
+35.91527 120.17527
+35.90832 120.19221
+35.94360 120.23582
+35.96415 120.29165
+99.00000 999.00000
+35.98888 120.27222
+35.96610 120.22860
+35.98277 120.20026
+99.00000 999.00000
+35.98472 126.70527
+35.97165 126.64249
+35.92582 126.61526
+35.89471 126.63665
+35.88748 126.70165
+35.89415 126.76693
+35.90694 126.82777
+35.87276 126.80693
+35.86138 126.74305
+35.83498 126.70305
+35.80972 126.76777
+35.76138 126.78693
+35.77472 126.73248
+35.74472 126.69248
+35.74498 126.65498
+35.71498 126.60805
+35.68748 126.55722
+35.65498 126.51082
+35.61943 126.47472
+35.57805 126.49860
+35.58777 126.56277
+35.59110 126.63222
+35.56831 126.67610
+35.53638 126.67527
+35.55138 126.62331
+35.53194 126.56805
+35.51276 126.51110
+35.47555 126.46860
+35.42388 126.43722
+35.37555 126.42748
+35.33722 126.44610
+35.35665 126.40055
+35.30110 126.37971
+35.25860 126.35443
+35.24165 126.33749
+35.22665 126.33276
+35.21082 126.36526
+35.17471 126.37222
+35.13360 126.40582
+35.09748 126.44915
+35.05665 126.44555
+35.02499 126.41415
+35.06360 126.38693
+35.09555 126.34305
+35.14805 126.34943
+35.10999 126.31915
+35.13665 126.26943
+35.09610 126.25943
+35.06110 126.27277
+35.06472 126.30860
+35.07471 126.32888
+35.03555 126.36388
+99.00000 999.00000
+35.09415 126.12638
+35.05748 126.11943
+35.05444 126.06721
+35.09860 126.06805
+35.12693 126.11332
+35.14055 126.15860
+99.00000 999.00000
+35.02998 128.01305
+35.06944 128.05415
+35.04165 128.05666
+99.00000 999.00000
+35.01305 128.49915
+35.05222 128.47139
+35.03222 128.41554
+35.00943 128.37109
+35.04665 128.39693
+35.06498 128.45415
+35.09638 128.46860
+35.10110 128.53305
+35.08472 128.58360
+35.05165 128.61943
+35.07277 128.62555
+35.11055 128.60443
+35.15805 128.58305
+35.20748 128.58998
+35.17805 128.61194
+35.14415 128.62749
+35.11639 128.66666
+35.13831 128.69693
+35.10110 128.71056
+35.09721 128.76721
+35.08777 128.80388
+35.08943 128.83498
+35.10582 128.89331
+35.09638 128.91081
+35.11888 128.95360
+35.10498 128.97221
+35.05165 128.97388
+99.00000 999.00000
+35.00999 128.68166
+35.01638 128.72556
+99.00000 999.00000
+35.07222 129.01082
+35.09248 129.04222
+35.10610 129.08055
+35.11221 129.13693
+35.15138 129.14165
+35.15971 129.20055
+35.19860 129.23944
+35.24249 129.25638
+35.28889 129.27582
+35.31944 129.32388
+35.35332 129.36943
+35.39944 129.36943
+35.45055 129.35498
+35.48415 129.38832
+35.53027 129.36971
+35.49638 129.40610
+35.48082 129.44026
+35.53722 129.46638
+35.59748 129.47443
+35.65138 129.46693
+35.70998 129.49388
+35.77360 129.50665
+35.82999 129.53027
+35.88165 129.54082
+35.93388 129.55331
+35.98888 129.58388
+99.00000 999.00000
+35.02415 132.25943
+35.04749 132.31276
+35.09082 132.35222
+35.13248 132.39139
+35.17776 132.42805
+35.20748 132.47748
+35.23444 132.52859
+35.26110 132.57944
+35.28305 132.63416
+35.33276 132.66998
+35.38805 132.66693
+35.42388 132.63693
+35.43860 132.69638
+35.44943 132.74361
+35.46388 132.77722
+35.48888 132.82971
+35.49638 132.89389
+35.49443 132.96443
+99.00000 999.00000
+35.54443 133.05165
+35.56998 133.08472
+35.56248 133.13306
+35.55276 133.18944
+35.55527 133.25000
+35.56721 133.30972
+35.54360 133.28415
+35.51221 133.25000
+35.47193 133.28555
+35.44665 133.35248
+35.44805 133.42055
+35.48389 133.46555
+35.50581 133.51999
+35.51638 133.58194
+35.50277 133.65721
+35.48721 133.73665
+35.48582 133.80666
+35.49139 133.86777
+35.49915 133.93138
+35.51305 133.99165
+99.00000 999.00000
+35.50832 134.03749
+35.51276 134.10361
+35.52305 134.16554
+35.53443 134.22693
+35.55860 134.27972
+35.58638 134.33026
+35.60693 134.38554
+35.61998 134.44582
+35.64055 134.50110
+35.64027 134.56749
+35.63415 134.63609
+35.64249 134.69388
+35.64944 134.75389
+35.64138 134.82111
+35.64249 134.87526
+35.64249 134.93639
+35.67527 134.98389
+99.00000 999.00000
+35.68555 135.03915
+35.72415 135.08249
+35.74194 135.13971
+35.75860 135.19832
+35.74055 135.24971
+35.70081 135.28777
+35.65860 135.29027
+35.61998 135.25221
+35.57972 135.20972
+35.52582 135.19110
+35.56222 135.21832
+35.55943 135.25777
+35.52805 135.25471
+35.50777 135.31444
+35.46277 135.31581
+35.46805 135.33582
+35.46638 135.38722
+35.49693 135.38832
+35.52472 135.34581
+35.55360 135.38748
+35.58165 135.43805
+35.56026 135.45860
+35.51610 135.48555
+35.52026 135.51222
+35.48888 135.54054
+35.50277 135.59999
+35.53443 135.64806
+35.51055 135.64415
+35.47665 135.62749
+35.47943 135.69139
+35.49498 135.74971
+35.51443 135.71944
+35.55305 135.71193
+35.53972 135.76694
+35.52165 135.82222
+35.56305 135.81471
+35.58582 135.83998
+35.63305 135.82222
+35.60693 135.87164
+35.60582 135.93248
+35.62610 135.98721
+35.67249 135.97832
+35.71972 135.97638
+99.00000 999.00000
+35.94082 135.97665
+35.98693 135.97139
+99.00000 999.00000
+35.01165 136.88664
+35.05860 136.88998
+35.06165 136.86777
+35.06665 136.82693
+35.03915 136.77638
+35.02026 136.72055
+99.00000 999.00000
+35.74222 136.01749
+35.70277 136.04805
+35.65860 136.04860
+35.67527 136.08305
+35.73360 136.09526
+35.78693 136.09027
+35.82888 136.05804
+35.86526 136.01109
+35.91693 136.00139
+99.00000 999.00000
+35.00805 138.83055
+35.00888 138.89389
+35.04971 138.88081
+35.08694 138.83443
+35.11555 138.76805
+35.12193 138.69832
+35.10055 138.64415
+35.09693 138.57944
+35.05027 138.54248
+35.01276 138.49777
+99.00000 999.00000
+35.03638 139.83859
+35.08749 139.83582
+35.14055 139.83221
+35.18722 139.84277
+35.22498 139.87860
+35.26971 139.85277
+35.29248 139.79305
+35.30998 139.82443
+35.33082 139.87915
+35.36498 139.92249
+35.41389 139.91249
+35.43027 139.96971
+99.00000 999.00000
+35.65555 139.98360
+35.64777 139.92249
+35.61998 139.87749
+35.62138 139.84055
+35.62360 139.78972
+35.59555 139.76694
+35.55082 139.76471
+35.50388 139.78027
+99.00000 999.00000
+35.47694 139.72081
+35.46082 139.66472
+35.42915 139.66138
+35.39639 139.67888
+35.38055 139.63722
+35.33276 139.64888
+35.28610 139.65582
+35.26110 139.69556
+35.24110 139.73831
+35.19860 139.70610
+35.15998 139.66360
+35.12888 139.65359
+35.15360 139.61998
+35.20582 139.61331
+35.24805 139.58081
+35.28748 139.54749
+35.29443 139.47777
+35.30415 139.40944
+35.29998 139.34499
+35.28944 139.28389
+35.26665 139.22693
+35.23998 139.17555
+35.18498 139.14082
+35.13748 139.15915
+35.11027 139.11221
+35.05722 139.08832
+35.00722 139.09999
+99.00000 999.00000
+35.96748 140.67665
+35.92388 140.70721
+35.88165 140.74110
+35.83722 140.76749
+35.79332 140.79498
+35.75138 140.82999
+35.71610 140.87776
+35.69221 140.85138
+35.68722 140.78860
+35.67555 140.72832
+35.67055 140.66360
+35.64360 140.61221
+35.60972 140.56444
+35.57193 140.51915
+35.53165 140.47527
+35.48138 140.43694
+35.41638 140.40831
+35.35777 140.39748
+35.30972 140.41415
+35.25471 140.41193
+35.19665 140.40414
+35.16527 140.35527
+35.12971 140.31027
+35.11110 140.25555
+35.10582 140.19693
+35.10081 140.13388
+35.05610 140.09943
+35.03693 140.04388
+99.00000 999.00000
+35.46498 140.00806
+35.50193 140.05360
+35.53443 140.10193
+35.57610 140.08693
+35.62331 140.06776
+35.64832 140.01332
+99.00000 999.00000
+36.00832 120.17165
+36.06472 120.16222
+36.09472 120.10972
+36.13972 120.08305
+36.18498 120.10582
+36.22443 120.09943
+36.20305 120.14415
+36.22165 120.20332
+36.19221 120.23444
+36.17693 120.28443
+36.20943 120.27360
+36.26693 120.28777
+36.22860 120.31721
+36.19138 120.35555
+36.14138 120.33582
+36.09665 120.30248
+36.06081 120.28831
+36.04055 120.35165
+36.05472 120.41582
+36.08248 120.46498
+36.08860 120.53388
+36.11526 120.57888
+36.11498 120.63165
+36.13277 120.69165
+36.18526 120.68832
+36.23638 120.67110
+36.28332 120.65193
+36.33027 120.64722
+36.31776 120.70721
+36.35722 120.69943
+36.40415 120.69582
+36.43860 120.74081
+36.46277 120.79443
+36.42527 120.83110
+36.37748 120.85277
+36.40193 120.89805
+36.45193 120.90582
+36.47555 120.93972
+36.52638 120.95998
+36.53138 120.92277
+36.56610 120.88443
+36.60415 120.84721
+36.56860 120.80389
+36.53722 120.75639
+36.57943 120.74805
+36.61138 120.76943
+36.63915 120.81831
+36.63665 120.88277
+36.61193 120.93388
+36.58498 120.97193
+99.00000 999.00000
+36.58582 121.02776
+36.62555 121.04722
+36.61665 121.08582
+36.65082 121.13026
+36.67915 121.18110
+36.68915 121.24722
+36.70499 121.30860
+36.70055 121.37360
+36.72749 121.37665
+36.74776 121.43388
+36.78999 121.46777
+36.82526 121.46360
+36.80331 121.50555
+36.83749 121.55110
+36.83360 121.60915
+36.80499 121.55888
+36.78332 121.50305
+36.74860 121.52388
+36.75581 121.57249
+36.73555 121.61694
+36.77860 121.62222
+36.82860 121.63860
+36.82915 121.66832
+36.81721 121.67332
+36.83555 121.73248
+36.87777 121.76749
+36.89555 121.82748
+36.91331 121.88748
+36.93248 121.94527
+36.97248 121.91805
+99.00000 999.00000
+36.98193 122.02555
+36.95860 122.03222
+36.90805 122.03582
+36.90915 122.07526
+36.94943 122.10582
+36.97110 122.14610
+99.00000 999.00000
+36.97110 122.17139
+36.92249 122.19082
+36.90055 122.25722
+36.89165 122.20305
+36.85610 122.18581
+36.83443 122.25027
+36.82360 122.32805
+36.85305 122.37693
+36.87055 122.43722
+36.91026 122.40055
+36.91998 122.46277
+36.93526 122.50943
+36.89360 122.50471
+36.94027 122.52305
+36.99889 122.53388
+99.00000 999.00000
+36.98055 126.83472
+36.94389 126.87555
+36.91888 126.92748
+36.94305 126.97998
+36.98277 126.99831
+99.00000 999.00000
+36.90527 126.97472
+36.88472 126.91805
+36.86248 126.86277
+36.82639 126.90165
+36.81665 126.86415
+36.77110 126.85498
+36.77444 126.83638
+36.82027 126.83221
+36.87832 126.83415
+36.91305 126.80805
+36.90665 126.78748
+36.95472 126.78665
+36.95415 126.73721
+36.97055 126.71415
+36.96665 126.68360
+36.92498 126.64805
+36.94360 126.63165
+36.98277 126.59943
+99.00000 999.00000
+36.98721 126.55860
+36.97276 126.53972
+99.00000 999.00000
+36.98832 126.49915
+36.95305 126.54498
+36.90888 126.57277
+36.91444 126.55027
+36.93722 126.51027
+36.88860 126.49776
+36.83943 126.47248
+36.89055 126.45805
+36.93777 126.47472
+36.94805 126.43110
+36.99555 126.44582
+99.00000 999.00000
+36.99638 126.36305
+36.98138 126.36777
+36.95665 126.34499
+36.93222 126.39555
+36.90415 126.41805
+36.87276 126.37582
+36.84888 126.37360
+36.85081 126.33415
+36.80555 126.34832
+36.80389 126.32471
+36.79998 126.28277
+36.83498 126.30305
+36.88443 126.32165
+36.93722 126.31026
+36.94915 126.28138
+36.89222 126.28471
+36.86610 126.24277
+36.89693 126.22082
+36.86472 126.19248
+36.81915 126.19165
+36.79943 126.22832
+36.78498 126.20472
+36.78665 126.17388
+36.78305 126.15360
+36.74693 126.13139
+36.71055 126.14471
+36.75193 126.15665
+36.73415 126.20165
+36.70415 126.19638
+36.67889 126.16193
+36.68055 126.22193
+36.71471 126.26749
+36.67555 126.26665
+36.63360 126.29915
+36.58472 126.28944
+36.60665 126.33888
+36.64555 126.33694
+36.68748 126.30472
+36.72639 126.33665
+36.71415 126.37331
+36.66472 126.38222
+36.64498 126.39360
+36.68388 126.43555
+36.72027 126.45165
+36.72694 126.49165
+36.68360 126.48972
+36.65610 126.50443
+36.61805 126.51888
+36.59193 126.50027
+36.55943 126.46915
+36.53138 126.50305
+36.49415 126.48331
+36.44360 126.49889
+36.45972 126.54581
+36.47110 126.60944
+36.44555 126.56415
+36.41748 126.51389
+36.38582 126.50248
+36.36694 126.55693
+36.33777 126.56026
+36.31222 126.51971
+36.29332 126.58110
+36.25526 126.55027
+36.19971 126.54472
+36.17915 126.59305
+36.16610 126.55693
+36.14222 126.50332
+36.13610 126.52998
+36.12389 126.59388
+36.08998 126.63943
+36.04943 126.64722
+36.00471 126.67360
+36.00581 126.73943
+36.03138 126.79138
+36.05193 126.84748
+36.04055 126.86388
+36.01915 126.80832
+99.00000 999.00000
+36.53831 126.37888
+36.50388 126.35555
+36.48805 126.38388
+36.45499 126.39443
+36.41444 126.42944
+36.41055 126.39055
+36.43472 126.37832
+36.44555 126.33777
+36.46471 126.33860
+36.51805 126.33527
+36.57165 126.32748
+36.58610 126.37860
+36.55860 126.36415
+99.00000 999.00000
+36.98582 127.02776
+36.96693 127.01082
+99.00000 999.00000
+36.00805 129.58804
+36.05972 129.57555
+36.05555 129.53888
+36.01998 129.49388
+99.00000 999.00000
+36.01276 129.39832
+36.06194 129.40027
+36.10222 129.42610
+36.14832 129.40277
+36.19331 129.37665
+36.24972 129.38609
+36.30331 129.38306
+36.35722 129.40582
+36.40638 129.43915
+36.46388 129.43915
+36.52110 129.44527
+36.56776 129.42305
+36.62276 129.41777
+36.67139 129.45193
+36.72165 129.47305
+36.77915 129.47305
+36.82555 129.44972
+36.87415 129.42998
+36.92722 129.42027
+36.98305 129.41722
+99.00000 999.00000
+36.05444 132.95139
+36.09748 132.98749
+99.00000 999.00000
+36.30582 133.32388
+36.26888 133.36722
+36.21638 133.37639
+36.20360 133.34721
+36.16555 133.33998
+36.16193 133.28110
+36.17277 133.23444
+36.20831 133.18776
+36.26360 133.18776
+36.30665 133.22777
+36.33165 133.27888
+99.00000 999.00000
+36.09998 133.13193
+36.04581 133.10915
+36.03555 133.07582
+36.08749 133.08360
+99.00000 999.00000
+36.10360 133.07664
+36.06415 133.05638
+36.07055 133.01555
+99.00000 999.00000
+36.10277 133.01164
+36.11998 133.06276
+99.00000 999.00000
+36.06665 136.02888
+36.11443 136.06165
+36.15027 136.10472
+36.20638 136.12805
+36.24055 136.16888
+36.25777 136.22665
+36.29443 136.27222
+36.33443 136.31555
+36.35944 136.36832
+36.40193 136.41081
+36.44722 136.45110
+36.48832 136.49306
+36.53082 136.53499
+36.57443 136.57639
+36.61777 136.61777
+36.66555 136.65639
+36.71888 136.69165
+36.77610 136.72443
+36.83805 136.75415
+36.89805 136.76610
+36.95360 136.76694
+99.00000 999.00000
+36.98888 137.05415
+36.93639 137.03610
+36.87777 137.01082
+99.00000 999.00000
+36.80860 137.03638
+36.77472 137.08665
+36.75305 137.16193
+36.74831 137.23248
+36.74638 137.30249
+36.77110 137.35582
+36.80915 137.40109
+36.87110 137.42165
+36.92415 137.44110
+36.94527 137.49664
+36.95748 137.55804
+36.96999 137.62054
+36.98389 137.68056
+99.00000 999.00000
+36.99332 140.97610
+36.94389 140.93999
+36.92805 140.88138
+36.90332 140.82693
+36.85332 140.79721
+36.81305 140.76749
+36.75471 140.73831
+36.69305 140.71832
+36.63582 140.69556
+36.57305 140.66638
+36.51749 140.63055
+36.45555 140.60944
+36.40165 140.61055
+36.35139 140.62164
+36.29665 140.58804
+36.25915 140.56721
+36.20555 140.56943
+36.15498 140.57944
+36.10471 140.59055
+36.05832 140.61415
+36.01498 140.64415
+99.00000 999.00000
+37.62444 118.99110
+37.57581 118.96332
+37.51415 118.95139
+37.45055 118.95277
+37.39305 118.94110
+37.33276 118.94527
+37.28138 118.96722
+99.00000 999.00000
+37.92081 119.01305
+37.87276 119.03693
+37.81472 119.01998
+37.76555 119.04581
+37.73027 119.08888
+37.68472 119.06998
+37.65971 119.02638
+99.00000 999.00000
+37.26415 119.02165
+37.22472 119.05832
+37.19860 119.11388
+37.16888 119.16582
+37.14610 119.22665
+37.13165 119.29777
+37.12693 119.37444
+37.12360 119.45305
+37.13805 119.52139
+37.13360 119.60332
+37.13638 119.68138
+37.14555 119.75305
+99.00000 999.00000
+37.39944 119.96360
+37.37276 119.91193
+37.35471 119.85555
+37.31081 119.87138
+37.26305 119.89388
+37.21693 119.86055
+37.18805 119.81055
+37.15138 119.76722
+99.00000 999.00000
+37.76415 120.94998
+37.81026 120.93581
+37.82860 120.86998
+37.81776 120.80472
+37.83472 120.73360
+37.80499 120.68360
+37.78443 120.62582
+37.76331 120.56860
+37.74831 120.50665
+37.73888 120.43888
+37.70222 120.39498
+37.68388 120.33472
+37.68415 120.25639
+37.66972 120.23610
+37.65943 120.31472
+37.60388 120.30915
+37.57249 120.26138
+37.53360 120.21999
+37.50000 120.17388
+37.46915 120.12444
+37.44331 120.07193
+37.42388 120.01193
+99.00000 999.00000
+37.47832 121.98082
+37.43277 121.99972
+37.42889 121.94027
+37.45972 121.92889
+37.45889 121.85305
+37.45721 121.77915
+37.45693 121.70332
+37.48110 121.64027
+37.45665 121.58555
+37.45915 121.63499
+37.43305 121.65472
+37.42582 121.59165
+37.44943 121.53915
+37.47221 121.47221
+37.51832 121.44860
+37.54694 121.39277
+37.59082 121.39277
+37.60638 121.40110
+37.62888 121.35722
+37.58749 121.34776
+37.57832 121.27915
+37.57193 121.20889
+37.59193 121.14082
+37.63998 121.14193
+37.68472 121.14526
+37.70972 121.08472
+37.71722 121.01722
+99.00000 999.00000
+37.02081 122.52972
+37.02832 122.46305
+37.00498 122.40555
+99.00000 999.00000
+37.04581 122.42860
+37.08248 122.44693
+37.13582 122.44305
+37.11581 122.46055
+37.14443 122.48665
+37.14526 122.55693
+37.17889 122.56443
+37.19498 122.62498
+37.23610 122.59110
+37.27193 122.55305
+37.31915 122.55582
+37.30527 122.59305
+37.34721 122.56721
+37.37055 122.62222
+37.37777 122.68694
+37.40722 122.66610
+37.40971 122.59665
+37.40055 122.52915
+37.42165 122.46582
+37.40998 122.40138
+37.41026 122.32498
+37.43665 122.26832
+37.44943 122.21498
+37.42081 122.16582
+37.46443 122.13527
+37.50165 122.14222
+37.54722 122.13831
+37.54749 122.08360
+37.52998 122.05832
+37.50248 122.01193
+99.00000 999.00000
+37.95998 124.74555
+37.95360 124.70415
+37.93248 124.69971
+37.91444 124.65193
+37.95222 124.61110
+37.97360 124.65888
+37.98165 124.72555
+99.00000 999.00000
+37.98082 125.13831
+37.96305 125.16972
+37.95889 125.09860
+37.96443 125.04138
+99.00000 999.00000
+37.92139 125.00860
+37.89305 125.05165
+37.87193 125.11722
+37.86472 125.18305
+37.90193 125.22527
+37.91638 125.25055
+37.88998 125.30389
+37.85055 125.28277
+37.81998 125.23888
+37.81693 125.30998
+37.82360 125.34776
+37.84972 125.35305
+37.85665 125.39805
+37.85332 125.44860
+37.88415 125.39443
+37.90165 125.42776
+37.90276 125.45972
+37.87638 125.51498
+37.84222 125.48527
+37.82110 125.52360
+37.81944 125.47276
+37.80860 125.41305
+37.77472 125.39082
+37.76610 125.43443
+37.76027 125.37331
+37.71915 125.33472
+37.67194 125.34832
+37.71305 125.38805
+37.71415 125.46027
+37.75832 125.49805
+37.78443 125.52110
+37.78582 125.55582
+37.75805 125.59805
+37.79305 125.61082
+37.82388 125.62998
+37.87055 125.63693
+37.92139 125.63055
+37.89082 125.68110
+37.91860 125.73277
+37.93388 125.70527
+37.95193 125.67831
+37.96582 125.65055
+37.99360 125.59026
+99.00000 999.00000
+37.98972 125.79777
+37.94165 125.81638
+37.91026 125.85582
+37.87082 125.89388
+37.83527 125.93222
+37.83331 125.98582
+37.87748 125.95721
+37.90555 125.97555
+99.00000 999.00000
+37.85415 126.03555
+37.83138 126.05722
+37.79221 126.08638
+37.74249 126.10165
+37.75165 126.16082
+37.80305 126.14693
+37.83472 126.17915
+37.83971 126.23389
+37.85277 126.29415
+37.87777 126.34805
+37.87748 126.40749
+37.84138 126.45165
+37.81110 126.50748
+37.78165 126.56527
+37.78665 126.61888
+37.82082 126.66360
+37.82193 126.69389
+37.76276 126.68526
+37.70943 126.68832
+37.66277 126.70693
+37.62805 126.74665
+37.65193 126.68305
+37.69805 126.66082
+37.75471 126.65943
+37.75305 126.60332
+37.76248 126.53277
+37.70610 126.53693
+37.65221 126.54639
+37.61277 126.57665
+37.60498 126.62138
+37.56805 126.65248
+37.51860 126.65415
+37.48472 126.65638
+37.45915 126.63555
+37.41110 126.65638
+37.38610 126.71693
+37.35582 126.74443
+37.32888 126.71443
+37.31332 126.76915
+37.30027 126.82027
+37.28305 126.85139
+37.27277 126.83331
+37.24026 126.79915
+37.23193 126.76610
+37.24776 126.73305
+37.25000 126.67999
+37.22221 126.67582
+37.20889 126.71860
+37.17831 126.66972
+37.16389 126.69444
+37.12444 126.68777
+37.14027 126.73082
+37.17249 126.77832
+37.15832 126.81026
+37.17638 126.86915
+37.13943 126.84444
+37.12555 126.78222
+37.07999 126.78027
+37.04860 126.75277
+37.03360 126.81748
+37.03194 126.84193
+37.08331 126.86722
+37.06638 126.88222
+37.02360 126.91305
+37.00805 126.88026
+37.00443 126.81305
+99.00000 999.00000
+37.03722 126.54581
+37.04415 126.51110
+37.00165 126.50471
+99.00000 999.00000
+37.78889 126.34248
+37.75581 126.29832
+37.75694 126.22915
+37.80444 126.23499
+37.79998 126.29055
+99.00000 999.00000
+37.69221 126.35277
+37.65360 126.36639
+37.67582 126.31582
+37.71027 126.29388
+37.74026 126.32722
+99.00000 999.00000
+37.79248 126.46249
+37.76110 126.51610
+37.70555 126.51943
+37.65276 126.53110
+37.60860 126.51805
+37.60610 126.46693
+37.59638 126.40388
+37.63165 126.38110
+37.66527 126.40582
+37.70527 126.36888
+37.76276 126.36943
+37.80693 126.39165
+37.80972 126.44027
+99.00000 999.00000
+37.50943 126.57581
+37.47581 126.55582
+37.45610 126.49722
+37.48027 126.50138
+37.52444 126.52332
+99.00000 999.00000
+37.75082 128.98138
+37.78831 128.93971
+37.82748 128.89998
+37.86360 128.85472
+37.90777 128.82664
+37.94832 128.79082
+37.99081 128.75972
+99.00000 999.00000
+37.03999 129.42055
+37.08360 129.41360
+37.12582 129.38165
+37.16915 129.35193
+37.22832 129.35416
+37.27277 129.32915
+37.31194 129.29111
+37.35722 129.26555
+37.39805 129.23027
+37.44110 129.20027
+37.48331 129.16832
+37.52555 129.13609
+37.57526 129.11998
+37.61248 129.07721
+37.66331 129.06305
+37.70443 129.02888
+99.00000 999.00000
+37.52388 130.91943
+37.47415 130.91554
+37.45415 130.86331
+37.48721 130.81165
+37.52499 130.82805
+37.53722 130.88914
+37.51915 130.92415
+99.00000 999.00000
+37.03415 136.73389
+37.08638 136.72832
+37.13610 136.71498
+37.15915 136.68193
+37.21443 136.70110
+37.26276 136.73555
+37.31582 136.73444
+37.35610 136.77693
+37.37805 136.83305
+37.38889 136.89555
+37.40276 136.95694
+99.00000 999.00000
+37.18888 136.98610
+37.21582 136.93193
+37.16582 136.90109
+37.12389 136.88472
+37.07693 136.86444
+37.07277 136.90582
+37.05276 136.95389
+99.00000 999.00000
+37.41832 137.00943
+37.43888 137.06610
+37.47221 137.11526
+37.48777 137.17526
+37.51138 137.23138
+37.52081 137.29472
+37.49972 137.35805
+37.45248 137.35860
+37.42527 137.31749
+37.41110 137.25693
+37.35693 137.25360
+37.30972 137.26248
+37.28332 137.20998
+37.28498 137.13971
+37.24443 137.09581
+37.19582 137.05722
+37.04722 137.00305
+99.00000 999.00000
+37.09165 137.04332
+37.04610 137.04582
+99.00000 999.00000
+37.00332 137.73109
+37.02165 137.78860
+37.03831 137.84749
+37.05555 137.90555
+37.07748 137.96082
+99.00000 999.00000
+37.10055 138.00861
+37.13277 138.05777
+37.15888 138.11055
+37.15527 138.18555
+37.17249 138.24388
+37.20026 138.29582
+37.23472 138.34222
+37.27305 138.38748
+37.30805 138.43498
+37.33943 138.48499
+37.36248 138.53972
+37.40415 138.58388
+37.46194 138.61832
+37.51331 138.65665
+37.54360 138.70721
+37.59165 138.74722
+37.65610 138.77554
+37.71582 138.78888
+37.77527 138.81610
+37.82249 138.85664
+37.85889 138.90388
+37.88721 138.95581
+99.00000 999.00000
+37.99305 138.54805
+37.94055 138.51360
+37.89193 138.48665
+37.86498 138.43388
+37.83055 138.38498
+37.81443 138.32498
+37.79639 138.26665
+37.81443 138.20915
+37.83582 138.26248
+37.88610 138.29193
+37.92889 138.31888
+37.98082 138.33139
+37.98832 138.27388
+37.98777 138.23805
+99.00000 999.00000
+37.92110 139.03915
+37.94165 139.09972
+37.96277 139.15694
+37.98638 139.21277
+99.00000 999.00000
+37.97777 140.91832
+37.92443 140.92027
+37.87110 140.93443
+37.82360 140.95248
+37.77748 140.96915
+99.00000 999.00000
+37.08971 140.98776
+37.02998 140.97305
+99.00000 999.00000
+37.73972 141.01443
+37.68665 141.01471
+37.63998 141.02638
+37.58805 141.03194
+37.53498 141.03194
+37.48415 141.04082
+37.42776 141.03499
+37.37498 141.03915
+37.31693 141.02748
+37.25694 141.01332
+37.20026 141.00638
+37.14860 141.01277
+99.00000 999.00000
+38.27888 117.79639
+38.25888 117.84972
+38.24026 117.90943
+38.20860 117.95610
+99.00000 999.00000
+38.29248 117.78360
+38.32693 117.73665
+38.36331 117.69527
+38.40498 117.66026
+38.44804 117.63248
+38.49388 117.60638
+38.54248 117.58389
+38.58832 117.55693
+38.64082 117.54082
+38.69276 117.55222
+38.75722 117.56693
+38.81305 117.59082
+38.86055 117.62389
+38.90721 117.65749
+38.95110 117.69389
+38.98610 117.71471
+38.99805 117.73665
+99.00000 999.00000
+38.15109 118.03360
+38.13748 118.07832
+38.14082 118.13693
+38.13998 118.20610
+38.13081 118.28471
+38.12860 118.34915
+38.11748 118.42388
+38.09776 118.48860
+38.06776 118.53860
+38.09639 118.59138
+38.13805 118.62415
+38.14499 118.69722
+38.15193 118.76832
+38.15527 118.82360
+38.11305 118.83749
+38.06165 118.85360
+38.05832 118.91444
+38.02361 118.95889
+99.00000 999.00000
+38.98082 121.34472
+38.96138 121.28582
+38.93694 121.23082
+38.94693 121.16721
+38.92805 121.10665
+38.89139 121.10471
+38.87831 121.14471
+38.83221 121.11443
+38.78638 121.14138
+38.75055 121.13139
+38.71777 121.17693
+38.75389 121.22110
+38.77777 121.21748
+38.78860 121.25860
+38.79610 121.31638
+38.81276 121.37415
+38.80638 121.44777
+38.82111 121.50110
+38.85138 121.55082
+38.85971 121.60722
+38.86526 121.67665
+38.89581 121.70943
+38.92581 121.65472
+38.93111 121.59165
+38.95221 121.64360
+38.99361 121.63527
+99.00000 999.00000
+38.98332 121.79498
+38.94638 121.83749
+38.96860 121.89332
+99.00000 999.00000
+38.87332 121.83805
+38.87944 121.82943
+99.00000 999.00000
+38.45831 124.98972
+38.46498 124.96443
+38.41666 124.92999
+38.36888 124.89498
+38.32359 124.87138
+38.26389 124.86777
+38.22610 124.90860
+38.23109 124.97055
+38.20998 124.95499
+38.19249 124.91444
+38.22861 124.87027
+38.19305 124.82498
+38.16888 124.77193
+38.13914 124.72165
+38.12582 124.66248
+38.10527 124.72943
+38.09639 124.80305
+38.10472 124.87082
+38.11610 124.91555
+38.08110 124.96138
+99.00000 999.00000
+38.51109 124.89360
+38.49748 124.85831
+38.50638 124.80248
+38.53581 124.80915
+38.53831 124.86610
+99.00000 999.00000
+38.99554 125.24026
+38.95248 125.20415
+38.90889 125.19276
+38.86943 125.14944
+38.80777 125.13943
+38.78360 125.18055
+38.74248 125.20139
+38.77527 125.22832
+38.77165 125.25832
+38.73027 125.24194
+38.69582 125.28471
+38.72972 125.30360
+38.72139 125.34972
+38.70277 125.38139
+38.72221 125.43222
+38.75360 125.43138
+38.75499 125.45443
+38.71860 125.49388
+38.69415 125.55193
+38.65721 125.59499
+38.63582 125.64748
+38.63277 125.60194
+38.66998 125.56026
+38.64693 125.51943
+38.68971 125.48805
+38.68443 125.44276
+38.69055 125.37444
+38.66026 125.32443
+38.66527 125.26305
+38.65944 125.20610
+38.62582 125.18888
+38.65222 125.14860
+38.63805 125.11832
+38.58888 125.13555
+38.55832 125.09193
+38.57582 125.06305
+38.58943 125.00027
+99.00000 999.00000
+38.06721 125.04805
+38.08693 125.10665
+38.08276 125.18055
+38.07832 125.25610
+38.04610 125.24831
+38.01665 125.22360
+38.04527 125.17860
+38.03806 125.10999
+99.00000 999.00000
+38.00861 125.57360
+38.02609 125.60527
+38.01749 125.66444
+99.00000 999.00000
+38.89082 127.97610
+38.92749 127.93193
+38.95888 127.89388
+38.99472 127.85305
+99.00000 999.00000
+38.65610 128.36139
+38.70221 128.33722
+38.73639 128.28806
+38.73776 128.24527
+38.73526 128.20139
+38.77498 128.16306
+38.81499 128.12582
+38.84526 128.06888
+99.00000 999.00000
+38.04222 128.71082
+38.08556 128.68056
+38.12138 128.63777
+38.17221 128.62332
+38.21889 128.60027
+38.26248 128.57082
+38.31055 128.55081
+38.35304 128.51915
+38.39861 128.49388
+38.44360 128.46748
+38.48860 128.44110
+38.53471 128.41693
+38.57944 128.38914
+99.00000 999.00000
+38.23526 138.50610
+38.17360 138.48138
+38.11555 138.44748
+38.05638 138.42998
+38.06082 138.46748
+38.07248 138.52972
+38.05722 138.58110
+99.00000 999.00000
+38.05638 138.23444
+38.10664 138.27138
+38.16110 138.30472
+38.19777 138.35165
+38.23888 138.39581
+38.27582 138.43832
+38.31694 138.48277
+38.29111 138.51193
+99.00000 999.00000
+38.01889 139.27609
+38.05527 139.32359
+38.09305 139.36971
+38.13914 139.41138
+38.19305 139.43582
+38.24971 139.44165
+38.30777 139.45110
+38.36472 139.45831
+38.42555 139.48138
+38.48499 139.51527
+38.53665 139.54639
+38.59305 139.57777
+38.65138 139.61221
+38.69110 139.65805
+38.72722 139.70610
+38.77110 139.75000
+38.83026 139.78389
+38.89415 139.80693
+38.95082 139.82860
+99.00000 999.00000
+38.21832 140.99554
+38.16110 140.95998
+38.09972 140.93915
+38.03972 140.92499
+99.00000 999.00000
+38.99165 141.74472
+38.96805 141.72360
+38.95139 141.69722
+38.98888 141.69165
+38.98776 141.62971
+38.93805 141.64165
+38.89165 141.66306
+38.84915 141.66498
+38.88664 141.63943
+38.87360 141.58055
+38.82332 141.59415
+38.78915 141.54889
+38.75444 141.53555
+38.71472 141.56665
+38.68832 141.52527
+38.66805 141.46777
+38.63777 141.50165
+38.60527 141.51915
+38.57166 141.46944
+38.53221 141.49609
+38.52805 141.54248
+38.47832 141.53249
+38.48665 141.50722
+38.44110 141.50693
+38.41805 141.47194
+38.40027 141.50415
+38.38081 141.54414
+38.36331 141.51305
+38.31555 141.52388
+38.26639 141.52582
+38.29027 141.48332
+38.32944 141.46222
+38.35832 141.43721
+38.37277 141.39861
+38.39915 141.35056
+38.39943 141.28165
+38.38722 141.21971
+38.36748 141.17805
+38.31694 141.17831
+38.34277 141.14139
+38.36444 141.09581
+38.32639 141.05276
+38.30026 141.08305
+38.26639 141.03665
+99.00000 999.00000
+39.05888 117.73082
+39.10498 117.71972
+39.12944 117.77527
+39.16554 117.81972
+39.19276 117.87444
+39.20665 117.94055
+99.00000 999.00000
+39.21609 118.06944
+39.19638 118.13665
+39.16415 118.18581
+39.12471 118.22360
+39.07304 118.24026
+39.05443 118.30582
+39.04915 118.35777
+39.07332 118.41331
+39.10248 118.46665
+39.13416 118.51555
+39.16972 118.56026
+39.18610 118.61832
+39.18860 118.68138
+39.15166 118.71110
+39.15166 118.77943
+39.17805 118.83276
+39.20193 118.86972
+39.16748 118.88776
+39.18776 118.94722
+39.16554 118.94693
+39.13081 118.90110
+39.13388 118.93472
+39.16582 118.98277
+99.00000 999.00000
+39.19943 119.02139
+39.23999 119.06026
+39.27443 119.07915
+39.30611 119.12860
+39.34389 119.17194
+39.37639 119.22027
+39.41331 119.25832
+39.46277 119.23860
+39.51971 119.26221
+39.56694 119.26389
+39.54582 119.22943
+39.55194 119.21526
+39.58748 119.23165
+39.59471 119.28999
+39.64998 119.31638
+39.70998 119.33777
+39.74443 119.38499
+39.78194 119.43055
+39.79999 119.49305
+39.84055 119.51082
+39.88248 119.54415
+39.90166 119.59415
+39.92749 119.65082
+39.93889 119.72055
+39.95526 119.78415
+39.98027 119.84472
+99.00000 999.00000
+39.96638 121.83805
+39.93222 121.79415
+39.91388 121.73277
+39.91193 121.67443
+39.88193 121.62276
+39.86610 121.55888
+39.83582 121.50915
+39.80081 121.47110
+39.75139 121.45776
+39.71027 121.48610
+39.68944 121.52860
+39.64915 121.52638
+39.61916 121.51472
+39.63998 121.46138
+39.61110 121.42194
+39.59694 121.35555
+39.57748 121.29527
+39.54277 121.24831
+39.51082 121.24748
+39.49664 121.31055
+39.52055 121.36388
+39.51305 121.43360
+39.47276 121.46027
+39.42305 121.47860
+39.37389 121.49972
+39.36081 121.56721
+39.35693 121.64805
+39.36888 121.71388
+39.40082 121.72998
+39.38609 121.80998
+39.39305 121.87832
+39.41415 121.92610
+39.38609 121.90555
+39.36331 121.84776
+39.36526 121.77026
+39.32388 121.73248
+39.28722 121.69971
+39.26360 121.64639
+39.25331 121.60139
+39.21889 121.62193
+39.18889 121.59165
+39.17444 121.64249
+39.13388 121.67665
+39.08582 121.67555
+39.06638 121.61555
+39.04944 121.55305
+39.02638 121.49638
+39.01360 121.43248
+39.04721 121.38332
+39.01694 121.33498
+99.00000 999.00000
+39.02081 121.71832
+39.01749 121.76915
+99.00000 999.00000
+39.01776 121.82943
+39.02666 121.87582
+39.01805 121.91915
+39.04776 121.90998
+39.04166 121.97055
+99.00000 999.00000
+39.39165 121.43610
+39.36693 121.38889
+39.38222 121.33555
+39.42194 121.37693
+39.42831 121.33276
+39.38638 121.29277
+39.40414 121.25748
+39.43944 121.29527
+39.47861 121.33722
+39.47748 121.40998
+39.43999 121.45110
+39.41805 121.43388
+99.00000 999.00000
+39.05556 122.03748
+39.09360 122.04248
+39.11861 122.09776
+39.14055 122.15555
+39.16331 122.09748
+39.20749 122.12832
+39.24055 122.17555
+39.26555 122.22998
+39.31665 122.24722
+39.34999 122.29165
+39.37831 122.34305
+39.40831 122.39388
+39.41388 122.46638
+39.43944 122.52222
+39.47388 122.55248
+39.46944 122.59193
+39.51027 122.63277
+39.51248 122.68277
+39.54582 122.72943
+39.56248 122.77972
+39.59444 122.82639
+39.60638 122.87472
+39.61693 122.94276
+39.62805 122.98721
+39.66554 122.98027
+99.00000 999.00000
+39.15138 122.39027
+39.14194 122.34638
+39.17722 122.33443
+39.20776 122.38499
+39.17276 122.39805
+99.00000 999.00000
+39.25665 122.63527
+39.25861 122.56998
+39.28331 122.50360
+39.29166 122.56110
+39.27914 122.62943
+39.25665 122.68526
+99.00000 999.00000
+39.20389 122.71777
+39.22081 122.69331
+39.22748 122.64581
+39.23805 122.71194
+99.00000 999.00000
+39.49582 122.97388
+39.54054 122.96805
+99.00000 999.00000
+39.67360 123.00639
+39.67276 123.06610
+39.67972 123.11305
+39.66306 123.16665
+39.67943 123.21999
+39.70860 123.26555
+39.72832 123.20693
+39.74306 123.24915
+39.78165 123.24610
+39.80138 123.25443
+39.78415 123.29527
+39.77777 123.36277
+39.81471 123.39665
+39.79138 123.41026
+39.73944 123.40582
+39.73749 123.45998
+39.78722 123.48693
+39.78526 123.54943
+39.77638 123.58193
+39.82111 123.60139
+39.87138 123.61805
+39.91306 123.65248
+39.86221 123.65332
+39.82944 123.70499
+39.82138 123.78748
+39.82748 123.84193
+39.82277 123.91138
+39.81694 123.96693
+99.00000 999.00000
+39.96443 124.37527
+39.92831 124.33749
+39.89221 124.34748
+39.85915 124.39332
+39.82555 124.42722
+39.82111 124.49889
+39.81055 124.56332
+39.76639 124.58777
+39.71832 124.59555
+39.69498 124.64193
+39.64722 124.62943
+39.59499 124.62415
+39.61415 124.68248
+39.63026 124.74388
+39.67722 124.75694
+39.71944 124.74972
+39.76971 124.73527
+39.74361 124.77165
+39.72249 124.82972
+39.69666 124.88748
+39.64861 124.90888
+39.66222 124.95665
+99.00000 999.00000
+39.83331 124.06498
+39.82693 124.11694
+39.86194 124.16389
+39.88971 124.21722
+39.92249 124.26555
+39.96304 124.30665
+39.99805 124.35360
+99.00000 999.00000
+39.52415 124.89165
+39.49554 124.83998
+39.53415 124.86472
+39.56415 124.85889
+39.60889 124.89388
+39.59248 124.92165
+99.00000 999.00000
+39.63165 125.00748
+39.59721 125.05527
+39.58415 125.10610
+39.55748 125.15332
+39.58859 125.16805
+39.57805 125.21693
+39.54665 125.24805
+39.52138 125.29998
+39.54749 125.35415
+39.56694 125.41360
+39.55388 125.44777
+39.52110 125.39944
+39.47499 125.36388
+39.42831 125.34415
+39.41972 125.36388
+39.38805 125.39665
+39.37054 125.45248
+39.35416 125.40388
+39.30804 125.42194
+39.28331 125.41610
+39.23749 125.38831
+39.22249 125.38415
+39.19472 125.33193
+39.15971 125.31972
+39.12776 125.28915
+39.09027 125.31026
+39.07527 125.28805
+39.03665 125.24944
+99.00000 999.00000
+39.04498 127.81305
+39.08832 127.78277
+39.11832 127.74222
+39.11415 127.67081
+39.14693 127.61915
+39.14027 127.55165
+39.17082 127.50193
+39.18248 127.47581
+39.17360 127.43388
+39.20915 127.38638
+39.26248 127.37527
+39.31694 127.39693
+39.33081 127.41582
+39.34639 127.47221
+39.35805 127.43138
+39.37498 127.37998
+39.39276 127.43610
+39.42915 127.47998
+39.39832 127.52165
+39.34831 127.53082
+39.29889 127.53165
+39.33249 127.55555
+39.38609 127.54665
+39.43805 127.53443
+39.49277 127.52776
+39.55194 127.54888
+39.60138 127.57498
+39.64276 127.54277
+39.65721 127.50639
+39.71277 127.50165
+39.75471 127.54305
+39.79359 127.58138
+39.81694 127.63776
+39.82111 127.68722
+39.84277 127.74194
+39.86806 127.79527
+39.88026 127.82777
+39.90414 127.88415
+39.96027 127.89748
+39.98610 127.95222
+99.00000 999.00000
+39.03331 139.86415
+39.09193 139.87639
+39.14665 139.89806
+39.20082 139.89748
+39.26222 139.91777
+39.29222 139.96971
+99.00000 999.00000
+39.85722 139.99248
+39.88971 139.93193
+39.88138 139.86638
+39.85527 139.81943
+39.86249 139.75082
+39.90527 139.71889
+39.94443 139.71332
+39.99306 139.70027
+39.96971 139.76555
+39.96056 139.83638
+39.98749 139.89055
+99.00000 999.00000
+39.36555 140.01665
+39.42749 140.03831
+39.48776 140.05527
+39.54555 140.06526
+39.60277 140.07027
+39.65582 140.06555
+39.70888 140.06276
+39.75888 140.05110
+39.80748 140.03555
+39.84972 140.00139
+99.00000 999.00000
+39.96277 141.95721
+39.91306 141.94472
+39.86916 141.97415
+39.81888 141.98360
+99.00000 999.00000
+39.72943 141.98610
+39.68138 141.98721
+39.62999 141.96248
+39.59389 141.96582
+99.00000 999.00000
+39.47415 141.98305
+39.43805 141.96609
+99.00000 999.00000
+39.41055 141.97832
+39.37248 141.95164
+39.35165 141.92888
+39.32388 141.93222
+39.34222 141.98581
+39.30693 141.95193
+39.28693 141.91582
+39.26164 141.90138
+39.24416 141.94472
+39.21805 141.94498
+39.19888 141.88664
+39.18222 141.92249
+39.15359 141.87639
+39.12776 141.86748
+39.09694 141.90889
+39.09831 141.84444
+39.07332 141.85027
+39.05305 141.82582
+39.01889 141.84526
+39.02805 141.78471
+39.02998 141.72804
+99.00000 999.00000
+39.63554 142.01164
+39.60081 142.03027
+39.55943 142.05972
+39.51915 142.03943
+39.44914 142.00165
+99.00000 999.00000
+39.47360 142.05443
+39.42249 142.03831
+99.00000 999.00000
+40.05972 120.00748
+40.07971 120.06805
+40.10027 120.12748
+40.12248 120.18610
+40.13860 120.25082
+40.16722 120.30276
+40.18915 120.36165
+40.19165 120.43832
+40.22804 120.48472
+40.27666 120.49805
+40.31972 120.52110
+40.34444 120.57665
+40.36165 120.56055
+40.40193 120.54998
+40.42331 120.60055
+40.46722 120.61665
+40.48082 120.67332
+40.53165 120.70165
+40.56499 120.74915
+40.59694 120.79805
+40.65443 120.82082
+40.67526 120.87998
+40.68414 120.95222
+99.00000 999.00000
+40.73055 120.98610
+40.75000 120.93610
+40.78888 120.96748
+40.83055 120.99748
+99.00000 999.00000
+40.77972 121.95527
+40.79831 121.89082
+40.83722 121.85110
+40.88860 121.83555
+40.94055 121.82805
+40.97943 121.86915
+40.96722 121.82222
+40.91859 121.79388
+40.86388 121.77610
+40.83832 121.71972
+40.83582 121.63889
+40.83665 121.56527
+40.87749 121.52832
+40.88914 121.47415
+40.90721 121.43248
+40.93027 121.37193
+40.90860 121.31332
+40.91527 121.25943
+40.92194 121.20415
+40.90665 121.15971
+99.00000 999.00000
+40.12332 121.98832
+40.10110 121.93360
+40.05722 121.89610
+40.02582 121.84610
+40.01082 121.87998
+99.00000 999.00000
+40.82388 121.03915
+40.84943 121.07693
+40.88277 121.12193
+99.00000 999.00000
+40.68193 122.12331
+40.68639 122.16582
+40.62555 122.16026
+40.58443 122.19027
+40.55888 122.25027
+40.52110 122.29415
+40.47194 122.28777
+40.43027 122.25000
+40.40527 122.20748
+40.35056 122.19138
+40.31831 122.14277
+40.27943 122.10443
+40.22804 122.08888
+40.19582 122.04055
+99.00000 999.00000
+40.07359 124.37860
+40.03444 124.41748
+40.02277 124.49388
+40.01999 124.44248
+40.00806 124.38194
+99.00000 999.00000
+40.04555 124.36110
+40.09639 124.37110
+99.00000 999.00000
+40.03389 128.05527
+40.02582 128.13554
+40.02361 128.18414
+40.03749 128.24081
+40.04944 128.28555
+40.03610 128.32693
+40.07332 128.36943
+40.09305 128.42860
+40.11888 128.48360
+40.14276 128.53943
+40.17165 128.59248
+40.18443 128.65443
+40.23082 128.67027
+40.27277 128.63664
+40.30556 128.68359
+40.32498 128.74388
+40.33998 128.80582
+40.36139 128.86444
+40.39581 128.91193
+40.43304 128.95776
+99.00000 999.00000
+40.45444 129.00861
+40.46222 129.07777
+40.49748 129.11832
+40.54054 129.15944
+40.59555 129.17749
+40.64806 129.20972
+40.69194 129.23526
+40.67610 129.28860
+40.71222 129.32971
+40.74498 129.37888
+40.76831 129.43665
+40.78777 129.49693
+40.81276 129.55249
+40.82805 129.61610
+40.83360 129.68694
+40.86972 129.73109
+40.92610 129.75276
+40.97139 129.72916
+99.00000 999.00000
+40.01610 139.91554
+40.07610 139.94972
+40.13914 139.98082
+99.00000 999.00000
+40.37054 139.98749
+40.40805 139.94026
+40.46332 139.94331
+40.51694 139.94194
+40.56082 139.91331
+40.58998 139.85248
+40.62915 139.89249
+40.66527 139.94165
+40.70581 139.98749
+99.00000 999.00000
+40.20444 140.02222
+40.25916 140.02443
+40.31360 140.02498
+40.35889 140.00026
+99.00000 999.00000
+40.75110 140.05777
+40.73526 140.12639
+40.76471 140.18027
+40.78249 140.24081
+40.83081 140.28249
+40.88998 140.30055
+40.94804 140.31194
+40.99832 140.34444
+99.00000 999.00000
+40.95110 140.65665
+40.90109 140.66859
+40.85638 140.69443
+40.82138 140.74971
+40.83026 140.81555
+40.87749 140.85248
+40.92027 140.86388
+40.96332 140.86638
+40.98332 140.90582
+40.95665 140.96304
+99.00000 999.00000
+40.94249 141.40027
+40.88943 141.40193
+40.84471 141.40582
+40.79248 141.41222
+40.74055 141.41748
+40.69055 141.42860
+40.64305 141.44693
+40.59389 141.46056
+40.54776 141.48332
+40.52248 141.53806
+40.51721 141.59193
+40.47888 141.63914
+40.44055 141.68414
+40.39638 141.71388
+40.35664 141.75526
+40.31248 141.77972
+40.27110 141.81665
+40.22527 141.84138
+40.18193 141.80888
+40.14943 141.87109
+40.11055 141.84471
+40.05914 141.84444
+40.02277 141.89499
+99.00000 999.00000
+40.91693 141.01971
+40.88193 141.07498
+40.85748 141.13805
+40.89806 141.18472
+40.95915 141.21805
+99.00000 999.00000
+41.01222 129.71805
+41.07056 129.71971
+41.12360 129.71860
+41.17722 129.71860
+41.23471 129.74361
+41.28806 129.75581
+41.33388 129.78860
+41.38110 129.79222
+41.41360 129.74193
+41.44556 129.68610
+41.49416 129.66722
+41.54971 129.66415
+41.60832 129.68582
+41.65776 129.71498
+41.70555 129.75305
+41.75722 129.78499
+41.76109 129.85527
+41.81415 129.88472
+41.86916 129.88055
+41.88971 129.93748
+41.92581 129.97276
+99.00000 999.00000
+41.54111 139.98721
+41.59248 139.97972
+99.00000 999.00000
+41.02638 140.36581
+41.06749 140.33194
+41.10805 140.29414
+41.12831 140.29610
+41.16998 140.33194
+41.22388 140.33472
+41.23471 140.38110
+41.19832 140.43222
+41.18721 140.49361
+41.21944 140.54555
+41.20055 140.61276
+41.15944 140.64943
+41.09915 140.63165
+41.04749 140.63971
+99.00000 999.00000
+41.16638 140.93776
+41.15498 140.87305
+41.12582 140.81943
+41.14806 140.76944
+41.20248 140.78055
+41.25471 140.78888
+41.31165 140.80722
+41.36276 140.83055
+41.41693 140.85361
+41.46748 140.89555
+41.52361 140.90889
+41.50665 140.97221
+99.00000 999.00000
+41.98360 140.90166
+41.94139 140.93582
+41.90248 140.97998
+99.00000 999.00000
+41.71527 140.95805
+41.74722 140.89389
+41.76498 140.81082
+41.75888 140.74248
+41.75638 140.69859
+41.79359 140.72916
+41.82610 140.67610
+41.79414 140.62360
+41.73415 140.60277
+41.70776 140.54610
+41.68915 140.48555
+41.65582 140.43748
+41.60027 140.43277
+41.55026 140.44360
+41.51193 140.40527
+41.50026 140.34027
+41.48415 140.27832
+41.44055 140.23332
+41.39499 140.18971
+41.41582 140.12193
+41.42915 140.05194
+41.47638 140.01889
+41.62444 140.00026
+99.00000 999.00000
+41.68138 140.01222
+41.73138 140.05331
+41.78471 140.07332
+41.81165 140.12610
+41.86610 140.12694
+41.91888 140.14610
+41.97026 140.13860
+99.00000 999.00000
+41.43193 141.14305
+41.39082 141.18056
+41.35304 141.22861
+41.33998 141.30777
+41.35193 141.37305
+41.38443 141.42610
+41.39748 141.47110
+41.34389 141.45581
+41.28555 141.43721
+41.22693 141.42221
+41.16748 141.39943
+41.11388 141.39998
+41.06248 141.40359
+41.00861 141.40498
+99.00000 999.00000
+41.04749 141.24081
+41.10443 141.25638
+41.15944 141.27638
+41.20555 141.25221
+41.24472 141.20860
+41.25249 141.14972
+41.21971 141.13722
+41.19221 141.08221
+41.17972 141.01971
+99.00000 999.00000
+41.47581 141.05556
+41.44972 141.12138
+99.00000 999.00000
+41.88277 141.03831
+41.86499 141.10971
+41.82832 141.16081
+41.78943 141.19165
+41.77914 141.12582
+41.74055 141.07889
+41.71248 141.02306
+99.00000 999.00000
+41.97165 143.25832
+41.92805 143.23499
+41.96277 143.17749
+99.00000 999.00000
+42.04111 130.06444
+42.07304 130.09277
+42.06221 130.15610
+42.09581 130.18610
+42.13609 130.20610
+42.17694 130.23277
+42.21082 130.28194
+42.19777 130.30249
+42.20860 130.33916
+42.24443 130.38248
+42.26915 130.37971
+42.31915 130.40305
+42.30998 130.45776
+42.31415 130.51721
+42.30055 130.58748
+42.25360 130.60472
+42.27306 130.66666
+42.29860 130.70860
+42.34164 130.75082
+42.40305 130.76527
+42.45943 130.78831
+42.48610 130.84222
+42.51527 130.85748
+42.55222 130.84665
+42.57805 130.78027
+42.57915 130.73805
+42.61581 130.72888
+42.64748 130.67331
+42.68748 130.71664
+42.68248 130.78665
+42.67581 130.83972
+42.65527 130.79138
+42.64638 130.83665
+42.64444 130.90109
+42.62971 130.94832
+42.63110 130.89638
+42.63055 130.82248
+42.60027 130.87555
+42.60722 130.94498
+42.63777 130.99777
+99.00000 999.00000
+42.63416 131.05582
+42.63055 131.09999
+42.65277 131.12555
+42.60777 131.14693
+42.58221 131.17471
+42.55415 131.21498
+42.60056 131.23082
+42.64722 131.22165
+42.68222 131.25861
+42.73389 131.26414
+42.77832 131.30388
+42.76414 131.36861
+42.81110 131.36249
+42.84027 131.41611
+42.86943 131.47081
+42.87305 131.41666
+42.90582 131.39555
+42.94139 131.41055
+42.94110 131.46999
+42.96889 131.48888
+99.00000 999.00000
+42.96056 131.90109
+42.95581 131.82999
+42.98055 131.77081
+42.99554 131.92305
+99.00000 999.00000
+42.96416 132.28581
+42.91443 132.29332
+42.86388 132.30331
+42.84721 132.33888
+42.89027 132.35248
+42.91943 132.39110
+42.93138 132.44443
+42.91277 132.50777
+42.85915 132.51360
+42.83888 132.57610
+42.85693 132.63889
+42.86777 132.68222
+42.90193 132.73248
+42.87610 132.77332
+42.82056 132.77443
+42.77693 132.79831
+42.73999 132.84471
+42.76443 132.88527
+42.80556 132.88777
+42.82056 132.95248
+99.00000 999.00000
+42.77498 133.03610
+42.73499 133.07610
+42.72861 133.01109
+42.68414 133.02805
+42.68277 133.10472
+42.69611 133.17139
+42.73471 133.21889
+42.75110 133.28110
+42.75748 133.34444
+42.76915 133.41165
+42.79082 133.47110
+42.82056 133.52332
+42.82639 133.57944
+42.85248 133.63306
+42.83582 133.68332
+42.82944 133.72861
+42.86472 133.77527
+42.89055 133.83194
+42.88582 133.88110
+42.88832 133.93498
+42.92805 133.98444
+99.00000 999.00000
+42.95915 134.02972
+42.98389 134.08693
+99.00000 999.00000
+42.12277 139.96359
+42.15498 139.90721
+42.19582 139.86971
+42.22610 139.80081
+42.27306 139.78139
+42.32138 139.77110
+42.37444 139.80888
+42.43304 139.83748
+42.49055 139.84776
+42.54248 139.84248
+42.59248 139.82915
+42.64888 139.85889
+42.67776 139.91415
+42.67722 139.98776
+99.00000 999.00000
+42.22139 139.49638
+42.23776 139.55888
+42.18860 139.53389
+42.13638 139.52055
+42.07721 139.49693
+42.05249 139.44859
+42.09581 139.42082
+42.14581 139.40944
+42.20193 139.43332
+99.00000 999.00000
+42.29805 140.96971
+42.32999 140.93694
+42.34222 140.97305
+42.37498 140.91081
+42.42389 140.89638
+42.46332 140.85472
+42.49777 140.79694
+42.54027 140.76471
+42.57332 140.70332
+42.57166 140.63138
+42.57304 140.55914
+42.57498 140.48639
+42.54498 140.43222
+42.50305 140.38527
+42.45332 140.34360
+42.39471 140.30748
+42.33360 140.28305
+42.27832 140.28055
+42.23389 140.30914
+42.20888 140.38722
+42.17471 140.44582
+42.13664 140.49248
+42.10527 140.55138
+42.11499 140.61777
+42.12027 140.68694
+42.10999 140.75139
+42.07027 140.79305
+42.02805 140.82639
+99.00000 999.00000
+42.00943 140.11139
+42.05138 140.07639
+42.09444 140.04414
+99.00000 999.00000
+42.67694 140.02443
+42.71332 140.07443
+42.74277 140.12915
+42.79166 140.17139
+42.79860 140.21999
+42.75806 140.25861
+42.77832 140.31194
+42.82805 140.32277
+42.87471 140.36526
+42.91972 140.41081
+42.95721 140.46082
+42.98805 140.51471
+99.00000 999.00000
+42.51889 141.96359
+42.55804 141.91972
+42.58777 141.84805
+42.61026 141.76639
+42.61526 141.69556
+42.61415 141.62360
+42.60304 141.55777
+42.58582 141.49554
+42.56831 141.43359
+42.54027 141.37805
+42.50693 141.32582
+42.47888 141.27026
+42.44611 141.22055
+42.42526 141.15999
+42.39444 141.10638
+42.35832 141.05611
+42.31415 141.01054
+99.00000 999.00000
+42.09999 142.95776
+42.11748 142.88081
+42.13889 142.80194
+42.16666 142.72276
+42.19415 142.65109
+42.22804 142.59082
+42.25139 142.51109
+42.28194 142.44388
+42.31276 142.37498
+42.34415 142.30748
+42.38026 142.25415
+42.42139 142.20139
+42.44804 142.12915
+42.47055 142.04472
+99.00000 999.00000
+42.90665 143.98972
+42.87248 143.93694
+42.84277 143.88693
+42.79971 143.83888
+42.75832 143.79054
+42.71971 143.73972
+42.68639 143.68694
+42.65193 143.63472
+42.61055 143.58638
+42.56471 143.53998
+42.51805 143.49944
+42.46748 143.45665
+42.41498 143.41498
+42.36165 143.37389
+42.30026 143.33748
+42.24277 143.32555
+42.19165 143.33194
+42.13777 143.33081
+42.08081 143.31943
+42.02722 143.30443
+99.00000 999.00000
+42.01610 143.12805
+42.04860 143.06360
+41.98334 142.98334
+99.00000 999.00000
+42.97527 144.93277
+42.98694 144.86581
+99.00000 999.00000
+42.97026 144.73694
+42.93027 144.77943
+42.92499 144.71915
+42.93971 144.63889
+42.94360 144.56444
+42.93111 144.49944
+42.94221 144.42110
+42.97777 144.36777
+42.99609 144.31165
+42.98109 144.24805
+42.96748 144.17943
+42.95055 144.11693
+42.93082 144.05498
+99.00000 999.00000
+43.04248 131.57889
+43.08693 131.62082
+43.12526 131.66554
+43.16832 131.69360
+43.16055 131.64276
+43.19388 131.67943
+43.16832 131.72581
+43.19666 131.74832
+43.21638 131.74971
+43.27472 131.76109
+43.31831 131.80081
+43.32414 131.82889
+43.31248 131.86555
+43.30804 131.92360
+43.27805 131.97610
+99.00000 999.00000
+43.23415 131.98888
+43.21248 131.92888
+43.16193 131.89581
+43.10999 131.85971
+43.08388 131.85777
+43.11165 131.91110
+43.08026 131.88943
+43.06360 131.95082
+43.09639 131.99832
+99.00000 999.00000
+43.02055 131.79166
+43.04665 131.80832
+43.05055 131.84222
+43.04915 131.87694
+43.02110 131.91722
+99.00000 999.00000
+43.30638 132.00972
+43.30194 132.05305
+43.26360 132.01193
+99.00000 999.00000
+43.11638 132.03638
+43.16081 132.07889
+43.19221 132.13193
+43.21193 132.19360
+43.24693 132.24306
+43.28693 132.28915
+43.31276 132.30582
+43.27722 132.35498
+43.24222 132.30527
+43.21443 132.36026
+43.17249 132.36194
+43.15082 132.32805
+43.10915 132.32193
+43.07166 132.29555
+43.02638 132.30276
+99.00000 999.00000
+43.01915 134.12305
+43.05331 134.17444
+43.08360 134.22331
+43.10248 134.28526
+43.11832 134.34027
+43.14221 134.39832
+43.17305 134.45164
+43.19777 134.50943
+43.23193 134.56027
+43.25139 134.62164
+43.28194 134.67499
+43.30638 134.73389
+43.33693 134.78722
+43.37805 134.83331
+43.40665 134.88805
+43.42943 134.94722
+43.46027 134.99026
+99.00000 999.00000
+43.48164 135.04305
+43.49554 135.10944
+43.53499 135.13527
+43.58139 135.17610
+43.62360 135.20305
+43.67055 135.22249
+43.70555 135.18166
+43.72998 135.23389
+43.69249 135.25972
+43.71138 135.31581
+43.73581 135.37415
+43.76389 135.42831
+43.78998 135.45248
+43.83582 135.48944
+43.87915 135.51443
+43.88693 135.48277
+43.92860 135.46193
+43.93304 135.49971
+43.95499 135.51443
+43.99554 135.53526
+99.00000 999.00000
+43.03139 140.50943
+43.07944 140.48138
+43.12082 140.44472
+43.16026 140.40222
+43.19415 140.34389
+43.24110 140.32222
+43.29749 140.35277
+43.32056 140.40166
+43.35138 140.45581
+43.35138 140.51610
+43.31610 140.57082
+43.28831 140.64444
+43.24915 140.68832
+43.21915 140.75861
+43.18498 140.81110
+43.19556 140.87776
+43.21416 140.93971
+43.19415 140.99915
+99.00000 999.00000
+43.16888 141.05165
+43.14499 141.13527
+99.00000 999.00000
+43.14526 141.21722
+43.17665 141.27193
+43.21359 141.32248
+43.25388 141.37164
+43.30249 141.41498
+43.36276 141.43639
+43.41472 141.43222
+43.45749 141.39972
+43.50082 141.36861
+43.54999 141.36388
+43.59831 141.38081
+43.64581 141.36305
+43.69139 141.33693
+43.74860 141.35889
+43.79749 141.40305
+43.82193 141.46165
+43.83832 141.52527
+43.86693 141.58221
+43.90805 141.62555
+43.96443 141.64832
+99.00000 999.00000
+43.98248 144.32332
+43.94859 144.38527
+43.93832 144.45193
+43.92722 144.53221
+43.91972 144.60944
+43.91165 144.69276
+99.00000 999.00000
+43.91222 144.76555
+43.93889 144.82332
+43.97165 144.87749
+99.00000 999.00000
+43.01054 144.83972
+43.04472 144.79889
+43.00360 144.74971
+99.00000 999.00000
+43.95415 145.14806
+43.89555 145.10971
+43.84332 145.10999
+43.79305 145.07860
+43.74026 145.07999
+43.69582 145.10889
+43.65222 145.14139
+43.61638 145.19777
+43.57111 145.22305
+43.52527 145.24582
+43.47804 145.26332
+43.42943 145.27832
+43.38248 145.29721
+43.33943 145.33194
+43.30249 145.38443
+43.31082 145.33055
+43.34222 145.26971
+43.30777 145.28471
+43.27666 145.30777
+43.25638 145.39027
+43.25110 145.46555
+43.23555 145.52306
+43.27554 145.50555
+43.30888 145.55888
+43.34444 145.61165
+43.38026 145.65749
+43.37749 145.73109
+43.37944 145.79498
+43.35498 145.78693
+43.32498 145.73109
+43.30443 145.67055
+43.28665 145.60944
+43.24582 145.56721
+43.19527 145.53444
+43.16277 145.50638
+43.17526 145.43027
+43.17082 145.36415
+43.16443 145.29582
+43.14165 145.23639
+43.13306 145.16888
+43.10110 145.11748
+43.07610 145.16249
+43.05972 145.10081
+43.03221 145.06888
+43.03915 145.00305
+99.00000 999.00000
+43.54582 145.35138
+43.51805 145.26889
+43.55914 145.32693
+43.59581 145.24388
+43.60027 145.24165
+99.00000 999.00000
+43.94139 145.78693
+43.90805 145.73277
+43.89972 145.66472
+43.86360 145.61526
+43.81749 145.57527
+43.76527 145.57664
+43.71056 145.56805
+43.65555 145.55943
+43.68776 145.54443
+43.72972 145.52248
+43.71277 145.45860
+43.75026 145.42610
+43.80388 145.42749
+43.84444 145.42665
+43.88443 145.47415
+43.91331 145.53055
+43.94777 145.58415
+43.97943 145.63914
+99.00000 999.00000
+43.53249 146.19194
+43.50388 146.20471
+43.47055 146.17444
+43.46944 146.12305
+43.50972 146.08110
+43.53499 146.12915
+99.00000 999.00000
+43.86249 146.87277
+43.84360 146.93193
+43.79639 146.90527
+43.77777 146.85304
+43.75722 146.79166
+43.73610 146.73109
+43.71056 146.68832
+43.72276 146.62831
+43.76555 146.61249
+43.80832 146.61693
+43.82414 146.68082
+43.84248 146.74388
+43.86081 146.80722
+43.86388 146.87054
+99.00000 999.00000
+44.01414 135.59027
+44.04944 135.63193
+44.10248 135.65138
+44.15332 135.64638
+44.18832 135.69611
+44.23860 135.73444
+44.25943 135.79582
+44.30832 135.83360
+44.36110 135.84305
+44.40138 135.89027
+44.41805 135.94998
+99.00000 999.00000
+44.45415 136.06638
+44.47556 136.12721
+44.50916 136.17972
+44.56221 136.20888
+44.60609 136.22472
+44.66611 136.24582
+44.69611 136.30081
+44.72305 136.31221
+44.76193 136.34389
+44.77832 136.39110
+44.78221 136.44055
+44.83305 136.46082
+44.86748 136.51414
+44.90277 136.56165
+44.94748 136.57111
+44.99110 136.61665
+99.00000 999.00000
+44.03415 141.66998
+44.08611 141.66582
+44.13832 141.66306
+44.18915 141.65498
+44.24277 141.65721
+44.29472 141.65082
+44.34555 141.69331
+44.40082 141.73332
+44.45860 141.75806
+44.51360 141.76389
+44.57388 141.78581
+44.63026 141.79694
+44.68304 141.79527
+44.73444 141.78998
+44.78444 141.77888
+44.83556 141.76915
+44.88277 141.75139
+44.92943 141.72861
+44.97527 141.70581
+99.00000 999.00000
+44.98389 142.55388
+44.94165 142.58888
+44.89777 142.61748
+44.85860 142.66222
+44.81776 142.70277
+99.00000 999.00000
+44.76944 142.74971
+44.72998 142.79332
+44.69139 142.84138
+44.65498 142.89693
+44.61806 142.94777
+44.57777 142.99055
+99.00000 999.00000
+44.54582 143.04111
+44.50943 143.09639
+44.47276 143.15248
+44.44110 143.22165
+44.40359 143.27527
+44.37498 143.35443
+44.32944 143.37971
+44.29639 143.44498
+44.26665 143.52026
+44.23944 143.60416
+44.21111 143.68414
+44.18832 143.76971
+44.18359 143.71527
+44.16165 143.69859
+44.11693 143.72499
+44.09248 143.78055
+44.10056 143.84999
+44.09526 143.92360
+44.12582 143.97916
+99.00000 999.00000
+44.16443 143.86665
+44.15166 143.94638
+44.14305 143.92471
+44.15749 143.84305
+99.00000 999.00000
+44.12526 144.08221
+44.11249 144.16277
+44.08748 144.13193
+44.03471 144.10722
+44.02306 144.16666
+44.07639 144.19693
+44.11305 144.23444
+44.08443 144.25832
+44.03638 144.27443
+99.00000 999.00000
+44.08722 145.00610
+44.12164 145.06055
+44.15414 145.11499
+44.18527 145.17055
+44.23138 145.21748
+44.27527 145.26443
+44.32332 145.31055
+44.32472 145.34776
+44.27998 145.37444
+44.22305 145.35527
+44.16611 145.31444
+44.12305 145.26694
+99.00000 999.00000
+44.14888 145.97249
+44.10748 145.92276
+44.05722 145.88222
+44.01889 145.86555
+44.00388 145.66943
+99.00000 999.00000
+44.03915 145.72249
+44.08388 145.75444
+44.13582 145.78249
+44.16998 145.83638
+44.22499 145.87138
+44.26443 145.92110
+44.29388 145.97748
+99.00000 999.00000
+44.50861 146.17139
+44.47693 146.23277
+44.44026 146.28806
+44.42165 146.36693
+44.42331 146.43915
+44.43082 146.50777
+44.44693 146.57222
+44.39276 146.54639
+44.36139 146.49361
+44.36888 146.42805
+44.33582 146.37526
+44.29166 146.32971
+44.27138 146.26805
+44.26999 146.21193
+44.25943 146.14471
+44.23164 146.08722
+44.18027 146.04277
+99.00000 999.00000
+44.34526 146.01054
+44.39861 146.02914
+44.44666 146.07414
+44.49582 146.11110
+99.00000 999.00000
+44.47722 146.99332
+44.41443 146.95860
+44.39943 146.86555
+44.45831 146.83556
+44.51776 146.91026
+44.58221 146.91193
+44.55443 146.94081
+99.00000 999.00000
+44.97888 147.88748
+44.95915 147.79305
+44.96248 147.71693
+44.96915 147.62999
+44.91165 147.58832
+44.86139 147.58443
+44.80055 147.53526
+44.75471 147.45581
+44.71056 147.36472
+44.66081 147.28665
+44.59888 147.24860
+44.54111 147.18971
+44.52832 147.09721
+44.49527 147.00861
+99.00000 999.00000
+44.61748 147.03471
+44.63748 147.11722
+44.69859 147.16388
+44.73805 147.10056
+44.79388 147.11194
+44.78665 147.19832
+44.84805 147.24165
+44.88554 147.33916
+44.94415 147.42082
+44.99944 147.49306
+99.00000 999.00000
+45.03305 136.67194
+45.06305 136.72556
+45.10138 136.77498
+45.16222 136.79915
+45.20526 136.84055
+45.23332 136.88971
+45.26389 136.94498
+45.30110 136.99609
+99.00000 999.00000
+45.33194 137.04555
+45.35889 137.10332
+45.38832 137.15944
+45.43999 137.19804
+45.47165 137.25110
+45.52498 137.29082
+45.57248 137.33415
+45.61305 137.38248
+45.64499 137.43694
+45.67082 137.49664
+45.71027 137.54555
+45.74222 137.60027
+45.77914 137.65109
+45.82915 137.69305
+45.87665 137.73055
+45.92831 137.77138
+45.96805 137.82056
+99.00000 999.00000
+45.40082 140.99138
+45.44832 140.97415
+99.00000 999.00000
+45.02722 141.66859
+45.07971 141.63361
+45.12305 141.60304
+45.16998 141.58165
+45.22139 141.57610
+45.27666 141.61026
+45.32472 141.64165
+45.37665 141.64165
+45.42972 141.64249
+45.42165 141.68694
+45.40805 141.72888
+45.41638 141.79889
+45.43860 141.86110
+45.48944 141.88165
+45.51414 141.94139
+99.00000 999.00000
+45.25055 141.20831
+45.21999 141.27193
+45.18082 141.31638
+45.13664 141.31776
+45.09915 141.26639
+45.11526 141.19194
+45.15082 141.13748
+45.19859 141.13693
+45.24026 141.17055
+99.00000 999.00000
+45.44832 141.04166
+45.40831 141.07332
+45.35277 141.06555
+45.29639 141.05527
+45.28581 141.03082
+45.33194 141.00861
+99.00000 999.00000
+45.43082 142.03027
+45.38860 142.06444
+45.35609 142.13026
+45.32193 142.19055
+45.28194 142.23222
+45.24193 142.27388
+45.20193 142.31526
+45.16331 142.36165
+45.12471 142.40915
+45.08638 142.45776
+45.04971 142.51027
+45.00638 142.54138
+99.00000 999.00000
+45.93472 142.02888
+45.89555 142.07359
+45.92831 142.10443
+45.98360 142.11305
+99.00000 999.00000
+45.03777 147.50221
+45.08722 147.52998
+45.05943 147.60805
+45.10582 147.67749
+45.16638 147.73277
+45.20471 147.82138
+45.23665 147.89249
+45.30305 147.87164
+45.36861 147.86360
+45.42331 147.94221
+45.36665 147.96832
+99.00000 999.00000
+45.44943 148.84471
+45.39915 148.80972
+45.33498 148.82527
+45.30832 148.72832
+45.31888 148.63777
+45.29831 148.54222
+45.24805 148.44722
+45.23222 148.35138
+45.20776 148.25555
+45.15472 148.15860
+45.10110 148.06721
+99.00000 999.00000
+45.24860 148.06082
+45.25916 148.15443
+45.26860 148.24805
+45.28139 148.34222
+45.34082 148.40749
+45.39777 148.47055
+45.45332 148.54860
+45.49748 148.62471
+45.52443 148.71999
+99.00000 999.00000
+45.58638 149.47888
+45.59749 149.57359
+45.61026 149.59082
+45.63306 149.68414
+45.68665 149.76471
+45.74443 149.82944
+45.78305 149.91693
+45.83388 149.99110
+99.00000 999.00000
+45.94081 149.87694
+45.88222 149.82111
+45.85999 149.72360
+45.82610 149.65193
+45.77554 149.59415
+45.71359 149.55388
+45.65721 149.50276
+45.60332 149.47360
+99.00000 999.00000
+45.85361 150.07138
+45.89998 150.15889
+45.95164 150.20277
+99.00000 999.00000
+46.00777 137.86305
+46.04721 137.91222
+46.10027 137.94055
+46.13138 137.99832
+99.00000 999.00000
+46.16472 138.04305
+46.21027 138.08832
+46.26360 138.10944
+46.32056 138.13138
+46.38248 138.15610
+46.43721 138.19472
+46.48694 138.23831
+46.51054 138.29944
+46.55360 138.34526
+46.60805 138.34721
+46.66388 138.35443
+46.72276 138.37971
+46.78194 138.41277
+46.83055 138.45639
+46.87498 138.50305
+46.92972 138.50555
+46.98805 138.54277
+99.00000 999.00000
+46.89471 141.97527
+46.83527 141.93860
+46.77609 141.91388
+46.71555 141.88081
+46.65498 141.85555
+46.60222 141.82056
+46.54999 141.81471
+46.49582 141.81749
+46.44611 141.82664
+46.39998 141.84360
+46.35388 141.86555
+46.30748 141.88609
+46.25916 141.90027
+46.20888 141.90831
+46.15944 141.91859
+46.11055 141.93166
+46.05582 141.92555
+46.01248 141.95639
+99.00000 999.00000
+46.01164 142.15610
+46.04248 142.20164
+46.09694 142.21416
+46.15166 142.24193
+46.21277 142.25165
+46.26776 142.25943
+46.32805 142.28806
+46.38805 142.32610
+46.44804 142.36110
+46.50888 142.38832
+46.56972 142.41527
+46.62444 142.45610
+46.67110 142.50276
+46.69722 142.56360
+46.71638 142.62776
+46.73305 142.69388
+46.71664 142.72722
+46.66943 142.74498
+46.62222 142.76248
+46.59499 142.81194
+46.59831 142.88609
+46.60498 142.95831
+99.00000 999.00000
+46.58556 143.03444
+46.58611 143.11055
+46.58665 143.18639
+46.55055 143.24248
+46.51248 143.29054
+46.54582 143.28110
+46.56194 143.32889
+46.53499 143.38664
+46.48749 143.35693
+46.46222 143.34526
+46.40805 143.33943
+46.35999 143.35609
+46.31526 143.38222
+46.26776 143.39943
+46.22165 143.42027
+46.17082 143.42581
+46.11861 143.42638
+46.06305 143.41222
+46.01944 143.43138
+46.07443 143.45499
+46.12360 143.47165
+46.17581 143.47139
+46.22055 143.51639
+46.27888 143.53665
+46.31805 143.57332
+46.35860 143.60664
+46.38664 143.57721
+46.42499 143.57944
+46.47139 143.55859
+46.51971 143.54555
+46.56831 143.53221
+46.62109 143.53221
+46.66805 143.51164
+46.72276 143.52026
+46.76999 143.50305
+46.81721 143.48610
+46.83305 143.43193
+46.78888 143.40610
+46.79111 143.32805
+46.81581 143.24081
+46.82860 143.18082
+46.78055 143.18498
+46.76665 143.26999
+46.74361 143.35165
+46.70277 143.39082
+46.68721 143.33026
+46.70943 143.24609
+46.70555 143.17221
+46.75000 143.14360
+46.79054 143.10304
+46.83722 143.09499
+46.84082 143.16777
+46.85748 143.14194
+46.87164 143.11610
+46.91443 143.10472
+46.96359 143.09360
+99.00000 999.00000
+46.00777 150.22693
+46.05666 150.31526
+46.10777 150.40443
+46.16249 150.48499
+46.20360 150.55748
+46.19859 150.46222
+46.21277 150.37109
+46.17860 150.27972
+46.13832 150.20972
+46.08665 150.13914
+46.06805 150.04749
+99.00000 999.00000
+46.95665 151.96304
+46.90248 151.89665
+46.85498 151.82999
+46.85889 151.73526
+46.80110 151.71222
+46.77306 151.80110
+46.82056 151.89082
+46.87054 151.95998
+99.00000 999.00000
+46.88889 152.01305
+46.94804 152.06749
+46.99443 152.14389
+99.00000 999.00000
+47.04582 138.57527
+47.08916 138.62277
+47.11861 138.68027
+47.15610 138.73222
+47.19748 138.78110
+47.24443 138.82639
+47.28860 138.87360
+47.31027 138.93359
+47.34222 138.98305
+99.00000 999.00000
+47.38443 139.02081
+47.43498 139.05360
+47.48499 139.05443
+47.53471 139.09305
+47.58527 139.13138
+47.63889 139.17221
+47.68332 139.21165
+47.73831 139.23444
+47.79443 139.27055
+47.83665 139.31943
+47.88055 139.36748
+47.92027 139.41832
+47.94582 139.47943
+47.98193 139.53305
+99.00000 999.00000
+47.64581 141.99165
+47.59138 141.96138
+47.53777 141.95776
+47.48332 141.95139
+47.43277 141.95915
+47.38554 141.97832
+47.33415 141.98248
+47.27998 141.97832
+99.00000 999.00000
+47.97998 142.18721
+47.92444 142.17221
+47.88222 142.12193
+47.83081 142.07944
+47.77388 142.06389
+47.72110 142.02609
+99.00000 999.00000
+47.21722 142.03499
+47.16972 142.05194
+47.11916 142.05859
+47.06444 142.05305
+47.00665 142.03526
+99.00000 999.00000
+47.29665 142.96277
+47.34027 142.93332
+47.37971 142.88971
+47.41165 142.81972
+47.42415 142.74193
+47.44165 142.74472
+47.48499 142.71388
+47.52666 142.67555
+47.56831 142.63943
+47.61165 142.60971
+47.65639 142.58388
+47.70221 142.56194
+47.75139 142.55026
+47.79944 142.53638
+47.85193 142.53777
+47.90193 142.52998
+47.96056 142.55138
+99.00000 999.00000
+47.04860 143.04472
+47.09915 143.03860
+47.15166 143.03915
+47.19914 143.02306
+47.24971 143.01721
+99.00000 999.00000
+47.15805 152.20972
+47.13693 152.17581
+47.07889 152.10971
+47.01944 152.05693
+99.00000 999.00000
+47.03831 152.16222
+47.09665 152.22472
+47.15248 152.28638
+47.13361 152.22415
+99.00000 999.00000
+47.30611 152.47916
+47.34193 152.53749
+47.38138 152.45639
+47.34415 152.38805
+99.00000 999.00000
+47.69693 153.02693
+47.74055 153.08943
+47.80832 153.07414
+47.77165 153.00581
+99.00000 999.00000
+48.01305 139.57443
+48.04971 139.62749
+48.08998 139.67805
+48.14221 139.71277
+48.18166 139.76332
+48.21582 139.81831
+48.24748 139.87555
+48.28665 139.92805
+48.31638 139.98639
+99.00000 999.00000
+48.33693 140.04332
+48.39471 140.07248
+48.43082 140.12498
+48.45943 140.17972
+48.51665 140.19276
+48.56276 140.17165
+48.60056 140.19249
+48.64693 140.18555
+48.70248 140.19582
+48.75861 140.21388
+48.81139 140.24527
+48.85944 140.26639
+48.89055 140.32414
+48.93610 140.36165
+48.98499 140.39110
+99.00000 999.00000
+48.98749 140.29749
+48.97388 140.27914
+48.99388 140.26831
+99.00000 999.00000
+48.92249 141.97610
+48.87498 141.96722
+48.83443 141.92249
+48.78806 141.87444
+48.73610 141.85722
+48.68860 141.87332
+48.64305 141.89610
+48.59915 141.92415
+48.55693 141.95860
+48.51555 141.99664
+99.00000 999.00000
+48.50665 142.00249
+99.00000 999.00000
+48.46388 142.03444
+48.42249 142.07138
+48.37944 142.10304
+48.33305 142.12389
+48.28722 142.14638
+48.23805 142.15694
+48.18721 142.16081
+48.13582 142.16582
+48.08415 142.16859
+48.03389 142.17526
+99.00000 999.00000
+48.01555 142.54665
+48.06972 142.56749
+48.12721 142.58943
+48.18748 142.61388
+48.24693 142.63914
+48.30443 142.67221
+48.36526 142.70360
+48.42610 142.73444
+48.48248 142.74944
+48.54193 142.77472
+48.60138 142.81139
+48.66249 142.84360
+48.72221 142.87054
+48.78276 142.90805
+48.84360 142.93915
+48.89748 142.98248
+48.95082 142.98860
+48.99777 142.97055
+99.00000 999.00000
+48.96664 144.46693
+48.92805 144.51471
+48.88805 144.55943
+48.84639 144.59499
+48.80331 144.62665
+48.75777 144.64888
+48.70721 144.65248
+48.66138 144.67555
+48.63638 144.73164
+48.66748 144.71359
+48.71332 144.69081
+48.76360 144.68915
+48.80914 144.69804
+48.85999 144.69360
+48.89777 144.64194
+48.93193 144.57805
+48.96527 144.51164
+99.00000 999.00000
+48.05360 153.29054
+48.11555 153.25806
+48.13081 153.16360
+48.07472 153.17221
+99.00000 999.00000
+48.74944 154.06332
+48.80859 154.11665
+48.85304 154.20221
+48.91110 154.21138
+48.89499 154.11221
+48.83110 154.09526
+48.78831 154.00665
+99.00000 999.00000
+49.00806 140.21832
+49.02361 140.28722
+49.04721 140.34415
+49.08221 140.29388
+49.09610 140.35609
+49.14331 140.37389
+49.19249 140.36971
+49.21443 140.34055
+49.25000 140.37471
+49.27165 140.36722
+49.29388 140.35332
+49.29138 140.43527
+49.34332 140.43388
+49.39665 140.44443
+49.45360 140.47777
+49.50165 140.51721
+49.54860 140.55055
+49.59972 140.54971
+49.64471 140.52361
+49.69276 140.51027
+49.75221 140.53749
+49.78806 140.48610
+49.82639 140.43915
+49.86693 140.40944
+49.90527 140.44026
+49.95639 140.47472
+49.99110 140.52472
+99.00000 999.00000
+49.97638 142.15999
+49.92389 142.14276
+49.87193 142.13165
+49.82639 142.15555
+49.77527 142.15831
+49.72081 142.14915
+49.67055 142.15443
+49.61638 142.14665
+49.56305 142.14139
+49.50861 142.13193
+49.45277 142.11888
+49.39276 142.09082
+49.33527 142.06776
+49.28249 142.06526
+49.23332 142.07472
+49.17943 142.06805
+49.12555 142.02972
+49.07304 142.02859
+49.01694 142.01414
+99.00000 999.00000
+49.03806 142.96609
+49.09555 142.98665
+99.00000 999.00000
+49.14499 143.02222
+49.18748 143.07359
+49.21944 143.13165
+49.24777 143.19998
+49.27055 143.26277
+49.28499 143.33276
+49.29582 143.40498
+49.30556 143.47777
+49.30415 143.55804
+49.30443 143.63693
+49.31888 143.61806
+49.32027 143.53777
+49.32082 143.45831
+49.31638 143.38193
+49.32111 143.31389
+49.35110 143.27666
+49.39082 143.26222
+49.39832 143.33693
+49.39249 143.41693
+49.35527 143.46832
+49.34389 143.53139
+49.33859 143.61388
+49.33527 143.69527
+49.31665 143.68694
+49.29776 143.75748
+49.28581 143.84444
+49.27777 143.92860
+99.00000 999.00000
+49.26109 144.01054
+49.23082 144.08832
+49.19693 144.15277
+49.15639 144.19276
+49.12109 144.25415
+49.07582 144.27805
+49.03998 144.33556
+49.00555 144.39806
+99.00000 999.00000
+49.02609 144.41331
+49.07111 144.38722
+49.11581 144.36221
+49.16026 144.33556
+49.20360 144.30611
+49.24805 144.27943
+49.29472 144.26555
+49.34222 144.25110
+49.38860 144.23248
+49.43721 144.22165
+49.48776 144.21777
+49.53665 144.20860
+49.58055 144.17943
+49.62305 144.14581
+49.66972 144.12498
+49.72081 144.12389
+49.76971 144.11444
+49.81415 144.08415
+49.85860 144.05859
+49.90414 144.03693
+49.94972 144.01527
+49.99832 144.00555
+99.00000 999.00000
+49.12639 154.45776
+49.07582 154.52110
+49.11832 154.60081
+49.15582 154.52554
+99.00000 999.00000
+49.28526 154.61276
+49.26222 154.70721
+49.29721 154.80331
+49.35889 154.82693
+49.42998 154.79027
+49.49248 154.81805
+49.54749 154.88222
+49.61139 154.90054
+49.64832 154.83249
+49.59721 154.75888
+49.53581 154.73665
+49.47388 154.70499
+49.41693 154.63443
+49.36055 154.60056
+49.29555 154.60081
+99.00000 999.00000
+49.73360 154.42499
+49.79443 154.45805
+49.83388 154.39832
+49.77415 154.35748
+99.00000 999.00000
+50.00471 140.56360
+50.03638 140.62193
+50.06831 140.68027
+50.09360 140.67027
+50.07359 140.60332
+50.10416 140.56221
+50.14610 140.52722
+50.19611 140.52055
+50.24889 140.52972
+50.29805 140.51805
+50.34915 140.53972
+50.39526 140.51944
+50.44415 140.50861
+50.48581 140.47693
+50.52666 140.43915
+50.57721 140.46944
+50.61888 140.51610
+50.66222 140.48639
+50.70665 140.46056
+50.75139 140.48555
+50.79582 140.53499
+50.84639 140.53444
+50.88416 140.56444
+50.92805 140.61139
+50.94693 140.67998
+50.99388 140.66388
+99.00000 999.00000
+50.95831 142.20581
+50.91415 142.15472
+50.86581 142.12498
+50.81305 142.09499
+50.76277 142.10165
+50.70749 142.08804
+50.64888 142.06360
+50.59332 142.05138
+50.53943 142.04332
+50.49248 142.05972
+50.44888 142.08832
+50.40527 142.11693
+50.36081 142.14389
+50.30943 142.14526
+50.26109 142.14972
+50.21248 142.16055
+50.16277 142.15831
+50.11415 142.16914
+50.06248 142.17165
+50.00526 142.15277
+99.00000 999.00000
+50.05165 143.97415
+50.09526 143.94556
+50.13805 143.91415
+50.18166 143.88332
+50.22305 143.84639
+50.26471 143.81082
+50.31027 143.78888
+50.35527 143.77361
+50.41165 143.75861
+50.45860 143.74193
+50.50610 143.72832
+50.55249 143.71027
+50.60110 143.70055
+50.65082 143.69249
+50.69972 143.68388
+50.74889 143.67526
+50.79582 143.66026
+50.84305 143.64471
+50.88638 143.62360
+50.93304 143.60664
+50.97972 143.58998
+99.00000 999.00000
+50.87222 155.44943
+50.81221 155.51776
+50.80611 155.62082
+50.86360 155.66805
+50.92610 155.61971
+50.93082 155.51582
+50.88443 155.44748
+99.00000 999.00000
+50.05972 155.31860
+50.02332 155.38081
+99.00000 999.00000
+50.04111 155.42610
+50.10193 155.46693
+50.15305 155.54831
+50.17888 155.64861
+50.18027 155.75276
+50.22777 155.80748
+50.26971 155.89693
+50.32915 155.94859
+99.00000 999.00000
+50.70332 155.90944
+50.64360 155.86110
+50.58026 155.83916
+50.52055 155.78915
+50.45805 155.76138
+50.40222 155.68388
+50.39499 155.59164
+50.37277 155.49248
+50.34749 155.38609
+50.29054 155.32748
+50.30138 155.22722
+50.24722 155.19472
+50.19221 155.23888
+50.12389 155.23305
+50.05972 155.21805
+99.00000 999.00000
+50.95776 156.72194
+50.90166 156.65027
+50.90776 156.71805
+50.96277 156.79776
+99.00000 999.00000
+50.40388 156.03110
+50.46889 156.04138
+50.50194 156.12831
+50.56665 156.14055
+50.63306 156.12415
+50.69972 156.12471
+50.76498 156.09526
+99.00000 999.00000
+50.63582 156.40054
+50.69638 156.44331
+50.75610 156.49026
+50.82248 156.49332
+50.86638 156.43111
+50.83972 156.32860
+50.78860 156.24889
+50.74138 156.16888
+50.67444 156.18915
+50.64665 156.28555
+50.62944 156.38443
+99.00000 999.00000
+51.02165 140.70277
+51.07304 140.70471
+51.11555 140.67221
+51.16777 140.67360
+51.21555 140.66026
+51.24472 140.71138
+51.29027 140.69305
+51.33165 140.71555
+51.33026 140.78943
+51.35304 140.85555
+51.39972 140.88443
+51.41972 140.87471
+51.42110 140.81082
+51.46527 140.80638
+51.47804 140.87999
+51.52443 140.90555
+51.57639 140.90721
+51.62582 140.92110
+51.65359 140.98332
+99.00000 999.00000
+51.67027 141.04610
+51.67581 141.11998
+51.72110 141.14082
+51.77306 141.18610
+51.82889 141.20526
+51.86081 141.26498
+51.88943 141.32805
+51.90776 141.39806
+51.94722 141.42581
+51.98138 141.36415
+99.00000 999.00000
+51.98555 141.66998
+51.93527 141.67581
+51.88388 141.64165
+51.85222 141.70915
+51.82082 141.78194
+51.78027 141.82082
+51.72916 141.82111
+51.72556 141.74110
+51.72916 141.68721
+51.69804 141.76082
+51.66222 141.81639
+51.62222 141.85805
+51.61388 141.91722
+51.57944 141.92998
+51.54138 141.96722
+99.00000 999.00000
+51.50888 142.01665
+51.47331 142.07359
+51.42888 142.09164
+51.38554 142.09444
+51.34526 142.13693
+51.30582 142.17943
+51.25444 142.17638
+51.21082 142.20389
+51.16972 142.24081
+51.12498 142.26555
+51.08472 142.26443
+51.02748 142.24388
+99.00000 999.00000
+51.01915 143.58221
+51.06721 143.57082
+51.11722 143.56305
+51.16693 143.54915
+51.21498 143.53777
+51.26277 143.52388
+51.30472 143.49693
+51.25806 143.51414
+51.21138 143.51138
+51.23972 143.47581
+51.28943 143.47472
+51.32498 143.41611
+51.35332 143.40332
+51.34360 143.45915
+51.37526 143.46693
+51.42415 143.45805
+51.47499 143.45776
+51.52055 143.43665
+51.55972 143.39638
+51.60498 143.37277
+51.63971 143.35722
+51.59138 143.32359
+51.54472 143.33943
+51.50331 143.33026
+51.51277 143.25806
+51.53165 143.22194
+51.58360 143.24055
+51.63443 143.25139
+51.68860 143.26999
+51.70915 143.31581
+51.75276 143.30472
+51.79776 143.28194
+51.84164 143.25388
+51.88748 143.23360
+51.85277 143.19498
+51.89499 143.16222
+51.93832 143.13722
+51.96889 143.15694
+99.00000 999.00000
+51.98055 156.47777
+51.91138 156.49306
+51.84471 156.49222
+51.77693 156.49915
+51.71056 156.49609
+51.64555 156.48499
+51.57915 156.48193
+51.51360 156.47276
+51.44443 156.49889
+51.37582 156.52055
+51.30859 156.52361
+51.25388 156.59749
+51.21443 156.68498
+51.14526 156.70193
+51.09138 156.73109
+51.02832 156.74165
+99.00000 999.00000
+51.03082 156.87860
+51.08221 156.98277
+99.00000 999.00000
+51.13193 157.05276
+51.18610 157.13722
+51.22081 157.22556
+51.27138 157.28972
+51.32944 157.34860
+51.35664 157.45998
+51.41388 157.48888
+51.47556 157.52388
+51.52748 157.62193
+51.55998 157.74055
+51.60110 157.83026
+51.63609 157.91582
+51.69527 157.95721
+99.00000 999.00000
+51.74805 158.00998
+51.80055 158.09444
+51.85664 158.15332
+51.91081 158.22581
+51.96805 158.28888
+99.00000 999.00000
+52.93443 140.96359
+52.97972 140.94276
+99.00000 999.00000
+52.02722 141.30722
+52.07166 141.35638
+52.10805 141.36499
+52.14194 141.41693
+52.16110 141.48639
+52.14943 141.54498
+52.19276 141.54166
+52.21138 141.50722
+52.21693 141.41972
+52.25026 141.35472
+52.28249 141.29166
+52.32027 141.24222
+52.34831 141.18776
+52.38805 141.14665
+52.43332 141.12471
+52.48332 141.14972
+52.50499 141.21777
+52.55556 141.26414
+52.61194 141.28972
+52.65805 141.31276
+52.70193 141.28665
+52.74332 141.25082
+52.78082 141.20110
+52.82748 141.24889
+52.84805 141.22665
+52.86388 141.15749
+52.88472 141.06888
+52.92139 141.02777
+99.00000 999.00000
+52.97972 141.14581
+52.99638 141.21443
+99.00000 999.00000
+52.94527 141.88889
+52.89055 141.87526
+52.83722 141.86221
+52.78665 141.86638
+52.72888 141.83305
+52.68111 141.84471
+52.62776 141.83665
+52.58748 141.83443
+52.53360 141.81305
+52.47638 141.78638
+52.42831 141.73749
+52.39499 141.67722
+52.34471 141.65054
+52.29498 141.65749
+52.24193 141.66138
+52.19582 141.67998
+52.14806 141.69305
+52.09776 141.64777
+52.04639 141.64915
+99.00000 999.00000
+52.04305 143.14027
+52.09222 143.13388
+52.12222 143.10805
+52.12971 143.13248
+52.14139 143.15082
+52.19305 143.15305
+52.24664 143.16360
+52.29944 143.17471
+52.33972 143.15805
+52.34499 143.11943
+52.36665 143.13832
+52.42139 143.17055
+52.47415 143.18999
+52.51889 143.22527
+52.57056 143.25555
+52.58943 143.29388
+52.53806 143.27165
+52.47943 143.23776
+52.44666 143.26414
+52.43222 143.20444
+52.38388 143.20193
+52.33859 143.20027
+52.38722 143.24944
+52.44276 143.29193
+52.49832 143.30972
+52.55165 143.32056
+52.60388 143.32555
+52.65582 143.33055
+52.70776 143.33582
+52.75888 143.33582
+52.80305 143.32388
+52.86165 143.35388
+52.92749 143.32777
+52.99306 143.31248
+99.00000 999.00000
+52.94943 156.09164
+52.88306 156.10027
+52.81332 156.12082
+52.74193 156.15610
+52.66972 156.19556
+52.59610 156.24498
+52.54805 156.31276
+52.52748 156.41277
+52.47610 156.42638
+52.46082 156.37248
+52.50888 156.31581
+52.48027 156.30081
+52.40749 156.34360
+52.33638 156.37415
+52.26555 156.40222
+52.19498 156.43056
+52.12471 156.44888
+52.05693 156.45610
+99.00000 999.00000
+52.06305 158.32639
+52.13138 158.31998
+52.15414 158.39526
+52.20665 158.37805
+52.25221 158.43027
+52.26915 158.50972
+52.32805 158.55472
+52.36610 158.52693
+52.41859 158.54277
+52.40414 158.43944
+52.45721 158.46193
+52.49081 158.51164
+52.55498 158.52361
+52.59305 158.44472
+52.65222 158.41914
+52.62248 158.50943
+52.65721 158.57082
+52.71664 158.58748
+52.74222 158.50972
+52.78471 158.54805
+52.82027 158.56998
+52.86499 158.61165
+52.92389 158.63055
+52.93944 158.53221
+52.91415 158.52138
+52.90999 158.44055
+52.97415 158.45248
+99.00000 999.00000
+52.97249 158.65971
+52.90359 158.69443
+52.92526 158.77748
+52.98193 158.84499
+99.00000 999.00000
+53.85277 136.94305
+53.82193 136.83748
+53.76639 136.77193
+53.81555 136.67665
+53.88026 136.66388
+53.94611 136.66081
+99.00000 999.00000
+53.57138 137.89082
+53.56248 137.78165
+53.54222 137.67221
+53.54721 137.56194
+53.53722 137.45415
+53.52527 137.34526
+53.56305 137.23360
+53.60971 137.26721
+53.66415 137.35304
+53.66472 137.46304
+53.70776 137.54027
+53.77138 137.55638
+53.82999 137.60056
+53.87109 137.68388
+53.90248 137.79222
+53.96248 137.85248
+53.93915 137.74332
+53.96359 137.63055
+53.98581 137.52472
+99.00000 999.00000
+53.94748 137.23831
+53.88138 137.20389
+53.81444 137.14555
+53.83527 137.05527
+99.00000 999.00000
+53.97194 138.75861
+53.90582 138.70193
+53.84332 138.69582
+53.77888 138.67471
+53.71332 138.64249
+53.64748 138.59943
+53.58139 138.55222
+53.51582 138.45471
+53.51389 138.34526
+53.50415 138.24498
+53.52998 138.24554
+53.57915 138.29111
+53.63248 138.34305
+53.69748 138.40109
+53.75888 138.49472
+53.82166 138.57555
+53.88693 138.58110
+53.95193 138.57332
+53.98277 138.54305
+53.93527 138.43472
+53.88388 138.33777
+53.81831 138.31721
+53.75276 138.29889
+53.69748 138.20277
+53.66277 138.09499
+99.00000 999.00000
+53.02998 140.89806
+53.05972 140.83139
+53.09415 140.77110
+53.12027 140.71722
+53.12248 140.80055
+53.10081 140.87332
+53.06415 140.92305
+99.00000 999.00000
+53.44722 140.93082
+53.49248 140.98831
+53.51694 140.90610
+53.54971 140.79665
+53.59694 140.68721
+53.63472 140.57721
+53.69972 140.53305
+53.75722 140.45360
+53.78943 140.34972
+53.85443 140.26332
+53.91914 140.29248
+53.97139 140.30305
+99.00000 999.00000
+53.03194 141.01721
+53.00249 141.09805
+99.00000 999.00000
+53.03389 141.25082
+53.04889 141.19026
+53.08415 141.24860
+53.07193 141.33081
+53.09555 141.35388
+53.13472 141.40082
+53.16859 141.42110
+53.21889 141.41914
+53.22360 141.35860
+53.26443 141.39693
+53.30110 141.35609
+53.30693 141.24722
+53.35582 141.15193
+53.39915 141.08916
+53.43582 141.00861
+99.00000 999.00000
+53.47388 141.09749
+99.00000 999.00000
+53.11249 141.87193
+53.07166 141.90889
+53.02498 141.92471
+99.00000 999.00000
+53.44110 141.93721
+53.39415 141.83081
+53.34776 141.79248
+53.28249 141.80165
+53.21693 141.83249
+99.00000 999.00000
+53.67249 142.96999
+53.71860 142.95471
+53.77498 142.90166
+53.82889 142.91472
+53.77443 142.96222
+53.70860 142.99388
+53.74554 142.97388
+53.81139 142.93805
+53.87193 142.90582
+53.89610 142.87860
+53.94498 142.91443
+99.00000 999.00000
+53.98944 142.65166
+53.92444 142.72165
+53.85944 142.70943
+53.79498 142.66888
+53.72998 142.62054
+53.70332 142.64998
+53.76582 142.69611
+53.83055 142.72139
+53.80859 142.77777
+53.74306 142.79414
+53.67831 142.77554
+53.63026 142.69388
+53.67082 142.61444
+53.66722 142.50415
+53.60222 142.49915
+53.53806 142.51831
+53.56915 142.61388
+53.52361 142.68193
+53.51389 142.59721
+53.44972 142.54166
+53.38693 142.47527
+53.37415 142.36555
+53.36972 142.27472
+53.43332 142.24554
+53.49860 142.24138
+53.51498 142.19165
+53.49026 142.08110
+99.00000 999.00000
+53.01248 143.31610
+53.07805 143.29414
+53.14360 143.28722
+53.20943 143.25665
+53.27498 143.23444
+53.34082 143.21472
+53.39915 143.17221
+53.39471 143.10527
+53.45139 143.06694
+53.48944 143.12831
+53.55498 143.10388
+53.55443 143.00722
+53.60416 143.05832
+53.65193 143.01944
+99.00000 999.00000
+53.96056 155.88832
+53.88998 155.91638
+53.83081 155.92139
+53.76082 155.94498
+53.69221 155.95415
+53.62389 155.96693
+53.55472 155.98027
+53.49222 155.99748
+99.00000 999.00000
+53.43056 156.00471
+53.36165 156.02138
+53.29027 156.04610
+53.22276 156.05026
+53.15388 156.06665
+53.08415 156.08748
+53.01665 156.09332
+99.00000 999.00000
+53.03165 158.46388
+53.06499 158.55194
+53.01555 158.64249
+99.00000 999.00000
+53.08638 159.02582
+53.12639 159.15388
+53.16388 159.27193
+53.15388 159.37332
+53.20471 159.44165
+53.23831 159.53722
+53.25360 159.65721
+53.25055 159.74860
+53.26527 159.80527
+53.20610 159.76749
+53.16472 159.86081
+53.12555 159.95526
+99.00000 999.00000
+53.25388 159.96609
+53.23055 159.94388
+53.28972 159.93776
+53.33331 159.94472
+53.38554 159.93082
+53.41666 159.85915
+53.48164 159.84222
+53.51471 159.79166
+53.50555 159.86610
+53.47777 159.95082
+53.54498 159.95305
+53.61415 159.94498
+53.66943 159.88193
+53.59943 159.91972
+53.63638 159.85277
+53.68915 159.86165
+53.76027 159.84055
+53.82582 159.85332
+53.88998 159.87471
+53.95471 159.89194
+99.00000 999.00000
+54.57359 135.98415
+54.56665 135.87248
+54.56888 135.75943
+54.61444 135.68860
+54.66611 135.64165
+54.67831 135.52722
+54.70082 135.41110
+54.71416 135.29639
+54.72665 135.25610
+54.78943 135.19556
+54.85304 135.15527
+54.91693 135.21248
+54.97415 135.29138
+99.00000 999.00000
+54.03276 136.71915
+54.08276 136.76776
+54.14806 136.81055
+54.21027 136.75806
+54.26555 136.77055
+54.30638 136.82056
+54.36276 136.75249
+54.42805 136.74832
+54.43359 136.83998
+54.49332 136.83194
+54.55026 136.83916
+54.60110 136.83443
+54.65193 136.79332
+54.60971 136.69388
+54.66722 136.67360
+54.64444 136.61943
+54.58943 136.53027
+54.59860 136.41666
+54.60361 136.30331
+54.61555 136.20055
+54.60388 136.08916
+99.00000 999.00000
+54.89972 136.68222
+54.91081 136.74248
+54.93665 136.81749
+54.95526 136.91777
+54.91832 136.98944
+99.00000 999.00000
+54.96222 136.69331
+99.00000 999.00000
+54.03860 137.39638
+54.06221 137.30331
+54.12526 137.32498
+54.14526 137.43472
+54.08556 137.44611
+54.11806 137.49248
+54.16914 137.55527
+54.22415 137.61360
+54.28082 137.69221
+54.31972 137.70389
+54.30138 137.60027
+54.31165 137.48749
+54.29860 137.38582
+54.26054 137.28389
+54.22055 137.20888
+54.17360 137.11916
+54.12332 137.09471
+54.06082 137.14444
+54.04138 137.23721
+54.00026 137.26498
+99.00000 999.00000
+54.44498 137.60748
+54.50748 137.64555
+54.56389 137.60971
+54.49860 137.55388
+54.43388 137.57222
+54.40359 137.58693
+99.00000 999.00000
+54.36221 137.71555
+54.38832 137.82111
+54.44556 137.87082
+54.48831 137.92415
+54.50026 137.84360
+54.43832 137.80972
+54.38638 137.71693
+99.00000 999.00000
+54.93639 137.07639
+54.99889 137.06638
+99.00000 999.00000
+54.80666 137.30638
+54.85081 137.39777
+54.85971 137.49693
+54.79555 137.53581
+54.73193 137.59721
+54.66748 137.63361
+54.61832 137.70721
+54.67221 137.77081
+54.72360 137.85527
+54.77081 137.93111
+99.00000 999.00000
+54.96860 137.36110
+54.90776 137.28665
+54.84164 137.25139
+54.77609 137.22165
+99.00000 999.00000
+54.24971 138.90527
+54.29248 138.79388
+54.30249 138.68639
+54.27666 138.70082
+54.21472 138.73277
+54.14943 138.72472
+54.08331 138.66998
+54.09027 138.73526
+54.05693 138.77914
+99.00000 999.00000
+54.92526 138.00693
+54.97221 138.07222
+99.00000 999.00000
+54.14471 139.96111
+54.18860 139.89139
+54.23082 139.79027
+54.29610 139.80914
+54.29805 139.70193
+54.25165 139.60248
+54.22415 139.49722
+54.20221 139.38638
+54.18915 139.27554
+54.20610 139.16360
+54.22055 139.05138
+99.00000 999.00000
+54.02832 140.23389
+54.07248 140.17776
+54.09805 140.06638
+99.00000 999.00000
+54.16165 142.96193
+54.22804 142.90332
+54.29222 142.81972
+54.35832 142.77388
+54.42305 142.73027
+54.38081 142.67888
+54.31915 142.61777
+54.25777 142.63026
+54.24664 142.58748
+54.25555 142.52748
+54.30943 142.57915
+54.28389 142.51443
+54.26610 142.40193
+54.30276 142.29166
+54.25610 142.36139
+54.19110 142.43443
+54.12526 142.48471
+54.06248 142.57082
+99.00000 999.00000
+54.95027 155.59721
+54.88193 155.61110
+54.81027 155.65109
+54.74443 155.64471
+54.67555 155.66055
+54.60944 155.67722
+54.54082 155.69276
+54.47110 155.71138
+54.40138 155.73581
+54.33139 155.75998
+54.26138 155.78055
+54.19138 155.80666
+54.11972 155.84360
+54.04944 155.87193
+99.00000 999.00000
+54.00943 159.92972
+54.06860 159.98109
+99.00000 999.00000
+55.05914 135.44666
+55.10971 135.53139
+55.13248 135.64276
+55.15138 135.75471
+55.19638 135.83832
+55.24193 135.93832
+99.00000 999.00000
+55.27666 136.02609
+55.30415 136.13306
+55.35860 136.19804
+55.42389 136.27361
+55.48415 136.31749
+55.54388 136.38498
+55.59027 136.48389
+55.62305 136.56610
+55.66055 136.67776
+55.65610 136.78249
+55.72305 136.84526
+55.77805 136.93527
+99.00000 999.00000
+55.06415 136.95221
+55.02722 136.85304
+99.00000 999.00000
+55.79111 137.02693
+55.83777 137.10388
+55.89665 137.20555
+55.93971 137.30666
+55.94305 137.38777
+55.97331 137.42831
+99.00000 999.00000
+55.02165 137.11305
+55.08888 137.17805
+55.11305 137.11665
+55.10609 137.05110
+99.00000 999.00000
+55.02306 137.94611
+55.02609 137.91388
+55.09277 137.98471
+55.14638 137.92860
+55.13472 137.81526
+55.14526 137.70055
+55.19556 137.62360
+55.15805 137.53276
+55.09332 137.49889
+55.02859 137.46304
+99.00000 999.00000
+55.03749 138.20665
+55.06027 138.10748
+54.98334 137.98334
+99.00000 999.00000
+55.93748 155.65610
+55.87222 155.64499
+55.80527 155.64526
+55.73915 155.63527
+55.67415 155.62193
+55.60915 155.60889
+55.54498 155.58665
+55.47972 155.57582
+55.41388 155.56972
+55.34999 155.54776
+55.28276 155.55026
+55.21472 155.56194
+55.14748 155.56694
+55.07944 155.57860
+55.01109 155.59222
+99.00000 999.00000
+56.04749 137.46915
+56.10999 137.56915
+56.13193 137.67526
+56.17499 137.72581
+56.23193 137.77306
+56.26582 137.85638
+56.33221 137.90805
+56.38638 137.95360
+99.00000 999.00000
+56.39915 138.05888
+56.45471 138.09749
+56.43610 138.21443
+56.47665 138.23305
+56.51527 138.13361
+56.58026 138.12471
+56.63416 138.21359
+56.66638 138.27332
+56.72221 138.32915
+56.75748 138.41498
+56.81831 138.47110
+56.86249 138.54248
+56.90776 138.59972
+56.97331 138.63443
+56.99193 138.74832
+99.00000 999.00000
+56.67805 155.95860
+56.61331 155.94249
+56.54999 155.91081
+56.48581 155.88998
+56.42276 155.85999
+56.35944 155.83221
+56.29555 155.80943
+56.23222 155.77609
+56.16748 155.76027
+56.10609 155.75998
+56.05914 155.69611
+99.00000 999.00000
+56.94666 156.43277
+56.89499 156.31082
+56.84277 156.20610
+56.78444 156.13582
+56.72527 156.07498
+56.76582 156.08194
+56.82277 156.16110
+56.81526 156.10443
+56.75693 156.03444
+99.00000 999.00000
+57.01222 138.78777
+57.04694 138.84610
+57.05055 138.94165
+57.11331 138.95581
+99.00000 999.00000
+57.16443 139.08081
+57.22861 139.12610
+57.27666 139.23277
+57.28972 139.35277
+57.31665 139.46498
+57.37888 139.56471
+57.44415 139.59665
+57.48665 139.70694
+57.50276 139.82748
+57.56831 139.87944
+57.63361 139.93166
+99.00000 999.00000
+57.72693 140.12498
+57.75916 140.24777
+57.75026 140.36249
+57.80888 140.44748
+57.86305 140.50722
+57.92860 140.51555
+57.99248 140.54971
+99.00000 999.00000
+57.82359 156.91638
+57.77888 156.82639
+57.73193 156.76305
+57.70332 156.86305
+57.63361 156.93748
+57.56248 156.97081
+57.49443 156.98082
+57.42722 156.98332
+57.36638 156.93056
+57.30666 156.87471
+57.24609 156.82359
+57.18527 156.77748
+57.12694 156.71056
+57.06665 156.69943
+57.07414 156.65109
+57.10748 156.54721
+57.04359 156.52248
+99.00000 999.00000
+57.98360 157.96277
+57.98415 157.83665
+99.00000 999.00000
+57.97305 157.62665
+57.91360 157.56860
+57.85110 157.53471
+57.79582 157.44638
+57.77165 157.31221
+57.77306 157.18748
+57.79582 157.07222
+99.00000 999.00000
+58.04443 140.58139
+58.10971 140.62805
+58.17526 140.66138
+58.24026 140.69859
+58.30527 140.78526
+58.36861 140.89471
+99.00000 999.00000
+58.46832 141.11415
+58.48471 141.23860
+58.53082 141.35664
+58.58194 141.47972
+58.63971 141.60361
+58.70389 141.71277
+58.76831 141.78249
+58.83249 141.85472
+58.89693 141.90971
+58.96138 141.96999
+99.00000 999.00000
+58.98581 151.19055
+58.92888 151.26027
+58.86026 151.31389
+58.85527 151.39110
+58.87248 151.50581
+58.85472 151.62749
+58.86748 151.75888
+58.88527 151.89165
+99.00000 999.00000
+58.92249 152.12277
+58.98831 152.12082
+99.00000 999.00000
+58.95915 152.53305
+58.93665 152.65082
+58.92499 152.75194
+58.91249 152.87526
+58.93027 152.88138
+58.99248 152.92581
+99.00000 999.00000
+58.38805 158.95221
+58.33611 158.84360
+58.28722 158.72165
+58.23805 158.61026
+58.18304 158.51555
+58.13248 158.40027
+58.07664 158.31694
+58.03638 158.24664
+58.01360 158.25581
+58.00471 158.12498
+99.00000 999.00000
+58.95164 159.75638
+58.88805 159.72972
+58.83972 159.64360
+58.78194 159.58665
+58.72527 159.50998
+58.68332 159.43582
+58.62860 159.34721
+58.57359 159.26138
+58.51776 159.17831
+58.45998 159.22581
+58.50861 159.14806
+58.45027 159.08443
+99.00000 999.00000
+59.04999 142.12610
+59.11249 142.24527
+59.15889 142.37389
+59.21027 142.50331
+59.24361 142.63222
+59.27026 142.76082
+59.29665 142.89221
+99.00000 999.00000
+59.34915 143.15305
+59.37665 143.21111
+59.36916 143.33556
+59.33804 143.46056
+59.35193 143.58943
+59.38554 143.71971
+59.40860 143.84943
+59.41331 143.98027
+99.00000 999.00000
+59.40527 144.09193
+59.39415 144.21860
+59.39748 144.33388
+59.37610 144.44914
+59.37749 144.40054
+59.37526 144.52805
+59.37109 144.65138
+59.38222 144.61943
+59.39360 144.72305
+59.37805 144.76222
+59.37555 144.88443
+99.00000 999.00000
+59.40027 145.12526
+59.42331 145.25610
+59.39389 145.35944
+59.40999 145.49222
+59.41443 145.62054
+59.41055 145.69165
+59.40222 145.80582
+59.41110 145.91443
+59.34749 145.90776
+59.29359 145.82332
+59.22916 145.83943
+59.19611 145.95164
+59.14888 145.99055
+99.00000 999.00000
+59.17165 146.10832
+59.19498 146.23639
+59.20110 146.34164
+59.26027 146.32832
+59.32582 146.32082
+59.39082 146.32332
+59.44693 146.44527
+59.44832 146.57498
+59.40805 146.69388
+59.36861 146.78943
+59.36806 146.91472
+99.00000 999.00000
+59.36665 147.02972
+59.32193 147.14943
+59.32721 147.27832
+59.29054 147.39165
+59.23972 147.48915
+59.27748 147.54498
+59.29359 147.66582
+59.26332 147.76721
+59.31888 147.80638
+59.38110 147.83665
+59.39389 147.96748
+99.00000 999.00000
+59.40665 148.08194
+59.41888 148.21277
+59.40027 148.33722
+59.34444 148.39693
+59.27972 148.41110
+59.25526 148.49498
+59.25444 148.62277
+59.23972 148.71416
+59.27943 148.81776
+59.25110 148.93915
+59.31694 148.91110
+59.37915 148.96388
+59.35860 148.88998
+59.39915 148.87109
+59.36555 148.75305
+59.41638 148.68999
+59.47943 148.72998
+59.53943 148.82111
+59.52222 148.84805
+59.46304 148.89610
+59.45776 148.98248
+99.00000 999.00000
+59.49609 149.10222
+59.46832 149.21416
+59.53471 149.17581
+59.56610 149.09055
+59.62721 149.03276
+59.66611 149.12498
+59.71056 149.26389
+59.75861 149.33026
+59.76027 149.42665
+59.77026 149.55914
+59.75943 149.68388
+59.73944 149.80859
+59.71277 149.93138
+99.00000 999.00000
+59.69221 150.04277
+59.65248 150.16193
+59.64861 150.29054
+59.62305 150.41055
+59.57166 150.47139
+59.55388 150.59055
+59.57277 150.72556
+59.53972 150.64110
+59.51805 150.50555
+59.49055 150.48499
+59.50722 150.61888
+59.49081 150.73332
+59.44276 150.70665
+59.45221 150.83722
+59.48526 150.92165
+59.53806 150.87360
+59.57304 150.96664
+99.00000 999.00000
+59.00139 150.53444
+59.05305 150.65332
+59.10527 150.74722
+59.14777 150.64915
+59.09193 150.58998
+59.05443 150.47499
+99.00000 999.00000
+59.59055 151.04944
+59.57832 151.17555
+59.57388 151.30138
+59.59721 151.38638
+59.54332 151.45277
+59.49693 151.54222
+59.43999 151.64360
+59.37555 151.67776
+59.32193 151.67415
+59.29944 151.78831
+59.28305 151.90665
+99.00000 999.00000
+59.15665 151.96944
+59.14861 151.83722
+59.13805 151.71082
+59.16582 151.58722
+59.15915 151.45694
+59.14055 151.35277
+59.10944 151.23721
+59.10638 151.11081
+59.06526 151.11415
+59.01193 151.19055
+99.00000 999.00000
+59.29414 152.10361
+59.26389 152.19693
+59.21388 152.28860
+59.20193 152.16638
+59.15277 152.04527
+99.00000 999.00000
+59.01277 152.25139
+59.03027 152.35443
+59.03915 152.40332
+99.00000 999.00000
+59.08693 153.07388
+59.09248 153.20555
+59.09972 153.31360
+59.14610 153.28110
+59.19110 153.32304
+59.24306 153.38165
+59.22499 153.50415
+59.20110 153.61415
+59.25249 153.72610
+59.22804 153.73248
+59.18915 153.68472
+59.16805 153.80582
+59.09776 153.88805
+59.05556 153.99361
+99.00000 999.00000
+59.06831 154.10388
+59.08972 154.21359
+59.11249 154.30472
+59.16306 154.32693
+59.20193 154.37555
+59.21111 154.50581
+59.14998 154.60860
+59.13081 154.73027
+59.16805 154.73999
+59.18944 154.82860
+59.19138 154.95915
+99.00000 999.00000
+59.49332 154.93443
+59.44943 154.84610
+59.48415 154.75581
+59.54166 154.64806
+59.53389 154.51694
+59.53110 154.42722
+59.46165 154.45721
+59.42888 154.45499
+59.46609 154.37555
+59.52888 154.38193
+59.47415 154.32138
+59.44360 154.22499
+59.46609 154.10332
+59.53389 154.08748
+59.57777 154.17776
+59.64110 154.20721
+59.60498 154.28998
+59.58611 154.34805
+59.65944 154.27722
+59.73055 154.22638
+59.79639 154.23082
+59.86249 154.23027
+59.89139 154.32610
+59.87831 154.41582
+59.86526 154.43971
+59.92638 154.47055
+59.98972 154.49860
+99.00000 999.00000
+59.18694 155.09972
+59.18582 155.17194
+59.24498 155.17805
+59.31027 155.15027
+59.37248 155.17831
+59.40388 155.06499
+99.00000 999.00000
+59.15694 159.89055
+59.10081 159.81248
+59.04277 159.75722
+99.00000 999.00000
+60.01471 154.51389
+60.07582 154.56471
+60.13609 154.62360
+60.19498 154.70221
+60.25388 154.78749
+60.31248 154.86249
+60.36916 154.95581
+99.00000 999.00000
+60.40831 155.07664
+60.44832 155.17415
+60.50249 155.29166
+60.52193 155.42110
+60.55582 155.47638
+60.59888 155.53305
+60.65193 155.63472
+60.68694 155.76414
+60.72165 155.86081
+60.76915 155.89444
+60.83556 155.89471
+60.89748 155.92276
+99.00000 999.00000
+60.99472 159.81998
+60.94026 159.79414
+60.95164 159.87831
+60.98222 159.95972
+99.00000 999.00000
+61.02972 156.11194
+61.08305 156.22998
+61.13860 156.32748
+61.19165 156.44888
+61.21889 156.59972
+61.24498 156.66222
+61.31027 156.64943
+61.37694 156.64832
+61.44331 156.64748
+61.50444 156.69388
+61.53110 156.76527
+61.55388 156.90498
+61.61081 156.98915
+99.00000 999.00000
+61.66249 157.06248
+61.70555 157.21443
+61.70665 157.35527
+61.76164 157.38638
+61.80443 157.50139
+61.79388 157.63664
+61.79193 157.77666
+61.78249 157.91249
+99.00000 999.00000
+61.75415 158.13722
+61.80556 158.26360
+61.82805 158.39748
+61.79166 158.51889
+61.83331 158.64665
+61.81805 158.77972
+61.85138 158.83498
+61.89998 158.93639
+99.00000 999.00000
+61.91415 159.05804
+61.92360 159.20555
+61.89777 159.33276
+61.84248 159.35498
+61.79082 159.41306
+61.80443 159.49443
+61.79027 159.50916
+61.72638 159.48610
+61.66277 159.53110
+61.70332 159.67082
+61.71915 159.74944
+61.72276 159.85777
+61.78249 159.91331
+99.00000 999.00000
+61.34972 159.93359
+61.30722 159.95499
+61.29388 159.91360
+61.28943 159.80722
+61.24805 159.78610
+61.24889 159.91805
+61.19055 159.94221
+61.12749 159.96971
+61.06860 159.91859
+61.01027 159.85388
diff --git a/jnls/contrib/bering_coast.jnl b/jnls/contrib/bering_coast.jnl
new file mode 100644
index 0000000..e67ea38
--- /dev/null
+++ b/jnls/contrib/bering_coast.jnl
@@ -0,0 +1,21 @@
+\cancel mode verify	! ... now overlaying coastal outline ...
+
+! Description: line-style overlay of bering sea & asian coastlines
+! contributed by Mick Spillane, NOAA/PMEL 1992
+
+set data/save
+define axis/x=1:13467:1 axtb
+define grid/x=axtb gtb
+
+file/col=2/form=(f8.5,f10.5)/var="ytb,xtb"/grid=gtb bering_coast.dat
+
+set variable/bad=999.0 xtb
+set variable/bad=99.0  ytb
+plot/set/vs/over/nolab/x=1:13467 xtb,ytb
+ppl pen 1 1
+ppl plot/over
+
+cancel data bering_coast.dat
+set data/restore
+set mode/last verify
+
diff --git a/jnls/contrib/bering_iso100.dat b/jnls/contrib/bering_iso100.dat
new file mode 100644
index 0000000..3b8d16e
--- /dev/null
+++ b/jnls/contrib/bering_iso100.dat
@@ -0,0 +1,4175 @@
+219.98000 70.21500 
+219.95000 70.24000 
+219.94000 70.25200 
+219.91000 70.26700 
+219.89999 70.27700 
+219.88000 70.29200 
+219.86000 70.30600 
+219.85001 70.31100 
+219.83000 70.32000 
+219.82001 70.32500 
+219.81000 70.33000 
+219.81000 70.33200 
+219.80000 70.33100 
+219.80000 70.33200 
+219.81000 70.33100 
+219.80000 70.33200 
+219.80000 70.33100 
+219.78999 70.33500 
+219.73000 70.34100 
+219.66000 70.34800 
+219.63000 70.34800 
+219.56000 70.34800 
+219.45000 70.34800 
+219.39000 70.35200 
+219.36000 70.35400 
+219.33000 70.35600 
+219.23000 70.35900 
+219.20000 70.36300 
+219.14999 70.36900 
+219.11000 70.37800 
+219.10001 70.38000 
+219.05000 70.38300 
+219.03999 70.38400 
+218.94000 70.38800 
+218.92000 70.38900 
+218.89000 70.39200 
+218.84000 70.39400 
+218.78999 70.39500 
+218.75999 70.39600 
+218.71001 70.39700 
+218.71001 70.39800 
+218.64999 70.39800 
+218.61000 70.40000 
+218.58000 70.40200 
+218.50999 70.40800 
+218.49001 70.40900 
+218.42999 70.41500 
+218.33000 70.43000 
+218.28999 70.43600 
+218.25999 70.43900 
+218.21001 70.45100 
+218.17999 70.45800 
+218.14999 70.46400 
+218.10001 70.47900 
+218.06000 70.48900 
+218.00999 70.50500 
+217.98000 70.51500 
+217.98000 70.51600 
+217.92000 70.53600 
+217.88000 70.55200 
+217.86000 70.55500 
+217.82001 70.56200 
+217.75999 70.56800 
+217.73000 70.57300 
+217.69000 70.58000 
+217.67000 70.58400 
+217.60001 70.58600 
+217.53999 70.58900 
+217.50000 70.59100 
+217.45000 70.59200 
+217.39999 70.59200 
+217.36000 70.59100 
+217.30000 70.59100 
+217.23000 70.58900 
+217.19000 70.58800 
+217.14999 70.58700 
+217.11000 70.58600 
+217.08000 70.58700 
+217.07001 70.58600 
+216.99001 70.58800 
+216.92000 70.58700 
+216.85001 70.58800 
+216.78000 70.58900 
+216.73000 70.59000 
+216.67999 70.59100 
+216.62000 70.59300 
+216.56000 70.59500 
+216.50000 70.59700 
+216.46001 70.59700 
+216.39999 70.59800 
+216.34000 70.59700 
+216.28999 70.59800 
+216.20000 70.59900 
+216.16000 70.59800 
+216.09000 70.59800 
+216.03999 70.59800 
+215.99001 70.59900 
+215.96001 70.60100 
+215.91000 70.60300 
+215.86000 70.60400 
+215.84000 70.60300 
+215.78999 70.60500 
+215.78000 70.60600 
+215.75999 70.61000 
+215.73000 70.61500 
+215.67000 70.63000 
+215.64999 70.64100 
+215.64000 70.65000 
+215.63000 70.65900 
+215.63000 70.66200 
+215.62000 70.66200 
+215.62000 70.66600 
+215.60001 70.68700 
+215.58000 70.69100 
+215.53000 70.69100 
+215.53000 70.69000 
+215.49001 70.68800 
+215.45000 70.68300 
+215.41000 70.68200 
+215.36000 70.68700 
+215.34000 70.69200 
+215.32001 70.69500 
+215.28000 70.69800 
+215.25000 70.70400 
+215.22000 70.71300 
+215.20000 70.72300 
+215.17999 70.73300 
+215.14999 70.74100 
+215.12000 70.74600 
+215.10001 70.75200 
+215.06000 70.75700 
+215.02000 70.75900 
+215.00000 70.76000 
+214.95000 70.76300 
+214.91000 70.76200 
+214.88000 70.75900 
+214.84000 70.75400 
+214.81000 70.75200 
+214.77000 70.75000 
+214.72000 70.74400 
+214.70000 70.74300 
+214.67999 70.74400 
+214.67999 70.74500 
+214.67000 70.74600 
+214.66000 70.74500 
+214.61000 70.74100 
+214.57001 70.74200 
+214.52000 70.74700 
+214.46001 70.75500 
+214.39000 70.76600 
+214.35001 70.77000 
+214.30000 70.77500 
+214.25000 70.78000 
+214.21001 70.78500 
+214.17999 70.78900 
+214.11000 70.79900 
+214.07001 70.80700 
+214.00000 70.81800 
+213.97000 70.82400 
+213.91000 70.83400 
+213.84000 70.84800 
+213.81000 70.85200 
+213.77000 70.86100 
+213.73000 70.86500 
+213.67999 70.86900 
+213.64999 70.87300 
+213.60001 70.87800 
+213.55000 70.88100 
+213.50999 70.88300 
+213.48000 70.88400 
+213.42000 70.88500 
+213.39000 70.88500 
+213.30000 70.88700 
+213.28999 70.88900 
+213.24001 70.89500 
+213.19000 70.90000 
+213.13000 70.90500 
+213.12000 70.90600 
+213.08000 70.91800 
+213.05000 70.93600 
+213.03000 70.94500 
+213.00000 70.94700 
+212.96001 70.94800 
+212.91000 70.94800 
+212.89000 70.95100 
+212.88000 70.95300 
+212.82001 70.95300 
+212.74001 70.95600 
+212.67000 70.96000 
+212.62000 70.96300 
+212.58000 70.96600 
+212.53000 70.96700 
+212.49001 70.97000 
+212.44000 70.97000 
+212.39999 70.97400 
+212.37000 70.97600 
+212.36000 70.97800 
+212.33000 70.98000 
+212.27000 70.98500 
+212.19000 70.99400 
+212.13000 71.00300 
+212.02000 71.02100 
+211.96001 71.03100 
+211.87000 71.04400 
+211.83000 71.05300 
+211.81000 71.05900 
+211.73000 71.07900 
+211.66000 71.09300 
+211.64999 71.09600 
+211.58000 71.11200 
+211.52000 71.11900 
+211.48000 71.12200 
+211.42000 71.12700 
+211.31000 71.13500 
+211.28999 71.13500 
+211.25999 71.13300 
+211.21001 71.13100 
+211.17999 71.13000 
+211.14999 71.12800 
+211.13000 71.12700 
+211.10001 71.12400 
+211.07001 71.12200 
+211.00000 71.11700 
+210.95000 71.11600 
+210.95000 71.11700 
+210.95000 71.11600 
+210.94000 71.11600 
+210.92999 71.11700 
+210.89999 71.11700 
+210.87000 71.11800 
+210.82001 71.12100 
+210.78000 71.12600 
+210.73000 71.13300 
+210.69000 71.14200 
+210.66000 71.15400 
+210.64000 71.16100 
+210.62000 71.17000 
+210.59000 71.17700 
+210.57001 71.18100 
+210.53999 71.18600 
+210.50999 71.18900 
+210.45000 71.19200 
+210.41000 71.19500 
+210.38000 71.19500 
+210.37000 71.19600 
+210.34000 71.19800 
+210.23000 71.19700 
+210.21001 71.19900 
+210.17999 71.20000 
+210.14000 71.20000 
+210.11000 71.20100 
+210.06000 71.20200 
+210.03000 71.20300 
+210.00999 71.20200 
+209.95000 71.20400 
+209.89999 71.20400 
+209.87000 71.20400 
+209.83000 71.20400 
+209.78000 71.20400 
+209.75000 71.20300 
+209.71001 71.20400 
+209.66000 71.20400 
+209.64000 71.20400 
+209.60001 71.20400 
+209.56000 71.20400 
+209.53000 71.20400 
+209.49001 71.20600 
+209.44000 71.20900 
+209.37000 71.22200 
+209.37000 71.22400 
+209.35001 71.22900 
+209.34000 71.23500 
+209.32001 71.24100 
+209.28999 71.25100 
+209.25999 71.25800 
+209.21001 71.26700 
+209.19000 71.26800 
+209.11000 71.27700 
+209.03999 71.28000 
+208.97000 71.28400 
+208.94000 71.28600 
+208.89000 71.29000 
+208.85001 71.29300 
+208.78999 71.29600 
+208.75000 71.29800 
+208.74001 71.29800 
+208.72000 71.30300 
+208.64999 71.30700 
+208.62000 71.31000 
+208.58000 71.31400 
+208.53000 71.32000 
+208.47000 71.32900 
+208.44000 71.33500 
+208.39999 71.34400 
+208.36000 71.35300 
+208.33000 71.35900 
+208.30000 71.36600 
+208.27000 71.37000 
+208.25000 71.37200 
+208.22000 71.37400 
+208.20000 71.37700 
+208.19000 71.38200 
+208.17999 71.38700 
+208.14999 71.40500 
+208.14000 71.40900 
+208.11000 71.41700 
+208.08000 71.42300 
+208.07001 71.42500 
+208.03999 71.42800 
+208.03000 71.42800 
+208.00999 71.43000 
+207.96001 71.43400 
+207.92999 71.43600 
+207.89000 71.44000 
+207.85001 71.44300 
+207.82001 71.44800 
+207.78999 71.45100 
+207.75999 71.46100 
+207.74001 71.47300 
+207.71001 71.48700 
+207.67999 71.50000 
+207.67999 71.50100 
+207.66000 71.50500 
+207.58000 71.52100 
+207.50999 71.53500 
+207.47000 71.54400 
+207.44000 71.55400 
+207.42999 71.55700 
+207.41000 71.56100 
+207.36000 71.57200 
+207.32001 71.58200 
+207.28000 71.59600 
+207.24001 71.61200 
+207.20000 71.63000 
+207.16000 71.64800 
+207.14000 71.66300 
+207.13000 71.66600 
+207.09000 71.68100 
+207.06000 71.69200 
+207.03000 71.70500 
+206.98000 71.72000 
+206.92999 71.73100 
+206.91000 71.73900 
+206.88000 71.74700 
+206.86000 71.75000 
+206.83000 71.75500 
+206.75999 71.76400 
+206.70000 71.76900 
+206.64000 71.77700 
+206.63000 71.77700 
+206.63000 71.77800 
+206.58000 71.77900 
+206.50999 71.78300 
+206.45000 71.78800 
+206.38000 71.79400 
+206.31000 71.80000 
+206.28000 71.80300 
+206.27000 71.80400 
+206.22000 71.80700 
+206.16000 71.81100 
+206.09000 71.82100 
+206.03000 71.82800 
+205.99001 71.83700 
+205.95000 71.84200 
+205.91000 71.84400 
+205.85001 71.84700 
+205.78000 71.84800 
+205.71001 71.85500 
+205.67000 71.85900 
+205.64999 71.86000 
+205.62000 71.86100 
+205.58000 71.86200 
+205.55000 71.86200 
+205.53000 71.86000 
+205.50999 71.85800 
+205.47000 71.85300 
+205.45000 71.84100 
+205.42000 71.83400 
+205.39999 71.82600 
+205.38000 71.82000 
+205.53000 71.85500 
+205.50000 71.85300 
+205.45000 71.85100 
+205.42999 71.84800 
+205.39999 71.83800 
+205.37000 71.82800 
+205.35001 71.81100 
+205.33000 71.79300 
+205.31000 71.78400 
+205.28000 71.76800 
+205.27000 71.76100 
+205.24001 71.75100 
+205.22000 71.74100 
+205.21001 71.73500 
+205.20000 71.73300 
+205.17000 71.72300 
+205.14000 71.71500 
+205.11000 71.70600 
+205.08000 71.69600 
+205.05000 71.68700 
+205.00999 71.68400 
+205.00000 71.68200 
+204.96001 71.68200 
+204.95000 71.68100 
+204.94000 71.68000 
+204.92999 71.68000 
+204.84000 71.67700 
+204.78000 71.67300 
+204.74001 71.66200 
+204.71001 71.65300 
+204.69000 71.64400 
+204.66000 71.63900 
+204.63000 71.63100 
+204.61000 71.62600 
+204.56000 71.61800 
+204.52000 71.61400 
+204.49001 71.61100 
+204.42999 71.59700 
+204.42000 71.59400 
+204.38000 71.58400 
+204.34000 71.57500 
+204.28000 71.56200 
+204.27000 71.55500 
+204.25000 71.55100 
+204.25999 71.55100 
+204.25999 71.54900 
+204.25000 71.53900 
+204.24001 71.53500 
+204.21001 71.53300 
+204.16000 71.52700 
+204.13000 71.52500 
+204.11000 71.52600 
+204.09000 71.52700 
+204.07001 71.53000 
+204.03999 71.53700 
+204.00999 71.55200 
+204.00000 71.56400 
+203.98000 71.57900 
+203.95000 71.61200 
+203.94000 71.61700 
+203.94000 71.62100 
+203.94000 71.62900 
+203.95000 71.65500 
+203.96001 71.67800 
+203.98000 71.70700 
+203.99001 71.72000 
+204.03999 71.74800 
+204.05000 71.75600 
+204.09000 71.77500 
+204.10001 71.78100 
+204.14000 71.79700 
+204.17000 71.80400 
+204.20000 71.81500 
+204.22000 71.82700 
+204.25999 71.86000 
+204.27000 71.88400 
+204.27000 71.90700 
+204.27000 71.92400 
+204.25999 71.93800 
+204.24001 71.94700 
+204.24001 71.94800 
+204.16000 71.98200 
+204.12000 71.99900 
+204.09000 72.01300 
+204.05000 72.02500 
+204.03000 72.02900 
+204.00000 72.02900 
+203.94000 72.02400 
+203.91000 72.02000 
+203.86000 72.01700 
+203.84000 72.01600 
+203.78000 72.01200 
+203.70000 72.01200 
+203.66000 72.01300 
+203.60001 72.01700 
+203.53999 72.01600 
+203.50999 72.01600 
+203.49001 72.01600 
+203.44000 72.01400 
+203.34000 72.01500 
+203.30000 72.01500 
+203.27000 72.01600 
+203.25000 72.01600 
+203.22000 72.01500 
+203.14000 72.01600 
+203.06000 72.01600 
+202.99001 72.01600 
+202.92000 72.02000 
+202.88000 72.02700 
+202.84000 72.03700 
+202.78000 72.05300 
+202.73000 72.07900 
+202.64000 72.10600 
+202.62000 72.11200 
+202.59000 72.11800 
+202.55000 72.13100 
+202.49001 72.16000 
+202.46001 72.17600 
+202.42999 72.18900 
+202.39000 72.20400 
+202.37000 72.21400 
+202.31000 72.24100 
+202.28000 72.25500 
+202.27000 72.25800 
+202.25999 72.26200 
+202.23000 72.27400 
+202.17999 72.29200 
+202.14999 72.30800 
+202.14000 72.31700 
+202.12000 72.33100 
+202.10001 72.34700 
+202.08000 72.36200 
+202.05000 72.38400 
+202.02000 72.40200 
+201.99001 72.42500 
+201.97000 72.43900 
+201.96001 72.44300 
+201.97000 72.44200 
+201.96001 72.44200 
+201.96001 72.44300 
+201.89999 72.47900 
+201.86000 72.50200 
+201.82001 72.52100 
+201.78999 72.54400 
+201.75999 72.56100 
+201.73000 72.57500 
+201.71001 72.59100 
+201.67000 72.60600 
+201.63000 72.61400 
+201.59000 72.62500 
+201.56000 72.64000 
+201.50000 72.66000 
+201.48000 72.67300 
+201.47000 72.67700 
+201.45000 72.68200 
+201.44000 72.68200 
+201.44000 72.68100 
+201.42999 72.68100 
+201.35001 72.67900 
+201.31000 72.67800 
+201.28999 72.67500 
+201.25999 72.67000 
+201.24001 72.66800 
+201.20000 72.66800 
+201.14999 72.67100 
+201.13000 72.67600 
+201.09000 72.68200 
+201.06000 72.68700 
+201.06000 72.68800 
+201.02000 72.68900 
+200.92999 72.69800 
+200.89000 72.70300 
+200.84000 72.71300 
+200.80000 72.72300 
+200.75000 72.73100 
+200.71001 72.74200 
+200.67999 72.75300 
+200.67000 72.75600 
+200.66000 72.75600 
+200.64999 72.75700 
+200.64999 72.75800 
+200.62000 72.76200 
+200.58000 72.77000 
+200.55000 72.77700 
+200.50999 72.78600 
+200.48000 72.79400 
+200.34000 72.94000 
+200.34000 72.95300 
+200.34000 72.96900 
+200.35001 72.97800 
+200.35001 72.98600 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 72.99200 
+200.36000 72.99100 
+200.36000 73.00000 
+200.37000 73.00500 
+200.37000 73.01300 
+200.36000 73.01800 
+200.30000 73.02400 
+200.27000 73.02600 
+200.24001 73.02800 
+200.21001 73.02900 
+200.19000 73.03000 
+200.16000 73.03000 
+200.14999 73.02900 
+200.12000 73.02400 
+200.10001 73.01600 
+200.07001 72.99900 
+200.07001 72.99000 
+200.06000 72.98700 
+200.06000 72.97800 
+200.06000 72.96900 
+200.05000 72.95200 
+200.05000 72.94200 
+200.05000 72.93100 
+200.05000 72.92300 
+200.05000 72.91600 
+200.05000 72.90800 
+200.03999 72.90400 
+200.03000 72.89600 
+200.00999 72.89100 
+199.98000 72.89200 
+199.96001 72.89600 
+199.95000 72.89700 
+199.94000 72.89800 
+199.92999 72.89900 
+199.92000 72.90100 
+199.91000 72.90100 
+199.89999 72.90200 
+199.89000 72.90300 
+199.88000 72.90300 
+199.86000 72.90500 
+199.84000 72.90300 
+199.81000 72.90000 
+199.78999 72.89800 
+199.77000 72.89600 
+199.75000 72.89500 
+199.73000 72.89400 
+199.71001 72.89400 
+199.70000 72.89400 
+199.63000 72.89800 
+199.63000 72.89700 
+199.59000 72.90100 
+199.52000 72.91700 
+199.50000 72.92700 
+199.48000 72.94200 
+199.46001 72.95300 
+199.44000 72.96900 
+199.42000 72.97800 
+199.39000 72.98700 
+199.37000 72.98800 
+199.33000 72.99200 
+199.30000 72.99400 
+199.25000 72.99600 
+199.22000 72.99600 
+199.21001 72.99600 
+199.17999 72.99600 
+199.12000 72.99600 
+199.08000 72.99300 
+199.02000 72.99100 
+198.98000 72.98900 
+198.94000 72.98500 
+198.91000 72.98100 
+198.89999 72.98300 
+198.89000 72.98400 
+198.86000 72.98300 
+198.81000 72.98300 
+198.75000 72.98100 
+198.72000 72.98000 
+198.67000 72.98300 
+198.64000 72.98400 
+198.60001 72.98700 
+198.55000 72.99000 
+198.50999 72.99200 
+198.50000 72.99300 
+198.46001 72.99400 
+198.42999 72.99400 
+198.39000 72.99300 
+198.36000 72.99200 
+198.33000 72.99200 
+198.31000 72.99300 
+198.27000 72.99400 
+198.25999 72.99400 
+198.21001 72.99200 
+198.17999 72.99400 
+198.16000 72.99400 
+198.14999 72.99400 
+198.12000 72.99700 
+198.12000 72.99600 
+198.10001 72.99700 
+198.07001 72.99900 
+198.05000 73.00100 
+198.02000 73.00300 
+198.00000 73.00700 
+197.98000 73.00900 
+197.96001 73.01800 
+197.95000 73.02000 
+197.94000 73.02500 
+197.92000 73.03000 
+197.88000 73.04300 
+197.86000 73.05100 
+197.85001 73.05900 
+197.82001 73.07200 
+197.80000 73.08200 
+197.78999 73.09100 
+197.75999 73.10500 
+197.73000 73.12600 
+197.72000 73.13900 
+197.71001 73.14300 
+197.71001 73.14400 
+197.67000 73.16800 
+197.64999 73.18100 
+197.63000 73.19300 
+197.62000 73.20800 
+197.60001 73.22100 
+197.60001 73.23100 
+197.58000 73.24700 
+197.57001 73.26100 
+197.56000 73.27300 
+197.55000 73.28900 
+197.55000 73.30300 
+197.53999 73.31700 
+197.53000 73.33600 
+197.53000 73.34900 
+197.52000 73.36700 
+197.52000 73.38900 
+197.52000 73.40100 
+197.50999 73.42100 
+197.50000 73.43600 
+197.50000 73.45300 
+197.49001 73.46100 
+197.47000 73.48200 
+197.47000 73.48500 
+197.46001 73.49100 
+197.42999 73.49500 
+197.42000 73.49600 
+197.41000 73.49700 
+197.39000 73.49600 
+197.37000 73.49300 
+197.36000 73.49100 
+197.32001 73.48400 
+197.31000 73.48200 
+197.30000 73.48100 
+197.27000 73.47800 
+197.22000 73.47400 
+197.19000 73.47500 
+197.14999 73.47500 
+197.12000 73.47500 
+197.07001 73.47500 
+197.03999 73.47600 
+197.02000 73.47500 
+196.99001 73.47700 
+196.96001 73.47600 
+196.89999 73.47500 
+196.87000 73.47500 
+196.82001 73.47400 
+196.80000 73.47200 
+196.78000 73.46700 
+196.75999 73.46400 
+196.74001 73.45700 
+196.73000 73.44900 
+196.69000 73.43900 
+196.69000 73.43800 
+196.67000 73.43200 
+196.64999 73.42600 
+196.62000 73.42100 
+196.59000 73.41900 
+196.56000 73.41600 
+196.52000 73.41400 
+196.49001 73.41200 
+196.44000 73.41000 
+196.42000 73.41000 
+196.35001 73.40700 
+196.32001 73.40400 
+196.28999 73.39900 
+196.23000 73.39500 
+196.22000 73.39500 
+196.19000 73.39500 
+196.19000 73.39600 
+196.14000 73.39700 
+196.07001 73.40100 
+196.00999 73.40700 
+195.96001 73.41600 
+195.92999 73.42400 
+195.91000 73.43000 
+195.89000 73.44000 
+195.88000 73.44800 
+195.84000 73.46900 
+195.83000 73.47300 
+195.80000 73.47500 
+195.78000 73.47700 
+195.75000 73.47800 
+195.73000 73.48000 
+195.69000 73.48000 
+195.66000 73.48100 
+195.64000 73.48000 
+195.61000 73.48100 
+195.60001 73.48200 
+195.58000 73.48300 
+195.56000 73.48500 
+195.55000 73.48500 
+195.52000 73.48700 
+195.49001 73.48900 
+195.46001 73.49100 
+195.42999 73.49200 
+195.39000 73.49200 
+195.37000 73.49300 
+195.31000 73.49300 
+195.28000 73.49400 
+195.25000 73.49500 
+195.23000 73.49500 
+195.20000 73.49500 
+195.16000 73.49600 
+195.12000 73.49600 
+195.10001 73.49600 
+195.00000 73.49800 
+194.98000 73.49800 
+194.94000 73.49900 
+194.92000 73.49900 
+194.89999 73.49900 
+194.87000 73.49700 
+194.86000 73.49600 
+194.84000 73.49400 
+194.82001 73.49200 
+194.78999 73.48900 
+194.75000 73.48600 
+194.71001 73.48200 
+194.67999 73.48100 
+194.63000 73.47900 
+194.58000 73.47800 
+194.57001 73.47800 
+194.50999 73.47800 
+194.48000 73.48000 
+194.45000 73.48100 
+194.41000 73.48400 
+194.39000 73.48400 
+194.36000 73.48600 
+194.31000 73.48700 
+194.28999 73.48600 
+194.28999 73.48700 
+194.27000 73.48700 
+194.24001 73.48800 
+194.21001 73.49000 
+194.19000 73.49100 
+194.16000 73.49300 
+194.12000 73.49600 
+194.10001 73.50000 
+194.06000 73.50700 
+194.00999 73.51900 
+193.98000 73.52900 
+193.95000 73.54100 
+193.94000 73.54900 
+193.91000 73.55700 
+193.89000 73.56100 
+193.85001 73.56400 
+193.83000 73.56600 
+193.80000 73.56500 
+193.78999 73.56400 
+193.77000 73.56300 
+193.74001 73.55800 
+193.72000 73.55300 
+193.70000 73.54600 
+193.69000 73.54200 
+193.67999 73.53100 
+193.67000 73.52700 
+193.67000 73.52300 
+193.67000 73.52200 
+193.66000 73.52300 
+193.55000 73.52000 
+193.50999 73.52000 
+193.46001 73.51900 
+193.42000 73.51700 
+193.37000 73.51700 
+193.35001 73.51500 
+193.33000 73.51300 
+193.28999 73.51300 
+193.25999 73.51400 
+193.21001 73.51300 
+193.17000 73.51000 
+193.14000 73.50800 
+193.08000 73.50600 
+193.03000 73.50100 
+192.97000 73.49900 
+192.96001 73.49800 
+192.91000 73.49500 
+192.88000 73.49500 
+192.81000 73.49500 
+192.78999 73.49600 
+192.72000 73.49700 
+192.67999 73.49800 
+192.67000 73.49800 
+192.67999 73.49800 
+192.67000 73.49800 
+192.67999 73.49800 
+192.64999 73.49600 
+192.60001 73.49100 
+192.57001 73.48900 
+192.52000 73.48600 
+192.47000 73.48500 
+192.42999 73.48500 
+192.39000 73.48300 
+192.36000 73.48100 
+192.35001 73.48100 
+192.31000 73.48100 
+192.27000 73.48000 
+192.23000 73.47800 
+192.00999 73.48700 
+192.00000 73.48600 
+191.96001 73.48800 
+191.92000 73.48800 
+191.88000 73.48400 
+191.86000 73.48000 
+191.84000 73.47800 
+191.82001 73.47400 
+191.81000 73.47200 
+191.78000 73.47000 
+191.77000 73.47300 
+191.75999 73.47200 
+191.75000 73.47600 
+191.75000 73.47700 
+191.74001 73.47700 
+191.74001 73.47900 
+191.69000 73.48600 
+191.64999 73.49100 
+191.61000 73.49800 
+191.59000 73.50200 
+191.55000 73.50900 
+191.50999 73.51300 
+191.48000 73.51600 
+191.47000 73.51700 
+191.45000 73.51900 
+191.41000 73.52500 
+191.39000 73.53000 
+191.38000 73.53100 
+191.32001 73.53700 
+191.28999 73.53900 
+191.27000 73.54100 
+191.25000 73.54100 
+191.22000 73.53900 
+191.21001 73.53700 
+191.20000 73.53400 
+191.17000 73.52200 
+191.14000 73.51300 
+191.12000 73.50100 
+191.11000 73.49700 
+191.09000 73.49700 
+191.02000 73.49000 
+191.02000 73.48700 
+191.00000 73.48200 
+191.00000 73.47900 
+190.98000 73.47500 
+190.96001 73.46900 
+190.95000 73.46000 
+190.92000 73.44900 
+190.89000 73.42900 
+190.87000 73.41100 
+190.86000 73.40200 
+190.84000 73.39100 
+190.83000 73.38400 
+190.81000 73.37400 
+190.80000 73.36400 
+190.78000 73.35200 
+190.75000 73.34000 
+190.74001 73.33500 
+190.73000 73.33100 
+190.70000 73.32200 
+190.67999 73.31600 
+190.67000 73.31500 
+190.64999 73.31400 
+190.64000 73.31100 
+190.59000 73.30800 
+190.50999 73.31200 
+190.49001 73.31700 
+190.47000 73.32100 
+190.42999 73.32900 
+190.39000 73.34000 
+190.37000 73.34400 
+190.36000 73.35100 
+190.32001 73.36100 
+190.31000 73.36600 
+190.27000 73.37700 
+190.25000 73.38300 
+190.24001 73.38700 
+190.22000 73.39000 
+190.21001 73.39400 
+190.20000 73.39700 
+190.17999 73.40200 
+190.17000 73.40600 
+190.14000 73.41200 
+190.11000 73.42300 
+190.08000 73.42800 
+190.06000 73.43500 
+190.03999 73.43900 
+190.03000 73.44400 
+190.00999 73.44900 
+189.98000 73.45300 
+189.95000 73.46000 
+189.89000 73.47400 
+189.87000 73.47800 
+189.87000 73.47700 
+189.87000 73.47800 
+189.86000 73.48100 
+189.81000 73.48700 
+189.77000 73.49200 
+189.74001 73.49600 
+189.72000 73.49900 
+189.67999 73.50200 
+189.64999 73.50300 
+189.61000 73.50300 
+189.59000 73.50300 
+189.55000 73.50000 
+189.50999 73.49700 
+189.49001 73.49600 
+189.45000 73.49200 
+189.42000 73.48800 
+189.39000 73.48400 
+189.37000 73.47700 
+189.33000 73.46500 
+189.31000 73.46000 
+189.30000 73.45100 
+189.28000 73.44200 
+189.27000 73.43700 
+189.03999 73.43000 
+189.02000 73.42900 
+189.00000 73.42800 
+188.98000 73.42600 
+188.95000 73.42400 
+188.92999 73.42400 
+188.89999 73.42100 
+188.87000 73.41900 
+188.85001 73.41700 
+188.84000 73.41200 
+188.81000 73.40600 
+188.78000 73.40000 
+188.75000 73.39100 
+188.74001 73.38700 
+188.70000 73.37500 
+188.67999 73.36800 
+188.63000 73.35900 
+188.61000 73.35700 
+188.59000 73.35500 
+188.57001 73.35300 
+188.53000 73.35000 
+188.50999 73.34700 
+188.49001 73.34500 
+188.46001 73.34100 
+188.42000 73.33700 
+188.39999 73.33600 
+188.38000 73.33400 
+188.35001 73.33200 
+188.32001 73.32800 
+188.28999 73.31900 
+188.27000 73.31100 
+188.25999 73.30800 
+188.25000 73.30400 
+188.24001 73.30000 
+188.23000 73.29500 
+188.22000 73.28800 
+188.21001 73.28300 
+188.17999 73.27800 
+188.17000 73.27400 
+188.14000 73.27000 
+188.11000 73.26700 
+188.07001 73.26600 
+188.00999 73.26400 
+188.00000 73.26300 
+187.99001 73.26200 
+187.96001 73.26000 
+187.92999 73.25900 
+187.91000 73.25900 
+187.88000 73.25800 
+187.85001 73.25600 
+187.84000 73.25500 
+187.81000 73.25300 
+187.78000 73.25300 
+187.75999 73.24900 
+187.72000 73.24300 
+187.71001 73.23800 
+187.67999 73.23300 
+187.67000 73.22600 
+187.64999 73.21700 
+187.63000 73.20800 
+187.61000 73.19700 
+187.60001 73.19100 
+187.59000 73.18700 
+187.57001 73.18600 
+187.50000 73.18100 
+187.45000 73.17800 
+187.38000 73.16900 
+187.35001 73.16100 
+187.33000 73.15000 
+187.31000 73.14000 
+187.30000 73.13100 
+187.27000 73.11900 
+187.25999 73.11200 
+187.24001 73.10200 
+187.22000 73.08700 
+187.20000 73.08100 
+187.17000 73.07300 
+187.14999 73.06600 
+187.13000 73.06100 
+187.10001 73.05000 
+187.09000 73.04400 
+187.07001 73.02700 
+187.06000 73.02400 
+187.03999 73.01000 
+187.03000 73.00900 
+186.99001 73.01200 
+186.96001 73.01700 
+186.96001 73.01900 
+186.94000 73.02400 
+186.92999 73.03100 
+186.91000 73.04200 
+186.89999 73.05300 
+186.89000 73.06300 
+186.88000 73.07400 
+186.87000 73.08000 
+186.85001 73.09100 
+186.83000 73.10500 
+186.80000 73.12600 
+186.80000 73.13600 
+186.78999 73.14900 
+186.78000 73.15600 
+186.75999 73.16800 
+186.75000 73.18000 
+186.73000 73.19900 
+186.71001 73.22000 
+186.71001 73.22400 
+186.71001 73.22600 
+186.70000 73.23000 
+186.70000 73.25200 
+186.70000 73.25400 
+186.69000 73.26500 
+186.67000 73.28500 
+186.66000 73.29500 
+186.64000 73.31400 
+186.63000 73.32600 
+186.61000 73.34100 
+186.60001 73.34700 
+186.55000 73.36900 
+186.53999 73.37300 
+186.52000 73.38100 
+186.52000 73.38000 
+186.50999 73.38200 
+186.45000 73.38800 
+186.42999 73.39000 
+186.41000 73.39400 
+186.34000 73.40200 
+186.31000 73.41100 
+186.28999 73.42000 
+186.28000 73.43100 
+186.24001 73.44600 
+186.22000 73.45200 
+186.19000 73.45700 
+186.14999 73.46400 
+186.12000 73.46700 
+186.10001 73.46900 
+186.06000 73.47200 
+186.03999 73.47800 
+186.00999 73.48600 
+185.98000 73.49700 
+185.95000 73.50800 
+185.92999 73.51800 
+185.89999 73.52400 
+185.88000 73.52900 
+185.85001 73.53500 
+185.83000 73.53900 
+185.77000 73.54300 
+185.74001 73.54400 
+185.70000 73.54300 
+185.66000 73.54400 
+185.64000 73.54400 
+185.59000 73.54400 
+185.58000 73.54500 
+185.53999 73.54600 
+185.50999 73.54500 
+185.49001 73.54400 
+185.48000 73.54400 
+185.44000 73.54300 
+185.41000 73.54300 
+185.39000 73.54200 
+185.38000 73.54100 
+185.38000 73.54200 
+185.35001 73.54300 
+185.28999 73.55000 
+185.25999 73.55700 
+185.23000 73.56700 
+185.21001 73.57300 
+185.17000 73.58300 
+185.14999 73.59000 
+185.11000 73.59600 
+185.10001 73.59800 
+185.06000 73.60300 
+185.02000 73.60800 
+185.00000 73.60800 
+184.96001 73.61100 
+184.92999 73.61200 
+184.92000 73.61300 
+184.88000 73.61400 
+184.86000 73.61100 
+184.84000 73.60900 
+184.83000 73.60700 
+184.82001 73.60300 
+184.80000 73.60300 
+184.77000 73.60400 
+184.75000 73.60600 
+184.72000 73.60900 
+184.70000 73.61300 
+184.67000 73.62100 
+184.64000 73.63100 
+184.61000 73.64100 
+184.60001 73.64900 
+184.60001 73.64800 
+184.53000 73.65300 
+184.47000 73.65700 
+184.44000 73.65700 
+184.41000 73.65800 
+184.38000 73.66000 
+184.34000 73.66100 
+184.33000 73.66200 
+184.28999 73.66400 
+184.24001 73.66700 
+184.20000 73.66700 
+184.13000 73.66400 
+184.08000 73.66300 
+184.07001 73.66200 
+184.03000 73.66300 
+184.02000 73.66300 
+183.99001 73.66300 
+183.94000 73.66400 
+183.89999 73.66400 
+183.88000 73.66400 
+183.85001 73.66400 
+183.82001 73.66600 
+183.80000 73.66900 
+183.77000 73.67900 
+183.75000 73.68700 
+183.73000 73.69300 
+183.71001 73.70400 
+183.69000 73.71100 
+183.67999 73.72000 
+183.66000 73.72900 
+183.64000 73.73200 
+183.61000 73.73800 
+183.61000 73.73900 
+183.58000 73.74000 
+183.52000 73.74400 
+183.48000 73.74600 
+183.39000 73.74900 
+183.36000 73.75100 
+183.35001 73.75200 
+183.31000 73.75400 
+183.30000 73.75500 
+183.30000 73.75400 
+183.30000 73.75500 
+183.28999 73.75500 
+183.25000 73.75500 
+183.17000 73.75600 
+183.16000 73.75700 
+183.14999 73.75700 
+183.14000 73.75600 
+183.05000 73.75700 
+182.96001 73.76400 
+182.92000 73.76700 
+182.91000 73.76700 
+182.81000 73.77400 
+182.78000 73.77600 
+182.75999 73.77600 
+182.74001 73.77500 
+182.71001 73.77500 
+182.67999 73.77400 
+182.64000 73.77300 
+182.58000 73.77300 
+182.56000 73.77300 
+182.53999 73.77300 
+182.50000 73.77400 
+182.48000 73.77500 
+182.47000 73.77500 
+182.46001 73.77500 
+182.44000 73.77500 
+182.41000 73.77600 
+182.39999 73.77700 
+182.39000 73.77700 
+182.36000 73.78300 
+182.33000 73.79400 
+182.31000 73.79900 
+182.30000 73.80700 
+182.27000 73.81900 
+182.23000 73.82800 
+182.20000 73.83400 
+182.12000 73.83900 
+182.10001 73.83900 
+182.06000 73.83600 
+181.98000 73.83300 
+181.92999 73.83500 
+181.88000 73.83500 
+181.83000 73.83400 
+181.78999 73.83300 
+181.73000 73.83200 
+181.66000 73.83400 
+181.61000 73.83400 
+179.31000 74.22600 
+179.31000 74.22700 
+179.27000 74.23400 
+179.17999 74.24800 
+179.13000 74.25800 
+179.10001 74.26700 
+179.09000 74.27300 
+179.06000 74.28100 
+179.03999 74.28700 
+179.00000 74.29800 
+178.97000 74.30700 
+178.92999 74.31300 
+178.89999 74.31700 
+178.87000 74.32200 
+178.84000 74.32500 
+178.78999 74.33000 
+178.77000 74.33200 
+178.67999 74.33800 
+178.63000 74.34000 
+178.60001 74.34100 
+178.57001 74.34200 
+178.53000 74.34400 
+178.52000 74.34400 
+178.49001 74.34500 
+178.45000 74.34600 
+178.39000 74.34700 
+178.38000 74.34700 
+178.39000 74.34700 
+178.38000 74.34700 
+178.36000 74.34700 
+178.33000 74.34900 
+178.24001 74.35600 
+178.20000 74.36300 
+178.16000 74.37200 
+178.13000 74.37800 
+177.86000 74.45600 
+177.85001 74.46000 
+177.84000 74.46500 
+177.83000 74.47300 
+177.82001 74.47700 
+177.82001 74.47800 
+177.82001 74.47900 
+177.82001 74.47800 
+177.82001 74.47900 
+177.81000 74.47900 
+177.82001 74.47800 
+177.82001 74.47900 
+177.82001 74.47800 
+177.81000 74.47800 
+177.82001 74.47900 
+177.81000 74.48400 
+177.78000 74.49200 
+177.75999 74.50000 
+177.72000 74.50900 
+177.67000 74.52300 
+177.64000 74.53100 
+177.63000 74.53700 
+177.59000 74.54800 
+177.57001 74.55300 
+177.55000 74.56100 
+177.53000 74.56700 
+177.50000 74.57700 
+177.48000 74.58300 
+177.45000 74.59600 
+177.42999 74.60400 
+177.39999 74.61300 
+177.38000 74.62300 
+177.37000 74.62700 
+177.35001 74.64000 
+177.31000 74.65700 
+177.30000 74.66700 
+177.28000 74.67900 
+177.27000 74.68700 
+177.25000 74.69900 
+177.24001 74.71100 
+177.23000 74.72100 
+177.21001 74.73200 
+177.20000 74.74300 
+177.17999 74.76100 
+177.17000 74.77800 
+177.16000 74.78800 
+177.14999 74.79700 
+177.13000 74.81000 
+177.12000 74.81300 
+177.12000 74.81600 
+177.11000 74.82100 
+177.11000 74.82000 
+177.10001 74.82200 
+177.07001 74.82700 
+177.02000 74.83600 
+176.98000 74.84100 
+176.91000 74.85500 
+176.87000 74.86300 
+176.78000 74.87500 
+176.75000 74.88000 
+176.71001 74.88400 
+176.69000 74.88800 
+176.64999 74.89400 
+176.61000 74.89700 
+176.56000 74.90200 
+176.52000 74.90500 
+176.42000 74.91200 
+176.37000 74.91500 
+176.32001 74.91600 
+176.28000 74.91800 
+176.24001 74.92000 
+176.22000 74.92200 
+176.17000 74.92000 
+176.12000 74.91700 
+176.06000 74.90900 
+176.03999 74.90500 
+176.02000 74.90100 
+176.00000 74.89900 
+176.00000 74.89800 
+175.99001 74.89800 
+175.95000 74.89900 
+175.84000 74.89800 
+175.75000 74.88900 
+175.69000 74.88100 
+175.64999 74.87500 
+175.57001 74.86500 
+175.53000 74.85900 
+175.49001 74.85300 
+175.46001 74.84900 
+175.42999 74.84600 
+175.41000 74.84300 
+175.35001 74.83500 
+175.31000 74.82800 
+175.25000 74.82000 
+175.21001 74.81700 
+175.22000 74.81700 
+175.21001 74.81700 
+175.22000 74.81700 
+175.21001 74.81700 
+175.17000 74.81800 
+175.11000 74.81500 
+175.07001 74.81300 
+175.00000 74.81000 
+174.92000 74.80800 
+174.88000 74.80700 
+174.83000 74.80500 
+174.78000 74.80200 
+174.75000 74.80200 
+174.74001 74.80200 
+174.74001 74.80100 
+174.72000 74.80100 
+174.71001 74.80100 
+174.67000 74.80100 
+174.62000 74.80200 
+174.58000 74.80400 
+174.53999 74.80600 
+174.50000 74.80700 
+174.45000 74.80900 
+174.42000 74.81000 
+174.37000 74.81000 
+174.25999 74.81600 
+174.17999 74.82100 
+174.13000 74.82400 
+174.08000 74.82800 
+174.05000 74.83000 
+174.00999 74.83400 
+173.95000 74.83800 
+173.92999 74.83900 
+173.88000 74.84300 
+173.83000 74.84600 
+173.75999 74.85200 
+173.69000 74.86000 
+173.63000 74.86700 
+173.58000 74.87300 
+173.52000 74.88100 
+173.47000 74.88800 
+173.42000 74.89600 
+173.37000 74.90400 
+173.32001 74.91400 
+173.24001 74.93000 
+173.17999 74.94300 
+173.14999 74.95200 
+173.13000 74.96200 
+173.08000 74.97100 
+173.03999 74.98300 
+173.03000 74.98500 
+173.00999 74.99200 
+173.00000 75.00000 
+172.99001 75.00400 
+172.99001 75.00600 
+999.00000 99.00000
+160.0000  53.00000 
+160.0300  52.99000 
+160.0600  53.02000 
+160.0800  53.08000 
+160.0800  53.10000 
+160.0800  53.13000 
+160.0800  53.16000 
+160.0900  53.20000 
+160.1000  53.24000 
+160.1000  53.28000 
+160.1000  53.32000 
+160.0900  53.37000 
+160.0800  53.41000 
+160.0800  53.46000 
+160.0800  53.49000 
+160.0800  53.52000 
+160.0700  53.55000 
+160.0700  53.57000 
+160.0700  53.59000 
+160.0800  53.63000 
+160.0900  53.65000 
+160.1100  53.70000 
+160.1400  53.75000 
+160.1800  53.82000 
+160.2100  53.87000 
+160.2300  53.91000 
+160.2400  53.94000 
+160.2600  53.98000 
+160.2700  54.01000 
+160.2900  54.05000 
+160.3000  54.08000 
+160.3300  54.10000 
+160.3600  54.14000 
+160.4000  54.17000 
+160.4300  54.19000 
+160.4600  54.22000 
+160.5000  54.24000 
+160.5400  54.25000 
+160.5800  54.27000 
+160.6200  54.30000 
+160.6700  54.31000 
+160.7300  54.33000 
+160.7700  54.33000 
+160.8100  54.34000 
+160.8400  54.33000 
+160.8600  54.31000 
+160.8600  54.29000 
+160.8700  54.27000 
+160.8900  54.26000 
+160.9200  54.27000 
+160.9600  54.30000 
+160.9900  54.32000 
+161.0600  54.37000 
+161.0800  54.39000 
+161.1200  54.40000 
+161.1400  54.41000 
+161.1600  54.41000 
+161.2000  54.41000 
+161.2300  54.40000 
+161.2900  54.42000 
+161.3200  54.42000 
+161.3700  54.43000 
+161.4300  54.45000 
+161.4700  54.46000 
+161.5000  54.46000 
+161.5400  54.46000 
+161.5900  54.47000 
+161.6300  54.47000 
+161.6800  54.47000 
+161.7200  54.47000 
+161.7500  54.48000 
+161.7700  54.49000 
+161.7900  54.50000 
+161.8200  54.52000 
+161.8500  54.54000 
+161.9000  54.58000 
+161.9200  54.59000 
+161.9500  54.61000 
+161.9700  54.62000 
+161.9900  54.63000 
+162.0100  54.63000
+162.0400  54.64000
+162.0800  54.65000
+162.1000  54.66000
+162.1200  54.68000
+162.1400  54.71000
+162.1600  54.75000
+162.1700  54.77000
+162.1800  54.79000
+162.1700  54.83000
+162.1600  54.86000
+162.1600  54.88000
+162.1600  54.90000
+162.1400  54.92000
+162.1300  54.94000
+162.1100  54.96000
+162.1000  54.98000
+162.0800  55.00000
+162.0600  55.03000
+162.0400  55.05000
+162.0200  55.07000
+161.9900  55.09000
+161.9700  55.10000
+161.9600  55.12000
+161.9300  55.16000
+161.9000  55.17000
+161.8700  55.20000
+161.8500  55.22000
+161.8200  55.25000
+161.8000  55.27000
+161.7800  55.30000
+161.7600  55.31000
+161.7500  55.34000
+161.7500  55.36000
+161.7300  55.38000
+161.6900  55.40000
+161.6700  55.42000
+161.6600  55.44000
+161.6600  55.46000
+161.6600  55.48000
+161.6700  55.50000
+161.7000  55.52000
+161.7200  55.52000
+161.7400  55.54000
+161.7800  55.57000
+161.8000  55.59000
+161.8100  55.61000
+161.8600  55.67000
+161.9200  55.74000
+161.9600  55.80000
+162.0000  55.85000
+162.0200  55.88000
+162.0400  55.90000
+162.0500  55.92000
+162.0700  55.95000
+162.1000  55.98000
+162.1100  56.01000
+162.1300  56.04000
+162.1500  56.05000
+162.1800  56.08000
+162.2000  56.10000
+162.2200  56.10000
+162.2500  56.12000
+162.2900  56.13000
+162.3200  56.14000
+162.3700  56.15000
+162.4100  56.15000
+162.4400  56.15000
+162.4700  56.15000
+162.5000  56.15000
+162.5200  56.15000
+162.5400  56.15000
+162.5800  56.14000
+162.6000  56.13000
+162.6400  56.12000
+162.6600  56.10000
+162.7000  56.08000
+162.7300  56.06000
+162.7700  56.03000
+162.7900  56.02000
+162.8100  56.00000
+162.8300  55.99000
+162.8600  55.97000
+162.8900  55.97000
+162.9200  55.98000
+162.9500  55.99000
+162.9700  55.99000
+163.0100  56.01000
+163.0300  56.02000
+163.0500  56.03000
+163.0800  56.07000
+163.1100  56.10000
+163.1300  56.11000
+163.1700  56.12000
+163.1900  56.14000
+163.2200  56.16000
+163.2600  56.19000
+163.2900  56.21000
+163.3200  56.22000
+163.3500  56.23000
+163.3900  56.24000
+163.4100  56.24000
+163.4300  56.25000
+163.4500  56.25000
+163.4700  56.26000
+163.4900  56.27000
+163.5100  56.29000
+163.5100  56.32000
+163.4900  56.33000
+163.4700  56.34000
+163.4500  56.34000
+163.4200  56.31000
+163.3900  56.30000
+163.3700  56.29000
+163.3400  56.31000
+163.3200  56.34000
+163.3100  56.36000
+163.2900  56.39000
+163.2800  56.41000
+163.2700  56.43000
+163.2700  56.45000
+163.2900  56.49000
+163.3000  56.51000
+163.3000  56.53000
+163.3000  56.56000
+163.3000  56.58000
+163.3000  56.60000
+163.2900  56.62000
+163.2700  56.64000
+163.2500  56.68000
+163.2300  56.70000
+163.2100  56.72000
+163.1900  56.74000
+163.1700  56.75000
+163.1400  56.76000
+163.1200  56.77000
+163.1000  56.78000
+163.0700  56.78000
+163.0500  56.79000
+163.0200  56.79000
+162.9700  56.79000
+162.9400  56.79000
+162.9000  56.79000
+162.8600  56.80000
+162.8300  56.84000
+162.8400  56.86000
+162.8300  56.90000
+162.8300  56.94000
+162.8500  56.98000
+162.8700  57.04000
+162.8700  57.06000
+162.8900  57.09000
+162.9000  57.11000
+162.9300  57.15000
+162.9500  57.17000
+162.9900  57.20000
+163.0200  57.22000
+163.0500  57.25000
+163.0700  57.26000
+163.1000  57.28000
+163.1200  57.29000
+163.1400  57.31000
+163.1600  57.35000
+163.1500  57.38000
+163.1400  57.43000
+163.1400  57.46000
+163.1500  57.48000
+163.1700  57.53000
+163.2000  57.56000
+163.2300  57.58000
+163.2700  57.60000
+163.3100  57.65000
+163.3300  57.67000
+163.3600  57.70000
+163.3900  57.73000
+163.4200  57.76000
+163.4400  57.77000
+163.4700  57.81000
+163.4800  57.84000
+163.4900  57.85000
+163.4800  57.86000
+163.4700  57.88000
+163.4600  57.90000
+163.4400  57.92000
+163.4200  57.95000
+163.4100  57.98000
+163.4100  58.02000
+163.4200  58.05000
+163.4300  58.07000
+163.4500  58.10000
+163.4700  58.12000
+163.5000  58.13000
+163.5200  58.15000
+163.5400  58.15000
+163.5600  58.15000
+163.5800  58.16000
+163.6200  58.18000
+163.6500  58.21000
+163.6800  58.22000
+163.6900  58.23000
+163.7100  58.24000
+163.7300  58.24000
+163.7400  58.27000
+163.7500  58.29000
+163.7600  58.41000
+163.7700  58.42000
+163.7800  58.44000
+163.7800  58.46000
+163.7900  58.49000
+163.8100  58.51000
+163.8200  58.53000
+163.8500  58.56000
+163.8900  58.58000
+163.9200  58.59000
+163.9500  58.61000
+163.9700  58.62000
+163.9900  58.64000
+164.0100  58.65000
+164.0500  58.67000
+164.0800  58.69000
+164.1000  58.70000
+164.1400  58.72000
+164.1600  58.73000
+164.2100  58.74000
+164.2400  58.75000
+164.2600  58.75000
+164.2900  58.76000
+164.3300  58.77000
+164.3700  58.78000
+164.4000  58.79000
+164.4400  58.81000
+164.4900  58.83000
+164.5300  58.84000
+164.5700  58.86000
+164.5900  58.89000
+164.6100  58.92000
+164.6300  58.95000
+164.6600  58.96000
+164.6900  58.97000
+164.7300  59.00000
+164.7600  59.04000
+164.7800  59.07000
+164.8000  59.09000
+164.8300  59.12000
+164.8500  59.15000
+164.8600  59.17000
+164.8900  59.20000
+164.9300  59.23000
+164.9500  59.25000
+164.9900  59.28000
+165.0000  59.29000
+165.0300  59.38000
+165.0500  59.44000
+165.0600  59.48000
+165.0600  59.50000
+165.1100  59.53000
+165.1600  59.56000
+165.1900  59.55000
+165.2200  59.59000
+165.2800  59.60000
+165.3800  59.60000
+165.4500  59.60000
+165.5000  59.59000
+165.5900  59.60000
+165.6300  59.57000
+165.6900  59.57000
+165.7100  59.53000
+165.7500  59.55000
+165.7700  59.52000
+165.8200  59.56000
+165.8500  59.56000
+165.8700  59.60000
+165.8900  59.62000
+165.9100  59.63000
+165.9300  59.64000
+165.9400  59.64000
+166.0200  59.65000
+166.0900  59.67000
+166.1600  59.70000
+166.2000  59.73000
+166.2500  59.73000
+166.2800  59.76000
+166.3400  59.76000
+166.3900  59.81000
+166.4200  59.78000
+166.4700  59.80000
+166.5300  59.86000
+166.5600  59.83000
+166.5800  59.87000
+166.6000  59.86000
+166.6600  59.85000
+166.7100  59.83000
+166.7300  59.85000
+166.7700  59.85000
+166.7900  59.85000
+166.8200  59.85000
+166.8400  59.85000
+166.8800  59.86000
+166.9100  59.85000
+166.9500  59.82000
+166.9700  59.84000
+167.0500  59.81000
+167.2600  59.80000
+167.3600  59.81000
+167.4200  59.82000
+167.5100  59.85000
+167.5400  59.88000
+167.5600  59.91000
+167.5800  59.93000
+167.6000  59.97000
+167.5800  59.99000
+167.6100  60.02000
+167.6400  60.05000
+167.6500  60.08000
+167.6700  60.11000
+167.6700  60.15000
+167.7000  60.19000
+167.7900  60.20000
+167.8600  60.19000
+167.8700  60.16000
+167.8900  60.17000
+167.9000  60.11000
+167.9900  60.08000
+168.0100  60.13000
+168.0100  60.16000
+168.0400  60.19000
+168.0400  60.21000
+168.1600  60.23000
+168.3800  60.24000
+168.4600  60.23000
+168.5200  60.21000
+168.5800  60.20000
+168.6500  60.19000
+168.6700  60.17000
+168.6100  60.15000
+168.5700  60.13000
+168.5700  60.11000
+168.5800  60.08000
+168.6000  60.07000
+168.6600  60.06000
+168.7100  60.07000
+168.7400  60.08000
+168.7800  60.12000
+168.7900  60.14000
+168.8100  60.16000
+169.0500  60.17000
+169.1900  60.18000
+169.2500  60.16000
+169.2800  60.14000
+169.3100  60.12000
+169.3400  60.11000
+169.3900  60.09000
+169.4600  60.10000
+169.5100  60.09000
+169.5400  60.06000
+169.5800  60.04000
+169.5900  60.02000
+169.6400  60.01000
+169.6800  59.99000
+169.7100  59.97000
+169.7500  59.94000
+169.7900  59.91000
+169.8200  59.88000
+169.8900  59.87000
+169.9400  59.85000
+170.0300  59.81000
+170.0700  59.79000
+170.1300  59.77000
+170.1800  59.76000
+170.2400  59.78000
+170.2900  59.79000
+170.3600  59.81000
+170.4100  59.83000
+170.4300  59.85000
+170.4900  59.87000
+170.5300  59.90000
+170.5600  59.93000
+170.5900  59.95000
+170.6200  59.98000
+170.6600  60.01000
+170.6700  60.04000
+170.6900  60.07000
+170.7100  60.09000
+170.7300  60.12000
+170.7400  60.15000
+170.7700  60.22000
+170.7900  60.23000
+170.8100  60.25000
+170.8400  60.30000
+170.8800  60.34000
+170.9200  60.37000
+170.9500  60.39000
+171.0100  60.42000
+171.0600  60.45000
+171.1100  60.47000
+171.1500  60.49000
+171.2200  60.51000
+171.2700  60.53000
+171.3400  60.54000
+171.4000  60.56000
+171.4700  60.58000
+171.5400  60.59000
+171.8200  60.61000
+171.8900  60.62000
+171.9400  60.64000
+171.9800  60.67000
+172.0200  60.68000
+172.0900  60.69000
+172.1400  60.69000
+172.2000  60.71000
+172.2300  60.71000
+172.2900  60.74000
+172.3100  60.75000
+172.3500  60.77000
+172.3800  60.78000
+172.4300  60.81000
+172.4500  60.83000
+172.4700  60.86000
+172.5000  60.89000
+172.5600  60.92000
+172.5800  60.92000
+172.6400  60.93000
+172.7200  60.93000
+172.8000  60.94000
+172.8400  60.93000
+172.8600  60.93000
+172.9200  60.92000
+172.9700  60.91000
+173.0500  60.91000
+173.0600  60.93000
+173.0500  60.95000
+173.0600  60.98000
+173.1300  61.00000
+173.1700  60.99000
+173.2200  60.97000
+173.2700  60.96000
+173.3300  60.95000
+173.3800  60.95000
+173.4200  60.97000
+173.4600  61.00000
+173.4900  61.01000
+173.5600  61.00000
+173.5900  61.00000
+173.6400  61.00000
+173.7100  61.01000
+173.7800  61.01000
+173.9300  61.02000
+173.9600  61.03000
+174.0300  61.07000
+174.0700  61.09000
+174.1600  61.13000
+174.1600  61.16000
+174.1900  61.18000
+174.2700  61.22000
+174.2800  61.25000
+174.3400  61.27000
+174.4200  61.29000
+174.4700  61.30000
+174.5600  61.31000
+174.6100  61.32000
+174.6700  61.34000
+174.7100  61.35000
+174.7700  61.36000
+174.8200  61.37000
+174.8800  61.39000
+174.9300  61.43000
+175.0000  61.43000
+175.1000  61.46000
+175.1500  61.47000
+175.1800  61.48000
+175.3200  61.53000
+175.3900  61.57000
+175.4900  61.60000
+175.5500  61.62000
+175.6100  61.66000
+175.6900  61.70000
+175.7300  61.72000
+175.8200  61.73000
+175.8800  61.73000
+175.9800  61.75000
+176.0400  61.77000
+176.1000  61.79000
+176.1400  61.82000
+176.1800  61.84000
+176.2700  61.86000
+176.3300  61.90000
+176.3700  61.92000
+176.4400  61.93000
+176.5200  61.92000
+176.5800  61.93000
+176.6800  61.96000
+176.7600  61.99000
+176.8500  62.00000
+176.9400  62.00000
+177.0100  62.01000
+177.1100  62.02000
+177.1600  62.02000
+177.2600  62.03000
+177.4700  62.02000
+177.6600  62.00000
+177.8400  62.01000
+177.8900  62.01000
+177.9200  62.00000
+177.9700  61.99000
+178.0100  61.99000
+178.0800  61.98000
+178.1700  61.94000
+178.2800  61.94000
+178.3400  61.94000
+178.4000  61.94000
+178.4200  61.94000
+178.4900  61.93000
+178.6900  61.91000
+178.7600  61.91000
+178.8000  61.91000
+178.8200  61.91000
+178.8800  61.91000
+178.9200  61.92000
+178.9800  61.91000
+179.0600  61.91000
+179.1000  61.92000
+179.1400  61.95000
+179.1700  61.96000
+179.2200  61.97000
+179.2600  61.98000
+179.3000  61.97000
+179.3400  61.98000
+179.3600  61.99000
+179.4300  62.02000
+179.4900  62.04000
+179.5200  62.04000
+179.5500  62.04000
+179.5800  62.04000
+179.6000  62.03000
+179.6300  62.03000
+179.6500  62.02000
+179.7100  62.02000
+179.7300  62.03000
+179.7500  62.03000
+179.7800  62.04000
+179.8300  62.06000
+179.9000  62.09000
+179.9100  62.11000
+179.9600  62.16000
+179.9700  62.19000
+179.9800  62.22000
+180.0300  62.29000
+180.0500  62.31000
+180.0800  62.34000
+180.1400  62.39000
+180.1900  62.45000
+180.2000  62.47000
+180.2600  62.51000
+180.3200  62.55000
+180.3600  62.58000
+180.4400  62.62000
+180.4700  62.62000
+180.5000  62.61000
+180.5200  62.61000
+180.5500  62.60000
+180.5800  62.58000
+180.5800  62.56000
+180.6000  62.52000
+180.6300  62.46000
+180.6600  62.42000
+180.7200  62.38000
+180.7800  62.35000
+180.8000  62.34000
+180.8400  62.33000
+180.8700  62.31000
+180.9000  62.30000
+180.9400  62.28000
+180.9700  62.27000
+181.0400  62.25000
+181.1300  62.23000
+181.1800  62.21000
+181.2400  62.19000
+181.2800  62.19000
+181.3900  62.19000
+181.4200  62.20000
+181.4500  62.22000
+181.4700  62.25000
+181.5000  62.28000
+181.5300  62.30000
+181.5500  62.31000
+181.5700  62.33000
+181.6000  62.34000
+181.6600  62.37000
+181.6600  62.40000
+181.6700  62.42000
+181.7000  62.46000
+181.7300  62.53000
+181.7800  62.59000
+181.7700  62.62000
+181.7700  62.66000
+181.7600  62.68000
+181.7400  62.75000
+181.7400  62.77000
+181.7400  62.83000
+181.7400  62.86000
+181.7500  62.90000
+181.7700  62.96000
+181.7000  62.85000
+181.7200  62.89000
+181.7400  62.96000
+181.7800  63.00000
+181.8000  63.02000
+181.8600  63.00000
+181.9000  62.95000
+181.9300  62.93000
+181.9300  62.89000
+181.9600  62.85000
+181.9400  62.84000
+181.9400  62.82000
+181.9400  62.78000
+181.9500  62.74000
+181.9900  62.71000
+182.0200  62.68000
+182.0400  62.66000
+182.0800  62.61000
+182.1100  62.57000
+182.1400  62.54000
+182.1900  62.49000
+182.2300  62.46000
+182.2500  62.44000
+182.3000  62.42000
+182.3300  62.42000
+182.3700  62.40000
+182.3900  62.40000
+182.4100  62.39000
+182.4900  62.35000
+182.5200  62.33000
+182.6000  62.28000
+182.6700  62.25000
+182.6900  62.24000
+182.7400  62.20000
+182.7700  62.19000
+182.8900  62.13000
+182.9400  62.08000
+182.9500  62.06000
+182.9700  62.02000
+183.0100  61.97000
+183.0300  61.94000
+183.0300  61.91000
+183.0500  61.85000
+183.0600  61.77000
+183.0700  61.75000
+183.0700  61.72000
+183.0700  61.67000
+183.0700  61.63000
+183.0700  61.60000
+183.0800  61.57000
+183.1000  61.54000
+183.1000  61.52000
+183.1300  61.47000
+183.1600  61.40000
+183.1600  61.38000
+183.1600  61.36000
+183.1700  61.31000
+183.1800  61.27000
+183.1800  61.23000
+183.1900  61.20000
+183.2100  61.15000
+183.2100  61.13000
+183.2200  61.09000
+183.2400  61.02000
+183.1200  60.62000
+183.0900  60.57000
+183.0700  60.54000
+183.0700  60.51000
+183.0500  60.46000
+183.0400  60.44000
+183.0200  60.40000
+183.0000  60.36000
+183.0000  60.34000
+182.9800  60.29000
+182.9600  60.23000
+182.9600  60.21000
+182.9600  60.18000
+182.9600  60.13000
+182.9500  60.09000
+182.9400  60.06000
+182.9200  60.02000
+182.9400  59.95000
+182.9600  59.92000
+183.0200  59.89000
+183.0900  59.83000
+183.1200  59.81000
+183.1600  59.78000
+183.2400  59.74000
+183.3000  59.71000
+183.3400  59.69000
+183.4100  59.67000
+183.5000  59.67000
+183.5500  59.66000
+183.6100  59.66000
+183.7100  59.66000
+183.8200  59.66000
+183.8800  59.67000
+183.9200  59.67000
+184.0100  59.69000
+184.0300  59.70000
+184.1200  59.71000
+184.2200  59.72000
+184.2400  59.72000
+184.2900  59.73000
+184.3600  59.75000
+184.4100  59.76000
+184.4700  59.77000
+184.5200  59.79000
+184.5700  59.81000
+184.6300  59.81000
+184.6800  59.82000
+184.8300  59.86000
+185.0500  59.89000
+185.0700  59.90000
+185.2000  59.90000
+185.3400  59.91000
+185.5400  59.92000
+185.5600  59.92000
+185.5900  59.92000
+185.6700  59.91000
+185.7300  59.91000
+185.8800  59.91000
+185.9200  59.91000
+186.0000  59.88000
+186.0800  59.85000
+186.1400  59.84000
+186.2700  59.81000
+186.3400  59.78000
+186.3600  59.75000
+186.3900  59.73000
+186.4700  59.69000
+186.5500  59.65000
+186.6100  59.61000
+186.6300  59.60000
+186.6600  59.61000
+186.6600  59.56000
+186.6900  59.54000
+186.7100  59.53000
+186.7500  59.49000
+186.7900  59.45000
+186.8300  59.42000
+186.8600  59.38000
+186.8800  59.36000
+186.9100  59.33000
+186.9300  59.31000
+186.9500  59.30000
+187.0200  59.27000
+187.0900  59.23000
+187.1500  59.20000
+187.2000  59.18000
+187.2400  59.15000
+187.2800  59.11000
+187.3200  59.09000
+187.3500  59.08000
+187.3800  59.07000
+187.7000  58.95000
+187.7100  58.91000
+187.7400  58.87000
+187.7700  58.81000
+187.8200  58.75000
+187.8500  58.71000
+187.8600  58.69000
+187.8800  58.66000
+187.9100  58.62000
+187.9400  58.57000
+187.9600  58.54000
+187.9800  58.52000
+188.0000  58.49000
+188.0100  58.46000
+188.0600  58.37000
+188.1100  58.28000
+188.1300  58.21000
+188.1700  58.15000
+188.1800  58.11000
+188.2200  58.05000
+188.2400  58.01000
+188.2700  57.97000
+188.3100  57.91000
+188.3400  57.88000
+188.3700  57.84000
+188.4000  57.76000
+188.4200  57.70000
+188.4500  57.62000
+188.4600  57.57000
+188.4900  57.51000
+188.5400  57.44000
+188.6100  57.38000
+188.6500  57.33000
+188.6900  57.25000
+188.7500  57.18000
+188.8000  57.13000
+188.8800  57.07000
+188.9500  57.02000
+189.0200  56.98000
+189.0800  56.96000
+189.1400  56.95000
+189.2200  56.94000
+189.3000  56.90000
+189.3200  56.89000
+189.4700  56.77000
+189.5800  56.71000
+189.7200  56.66000
+189.8200  56.61000
+189.8800  56.57000
+189.9500  56.53000
+190.0000  56.49000
+190.0500  56.47000
+190.1900  56.42000
+190.2900  56.40000
+190.4300  56.40000
+190.4600  56.41000
+190.4600  56.44000
+190.5000  56.46000
+190.6000  56.48000
+190.7200  56.48000
+190.8100  56.49000
+190.8700  56.50000
+190.9600  56.54000
+191.0100  56.59000
+191.0600  56.65000
+191.0900  56.69000
+191.1200  56.73000
+191.1700  56.77000
+191.2200  56.79000
+191.2400  56.80000
+191.2600  56.81000
+191.3500  56.82000
+191.4200  56.82000
+191.5000  56.83000
+191.5900  56.84000
+191.7000  56.83000
+191.7400  56.82000
+191.8600  56.81000
+191.9000  56.81000
+191.9700  56.79000
+192.0800  56.76000
+192.2400  56.73000
+192.3500  56.73000
+192.4200  56.72000
+192.4800  56.71000
+192.5700  56.67000
+192.7200  56.64000
+192.8300  56.62000
+192.8800  56.61000
+192.9300  56.59000
+193.0300  56.56000
+193.1500  56.54000
+193.2100  56.53000
+193.2800  56.50000
+193.3200  56.48000
+193.4500  56.44000
+193.4900  56.43000
+193.5800  56.40000
+193.6800  56.37000
+193.7900  56.36000
+193.8200  56.35000
+193.8900  56.32000
+193.9500  56.29000
+194.0000  56.25000
+194.0500  56.21000
+194.1100  56.17000
+194.1300  56.16000
+194.1600  56.14000
+194.2200  56.10000
+194.2900  56.07000
+194.4500  56.03000
+194.5400  56.01000
+194.6100  55.98000
+194.6600  55.96000
+194.7600  55.92000
+194.8700  55.87000
+194.9000  55.86000
+194.9600  55.84000
+194.9800  55.82000
+195.0200  55.78000
+195.0600  55.75000
+195.1000  55.72000
+195.1900  55.69000
+195.2600  55.67000
+195.3300  55.66000
+195.3900  55.64000
+195.4500  55.61000
+195.5100  55.56000
+195.5500  55.52000
+195.5700  55.47000
+195.5600  55.43000
+195.5600  55.39000
+195.5500  55.37000
+195.4900  55.34000
+195.4200  55.32000
+195.3300  55.28000
+195.3000  55.26000
+195.2800  55.21000
+195.2700  55.18000
+195.2400  55.16000
+195.2000  55.13000
+195.1600  55.11000
+195.1200  55.08000
+195.1100  55.06000
+195.0700  55.02000
+195.0100  54.99000
+194.9600  54.95000
+194.9300  54.92000
+194.9000  54.88000
+194.8700  54.84000
+194.8300  54.80000
+194.8100  54.77000
+194.7700  54.74000
+194.7300  54.71000
+194.7200  54.69000
+194.6800  54.65000
+194.6500  54.62000
+194.6300  54.57000
+194.6100  54.54000
+194.5500  54.50000
+194.4900  54.46000
+194.4300  54.43000
+194.3800  54.41000
+194.3200  54.37000
+194.2900  54.33000
+194.2600  54.31000
+194.2000  54.28000
+194.1200  54.24000
+194.0600  54.22000
+194.0200  54.20000
+193.9900  54.18000
+193.9600  54.18000
+193.9200  54.16000
+193.8700  54.15000
+193.8000  54.12000
+193.7600  54.08000
+193.7400  54.06000
+193.7100  54.05000
+193.6800  54.03000
+193.6400  54.02000
+193.6000  54.01000
+193.5300  54.00000
+193.4900  53.99000
+193.4700  53.99000
+193.3700  53.98000
+193.3000  53.97000
+193.2200  53.96000
+193.1900  53.96000
+193.1300  53.95000
+193.0800  53.95000
+193.0600  53.94000
+193.0000  53.93000
+192.5700  53.56000
+192.5500  53.55000
+192.5300  53.54000
+192.5000  53.52000
+192.4400  53.51000
+192.4200  53.49000
+192.3700  53.47000
+192.3400  53.46000
+192.3000  53.44000
+192.2500  53.43000
+192.2100  53.43000
+192.1400  53.42000
+192.1200  53.44000
+192.0600  53.42000
+192.0300  53.43000
+191.9800  53.46000
+191.9700  53.48000
+191.9600  53.50000
+191.9400  53.51000
+191.8800  53.52000
+191.8400  53.53000
+191.8000  53.53000
+191.7700  53.53000
+191.7400  53.52000
+191.6900  53.50000
+191.6600  53.48000
+191.6400  53.47000
+191.6200  53.44000
+191.6000  53.43000
+191.5600  53.41000
+191.5400  53.40000
+191.5100  53.40000
+191.4900  53.39000
+191.4700  53.36000
+191.4500  53.35000
+191.4400  53.33000
+191.4100  53.31000
+191.3900  53.30000
+191.3700  53.29000
+191.3200  53.24000
+191.2700  53.22000
+191.2100  53.20000
+191.1800  53.18000
+191.1300  53.14000
+191.1200  53.12000
+191.0900  53.08000
+191.0500  53.04000
+191.0200  53.02000
+190.9800  52.99000
+190.9000  52.96000
+190.8700  52.92000
+190.8200  52.89000
+190.7800  52.86000
+190.7400  52.83000
+190.6800  52.79000
+190.6700  52.77000
+190.6500  52.73000
+190.6800  52.71000
+190.7000  52.69000
+190.7700  52.68000
+190.8000  52.68000
+190.8300  52.68000
+190.8700  52.69000
+190.9300  52.71000
+190.9900  52.73000
+191.0200  52.74000
+191.0500  52.76000
+191.1000  52.78000
+191.1200  52.79000
+191.1900  52.81000
+191.2200  52.81000
+191.2700  52.82000
+191.2900  52.85000
+191.3200  52.87000
+191.3500  52.87000
+191.3800  52.89000
+191.4300  52.90000
+191.5000  52.93000
+191.5400  52.94000
+191.5900  52.94000
+191.6500  52.96000
+191.6900  52.97000
+191.7100  52.98000
+191.7300  53.01000
+191.7900  53.04000
+191.8300  53.05000
+191.8800  53.05000
+191.9400  53.04000
+192.0500  53.03000
+192.1100  53.03000
+192.1400  53.04000
+192.2000  53.07000
+192.2700  53.10000
+192.3400  53.10000
+192.4200  53.12000
+192.4500  53.13000
+192.5200  53.16000
+192.5900  53.18000
+192.6400  53.20000
+192.7300  53.22000
+192.7500  53.23000
+192.8000  53.25000
+192.8400  53.26000
+192.8800  53.28000
+192.9400  53.31000
+193.0300  53.32000
+193.1000  53.34000
+193.1400  53.35000
+193.1700  53.35000
+193.2400  53.37000
+193.2900  53.39000
+193.3100  53.41000
+193.3900  53.44000
+193.4700  53.46000
+193.5200  53.47000
+193.5800  53.49000
+193.6300  53.51000
+193.6500  53.53000
+193.7100  53.55000
+193.7500  53.55000
+193.8200  53.55000
+193.9000  53.56000
+193.9600  53.56000
+194.0000  53.57000
+194.0600  53.58000
+194.1300  53.59000
+194.1900  53.61000
+194.2500  53.63000
+194.2700  53.63000
+194.3200  53.66000
+194.3500  53.67000
+194.4000  53.69000
+194.4600  53.70000
+194.5100  53.73000
+194.5400  53.77000
+194.5800  53.82000
+194.6200  53.84000
+194.6400  53.85000
+194.7000  53.86000
+194.7800  53.87000
+194.8100  53.87000
+194.8600  53.87000
+194.8900  53.84000
+195.0200  53.83000
+195.0900  53.83000
+195.1600  53.85000
+195.2500  53.88000
+195.2900  53.88000
+195.3100  53.88000
+195.3400  53.87000
+195.3600  53.87000
+195.4000  53.86000
+195.4400  53.86000
+195.5200  53.79000
+195.6600  53.78000
+195.6900  53.79000
+195.7300  53.80000
+195.8000  53.80000
+195.8700  53.81000
+195.8900  53.81000
+195.9800  53.84000
+196.0800  53.86000
+196.1000  53.87000
+196.1500  53.88000
+196.1800  53.90000
+196.2100  53.91000
+196.1800  53.91000
+196.1600  53.92000
+196.1400  53.95000
+196.1300  53.97000
+196.1200  54.01000
+196.1300  54.04000
+196.1700  54.04000
+196.2300  54.06000
+196.2400  54.04000
+196.2500  54.01000
+196.2700  53.99000
+196.3200  53.99000
+196.3500  54.02000
+196.4200  54.07000
+196.4500  54.06000
+196.5000  54.05000
+196.5600  54.04000
+196.6500  54.04000
+196.7300  54.04000
+196.7600  54.05000
+196.8600  54.08000
+196.9500  54.10000
+197.0400  54.11000
+197.1100  54.12000
+197.1800  54.13000
+197.2500  54.15000
+197.3200  54.18000
+197.4100  54.20000
+197.4600  54.21000
+197.5000  54.21000
+197.5400  54.22000
+197.5700  54.21000
+197.6300  54.21000
+197.6600  54.21000
+197.7000  54.26000
+197.7400  54.31000
+197.7500  54.35000
+197.8100  54.38000
+197.8700  54.38000
+197.9100  54.36000
+197.9600  54.35000
+198.0000  54.34000
+198.0500  54.34000
+198.0800  54.33000
+198.1000  54.33000
+198.1200  54.32000
+198.1400  54.30000
+198.1600  54.29000
+198.1400  54.28000
+198.1400  54.25000
+198.1500  54.23000
+198.2200  54.21000
+198.2600  54.24000
+198.2600  54.27000
+198.2600  54.30000
+198.3000  54.33000
+198.3400  54.33000
+198.3600  54.30000
+198.3800  54.31000
+198.4100  54.33000
+198.4600  54.38000
+198.5000  54.40000
+198.5600  54.42000
+198.6500  54.45000
+198.6900  54.48000
+198.7100  54.50000
+198.7800  54.56000
+198.8500  54.61000
+198.9600  54.67000
+199.0400  54.70000
+199.1100  54.73000
+199.1800  54.75000
+199.2300  54.76000
+199.2700  54.77000
+199.3300  54.77000
+199.3500  54.77000
+199.4000  54.77000
+199.4700  54.72000
+199.5200  54.68000
+199.6000  54.59000
+199.6800  54.56000
+199.7600  54.52000
+199.7800  54.52000
+199.8600  54.50000
+199.9300  54.49000
+199.9500  54.48000
+200.0100  54.48000
+200.0900  54.47000
+200.1500  54.47000
+200.1900  54.48000
+200.2700  54.49000
+200.3300  54.50000
+200.3800  54.51000
+200.4500  54.53000
+200.5300  54.54000
+200.6100  54.55000
+200.6700  54.56000
+200.7100  54.58000
+200.7400  54.60000
+200.8100  54.64000
+200.8800  54.67000
+200.9500  54.69000
+200.9900  54.70000
+201.0000  54.72000
+201.0300  54.74000
+201.1000  54.78000
+201.1500  54.80000
+201.1300  54.84000
+201.1000  54.87000
+201.0500  54.95000
+200.9900  55.02000
+200.9700  55.04000
+200.9500  55.08000
+200.9200  55.12000
+200.8900  55.16000
+200.8700  55.19000
+200.8600  55.21000
+200.8900  55.30000
+200.9100  55.31000
+200.9300  55.34000
+200.9900  55.41000
+201.0600  55.43000
+201.1000  55.45000
+201.1800  55.48000
+201.2500  55.48000
+201.3100  55.48000
+201.3300  55.48000
+201.4100  55.46000
+202.0800  55.21000
+202.1400  55.20000
+202.1400  55.23000
+202.1500  55.26000
+202.1600  55.30000
+202.1500  55.32000
+202.1600  55.36000
+202.1600  55.40000
+202.1700  55.48000
+202.2100  55.55000
+202.2100  55.59000
+202.2400  55.64000
+202.2700  55.69000
+202.3100  55.73000
+202.3300  55.77000
+202.3500  55.83000
+202.3600  55.88000
+202.3700  55.94000
+202.3800  55.98000
+202.4000  56.04000
+202.4200  56.08000
+202.8600  56.14000
+202.8800  56.12000
+202.9000  56.10000
+202.9100  56.08000
+202.9000  56.05000
+202.8800  56.01000
+202.8500  55.98000
+202.8200  55.91000
+202.8300  55.89000
+202.8900  55.88000
+202.9200  55.87000
+202.9500  55.87000
+202.9700  55.88000
+202.9900  55.90000
+203.2100  55.87000
+203.2300  55.88000
+203.2800  55.91000
+203.3500  55.91000
+203.4100  55.93000
+203.4400  55.97000
+203.4500  56.01000
+203.3800  56.07000
+203.3600  56.10000
+203.3300  56.12000
+203.3100  56.15000
+203.2900  56.21000
+203.2800  56.23000
+203.2500  56.25000
+203.2100  56.29000
+203.1900  56.31000
+203.1800  56.35000
+203.2000  56.42000
+203.2100  56.44000
+203.2500  56.49000
+203.3000  56.54000
+203.3200  56.57000
+203.3600  56.62000
+203.4300  56.68000
+203.4900  56.71000
+203.5300  56.75000
+203.6000  56.80000
+203.6300  56.87000
+203.6700  56.94000
+203.7000  57.00000
+203.7100  57.06000
+203.7100  57.14000
+203.7300  57.18000
+203.7600  57.23000
+203.7800  57.26000
+203.7800  57.28000
+203.8300  57.34000
+203.8600  57.33000
+203.8800  57.33000
+204.0300  57.35000
+204.1300  57.41000
+204.2300  57.49000
+204.3200  57.52000
+204.4300  57.57000
+204.5500  57.62000
+204.5900  57.68000
+204.6600  57.74000
+204.6900  57.74000
+204.8000  57.76000
+204.8800  57.87000
+204.9800  57.91000
+999.00000 99.00000
+190.2700  52.66700
+190.2400  52.67500
+190.2200  52.68400
+190.2000  52.69500
+190.1800  52.70400
+190.1700  52.72400
+190.1800  52.75000
+190.2000  52.76300
+190.2200  52.77600
+190.2400  52.77700
+190.2600  52.77100
+190.2800  52.78400
+190.2800  52.80400
+190.2700  52.82300
+190.2500  52.83900
+190.2300  52.83300
+190.2100  52.83000
+190.1900  52.82500
+190.1600  52.81200
+190.1300  52.80200
+190.1100  52.77800
+190.0900  52.76900
+190.0600  52.76100
+190.0300  52.75400
+190.0100  52.74900
+189.9900  52.73900
+189.9600  52.72700
+189.9400  52.71700
+189.9200  52.72500
+189.9200  52.74700
+189.8400  52.89100
+189.8000  52.89800
+189.8200  52.90400
+189.8400  52.92700
+189.8700  52.93700
+189.8900  52.94600
+189.9100  52.95100
+189.9300  52.95800
+189.9600  52.96800
+189.9900  52.97900
+190.0100  52.98400
+190.0400  52.98800
+190.0600  52.99300
+190.0800  52.99500
+190.1200  52.99400
+190.1500  52.99300
+190.1700  52.99600
+190.1900  52.99800
+190.2100  52.99300
+190.2500  52.99200
+190.2800  52.98900
+190.3000  52.98800
+190.3300  52.98300
+190.3500  52.96500
+190.3600  52.94700
+190.3700  52.92800
+190.3700  52.90400
+190.3800  52.87800
+190.3800  52.84400
+190.3700  52.81600
+190.3800  52.79100
+190.3800  52.76800
+190.3700  52.73600
+190.3600  52.71700
+190.3600  52.68200
+190.3400  52.67100
+190.3100  52.66000
+190.2900  52.65600
+190.2600  52.66000
+190.2400  52.67400
+999.00000 99.00000
+187.3400  52.23700
+187.3500  52.25600
+187.3700  52.28300
+187.3900  52.29700
+187.4100  52.31600
+187.4300  52.31800
+187.4600  52.30600
+187.4800  52.29200
+187.5100  52.27100
+187.5400  52.26400
+187.5600  52.25800
+187.5700  52.23300
+187.5600  52.20900
+187.5400  52.19600
+187.5200  52.18400
+187.5000  52.17800
+187.4600  52.17400
+187.4300  52.17400
+187.4100  52.18200
+187.3900  52.19500
+187.3700  52.20600
+187.3500  52.21600
+187.3400  52.22600
+187.3400  52.23700
+999.00000 99.00000
+187.5800  52.31100
+187.6000  52.33300
+187.6200  52.34700
+187.6400  52.35500
+187.6600  52.35800
+187.6800  52.35300
+187.7000  52.33500
+187.7100  52.31300
+187.7000  52.28900
+187.6900  52.27000
+187.6700  52.26600
+187.6500  52.26800
+187.6300  52.27400
+187.6100  52.29400
+187.5900  52.31500
+999.00000 99.00000
+187.2000  52.13900
+187.2100  52.12100
+187.2200  52.10200
+187.2300  52.08000
+187.2100  52.05600
+187.1800  52.05200
+187.1400  52.04200
+187.1000  52.04300
+187.0800  52.04500
+187.0400  52.04700
+187.0100  52.05000
+186.9900  52.04900
+186.9600  52.04300
+186.9200  52.02800
+186.8800  52.02200
+186.8300  52.01500
+186.8100  52.01200
+186.7700  52.00600
+186.7200  51.98800
+186.6800  51.97600
+186.6500  51.97100
+186.6100  51.96800
+186.5700  51.96700
+186.5200  51.96700
+186.4900  51.96800
+186.4500  51.96800
+186.4100  51.96700
+186.3600  51.96400
+186.3300  51.95800
+186.2900  51.95400
+186.2700  51.95200
+186.2300  51.95400
+186.1800  51.95300
+186.1500  51.95000
+186.1300  51.94500
+186.0700  51.93800
+186.0500  51.93600
+186.0100  51.93400
+185.9900  51.93200
+185.9500  51.93700
+185.9100  51.93900
+185.8400  51.96200
+185.8200  51.96500
+185.8000  51.96900
+185.7500  51.96900
+185.6900  51.96100
+185.6500  51.95900
+185.6300  51.95800
+185.6100  51.95400
+185.5700  51.93400
+185.5200  51.92300
+185.4900  51.92000
+185.4700  51.91800
+185.4300  51.91400
+185.3800  51.91100
+185.3500  51.91200
+185.3300  51.91400
+185.3100  51.92100
+185.1400  51.94000
+185.1200  51.94000
+185.1000  51.92200
+184.9500  51.86600
+184.9500  51.89700
+184.8800  51.91700
+184.8500  51.89500
+184.7500  51.88900
+184.9700  51.90700
+184.9500  51.90900
+184.9100  51.90400
+184.8600  51.90200
+184.8300  51.90200
+184.7700  51.90200
+184.7400  51.90500
+184.6800  51.90200
+184.6400  51.89700
+184.5600  51.89400
+184.5300  51.89300
+184.4800  51.89500
+184.4300  51.88700
+184.3700  51.86300
+184.3000  51.82600
+184.2800  51.82100
+184.2100  51.80500
+184.1900  51.80600
+184.1500  51.80200
+184.1300  51.80100
+184.0600  51.79700
+184.0400  51.79100
+184.0200  51.78400
+183.9900  51.77500
+183.9700  51.77400
+183.9300  51.76700
+183.9100  51.76100
+183.8900  51.75800
+183.8600  51.74600
+183.8300  51.74300
+183.7900  51.73400
+183.7400  51.72100
+183.7100  51.72300
+183.6600  51.72200
+183.6300  51.71600
+183.6000  51.71400
+183.5600  51.71000
+183.5500  51.68700
+183.4600  51.65900
+183.4400  51.65600
+183.4000  51.64700
+183.3600  51.63200
+183.3200  51.61600
+183.2700  51.60700
+183.2100  51.59200
+183.1800  51.58700
+183.1300  51.57900
+183.1100  51.57600
+183.0900  51.57400
+183.0700  51.57600
+183.0400  51.58600
+183.0100  51.60800
+182.9800  51.64000
+182.9600  51.65500
+182.9300  51.68200
+182.9100  51.69400
+182.8800  51.68800
+182.8600  51.67900
+182.8400  51.66400
+182.8200  51.65600
+182.8000  51.64000
+182.7600  51.63800
+182.7300  51.64900
+182.7100  51.65900
+182.6600  51.67100
+182.6400  51.68700
+182.6200  51.68800
+182.5800  51.67900
+182.5300  51.66600
+182.5000  51.65300
+182.4300  51.64700
+182.3800  51.63800
+182.3400  51.64600
+182.3100  51.64800
+182.2800  51.64600
+182.2500  51.64100
+182.2300  51.63200
+182.1800  51.61500
+182.1600  51.61300
+182.1300  51.61700
+182.1100  51.61500
+182.0900  51.60300
+182.0700  51.58500
+182.0500  51.57500
+182.0100  51.58000
+181.9900  51.58800
+181.9700  51.59900
+181.9500  51.60900
+181.9000  51.62500
+181.8700  51.62700
+181.8500  51.62800
+181.8000  51.63700
+181.7800  51.65900
+181.8000  51.68700
+181.8000  51.70900
+181.8100  51.74100
+181.8200  51.75900
+181.8400  51.78100
+181.8600  51.78200
+181.9000  51.79100
+181.9200  51.80400
+181.9400  51.81400
+181.9600  51.81900
+181.9900  51.82000
+182.0100  51.82300
+182.0400  51.82300
+182.0600  51.81900
+182.0900  51.80900
+182.1100  51.80600
+182.1300  51.78700
+182.1500  51.77600
+182.1800  51.76500
+182.2000  51.75400
+182.2200  51.74600
+182.2500  51.74400
+182.2900  51.74800
+182.3200  51.75300
+182.3500  51.75400
+182.3900  51.75500
+182.4300  51.75000
+182.4600  51.75000
+182.4800  51.74900
+182.5200  51.75100
+182.5500  51.75500
+182.5800  51.76000
+182.6200  51.76400
+182.6500  51.76500
+182.6800  51.76600
+182.7000  51.76800
+182.7300  51.77200
+182.7600  51.77600
+182.7900  51.78500
+182.8500  51.78900
+182.8700  51.79700
+182.9100  51.79800
+182.9300  51.79300
+182.9600  51.79100
+183.0000  51.77900
+183.0300  51.78100
+183.0700  51.78400
+183.0900  51.79200
+183.1200  51.80600
+183.1500  51.82300
+183.1800  51.84800
+183.2000  51.85600
+183.2200  51.86100
+183.2500  51.86700
+183.2700  51.87100
+183.3100  51.87400
+183.3400  51.87900
+183.3700  51.88100
+183.4000  51.88800
+183.4500  51.88600
+183.4800  51.88300
+183.5100  51.88300
+183.5400  51.88400
+183.5900  51.88500
+183.6100  51.89700
+183.6300  51.91100
+183.6600  51.92100
+183.6900  51.92900
+183.7200  51.94100
+183.7500  51.97300
+183.7900  51.99300
+183.8200  52.01000
+183.8700  52.02100
+183.9000  52.02000
+183.9300  52.02100
+183.9700  52.02200
+183.9900  52.02800
+184.0200  52.03200
+184.0500  52.03700
+184.0800  52.04000
+184.1100  52.03400
+184.1300  52.03100
+184.1700  52.02400
+184.2300  52.02000
+184.2500  52.01900
+184.2800  52.00600
+184.3000  51.99800
+184.3400  51.99200
+184.3600  51.99500
+184.4000  51.99700
+184.4500  52.00100
+184.4900  52.00900
+184.5200  52.01200
+184.5600  52.01300
+184.6000  52.01300
+184.6400  52.01500
+184.6600  52.01700
+184.7600  52.03800
+184.8000  52.03800
+184.8400  52.03400
+184.8700  52.04300
+184.9100  52.05200
+184.9400  52.06900
+185.0100  52.09700
+185.0300  52.10300
+185.0800  52.10900
+185.1000  52.11300
+185.1400  52.12000
+185.1600  52.12600
+185.2200  52.13600
+185.2500  52.14300
+185.2900  52.15500
+185.3800  52.18200
+185.4300  52.20000
+185.4900  52.25000
+185.5200  52.26900
+185.5600  52.29500
+185.6300  52.32100
+185.6700  52.33900
+185.7100  52.33900
+185.7300  52.33100
+185.7500  52.31400
+185.7700  52.30100
+185.7900  52.28100
+185.8200  52.26600
+185.8400  52.25200
+185.8700  52.24800
+185.9300  52.25500
+185.9500  52.26700
+185.9700  52.30500
+186.0000  52.30300
+186.0400  52.28600
+186.0900  52.26600
+186.1100  52.25600
+186.1500  52.24200
+186.2800  52.21500
+186.4100  52.19900
+186.4600  52.19300
+186.4800  52.18300
+186.5400  52.15800
+186.5800  52.15000
+186.6700  52.14500
+186.7600  52.14200
+186.8500  52.13200
+186.9400  52.12400
+186.9800  52.12000
+187.0000  52.12800
+187.0500  52.13600
+187.0700  52.13800
+187.0900  52.14400
+187.1300  52.14800
+187.1700  52.14300
+187.1900  52.12900
+187.2000  52.13900
+999.00000 99.00000
+179.4600  51.97200
+179.4900  52.02700
+179.5200  52.06200
+179.5500  52.08800
+179.5800  52.11300
+179.6300  52.14000
+179.6500  52.14900
+179.7000  52.14700
+179.7300  52.13900
+179.7600  52.11600
+179.7900  52.07600
+179.7900  52.05200
+179.7700  52.02100
+179.7600  51.98400
+179.7400  51.95500
+179.7300  51.93700
+179.7100  51.91900
+179.6700  51.88600
+179.6400  51.86700
+179.6100  51.86400
+179.5700  51.86400
+179.5400  51.87500
+179.5300  51.89400
+999.00000 99.00000
+179.2000  51.31000
+179.1600  51.32100
+179.1300  51.33300
+179.0900  51.34600
+179.0500  51.37000
+179.0100  51.39500
+178.9600  51.42500
+178.9300  51.45200
+178.8900  51.47500
+178.8600  51.48900
+178.8000  51.50500
+178.7400  51.51900
+178.7000  51.53100
+178.6600  51.54600
+178.6400  51.55500
+178.6600  51.58300
+178.7300  51.58600
+178.7700  51.57800
+178.8200  51.57100
+178.8500  51.56800
+178.8700  51.56300
+178.8900  51.55700
+178.9200  51.53300
+178.9600  51.52200
+179.0000  51.52000
+179.0400  51.51400
+179.0800  51.50000
+179.1000  51.48800
+179.1300  51.46800
+179.1600  51.44800
+179.2000  51.43100
+179.2300  51.42100
+179.2500  51.41500
+179.2700  51.39200
+179.2800  51.37000
+179.2400  51.34800
+999.00000 99.00000
+178.1400  51.78000
+178.1600  51.74500
+178.1500  51.77100
+178.4000  51.88500
+178.3600  51.85500
+178.3400  51.84200
+178.3300  51.81800
+178.3300  51.79700
+178.3400  51.77700
+178.3400  51.74800
+178.3400  51.72800
+178.3100  51.71900
+178.2800  51.72000
+178.2500  51.72000
+178.2100  51.72800
+178.1900  51.74500
+178.1600  51.75500
+178.1400  51.78000
+999.00000 99.00000
+177.2000  51.83300
+177.2000  51.87200
+177.3700  51.99700
+177.4000  52.00000
+177.4200  52.01000
+177.4400  52.01900
+177.4600  52.03000
+177.4800  52.03900
+177.5000  52.04500
+177.5400  52.05400
+177.5700  52.05400
+177.6000  52.05100
+177.6300  52.05000
+177.6500  52.03400
+177.6800  52.00900
+177.7100  51.99300
+177.7300  51.98900
+177.7300  51.95700
+177.7200  51.93800
+177.7000  51.91300
+177.6700  51.90500
+999.00000 99.00000
+172.6900  52.73600
+172.6600  52.74100
+172.6300  52.75800
+172.6200  52.77700
+172.6100  52.79500
+172.5800  52.81300
+172.5600  52.83400
+172.5300  52.85200
+172.4900  52.88000
+172.4700  52.89200
+172.4500  52.90200
+172.4800  52.90700
+172.5000  52.91100
+172.5200  52.92000
+172.5500  52.93300
+172.5600  52.95200
+172.5900  52.96800
+172.6200  52.99800
+172.6700  53.01200
+172.7000  53.01100
+172.7200  53.01100
+172.7500  53.01100
+172.7700  53.00800
+172.8000  53.00400
+172.8300  52.99600
+172.8800  52.98900
+172.9200  52.98300
+172.9700  52.97900
+173.0100  52.97000
+173.0300  52.96600
+173.0600  52.95700
+173.0900  52.94200
+173.1200  52.92900
+173.1400  52.92000
+173.1700  52.91100
+173.2000  52.90500
+173.2200  52.89900
+173.2400  52.88600
+173.2600  52.86100
+173.3000  52.83800
+173.3300  52.83100
+173.3500  52.83100
+173.4000  52.81700
+173.4100  52.79500
+173.4300  52.77400
+173.4500  52.76100
+173.4700  52.73400
+173.4900  52.71600
+173.5100  52.66300
+173.5200  52.64000
+173.5400  52.61800
+173.5700  52.61200
+173.6000  52.61000
+173.6400  52.61000
+173.6700  52.61600
+173.6900  52.62700
+173.7100  52.63800
+173.7300  52.66900
+173.7300  52.70600
+173.6900  52.74300
+173.6600  52.76400
+173.6800  52.77200
+173.7000  52.76700
+173.7400  52.75400
+173.7600  52.74800
+173.7900  52.74400
+173.8100  52.73900
+173.8600  52.73300
+173.9100  52.72500
+173.9600  52.71000
+173.9800  52.70200
+174.0000  52.68800
+174.0300  52.67700
+174.0500  52.67200
+174.0700  52.66100
+174.0900  52.63600
+174.1000  52.61500
+174.1100  52.58400
+174.1200  52.56300
+174.1300  52.53800
+174.1400  52.50700
+174.1300  52.48700
+174.1000  52.47500
+174.0800  52.46500
+174.0600  52.45400
+174.0400  52.44100
+174.0100  52.42200
+173.9800  52.40800
+173.9600  52.39900
+173.9300  52.38800
+173.9100  52.37700
+173.8800  52.36600
+173.8600  52.35600
+173.8300  52.34800
+173.8000  52.33000
+173.7800  52.30900
+173.7600  52.28000
+173.7400  52.25700
+173.7200  52.25400
+173.6900  52.27500
+173.6700  52.29400
+173.6400  52.31600
+173.6200  52.32400
+173.5900  52.32800
+173.5600  52.32900
+173.5000  52.32700
+173.4800  52.32900
+173.4500  52.33300
+173.4300  52.33800
+173.4100  52.35400
+173.3900  52.36400
+173.3600  52.37300
+173.3300  52.38700
+173.3100  52.39700
+173.2800  52.40600
+173.2500  52.42100
+173.2200  52.43200
+173.1900  52.43800
+173.1700  52.45100
+173.1400  52.47100
+173.1100  52.48100
+173.0700  52.49600
+173.0400  52.50400
+173.0100  52.53500
+172.9800  52.55000
+172.9600  52.56900
+172.9400  52.59000
+172.9300  52.61400
+172.9200  52.63200
+172.9000  52.64800
+172.8700  52.66500
+172.8400  52.68800
+172.8000  52.70900
+172.7600  52.72700
+172.7100  52.74300
+999.00000 99.00000
+167.9000  54.57300
+167.8700  54.57700
+167.8400  54.58000
+167.8100  54.57900
+167.7800  54.57500
+167.7400  54.57500
+167.7100  54.57600
+167.6700  54.57400
+167.6400  54.57300
+167.6100  54.58100
+167.5800  54.59500
+167.5600  54.60600
+167.5300  54.62300
+167.5000  54.64300
+167.4700  54.65700
+167.4400  54.66700
+167.3900  54.67500
+167.3700  54.68300
+167.3500  54.69700
+167.3200  54.72300
+167.3100  54.74100
+167.3100  54.77600
+167.3000  54.80500
+167.3200  54.83500
+167.3400  54.84200
+167.3700  54.84200
+167.3900  54.83700
+167.4100  54.83000
+167.4400  54.81300
+167.4600  54.79700
+167.4900  54.77300
+167.5100  54.76700
+167.5400  54.76300
+167.5700  54.75900
+167.5900  54.75300
+167.6200  54.73400
+167.6300  54.71600
+167.6500  54.70700
+167.6700  54.69400
+167.7000  54.69200
+167.7300  54.69000
+167.7700  54.67500
+167.7900  54.66600
+167.8100  54.64800
+167.8300  54.62100
+167.8500  54.60600
+167.8700  54.59300
+167.8900  54.59000
+999.00000 99.00000
+166.3700  54.84300
+166.3300  54.85600
+166.2800  54.87500
+166.2600  54.88700
+166.2300  54.90000
+166.1900  54.92700
+166.1600  54.94500
+166.1300  54.98200
+166.1000  55.00600
+166.0700  55.03200
+166.0600  55.05200
+166.0400  55.07400
+166.0300  55.09200
+166.0100  55.11600
+165.9900  55.13600
+165.9600  55.16300
+165.9300  55.18600
+165.8900  55.20700
+165.8600  55.22100
+165.8200  55.23500
+165.7800  55.25100
+165.7500  55.26100
+165.7300  55.26900
+165.7100  55.27200
+165.6700  55.28100
+165.6500  55.29600
+165.6300  55.31500
+165.6400  55.33700
+165.6800  55.34200
+165.7200  55.34700
+165.7600  55.35000
+165.8100  55.35800
+165.8600  55.37300
+165.9000  55.38000
+165.9300  55.38500
+165.9600  55.38400
+165.9900  55.37700
+166.0200  55.37000
+166.0800  55.36600
+166.1100  55.35700
+166.1400  55.35200
+166.1700  55.33000
+166.2100  55.29800
+166.2500  55.27900
+166.2700  55.26000
+166.2900  55.24300
+166.3000  55.21500
+166.3000  55.19500
+166.3200  55.15600
+166.3500  55.11300
+166.3700  55.09200
+166.4000  55.05800
+166.4300  55.02900
+166.4500  55.01200
+166.4800  54.98800
+166.5100  54.96700
+166.5400  54.95000
+166.5700  54.93500
+166.6300  54.90600
+166.6800  54.85800
+166.7100  54.83000
+166.7400  54.79100
+166.7700  54.75700
+166.7900  54.73000
+166.8200  54.69900
+166.8200  54.67700
+166.7800  54.66300
+166.7600  54.66400
+166.7300  54.67200
+166.7000  54.68000
+166.7000  54.68000
+166.6800  54.69000
+166.6500  54.69900
+999.00000 99.00000
+156.99896 60.75002
+156.83231 60.66669
+156.66565 60.58336
+156.49899 60.50003
+155.99902 60.25003
+155.58238 59.91670
+155.58238 59.83337
+155.58238 59.58337
+155.66571 59.50004
+155.83237 59.41671
+155.99902 59.16671
+155.83237 59.08338
+155.33240 59.00005
+154.58244 58.91672
+152.33258 58.75005
+151.99927 58.66672
+150.58269 58.75005
+150.49936 58.83339
+150.08272 59.08338
+149.91606 59.08338
+149.33276 59.00005
+148.58281 59.00005
+148.24950 59.08338
+148.08284 59.08338
+147.74953 59.08338
+147.74953 59.00005
+147.58287 58.91672
+147.08290 59.08338
+146.99957 59.00005
+146.49960 59.08338
+146.08296 59.00005
+145.58299 59.00005
+145.58299 59.08338
+145.41634 59.16671
+145.33301 59.16671
+144.58305 59.08338
+144.49973 59.08338
+143.41646 58.91672
+143.08315 58.83339
+142.83316 58.75005
+142.33319 58.58339
+142.24986 58.50006
+142.08321 58.41673
+141.91655 58.33339
+141.16660 58.00006
+141.08327 57.91673
+140.99994 57.83340
+140.91661 57.75007
+140.74995 57.66674
+140.66663 57.58340
+999.00000 99.00000
+159.83212 59.58337
+159.08217 59.25005
+158.99884 59.16671
+158.83218 59.08338
+158.41554 58.91672
+157.99890 58.75005
+157.83224 58.66672
+157.66559 58.58339
+156.41566 58.00006
+156.33234 57.91673
+156.24901 57.83340
+156.16568 57.75007
+155.83237 57.50007
+155.58238 57.25008
+155.49905 57.16674
+155.41573 57.08341
+155.33240 57.00008
+155.24907 56.91675
+154.83243 56.66675
+154.83243 56.58342
+154.83243 56.50009
+154.83243 56.41676
+154.83243 56.33342
+154.83243 56.25009
+154.83243 56.16676
+154.83243 56.08343
+154.74910 55.75010
+154.74910 55.66677
+154.74910 55.58344
+154.83243 55.41677
+154.83243 55.33344
+154.83243 55.25011
+154.83243 55.16677
+154.91576 55.08344
+154.91576 55.00011
+154.91576 54.91678
+154.91576 54.41679
+154.91576 54.33345
+154.91576 54.25012
+154.91576 54.08346
+154.91576 54.00013
+154.91576 53.91679
+154.91576 53.83346
+155.24907 53.00014
+155.24907 52.91681
+155.33240 52.83348
+155.33240 52.75014
+155.41573 52.58348
+155.49905 52.50015
+155.49905 52.41682
+155.49905 52.33348
+155.58238 52.16682
+155.83237 51.83349
+155.91570 51.75016
+155.99902 51.66683
+156.08235 51.58350
+156.24901 51.41683
+156.33234 51.33350
+156.33234 51.25017
+156.33234 51.16684
+156.33234 51.08350
+156.24901 51.00017
+156.16568 50.91684
+155.99902 50.83351
+155.83237 50.75018
+155.74904 50.66684
+155.66571 50.58351
+155.66571 50.50018
+155.58238 50.41685
+155.33240 50.33352
+155.16574 50.25018
+155.16574 50.16685
+155.16574 50.08352
+155.16574 50.00019
+155.24907 49.91685
+155.58238 49.91685
+155.74904 49.91685
+155.83237 49.83352
+155.99902 49.75019
+156.16568 49.75019
+156.33234 49.83352
+156.33234 49.91685
+156.33234 50.00019
+156.33234 50.08352
+156.41566 50.16685
+156.49899 50.25018
+156.58232 50.33352
+156.74898 50.41685
+156.83231 50.50018
+156.99896 50.58351
+157.33228 50.66684
+157.41560 50.75018
+157.49893 50.83351
+157.58226 50.91684
+157.66559 51.00017
+157.74892 51.16684
+157.83224 51.25017
+157.83224 51.33350
+157.99890 51.41683
+157.99890 51.50016
+158.08223 51.58350
+158.16556 51.66683
+158.24889 51.75016
+158.33221 51.83349
+158.41554 51.91682
+158.49887 52.00016
+158.58220 52.08349
+158.66553 52.16682
+158.66553 52.25015
+158.49887 52.33348
+158.49887 52.41682
+158.49887 52.50015
+158.58220 52.58348
+158.66553 52.66681
+158.66553 52.75014
+158.58220 52.83348
+158.99884 52.91681
+159.33215 53.00014
+159.74879 53.08347
+999.00000 99.00000
+140.08333 48.00022
+140.16666 48.08355
+140.24998 48.25021
+140.33331 48.33355
+140.41664 48.41688
+140.49997 48.50021
+140.58330 48.58354
+140.66663 48.66687
+140.66663 48.75021
+140.74995 48.83354
+140.83328 48.91687
+140.83328 49.00020
+140.83328 49.08353
+140.91661 49.25020
+140.91661 49.33353
+140.91661 49.41686
+140.91661 49.50019
+140.91661 49.58353
+140.91661 49.66686
+140.99994 49.75019
+140.99994 49.83352
+140.99994 49.91685
+141.08327 50.08352
+141.16660 50.25018
+141.33325 50.50018
+141.58324 50.66684
+141.74989 50.66684
+141.66656 50.58351
+141.66656 50.50018
+141.74989 50.41685
+141.83322 50.33352
+141.83322 50.25018
+141.83322 50.16685
+141.83322 50.00019
+141.83322 49.91685
+141.83322 49.83352
+141.83322 49.75019
+141.83322 49.66686
+141.83322 49.58353
+141.83322 49.50019
+141.83322 49.41686
+141.83322 49.33353
+141.83322 49.25020
+141.83322 49.16687
+141.83322 49.08353
+141.74989 49.00020
+141.74989 48.91687
+141.74989 48.83354
+141.66656 48.75021
+141.66656 48.66687
+141.66656 48.58354
+141.74989 48.50021
+141.74989 48.41688
+141.74989 48.33355
+141.83322 48.25021
+141.83322 48.16688
+141.74989 48.08355
+141.74989 48.00022
+141.74989 47.91689
+141.74989 47.83355
+141.74989 47.75022
+141.83322 47.66689
+141.83322 47.58356
+141.83322 47.50023
+141.91655 47.41689
+141.91655 47.33356
+141.91655 47.25023
+141.91655 47.16690
+141.91655 47.08356
+141.91655 47.00023
+141.91655 46.91690
+141.83322 46.83357
+141.74989 46.75024
+141.66656 46.66690
+141.66656 46.58357
+141.66656 46.50024
+141.66656 46.41691
+141.66656 46.33358
+141.58324 46.25024
+141.58324 46.16691
+141.58324 46.08358
+141.49991 46.00025
+141.49991 45.91692
+141.49991 45.83358
+141.49991 45.75025
+141.41658 45.66692
+141.41658 45.58359
+140.91661 45.50026
+140.91661 45.41692
+140.91661 45.33359
+140.91661 45.25026
+140.91661 45.16693
+140.99994 45.08360
+140.99994 45.00026
+141.08327 44.91693
+141.16660 44.83360
+141.24992 44.75027
+141.24992 44.66693
+141.24992 44.58360
+141.16660 44.50027
+141.16660 44.41694
+141.24992 44.08361
+141.33325 43.91695
+141.33325 43.83361
+141.16660 43.75028
+141.16660 43.66695
+141.08327 43.58362
+140.99994 43.50029
+140.91661 43.41695
+140.83328 43.33362
+140.41664 43.33362
+140.24998 43.33362
+140.24998 43.25029
+140.24998 43.16696
+140.33331 43.08363
+140.33331 43.00029
+140.33331 42.91696
+140.16666 42.83363
+140.08333 42.75030
+999.00000 99.00000
+143.08315 54.75011
+143.24980 54.66678
+143.33313 54.58345
+143.33313 54.50012
+143.33313 54.41679
+143.41646 54.33345
+143.41646 54.25012
+143.41646 54.16679
+143.33313 54.08346
+143.41646 54.00013
+143.58311 53.66680
+143.66644 53.58347
+143.66644 53.50013
+143.74977 53.41680
+143.74977 53.33347
+143.83310 53.16681
+143.83310 53.08347
+143.91643 53.00014
+143.91643 52.91681
+143.99976 52.83348
+144.08308 52.66681
+144.08308 52.58348
+144.08308 52.50015
+144.08308 52.41682
+144.08308 52.33348
+144.08308 52.25015
+144.08308 52.16682
+144.08308 52.08349
+144.08308 52.00016
+143.99976 51.91682
+143.99976 51.83349
+143.99976 51.75016
+143.99976 51.66683
+143.99976 51.58350
+143.99976 51.50016
+143.99976 51.41683
+143.99976 51.33350
+143.99976 51.25017
+143.99976 51.16684
+143.99976 51.08350
+143.99976 51.00017
+143.99976 50.91684
+143.99976 50.83351
+143.99976 50.75018
+144.08308 50.66684
+144.08308 50.58351
+144.08308 50.50018
+144.08308 50.41685
+144.16641 50.33352
+144.16641 50.25018
+144.24974 50.16685
+144.24974 50.08352
+144.33307 49.91685
+144.41640 49.83352
+144.41640 49.75019
+144.49973 49.66686
+144.49973 49.58353
+144.58305 49.50019
+144.58305 49.41686
+144.58305 49.33353
+144.58305 49.25020
+144.74971 49.16687
+144.74971 49.08353
+144.83304 49.00020
+144.91637 48.91687
+144.91637 48.83354
+144.99969 48.75021
+144.99969 48.66687
+145.08302 48.58354
+145.08302 48.50021
+145.08302 48.41688
+145.08302 48.33355
+145.16635 48.25021
+145.33301 48.16688
+145.24968 48.08355
+145.33301 48.00022
+145.33301 47.91689
+145.33301 47.83355
+144.66638 47.91689
+144.49973 48.00022
+144.24974 47.91689
+144.08308 47.83355
+143.91643 47.75022
+143.66644 47.58356
+143.49979 47.41689
+143.33313 47.50023
+143.33313 47.41689
+143.41646 47.33356
+143.41646 47.25023
+143.41646 47.16690
+143.41646 47.08356
+143.58311 46.91690
+143.66644 46.83357
+143.66644 46.75024
+143.66644 46.66690
+143.66644 46.58357
+143.74977 46.50024
+143.74977 46.41691
+143.74977 46.33358
+143.83310 46.25024
+143.66644 46.16691
+143.66644 46.08358
+143.58311 46.00025
+143.58311 45.91692
+143.16647 45.91692
+142.91649 45.91692
+142.74983 45.83358
+142.66650 45.75025
+142.66650 45.66692
+142.66650 45.58359
+142.66650 45.50026
+142.74983 45.41692
+142.83316 45.25026
+142.91649 45.08360
+142.99982 44.91693
+143.08315 44.83360
+143.24980 44.75027
+143.41646 44.66693
+143.58311 44.58360
+144.16641 44.25027
+144.24974 44.08361
+144.41640 44.00028
+144.74971 44.00028
+144.91637 44.08361
+145.08302 43.91695
+145.41634 43.91695
+145.58299 44.00028
+145.66632 44.08361
+145.74965 44.16694
+145.83298 44.25027
+145.91631 44.33361
+145.99963 44.41694
+146.08296 44.50027
+146.33295 44.50027
+146.49960 44.41694
+146.58293 44.33361
+146.66626 44.25027
+146.66626 44.16694
+146.74959 44.08361
+146.74959 44.00028
+146.91624 44.00028
+146.83292 44.41694
+146.83292 44.50027
+146.83292 44.58360
+146.99957 44.66693
+999.00000 99.00000
+147.08290 44.75027
+147.16623 44.83360
+147.33289 44.91693
+148.08284 44.91693
+147.74953 44.83360
+147.66620 44.75027
+147.58287 44.66693
+147.41621 44.58360
+147.33289 44.50027
+147.24956 44.41694
+147.33289 44.00028
+147.33289 43.91695
+147.33289 43.83361
+147.08290 43.75028
+147.08290 43.66695
+146.91624 43.58362
+146.74959 43.50029
+146.58293 43.41695
+146.41628 43.41695
+146.41628 43.33362
+146.24962 43.25029
+145.74965 43.16696
+145.66632 43.08363
+145.49966 43.00029
+145.33301 43.00029
+145.24968 43.00029
+145.16635 42.91696
+145.08302 42.83363
+144.74971 42.83363
+144.16641 42.83363
+143.99976 42.75030
+143.91643 42.66697
+143.83310 42.58363
+143.74977 42.50030
+143.66644 42.41697
+143.66644 42.33364
+143.58311 42.25031
+143.58311 42.16697
+143.58311 42.08364
+143.58311 42.00031
+143.33313 41.83364
+143.16647 41.83364
+142.99982 41.91698
+142.83316 42.00031
+142.66650 42.08364
+142.49985 42.16697
+142.33319 42.25031
+142.08321 42.33364
+141.91655 42.41697
+141.41658 41.33365
+141.41658 41.25032
+141.33325 41.08366
+141.33325 41.00032
+141.49991 40.91699
+141.49991 40.83366
+141.58324 40.75033
+141.66656 40.66700
+141.74989 40.58366
+141.83322 40.50033
+141.91655 40.41700
+141.99988 40.33367
+141.99988 40.25034
+142.08321 40.08367
diff --git a/jnls/contrib/bering_iso100.jnl b/jnls/contrib/bering_iso100.jnl
new file mode 100644
index 0000000..52fd426
--- /dev/null
+++ b/jnls/contrib/bering_iso100.jnl
@@ -0,0 +1,21 @@
+! Description: overlay of bering sea & asian 100m isobath
+! contributed by Mick Spillane, NOAA/PMEL 1992
+                        
+cancel mode verify	! ... now overlaying 100m isobath ...
+
+set data/save
+define axis/x=1:4175:1 axtb
+define grid/x=axtb gtb
+
+file/col=2/form=(2f9.5)/var="xtb,ytb"/grid=gtb bering_iso100.dat
+
+set variable/bad=999.0 xtb
+set variable/bad=99.0  ytb
+plot/set/vs/over/nolab/x=1:4175 xtb,ytb
+ppl pen 1 3
+ppl plot/over
+
+cancel data bering_iso100.dat
+set data/restore
+set mode/last verify
+
diff --git a/jnls/contrib/bering_iso1000.dat b/jnls/contrib/bering_iso1000.dat
new file mode 100644
index 0000000..ad8bf79
--- /dev/null
+++ b/jnls/contrib/bering_iso1000.dat
@@ -0,0 +1,2570 @@
+160.33331 79.08331
+160.66663 78.99997
+160.91661 78.91663
+161.24992 78.83330
+161.49991 78.74996
+161.74989 78.66663
+162.08321 78.58329
+162.58318 78.49995
+165.49966 78.49995
+167.24956 78.49995
+167.99951 78.41662
+168.41615 78.33328
+168.99945 78.24995
+169.91606 78.16661
+170.41603 78.08327
+170.99933 77.99994
+171.49930 77.91660
+171.83261 77.83327
+172.16592 77.74993
+172.41591 77.66660
+172.66589 77.58326
+172.83255 77.49992
+173.08253 77.41659
+173.33252 77.33325
+173.58250 77.24992
+174.24913 77.16658
+175.66571 77.16658
+176.08235 77.16658
+176.58232 77.08324
+176.91563 76.91657
+176.99896 76.83324
+176.99896 76.74990
+177.08229 76.66656
+177.08229 76.58323
+177.16562 76.49989
+177.49893 76.33322
+179.66547 76.33322
+181.99866 76.41656
+181.91533 76.33322
+181.83200 76.24989
+181.41536 76.16655
+181.24870 76.08321
+181.24870 75.99988
+181.41536 75.91654
+181.49869 75.83321
+181.66534 75.74987
+181.83200 75.66653
+182.41530 75.58320
+185.08180 75.49986
+186.74837 75.58320
+189.33154 75.66653
+189.66486 75.74987
+189.83151 75.83321
+190.24815 75.91654
+190.66479 75.99988
+191.16476 76.08321
+191.58141 76.16655
+191.91472 76.24989
+192.49802 76.33322
+192.99799 76.41656
+999.00000 99.00000
+191.41475 77.08324
+191.24809 77.16658
+191.16476 77.24992
+190.99811 77.41659
+190.91478 77.49992
+190.91478 77.58326
+190.74812 77.66660
+190.66479 77.74993
+190.58147 77.83327
+190.58147 77.91660
+190.58147 77.99994
+190.66479 78.08327
+190.74812 78.16661
+190.99811 78.24995
+191.33142 78.33328
+191.74806 78.41662
+192.33136 78.49995
+999.00000 99.00000
+191.41475 77.08324
+192.83133 77.08324
+193.08131 77.16658
+193.49796 77.16658
+193.83127 77.08324
+194.83121 76.99991
+195.08119 76.91657
+195.16452 76.83324
+195.24785 76.74990
+194.91454 76.66656
+194.58122 76.58323
+194.33124 76.49989
+192.99799 76.41656
+999.00000 99.00000
+192.33136 78.49995
+194.24791 78.58329
+194.91454 78.66663
+195.66449 78.74996
+199.16428 78.74996
+200.08089 78.66663
+200.24754 78.58329
+200.08089 78.49995
+199.83090 78.41662
+199.58092 78.33328
+199.41426 78.24995
+199.16428 78.16661
+198.91429 78.08327
+198.66431 77.99994
+198.41432 77.91660
+198.16434 77.83327
+197.91435 77.74993
+197.66437 77.66660
+197.66437 77.58326
+197.74770 77.49992
+198.16434 77.41659
+198.33099 77.33325
+198.24767 77.24992
+198.16434 77.16658
+198.08101 77.08324
+197.91435 76.99991
+197.74770 76.91657
+197.58104 76.83324
+196.16446 76.74990
+195.83115 76.49989
+195.83115 76.41656
+195.83115 76.33322
+195.83115 76.24989
+195.83115 76.16655
+195.83115 76.08321
+195.83115 75.99988
+195.83115 75.91654
+195.83115 75.83321
+195.74782 75.74987
+195.58116 75.66653
+195.41451 75.58320
+195.33118 75.49986
+195.33118 75.41653
+195.33118 75.33319
+195.41451 75.24986
+195.49783 75.16652
+195.74782 75.08318
+195.99780 75.00000
+196.16446 74.91666
+196.41444 74.83333
+197.08107 74.74999
+197.49771 74.66666
+197.74770 74.58332
+198.33099 74.49998
+198.74763 74.41665
+199.08095 74.33331
+199.16428 74.24998
+199.24760 74.16664
+199.16428 74.08331
+199.16428 73.99997
+198.99762 73.91663
+198.83096 73.83330
+198.83096 73.74996
+198.99762 73.66663
+199.16428 73.58329
+199.33093 73.49995
+199.49759 73.41662
+199.66425 73.33328
+200.24754 73.24995
+200.83084 73.16661
+201.83078 73.08327
+202.33075 72.99994
+202.41408 72.91660
+202.58073 72.83327
+202.66406 72.74993
+202.74739 72.66660
+202.91405 72.58326
+203.74733 72.41659
+204.41396 72.33325
+205.24724 72.24992
+205.83054 72.16658
+206.08052 72.08324
+206.33051 71.99991
+206.99713 71.91657
+207.41377 71.83324
+207.66376 71.74990
+207.99707 71.66656
+208.41371 71.58323
+209.08034 71.49989
+209.58031 71.41656
+210.66357 71.33322
+211.66351 71.24989
+212.16348 71.16655
+213.33008 71.08321
+215.91325 70.99988
+216.24657 70.91654
+217.49649 70.83321
+217.74648 70.74987
+218.41310 70.66653
+218.49643 70.66653
+218.91307 70.66653
+219.16306 70.66653
+999.00000 99.00000
+203.16403 76.41656
+203.24736 76.49989
+203.24736 76.58323
+203.16403 76.66656
+202.99738 76.74990
+202.83072 76.83324
+202.66406 76.91657
+202.33075 76.99991
+202.24742 77.08324
+202.49741 77.16658
+202.91405 77.24992
+999.00000 99.00000
+203.16403 77.33325
+203.83066 77.33325
+204.58061 77.24992
+204.83060 77.16658
+204.91393 77.08324
+204.91393 76.99991
+204.99725 76.91657
+204.99725 76.83324
+204.91393 76.74990
+204.83060 76.66656
+204.66394 76.58323
+204.41396 76.49989
+203.66400 76.33322
+203.49734 76.24989
+203.33069 76.16655
+203.16403 76.08321
+203.16403 75.99988
+203.08070 75.91654
+202.99738 75.83321
+202.91405 75.74987
+202.74739 75.66653
+202.58073 75.58320
+202.33075 75.49986
+202.16409 75.41653
+201.99744 75.33319
+201.83078 75.24986
+201.66412 75.16652
+999.00000 99.00000
+203.99731 76.41656
+203.49734 76.24989
+203.33069 76.16655
+203.16403 76.08321
+203.16403 75.99988
+203.08070 75.91654
+202.99738 75.83321
+202.91405 75.74987
+202.74739 75.66653
+202.58073 75.58320
+202.33075 75.49986
+202.16409 75.41653
+201.99744 75.33319
+201.83078 75.24986
+201.66412 75.16652
+201.58080 75.08318
+200.99750 75.08318
+200.83084 75.16652
+200.74751 75.24986
+200.66418 75.33319
+200.58086 75.41653
+200.58086 75.49986
+200.74751 75.58320
+200.83084 75.66653
+200.99750 75.74987
+201.24748 75.83321
+201.74745 75.91654
+202.16409 75.99988
+202.41408 76.08321
+202.58073 76.16655
+202.74739 76.24989
+202.91405 76.33322
+999.00000 99.00000
+160.00000 52.76000
+160.03000 52.76000
+160.07001 52.75000
+160.11000 52.74000
+160.16000 52.74000
+160.21001 52.74000
+160.24001 52.74000
+160.27000 52.74000
+160.28999 52.74000
+160.31000 52.75000
+160.33000 52.77000
+160.34000 52.79000
+160.35001 52.81000
+160.35001 52.83000
+160.36000 52.86000
+160.36000 52.89000
+160.35001 52.91000
+160.34000 52.94000
+160.33000 52.96000
+160.32001 52.99000
+160.32001 53.02000
+160.31000 53.06000
+160.30000 53.09000
+160.28999 53.12000
+160.28999 53.17000
+160.30000 53.23000
+160.28999 53.28000
+160.28000 53.32000
+160.27000 53.36000
+160.25999 53.38000
+160.25000 53.42000
+160.25000 53.44000
+160.25000 53.46000
+160.25999 53.51000
+160.28999 53.55000
+160.31000 53.57000
+160.35001 53.58000
+160.41000 53.60000
+160.46001 53.62000
+160.50000 53.64000
+160.53000 53.66000
+160.53999 53.71000
+160.53999 53.75000
+160.56000 53.81000
+160.58000 53.86000
+160.59000 53.88000
+160.62000 53.91000
+160.64999 53.93000
+160.69000 53.94000
+160.73000 53.95000
+160.78000 53.97000
+160.84000 54.00000
+160.89999 54.02000
+161.00000 54.09000
+161.07001 54.11000
+161.13000 54.14000
+161.21001 54.19000
+161.23000 54.20000
+161.25000 54.20000
+161.34000 54.27000
+161.39000 54.30000
+161.44000 54.32000
+161.50999 54.35000
+161.57001 54.36000
+161.63000 54.35000
+161.69000 54.35000
+161.77000 54.35000
+161.82001 54.35000
+161.88000 54.36000
+161.92000 54.38000
+161.99001 54.40000
+162.07001 54.42000
+162.12000 54.42000
+162.16000 54.44000
+162.20000 54.46000
+162.24001 54.48000
+162.28000 54.51000
+162.33000 54.55000
+162.35001 54.57000
+162.37000 54.61000
+162.38000 54.66000
+162.39999 54.71000
+162.39999 54.73000
+162.39000 54.76000
+162.38000 54.79000
+162.37000 54.83000
+162.37000 54.86000
+162.37000 54.89000
+162.35001 54.92000
+162.35001 54.95000
+162.33000 54.97000
+162.30000 55.00000
+162.28000 55.02000
+162.25999 55.06000
+162.22000 55.09000
+162.19000 55.12000
+162.16000 55.16000
+162.13000 55.21000
+162.11000 55.23000
+162.09000 55.26000
+162.07001 55.29000
+162.06000 55.32000
+162.06000 55.34000
+162.08000 55.38000
+162.08000 55.41000
+162.09000 55.43000
+162.09000 55.46000
+162.11000 55.49000
+162.13000 55.51000
+162.14999 55.52000
+162.19000 55.54000
+162.23000 55.55000
+162.23000 55.57000
+162.27000 55.61000
+162.30000 55.63000
+162.41000 55.69000
+162.47000 55.73000
+162.50999 55.75000
+162.56000 55.78000
+162.60001 55.80000
+162.64000 55.82000
+162.69000 55.83000
+162.72000 55.84000
+162.77000 55.86000
+162.84000 55.87000
+162.89999 55.86000
+162.95000 55.84000
+162.99001 55.84000
+163.03999 55.83000
+163.08000 55.84000
+163.11000 55.86000
+163.14000 55.89000
+163.16000 55.92000
+163.17999 55.95000
+163.22000 56.00000
+163.27000 56.04000
+163.34000 56.08000
+163.38000 56.10000
+163.42999 56.12000
+163.49001 56.15000
+163.56000 56.18000
+163.61000 56.20000
+163.66000 56.22000
+163.69000 56.23000
+163.70000 56.25000
+163.70000 56.27000
+163.69000 56.29000
+163.67000 56.32000
+163.64000 56.36000
+163.63000 56.39000
+163.62000 56.41000
+163.59000 56.47000
+163.57001 56.49000
+163.53999 56.52000
+163.50000 56.56000
+163.49001 56.58000
+163.45000 56.64000
+163.42999 56.68000
+163.42000 56.70000
+163.39999 56.74000
+163.38000 56.79000
+163.37000 56.81000
+163.35001 56.85000
+163.31000 56.90000
+163.28000 56.93000
+163.25999 56.96000
+163.28000 57.01000
+163.28999 57.06000
+163.31000 57.09000
+163.35001 57.13000
+163.38000 57.15000
+163.42000 57.19000
+163.44000 57.22000
+163.44000 57.24000
+163.44000 57.27000
+163.44000 57.33000
+163.42000 57.39000
+163.42000 57.42000
+163.42000 57.45000
+163.42999 57.48000
+163.42999 57.51000
+163.44000 57.55000
+163.48000 57.59000
+163.52000 57.62000
+163.55000 57.65000
+163.63000 57.69000
+163.66000 57.72000
+163.70000 57.73000
+163.71001 57.76000
+163.73000 57.79000
+163.72000 57.82000
+163.73000 57.88000
+163.74001 57.93000
+163.75999 57.99000
+163.77000 58.06000
+163.78000 58.08000
+163.78999 58.10000
+163.82001 58.13000
+163.85001 58.18000
+163.89000 58.22000
+163.92999 58.29000
+163.95000 58.32000
+163.96001 58.34000
+163.99001 58.38000
+164.00999 58.43000
+164.06000 58.48000
+164.09000 58.50000
+164.14000 58.53000
+164.17999 58.55000
+164.24001 58.59000
+164.28999 58.61000
+164.36000 58.64000
+164.42999 58.67000
+164.50999 58.71000
+164.57001 58.73000
+164.60001 58.74000
+164.66000 58.78000
+164.69000 58.81000
+164.71001 58.82000
+164.74001 58.84000
+164.80000 58.89000
+164.81000 58.91000
+164.85001 58.93000
+164.89000 58.97000
+164.94000 59.01000
+164.96001 59.03000
+165.00000 59.07000
+165.00999 59.09000
+165.03000 59.10000
+165.06000 59.12000
+165.08000 59.14000
+165.10001 59.16000
+165.12000 59.19000
+165.14000 59.21000
+165.17000 59.23000
+165.20000 59.24000
+165.22000 59.26000
+165.25000 59.27000
+165.28000 59.26000
+165.30000 59.28000
+165.34000 59.30000
+165.41000 59.29000
+165.42999 59.27000
+165.45000 59.25000
+165.47000 59.23000
+165.50999 59.21000
+165.53000 59.18000
+165.56000 59.15000
+165.60001 59.12000
+165.63000 59.10000
+165.64999 59.09000
+165.67000 59.07000
+165.69000 59.06000
+165.73000 59.05000
+165.77000 59.04000
+165.78999 59.04000
+165.81000 59.03000
+165.86000 59.01000
+165.89999 59.01000
+165.92999 59.01000
+165.97000 59.01000
+165.99001 59.02000
+166.00999 59.04000
+166.05000 59.05000
+166.10001 59.06000
+166.14000 59.08000
+166.17999 59.09000
+166.20000 59.10000
+166.22000 59.11000
+166.25999 59.12000
+166.28000 59.14000
+166.28999 59.17000
+166.30000 59.19000
+166.30000 59.21000
+166.30000 59.24000
+166.30000 59.26000
+166.30000 59.30000
+166.28999 59.33000
+166.28000 59.36000
+166.27000 59.40000
+166.27000 59.43000
+166.27000 59.45000
+166.28000 59.48000
+166.31000 59.51000
+166.34000 59.53000
+166.39000 59.55000
+166.42999 59.56000
+166.47000 59.57000
+166.50999 59.58000
+166.57001 59.61000
+166.62000 59.62000
+166.64999 59.64000
+166.67999 59.64000
+166.74001 59.64000
+166.78000 59.64000
+166.84000 59.63000
+166.89000 59.60000
+166.96001 59.59000
+166.99001 59.57000
+167.03999 59.58000
+167.05000 59.56000
+167.08000 59.57000
+167.10001 59.56000
+167.14999 59.57000
+167.20000 59.58000
+167.24001 59.59000
+167.25999 59.59000
+167.28999 59.62000
+167.32001 59.61000
+167.34000 59.64000
+167.37000 59.64000
+167.39999 59.65000
+167.44000 59.66000
+167.48000 59.67000
+167.50999 59.68000
+167.53000 59.68000
+167.56000 59.69000
+167.59000 59.71000
+167.67999 59.74000
+167.72000 59.76000
+167.77000 59.78000
+167.84000 59.81000
+167.94000 59.85000
+167.97000 59.85000
+168.00000 59.85000
+168.05000 59.86000
+168.09000 59.88000
+168.09000 59.85000
+168.13000 59.85000
+168.16000 59.87000
+168.17999 59.87000
+168.25000 59.87000
+168.28000 59.86000
+168.36000 59.90000
+168.39000 59.89000
+168.44000 59.91000
+168.49001 59.91000
+168.53999 59.92000
+168.63000 59.92000
+168.67999 59.91000
+168.72000 59.91000
+168.78000 59.90000
+168.86000 59.88000
+168.89999 59.87000
+168.92999 59.86000
+169.03000 59.84000
+169.13000 59.85000
+169.21001 59.85000
+169.25999 59.85000
+169.30000 59.85000
+169.39000 59.83000
+169.49001 59.82000
+169.53000 59.81000
+169.61000 59.79000
+169.69000 59.75000
+169.72000 59.74000
+169.75000 59.72000
+169.81000 59.68000
+169.84000 59.66000
+169.89000 59.62000
+169.92000 59.57000
+169.94000 59.51000
+169.92999 59.47000
+169.94000 59.43000
+169.97000 59.36000
+169.98000 59.30000
+169.96001 59.24000
+169.96001 59.19000
+169.96001 59.14000
+169.98000 59.10000
+169.99001 59.05000
+170.00999 59.01000
+170.00999 58.95000
+170.00999 58.89000
+170.00000 58.85000
+169.99001 58.78000
+169.97000 58.74000
+169.95000 58.66000
+169.92000 58.63000
+169.86000 58.57000
+169.82001 58.52000
+169.78000 58.47000
+169.74001 58.42000
+169.73000 58.38000
+169.74001 58.36000
+169.75999 58.31000
+169.78000 58.25000
+169.81000 58.22000
+169.85001 58.18000
+169.91000 58.14000
+169.97000 58.11000
+170.03000 58.08000
+170.12000 58.05000
+170.17999 58.02000
+170.23000 58.00000
+170.28999 57.97000
+170.32001 57.95000
+170.36000 57.92000
+170.42000 57.87000
+170.47000 57.83000
+170.50999 57.78000
+170.50999 57.75000
+170.52000 57.70000
+170.53000 57.68000
+170.53999 57.61000
+170.53000 57.56000
+170.50000 57.50000
+170.49001 57.44000
+170.48000 57.40000
+170.49001 57.37000
+170.52000 57.40000
+170.56000 57.45000
+170.60001 57.48000
+170.64999 57.54000
+170.73000 57.62000
+170.81000 57.71000
+170.86000 57.78000
+170.89000 57.84000
+170.92999 57.91000
+170.98000 57.99000
+171.02000 58.06000
+171.03000 58.12000
+171.06000 58.19000
+171.08000 58.28000
+171.09000 58.38000
+171.08000 58.50000
+171.06000 58.61000
+171.03000 58.68000
+170.98000 58.76000
+170.95000 58.85000
+170.92000 58.94000
+170.85001 59.04000
+170.78999 59.12000
+170.75000 59.23000
+170.71001 59.33000
+170.69000 59.38000
+170.62000 59.45000
+170.57001 59.52000
+170.53999 59.59000
+170.53999 59.63000
+170.53999 59.65000
+170.56000 59.68000
+170.59000 59.70000
+170.64999 59.74000
+170.70000 59.78000
+170.77000 59.81000
+170.83000 59.85000
+170.89999 59.91000
+170.95000 59.96000
+170.99001 60.01000
+171.02000 60.06000
+171.05000 60.13000
+171.09000 60.19000
+171.12000 60.24000
+171.14999 60.29000
+171.19000 60.32000
+171.22000 60.35000
+171.28999 60.37000
+171.37000 60.40000
+171.44000 60.41000
+171.52000 60.42000
+171.61000 60.42000
+171.70000 60.42000
+171.74001 60.41000
+171.78999 60.39000
+171.83000 60.37000
+171.89999 60.36000
+171.95000 60.37000
+172.05000 60.41000
+172.17000 60.42000
+172.28000 60.45000
+172.39999 60.50000
+172.53000 60.55000
+172.60001 60.57000
+172.69000 60.57000
+172.74001 60.58000
+172.78999 60.59000
+172.88000 60.61000
+172.97000 60.62000
+173.09000 60.64000
+173.17999 60.65000
+173.25000 60.66000
+173.33000 60.66000
+173.45000 60.66000
+173.49001 60.67000
+173.60001 60.68000
+173.69000 60.68000
+173.77000 60.68000
+173.91000 60.69000
+174.03999 60.68000
+174.13000 60.70000
+174.21001 60.75000
+174.32001 60.81000
+174.39000 60.87000
+174.45000 60.92000
+174.53000 60.98000
+174.64000 61.03000
+174.70000 61.04000
+174.83000 61.08000
+174.91000 61.09000
+175.00999 61.12000
+175.20000 61.17000
+175.27000 61.19000
+175.39999 61.23000
+175.53999 61.27000
+175.66000 61.32000
+175.84000 61.37000
+175.95000 61.40000
+175.97000 61.40000
+176.02000 61.42000
+176.11000 61.44000
+176.20000 61.47000
+176.30000 61.49000
+176.37000 61.50000
+176.58000 61.51000
+176.67000 61.53000
+176.74001 61.54000
+176.87000 61.59000
+176.94000 61.61000
+177.06000 61.64000
+177.14000 61.66000
+177.25999 61.67000
+177.39999 61.66000
+177.48000 61.66000
+177.59000 61.66000
+177.67999 61.64000
+177.77000 61.62000
+177.85001 61.59000
+177.99001 61.57000
+178.12000 61.57000
+178.25000 61.56000
+178.30000 61.54000
+178.36000 61.53000
+178.49001 61.50000
+178.52000 61.48000
+178.55000 61.47000
+178.57001 61.43000
+178.58000 61.40000
+178.60001 61.37000
+178.64000 61.33000
+178.67999 61.29000
+178.72000 61.26000
+178.80000 61.22000
+178.84000 61.21000
+178.92999 61.20000
+178.98000 61.19000
+179.14000 61.17000
+179.25999 61.14000
+179.38000 61.10000
+179.50000 61.04000
+179.63000 60.99000
+179.78999 60.93000
+179.92999 60.87000
+180.05000 60.80000
+180.14999 60.73000
+180.17000 60.69000
+180.22000 60.63000
+180.25999 60.56000
+180.27000 60.54000
+180.33000 60.48000
+180.36000 60.43000
+180.38000 60.40000
+180.42000 60.37000
+180.50000 60.31000
+180.56000 60.25000
+180.59000 60.22000
+180.59000 60.19000
+180.53000 60.16000
+180.50999 60.15000
+180.57001 60.14000
+180.69000 60.12000
+180.83000 60.11000
+180.91000 60.10000
+180.92999 60.10000
+181.02000 60.09000
+181.10001 60.07000
+181.17000 60.04000
+181.25999 60.00000
+181.30000 59.98000
+181.33000 59.98000
+181.38000 59.95000
+181.39000 59.93000
+181.39999 59.89000
+181.41000 59.83000
+181.41000 59.72000
+181.42999 59.63000
+181.46001 59.58000
+181.49001 59.52000
+181.50000 59.45000
+181.50000 59.41000
+181.50999 59.33000
+181.50999 59.28000
+181.50000 59.23000
+181.50000 59.20000
+181.50999 59.12000
+181.52000 59.08000
+181.53000 59.03000
+181.58000 58.98000
+181.62000 58.93000
+181.67999 58.88000
+181.73000 58.83000
+181.78000 58.79000
+181.82001 58.75000
+181.88000 58.69000
+181.94000 58.64000
+181.99001 58.61000
+182.03999 58.59000
+182.07001 58.60000
+182.10001 58.60000
+182.17000 58.61000
+182.28000 58.64000
+182.33000 58.64000
+182.42000 58.65000
+182.49001 58.65000
+182.55000 58.63000
+182.62000 58.61000
+182.72000 58.59000
+182.84000 58.57000
+182.94000 58.55000
+183.03000 58.52000
+183.11000 58.49000
+183.14999 58.48000
+183.24001 58.48000
+183.33000 58.49000
+183.50000 58.48000
+183.59000 58.48000
+183.67000 58.48000
+183.71001 58.48000
+183.74001 58.48000
+183.92000 58.46000
+184.03999 58.46000
+184.17999 58.44000
+184.27000 58.40000
+184.33000 58.36000
+184.42000 58.31000
+184.47000 58.26000
+184.56000 58.23000
+184.64999 58.24000
+184.74001 58.25000
+184.77000 58.26000
+184.78999 58.27000
+184.82001 58.28000
+184.85001 58.31000
+184.89999 58.34000
+184.92000 58.38000
+185.00000 58.43000
+185.03000 58.45000
+185.09000 58.47000
+185.17000 58.48000
+185.21001 58.47000
+185.27000 58.45000
+185.33000 58.41000
+185.37000 58.38000
+185.41000 58.35000
+185.46001 58.31000
+185.53999 58.26000
+185.60001 58.22000
+185.64000 58.16000
+185.70000 58.10000
+185.75999 58.04000
+186.00999 57.29000
+185.99001 57.28000
+186.00000 57.26000
+186.03000 57.21000
+186.07001 57.13000
+186.10001 57.07000
+186.13000 57.02000
+186.19000 56.94000
+186.22000 56.94000
+186.24001 56.94000
+186.28000 56.94000
+186.32001 56.93000
+186.36000 56.93000
+186.41000 56.91000
+186.45000 56.90000
+186.47000 56.88000
+186.53000 56.84000
+186.56000 56.79000
+186.58000 56.75000
+186.62000 56.67000
+186.66000 56.64000
+186.67999 56.64000
+186.74001 56.62000
+186.84000 56.58000
+186.97000 56.53000
+187.07001 56.49000
+187.19000 56.45000
+187.22000 56.45000
+187.25999 56.44000
+187.33000 56.44000
+187.42000 56.45000
+187.44000 56.46000
+187.52000 56.47000
+187.57001 56.47000
+187.75000 56.48000
+187.89999 56.47000
+188.00000 56.47000
+188.03999 56.47000
+188.14999 56.46000
+188.21001 56.44000
+188.36000 56.37000
+188.38000 56.37000
+188.41000 56.37000
+188.50999 56.37000
+188.60001 56.30000
+188.64000 56.24000
+188.75000 56.19000
+188.84000 56.17000
+188.89999 56.15000
+189.02000 56.11000
+189.13000 56.07000
+189.21001 56.05000
+189.23000 56.05000
+189.25999 56.05000
+189.35001 56.05000
+189.38000 56.05000
+189.47000 56.04000
+189.58000 56.03000
+189.67000 55.96000
+189.74001 55.91000
+189.81000 55.88000
+189.86000 55.87000
+189.88000 55.88000
+189.96001 55.88000
+190.09000 55.89000
+190.20000 55.90000
+190.23000 55.91000
+190.32001 55.92000
+190.39000 55.92000
+190.48000 55.94000
+190.56000 55.95000
+190.70000 55.98000
+190.78999 55.99000
+190.91000 56.01000
+190.97000 56.00000
+191.03999 55.95000
+191.03999 55.88000
+191.03999 55.83000
+191.05000 55.79000
+191.07001 55.71000
+191.12000 55.63000
+191.19000 55.57000
+191.27000 55.55000
+191.39000 55.50000
+191.50999 55.44000
+191.60001 55.37000
+191.66000 55.32000
+191.72000 55.25000
+191.81000 55.16000
+191.89999 55.11000
+192.00000 55.06000
+192.11000 54.97000
+192.19000 54.92000
+192.24001 54.87000
+192.30000 54.78000
+192.30000 54.71000
+192.27000 54.65000
+192.24001 54.58000
+192.22000 54.51000
+192.21001 54.44000
+192.22000 54.38000
+192.25999 54.36000
+192.32001 54.36000
+192.46001 54.35000
+192.66000 54.34000
+192.85001 54.32000
+192.99001 54.31000
+193.14000 54.31000
+193.28999 54.30000
+193.34000 54.27000
+193.36000 54.25000
+193.38000 54.23000
+193.35001 54.20000
+193.23000 54.15000
+193.06000 54.09000
+192.92000 54.05000
+192.78999 54.00000
+192.70000 53.94000
+192.60001 53.86000
+192.53000 53.78000
+192.44000 53.72000
+192.37000 53.68000
+192.27000 53.66000
+192.07001 53.65000
+191.91000 53.63000
+191.73000 53.63000
+191.59000 53.59000
+191.50999 53.56000
+191.42999 53.53000
+191.33000 53.48000
+191.28000 53.43000
+191.16000 53.36000
+191.10001 53.30000
+190.96001 53.26000
+190.87000 53.22000
+190.81000 53.18000
+190.72000 53.13000
+190.67999 53.10000
+190.52000 53.11000
+190.39000 53.15000
+190.36000 53.20000
+190.28000 53.24000
+190.19000 53.27000
+190.11000 53.26000
+189.99001 53.22000
+189.89999 53.18000
+189.72000 53.13000
+189.63000 53.10000
+189.52000 53.05000
+189.44000 53.00000
+189.34000 52.95000
+189.22000 52.90000
+189.14999 52.89000
+189.12000 52.89000
+189.00000 52.91000
+188.92999 52.92000
+188.71001 52.92000
+188.49001 52.90000
+188.36000 52.86000
+188.25999 52.83000
+188.22000 52.81000
+188.17999 52.80000
+188.14000 52.77000
+187.98000 52.74000
+187.89000 52.73000
+187.73000 52.72000
+187.66000 52.72000
+187.57001 52.71000
+187.53000 52.70000
+187.49001 52.67000
+187.41000 52.62000
+187.28999 52.58000
+187.21001 52.56000
+187.02000 52.54000
+186.99001 52.53000
+186.92000 52.55000
+186.78000 52.60000
+186.69000 52.63000
+186.62000 52.62000
+186.50000 52.58000
+186.36000 52.54000
+186.20000 52.51000
+186.03999 52.47000
+185.95000 52.46000
+185.84000 52.44000
+185.78000 52.43000
+185.73000 52.43000
+185.62000 52.41000
+185.50000 52.39000
+185.41000 52.37000
+185.28999 52.34000
+185.22000 52.32000
+185.17000 52.30000
+185.14000 52.29000
+185.12000 52.27000
+185.08000 52.25000
+185.03999 52.24000
+184.98000 52.24000
+184.89999 52.23000
+184.84000 52.21000
+184.78999 52.19000
+184.72000 52.18000
+184.62000 52.16000
+184.52000 52.15000
+184.50999 52.17000
+184.46001 52.17000
+184.35001 52.18000
+184.28999 52.18000
+184.20000 52.18000
+184.10001 52.17000
+184.02000 52.15000
+183.94000 52.14000
+183.82001 52.11000
+183.75000 52.09000
+183.69000 52.07000
+183.64000 52.06000
+183.58000 52.04000
+183.53999 52.03000
+183.47000 52.02000
+183.42000 52.02000
+183.34000 52.01000
+183.25000 52.00000
+183.23000 51.99000
+183.17999 51.98000
+183.06000 51.95000
+182.98000 51.95000
+182.86000 51.96000
+182.74001 51.94000
+182.64999 51.93000
+182.56000 51.92000
+182.47000 51.91000
+182.42999 51.90000
+182.33000 51.91000
+182.20000 51.91000
+182.11000 51.92000
+182.03999 51.91000
+181.99001 51.90000
+181.96001 51.91000
+181.91000 51.91000
+181.84000 51.90000
+181.78999 51.88000
+181.72000 51.84000
+181.69000 51.82000
+181.67999 51.80000
+181.64000 51.78000
+181.58000 51.76000
+181.53000 51.75000
+181.47000 51.74000
+181.41000 51.76000
+181.33000 51.78000
+181.30000 51.81000
+181.23000 51.82000
+181.16000 51.82000
+181.07001 51.80000
+180.98000 51.78000
+180.89999 51.75000
+180.85001 51.72000
+180.71001 51.66000
+180.66000 51.64000
+180.61000 51.62000
+180.59000 51.60000
+180.59000 51.58000
+180.58000 51.52000
+180.58000 51.48000
+180.61000 51.45000
+180.63000 51.42000
+180.64000 51.37000
+180.69000 51.30000
+180.72000 51.28000
+180.75000 51.26000
+180.78000 51.23000
+180.80000 51.17000
+180.82001 51.16000
+180.85001 51.14000
+180.89000 51.11000
+180.91000 51.09000
+180.97000 51.11000
+181.03999 51.14000
+181.10001 51.17000
+181.17999 51.21000
+181.25000 51.24000
+181.30000 51.25000
+181.35001 51.26000
+181.39999 51.25000
+181.50000 51.29000
+181.59000 51.31000
+181.66000 51.31000
+181.78000 51.32000
+181.89000 51.33000
+181.95000 51.36000
+182.03999 51.39000
+182.11000 51.40000
+182.22000 51.43000
+182.30000 51.45000
+182.38000 51.46000
+182.52000 51.48000
+182.63000 51.49000
+182.71001 51.48000
+182.75999 51.49000
+182.83000 51.49000
+182.89000 51.51000
+182.94000 51.53000
+182.97000 51.54000
+183.03000 51.51000
+183.05000 51.49000
+183.11000 51.44000
+183.21001 51.42000
+183.30000 51.42000
+183.41000 51.45000
+183.53000 51.48000
+183.64999 51.50000
+183.80000 51.51000
+183.99001 51.55000
+184.17000 51.58000
+184.27000 51.61000
+184.35001 51.63000
+184.45000 51.65000
+184.58000 51.68000
+184.70000 51.69000
+184.83000 51.71000
+185.00999 51.72000
+185.17000 51.73000
+185.32001 51.74000
+185.47000 51.76000
+185.59000 51.78000
+185.70000 51.79000
+185.86000 51.80000
+185.99001 51.80000
+186.02000 51.80000
+186.09000 51.80000
+186.25999 51.82000
+186.42999 51.83000
+186.56000 51.85000
+186.69000 51.85000
+186.83000 51.86000
+186.98000 51.87000
+187.08000 51.87000
+187.20000 51.89000
+187.34000 51.90000
+187.42999 51.90000
+187.64000 51.89000
+187.80000 51.89000
+187.94000 51.88000
+188.10001 51.89000
+188.23000 51.92000
+188.36000 51.96000
+188.49001 52.02000
+188.63000 52.08000
+188.78999 52.14000
+188.94000 52.18000
+189.07001 52.17000
+189.17000 52.15000
+189.27000 52.14000
+189.41000 52.15000
+189.48000 52.19000
+189.55000 52.23000
+189.71001 52.25000
+189.82001 52.29000
+189.94000 52.31000
+189.96001 52.32000
+189.92000 52.30000
+189.89999 52.30000
+189.94000 52.32000
+189.99001 52.32000
+189.94000 52.32000
+189.96001 52.32000
+190.05000 52.35000
+190.11000 52.39000
+190.17999 52.40000
+190.25000 52.40000
+190.35001 52.41000
+190.44000 52.43000
+190.53999 52.46000
+190.62000 52.50000
+190.64999 52.51000
+190.69000 52.52000
+190.74001 52.53000
+190.81000 52.55000
+190.88000 52.57000
+190.94000 52.58000
+191.03000 52.60000
+191.10001 52.63000
+191.17999 52.66000
+191.25000 52.69000
+191.30000 52.70000
+191.32001 52.70000
+191.39999 52.73000
+191.44000 52.75000
+191.49001 52.76000
+191.53000 52.77000
+191.62000 52.80000
+191.67999 52.81000
+191.74001 52.82000
+191.78000 52.83000
+191.82001 52.85000
+191.85001 52.87000
+191.87000 52.87000
+191.92999 52.87000
+191.98000 52.87000
+192.12000 52.89000
+192.19000 52.89000
+192.27000 52.89000
+192.38000 52.90000
+192.39999 52.90000
+192.50999 52.92000
+192.53999 52.93000
+192.61000 52.97000
+192.66000 52.98000
+192.71001 52.98000
+192.81000 53.01000
+192.87000 53.03000
+192.89000 53.04000
+192.95000 53.06000
+193.00999 53.07000
+193.03999 53.07000
+193.09000 53.08000
+193.14999 53.09000
+193.25000 53.11000
+193.38000 53.14000
+193.44000 53.15000
+193.52000 53.18000
+193.53999 53.18000
+193.56000 53.18000
+193.59000 53.18000
+193.78999 53.17000
+193.81000 53.17000
+193.96001 53.24000
+194.05000 53.29000
+194.14999 53.35000
+194.24001 53.41000
+194.32001 53.45000
+194.37000 53.48000
+194.46001 53.51000
+194.50000 53.53000
+194.52000 53.53000
+194.64000 53.52000
+194.78999 53.54000
+194.84000 53.55000
+194.98000 53.54000
+195.12000 53.55000
+195.19000 53.57000
+195.27000 53.58000
+195.32001 53.57000
+195.44000 53.58000
+195.53000 53.59000
+195.62000 53.61000
+195.67999 53.62000
+195.75000 53.64000
+195.82001 53.66000
+195.89999 53.67000
+195.97000 53.68000
+196.08000 53.70000
+196.20000 53.72000
+196.30000 53.74000
+196.45000 53.78000
+196.53000 53.79000
+196.62000 53.80000
+196.67999 53.81000
+196.75000 53.82000
+196.89000 53.86000
+196.98000 53.88000
+197.05000 53.89000
+197.20000 53.91000
+197.31000 53.94000
+197.38000 53.95000
+197.53999 53.97000
+197.67000 53.98000
+197.72000 53.99000
+197.86000 53.98000
+197.89000 53.98000
+197.96001 53.97000
+198.06000 53.95000
+198.28000 53.92000
+198.36000 53.93000
+198.45000 53.96000
+198.50999 53.99000
+198.58000 54.05000
+198.63000 54.09000
+198.70000 54.13000
+198.67000 54.14000
+198.77000 54.15000
+198.87000 54.15000
+198.99001 54.15000
+199.08000 54.15000
+199.23000 54.15000
+199.33000 54.14000
+199.42000 54.13000
+199.53999 54.14000
+199.63000 54.14000
+199.72000 54.15000
+199.84000 54.16000
+199.91000 54.18000
+199.98000 54.21000
+200.03999 54.22000
+200.12000 54.24000
+200.24001 54.26000
+200.27000 54.26000
+200.33000 54.27000
+200.42999 54.29000
+200.50999 54.30000
+200.64000 54.32000
+200.72000 54.33000
+200.77000 54.34000
+200.86000 54.36000
+201.05000 54.38000
+201.16000 54.39000
+201.25999 54.43000
+201.36000 54.47000
+201.45000 54.49000
+201.57001 54.52000
+201.67999 54.53000
+201.81000 54.55000
+202.00999 54.58000
+202.20000 54.63000
+202.32001 54.66000
+202.46001 54.70000
+202.58000 54.75000
+202.64000 54.77000
+202.75999 54.82000
+202.92000 54.86000
+203.03999 54.92000
+203.16000 54.94000
+203.20000 54.95000
+203.24730 55.00000
+203.66400 55.08314
+203.91389 55.16647
+204.24730 55.24980
+204.41389 55.33313
+204.66389 55.41647
+205.16389 55.49980
+205.58051 55.58313
+205.83051 55.66646
+205.83051 55.74979
+206.66380 55.91646
+206.66380 55.99979
+206.74710 56.08312
+206.83040 56.16645
+207.24710 56.24979
+207.66370 56.33312
+207.83040 56.41645
+208.08040 56.49978
+208.33031 56.58311
+208.41370 56.66645
+208.49699 56.74978
+208.74699 56.83311
+208.91360 56.91644
+209.08031 56.99977
+209.33031 57.08311
+209.49690 57.16644
+209.66360 57.24977
+209.91360 57.33310
+210.08020 57.41644
+210.24690 57.49977
+210.33020 57.58310
+210.49690 57.66643
+210.66350 57.74976
+210.91350 57.83310
+211.16350 57.91643
+211.33020 57.99976
+211.41350 58.08309
+211.49680 58.16642
+211.58009 58.24976
+211.66350 58.33309
+211.66350 58.41642
+211.74680 58.49975
+211.83009 58.58308
+211.91350 58.66642
+211.99680 58.74975
+212.08009 58.83308
+212.24680 58.91641
+212.49680 58.99974
+212.66341 59.08308
+213.16341 59.16641
+213.83000 59.24974
+214.16330 59.33307
+214.66330 59.41640
+215.57990 59.49974
+216.32990 59.49974
+216.57980 59.49974
+217.24651 59.49974
+217.49640 59.41640
+217.57980 59.33307
+217.74640 59.24974
+218.07970 59.16641
+218.32970 59.08308
+218.57970 58.99974
+218.82970 58.91641
+218.91299 58.83308
+219.07970 58.74975
+219.49631 58.66642
+219.66299 58.58308
+219.82961 58.49975
+999.00000 99.00000
+180.58000 52.47000
+180.61000 52.52000
+180.64000 52.56000
+180.67000 52.62000
+180.67999 52.66000
+180.72000 52.69000
+180.72000 52.73000
+180.72000 52.76000
+180.67999 52.77000
+180.63000 52.72000
+180.59000 52.67000
+180.52000 52.63000
+180.42999 52.60000
+180.35001 52.60000
+180.25999 52.60000
+180.24001 52.62000
+180.27000 52.69000
+180.32001 52.75000
+180.36000 52.79000
+180.39000 52.88000
+180.42000 52.97000
+180.42000 53.05000
+180.41000 53.14000
+180.39000 53.25000
+180.45000 53.31000
+180.50999 53.33000
+180.60001 53.42000
+180.62000 53.47000
+180.63000 53.52000
+180.61000 53.57000
+180.57001 53.60000
+180.44000 53.65000
+180.32001 53.70000
+180.24001 53.75000
+180.24001 53.77000
+180.23000 53.81000
+180.21001 53.85000
+180.14999 53.95000
+180.12000 54.03000
+180.06000 54.11000
+180.03000 54.14000
+179.98000 54.18000
+179.94000 54.22000
+179.86000 54.30000
+179.80000 54.35000
+179.73000 54.40000
+179.67000 54.44000
+179.59000 54.48000
+179.48000 54.51000
+179.39000 54.55000
+179.34000 54.60000
+179.25999 54.67000
+179.16000 54.70000
+179.11000 54.71000
+179.09000 54.71000
+179.00000 54.74000
+178.87000 54.79000
+178.84000 54.84000
+178.74001 54.87000
+178.62000 54.90000
+178.52000 54.93000
+178.42000 54.94000
+178.36000 54.94000
+178.34000 54.93000
+178.30000 54.88000
+178.28000 54.84000
+178.28000 54.80000
+178.31000 54.76000
+178.35001 54.72000
+178.39000 54.69000
+178.42999 54.67000
+178.49001 54.66000
+178.58000 54.65000
+178.67000 54.62000
+178.78000 54.58000
+178.87000 54.55000
+178.95000 54.51000
+178.98000 54.49000
+179.02000 54.46000
+179.03999 54.45000
+179.09000 54.41000
+179.14999 54.37000
+179.20000 54.31000
+179.24001 54.24000
+179.28999 54.17000
+179.34000 54.12000
+179.36000 54.09000
+179.42000 54.07000
+179.45000 54.06000
+179.49001 54.02000
+179.50999 54.00000
+179.57001 53.93000
+179.63000 53.86000
+179.69000 53.80000
+179.75000 53.74000
+179.80000 53.68000
+179.82001 53.63000
+179.85001 53.58000
+179.87000 53.53000
+179.94000 53.47000
+180.00000 53.41000
+180.02000 53.34000
+180.03999 53.28000
+180.03000 53.23000
+180.03999 53.14000
+180.03999 53.06000
+180.05000 52.99000
+180.06000 52.92000
+180.07001 52.87000
+180.08000 52.80000
+180.07001 52.77000
+180.03999 52.71000
+180.03000 52.69000
+179.99001 52.66000
+179.94000 52.62000
+179.87000 52.59000
+179.82001 52.57000
+179.75999 52.53000
+179.67999 52.50000
+179.63000 52.48000
+179.60001 52.47000
+179.50000 52.43000
+179.38000 52.38000
+179.35001 52.37000
+179.30000 52.35000
+179.22000 52.32000
+179.11000 52.26000
+179.02000 52.23000
+178.92999 52.21000
+178.84000 52.21000
+178.81000 52.21000
+178.72000 52.22000
+178.67999 52.22000
+178.50000 52.13000
+178.52000 52.15000
+178.52000 52.17000
+178.42999 52.18000
+178.36000 52.19000
+178.22000 52.14000
+178.17000 52.16000
+178.11000 52.15000
+177.98000 52.14000
+177.82001 52.14000
+177.70000 52.16000
+177.60001 52.18000
+177.50000 52.18000
+177.39000 52.16000
+177.24001 52.13000
+177.11000 52.12000
+177.09000 52.12000
+177.02000 52.14000
+176.92000 52.16000
+176.75000 52.21000
+176.59000 52.25000
+176.47000 52.27000
+176.36000 52.30000
+176.28000 52.34000
+176.13000 52.38000
+176.03000 52.41000
+175.87000 52.45000
+175.70000 52.48000
+175.58000 52.50000
+175.49001 52.50000
+175.47000 52.48000
+175.39000 52.46000
+175.28000 52.44000
+175.17000 52.46000
+175.03000 52.51000
+174.92000 52.54000
+174.86000 52.57000
+174.78999 52.60000
+174.75000 52.62000
+174.64999 52.65000
+174.53000 52.67000
+174.38000 52.69000
+174.24001 52.73000
+174.17999 52.75000
+174.11000 52.78000
+174.08000 52.79000
+173.94000 52.82000
+173.78999 52.86000
+173.64000 52.88000
+173.49001 52.90000
+173.39000 52.95000
+173.33000 52.97000
+173.28999 53.00000
+173.20000 53.02000
+173.08000 53.05000
+173.00000 53.07000
+172.94000 53.08000
+172.85001 53.10000
+172.77000 53.10000
+172.73000 53.11000
+172.63000 53.10000
+172.56000 53.09000
+172.42999 53.05000
+172.35001 53.05000
+172.32001 53.04000
+172.27000 53.03000
+172.20000 53.01000
+172.11000 53.01000
+172.05000 53.03000
+171.99001 53.04000
+171.96001 53.02000
+171.95000 52.99000
+171.95000 52.97000
+171.96001 52.95000
+171.98000 52.93000
+171.97000 52.90000
+171.97000 52.87000
+171.97000 52.85000
+171.99001 52.83000
+172.02000 52.81000
+172.06000 52.80000
+172.10001 52.80000
+172.17000 52.80000
+172.25000 52.79000
+172.31000 52.78000
+172.35001 52.77000
+172.39000 52.76000
+172.46001 52.75000
+172.50999 52.73000
+172.60001 52.69000
+172.61000 52.67000
+172.67000 52.62000
+172.71001 52.58000
+172.75999 52.53000
+172.78999 52.50000
+172.84000 52.45000
+172.89000 52.40000
+172.95000 52.36000
+173.03999 52.32000
+173.10001 52.29000
+173.12000 52.28000
+173.17999 52.27000
+173.23000 52.26000
+173.33000 52.23000
+173.42000 52.20000
+173.50999 52.18000
+173.59000 52.15000
+173.66000 52.13000
+173.75999 52.12000
+173.83000 52.11000
+173.87000 52.11000
+173.92000 52.13000
+173.97000 52.16000
+174.03999 52.18000
+174.06000 52.18000
+174.12000 52.19000
+174.22000 52.19000
+174.69000 51.99000
+174.69000 51.97000
+174.71001 51.95000
+174.74001 51.93000
+174.78999 51.94000
+174.83000 51.95000
+174.86000 51.95000
+174.91000 51.96000
+174.99001 51.97000
+175.03000 51.95000
+175.06000 51.94000
+175.12000 51.91000
+175.17999 51.88000
+175.25000 51.85000
+175.27000 51.83000
+175.31000 51.80000
+175.35001 51.76000
+175.41000 51.71000
+175.47000 51.66000
+175.52000 51.62000
+175.55000 51.60000
+175.60001 51.58000
+175.63000 51.58000
+175.70000 51.60000
+175.78000 51.61000
+175.83000 51.63000
+175.89999 51.66000
+175.94000 51.71000
+176.00000 51.76000
+176.03000 51.79000
+176.08000 51.82000
+176.11000 51.84000
+176.19000 51.88000
+176.20000 51.90000
+176.22000 51.92000
+176.23000 51.94000
+176.32001 51.95000
+176.37000 51.93000
+176.45000 51.90000
+176.53999 51.88000
+176.64000 51.87000
+176.67999 51.88000
+176.73000 51.89000
+176.78000 51.89000
+176.86000 51.92000
+176.92999 51.93000
+176.99001 51.93000
+177.08000 51.90000
+177.06000 51.89000
+177.02000 51.85000
+176.98000 51.80000
+176.96001 51.75000
+176.96001 51.72000
+176.97000 51.70000
+177.00000 51.68000
+177.08000 51.66000
+177.14999 51.66000
+177.24001 51.66000
+177.32001 51.66000
+177.35001 51.66000
+177.46001 51.65000
+177.52000 51.65000
+177.58000 51.64000
+177.61000 51.64000
+177.67999 51.62000
+177.72000 51.61000
+177.80000 51.60000
+177.89999 51.59000
+177.98000 51.55000
+178.00999 51.54000
+178.08000 51.52000
+178.12000 51.51000
+178.21001 51.49000
+178.25999 51.46000
+178.28000 51.45000
+178.28999 51.43000
+178.41000 51.37000
+178.53000 51.33000
+178.67999 51.31000
+178.71001 51.31000
+178.77000 51.31000
+178.81000 51.30000
+178.88000 51.26000
+178.95000 51.23000
+179.00000 51.20000
+179.07001 51.18000
+179.16000 51.17000
+179.23000 51.17000
+179.27000 51.18000
+179.33000 51.20000
+179.42999 51.23000
+179.53999 51.27000
+179.56000 51.30000
+179.63000 51.35000
+179.64999 51.36000
+179.73000 51.37000
+179.82001 51.39000
+179.89000 51.43000
+179.92999 51.47000
+179.99001 51.49000
+180.02000 51.49000
+180.12000 51.54000
+180.09000 51.57000
+180.07001 51.62000
+180.00999 51.69000
+180.00999 51.76000
+180.02000 51.83000
+180.03999 51.88000
+180.10001 51.93000
+180.17000 51.98000
+180.25000 52.03000
+180.31000 52.07000
+180.35001 52.12000
+180.37000 52.14000
+180.42000 52.20000
+180.42999 52.22000
+180.47000 52.25000
+180.49001 52.29000
+180.53000 52.34000
+180.58000 52.41000
+180.61000 52.45000
+180.61000 52.52000
+999.00000 99.00000
+176.16000 54.62000
+176.14000 54.64000
+176.11000 54.69000
+176.13000 54.73000
+176.16000 54.76000
+176.20000 54.81000
+176.22000 54.83000
+176.25000 54.86000
+176.27000 54.87000
+176.30000 54.89000
+176.35001 54.90000
+176.39999 54.91000
+176.44000 54.92000
+176.49001 54.94000
+176.53999 54.97000
+176.60001 54.98000
+176.66000 54.99000
+176.71001 54.99000
+176.74001 54.99000
+176.78000 54.99000
+176.85001 54.99000
+176.88000 54.98000
+176.92999 54.96000
+176.96001 54.93000
+176.96001 54.91000
+176.99001 54.88000
+176.96001 54.82000
+176.91000 54.79000
+176.87000 54.76000
+176.82001 54.73000
+176.78999 54.73000
+176.73000 54.72000
+176.67000 54.71000
+176.63000 54.70000
+176.57001 54.68000
+176.48000 54.64000
+176.39999 54.62000
+176.35001 54.62000
+176.28000 54.61000
+176.16000 54.62000
+176.13000 54.65000
+999.00000 99.00000
+170.66000 52.92000
+170.64000 52.94000
+170.64999 52.97000
+170.64999 53.01000
+170.64999 53.05000
+170.64999 53.10000
+170.63000 53.14000
+170.61000 53.18000
+170.58000 53.24000
+170.57001 53.28000
+170.62000 53.30000
+170.66000 53.31000
+170.72000 53.31000
+170.75999 53.30000
+170.82001 53.29000
+170.86000 53.28000
+170.89000 53.26000
+170.94000 53.22000
+170.99001 53.20000
+171.06000 53.16000
+171.08000 53.15000
+171.11000 53.13000
+171.14999 53.09000
+171.16000 53.05000
+171.14999 53.02000
+171.13000 52.99000
+171.10001 52.97000
+171.08000 52.95000
+171.03999 52.92000
+171.00000 52.90000
+170.95000 52.89000
+170.88000 52.87000
+170.82001 52.88000
+170.75999 52.89000
+170.73000 52.89000
+170.64999 52.90000
+170.66000 52.92000
+999.00000 99.00000
+169.02000 53.99000
+168.96001 54.01000
+168.94000 54.03000
+168.91000 54.07000
+168.92999 54.09000
+168.96001 54.10000
+169.00000 54.11000
+169.02000 54.12000
+169.05000 54.12000
+169.10001 54.11000
+169.16000 54.11000
+169.24001 54.05000
+169.28000 54.00000
+169.28999 53.95000
+169.27000 53.92000
+169.24001 53.91000
+169.19000 53.91000
+169.14999 53.93000
+169.08000 53.96000
+169.03000 54.00000
+169.02000 53.99000
+999.00000 99.00000
+168.47000 54.21000
+168.42000 54.24000
+168.37000 54.26000
+168.32001 54.28000
+168.27000 54.31000
+168.20000 54.35000
+168.14999 54.36000
+168.10001 54.37000
+168.03999 54.39000
+167.94000 54.40000
+167.87000 54.41000
+167.84000 54.42000
+167.78999 54.43000
+167.69000 54.43000
+167.58000 54.45000
+167.50999 54.48000
+167.44000 54.51000
+167.38000 54.52000
+167.34000 54.54000
+167.27000 54.58000
+167.20000 54.62000
+167.16000 54.64000
+167.09000 54.66000
+167.00000 54.63000
+166.97000 54.55000
+166.91000 54.50000
+166.85001 54.50000
+166.78999 54.52000
+166.71001 54.53000
+166.67000 54.58000
+166.60001 54.61000
+166.55000 54.63000
+166.46001 54.67000
+166.37000 54.73000
+166.34000 54.76000
+166.28000 54.82000
+166.17999 54.90000
+166.10001 54.96000
+166.07001 55.00000
+166.00000 55.04000
+165.96001 55.07000
+165.92999 55.10000
+165.91000 55.10000
+165.82001 55.12000
+165.80000 55.13000
+165.72000 55.15000
+165.64999 55.14000
+165.64000 55.16000
+165.59000 55.18000
+165.53000 55.21000
+165.47000 55.26000
+165.41000 55.30000
+165.38000 55.32000
+165.33000 55.35000
+165.25999 55.39000
+165.22000 55.42000
+165.13000 55.46000
+165.08000 55.49000
+165.06000 55.51000
+165.05000 55.53000
+165.05000 55.56000
+165.07001 55.58000
+165.10001 55.61000
+165.14999 55.63000
+165.19000 55.64000
+165.23000 55.64000
+165.25999 55.65000
+165.31000 55.66000
+165.36000 55.66000
+165.49001 55.64000
+166.44000 55.34000
+166.47000 55.31000
+166.53000 55.28000
+166.61000 55.26000
+166.70000 55.25000
+166.78999 55.24000
+166.84000 55.23000
+166.87000 55.23000
+166.95000 55.21000
+167.00000 55.18000
+167.09000 55.14000
+167.12000 55.12000
+167.21001 55.09000
+167.25999 55.06000
+167.33000 55.01000
+167.41000 54.97000
+168.25999 54.58000
+168.27000 54.56000
+168.33000 54.55000
+168.36000 54.53000
+168.42000 54.51000
+168.47000 54.47000
+168.56000 54.44000
+168.58000 54.39000
+168.60001 54.36000
+168.63000 54.33000
+168.64000 54.31000
+168.66000 54.26000
+168.66000 54.24000
+168.64999 54.22000
+168.62000 54.21000
+168.58000 54.20000
+168.55000 54.20000
+168.52000 54.19000
+168.49001 54.20000
+999.00000 99.00000
+159.16550 52.75014
+159.58214 52.75014
+158.91551 52.75014
+158.83218 52.66681
+158.83218 52.58348
+158.83218 52.50015
+158.74886 52.41682
+158.83218 52.33348
+158.91551 52.25015
+158.91551 52.16682
+158.83218 52.08349
+158.83218 52.00016
+158.83218 51.91682
+158.74886 51.83349
+158.74886 51.75016
+158.66553 51.66683
+158.74886 51.58350
+158.66553 51.50016
+158.58220 51.41683
+158.66553 51.33350
+158.66553 51.25017
+158.58220 51.16684
+158.58220 51.08350
+158.41554 51.00017
+158.41554 50.91684
+158.24889 50.83351
+158.08223 50.75018
+157.99890 50.66684
+157.91557 50.58351
+157.83224 50.50018
+157.66559 50.41685
+157.49893 50.33352
+157.16562 50.25018
+156.91563 50.16685
+156.83231 50.08352
+156.83231 50.00019
+156.74898 49.91685
+156.74898 49.83352
+156.74898 49.75019
+156.58232 49.66686
+156.41566 49.58353
+156.33234 49.50019
+156.24901 49.41686
+156.16568 49.33353
+155.99902 49.25020
+155.91570 49.16687
+155.74904 49.08353
+155.66571 49.00020
+155.58238 48.91687
+155.49905 48.83354
+155.41573 48.75021
+155.24907 48.66687
+155.16574 48.58354
+155.16574 48.50021
+155.16574 48.41688
+155.08241 48.33355
+155.08241 48.25021
+154.91576 48.16688
+154.83243 48.08355
+154.74910 48.00022
+154.66577 47.91689
+154.58244 47.83355
+154.41579 47.83355
+154.33246 47.91689
+154.24913 48.00022
+154.24913 48.08355
+154.24913 48.16688
+154.24913 48.25021
+154.33246 48.33355
+153.99915 48.41688
+153.83249 48.33355
+153.66583 48.25021
+153.58250 48.16688
+153.58250 48.08355
+153.49918 48.00022
+153.33252 47.91689
+153.24919 47.83355
+153.08253 47.75022
+153.08253 47.66689
+153.08253 47.58356
+152.99921 47.50023
+152.99921 47.41689
+152.91588 47.33356
+152.83255 47.25023
+152.74922 47.16690
+152.66589 47.08356
+152.58257 47.00023
+152.49924 46.91690
+152.33258 46.83357
+152.16592 46.75024
+151.74928 46.75024
+151.66595 46.83357
+151.66595 46.91690
+151.83261 47.00023
+151.91594 47.08356
+151.99927 47.16690
+152.08260 47.25023
+152.08260 47.33356
+152.33258 47.41689
+152.66589 47.50023
+152.74922 47.58356
+152.83255 47.66689
+152.83255 47.75022
+152.91588 47.83355
+152.91588 47.91689
+152.99921 48.00022
+153.08253 48.08355
+153.08253 48.16688
+153.16586 48.25021
+153.16586 48.33355
+153.49918 48.33355
+153.49918 48.41688
+153.58250 48.50021
+153.66583 48.58354
+153.74916 48.66687
+153.83249 48.75021
+153.83249 48.83354
+153.83249 48.91687
+153.74916 49.00020
+153.83249 49.08353
+153.91582 49.16687
+154.08247 49.16687
+154.16580 49.16687
+154.33246 49.25020
+154.24913 49.33353
+154.16580 49.41686
+154.24913 49.50019
+154.16580 49.58353
+153.99915 49.66686
+153.99915 49.75019
+154.16580 49.75019
+154.33246 49.83352
+154.49911 49.83352
+154.74910 49.83352
+154.74910 49.91685
+154.74910 50.00019
+154.74910 50.08352
+154.74910 50.16685
+154.83243 50.25018
+154.83243 50.33352
+154.99908 50.41685
+154.99908 50.50018
+155.08241 50.58351
+155.08241 50.66684
+155.08241 50.75018
+155.08241 50.83351
+154.83243 50.83351
+154.66577 50.75018
+154.58244 50.66684
+154.41579 50.58351
+154.16580 50.50018
+153.99915 50.41685
+153.49918 50.41685
+152.83255 50.66684
+152.58257 50.75018
+152.41591 50.83351
+152.33258 50.91684
+151.91594 51.16684
+151.83261 51.25017
+151.66595 51.33350
+151.58263 51.41683
+150.99933 51.66683
+149.66608 51.91682
+149.74940 52.00016
+149.58275 52.00016
+149.66608 52.08349
+150.33270 52.16682
+150.66602 52.25015
+150.83267 52.33348
+150.91600 52.41682
+150.99933 52.50015
+150.99933 52.58348
+150.99933 52.66681
+150.91600 52.83348
+150.83267 52.91681
+150.74934 53.00014
+150.49936 53.16681
+150.41603 53.33347
+150.33270 53.41680
+150.24937 53.50013
+149.99939 53.66680
+149.74940 53.83346
+149.41609 54.00013
+148.83279 54.08346
+148.33282 54.25012
+148.08284 54.33345
+147.91618 54.41679
+147.83286 54.50012
+147.66620 54.58345
+146.99957 54.66678
+146.66626 54.75011
+145.99963 54.91678
+144.99969 55.00011
+144.74971 55.08344
+144.58305 55.16677
+144.33307 55.25011
+144.16641 55.25011
+144.16641 55.16677
+144.16641 55.08344
+144.16641 55.00011
+144.24974 54.91678
+144.24974 54.83345
+144.33307 54.75011
+144.33307 54.66678
+144.33307 54.58345
+144.33307 54.50012
+144.33307 54.41679
+144.33307 54.33345
+144.33307 54.25012
+144.33307 54.16679
+144.33307 54.08346
+144.33307 54.00013
+144.24974 53.83346
+144.24974 53.91679
+144.24974 53.75013
+144.33307 53.66680
+144.33307 53.58347
+144.33307 53.50013
+144.41640 53.41680
+144.41640 53.33347
+144.41640 53.25014
+144.49973 53.16681
+144.49973 53.08347
+144.58305 53.00014
+144.66638 52.91681
+144.74971 52.83348
+144.83304 52.75014
+144.91637 52.58348
+144.91637 52.50015
+144.99969 52.41682
+144.99969 52.33348
+145.08302 52.25015
+145.08302 52.16682
+145.08302 52.08349
+145.08302 52.08349
+144.99969 52.00016
+144.99969 51.91682
+144.99969 51.83349
+144.91637 51.75016
+144.91637 51.66683
+144.99969 51.58350
+145.41634 51.41683
+145.66632 51.33350
+145.74965 51.25017
+145.83298 51.16684
+145.91631 51.08350
+146.41628 51.00017
+146.49960 50.91684
+146.49960 50.83351
+146.49960 50.75018
+146.58293 50.66684
+146.58293 50.58351
+146.66626 50.50018
+146.66626 50.41685
+146.66626 50.33352
+146.66626 50.25018
+146.74959 50.16685
+146.74959 50.08352
+146.74959 50.00019
+146.74959 49.91685
+146.83292 49.83352
+146.91624 49.75019
+146.91624 49.66686
+146.91624 49.58353
+146.99957 49.50019
+146.99957 49.41686
+146.99957 49.33353
+146.99957 49.25020
+146.91624 49.16687
+146.83292 49.08353
+146.66626 49.00020
+146.24962 48.83354
+146.08296 48.75021
+145.99963 48.66687
+145.91631 48.58354
+145.83298 48.50021
+145.74965 48.41688
+145.74965 48.33355
+145.66632 48.25021
+145.58299 48.16688
+145.58299 48.08355
+145.58299 48.00022
+145.49966 47.91689
+145.49966 47.83355
+145.49966 47.75022
+145.49966 47.66689
+145.58299 47.58356
+145.58299 47.50023
+145.24968 47.50023
+145.16635 47.50023
+144.83304 47.50023
+144.58305 47.58356
+144.24974 47.58356
+144.08308 47.50023
+144.08308 47.41689
+143.99976 47.33356
+143.99976 47.25023
+143.99976 47.16690
+143.99976 47.08356
+143.99976 47.00023
+144.08308 46.91690
+143.99976 46.83357
+143.99976 46.75024
+143.99976 46.66690
+143.91643 46.58357
+143.91643 46.50024
+143.99976 46.41691
+143.99976 46.33358
+143.99976 46.25024
+143.99976 46.16691
+143.99976 46.08358
+144.08308 46.00025
+144.08308 45.91692
+144.08308 45.83358
+144.08308 45.75025
+144.16641 45.66692
+144.24974 45.58359
+144.33307 45.50026
+144.33307 45.41692
+144.41640 45.33359
+144.41640 45.25026
+144.49973 45.16693
+144.49973 45.08360
+144.58305 45.00026
+144.58305 44.91693
+144.58305 44.83360
+144.58305 44.75027
+144.58305 44.66693
+144.49973 44.58360
+144.49973 44.50027
+144.49973 44.41694
+144.49973 44.33361
+145.08302 44.33361
+145.16635 44.41694
+145.49966 44.16694
+145.49966 44.25027
+145.49966 44.33361
+145.58299 44.41694
+145.66632 44.25027
+145.74965 44.33361
+145.83298 44.41694
+145.91631 44.50027
+145.99963 44.58360
+146.16629 44.66693
+146.58293 44.75027
+146.66626 44.83360
+147.08290 44.91693
+147.16623 45.00026
+147.33289 45.08360
+147.33289 45.16693
+147.58287 45.25026
+147.66620 45.33359
+147.74953 45.41692
+147.83286 45.50026
+148.08284 45.50026
+148.33282 45.50026
+148.33282 45.58359
+148.41615 45.66692
+148.49948 45.75025
+148.83279 45.75025
+148.99945 45.66692
+149.16611 45.75025
+149.41609 45.83358
+149.58275 45.91692
+149.66608 46.00025
+149.83273 46.08358
+149.91606 46.16691
+150.08272 46.25024
+150.16605 46.33358
+150.58269 46.41691
+150.66602 46.50024
+150.74934 46.58357
+150.66602 46.75024
+150.66602 46.83357
+150.83267 46.83357
+150.91600 46.75024
+151.08266 46.58357
+151.08266 46.50024
+151.08266 46.41691
+151.08266 46.33358
+150.99933 46.25024
+150.83267 46.16691
+150.66602 46.08358
+150.58269 46.00025
+150.58269 45.91692
+150.58269 45.83358
+150.91600 45.83358
+151.08266 45.83358
+151.33264 45.75025
+151.24931 45.66692
+151.08266 45.58359
+150.91600 45.50026
+150.74934 45.41692
+150.58269 45.33359
+150.41603 45.25026
+150.16605 45.16693
+149.99939 45.08360
+149.74940 45.00026
+149.49942 44.91693
+149.24944 44.83360
+149.08278 44.75027
+148.99945 44.66693
+148.91612 44.58360
+148.83279 44.50027
+148.74947 44.41694
+148.58281 44.33361
+148.41615 44.25027
+148.33282 44.16694
+148.24950 44.08361
+148.08284 44.00028
+147.99951 43.91695
+147.83286 43.83361
+147.74953 43.75028
+147.49954 43.66695
+147.33289 43.58362
+147.16623 43.50029
+146.99957 43.41695
+146.74959 43.33362
+146.58293 43.25029
+146.41628 43.16696
+146.16629 43.08363
+145.91631 43.00029
+145.74965 42.91696
+145.58299 42.83363
+145.41634 42.75030
+145.24968 42.66697
+144.99969 42.58363
+144.33307 42.50030
+144.24974 42.41697
+144.16641 42.33364
+144.24974 42.25031
+144.16641 42.16697
+144.16641 42.08364
+144.16641 42.00031
+144.08308 41.83364
+143.99976 41.75031
+143.91643 41.66698
+143.74977 41.58365
+143.49979 41.50032
+142.66650 41.50032
+142.58318 41.58365
+142.49985 41.66698
+142.49985 41.75031
+142.41652 41.83364
+142.24986 41.91698
+141.91655 41.91698
+141.91655 41.83364
+141.91655 41.75031
+141.91655 41.66698
+141.91655 41.58365
+141.91655 41.50032
+141.91655 41.41698
+141.91655 41.33365
+141.99988 41.25032
+141.99988 41.16699
+142.08321 41.08366
+142.08321 41.00032
+142.16653 40.91699
+142.41652 40.83366
+142.41652 40.75033
+142.41652 40.66700
+142.41652 40.58366
+142.49985 40.50033
+142.49985 40.41700
+142.49985 40.33367
+142.58318 40.25034
+142.58318 40.16700
diff --git a/jnls/contrib/bering_iso1000.jnl b/jnls/contrib/bering_iso1000.jnl
new file mode 100644
index 0000000..857772f
--- /dev/null
+++ b/jnls/contrib/bering_iso1000.jnl
@@ -0,0 +1,21 @@
+! Description: overlay of bering sea & asian 1000m isobath
+! contributed by Mick Spillane, NOAA/PMEL 1992
+
+cancel mode verify	! ... now overlaying 1000m isobath ...
+
+set data/save
+define axis/x=1:2570:1 axtb
+define grid/x=axtb gtb
+
+file/col=2/form=(2f9.5)/var="xtb,ytb"/grid=gtb bering_iso1000.dat
+
+set variable/bad=999.0 xtb
+set variable/bad=99.0  ytb
+plot/set/vs/over/nolab/x=1:2570 xtb,ytb
+ppl pen 1 2
+ppl plot/over
+
+cancel data bering_iso1000.dat
+set data/restore
+set mode/last verify
+
diff --git a/jnls/contrib/bias_zonalanommap.nc b/jnls/contrib/bias_zonalanommap.nc
new file mode 100644
index 0000000..ccaaa90
Binary files /dev/null and b/jnls/contrib/bias_zonalanommap.nc differ
diff --git a/jnls/contrib/color_vector.jnl b/jnls/contrib/color_vector.jnl
new file mode 100644
index 0000000..0a54302
--- /dev/null
+++ b/jnls/contrib/color_vector.jnl
@@ -0,0 +1,301 @@
+\ cancel mode verify
+! 
+! Description : color_vector : GO file to make color/shaded vectors (in both base
+!                  plot and overlay modes) according to specified color palette and 
+!                  shading levels.
+!
+! Arguments/INPUT : following predefined (in the script which calls color_vector)
+!               symbols with proper entries
+!
+!           vec_cmd       : vector command without /LENGTH, /XSKIP, /YSKIP, /COLOR
+!                              qualifiers (see other options below). However, a 
+!                              /OVER qualifier will work just fine.
+!           vec_u         : u var name, no [],(),*,/,+,-, ^ fields
+!           vec_v         : v var name, no [],(),*,/,+,-, ^ fields
+!           vec_len       : value for /LENGTH qualifier
+!           vec_xskip     : value for /XSKIP qualifier
+!           vec_yskip     : value for /YSKIP qualifier
+!           vec_arrowkey  : YES or NO, for scale/key vector
+!           vec_veckey    : arguments to "PPL VECKEY" command
+!           vec_lo        : low   value for color levels
+!           vec_hi        : high  value for color levels
+!           vec_delta     : delta value for color levels
+!           vec_pal       : palette file name (should be present in pwd or $FER_DIR/ppl)
+!           vec_colorkey  : YES or NO, for color bar/key
+!           vec_shakey    : arguments to "PPL SHAKEY" command    
+!           vec_otherppl  : other ppl commands like "ppl xfor", "ppl yfor" etc.
+!                              (if none, just use any word other than "ppl")
+!
+! Output : A nice colorfull vector plot with specified coloring levels and palette.
+!
+! Usage  : go  color_vector                    ! NO ARGUMENTS with GO command
+!
+! Example : Please see color_vector_demo.jnl
+!
+! Notes : 1. color_vector will work only with two argument vector command form
+!               (ie. no support for curvilinear version) for regurlarly spaced 
+!               (dx=constant, dy=constant) gridded data.
+!         2. All input symbols (vec_*) is assumed to be defined in the main script.
+!         3. Specified palette file (vec_pal) should exist either in PWD or 
+!               $FER_DIR/ppl
+!         4. PPL and Viewport settings should be done before the plot.
+!
+! Known Problems :
+!         1. PPL Colors 1 and 6 will be set back to their defaults.
+!         2. This script will work only with PERCENTAGE based palette (.spk) files,
+!               which have entries for 0% and 100%. Header lines at beginning and 
+!               blank lines towards the end are OK.
+!
+! To do : 1. Auto lo:hi:delta estimatation.
+!         2. Automize the placement of color key and vector key.
+!         3. Add examples with multi_view.
+!         4. Color options for veckey.
+!         5. Add curvilinear compatibility.
+!         6. Coloring based on another field.
+!         7. Options for By_Value and By_Level patelles 
+!                 (User Manual Ch6 Sec5.2.  Shade and fill colors).
+!
+! Got Questions/Comments? Please let me know.
+!
+! Related Posts :
+!      palette viewer
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2007/msg00372.html
+!      palette maker 
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2007/msg00410.html
+!      rgb colors 
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2006/msg00725.html
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2006/msg00736.html
+!
+! Written By : Jaison Kurian (jaison at caos.iisc.ernet.in, jaison at atmos.ucla.edu)
+! Written On : Jan/04/2008 (based on a draft completed on May/28/2007) 
+!
+!-------------------------------------------------------------------------------------
+
+!-----safe guards---------------
+
+   define region/default save
+   can region/x/I
+
+!-----check for palette file
+
+   let vec_pal_chk = STRINDEX("($vec_pal)","/")
+   IF `vec_pal_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Palette file name should be like rainbow or"
+             say "         rainbow.spk. Requested ($vec_pal) contains '/' & hence not accepted."
+             say "         Using default palette rainbow.spk." ; say  
+	     define symbol vec_pal = rainbow 
+   ENDIF
+   let vec_pal_ext = STRINDEX("($vec_pal)",".spk")
+   IF `vec_pal_ext GT 0` THEN
+       let vec_pal_1 = "($vec_pal)" 
+   ELSE 
+       let vec_pal_1 = "($vec_pal)" + ".spk"
+   ENDIF
+
+   define symbol found_pal = NO
+   let fer_dir             = {spawn:"echo $FER_DIR"}
+   let vec_fex_1           = {spawn:"ls `fer_dir`/ppl/`vec_pal_1`"}
+   define symbol fer_pal   = `fer_dir`/ppl
+   IF `STRLEN(vec_fex_1[i=1]) GT 0` THEN
+       define symbol found_pal = YES
+       define symbol vec_pal_2 = "($fer_pal)/`vec_pal_1`"
+   ELSE 
+       let vec_fex_2 = {spawn:"ls `vec_pal_1`"}
+       IF `STRLEN(vec_fex_2[i=1]) GT 0` THEN
+           define symbol found_pal = YES
+           define symbol vec_pal_2 = "./`vec_pal_1`"
+       ENDIF
+   ENDIF
+
+   IF ($found_pal) THEN
+      say ; say " NOTE (color_vector) : Using palette file `($vec_pal_2)`" ; say
+   ELSE 
+      say ; say " ERROR (color_vector) : Requested palette file ($vec_pal) DOES NOT FOUND"
+            say "         in pwd and ($fer_pal)"
+	    say "         ......Quitting " ; say ;  EXIT/PROMPT
+   ENDIF
+
+!--read palette file and interpolate rgb values
+
+   let vec_pal_lines = {spawn:"cat `($vec_pal_2)` | wc -l"}
+   define axis/x=1:`vec_pal_lines`:1 xpal
+   define grid/x=xpal gpal
+
+   FILE/grid=gpal/format=delimited/var=vec_spk_head ($vec_pal_2)
+   let vec_spk_skip = -1
+   REPEAT/RANGE=1:`vec_pal_lines`:1/name=vec_hd (;\
+      define symbol vec_hdr = `vec_hd` ;\
+      IF `SUBSTRING(vec_spk_head[i=($vec_hdr)],1,1) EQ "0"` THEN ;\
+         let vec_spk_skip = `($vec_hdr) - 1` ;\
+         EXIT/LOOP ;\
+      ENDIF   ;\
+   )
+   IF `vec_spk_skip LT 0` THEN 
+      say ; say " ERROR (color_vector) : Requested palette file ($vec_pal) DOES NOT have entry for 0%."
+            say "         Palette files should be PERCENTAGE based and should have"
+	    say "         entries for 0% and 100%......Quitting " ; say ;  EXIT/PROMPT
+
+   ENDIF
+   cancel data `vec_pal_1`
+
+   FILE/grid=gpal/skip=`vec_spk_skip`/var="vec_perc,vec_r,vec_g,vec_b" ($vec_pal_2)
+   define axis/x/from_data xperc=vec_perc[d=`vec_pal_1`]
+
+   let vec_perc_0   = vec_perc[d=`vec_pal_1`,i=1]
+   let vec_perc_100 = vec_perc[d=`vec_pal_1`,i=@MAX]
+
+   let vec_spk_chk = IF `vec_perc_0 NE 0` OR `vec_perc_100 NE 100` THEN 1 ELSE 0
+   IF `vec_spk_chk EQ 1` THEN
+      say ; say " ERROR (color_vector) : COULD NOT locate entries for 0% and/or 100% "
+            say "         in requested palette file ($vec_pal)."
+            say "         Palette files should be PERCENTAGE based and should have"
+	    say "         entries for 0% and 100%......Quitting " ; say ;  EXIT/PROMPT
+
+   ENDIF
+
+   let vec_r1 = vec_r[gx=xperc at ASN]
+   let vec_g1 = vec_g[gx=xperc at ASN]
+   let vec_b1 = vec_b[gx=xperc at ASN]
+
+   define axis/x=`($vec_lo)`:`($vec_hi)`:`($vec_delta)` xclevs
+   let vec_col_levs = `x[gx=xclevs],r=iend` - 1
+   define axis/x=0:100/npoints=`vec_col_levs` xpal_levs
+   let vec_red   = vec_r1[gx=xpal_levs]
+   let vec_green = vec_g1[gx=xpal_levs]
+   let vec_blue  = vec_b1[gx=xpal_levs]
+
+!--determine whether the first plot is an /over plot or not
+
+   ppl set vec_cmd_1 $EDIT (vec_cmd, COLLAPSE) 
+   let vec_cmd_2 = DNCASE("($vec_cmd_1)")
+   let vec_cmd_o = STRINDEX(vec_cmd_2,"/ov")
+   IF `vec_cmd_o GT 0` THEN
+        define symbol vec_ppl = ppl vector/over
+   ELSE 
+        define symbol vec_ppl = ppl vector
+   ENDIF
+
+!--check for undesired qualifiers in vec_cmd
+
+   let vec_cmd_chk = STRINDEX(vec_cmd_2,"/xs")
+   IF `vec_cmd_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Qualifier /XSKIP is not effective with vec_cmd."
+             say "                             Instead, use vec_xskip." ; say 
+   ENDIF 
+
+   let vec_cmd_chk = STRINDEX(vec_cmd_2,"/ys")
+   IF `vec_cmd_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Qualifier /YSKIP is not effective with vec_cmd."
+             say "                             Instead, use vec_yskip." ; say 
+   ENDIF 
+
+   let vec_cmd_chk = STRINDEX(vec_cmd_2,"/le")
+   IF `vec_cmd_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Qualifier /LENGTH is not effective with vec_cmd."
+             say "                             Instead, use vec_len." ; say 
+   ENDIF 
+
+   let vec_cmd_chk = STRINDEX(vec_cmd_2,"/c")
+   IF `vec_cmd_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Qualifier /COLOR is not effective with vec_cmd."
+             say "         Instead, use symbol vec_pal in main script." ; say 
+   ENDIF 
+
+   let vec_cmd_chk = STRINDEX(vec_cmd_2,"/p")
+   IF `vec_cmd_chk GT 0` THEN
+       say ; say " WARNING (color_vector) : Qualifier /PEN is not effective with vec_cmd."
+             say "          Instead, use symbol vec_pal in main script." ; say 
+   ENDIF 
+
+!---apply xskip and yskip and sample the data accordingly
+!         assume : data dx and dy are constant
+
+   set region save
+
+   IF `($vec_xskip) LT 1` THEN
+       say ; say " ERROR : color_vector : vec_xskip should be .GE. 1. Quitting.... "
+             say ; EXIT/PROMPT
+   ENDIF
+
+   IF `($vec_yskip) LT 1` THEN
+       say ; say " ERROR : color_vector : vec_yskip should be .GE. 1. Quitting.... "
+             say ; EXIT/PROMPT
+   ENDIF
+
+
+   IF `($vec_xskip) EQ 1` THEN
+       let vec_u_xk  = ($vec_u)
+       let vec_v_xk  = ($vec_v)
+   ELSE 
+       let vec_is    = `($vec_u),r=istart` ; let vec_ie    = `($vec_u),r=iend`
+       define axis/x=`vec_is`:`vec_ie`:`($vec_xskip)` xvec_abs
+       let vec_xs    = x[gx=($vec_u),i=`vec_is`]
+       let vec_xe    = x[gx=($vec_u),i=`vec_ie`]
+       let vec_dx    = x[gx=($vec_u),i=2]-x[gx=($vec_u),i=1]
+       define axis/x=`vec_xs`:`vec_xe`:`vec_dx*($vec_xskip)`/units=longitudes xvec_lon
+       let vec_u_xk_abs = SAMPLEI(($vec_u),x[gx=xvec_abs])
+       let vec_u_xk     = vec_u_xk_abs[gx=xvec_lon at ASN]
+       let vec_v_xk_abs = SAMPLEI(($vec_v),x[gx=xvec_abs])
+       let vec_v_xk     = vec_v_xk_abs[gx=xvec_lon at ASN]
+   ENDIF
+   
+   IF `($vec_yskip) EQ 1` THEN
+       let vec_u_xyk  = vec_u_xk
+       let vec_v_xyk  = vec_v_xk
+   ELSE
+       let vec_js    = `($vec_u),r=jstart` ; let vec_je    = `($vec_u),r=jend`
+       define axis/y=`vec_js`:`vec_je`:`($vec_yskip)` yvec_abs 
+       let vec_ys    = y[gy=($vec_u),j=`vec_js`]
+       let vec_ye    = y[gy=($vec_u),j=`vec_je`]
+       let vec_dy    = y[gy=($vec_u),j=2]-y[gy=($vec_u),j=1]
+       define axis/y=`vec_ys`:`vec_ye`:`vec_dy*($vec_yskip)`/units=latitudes  yvec_lat
+       let vec_u_yk_abs = SAMPLEJ(vec_u_xk,y[gy=yvec_abs])
+       let vec_u_xyk    = vec_u_yk_abs[gy=yvec_lat at ASN]
+       let vec_v_yk_abs = SAMPLEJ(vec_v_xk,y[gy=yvec_abs])
+       let vec_v_xyk    = vec_v_yk_abs[gy=yvec_lat at ASN]
+   ENDIF 
+
+! plot vectors
+
+   let vec_sp_xyk = (vec_u_xyk^2 + vec_v_xyk^2)^0.5  
+
+   define symbol vec_cmd_p = vector/ov/nolab/nokey/len=(\$vec_len)/xskip=1/yskip=1 
+
+   ppl color 1, 0,0,0  
+   REPEAT/RANGE=1:`vec_col_levs`:1/NAME=cv (;\
+       def sym vec_clv  = `cv`                ;\
+       def sym vec_clvp1= `cv+1`              ;\
+       let     vec_lv1  = `x[gx=xclevs,i=($vec_clv)] ` ;\
+       let     vec_lv2  = `x[gx=xclevs,i=($vec_clvp1)] ` ;\
+       ppl color 6, `vec_red[i=($vec_clv)]`,`vec_green[i=($vec_clv)]`,`vec_blue[i=($vec_clv)]`;\
+       IF `($vec_clv) EQ 1` THEN  ;\
+          let vec_mask   =  IF vec_sp_xyk GE vec_lv1 AND vec_sp_xyk LE vec_lv2 THEN 1;\
+          let vec_uu = vec_u_xyk * vec_mask ; let vec_vv = vec_v_xyk * vec_mask ;\
+          ($vec_cmd)/color=1/set/len=($vec_len) vec_uu, vec_vv ;\ 
+          IF ($vec_arrowkey) THEN ; ppl veckey ($vec_veckey) ; ENDIF ;\
+	  let vec_chk_ppl = SUBSTRING("($vec_otherppl)",1,3) ;\
+	  IF `vec_chk_ppl EQ "ppl"` THEN ;  ($vec_otherppl) ; ENDIF ;\
+          ($vec_ppl),1,1  ;\ 
+          ($vec_cmd_p)/color=6 vec_uu, vec_vv ;\ 
+       ELSE  ;\
+          let vec_mask   =  IF vec_sp_xyk GT vec_lv1 AND vec_sp_xyk LE vec_lv2 THEN 1 ;\
+          let vec_uu = vec_u_xyk * vec_mask ; let vec_vv = vec_v_xyk * vec_mask  ;\
+          ($vec_cmd_p)/color=6 vec_uu, vec_vv ;\
+       ENDIF ;\
+   )
+
+   ! get the colorkey with proper levels and labels
+   IF ($vec_colorkey) THEN
+      poly/fill/pal=($vec_pal)/lev=(`($vec_lo)`,`($vec_hi)`,`($vec_delta)`)\
+                       /nolab/key/ov/set {1000,1000,1000,1000},{1000,1000,1000,1000}
+      ppl shakey ($vec_shakey)
+      ppl fillpol/over
+   ENDIF
+
+!-----set back default behaviour
+
+   cancel data `vec_pal_1`
+
+   set region save
+   ppl color 1
+   ppl color 6
diff --git a/jnls/contrib/color_vector_demo.jnl b/jnls/contrib/color_vector_demo.jnl
new file mode 100644
index 0000000..a088201
--- /dev/null
+++ b/jnls/contrib/color_vector_demo.jnl
@@ -0,0 +1,106 @@
+\ cancel mode verify
+!
+! Description : Demo file for color_vector GO file. Colored contours based on 
+!                  specified palette file and contour levels.
+!  
+! Jaison Kurian (jaison at atmos.ucla.edu)
+! Jan/05/2008
+!
+!-------------------------------------------------------------------------------
+
+!--open datasets and set reg and variables
+
+   set data monthly_navy_winds
+
+   let uu = uwnd[d=1]
+   let vv = vwnd[d=1]
+   set reg/x=160:360/y=-30:70/t=15-JUL-1989
+
+!--define color_vector fields (symbol names vec_* is prefixed)    
+
+   ! NOTE : Please don't use the following qualifiers with vec_cmd :
+   !             /LENGTH /XSKIP /YSKIP /COLOR
+   !        Instead give them with other options below :
+
+   define symbol vec_cmd      = VECTOR/hlimits=160:360:20/ vlimits=-30:70:10/nolab
+   define symbol vec_u        = uu                    ! u var name, no [],(),*,/,+,-, ^ stuff
+   define symbol vec_v        = vv                    ! v var name, no [],(),*,/,+,-, ^ stuff
+   define symbol vec_len      = 10                    ! value for /LENGTH qualifier
+   define symbol vec_xskip    = 2                     ! value for /XSKIP qualifier
+   define symbol vec_yskip    = 2                     ! value for /YSKIP qualifier
+   define symbol vec_arrowkey = YES                   ! YES or NO, for scale/key vector
+   define symbol vec_veckey   = 325,78,,(f4.1, " m/s")! arguments to "PPL VECKEY" command
+   define symbol vec_lo       = 0                     ! low   value for color levels
+   define symbol vec_hi       = 9                     ! high  value for color levels
+   define symbol vec_delta    = 0.5                   ! delta value for color levels
+   define symbol vec_pal      = rainbow                ! palette file name
+   define symbol vec_colorkey = YES                   ! YES or NO, for color bar/key
+   define symbol vec_shakey   = 1,1,0.12,2            ! arguments to "PPL SHAKEY" command    
+   define symbol vec_otherppl = none                  !other ppl commands (should start with "ppl"),
+                                                      !   for example
+                                                      !   ppl xfor (f5.1, ''lonE'')
+
+!--if you have any viewport/ppl settings, invoke them here (also the metafile part)
+
+   ! sp rm -f metafile* ; set mode meta
+   PPL AXNMTC 3,3
+   PPL AXLINT 2,2
+
+!--call color_vector GO file (note that NO ARGUMENTS are passed)
+
+   say ; say "  With basic commands" 
+         say "  -------------------"
+   say
+
+
+   go color_vector
+
+!--do plot enhancements/overlays/labelling here
+
+   go land
+   label 250,76,0,0,0.20 Color Vector Demo
+
+!--let us see how to use "vec_otherppl" option
+   pause
+
+   say ; say "  Let us see how to use     vec_otherppl   option" 
+         say "  -----------------------------------------------"
+         say
+         say "      The value for vec_otherppl should start with ppl and different"
+	 say "      entries should be seperated by a   \;    for example .... " ; say
+	 say "      define symbol vec_otherppl = ppl xfor (f5.1,''lonE'') \\; ppl yfor (f4.1,''lat'') "
+   say
+   define symbol vec_otherppl = ppl xfor (f5.1,''lonE'') \; ppl yfor (f4.1,''lat'')
+
+   pause
+
+   go color_vector
+   go land
+   label 250,76,0,0,0.175 Color Vector Demo (other ppl commands)
+
+!--color vector in overlay plots   
+   pause 
+
+   say ; say "  Let us see how to use     color_vector    in overlay plots" 
+         say "  ----------------------------------------------------------"
+         say
+         say "      The value for vec_cmd should have a /over qualifier. For example" ; say
+	 say "         define symbol vec_cmd = VECTOR/over/nolab"
+   say
+
+   pause
+
+   define symbol vec_otherppl = none
+   define symbol vec_cmd      = VECTOR/over/nolab
+   let spd = (uu^2 + vv^2)^0.5
+   cont/color=1/lev=(2,16,2)/hlimits=160:360:20/ vlimits=-30:70:10/nolab spd
+
+   go color_vector
+   go land
+   label 250,76,0,0,0.20 Color Vector Demo (Overlay)
+
+!--commands for making plot output
+   
+   !sp rm -f color_vector_demo.ps
+   !cancel mode meta ; ppl clsplt
+   !sp Fprint -l cps -R color_vector_demo.ps ./metafile.plt
diff --git a/jnls/contrib/create_KMZ.jnl b/jnls/contrib/create_KMZ.jnl
new file mode 100644
index 0000000..5ef7ed9
--- /dev/null
+++ b/jnls/contrib/create_KMZ.jnl
@@ -0,0 +1,346 @@
+! create_KMZ.jnl
+\cancel mode verify
+!
+!
+! Make a KMZ archive containing Ferret gif images for use in Google Earth.
+! The tags that are written to the file are take from the documentation
+! at http://code.google.com/apis/kml/documentation/kmlreference.html
+! and comments in this script are take from that document.
+!
+! For more information, please contact jian.zhou3 at mail.mcgill.ca
+!
+say START FERRET WITH ferret -gif SO THAT THE IMAGE CAN BE MADE WITH TRANSPARENCY
+
+!         arguments           1         2                      3                  4        5
+!Usage1:  GO create_KMZ plot_command variable K=low_value:high_value:increment l=value [Duration]
+!         arguments           1         2         3                   4                    5
+!Usage2:  GO create_KMZ plot_command variable K=value L=low_value:high_value:increment [Duration]
+!         arguments           1         2         3                   4                    5
+!Usage3:  GO create_KMZ plot_command variable K=null L=low_value:high_value:increment [Duration]
+!         arguments           1         2                      3                  4        5
+!Usage4:  GO create_KMZ plot_command variable K=low_value:high_value:increment l=null [Duration]
+!         arguments           1         2        3      4        5
+!Usage5:  GO create_KMZ plot_command variable K=null L=null [Duration]
+
+
+!Examples:
+! in plot_command, "pal" and "lev" section is optional
+! make sure you type "lev section" at the end of your plot_command (if you choose to add "lev" section), like the following examples
+! $5 is optional (the duration of images in the movie, unit: seconds. If not indicated, the default is 0.2) 
+! yes? go create_kmz shade/pal=light_centered/lev=(-2,31,1) temp K=1:10:1 L=1 0.5    OR
+! yes? go create_kmz shade/pal=light_centered/lev=(-2,31,1) temp[d=2]-o_temp[d=1] K=1 L=1:12:1    OR
+! yes? go create_kmz fill/pal=light_centered/lev=(-2,31,1) temp K=NULL L=1:12:2 OR
+! yes? go create_kmz shade/pal=light_centered temp K=1:10:2 L=NULL
+! yes? go create_kmz shade temp K=NULL L=NULL
+
+
+query/ignore $1%Argument 1 is the plot command where you can indicate pal and lev (MUST type lev in the end of the plot command)%
+query/ignore $2%Argument 2 is the variable name, math calculation can be indicated%
+query/ignore $3%Argument 3 is k value range or null%
+query/ignore $4%Argument 4 is l value range or null%
+
+IF $5"0|*>1" THEN
+   DEFINE SYMBOL duration = $5"0"
+ELSE
+   DEFINE SYMBOL duration = 0.2
+ENDIF
+
+DEFINE SYMBOL pcommand = $1
+LET plotcom = "($pcommand)"
+LET has_levs = STRINDEX(plotcom, "lev")
+IF `has_levs EQ 0` THEN
+    LET has_levs = STRINDEX(plotcom, "LEV")
+ENDIF
+
+DEFINE SYMBOL commandvar = ($pcommand)
+LET has_noaxes = STRINDEX("($commandvar)","NOAXES")
+IF `has_noaxes EQ 0` THEN
+    LET has_noaxes = STRINDEX("($commandvar)","noaxes")
+ENDIF
+IF `has_noaxes EQ 0` THEN
+    LET has_noaxes = STRINDEX("($commandvar)","Noaxes")
+ENDIF
+IF `has_noaxes GT 0` THEN
+   SAY YOU DO NOT NEED TO INDICATE NOAXES SINCE IT IS DEFAULT
+   EXIT/SCRIPT
+ENDIF
+LET has_pal = STRINDEX("($commandvar)","PAL")
+IF `has_pal EQ 0` THEN
+    LET has_pal = STRINDEX("($commandvar)","pal")
+ENDIF
+IF `has_pal EQ 0` THEN
+    LET has_pal = STRINDEX("($commandvar)","Pal")
+ENDIF
+LET has_lev = STRINDEX("($commandvar)","LEV")
+IF `has_lev EQ 0` THEN
+    LET has_lev = STRINDEX("($commandvar)","lev")
+ENDIF
+IF `has_lev EQ 0` THEN
+    LET has_lev = STRINDEX("($commandvar)","Lev")
+ENDIF
+IF `has_pal GT has_lev` THEN
+   SAY PLEASE TYPE PAL SECTION IN FRONT OF LEV SECTION AND MAKE SURE LEV SECTION IS IN THE END OF THE PLOT_COMMAND
+   EXIT/SCRIPT
+ENDIF
+
+DEFINE SYMBOL var = $2
+
+DEFINE SYMBOL kml_write LIST/QUIET/nohead/norowhead/file="doc.kml"/format=(a)
+
+DEFINE SYMBOL kml_write1 LIST/QUIET/nohead/norowhead/file="file.txt"/format=(a)
+
+! Header lines
+($kml_write)/clobber {"<?xml version='1.0' encoding='UTF-8'?>"}
+($kml_write)/append  {"<kml xmlns='http://www.opengis.net/kml/2.2' "}
+($kml_write)/append  {" xmlns:gx='http://www.google.com/kml/ext/2.2'> "}
+!<Document>
+($kml_write)/append {"    <Document>"}
+($kml_write)/append {"    	<name>($var)</name>"}
+($kml_write)/append {"    	<open>1</open>"}
+
+! Part of Colorbar code is used here.
+! KML_nlevels        approximate number of color levels to use
+DEFINE SYMBOL KML_nlevels = 30
+! Compute the color levels and save in symbol KML_fill_levels
+LET blank_var = ($var)
+LET the_var = ($var)
+IF `has_levs EQ 0` THEN
+LET vmin = the_var[x=@min,y=@min,z=@min,t=@min]
+LET vmax = the_var[x=@max,y=@max,z=@max,t=@max]
+IF ($center_levels%0|*>1%) THEN
+    LET highest = MAX(ABS(vmin), ABS(vmax))
+    LET vmin = -1*highest
+    LET vmax = highest
+ENDIF
+DEFINE SYMBOL KML_fill_levels (($PPL$RANGE_LOW),($PPL$RANGE_HIGH),($PPL$RANGE_INC))
+ELSE
+DEFINE SYMBOL KML_fill_levels = SUBSTRING("($pcommand)", has_levs, 100)
+SAY IF THE COLORBAR WAS NOT ADJUSTED TO YOUR COMMAND BECAUSE OF AN UNSOLVED BUG, PLEASE RUN YOUR COMMAND AGAIN AND THE COLORBAR WILL PROBABLY BE RIGHT
+ENDIF
+
+! Draw the colorbar using the levels and the palette that will be used for all of the main plots
+SET WINDOW/SIZE=0.1/ASPECT=3
+DEFINE SYMBOL colorbar_quals = NOAXES/NOLABELS/LEVELS=($KML_fill_levels)
+! The command to draw colorbar is slightly different between different usages.
+
+! Colorbar is tagged here
+($kml_write)/append {"      <ScreenOverlay>"}
+($kml_write)/append {"         <name>Colorbar_($var)</name>"}
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>Colorbar.gif</href>"}
+($kml_write)/append {"         </Icon>"}
+($kml_write)/append {"         <overlayXY x='0' y='0' xunits='fraction' yunits='fraction'/>"}
+($kml_write)/append {"         <screenXY x='0' y='0' xunits='fraction' yunits='fraction'/>"}
+($kml_write)/append {"         <rotationXY x='0' y='0' xunits='pixels' yunits='pixels'/>"}
+($kml_write)/append {"         <size x='0.15' y='0.6' xunits='fraction' yunits='fraction'/>"}
+($kml_write)/append {"      </ScreenOverlay>"}
+
+DEFINE SYMBOL kvalues = $3
+DEFINE SYMBOL lvalues = $4
+
+DEFINE SYMBOL kvaluerange = ($kvalues)
+DEFINE SYMBOL lvaluerange = ($lvalues)
+
+LET k_has_null = STRINDEX ("($kvaluerange)","N")
+IF `k_has_null EQ 0` THEN
+    LET K_has_null = STRINDEX ("($kvaluerange)","n")
+ENDIF
+LET k_has_colon = STRINDEX ("($kvaluerange)",":")
+LET l_has_null = STRINDEX ("($lvaluerange)","N")
+IF `l_has_null EQ 0` THEN
+    LET l_has_null = STRINDEX ("($lvaluerange)","n")
+ENDIF
+LET l_has_colon = STRINDEX ("($lvaluerange)",":")
+
+IF `k_has_null EQ 0 AND k_has_colon GT 0 AND l_has_null EQ 0 AND l_has_colon EQ 0` THEN
+    SAY K has a range and L has a value, Usage 1
+    !Usage 1 code here
+    LET usage = 1
+
+    !Colorbar is drawn here based on the symbols defined above.
+    SHADE/L=1/K=1/($colorbar_quals) blank_var
+    PPL AXLEN 0.01 0.01
+    LET bar_wid = ($PPL$WIDTH)* 0.1
+    PPL SHAKEY 1,1,0.4,0,3,6,`(($PPL$WIDTH)/2)-((bar_wid)*3)`,`(($PPL$WIDTH)/2-(bar_wid))`,1,`($PPL$HEIGHT)-1`
+    PPL SHADE
+    !save the result as a gif image
+    FRAME/TRANSPARENT/FORMAT=gif/FILE="Colorbar.gif"
+    ($kml_write1)/append {"Colorbar.gif"}
+    !SET WINDOW/SIZE=0.5/ASPECT=0.5
+
+    !The main part of doc.kml is written by the following repeat command. Please refer to create_KMZ_groundoverlay.jnl
+    ($kml_write)/append {"      <Folder>"}
+    ($kml_write)/append {"      <name>($var) ($lvaluerange)</name>"}
+    ($kml_write)/append {"      <open>1</open>"} 
+    REPEAT/($kvaluerange) (GO create_KMZ_groundoverlay)
+    say teststringprintedgroundoverlay
+    ($kml_write)/append {"    </Folder>"}
+
+    ($kml_write)/append {"      <gx:Tour>"}
+    ($kml_write)/append {"      <name>Play me</name>"}
+    ($kml_write)/append {"      <gx:Playlist>"}
+    REPEAT/($kvaluerange) (GO create_KMZ_tour)
+    say teststringprintedtour
+    ($kml_write)/append {"      </gx:Playlist>"}
+    ($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+IF `k_has_null EQ 0 AND k_has_colon EQ 0 AND l_has_null EQ 0 AND l_has_colon GT 0` THEN
+    SAY K has a value and L has a range, Usage 2
+    LET usage = 2  
+ 
+    !Colorbar is drawn here based on the symbols defined above.
+    SHADE/L=1/K=1/($colorbar_quals) blank_var
+    PPL AXLEN 0.01 0.01
+    LET bar_wid = ($PPL$WIDTH)* 0.1
+    PPL SHAKEY 1,1,0.4,0,3,6,`(($PPL$WIDTH)/2)-((bar_wid)*3)`,`(($PPL$WIDTH)/2-(bar_wid))`,1,`($PPL$HEIGHT)-1`
+    PPL SHADE
+    !save the result as a gif image
+    FRAME/TRANSPARENT/FORMAT=gif/FILE="Colorbar.gif"
+    ($kml_write1)/append {"Colorbar.gif"}
+    !SET WINDOW/SIZE=0.5/ASPECT=0.5
+
+    !The main part of doc.kml is written by the following repeat command. Please refer to create_KMZ_groundoverlay.jnl
+    ($kml_write)/append {"      <Folder>"}
+    ($kml_write)/append {"      <name>($var) ($kvaluerange)</name>"}
+    ($kml_write)/append {"      <open>1</open>"} 
+    REPEAT/($lvaluerange) (GO create_KMZ_groundoverlay)
+    ($kml_write)/append {"    </Folder>"}
+
+    ($kml_write)/append {"      <gx:Tour>"}
+    ($kml_write)/append {"      <name>Play me</name>"}
+    ($kml_write)/append {"      <gx:Playlist>"}
+    REPEAT/($lvaluerange) (GO create_KMZ_tour)
+    ($kml_write)/append {"      </gx:Playlist>"}
+    ($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+IF `k_has_null GT 0 AND k_has_colon EQ 0 AND l_has_null EQ 0 AND l_has_colon GT 0` THEN
+    SAY K is null and l has a range, Usage 3
+    LET usage = 3
+
+    !Colorbar is drawn here based on the symbols defined above.
+    SHADE/L=1/($colorbar_quals) blank_var
+    PPL AXLEN 0.01 0.01
+    LET bar_wid = ($PPL$WIDTH)* 0.1
+    PPL SHAKEY 1,1,0.4,0,3,6,`(($PPL$WIDTH)/2)-((bar_wid)*3)`,`(($PPL$WIDTH)/2-(bar_wid))`,1,`($PPL$HEIGHT)-1`
+    PPL SHADE
+    !save the result as a gif image
+    FRAME/TRANSPARENT/FORMAT=gif/FILE="Colorbar.gif"
+    ($kml_write1)/append {"Colorbar.gif"}
+    !SET WINDOW/SIZE=0.5/ASPECT=0.5
+
+    !The main part of doc.kml is written by the following repeat command. Please refer to create_KMZ_groundoverlay.jnl
+    ($kml_write)/append {"      <Folder>"}
+    ($kml_write)/append {"      <name>($var)</name>"}
+    ($kml_write)/append {"      <open>1</open>"} 
+    REPEAT/($lvaluerange) (GO create_KMZ_groundoverlay)
+    ($kml_write)/append {"    </Folder>"}
+
+    ($kml_write)/append {"      <gx:Tour>"}
+    ($kml_write)/append {"      <name>Play me</name>"}
+    ($kml_write)/append {"      <gx:Playlist>"}
+    REPEAT/($lvaluerange) (GO create_KMZ_tour)
+    ($kml_write)/append {"      </gx:Playlist>"}
+    ($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+IF `k_has_null EQ 0 AND k_has_colon GT 0 AND l_has_null GT 0 AND l_has_colon EQ 0` THEN
+    SAY K has a range and L is NULL, Usage 4
+    LET usage = 4
+
+    !Colorbar is drawn here based on the symbols defined above.
+    SHADE/K=1/($colorbar_quals) blank_var
+    PPL AXLEN 0.01 0.01
+    LET bar_wid = ($PPL$WIDTH)* 0.1
+    PPL SHAKEY 1,1,0.4,0,3,6,`(($PPL$WIDTH)/2)-((bar_wid)*3)`,`(($PPL$WIDTH)/2-(bar_wid))`,1,`($PPL$HEIGHT)-1`
+    PPL SHADE
+    !save the result as a gif image
+    FRAME/TRANSPARENT/FORMAT=gif/FILE="Colorbar.gif"
+    ($kml_write1)/append {"Colorbar.gif"}
+    !SET WINDOW/SIZE=0.5/ASPECT=0.5
+
+    !The main part of doc.kml is written by the following repeat command. Please refer to create_KMZ_groundoverlay.jnl
+    ($kml_write)/append {"      <Folder>"}
+    ($kml_write)/append {"      <name>($var)</name>"}
+    ($kml_write)/append {"      <open>1</open>"} 
+    REPEAT/($kvaluerange) (GO create_KMZ_groundoverlay)
+    ($kml_write)/append {"    </Folder>"}
+
+    ($kml_write)/append {"      <gx:Tour>"}
+    ($kml_write)/append {"      <name>Play me</name>"}
+    ($kml_write)/append {"      <gx:Playlist>"}
+    REPEAT/($kvaluerange) (GO create_KMZ_tour)
+    ($kml_write)/append {"      </gx:Playlist>"}
+    ($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+IF `k_has_null GT 0 AND k_has_colon EQ 0 AND l_has_null GT 0 AND l_has_colon EQ 0` THEN
+    SAY K and L are NULL, Usage 5
+    LET usage = 5
+
+    !Colorbar is drawn here based on the symbols defined above.
+    SHADE/($colorbar_quals) blank_var
+    PPL AXLEN 0.01 0.01
+    LET bar_wid = ($PPL$WIDTH)* 0.1
+    PPL SHAKEY 1,1,0.4,0,3,6,`(($PPL$WIDTH)/2)-((bar_wid)*3)`,`(($PPL$WIDTH)/2-(bar_wid))`,1,`($PPL$HEIGHT)-1`
+    PPL SHADE
+    !save the result as a gif image
+    FRAME/TRANSPARENT/FORMAT=gif/FILE="Colorbar.gif"
+    ($kml_write1)/append {"Colorbar.gif"}
+    !SET WINDOW/SIZE=0.5/ASPECT=0.5
+
+    ($kml_write)/append {"      <Folder>"}
+    ($kml_write)/append {"      <name>($var)</name>"}
+    ($kml_write)/append {"      <open>1</open>"} 
+    IF `has_levs EQ 0` THEN
+       ($pcommand)/NOAXES/LEVELS=($KML_fill_levels) ($var)
+    ELSE
+       ($pcommand)/NOAXES ($var)
+    ENDIF
+    FRAME/TRANSPARENT/FILE=($kvaluerange)_($lvaluerange).gif
+    ($kml_write1)/append {"($kvaluerange)_($lvaluerange).gif"}
+    ($kml_write)/append {"      <GroundOverlay id='($var) ($kvaluerange) ($lvaluerange)'>"}
+    ($kml_write)/append {"         <name>($var) ($kvaluerange) ($lvaluerange)</name>"}
+    ($kml_write)/append {"         <visibility>1</visibility>"}
+    ($kml_write)/append {"         <Icon>"}
+    ($kml_write)/append {"            <href>K=($kvaluerange)_($lvaluerange).gif</href>"}
+    ($kml_write)/append {"         </Icon>"}
+    ($kml_write)/append {"         <LatLonBox>"}
+    ($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+    ($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+    IF `(360 - (($PPL$XMAX) - ($PPL$XMIN))) LT 6` THEN
+	DEFINE SYMBOL iinterval = `(360 - (($PPL$XMAX) - ($PPL$XMIN)))`
+	($kml_write)/append {"             <east>`($ppl$xmin)-(($iinterval)/2)`</east>"}
+	($kml_write)/append {"             <west>`($ppl$xmax)+(($iinterval)/2)`</west>"}	
+    ELSE
+	($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+	($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+    ENDIF
+    ($kml_write)/append {"             <rotation>0</rotation>"}
+    ($kml_write)/append {"         </LatLonBox>"}
+
+    ($kml_write)/append {"      </GroundOverlay>"}
+    ($kml_write)/append {"    </Folder>"}
+ENDIF
+ 
+! Close the remaining tags
+($kml_write)/append {"    </Document>"}
+($kml_write)/append {"</kml>"}
+($kml_write1)/append {"doc.kml"}
+
+cancel symbol kml_write
+cancel symbol kml_write1
+
+
+!zip doc.kml and gif images to make a KMZ archive
+!spawn zip temp.zip doc.kml *.gif
+spawn xargs zip temp.zip < file.txt
+spawn mv temp.zip output.kmz
+!delete doc.kml and gif images and only left KMZ archive as the script output
+!!spawn xargs rm < file.txt
+!!spawn rm file.txt
+
+set mode/last verify
+! --- end of create_KMZ.jnl ---
+! --- Visit http://rose.geog.mcgill.ca/~jian to Animate the KMZ ---
diff --git a/jnls/contrib/create_KMZ_groundoverlay_1.jnl b/jnls/contrib/create_KMZ_groundoverlay_1.jnl
new file mode 100644
index 0000000..06d7f5e
--- /dev/null
+++ b/jnls/contrib/create_KMZ_groundoverlay_1.jnl
@@ -0,0 +1,83 @@
+! create_KMZ_groundoverlay_1.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL kvalue = `k`
+
+DEFINE VIEW/AXES/XLIM=0:1/YLIM=0:1 WMSview
+SET VIEW WMSview
+
+SHADE/L=($lvalue)/NOAXES/LEVELS=($KML_fill_levels) ($var)
+!the name of the gif image generated above is set to be K($kvalue)_L($lvalue)_($var).gif
+FRAME/TRANSPARENT/FILE=K($kvalue)_L($lvalue)_($var).gif
+
+!<Folder>
+
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"      <Folder>"}
+	($kml_write)/append {"      <name>($var) Time=($lvalue)</name>"}
+	($kml_write)/append {"      <open>1</open>"}
+ENDIF
+	
+!<GroundOverlay>
+!    This element draws an image overlay draped onto the terrain. The
+!    <href> child of <Icon> specifies the image to be used as the overlay.
+!    This file can be either on a local file system or on a web server.
+
+($kml_write)/append {"      <GroundOverlay id='($var) Level=($kvalue) Time=($lvalue)'>"}
+
+!<name>
+!    User-defined text displayed in the 3D viewer as the label for
+!    the object (for example, for a Placemark, Folder, or NetworkLink).
+
+($kml_write)/append {"         <name>($var) Level=($kvalue) Time=($lvalue)</name>"}
+
+!<visibility>
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"         <visibility>1</visibility>"}
+ELSE
+	($kml_write)/append {"         <visibility>0</visibility>"}
+ENDIF
+	
+!<Icon>
+!    Defines an image associated with an Icon style or overlay.
+!    (For this script this is a simple gif image file.)
+
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>K($kvalue)_L($lvalue)_($var).gif</href>"}
+($kml_write)/append {"         </Icon>"}
+
+
+!<LatLonBox>
+!    Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
+
+($kml_write)/append {"         <LatLonBox>"}
+
+	($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+
+
+	($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+
+!Delete the gap on the earth surface
+!If the scale of image is near 360, then consider the image to be show on the whole earth
+!Change the values of the lat and longitude boundary to fix the gap on the earth surface
+IF `(360 - (($PPL$XMAX) - ($PPL$XMIN))) GT ($iinterval)` THEN
+	($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+	($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+ELSE
+	($kml_write)/append {"             <east>`($ppl$xmin)-(($iinterval)/2)`</east>"}
+	($kml_write)/append {"             <west>`($ppl$xmax)+(($iinterval)/2)`</west>"}	
+ENDIF
+
+($kml_write)/append {"             <rotation>0</rotation>"}
+($kml_write)/append {"         </LatLonBox>"}
+
+($kml_write)/append {"      </GroundOverlay>"}
+
+IF `($kvalue) EQ ($khighvalue)` THEN
+	($kml_write)/append {"    </Folder>"}
+ENDIF
+
+PPL SHASET RESET
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_groundoverlay_2.jnl b/jnls/contrib/create_KMZ_groundoverlay_2.jnl
new file mode 100644
index 0000000..dc495da
--- /dev/null
+++ b/jnls/contrib/create_KMZ_groundoverlay_2.jnl
@@ -0,0 +1,83 @@
+! create_KMZ_groundoverlay_2.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL lvalue = `l`
+
+DEFINE VIEW/AXES/XLIM=0:1/YLIM=0:1 WMSview
+SET VIEW WMSview
+
+SHADE/k=($kvalue)/NOAXES/LEVELS=($KML_fill_levels) ($var)
+!the name of the gif image generated above is set to be K($kvalue)_L($lvalue)_($var).gif
+FRAME/TRANSPARENT/FILE=K($kvalue)_L($lvalue)_($var).gif
+
+!<Folder>
+
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"      <Folder>"}
+	($kml_write)/append {"      <name>($var) Level=($kvalue)</name>"}
+	($kml_write)/append {"      <open>1</open>"}
+ENDIF
+	
+!<GroundOverlay>
+!    This element draws an image overlay draped onto the terrain. The
+!    <href> child of <Icon> specifies the image to be used as the overlay.
+!    This file can be either on a local file system or on a web server.
+
+($kml_write)/append {"      <GroundOverlay id='($var) Level=($kvalue) Time=($lvalue)'>"}
+
+!<name>
+!    User-defined text displayed in the 3D viewer as the label for
+!    the object (for example, for a Placemark, Folder, or NetworkLink).
+
+($kml_write)/append {"         <name>($var) Level=($kvalue) Time=($lvalue)</name>"}
+
+!<visibility>
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"         <visibility>1</visibility>"}
+ELSE
+	($kml_write)/append {"         <visibility>0</visibility>"}
+ENDIF
+	
+!<Icon>
+!    Defines an image associated with an Icon style or overlay.
+!    (For this script this is a simple gif image file.)
+
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>K($kvalue)_L($lvalue)_($var).gif</href>"}
+($kml_write)/append {"         </Icon>"}
+
+
+!<LatLonBox>
+!    Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
+
+($kml_write)/append {"         <LatLonBox>"}
+
+	($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+
+
+	($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+
+!Delete the gap on the earth surface
+!If the scale of image is near 360, then consider the image to be show on the whole earth
+!Change the values of the lat and longitude boundary to fix the gap on the earth surface
+IF `(360 - (($PPL$XMAX) - ($PPL$XMIN))) GT ($iinterval)` THEN
+	($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+	($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+ELSE
+	($kml_write)/append {"             <east>`($ppl$xmin)-(($iinterval)/2)`</east>"}
+	($kml_write)/append {"             <west>`($ppl$xmax)+(($iinterval)/2)`</west>"}	
+ENDIF
+
+($kml_write)/append {"             <rotation>0</rotation>"}
+($kml_write)/append {"         </LatLonBox>"}
+
+($kml_write)/append {"      </GroundOverlay>"}
+
+IF `($lvalue) EQ ($lhighvalue)` THEN
+	($kml_write)/append {"    </Folder>"}
+ENDIF
+
+PPL SHASET RESET
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_groundoverlay_3.jnl b/jnls/contrib/create_KMZ_groundoverlay_3.jnl
new file mode 100644
index 0000000..7128b7c
--- /dev/null
+++ b/jnls/contrib/create_KMZ_groundoverlay_3.jnl
@@ -0,0 +1,83 @@
+! create_KMZ_groundoverlay_3.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL lvalue = `l`
+
+DEFINE VIEW/AXES/XLIM=0:1/YLIM=0:1 WMSview
+SET VIEW WMSview
+
+SHADE/NOAXES/LEVELS=($KML_fill_levels) ($var)
+!the name of the gif image generated above is set to be L($lvalue)_($var).gif
+FRAME/TRANSPARENT/FILE=L($lvalue)_($var).gif
+
+!<Folder>
+
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"      <Folder>"}
+	($kml_write)/append {"      <name>($var)</name>"}
+	($kml_write)/append {"      <open>1</open>"}
+ENDIF
+	
+!<GroundOverlay>
+!    This element draws an image overlay draped onto the terrain. The
+!    <href> child of <Icon> specifies the image to be used as the overlay.
+!    This file can be either on a local file system or on a web server.
+
+($kml_write)/append {"      <GroundOverlay id='($var) Time=($lvalue)'>"}
+
+!<name>
+!    User-defined text displayed in the 3D viewer as the label for
+!    the object (for example, for a Placemark, Folder, or NetworkLink).
+
+($kml_write)/append {"         <name>($var) Time=($lvalue)</name>"}
+
+!<visibility>
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"         <visibility>1</visibility>"}
+ELSE
+	($kml_write)/append {"         <visibility>0</visibility>"}
+ENDIF
+	
+!<Icon>
+!    Defines an image associated with an Icon style or overlay.
+!    (For this script this is a simple gif image file.)
+
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>L($lvalue)_($var).gif</href>"}
+($kml_write)/append {"         </Icon>"}
+
+
+!<LatLonBox>
+!    Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
+
+($kml_write)/append {"         <LatLonBox>"}
+
+	($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+
+
+	($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+
+!Delete the gap on the earth surface
+!If the scale of image is near 360, then consider the image to be show on the whole earth
+!Change the values of the lat and longitude boundary to fix the gap on the earth surface
+IF `(360 - (($PPL$XMAX) - ($PPL$XMIN))) GT ($iinterval)` THEN
+	($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+	($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+ELSE
+	($kml_write)/append {"             <east>`($ppl$xmin)-(($iinterval)/2)`</east>"}
+	($kml_write)/append {"             <west>`($ppl$xmax)+(($iinterval)/2)`</west>"}	
+ENDIF
+
+($kml_write)/append {"             <rotation>0</rotation>"}
+($kml_write)/append {"         </LatLonBox>"}
+
+($kml_write)/append {"      </GroundOverlay>"}
+
+IF `($lvalue) EQ ($lhighvalue)` THEN
+	($kml_write)/append {"    </Folder>"}
+ENDIF
+
+PPL SHASET RESET
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_groundoverlay_4.jnl b/jnls/contrib/create_KMZ_groundoverlay_4.jnl
new file mode 100644
index 0000000..d389f1c
--- /dev/null
+++ b/jnls/contrib/create_KMZ_groundoverlay_4.jnl
@@ -0,0 +1,83 @@
+! create_KMZ_groundoverlay_4.jnl
+\cancel mode verify
+
+!The values of k and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL kvalue = `k`
+
+DEFINE VIEW/AXES/XLIM=0:1/YLIM=0:1 WMSview
+SET VIEW WMSview
+
+SHADE/NOAXES/LEVELS=($KML_fill_levels) ($var)
+!the name of the gif image generated above is set to be K($kvalue)_($var).gif
+FRAME/TRANSPARENT/FILE=K($kvalue)_($var).gif
+
+!<Folder>
+
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"      <Folder>"}
+	($kml_write)/append {"      <name>($var)</name>"}
+	($kml_write)/append {"      <open>1</open>"}
+ENDIF
+	
+!<GroundOverlay>
+!    This element draws an image overlay draped onto the terrain. The
+!    <href> child of <Icon> specifies the image to be used as the overlay.
+!    This file can be either on a local file system or on a web server.
+
+($kml_write)/append {"      <GroundOverlay id='($var) Level=($kvalue)'>"}
+
+!<name>
+!    User-defined text displayed in the 3D viewer as the label for
+!    the object (for example, for a Placemark, Folder, or NetworkLink).
+
+($kml_write)/append {"         <name>($var) Level=($kvalue)</name>"}
+
+!<visibility>
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"         <visibility>1</visibility>"}
+ELSE
+	($kml_write)/append {"         <visibility>0</visibility>"}
+ENDIF
+	
+!<Icon>
+!    Defines an image associated with an Icon style or overlay.
+!    (For this script this is a simple gif image file.)
+
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>K($kvalue)_($var).gif</href>"}
+($kml_write)/append {"         </Icon>"}
+
+
+!<LatLonBox>
+!    Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
+
+($kml_write)/append {"         <LatLonBox>"}
+
+	($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+
+
+	($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+
+!Delete the gap on the earth surface
+!If the scale of image is near 360, then consider the image to be show on the whole earth
+!Change the values of the lat and longitude boundary to fix the gap on the earth surface
+IF `(360 - (($PPL$XMAX) - ($PPL$XMIN))) GT ($iinterval)` THEN
+	($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+	($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+ELSE
+	($kml_write)/append {"             <east>`($ppl$xmin)-(($iinterval)/2)`</east>"}
+	($kml_write)/append {"             <west>`($ppl$xmax)+(($iinterval)/2)`</west>"}	
+ENDIF
+
+($kml_write)/append {"             <rotation>0</rotation>"}
+($kml_write)/append {"         </LatLonBox>"}
+
+($kml_write)/append {"      </GroundOverlay>"}
+
+IF `($kvalue) EQ ($khighvalue)` THEN
+	($kml_write)/append {"    </Folder>"}
+ENDIF
+
+PPL SHASET RESET
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_tour_1.jnl b/jnls/contrib/create_KMZ_tour_1.jnl
new file mode 100644
index 0000000..316af71
--- /dev/null
+++ b/jnls/contrib/create_KMZ_tour_1.jnl
@@ -0,0 +1,52 @@
+! create_KMZ_1.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL kvalue = `k`
+
+!<gx:Tour>
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"      <gx:Tour>"}
+	($kml_write)/append {"      <name>Play me</name>"}
+	($kml_write)/append {"      <gx:Playlist>"}
+ENDIF
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>1</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>0</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+
+IF `($kvalue) EQ ($khighvalue)` THEN
+	($kml_write)/append {"      </gx:Playlist>"}
+	($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_tour_2.jnl b/jnls/contrib/create_KMZ_tour_2.jnl
new file mode 100644
index 0000000..651754c
--- /dev/null
+++ b/jnls/contrib/create_KMZ_tour_2.jnl
@@ -0,0 +1,52 @@
+! create_KMZ_1.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL lvalue = `l`
+
+!<gx:Tour>
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"      <gx:Tour>"}
+	($kml_write)/append {"      <name>Play me</name>"}
+	($kml_write)/append {"      <gx:Playlist>"}
+ENDIF
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>1</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>0</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+
+IF `($lvalue) EQ ($lhighvalue)` THEN
+	($kml_write)/append {"      </gx:Playlist>"}
+	($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_tour_3.jnl b/jnls/contrib/create_KMZ_tour_3.jnl
new file mode 100644
index 0000000..995c2bf
--- /dev/null
+++ b/jnls/contrib/create_KMZ_tour_3.jnl
@@ -0,0 +1,52 @@
+! create_KMZ_3.jnl
+\cancel mode verify
+
+!The values of k, l and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL lvalue = `l`
+
+!<gx:Tour>
+IF `($lvalue) EQ ($llowvalue)` THEN
+	($kml_write)/append {"      <gx:Tour>"}
+	($kml_write)/append {"      <name>Play me</name>"}
+	($kml_write)/append {"      <gx:Playlist>"}
+ENDIF
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>1</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Time=($lvalue)'>"}
+($kml_write)/append {"              <visibility>0</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+
+IF `($lvalue) EQ ($lhighvalue)` THEN
+	($kml_write)/append {"      </gx:Playlist>"}
+	($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+set mode/last verify
diff --git a/jnls/contrib/create_KMZ_tour_4.jnl b/jnls/contrib/create_KMZ_tour_4.jnl
new file mode 100644
index 0000000..9a4c55c
--- /dev/null
+++ b/jnls/contrib/create_KMZ_tour_4.jnl
@@ -0,0 +1,52 @@
+! create_KMZ_4.jnl
+\cancel mode verify
+
+!The values of k and other symbols defined in create_KMZ.jnl are accessable in this script
+DEFINE SYMBOL kvalue = `k`
+
+!<gx:Tour>
+IF `($kvalue) EQ ($klowvalue)` THEN
+	($kml_write)/append {"      <gx:Tour>"}
+	($kml_write)/append {"      <name>Play me</name>"}
+	($kml_write)/append {"      <gx:Playlist>"}
+ENDIF
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue)'>"}
+($kml_write)/append {"              <visibility>1</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>1</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+($kml_write)/append {"      <gx:AnimatedUpdate>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"         <Update>"}
+($kml_write)/append {"         <targetHref></targetHref>"}
+($kml_write)/append {"         <Change>"}
+($kml_write)/append {"            <GroundOverlay targetId='($var) Level=($kvalue)'>"}
+($kml_write)/append {"              <visibility>0</visibility>"}
+($kml_write)/append {"            </GroundOverlay>"}
+($kml_write)/append {"         </Change>"}
+($kml_write)/append {"         </Update>"}
+($kml_write)/append {"      </gx:AnimatedUpdate>"}
+
+($kml_write)/append {"      <gx:Wait>"}
+($kml_write)/append {"         <gx:duration>0.25</gx:duration>"}
+($kml_write)/append {"      </gx:Wait>"}
+
+
+IF `($kvalue) EQ ($khighvalue)` THEN
+	($kml_write)/append {"      </gx:Playlist>"}
+	($kml_write)/append {"      </gx:Tour>"}
+ENDIF
+
+set mode/last verify
diff --git a/jnls/contrib/def_monthaxis_days.jnl b/jnls/contrib/def_monthaxis_days.jnl
new file mode 100644
index 0000000..6edc36b
--- /dev/null
+++ b/jnls/contrib/def_monthaxis_days.jnl
@@ -0,0 +1,141 @@
+! def_monthaxis_days.jnl
+
+\cancel mode verify
+
+!**************************************************************
+! Description: Define a time axis in days in specific calendar 
+!              Each grid cell begins at first of the month
+!              Axis coordinates are at the middle of each month
+!
+! Usage: go def_monthaxis_days.jnl calendar year_start year_end [axis_name] [year_ref]
+!
+! Arguments:
+! 		calendar(case insensitive) =	
+!				STANDARD or GREGORIAN
+!				NOLEAP   or 365_DAY
+!				ALL_LEAP or 366_DAY
+!				360_DAY
+!				JULIAN   (added in 2014)
+!
+!		year_start =    start year for axis
+!
+!		year_end =      start year for axis
+!
+!		axis_name =     if not specifed, monthaxis is used
+!
+!		year_ref =      if not specified, set to year_start
+! 
+! Examples:
+!            go def_monthaxis_days.jnl NOLEAP 2002 2005 mytaxis 
+!            go def_monthaxis_days.jnl ALL_LEAP 2002 2005 mytaxis
+!            go def_monthaxis_days.jnl 360_DAY 2002 2005 mytaxis 
+!            go def_monthaxis_days.jnl JULIAN 2002 2005 mytaxis 
+!
+! Notes: For the present, the JULIAN calendar is not included.
+!        Julian calendar added in 20141/8/2014
+!        
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at cea.fr
+! $Date: $
+! $Name: $
+! $Revision: $
+! History:
+! Modification:
+!   1/8/2014 Ansley Manke added Julian calendar 
+!
+!**************************************************************
+
+!=====================================================
+let calendar=UPCASE("($01)")
+let year_start=($02)
+let year_end=($03)
+def sym axisname=($04%monthaxis%)
+let year_ref=($05%($02)%)
+
+let nbyears=year_end-year_start+1
+
+!=====================================================
+IF `(calendar EQ "STANDARD") OR (calendar EQ "GREGORIAN")` THEN
+	let indices = L[L=1:`1+nbyears*12`]
+	let month = MOD(indices-1,12)+1
+	let year = year_start + INT((indices-1)/12)
+	define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="GREGORIAN" ($axisname) = DAYS1900(year,month,1)-DAYS1900(`year_ref`,1,1)
+
+!=====================================================
+ELIF `(calendar EQ "JULIAN")` THEN
+
+! A couple of 4-year cycles of month lengths for the Julian calendar.
+
+let nbdays={\
+31,29,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31,\
+31,29,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31,\
+31,28,31,30,31,30,31,31,30,31,30,31}
+
+! Start with the correct year. If start year is a leap year, then use 
+! nbdays from 1:48, or to start in a year after a leap year 13:60, etc.
+
+LET y1 = 1+ 12*(MOD(year_start,4))
+LET y2 = y1 + 47
+
+LET nyears = `year_end - year_start + 1`
+
+! A modulo axis 4 years long
+DEFINE AXIS/MODULO=48/X boxaxis = i[i=1:48]
+
+! The month lengths for a 4-year cycle
+LET boxes = nbdays[gx=boxaxis at asn]
+
+! Use modulo replication to extend this as long as we want.
+LET all_boxes  = boxes[x=`y1`:`12*nyears+y1-1`]
+
+! Box edges will be the running sum, plus a 0 at the start.
+! i.e. (0,31) are edges for January; (31,60) for February, etc.
+
+LET month_edges = XCAT (0,  all_boxes[x=@iin] )
+
+! Now add the number of days in the years from year_ref to the start of year_start
+
+LET days_in_year = {366,365,365,365}
+LET n_prior_cycles = INT((year_start-year_ref)/4)
+LET this_cycle = IF (MOD(year_start,4) GT 0) THEN days_in_year[i=1:`MOD(year_start,4)`@SUM] ELSE 0
+LET days_to_add = n_prior_cycles*days_in_year[i=@SUM] + this_cycle
+
+define axis/cal="JULIAN"/T0="1-jan-`year_ref`:00:00"/edges/units=days ($axisname) = month_edges + days_to_add
+
+
+!=====================================================
+ELIF `(calendar EQ "NOLEAP") OR (calendar EQ "365_DAY")` THEN
+	let nbdays={31,28,31,30,31,30,31,31,30,31,30,31}
+	define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="NOLEAP" ($axisname) = `(year_start-year_ref)*365`+xcat(0,xsequence(365*(j[j=1:`nbyears`]-1)+nbdays[i=@rsum]))
+
+!=====================================================
+ELIF `(calendar EQ "ALL_LEAP") OR (calendar EQ "366_DAY")` THEN
+	let nbdays={31,29,31,30,31,30,31,31,30,31,30,31}
+	define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="ALL_LEAP" ($axisname) = `(year_start-year_ref)*366`+xcat(0,xsequence(366*(j[j=1:`nbyears`]-1)+nbdays[i=@rsum]))
+
+!=====================================================
+ELIF `calendar EQ "360_DAY"` THEN
+	define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="360_DAY"/t="01-JAN-`year_start`":"30-DEC-`year_end`":30 ($axisname)
+
+!=====================================================
+ELSE
+ 	say "`calendar` not known"
+ 	say "Possible calendars are : STANDARD (or GREGORIAN), JULIAN, NOLEAP (or 365_DAY), ALL_LEAP (or 366_DAY), 360_DAY"
+	exit
+
+!=====================================================
+ENDIF
+
+show axis ($axisname)
+
+!**************************************************************
+set mode/last verify
+
diff --git a/jnls/contrib/flip_palette.jnl b/jnls/contrib/flip_palette.jnl
new file mode 100644
index 0000000..e7375d3
--- /dev/null
+++ b/jnls/contrib/flip_palette.jnl
@@ -0,0 +1,175 @@
+\ cancel mode verify
+! 
+! Description : flip_palette : Flip (reverse) the color scheme for a given palette.
+! 
+! Arguments/INPUT : $1 (mandatory) : palette file to be flipped/reversed. ".spk"
+!                                       extension can be skipped.
+!                   $2 (optional)  : name of new reversed palette file. ".spk"
+!                                       extension can be skipped.
+! 
+! OUTPUT          : palette file $2.spk (or $1_rev.spk, default) with reversed 
+!                         color levels 
+!
+! Usage   : go flip_palette rainbow            ! output is "rainbow_rev.spk"
+!           go flip_palette rainbow newpalette ! output is "newpalette.spk"
+!
+! Example : yes? set data levitus_climatology
+!           yes? shade/k=1/lev=(-5,30,1)/palette=rainbow temp 
+!           yes? go flip_palette rainbow
+!           yes? shade/k=1/lev=(-5,30,1)/palette=rainbow_rev temp
+!
+! Known Problems :
+!         1. This script will work only with PERCENTAGE based palette (.spk) files,
+!               which have entries for 0% and 100%. Header lines at beginning and 
+!               blank lines towards the end are OK.
+!
+! Related postings : 
+!      palette viewer
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2007/msg00372.html
+!      palette maker 
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2007/msg00410.html
+!      color_vector
+!         http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2008/msg00054.html
+!
+! Written By : Jaison Kurian (jaison at atmos.ucla.edu)
+! Written On : June/16/2008 (based on color_vector.jnl)
+!
+!----------------------------------------------------------------------------
+
+!-----safe guards---------------
+
+   define region/default save
+   can region/x/I
+
+!-----check for palette file
+
+   define symbol flp_pal = $1"<FATAL (flip_palette) : You must supply 1st argument, palette filename. Quitting......"
+   define symbol flp_chk = $2"flpjunk"
+
+   let flp_pal_chk = STRINDEX("($flp_pal)","/")
+   IF `flp_pal_chk GT 0` THEN
+       say ; say " WARNING (flip_palette) : Palette file name should be like rainbow or"
+             say "         rainbow.spk. Requested ($flp_pal) contains '/' & hence not accepted."
+             say "         Using default palette rainbow.spk." ; say  
+	     define symbol flp_pal = rainbow 
+   ENDIF
+   let flp_pal_ext = STRINDEX("($flp_pal)",".spk")
+   IF `flp_pal_ext GT 1` THEN
+       let flp_pal_1 = "($flp_pal)" 
+   ELSE 
+       let flp_pal_1 = "($flp_pal)" + ".spk"
+   ENDIF
+
+   define symbol found_pal = 0
+   let fer_dir             = {spawn:"echo $FER_DIR"}
+   let flp_fex_1           = {spawn:"ls `fer_dir`/ppl/`flp_pal_1` 2> /dev/null"}
+   define symbol fer_pal   = `fer_dir`/ppl
+   IF `STRLEN(flp_fex_1[i=1]) GT 0` THEN
+       define symbol found_pal = 1
+       define symbol flp_pal_2 = "($fer_pal)/`flp_pal_1`"
+   ELSE 
+       let flp_fex_2 = {spawn:"ls `flp_pal_1` 2> /dev/null"}
+       IF `STRLEN(flp_fex_2[i=1]) GT 0` THEN
+           define symbol found_pal = 1
+           define symbol flp_pal_2 = "./`flp_pal_1`"
+       ENDIF
+   ENDIF
+
+   IF `($found_pal) NE 1` THEN
+      say ; say " ERROR (flip_palette) : Requested palette file ($flp_pal) DOES NOT FOUND"
+            say "         in pwd and ($fer_pal)"
+	    say "         ......Quitting " ; say ;  EXIT/PROMPT
+   ENDIF
+
+
+!--create output palette name
+
+   let flp_pal_len = STRLEN(flp_pal_1)
+   IF `"($flp_chk)" EQ "flpjunk"` THEN
+      let flp_out  = SUBSTRING("($flp_pal)",1,`flp_pal_len-4`) + "_rev.spk"
+   ELSE 
+      let flp_out_ext = STRINDEX("($flp_chk)",".spk")
+      IF `flp_out_ext GT 1` THEN
+          let flp_out = "($flp_chk)"
+      ELSE 
+          let flp_out = "($flp_chk)" + ".spk"
+      ENDIF
+   ENDIF
+
+!--read palette file 
+
+   let flp_pal_lines = {spawn:"cat `($flp_pal_2)` | wc -l"}
+   define axis/x=1:`flp_pal_lines`:1 xpal
+   define grid/x=xpal gpal
+
+   !--get number of header lines to skip 
+
+   FILE/grid=gpal/format=delimited/var=flp_spk_head ($flp_pal_2)
+   let flp_spk_skip = -1
+   REPEAT/RANGE=1:`flp_pal_lines`:1/name=flp_hd (;\
+      define symbol flp_hdr = `flp_hd` ;\
+      IF `SUBSTRING(flp_spk_head[i=($flp_hdr)],1,1) EQ "0"` THEN ;\
+         let flp_spk_skip = `($flp_hdr) - 1` ;\
+         EXIT/LOOP ;\
+      ENDIF   ;\
+   )
+   IF `flp_spk_skip LT 0` THEN 
+      say ; say " ERROR (flip_palette) : Requested palette file ($flp_pal) DOES NOT have entry for 0%."
+            say "         Palette files should be PERCENTAGE based and should have"
+	    say "         entries for 0% and 100%......Quitting " ; say ;  EXIT/PROMPT
+
+   ENDIF
+
+   cancel data `flp_pal_1`
+
+   !--check whether 0% and 100% entries exists
+
+   FILE/grid=gpal/skip=`flp_spk_skip`/var="flp_perc,flp_r,flp_g,flp_b" ($flp_pal_2)
+
+   let flp_perc_0   = flp_perc[d=`flp_pal_1`,i=1]
+   let flp_perc_100 = flp_perc[d=`flp_pal_1`,i=@MAX]
+
+   let flp_spk_chk = IF `flp_perc_0 NE 0` OR `flp_perc_100 NE 100` THEN 1 ELSE 0
+   IF `flp_spk_chk EQ 1` THEN
+      say ; say " ERROR (flip_palette) : COULD NOT locate entries for 0% and/or 100% "
+            say "         in requested palette file ($flp_pal)."
+            say "         Palette files should be PERCENTAGE based and should have"
+	    say "         entries for 0% and 100%......Quitting " ; say ;  EXIT/PROMPT
+
+   ENDIF
+
+!-- OK. Now flip the colors, with proper percentage values
+
+   let flp_pr   = ABS( COMPRESSI(flp_perc)-100 )
+   let flp_levs = flp_pr[i=@NGD] 
+   let flp_r1   = COMPRESSI(flp_r)
+   let flp_g1   = COMPRESSI(flp_g)
+   let flp_b1   = COMPRESSI(flp_b)
+
+   sp rm -f `flp_out`
+   let pwdir  = {spawn:"pwd"}
+   let cdate  = {spawn:"date +%b/%d/%Y\ %H\:%M\:%S"}
+   sp echo "\!  Ferret Palette File, with reversed colors using flip_palette.jnl." > `flp_out`
+   sp echo "\!           Reference palette is ($flp_pal_2)" >> `flp_out`
+   sp echo "\!           PWD  : `pwdir`" >> `flp_out`
+   sp echo "\!           Date : `cdate`" >> `flp_out`
+   sp echo "\!  -----------------------------------------------------------------" >> `flp_out`
+
+   define symbol flp_cmd = list/nohead/format=(4(3x,f8.4))/file=`flp_out`/append/quiet
+   REPEAT/RANGE=1:`flp_levs`:1/NAME=fv (;\
+      define symbol lb = `flp_levs-fv+1` ;\
+      ($flp_cmd) flp_pr[i=($lb)], flp_r1[i=($lb)], flp_g1[i=($lb)], flp_b1[i=($lb)] ;\
+   )
+
+!--Print status
+ 
+   say ; say "     NOTE (flip_palette) : Created new flipped palette file `flp_out`" ; say
+
+!--clean up
+
+   cancel data `flp_pal_1`
+   cancel var flp_*  ; cancel symbol flp_*
+
+!--set back default behaviour
+
+   set region save
diff --git a/jnls/contrib/histogram.jnl b/jnls/contrib/histogram.jnl
new file mode 100644
index 0000000..3340620
--- /dev/null
+++ b/jnls/contrib/histogram.jnl
@@ -0,0 +1,51 @@
+\CANCEL MODE VERIFY    ! histogram.jnl
+! partially updated 4/94 for Ferret V3.10
+! (could use g=@asn to create variable based on hvar axis with unique-ified
+! points but running out of axis memory is a limitation)
+
+! Description: generate and plot a frequency histogram from a FERRET variable
+
+! Usage:  GO histogram expression
+
+! check that all necessary input arguments were supplied
+QUERY/IGNORE $1"<Usage:GO histogram expression"
+
+! save the users region and data set to be restored later
+define region/default husr
+set data/save
+
+! produce a sorted, numbered listing of the user's data in a file
+! "**"'s are removed from the data with unix sed
+spawn rm -f ferret_histo.dat ferret_histo.sort
+list/file=ferret_histo.dat/form=(1x,f18.9)/nohead $1
+spawn fgrep -v '**' ferret_histo.dat | sort -n  | awk '{print NR,$0}' > ferret_histo.sort
+spawn rm -f ferret_histo.dat
+
+! setup to read the data back - allocate space for 40K by default
+cancel region
+define axis/x=1:40000:1 histsize
+define grid/x=histsize histgrid
+file/grid=histgrid/var=hcount,hval ferret_histo.sort
+
+! define variables needed for the histogram
+! hcdf - a normalized "counter" that increments for each data point
+! hpdf - the raw probability density function for the users data
+! The PDF approximates the derivative of the CDF as
+! d/dx(CDF) = d/di(CDF) / d/di(HVAL) where HVAL are the sorted data values.
+! An arbitrary delta i of 10 points is used.  Large data sets could use a 
+! larger delta i.
+! e.g. LET hpdf = 50/((hval[i=@shf:+25]-hval[i=@shf:-25])*hcount[x=@max])
+LET hcdf = hcount/hcount[x=@max] ! normalized for cumulative prob. dens. fct
+LET hpdf = 10/((hval[i=@shf:+5]-hval[i=@shf:-5])*hcount[x=@max])
+
+! various results can be plotted from this
+! plot/vs hval,hcdf              ! cumulative probability density function
+! plot/vs hval,hpdf              ! approximate probability density function
+! plot/vs hval,hpdf[i=@sbx:11]   ! histogram: smoothed PDF
+
+! here is a fully labelled plot using an overlay technique to get the labels
+! For large data sets smoothing can be increased using a larger @SBX argument 
+define alias histplot PLOT/VS/NOLAB HVAL,HPDF[I=@SBX:11]
+go histogram.plot $1
+
+SET MODE/LAST VERIFY
diff --git a/jnls/contrib/histogram.notes b/jnls/contrib/histogram.notes
new file mode 100644
index 0000000..0547e38
--- /dev/null
+++ b/jnls/contrib/histogram.notes
@@ -0,0 +1,41 @@
+SET MODE VERIFY  ! histogram.notes
+! -------
+! The command "GO histogram" can be used to produce a histogram-like plot.
+! Basic instructions on its use are given when the command is issued.
+! You will need only to define the variable HISTOVAR and set the region
+! of interest.
+! What follows are notes on the advanced usage of the command.
+! -------
+! SMOOTHING THE OUTPUT PLOT:
+! By default a smoothing window of width 11 points (@SBX:11) is applied 
+! to HPDF, the unsmoothed estimate of the Probability Density Function.
+! To modify the width of the smoothing window use the commands
+! "SHOW ALIAS HISTPLOT" and "DEFINE ALIAS HISTPLOT ...".  Redefine the 
+! smoothing window and then give the command "GO histogram.plot"
+! Also, by default the variable HPDF is computed using an approximate
+! derivative based on an interval of 10 data points.  For large data sets a
+! a larger interval may be preferable.  Use "SHOW VARIABLE HPDF" to see the
+! current definition and enlarge it to, say, 20 points with
+! LET HPDF = 20/((HVAL[I=@SHF:+10]-HVAL[I=@SHF:-10])*HCOUNT[X=@MAX])
+! Then give the command "GO histogram.plot"
+message ****
+! -------
+! VERY LARGE AMOUNTS OF DATA
+! By default "GO histogram" can accept up to 40000 points.  To increase
+! this limit copy the file $FER_DIR/fer/go/histogram.jnl into your own
+! directory and modify the line which defines the axis HISTSIZE.
+! -------
+! WIDE-RANGING DATA VALUES
+! FERRET writes your data to a disk file and uses the Unix command sort to
+! assist with producing histograms.  By default FERRET writes your data to
+! disk using a FORTRAN format of F18.9.  If this is inadequate to describe
+! your data copy the file $FER_DIR/fer/go/histogram.jnl into your own
+! directory and modify the FORTRAN FORMAT statement in it.
+! -------
+! HISTOGRAM PLOTS AND VIEWPORTS
+! The GO histogram command uses viewports to help with labelling the plot.
+! If this conflicts with your uses of viewports copy the file
+! $FER_DIR/fer/go/histogram.plot into your own directory and modify 
+! the definitions of viewports hvp1 and hvp2 to suit your needs. 
+
+SET MODE/LAST VERIFY
diff --git a/jnls/contrib/histogram.plot b/jnls/contrib/histogram.plot
new file mode 100644
index 0000000..193da31
--- /dev/null
+++ b/jnls/contrib/histogram.plot
@@ -0,0 +1,38 @@
+CANCEL MODE VERIFY ! histogram.plot - plot the histogram as overlaid viewports
+cancel region
+! minor change (uses $1 now) 4/94
+
+! produce a fully documented histogram using overlaid viewports to obtain
+! labels and titles
+cancel viewports                          ! erase previous drawings
+define viewport hvp1    ! just like "full"
+define viewport hvp2    ! just like "full"
+set view hvp1
+
+set data/restore   ! the users original data set
+plot/vs/set/@husr $1,$1
+
+! plot only the desired labels - use x axis label as plot title
+ppl yaxis -10100,-10000,100
+ppl title .15, at AC'LABX'
+ppl xlab
+! ylab located wrong on the first plot, ok on second try - don't know why
+ppl ylab Probability Density Function
+ppl axset 0,0,0,0
+ppl plot
+
+! restore normal plot style
+ppl pen 1,1
+ppl axset 1,1,1,1
+
+! now overlay the histogram on these labels
+set viewport hvp2
+set data ferret_histo.sort
+histplot    ! normally "plot/vs/nolab hval,histo[i=@sbx:11]"
+
+! restore user defaults
+set region husr
+set data/restore
+
+say Use CANCEL VIEWPORTS to erase the histogram plot
+SET MODE/LAST VERIFY
\ No newline at end of file
diff --git a/jnls/contrib/histogram_spillane b/jnls/contrib/histogram_spillane
new file mode 100644
index 0000000..11fde59
--- /dev/null
+++ b/jnls/contrib/histogram_spillane
@@ -0,0 +1,64 @@
+# /bin/csh -f
+# contributed by Mick Spillane - 5/93
+# revised 8/93: does not assume positive data - *ms*
+#
+# histogram - script to summarize binned data, assuming one entry per record.
+#             the class values are determined by the data format (fortran i or
+#             f format) e.g. f8.2 will result in class increments of 0.01
+#
+# i/o files used are:
+#       histo.input   - file of binned data (perhaps produced by ferret)
+#       histo.output  - output of this script with count and class_value
+#                       for each bin present
+#       get_histo.jnl - file of ferret instructions to plot histogram
+#
+# example of usage from within ferret:
+#       yes? let hisvar = ...            ! defines the binning of the data
+#       yes? list/nohead/file=histo.input/form=(f8.2) hisvar  ! write data
+#       yes? spawn histogram                          ! form the histogram
+#       yes? go get_histo                      ! returns & plots histogram
+#
+# mick spillane               noaa/pmel/ocrd                      8/2/1993
+#
+# step 1 - remove missing data records
+  grep -v '\*' histo.input >! histo.inp2
+# step 2 - sort the resulting file
+  sort -n histo.inp2 >! histo.sort
+# step 3a - compute count for each bin
+  uniq -c histo.sort  >! histo.out1
+# step 3b - form an integer from the bin variable
+  awk '{print $2}' histo.out1 | sed 's/\.//;s/^0//;s/-0/-/' >! histo.out2
+  paste histo.out1 histo.out2 >! histo.out
+# step 4a - form awk script to fill missing bins
+  set fbin = `head -1 histo.out | sed 's/\.//' | awk '{print $3}'`
+  @ nbin = ($lbin - $fbin) + 1
+  echo '{'                                           >! fillgap.awk
+  echo '  bin[$3] = $2'                              >> fillgap.awk
+  echo '  count[$3] = $1'                            >> fillgap.awk
+  echo '}'                                           >> fillgap.awk
+  echo 'END {'                                       >> fillgap.awk
+  echo '  fac = bin['$fbin']/'$fbin                  >> fillgap.awk
+  echo '  for ( i = '$fbin' ; i <= '$lbin' ; i++ )'  >> fillgap.awk
+  echo '    if ( count[i] >= 1 )'                    >> fillgap.awk
+  echo '      print bin[i], count[i]'                >> fillgap.awk
+  echo '    else'                                    >> fillgap.awk
+  echo '      print i*fac, "0"'                      >> fillgap.awk
+  echo '}'                                           >> fillgap.awk
+# step 4b - apply the script
+  awk -f fillgap.awk histo.out >! histo.output
+# step 5 - produce a get_histo.jnl file to plot the histogram in ferret
+  echo 'define axis/x=1:'$nbin':1 xh'                      >! get_histo.jnl
+  echo 'define grid/x=xh gh'                               >> get_histo.jnl
+  echo 'file/grid=gh/for=free/var="bin,npts" histo.output' >> get_histo.jnl
+  echo 'region/x=1:'$nbin                                  >> get_histo.jnl
+  echo 'plot/vs bin,npts'                                  >> get_histo.jnl
+# step 6 - clean up unwanted files
+  \rm histo.sort histo.input histo.inp2 histo.out1 histo.out2 histo.out
+#
+  echo '*****************************************************'
+  echo '* use get_histo.jnl in ferret to plot the histogram *'
+  echo '*****************************************************'
+#
+# end of script
+
+
diff --git a/jnls/contrib/land_full.jnl b/jnls/contrib/land_full.jnl
new file mode 100644
index 0000000..de1a4fc
--- /dev/null
+++ b/jnls/contrib/land_full.jnl
@@ -0,0 +1,241 @@
+\cancel mode verify	! ... now overlaying coastal outline ...
+
+! Description: Plot outlines of continents, countries, states, and/or rivers.
+!              This script, based on land.jnl, plot GMT intermediate-
+!              resolution coastline and boundary data and rivers.
+! 8/11/03 ACM 
+!
+! usage:   go land_detail arg1 [arg2] [arg3] [arg4] [arg5] [arg6] [arg7]
+!
+!    arg1  continent_pen  
+!    arg2 "basemap" "overlay", or omitted for overlay
+!    arg3 country_pen	Pen for optional national boundaries 
+!    arg4 state_pen	Pen for optional state boundaries (Western hemisphere)
+!    arg5 rivers_pen	Pen for largest rivers
+!    arg6 more_rivers	Pen for additional rivers 
+!    arg7 marine boundaries  Pen for marine boundaries in South Pacific, Bering Strait
+!
+!
+! pens 	may be "0"(background), "1"(foreground), "thick"(same as pen 7),
+!	"black", "red", "green", "blue", "lightblue" "purple" "white" or 2-19.
+!
+!	Note 1: A pen color of "black" will actually pen number 1
+!		-- normally white if the window background is black.
+!               White is always pen 19, white
+!	Note 2: An "N" for the continent pen means no continents
+!		-- use this for the special case of geo-political 
+!		   overlay or rivers without continents
+!       Note 3: This script plots data in the longitude range -360:720. If you need
+!               longitudes outside that range, this script may easily be modified
+!               to add or subtract multiples of 360 from the longitude variables.
+
+! examples:
+!   go land_detail red        	 - overlay continents using red pen (2)
+!   go land_detail  10           - overlay continents using pen number 10
+!   go land_detail 1 basemap     - basemap of continents outline in foreground color
+!   go land_detail 1 " " red     - overlay continents with countries in red
+!   go land_detail thick basemap black black - continents, countries, and states
+!   go land_detail thick " " red green blue lightblue purple - continents, countries, states, 
+!                                                 all rivers, and marine boundaries
+!   go land_detail N " " 1 1     - overlay: no continents; yes political boundaries
+
+! Notes:
+!  1) If a pen value is given for the country_pen or state_pen then the
+!	corresponding geopolitical boundaries will be drawn - else
+!	they will be omitted
+!  2) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+!  3) For more control over basemaps use "GO basemap"
+
+! test argument before performing any actions
+query/ignore $1%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|<argument 2 can be "basemap", "overlay"%
+query/ignore $3%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $5%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $6%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $7%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+set data/save
+define region/default save
+cancel region
+
+! introduce the outline data set
+set mem/size=300
+use geo_borders_full
+
+! Initialize
+let landi_subx = 0
+let landi_addx = 0
+let landi_mapxmin = 0
+let landi_mapxmax = 0
+let landi_datxmin = continent_LON[x=@min]
+let landi_datxmax = continent_LON[x=@max]
+
+let landi_basemap = $2"0|basemap>1|*>0"
+
+IF `landi_basemap EQ 0` THEN
+
+   let landi_mapxmin = ($xaxis_min)
+   let landi_mapxmax = ($xaxis_max)
+
+   IF `landi_mapxmin LT landi_datxmin` then let landi_subx = `landi_subx - 360`
+   IF `landi_mapxmax GT landi_datxmax` then let landi_addx = `landi_addx + 360`
+
+ELSE
+   
+   shade/pal=white/nokey/nolab x[x=28:380:1] + y[y=-90:90:1]
+   let landi_mapxmin = 20.
+   let landi_mapxmax = 380.
+
+   IF `landi_mapxmin LT landi_datxmin` then let landi_subx = `landi_subx - 360`
+   IF `landi_mapxmax GT landi_datxmax` then let landi_addx = `landi_addx + 360`
+
+ENDIF
+
+
+! always do the continents
+
+$1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/line=1/$2"i=1:7437192/overlay|basemap>i=1:7437192/overlay|*>i=1:7437192/overlay" CONTINENT_LON, CONTINENT_LAT
+
+! select line style and plot
+ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19>19|N>1|"
+
+! set up axis formatting in case it is a basemap
+ppl xfor (I7,''LONE'')
+ppl yfor (I7,''LAT'')
+
+! draw it - as an overlay or as a basemap
+$1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+
+! Draw any lines outside 0 to 360
+
+IF `landi_addx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_addx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+
+IF `landi_subx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_subx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+can mode ver
+
+! **** now the optional country borders
+$3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON, COUNTRY_LAT
+
+! select line style and plot
+ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$3"query/ignore|*>ppl plot/overlay"
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_addx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_subx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! **** now the optional state borders
+$4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON, STATE_LAT
+
+! select line style and plot
+ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$4"query/ignore|*>ppl plot/overlay"
+
+IF `landi_addx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_addx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_subx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! **** now the optional major and minor rivers
+!$6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON, RIVER1_2_LAT
+
+! select line style and plot
+!ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+!$6"query/ignore|*>ppl plot/overlay"
+
+! Draw any lines outside 0 to 360
+!IF `landi_addx NE 0` THEN 
+!   $6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON+landi_addx,RIVER1_2_LAT
+!   ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+!   $6"query/ignore|*>ppl plot/overlay"
+!ENDIF
+!IF `landi_subx NE 0` THEN 
+!   $6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON+landi_subx,RIVER1_2_LAT
+!   ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+!   $6"query/ignore|*>ppl plot/overlay"
+!ENDIF
+
+! **** now the optional major rivers
+$5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON, RIVER1_LAT
+
+! select line style and plot
+ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$5"query/ignore|*>ppl plot/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON+landi_addx,RIVER1_LAT
+   ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $5"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON+landi_subx,RIVER1_LAT
+   ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $5"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+
+
+
+! **** now the optional marine boundaries
+$7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON, MARINE_LAT
+
+! select line style and plot
+ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$7"query/ignore|*>ppl plot/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON+landi_addx,MARINE_LAT
+   ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $7"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON+landi_subx,MARINE_LAT
+   ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $7"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! Restore data set and region
+cancel data geo_borders_full
+cancel var landi_*
+
+set region save
+set data/restore
+set mode/last verify
diff --git a/jnls/contrib/legend.jnl b/jnls/contrib/legend.jnl
new file mode 100644
index 0000000..c9a09e4
--- /dev/null
+++ b/jnls/contrib/legend.jnl
@@ -0,0 +1,47 @@
+\cancel mode verify
+
+! Contributed by Hein Zelle, 11-December-2003
+! Run test_legend.jnl for an example which calls this script.
+
+! script to add a legend line to a plot
+! use this between plot/set_up and ppl plot.
+! it may also work before a plot/overlay, but I'm not sure.
+! if it doesn't, change it to use immediate mode: remove the "on"
+! argument to ppl aline. For skipping lines we'll need to write a more
+! advanced script that keeps track of how many times we've been called
+! so far.
+!
+! go legend line# title [location]
+! 
+! where location is one of ul, ur, ll or lr
+! default location is ul
+
+query/ignore $1%<usage: go legend line# title [location: ul* ur ll lr]%
+query/ignore $2%<usage: go legend line# title [location: ul* ur ll lr]%
+query/ignore $3%1|ul>1|ur>2|ll>3|lr>4|<location must be ul, ur, ll or lr%
+
+if `$3%1|ul>1|ur>2|ll>3|lr>4|% eq 1` then     ! left top
+
+  ppl aline/nouser $1,0.1,`($PPL$YLEN)-0.2*$1`,0.5,`($PPL$YLEN)-0.2*$1`,on
+  ppl labs/nouser $1,0.6,`($PPL$YLEN)-0.05-0.2*$1`,-1,"$2"
+
+elif `$3%1|ul>1|ur>2|ll>3|lr>4|% eq 2` then   ! right top
+
+  ppl aline/nouser $1,`($PPL$XLEN)-0.1`,`($PPL$YLEN)-0.2*$1`,`($PPL$XLEN)-0.5`,`($PPL$YLEN)-0.2*$1`,on
+  ppl labs/nouser $1,`($PPL$XLEN)-0.6`,`($PPL$YLEN)-0.05-0.2*$1`,1,"$2"
+
+elif `$3%1|ul>1|ur>2|ll>3|lr>4|% eq 3` then   ! left bottom
+
+  ppl aline/nouser $1,0.1,`0.2*$1`,0.5,`0.2*$1`,on
+  ppl labs/nouser $1,0.6,`-0.05+0.2*$1`,-1,"$2"
+
+else                                          ! right bottom
+
+  ppl aline/nouser $1,`($PPL$XLEN)-0.1`,`0.2*$1`,`($PPL$XLEN)-0.5`,`0.2*$1`,on
+  ppl labs/nouser $1,`($PPL$XLEN)-0.6`,`-0.05+0.2*$1`,1,"$2"
+
+endif
+
+say label `$1`: "$2"
+
+set mode /last verify
diff --git a/jnls/contrib/legline.jnl b/jnls/contrib/legline.jnl
new file mode 100644
index 0000000..e9f07ef
--- /dev/null
+++ b/jnls/contrib/legline.jnl
@@ -0,0 +1,22 @@
+
+\can mode verify
+! make a legend line and its label
+! arg1=x-value of line starting point (user units)
+! arg2=length of line (user units)
+! arg3=y-value of line
+! arg4=line type (number 1-19)
+! arg5=text character height
+! arg6=label text (in quotes if a space is included)
+! only gets label position right for positive-up axes
+
+define symbol xend `$1+$2`
+define symbol txstart `($xend)+$2/10`
+ppl %range ($ppl$ymin1) ($ppl$ymax1) 10		! get axis range user units
+define symbol drop `$5/2`			! half char hgt in inches
+define symbol txypos `($3)-(($drop))*((($ppl$range_high))-(($ppl$range_low)))/($ppl$ylen)`
+! set pen for a dummy line number (not to interfere)
+ppl pen,77,$4
+ppl aline 77 $1 $3 ($xend) $3 
+label ($txstart) ($txypos) -1 0 $5 $6
+set mode/last verify
+
diff --git a/jnls/contrib/legline_nu.jnl b/jnls/contrib/legline_nu.jnl
new file mode 100644
index 0000000..a79d46a
--- /dev/null
+++ b/jnls/contrib/legline_nu.jnl
@@ -0,0 +1,19 @@
+\can mode verify
+! make a legend line and its label (nouser units) (Vanvyve e-mails 25 July 2003)
+! calls user-unit legline script, after converting to user units
+
+! arg1=x-value of line starting point (fraction of plot width)
+! arg2=length of line (fraction of plot width)
+! arg3=y-value of line (fraction of plot height)
+! arg4=line type (number 1-19)
+! arg5=text character height
+! arg6=label text (in quotes if a space is included)
+! only gets label position right for positive-up axes
+
+let xrange `($xaxis_max) - ($xaxis_min)`
+let yrange `($yaxis_max) - (($yaxis_min))`
+let leg1 `($xaxis_min) + xrange*$1`
+let leg2 `xrange*$2`
+let leg3 `($yaxis_min) + yrange*$3`
+
+go legline `leg1` `leg2` `leg3` $4 $5 "$6"
diff --git a/jnls/contrib/line_segments.jnl b/jnls/contrib/line_segments.jnl
new file mode 100644
index 0000000..1888926
--- /dev/null
+++ b/jnls/contrib/line_segments.jnl
@@ -0,0 +1,60 @@
+\cancel mode verify
+! line_segments.jnl
+! 4/25/94 *sh*
+
+! Description:  general routine for plotting a sequence of line segments
+
+! suitable for unequally spaced axis tic marks, etc.
+
+! Usage GO line_segments plot_command xlo ylo xhi yhi n [axis]
+! plot_command	- the plotting command (with qualifiers) to display the lines
+! xlo,ylo	- the coordinates (expressions) of the line segment starts
+! xhi,yhi	- the coordinates (expressions) of the line segment ends
+! n		- the number of line segments to plot
+! axis		- "X", "Y", "Z", or "T" axis used in expression [default="X"]
+
+! dumb example:
+!    yes? SET REGION/I=1:50
+!    yes? go line_segments plot/line=2 i/10 sin(i/10) i/10 sin(i/10)+.1 50
+
+! check for required filename and haf_inch_value and valid style
+QUERY/IGNORE $1%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $2%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $3%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $4%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $5%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $6%<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+QUERY/IGNORE $7%X|X|Y|Z|T|<Usage: GO line_segments plot_command xlo ylo xhi yhi n [axis]%
+
+LET/QUIET p1x = $2
+LET/QUIET p1y = $3
+LET/QUIET p2x = $4
+LET/QUIET p2y = $5
+DEFINE REGION/$7"X|X|Y|Z|T|"=0:$6 seg
+
+LOAD p1x,p1y,p2x,p2y   ! so grids are determined
+
+DEFINE AXIS/$7"X|X|Y|Z|T|"=.333333333:1000.333333333:1 x31    ! start points
+DEFINE AXIS/$7"X|X|Y|Z|T|"=.666666667:1000.666666667:1 x32    ! end   points
+DEFINE AXIS/$7"X|X|Y|Z|T|"=.333333333:1000:.3333333333   x3   ! both  points
+DEFINE GRID/LIKE=p1x/$7"X|X|Y|Z|T|"=x31 g31
+DEFINE GRID/LIKE=p1x/$7"X|X|Y|Z|T|"=x32 g32
+DEFINE GRID/LIKE=p1x/$7"X|X|Y|Z|T|"=x3  g3
+
+
+LET/QUIET p1xg = p1x[g=g31 at asn]
+LET/QUIET p1yg = p1y[g=g31 at asn]
+LET/QUIET p2xg = p2x[g=g32 at asn]
+LET/QUIET p2yg = p2y[g=g32 at asn]
+
+LET/QUIET index = MOD($7"I|X>I|Y>J|Z>K|T>L"[g=g3]-1,3) + 1
+LET/QUIET p1xg0 = IF (index EQ 1 ) THEN p1xg[g=g3]
+LET/QUIET p1yg0 = IF (index EQ 1 ) THEN p1yg[g=g3]
+LET/QUIET p2xg0 = IF (index EQ 2 ) THEN p2xg[g=g3]
+LET/QUIET p2yg0 = IF (index EQ 2 ) THEN p2yg[g=g3]
+
+LET/QUIET px = MISSING(p1xg0,p2xg0)
+LET/QUIET py = MISSING(p1yg0,p2yg0)
+
+! plot command
+$1/VS/@seg px,py
diff --git a/jnls/contrib/mlbase_var.jnl b/jnls/contrib/mlbase_var.jnl
new file mode 100644
index 0000000..92d87fc
--- /dev/null
+++ b/jnls/contrib/mlbase_var.jnl
@@ -0,0 +1,79 @@
+\ cancel mode verify
+!
+! Go File  "mlbase_var"  
+! ---------------------
+!
+! Description : 1. To find the value of a variable (say temp or salt) at 
+!                  the base of the given Mixed Layer (ML). Result will be 
+!                  available as a variable with a prefix of the given field 
+!                  (var) as "var_mlbase".
+!
+!               2. To extend the given Mixed Layer Depth (MLD) to the base 
+!                  of the corresponding grid cells. Result will be availabe 
+!                  as avariable, "mld_extn".
+!
+! Arguments   : Mandatory : $1 - variable to be used for extracting values 
+!                                                               at ML base
+!             : Mandatory : $2 - MLD variable
+!
+! Usage       : yes? GO mlbase_var temp, mld           ! <---- CORRECT
+! 
+!               yes? GO mlbase_var temp[d=1], mld[d=2] ! <---- WRONG
+!
+!                    results will be available as the following variables
+!                       -->  "var_mlbase" & "mld_extn"
+!
+! Note        : 1. The given "field" is assumed to be on proper Z-axis 
+!                  (with 'meters' units).
+!               2. Variables defined here has a prefix of "ml_".
+!               3. It is assumed that given variable is at the middle of the 
+!                    depth-grid cell. 
+!               4. If you want to remove the Z-axis information from the 
+!                    final output variable "var_mlbase", please see the
+!                    Note 3 in mld_temp.jnl (or mld_dens.jnl).
+!
+! Example     :  yes? use levitus_climatology
+!                yes? set reg/x=30:120/y=-30:30
+!                yes? go mld_temp temp
+!                yes? go mlbase_var temp, mld_t
+!                yes? list/x=60/y=10 mld_t
+!                yes? list/x=60/y=10 mld_extn
+!                yes? list/x=60/y=10 temp_mlbase
+!                yes? list/x=60/y=10 temp
+!                yes? fill temp_mlbase
+!
+! Author : Jaison Kurian
+! Contact: jaison at caos.iisc.ernet.in
+! Date   : 04-MAR-2006
+! Modifications : None
+!----------------------------------------------
+   
+  
+   let ml_var      = $1"<Usage: go mlbase_var[.jnl] var mld"
+   let ml_mld      = $2"<Usage: go mlbase_var[.jnl] var mld"
+
+   define symbol cvar = $1
+
+   let ml_zvals    = Z[GZ=ml_var]
+   let ml_cell_bot = ml_zvals + (ml_zvals[k=@SHF:1]-ml_zvals)/2
+   let ml_cell_top = ml_zvals - (ml_zvals[k=@SHF:1]-ml_zvals)/2
+
+! extend MLD to the base of the grid cell
+
+   let ml_mld_mask    = IF ml_cell_top LT ml_mld THEN 1 
+   let ml_mld_extn_1  = ml_cell_bot * ml_mld_mask !because "K" will be the same
+   let ml_mld_kvals   = K[g=ml_mld_extn_1] + ml_mld_extn_1 * 0
+   let ml_mld_kzero   = ml_mld_kvals - ml_mld_kvals[k=1:`ml_mld_kvals,r=kend`@MAX]
+   let ml_mld_extn_z  = ml_mld_extn_1 * ml_mld_kzero[k=@WEQ:0]
+   let mld_extn       = ml_mld_extn_z[k=@SUM]
+
+! find Temp at base of ML
+
+   let ml_bot_mask    = IF ml_cell_top GE ml_mld THEN 1
+   let ml_var_bot     = ml_var * ml_bot_mask
+   let ml_var_kvals   = k[g=ml_var_bot] + ml_var_bot * 0
+   let ml_var_kzero   = ml_var_kvals - ml_var_kvals[k=1:`ml_var_kvals,r=kend`@MIN]
+   let ml_var_base_z  = ml_var_bot * ml_var_kzero[k=@WEQ:0]
+   let ($cvar)_mlbase = ml_var_base_z[k=@SUM]
+
+   set mode/last verify
diff --git a/jnls/contrib/mld_dens.jnl b/jnls/contrib/mld_dens.jnl
new file mode 100644
index 0000000..576a712
--- /dev/null
+++ b/jnls/contrib/mld_dens.jnl
@@ -0,0 +1,72 @@
+\ cancel mode verify
+!
+! Description : To find Mixed Layer Depth (MLD) based on density criteria.
+!               MLD is defined here as the depth at which the density 
+!               increases from that at surface by an amount equal to the
+!               increase in density caused by the given (or the 1^oC default
+!               value) decrease in temperature. Please note that salinity
+!               will be the surface salinity and the densities are referenced
+!               to actual depth.
+!
+! Arguments   : Mandatory : $1 - salinity variable
+!                         : $2 - temperature variable
+!             : Optional  : $3 - delta_T : amount of temperature decrease 
+!                                          (default is 1^oC)
+!
+! Usage       :  yes? GO mld_dens temp, salt, 0.5            ! <---- CORRECT 
+!
+!                yes? GO mld_dens temp[d=1], salt[d=2], 0.5  ! <---- WRONG
+!
+!                the resulting MLD will be available in the variable "mld_d"
+!                
+! Note        : 1. Pressure/Density values will be found inside the script 
+!                  assuming that the temperature and salinity fields are on
+!                  proper Z-axis, with 'meters' units.
+!
+!               2. Variables defined here has a prefix of "dml_".
+!
+!               3. If you want to remove the Z-axis information from the MLD 
+!                  variable, use any of the following methods
+!
+!                   a) define a new variable and use Z=@AVE to eliminate the
+!                       Z-axis information (this will not change the MLD values
+!                       since there is only one value).
+!     
+!                       yes? let mld = mld_d[Z=@AVE]
+!
+!                   b) Use RESHAPE command with grid without Z-Axis (this may be 
+!                       bit slower than above method)  
+!
+!                       yes? let grid_xyt = x[gx=temp]*0+y[gy=temp]*0+t[gt=temp]*0
+!                       yes? let mld = RESHAPE(mld_d, grid_xyt)
+!
+! Example     :  yes? set data levitus_climatology
+!                yes? set reg/x=30:120/y=-30:30
+!                yes? go mld_dens salt, temp, 0.5
+!                yes? fill mld_d
+! 
+! Author : Jaison Kurian
+! Contact: jaison at caos.iisc.ernet.in
+! Date   : 04-MAR-2006
+! Modifications : None
+!----------------------------------------------------------------------------
+
+    let dml_sa = $1"<Usage: go mld_dens[.jnl] salt temp [delta_T]"
+    let dml_te = $2"<Usage: go mld_dens[.jnl] salt temp [delta_T]"
+    let dml_cr = $3"1.0"
+
+    let dml_press        = Z[GZ=dml_sa]
+    let dml_dens         = RHO_UN(dml_sa, dml_te, dml_press)     
+    let dml_temp_sfc     = dml_te[k=1]
+    let dml_salt_sfc     = dml_sa[k=1]
+    let dml_temp_sfc_m_cr= dml_temp_sfc - dml_cr   ! delta_T ^oC  <  that at sfc
+                                                   
+    ! If you want to refer the densities to the surface pressure, set the
+    ! the third argument to RHO_UN below to dml_press[k=1] or 0.
+                    
+    let dml_dens_at_mld  = RHO_UN(dml_salt_sfc, dml_temp_sfc_m_cr, dml_press) 
+    let dml_zero_at_mld  = dml_dens - dml_dens_at_mld
+    let mld_d            = dml_zero_at_mld[Z=@loc:0]
+
+    set var/title="MLD Based on Density criteria (delta_T = `dml_cr`^oC)"\
+           /units=meters mld_d
diff --git a/jnls/contrib/mld_temp.jnl b/jnls/contrib/mld_temp.jnl
new file mode 100644
index 0000000..6f506dd
--- /dev/null
+++ b/jnls/contrib/mld_temp.jnl
@@ -0,0 +1,71 @@
+\ cancel mode verify
+!
+! Description : To find Mixed Layer Depth (MLD) based on temperature criteria.
+!               MLD is defined here as the depth at which the temperature 
+!               changes from that at surface by 1^oC (default value) or the
+!               given delta_T. Temperature inversions > delta_T will be 
+!               taken careoff.
+!
+!               This MLD will be same as the commonly referred Isothermal
+!               Layer Depth (ILD) for the given delta_T.
+!
+! Arguments   : Mandatory : $1 - temperature variable
+!             : Optional  : $2 - delta_T : amount of temperature change 
+!                                          (default is 1^oC)
+!
+! Usage       :  yes? GO mld_temp temp, 0.5         ! <---- CORRECT 
+!
+!                yes? GO mld_temp temp[d=1], 0.5    ! <---- WRONG
+!
+!                the resulting MLD will be available in the variable "mld_t"
+!                
+! Note        : 1. The temperature field is assumed to be on proper Z-axis, 
+!                  with 'meters' units.
+!
+!               2. Variables defined here has a prefix of "tml_".
+!
+!               3. If you want to remove the Z-axis information from the MLD 
+!                  variable, use any of the following methods
+!
+!                   a) define a new variable and use Z=@AVE to eliminate the
+!                       Z-axis information (this will not change the MLD values
+!                       since there is only one value).
+!     
+!                       yes? let mld = mld_t[Z=@AVE]
+!
+!                   b) Use RESHAPE command with grid without Z-Axis (this may be 
+!                       bit slower than above method)  
+!
+!                       yes? let grid_xyt = x[gx=temp]*0+y[gy=temp]*0+t[gt=temp]*0
+!                       yes? let mld = RESHAPE(mld_t, grid_xyt)
+!
+! Example     :  yes? set data levitus_climatology
+!                yes? set reg/x=30:120/y=-30:30
+!                yes? go mld_temp temp, 0.5
+!                yes? fill mld_t
+! 
+! Author : Jaison Kurian
+! Contact: jaison at caos.iisc.ernet.in
+! Date   : 04-MAR-2006
+! Modifications : None
+!----------------------------------------------------------------------------
+
+    let tml_te = $1"<Usage: go mld_temp[.jnl] temp [delta_T]"
+    let tml_cr = $2"1.0"
+
+    let tml_temp_sfc     = tml_te[k=1]
+    let tml_temp_sfc_m_cr= tml_temp_sfc - tml_cr   ! delta_T ^oC < that at sfc
+    let tml_temp_sfc_p_cr= tml_temp_sfc + tml_cr   ! delta_T ^oC < that at sfc
+    let tml_zero_at_m_cr = tml_te - tml_temp_sfc_m_cr
+    let mld_m_cr         = tml_zero_at_m_cr[Z=@LOC:0]
+    let tml_zero_at_p_cr = tml_te - tml_temp_sfc_p_cr
+    let mld_p_cr         = tml_zero_at_p_cr[Z=@LOC:0]
+    let mld_p            = IF mld_p_cr THEN mld_p_cr ELSE mld_m_cr
+    let mld_m            = IF mld_m_cr THEN mld_m_cr ELSE mld_p_cr
+    let mld_t            = MIN(mld_p, mld_m)
+
+
+    set var/title="MLD based on Temperature criteria (delta_T = `tml_cr`^oC)"\
+           /units=meters mld_t
+
+    set mode/last verify
diff --git a/jnls/contrib/mp_lambert_az.jnl b/jnls/contrib/mp_lambert_az.jnl
new file mode 100644
index 0000000..2a719c9
--- /dev/null
+++ b/jnls/contrib/mp_lambert_az.jnl
@@ -0,0 +1,67 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_lambert_az.jnl --  Sets up variables for a Lambert Azimuthal equal area
+!                  projection using 'curvilinear coordinates' code in Ferret v4.50
+!	
+! contributed by:
+! Lev Tarasov
+! 6/10
+!uses equations from http://mathworld.wolfram.com/LambertAzimuthalEqual-AreaProjection.html
+! Description:  Sets up variables for a Lambert Azimuthal Equal Area map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_lambert_az [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_lambert_az
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_lambert_az
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_lambert_az `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet Rk = 1. +  sin(mp_phi0)*sin(mp_phi) + cos(mp_phi0)*cos(mp_phi)*cos(mp_lambda-mp_lambda0)
+let/quiet mp_R = EXP( 0.5*LN( 2./Rk ) )
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi0 = mp_standard_parallel * deg2rad
+
+let/quiet x_page = mp_R * cos(mp_phi) * sin(mp_lambda-mp_lambda0)                    ! eqn (1)
+let/quiet y_page = mp_R * cos(mp_phi0) * sin(mp_phi) - sin(mp_phi0) * cos(mp_phi) * cos(mp_lambda-mp_lambda0) !eqn 2
+
+let/quiet mp_mask = if Rk gt 0 then 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/contrib/mp_lambert_cc.jnl b/jnls/contrib/mp_lambert_cc.jnl
new file mode 100644
index 0000000..21c653d
--- /dev/null
+++ b/jnls/contrib/mp_lambert_cc.jnl
@@ -0,0 +1,70 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_lambert_cc.jnl --  Sets up variables for a Lambert Conformal Conic
+!                  projection using 'curvilinear coordinates' code in Ferret v4.50
+!	
+! contributed by:
+! Lev Tarasov
+! 6/10
+!uses equations from http://mathworld.wolfram.com/LambertConformalConicProjection.html
+! Description:  Sets up variables for a Lambert Conformal Conic map of the world
+!
+! Usage:                   arg1               arg2            arg 3      arg 4
+!  go mp_lambert_cc [central meridian] [ref parallel] [standard paralle1 and 2]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+! arg 3 - standard paralell 1 (latitude)
+! arg 4 - standard paralell 2 ("")
+
+! NOTE: there is no error checking on the argument bounds. Longitude
+! bounds likely vary with your grid definition (-180 to 180 or
+! 0 to 360), latitude is  -90 to 90
+
+! Example:
+!  use coads_climatology 
+!  go mp_lambert_cc long1 lat0 lat1 lat2
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+!
+
+!if `$2%0% gt 90` then
+!    query/ignore $3"<The standard parallel must be between -90 and 90"
+!elif `$2%0% lt (-90)` then
+!    query/ignore $3"<The standard parallel must be between -90 and 90"
+!endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1
+let/quiet mp_y = y
+let/quiet mp_central_parallel = $2
+let/quiet mp_standard_parallel = $2
+let/quiet mp_standard_parallel1 = $3
+let/quiet mp_standard_parallel2 = $4
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi0 = mp_central_parallel * deg2rad
+let/quiet mp_phi1 = mp_standard_parallel1 * deg2rad
+let/quiet mp_phi2 = mp_standard_parallel2 * deg2rad
+
+let/quiet RN =LN(cos(mp_phi1)/cos(mp_phi2)) / LN(tan(0.25*Pi + 0.5*mp_phi2)/tan(0.25*Pi + 0.5*mp_phi1) )   !eq 4
+
+let/quiet mRN = (-1.0)*RN
+let/quiet RF = cos(mp_phi1)*EXP( RN*LN(tan(0.25*Pi + 0.5*mp_phi1) ) ) / RN !eq 3
+
+let/quiet mp_R = RF * EXP( mRN*LN(tan(0.25*Pi + 0.5*mp_phi) ) )   !eq 5
+let/quiet mp_R0 = RF * EXP( mRN*LN(tan(0.25*Pi + 0.5*mp_phi0) ) ) !eq 6
+
+let/quiet x_page = mp_R * sin(RN*(mp_lambda-mp_lambda0))     ! eqn (1)
+let/quiet y_page = mp_R0 - mp_R * cos(RN*(mp_lambda-mp_lambda0)) !eqn 2
+
+let/quiet mp_mask = if mp_R gt 0 then 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/contrib/multi_view.jnl b/jnls/contrib/multi_view.jnl
new file mode 100644
index 0000000..e73dad5
--- /dev/null
+++ b/jnls/contrib/multi_view.jnl
@@ -0,0 +1,251 @@
+\ cancel mode verify
+!
+! DESCRIPTION: GO file to make multiple viewports with 
+!                    1. desired size/position.
+!                    2. four corner boxes (per viewport) for labeling
+!                    3. polygon commands to choose background color
+!                          and boundary line properties for corner boxes.
+!
+! REQUIRES : Ferret version 5.7 or higher (which supports /AXES qualifier
+!                to  "define view" and /RANGE qualifier to "REPEAT" commands.
+!
+! Some typical bugs/problems and theirs fixes
+! --------------------------------------
+!   1  segmentation fault : If you face this, and if you have a 
+!          "set mode metafile" command, then add a "cancel mode meta" towards 
+!          the end of the script. See
+!          http://ferret.pmel.noaa.gov/Ferret/Mail_Archives/fu_2006/msg00080.html
+!
+!   2  /SIGDIG qualifier to the CONTOUR command may not be effective
+!          sometimes. Then use the 4th argument to /LEVELS qualifier
+!              /LEVELS=(lo, hi, delta, ndigits)  & the usage is 
+!              ndigits = -1 for integer format
+!                      = -3 to omit numerical labels 
+!                      = 1/2/ for valid precision/significant digits
+!
+!   3  blank/white regions at edges of viewport : do any of the following
+!             - tune /hlimits or /vlimits
+!             - tune "set reg" command (set is slightly bigger than hlimits
+!                                         or vlimits)
+!             - first shade and then overlay with fill
+!             - just repeat the script once again, in the same ferret session.
+!          Also see mails, starting with this one : 
+!          http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2005/msg00148.html
+!
+!   4  some times polygone commands ( ($polf) of ($poll) ) does not work. Then
+!             - issue the polygon command twice. See example 2 below.
+!
+!   5. In some cases the polygon command will change colors of already drawn plots,
+!          on the screen (especially if you use rgb_colors go file). However, the
+!          metafile and resulting ps file will be just fine, but the gif file 
+!          (FRAME/FILE=mygiffile.gif) will be in bad shape.
+!
+! NOTES
+!      1.  To define two sets of viewports with similar features (position & size), 
+!               call multi_view two times with different values ONLY for the 9th 
+!               argument. See example 2 below.
+!
+!      2.  The ordering of viewports is shown towards the end of these comments. 
+!
+!      3.  The corer box will have suffixes like  ("*" is the viewport name).
+!                      *_bl  : bottom left
+!                      *_br  : bottom right
+!                      *_tr  : top    right
+!                      *_tl  : top    left
+!
+!               To put labels inside the corner boxes, use the predefined polygon
+!               commands ( ($polfl)  and ($poll) ). Remember that: 1. Xaxis and 
+!               Yaxis varies from 1 to 10, 2. xpol and ypol are variables to polygon
+!               command
+!
+!               set view v11_bl
+!                   ($polfl)/palette=white/color=1  xpol, ypol   ! white background 
+!                   label 4.5, 4.5, 0, 0, 0.35 @C010(a)
+! 
+!      4.  While using ($polfl), be careful not to give any commands which will
+!               alter the default ferret behavior (like using palette within /SET 
+!               environment and commands like "ppl tics" etc.).
+!
+! Default   1 : Just "go multi_view" (ie without any arguments) will define 15 
+! Behavior       viewports in 5 rows and 3 columns with names v11, v12,...v53
+!
+!           2 : There is no mandatory arguments for this go file ; all
+!                 arguments are optional.
+!
+!                          $1       $2      $3      $4       $5     $6       $7
+! USAGE :  go multi_view [rows],[columns],[xsize],[xstart],[xgap],[ysize],[ystart]
+!                        [ygap],[view_name_prefix],[CB_xsize],[CB_ysize] 
+!                           $8         $9              $10        $11
+!
+!             CB -> Corner Box
+!
+!          rows  : number of rows            columns : number of columns
+!          xsize : view size along X         ysize   : view size along Y
+!          xstart: xlo for lefternmost view  ystart  : ylo for bottommost view
+!          xgap  : spacing of view along X   ygap    : spacing of view along Y 
+!          prefix: prefix to view number     CB_xsize : xsize for corner box
+!                     default is "V"         CB_ysize : ysize for corner box
+!                            
+! EXAMPLE  1: ! 6 viewports of similar size  
+!               use coads_climatology
+!               set reg/l=1/x=30:120/y=-30:30
+!               set window/aspect=1.3
+!               go multi_view 5, 3, 0.25, 0.1, 0.03, 0.15, 0.10, 0.02, , 0.05,0.035 
+!               set view v11 ; ppl axlabp  1,-1 ; fill/nolab/line sst
+!               set view v12 ; ppl axlabp  1, 0 ; fill/nolab/line sst
+!               set view v13 ; ppl axlabp  1, 1 ; fill/nolab/line sst
+!               set view v21 ; ppl axlabp -1,-1 ; fill/nolab/line sst
+!               set view v22 ; ppl axlabp -1, 0 ; fill/nolab/line sst
+!               set view v23 ; ppl axlabp -1, 1 ; fill/nolab/line sst
+!            !How to use the corner boxes for labeling ?
+!            !     polfl --> think about polygon/fill/line
+!            !     poll  --> think about polygon/line
+!               set view v22_bl 
+!                 ($polfl)/pal=white/COLOR=1 xpol, ypol
+!                 label 4.3,4.3,0,0,0.35 @C010 (a)
+!               set view v23_br 
+!                 ($polfl)/palette=black/COLOR=1 xpol, ypol
+!                 label 4.3,4.3,0,0,0.35 @C011 (b) 
+!
+! Example 2: ! 2 sets of viewports, to plot MLD over depth-lat/lon section of temp.
+!            use levitus_climatology
+!            let zero_at_mld = temp[d=1] - (temp[d=1,k=1]-1)
+!            let mld         = zero_at_mld[Z=@LOC:0]
+!            go multi_view 1,2,0.30,0.12,0.03,0.35,0.4,0.01,VL,0.045,0.045
+!            go multi_view 1,2,0.30,0.12,0.03,0.35,0.4,0.01,VR,0.045,0.045
+!            palette=orange_purple ; PPL AXLSZE 0.12,0.12 ;  PPL AXNMTC 1,1
+!
+!            set view VL11 ; ppl axlabp -1,-1
+!              fill/vlim=0:150:20/hlim=54.5:75.5:5/nolab/lev=(15,29,1)/nokey temp[y=6N]
+!            set view VR11  
+!              plot/vlim=150:0:20/hlim=54.5:75.5:5/nolab/noaxes/color=10     mld[y=6N]
+!              set view VL11_bl
+!                 ($poll)/color=1 xpol, ypol  ;  ($poll)/color=1 xpol, ypol  
+!                 label 4.5,4.5,0,0,0.38 @C008 (a)
+!        
+!            set view VL12 ; ppl axlabp -1,0
+!              fill/vlim=0:150:20/hlim=79.5:100.5:5/nolab/lev=(15,29,1)      temp[y=6S]
+!            set view VR12  
+!              plot/vlim=150:0:20/hlim=79.5:100.5:5/nolab/noaxes/color=10    mld[y=6S] 
+!              set view VL12_bl 
+!                ($polfl)/palette=white xpol, ypol ; ($polfl)/palette=white xpol, ypol  
+!                label 4.5,4.5,0,0,0.38 @C008 (b) 
+!------------------------------------------------------------------------------
+!
+!                                               +-------+-------+-------+
+! Written By    : Jaison Kurian                 !  v11  |  v12  |  v13  |
+! Contact       : jaison at caos.iisc.ernet.in     +-------+-------+-------+
+!                 jaisonkurian at gmail.com        !  v21  |  v22  |  v23  |
+! Version       : multi_view                    +-------+-------+-------+
+! Date          : 27-FEB-2006                   !  v31  |  v32  |  v33  |
+! Comments      : None                          +-------+-------+-------+
+! Modifications : 2                             !  v41  |  v42  |  v43  |
+!                                               +-------+-------+-------+
+!                                               !  v51  |  v52  |  v53  |
+!                                               +-------+-------+-------+
+! Modifications :
+! ---------------
+!    1. On 15/Nov/2006 : Corner boxes for figure labelling have been added
+!                           with two additional arguments ($10 & $11).
+!
+!         +---+---------+ +-------------+ +-------------+ +---------+---+
+!         | A |         | |             | |             | |         | D |
+!         |---+         | |             | |             | |         +---|
+!         |             | |             | |             | |             |
+!         |             | |---+         | |         +---| |             |
+!         |             | | B |         | |         | C | |             |
+!         +-------------+ +---+---------+ +---------+---+ +-------------+
+!                                             
+!    2. On 14/Jun/2007 : Polygon commands were added to make the Figure labelling
+!                           easy (symbols "polfl" and "poll"). 
+!
+!-------------------------------------------------------------------------------
+!
+! define internal variables
+!
+    define symbol mv_r    = $1"5"      ! number of rows
+    define symbol mv_c    = $2"3"      ! number of columns
+    define symbol mv_xs   = $3"0.25"   ! X size
+    define symbol mv_xb   = $4"0.10"   ! X beginning
+    define symbol mv_xg   = $5"0.03"   ! X gap 
+    define symbol mv_ys   = $6"0.15"   ! Y size 
+    define symbol mv_yb   = $7"0.10"   ! Y beginning
+    define symbol mv_yg   = $8"0.02"   ! Y gap
+    define symbol mv_prefx= $9"v"      ! Prefix for the viewport name
+    define symbol mv_cbw  = $10"0.07"  ! Corner box width
+    define symbol mv_cbh  = $11"0.07"  ! Corner box height
+!
+! Issue a warning message if request values does not fit in
+!
+    let mv_xh = `($mv_xb)+($mv_c)*($mv_xs)+(($mv_c)-1)*($mv_xg)`  ! X high
+    let mv_yh = `($mv_yb)+($mv_r)*($mv_ys)+(($mv_r)-1)*($mv_yg)`  ! Y high
+
+    IF `($mv_r) LT 1` THEN  ! minimum number of rows is 1
+          SAY ; SAY " ERROR (multi_view) : Number of rows should be > 0" ; SAY
+          EXIT/PROMPT
+    ENDIF 
+    IF `($mv_c) LT 1` THEN  ! minimum number of columns is 1
+          SAY ; SAY " ERROR (multi_view) : Number of columns should be > 0" ; SAY
+          EXIT/PROMPT
+    ENDIF 
+
+    IF `($mv_xb) GT 0.9 OR ($mv_xb) LT 0` THEN   ! upper/lower bound for xstart 
+          SAY ; SAY " ERROR (multi_view) : X_Start should be between 0.0 and 0.9" ; SAY
+          EXIT/PROMPT
+    ENDIF
+    IF `($mv_yb) GT 0.9 OR ($mv_yb) LT 0` THEN   ! upper/lower bound for ystart 
+          SAY ; SAY " ERROR (multi_view) : Y_Start should be between 0.0 and 0.9" ; SAY
+          EXIT/PROMPT
+    ENDIF
+    IF `mv_xh GT 1.0` THEN 
+          SAY 
+          SAY " ERROR (multi_view) : Exceeded Max Xsize --> "
+          SAY "       Reduce Number of Columns or Xsize/Xstart/Xgap...."
+          SAY ; EXIT/PROMPT
+    ENDIF
+    IF `mv_yh GT 1.0` THEN 
+          SAY 
+          SAY " ERROR (multi_view) : Exceeded Max Ysize --> "
+          SAY "       Reduce Number of  Rows or Ysize/Ystart/Ygap...."
+          SAY ; EXIT/PROMPT
+    ENDIF
+    IF `($mv_cbh) GE ($mv_ys)` THEN
+          SAY 
+          SAY " ERROR (multi_view) : Corner Box Height is > Ysize --> "
+          SAY "       Reduce Corner Box Height (arg 11) or increase Ysize (arg 6)."
+          SAY ; EXIT/PROMPT
+    ENDIF
+    IF `($mv_cbw) GE ($mv_xs)` THEN
+          SAY 
+          SAY " ERROR (multi_view) : Corner Box Width is > Xsize --> "
+          SAY "       Reduce Corner Box Width (arg 10) or increase Xsize (arg 3)."
+          SAY ; EXIT/PROMPT
+    ENDIF
+!
+! IF arguments are valid, define the viewports
+!
+    REPEAT/RANGE=1:`($mv_r)`:1/NAME=mv_ro ( ;\
+       let mv_ylo = ($mv_yb) + (($mv_r)-`mv_ro`)*($mv_yg) + (($mv_r)-`mv_ro`)*($mv_ys)     ;\
+       let mv_yhi = ($mv_yb) + (($mv_r)-`mv_ro`)*($mv_yg) + (($mv_r)-(`mv_ro`-1))*($mv_ys) ;\
+       REPEAT/RANGE=1:`($mv_c)`:1/NAME=mv_co (  ;\
+          let mv_xlo = ($mv_xb) + (`mv_co`-1)*($mv_xg) + (`mv_co`-1)*($mv_xs) ;\
+          let mv_xhi = ($mv_xb) + (`mv_co`-1)*($mv_xg) + `mv_co`*($mv_xs)     ;\
+          define view/axes/xlim=`mv_xlo`:`mv_xhi`/ylim=`mv_ylo`:`mv_yhi` ($mv_prefx)`mv_ro``mv_co` ;\
+          define view/axes/xlim=`mv_xlo`:`mv_xlo+($mv_cbw)`/ylim=`mv_ylo`:`mv_ylo+($mv_cbh)` ($mv_prefx)`mv_ro``mv_co`_bl ;\
+          define view/axes/xlim=`mv_xhi-($mv_cbw)`:`mv_xhi`/ylim=`mv_ylo`:`mv_ylo+($mv_cbh)` ($mv_prefx)`mv_ro``mv_co`_br ;\
+          define view/axes/xlim=`mv_xlo`:`mv_xlo+($mv_cbw)`/ylim=`mv_yhi-($mv_cbh)`:`mv_yhi` ($mv_prefx)`mv_ro``mv_co`_tl ;\ 
+          define view/axes/xlim=`mv_xhi-($mv_cbw)`:`mv_xhi`/ylim=`mv_yhi-($mv_cbh)`:`mv_yhi` ($mv_prefx)`mv_ro``mv_co`_tr ;\
+       ) ;\
+    )
+!
+! Define few polygon commands which will make the labelling easy
+!
+     define symbol polfl = POLYGON/fill/line/noaxes/nolab/nokey/vlim=1:10/hlim=1:10    
+     define symbol poll  = POLYGON/line/noaxes/nolab/nokey/vlim=1:10/hlim=1:10    
+     let xpol = XSEQUENCE({1,10,10,1,1})
+     let ypol = XSEQUENCE({1,1,10,10,1})
+!
+! Clean Up
+!    
+    cancel variable mv_* ; cancel symbol mv_*
+    set mode/last verify
diff --git a/jnls/contrib/multi_view_demo.jnl b/jnls/contrib/multi_view_demo.jnl
new file mode 100644
index 0000000..c65601e
--- /dev/null
+++ b/jnls/contrib/multi_view_demo.jnl
@@ -0,0 +1,358 @@
+\ cancel mode verify
+!
+! Description : Demo file to show the capabalities and usage of multi_view
+!                   GO file.
+!
+! Requires    : multi_view.jnl, coads_climatology, levitus_climatology in pwd
+!                 or Ferret search path.
+!
+! Usage       :   yes? go multi_view_demo
+!
+! Written By  :  Jaison Kurian
+! Written On  :  16/June/2007
+! Comments    :  None
+! Modifications : Ansley Manke 2-Jan-2014 Ferret v6.86: 
+!                 Fix incorrect syntax. No equals sign in
+!                   palette=rainbow2_cmyk
+!
+!-------------------------------------------------------------------------
+
+
+\  set mode verify
+
+   ! SOME INITIAL SET UP
+
+        use coads_climatology
+        set reg/x=30:120/y=-30:30/k=1
+        palette rainbow2_cmyk 
+        set window/clear 
+
+\  pause
+   ! LET US DEFINE 4 VIEWPORTS : 2 ROW & 2 COLUMN
+   !     WITH MINIMAL ARGUMENTS.....
+
+        go multi_view 2, 2, 0.34, 0.12, 0.05, 0.34, 0.12, 0.05
+
+\  pause
+   ! LET US MAKE A PLOT IN UPPER LEFT VIEW : V11 --> DEFAULT NAME  
+
+        set view v11 ; ppl axlabp 1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=3]
+            go land
+
+\  pause 
+   ! NOW, IN UPPER RIGHT VIEW : V12 --> DEFAULT NAME
+
+        set view v12 ; ppl axlabp 1,1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=4]
+            go land
+
+\  pause 
+   ! NOW, IN LOWER TWO : V21 & V22
+
+        set view v21 ; ppl axlabp -1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=5]
+            go land
+
+        set view v22 ; ppl axlabp -1,1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=6]
+            go land
+
+\ pause 
+   ! THERE IS LOT OF WHITE SPACE BETWEEN THE VIEWPORTS. LET US REMOVE
+   !   IT BY ADJUSTING "xgap" and "ygap"
+  
+   !    go multi_view 2, 2, 0.34, 0.12, 0.05, 0.34, 0.12, 0.05      Prev. one
+   !                                    ####              ####   
+        go multi_view 2, 2, 0.34, 0.12, 0.025,0.34, 0.12, 0.03, vv
+
+   ! THE LAST ARGUMENT "vv" is used here just to avoid 
+   !    "Re-defining viewport" Message on terminal.
+\ pause 
+\ ppl shaset reset ; set window/clear
+        set view vv11 ; ppl axlabp 1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=3]
+            go land
+        set view vv12 ; ppl axlabp 1,1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=4]
+            go land
+        set view vv21 ; ppl axlabp -1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=5]
+            go land
+        set view vv22 ; ppl axlabp -1,1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=6]
+            go land
+
+\  pause
+!---------------------------------------------------------------------------- 
+\  set reg/x=150:280/y=-20:20/k=1 
+
+   ! NOW LET US SEE HOW TO INSERT FIGURE NUMBER AT CORNERS OF VIEWPORT
+   
+        go multi_view 2, 2, 0.34, 0.12, 0.025,0.34, 0.12, 0.03, vb
+
+\ ppl shaset reset ; set window/clear
+
+        set view vb11 ; ppl axlabp 1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=3]
+            go land
+
+   ! LET US PLACE THE LABEL ON BOTTOM-LEFT CORNER. REMEBMER THAT THE
+   !     X & Y AXES OF THE SMALL CORNER BOX VARIES FROM 1-10 FOR 
+   !     EASY "x","y" VALUES FOR THE     LABEL   COMMAND
+
+   !  vb11_bl  -->  "vb11" is parent view and "_bl" indicates BOTTOM-LEFT
+
+   !  ($polfl)  -->  POLYGONE/FILL/LINE   predefined polygon command
+   !  xpol      -->  predefined  polygon x-variable
+   !  ypol      -->  predefined  polygon y-variable
+
+   !  ALWAYS USE VERY BIG FONT SIZE SINCE THE VIEWPORT SIZE IS VERY SMALL
+
+\ pause 
+        set view vb11_bl 
+        ($polfl)/pal=white/color=1  xpol, ypol
+        label 5,4.5,0,0,0.55 @C007A
+
+\ pause
+   ! LET US TUNE THE FIGURE NUMBER AREA 
+   
+   !  go multi_view 2, 2, 0.34, 0.12, 0.025,0.34, 0.12, 0.03, vb   Prev. one
+   !                                                                  ##    ##
+      go multi_view 2, 2, 0.34, 0.12, 0.025,0.34, 0.12, 0.03, vc, 0.04, 0.05 
+
+\ pause
+\ set window/clear
+        set view vc11 ; ppl axlabp 1,-1
+            fill/lev="(20,28,0.5),(28,30,0.25)"/nolab/nokey sst[l=3]
+            go land
+
+            set view vc11_bl 
+            ($polfl)/pal=white/color=1  xpol, ypol
+            label 5,4.2,0,0,0.50 @C007A
+
+\ pause
+   ! NUMBERING WITH ONLY BOX LINING  
+
+            set view vc11_tl 
+            ($poll)/color=1  xpol, ypol
+            label 5,4.2,0,0,0.50 @C010B
+
+\ pause 
+
+!---------------------------------------------------------------------------- 
+\   use levitus_climatology ; cancel reg/all
+\   let zero_at_mld = temp[d=2] - (temp[d=2,k=1]-1)
+\   let mld         = zero_at_mld[Z=@LOC:0]
+\   palette orange_purple ; PPL AXLSZE 0.12,0.12 ;  PPL AXNMTC 1,1
+
+   ! LET US PLOT MLD OVER A DEPTH-LAT/LON SECTION OF TEMPERATURE.
+   !    HERE WE WILL DEFINE TWO IDENTICAL VIEWPORTS, WITH DIFFERENT
+   !    NAMES.
+   !                                              ##
+   go multi_view 1,2,0.30,0.12,0.03,0.35,0.4,0.01,VL,0.045,0.045
+   go multi_view 1,2,0.30,0.12,0.03,0.35,0.4,0.01,VR,0.045,0.045
+
+   ! PLEASE NOTE THAT WE WILL USE REVERSED /VLIMITS for MLD
+
+\ pause ; set window/clear
+
+   set view VL11 ; ppl axlabp -1,-1
+     fill/vlim=0:150:20/hlim=54.5:75.5:5/nolab/lev=(15,29,1)/nokey temp[y=6N]
+   set view VR11  
+     plot/vlim=150:0:20/hlim=54.5:75.5:5/nolab/noaxes/color=10     mld[y=6N]
+
+   ! LET US MAKE ONE MORE PLOT
+
+\ pause 
+
+   set view VL12 ; ppl axlabp -1,0
+     fill/vlim=0:150:20/hlim=79.5:100.5:5/nolab/lev=(15,29,1)      temp[y=6S]
+   set view VR12  
+     plot/vlim=150:0:20/hlim=79.5:100.5:5/nolab/noaxes/color=10    mld[y=6S]
+
+!---------------------------------------------------------------------------- 
+
+  ! Suppose you want to adjust axis labels without wasting precious journal 
+  !   space.....here is a small trick
+
+  ! See the Y-axis time labels in the following plot -->  
+
+\ set reg/y=-2:2/x=42.5:100
+  
+  go multi_view 1,1,0.45,0.12,0.01,0.35,0.50,0.01,vbb
+
+\ pause ; set window/clear
+
+  set view vbb11 ; ppl axlabp -1,-1 ; ppl txlabp -1
+     fill/line/pal=yellow_orange_brown\
+                   /nolab/lev=(1009,1015,0.5) slp[d=1,j=@AVE]
+
+\ pause 
+
+  ! We can tune it slightly....right ??
+
+  ! Here is the trick : Define two identical view ports with different
+  !     names.
+
+  go multi_view 1,1,0.45,0.12,0.01,0.35,0.10,0.01,vvb
+  go multi_view 1,1,0.45,0.12,0.01,0.35,0.10,0.01,vvc
+  
+  ! use the first view to make the plot without Y-axis labels
+
+\ pause 
+
+  set view vvb11 ; ppl axlabp -1,0 ; ppl txlabp 0
+     fill/line/pal=yellow_orange_brown\
+                   /nolab/lev=(1009,1015,0.5) slp[d=1,j=@AVE]
+
+\ pause
+
+  ! prepare the label fields
+
+  let mnames = TSEQUENCE({"J","F","M","A","M","J","J","A","S","O","N","D"})
+
+  ! use the second "dummy view to make an EMPTY plot
+  ! choose /vlimits=0:12 for easy y-coordinate values for labelling
+
+\ pause 
+  ! Looks good ??
+
+  set view vvc11
+      plot/vs/nolab/noaxes/vlimits=0:12/hlimits=1:10    100,100  
+      REPEAT/RANGE=1:12:1/NAME=yyl (;\
+         define symbol mm = `yyl`  ;\
+         label 0.8,`($mm)-0.5`,0,90,0.12 @C001`mnames[l=($mm)]` ;\
+      )
+
+!---------------------------------------------------------------------------- 
+
+! TWO different viewports side by side
+! 
+! Say you want to plot the zonal section of temperature and place a 
+!   time series of wind zonal wind speed, in such a way that there
+!   is direct correspondence between longitudes.
+!   
+!   BIGGER  view at bottom for temperature section
+!   SMALLER view at top    for zonal wind time series
+
+\ pause  ; set reg/Y=10/Z=0:300/l=6
+
+! good to start with the BIGGER BOTTOM  plot   --> VBOT
+!                                                ##    ##    ##   
+      go multi_view  1, 1, 0.55, 0.15, 0.01, 0.40, 0.20, 0.01, VBOT
+
+\ pause ; set window/clear ; ppl axlint 2,2 ; ppl axnmtc 0,0
+
+
+      set view VBOT11 ; ppl axlabp -1,-1 ; ppl axlsze 0.11,0.11
+         fill/hlim=54:74:2/lev=(10,29,1)/nolab temp[d=2]
+
+
+! How to define a matching viewport for time series?
+!
+!    for VB above, we had    :   ysize  = 0.40
+!                                ystart = 0.20
+!                                ygap   = 0.01
+!  
+!    --> the ystart for next view should be sum of above 3 plus the
+!           required gap between viewports (let it be 0.03), then
+!              0.40 + 0.20 + 0.01 = 0.61   ;  0.61+0.03 = 0.64
+! 
+!    --> the x variables (xsize, xstart, xgap) will REMAIN THE SAME
+!
+!  Let us define the top view, with a ysize of 0.15 and ystart of 0.64
+
+   !                                           ysize, ystart
+   !  go multi_view  1, 1, 0.55, 0.15, 0.01, 0.40, 0.20, 0.01, VBOT
+   !                                             ##    ##
+      go multi_view  1, 1, 0.55, 0.15, 0.01, 0.15, 0.64, 0.01, VTOP
+
+\ pause
+
+      set view VTOP11 ; ppl axlabp 1,-1 ; ppl axlsze 0.13,0.13
+         plot/hlim=54:74:2/vlim=6:10/color=2/nolab uwnd[d=1]
+
+!---------------------------------------------------------------------------- 
+\ pause ; set reg/l=1:12 ; set window/clear ; cancel viewport v*
+
+     ! Drawing LINE LEGENDS on time a time seris plot is not that easy. Lest us
+     !    see how we can do it comfortably with multi_view.  
+
+     ! Define the main viewport and make 3 time series plots
+ 
+     go multi_view 1,1,0.7,0.15,0.01,0.32,0.40,0.01,vts,0.03,0.04
+
+     set view vts11 
+        plot/vlim=26:31:0.5/nolab/color=1      sst[d=1,x=60,y=10]
+        plot/vlim=26:31:0.5/nolab/ov/color=2   sst[d=1,x=90,y=10]
+        plot/vlim=26:31:0.5/nolab/ov/color=4   sst[d=1,x=150,y=10]
+
+\   pause 
+  
+     ! Let us put the line legends within the plot area, to the top. 
+     !  --> define a similar viewport, with adjusted y-parameters
+
+     ! go multi_view 1,1,0.7,0.15,0.01,0.32,0.40,0.01,vts,0.03,0.04
+     !                                 ###  ###      ###
+       go multi_view 1,1,0.7,0.15,0.01,0.12,0.65,0.01,vlg,0.03,0.04
+
+     ! remember that the variables xpol and ypol varies 1-10 --> hence
+     ! you can easily pick the positions of lines and labels here.
+
+\    pause
+
+     set view vlg11
+        ($poll)/axes=0,0,0,0 xpol*0+100, ypol*+100
+        plot/vs/over/line/nolab/color=1 {2,3},{3,3}
+        label 3.2,2.8,-1,0,0.15 60^0E
+        plot/vs/over/line/nolab/color=2 {4,5},{3,3}
+        label 5.2,2.8,-1,0,0.15 90^0E
+        plot/vs/over/line/nolab/color=4 {6,7},{3,3}
+        label 7.2,2.8,-1,0,0.15 150^0E
+
+\ pause
+!---------------------------------------------------------------------------- 
+
+  !  HERE IS THE FINAL SHOW OFF.....
+
+  !  Question : Can you define 60  (read it carefully..ok   "60") viewports
+  !             on a Ferret window ?? 
+  !      
+  !             Suppose you had the patience to sit and write 60 lines of 
+  !             "define view" with arguments calculated to the 3rd or 4th
+  !             presion.....using your computer ...... and to make plots
+  !             in that viewports......fine.
+  ! 
+  !             If somebody ask you to change the spacing between viewports
+  !             "little bit" or increase the view size "slightly".....what 
+  !             will be your response ?? .......excuse me..
+  !
+  !     with multi_view it will take only < 1 minute ....
+  !
+  !  HERE YOU GO...........
+
+   go small_view 10,6,0.12,0.11,0.008,0.08,0.1,0.006, VS
+
+\  pause
+\  cancel mode verify
+
+   set reg/x=30:120/y=-30:30
+   palette rainbow2_cmyk
+   set window/aspect=1.3 ; set window/clear
+
+   ppl axlint 3,3 ; ppl axnmtc 0,0 ; ppl axlabp 0,0 ; ppl tics ,,,,1,1
+
+   let count = 0
+   REPEAT/RANGE=1:10:1/NAME=nrow (;\
+       REPEAT/RANGE=1:6:1/NAME=ncol (;\
+          let count = `count` + 1 ;\
+          let m_id  = IF `count/12 GT 1` THEN `count-12*int((count-1)/12)` ELSE `count` ;\
+          set view VS`nrow``ncol`    ;\
+          fill/lev=(20,30,1)/nolab/nokey sst[l=`m_id`,d=1] ;\
+          go land ;\
+          ppl shaset reset ;\
+       ) ;\
+   )
+
+  say ;  say "  ADIOS......." ; say
diff --git a/jnls/contrib/plot_vectors.jnl b/jnls/contrib/plot_vectors.jnl
new file mode 100644
index 0000000..f6a876e
--- /dev/null
+++ b/jnls/contrib/plot_vectors.jnl
@@ -0,0 +1,195 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: plot over vectors 
+!http://ferret.wrc.noaa.gov/Ferret/Mail_Archives/fu_2000/msg00513.html
+! Usage: go plot_vectors u v lon lat [skip] [fill]
+!                  
+!
+! Notes:  default skip = 1 (all vectors)
+!         u = zonal wind component
+!         v = meridional wind component
+!         lon = starting longitude of the vector 
+!         lat = starting latitude of the vector 
+!         Those arguments can be either 2D or 1D
+!        
+!         u, v, lon, lat can be either vectors or arrays
+!
+!         A vector key could be added but the scale is the 
+!         same as the previous plot.
+!
+! Example: use monthly_navy_winds.cdf
+!          go basemap " " " " " " " "  hollow
+!          go plot_vectors UWND[l=1] VWND[l=1] x[g=UWND]*y[g=UWND]*0+x[g=UWND]
+! x[g=UWND]*y[g=UWND]*0+y[g=UWND]
+!
+!          go basemap " " " " " " " "  hollow
+!          go plot_vectors UWND[l=1] VWND[l=1] x[g=UWND]*y[g=UWND]*0+x[g=UWND]
+! x[g=UWND]*y[g=UWND]*0+y[g=UWND] 10
+!
+!          go basemap " " " " " " " "  hollow
+!          go plot_vectors UWND[l=1] VWND[l=1] x[g=UWND]*y[g=UWND]*0+x[g=UWND]
+! x[g=UWND]*y[g=UWND]*0+y[g=UWND] 10 fill
+!
+!          go basemap " " " " " " " "  hollow
+!          let XPOS = {50,130,240,300,140,90,200,210,110,70}
+!          let YPOS = {10,-50,40,20,-10,0,40,70,-35,50}
+!          let U = {10,3,-12,8,15,6,-8,9,17,-8}
+!          let V = {-3,5,7,2,-3,10,-15,11,9,-12}
+!          go plot_vectors U V XPOS YPOS " " fill 
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: brock at lsce.saclay.cea.fr
+!
+! Creation: October 2000
+! Version: 1.0
+! History:
+! Modification:
+!
+! Ansley Manke October 2005 modify the definition of PV_nbvectors
+!                           and restore Patricks original arrow size of 0.3
+!**************************************************************
+
+say " "
+say "This script is superseded by the script vect_cylin.jnl or vect_cylin_over.jnl"
+say "which is available in the FAST scripts package at "
+say "http://dods.ipsl.jussieu.fr/fast/fiches/f00/f00.html"
+say " "
+say "Or see the scripts poly_vectors.jnl and mp_poly_vectors.jnl for vectors"
+say "drawn as filled polygons"
+say " "
+pause
+
+query/ignore $1%<Use: go plot_vectors u v lon lat [skip] [fill]%
+query/ignore $2%<Use: go plot_vectors u v lon lat [skip] [fill]% 
+query/ignore $3%<Use: go plot_vectors u v lon lat [skip] [fill]% 
+query/ignore $4%<Use: go plot_vectors u v lon lat [skip] [fill]% 
+
+if `$5%1% lt 1` then
+        message/continue "Error\! Must have option skip > 0"
+        exit
+endif
+
+!**************************************************************
+def sym PV_PI = 3.14159265
+def sym PV_DEG2RAD = `($PV_PI)/180`
+
+!**************************************************************
+
+
+let PV_u=xsequence (($1))
+let PV_v=xsequence (($2))
+let PV_lon=xsequence (($3))
+let PV_lat=xsequence (($4))
+
+! def sym PV_nbvectors=`PV_u,return=iend - PV_u,return=istart`
+let PV_nbv = `PV_u,return=iend` - `PV_u,return=istart` + 1
+def sym PV_nbvectors=`PV_nbv`
+
+!say `($PV_nbvectors)`
+
+!-----------------------
+! Select 1 vector on $5 (default = all)
+let PV_select0=mod(i[i=1:($PV_nbvectors)]-1,`$5%1%`) + 1 
+let PV_select1=if PV_select0 eq 1 then 1
+
+let PV_u1 = PV_u * PV_select1
+let PV_v1 = PV_v * PV_select1
+let PV_lon1 = PV_lon * PV_select1
+let PV_lat1 = PV_lat * PV_select1
+
+!-----------------------
+! take into account ratio (= ratioworld * ratioviewp)
+! to respect in everye case the head angle choosen 
+!-----------------------
+def sym PV_ratioworld = `(($YAXIS_MAX) - ($YAXIS_MIN))/(($XAXIS_MAX) - ($XAXIS_MIN))`
+def sym PV_ratioviewp = `($PPL$XLEN)/($PPL$YLEN)`
+def sym PV_ratio = `($PV_ratioworld)*($PV_ratioviewp)`
+! say ($PV_ratioworld) ($PV_ratioviewp) ($PV_ratio) 
+
+!-----------------------
+! vector points
+!           e 
+!         / | \
+!        a -|- b
+!           | 
+!           | 
+!           | 
+!           s 
+!-----------------------
+def sym PV_head_size = 0.3                        ! in percentage
+!def sym PV_head_size = 0.1                        !*ACM* 
+def sym PV_head_angle = `30*($PV_DEG2RAD)`            ! in degrees
+let PV_size = 0.1* ($PV_head_size) * (PV_u1^2 + (PV_v1/($PV_ratio))^2)^.5
+let PV_alpha = atan2(PV_v1/($PV_ratio),PV_u1)
+
+!-- point a
+let PV_headlon_a0 = cos(PV_alpha - ($PV_head_angle)) * PV_size * 1/cos(($PV_head_angle))
+let PV_headlat_a0 = sin(PV_alpha - ($PV_head_angle)) * PV_size * 1/cos(($PV_head_angle))
+
+let PV_headlon_a1 = PV_lon1 + PV_u1 - PV_headlon_a0  
+let PV_headlat_a1 = PV_lat1 + PV_v1 - PV_headlat_a0 * ($PV_ratio) 
+
+!-- point b
+let PV_headlon_b0 = sin(PV_alpha + ($PV_head_angle) - ($PV_PI)/2) * PV_size * 1/cos(($PV_head_angle))
+let PV_headlat_b0 = cos(PV_alpha + ($PV_head_angle) - ($PV_PI)/2) * PV_size * 1/cos(($PV_head_angle))
+
+let PV_headlon_b1 = PV_lon1 + PV_u1 + PV_headlon_b0 
+let PV_headlat_b1 = PV_lat1 + PV_v1 - PV_headlat_b0 * ($PV_ratio)
+
+!-- make the polygon vectors 
+let PV_dum = PV_u*0 + j[j=1:6]
+
+!-----------------------
+! normal vectors or filled head vectors
+if $6%false|fill>true|*>false% then
+
+  ! head filled in black
+  !-- gather points (pt_s--pt_e--pt_a--pt_b--pt_e--pt_s) 
+  let PV_headlon0 = if PV_dum eq 1 then PV_lon1 else PV_dum
+  let PV_headlon1 = if PV_dum eq 2 then PV_lon1+PV_u1 else PV_headlon0
+  let PV_headlon2 = if PV_dum eq 3 then PV_headlon_a1 else PV_headlon1
+  let PV_headlon3 = if PV_dum eq 4 then PV_headlon_b1 else PV_headlon2
+  let PV_headlon4 = if PV_dum eq 5 then PV_lon1+PV_u1 else PV_headlon3
+  let PV_headlon5 = if PV_dum eq 6 then PV_lon1 else PV_headlon4
+
+  let PV_headlat0 = if PV_dum eq 1 then PV_lat1 else PV_dum
+  let PV_headlat1 = if PV_dum eq 2 then PV_lat1+PV_v1 else PV_headlat0
+  let PV_headlat2 = if PV_dum eq 3 then PV_headlat_a1 else PV_headlat1
+  let PV_headlat3 = if PV_dum eq 4 then PV_headlat_b1 else PV_headlat2
+  let PV_headlat4 = if PV_dum eq 5 then PV_lat1+PV_v1 else PV_headlat3
+  let PV_headlat5 = if PV_dum eq 6 then PV_lat1 else PV_headlat4
+
+  polygon/nolab/over/pal=black/line/fill PV_headlon5, PV_headlat5, i[i=1:($PV_nbvectors)] 
+
+else
+
+  ! normal vectors
+  !-- gather points (pt_s--pt_e--pt_a--pt_e--pt_b--pt_e) 
+  let PV_headlon0 = if PV_dum eq 1 then PV_lon1 else PV_dum
+  let PV_headlon1 = if PV_dum eq 2 then PV_lon1+PV_u1 else PV_headlon0
+  let PV_headlon2 = if PV_dum eq 3 then PV_headlon_a1 else PV_headlon1
+  let PV_headlon3 = if PV_dum eq 4 then PV_lon1+PV_u1 else PV_headlon2
+  let PV_headlon4 = if PV_dum eq 5 then PV_headlon_b1 else PV_headlon3
+  let PV_headlon5 = if PV_dum eq 6 then PV_lon1+PV_u1 else PV_headlon4
+
+  let PV_headlat0 = if PV_dum eq 1 then PV_lat1 else PV_dum
+  let PV_headlat1 = if PV_dum eq 2 then PV_lat1+PV_v1 else PV_headlat0
+  let PV_headlat2 = if PV_dum eq 3 then PV_headlat_a1 else PV_headlat1
+  let PV_headlat3 = if PV_dum eq 4 then PV_lat1+PV_v1 else PV_headlat2
+  let PV_headlat4 = if PV_dum eq 5 then PV_headlat_b1 else PV_headlat3
+  let PV_headlat5 = if PV_dum eq 6 then PV_lat1+PV_v1 else PV_headlat4
+
+  polygon/nolab/over/line PV_headlon5, PV_headlat5, i[i=1:($PV_nbvectors)] 
+
+endif
+!-----------------------
+
+!**************************************************************
+! cancel sym PV_*
+! cancel var PV_* 
+
+!**************************************************************
+set mode/last verify
diff --git a/jnls/contrib/portraitNxN.jnl b/jnls/contrib/portraitNxN.jnl
new file mode 100644
index 0000000..55a59fb
--- /dev/null
+++ b/jnls/contrib/portraitNxN.jnl
@@ -0,0 +1,63 @@
+ 
+\can mod verify
+! portraitNxN.jnl
+! 17/06/99 Rodrigo Caballero rca at gfy.ku.dk
+ 
+! Description: Set up an arbitrary number of evenly-spaced viewports
+ 
+! Usage: GO portraitNxN #columns #rows [xmag] [ymag] [aspect]
+!  where:
+!  #columns: number of viewports accross page
+!  #rows: number of viewports down page
+!  xmag: horizontal magnification of viewports (as percentage; default=0)
+!  ymag: vertical magnification of viewports (as percentage; default=0)
+!  aspect: aspect ratio of page (default A4 paper)
+ 
+! Example:
+!  GO portraitNxN 5 8 40 50
+!  will set up 40 viewports (5 accross, 8 down) magnified by 
+!  40% horizontally and 50% vertically. The viewports are named
+!  using consecutive numbers starting with "1" for upper-left to
+!  "40" for lower-right.
+
+! Notes:
+! - The viewports are named using consecutive numbers. This is useful
+!   for making a series of consecutive plots; for instance:
+!   repeat/l=1:40 (set viewport `l`; shade field) 
+!   will plot 40 consecutive snapshots of variable "field", one in each 
+!   viewport.
+! - The script is set up to fill a European A4 page; American users  should
+!   uncoment the relevant line below. 
+
+! check that parameters are OK 
+query/ignore $1%<Use: GO portraitNxN #columns #rows [xmag] [ymag] [aspect]%
+query/ignore $2%<Use: GO portraitNxN #columns #rows [xmag] [ymag] [aspect]%
+
+let/quiet width=`(1+$3"0"/100)/$1`  
+let/quiet height=`(1+$4"0"/100)/$2`
+
+define axis/x=`width/2`:`1-width/2`/npoint=$1 xview
+define axis/y=`height/2`:`1-height/2`/npoint=$2 yview
+define grid/x=xview/y=yview gview
+let/quiet xv=x[g=gview]
+let/quiet yv=y[g=gview]
+let/quiet x1=xv-width/2  
+let/quiet y1=yv-height/2 
+let/quiet x2=xv+width/2  
+let/quiet y2=yv+height/2 
+let/quiet xx1=if x1 ge 0 then x1 else 0
+let/quiet yy1=if y1 ge 0 then y1 else 0
+let/quiet xx2=if x2 le 1 then x2 else 1
+let/quiet yy2=if y2 le 1 then y2 else 1  
+
+ppl/reset
+set win/as=$5"`296/210`" ! A4 paper        
+!set win/as=$5"`11/8.5`" ! 8 1/2 x 11  paper (uncomment as suitable)
+
+define region/default save
+can reg
+
+repeat/j=$2:1:-1 (repeat/i=1:$1 define view/xlim=`xx1`,`xx2`/ylim=`yy1`,`yy2` `i+($2-j)*$1`)
+
+set region save
+set mod/last verify
diff --git a/jnls/contrib/ratio_set.jnl b/jnls/contrib/ratio_set.jnl
new file mode 100644
index 0000000..2bfabf3
--- /dev/null
+++ b/jnls/contrib/ratio_set.jnl
@@ -0,0 +1,61 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: Set ratio and margins 
+!
+! Usage: go ratio_set [ratio] [margin=30] 
+!
+! Example: 
+!  yes? go ratio_set 2 25 
+!
+! Notes:
+!  * margin (as percentage of the smallest hor/vert side of the viewport; default=30)
+!
+! Calls: go margins 
+!
+! Author:
+! Contact: 
+!
+! Author: Patrick Brockmann 
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2005-01-07 10:54:00 -0800 (Fri, 07 Jan 2005) $ 
+! $Name$
+! $Revision: 8905 $
+! History:
+! Modification:
+!  * put ratio as optionnal
+!  * put default margins = 30
+!  * width calculation
+!         r*min(w,r*h)
+!
+!**************************************************************
+
+if $1"true|*>false" then
+   go margins reset
+   exit
+endif
+
+!**************************************************************
+def sym ME_ratio = $1
+if `($ME_ratio) lt -10 or ($ME_ratio) gt 10` then
+   message/continue Error\! Must have -10 <= ratio <= 10
+   exit 
+endif
+
+def sym ME_margin = $2%30%
+if `($ME_margin) lt 0 or ($ME_margin) gt 100` then
+   message/continue Error\! Must have 0 <= marg <= 100
+   exit 
+endif
+
+!**************************************************************
+def sym ME_plot_width = `(1-($ME_margin)/100)*min(($vp_width),($ME_ratio)*($vp_height))`
+def sym ME_plot_height = `($ME_plot_width)/($ME_ratio)`
+ppl axlen ($ME_plot_width), ($ME_plot_height)
+ppl origin `(($vp_width)-($ME_plot_width))/2`,`(($vp_height)-($ME_plot_height))/2` 
+
+!**************************************************************
+cancel sym ME_*
+
+!**************************************************************
+set mode/last verify
diff --git a/jnls/contrib/regressxy.jnl b/jnls/contrib/regressxy.jnl
new file mode 100644
index 0000000..0c2a65e
--- /dev/null
+++ b/jnls/contrib/regressxy.jnl
@@ -0,0 +1,46 @@
+\CANCEL MODE VERIFY 
+! Contributed by Andreas Schmittner 31 Oct 2001
+! Corrections by Jian Ma 08 Aug 2009
+!
+!
+! Description:  define FERRET variables for regression along the X and Y axis
+
+say ... Linear Regression In the XY Plane
+say ... Instructions:
+say Use the LET command to define new variables
+say Define the variable P as your independent (X) variable
+say Define the variable Q as your   dependent (Y) variable
+say Results will be variables "SLOPE", "INTERCEP" and "RSQUARE"
+say QHAT will be the regression estimate
+say Note: If "Y" is your independent variable then
+say ...   "SET GRID Q" after defining Q.
+say ... 
+
+let pq = p*q
+let pqmask = pq-pq  ! 0 or "missing" so all variables share the same
+missing
+let pmasked = p + pqmask
+let qmasked = q + pqmask
+let pp = pmasked*pmasked
+let qq = qmasked*qmasked
+
+let pave = pmasked[x=@ave,y=@ave]
+let qave = qmasked[x=@ave,y=@ave]
+let pqave = pq[x=@ave,y=@ave]
+let ppave = pp[x=@ave,y=@ave]
+let qqave = qq[x=@ave,y=@ave]
+
+let pvar  = ppave - pave*pave
+let qvar  = qqave - qave*qave
+let pqvar = pqave - pave*qave
+
+let slope = pqvar / pvar
+let intercep = qave - slope*pave
+let qhat = slope*p + intercep
+let rsquare = (pqvar*pqvar) / (pvar*qvar)
+let corr = pqvar/(pvar*qvar)^0.5
+
+SET MODE/LAST VERIFY
+
+
+
diff --git a/jnls/contrib/small_view.jnl b/jnls/contrib/small_view.jnl
new file mode 100644
index 0000000..4214597
--- /dev/null
+++ b/jnls/contrib/small_view.jnl
@@ -0,0 +1,145 @@
+\ cancel mode verify
+!
+! Called by multi_view_demo.jnl
+!
+! Description : GO file to make desired number of viewports with desired 
+!                 size/position for portrait/landscape mode.
+!
+! Notes   1   : Please note that the version of Ferret should be 5.6 or 
+!                 later one which supports /AXES qualifier to 
+!                 "define view" command and /RANGE qualifier to "REPEAT"
+!                 command.
+! 
+!         2   : Works well in portrait/landscape mode. Since /AXES qualifier is
+!                 used with "DEFINE VIEW" command, Ferret may show some peculiar
+!                 behaviour sometimes (http://ferret.pmel.noaa.gov/Ferret/
+!                 Mail_Archives/fu_2006/msg00080.html). 
+!
+!         3   : If the defined viewport is very small, /SIGDIG qualifier
+!                 to the CONTOUR command may not be effective. In this case
+!                 please use the fourth argument to /LEVELS qualifier to get
+!                 proper numeric labels for contours.
+!
+!                    /LEVELS=(lo, hi, delta, ndigits)  & the usage is 
+!
+!                    ndigits = -1 for integer format
+!                            = -3 to omit numerical labels 
+!                            = 1/2/ for valid precision/significant digits
+!
+!         4   : To define two set of viewports of similar features 
+!                 (position & size), call multi_view two times with 
+!                 different values for 9th argument (but exactly same 
+!                 values for arguments 1-8).  
+!
+!         5   : Internal variables to this GO file does have a prefix "mv_".
+!
+!
+! Default   1 : Just "go multi_view" (ie without any arguments) will 
+! Behaviour       define 15 viewports in 5 rows and 3 columns with 
+!                 names v11, v12,...v53
+!
+!           2 : There is no mandatory arguments for this go file ; all
+!                 arguments are optional.
+!
+!                                $1       $2      $3      $4       $5 
+! USAGE       :  go multi_view [rows],[columns],[xsize],[xstart],[xgap],
+!                                      [ysize],[ystart],[ygap],[prefix]
+!                                         $6      $7       $8      $9 
+! Example  1: 6 viewports of similar size  
+!                 use coads_climatology
+!                 set reg/l=1/x=30:120/y=-30:30
+!                 set window/aspect=1.3
+!                 go multi_view 5, 3, 0.25, 0.1, 0.03, 0.15, 0.10, 0.02 
+!                 set view v11 ; ppl axlabp  1,-1 ; fill/nolab/line sst
+!                 set view v12 ; ppl axlabp  1, 0 ; fill/nolab/line sst
+!                 set view v13 ; ppl axlabp  1, 1 ; fill/nolab/line sst
+!                 set view v21 ; ppl axlabp -1,-1 ; fill/nolab/line sst
+!                 set view v22 ; ppl axlabp -1, 0 ; fill/nolab/line sst
+!                 set view v23 ; ppl axlabp -1, 1 ; fill/nolab/line sst
+!
+! Example 2: 2 viewports of similar size (tune xstart & ystart to position it)
+!                 use coads_climatology
+!                 set reg/l=1/x=30:120/y=-30:30
+!                 set window/aspect=1.3
+!                 go multi_view 2, 1, 0.25, 0.25, 0.03, 0.15, 0.60, 0.02 
+!                 set view v11 ; ppl axlabp  1,-1 ; fill/nolab/line sst
+!                 set view v21 ; ppl axlabp -1,-1 ; fill/nolab/line sst
+! 
+!------------------------------------------------------------------------------
+!
+!                                               !-------|-------|-------|
+! Written By    : Jaison Kurian                 !  v11  |  v12  |  v13  |
+! Contact       : jaison at caos.iisc.ernet.in     !-------|-------|-------|
+!                 jaisonkurian at gmail.com        !  v21  |  v22  |  v23  |
+! Version       : multi_view                    !-------|-------|-------|
+! Date          : 27-FEB-2006                   !  v31  |  v32  |  v33  |
+! Comments      : None                          !-------|-------|-------|
+! Modifications : None                          !  v41  |  v42  |  v43  |
+!                                               !-------|-------|-------|
+!                                               !  v51  |  v52  |  v53  |
+!                                               !-------|-------|-------|
+!                                               
+!
+!-------------------------------------------------------------------------------
+
+! define internal variables
+
+    define symbol mv_r  = $1"5"      ! number of rows
+    define symbol mv_c  = $2"3"      ! number of columns
+    define symbol mv_xs = $3"0.25"   ! X size
+    define symbol mv_xb = $4"0.10"   ! X beginning
+    define symbol mv_xg = $5"0.03"   ! X gap 
+    define symbol mv_ys = $6"0.15"   ! Y size 
+    define symbol mv_yb = $7"0.10"   ! Y beginning
+    define symbol mv_yg = $8"0.02"   ! Y gap
+    define symbol prefx = $9"v"      ! Prefix for the viewport name
+
+! Issue a warning message if request values doesnot fit in
+
+    let mv_xh = `($mv_xb)+($mv_c)*($mv_xs)+(($mv_c)-1)*($mv_xg)`  ! X high
+    let mv_yh = `($mv_yb)+($mv_r)*($mv_ys)+(($mv_r)-1)*($mv_yg)`  ! Y high
+
+    IF `($mv_r) LT 1` THEN  ! minimum number of rows is 1
+          SAY ; SAY " ERROR (small_view) : Number of rows should be > 0" ; SAY
+          EXIT
+    ENDIF 
+    IF `($mv_c) LT 1` THEN  ! minimum number of rows is 1
+          SAY ; SAY " ERROR (small_view) : Number of columns should be > 0" ; SAY
+          EXIT
+    ENDIF 
+
+    IF `($mv_xb) GT 0.9 OR ($mv_xb) LT 0` THEN   ! upper/lower bound for xstart 
+          SAY ; SAY " ERROR (small_view) : X_Start should be between 0.0 and 0.9" ; SAY
+          EXIT
+    ENDIF
+    IF `($mv_yb) GT 0.9 OR ($mv_yb) LT 0` THEN   ! upper/lower bound for ystart 
+          SAY ; SAY " ERROR (small_view) : Y_Start should be between 0.0 and 0.9" ; SAY
+          EXIT
+    ENDIF
+    IF `mv_xh GT 1.0` THEN 
+          SAY 
+          SAY " ERROR (small_view) : Exceeded Max Xsize --> "
+          SAY "       Reduce Number of Columns or Xsize/Xstart/Xgap...."
+          SAY ; EXIT
+    ENDIF
+    IF `mv_yh GT 1.0` THEN 
+          SAY 
+          SAY " ERROR (small_view) : Exceeded Max Ysize --> "
+          SAY "       Reduce Number of  Rows or Ysize/Ystart/Ygap...."
+          SAY ; EXIT
+    ENDIF
+
+! IF arguments are valid, define the viewports
+
+    REPEAT/RANGE=1:`($mv_r)`:1/NAME=mv_ro ( ;\
+       let mv_ylo = ($mv_yb) + (($mv_r)-`mv_ro`)*($mv_yg) + (($mv_r)-`mv_ro`)*($mv_ys)     ;\
+       let mv_yhi = ($mv_yb) + (($mv_r)-`mv_ro`)*($mv_yg) + (($mv_r)-(`mv_ro`-1))*($mv_ys) ;\
+       REPEAT/RANGE=1:`($mv_c)`:1/NAME=mv_co (  ;\
+          let mv_xlo = ($mv_xb) + (`mv_co`-1)*($mv_xg) + (`mv_co`-1)*($mv_xs) ;\
+          let mv_xhi = ($mv_xb) + (`mv_co`-1)*($mv_xg) + `mv_co`*($mv_xs)     ;\
+          define view/axes/xlim=`mv_xlo`:`mv_xhi`/ylim=`mv_ylo`:`mv_yhi` ($prefx)`mv_ro``mv_co` ;\
+       ) ;\
+    )
+
+
+    set mode/last verify
diff --git a/jnls/contrib/surface_uv_from_ssh.jnl b/jnls/contrib/surface_uv_from_ssh.jnl
new file mode 100644
index 0000000..9cb9bbf
--- /dev/null
+++ b/jnls/contrib/surface_uv_from_ssh.jnl
@@ -0,0 +1,50 @@
+!---------------surface_uv_from_ssh.jnl------------------
+\ cancel mode verify
+! Contributed by Jaison Kurian jaison at caos.iisc.ernet.in 8/8/2005
+!
+! To compute surface geostrophic currents from satellite altimetry.
+!
+! (this data is obtained from ftp://ftp.cls.fr/pub/oceano/enact/msla/j1/
+!    & units is cm )
+!
+! For details of the eqns, please see
+!  http://oceanworld.tamu.edu/resources/ocng_textbook/chapter10/chapter10_03.htm
+!  http://oceanworld.tamu.edu/resources/ocng_textbook/chapter10/chapter10_02.htm
+!
+!--------------------------------------------------------------------------
+
+    set data hh_msla_oer_j1_h_20093.nc
+
+    let sla   = GRID_0001! name of the sea level anomaly variable in the file
+
+    let g     = 9.8      ! acceleration due to gravity (m/s2)
+    let pi=4*atan(1)     ! constant
+    let omega = 7.292E-5 ! Angular speed of rotation of Earth (rad/s)
+    let cm2m  = 1/100    ! convertion factor ==> from cm to m
+
+    let fc     = 2 * omega * sin(y[gy=sla]*pi/180.0) ! coriolis parameter
+                                                    ! 2*omega*sin(phi)
+    !
+    !        -g    d(eta)                g    d(eta)
+    !   Us = --- * ------   ;      Vs = --- * ------
+    !         fc   dY                   fc    dX
+    ! At equator fc --> 0 & hence 1/fc --> infinity....so mask the region
+    !    near equator using an IF condition
+    !   @DDC ==> centred derivative
+
+    let Us    = IF ABS(y[gy=sla]) GT 3.0 THEN (-1*(g/fc)*sla[Y=@DDC]*cm2m)
+    let Vs    = IF ABS(y[gy=sla]) GT 3.0 THEN (   (g/fc)*sla[X=@DDC]*cm2m)
+
+    set var/title="Surface Geostrophic U from Jason's SSH"/units=m Us
+    set var/title="Surface Geostrophic V from Jason's SSH"/units=m Vs
+
+    set reg/x=30:120/y=-30:30
+
+    vec/xskip=4/yskip=4/len=0.5 Us, Vs
+    go land
+
+    ! save data to a NetCDF file for future use
+    ! sp rm -f surface_uv_from_ssh.nc
+    ! save/file=surface_uv_from_ssh.nc/append   Us, Vs
+
+!------------end of surface_uv_from_ssh.jnl------------------
diff --git a/jnls/contrib/taylor_agraticule.jnl b/jnls/contrib/taylor_agraticule.jnl
new file mode 100644
index 0000000..177acfd
--- /dev/null
+++ b/jnls/contrib/taylor_agraticule.jnl
@@ -0,0 +1,60 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: Plot graticules (lines) at specified angles (relative to correlation)
+!
+! Usage: go taylor_agraticule rmax [PLOT qualifiers=/line=1] [amin=10] [amax=90] [adelta=10] [quadrants=1]
+!
+! arg 1: maximum radius of graticules 
+! arg 2: plot command qualifiers
+! arg 3: minimum angle of graticules
+! arg 4: maximum angle of graticules 
+! arg 5: delta angle of graticules
+! arg 6: quadrants (1 = normal diagram (R positive); 2 = full diagram (R negative & positive)
+!
+! Example:
+!           yes? go taylor_frame.jnl 3 0.2 " " "Standard Deviation (units)"
+!           yes? go taylor_agraticule.jnl 3 " " 10 90 10 
+!           yes? go taylor_agraticule.jnl 3 " " 91 99 1
+!
+! Notes:
+!
+! Calls: 
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: FAST_672_1_0 $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+let ME_rmax=$1
+def sym ME_qualifiers=$2%/line=1%
+let ME_amin=$3%10%
+let ME_amax=$4%90%
+let ME_adelta=$5%10%
+def sym quadrants $6%1%      !can be 1 (normal case) or 2 (when R's are negative & positive)
+
+
+! ----------------------------------------------
+let ME_angle  =  j/100
+let ME_xx = ME_rmax*cos(acos(ME_angle))
+let ME_yy = ME_rmax*sin(acos(ME_angle))
+repeat/j=`ME_amin`:`ME_amax`:`ME_adelta` plot/nolab/over/vs($ME_qualifiers) {0,`ME_xx`},{0,`ME_yy`}
+if ($quadrants%|2>TRUE|*>FALSE%) then
+  let ME_xx = ME_rmax*cos(acos(ME_angle*(-1)))
+  repeat/j=`ME_amin`:`ME_amax`:`ME_adelta` plot/nolab/over/vs($ME_qualifiers) {0,`ME_xx`},{0,`ME_yy`}
+endif
+
+
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
+
diff --git a/jnls/contrib/taylor_example1.jnl b/jnls/contrib/taylor_example1.jnl
new file mode 100644
index 0000000..cf837c6
--- /dev/null
+++ b/jnls/contrib/taylor_example1.jnl
@@ -0,0 +1,46 @@
+!**************************************************************
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: FAST_608_1_3 $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+set window 1
+
+go taylor_frame
+go taylor_polymark 2.4 0.6 /line/fill/pal=red
+go taylor_label 2.4 0.6 "MODEL"
+
+message
+
+go taylor_frame.jnl 3 0.2 " " "Standard Deviation (units)"
+go taylor_agraticule.jnl 3 " " 10 90 10 
+go taylor_agraticule.jnl 3 " " 91 99 1
+
+message
+
+go taylor_frame.jnl 2 0.25 " " "Standard Deviation (units)"
+go taylor_rgraticule.jnl 0.5
+go taylor_rgraticule.jnl 1.0 /line=2
+go taylor_rgraticule.jnl 1.5
+
+message
+
+go taylor_frame.jnl 3 .2 " " "Standard Deviation (units)"
+go taylor_agraticule.jnl 3 " " 10 90 10
+go taylor_agraticule.jnl 3 " " 91 99 1
+go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2 2.8 0.4
+go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4
+
+message
+
+go taylor_frame.jnl 3 .2 " " "Standard Deviation (units)" 2
+go taylor_agraticule.jnl 3 " " 10 90 10 2
+go taylor_agraticule.jnl 3 " " 91 99 1 2
+go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2 2.8 0.4 2
+go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4 2
+
diff --git a/jnls/contrib/taylor_example2.jnl b/jnls/contrib/taylor_example2.jnl
new file mode 100644
index 0000000..ce3625c
--- /dev/null
+++ b/jnls/contrib/taylor_example2.jnl
@@ -0,0 +1,13 @@
+
+set window 1
+
+go taylor_frame
+
+let a=xsequence({2.4, 0.8, 2.3 })
+let b=xsequence({0.6, 0.9, 0.8})
+let c=xsequence({"Mod1","Mod2","Mod3"})
+
+list a,b,c
+
+repeat/i=1:`a[i=@ngd]` (go taylor_polymark a b /line/fill/pal=red;  go taylor_label a b "_<NL>`c`")
+
diff --git a/jnls/contrib/taylor_example3.jnl b/jnls/contrib/taylor_example3.jnl
new file mode 100644
index 0000000..b875c31
--- /dev/null
+++ b/jnls/contrib/taylor_example3.jnl
@@ -0,0 +1,17 @@
+
+set window 1
+
+! Plot an accurate taylor frame with Correlation from 0.9 to 1.0
+go taylor_frame_accurate
+
+let a=xsequence({2.4, 0.8, 2.3 })
+let b=xsequence({0.96, 0.93, 0.98})
+let c=xsequence({"Mod1","Mod2","Mod3"})
+
+list a,b,c
+
+! Translate correlation values to classic correlation values from 0.0 to 1.0
+let b1=(b-0.9)*10.
+
+repeat/i=1:`a[i=@ngd]` (go taylor_polymark a b1 /line/fill/pal=red;  go taylor_label a b1 "_<NL>`c`")
+
diff --git a/jnls/contrib/taylor_frame.jnl b/jnls/contrib/taylor_frame.jnl
new file mode 100644
index 0000000..963fa41
--- /dev/null
+++ b/jnls/contrib/taylor_frame.jnl
@@ -0,0 +1,138 @@
+\cancel mode verify
+
+!**************************************************************
+! Description:
+!
+! Usage: go taylor_frame [max=3] [ticks=0.2] [format="(f4.1)"] [xy_label="Standard Deviation"] [quadrants=1]
+!
+! arg 1: maximum axis length (in user units) 
+! arg 2: delta (length) between major ticks
+! arg 3: ppl format for x and y axes
+! arg 4: Label on X and Y (r-axis) 
+!        (e.g.,  "Standard Deviation (Normalized)"
+!           or   "Standard Deviation (^oC)"
+! arg 5: quadrants (1 = normal diagram (R positive); 2 = full diagram (R negative & positive)
+!
+! Example: 
+!           yes? go taylor_frame.jnl 
+!           yes? go taylor_frame.jnl 3 .2 " " "Standard Deviation (units)"
+! 
+!           yes? go taylor_frame.jnl 3 .2 " " "Standard Deviation (units)"
+!           yes? go taylor_agraticule.jnl 3 " " 10 90 10
+!           yes? go taylor_agraticule.jnl 3 " " 91 99 1
+!           yes? go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2) 2.8 0.4
+!           yes? go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4
+!
+! Notes:
+!
+! Calls: go ratio_set
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: $
+! $Revision: 14123 $
+! History:
+! Modification:
+! Original implentation: James.Orr at cea.fr 
+!
+! Modified: James Orr, 6 May 2009 (to allow for 2 quadrants, i.e., negative R's)
+!******************************************************************~************
+
+go ratio_set 1
+
+let ME_rmax=$1%3%
+let ME_tick=$2%.2%
+def sym ME_axfmt=$3%(f4.1)%
+def sym ME_labaxis=$4%Standard Deviation%
+def sym quadrants $5%1%      !can be 1 (normal case) or 2 (when R's are negative & positive)
+
+if ($quadrants%|1>TRUE|*>FALSE%) then
+  let ME_haxbeg = 0
+else
+  let ME_haxbeg = `ME_rmax*(-1.)`
+endif
+
+! Draw 1 circle for axis extreme (maximum radius) 
+! -----------------------------------------------
+let ME_pi = atan(1.)*4.
+let ME_deg2rad = 2*ME_pi/180
+let ME_angle = (i-1)
+let ME_xx = ME_rmax*cos(ME_pi*ME_angle/(100*2))
+let ME_yy = ME_rmax*sin(ME_pi*ME_angle/(100*2))
+
+if ($quadrants%|1>TRUE|*>FALSE%) then
+  plot/set_up/nolab/i=1:101/line=1/hlimits=0:`ME_rmax`:`ME_tick`/vlimits=0:`ME_rmax`:`ME_tick`/vs ME_xx,ME_yy
+else
+  plot/set_up/nolab/i=1:201/line=1/hlimits=`ME_haxbeg`:`ME_rmax`:`ME_tick`/vlimits=0:`2*ME_rmax`:`ME_tick`/vs ME_xx,ME_yy
+endif
+
+ppl xfor "($ME_axfmt)"
+ppl yfor "($ME_axfmt)"
+ppl xlab "($ME_labaxis)"
+
+if ($quadrants%|1>TRUE|*>FALSE%) then
+  ppl ylab "($ME_labaxis)"
+  ppl axset  0,1,1,0
+else
+  ppl axset  0,1,0,0
+endif
+
+ppl plot
+
+! Plot simple vertical line (R=0)
+plot/over/nolab/line/thick=1/col=black/vs  {0,0}, {0, `ME_rmax`}
+
+! Label  curved "Correlation axis"
+! -----------------------------------------------
+if ($quadrants%|1>TRUE|*>FALSE%) then
+! Place label on right at 45 degrees (center of theta axis for quadrant 1)
+  let ME_xx = 1.08 * ME_rmax * cos(ME_pi/4)
+  let ME_yy = 1.08 * ME_rmax * sin(ME_pi/4) 
+  label `ME_xx` `ME_yy`  0 -45 .12 "Correlation"
+else
+! Place label at top center (just between 2 quadrants)
+  let ME_xx = 1.13 * ME_rmax * cos(ME_pi/2)
+  let ME_yy = 1.13 * ME_rmax * sin(ME_pi/2) 
+  label `ME_xx` `ME_yy`  0   0 .12 "Correlation"
+endif
+
+! Make ticks on curved "Correlation axis"
+! ----------------------------------------------
+let ME_angle  =  j/100
+let ME_xx = ME_rmax*cos(acos(ME_angle))
+let ME_yy = ME_rmax*sin(acos(ME_angle))
+repeat/j=10:90:10 plot/nolab/over/line=1/vs {`0.95*ME_xx`,`ME_xx`},{`0.95*ME_yy`,`ME_yy`}
+repeat/j=5:95:10 plot/nolab/over/line=1/vs {`0.97*ME_xx`,`ME_xx`},{`0.97*ME_yy`,`ME_yy`}
+repeat/j=91:99:1 plot/nolab/over/line=1/vs {`0.99*ME_xx`,`ME_xx`},{`0.99*ME_yy`,`ME_yy`}
+if ($quadrants%|2>TRUE|*>FALSE%) then
+  let ME_xx = ME_rmax*cos(acos(ME_angle*(-1)))
+  repeat/j=10:90:10 plot/nolab/over/line=1/vs {`0.95*ME_xx`,`ME_xx`},{`0.95*ME_yy`,`ME_yy`}
+  repeat/j=5:95:10 plot/nolab/over/line=1/vs {`0.97*ME_xx`,`ME_xx`},{`0.97*ME_yy`,`ME_yy`}
+  repeat/j=91:99:1 plot/nolab/over/line=1/vs {`0.99*ME_xx`,`ME_xx`},{`0.99*ME_yy`,`ME_yy`}
+endif
+
+! Label ticks on curved "Standard Deviation axis"
+! -----------------------------------------------
+let ME_xx = 1.01 * ME_rmax * cos(acos(ME_angle))
+let ME_yy = 1.01 * ME_rmax * sin(acos(ME_angle))
+let ME_angletext = 2*acos(ME_angle)/ME_deg2rad
+repeat/j=10:90:10 label `ME_xx` `ME_yy`  -1 `ME_angletext` .09 "`ME_angle`"
+repeat/j=95:95:1  label `ME_xx` `ME_yy`  -1 `ME_angletext` .09 "`ME_angle`"
+repeat/j=99:99:1  label `ME_xx` `ME_yy`  -1 `ME_angletext` .09 "`ME_angle`"
+! Do the equivalent operations for the 2nd quadrant (negative R values)
+if ($quadrants%|2>TRUE|*>FALSE%) then
+  let ME_xx = 1.01 * ME_rmax * cos(acos(ME_angle*(-1)))
+  let ME_angletext = 2*acos(ME_angle*(-1))/ME_deg2rad - 180
+  repeat/j=10:90:10 label `ME_xx` `ME_yy`  +1 `ME_angletext` .09 "`ME_angle*(-1)`"
+  repeat/j=95:95:1  label `ME_xx` `ME_yy`  +1 `ME_angletext` .09 "`ME_angle*(-1)`"
+  repeat/j=99:99:1  label `ME_xx` `ME_yy`  +1 `ME_angletext` .09 "`ME_angle*(-1)`"
+endif
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
+
diff --git a/jnls/contrib/taylor_frame_accurate.jnl b/jnls/contrib/taylor_frame_accurate.jnl
new file mode 100644
index 0000000..684664d
--- /dev/null
+++ b/jnls/contrib/taylor_frame_accurate.jnl
@@ -0,0 +1,90 @@
+\cancel mode verify
+
+!**************************************************************
+! Description:
+!
+! Usage: go taylor_frame_accurate [max=3]  [ticks=0.2]  [format="(f4.1)"]   [xy_label="Standard Deviation"]
+!
+! arg 1: maximum axis length (in user units) 
+! arg 2: delta (length) between major ticks
+! arg 3: ppl format for x and y axes
+! arg 4: Label on X and Y (r-axis) 
+!        (e.g.,  "Standard Deviation (Normalized)"
+!           or   "Standard Deviation (^oC)"
+!
+! Example: 
+!           yes? go taylor_frame_accurate.jnl 
+!           yes? go taylor_frame_accurate.jnl 3 .2 " " "Standard Deviation (units)"
+! 
+!           yes? go taylor_frame_accurate.jnl 3 .2 " " "Standard Deviation (units)"
+!           yes? go taylor_agraticule.jnl 3 " " 10 90 10
+!           yes? go taylor_agraticule.jnl 3 " " 91 99 1
+!           yes? go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2) 2.8 0.4
+!           yes? go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4
+!
+! Notes:
+!
+! Calls: go ratio_set
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2009/05/14 15:04:00 $
+! $Name: FAST_608_1_3 $
+! $Revision: 1.1.1.3 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+go ratio_set 1
+
+let ME_rmax=$1%3%
+let ME_tick=$2%.2%
+def sym ME_axfmt=$3%(f4.1)%
+def sym ME_labaxis=$4%Standard Deviation%
+
+! Draw 1 circle for axis extreme (maximum radius) 
+! -----------------------------------------------
+let ME_pi = atan(1.)*4.
+let ME_deg2rad = 2*ME_pi/180
+let ME_angle = (i-1)
+let ME_xx = ME_rmax*cos(ME_pi*ME_angle/(100*2))
+let ME_yy = ME_rmax*sin(ME_pi*ME_angle/(100*2))
+
+plot/set_up/axes=(0,1,1,0)/nolab/i=1:101/line=1/hlimits=0:`ME_rmax`:`ME_tick`/vlimits=0:`ME_rmax`:`ME_tick`/vs ME_xx,ME_yy
+ppl xfor "($ME_axfmt)"
+ppl yfor "($ME_axfmt)"
+ppl xlab "($ME_labaxis)"
+ppl ylab "($ME_labaxis)"
+ppl plot
+
+! Label  curved "Correlation axis"
+! -----------------------------------------------
+let ME_xx = 1.08 * ME_rmax * cos(ME_pi/4)
+let ME_yy = 1.08 * ME_rmax * sin(ME_pi/4) 
+label `ME_xx` `ME_yy`  0 -45 .12 "Correlation"
+
+! Make ticks on curved "Correlation axis"
+! ----------------------------------------------
+let ME_angle  =  j/100
+let ME_xx = ME_rmax*cos(acos(ME_angle))
+let ME_yy = ME_rmax*sin(acos(ME_angle))
+repeat/j=10:90:10 plot/nolab/over/line=1/vs {`0.95*ME_xx`,`ME_xx`},{`0.95*ME_yy`,`ME_yy`}
+repeat/j=5:95:10 plot/nolab/over/line=1/vs {`0.97*ME_xx`,`ME_xx`},{`0.97*ME_yy`,`ME_yy`}
+repeat/j=91:99:1 plot/nolab/over/line=1/vs {`0.99*ME_xx`,`ME_xx`},{`0.99*ME_yy`,`ME_yy`}
+
+! Label ticks on curved "Standard Deviation axis"
+! -----------------------------------------------
+let ME_xx = 1.01 * ME_rmax * cos(acos(ME_angle))
+let ME_yy = 1.01 * ME_rmax * sin(acos(ME_angle))
+let ME_angletext = 2*acos(ME_angle)/ME_deg2rad
+repeat/j=10:90:10 label `ME_xx` `ME_yy`  -1 `ME_angletext` .09 "`0.9+ME_angle/10.,P=3`"
+repeat/j=95:95:1  label `ME_xx` `ME_yy`  -1 `ME_angletext` .09 "`0.9+ME_angle/10.,P=3`"
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
+
diff --git a/jnls/contrib/taylor_label.jnl b/jnls/contrib/taylor_label.jnl
new file mode 100644
index 0000000..f685448
--- /dev/null
+++ b/jnls/contrib/taylor_label.jnl
@@ -0,0 +1,43 @@
+\cancel mode verify
+
+!**************************************************************
+! Description:
+!
+! Usage: go taylor_label Standard_Deviation Correlation "text" [justification=0] [character height=0.3] [angle=0]
+!
+! Example:
+!
+! Notes: * Takes into account height of character to set precisely the text
+!          Useful when you want to place with accuracy a letter as a identifier 
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: FAST_608_1_3 $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+let ME_std = $1
+let ME_cor = $2 
+let ME_x = ME_std*cos(acos(ME_cor))
+let ME_y = ME_std*sin(acos(ME_cor))
+
+def sym ME_text=$3
+def sym ME_just=$4%0%
+def sym ME_labheight=`$5%0.3%/2.54`   ! cm to inch
+def sym ME_angle=$6%0%
+
+!**************************************************************
+label `ME_x`,`ME_y-(($ME_labheight)/(($PPL$YLEN)-($PPL$YORG)))`,($ME_just),($ME_angle),($ME_labheight),"($ME_text)"
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
diff --git a/jnls/contrib/taylor_plot.jnl b/jnls/contrib/taylor_plot.jnl
new file mode 100644
index 0000000..9c88a1d
--- /dev/null
+++ b/jnls/contrib/taylor_plot.jnl
@@ -0,0 +1,43 @@
+\cancel mode verify
+
+!**************************************************************
+! Description:
+!
+! Usage: go taylor_plot Standard_Deviation Correlation [PLOT qualifiers]
+!
+! Example:
+!
+! Notes:
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: FAST_608_1_3 $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+let ME_std = $1
+let ME_cor = $2 
+let ME_x = ME_std*cos(acos(ME_cor))
+let ME_y = ME_std*sin(acos(ME_cor))
+
+if $3"false|*>true" then
+	define symbol ME_QUALIFIERS = /vs/over/nolab$3
+else
+	define symbol ME_QUALIFIERS = /vs/symb=20/over/nolab
+endif
+
+!**************************************************************
+plot($ME_QUALIFIERS) `ME_x`,`ME_y`
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
diff --git a/jnls/contrib/taylor_polymark.jnl b/jnls/contrib/taylor_polymark.jnl
new file mode 100644
index 0000000..b2f8052
--- /dev/null
+++ b/jnls/contrib/taylor_polymark.jnl
@@ -0,0 +1,51 @@
+\cancel mode verify
+
+!**************************************************************
+! Description:
+!
+! Usage: go taylor_polymark Standard_Deviation Correlation [polymark qualifiers] [values] [shape] [scale]
+!
+! Example:
+!
+! Notes: 
+!
+! Calls: go polymark
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: FAST_608_1_3 $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+let ME_std = $1
+let ME_cor = $2 
+let ME_x = ME_std*cos(acos(ME_cor))
+let ME_y = ME_std*sin(acos(ME_cor))
+
+def sym ME_value=$4%0%
+def sym ME_shape=$5%circle%
+def sym ME_scale=$6%1%
+
+if $3"false|*>true" then
+	define symbol ME_QUALIFIERS = /over/noaxis/nolab$3
+else
+	define symbol ME_QUALIFIERS = /over/noaxis/nolab
+endif
+
+!**************************************************************
+! say go polymark poly($ME_QUALIFIERS) `ME_x`,`ME_y`,($ME_value),($ME_shape),($ME_scale)
+
+go polymark poly($ME_QUALIFIERS) `ME_x`,`ME_y`,($ME_value),($ME_shape),($ME_scale) 
+
+!**************************************************************
+cancel variable XPOLYSHAPE,YPOLYSHAPE ! set by polymark script
+
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
diff --git a/jnls/contrib/taylor_rgraticule.jnl b/jnls/contrib/taylor_rgraticule.jnl
new file mode 100644
index 0000000..4b2b852
--- /dev/null
+++ b/jnls/contrib/taylor_rgraticule.jnl
@@ -0,0 +1,69 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: Plot graticules (lines) at specified radius (relative to standard deviation)
+!
+! Usage: go taylor_rgraticule rmin [PLOT qualifiers=/line=1] [rmax] [rdelta] [quadrants=1]
+!
+! arg 1: minimum radius of graticules
+! arg 2: plot command qualifiers
+! arg 3: maximum radius of graticules 
+! arg 4: delta radius of graticules
+! arg 5: quadrants (1 = normal diagram (R positive); 2 = full diagram (R negative & positive)
+!
+! Example:
+!           yes? go taylor_frame.jnl 2 0.25 " " "Standard Deviation (units)"
+!           yes? go taylor_rgraticule.jnl 0.5  
+!           yes? go taylor_rgraticule.jnl 1.0 /line=2 
+!           yes? go taylor_rgraticule.jnl 1.5 
+!           
+!           yes? go taylor_frame.jnl 3 0.2 " " "Standard Deviation (units)"
+!           yes? go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2) 2.8 0.4
+!           yes? go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4
+!
+! Notes:
+!
+! Calls: 
+!
+! Author: Patrick Brockmann
+! Contact: Patrick.Brockmann at ipsl.jussieu.fr
+! $Date: 2012-06-06 17:15:29 -0700 (Wed, 06 Jun 2012) $
+! $Name: $
+! $Revision: 14123 $
+! History:
+! Modification:
+!
+!**************************************************************
+
+let ME_rmin=$1
+def sym ME_qualifiers=$2%/line=1%
+let ME_rmax=$3%$1%
+let ME_rdelta=$4%$1%
+def sym quadrants $5%1%      !can be 1 (normal case) or 2 (when R's are negative & positive)
+
+! Draw 1 circle for axis extreme (maximum radius) 
+! -----------------------------------------------
+let ME_pi = atan(1.)*4.
+let ME_deg2rad = 2*ME_pi/180
+let ME_angle = (i-1)
+let ME_xx = cos(ME_pi*ME_angle/(100*2))
+let ME_yy = sin(ME_pi*ME_angle/(100*2))
+
+let ME_nb = 1+(ME_rmax-ME_rmin)/ME_rdelta
+let ME_rcurr = ME_rmin+(k-1)*ME_rdelta
+
+! Standard case (1st quadrant - do this in either case) 
+  repeat/k=1:`ME_nb`:1 ( plot/over/nolab/i=1:101/vs($ME_qualifiers) ME_rcurr*ME_xx, ME_rcurr*ME_yy )
+! Exceptional case (2 quadrants, i.e., when R values are negative) -- do this only for 2nd quadrant
+if ($quadrants%|2>TRUE|*>FALSE%) then
+  ! repeat/k=1:`ME_nb`:1 ( plot/over/nolab/i=1:201/vs($ME_qualifiers) ME_rcurr*ME_xx, ME_rcurr*ME_yy )
+  repeat/k=1:`ME_nb`:1 ( plot/over/nolab/i=1:101/vs($ME_qualifiers) ME_rcurr*ME_xx*(-1), ME_rcurr*ME_yy )
+endif
+
+!**************************************************************
+cancel variable ME_*
+cancel symbol ME_*
+
+!**************************************************************
+set mode verify
+
diff --git a/jnls/contrib/taylor_rmscircles.jnl b/jnls/contrib/taylor_rmscircles.jnl
new file mode 100644
index 0000000..62375b7
--- /dev/null
+++ b/jnls/contrib/taylor_rmscircles.jnl
@@ -0,0 +1,86 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: Plot RMS semicircles centered around data ref point on bottom axis
+!
+! Usage: go taylor_rmscircles rmin [PLOT qualifiers=/line=1] [rmax] [rdelta] [sigmadata] [maxsigma]
+!
+! arg 1: minimum radius for 1st RMS semicircle
+! arg 2: plot command qualifiers
+! arg 3: maximum radius last RMS semicircle
+! arg 4: delta radius of RMS semicircles
+! arg 5: standard deviation of data (or 1.0 in case of multi-variables with 1/sigma normalization)
+! arg 6: maximum on radial axis of Taylor plot (along which the "Correlation" label is written
+!        - this is the same value as the 1st argument to taylor_frame.jnl
+!
+! Example:
+!           yes? go taylor_frame.jnl 2 0.25 " " "Standard Deviation (units)"
+!           yes? go taylor_rgraticule.jnl 0.5  
+!           yes? go taylor_rgraticule.jnl 1.0 /line=2 
+!           yes? go taylor_rgraticule.jnl 1.5 
+!           
+!           yes? go taylor_frame.jnl 3 0.2 " " "Standard Deviation (units)"
+!           yes? go taylor_rgraticule.jnl 0.4 /DASH=(0.2,0.1,0.2,0.1)/COLOR=RED/THICK=2) 2.8 0.4
+!           yes? go taylor_rgraticule.jnl 0.2 /DASH=(0.2,0.1,0.2,0.1)/COLOR=BLACK/THICK=1 2.6 0.4
+!
+! Notes: In a Taylor diagram, there are concentric semicircles focused around the data reference
+!        point on the bottom axis.  This go script adds this feature to those written by
+!        P. Brockmann and J. Orr to make Taylor plots in Ferret (see Ferret FAQ). 
+!
+! Calls: 
+!
+! Author: James Orr
+! Contact: James.Orr at lsce.ipsl.fr
+! $Date: $
+! $Name: $
+! $Revision: $
+! History:  Modified from taylor_rgraticule.jnl (by Patrick Brockmann)
+! Modification:
+!
+!**************************************************************
+
+let ME_rmin=$1
+def sym ME_qualifiers=$2%/line=1%
+let ME_rmax=$3%$1%
+let ME_rdelta=$4%$1%
+let ME_sigmadata=$5%$1%
+let ME_maxsigma=$6%$1%
+
+! Draw 1 circle for axis extreme (maximum radius) 
+! -----------------------------------------------
+let ME_pi = atan(1.)*4.
+let ME_deg2rad = 2*ME_pi/180
+let ME_angle = (i-1)
+!let ME_xx = cos(ME_pi*ME_angle/(100*2))
+!let ME_yy = sin(ME_pi*ME_angle/(100*2))
+let ME_xx = cos(ME_pi*ME_angle/(100))
+let ME_yy = sin(ME_pi*ME_angle/(100))
+
+let ME_nb = 1+(ME_rmax-ME_rmin)/ME_rdelta
+let ME_rcurr = ME_rmin+(k-1)*ME_rdelta
+
+! To mask values to the right of the "Correlation" line (maxsigma):
+! Determine intersecting points of the two circles (Taylor Frame & each rms semicircle)
+! See http://www.sonoma.edu/users/w/wilsonst/Papers/Geometry/circles/default.html
+! --------------------------------------------------------------------------------
+! ME_xi and ME_yi are the intersecting values (ME_yi not needed for masking below)
+  let ME_xi = ME_sigmadata/2 + (ME_maxsigma^2 - ME_rcurr^2) / (2*ME_sigmadata)
+!  let ME_yi = ( ((ME_maxsigma^2 - ME_rcurr^2) - ME_sigmadata^2)*(ME_sigmadata^2 - (ME_rcurr - ME_maxsigma)^2) )^0.5 / (2*ME_sigmadata)
+
+! Coordinates for complete semicircles
+let ME_xrms = ME_rcurr*ME_xx + ME_sigmadata  !Add x offset = sigmadata
+let ME_yrms = ME_rcurr*ME_yy
+
+! Mask portion of semicircle to the right of the intersection point 
+let ME_xrmsm = if ME_xrms le ME_xi then ME_xrms  !Mask off values that extend beyond angular axis max
+let ME_yrmsm = if ME_xrms le ME_xi then ME_yrms  !Mask off values that extend beyond angular axis max
+
+repeat/k=1:`ME_nb`:1 ( plot/over/nolab/i=1:101/vs($ME_qualifiers) ME_xrmsm, ME_yrmsm )
+
+!**************************************************************
+ cancel variable ME_*
+ cancel symbol ME_*
+
+!**************************************************************
+ set mode verify
+
diff --git a/jnls/contrib/taylor_wtarea.jnl b/jnls/contrib/taylor_wtarea.jnl
new file mode 100644
index 0000000..1081bf7
--- /dev/null
+++ b/jnls/contrib/taylor_wtarea.jnl
@@ -0,0 +1,124 @@
+\cancel mode verify
+
+!**************************************************************
+! Description: Computes statistics for Taylor diagram (weights by area array defined a priori)
+!              Define FERRET variables Taylor Diagram Calculation (wt by area)
+!
+! Usage: 
+!
+! Example:
+!   yes? SET DATA coads_climatology
+!   yes? LET p = sst[x=180,y=0]; LET q = airt[x=180,y=0]
+!   yes? GO variance
+!   yes? list p, q
+!
+! Notes:
+!        ... Instructions to get Taylor Diagram variables: 
+!        See Taylor, K.E., Summarizing multiple aspects of model peformance in 
+!            a single diagam (JGR, 106, D7, 7183--7192,2001)
+!        Define variables P and Q as follows
+!         e.g. yes? LET/quiet P = model_field 
+!              yes? let/quiet q = dataref_field
+!              yes? let/quiet area_o = area * mask
+!        * IMPORTANT: P must be the model field and Q the data (reference) field!
+!        *            Both fields should have identical grids with identical masks
+!        *            (area is the surface area; mask = 1 if ocean, 0 if land)
+!
+! Calls: 
+!
+! Author: James Orr 
+! Contact: James.Orr at cea.fr
+! $Date: 2012-05-01 17:39:32 -0700 (Tue, 01 May 2012) $ 
+! $Name$
+! $Revision: 13851 $
+! History:
+! Modification:
+! 
+!**************************************************************
+
+let/quiet area_toto = area_o[i=@sum,j=@sum,t=@ave]
+say "Ocean area (should be ~3e+14 m^2):" `area_toto`
+! list area_toto
+
+! Wt. Averages, deviations, squared deviations, weighted sqared deviations
+! ------------------------------------------------------------------------
+!say ... taylor_wtarea: averaging
+let/quiet P_w = P * area_o/area_toto
+let/quiet Q_w = Q * area_o/area_toto
+let/quiet P_ave = P_w[i=@sum,j=@sum,k=@sum,l=@ave]
+let/quiet Q_ave = Q_w[i=@sum,j=@sum,k=@sum,l=@ave]
+let/quiet P_dev = P - P_ave
+let/quiet Q_dev = Q - Q_ave
+let/quiet P_dsq = P_dev * P_dev
+let/quiet Q_dsq = Q_dev * Q_dev
+let/quiet P_dsqW = P_dsq * area_o/area_toto
+let/quiet Q_dsqW = Q_dsq * area_o/area_toto
+
+! Differences, squared differences, weighted squared differences
+! --------------------------------------------------------------
+!say ... taylor_wtarea: dif
+let PmQ = P - Q
+let PmQ_SQ = PmQ * PmQ
+let PmQ_sqW = PmQ_SQ * area_o/area_toto
+let/quiet PmQ_dev = P_dev - Q_dev
+let/quiet PmQ_devsq = PmQ_dev * PmQ_dev
+let/quiet PmQ_devsqW = PmQ_devsq * area_o/area_toto
+ 
+! Weighted Variance, weighted std dev.
+! ------------------------------------
+!say ... taylor_wtarea: var
+!let/quiet/title="Variance of Model" P_var = P_dsq[i=@ave,j=@ave,k=@ave,l=@ave]
+let/quiet/title="Wt. Variance of Model" P_var = P_dsqW[i=@sum,j=@sum,k=@sum,l=@ave]
+let/quiet/title="Wt. Variance of Reference" Q_var = Q_dsqW[i=@sum,j=@sum,k=@sum,l=@ave]
+let/quiet/title="Wt. Std. Dev. of Model" P_sigma = P_var^.5
+let/quiet/title="Wt. Std. Dev. of Reference" Q_sigma = Q_var^.5
+
+! Wt. Regression coefficient
+! --------------------------
+!say ... taylor_wtarea: R
+let/quiet pq_dev = (P_dev * Q_dev) * area_o/area_toto
+let/quiet pq_sigma = P_sigma * Q_sigma
+let/quiet/title="Regression Coeff." Rcoeff = pq_dev[i=@sum,j=@sum,k=@sum,l=@ave] / pq_sigma
+
+! RMS
+! ---
+! (E_bar is Overall bias, E_prime is centered RMS difference, Erms is RMS difference)
+! Following are 2 consistency Tests (which you should check): 
+!      (1) Check if Erms^2 = Ebar^2 + Eprime^2
+!      (2) Check if Eprime^2 = P_sigma^2 + Q_sigma^2 - 2*P_sigma*Q_sigma*Rcoeff
+let E_bar = P_ave - Q_ave
+let E_prime =  (PmQ_devsqW[i=@sum,j=@sum,k=@sum,l=@ave])^.5
+let Erms =  (PmQ_sqW[i=@sum,j=@sum,k=@sum,l=@ave])^.5
+let Etest = (E_bar^2 + E_prime^2)^.5
+let E_primetest =  (P_sigma^2 + Q_sigma^2 - 2*P_sigma*Q_sigma*Rcoeff)^.5
+
+!list Erms, Etest, E_prime, E_primetest
+
+! Nondimensionalize by dividing sigma's and E's by Q_sigma (Conversely R is identical)
+! (Needed for comparing different types of fields on same Taylor Diagram)
+! ------------------------------------------------------------------------------------
+
+let Ehat = Erms/Q_sigma
+let Ehat_bar = E_bar/Q_sigma
+let Ehat_prime = E_prime/Q_sigma
+let Phat_sigma = P_sigma/Q_sigma
+
+set var/title="Overall bias (RMS)" E_bar
+set var/title="Centered RMS difference" E_prime
+set var/title="RMS difference" Erms
+set var/title="Normalized Overall bias (RMS)" Ehat_bar
+set var/title="Normalized Centered RMS difference" Ehat_prime
+set var/title="Normalized RMS difference" Ehat
+
+let/title="Normalized Std. Dev. of Model" Radi   = Phat_sigma
+let/title="Angle in radians (arcos(Regr. Coeff.))" Angle = acos (Rcoeff)
+
+!**************************************************************
+set mode verify
+
+
+
+
+
+
+
diff --git a/jnls/contrib/test_legend.jnl b/jnls/contrib/test_legend.jnl
new file mode 100644
index 0000000..52c46fc
--- /dev/null
+++ b/jnls/contrib/test_legend.jnl
@@ -0,0 +1,50 @@
+! test_legend.jnl
+! example call of the script legend.jnl
+
+! Contributed by Hein Zelle, 11-December-2003
+
+let one=3*x+2
+let two=x*x-5
+let three=0*x+3
+
+set region /x=-10:10
+
+set viewport ul
+plot /set_up /nolabel one,two,three
+ppl title "test plot"
+ppl xlab "X axis"
+ppl ylab "Y axis"
+go legend 1 "Variable one"
+go legend 2 "Variable two" 
+go legend 3 "Variable three"
+ppl plot
+
+set viewport ur
+plot /set_up /nolabel one,two,three
+ppl title "test plot"
+ppl xlab "X axis"
+ppl ylab "Y axis"
+go legend 1 "Variable one" ur
+go legend 2 "Variable two" ur
+go legend 3 "Variable three" ur
+ppl plot
+
+set viewport ll
+plot /set_up /nolabel one,two,three
+ppl title "test plot"
+ppl xlab "X axis"
+ppl ylab "Y axis"
+go legend 1 "Variable one" ll
+go legend 2 "Variable two" ll
+go legend 3 "Variable three" ll
+ppl plot
+
+set viewport lr
+plot /set_up /nolabel one,two,three
+ppl title "test plot"
+ppl xlab "X axis"
+ppl ylab "Y axis"
+go legend 1 "Variable one" lr
+go legend 2 "Variable two" lr
+go legend 3 "Variable three" lr
+ppl plot
diff --git a/jnls/contrib/variance-ellipses-bold.jnl b/jnls/contrib/variance-ellipses-bold.jnl
new file mode 100644
index 0000000..5898359
--- /dev/null
+++ b/jnls/contrib/variance-ellipses-bold.jnl
@@ -0,0 +1,221 @@
+! variance-ellipses-bold.jnl
+! Contributed by Billy Kessler PMEL, April 2005
+!
+! make variance ellipses overlaid on mean vectors
+! mean vectors and variance ellipses are scaled the same
+! ellipse is oriented along the axis of largest variance (Preisendorfer, Chap 2)
+! plots "significant" vectors (that extend outside the ellipse) thicker
+
+! the script makes 3 plots successively, of which only the last is of interest
+! this is necessary to make the aspect ratio of the plot consistent with the
+!    range of the data. The correct aspect ratio is essential to make the
+!    shape of the ellipses meaningful.
+! the problem is the need to convert data units to inches so as to scale the
+!    ellipses correctly, and the symbols ($xaxis_max) etc are only available
+!    after a plot has been made.
+
+! this script requires that the data grid has a free z axis!
+! it assumes that the data grid is (x,y,t)
+
+! note for publication-quality plots: The thicker "significant" vectors
+! produced by this script are fine for gifs, but are not thick enough when
+! converted to postscript (Fprint). To fix this, make your postscript, then
+! bring it up in a text editor. There will be 2 lines "2.000000 lw". Change
+! the first of these to "5.000000 lw". The resulting vectors will print well
+! in postscript or pdf.
+
+
+! if you use this script in a publication,
+! please credit William S. Kessler, NOAA/PMEL
+
+! --->>> Make your own local copy of variance-ellipses-bold.jnl
+! --->>> edit the section within the stars at the start of variance-ellipses-bold.jnl
+
+\cancel mode verify
+
+! *********************************************************************
+! values that must be chosen (edit here):
+
+use "/kdata/kessler/fsu/fsu61-99.cdf"	! choose data set
+
+! names for variables. 
+define symbol fvar tauxfsu		! name of file variable (to get grid)
+define symbol pvar1 tauxfsu		! name of working variable 1
+define symbol pvar2 tauyfsu		! name of working variable 2
+
+! choose scaling factors and other data-specific values
+define symbol l1 1			! first time gridpoint to use
+define symbol lf 456			! final time gridpoint to use
+define symbol xskp 2			! vector xskip argument
+define symbol yskp 1			! vector yskip argument
+define symbol vscl 100			! data unit scale (plot data*($vscl))
+define symbol unitlab "x10^-^2 N m^-^2"	! units of scaled data (for label)
+define symbol vlen 10			! vector length scale (also ellipses)
+define symbol ste1 .05			! major axis of scale ellipse (data
+define symbol ste2 .02			! minor axis of scale ellipse  units)
+! the last 2 only describe the scale ellipse key, in (unscaled) data units
+
+! choose axis limits
+define symbol axlim "xli=155w:75w:10/yli=0:25n:5"
+
+! choose data (i,j) limits for ellipse plotting
+! this allows ellipses to extend outside the plotting frame (ppl window,off)
+! this gives control over ellipses appearing at the edge of the viewport
+!     but the start/end values must be consistent with symbol axlim above!
+! a mindless first-look choice is to set these to grid mins/maxs,
+!     and comment out "ppl window,off" below. This will take a lot more time.
+define symbol i1 43			! start of i repeat loop
+define symbol i2 84			! end of i repeat loop
+define symbol j1 16			! start of j repeat loop
+define symbol j2 28			! end of j repeat loop
+
+! title text labels
+define symbol main_title "FSU winds 1961-99"
+define symbol title_subhead "Monthly Values"
+
+! axis labeling/ticking parameters and vector key label format
+define symbol axlint_axnmtc "ppl axlint,1,1;ppl axnmtc,1,4"
+define symbol veckey_format "(f3.0)"
+! *********************************************************************
+
+! make a dummy plot to get xlen and ylen
+vector/($axlim)/len=($vlen) ($pvar1)[l=1]*($vscl),($pvar2)[l=1]*($vscl)
+
+define symbol xdeg `($xaxis_max)-($xaxis_min)`
+define symbol ydeg `($yaxis_max)-($yaxis_min)`
+define symbol alasp `($ydeg)/($xdeg)`
+
+! now set correct aspect ratio and make second dummy plot
+!    to get the axis length in inches.
+! this is really stupid. Probably it would be better to just
+!    set these things by hand above
+set win/asp=($alasp):axis
+vector/($axlim)/len=($vlen) ($pvar1)[l=1]*($vscl),($pvar2)[l=1]*($vscl)
+
+define symbol xxlen `($ppl$xlen)`
+define symbol yylen `($ppl$ylen)`
+
+! these define the conversion from plot inches to lat/lon
+define symbol degpinx `($xdeg)/($xxlen)`
+define symbol degpiny `($ydeg)/($yylen)`
+say ($degpinx) ($degpiny)
+mess/q/cont The above values (inches/degree lat/lon) should be identical
+
+! thus get the conversion from data units to half-inch standard vector length
+define symbol duhi `($degpinx)/(2*($vlen))`
+
+! end of dummy plotting
+! ----------------------------------------------------------------------
+! make variances and covariance
+let/q xbar = ($pvar1)[l=($l1):($lf)@ave]
+let/q ybar = ($pvar2)[l=($l1):($lf)@ave]
+let/q txdm = ($pvar1)-xbar
+let/q tydm = ($pvar2)-ybar
+let/q xsq = txdm^2
+let/q ysq = tydm^2
+let/q xy = txdm*tydm
+
+let/q syy = ysq[l=($l1):($lf)@ave]
+let/q sxx = xsq[l=($l1):($lf)@ave]
+let/q sxy = xy[l=($l1):($lf)@ave]
+
+! make ellipse parameters
+! thetam is the variance ellipse rotation (principal angle). clockwise. (P2.9)
+let/q thetam = (-1)*0.5*atan2(2*sxy,sxx-syy)
+
+! major and minor axes of ellipse (P2.12)
+let/q amaj = (0.5*(sxx+syy+((sxx-syy)^2 +4*sxy^2)^.5 ))^.5
+let/q bmin = (0.5*(sxx+syy-((sxx-syy)^2 +4*sxy^2)^.5 ))^.5
+
+! construct the ellipse in 37 segments
+! must have a free z-axis
+let/q pi = 4*atan(1)
+define axis/z=1:361:10 zphi
+let/q rad = z[gz=zphi]*pi/180
+
+! ellipse points in the rotated reference frame
+let/q xell = amaj*cos(rad)*($vscl)
+let/q yell = bmin*sin(rad)*($vscl)
+
+! ellipse points in the longitude/latitude frame (rotate by thetam)
+! this ellipse is in units of scaled data ($vscl)
+let/q xellp = xell*cos(thetam) + yell*cos(thetam-pi/2)
+let/q yellp = xell*cos(thetam+pi/2) + yell*cos(thetam)
+
+! Now scale to lat/long units for overplotting on the map
+let/q xellpsc = if xellp then xellp * ($duhi) else 0
+let/q yellpsc = if yellp then yellp * ($duhi) else 0
+
+! place in correct location on map
+! place ellipse around vector head!
+let/q xx=x[gx=($fvar)]
+let/q yy=y[gy=($fvar)]
+let/q xellmap = if xellp then xellpsc+xx + xbar*($vscl)*($duhi) else 0
+let/q yellmap = if yellp then yellpsc+yy + ybar*($vscl)*($duhi) else 0
+
+! finally make the plot
+set mode ignore_error		! some ellipses may be blank. must ignore_error
+can mode verify			! avoid filling window with many messages
+
+vector/set/nolab/($axlim)/len=($vlen) xbar*($vscl),ybar*($vscl)
+($axlint_axnmtc)
+ppl veckey/nou,0,-.6,,(($veckey_format))
+ppl vector,($xskp),($yskp)
+
+label/nou 0 -1. -1 0 .12 ($unitlab)
+
+! identify the vectors that are "significant" (outside the variance ellipse)
+! imagine that the ellipse is centered at the vector TAIL for this calculation
+! find distance of vector head from all points of the ellipse:
+let dist=((xellp-xbar*($vscl))^2 + (yellp-ybar*($vscl))^2)^.5
+! find point on the ellipse closest to the vector head,
+! compare its distance from the ellipse center with the vector length
+let mindist=dist[z=@min]
+let zatmin=dist-mindist
+let integrandx=xellp*zatmin[k=@weq]
+let integrandy=yellp*zatmin[k=@weq]
+let xellmin=integrandx[z=@sum]		        ! (x,y)-values of ellipse at
+let yellmin=integrandy[z=@sum]		        ! closest point to vector
+let distellipse=(xellmin^2 +yellmin^2)^.5	! ellipse radius at closest pt
+let distvector=($vscl)*(xbar^2 +ybar^2)^.5	! vector length
+let xbarsig=if distvector ge distellipse then xbar    ! extract vectors only
+let ybarsig=if distvector ge distellipse then ybar    ! if larger than ellipse
+
+! overplot significant vectors in heavy line
+! comment out this line if bolding not wanted
+vector/set/nolab/over/len/col=7 xbarsig*($vscl),ybarsig*($vscl)
+ppl vector/over,($xskp),($yskp)
+
+! overplot ellipses
+! if i1,i2,j1,j2 chosen correctly -> allow ellipses to extend beyond viewport
+ppl window,off
+repeat/i=($i1):($i2):($xskp) repeat/j=($j1):($j2):($yskp) plot/vs/line=2/over/nolab xellmap,yellmap
+
+! plot titles
+label/nou `($ppl$xlen)/2` `($ppl$ylen)+.9` 0 0 .25 Mean and RMS of ($main_title)
+label/nou `($ppl$xlen)/2` `($ppl$ylen)+.4` 0 0 .18 ($title_subhead)
+
+! standard ellipse key scaled the same as standard vector
+let/q amaj1=($ste1)*($vscl)
+let/q bmin1=($ste2)*($vscl)
+let/q thetam1=-45*pi/180			! make it tilted 
+let/q xell1=amaj1*cos(rad)
+let/q yell1=bmin1*sin(rad)
+let/q xellp1 = xell1*cos(thetam1) + yell1*cos(thetam1-pi/2)
+let/q yellp1 = xell1*cos(thetam1+pi/2) + yell1*cos(thetam1)
+let/q xellpsc1 = ($duhi) * xellp1
+let/q yellpsc1 = ($duhi) * yellp1
+let/q xellmap1 = xellpsc1+`($xaxis_min)+(($xaxis_max)-($xaxis_min))/2`
+let/q yellmap1 = yellpsc1+`($yaxis_min)-($degpiny)*.8`
+ppl window,off
+plot/vs/line=2/over/nolab xellmap1,yellmap1
+
+label/nou `($ppl$xlen)/2+.5` -.75 -1 0 .12 Major/minor axes = `($ste1)*($vscl)` and `($ste2)*($vscl)` ($unitlab)
+label/nou `($ppl$xlen)/2+.5` -1. -1 0 .12 (Same scale as mean vectors)
+
+ppl window,on
+go land thick
+
+
+
+set mode/last verify
diff --git a/jnls/contrib/viewport_defn_tool b/jnls/contrib/viewport_defn_tool
new file mode 100644
index 0000000..536f06e
--- /dev/null
+++ b/jnls/contrib/viewport_defn_tool
@@ -0,0 +1,43 @@
+# contributed by Michael Spillane <spillane at panda.noaapmel.gov>
+# 21 June 1993
+#
+# viewport_defn_tool - script to produce a ferret viewport definition with
+#           the ferret lines needed written to "name".jnl
+#
+# usage: viewport_defn_tool px py ax ay ox oy dx dy name
+#                                  ___________________________
+# where px = page width            |<----------px----------->| ^
+#       py = page height           |     ....................| |
+#       ax = x-axis length         |     .  ferret margin   .| |
+#       ay = y-axis length         |     .   ____________   .| |
+#       ox = x-component of origin |     <mx>|  plot    | ^ .| |
+#       oy = y-component of origin |     .   | region   | ay.| py
+#       mx = ferret margin in x    |(ox,oy)->!__________| v .| |
+#       my = ferret margin in y    |     .             ^    .| |
+# all values in inches and         |     .             my   .| |
+#     name = name for viewport     |     ..............v.....| |
+#                                  |       overall page      | |
+# go "name"  will invoke viewport  |_________________________| v
+
+# viewport_defn_tool (or spawn viewport_defn_tool in ferret) without arguments will
+# display the usage and definition text above
+
+#! /bin/csh -f
+
+if ( $#argv < 9 ) then
+   head -19 viewport_defn_tool
+else
+   set jnl = $9:r.jnl
+
+   echo $1 $2 $3 $4 $5 $6 $7 $8 $9  | awk '{           \
+   origx = ($5-$7)/$1    ; origy = ($6-$8)/$2        ; \
+   clipx = ($5+$3+$7)/$1 ; clipy = ($6+$4+$8)/$2     ; \
+   str1  = "def view/size=1/orig=" ; str2 = "/clip=" ; \
+   print "ppl size",$1,$2 ; print "ppl axlen",$3,$4  ; \
+   print "ppl origin",$7,$8                          ; \
+   print str1 origx","origy str2 clipx","clipy,$9    ; \
+   print "set view",$9 }' >! $jnl
+endif
+
+# end of script
+
diff --git a/jnls/contrib/wind_barbs.jnl b/jnls/contrib/wind_barbs.jnl
new file mode 100644
index 0000000..e78de67
--- /dev/null
+++ b/jnls/contrib/wind_barbs.jnl
@@ -0,0 +1,76 @@
+! wind_barbs.jnl
+! Description: illustrates how to draw wind barbs "from scratch" using ALINE
+! (as an alternative to vector arrows)
+
+! 4/10/95 *sh*
+
+! Note that this does NOT cope with corrections for the aspect ratio of the
+! plot as VECTOR/ASPECT does.  It also does not cope with the added subtlety
+! that the aspect ratio effectively changes as a function of latitude
+! Those corrections could be applied in the same spirit as the shafts and
+! barbs below using these equations:
+
+! procedure:    at each point
+!          x --> xprime = A * x
+!          y --> yprime = B * y
+!       where
+!          x**2 + y**2 = xprime**2 + yprime**2
+!       and  A/B = s, a constant
+
+!       let dx          the range of data on the x axis
+!           dy          the range of data on the y axis
+!           aspect      the ratio of axis lengths ylen/xlen
+!           xscale      the scale factor (units/inch) on the x axis
+!           s           the ratio of scale factors, yscale/xscale
+!           tan         the ratio of the vector components y/x at any point
+!       then
+!           s = (dy/dx)/aspect
+
+!       and, from the constraints on the transformation, above
+!           B = { (1 + tan**2) / (s**2 + tan**2) } **.5
+!           A = s * B
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+! a basic FERRET vector plot to serve as a comparison
+set data coads_climatology
+set window 1
+set region/x=60w:20w/y=35n:55n/l=1
+vector uwnd,vwnd
+! **********************************
+
+
+! in a separate window (for comparison) we'll draw wind barbs
+
+! define variables to draw the shafts of the arrows
+let xstart = x[g=uwnd]+y-y
+let ystart = y[g=uwnd]+x-x
+let scale = 0.4    ! plotted degree per m/sec of wind
+let xend = xstart + uwnd*scale
+let yend = ystart + vwnd*scale
+
+! define variables to draw the barbs of the arrows
+let barb_length = 0.5
+let barb_angle = -0.2
+let line_angle = atan2(uwnd,vwnd)
+let angle = barb_angle + line_angle
+let ybarb = yend - COS(angle)*barb_length
+let xbarb = xend - SIN(angle)*barb_length
+
+! delete files left over from last time
+sp rm -f shafts.jnl barbs.jnl
+list/format=("ppl aline 1 ",4F7.2)/nohead/file=shafts.jnl xstart,ystart,xend,yend
+list/format=("ppl aline 1 ",4F7.2)/nohead/file=barbs.jnl xend,yend,xbarb,ybarb
+
+set wind 2
+vector/set_up uwnd,vwnd
+ppl pen 1,0	! invisible arrows
+ppl vector
+ppl pen 1,1
+
+cancel mode verify     ! avoid seeing a jillion arrows drawn
+GO shafts
+GO barbs
+set mode verify
diff --git a/jnls/examples/argo_zt.jnl b/jnls/examples/argo_zt.jnl
new file mode 100644
index 0000000..bbb01d3
--- /dev/null
+++ b/jnls/examples/argo_zt.jnl
@@ -0,0 +1,70 @@
+! argo_zt.jnl
+!
+! Description: 
+! For an ARGO float data file from http://www.usgodae.org/cgi-bin/argo_select.pl .
+! open the data, change the order of the axes, and define a time axis and levels
+! axis; regrid pressure and temp or other fields of interest to this ZT grid.
+! Call ZAXREPLACE to put the temperature or other field onto a pressure axis in Z
+!
+!                       arg 1         arg 2        arg 3        
+! usage:   GO argo_zt  filename   variable[temp]  [pressure-axis]
+! 
+! If argument 3 is not given then the pressureaxis is defined in this script
+!
+! Examples:
+!          yes? go argo_zt 2900622_prof.nc temp
+! 
+!          yes? define axis/z/units=decibars/depth z7 = {5,100,200,300,400,800,1200}
+!          yes? go argo_zt 900622_prof.nc psal z7
+!
+
+
+CANCEL DATA/ALL
+CAN MODE logo
+CANCEL MODE depth_label ! changes label on vertical axis from DEPTH to just Z
+SET WINDOW/SIZ=0.6
+
+USE/ORDER=ZT $1
+
+DEFINE SYMBOL data_var = ($2"temp")
+
+! Define a time axis based on JULD
+SHOW ATT/ALL juld
+
+DEF AXIS/T/T0="1-JAN-1950:00:00"/UNITS=days tday=juld
+
+LET zz=Z[GZ=($data_var)]
+DEF AXIS/Z/UNITS=levels/DEPTH zlev=zz
+
+! Put the variable and pressure on this corrected time-layer grid
+LET/UNITS="`pres,R=units`"/TITLE="`pres,R=title`"/BAD=`pres,R=bad` \
+    pressure=pres[gz=zlev at asn,gt=tday at asn]
+
+LET/UNITS="`($data_var),R=units`"/TITLE="`($data_var),R=title`"/BAD=`($data_var),R=bad` \
+    ($data_var)_zt=($data_var)[gz=zlev at asn,gt=tday at asn]
+
+SET VIEW ul
+SHADE pressure
+SET VIEW ll
+SHADE ($data_var)_zt
+
+! Define an output Z axis with units of pressure
+
+IF ($3"0|*>1") THEN
+   DEFINE SYMBOL press_ax = ($3)
+ELSE
+   DEFINE SYMBOL press_ax = zpres
+   DEFINE AXIS/Z/UNITS=decibars/DEPTH zpres= {5.,10.,15.,20.,25.,30.,34.,40.\
+,45.,50.,55.,60.,65.,70.,75.,80.,85.,90.,95.,100.,105.,110.,120.,130.,\
+140.,160.,180.,200.,225.,250.,275.,300.,325.,350.,375.,400.,450.,500.,\
+550.,600.,675.,750.,825.,900.,1000.,1100.,1200.}
+ENDIF
+
+! Call zaxreplace to put the variable on this new pressure axis
+
+LET/UNITS="`($data_var)_zt,R=units`"/TITLE="`($data_var)_zt,R=title`" \
+    var_on_pres = ZAXREPLACE(($data_var)_zt,pressure,Z[GZ=($press_ax)])
+
+SET VIEW ur
+SHADE var_on_pres
+
diff --git a/jnls/examples/bar_chart_demo.jnl b/jnls/examples/bar_chart_demo.jnl
new file mode 100644
index 0000000..83dab40
--- /dev/null
+++ b/jnls/examples/bar_chart_demo.jnl
@@ -0,0 +1,30 @@
+! bar_chart.jnl
+! *sh* 6/99
+! *acm* 7/01 update /xlimits to /hlimits
+
+! Description: demonstrate usage of bar charts
+
+set mode verify
+
+! most basic example -- no overlay, no axes
+let a = RANDN(I[i=1:8]) + 1
+go bar_chart3 poly/line/fill/nolabel/noaxis a a
+label/nouser 0.5,-.1,1,90,.16 @CRItem 1
+label/nouser 1.5,-.1,1,90,.16 @CRItem 2
+label/nouser 2.5,-.1,1,90,.16 @CRItem 3
+\pause
+
+! overlay two variables on auto-formatted axes
+let a = 1+RANDU(I[i=1:10])
+ppl axset 0,1,1,0  ! remove top and right axes
+plot/hlimits=0.5:10.5/sym/ylim=0:2/title="My Bars" 0*a+0.5
+go bar_chart3 poly/line/palette=red/overlay/title="My reds" a
+let b = RANDU(I[i=1:10]+1)
+go bar_chart3 poly/line/palette=blue/overlayy/title="My blues" b
+ppl axset 1,1,1,1  ! restore normal axes
+\pause
+
+! time series colored by magnitude
+let a = RANDN(T[T=2-jan-1990:1-jun-1990:24])
+plot/ylim=-3:3/title="hist-style plot" 0*a
+go bar_chart3 poly/over/palette=no_green_centered/levels=(-3,3,.5)/nolab a a
diff --git a/jnls/examples/binary_read_demo.jnl b/jnls/examples/binary_read_demo.jnl
new file mode 100644
index 0000000..7740f34
--- /dev/null
+++ b/jnls/examples/binary_read_demo.jnl
@@ -0,0 +1,102 @@
+set mode verify
+! 
+!binary_read_demo.jnl (4/99) *js*
+!
+
+!Description: Demonstration of v5.0 binary read capabilities
+
+!Usage: yes? GO binary_read_demo
+
+
+
+!
+!Create temporary file consisting of REAL*4 values 0:47
+!and create sample grid for this file
+!
+message
+
+def sym file sDemoPermutedBinaryTest.dat
+sp rm -f ($file)
+list/i=1:48/form=stream/file=($file) i-1
+canc data/all
+
+def axis/x=1:1:1 xax
+def axis/y=1:2:1 yax
+def axis/z=1:3:1 zax
+def axis/t=1:4:1 tax
+def grid/x=xax/y=yax/z=zax/t=tax mygrid
+
+!
+!Now load the file in "normal order." The first variable (num) should
+!contain the values 0:23, and the second variable will contain the
+!values 24:47
+!
+
+message
+file/format=stream/var=num,num1/grid=mygrid ($file)
+list num
+list num1
+
+!
+!Now the file will be loaded and permuted. In the following example,
+!the order is tzyx instead of the default of xyzt
+!
+message
+file/format=stream/var=num,num1/grid=mygrid/order=tzyx ($file)
+list num
+list num1
+
+!
+!Variables can also be part of the permutation. The 'v' option
+!can be used in the order qualifier. In the following example,
+!the order is vxyzt
+!
+message
+file/format=stream/var=num,num1/grid=mygrid/order=vxyzt ($file)
+list num
+list num1
+
+sp rm -f ($file)
+
+
+!
+!The following commands are used to determine if your system
+!is a big-endian or little-endian system. This is used to determine
+!which binary files to use for upcoming examples
+message
+def sym isbig ($BYTEORDER%|BIG>TRUE|*>FALSE%)
+if ($isbig) then def sym file int.dat else def sym file intSwapped.dat
+
+!
+!Now, read in a list of INTEGER*4 numbers. Note the addition of the
+!/type=i4 qualifier
+!
+message
+file/format=stream/var=num,num1/grid=mygrid/type=i4 ($file)
+list num
+list num1
+
+!
+!Same as before, but with INTEGER*2 (using /type=i2)
+!
+message
+if ($isbig) then def sym file short.dat else def sym file shortSwapped.dat
+file/format=stream/var=num,num1/grid=mygrid/type=i2 ($file)
+list num
+list num1
+
+!
+!Finally, we'll use a file of 24 INTEGER*2 followed by 24 REAL*8 numbers
+!and read it in using /type=i2,r8
+!
+message
+if ($isbig) then def sym file mixed.dat else def sym file mixedSwapped.dat
+file/format=stream/var=num,num1/grid=mygrid/type=i2,r8 ($file)
+list num
+list num1
+
+
+canc sym file
+set mode/last verify
+
+
diff --git a/jnls/examples/call_stack.jnl b/jnls/examples/call_stack.jnl
new file mode 100644
index 0000000..98ab5a6
--- /dev/null
+++ b/jnls/examples/call_stack.jnl
@@ -0,0 +1,18 @@
+! call stack.jnl to draw stack plot
+
+set win/siz=0.4
+can view
+
+set data "http://stout.pmel.noaa.gov/xwang_las_test-FDS/LAS/ndbc-adcp-44030/water_dir-ndbc-adcp-44030"
+
+! set a region ( this will be done elsewhere in LAS )
+set region/t=1-jun-2005:1-jul-2005/k=1:9
+
+
+go stack water_dir
+
+pause
+can view
+set reg/k=6:9
+
+go stack water_dir 0 499
diff --git a/jnls/examples/call_stack_stick.jnl b/jnls/examples/call_stack_stick.jnl
new file mode 100644
index 0000000..403830b
--- /dev/null
+++ b/jnls/examples/call_stack_stick.jnl
@@ -0,0 +1,18 @@
+set win/siz=0.4
+can view
+
+set data "http://stout.pmel.noaa.gov/xwang_las_test-FDS/LAS/ndbc-adcp-44030/water_spd-ndbc-adcp-44030"
+set data "http://stout.pmel.noaa.gov/xwang_las_test-FDS/LAS/ndbc-adcp-44030/water_dir-ndbc-adcp-44030"
+set region/t=1-jun-2005:1-jul-2005/k=1:9
+let dd = water_dir[d=2]
+let ss = water_spd[d=1]
+set win/siz=0.4
+set mode ver
+go water_vector_stack.jnl ss dd -40 40
+
+pause
+can view
+set region/k=5:9
+
+go water_vector_stack.jnl ss dd
+
diff --git a/jnls/examples/ccbar_demo.jnl b/jnls/examples/ccbar_demo.jnl
new file mode 100644
index 0000000..6aa1445
--- /dev/null
+++ b/jnls/examples/ccbar_demo.jnl
@@ -0,0 +1,77 @@
+! ccbar_demo.jnl (acm 5/02)
+
+! Description: demonstrate continuous colorbar on plots that use 
+! color fill and shade.
+
+! EXAMPLE 1:
+! Define a variable ranging from 0 to 6 and plot it in fine
+! detail with the default colorbar.  Note it doesn't look good 
+! at all, particularly on a small plot!
+
+DEFINE axis/x=0:200:1 xax 
+DEFINE axis/y=0:100:1 yax
+LET var=6*(X[GX=xax]+Y[GY=yax])/300
+FILL/LEV=(0,6,0.06)/TITLE="Default Colorbar" var  
+
+
+!We will replot the variable defined above, but hold off on the colorbar
+! First SET VIEW, so that the key can be added as a viewport 
+
+PAUSE
+SET VIEW full           ! this holds the actual plot
+FILL/LEV=(0,6,0.06)/TITLE="Continuous Colorbar"/NOKEY var
+
+! Plot the continuous colorbar, taking up the fraction of the window
+! from  x=0.93 to 0.96, y=0.2 to 0.8, and showing levels from 0 to 6,
+! with increments of 0.06.  Orient it vertically.
+
+GO ccbar  0.93,0.96,  0.2,0.8,  0,6,0.06, v 
+
+! EXAMPLE2:
+! Next a plot with a different palette, and a horizontal colorbar
+PAUSE
+CAN VIEW
+PPL SHASET RESET
+
+USE etopo60
+
+SET VIEW full
+SHADE/LEV=(-6000,6000,100)/AXES=1,1,1,1/NOKEY/PALETTE=land_sea rose
+
+! Locate the colorbar in x=0.12 to 0.6; y=0.9 to 0.94, and the range 
+! of data and palette matches what was used to plot the data.
+
+GO ccbar  0.12,0.6  0.9,0.94, -6000,6000,100, h, land_sea
+
+! EXAMPLE 3:
+! Next demonstrate the continuous colorbars on plots with viewports.
+PAUSE
+CAN VIEW
+PPL SHASET RESET
+
+! Let's go back to the variable created for the first plot,
+! and put that plot in two pre-defined viewports, UL and LR.
+
+DEFINE axis/x=0:200:1 xax 
+DEFINE axis/y=0:100:1 yax
+LET var=6*(X[GX=xax]+Y[GY=yax])/300
+  
+SET VIEW ul
+FILL/LEV=(0,6,0.06)/TITLE="Continuous Colorbar"/NOKEY/AXES=1,1,1,1/pal var
+
+SHOW VIEW ul
+ 
+! The viewport UL takes the fraction of the page from 
+! x=0 to 0.5, y=.5 to 1. Locate and size the key inside this.
+
+GO ccbar  0.44,0.46, 0.62,0.88,  0, 6, 0.06, v 
+
+! Similarly for a second viewport
+
+SET VIEW lr
+FILL/LEV=(0,6,0.06)/TITLE="Continuous Colorbar Demo"/NOKEY/AXES=1,1,1,1/pal var
+SHOW VIEW lr
+
+GO ccbar  0.94,0.96,  0.12,0.38  0,6,0.06,  v 
+
+
diff --git a/jnls/examples/coads_demo.jnl b/jnls/examples/coads_demo.jnl
new file mode 100644
index 0000000..730f3e9
--- /dev/null
+++ b/jnls/examples/coads_demo.jnl
@@ -0,0 +1,146 @@
+! coads_demo.jnl *jd* 11/91
+
+! Description: introduces and briefly explores the COADS climatological data 
+
+! COADS is the comprehensive ocean-atmosphere data set compiled at NCAR from
+! ship reports over the global ocean.  The monthly climatology introduced here 
+! represents a simple average of all data available for each month of the year
+! from 1946-1989.
+
+! Advanced use of FERRET commands in the demo will give you helpful examples
+! of their use.  See the User's Guide for more on individual commands.
+
+! 7/01 *acm* change uppercase GO LAND to GO land
+
+MESSAGE
+
+
+CAN REGION
+SET MODE VERIFY 
+SET DATA coads_climatology
+SHOW DATA coads_climatology
+
+! Note that 7 variables are available.  The grid is 2x2 degree, and global.
+
+MESSAGE
+
+SET REGION/Y=60S:80N
+SET WIND/SIZE=.6/ASPECT=.86
+PPL CROSS 1	! This PPL command causes the equator to be drawn in plots
+
+MESSAGE
+
+! Sea level pressure for the average July
+
+go rgb_rainbow
+SHADE/L=7 SLP
+GO land		
+
+MESSAGE
+
+! Overlay the July surface wind.
+
+VECTOR/OVER/L=7/LEN=10 UWND,VWND
+
+MESSAGE
+
+! The horizontal equations of motion on the rotating earth show that
+! acceleration of a parcel of air is dependent on the pressure gradient,
+! the coriolis force, and any friction retarding its motion.  Neglecting 
+! friction, a geostrophic wind may be defined, where the pressure gradient
+! force is balanced by the coriolis force.  Let's define variables ug and vg
+! to be that geostrophic wind, being careful to use common units of measure.
+
+LET RHO = 1.275                    ! Use a constant for air density for now
+LET OMEGA = 2*3.14159/86400        ! The angular velocity of the earth
+LET DPDX = SLP[X=@DDC]*100         ! Zonal pressure gradient (in SI units)
+LET DPDY = SLP[Y=@DDC]*100         ! Meridional pressure gradient
+LET C = 3.14159/180                ! Conversion factor -- radians/degree
+LET FC = 2*OMEGA*SIN(Y[G=SLP]*C)    ! The coriolis parameter
+
+LET/TITLE="VG" VG = IF ABS(Y) GT 5 THEN DPDX/(FC*RHO)
+LET/TITLE="UG" UG = IF ABS(Y) GT 5 THEN (-1)*DPDY/(FC*RHO)
+
+! The geostrophic wind is ill-defined near the equator as fc is 0 there.
+! This definition specifies ug and vg poleward of latitudes +/- 5 degrees.
+
+MESSAGE
+
+! The geostrophic wind
+
+VECTOR/LEN=10/L=7 UG,VG
+GO land
+
+MESSAGE
+
+! A bit noisy so let's smooth it 5 grid points in x
+
+LET UGS = UG[X=@SBX:5]
+LET VGS = VG[X=@SBX:5]
+VECTOR/LEN=10/L=7 UGS,VGS
+GO land
+
+MESSAGE
+
+! Here is the geostrophic wind field superimposed on sea level pressure.
+
+SHADE/L=7 SLP
+GO land
+VECTOR/LEN=10/OVER/L=7 UGS,VGS
+
+! If we now overlay the observed winds we see that they are often
+! subgeostrophic, that is, the coriolis force is not strong enough to 
+! balance the pressure gradient force (from high to low pressure),
+! possibly indicating presence of friction near the earth's surface.
+
+VECTOR/LEN=10/OVER/L=7 UWND,VWND
+
+MESSAGE
+
+! Here is the same plot for March
+
+SHADE/L=3 SLP
+GO land
+VECTOR/LEN=10/OVER/L=3 UGS,VGS
+VECTOR/LEN=10/OVER/L=3 UWND,VWND
+
+MESSAGE
+
+! And we can look more closely at a hemisphere
+
+SET REGION/Y=5:70
+SET WIND/ASP=.5
+
+SHADE/L=7 SLP
+VECTOR/LEN=10/OVER/L=7 UGS,VGS
+VECTOR/LEN=10/OVER/L=7 UWND,VWND
+PPL CROSS 0
+
+! The "land" go tool ("go land") is useful for continental outlines and has
+! been used several times in this demo.  There is another tool to fill 
+! the land masses with a dark grey color, "go fland".  A land mask is layed
+! over the plot, as in:
+
+MESSAGE
+
+GO fland
+
+! The "go land" tool can still be used, too.
+
+MESSAGE
+
+GO land
+
+MESSAGE
+
+! More exploration of global climate is possible using the COADS climatology. 
+! This demonstration uses a fixed value for the density of air.  Since 
+! pressure, temperature, and specific humidity are available, density could
+! be cast in a more complex functional form.  Models of the friction suggested
+! above can be tested.  And other explorations that come to mind.
+
+MESSAGE
+
+GO rgb_rainbow
+SET WINDOW/ASPECT=.86
+
diff --git a/jnls/examples/compass_rose.jnl b/jnls/examples/compass_rose.jnl
new file mode 100644
index 0000000..02deb39
--- /dev/null
+++ b/jnls/examples/compass_rose.jnl
@@ -0,0 +1,81 @@
+\CANCEL MODE VERIFY
+
+! *sh* 3-28-95
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+
+!Description: Demonstration of immediate mode expressions
+! This script uses immediate mode expressions to compute the placement
+! of tic marks and text labels for the creation of a compass rose
+! The size and location of the rose are arguments to the script
+
+! usage
+!	GO compass_rose [size_factor] [xcenter_inches] [ycenter_inches]
+
+! arguments:
+! size_factor - relative to a nominal size of "1" (default=1)
+! xcenter_inches - horizontal center of rose in PLOT+ inches (default=4)
+! ycenter_inches - vertical   center of rose in PLOT+ inches (default=3)
+
+! set up PLOT+ as if a plot had just been made
+SET WIND/CLEAR
+PLOT/HLIMITS=-2:2:1/VLIMITS=-2:2:1/nolabels/set_up 1
+PPL AXSET 0,0,0,0
+PPL xlab; ppl ylab
+PPL PLOT
+
+! define variables
+let/quiet size = $1"1"
+let/quiet xc = $2"4"
+let/quiet yc = $3"3"
+
+let/quiet r = 2 * size
+let/quiet pi = 3.141592
+let/quiet theta = (2*pi/32) * (i-1)
+
+let/quiet tiny = 0.1 * size
+let/quiet short = 0.2 * size
+let/quiet mid = 0.3 * size
+let/quiet long = 0.4 * size
+
+let/quiet rt = r + tiny
+let/quiet rs = r + short
+let/quiet rm = r + mid
+let/quiet rl = r + long
+
+let/quiet text = 0.2 * size
+let/quiet text_gap = 0.1 * size
+let/quiet rtx = rl + text_gap
+
+let/quiet ctheta = COS(theta)
+let/quiet stheta = SIN(theta)
+
+
+! draw the long tics
+repeat/i=1:32:8 PPL ALINE/NOUSER 1,`xc+r*ctheta`,`yc+r*stheta`,`xc+rl*ctheta`,`yc+rl*stheta`
+
+! mid tics
+repeat/i=5:32:8 PPL ALINE/NOUSER 1,`xc+r*ctheta`,`yc+r*stheta`,`xc+rm*ctheta`,`yc+rm*stheta`
+
+! draw the short tics
+repeat/i=3:32:4 PPL ALINE/NOUSER 1,`xc+r*ctheta`,`yc+r*stheta`,`xc+rs*ctheta`,`yc+rs*stheta`
+
+! draw the tiny tics
+repeat/i=2:32:2 PPL ALINE/NOUSER 1,`xc+r*ctheta`,`yc+r*stheta`,`xc+rt*ctheta`,`yc+rt*stheta`
+
+
+! put on the text labels
+let/quiet s45 = SIN(PI/4)*rtx
+LABEL/NOUSER `xc`,`yc+rtx`,0,0,`text` @CRN
+LABEL/NOUSER `xc-rtx`,`yc`,0,90,`text` @CRW
+LABEL/NOUSER `xc`,`yc-rtx`,0,180,`text` @CRS
+LABEL/NOUSER `xc+rtx`,`yc`,0,270,`text` @CRE
+
+LABEL/NOUSER `xc-s45`,`yc+s45`,0,45,`text` @CRNW
+LABEL/NOUSER `xc-s45`,`yc-s45`,0,135,`text` @CRSW
+LABEL/NOUSER `xc+s45`,`yc-s45`,0,225,`text` @CRSE
+LABEL/NOUSER `xc+s45`,`yc+s45`,0,315,`text` @CRNE
+
+! clean up
+PPL AXSET 1,1,1,1
+
+set mode/last verify
diff --git a/jnls/examples/constant_array_demo.jnl b/jnls/examples/constant_array_demo.jnl
new file mode 100644
index 0000000..704ade6
--- /dev/null
+++ b/jnls/examples/constant_array_demo.jnl
@@ -0,0 +1,62 @@
+define alias pause message
+
+! constant_array_demo.jnl (4/99)
+
+! Description: Demonstration of the {1, 3, 5} "constant array"  syntax 
+
+! Constant array syntax introduced into Ferret in V5.0
+
+! *acm* 7/01 update /pen= to /color=/thickness=
+
+
+
+! ** Constant arrays allow you quickly to enter lists of constant values.
+
+! SYNTAX:
+! Constant arrays are comma-separated lists enclosed in curly braces.
+! If the list needs to contain gaps (missing values), simply omit the element
+! For example
+
+  LIST {1,3,5}, {1,,5}
+
+pause
+
+! Note that a constant variable is always an array oriented in the X direction
+! To create a constant aray oriented in, say, the Y direction use YSEQUENCE
+
+  STAT/BRIEF YSEQUENCE({1,3,5})
+
+pause
+
+! EXAMPLES
+! Below are several examples illustrating uses of constant arrays
+! 1) plots a triangle
+! 2) plots a series of triangles at data points
+! 3) Samples a variable at a list of subscripts
+
+! Ex 1) plot a triangle
+
+  LET xtriangle = {0,.5,1}
+  LET ytriangle = {0,1,0}
+  POLYGON/COLOR=red/THICKNESS=2 xtriangle, ytriangle, 0
+
+pause
+
+! Ex 2) plot a series of triangles at data points
+! See also XXXX.jnl for a more automated way to do this)
+
+  LET xpts = 10*RANDU(j[j=1:20]+0)	! random X coordinates
+  LET ypts = 10*RANDU(j[j=1:20]+1)	! random Y coordinates
+  LET values = 10* j[j=1:20]		! value at each (x,y) point
+  POLYGON xpts+xtriangle, ypts+ytriangle, values
+
+pause
+
+! Ex 3) Sample Jan, June, and December from sst in coads_climatology
+
+  USE  coads_climatology
+  LET  my_sst_winter = SAMPLEL(sst[Y=0:90N], {1,2,12})
+  LET  my_sst_summer = SAMPLEL(sst[Y=0:90N], {6,7,8})
+  STAT/BRIEF my_sst_winter
+  STAT/BRIEF my_sst_summer
+
diff --git a/jnls/examples/custom_contour_demo.jnl b/jnls/examples/custom_contour_demo.jnl
new file mode 100644
index 0000000..5226cca
--- /dev/null
+++ b/jnls/examples/custom_contour_demo.jnl
@@ -0,0 +1,72 @@
+set mode verify    ! display the commands at the user's console
+! custom_contour.jnl *sh* 11/91 - added some axis customizations 11/93
+!                    *sh* 5/94 - restore default SET GRID on exit
+
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+
+
+! Description: show customizable features of PLOT+ contouring within FERRET
+
+! in case there are left-over regions from previous commands
+cancel region
+
+! define an arbitrary function to use as a contouring example
+define axis/x=-20:20:1 x2020
+define axis/y=-20:20:1 y2020
+define grid/x=x2020/y=y2020 g2020
+set grid g2020
+let circle = (x^2 + y^2) ^ 0.5
+let/title="SAMPLE FUNCTION" my_var = circle * exp((10-(i+j))/50)
+
+! produce a default contour plot
+contour my_var
+message
+
+! change the contour levels - unequally spaced
+contour/levels=(1,7,.5)(7,30,3)(11.3) my_var
+message
+
+! omit contour labels ("-3")
+contour/levels=(1,30,2,-3) my_var
+message
+
+! mix: no labels ("-3"), 3 decimal points, and no decimal points ("-1")
+contour/levels=(1,5,0.3,-3)(6,15,2,3)(16,30,1,-1) my_var
+message
+
+! mix: normal lines, dashed lines and heavy lines
+cont/level="(1,30,2,-1) LINE(1,7,2,1) DARK(9,15,2,1) DASH(17,29,2,1)" my_var
+message
+
+! mix: three line colors
+contour/level="(1,30,1,-1) PEN(5,10,1,2) PEN(11,20,1,3) PEN(21,30,1,4)" my_var 
+message
+
+! make contour labels bigger
+! note: this feature remains in effect until explicitly removed
+ppl conset 0.15
+contour/levels="(1,30,3) PEN(1,30,3,1)" my_var
+message
+
+! do contour labels in color in Triplex Roman font
+! note: this feature remains in effect until explicitly removed
+ppl conpre @P2 at TR
+contour/levels=(1,30,3) my_var
+message
+
+! add units of "cm" in Complex Itallic font to the contour labels
+! note: this feature remains in effect until explicitly removed
+ppl conpst @CIcm
+contour/levels=(1,30,3) my_var
+message
+
+! give explicit axis bounds and tic interval
+contour/levels=(1,30,3)/hlimits=-20:20:10/vlimits=-20:20:10 my_var
+
+! restore normal operation
+ppl conpre
+ppl conpst
+ppl conset 0.08
+contour/lev=(1,30,1,-1)/set_up my_var
+set grid abstract
+set mode/last verify
diff --git a/jnls/examples/depth_to_density_demo.jnl b/jnls/examples/depth_to_density_demo.jnl
new file mode 100644
index 0000000..dda520e
--- /dev/null
+++ b/jnls/examples/depth_to_density_demo.jnl
@@ -0,0 +1,43 @@
+! depth_to_density_axis.jnl - S.Hankin 8/25/92 
+!   Updated to use ZAXREPLACE rather than @WEQ  - Ansley Manke 1/10/2000
+
+! This FERRET script demonstrates a technique for using a user-defined variable
+! as an axis of a FERRET variable for purposes of plotting, listing or
+! calculations
+
+! Notes:
+!  1) This demo replaces an older depth_to_density demo, which used the @WEQ
+!     transformation and was quite a bit more involved.
+!  2) If the translation from the independent axis to the user-defined
+!    (dependent) variable is constant with respect to the other axes then the
+!    desired result can be achieved much more simply using regridding by
+!    association (g=@ASN).
+!    e.g. To display depth in cm instead of meters:
+!         DEFINE AXIS/Z=lo:hi:delta/unit=cm zcm   ! match z in meters pt for pt
+!         DEFINE GRID/LIKE=my_var/Z=zcm  gcm
+!         CONTOUR my_var[g=gcm at ASN]
+
+! In this example we will produce a contour plot of temperature along the
+! equator in the Tropical Pacific Ocean using axes of longitude and density.
+! The dependent variable, dens (density), will replace the independent axis,
+! depth.
+message/quiet  ! pause to read
+
+! use the Levitus climatology along the equator in the Pacific Ocean
+set data levitus_climatology
+set region/y=0/x=130e:80w/z=0:1000
+
+! define a new variable for density (dens) and contour it just for a look
+let/title=density dens = rho_un(salt,temp,z)
+contour dens
+message/quiet  ! pause to look at the plot
+
+! Define the density axis
+define axis/z=1022:1032:1/unit="density"/depth zdens
+
+! Define a variable temp_dens, which will be temperature as a function of density
+let temp_dens = ZAXREPLACE(temp, dens, z[gz=zdens])
+
+! contour the new variable
+contour/z=1022:1032 temp_dens
+message/quiet  ! pause to look at the plot
diff --git a/jnls/examples/depth_to_density_weq_demo.jnl b/jnls/examples/depth_to_density_weq_demo.jnl
new file mode 100644
index 0000000..9e4dd1a
--- /dev/null
+++ b/jnls/examples/depth_to_density_weq_demo.jnl
@@ -0,0 +1,77 @@
+! depth_to_density_axis.jnl - S.Hankin 8/25/92 
+
+! Description: show contour with a user-defined variable as an axis
+
+! This FERRET script demonstrates a technique for using a user-defined variable
+! as an axis of a FERRET variable for purposes of plotting, listing or
+! calculations
+
+! Notes:
+! 1) The technique will not work on 4D variables - ony 1D, 2D, and 3D
+! 2) If the translation from the independent axis to the user-defined
+!    (dependent) variable is constant with respect to the other axes then the
+!    desired result can be achieved much more simply using regridding by
+!    association (g=@ASN).
+!    e.g. To display depth in cm instead of meters:
+!         DEFINE AXIS/Z=lo:hi:delta/unit=cm zcm   ! match z in meters pt for pt
+!         DEFINE GRID/LIKE=my_var/Z=zcm  gcm
+!         CONTOUR my_var[g=gcm at ASN]
+
+! The strategy used in this script may be more difficult to understand in
+! words than by example.  Both follow.
+
+! This script uses the following strategy:
+! 1) define a grid (gdens) which replaces one of the unused dimensions of your
+!    variable with the desired axis (axdens) of (dependent) values
+! 2) by subtracting the new axis coordinates from the dependent variable
+!    define a new variable (r0) which at each point of the new axis is 
+!    exactly zero where the dependent value equals the coordinate value. 
+!    (Effectively this replicates the original dependent field at each
+!    point of the new axis and then subtracts the coordinate value at each
+!    point.  The resulting N+1 dimensional field will always have a value of
+!    zero where the coordinate equals the original unreplicated value)
+! 3) Create an expression (r0[z=@weq:0]) which when multiplied by the variable
+!    you wish to plot (temp) and summed along its original independent axis
+!    will produce the value of temp at the point where the dependent
+!    axis coordinate equals the dependent variable field.
+! 4) Multiply and sum to produce the desired result.
+! 5) (Manually invert the depth axis direction if appropriate)
+ 
+! In this example we will produce a contour plot of temperature along the
+! equator in the Tropical Pacific Ocean using axes of longitude and density.
+! The dependent variable, dens (density), will replace the independent axis,
+! depth.
+message/quiet  ! pause to read
+
+! use the Levitus climatology along the equator in the Pacific Ocean
+set data levitus_climatology
+set region/y=0/x=130e:80w/z=0:1000
+
+! define a new variable for density (dens) and contour it just for a look
+let/title=density dens = rho_un(salt,temp,z)
+contour dens
+message/quiet  ! pause to look at the plot
+
+! in a new grid replace the unused T axis of "temp" with the density axis
+define axis/t=1022:1032:1/unit="density" axdens
+define grid/like=temp/t=axdens gdens
+
+! define a new variable, r0, with a value of zero wherever dens equals its
+! coordinate on the density axis  (r0 is a 4-dimensional variable with 
+! density in the T axis slot)
+let r0 = dens[l=1] - t[g=gdens]
+
+! define a new variable, ktemp, which, when summed along the Z axis, will give
+! the (single) value of temp at the location where dens equals its own
+! coordinate on the density axis 
+let ktemp = r0[z=@weq:0] * temp[l=1]
+
+! contour the new variable summed (integrated) along the Z axis
+! ( Since the Z axis reduces to a point in this operation the result is 3D - 
+!   longitude, latitude and density with latitude fixed at Y=0) 
+contour/t=1022:1032 ktemp[z=@sum]
+message/quiet  ! pause to look at the plot
+
+! reverse the vertical (density) axis so it looks conventional
+ppl yaxis 1032,1022,-1
+ppl contour
diff --git a/jnls/examples/dods_demo.jnl b/jnls/examples/dods_demo.jnl
new file mode 100644
index 0000000..04270b0
--- /dev/null
+++ b/jnls/examples/dods_demo.jnl
@@ -0,0 +1,160 @@
+\cancel mode verify
+
+! set initial demo state
+cancel data/all
+cancel region
+
+! dods_demo.jnl  *kob* 5/99
+! customized for IPRC presentation 9/99 *sh*
+!
+! Description: Demo: how to use Ferret and DODS to access remote Datasets
+!
+
+set mode verify
+
+
+
+
+!      *********************************************************
+!        DEMO: Using Ferret and DODS to access remote data sets
+!      *********************************************************
+
+! First we will examine the COADS climatology dataset from the Pacific
+! Marine Environmental Laboratory (PMEL) in Seattle, Washington. 
+
+
+! Note:  Once the dataset has been initialized from the remote site,
+!        using the dataset is exactly the same as if it were local
+
+
+PAUSE
+!      *********************************************************
+
+
+
+set data "http://ferret.pmel.noaa.gov/thredds/dodsC/las/COADS-climatology/data_coads_climatology.jnl"
+show data
+
+
+
+! SHOW DATA verifies that this is indeed a remote dataset
+! 
+! Now let's look at a color contour of Sea Surface Temperature
+
+
+
+
+PAUSE
+!      *********************************************************
+
+fill/t="16-jul" sst
+go land
+
+! Next, let's look at a subregion of the SST. 
+ 
+!   Note: Higher data access speed may be noticed due to data caching by Ferret
+
+
+
+PAUSE
+!      *********************************************************
+
+
+go basemap x=130e:170w y=30N:70N 20
+fill/overlay/t="16-jul"/x=140e:180e/y=40N:65N sst
+
+
+! Remote data has full random access. Here we will plot the evolution of SST
+! averaged over the Equatorial waveguide (an XT section)
+
+PAUSE
+!      *********************************************************
+
+
+fill/x=140e:180e/l=1:24 sst[y=5s:5n at ave]
+
+! Now, let's use a different SST dataset from the Earth System Research Laboratory
+! (ESRL) in Boulder, Colorado
+
+PAUSE
+!      *********************************************************
+
+use "http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/aggro/OISSThires.nc"
+show data 2
+
+! This data set contains weekly mean global SST grids prepared by
+! Reynolds et. al.  (see http://www.esrl.noaa.gov/psd/thredds/catalog.html)
+! Let's look at the SST for June 15, 1989
+
+PAUSE
+!      *********************************************************
+
+
+fill/t="15-JUN-1989" sst[d=2]
+go fland
+
+! Now, let's see where the June 15, 1998 Reynolds field (served from Boulder)
+! exceeds the June climatological data (served from Seattle)
+
+! This requires regridding the 2x2 degree COADS data to the 0.25x0.25 degree
+! Reynolds grid
+
+PAUSE
+!      *********************************************************
+
+let coads_on_reynolds = sst[d=1,g=sst[d=2]]
+let warmer = IF sst[d=2] GT coads_on_reynolds THEN 1
+shade/x=80w:20e/y=0:80N/pal=black/levels/pattern=weave/t="15-jun-1989"/over warmer
+
+
+! Next let's look at a dataset from NASA's Earth Observing system (EOS) HDF-EOS group. 
+! This data set is in HDF format. It contains surface data - wind stress, heat flux,
+! humidity, precipitable water.
+
+!   Note that DODS gives Ferret format-independence -- the ability to read
+!        an HDF file
+
+PAUSE
+!      *********************************************************
+use "http://eosdap.hdfgroup.uiuc.edu:8080/opendap/data/NASAFILES/hdf5/GSSTF.2b.2008.01.01.he5"
+show data/att 3
+
+
+! Let's look at the wind-stress vectors
+
+PAUSE
+!      *********************************************************
+
+
+vector/xskip=5/yskip=1 A4STu, A5STv
+go fland
+
+! Next lets examine some NOAA AVHRR data served by the University
+! of Rhode Island, Graduate School of Oceanography (GSO). This
+! data is in the form of 1024x1024 pixel images (1 megabyte per image)
+
+! We will use this to illustrate the ability of Ferret and DODS to
+! subsample -- making the data transfer much faster.
+
+PAUSE
+!      *********************************************************
+
+use "http://satdat1.gso.uri.edu/opendap/Pathfinder/Northwest_Atlantic/6km/raw/1995/1/f95018175608.hdf"
+
+! Performance greatly enhanced through use of strides
+shade/levels=50 dsp_band_1[i=1:1024:4, j=1:1024:4]
+
+! We can see Florida and the Carribean islands, but they are upside down. 
+! Ferret can use the netCDF library to address this, with the /ORDER qualifier.
+cancel data 4
+use/order=x-y "http://satdat1.gso.uri.edu/opendap/Pathfinder/Northwest_Atlantic/6km/raw/1995/1/f95018175608.hdf"
+
+! The coordinate axes are just index values, but the longitude/latitude ranges are 
+! defined in global attributes. We can redefine the x and y axes to represent 
+! longitude and latitude axes.
+
+define axis/x=`..dsp_nav_earth_leflon`:`..dsp_nav_earth_ritlon`/npoints=1024/units=degrees_east `DSP_BAND_1,return=xaxis`
+define axis/y=`..dsp_nav_earth_botlat`:`..dsp_nav_earth_toplat`/npoints=1024/units=degrees_north `DSP_BAND_1,return=yaxis`
+shade/levels=v dsp_band_1[i=1:1024:4, j=1:1024:4]
+go fland 05
+
diff --git a/jnls/examples/draw_it.jnl b/jnls/examples/draw_it.jnl
new file mode 100644
index 0000000..d7c0ab8
--- /dev/null
+++ b/jnls/examples/draw_it.jnl
@@ -0,0 +1,15 @@
+\cancel mode verify
+!Description: Support routine for objective_analysis demonstration
+! usage:
+!	 GO draw_it variable "title" "graphics_style" "viewport"
+!  e.g.  GO draw_it my_variable "Title of my variable" SHADE upper_left
+
+set view $4"|upper>vupper|upper_right>vur|upper_left>vul|lower_right>vlr|lower_left>vll"
+go magnify 1.4
+$3/x=1:10/y=1:10/lev=(-0.6,.8,.1)/nolab/set_up $1
+ppl labs; ppl ylab; ppl xlab
+ppl title .3 @AC$2
+ppl $3
+ppl shaset reset
+set mode verify
+
diff --git a/jnls/examples/edit_data_file_demo.jnl b/jnls/examples/edit_data_file_demo.jnl
new file mode 100644
index 0000000..8bbf299
--- /dev/null
+++ b/jnls/examples/edit_data_file_demo.jnl
@@ -0,0 +1,53 @@
+! replace_arbitrary_values.jnl   - last modified 8/24/92
+
+! Description: demo of a technique for "hand-editing" a variable
+
+! *acm* 7/01 update /line= to /color=
+
+
+! This FERRET script demonstrates a technique for customizing data on an
+! arbitrary basis - i.e. replacing arbitrary regions of a variable with
+! arbitrarily selected values
+
+! This example customizes the land/ocean mask contained in the 2x2 degree
+! ETOPO data set supplied with FERRET
+
+! NetCDF files and the SAVE command are at the heart of the technique
+
+set data etopo120
+region/x=100w:10w/y=20n:60n              ! North Atlantic
+let ocean = if rose le 0 then 0 else 1   ! 0 = ocean, 1 = land
+set wind/siz=.5 1
+shade/lev=(-0.5,2.5,1)/nokey ocean
+go land
+
+! Notice that Florida and Cuba appear to be ocean.
+! We will fix this.
+
+pause
+! First, save the full mask as-is
+spawn rm ocean_mask.cdf   ! so the script can be run over and over
+SAVE/file=ocean_mask.cdf ocean
+
+! Lets mark Florida and Cuba (very roughly) to get the right locations
+plot/vs/over/symb=2/color=green x[x=81w],y[y=27n]
+plot/vs/over/symb=2/color=green x[x=81w],y[y=23n]
+plot/vs/over/symb=2/color=green x[x=77w],y[y=21n]
+
+pause
+! Now we'll save a 1 for land over these locations
+! We need to use the SAME variable name, ocean,  so that SAVE will overwrite
+! regions of the previous variable definition
+let ocean = rose - rose + 1
+save/append/file=ocean_mask.cdf  ocean[x=81w,y=27n]
+save/append/file=ocean_mask.cdf  ocean[x=81w,y=23n]
+save/append/file=ocean_mask.cdf  ocean[x=77w,y=21n]
+
+! Now lets look at it to confirm that it worked
+! Note: If a file variable and a user-defined variable have the same name
+! FERRET will use the user definition, so we must eliminate that
+USE ocean_mask 
+cancel variable ocean 
+set wind/siz=.5 2
+shade/lev=(-0.5,2.5,1)/nokey ocean
+go land
diff --git a/jnls/examples/ef_eof_demo.jnl b/jnls/examples/ef_eof_demo.jnl
new file mode 100644
index 0000000..fd241d0
--- /dev/null
+++ b/jnls/examples/ef_eof_demo.jnl
@@ -0,0 +1,187 @@
+\SET MODE VERIFY
+! ef_eof_demo.jnl ( acm  9/2000)
+
+! Description: Demonstration of computing EOFs using the
+! External Functions EOF_SPACE, EOF_TFUNC, EOF_STAT
+
+! The functions implements Chelton's '82 method for finding EOFs of gappy
+! time series. All the functions perform the same computation but return
+! different portions of the results.
+
+!   * EOF_SPACE returns EOF eigenvectors: spatial EOF in x and y with the
+!     same units as the incoming data
+!   * EOF_TFUNC returns EOF time amplitude functions; dimensionless
+!   * EOF_STAT returns statistics on the EOF computation: number of EOFs
+!     scaled and returned; Percent variance explained by each EOF; and the
+!     eigenvalues.
+!
+! For all functions the arguments are as follows:
+!
+!   * 1st argument: Input data field, a function of x, y, and time; may be a
+!     function of z
+!   * 2nd argument: The minimum percent variance explained by the EOF's that
+!     are computed and scaled, e.g. to return EOFs that explain at least 2%
+!     variance, use 2.0
+!   * 3nd argument: The fraction of each time series that must be present to
+!     include it in the calculations, e.g. to use all time series that have
+!     at least half the data present, use 0.5
+!
+!
+! EOF functions Example 1: define a function of x,y,time using trig
+! functions.  Decompose into spatial and time EOF's and display statistics.
+!
+Say With Ferret v6.8 and higher, run ef_eofsvd_demo instead
+IF `($ferret_version"0") GE 6.8` THEN exit/script
+PAUSE
+LET time = t[t=1-jan-1990:10-jan-1990:24]   ! 24 hour resolution time axis
+
+DEFINE AXIS/x=0:10:0.5 x10
+DEFINE AXIS/y=0:10:0.5 y10
+DEFINE GRID/x=x10/y=y10/t=time g10x10
+SET GRID g10x10
+
+LET fcn1 = 15.* sin(omega1*t)*cos(r)/(r+1)
+LET fcn2 = 20.* sin(omega2*t)*(sin(s)-.2*sin(q))/(s+1)
+
+LET r = ((6.*(xpts-x0)^2 + 7.*(ypts-y0)^2)^0.5)
+LET s = (((xpts-x1)^2 + 2*(ypts-y1)^2)^0.5)
+LET q = ((3*(xpts-x0)^2 + (ypts-y1)^2)^0.5)
+
+LET x0 = 2
+LET y0 = 4
+LET x1 = 5
+LET y1 = 7
+
+LET omega1 = 1/10*2*3.14159
+LET omega2 = 2 * omega1
+
+LET sample_function = fcn1 + fcn2
+LET xpts = x
+LET ypts = y
+
+!  Compute the statistics on the EOF solution.  EOF_STAT returns:
+!  for J=1  the number of EOFs returned
+!  for J=2  the percent variance explained by each EOF
+!  for J=3  the eigenvalue for each EOF
+
+LET estat = eof_stat(sample_function, 0.1)
+
+LIST/I=1/J=1 estat
+
+LIST/I=1:4/J=2 estat
+
+LIST/I=1:4/J=3 estat
+
+
+!  Plot the original function (averaged over time) and its spatial
+!  decomposition by EOF_SPACE
+
+PAUSE
+
+DEFINE VIEW/xlim=0.,.33/ylim=.6,1./text=0.2 vul
+DEFINE VIEW/xlim=.33,.66/ylim=.6,1./text=0.2 vuc
+DEFINE VIEW/xlim=.66,1./ylim=.6,1./text=0.2 vur
+
+DEFINE VIEW/xlim=0.,.33/ylim=.1,.5/text=0.2 vll
+DEFINE VIEW/xlim=.33,.66/ylim=.1,.5/text=0.2 vlc
+DEFINE VIEW/xlim=.66,1./ylim=.1,.5/text=0.2 vlr
+
+SET VIEW vul; CONTOUR/TITLE="FCN1" fcn1[l=1:10 at ave]
+SET VIEW vuc; CONTOUR/TITLE="FCN2" fcn2[l=1:10 at ave]
+SET VIEW vur; CONTOUR/TITLE="FCN1 + FCN2" sample_function[l=1:10 at ave]
+
+
+LET exy = eof_space(sample_function, 0.1)
+
+SET VIEW vll; CONTOUR/L=1/TITLE="EOF 1" exy
+SET VIEW vlc; CONTOUR/L=2/TITLE="EOF 2" exy
+
+PAUSE
+CANCEL VIEW
+
+! Now plot the time amplitude functions.
+
+LET etim = eof_tfunc(sample_function, 0.1)
+
+SET VIEW ul
+PLOT/I=1/TITLE=taf1 etim
+
+SET VIEW ur
+PLOT/I=2/TITLE=taf2 etim
+
+! should be all bad flags...
+SET VIEW ll
+PLOT/I=3/TITLE=taf3 etim
+
+PAUSE
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+CANCEL VIEW
+
+!  A second example, using the COADS climatology data.
+!
+
+USE coads_climatology
+SET REGION/X=67w:1w/Y=11S:11N
+
+!  Compute and save the spatial EOF functions.  These have the same units
+!  as the data.
+
+LET eof_xyfcn = eof_space(sst, 0.5)
+SAVE/CLOBBER/FILE=sst_clim_eof_space.cdf eof_xyfcn
+
+
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+
+USE sst_clim_eof_space.cdf
+SET VIEW ul; fill/l=1/TITLE="eof 1" eof_xyfcn; go land
+SET VIEW ur; fill/l=2/TITLE="eof 2" eof_xyfcn; go land
+SET VIEW ll; fill/l=3/TITLE="eof 3" eof_xyfcn; go land
+
+PAUSE
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+
+!  Compute the statistics on the EOFs: number of EOFs scaled
+!  and returned; Percent variance explained by each EOF; and the
+!  eigenvalues.
+
+
+USE coads_climatology
+SET REGION/X=67w:1w/Y=11S:11N
+LET eofstat = eof_stat(sst[X=67w:1w,Y=11S:11N], 0.5)
+
+LET nout = eofstat[i=1,j=1]
+LET pcts = eofstat[i=1:`nout`,j=2]
+
+LET eigenv = eofstat[i=1:`nout`,j=3]
+
+LIST nout
+LIST/I=1:6 pcts
+LIST/I=1:6 eigenv
+
+PAUSE
+
+!  Compute and save time amplitude functions: Note they are dimensionless.
+
+USE coads_climatology
+LET eoftime = eof_tfunc(sst[X=67w:1w,Y=11S:11N], 0.5)
+
+SAVE/CLOBBER/FILE=sst_clim_eof_tfunc.cdf eoftime[i=1:`nout`]
+
+CANCEL VIEW
+CANCEL VARIABLE/ALL
+USE sst_clim_eof_tfunc.cdf
+
+SET VIEW ul
+PLOT/I=1/TITLE="time function 1"/VLIMITS=-2:2:0.5 eoftime
+SET VIEW ur
+PLOT/I=2/TITLE="time function 2"/VLIMITS=-2:2:0.5 eoftime
+SET VIEW ll
+PLOT/I=3/TITLE="time function 3"/VLIMITS=-2:2:0.5 eoftime
+
+\SET MODE/LAST VERIFY
diff --git a/jnls/examples/ef_eofsvd_demo.jnl b/jnls/examples/ef_eofsvd_demo.jnl
new file mode 100644
index 0000000..22acc13
--- /dev/null
+++ b/jnls/examples/ef_eofsvd_demo.jnl
@@ -0,0 +1,177 @@
+\SET MODE VERIFY
+! ef_eofsvd_demo.jnl ( acm  9/2000)
+
+! Description: Demonstration of computing EOFs using the
+! External Functions EOFSVD_SPACE, EOFSVD_TFUNC, EOFSVD_STAT
+
+! The functions implements Numerical Recipes SVDCMP. All the functions perform
+! the same computation but return different portions of the results.
+
+!   * EOFSVD_SPACE returns EOF eigenvectors: spatial EOF in x and y with the
+!     same units as the incoming data
+!   * EOFSVD_TFUNC returns EOF time amplitude functions; dimensionless
+!   * EOFSVD_STAT returns statistics on the EOF computation: number of EOFs
+!     scaled and returned; Percent variance explained by each EOF; and the
+!     eigenvalues.
+!
+! For all functions the arguments are as follows:
+!
+!   * 1st argument: Input data field, a function of x, y, and time; may be a
+!     function of z
+!
+! EOFSVD functions Example 1: define a function of x,y,time using trig
+! functions.  Decompose into spatial and time EOF's and display statistics.
+!
+PAUSE
+LET time = t[t=1-jan-1990:10-jan-1990:24]   ! 24 hour resolution time axis
+
+DEFINE AXIS/x=0:10:0.5 x10
+DEFINE AXIS/y=0:10:0.5 y10
+DEFINE GRID/x=x10/y=y10/t=time g10x10
+SET GRID g10x10
+
+LET fcn1 = 15.* sin(omega1*t)*cos(r)/(r+1)
+LET fcn2 = 20.* sin(omega2*t)*(sin(s)-.2*sin(q))/(s+1)
+
+LET r = ((6.*(xpts-x0)^2 + 7.*(ypts-y0)^2)^0.5)
+LET s = (((xpts-x1)^2 + 2*(ypts-y1)^2)^0.5)
+LET q = ((3*(xpts-x0)^2 + (ypts-y1)^2)^0.5)
+
+LET x0 = 2
+LET y0 = 4
+LET x1 = 5
+LET y1 = 7
+
+LET omega1 = 1/10*2*3.14159
+LET omega2 = 2 * omega1
+
+LET sample_function = fcn1 + fcn2
+LET xpts = x
+LET ypts = y
+
+!  Compute the statistics on the EOF solution.  EOFSVD_STAT returns:
+!  for J=1  the number of EOFs returned
+!  for J=2  the percent variance explained by each EOF
+!  for J=3  the eigenvalue for each EOF
+
+LET estat = eofsvd_stat(sample_function)
+
+LIST/I=1/J=1 estat
+
+LIST/I=1:4/J=2 estat
+
+LIST/I=1:4/J=3 estat
+
+
+!  Plot the original function (averaged over time) and its spatial
+!  decomposition by EOFSVD_SPACE
+
+PAUSE
+
+DEFINE VIEW/xlim=0.,.33/ylim=.6,1./text=0.2 vul
+DEFINE VIEW/xlim=.33,.66/ylim=.6,1./text=0.2 vuc
+DEFINE VIEW/xlim=.66,1./ylim=.6,1./text=0.2 vur
+
+DEFINE VIEW/xlim=0.,.33/ylim=.1,.5/text=0.2 vll
+DEFINE VIEW/xlim=.33,.66/ylim=.1,.5/text=0.2 vlc
+DEFINE VIEW/xlim=.66,1./ylim=.1,.5/text=0.2 vlr
+
+SET VIEW vul; CONTOUR/TITLE="FCN1" fcn1[l=1:10 at ave]
+SET VIEW vuc; CONTOUR/TITLE="FCN2" fcn2[l=1:10 at ave]
+SET VIEW vur; CONTOUR/TITLE="FCN1 + FCN2" sample_function[l=1:10 at ave]
+
+
+LET exy = eofsvd_space(sample_function)
+
+SET VIEW vll; CONTOUR/L=1/TITLE="EOF 1" exy
+SET VIEW vlc; CONTOUR/L=2/TITLE="EOF 2" exy
+
+PAUSE
+CANCEL VIEW
+
+! Now plot the time amplitude functions.
+
+LET etim = eofsvd_tfunc(sample_function)
+
+SET VIEW ul
+PLOT/I=1/TITLE=taf1 etim
+
+SET VIEW ur
+PLOT/I=2/TITLE=taf2 etim
+
+! should be all bad flags...
+SET VIEW ll
+PLOT/I=3/TITLE=taf3 etim
+
+PAUSE
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+CANCEL VIEW
+
+!  A second example, using the COADS climatology data.
+!
+
+USE coads_climatology
+SET REGION/X=67w:1w/Y=11S:11N
+
+!  Compute and save the spatial EOF functions.  These have the same units
+!  as the data.
+
+LET EOFSVD_xyfcn = eofsvd_space(sst)
+SAVE/CLOBBER/FILE=sst_clim_eofsvd_space.cdf eofsvd_xyfcn
+
+
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+
+USE sst_clim_eofsvd_space.cdf
+SET VIEW ul; fill/l=1/TITLE="eof 1" eofsvd_xyfcn; go land
+SET VIEW ur; fill/l=2/TITLE="eof 2" eofsvd_xyfcn; go land
+SET VIEW ll; fill/l=3/TITLE="eof 3" eofsvd_xyfcn; go land
+
+PAUSE
+CANCEL DATA/ALL
+CANCEL VARIABLE/ALL
+CANCEL REGION
+
+!  Compute the statistics on the EOFs: number of EOFs scaled
+!  and returned; Percent variance explained by each EOF; and the
+!  eigenvalues.
+
+
+USE coads_climatology
+SET REGION/X=67w:1w/Y=11S:11N
+LET eofstat = eofsvd_stat(sst[X=67w:1w,Y=11S:11N])
+
+LET nout = eofstat[i=1,j=1]
+LET pcts = eofstat[i=1:`nout`,j=2]
+
+LET eigenv = eofstat[i=1:`nout`,j=3]
+
+LIST nout
+LIST/I=1:6 pcts
+LIST/I=1:6 eigenv
+
+PAUSE
+
+!  Compute and save time amplitude functions: Note they are dimensionless.
+
+USE coads_climatology
+LET eoftime = eofsvd_tfunc(sst[X=67w:1w,Y=11S:11N])
+
+SAVE/CLOBBER/FILE=sst_clim_eofsvd_tfunc.cdf eoftime[i=1:`nout`]
+
+CANCEL VIEW
+CANCEL VARIABLE/ALL
+USE sst_clim_eofsvd_tfunc.cdf
+
+SET VIEW ul
+PLOT/I=1/TITLE="time function 1"/VLIMITS=-2:2:0.5 eoftime
+SET VIEW ur
+PLOT/I=2/TITLE="time function 2"/VLIMITS=-2:2:0.5 eoftime
+SET VIEW ll
+PLOT/I=3/TITLE="time function 3"/VLIMITS=-2:2:0.5 eoftime
+
+\SET MODE/LAST VERIFY
diff --git a/jnls/examples/ef_fft_demo.jnl b/jnls/examples/ef_fft_demo.jnl
new file mode 100644
index 0000000..6c9362b
--- /dev/null
+++ b/jnls/examples/ef_fft_demo.jnl
@@ -0,0 +1,165 @@
+\cancel mode verify
+! ef_fft_demo.jnl
+! *acm* 4/99
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+! *acm* 3/04 Add a section with FFT_RE, FFT_IM, and FFT_INVERSE
+
+set mode verify
+! Description: Demonstration of external functions for FFT:  
+! FFTA computes amplitude spectrum
+! FFTP computes phase.
+! FFT_RE computes the real part of the FFT
+! FFT_IM computes the imaginary part of the FFT
+! FFT_INVERSE inverts FFT_RE and FFT_IM to the time domain.
+
+! We will plot an FFT for the monthly_navy_winds and look for the
+! annual cycle. Say "show data" to see the length of the time axis. 
+
+PAUSE
+USE monthly_navy_winds
+SHOW DATA
+
+! Define the time series at a point in space.
+! Set the FFT, using explicit time specification.
+! Plot the amplitude spectrum vs frequency.
+
+LET FFT_uwndtim = uwnd[x=150e:130w at ave,y=20n:40n at ave]
+LET FFT_uwndfft = FFTA(FFT_uwndtim[l=1:132])
+SET VARIABLE/TITLE="Amplitude Spectrum" FFT_uwndfft
+
+SET WINDOW/SIZ=0.4
+
+SET VIEW ul
+PLOT FFT_uwndfft
+
+!  For easier interpretation, invert the frequency axis and plot the 
+!  spectrum vs period: months/cycle
+PAUSE
+
+!  Get the frequency increment used in the FFT.
+LET FFT_nf = `FFT_uwndfft,return=lend`
+LET FFT_nyquist = 0.5
+LET FFT_freq1 = FFT_nyquist/ FFT_nf
+
+!  Define a frequency axis.
+DEFINE AXIS/T=`FFT_freq1`:`FFT_nyquist`:`FFT_freq1` faxis
+DEFINE GRID/T=faxis gfftfreq
+LET a = T[g=gfftfreq]
+
+!  Define the period from the frequency axis.
+LET per = 1./a
+
+!  Plot as a "Y VS X" plot, showing the first 24 months where the most energy is.
+!  The PPL ccommands clean up the plot appearance.
+
+SET VIEW ur
+PLOT/VS/LINE/HLIMITS=0:24:2/TITLE="Amplitude Spectrum"/SET_UP per[l=1:`FFT_nf`], FFT_uwndfft
+PPL XFOR (I2)
+PPL XLAB Period, months/cycle
+PPL YLAB 
+PPL PLOT
+
+
+!  Next we will plot the phase
+PAUSE
+
+LET FFT_uwndfftp = FFTP(FFT_uwndtim[l=1:132])
+SET VARIABLE/TITLE="FFT Phase"/UNITS="deg" FFT_uwndfftp
+
+SET VIEW ll
+PLOT FFT_uwndfftp
+
+!  And the phase in months/cycle
+PAUSE
+
+SET VIEW lr
+PLOT/VS/LINE/HLIMITS=0:24:2/TITLE="FFT Phase"/SET_UP per[l=1:`FFT_nf`],FFT_uwndfftp
+PPL XFOR (I2)
+PPL XLAB Period, months/cycle
+PPL YLAB Deg
+PPL PLOT
+
+CANCEL DATA/ALL
+CANCEL VAR/ALL
+
+
+! Now let us look at the FFT_RE, FFT_IM, and FFT_INVERSE functions:
+PAUSE
+CANCEL VIEWPORT
+
+! Define a time series function.
+
+DEFINE AXIS/t=1:366:1 dayt
+DEFINE GRID/T=dayt  tgrid
+SH GRID tgrid
+SET GRID tgrid
+
+LET fcn1 = SIN(0.5*tpts - 6.) /2.
+LET fcn2 = COS(0.3*tpts)
+
+LET sample_function = fcn1 - fcn2 + 0.2* RANDU(tpts)
+LET tpts = t
+
+SET WINDOW/SIZ=0.4
+SET VIEW upper
+PLOT/TITLE="Original SAMPLE_FUNCTION" sample_function
+
+! Compute the equivalent of FFTA(sample_function)
+pause
+
+LET sample_re = FFT_RE(sample_function)
+LET sample_im = FFT_IM(sample_function)
+LET amp_fft = (sample_re* sample_re + sample_im* sample_im)^0.5
+
+! Compare with the computation in fcn FFTA
+
+SET VIEW upper
+PLOT FFTA(sample_function)
+SET VIEW lower
+PLOT amp_fft
+
+! Now overlay amplitude spectrum computed by FFTA
+PAUSE
+PLOT/OVER FFTA(sample_function)
+
+! next compare the phase function
+PAUSE
+! Compute the equivalent of FFTP(sample_function)
+
+LET sample_re = FFT_RE(sample_function)
+LET sample_im = FFT_IM(sample_function)
+
+LET rad = 180.0/ (4.*ATAN(1.))
+LET phas =  rad* ATAN2(-1.*sample_im, sample_re)     ! the computation done in FFTP(v)
+
+! Compare with the computation of FFTA
+
+SET WINDOW/SIZ=0.4
+SET VIEW upper
+PLOT FFTP(sample_function)
+SET VIEW lower
+PLOT phas
+
+! Overlay FFT phase computed by fftp
+PAUSE
+PLOT/OVER FFTP(sample_function)
+
+! Next invert the FFT and compare with original time series
+PAUSE
+
+LET invert_ts = FFT_INVERSE(sample_re, sample_im)
+SET VIEW upper
+PLOT/TITLE="Original SAMPLE_FUNCTION" sample_function
+
+SET VIEW lower
+PLOT invert_ts
+ 
+! Overlay the original time series function
+PAUSE
+PLOT/OVER sample_function
+
+! clean up
+! restore plot state 
+CANCEL SYMBOL FFT_*
+CANCEL VARIABLE FFT_*
+SET MODE/LAST VERIFY	! restore echo behavior
diff --git a/jnls/examples/ef_sort_demo.jnl b/jnls/examples/ef_sort_demo.jnl
new file mode 100644
index 0000000..3e3f1f9
--- /dev/null
+++ b/jnls/examples/ef_sort_demo.jnl
@@ -0,0 +1,93 @@
+set MODE VERIFY
+!     
+! ******************************************************************** 
+! ef_sort_demo.jnl *acm* 9/98 - EF sorting and sampling demo
+!                  *ACM* 5/00 - correct the order of args to sample*
+!                  *ACM* 5/06 - use square brackets to choose region on 
+!                               args to SORT, SAMPLE grid-changing functions
+
+! Description: examples of the sorting external functions for FERRET.
+! SORTI, SORTJ, SORTK, SORTL to obtain lists of indices of sorted data
+! SAMPLEI, SAMPLEJ, SAMPLEK, SAMPLEL to sample data at a list of indices
+ 
+CANCEL REGION
+
+!         This demonstration/tutorial will introduce the FERRET
+!         external functions for sorting data.
+ 
+! ******************************************************************** 
+MESSAGE
+
+!         A first simple example of sorting: Sort a list of data.
+
+USE coads_climatology
+LIST sst[x=19e,y=77n,l=1:6]
+
+!         The sequence of calls is:  Compute the sorted indices, then sample 
+!         the data using the new order of indices.  This is COADS sea surface 
+!         data at a location where some of the data is missing.
+! ******************************************************************** 
+MESSAGE
+
+!       Show the indices and the sorted temperatures
+
+LET tsorted_indices = sortl(sst[x=19e,y=77n,l=1:6])
+
+LET tsorted_sst = samplel(sst[x=19e,y=77n,l=1:6], tsorted_indices)
+LIST tsorted_indices, tsorted_sst
+
+!       We can also use the constant-array notation to pick out a couple
+!       of points:
+
+list samplel(sst[x=19e,y=77n,l=1:6], {1,5})
+
+
+
+! ******************************************************************** 
+MESSAGE
+
+!         A more involved example:  What is the Sea Surface 
+!         Temperature in a region 3 months after the strongest winds 
+!         elsewhere?  Use the COADS monthly climatology data set.
+
+SET DATA coads_climatology
+
+!         Choose a region in the Pacific, and define the westerly_wind 
+!         variable to be the monthly west winds averaged over this region.
+!         Sort the westerly winds, lowest to highest. "sorted_indices3" 
+!         is the indices 3 months after.
+
+LET westerly_wind = uwnd[x=160e:180 at ave,y=5s:5n at ave]
+LET sst_e = sst[x=180:80w at ave,y=5s:5n at ave]
+
+LET sorted_indices = sortl(westerly_wind)
+LET sorted_indices3 = MOD((sorted_indices + 2), 12) + 1
+
+!         We will plot sorted winds vs the SST's, 3 months later, 
+!         and in another region.   First sample the westerly winds 
+!         by their sorted indices.  Then order the SST's according  
+!         to the sorted wind indices plus 3 months.  
+
+LET wwe_by_wwe = samplel(westerly_wind, sorted_indices)
+LET sst_by_wwe = samplel(sst_e, sorted_indices3)
+
+!         The SST's of interest are to the east of our westerly_wind 
+!         region.  Get the number of valid data in the sort. 
+
+LET leng = wwe_by_wwe[l=@NGD]
+! ******************************************************************** 
+MESSAGE
+
+!          Make scatter plots: sampled winds vs SST, and mark the
+!          highest winds with a symbol.  The computation takes a moment.
+
+PLOT/VS/TITLE="SST 3 months after High Westerly Winds"/SET_UP/l=1:`leng` wwe_by_wwe, sst_by_wwe
+ppl xaxis -3.3, -1.9, 0.1
+ppl yaxis, 25.4, 27.4, 0.2
+ppl xlab "Sorted Westerly Winds from 160E to 180"
+ppl ylab "SST from 180 to 80W 3 months after Westerly winds"
+ppl plot
+
+PLOT/VS/OVER/SYMBOL=18/NOLABELS/l=`leng-3`:`leng` wwe_by_wwe, sst_by_wwe
+
+!         done  
diff --git a/jnls/examples/ef_wv5d_demo.jnl b/jnls/examples/ef_wv5d_demo.jnl
new file mode 100644
index 0000000..73ef797
--- /dev/null
+++ b/jnls/examples/ef_wv5d_demo.jnl
@@ -0,0 +1,92 @@
+!      ef_vis5d_write_demo.jnl *acm* 9/98 - writev5d EF demo
+
+!      Description: examples of the external function to write Vis5D files 
+!      from FERRET.
+ 
+CANCEL REGION
+SET MODE VERIFY
+ 
+!      This demonstration/tutorial will introduce the FERRET
+!      external function for writing Vis5D data files.
+ 
+MESSAGE
+ 
+!      Write climatology data to a Vis5D file.  The first argument 
+!      to the GO script is the file, arguments 2 through 9 are variable 
+!      names to be written.
+ 
+CAN REGION
+USE coads_climatology
+
+!      By default Vis5D looks for variables named U and V to plot as
+!      horizontal winds (Hwind1) so it is convenient to name them this way.
+ 
+LET u =  uwnd
+LET v =  vwnd 
+ 
+GO vis5d_write coads_clim.v5d sst airt wspd u v slp
+
+MESSAGE
+
+!      Write COADS climatology and Levitus climatology data to a Vis5D 
+!      file.  Use the horizontal grid from coads_climatology, and a 
+!      regularly-spaced depth grid in the upper 500 meters of the ocean.  
+!      When writing data to a Vis5D file from more than one data set, you 
+!      must regrid the data so that the horizontal grid and the time axes 
+!      are the same.  The vertical axis, or layers as they are called in 
+!      Vis5D, can be different for different variables.
+ 
+CAN REGION
+USE coads_climatology, levitus_climatology
+SET REGION/X=180:280/Y=5:45
+ 
+DEFINE AXIS/Z=0:500:50/DEPTH dep500 
+DEFINE GRID/LIKE=sst[d=coads_climatology]/Z=dep500 cl_grid
+ 
+!      The Levitus data has one time step; apply the 1:1 at AVE so that the 
+!      time axes of both variables are defined as time-averaged.
+ 
+LET sst_tav = sst[D=coads_climatology, G=cl_grid, l=1:12 at AVE]
+LET lev_tmp = temp[D=levitus_climatology, G=cl_grid, l=1:1 at AVE]
+ 
+GO vis5d_write coads_levitus_test.v5d lev_tmp sst_tav
+ 
+MESSAGE
+
+
+!      There is a Vis5D utility which appends a Vis5D file to an existing
+!      file.  The GO script vis5d_write_append calls this.  It allows 
+!      us to add more time steps to a Vis5D file.  The spatial grid for 
+!      the file being appended must match the grid of the original file.  
+!      The utility checks for this and will issue an error message if 
+!      they do not match.
+
+!      We will write a few months' data from the COADS Climatology surface 
+!      data set, and then append data from later in the year. Times being
+!      appended need to be after times in the initial file, but we can skip
+!      time steps between the two files.  If some variables are not available
+!      for the appended set, the file is written and Vis5D will display the
+!      variables when they are present. 
+
+CAN REGION
+CAN DATA/ALL
+
+USE coads_climatology
+LET u =  uwnd
+LET v =  vwnd
+
+SET REGION/l=1:4
+GO vis5d_write coads_suv.v5d sst u v
+
+CAN REGION
+SET REGION/l=7:12
+GO vis5d_append coads_suv.v5d sst
+
+GO vis5d_start coads_suv.v5d
+
+
+!      To get started learning Vis5D, see the External Functions web page 
+!      for links to a basic primer, and to the Vis5D web site.
+
+
+ 
diff --git a/jnls/examples/error_bars_demo.jnl b/jnls/examples/error_bars_demo.jnl
new file mode 100644
index 0000000..f64dba1
--- /dev/null
+++ b/jnls/examples/error_bars_demo.jnl
@@ -0,0 +1,65 @@
+! error_bars_demo.jnl
+! *sh* 6/99
+
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+!	     and /pen=  to /color=/thickness=
+
+! Description: demonstrate usage of error bars
+
+cancel viewports
+set mode verify
+
+! on an X axis
+define axis/x=1:15:1 x5
+let/quiet xp2 = X[gx=x5]
+let/quiet yp2 = SIN(xp2/4)
+let/quiet errup = 0.6 * RANDU(xp2)
+let/quiet errdn = 0.6 * RANDU(xp2+1)
+
+plot/title="X axis plot" yp2 
+GO error_bars polygon/color=blue/title="uncertainty" yp2 errup
+\pause
+
+! on a time axis
+define axis/t0=1-jan-1990/t=2-jan-1990:6-jan-1990:2/unit=hours tt
+let/quiet xp3 = t[gt=tt]
+let/quiet yp3 =  SIN(xp3/20)
+let/quiet errors = 0.6 * RANDU(xp3)
+
+plot/hlimits="1-jan-1990:12:00":10-JAN-1990/title="time series" yp3
+GO error_bars polygon/color=red/thickness=2/nolab yp3[l=1:50:5] errors[l=1:50:5]
+\pause
+
+! on a log vertical axis
+ppl axtype 1,2
+let exp_yp3 = EXP(yp3)
+plot/hlimits="1-jan-1990:12:00":10-JAN-1990/title="log axis" exp_yp3
+GO error_bars polygon/color=red/thickness=2/nolab exp_yp3[l=1:50:5] errors[l=1:50:5]
+\pause
+ppl axtype 1,1		! restore normal axes
+
+! on (vertical) Z axis
+define axis/z=1:15:1/depth/units=meters z5
+let/quiet xp4 = Z[gz=z5]
+let/quiet yp4 = SIN(xp4/5)
+let/quiet errors = 0.5/(xp4+5)
+
+plot/title="vertical profile" yp4 
+GO error_bars polygon/color=red/thickness=2/title="variability" yp4 errors
+\pause
+
+! NOTE: plot_swath is also a good way to show error limits!
+use coads_climatology
+let mean = sst[x=130e:80w,y=0,l=1:12 at ave]
+let std_dev = sst[x=130e:80w,y=0,l=1:12 at var] ^ 0.5
+set mode calendar:months
+
+set view upper
+plot/vlimits=21:30/title="Tropical SST variability" mean
+go plot_swath poly/over/pal=gray/nolab mean-std_dev, mean+std_dev
+plot/over/nolab/color=black/thickness=2 mean
+set view lower
+plot/vlimits=21:30/title="Tropical SST variability" mean
+GO error_bars polygon/color=red/nolab mean std_dev
+
+
diff --git a/jnls/examples/file_reading_demo.jnl b/jnls/examples/file_reading_demo.jnl
new file mode 100644
index 0000000..262c1c6
--- /dev/null
+++ b/jnls/examples/file_reading_demo.jnl
@@ -0,0 +1,63 @@
+! reading_files.jnl *sh* 11/91 - updated 11/93
+
+! Description: shows examples of reading data from ASCII files
+
+CANCEL REGION   ! in case there's region info left over from previous commands
+SET MODE VERIFY ! display the FERRET commands at the console
+
+! This FERRET journal file presents examples of reading data from a file.
+! The file SNOOPY.DAT is distributed with the FERRET demo data sets
+! It contains 50 records with 6 columns of data.
+!	Columns 1,3,5 are variable number 1
+!	Columns 2,4,6 are variable number 2
+! (The FERRET Users Guide has additional  examples.)
+
+! Our first file access will be as simple as possible - we will rely strictly
+! on defaults.  FERRET will by default access only the first column and will
+! name it "v1"
+
+FILE snoopy.dat
+PLOT v1
+MESSAGE 
+
+! Now we will access all the data by telling FERRET there are 2 variables
+! located in 6 columns.
+
+FILE/VARIABLES="my_var1,my_var2"/COLUMNS=6 snoopy.dat
+PLOT my_var1,my_var2
+MESSAGE 
+
+! Just for the heck of it lets add the two variables together.
+PLOT my_var1+my_var2
+
+MESSAGE 
+
+! And just for the heck of it lets grab columns 3 and 4, only.
+
+FILE/VARIABLES="my_var1,my_var2"/FORMAT=(21X,F14.0,F8.0) snoopy.dat
+PLOT my_var1,my_var2
+
+MESSAGE 
+
+! Now suppose that the data, instead, represent a 2D grid with
+! 6 longitudes by 50 latitudes
+
+DEFINE AXIS/X=10e:60e:10/unit=degree xlong
+DEFINE AXIS/Y=0:49n:1/unit=degree y50
+DEFINE GRID/x=xlong/y=y50 gsnoopy2D
+! By default only one column will be read.  The /COLUMNS= tells FERRET how many
+FILE/VARIABLES=my_2D_var/COLUMNS=6/GRID=gsnoopy2D snoopy.dat
+contour my_2D_var
+
+MESSAGE 
+
+! or suppose it was a time series of 10 lat/long grids - each grid
+! having 6 longitudes by 5 latitudes
+
+DEFINE AXIS/Y=0:40n:10/unit=degree y5
+DEFINE AXIS/T=1-jan-1981:10-jan-1981:1/unit=day t10
+DEFINE GRID/x=xlong/y=y5/t=t10 gsnoopy3D
+FILE/VARIABLES=my_3D_var/COLUMNS=6/GRID=gsnoopy3D snoopy.dat
+contour/Y=10N my_3D_var
+
+SET MODE/LAST VERIFY
diff --git a/jnls/examples/fill_between.jnl b/jnls/examples/fill_between.jnl
new file mode 100644
index 0000000..b102fd8
--- /dev/null
+++ b/jnls/examples/fill_between.jnl
@@ -0,0 +1,89 @@
+
+\cancel mode verify
+! fill_between.jnl
+! 6/99 *sh*
+! From Weimin Wang/Steve Hankin emails  July 2000
+! cleanup Ansley Manke 10/2000
+! Bug fix: 3/2004 for depth axis polygon overlay was not drawn.
+
+! Description: Fill between two curves or a curve and a constant value
+
+! Usage:                   $1         $2   $3    $4
+! yes?  GO fill_between polygon_command data axis [base]
+! $1 - the polygon command with qualifiers (eg POLYGON/OVER/PALETTE=GREEN
+! $2 - a variable -- as if it were being plotted
+! $3 - the axis name for variable "data"
+! $4 - base curve or offset value.  If omitted, shade between "data" and 0.
+
+! example
+!  define axis/t=1-jan-1990:1-mar-1990:1/unit=days tday
+!  let a = SIN(T[gt=tday]/10)
+!  let b = 0.4*cos(T[gt=tday]/4) - 2
+!  plot a, b
+!  go fill_between poly/over/palette=red/line a tday b
+!  go fill_between poly/over/palette=yellow a tday 1.
+!  go fill_between poly/over/palette=green b tday -3
+
+! example with a depth axis
+!  use levitus_climatology
+!  let a = temp[y=0,x=180]
+!  let b = temp[y=60,x=180]
+!  plot a,b
+!  go fill_between poly/over/palette=green/line/nolab a zaxlevitr b
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO  fill_between polygon_command data axis [base]"
+QUERY/IGNORE $2"<usage: yes? GO  fill_between polygon_command data axis [base]"
+QUERY/IGNORE $3"<usage: yes? GO  fill_between polygon_command data axis [base]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET FBy = $2
+LET/QUIET FBbase = $4"0"
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL FBax `FBy,return=shape`
+DEFINE SYMBOL FBiax ($FBax"|X>i|Y>j|Z>k|T>l|<error: data is not a line")
+DEFINE SYMBOL FBbar_ax ($FBax"|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a line")
+
+DEFINE SYMBOL FBbase_ax `FBbase,return=shape`
+DEFINE SYMBOL FBbase_iax ($FBbase_ax"|X>i|Y>j|Z>k|T>l|POINT>i|<error: base is not a line")
+DEFINE SYMBOL FBbase_bar_ax ($FBbase_ax"|X>Z|Y>Z|Z>Z|T>Z|POINT>Z|<error: base is not a line")
+
+! get the independent axis out as a separate variable
+DEFINE SYMBOL FBilo `FBy,return=($FBiax)start`
+DEFINE SYMBOL FBihi `FBy,return=($FBiax)end`
+
+! Define a new non-depth axis in case of a depth axis: the poly overlay 
+! with /transpose is incorrect on a depth axis.
+
+define axis/($FBax) FBaxis=($FBax)[G($FBax)=$3] 
+LET/QUIET FBx = ($FBax)[G($FBax)=FBaxis,($FBiax)=($FBilo):($FBihi)]   !FBx=X[GX=ax,i=lo:hi]
+LET/QUIET FBx = ($FBax)[G($FBax)=$3,($FBiax)=($FBilo):($FBihi)]   !FBx=X[GX=ax,i=lo:hi]
+! assemble the vertices above and below
+LET/QUIET FBxup  = FBx
+LET/QUIET FByup  = FBy
+LET/QUIET FBxdn  = FBx
+LET FBydn  = 0.*FBy + FBbase
+
+
+LET/QUIET FBpindex = ($FBbar_ax)[($FBbar_ax)=1:4]
+
+LET/QUIET FBx4_0 = IF FBpindex EQ 1 OR FBpindex EQ 4 then FBxdn ELSE FBxup
+LET/QUIET FBy4_0 = IF FBpindex EQ 1 OR FBpindex EQ 4 then FBydn ELSE FByup
+LET/QUIET FBx4_1 = IF FBpindex LE 2 then FBx4_0 ELSE FBx4_0[($FBax)=@shf:-1]
+LET/QUIET FBy4_1 = IF FBpindex LE 2 then FBy4_0 ELSE FBy4_0[($FBax)=@shf:-1]
+
+! for Z -axis plot, transpose the overlay
+! if it is a depth axis, need to also multiply by -1.
+DEFINE SYMBOL FB_orient ($FBax"|X>fill|Y>fill|T>fill|Z>transpose|")
+DEFINE SYMBOL FB_mult ($FBax"|X>1|Y>1|T>1|Z>-1|")
+
+$1/($FB_orient)/coord_ax=($FBbar_ax) FBx4_1, FBy4_1
+
+IF `($FB_mult) LT 0` THEN $1/nolab/($FB_orient)/coord_ax=($FBbar_ax)  ($FB_mult)*FBx4_1, ($FB_mult)*FBy4_1
+! In case of a POLY/LINE command, also overlay with the opposite sign.
+IF `($FB_mult) LT 0` THEN $1/over/nolab/($FB_orient)/coord_ax=($FBbar_ax)  FBx4_1, ($FB_mult)*FBy4_1
+
+cancel symbol FB*
+cancel variable FB*
+set mode/last verify
diff --git a/jnls/examples/fnoc_demo.jnl b/jnls/examples/fnoc_demo.jnl
new file mode 100644
index 0000000..c35b639
--- /dev/null
+++ b/jnls/examples/fnoc_demo.jnl
@@ -0,0 +1,126 @@
+! fnoc_demo.jnl *jd* 11/91
+! 7/01 *acm* change uppercase GO LAND to GO land
+
+! Description: explores the Navy's FNOC surface marine wind field.
+
+! This demonstration explores the Navy's Fleet Numerical Oceanography Center
+! (FNOC) surface marine wind field.  The winds are on a 2.5 degree lat-lon
+! grid and are monthly averages.
+
+! Advanced use of FERRET commands in the demo will give you helpful examples
+! of their use.  See the User's Guide for more on individual commands.
+
+CAN REGION
+SET WIND/SIZE=.6/ASPECT=.86
+PPL CROSS 1 	! To cause the equator to be drawn in plots
+SET MODE VERIFY
+SET DATA monthly_navy_winds
+SHOW DATA monthly_navy_winds
+ 
+MESSAGE
+
+! Let's look at a particular month's vector winds.  Note that as the x & y
+! regions are not specified, the complete x & y axes are chosen for display --
+
+CAN REGION
+VECTOR/LEN=20/T="15-DEC-1990" UWND,VWND
+GO land
+
+MESSAGE
+
+! PPLUS, FERRET's graphics subsystem, can be invoked directly to display
+! the vector field more densely.
+
+VECTOR/LEN=20/T="15-DEC-1990"/SET UWND,VWND
+PPL VECTOR 3 2
+GO land
+
+! A time series of the winds at a point may be reviewed as well.
+
+PLOT/X=100W/Y=0 UWND,VWND
+
+MESSAGE
+
+! This can be smoothed along the time axis, taking out most of the annual cycle
+
+PLOT/X=100W/Y=0 UWND[T=@SBX:12],VWND[T=@SBX:12]
+
+MESSAGE
+
+! We can see a time-longitude plot of the zonal wind along the equator.
+
+GO rgb_centered
+SHADE/X=130E:80W/Y=0/LEV=(-10,10,2)/LINE/KEY UWND[T=@SBX:2]
+
+MESSAGE
+
+! Or compare winds at different locations in space.
+
+PLOT UWND[X=50W,Y=40N],UWND[X=180,Y=40N]
+
+MESSAGE
+
+! Let's smooth that.
+
+PLOT UWND[X=50W,Y=40N,T=@SBX:12],UWND[X=180,Y=40N,T=@SBX:12]
+
+MESSAGE
+
+! Using viewports we can see these two plots in separate areas.  Several
+! viewports are predefined and limit plotting to particular regions of the
+! available area.  Plot aspect ratio (x-size to y-size ratio) is changed
+! automatically to fit the space specified by the viewports.  Here are
+! the predefined viewports:
+
+SHOW VIEWPORT/ALL
+
+MESSAGE
+
+! Let's use viewport UPPER, using all the available X area (0.0 to 1.0) and
+! the upper half of the available Y area (0.5 to 1.0).  
+
+SET VIEWPORT UPPER
+PLOT UWND[X=50W,Y=40N,T=@SBX:12]
+
+! And then the lower portion of the available area for the second plot:
+
+SET VIEWPORT LOWER
+PLOT UWND[X=180,Y=40N,T=@SBX:12]
+
+MESSAGE
+
+! Viewports using any rectangular portion of the available area can be defined.
+! Let's define MY_UPPER using 3/4 of the upper area.  First cancel the use of 
+! viewports and clear the screen, then set up a viewport and use it:
+
+CAN VIEWPORT
+DEFINE VIEWPORT/XLIMITS=0,1/YLIMITS=0.25,1 MY_UPPER
+SET VIEWPORT MY_UPPER
+SHOW VIEWPORT MY_UPPER
+
+PLOT UWND[X=50W,Y=40N,T=@SBX:12]
+
+MESSAGE
+
+! Note in the definition of MY_UPPER the text attribute has been automatically
+! scaled to keep the plot and text sizes in the same proportion.  The text
+! can be made comparatively larger or smaller in the following way:
+
+CAN VIEWPORT
+DEFINE VIEWPORT/XLIMITS=0,1/YLIMITS=0.25,1/TEXT=2 MY_UPPER
+SET VIEWPORT MY_UPPER
+SHOW VIEWPORT MY_UPPER
+
+PLOT UWND[X=50W,Y=40N,T=@SBX:12]
+
+MESSAGE
+
+! Remember when you're ready to go back to using all the available plot area
+! to cancel the use of viewports.
+
+CAN VIEWPORT
+PLOT UWND[X=50W,Y=40N,T=@SBX:12]
+
+MESSAGE
+
+PPL CROSS 0
diff --git a/jnls/examples/graticules_demo.jnl b/jnls/examples/graticules_demo.jnl
new file mode 100644
index 0000000..5f6a1d8
--- /dev/null
+++ b/jnls/examples/graticules_demo.jnl
@@ -0,0 +1,97 @@
+! graticules_demo.jnl
+! 3/2004  ACM
+
+yes? SET WIN/SIZ=0.6
+yes? set mode verify
+
+! Ferret version 5.6 
+! The /GRATICULE, /HGRATICULE and /VGRATICULE qualifiers for
+! plot commands turn on and control the line type for graticule
+! lines at the tic marks of the axes.
+
+! /GRATICULE sets the horizontal and vertical tic marks to be
+! the same style.  The lines may take on the same characteristics 
+! as lines that we plot with the Ferret PLOT command:  dashed or
+! solid; colors Black,Red,Green,Blue,LightBlue,Purple, and White
+! and THICK=1,2, or 3 where 1 is thin and 3 is the thickest.
+
+yes? PLOT/GRAT=dash/i=1:40 sin(i/6)
+
+! We can give multiple arguments to the /GRATICULE qualifier within parentheses
+PAUSE
+
+yes? USE coads_climatology
+yes? SET REGION/X=130E:70W/y=30S:50N/L=1
+yes? CONTOUR/COLOR=blue/GRAT=(line,COLOR=red) sst
+yes? GO land thick
+
+! Here is another example of a simple /GRAT qualifier
+PAUSE
+
+yes? USE etopo20
+yes? SHADE/PAL=dark_land_sea/GRAT=(COLOR=white) rose
+yes? CANCEL REGION
+yes? CANCEL DATA/all
+
+! Next, a time axis. 
+PAUSE
+
+yes? USE monthly_navy_winds
+yes? SET REGION/X=180/Y=0/T=1-may-1988:1-may-1992
+yes? PLOT/THICK=3/GRAT=(COLOR=blue,THICK) uwnd
+
+
+! If there are large and small tics on the plot, each may have
+! graticule lines with different characteristics.  Recall that 
+! time axes and log axes automatically have small tic marks; you 
+! can turn on the small tic marks and control their spacing other 
+! axes using the commands listed under "axis, customizing" and 
+! "axis, PPLUS commands" in the Ferret Users Guide.
+
+PAUSE
+yes? PPL AXNMTC 2,2
+yes? PLOT/GRAT="large=(line),small=(color=blue,dash)"/i=1:40 sin(i/6)
+
+! Sometimes we might want to make different settings for the
+! horizontal and vertical graticules; when the two axes represent
+! different quantities, such as space and time, or very different
+! scales.
+
+! Next we will show a plot with a logarithmic axis
+PAUSE
+
+yes? DEF AXIS/Z/DEPTH dlog=exp(k[k=1:10])
+yes? LET fcn = k[gz=dlog]
+yes? PLOT/VLOG/VLIMITS=1:10000/HGRAT="LARGE(COLOR=red),SMALL(COLOR=lightblue)"/VGRAT fcn
+
+! And, a time axis, with only the vertical graticules on and
+! the small and large tics set differently.
+PAUSE
+
+yes? PPL AXNMTC 2,2
+yes? USE monthly_navy_winds
+yes? SET REGION/X=180/Y=0/T=1-may-1988:1-may-1992
+yes? plot/thick/VGRAT="LARGE(COLOR=blue),SMALL(COLOR=lightblue)" uwnd
+
+! Here we set the axis tics with PPL commands and do a shade plot
+PAUSE
+
+yes? PPL AXNMTC 2,1
+yes? USE etopo05
+yes? SET REGION/X=130E:160E/y=30S:0S
+yes? SHADE/SET/HGRAT="LARGE=(THICK),SMALL"/VGRAT="LARGE=(THICK),SMALL"\
+yes? /PALETTE=topo/LEV=(-9000,-1000,1000)(-1000,-100,100)(-100,0,10) rose
+yes? SET REGION/X=130E:160e/y=30S:0s
+yes? PPL XAXIS 130,160,8
+yes? PPL YAXIS -30,0,10
+yes? PPL SHADE
+yes? GO fland 5
+
+! Note that the land fill overplots the graticule lines. We can restore 
+! them by overlaying an empty plot with the original graticule qualifiers.
+PAUSE
+
+yes? LET baddat = `rose,RETURN=bad` + 0*rose
+yes? SHADE/OVER/NOLAB/HGRAT="LARGE=(THICK),SMALL"/VGRAT="LARGE=(THICK),SMALL" baddat
+
+
diff --git a/jnls/examples/image_to_kml.jnl b/jnls/examples/image_to_kml.jnl
new file mode 100644
index 0000000..9075688
--- /dev/null
+++ b/jnls/examples/image_to_kml.jnl
@@ -0,0 +1,163 @@
+! image_to_kmz.jnl
+\cancel mode verify
+!
+! ACM 7/1/2009 -- created
+! ATW 7/2/2009 -- minor modifications
+!
+! Write a kml file containing a Ferret image for use in Google Earth.
+! The tags that are written to the file are take from the documentation
+! at http://code.google.com/apis/kml/documentation/kmlreference.html
+! and comments in this script are take from that document.
+!
+! The image is made as a gif image with any missing data set to be
+! transparent, so that the Google Image map will show through it.
+!
+say START FERRET WITH ferret -gif SO THAT THE IMAGE CAN BE MADE WITH TRANSPARENCY
+!
+! Usage:
+!
+! > ferret -gif
+!
+!                        arg 1   arg 2   arg 3        arg 4    arg 5       arg 6
+!Usage:  GO image_to_kml gifFile kmlFile plot_command variable [xcoordVar] [YcoordVar]
+!
+!    gifFile        gif file to be saved
+!    kmlFile        kml file to write
+!    plot_command    2D plot command including palette, levels etc
+!    variable        variable to plot, must be 2D in longitude/latitude
+!    xcoordVar        For curvilinear grids, the longitude coordinate variable
+!    xcoordVar        For curvilinear grids, the latitude coordinate variable
+!
+!
+!Examples:
+! > ferret -gif
+!
+! yes? USE etopo20
+! yes? GO image_to_kml rose.gif rose.kml SHADE/Y=-60:60/pal=dark_land_sea/lev=c rose
+!
+!    ! or for a variable with curvilinear coordinates geolon,geolat:
+!
+! yes? use my_curvilinear_data.nc
+! yes? GO image_to_kml curv.gif curv.kml FILL/MOD/HLIM=-180:180 var[t=1-jan-2005] geolon geolat
+
+query/ignore $1%Argument 1 is a gif file name%
+query/ignore $2%Argument 2 is a kml file name%
+query/ignore $3%Argument 3 is the plot comand%
+query/ignore $4%Argument 4 is the variable in XY%
+
+DEFINE SYMBOL pcommand = $3
+DEFINE SYMBOL var = $4
+
+IF $5"0|*>1" THEN
+  DEFINE SYMBOL var ($var),$5"0"
+ENDIF
+IF $6"0|*>1" THEN
+  DEFINE SYMBOL var ($var),$6"0"
+ENDIF
+
+DEFINE SYMBOl gifFile = $1
+IF `STRINDEX("($gifFile)","gif") EQ 0` THEN
+  SAY Argument 1 is a gif file name
+  EXIT/SCRIPT
+ENDIF
+
+DEFINE SYMBOL kmlname = $2
+IF `STRINDEX("($kmlname)","kml") EQ 0` THEN
+  SAY Argument 2 is a kml file name
+  EXIT/SCRIPT
+ENDIF
+
+DEFINE SYMBOL dispname = FerretPlot
+
+DEFINE VIEW/AXES/XLIM=0:1/YLIM=0:1 WMSview
+SET VIEW WMSview
+
+($pcommand) ($var)
+FRAME/TRANS/FORMAT=gif/FILE=($gifFile)
+
+DEFINE SYMBOL kml_write LIST/QUIET/nohead/norowhead/file="($kmlname)"/format=(a)
+
+! Header lines
+!<kml>
+!    The root element of a KML file. This element is required.
+!    It follows the xml declaration at the beginning of the file.
+
+($kml_write)/clobber {"<?xml version='1.0' encoding='UTF-8'?>"}
+($kml_write)/append  {"<kml xmlns='http://earth.google.com/kml/2.1'>"}
+
+!<Folder>
+!    A Folder is used to arrange other Features hierarchically
+!   (Folders, Placemarks, NetworkLinks, or Overlays). A Feature is visible
+!    only if it and all its ancestors are visible.
+
+($kml_write)/append {"    <Folder>"}
+
+
+!<GroundOverlay>
+!    This element draws an image overlay draped onto the terrain. The
+!    <href> child of <Icon> specifies the image to be used as the overlay.
+!    This file can be either on a local file system or on a web server.
+
+($kml_write)/append {"      <GroundOverlay>"}
+
+!<name>
+!    User-defined text displayed in the 3D viewer as the label for
+!    the object (for example, for a Placemark, Folder, or NetworkLink).
+
+($kml_write)/append {"         <name>($dispname)</name>"}
+
+!<LookAt>
+!    Defines a virtual camera that is associated with any element
+!    derived from Feature.
+
+($kml_write)/append {"         <LookAt>"}
+($kml_write)/append {"               <longitude>180</longitude>"}
+($kml_write)/append {"               <latitude>20</latitude>"}
+($kml_write)/append {"               <range>3035000.36838438907</range>"}
+($kml_write)/append {"               <tilt>0</tilt>"}
+($kml_write)/append {"               <heading>0</heading>"}
+($kml_write)/append {"         </LookAt>"}
+
+!<visibility>
+!    Boolean value. Specifies whether the feature is drawn in the 3D viewer when it
+!    is initially loaded. In order for a feature to be visible, the <visibility>
+!    tag of all its ancestors must also be set to 1. In the Google Earth LIST/QUIET View,
+!    each Feature has a checkbox that allows the user to control visibility of the Feature.
+($kml_write)/append {"         <visibility>1</visibility>"}
+
+!<Icon>
+!    Defines an image associated with an Icon style or overlay.
+!    (For this script this is a simple gif image file.)
+
+($kml_write)/append {"         <Icon>"}
+($kml_write)/append {"            <href>($gifFile)</href>"}
+($kml_write)/append {"         </Icon>"}
+
+
+!<LatLonBox>
+!    Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
+!
+!        * <north> Specifies the latitude of the north edge of the bounding box, in decimal degrees from 0 to �90.
+!        * <south> Specifies the latitude of the south edge of the bounding box, in decimal degrees from 0 to �90.
+!        * <east> Specifies the longitude of the east edge of the bounding box, in decimal degrees from 0 to �180. (For overlays that overlap the meridian of 180� longitude, values can extend beyond that range.)
+!        * <west> Specifies the longitude of the west edge of the bounding box, in decimal degrees from 0 to �180. (For overlays that overlap the meridian of 180� longitude, values can extend beyond that range.)
+!        * <rotation> Specifies a rotation of the overlay about its center, in degrees. Values can be �180. The default is 0 (north). Rotations are specified in a counterclockwise direction.
+
+($kml_write)/append {"         <LatLonBox>"}
+($kml_write)/append {"             <north>($ppl$ymax)</north>"}
+($kml_write)/append {"             <south>($ppl$ymin)</south>"}
+($kml_write)/append {"             <east>($ppl$xmin)</east>"}
+($kml_write)/append {"             <west>($ppl$xmax)</west>"}
+($kml_write)/append {"             <rotation>0</rotation>"}
+($kml_write)/append {"         </LatLonBox>"}
+
+
+! Close the remaining tags
+
+($kml_write)/append {"      </GroundOverlay>"}
+($kml_write)/append {"    </Folder>"}
+($kml_write)/append {"</kml>"}
+
+cancel symbol kml_write
+
+set mode/last verify
diff --git a/jnls/examples/janfebmar_time_axis.jnl b/jnls/examples/janfebmar_time_axis.jnl
new file mode 100644
index 0000000..67bb510
--- /dev/null
+++ b/jnls/examples/janfebmar_time_axis.jnl
@@ -0,0 +1,61 @@
+! janfebmar_time_axis.jnl 2/96 *sh*
+
+! based on question from user Donna Sengelaub at Naval Postgraduate School
+
+! Description: a time axis of Jan,Feb,Mar only from successive years
+
+! ============================
+
+! define some fictitious data ...
+! suppose the data is on a weekly axis
+define axis/t=1-jan-1987:1-jan-1997:7/unit=days t_weeks
+define grid/t=t_weeks g_weeks
+let my_data = sin(l[g=g_weeks])
+
+! regrid to daily data so the data points fill each month
+define axis/t="1-jan-1987:12:00":"1-jan-1997:12:00":1/unit=days t_days
+define grid/t=t_days g_days
+let my_data_daily = my_data[g=g_days]
+
+set wind/asp=.5	! looks nicer for time series plot
+
+! plot the first year of data
+define view/xlim=0,.1/text=1 y87
+set view y87
+ppl axlen ($VP_width)
+plot/t=1-jan-1987:31-mar-1987/title=" "/set_up my_data_daily
+ppl axset 1,1,1,0		! no right hand axis
+GO unlabel 1; GO unlabel 2; GO unlabel 3
+ppl plot
+
+! plot the second year of data
+define view/xlim=.1,.2/text=1 y88
+set view y88
+ppl axlen ($VP_width)
+plot/t=1-jan-1988:31-mar-1988/title=" "/set_up my_data_daily
+ppl axset 1,1,0,0		! no right or left hand axis
+GO unlabel 1; GO unlabel 2; GO unlabel 3
+ppl plot
+
+! plot the third year of data
+define view/xlim=.2,.3/text=1 y89
+set view y89
+ppl axlen ($VP_width)
+plot/t=1-jan-1989:31-mar-1989/title=" "/set my_data_daily
+GO unlabel 1; GO unlabel 2; GO unlabel 3
+ppl plot
+
+! repeat for other years
+REPEAT/I=3:6 (define view/xlim=`i/10`,`(i+1)/10`/text=1 y`87+i`; set view y`87+i`; ppl axlen ($VP_width); plot/t=1-jan-19`87+i`:31-mar-19`87+i`/title=" "/set my_data_daily; GO unlabel 1; GO unlabel 2; GO unlabel 3; ppl plot)
+
+! plot the final year of data
+define view/xlim=.7,.8/text=1 y94
+set view y94
+ppl axlen ($VP_width)
+ppl axset 1,1,0,1
+plot/t=1-jan-1989:31-mar-1989/title=" " my_data_daily
+
+! clean up
+ppl axset 1,1,1,1
+
+
diff --git a/jnls/examples/land_detail_demo.jnl b/jnls/examples/land_detail_demo.jnl
new file mode 100644
index 0000000..7091bcb
--- /dev/null
+++ b/jnls/examples/land_detail_demo.jnl
@@ -0,0 +1,42 @@
+
+SET WINDOW/SIZE=0.6
+CAN MODE logo
+PPL AXLEN,7.8
+
+set mode verify
+
+! U.S.  State boundaries are available in the North and South
+! America. Here we use pen-color codes 8 and 9 for thick lines
+! along the national and state boundaries in red and green, so 
+! that the rivers, drawn with thinner lines, show up on top of 
+! the national or state boundary lines.
+
+go fland 40 white basemap solid x=232:241 y=44:50
+go land_detail black overlay 8 9 blue lightblue
+! frame/file=land_detail_1.gif
+pause
+
+! Showing national boundaries and rivers. Access the detailed
+! topography/bathymetry data from Smith and Sandwell via DODS
+
+use "http://www.ferret.noaa.gov/cgi-bin/nph-dods/data/PMEL/smith_sandwell_topo_v8_2.nc"
+fill/lev=(0,10000,10000)/pal=tan/x=0:24/y=30:46 rose
+fill/over/lev=(-5000,-1000,500)(-1000,0,50)/pal=topo/x=0:24/y=30:46 rose
+go land_detail black overlay red green blue blue
+! frame/file=land_detail_2.gif
+
+can data/all
+
+pause
+! Showing international marine boundaries
+
+use etopo20
+fill/x=80:240/y=-50:20/pal=land_sea/lev=(-9000,9000,500) rose
+
+! Show continental, national and international marine boundaries
+
+go land_detail black overlay red " " " " " " red
+
+can data/all
+
+! frame/file=land_detail_3.gif
diff --git a/jnls/examples/langrangian.sub b/jnls/examples/langrangian.sub
new file mode 100644
index 0000000..21da88c
--- /dev/null
+++ b/jnls/examples/langrangian.sub
@@ -0,0 +1,16 @@
+\ cancel mode verify
+! langrangian.sub
+! 10/17/95
+
+! integrate forward in time by dtsec and plot tracers
+
+user/command=sample/opt2=c/opt1="hole,standard_bad"/file=uwind.next uwnd[d=monthly_navy_winds],xpts,ypts,1/0,1/0
+user/command=sample/opt2=c/opt1="hole,standard_bad"/file=vwind.next vwnd[d=monthly_navy_winds],xpts,ypts,1/0,1/0
+
+sp mv uwind.next uwind.prev
+sp mv vwind.next vwind.prev
+
+! read and plot the new locations
+plot/vs/over/sym=21/nolab/d=uwind.prev/set xloc,yloc; ppl pen 1,2; ppl plot/over
+
+set mode/last verify
diff --git a/jnls/examples/langrangian_example.jnl b/jnls/examples/langrangian_example.jnl
new file mode 100644
index 0000000..4973ed9
--- /dev/null
+++ b/jnls/examples/langrangian_example.jnl
@@ -0,0 +1,50 @@
+! langrangian_example.jnl
+! 10/17/95
+! *acm* 7/01 update ppl pen 1,2  to plot/color=
+
+! illustration of tracer plots
+! slow and klunky ... but it works
+
+! clean up past files
+sp rm -f  vwind.prev uwind.prev vwind.next uwind.next
+
+! constant parameters
+let deg2m   = 111177
+let deg2rad = 3.14159/180
+let dtsec   = 21600   		! 6 hours
+
+set dat monthly_navy_winds
+
+set region/y=20s:20n/x=130e:80w
+set region/t=17-JAN-1982
+set mode interp			! only significant if time-varying field
+
+! this causes Ferret to **reread** data files at every access
+! -- it picks up changes to the file this way
+set mode stupid
+
+! base map for Langrangian tracers
+go basemap
+vector/over uwnd,vwnd
+cancel region/x/y
+
+! initial Langrangian "float" locations
+let is = i[i=1:24]	! 24 points in X
+let js = j[j=1:15]	! 15 points in Y
+let xpts = 125 + is*15 +(js-js)
+let ypts = (-22) + js*5 + (is-is)
+plot/vs/over/sym=22/color=red/nolab xpts,ypts
+
+user/command=sample/opt2=c/opt1="hole,standard_bad"/file=uwind.prev uwnd[d=monthly_navy_winds],xpts,ypts,1/0,1/0
+user/command=sample/opt2=c/opt1="hole,standard_bad"/file=vwind.prev vwnd[d=monthly_navy_winds],xpts,ypts,1/0,1/0
+
+file/var=usamp,xloc,yloc uwind.prev
+file/var=vsamp vwind.prev
+
+! redefine xpts and ypts to be the "next" time step
+let xpts = xloc[d=uwind.prev] + ((usamp[d=uwind.prev]*dtsec)/deg2m)/cos(yloc[d=uwind.prev]*deg2rad)
+let ypts = yloc[d=uwind.prev] +  (vsamp[d=vwind.prev]*dtsec)/deg2m
+
+! LOOP
+repeat/l=1:25 go langrangian.sub
+
diff --git a/jnls/examples/levitus_demo.jnl b/jnls/examples/levitus_demo.jnl
new file mode 100644
index 0000000..28dd9e1
--- /dev/null
+++ b/jnls/examples/levitus_demo.jnl
@@ -0,0 +1,152 @@
+! levitus_demo.jnl *jd* 11/91 2/95
+
+! *acm* 7/01 change uppercase GO LAND to GO land
+
+! Description: explores the Climatological Atlas of the World Ocean
+
+! This demonstration explores the Climatological Atlas of the World Ocean, 
+! actually a subset of it, compiled by Sydney Levitus.  The present data set
+! contains the annual average value of ocean temperature and salinity at 20
+! levels to 5000 meters, over the world ocean.
+
+! Advanced use of FERRET commands in the demo will give you helpful examples
+! of their use.  See the User's Guide for more on individual commands.
+
+SET MODE VERIFY
+
+SET DATA levitus_climatology
+SHOW DATA levitus_climatology
+
+! The data set is 1x1 degree in lat-lon resolution.
+! Let's check out the vertical grid --
+
+MESSAGE
+
+SHOW GRID/Z TEMP
+
+MESSAGE
+
+! Let's first display the sea surface temperature and salinity over the globe
+
+CANCEL REGION
+SET WIND/SIZE=.6/ASPECT=.86
+PPL CROSS 1	! This PPL command causes a line to be drawn at the equator 
+PALETTE rainbow
+SHADE/K=1 TEMP
+ 
+MESSAGE
+
+! Or, looking at the structure of the temperature field more closely --
+
+SHADE/K=1/LEV=(-2,32,1) TEMP
+
+! You can note --
+!	The `cold tongue' in the eastern equatorial Pacific, the western 
+!	Pacific equatorial warm pool, the effects of the gulf stream in the 
+!	NE Atlantic at about 60 North and that in the subtropics surface
+!	temperatures are greater in the west than in the east.
+
+MESSAGE
+
+SHADE/K=1 SALT
+
+MESSAGE
+
+! The levels chosen for salinity are not the best -- let's change them
+
+SHADE/K=1/LEV=(0,49,3)(33,37,.4) SALT
+
+! In surface salinity you can note --
+!	Higher salinity in the centers of the subtropical gyres.
+!	The difference in salinity between the Mediterranean and the Baltic.
+!	Low salinity in river outflows: the Amazon, Congo and Ganges.
+
+MESSAGE
+
+! Now overlay the two fields and outline the land masses
+
+SHADE/K=1/LEV=(-2,32,2) TEMP
+CONTOUR/OVER/K=1/LEV=(0,49,3)(33,37,.4) SALT
+GO land
+
+! The relationship between surface temperature and salinity is not simple.
+
+MESSAGE
+
+! Now let's look deeper -- but also retain this view, and the same levels 
+! for comparison
+
+SET WINDOW/CLEAR
+SET WINDOW/SIZE=.4 2	! Open a second window smaller than the present one
+SHADE/K=1/LEV=(-2,32,2) TEMP
+CONTOUR/OVER/K=1/LEV=(0,49,3)(33,37,.4) SALT
+GO land
+
+SET WINDOW 1
+SHADE/Z=200/LEV=(-2,32,2) TEMP
+CONTOUR/OVER/Z=200/LEV=(0,49,3)(33,37,.4) SALT
+GO land
+
+! Note at 200 meters temperature and salinity are more closely related.  
+
+MESSAGE
+
+! And now a meridional slice -- first in the Atlantic
+
+FILL/X=30W/LEV=(-2,32,2) TEMP
+CONTOUR/OVER/X=30W/LEV=(0,49,3)(33,37,.4) SALT
+
+! The warm subtropical gyres are evident here; there is correlation between
+! temperature and salinity, and note the Antarctic Intermediate Water's 
+! strong signal in salinity near 60 South at the surface, extending 
+! equatorward around 1000 meters.
+
+MESSAGE
+
+! And then in the Pacific
+
+FILL/X=180W/LEV=(-2,32,2) TEMP
+CONTOUR/OVER/X=180W/LEV=(0,49,3)(33,37,.4) SALT
+
+MESSAGE
+
+! T-S diagrams may be constructed with a single "sounding"
+
+PLOT/VS/LINE/X=20W/Y=35N SALT,TEMP
+
+! Illustrating the general monotonic decrease of temperature with depth.  This
+! is in general true of salinity too but note here around 10 degrees Celsius 
+! salinity increases -- due to inflow at depth into the Atlantic of
+! higher salinity Mediterranean water.
+
+MESSAGE
+
+! Or using multiple soundings over a selected area
+
+REPEAT/X=22W:20W REPEAT/Y=30N:32N PLOT/VS/LINE/OVER SALT,TEMP
+
+MESSAGE
+
+! Alternatively
+
+PLOT/VS/X=22W:20W/Y=30N:32N/SYMBOL=26 SALT,TEMP
+
+MESSAGE
+
+! And water masses at different levels can be compared
+
+SET VIEW UL
+PLOT/VS/X=25W:20W/Y=30N:35N/Z=0/SYMBOL=18 SALT,TEMP
+SET VIEW UR
+PLOT/VS/X=25W:20W/Y=30N:35N/Z=50/SYMBOL=18 SALT,TEMP
+SET VIEW LL
+PLOT/VS/X=25W:20W/Y=30N:35N/Z=100/SYMBOL=18 SALT,TEMP
+SET VIEW LR
+PLOT/VS/X=25W:20W/Y=30N:35N/Z=200/SYMBOL=18 SALT,TEMP
+
+MESSAGE
+
+CANCEL VIEWPORT
+CANCEL WINDOW 2
+PPL CROSS 0
+
diff --git a/jnls/examples/log_plot_demo.jnl b/jnls/examples/log_plot_demo.jnl
new file mode 100644
index 0000000..66b29f7
--- /dev/null
+++ b/jnls/examples/log_plot_demo.jnl
@@ -0,0 +1,32 @@
+\cancel mode verify
+
+! Description: demonstrates log plots using PLOT+ in FERRET
+
+! *acm* 7/01 update /xlimits to /hlimits
+! *acm*12/01 update to use /VLOG  and /HLOG qualifiers.
+
+cancel viewports
+set window/size=.75/aspect=1.2
+set mode verify
+
+! example 1: Y axis as log axis
+set view upper
+plot/x=1:100 exp(-1*x/5)
+
+set view lower
+ppl axtype 1,2
+plot/vlog/x=1:100 exp(-1*x/5)
+
+message
+set window/clear
+
+! example 2: X axis as log axis
+! note that the axis limits are specified in data units
+set view upper
+plot/x=1:100 sin(x/6)
+
+set view lower
+ppl axtype 2
+plot/x=1:100/hlog/hlimits=1:100 sin(x/6)
+
+
diff --git a/jnls/examples/mathematics_demo.jnl b/jnls/examples/mathematics_demo.jnl
new file mode 100644
index 0000000..1b2e883
--- /dev/null
+++ b/jnls/examples/mathematics_demo.jnl
@@ -0,0 +1,62 @@
+! mathematics.jnl *sh* 11/91 - added "pretty" display at end 11/93
+
+! Description: demo of computation and display of "abstract expressions"
+
+! The following example supplied by Ping Chang, PMEL postdoc, 4/90.
+! Vhat and Hhat are the results of a perturbation calculation of Ping's
+
+! in case a region setting was left by a previous command
+CANCEL REGION
+
+LET lg=10
+LET delta=.25
+
+LET a=y/lg
+LET tanh = (EXP(a)-EXP(-1*a))/(EXP(a)+EXP(-1*a))
+LET d = (1+delta*(tanh-1))^.5
+LET b = -1*x/d
+LET vhat=-1*(.5+b)*d[y=@ddc]*EXP(b)/(d*d)
+LET hhat=-1*(.5-b)*d[Y=@DDC]*EXP(b)/d
+
+DEFINE AXIS/X=0:4:.1   xax
+DEFINE AXIS/Y=-20:20:.2/unit="ROSSBY RADIUS" yax
+DEFINE GRID/X=xax/Y=yax gping
+SET GRID gping
+
+! Now we will produce a contour plot of VHAT over the domain.
+! X=[0,4] and Y=[-20,20]
+contour vhat
+
+! Now lets try it again for different values of the parameters.
+LET lg=25
+LET delta=.5
+message
+contour vhat
+
+! We'll finish up with a "pretty picture" of the vhat field
+message
+LET lg=10
+LET delta=.25
+set window/asp=1.4/size=.6
+set view upper
+contour/lev=(-.01,.01,.002)PEN(-.01,0,.002,4)PEN(0,.01,.002,2)DARK(0)/set vhat
+ppl title .3, @TR-(B+1/2)*D_y*e^B/D^2     ! big title with sub/superscripts
+ppl contour
+
+! a wire frame of it at lower resolution right underneath
+set view lower
+DEFINE AXIS/X=0:4:.25   xcoarse
+DEFINE AXIS/Y=-20:20:1.5/unit="ROSSBY RADIUS" ycoarse
+DEFINE GRID/X=xcoarse/Y=ycoarse gcoarse
+SET GRID gcoarse
+wire/nolab/viewpoint=0.5,-80,.004/zscale=1500 vhat
+
+! We will now clean up FERRET for whatever you, the user, will be doing next.
+! To experiment with these mathematical functions further use the command
+!     SET GRID gping
+message
+
+SET GRID abstract
+CANCEL VIEWPORTS
+set wind/asp=.75:ax       ! default aspect ratio
+ppl lev () (-.01,.01,.002,1) pen(-.01,.01,.002,1) ! reset PLOT+ contour colors 
diff --git a/jnls/examples/mercator_demo.jnl b/jnls/examples/mercator_demo.jnl
new file mode 100644
index 0000000..cafda8a
--- /dev/null
+++ b/jnls/examples/mercator_demo.jnl
@@ -0,0 +1,80 @@
+! mercator_demo.jnl  9/96
+
+! Description: Plot a 2-panel demonstration of a Mercator projection
+! Note that Lambert conformal is very similar (see Lambert conformal eqn below)
+
+! usage:   GO mercator_demo [Y_lo, Y_hi] [Y_tics] 
+! Y_lo,Y_hi  - latitude range to plot
+! Y_tics     - the tic spacing on the Mercator plot
+
+! The technique that is used is to create a new Y axis of "page positions"
+! made by transforming the latitudes of the data grid using the
+! Mercator equations. Then "associate" the data with these page positions
+! (replacing the original latitudes) using the "GY=@ASN" syntax.
+
+! The only complication to this is to get the axis tic marks as desired
+! For that we use the REPEAT loop at the end of the demo
+
+!	Map Projections -- A Working Manual
+!	J.P. Snyder
+!	USGS Professional Paper 1395
+!	US Govt Printing Office, 1987.
+
+
+CANCEL REGION
+SET WIND/ASP=1.2
+SET DATA etopo60
+
+! determine J index limits corresponding to requested latitude range
+! (the default range is 80S to 80N)
+LET j_lo = J[G=ROSE,Y=$1"80S"]
+LET j_hi = J[G=ROSE,Y=$2"80N"]
+
+! ***** Standard Rectilinear Projection (for comparison) *****
+SET VIEW upper
+GO magnify 1.2		! looks nicer
+
+SHADE/LEV=(0,10000,1000)/PALETTE=dark_terrestrial/NOKEY/j=`j_lo`:`j_hi` rose
+
+
+! ***** Mercator Projection *****
+SET VIEW lower
+GO magnify 1.2		! looks nicer
+
+! define the vertical page location axis
+! (the transformed latitudes of the grid to be plotted)
+LET pi = 3.141529
+LET degrad = pi/180
+LET radian_lat = degrad * y[g=rose]
+LET yp = LOG(TAN(radian_lat/2 + pi/4))		! Mercator eqn
+! LET yp = SIN(radian_lat)			! Lambert Conformal eqn.
+DEFINE AXIS/from/y/name=ypageax yp
+
+! plot the data on a Mercator projection (omit Y axis)
+SHADE/LEVELS/PALETTE=dark_terrestrial/NOKEY/SET_UP/j=`j_lo`:`j_hi` rose[gy=ypageax at asn]
+PPL YLAB
+PPL AXSET 1,1,0,0	! suppress latitude axes
+PPL TITLE .15 @CRRelief using Mercator Projection
+PALETTE dark_terrestrial;ppl shade;palette default
+PPL AXSET 1,1,1,1
+
+! *** Vertical Axis Tics ***
+
+! draw vertical axis lines
+PPL ALINE/NOUSER 1,0,0,0,($PPL$YLEN)
+PPL ALINE/NOUSER 1,($PPL$XLEN),0,($PPL$XLEN),($PPL$YLEN)
+
+! "lat" will be the latitude of each tic to be drawn
+LET radian_lat=degrad * lat
+DEFINE AXIS/Y=$1"80s":$2"80n":$3"40" ytics
+
+! small correction to get label text to align with tic mark
+LET lat = `y[gy=ytics,y=$1"80s"]`; LET ypage_lo = `yp`
+LET lat = `y[gy=ytics,y=$2"80n"]`; LET ypage_hi = `yp`
+LET yoffset = 0.02*(ypage_hi - ypage_lo)
+
+! draw the tics
+! note 1: the tic at the equator should really be drawn separately
+REPEAT/Y=$1"80s":0:$3"40" (LET lat=`y[gy=ytics]`; PPL ALINE 1,12,`yp`,20,`yp`; LABEL 8,`yp-yoffset`,1,0,.1  "@SR`ABS(lat)`#S")
+REPEAT/Y=0:$2"80n":$3"40" (LET lat=`y[gy=ytics]`; PPL ALINE 1,12,`yp`,20,`yp`; LABEL 8,`yp-yoffset`,1,0,.1  "@SR`lat`#N")
+LABEL -15,0,0,90,.12 LATITUDE
diff --git a/jnls/examples/minmax_label_demo.jnl b/jnls/examples/minmax_label_demo.jnl
new file mode 100644
index 0000000..82c5343
--- /dev/null
+++ b/jnls/examples/minmax_label_demo.jnl
@@ -0,0 +1,31 @@
+! example to call label_hi_lo.jnl to label extrema 
+! 1/2002 change in the "neighborhood" arguments fromm
+!        number of gridpoints, to range in data units.
+
+use coads_climatology
+set region/l=7/x=100:360/y=-20:60
+
+fill/line/pal=no_red slp; go fland
+go label_hi_lo.jnl slp label 10 8 green purple
+
+pause
+contour slp
+go fland
+go label_hi_lo.jnl slp mark 6 6 red blue
+
+pause
+! note: cannot set region in square brackets on the call to 
+!       label_hi_lo, but as long as the time region is set,the
+!       script gets ppl$xmin, ppl$xmax, etc and is ok
+
+can region
+set region/l=7
+fill/line/pal=no_red slp[l=7,x=100:360,y=-20:60]; go fland
+go label_hi_lo.jnl slp label 10 8 green purple
+
+message but this fails:
+
+can region
+
+fill/line/pal=no_red/l=7/x=100:360/y=-20:60 slp; go fland
+go label_hi_lo.jnl slp[l=7] label 10 8 green purple
diff --git a/jnls/examples/mp_stereo_demo.jnl b/jnls/examples/mp_stereo_demo.jnl
new file mode 100644
index 0000000..71198ef
--- /dev/null
+++ b/jnls/examples/mp_stereo_demo.jnl
@@ -0,0 +1,74 @@
+! mp_stereo_demo.jnl
+
+! Description: demonstrate fancy map projection techniques
+! ACM June 15, 2001
+
+SET WINDOW/SIZE=0.6
+USE etopo40
+SET GRID rose
+
+!  Define a region in the northern hemisphere.
+
+LET xmin = 280; LET xmax = 360
+LET ymin = 10; LET ymax = 80
+LET xdel = 10; LET ydel = 10
+
+LET mid_lon = `xmin+(xmax-xmin)/2`
+LET mid_lat = `ymin+(ymax-ymin)/2`
+SET REGION/X=`xmin`:`xmax`/Y=`ymin`:`ymax`
+
+!   Set up the map projection parameters and apply the 
+!   correct aspect ratio.
+
+GO mp_stereographic_north `mid_lon` `mid_lat`
+LET masked_rose = rose * mp_mask
+GO mp_aspect
+
+!   Plot the data.  Use SHAKEY to make the color key at the top of the plot and
+!   control its size and location.  For a description of SHAKEY see the on-line
+!   Ferret Users' Guide at http://www.ferret.noaa.gov/Ferret/Documentation/Users_Guide/current/fer_html.htm
+
+!   The arguments to SHAKEY are 
+!   SHAKEY do_key, orient, klab_siz, klab_inc, klab_dig, klab_len, kx_lo, kx_hi, ky_lo, ky_hi
+!   Here we place a key at the top, label size 0.1.  Every second interval is labelled.
+!   The x-coordinates of the corners of the key are 2.5, 8.5  and the bottom and top 
+!   are at 7.5, 8.2
+
+FILL/NOAXES/NOLAB/PALETTE=land_sea/SET_UP masked_rose, x_page, y_page
+PPL SHAKEY 1, 0, 0.1, 2, , , 2.5, 8.5, 7.5, 7.8
+PPL FILL
+
+GO mp_land
+
+!   Now mark a set of points, such as observation locations.
+!   In practice these would be read from a data file.
+
+LET xlon = {307, 307,  307, 307, 312, 315, 318, 321, 324, 327}
+LET ylat = { 25,  26, 27.5,  29,  31,  31,  31,  31,  31,  33}
+
+GO mp_polymark pOLY/OVER/NOLAB/NOAXES/NOKEY/PALETTE=black xlon, ylat, , square, 0.3
+
+!   Mark latitude and longitude with a graticule. 
+
+GO mp_graticule `xmin` `xmax` `xdel` `ymin` `ymax` `ydel` 
+
+!  Label the graticules  every X line and every second Y line.
+
+REPEAT/K=`xmin`:`xmax`:`xdel` (GO mp_label `k` `ymin-2` 0 `k-mid_lon` 0.12 "@CR`k`")
+REPEAT/K=`ymin+ydel`:`ymax-ydel`:`2*ydel` (GO mp_label `xmin-2` `k`  1 `xmin-mid_lon` 0.12 "@CR`k`")
+REPEAT/K=`ymin+ydel`:`ymax-ydel`:`2*ydel` (GO mp_label `xmax+2` `k` -1 `xmax-mid_lon` 0.12 "@CR`k`")
+
+!  Note: in the Southern Hemisphere these commands would be as follows.
+!        The index K needs to be positive so we use -1* k for the latitude labels.
+!        Also the 4th argument to mp_label, the angle at which the label is drawn, is 
+!        "mid_lon - longitude"  for the Southern Hemisphere
+
+! REPEAT/K=`xmin`:`xmax`:`xdel` (GO mp_label `k` `ymax+2` 0 `mid_lon-k` 0.12 "@CR`k`")
+! REPEAT/K=`-1*(ymin+ydel)`:`-1*(ymax-ydel)`:`2*ydel` (GO mp_label `xmin-2` `-1*k` -1 `mid_lon-xmin` 0.12 "@CR`-1*k`")
+! REPEAT/K=`-1*(ymin+ydel)`:`-1*(ymax-ydel)`:`2*ydel` (GO mp_label `xmax+2` `-1*k`  1 `mid_lon-xmax` 0.12 "@CR`-1*k`")
+
+
+!  Add labels in world coordinates.
+
+GO mp_label `xmin-2*xdel` `ymax-ydel` 1 0 0.14 "@CRETOPO Topography"
+GO mp_label mid_lon `ymin-0.5*ydel` 0 0 .18 "@CRObservation Sites"
diff --git a/jnls/examples/multi_line_labels_demo.jnl b/jnls/examples/multi_line_labels_demo.jnl
new file mode 100644
index 0000000..28ef988
--- /dev/null
+++ b/jnls/examples/multi_line_labels_demo.jnl
@@ -0,0 +1,78 @@
+!  Starting with Ferret v5.53, we can send multi-line labels
+!  to plots, including the title, axis labels, and moveable labels.
+!  Separate  the lines using the separator <NL>, which can be 
+!  uppercase or lowercase.
+     
+set win/siz=0.5
+set view full
+
+plot/i=1:100/title="multi line title<nl>with the second line pretty long: \
+so Ferret will resize the entire title. Titles are \
+<nl>sized according to the longest line <nl>and lines are centered individually" i*cos(i/8)
+plot/over/i=1:100 i*sin(i/8)
+
+pause
+plot/i=1:100/title="@p2TWO-LINE<NL>RED TITLE"/set i*cos(i/8)
+ppl ylab "A four-line y label.<nl>second line<nl>third line<NL>fourth line"
+ppl xlab "a two-line X label. <nl>Not good together with a multi-line title"
+ppl plot
+
+Message "For overlay plots the title is used for a key at the lower left"
+ 
+plot/over/i=1:100/title="short two-line<nl>title for the overlay line" i*sin(i/8)
+plot/over/i=1:100/title="here is the key for the<nl>second overlay line" i*sin(i/4)
+
+message "Now some moveable labels with the LABEL command."
+label 10,80,-1,-20,0.2,"@CSfonts and @p2colors<nl>a at p1nd at an angle<NL>\
+no at p3w green and @CRCR font<NL>back at CS to script"
+
+label 30,-70,-1,40,0.2,"first line, then blank<NL> <NL>third line, all rotated"
+
+label/nouser 6.5,6,1,90,0.2,"@p2Another @CImoveable label<nl>Set to @CRCR and @p4P4\
+<NL>at 90 degrees"
+ 
+message "a set of multi-line key labels."
+plot/title="multi-line key labels"/i=1:100 i*sin(i/12)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 1" i*sin(i/6)
+plot/over/i=1:100/title="Two-lines<nl>overlay 2" i*cos(i/6)
+plot/over/i=1:100/title="Three-lines<nl>second line<nl>overlay 3" -1*cos(i/10)
+plot/over/i=1:100/title="One-line" i*cos(i/8)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay5" i*cos(i/14)
+plot/over/i=1:100/title="Two-line<nl>overlay6" i*cos(i/20)
+plot/over/i=1:100/title="Three-line<nl>second<nl>overlay7" i*sin(i/12)
+
+   
+message "now a very long bunch of text.  The maximum for a single label is 2048 characters."
+plot/i=1:100 i*cos(i/8)
+
+label 3,95,-1,0,0.14,\
+"@CRHere is a long label, made with the LABEL command:<NL>\
+ <NL> Ferret is an interactive computer visualization and analysis<NL>\
+environment designed to meet the needs of oceanographers and<NL>\
+meteorologists analyzing large and complex gridded data sets. It<NL>\
+runs on most Unix systems, and on Windows NT/9x using X<NL>\
+windows for display. It can be installed to run from a Web<NL>\
+browser (WebFerret) for use while away from your desk or<NL>\
+from a system lacking X windows software. It can transparently<NL>\
+access extensive remote Internet data bases using OPeNDAP,<NL>\
+formerly known as DODS. See the dods webpage\
+<NL> <NL>\
+Ferret was developed by the Thermal Modeling and Analysis<NL>\
+Project (TMAP) at PMEL in Seattle to analyze the outputs of its<NL>\
+numerical ocean models and compare them with gridded,<NL>\
+observational data. The model data sets are generally multi-<NL>\
+gigabyte in size with mixed 3 and 4-dimensional variables defined<NL>\
+on staggered grids. Ferret offers a Mathematica-like approach to<NL>\
+analysis, new variables may be defined interactively as<NL>\
+mathematical expressions involving data set variables.<NL>\
+Calculations may be applied over arbitrarily shaped regions. Fully<NL>\
+documented graphics are produced with a single command.\
+<NL> <NL>\
+Many excellent software packages have been developed recently<NL>\
+for @p2scientific visualization at p1. The features that make Ferret distinctive<NL>\
+among these packages are Mathematica-like flexibility,<NL>\
+geophysical formatting, intelligent connection to its data base,<NL>\
+memory management for very large calculations, and symmetrical<NL>\
+processing in 4 dimensions."
+
+
diff --git a/jnls/examples/multi_variable_demo.jnl b/jnls/examples/multi_variable_demo.jnl
new file mode 100644
index 0000000..c9d1860
--- /dev/null
+++ b/jnls/examples/multi_variable_demo.jnl
@@ -0,0 +1,106 @@
+\cancel mode verify
+
+! Description: show some styles of plots with multiple dependent axes
+
+cancel viewports
+set data levitus_climatology
+set window/aspect=.6/size=0.6
+set mode verify
+alias WAITING MESSAGE
+
+! **********   MULTIPLE-VARIABLE PLOTTING TOOLS  *************
+
+! This demonstration will introduce some options for multi-variable plotting
+! using separate axes for each variable on the plot
+
+! As the demonstration runs please continue to read the text on the screen.
+! You will see exactly the commands that are controlling the FERRET program.
+! Lines that begin with "!" are comment lines - for your information only.
+
+! ********************************************************************
+WAITING
+
+! FIRST, THE DEFAULT FOR FERRET - VARIABLES SHARING THE SAME Y AXIS
+! No special tools are required for these plots.  For example,
+
+set region/y=0/z=0/x=130e:80w 				! a line in X
+plot temp[z=0], temp[z=50], temp[z=100], temp[z=200]
+
+waiting
+
+! * A COMMON REQUIREMENT - 2 VARIABLES WITH DIFFERENT AXES
+!   An attractive and simple style is to locate 2 axes left and right
+
+set region/y=0/z=0/x=130e:80w     ! line in X
+go left_axis_plot temp
+go right_axis_plot salt
+
+waiting
+
+! ** QUICK AND DIRTY - NO ADVANCE PLANNING
+!    Use this if one variable has already been plotted and you want
+!    to overlay additional variables quickly using new Y axes
+
+let dens = rho_un(salt,temp,0) - 1000
+set region/y=0/z=0/x=130e:80w	! line in X
+plot temp			! quick and dirty plot
+go multi_yaxis_overlay	salt	! quick and dirty multi-axis overlay
+go multi_yaxis_overlay	dens 2	! "2" indicating a second overlay
+
+waiting
+
+! ** ... WITH JUST A LITTLE PLANNING:
+!   we can set up several variables more attractively
+
+set region/y=0/z=0/x=130e:80w		! line in X
+go multi_yaxis_plot1 temp 2		! "2" variables to follow
+go multi_yaxis_overlay salt 1 "-"	! overlay #1 left of axis ("-")
+go multi_yaxis_overlay dens 2 "-"	! overlay #2 left of axis ("-")
+
+waiting
+
+! ** ... SIMILARLY ...
+! ** 3 variables using differing X axes
+
+set window/aspect=1.5
+set region/y=0/x=160e/Z=0:500		! line in Z
+let dens = rho_un(salt,temp,0) - 1000
+go multi_xaxis_plot1 temp 2		! "2" variables to follow
+go multi_xaxis_overlay salt 1 "-"	! overlay #1 below axis ("-")
+go multi_xaxis_overlay dens 2 "-"	! overlay #2 below axis ("-")
+
+waiting
+
+! ** CUSTOM CONTROLS:
+! for detailed customization of these plots additional arguments are
+! provided.  The arguments are documented in the files multi_xaxis_overlay.jnl,
+! etc.  Here is a quick example in which customizations are applied to
+! axis scaling, axis labels, axis spacing, tic label sizes, and tic spacing
+
+set window/aspect=.6
+set region/y=0/z=0/x=130e:80w		! line in X
+let dens = rho_un(salt,temp,0) - 1000
+go multi_yaxis_plot1 temp 3 "0.21  @CRPlot With Customized Axes"
+go multi_yaxis_overlay salt 1 "-" "33,36,0.5" "My Salinity" 0.25 1.5
+go multi_yaxis_overlay dens 2 "-" " " @CI"Density" .3 1.5  ",1,,,.13,(1PG10.3)"
+
+waiting
+
+set window/aspect=0.8
+! *** MULTI-VARIAABLE PLOT STYLES INSIDE VIEWPORTS
+
+set view ul			! upper left
+set region/y=0/z=0/x=130e:80w
+plot temp[z=0], temp[z=50]
+set view ur			! upper right
+go left_axis_plot temp "Double Variable Plot"
+go right_axis_plot salt
+set view ll			! lower left
+let dens = rho_un(salt,temp,0) - 1000
+go multi_yaxis_plot1 temp 1
+go multi_yaxis_overlay salt 1 "-"
+set view lr			! lower right
+set region/x=160E/y=0/z=0:200
+go multi_xaxis_plot1 temp 1
+go multi_xaxis_overlay salt 1 "-"
+
diff --git a/jnls/examples/objective_analysis_demo.jnl b/jnls/examples/objective_analysis_demo.jnl
new file mode 100644
index 0000000..2e79c35
--- /dev/null
+++ b/jnls/examples/objective_analysis_demo.jnl
@@ -0,0 +1,133 @@
+\cancel mode verify
+!Description: Demonstration of interpolating scattered data to grids  4/99
+
+! External Functions introduced in Ferret V5.0
+! Two interpolation techniques are available for gridding
+
+! Note that both techniques are applicable ONLY for output
+! grids which are REGULAR, that is to say, have EQUALLY-SPACED
+! coordinates.
+
+set grid/save
+
+! Set viewports
+DEFINE VIEW/ylim=.6,1/text=.5 vupper
+DEFINE VIEW/xlim=0.,.5/ylim=.3,.55/text=.2 vul
+DEFINE VIEW/xlim=.5,1./ylim=.3,.55/text=.2 vur
+DEFINE VIEW/xlim=0.,.5/ylim=0.05,.3/text=.2 vll
+DEFINE VIEW/xlim=.5,1./ylim=0.05,.3/text=.2 vlr
+
+! Define a 2-dimensional function and sample it
+DEFINE AXIS/x=0:10:0.05 x10
+DEFINE AXIS/y=0:10:0.05 y10
+DEFINE GRID/x=x10/y=y10 g10x10
+SET GRID g10x10
+
+LET/QUIET WAVE = SIN(KX*XPTS + KY*YPTS - PHASE) / 3
+LET/QUIET PHASE = 0
+LET/QUIET KAPPA = 0.4
+LET/QUIET KX = 0.4
+LET/QUIET KY = 0.7
+
+LET/QUIET FCN1 = SIN(R)/(R+1)
+LET/QUIET R = ((XPTS-X0)^2+ 5*(YPTS-Y0)^2)^0.5
+LET/QUIET X0 = 3
+LET/QUIET Y0 = 8
+
+LET/QUIET sample_function = fcn1 + wave
+
+say ...
+say For simplicity this demo will work with abstract mathematical functions
+say rather than with "real" data.  We will create an abstract function in
+say the XY plane and use it as a model of "reality".  Our goal is to
+say sample this "reality" at scattered (X,Y) points and then attempt to
+say recreate the original field through interpolation and objectibe analysis
+say techniques. 
+say ...
+say From here on the lines you see will be exactly the lines executed in this
+say demonstration script.  To focus attention on the issues of regridding
+say and avoid the clutter of graphics layout commands you will notice that
+say graphics are performed by a script called "draw_it".
+say ...
+MESSAGE
+set mode verify
+
+! **********************************************************
+! To display "reality" we will first let our sample points (xpts,ypts) be
+! simply the X and y points of a grid.  Then we will change (xpts,ypts) to
+! be 200 sampling locations and mark them with symbols on the plot.
+! We will draw this output in the "upper" viewport.  The script draw_it
+! simplifies plotting the functions in a viewport and with a title.
+
+! Shaded plot of the points on the (X,Y) grid
+LET/QUIET xpts = x; LET/QUIET ypts = y
+GO draw_it "fcn1+wave" "A field with 200 sample points marked" "SHADE" upper
+
+! points randomly sampled in (X,Y)
+LET/QUIET xpts = 10*randu(i); LET/QUIET ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+MESSAGE
+
+! **********************************************************
+! Now we will interpolate those 200 (X,Y,value) triples back onto a regular
+! grid in the (X,Y) plane.  The output grid will be from 1 to 10 by .5 along
+! both the X and y axes.  Defaults will be used for all other interpolation
+! controls; CAY = 5.0, NRNG = 5
+! Under the "SHADEd" (raster-style) plot we will display the very same result
+! as a filled contour plot.
+
+DEFINE AXIS/x=1:10:.5 xax5
+DEFINE AXIS/y=1:10:.5 yax5
+LET/QUIET sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 5., 5)
+GO draw_it sgrid "Laplace gridding to 20x20 grid" "SHADE" upper_left
+GO draw_it sgrid "20x20 grid, fill contoured" "FILL" lower_left
+MESSAGE
+
+! **********************************************************
+! Now we perform the identical analysis but we will instead interpolate onto
+! a higher resolution grid.  The gaps in the output are because there are
+! points on this output grid that are unacceptably far from any sample points
+! using the default interpolation parameters.
+
+DEFINE AXIS/x=1:10:.2 xax2
+DEFINE AXIS/y=1:10:.2 yax2
+LET/QUIET sgrid = scat2gridlaplace_xy (xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2], 5., 5)
+GO draw_it sgrid "Laplace gridding to 50x50 grid" "SHADE" upper_right
+GO draw_it sgrid "50x50 grid, fill contoured" "fill" lower_right
+MESSAGE
+
+! Now do the same plots with the Gaussian gridding function 
+! scat2gridgauss_xy which uses a different technique to interpolate the 
+! scattered points to the grid.  This results in a somewhat smoother plot.  
+! The interpolation parameters are  XSCALE, YSCALE, XCUTOFF, YCUTOFF;
+! where the algorithm uses scattered points which are within 
+!         cutoff* the scale width from the gridbox center.  We use 
+! XSCALE = YSCALE = XCUTOFF = YCUTOFF = 2.
+
+
+set window/new
+LET/QUIET xpts = x; LET/QUIET ypts = y
+GO draw_it "fcn1+wave" "A field with 200 sample points marked" "SHADE" upper
+
+LET/QUIET xpts = 10*randu(i); LET/QUIET ypts = 10*randu(i+2)
+set region/i=1:200
+plot/vs/over/symbols xpts,ypts
+
+
+DEFINE AXIS/x=1:10:.5 xax5
+DEFINE AXIS/y=1:10:.5 yax5
+LET/QUIET sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax5], y[gy=yax5], 2.,2.,2.,2)
+GO draw_it sgrid "Gauss gridding to 20x20 grid" "SHADE" upper_left
+GO draw_it sgrid "20x20 grid, fill contoured" "FILL" lower_left
+
+
+DEFINE AXIS/x=1:10:.2 xax2
+DEFINE AXIS/y=1:10:.2 yax2
+LET/QUIET sgrid = scat2gridgauss_xy (xpts, ypts, sample_function, x[gx=xax2], y[gy=yax2], 2.,2.,2.,2)
+GO draw_it sgrid "Gauss gridding to 50x50 grid" "SHADE" upper_right
+GO draw_it sgrid "50x50 grid, fill contoured" "fill" lower_right
+MESSAGE
+set grid/restore
+exit
+
diff --git a/jnls/examples/overlay_on_time_axis_demo.jnl b/jnls/examples/overlay_on_time_axis_demo.jnl
new file mode 100644
index 0000000..5519232
--- /dev/null
+++ b/jnls/examples/overlay_on_time_axis_demo.jnl
@@ -0,0 +1,43 @@
+!overlay_on_time_axis_demo.jnl
+! *sh* 6/99
+! *acm* 7/01 update /pen=  and /line=  to /color=/thickness=
+
+! Description: demonstrate PLOT/VS and POLYGON over time axes
+
+set mode verify
+cancel region
+use coads_climatology
+
+! coordinates of a unit square
+LET xsqr = {-1,1,1,-1}
+LET ysqr = {-1,-1,1,1}
+
+! coordinates of unit circle
+LET xcircle = COS(6.3*i[i=1:42]/40)
+LET ycircle = SIN(6.3*i[i=1:42]/40)
+
+! Notice that the units of the time axis
+show axis/l=1:3 sst
+
+! *** mark-up over a time series plot ***
+plot/x=180/y=0 sst
+let tt = T[gt=sst]
+
+! put a box around the value exactly at 7-aug
+let t0   = tt[t="7-aug-0000"@itp]
+let val0 = sst[x=180,y=0,t="7-aug-0000"@itp]
+polygon/over/color=red/thickness=2/title="Special region" t0+500*xsqr, 0.05*ysqr+val0
+plot/vs/over/nolab/sym=2/color=red/thickness=2 t0,val0		! mark point with an "X"
+
+! put a circle around the data point nearest to 15-may
+let t1   = tt[t="15-may-0000"]
+let val1 = sst[x=180,y=0,t="15-may-0000"]
+plot/vs/over/color=blue/thickness=2/line/nolab t1+500*xcircle,0.05*ycircle+val1
+plot/vs/over/nolab/sym=2/color=blue/thickness=2 t1,val1	! mark point with an "X"
+\pause
+
+! *** mark-up over a Hovmoller diagram ***
+shade/x=180 sst
+let y0 = 30
+polygon/over/color=black/thickness=2/pal=gray/pat=lite_up_left_to_right t0+500*xsqr, y0+15*ysqr
+plot/vs/over/color=black/thickness=2/line/nolab t0+900*xcircle,y0+25*ycircle
diff --git a/jnls/examples/palette_demo.jnl b/jnls/examples/palette_demo.jnl
new file mode 100644
index 0000000..3b293ad
--- /dev/null
+++ b/jnls/examples/palette_demo.jnl
@@ -0,0 +1,108 @@
+! palette_demo.jnl
+! *jd* 5.99, *sh* 6/99 reorg
+
+! Description: demonstration of V5.0 palette capabilities
+
+! set up for demo
+\set data levitus_climatology
+\set reg/@t
+\SET WINDOW/ASPECT=1.2:axis
+\DEFINE VIEWPORT/y=0:.33 low
+\DEFINE VIEWPORT/y=.33:.67 mid
+\DEFINE VIEWPORT/y=.67:1 up
+
+! * * * *  PALETTES  * * * *
+! As of Ferret version 5 there are 3 types of palettes:
+! PERCENT, BY_LEVELS, and BY_VALUES. All palettes consist
+! of a list of RGB color values and associated with each
+! RGB value another value that determines how to map the color
+! onto the "Z axis" of the plot. Previous to V5 all palettes
+! behaved like PERCENT palettes.
+
+! Note: from the Unix prompt you can use 
+!	Fpalette '*'
+! to see the available palettes.
+
+! A PERCENT palette is an ordered sequence of RGB values
+! representing a piecewise continuous path through color space.
+! For a given plot with N contour levels the set of discrete colors
+! used are determined by interpolating to N-1 equally spaced points
+! along this path.
+
+! From the Unix prompt try, for example, 
+! 	Fpalette -more rbn2
+! to see an example of a PERCENT palette file.
+
+! Here are examples using a PERCENT palette:
+PALETTE rainbow
+ppl list shaset
+
+set view upper; go magnify 1.2
+FILL/levels=10 temp[z=0]; go land thick
+
+set view lower; go magnify 1.2
+FILL/lev=20 temp[z=0]; go land thick
+\pause; set window/clear
+
+! -----------------
+! A BY_LEVELS palette specifies a list of invariant RGB color.
+! The colors given in the list are exactly the colors that will be
+! used on the plot -- no interpolation of colors is used. This is
+! particularly useful for hard copy, where printers may be "fussy"
+! about which colors look best. If the number of colors required
+! for the plot exceeds the number given in the palette the
+! colors are repeated starting from the first color as necessary.
+! Note that this is the same logic used for pattern files.
+
+! From the Unix prompt try, for example, 
+! 	Fpalette -more rainbow_by_levels
+! to see an example of a BY_LEVELS palette file.
+
+! Here are examples using a BY_LEVELS palette:
+PALETTE rainbow_by_levels
+ppl list shaset
+
+set view upper; go magnify 1.2
+FILL/levels=(15,30,2.5) temp[z=0]; go land thick
+
+set view lower; go magnify 1.2
+FILL/lev=(15,30,.5) temp[z=0]; go land thick
+\pause; set window/clear
+
+
+! --------------------
+! A BY_VALUE palette specifies a path through color
+! space, much as does a PERCENT palette. However, the logic
+! used to interpolate colors along the path is based on
+! the data values of the the contour levels. With such a palette 
+! the color representing, say, 25 degree temperature
+! will be the same whether the temperature range on the
+! plot is large or small and whether 25 degrees lies at the lower
+! end of the range or the upper.
+
+! From the Unix prompt try, for example, 
+! 	Fpalette -more ocean_temp
+! to see an example of a BY_VALUE palette file.
+
+! In this example, using a BY_VALUE palette, we see
+! sequence of ocean temperature plots at increasing depth.
+! Note how the colors adjust themselves to the temperature values.
+
+PALETTE ocean_temp
+ppl list shaset
+
+set view up; go magnify 1.5
+FILL/Z=0 temp; go land thick
+
+set view mid; go magnify 1.5
+FILL/Z=50 temp; go land thick
+
+set view low; go magnify 1.5
+FILL/Z=200 temp; go land thick
+\pause
+
+! clean up
+PALETTE default
+SET WINDOW/ASP=.75:ax
+CANCEL VIEWPORTS
+
diff --git a/jnls/examples/pattern_demo.jnl b/jnls/examples/pattern_demo.jnl
new file mode 100644
index 0000000..122b98f
--- /dev/null
+++ b/jnls/examples/pattern_demo.jnl
@@ -0,0 +1,37 @@
+! pattern_demo.jnl
+! Quick demo of Ferret pattern feature *jd* 12.18.98
+
+set data coads_climatology
+set reg/l=7/y=50s:60n/x=100e:60w
+set mode cal months
+
+! The /pattern qualifier sets patterns to be used, like /palette sets colors.
+! Files in $FER_PALETTE with extension .pat are read in to set patterns.
+! Use "Fpattern '*'" to find available pattern files.
+
+! Note that colors are set in the usual way...
+
+set win 1
+shade/pal=black/lev=(10,30,5,-3)/line/key/pattern=4patterns sst
+
+go fland 20; go land thick
+
+\message
+
+! Colors and patterns can be overlaid; patterns are transparent
+
+set win 2
+
+set data coads_climatology
+set reg/l=1:12/y=50s:60n/x=100e:60w
+set mode cal months
+
+fill/lev=(0,33,3) sst[l=@ave]
+
+fill/lev=(1000,1010,10)/over/nolab/pal=black/pat=angled_grid slp[l=@ave,y=20s:20n]
+label/user,185,-18,-1,0,.15, at trSLP gt 1000 and lt 1010 mb
+
+fill/lev=(1020,1050,30)/over/nolab/pal=black/pat=large_grid slp[l=@ave,y=20n:60n]
+label/user,225,22,1,0,.15, at trSLP gt 1020 and lt 1050 mb
+
+go fland 20; go land thick
diff --git a/jnls/examples/plot_swath_demo.jnl b/jnls/examples/plot_swath_demo.jnl
new file mode 100644
index 0000000..ef65f9f
--- /dev/null
+++ b/jnls/examples/plot_swath_demo.jnl
@@ -0,0 +1,40 @@
+! plot_swath_demo.jnl
+! *sh* 6/99
+! *acm* 7/01 update /pen=7 to /thickness=2
+! *acm*12/01 example2: def of base fails starting w/ v5.22.
+
+
+! Description: demonstrate "line plots" done with swaths of color
+
+set mode calendar:month
+set mode verify
+
+! example 1 -- show variability as a gray background swath
+use coads_climatology
+let mean = sst[x=130e:80w,y=0,l=1:12 at ave]
+let std_dev = sst[x=130e:80w,y=0,l=1:12 at var] ^ 0.5
+plot/title="Tropical SST variability" mean
+go plot_swath poly/over/pal=gray/nolab mean-std_dev, mean+std_dev
+plot/over/nolab/thickness=2 mean
+\pause
+
+! example 2 -- 3 colored time series
+! let base = T[T=1-jan-1990:1-feb-1990:24] - T[T=1-jan-1990]
+define axis/T/T=1-jan-1990:1-feb-1990:1/UNITS=DAYS/T0=1-jan-1990 tax
+let base = t[gt=tax]
+let y1 = base^0.5
+let y2 = base
+let y3 = base^1.1
+let y4 = base^1.2
+
+plot/title="Business trends" y1,y2,y3,y4
+go plot_swath poly/over/nolabels/palette=red   y1,y2
+go plot_swath poly/over/nolabels/palette=green y2,y3
+go plot_swath poly/over/nolabels/palette=blue  y3,y4
+\pause
+
+! example 3 - difference between two points on a grid
+use coads_climatology
+let sst1 = sst[l=1,x=20e:20e]
+plot sst1[y=0], sst1[y=10n]
+go plot_swath poly/over/nolabels/palette=black sst1[y=0]  sst1[y=10n]
diff --git a/jnls/examples/polar_demo.jnl b/jnls/examples/polar_demo.jnl
new file mode 100644
index 0000000..d679d5f
--- /dev/null
+++ b/jnls/examples/polar_demo.jnl
@@ -0,0 +1,68 @@
+
+! Description: demonstrate the production of polar stereographic projections
+
+! *acm* 7/01 update /pen=  to /color=/thickness=
+
+! *** Note: this demo is superseded by newer map projection  *** !
+! *** capabilities introduced in Ferret Version 5.0 see      *** !
+! *** "map projections" in Users Guide, and                  *** !
+! ***                                                        *** !
+! ***  yes? go mp_demo                                       *** !
+! ***                                                        *** !
+
+! This demo will display the same plot twice: first with a standard
+! latitude/longitude rectangular "projection" and again using a polar
+! stereographic projection.   The demo plots are based on COADS data
+! and include these features:
+
+! 1) An SST field as a color-filled contour background
+! 2) The continents in solid-filled gray at 40 minute resolution
+! 3) The outline of the continents overlaid (for sharpness)
+! 4) Vectors of surface wind speed overlaid in red
+! 5) Contours of air temperature as an overlay
+! 6) A series of CTD cast locations plotted as overlaid symbols
+
+message
+
+! **** set up data sets and variables for the demo  ****
+set data coads_climatology
+cancel region/x
+set region/l=1
+set region/y=0:90
+! define fake variables as make-pretend CTD cast data
+let/quiet ctd_casts_lon = if i[i=1:40] LT 20 then 140+3*i[i=1:40] else 200 
+let/quiet ctd_casts_lat = if i[i=1:40] LT 20 then  25 else 1.5*i[i=1:40]-5 
+
+! ****************************************************************
+! **** First plot: on standard latitude/longitude coordinates ****
+set window 1
+set window/aspect=.6/size=.5
+fill/lev=(-2,30,2)/title="SST, winds, and AIRT"/pal=no_red sst
+go fland 60 gray
+go land
+vector/color=red/overlay uwnd,vwnd
+contour/color=black/levels=(-5,30,5)/overlay airt
+plot/vs/overlay/nolabels/symbols ctd_casts_lon,ctd_casts_lat
+
+
+! ****************************************************************
+! **** Next: the same plot using a polar stereographic projection *** 
+
+! Note that the commands are very similar to the previous plot
+!     (The rotation angle of 100 degrees is as per NMC conventions)
+! Note, also, that the speed of the polar output depends on the resolution
+!	that is requested.  This example uses the default of 201x201.
+!	The resolution is an optional argument which may follow the "100"
+!	in the "go polar_2d" and "go polar_vector" commands.
+message
+set window 2
+set wind/aspect=1:ax/size=.5
+go polar_2d fill/lev=(-2,30,2)/title="SST, winds and AIRT"/pal=no_red sst 100
+go polar_fland 60 gray
+go polar_land " " 1.0       ! limit lines to a radius of 1
+go polar_vector vector/color=red/overlay uwnd,vwnd 100
+go polar_2d contour/color=black/levels=(-5,30,5)/overlay airt 100 
+go polar_vs plot/vs/overlay/nolabels/symbols ctd_casts_lon,ctd_casts_lat
+
+! a little extra: put a curved "graticule" onto the plot
+go polar_grid_fancy
diff --git a/jnls/examples/polar_south_demo.jnl b/jnls/examples/polar_south_demo.jnl
new file mode 100644
index 0000000..db3b765
--- /dev/null
+++ b/jnls/examples/polar_south_demo.jnl
@@ -0,0 +1,58 @@
+! Description: demonstrate South pole polar stereographic projections
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+
+! *** Note: this demo is superseded by newer map projection  *** !
+! *** capabilities introduced in Ferret Version 5.0 see      *** !
+! *** "map projections" in Users Guide, and                  *** !
+! ***                                                        *** !
+! ***  yes? go mp_demo                                       *** !
+! ***                                                        *** !
+
+! This demo will display the same plot twice: first with a standard
+! latitude/longitude rectangular "projection" and again using a polar
+! stereographic projection.   The demo plots are based on COADS data
+! and include these features:
+
+! 1) An SST field as a color-filled contour background
+! 2) The continents in solid-filled gray at 40 minute resolution
+! 3) The outline of the continents overlaid (for sharpness)
+! 4) Vectors of surface wind speed overlaid in red
+! 5) Contours of air temperature as an overlay
+! 6) A series of CTD cast locations plotted as overlaid symbols
+
+! South pole enhancements to the FERRET polar routines were contributed by
+! FERRET user Tony Craig at NCAR - 6/94.
+
+message
+
+set data coads_climatology
+cancel region/x
+set region/l=1
+set region/y=0s:90s
+
+! define fake variables as make-pretend CTD cast data
+let/quiet ctd_casts_lon = if i[i=1:40] LT 20 then 140+3*i[i=1:40] else 200 
+let/quiet ctd_casts_lat = if i[i=1:40] LT 20 then  0-25 else 0-(1.5*i[i=1:40]-5)
+
+set window 1
+set window/aspect=.6/size=.5
+fill/lev=(-2,30,2)/title="SST, winds, and AIRT"/pal=no_red sst
+go fland 60 gray
+go land
+vector/color=red/overlay uwnd,vwnd
+contour/color=black/levels=(-5,30,5)/overlay airt
+plot/vs/overlay/nolabels/symbols ctd_casts_lon,ctd_casts_lat
+
+
+
+set window 2
+set wind/aspect=1:ax/size=.5
+
+go polar_2d fill/lev=(-2,30,2)/title="SST,winds and AIRT"/pal=no_red sst,100,,,,,-1
+go polar_fland 60 gray
+go polar_land green,1.0
+go polar_vector vector/color=red/overlay uwnd,vwnd,100,,,,-1
+go polar_2d contour/color=black/levels=(-5,30,5)/overlay airt,100,,,,,-1
+go polar_vs plot/vs/overlay/nolabels/symbols ctd_casts_lon,ctd_casts_lat
+go polar_grid_fancy
+
diff --git a/jnls/examples/poly_vec_demo.jnl b/jnls/examples/poly_vec_demo.jnl
new file mode 100644
index 0000000..f4c66c3
--- /dev/null
+++ b/jnls/examples/poly_vec_demo.jnl
@@ -0,0 +1,241 @@
+SET MODE VERIFY
+
+! poly_vec_demo.jnl 7/03 *acm*
+! Description: demo of filled-polygon vectors
+! Uses poly_vectors.jnl and mp_poly_vectors.jnl scripts  
+! contributed by E. D. Cokelet, NOAA/PMEL, 2003
+
+! The scripts poly_vectors.jnl and mp_poly_vectors.jnl compute polygon
+! coordinates for drawing vectors in Cartesian or curvlilinear coordinates 
+! as polygon arrows or sticks, optionally filled with color.  These scripts 
+! are similar to scattered_vectors.jnl in that they set up the data, which 
+! is then plotted with a separate command, in this case the POLYGON command. 
+! A third script, poly_arrow_key.jnl, makes an arrow key at any location on 
+! the page.
+  
+! First lets make a plot in Cartesian coordinates.  We will call the script 
+! poly_vectors.jnl to set up the polygons for plotting.
+
+PAUSE
+SET WINDOW/siz=0.6
+CANCEL MODE logo
+
+USE coads_climatology
+SET REGION/X=120:180/Y=20:60/L=1
+
+! poly_vectors.jnl must have the plot parameters (such as axis lengths) 
+! already set.  Draw a 2-D plot over the region of interest.  
+
+GO basemap x=120:180 y=20:60 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "UWND, VWND"
+
+
+! The inputs to poly_vectors.jnl are the components of the vectors to be 
+! plotted and the X and Y coordinates of the vectors.  We need to limit 
+! the region of the data explicitly, so that the calculations are done 
+! only for the vectors we are interested in.
+
+PAUSE
+LET x_vec = X[GX=uwnd,X=120:180] + 0*Y[GY=uwnd,Y=20:60]
+LET y_vec = 0*X[GX=uwnd,X=120:180] + Y[GY=uwnd,Y=20:60]
+LET u_vec = uwnd[X=120:180,Y=20:60,L=1]
+LET v_vec = vwnd[X=120:180,Y=20:60,L=1]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 5 "arrow"
+
+! Now the polygon coordinates have been defined.  Next we issue a POLYGON
+! command to draw the arrow polygons. We can use a third argument on the 
+! POLYGON command to fill the polygons with colors according to any variable. 
+! Here we make a list of the values of sea level pressure which corresponds 
+! to the original vector components. The color key is for the fill color. 
+! We use the /LINE qualifier to outline the arrows with black.  Call 
+! poly_arrow_key.jnl to make the vector key.
+
+PAUSE
+
+LET press = YSEQUENCE(slp[X=120:180,Y=20:60,L=1])
+POLYGON/OVER/NOAX/NOLAB/KEY/LINE/PAL=rainbow plt_x_arrow, plt_y_arrow, press
+
+! Make a vector arrow key.
+
+GO poly_arrow_key "winds", "5 m/s"
+
+PAUSE
+
+CAN VAR/ALL
+CAN REGION
+
+! For a larger-scale plot we need to sub-sample the vectors before
+! sending them as arguments to the poly_vectors script.  This is done
+! automatically by the Ferret VECTOR command, but here the user needs
+! to do the sub-sampling.
+
+PAUSE
+
+USE coads_climatology
+SET REGION/L=1/X=0:360/Y=-80:80
+
+! Make a 2-D plot to set plot parameters.
+
+GO basemap x=0:360 y=-80:80 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "Wind Vectors Colored by SLP"
+
+! Subsample the vector data and set up the vectors to be plotted as polygons
+PAUSE
+
+LET x_vec = X[GX=uwnd,X=0:360:10] + 0*Y[GY=uwnd,Y=-80:80:5]
+LET y_vec = 0*X[GX=uwnd,X=0:360:10] + Y[GY=uwnd,Y=-80:80:5]
+LET u_vec = uwnd[X=0:360:10,Y=-80:80:5,L=5]
+LET v_vec = vwnd[X=0:360:10,Y=-80:80:5,L=5]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 8 "arrow"
+
+PAUSE
+
+! Draw the arrow polygons, colored by SLP, and make a key for the arrows.
+! Note the different plot appearance when we leave off the LINE qualifier
+! on the POLYGON command.
+
+LET press = YSEQUENCE(slp[X=0:360:10,Y=-80:80:5,L=5])
+POLYGON/OVER/NOAX/NOLAB/KEY/PAL=rainbow/LEV=(980,1030,5) plt_x_arrow, plt_y_arrow, press
+GO poly_arrow_key "", "8 m/s", red
+
+
+CAN REGION
+CAN VAR/ALL
+
+PAUSE
+! Next we will do some polygon-vector plots using map projections. 
+
+! The steps are: Define a subset of the data to plot, define a map projection, 
+! and draw some plot in the map projection, using the curvilinear form 
+! of the plotting command. Define variables with with U, V, X, and Y for the 
+! vectors, call mp_poly_vectors to set up the polygon coordinates and use a 
+! curvlinear polygon command to plot them.
+
+USE coads_climatology
+
+SET REGION/X=131:181/Y=21:61/L=5
+LET mp_central_meridian = (131+181)/2
+LET mp_standard_parallel = (60+20)/2
+
+GO mp_stereographic_north  `mp_central_meridian` `mp_standard_parallel`
+SET GRID uwnd
+GO mp_aspect
+
+! Make a FILL plot using the map projection to set the plot parameters for 
+! the mp_poly_vectors script
+
+FILL/NOAXIS/NOKEY/PAL=inverse_grayscale/TITLE="Winds Colored by Pressure" slp, x_page,y_page
+GO mp_fland 20 black
+
+PAUSE
+
+! Call mp_poly_vectors to set up the vectors to be plotted as polygons
+
+LET x_vec = X[GX=uwnd,X=131:181] + 0*Y[GY=uwnd,Y=21:61]
+LET y_vec = 0*X[GX=uwnd,X=131:181] + Y[GY=uwnd,Y=21:61]
+LET u_vec = uwnd[X=131:181,Y=21:61,L=5]
+LET v_vec = vwnd[X=131:181,Y=21:61,L=5]
+
+GO mp_poly_vectors x_vec y_vec u_vec v_vec 3 "arrow"
+
+
+! Draw the polygons, colored by SLP
+
+PAUSE
+
+LET press = YSEQUENCE(slp[X=131:181,Y=21:61,L=5])
+POLYGON/OVER/NOAX/NOLAB/KEY/LINE/PAL=rainbow mp_x_arrow, mp_y_arrow, press
+
+GO mp_graticule 131 181 12.5 21 61 10
+
+! Now we illustrate positioning the vector arrow key. By default it is 
+! positioned at the lower left.  We can choose to center it horizontally
+! or vertically by sending C as the argument for a position.
+
+PAUSE 
+
+GO poly_arrow_key "default key", "3 m/s", red, line
+GO poly_arrow_key "left top key", 3, blue, " ", 2, `($ppl$height)-1.5`
+GO poly_arrow_key "centered bottom", 3, violet, " ", c, 0.2
+GO poly_arrow_key "upper right", 3, green, line, `($ppl$width)-1.6`, `($ppl$height)-1.5`,0.14
+
+CAN DATA/ALL
+CAN VAR/ALL
+CAN REGION
+
+! Next we'll make a view from space.  We need the mp_mask for this projection, 
+! to keep the vectors on other side of the earth from "showing through" the
+! map.  Apply it to the polygon data as it is plotted. This time we will 
+! use explicit regridding to put the vector components onto a coarser grid.
+
+PAUSE
+USE coads_climatology
+SET REGION/L=1
+
+! Set up the vectors to be plotted as polygons
+
+DEFINE AXIS/X=0:360:8 xax
+DEFINE AXIS/Y=-80:80:4 yax
+DEFINE GRID/X=xax/Y=yax gxy
+
+LET x_vec = X[GX=xax] + 0*Y[GY=yax]
+LET y_vec = 0*X[GX=xax] + Y[GY=yax]
+LET u_vec = uwnd[g=gxy,L=1]
+LET v_vec = vwnd[g=gxy,L=1]
+
+! Make a plot with the map projection to set the plot parameters. (FILL plot
+! with the palette set to all white, for a blank underlying plot)
+PAUSE
+
+GO mp_orthographic 210 45
+SET GRID gxy
+GO mp_aspect
+
+FILL/NOAXIS/NOKEY/NOLAB/PAL=white/TITLE="Winds Colored by Pressure" u_vec, x_page,y_page
+GO mp_fland
+GO mp_graticule 0 360 30 -90 90 20
+
+GO mp_poly_vectors x_vec y_vec u_vec v_vec 5 "arrow"
+
+! draw the arrow polygons, colored by SLP, and the vector key.
+PAUSE
+
+LET press = YSEQUENCE(slp[g=gxy,L=1])
+POLYGON/OVER/NOAX/NOLAB/LINE/KEY/PAL=rainbow mp_mask*mp_x_arrow, mp_mask*mp_y_arrow, mp_mask*press
+
+! Vector key
+
+GO poly_arrow_key " ", "5 m/s", red, " ", 1, `($ppl$yorg)`
+
+
+CAN DATA/ALL
+CAN VAR/ALL
+CAN REGION
+
+! Finally, the poly_vector scripts also have the option to plot the vectors 
+! as stick vectors, rather than arrows.  All the commands stay the same,
+! but with the final argument to poly_vectors.jnl or mp_poly_vectors.jnl
+! being "stick" rather than "arrow".  Here is the first plot from this demo
+! made with stick vectors:
+
+PAUSE
+USE coads_climatology
+SET REGION/X=120:180/Y=20:60/L=1
+
+GO basemap X=120:180 Y=20:60 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "Wind Vectors Colored by SLP"
+
+LET x_vec = X[GX=uwnd,X=120:180] + 0*Y[GY=uwnd,Y=20:60]
+LET y_vec = 0*X[GX=uwnd,X=120:180] + Y[GY=uwnd,Y=20:60]
+LET u_vec = uwnd[X=120:180,Y=20:60,L=1]
+LET v_vec = vwnd[X=120:180,Y=20:60,L=1]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 5 "stick"
+
+LET press = YSEQUENCE(slp[X=120:180,Y=20:60,L=1])
+POLYGON/OVER/NOAX/NOLAB/KEY/PAL=rainbow plt_x_arrow, plt_y_arrow, press
+
+GO poly_arrow_key "winds", "5 m/s" red
+
diff --git a/jnls/examples/poly_vector_demo.jnl b/jnls/examples/poly_vector_demo.jnl
new file mode 100644
index 0000000..f4c66c3
--- /dev/null
+++ b/jnls/examples/poly_vector_demo.jnl
@@ -0,0 +1,241 @@
+SET MODE VERIFY
+
+! poly_vec_demo.jnl 7/03 *acm*
+! Description: demo of filled-polygon vectors
+! Uses poly_vectors.jnl and mp_poly_vectors.jnl scripts  
+! contributed by E. D. Cokelet, NOAA/PMEL, 2003
+
+! The scripts poly_vectors.jnl and mp_poly_vectors.jnl compute polygon
+! coordinates for drawing vectors in Cartesian or curvlilinear coordinates 
+! as polygon arrows or sticks, optionally filled with color.  These scripts 
+! are similar to scattered_vectors.jnl in that they set up the data, which 
+! is then plotted with a separate command, in this case the POLYGON command. 
+! A third script, poly_arrow_key.jnl, makes an arrow key at any location on 
+! the page.
+  
+! First lets make a plot in Cartesian coordinates.  We will call the script 
+! poly_vectors.jnl to set up the polygons for plotting.
+
+PAUSE
+SET WINDOW/siz=0.6
+CANCEL MODE logo
+
+USE coads_climatology
+SET REGION/X=120:180/Y=20:60/L=1
+
+! poly_vectors.jnl must have the plot parameters (such as axis lengths) 
+! already set.  Draw a 2-D plot over the region of interest.  
+
+GO basemap x=120:180 y=20:60 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "UWND, VWND"
+
+
+! The inputs to poly_vectors.jnl are the components of the vectors to be 
+! plotted and the X and Y coordinates of the vectors.  We need to limit 
+! the region of the data explicitly, so that the calculations are done 
+! only for the vectors we are interested in.
+
+PAUSE
+LET x_vec = X[GX=uwnd,X=120:180] + 0*Y[GY=uwnd,Y=20:60]
+LET y_vec = 0*X[GX=uwnd,X=120:180] + Y[GY=uwnd,Y=20:60]
+LET u_vec = uwnd[X=120:180,Y=20:60,L=1]
+LET v_vec = vwnd[X=120:180,Y=20:60,L=1]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 5 "arrow"
+
+! Now the polygon coordinates have been defined.  Next we issue a POLYGON
+! command to draw the arrow polygons. We can use a third argument on the 
+! POLYGON command to fill the polygons with colors according to any variable. 
+! Here we make a list of the values of sea level pressure which corresponds 
+! to the original vector components. The color key is for the fill color. 
+! We use the /LINE qualifier to outline the arrows with black.  Call 
+! poly_arrow_key.jnl to make the vector key.
+
+PAUSE
+
+LET press = YSEQUENCE(slp[X=120:180,Y=20:60,L=1])
+POLYGON/OVER/NOAX/NOLAB/KEY/LINE/PAL=rainbow plt_x_arrow, plt_y_arrow, press
+
+! Make a vector arrow key.
+
+GO poly_arrow_key "winds", "5 m/s"
+
+PAUSE
+
+CAN VAR/ALL
+CAN REGION
+
+! For a larger-scale plot we need to sub-sample the vectors before
+! sending them as arguments to the poly_vectors script.  This is done
+! automatically by the Ferret VECTOR command, but here the user needs
+! to do the sub-sampling.
+
+PAUSE
+
+USE coads_climatology
+SET REGION/L=1/X=0:360/Y=-80:80
+
+! Make a 2-D plot to set plot parameters.
+
+GO basemap x=0:360 y=-80:80 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "Wind Vectors Colored by SLP"
+
+! Subsample the vector data and set up the vectors to be plotted as polygons
+PAUSE
+
+LET x_vec = X[GX=uwnd,X=0:360:10] + 0*Y[GY=uwnd,Y=-80:80:5]
+LET y_vec = 0*X[GX=uwnd,X=0:360:10] + Y[GY=uwnd,Y=-80:80:5]
+LET u_vec = uwnd[X=0:360:10,Y=-80:80:5,L=5]
+LET v_vec = vwnd[X=0:360:10,Y=-80:80:5,L=5]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 8 "arrow"
+
+PAUSE
+
+! Draw the arrow polygons, colored by SLP, and make a key for the arrows.
+! Note the different plot appearance when we leave off the LINE qualifier
+! on the POLYGON command.
+
+LET press = YSEQUENCE(slp[X=0:360:10,Y=-80:80:5,L=5])
+POLYGON/OVER/NOAX/NOLAB/KEY/PAL=rainbow/LEV=(980,1030,5) plt_x_arrow, plt_y_arrow, press
+GO poly_arrow_key "", "8 m/s", red
+
+
+CAN REGION
+CAN VAR/ALL
+
+PAUSE
+! Next we will do some polygon-vector plots using map projections. 
+
+! The steps are: Define a subset of the data to plot, define a map projection, 
+! and draw some plot in the map projection, using the curvilinear form 
+! of the plotting command. Define variables with with U, V, X, and Y for the 
+! vectors, call mp_poly_vectors to set up the polygon coordinates and use a 
+! curvlinear polygon command to plot them.
+
+USE coads_climatology
+
+SET REGION/X=131:181/Y=21:61/L=5
+LET mp_central_meridian = (131+181)/2
+LET mp_standard_parallel = (60+20)/2
+
+GO mp_stereographic_north  `mp_central_meridian` `mp_standard_parallel`
+SET GRID uwnd
+GO mp_aspect
+
+! Make a FILL plot using the map projection to set the plot parameters for 
+! the mp_poly_vectors script
+
+FILL/NOAXIS/NOKEY/PAL=inverse_grayscale/TITLE="Winds Colored by Pressure" slp, x_page,y_page
+GO mp_fland 20 black
+
+PAUSE
+
+! Call mp_poly_vectors to set up the vectors to be plotted as polygons
+
+LET x_vec = X[GX=uwnd,X=131:181] + 0*Y[GY=uwnd,Y=21:61]
+LET y_vec = 0*X[GX=uwnd,X=131:181] + Y[GY=uwnd,Y=21:61]
+LET u_vec = uwnd[X=131:181,Y=21:61,L=5]
+LET v_vec = vwnd[X=131:181,Y=21:61,L=5]
+
+GO mp_poly_vectors x_vec y_vec u_vec v_vec 3 "arrow"
+
+
+! Draw the polygons, colored by SLP
+
+PAUSE
+
+LET press = YSEQUENCE(slp[X=131:181,Y=21:61,L=5])
+POLYGON/OVER/NOAX/NOLAB/KEY/LINE/PAL=rainbow mp_x_arrow, mp_y_arrow, press
+
+GO mp_graticule 131 181 12.5 21 61 10
+
+! Now we illustrate positioning the vector arrow key. By default it is 
+! positioned at the lower left.  We can choose to center it horizontally
+! or vertically by sending C as the argument for a position.
+
+PAUSE 
+
+GO poly_arrow_key "default key", "3 m/s", red, line
+GO poly_arrow_key "left top key", 3, blue, " ", 2, `($ppl$height)-1.5`
+GO poly_arrow_key "centered bottom", 3, violet, " ", c, 0.2
+GO poly_arrow_key "upper right", 3, green, line, `($ppl$width)-1.6`, `($ppl$height)-1.5`,0.14
+
+CAN DATA/ALL
+CAN VAR/ALL
+CAN REGION
+
+! Next we'll make a view from space.  We need the mp_mask for this projection, 
+! to keep the vectors on other side of the earth from "showing through" the
+! map.  Apply it to the polygon data as it is plotted. This time we will 
+! use explicit regridding to put the vector components onto a coarser grid.
+
+PAUSE
+USE coads_climatology
+SET REGION/L=1
+
+! Set up the vectors to be plotted as polygons
+
+DEFINE AXIS/X=0:360:8 xax
+DEFINE AXIS/Y=-80:80:4 yax
+DEFINE GRID/X=xax/Y=yax gxy
+
+LET x_vec = X[GX=xax] + 0*Y[GY=yax]
+LET y_vec = 0*X[GX=xax] + Y[GY=yax]
+LET u_vec = uwnd[g=gxy,L=1]
+LET v_vec = vwnd[g=gxy,L=1]
+
+! Make a plot with the map projection to set the plot parameters. (FILL plot
+! with the palette set to all white, for a blank underlying plot)
+PAUSE
+
+GO mp_orthographic 210 45
+SET GRID gxy
+GO mp_aspect
+
+FILL/NOAXIS/NOKEY/NOLAB/PAL=white/TITLE="Winds Colored by Pressure" u_vec, x_page,y_page
+GO mp_fland
+GO mp_graticule 0 360 30 -90 90 20
+
+GO mp_poly_vectors x_vec y_vec u_vec v_vec 5 "arrow"
+
+! draw the arrow polygons, colored by SLP, and the vector key.
+PAUSE
+
+LET press = YSEQUENCE(slp[g=gxy,L=1])
+POLYGON/OVER/NOAX/NOLAB/LINE/KEY/PAL=rainbow mp_mask*mp_x_arrow, mp_mask*mp_y_arrow, mp_mask*press
+
+! Vector key
+
+GO poly_arrow_key " ", "5 m/s", red, " ", 1, `($ppl$yorg)`
+
+
+CAN DATA/ALL
+CAN VAR/ALL
+CAN REGION
+
+! Finally, the poly_vector scripts also have the option to plot the vectors 
+! as stick vectors, rather than arrows.  All the commands stay the same,
+! but with the final argument to poly_vectors.jnl or mp_poly_vectors.jnl
+! being "stick" rather than "arrow".  Here is the first plot from this demo
+! made with stick vectors:
+
+PAUSE
+USE coads_climatology
+SET REGION/X=120:180/Y=20:60/L=1
+
+GO basemap X=120:180 Y=20:60 20
+LABEL/NOUSER `($ppl$xlen)/2`, `($ppl$yorigin)-1`, 0, 0, 0.16, "Wind Vectors Colored by SLP"
+
+LET x_vec = X[GX=uwnd,X=120:180] + 0*Y[GY=uwnd,Y=20:60]
+LET y_vec = 0*X[GX=uwnd,X=120:180] + Y[GY=uwnd,Y=20:60]
+LET u_vec = uwnd[X=120:180,Y=20:60,L=1]
+LET v_vec = vwnd[X=120:180,Y=20:60,L=1]
+
+GO poly_vectors.jnl x_vec y_vec u_vec v_vec 5 "stick"
+
+LET press = YSEQUENCE(slp[X=120:180,Y=20:60,L=1])
+POLYGON/OVER/NOAX/NOLAB/KEY/PAL=rainbow plt_x_arrow, plt_y_arrow, press
+
+GO poly_arrow_key "winds", "5 m/s" red
+
diff --git a/jnls/examples/polydata.cdf b/jnls/examples/polydata.cdf
new file mode 100644
index 0000000..53343e1
Binary files /dev/null and b/jnls/examples/polydata.cdf differ
diff --git a/jnls/examples/polymark_demo.jnl b/jnls/examples/polymark_demo.jnl
new file mode 100644
index 0000000..7baa986
--- /dev/null
+++ b/jnls/examples/polymark_demo.jnl
@@ -0,0 +1,23 @@
+! polymark_demo.jnl
+! *jd* 5.99
+
+! Description: demonstrate usage of polymark jnl file
+
+set mode verify
+
+! Open demo ship track file with Lat, Lon, and SST
+use polydata
+
+! polymark needs an underlying plot to define scaling
+go basemap x=130:250 Y=20:65 20
+go polymark poly/over/key/title="SST along track" lon lat sst star 
+\message
+
+! A little smaller & outline
+go basemap x=130:250 Y=20:65 20
+go polymark poly/over/key/line/fill/lev=(1,9,1)/title="Smaller & outline" lon lat sst square .6
+\message
+
+! Use a square in a pattern & outline
+go basemap x=130:250 Y=20:65 20
+go polymark poly/over/key/pattern=4patterns/palette=black/line/fill/lev=(1,9,2)/title="Using patterns" lon[i=3:37:2] lat[i=3:37:2] sst[i=3:37:2] square 1.75
diff --git a/jnls/examples/polytube_bent_demo.jnl b/jnls/examples/polytube_bent_demo.jnl
new file mode 100644
index 0000000..90ac576
--- /dev/null
+++ b/jnls/examples/polytube_bent_demo.jnl
@@ -0,0 +1,27 @@
+
+
+! Tests polytube and polytube_bent
+
+let pi = 4.0*atan(1.0)
+
+let npts = 6	! Vary npts to get a coarser or finer trackline
+
+define axis/t=0:`npts-1`:1/units=days t_ax
+let tim = t[gt=t_ax]
+
+let xpts = 180 + 50*COS(2*pi*tim/(npts-1))
+let ypts = 15  + 20*SIN(2*pi*tim/(npts-1))
+let sst  = 35 - ypts + RANDN(ypts)
+let sst1 = if (l eq 3) then sst/0 else sst	! Test function with missing value which should not plot
+
+set window/aspect=1:axis 1
+go basemap x=120:250 Y=25s:65n 20
+go polytube polygon/over/key/title=sst xpts,ypts,sst
+plot/vs/over/nolab/line/sym/thick=2 xpts,ypts
+
+set window/aspect=1:axis 2
+go basemap x=120:250 Y=25s:65n 20
+go polytube_bent polygon/over/key/title=sst xpts,ypts,sst
+plot/vs/over/nolab/line/sym/thick=2 xpts,ypts
+
+
diff --git a/jnls/examples/polytube_demo.jnl b/jnls/examples/polytube_demo.jnl
new file mode 100644
index 0000000..681507d
--- /dev/null
+++ b/jnls/examples/polytube_demo.jnl
@@ -0,0 +1,48 @@
+! polytube_demo.jnl
+! *jd* 5.99
+! *acm* 7/01 update /line= to /color=/thickness=
+
+! Description: demonstrate "lagrangian" plots along a path using color fill
+
+
+set mode verify
+
+! Define a 3-leg plot track with discontinuities
+LET/QUIET     X0 = 240
+LET/QUIET     Y0 = 10
+LET/QUIET     X1 = 180
+LET/QUIET     Y1 = 60
+LET/QUIET     X2 = 150
+LET/QUIET     Y2 = 10
+LET/QUIET     XLEG1 = X0 + (L-1)*(X1-X0)/50
+LET/QUIET     YLEG1 = Y0 + (L-1)*(Y1-Y0)/50
+LET/QUIET     XLEG2 = X1 + (L-51)*(X2-X1)/20
+LET/QUIET     YLEG2 = Y1 + (L-51)*(Y2-Y1)/20
+LET/QUIET     LCURVE = L-71
+LET/QUIET     R0 = 35
+LET/QUIET     RADIUS = R0 - LCURVE/3
+LET/QUIET     XLEG3 = X2+R0 - RADIUS * COS(LCURVE/12)
+LET/QUIET     YLEG3 = Y2 - RADIUS * SIN(LCURVE/12)
+LET/QUIET     XSTRAIGHT = IF L LE 50 THEN XLEG1 ELSE XLEG2
+LET/QUIET     YSTRAIGHT = IF L LE 50 THEN YLEG1 ELSE YLEG2
+LET/QUIET     XTRACK = IF L LE 70 THEN XSTRAIGHT ELSE XLEG3
+LET/QUIET     YTRACK = IF L LE 70 THEN YSTRAIGHT ELSE YLEG3
+
+LET/QUIET     SST = 25 - YTRACK/3
+LET/QUIET     wind = ytrack/20 * RANDN(ytrack)
+SET REGION/L=1:120
+ 
+! Plot SST and indicate the ship track
+go basemap x=120:260 Y=25s:65n 20
+go polytube polygon/over/key/title="SST" xtrack ytrack SST
+plot/vs/line/sym/over/nolab xtrack, ytrack
+\PAUSE
+
+! a similar plot, but a thinner "tube" with a different palette, and another
+! variable drawn dith it
+go basemap x=120:260 Y=25s:65n 20
+go polytube polygon/over/key/pal=no_green xtrack ytrack SST 0.3
+label/nouser `1.05*($ppl$xlen)`,-.5,0,0,.15 @CRSST
+go trackplot plot/vs/line/over/color=green/thickness=2/title="wind" xtrack ytrack wind
+
+
diff --git a/jnls/examples/quantiles.jnl b/jnls/examples/quantiles.jnl
new file mode 100644
index 0000000..898dbd6
--- /dev/null
+++ b/jnls/examples/quantiles.jnl
@@ -0,0 +1,65 @@
+! To form quartiles, or percentiles, use the ZSEQUENCE function.
+! Based on a contribution from Andrew Wittenberg Fri, 17 Sep 2004 
+
+! Here's an example showing how to compute quartiles (and more generally, 
+! quantiles/percentiles) from some 2-dimensional data:
+
+use coads_climatology
+let svar = sst[l=1]
+
+set mode interp
+
+! unwrap January  SSTs into a 1-dimensional array
+let a = zsequence(svar)
+
+! define a quantile axis
+let ngood = `a[k=@ngd]`
+def ax/z=0:1/np=`ngood` z_q
+
+! sort the data (missing values will be last)
+let a_z = samplek(a,sortk(a))
+ 
+! place the sorted valid data onto the quantile axis
+let/title="quantiles of `sst,r=title`"/unit="`sst,r=unit`" a_q = a_z[gz=z_q at asn]
+
+! plot the quantile function (inverse cumulative distribution function)
+plot/trans a_q
+
+! list the min, 1st quartile, median, 3rd quartile, and max 
+list a_q[z=0],a_q[z=.25],a_q[z=.5],a_q[z=.75],a_q[z=1]
+
+
+! Plot shaded percentiles. pct_levs contains the variable values separating 
+! each range of 10 percentile points
+
+let pct_levs = a_q[z=0:1:0.1]
+list pct_levs
+
+! Form variables each containing a range of 10 percentile points, e.g.
+!
+!     let mask2 = if svar le hi then 1 else 0 ! mask=1 where svar LE 30th percentile
+!     let v2   = if svar gt lo then 15* mask2 else 0  
+!
+! then v2 contains the value 15 where svar is between the tenth and 20th
+! percentile, and v2 is 0 everwhere else.
+
+! inialize the series of variables
+let v1 = if svar le `pct_levs[k=1]` then 0 else 0
+
+! Define variables each representing a 10 percent range
+
+repeat/range=2:11:1/name=m (let vhi = pct_levs[k=`m`]; let vlo = pct_levs[k=`m-1`]; \
+let mask`m` = if svar le `vhi` then 1  else 0; \
+ let v`m` = if svar GT `vlo` then `10*(m-1)-5` * mask`m` else 0)
+
+! Add to form a single varible which is 5 for 0-10%, 15 for 10-20% and so on.
+
+let pct = v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10 + v11
+
+! Define a mask to restore the missing data from the original variable, 
+! mask=1 where the variable has valid data
+
+let missing_mask = if svar then 1
+
+shade/lev=(0,100,10)/palette=blue_orange/title="percentiles" pct * missing_mask
+go fland
diff --git a/jnls/examples/regridding_demo.jnl b/jnls/examples/regridding_demo.jnl
new file mode 100644
index 0000000..b3398ef
--- /dev/null
+++ b/jnls/examples/regridding_demo.jnl
@@ -0,0 +1,177 @@
+CANCEL MODE VERIFY
+! Description: tutorial to introduce FERRET regridding concepts
+
+MESSAGE/CONTINUE   ... setting up demo environment ...
+! regridding.jnl *sh* 11/91 - regridding demo
+! eliminate the program state left by previous activities
+CANCEL REGION
+CANCEL VARIABLES/ALL
+CANCEL DATA/ALL
+SET WINDOW/SIZE=0.7/ASPECT=.75:axis   ! default
+SET GRID ABSTRACT
+SET MODE CALENDAR:DAYS
+SET MODE VERIFY     ! display the command lines below at the user's console
+
+! This demonstration/tutorial will introduce FERRET regridding concepts.
+
+! As the demonstration runs please continue to read the text on the screen.
+! You will see exactly the commands that are controlling the FERRET program.
+! Lines that begin with "!" are comment lines - no action is taken by FERRET.
+
+! The explanatory text provided is quite brief.
+! Further explanation is provided in the FERRET Users' Guide.
+
+! This demonstration presumes that you are seated at a windowing screen.
+! ==== Parts of this demo will not work properly on dumb terminal displays ====
+
+MESSAGE
+
+! We begin by selecting the ETOPO data set: earth surface relief
+! We will display some data over North America.
+! Notice that the resolution of this particular data set is quite low.
+
+SET DATA etopo120
+SHADE/X=160W:40W/Y=20N:70N rose
+
+message
+
+! Now we will define new axes and a new grid with finer resolution.
+! We will then view the same data regridded to this new grid.
+! FERRET regridding is controlled by "g=...".
+! By default regridding is done via multi-linear interpolation.
+! Note that interpolation may produce some undesirable effects
+!      e.g. eliminating much of Florida.  
+
+DEFINE AXIS/X=160W:40W:.5/UNIT=LONGITUDE xfine
+DEFINE AXIS/Y=20N:70N:.5/UNIT=LATITUDE   yfine
+DEFINE GRID/X=xfine/Y=yfine gfine
+SHADE/X=160W:40W/Y=20N:70N rose[g=gfine]
+
+message The @AVE transformation improves this behavior in this instance
+
+SHADE/X=160W:40W/Y=20N:70N rose[g=gfine at AVE]
+
+message
+
+! Gridded data fields often exist on grids with unequally spaced points.
+! The subsampled Levitus climatology provided with FERRET is an example
+! of such a data set.
+
+! We will plot the upper 100 meters of temperature at several arbitrary
+! lat./long. positions and indicate the points with a large marker ("2").
+! The unequal spacing of the point along the depth axis is apparent.
+
+! Note:  "SHOW GRID/Z=0:100 temp"   could be used to list the exact depths.
+
+SET DATA levitus_climatology
+PLOT/X=140W/Z=0:100/LINE/SYMBOL=2 temp[Y=20N], temp[Y=10N], temp[Y=0]
+
+message
+
+! Suppose we require this data every 5 meters in the vertical.
+! We can define a grid to acheive this.
+
+DEFINE AXIS/Z=0:5000:5/UNIT=meters z5
+DEFINE GRID/LIKE=temp/Z=z5  gz5
+
+! The "LIKE=temp" ensures that the original X and Y axes will be preserved.
+
+! Now we'll plot the original "curves" and overlay the regridded values.
+
+LET tempz5 = temp[g=gz5]
+PLOT/X=140W/Z=0:100 temp[Y=20N], temp[Y=10N], temp[Y=0]
+PLOT/OVERLAY/SYMBOLS/X=140W/Z=0:100 tempz5[Y=20N], tempz5[Y=10N], tempz5[Y=0]
+
+! Note that the LIST command could be used to obtain these results in a file.
+
+message
+
+! A common need for regridding is to compare variables from different
+! data  sets.
+! As a test case we will examine sea surface temperature fields from 2
+! different sources: Esbensen-Kushnir and COADS
+! First we will shade Esbensen-Kushnir sst and overlay the COADS sst in
+! the North Pacific.
+
+SET DATA esku_heat_budget, coads_climatology
+SET REGION/Y=0:70N/X=130E:60W
+SHADE/T="15-JAN"           sst[d=esku_heat_budget]
+GO land
+CONTOUR/OVERLAY/T="15-JAN" sst[d=coads_climatology]
+
+message
+
+! Clearly, the two fields are similar.
+! We would like to subtract them to examine the differences.
+! Unfortunately the two fields are on different grids.
+! The SHOW GRID command will next be used to compare the latitudes of sst
+! grid points between 1 and 5 degrees north from each data set:
+
+!	SHOW GRID/Y=1N:5N sst[d=esku_heat_budget] sst[d=coads_climatology]
+
+message
+
+SHOW GRID/Y=1N:5N sst[d=esku_heat_budget] sst[d=coads_climatology]
+message
+
+! Now we will use the grid from the COADS data set to regrid the 
+! Esbensen-Kushnir sst to the (finer) COADS grid. And shade the difference 
+! field using a zero-centered color palette.
+
+LET DIFF = sst[d=esku_heat_budget,g=sst[d=coads_climatology]] - sst[d=coads_climatology]
+SHADE/T="15-JAN"/LEVELS=(-3,3,0.5) diff
+GO rgb_centered
+GO land
+
+message
+
+! What happens when the dimensionality of variables differs ?
+! As a test case lets examine the US Navy Fleet Numerical winds.
+! We will use the earth surface relief to create land masses.
+
+! Note:  "Using every 2th vector in the X direction" is an
+! informational message from FERRET.
+
+set data monthly_navy_winds
+shade/lev="(0)(8000)"/nokey rose[d=etopo120]
+vector/l=1/over uwnd,vwnd
+
+message
+
+! How can we eliminate the wind values over the land ?
+! The earth relief data should allow us to do this.
+! However the winds are defined at different latitude/longitude
+! points from the earth relief.
+! Also ==> "uwnd" (and "vwnd") has discrete time locations whereas 
+!          "rose" is time-independent.
+
+message
+
+SHOW GRID   rose[d=etopo120] 
+
+SHOW GRID   uwnd[d=monthly_navy_winds]
+message
+
+! If we request "rose[g=fnoc251]" FERRET will flag an error because the
+! "rose" cannot be unambiguously located on a time axis.
+! To obtain "rose" on the latitude/longitude points of "uwnd" we define
+! a new grid which is like "uwnd" but keeps the (normal) time axis
+! of the variable "rose".
+ 
+DEFINE GRID/LIKE=uwnd[d=monthly_navy_winds]/T=rose[d=etopo120] gmask
+
+message
+
+! Then we will use this grid to create a land mask.
+! And use the mask to vector plot the winds only over the oceans.
+
+LET ocean = if rose[d=etopo120,g=gmask] le 0 then 1
+SHADE/LEVELS="(0)(8000)"/nokey rose[d=1,g=gmask]
+VECTOR/L=1/OVER uwnd*ocean, vwnd*ocean
+
+message
+
+! done - restore normal FERRET states
+SET MODE VERIFY
+GO rgb_rainbow
+SET MODE CALENDAR:MINUTES
diff --git a/jnls/examples/ribbon_plot_demo.jnl b/jnls/examples/ribbon_plot_demo.jnl
new file mode 100644
index 0000000..bbc90e3
--- /dev/null
+++ b/jnls/examples/ribbon_plot_demo.jnl
@@ -0,0 +1,197 @@
+\cancel mode verify
+! ribbon_plot_demo.jnl
+! Description: Demonstration of various ribbon plotting options
+! Ferret v6.84 capabilities for coloring a line by the values
+! of a variable, or "ribbon" plots.
+!
+
+say **** Welcome to the Ribbon plotting demo ****
+say .
+say This demo will lead you through a number of options and styles for
+say colored-by-variable line plotting in FERRET. The commands that are
+say producing the plots you will see are set off in the style
+say
+say .   yes? [command]
+say
+say 
+pause
+
+! clean up from any previous activity and set up
+define region/default save
+cancel region
+set wind/asp=.75:ax
+go white
+cancel mode logo
+cancel viewports
+ppl shaset reset
+
+say Ribbon plots are line plots colored by a variable. 
+say These may be 3-variable PLOT/VS plots, colored by the third argument
+
+
+say . RIBBON/VS/LEV= xpts, ypts, var
+say . 
+say . or 2-variable line plot, colored by the second argument
+say . RIBBON/LEV= var1, var2
+say . 
+say . The alias RIBBON is shorthand for PLOT/RIBBON
+say ...
+
+say .    yes? show alias ribbon
+
+show alias ribbon
+
+pause
+
+
+say Here are some plots where a line plot is colored by a second variable.
+say
+say .    yes? USE coads_climatology
+say .    yes? RIBBON/THICK/Y=0/L=6 sst, speh
+say ...
+
+USE coads_climatology
+RIBBON/THICK/Y=0/L=6 sst, speh
+
+pause
+
+say Now temperature, colored by salinity
+
+say
+say .    yes? USE levitus_climatology
+say .    yes? RIBBON/X=150/Y=10/L=5/Z=0:3000/LEV=v/THICK temp, salt
+say ...
+
+USE levitus_climatology
+RIBBON/X=150/Y=10/L=5/Z=0:3000/LEV=v/THICK temp, salt
+
+pause
+
+say We can even plot a variable, colored by itself. 
+say Notice here that the /LEVELS and /PALETTE qualifiers are
+say applied in the same way as for any 2-dimensonal color plot.
+say ...
+
+say
+say .    yes? USE etopo60
+say .    yes? RIBBON/Y=30/THICK/PALETTE=land_sea/LEVEL=c rose, rose
+say ...
+
+
+USE etopo60
+RIBBON/Y=30/THICK/PALETTE=land_sea/LEVEL=c rose, rose
+
+pause
+can data/all
+can view
+
+LET/TITLE="Xloc"/UNITS=degrees_east xpts = {\
+151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,\
+177.0,179.0,181.0,183.0,185.0,187.0,189.0}
+
+LET/TITLE="SST"/UNITS="Deg C" ypts {\
+29.32,29.43,29.33,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+28.69,28.20,28.86,27.98,27.80,28.29,27.94}
+
+LET/TITLE="VAR"/UNITS="V" var =  {\
+11.5, 2.5, 13.5, 4.5, 15.5, 6.5, 17.5, 8.5, 19.5, 1.5, 11.5, 2.5, 13.5, 4.5, \
+15.5, 6.5, 17.5, 8.5, 19.5, 10.5}
+
+
+say We just defined some variables to plot. These will be 
+say PLOT/VS plots, where the plot is colored by a third variable.
+say
+say By default, colors are blended from one point to the next, with the 
+say color right at the point corresponding to the value at that point.
+say If we plot with /SYMBOL, the symbols will be colored by the exact color
+say for the variable at that point.
+say
+say The /FAST qualifier draws a plot without this blending. The color 
+say for the point extends from the start of the grid cell to the end 
+say of the grid cell.
+
+say Plot with /LINE/SYMBOL to show both the points and the line between them
+say ...
+say
+say .    yes? SET VIEW upper
+say .    yes? RIBBON/VS/LINE/SYMBOL=21/THICK/LEV=10/TITLE="Without FAST qualifier" xpts,ypts,var
+say
+say .    yes? SET VIEW lower
+say .    yes? RIBBON/FAST/VS/LINE/SYMBOL=21/THICK/LEV=10/TITLE="With FAST qualifier" xpts,ypts,var
+
+
+
+SET VIEW upper
+RIBBON/VS/LINE/SYMBOL=21/THICK/LEV=10/TITLE="Without FAST qualifier" xpts,ypts,var
+
+pause
+
+say Compare with the same data plotted using the /FAST qualifier
+say ...
+say
+
+SET VIEW lower
+RIBBON/FAST/VS/LINE/SYMBOL=21/THICK/LEV=10/TITLE="With FAST qualifier" xpts,ypts,var
+
+pause
+cancel view
+
+say If there are gaps in the variable or variables that define the line, there 
+say is a gap in the line. If there is a gap in the color-by variable, the line
+say is drawn using a thin gray line.
+
+say Lets add a gap or two to the color-by variable.
+say ...
+
+
+say .    yes? LET/TITLE="VAR"/UNITS="V" var =  {\
+say        14.16,14.31,13.34,11.90,12.19, , ,12.25,10.37, 9.22,10.05, 5.91, \
+say        3.13, 6.88, 2.02, 8.63, , , 2.94,-0.65}
+
+
+say .    yes? SET VIEW upper
+say .    yes? RIBBON/VS/LINE/THICK=3/PAL=rnb2/TITLE="Gaps in var" xpts,ypts,var
+
+
+
+LET/TITLE="VAR"/UNITS="V" var =  {\
+ 14.16,14.31,13.34,11.90,12.19, , ,12.25,10.37, 9.22,10.05, 5.91, \
+ 3.13, 6.88, 2.02, 8.63, , , 2.94,-0.65}
+
+
+SET VIEW upper
+RIBBON/VS/LINE/THICK=3/PAL=rnb2/TITLE="Gaps in var" xpts,ypts,var
+
+pause
+
+
+say Add some gaps in one of the /vs varibles.
+say ...
+
+     
+say .    yes? LET/TITLE="SST"/UNITS="Deg C" ypts {\
+say        29.42,29.43, ,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+say        28.69,28.20,28.86,27.98, ,28.29,27.94}
+
+say .    yes? SET VIEW lower 
+say .    yes? RIBBON/VS/LINE/THICK=3/PAL=rnb2/TITLE="Gaps also in the versus variable"  xpts,ypts,var
+
+     
+LET/TITLE="SST"/UNITS="Deg C" ypts {\
+  29.42,29.43, ,29.19,29.22,29.12,29.36,29.22,29.04,28.92,29.00,28.59,28.31,\
+  28.69,28.20,28.86,27.98, ,28.29,27.94}
+
+SET VIEW lower 
+RIBBON/VS/LINE/THICK=3/PAL=rnb2/TITLE="Gaps also in the versus variable"  xpts,ypts,var
+
+
+pause
+say ...
+
+say clean up
+set region save
+
+set mode/last logo
+cancel viewports
+ppl shaset reset
+set mode/last verify
diff --git a/jnls/examples/samplexy_demo.jnl b/jnls/examples/samplexy_demo.jnl
new file mode 100644
index 0000000..4244227
--- /dev/null
+++ b/jnls/examples/samplexy_demo.jnl
@@ -0,0 +1,57 @@
+! samplexy_demo.jnl
+! 5/27/03 *acm*
+
+! Set up some viewports.
+
+DEF VIEW/AXES/X=0.1:0.9/Y=0.65:0.95 bigup
+DEF VIEW/AXES/X=0.1:0.9/Y=0.15:0.45 bigdn
+
+
+! Description: Use the SAMPLEXY function to create an arbitrary 2D 
+! vertical section from a 3D field. The result has the same depth
+! axis as the variable being sampled.  The horizontal axis is abstract; 
+! it is a count of the number of points along the track.  
+
+
+! Here is a section of the Levitus climatological temperature running
+! along a track defined by points (xlon, xlat), which could also be
+! read from a file.
+
+SET DATA levitus_climatology
+
+LET xlon = {234.6, 228.4, 220.9, 213.0, 204.7, 196.0, 187.5, 178.9, 170.9, 163.5, 157.1, 151.2, 144.8}
+LET ylat = { 48.6,  50.5,  52.2,  53.4,  54.0,  54.2,  54.0,  53.5,  52.8,  50.9,  48.5,  45.5,   42.3}
+
+SET VIEW bigup
+GO basemap X=130:250 Y=20:65 20
+PLOT/VS/over/LINE/SYM=27/title="ship track" xlon,ylat      ! Demonstration ship track
+
+
+SET VIEW bigdn
+
+FILL/set/title="TEMP along ship track" SAMPLEXY(temp, xlon, ylat)
+PPL XLAB "point count"
+PPL FILL
+
+message Now show the example from the Users Guide
+
+USE levitus_climatology
+LET xlon = 234.5 + I[I=1:50]       ! define the slant line
+LET dely = 24./49
+LET ylat = 24.5 - dely*i[i=1:50] + dely
+
+set view bigup
+PLOT/VS/LINE/SYM=27 xlon, ylat      ! line off Central America
+GO land 
+
+! Now sample the field "salt" along this track and make a filled contour plot.  
+! To speed the calculation, or if we otherwise want to restrict the region used 
+! on the variable salt, put that information in explicit limits on the first argument.
+
+set view bigdn
+LET slantsalt = SAMPLEXY(salt[X=200:300,Y=0:30],xlon,ylat)
+FILL/SET/LEVELS=(33.2,35.2,0.1)/VLIMITS=0:4000 slantsalt
+PPL XLAB "point count"
+PPL FILL
+
+
diff --git a/jnls/examples/shaded_error_bar_zone.jnl b/jnls/examples/shaded_error_bar_zone.jnl
new file mode 100644
index 0000000..a4f23a9
--- /dev/null
+++ b/jnls/examples/shaded_error_bar_zone.jnl
@@ -0,0 +1,60 @@
+! 7/98 - demonstrate a shaded region (representing a region of uncertainty)
+! behind a line plot
+! *acm* 7/01 update /ylimits to /vlimits
+
+! This example uses a time series -- which has a special difficulty
+
+! Description: Demo of shaded (error uncertainty) region around line plot
+
+! First example -- where time series axis is in units of hours
+DEFINE AXIS/t=1-jan-1980:1-jan-1981:24/UNIT=hours thr
+LET fcn = SIN(T[gt=thr]/500)
+
+! basic plot of function
+PLOT/VLIMITS=-2:2 fcn
+
+! 2D version of function
+LET fcn_2d = z[z=-2:2:.4] - fcn
+
+! illustrate what the 2D function looks like: positive above, negative below
+FILL/PALETTE=centered fcn_2d
+
+! now illustrate a shaded uncertainty regionaround the time series
+FILL/LEV=(-.3)(.3)/PALETTE=gray/NOKEY/TITLE="My Function" fcn_2d
+PLOT/OVER/NOLAB fcn
+MESSAGE  ! pause
+
+!================
+! second example -- a complication if time axis is not in hours
+DEFINE AXIS/t=1-jan-1980:1-jan-1981:1/UNIT=days tday
+LET fcnDAY = SIN(T[gt=tday]/(500/24))
+
+! basic plot of function
+PLOT/VLIMITS=-2:2 fcnDAY
+
+! 2D version of function
+LET fcnDAY_2d = z[z=-2:2:.4] - fcnDAY
+
+! the background plot ...
+! (define a 1-color light gray palette to taste --
+! see "Fpalette -more green.spk" as an example )
+FILL/LEV=(-.3)(.3)/PALETTE=gray/NOKEY/TITLE="My Function" fcnDAY_2d
+
+! and the line plot fails!!
+PLOT/OVER/NOLAB fcnDAY  	! where did the plot go???
+MESSGE
+
+! the problem is evident if you use the command "PPL LIST TAXIS"
+! after both the FILL and the PLOT graphics. You'll see that the
+! value od "DT" is different in the 2 cases. The PLOT command ALWAYS
+! creates PLOT+ time axes in units of hours (DT=60), whereas the FILL
+! (or CONTOUR or SHADE) command uses the original units of the time axis.
+! So, to get around the problem you have to regrid the 2D field to an
+! hourly time axis before plotting it.
+
+! successful plot using hours...
+FILL/LEV=(-.3)(.3)/PALETTE=gray/NOKEY/TITLE="Yes" fcnDAY_2d[gt=thr]
+PLOT/OVER/NOLAB fcn
+
+
+
diff --git a/jnls/examples/show_all_patterns.jnl b/jnls/examples/show_all_patterns.jnl
new file mode 100644
index 0000000..f506b19
--- /dev/null
+++ b/jnls/examples/show_all_patterns.jnl
@@ -0,0 +1,79 @@
+\cancel mode verify
+! show_patterns.jnl
+!	designed to show all the installed patterns available
+!	all patterns are shown in the color inputed or black if none specified
+!
+!	INPUTS	
+!		1: (optional)		name of color palette to use
+!					(default=black)
+
+
+define symbol color $1"black"		
+
+!	set up total number of installed patterns (must be changed by hand)
+define symbol NUM_PATTERNS 21
+
+
+define symbol mylevels "(0.5,`($NUM_PATTERNS)+0.5`,1)"
+
+! 	set up viewports 
+define symbol numview 7
+repeat/k=1:($numview) define viewport/ylimits=`(k-1)/($numview)`,`k/($numview)`/xlimits=0.0,0.333 L`($numview)-k+1`
+repeat/k=1:($numview) define viewport/ylimits=`(k-1)/($numview)`,`k/($numview)`/xlimits=0.333,0.666 M`($numview)-k+1`
+repeat/k=1:($numview) define viewport/ylimits=`(k-1)/($numview)`,`k/($numview)`/xlimits=0.666,0.999 R`($numview)-k+1`
+
+
+!	make the first page
+set viewport L1
+go show_pattern.jnl "solid" ($color)
+set viewport L2
+go show_pattern.jnl "fish_scale" ($color)
+set viewport L3
+go show_pattern.jnl "brick" ($color)
+set viewport L4
+go show_pattern.jnl "ball_bearings" ($color)
+set viewport L5
+go show_pattern.jnl "weave" ($color)
+set viewport L6
+go show_pattern.jnl "double_vertical" ($color)
+set viewport L7
+go show_pattern.jnl "double_horizontal" ($color)
+
+
+set viewport M1
+go show_pattern.jnl "large_grid" ($color)
+set viewport M2
+go show_pattern.jnl "tiny_open_squares" ($color)
+set viewport M3
+go show_pattern.jnl "angled_grid" ($color)
+set viewport M4
+go show_pattern.jnl "lite_up_left_to_right" ($color)
+set viewport M5
+go show_pattern.jnl "lite_up_right_to_left" ($color)
+set viewport M6
+go show_pattern.jnl "lite_vertical" ($color)
+set viewport M7
+go show_pattern.jnl "lite_horizontal" ($color)
+
+
+set viewport R1
+go show_pattern.jnl "tiny_grid" ($color)
+set viewport R2
+go show_pattern.jnl "tiny_squares" ($color)
+set viewport R3
+go show_pattern.jnl "tiny_triangles" ($color)
+set viewport R4
+go show_pattern.jnl "dark_up_left_to_right" ($color)
+set viewport R5
+go show_pattern.jnl "dark_up_right_to_left" ($color)
+set viewport R6
+go show_pattern.jnl "dark_vertical" ($color)
+set viewport R7
+go show_pattern.jnl "dark_horizontal" ($color)
+
+
+set mode/last verify
+exit
+
+
+
diff --git a/jnls/examples/show_pattern.jnl b/jnls/examples/show_pattern.jnl
new file mode 100644
index 0000000..eff3872
--- /dev/null
+++ b/jnls/examples/show_pattern.jnl
@@ -0,0 +1,21 @@
+! show_pattern.jnl
+! 	shows up to the first 10 patterns in a .pat file 
+! 	in a color or colors of the user's choice
+!
+!	INPUTS
+!		1: (required)		.pat pattern file name
+!
+!		2: (optional)		color palette name
+!					(default=black)
+
+define symbol patternfile  $1"default"
+define symbol palettecolor $2"black"
+shade/nokey/nolab/set/i=1:100/j=1:100/lev=(1,101,10)/pattern=($patternfile)/palette=($palettecolor) i+j-j+0.5
+ppl tics 0,0,0,0
+ppl axlabp 0,0
+ppl labs/nouser,1,0,-0.4,-1,"@AC($patternfile)"
+ppl hlabs, 1, 0.25
+go margins 0.5 0.5 0.5 0.5
+ppl shade
+ppl shaset reset
+
diff --git a/jnls/examples/sigma_coordinate_demo.jnl b/jnls/examples/sigma_coordinate_demo.jnl
new file mode 100644
index 0000000..280e814
--- /dev/null
+++ b/jnls/examples/sigma_coordinate_demo.jnl
@@ -0,0 +1,194 @@
+! sigma_coordinate_demo_zaxreplace.jnl 9/96 *sh*
+!    updated 11/97 using ZAXREPLACE() function
+
+! Description: demo of how to handle sigma coordinate output
+
+! This demo will proceed in several steps:
+! 1) We will create an artificial sigma coordinate model output data set
+!    Clearly in **your** application you would not do this -- you
+!    would be working with your own model outputs
+! 2) We will define the "depth" function as the vertical integral of
+!    layer thickness and produce some reference plots from it
+! 3) We will show how to transform the 4-dimensional X-Y-LAYER-TIME data
+!    set into an X-Y-DEPTH-TIME representation:
+! 3a) Simple case -- where Z is a single fixed depth
+!     For example, a time series at a fixed depth
+! 3b) General case -- where the "view" of the data requires a range of depths
+!     For example, a vertical section contour plot
+ 
+
+! ----------------------
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+
+! Create variables to define a bottom bathymetry on a grid
+! and a vertical sigma coordinate system of 10 layers.
+! We will invent a (non-physical) flow field in a channel.
+
+! The variables we create will be
+!	bathymetry - the bottom bathymetry for the model
+!	h	   - layer thickness (a fcn of X,Y,Z, and T)
+!	flow	   - the flow field
+
+! house-keeping for the demo
+cancel wind 2
+set wind 1
+define view/x=0.0:.33 v1
+define view/x=.33:.67 v2
+define view/x=.67:1.0 v3
+
+define axis/x=-50:50:2/unit=km xchannel
+define axis/y=-30:30:2/unit=km yrise
+define axis/z=1:10:1/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gg
+
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gg]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gg]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gg]/100
+let h0 = EXP(time_evolve*K[g=gg])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+
+! fictitious flow field:
+! ... faster near surface
+!     faster at mid-channel than near the edges
+!     speeds up over the rise
+!     speed increases with sinusoidal variation in time
+let flow_profile = LOG((11-K[g=gg]))
+let time_ramp = 1 + L[g=gg]/20 + 0.2*SIN((L[g=gg]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+
+! ----------------------
+! 2) DEFINE "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+
+! The depth of each (x,y,k) grid point is computed by integrating H.
+! We subtract h/2 because we want the depth of the midpoint of the layer.
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+
+! * * * PLOT: a 3-frame plot to serve as a reference
+   set wind/asp=.4/size=.7 1
+   set view v1
+   go magnify 1.1
+   wire/view=-30,-80,150 bathymetry	! from 150m above and 80 km upstream
+
+   set view v2
+   go magnify 1.1
+   shade/y=0/l=1 depth
+   contour/y=0/l=1/levels=(50)DARK(50)/over/nolab/palette=black depth
+   label 0 2 0,0,.15 @AC(50m depth marked)
+
+   set view v3
+   go magnify 1.1
+   fill/y=0/l=1/levels=(0,320,20) flow
+   contour/y=0/l=1/levels=(50)DARK(50)/over/nolab/palette=black depth
+   label 0 2.4 0,0,.15 @AC(50m depth marked)
+
+   label/nouser -1 -.65 0,0,.2 @ACMid-way
+   label/nouser -1 -.90 0,0,.2 @ACdown channel
+
+   message
+
+! ----------------------
+! DEFINE FLOW FIELD ON A DEPTH AXIS
+
+define axis/z=0:180:2/unit=meters/depth zdepth
+LET flow_on_depth = ZAXREPLACE(flow,depth, z[gz=zdepth])
+set variable/title="Flow as a function of depth" flow_on_depth
+
+   message
+
+! ----------------------
+! VISUALIZE FLOW WHERE Z IS A SINGLE FIXED DEPTH
+! Note: this demo is graphical but the procedure is valid for analyses, as well
+
+LET flow_at_50 = flow_on_depth[Z=50]
+set variable/title="Flow at 50 meters" flow_at_50
+
+! * * * PLOT: a 2-frame plot comparing flow field in a single layer
+!	with flow at fixed depth
+   set wind/asp=.5 2
+   set wind/clear
+   set view left
+   go magnify 1.2
+
+!  ... flow field within a single layer
+   fill/k=8/l=1/title="Flow in layer 8"/level=(0,320,20) flow
+
+   set view right
+   go magnify 1.2
+
+!  Note: the missing points between the flow and the black mask occur
+!  ... because the deepest layer of flow is considered to be 1/2 grid box above
+!  ... the bottom
+   shade/l=1/level flow_at_50
+   shade/over/nolab/palette=black IF bathymetry GT (-50) then 1
+   plot/vs/over/line x[g=gg], -1 * bathymetry[y=0]
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACPlan View
+   message
+
+! Make a time-series plot comparing flow in a layer with flow at a fixed depth
+! (at the top of the rise along the channel mid-line)
+   cancel view
+   set wind/asp=.5
+   plot/x=0/y=0/l=1:20 flow[k=8], flow_at_50
+
+   label/nouser  `($ppl$xlen)/2` `($ppl$ylen)+0.3` 0,0,.25 @ACTime series
+
+   message
+
+! ----------------------
+! VISUALIZE FLOW WHERE THE "VIEW" OF THE DATA REQUIRES A RANGE OF DEPTHS
+! Note: this demo is graphical but the procedure is valid for analyses, as well
+
+
+! * * * PLOT: across-channel flow field at the "rise" along the channel
+! 	Compare flow as a function of layer with flow as a function of depth
+   set wind/clear
+   set wind/asp=.5
+   set view left
+   go magnify 1.2
+
+!  First flow as a function of layer
+   fill/Y=0/l=1/level=(0,320,20)/title="Flow as a function of layer" flow
+
+   set view right
+   go magnify 1.2
+
+!  Now flow as a function of depth
+!  Note: the missing points at the surface occur where the top H layer
+!        is thick enough so that the mid-point of the top layer is deeper
+!        than the first point of the new depth axis, zdepth
+   shade/levels/z=0:180/Y=0/L=1 flow_on_depth
+   plot/vs/over/line x[g=gg], -1 * bathymetry[y=0]
+
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACCross-section: mid-way along channel
+   message
+
+! * * * PLOT: along-channel flow at mid-channel
+! 	Compare flow as a function of layer with flow as a function of depth
+   set wind/clear
+   set view left
+   go magnify 1.2
+
+!  First flow as a function of layer
+   fill/x=0/l=1/title="Flow as a function of layer" flow
+
+   set view right
+   go magnify 1.2
+
+!  Now flow as a function of depth
+   shade/levels/z=0:180/X=0/L=1 flow_on_depth
+   plot/vs/over/line y[g=gg], -1 * bathymetry[x=0]
+
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACSection along channel axis
diff --git a/jnls/examples/sigma_coordinate_demo_weq.jnl b/jnls/examples/sigma_coordinate_demo_weq.jnl
new file mode 100644
index 0000000..858235b
--- /dev/null
+++ b/jnls/examples/sigma_coordinate_demo_weq.jnl
@@ -0,0 +1,228 @@
+! sigma_coordinate_demo.jnl 9/96 *sh*
+!    comments updated 11/97 for ZAXREPLACE() function availability
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+
+! Description: demo of how to handle sigma coordinate output
+
+! This demo will proceed in several steps:
+! 1) We will create an artificial sigma coordinate model output data set
+!    Clearly in **your** application you would not do this -- you
+!    would be working with your own model outputs
+! 2) We will define the "depth" function as the vertical integral of
+!    layer thickness and produce some reference plots from it
+! 3) We will show how to transform the 4-dimensional X-Y-LAYER-TIME data
+!    set into an X-Y-DEPTH-TIME representation:
+! 3a) Simple case -- where Z is a single fixed depth
+!     For example, a time series at a fixed depth
+! 3b) General case -- where the "view" of the data requires a range of depths
+!     For example, a vertical section contour plot
+ 
+
+! ----------------------
+! 1) CREATE AN ARTIFICIAL SIGMA COORDINATE MODEL OUTPUT
+
+! Create variables to define a bottom bathymetry on a grid
+! and a vertical sigma coordinate system of 10 layers.
+! We will invent a (non-physical) flow field in a channel.
+
+! The variables we create will be
+!	bathymetry - the bottom bathymetry for the model
+!	h	   - layer thickness (a fcn of X,Y,Z, and T)
+!	flow	   - the flow field
+
+! house-keeping for the demo
+cancel wind 2
+set wind 1
+define view/x=0.0:.33 v1
+define view/x=.33:.67 v2
+define view/x=.67:1.0 v3
+
+define axis/x=-50:50:2/unit=km xchannel
+define axis/y=-30:30:2/unit=km yrise
+define axis/z=1:10:1/unit=layer/depth zlayer
+define axis/T=1:20:1/unit=hours time
+define grid/x=xchannel/y=yrise/z=zlayer/t=time gg
+
+! bathymetry: a channel with a rise along the axis of the channel
+let pi = 3.14159
+let nominal_depth = 100
+let cross_channel_size = nominal_depth * (1 + COS(X[g=gg]/60*pi))
+let xchannel = -1 * cross_channel_size
+let rise_shape = (1 + COS(Y[g=gg]/40*pi))/6
+let bathymetry = xchannel + rise_shape*CROSS_CHANNEL_SIZE
+set variable/title="Channel Bathymetry"/unit=meters bathymetry
+
+! sigma layer thickness: varies in X, Y, Z, and T in this example
+let time_evolve = 0 + L[g=gg]/100
+let h0 = EXP(time_evolve*K[g=gg])
+let h_normalized = h0/h0[k=1:10 at sum]
+let h = h_normalized * (-1 * bathymetry)
+set variable/title="layer thickness"/unit=meters h
+
+! fictitious flow field:
+! ... faster near surface
+!     faster at mid-channel than near the edges
+!     speeds up over the rise
+!     speed increases with sinusoidal variation in time
+let flow_profile = LOG((11-K[g=gg]))
+let time_ramp = 1 + L[g=gg]/20 + 0.2*SIN((L[g=gg]-1)/2)
+let flow = time_ramp * flow_profile * cross_channel_size / (1-rise_shape)
+set variable/title="non-physical flow field" flow
+
+! ----------------------
+! 2) DEFINE "DEPTH" --  THE VERTICAL INTEGRAL OF LAYER THICKNESS
+
+! The depth of each (x,y,k) grid point is computed by integrating H.
+! We subtract h/2 because we want the depth of the midpoint of the layer.
+let depth = h[k=@rsum]-h/2
+set variable/title="DEPTH function"/unit=meters depth
+
+! * * * PLOT: a 3-frame plot to serve as a reference
+   set wind/asp=.4/size=.7 1
+   set view v1
+   go magnify 1.1
+   wire/view=-30,-80,150 bathymetry	! from 150m above and 80 km upstream
+
+   set view v2
+   go magnify 1.1
+   shade/y=0/l=1 depth
+   contour/y=0/l=1/levels=(50)DARK(50)/over/nolab/palette=black depth
+   label 0 2 0,0,.15 @AC(50m depth marked)
+
+   set view v3
+   go magnify 1.1
+   fill/y=0/l=1/levels=(0,320,20) flow
+   contour/y=0/l=1/levels=(50)DARK(50)/over/nolab/palette=black depth
+   label 0 2.4 0,0,.15 @AC(50m depth marked)
+
+   label/nouser -1 -.65 0,0,.2 @ACMid-way
+   label/nouser -1 -.90 0,0,.2 @ACdown channel
+
+   message
+
+! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! 
+! NOTE !!!!!
+! From this point on the demo is based on the techniques that were available
+! in Ferret pre-version 4.9. See http://tmap.pmel.noaa.gov/ferret/FAQ for
+! more recent techniques based on the ZAXREPLACE() function
+! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! 
+
+
+! ----------------------
+! SIMPLE CASE -- VISUALIZE FLOW WHERE Z IS A SINGLE FIXED DEPTH
+! Note: this demo is graphical but the procedure is valid for analyses, as well
+
+! define flow field on a surface of constant 50 m depth
+let kernel = depth[z=@weq:50] * flow
+let flow_at_50 =  kernel[z=@sum]
+set variable/title="Flow at 50m" flow_at_50
+
+! * * * PLOT: a 2-frame plot comparing flow field in a single layer
+!	with flow at fixed depth
+   set wind/asp=.5 2
+   set wind/clear
+   set view left
+   go magnify 1.2
+
+!  ... flow field within a single layer
+   fill/k=8/l=1/title="Flow in layer 8"/level=(0,320,20) flow
+
+   set view right
+   go magnify 1.2
+
+!  Note: the missing points between the flow and the black mask occur
+!  ... because the deepest layer of flow is considered to be 1/2 grid box above
+!  ... the bottom
+   shade/l=1/level flow_at_50
+   shade/over/nolab/palette=black IF bathymetry GT (-50) then 1
+
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACPlan View
+   message
+
+! Make a time-series plot comparing flow in a layer with flow at a fixed depth
+! (at the top of the rise along the channel mid-line)
+   cancel view
+   set wind/asp=.5
+   plot/x=0/y=0/l=1:20 flow[k=8], flow_at_50
+
+   label/nouser  `($ppl$xlen)/2` `($ppl$ylen)+0.3` 0,0,.25 @ACTime series
+
+   message
+
+! ----------------------
+! GENERAL CASE -- VISUALIZE FLOW WHERE THE "VIEW" OF THE DATA REQUIRES
+! A RANGE OF DEPTHS
+! Note: this demo is graphical but the procedure is valid for analyses, as well
+
+! This procedure (borrowed from depth_to_density_demo.jnl) requires us to
+! "borrow" an axis to serve as the new depth axis. We can only access a
+! single point location along whatever axis we borrow -- though
+! that point can be any point of the axis. In this example we will borrow
+! the TIME axis -- thus we can produce plots only at L=1, L=2, etc..
+! If we desired to produce a time series plot we would have to borrow the X
+! or the Y axis, instead.
+
+! in a new grid replace the (borrowed) time axis with the desired depth axis
+define axis/t=0:180:2/unit=meters tdepth
+define grid/like=gg/t=tdepth ggdepth
+
+! define a new variable, r0, with a value of zero wherever depth equals its
+! coordinate on the tdepth axis  (r0 is a 4-dimensional variable with 
+! depth in the T axis slot)
+! Note that "L=1" here and in the definition of kflow, below, determine
+!      the fixed value on the TIME axis at which this calculation takes place
+let r0 = depth[l=1] - t[g=ggdepth]
+
+! define a new variable, kflow, which, when summed along the Z axis, will give
+! the (single) value of flow at the location where depth equals its own
+! coordinate on the tdepth axis 
+let kflow = r0[z=@weq:0] * flow[l=1]
+
+! sum the variable (integrate) along the Z axis. Since the Z axis reduces
+! to a point in this operation the result is 3D -  X,Y and depth.
+let flow_on_depth =  kflow[z=@sum]
+set variable/title="Flow as a function of depth" flow_on_depth
+
+! * * * PLOT: across-channel flow field at the "rise" along the channel
+! 	Compare flow as a function of layer with flow as a function of depth
+   set wind/clear
+   set wind/asp=.5
+   set view left
+   go magnify 1.2
+
+!  First flow as a function of layer
+   fill/Y=0/l=1/level=(0,320,20)/title="Flow as a function of layer" flow
+
+   set view right
+   go magnify 1.2
+
+!  Now flow as a function of depth
+!  Note: the missing points at the surface occur where the top H layer
+!        is thick enough so that the mid-point of the top layer is deeper
+!        than the first point of the new depth axis, tdepth
+   shade/levels/t=0:180/Y=0/vlimits=0:180:-20 flow_on_depth
+!  ... overlay the bathymetry in black
+   let bathy_field = (-1*bathymetry) - T[gt=tdepth]
+   fill/over/nolab/Y=0/vlimits=0:180:-20/lev=(-1000,0,1000)/palette=black bathy_field
+
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACCross-section: mid-way along channel
+   message
+
+! * * * PLOT: along-channel flow at mid-channel
+! 	Compare flow as a function of layer with flow as a function of depth
+   set wind/clear
+   set view left
+   go magnify 1.2
+
+!  First flow as a function of layer
+fill/x=0/l=1/title="Flow as a function of layer" flow
+
+   set view right
+   go magnify 1.2
+
+!  Now flow as a function of depth
+   shade/levels/t=0:180/X=0/transpose/vlimits=0:180:-20 flow_on_depth
+!  ... overlay the bathymetry in black
+   fill/over/nolab/X=0/trans/vlimits=0:180:-20/lev=(-1000,0,1000)/palette=black bathy_field
+
+   label/nouser  -1 `($ppl$ylen)+0.2` 0,0,.25 @ACSection along channel axis
diff --git a/jnls/examples/single_color_palettes.jnl b/jnls/examples/single_color_palettes.jnl
new file mode 100644
index 0000000..c395523
--- /dev/null
+++ b/jnls/examples/single_color_palettes.jnl
@@ -0,0 +1,120 @@
+! Demonstrate single-color palettes.
+! good for backgrounds, or plotting symbols
+! with the POLYGON command.
+
+set win/asp=0.5
+
+list 1./12
+def view/xlim=0:0.08/ylim=0:0.33/axes v1_1
+def view/xlim=0:0.08/ylim=0.33:0.67/axes v1_2
+def view/xlim=0:0.08/ylim=0.67:1/axes v1_3
+
+def view/xlim=0.08:0.16/ylim=0:0.33/axes v2_1
+def view/xlim=0.08:0.16/ylim=0.33:0.67/axes v2_2
+def view/xlim=0.08:0.16/ylim=0.67:1/axes v2_3
+
+def view/xlim=0.16:0.24/ylim=0:0.33/axes v3_1
+def view/xlim=0.16:0.24/ylim=0.33:0.67/axes v3_2
+def view/xlim=0.16:0.24/ylim=0.67:1/axes v3_3
+
+def view/xlim=0.24:0.32/ylim=0:0.33/axes v4_1
+def view/xlim=0.24:0.32/ylim=0.33:0.67/axes v4_2
+def view/xlim=0.24:0.32/ylim=0.67:1/axes v4_3
+
+def view/xlim=0.32:0.40/ylim=0:0.33/axes v5_1
+def view/xlim=0.32:0.40/ylim=0.33:0.67/axes v5_2
+def view/xlim=0.32:0.40/ylim=0.67:1/axes v5_3
+
+def view/xlim=0.40:0.48/ylim=0:0.33/axes v6_1
+def view/xlim=0.40:0.48/ylim=0.33:0.67/axes v6_2
+def view/xlim=0.40:0.48/ylim=0.67:1/axes v6_3
+
+def view/xlim=0.48:0.56/ylim=0:0.33/axes v7_1
+def view/xlim=0.48:0.56/ylim=0.33:0.67/axes v7_2
+def view/xlim=0.48:0.56/ylim=0.67:1/axes v7_3
+
+def view/xlim=0.56:0.64/ylim=0:0.33/axes v8_1
+def view/xlim=0.56:0.64/ylim=0.33:0.67/axes v8_2
+def view/xlim=0.56:0.64/ylim=0.67:1/axes v8_3
+
+def view/xlim=0.64:0.72/ylim=0:0.33/axes v9_1
+def view/xlim=0.64:0.72/ylim=0.33:0.67/axes v9_2
+def view/xlim=0.64:0.72/ylim=0.67:1/axes v9_3
+
+def view/xlim=0.72:0.80/ylim=0:0.33/axes v10_1
+def view/xlim=0.72:0.80/ylim=0.33:0.67/axes v10_2
+def view/xlim=0.72:0.80/ylim=0.67:1/axes v10_3
+
+def view/xlim=0.80:0.88/ylim=0:0.33/axes v11_1
+def view/xlim=0.80:0.88/ylim=0.33:0.67/axes v11_2
+def view/xlim=0.80:0.88/ylim=0.67:1/axes v11_3
+
+def view/xlim=0.88:0.96/ylim=0:0.33/axes v12_1
+def view/xlim=0.88:0.96/ylim=0.33:0.67/axes v12_2
+def view/xlim=0.88:0.96/ylim=0.67:1/axes v12_3
+
+set view v1_1; shade/noax/nolab/nokey/pal=pink_light/title=pink_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"pink"
+set view v1_2; shade/noax/nolab/nokey/pal=pink/title=pink/i=1:2/j=1:2 i+j
+set view v1_3; shade/noax/nolab/nokey/pal=pink_dark/title=pink_dark/i=1:2/j=1:2 i+j
+
+set view v2_1; shade/noax/nolab/nokey/pal=red_light/title=red_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"red"
+set view v2_2; shade/noax/nolab/nokey/pal=red/title=red/i=1:2/j=1:2 i+j
+set view v2_3; shade/noax/nolab/nokey/pal=red_dark/title=red_dark/i=1:2/j=1:2 i+j
+
+set view v3_1; shade/noax/nolab/nokey/pal=orange_light/title=orange_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"orange"
+set view v3_2; shade/noax/nolab/nokey/pal=orange/title=orange/i=1:2/j=1:2 i+j
+set view v3_3; shade/noax/nolab/nokey/pal=orange_dark/title=orange_dark/i=1:2/j=1:2 i+j
+
+ppl shaset reset
+
+set view v4_1; shade/noax/nolab/nokey/pal=yellow_light/title=yellow_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"yellow"
+set view v4_2; shade/noax/nolab/nokey/pal=yellow/title=yellow/i=1:2/j=1:2 i+j
+set view v4_3; shade/noax/nolab/nokey/pal=yellow_dark/title=yellow_dark/i=1:2/j=1:2 i+j
+
+set view v5_1; shade/noax/nolab/nokey/pal=green_light/title=green_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"green"
+set view v5_2; shade/noax/nolab/nokey/pal=green/title=green/i=1:2/j=1:2 i+j
+set view v5_3; shade/noax/nolab/nokey/pal=green_dark/title=green_dark/i=1:2/j=1:2 i+j
+
+set view v6_1; shade/noax/nolab/nokey/pal=cyan_light/title=cyan_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"cyan"
+set view v6_2; shade/noax/nolab/nokey/pal=cyan/title=cyan/i=1:2/j=1:2 i+j
+set view v6_3; shade/noax/nolab/nokey/pal=cyan_dark/title=cyan_dark/i=1:2/j=1:2 i+j
+
+ppl shaset reset
+
+set view v7_1; shade/noax/nolab/nokey/pal=blue_light/title=blue_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"blue"
+set view v7_2; shade/noax/nolab/nokey/pal=blue/title=blue/i=1:2/j=1:2 i+j
+set view v7_3; shade/noax/nolab/nokey/pal=blue_dark/title=blue_dark/i=1:2/j=1:2 i+j
+
+set view v8_1; shade/noax/nolab/nokey/pal=purple_light/title=purple_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"purple"
+set view v8_2; shade/noax/nolab/nokey/pal=purple/title=purple/i=1:2/j=1:2 i+j
+set view v8_3; shade/noax/nolab/nokey/pal=purple_dark/title=purple_dark/i=1:2/j=1:2 i+j
+
+set view v9_1; shade/noax/nolab/nokey/pal=magenta_light/title=magenta_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"magenta"
+set view v9_2; shade/noax/nolab/nokey/pal=magenta/title=magenta/i=1:2/j=1:2 i+j
+set view v9_3; shade/noax/nolab/nokey/pal=magenta_dark/title=magenta_dark/i=1:2/j=1:2 i+j
+
+ppl shaset reset
+
+set view v10_1; shade/noax/nolab/nokey/pal=brown_light/title=brown_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"brown"
+set view v10_2; shade/noax/nolab/nokey/pal=brown/title=brown/i=1:2/j=1:2 i+j
+set view v10_3; shade/noax/nolab/nokey/pal=brown_dark/title=brown_dark/i=1:2/j=1:2 i+j
+
+set view v11_1; shade/noax/nolab/nokey/pal=tan_light/title=tan_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"tan"
+set view v11_2; shade/noax/nolab/nokey/pal=tan/title=tan/i=1:2/j=1:2 i+j
+set view v11_3; shade/noax/nolab/nokey/pal=tan_dark/title=tan_dark/i=1:2/j=1:2 i+j
+
+set view v12_1; shade/noax/nolab/nokey/pal=grey_light/title=grey_light/i=1:2/j=1:2 i+j
+label/user 1,1.5,-1,0,0.24,"grey"
+set view v12_2; shade/noax/nolab/nokey/pal=grey/title=grey/i=1:2/j=1:2 i+j
+set view v12_3; shade/noax/nolab/nokey/pal=grey_dark/title=grey_dark/i=1:2/j=1:2 i+j
diff --git a/jnls/examples/snoopy.dat b/jnls/examples/snoopy.dat
new file mode 100644
index 0000000..baab6b5
--- /dev/null
+++ b/jnls/examples/snoopy.dat
@@ -0,0 +1,50 @@
+        0.006 0.8865         0.176 0.7597         0.282 0.7151
+        0.355 0.6643         0.379 0.6455         0.393 0.6246
+        0.410 0.6071         0.417 0.5935         0.467 0.5648
+        0.435 0.5535         0.444 0.5458         0.470 0.5326
+        0.478 0.5337         0.515 0.5147         0.469 0.5250
+        0.541 0.5064         0.457 0.5060         0.498 0.5023
+        0.502 0.4877         0.532 0.4853         0.500 0.4761
+        0.510 0.4821         0.532 0.4691         0.483 0.4778
+        0.521 0.4613         0.515 0.4631         0.570 0.4546
+        0.575 0.4540         0.568 0.4558         0.567 0.4482
+        0.621 0.4544         0.558 0.4529         0.545 0.4401
+        0.561 0.4457         0.552 0.4352         0.585 0.4382
+        0.598 0.4288         0.572 0.4221         0.591 0.4332
+        0.571 0.4243         0.595 0.4294         0.577 0.4295
+        0.543 0.4260         0.600 0.4124         0.586 0.4102
+        0.600 0.4165         0.565 0.4216         0.604 0.4015
+        0.600 0.4182         0.612 0.3997         0.580 0.4077
+        0.603 0.4108         0.638 0.4120         0.615 0.4050
+        0.630 0.4058         0.625 0.4079         0.594 0.3883
+        0.661 0.4031         0.608 0.3953         0.617 0.3978
+        0.599 0.4021         0.649 0.3831         0.620 0.3969
+        0.620 0.3906         0.641 0.3857         0.643 0.3842
+        0.628 0.3814         0.601 0.3813         0.679 0.3874
+        0.612 0.3784         0.642 0.3839         0.606 0.3722
+        0.651 0.3713         0.668 0.3692         0.655 0.3867
+        0.640 0.3731         0.647 0.3660         0.639 0.3741
+        0.623 0.3722         0.647 0.3705         0.668 0.3676
+        0.631 0.3639         0.633 0.3730         0.627 0.3693
+        0.623 0.3709         0.598 0.3582         0.641 0.3720
+        0.633 0.3599         0.606 0.3675         0.655 0.3712
+        0.652 0.3590         0.644 0.3554         0.631 0.3564
+        0.654 0.3580         0.641 0.3565         0.672 0.3583
+        0.667 0.3579         0.661 0.3675         0.668 0.3490
+        0.661 0.3606         0.609 0.3506         0.635 0.3557
+        0.680 0.3590         0.675 0.3517         0.638 0.3474
+        0.677 0.3473         0.670 0.3519         0.676 0.3430
+        0.647 0.3525         0.671 0.3456         0.661 0.3431
+        0.641 0.3458         0.672 0.3478         0.692 0.3498
+        0.658 0.3463         0.671 0.3535         0.685 0.3474
+        0.668 0.3496         0.646 0.3540         0.635 0.3342
+        0.659 0.3475         0.667 0.3413         0.688 0.3377
+        0.728 0.3420         0.713 0.3488         0.662 0.3380
+        0.627 0.3501         0.634 0.3356         0.683 0.3377
+        0.666 0.3374         0.686 0.3475         0.689 0.3291
+        0.672 0.3336         0.658 0.3365         0.709 0.3292
+        0.700 0.3295         0.687 0.3327         0.663 0.3257
+        0.643 0.3309         0.698 0.3353         0.679 0.3402
+        0.676 0.3295         0.656 0.3279         0.671 0.3359
+        0.656 0.3395         0.665 0.3407         0.692 0.3285
+        0.694 0.3303         0.676 0.3335         0.698 0.3306
diff --git a/jnls/examples/spirograph_demo.jnl b/jnls/examples/spirograph_demo.jnl
new file mode 100644
index 0000000..f68cafa
--- /dev/null
+++ b/jnls/examples/spirograph_demo.jnl
@@ -0,0 +1,43 @@
+! spirograph.jnl - cute pictures - *sh* 11/91
+! Description: demo of fun line plots
+
+! Clean up from whatever the user has been doing ...
+SET GRID abstract
+CANCEL VARIABLES/ALL
+
+
+! Use the straightening of 2D arrays into 1D to quickly create a cute picture.
+PLOT/VS/LINE/I=1:50/J=1:50 6*I/J,5*J/I
+MESSAGE
+
+! Now define the variable, ODD, to separate odd and even points.
+! Then plot alternatine points on the circumference of a circle.
+LET ODD = MOD(I,2) EQ 0
+LET XPT = IF ODD THEN (-1*SIN(I/100)) ELSE SIN(I/100)
+LET YPT = IF ODD THEN COS(I/100) ELSE (-1*COS(I/100))
+PLOT/VS/LINE/I=1:314 XPT,YPT
+MESSAGE
+
+! Variation on a theme: place the circumference points 10 times
+! further apart but go around the circle 10 times.
+LET XPT2 = IF ODD THEN (-1*SIN(I/10)) ELSE SIN(I/10)
+LET YPT2 = IF ODD THEN COS(I/10) ELSE (-1*COS(I/10))
+PLOT/VS/LINE/I=1:314 XPT2,YPT2
+MESSAGE
+
+! A bit wilder, still ...
+LET XPT3 = IF ODD THEN (-1*SIN(I/10)) ELSE 1/(2+SIN(I/10))
+LET YPT3 = IF ODD THEN COS(I/10) ELSE (1/(2+COS(I/10)))
+PLOT/VS/LINE/I=1:314 XPT3,YPT3
+MESSAGE
+
+! Now for some true art ...
+! Move the circle center while drawing circumference points.
+LET XCNTR = COS(I/30)
+LET YCNTR = SIN(I/30)
+LET XPT4 = IF ODD THEN (-1*SIN(I/10)) ELSE SIN(I/10)
+LET YPT4 = IF ODD THEN COS(I/10) ELSE (-1*COS(I/10))
+LET XPT5 = XPT4 + XCNTR
+LET YPT5 = YPT4 + YCNTR
+PLOT/VS/LINE/I=1:380 XPT5,YPT5
+
diff --git a/jnls/examples/splash_demo.jnl b/jnls/examples/splash_demo.jnl
new file mode 100644
index 0000000..9df21b7
--- /dev/null
+++ b/jnls/examples/splash_demo.jnl
@@ -0,0 +1,50 @@
+! splash.jnl *sh* 11/91
+! Description: some pretty color pictures
+
+! initialize
+CANCEL VIEWPORTS
+SET WINDOW/ASPECT=1:AXIS
+GO rgb_rainbow
+
+! Navahoe blanket
+SET GRID ABSTRACT
+SHADE/I=1:188/J=1:188/NOKEY sin(i/20)*sin(j/20)
+GO rgb_try_em
+
+! set up for shading in the [-1,1],[-1,1] square
+DEFINE AXIS/X=-1:1:.025 x80
+DEFINE AXIS/Y=-1:1:.025 y80
+DEFINE GRID/X=x80/Y=y80 g8080
+SET GRID g8080
+SET REGION/X=-1:1/Y=-1:1
+
+! color shade some hyperbolas
+LET zmod = x^2 - y^2 
+LET hi_lo4 = mod(i+j,4)
+PPL axset 0,0,0,0
+SHADE/NOKEY/NOLAB/LEVELS=(-3,3.5,.3) zmod * hi_lo4
+REPEAT/l=1:2 GO rgb_try_em
+
+! color shade the upper half of a sphere
+LET hi_lo = if mod(i+j,2) eq 0 then 0 else 1
+LET rsq = x^2 + y^2
+LET sphere = (1-rsq)^0.5
+LET wild = hi_lo * sphere
+PPL axset 0,0,0,0
+SHADE/NOKEY/NOLAB wild
+
+! overlay bands of color
+CONTOUR/OVERLAY/LEVELS=(0.99,1.01,.01,-3)/NOLAB    rsq
+CONTOUR/OVERLAY/LEVELS=(.4,.415,.005,-3)/NOLAB sphere
+CONTOUR/OVERLAY/LEVELS=(.6,.615,.004,-3)/NOLAB sphere
+CONTOUR/OVERLAY/LEVELS=(.7,.71,.003,-3)/NOLAB  sphere
+CONTOUR/OVERLAY/LEVELS=(.8,.808,.002,-3)/NOLAB sphere
+CONTOUR/OVERLAY/LEVELS=(.9,.905,.001,-3)/NOLAB sphere
+REPEAT/l=1:3 GO rgb_try_em
+GO rgb_fireworks
+
+! We will now clean up FERRET for whatever you, the user, will be doing next.
+GO rgb_rainbow
+PPL/RESET
+PPL axset 1,1,1,1
+SET GRID abstract
diff --git a/jnls/examples/statistics_demo.jnl b/jnls/examples/statistics_demo.jnl
new file mode 100644
index 0000000..24688b8
--- /dev/null
+++ b/jnls/examples/statistics_demo.jnl
@@ -0,0 +1,77 @@
+! statistics.jnl - example statistical calculations from FERRET *sh* 11/91
+! Description: demo of some sample distribution functions and plots
+
+! minor changes 11/93 for FERRET V3.01
+
+! some simple manipulations of distribution functions ...
+
+! * * * define and plot a gaussian probability density function * * *
+! "pdf" == "probability density function"
+! "cdf" == "cumulative  density function"
+!     ( the random variable X, normally distributed )
+
+CANCEL REGION   ! in case there's region info left over from previous commands
+
+! define the mathematical variables
+LET PI = 3.14159
+LET XBAR = 2
+LET SIGMA = 1
+LET ARG = (X-XBAR)/SIGMA
+LET/TITLE="gaussian pdf" NORM_PDF = (1./(2*PI)^.5)/SIGMA * EXP(-.5*ARG*ARG)
+LET/TITLE="gaussian cdf" NORM_CDF = NORM_PDF[X=@IIN]
+
+! define the region for plotting and the resolution of calculations
+DEFINE AXIS/X=-10:50:.01 XAXIS
+DEFINE GRID/X=XAXIS G_GAUSS
+SET GRID G_GAUSS	! abstract variables will use g_gauss by default
+SET REGION/x=-2:6
+
+! make a few demo plots:
+! plot the bell curve of the Normal pdf
+MESSAGE
+PLOT NORM_PDF
+! plot the integrated bell curve
+MESSAGE
+PLOT NORM_CDF
+! plot both together scaling the PDF so its max is 1
+MESSAGE
+PLOT NORM_CDF,NORM_PDF/NORM_PDF[X=@MAX]
+
+! define and compute some simple statistics
+LET MEDIAN = NORM_CDF[X=@LOC:.5]	! where is cdf equal to 0.5 ?
+LET WT_PDF = X*NORM_PDF
+LET MEAN = WT_PDF[X=@DIN]		! integrate X*pdf
+LIST MEAN,MEDIAN
+MESSAGE
+
+! * * * define and plot a LOG-NORMAL probability density function * * *
+!    this is done by associating the values from the normal cdf with a
+!    transformed axis - using the fact that exp(x) is monotonic
+
+! write the normal cdf values to a file
+SPAWN rm normal_cdf.dat
+LIST/FILE=normal_cdf.dat/FORMAT=UNFORMATTED/NOHEAD NORM_CDF
+
+! create an exponentially transformed axis
+LET BETA = 5	! 0 maps into beta
+LET LAMDA = .5	
+LET EXP_TRNS = BETA*EXP(LAMDA*X)	! exponentially transformed axis
+DEFINE AXIS/FROM/NAME=AX_EXP/X EXP_TRNS
+DEFINE GRID/X=AX_EXP G_EXP
+
+! associate the exponentail axis with the normal cdf - call the variable lnorm
+! then normalize it and define the pdf as its derivative
+FILE/GRID=G_EXP/FORMAT=UNFORMATTED/VAR=LNORM normal_cdf.dat
+LET LNRM_CDF = LNORM/LNORM[X=@MAX]	! normalize the cdf
+LET LNRM_PDF = LNRM_CDF[X=@DDB]
+
+! plot the log-normal cdf and the scaled pdf
+SET REGION/X=0:50
+MESSAGE
+PLOT LNRM_CDF,LNRM_PDF/LNRM_PDF[X=@MAX]
+
+! define and compute some simple statistics
+LET MEDIAN = LNRM_CDF[X=@LOC:.5]
+LET WT_PDF = X*LNRM_PDF
+LET MEAN = WT_PDF[X=@DIN]	
+LIST MEAN,MEDIAN
diff --git a/jnls/examples/symbol_demo.jnl b/jnls/examples/symbol_demo.jnl
new file mode 100644
index 0000000..8146eef
--- /dev/null
+++ b/jnls/examples/symbol_demo.jnl
@@ -0,0 +1,57 @@
+! symbol_demo.jnl  6/95 *sh*
+
+!Description: Demonstration of symbols to customize plot layout
+
+! usage:
+!	yes? GO symbol_demo  variable time
+
+! e.g.	yes? GO symbol_demo SLP L=6
+
+
+set data coads_climatology
+
+ppl/reset
+set wind/asp=1.5
+set mode calendar:days
+set region /$2"l=1"
+
+! ==========================
+! +++++ upper panel ++++++++
+! ==========================
+set view upper
+shade $1"sst"
+
+! diagonal remark about the plot
+label/nouser `($ppl$xlen)/2` `($ppl$ylen)/2` 0,45,.28 @TRNORMAL LAYOUT
+
+! ==========================
+! +++++ lower panel ++++++++
+! ==========================
+set view lower
+ppl origin ,2	! shift plot rectangle upwards
+
+! remove Ferret logo
+GO unlabel 1
+GO unlabel 2
+GO unlabel 3
+
+! move the time label to the bottom left
+ppl labs/nouser ($labnum_t) 0,-0.6,-1 @P2 at AC($lab4)
+
+! move the data set label to the bottom right and
+! remove "DATA SET:" from the string "DATA SET: coads_climatology"
+PPL SET dset_len $LENGTH( lab($labnum_datitl) )   ! "$LENGTH(lab5)"
+PPL SET new_dset $EXTRACT(11,($dset_len),lab($labnum_dset))
+ppl labs/nouser ($labnum_dset) ($ppl$xlen),-0.6,+1 @P2 at AC($new_dset)
+
+! use data set title as a second plot title at the bottom
+ppl labs/nouser ($labnum_datitl) `($ppl$xlen)/2`,-1.3,0 @P4 at AC<<($lab($labnum_datitl))>>
+ppl hlabs ($labnum_datitl), .18
+
+! actually draw it
+ppl shade
+! diagonal remark about the plot
+label/nouser `($ppl$xlen)/2` `($ppl$ylen)/2` 0,45,.28 @TRSPECIAL LAYOUT
+
+! clean up
+ppl origin 1.2,1.4
diff --git a/jnls/examples/topo_palette_demo.jnl b/jnls/examples/topo_palette_demo.jnl
new file mode 100644
index 0000000..2a10db4
--- /dev/null
+++ b/jnls/examples/topo_palette_demo.jnl
@@ -0,0 +1,19 @@
+! topo_palette_demo.jnl
+! This is a palette defined by_value.  That is, the same
+! colors will correspond to the same value of elevation
+! regardless of the range of elevation on the plot.
+
+! Good levels for US elevation (in meters):
+! (-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,6000,1000)
+
+use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/smith_sandwell_topo_v8_2.nc"
+SET VAR/TITLE="Topography and Bathymetry" rose
+SET REGION/X=130E:160E/y=30S:0S
+shade/pal=topo/lev=(-9000,-1000,1000)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,4000,1000) rose
+
+! A smaller region, choosing different levels, the colors
+! used for each elevation are the same.
+SET REGION/X=134:144/Y=-18:-8
+SHADE/PAL=topo/LEV=(-2600,-100,50)(-100,100,5)(100,500,50) rose
+
+
diff --git a/jnls/examples/topographic_relief_demo.jnl b/jnls/examples/topographic_relief_demo.jnl
new file mode 100644
index 0000000..40fade3
--- /dev/null
+++ b/jnls/examples/topographic_relief_demo.jnl
@@ -0,0 +1,91 @@
+! relief_demo.jnl *jd* 11/91
+
+! *acm* 7/01 change uppercase GO LAND to GO land
+
+! Description: reviews coarse subsets of the ETOPO (Equator to Poles) data set
+
+! This demonstration reviews coarse subsets of the ETOPO (Equator to Poles)
+! data set available from NOAA's National Geophysical Data Center in Boulder.  
+
+! Advanced use of FERRET commands in the demo will give you helpful examples
+! of their use.  See the User's Guide for more on individual commands.
+
+CANCEL REGION
+SET DATA etopo120
+SET WIND/SIZE=.6/ASPECT=.86
+PPL CROSS 1  ! Delineates the equator when plots are made
+SHOW DATA etopo120
+
+MESSAGE
+
+! Let's first look at the relief of the earth's surface at 2 degree resolution
+
+LET/TITLE="Surface relief x1000 (meters)" R1000 ROSE/1000
+CONTOUR/LEV=(-8,8,2,-1) R1000
+
+MESSAGE
+
+! Visualizing that in another way...
+
+GO rgb_centered		! Changing the color palette
+SHADE/LEV/OVER R1000
+GO land
+
+MESSAGE
+
+! There is another data set at 1 degree resolution
+
+SET DATA etopo60
+SHADE/X=50E:180/Y=-40:40/LEV=(-8,8,1) R1000
+GO land
+
+MESSAGE
+
+! Sharpening this up with outines --
+
+CONTOUR/X=50E:180/Y=-40:40/SET/NOLAB/OVER R1000
+PPL LEV ()(1,8,1,-3)
+PPL CONTOUR/OVER
+PPL LEV ()(-8,-1,1,-3) LINE (-8,-1,1,-3)
+PPL PEN 1 4
+PPL CONTOUR/OVER
+
+MESSAGE
+
+! Different PALETTES can be used to change color and emphasis in a shade plot. 
+! For example: 
+
+SET VIEW UPPER
+SHADE/X=110W:100E/Y=-20:20/LEV=(-8,8,1) R1000
+
+SET VIEW LOWER
+SHADE/X=110W:100E/Y=-20:20/PALETTE=greyscale/LEV=(-8,0,1) R1000
+
+! Here the /PALETTE qualifier is used to temporarily change the palette to
+! greyscale.
+
+MESSAGE
+
+! The current palette remains in effect if the option is not specified
+
+CAN VIEW
+SHADE/X=110W:50E/Y=-50:30/LEV=(-8,8,1) R1000
+
+MESSAGE
+
+! And the CONTOUR/FILL command (with an alias of FILL) can be used to generate
+! smooth color filled contours -- but it is generally slower to execute than 
+! shade.
+
+FILL/X=110W:50E/Y=-50:30/LEV=(-8,8,1) R1000
+CONTOUR/OVER/X=110W:50E/Y=-50:30/LEV=(0) R1000
+
+MESSAGE
+
+CAN VIEW
+GO rgb_rainbow
+PPL PEN 1 1
+PPL CROSS 0
+
+
+
diff --git a/jnls/examples/trackplot_demo.jnl b/jnls/examples/trackplot_demo.jnl
new file mode 100644
index 0000000..d06e7d0
--- /dev/null
+++ b/jnls/examples/trackplot_demo.jnl
@@ -0,0 +1,62 @@
+! trackplot_demo.jnl
+! *jd* 5.99
+! *acm* 7/01 update /line=  to /color=/thickness=
+
+! Description: demonstrate usage of trackplot jnl file
+
+set mode verify
+
+! Define a 3-leg plot track with discontinuities
+LET/QUIET     X0 = 240
+LET/QUIET     Y0 = 10
+LET/QUIET     X1 = 180
+LET/QUIET     Y1 = 60
+LET/QUIET     X2 = 150
+LET/QUIET     Y2 = 10
+LET/QUIET     XLEG1 = X0 + (L-1)*(X1-X0)/50
+LET/QUIET     YLEG1 = Y0 + (L-1)*(Y1-Y0)/50
+LET/QUIET     XLEG2 = X1 + (L-51)*(X2-X1)/20
+LET/QUIET     YLEG2 = Y1 + (L-51)*(Y2-Y1)/20
+LET/QUIET     LCURVE = L-71
+LET/QUIET     R0 = 35
+LET/QUIET     RADIUS = R0 - LCURVE/3
+LET/QUIET     XLEG3 = X2+R0 - RADIUS * COS(LCURVE/12)
+LET/QUIET     YLEG3 = Y2 - RADIUS * SIN(LCURVE/12)
+LET/QUIET     XSTRAIGHT = IF L LE 50 THEN XLEG1 ELSE XLEG2
+LET/QUIET     YSTRAIGHT = IF L LE 50 THEN YLEG1 ELSE YLEG2
+LET/QUIET     XTRACK = IF L LE 70 THEN XSTRAIGHT ELSE XLEG3
+LET/QUIET     YTRACK = IF L LE 70 THEN YSTRAIGHT ELSE YLEG3
+
+LET/QUIET     MY_VAR = SIN(L/2)
+LET/QUIET     OTHER_VAR = RANDN(L) + 1 
+SET REGION/L=1:120
+ 
+! Plot variable "my_var" as a red line, "other_var" in blue
+! over the ship track in black
+! Use automatic scaling and baseline of plot
+go basemap x=120:260 Y=25s:65n 20
+plot/vs/line/over/title="Ship track" xtrack, ytrack
+go trackplot plot/vs/over/line/color=red/title="Variable MY_VAR" xtrack ytrack my_var
+go trackplot plot/vs/over/line/color=blue/title="Variable OTHER_VAR" xtrack ytrack other_var
+label/nouser `($ppl$xlen)/2` -1 0 0 .18 "@CRSynthetic track and 2 variables"
+\PAUSE
+
+! Try again, but scale the data smaller and shift baseline of other_var 
+SAY ($TRACKPLOTscale)			! notice default scaling = 5.5983 units/inch
+go basemap x=120:260 Y=25s:65n 20 
+plot/vs/line/over/title="Ship track" xtrack, ytrack
+go trackplot plot/vs/over/line/color=red/title="Variable MY_VAR" xtrack ytrack my_var 12
+go trackplot plot/vs/over/line/color=blue/title="Variable OTHER_VAR" xtrack ytrack other_var 12 1
+\PAUSE
+
+! In this demo we will mark every 10th point on the ship track
+! and put scale markers onto the plot
+go basemap x=120:260 Y=25s:65n 20
+plot/vs/line/over/title="Ship track" xtrack, ytrack
+plot/vs/over/NOLABEL/SYMBOL=88 xtrack[L=1:120:10], ytrack[L=1:120:10]
+label 220,-10,-1,0,.1 "@PM88 at CR - every 10^t^h point"
+go trackplot plot/vs/over/line/color=red/title="Variable MY_VAR" xtrack ytrack my_var 4
+go scalemark 1 -1 2    ! position outside of plot rectangle using inches
+go trackplot plot/vs/over/line/color=blue/title="Variable OTHER_VAR" xtrack ytrack other_var " " 1
+go scalemark 180 0 2 user "2 units"
+label/user 180 -3 0 0 .08 "random values plus 1"
diff --git a/jnls/examples/tutorial.jnl b/jnls/examples/tutorial.jnl
new file mode 100644
index 0000000..484716c
--- /dev/null
+++ b/jnls/examples/tutorial.jnl
@@ -0,0 +1,412 @@
+\CANCEL MODE VERIFY
+! Description: A brief tutorial introduction to FERRET
+
+SAY   ... setting up demo environment ...
+! tutorial.jnl - *sh* 11/91
+! updated with V3.01 features 11/93 *sh*
+! don't shrink the 4-panel anomaly window - too slow under XGKS 5/94 *sh*
+! *acm* 7/01 update /xlimits and /ylimits to /hlimits and /vlimits
+
+! eliminate the program state left by previous activities
+CANCEL REGION
+CANCEL VARIABLES/ALL
+CANCEL DATA/ALL
+CANCEL VIEWPORTS
+SET WINDOW/SIZE=0.7/ASPECT=.75:axis   ! default
+SET GRID ABSTRACT
+SET MODE CALENDAR:DAYS
+GO black
+SET MODE VERIFY      ! show command file lines at the screen
+
+!
+! *************** Mini-tutorial on program FERRET  ******************
+
+! This demonstration/tutorial will introduce the basic capabilities
+! of the FERRET program through examples.
+
+! As the demonstration runs please continue to read the text on the screen.
+! You will see exactly the commands that are controlling the FERRET program.
+! Lines that begin with "!" are comment lines - for your information only.
+
+! ******************************************************************** 
+MESSAGE
+
+! Suppose we want to plot values of 1/i for the first 10 integers
+! i = 1, 2, 3, ..., 10
+! We can do that with the following command:
+
+PLOT/i=1:10  1/i
+
+! ******************************************************************** 
+MESSAGE 
+
+! We can change the aspect ratio of the plot to a more pleasing size and
+! shape and re-draw the plot
+
+SET WINDOW/SIZE=0.5/ASPECT=0.5
+PLOT/i=1:10  1/i
+
+! ******************************************************************** 
+MESSAGE
+
+! We can do the plot with marker symbols instead of a smooth curve:
+! and request a white background
+
+GO white
+PLOT/i=1:10/SYMBOLS  1/i
+
+! ******************************************************************** 
+MESSAGE
+
+! We can define a new variable, "inverse", and give it a title of our
+! choosing.  In this plot we use both custom plot marks and a line and
+! we specify the vertical plotting axis range.
+
+GO black
+LET/TITLE="My inverse of I" iinverse = 1/i
+PLOT/i=1:10/SYMBOLS=2/LINE/VLIMITS=-1:2:0.25  iinverse
+
+! ******************************************************************** 
+MESSAGE
+
+! We can combine several functions on the same plot
+
+PLOT/i=1:10   1/i, 1/(i+3), 1/i + 1/(10-i)
+
+! ******************************************************************** 
+MESSAGE
+
+! Now in a single window we will plot all of the preceding graphs again.
+! The parts of the window are called "viewports".
+! They are named UL, for "upper left", LL, LR, and UR, similarly.
+
+SET WINDOW/SIZE=.9    ! (bigger 'cause there will be 4 plots)
+SET VIEWPORT UL
+PLOT/i=1:10  1/i
+SET VIEWPORT LL
+PLOT/i=1:10/SYMBOLS  1/i
+SET VIEWPORT LR
+PLOT/i=1:10/SYMBOLS=2/LINE/VLIMITS=-1:2:0.25  iinverse
+SET VIEWPORT UR
+PLOT/i=1:10   1/i, 1/(i+3), 1/i + 1/(10-i)
+
+! ******************************************************************** 
+MESSAGE
+
+! Other forms of graphics are also available.
+! Here we are just playing with simple 2-dimensional mathematical functions
+
+! Contouring ...
+CANCEL VIEWPORT
+SET WINDOW/ASPECT=0.8
+LET circle = ((i-20)^2 + (j-20)^2) ^ 0.5
+CONTOUR/i=1:40/j=1:40 circle * exp((10-(i+j))/50)
+
+! ******************************************************************** 
+MESSAGE
+
+! Vector arrows ... (later you will see how to overlay vector arrows)
+VECTOR/i=1:20/j=1:20 i+cos(j/5)+5,i-j
+
+! ******************************************************************** 
+MESSAGE
+
+! A "raster" of color-shaded grid rectangles and a color key ...
+
+SHADE/i=1:40/j=1:40 cos(i/5)*sin(j/10)
+
+! ******************************************************************** 
+MESSAGE
+
+! The same figure drawn as a color-filled contour plot ...
+
+FILL/i=1:40/j=1:40 cos(i/5)*sin(j/10)
+
+! ******************************************************************** 
+MESSAGE
+
+! And a wire frame drawing (using more advanced grid definition commands)
+
+DEFINE AXIS/X=-4:4:.2 xax40
+DEFINE AXIS/Y=-4:4:.2 yax40
+DEFINE GRID/X=xax40/Y=yax40 g_gauss
+SET GRID g_gauss
+LET GAUSS = 2*EXP(-1*((x/2)^2 + y^2))
+WIRE/VIEWPOINT=-4,-10,4 gauss
+SET GRID ABSTRACT		! restore default grid for demos that follow
+
+! ******************************************************************** 
+MESSAGE
+
+! Now we will look at some actual data.
+
+! To begin we inform FERRET of the "data set" of interest using the
+! SET DATA command.  The ETOPO60 data set contains the relief of the
+! surface of the earth at 120 minute resolution
+
+SET DATA etopo120
+
+! ******************************************************************** 
+MESSAGE 
+
+! We can query FERRET for the contents of the data set with the SHOW DATA
+! command.  The output of SHOW DATA immediately follows the command, below.
+
+SHOW DATA
+
+! ******************************************************************** 
+MESSAGE
+
+! What we see is a single variable, "ROSE", and its 4-dimensional limits.
+! The letters I,J,K and L refer to its limits along the X,Y,Z, and T axes,
+! respectively.  ROSE is a 2-dimensional variable;  it exists in the XY
+! (latitude-longitude) plane.
+
+! Lets look at a shaded plot of the earth's relief.
+! Since we don't specify any limits the full extent of the data
+! will be used.
+
+SHADE  ROSE
+
+! ******************************************************************** 
+MESSAGE
+
+! Or we can zoom in on North America (long. 160W:40W, lat. 20N:70N)
+! using a 500 meter vertical resolution and a filled-contour plot.
+
+FILL/X=160W:40W/Y=20N:70N/level=(-7000,4000,500) ROSE
+
+! ... and overlay the continental boundaries  
+
+GO land 0  
+
+! The "0" above specifies pen color zero (black) for the continents.
+! The GO command, as you have been seeing, can run "scripts" to perform a
+! wide variety of tasks.  Go scripts are files of ordinary FERRET commands.
+
+! ******************************************************************** 
+MESSAGE
+
+! Now lets turn our attention to another data set: 
+! the Comprehensive Ocean-Atmosphere Data SET ("COADS")
+
+SET  DATA coads_climatology
+SHOW DATA coads_climatology
+
+! As you can see there are a number of variables and there are 12 points
+! on the time (L) axis.
+
+! ******************************************************************** 
+MESSAGE
+
+! Within FERRET "variables" are always defined on "grids";  "grids" are always
+! composed of 1 to 4 "axes"; and "axes" are composed of numerous points.
+ 
+! We can query FERRET to learn more about the grid and axes upon which
+! the variable SST is defined using the SHOW GRID command.
+! (The output of "SHOW GRID SST" follows the command.)
+
+SHOW GRID SST
+
+! ******************************************************************** 
+MESSAGE
+
+! We can further enquire about the coordinates of axis points by specifying
+! which axis and what range of values we are interested in.
+! For example,  (the output of "SHOW GRID/L=1:4 SST" follows the command)
+
+SHOW GRID/L=1:4 SST
+
+! ******************************************************************** 
+MESSAGE
+
+! OK.  Now lets use the SHADE command to make a color shaded plot of the
+! sea surface temperature at the first time step.
+
+SHADE/L=1 SST
+
+! And overlay "filled" continents instead of an outline
+GO fland
+
+! Notice the black regions where there are gaps in the COADS data set
+
+! ******************************************************************** 
+MESSAGE
+
+! Just as simply we can look at the air-sea temperature difference.
+
+SHADE/L=1 AIRT-SST
+GO fland        ! overlay "filled" continents
+
+! ******************************************************************** 
+MESSAGE
+
+! And we can overlay a vector arrow plot of the surface winds, too.
+
+VECTOR/OVERLAY/L=1 UWND, VWND
+
+! The combination of high wind speeds and large air-sea temperature
+! difference suggests some regions of the worlds oceans where the 
+! sensible heat exchange is very large - for example off the Atlantic
+! coast of North America.
+
+! ******************************************************************** 
+MESSAGE
+
+! A thought exercise to the viewer:
+
+! If sensible heat exchange can be computed by the equation
+!      QSENS = COEF * WSPD * (AIRT-SST)
+! where WSPD is the COADS wind speed and COEF is an arbitrary coefficient
+
+! 1> How would you produce a shaded plot of QSENS at L=1 ?
+
+! 2> How would you produce a time series plot for all 12 months at a point
+!    of your choosing in the North Atlantic ?
+ 
+! ******************************************************************** 
+MESSAGE
+
+! OK. Lets look at the annual variation of the sea surface temperature
+! by displaying the four seasons on a single plot.
+
+SET VIEW Ul
+SHADE/L=3 sst
+SET VIEW UR
+SHADE/L=6 sst
+SET VIEW LL
+SHADE/L=9 sst
+SET VIEW LR
+SHADE/L=12 sst
+
+! It is difficult to pick out the differences in the fields, isn't it ?
+
+! ******************************************************************** 
+MESSAGE
+
+! FERRET has many ways to help you explore this kind of problem.
+! Lets begin by looking at the average over all 12 time steps.
+! We do this with the "AVE" transformation applied to the time axis.
+
+! "SHADE/LINE" tells FERRET to overlay contour lines instead of
+! putting a color key on the plot.
+
+CANCEL VIEWPORTS
+SHADE/LINE SST[L=1:12 at AVE]
+
+! ******************************************************************** 
+MESSAGE
+
+! Now lets look at how the first time step differs from this average.
+! We will use a color palette that emphasizes which regions are
+! positive and which are negative.
+
+! Notice that the plot is for January.  The northern hemisphere is in
+! winter - hence colder than the annual average.  The opposite is true
+! in the southern hemisphere.
+
+SHADE/PALETTE=saz2 SST[L=1] - SST[L=1:12 at AVE]
+GO fland
+
+! ******************************************************************** 
+MESSAGE
+
+! Now lets look at the four seasons ae we did before - but this
+! time plotting the anomaly from the annual average field.
+
+LET SST_AVE  = SST[L=1:12 at AVE]
+LET/TITLE="SST Anomaly"    SST_ANOM = SST - SST_AVE
+
+SET VIEW Ul
+SHADE/L=3/LEVELS=(-14)(-5,5,1)(14) sst_anom
+SET VIEW UR
+SHADE/L=6/LEVELS=(-14)(-5,5,1)(14) sst_anom
+SET VIEW LL
+SHADE/L=9/LEVELS=(-14)(-5,5,1)(14) sst_anom
+SET VIEW LR
+SHADE/L=12/LEVELS=(-14)(-5,5,1)(14) sst_anom
+
+! The contour levels were chosen to emphasize the variations.
+
+
+! ******************************************************************** 
+MESSAGE
+
+! Digression:
+! An effective way to visualize the annual variations of SST would be as
+! an animation.  It is a simple matter for FERRET to create an animation.
+! After this tutorial try these commands to make a movie of 12 sst months.
+
+! 	yes? SET DATA coads_climatology
+! 	yes? SET MOVIE/FILE=my_animation.mgm
+!	yes? REPEAT/l=1:12 SHADE/FRAME sst_anom    ! save frames in your file
+!	yes? ANIMATE
+
+! ******************************************************************** 
+MESSAGE
+
+! Lets focus our attention at a particular longitude, say, X=180, the
+! International Dateline.  We can get an accurate picture of the SST
+! changes there by producing a 2-dimensional view along the Y and T axes.
+! We will use the SET REGION command to confine ourselves to X=180.
+
+! We leave the existing window on the screen as a reference and send the
+! new output to a separate window.
+! (If the new window overlaps the old you can use your mouse to separate them)
+
+SET REGION/X=180
+SET WINDOW/SIZE=0.6/NEW
+FILL/Y=70S:70N/L=1:48/LEVELS=(-7,7,1) SST_ANOM
+
+! The time axis of this data set is referred to as a "modulo" axis
+! - that is, the first month follows the last.  So the L=1:48 qualifier
+! repeats the data over 4 cycles in time - emphasizing its cyclic nature.
+
+! ******************************************************************** 
+MESSAGE
+
+! Our plot shows the expected out of phase behavior between north and south.
+
+! Lets summarize the results by averaging separately within the northern
+! and southern temperate zones (23.5 to 65 degrees latitude).
+! We can then plot the two time series that result.
+
+! We will put the results into the first window so they can easily be
+! compared to the last shaded drawing.
+
+SET WINDOW/CLEAR 1
+SET WINDOW/ASPECT=0.4/SIZE=0.5 1
+CANCEL VIEWPORTS
+LET NORTH = SST_ANOM[Y=23.5N:65N at AVE]
+LET SOUTH = SST_ANOM[Y=65S:23.5S at AVE]
+PLOT/L=1:48 NORTH, SOUTH
+
+! ******************************************************************** 
+MESSAGE
+
+! We can list the first 5 months to the screen with the LIST command below.
+
+LIST/L=1:5 NORTH, SOUTH
+
+! Sending the listed results to a file (with a variety of formats) 
+! requires only the addition of "/FILE=filename".
+
+! ******************************************************************** 
+MESSAGE
+
+! This tutorial is now completed.
+
+! You have been shown numerous capabilities of FERRET:
+! line, contour, vector and shaded plots;
+! multiple viewports, and windows; color controls;
+! abstract mathematical functions, data from data sets, and new
+! variables defined from old ones;
+! transformations and plots along various axes.
+
+! You have only scratched the surface.
+
+CANCEL MODE VERIFY
+! clean up
+SET MODE CALENDAR:MINUTES
+SET MODE/LAST VERIFY
+ 
diff --git a/jnls/examples/two_dee_plot_of_1d.jnl b/jnls/examples/two_dee_plot_of_1d.jnl
new file mode 100644
index 0000000..90e1c6a
--- /dev/null
+++ b/jnls/examples/two_dee_plot_of_1d.jnl
@@ -0,0 +1,31 @@
+!two_dee_plot_of_1d.jnl   7/95  *sh*
+
+! Description: Illustrates FILLing under a 1D plot (e.g. ocean bottom)
+
+! we will use the etopo data set to draw the ocean bottom over XZ temperatures
+set data etopo60
+set data levitus_climatology
+
+set wind/asp=.75/siz=.6
+set region/x=180:360/y=20n/z=0:5000
+
+! the temperature and the bottom as a line
+set view upper
+shade/title="Ocean Bottom using 1D PLOT" temp
+let bottom = (-1)*rose[d=etopo60]
+plot/over/nolab bottom
+
+! the temperature and the bottom as a filled region
+! we define a 2-D field where on which a contour of (0) is the bottom
+set view lower
+shade/title="Ocean Bottom using 2D FILL" temp
+let bottom_2d = bottom - z[g=temp]
+fill/over/lev=(-10000)(0)/palette=black/nolab bottom_2d
+message Lets make a nice looking plot of this
+
+! as long as we've gone this far lets make a "nice" plot
+! ("@fln" fills by linear interpolation)
+! ("@fln:100" reaches over North Africa to find an interpolating point)
+set wind/asp=.5/size=.6
+fill/title="Aint it purdy?" temp[x=@fln:100]
+fill/over/lev=(-10000)(0)/palette=black/nolab bottom_2d
diff --git a/jnls/examples/vector_demo.jnl b/jnls/examples/vector_demo.jnl
new file mode 100644
index 0000000..b0393a9
--- /dev/null
+++ b/jnls/examples/vector_demo.jnl
@@ -0,0 +1,213 @@
+\cancel mode verify
+! Description: Demonstration of various vector plotting options
+! 4/94 *sh*
+! updated 9/96 for Ferret V4.4
+
+! *acm* 7/01 update /LINE= to /COLOR=/THICKNESS=
+! *ACM* 2/13 when calling stick_vectors, works best w/o quoted string in title
+
+define alias wait message
+
+say **** Welcome to the vector plotting demo ****
+say .
+say This demo will lead you through a number of options and styles for
+say vector plotting in FERRET.  The commands that are producing the
+say plots you will see are set off in the style
+say
+say .   yes? [command]
+say
+say 
+WAIT
+
+! clean up from any previous activity
+define region/default save
+cancel region
+set wind/asp=.75:ax
+go white
+
+! ***********************************************************
+say ...
+say We will begin by examining the global FNOC winds on Jan. 1, 1990
+say The FNOC data set (monthly_navy_winds) has variables "uwnd", and "vwnd"
+say We will overlay the continentintal boundaries in red.
+say ...
+
+say .    yes? set data monthly_navy_winds
+say .    yes? set region/t=1-jan-1990
+say .    yes? vector uwnd,vwnd
+say .    yes? go land red
+
+
+set data monthly_navy_winds
+set region/t=1-jan-1990
+vector uwnd,vwnd
+go land red
+
+WAIT
+
+! ***********************************************************
+say ...
+say Now the same plot done a little nicer ...
+say (Pen number 2 is red.)
+say ...
+
+say .    yes? go fland 60 red basemap
+say .    yes? vector/overlay/length=10/title="wind speed"  uwnd,vwnd
+
+
+go fland 60 red basemap
+vector/overlay/length=10/title="wind speed"  uwnd,vwnd
+
+
+WAIT
+
+! ***********************************************************
+say ...
+say The command qualifiers /XSKIP and /YSKIP control the thinning of vectors.
+say By altering the spacing we can bring out the zonal structure of the winds.
+say ...
+
+
+say .    yes? go fland 60 black basemap
+say .    yes? vector/over/len=10/title="wind speed"/xskip=5/yskip=1/pen=2 uwnd,vwnd
+
+go fland 60 black basemap
+vector/overlay/length=10/title="wind speed"/xskip=5/yskip=1/pen=2 uwnd,vwnd
+
+
+
+WAIT
+
+! ***********************************************************
+say ...
+say In this plot we will see the important effect of the /ASPECT qualifier.
+say In this thin slice of the world from latitude 10S to 10N the scaling
+say of longitude is very different from latitude.  The /ASPECT qualifier
+say rotates the vectors to compensate while preserving their magnitudes.
+say ...
+
+ 
+say .    yes? set view upper
+say .    yes? set region/y=10s:10n
+say .    yes? go fland 60 red basemap
+say .    yes? vector/over/len=10/title="wind speed"/xskip=1/yskip=1 uwnd,vwnd
+say
+say .    yes? set view lower
+say .    yes? go fland 60 red basemap
+say .    yes? vector/over/len=10/title="wind speed"/xskip=1/yskip=1/aspect uwnd,vwnd
+
+
+set view upper
+set region/y=10s:10n
+go magnify 1.5
+go fland 60 red basemap
+vector/overlay/length=10/title="wind speed"/xskip=1/yskip=1 uwnd,vwnd
+
+set view lower
+go magnify 1.5
+go fland 60 red basemap
+vector/overlay/length=10/title="wind speed"/xskip=1/yskip=1/aspect uwnd,vwnd
+
+
+WAIT
+
+! ***********************************************************
+say ...
+say Now we will look at the same data but subtly modify the vectors
+say by centering them over their coordinate locations.  By default the
+say end point of each vector is located at its coordinate point.
+say We use the FERRET GO tool "GO centered_vectors".
+say ...
+
+
+say .    yes? set view upper
+say .    yes? go fland 60 red basemap
+say .    yes? go centered_vectors vector/overlay/title="wind speed" uwnd,vwnd 10 
+
+
+set view upper
+go magnify 1.5
+go fland 60 red basemap
+go centered_vectors vector/overlay/title="wind speed" uwnd,vwnd 10 
+go magnify 1     ! return to normal
+
+
+WAIT
+
+! ***********************************************************
+say ...
+say Oceanographers commonly want to look at a line of vectors with a
+say "stick" plot.  The GO tool "GO stick_vectors" can provide this.
+say ...
+
+
+say .    yes? set wind/asp=.4/siz=.4
+say .    yes? set region/x=180/y=0
+say .    yes? set region/t=1-jan-1982:31-jan-1992
+say .    yes? GO stick_vectors plot/COLOR=red/title=FNOC_winds uwnd vwnd
+
+
+set wind/asp=.4/siz=.4
+set region/x=180/y=0
+set region/t=1-jan-1982:31-jan-1992
+GO stick_vectors plot/COLOR=red/title=FNOC_winds uwnd vwnd
+
+
+WAIT
+set wind/asp=.75:ax/siz=.6
+set region/t=1-jan-1990
+sp rm -f vdtmp_*
+
+! ***********************************************************
+say ...
+say To complete the demonstration we will try a more challenging display.
+say We will use FERRETs ability to sub-sample from a data set to generate
+say a scatter of vector wind speeds on North Atlantic coasts.
+say Then we will use the tool "GO scattered_vectors" to display them.
+say
+say We will start by displaying a map of the region.
+say ...
+
+say .    yes? set region/x=100w:10w/y=0:60     	! North Atlantic
+say .    yes? set data etopo60		 	! 60 minute bathymetry data set
+say .    yes? FILL/PALETTE=land_sea/TITLE="Coastal Winds" rose
+say .    yes? GO land blue
+say
+say Now we will create a data file of scattered X,Y,U,V quadruples
+say to be plotted.  Use "Fgo -more vector_demo.jnl" to see the FERRET commands
+
+set region/x=100w:10w/y=0:60     		! North Atlantic
+set data etopo60		 		! 60 minute bathymetry data set
+FILL/PALETTE=land_sea/TITLE="Coastal Winds"/level=(-10000,0,1000)(0,3000,300) rose
+
+! create a data file of scattered X,Y,U,V quadruples to be plotted
+let coastmask = if rose[d=etopo60] ge 0 and rose[d=etopo60] le 20 then 1
+user/command=sample/opt2=c/file=vdtmp_u.raw uwnd[d=monthly_navy_winds], x*coastmask, y*coastmask, 1/0, 1/0
+user/command=sample/opt2=c/file=vdtmp_v.raw vwnd[d=monthly_navy_winds], x*coastmask, y*coastmask, 1/0, 1/0
+sp grep -v "99.9" vdtmp_u.raw > vdtmp_u.dat
+sp grep -v "99.9" vdtmp_v.raw > vdtmp_v.dat
+file/var=uwnd,xp,yp vdtmp_u.dat
+file/var=vwnd,xp,yp vdtmp_v.dat
+list/nohead/file=vdtmp_uv.dat/format=(4f10.4)/i=1:999 xp,yp,uwnd[d=vdtmp_u.dat],vwnd[d=vdtmp_v.dat]
+sp echo "0 0 0 0" >> vdtmp_uv.dat
+
+say .    yes? ! now overlay the vectors
+say .    yes? go scattered_vectors  vdtmp_uv.dat 15 clock
+say .    yes? PLOT/VS/D=vdtmp_uv.dat/@aros/OVERLAY/LINE/COLOR=lack/THICK=2/nolab arrow_x,arrow_y
+
+! now overlay the vectors 
+go scattered_vectors  vdtmp_uv.dat 15 clock
+PLOT/VS/D=vdtmp_uv.dat/@aros/OVERLAY/LINE/COLOR=black/THICKNESS=2/nolabels arrow_x,arrow_y
+GO land blue
+
+say ...
+say Finally, please also run the demo script poly_vec_demo.jnl for
+say a new way to plot color-filled vector arrows in both rectangular
+say and curvilinear coordinates.
+say ...
+
+! clean up
+cancel data vdtmp_u.dat, vdtmp_v.dat, vdtmp_uv.dat
+sp rm -f vdtmp_*
+set region save
+set mode/last verify
diff --git a/jnls/examples/viewports_demo.jnl b/jnls/examples/viewports_demo.jnl
new file mode 100644
index 0000000..327c3b0
--- /dev/null
+++ b/jnls/examples/viewports_demo.jnl
@@ -0,0 +1,54 @@
+CANCEL MODE VERIFY
+CANCEL VARIABLES/ALL   ! clean up from whatever went before
+SET MODE VERIFY
+
+! viewports.jnl - *sh* 11/91 updated (slightly) 11/93 
+! *acm* 7/01 update PPL PEN to /COLOR=/THICKNESS=  and PPL AXTYPE to /NOAXIS 
+
+! Description: a quick (cutsie) demo using line plots and viewports
+
+! The command  "SET VIEWPORT viewport_name" is used to select a viewport.
+! The DEFINE VIEWPORT command is used to define (or redefine) a viewport.
+
+! === This demo displays the figures from GO spirograph in viewports
+
+message
+
+! simple spiral in lower left
+SET VIEWPORT LL		! lower left
+LET xspiral = i^.5*cos(i/20)
+LET yspiral = i^.5*sin(i/20)
+PLOT/VS/LINE/I=1:2000/COLOR=RED/NOAXES/NOLAB xspiral,yspiral
+
+! Define a variable to separate odd and even points.
+! Then draw 10 time around circle, every 10th point.
+SET VIEWPORT LR		! lower right
+LET ODD = MOD(I,2) EQ 0
+LET XPT = IF ODD THEN (-1*SIN(I/10)) ELSE SIN(I/10)
+LET YPT = IF ODD THEN COS(I/10) ELSE (-1*COS(I/10))
+PLOT/VS/LINE/NOLAB/I=1:314/COLOR=green/NOAXES XPT,YPT
+
+! true art ... moving center to the circle
+SET VIEWPORT UL		! upper left
+LET XCNTR = COS(I/30)
+LET YCNTR = SIN(I/30)
+LET XPT1 = IF ODD THEN (-1*SIN(I/10)) ELSE SIN(I/10)
+LET YPT1 = IF ODD THEN COS(I/10) ELSE (-1*COS(I/10))
+LET XPT2 = XPT1 + XCNTR
+LET YPT2 = YPT1 + YCNTR
+PLOT/VS/LINE/NOLAB/I=1:380/COLOR=blue/NOAXES XPT2,YPT2
+
+! 3D wire frame
+SET VIEWPORT UR		! upper right
+LET GAUSS = 2*EXP( -1*(((i-21)/10)^2 + ((j-21)/5)^2) )
+WIRE/NOLAB/I=1:41/J=1:41/VIEW=-4,-10,4 gauss
+
+! a parting thought ...
+SET WINDOW/SIZE=0.5 2
+GO setup_text
+PPL labs 1 0.5,0.5,0 @CI at P2finis; PPL hlabs 1,1.0; PPL plot
+
+message
+GO cleanup_text
+say Done.  See ya
+CANCEL WINDOW 2
diff --git a/jnls/examples/wire_frame_demo.jnl b/jnls/examples/wire_frame_demo.jnl
new file mode 100644
index 0000000..2d1bb7d
--- /dev/null
+++ b/jnls/examples/wire_frame_demo.jnl
@@ -0,0 +1,29 @@
+! wire_frame.jnl - *sh* 11/91
+! update 12/92 using the WIRE command
+! update 11/93 for V3.01 which defaults region of abstract vars to grid limits
+
+! Description: demonstrates how to create a 3D wire frame plot
+
+! demonstrates a simple wire frame 3D drawing from PLOT+ inside FERRET
+! uses a 2D Gaussian function for the example
+
+! ...in case of left-overs from previous commands
+CANCEL REGION
+
+! Define a simple 2D Gaussian function in the XY plane.
+LET GAUSS = 2*EXP(-1*((x/2)^2 + y^2))
+
+! Define an 80 by 80 point region from (-4,-4) to (4,4) in the XY plane.
+DEFINE AXIS/X=-4:4:.1 xax80
+DEFINE AXIS/Y=-4:4:.1 yax80
+DEFINE GRID/X=xax80/Y=yax80 g_gauss
+SET GRID g_gauss     ! the pseudo-variables "x" and "y" on this grid
+
+! View the field from the point (x,y,z)=(-4,-10,4).
+WIRE/view=-4,-10,4 gauss
+
+! We will now clean up FERRET for whatever you, the user, will be doing next.
+! To experiment with this mathematical functions further use the commands
+!      SET GRID g_gauss 
+SET GRID abstract
+CANCEL REGION
diff --git a/jnls/go/bar_chart1.jnl b/jnls/go/bar_chart1.jnl
new file mode 100644
index 0000000..f0c813e
--- /dev/null
+++ b/jnls/go/bar_chart1.jnl
@@ -0,0 +1,61 @@
+\CANCEL MODE VERIFY
+! bar_chart.jnl   *sh* 11/93
+
+! Description: Make a bar chart using color fill (not suitable for Z axis)
+
+! this routine will take a simple 1D line of data and represent it as a
+! bar chart from FERRET
+
+! Note:  The line of data may be a line in X, Y, or T but not Z. The Z
+! location of the data to be plotted (if relevant) must be unambiguously
+! given as a part of the expression.  A simple modification of this routine
+! could make a Z-line plottable (at the sacrifice of one other axis).
+
+! usage: GO bar_chart expression lo_limit hi_limit [color]
+!	"color" must be the name of a .spk file in the $FER_PALETTE list
+
+! example 1 (abstract):
+!	yes? GO bar_chart sin(X[i=1:30]/6) -1 1 .05
+! example 2 (time series of sst):
+!	yes? SET DATA gt01mncoads
+!	yes? SET REGION/X=180/Y=0/t=1-jan-1980:1-jan-1990
+!	yes? GO bar_chart sst 27 31 red
+
+! Had the variable in the data set been 4D temperature ("temp") instead of SST
+! the correct command would have been "GO bar_chart temp[Z=0] 27 31"
+! The command argument "delta" is the resolution of the vertical axis of the
+! plot.
+
+! capture the current region because Z limits will be modified
+
+! check the arguments
+QUERY/IGNORE $1"<usage: yes? GO bar_chart expression lo_limit hi_limit [color]"
+QUERY/IGNORE $2"<usage: yes? GO bar_chart expression lo_limit hi_limit [color]"
+QUERY/IGNORE $3"<usage: yes? GO bar_chart expression lo_limit hi_limit [color]"
+
+! define a 2D grid for the display
+DEFINE AXIS/Z=$2:$3/npoints=40 zbchart
+DEFINE GRID/z=zbchart gbchart
+
+! define a 2D field that has the desired bar chart shape
+LET bchart_data = $1"<usage: GO bar_chart [lo] [hi] [delta]"
+LET bchart = IF z[g=gbchart,Z=$2:$3] LT bchart_data THEN 0.0
+
+! grab the title and units string as PLOT+ symbols
+PLOT/SET $1
+ppl set savetitl 'labtit'
+ppl set saveylab 'laby'
+
+! now to display it as a 2-D bar chart (color control not fully supported)
+! palette defaults to gray.spk - other palettes are OK
+shade/nokey/palette=$4"gray"/SET bchart
+ppl TITLE @AC'savetitl'
+ppl YLAB  @AS'saveylab'
+ppl shade
+
+! cleanup
+!SET REGION save
+!cancel region save
+SET MODE/LAST VERIFY
+
+
diff --git a/jnls/go/bar_chart2.jnl b/jnls/go/bar_chart2.jnl
new file mode 100644
index 0000000..d0da2a9
--- /dev/null
+++ b/jnls/go/bar_chart2.jnl
@@ -0,0 +1,111 @@
+\cancel mode verify
+! bar_chart2.jnl
+! 4/94
+! bug fixes 8/94: use "ppl yaxis" to set lower plot bound
+!		  use "ppl xaxis" to make X axis wide enough
+! bug fix  12.98: overlay/vs -> overlay>overlay/vs *jd* per *sh*
+
+! Description: Make a bar chart using hollow rectangles
+
+! Usage:
+
+!	GO bar_chart2 plot_command expression [axis] ["overlay"] [lower_bound]
+! 1 plot_command   - "PLOT" with its qualifiers
+! 2 expression     - a line of data (oriented along "axis") to be bar-charted
+! 3 axis	   - "X", "Y", "Z", or "T"
+! 4 overlay	   - "OVERLAY" or " " or "CLEAR"
+! 5 lower_bound	   - the bottom of the bar chart (default = below min data)
+
+! Example:
+!	yes? SET DATA coads_climatology
+!	yes? SET REGION/L=1/Y=40S:40N/X=110W
+!	yes? GO  bar_chart2 PLOT/LINE=1 sst Y
+!	yes? GO  bar_chart2 PLOT/LINE=2 sst[x=90w] Y overlay
+
+! Note: To use a T axis requires CANCEL MODE CALENDAR
+
+! Note: as of 4/25/94 this routine has a bug and the first bar is missing.
+!       Kludge sol'n is to plot one extra bar at the beginning
+
+! check for required args
+QUERY/IGNORE $1%<Usage: GO bar_chart2 "PLOT"[/quals] expression [axis] ["OVERLAY"] [lower_bound]%
+QUERY/IGNORE $2%<Usage: GO bar_chart2 "PLOT"[/quals] expression [axis] ["OVERLAY"] [[lower_bound]%
+QUERY/IGNORE $3%X|X|Y|Z|T|<Usage: GO bar_chart2 "PLOT"[/quals] expression [axis] ["OVERLAY"] [[lower_bound]%
+QUERY/IGNORE $4%clear|overlay|clear|<Usage: GO bar_chart2 "PLOT"[/quals] expression [axis] ["OVERLAY"] [[lower_bound]%
+
+! determine the grid for bar_expr (so SET GRID works)
+LET/QUIET bar_expr = missing($2,-9999.)	! attach a known missing data flag to the data
+LOAD bar_expr
+SET GRID/SAVE
+SET GRID bar_expr
+
+! determine the start and end of the X axis of the plot
+LET/QUIET x_expr = $3"X|X|Y|Z|T"
+LET/QUIET x_ax_end   = x_expr[$3"X|X|Y|Z|T"=@max]
+LET/QUIET x_ax_start = x_expr[$3"X|X|Y|Z|T"=@min]
+LET/QUIET x_ax_delta = (x_ax_end - x_ax_start)/(x_expr[$3"X|X|Y|Z|T"=@ngd]+x_expr[$3"X|X|Y|Z|T"=@nbd]-1)
+
+! set the lower edge of the boxes
+LET/QUIET bar_min = y3[X=@MIN]
+LET/QUIET bar_y0 = $5"bar_min-0.2*ABS(bar_min)"   ! a bit below the min
+
+! write the data to a file so it can be placed on a simple counting axis
+! write the first and last X values to help complete the edge bars
+sp rm -f bar_plot.dat
+LIST/NOHEAD/FILE=bar_plot.dat/FORMAT=(2(1PG15.7))/APPEND x_ax_start - x_ax_delta, 0
+LIST/NOHEAD/FILE=bar_plot.dat/FORMAT=(2(1PG15.7))/APPEND $3"X|X|Y|Z|T", bar_expr 
+LIST/NOHEAD/FILE=bar_plot.dat/FORMAT=(2(1PG15.7))/APPEND x_ax_end+x_ax_delta, 0
+LIST/NOHEAD/FILE=bar_plot.dat/FORMAT=(2(1PG15.7))/APPEND x_ax_end+2*x_ax_delta, 0
+
+! prepare to read it back
+SET DATA/SAVE
+CANCEL DATA/NOERR bar_plot.dat
+FILE/VARIABLES=bar_x,bar_y bar_plot.dat
+SET DATA/RESTORE
+
+! replicate the points x 3 by regridding to an axis from 1/3 to n+1/3 by 1/3
+! then delete all except the integer point in each group of three
+DEFINE AXIS/X=.66666667:10000:.3333333333    axtimes3  ! 2/3:big:1/3
+DEFINE GRID/X=axtimes3 gtimes3
+LET/QUIET bar_index = MOD(i[g=gtimes3]-1,3) + 1
+LET/QUIET midmask = IF bar_index EQ 2 THEN 1
+LET/QUIET x_mid   = midmask * bar_x[G=gtimes3,d=bar_plot.dat]
+LET/QUIET y_mid   = midmask * bar_y[G=gtimes3,d=bar_plot.dat]
+LET/QUIET x3   = x_mid[x=@FNR]
+LET/QUIET y3_9999   = y_mid[x=@FNR]
+LET/QUIET y3 = IF y3_9999 NE (-9999) THEN y3_9999 !screen out REAL missing data
+
+
+! Define the region "bar" to be the number of points x3
+LIST/NOHEAD/APPEND/FORMAT=("DEFINE REGION/I=1:",1PG11.6," bar")/FILE=bar_commands.jnl (bar_expr[$3"X|X|Y|Z|T"=@ngd]+1)*3 + 1
+GO bar_commands.jnl
+sp rm -f bar_commands.jnl     ! clean up
+
+! define the pieces of each "bar" - 3 points
+! for a data point i (Xi,Yi), the 3 points are 
+! P1 = (Xi + Xi-1)/2, bar_y0
+! P2 = (Xi + Xi-1)/2, Yi
+! P3 = (Xi+1 + Xi)/2, Yi
+
+LET/QUIET p1x = IF bar_index EQ 1 THEN (x3 + x3[x=@shf:-1])/2
+LET/QUIET p2x = IF bar_index EQ 2 THEN (x3 + x3[x=@shf:-2])/2
+LET/QUIET p3x = IF bar_index EQ 3 THEN (x3[x=@shf:+1] + x3)/2
+LET/QUIET p1y = IF bar_index EQ 1 THEN bar_y0
+LET/QUIET p2y = IF bar_index EQ 2 THEN y3
+LET/QUIET p3y = IF bar_index EQ 3 THEN y3
+
+! and now the fully assembled plot
+LET/QUIET bar_px = MISSING(p1x,MISSING(p2x,p3x))
+LET/QUIET bar_py = MISSING(p1y,MISSING(p2y,p3y))
+SET VARIABLE/TITLE="Value" bar_px
+SET VARIABLE/TITLE="Histogram Magnitude" bar_py
+
+! plot it
+DEFINE REGION/DEFAULT save
+cancel region    ! probably unnecessary ...
+$1/$4"vs|clear>vs|overlay>overlay/vs|"/@bar/D=bar_plot.dat bar_px,bar_py
+SET GRID/SAVE
+SET REGION save
+
+
+set mode/last verify
diff --git a/jnls/go/bar_chart3.jnl b/jnls/go/bar_chart3.jnl
new file mode 100644
index 0000000..8460657
--- /dev/null
+++ b/jnls/go/bar_chart3.jnl
@@ -0,0 +1,69 @@
+\cancel mode verify
+! bar_chart3.jnl
+! 6/99 *sh*
+! 7/01 *acm* update /xlimits to /hlimits
+
+! Description: Produce a color-filled bar chart
+
+! Usage:                    $1          $2          $3        $4
+! yes?	GO bar_chart3 polygon_command bar_data [color_data] [base]
+! $1 - the polygon command with qualifiers (eg POLYGON/OVER/NOLABEL)
+! $2 - a variable -- as if it were being plotted
+!       region for variable should be self-contained (not depend on SET REG
+!	or on command qualifiers)
+! $4 - base or offset value (this value will have a zero-sized bar)
+
+! example  (see also bar_chart_demo)
+! yes? go bar_chart3 poly/line/nolabel/fill RANDN(I[i=1:10]) RANDN(I[i=1:10]+1)
+
+! example 2 - two variables overlaid
+!let a = 1+RANDU(I[i=1:10])
+! plot/hlimits=0.5:10.5/sym/ylim=0:2/title="My Bars" 0*a+0.5  ! axes + title
+!go bar_chart3 poly/line/palette=red/overlay/title="My reds" a
+! let b = RANDU(I[i=1:10]+1)
+!go bar_chart3 poly/line/palette=blue/overlayy/title="My blues" b
+
+! example 3
+!let a = RANDN(T[T=2-jan-1990:1-jun-1990:24])
+!plot/ylim=-3:3/title="hist-style plot" 0*a
+!go bar_chart3 poly/over/palette=no_green_centered/levels=(-3,3,.5)/nolab a a
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO bar_chart3 polygon_command bar_data [color_data] [base]"
+QUERY/IGNORE $2"<usage: yes? GO bar_chart3 polygon_command bar_data [color_data] [base]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET BCHy = $2
+IF $3"0|*>1" THEN
+  DEFINE SYMBOL BCHcolor  ",$3"
+ELSE
+  DEFINE SYMBOL BCHcolor  " "
+ENDIF
+LET/QUIET BCHbase = $4"0"
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL BCHax `BCHy,return=shape`
+DEFINE SYMBOL BCHiax ($BCHax"|X>i|Y>j|Z>k|T>l|<error: data is not a line")
+DEFINE SYMBOL BCHbar_ax ($BCHax"|X>Z|Y>Z|Z>Y|T>Z)   ! pick a different axis
+
+! get the independent axis out as a separate variable
+! typically, "0*BCHy + X[i=lo:hi]", so X is inherited from BCHy
+DEFINE SYMBOL BCHilo `BCHy,return=($BCHiax)start`
+DEFINE SYMBOL BCHihi `BCHy,return=($BCHiax)end`
+LET/QUIET BCHx = 0*BCHy + ($BCHax)[($BCHiax)=($BCHilo):($BCHihi)]
+
+! compute midpoints along the independent axis so the "bars" are centered
+! (use MISSING to extrapolate down to the bottom end of the first bar)
+LET/QUIET BCHxmid = MISSING((BCHx + BCHx[($BCHiax)=@shf:-1])/2, 1.5*BCHx[($BCHiax)=($BCHilo)]-0.5*BCHx[($BCHiax)=`($BCHilo)+1`])
+
+! create rectangles (polygons) on the BCHbar_ax axis
+LET/QUIET BCHpindex = ($BCHbar_ax)[($BCHbar_ax)=1:4]
+LET/QUIET BCHy4 = IF BCHpindex EQ 1 OR BCHpindex EQ 4 then 0*BCHy+BCHbase ELSE BCHy
+LET/QUIET BCHx4 = MISSING(IF BCHpindex LE 2 then BCHxmid ELSE BCHxmid[($BCHiax)=@shf:1], 1.5*BCHx[($BCHiax)=($BCHihi)]-0.5*BCHx[($BCHiax)=`($BCHihi)-1`])
+
+! execute the polygon command
+$1/coord_ax=($BCHbar_ax)  BCHx4,BCHy4 ($BCHcolor)
+
+cancel symbol BCH*
+cancel variable BCH*
+set mode/last verify
diff --git a/jnls/go/basemap.jnl b/jnls/go/basemap.jnl
new file mode 100644
index 0000000..f72a488
--- /dev/null
+++ b/jnls/go/basemap.jnl
@@ -0,0 +1,54 @@
+\cancel mode verify
+! basemap.jnl - 10/94 *sh*
+
+! Description: Plot a base map of the earth (solid, outline, or detailed) 
+
+!              arg 1     arg 2   arg 3   arg 4     arg 5   arg 6  arg 7  arg 8
+! GO basemap [x=lo:hi] [y=lo:hi] [res] [palette] [detail] [land] [natl] [state]
+
+! arg 1 - longitude limits - specify as for any FERRET longitude range.
+!	  To produce a 360 degree view centered on Greenwhich use X=180:540.
+!     					default = 20e to 380 (range of etoponn)
+! arg 2 - latitude limits - specify as for any FERRET latitude range. 
+!	  		     		default 90s to 90n (range of etoponn)
+! arg 3 - resolution - may be 120,60,40,20,10, or 5     default=20
+!	  To use resolution "nnn" the file etoponnn must exist.
+! arg 4 - palette - may be any palette on your system.  Normally solid colors
+!		    like black, gray,red, etc. (see Fpalette '*') default=gray
+! arg 5 - detailed - may be "detailed",  "hollow", "all", or "solid"  (default)
+! arg 6 - Color (and thickness) of coastal outline drawn. default=none
+!         The color may be any of the acceptable colors from GO land. 
+!	  (Use "N" to omit coastlines but include nation or state boundaries)
+! arg 7 - Color (and thickness) of national boundaries drawn.   default=none
+!         The color may be any of the acceptable colors from GO land. 
+! arg 8 - Color (and thickness) of US state boundaries drawn.   default=none
+!         The color may be any of the acceptable colors from GO land. 
+
+! examples:
+!	GO basemap
+!	GO basemap x=140w:360 y=-15:40
+!	GO basemap x=140w:360 y=-15:40 20
+!	GO basemap x=140w:360 y=-15:40 20        red
+!	GO basemap x=140w:360 y=-15:40 20 dark_terrestrial detailed
+!	GO basemap x=140w:360 y=-15:40 20      land_sea      all
+!	GO basemap   " "        " "   " "        red        solid  thick
+!	GO basemap   " "        " "   " "        " "        hollow  red
+!	GO basemap  x=140w:10e y=30s:70n 60    land_sea      all  black red red
+
+! check the overlay/basemap option
+query/ignore $5%not_required|detailed|hollow|solid|all> <5th argument of GO basemap may be "detailed", "hollow" or "solid" or "all" (ocean, too)%
+query/ignore $6%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<line_color may be 0(back), 1(fore), thick, 2-18 or a color%
+
+! initialize
+set data/save
+
+! do the shaded plot
+set data etopo$3"20"
+shade/nolab/nokey/$1"nolab"/$2"nolab"/lev=$5"(0,10000,10000)|detailed>(0,200,50)(200,1000,100)(1000,10000,1000)|solid>(0,10000,10000)|hollow>(20000,20000,1)|all>(-200,200,50)(-1000,1000,200)(-8000,8000,1000)"/pal=$4"gray" rose
+cancel data etopo$3"20"
+set data/restore
+
+! optionally overlay the conintental boundaries
+$6"query/ignore this|*>GO land" $6"dummy" overlay $7" " $8" "
+
+set mode/last verify
diff --git a/jnls/go/black.jnl b/jnls/go/black.jnl
new file mode 100644
index 0000000..5c0422b
--- /dev/null
+++ b/jnls/go/black.jnl
@@ -0,0 +1,9 @@
+\CANCEL MODE VERIFY     ! ... setting black background
+! updated 10/93 for Ferret V3.01
+
+! Description: set video background to black, foreground to white 
+
+ppl color 0 0 0 0
+ppl color 1 100 100 100
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/bold.jnl b/jnls/go/bold.jnl
new file mode 100644
index 0000000..944f536
--- /dev/null
+++ b/jnls/go/bold.jnl
@@ -0,0 +1,30 @@
+\cancel mode verify
+! Description: set up PLOT+ and FERRET to produce bolder-looking plots
+
+! note there may be some undesirable side-effects regarding fonts since
+! underscores and square brackets exist only in the PLOT+ ASCII fonts
+! updated 10/93 *sh* for Ferret V3.01
+! updated 4/95 to increase SHAKEY numbering size
+
+! Complex Roman font
+can mode ascii
+ppl dfltfnt TR
+
+! bigger axis tic numberings
+ppl axlsze .13,.13
+
+! bigger contour numbers also in TR font
+ppl conset .11
+ppl conpre @TR
+
+! bigger color key labelling
+ppl shakey  ,,0.12
+
+! can optionally make lines thick by adding 6 to the PLOT+ line style number
+!ppl pen 0,7
+!ppl pen 1,7
+
+! can optionally increase default label sizes
+!ppl labset ,,,.15
+
+set mode/last verify
diff --git a/jnls/go/box.jnl b/jnls/go/box.jnl
new file mode 100644
index 0000000..f24430d
--- /dev/null
+++ b/jnls/go/box.jnl
@@ -0,0 +1,40 @@
+\cancel mode verify
+! box.jnl - draw a box using the indicated corners
+! 8/94
+! 1/03 bug fix: with v5.5 Ferret, possible negative numbers in arguments 
+!               need to be in parentheses within the IF THEN statements
+
+! Description: Overlay a colored box outline given the corner coordinates
+
+! usage:  GO box xlo xhi ylo yhi [pen_number]
+
+! Notes:
+!  1) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+
+! test pen_number before performing any actions
+query/ignore $1%<Usage: GO box xlo xhi ylo yhi [pen_number]%
+query/ignore $2%<Usage: GO box xlo xhi ylo yhi [pen_number]%
+query/ignore $3%<Usage: GO box xlo xhi ylo yhi [pen_number]%
+query/ignore $4%<Usage: GO box xlo xhi ylo yhi [pen_number]%
+query/ignore $5%1|red>1|green>1|blue>1|thick>1|0>1|1>1|2>1|3>1|4>1|5>1|6>1|7>1|8>1|9>1|10>1|11>1|12>1|13>1|14>1|15>1|16>1|17>1|18>1|<GO box xlo xhi ylo yhi pen with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+LET/QUIET XBOX_CORNERS = IF I LE 2 THEN (($1)) ELSE XBOX_CORNER2
+LET/QUIET XBOX_CORNER2 = IF I LE 4 THEN (($2)) ELSE ($1)
+LET/QUIET YBOX_CORNERS = IF I EQ 1 THEN (($4)) ELSE YBOX_CORNER2
+LET/QUIET YBOX_CORNER2 = IF I LE 3 THEN (($3)) ELSE ($4)
+
+! set up PLOT+
+PLOT/VS/NOLAB/OVER/line=1/SET_UP/I=1:5 XBOX_CORNERS, YBOX_CORNERS
+
+! select line style
+! Note: The "line=" could be used to specify the line style but the command
+!       gets too ungainly to read
+ppl pen 1,$5"1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! plot it
+PPL PLOT/OVERLAY
+
+! clean up
+ppl pen 1,1
+set mode/last verify
diff --git a/jnls/go/box_plot.jnl b/jnls/go/box_plot.jnl
new file mode 100644
index 0000000..1412e00
--- /dev/null
+++ b/jnls/go/box_plot.jnl
@@ -0,0 +1,28 @@
+\cancel mode verify
+! 2/94 - box_plot.jnl
+
+! Description: produce a plot with "bare" axes (no tics, no labels)
+
+! usage:  GO box_plot plot_command
+
+! plot_command:	A full plot command including qualifiers and arguments
+
+! Note on plot command qualifiers:
+!  If /SET_UP is used manual setting and resetting of PPL tics and axlabp
+!  commands will be required
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO box_plot complete_plot_command%
+
+! set up PLOT+ without axis tics
+ppl tics 0,0,0,0
+ppl axlabp 0,0
+
+! produce the plot (whatever plot command they gave)
+$*
+
+! restore PLOT+ defaults
+ppl tics 0.125,.25,.125,.25
+ppl axlabp -1,-1
+
+set mode/last verify
diff --git a/jnls/go/bullseye.jnl b/jnls/go/bullseye.jnl
new file mode 100644
index 0000000..3e181d2
--- /dev/null
+++ b/jnls/go/bullseye.jnl
@@ -0,0 +1,89 @@
+\cancel mode verify
+! bullseye.jnl
+
+! Description: locate and show a bullseye in a region of  data
+
+! Given a 2D XY field to search, and approximate location, and (optionally)
+! the height and width of a rectangle to search, this routine will locate
+! an extrema, mark the search box and the extreme point in black, and report
+! the extreme value, its location, and a 7x7 table of surrounding values
+! If no extremum is found the rectangle is marked in red.
+! The argrment "output" allows control if no plotting is desired.
+
+! modified 4/29/97
+
+! Usage:		arg 1	2   3     4      5    	 6
+!	GO bullseye expression xpt ypt [xwid] [ywid] [output]
+
+!  arg 1 (expression)	- name of variable or expression with bullseye
+!  arg 2 (xpt)		- approximate X location of bull's eye
+!  arg 3 (ypt)		- approximate Y location of bull's eye
+!  arg 4 (xwid)		- width of X box to search (default=10 degrees)
+!  arg 5 (ywid)		- width of Y box to search (default=10 degrees)
+!  arg 6 (output)	- "LIST", "PLOT", or "BOTH" (default=BOTH)
+
+! example (try it):
+!	yes? USE ocean_atlas_annual
+!	(yes? CANCEL MODE LONGITUDE	! optional )
+!	yes? SHADE  po4[k=1]		! Note Bull's eye at approx 30w 60S
+!	yes? GO bullseye po4[k=1] 175e 50n	! simple success
+
+!	yes? GO bullseye po4[k=1] 55e 20n 20 20	! OK with missing data inside
+
+!	yes? GO bullseye po4[k=1] 173e 50n	! failure -- extremum at edge
+
+! test validity of arguments
+query/ignore $1%<Usage: GO bullseye expression X=lo:hi  Y=lo:hi%
+query/ignore $2%<Usage: GO bullseye expression X=lo:hi  Y=lo:hi%
+query/ignore $3%<Usage: GO bullseye expression X=lo:hi  Y=lo:hi%
+define sym choice $6"0|LIST>1|PLOT>-1|BOTH>0|<Argument 6 must be LIST, PLOT, or BOTH" ! "list"=1, "plot"=-1, "both"=0
+
+! check for a MAX in region
+define symbol extreme MAXIMUM
+GO find_bullseye $1 $2 $3 $4"10" $5"10" MAX
+
+! Nope?  Then check for a MIN, instead
+IF `($success) NE 1` THEN
+  define symbol extreme MINIMUM
+  GO find_bullseye $1 $2 $3 $4"10" $5"10" MIN
+ENDIF
+
+!========================
+! If no success report failure and exit
+IF `($success) NE 1` THEN
+  SAY *****************************************************************
+  SAY ***                                                           ***
+  SAY *** Search failed:    ($failure_reason)
+  SAY ***                                                           ***
+  SAY *****************************************************************
+  SAY *** (Ignore the following message about the Unclosed IF statement)
+  IF `($choice) GE 0` THEN
+    GO bullseye_box 2      ! red box shows failure region
+  ENDIF
+  EXIT
+ENDIF
+!========================
+
+! SUCCESS!!
+! announce the results
+say **********************************************************************
+SAY ****                                                         ****
+say **** Bullseye=`field[I=($iloc),J=($jloc)]` (($extreme)) at X=($xloc) (I=($iloc)), Y=`yloc` (J=($jloc)) ****
+SAY ****                                                         ****
+say **********************************************************************
+
+! list a 7 by 7 block of the field centered on the bullseye 
+IF `($choice) GE 0` THEN
+   SAY LIST/I=`($iloc)-3`:`($iloc)+3`/J=`($jloc)-3`:`($jloc)+3` field
+   LIST/I=`($iloc)-3`:`($iloc)+3`/J=`($jloc)-3`:`($jloc)+3` field
+ENDIF
+
+! plot the bulls eye and a box around it
+IF `($choice) LE 0` THEN
+   GO bullseye_box 1   			   	! black box
+   PLOT/VS/OVER/NOLABEL/SYMB=2 ($xloc), ($yloc)	! mark the extremum
+ENDIF
+
+! clean up
+set mode/last verify
+
diff --git a/jnls/go/bullseye_box.jnl b/jnls/go/bullseye_box.jnl
new file mode 100644
index 0000000..f98ef8e
--- /dev/null
+++ b/jnls/go/bullseye_box.jnl
@@ -0,0 +1,28 @@
+\cancel mode verify
+! bullseye_box.jnl
+
+! Description: draw box around bullseye search region
+! Note: this is a subroutine of bullseye.jnl
+
+! created 4/29/97
+
+! Usage:	arg        1
+!	GO bullseye_box pen_color
+
+!  arg 1 (pen_color)	- color of box to draw
+
+! test validity of arguments
+query/ignore $1%<Usage: GO bullseye_box pen_color%
+
+! define variables -- arrays of X and of Y (possibly of differing lengths)
+LET/QUIET xlims = X[($xrng)]
+LET/QUIET ylims = Y[($yrng)]
+
+! draw the box
+PLOT/VS/LINE=$1/OVERLAY/NOLAB xlims, 0*xlims+ylims[y=@min]
+PLOT/VS/LINE=$1/OVERLAY/NOLAB xlims, 0*xlims+ylims[y=@max]
+PLOT/VS/LINE=$1/OVERLAY/NOLAB 0*ylims+xlims[x=@min], ylims
+PLOT/VS/LINE=$1/OVERLAY/NOLAB 0*ylims+xlims[x=@max], ylims
+
+! clean up
+set mode/last verify
diff --git a/jnls/go/ccbar.jnl b/jnls/go/ccbar.jnl
new file mode 100644
index 0000000..6dafb75
--- /dev/null
+++ b/jnls/go/ccbar.jnl
@@ -0,0 +1,128 @@
+\CANCEL MODE verify
+! ccbar.jnl - 5/02  ms and acm
+
+! Description: Continuous colorbar script: uses a shade plot in a viewport to make a colorbar
+! 
+
+!          arg 1  arg 2  arg 3  arg 4  arg 5  arg 6  arg 7  arg 8
+! GO ccbar  x1     x2     y1     y2     v1     v2     dv     orient
+!
+!         x1 = x lo limit of rectangle for the colorbar
+!         x2 = x hi limit of rectangle for the colorbar
+!         y1 = y lo limit of rectangle for the colorbar
+!         y2 = y hi limit of rectangle for the colorbar
+
+!         v1 = lo value on colorbar 
+!         v2 = hi value on colorbar
+!         dv = delta value for clorbar axis
+!
+!         arg 7 = orientation, v for vertical or h for horizontal, default v
+!         arg 8 = palette to use, optional
+
+! Where the first four arguments define a rectangle, as a fraction 
+! of the entire plot page.  This is equivalent to how DEFINE VIEWPORT 
+! works.  Its qualifiers /XLIMITS=x1,x2 and /YLIMITS=y1,y2 allow the 
+! user to specify a portion of the graphics window as the viewport.
+
+!  Example:
+!   yes? SET VIEW full
+!   yes? SHADE/i=1:50/y=1:50/NOKEY i+j
+!   yes? GO ccbar .91 .94 .2 .8 0 100 2 
+!
+!  Or, a horizontal colorbar with a viewport plot:
+!   yes? SET VIEW ur
+!   yes? FILL/I=1:50/J=1:50/LEV=(0,110,2)/NOKEY/PAL=no_green i+j
+!   yes? GO ccbar 0.65,0.9, 0.92,0.94, 0,110,2, h, no_green
+
+
+! Check inputs. First 7 are required
+
+QUERY/IGNORE $1%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $2%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $3%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $4%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $5%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $6%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $7%<Usage: GO ccbar x1 x2 y1 y2 v1 v2 dv orient"%
+QUERY/IGNORE $8%v%
+LET ccb_orient = $8"1|v>1|h>2|*>1"
+
+DEFINE SYM ccb_pal = $9"none"
+LET ccb_given = ($ccb_pal%|none>0|*>1%)
+IF `ccb_given EQ 1` THEN 
+   DEFINE SYM ccb_pal = /PAL=$9
+ELSE
+   CANCEL SYM ccb_pal 
+ENDIF
+
+! Define the viewport to contain the colorbar
+
+LET ccb_x1 = $1
+LET ccb_x2 = $2
+LET ccb_y1 = $3
+LET ccb_y2 = $4
+
+DEFINE VIEW/AXES/text=0.6/XLIMITS=`ccb_x1`,`ccb_x2`/YLIMITS=`ccb_y1`,`ccb_y2` ccb_cbar$1$2$3$4
+SET VIEW ccb_cbar$1$2$3$4
+
+!  Set up to plot a variable with desired range
+LET ccb_v1 = $5
+LET ccb_v2 = $6
+LET ccb_dv = $7
+
+DEFINE AXIS/X=1:2:1 ccb_xcb 
+DEFINE AXIS/Y=`ccb_v1`:`ccb_v2`:`ccb_dv` ccb_ycb
+LET ccb_var = 0*x[gx=ccb_xcb] + y[gy=ccb_ycb]
+
+! ----------------------------------------------------------------------
+!  Set the label format.  This could be further customized.
+
+! I3 if range in [-99,999]
+
+LET ccb_fmt = 0
+IF `ccb_v1 GE -99` THEN
+  IF `ccb_v2 LT 1000` THEN LET ccb_fmt = 1
+  IF `ccb_v2 LT 1000` THEN DEFINE SYM ccb_yform = (I3)
+ENDIF
+
+!  I2 format if range in [-9,99]
+
+IF `ccb_v1 GE -9` THEN
+  IF `ccb_v2 LT 100` THEN LET ccb_fmt = 1
+  IF `ccb_v2 LT 100` THEN DEFINE SYM ccb_yform = (I2)
+ENDIF
+
+!  I1 if in range 0 [0,9]   This may not be adequate!
+IF `ccb_v1 GE 0` THEN 
+  IF `ccb_v2 LT 10` THEN LET ccb_fmt = 1
+  IF `ccb_v2 LT 10` THEN DEFINE SYM ccb_yform = (I1)
+ENDIF
+
+! Otherwise use default axis labelling...
+
+IF `ccb_v2 - ccb_v1 LT 2` THEN 
+  LET ccb_fmt = 0
+ENDIF
+
+! ----------------------------------------------------------------------
+
+!  Plot the variable within the colorbar.
+
+PPL yfor
+IF `ccb_orient EQ 1` THEN
+   SHADE/LEV=(`ccb_v1`,`ccb_v2+ccb_dv`,`ccb_dv`)/NOKEY/NOLAB/AXES=0,0,0,1($ccb_pal)/SET ccb_var
+   IF `ccb_fmt eq 1` THEN PPL YFOR ($ccb_yform)
+   PPL SHADE
+ELSE
+set mode ver
+   SHADE/TRANS/LEV=(`ccb_v1`,`ccb_v2+ccb_dv`,`ccb_dv`)/NOKEY/NOLAB/AXES=1,0,0,0($ccb_pal)/SET ccb_var
+   IF `ccb_fmt eq 1` THEN PPL XFOR ($ccb_yform)
+   PPL SHADE
+ENDIF
+
+! Clean up
+!CANCEL VAR ccb_*
+!CANCEL AXIS ccb_xcb
+!CANCEL AXIS ccb_ycb
+
+SET MODE/LAST verify
diff --git a/jnls/go/centered_vectors.jnl b/jnls/go/centered_vectors.jnl
new file mode 100644
index 0000000..758a0f5
--- /dev/null
+++ b/jnls/go/centered_vectors.jnl
@@ -0,0 +1,77 @@
+\cancel mode verify
+! centered_vectors.jnl
+! 4/94
+! updated 9/96 for Ferret V4.4 -- default PLOT/vs is now symbols
+
+! Description: Vector plot with coords at vector midpoints
+
+! Usage:
+
+!    GO centered_vectors VECTOR/[quals] U V half_inch_value ["clock"] ["stick"]
+! 1 command	   - VECTOR with optional /OVERLAY, /TITLE, /NOLAB
+!		   Note: other qualifiers will not function properly (see note)
+! 2 U              - expression for the U component
+! 3 V              - expression for the V component
+! 4 haf_inch_value - the scale value - value of a 1/2 inch vector
+! 5 arrow center   - "clock" for clock-hand vectors or "centered" [default]
+! 6 arrow head     - "stick" for no head or "head" [default]
+
+! Note: To achieve the effects of /XSKIP and /YSKIP requires regridding
+!	see example below
+
+! example:
+!	yes? SET DATA  monthly_navy_winds
+!	yes? SET REGION/L=1/X=130E:80W/Y=10S:30N
+!	yes? GO centered_vectors vector uwnd vwnd 10	! centered with heads
+!	yes? GO centered_vectors vector/title=test uwnd vwnd 10 " " stick
+
+! or to get /XSKIP and /YSKIP functionality use regridding:
+!	yes? SET REGION/X=50E:0/Y=80S:80N     ! too many vectors
+!	yes? DEFINE AXIS/X=50E:0/NPOINTS=50/UNIT=DEGREE xskip
+!	yes? DEFINE AXIS/Y=80S:80N/NPOINTS=40/UNIT=DEGREE yskip
+!	yes? DEFINE GRID/LIKE=uwnd/X=xskip/Y=yskip gskip
+!	yes? GO centered_vectors vector uwnd[G=gskip] vwnd[G=gskip] 10
+
+! check for required filename and haf_inch_value and valid style
+QUERY/IGNORE $1%<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $2%<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $3%<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $4%<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $5%0|centered|clock|center|<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $6%0|stick|head|<Usage: GO centered_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+
+! set up the PLOT+ environment so that the scalings, etc. are known
+$1/ASPECT/LENGTH=$4/XSKIP=1/YSKIP=1 $2-$2, $3-$3
+
+! Write the given vector fields to a properly formatted file
+! Each file record contains x,y,u,v
+! The sequence of x,y, coordinates need not represent a grid
+! The file must have a 0,0,0,0 record on the end or the last vector
+! will be truncated
+
+! initialize
+SET GRID/SAVE
+cancel data/noerr custom_vectors.dat
+sp rm -f custom_vectors.dat    ! sometimes this doesn't work ???
+sp rm -f custom_vectors.dat
+
+! define variable with known missing flag and in case an expression was passed
+LET/QUIET uexpr = missing($2,-9999.)
+LET/QUIET vexpr = missing($3,-9999.)
+LOAD uexpr,vexpr    	! this computes the grid so SET GRID will work reliably
+SET GRID uexpr
+
+! list the data to a file - grid structure buried in X,Y coordinates
+! add a line of zeros at the end because the
+! regridding operation needs to be able to interpolate
+LIST/NOHEAD/FILE=custom_vectors.dat/FORMAT=(4(1PG15.7)) X, Y, uexpr, vexpr
+sp echo "0 0 0 0" >> custom_vectors.dat   ! 0 length vector at end
+
+! prepare to use data from file
+SET GRID/restore
+
+! now use another tool to do all the work
+GO scattered_vectors custom_vectors.dat $4 $5"centered" $6"head"
+PLOT/VS/LINE/D=custom_vectors.dat/@aros/nolab/overlay arrow_x,arrow_y
+
+set mode/last verify
diff --git a/jnls/go/cleanup_text.jnl b/jnls/go/cleanup_text.jnl
new file mode 100644
index 0000000..dc2c2a9
--- /dev/null
+++ b/jnls/go/cleanup_text.jnl
@@ -0,0 +1,13 @@
+\cancel mode verify
+! cleanup_text.jnl  (4/93)
+
+! Description: cleanup FERRET and PLOT+ settings following GO setup_text
+
+! this block of code resets the PLOT+ environment following "GO setup_text"
+! updated 10/93 for Ferret V3.01
+
+ppl axset 1,1,1,1
+ppl origin 1.2,1.4
+cancel viewport     ! forces reset of axis lengths
+
+set mode/last verify
diff --git a/jnls/go/climatological_axes.cdf b/jnls/go/climatological_axes.cdf
new file mode 100644
index 0000000..3f326ad
Binary files /dev/null and b/jnls/go/climatological_axes.cdf differ
diff --git a/jnls/go/convert_to_fnoc_2d.jnl b/jnls/go/convert_to_fnoc_2d.jnl
new file mode 100644
index 0000000..35ccefa
--- /dev/null
+++ b/jnls/go/convert_to_fnoc_2d.jnl
@@ -0,0 +1,49 @@
+\cancel mode verify
+! 2/94 - convert_to_fnoc_2d.jnl
+
+! Description: extract (sample) lat/lon data onto the FNOC polar grid
+
+! Note: the variable "polar_rotation" needs to be pre-defined
+
+! usage:   GO convert_to_fnoc_2d variable [fill] [file]
+
+! 	     variable:  variable or expression to be plotted.
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! (optional) fill:	Either FILL or HOLE(default) to indicate how points
+!			bordering on missing values should be treated
+! (optional) file:	name of file to receive the sampled points
+!			Default = fnoc_points.dat
+!			Note: the format of this file will be unformatted
+!			with #_points columns per record.
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO convert_to_fnoc_2d variable [HOLES] [file]%
+query/ignore $2%HOLE|FILL|HOLES|HOLE|<Argument 2 must be "FILL" or "HOLES"%
+
+! define the rotation parameter as per FNOC
+LET/quiet polar_rotation = 100
+
+! define the output grid (with #_points resolution argument)
+GO fnoc_map_grid
+
+! define the polar projection equations
+GO polar_map_inv_eqns gprojfnoc
+
+! prepare for sampling of data at polar-projecting points
+cancel data/noerror $3"fnoc_points.dat"
+sp rm -f $3"fnoc_points.dat"
+set data/save
+
+! now sample it
+user/command=sample/opt2=c/file=$3"fnoc_points.dat"/form=unf:63/opt1=$2"HOLE|FILL|HOLES|HOLE|"-STANDARD_BAD $1,polar_xdeg[x=-1:1,y=-1:1],polar_ydeg[x=-1:1,y=-1:1],1/0,1/0
+
+! now prepare to read back the results
+file/grid=gprojfnoc/var=polar/form=unf/col=63 $3"fnoc_points.dat"
+set variable/title=$1 polar
+set data/restore
+
+! message to user
+message/continue Note: Polar-projected data is variable "polar" in $3"fnoc_points.dat"
+
+set mode/last verify
diff --git a/jnls/go/convert_to_polar_2d.jnl b/jnls/go/convert_to_polar_2d.jnl
new file mode 100644
index 0000000..7ec2da5
--- /dev/null
+++ b/jnls/go/convert_to_polar_2d.jnl
@@ -0,0 +1,60 @@
+\cancel mode verify 
+! 2/94 - convert_to_polar_2d.jnl
+
+
+! NOTE: All of the *polar* journal files are superseded by the map projection 
+! capabilities of version 5.0.   Run the script  mp_demo  for an introduction.
+
+
+! Description: extract (sample) data for a 2D polar plot
+
+! Note: the variable "polar_rotation" needs to be pre-defined
+
+! usage:   GO convert_to_polar_2d variable [#_points] [fill] [file]
+
+! 	     variable:  variable or expression to be plotted.
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! (optional) #_points:	number of points on X and Y axes of the final
+!			plot (essentially, the resolution of the plot)
+!			Use #_points=63 for FNOC (?), #_points=65 for NMC (?)
+! (optional) fill:	Either FILL or HOLE(default) to indicate how points
+!			bordering on missing values should be treated
+! (optional) file:	name of file to receive the sampled points
+!			Default = polar_sampled_points.dat
+!			Note: the format of this file will be unformatted 
+!			with #_points columns per record.
+
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO convert_to_polar_2d variable [n by n points] [HOLES] [file]%
+query/ignore $3%HOLE|FILL|HOLES|HOLE|<Argument 3 must be "FILL" or "HOLES"%
+
+! define the output grid (with #_points resolution argument)
+GO projected_map_grid $2"201"
+
+! define the polar projection equations
+GO polar_map_inv_eqns gproj$2"201"
+
+! prepare for sampling of data at polar-projecting points
+cancel data/noerror $4"polar_sampled_points.dat"
+sp rm -f $4"polar_sampled_points.dat"
+set data/save
+
+! now sample it
+user/command=sample/opt2=c/file=$4"polar_sampled_points.dat"/form=unf:$2"201"/opt1=$3"HOLE|FILL|HOLES|HOLE|"-STANDARD_BAD $1,polar_xdeg[x=-1:1,y=-1:1],polar_ydeg[x=-1:1,y=-1:1],1/0,1/0
+
+! now prepare to read back the results
+file/grid=gproj$2"201"/var=polar/form=unf/col=$2"201" $4"polar_sampled_points.dat"
+set variable/title=$1 polar
+set data/restore
+
+! message to user
+message/continue Note: Polar-projected data is variable "polar" in $4"polar_sampled_points.dat"
+
+set mode/last verify
+
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/datestring.jnl b/jnls/go/datestring.jnl
new file mode 100644
index 0000000..57e591b
--- /dev/null
+++ b/jnls/go/datestring.jnl
@@ -0,0 +1,71 @@
+\CANCEL MODE verify
+! Create a Date string from numbers representing year, month, day, ...
+! the result is returned in the symbol date_symbol. Hour, minute, and
+! second are optional inputs.
+! acm 10/20/06 fix bugs: treatment of hour=0, and formatting of seconds 
+!
+!		         arg1  arg2   arg3  arg4    arg5      arg6
+! usage:   GO datestring year  month  day  [hour]  [minute]  [second]
+
+! Example:
+!          yes? go datestring 2004 1 1 12
+!              DATE_SYMBOL = "1-JAN-2004 12:00:00"
+!          yes? def sym start_date ($date_symbol)
+!          
+!          yes? go datestring 2004 11 1
+!              DATE_SYMBOL = "1-NOV-2004"
+!          yes? def sym end_date ($date_symbol)
+!          
+!          yes? define axis/t="($start_date)":"($end_date)":1/t0="($start_date)" tax
+
+! Check inputs. First 3 are required
+
+QUERY/IGNORE $1%<Usage: GO datestring year month  day  [hour]  [minute]  [second]%
+QUERY/IGNORE $2%<Usage: GO datestring year month  day  [hour]  [minute]  [second]%
+QUERY/IGNORE $3%<Usage: GO datestring year month  day  [hour]  [minute]  [second]%
+
+LET DS_year = $1
+LET DS_nmon = $2
+LET DS_day = $3
+
+LET DS_hour = $4"-99"
+LET DS_min = $5"0"
+LET DS_sec = $6"0"
+
+LET DS_months = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}
+
+
+LET DS_str1 = strcat("`DS_day`", "-")
+LET DS_str2 = strcat(DS_str1, DS_months[i=`DS_nmon`])
+LET DS_str3 = strcat(DS_str2,"-")
+LET DS_str4 = strcat(DS_str3,"`DS_year`")
+LET date_string = DS_str4
+
+!IF `DS_hour GT 0` THEN
+IF `DS_hour GE 0` THEN
+   LET DS_str5 = strcat(DS_str4," ")
+   IF `DS_hour LT 10` THEN LET DS_str5 = strcat(DS_str4," 0")
+   LET DS_str6 = strcat(DS_str5, "`DS_hour`")
+   LET date_string = DS_str6
+
+   IF `DS_min GE 0` THEN
+      LET DS_str7 = strcat(DS_str6,":")
+      IF `DS_min LT 10` THEN LET DS_str7 = strcat(DS_str6,":0")
+      LET DS_str8 = strcat(DS_str7, "`DS_min`")
+      LET date_string = DS_str8
+
+
+      IF `DS_sec GE 0` THEN
+         LET DS_str9 = strcat(DS_str8,":")
+         IF `DS_sec LT 10` THEN LET DS_str9 = strcat(DS_str8,":0")
+         LET DS_str10 = strcat(DS_str9, "`DS_sec`")
+         LET date_string = DS_str10
+
+      ENDIF
+   ENDIF
+ENDIF
+
+define symbol date_symbol = `date_string`
+show symbol date_symbol
+
+can var DS_*
diff --git a/jnls/go/digitize.jnl b/jnls/go/digitize.jnl
new file mode 100644
index 0000000..000a134
--- /dev/null
+++ b/jnls/go/digitize.jnl
@@ -0,0 +1,127 @@
+\cancel mode verify
+! digitize.jnl
+! 7/99 *sh*
+
+! Description: Click cursor on plot -- get value or surrounding block
+
+! Note that the output position is available in the symbols
+! ($xmouse) and ($ymouse) given in the units of the coordinate axes of the plot
+! The digitized value is available in the symbol ($digitized)
+
+! Usage:                $1            $2           $3        $4
+! yes?  GO digitize expression ["nearest" or n] [format] [output_file]
+! $1 - supply the same expression that is on the plot (see note, below)
+! $2 - [optional] output may be
+!	"interpolate" - value at exact cursor location [DEFAULT]
+!	"nearest"     - value of the grid cell containing cursor
+!	n - an integer indicating a spread of data surrounding the point
+! $3 - [optional] - if "brief" just the digitized value will be displayed
+!		    if "quiet" the digitized output will not be displayed
+!		    if "full"  the LIST command is used to display the output
+! $4 - [optional] name of output file
+
+!	Note: if region qualifiers were given on the plotting commend, then
+!		those regions must be enclosed in square brackets on the
+!		expression.
+!	        For example, if the plotting command was
+!			yes? PLOT/Y=0 SST
+!		then the expression must be "SST[Y=0]"
+
+
+! example
+!	yes? USE coads_climatology
+!	yes? SHADE SST[L=1]
+!	yes? GO digitize SST[L=1]		! get one grid point value
+!	yes? SAY ($digitized)			! see the value
+!	yes? GO digitize SST[L=1] nearest	! get actual grid point value
+!	yes? GO digitize SST[L=1] 2		! see a block of 5x5 points
+!	yes? GO digitize SST[L=1] interpolate brief 	    ! brief format
+!	yes? GO digitize SST[L=1] interpolate brief out.dat ! output to file
+
+! save the input expressions into simple variable definitions
+LET/QUIET DGTexpr = $1%<usage: GO digitize expression ["interpolate" "nearest" or n] ["full" "brief" or "quiet"] [out_filename]%
+IF $2"1|nearest>0|interpolate>1|interp>1|*>0" THEN
+  DEFINE SYMBOL DGTinterp @ITP
+ELSE
+  CANCEL SYMBOL DGTinterp	! effectly a blank symbol
+ENDIF
+DEFINE SYMBOL DGTblock $2"0|nearest>0|interpolate>0|interp>0|*>1"
+DEFINE SYMBOL DGTquiet $3"0|quiet>1|*>0"
+DEFINE SYMBOL DGTbrief_verify $3"0|brief>1|*>0|"	! default
+DEFINE SYMBOL DGTfull_verify  `1-($DGTbrief_verify)`	! default
+IF ($DGTblock) THEN
+  DEFINE SYMBOL DGTbrief_verify 1
+  DEFINE SYMBOL DGTfull_verify  0
+ENDIF
+IF ($DGTquiet) THEN
+  DEFINE SYMBOL DGTbrief_verify 0
+  DEFINE SYMBOL DGTfull_verify  0
+ENDIF
+
+! determine the orientation of the data (and check if it is 1D or 2D)
+DEFINE SYMBOL DGTdims `DGTexpr,return=shape`
+DEFINE SYMBOL DGTndim ($DGTdims"|X>1|Y>1|Z>1|T>1|XY>2|XZ>2|XT>2|YZ>2|YT>2|ZT>2|<error: expression is not plottable -- 1D or 2D")
+IF `($DGTndim) EQ 2` THEN
+  DEFINE SYMBOL DGTax1 ($DGTdims"|XY>X|XZ>X|XT>X|YZ>Y|YT>Y|ZT>Z|")
+  DEFINE SYMBOL DGTax2 ($DGTdims"|XY>Y|XZ>Z|XT>T|YZ>Z|YT>T|ZT>T|")
+ENDIF
+
+! get the digitized location on the plot
+WHERE
+
+! get the value from the given expression and return in symbol ($digitize)
+! e.g. (1d) DGTexpr[X=133.25 at ITP] or (2d) DGTexpr[X=55.3,Y=13.9]
+IF `($DGTndim) EQ 1` THEN
+  LET/QUIET DGTresult = DGTexpr[($DGTdims)=($xmouse)($DGTinterp)]
+  DEFINE SYMBOL digitize `DGTresult,p=7`
+ELSE
+  LET/QUIET DGTresult = DGTexpr[($DGTax1)=($xmouse)($DGTinterp),($DGTax2)=($ymouse)($DGTinterp)]
+  DEFINE SYMBOL digitize `DGTresult,p=7`
+ENDIF
+
+! report result - either in brief style or full [default] style
+IF ($DGTbrief_verify) THEN 
+  IF `($DGTndim) EQ 1` THEN
+      SAY "Value=($digitize)  X=($xmouse)"
+      IF $4"0|*>1" THEN SPAWN echo "($digitize),($xmouse)" >> $4%??%
+  ENDIF
+  IF `($DGTndim) EQ 2` THEN
+    SAY "Value=($digitize)  X=($xmouse)  Y=($ymouse)"
+      IF $4"0|*>1" THEN SPAWN echo "($digitize),($xmouse),($ymouse)" >> $4%??%
+  ENDIF
+ENDIF
+IF ($DGTfull_verify) THEN
+  LIST/PREC=7 DGTresult
+  IF $4"0|*>1" THEN LIST/APPEND/PREC=7/QUIET/FILE="$4%??%" DGTresult
+ENDIF
+
+! show a block of surrounding points ?
+! procedure: LET ipos = I[X=xmouse]; LIST expr[I=ipos-width:ipos+width]
+IF  $2"0|nearest>0|interpolate>0|interp>0|*>1" THEN
+  LET/QUIET DGTgrid = MISSING(DGTresult,0)
+  DEFINE SYMBOL DGTwidth $2
+  IF `($DGTndim) EQ 1` THEN
+    DEFINE SYMBOL DGTiax ($DGTdims"|X>I|Y>J|Z>K|T>L|")
+    LET/QUIET ipos = 0*DGTgrid + ($DGTiax)[($DGTdims)=($xmouse)]
+    DEFINE SYMBOL DGTilo `ipos - $2`
+    DEFINE SYMBOL DGTihi `ipos + $2`
+    LIST/PREC=7 DGTexpr[($DGTiax)=($DGTilo):($DGTihi)]
+    IF $4"0|*>1" THEN LIST/APPEND/PREC=7/QUIET/FILE="$4%??%" DGTexpr[($DGTiax)=($DGTilo):($DGTihi)]
+  ENDIF
+  IF `($DGTndim) EQ 2` THEN
+    DEFINE SYMBOL DGTiax1 ($DGTax1"|X>I|Y>J|Z>K|T>L|")
+    DEFINE SYMBOL DGTiax2 ($DGTax2"|X>I|Y>J|Z>K|T>L|")
+    LET/QUIET ipos =  0*DGTgrid + ($DGTiax1)[($DGTax1)=($xmouse)]
+    LET/QUIET jpos =  0*DGTgrid + ($DGTiax2)[($DGTax2)=($ymouse)]
+    DEFINE SYMBOL DGTilo `ipos - $2`
+    DEFINE SYMBOL DGTihi `ipos + $2`
+    DEFINE SYMBOL DGTjlo `jpos - $2`
+    DEFINE SYMBOL DGTjhi `jpos + $2`
+    LIST/PREC=7 DGTexpr[($DGTiax1)=($DGTilo):($DGTihi),($DGTiax2)=($DGTjlo):($DGTjhi)]
+    IF $4"0|*>1" THEN LIST/APPEND/PREC=7/QUIET/FILE="$4%??%" DGTexpr[($DGTiax1)=($DGTilo):($DGTihi),($DGTiax2)=($DGTjlo):($DGTjhi)]
+  ENDIF
+ENDIF
+
+cancel symbol DGT*
+cancel variable DGT*
+set mode/last verify
diff --git a/jnls/go/dynamic_height.jnl b/jnls/go/dynamic_height.jnl
new file mode 100644
index 0000000..aeff25b
--- /dev/null
+++ b/jnls/go/dynamic_height.jnl
@@ -0,0 +1,54 @@
+cancel mode verify      ! defining dynamic height terms
+! dynamic_height.jnl
+! updated 10/93 for Ferret V3.01
+! Description:  Define FERRET variables for dynamic height calculations
+
+say *** INSTRUCTIONS:
+say 1) Use LET to define three variables:
+say dyn_S   -   your salinity          (PPT/1000 - 1)
+say dyn_T   -   your temperature       (degrees C)
+say dyn_P   -   your pressure          (millibars) (or depth in meters)
+say note: if you use "Z" for pressure use the G= syntax e.g. Z[G=TEMP]
+say       so that FERRET knows which Z axis to use
+say   
+say
+say 2) Use the SET REGION command to specify the depth of zero motion
+say e.g. SET REGION/Z=0:1000 to set 1000 meters as the zero motion depth
+say
+say 
+say 3) Results will be available as the following LET variables:
+say Result                         XY plane    XZ or YZ plane
+say ---------                      --------    --------------
+say Dynamic height (dynamic cm)     DYN_HT        DYN_HTz
+say Geostriphic velocity(cm/sec)  GEO_U,GEO_V   GEO_Uz,GEO_Vz
+say 
+say 4) Examples: yes? CONTOUR/X=160e:160w/y=10s:10n DYN_HT   <-- in the XY plane 
+say or           yes? CONTOUR/X=180/Y=10S:10n DYN_HTz        <-- in the YZ plane
+say The difference in dynamic height between two depths (pressure levels)
+say may be expressed as e.g. z=500m to 1000m --> DYN_HT[Z=500:1000]
+
+! description of calculation used:
+!
+! dynamic ht = INTEGRAL[ SVanom dZ ]
+! where SVanom = SV - SV(35,0,0)
+! and SV = 1/RHO, the specific volume
+! Z in meters or decibars
+
+! geostrophic velocity is given by 
+! Ug = -10/f d/dy(D)
+! Vg =  10/f d/dx(D)
+! where f is 2*OMEGA*SIN(latitude), OMEGA = 2*3.14159/86164 = 7.29212E-5 s-1
+
+let SVanom = 1/rho_UN(dyn_s,dyn_t,dyn_p) - 1/rho_UN(35,0,dyn_p)
+! 8/99 *kob* bug fix temp was incorrectly being used in dyn_mask
+! definition.  Pointed out by Russel Fiedler
+let dyn_mask = if dyn_t[z=@nbd] eq 0 then 1
+let/title="Dynamic Height(dyn-cm)" DYN_HT  = 1E5 * dyn_mask * SVanom[z=@din]
+let/title="Dynamic Height(dyn-cm)" DYN_HTz = 1E5 * dyn_mask * (SVanom[z=@din]-SVanom[z=@iin])
+let/title="Geostrophic U (cm/sec)" GEO_U = -10/(1.458424E-4*SIN(Y/57.29578)) * DYN_HT[Y=@DDC]
+let/title="Geostrophic V (cm/sec)" GEO_V =  10/(1.458424E-4*SIN(Y/57.29578)) * DYN_HT[X=@DDC]
+let/title="Geostrophic U (cm/sec)" GEO_Uz = -10/(1.458424E-4*SIN(Y/57.29578)) * DYN_HTz[Y=@DDC]
+let/title="Geostrophic V (cm/sec)" GEO_Vz =  10/(1.458424E-4*SIN(Y/57.29578)) * DYN_HTz[X=@DDC]
+
+set mode/last verify
+
diff --git a/jnls/go/ellipse.jnl b/jnls/go/ellipse.jnl
new file mode 100644
index 0000000..283d416
--- /dev/null
+++ b/jnls/go/ellipse.jnl
@@ -0,0 +1,42 @@
+\cancel mode verify
+! ellipse.jnl - draw an ellipse inscribed in the indicated corners
+! 8/94
+
+! Description: Overlay an ellipse outline from inscribing rectangle coordinates
+
+! usage:  GO ellipse xlo xhi ylo yhi [pen_number]
+! 	   (arguments identical to GO box)
+
+! Notes:
+!  1) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+
+! test pen_number before performing any actions
+query/ignore $1%<Usage: GO ellipse xlo xhi ylo yhi [pen_number]%
+query/ignore $2%<Usage: GO ellipse xlo xhi ylo yhi [pen_number]%
+query/ignore $3%<Usage: GO ellipse xlo xhi ylo yhi [pen_number]%
+query/ignore $4%<Usage: GO ellipse xlo xhi ylo yhi [pen_number]%
+query/ignore $5%1|red>1|green>1|blue>1|thick>1|0>1|1>1|2>1|3>1|4>1|5>1|6>1|7>1|8>1|9>1|10>1|11>1|12>1|13>1|14>1|15>1|16>1|17>1|18>1|<GO ellipse xlo xhi ylo yhi pen with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+LET/QUIET xellipse_axis = ($2) - ($1)
+LET/QUIET yellipse_axis = ($4) - ($3)
+LET/QUIET xellipse_center = (($2)+($1))/2
+LET/QUIET yellipse_center = (($4)+($3))/2
+LET/QUIET ellipse_theta = i * (6.29/100)   ! just over 2 PI in 100 points
+LET/QUIET xellipse = xellipse_axis/2 * COS(ellipse_theta) +  xellipse_center
+LET/QUIET yellipse = yellipse_axis/2 * SIN(ellipse_theta) +  yellipse_center
+
+! set up PLOT+
+! Note: The "line=" could be used to specify the line style but the command
+!       gets too ungainly to read
+PLOT/VS/NOLAB/OVER/line=1/SET_UP/I=1:101  xellipse, yellipse
+
+! select line style
+ppl pen 1,$5"1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! plot it
+PPL PLOT/OVERLAY
+
+! clean up
+ppl pen 1,1
+set mode/last verify
diff --git a/jnls/go/error_bars.jnl b/jnls/go/error_bars.jnl
new file mode 100644
index 0000000..3f45177
--- /dev/null
+++ b/jnls/go/error_bars.jnl
@@ -0,0 +1,103 @@
+\cancel mode verify
+! error_bars.jnl
+! 6/99 *sh*
+! 7/01 *acm* update /xlimits to /hlimits
+
+! Description: Overlay error bars on a plot
+
+! Usage:                   $1       $2   $3       $4           $5
+! yes?  GO error_bars plot_command base errors [err_down] ["transpose"]
+! $1 - the plot command with qualifiers (eg PLOT/VS/OVER/LINE=2)
+! $2 - underlying points to be marked with error bars
+! $3 - error values associated with points (or error limit above)
+! $4 - [optional] error limit below (if different that $4)
+! $5 - [optional] "transpose" to interchange X and Y axes
+
+! examples
+!         demo script has more examples
+!       yes? go error_bars_demo
+
+! 1) Define synthetic data
+
+!	yes? let xpts = j[j=1:5]
+!	yes? let ypts = sin(xpts)
+!	yes? let errup = 0.6 * RANDU(xpts)
+!	yes? let errdn = 0.6 * RANDU(xpts+1)
+!
+!	yes? plot/hlimits=0:6/vlimits=-2:2/vs/line xpts, ypts
+!	yes? GO error_bars poly/line=2 ypts errup 
+
+!       yes? GO error_bars poly/line=3 ypts errup errdn
+
+
+! 2) Use a data set, but create some dummy error numbers
+!
+! Note that if using transformations to create a 1-dimensional variable
+! from a multi-dimensional variable, the limits must be made explicitly.
+! sst[x=@ave,y=@ave] would cause this script to fail where it uses the 
+! `var,return=shape` syntax.
+
+!	yes? use coads_climatology
+!       yes? let sst_ave = sst[x=0:360 at ave,y=-60:60 at ave]
+!       yes? let errup = 0.1 + 0*sst_ave
+!       yes? let errdn = 0.2 + 0*sst_ave
+!
+!	yes? plot sst_ave
+!	yes? GO error_bars poly/line=2 sst_ave, errup, errdn
+
+! argument check
+QUERY/IGNORE $1%<usage: yes? GO error_bars plot_command base errors [err_down] ["transpose"]%
+QUERY/IGNORE $2%<usage: yes? GO error_bars plot_command base errors [err_down] ["transpose"]%
+QUERY/IGNORE $3%<usage: yes? GO error_bars plot_command base errors [err_down] ["transpose"]%
+
+! save the input expressions into simple variable definitions
+LET/QUIET ERBy = ($2)
+LET/QUIET ERBerr_up = ($3)
+IF $4"0|*>1" THEN
+   LET/QUIET ERBerr_dn = ($4)
+ELSE
+   LET/QUIET ERBerr_dn = ERBerr_up
+ENDIF
+DEFINE SYMBOL ERBis_transposed  $5"0|*>1"
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL ERBax `ERBy,return=shape`
+DEFINE SYMBOL ERBbar_dim ($ERBax"|PT>Z|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a point or line")
+DEFINE SYMBOL ERBiax ($ERBax"|X>i|Y>j|Z>k|T>l")
+
+! get the dependent coordinates -- needed since POLYGON is like PLOT/VS
+! typically, "0*ERBy + X[i=lo:hi]", so X is inherited from ERBy
+DEFINE SYMBOL ERBilo `ERBy,return=($ERBiax)start`
+DEFINE SYMBOL ERBihi `ERBy,return=($ERBiax)end`
+LET/QUIET ERBx_raw =  0*ERBy + ($ERBax)
+LET/QUIET ERBx = ERBx_raw[($ERBiax)=($ERBilo):($ERBihi)]
+
+! Z axis plots have a reversed sense of "transposed"
+IF ($ERBax"|Z>1|*>0") THEN
+   DEFINE SYMBOL ERBis_transposed  ($ERBis_transposed"|0>1|1>0")
+ENDIF
+IF ($ERBis_transposed) THEN
+   DEFINE SYMBOL ERBtranspz "/transpose"
+ELSE
+   CANCEL SYMBOL ERBtranspz
+ENDIF
+
+! determine the orientation for the error bar coordinates
+LET/QUIET ERBxbar = ($ERBbar_dim)SEQUENCE({0,0,-1,1,0})
+LET/QUIET ERBybar = ($ERBbar_dim)SEQUENCE({0,1, 1,1,1})
+
+! scale the "T" on the error bar based on the  to data ...
+! NOTE: define the symbol "IbeamWidth" to control the cross bar
+IF ($ERBtranspz"0|*>1) THEN
+   LET/QUIET ERBwidth = ($IbeamWidth".005") * (($YAXIS_MAX"1")-(($YAXIS_MIN"0")))
+ELSE
+   LET/QUIET ERBwidth = ($IbeamWidth".005") * (($XAXIS_MAX"1")-(($XAXIS_MIN"0")))
+ENDIF
+
+$1($ERBtranspz"/over")/over/coord=($ERBbar_dim)) ERBx+ERBxbar*ERBwidth,ERBy+ERBerr_up*ERBybar
+$1($ERBtranspz"/over")/over/coord=($ERBbar_dim)/NOLABEL ERBx+ERBxbar*ERBwidth,ERBy-ERBerr_dn*ERBybar
+
+
+cancel symbol ERB*
+cancel variable ERB*
+set mode/last verify
diff --git a/jnls/go/exact_colors.jnl b/jnls/go/exact_colors.jnl
new file mode 100644
index 0000000..7d937a4
--- /dev/null
+++ b/jnls/go/exact_colors.jnl
@@ -0,0 +1,85 @@
+\cancel mode verify
+! exact_colors.jnl  *sh* 5/93
+! updated 10/93 for Ferret V3.01
+! fixed error in "SET MODE/LAST VERIFY" 12/95
+
+! Description: Setup FERRET and PLOT+ to modify single SHADE or CONT colors
+
+say For detailed instructions examine the file  $FER_DIR/go/exact_colors.jnl
+
+! Usage:   GO exact_colors #_of_colors  [input_spectrum] [output_filename]
+! sample:  GO exact_colors 12 rnb rnb12.save
+! defaults:  input_spectrum = default.spk   output_filename = exact_colors.spk
+
+! The colors specified with the PLOT+ SHASET command (& w/ spectrum files)
+! define points in an abstract color space that runs from 0 to 100 percent.
+! The actual colors used by SHADE or FILL are determined by dividing this
+! abstract color scale into n equal percentage increments, where n is the
+! number of colors, and linearly interpolating between the SHASET values.
+
+! exact_colors.jnl determines the actual RGB values for each SHADE or FILL
+! color and writes those results to exact_colors.spk (or the specified output
+! file).  The command "PALETTE exact_colors" is then used to make
+! those colors the current SHASET values thereby eliminating the abstraction
+! of the color scale.  Thereafter modifying any individual SHASET color will
+! change only one unique SHADE or FILL color on the display.
+
+! FERRET example 1:
+!	yes? SET DATA levitus_climatology	! distributed with ferret
+!	yes? SET REGION/Z=0/Y=60S:60N
+!	yes? SHADE/lev=(0,30,2) temp   ! 15 colors (16 levels)
+!	yes? GO exact_colors 15        ! (saves results in exact_colors.spk)
+!	yes? PPL LIST SHASET           ! notice there are 15 shaset points
+!	yes? PPL SHASET 50 100 100 100 ! change one of the colors to white
+!	
+! FERRET example 2:
+!       If you use the qualifier /PALETTE= to control the colors of a plot
+!	FERRET changes the SHASET colors only for the moment of the plot.  As
+!	soon as the plot is on the screen FERRET "protects" the colors on 
+!	screen and restores the previous SHASET colors.  If you wish to
+!	modify the colors on the screen after this you must "unprotect"
+!	them with
+!		yes? PPL SHASET RESET
+! e.g.
+!	yes? SET DATA levitus_climatology
+!	yes? SET REGION/Z=0/Y=60S:60N
+!	yes? SHADE/lev=(0,30,2)/PALETTE=greyscale temp
+!	yes? GO exact_colors 15 greyscale	! spectrum file "greyscale.spk"
+!	yes? PPL LIST SHASET
+!	yes? PPL SHASET RESET			! unprotect the colors
+!	yes? PPL SHASET 50.0 100 0 0            ! change one a color to red
+
+alias argcheck "CANCEL EXPRESSION"        ! a no-op used to check arguments
+argcheck $1"<Must specify number of colors on screen.  Usage:GO exact_colors n"
+
+cancel region/x
+
+! read the specified input spectrum name (Default:$FER_PALETTE/default.spk)
+! using its "percentage" variable as the data set axis
+file/var=pcentin,redin,greenin,bluein "$FER_PALETTE/$2&default&.spk"
+define axis/from/x/name=axin pcentin
+define grid/x=axin  gin
+cancel data/noerr $2&default&.spk
+file/var=pcentin,redin,greenin,bluein/grid=gin "$FER_PALETTE/$2&default&.spk"
+
+! number of desired colors 
+let percent = 100*(i-1)/($1-1) 
+
+! split the 0 to 100% range into n equally-spaced regions
+! using g=gout linear-interpolation regridding
+define axis/from/x/name=axout percent[i=1:$1]
+define grid/x=axout gout
+let pcentout = x[g=gout]
+let redout   = redin[g=gout]    ! linear interpolation
+let greenout = greenin[g=gout]  ! linear interpolation
+let blueout  = bluein[g=gout]   ! linear interpolation
+
+spawn rm -f $3"exact_colors.spk"
+! note: output precision restricted to 1 decimal place consistent with PLOT+ 
+list/file=$3"exact_colors.spk"/nohead/format=(4F10.1)/i=1:$1 pcentout,redout,greenout,blueout
+
+ppl shaset spectrum=$3"exact_colors.spk"
+
+cancel data/noerr $2&default&.spk
+set mode/last verify
+
diff --git a/jnls/go/extremum.jnl b/jnls/go/extremum.jnl
new file mode 100644
index 0000000..baec249
--- /dev/null
+++ b/jnls/go/extremum.jnl
@@ -0,0 +1,46 @@
+\cancel mode verify
+! extremum.jnl - annotate an extremum for a region on a plot 
+! 3/96
+
+! Description: Annotate an extremum for a region on a plot 
+
+! arg no.:                1         2        3         4         5      6
+! usage:  GO extremum min_or_max variable "X=lo:hi" "Y=lo:hi" [size] [delta]
+ 
+! where
+!          min_or_max is "MIN" or "MAX" as desired
+!          variable   is the expression that has been contoured
+!          X=lo:hi    is the X range over which to locate the extremum
+!          Y=lo:hi    is the Y range over which to locate the extremum
+!          size       is the label size for the extremum value [default=0.15]
+!          delta      is the distance above the extrema to locate the label
+
+! example: mark the sea level pressure maximum in the N. Pacific
+!          SET DATA coads_climatology
+!          ! GO graticule             ! optional - helps to locate extrema
+!          SHADE/L=1/LEVELS=40 slp
+!          GO extremum MAX "slp[l=1]" x=170w:110w y=20N:40N 0.15 2
+
+! Note: this quick and dirty version is suitable only for 2D plots in the
+! XY plane. Extension to other planes is straightforward. 
+
+! the user must specify "min" or "max"
+QUERY/IGNORE this $1%|MIN|MAX|<Usage: GO extremum "min"_or_"max" variable "X=lo:hi" "Y=lo:hi" [text_size]%
+
+! define a variable with the expression currently on the plot
+LET/quiet field = $2%<Usage: GO extremum min_or_max variable "X=lo:hi" "Y=lo:hi" [text_size]%
+
+let extremum = field[$3@$1,$4@$1]      ! becomes field[X=lo:hi at MAX,Y=lo:hi at MAX]
+LET/quiet field0 = field - extremum
+LET/quiet xlocs = field0[$3 at loc:0]     ! becomes X=lo:hi at loc:0
+LET/quiet ylocs = field0[$4 at loc:0]
+
+! put a plot mark over the maximum
+PLOT/VS/OVER/NOLABEL/SYM=2 `xlocs[$4 at ave]`,`ylocs[$3 at ave]`
+
+! label the maximum (place label above the mark)
+LABEL `xlocs[$4 at ave]`,`ylocs[$3 at ave]+$6"0"`,0,0,$5".15" "@CR`extremum`"
+
+! clean up
+SET MODE/LAST VERIFY
+
diff --git a/jnls/go/fft2drun.jnl b/jnls/go/fft2drun.jnl
new file mode 100644
index 0000000..a8eb036
--- /dev/null
+++ b/jnls/go/fft2drun.jnl
@@ -0,0 +1,84 @@
+! fft2drun.jnl 06/00
+! Description: computes and plots running power spectrum for variable "specvar"
+! Usage: go fft2drun "plot title" "Taxis" "tlo:thi:dt" window
+!
+! where;
+!1			-plot title
+!2	Taxis 		-the name of the input /T axis for specvar
+!3	tlo:thi:dt 	-is the time axis specification for the running power 
+!			 spectrum, and must not have more than 1100 grid points
+!			 (or memory limits will be hit)
+!4	window 		- (half window length)/dt
+!
+! Example: to plot running power spectrum of "myvar" with 200 gridpoint wide window
+!    for the time range of -2000 to -2 and where myvar has the time axis "Tw"
+!
+!	yes? Let specvar=myvar
+!	yes? Go fft2drun "my title" "Tw" "-2000:-2:2" 100
+!
+! Output: can use routine within the script with adjusted ranges and annotation
+! or else can use "series_fft*series_fft" with one's own plot routine
+! Note might need to modify smoothing of specvar within script ("let wtser...")
+!----------------------------------------------------------
+\cancel mode verify
+define region/default save
+set grid/save
+
+set memory/size=5.
+
+define axis/T=$3 lyear
+define axis/z=$3 lag_axis
+
+
+let wT = T[gt=lyear]
+let Tinv = T[gt=$2]
+let wL = L[gt=lyear]
+let NT = wT[l=@ngd]
+let NTin = Tinv[l=@ngd]
+
+let wtser=specvar[L=1:`NTin`@SBX:5] !smooth time series, MODIFY as needed
+let vts = wtser[gt=lyear]
+
+set view upper
+plot /tit="smoothed time series" vts
+
+DEFINE GRID /T=lyear gly
+
+let p= t[gt=lyear]
+let q=vts
+set grid q
+go regresst
+list rsquare
+
+
+Let wts=vts-qhat !linearly detrend timeseries
+
+set view lower
+plot /tit="detrended time series" wts
+pause
+can view
+
+! define a lag axis and a 2D version of the time series with a running window
+let window = $4
+let lag = K[gz=lag_axis] - 1
+let tseries_2d = IF (lag LT wl+window) and (wl LT lag + window) then wts ELSE 0
+
+! take the full FFT
+let series_fft = ffta(tseries_2d[l=1:`NT`]) 
+
+!set mode meta
+set region /Z=-1800:-200/T=0:0.06 !MODIFY as required
+fill /set_up  /transp series_fft*series_fft
+go remove_logo
+PPL LIST LABELS
+GO unlabel 4
+ppl ylab Frequency (cycles/kyr)
+ppl xlab Time (kyr)
+ppl title, "$1"
+ppl fill
+LABEL -1000,0.064,0,0,0.3 @C13 Running Power Spectrum
+!can mode meta
+
+set region save
+set grid/restore
+set mode/last verify
diff --git a/jnls/go/find_bullseye.jnl b/jnls/go/find_bullseye.jnl
new file mode 100644
index 0000000..9b07f9d
--- /dev/null
+++ b/jnls/go/find_bullseye.jnl
@@ -0,0 +1,101 @@
+\cancel mode verify
+! find_bullseye.jnl
+
+! Description: find bullseye when told if max or min (subroutine)
+! Note: this is a subroutine of bullseye.jnl
+
+! created 4/29/97
+
+! Usage:		arg 1	2   3   4    5         6	
+!	GO bullseye expression xpt ypt xwid ywid "MIN" or "MAX"
+
+!  arg 1 (expression)	- name of variable or expression with bullseye
+!  arg 2 (xpt)		- approximate X location of bull's eye
+!  arg 3 (ypt)		- approximate Y location of bull's eye
+!  arg 4 (xwid)		- width of X box to search
+!  arg 5 (ywid)		- width of Y box to search
+!  arg 6 (MIN or MAX)	- look for local "MIN" or "MAX"
+
+! example:
+!	yes? USE ocean_atlas_annual
+!	yes? GO find_bullseye po4[k=1] 175e 50n 10 10 MAX
+!	yes? show symbol success
+!	yes? show symbol failure_reason
+
+! test validity of arguments
+query/ignore $1%<Usage: GO find_bullseye exprn Xpt Ypt xwidth ywidth MINMAX%
+query/ignore $2%<Usage: GO find_bullseye exprn Xpt Ypt xwidth ywidth MINMAX%
+query/ignore $3%<Usage: GO find_bullseye exprn Xpt Ypt xwidth ywidth MINMAX%
+query/ignore $4%<Usage: GO find_bullseye exprn Xpt Ypt xwidth ywidth MINMAX%
+query/ignore $5%<Usage: GO find_bullseye exprn Xpt Ypt xwidth ywidth MINMAX%
+query/ignore $6"|MIN|MAX|<Argument 6 must be MIN or MAX"
+
+! assign the passed arguments
+! ... the field to be examined (may have square bracket qualifiers)
+LET/QUIET arg1 = $1
+! ... convert location in degrees EWSN into lat/long ranges
+!     expressed as pure numbers (rounded to nearest 1/10 degree)
+define axis/x=-180:360:0.1/unit=longitude x_10ths
+define axis/y=-90:90:0.1/unit=latiitude y_10ths
+define sym xrng X=`X[gx=x_10ths,x=$2]-$4/2`:`X[gx=x_10ths,x=$2]+$4/2` 
+define sym yrng Y=`Y[gy=y_10ths,y=$3]-$5/2`:`Y[gy=y_10ths,y=$3]+$5/2` 
+
+! test that a valid sub-field was passed to us
+LET/QUIET field = arg1[($xrng),($yrng)]	! the rectangle of data to be examined
+define symbol shape `field,return=shape`
+IF ($shape%|XY>0|*>1) THEN
+  SAY You have passed a ($shape) region of data. You need to supply an XY region.
+  define symbol success 0
+  define symbol failure_reason Not an XY region
+  EXIT  
+ENDIF
+
+! define variables
+LET/QUIET eyeval = field[X=@$6,Y=@$6]	! the extrema within that rectangle
+LET/QUIET field0 = field - eyeval	! equals zero at the extrema
+LET/QUIET xloc_array = field0[X=@loc]	! an array in Y containing the X locn
+
+! report the result silently in symbol "success"
+! check to make sure that there is only a single bullseye in the region
+define symbol success 1   ! start by assuming success
+define symbol failure_reason No failure
+LET/QUIET num_eyes = MISSING(xloc_array[y=@ngd],0)
+IF `num_eyes EQ 0` THEN
+   define symbol success 0
+   define symbol failure_reason No bullseye in region
+ELIF `num_eyes GT 1` THEN
+   define symbol success 0
+   define symbol failure_reason Multiple bullseyes in region
+ENDIF
+
+! final check: an extremum on the box boundary is not a real extremum
+IF `($success)` THEN
+! determine the world coord and subscript position of the extrema
+  set grid/save
+  set grid field
+  LET/QUIET xloc = xloc_array[y=@sum]
+  LET/QUIET xloc_array0 = 0 * xloc_array
+  LET/QUIET yloc = xloc_array0[y=@loc]
+  define symbol xloc `xloc`
+  define symbol iloc `i[x=($xloc)]`
+  define symbol yloc `yloc`
+  define symbol jloc `j[y=($yloc)]`
+
+! make sure the extrema is not on the box boundary
+  LET/QUIET irng = I[($xrng)]
+  LET/QUIET jrng = J[($yrng)]
+  IF `irng[i=@min] EQ ($iloc) OR irng[i=@max] EQ ($iloc)` THEN
+    define symbol success 0
+    define symbol failure_reason Extremum lies on region boundary
+  ENDIF
+  IF `jrng[j=@min] EQ ($jloc) OR jrng[j=@max] EQ ($jloc)` THEN
+    define symbol success 0
+    define symbol failure_reason Extremum lies on region boundary
+  ENDIF
+  set grid/restore field
+ENDIF
+
+! clean up
+set mode/last verify
+
+
diff --git a/jnls/go/fland.jnl b/jnls/go/fland.jnl
new file mode 100644
index 0000000..ee81e38
--- /dev/null
+++ b/jnls/go/fland.jnl
@@ -0,0 +1,65 @@
+\cancel mode verify
+! fland.jnl - a land mask (overlay or "basemap" (default 20 minute resolution)
+! 4/93
+! 	 10/93 - updated for Ferret V3.01
+! 	 2/94  - added [basemap]
+! 	 11/94 - added transparent overlays and "detail" control
+!	  3/95 - added region arguments -- mostly to help point-and-click
+!	 11/96 - use patterns for transparent fills
+!        11/96 - use plot region (xaxis_min, xaxis_max) if available
+
+! Description: Plot or overlay an area-filled map of the continents
+
+! usage:       arg1        arg2        arg3          arg4      arg5      arg6
+!  GO fland [resolution] [palette] [overlay_style] [detail] [x=lo:hi] [y=lo:hi]
+
+! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=20
+!	  To use resolution "nnn" the file etoponnn must exist.
+! arg 2 - palette - may be any palette on your system.  Normally solid colors
+!		    like black, gray,red, etc. (see Fpalette '*') default=gray
+! arg 3 - overlay_style - "basemap", "transparent", or "overlay" (default)
+! arg 4 - detailed - may be "detailed", "all" or "solid"  default=solid
+!	  Use "detailed" together with a spectrum like dark_terrestrial
+!	  Use "all" to plot oceans as well as land.
+! arg 5 - longitude limits - specify as for any FERRET longitude range
+! arg 6 - latitude  limits - specify as for any FERRET latitude  range
+ 
+! examples:
+!	  GO fland 		! default - 60 minute resolution, color gray
+!	  GO fland 120		!  120 minute resolution
+!	  GO fland 5		! 5 minute resolution - caution! it's LARGE
+!	  GO fland 40 red	! 20 minute resolution with palette red.spk
+!	  GO fland 40 red basemap
+!	  GO fland 40 dark_terrestrial overlay detailed
+!	  GO fland 20 gray transparent
+!	  GO fland " " red	! default (60) minute resolution in red
+!	  GO fland 40 dark_terrestrial overlay detailed x=160e:140w y=20s:20n
+! or for a good time try
+!	SET DATA monthly_navy_winds; VECTOR/l=1 uwnd,vwnd
+!	GO fland  60 dark_terrestrial transparent detailed
+
+! Note 1: To use resolution "nnn" the file etoponnn must exist.
+! Note 2: If "basemap" is given then the current default region will determine
+!	  the region to be plotted
+! Note 3: The transparent option creates a see-through overlay land mask
+
+! check the overlay/basemap/transparent option
+query/ignore $3%overlay|overlay|basemap|transparent<3rd argument of GO fland must be "overlay", "basemap", or "transparent"%
+query/ignore $4%not_required|detailed|solid|all> <4th argument of GO basemap may be "detailed", "solid" or "all" (ocean, too)%
+
+set data/save
+
+def sym xlo_hack ($xaxis_min%0%)
+def sym xhi_hack ($xaxis_max%360%)
+def sym map_reg = [$5%x=($xlo_hack):($xhi_hack)%]
+
+
+set data etopo$1"20"
+
+
+shade/nolab/nokey/lev=$4"(0,10000,10000)|detailed>(0,200,50)(200,1000,100)(1000,10000,1000)|solid>(0,10000,10000)|all>(-200,200,50)(-1000,1000,200)(-8000,8000,1000)"/pal=$2"gray"$3"/overlay|basemap> |*>/overlay"$5" |*>/*"$6" |*>/*"$3" |transparent>/pattern=tiny_grid|*>/pattern=solid" $3"rose($map_reg)|base>rose($map_reg)|*>rose($map_reg)"
+
+cancel data etopo$1"20"
+set data/restore
+set mode/last verify
+
diff --git a/jnls/go/fnoc_2d.jnl b/jnls/go/fnoc_2d.jnl
new file mode 100644
index 0000000..66d7c00
--- /dev/null
+++ b/jnls/go/fnoc_2d.jnl
@@ -0,0 +1,44 @@
+\cancel mode verify
+! 2/94 - fnoc_2d.jnl
+
+! Description: produce a 2D polar stereographic plot
+
+! usage:  GO fnoc_2d plot_command variable [limit] [fill] [file]
+
+! plot_command:		one of "SHADE" [default], "CONTOUR", or "FILL"
+!			including qualifiers (see note below)
+! variable:		variable or expression to be plotted.
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! (optional) limit:	fraction of full region that will be displayed
+!			Default = 1 (full region).  e.g. 0.5 will display
+!			only the -.5 to .5 region from the full plot
+! (optional) fill:	Either FILL or HOLE(default) to indicate how points
+!			bordering on missing values should be treated
+! (optional) file:	name of file to receive the sampled points
+!			Default = fnoc_points.dat
+!			Note: the format of this file will be unformatted
+!			with #_points columns per record.
+
+! Note on plot command qualifiers:
+!  Use /TITLE= to annotate your plot
+!  /OVERLAY works fine
+!  /SET_UP requires manual setting and resetting of PPL tics and axlabp
+!  /X/Y/Z/T/I/J/K/L qualifiers will refer to the OUTPUT (page layout) grid
+!	not to the input (lat/long) grid		
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO fnoc_2d plot_command variable [limit] ["FILL"] [file]%
+query/ignore $2%<Use: GO fnoc_2d plot_command variable [limit] ["FILL"] [file]%
+
+! extract the data ready to plot
+GO convert_to_fnoc_2d $2 $4"HOLE" $5"fnoc_points.dat"
+
+! produce the plot
+GO box_plot $1/x=-$3"1":$3"1"/y=-$3"1":$3"1" polar[d=$5"fnoc_points.dat"]
+
+! coach the user on how to make quick replots
+MESSAGE/Cont "The following plotting command can be modified and reused:"
+MESSAGE/Cont >>>GO box_plot $1/x=-$3"1":$3"1"/y=-$3"1":$3"1" polar[d=$5"fnoc_points.dat"]
+
+set mode/last verify
diff --git a/jnls/go/fnoc_map_grid.jnl b/jnls/go/fnoc_map_grid.jnl
new file mode 100644
index 0000000..03a76b2
--- /dev/null
+++ b/jnls/go/fnoc_map_grid.jnl
@@ -0,0 +1,19 @@
+\cancel mode verify
+! 2/94 - routine used for creating a "page grid" for FNOC polar data
+
+! Description: define the map grid for the FNOC polar 63x63 grid
+
+! The grid defined by this routine refers to the plot page, itself, rather
+! than to the underlying data coordinates.  A coordinate system is defined
+! for the plot page that runs from -1 to one in both x and y with a resolution
+! determined by the argument to this script.
+
+! usage:   GO fnoc_map_grid
+
+! could define it as an irregular axis thusly:
+! define axis/x/name=fnoc63/from (i[i=1:63]-32)/31.204359
+
+define axis/x=-0.9934509:0.9934509:0.0320468 fnoc63
+define grid/x=fnoc63/y=fnoc63 gprojfnoc
+
+set mode/last verify
diff --git a/jnls/go/fnoc_verify.jnl b/jnls/go/fnoc_verify.jnl
new file mode 100644
index 0000000..bd29fa9
--- /dev/null
+++ b/jnls/go/fnoc_verify.jnl
@@ -0,0 +1,10 @@
+set wind/asp=1:ax
+go white
+set data etopo60
+
+go fnoc_2d shade/pal=inverse_redscale rose .99345
+go gridxy
+go polar_grid
+go polar_land
+
+label 0,-1.2,0,0,.1 DEFINE AXIS/X=-0.9934509:0.9934509:0.0320468 FNOC63
diff --git a/jnls/go/focean.jnl b/jnls/go/focean.jnl
new file mode 100644
index 0000000..68b9a41
--- /dev/null
+++ b/jnls/go/focean.jnl
@@ -0,0 +1,54 @@
+\cancel mode verify
+! focean.jnl - an ocean mask (overlay or "basemap")
+! (default 60 minute resolution)
+! 4/93
+! 	 10/93 - updated for Ferret V3.01
+! 	 2/94  - added [basemap]
+! 	 11/94 - added transparent overlays and "detail" control
+
+! Description: Plot or overlay an area-filled map of the oceans
+
+!		       arg1        arg2             arg3             arg4
+! usage:  GO focean [resolution] [palette] [basemap or transparent] [detail]
+
+! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=60
+!	  To use resolution "nnn" the file etoponnn must exist.
+! arg 2 - palette - may be any palette on your system.  Normally solid colors
+!		    like black, gray,red, etc. (see Fpalette '*') default=gray
+! arg 3 - may be "basemap", "transparent", or "overlay" (default)
+! arg 4 - detailed - may be "detailed", "all" or "solid"  default=solid
+!	  Use "detailed" together with a spectrum like dark_terrestrial
+!	  Use "all" to plot oceans as well as land.
+ 
+! examples:
+!	  GO focean 		! default - 60 minute resolution, color gray
+!	  GO focean 120		!  120 minute resolution
+!	  GO focean 5		! 5 minute resolution - caution! it's LARGE
+!	  GO focean 40 red	! 20 minute resolution with palette red.spk
+!	  GO focean 40 red basemap
+!	  GO focean 40 ocean_blue basemap detailed
+!	  GO focean 40 gray transparent
+!	  GO focean " " red	! default (60) minute resolution in red
+! or for a good time try
+!	SET DATA monthly_navy_winds; VECTOR/l=1 uwnd,vwnd
+!	GO focean  60 dark_terrestrial transparent detailed
+
+! Note 1: To use resolution "nnn" the file etoponnn must exist.
+! Note 2: If "basemap" is given then the current default region will determine
+!	  the region to be plotted
+! Note 3: The transparent option creates a see-through overlay land mask
+
+! check the overlay/basemap/transparent option
+query/ignore $3%overlay|overlay|basemap|transparent<3rd argument of GO focean must be "overlay", "basemap", or "transparent"%
+query/ignore $4%not_required|detailed|solid|all> <4th argument of GO basemap may be "detailed", "solid" or "all" (ocean, too)%
+
+set data/save
+
+set data etopo$1"60"
+
+shade/nolab/nokey/lev=$4"(-10000,0,10000)|detailed>(-200,0,50)(-1000,-200,100)(-10000,0,1000)|solid>(-10000,0,10000)|all>(-200,200,50)(-1000,1000,200)(-8000,8000,1000)"/pal=$2"gray"$3"/overlay|basemap> |*>/overlay" $3"rose|transparent>if mod(i+j,2) eq 0 then rose|*>rose"
+
+
+cancel data etopo$1"60"
+set data/restore
+set mode/last verify
diff --git a/jnls/go/frequency.awk b/jnls/go/frequency.awk
new file mode 100644
index 0000000..6371e2a
--- /dev/null
+++ b/jnls/go/frequency.awk
@@ -0,0 +1,40 @@
+# frequency.awk - *sh* 8/94
+# this procedure should be executed with awk -f frequency.awk input.file
+# The input file should be a sorted list of records with 2 values per
+# record.  The first value should be the sorting index - the second should
+# be a weight to associate with that record.  The sorting index may
+# contain duplicates and gaps.
+# The output will be a list of consecutive integers and the corresponding
+# sum of weights
+
+# due to what appears to be a bug in awk the diagnostic print line "XXXXX"
+# is needed for proper functioning.
+
+# Here is the complete usage pipe for an unsorted list:
+# sort -n myintegers.dat | awk -f TS_frequency.awk | grep -v "XXXXX"
+
+#printf("XXXXXXXXX  %d %d\n",$1,$2)   # doesn't work w/out this ???
+#
+# *acm* 10/02 This line was after the else, but it's wrong: bin 1 always 0!
+#	      if (ndx==1) wt=0       # index 1 used to capture garbage
+
+BEGIN   {ndx=1
+         wt=0}
+
+	{
+          if ($1 == 0 ) {
+            ndx = 1
+          }
+          else {
+            if ($1 == ndx) {
+            wt = wt + $2
+	    } else {
+	      printf("%d   %f\n",ndx,wt)
+              wt = 0
+	      for (i=ndx+1; i<$1; i++) printf("%d   %f\n",i,wt)
+	      ndx=$1
+              wt=$2
+	    }
+          }
+	}
+
diff --git a/jnls/go/frequency_histogram.jnl b/jnls/go/frequency_histogram.jnl
new file mode 100644
index 0000000..170c95a
--- /dev/null
+++ b/jnls/go/frequency_histogram.jnl
@@ -0,0 +1,102 @@
+\cancel mode verify
+!!
+! frequency_histogram.jnl - *sh* 8/94
+! *acm* Add argument to choose hollow or filled bars. Also fix
+!       the call to bar_chart2.jnl which should use plot/line
+!
+! Description: produce a 1D frequency histogram
+
+! Usage:  
+!    yes? GO frequency_histogram expression lo hi del [weight] [axis]  [style]
+
+! Note: this procedure (actually the bar_chart2 routine) uses the Y axis
+!	internally so it may not work properly if the Y axis has a region
+! 	set (it may even crash).  In this case either include the Y limits
+!	in the expression (i.e. "temp[y=0]" instead of "temp" with Y=0 in the
+!       region) or specify a free axis in the optional [AXIS] parameter
+
+! Note: If this script fails due to a large amount of input data, use 
+!       frequency_histogram2.jnl which does not call Unix sort and awk
+!       tools, but instead uses Ferret functions to compile the bins.
+
+! arguments:
+!    expression  - expression (values) from which histogram is to be computed
+!    lo, hi, del - the range of values for which a histogram is desired
+!    [weight]    - optional expression with weight for each value
+!    [axis]      - a free axis that the procedure can use (if Y isn't free)
+!    [style]     - 0 for hollow bars, 1 for filled.
+
+! Defaults:  weight - "1" ("weight" can be a variable name)
+!            axis - "Y"
+!            style - "0" hollow
+
+! Sample usage:
+!	yes? SET DATA levitus_climatology
+!	yes? GO  frequency_histogram temp[X=0:360,Y=0:45N,Z=0] 0 32 0.5
+!
+!	yes? GO  frequency_histogram temp[X=0:360,Y=0:45N,Z=0] 0 32 0.5 " " y 1
+
+
+! The optional "weight" parameter multiplies each grid cell by the variable
+! supplied.  In the surface temperature example above this might be the
+! area of each grid cell as follows:
+!let r=6370		! radius of earth
+!let pi=atan(1.)*4.
+!let deg2rad=pi/180.
+!let deg2km=2*pi*r/360.
+!let area=xbox[g=TEMP]*ybox[g=TEMP]*cos(y[g=TEMP]*deg2rad)*deg2km*deg2km*1e-6
+!SET VARIABLE/TITLE="Area of grid cells"/Unit="km^22 x 10^-6" area
+!GO frequency_histogram TEMP 0 32 .5 area
+
+query/ignore $1"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $2"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $3"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $4"<Usage: GO frequency_histogram expression lo hi del [weight]"
+let style = $7"0"
+
+! cleanup from previous
+set data/save
+cancel data/noerror frequency_h.dat
+
+! compute an index that numbers the histogram boxes on the desired output plot
+! also cope with missing values ("MISSING()") and data below the minimums
+! ("MAX()").  Data above the max is simply not read in the final commands
+! because it lies beyond the number of points in the grid gindex
+LET/QUIET vmin = $2
+LET/QUIET vmax = $3
+LET/QUIET vdelta = $4
+LET/QUIET vn = INT((vmax-vmin)/vdelta + 0.5) + 1
+LET/QUIET vindex = MISSING(INT(($1-vmin)/vdelta + 0.5) + 1, 0) ! 1 to vn
+LET/QUIET index = MAX(0, vindex) 
+
+! weight function for each grid cell
+LET/QUIET wt_index = $5"1"
+
+! create an output file with all TS grid boxes represented in order
+sp rm -f frequency_h.raw frequency_h.dat
+list/nohead/form=(F10.0,1X,1PG14.7)/file=frequency_h.raw index, wt_index
+list/nohead/form=(F10.0,1X,1PG14.7)/file=frequency_h.raw/append vn+1,0  ! MAX index + 1
+sp sort -n frequency_h.raw | awk -f $FER_DIR/go/frequency.awk > frequency_h.dat
+
+define axis/$6"y|X|Y|Z|T"=$2:$3:$4 yax
+define grid/$6"y|X|Y|Z|T"=yax gindex
+set data/save
+file/grid=gindex/var="-,wt_count" frequency_h.dat
+set variable/title="Sum of Weights" wt_count
+set data/restore
+
+! clean up
+set data/restore
+
+! do a hollow or filled plot
+IF `style EQ 0` THEN
+  message/cont You may want to replot with color qualifiers on PLOT and Ymin specified:
+  message/cont >>>  go bar_chart2 plot/line wt_count[d=frequency_h.dat] $6"y|X|Y|Z|T" clear [Ymin]
+  go bar_chart2 plot/line wt_count[d=frequency_h.dat] $6"y|X|Y|Z|T"
+ELSE
+  message/cont You may want to replot with /HLIM /PALETTE or other qualifiers on PLOT:
+  message/cont >>>  go bar_chart3 poly/line/nolabel/fill wt_count [color] [base]
+  go bar_chart3 poly/line/nolabel/fill wt_count[d=frequency_h.dat] 
+ENDIF
+
+set mode/last verify
diff --git a/jnls/go/frequency_histogram2.jnl b/jnls/go/frequency_histogram2.jnl
new file mode 100644
index 0000000..537bbd7
--- /dev/null
+++ b/jnls/go/frequency_histogram2.jnl
@@ -0,0 +1,103 @@
+\cancel mode verify
+! frequency_histogram2.jnl - *acm* 10/02  
+! 
+! Description: produce a 1D frequency histogram, using Ferret functions to
+!              compile bin data. Calls sort and sample functions, and 
+!              external function bin_index_wt are called rather than Unix 
+!              sort and awk. This works when frequency_histogram.jnl fails 
+!              due to large input data.
+
+! Usage:  
+!    yes? GO frequency_histogram expression lo hi del [weight] [axis] [style]
+!
+! Note 1: Because the sort and sample are applied to XSEQUENCE(expression)
+!         the expression must have any region limits specified explicitly
+!         Do not use after applying a SET REGION.
+
+! Note 2: this procedure (actually the bar_chart2 routine) uses the Y axis
+!	  internally so it may not work properly if the Y axis has a region
+! 	  set (it may even crash).  In this case either include the Y limits
+!	  in the expression (i.e. "temp[y=0]" instead of "temp" with Y=0 in the
+!         region) or specify a free axis in the optional [AXIS] parameter
+
+! arguments:
+!    expression  - expression (values) from which histogram is to be computed
+!    lo, hi, del - the range of values for which a histogram is desired
+!    [weight]    - optional expression with weight for each value
+!    [axis]      - a free axis that the procedure can use (if Y isn't free)
+!    [style]     - 0 for hollow bars, 1 for filled.
+
+! Defaults:  weight - "1" ("weight" can be a variable name)
+!            axis - "Y"
+!            style - "0" hollow
+
+! Sample usage:
+!	yes? SET DATA levitus_climatology
+!	yes? GO  frequency_histogram2 TEMP[X=0:360,Y=0:45N,Z=0] 0 32 0.5
+
+
+! The optional "weight" parameter multiplies each grid cell by the variable
+! supplied.  In the surface temperature example above this might be the
+! area of each grid cell as follows:
+
+! LET/QUIET r=6370		! radius of earth
+! LET/QUIET pi=atan(1.)*4.
+! LET/QUIET deg2rad=pi/180.
+! LET/QUIET deg2km=2*pi*r/360.
+! LET/QUIET area=xbox[g=TEMP]*ybox[g=TEMP]*cos(y[g=TEMP]*deg2rad)*deg2km*deg2km*1e-6
+! SET VARIABLE/TITLE="Area of grid cells"/Unit="km^22 x 10^-6" area
+! GO frequency_histogram2 TEMP[X=0:360,Y=0:45N,Z=0] 0 32 .5 area " " 1
+
+query/ignore $1"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $2"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $3"<Usage: GO frequency_histogram expression lo hi del [weight]"
+query/ignore $4"<Usage: GO frequency_histogram expression lo hi del [weight]"
+
+let style = $7"0"
+
+
+! cleanup from previous
+set data/save
+
+! compute an index that numbers the histogram boxes on the desired output plot
+! also cope with missing values ("MISSING()") and data below the minimums
+! ("MAX()").  Data above the max is simply not read in the final commands
+! because it lies beyond the number of points in the grid gindex
+LET/QUIET v1 = COMPRESSI(XSEQUENCE(($1)) )
+LET/QUIET ngood = v1[x=@NGD]
+LET/QUIET vdata = v1[i=1:`ngood`]
+LET/QUIET vmin = $2
+LET/QUIET vmax = $3
+LET/QUIET vdelta = $4
+LET/QUIET vn = INT((vmax-vmin)/vdelta + 0.5) + 1
+LET/QUIET vindex = INT((vdata-vmin)/vdelta + 0.5) + 1   ! 1 to vn
+LET/QUIET index = MAX(0, vindex) 
+
+! weight function for each grid cell
+LET/QUIET wt_index = $5"1+0*index"
+
+LET/QUIET fh_sort = sorti(XSEQUENCE(index))
+LET/QUIET fh_indsort = samplei(XSEQUENCE(index),fh_sort)
+LET/QUIET fh_wtsort = samplei(XSEQUENCE(wt_index),fh_sort)
+
+LET/QUIET fh_fbins = bin_index_wt(fh_indsort, fh_wtsort, vn+1)
+
+define axis/$6"y|X|Y|Z|T"=$2:$3:$4 yax
+define grid/$6"y|X|Y|Z|T"=yax gindex
+define var fh_a =$6"y|X|Y|Z|T"[g$6"y|X|Y|Z|T"=yax] 
+
+LET/QUIET fh_wc = reshape(fh_fbins,fh_a)
+LET/QUIET wt_count = missing(fh_wc,0.)
+
+
+! do a hollow or filed plot
+IF `style EQ 0` THEN
+  message/cont You may want to replot with color qualifiers on PLOT and Ymin specified:
+  message/cont >>>  go bar_chart2 plot/line wt_count $6"y|X|Y|Z|T" clear [Ymin]
+  go bar_chart2 plot/line wt_count $6"y|X|Y|Z|T"
+ELSE
+  message/cont You may want to replot with /HLIM /PALETTE or other qualifiers on PLOT:
+  message/cont >>>  go bar_chart3 poly/line/nolabel/fill wt_count [color] [base]
+  go bar_chart3 poly/line/nolabel/fill wt_count
+
+set mode/last verify
diff --git a/jnls/go/gmt_power.jnl b/jnls/go/gmt_power.jnl
new file mode 100644
index 0000000..da7a324
--- /dev/null
+++ b/jnls/go/gmt_power.jnl
@@ -0,0 +1,121 @@
+\cancel mode verify
+! gmt_power.jnl 10/96
+! update 10/23 - display the GMT commend that is issued
+
+! Description: define a variable for the power spectrum of a time series
+
+! Output: variable definitions for "out_name".power and "out_name".error
+
+! Usage:	            1        2        3         4
+!         GO gmt_power my_T_series grid  [out_name] [seg_len]
+
+! Arguments:
+!  my_T_series - variable or expression for time series
+!		 (should not depend on SET REGION/T=...)
+!
+!  grid		The name of the grid upon which your time series is defined
+!		   (If computing the power spectrum of a file variable you
+!			may simply use the variable name here.)  
+!				[default="unknown"]
+!
+!  out_name   - name stem for the resultant variables
+!			        [default="gmt"]
+!		    use this argument especially when it is necessary to
+!		    work with multiple time series simultaneously
+!
+!  seg_len	seg_len ("-S" in GMT spectrum1d man pages)
+!		  [default=largest power of 2 less than 1/2 Npoints]
+!	  ... a radix-2 number of samples per window for ensemble
+!	  averaging.  The smallest frequency estimated is 1.0/(segment_size *
+!	  dt), while the largest is 1.0/(2 * dt).  One standard error in power
+!	  spectral density is approximately 1.0 / sqrt(n_data / segment_size),
+!	  so if segment_size = 256, you need 25,600 data to get a one standard
+!	  error bar of 10%.
+
+! Example: power spectrum of zonal wind at Equator, dateline
+
+!	yes? SET DATA monthly_navy_winds
+!	yes? GO gmt_power uwnd[x=180,y=0] uwnd x180y0 64
+!	yes? PLOT x180y0_power
+!	yes? GO overlay_bars x180y0_power  x180y0_error red
+
+! See "man spectrum1d" for detailed explanations.
+
+! Note -- this tool:
+!  - computes a power spectrum at a single geographical location, only
+!  - CANCELs the current REGION
+!  - cannot accept missing data (gaps) in the time series
+!  For details on the FFT calculation type "man spectrum1d" at the Unix prompt.
+
+! check for valid time series - must exist, must be a simple 1D time series
+query/ignore $1%<Usage: GO gmt_power my_T_series grid [out_name] [seg-len]%
+query/ignore $2%<Usage: GO gmt_power my_T_series grid [out_name] [seg-len]%
+DEFINE SYMBOL psgmt_shape `$1,return=shape`
+IF ($psgmt_shape"|T>0|*>1") THEN
+   SAY You must pass a simple time series to this routine
+   SAY Your argument of $1 is ($psgmt_shape) dimensioned
+   CANNOT_CONTINUE using $1		! deliberate syntax error
+ENDIF 
+
+! abort if the time series contains missing values
+LET/quiet psgmt_check = $1
+IF `psgmt_check[l=@nbd]` THEN
+   SAY >>> GMT FFT routines cannot handle gaps in data
+   SAY >>> Expression contains `psgmt_check[l=@nbd]` missing values: $1
+   EXIT
+ENDIF
+
+! determine the "segment length" (if not passed as an argument)
+IF $4"0" THEN
+  DEFINE SYMBOL psgmt_seg $4
+ELSE
+! ... greatest power of 2 less than one half of the time series length
+  DEFINE SYMBOL psgmt_Nt  `$1,return=lsize`
+  DEFINE SYMBOL psgmt_seg `2^(INT(LOG(($psgmt_Nt))/LOG(2))-1)`
+  SAY Using segment length of ($psgmt_seg)
+ENDIF
+
+! set up symbols for variable names, and file names
+DEFINE SYMBOL psgmt_var     $3"gmt"
+DEFINE SYMBOL psgmt_dat     ($psgmt_var).tseries
+
+! determine delta T for the time series (in days)
+LET/QUIET gmt_T_one = T[G=$2]/T[G=$2]
+DEFINE SYMBOL psgmt_days `gmt_T_one[l=@din]/(gmt_T_one[l=@ngd]*60*60*24)`
+CANCEL VARIABLE gmt_T_one
+
+! clean up files after last use
+SPAWN rm -f ($psgmt_dat)
+
+! write the indicated time series data into a new file
+list/file=($psgmt_dat)/format=(1PG15.6)/nohead $1
+
+! compute the power spectrum using GMT routine
+SAY >>> Using GMT command: spectrum1d ($psgmt_dat) -N($psgmt_var) -S($psgmt_seg) -D($psgmt_days)
+SPAWN spectrum1d ($psgmt_dat) -N($psgmt_var) -S($psgmt_seg) -D($psgmt_days)
+
+! read the frequency axis from the resulting spectrum
+SET DATA/SAVE
+CANCEL REGION
+file/var=freq ($psgmt_var).xpower
+DEFINE AXIS/T=`freq[i=1]`:`freq[i=@max]`/npoints=`freq[i=@ngd]`/units="1/days" ($psgmt_var)freq
+define grid/T=($psgmt_var)freq ($psgmt_var)freq
+CANCEL DATA ($psgmt_var).xpower 
+
+! define variables for the results: power series and error
+file/grid=($psgmt_var)freq/var=-,power,error ($psgmt_var).xpower 
+
+! set titles and units for resultant variables
+LET/QUIET ($psgmt_var)_power = power[d=($psgmt_var).xpower]
+SET VARIABLE/TITLE="Power Spectrum of $1 " ($psgmt_var)_power
+LET/QUIET ($psgmt_var)_error = error[d=($psgmt_var).xpower]
+SET VARIABLE/TITLE="Spectral Error of $1 " ($psgmt_var)_error
+
+! let the user know what the power spectrum variables are
+SAY >>> Power spectrum is  ($psgmt_var)_power   (try PLOT ($psgmt_var)_power )
+SAY >>> Spectral error is  ($psgmt_var)_error
+
+! clean up
+CANCEL SYMBOL psgmt*
+SET DATA/RESTORE
+SET MODE/LAST VERIFY
diff --git a/jnls/go/graticule.jnl b/jnls/go/graticule.jnl
new file mode 100644
index 0000000..57fd469
--- /dev/null
+++ b/jnls/go/graticule.jnl
@@ -0,0 +1,14 @@
+\ cancel mode verify
+! graticule.jnl  (12/93)
+
+! Description: Set the plot axis style to use a graticule (see GO tics)
+
+! Usage:  GO graticule
+! 	(to restore the normal tic style use  "GO tics")
+
+! This script needs to be exectuted AFTER changes in aspect ration
+! (It uses the current axis lengths to set up)
+
+ppl tics,,'ppl$ylen',,'ppl$xlen',1,1
+
+set mode/last verify
diff --git a/jnls/go/gratxt.jnl b/jnls/go/gratxt.jnl
new file mode 100644
index 0000000..13a9981
--- /dev/null
+++ b/jnls/go/gratxt.jnl
@@ -0,0 +1,23 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of XT graticule lines to show the axis values
+! 
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  Here we contour L rather than T 
+! Example:
+!     yes? use coads_climatology
+!     yes? shade/y=0/x=180:210 sst
+!     yes? go gratdxt
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS X+(T*0)	! "T*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(-400,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(X*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gratxy.jnl b/jnls/go/gratxy.jnl
new file mode 100644
index 0000000..9422430
--- /dev/null
+++ b/jnls/go/gratxy.jnl
@@ -0,0 +1,26 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of XY graticule lines to show the axis values
+
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  
+! Example: Since gridxy uses the grid of the last data access; after go land
+!          you need to reload sst.
+!     yes? use coads_climatology
+!     yes? shade/l=1/x=100:150/y=-20:20 sst
+!     yes? go fland
+!     yes? load sst
+!     yes? go gridxy
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS X+(Y*0)	! "Y*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(-400,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS Y+(X*0)
+PPL PEN 1,1
+PPL LEV () (-100,100,1,-3) (-100,100,10,-1) LINE(-100,100,1) DARK(-100,100,10)
+PPL CONTOUR/OVER
+
+SET GRID/RESTORE
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gratxz.jnl b/jnls/go/gratxz.jnl
new file mode 100644
index 0000000..aca1d61
--- /dev/null
+++ b/jnls/go/gratxz.jnl
@@ -0,0 +1,23 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of XZ graticule lines to show the axis values 
+
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  
+! Example:
+!     yes? use levitus_climatology
+!     yes? shade/y=0/x=140:190/z=0:500 temp
+!     yes? go gridxz
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS X+(Z*0)	! "Z*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS Z+(X*0)
+PPL PEN 1,1
+PPL LEV () (-1000,1000,10,-3) (-1000,1000,100,-1) DARK(-1000,1000,100)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gratyt.jnl b/jnls/go/gratyt.jnl
new file mode 100644
index 0000000..5a087c0
--- /dev/null
+++ b/jnls/go/gratyt.jnl
@@ -0,0 +1,23 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of YT graticule lines to show the axis values
+
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  Here we contour L rather than T 
+! Example:
+!     yes? use coads_climatology
+!     yes? shade/x=180/y=-10:10 sst
+!     yes? go gridyt
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS Y+(T*0)	! "T*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (-100,100,1,-3) (-100,100,10,-1) DARK(-100,100,10) LINE(-100,100,1)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(Y*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gratyz.jnl b/jnls/go/gratyz.jnl
new file mode 100644
index 0000000..2b2ca01
--- /dev/null
+++ b/jnls/go/gratyz.jnl
@@ -0,0 +1,23 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of YZ graticule lines to show the axis values
+
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  
+! Example:
+!     yes? use levitus_climatology
+!     yes? shade/x=180/y=-10:20/z=0:500 temp
+!     yes? go gridyz
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS Y+(K*0)	! "K*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (-100,100,1,-3) (-100,100,10,-1) LINE(-100,100,1) DARK(-100,100,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS Z+(Y*0)
+PPL PEN 1,1
+PPL LEV () (-1000,1000,10,-3) (-1000,1000,100,-1) DARK(-1000,1000,100)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gratzt.jnl b/jnls/go/gratzt.jnl
new file mode 100644
index 0000000..4f02645
--- /dev/null
+++ b/jnls/go/gratzt.jnl
@@ -0,0 +1,25 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of TZ graticule lines to show the axis values
+
+! Note: you may need to change the PPL LEV commands to contour over the
+!       range of the axes for your data.  Here we contour L rather than T 
+! Example:
+!     yes? def axis/z=0:600:80/depth zzax
+!     yes? def axis/t=1:30:1/units=days ttax
+!     yes? let my_func = sin(z[gz=zzax]/30) + t[gt=ttax] - 15
+!     yes? fill my_func
+!     yes? go gridzt
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS Z+(T*0)	! "T*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (-1000,1000,10,-3) (-1000,1000,100,-1) DARK(-1000,1000,100)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(Z*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/great_circle.jnl b/jnls/go/great_circle.jnl
new file mode 100644
index 0000000..263be21
--- /dev/null
+++ b/jnls/go/great_circle.jnl
@@ -0,0 +1,65 @@
+!\ CANCEL MODE VERIFY
+! great_circle.jnl
+! Description: Overlay a great circle arc on a lat/lon plot
+
+ ! plotting of great circle between (lat1,lon1) & (lat2,lon2)
+ ! use east longitudes (0-360 unless spanning greenwich meridian
+ ! when a negative longitude is appropriate for the location in
+ ! the western hemisphere)
+ ! Mick Spillane           NOAA/PMEL/OCRD            March 1993
+
+ ! usage:
+ ! GO great_circle lat1 lon1 lat2 lon2 [pen_color]
+ ! Note: all arguments must be numeric - formatted lat/lons not supported
+ !	(e.g. use "160" for 160E, "200" for 160W, "-20" for 20S, "20 for 20N
+
+! check that 4 arguments were supplied and check optional color
+QUERY/IGNORE $4"<Usage: GO great_circle lat1 lon1 lat2 lon2 [pen_color] (numeric positions only)"
+ppl pen 1 $5%1|red>1|green>1|blue>1|thick>1|0>1|1>1|2>1|3>1|4>1|5>1|6>1|7>1|8>1|9>1|10>1|11>1|12>1|13>1|14>1|15>1|16>1|17>1|18>1|<optional pen_color = 0(back), 1(fore), thick, 2-18 or a color%
+
+! assign the arguments
+LET lat1 = $1
+LET lon1 = $2
+LET lat2 = $3
+LET lon2 = $4
+
+ ! degree to radian conversion
+
+let d2r=atan(1.)/45.
+
+ ! cos and sin for end points
+
+let ct1=cos(d2r*lat1)
+let st1=sin(d2r*lat1)
+let ct2=cos(d2r*lat2)
+let st2=sin(d2r*lat2)
+let cp1=cos(d2r*lon1)
+let sp1=sin(d2r*lon1)
+let cp2=cos(d2r*lon2)
+let sp2=sin(d2r*lon2)
+
+let a=ct1*sp1*st2-st1*ct2*sp2
+let b=st1*ct2*cp2-ct1*cp1*st2
+let c=ct1*sp1*ct2*cp2-ct1*cp1*ct2*sp2
+
+ ! lat,lon are points along the great circle
+
+let sp=sin(d2r*lon)
+let cp=cos(d2r*lon)
+
+let lat=atan((a*cp+b*sp)/c)/d2r
+
+ ! use 100 arcs to draw great circle
+
+define axis/z=1:101:1 zgrc
+set region/k=1:101
+let lon=lon1+(k-1)*(lon2-lon1)/100
+
+ ! overlay the great circle on an existing plot
+
+plot/overlay/nolabel/set_up/vs lon,lat
+ppl pen 1 $5"1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+ppl plot/overlay
+
+set mode/last verify
+
diff --git a/jnls/go/gridlines.jnl b/jnls/go/gridlines.jnl
new file mode 100644
index 0000000..8fca49c
--- /dev/null
+++ b/jnls/go/gridlines.jnl
@@ -0,0 +1,41 @@
+\cancel mode verify  
+
+!**************************************************************
+! Description: plot over the grid of a plot 
+!
+! Example: use levitus_climatology
+!          shade/lev=25 temp[k=1]
+!          go land
+!          go gridlines 30        ! for graticules every 30 degrees
+!
+!         go gridlines 20 1
+!          will plot every 20 on the physical xaxis a vertical bar
+!          made of line of 1% of the physical yaxis
+!      and will plot every 20 on the physical yaxis a horizontal bar
+!          made of line of 1% of the physical xaxis
+!
+!
+! Notes: default hdelta and vdelta are 1%       
+!
+! Calls: go xgridlines
+!        go ygridlines
+!
+! Author: Patrick Brockmann
+! Contact: brock at lsce.saclay.cea.fr
+!
+! Creation: Sept 2000
+! Version: 1.0
+! History:
+! Modification:
+!
+!**************************************************************
+
+query/ignore $1%<Usage: go gridlines hdelta [vdelta]%
+
+go xgridlines $1 $2%1%
+go ygridlines $1 $2%1%
+
+!**************************************************************
+set mode/last verify
+
+
diff --git a/jnls/go/gridxt.jnl b/jnls/go/gridxt.jnl
new file mode 100644
index 0000000..bee616f
--- /dev/null
+++ b/jnls/go/gridxt.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of IL graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS I+(L*0)	! "L*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(I*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gridxy.jnl b/jnls/go/gridxy.jnl
new file mode 100644
index 0000000..68959b8
--- /dev/null
+++ b/jnls/go/gridxy.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of IJ graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS I+(J*0)	! "J*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS J+(I*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+
+SET GRID/RESTORE
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gridxz.jnl b/jnls/go/gridxz.jnl
new file mode 100644
index 0000000..766d571
--- /dev/null
+++ b/jnls/go/gridxz.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of IK graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS I+(K*0)	! "K*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS K+(I*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gridyt.jnl b/jnls/go/gridyt.jnl
new file mode 100644
index 0000000..34b2e16
--- /dev/null
+++ b/jnls/go/gridyt.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of JL graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS J+(L*0)	! "L*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(J*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gridyz.jnl b/jnls/go/gridyz.jnl
new file mode 100644
index 0000000..0416818
--- /dev/null
+++ b/jnls/go/gridyz.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY
+! Description: create an overlay of JK graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS J+(K*0)	! "K*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS K+(J*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/gridzt.jnl b/jnls/go/gridzt.jnl
new file mode 100644
index 0000000..b256fcb
--- /dev/null
+++ b/jnls/go/gridzt.jnl
@@ -0,0 +1,17 @@
+\CANCEL MODE VERIFY 
+! Description: create an overlay of KL graticule lines to show the grid points
+! updated 10/93 for Ferret V3.01.S
+
+SET GRID/SAVE
+SET GRID				! grid from last data access
+CONTOUR/OVER/SET/NOLABELS K+(L*0)	! "L*0" to create 2D structure
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+CONTOUR/OVER/SET/NOLABELS L+(K*0)
+PPL PEN 1,1
+PPL LEV () (1,400,1,-3) (10,400,10,-1) DARK(10,400,10)
+PPL CONTOUR/OVER
+SET GRID/RESTORE
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/histogram_pdf.jnl b/jnls/go/histogram_pdf.jnl
new file mode 100644
index 0000000..abc5e0e
--- /dev/null
+++ b/jnls/go/histogram_pdf.jnl
@@ -0,0 +1,78 @@
+\CANCEL MODE VERIFY    
+
+! histogram_pdf.jnl
+! based on the old histogram.jnl
+! Upgraded 10/2009 for Ferret v6.3+
+!
+! Description: generate and plot a frequency histogram from a FERRET variable
+! Note that internal settings are made for:
+! 1) computing the PDF (see the definition of hpdf below), and 
+! 2) for smoothing the histogram that is plotted, which is the smoothed PDF.
+
+! Usage:  GO histogram_pdf expression 
+! Example: 
+!   USE levitus_climatology
+!   GO histogram_pdf temp[k=1:2]
+
+! check that all necessary input arguments were supplied
+QUERY/IGNORE $1"<Usage:GO histogram_pdf expression"
+
+! produce a sorted, numbered set from the data in the expression
+! hsort is a sorted list of all the valid data
+! hcount is a list of indices of the valid data
+
+LET hsort =  SAMPLEI(XSEQUENCE(($1)), SORTI(XSEQUENCE(($1)) ))
+LET ns = `hsort[i=@ngd]`
+LET hval = hsort[i=1:`ns`]
+
+LET hcount = i[gx=hval,i=1:`ns`]
+
+! define variables needed for the histogram
+! hcdf - a normalized "counter" that increments for each data point
+! hpdf - the raw probability density function for the users data
+! The PDF approximates the derivative of the CDF as
+! d/dx(CDF) = d/di(CDF) / d/di(HVAL) where HVAL are the sorted data values.
+! An arbitrary delta i of 10 points is used.  Large data sets could use a 
+! larger delta i.
+! e.g. LET hpdf = 50/((hval[i=@shf:+25]-hval[i=@shf:-25])*hcount[x=@max])
+
+LET hcdf = hcount/hcount[x=@max] ! normalized for cumulative prob. dens. fct
+LET hpdf = 10/((hval[i=@shf:+5]-hval[i=@shf:-5])*hcount[x=@max])
+
+! various results can be plotted from this
+! plot/vs hval,hcdf              ! cumulative probability density function
+! plot/vs hval,hpdf              ! approximate probability density function
+! plot/vs hval,hpdf[i=@sbx:11]   ! histogram: smoothed PDF
+
+! For large data sets smoothing can be increased using a larger @SBX argument 
+
+LET/TITLE="Probability Density Function" vval = hpdf[i=@sbx:11]
+SET VAR/TITLE="`($1),return=title` (`$1,return=units`)" hval
+
+! Do an "underlay" plot of the original variable (but with a /VLIM setting
+! so that no data points are plotted). This puts the region information in 
+! the upper left, and the dataset info in the upper right.
+
+DEFINE VIEWPORT hvp1    ! just like "full"
+DEFINE VIEWPORT hvp2    ! just like "full"
+
+SET VIEW hvp1
+LET varmax = `hsort[i=@max]`
+
+PLOT/VS/NOAX/VLIM=`varmax+1`:`varmax+2` ($1),($1)
+
+SET VIEW hvp2
+
+PLOT/VS/NOLAB hval,vval
+
+! Label the axes.
+LABEL/NOUSER `($ppl$xlen)/2`,-0.8, 0, 0, 0.12, @AC`($1),return=title` (`$1,return=units`)
+LABEL/NOUSER -0.8,`($ppl$ylen)/2`,0,90,0.12, @ACProbability Density Function
+
+SAY Other various results can be plotted from this:
+
+SAY PLOT/VS hval,hcdf              ! cumulative probability density function
+SAY PLOT/VS hval,hpdf              ! approximate probability density function
+SAY PLOT/VS hval,hpdf[i=@SBX:11]   ! histogram: smoothed PDF
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/label_hi_lo.jnl b/jnls/go/label_hi_lo.jnl
new file mode 100644
index 0000000..439b8de
--- /dev/null
+++ b/jnls/go/label_hi_lo.jnl
@@ -0,0 +1,139 @@
+\cancel mode verify
+! label_hi_lo
+! *8/01 *acm* 
+
+! Description: overlay labels for local extrema with H and L or the
+!              values at those extrema
+!
+!   usage:
+!       GO label_hi_lo var marktype xrng yrng [hicolor] [locolor] [labsize] [precision]
+!   where:
+!       var        Variable in the underlying plot. note do not use square
+!                  bracket syntax (GO label_lo_hi sst[l=1]... will fail )
+!
+!       marktype "mark" or "label": 
+!                       mark puts L and H
+!                       label puts the data value in a box at extremum
+!
+!       xrng     range in data units, in x and y direction
+!       yrng       in which to look for local extrema
+!
+!       hicolor  color of box around HI labels, or of letter H, default black
+!       locolor  color of box around LO labels, or of letter L, default black
+!       labsize  size of the mark or label (default 1.5) 
+!       precision number of significant figures for numeric lables (default not specified)
+
+! example:
+!       yes? USE coads_climatology
+!       yes? SET REGION/L=7/X=100:360/Y=-20:60
+!       yes? FILL/LINE/PAL=no_red slp
+!       yes? GO fland
+!       yes? GO label_hi_lo.jnl slp label 10 8 green purple
+!       yes? PAUSE
+!       yes? CONTOUR slp
+!       yes? GO fland
+!       yes? GO label_hi_lo.jnl slp mark 6 6 red blue
+
+! check arguments
+QUERY/IGNORE $1%<Usage: GO label_hi_lo  var marktype xrng yrng xmin xmax ymin%
+QUERY/IGNORE $2%<argument 2 is mark or label %
+QUERY/IGNORE $3%<argument 3 is x radius in data units%
+QUERY/IGNORE $4%<argument 4 is y radius in data units%
+QUERY/IGNORE $5%black|black|red|green|blue|lightblue|purple|*>black|%
+QUERY/IGNORE $6%black|black|red|green|blue|lightblue|purple|*>black|%
+QUERY/IGNORE $7%1.5%
+QUERY/IGNORE $8%-1%
+
+LET/QUIET LHL_rsiz = $7%1.5% 
+LET/QUIET LHL_prec = $8%-1%
+
+! save region and grid information.  X and Y regions are cancelled below
+
+DEFINE REGION/DEFAULT save
+
+LET/QUIET LHL_xmax = ($ppl$xmax)
+LET/QUIET LHL_xmin = ($ppl$xmin)
+LET/QUIET LHL_ymax = ($ppl$ymax)
+LET/QUIET LHL_ymin = ($ppl$ymin)
+
+! compute local mins and maxes
+LET/QUIET LHL_datlo = findlo($1[x=`LHL_xmin`:`LHL_xmax`,y=`LHL_ymin`:`LHL_ymax`], $3, $4)
+LET/QUIET LHL_dathi = findhi($1[x=`LHL_xmin`:`LHL_xmax`,y=`LHL_ymin`:`LHL_ymax`], $3, $4)
+
+LET/QUIET LHL_xph = LHL_dathi[j=1]
+LET/QUIET LHL_yph = LHL_dathi[j=2]
+LET/QUIET LHL_zph = LHL_dathi[j=3]
+
+LET/QUIET LHL_xpl = LHL_datlo[j=1]
+LET/QUIET LHL_ypl = LHL_datlo[j=2]
+LET/QUIET LHL_zpl = LHL_datlo[j=3]
+
+LOAD LHL_xph; LOAD LHL_yph; LOAD LHL_zph
+LOAD LHL_xph; LOAD LHL_ypl; LOAD LHL_zpl
+LET/QUIET LHL_nhi = LHL_xph[x=@ngd]
+LET/QUIET LHL_nlo = LHL_xph[x=@ngd]
+
+! I and J indices are used as indices of the extrema, so cancel the
+! region that came in with the variable.
+
+CAN REGION/X/Y
+
+IF $2"|label>1|*>0|" THEN
+! Mark the max's and mins with a rectangle, and the value of the extremum.
+! Allow either violet or purple to be specified.   
+
+
+set mode verify
+  LET/QUIET LHL_chsiz = LHL_rsiz / 20
+
+  GO polymark POLY/OVER/NOLABEL/PAL=white/LINE/COLOR=$5%black|black|red|green|blue|lightblue|purple|violet>purple|*>black% LHL_xph,LHL_yph,LHL_zph,rectangle, LHL_rsiz
+  IF `LHL_prec GT 1 AND LHL_prec LE 2` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=2`")
+  ELIF `LHL_prec GT 2 AND LHL_prec LE 3` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=3`")
+  ELIF `LHL_prec GT 3 AND LHL_prec LE 4` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=4`")
+  ELIF `LHL_prec GT 4 AND LHL_prec LE 5` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=5`")
+  ELIF `LHL_prec GT 5 AND LHL_prec LE 6` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=6`")
+  ELIF `LHL_prec GT 6 AND LHL_prec LE 7` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=7`")
+  ELIF `LHL_prec GT 7 AND LHL_prec LE 8` THEN
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=8`")
+  ELSE
+    REPEAT/i=1:`LHL_nhi` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_yph[i=`i`]; LET/QUIET LHL_zp=LHL_zph[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp`")
+  ENDIF
+
+  GO polymark POLY/OVER/NOLABEL/PAL=white/LINE/COLOR=$6%black|black|red|green|blue|lightblue|purple|violet>purple|*>black% LHL_xph,LHL_ypl,LHL_zpl,rectangle, LHL_rsiz
+  IF `LHL_prec GT 1 AND LHL_prec LE 2` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=2`")
+  ELIF `LHL_prec GT 2 AND LHL_prec LE 3` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=3`")
+  ELIF `LHL_prec GT 3 AND LHL_prec LE 4` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=4`")
+  ELIF `LHL_prec GT 4 AND LHL_prec LE 5` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=5`")
+  ELIF `LHL_prec GT 5 AND LHL_prec LE 6` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=6`")
+  ELIF `LHL_prec GT 6 AND LHL_prec LE 7` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=7`")
+  ELIF `LHL_prec GT 7 AND LHL_prec LE 8` THEN
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp,prec=8`")
+  ELSE
+    REPEAT/i=1:`LHL_nlo` (LET/QUIET LHL_xp=LHL_xph[i=`i`]; LET/QUIET LHL_yp=LHL_ypl[i=`i`]; LET/QUIET LHL_zp=LHL_zpl[i=`i`]; label `LHL_xp`, `LHL_yp-LHL_chsiz`, 0,0, `LHL_chsiz`, "`LHL_zp`")
+  ENDIF
+ENDIF
+
+IF $2"|mark>1|*>0|" THEN
+! Mark the extrema with L and H 
+! Allow either violet or purple to be specified.   
+
+  GO polymark POLY/OVER/NOLABEL/PAL=$5%black|black|red|green|blue|lightblue|violet|purple>violet|*>black%/fill LHL_xph,LHL_yph,,hletter,LHL_rsiz
+  GO polymark POLY/OVER/NOLABEL/PAL=$6%black|black|red|green|blue|lightblue|violet|purple>violet|*>black%/fill LHL_xph,LHL_ypl,LHL_zpl,lletter,LHL_rsiz
+ENDIF
+
+! Restore input region
+SET REGION save
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/labelvalues.jnl b/jnls/go/labelvalues.jnl
new file mode 100644
index 0000000..9820e24
--- /dev/null
+++ b/jnls/go/labelvalues.jnl
@@ -0,0 +1,143 @@
+\cancel mode verify
+! labelvalues
+! *10/02 *acm* 
+
+! Description: Label locations on a 2-D plot with values and optional text
+!
+!   usage:
+!       GO labelvalues xloc yloc value [size] [location] [prefix] [suffix] [ndigits] [offset]
+!   where:
+!       xloc      horizontal location of the points
+!       yloc      vertical location of the points
+!       value     function value at the points
+!       size      size of the labels (default 0.12 inches)
+!       location  location of the label: right(default), left, above, below
+!       prefix    text and/or a font setting, to preceed each label
+!       suffix    text following each label
+!       ndigits   maximum number of digits to the right of the decimal point
+!       offset    space, in inches, to separate the label from the point
+!                   in the direction of the label position, e.g. labels
+!                   that are "below" with an offset of 0.5 will be half
+!                   and inch below the points.
+!
+! example:
+!       yes? USE coads_climatology
+!       yes? FILL/L=1/X=100:360/Y=-20:60 sst
+!       yes? LET xpts = {123, 198, 245, 260, 330}
+!       yes? LET ypts = {-10,  10, -10,  10, -10}
+!       yes? LET vals = SAMPLEXY(sst[L=1], xpts, ypts)
+!       yes? GO labelvalues.jnl xpts ypts vals 0.14 "left" " " " Deg C" 1
+!
+!       yes? ! or, to set a color and font, for example,
+!       yes? GO labelvalues.jnl xpts ypts vals 0.10 "right" "@P5 at TR" " C" 0
+
+!       yes? ! all arguments
+!       yes? GO labelvalues.jnl xpts ypts vals 0.10 "above" "@TR" "Deg C" 1 0.1
+
+! check arguments
+QUERY/IGNORE $1%<Usage: GO labelvalues  xpts ypts var [size] [justify] [prefix] [suffix] [ndigits]%
+QUERY/IGNORE $2%<argument 2 is ypts %
+QUERY/IGNORE $3%<argument 3 is values%
+QUERY/IGNORE $4%0.12%
+QUERY/IGNORE $5%-1|right>-1|left>1|*>-1|%
+
+LET LN_xpts = $1
+LET LN_ypts = $2
+LET LN_vals = $3
+LET LN_lsiz = $4%0.12% 
+
+LET LN_just = $5%-1|right>-1|left>1|above>0|below>0|*>-1|%
+LET LN_vert = $5%0|right>0|left>0|above>1|below>-1|*>0|%
+
+DEFINE SYMBOL LN_prefix = "$6%  %"
+DEFINE SYMBOL LN_suffix = "$7%  %"
+LET LN_prefix_exists = $6"0|*>1"
+LET LN_ndig = $8%-1%
+LET LN_off = $9%0%
+
+! Save region; If user has set a region, then the XSEQUENCE(vals)
+! may be wrong. So we need to cancel it for this script.
+
+DEFINE REGION/DEFAULT save
+CAN REGION/X/Y
+
+LET LN_x = XSEQUENCE(LN_xpts)
+LET LN_y = XSEQUENCE(LN_ypts)
+LET LN_v = XSEQUENCE(LN_vals)
+
+LET LN_x = LN_xpts
+LET LN_y = LN_ypts
+LET LN_v = LN_vals
+
+! See if horizontal offset was requested
+
+LET LN_xfac = 0.
+LET LN_xoff = 0.
+IF `LN_just NE 0` THEN
+   LET LN_xfac = ( ($PPL$XMAX)-($PPL$XMIN) ) / ($PPL$XLEN)
+   LET LN_xoff = -1* LN_just* LN_off * LN_xfac 
+ENDIF
+
+! See if label above or below was requested, and apply vertical offset.
+! Plot these labels to the right of the points, with the first character
+! just above or below the point.
+
+LET LN_yfac = 0.
+LET LN_yoff = 0.
+IF `LN_vert NE 0` THEN
+   LET LN_yfac = ( ($PPL$YMAX)-($PPL$YMIN) ) / ($PPL$YLEN)
+   LET LN_yoff = LN_vert* (LN_off + LN_lsiz)* LN_yfac 
+   IF `LN_vert EQ -1` THEN LET LN_yoff = `LN_yoff` - (LN_lsiz * LN_yfac)
+
+   LET LN_xfac = ( ($PPL$XMAX)-($PPL$XMIN) ) / ($PPL$XLEN)
+   LET LN_xoff = -1* LN_lsiz * LN_xfac 
+   LET LN_just = -1
+ENDIF
+
+
+! Initialize 
+LET LN_p = 0
+LET LN_n = 0
+
+! Case where we arent fixing the formatting of the values
+
+LET LN_npts = `LN_x,return=isize`
+IF `LN_ndig LT 0` THEN
+
+  REPEAT/i=1:`LN_npts` ( \
+    LET LN_xval = LN_x[i=`i`] + LN_xoff;\
+    LET LN_yval = LN_y[i=`i`] + LN_yoff;\
+    LET ln_vval = LN_v[i=`i`];\
+    LET LN_out1 = STRCAT(($LN_prefix),"`ln_vval`");\
+    LET LN_outlab = STRCAT(LN_out1,($LN_suffix));\  
+    LET LN_p = ln_vval AND `LN_prefix_exists eq 1`;\
+    LET LN_n = ln_vval AND `LN_prefix_exists eq 0`;\
+    IF `LN_p NE 0` THEN LABEL `LN_xval`, `LN_yval`, `LN_just`, 0, `LN_lsiz`,  `LN_outlab`;\
+    IF `LN_n NE 0` THEN LABEL `LN_xval`, `LN_yval`, `LN_just`, 0, `LN_lsiz`, "`LN_outlab`")
+ELSE 
+
+! Adjust format of values to show fewer digits if specified.
+
+  REPEAT/i=1:`LN_npts` ( \
+    LET LN_xval = LN_x[i=`i`] + LN_xoff;\  
+    LET LN_yval = LN_y[i=`i`] + LN_yoff;\
+    LET ln_vval = LN_v[i=`i`];\ 
+    LET LN_lab = "`ln_vval`";\
+    LET LN_ndot = STRINDEX(LN_lab, ".");\ 
+    LET LN_nlen = STRLEN(LN_lab);\
+    LET LN_wh = LN_nlen - LN_ndot + LN_ndig;\  
+    LET LN_out1 = SUBSTRING(LN_lab, 1, LN_wh);\
+    LET LN_out2 = STRCAT(($LN_prefix), LN_out1);\
+    LET LN_outlab = STRCAT(LN_out2, ($LN_suffix));\
+    LET LN_p = ln_vval AND `LN_prefix_exists eq 1`;\
+    LET LN_n = ln_vval AND `LN_prefix_exists eq 0`;\
+    IF `LN_p NE 0` THEN LABEL `LN_xval`, `LN_yval`, `LN_just`, 0, `LN_lsiz`, `LN_outlab`;\
+    IF `LN_n NE 0` THEN LABEL `LN_xval`, `LN_yval`, `LN_just`, 0, `LN_lsiz`, "`LN_outlab`")
+ENDIF
+
+! clean up
+SET REGION save
+CANCEL VARIABLE LN_*
+CANCEL SYMBOL LN_*
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/land.jnl b/jnls/go/land.jnl
new file mode 100644
index 0000000..aa00189
--- /dev/null
+++ b/jnls/go/land.jnl
@@ -0,0 +1,162 @@
+\cancel mode verify	! ... now overlaying coastal outline ...
+
+! Description: Plot outlines of continents, countries, and/or states
+
+!		        arg 1	      arg 2	   arg 3        arg 4
+! usage:   GO land [continent_pen] ["basemap"] [country_pen] [state_pen]
+
+! pens 	may be "0"(background), "1"(foreground), "thick"(same as pen 7),
+!	"black", "red", "green", "blue", or 2-18.
+! arg 2 may be "basemap", "overlay", "fast" (fast, 20e:20e overlay) or omitted
+
+!	Note 1: A pen color of "black" will actually pen number 1
+!		-- normally white if the window background is black
+!	Note 2: An "N" for the continent pen means no continents
+!		-- use this for the special case of geo-political
+!		   overlay without continents.
+
+! examples:
+!   GO land red        	  - overlay continents using red pen (2)
+!   GO land  10           - overlay continents using pen number 10
+!   GO land 1 basemap     - basemap of continents outline in foreground color
+!   GO land 1 fast        - overlay continents in region 20e to 380, only
+!   GO land 1 " " red     - overlay continents with countries in red
+!   GO land thick basemap black black - continents, countries, and states
+!   GO land N " " 1 1     - overlay: no continents; yes political boundaries
+
+! Notes:
+!  1) If a pen value is given for the country_pen or state_pen then the
+!	corresponding geopolitical boundaries will be drawn - else
+!	they will be omitted
+!  2) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+!  3) For more control over basemaps use "GO basemap"
+!
+!  4) 10/12/2004 ACM
+! This script has additions similar to commands in land_detail
+! to draw replications  +/-360 degrees longitude beyond the data
+! in geo_borders. This gives us -540 to 1100 degrees.
+
+! test argument before performing any actions
+query/ignore $1%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|fast|<argument 2 can be "basemap", "overlay", or "fast"%
+query/ignore $3%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+
+! introduce the outline data set
+set data/save
+use geo_borders
+
+!*!*
+! from land_detail: allow modulo duplications 360 deg beyond 
+! data in geo_borders
+
+! Initialize
+let landi_subx = 0
+let landi_addx = 0
+let landi_mapxmin = 0
+let landi_mapxmax = 0
+
+let landi_datxmin = 0
+let landi_datxmax = 0
+
+let landi_basemap = $2"0|basemap>1|*>0"
+
+IF `landi_basemap EQ 1` THEN
+   GO  basemap " " " " " " white
+ENDIF
+
+let landi_mapxmin = ($xaxis_min)
+let landi_mapxmax = ($xaxis_max)
+
+define region/default save
+cancel region
+
+let landi_datxmin = continent_LON[x=@min]
+let landi_datxmax = continent_LON[x=@max]
+IF `landi_mapxmin LT landi_datxmin` then let landi_subx = `landi_subx - 360`
+IF `landi_mapxmax GT landi_datxmax` then let landi_addx = `landi_addx + 360`
+
+!*!*
+
+! always do the continents
+$1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/line=1/$2"i=1:22585/overlay|basemap>i=1:22585/overlay|fast>i=4886:13712/overlay|*>i=1:22585/overlay" CONTINENT_LON, CONTINENT_LAT
+
+! select line style and plot
+ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+
+! set up axis formatting in case it is a basemap
+ppl xfor (I7,''LONE'')
+ppl yfor (I7,''LAT'')
+
+! draw it - as an overlay or as a basemap
+$1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+
+!*!*
+! Draw any lines outside 0 to 360
+
+IF `landi_addx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_addx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+
+IF `landi_subx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_subx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+!*!*
+
+! **** now the optional country borders
+$3"query/ignore|*>plot/set/vs/nolab/line=1/x=1:91083/overlay" COUNTRY_LON, COUNTRY_LAT
+
+! select line style and plot
+ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$3"query/ignore|*>ppl plot/overlay"
+
+!*!*
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_addx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_subx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+!*!*
+
+! **** now the optional state borders
+$4"query/ignore|*>plot/set/vs/nolab/line=1/x=1:7034/overlay" STATE_LON, STATE_LAT
+
+! select line style and plot
+ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$4"query/ignore|*>ppl plot/overlay"
+
+!*!*
+IF `landi_addx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_addx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_subx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+!*!*
+
+cancel data geo_borders
+cancel var landi_*
+
+set region save
+set data/restore
+set mode/last verify
diff --git a/jnls/go/land_detail.jnl b/jnls/go/land_detail.jnl
new file mode 100644
index 0000000..8af8a68
--- /dev/null
+++ b/jnls/go/land_detail.jnl
@@ -0,0 +1,233 @@
+\cancel mode verify	! ... now overlaying coastal outline ...
+
+! Description: Plot outlines of continents, countries, states, and/or rivers.
+!              This script, based on land.jnl, plot GMT intermediate-
+!              resolution coastline and boundary data and rivers.
+! 8/11/03 ACM 
+!
+! usage:   go land_detail arg1 [arg2] [arg3] [arg4] [arg5] [arg6] [arg7]
+!
+!    arg1  continent_pen  
+!    arg2 "basemap" "overlay", or omitted for overlay
+!    arg3 country_pen	Pen for optional national boundaries 
+!    arg4 state_pen	Pen for optional state boundaries (Western hemisphere)
+!    arg5 rivers_pen	Pen for largest rivers
+!    arg6 more_rivers	Pen for additional rivers 
+!    arg7 marine boundaries  Pen for marine boundaries in South Pacific, Bering Strait
+!
+!
+! pens 	may be "0"(background), "1"(foreground), "thick"(same as pen 7),
+!	"black", "red", "green", "blue", "lightblue" "purple" "white" or 2-19.
+!
+!	Note 1: A pen color of "black" will actually pen number 1
+!		-- normally white if the window background is black.
+!               White is always pen 19, white
+!	Note 2: An "N" for the continent pen means no continents
+!		-- use this for the special case of geo-political 
+!		   overlay or rivers without continents
+!       Note 3: This script plots data in the longitude range -360:720. If you need
+!               longitudes outside that range, this script may easily be modified
+!               to add or subtract multiples of 360 from the longitude variables.
+
+! examples:
+!   go land_detail red        	 - overlay continents using red pen (2)
+!   go land_detail  10           - overlay continents using pen number 10
+!   go land_detail 1 basemap     - basemap of continents outline in foreground color
+!   go land_detail 1 " " red     - overlay continents with countries in red
+!   go land_detail thick basemap black black - continents, countries, and states
+!   go land_detail thick " " red green blue lightblue purple - continents, countries, states, 
+!                                                 all rivers, and marine boundaries
+!   go land_detail N " " 1 1     - overlay: no continents; yes political boundaries
+
+! Notes:
+!  1) If a pen value is given for the country_pen or state_pen then the
+!	corresponding geopolitical boundaries will be drawn - else
+!	they will be omitted
+!  2) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+!  3) For more control over basemaps use "GO basemap"
+
+! test argument before performing any actions
+query/ignore $1%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|<argument 2 can be "basemap", "overlay"%
+query/ignore $3%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $5%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $6%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $7%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+set data/save
+define region/default save
+cancel region
+
+! introduce the outline data set
+use geo_borders_intermed
+
+! Initialize
+let landi_subx = 0
+let landi_addx = 0
+let landi_mapxmin = 0
+let landi_mapxmax = 0
+
+let landi_datxmin = 0
+let landi_datxmax = 0
+
+let landi_basemap = $2"0|basemap>1|*>0"
+
+IF `landi_basemap EQ 1` THEN
+   GO  basemap " " " " " " white
+ENDIF
+
+let landi_mapxmin = ($xaxis_min)
+let landi_mapxmax = ($xaxis_max)
+
+let landi_datxmin = continent_LON[x=@min]
+let landi_datxmax = continent_LON[x=@max]
+IF `landi_mapxmin LT landi_datxmin` then let landi_subx = `landi_subx - 360`
+IF `landi_mapxmax GT landi_datxmax` then let landi_addx = `landi_addx + 360`
+
+
+! always do the continents
+
+$1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/line=1/$2"i=1:193518/overlay|basemap>i=1:193518/overlay|*>i=1:193518/overlay" CONTINENT_LON, CONTINENT_LAT
+
+! select line style and plot
+ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19>19|N>1|"
+
+! set up axis formatting in case it is a basemap
+ppl xfor (I7,''LONE'')
+ppl yfor (I7,''LAT'')
+
+! draw it - as an overlay or as a basemap
+$1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+
+! Draw any lines outside 0 to 360
+
+IF `landi_addx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_addx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+
+IF `landi_subx NE 0` THEN 
+   plot/set/overlay/vs/nolab/line=1 CONTINENT_LON+landi_subx, CONTINENT_LAT
+   ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   ppl plot/overlay
+ENDIF
+
+! **** now the optional country borders
+$3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON, COUNTRY_LAT
+
+! select line style and plot
+ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$3"query/ignore|*>ppl plot/overlay"
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_addx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" COUNTRY_LON+landi_subx, COUNTRY_LAT
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $3"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! **** now the optional state borders
+$4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON, STATE_LAT
+
+! select line style and plot
+ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$4"query/ignore|*>ppl plot/overlay"
+
+IF `landi_addx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_addx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" STATE_LON+landi_subx, STATE_LAT
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $4"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! **** now the optional major and minor rivers
+$6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON, RIVER1_2_LAT
+
+! select line style and plot
+ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$6"query/ignore|*>ppl plot/overlay"
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON+landi_addx,RIVER1_2_LAT
+   ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $6"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_2_LON+landi_subx,RIVER1_2_LAT
+   ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $6"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! **** now the optional major rivers
+$5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON, RIVER1_LAT
+
+! select line style and plot
+ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$5"query/ignore|*>ppl plot/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON+landi_addx,RIVER1_LAT
+   ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $5"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" RIVER1_LON+landi_subx,RIVER1_LAT
+   ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $5"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+
+
+
+! **** now the optional marine boundaries
+$7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON, MARINE_LAT
+
+! select line style and plot
+ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$7"query/ignore|*>ppl plot/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF `landi_addx NE 0` THEN 
+   $7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON+landi_addx,MARINE_LAT
+   ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $7"query/ignore|*>ppl plot/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+   $7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" MARINE_LON+landi_subx,MARINE_LAT
+   ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+   $7"query/ignore|*>ppl plot/overlay"
+ENDIF
+
+! Restore data set and region
+cancel data geo_borders_intermed
+cancel var landi_*
+
+set region save
+set data/restore
+set mode/last verify
diff --git a/jnls/go/landscape.jnl b/jnls/go/landscape.jnl
new file mode 100644
index 0000000..2d2f64e
--- /dev/null
+++ b/jnls/go/landscape.jnl
@@ -0,0 +1,12 @@
+\cancel mode verify      ! ... now setting window to 11 x 8 1/2 size
+! Description: Set up for 11 x 8.5 page
+message/continue .....
+message/continue Use PPL/RESET to restore default graphics
+message/continue .....
+
+!ppl size 11,8.5
+!ppl axlen 8.8,5.7	! x axis has 2.2 inches space.  y axis has 2.8 inches
+
+set wind/asp=.8	! adjust screen size - immediate redraw
+
+set mode/last verify
diff --git a/jnls/go/landscape1x2.jnl b/jnls/go/landscape1x2.jnl
new file mode 100644
index 0000000..f1702ae
--- /dev/null
+++ b/jnls/go/landscape1x2.jnl
@@ -0,0 +1,16 @@
+\cancel mode verify      ! ... now defining 2 viewports vertically
+! Description: Set up for 2 viewports placed horizontally on an 11 x 8.5 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Use "SET VIEWPORT upper"  to select the upper, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue .....
+
+! The sizing is to fill a landscape 8 1/2 x 11 page.
+! use pre-defined viewports
+
+ppl/reset
+set window/aspect=0.8	
+
+
+set mode/last verify
diff --git a/jnls/go/landscape2x1.jnl b/jnls/go/landscape2x1.jnl
new file mode 100644
index 0000000..635c37d
--- /dev/null
+++ b/jnls/go/landscape2x1.jnl
@@ -0,0 +1,19 @@
+\cancel mode verify      ! ... now defining 2 viewports horizontally
+! Description: Set up for 2 viewports vertically placed on an 11 x 8.5 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Use "SET VIEWPORT left"  to select the left, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue .....
+
+! The sizing is to fill a landscape 8 1/2 x 11 page.
+! use pre-defined viewports
+
+ppl/reset
+set window/aspect=.8    ! ratio of 8 1/2 to 11
+! ppl box on
+
+
+set mode/last verify
+
+
diff --git a/jnls/go/landscape2x2.jnl b/jnls/go/landscape2x2.jnl
new file mode 100644
index 0000000..6193eba
--- /dev/null
+++ b/jnls/go/landscape2x2.jnl
@@ -0,0 +1,34 @@
+\cancel mode verify      ! ... now defining 4 viewports: 2 across, 2 down
+! Description: Set up for four viewports on an 11 x 8.5 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Viewport names are: ll4,lr4,ul4, and ur4
+message/continue ll4 -- lower left
+message/continue lr4 -- lower right
+message/continue ul4 -- upper left
+message/continue ur4 -- upper right
+message/continue Use "SET VIEWPORT ll"  to select the lower left, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue .....
+
+! Create 4 viewports on a landscape plot - 2 across, 2 down.
+! The sizing is to fill a landscape 8 1/2 x 11 page.
+
+ppl/reset
+set window/aspect=0.8    ! ratio of 8 1/2 to 11
+set mode/last verify
+
+\! define viewports
+
+define view/xlimits=0,.5/ylimits=0,.5 ll4
+define view/xlimits=.5,1/ylimits=0,.5 lr4
+define view/xlimits=0,.5/ylimits=.5,1 ul4
+define view/xlimits=.5,1/ylimits=.5,1 ur4
+
+\message/continue .....
+\message/continue In order to decrease amount of "dead space" in the plot,
+\message/continue simply modify the ylimits as defined above so that the
+\message/continue viewports slightly overlap each other.
+\message/continue .....
+
+\set window/size=.9	! immediate redraw / appropriate size
diff --git a/jnls/go/landscape3x2.jnl b/jnls/go/landscape3x2.jnl
new file mode 100644
index 0000000..4a69178
--- /dev/null
+++ b/jnls/go/landscape3x2.jnl
@@ -0,0 +1,38 @@
+\cancel mode verify      ! ... now defining 6 viewports: 3 across, 2 down
+! Description: Set up for six viewports on an 11 x 8.5 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Viewport names are: ll6,lm6,lr6,ul6,um6, and ur6
+message/continue ll6 -- lower left
+message/continue lm6 -- lower middle
+message/continue lr6 -- lower righe
+message/continue ul6 -- upper left
+message/continue um6 -- upper middle
+message/continue ur6 -- upper right
+message/continue Use "SET VIEWPORT lm6"  to select the lower middle, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue .....
+
+! Create 6 viewports on a landscape plot - 3 across, 2 down.
+! Use a larger that normal axis box since these teensy plots get so small.
+! The sizing is to fill a landscape 8 1/2 x 11 page.
+
+ppl/reset
+set window/aspect=.8    ! 8 1/2 x 11
+set mode/last verify
+
+\! define viewports
+define view/xlimits=0,.33/ylimits=0,.5   ll6
+define view/xlimits=.33,.66/ylimits=0,.5 lm6
+define view/xlimits=.66,1/ylimits=0,.5   lr6
+define view/xlimits=0,.33/ylimits=.5,1   ul6
+define view/xlimits=.33,.66/ylimits=.5,1 um6
+define view/xlimits=.66,1/ylimits=.5,1   ur6
+
+\message/continue .....
+\message/continue In order to decrease amount of "dead space" in the plot,
+\message/continue simply modify the ylimits as defined above so that the
+\message/continue viewports slightly overlap each other.
+\message/continue .....
+
+\set window/size = 0.6	! immediate redraw / appropriate screen size
diff --git a/jnls/go/landt.jnl b/jnls/go/landt.jnl
new file mode 100644
index 0000000..e2b6506
--- /dev/null
+++ b/jnls/go/landt.jnl
@@ -0,0 +1,10 @@
+\cancel mode verify 
+! updated 10/93 for Ferret V3.01
+
+! Description: Overlay the GFDL/MOM/Pacific boundaries based on the TS grid
+
+! define land mask as points with undefined TEMP and contour it at water edge
+
+CONT/OVER/NOLAB/lev="(.999,.999,1,-3) DARK(.999,.999,1,1)" MISSING( TEMP GT 0, 0 )
+
+set mode/last verify
diff --git a/jnls/go/landu.jnl b/jnls/go/landu.jnl
new file mode 100644
index 0000000..037d6d8
--- /dev/null
+++ b/jnls/go/landu.jnl
@@ -0,0 +1,10 @@
+\CANCEL MODE VERIFY
+
+! Description: Overlay the GFDL/MOM/Pacific boundaries based on the UV grid
+
+! define U land mask as points with undefined TEMP and contour it at midpoints
+! updated 10/93 for Ferret V3.01
+
+CONTOUR/OVER/NOLABELS/lev="(.5,.5,1,-3) DARK(.5,.5,1,1)" MISSING( TEMP GT 0, 0 )
+
+set mode/last verify
diff --git a/jnls/go/landz.jnl b/jnls/go/landz.jnl
new file mode 100644
index 0000000..36d8288
--- /dev/null
+++ b/jnls/go/landz.jnl
@@ -0,0 +1,87 @@
+\cancel mode verify	! ... now overlaying coastal outline ...
+! 
+! Description: Plot outlines of continents, countries, and/or states
+! Chooses the resolution based on the region being plotted:
+! calls land.jnl or land_detail.jnl
+!
+!
+!		        arg 1	      arg 2	   arg 3        arg 4        arg 5        arg 6        arg 7
+! usage:   GO landz [continent_pen] ["basemap"] [country_pen] [state_pen] [major_rivers] [more_rivers] [marine]
+!
+!    arg1  continent_pen 
+!    arg2 "basemap" "overlay", or omitted for overlay
+!    arg3 country_pen	Pen for optional national boundaries 
+!    arg4 state_pen	Pen for optional state boundaries (Western hemisphere)
+!    arg5 rivers_pen	Pen for largest rivers
+!    arg6 more_rivers	Pen for additional rivers 
+!    arg7 marine boundaries  Pen for marine boundaries in South Pacific, Bering Strait
+!
+! Rivers and marine boundaries are only available as part of the higher-resolution dataset.
+! Arguments 5, 6, and 7 will be ignored for ranges delta-x over 60 and delta-y over 30 degrees.
+
+!Examples
+
+!   GO landz red           - overlay continents using red pen (2)
+!   GO landz  10           - overlay continents using pen number 10
+!   GO landz 1 basemap     - basemap of continents outline in foreground color
+!   GO landz 1 " " red     - overlay continents with countries in red
+!   GO landz thick basemap black black - continents, countries, and states
+!   GO landz N " " 1 1     - overlay: no continents; yes political boundaries
+!   go landz black " " red green blue lightblue purple - continents, countries, states, 
+!                                                 all rivers, and marine boundaries
+
+! test argument before performing any actions
+query/ignore $1%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|<argument 2 can be "basemap", "overlay"%
+query/ignore $3%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $5%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $6%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $7%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+! Determine which land-line script to call
+
+LET landi_basemap = $2%0|basemap>1|*>0%
+
+IF `landi_basemap EQ 1` THEN
+   GO basemap " " " " " " white
+ENDIF
+
+LET landi_mapxmin = ($xaxis_min)
+LET landi_mapxmax = ($xaxis_max)
+LET landi_mapymin = ($yaxis_min)
+LET landi_mapymax = ($yaxis_max)
+
+! Decide which script to use: standard land.jnl or land_detail.jnl
+LET region_x_range = ($xaxis_max) - ($xaxis_min)
+LET region_y_range = ($yaxis_max) - ($yaxis_min)
+
+LET lz_detailed = 0
+IF `( region_x_range LT 80) OR ( region_y_range LT 40)` THEN LET lz_detailed = 1
+
+! Set symbols for arguments to pass to the land script
+$1%1|*>DEFINE SYMBOL lz_continent = $1%
+$3%query/ignore|*>DEFINE SYMBOL lz_country = $3% 
+$4%query/ignore|*>DEFINE SYMBOL lz_state = $4% 
+$5%query/ignore|*>DEFINE SYMBOL lz_river1 = $5% 
+$6%query/ignore|*>DEFINE SYMBOL lz_river2 = $6% 
+$7%query/ignore|*>DEFINE SYMBOL lz_marine = $7% 
+
+! If an argument symbol is not defined, send placeholder " ".
+
+IF `lz_detailed GT 0` THEN
+   GO land_detail ($lz_continent) "overlay" ($lz_country%" "%) ($lz_state%" "%) ($lz_river1%" "%) ($lz_river2%" "%) ($lz_marine%" "%)
+ELSE
+   GO land ($lz_continent) "overlay" ($lz_country%" "%) ($lz_state%" "%) 
+ENDIF
+
+! Clean up
+cancel symbol lz_continent
+cancel symbol lz_country
+cancel symbol lz_state
+cancel symbol lz_river1
+cancel symbol lz_river2
+cancel symbol lz_marine
+
+
+!  ----------------- End of landz.jnl ------------------------------------
diff --git a/jnls/go/left_axis_plot.jnl b/jnls/go/left_axis_plot.jnl
new file mode 100644
index 0000000..bf8f9eb
--- /dev/null
+++ b/jnls/go/left_axis_plot.jnl
@@ -0,0 +1,64 @@
+\cancel mode verify
+! left_yaxis_plot.jnl
+! Description: Plot a single variable preparing for a 2nd axis on the right
+
+! replaced 'GO magnify 1' with pertinent lines of magnify.jnl (problem
+! with state of mode verify) 11/93
+
+! Create a plot appropriately formatted for overlay of another variable using a
+! separate axis on the right side
+! This is the initialization routine for right_yaxis_plot.
+
+! usage:
+!	yes? GO left_yaxis_plot FERRET_expression_to_plot [title]
+! optional:	title (size may preceed it)
+
+! Note that this routine will alter the X axis length.
+!	Use SET VIEWPORT, CANCEL VIEWPORT or PPL/RESET to restore
+!	axis lengths following this plot
+
+!  example: temp and salt on same plot
+!	yes? SET REGION/L=0:500
+!	yes? GO left_axis_plot temp
+!	yes? GO right_axis_plot salt
+
+! reset axis sizes and positions (also cancels viewports)
+! GO magnify 1
+ppl origin 1.2, 1.4
+ppl set tmpx 'vp_width' - 2.2
+ppl set tmpy 'vp_height' - 2.8
+ppl axlen 'tmpx','tmpy'
+
+! initialize  (FERRET initializes PLOT+ through "plot/set")
+plot/set $1
+ppl title $3" "
+ppl set axov_midpoint 'ppl$ylen' / 2.0
+ppl set axov_ylabpos 'axov_midpoint' - 0.5
+ppl set axov_xlabpos -0.8
+ppl set axov_aline_start 'axov_midpoint' - 2.2
+ppl set axov_aline_end 'axov_midpoint' - 0.7
+ppl set axov_aline_xpos  -0.85
+
+! shorten the X axis a smidge to fit the right axis later
+ppl set axov_xlen 'ppl$xlen' - 0.5
+ppl axlen 'axov_xlen'
+
+! use this labelling scheme to get good black and white hard copy
+ppl ylab
+ppl labs/nouser 2,'axov_xlabpos','axov_ylabpos',-1 @AS'labtit'
+ppl hlabs 2,0.12
+ppl rlabs 2,90
+
+! set up the line specimen
+ppl aline/nouser 1,'axov_aline_xpos','axov_aline_start','axov_aline_xpos','axov_aline_end',on
+
+! turn off the right hand axis
+ppl axset 1,1,1,0
+
+! draw the plot
+ppl plot
+
+! clean up
+ppl rlabs 2,0
+!ppl axset 1,1,1,1 		  ! reset in right_axis_plot
+set mode/last verify
diff --git a/jnls/go/line_samples.jnl b/jnls/go/line_samples.jnl
new file mode 100644
index 0000000..8c8fe9b
--- /dev/null
+++ b/jnls/go/line_samples.jnl
@@ -0,0 +1,23 @@
+\cancel mode verify
+! line_samples.jnl
+
+! Description: draw examples of the line styles used by the PLOT command
+! updated 1/94 for Ferret V3.01
+
+let line_zero = i-i
+plot/set/nolab/i=1:10 line_zero+1
+ppl xaxis 1 10 1
+ppl yaxis 0 36 1
+ppl axlint 1 1
+ppl xfor (i3)
+ppl yfor (i3)
+ppl title "Default line styles used by the PLOT command"
+ppl axlabp 0 ; ppl tics 0,0   ! no X axis labels or tics
+ppl plot
+ppl %label/nouser 4,-1,0,0,.15  "(Style is combination of /LINE= and /SYMBOLS= qualifiers)"
+repeat/j=2:36:1 plot/over/nolab/i=1:10 line_zero+j
+
+ppl axlabp -1		! restore X axis label
+ppl tics 0.125,.25      ! restore X axis tics
+set mode/last verify
+
diff --git a/jnls/go/line_thickness.jnl b/jnls/go/line_thickness.jnl
new file mode 100644
index 0000000..01e241b
--- /dev/null
+++ b/jnls/go/line_thickness.jnl
@@ -0,0 +1,21 @@
+\cancel mode verify
+! line_thickness.jnl
+
+! Description: draw examples of the pen color/thickness in PLOT+
+! 1/94 *sh*
+! updated 6/99 *sh*
+! 7/01 *acm* update /ylimits to /vlimits
+
+
+! plot a sample of each /LINE= type
+plot/line=1/vlimits=1:18:1/hlimits=0:20:1/nolab/set i[i=1:20]*0+1
+ppl title .15 @SRLine color and thickness for qualifier /LINE= and command PPL PEN 1,n
+ppl axset 0,0,1,0;ppl yfor (I3); ppl axlint 1,1; ppl tics 0,0
+ppl plot
+repeat/j=2:18 plot/line=`j`/over/nolab i[i=1:20]*0+`j`
+
+! clean up
+ppl axset 1,1,1,1
+ppl axlabp -1    	! restore X axis labels
+ppl tics 0.125,.25	! restore X axis tics
+set mode/last verify
diff --git a/jnls/go/magnify.jnl b/jnls/go/magnify.jnl
new file mode 100644
index 0000000..33d1ac0
--- /dev/null
+++ b/jnls/go/magnify.jnl
@@ -0,0 +1,86 @@
+\ cancel mode verify
+!
+! magnify.jnl  (11/93)
+! modified to take separate X and Y factors 10/95
+! modified to take arguments shifting the origin 10/95 (NKL)
+ 
+! Description: rescale and shift the data plotting area (area inside the axes)
+
+! reset the default plotting with     yes? GO magnify 1
+
+ ! use this procedure as follows:
+!		      1         2         3        4
+!       GO magnify [factor] [yfactor] [xshift] [yshift]
+!               factor          - magnification factor (or X mag factor, only,
+!                                 when separate Y factor is supplied)
+!                                 (default = 100)
+!                       = 1     - restore default sizing
+!                       > 1     - increase plot area, decrease edge space
+!                       < 1     - decresae plot area, increase edge space
+!               yfactor         - separate factor for Y axis
+!                                 (default = same as X)
+!		xshift		- the distance (in plot inches) to shift the
+!				  x origin
+!		yshift		- the distance (in plot inches) to shift the
+!				  y origin
+! basic examples
+!	yes? contour/i=1:5/j=1:5 exp(j/2)/i	! default plot
+!       yes? GO magnify				! maximum magnification
+!	yes? contour/i=1:5/j=1:5 exp(j/2)/i	! magnified plot
+!       yes? GO magnify 1			! restore default sizing
+!	yes? contour/i=1:5/j=1:5 exp(j/2)/i	! default plot, again
+! more examples
+!       yes? GO magnify 0.5		!reduce plot area
+!       yes? GO magnify 0.9 2		!magnify X by 0.9 and Y by 2
+!	yes? GO magnify 0.9 2 1.1 -.7	! ... also shift right and down
+
+ ! Note 1: Magnification greater that 100 may have unpredictable results
+!       due to a 4 significant digit limit in PLOT+ symbols
+!       (e.g. 10.20 - 3.4000E-03  -> 10.20 using PLOT+ symbols)
+!       Magnifications less than 1 will have unpredictable results if they
+!       cause the expanded margins (below) to exceed the plot size
+ 
+! Note 2: This procedure must be called again AFTER each "SET VIEWPORT" or
+!	"SET WINDOW/ASPECT=xx" command
+
+! Note 3: The PLOT command recomputes the Y origin and axis length internally
+!	in order to allow room for plot keys.  When using this procedure
+!	together with PLOT follow this procedure:
+!	  yes? GO magnify
+!	  yes? PLOT/SET_UP ... your plot command ...
+!	  yes? GO magnify		! repeat the command
+!	  yes? PPL PLOT
+
+! standard plot margins are (dx,dy) = (1.2,1.4) in the lower left
+!                           (dx,dy) = (1.0,1.4) in the upper right
+! this procedure will divide those margins by the given factor
+ 
+! in case PLOT+ is not yet up and running ...
+PPL origin	! a no-op
+
+! define factors (inverse of the arguments passed)
+DEFINE SYMBOL x_mag_factor 1 / $1"100"
+DEFINE SYMBOL y_mag_factor 1 / $2"($x_mag_factor)"
+ 
+! origin shift requests
+DEFINE SYMBOL x_shift $3"0"
+DEFINE SYMBOL y_shift $4"0"
+
+! origin before shift
+DEFINE SYMBOL mag_xorg `1.2 * ($x_mag_factor)`
+DEFINE SYMBOL mag_yorg `1.4 * ($y_mag_factor)`
+
+! compute axis lengths based on origin and upper right margin
+DEFINE SYMBOL tmpx `1.0 * ($x_mag_factor)`
+DEFINE SYMBOL tmpy `1.4 * ($y_mag_factor)`
+DEFINE SYMBOL tmpx `($tmpx) + ($mag_xorg)`
+DEFINE SYMBOL tmpy `($tmpy) + ($mag_yorg)`
+DEFINE SYMBOL mag_xlen `($vp_width)  - ($tmpx)`
+DEFINE SYMBOL mag_ylen `($vp_height) - ($tmpy)`
+
+
+! set origin and axis length
+ppl origin `($mag_xorg)+($x_shift)`  `($mag_yorg)+($y_shift)`	! reset origin
+ppl axlen  ($mag_xlen)  ($mag_ylen)               	! reset axis lengths
+ 
+set mode/last verify
diff --git a/jnls/go/make_monthly_climatology.jnl b/jnls/go/make_monthly_climatology.jnl
new file mode 100644
index 0000000..93daa3f
--- /dev/null
+++ b/jnls/go/make_monthly_climatology.jnl
@@ -0,0 +1,112 @@
+\cancel mode verify
+! 2/94 - make_monthly_climatology.jnl
+
+! Description: create a monthly climatology data set
+!  NOTE:  For a more modern methodology, please see the FAQ 
+!  "How do I calculate climatologies and climatological anomalies?" at 
+!  http://www.ferret.noaa.gov/Ferret/FAQ/analysis/climatologies.html
+!  and also the topic "climatology" in the Ferret Users guide.
+
+! usage:  GO make_monthly_climatology variable clim_var_name clim_grid high_month ["append"] [out_file] 
+
+! variable:		variable from which to compute climatology
+!
+! clim_var_name:	name for climatological result variable
+!
+! clim_grid:		name of a grid containing the desired climatological
+!			time axis to use
+!			e.g. SHOW GRID SST[D=coads_climatology]
+!			Note: this argument is included because climatological
+!			time axes may differ:  e.g. equal length months for
+!			modelers, calendar months for data products, etc. 
+!
+! high_month:		highest monthe number in the input data to use
+!
+! (optional) append:	specify "append" to add new variables to a
+!			previously created climatology  (default = "NEW")
+!
+! (optional) out_file:	name of output data set
+!			(default "monthly_climatology.cdf")
+!
+
+! Notes:
+!  1) To produce a climatology with multiple variables use "append" and
+!	call this procedure once for each variable (see example)
+!  2) Known bug:  Each time this procedure is called it creates 12 time
+!	axes.  Ferret will allow a maximum of only 200 axes.  To append
+!	many climatological variables into a file it may be necessary to
+!	exit and restart Ferret.
+
+! Example:
+! Compute a Western Pacific Wind climatology from "monthly_navy_winds".
+! That data set (of FNOC winds) has 132 months in it.
+! Use the climatological time axis from the variable sst[d=coads_climatology]
+
+!	SET DATA coads_climatology
+!	SET DATA monthly_navy_winds
+!	SET REGION/x=130e:180/y=10s:10n
+!	GO make_monthly_climatology uwnd clim_uwind sst[d=coads_climatology] 132 new west_pacific_winds.cdf
+!	GO make_monthly_climatology vwnd clim_vwind sst[d=coads_climatology] 132 append west_pacific_winds.cdf
+
+! Explanation of example:
+! coads_climatology is a data set containing a climatological time axis to use.
+! SET REGION specifies the region of interest.
+! The first call to "GO make_monthly_climatology" computes "clim_uwind"
+! from "UWND" and outputs the results in a new file
+! The second call computes "clim_vwnd" from "VWND" in the same file
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO make_monthly_climatology variable clim_var_name clim_grid high_month ["append"] [file]%
+query/ignore $2%<Use: GO make_monthly_climatology variable clim_var_name clim_grid high_month ["append"] [file]%
+query/ignore $3%<Use: GO make_monthly_climatology variable clim_var_name clim_grid high_month ["append"] [file]%
+query/ignore $4%<Use: GO make_monthly_climatology variable clim_var_name clim_grid high_month ["append"] [file]%
+query/ignore $5%new|new|append<GO make_monthly_climatology: Argument 5 must be "new" or "append"%
+
+! ------------  START OF PROCEDURE -------------
+
+! clean-up in case the procedure crashed in the past
+cancel data/noerr every_12th_month.cdf
+spawn rm -f every_12th_month.cdf
+
+! if it's a new data set delete any previous one 
+cancel data/noerr $6"monthly_climatology.cdf"
+spawn $5"rm -i|new>rm -i|append>ls -l" $6"monthly_climatology.cdf"
+
+! define the output grid for the result
+define grid/like=$1/T=$3 gmnthclim
+
+! define the "time stamp" variable.
+! This variable is always zero in value but when added to a time-averaged
+! result (which has no fixed point location on a time axis in ferret's view)
+! it will impart its time "stamp" to that variable
+let/quiet clim_stamp = t[g=gmnthclim] - t[g=gmnthclim]
+
+
+! the procedure "one_climatological_month" will write all of the indicated
+! month (1, 2, 3, ..., 12) into a file under the variable name "mnthvar"
+! This statement will define the average of all those months and "stamp" it
+! as the indicated month number.
+! --> LET my_clim_var = input_var[l=1:9999 at ave] + clim_stamp
+! (inside one_climatology_month.jnl "input_var" with be every 12th month)
+let/quiet $2 = $1[l=1:9999 at ave] + clim_stamp ! output climatology result
+set variable/title=variable:$1 $2
+
+! (crudely) process each of the 12 months
+! --> one_climatology_month variable clim_var_name month_num high_month file
+GO one_climatology_month $1 $2   1   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   2   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   3   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   4   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   5   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   6   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   7   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   8   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2   9   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2  10   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2  11   $4 $6"monthly_climatology.cdf"
+GO one_climatology_month $1 $2  12   $4 $6"monthly_climatology.cdf"
+
+message/cont Type >>USE $6"monthly_climatology.cdf"<< (contains variable $2)
+
+cancel variable $2       ! definition now obsolete; use file values
+set mode/last verify
diff --git a/jnls/go/margins.jnl b/jnls/go/margins.jnl
new file mode 100644
index 0000000..3375643
--- /dev/null
+++ b/jnls/go/margins.jnl
@@ -0,0 +1,82 @@
+\ cancel mode verify
+! margins.jnl (10/30/95) (NKL)
+
+! Description: specify plot margins (layout of plot axes to window edges)
+
+! usage:             1       2       3      4
+!       GO margins [top] [bottom] [left] [right]
+!
+!       Arguments not specified will not be modified from current settings.
+!       Margins are specified in "inches" from edge of viewport.
+!
+! defaults          1.4     1.4     1.2    1.0
+!
+! also
+!       GO margins  "reset"     -- RESETS to default plot margins
+!       GO margins              -- query the current plot margins
+!
+! example:
+!       yes? go margins 0.2 0.6 " " 1.0
+!                                           
+!  	set margins to 0.2 on top, 0.6 bottom, left is unchanged, 1.0 on right
+!
+! a sample session - lay out two frames vertically:
+!	yes? SET DATA coads_climatology	! demo data set
+!	yes? SET VIEW upper		! use upper half of plot frame
+!	yes? SHADE/NOLAB sst[l=1]	! default plot layout
+!	yes? GO margins			! look at the current margins
+!	yes? GO margins 0.2 0.75	! adjust the vertical margins
+!	yes? SHADE/NOLAB sst[l=1]	! look at the resulting plot
+!	yes? GO margins  " ",,0.9,0.8	! adjust the horizontal margins
+!	yes? SHADE/NOLAB sst[l=1]	! look at the resulting plot
+!	yes? GO margins			! ask to look at the new margins
+!	yes? SET VIEW lower		! use lower half of plot frame
+!	yes? GO margins 0.2 0.75 0.9 0.8! use the same modified margins
+!	yes? SHADE/NOLAB sst[l=6]	! make the lower plot
+!	yes? GO margins   RESET		! return to default settings
+
+! Note 1: Issue "GO margins ..." AFTER changing the viewport with SET VIEWPORT
+!	  because SET VIEWPORT recomputes the origin and axis lengths.
+! Note 2: The "PLOT" command recomputes the vertical origin and axis length in
+!	  order to accomodate label keys. When adjusting margins for the
+!	  PLOT command follow the sequence:
+!	  	"PLOT/SET_UP ..." , then "GO margins ..." , then "PPL PLOT"
+
+! -----------make sure ppl is up and running
+ppl set junk            1
+ppl delete junk 
+
+! -----------prepare to process a query (if no arguments were given)
+define alias cmd0 "query/ignore"
+define alias cmd1 "message/continue"
+define symbol do_query cmd`$1"1|*>0"*$2"1|*>0"*$3"1|*>0"*$4"1|*>0"`  ! 1 or 0
+
+! -----------set symbols - default to current conditions
+define symbol top    $1"($vp_height) - ($ppl$yorg) - ($ppl$ylen)|reset>-10|*|"
+define symbol bottom $2"($ppl$yorg)"
+define symbol left   $3"($ppl$xorg)"
+define symbol right  $4"($vp_width) - ($ppl$xorg) - ($ppl$xlen)"
+
+! -----------Old conditions
+($do_query) "                            T     B     L    R"
+($do_query) "margins are  -- GO margins `($vp_height) - ($ppl$yorg) - ($ppl$ylen)`   `($ppl$yorg)`   `($ppl$xorg)`   `($vp_width) - ($ppl$xorg) - ($ppl$xlen)`"
+
+! ----------Reset is top = -10
+define symbol bottom    `if (($top)) le (-10) then 1.4 else (($bottom))`
+define symbol left      `if (($top)) le (-10) then 1.2 else (($left))`
+define symbol right     `if (($top)) le (-10) then 1.0 else (($right))`
+define symbol top       `if (($top)) le (-10) then 1.4 else (($top))`
+
+! -----------change origin, axis length
+ppl origin ($left),($bottom)
+ppl axlen `($vp_width) - ($left) - ($right)`,`($vp_height) - ($bottom) - ($top)`
+
+! clean up
+cancel alias cmd0
+cancel alias cmd1
+cancel symbol do_query
+cancel symbol top
+cancel symbol bottom
+cancel symbol left
+cancel symbol right
+set mode/last verify
diff --git a/jnls/go/mask_outline.jnl b/jnls/go/mask_outline.jnl
new file mode 100644
index 0000000..7a333cd
--- /dev/null
+++ b/jnls/go/mask_outline.jnl
@@ -0,0 +1,116 @@
+\cancel mode verify
+! mask_outline.jnl
+! *sh* 2/01
+! *sh* 3/01 - enhanced to support irregularly spaced axes
+!(*acm 6/01 - checked into directory jnls/go rather than jnls)
+! *acm 6/01 - correct bug: name of region now mo_reg throughout
+! 10/25/2004  This version works with irregular grids; it uses
+!             Ferret Pseudo-Variables XBOXLO, XBOXHI, YBOXLO, YBOXHI
+
+! Description: define a contour field with squared off lines for a 1-0 mask
+
+! Explanation:
+! A straightforward contour of a mask grid of 0's and 1's does not produce
+! a nice representation of the mask  because the contour lines do not
+! "square up" at the boundaries between grid cells. In this script we regrid
+! the mask to a new grid which when contoured produces squared off boundaries.
+
+!usage: GO mask_outline mask [color]
+
+!  arg 1 (mask)	- 2D mask of 0's and 1's on a grid.
+!  arg 2 (color)  Optional color to draw the lines
+
+! example
+!   yes? use etopo60
+!   yes? set region/x=90w:20e/y=15s:55n
+!   yes? shade rose
+!
+!   yes? let ocean_mask = IF rose LT 0 THEN 1 ELSE 0 
+!   yes? GO mask_outline ocean_mask
+!   yes? ovmo  ! think "overlay mask outline"
+
+! if the final line segments at the north and east of the plot are missing
+!   yes? cancel region
+!   yes? ovmo
+
+! use "yes? SHOW ALIAS ovmo" to see or modify the contour command
+
+! ================================================
+! The technique used is to define a modified mask grid as follows:
+! ('+' to incicate the corners of the boundaries between grid cells)
+! Say the original grid of 0's and 1's looks like this:
+!
+!       0     1     1
+!
+!    +     +     +     +
+!
+!       0     0     1
+!
+! We define a new mask which contains clusters of 4 points a small distance,
+! EPSILON, from one another immediately surrounding the cell corners.
+! (the original values are in parentheses):
+!
+!      (0)   (1)   (1)
+!     0   0 1   1 1   1
+!    +     +     +     +
+!     0   0 0   0 1   1
+!      (0)   (0)   (1)
+!
+! When the value 0.5 is contoured on this mask, the contour lines will pass
+! within EPSILON of the true corners.
+! ================================================
+
+! ***
+! Note that using the XBOXLO, YBOXLO pseudo-variables of Ferret V5.3 and higher
+! this script can be substantially simplified
+! ***
+
+! Save the current region -- to be restored at the end
+DEFINE REGION/DEFAULT mo_reg
+CANCEL REGION
+
+! define the modified X axis and cluster the mask values at the cell boundaries
+let mo_x    = X[g=$1]
+
+define symbol mo_np = `$1,return=isize`
+define symbol mo_st = `$1,return=istart`
+define symbol mo_en = `$1,return=iend`
+let mo_i1 = `$1,return=istart`
+let mo_i2 = `$1,return=iend`
+let mo_xhi = XBOXHI[i=`mo_i1`:`mo_i2`,g=$1]
+let mo_xlo = XBOXLO[i=`mo_i1`:`mo_i2`,g=$1] 
+
+define symbol mo_xeps `(mo_x[i=($mo_en)]-mo_x[i=($mo_st)])/(($mo_np)-1)/1e4,p=7`
+let mo_xpoints = XSEQUENCE(IF K[g=abstract,k=1:2] EQ 1 THEN TSEQUENCE(mo_xlo+($mo_xeps)) ELSE TSEQUENCE(mo_xhi-($mo_xeps)))
+define axis/X/units="`$1,return=xunits`" mo_xaxis = mo_xpoints
+
+! define the modified Y axis and cluster the mask values at the cell boundaries
+let mo_y    = Y[g=$1]
+
+define symbol mo_np = `$1,return=jsize`
+define symbol mo_st = `$1,return=jstart`
+define symbol mo_en = `$1,return=jend`
+
+let mo_j1 = `$1,return=jstart`
+let mo_j2 = `$1,return=jend`
+let mo_yhi = YBOXHI[j=`mo_j1`:`mo_j2`,g=$1]
+let mo_ylo = YBOXLO[j=`mo_j1`:`mo_j2`,g=$1] 
+
+define symbol mo_yeps  `(mo_y[j=($mo_en)]-mo_y[j=($mo_st)])/(($mo_np)-1)/1e4,p=7`
+
+let mo_ypoints = XSEQUENCE(IF K[g=abstract,k=1:2] EQ 1 THEN TSEQUENCE(mo_ylo+($mo_yeps)) ELSE TSEQUENCE(mo_yhi-($mo_yeps)))
+define axis/Y/units="`$1,return=yunits`" mo_yaxis = mo_ypoints
+
+! regrid the mask
+let $1_mo = INT($1[gx=mo_xaxis at ave,gy=mo_yaxis at ave]+.01) ! round to be safe
+
+! define an alias the user can type for easy plotting
+define alias ovmo cont/over/lev=(0.5,0.5,1,-3)/nolab/color=$2"black" $1_mo
+show alias ovmo
+say *** Use the command alias "ovmo" to overlay the mask outline ***
+
+! clean up
+cancel variables mo_*
+cancel symbol mo_*
+set region mo_reg
+set mode/last verify
diff --git a/jnls/go/max_area.jnl b/jnls/go/max_area.jnl
new file mode 100644
index 0000000..affac35
--- /dev/null
+++ b/jnls/go/max_area.jnl
@@ -0,0 +1,14 @@
+\ cancel mode verify
+! max_area.jnl  (11/93)
+
+! Description: set the data plotting area (inside the axes) to the full window
+
+! use this procedure as follows:
+!	GO max_area
+
+! reset to the default plotting with yes? PPL/RESET
+
+ppl origin 0,0
+ppl axlen 'VP_WIDTH','VP_HEIGHT'
+
+set mode/last verify
diff --git a/jnls/go/mp_aspect.jnl b/jnls/go/mp_aspect.jnl
new file mode 100644
index 0000000..74292f8
--- /dev/null
+++ b/jnls/go/mp_aspect.jnl
@@ -0,0 +1,41 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_aspect.jnl --  Adjust the window aspect ratio for the currently
+!                   displayed plot.  This routine is for use with 
+!                   map  projection scripts.
+!		    		
+! Jonathan Callahan
+! 4/99
+
+! Description:  Calculate the appropriate aspect ration
+!
+! Usage:             arg1
+!  go mp_aspect [aspect action]
+!
+! arg 1 - action to take after calculating the appropriate aspect ratio
+!         LIST - print out appropriate aspect ratio
+!         1(default) - issue SET WIN/ASPECT=`aspect_ratio`:ax command
+
+! Example 1: basic gridded field
+!
+!  use coads_climatology 
+!  set region/x=140:240/y=40n:70n/l=1
+!  set grid sst
+!  go mp_mercator
+!  go mp_aspect
+!  shade sst[l=1], x_page, y_page
+!
+
+let/quiet x_axis_range = `x_page[i=@max,j=@max]` - `x_page[i=@min,j=@min]`
+let/quiet y_axis_range = `y_page[i=@max,j=@max]` - `y_page[i=@min,j=@min]`
+let/quiet y_over_x = y_axis_range / x_axis_range
+
+if `$1"1|PRINT>0|LIST>0|SHOW>0|DISPLAY>0|<'go mp_aspect LIST' to display the ratio without setting it" eq 0` then
+    message/cont The appropriate aspect ratio is `y_over_x`
+elif `$1"1|PRINT>0|LIST>0|SHOW>0|DISPLAY>0|<'go mp_aspect LIST' to display the ratio without setting it" eq 1` then
+    set win/aspect=`y_over_x`:axis
+endif
+
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_bonne.jnl b/jnls/go/mp_bonne.jnl
new file mode 100644
index 0000000..8335131
--- /dev/null
+++ b/jnls/go/mp_bonne.jnl
@@ -0,0 +1,95 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_bonne.jnl --  Sets up variables for a Bonne projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Bonne map of the world
+!
+! Usage:              arg1             arg2            arg3             arg4
+!  go mp_bonne [central meridian] [std parallel] [std parallel N] [std parallel S]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+! arg 2 - latitude used for the northern edge of the projection
+! arg 2 - latitude used for the southern edge of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_bonne
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_bonne
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_bonne `mp_central_meridian` `mp_standard_parallel` `mp_standard_parallel_north` `mp_standard_parallel_south`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $9"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $9"<The standard parallel must be between -90 and 90"
+endif
+
+if `$3%0% gt 90` then
+    query/ignore $9"<The N standard parallel must be between -90 and 90"
+elif `$3%0% lt (-90)` then
+    query/ignore $9"<The N standard parallel must be between -90 and 90"
+endif
+
+if `$4%0% gt 90` then
+    query/ignore $9"<The S standard parallel must be between -90 and 90"
+elif `$4%0% lt (-90)` then
+    query/ignore $9"<The S standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet mp_std_parallel_north = $3%mp_y[j=@max]%
+let/quiet mp_std_parallel_south = $4%mp_y[j=@min]%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi2 = mp_std_parallel_north * deg2rad
+let/quiet mp_phi1 = mp_std_parallel_south * deg2rad
+let/quiet mp_phi0 = (mp_phi2 + mp_phi1) / 2
+let/quiet cot_mp_phi1 = cos(mp_phi1) / sin(mp_phi1)
+
+let/quiet mp_A = cot_mp_phi1 + mp_phi1 - mp_phi                   ! eqn (103)
+let/quiet mp_B = (mp_lambda - mp_lambda0) * cos(mp_phi) / mp_A    ! eqn (104)
+
+let/quiet x_page = mp_R * mp_A * sin(mp_B)                        ! eqn (105)
+let/quiet y_page = mp_R * (cot_mp_phi1 - mp_A*cos(mp_B))          ! eqn (106)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_craster_parabolic.jnl b/jnls/go/mp_craster_parabolic.jnl
new file mode 100644
index 0000000..1350f2f
--- /dev/null
+++ b/jnls/go/mp_craster_parabolic.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_craster_parabolic.jnl --  Sets up variables for a Craster Parabolic projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Craster Parabolic map of the world
+!
+! Usage:                          arg1               arg2
+!  go mp_craster_parabolic [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_craster_parabolic
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_craster_parabolic
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_craster_parabolic `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = 3^.5 * mp_R * (mp_lambda - mp_lambda0) * (2 * cos(2 * mp_phi / 3) - 1) / Pi^.5   ! eqn (54)
+let/quiet y_page = (3 * Pi)^.5 * mp_R * sin(mp_phi/3)                                         ! eqn (55)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_demo.jnl b/jnls/go/mp_demo.jnl
new file mode 100644
index 0000000..a65d5a6
--- /dev/null
+++ b/jnls/go/mp_demo.jnl
@@ -0,0 +1,162 @@
+! mp_demo.jnl 4/99 *JC*
+!            10/01 *acm* use /NOAXES, NOKEY
+! Description: demo of map projection scripts, including
+!
+! mp_aspect, mp_fland, mp_land, mp_label,  mp_graticule, mp_line, 
+! mp_orthographic, mp_sinusoidal, mp_lambert_cyl, mp_bonne, mp_mcbryde_fpp,
+! mp_polyconic, mp_stereographic_eq, mp_stereographic_north, mp_hammer,
+! mp_ocean_stripmap 
+ 
+! Here is your basic Ferret plot:
+!
+!
+message
+
+use coads_climatology
+set region/x=0:360/y=-90:90/l=1
+shade/title="Standard Plot" sst
+go fland
+
+!
+! Here is a sampling of what you can do with map
+! projections.  In this case:  a view from space.
+!
+message
+
+go mp_orthographic 210 45
+set grid sst
+go mp_aspect
+
+let masked_sst = sst * mp_mask
+fill/title="View From Space"/noaxes masked_sst, x_page, y_page
+go mp_fland
+go mp_land
+
+!
+! Let's add some labels in world coordinates:
+!
+go mp_label 237.7 47.6 -1 0 .1 @p5 at IISeattle
+go mp_label 204.4 19.5 -1 0 .1 @p5 at IIHawaii
+
+!
+! And two graticules:
+!   One for the whole world
+!   and one for the Bering Sea
+!
+go mp_graticule
+go mp_graticule 160 200 40 50 65 15 11
+go mp_label 180 45 0 -22 .15 "@p5 at DRThe Bering Sea"
+
+!
+! Here's how you can plot your own data
+! on top of the map projection.  This one
+! is a straight line between Hawaii and Seattle
+
+let a = 204.4 + (237.7-204.4)/20 * i
+let b = 19.5 + (47.6-19.5)/20 * i
+go mp_line plot/nolab/vs/over/i=1:20 a b
+
+!
+! Now a menagerie of projections from among
+! those provided with Ferret.
+!
+message
+
+set win/aspect=1:ax 3
+
+define viewport/xlimits=0.000,0.333/ylim=0.666,0.999 tl
+define viewport/xlimits=0.000,0.333/ylim=0.333,0.666 ml 
+define viewport/xlimits=0.000,0.333/ylim=0.000,0.333 bl
+define viewport/xlimits=0.333,0.666/ylim=0.666,0.999 tm
+define viewport/xlimits=0.333,0.666/ylim=0.333,0.666 mm
+define viewport/xlimits=0.333,0.666/ylim=0.000,0.333 bm
+define viewport/xlimits=0.666,0.999/ylim=0.666,0.999 tr
+define viewport/xlimits=0.666,0.999/ylim=0.333,0.666 mr 
+define viewport/xlimits=0.666,0.999/ylim=0.000,0.333 br
+ 
+set region/x=0:360/y=-90:90/l=1
+
+set view tl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst
+go fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Standard Plot
+
+set view tm
+go mp_sinusoidal
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Sinusoidal
+
+set view tr
+go mp_lambert_cyl
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Lambert Equal Area
+
+set view ml
+go mp_bonne
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Bonne
+
+set view mm
+go mp_mcbryde_fpp
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 McBryde Flat Polar
+
+set view mr
+go mp_polyconic
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Polyconic
+
+set view bl
+go mp_orthographic 300 45
+go margins .2, .6, .2, .2
+let masked_sst = sst * mp_mask
+shade/nolab/nokey/noaxes masked_sst, x_page, y_page
+go mp_graticule
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 OrthoGraphic
+
+set view bm
+set region/x=240:420
+go mp_stereographic_eq
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule 240 420 30 -90 90 15
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic Equatorial
+
+set view br
+set region/x=0:360/y=00:90
+go mp_stereographic_north
+go margins .2, .6, .2, .2
+shade/nolab/nokey/noaxes sst, x_page, y_page
+go mp_graticule 0 360 30 0 90 15
+go mp_fland 120 gray
+label/nouser `($PPL$XLEN)*0.5`,-0.4,0,0,.20 Stereographic North
+
+!
+! Finally, we'll create a fancy strip map centered on the Pacific.
+!
+message
+
+set win/size=.4/aspect=.5 3
+go mp_hammer
+set grid sst
+go mp_ocean_stripmap sst lev=(-2,20,4)(20,34,2) no_green 1 0
+
+
diff --git a/jnls/go/mp_eckert_greifendorff.jnl b/jnls/go/mp_eckert_greifendorff.jnl
new file mode 100644
index 0000000..fd8fec5
--- /dev/null
+++ b/jnls/go/mp_eckert_greifendorff.jnl
@@ -0,0 +1,74 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_eckert_greifendorff.jnl --  Sets up variables for a Eckert-Greifendorff projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Eckert-Greifendorff map of the world
+!
+! Usage:                            arg1               arg2
+!  go mp_eckert_greifendorff [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_eckert_greifendorff
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_eckert_greifendorff
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_eckert_greifendorff `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_W = 0.25
+let/quiet mp_D = 2 / (1 + cos(mp_phi) * cos(mp_W*(mp_lambda-mp_lambda0)))             ! eqn (170)
+
+let/quiet x_page = mp_R * (mp_D^.5)/mp_W * cos(mp_phi) * sin(mp_W*(mp_lambda-mp_lambda0))! eqn (171)
+let/quiet y_page = mp_R * mp_D^.5 * sin(mp_phi)                                       ! eqn (172)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_eckert_iii.jnl b/jnls/go/mp_eckert_iii.jnl
new file mode 100644
index 0000000..32701cb
--- /dev/null
+++ b/jnls/go/mp_eckert_iii.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_eckert_iii.jnl --  Sets up variables for a Eckert III projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Eckert III map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_eckert_iii [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_eckert_iii
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_eckert_iii
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_eckert_iii `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = 2 * (1 + (1-(2*mp_phi/Pi)^2)^.5) * mp_R * (mp_lambda-mp_lambda0) / (4 * Pi + Pi^2)^.5  ! eqn (38)
+let/quiet y_page = 4 * mp_R * mp_phi / (4 * Pi + Pi^2)^.5                                           ! eqn (39)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_eckert_v.jnl b/jnls/go/mp_eckert_v.jnl
new file mode 100644
index 0000000..25076e9
--- /dev/null
+++ b/jnls/go/mp_eckert_v.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_eckert_v.jnl --  Sets up variables for a Eckert V projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Eckert V map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_eckert_v [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_eckert_v
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_eckert_v
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_eckert_v `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (1 + cos(mp_phi)) * (mp_lambda-mp_lambda0) / (2 + Pi)^.5   ! eqn (27)
+let/quiet y_page = mp_R * 2 * (mp_phi) / (2 + Pi)^.5                           ! eqn (28)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_fland.jnl b/jnls/go/mp_fland.jnl
new file mode 100644
index 0000000..e75fc57
--- /dev/null
+++ b/jnls/go/mp_fland.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify
+! mp_fland.jnl - a land mask (overlay or "basemap" (default 60 minute resolution)
+! 4/93
+! 	 10/93 - updated for Ferret V3.01
+! 	 2/94  - added [basemap]
+! 	 11/94 - added transparent overlays and "detail" control
+!	  3/95 - added region arguments -- mostly to help point-and-click
+
+! Description: Plot or overlay an area-filled map of the continents
+
+! Usage:          arg1        arg2        arg3          arg4      arg5      arg6
+!  GO mp_fland [resolution] [palette] [overlay_style] [detail] [x=lo:hi] [y=lo:hi]
+
+! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=60
+!	  To use resolution "nnn" the file etoponnn must exist.
+! arg 2 - palette - may be any palette on your system.  Normally solid colors
+!		    like black, gray,red, etc. (see Fpalette '*') default=gray
+! arg 3 - overlay_style - "basemap", "transparent", or "overlay" (default)
+!         see note 2 below regarding "basemap"
+! arg 4 - detailed - may be "detailed", "all" or "solid"  default=solid
+!	  Use "detailed" together with a spectrum like dark_terrestrial
+!	  Use "all" to plot oceans as well as land.
+! arg 5 - longitude limits - specify as for any FERRET longitude range
+! arg 6 - latitude  limits - specify as for any FERRET latitude  range
+ 
+! Example:
+!	  GO mp_fland 		! default - 60 minute resolution, color gray
+!	  GO mp_fland 120		!  120 minute resolution
+!	  GO mp_fland 5		! 5 minute resolution - caution! it's LARGE
+!	  GO mp_fland 40 red	! 20 minute resolution with palette red.spk
+!	  GO mp_fland 40 red basemap
+!	  GO mp_fland 40 dark_terrestrial overlay detailed
+!	  GO mp_fland 20 gray transparent
+!	  GO mp_fland " " red	! default (60) minute resolution in red
+!	  GO mp_fland 40 dark_terrestrial overlay detailed x=160e:140w y=20s:20n
+! or for a good time try
+!	SET DATA monthly_navy_winds; VECTOR/l=1 uwnd,vwnd
+!	GO mp_fland  60 dark_terrestrial transparent detailed
+
+! Note 1: To use resolution "nnn" the file etoponnn must exist.
+! Note 2: If "basemap" is given then the current default region will determine
+!	  the region to be plotted (if a SET GRID or SET REGION command has 
+!         not been issued, you may need to set a region explicitly)
+! Note 3: The transparent option creates a see-through overlay land mask
+
+! check the overlay/basemap/transparent option
+query/ignore $3%overlay|overlay|basemap|transparent<3rd argument of GO mp_fland must be "overlay", "basemap", or "transparent"%
+query/ignore $4%not_required|detailed|solid|all> <4th argument of GO basemap may be "detailed", "solid" or "all" (ocean, too)%
+
+set data/save
+set grid/save
+
+set data etopo$1"60"
+
+IF ($mp_grid_variable"0|*>1) THEN
+  go mp_grid rose
+ELSE
+  set grid rose
+ENDIF
+
+set grid rose
+
+let/quiet masked_rose = mp_mask * rose
+
+
+shade/noaxis/nolab/nokey/lev=$4"(0,10000,10000)|detailed>(0,200,50)(200,1000,100)(1000,10000,1000)|solid>(0,10000,10000)|all>(-200,200,50)(-1000,1000,200)(-8000,8000,1000)"/pal=$2"gray"$3"/overlay|basemap> |*>/overlay"$5" |*>/*"$6" |*>/*" $3"masked_rose|transparent>if mod(i+j,2) eq 0 then masked_rose|*>masked_rose", x_page, y_page
+
+cancel data etopo$1"60"
+set grid/restore
+set data/restore
+set mode/last verify
diff --git a/jnls/go/mp_graticule.jnl b/jnls/go/mp_graticule.jnl
new file mode 100644
index 0000000..9658ef9
--- /dev/null
+++ b/jnls/go/mp_graticule.jnl
@@ -0,0 +1,227 @@
+\cancel mode verify    
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_graticule.jnl --  Overlay a graticule on a map projection.  For working
+!                  with map projection scripts in Ferret v4.50
+!                               
+! Jonathan Callahan
+! 5/97
+! This version from Ned Cokelet,  april 2001
+
+! *acm* 6/13/2001  bug fix: in restoring central meridians etc at the end
+!                  use grave accents to fix them.  else scripts like mp_polymark
+!                  cancels the grid and then recomputes x_page etc based on 
+!                  central meridian using the wrong x range 
+! *acm* 6/15/2001  add ppl window off  (and on at the end)  so graticule lines 
+!		   around the plot edge are complete.
+! *acm* 11/30/2001 change the name of the local variable mp_test to mp_gtest. 
+!                  Defining and cancelling it has an impact on mp_land.jnl
+! *acm*  9/24/03   Definition of mp_xaxdel gave gaps in the plotted lines, when 
+!                  mp_xaxdel does not divide the region exactly. Fix this, and
+!                  also add an argument window_flag to turn on windowing when
+!                  desired.
+! *acm*  9/30/04   replace REPEAT/K=2:5 with REPEAT/RANGE=2:5/NAME=m
+! *acm*  3/15/12   replace /NAME=m with /NAME=q
+
+! Description:  Overlay a graticule on a map.
+!
+! This journal file comes from equations in:
+!  J. P. Snyder & P. M. Voxland, 1989, An Album of Map Projections,
+!    U.S. Geological Survey, Professional Paper 1453, U.S. Government
+!    Printing Office, Washington, DC, 249 pp. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!       mp_lambda  longitude in radians
+!       mp_phi     latitude in radians
+!       x_page  field describing transformation from lat/lon to X page coordinates
+!       x_page  field describing transformation from lat/lon to Y page coordinates
+!
+! Usage:              arg1      arg2      arg3        arg4      arg5      arg6      arg7  arg8
+!  go mp_graticule [lon_min] [lon_max] [lon_delta] [lat_min] [lat_max] [lat_delta] [pen]  [winflag]
+!
+! arg 1 - minimum longitude
+! arg 2 - maximum longitude
+! arg 3 - spacing for the longitude graticule
+! arg 4 - minimum latitude
+! arg 5 - maximum latitude
+! arg 6 - spacing for the latitude graticule
+! arg 7 - pen number
+! arg 8 - window flag: 1 to window lines at the axes, 0 not to, default 0
+!
+! examples:
+!         go mp_graticule                         ! default - whole world in black
+!         go mp_graticule 120 220 20 35 65 2.5 5  ! graticule over northern Pacific in cyan
+!
+! Note:   If overlaying on a basemap or in any case where a SET GRID has
+!         not been issued, the current default region will determine
+!	  the region to be plotted.
+
+define region/default save
+set grid/save
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+!   Turn windowing of plot lines off, so the  
+!   lines are complete around the edge of the plot.
+
+ppl window off
+IF `$8"0" eq 1` THEN ppl window on
+
+!
+! create reasonable defaults for graticule spacing
+!
+let/quiet mp_xmin = $1"`mp_x[i=@min]`"
+let/quiet mp_xmax = $2"`mp_x[i=@max]`"
+
+if `mp_xmax - mp_xmin ge 180` then
+  let/quiet mp_xdel = $3"30"
+elif `mp_xmax - mp_xmin ge 60` then
+  let/quiet mp_xdel = $3"10"
+elif `mp_xmax - mp_xmin ge 10` then
+  let/quiet mp_xdel = $3"5"
+else
+  let/quiet mp_xdel = $3"1"
+endif
+
+let/quiet mp_ymin = $4"`mp_y[j=@min]`"
+let/quiet mp_ymax = $5"`mp_y[j=@max]`"
+
+if `mp_ymax - mp_ymin ge 180` then
+  let/quiet mp_ydel = $6"30"
+elif `mp_ymax - mp_ymin ge 60` then
+  let/quiet mp_ydel = $6"10"
+elif `mp_ymax - mp_ymin ge 10` then
+  let/quiet mp_ydel = $6"5"
+else
+  let/quiet mp_ydel = $6"1"
+endif
+
+!
+! This test will keep the central meridians defined by "from space" views
+!
+let/quiet mp_gtest = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+
+let/quiet mp_gtest = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+
+cancel variable mp_gtest
+
+let/quiet mp_std_parallel_north = `mp_y[j=@max]`
+let/quiet mp_std_parallel_south = `mp_y[j=@min]`
+
+!
+! Now for the appropriate latitude lines:
+!   Define a grid with the 'fast' index being longitude
+!   Have the axis be one point 'too long' and make the last point a bad value to avoid 'sweep-back'
+!   Set the region appropriately
+!   Redefine mp_lambda and mp_phi, mask and plot
+!
+!  ACM  6/01
+! Ned's  def uses mp_xdel.  This can be too coarse and results in a spider-web 
+! effect on projection plots over large areas
+!define axis/x=`mp_xmin`:`mp_xmax + mp_xdel`:`mp_xdel` lon_field_i_axis
+
+! Use delta of 1 as in Jon's original script, or mp_xdel if its smaller
+! let/quiet mp_xaxdel = MIN(mp_xdel, 1)
+
+! But, 9/03, This gives gaps when mp_xaxdel does not divide the region exactly
+! 
+let/quiet mp_xaxdel = mp_xdel
+repeat/range=2:5/NAME=q (if `mp_xaxdel gt 1` then let/quiet mp_xaxdel = mp_xdel/`q`)
+
+
+define axis/x=`mp_xmin`:`mp_xmax + mp_xaxdel`:`mp_xaxdel` lon_field_i_axis
+define axis/y=`mp_ymin`:`mp_ymax`:`mp_ydel` lon_field_j_axis
+
+let i_index = i[gx=lon_field_i_axis]
+let j_index = j[gy=lon_field_j_axis]
+
+let i_index_max = i_index[i=@max]
+let j_index_max = j_index[j=@max]
+
+set region/x=`mp_xmin`:`mp_xmax + mp_xaxdel`/y=`mp_ymin`:`mp_ymax`
+
+define grid/x=lon_field_i_axis/y=lon_field_j_axis lon_field_grid
+
+let/quiet lon_field_i = x[g=lon_field_grid] + 0*y[g=lon_field_grid]
+let/quiet lon_field_j = 0*x[g=lon_field_grid] + y[g=lon_field_grid]
+let/quiet lon_field_i_2 = if i[g=lon_field_grid] ne i_index_max then lon_field_i
+
+let/quiet mp_lambda = lon_field_i_2 * deg2rad
+let/quiet mp_phi    = lon_field_j   * deg2rad
+
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+
+plot/vs/over/nolab/line=$7"1" masked_x_page, masked_y_page
+
+!
+! Now for the appropriate longitude lines:
+!
+! ACM 6/2001 choose smaller delta here too.
+!define axis/x=`mp_ymin`:`mp_ymax + mp_ydel`:`mp_ydel` lat_field_i_axis
+
+let/quiet mp_yaxdel = MIN(mp_ydel,1)
+define axis/x=`mp_ymin`:`mp_ymax + mp_yaxdel`:`mp_yaxdel` lat_field_i_axis
+define axis/y=`mp_xmin`:`mp_xmax`:`mp_xdel` lat_field_j_axis
+
+let i_index = i[gx=lat_field_i_axis]
+let j_index = j[gy=lat_field_j_axis]
+
+set region/x=`mp_ymin`:`mp_ymax + mp_yaxdel`/y=`mp_xmin`:`mp_xmax`
+
+define grid/x=lat_field_i_axis/y=lat_field_j_axis lat_field_grid
+
+let/quiet lat_field_i = x[g=lat_field_grid] + 0*y[g=lat_field_grid]
+let/quiet lat_field_j = 0*x[g=lat_field_grid] + y[g=lat_field_grid]
+let/quiet lat_field_i_2 = if i[g=lat_field_grid] ne i_index_max then lat_field_i
+
+let/quiet mp_lambda = lat_field_j   * deg2rad
+!let/quiet mp_phi    = lat_field_i_2 * deg2rad
+
+let/quiet mp_phi    = lat_field_i_2[g=lat_field_grid] * deg2rad	! acm - like Jons original
+
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+
+plot/vs/over/nolab/line=$7"1" masked_x_page, masked_y_page
+!
+! Restore all the previous settings and variables
+!
+set region save
+set grid/restore
+
+ppl window on
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+let/quiet mp_gtest = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+
+let/quiet mp_gtest = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_gtest eq 0` then
+   let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+
+cancel variable mp_gtest
+
+let/quiet mp_std_parallel_north = mp_y[j=@max]
+let/quiet mp_std_parallel_south = mp_y[j=@min]
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_graticule_limit.jnl b/jnls/go/mp_graticule_limit.jnl
new file mode 100644
index 0000000..54155f3
--- /dev/null
+++ b/jnls/go/mp_graticule_limit.jnl
@@ -0,0 +1,258 @@
+\ cancel mode verify    
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_graticule_limit.jnl --  Overlay a graticule on a map projection.  For working
+!                  with map projection scripts in Ferret v4.50
+!                               
+! Ansley Manke
+! 12/16/02
+!
+! Description:  Overlay a graticule on a map, limited by a range of x and
+!               y page coordinates.
+!
+! Based on mp_graticule.jnl
+!
+! This journal file comes from equations in:
+!  J. P. Snyder & P. M. Voxland, 1989, An Album of Map Projections,
+!    U.S. Geological Survey, Professional Paper 1453, U.S. Government
+!    Printing Office, Washington, DC, 249 pp. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!       mp_lambda  longitude in radians
+!       mp_phi     latitude in radians
+!       x_page  field describing transformation from lat/lon to X page coordinates
+!       x_page  field describing transformation from lat/lon to Y page coordinates
+!
+! Usage:              arg1      arg2      arg3        arg4      arg5      arg6      arg7   arg8    arg9    arg10   arg11
+!  go mp_graticule [lon_min] [lon_max] [lon_delta] [lat_min] [lat_max] [lat_delta] [pen] [mp_minxp] [mp_maxxp] [mp_minyp] [mp_maxyp]
+!
+! arg 1 - minimum longitude
+! arg 2 - maximum longitude
+! arg 3 - spacing for the longitude graticule
+! arg 4 - minimum latitude
+! arg 5 - maximum latitude
+! arg 6 - spacing for the latitude graticule
+! arg 7 - pen number
+! arg 8 - minimum x to plot, in page-coordinates  (if these are specified,
+! arg 9 - maximum x to plot, in page-coordinates   all four must be provided.)
+! arg10 - minimum y to plot, in page-coordinates
+! arg11 - maximum y to plot, in page-coordinates
+! arg12 - dash characteristics: dash(dn,up,dn,up)
+!
+! example:  Limit the plot to a square, in terms of plot page coordinates.
+!   use etopo60
+!   set region/y=0:90
+!   go mp_stereographic_north
+!   set grid rose
+!   go mp_aspect
+!   shade/l=1/hlim=-1:1/vlim=-1:1/noax/nolab rose,x_page,y_page
+!   go mp_graticule_limit " ", " ", " ", " ", " ", " ", " ", -1,1,-1,1, dash=(.1,.18,.1,.18)
+!   plot/over/vs/line/nolabel/color=black {-1,1,1,-1,-1}, {-1,-1,1,1,-1}
+!
+!
+!   ! Note:   If overlaying on a basemap or in any case where a SET GRID has
+!         not been issued, the current default region will determine
+!	  the region to be plotted.
+
+define region/default save
+set grid/save
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+!   Turn windowing of plot lines off, so the  
+!   lines are complete around the edge of the plot.
+
+ppl window off
+!
+! create reasonable defaults for graticule spacing
+!
+
+let/quiet mp_xmin = $1"`mp_x[i=@min]`"
+let/quiet mp_xmax = $2"`mp_x[i=@max]`"
+
+if `mp_xmax - mp_xmin ge 180` then
+  let/quiet mp_xdel = $3"30"
+elif `mp_xmax - mp_xmin ge 60` then
+  let/quiet mp_xdel = $3"10"
+elif `mp_xmax - mp_xmin ge 10` then
+  let/quiet mp_xdel = $3"5"
+else
+  let/quiet mp_xdel = $3"1"
+endif
+
+let/quiet mp_ymin = $4"`mp_y[j=@min]`"
+let/quiet mp_ymax = $5"`mp_y[j=@max]`"
+
+if `mp_ymax - mp_ymin ge 180` then
+  let/quiet mp_ydel = $6"30"
+elif `mp_ymax - mp_ymin ge 60` then
+  let/quiet mp_ydel = $6"10"
+elif `mp_ymax - mp_ymin ge 10` then
+  let/quiet mp_ydel = $6"5"
+else
+  let/quiet mp_ydel = $6"1"
+endif
+
+! parameters to limit the graticule to a rectangle
+let/quiet mp_minxp = $8%99%
+let/quiet mp_maxxp = $9%99%
+let/quiet mp_minyp = $10%99%
+let/quiet mp_maxyp = $11%99%
+
+def sym dashline = /$12%dash=(1,0,1,0)%
+
+! This test will keep the central meridians defined by "from space" views
+!
+let/quiet mp_gtest = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+
+let/quiet mp_gtest = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+
+cancel variable mp_gtest
+
+let/quiet mp_std_parallel_north = `mp_y[j=@max]`
+let/quiet mp_std_parallel_south = `mp_y[j=@min]`
+
+!
+! Now for the appropriate latitude lines:
+!   Define a grid with the 'fast' index being longitude
+!   Have the axis be one point 'too long' and make the last point a bad value to avoid 'sweep-back'
+!   Set the region appropriately
+!   Redefine mp_lambda and mp_phi, mask and plot
+!
+!  ACM  6/01
+! Ned's  def uses mp_xdel.  This can be too coarse and results in a spider-web 
+! effect on projection plots over large areas
+!define axis/x=`mp_xmin`:`mp_xmax + mp_xdel`:`mp_xdel` lon_field_i_axis
+
+! Use delta of 1 as in Jon's original script, or mp_xdel if its smaller
+let/quiet mp_xaxdel = MIN(mp_xdel, 1)
+define axis/x=`mp_xmin`:`mp_xmax + mp_xaxdel`:`mp_xaxdel` lon_field_i_axis
+define axis/y=`mp_ymin`:`mp_ymax`:`mp_ydel` lon_field_j_axis
+
+let i_index = i[gx=lon_field_i_axis]
+let j_index = j[gy=lon_field_j_axis]
+
+let i_index_max = i_index[i=@max]
+let j_index_max = j_index[j=@max]
+
+set region/x=`mp_xmin`:`mp_xmax + mp_xaxdel`/y=`mp_ymin`:`mp_ymax`
+
+define grid/x=lon_field_i_axis/y=lon_field_j_axis lon_field_grid
+
+let/quiet lon_field_i = x[g=lon_field_grid] + 0*y[g=lon_field_grid]
+let/quiet lon_field_j = 0*x[g=lon_field_grid] + y[g=lon_field_grid]
+let/quiet lon_field_i_2 = if i[g=lon_field_grid] ne i_index_max then lon_field_i
+
+let/quiet mp_lambda = lon_field_i_2 * deg2rad
+let/quiet mp_phi    = lon_field_j   * deg2rad
+
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+
+! If requested, limit the lines to a box defined by the last 4 arguments.
+
+
+let ok1 = if `mp_minxp NE 99` then 1
+let ok2 = if `mp_maxxp NE 99` then 1
+let ok3 = if `mp_minyp NE 99` then 1
+let ok4 = if `mp_maxyp NE 99` then 1
+let ok = ok1 + ok2 + ok3 + ok4
+
+IF `ok eq 4` THEN
+  let/quiet limit_x_page_a = if masked_x_page ge mp_minxp then masked_x_page
+  let/quiet limit_y_page_a = if masked_y_page ge mp_minyp then masked_y_page
+
+  let/quiet limit_x_page = if masked_x_page LE mp_maxxp then limit_x_page_a
+  let/quiet limit_y_page = if masked_y_page LE mp_maxyp then limit_y_page_a
+ELSE
+  let limit_x_page - masked_x_page
+  let limit_y_page = masked_y_page
+ENDIF
+
+plot/vs/over/nolab/line=$7"1"($dashline) limit_x_page, limit_y_page
+
+!
+! Now for the appropriate longitude lines:
+!
+! ACM 6/2001 choose smaller delta here too.
+!define axis/x=`mp_ymin`:`mp_ymax + mp_ydel`:`mp_ydel` lat_field_i_axis
+
+let/quiet mp_yaxdel = MIN(mp_ydel,1)
+define axis/x=`mp_ymin`:`mp_ymax + mp_yaxdel`:`mp_yaxdel` lat_field_i_axis
+define axis/y=`mp_xmin`:`mp_xmax`:`mp_xdel` lat_field_j_axis
+
+let i_index = i[gx=lat_field_i_axis]
+let j_index = j[gy=lat_field_j_axis]
+
+set region/x=`mp_ymin`:`mp_ymax + mp_yaxdel`/y=`mp_xmin`:`mp_xmax`
+
+define grid/x=lat_field_i_axis/y=lat_field_j_axis lat_field_grid
+
+let/quiet lat_field_i = x[g=lat_field_grid] + 0*y[g=lat_field_grid]
+let/quiet lat_field_j = 0*x[g=lat_field_grid] + y[g=lat_field_grid]
+let/quiet lat_field_i_2 = if i[g=lat_field_grid] ne i_index_max then lat_field_i
+
+let/quiet mp_lambda = lat_field_j   * deg2rad
+!let/quiet mp_phi    = lat_field_i_2 * deg2rad
+
+let/quiet mp_phi    = lat_field_i_2[g=lat_field_grid] * deg2rad	! acm - like Jons original
+
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+
+
+IF `ok` THEN
+  let/quiet limit_x_page_a = if masked_x_page ge mp_minxp then masked_x_page
+  let/quiet limit_y_page_a = if masked_y_page ge mp_minyp then masked_y_page
+
+  let/quiet limit_x_page = if masked_x_page LE mp_maxxp then limit_x_page_a
+  let/quiet limit_y_page = if masked_y_page LE mp_maxxp then limit_y_page_a
+ELSE
+  let limit_x_page - masked_x_page
+  let limit_y_page = masked_y_page
+ENDIF
+
+plot/vs/over/nolab/line=$7"1"($dashline) limit_x_page, limit_y_page
+
+
+!
+! Restore all the previous settings and variables
+!
+set region save
+set grid/restore
+
+ppl window on
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+let/quiet mp_gtest = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+
+if `mp_gtest eq 0` then
+   let/quiet mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+
+let/quiet mp_gtest = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_gtest eq 0` then
+   let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+
+cancel variable mp_gtest
+
+let/quiet mp_std_parallel_north = mp_y[j=@max]
+let/quiet mp_std_parallel_south = mp_y[j=@min]
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_grid.jnl b/jnls/go/mp_grid.jnl
new file mode 100644
index 0000000..dfea95e
--- /dev/null
+++ b/jnls/go/mp_grid.jnl
@@ -0,0 +1,28 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_grid.jnl --  Associate a grid with the mp_x and mp_y variables.  For
+!                 working with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 10/99
+
+! Description:  Associates a data grid with a predefined map projection. 
+!
+! Usage:        arg1
+!  go mp_grid variable
+!
+! arg 1 - variable name
+!
+! Example:
+!	  go mp_grid sst
+!
+
+query/ignore $1%<Specify a variable%
+
+define symbol mp_grid_variable = $1
+
+let mp_x = x[g=($mp_grid_variable)]
+let mp_y = y[g=($mp_grid_variable)]
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_hammer.jnl b/jnls/go/mp_hammer.jnl
new file mode 100644
index 0000000..a1350fd
--- /dev/null
+++ b/jnls/go/mp_hammer.jnl
@@ -0,0 +1,74 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_hammer.jnl --  Sets up variables for a Hammer projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Hammer map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_hammer [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_hammer
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_hammer
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_hammer `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_W = 0.5
+let/quiet mp_D = 2 / (1 + cos(mp_phi) * cos(mp_W*(mp_lambda-mp_lambda0)))       ! eqn (170)
+
+let/quiet x_page = mp_R * (mp_D^.5)/mp_W * cos(mp_phi) * sin(mp_W*(mp_lambda-mp_lambda0)) ! eqn (171)
+let/quiet y_page = mp_R * mp_D^.5 * sin(mp_phi)                                 ! eqn (172)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_label.jnl b/jnls/go/mp_label.jnl
new file mode 100644
index 0000000..9518c7a
--- /dev/null
+++ b/jnls/go/mp_label.jnl
@@ -0,0 +1,93 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_label.jnl --  Place a label on a map projection.  For working
+!                  with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Place a label on a map projection using user coordinates
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	mp_lambda  longitude in radians
+!       mp_phi     latitude in radians
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!
+! Usage:        arg1   arg2    arg3    arg4    arg5   arg6
+!  go mp_label [xpos] [ypos] [center] [angle] [size] [text]
+!
+! arg 1 - X position in user units (world longitude)
+! arg 2 - Y position in user units (world latitude)
+! arg 3 - justification -1:left  0:center  1:right
+! arg 4 - angle in degrees, 0 degrees a 3 o'clock
+! arg 5 - size of text in inches
+! arg 6 - text to use as label
+!
+! Example:
+!	  go mp_label 237.7 47.6 -1 20 .1 @p2 at IISeattle     ! mark "Seattle" on the map
+!
+
+query/ignore $1%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+query/ignore $2%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+query/ignore $3%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+query/ignore $4%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+query/ignore $5%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+query/ignore $6%<Specify all arguments: [xpos] [ypos] [center] [angle] [size] [text]%
+
+define region/default save
+set grid/save
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+let/quiet mp_std_parallel_north = `mp_y[j=@max]`
+let/quiet mp_std_parallel_south = `mp_y[j=@min]`
+
+!
+! This test will keep the central meridians defined by "from space" views
+!
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+cancel variable mp_test
+
+
+let/quiet mp_lambda = $1 * deg2rad
+let/quiet mp_phi = $2 * deg2rad
+
+label `x_page`, `y_page`, $3, $4, $5  $6
+
+!
+! Restore previous settings
+!
+set region save
+set grid/restore
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+
+cancel variable mp_test
+let/quiet mp_std_parallel_north = mp_y[j=@max]
+let/quiet mp_std_parallel_south = mp_y[j=@min]
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_lambert_cyl.jnl b/jnls/go/mp_lambert_cyl.jnl
new file mode 100644
index 0000000..b9b517d
--- /dev/null
+++ b/jnls/go/mp_lambert_cyl.jnl
@@ -0,0 +1,71 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_lambert_cyl.jnl --  Sets up variables for a Lambert Cylindrical equal area
+!                  projection using 'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Lambert Cylindrical Equal Area map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_lambert_cyl [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_lambert_cyl
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_lambert_cyl
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_lambert_cyl `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (mp_lambda-mp_lambda0)                    ! eqn (1)
+let/quiet y_page = mp_R * sin(mp_phi)                               ! eqn (9)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_land.jnl b/jnls/go/mp_land.jnl
new file mode 100644
index 0000000..279d916
--- /dev/null
+++ b/jnls/go/mp_land.jnl
@@ -0,0 +1,244 @@
+\cancel mode verify	
+! ... now overlaying coastal outline ...
+
+! Description: Plot outlines of continents, countries, and/or states
+
+!		        arg 1	      arg 2	   arg 3        arg 4
+! Usage:   GO mp_land [continent_pen] ["basemap"] [country_pen] [state_pen]
+
+! pens 	may be "0"(background), "1"(foreground), "thick"(same as pen 7),
+!	"black", "red", "green", "blue", or 2-18.
+! arg 2 may be "basemap", "overlay", "fast" (fast, 20e:20e overlay) or omitted
+
+!	Note 1: A pen color of "black" will actually pen number 1
+!		-- normally white if the window background is black
+!	Note 2: An "N" for the continent pen means no continents
+!		-- use this for the special case of geo-political
+!		   overlay without continents.
+
+! Example:
+!   GO mp_land red        	  - overlay continents using red pen (2)
+!   GO mp_land  10           - overlay continents using pen number 10
+!   GO mp_land 1 basemap     - basemap of continents outline in foreground color
+!   GO mp_land 1 fast        - overlay continents in region 20e to 380, only
+!   GO mp_land 1 " " red     - overlay continents with countries in red
+!   GO mp_land thick basemap black black - continents, countries, and states
+!   GO mp_land N " " 1 1     - overlay: no continents; yes political boundaries
+
+! Notes:
+!  1) If a pen value is given for the country_pen or state_pen then the
+!	corresponding geopolitical boundaries will be drawn - else
+!	they will be omitted
+!  2) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+!  3) For more control over basemaps use "GO basemap"
+
+! test argument before performing any actions
+query/ignore $1%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO mp_land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|fast|<argument 2 can be "basemap", "overlay", or "fast"%
+query/ignore $3%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO mp_land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO mp_land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+! introduce the outline data set
+set data/save
+set grid/save
+
+let/quiet mp_x = x
+let/quiet mp_xmin = `mp_x[i=@min]`
+let/quiet mp_xmax = `mp_x[i=@max]`
+let/quiet mp_y = y
+let/quiet mp_ymin = `mp_y[j=@min]`
+let/quiet mp_ymax = `mp_y[j=@max]`
+let/quiet mp_std_parallel_north = mp_ymax
+let/quiet mp_std_parallel_south = mp_ymin
+
+!
+! This test will keep the central meridians defined by "from space" views
+!
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+cancel variable mp_test
+
+
+use geo_borders
+
+! Initialize
+let landi_subx = 0
+let landi_addx = 0
+let landi_datxmin = continent_lon[x=@min]
+let landi_datxmax = continent_lon[x=@max]
+
+let landi_basemap = $2"0|basemap>1|*>0"
+IF `landi_basemap EQ 0` THEN
+
+   IF `mp_xmin LT landi_datxmin` then let landi_subx = `landi_subx - 360`
+   IF `mp_xmax GT landi_datxmax` then let landi_addx = `landi_addx + 360`
+
+ENDIF
+ 
+
+! always do the continents
+set grid CONTINENT_LON
+let/quiet mp_lambda = if (CONTINENT_LON ge mp_xmin and CONTINENT_LON le mp_xmax and CONTINENT_LAT ge mp_ymin and CONTINENT_LAT le mp_ymax) then (CONTINENT_LON * deg2rad)
+let/quiet mp_phi = if (CONTINENT_LON ge mp_xmin and CONTINENT_LON le mp_xmax and CONTINENT_LAT ge mp_ymin and CONTINENT_LAT le mp_ymax) then (CONTINENT_LAT * deg2rad)
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+$1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:22585/overlay|basemap>i=4886:13712|fast>i=4886:13712/overly|*>i=1:22585/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+
+! set up axis formatting in case it is a basemap  !!! incorrect for map projection plots!
+! ppl xfor (I7,''LONE'')
+! ppl yfor (I7,''LAT'')
+
+! draw it - as an overlay or as a basemap
+$1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF ($1"0|*>1") THEN
+
+IF `landi_addx NE 0` THEN 
+  set grid continent_lon
+  let/quiet mp_lambda = if ((continent_lon+landi_addx) ge mp_xmin and (continent_lon+landi_addx) le mp_xmax and \
+   continent_lat ge mp_ymin and continent_lat le mp_ymax) then ((continent_lon+landi_addx) * deg2rad)
+  let/quiet mp_phi = if ((continent_lon+landi_addx) ge mp_xmin and (continent_lon+landi_addx) le mp_xmax and \
+   continent_lat ge mp_ymin and continent_lat le mp_ymax) then (continent_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+  set grid continent_lon
+  let/quiet mp_lambda = if ((continent_lon+landi_subx) ge mp_xmin and (continent_lon+landi_subx) le mp_xmax and \
+   continent_lat ge mp_ymin and continent_lat le mp_ymax) then ((continent_lon+landi_subx) * deg2rad)
+  let/quiet mp_phi = if ((continent_lon+landi_subx) ge mp_xmin and (continent_lon+landi_subx) le mp_xmax and \
+   continent_lat ge mp_ymin and continent_lat le mp_ymax) then (continent_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+
+ENDIF  ! lines outside 0 to 360
+
+! **** now the optional country borders
+set grid COUNTRY_LON
+let/quiet mp_lambda = if (COUNTRY_LON ge mp_xmin and COUNTRY_LON le mp_xmax and COUNTRY_LAT ge mp_ymin and COUNTRY_LAT le mp_ymax) then (COUNTRY_LON * deg2rad)
+let/quiet mp_phi = if (COUNTRY_LON ge mp_xmin and COUNTRY_LON le mp_xmax and COUNTRY_LAT ge mp_ymin and COUNTRY_LAT le mp_ymax) then (COUNTRY_LAT * deg2rad)
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+$3"query/ignore|*>plot/set/vs/nolab/line=1/x=1:91083/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$3"query/ignore|*>ppl plot/overlay"
+
+! Draw any lines outside 0 to 360
+IF ($3"0|*>1") THEN
+
+IF `landi_addx NE 0` THEN 
+  set grid COUNTRY_LON
+  let/quiet mp_lambda = if ((country_lon+landi_addx) ge mp_xmin and (country_lon+landi_addx) le mp_xmax and \
+   country_lat ge mp_ymin and country_lat le mp_ymax) then ((country_lon+landi_addx) * deg2rad)
+  let/quiet mp_phi = if ((country_lon+landi_addx) ge mp_xmin and (country_lon+landi_addx) le mp_xmax and \
+   country_lat ge mp_ymin and country_lat le mp_ymax) then (country_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $3"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $3"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+  set grid COUNTRY_LON
+  let/quiet mp_lambda = if ((country_lon+landi_subx) ge mp_xmin and (country_lon+landi_subx) le mp_xmax and \
+   country_lat ge mp_ymin and country_lat le mp_ymax) then ((country_lon+landi_subx) * deg2rad)
+  let/quiet mp_phi = if ((country_lon+landi_subx) ge mp_xmin and (country_lon+landi_subx) le mp_xmax and \
+   country_lat ge mp_ymin and country_lat le mp_ymax) then (country_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $3"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $3"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+
+ENDIF  ! lines outside 0 to 360
+
+! **** now the optional state borders
+set grid STATE_LON
+let/quiet mp_lambda = if (STATE_LON ge mp_xmin and STATE_LON le mp_xmax and STATE_LAT ge mp_ymin and STATE_LAT le mp_ymax) then (STATE_LON * deg2rad)
+let/quiet mp_phi = if (STATE_LON ge mp_xmin and STATE_LON le mp_xmax and STATE_LAT ge mp_ymin and STATE_LAT le mp_ymax) then (STATE_LAT * deg2rad)
+let/quiet masked_x_page = mp_mask * x_page
+let/quiet masked_y_page = mp_mask * y_page
+$4"query/ignore|*>plot/set/vs/nolab/line=1/x=1:7034/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$4"query/ignore|*>ppl plot/overlay"
+
+
+! Draw any lines outside 0 to 360
+IF ($4"0|*>1") THEN
+
+IF `landi_addx NE 0` THEN 
+  set grid state_LON
+  let/quiet mp_lambda = if ((state_lon+landi_addx) ge mp_xmin and (state_lon+landi_addx) le mp_xmax and \
+   state_lat ge mp_ymin and state_lat le mp_ymax) then ((state_lon+landi_addx) * deg2rad)
+  let/quiet mp_phi = if ((state_lon+landi_addx) ge mp_xmin and (state_lon+landi_addx) le mp_xmax and \
+   state_lat ge mp_ymin and state_lat le mp_ymax) then (state_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $4"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $4"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+IF `landi_subx NE 0` THEN 
+  set grid state_LON
+  let/quiet mp_lambda = if ((state_lon+landi_subx) ge mp_xmin and (state_lon+landi_subx) le mp_xmax and \
+   state_lat ge mp_ymin and state_lat le mp_ymax) then ((state_lon+landi_subx) * deg2rad)
+  let/quiet mp_phi = if ((state_lon+landi_subx) ge mp_xmin and (state_lon+landi_subx) le mp_xmax and \
+   state_lat ge mp_ymin and state_lat le mp_ymax) then (state_lat * deg2rad)
+  let/quiet masked_x_page = mp_mask * x_page
+  let/quiet masked_y_page = mp_mask * y_page
+  $4"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+  ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+  $4"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+ENDIF
+
+ENDIF  ! lines outside 0 to 360
+
+cancel data geo_borders
+
+set grid/restore
+set data/restore
+let/quiet mp_x = x
+let/quiet mp_y = y
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+cancel variable mp_test
+let/quiet mp_std_parallel_north = mp_y[j=@max]
+let/quiet mp_std_parallel_south = mp_y[j=@min]
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+set mode/last verify
diff --git a/jnls/go/mp_land_detail.jnl b/jnls/go/mp_land_detail.jnl
new file mode 100644
index 0000000..b042833
--- /dev/null
+++ b/jnls/go/mp_land_detail.jnl
@@ -0,0 +1,318 @@
+\cancel mode verify	
+! overlaying coastal outline using detailed geo_borders_intermed data.
+
+! Description: Plot outlines of continents, countries, and/or states
+! History: Simplified 6/11/2012 to remove SET GRID commands, and to
+!	   handle longitude replications differently
+
+! usage:   go mp_land_detail arg1 [arg2] [arg3] [arg4] [arg5] [arg6] [arg7]
+!
+!    arg1  continent_pen  
+!    arg2 "basemap" "overlay", or omitted for overlay
+!    arg3 country_pen	Pen for optional national boundaries 
+!    arg4 state_pen	Pen for optional state boundaries (Western hemisphere)
+!    arg5 rivers_pen	Pen for largest rivers
+!    arg6 more_rivers	Pen for additional rivers 
+!    arg7 marine boundaries  Pen for marine boundaries in South Pacific, Bering Strait
+!
+! pens 	may be "0"(background), "1"(foreground), "thick"(same as pen 7),
+!	"black", "red", "green", "blue", or 2-18.
+! arg 2 may be "basemap", "overlay", "fast" (fast, 20e:20e overlay) or omitted
+
+!	Note 1: A pen color of "black" will actually pen number 1
+!		-- normally white if the window background is black
+!	Note 2: An "N" for the continent pen means no continents
+!		-- use this for the special case of geo-political
+!		   overlay without continents.
+! Example calls:
+!   GO mp_land_detail red	     - overlay continents using red pen (2)
+!   GO mp_land_detail  10           - overlay continents using pen number 10
+!   GO mp_land_detail 1 basemap     - basemap of continents outline in foreground color
+!   GO mp_land_detail 1 " " red     - overlay continents with countries in red
+!   GO mp_land_detail thick basemap black black - continents, countries, and states
+!   GO mp_land_detail thick " " red green blue lightblue purple - continents, countries, states, 
+!                                                 all rivers, and marine boundaries
+!   GO mp_land_detail N " " 1 1     - overlay: no continents; yes political boundaries
+! 
+! Example:
+!   USE coads_climatology
+!   SET REGION/X=0:360/Y=-90:90/L=1
+!   GO mp_orthographic 210 45
+!   SET GRID sst
+!   GO mp_aspect
+!   LET masked_sst = sst * mp_mask
+!   FILL/TITLE="View From Space"/NOAXES masked_sst, x_page, y_page
+!   GO mp_fland
+!   GO mp_land_detail thick overlay red green blue lightblue purple
+!
+! Notes:
+!  1) This script is SLOW! It computes the map projection for all the 
+!       boundary data, even when a small subset is being plotted.
+!  2) If a pen value is given for the country_pen or state_pen then the
+!	corresponding geopolitical boundaries will be drawn - else
+!	they will be omitted
+!  3) use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+!  3) For more control over basemaps use "GO basemap"
+
+! test argument before performing any actions
+
+query/ignore $1%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $2%default|basemap|overlay|<argument 2 can be "basemap", "overlay"%
+query/ignore $3%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $4%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $5%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $6%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+query/ignore $7%1|black|red|green|blue|lightblue|purple|white|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|N|<go land_detail [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+! introduce the outline data set
+set data/save
+set grid/save
+
+LET/QUIET mp_x = x
+LET/QUIET mp_xmin = `mp_x[i=@min]`
+LET/QUIET mp_xmax = `mp_x[i=@max]`
+LET/QUIET mp_y = y
+LET/QUIET mp_ymin = `mp_y[j=@min]`
+LET/QUIET mp_ymax = `mp_y[j=@max]`
+LET/QUIET mp_std_parallel_north = mp_ymax
+LET/QUIET mp_std_parallel_south = mp_ymin
+
+! This test will keep the central meridians defined by "from space" views
+!
+LET/QUIET mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   LET/QUIET mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+LET/QUIET mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   LET/QUIET mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+cancel variable mp_test
+
+define region/default save
+cancel region
+
+use geo_borders_intermed
+
+
+! Initialize
+let landi_addx = 0
+let landi_datxmin = continent_lon[x=@min]
+let landi_datxmax = continent_lon[x=@max]
+
+let landi_basemap = $2"0|basemap>1|*>0"
+IF `landi_basemap EQ 0` THEN
+
+   IF `mp_xmin LT landi_datxmin` then let landi_addx = -360
+   IF `mp_xmax GT landi_datxmax` then let landi_addx = 360
+
+ENDIF
+
+! always do the continents
+
+! Add replication of longitudes if necessary to match whats on the map.
+IF `landi_addx NE 0` THEN 
+   SET VAR/NAME=continent_lon_in continent_lon
+   SET VAR/NAME=continent_lat_in continent_lat
+   LET continent_lon = XCAT(continent_lon_in, continent_lon_in + (landi_addx))
+   LET continent_lat = XCAT(continent_lat_in, continent_lat_in)
+ENDIF
+
+LET/QUIET mp_x = x[gx=continent_lon]
+LET/QUIET mp_y = y[gy=continent_lon]
+
+LET/QUIET mp_lambda = continent_lon * deg2rad
+LET/QUIET mp_phi = continent_lat * deg2rad
+LET/QUIET masked_x_page = mp_mask * x_page
+LET/QUIET masked_y_page = mp_mask * y_page
+
+$1"plot|N>QUERY/IGNORE stuff |*>plot"/set/vs/nolab/noax/line=1/$2"i=1:200826/overlay|basemap>i=1:200826/overly|*>i=1:200826/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+ppl pen 1 $1"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|N>1|"
+
+! draw it - as an overlay or as a basemap
+
+$1"ppl plot|N>QUERY/IGNORE stuff |*>ppl plot"$2"/overlay|basemap> |*>/overlay"
+
+CANCEL VAR continent*
+
+
+! **** now the optional country borders
+IF ($3%0|*>1%) THEN
+
+! Add replication of longitudes if necessary to match whats on the map.
+   IF `landi_addx NE 0` THEN 
+      SET VAR/NAME=country_lon_in country_lon
+      SET VAR/NAME=country_lat_in country_lat
+      LET country_lon = XCAT(country_lon_in, country_lon_in + (landi_addx))
+      LET country_lat = XCAT(country_lat_in, country_lat_in)
+   ENDIF
+
+   LET/QUIET mp_x = x[gx=country_lon]
+   LET/QUIET mp_y = y[gy=country_lon]
+
+   LET/QUIET mp_lambda = country_lon * deg2rad
+   LET/QUIET mp_phi = country_lat * deg2rad
+
+   LET/QUIET masked_x_page = mp_mask * x_page
+   LET/QUIET masked_y_page = mp_mask * y_page
+   $3"query/ignore|*>plot/set/vs/nolab/line=1/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+   ppl pen 1 $3"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+   $3"query/ignore|*>ppl plot/overlay"
+
+   CANCEL VAR country*
+ENDIF
+
+! **** now the optional state borders
+IF ($4%0|*>1%) THEN
+
+   IF `landi_addx NE 0` THEN 
+      SET VAR/NAME=state_lon_in state_lon
+      SET VAR/NAME=state_lat_in state_lat
+      LET state_lon = XCAT(state_lon_in, state_lon_in + (landi_addx))
+      LET state_lat = XCAT(state_lat_in, state_lat_in)
+   ENDIF
+
+   LET/QUIET mp_x = x[gx=state_lon]
+   LET/QUIET mp_y = y[gy=state_lon]
+
+   LET/QUIET mp_lambda = state_lon * deg2rad
+   LET/QUIET mp_phi = state_lat * deg2rad
+   
+   LET/QUIET masked_x_page = mp_mask * x_page
+   LET/QUIET masked_y_page = mp_mask * y_page
+   $4"query/ignore|*>plot/set/vs/nolab/line=1/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+   ppl pen 1 $4"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay
+   $4"query/ignore|*>ppl plot/overlay"
+
+   CANCEL VAR state*
+ENDIF
+
+
+! **** now the optional rivers (secondary ones first)
+IF ($6%0|*>1%) THEN
+
+   IF `landi_addx NE 0` THEN 
+      SET VAR/NAME=river1_2_lon_in river1_2_lon
+      SET VAR/NAME=river1_2_lat_in river1_2_lat
+      LET river1_2_lon = XCAT(river1_2_lon_in, river1_2_lon_in + (landi_addx))
+      LET river1_2_lat = XCAT(river1_2_lat_in, river1_2_lat_in)
+   ENDIF
+
+   LET/QUIET mp_x = x[gx=river1_2_lon]
+   LET/QUIET mp_y = y[gy=river1_2_lon]
+
+   LET/QUIET mp_lambda = river1_2_lon * deg2rad
+   LET/QUIET mp_phi = river1_2_lat * deg2rad
+
+   LET/QUIET masked_x_page = mp_mask * x_page
+   LET/QUIET masked_y_page = mp_mask * y_page
+
+   $6"query/ignore|*>plot/set/vs/nolab/line=1/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+   ppl pen 1 $6"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+   $6"query/ignore|*>ppl plot/overlay"
+
+   CANCEL VAR river1_2*
+ENDIF
+
+
+! **** now the optional rivers (primary ones second)
+IF ($5%0|*>1%) THEN
+
+   IF `landi_addx NE 0` THEN 
+      SET VAR/NAME=river1_lon_in river1_lon
+      SET VAR/NAME=river1_lat_in river1_lat
+      LET river1_lon = XCAT(river1_lon_in, river1_lon_in + (landi_addx))
+      LET river1_lat = XCAT(river1_lat_in, river1_lat_in)
+   ENDIF
+
+   LET/QUIET mp_x = x[gx=river1_lon]
+   LET/QUIET mp_y = y[gy=river1_lon]
+
+   LET/QUIET mp_lambda = river1_lon * deg2rad
+   LET/QUIET mp_phi = river1_lat * deg2rad
+   
+   LET/QUIET masked_x_page = mp_mask * x_page
+   LET/QUIET masked_y_page = mp_mask * y_page
+$5"query/ignore|*>plot/set/vs/nolab/line=1/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+ppl pen 1 $5"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+$5"query/ignore|*>ppl plot/overlay"
+
+   CANCEL VAR river1*
+ENDIF
+
+
+! **** now the optional marine boundaries
+
+IF ($7%0|*>1%) THEN
+
+   IF `landi_addx NE 0` THEN 
+      SET VAR/NAME=marine_lon_in marine_lon
+      SET VAR/NAME=marine_lat_in marine_lat
+      LET marine_lon = XCAT(marine_lon_in, marine_lon_in + (landi_addx))
+      LET marine_lat = XCAT(marine_lat_in, marine_lat_in)
+   ENDIF
+
+   LET/QUIET mp_x = x[gx=marine_lon]
+   LET/QUIET mp_y = y[gy=marine_lon]
+
+   LET/QUIET mp_lambda = marine_lon * deg2rad
+   LET/QUIET mp_phi = marine_lat * deg2rad
+   
+   LET/QUIET masked_x_page = mp_mask * x_page
+   LET/QUIET masked_y_page = mp_mask * y_page
+
+   $7"query/ignore|*>plot/set/vs/nolab/line=1/overlay" masked_x_page, masked_y_page
+
+! select line style and plot
+   ppl pen 1 $7"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! draw it - as an overlay or as a basemap
+   $7"query/ignore|*>ppl plot/overlay"
+
+   CANCEL VAR marine*
+ENDIF
+
+
+cancel data geo_borders_intermed
+
+set grid/restore
+set data/restore
+
+LET/QUIET mp_x = x
+LET/QUIET mp_y = y
+LET/QUIET mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   LET/QUIET mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+LET/QUIET mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   LET/QUIET mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+cancel variable mp_test
+LET/QUIET mp_std_parallel_north = mp_y[j=@max]
+LET/QUIET mp_std_parallel_south = mp_y[j=@min]
+LET/QUIET mp_lambda = mp_x * deg2rad
+LET/QUIET mp_phi = mp_y * deg2rad
+
+set region save
+set mode/last verify
+
diff --git a/jnls/go/mp_land_stripmap.jnl b/jnls/go/mp_land_stripmap.jnl
new file mode 100644
index 0000000..2cffa3b
--- /dev/null
+++ b/jnls/go/mp_land_stripmap.jnl
@@ -0,0 +1,152 @@
+\cancel mode verify
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_land_stripmap.jnl --  Creates an composite map based on the predefined
+!                           map projection.  
+!		    		
+! Jonathan Callahan
+! 9/97
+!
+
+! Description:  This journal file is not "nice" and is provided as an example only.
+!
+! Usage:                   arg1          arg2            arg3     arg4   arg5
+!  go mp_ocean_stripmap [variable] [levels qualifier] [palette] [fland] [land]
+!
+! arg 1 - variable to be plotted
+! arg 2 - a Ferret style levels qualifier
+! arg 3 - the palette to use
+! arg 4 - flag determining whether mp_go_fland is turned on[1] or off[0]
+! arg 5 - flag determining whether mp_go_land is turned on[1] or off[0]
+
+! Example:
+!   use coads_clmatology
+!   go mp_sinusoidal
+!   set grid sst
+!   go mp_land_stripmap sst lev=(-2,20,4)(20,34,2) no_green 1 0
+!
+
+
+define viewport/xlim=0,.222/ylim=0,.5 mp_l1
+define viewport/xlim=.222,.444/ylim=0,.5 mp_l2
+define viewport/xlim=.444,.722/ylim=0,.5 mp_l3
+define viewport/xlim=.722,.999/ylim=0,.5 mp_l4
+define viewport/xlim=0,.389/ylim=.5,1 mp_u1
+define viewport/xlim=.389,.999/ylim=.5,1 mp_u2
+
+set data/save
+
+set region/y=-90:0
+
+set grid $1
+palette $3
+set view mp_l1
+set region/x=180:260
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+set data/restore
+set grid $1
+palette $3
+set view mp_l2
+set region/x=260:340
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+set data/restore
+set grid $1
+palette $3
+set view mp_l3
+set region/x=340:440
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+set data/restore
+set grid $1
+palette $3
+set view mp_l4
+set region/x=440:540
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+set region/y=0:90
+
+set data/restore
+set grid $1
+palette $3
+set view mp_u1
+set region/x=180:320
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+set data/restore
+set grid $1
+palette $3
+set view mp_u2
+set region/x=320:540
+go margins 0,0,0,0
+shade/set_up/nolab/$2 $1, x_page, y_page
+ppl axset,0,0,0,0
+ppl axlabp,0,0
+ppl box,OFF
+ppl shade
+if $4 then
+  set data etopo60
+  set grid rose
+  palette gray
+  shade/over/nolab/lev=(0,8000,8000) rose, x_page, y_page
+endif
+
+
+set grid $1
+set data/restore
+set mode/last verify
diff --git a/jnls/go/mp_line.jnl b/jnls/go/mp_line.jnl
new file mode 100644
index 0000000..09c9f6f
--- /dev/null
+++ b/jnls/go/mp_line.jnl
@@ -0,0 +1,74 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_line.jnl --  Plot data using a particular map projection.  For working
+!                  with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Plots data using a predefined map projection. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!	mp_mask  mask for orthographic map projections
+!
+! Usage:          arg1     arg2  arg3
+!  go mp_line plot_command xpos  ypos
+!
+! arg 1 - plot command (eg. "SHADE/VS/OVER")
+! arg 2 - X position in user units (world longitude)
+! arg 3 - Y position in user units (world latitude)
+!
+! Example:
+!	  go mp_line plot/vs/over my_x my_y
+!
+
+query/ignore $1%<Specify all arguments: plot_command xpos ypos%
+query/ignore $2%<Specify all arguments: plot_command xpos ypos%
+query/ignore $3%<Specify all arguments: plot_command xpos ypos%
+
+! Save the region and grid
+
+define region/default save
+
+let/quiet mp_central_meridian = `mp_central_meridian`
+let/quiet mp_standard_parallel = `mp_standard_parallel`
+
+
+! Cancel the region because the I index info is used to restrict
+! the points to be plotted as a line.
+
+can region/x/y
+
+! Check to make sure the xpos and ypos arrays are one dimensional
+
+let/quiet mp_xpos = $2
+let/quiet mp_ypos = $3
+define symbol mp_shape_x `mp_xpos,RESULT=SHAPE`
+define symbol mp_shape_y `mp_ypos,RESULT=SHAPE`
+query/ignore ($mp_shape_x%|X|Y|Z|T|<error: x position array must be 1-dimensional%)
+query/ignore ($mp_shape_y%|X|Y|Z|T|<error: y position array must be 1-dimensional%)
+can variable mp_xpos
+can variable mp_ypos
+
+
+! Alter the map projection equations to use xpos and ypos
+
+let/quiet mp_x = $2
+let/quiet mp_y = $3
+
+$1 x_page*mp_mask, y_page*mp_mask
+
+
+! Restore the region and map projection equations
+
+set region save
+
+let/quiet mp_x = x[g=($mp_grid_variable)]
+let/quiet mp_y = y[g=($mp_grid_variable)]
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_mask_outline.jnl b/jnls/go/mp_mask_outline.jnl
new file mode 100644
index 0000000..17b7bbe
--- /dev/null
+++ b/jnls/go/mp_mask_outline.jnl
@@ -0,0 +1,57 @@
+\cancel mode verify
+! mp_mask_outline.jnl
+! 
+! *acm 6/01 
+!      6/20/01 simplify logic to call mask_outline
+
+! Description: For a plot using map projections, define a contour field with 
+!              squared off lines for a 1-0 mask
+!              See mask_outline.jnl for a description of the technique.
+
+!usage: GO mp_mask_outline mask [xax_start] [yax_start] x_page y_page
+! xax_start - optional argument giving the lower bound of the first (I=1) grid
+!             cell on the X axis of the mask. If omitted the default value
+!             used will be X[I=1] - XBOX[I=1]/2 -- i.e. the assumption is that
+!             the first point on the X axis is centered within its grid cell
+! yax_start - ditto for the y axis
+! x_page      map projection coordinates
+! y_page      map projection coordinates
+
+
+! example with map projection
+!   yes? use etopo60
+!   yes? set region/x=90w:20e/y=15s:55n
+!   yes? go mp_orthographic 315 35
+!   yes? set grid rose
+!   yes? go mp_aspect
+!   yes? shade/noaxis rose, x_page, y_page
+!
+!   yes? let ocean_mask = IF rose LT 0 THEN 1 ELSE 0 
+!   yes? GO mp_mask_outline ocean_mask, , , x_page, y_page
+!   yes? mp_ovmo
+
+! if the final line segments at the north and east of the plot are missing
+!   yes? cancel region
+!   yes? mp_ovmo
+
+! use "yes? SHOW ALIAS *ovmo" to see or modify the contour command
+
+
+! Call mask_outline.jnl
+
+    GO mask_outline $1%" "% $2%" "%  $3%" "% $4%" "% $5%" "%
+
+! Regrid x_page and y_page to x_page_mo and y_page_mo
+
+let $4_mo = $4[GX=MO_XAXIS,GY=MO_YAXIS]
+let $5_mo = $5[GX=MO_XAXIS,GY=MO_YAXIS]
+
+DEFINE ALIAS mp_ovmo "ovmo , $4_mo, $5_mo"
+
+say *** Use the command alias "mp_ovmo" to overlay the mask outline on a map projection***
+
+! clean up
+cancel variables mo_*
+cancel symbols mo_*
+
+set mode/last verify
diff --git a/jnls/go/mp_mcbryde_fpp.jnl b/jnls/go/mp_mcbryde_fpp.jnl
new file mode 100644
index 0000000..7d3c73c
--- /dev/null
+++ b/jnls/go/mp_mcbryde_fpp.jnl
@@ -0,0 +1,72 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_mcbryde_fpp.jnl --  Sets up variables for a McBryde-Thomas Flat-Polar Parabolic projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a McBryde-Thomas Flat-Polar Parabolic map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_mcbryde_fpp [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_mcbryde_fpp
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_mcbryde_fpp
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_mcbryde_fpp `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_theta = asin((7/3)*(sin(mp_phi)/6^.5))
+
+let/quiet x_page = 6^.5 * mp_R * (mp_lambda - mp_lambda0) * (2 * cos(2*mp_theta/3) - 1) / 7^.5   ! eqn (57)
+let/quiet y_page = 9 * mp_R * sin(mp_theta/3) / 7^.5                                       ! eqn (58)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_mercator.jnl b/jnls/go/mp_mercator.jnl
new file mode 100644
index 0000000..9575991
--- /dev/null
+++ b/jnls/go/mp_mercator.jnl
@@ -0,0 +1,87 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_mercator.jnl --  Sets up variables for a Mercator
+!  projection using 'curvilinear coordinates' code in Ferret v4.50
+!                   
+! Steve Hankin
+! 12/98 - based on mp_lambert_cly.jnl
+
+! Description:  Sets up variables for a Mercator projection
+!
+! Usage:                 arg1        
+!  go mp_mercator [central meridian]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example 1 - basic gridded field:
+!  use coads_climatology 
+!  set region/y=80s:80n
+!  go mp_mercator
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+
+! Example 2: points plotted over a basemap
+
+! ... turn off automatic axis labeling
+! ppl axlabp,0,0
+! ppl axset 0, 0, 0, 0
+!
+! ... create basemap
+! go mp_mercator
+! set region/x=100e:80w/y=40n:80n
+! go mp_fland 20 gray basemap
+! go mp_graticule
+!
+! ... create and overlay random point
+! let xpt = 160 + RANDU(i)*20
+! let ypt = 50 + RANDU(i+1)*30
+! go mp_line plot/vs/over/i=1:50/symbol=2 xpt,ypt
+! 
+! ... restore axes in preparation for next plot
+! ppl axlabp,-1,-1
+! ppl axset 1,1,1,1
+
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_mercator
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_mercator `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2   ! ???
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (mp_lambda-mp_lambda0)              ! eqn (1)
+let/quiet y_page = mp_R *  LN(TAN(mp_phi/2 + pi/4))           ! Mercator eqn
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_ocean_stripmap.jnl b/jnls/go/mp_ocean_stripmap.jnl
new file mode 100644
index 0000000..586a8a3
--- /dev/null
+++ b/jnls/go/mp_ocean_stripmap.jnl
@@ -0,0 +1,88 @@
+\cancel mode verify
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_ocean_stripmap.jnl --  Creates an composite map based on the predefined
+!                           map projection.  
+!		    		
+! Jonathan Callahan
+! 9/97
+!
+
+! Description:  This journal file is not "nice" and is provided as an example only.
+!
+! Usage:                   arg1          arg2            arg3     arg4   arg5
+!  go mp_ocean_stripmap [variable] [levels qualifier] [palette] [fland] [land]
+!
+! arg 1 - variable to be plotted
+! arg 2 - a Ferret style levels qualifier
+! arg 3 - the palette to use
+! arg 4 - flag determining whether mp_go_fland is turned on[1] or off[0]
+! arg 5 - flag determining whether mp_go_land is turned on[1] or off[0]
+
+! Example:
+!   use coads_clmatology
+!   go mp_sinusoidal
+!   set grid sst
+!   go mp_ocean_stripmap sst lev=(-2,20,4)(20,34,2) no_green 1 0
+!
+
+
+define viewport/xlim=0,.333/ylim=0,.51 mp_ll
+define viewport/xlim=.333,.75/ylim=0,.51 mp_lm
+define viewport/xlim=.75,.999/ylim=0,.51 mp_lr
+define viewport/xlim=0,.25/ylim=.5,1 mp_ul
+define viewport/xlim=.25,.667/ylim=.5,1 mp_um
+define viewport/xlim=.667,.999/ylim=.5,1 mp_ur
+
+set data/save
+
+set region/y=-90:0
+
+set grid $1
+palette $3
+set view mp_ll
+set region/x=20:140
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+set view mp_lm
+set region/x=140:290
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+set view mp_lr
+set region/x=290:380
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+set region/y=0:90
+
+set view mp_ul
+set region/x=20:110
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+set view mp_um
+set region/x=110:260
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+set view mp_ur
+set region/x=260:380
+go margins 0,0,0,0
+shade/noaxes/nokey/nolab/$2 $1, x_page, y_page
+if $4 then go mp_fland
+if $5 then go mp_land
+
+
+set data/restore
+set mode/last verify
diff --git a/jnls/go/mp_orthographic.jnl b/jnls/go/mp_orthographic.jnl
new file mode 100644
index 0000000..58889a5
--- /dev/null
+++ b/jnls/go/mp_orthographic.jnl
@@ -0,0 +1,65 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_orthographic.jnl --  Sets up variables for a Orthographic projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Orthographic map of the world
+!
+! Usage:                    arg1             arg2
+!  go mp_orthographic central_meridian standard_parallel
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_orthographic 300 45
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+query/ignore $1"<Please supply a longitude and latitude:    go mp_orthographic 300 45"
+query/ignore $2"<Please supply a longitude and latitude:    go mp_orthographic 300 45"
+
+if `$2 gt 90` then
+	query/ignore $3"<The latitude must be between -90 and 90"
+elif `$2 lt (-90)` then
+	query/ignore $3"<The latitude must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+let/quiet mp_central_meridian = $1
+let/quiet mp_standard_parallel = $2
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_k0 = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi1 = mp_standard_parallel * deg2rad
+
+let/quiet mp_bigK = 1
+let/quiet mp_cos_z = sin(mp_phi1)*sin(mp_phi) + cos(mp_phi1)*cos(mp_phi)*cos(mp_lambda-mp_lambda0)                    ! eqn (112)
+
+let/quiet x_page = mp_R * mp_bigK * cos(mp_phi) * sin(mp_lambda-mp_lambda0)                                    ! eqn (114)
+let/quiet y_page = mp_R * mp_bigK * ( cos(mp_phi1)*sin(mp_phi) - sin(mp_phi1)*cos(mp_phi)*cos(mp_lambda-mp_lambda0) )   ! eqn (115)
+
+let/quiet mp_mask = if mp_cos_z ge 0 then 1 
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_plate_caree.jnl b/jnls/go/mp_plate_caree.jnl
new file mode 100644
index 0000000..20e3967
--- /dev/null
+++ b/jnls/go/mp_plate_caree.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_plate_caree.jnl --  Sets up variables for a Plate Caree projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Plate Caree map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_plate_caree [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_plate_caree
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_plate_caree
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_plate_caree `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (mp_lambda-mp_lambda0)                    ! eqn (1)
+let/quiet y_page = mp_R * mp_phi                                    ! eqn (14)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_poly_vectors.jnl b/jnls/go/mp_poly_vectors.jnl
new file mode 100644
index 0000000..47f3f28
--- /dev/null
+++ b/jnls/go/mp_poly_vectors.jnl
@@ -0,0 +1,243 @@
+\cancel mode verify
+! mp_poly_vectors:  Sets up the drawing of a sequence of color-filled vectors scattered on a map projection
+
+! The vector tail coordinates are projected from the earth to the map.
+! The vector directions are such that poleward vectors will lie along projected
+! meridians and zonal vectors along parallels.  Vectors at other angles will
+! lie proportionately between meridians and parallels.   
+
+! Programmed by E. D. Cokelet, NOAA/PMEL, 11 Feb 2003
+! Last modified 12 Mar 2003
+
+! Usage: (for examples, run poly_vec_demo.jnl)
+
+! go mp_poly_vectors lon_vect lat_vect u_east v_north vector_scale "arrow"
+! polygon/over/nolabel mp_x_arrow, mp_y_arrow, my_values[j=1:`num_vectors`]
+
+! with inputs:
+!       lon_vect = sequence of longitudes of vector tails
+!       lat_vect = sequence of latitudes  of vector tails
+!       u_east   = sequence of eastward  components of vectors
+!       v_north  = sequence of northward components of vectors
+!       vector_scale = vector length in user units (e.g. cm/s) corresponding to
+!                      a half-inch-long vector
+!       "arrow" or "stick" = with or without arrow heads
+! and with outputs:
+!       num_vectors = number of vector arrow polygons to plot
+!       mp_x_arrow = (7 x num_vectors) x-y array whose x-values are the
+!                    x-components of the vector arrow polygons on the map.
+!                    The y-values are counters, one for each vector.   
+!       mp_y_arrow = (7 x num_vectors) x-y array whose x-values are the
+!                    y-components of the vector arrow polygons on the map.
+
+! and where: 
+!       my_values = An input y array of num_vectors values corresponding to the
+!                   color-fill levels of the vectors.
+
+! Note 1:  A map must have been drawn using Ferret map projections (e.g. mp_mercator)
+!          before calling mp_poly_vectors.
+! Note 2:  Any polygon command can be used to plot the vectors.
+! Note 3:  This script writes and subsequently removes a work file called
+!          work_mp_poly_vectors.cdf in the current working directory.
+
+
+define region/default save
+cancel region
+
+set data/save
+
+
+! Place vector positions and components on a y axis
+
+let vect_tail_lon1   = ysequence( $1 )  ! Sequence on abstract axis
+let vect_tail_lat1   = ysequence( $2 )  ! Sequence on abstract axis
+let vect_east_comp1  = ysequence( $3 )  ! Sequence on abstract axis
+let vect_north_comp1 = ysequence( $4 )  ! Sequence on abstract axis
+
+let mag_per_inch = `$5 * 2`
+
+let arrowhead_draw = $6"|arrow>0|stick>1|<You must specify arrow or stick."
+
+let num_vectors = vect_east_comp1[j=@ngd] + vect_east_comp1[j=@nbd]
+
+define axis/y=1:`num_vectors`:1 y_vect_cnt
+
+define grid/y=y_vect_cnt vect_cnt_grd
+
+let vect_tail_lon   = vect_tail_lon1[g=vect_cnt_grd at asn]
+let vect_tail_lat   = vect_tail_lat1[g=vect_cnt_grd at asn]
+let vect_east_comp  = vect_east_comp1[g=vect_cnt_grd at asn]
+let vect_north_comp = vect_north_comp1[g=vect_cnt_grd at asn]
+
+
+! **************** Compute vector direction in map coordinates **************
+
+! At each vector location compute the angle, meridian_angle, between the map's
+! y-axis and north and the angle, parallel_angle, between the map's y-axis and
+! east.
+
+! meridian_angle = atan( dx/dy ) with longitude held constant. 
+! parallel_angle = atan( dx/dy ) with latitude  held constant. 
+
+
+! Compute dx/dy numerically at constant longitude
+
+cancel variable mp_x, mp_y
+
+let mp_x = vect_tail_lon        ! Sets x_page via mp_<projection> transform
+let mp_y = vect_tail_lat        ! Sets y_page via mp_<projection> transform
+
+let map_x = x_page
+let map_y = y_page
+let map_x_del_lat = map_x       ! Dummy place holder in file
+let map_y_del_lat = map_y       ! Dummy place holder in file
+let map_x_del_lon = map_x       ! Dummy place holder in file
+let map_y_del_lon = map_y       ! Dummy place holder in file
+
+save/rigid/clobber/quiet/file=work_mp_poly_vectors.cdf map_x, map_y, map_x_del_lat,  map_y_del_lat, map_x_del_lon, map_y_del_lon     ! Must save results in file because mp_x, mp_y, x_page & y_page are reused
+
+let del_lat = 0.1 + 0*y[g=vect_cnt_grd]  ! An infinitesimal increment in latitude (degrees)
+
+let mp_x = vect_tail_lon           ! Sets x_page via mp_<projection> transform
+let mp_y = vect_tail_lat + del_lat ! Sets y_page via mp_<projection> transform
+
+let map_x_del_lat = x_page
+let map_y_del_lat = y_page
+
+save/append/quiet/file=work_mp_poly_vectors.cdf map_x_del_lat, map_y_del_lat       ! Must save results in file because mp_x, mp_y, x_page & y_page are reused
+
+
+! Compute dx/dy numerically at constant latitude
+
+let del_lon = 0.1 + 0*y[g=vect_cnt_grd]  ! An infinitesimal increment in longitude (degrees)
+
+let mp_x = vect_tail_lon + del_lon ! Sets x_page via mp_<projection> transform
+let mp_y = vect_tail_lat           ! Sets y_page via mp_<projection> transform
+
+let map_x_del_lon = x_page
+let map_y_del_lon = y_page
+
+save/append/quiet/file=work_mp_poly_vectors.cdf map_x_del_lon, map_y_del_lon       ! Must save results in file because mp_x, mp_y, x_page & y_page are reused
+
+
+! Compute meridian_angle, parallel_angle, vector azimuth and direction on map
+
+cancel variable map_x, map_y, map_x_del_lat, map_y_del_lat, map_x_del_lon, map_y_del_lon
+
+use work_mp_poly_vectors.cdf
+
+let pi = 4*atan(1)
+
+let meridian_angle = atan2( map_x_del_lat[d=work_mp_poly_vectors.cdf] - map_x[d=work_mp_poly_vectors.cdf], map_y_del_lat[d=work_mp_poly_vectors.cdf] -  map_y[d=work_mp_poly_vectors.cdf])
+
+let parallel_angle = atan2( map_x_del_lon[d=work_mp_poly_vectors.cdf] - map_x[d=work_mp_poly_vectors.cdf], map_y_del_lon[d=work_mp_poly_vectors.cdf] -  map_y[d=work_mp_poly_vectors.cdf])
+
+set data/restore
+
+
+! Compute the projected azimuth angle depending on the earth azimuth angle
+
+let vect_az_earth1 = atan2( vect_east_comp, vect_north_comp )
+let vect_az_earth = if (vect_az_earth1 lt 0) then vect_az_earth1 + `2*pi`  else vect_az_earth1
+
+let vect_az_map1 = if (vect_az_earth ge 0 and vect_az_earth lt `pi/2`)  then 2*(parallel_angle - meridian_angle)*vect_az_earth/`pi` 
+
+let vect_az_map2 = if (vect_az_earth ge `pi/2` and vect_az_earth lt `pi`)  then 2*(`pi` - parallel_angle + meridian_angle)*vect_az_earth/`pi` +  2*(parallel_angle - meridian_angle) - `pi` else vect_az_map1
+ 
+let vect_az_map3 = if (vect_az_earth ge `pi` and vect_az_earth lt `3*pi/2`)  then 2*(parallel_angle - meridian_angle)*vect_az_earth/`pi` + `pi` -  2*(parallel_angle - meridian_angle) else vect_az_map2
+ 
+let vect_az_map4 = if (vect_az_earth ge `3*pi/2` and vect_az_earth le 2*pi)  then 2*(`pi` + meridian_angle - parallel_angle)*vect_az_earth/`pi` -  4*(meridian_angle - parallel_angle + `pi`/2) else vect_az_map3
+
+
+! Ensure vector azimuth on map does not differ by more than pi from vector azimuth on earth.
+
+let vect_az_map5 = if (vect_az_map4 - vect_az_earth ge 0.99*pi) then vect_az_map4 - pi else vect_az_map4
+
+let vect_az_map = if (vect_az_map5 - vect_az_earth le (-0.99)*pi) then vect_az_map5 + pi else vect_az_map5
+
+let vect_map_angle = meridian_angle + vect_az_map
+
+! ******************* End vector direction calculation *********************
+
+
+! Compute the arrow lengths in inches as they lie along the x-axis with tails at the origin.
+! For each y, polygon vertices are functions of x. 
+
+define axis/x=1:7:1 x_poly_vert
+define grid/x=x_poly_vert poly_vert_grd
+
+let vect_mag = (vect_east_comp^2 + vect_north_comp^2)^0.5
+let vect_inch = vect_mag / mag_per_inch
+
+let arrow_hd_ln = if (arrowhead_draw eq 0) then 0.15 else 0   ! arrow head length (inches)
+
+let arrow_hd_half_wd = if (arrowhead_draw eq 0) then 0.05 else 0   ! arrow head half-width (inches)
+
+let arrow_shft_half_thk = 0.01  ! arrow shaft half-thickness (inches)
+
+let vect_inch_add = {0, `arrow_hd_ln`, `arrow_hd_ln`, 0, `arrow_hd_ln`, `arrow_hd_ln`, 0} + 0*x[g=poly_vert_grd]
+
+let vect_inch_mul = {0,   1,   1, 1,   1,   1, 0} + 0*x[g=poly_vert_grd]
+
+let x_arrow_inch0 = (vect_inch - vect_inch_add)*vect_inch_mul
+
+let x_arrow_inch1 = if (x_arrow_inch0 lt 0) then 0 else x_arrow_inch0   !Truncate arrow heads of short vectors
+
+let y_arrow_inch1 = {-`arrow_shft_half_thk`, -`arrow_shft_half_thk`, -`arrow_hd_half_wd`, 0.00, `arrow_hd_half_wd`, `arrow_shft_half_thk`, `arrow_shft_half_thk`} + 0*x[g=poly_vert_grd]
+
+let x_std_arrow = (0.5 - vect_inch_add)*vect_inch_mul
+let y_std_arrow = y_arrow_inch1
+
+! Rotate the arrows to their proper direction on the map
+
+let x_arrow_inch2 = (x_arrow_inch1*sin(vect_map_angle) - y_arrow_inch1*cos(vect_map_angle))
+
+let y_arrow_inch2 = (y_arrow_inch1*sin(vect_map_angle) + x_arrow_inch1*cos(vect_map_angle))
+
+
+! Compute the map scaling. 
+
+let mp_x_inch_span = `($PPL$XLEN)` + 0*x[g=poly_vert_grd]
+let mp_y_inch_span = `($PPL$YLEN)` + 0*x[g=poly_vert_grd]
+
+let mp_x_user_span = `($xaxis_max)` - `($xaxis_min)` + 0*x[g=poly_vert_grd]
+let mp_y_user_span = `($yaxis_max)` - `($yaxis_min)` + 0*x[g=poly_vert_grd]
+
+let mp_x_per_inch = mp_x_user_span/mp_x_inch_span
+let mp_y_per_inch = mp_y_user_span/mp_y_inch_span
+
+
+! Compute the arrow lengths in map units
+
+let x_arrow_plot = x_arrow_inch2*mp_x_per_inch
+let y_arrow_plot = y_arrow_inch2*mp_y_per_inch
+
+
+! Displace the arrow tails in map units
+
+let mp_x = vect_tail_lon
+let mp_y = vect_tail_lat
+
+let mp_x_arrow = ( x_page + x_arrow_plot )
+let mp_y_arrow = ( y_page + y_arrow_plot )
+
+
+! Clean up
+
+let mp_key_x = {1, 1.4, 1.4, 1.5, 1.4, 1.4, 1}
+let mp_key_y = {-1.02, -1.02, -1.14, -1.0, -0.86, -0.98, -0.98}
+
+
+!can data work_mp_poly_vectors.cdf
+sp "\rm work_mp_poly_vectors.cdf*"
+
+
+set data/restore
+
+say
+say *** MP_POLY_VECTORS:  Issue commands such as follow to plot the vectors ***
+say *** POLYGON/OVER/NOLABEL/KEY/NOAXES MP_X_ARROW, MP_Y_ARROW, MY_VALUES[J=1:`NUM_VECTORS`] ***
+say *** SET REGION SAVE ***
+say
+
+set mode/last verify
diff --git a/jnls/go/mp_polyconic.jnl b/jnls/go/mp_polyconic.jnl
new file mode 100644
index 0000000..d1c523a
--- /dev/null
+++ b/jnls/go/mp_polyconic.jnl
@@ -0,0 +1,99 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_polyconic.jnl --  Sets up variables for a Polyconic projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Polyconic map of the world
+!
+! Usage:                   arg1               arg2             arg3             arg4
+!  go mp_polyconic [central meridian] [standard parallel][std parallel N] [std parallel S]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+! arg 3 - latitude used for the northern edge of the projection
+! arg 4 - latitude used for the southern edge of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_polyconic
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_polyconic
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_polyconic `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $9"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $9"<The standard parallel must be between -90 and 90"
+endif
+
+if `$3%60% gt 90` then
+    query/ignore $9"<The northern parallel must be between -90 and 90"
+elif `$3%60% lt (-90)` then
+    query/ignore $9"<The northern parallel must be between -90 and 90"
+endif
+
+if `$4%60% gt 90` then
+    query/ignore $9"<The southern parallel must be between -90 and 90"
+elif `$4%60% lt (-90)` then
+    query/ignore $9"<The southern parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet mp_std_parallel_north = $3%mp_y[j=@max]%
+let/quiet mp_std_parallel_south = $4%mp_y[j=@min]%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi2 = mp_std_parallel_north * deg2rad
+let/quiet mp_phi1 = mp_std_parallel_south * deg2rad
+
+let/quiet mp_phi0 = (mp_phi2 + mp_phi1) / 2                               ! eqn (91)
+let/quiet mp_cot_phi = cos(mp_phi) / sin(mp_phi)
+
+!if (mp_phi eq 0) then
+!   let/quiet x_page = mp_R * (mp_lambda - mp_lambda0)                     ! eqn (1)
+!   let/quiet y_page = (-1.0) * mp_R * mp_phi0                          ! eqn (94)              
+!else
+   let/quiet mp_E = (mp_lambda - mp_lambda0) * sin(mp_phi)                   ! eqn (95)
+   let/quiet x_page = mp_R * mp_cot_phi * sin(mp_E)                       ! eqn (96)
+   let/quiet y_page = mp_R * ( mp_phi - mp_phi0 + mp_cot_phi*(1 - cos(mp_E)))   ! eqn (97)
+!endif
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_polymark.jnl b/jnls/go/mp_polymark.jnl
new file mode 100644
index 0000000..dd42054
--- /dev/null
+++ b/jnls/go/mp_polymark.jnl
@@ -0,0 +1,125 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_polymark.jnl --  Map projection version of polymark.jnl.  For
+!                    working with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 4/99
+
+! Description:  Plot polygons using a predefined map projection. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!	mp_mask  mask for orthographic map projections
+!
+! Usage:                  $1        $2    $3     $4      $5      $6
+! Yes?  GO polymark polygon_command xpts ypts [values] [shape] [scale]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track 
+! $3 - Y coordinates of track 
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - shape of the symbol, as defined by polyshape.jnl 
+! $6 - scale the symbol size by this factor (optional, default 1)
+
+!      shape names include:
+!           triangle           delta           square
+!           diamond            pentagon        hexagon
+!           circle             star            plus
+!           ex
+!
+! Example:
+!     set win/size=.4
+!     use coads_climatology
+!     set region/x=130:250/y=20:64/l=1
+!     go mp_hammer
+!     set grid sst
+!     shade/noaxis sst, x_page, y_page
+!     
+!     use polydata
+!     go mp_polymark poly/over/noaxis/key lon lat sst star 0.5
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO mp_polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $2"<usage: yes? GO mp_polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $3"<usage: yes? GO mp_polymark polygon_command xpts ypts [values] [shape] [scale]"
+
+!message/cont "If this script does not complete you will need to rerun the map projection script."
+!
+! Save the region and grid
+!
+define region/default save
+set grid/save
+
+!  acm (as in mp_land etc)
+!  tie down mp_central_meridian and parallel or else they get redefined
+!  when we cancel the region and use the one implied by lon and lat that 
+!  come into this script.
+
+set data/save
+set grid/save
+
+let/quiet mp_x = x
+let/quiet mp_xmin = `mp_x[i=@min]`
+let/quiet mp_xmax = `mp_x[i=@max]`
+let/quiet mp_y = y
+let/quiet mp_ymin = `mp_y[j=@min]`
+let/quiet mp_ymax = `mp_y[j=@max]`
+let/quiet mp_std_parallel_north = mp_ymax
+let/quiet mp_std_parallel_south = mp_ymin
+
+!
+! This test will keep the central meridians defined by "from space" views
+!
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = `(mp_x[i=@max] + mp_x[i=@min])/2`
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = `(mp_y[j=@max] + mp_y[j=@min])/2`
+endif
+cancel variable mp_test
+
+
+! Cancel the region because the I index info is used to restrict
+! the points to be plotted as a line.
+!
+can region/x/y
+
+!
+! Alter the map projection equations to use xpos and ypos
+!
+let/quiet mp_x = $2
+let/quiet mp_y = $3
+go polymark $1 x_page*mp_mask y_page*mp_mask $4"0" $5"triangle" $6"1"
+!
+! Restore the region, grid and map projection equations
+!
+set region save
+set grid/restore
+
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+let/quiet mp_test = `mp_central_meridian` - `(mp_x[i=@max] + mp_x[i=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_central_meridian = (mp_x[i=@max] + mp_x[i=@min])/2
+endif
+let/quiet mp_test = `mp_standard_parallel` - `(mp_y[j=@max] + mp_y[j=@min])/2`
+if `mp_test eq 0` then
+   let/quiet mp_standard_parallel = (mp_y[j=@max] + mp_y[j=@min])/2
+endif
+cancel variable mp_test
+let/quiet mp_std_parallel_north = mp_y[j=@max]
+let/quiet mp_std_parallel_south = mp_y[j=@min]
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+set mode/last verify
+
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_polytube.jnl b/jnls/go/mp_polytube.jnl
new file mode 100644
index 0000000..bd325fd
--- /dev/null
+++ b/jnls/go/mp_polytube.jnl
@@ -0,0 +1,76 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_polytube.jnl --  Map projection version of polytube.jnl.  For
+!                    working with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 4/99
+
+! Description:  Plot a colored tube using a predefined map projection. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!	mp_mask  mask for orthographic map projections
+!
+! Usage:                     $1         $2   $3   $4      $5       $6
+! yes?  GO mp_polytube polygon_command xpts ypts values [scale] [smooth]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track
+! $3 - Y coordinates of track
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - scale the values by this factor (optional, default 1)
+! $6 - smooth the track to be plotted with SBX:$6 (optional, default 3)
+!      The "smooth" parameter is given in units of the number of points over
+!      which a running mean filter will be applied to the normal vectors. It 
+!      is effective only in special cases. For "rough" paths, best results are
+!      obtained by smoothing the position data that is passed to this script. 
+
+! Example:
+!     set win/size=.4
+!     use coads_climatology
+!     set region/x=130:250/y=20:64/l=1
+!     go mp_hammer
+!     set grid sst
+!     shade/noaxis sst, x_page, y_page
+!     
+!     use polydata
+!     go mp_polytube poly/over/noaxis/key lon lat sst star 0.5
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $2"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $3"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+
+!
+! Save the region and grid
+!
+define region/default save
+set grid/save
+
+! Cancel the region because the I index info is used to restrict
+! the points to be plotted as a line.
+!
+can region/x/y
+
+!
+! Alter the map projection equations to use xpos and ypos
+!
+let/quiet mp_x = $2
+let/quiet mp_y = $3
+
+go polytube $1 x_page*mp_mask y_page*mp_mask $4"0" $5"1" $6"3"
+
+!
+! Restore the region, grid and map projection equations
+!
+set region save
+set grid/restore
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_polytube_bent.jnl b/jnls/go/mp_polytube_bent.jnl
new file mode 100644
index 0000000..16f7c00
--- /dev/null
+++ b/jnls/go/mp_polytube_bent.jnl
@@ -0,0 +1,76 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_polytube.jnl --  Map projection version of polytube.jnl.  For
+!                    working with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 4/99
+
+! Description:  Plot a colored tube using a predefined map projection. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!	mp_mask  mask for orthographic map projections
+!
+! Usage:                     $1         $2   $3   $4      $5       $6
+! yes?  GO mp_polytube polygon_command xpts ypts values [scale] [smooth]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track
+! $3 - Y coordinates of track
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - scale the values by this factor (optional, default 1)
+! $6 - smooth the track to be plotted with SBX:$6 (optional, default 3)
+!      The "smooth" parameter is given in units of the number of points over
+!      which a running mean filter will be applied to the normal vectors. It 
+!      is effective only in special cases. For "rough" paths, best results are
+!      obtained by smoothing the position data that is passed to this script. 
+
+! Example:
+!     set win/size=.4
+!     use coads_climatology
+!     set region/x=130:250/y=20:64/l=1
+!     go mp_hammer
+!     set grid sst
+!     shade/noaxis sst, x_page, y_page
+!     
+!     use polydata
+!     go mp_polytube poly/over/noaxis/key lon lat sst star 0.5
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $2"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $3"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+
+!
+! Save the region and grid
+!
+define region/default save
+set grid/save
+
+! Cancel the region because the I index info is used to restrict
+! the points to be plotted as a line.
+!
+can region/x/y
+
+!
+! Alter the map projection equations to use xpos and ypos
+!
+let/quiet mp_x = $2
+let/quiet mp_y = $3
+
+go polytube_bent $1 x_page*mp_mask y_page*mp_mask $4"0" $5"1" $6"3"
+
+!
+! Restore the region, grid and map projection equations
+!
+set region save
+set grid/restore
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_rotate.jnl b/jnls/go/mp_rotate.jnl
new file mode 100644
index 0000000..4c30213
--- /dev/null
+++ b/jnls/go/mp_rotate.jnl
@@ -0,0 +1,47 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_rotate.jnl --  Sets up variables for a Rotated projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Ansley Manke 4/28/05
+! based on other map projection scripts
+
+! Description:  Sets up variables for a Rotated map of the world
+!
+! Usage:      
+!  go mp_rotate angle [central meridian] [standard_parallel]
+!
+! arg 1 - angle to rotate from horizontal X axis, in degrees
+! arg 2 - longitude used for the center of the projection, mp_central_meridian
+! arg 3 - latitude used for the center of the projection, mp_standard_parallel
+
+! Example:
+!  use coads_climatology 
+!  go mp_rotate 30
+!  set grid sst
+!  shade/noaxis sst[l=1], x_page, y_page
+!
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $2%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $3%(mp_y[j=@max] + mp_y[j=@min])/2 %  ! ???
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = $1* deg2rad
+
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+
+let/quiet mp_phi0 = mp_standard_parallel * deg2rad
+
+let/quiet mp_lambda = mp_x * deg2rad - mp_lambda0
+let/quiet mp_phi = mp_y * deg2rad - mp_phi0
+
+let/quiet x_page = mp_lambda* cos(mp_R) - mp_phi* sin(mp_R)
+let/quiet y_page = mp_phi* cos(mp_R) + mp_lambda* sin(mp_R)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_sinusoidal.jnl b/jnls/go/mp_sinusoidal.jnl
new file mode 100644
index 0000000..b846b84
--- /dev/null
+++ b/jnls/go/mp_sinusoidal.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_sinusoidal.jnl --  Sets up variables for a Sinusoidal projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Sinusoidal map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_sinusoidal [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_sinusoidal
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_sinusoidal
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_sinusoidal `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (mp_lambda-mp_lambda0) * cos(mp_phi)   ! eqn (23)
+let/quiet y_page = mp_R * (mp_phi)                               ! eqn (14)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_stereographic_eq.jnl b/jnls/go/mp_stereographic_eq.jnl
new file mode 100644
index 0000000..4650ce0
--- /dev/null
+++ b/jnls/go/mp_stereographic_eq.jnl
@@ -0,0 +1,75 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_stereographic_eq.jnl --  Sets up variables for a Stereographic Equatorial projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Stereographic Equatorial map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_stereographic_eq [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_stereographic_eq
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_stereographic_eq
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_stereographic_eq `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_k0 = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_cos_z = cos(mp_phi) * cos(mp_lambda-mp_lambda0)                 ! eqn (117)
+let/quiet mp_bigK = 2 * mp_k0 / (1+mp_cos_z)                                 ! eqn (118)
+
+let/quiet x_page = mp_R * mp_bigK * cos(mp_phi) * sin(mp_lambda-mp_lambda0)  ! eqn (114)
+let/quiet y_page = mp_R * mp_bigK * sin(mp_phi)                              ! eqn (119)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_stereographic_north.jnl b/jnls/go/mp_stereographic_north.jnl
new file mode 100644
index 0000000..eed9bd9
--- /dev/null
+++ b/jnls/go/mp_stereographic_north.jnl
@@ -0,0 +1,74 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_stereographic_north.jnl --  Sets up variables for a Stereographic North projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Stereographic North map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_stereographic_north [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_stereographic_north
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_stereographic_north
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_stereographic_north `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_k0 = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_rho = 2 * mp_R * mp_k0 * tan(Pi/4 - mp_phi/2)     ! eqn (116)
+
+let/quiet x_page = mp_rho * sin(mp_lambda-mp_lambda0)          ! eqn (108)
+let/quiet y_page = (-1.0) * mp_rho * cos(mp_lambda-mp_lambda0) ! eqn (109)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_stereographic_south.jnl b/jnls/go/mp_stereographic_south.jnl
new file mode 100644
index 0000000..ba7622d
--- /dev/null
+++ b/jnls/go/mp_stereographic_south.jnl
@@ -0,0 +1,74 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_stereographic_south.jnl --  Sets up variables for a Stereographic South projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Stereographic South map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_stereographic_south [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_stereographic_south
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_stereographic_south
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_stereographic_south `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_mer` + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_k0 = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_rho = 2 * mp_R * mp_k0 * tan(Pi/4 + mp_phi/2)     ! eqn (116)
+
+let/quiet x_page = (-1.0) * mp_rho * sin(mp_lambda-mp_lambda0) ! eqn (108)
+let/quiet y_page = (-1.0) * mp_rho * cos(mp_lambda-mp_lambda0) ! eqn (109)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_trackplot.jnl b/jnls/go/mp_trackplot.jnl
new file mode 100644
index 0000000..ac95ba1
--- /dev/null
+++ b/jnls/go/mp_trackplot.jnl
@@ -0,0 +1,79 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_trackplot.jnl --  Map projection version of trackplot.jnl.  For
+!                    working with map projection scripts in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 4/99
+
+! Description:  Plot a trackplot using a predefined map projection. 
+!
+! This script presumes that following are predefined a projection script
+! run previous to this script:
+!
+!	x_page	field describing transformation from lat/lon to X page coordinates
+!	x_page	field describing transformation from lat/lon to Y page coordinates
+!	mp_mask  mask for orthographic map projections
+!
+! Usage:                    $1        $2     $3     $4     $5        $6        $7
+! yes?  GO mp_trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]
+! $1 - the plot command with qualifiers (eg PLOT/VS/OVER/LINE=2)
+! $2 - X coordinates of track to be plotted
+! $3 - Y coordinates of track to be plotted
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - scale the values by this factor (optional, default 1)
+! $6 - baseline (a.k.a. offset) -- what data value is associated with zero
+!      displacement from the trackline ans the "horizontal axis" of the trackplot
+!      Default = 0
+! $7 - smooth the track to be plotted with SBX:$6 (optional, default 3)
+!      The "smooth" parameter is given in units of the number of points over
+!      which a running mean filter will be applied to the normal vectors. It 
+!      is effective only in special cases. For "rough" paths, best results are
+!      obtained by smoothing the position data that is passed to this script. 
+
+! Example:
+!     set win/size=.4
+!     use coads_climatology
+!     set region/x=130:250/y=20:64/l=1
+!     go mp_hammer
+!     set grid sst
+!     shade/noaxis sst, x_page, y_page
+!     
+!     use polydata
+!     go mp_trackplot plot/vs/over/noaxis/line=2 lon lat sst values
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+QUERY/IGNORE $2"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+QUERY/IGNORE $3"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+
+!
+! Save the region and grid
+!
+define region/default save
+set grid/save
+
+! Cancel the region because the I index info is used to restrict
+! the points to be plotted as a line.
+!
+can region/x/y
+
+!
+! Alter the map projection equations to use xpos and ypos
+!
+let/quiet mp_x = $2
+let/quiet mp_y = $3
+
+go trackplot $1 x_page*mp_mask y_page*mp_mask $4"0" $5"1" $6"0" $7"3"
+
+!
+! Restore the region, grid and map projection equations
+!
+set region save
+set grid/restore
+
+let/quiet mp_x = x
+let/quiet mp_y = y
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_vertical_perspective.jnl b/jnls/go/mp_vertical_perspective.jnl
new file mode 100644
index 0000000..eab7bf8
--- /dev/null
+++ b/jnls/go/mp_vertical_perspective.jnl
@@ -0,0 +1,68 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_vertical_perspective.jnl --  Sets up variables for a Vertical Perspective projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Vertical Perspective map of the world
+!
+! Usage:                             arg1             arg2          arg3
+!  go mp_vertical_perspective central_meridian standard_parallel distance(km)
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+! arg 2 - distance above the earth in km
+
+! Example:
+!  use coads_climatology 
+!  go mp_vertical_perspective 300 45 35900
+!  set grid sst
+!  let masked_sst = sst * mp_mask
+!  shade masked_sst[l=1], x_page, y_page
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+query/ignore $1"<Please supply a longitude and latitude:    go mp_vertical_perspective 300 45 35900"
+query/ignore $2"<Please supply a longitude and latitude:    go mp_vertical_perspective 300 45 35900"
+query/ignore $3"<Please supply a distance above the Earth:    go mp_Vertical_Perspective 300 0 35900"
+
+if `$2 gt 90` then
+	query/ignore $3"<The latitude must be between -90 and 90"
+elif `$2 lt (-90)` then
+	query/ignore $3"<The latitude must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 6.38 * 10^3
+let/quiet mp_P = ($3 + mp_R)/mp_R
+let/quiet mp_k0 = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+let/quiet mp_phi1 = mp_standard_parallel * deg2rad
+
+let/quiet mp_cos_z = sin(mp_phi1)*sin(mp_phi) + cos(mp_phi1)*cos(mp_phi)*cos(mp_lambda-mp_lambda0)                    ! eqn (112)
+let/quiet mp_bigK = (mp_P-1)/(mp_P-mp_cos_z)                                                                 ! eqn (122)
+
+let/quiet x_page = mp_R * mp_bigK * cos(mp_phi) * sin(mp_lambda-mp_lambda0)                                    ! eqn (114)
+let/quiet y_page = mp_R * mp_bigK * ( cos(mp_phi1)*sin(mp_phi) - sin(mp_phi1)*cos(mp_phi)*cos(mp_lambda-mp_lambda0) )   ! eqn (115)
+
+let/quiet mp_mask = if mp_cos_z ge (1/mp_P) then 1 
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_viewport_aspect.jnl b/jnls/go/mp_viewport_aspect.jnl
new file mode 100644
index 0000000..c4771b6
--- /dev/null
+++ b/jnls/go/mp_viewport_aspect.jnl
@@ -0,0 +1,103 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_viewport_aspect.jnl -- Calculate the appropriate aspect ratio for the
+!                           current region and map projection and then define
+!                           a viewport with the appropriate dimensions.
+!		    		
+! Jonathan Callahan
+! 6/99
+
+! Description:  Define a viewport for plotting map projections
+!
+! Usage:           arg1   arg2   arg3     arg4         arg5
+!  go mp_viewport xlolim xhilim ylolim text_factor [viewport_name]
+!
+! arg 1 - X lo limit [0,1] (as in DEFINE VIEWPORT/XLIMITS=xlolim,xhilim)
+! arg 2 - X hi limit [0,1] (as in DEFINE VIEWPORT/XLIMITS=xlolim,xhilim)
+! arg 3 - Y lo limit [0,1] (as in DEFINE VIEWPORT/YLIMITS=ylolim,yhilim)
+! arg 4 - text prominence  (as in DEFINE VIEWPORT/TEXT=text_factor)
+! arg 5 - viewport name
+
+! Example 1: 2 viewports on an 8.5 X 11 plot
+!
+!  set win/size=.4/aspect=`11/8.5` ! set up desired page size and aspect
+!  use coads_climatology
+!  set grid sst                    ! out of habit, for map projections
+!  shade sst[l=1]                  ! to initialize the window
+!  set region/x=80w:40e/y=30n:80n
+!  go mp_bonne
+!  go margins 0.4 0.4 0.4 0.8      ! to specify narrow margins
+!  go mp_viewport_aspect 0 1 0 1 mp_vp1
+!  shade/noaxis/nolabel sst[l=7], x_page, y_page
+!  go mp_fland
+!  go mp_label 340 85 0 0 .3 "@TRJuly SST"
+!  go mp_viewport_aspect 0 1 0.5 1 mp_vp2
+!  shade/noaxis/nolabel sst[l=1], x_page, y_page
+!  go mp_fland
+!  go mp_label 340 85 0 0 .3 "@TRJanuary SST"
+!
+
+! Getting the right aspect ratio for plots in viewports is rather
+! complicated because of the interaction of various elements in 
+! plot plus.  In order to get the aspect ratios right, we need to
+! calculate and specify the X and Y axis lengths.
+!
+! The basic equations we need to know are the following:
+!
+! xaxlen = xfraction * plot_width - right_margin - left_margin
+! yaxlen = yfraction * plot_height - top_margin - bottom_margin
+! aspect_ratio = yaxlen / xaxlen
+!
+! For non-viewports xfraction and yfraction are both 1.0.
+!
+! When using viewports, 
+!
+! xfraction = scale * (xhilim - xlolim)
+! yfraction = scale * (yhilim - ylolim)
+! scale = 1 / sqrt(text_factor)
+!
+! If you know xhilim, xlolim, ylolim, text_factor and the
+! various margins, you can solve for yhilim which is what we do
+! below.
+
+
+! First determine the margins that are currently set
+!
+let/quiet mp_vp_top = `($vp_height) - ($ppl$yorg) - ($ppl$ylen)`
+let/quiet mp_vp_bottom = `($ppl$yorg)`
+let/quiet mp_vp_left = `($ppl$xorg)`
+let/quiet mp_vp_right = `($vp_width) - ($ppl$xorg) - ($ppl$xlen)`
+
+! Get the arguments 
+!
+let/quiet mp_vp_xlolim=$1"0"
+let/quiet mp_vp_xhilim=$2"1"
+let/quiet mp_vp_ylolim=$3"0"
+let/quiet mp_vp_text_factor = $4"1"
+let/quiet mp_vp_fractional_width = mp_vp_xhilim-mp_vp_xlolim
+
+! Calculate the aspect ratio
+!
+let/quiet mp_vp_x_axis_range = `x_page[i=@max,j=@max]` - `x_page[i=@min,j=@min]`
+let/quiet mp_vp_y_axis_range = `y_page[i=@max,j=@max]` - `y_page[i=@min,j=@min]`
+let/quiet mp_vp_ratio = mp_vp_y_axis_range / mp_vp_x_axis_range
+
+let mp_vp_xfrac = mp_vp_fractional_width / mp_vp_text_factor^0.5
+
+let mp_vp_fractional_height = (mp_vp_text_factor^0.5/($ppl$height)) * (mp_vp_ratio*(mp_vp_xfrac*($ppl$width)-mp_vp_left-mp_vp_right)+mp_vp_top+mp_vp_bottom)
+
+! Define the new viwport
+! Set the new viewport
+! Keep the original margin specification
+!
+define view/xlimits=`mp_vp_xlolim`,`mp_vp_xhilim`/ylimits=`mp_vp_ylolim`,`mp_vp_ylolim+mp_vp_fractional_height`/text=`mp_vp_text_factor` $5"mp_viewport"
+set view $5"mp_vewport"
+go margins `mp_vp_top` `mp_vp_bottom` `mp_vp_left` `mp_vp_right`
+
+! Clean up our mess
+!
+cancel variable mp_vp_*
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
+ 
diff --git a/jnls/go/mp_wagner_vii.jnl b/jnls/go/mp_wagner_vii.jnl
new file mode 100644
index 0000000..a00859f
--- /dev/null
+++ b/jnls/go/mp_wagner_vii.jnl
@@ -0,0 +1,75 @@
+\ cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_wagner_vii.jnl --  Sets up variables for a Wagner VII projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Wagner VII map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_wagner_vii [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_wagner_vii
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_wagner_vii
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_wagner_vii `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet mp_S = 0.90631 * sin(mp_phi)                                       ! eqn (180)
+let/quiet mp_C0 = (1-mp_S^2)^.5                                              ! eqn (181)
+let/quiet mp_C1 = ( 2 / (1 + mp_C0*cos((mp_lambda-mp_lambda0)/3)) )^.5       ! eqn (182)
+
+let/quiet x_page = 2.66723 * mp_R * mp_C0 * mp_C1 * sin((mp_lambda-mp_lambda0)/3)  ! eqn (183)
+let/quiet y_page = 1.24104 * mp_R * mp_S * mp_C1                             ! eqn (184)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/mp_winkel_i.jnl b/jnls/go/mp_winkel_i.jnl
new file mode 100644
index 0000000..b49fa8a
--- /dev/null
+++ b/jnls/go/mp_winkel_i.jnl
@@ -0,0 +1,72 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! mp_winkel_i.jnl --  Sets up variables for a Winkel I projection using
+!                  'curvilinear coordinates' code in Ferret v4.50
+!		    		
+! Jonathan Callahan
+! 5/97
+
+! Description:  Sets up variables for a Winkel I map of the world
+!
+! Usage:                   arg1               arg2
+!  go mp_winkel_1 [central meridian] [standard parallel]
+!
+! arg 1 - longitude used for the center of the projection
+! arg 2 - latitude used for the center of the projection
+
+! Example:
+!  use coads_climatology 
+!  go mp_winkel_1
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!
+! Note 1: If you intend to plot an overlay which is a subregion
+!         of the original plot you will need to specify the two
+!         optional arguments as in:
+!
+!  use coads_climatology 
+!  go mp_winkel_1
+!  set grid sst
+!  shade sst[l=1], x_page, y_page
+!  go mp_winkel_1 `mp_central_meridian` `mp_standard_parallel`
+!  set region/x=40e:110e/y=60s:20s
+!  shade/over slp[l=1], x_page, y_page
+!
+! Note 2: The x-range for the subregion to be overlayed must
+!         be: ( `mp_cent_mer` - 180 < x < `mp_cent_me`r + 180 )
+
+! This journal file comes from equations in the following book:
+!
+!    An Album of Map Projections
+!    U.S. Geological Survey
+!    Professional Paper 1453
+!
+! Equation numbers refer to the equation number in this book.
+
+if `$2%0% gt 90` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+elif `$2%0% lt (-90)` then
+    query/ignore $3"<The standard parallel must be between -90 and 90"
+endif
+
+let/quiet mp_x = x
+let/quiet mp_central_meridian = $1%(mp_x[i=@max] + mp_x[i=@min])/2%
+let/quiet mp_y = y
+let/quiet mp_standard_parallel = $2%(mp_y[j=@max] + mp_y[j=@min])/2%
+
+let/quiet Pi = 3.14159265
+let/quiet deg2rad = Pi / 180.0
+
+let/quiet mp_R = 1
+let/quiet mp_lambda0 = mp_central_meridian * deg2rad
+let/quiet mp_phi1 = mp_standard_parallel * deg2rad
+let/quiet mp_lambda = mp_x * deg2rad
+let/quiet mp_phi = mp_y * deg2rad
+
+let/quiet x_page = mp_R * (mp_lambda-mp_lambda0) * (cos(mp_phi1) + cos(mp_phi)) / 2   ! eqn (27)
+let/quiet y_page = mp_R * mp_phi                                             ! eqn (28)
+
+let/quiet mp_mask = 1
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/multi_xaxis_overlay.jnl b/jnls/go/multi_xaxis_overlay.jnl
new file mode 100644
index 0000000..2369f74
--- /dev/null
+++ b/jnls/go/multi_xaxis_overlay.jnl
@@ -0,0 +1,71 @@
+\cancel mode verify
+! multi_xaxis_overlay.jnl
+
+! Description: PLOT/Overlay a variable plot using a new X axis
+
+! This GO file presents one possible style for overlaying multiple plots
+! on multiple X axes.
+! Copy and modify this file to customize to individual needs.
+
+! usage:
+!  GO multi_xaxis_overlay exprn overlay_# ["-"] [scale] [key] [hgt]
+!					  [axis_spacing] [args]
+! 1		exprn - FERRET expression to be plotted
+! 2		overlay_# 1-n, increasing as each overlay is added
+! 3 optional: 	"-" to locate axis below (negative) X axis (v.s. "+")
+! 4 optional:	scale - "low,high,delta" in quotes for axis scaling
+! 5 optional:	key - title string documenting the variable to be plotted
+! 6 optional:	hgt - PLOT+ character height for key string [default 0.12]
+! 7 optional:	"axis_spacing" controls axis location [default 0.9]
+! 8 optional:	"args" specifies all other %xaxis options [",,,,,(1PG10.3)"]
+!		(see PLOT+ Users' Guide, chapter 10)
+!  e.g. (temp, salt, and u on a single plot)
+!	yes? SET REGION/Z=0:500
+!	yes? PLOT/TITLE="Vertical Cast" temp
+!	yes? GO multi_xaxis_overlay salt 1
+!	yes? GO multi_xaxis_overlay    u 2
+
+! tell FERRET to introduce PLOT+ to this variable
+plot/over/set $1
+ppl labs
+ppl aline
+
+ppl set axov_spacing $7"0.9"     	! space between axes
+ppl set axov_number $2"1"
+ppl set tmp 'axov_number' + 1
+ppl set axov_pen $INTEGER(tmp)
+ppl set tmp $3" "'axov_number'
+ppl set axov_ypos 'tmp' * 'axov_spacing'
+ppl set axov_midpoint 'ppl$xlen' / 2.0
+ppl set axov_ylabpos 'axov_ypos' - 0.55
+ppl set axov_xlabpos 'axov_midpoint' - 1.2
+ppl set axov_aline_start 'axov_midpoint' - 2.9
+ppl set axov_aline_end 'axov_midpoint' - 1.4
+ppl set axov_aline_ypos 'axov_ypos' - 0.50
+
+! set pen color
+ppl pen 1,'axov_pen'
+
+! set up label to match pen color
+! use this labelling scheme to get good black and white hard copy
+ppl xlab
+ppl labs/nouser 1,'axov_xlabpos','axov_ylabpos',-1 $5"@AS'labkey'"
+ppl hlabs 1,$6"0.12"
+
+! use this labelling scheme instead for color devices
+!ppl xlab @P'axov_pen'@AS'labkey'
+
+! set up scaling and draw axis
+ppl %range 'PPL$XMIN1','PPL$XMAX1',10
+ppl %xaxis/nouser $4"'ppl$range_low','ppl$range_high','ppl$range_inc'",'axov_ypos',$8",,,,,(1PG10.3)"
+
+! draw the overlay
+ppl window off
+ppl plot/over
+ppl aline/nouser 1,'axov_aline_start','axov_aline_ypos','axov_aline_end','axov_aline_ypos'
+
+! cleanup
+ppl window on
+ppl pen 1,1
+
+set mode/last verify
diff --git a/jnls/go/multi_xaxis_plot1.jnl b/jnls/go/multi_xaxis_plot1.jnl
new file mode 100644
index 0000000..ecbac92
--- /dev/null
+++ b/jnls/go/multi_xaxis_plot1.jnl
@@ -0,0 +1,78 @@
+\cancel mode verify
+! multi_xaxis_plot1.jnl
+
+! Description: Draw a plot formatted for later overlays using multiple X axes
+
+! This is the [optional] initialization routine for multi_xaxis_overlay
+
+! replaced 'GO magnify 1' with pertinent lines of magnify.jnl (problem
+! with state of mode verify) 11/93
+
+! usage:
+!  GO multi_xaxis_plot1 expression [#_overlays_below_axis]
+! 1		FERRET expression to be plotted
+! 2 optional:	#_overlays_below_axis  0 or positive (# of overlays to follow)
+
+!  example 1: temp, salt, and u with X axes stacked **above** the original
+!	yes? SET REGION/Z=0:500
+!	yes? GO multi_xaxis_plot1 temp
+!	yes? GO multi_xaxis_overlay salt 1	! new axis drawn above original
+!	yes? GO multi_xaxis_overlay    u 2
+
+!  example 2: temp, salt, and u with X axes stacked **below** the original
+!	yes? SET REGION/Z=0:500
+!	yes? GO multi_xaxis_plot1 temp 2    	! 2 plots follow w/ axes below
+!	yes? GO multi_xaxis_overlay salt 1 "-"  ! "-" -> below axis overlay 
+!	yes? GO multi_xaxis_overlay    u 2 "-"
+
+! Note that a non-zero value for #_overlays_below_axis will alter the Y
+!	plot origin and Y axis length.  Use SET VIEWPORT, CANCEL VIEWPORT,
+!	or PPL/RESET to restore axis positions following this plot
+
+! reset axis sizes and positions
+!GO magnify 1
+ppl origin 1.2, 1.4
+ppl set tmpx 'vp_width' - 2.2
+ppl set tmpy 'vp_height' - 2.8
+ppl axlen 'tmpx','tmpy'
+
+! initialize  (FERRET initializes PLOT+ through "plot/set")
+ppl set axov_number 1
+ppl set axov_ypos 0
+ppl set axov_spacing 0.9		! space between axes
+plot/set $1
+
+! shift X axis up to allow room for other axes below
+ppl set axov_yoffset 'axov_spacing' * $2"0"
+ppl set tmp 'ppl$yorg' + 'axov_yoffset'
+ppl origin ,'tmp'
+ppl set tmp 'ppl$ylen' - 'axov_yoffset'
+ppl axlen ,'tmp'
+
+! reinitialize PLOT+ with shifted origin and axis length
+ppl nlines
+plot/set $1
+ppl set axov_midpoint 'ppl$xlen' / 2.0
+ppl set axov_ylabpos 'axov_ypos' - 0.55
+ppl set axov_xlabpos 'axov_midpoint' - 1.2
+ppl set axov_aline_start 'axov_midpoint' - 2.9
+ppl set axov_aline_end 'axov_midpoint' - 1.4
+ppl set axov_aline_ypos 'axov_ypos' - 0.50
+
+! no title (interferes with axes below)
+ppl title
+
+! use this labelling scheme to get good black and white hard copy
+ppl xlab
+ppl labs/nouser 2,'axov_xlabpos','axov_ylabpos',-1 @AS'labtit'
+ppl hlabs 2,0.12
+
+! use this labelling scheme instead for color devices
+!ppl xlab @P'axov_pen'@AS'labtit'
+
+! draw the plot
+ppl pen 1,1
+ppl plot
+ppl aline/nouser 1,'axov_aline_start','axov_aline_ypos','axov_aline_end','axov_aline_ypos'
+
+set mode/last verify
diff --git a/jnls/go/multi_yaxis_overlay.jnl b/jnls/go/multi_yaxis_overlay.jnl
new file mode 100644
index 0000000..e539f9f
--- /dev/null
+++ b/jnls/go/multi_yaxis_overlay.jnl
@@ -0,0 +1,76 @@
+\cancel mode verify
+! multi_yaxis_overlay.jnl
+
+! Description: PLOT/Overlay a variable plot using a new Y axis
+
+! This GO file presents one possible style for overlaying multiple plots
+! on multiple Y axes.
+! Copy and modify this file to customize to individual needs.
+
+! usage:
+!   GO multi_yaxis_overlay exprn overlay_# ["-"] [scale] [key] [hgt]
+!					   [axis_spacing] [args]
+! 1		exprn - FERRET expression to be plotted
+! 2		overlay_# 1-n, increasing as each overlay is added
+! 3 optional: 	"-" to locate axis on negative (left) side of plot (v.s. "+")
+! 4 optional:   scale - "low,high,delta" in quotes for axis scaling
+! 5 optional:	key - title string documenting the variable to be plotted
+! 6 optional:	hgt - PLOT+ character height for key string [default 0.12]
+! 7 optional:	"axis_spacing" controls axis location [default 1.1]
+! 8 optional:	"args" specifies all other %yaxis options [",,,,,(1PG10.3)"]
+!		(see PLOT+ Users' Guide, chapter 10)
+
+! Note: If the values require axis labels that are many digits (e.g. 1024.35
+! or 0.00124) it may be necessary to specify argument 4, "scale", manually.
+
+!  e.g. (temp, salt, and u on a single plot)
+!	yes? SET REGION/l=0:500
+!	yes? PLOT/TITLE="Time Series" temp
+!	yes? GO multi_yaxis_overlay salt 1
+!	yes? GO multi_yaxis_overlay    u 2
+
+! tell FERRET to introduce PLOT+ to this variable
+plot/over/set $1
+ppl labs
+ppl aline
+
+ppl set axov_spacing $7"1.1"    	! space between axes
+ppl set axov_number $2"1"
+ppl set tmp 'axov_number' + 1
+ppl set axov_pen $INTEGER(tmp)
+ppl set tmp $3" "'axov_number'
+ppl set axov_xpos 'tmp' * 'axov_spacing'
+ppl set axov_midpoint 'ppl$ylen' / 2.0
+ppl set axov_xlabpos 'axov_xpos' - 0.8
+ppl set axov_ylabpos 'axov_midpoint' - 0.5 
+ppl set axov_aline_start 'axov_midpoint' - 2.2
+ppl set axov_aline_end 'axov_midpoint' - 0.7
+ppl set axov_aline_xpos 'axov_xpos' - 0.85
+
+! set pen color
+ppl pen 1,'axov_pen'
+
+! set up label to match pen color
+! use this labelling scheme to get good black and white hard copy
+ppl ylab
+ppl labs/nouser 1,'axov_xlabpos','axov_ylabpos',-1 $5"@AS'labkey'"
+ppl rlabs 1,90
+ppl hlabs 1,$6"0.12"
+
+! set up scaling and draw axis
+ppl %range 'PPL$YMIN1','PPL$YMAX1',10
+ppl %yaxis/nouser $4"'ppl$range_low','ppl$range_high','ppl$range_inc'",'axov_xpos',$8",,,,,(1PG10.3)"
+
+! draw the overlay
+ppl window off
+ppl plot/over
+
+! draw the line specimen
+ppl aline/nouser 1,'axov_aline_xpos','axov_aline_start','axov_aline_xpos','axov_aline_end'
+
+! cleanup
+ppl window on
+ppl rlabs 1,0
+ppl pen 1,1
+
+set mode/last verify
diff --git a/jnls/go/multi_yaxis_plot1.jnl b/jnls/go/multi_yaxis_plot1.jnl
new file mode 100644
index 0000000..9fe6cd8
--- /dev/null
+++ b/jnls/go/multi_yaxis_plot1.jnl
@@ -0,0 +1,80 @@
+\cancel mode verify
+! multi_yaxis_plot1.jnl
+
+! Description: Draw a plot formatted for later overlays using multiple Y axes
+ 
+! This is the [optional] initialization routine for multi_yaxis_overlay
+
+! replaced 'GO magnify 1' with pertinent lines of magnify.jnl
+! (problem with state of mode verify) 11/93
+
+! usage:
+!  GO multi_yaxis_plot1 expression [#_vars_left_of_axis] [title]
+! 1		FERRET expression to be plotted
+! 2 optional:	"#_vars_left_of_axis", 0 or positive (overlays to follow)
+! 3 optional:	Title (size may preceed it)
+
+!  example 1: temp, salt, and u with Y axes **right** of the original
+!	yes? SET REGION/L=0:500
+!	yes? GO multi_yaxis_plot1 temp
+!	yes? GO multi_yaxis_overlay salt 1	! new axis drawn above original
+!	yes? GO multi_yaxis_overlay    u 2
+
+!  example 2: temp, salt, and u with Y axes **left** of the original
+!	yes? SET REGION/L=0:500
+!	yes? GO multi_yaxis_plot1 temp 2    	! 2 plots follow w/ axes left
+!	yes? GO multi_yaxis_overlay salt 1 "-"  ! "-" -> left of axis overlay 
+!	yes? GO multi_yaxis_overlay    u 2 "-"
+
+! Note that a non-zero value for #_overlays_below_axis will alter the Y
+!	plot origin and Y axis length.  Use SET VIEWPORT, CANCEL VIEWPORT,
+!	or PPL/RESET to restore axis positions following this plot
+
+! reset axis sizes and positions
+!GO magnify 1
+ppl origin 1.2, 1.4
+ppl set tmpx 'vp_width' - 2.2
+ppl set tmpy 'vp_height' - 2.8
+ppl axlen 'tmpx','tmpy'
+
+! initialize  (FERRET initializes PLOT+ through "plot/set")
+ppl set axov_number 1
+ppl set axov_xpos 0
+ppl set axov_spacing 1.1		! space between axes
+plot/set $1
+
+! shift Y axis up to allow room for other axes below
+ppl set axov_xoffset 'axov_spacing' * $2"0"
+ppl set tmp 'ppl$xorg' + 'axov_xoffset'
+ppl origin 'tmp'
+ppl set tmp 'ppl$xlen' - 'axov_xoffset'
+ppl axlen 'tmp'
+
+! reinitialize PLOT+ with shifted origin and axis length
+ppl nlines
+plot/set $1
+ppl set axov_midpoint 'ppl$ylen' / 2.0
+ppl set axov_xlabpos 'axov_xpos' - 0.8
+ppl set axov_ylabpos 'axov_midpoint' - 0.5
+ppl set axov_aline_start 'axov_midpoint' - 2.2
+ppl set axov_aline_end 'axov_midpoint' - 0.7
+ppl set axov_aline_xpos 'axov_xpos' - 0.85
+
+! set up variable #1 label
+ppl title $3" "
+
+! use this labelling scheme to get good black and white hard copy
+ppl ylab
+ppl labs/nouser 2,'axov_xlabpos','axov_ylabpos',-1 @AS'labtit'
+ppl hlabs 2,0.12
+ppl rlabs 2,90
+
+! set up the line specimen
+ppl aline/nouser 1,'axov_aline_xpos','axov_aline_start','axov_aline_xpos','axov_aline_end',on
+
+! draw the plot
+ppl plot
+
+! clean up
+ppl rlabs 2,0
+set mode/last verify
diff --git a/jnls/go/objective.jnl b/jnls/go/objective.jnl
new file mode 100644
index 0000000..e6fc483
--- /dev/null
+++ b/jnls/go/objective.jnl
@@ -0,0 +1,63 @@
+\cancel mode verify
+! objective.jnl  11/93 *sh*
+! Description: 2D objective analysis of scattered data
+
+! NOTE: See external functions scat2grid* for options on gridding data
+
+SAY OBJECTIVE function has been discontinued.
+SAY See external functions scat2grid*  for options on gridding data.
+SAY SCAT2GRID_LAPLACE_XY uses underlying code identical to what the objective function used.
+
+EXIT/SCRIPT
+
+! usage:
+!  GO objective xpts ypts zpts "xlo:xhi:xdel" "ylo:yhi:ydel" [cay] [nrng]
+!							[filename] [append]
+! where
+!1-3	xpts ypts zpts 	- 3 arrays representing (X,Y,value) triples
+!4	xlo:xhi:xdel 	- output axis specification for first coordinate
+!5	ylo:yhi:ydel 	- output axis specification for second coordinate
+!6 optional	cay	- interpolation scheme (see PLOT+ CONSET command)
+! 			  0.0->Laplacian; large cay->Spline [default=5.0]
+!7 optional	nrng	- include points within nrng output grid cells in the
+!			  interpolation (see PLOT+ CONSET command) [dflt=5]
+!8 optional	filename- file name to receive output [dflt=fer_objective.unf]
+!9 optional	append	- "append" to old or create "new" file [default="new"]
+
+! example: Put scattered (long, lat, sst) triples (in variables lons,lats,ssts)
+!	   onto a grid that is 1x1 degree on 160E:160W and 20S:20N with
+!	   interpolations based on points within 8 grid points (degrees) and
+!	   output into file sst_grid.unf
+!
+!   yes? GO objective lons lats ssts "160:200:1" "-20:20:1" " " 8 sst_grid.unf
+ 
+! check that 5 mandatory arguments are provided and that arg 9 is valid
+query/ignore $5%<Use: GO objective xp yp zp "xlo:hi:dx" "ylo:hi:dy" [cay] [nrng] [ofile] ["append"]%
+query/ignore $9%new|new|append|delete|<specify "new" or "append" for argument 9%
+
+! remove (spawn rm) old file unless "append" is specified
+$9"sp rm -f|new>sp rm -f|append>sp touch|delete>sp rm -f" $8"fer_objective.unf"
+
+! if this output file is already in use via SET DATA then cancel it
+CANCEL DATA/NOERROR $8"fer_objective.unf"
+
+! define a grid as per the desired output
+define axis/x=$4 obj_xax
+define axis/y=$5 obj_yax
+define grid/x=obj_xax/y=obj_yax obj_grid
+
+! a message to the user ...
+say Your result will be variable "gridded" in data set $8"fer_objective.unf".
+
+! perform the objective alanysis
+USER/COMMAND=OBJECTIVE/opt1=$4,$5,$6"5.0",$7"5"/file=$8"fer_objective.unf" $1,$2,$3
+
+! prepare to use the new variable "gridded"
+set data/save
+file/grid=obj_grid/format=unf/variable=gridded $8"fer_objective.unf"
+set variable/bad=1E35 gridded
+set data/restore
+say Now you can SET REGION and issue:
+say ...... >>>  SHADE gridded[d=$8"fer_objective.unf"]  <<<
+
+set mode/last verify
diff --git a/jnls/go/one_climatology_month.jnl b/jnls/go/one_climatology_month.jnl
new file mode 100644
index 0000000..c44aad2
--- /dev/null
+++ b/jnls/go/one_climatology_month.jnl
@@ -0,0 +1,42 @@
+\cancel mode verify
+! 2/94 - one_climatology_month.jnl
+
+! Description: (work routine for make_monthly_climatology)
+
+! usage:  GO one_climatology_month variable clim_var_name month_num high_month file
+
+! variable:		monthly input variable name
+!
+! clim_var_name:	name for climatological result variable
+!
+! month_num:		what month (1 through 12) to process
+!
+! high_month:		highest monthe number in the input data to use
+!
+! file:			name of output data set
+!
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO one_climatology_month variable clim_var_name month_num high_month [file]%
+query/ignore $2%<Use: GO one_climatology_month variable clim_var_name month_num high_month [file]%
+query/ignore $3%<Use: GO one_climatology_month variable clim_var_name month_num high_month [file]%
+query/ignore $4%<Use: GO one_climatology_month variable clim_var_name month_num high_month [file]%
+query/ignore $5%<Use: GO one_climatology_month variable clim_var_name month_num high_month [file]%
+
+! ------------  start of procedure -------------
+
+set data/save
+
+! place all of this particular month into a single (temporary) file
+repeat/l=$3:$4:12 save/append/file=every_12th_month.cdf $1
+use every_12th_month.cdf
+
+! save/append/file=output_file/l=month_number   clim_var_name
+save/append/file=$5/l=$3 $2
+
+! eliminate traces of the temporary file
+cancel data every_12th_month.cdf
+spawn rm -f every_12th_month.cdf
+
+set data/restore
+set mode/last verify
diff --git a/jnls/go/overlay_bars.jnl b/jnls/go/overlay_bars.jnl
new file mode 100644
index 0000000..bd88469
--- /dev/null
+++ b/jnls/go/overlay_bars.jnl
@@ -0,0 +1,36 @@
+\CANCEL MODE VERIFY
+! overlay_bars.jnl 10/96
+
+! DESCRIPTION: Overlay error bars on a time series (or frequency) plot
+
+! This is a simple routine to overlay error bars. It is applicable only to
+! T axis plots and it creates only a simple vertical line (no I bar).
+
+! A more sophisticated script could be both faster and higher functioning.
+
+! Usage:                   1        2      3
+!       GO overlay_bars spectrum errors [color]
+
+! Arguments:
+
+!  spectrum - 1D field to be plotted (on T axis)
+!
+!  errors   - a 1D field of errors (bars from spectrum-error to spectrum+error)
+!
+!  color    - color of the error bars
+
+! check color parameter
+DEFINE SYMBOL ob_color $3"1|1|2|3|4|5|6|7|8|9|10|11|12|13|14|black>1|red>2|green>3|blue>4|<Unknown color argument"
+
+! define a 2-point vertical line with this variable
+LET/QUIET kk=k		! to work around a known bug in Ferret V4.4
+LET/QUIET vbar = if kk eq 1 then (-1)*$2 else $2
+
+! error bar plot
+REPEAT/L=`$1,return=lstart`:`$1,return=lend` PLOT/OVER/VS/LINE=($ob_color)/K=1:2/NOLAB $1*kk*0+T,$1+vbar
+
+! clean up
+CANCEL REGION/l
+CANCEL VARIABLE kk, vbar
+CANCEL SYMBOL ob_color
+SET MODE/LAST VERIFY
diff --git a/jnls/go/pdatekey_dms.jnl b/jnls/go/pdatekey_dms.jnl
new file mode 100644
index 0000000..7e3cf6d
--- /dev/null
+++ b/jnls/go/pdatekey_dms.jnl
@@ -0,0 +1,21 @@
+! pdatekey_dms
+! Add some or all of day:min:sec
+! to the labels in the date key according to the value of PLMlabel
+!
+! PLMlabel     add
+!  1          :hh
+!  2          :hh:mm
+!  3          :hh:mm:sss
+
+let dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+DEFINE SYMBOL hou = `INT(dayfrac*24)`
+DEFINE SYMBOL min = `INT( (dayfrac*24 - ($hou))* 60)`
+DEFINE SYMBOL sec = `INT( ( (dayfrac*24 - ($hou)) *60 - ($min)) *60)`
+
+IF `STRLEN("($hou)") EQ 1` THEN DEFINE SYMBOL hou = 0($hou)
+IF `STRLEN("($min)") EQ 1` THEN DEFINE SYMBOL min = 0($min)
+IF `STRLEN("($sec)") EQ 1` THEN DEFINE SYMBOL sec = 0($sec)
+
+IF `PLMlabel GT 0` THEN DEFINE SYMBOL dms = <NL>($hou)
+IF `PLMlabel GT 1` THEN DEFINE SYMBOL dms = ($dms):($min)
+IF `PLMlabel GT 2` THEN DEFINE SYMBOL dms = ($dms):($sec)
diff --git a/jnls/go/plot_swath.jnl b/jnls/go/plot_swath.jnl
new file mode 100644
index 0000000..a5f022b
--- /dev/null
+++ b/jnls/go/plot_swath.jnl
@@ -0,0 +1,88 @@
+\cancel mode verify
+! plot_swath.jnl
+! 6/99 *sh*
+! 1/02 *acm* add note on limits
+
+! Description: Plot a color-filed swath between upper and lower bounds
+
+! Usage:                    $1         $2  $3   $4
+! yes?	GO plot_swath polygon_command ylo yhi [xpts] 
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - upper bound variable
+! $3 - lower bound variable
+! $4 - x coordinates (shared by both of the following arguments)
+!    - default is the values of t the underlying axis of argment 2 
+
+! Note:
+!     The variables a and b must be 1-dimensional.  If they have axes
+!     that are normal to the axis of interest, then limits on those axes
+!     must be explicit in the expressions passed in arguments 2 and 3, 
+!     even if the range on that axis is a single point.  See example 3.
+
+! example 1 - difference between two points on a grid
+!	yes? use coads_climatology
+!	yes? let a = sst[y=0,l=1,x=20e:20e]
+!	yes? let b = sst[y=10n,l=1,x=20e:20e]
+!	yes? plot a,b
+!	yes? go plot_swath poly/over/nolabels/palette=black  a b
+
+! example 2 -- 3 colored time series
+!	yes? let base =  T[T=1-jan-1990:1-feb-1990:24] - T[T=1-jan-1990]
+!	yes? let y1 = base^0.5
+!	yes? let y2 = base
+!	yes? let y3 = base^1.1
+!	yes? let y4 = base^1.2
+!	
+!	yes? plot/nolabels y1,y2,y3,y4
+!	yes? go plot_swath poly/over/nolabels/palette=red   y1,y2
+!	yes? go plot_swath poly/over/nolabels/palette=green y2,y3
+!	yes? go plot_swath poly/over/nolabels/palette=blue  y3,y4
+!
+! example 3 -- 2 time series with 1-point z axis.
+!	yes? define axis/T=1-jan-1990:1-feb-1990:24] timeax
+!	yes? define axis/z=1:1:1 zax
+!	yes? define grid/z=zax/t=timeax ztgrid
+!	yes? let tpts = t[gt=ztgrid] - T[T=1-jan-1990]
+!	yes? let zpts = z[gz=ztgrid]
+!	yes? let a1 = tpts + zpts
+!	yes? let a2 = a1 + 100*sin(tpts/100)
+!	yes? plot/nolabels a1,a2
+!       yes? !  note we need to pass explicit Z limits even for a 1-point axis.
+!	yes? go plot_swath poly/over/nolabels/palette=red (a1[k=1]), (a2[k=1])
+!
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO plot_swath polygon_command ylo yhi [xpts]"
+QUERY/IGNORE $2"<usage: yes? GO plot_swath polygon_command ylo yhi [xpts]"
+QUERY/IGNORE $3"<usage: yes? GO plot_swath polygon_command ylo yhi [xpts]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET PSWylo = ($2)
+LET/QUIET PSWyhi = ($3)
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL PSWax `PSWylo,return=shape`
+DEFINE SYMBOL PSWquad_ax ($PSWax"|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a line")
+DEFINE SYMBOL PSWiax ($PSWax"|X>i|Y>j|Z>k|T>l")
+
+! get the dependent coordinates -- needed since POLYGON is like PLOT/VS
+! typically, "0*PSWylo + X[i=lo:hi]", so X is inherited from PSWylo
+IF $4"0|*>1" THEN
+   LET/QUIET PSWx = $4
+ELSE
+  DEFINE SYMBOL PSWilo `PSWylo,return=($PSWiax)start`
+  DEFINE SYMBOL PSWihi `PSWylo,return=($PSWiax)end`
+  LET/QUIET PSWx_raw =  0*PSWylo + ($PSWax)
+  LET/QUIET PSWx = PSWx_raw[($PSWiax)=($PSWilo):($PSWihi)]
+ENDIF
+
+! break swath into a sequence of discrete quadralaterals
+LET/QUIET PSWpindex = ($PSWquad_ax)[($PSWquad_ax)=1:4]
+LET/QUIET PSWx4_0 = IF PSWpindex EQ 1 OR PSWpindex EQ 4 then PSWx ELSE PSWx[($PSWax)=@shf:1]
+LET/QUIET PSWy4_1 = IF PSWpindex LE 2 then PSWylo ELSE PSWyhi
+LET/QUIET PSWy4_0 = IF PSWpindex EQ 1 OR PSWpindex EQ 4 then PSWy4_1 ELSE PSWy4_1[($PSWax)=@shf:1]
+
+$1/coord_ax=($PSWquad_ax)  PSWx4_0,PSWy4_0
+
+cancel symbol PSW*
+cancel variable PSW*
+set mode/last verify
diff --git a/jnls/go/polar.jnl b/jnls/go/polar.jnl
new file mode 100644
index 0000000..b0cb2fb
--- /dev/null
+++ b/jnls/go/polar.jnl
@@ -0,0 +1,4 @@
+! Description: Define R and THETA from X and Y to perform (limited) polar plots
+
+let theta = atan2(y,x)
+let r = (x^2+y^2)^.5
diff --git a/jnls/go/polar_2d.jnl b/jnls/go/polar_2d.jnl
new file mode 100644
index 0000000..96deac5
--- /dev/null
+++ b/jnls/go/polar_2d.jnl
@@ -0,0 +1,65 @@
+\cancel mode verify
+! 2/94 - polar_2d.jnl 
+
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction
+
+
+! Description: produce a 2D polar stereographic plot
+
+! usage:  GO polar_2d plot_command variable [rotation] [#_points] [limit] [fill] [file] [pole]
+
+! plot_command:		one of "SHADE" [default], "CONTOUR", or "FILL"
+!			including qualifiers (see note below)
+! variable:		variable or expression to be plotted.
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! (optional) rotation:	rotation of projected plot.  Zero [default] means
+!			prime meridian centered in upper half of plot
+!			Use rotation = 105 for FNOC and NMC plots
+! (optional) #_points:	number of points on X and Y axes of the final
+!			plot (essentially, the resolution of the plot)
+!			Use #_points=63 for FNOC grid, #_points=65 for NMC
+! (optional) limit:	fraction of full region that will be displayed
+!			Default = 1 (full region).  e.g. 0.5 will display
+!			only the -.5 to .5 region from the full plot
+! (optional) fill:	Either FILL or HOLE(default) to indicate how points
+!			bordering on missing values should be treated
+! (optional) file:	name of file to receive the sampled points
+!			Default = polar_grid.dat
+!			Note: the format of this file will be unformatted
+!			with #_points columns per record.
+! (optional) pole:      pole, +1 is north pole (default), -1 is south pole.
+
+! Note on plot command qualifiers:
+!  Use /TITLE= to annotate your plot
+!  /OVERLAY works fine
+!  /SET_UP requires manual setting and resetting of PPL tics and axlabp
+!  /X/Y/Z/T/I/J/K/L qualifiers will refer to the OUTPUT (page layout) grid
+!	not to the input (lat/long) grid		
+
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO polar_2d plot_command variable [angle] [#] [limit] ["FILL"] [file]%
+query/ignore $2%<Use: GO polar_2d plot_command variable [angle] [#] [limit] ["FILL"] [file]%
+
+! define the rotation
+let/quiet polar_rotation=$3"0"
+let/quiet signgr = if ($8"1.0") ge 0.0 then 1.0 else (-1.0)
+
+! extract the data ready to plot
+GO convert_to_polar_2d $2 $4"201" $6"HOLE" $7"polar_grid.dat"
+
+! produce the plot
+GO box_plot $1/x=-$5"1":$5"1"/y=-$5"1":$5"1" polar[d=$7"polar_grid.dat"]
+
+! coach the user on how to make quick replots
+MESSAGE/Cont "The following plotting command can be modified and reused:"
+MESSAGE/Cont >>>GO box_plot $1/x=-$5"1":$5"1"/y=-$5"1":$5"1" polar[d=$7"polar_grid.dat"]
+
+set mode/last verify
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/polar_fland.jnl b/jnls/go/polar_fland.jnl
new file mode 100644
index 0000000..f10786c
--- /dev/null
+++ b/jnls/go/polar_fland.jnl
@@ -0,0 +1,61 @@
+\cancel mode verify
+! polar_fland.jnl - overlay a land mask on a polar stereographic plot
+! (default 60 minute resolution)
+! 2/94
+ 
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction
+
+
+! Description: Overlay solid-filled continents on a polar plot
+
+! usage:  GO polar_fland [resolution] [palette] ["basemap"]
+!	GO polar_fland 	! use defaults: 60 minute resolution, color gray
+!	GO polar_fland 60	! same as "GO polar_fland"
+!	GO polar_fland 40	! 40 minute resolution
+!	GO polar_fland 20	! 20 minute resolution
+!	GO polar_fland 5	!  5 minute resolution - use with caution
+!	GO polar_fland 120	!  2 degree resolution
+!	GO polar_fland  20 red	! 20 minute resolution with palette red.spk
+!	GO polar_fland " " red	! default (60) minute resolution in red
+!       GO polar_fland " " red basemap
+
+! Note 1: The variable POLAR_ROTATION must be defined before running this
+!	  routine.  (especially an issue for the "basemap" option, above)
+! Note 2: To use resolution "nnn" the file etoponnn must exist.
+! Note 3: If "basemap" is given then the current default region will determine
+!         the region to be plotted
+! Note 4: You must pre-define the variable "SIGNGR" to be 1 (north polar plot)
+!	  or -1 (south polar plot) prior to running this script.
+
+
+! check the overlay/basemap option
+query/ignore $3%overlay|overlay>overlay|basemap> <3rd argument of GO polar_fland must be "overlay" or "basemap"%
+
+! test argument validity
+ppl pen 1 $1"201|120>101|60>201|40>301|20>401|5>801|<GO polar_fland [resolution] [palette] res=20,40, or 60"
+
+set data/save
+
+! extract the data ready to plot
+set data etopo$1"60"
+set data/restore
+GO convert_to_polar_2d rose[d=etopo$1"60"] $1"201|120>101|60>201|40>301|20>401|5>801|"  HOLE   polar_fland.dat
+
+! do the overlay
+ppl title; ppl xlab; ppl ylab
+ppl tics 0,0,0,0;ppl axlabp 0,0
+shade/nolab/nokey/lev=(0,10000,10000)/palette=$2"gray"/x=-1:1/y=-1:1$3"/overlay|overlay>/overlay|basemap>/nokey" polar[d=polar_fland.dat]
+
+! clean up
+cancel data polar_fland.dat
+cancel data etopo$1"60"
+ppl tics 0.125,.25,.125,.25; ppl axlabp -1,-1
+set data/restore
+set mode/last verify
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/polar_grid.jnl b/jnls/go/polar_grid.jnl
new file mode 100644
index 0000000..a9d072c
--- /dev/null
+++ b/jnls/go/polar_grid.jnl
@@ -0,0 +1,50 @@
+\cancel mode verify
+! 2/94 - polar_grid.jnl
+  
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction
+
+
+! Description: overlay "quick" radial logitude and curved latitude lines
+
+! A higher quality (but slower) output is available in "polar_grid_fancy.jnl"
+
+! The internal complexities that this routine minimizes are
+!	o discontinuity at +/-180 (also causes trouble at Y=90)
+!	o contour labels that don't overlap the intersecting grid lines
+
+! usage:   GO polar_qgrid
+
+
+message "NOTE: All of the *polar* journal files are superseded by the map projection capabilities of version 5.0.   Run the script  mp_demo  for an introduction."
+
+! use a low resolution grid for speed
+define axis/x=-1:1/npoints=51 x51
+define axis/y=-1:1/npoints=51 y51
+define grid/x=x51/y=y51 g51
+
+! define polar equations for this grid
+GO polar_map_inv_eqns g51
+
+! latitude contour/pen=1s
+contour/pen=1/over/nolab/lev=(-60,60,30,-1)/x=-1:1/y=-1:1 polar_ydeg
+
+! longitude "contour/pen=1s" - need to bypass nasty discontinuity at date line
+let/quiet polar_long = if (175-abs(polar_xdeg180) gt 0) and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180  ! avoid discontinuity
+let/quiet polar_pacific   = if ABS(polar_xdeg180) gt 90 and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180
+let/quiet polar_pac = if polar_pacific lt 0 then 360+polar_pacific else polar_pacific
+
+! all longitudes except 180
+contour/pen=1/over/nolab/lev=(-150,150,30,-1)line(-150,150,30)/x=-1:1/y=-1:1 polar_long
+
+! dateline - must shift discontinuity to Greenwhich
+contour/pen=1/over/nolab/lev=(180,180,1,-1)/x=-1:1/y=-1:1 polar_pac
+
+set mode/last verify
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
+
diff --git a/jnls/go/polar_grid_fancy.jnl b/jnls/go/polar_grid_fancy.jnl
new file mode 100644
index 0000000..ef74ad3
--- /dev/null
+++ b/jnls/go/polar_grid_fancy.jnl
@@ -0,0 +1,101 @@
+\cancel mode verify
+! 2/94 - polar_grid_fancy.jnl
+ 
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction"
+
+
+! Description: overlay "fancy" radial logitude and curved latitude lines
+
+! The internal complexities of this routine are to cope with the following:
+!	o discontinuity at +/-180 (also causes trouble at Y=90)
+!	o contour labels that don't overlap the intersecting grid lines
+!	o color (pen) controls) 
+
+! usage:   GO polar_grid [color] [label_lo_ylimit] [label_hi_ylimit] [overlap] [label_delta_lon] [label_delta_lat]
+!       where
+! color	- may be red, green, blue, thick, or 1-18
+! lo/hi limits 	- the latitude region in which labelling will occur
+!		  default = 32 to 57  (8 and 25 good alt.)
+! overlap	- the amount of overlap between the labelled and unlabelled
+!		  contour segments
+!		  Default = 2 degrees - adjust upward if gaps appear in lines
+! label_delta	- the conset parameter governing the frequency of labels
+!		  Default = 0.0 for lon - adjust upwards if multiple labels appear
+!                 Default = 2.0 for lat -
+!   e.g.   GO polar_grid red        - to use pen color red (2)
+!   e.g.   GO polar_grid 10         - to use pen number 10
+!   e.g.   GO polar_grid  0         - to use pen number 0 (background)
+!   e.g.   GO polar_grid  " " 8 25 - insert labels between 10 and 30 deg lat
+!  use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+! Note: the rotation parameter is inherited from the other polar routines
+
+
+
+! test argument before performing any actions
+ppl pen 1 $1%1|red>1|green>1|blue>1|thick>1|0>1|1>1|2>1|3>1|4>1|5>1|6>1|7>1|8>1|9>1|10>1|11>1|12>1|13>1|14>1|15>1|16>1|17>1|18>1|<GO polar_grid [pen] [fine-controls] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+! set a PLOT+ symbol with the pen color (allows code below to be shorter)
+ppl set pen_color $1"1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+
+! use a low resolution grid for speed
+define axis/x=-1:1/npoints=101 x51
+define axis/y=-1:1/npoints=101 y51
+define grid/x=x51/y=y51 g51
+
+! define polar equations for this grid
+GO polar_map_inv_eqns g51
+
+! latitude contours
+ppl conset 0.10,,,,,,,$6"2.0"    ! big labels
+let/quiet mask = if polar_ydeg lt 0 then 1.
+contour/over/nolab/set/lev=(0,60,30,-1)/x=-1:1/y=-1:1 polar_ydeg; ppl conpre @CR; ppl conpst #N; ppl pen 1 'pen_color'; ppl contour/over
+contour/over/nolab/set/lev=(30,60,30,-1)/x=-1:1/y=-1:1 abs(mask*polar_ydeg); ppl conpre @CR; ppl conpst #S; ppl pen 1 'pen_color'; ppl contour/over
+
+! force labelling into a restricted band
+let/quiet polar_epsilon = $4"2"   ! overlap to avoid gaps between line segments
+let/quiet polar_label_region   = if abs(polar_ydeg) le ($3"57"+polar_epsilon) and signgr*polar_ydeg ge ($2"32"-polar_epsilon) then 1
+let/quiet polar_nolabel_region = if abs(polar_ydeg) ge ($3"57"-polar_epsilon) or abs(polar_ydeg) le ($2"32"+polar_epsilon) then 1
+
+! longitude "contours" - need to bypass nasty discontinuity at date line
+let/quiet polar_long = if (175-abs(polar_xdeg180) gt 0) and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180  ! avoid discontinuity
+let/quiet polar_pacific   = if ABS(polar_xdeg180) gt 90 and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180
+let/quiet polar_pac = if polar_pacific lt 0 then 360+polar_pacific else polar_pacific
+let/quiet polar_lon_nolab = if polar_nolabel_region then polar_long
+let/quiet polar_lon_lab   = if polar_label_region   then polar_long
+let/quiet polar_pac_nolab = if polar_nolabel_region then polar_pac
+let/quiet polar_pac_lab   = if polar_label_region   then polar_pac
+
+! Note: CONSET command forces the drawing of more closely-spaced labels
+!       in this case it forsec them into the desired location
+
+! longitude West
+ppl conpst #W; ppl conset,,,,,,,,$5"0"
+contour/over/nolab/lev=(30,150,30,-3)(90,90,1,-1)line(30,150,30)/set/x=-1:1/y=-1:1 (-1)*polar_lon_lab;   ppl pen 1,'pen_color'; ppl contour/over
+contour/over/nolab/lev=(30,150,30,-3)line(30,150,30)/set/x=-1:1/y=-1:1 (-1)*polar_lon_nolab; ppl pen 1,'pen_color'; ppl contour/over
+
+! longitude East and prime meridian
+ppl conpst #E; ppl conset,,,,,,,,$5"0"; contour/over/nolab/lev=(30,150,30,-3)(90,90,1,-1)line(30,150,30)/set/x=-1:1/y=-1:1 polar_lon_lab;   ppl pen 1,'pen_color'; ppl contour/over
+ppl conset,,,,,,,,0.4; ppl conpst #; ppl lev ()(0,0,1,-1)line(0); ppl contour/over
+ppl conpst #E; ppl conset,,,,,,,,$5"0"; contour/over/nolab/lev=(30,150,30,-3)line(30,150,30)/set/x=-1:1/y=-1:1 polar_lon_nolab; ppl pen 1,'pen_color'; ppl contour/over
+ppl conset,,,,,,,,0.4; ppl conpst #; ppl lev ()(0,0,1,-3)line(0); ppl contour/over
+! dateline - must shift discontinuity to Greenwhich
+ppl conset,,,,,,,,$5"0"
+contour/over/nolab/lev=(180,180,1,-1)/set/x=-1:1/y=-1:1 polar_pac_lab ;   ppl pen 1,'pen_color'; ppl contour/over
+contour/over/nolab/lev=(180,180,1,-3)/set/x=-1:1/y=-1:1 polar_pac_nolab ; ppl pen 1,'pen_color'; ppl contour/over
+
+! clean up
+ppl conpst
+ppl conpre
+ppl conset,,,,,,,,5
+!ppl conset 0.8
+ppl pen 1,1
+
+set mode/last verify
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/polar_land.jnl b/jnls/go/polar_land.jnl
new file mode 100644
index 0000000..cd9f3e9
--- /dev/null
+++ b/jnls/go/polar_land.jnl
@@ -0,0 +1,65 @@
+\cancel mode verify
+! 2/94 - polar_land.jnl
+ 
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction"
+
+
+! Description: overlay the continental outlines on a polar stereographic plot
+
+! usage:   GO polar_land [color] [radius]
+!       where the color argument may be red, green, blue, thick, or 1-18
+!   e.g.   GO polar_land red        - to use pen color red (2)
+!   e.g.   GO polar_land 10         - to use pen number 10
+!   e.g.   GO polar_land  0         - to use pen number 0 (background)
+!       [radius] is the max radius the land will be plotted relative
+!                to the -1:1,-1:1 full hemisphere box.
+!  use  GO line_samples    to view the first 6 pen numbers
+!       Higher pen numbers cycle with thicker lines (max 18)
+! Note: the rotation parameter is inherited from the other polar routines
+
+
+
+! test argument before performing any actions
+ppl pen 1 $1%1|red>1|green>1|blue>1|thick>1|0>1|1>1|2>1|3>1|4>1|5>1|6>1|7>1|8>1|9>1|10>1|11>1|12>1|13>1|14>1|15>1|16>1|17>1|18>1|<GO polar_land "pen" with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+set data/save
+
+! introduce the coastal outline data set
+define axis/x=1:8850:1 axtlandr
+define grid/x=axtlandr gtlandr
+file/col=2/form=unform/var="xland,yland"/grid=gtlandr unf_tlandr.dat
+set variable/bad=1E35 xland
+set variable/bad=1E35 yland
+
+let/quiet deg2rad = 3.141592/180
+let/quiet polar_cosx = cos(xland * deg2rad)
+let/quiet polar_sinx = 0-sin(xland * deg2rad)*signgr
+let/quiet polar_cosy = cos(yland * deg2rad)
+let/quiet polar_siny = sin(yland * deg2rad)*signgr
+let/quiet polar_xpage0 = polar_sinx*polar_cosy/(1+polar_siny)
+let/quiet polar_ypage0 = polar_cosx*polar_cosy/(1+polar_siny)
+
+! rotate to arbitrary angle
+let/quiet polar_sinrot = sin(polar_rotation*deg2rad)
+let/quiet polar_cosrot = cos(polar_rotation*deg2rad)
+!let/quiet polar_xpage = polar_sinrot*polar_xpage0 + polar_cosrot*polar_ypage0
+!let/quiet polar_ypage = polar_sinrot*polar_ypage0 - polar_cosrot*polar_xpage0
+let/quiet polar_xpage = polar_cosrot*polar_xpage0 + signgr*polar_sinrot*polar_ypage0
+let/quiet polar_ypage = polar_cosrot*polar_ypage0 - signgr*polar_sinrot*polar_xpage0
+
+let/quiet mask = if ((polar_xpage*polar_xpage+polar_ypage*polar_ypage)^0.5 le $2"2") then 1.
+
+plot/set/vs/over/nolab/line=1/x=1:8850 mask*polar_xpage,mask*polar_ypage
+ppl pen 1 $1"1|red>2|green>3|blue>4|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|"
+ppl plot/over
+
+cancel data unf_tlandr.dat
+set data/restore
+set mode/last verify
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/polar_map_inv_eqns.jnl b/jnls/go/polar_map_inv_eqns.jnl
new file mode 100644
index 0000000..3967f61
--- /dev/null
+++ b/jnls/go/polar_map_inv_eqns.jnl
@@ -0,0 +1,28 @@
+\cancel mode verify
+! polar_map_inv_eqns.jnl
+! 2/94 - internal routine used for creating inverse polar mappings
+! These equations compute a long/lat point (polar_xdeg,polar_ydeg) given
+! an x,y "page location" in a coordinate system where (0,0) should map
+! to the pole and (-1,0), (+1,0), (0,-1), and (0,+1) map to 90 degree
+! separated points on the equator (longitude influenced by "polar_rotation"
+
+! Description: define the equations used for polar projections
+
+! usage:   GO polar_map_inv_eqns output_grid
+
+!   output grid		- the name of the grid created by projected_map_grid 
+
+! Note:  "polar_rotation" must be defined external to this routine
+
+! test arguments
+query/ignore $1%<Use: GO polar_map_inv_eqns grid%
+
+let/quiet polar_sumsq = x[g=$1]^2 + y[g=$1]^2
+let/quiet polar_xrad = atan2(-1*x[g=$1],y[g=$1])*signgr
+let/quiet polar_yrad = asin( (1-polar_sumsq)/(1+polar_sumsq) )*signgr
+let/quiet rad2deg = 180 / 3.14159
+let/quiet polar_xdeg180 = MOD(rad2deg*polar_xrad+polar_rotation+180+360, 360) - 180
+let/quiet polar_xdeg = (polar_xdeg180 + 360)      ! all positive
+let/quiet polar_ydeg = rad2deg * polar_yrad
+
+set mode/last verify
diff --git a/jnls/go/polar_vector.jnl b/jnls/go/polar_vector.jnl
new file mode 100644
index 0000000..05395ee
--- /dev/null
+++ b/jnls/go/polar_vector.jnl
@@ -0,0 +1,76 @@
+\cancel mode verify
+! 2/94 - polar_vector.jnl
+! 3/96 - bug fix: vectors in South projection were mis-oriented
+ 
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction"
+
+
+! Description: produce a 2D polar stereographic vector plot
+
+! usage:  GO polar_vector uvar vvar [vector_command] [rotation] [#_points] [limit] [fill] [pole]
+
+! uvar:			U vector component (variable or expression)
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! vvar:			V vector component (variable or expression)
+!			Must include explicit qualifiers with region
+!			encompassing the area to be plotted 
+! vector_command:	The full "VECTOR" command including qualifiers
+!			(see note below)
+! (optional) rotation:	rotation of projected plot.  Zero [default] means
+!			prime meridian centered in lower half of plot
+!			Use rotation = 105 for FNOC and NMC plots
+! (optional) #_points:	number of points on X and Y axes of the final
+!			plot (essentially, the resolution of the plot)
+!			Use #_points=63 for FNOC grid, #_points=65 for NMC
+! (optional)  limit:	fraction of full region that will be displayed
+!			Default = 1 (full region).  e.g. 0.5 will display
+!			only the -.5 to .5 region from the full plot
+! (optional) fill:	Either FILL or HOLE(default) to indicate how points
+!			bordering on missing values should be treated
+! (optional) pole:      pole, +1 is north pole (default), -1 is south pole.
+
+! Note on vector command qualifiers:
+!  /OVERLAY works fine
+!  /SET_UP requires manual setting and resetting of PPL tics and axlabp
+!  /X/Y/Z/T/I/J/K/L qualifiers will refer to the OUTPUT (page layout) grid
+!	not to the input (lat/long) grid		
+
+
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO polar_2d_plot plot_command Uvar Vvar [angle] [#] [limit] ["FILL"]%
+query/ignore $2%<Use: GO polar_2d_plot plot_command Uvar Vvar [angle] [#] [limit] ["FILL"]%
+query/ignore $3%<Use: GO polar_2d_plot plot_command Uvar Vvar [angle] [#] [limit] ["FILL"]%
+
+! extract the vector data ready to plot
+let/quiet polar_rotation=$4"0"
+let/quiet signgr = if ($8"1.0") ge 0.0 then 1.0 else (-1.0)
+
+GO convert_to_polar_2d $2 $5"201" $7"HOLE" polar_U_points.dat
+GO convert_to_polar_2d $3 $5"201" $7"HOLE" polar_V_points.dat
+
+! set up PLOT+ without axis tics
+ppl tics 0,0,0,0
+ppl axlabp 0,0
+
+! rotate the vector components for the polar projection
+! (south direction corrected with signgr 3/96)
+let/quiet polar_vec_sumsq = (-1*signgr) / (x[g=gproj$5"201"]^2 + y[g=gproj$5"201"]^2)^0.5
+let/quiet polar_u = (x*polar[d=polar_V_points.dat] + y*polar[d=polar_U_points.dat]) * polar_vec_sumsq
+let/quiet polar_v = (y*polar[d=polar_V_points.dat] - x*polar[d=polar_U_points.dat]) * polar_vec_sumsq
+
+! produce the plot (box_plot to avoid axis decorations)
+GO box_plot $1/x=-$6"1":$6"1"/y=-$6"1":$6"1" polar_u, polar_v
+
+! coach the user on how to make quick replots
+MESSAGE/Cont "The following vector command can be modified and reused:"
+MESSAGE/Cont >>>GO box_plot $1/x=-$6"1":$6"1"/y=-$6"1":$6"1" polar_u, polar_v
+
+set mode/last verify
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/polar_vs.jnl b/jnls/go/polar_vs.jnl
new file mode 100644
index 0000000..7712027
--- /dev/null
+++ b/jnls/go/polar_vs.jnl
@@ -0,0 +1,61 @@
+\cancel mode verify
+! 2/94 - polar_vs.jnl
+ 
+
+! NOTE: The map projection capabilities beginning with Ferret v5.0
+! provide far more flexibility for making plots with curvilinear coordinates.
+! Run the script  mp_demo  for an introduction
+ 
+
+! Description: perform a polar PLOT/VS of 2 variables: lat long
+
+! usage:   GO polar_vs plot_command lats longs
+
+! plot_command:		"PLOT" with its qualifiers (see note below)
+!
+! lats:			array of latitudes in degrees
+!			(must be same number of points as "longs") 
+! longs:		array of longitudes in degrees
+!			(must be same number of points as "lats") 
+
+!   e.g.   GO polar_vs PLOT/VS/OVERLAY lat long red
+
+! Note on plot command qualifiers:
+!  /OVERLAY works fine
+!  /SET_UP requires manual setting and resetting of PPL tics and axlabp
+!  /X/Y/Z/T/I/J/K/L qualifiers work fine
+!  /LINE and /SYMBOL qualifiers work fine
+
+! Note: the rotation parameter is inherited from the other polar routines
+! Use    LET polar_rotation="value"   to use this routine apart from the others
+
+
+
+! check that parameters are OK to the best we can
+query/ignore $1%<Use: GO polar_vs plot_command lats longs [color]%
+query/ignore $2%<Use: GO polar_vs plot_command lats longs [color]%
+query/ignore $3%<Use: GO polar_vs plot_command lats longs [color]%
+
+let/quiet deg2rad = 3.141592/180
+let/quiet polar_cosx = cos($2 * deg2rad)
+let/quiet polar_sinx = 0-sin($2 * deg2rad)*signgr
+let/quiet polar_cosy = cos($3 * deg2rad)
+let/quiet polar_siny = sin($3 * deg2rad)*signgr
+let/quiet polar_xpage0 = polar_sinx*polar_cosy/(1+polar_siny)
+let/quiet polar_ypage0 = polar_cosx*polar_cosy/(1+polar_siny)
+
+! rotate to arbitrary angle
+let/quiet polar_sinrot = sin(polar_rotation*deg2rad)
+let/quiet polar_cosrot = cos(polar_rotation*deg2rad)
+!let/quiet polar_xpage = polar_sinrot*polar_xpage0 + polar_cosrot*polar_ypage0
+!let/quiet polar_ypage = polar_sinrot*polar_ypage0 - polar_cosrot*polar_xpage0
+let/quiet polar_xpage = polar_cosrot*polar_xpage0 + signgr*polar_sinrot*polar_ypage0
+let/quiet polar_ypage = polar_cosrot*polar_ypage0 - signgr*polar_sinrot*polar_xpage0
+
+GO box_plot $1/vs polar_xpage,polar_ypage
+
+set mode/last verify
+
+message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
+message/continue "provide far more flexibility for plots with curvilinear coordinates."
+message/continue "Run the script  mp_demo  for an introduction"
diff --git a/jnls/go/poly_arrow_key.jnl b/jnls/go/poly_arrow_key.jnl
new file mode 100644
index 0000000..86c215f
--- /dev/null
+++ b/jnls/go/poly_arrow_key.jnl
@@ -0,0 +1,82 @@
+\cancel mode verify	
+
+! Label a Vector plot produced using a call to poly_vectors or mp_poly_vectors
+
+! ARGUMENTS:
+
+! 1 vector label, e.g. UWND,VWND
+! 2 vector scale, units per half inch
+! 3 key color, default black
+! 4 LINE to outline the key
+! 5 xpos - inches from left of page, or C to center  	(default lower left)
+! 6 ypos - inches from bottom of page, or C to center	(default lower left)
+! 7 size - label text size in inches 		(default 0.12)
+
+! EXAMPLES (see poly_vec_demo.jnl for full examples)
+
+! GO poly_arrow_key " ", "5"   ! single black arrow labelled 5 in lower left
+! GO poly_arrow_key "Wind", "4 m/s", red, line, c, 0.2
+
+! check arguments
+QUERY/IGNORE $2"<usage: yes? GO mp_vec_key [label] [units per half inch]"
+
+def sym keytitle = $1%.%
+let keytitle_exists $1"0|*>1"
+def sym keyscale = "$2"
+
+let keypalette = "$3%black%"
+let lineit = $4"0|line>1|LINE>1"
+
+! standard half-inch polygon arrow
+
+let x_std_arrow = (0.5 - vect_inch_add)*vect_inch_mul
+let y_std_arrow = y_arrow_inch1
+
+! Scale length of the arrow polygon, to half inch in plot units
+
+let xsc = (($xaxis_max) - ($xaxis_min))/ ($ppl$xlen)
+let ysc = (($yaxis_max) - ($yaxis_min))/ ($ppl$ylen)
+
+def sym xcent = "$5%0%"
+if `($xcent) eq "c"` then
+  let xloc = (($xaxis_max) + ($xaxis_min))/2
+else
+  let xloc = $5%-1%
+  if `xloc LT 0` then  ! Default positions
+    let xloc = ($xaxis_min) + .4*xsc
+    let xloc = ($xaxis_min) 
+  else
+    let xloc = $5 * xsc + ($xaxis_min) - ($ppl$xorg) * xsc
+  endif
+endif
+
+def sym ycent = "$6%0%"
+if `($ycent) eq "c"` then
+  let yloc = (($yaxis_max) + ($yaxis_min))/2
+else
+  let yloc = $6%-1%
+  if `yloc LT 0` then
+    let yloc = ($yaxis_min) - ysc
+  else
+    let yloc = $6 * ysc + ($yaxis_min)  - ($ppl$yorg) * ysc
+  endif
+endif
+
+let labsize = $7%0.12%
+let yoff = (labsize/4)* ysc
+
+ppl window off
+IF `LINEIT EQ 1` THEN
+   poly/over/noax/LINE/pal=`keypalette`/nolab `xsc`*x_std_arrow + `xloc`,\
+    `ysc`*y_std_arrow + `yloc`, 1
+ELSE
+   poly/over/noax/pal=`keypalette`/nolab `xsc`*x_std_arrow + `xloc`,\
+    `ysc`*y_std_arrow + `yloc`, 1
+ENDIF
+
+if `keytitle_exists EQ 1` THEN label `xloc-.1*xsc`, `yloc-yoff`, 1, 0, `labsize`, ($keytitle)
+
+label `xloc+0.6*xsc`, `yloc-yoff`, -1, 0, `labsize`, ($keyscale)
+
+ppl window on
+set mode/last verify
diff --git a/jnls/go/poly_vectors.jnl b/jnls/go/poly_vectors.jnl
new file mode 100644
index 0000000..4750749
--- /dev/null
+++ b/jnls/go/poly_vectors.jnl
@@ -0,0 +1,146 @@
+\cancel mode verify
+! poly_vectors:  Sets up the drawing of a sequence of color-filled vectors
+! scattered on plot with Cartesian coordinates
+
+! Programmed by E. D. Cokelet, NOAA/PMEL, 11 Feb 2003
+! Last modified 6 Mar 2003
+
+! Usage: (for examples, run poly_vec_demo.jnl)
+
+! go poly_vectors x_vect y_vect u_comp v_comp vector_scale "arrow"
+! polygon/over/nolabel/key/pal=rainbow/line plt_x_arrow, plt_y_arrow, my_values[j=1:`num_vectors`]
+
+! with inputs:
+!       x_vect = sequence of x coordinates of vector tails
+!       y_vect = sequence of y coordinates of vector tails
+!       u_comp = sequence of x-ward  components of vectors
+!       v_comp = sequence of y-ward components of vectors
+!       vector_scale = vector length in user units (e.g. cm/s) corresponding to
+!                      a half-inch-long vector
+!       "arrow" or "stick" = with or without arrow heads
+
+! and with outputs:
+!       num_vectors = number of vector arrow polygons to plot
+!       plt_x_arrow = (7 x num_vectors) x-y array whose x-values are the
+!                    x-components of the vector arrow polygons on the plot.
+!                    The y-values are counters, one for each vector.   
+!       plt_y_arrow = (7 x num_vectors) x-y array whose x-values are the
+!                    y-components of the vector arrow polygons on the plot.
+
+! and where: 
+!       my_values = An input y array of num_vectors values corresponding to the
+!                   color-fill levels of the vectors.
+
+! Note 1:  A plot in Cartesian coordinates must have been drawn using Ferret
+!          before calling vectors.
+! Note 2:  Any polygon command can be used to plot the vectors.
+
+
+define region/default save
+cancel region
+
+set data/save
+
+
+! Place vector positions and components on a y axis
+
+let vect_tail_x1 = ysequence( $1 )      ! Sequence on abstract axis
+let vect_tail_y1 = ysequence( $2 )      ! Sequence on abstract axis
+let vect_x_comp1 = ysequence( $3 )      ! Sequence on abstract axis
+let vect_y_comp1 = ysequence( $4 )      ! Sequence on abstract axis
+
+let mag_per_inch = `$5 * 2`
+
+let arrowhead_draw = $6"|arrow>0|stick>1|<You must specify arrow or stick."
+
+let num_vectors = vect_x_comp1[j=@ngd] + vect_x_comp1[j=@nbd]
+
+define axis/y=1:`num_vectors`:1 y_vect_cnt
+define grid/y=y_vect_cnt vect_cnt_grd
+
+let vect_tail_x = vect_tail_x1[g=vect_cnt_grd at asn]
+let vect_tail_y = vect_tail_y1[g=vect_cnt_grd at asn]
+let vect_x_comp = vect_x_comp1[g=vect_cnt_grd at asn]
+let vect_y_comp = vect_y_comp1[g=vect_cnt_grd at asn]
+
+
+! Compute the plot scaling. 
+
+let plt_x_inch_span = `($PPL$XLEN)` + 0*x[g=poly_vert_grd]
+let plt_y_inch_span = `($PPL$YLEN)` + 0*x[g=poly_vert_grd]
+
+let plt_x_user_span = `($xaxis_max)` - `($xaxis_min)` + 0*x[g=poly_vert_grd]
+let plt_y_user_span = `($yaxis_max)` - `($yaxis_min)` + 0*x[g=poly_vert_grd]
+
+let plt_x_per_inch = plt_x_user_span/plt_x_inch_span
+let plt_y_per_inch = plt_y_user_span/plt_y_inch_span
+
+
+! Compute the vector direction on the plot
+
+let pi = 4*atan(1)
+let vect_dir = atan2( vect_y_comp/plt_y_per_inch, vect_x_comp/plt_x_per_inch)
+
+
+! Compute the arrow lengths in inches as they lay along the x-axis with 
+! tails at the origin.
+! For each y, polygon vertices are functions of x. 
+
+define axis/x=1:7:1 x_poly_vert
+define grid/x=x_poly_vert poly_vert_grd
+
+let vect_mag = (vect_x_comp^2 + vect_y_comp^2)^0.5
+let vect_inch = vect_mag / mag_per_inch
+
+! arrow head length (inches)
+let arrow_hd_ln = if (arrowhead_draw eq 0) then 0.15 else 0   
+ 
+! arrow head half-width (inches)
+let arrow_hd_half_wd = if (arrowhead_draw eq 0) then 0.05 else 0  
+
+let arrow_shft_half_thk = 0.01  ! arrow shaft half-thickness (inches)
+
+let vect_inch_add = {0, `arrow_hd_ln`, `arrow_hd_ln`, 0, \
+`arrow_hd_ln`,`arrow_hd_ln`, 0} + 0*x[g=poly_vert_grd]
+
+let vect_inch_mul = {0,   1,   1, 1,   1,   1, 0} + 0*x[g=poly_vert_grd]
+
+let x_arrow_inch0 = (vect_inch - vect_inch_add)*vect_inch_mul
+
+!Truncate arrow heads of short vectors
+let x_arrow_inch1 = if (x_arrow_inch0 lt 0) then 0 else x_arrow_inch0   
+
+let y_arrow_inch1 = {-`arrow_shft_half_thk`, -`arrow_shft_half_thk`, \
+-`arrow_hd_half_wd`, 0.00, `arrow_hd_half_wd`, `arrow_shft_half_thk`, \
+`arrow_shft_half_thk`} + 0*x[g=poly_vert_grd]
+
+
+! Rotate the arrows to their proper direction on the plot
+
+let x_arrow_inch2 = (x_arrow_inch1*cos(vect_dir) - y_arrow_inch1*sin(vect_dir))
+let y_arrow_inch2 = (y_arrow_inch1*cos(vect_dir) + x_arrow_inch1*sin(vect_dir))
+
+
+! Compute the arrow lengths in plot units
+
+let x_arrow_plot = x_arrow_inch2*plt_x_per_inch
+let y_arrow_plot = y_arrow_inch2*plt_y_per_inch
+
+
+! Displace the arrow tails in plot units
+
+let plt_x_arrow = ( vect_tail_x + x_arrow_plot )
+let plt_y_arrow = ( vect_tail_y + y_arrow_plot )
+
+
+! Clean up
+
+set data/restore
+
+say
+say *** POLY_VECTORS: Issue commands such as follow to plot the vectors ***
+say *** POLYGON/OVER/NOLABEL/KEY/NOAXES/LINE PLT_X_ARROW, PLT_Y_ARROW, MY_VALUES[J=1:`NUM_VECTORS`] ***
+say *** SET REGION SAVE ***
+say
+
+set mode/last verify
diff --git a/jnls/go/polymark.jnl b/jnls/go/polymark.jnl
new file mode 100644
index 0000000..21df7fd
--- /dev/null
+++ b/jnls/go/polymark.jnl
@@ -0,0 +1,77 @@
+\cancel mode verify
+! polymark.jnl
+! 4/99 *sh* and *jd*
+! 10/00 *sh* bug fix to scaling algorithm
+!  3/04 *acm* bug fix in check for point data
+
+! Description: Plot symbols colored by values of a variable along a track
+!
+!              Needs a basemap or other underlying plot to define scaling
+!              parameters.
+
+! Usage:                  $1        $2    $3     $4      $5      $6
+! Yes?	GO polymark polygon_command xpts ypts [values] [shape] [scale]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track 
+! $3 - Y coordinates of track 
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - shape of the symbol, as defined by polyshape.jnl 
+! $6 - scale the symbol size by this factor (optional, default 1)
+
+!      shape names include:
+!           triangle           delta           square
+!           diamond            pentagon        hexagon
+!           circle             star            plus
+!           ex
+
+! examples
+!       GO polymark polygon/over/key lon lat sst diamond
+
+! In detail, set cruise track and plot on a map:
+!       yes? LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+!       yes? LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+!       yes? LET sst = 25 - ypts + RANDN(ypts)
+
+!       yes? GO basemap x=120:250 Y=25s:65n 20
+!
+!       yes? GO polymark polygon/over/key/title="SST"  xpts,ypts,sst,ex, 0.5 
+
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $2"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $3"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET PLMxpoly = ($2)
+LET/QUIET PLMypoly = ($3)
+LET/QUIET PLMpolydata = $4"0"
+
+! determine the orientation of the data (and check that it is 1D or a point)
+DEFINE SYMBOL PLMax `PLMxpoly,return=shape`
+DEFINE SYMBOL PLMpoly_ax ($PLMax"|POINT>Z|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a point or line")
+
+! units/inch scale factors
+LET/QUIET PLMdefault_scale =$6"1" *  0.1
+LET/QUIET PLMx_correction = PLMdefault_scale*((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET PLMy_correction = PLMdefault_scale*((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+
+! optionally create the polygon coordinates, xpolyshape, ypolyshape
+! else check that the coordinates exist
+IF $5"0|*>1" THEN
+   GO polyshape $5
+ELSE
+   LOAD xpolyshape, ypolyshape  ! THESE MUST BE DEFINED BY GO polyshape
+ENDIF
+
+! make sure that the polygon coordinates are along the correct axis
+! and correct the coordinates for unequal axis scaling and user scale factor 
+LET/QUIET PLMxpolymark = ($PLMpoly_ax)SEQUENCE(xpolyshape) * PLMx_correction
+LET/QUIET PLMypolymark = ($PLMpoly_ax)SEQUENCE(ypolyshape) * PLMy_correction
+
+$1/coord_ax=($PLMpoly_ax)  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+
+cancel symbol PLM*
+cancel variable PLM*
+set mode/last verify
+
diff --git a/jnls/go/polymark_annotate_key.jnl b/jnls/go/polymark_annotate_key.jnl
new file mode 100644
index 0000000..41d1808
--- /dev/null
+++ b/jnls/go/polymark_annotate_key.jnl
@@ -0,0 +1,79 @@
+\cancel mode verify
+! polymark.jnl
+! 4/99 *sh* and *jd*
+! 10/00 *sh* bug fix to scaling algorithm
+!  3/04 *acm* bug fix in check for point data
+
+! Description: Plot symbols colored by values of a variable along a track
+!
+!              Needs a basemap or other underlying plot to define scaling
+!              parameters.
+
+! Usage:                  $1        $2    $3     $4      $5      $6
+! Yes?	GO polymark polygon_command xpts ypts [values] [shape] [scale]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track 
+! $3 - Y coordinates of track 
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - shape of the symbol, as defined by polyshape.jnl 
+! $6 - scale the symbol size by this factor (optional, default 1)
+
+!      shape names include:
+!           triangle           delta           square
+!           diamond            pentagon        hexagon
+!           circle             star            plus
+!           ex
+
+! examples
+!       GO polymark polygon/over/key lon lat sst diamond
+
+! In detail, set cruise track and plot on a map:
+!       yes? LET xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+!       yes? LET ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+!       yes? LET sst = 25 - ypts + RANDN(ypts)
+
+!       yes? GO basemap x=120:250 Y=25s:65n 20
+!
+!       yes? GO polymark polygon/over/key/title="SST"  xpts,ypts,sst,ex, 0.5 
+
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $2"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+QUERY/IGNORE $3"<usage: yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET PLMxpoly = ($2)
+LET/QUIET PLMypoly = ($3)
+LET/QUIET PLMpolydata = $4"0"
+
+! determine the orientation of the data (and check that it is 1D or a point)
+DEFINE SYMBOL PLMax `PLMxpoly,return=shape`
+DEFINE SYMBOL PLMpoly_ax ($PLMax"|POINT>Z|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a point or line")
+
+! units/inch scale factors
+LET/QUIET PLMdefault_scale =$6"1" *  0.1
+LET/QUIET PLMx_correction = PLMdefault_scale*((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET PLMy_correction = PLMdefault_scale*((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+
+! optionally create the polygon coordinates, xpolyshape, ypolyshape
+! else check that the coordinates exist
+IF $5"0|*>1" THEN
+   GO polyshape $5
+ELSE
+   LOAD xpolyshape, ypolyshape  ! THESE MUST BE DEFINED BY GO polyshape
+ENDIF
+
+! make sure that the polygon coordinates are along the correct axis
+! and correct the coordinates for unequal axis scaling and user scale factor 
+LET/QUIET PLMxpolymark = ($PLMpoly_ax)SEQUENCE(xpolyshape) * PLMx_correction
+LET/QUIET PLMypolymark = ($PLMpoly_ax)SEQUENCE(ypolyshape) * PLMy_correction
+
+$1/coord_ax=($PLMpoly_ax)/set  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+PPL SHAKEY 1,,,,,,,,,,1 
+ppl fillpol
+
+cancel symbol PLM*
+cancel variable PLM*
+set mode/last verify
+
diff --git a/jnls/go/polymark_datekey.jnl b/jnls/go/polymark_datekey.jnl
new file mode 100644
index 0000000..57267c4
--- /dev/null
+++ b/jnls/go/polymark_datekey.jnl
@@ -0,0 +1,210 @@
+\cancel mode verify
+! polymark_datekey.jnl
+! 11/05 ACM 
+
+! Description: Plot symbols colored by values of a variable along a track
+!              and labelled with dates from a time axis
+!
+!              Needs a basemap or other underlying plot to define scaling
+!              parameters.
+
+! Usage:                    $1              $2   $3    $4       $5      $6     $7
+! Yes?	GO polymark_datekey polygon_command xpts ypts [values] [shape] [scale] timevar
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track 
+! $3 - Y coordinates of track 
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - shape of the symbol, as defined by polyshape.jnl 
+! $6 - scale the values by this factor (optional, default 1)
+! $7 - variable on the time axis to use for labelling the key
+! $8 - hr, min, or sec to add :hh or hh:mm or hh:mm:ss
+
+!      shape names include:
+!           triangle           delta           square
+!           diamond            pentagon        hexagon
+!           circle             star            plus
+!           ex
+
+! examples
+!       GO polymark_datekey polygon/over/key lon lat sst diamond " " tax
+
+! In detail, set cruise track as a time series and plot on a map: 
+!       yes? !  The key labels need more space on the right, so define 
+!       yes? !  a viewport leaving amargin on the right
+!
+!       yes? def view/x=0:0.8/y=0:1 xview
+!       yes? set view xview
+!
+!       yes? def axis/t=1-jan-1990:1-mar-1990:1/units=days timeax
+!       yes? LET lpts = L[gt=timeax]
+!       yes? LET xpts = 180 + 50*COS(2*3.14*lpts/60)
+!       yes? LET ypts = 15 + 20*sin(2*3.14*lpts/60)
+!       yes? LET taxvar = t[gt=timeax]
+!
+!       yes? GO basemap x=120:250 Y=25s:65n 20
+!       yes? GO polymark_datekey polygon/over/key  xpts,ypts,lpts,ex,0.5,taxvar
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polymark_datekey polygon_command xpts ypts [values] [shape] [scale] timevar"
+QUERY/IGNORE $2"<usage: yes? GO polymark_datekey polygon_command xpts ypts [values] [shape] [scale] timevar"
+QUERY/IGNORE $3"<usage: yes? GO polymark_datekey polygon_command xpts ypts [values] [shape] [scale] timevar"
+QUERY/IGNORE $7"<usage: yes? GO polymark_datekey polygon_command xpts ypts [values] [shape] [scale] timevar"
+
+! save the input expressions into simple variable definitions
+LET/QUIET PLMxpoly = ($2)
+LET/QUIET PLMypoly = ($3)
+LET/QUIET PLMpolydata = $4"0"
+
+LET tpts = $7
+LET/QUIET PLMlabel = $8"0|hr>1|min>2|sec>3|*>0"
+
+! determine the orientation of the data (and check that it is 1D or a point)
+DEFINE SYMBOL PLMax `PLMxpoly,return=shape`
+DEFINE SYMBOL PLMpoly_ax ($PLMax"|POINT>Z|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a point or line")
+
+! units/inch scale factors
+LET/QUIET PLMdefault_scale =$6"1" *  0.1
+LET/QUIET PLMx_correction = PLMdefault_scale*((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET PLMy_correction = PLMdefault_scale*((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+
+! optionally create the polygon coordinates, xpolyshape, ypolyshape
+! else check that the coordinates exist
+IF $5"0|*>1" THEN
+   GO polyshape $5
+ELSE
+   LOAD xpolyshape, ypolyshape  ! THESE MUST BE DEFINED BY GO polyshape
+ENDIF
+
+! make sure that the polygon coordinates are along the correct axis
+! and correct the coordinates for unequal axis scaling and user scale factor 
+LET/QUIET PLMxpolymark = ($PLMpoly_ax)SEQUENCE(xpolyshape) * PLMx_correction
+LET/QUIET PLMypolymark = ($PLMpoly_ax)SEQUENCE(ypolyshape) * PLMy_correction
+
+$1/coord_ax=($PLMpoly_ax)/set  PLMxpoly+PLMxpolymark, PLMypoly+PLMypolymark, PLMpolydata
+ppl shakey 1,1,0.0000001,100
+ppl fillpol/over
+
+
+! set up the date/time labels for the color key
+! (see insitu_setup.jnl)
+
+LET TLAB_tstart = `$7[L=@min]`
+DEFINE SYMBOL TLAB_tstart = `TLAB_tstart`
+
+LET TLAB_tend = `$7[L=@max]`
+DEFINE SYMBOL TLAB_tend = `TLAB_tend`
+
+LET TLAB_tstep = int((`TLAB_tend`-`TLAB_tstart`)/4)
+DEFINE SYMBOL TLAB_tstep = `TLAB_tstep`
+
+LET dates_same = 0
+
+LET ttime = `($TLAB_tstart)+0*($TLAB_tstep)`
+DEFINE SYMBOL day_0_fourth = `TAX_DATESTRING(ttime, tpts, "day")`
+
+LET ttime = `($TLAB_tstart)+1*($TLAB_tstep)`
+DEFINE SYMBOL day_1_fourth = `TAX_DATESTRING(ttime, tpts, "day")`
+IF `STRCMP("($day_1_fourth)", "($day_0_fourth)") EQ 0` THEN LET dates_same = 1
+
+LET ttime = `($TLAB_tstart)+2*($TLAB_tstep)`
+LET ttime_last = `ttime`
+DEFINE SYMBOL day_2_fourth = `TAX_DATESTRING(ttime, tpts, "day")`
+IF `STRCMP("($day_2_fourth)", "($day_1_fourth)") EQ 0` THEN LET dates_same = 1
+
+LET ttime = `($TLAB_tstart)+3*($TLAB_tstep)`
+LET ttime_last = `ttime`
+DEFINE SYMBOL day_3_fourth = `TAX_DATESTRING(ttime, tpts, "day")`
+IF `STRCMP("($day_3_fourth)", "($day_2_fourth)") EQ 0` THEN LET dates_same = 1
+
+! The last section may be degenerate depending on the 
+! underlying time axis. Force it not to be, within
+! single-precision time coordinates
+
+LET ttime = `($TLAB_tstart)+4*($TLAB_tstep)`
+IF `ttime LE ttime_last` THEN 
+   LET ttime =  = `(1. - 1.e-5)* ($TLAB_tend) - 1`
+ENDIF 
+DEFINE SYMBOL day_4_fourth = `TAX_DATESTRING(ttime, tpts, "day")`
+IF `STRCMP("($day_4_fourth)", "($day_3_fourth)") EQ 0` THEN LET dates_same = 1
+
+! --------
+! If some of the date symbols were repeated, add hours:minutes on a
+! second line under the lables.
+
+IF `dates_same GT 0` THEN
+   IF `PLMlabel LT 2` THEN LET PLMlabel = 2
+
+   LET ttime = `($TLAB_tstart)+0*($TLAB_tstep)`
+   let dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+   IF `PLMlabel GT 0` THEN
+      GO pdatekey_dms
+      DEFINE SYMBOL day_0_fourth = ($day_0_fourth)($dms)
+   ENDIF
+   
+   LET ttime = `($TLAB_tstart)+1*($TLAB_tstep)`
+   let dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+   IF `PLMlabel GT 0` THEN
+      GO pdatekey_dms
+      DEFINE SYMBOL day_1_fourth = ($day_1_fourth)($dms)
+   ENDIF
+   
+   LET ttime = `($TLAB_tstart)+2*($TLAB_tstep)`
+   let dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+   IF `PLMlabel GT 0` THEN
+      GO pdatekey_dms
+      DEFINE SYMBOL day_2_fourth = ($day_2_fourth)($dms)
+   ENDIF
+   
+   LET ttime = `($TLAB_tstart)+3*($TLAB_tstep)`
+   let dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+   IF `PLMlabel GT 0` THEN
+      GO pdatekey_dms
+      DEFINE SYMBOL day_3_fourth = ($day_3_fourth)($dms)
+   ENDIF
+   
+   ! The last section may be degenerate depending on the 
+   ! underlying time axis. Force it not to be, within
+   ! single-precision time coordinates
+   
+   LET ttime = `($TLAB_tstart)+4*($TLAB_tstep)`
+   IF `ttime LE ttime_last` THEN 
+      LET ttime =  = `(1. - 1.e-5)* ($TLAB_tend) - 1`
+   ENDIF 
+   LET dayfrac = `TAX_DAYFRAC(ttime, tpts)`
+   IF `PLMlabel GT 0` THEN
+      GO pdatekey_dms
+      DEFINE SYMBOL day_4_fourth = ($day_4_fourth)($dms)
+   ENDIF
+
+ENDIF
+
+! --------
+
+! Based on what key.F does to define the upper x corner of the colorbar key.
+! If we are in a viewport, start with vp_width
+! 10/2011 change size of labels to 0.1
+
+LET vwid = (($ppl$xlen) + ($ppl$xorg)) * 1.15
+IF ($vp_width"0|*>1") THEN let vwid = ($vp_width)
+
+LET rem = vwid - (($ppl$xlen) + ($ppl$xorg))
+LET xmaxx = 0.25*($ppl$xlen)
+LET key_hi = MIN (`($ppl$xorg) + ($ppl$xlen) + xmaxx`,`vwid-0.051*rem`)
+
+LET key_lo = (($ppl$xorg) + ($ppl$xlen) + 0.25*MIN (rem,xmaxx))
+LET key_lo = (($ppl$xlen) + 0.25*MIN (rem,xmaxx))
+LET key_inc = `0.1 * (key_hi - key_lo)`
+
+LET key_hi = `key_lo + 4.0*key_inc`
+LET key_hi = `key_lo + 2.0*key_inc`
+
+label/nouser `key_hi`,`(($ppl$ylen)*0)/4-.05`,-1,0,.10,($day_0_fourth)
+label/nouser `key_hi`,`(($ppl$ylen)*1)/4-.05`,-1,0,.10,($day_1_fourth)
+label/nouser `key_hi`,`(($ppl$ylen)*2)/4-.05`,-1,0,.10,($day_2_fourth)
+label/nouser `key_hi`,`(($ppl$ylen)*3)/4-.05`,-1,0,.10,($day_3_fourth)
+label/nouser `key_hi`,`(($ppl$ylen)*4)/4-.05`,-1,0,.10,($day_4_fourth)
+
+cancel symbol PLM*
+cancel variable PLM*
+set mode/last verify
+
diff --git a/jnls/go/polyshape.jnl b/jnls/go/polyshape.jnl
new file mode 100644
index 0000000..b351d64
--- /dev/null
+++ b/jnls/go/polyshape.jnl
@@ -0,0 +1,220 @@
+\cancel mode verify
+! polyshape.jnl
+! *4/99 *sh* and *jd*
+!  7/01 *acm* update /xlimits and /ylimits to /hlimits and /vlimits
+!  7/01 *acm* add rectangle and tallbox
+!  8/01 *acm* add hletter and lletter for marking highs and lows
+!  2/09 *acm* add bslash and hslash, and variations on some previous shapes
+!             trianglec and deltac are centered vertically
+!             exc is smaller, as are rectanglec and tallboxc.
+
+! Description: define xpolyshape, ypolyshape variables for polygon fills
+
+!   usage:
+!	GO polyshape shape_name
+
+! shape names include:
+!    triangle		delta		square
+!    diamond		pentagon	hexagon
+!    circle		star		plus
+!    ex			rectangle	tallbox
+!    hletter            lletter
+!    trianglec		deltac		exc
+!    rectanglec		tallboxc	fslash
+!    bslash		tletter		tupside
+!    tleft		tright		vright
+!    vleft		rtriangle	ltriangle
+!    uright		uleft
+
+! example:
+!	yes? GO polyshape star 2   ! define double-sized star
+
+! check shape name
+
+query/ignore $1"|triangle|delta|square|diamond|pentagon|hexagon|circle\
+|star|plus|ex|rectangle|tallbox|hletter|lletter|fslash|bslash|trianglec\
+|deltac|exc|rectanglec|tallboxc|tletter|tupside|tleft|tright|vright\
+|vleft|rtriangle|ltriangle|uright|uleft"
+
+IF $1"|triangle>1|*>0|" THEN
+  LET/QUIET xpolyshape = COS(3.14159/180 * X[X=90:`2*120+90`:120])
+  LET/QUIET ypolyshape = SIN(3.14159/180 * X[X=90:`2*120+90`:120])
+ENDIF
+
+IF $1"|delta>1|*>0|" THEN
+  LET/QUIET xpolyshape = COS(3.14159/180 * X[X=30:`2*120+30`:120])
+  LET/QUIET ypolyshape = SIN(3.14159/180 * X[X=30:`2*120+30`:120])
+ENDIF
+
+IF $1"|square>1|*>0|" THEN
+  LET/QUIET xpolyshape = COS(3.14159/180 * X[X=45:`3*90+45`:90])
+  LET/QUIET ypolyshape = SIN(3.14159/180 * X[X=45:`3*90+45`:90])
+  LET/QUIET xpolyshape = {0.8, -0.8, -0.8,  0.8}
+  LET/QUIET ypolyshape = {0.8,  0.8, -0.8, -0.8}
+ENDIF
+
+IF $1"|diamond>1|*>0|" THEN
+  LET/QUIET xpolyshape =  {0.8, 0.0, -0.8,  0.0}
+  LET/QUIET ypolyshape =  {0.0, 0.8,  0.0, -0.8}
+ENDIF
+
+IF $1"|pentagon>1|*>0|" THEN
+  LET/QUIET xpolyshape = 0.9 * COS(3.14159/180 * X[X=90:`4*72+90`:72])
+  LET/QUIET ypolyshape = 0.9 * SIN(3.14159/180 * X[X=90:`4*72+90`:72])
+ENDIF
+
+IF $1"|hexagon>1|*>0|" THEN
+  LET/QUIET xpolyshape = 0.8 * COS(3.14159/180 * X[X=0:`5*60+0`:60])
+  LET/QUIET ypolyshape = 0.8 * SIN(3.14159/180 * X[X=0:`5*60+0`:60])
+ENDIF
+
+IF $1"|circle>1|*>0|" THEN
+  LET/QUIET xpolyshape = 0.8 * COS(3.14159/180 * X[X=0:`23*15+0`:15])
+  LET/QUIET ypolyshape = 0.8 * SIN(3.14159/180 * X[X=0:`23*15+0`:15])
+ENDIF
+
+IF $1"|star>1|*>0|" THEN
+  !LET/QUIET xpen = COS(3.14159/180 * X[X=90:`4*72+90`:72])
+  !LET/QUIET ypen = SIN(3.14159/180 * X[X=90:`4*72+90`:72])
+  !poly/hlimits=-1:1/vlimits=-1:1 xpen,ypen,0
+  !LET/QUIET xpeni = 0.3*COS(3.14159/180 * X[X=`90-36`:`4*72+90-36`:72])
+  !LET/QUIET ypeni = 0.3*SIN(3.14159/180 * X[X=`90-36`:`4*72+90-36`:72])
+  !poly/over/line/hlimits=-1:1/vlimits=-1:1 xpeni,ypeni,0
+  LET/QUIET xpolyshape = { 0.17634 , 0.00000 , -0.17634, -0.95106,  -0.28532,   -0.58779,    0.00000 ,    0.58778 ,    0.28532 ,    0.95106 }
+  LET/QUIET ypolyshape =  { 0.24270,  1.00000,  0.24271,  0.30902,  -0.09270,   -0.80902,  -0.30000,   -0.80902,   -0.09271,   0.30901 }
+ENDIF
+
+IF $1"|plus>1|*>0|" THEN
+!  LET/QUIET poly_d = .2
+!  LET/QUIET xpolyshape = 0.8 * {`-1*poly_d`,`-1*poly_d`,-1,-1,`-1*poly_d`,`-1*poly_d`,`poly_d`,`poly_d`,1,1,`poly_d`,`poly_d`}
+!  LET/QUIET ypolyshape = 0.8 * {1,`poly_d`,`poly_d`,`-1*poly_d`,`-1*poly_d`,-1,-1,`-1*poly_d`,`-1*poly_d`,`poly_d`,`poly_d`,1}
+!  cancel variable poly_d
+  LET/QUIET xpolyshape = {-0.2, -0.2, -0.8,  -0.8,  -0.2, -0.2, 0.2,  0.2,  0.8,  0.8,  0.2, 0.2}
+  LET/QUIET ypolyshape = { 0.8,   0.2,  0.2, -0.2, -0.2, -0.8,  -0.8, -0.2, -0.2, 0.2, 0.2, 0.8}
+ENDIF
+
+IF $1"|ex>1|*>0|" THEN
+LET/QUIET poly_h = .7
+LET/QUIET poly_d = .4
+  ! note: V4.91 bug: cant handle all these grave pairs
+!  LET/QUIET xpolyshape = {`poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`,`poly_h+poly_d`,.3,`poly_h+poly_d`}
+!  LET/QUIET ypolyshape = {`poly_h+poly_d`,.3,`poly_h+poly_d`, `poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`}
+  LET/QUIET xpolyshape = {`poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`,`poly_h+poly_d`,`2*poly_d`,`poly_h+poly_d`}
+  LET/QUIET ypolyshape = {`poly_h+poly_d`,`2*poly_d`,`poly_h+poly_d`, `poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`}
+  cancel variable poly_d, poly_h
+ENDIF
+
+IF $1"|rectangle>1|*>0|" THEN
+  LET/QUIET xpolyshape = 2.* COS(3.14159/180 * X[X=45:`3*90+45`:90])
+  LET/QUIET ypolyshape = SIN(3.14159/180 * X[X=45:`3*90+45`:90])
+ENDIF
+
+IF $1"|tallbox>1|*>0|" THEN
+  LET/QUIET xpolyshape = COS(3.14159/180 * X[X=45:`3*90+45`:90])
+  LET/QUIET ypolyshape = 2.* SIN(3.14159/180 * X[X=45:`3*90+45`:90])
+ENDIF
+
+IF $1"|lletter>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.4, -0.4,  0.4,  0.4, -0.2, -0.2, -0.4}
+  LET/QUIET ypolyshape = { 0.8, -0.8, -0.8, -0.6, -0.6,  0.8,  0.8}
+ENDIF
+
+IF $1"|hletter>1|*>0|" THEN
+  LET/QUIET poly_d = .2
+  LET/QUIET poly_h = .1
+  LET/QUIET xpolyshape = {-0.6, -0.6, `-0.6+poly_d`, `-0.6+poly_d`, `0.6-poly_d`, `0.6-poly_d`,  0.6, 0.6, `0.6-poly_d`, `0.6-poly_d`, `-0.6+poly_d`, `-0.6+poly_d`}
+  LET/QUIET ypolyshape = { 0.8, -0.8,          -0.8,   `0.-poly_h`,  `0.-poly_h`,         -0.8, -0.8, 0.8,          0.8,     `poly_h`,      `poly_h`,           0.8}
+  cancel variable poly_d
+ENDIF
+
+IF $1"|fslash>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.2, 0.8, 0.2, -0.8}
+  LET/QUIET ypolyshape = {-0.8, -0.8, 0.8, 0.8, -0.8}
+ENDIF
+
+IF $1"|bslash>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.2, 0.8, 0.2, -0.8}
+  LET/QUIET ypolyshape = { 0.8,  0.8, -0.8, -0.8,  0.8}
+ENDIF
+
+IF $1"|trianglec>1|*>0|" THEN
+  LET/QUIET xpolyshape = { 0.0, -0.6, 0.6}
+  LET/QUIET ypolyshape = {0.8, -0.8, -0.8}
+ENDIF
+
+IF $1"|deltac>1|*>0|" THEN
+  LET/QUIET xpolyshape = {0.6, -0.6,  0.0, 0.6}
+  LET/QUIET ypolyshape = {0.8,  0.8, -0.8, 0.8}
+ENDIF
+
+IF $1"|exc>1|*>0|" THEN
+LET/QUIET poly_h = .6
+LET/QUIET poly_d = .12
+  LET/QUIET xpolyshape = {`poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`,`poly_h+poly_d`,`2*poly_d`,`poly_h+poly_d`}
+  LET/QUIET ypolyshape = {`poly_h+poly_d`,`2*poly_d`,`poly_h+poly_d`, `poly_h-poly_d`,0,`-1*(poly_h-poly_d)`,`-1*(poly_h+poly_d)`,`-2*poly_d`,`-1*(poly_h+poly_d)`,`-1*(poly_h-poly_d)`,0,`poly_h-poly_d`}
+  cancel variable poly_d, poly_h
+ENDIF
+
+IF $1"|rectanglec>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8,  0.8,  0.8, -0.8, -0.8}
+  LET/QUIET ypolyshape = {-0.3, -0.3,  0.3,  0.3, -0.3}
+ENDIF
+
+IF $1"|tallboxc>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.3, -0.3,  0.3,  0.3, -0.3}
+  LET/QUIET ypolyshape = {-0.8,  0.8,  0.8, -0.8, -0.8}
+ENDIF
+
+
+IF $1"|tletter>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.8,  0.8,  0.8,  0.2,  0.2, -0.2, -0.2, -0.8}
+  LET/QUIET ypolyshape = { 0.4,  0.8,  0.8,  0.4,  0.4, -0.8, -0.8,  0.4,  0.4}
+ENDIF
+
+IF $1"|tupside>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.8,  0.8,  0.8,  0.2,  0.2, -0.2, -0.2, -0.8}
+  LET/QUIET ypolyshape = {-0.4, -0.8, -0.8, -0.4, -0.4,  0.8,  0.8, -0.4, -0.4}
+ENDIF
+
+IF $1"|tleft>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.8,  0.4,  0.4,  0.8,  0.8,  0.4,  0.4, -0.8}
+  LET/QUIET ypolyshape = {-0.2,  0.2,  0.2,  0.8,  0.8, -0.8, -0.8, -0.2, -0.2}
+ENDIF
+
+IF $1"|tright>1|*>0|" THEN
+  LET/QUIET xpolyshape = { 0.8,  0.8, -0.4, -0.4, -0.8, -0.8, -0.4, -0.4,  0.8}
+  LET/QUIET ypolyshape = {-0.2,  0.2,  0.2,  0.8,  0.8, -0.8, -0.8, -0.2, -0.2}
+ENDIF
+
+IF $1"|vright>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, 0.8, 0.8, 0.2,  0.8,  0.8, -0.8}
+  LET/QUIET ypolyshape = { 0.0, 0.8, 0.6, 0.0, -0.6, -0.8,  0.0}
+ENDIF
+
+IF $1"|vleft>1|*>0|" THEN
+  LET/QUIET xpolyshape = { 0.8, -0.8, -0.8, -0.2, -0.8, -0.8, 0.8}
+  LET/QUIET ypolyshape = { 0.0,  0.8,  0.6,  0.0, -0.6, -0.8,  0.0}
+ENDIF
+
+IF $1"|rtriangle>1|*>0|" THEN
+  LET/QUIET xpolyshape = {0.8, -0.8, -0.8, 0.8}
+  LET/QUIET ypolyshape = {0.0,  -0.6, 0.6, 0.0}
+ENDIF
+
+IF $1"|ltriangle>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, 0.8,  0.8, -0.8}
+  LET/QUIET ypolyshape = {0.0,  -0.6, 0.6, 0.0}
+ENDIF
+
+IF $1"|uright>1|*>0|" THEN
+  LET/QUIET xpolyshape = { 0.8,  0.8, -0.4, -0.4, 0.8, 0.8, -0.8, -0.8,  0.8}
+  LET/QUIET ypolyshape = {-0.8, -0.4, -0.4,  0.4, 0.4, 0.8,  0.8, -0.8, -0.8}
+ENDIF
+
+IF $1"|uleft>1|*>0|" THEN
+  LET/QUIET xpolyshape = {-0.8, -0.8,  0.4,  0.4, -0.8, -0.8,  0.8,  0.8, -0.8}
+  LET/QUIET ypolyshape = {-0.8, -0.4, -0.4,  0.4,  0.4,  0.8,  0.8, -0.8, -0.8}
+ENDIF
+
+set mode/last verify
+
diff --git a/jnls/go/polytube.jnl b/jnls/go/polytube.jnl
new file mode 100644
index 0000000..e895291
--- /dev/null
+++ b/jnls/go/polytube.jnl
@@ -0,0 +1,93 @@
+\cancel mode verify
+! polytube.jnl
+! 4/99 *sh* and *jd*
+! 10/00 *sh* bug fix to scaling algorithm
+
+! Description: Plot a colored tube of variable values along a plotted track
+
+! Usage:                  $1         $2   $3   $4      $5       $6
+! yes?	GO polytube polygon_command xpts ypts values [scale] [smooth]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track
+! $3 - Y coordinates of track
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - scale the values by this factor (optional, default 1)
+! $6 - smooth the track to be plotted with SBX:$6 (optional, default 3)
+!      The "smooth" parameter is given in units of the number of points over
+!      which a running mean filter will be applied to the normal vectors. It 
+!      is effective only in special cases. For "rough" paths, best results are
+!      obtained by smoothing the position data that is passed to this script. 
+
+! example -- make up a cruise track and data
+!	yes? let xpts = 180 + 50*COS(2*3.14*I[I=1:50]/60)
+!	yes? let ypts = 15  + 20*SIN(2*3.14*I[I=1:50]/60)
+!	yes? let sst = 25 - ypts + RANDN(ypts)
+!	yes? go basemap x=120:250 Y=25s:65n 20
+!
+!	yes? go polytube polygon/over/key/title=sst xpts,ypts,sst
+!
+!	yes? plot/vs/over/nolab/line/sym xpts,ypts
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $2"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+QUERY/IGNORE $3"<usage: yes? GO polytube polygon_command xpts ypts values [scale] [smooth]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET TUBEx = ($2)
+LET/QUIET TUBEy = ($3)
+LET/QUIET TUBEdata = ($4)
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL TUBEax `TUBEx,return=shape`
+DEFINE SYMBOL TUBEpoly_ax ($TUBEax"|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a line")
+
+! units/inch scale factors
+LET/QUIET TUBEdefault_scale =$5"1" *  0.25
+LET/QUIET TUBEx_correction = TUBEdefault_scale*((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET TUBEy_correction = TUBEdefault_scale*((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+LET/QUIET TUBEaxscale_factor = TUBEy_correction/TUBEx_correction
+
+! compute the local normal vector components -- (COS,SIN) --> (-SIN,COS)
+! this will be used to create offsets from track line
+! @DDF and @DDB fill in derivative values at endpoints and missing pts
+LET/QUIET TUBEdx0 = MISSING(TUBEx[($TUBEax)=@ddc],MISSING(TUBEx[($TUBEax)=@ddf],TUBEx[($TUBEax)=@ddb])) * TUBEaxscale_factor
+
+LET/QUIET TUBEdy0 = MISSING(TUBEy[($TUBEax)=@ddc],MISSING(TUBEy[($TUBEax)=@ddf],TUBEy[($TUBEax)=@ddb]))
+
+LET/QUIET TUBEds_mag = (TUBEdx0^2+TUBEdy0^2)^0.5
+LET/QUIET TUBExnorm0 = TUBEx_correction * (-1 *  TUBEdy0 / TUBEds_mag)
+LET/QUIET TUBEynorm0 = TUBEy_correction * TUBEdx0 / TUBEds_mag
+
+! smooth the normal vectors ...
+LET/QUIET TUBExnorm = MISSING(TUBExnorm0[($TUBEax)=@sbx:$6"3"],TUBExnorm0)
+LET/QUIET TUBEynorm = MISSING(TUBEynorm0[($TUBEax)=@sbx:$6"3"],TUBEynorm0)
+
+! compute midpoints -- base points to which the polygon deltas are added 
+! use MISSING to capture the very last 1/2 sized quadralateral
+LET/QUIET TUBExmid = MISSING( (TUBEx + TUBEx[($TUBEax)=@shf])/2, TUBEx )
+LET/QUIET TUBEymid = MISSING( (TUBEy + TUBEy[($TUBEax)=@shf])/2, TUBEy )
+
+! at each midpoint, assemble the vertices above and below
+!LET/QUIET TUBExup  = TUBExmid + TUBExnorm
+!LET/QUIET TUBEyup  = TUBEymid + TUBEynorm
+!LET/QUIET TUBExdn  = TUBExmid - TUBExnorm
+!LET/QUIET TUBEydn  = TUBEymid - TUBEynorm
+
+! create the 4 vertices for each quadrlateral of the tube
+LET/QUIET TUBEpindex = ($TUBEpoly_ax)[($TUBEpoly_ax)=1:4]
+LET/QUIET TUBEx4_0 = IF TUBEpindex EQ 1 OR TUBEpindex EQ 4 then TUBExmid-TUBExnorm ELSE TUBExmid+TUBExnorm
+LET/QUIET TUBEy4_0 = IF TUBEpindex EQ 1 OR TUBEpindex EQ 4 then TUBEymid-TUBEynorm ELSE TUBEymid+TUBEynorm
+
+! x4p1,y4p1 just to capture the very first 1/2 sized quadralateral
+LET/QUIET TUBEx4p1 = IF TUBEpindex EQ 1 OR TUBEpindex EQ 4 then TUBEx-TUBExnorm ELSE TUBEx+TUBExnorm
+LET/QUIET TUBEy4p1 = IF TUBEpindex EQ 1 OR TUBEpindex EQ 4 then TUBEy-TUBEynorm ELSE TUBEy+TUBEynorm
+
+LET/QUIET TUBEx4_1 = IF TUBEpindex LE 2 then TUBEx4_0 ELSE MISSING( TUBEx4_0[($TUBEax)=@shf:-1], TUBEx4p1 )
+LET/QUIET TUBEy4_1 = IF TUBEpindex LE 2 then TUBEy4_0 ELSE MISSING( TUBEy4_0[($TUBEax)=@shf:-1], TUBEy4p1 )
+
+$1/coord_ax=($TUBEpoly_ax)  TUBEx4_1,TUBEy4_1,TUBEdata
+
+cancel symbol TUBE*
+cancel variable TUBE*
+set mode/last verify
diff --git a/jnls/go/polytube_bent.jnl b/jnls/go/polytube_bent.jnl
new file mode 100644
index 0000000..72c3db2
--- /dev/null
+++ b/jnls/go/polytube_bent.jnl
@@ -0,0 +1,149 @@
+\cancel mode verify
+! polytube_bent.jnl
+! 4/99 *sh* and *jd*
+! 10/00 *sh* bug fix to scaling algorithm
+! 08/2012 Adapted from polytube by E. D. Cokelet, NOAA/PMEL
+
+! Description: Plot a colored, sgmented tube of variable values along a plotted track.
+! Older polytube cuts off the corners, i.e. it draws a single tube between the midpoints of successive trackline points.  
+! polytube_bent does not cut off the corners between trackline data points.  Instead it draws 2-segment tube that lies along the trackline and bends around each data point.  The first segment goes from the midpoint before to the trackline point, and the second segment goes from the trackline point to the midpoint after.  Contrary to polytube, no smoothing is employed in polytube_bent.  If desired, the user should smooth the inputs before calling polytube_bent.  
+! Missing values:  polytube_bent does not replace missing values via interpolation.  Missing value interpolation is left to the user prior to input to polytube_bent.  polytube_bent requires that "xpts" and "ypts" contain no missing values.  The "values" variable can contain missing values around which no polygon will be drawn.   
+
+! Usage:                            $1         $2   $3   $4      $5
+! yes?	GO polytube_bent polygon_command xpts ypts values [scale]
+! $1 - the plot command with qualifiers (eg POLYGON/OVER/KEY)
+! $2 - X coordinates of track
+! $3 - Y coordinates of track
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - scale the values by this factor in user units per quarter inch (optional, default 1)
+
+! example -- make up a cruise track and data
+!	let pi = 4.0*atan(1.0)
+!	let npts = 6
+!	define axis/t=0:`npts-1`:1/units=days t_ax
+!	let tim = t[gt=t_ax]
+!	let xpts = 180 + 50*COS(2*pi*tim/(npts-1))
+!	let ypts = 15  + 20*SIN(2*pi*tim/(npts-1))
+!	let sst  = 35 - ypts + RANDN(ypts)
+!	let sst1 = if (l eq 3) then sst/0 else sst	! Test function with missing value that should not plot
+!	go basemap x=120:250 Y=25s:65n 20
+
+! Choose with polytube
+!	go polytube polygon/over/key/title=sst xpts,ypts,sst
+! or with polytube_bent
+
+!	go polytube_bent polygon/over/key/title=sst xpts,ypts,sst
+!	plot/vs/over/nolab/line/sym/thick=2 xpts,ypts
+!	list xpts, ypts, sst
+
+
+! argument check
+
+QUERY/IGNORE $1"<usage: yes? GO polytube_bent polygon_command xpts ypts values [scale]"
+QUERY/IGNORE $2"<usage: yes? GO polytube_bent polygon_command xpts ypts values [scale]"
+QUERY/IGNORE $3"<usage: yes? GO polytube_bent polygon_command xpts ypts values [scale]"
+
+
+! save the input expressions into simple variable definitions
+
+LET/QUIET TUBEx = ($2)
+LET/QUIET TUBEy = ($3)
+LET/QUIET TUBEdata = ($4)
+
+
+! determine the orientation of the data (and check that it is 1D)
+
+DEFINE SYMBOL TUBEax `TUBEx,return=shape`
+DEFINE SYMBOL TUBEpoly_ax ($TUBEax"|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a line")
+
+
+! Scale factors in units/(quarter-inch)
+
+LET/QUIET TUBEdefault_scale =$5"1" *  0.25
+LET/QUIET TUBEx_scale = TUBEdefault_scale*((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET TUBEy_scale = TUBEdefault_scale*((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+LET/QUIET TUBEaxscale_factor = TUBEy_scale/TUBEx_scale
+
+
+! Compute the local normal vector components -- (COS,SIN) --> (-SIN,COS)
+! at each trackline point and at the midpoints before and after.
+! These will be used to create offsets from track line.
+! The missing value logic below takes care of the first (or last) plotted point before (or after) which there is no value.
+! If a centered derivative is missing, fill it with a forward one if it exists, or a backward one if not.
+
+LET/QUIET TUBEdx_bef = TUBEx[($TUBEax)=@ddb] * TUBEaxscale_factor
+LET/QUIET TUBEdy_bef = TUBEy[($TUBEax)=@ddb]
+
+LET/QUIET TUBEdx_pt = missing( TUBEx[($TUBEax)=@ddc], missing( TUBEx[($TUBEax)=@ddf], TUBEx[($TUBEax)=@ddb]) ) * TUBEaxscale_factor
+LET/QUIET TUBEdy_pt = missing( TUBEy[($TUBEax)=@ddc], missing( TUBEy[($TUBEax)=@ddf], TUBEy[($TUBEax)=@ddb]) )
+
+LET/QUIET TUBEdx_aft = TUBEx[($TUBEax)=@ddf] * TUBEaxscale_factor
+LET/QUIET TUBEdy_aft = TUBEy[($TUBEax)=@ddf]
+
+LET/QUIET TUBEds_mag_bef = (TUBEdx_bef^2+TUBEdy_bef^2)^0.5 
+LET/QUIET TUBExnorm_bef = TUBEx_scale * (-1 *  TUBEdy_bef / TUBEds_mag_bef)
+LET/QUIET TUBEynorm_bef = TUBEy_scale * TUBEdx_bef / TUBEds_mag_bef
+
+LET/QUIET TUBEds_mag_pt = (TUBEdx_pt^2+TUBEdy_pt^2)^0.5
+LET/QUIET TUBExnorm_pt = TUBEx_scale * (-1 *  TUBEdy_pt / TUBEds_mag_pt)
+LET/QUIET TUBEynorm_pt = TUBEy_scale * TUBEdx_pt / TUBEds_mag_pt
+
+LET/QUIET TUBEds_mag_aft = (TUBEdx_aft^2+TUBEdy_aft^2)^0.5
+LET/QUIET TUBExnorm_aft = TUBEx_scale * (-1 *  TUBEdy_aft / TUBEds_mag_aft)
+LET/QUIET TUBEynorm_aft = TUBEy_scale * TUBEdx_aft / TUBEds_mag_aft
+
+
+! compute midpoints before and after each trackline point
+
+LET/QUIET TUBExmid_bef = missing( (TUBEx + TUBEx[($TUBEax)=@shf:-1])/2, TUBEx )
+LET/QUIET TUBEymid_bef = missing( (TUBEy + TUBEy[($TUBEax)=@shf:-1])/2, TUBEy )
+
+LET/QUIET TUBExmid_aft = missing( (TUBEx + TUBEx[($TUBEax)=@shf:1])/2, TUBEx )
+LET/QUIET TUBEymid_aft = missing( (TUBEy + TUBEy[($TUBEax)=@shf:1])/2, TUBEy )
+
+
+! create the 6 vertices for each 6-sided bent tube centered on each trackline point
+! Vertices are numbered counterclockwise beginning in lower, left corner
+
+LET/QUIET TUBE_index = ($TUBEpoly_ax)[($TUBEpoly_ax)=1:6]
+
+let/quiet TUBEx1 = missing( 0*TUBE_index + TUBExmid_bef - TUBExnorm_bef, TUBEx2)
+let/quiet TUBEy1 = missing( 0*TUBE_index + TUBEymid_bef - TUBEynorm_bef, TUBEy2)
+
+let/quiet TUBEx2 = 0*TUBE_index + TUBEx - TUBExnorm_pt
+let/quiet TUBEy2 = 0*TUBE_index + TUBEy - TUBEynorm_pt
+
+let/quiet TUBEx3 = missing( 0*TUBE_index + TUBExmid_aft - TUBExnorm_aft, TUBEx2) 
+let/quiet TUBEy3 = missing( 0*TUBE_index + TUBEymid_aft - TUBEynorm_aft, TUBEy2)
+ 
+let/quiet TUBEx4 = missing( 0*TUBE_index + TUBExmid_aft + TUBExnorm_aft, TUBEx5)
+let/quiet TUBEy4 = missing( 0*TUBE_index + TUBEymid_aft + TUBEynorm_aft, TUBEy5)
+
+let/quiet TUBEx5 = 0*TUBE_index + TUBEx + TUBExnorm_pt 
+let/quiet TUBEy5 = 0*TUBE_index + TUBEy + TUBEynorm_pt
+
+let/quiet TUBEx6 = missing( 0*TUBE_index + TUBExmid_bef + TUBExnorm_bef, TUBEx5)
+let/quiet TUBEy6 = missing( 0*TUBE_index + TUBEymid_bef + TUBEynorm_bef, TUBEy5)
+
+let/quiet TUBEmask1 = if TUBE_index eq 1 then 1 else 0
+let/quiet TUBEmask2 = if TUBE_index eq 2 then 1 else 0
+let/quiet TUBEmask3 = if TUBE_index eq 3 then 1 else 0
+let/quiet TUBEmask4 = if TUBE_index eq 4 then 1 else 0
+let/quiet TUBEmask5 = if TUBE_index eq 5 then 1 else 0
+let/quiet TUBEmask6 = if TUBE_index eq 6 then 1 else 0
+
+let/quiet TUBEx_plot = TUBEmask1*TUBEx1 + TUBEmask2*TUBEx2 + TUBEmask3*TUBEx3 + TUBEmask4*TUBEx4 + TUBEmask5*TUBEx5 + TUBEmask6*TUBEx6
+
+let/quiet TUBEy_plot = TUBEmask1*TUBEy1 + TUBEmask2*TUBEy2 + TUBEmask3*TUBEy3 + TUBEmask4*TUBEy4 + TUBEmask5*TUBEy5 + TUBEmask6*TUBEy6
+
+
+! Plot the polygons on the trackline
+
+$1/coord_ax=($TUBEpoly_ax) TUBEx_plot, TUBEy_plot, TUBEdata
+
+cancel symbol TUBE*
+cancel variable TUBE*
+set mode/last verify
+
+
+
diff --git a/jnls/go/portrait.jnl b/jnls/go/portrait.jnl
new file mode 100644
index 0000000..9f39f5c
--- /dev/null
+++ b/jnls/go/portrait.jnl
@@ -0,0 +1,10 @@
+\cancel mode verify    !. . . . now setting window to 8 1/2 x 11 size
+! Description: Set up for 8.5 x 11 page size
+message/continue ......
+message/continue Use PPL/RESET to restore default graphics
+message/continue For hardcopy, use the "-p portrait" option with mtp
+message/continue ......
+
+set wind/asp=1.3
+
+set mode/last verify
diff --git a/jnls/go/portrait1x2.jnl b/jnls/go/portrait1x2.jnl
new file mode 100644
index 0000000..48c2385
--- /dev/null
+++ b/jnls/go/portrait1x2.jnl
@@ -0,0 +1,26 @@
+\can mode verify
+! Description: Set up for two viewports on an 8.5 x 11 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Viewport names are: bot2,top2
+message/continue Use "SET VIEWPORT bot2" to select the bottom half, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue For hard copy use the "-p portrait" option with mtp
+message/continue .....
+
+
+ppl/reset
+set window/aspect=1.3  ! 11.5/2 x 8.5
+
+\set mode verify
+\! define viewports
+
+define view/xlimits=0,1/ylimits=.47,1 top2
+define view/xlimits=0,1/ylimits=0,.53 bot2
+
+\message/continue .....
+\message/continue To decrease the amount of "dead space" in the plot,
+\message/continue simply modify the ylimits as defined above so
+\message/continue that the viewports slightly overlap each other
+\message/continue .....
+
diff --git a/jnls/go/portrait1x3.jnl b/jnls/go/portrait1x3.jnl
new file mode 100644
index 0000000..f8e72d4
--- /dev/null
+++ b/jnls/go/portrait1x3.jnl
@@ -0,0 +1,32 @@
+\cancel mode verify      ! ... now defining 3 viewports: bottom,middle,top
+! Description: Set up for three viewports on an 8.5 x 11 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Viewport names are: bot3,mid3,top3
+message/continue Use "SET VIEWPORT bot3" to select the bottom third, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue For hard copy use the "-p portrait" option with mtp
+
+! Create 3 viewports on a portrait plot - 3 down
+! The sizing is to fill a portrait 8 1/2 x 11 page.
+
+ppl/reset
+set window/aspect=1.32  
+
+! define viewports
+set mode/last verify
+
+define view/xlimits=0,1/ylimits=0,.33 bot3
+define view/xlimits=0,1/ylimits=.33,.66 mid3
+define view/xlimits=0,1/ylimits=.66,1 top3
+
+\message/continue .....
+\message/continue In order to decrease amount of "dead space" in the plot,
+\message/continue simply modify the ylimits as defined above so that the
+\message/continue viewports slightly overlap each other.
+\message/continue .....
+
+
+
+\set window/size = 0.6	! immediate redraw / appropriate screen size
+
diff --git a/jnls/go/portrait1x4.jnl b/jnls/go/portrait1x4.jnl
new file mode 100644
index 0000000..fa00193
--- /dev/null
+++ b/jnls/go/portrait1x4.jnl
@@ -0,0 +1,35 @@
+\cancel mode verify      ! ... now defining 4 viewports: bot4,bm4,tm4,top4
+! Description: Set up for four viewports on an 8.5 x 11 page
+message/continue .....
+message/continue The viewports are sized to fit well on an 8 1/2 x 11 page
+message/continue Viewport names are: bb4,ub4,lt4,tt4
+message/continue bb4 ----> bottom bottom
+message/continue ub4 ----> upper bottom
+message/continue lt4 ----> lower top
+message/continue tt4 ----> top top
+message/continue Use "SET VIEWPORT ub4" to select the 2nd quarter from the
+message/continue bottom, etc.
+message/continue Use CANCEL VIEWPORT and PPL/RESET to restore default graphics
+message/continue For hard copy use the "-p portrait" option with mtp
+message/continue .....
+
+! Create 4 viewports on a portrait plot - 4 down
+! The sizing is to fill a portrait 8 1/2 x 11 page.
+
+ppl/reset
+set window/aspect=1.32  
+
+set mode/last verify
+
+define view/xlimits=0,1/ylimits=0,.26   bb4
+define view/xlimits=0,1/ylimits=.24,.51 ub4
+define view/xlimits=0,1/ylimits=.51,.76 lt4
+define view/xlimits=0,1/ylimits=.76,1   tt4
+
+\message/continue .....
+\message/continue To decrease the amount of "dead space" in the plot,
+\message/continue simply modify the ylimits as defined above so
+\message/continue that the viewports slightly overlap each other
+\message/continue .....
+
+\set window/size = 0.6	! immediate redraw / appropriate screen size
diff --git a/jnls/go/projected_map_grid.jnl b/jnls/go/projected_map_grid.jnl
new file mode 100644
index 0000000..79849e4
--- /dev/null
+++ b/jnls/go/projected_map_grid.jnl
@@ -0,0 +1,24 @@
+\cancel mode verify
+! 2/94 - routine used for creating "page grids" suitable for map projections
+
+! Description: define the map grid for a projected plot
+
+! The grid defined by this routine refers to the plot page, itself, rather
+! than to the underlying data coordinates.  A coordinate system is defined
+! for the plot page that runs from -1 to one in both x and y with a resolution
+! determined by the argument to this script.
+
+! In a typical application such as spherical polar plotting the original data,
+! which are on a lat/lon grid, are "sampled" (interpolated) at just those
+! coordinates which will project onto this page grid.
+
+! usage:   GO projected_map_grid #_points
+!	default: #_points = 201
+
+! use fnoc_map_grid to get the 63x63 FNOC grid
+
+define axis/x=-1:1/npoints=$1"201" xproj$1"201"
+define axis/y=-1:1/npoints=$1"201" yproj$1"201"
+define grid/x=xproj$1"201"/y=yproj$1"201" gproj$1"201"
+
+set mode/last verify
diff --git a/jnls/go/ptest.jnl b/jnls/go/ptest.jnl
new file mode 100644
index 0000000..a897509
--- /dev/null
+++ b/jnls/go/ptest.jnl
@@ -0,0 +1,5 @@
+! Description: create a simple test line plot
+
+! spirograph picture ...
+PLOT/VS/LINE/I=1:314 i*cos(i/20),i*sin(i/20)
+
diff --git a/jnls/go/regresst.jnl b/jnls/go/regresst.jnl
new file mode 100644
index 0000000..ec280fd
--- /dev/null
+++ b/jnls/go/regresst.jnl
@@ -0,0 +1,39 @@
+\CANCEL MODE VERIFY 
+! Description:  define FERRET variables for regression along the T axis
+! updated 10/93 for Ferret V3.01
+! 10/09 More-robust computations of variance using the Ferret @VAR transform
+
+say ... Linear Regression Along the T Axis
+say ... Instructions:
+say Use the LET command to define new variables
+say Define the variable P as your independent (X) variable
+say Define the variable Q as your   dependent (Y) variable
+say Results will be variables "SLOPE", "INTERCEP" and "RSQUARE"
+say QHAT will be the regression estimate
+say Note: If "T" is your independent variable then
+say ...   "SET GRID Q" after defining Q.
+say ... 
+
+let pq = p*q
+let pqmask = pq-pq  ! 0 or "missing" so all variables share the same missing
+let pmasked = p + pqmask
+let qmasked = q + pqmask
+let pp = pmasked*pmasked
+let qq = qmasked*qmasked
+
+let pave = pmasked[t=@ave]
+let qave = qmasked[t=@ave]
+
+let pdev=pmasked-pave
+let qdev=qmasked-qave
+let pdevqdev=pdev*qdev
+let pqvar=pdevqdev[t=@ave]
+let pvar=pmasked[t=@var]
+let qvar=qmasked[t=@var] 
+
+let slope = pqvar / pvar
+let intercep = qave - slope*pave
+let qhat = slope*p + intercep
+let rsquare = (pqvar*pqvar) / (pvar*qvar)
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/regressx.jnl b/jnls/go/regressx.jnl
new file mode 100644
index 0000000..7a3e0c3
--- /dev/null
+++ b/jnls/go/regressx.jnl
@@ -0,0 +1,38 @@
+\CANCEL MODE VERIFY 
+! Description:  define FERRET variables for regression along the X axis
+! updated 10/93 for Ferret V3.01
+
+say ... Linear Regression Along the X Axis
+say ... Instructions:
+say Use the LET command to define new variables
+say Define the variable P as your independent (X) variable
+say Define the variable Q as your   dependent (Y) variable
+say Results will be variables "SLOPE", "INTERCEP" and "RSQUARE"
+say QHAT will be the regression estimate
+say Note: If "X" is your independent variable then
+say ...   "SET GRID Q" after defining Q.
+say ... 
+
+let pq = p*q
+let pqmask = pq-pq  ! 0 or "missing" so all variables share the same missing
+let pmasked = p + pqmask
+let qmasked = q + pqmask
+let pp = pmasked*pmasked
+let qq = qmasked*qmasked
+
+let pave = pmasked[x=@ave]
+let qave = qmasked[x=@ave]
+
+let pdev=pmasked-pave
+let qdev=qmasked-qave
+let pdevqdev=pdev*qdev
+let pqvar=pdevqdev[x=@ave]
+let pvar=pmasked[x=@var]
+let qvar=qmasked[x=@var] 
+
+let slope = pqvar / pvar
+let intercep = qave - slope*pave
+let qhat = slope*p + intercep
+let rsquare = (pqvar*pqvar) / (pvar*qvar)
+
+SET MODE/LAST VERIFY
\ No newline at end of file
diff --git a/jnls/go/regressy.jnl b/jnls/go/regressy.jnl
new file mode 100644
index 0000000..fa6e50d
--- /dev/null
+++ b/jnls/go/regressy.jnl
@@ -0,0 +1,38 @@
+\CANCEL MODE VERIFY 
+! Description:  define FERRET variables for regression along the Y axis
+! updated 10/93 for Ferret V3.01
+
+say ... Linear Regression Along the Y Axis
+say ... Instructions:
+say Use the LET command to define new variables
+say Define the variable P as your independent (X) variable
+say Define the variable Q as your   dependent (Y) variable
+say Results will be variables "SLOPE", "INTERCEP" and "RSQUARE"
+say QHAT will be the regression estimate
+say Note: If "Y" is your independent variable then
+say ...   "SET GRID Q" after defining Q.
+say ... 
+
+let pq = p*q
+let pqmask = pq-pq  ! 0 or "missing" so all variables share the same missing
+let pmasked = p + pqmask
+let qmasked = q + pqmask
+let pp = pmasked*pmasked
+let qq = qmasked*qmasked
+
+let pave = pmasked[y=@ave]
+let qave = qmasked[y=@ave]
+
+let pdev=pmasked-pave
+let qdev=qmasked-qave
+let pdevqdev=pdev*qdev
+let pqvar=pdevqdev[y=@ave]
+let pvar=pmasked[y=@var]
+let qvar=qmasked[y=@var] 
+
+let slope = pqvar / pvar
+let intercep = qave - slope*pave
+let qhat = slope*p + intercep
+let rsquare = (pqvar*pqvar) / (pvar*qvar)
+
+SET MODE/LAST VERIFY
\ No newline at end of file
diff --git a/jnls/go/regressz.jnl b/jnls/go/regressz.jnl
new file mode 100644
index 0000000..b2f87f1
--- /dev/null
+++ b/jnls/go/regressz.jnl
@@ -0,0 +1,38 @@
+\CANCEL MODE VERIFY 
+! Description:  define FERRET variables for regression along the Z axis
+! updated 10/93 for Ferret V3.01
+
+say ... Linear Regression Along the Z Axis
+say ... Instructions:
+say Use the LET command to define new variables
+say Define the variable P as your independent (X) variable
+say Define the variable Q as your   dependent (Y) variable
+say Results will be variables "SLOPE", "INTERCEP" and "RSQUARE"
+say QHAT will be the regression estimate
+say Note: If "Z" is your independent variable then
+say ...   "SET GRID Q" after defining Q.
+say ... 
+
+let pq = p*q
+let pqmask = pq-pq  ! 0 or "missing" so all variables share the same missing
+let pmasked = p + pqmask
+let qmasked = q + pqmask
+let pp = pmasked*pmasked
+let qq = qmasked*qmasked
+
+let pave = pmasked[z=@ave]
+let qave = qmasked[z=@ave]
+
+let pdev=pmasked-pave
+let qdev=qmasked-qave
+let pdevqdev=pdev*qdev
+let pqvar=pdevqdev[z=@ave]
+let pvar=pmasked[z=@var]
+let qvar=qmasked[z=@var] 
+
+let slope = pqvar / pvar
+let intercep = qave - slope*pave
+let qhat = slope*p + intercep
+let rsquare = (pqvar*pqvar) / (pvar*qvar)
+
+SET MODE/LAST VERIFY
\ No newline at end of file
diff --git a/jnls/go/reminder.jnl b/jnls/go/reminder.jnl
new file mode 100644
index 0000000..4e8d541
--- /dev/null
+++ b/jnls/go/reminder.jnl
@@ -0,0 +1,32 @@
+\ cancel mode verify
+! reminder.jnl  (12/94)
+
+! Description: Place a reminder string on the upper left corner of a plot
+
+! Note: A known "bug" of this procedure is that the PLOT+ symbol GO_FILE
+!       gets defined only **after** PLOT+ has already placed a window on
+!       the screen and a GO command is executed.  This means that if the
+!       GO file to create a plot contains the first command that opens
+!       an output window the symbol GO_FILE will **not** be defined.
+
+! usage: GO reminder "string" [xpos] [ypos] [size] [rotation]
+
+! example:  yes? GO reminder "Am. Jnl. of Hagiology fig. 3"
+
+! arguments
+! xpos - inches from left    	(default 0.0)
+! ypos - inches from top	(default 0.0)
+! size - size in inches 	(default 0.1)
+! rotation                      (default 0.0)
+
+! locate the position of the label start
+ppl set temp 'vp_height' - 'PPL$YORG'
+ppl set temp 'temp' - $4"0.1"           ! drop down by text size
+ppl set remind_yloc 'temp' - $3"0.0"
+ppl set remind_xloc $2"0.1" - 'PPL$XORG'
+
+! insert the label (left justified, 0.0 rotation)
+LABEL/NOUSER 'remind_xloc' 'remind_yloc' -1 $5"0"  $4"0.1" $1"@AS'go_file'"
+
+! clean up
+set mode/last verif
diff --git a/jnls/go/remove_logo.jnl b/jnls/go/remove_logo.jnl
new file mode 100644
index 0000000..8a7f3da
--- /dev/null
+++ b/jnls/go/remove_logo.jnl
@@ -0,0 +1,22 @@
+\cancel mode verify	! ... removing the Ferret logo from a plot.
+! usage:   GO remove_logo
+
+! The Ferret logo is automatically placed on each plot made by Ferret, giving
+! the version of Ferret and the date of the plot.  You may wish to remove this
+! logo from your plots, for example, for publications.
+!
+!   e.g.  remove the Ferret logo from a plot
+!	   yes? PLOT/SET_UP/I=1:100 SIN(I/6)
+!	   yes? GO remove_logo
+!	   yes? PPL PLOT
+
+! Label 1, the FERRET version number
+PPL LABS/NOUSER 1,0,0 @AS
+
+! Label 2, the NOAA/PMEL/TMAP citation
+PPL LABS/NOUSER 2,0,0 @AS
+
+! Label 3, the date stamp
+PPL LABS/NOUSER 3,0,0 @AS
+
+set mode/last verify
diff --git a/jnls/go/rgb_centered.jnl b/jnls/go/rgb_centered.jnl
new file mode 100644
index 0000000..2a24ab9
--- /dev/null
+++ b/jnls/go/rgb_centered.jnl
@@ -0,0 +1,6 @@
+CANCEL MODE VERIFY     ! ... now changing color spectrum
+! set colors to a pronounced split at zero spectrum
+
+ppl shaset spectrum=saz2
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/rgb_fireworks.jnl b/jnls/go/rgb_fireworks.jnl
new file mode 100644
index 0000000..fc3128f
--- /dev/null
+++ b/jnls/go/rgb_fireworks.jnl
@@ -0,0 +1,34 @@
+\cancel mode verify	! beat 8 colors against 3 scale locations - 24 combos
+
+! Description: a display of video color changes
+
+ppl shaset
+
+ppl shaset  100  100   0   0
+ppl shaset    0    0 100   0
+ppl shaset   50    0   0 100
+ppl shaset  100  100 100   0
+ppl shaset    0    0 100 100
+ppl shaset   50  100   0 100
+ppl shaset  100  100 100 100
+ppl shaset    0    0   0   0
+
+ppl shaset   50  100   0   0
+ppl shaset  100    0 100   0
+ppl shaset    0    0   0 100
+ppl shaset   50  100 100   0
+ppl shaset  100    0 100 100
+ppl shaset    0  100   0 100
+ppl shaset   50  100 100 100
+ppl shaset  100    0   0   0
+
+ppl shaset    0  100   0   0
+ppl shaset   50    0 100   0
+ppl shaset  100    0   0 100
+ppl shaset    0  100 100   0
+ppl shaset   50    0 100 100
+ppl shaset  100  100   0 100
+ppl shaset    0  100 100 100
+ppl shaset   50    0   0   0
+
+set mode/last verify
diff --git a/jnls/go/rgb_grayscale.jnl b/jnls/go/rgb_grayscale.jnl
new file mode 100644
index 0000000..a749405
--- /dev/null
+++ b/jnls/go/rgb_grayscale.jnl
@@ -0,0 +1,7 @@
+CANCEL MODE VERIFY     ! ... now changing color spectrum
+! set color spectrum to a gray scale
+! Description:  An obsolete tool equivalent to "PALETTE greyscale"
+
+ppl shaset spectrum=greyscale
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/rgb_greyscale.jnl b/jnls/go/rgb_greyscale.jnl
new file mode 100644
index 0000000..4222773
--- /dev/null
+++ b/jnls/go/rgb_greyscale.jnl
@@ -0,0 +1,8 @@
+CANCEL MODE VERIFY     ! ... now changing color spectrum
+! set color spectrum to a gray scale
+
+! Description:  An obsolete tool equivalent to "PALETTE greyscale"
+
+ppl shaset spectrum=greyscale
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/rgb_rainbow.jnl b/jnls/go/rgb_rainbow.jnl
new file mode 100644
index 0000000..c574abf
--- /dev/null
+++ b/jnls/go/rgb_rainbow.jnl
@@ -0,0 +1,8 @@
+CANCEL MODE VERIFY     ! ... now changing color spectrum
+! set color spectrum to a rainbow
+
+! Description:  An obsolete tool equivalent to "PALETTE rnb"
+
+ppl shaset spectrum=rnb
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/rgb_try_em.jnl b/jnls/go/rgb_try_em.jnl
new file mode 100644
index 0000000..e38ed44
--- /dev/null
+++ b/jnls/go/rgb_try_em.jnl
@@ -0,0 +1,8 @@
+cancel mode verify	! cycle through the pre-defined spectra
+
+! Description: An obsolete routine to cycle through 3 spectra
+
+ppl shaset spectrum=saz2
+ppl shaset
+ppl shaset spectrum=rnb
+set mode/last verify
diff --git a/jnls/go/right_axis_plot.jnl b/jnls/go/right_axis_plot.jnl
new file mode 100644
index 0000000..df8e588
--- /dev/null
+++ b/jnls/go/right_axis_plot.jnl
@@ -0,0 +1,63 @@
+\cancel mode verify
+! right_yaxis_plot.jnl
+
+! Description: Overlay a plot of one variable using an axis on the right
+
+! Overlay a second variable on a plot placing the vertical axis on the right
+! The routine left_axis_plot should be used before this.
+
+!  *acm* 6/19/2000 fix bug in aline call as suggested by M.Verschell
+
+! usage:
+!   yes? GO right_yaxis_plot expression_to_plot [scale] [key] [hgt] [args]
+
+! 1		exprn - FERRET expression to be plotted
+! 2 optional:   scale - "low,high,delta" in quotes for axis scaling
+! 3 optional:	key - title string documenting the variable to be plotted
+! 4 optional:	hgt - PLOT+ character height for key string [default 0.12]
+! 5 optional:	"args" specifies all other %yaxis options [",,,,,(1PG10.3)"]
+!		(see PLOT+ Users' Guide, chapter 10)
+
+!  example: temp and salt on same plot
+!	yes? SET REGION/L=0:500
+!	yes? GO left_axis_plot temp
+!	yes? GO right_axis_plot salt
+!  or (for example)
+!  GO right_axis_plot salt "33,36,0.5" "My Salinity" 0.25 ",2,,+1,.13,(I2)"
+
+! initialize  (FERRET initializes PLOT+ through "plot/set")
+plot/set $1
+ppl title
+ppl labs
+ppl set axov_midpoint 'ppl$ylen' / 2.0
+ppl set axov_ylabpos 'axov_midpoint' - 0.5
+ppl set axov_xlabpos 'ppl$xlen' + 0.65
+ppl set axov_aline_start 'axov_midpoint' - 2.2
+ppl set axov_aline_end 'axov_midpoint' - 0.7
+ppl set axov_aline_xpos  'ppl$xlen' + 0.7
+
+! always a red line
+ppl pen 1,2
+
+! use this labelling scheme to get good black and white hard copy
+ppl ylab
+ppl labs/nouser 1,'axov_xlabpos','axov_ylabpos',+1 $3"@AS'labtit'"
+ppl hlabs 1,$4"0.12"
+ppl rlabs 1,-90
+
+! lay on the new axis
+ppl %range 'PPL$YMIN1','PPL$YMAX1',10
+ppl %yaxis/nouser $2"'ppl$range_low','ppl$range_high','ppl$range_inc'",'ppl$xlen',$5",,,+1,,(1PG10.3)"
+
+! draw the plot
+ppl window off
+ppl plot/over
+! set up the line specimen
+ppl aline/nouser 1,'axov_aline_xpos','axov_aline_start','axov_aline_xpos','axov_aline_end'
+
+! clean up
+ppl window on
+ppl axset 1,1,1,1
+ppl rlabs 1,0
+ppl pen 1,1
+set mode/last verify
diff --git a/jnls/go/scalemark.jnl b/jnls/go/scalemark.jnl
new file mode 100644
index 0000000..74bdec5
--- /dev/null
+++ b/jnls/go/scalemark.jnl
@@ -0,0 +1,101 @@
+\cancel mode verify
+! scalemark.jnl
+! 6/99 *sh*
+
+! Description: Plot an "I beam" documenting a scale on a plot
+
+! This script is particularly designed to be a companion for trackplot.jnl
+! See trackplot_demo for examples.
+
+! Usage:              $1   $2     $3     $4     $5        $6         $7        $8
+! yes?  GO scalemark xloc yloc [value] [user] [label] [units/in] [baseline] [line no.] 
+! $1 - X coordinate of the lower left hand corner of the scale marker
+! $2 - Y coordinate of the lower left hand corner of the scale marker
+! $3 - [optional] magnitude (range) in data units to be shown by the scale.
+!		Default = 1
+! $4 - [optional] If "user" then coordinates are in "user units".
+!		Default = coords in inches 
+! $5 - [optional] label to be written at center of scale.
+!		Default = magnitude as text
+! $6 - [optional] units/inch to be shown by scale
+!		Default normally pre-set by the trackplot command
+! $7 - [optional] baseline (a.k.a. offset) of variable plotted
+!		(e.g. value represented by plot crossing the trackline)
+!		Default =  normally pre-set by the trackplot command
+! $8 - [optional] line number (style) to match on the screen.
+!		Default = 1 (use if one line was drawn in the last plot command)
+
+! example
+! Define synthetic data
+!       yes? LET xpts = 230 - L[L=1:80]
+!       yes? LET ypts = 30 + 20*SIN(L[L=1:80]/30)
+!       yes? LET val  = RANDN(L[L=1:80])
+!
+! Draw base map
+!       yes? go basemap x=130E:120W Y=10n:60n 20
+!       yes? plot/vs/over/line/title="track" xpts, ypts
+!
+! Auto-scaled plot, then manually scaled plot
+!	yes? GO trackplot plot/vs/over/line=2/title="my data" xpts, ypts, val
+!       yes? GO scalemark 150 30 1 user
+!	yes? GO trackplot plot/vs/over/line=4/title="scaled" xpts, ypts, val 3
+!	yes? GO scalemark 0.5 6.2 2 nouser "2 units"
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO scalemark xloc yloc [value] ["user"] [label] [units/in] [line no.]"
+QUERY/IGNORE $2"<usage: yes? GO scalemark xloc yloc [value] ["user"] [label] [units/in] [line no.]"
+
+! set default argument values
+LET/QUIET SMKmagnitude = $3"1"
+IF $6"0|*>1" THEN
+   LET/QUIET SMKunitsperinch = $6
+ELSE
+   LET/QUIET SMKunitsperinch = ($TRACKPLOTscale"1")  
+ENDIF
+IF $5"0|*>1" THEN
+   DEFINE SYMBOL SMKlabel = $5
+ELSE
+   DEFINE SYMBOL SMKlabel = `SMKmagnitude`
+ENDIF
+IF $7"0|*>1" THEN
+   LET/QUIET SMKoffset = $7
+ELSE
+   LET/QUIET SMKoffset =  ($TRACKPLOToffset"0")
+ENDIF
+LET/QUIET SMKline = $8"1"
+
+! size of label text (inches)
+LET/QUIET SMKtxt_size = 0.1
+
+! draw the scale mark
+IF  $4"0|USER>1|*>0"  THEN
+! using user units (typ. lat/lon degrees)
+   LET/QUIET SMKhsize = 0.01 * (($xaxis_max)-(($xaxis_min)))		! horizontal size
+   LET/QUIET SMKmap_yscale =   (($yaxis_max)-(($yaxis_min)))/ ($ppl$ylen)  ! degrees/inch
+   LET/QUIET SMKvsize =  SMKmap_yscale * SMKmagnitude/SMKunitsperinch	! vertical   size
+! ... I-beam
+   PPL ALINE `SMKline`,$1,$2,`$1+SMKhsize*2`,$2				 ! bottom
+   PPL ALINE `SMKline`,`$1+SMKhsize`,$2,`$1+SMKhsize`,`$2+SMKvsize`
+   PPL ALINE `SMKline`,`$1+SMKhsize*0.5`,`$2+SMKvsize`,`$1+SMKhsize*1.5`,`$2+SMKvsize` ! top
+! ... labels
+   LET/QUIET SMKtxt_height = SMKtxt_size * SMKmap_yscale
+   LABEL `$1+SMKhsize*2.1`,`$2+SMKvsize/2-SMKtxt_height/2`,-1,0,`SMKtxt_size` "($SMKlabel)"
+   LABEL `$1+SMKhsize*2.4`,`$2-SMKtxt_height*0.4`,-1,0,`SMKtxt_size*0.8` "`SMKoffset`"
+
+ELSE
+! using inches
+   LET/QUIET SMKhsize = 0.01 * ($ppl$xlen)		! horizontal size
+   LET/QUIET SMKvsize = SMKmagnitude/SMKunitsperinch	! vertical   size
+! ... I-beam
+   PPL ALINE/NOUSER `SMKline`,$1,$2,`$1+SMKhsize*2`,$2				 ! bottom
+   PPL ALINE/NOUSER `SMKline`,`$1+SMKhsize`,$2,`$1+SMKhsize`,`$2+SMKvsize`
+   PPL ALINE/NOUSER `SMKline`,`$1+SMKhsize*0.5`,`$2+SMKvsize`,`$1+SMKhsize*1.5`,`$2+SMKvsize` ! top
+! ... labels
+   LABEL/NOUSER `$1+SMKhsize*2.1`,`$2+SMKvsize/2-SMKtxt_size/2`,-1,0,`SMKtxt_size` "($SMKlabel)"
+   LABEL/NOUSER `$1+SMKhsize*2.5`,`$2-SMKtxt_size*0.4`,-1,0,`SMKtxt_size*0.8`  "`SMKoffset`"
+ENDIF
+
+! clean up
+cancel symbol SMK*
+cancel variable SMK*
+set mode/last verify
diff --git a/jnls/go/scattered_vectors.jnl b/jnls/go/scattered_vectors.jnl
new file mode 100644
index 0000000..583756a
--- /dev/null
+++ b/jnls/go/scattered_vectors.jnl
@@ -0,0 +1,165 @@
+\cancel mode verify
+! scattered_vectors.jnl
+! 4/94
+! updated 9/96 for Ferret V4.4 - use symbols to grab plot state
+
+! Description: Scattered vector plot from ASCII file: x,y,u,v
+
+! The final record of the file should be 0,0,0,0 (else the final vector
+! will not be plotted)
+
+! Usage:
+
+!	GO scattered_vectors filename haf_inch_value ["clock"] ["stick"]
+! 1 filename       - the ASCII fie containing the 4-tuple data
+! 2 haf_inch_value - the scale value - value of a 1/2 inch vector
+! 3 arrow center   - "clock" for clock-hand vectors or "centered" [default]
+! 4 arrow head     - "stick" for no head or "head" [default]
+
+! Example:
+!	see "centered_vectors.jnl" for a usage example
+
+! Note: This procedure will grab the plot state from PLOT+ so that plot state
+!	must already exist.  If this procedure is used to generate an overlay
+!	there will be no problem.  If this procedure is used to generate
+!	a new plot and the information in PLOT+ (PPL LISTSYM) is not
+!	applicable then the PLOT+ variables below must be defined before
+!	using this procedure:
+!	yes? PPL SET PPL$XLEN  (X axis length)
+!	yes? PPL SET PPL$YLEN  (Y axis length)
+!	yes? PPL SET PPL$XMIN  (X axis starting value)
+!	yes? PPL SET PPL$XMAX  (X axis maximum value)
+!	yes? PPL SET PPL$YMIN  (Y axis starting value)
+!	yes? PPL SET PPL$YMAX  (Y axis maximum value)
+
+! check for required filename and haf_inch_value and valid style
+QUERY/IGNORE $1%<Usage: GO scattered_vectors filename haf_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $2%<Usage: GO scattered_vectors filename haf_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $3%centered|centered|clock|center|<Usage: GO scattered_vectors filename haf_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $4%head|stick|head|<Usage: GO scattered_vectors filename haf_inch_value ["clock"] ["stick"]%
+
+! plot size and scale characteristics
+LET/QUIET haf_inch_value = $2
+
+! choice of vector centering: see below
+LET/QUIET clock=$3"0|centered>0|center>0|clock>1"
+
+! choice of whether to include  arrow heads
+LET/QUIET arrow_head = $4"1|stick>0|head>1"
+
+! read the vector-quadruples in as a line of data 
+! (20480 pts max in default grid)
+SET DATA/save       ! to restore original data set
+FILE/VAR=xp,yp,uvar,vvar $1
+
+! replicate the points x 7 by regridding to an axis from 4/7 to n+3/7 by 1/7
+! then delete all except the middle point in each group of seven
+! then re-fill the other 6 by replication
+DEFINE AXIS/X=.57142857:10000:.14285714    axtimes7  ! 4/7:big:1/7
+DEFINE GRID/X=axtimes7 gtimes7
+LET/QUIET mid7mask = IF MOD(i[g=gtimes7],7) EQ 4 THEN 1
+LET/QUIET xp7_mid7   = mid7mask * xp[G=gtimes7]
+LET/QUIET yp7_mid7   = mid7mask * yp[G=gtimes7]
+LET/QUIET u7_mid7 = mid7mask * uvar[G=gtimes7]
+LET/QUIET v7_mid7 = mid7mask * vvar[G=gtimes7]
+LET/QUIET xp7   = xp7_mid7[x=@FNR]
+LET/QUIET yp7   = yp7_mid7[x=@FNR]
+LET/QUIET u7_9999 = u7_mid7[x=@FNR]
+LET/QUIET v7_9999 = v7_mid7[x=@FNR]
+LET/QUIET u7 = IF u7_9999 NE (-9999) THEN u7_9999 ! screen out REAL missing data
+LET/QUIET v7 = IF v7_9999 NE (-9999) THEN v7_9999
+
+! capture the current scaling information about the plot
+! This block of code will define 4 variables {horiz,vert}_{inch,degree}_span
+LET/QUIET horiz_inch_span = ($PPL$XLEN)
+LET/QUIET vert_inch_span = ($PPL$YLEN)
+LET/QUIET horiz_degree_span = ($PPL$XMAX) - ($PPL$XMIN)
+LET/QUIET vert_degree_span  = ($PPL$YMAX) - ($PPL$YMIN)
+
+! Define the region "aros" to be the number of points x7
+DEFINE REGION/DEFAULT save
+CANCEL REGION/X
+LIST/NOHEAD/APPEND/FORMAT=("DEFINE REGION/I=1:",1PG11.6," aros")/FILE=vector_commands.jnl (xp[i=@ngd]-1)*7   ! -2 to skip blank records
+GO vector_commands.jnl
+SET REGION save     ! restore original region
+sp rm -f vector_commands.jnl     ! clean up
+
+! define the transformations to go from user units (e.g. cm/sec) to plot
+! coordinates (i.e. degrees) with inches as an intermediate
+! xscale is units/inch on the X axis
+! yscale is units/inch on the Y axis
+! rot_fact is the non-uniformity of scaling, yscale/xscale
+! arrow_scale is the requested scaling, inches/user unit
+! u,v, the components in user units; ui,vi, the components in inches
+! ud,vd, the components in degrees, then
+! we want:
+! 	EQN 1) arrow_scale*SQRT(u^2+v^2) = SQRT(ui^2+vi^2)
+! 	EQN 2) ui/vi = rot_fact * u/v
+! if we combine (1) and (2) letting ui=A*u and vi=B*v we get
+! 	B = arrow_scale * SQRT(1+(v/u)^2))/SQRT(rot_fact^2 * (v/u)^2)
+! 	A = rot_fact*B
+LET/QUIET xscale = horiz_degree_span/horiz_inch_span
+LET/QUIET yscale = vert_degree_span / vert_inch_span
+LET/QUIET rot_fact = yscale/xscale
+LET/QUIET arrow_scale = 0.5 / haf_inch_value
+LET/QUIET arrow_slope = v7/u7
+LET/QUIET vcorectn = arrow_scale*((1+arrow_slope^2)/(rot_fact^2+arrow_slope^2))^0.5
+LET/QUIET ucorectn = rot_fact * vcorectn
+LET/QUIET ui7 = IF u7 EQ 0 THEN 0              ELSE ucorectn*u7
+LET/QUIET vi7 = IF u7 EQ 0 THEN arrow_scale*v7 ELSE vcorectn*v7
+LET/QUIET ud7 = xscale * ui7
+LET/QUIET vd7 = yscale * vi7
+
+! define the size for the vector arrow heads
+! note: the variables arrow_head_len_{x,y} and arrow_head_wid_{r,l} define
+!       the sizes of the arrow heads relative to the vector length.  An
+! 	absolute size (in units of degrees) could be substituted
+LET/QUIET arrow_head_len_x = 0.2 * ui7
+LET/QUIET arrow_head_len_y = 0.2 * vi7
+LET/QUIET arrow_head_wid_r = 0.05 * vi7    ! half width
+LET/QUIET arrow_head_wid_l = 0.05 * ui7    ! half width
+
+! define the 7 points of each vector
+! P1 vector start point
+! P2 vector end point (arrow head end)
+! P3 pen up (missing)
+! P4 right limb of arrow head
+! P5 vector end point (repeated)
+! P6 left limb of arrow head
+! P7 pen up (missing)
+! clock-style   arrows have the shaft end      at the data point
+! compass-style arrows have the shaft midpoint at the data point
+LET/QUIET arrow_start_x = IF clock EQ 1 THEN xp7/xscale ELSE xp7/xscale - ui7/2
+LET/QUIET arrow_start_y = IF clock EQ 1 THEN yp7/yscale ELSE yp7/yscale - vi7/2
+LET/QUIET arrow_end_x = arrow_start_x + ui7		! end point, P2&P5
+LET/QUIET arrow_end_y = arrow_start_y + vi7		! end point, P2&P5
+LET/QUIET arrow_left_x = IF (arrow_head) THEN arrow_end_x - arrow_head_len_x - arrow_head_wid_r  !P4
+LET/QUIET arrow_left_y = arrow_end_y - arrow_head_len_y + arrow_head_wid_l
+LET/QUIET arrow_right_x = IF (arrow_head) THEN arrow_end_x - arrow_head_len_x + arrow_head_wid_r !P6
+LET/QUIET arrow_right_y = arrow_end_y - arrow_head_len_y - arrow_head_wid_l
+
+! create an ordered sequence of points for each vector with pen-up's included
+LET/QUIET arrow_index = MOD(i[g=gtimes7]-1,7) + 1
+LET/QUIET ap1x = IF arrow_index EQ 1 THEN arrow_start_x
+LET/QUIET ap2x = IF arrow_index EQ 2 THEN arrow_end_x
+LET/QUIET ap4x = IF arrow_index EQ 4 THEN arrow_left_x
+LET/QUIET ap5x = IF arrow_index EQ 5 THEN arrow_end_x
+LET/QUIET ap6x = IF arrow_index EQ 6 THEN arrow_right_x
+LET/QUIET arrow_x = MISSING(ap1x,MISSING(ap2x,MISSING(ap4x,MISSING(ap5x,ap6x)))) * xscale
+LET/QUIET ap1y = IF arrow_index EQ 1 THEN arrow_start_y
+LET/QUIET ap2y = IF arrow_index EQ 2 THEN arrow_end_y
+LET/QUIET ap4y = IF arrow_index EQ 4 THEN arrow_left_y
+LET/QUIET ap5y = IF arrow_index EQ 5 THEN arrow_end_y
+LET/QUIET ap6y = IF arrow_index EQ 6 THEN arrow_right_y
+LET/QUIET arrow_y = MISSING(ap1y,MISSING(ap2y,MISSING(ap4y,MISSING(ap5y,ap6y)))) * yscale
+
+! display the answer
+!SAY
+!SAY Variables are defined appropriately for a plot of
+!list/nohead/format=(8X,"X axis length = ",F5.2,";  Y axis length = ",F5.2) horiz_inch_span,vert_inch_span
+!list/nohead/format=(8X,"X data span = ",F7.2,";  Y data span = ",F7.2) horiz_degree_span,vert_degree_span
+!SAY Cut and hack this command for your custom vectors:
+SAY  >> PLOT/VS/LINE/D=$1/@aros/OVERLAY arrow_x,arrow_y <<
+
+set data/restore
+set mode/last verify
diff --git a/jnls/go/set_aspect.jnl b/jnls/go/set_aspect.jnl
new file mode 100644
index 0000000..bfc3e98
--- /dev/null
+++ b/jnls/go/set_aspect.jnl
@@ -0,0 +1,45 @@
+\cancel mode verify	
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! set_aspect.jnl --  Adjust the window aspect ratio for the currently
+!                    displayed plot.
+!		    		
+! Ansley Manke 10/2005
+! (see mp_aspect.jnl)
+!
+! Description:  Calculate the appropriate aspect ratio for an x-y plot
+!
+! Usage:             arg1
+!  go mp_aspect [aspect action]
+!
+! arg 1 - action to take after calculating the appropriate aspect ratio
+!         LIST - print out appropriate aspect ratio
+!         1(default) - issue SET WIN/ASPECT=`aspect_ratio`:ax command
+
+! Example 1: basic gridded field
+!
+!  use coads_climatology 
+!  set region/x=140:240/y=40n:70n/l=1
+!  set grid sst
+!  go set_aspect
+!  shade sst[l=1]
+!
+
+let/quiet ASP_xx = x
+let/quiet ASP_yy = y
+let/quiet ASP_xb = xbox
+let/quiet ASP_yb = ybox
+let/quiet x_axis_range = `ASP_xx[i=@max] - ASP_xx[i=@min] + ASP_xb[i=@min]/2 + ASP_xb[i=@max]/2`
+let/quiet y_axis_range = `ASP_yy[j=@max] - ASP_yy[j=@min] + ASP_yb[j=@min]/2 + ASP_yb[j=@max]/2`
+
+let/quiet y_over_x = y_axis_range / x_axis_range
+
+if `$1"1|PRINT>0|LIST>0|SHOW>0|DISPLAY>0|<'go mp_aspect LIST' to display the ratio without setting it" eq 0` then
+    message/cont The appropriate aspect ratio is `y_over_x`
+elif `$1"1|PRINT>0|LIST>0|SHOW>0|DISPLAY>0|<'go mp_aspect LIST' to display the ratio without setting it" eq 1` then
+    set win/aspect=`y_over_x`:axis
+endif
+
+can var ASP_*
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+set mode/last verify
diff --git a/jnls/go/set_pixel_size.jnl b/jnls/go/set_pixel_size.jnl
new file mode 100644
index 0000000..ebeb948
--- /dev/null
+++ b/jnls/go/set_pixel_size.jnl
@@ -0,0 +1,40 @@
+\cancel mode verify
+! set_pixel_size.jnl
+! 6/98 *sh*
+!
+! Description: set the size of the output window in pixels
+!
+! usage:                     arg1  arg2     arg3       arg4
+!         GO set_pixel_size xsize ysize [default_x] [default_y]
+!
+! example:
+!	yes? GO set_pixel_size 600 400
+! or
+!       yes? GO set_pixel_size 600 400 781 674
+!
+! xsize - desired window width  in pixels
+! ysize - desired window height in pixels
+! default_x - the width  of the default window in pixels 
+! default_y - the height of the default window in pixels 
+!
+! Since Ferret graphics are "device independent" its window sizes are
+! internally measured as fractions of the screen size. Thus, the
+! "default" size (size of the first plot where no SET WINDOW commands
+! have been issued) depends on the resolution of the screen being used
+!
+! Since Ferret sets sizes in floating point units integer roundoff
+! may cause this script to miss the desired size by +/- 1 pixel on either
+! or both axes. After running this script, execute
+!     yes? GO ptest
+!     yes? say ($ppl$xpixel), ($ppl$ypixel)
+! to see the actual size and adjust the arguments accordingly
+!
+! check validity of arguments (first two args are mandatory)
+query/ignore $1"<Usage: GO set_pixel_size xsize ysize [default_x] [default_y]"
+query/ignore $2"<Usage: GO set_pixel_size xsize ysize [default_x] [default_y]"
+!
+! set the aspect ratio
+SET WINDOW/ASPECT=`$2/$1`
+!
+! set window size. Note that the default window has a size of .7
+SET WINDOW/SIZE= `(($1 * $2) / ($3"781" * $4"674")) * .7`
diff --git a/jnls/go/setup_text.jnl b/jnls/go/setup_text.jnl
new file mode 100644
index 0000000..d2a46ff
--- /dev/null
+++ b/jnls/go/setup_text.jnl
@@ -0,0 +1,36 @@
+\ cancel mode verify
+! setup_text.jnl  (4/93)  updated 11/93 to use vp_width/height
+
+! Description: set up FERRET and PLOT+ to layout text easily
+
+! this block of code sets up PLOT+ to draw a blank screen
+! the X and Y axes are scaled from zero to one across the full window
+! or viewport
+
+! use this procedure as follows:
+!
+!	GO setup_text
+
+!	ppl labset,,,,default_label_size
+!	ppl labs 1,xposition,yposition,justify  "Text with fonts"
+!	ppl labs 2,xposition,yposition,justify  "Text with fonts"
+!		 .
+!		 .
+!		 .
+!	ppl plot       ! writes the text
+
+! optional:  (use /line= to control color)
+!	plot/over/nolab/vs/i=1:2 (i-1),(i-i)+yvalue  ! a horizontal line 
+! optional:  (use /line= to control color)
+!	plot/over/nolab/vs/i=1:2 (i-i)+xvalue,(i-1)  ! a vertical line 
+
+!	GO cleanup_text     ! restore normal FERRET graphics
+
+plot/set/nolab/i=1:2 i-i-99   ! -99's
+ppl labs; ppl title; ppl xlab; ppl ylab
+ppl axset 0,0,0,0
+ppl origin 0,0
+ppl yaxis 0,1,1; ppl xaxis 0,1,1
+ppl axlen 'VP_WIDTH','VP_HEIGHT'
+
+set mode/last verify
diff --git a/jnls/go/show_88_syms.jnl b/jnls/go/show_88_syms.jnl
new file mode 100644
index 0000000..d066ebc
--- /dev/null
+++ b/jnls/go/show_88_syms.jnl
@@ -0,0 +1,116 @@
+cancel mode verify
+! show_88_syms.jnl
+! Description: display all possible PLOT+ marks (usable in by PLOT/SYMBOL=)
+
+message/cont ...
+message/cont Now displaying all 88 PLOT+ plotting symbols ...
+message/cont ...
+
+plot/vs/set/nolab/symbol=1 1,0
+ppl xaxis -1 10 1
+ppl yaxis -1 9 1
+ppl axlint 1 1
+ppl xfor (i3)
+ppl yfor (i3)
+ppl title 0.15, Symbol choices in PLOT/SYMBOL=value ... e.g. 35 is z, 36 is Z
+ppl markh 1,.2
+ppl plot
+
+plot/vs/nolab/over/symbol=2  2,0
+plot/vs/nolab/over/symbol=3  3,0
+plot/vs/nolab/over/symbol=4  4,0
+plot/vs/nolab/over/symbol=5  5,0
+plot/vs/nolab/over/symbol=6  6,0
+plot/vs/nolab/over/symbol=7  7,0
+plot/vs/nolab/over/symbol=8  8,0
+plot/vs/nolab/over/symbol=9  9,0
+plot/vs/nolab/over/symbol=10 0,1
+
+plot/vs/nolab/over/symbol=11 1,1
+plot/vs/nolab/over/symbol=12 2,1
+plot/vs/nolab/over/symbol=13 3,1
+plot/vs/nolab/over/symbol=14 4,1
+plot/vs/nolab/over/symbol=15 5,1
+plot/vs/nolab/over/symbol=16 6,1
+plot/vs/nolab/over/symbol=17 7,1
+plot/vs/nolab/over/symbol=18 8,1
+plot/vs/nolab/over/symbol=19 9,1
+plot/vs/nolab/over/symbol=20 0,2
+
+plot/vs/nolab/over/symbol=21 1,2
+plot/vs/nolab/over/symbol=22 2,2
+plot/vs/nolab/over/symbol=23 3,2
+plot/vs/nolab/over/symbol=24 4,2
+plot/vs/nolab/over/symbol=25 5,2
+plot/vs/nolab/over/symbol=26 6,2
+plot/vs/nolab/over/symbol=27 7,2
+plot/vs/nolab/over/symbol=28 8,2
+plot/vs/nolab/over/symbol=29 9,2
+plot/vs/nolab/over/symbol=30 0,3
+
+plot/vs/nolab/over/symbol=31 1,3
+plot/vs/nolab/over/symbol=32 2,3
+plot/vs/nolab/over/symbol=33 3,3
+plot/vs/nolab/over/symbol=34 4,3
+plot/vs/nolab/over/symbol=35 5,3
+plot/vs/nolab/over/symbol=36 6,3
+plot/vs/nolab/over/symbol=37 7,3
+plot/vs/nolab/over/symbol=38 8,3
+plot/vs/nolab/over/symbol=39 9,3
+plot/vs/nolab/over/symbol=40 0,4
+
+plot/vs/nolab/over/symbol=41 1,4
+plot/vs/nolab/over/symbol=42 2,4
+plot/vs/nolab/over/symbol=43 3,4
+plot/vs/nolab/over/symbol=44 4,4
+plot/vs/nolab/over/symbol=45 5,4
+plot/vs/nolab/over/symbol=46 6,4
+plot/vs/nolab/over/symbol=47 7,4
+plot/vs/nolab/over/symbol=48 8,4
+plot/vs/nolab/over/symbol=49 9,4
+plot/vs/nolab/over/symbol=50 0,5
+
+plot/vs/nolab/over/symbol=51 1,5
+plot/vs/nolab/over/symbol=52 2,5
+plot/vs/nolab/over/symbol=53 3,5
+plot/vs/nolab/over/symbol=54 4,5
+plot/vs/nolab/over/symbol=55 5,5
+plot/vs/nolab/over/symbol=56 6,5
+plot/vs/nolab/over/symbol=57 7,5
+plot/vs/nolab/over/symbol=58 8,5
+plot/vs/nolab/over/symbol=59 9,5
+plot/vs/nolab/over/symbol=60 0,6
+
+plot/vs/nolab/over/symbol=61 1,6
+plot/vs/nolab/over/symbol=62 2,6
+plot/vs/nolab/over/symbol=63 3,6
+plot/vs/nolab/over/symbol=64 4,6
+plot/vs/nolab/over/symbol=65 5,6
+plot/vs/nolab/over/symbol=66 6,6
+plot/vs/nolab/over/symbol=67 7,6
+plot/vs/nolab/over/symbol=68 8,6
+plot/vs/nolab/over/symbol=69 9,6
+plot/vs/nolab/over/symbol=70 0,7
+
+plot/vs/nolab/over/symbol=71 1,7
+plot/vs/nolab/over/symbol=72 2,7
+plot/vs/nolab/over/symbol=73 3,7
+plot/vs/nolab/over/symbol=74 4,7
+plot/vs/nolab/over/symbol=75 5,7
+plot/vs/nolab/over/symbol=76 6,7
+plot/vs/nolab/over/symbol=77 7,7
+plot/vs/nolab/over/symbol=78 8,7
+plot/vs/nolab/over/symbol=79 9,7
+plot/vs/nolab/over/symbol=80 0,8
+
+plot/vs/nolab/over/symbol=81 1,8
+plot/vs/nolab/over/symbol=82 2,8
+plot/vs/nolab/over/symbol=83 3,8
+plot/vs/nolab/over/symbol=84 4,8
+plot/vs/nolab/over/symbol=85 5,8
+plot/vs/nolab/over/symbol=86 6,8
+plot/vs/nolab/over/symbol=87 7,8
+plot/vs/nolab/over/symbol=88 8,8
+
+ppl markh 1,.08    ! return to default
+set mode/last verify
\ No newline at end of file
diff --git a/jnls/go/show_symbols.jnl b/jnls/go/show_symbols.jnl
new file mode 100644
index 0000000..6984abf
--- /dev/null
+++ b/jnls/go/show_symbols.jnl
@@ -0,0 +1,29 @@
+cancel mode verify
+! show_symbols.jnl
+
+! Description: display the PLOT+ marks used by the FERRET PLOT command
+
+message/cont ...
+message/cont Now displaying a plot with the default symbol types ...
+message/cont Alternatively, the syntax /SYMBOL=57 will select PLOT+ symbol
+message/cont number 57 of a possible 88 choices.
+message/cont To see all possible symbols use     GO show_88_syms
+message/cont ...
+
+let line_zero = i-i
+plot/set/nolab/i=1:2/symbol line_zero+1
+ppl xaxis .9 1.9 1
+ppl yaxis 0 18 1
+ppl axlint 1 1
+ppl xfor (i3)
+ppl yfor (i3)
+ppl xlab
+ppl axset 0,0,1,0
+ppl title "FERRET symbols automatically selected by PLOT/SYMBOL"
+ppl markh 1,.2
+ppl plot
+repeat/j=2:17:1 plot/over/nolab/i=1:10/symbol line_zero+j
+
+ppl markh 1,.08
+ppl axset 1,1,1,1
+set mode/last verify
\ No newline at end of file
diff --git a/jnls/go/split_z.jnl b/jnls/go/split_z.jnl
new file mode 100644
index 0000000..39c88c5
--- /dev/null
+++ b/jnls/go/split_z.jnl
@@ -0,0 +1,92 @@
+\cancel mode verify
+! split_z.jnl
+! 10/95 - based on a script submitted by Joachim Dengg
+! Description: make a CONTOUR,SHADE, or FILL plot with a split vertical axis
+! producing a "magnified" view of the near-surface waters
+
+! 7/01 *acm* update /xlimits and /ylimits  to /hlimits and /vlimits
+
+! usage:	       $1       $2    $3  $4  $5   $6     $7
+!   yes? GO split_z command  qualifs var top mid bottom split
+! $1 - the plot command (SHADE,FILL or CONT)  (default, "FILL")
+! $2 - qualifiers to the plot command - /LEVELS and /PALETTE (default, none)
+! $3 - the variable to be plotted (use quotation marks if it contains commas)
+! $4 - the depth at the      top    of the plot (default=0)
+! $5 - the depth at the split point of the plot (default=1000)
+! $6 - the depth at the    bottom   of the plot (default=5000)
+! $7 - the fractio of the page given to the upper viewport (default=0.33)
+
+! example:
+!   yes? SET DATA levitus_climatology
+!   yes? SET WINDOW/ASPECT=1
+!   yes? go split_z FILL "/lev=(0,4,.5)(0,30,2)" "temp[X=160W,Y=45S:45N]" 0 500 4000 0.4
+! Note 1: a taller, thinner window looks nicer ...
+!         yes? SET WINDOW/ASPECT=1
+! Note 2: this procedure will not work in a viewport since it uses viewports
+
+! set default values and check for argument errors
+define symbol cmnd $1"FILL"
+define symbol quals $2"set_up"
+define symbol var  $3"<Usage: GO split_z cmnd quals var top mid bottom split"
+define symbol topZ $4"0"
+define symbol splitZ $5"1000"
+define symbol botZ $6"5000"
+define symbol vp_split `1-$7".33"`
+
+! clear the screen
+cancel viewports
+
+! define viewports for top and bottom panels
+! "/text=..." scales the viewports consistently
+define viewport/text=.6/y=($vp_split),1 sp_u   ! upper
+define viewport/text=.6/y=0,($vp_split) sp_l   ! lower
+
+! the upper frame with the Y axis coming right to its bottom
+set view sp_u
+define symbol upper_axlen `($ppl$yorg)+($PPL$YLEN)`
+define symbol orig_yorg ($ppl$yorg)
+ppl origin ,0
+ppl axlen ,($upper_axlen)
+(($cmnd)/($quals)/z=($topZ):($botZ)/vlimits=($topZ):($splitZ)/set_up ($var))
+ppl title   	! no title under plot
+ppl axset 1,0	! no lower axis
+ppl xlab	! no X axis label
+ppl shakey 0	! no key drawn for upper half
+ppl ($cmnd)
+ppl origin ,($orig_yorg)	! restore Y origin
+
+! the lower frame with the Y axis coming almost to its top
+set view sp_l
+define symbol axis_gap 0.15
+define symbol lower_axlen `($VP_HEIGHT)-($ppl$yorg)-($axis_gap)`
+ppl axlen ,($lower_axlen)
+(($cmnd)/($quals)/z=($topZ):($botZ)/vlimits=($splitZ):($botZ)/set_up ($var))
+ppl axset 0,1	! no upper axis
+ppl ylab	! no Y axis label on this part
+ppl labs
+
+! set up the color key
+define symbol lower_right_x `($ppl$xorg)+($ppl$xlen)`
+define symbol lower_right_y `($ppl$yorg)`
+! see "Plot Plus for Ferret Manual" for shakey description
+ppl shakey 1,1,.12,,,,`($lower_right_x)+0.3`,`($lower_right_x)+0.9`,`($lower_right_y)`,`($lower_right_y)+($lower_axlen)+($axis_gap)+($upper_axlen)`
+
+! plot the lower half and the key
+ppl ($cmnd)
+
+! clean up
+ppl axset 1,1
+cancel symbol cmnd
+cancel symbol quals
+cancel symbol var
+cancel symbol topZ
+cancel symbol splitZ
+cancel symbol botZ
+cancel symbol vp_split
+cancel symbol upper_axlen
+cancel symbol orig_yorg
+cancel symbol lower_right_x
+cancel symbol lower_right_y
+cancel symbol axis_gap
+cancel symbol lower_axlen
+set mode/last verify
diff --git a/jnls/go/squares.jnl b/jnls/go/squares.jnl
new file mode 100644
index 0000000..506791f
--- /dev/null
+++ b/jnls/go/squares.jnl
@@ -0,0 +1,8 @@
+! Ferret v3.0 *jd* 3.93/8.96
+! Description: create a filled-area test plot
+
+message/cont executing test shade
+
+! shade and fill squares
+SHADE/I=1:15/J=2:12/LEV=(3,28,2) IF MOD(I,2) EQ 0 OR MOD(J,2) EQ 1 THEN I+J-1
+
diff --git a/jnls/go/squeeze_colors.jnl b/jnls/go/squeeze_colors.jnl
new file mode 100644
index 0000000..104bf13
--- /dev/null
+++ b/jnls/go/squeeze_colors.jnl
@@ -0,0 +1,63 @@
+\cancel mode verify
+! squeeze_colors.jnl  *sh* 4/94 for Ferret V3.10
+
+! Description: Modify a palette by squeezing and stretching the color scale
+
+say For detailed instructions examine the file  $FER_DIR/go/squeeze_colors.jnl
+
+! Usage:   GO squeeze_colors old_lo old_hi new_lo new_hi [input_palette] [output_palette]
+! defaults:  input_palette = default    output_palette = squeeze
+
+! To enhance the effectiveness of color it is often desirable to concentrate
+! color contrasts at certain ranges of the data being displayed.  The full-
+! blown version of this concept is a histogram-based distortion of the color
+! mapping (which could be developed with a FERRET script - see histogram.jnl).
+! This script provides the more limited functionality: a range of the original
+! color palette from old_lo to old_hi percent will be remapped to a new range
+! extending from new_lo to new_hi.  For example, the middle 20% of the color
+! scale could be expanded to 40% using 40,60 --> 30,70.  The total range of
+! colors implied by the palette will be unchanged - only the distribution of
+! this color range along the 0-100% scale will be effected.
+
+! example: stretch the first 60 percent of colors into 80 percent of the scale
+!	yes? set data coads_climatology
+!	yes? shade/l=1/levels=(-5,35,1)/palette=rnb2 sst ! normal rnb2 palette
+!	yes? GO squeeze_colors 40 60 30 70 rnb2 rnb2_shift
+!	yes? shade/l=1/levels=(-5,35,1)/palette=rnb2_shift sst ! new palette
+
+! check that all necessary input arguments were supplied
+QUERY/IGNORE $1"<Usage:GO squeeze_colors orig_lo% orig_hi% new_lo% new_hi% [input_palette] [output_palette]"
+QUERY/IGNORE $2"<Usage:GO squeeze_colors orig_lo% orig_hi% new_lo% new_hi% [input_palette] [output_palette]"
+QUERY/IGNORE $3"<Usage:GO squeeze_colors orig_lo% orig_hi% new_lo% new_hi% [input_palette] [output_palette]"
+QUERY/IGNORE $4"<Usage:GO squeeze_colors orig_lo% orig_hi% new_lo% new_hi% [input_palette] [output_palette]"
+
+! save the users region and data set to be restored later
+define region/default husr
+set data/save
+
+! initialize
+cancel region/x
+sp rm -f $6&squeeze&.spk    ! delete old output spectrum by this name
+
+! read the specified input spectrum name (Default:$FER_PALETTE/default.spk)
+! using its "percentage" variable as the data set axis
+file/var=old_pcent,red,green,blue "$FER_PALETTE/$5&default&.spk"
+define axis/from/x/name=axin old_pcent
+define grid/x=axin  gold
+cancel data/noerr $5&default&.spk
+file/var=old_pcent,red,green,blue/grid=gold "$FER_PALETTE/$5&default&.spk"
+
+! recompute percentages to associate with RGB triples
+let/quiet new_pcent = IF old_pcent LT $1 THEN old_pcent*($3/$1) ELSE mid_pcent
+let/quiet mid_pcent = IF old_pcent LT $2 THEN (old_pcent-$1)*(($4-$3)/($2-$1)) + $3 ELSE hi_perc
+let/quiet hi_perc   = IF old_pcent LT 100 THEN (old_pcent-$2) * ((100-$4)/(100-$2)) + $4 ELSE 100
+
+! write out the squeezed spectrum
+! note: output precision restricted to 1 decimal place consistent with PLOT+ 
+list/file=$6&squeeze&.spk/nohead/format=(4F10.1) new_pcent,red,green,blue
+
+! wrap up
+cancel data/noerr $5&default&.spk
+set region husr
+set data/restore
+set mode/last verify
diff --git a/jnls/go/stack_line.jnl b/jnls/go/stack_line.jnl
new file mode 100644
index 0000000..5b1471c
--- /dev/null
+++ b/jnls/go/stack_line.jnl
@@ -0,0 +1,122 @@
+\cancel mode verify
+
+! stack_line.jnl
+! stack line plots of a variable at each depth
+! acm 6/2007
+
+! See the example in call_stack_line.jnl
+
+! go stack_line zvar [yaxmin] [yaxmax]
+
+! If arguments 2 and 3 are not specified, they are computed from the data.
+! $1 A variable to plot, defined in Z and one other dimension
+! $2 optional lower limit on Y axes for all plots
+! $3 optional upper limit on Y axes for all plots
+
+! Example 1) 
+!   yes? USE levitus_climatology
+!   yes? LET/units="Deg C" yvar = temp[x=300]
+!   yes? go stack_line yvar
+
+QUERY/IGNORE $1%<Usage: GO stack_line  var [yaxmin] [yaxmax]
+
+cancel view
+
+! Set up parameters for defining the viewports and making the plots.
+
+let zz = z[gz=$1]
+
+let ks = `zz,return=kstart`
+let ke = `zz,return=kend`
+let nz = `zz,return=ksize`
+
+let y2 = 0.9
+let del = 0.8/`nz`
+let y1 = `y2 - del` + 0.02
+
+! This viewport will be used to draw the time axis at the bottom 
+! and to label the z axes.
+
+def view/axes/xlim=0.1:0.9/ylim=0.095:0.9 tv
+
+! Define viewports for all the stacked plots.
+!
+! The rt_* viewports, one for each depth being plotted are used to plot the right-
+! hand axes giving the data range for each Z lavel.
+
+! The lf_* viewports are the same size and shape. They will be used to plot the
+! left-hand axis with the corresponding depth
+
+repeat/range=`ks`:`ke`/NAME=q (def view/axes/xlim=0.1:0.9/ylim=`y1`:`y2` rt_`q`; \
+                          def view/axes/xlim=0.1:0.9/ylim=`y1`:`y2` lf_`q`; \
+                          let y1 = `y1 - del`; let y2 = `y2 - del`)
+
+! Get the y axis range to use if not specified by the user; %range returns the
+! plot range that Ferret would automatically use.
+IF ($2"1|*>0") THEN
+!   PLOT/SET XSEQUENCE(($1))
+   ppl %RANGE `($1)[x=@min,y=@min,z=@min,t=@min]`, `($1)[x=@max,y=@max,z=@max,t=@max]`, 2
+   LET xlo = ($PPL$RANGE_LOW)
+   LET xhi = ($PPL$RANGE_HIGH)
+ELSE
+   LET xlo = ($2)
+   LET xhi = ($3)
+ENDIF
+
+! Draw the time axis by plotting a variable having no data in the vertical range.
+! Label the vertical stacks of axes in the middle.
+
+set view tv
+let/bad=9999 all_zero = if missing($1,0) then 0 else 0*$1
+plot/noy/ax=0,1,0,0/nolab/k=`ke`/vlim=100:200 all_zero 
+
+label/nouser `($ppl$xlen)/2`,-0.6, 0, 0, 0.14 "`$1,return=title`"
+label/nouser -0.6, `($ppl$ylen)/2`, 0, 90, 0.12 "Depth (`$1,return=zunits`)"
+label/nouser `($ppl$xlen)+0.4`, `($ppl$ylen)/2`, 0, 90, 0.12 "Each line, `xlo` - `xhi` (`$1,return=units`)"
+
+! This label on the right, is replaced by making a key at the bottom.
+!label/nouser `($ppl$xlen)+0.7`, `($ppl$ylen)/2`, 0, 90, 0.12 "`$1,return=units`"
+
+! Draw a plot for each series, labelling on the left with the depth.
+
+! Put most of the labels on , except for the title, depth, and yaxis label.
+
+set view lf_`ks`
+PPL tics,0,0,0,0
+PPL axlsze,0,0
+PLOT/SET_UP/NOY/AXES=0,0,1,0/NOLAB/COLOR=white/k=`ks` $1*0
+PPL PLOT
+LET zlab = zz[k=`ks`]
+LABEL/NOUSER `-1*0.1*($ppl$xorg)`, `($ppl$ylen)/2`, 1, 0, 0.12, "`zlab`"
+PPL TICS,.125,.25,.125,.25
+PPL AXLINT,2,2
+PPL AXLSZE,0.1,0.1
+PPL AXATIC 5,5
+
+SET VIEW rt_`ks`
+CANCEL MODE logo
+! Unlabel 1 removes the depth label...
+PLOT/NOY/K=`ks`/AXES=0,0,0,1/VLIMITS=`xlo`:`xhi`/TITLE=" "/SET $1
+   GO unlabel ($labnum_z)
+   PPL YAXIS `xlo` `xhi` `(xhi-xlo)/4`
+   PPL TICS,0,0,0,0
+   PPL AXLSZE,0,0
+   PPL YLAB " "
+PPL PLOT
+
+REPEAT/RANGE=`ks+1`:`ke`/NAME=q (  SET VIEW lf_`q`; \
+   PPL TICS,0,0,0,0; PPL AXLSZE,0,0; \
+     PLOT/SET_UP/NOY/AXES=0,0,1,0/NOLAB/COLOR=WHITE/K=`ks` $1*0; \
+     PPL PLOT; \
+   LET zlab = zz[k=`q`]; \
+   LABEL/NOUSER `-1*0.1*($ppl$xorg)`, `($ppl$ylen)/2`, 1, 0, 0.12, "`zlab`"; \
+   PPL TICS,.125,.25,.125,.25; \ 
+   PPL AXLINT,2,2; \
+   PPL AXLSZE,0.1,0.1; \
+   PPL AXATIC 5,5;\
+   ; \
+   SET VIEW rt_`q`; \
+   PLOT/NOY/K=`q`/AXES=0,0,0,1/VLIMITS=`xlo`:`xhi`/NOLAB/SET $1; \
+     PPL YAXIS `xlo` `xhi` `(xhi-xlo)/4` ;  PPL TICS,0,0,0,0; PPL AXLSZE,0,0; PPL PLOT) 
+
+SET MODE/LAST verify
diff --git a/jnls/go/stack_stick.jnl b/jnls/go/stack_stick.jnl
new file mode 100644
index 0000000..1afbb85
--- /dev/null
+++ b/jnls/go/stack_stick.jnl
@@ -0,0 +1,143 @@
+\cancel mode verify
+
+! stack_stick.jnl
+! stack plot of stick vector plots at each depth
+! acm 7/2005
+
+! See the example in call_stack_stick.jnl
+
+! go stack_stick uvar vvar yaxmin yaxmax
+! Arguments 3 and 4 are required, so we can draw a single key for 
+! the length of a standard vector at the bottom.
+
+! $1 U component  -- Depends only on Z and one other dimension
+! $2 V component  -- Depends only on Z and one other dimension
+! $3 lower limit on Y axes for all plots
+! $4 upper limit on Y axes for all plots
+
+QUERY/IGNORE $1%<Usage: GO stack_stick  U V yaxmin yaxmax
+QUERY/IGNORE $2%<Usage: GO stack_stick  U V yaxmin yaxmax
+QUERY/IGNORE $3%<Usage: GO stack_stick  U V yaxmin yaxmax
+QUERY/IGNORE $4%<Usage: GO stack_stick  U V yaxmin yaxmax
+
+cancel view
+
+! Set up parameters for defining the viewports and making the plots.
+
+let zz = z[gz=$1]
+
+let ks = `zz,return=kstart`
+let ke = `zz,return=kend`
+let nz = `zz,return=ksize`
+
+let y2 = 0.9
+let del = 0.8/`nz`
+let y1 = `y2 - del` + 0.02
+
+! This viewport will be used to draw the time axis at the bottom 
+! and to label the z axes.
+
+def view/axes/xlim=0.1:0.9/ylim=0.095:0.9 tv
+
+! This viewport will contain the key with the standard arrow length.
+
+def view/axes/xlim=0.:1./ylim=0.01:0.095 keyview
+
+! Define viewports for all the stacked plots.
+!
+! The rt_* viewports, one for each depth being plotted are used to plot the right-
+! hand axes giving the data range for each Z lavel.
+
+! The lf_* viewports are the same size and shape. They will be used to plot the
+! left-hand axis with the corresponding depth
+
+repeat/range=`ks`:`ke`/name=q (def view/axes/xlim=0.1:0.9/ylim=`y1`:`y2` rt_`q`; \
+                          def view/axes/xlim=0.1:0.9/ylim=`y1`:`y2` lf_`q`; \
+                          let y1 = `y1 - del`; let y2 = `y2 - del`)
+
+! Draw the time axis by plotting a variable having no data in the vertical range.
+! Label the vertical stacks of axes in the middle.
+
+set view tv
+let/bad=9999 all_zero = if missing($1,0) then 0 else 0*$1
+plot/noy/ax=0,1,0,0/nolab/k=`ke`/vlim=100:200 all_zero 
+
+label/nouser `($ppl$xlen)/2`,-0.8, 0, 0, 0.14 "`$1,return=title`   `$2,return=title`"
+label/nouser -0.6, `($ppl$ylen)/2`, 0, 90, 0.12 "Depth (`$1,return=zunits`)"
+
+! This label on the right, is replaced by making a key at the bottom.
+!label/nouser `($ppl$xlen)+0.7`, `($ppl$ylen)/2`, 0, 90, 0.12 "`$1,return=units`"
+
+
+! Draw a plot for each series, labelling on the left with the depth.
+
+
+! The PLOT and PLOTUV commands are from stick_vectors.jnl
+! set up the PLOT+ as if for a 2-line plot
+!  plot/SET_UP/noy/axes=0,0,1,0/nolab/k=1 $1, $2
+! ... but display it with the PLOTUV command
+!   PPL PLOTUV 0 1
+
+
+! Put most of the labels on , except for the title, depth, and yaxis label.
+
+set view lf_`ks`
+ppl tics,0,0,0,0
+ppl axlsze,0,0
+plot/SET_UP/noy/axes=0,0,1,0/nolab/color=white/k=`ks` $1*0
+   PPL PLOT
+let zlab = zz[k=`ks`]
+LABEL/NOUSER `-1*0.1*($ppl$xorg)`, `($ppl$ylen)/2`, 1, 0, 0.12, "`zlab`"; \
+ppl tics,.125,.25,.125,.25
+ppl axlint,2,2
+ppl axlsze,0.1,0.1
+ppl axatic 5,5
+
+set view rt_`ks`
+cancel mode logo
+! Unlabel ($labnum_z) removes the depth label...
+plot/noy/k=`ks`/axes=0,0,0,1/vlimits=$3:$4/title=" "/set $1, $2
+   go unlabel ($labnum_z)
+   ppl yaxis $3 $4 `($4-$3)/4`
+   ppl tics,0,0,0,0; ppl axlsze,0,0
+   ppl ylab " "
+PPL PLOTUV 0 1
+
+repeat/range=`ks+1`:`ke`/name=q (  set view lf_`q`; \
+   ppl tics,0,0,0,0; ppl axlsze,0,0; \
+     plot/SET_UP/noy/axes=0,0,1,0/nolab/color=white/k=`ks` $1*0; \
+     PPL PLOT; \
+   let zlab = zz[k=`q`]; \
+   LABEL/NOUSER `-1*0.1*($ppl$xorg)`, `($ppl$ylen)/2`, 1, 0, 0.12, "`zlab`"; \
+   ppl tics,.125,.25,.125,.25; \ 
+   ppl axlint,2,2; \
+   ppl axlsze,0.1,0.1; \
+   ppl axatic 5,5;\
+   ; \
+   set view rt_`q`; \
+   plot/noy/k=`q`/axes=0,0,0,1/vlimits=$3:$4/nolab/set $1, $2; \
+     ppl yaxis $3 $4 `($4-$3)/4` ;  ppl tics,0,0,0,0; ppl axlsze,0,0; PPL PLOTUV 0 1) 
+
+
+! Make a key: a stick of the length of half the vertical axis; labelled with
+! the length of the corresponding vector.
+
+let sticklen = `(($yaxis_max) - ($yaxis_min))/2`  ! for label
+let ylen = `($ppl$ylen)/2/($VP_WIDTH)/($VP_SCALE)`
+let xstart = ($ppl$xorg)/($VP_WIDTH)/($VP_SCALE)
+
+! make the key at the lower left, below any title or time axis label 
+set view keyview
+
+plot/i=1:10/hlim=0:1/vlim=0:1/noax/nolab 10*i
+let ypos = 0.25
+plot/over/vs/LINE/color=black/noax/nolab {`xstart`, `xstart+ylen`}, {`ypos`, `ypos`}
+
+! Center the label on the line we just drew
+
+let xpos = xstart + ylen/2
+let keysize = 0.14
+def sym unlab  "`$1,return=units`"
+LABEL `xpos`, `ypos-1.4*keysize`, 0, 0, `keysize`,  "`sticklen` ($unlab)"
+
+set mode/last verify
diff --git a/jnls/go/start_vis5d.jnl b/jnls/go/start_vis5d.jnl
new file mode 100644
index 0000000..fbad035
--- /dev/null
+++ b/jnls/go/start_vis5d.jnl
@@ -0,0 +1,17 @@
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! start_vis5d.jnl --  Starts vis5d for a file in .v5d format
+!                   
+! Ansley Manke
+! 7/98
+ 
+\cancel mode verify 
+! Description:  Set filename and start vis5d .
+ 
+!                          arg 1     
+!  usage:  GO start_vis5d file-name 
+ 
+!  Must have the filename.
+ 
+query/ignore $1"<Argument 1 is the Vis5D file name."
+
+sp vis5d -box 2 1 1 -date $1
diff --git a/jnls/go/stick_vectors.jnl b/jnls/go/stick_vectors.jnl
new file mode 100644
index 0000000..1cc3fe8
--- /dev/null
+++ b/jnls/go/stick_vectors.jnl
@@ -0,0 +1,70 @@
+\cancel mode verify
+! stick_vectors.jnl
+! 4/94
+! 4/95 - instructions on how to use "PLOTV" and angle/increment arguments
+! 7/01 *acm* update /ylimits to /vlimits
+! 2/13 *acm* dont stop on quotes in the plot command when checking for /over
+
+! Description: Make a stick vector plot of a line of U,V values
+
+! Usage:
+
+!    GO stick_vectors PLOT/[quals] U V [angle] [increment]
+! 1 command	   - PLOT with optional /OVERLAY, /TITLE, /NOLAB
+!		   Note: other qualifiers will not function properly (see note)
+! 2 U              - expression for the U component
+! 3 V              - expression for the V component
+! 4 angle          - rotation offset angle of vectors (default=0.0)
+! 5 increment      - plot every Nth vector (default=1)
+
+! example:
+!	yes? SET WINDOW/ASPECT=.4/SIZE=.5    ! long and skinny looks right
+!	yes? SET DATA  monthly_navy_winds
+!	yes? SET REGION/T=16-JAN-1985:16-JAN-1990/X=180/Y=0
+!	yes? GO stick_vectors plot uwnd vwnd
+!  or
+!	yes? GO stick_vectors plot/title=test/line=2/vlimits=-5:5:1 uwnd vwnd
+
+
+! 4/95 -- alternative approach using PLOTV
+! The approach below uses the FERRET command PLOT to load data as 2 variables
+! U and V into PLOT+.  Then it uses "PPL PLOTUV" to perform the plot.
+! An alternative approach is to use the FERRET "PLOT/VS" command to load the
+! data into PLOT+ as "X" and "Y".  Then use "PPL XAXIS" and "PPL YAXIS" to
+! eliminate the incorrect axis limits for the stick plot and use PPL PLOTV
+! to draw the plot.  The X axis will be the numbers 1 ... N
+
+
+! check for required filename and haf_inch_value and valid style
+QUERY/IGNORE $1%<Usage: GO stick_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $2%<Usage: GO stick_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $3%<Usage: GO stick_vectors "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+
+! set up the PLOT+ as if for a 2-line plot
+$1/SET_UP $2, $3
+
+! If the plot command includes /OVER, then that needs to be added to the
+! PPL PLOTUV command.
+
+! The commands below to send the the $1 argument into string functions
+! will fail if there are quotes in the text of $1.  If there is an error,
+! try to continue without setting the /OVER qualifier.
+
+SET MODE IGNORE
+DEFINE SYMBOL upcommand = `UPCASE("($1)")`
+IF ($FER_LAST_ERROR%0|*>1%) THEN 
+   SAY ... 
+   SAY ... stick_vectors.jnl fails checking the plot command for /OVERLAY qualifier, 
+   SAY ... when command contains a quoted string. Continuing.
+   SAY ... 
+ELSE
+   IF `STRINDEX("($upcommand)","OV") GT 0` THEN DEFINE SYMBOL qualifiers = /OVER
+ENDIF
+SET MODE/LAST IGNORE
+
+! ... but display it with the PLOTUV command
+PPL PLOTUV($qualifiers) $4"0" $5"1"
+
+set mode/last verify
+cancel symbol qualifiers
+
diff --git a/jnls/go/stick_vectors_key.jnl b/jnls/go/stick_vectors_key.jnl
new file mode 100644
index 0000000..5edf7c0
--- /dev/null
+++ b/jnls/go/stick_vectors_key.jnl
@@ -0,0 +1,86 @@
+\cancel mode verify
+! stick_vectors_key.jnl
+! 4/94
+! 4/95 - instructions on how to use "PLOTV" and angle/increment arguments
+! 7/01 *acm* update /ylimits to /vlimits
+! 9/05 *acm* version that makes a key with a standard stick vector at the 
+!            bottom instead of labelling the vertical axis with units.
+
+! Description: Make a stick vector plot of a line of U,V values
+
+! Usage:
+
+!    GO stick_vectors_key PLOT/[quals] U V [angle] [increment]
+! 1 command	   - PLOT with optional /OVERLAY, /TITLE, /NOLAB
+!		   Note: other qualifiers will not function properly (see note)
+! 2 U              - expression for the U component
+! 3 V              - expression for the V component
+! 4 angle          - rotation offset angle of vectors (default=0.0)
+! 5 increment      - plot every Nth vector (default=1)
+
+! We must be in a viewport!
+
+! example:
+!	yes? SET WINDOW/ASPECT=.4/SIZE=.5    ! long and skinny looks right
+!	yes? SET DATA  monthly_navy_winds
+!	yes? SET REGION/T=16-JAN-1985:16-JAN-1990/X=180/Y=0
+!       yes? SET VIEW full
+!	yes? GO stick_vectors_key plot uwnd vwnd
+!  or
+!	yes? GO stick_vectors_key plot/title=test/line=2/vlimits=-5:5:1 uwnd vwnd
+
+
+! 4/95 -- alternative approach using PLOTV
+! The approach below uses the FERRET command PLOT to load data as 2 variables
+! U and V into PLOT+.  Then it uses "PPL PLOTUV" to perform the plot.
+! An alternative approach is to use the FERRET "PLOT/VS" command to load the
+! data into PLOT+ as "X" and "Y".  Then use "PPL XAXIS" and "PPL YAXIS" to
+! eliminate the incorrect axis limits for the stick plot and use PPL PLOTV
+! to draw the plot.  The X axis will be the numbers 1 ... N
+
+
+! check for required filename and haf_inch_value and valid style
+QUERY/IGNORE $1%<Usage: GO stick_vectors_key "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $2%<Usage: GO stick_vectors_key "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+QUERY/IGNORE $3%<Usage: GO stick_vectors_key "VECTOR"/[QUALS] U V half_inch_value ["clock"] ["stick"]%
+
+! set up the PLOT+ as if for a 2-line plot
+$1/SET_UP $2, $3
+ppl axatic,,1
+ppl axlabp,,0
+
+
+! ... but display it with the PLOTUV command
+PPL PLOTUV $4"0" $5"1"
+
+! Make the key: a single stick vector of a standard length: half the 
+! y-axis length on the stick plot
+
+! Get the size of the vector, equivalent to a quarter of the size of the
+! vertical axis which is determined automatically when making the plotuv plot.
+
+let sticklab = `(($yaxis_max) - ($yaxis_min))/4`  ! for label
+let sticklen = `($ppl$ylen)/4/($VP_WIDTH)/($VP_SCALE)`
+let xstart = ($ppl$xorg)/($VP_WIDTH)/($VP_SCALE)
+
+! Define a viewport in which to put the key.
+let vht = ($ppl$yorg)/($VP_WIDTH)/($VP_SCALE)
+def view/axes/xlim=0.:1./ylim=0:`vht` keyview
+
+! Make a dummy plot in the viewport to set the scaling, then draw and 
+! label the stick.
+
+set view keyview
+plot/i=1:10/hlim=0:1/vlim=0:1/noax/nolab 10*i
+let ypos = 0.8
+plot/over/vs/LINE/color=black/noax/nolab {`xstart`, `xstart+sticklen`}, {`ypos`, `ypos`}
+let keysize = 0.14
+
+LET unit_lab = "`$2,return=units`"
+LABEL `xstart+sticklen+keysize/10`,`ypos - keysize/3`, -1, 0, `keysize`, "`sticklab` `unit_lab`"
+
+set mode/last verify
+
+
+set mode/last verify
+
diff --git a/jnls/go/test.jnl b/jnls/go/test.jnl
new file mode 100644
index 0000000..cb5c06a
--- /dev/null
+++ b/jnls/go/test.jnl
@@ -0,0 +1,3 @@
+! Description: a dummy test journal file to execute
+
+message/cont executing test journal file
diff --git a/jnls/go/tgridlines.jnl b/jnls/go/tgridlines.jnl
new file mode 100644
index 0000000..a7af352
--- /dev/null
+++ b/jnls/go/tgridlines.jnl
@@ -0,0 +1,70 @@
+
+
+\cancel mode verify  
+set mode verify
+
+!**************************************************************
+! Description: plot over the vertical grid of a plot 
+!
+! Example: go tgridlines 20 1
+!          will plot every 20 on the physical xaxis a vertical bar
+!          made of line of 1% of the physical yaxis
+!
+! Notes: default vdelta is 1%   
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: brock at lsce.saclay.cea.fr
+!
+! Creation: Sept 2000
+! Version: 1.0
+! History:
+! Modification: 
+!       With time axis, $XAXIS_MIN and $PPL$XMAX
+!       are defined but not used  
+!       Replace by PPL$XMIN1 and PPL$XMAX1 
+!
+!**************************************************************
+
+query/ignore $1%<Usage: go tgridlines hdelta [vdelta]%
+
+! x1 = first vertical line (superior value)
+if `($PPL$XMIN1) lt 0` then
+        def sym gridlines_x1 = int(($PPL$XMIN1)/$1)*$1
+else
+        def sym gridlines_x1 = (int(($PPL$XMIN1)/$1)+1) *$1
+endif
+! x2 = last vertical line  (inferior value)
+if `($PPL$XMAX1) lt 0` then
+        def sym gridlines_x2 = (int(($PPL$XMAX1)/$1)-1) *$1
+else
+        def sym gridlines_x2 = (int(($PPL$XMAX1)/$1)) *$1
+endif
+def sym gridlines_xrange = (($gridlines_x2) - ($gridlines_x1))
+
+def sym gridlines_x = ($gridlines_x1) + (i-1)*$1
+def sym gridlines_nbx = int(($gridlines_xrange)/$1) + 1
+
+def sym gridlines_yrange = `($YAXIS_MAX)-($YAXIS_MIN)`
+def sym gridlines_y1 = ($YAXIS_MIN) + ($gridlines_yrange)*(j-1)/100
+def sym gridlines_y2 = ($YAXIS_MIN) + ($gridlines_yrange)*(j-1+$2%1%)/100
+
+if `($gridlines_nbx) ge 1` then
+        repeat/i=1:`($gridlines_nbx)`:1 ( repeat/j=1:100:`2*$2%1%` ppl aline 1,`($gridlines_x)`,`($gridlines_y1)`,`($gridlines_x)`,`($gridlines_y2)` )
+endif
+
+!**************************************************************
+cancel sym gridlines_x1
+cancel sym gridlines_x2
+cancel sym gridlines_xrange
+cancel sym gridlines_x
+cancel sym gridlines_nbx
+cancel sym gridlines_yrange
+cancel sym gridlines_y1
+cancel sym gridlines_y2
+
+!**************************************************************
+set mode/last verify
+
+
diff --git a/jnls/go/tics.jnl b/jnls/go/tics.jnl
new file mode 100644
index 0000000..71ce4eb
--- /dev/null
+++ b/jnls/go/tics.jnl
@@ -0,0 +1,11 @@
+\cancel mode verify
+! tics.jnl  (12/93)
+
+! Description: Reset the plot style to use axis tics (see GO graticule)
+
+! Usage:  GO tics
+! 	(to obtain a graticule instead of tics use  "GO graticule")
+
+ppl tics,,.25,,.25,-1,-1
+
+set mode/last verify
diff --git a/jnls/go/tlandr.jnl b/jnls/go/tlandr.jnl
new file mode 100644
index 0000000..9e53b2d
--- /dev/null
+++ b/jnls/go/tlandr.jnl
@@ -0,0 +1,19 @@
+cancel mode verify	! ... now overlaying coastal outline ...
+! Description: an outdated routine equivalent to "GO land"
+
+set data/save
+define axis/x=1:8850:1 axtlandr
+define grid/x=axtlandr gtlandr
+
+file/col=2/form=unform/var="xtlandr,ytlandr"/grid=gtlandr unf_tlandr.dat
+
+set variable/bad=1E35 xtlandr
+set variable/bad=1E35 ytlandr
+plot/set/vs/over/nolab/x=1:8850 xtlandr,ytlandr
+ppl pen 1 1
+ppl plot/over
+
+cancel data unf_tlandr.dat
+set data/restore
+set mode/last verify
+
diff --git a/jnls/go/trackplot.jnl b/jnls/go/trackplot.jnl
new file mode 100644
index 0000000..ad185ee
--- /dev/null
+++ b/jnls/go/trackplot.jnl
@@ -0,0 +1,102 @@
+\cancel mode verify
+! trackplot.jnl
+! 4/99 *sh* and *jd*
+
+! Description: Plot values of a variable alongside a plotted track
+
+! Usage:                  $1        $2     $3     $4     $5       $6        $7
+! yes?  GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]
+! $1 - the plot command with qualifiers (eg PLOT/VS/OVER/LINE=2)
+! $2 - X coordinates of track to be plotted
+! $3 - Y coordinates of track to be plotted
+! $4 - variable whose values will be plotted along the track (eg SST)
+! $5 - optional: scale the values by this factor (in units/inch) 
+! $6 - baseline (a.k.a. offset) -- what data value is associated with zero
+!      displacement from the trackline ans the "horizontal axis" of the trackplot
+!      Default = 0
+! $7 - smooth the track to be plotted with SBX:$6 (optional, default 3)
+!      The "smooth" parameter is given in units of the number of points over
+!      which a running mean filter will be applied to the normal vectors. It 
+!      is effective only in special cases. For "rough" paths, best results are
+!      obtained by smoothing the position data that is passed to this script. 
+
+! example
+! Define synthetic data
+!       yes? LET xpts = 230 - L[L=1:80]
+!       yes? LET ypts = 30 + 20*SIN(L[L=1:80]/30)
+!       yes? LET val  = RANDN(L[L=1:80])
+!
+! Draw base map
+!       yes? go basemap x=130E:120W Y=10n:60n 20
+!       yes? plot/vs/over/line/title="track" xpts, ypts
+!
+! Auto-scaled plot, then manually scaled plot
+!	yes? GO trackplot plot/vs/over/line=2/title="my data" xpts, ypts, val
+!       yes? SAY ($TRACKPLOTscale)     ! value is 3.356 units/inch
+!	yes? GO trackplot plot/vs/over/line=4/title="scaled" xpts, ypts, val 3
+
+! argument check
+QUERY/IGNORE $1"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+QUERY/IGNORE $2"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+QUERY/IGNORE $3"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+QUERY/IGNORE $4"<usage: yes? GO trackplot plot_command xtrack ytrack values [scale] [baseline] [smooth]"
+
+! save the input expressions into simple variable definitions
+LET/QUIET TRKx = ($2)
+LET/QUIET TRKy = ($3)
+LET/QUIET TRKdata = ($4)
+LET/QUIET TRKoffset = $6"0"
+
+! determine the orientation of the data (and check that it is 1D)
+DEFINE SYMBOL TRKax `TRKx,return=shape`
+
+LET/QUIET TRKxscale = ((($xaxis_max))-(($xaxis_min)))/($ppl$xlen)
+LET/QUIET TRKyscale = ((($yaxis_max))-(($yaxis_min)))/($ppl$ylen)
+
+! compute factor to compensate for unequal scaling of X and Y plot axes
+LET/QUIET TRKaxscale_factor = TRKyscale/TRKxscale
+LET/QUIET TRKx_correction = (1 + TRKaxscale_factor^2)^0.5
+LET/QUIET TRKy_correction = TRKaxscale_factor * TRKx_correction
+
+! compute the local normal vector components -- (COS,SIN) --> (-SIN,COS)
+! this will be used to createoffsets from track line
+LET/QUIET TRKdx0 = MISSING(TRKx[($TRKax)=@ddc],MISSING(TRKx[($TRKax)=@ddf],TRKx[($TRKax)=@ddb])) * TRKaxscale_factor
+
+LET/QUIET TRKdy0 = MISSING(TRKy[($TRKax)=@ddc],MISSING(TRKy[($TRKax)=@ddf],TRKy[($TRKax)=@ddb]))
+
+LET/QUIET TRKds_mag = (TRKdx0^2+TRKdy0^2)^0.5
+LET/QUIET TRKxnorm0 = TRKx_correction * (-1 *  TRKdy0 / TRKds_mag)
+LET/QUIET TRKynorm0 = TRKy_correction * TRKdx0 / TRKds_mag
+
+! smooth the normal vectors ...
+LET/QUIET TRKxnorm = MISSING(TRKxnorm0[($TRKax)=@sbx:$6"3"],TRKxnorm0)
+LET/QUIET TRKynorm = MISSING(TRKynorm0[($TRKax)=@sbx:$6"3"],TRKynorm0)
+
+! determine default scale
+LET/QUIET TRKmap_range = ( (($yaxis_max)-(($yaxis_min))) * (($xaxis_max)-(($xaxis_min))) ) ^ 0.5
+LET/QUIET TRKdata_range = MAX(ABS(TRKdata[($TRKax)=@max])-TRKoffset,ABS(TRKdata[($TRKax)=@min])-TRKoffset)
+
+! Handle all-zero fields & custom scaling...
+LET/QUIET TRKinches = (($ppl$ylen)*($ppl$xlen))^0.5    ! blend X and Y ax lens
+IF  $5"FALSE|*>TRUE" THEN 
+    LET/QUIET TRKunitsperinch = $5     ! user-specified
+ELIF `TRKdata_range eq 0` THEN 
+    LET/QUIET TRKunitsperinch =  1     ! irrelevant
+ELSE
+    LET/QUIET TRKaxis_fraction = 0.06 ! fraction of axis length for default scale
+    LET/QUIET TRKunitsperinch = TRKdata_range / (TRKaxis_fraction*TRKinches)  ! auto-scaled
+ENDIF
+DEFINE SYMBOL TRACKPLOTscale  `TRKunitsperinch`
+DEFINE SYMBOL TRACKPLOToffset `TRKoffset`
+
+
+LET/QUIET TRKscale = TRKmap_range / (TRKunitsperinch * TRKinches)
+
+LET/QUIET TRKxplot = TRKx + TRKscale*TRKxnorm*(TRKdata-TRKoffset)
+LET/QUIET TRKyplot = TRKy + TRKscale*TRKynorm*(TRKdata-TRKoffset)
+
+$1/vs TRKxplot,TRKyplot
+
+cancel symbol TRK*
+cancel variable TRK*
+set mode/last verify
diff --git a/jnls/go/try_centered_palette.jnl b/jnls/go/try_centered_palette.jnl
new file mode 100644
index 0000000..f69a3db
--- /dev/null
+++ b/jnls/go/try_centered_palette.jnl
@@ -0,0 +1,22 @@
+\cancel mode verify  
+
+! Description: 4 plots to illustrate "split at zero" color bar densities
+! see also try_palette.jnl
+
+query/ignore $1"<usage:  GO try_palette palette_name"
+
+set wind/clear
+
+set view ul
+shade/i=1:120/j=1:120/lev=(-120,120,60)/palette=$1/title="4 levels" j-i
+
+set view ur
+shade/i=1:120/j=1:120/lev=(-120,120,40)/palette=$1/title="6 levels" j-i
+
+set view ll
+shade/i=1:120/j=1:120/lev=(-120,120,30)/palette=$1/title="8 levels" j-i
+
+set view lr
+shade/i=1:120/j=1:120/lev=(-120,120,15)/palette=$1/title="16 levels" j-i
+
+set mode/last verify
diff --git a/jnls/go/try_palette.jnl b/jnls/go/try_palette.jnl
new file mode 100644
index 0000000..854dd6a
--- /dev/null
+++ b/jnls/go/try_palette.jnl
@@ -0,0 +1,28 @@
+\cancel mode verify  
+
+! Description: View 4 plots to illustrate color bar densities
+! see also try_palette.jnl
+
+query/ignore $1"<usage:  GO try_palette palette_name"
+
+set wind/clear
+can mode logo
+
+! Make a blank plot and a label with the palette name
+set view full
+shade/noax/nolab/pal=white/nokey/i=1:2/j=1:2 i+j
+label/nouser `($ppl$xlen)/2`,`($ppl$ylen)/2`,0,0,0.15, at AS$1
+
+set view ul
+shade/i=1:120/j=1:120/lev=(-90,90,60)/palette=$1/title="3 levels" j-i
+
+set view ur
+shade/i=1:120/j=1:120/lev=(-100,100,40)/palette=$1/title="5 levels" j-i
+
+set view ll
+shade/i=1:120/j=1:120/lev=(-105,105,30)/palette=$1/title="7 levels" j-i
+
+set view lr
+shade/i=1:120/j=1:120/lev=(-120,120,16)/palette=$1/title="15 levels" j-i
+
+set mode/last verify
diff --git a/jnls/go/try_pattern.jnl b/jnls/go/try_pattern.jnl
new file mode 100644
index 0000000..80a22a3
--- /dev/null
+++ b/jnls/go/try_pattern.jnl
@@ -0,0 +1,33 @@
+\cancel mode verify  
+
+! Description: View 4 plots to illustrate patterns
+
+query/ignore $1"<usage:  GO try_pattern patt_name"
+
+set wind/clear
+
+set view ul
+shade/i=1:120/j=1:120/lev=(0,120,40)/pattern=$1/palette=black/title="black palette, 3 levels" j+i-i
+
+set view ur
+shade/i=1:120/j=1:120/lev=(0,120,24)/pattern=$1/palette=rainbow/title="rainbow palette, 5 levels" j+i-i
+
+set view ll
+shade/i=1:120/j=1:120/lev=(0,120,15)/pattern=$1/palette=rainbow/title="rainbow palette, 8 levels" j+i-i
+
+set view lr
+shade/i=1:120/j=1:120/lev=(0,120,8)/pattern=$1/palette=red/title="red palette, 15 levels" j+i-i
+
+set mode/last verify
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jnls/go/ts_frequency.jnl b/jnls/go/ts_frequency.jnl
new file mode 100644
index 0000000..963c106
--- /dev/null
+++ b/jnls/go/ts_frequency.jnl
@@ -0,0 +1,91 @@
+\cancel mode verify
+! ts_frequency.jnl - *sh* 8/94
+! 2/95 - *sh* fixed bugs from points out of range showing up inside plot
+
+! Description: produce a TS frequency "histogram"
+! i.e. on a 2D plot with axes of temp and salt display the number of
+! grid points within that temp/salt grid box range
+
+! The procedure gives a choice of plotting numbers of grid cells in each
+! TS "bin" or volume of water (assuming lat/long/depth units are deg/deg/m)
+
+! Note that this procedure can actually plot a frequency histogram for **ANY**
+! two variables - just specify the appropriate variable names and ranges
+! as arguments  (axis labels, however, will still say temperature and salinity)
+
+! Usage:  first set set data set and region
+!	  make sure the variables TV and SV are defined as temperature
+!	  (degrees C) and salinity (28 to 42)
+
+!    GO ts_frequency [tvar] [svar] [tlo] [thi] [tdel] [slo] [shi] [sdel] [wt]
+
+!	defaults: tvar="TEMP", svar="SALT", tlo=-5, thi=35, tdel=0.1,
+!	                                    slo=28, shi=42, sdel=0.1
+!		  wt= weight of "1" for every cell
+
+! "wt" is an optional variable name that can be passed to indicate the
+! weight to be assigned to each grid cell - typically the volume of the cell
+! For example (contributed by Tony Craig):
+!let r=6370		! radius of earth
+!let pi=atan(1.)*4.
+!let deg2rad=pi/180.
+!let deg2km=2*pi*r/360.
+!let wt=zbox[g=TEMP]/1000.*xbox[g=TEMP]*ybox[g=TEMP]*cos(y[g=TEMP]*deg2rad)*deg2km*deg2km
+! GO ts_frequency TEMP SALT 0 30 .5 29 41 .2 wt
+
+! Sample usage:
+!	yes? SET DATA levitus_climatology
+!	yes? SET REGION/X=0:360/Y=90S:90N/Z=0    ! global surface
+!	yes? GO ts_frequency
+
+! e.g. to use smax=38 try
+!	yes? GO go ts_frequency temp,salt,,,,,38
+
+! check arguments
+QUERY/IGNORE $1"<Usage: GO ts_frequency my_temp my_salt [tlo] [thi] [tdel] [slo] [shi] [sdel] [wt]"
+QUERY/IGNORE $2"<Usage: GO ts_frequency my_temp my_salt [tlo] [thi] [tdel] [slo] [shi] [sdel] [wt]"
+
+! cleanup from previous
+cancel data/noerror ts_frequency.dat
+
+! compute a 1D index that numbers all the grid boxes on the desired output plot
+! also cope with missing values ("MISSING()") and data below the minimums
+! ("MAX()").  Data above the max is simply not read in the final commands
+! because it lies beyond the number of points in the grid gindex
+LET/QUIET tmin = $3"-5"
+LET/QUIET tmax = $4"35"
+LET/QUIET tdelta = $5"0.1"
+LET/QUIET smin = $6"28"
+LET/QUIET smax = $7"42"
+LET/QUIET sdelta = $8"0.1"
+LET/QUIET tn = INT((tmax-tmin)/tdelta + 0.5) + 1
+LET/QUIET tusable = $1"TEMP" GT (tmin-0.5*tdelta) AND $1"TEMP" LT (tmax+0.5*tdelta)
+LET/QUIET tindex = IF tusable THEN INT(($1"TEMP"-tmin)/tdelta + 0.5) + 1 ! 1 to tn
+LET/QUIET sn = INT((smax-smin)/sdelta + 0.5) + 1
+LET/QUIET susable = $2"SALT" GT (smin-0.5*sdelta) AND $2"SALT" LT (smax+0.5*sdelta)
+LET/QUIET sindex = IF susable THEN INT(($2"SALT"-smin)/sdelta + 0.5) + 1 ! 1 to sn
+LET/QUIET index = IF (tusable AND susable) THEN MAX(0, (sindex-1)*tn + tindex) ELSE 0		  ! 1 to tn*sn with 0 for bad values
+
+! function to compute volume of each grid cell
+LET/QUIET wt_index = $9"1"
+
+! create an output file with all TS grid boxes represented in order
+sp rm -f ts_frequency.raw ts_frequency.dat
+list/nohead/form=(F10.0,1PG14.7)/file=ts_frequency.raw index, wt_index
+list/nohead/form=(F10.0,1PG14.7)/file=ts_frequency.raw/append sn*tn+1, 0 ! MAX index+1
+sp sort -n ts_frequency.raw | awk -f $FER_DIR/go/frequency.awk | grep -v "XXXXX" > ts_frequency.dat
+
+define axis/x=$3"-5":$4"35":$5"0.1"/unit="temperature" xax
+define axis/y=$6"28":$7"42":$8"0.1"/unit="salinity" yax
+define grid/x=xax/y=yax gindex
+set data/save
+file/grid=gindex/var="-,wt_count" ts_frequency.dat
+set variable/title="Sum of Weights" wt_count
+set data/restore
+
+set mode/last verify
+
+! do a shaded plot
+message/cont >>> shade/x=$3"-5":$4"35"/y=$6"28":$7"42" wt_count[d=ts_frequency.dat]
+shade/x=$3"-5":$4"35"/y=$6"28":$7"42" wt_count[d=ts_frequency.dat]
+
diff --git a/jnls/go/unbold.jnl b/jnls/go/unbold.jnl
new file mode 100644
index 0000000..b2c1400
--- /dev/null
+++ b/jnls/go/unbold.jnl
@@ -0,0 +1,23 @@
+\cancel mode verify
+! Description: restore PLOT+ & FERRET to normal styling following "GO bold"
+! created 10/93 *sh*
+
+! normal ASCII fonts
+set mode ascii
+ppl dfltfnt SR
+
+! normal axis numbering size
+ppl axlsze .10,.10
+
+! normal contour numbers
+ppl conset .08
+ppl conpre 
+
+! normal thickness lines
+ppl pen 0,1
+ppl pen 1,1
+
+! can increase default label sizes
+ppl labset .16,.12,.12,.12
+
+set mode/last verify
diff --git a/jnls/go/unf_tlandr.dat_dec b/jnls/go/unf_tlandr.dat_dec
new file mode 100644
index 0000000..b288487
Binary files /dev/null and b/jnls/go/unf_tlandr.dat_dec differ
diff --git a/jnls/go/unf_tlandr.dat_sun b/jnls/go/unf_tlandr.dat_sun
new file mode 100644
index 0000000..fa3d04d
Binary files /dev/null and b/jnls/go/unf_tlandr.dat_sun differ
diff --git a/jnls/go/unit_square.jnl b/jnls/go/unit_square.jnl
new file mode 100644
index 0000000..e180902
--- /dev/null
+++ b/jnls/go/unit_square.jnl
@@ -0,0 +1,7 @@
+! Description: set up the unit square as the default for abstract variables
+
+DEFINE AXIS/X=-1:1:.02 axsquare
+DEFINE GRID/X=axsquare/Y=axsquare gsquare
+
+SET REGION/X=0:1/Y=0:1
+SET GRID gsquare
diff --git a/jnls/go/unlabel.jnl b/jnls/go/unlabel.jnl
new file mode 100644
index 0000000..6a33c2f
--- /dev/null
+++ b/jnls/go/unlabel.jnl
@@ -0,0 +1,18 @@
+\cancel mode verify	! ... removing the specified PLOT+ movable label
+! usage:   GO unlabel label_number
+!	where label_number is the label revealed by the command PPL LIST LABELS
+
+!   e.g.  remove the "NOAA/PMEL TMAP" signature label from a plot
+!	   yes? PLOT/SET_UP/I=1:100 SIN(I/6)
+!	   yes? PPL LIST LABELS                ! notice #2 is the one to remove
+!	   yes? GO unlabel 2
+!	   yes? PPL PLOT
+
+
+! test argument before performing any actions
+QUERY/IGNORE $1"<Usage: GO unlabel n,  where n is a PLOT+ movable label number"
+
+! remove the label by setting its location to the origin with no text content
+PPL LABS/NOUSER $1,0,0 @AS
+
+set mode/last verify
diff --git a/jnls/go/unmagnify.jnl b/jnls/go/unmagnify.jnl
new file mode 100644
index 0000000..7e79211
--- /dev/null
+++ b/jnls/go/unmagnify.jnl
@@ -0,0 +1,9 @@
+\ cancel mode verify
+! unmagnify.jnl  (11/93)
+
+! Description: restore the plot origin and axis lengths to default values
+
+set mode/last verify
+
+GO magnify 1
+
diff --git a/jnls/go/var_n.jnl b/jnls/go/var_n.jnl
new file mode 100644
index 0000000..f24bfe3
--- /dev/null
+++ b/jnls/go/var_n.jnl
@@ -0,0 +1,25 @@
+CANCEL MODE VERIFY
+
+! var_n.jnl
+! Description: Correct "GO variance" definitions by n/n-1 factor
+
+! 6/24/2004  add new definitions for masked variables, so that
+! CORREL will be corrected (see the FAQ on computing correleations).
+! 4/2011 compute nm1 based on the number of VALID data.
+
+! compute n/n-1 factor to get the variances exact
+let l1 = mask_pq
+let nm1 = l1[l=@ngd] - 1
+IF `nm1 eq 0` then exit/script
+let ndnm1 = (nm1+1)/nm1
+
+! redefine terms with n/n-1 factor 
+let/title="VARIANCE OF P" 	   P_VAR = P_DSQ[l=@ave] * ndnm1
+let/title="VARIANCE OF Q" 	   Q_VAR = Q_DSQ[l=@ave] * ndnm1
+let/title="COVARIANCE OF P AND Q"  COVAR = PQ_DSQ[l=@ave] * ndnm1
+
+
+let/quiet/title="VARIANCE OF P WHEN Q PRESENT" P_VAR_MASK = P_DSQ_MASK[l=@ave] * ndnm1
+let/quiet/title="VARIANCE OF Q WHEN P PRESENT" Q_VAR_MASK = Q_DSQ_MASK[l=@ave] * ndnm1
+
+
diff --git a/jnls/go/variance.jnl b/jnls/go/variance.jnl
new file mode 100644
index 0000000..93002f4
--- /dev/null
+++ b/jnls/go/variance.jnl
@@ -0,0 +1,47 @@
+\CANCEL MODE VERIFY
+! updated 10/93 for Ferret V3.01
+! updated 6/99 to handle bad data - SIM
+
+! Description:  define FERRET variables for covariance and correlation
+
+! example:
+!   yes? SET DATA coads_climatology
+!   yes? LET p = sst[x=180,y=0]; LET q = airt[x=180,y=0]
+!   yes? GO variance
+!   yes? list p, q
+
+SAY ... Variance and Covariance: Instructions:
+SAY Use the LET/QUIET command to define the variable(s) P (and Q) as
+SAY your variable(s) of interest (e.g. yes? LET/QUIET P = u[x=180,y=0])
+SAY The variance of P will be variable P_VAR  (Q --> Q_VAR)
+SAY The covariance will be COVAR The correlation will be CORREL.
+SAY Type GO VAR_N to obtain n/n+1 statistical correction factor
+SAY ...
+
+! deviations, squared deviations, cross deviations
+let/quiet P_AVE = P[L=@ave]
+let/quiet Q_AVE = Q[L=@ave]
+let/quiet P_DEV = P - P_AVE
+let/quiet Q_DEV = Q - Q_AVE
+let/quiet MASK_PQ = p*q-p*q + 1 	! always 1 or "missing"
+let/quiet P_MASK = P*MASK_PQ
+let/quiet Q_MASK = Q*MASK_PQ
+let/quiet P_DSQ = P_DEV * P_DEV
+let/quiet Q_DSQ = Q_DEV * Q_DEV
+let/quiet P_AVE_MASK = P_MASK[l=@ave]
+let/quiet Q_AVE_MASK = Q_MASK[l=@ave]
+let/quiet P_DEV_MASK = P_MASK - P_AVE_MASK
+let/quiet Q_DEV_MASK = Q_MASK - Q_AVE_MASK
+let/quiet P_DSQ_MASK = P_DEV_MASK*P_DEV_MASK
+let/quiet Q_DSQ_MASK = Q_DEV_MASK*Q_DEV_MASK
+let/quiet PQ_DSQ= P_DEV_MASK * Q_DEV_MASK     ! also = P_DEV*Q_DEV
+
+! variances, covariances
+let/quiet/title="VARIANCE OF P"          P_VAR = P_DSQ[l=@ave]
+let/quiet/title="VARIANCE OF Q"          Q_VAR = Q_DSQ[l=@ave]
+let/quiet/title="VARIANCE OF P WHEN Q PRESENT" P_VAR_MASK = P_DSQ_MASK[l=@ave]
+let/quiet/title="VARIANCE OF Q WHEN P PRESENT" Q_VAR_MASK = Q_DSQ_MASK[l=@ave]
+let/quiet/title="COVARIANCE OF P AND Q"  COVAR = PQ_DSQ[l=@ave]
+let/quiet/title="CORRELATION OF P AND Q" CORREL= COVAR / (P_VAR_MASK*Q_VAR_MASK)^.5
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/vertical_section.jnl b/jnls/go/vertical_section.jnl
new file mode 100644
index 0000000..2a3d10b
--- /dev/null
+++ b/jnls/go/vertical_section.jnl
@@ -0,0 +1,64 @@
+\cancel mode verify
+! vertical_section.jnl
+! 12/1/94 *sh*
+! 10/2003 *acm*
+
+! Description: Create an arbitrary 2D vertical section from a 3D field
+!
+! Updated in 2003 to use the SAMPLEXY function.  The argument list 
+! has been changed with this update
+
+! NOTE: Also see the script samplexy_demo.jnl for a more ideas on 
+!  creating vertical cross-sections, when the path is not a straight line
+
+! usage:
+!                           arg1         arg2     a3  a4  a5  a6  a7
+!	GO vertical_section plot_command variable xlo,ylo,xhi,yhi,nx
+
+! arguments
+! variable (arg1) - the variable to be sampled.  >>BE SURE TO SPECIFY A
+!			UNIQUE T= OR L= VALUE IN THE DEFINITION<<
+! xlo,ylo,xhi,yhi - the lower left and upper right coordinates of the section
+!			to be extracted.
+!			>> NOTE THAT COORDINATES MUST BE PURELY NUMERICAL:
+!			FOR LONGITUDE DEGREES EAST USE NUMERICAL LONGITUDE
+!			FOR LONGITUDE DEGREES WEST USE 360-LONGITUDE
+!			FOR LATITUDE DEGREES SOUTH USE (-1) * LATITUDE
+!			FOR LATITUDE DEGREES NORTH USE NUMERICAL LATITUDE
+! nx	   (arg7) - the number of desired horizontal points
+
+! examples:
+! 1. Create a section of a variable which is defined in X-Y-Z-T,
+!    at a single time and over a range of depths, with the section
+!    running from (100e,40S) to (300E,40N)
+!       yes? GO vertical_section SHADE/T="1-jan-2001"/z=0:120 var 100,-40,300,40,81
+
+! 2. Create a section of the Levitus climatological temperature running
+!    from (160e,20s) to (140w,30n)
+!
+!	yes? SET DATA levitus_climatology
+!	yes? GO vertical_section FILL "temp[x=150e:130w,y=25s:35n]" 160,-20,220,30,61
+
+! Notes:
+!   1) Quotation marks avoid a syntax error from the comma in "temp[...,...]"
+!   2) The region x=150e:130w,y=25s:35n is a subset of the full data
+!		set chosen (arbitrarily) large enough to encompass the
+!		section to be sampled.
+
+! check the arguments
+query/ignore $1%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $2%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $3%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $4%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $5%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $6%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+query/ignore $7%<Use: GO vertical_section plot_command,variable,xlo,ylo,xhi,yhi,nx%
+
+LET var_vsect = $2
+
+! define the X,Y, and Z coordinates for sampling the 3D field
+LET/QUIET x_vsect = ($5-($3))/($7-1) * (I-1) + ($3)
+LET/QUIET y_vsect = ($6-($4))/($7-1) * (I-1) + ($4)
+
+$1 SAMPLEXY($2, x_vsect[i=1:$7], y_vsect[i=1:$7])
+set mode/last verify
diff --git a/jnls/go/vfland.jnl b/jnls/go/vfland.jnl
new file mode 100644
index 0000000..36b86c6
--- /dev/null
+++ b/jnls/go/vfland.jnl
@@ -0,0 +1,84 @@
+\cancel mode verify
+! vfland.jnl - Draw a filled vertical bathymetry slice in the x or y direction
+! (overlay or "basemap" (default 20 minute resolution)
+! 8/12
+
+! Description: Draw a filled vertical bathymetry slice in the x or y direction
+
+! usage:       arg1        arg2       arg3     arg3
+!  GO vfland [resolution] [palette]  x=val    y=lo:hi
+!                                    x=lo:hi  y=val
+
+
+! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=20
+!         To use resolution "nnn" the file etoponnn must exist.
+! arg 2 - palette - may be any palette on your system.  Normally solid colors
+!                   like black, gray,red, etc. (see Fpalette '*') default=gray
+!                   Fill is made with a single color
+! arg 3 - longitude limits for the slice - specify as for FERRET longitude range or value
+! arg 4 - latitude  limits for the slice - specify as for FERRET latitude  range or value
+ 
+! See also vland.jnl for line plots of vertical slices of bathymetry
+
+! Examples:
+! XZ slice
+!    use levitus_climatology
+!    shade/y=20/x=50e:150e  temp
+!    GO vfland 60 blue_dark x=50e:150e y=20
+
+! Just the bathymetry of a YZ slice
+!    GO vfland 20 black x=180 y=-90:90
+
+! YZ slice with default topo resolution and gray palette
+!    use levitus_climatology
+!    shade/x=95w/y=15:30/z=0:4000 salt
+!    fill/over/nolab/lev/x=95w/y=15:30/z=0:4000 salt
+!    GO vfland "" "" x=95w y=15:30
+
+! Check for location arguments
+LET fv_xyloc = 1
+IF `($3"0|*>1") EQ 0` THEN LET fv_xyloc = 0
+IF `($4"0|*>1") EQ 0` THEN LET fv_xyloc = 0
+IF `fv_xyloc EQ 0` THEN 
+   SAY Arguments 3 and 4, longitude and latitude of slice, are required.
+   CANCEL VAR fv*
+   CANCEL SYM fv*
+   EXIT/SCRIPT
+ENDIF
+
+LET fv_xc = `STRINDEX("($3)", ":")`
+LET fv_xc = IF `fv_xc` GT 0 THEN 1 ELSE 0
+LET fv_yc = `STRINDEX("($4)", ":")`
+LET fv_yc = IF `fv_yc` GT 0 THEN 1 ELSE 0
+
+IF `fv_xc+fv_yc NE 1` THEN 
+   SAY Error in arguments 3 and 4: One must be a range, the other a single value.
+   CANCEL VAR fv*
+   CANCEL SYM fv*
+   EXIT/SCRIPT
+ENDIF
+
+DEFINE SYMBOL fv_xyregion = ($3),($4)
+
+! Open the topo dataset
+! Define arguments for the fill_between script.
+SET DATA/SAVE
+
+USE etopo$1"20"
+LET fv_rosedepth = IF rose LE 0 THEN rose ELSE 0
+
+IF `fv_xc EQ 1` THEN DEFINE SYMBOL fv_fill_axis = `rose,RETURN=xaxis` 
+IF `fv_yc EQ 1` THEN DEFINE SYMBOL fv_fill_axis = `rose,RETURN=yaxis`
+
+LET fv_bot = ($ppl$ymax) + 0*fv_rosedepth[($fv_xyregion)]
+
+GO fill_between POLY/NOLAB/PAL=$2"gray"/VLIM=($ppl$ymax):($ppl$ymin)/overlay  -1*fv_rosedepth[($fv_xyregion)] ($fv_fill_axis) fv_bot
+
+
+! Clean up and exit
+CANCEL VAR fv*
+CANCEL SYM fv*
+
+CANCEL DATA etopo$1"20"
+SET DATA/RESTORE
+SET MODE/LAST verify
diff --git a/jnls/go/vis5d_append.jnl b/jnls/go/vis5d_append.jnl
new file mode 100644
index 0000000..b011315
--- /dev/null
+++ b/jnls/go/vis5d_append.jnl
@@ -0,0 +1,37 @@
+\cancel mode verify 
+
+! Description:  Set filename and write a vis5d file with up to 8 variables.
+!  Data is written to a scratch file, then appended to the data in the file.
+
+
+! Script usage:
+!                arg 1     arg 2      arg 3       arg 4           arg 9   
+!      GO wv5d [file-name]  variable1 [variable2] [variable3] ... [variable8]
+
+!       defaults: file-name="vis5d_out.v5d"
+!    
+!  Must have at least one variable
+!  Default to 0 any more variables not specified.
+
+! test argument before performing any actions
+
+query/ignore $2"<vis5d_append writes at least one variable to the file. Supply variable name"
+
+
+!  Write the scratch file with new time records.
+ 
+let vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, "appnd_scratch.v5d")
+LOAD/TEMPORARY vflag
+
+!  v5dappend utility appends the new file onto the old.
+
+MESSAGE/CONTINUE !
+sp v5dappend appnd_scratch.v5d $1%vis5d_out.v5d%
+sp rm appnd_scratch.v5d
+
+SAY To view the file with Vis5D say:   GO vis5d_start $1%vis5d_out.v5d%
+
+
+set mode/last verify
+
+
diff --git a/jnls/go/vis5d_start.jnl b/jnls/go/vis5d_start.jnl
new file mode 100644
index 0000000..4eb73d4
--- /dev/null
+++ b/jnls/go/vis5d_start.jnl
@@ -0,0 +1,20 @@
+\CANCEL MODE VERIFY
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! vis5d_start.jnl --  Starts vis5d for a file in .v5d format
+!                   
+! Ansley Manke
+! 7/98
+ 
+! Description:  Set filename and start vis5d .
+ 
+!                          arg 1     
+!  usage:  GO vis5d_start file-name 
+ 
+! example:
+!   yes? GO vis5d_start vis5d_out.v5d%
+
+!  Must have the filename.
+ 
+!query/ignore $1"<Argument 1 is the Vis5D file name."
+define symbol filename $1"vis5d_out.v5d"
+sp vis5d -box 2 1 1 -date ($filename)
diff --git a/jnls/go/vis5d_write.jnl b/jnls/go/vis5d_write.jnl
new file mode 100644
index 0000000..4eca30b
--- /dev/null
+++ b/jnls/go/vis5d_write.jnl
@@ -0,0 +1,34 @@
+\cancel mode verify 
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! wv5d.jnl
+! *acm* 7/98
+ 
+! Description:  Write up to 8 Ferret variables to a Vis5D file.
+
+!                                arg 1   arg 2  arg 3  arg 4      arg 9   
+!  usage:  yes? GO vis5d_write filename  var1  [var2] [var3] ... [var8]
+! $1 - the Vis5D file name, defaults to vis5d_out.v5d
+! $2 - First Ferret variable to write
+! $3 - (optional) further variables to write
+! ...
+! $9 - (optional) further variables to write
+
+! example:
+!   yes? SET DATA coads_climatology
+!   yes? GO vis5d_write coads-clim.v5d sst airt uwnd vwnd
+
+! Check arguments
+
+QUERY/IGNORE $2"<vis5d_write writes at least one variable to the file. Supply variable name"
+
+!  Define the file and load vflag to call the external function and write it.
+
+LET/QUIET vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, "$1%vis5d_out.v5d%")
+
+LOAD/TEMPORARY vflag
+
+!  Give an option of viewing the file now.
+
+SAY To view the file with Vis5D say:   GO vis5d_start $1%vis5d_out.v5d%
+
+set mode/last verify
diff --git a/jnls/go/vland.jnl b/jnls/go/vland.jnl
new file mode 100644
index 0000000..03fd98a
--- /dev/null
+++ b/jnls/go/vland.jnl
@@ -0,0 +1,80 @@
+\cancel mode verify
+! vland.jnl - Draw a vertical bathymetry line showing a slice in the x or y direction
+! Specify "overlay" or "basemap" (default 20 minute resolution land bathymetry data)
+! 8/12
+
+! Description: Draw a vertical bathymetry line showing a slice in the x or y direction
+
+! usage:       arg1        arg2  arg3     arg4
+!  GO vland  [resolution] [pen]  x=val    y=lo:hi
+!                                x=lo:hi  y=val
+
+
+! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=20
+!         To use resolution "nnn" the file etoponnn must exist.
+! arg 2 - pen or "thick" for thick black pen
+! arg 3 - longitude limits for the slice - specify as for FERRET longitude range or value
+! arg 4 - latitude  limits for the slice - specify as for FERRET latitude  range or value
+
+! See also vfland.jnl for filled vertical bathymetry overlays
+
+! Examples:
+! XZ slice
+!    use levitus_climatology
+!    shade/y=20/x=50e:150e  temp
+!    GO vland 20 thick x=50e:150e y=20
+
+! YZ slice
+!    use levitus_climatology
+!    shade/pal=grayscale/x=95w/y=15:30/z=0:4000 salt
+!    fill/pal=grayscale/over/nolab/lev/x=95w/y=15:30/z=0:4000 salt
+!    GO vland 5 green x=95w y=15:30
+
+! Check the pen argument
+query/ignore $2%1|black|red|green|blue|thick|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|N|<GO land [pen or "N"] ["basemap"] [pen] [pen] with pen = 0(back), 1(fore), thick, 2-18 or a color%
+
+! Check for location arguments
+LET fv_xyloc = 1
+IF `($3"0|*>1") EQ 0` THEN LET fv_xyloc = 0
+IF `($4"0|*>1") EQ 0` THEN LET fv_xyloc = 0
+IF `fv_xyloc EQ 0` THEN 
+   SAY Arguments 3 and 4, longitude and latitude of slice, are required.
+   CANCEL VAR fv*
+   CANCEL SYM fv*
+   EXIT/SCRIPT
+ENDIF
+
+LET fv_xc = `STRINDEX("($3)", ":")`
+LET fv_xc = IF `fv_xc` GT 0 THEN 1 ELSE 0
+LET fv_yc = `STRINDEX("($4)", ":")`
+LET fv_yc = IF `fv_yc` GT 0 THEN 1 ELSE 0
+
+
+IF `fv_xc+fv_yc NE 1` THEN 
+   SAY Error in arguments 3 and 4: One must be a range, the other a single value.
+   CANCEL VAR fv*
+   CANCEL SYM fv*
+   EXIT/SCRIPT
+ENDIF
+
+DEFINE SYMBOL fv_xyregion = ($3),($4)
+
+! Open the topo dataset
+! Define variable to plot. Let it go above zero so that the data extends
+! to the surface.
+SET DATA/SAVE
+
+USE etopo$1"20"
+LET fv_rosedepth = rose
+
+PLOT/NOLAB/overlay/VLIM=($ppl$ymax):($ppl$ymin)/SET  -1*fv_rosedepth[($fv_xyregion)]
+   PPL PEN 1 $2"1|black>1|red>2|green>3|blue>4|lightblue>5|purple>6|white>19|thick>7|0>0|1>1|2>2|3>3|4>4|5>5|6>6|7>7|8>8|9>9|10>10|11>11|12>12|13>13|14>14|15>15|16>16|17>17|18>18|19|N>1|"
+   PPL PLOT/OVERLAY
+
+! Clean up and exit
+CANCEL VAR fv*
+CANCEL SYM fv*
+
+CANCEL DATA etopo$1"20"
+SET DATA/RESTORE
+SET MODE/LAST verify
diff --git a/jnls/go/water_vector_stack.jnl b/jnls/go/water_vector_stack.jnl
new file mode 100644
index 0000000..60c879b
--- /dev/null
+++ b/jnls/go/water_vector_stack.jnl
@@ -0,0 +1,50 @@
+\cancel mode verify
+
+! convert speed and direction to vector components.
+! Then call stack_stick.jnl to draw stack plot
+
+!  GO water_vector_stack spd dir lower_y upper_y
+
+! Arguments are 
+! $1  speed 
+! $2  direction
+! $3 lower limit on Y axes for all plots
+! $4 upper limit on Y axes for all plots
+
+! Example 
+!   yes? set data 44029a2007.nc
+!   yes? set region/t=1-mar-2007:15-apr-2007/k=1:10
+!   yes? go water_vector_stack.jnl water_spd water_dir -40 40
+
+ can mode logo
+
+
+! Define constants for converting degrees to radians
+
+let pi = atan(1)*4
+let deg2rad = pi/180
+
+! Variables must be on the same grid: Regrid water_dir to the grid of water_spd
+
+let dirr = $2[g=$1]
+
+! If there are units on the water speed variable use the same units for the vector components
+
+define symbol vector_units = "`$1,return=units`"
+
+! Define variables for uu and vv, vector components
+
+IF `($vector_units) EQ " "` THEN
+  let/title="Zonal Current"  uu = ABS(($1))* cos(deg2rad* dirr)
+  let/title="Meridional Current" vv = ABS(($1))* sin(deg2rad* dirr)
+ELSE
+  let/units=($vector_units)/title="Zonal Current "  uu = ABS(($1))* cos(deg2rad* dirr)
+  let/units=($vector_units)/title="Meridional Current " vv = ABS(($1))* sin(deg2rad* dirr)
+ENDIF
+
+! call stack plot script (optional arguments are the min and max vertical limits
+! on the right-hand y axes.)
+
+go stack_stick uu vv $3 $4
+set mode/last verify
+
diff --git a/jnls/go/white.jnl b/jnls/go/white.jnl
new file mode 100644
index 0000000..66850fb
--- /dev/null
+++ b/jnls/go/white.jnl
@@ -0,0 +1,9 @@
+\CANCEL MODE VERIFY     ! ... setting white background
+! updated 10/93 for Ferret V3.01
+
+! Description: set video background to white, foreground to black
+
+ppl color 1 0 0 0
+ppl color 0 100 100 100
+
+SET MODE/LAST VERIFY
diff --git a/jnls/go/wv5d.jnl b/jnls/go/wv5d.jnl
new file mode 100644
index 0000000..026c89f
--- /dev/null
+++ b/jnls/go/wv5d.jnl
@@ -0,0 +1,26 @@
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
+! wv5d.jnl --  Sets up and creates a vis5d file using 'external function' 
+!                   code in Ferret v4.91
+!                   
+! Ansley Manke
+! 7/98
+ 
+\cancel mode verify 
+! Description:  Set filename and write a vis5d file with up to 8 variables.
+
+!                    arg 1     arg 2     arg 3       arg 4           arg 9   
+!  usage:  GO wv5d file-name variable1 [variable2] [variable3] ... [variable8]
+
+!  Must have the filename and at least one variable
+!  Default to 0 any more variables not specified.
+
+! test argument before performing any actions
+query/ignore $1"<Argument 1 is the file name for vis5d file."
+query/ignore $2"<vis5d writes at least one variable to the file. Supply variable name"
+
+define symbol VIS5D_FILENAME = $1
+show symbol VIS5D_FILENAME
+let vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, 0)
+LOAD/TEMPORARY vflag
+
+set mode/last verify
diff --git a/jnls/go/wv5d_append.jnl b/jnls/go/wv5d_append.jnl
new file mode 100644
index 0000000..47852f3
--- /dev/null
+++ b/jnls/go/wv5d_append.jnl
@@ -0,0 +1,60 @@
+\cancel mode verify 
+
+! Description:  Set filename and write a vis5d file with up to 8 variables.
+!  Data is written to a scratch file, then appended to the data in the file.
+!  From the Vis5D README.txt file:
+
+!v5dappend
+!     Usage:  v5dappend [-var] [...] file.v5d [...] target.v5d
+!     
+!     Description:  v5dappend allows you to append a number of v5d files
+!     together to make one larger file.  This might be useful if your
+!     model generates a separate .v5d file for each timestep and
+!     you want to join those files together to view the data in Vis5D.
+!     
+!     The arguments are, in order:
+!        �  An optional list of variables to omit from the output file. For
+!          example, if you want to omit the variables U and THETA you would
+!          use the arguments -U and -THETA.
+!        �  The list of v5d files to append onto the target file.
+!        �  The name of the target v5d file to create (if it doesnt exit)
+!          or append onto (if the target file already exists).
+!     
+!     Note that the dimensions of the grids (rows, columns and levels) must
+!     be the same in each file to append them together.  The map projection
+!     and vertical coordinate system information will be taken from the
+!     first input file and ignored the the remaining files.
+     
+
+! Script usage:
+!                arg 1     arg 2      arg 3       arg 4           arg 9   
+!      GO wv5d file-name  variable1 [variable2] [variable3] ... [variable8]
+
+!  Must have the filename and at least one variable
+!  Default to 0 any more variables not specified.
+
+! test argument before performing any actions
+
+query/ignore $1"<Argument 1 is the file name for vis5d file."
+query/ignore $2"<vis5d writes at least one variable to the file. Supply variable name"
+
+DEFINE SYMBOL Making_vis5d_file Append to Vis5D file $1
+
+MESSAGE/CONTINUE !
+SHOW SYMBOL Making_vis5d_file
+
+!  Write the scratch file with new time records.
+ 
+DEFINE SYMBOL VIS5D_FILENAME = appnd_scratch.v5d
+let vflag = writev5d($2, $3%0%, $4%0%, $5%0%, $6%0%, $7%0%, $8%0%, $9%0%, 0)
+LOAD/TEMPORARY vflag
+
+!  v5dappend utility appends the new file onto the old.
+
+MESSAGE/CONTINUE !
+sp v5dappend appnd_scratch.v5d $1
+sp rm appnd_scratch.v5d
+
+set mode/last verify
+
+
diff --git a/jnls/go/xgridlines.jnl b/jnls/go/xgridlines.jnl
new file mode 100644
index 0000000..4f2cc69
--- /dev/null
+++ b/jnls/go/xgridlines.jnl
@@ -0,0 +1,64 @@
+\cancel mode verify  
+
+!**************************************************************
+! Description: plot over the vertical grid of a plot 
+!
+! Example: go xgridlines 20 1
+!          will plot every 20 on the physical xaxis a vertical bar
+!          made of line of 1% of the physical yaxis
+!
+! Notes: default vdelta is 1%   
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: brock at lsce.saclay.cea.fr
+!
+! Creation: Sept 2000
+! Version: 1.0
+! History:
+! Modification:
+!
+!**************************************************************
+
+query/ignore $1%<Usage: go xgridlines hdelta [vdelta]%
+
+! x1 = first vertical line (superior value)
+if `($XAXIS_MIN) lt 0` then
+        def sym gridlines_x1 = int(($XAXIS_MIN)/$1)*$1
+else
+        def sym gridlines_x1 = (int(($XAXIS_MIN)/$1)+1) *$1
+endif
+! x2 = last vertical line  (inferior value)
+if `($XAXIS_MAX) lt 0` then
+        def sym gridlines_x2 = (int(($XAXIS_MAX)/$1)-1) *$1
+else
+        def sym gridlines_x2 = (int(($XAXIS_MAX)/$1)) *$1
+endif
+def sym gridlines_xrange = (($gridlines_x2) - ($gridlines_x1))
+
+def sym gridlines_x = ($gridlines_x1) + (i-1)*$1
+def sym gridlines_nbx = int(($gridlines_xrange)/$1) + 1
+
+def sym gridlines_yrange = `($YAXIS_MAX)-($YAXIS_MIN)`
+def sym gridlines_y1 = ($YAXIS_MIN) + ($gridlines_yrange)*(j-1)/100
+def sym gridlines_y2 = ($YAXIS_MIN) + ($gridlines_yrange)*(j-1+$2%1%)/100
+
+if `($gridlines_nbx) ge 1` then
+        repeat/i=1:`($gridlines_nbx)`:1 ( repeat/j=1:100:`2*$2%1%` ppl aline 1,`($gridlines_x)`,`($gridlines_y1)`,`($gridlines_x)`,`($gridlines_y2)` )
+endif
+
+!**************************************************************
+cancel sym gridlines_x1
+cancel sym gridlines_x2
+cancel sym gridlines_xrange
+cancel sym gridlines_x
+cancel sym gridlines_nbx
+cancel sym gridlines_yrange
+cancel sym gridlines_y1
+cancel sym gridlines_y2
+
+!**************************************************************
+set mode/last verify
+
+
diff --git a/jnls/go/ygridlines.jnl b/jnls/go/ygridlines.jnl
new file mode 100644
index 0000000..b868fb0
--- /dev/null
+++ b/jnls/go/ygridlines.jnl
@@ -0,0 +1,62 @@
+\cancel mode verify  
+
+!**************************************************************
+! Description: plot over the horizontal grid of a plot 
+!
+! Example: go ygridlines 20 1
+!          will plot every 20 on the physical yaxis a horizontal bar
+!          made of line of 1% of the physical xaxis
+!
+! Notes: default hdelta is 1%   
+!
+! Calls:
+!
+! Author: Patrick Brockmann
+! Contact: brock at lsce.saclay.cea.fr
+!
+! Creation: Sept 2000
+! Version: 1.0
+! History:
+! Modification:
+!
+!**************************************************************
+query/ignore $1%<Usage: go ygridlines vdelta [hdelta]%
+
+! y1 = first horizontal line (superior value)
+if `($YAXIS_MIN) lt 0` then
+        def sym gridlines_y1 = int(($YAXIS_MIN)/$1)*$1
+else
+        def sym gridlines_y1 = (int(($YAXIS_MIN)/$1)+1) *$1
+endif
+! y2 = last horizontal line  (inferior value)
+if `($YAXIS_MAX) lt 0` then
+        def sym gridlines_y2 = (int(($YAXIS_MAX)/$1)-1) *$1
+else
+        def sym gridlines_y2 = (int(($YAXIS_MAX)/$1)) *$1
+endif
+def sym gridlines_yrange = (($gridlines_y2) - ($gridlines_y1))
+
+def sym gridlines_y = ($gridlines_y1) + (i-1)*$1
+def sym gridlines_nby = int(($gridlines_yrange)/$1) + 1
+
+def sym gridlines_xrange = `($XAXIS_MAX)-($XAXIS_MIN)`
+def sym gridlines_x1 = ($XAXIS_MIN) + ($gridlines_xrange)*(j-1)/100
+def sym gridlines_x2 = ($XAXIS_MIN) + ($gridlines_xrange)*(j-1+$2%1%)/100
+
+if `($gridlines_nby) ge 1` then
+        repeat/i=1:`($gridlines_nby)`:1 ( repeat/j=1:100:`2*$2%1%` ppl aline 1,`($gridlines_x1)`,`($gridlines_y)`,`($gridlines_x2)`,`($gridlines_y)` )
+endif
+
+!**************************************************************
+cancel sym gridlines_x1
+cancel sym gridlines_x2
+cancel sym gridlines_xrange
+cancel sym gridlines_y
+cancel sym gridlines_nby
+cancel sym gridlines_yrange
+cancel sym gridlines_y1
+cancel sym gridlines_y2
+
+!**************************************************************
+set mode/last verify
+
diff --git a/palettes/2patterns.pat b/palettes/2patterns.pat
new file mode 100644
index 0000000..d8531a4
--- /dev/null
+++ b/palettes/2patterns.pat
@@ -0,0 +1,2 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
diff --git a/palettes/3patterns.pat b/palettes/3patterns.pat
new file mode 100644
index 0000000..efc5210
--- /dev/null
+++ b/palettes/3patterns.pat
@@ -0,0 +1,3 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL
diff --git a/palettes/4patterns.pat b/palettes/4patterns.pat
new file mode 100644
index 0000000..96a5219
--- /dev/null
+++ b/palettes/4patterns.pat
@@ -0,0 +1,4 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL
+  4  LITE_HORIZONTAL          
diff --git a/palettes/5patterns.pat b/palettes/5patterns.pat
new file mode 100644
index 0000000..f4a35e7
--- /dev/null
+++ b/palettes/5patterns.pat
@@ -0,0 +1,5 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL            
+  4  LITE_HORIZONTAL          
+  5  LITE_UP_LEFT_TO_RIGHT    
diff --git a/palettes/6patterns.pat b/palettes/6patterns.pat
new file mode 100644
index 0000000..84a988f
--- /dev/null
+++ b/palettes/6patterns.pat
@@ -0,0 +1,6 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL            
+  4  LITE_HORIZONTAL          
+  5  LITE_UP_LEFT_TO_RIGHT    
+  6  LITE_UP_RIGHT_TO_LEFT    
diff --git a/palettes/7patterns.pat b/palettes/7patterns.pat
new file mode 100644
index 0000000..6904afb
--- /dev/null
+++ b/palettes/7patterns.pat
@@ -0,0 +1,7 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL            
+  4  LITE_HORIZONTAL          
+  5  LITE_UP_LEFT_TO_RIGHT    
+  6  LITE_UP_RIGHT_TO_LEFT    
+  7  DOUBLE_VERTICAL          
diff --git a/palettes/8patterns.pat b/palettes/8patterns.pat
new file mode 100644
index 0000000..ed09864
--- /dev/null
+++ b/palettes/8patterns.pat
@@ -0,0 +1,8 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL            
+  4  LITE_HORIZONTAL          
+  5  LITE_UP_LEFT_TO_RIGHT    
+  6  LITE_UP_RIGHT_TO_LEFT    
+  7  DOUBLE_VERTICAL          
+  8  DOUBLE_HORIZONTAL        
diff --git a/palettes/QC_by_level.spk b/palettes/QC_by_level.spk
new file mode 100644
index 0000000..32bf955
--- /dev/null
+++ b/palettes/QC_by_level.spk
@@ -0,0 +1,21 @@
+RGB_Mapping By_Level
+ 
+! Level    Red  Green   Blue
+   1     0.0    0.0  100.0  ! blue
+   2     0.0   60.0   30.0  ! green
+   3   100.0   90.0    0.0  ! yellow
+   4   100.0    0.0    0.0  ! bright red
+   5    70.0    0.0  100.0  ! purple
+   6    80.0   73.0   59.0  ! tan
+   7     0.0  100.0  100.0  ! cyan
+   8   100.0   50.0    0.0  ! orange
+   9     0      0      0    ! black 
+
+!A = 65
+!B = 66
+!C = 67
+!D = 68
+!F = 70
+!N = 78 
+!X = 88
+!U = 85
diff --git a/palettes/angled_grid.pat b/palettes/angled_grid.pat
new file mode 100644
index 0000000..a70518d
--- /dev/null
+++ b/palettes/angled_grid.pat
@@ -0,0 +1 @@
+1 ANGLED_GRID
diff --git a/palettes/ball_bearings.pat b/palettes/ball_bearings.pat
new file mode 100644
index 0000000..7535b17
--- /dev/null
+++ b/palettes/ball_bearings.pat
@@ -0,0 +1 @@
+1 BALL_BEARINGS
diff --git a/palettes/black.spk b/palettes/black.spk
new file mode 100644
index 0000000..e110b23
--- /dev/null
+++ b/palettes/black.spk
@@ -0,0 +1,2 @@
+0 0 0 0
+100 0 0 0
diff --git a/palettes/blue.spk b/palettes/blue.spk
new file mode 100644
index 0000000..a253df3
--- /dev/null
+++ b/palettes/blue.spk
@@ -0,0 +1,2 @@
+0 0 0 100
+100 0 0 100
diff --git a/palettes/blue_brown.spk b/palettes/blue_brown.spk
new file mode 100644
index 0000000..b512ff2
--- /dev/null
+++ b/palettes/blue_brown.spk
@@ -0,0 +1,14 @@
+! Reverse of Brown to Blue                                                 
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0     0.0    48.0    60.0
+     9.1     0.0    66.7    80.0
+    18.2    20.0    89.3   100.0
+    27.3    40.0    94.0   100.0
+    36.4    60.0    97.3   100.0
+    45.5    80.0    99.3   100.0
+    54.5    95.0    85.5    80.8
+    63.6    85.0    68.8    59.5
+    72.7    80.0    60.8    48.0
+    81.8    60.0    37.9    21.0
+    90.9    40.0    18.7     0.0
+   100.0    20.0    10.0     0.0
diff --git a/palettes/blue_dark.spk b/palettes/blue_dark.spk
new file mode 100644
index 0000000..ef37d7b
--- /dev/null
+++ b/palettes/blue_dark.spk
@@ -0,0 +1,3 @@
+  0   10   10   44 ! midnightblue
+100   10   10   44
+ 
\ No newline at end of file
diff --git a/palettes/blue_darkorange.spk b/palettes/blue_darkorange.spk
new file mode 100644
index 0000000..379ff88
--- /dev/null
+++ b/palettes/blue_darkorange.spk
@@ -0,0 +1,21 @@
+! Blue to Dark Orange, from Oregon
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0     0.0    40.0    40.0
+     5.9     0.0    60.0    60.0
+    11.8     0.0    80.0    80.0
+    17.6     0.0   100.0   100.0
+    23.5    20.0   100.0   100.0
+    29.4    40.0   100.0   100.0
+    35.3    60.0   100.0   100.0
+    41.2    70.0   100.0   100.0
+    47.1    80.0   100.0   100.0
+    52.9    90.0   100.0   100.0
+    58.8   100.0    90.0    80.0
+    64.7   100.0    79.3    60.0
+    70.6   100.0    68.0    40.0
+    76.5   100.0    56.0    20.0
+    82.4   100.0    43.3     0.0
+    88.2    80.0    33.3     0.0
+    94.1    60.0    24.0     0.0
+   100.0    40.0    15.3     0.0
+
diff --git a/palettes/blue_darkred.spk b/palettes/blue_darkred.spk
new file mode 100644
index 0000000..f5273dd
--- /dev/null
+++ b/palettes/blue_darkred.spk
@@ -0,0 +1,21 @@
+! Reverse of Dark Red to Blue, 18 steps, based on ColorBrewer RdYlBu_11 
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0    14.2     0.0    85.0
+     5.9     9.7    11.2    97.0
+    11.8    16.0    34.2   100.0
+    17.6    24.0    53.1   100.0
+    23.5    34.0    69.2   100.0
+    29.4    46.0    82.9   100.0
+    35.3    60.0    92.0   100.0
+    41.2    74.0    97.8   100.0
+    47.1    92.0   100.0   100.0
+    52.9   100.0   100.0    92.0
+    58.8   100.0    94.8    74.0
+    64.7   100.0    84.0    60.0
+    70.6   100.0    67.6    46.0
+    76.5   100.0    47.2    34.0
+    82.4   100.0    24.0    24.0
+    88.2    97.0    15.5    21.0
+    94.1    85.0     8.5    18.7
+   100.0    65.0     0.0    13.0
+
diff --git a/palettes/blue_green.spk b/palettes/blue_green.spk
new file mode 100644
index 0000000..4277271
--- /dev/null
+++ b/palettes/blue_green.spk
@@ -0,0 +1,17 @@
+! Blue-Green
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0     0.0     0.0   100.0
+     7.7    20.0    20.0   100.0
+    15.4    40.0    40.0   100.0
+    23.1    60.0    60.0   100.0
+    30.8    70.0    70.0   100.0
+    38.5    80.0    80.0   100.0
+    46.2    90.0    90.0   100.0
+    53.8    90.0   100.0    90.0
+    61.5    80.0   100.0    80.0
+    69.2    70.0   100.0    70.0
+    76.9    60.0   100.0    60.0
+    84.6    40.0   100.0    40.0
+    92.3    20.0   100.0    20.0
+   100.0     0.0   100.0     0.0
+
diff --git a/palettes/blue_green_yellow.spk b/palettes/blue_green_yellow.spk
new file mode 100644
index 0000000..867053e
--- /dev/null
+++ b/palettes/blue_green_yellow.spk
@@ -0,0 +1,12 @@
+! Reverse of Yellow-Green_blue spectrum from Colorbrewer
+! Sequential spectrum: friendly to colorblind, b/w printers, all displays
+     0.0     3.1    11.3    34.4
+    12.5    10.5    20.3    57.8
+    25.0    13.3    36.7    65.6
+    37.5    11.3    56.6    75.0
+    50.0    25.4    71.1    76.6
+    62.5    49.6    80.1    73.0
+    75.0    77.7    91.0    70.3
+    87.5    92.6    96.9    69.1
+   100.0    99.6    99.6    84.8
+
diff --git a/palettes/blue_light.spk b/palettes/blue_light.spk
new file mode 100644
index 0000000..2986296
--- /dev/null
+++ b/palettes/blue_light.spk
@@ -0,0 +1,3 @@
+  0  60  80 100 ! 69   89  100 !    69   89  100 
+100  60  80 100
+ 
\ No newline at end of file
diff --git a/palettes/blue_orange.spk b/palettes/blue_orange.spk
new file mode 100644
index 0000000..d80ec69
--- /dev/null
+++ b/palettes/blue_orange.spk
@@ -0,0 +1,14 @@
+! Blue to Orange, 12 steps
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0     0.0    16.7   100.0
+     9.1    10.0    40.0   100.0
+    18.2    20.0    60.0   100.0
+    27.3    40.0    80.0   100.0
+    36.4    60.0    93.3   100.0
+    45.5    80.0   100.0   100.0
+    54.5   100.0   100.0    80.0
+    63.6   100.0    93.3    60.0
+    72.7   100.0    80.0    40.0
+    81.8   100.0    60.0    20.0
+    90.9   100.0    40.0    10.0
+   100.0   100.0    16.7     0.0
diff --git a/palettes/blue_red_centered.spk b/palettes/blue_red_centered.spk
new file mode 100644
index 0000000..1b05ece
--- /dev/null
+++ b/palettes/blue_red_centered.spk
@@ -0,0 +1,14 @@
+! blue_red_centered.spk
+! (contributed by Ryo Furue as r_b.spk)
+! dark blue -> blue -> white -> red -> dark red
+!
+   0       0  20  40
+  20       0  50 100
+  30      45  70 100
+  44      90  90 100
+  49.001 100 100 100
+  50.999 100 100 100
+  56     100  90  90
+  70     100  45  45
+  80     100   0   0
+ 100      40   0   0
diff --git a/palettes/blue_red_gray_centered.spk b/palettes/blue_red_gray_centered.spk
new file mode 100644
index 0000000..e7a8736
--- /dev/null
+++ b/palettes/blue_red_gray_centered.spk
@@ -0,0 +1,14 @@
+! blue_gray_red_centered.spk
+! (contributed by Ryo Furue as r_b_gray.spk)
+! dark blue -> blue -> gray -> red -> dark red
+!
+   0       0  20  40
+  20       0  50 100
+  30      45  70 100
+  44      85  85 100
+  44.001  85  85  85
+  55.999  85  85  85
+  56     100  85  85
+  70     100  45  45
+  80     100   0   0
+ 100      40   0   0
diff --git a/palettes/blue_red_nowhite_centered.spk b/palettes/blue_red_nowhite_centered.spk
new file mode 100644
index 0000000..ecadcf0
--- /dev/null
+++ b/palettes/blue_red_nowhite_centered.spk
@@ -0,0 +1,13 @@
+! blue_red_nowhite_centered.spk
+! (contributed by Ryo Furue as r_b_nowhite.spk)
+! variation on red_blue.spk without white.
+! dark blue -> blue -> red -> dark red
+!
+   0       0  20  40
+  20       0  50 100
+  30      45  70 100
+  49.999  90  90 100
+  50.001 100  90  90
+  70     100  45  45
+  80     100   0   0
+ 100      40   0   0
diff --git a/palettes/blues_cmyk.spk b/palettes/blues_cmyk.spk
new file mode 100644
index 0000000..8ec8add
--- /dev/null
+++ b/palettes/blues_cmyk.spk
@@ -0,0 +1,8 @@
+   0.000  94.510  96.078  95.686
+  14.286  81.961  87.843  93.333
+  28.571  72.941  84.706  91.373
+  42.857  53.333  73.333  83.529
+  57.143  29.412  53.333  74.510
+  71.429  11.373  27.843  60.392
+  85.714   3.529  15.686  41.176
+ 100.000   5.490   9.412  20.000
diff --git a/palettes/bluescale.spk b/palettes/bluescale.spk
new file mode 100644
index 0000000..bb051fc
--- /dev/null
+++ b/palettes/bluescale.spk
@@ -0,0 +1,2 @@
+0 0 0 95
+100 95 95 95
diff --git a/palettes/brick.pat b/palettes/brick.pat
new file mode 100644
index 0000000..a4bb219
--- /dev/null
+++ b/palettes/brick.pat
@@ -0,0 +1 @@
+1 BRICK
diff --git a/palettes/bright_centered.spk b/palettes/bright_centered.spk
new file mode 100644
index 0000000..7748e8d
--- /dev/null
+++ b/palettes/bright_centered.spk
@@ -0,0 +1,9 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   49.0    0.0  100.0    0.0
+   51.0  100.0  100.0    0.0
+   55.0  100.0   80.0    0.0
+   75.0  100.0    0.0    0.0
+   80.0   80.0    0.0    0.0
+   90.0   60.0    5.0    5.0
+  100.0   35.0   10.0   10.0
diff --git a/palettes/broad.spk b/palettes/broad.spk
new file mode 100644
index 0000000..3b036f2
--- /dev/null
+++ b/palettes/broad.spk
@@ -0,0 +1,10 @@
+  0.   30.    0.   30.
+ 15.  100.    0.  100.
+ 25.   30.    0.  100.
+ 26.    0.    0.  100.
+ 34.    0.    0.   60.
+ 50.    0.  100.  100.
+ 60.    0.   50.    0.
+ 75.  100.  100.    0.
+ 90.  100.    0.    0.
+100.   40.    0.    0.
diff --git a/palettes/brown.spk b/palettes/brown.spk
new file mode 100644
index 0000000..05dd44e
--- /dev/null
+++ b/palettes/brown.spk
@@ -0,0 +1,2 @@
+  0  52   42   35 
+100  52   42   35 
diff --git a/palettes/brown_blue.spk b/palettes/brown_blue.spk
new file mode 100644
index 0000000..9b130c7
--- /dev/null
+++ b/palettes/brown_blue.spk
@@ -0,0 +1,14 @@
+! Brown to Blue                                                 
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0    20.0    10.0     0.0
+     9.1    40.0    18.7     0.0
+    18.2    60.0    37.9    21.0
+    27.3    80.0    60.8    48.0
+    36.4    85.0    68.8    59.5
+    45.5    95.0    85.5    80.8
+    54.5    80.0    99.3   100.0
+    63.6    60.0    97.3   100.0
+    72.7    40.0    94.0   100.0
+    81.8    20.0    89.3   100.0
+    90.9     0.0    66.7    80.0
+   100.0     0.0    48.0    60.0
diff --git a/palettes/brown_dark.spk b/palettes/brown_dark.spk
new file mode 100644
index 0000000..5ca093c
--- /dev/null
+++ b/palettes/brown_dark.spk
@@ -0,0 +1,2 @@
+  0 30   22   15  ! 35   27   20
+100 30   22   15
diff --git a/palettes/brown_green.spk b/palettes/brown_green.spk
new file mode 100644
index 0000000..79e7e94
--- /dev/null
+++ b/palettes/brown_green.spk
@@ -0,0 +1,9 @@
+     0.0    54.7    31.6     3.9
+    12.5    74.6    50.4    17.6
+    25.0    87.1    75.8    48.8
+    37.5    96.1    90.6    76.2
+    50.0    90.6    95.7    95.7
+    62.5    77.7    91.4    89.5
+    75.0    50.0    80.1    75.4
+    87.5    20.7    59.0    55.9
+   100.0     0.4    39.8    36.7
diff --git a/palettes/brown_light.spk b/palettes/brown_light.spk
new file mode 100644
index 0000000..997885d
--- /dev/null
+++ b/palettes/brown_light.spk
@@ -0,0 +1,2 @@
+  0   80   69   58                             
+100   80   69   58
diff --git a/palettes/brown_orange_yellow.spk b/palettes/brown_orange_yellow.spk
new file mode 100644
index 0000000..961c154
--- /dev/null
+++ b/palettes/brown_orange_yellow.spk
@@ -0,0 +1,9 @@
+     0.0    39.8    14.5     2.3
+    12.5    59.8    20.3     1.6
+    25.0    79.7    29.7     0.8
+    37.5    92.2    43.8     7.8
+    50.0    99.2    59.8    16.0
+    62.5    99.2    76.6    30.9
+    75.0    99.2    88.7    56.6
+    87.5    99.6    96.5    73.4
+   100.0    99.6    99.6    89.5
diff --git a/palettes/categorical_12_step.spk b/palettes/categorical_12_step.spk
new file mode 100644
index 0000000..21a32d0
--- /dev/null
+++ b/palettes/categorical_12_step.spk
@@ -0,0 +1,14 @@
+! Categorical 12-step scheme, after ColorBrewer 11-step Paired Scheme     
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+    0.0  100.0   75.0   50.0
+    9.1  100.0   50.0    0.0
+   18.2  100.0  100.0   60.0
+   27.3  100.0  100.0   20.0
+   36.4   70.0  100.0   55.0
+   45.5   20.0  100.0    0.0
+   54.5   65.0   93.0  100.0
+   63.6   10.0   70.0  100.0
+   72.7   80.0   75.0  100.0
+   81.8   40.0   30.0  100.0
+   90.9  100.0   60.0   75.0
+  100.0   90.0   10.0   20.0
diff --git a/palettes/centered.spk b/palettes/centered.spk
new file mode 100644
index 0000000..fbdfce0
--- /dev/null
+++ b/palettes/centered.spk
@@ -0,0 +1,9 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   49.0    0.0  100.0    0.0
+   51.0  100.0  100.0    0.0
+   55.0  100.0   80.0    0.0
+   75.0  100.0    0.0    0.0
+   80.0   80.0    0.0    0.0
+   90.0   60.0   50.0   50.0
+  100.0  100.0   75.0   75.0
diff --git a/palettes/centered_diff.spk b/palettes/centered_diff.spk
new file mode 100644
index 0000000..6b92291
--- /dev/null
+++ b/palettes/centered_diff.spk
@@ -0,0 +1,8 @@
+! Centered palette for differences in LAS
+! bright blue-green to blue to dark-red to dark-yellow 
+  0    0   80   80
+ 30   20   40   80
+ 50  100  100  100
+ 60   70    0    0
+ 80  100   30    0
+100  100   90    0
diff --git a/palettes/centered_turq_red_purple.spk b/palettes/centered_turq_red_purple.spk
new file mode 100644
index 0000000..9ea8cb0
--- /dev/null
+++ b/palettes/centered_turq_red_purple.spk
@@ -0,0 +1,5 @@
+  0    0   80   80
+ 30   20   40   80
+ 50  100  100  100
+ 60   60    0   65
+100  100   20    0
diff --git a/palettes/cyan.spk b/palettes/cyan.spk
new file mode 100644
index 0000000..3cdf2b9
--- /dev/null
+++ b/palettes/cyan.spk
@@ -0,0 +1,2 @@
+  0 0 100 100
+100 0 100 100
diff --git a/palettes/cyan_dark.spk b/palettes/cyan_dark.spk
new file mode 100644
index 0000000..cd727b4
--- /dev/null
+++ b/palettes/cyan_dark.spk
@@ -0,0 +1,2 @@
+  0 0 63 68
+100 0 63 68
diff --git a/palettes/cyan_light.spk b/palettes/cyan_light.spk
new file mode 100644
index 0000000..fbd36b2
--- /dev/null
+++ b/palettes/cyan_light.spk
@@ -0,0 +1,2 @@
+  0   77  100  100                                        
+100   77  100  100
diff --git a/palettes/dark_horizontal.pat b/palettes/dark_horizontal.pat
new file mode 100644
index 0000000..11328ff
--- /dev/null
+++ b/palettes/dark_horizontal.pat
@@ -0,0 +1 @@
+1 DARK_HORIZONTAL
diff --git a/palettes/dark_land_sea.spk b/palettes/dark_land_sea.spk
new file mode 100644
index 0000000..a72cef5
--- /dev/null
+++ b/palettes/dark_land_sea.spk
@@ -0,0 +1,8 @@
+   0.   0.   0.  40.
+   5.  20.  20.  50.
+  20.  30.  30. 100.
+  50.  50. 100. 100.
+  50.1  0.  50.   0.
+  70.  70.  70.   0.
+  90.  75.  40.   0.
+ 100.  75.  70.  65.
diff --git a/palettes/dark_terrestrial.spk b/palettes/dark_terrestrial.spk
new file mode 100644
index 0000000..f4f78d2
--- /dev/null
+++ b/palettes/dark_terrestrial.spk
@@ -0,0 +1,14 @@
+  0.   0.  50.   0.
+ 30.  70.  70.   0.
+ 80.  75.  40.   0.
+100.  75.  70.  65.
+
+
+
+
+
+
+
+
+
+
diff --git a/palettes/dark_up_left_to_right.pat b/palettes/dark_up_left_to_right.pat
new file mode 100644
index 0000000..49a3a5a
--- /dev/null
+++ b/palettes/dark_up_left_to_right.pat
@@ -0,0 +1 @@
+1 DARK_UP_LEFT_TO_RIGHT
diff --git a/palettes/dark_up_right_to_left.pat b/palettes/dark_up_right_to_left.pat
new file mode 100644
index 0000000..f0c7dc4
--- /dev/null
+++ b/palettes/dark_up_right_to_left.pat
@@ -0,0 +1 @@
+1 DARK_UP_RIGHT_TO_LEFT
diff --git a/palettes/dark_vertical.pat b/palettes/dark_vertical.pat
new file mode 100644
index 0000000..52f2d83
--- /dev/null
+++ b/palettes/dark_vertical.pat
@@ -0,0 +1 @@
+1 DARK_VERTICAL
diff --git a/palettes/darkorange_blue.spk b/palettes/darkorange_blue.spk
new file mode 100644
index 0000000..c9a5d22
--- /dev/null
+++ b/palettes/darkorange_blue.spk
@@ -0,0 +1,20 @@
+! Reverse of Blue to Dark Orange, from Oregon
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     5.9    40.0    15.3     0.0
+    11.8    60.0    24.0     0.0
+    17.6    80.0    33.3     0.0
+    23.5   100.0    43.3     0.0
+    29.4   100.0    56.0    20.0
+    35.3   100.0    68.0    40.0
+    41.2   100.0    79.3    60.0
+    47.1   100.0    90.0    80.0
+    52.9    90.0   100.0   100.0
+    58.8    80.0   100.0   100.0
+    64.7    70.0   100.0   100.0
+    70.6    60.0   100.0   100.0
+    76.5    40.0   100.0   100.0
+    82.4    20.0   100.0   100.0
+    88.2     0.0   100.0   100.0
+    94.1     0.0    80.0    80.0
+   100.0     0.0    60.0    60.0
+   105.9     0.0    40.0    40.0
diff --git a/palettes/darkred_blue.spk b/palettes/darkred_blue.spk
new file mode 100644
index 0000000..e8c4036
--- /dev/null
+++ b/palettes/darkred_blue.spk
@@ -0,0 +1,20 @@
+! Red to Dark Blue, 18 steps, based on ColorBrewer RdYlBu_11
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0    65.0     0.0    13.0
+     5.9    85.0     8.5    18.7
+    11.8    97.0    15.5    21.0
+    17.6   100.0    24.0    24.0
+    23.5   100.0    47.2    34.0
+    29.4   100.0    67.6    46.0
+    35.3   100.0    84.0    60.0
+    41.2   100.0    94.8    74.0
+    47.1   100.0   100.0    92.0
+    52.9    92.0   100.0   100.0
+    58.8    74.0    97.8   100.0
+    64.7    60.0    92.0   100.0
+    70.6    46.0    82.9   100.0
+    76.5    34.0    69.2   100.0
+    82.4    24.0    53.1   100.0
+    88.2    16.0    34.2   100.0
+    94.1     9.7    11.2    97.0
+   100.0    14.2     0.0    85.0
diff --git a/palettes/default.pat b/palettes/default.pat
new file mode 100644
index 0000000..96a5219
--- /dev/null
+++ b/palettes/default.pat
@@ -0,0 +1,4 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL
+  4  LITE_HORIZONTAL          
diff --git a/palettes/default.spk b/palettes/default.spk
new file mode 100644
index 0000000..cd436fa
--- /dev/null
+++ b/palettes/default.spk
@@ -0,0 +1,6 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   33.0    0.0   60.0   30.0
+   66.0  100.0  100.0    0.0
+   90.0  100.0    0.0    0.0
+  100.0   60.0    0.0    0.0
diff --git a/palettes/double_horizontal.pat b/palettes/double_horizontal.pat
new file mode 100644
index 0000000..5ef5eb4
--- /dev/null
+++ b/palettes/double_horizontal.pat
@@ -0,0 +1 @@
+1 DOUBLE_HORIZONTAL
diff --git a/palettes/double_vertical.pat b/palettes/double_vertical.pat
new file mode 100644
index 0000000..4812724
--- /dev/null
+++ b/palettes/double_vertical.pat
@@ -0,0 +1 @@
+1 DOUBLE_VERTICAL
diff --git a/palettes/dynamic_cmyk.spk b/palettes/dynamic_cmyk.spk
new file mode 100644
index 0000000..0eef72b
--- /dev/null
+++ b/palettes/dynamic_cmyk.spk
@@ -0,0 +1,11 @@
+   0.000  94.902  94.510  94.902
+  10.000  94.510  88.627  94.118
+  20.000  69.804  62.745  80.392
+  30.000  50.196  65.098  80.784
+  40.000  40.392  75.686  60.784
+  50.000  33.725  69.412  20.000
+  60.000  80.000  90.588   4.314
+  70.000  98.039  96.078   9.804
+  80.000  97.255  50.980   6.667
+  90.000  98.039   7.059   4.706
+ 100.000  59.608   5.882   3.137
diff --git a/palettes/etop_values.spk b/palettes/etop_values.spk
new file mode 100644
index 0000000..09f137a
--- /dev/null
+++ b/palettes/etop_values.spk
@@ -0,0 +1,22 @@
+
+! another palette for ocean/terrestrial elevation.
+! ACM 08/07
+
+! Colors similar to land_sea_values but with more purples in the lower
+! ocean and ending with a dark brown. Here are some good levels values
+! (-inf)(-6000,-1000,500)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,5000,500)(inf)
+
+RGB_Mapping By_Value
+
+   
+! Val    R    G    B
+-7000. 22.   7.  36.    ! blue-black
+-6000  27.   8.  50.    ! dark purple
+-4000  20.  20. 100.    ! blue
+ -200   50. 100. 100.   ! turq
+ -0.1  90. 100. 100.    ! light green-blue
+   0.   0.  90.   0.    ! green
+  100   0.  35.   0.    ! dark green
+ 1000 100. 100.   0.    ! yellow
+ 4000  75.  40.   0.    ! brown
+ 5000  40.  19.   0.    ! dark brown
diff --git a/palettes/exciting_cmyk.spk b/palettes/exciting_cmyk.spk
new file mode 100644
index 0000000..3b754ba
--- /dev/null
+++ b/palettes/exciting_cmyk.spk
@@ -0,0 +1,10 @@
+   0.000  94.510  88.627  94.118
+  11.111  69.804  62.745  80.392
+  22.222  50.196  65.098  80.784
+  33.333  40.392  75.686  60.784
+  44.444  33.725  69.412  20.000
+  55.556  80.000  90.588   4.314
+  66.667  98.039  96.078   9.804
+  77.778  97.255  50.980   6.667
+  88.889  98.039   7.059   4.706
+ 100.000  59.608   5.882   3.137
diff --git a/palettes/fish_scale.pat b/palettes/fish_scale.pat
new file mode 100644
index 0000000..2860647
--- /dev/null
+++ b/palettes/fish_scale.pat
@@ -0,0 +1 @@
+1 FISH_SCALE
diff --git a/palettes/gray.spk b/palettes/gray.spk
new file mode 100644
index 0000000..897d6c4
--- /dev/null
+++ b/palettes/gray.spk
@@ -0,0 +1,2 @@
+0 50 50 50 
+100 50 50 50
diff --git a/palettes/gray_dark.spk b/palettes/gray_dark.spk
new file mode 100644
index 0000000..2801307
--- /dev/null
+++ b/palettes/gray_dark.spk
@@ -0,0 +1,2 @@
+  0 30   30   30     ! DimGray
+100 30   30   30
diff --git a/palettes/gray_light.spk b/palettes/gray_light.spk
new file mode 100644
index 0000000..6545519
--- /dev/null
+++ b/palettes/gray_light.spk
@@ -0,0 +1,2 @@
+  0 75   75   75 
+100 75   75   75
diff --git a/palettes/grayscale.spk b/palettes/grayscale.spk
new file mode 100644
index 0000000..6de9abe
--- /dev/null
+++ b/palettes/grayscale.spk
@@ -0,0 +1,2 @@
+    0.0   20.0   20.0   20.0
+  100.0   95.0   95.0   95.0
diff --git a/palettes/green.spk b/palettes/green.spk
new file mode 100644
index 0000000..bcbba27
--- /dev/null
+++ b/palettes/green.spk
@@ -0,0 +1,2 @@
+0 0 100 0
+100 0 100 0
diff --git a/palettes/green_blue.spk b/palettes/green_blue.spk
new file mode 100644
index 0000000..77904f4
--- /dev/null
+++ b/palettes/green_blue.spk
@@ -0,0 +1,17 @@
+! reverse of Blue-Green
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+
+     0.0     0.0   100.0     0.0
+     7.7    20.0   100.0    20.0
+    15.4    40.0   100.0    40.0
+    23.1    60.0   100.0    60.0
+    30.8    70.0   100.0    70.0
+    38.5    80.0   100.0    80.0
+    46.2    90.0   100.0    90.0
+    53.8    90.0    90.0   100.0
+    61.5    80.0    80.0   100.0
+    69.2    70.0    70.0   100.0
+    76.9    60.0    60.0   100.0
+    84.6    40.0    40.0   100.0
+    92.3    20.0    20.0   100.0
+   100.0     0.0     0.0   100.0
diff --git a/palettes/green_brown.spk b/palettes/green_brown.spk
new file mode 100644
index 0000000..ba56527
--- /dev/null
+++ b/palettes/green_brown.spk
@@ -0,0 +1,9 @@
+     0.0     0.4    39.8    36.7
+    12.5    20.7    59.0    55.9
+    25.0    50.0    80.1    75.4
+    37.5    77.7    91.4    89.5
+    50.0    90.6    95.7    95.7
+    62.5    96.1    90.6    76.2
+    75.0    87.1    75.8    48.8
+    87.5    74.6    50.4    17.6
+   100.0    54.7    31.6     3.9
diff --git a/palettes/green_dark.spk b/palettes/green_dark.spk
new file mode 100644
index 0000000..f25582e
--- /dev/null
+++ b/palettes/green_dark.spk
@@ -0,0 +1,2 @@
+   0    0  55  00 
+ 100    0  55  00 
diff --git a/palettes/green_deep.spk b/palettes/green_deep.spk
new file mode 100644
index 0000000..6ae4414
--- /dev/null
+++ b/palettes/green_deep.spk
@@ -0,0 +1,2 @@
+   0    0 20 10
+ 100    0 20 10
diff --git a/palettes/green_light.spk b/palettes/green_light.spk
new file mode 100644
index 0000000..fce9641
--- /dev/null
+++ b/palettes/green_light.spk
@@ -0,0 +1,2 @@
+  0    80. 100.   0. ! light green
+100    80. 100.   0.
diff --git a/palettes/green_magenta.spk b/palettes/green_magenta.spk
new file mode 100644
index 0000000..7f225a1
--- /dev/null
+++ b/palettes/green_magenta.spk
@@ -0,0 +1,18 @@
+! Green to Magenta
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0     0.0    31.6     0.0
+     6.7     0.0    52.6     0.0
+    13.3     0.0    73.7     0.0
+    20.0     0.0    94.7     0.0
+    26.7    31.6   100.0    31.6
+    33.3    52.6   100.0    52.6
+    40.0    73.7   100.0    73.7
+    46.7   100.0   100.0   100.0
+    53.3   100.0    94.7   100.0
+    60.0   100.0    73.7   100.0
+    66.7   100.0    52.6   100.0
+    73.3   100.0    31.6   100.0
+    80.0    94.7     0.0    94.7
+    86.7    73.7     0.0    73.7
+    93.3    52.6     0.0    52.6
+   100.0    31.6     0.0    31.6
diff --git a/palettes/greens_cmyk.spk b/palettes/greens_cmyk.spk
new file mode 100644
index 0000000..e5e5409
--- /dev/null
+++ b/palettes/greens_cmyk.spk
@@ -0,0 +1,8 @@
+   0.000  83.137  89.412  84.314
+  14.286  72.941  89.412  73.725
+  28.571  61.961  84.706  63.137
+  42.857  40.000  74.902  49.020
+  57.143   0.000  50.196  30.588
+  71.429   0.000  33.333  18.824
+  85.714   7.451  18.824  10.588
+ 100.000   0.392   8.235   6.275
diff --git a/palettes/greenscale.spk b/palettes/greenscale.spk
new file mode 100644
index 0000000..3637c79
--- /dev/null
+++ b/palettes/greenscale.spk
@@ -0,0 +1,2 @@
+0 0 95 0
+100 95 95 95
diff --git a/palettes/grey.spk b/palettes/grey.spk
new file mode 100644
index 0000000..897d6c4
--- /dev/null
+++ b/palettes/grey.spk
@@ -0,0 +1,2 @@
+0 50 50 50 
+100 50 50 50
diff --git a/palettes/grey_dark.spk b/palettes/grey_dark.spk
new file mode 100644
index 0000000..2801307
--- /dev/null
+++ b/palettes/grey_dark.spk
@@ -0,0 +1,2 @@
+  0 30   30   30     ! DimGray
+100 30   30   30
diff --git a/palettes/grey_light.spk b/palettes/grey_light.spk
new file mode 100644
index 0000000..6545519
--- /dev/null
+++ b/palettes/grey_light.spk
@@ -0,0 +1,2 @@
+  0 75   75   75 
+100 75   75   75
diff --git a/palettes/greyscale.spk b/palettes/greyscale.spk
new file mode 100644
index 0000000..6de9abe
--- /dev/null
+++ b/palettes/greyscale.spk
@@ -0,0 +1,2 @@
+    0.0   20.0   20.0   20.0
+  100.0   95.0   95.0   95.0
diff --git a/palettes/horizontal.pat b/palettes/horizontal.pat
new file mode 100644
index 0000000..6778384
--- /dev/null
+++ b/palettes/horizontal.pat
@@ -0,0 +1 @@
+  1  LITE_HORIZONTAL          
diff --git a/palettes/inverse_bluescale.spk b/palettes/inverse_bluescale.spk
new file mode 100644
index 0000000..af7ca44
--- /dev/null
+++ b/palettes/inverse_bluescale.spk
@@ -0,0 +1,2 @@
+0 95 95 95
+100 0 0 95
diff --git a/palettes/inverse_dark_rainbow.spk b/palettes/inverse_dark_rainbow.spk
new file mode 100644
index 0000000..cb2818f
--- /dev/null
+++ b/palettes/inverse_dark_rainbow.spk
@@ -0,0 +1,6 @@
+    0.0   60.0    0.0    0.0
+   10.0  100.0    0.0    0.0
+   33.0  100.0  100.0    0.0
+   66.0    0.0   60.0   30.0
+   90.0   30.0   20.0  100.0
+  100.0   33.0   10.0   55.0
diff --git a/palettes/inverse_grayscale.spk b/palettes/inverse_grayscale.spk
new file mode 100644
index 0000000..fd66b1b
--- /dev/null
+++ b/palettes/inverse_grayscale.spk
@@ -0,0 +1,2 @@
+    0.0   95.0   95.0   95.0
+  100.0   20.0   20.0   20.0
diff --git a/palettes/inverse_greenscale.spk b/palettes/inverse_greenscale.spk
new file mode 100644
index 0000000..a972fbe
--- /dev/null
+++ b/palettes/inverse_greenscale.spk
@@ -0,0 +1,2 @@
+0 95 95 95
+100 0 95 0
diff --git a/palettes/inverse_greyscale.spk b/palettes/inverse_greyscale.spk
new file mode 100644
index 0000000..fd66b1b
--- /dev/null
+++ b/palettes/inverse_greyscale.spk
@@ -0,0 +1,2 @@
+    0.0   95.0   95.0   95.0
+  100.0   20.0   20.0   20.0
diff --git a/palettes/inverse_redscale.spk b/palettes/inverse_redscale.spk
new file mode 100644
index 0000000..538e881
--- /dev/null
+++ b/palettes/inverse_redscale.spk
@@ -0,0 +1,2 @@
+0 95 95 95
+100 95 0 0
diff --git a/palettes/land_sea.spk b/palettes/land_sea.spk
new file mode 100644
index 0000000..f3504a3
--- /dev/null
+++ b/palettes/land_sea.spk
@@ -0,0 +1,8 @@
+   0.   0.   0.  40.
+   5.  20.  20.  50.
+  20.  30.  30. 100.
+  50.  50. 100. 100.
+  50.1  0.  90.   0.
+  70. 100. 100.   0.
+  90.  75.  40.   0.
+ 100.  75.  70.  65.
diff --git a/palettes/land_sea3.spk b/palettes/land_sea3.spk
new file mode 100644
index 0000000..55d3758
--- /dev/null
+++ b/palettes/land_sea3.spk
@@ -0,0 +1,23 @@
+! Palette for ocean/terrestrial elevation.
+! *jc* 11/00
+
+! Good levels for US elevation (in meters):
+! (-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,6000,1000)
+
+RGB_Mapping By_Value
+
+! Val    R    G    B
+-8000.    0.   0.  10.
+-4000.    0.   0.  50.
+-2000.    0.   0. 100.
+ -300.   40.  70. 100.
+ -100.   50. 100. 100.
+  -50.   40.  80.  70.
+   -0.1  90. 100. 100.
+    0.    0.  20.  00. ! dark green
+  100.    0.  70.  30. ! light green
+  300.   90. 100.   0. ! light yellow
+ 1200.   60.  30.   0. ! rust
+ 4000.   90.  90. 100. ! ice blue
+ 5000.  100. 100. 100. ! white
+
diff --git a/palettes/land_sea_values.spk b/palettes/land_sea_values.spk
new file mode 100644
index 0000000..98dc338
--- /dev/null
+++ b/palettes/land_sea_values.spk
@@ -0,0 +1,17 @@
+! Colors similar to land_sea, given by_value
+
+RGB_Mapping By_Value
+
+   
+! Val    R    G    B
+-8000   0.   0.  40.         ! dark blue
+-6000  20.  20.  50.
+-4000  30.  30. 100.
+-300   50. 100. 100.        ! turq
+ -0.1  90. 100. 100.        ! light green-blue
+   0.   0.  90.   0.    ! green
+  600   0.  45.   0.    ! dark green
+ 1200 100. 100.   0.    ! yellow
+ 4000  75.  40.   0.    ! brown
+ 5000  40.  19.   0.     ! dark brown
+
diff --git a/palettes/large_grid.pat b/palettes/large_grid.pat
new file mode 100644
index 0000000..043fe3f
--- /dev/null
+++ b/palettes/large_grid.pat
@@ -0,0 +1 @@
+1 LARGE_GRID
diff --git a/palettes/light_bottom.spk b/palettes/light_bottom.spk
new file mode 100644
index 0000000..01a2b57
--- /dev/null
+++ b/palettes/light_bottom.spk
@@ -0,0 +1,16 @@
+! palette suited to data with low significance at low values  
+! *sh* 2/00
+
+RGB_Mapping Percent
+
+! Lev  R    G    B
+0     100. 100. 100.
+24     50. 100. 100.
+45     30.  30. 100.
+56     20.  20.  50.
+67     10.  60.  10.
+78     50. 100.  50.
+89    100. 100.   0.
+100   100.    0.  0.
+
+
diff --git a/palettes/light_centered.spk b/palettes/light_centered.spk
new file mode 100644
index 0000000..656617d
--- /dev/null
+++ b/palettes/light_centered.spk
@@ -0,0 +1,5 @@
+0     0  100  100
+30   20   20  100
+50  100  100  100
+70  100   20   20
+100 100  100    0
diff --git a/palettes/light_rainbow.spk b/palettes/light_rainbow.spk
new file mode 100644
index 0000000..05cdee4
--- /dev/null
+++ b/palettes/light_rainbow.spk
@@ -0,0 +1,8 @@
+    0.0   80.0   50.0  100.0
+   10.0   60.0   60.0  100.0
+   33.0    0.0   90.0   90.0
+   66.0  100.0  100.0   50.0
+   90.0  100.0   50.0   50.0
+  100.0   80.0   45.0   45.0
+
+
diff --git a/palettes/lightgray_bottom.spk b/palettes/lightgray_bottom.spk
new file mode 100644
index 0000000..c6a9541
--- /dev/null
+++ b/palettes/lightgray_bottom.spk
@@ -0,0 +1,15 @@
+! lightgray_bottom palette, for data that has values of zero
+! to appear with little fanfare
+! otherwise based on rainbow
+
+RGB_Mapping Percent
+
+! Lev  R    G    B
+    0   95   98   98
+   10   30   20  100
+   33    0   60   30
+   66  100  100    0
+   90  100    0    0
+  100   60    0    0
+
+
diff --git a/palettes/lite_horizontal.pat b/palettes/lite_horizontal.pat
new file mode 100644
index 0000000..5eae052
--- /dev/null
+++ b/palettes/lite_horizontal.pat
@@ -0,0 +1 @@
+1 LITE_HORIZONTAL
diff --git a/palettes/lite_up_left_to_right.pat b/palettes/lite_up_left_to_right.pat
new file mode 100644
index 0000000..885b60f
--- /dev/null
+++ b/palettes/lite_up_left_to_right.pat
@@ -0,0 +1 @@
+1 LITE_UP_LEFT_TO_RIGHT
diff --git a/palettes/lite_up_right_to_left.pat b/palettes/lite_up_right_to_left.pat
new file mode 100644
index 0000000..5dcf8c5
--- /dev/null
+++ b/palettes/lite_up_right_to_left.pat
@@ -0,0 +1 @@
+1 LITE_UP_RIGHT_TO_LEFT
diff --git a/palettes/lite_vertical.pat b/palettes/lite_vertical.pat
new file mode 100644
index 0000000..c0bf109
--- /dev/null
+++ b/palettes/lite_vertical.pat
@@ -0,0 +1 @@
+1 LITE_VERTICAL
diff --git a/palettes/low_blue.spk b/palettes/low_blue.spk
new file mode 100644
index 0000000..49bc4aa
--- /dev/null
+++ b/palettes/low_blue.spk
@@ -0,0 +1,5 @@
+  0   0  60  40
+ 40  40 100   0
+ 50  85  85   0
+ 75 100  30   0
+100  70   0  40
diff --git a/palettes/low_green.spk b/palettes/low_green.spk
new file mode 100644
index 0000000..01375f3
--- /dev/null
+++ b/palettes/low_green.spk
@@ -0,0 +1,5 @@
+  0   0  40  70
+ 25  30   0 100
+ 45  85   0  85
+ 65 100   0  30
+100  70  40   0
diff --git a/palettes/low_red.spk b/palettes/low_red.spk
new file mode 100644
index 0000000..513d67d
--- /dev/null
+++ b/palettes/low_red.spk
@@ -0,0 +1,5 @@
+  0   40   0  70
+ 20    0  30 100
+ 55    0  85  85
+ 65    0 100  30
+100   30  60   0
diff --git a/palettes/magenta.spk b/palettes/magenta.spk
new file mode 100644
index 0000000..6beaa71
--- /dev/null
+++ b/palettes/magenta.spk
@@ -0,0 +1,2 @@
+  0 100 0 100
+100 100 0 100
diff --git a/palettes/magenta_dark.spk b/palettes/magenta_dark.spk
new file mode 100644
index 0000000..bf59c9f
--- /dev/null
+++ b/palettes/magenta_dark.spk
@@ -0,0 +1,3 @@
+  0  55 0 55
+100  55 0 55
+
diff --git a/palettes/magenta_green.spk b/palettes/magenta_green.spk
new file mode 100644
index 0000000..7214775
--- /dev/null
+++ b/palettes/magenta_green.spk
@@ -0,0 +1,19 @@
+! Green to Magenta
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+
+     0.0    31.6     0.0    31.6
+     6.7    52.6     0.0    52.6
+    13.3    73.7     0.0    73.7
+    20.0    94.7     0.0    94.7
+    26.7   100.0    31.6   100.0
+    33.3   100.0    52.6   100.0
+    40.0   100.0    73.7   100.0
+    46.7   100.0    94.7   100.0
+    53.3   100.0   100.0   100.0
+    60.0    73.7   100.0    73.7
+    66.7    52.6   100.0    52.6
+    73.3    31.6   100.0    31.6
+    80.0     0.0    94.7     0.0
+    86.7     0.0    73.7     0.0
+    93.3     0.0    52.6     0.0
+   100.0     0.0    31.6     0.0
diff --git a/palettes/magenta_light.spk b/palettes/magenta_light.spk
new file mode 100644
index 0000000..d3c43ae
--- /dev/null
+++ b/palettes/magenta_light.spk
@@ -0,0 +1,2 @@
+  0   100   70  100  !   thistle1 
+100   100   70  100  
diff --git a/palettes/modulo.spk b/palettes/modulo.spk
new file mode 100644
index 0000000..3b036f2
--- /dev/null
+++ b/palettes/modulo.spk
@@ -0,0 +1,10 @@
+  0.   30.    0.   30.
+ 15.  100.    0.  100.
+ 25.   30.    0.  100.
+ 26.    0.    0.  100.
+ 34.    0.    0.   60.
+ 50.    0.  100.  100.
+ 60.    0.   50.    0.
+ 75.  100.  100.    0.
+ 90.  100.    0.    0.
+100.   40.    0.    0.
diff --git a/palettes/more_by_levels.spk b/palettes/more_by_levels.spk
new file mode 100644
index 0000000..6adcb72
--- /dev/null
+++ b/palettes/more_by_levels.spk
@@ -0,0 +1,18 @@
+RGB_Mapping By_level
+ 
+! Level    Red  Green   Blue
+      1   80.0    0.0  100.0  ! violet
+      2   30.0   20.0  100.0  ! blue
+      3    0.0   60.0   30.0  ! green
+      4  100.0  100.0    0.0  ! yellow
+      5  100.0    0.0    0.0  ! bright red
+      6   60.0    0.0    0.0  ! dark red
+      7  100.0   75.0    0.0  ! gold
+      8   33.0   10.0   55.0  ! purple
+      9  100.0   50.0    0.0  ! orange
+     10   60.0   80.0  100.0  ! light blue
+     11   80.0  100.0   30.0  ! light green
+     12   52.0   42.0   35.0  ! brown 
+     13    0.0    0.0   60.0  ! dark blue
+     14   80.0   73.0   59.0  ! tan
+     15  100.0   60.0   70.0  ! pink
diff --git a/palettes/narrow_light_centered.spk b/palettes/narrow_light_centered.spk
new file mode 100644
index 0000000..55728f2
--- /dev/null
+++ b/palettes/narrow_light_centered.spk
@@ -0,0 +1,6 @@
+0     0  100  100
+30   20   20  100
+48  100  100  100
+52  100  100  100
+70  100   20   20
+100 100  100    0
diff --git a/palettes/navy.spk b/palettes/navy.spk
new file mode 100644
index 0000000..12e43b2
--- /dev/null
+++ b/palettes/navy.spk
@@ -0,0 +1,2 @@
+   0    0 0 10
+ 100    0 0 10
\ No newline at end of file
diff --git a/palettes/no_blue.spk b/palettes/no_blue.spk
new file mode 100644
index 0000000..6c79050
--- /dev/null
+++ b/palettes/no_blue.spk
@@ -0,0 +1,5 @@
+  0   0  30   0
+ 40  40 100   0
+ 50  85  85   0
+ 75 100  30   0
+100  40   0   0
diff --git a/palettes/no_blue_centered.spk b/palettes/no_blue_centered.spk
new file mode 100644
index 0000000..7403ac4
--- /dev/null
+++ b/palettes/no_blue_centered.spk
@@ -0,0 +1,7 @@
+   0   0  30   0
+  40  30 100   0
+49.9  75 100  75
+51.1 100  75  75
+  70 100  30   0
+100   40   0   0
+
diff --git a/palettes/no_blue_grey_centered.spk b/palettes/no_blue_grey_centered.spk
new file mode 100644
index 0000000..76656c8
--- /dev/null
+++ b/palettes/no_blue_grey_centered.spk
@@ -0,0 +1,10 @@
+  0   0  90 100
+ 20   0  40   0
+ 40  30 100   0
+ 45  75 100  75
+ 48  95  95  95 
+ 52  95  95  95 
+ 55 100  75  75
+ 70 100  30   0
+ 80  60   0   0
+100 100   0 100
diff --git a/palettes/no_blue_yellow_centered.spk b/palettes/no_blue_yellow_centered.spk
new file mode 100644
index 0000000..21dec80
--- /dev/null
+++ b/palettes/no_blue_yellow_centered.spk
@@ -0,0 +1,10 @@
+  0   0  90 100
+ 20   0  40   0
+ 40  30 100   0
+ 45  75 100  75
+ 48 100  98  80
+ 52 100  98  80
+ 55 100  75  75
+ 70 100  30   0
+ 80  60   0   0
+100 100   0 100
diff --git a/palettes/no_green.spk b/palettes/no_green.spk
new file mode 100644
index 0000000..d018950
--- /dev/null
+++ b/palettes/no_green.spk
@@ -0,0 +1,5 @@
+  0   0   0  40
+ 25  30   0 100
+ 45  85   0  85
+ 65 100   0  30
+100  40   0   0
diff --git a/palettes/no_green_centered.spk b/palettes/no_green_centered.spk
new file mode 100644
index 0000000..5278468
--- /dev/null
+++ b/palettes/no_green_centered.spk
@@ -0,0 +1,7 @@
+   0   0   0  40
+  20  30   0 100
+49.9  75  75 100
+51.1 100  75  75
+  70 100   0  30
+100   40   0   0
+
diff --git a/palettes/no_red.spk b/palettes/no_red.spk
new file mode 100644
index 0000000..ca19290
--- /dev/null
+++ b/palettes/no_red.spk
@@ -0,0 +1,5 @@
+  0    0   0  40
+ 20    0  30 100
+ 55    0  85  85
+ 65    0 100  30
+100    0  30   0
diff --git a/palettes/no_red_centered.spk b/palettes/no_red_centered.spk
new file mode 100644
index 0000000..3892124
--- /dev/null
+++ b/palettes/no_red_centered.spk
@@ -0,0 +1,7 @@
+   0   0   0  40
+  20   0  30 100
+49.9  75  75 100
+51.1  75 100  75
+  65   0 100  30
+ 100   0  30   0
+
diff --git a/palettes/no_white_greenpink_centered.spk b/palettes/no_white_greenpink_centered.spk
new file mode 100644
index 0000000..10c2aa6
--- /dev/null
+++ b/palettes/no_white_greenpink_centered.spk
@@ -0,0 +1,9 @@
+  0   0  90 100
+ 20   0  40   0
+ 40  30 100   0
+ 45  75 100  75
+ 50  95  95  95 
+ 55 100  75  75
+ 70 100  30   0
+ 80  60   0   0
+100 100   0 100
diff --git a/palettes/no_white_light_centered.spk b/palettes/no_white_light_centered.spk
new file mode 100644
index 0000000..2ca8324
--- /dev/null
+++ b/palettes/no_white_light_centered.spk
@@ -0,0 +1,5 @@
+0     0  100  100
+30   20   20  100
+50   90   90   90
+70  100   20   20
+100 100  100    0
diff --git a/palettes/norm_cent_cmyk.spk b/palettes/norm_cent_cmyk.spk
new file mode 100644
index 0000000..daeda2b
--- /dev/null
+++ b/palettes/norm_cent_cmyk.spk
@@ -0,0 +1,16 @@
+0          72.1569  87.4510  27.0588
+6.666667   26.2745  61.5686  21.5686
+13.33333    7.8431  24.3137   8.6275
+20          6.6667   8.6275  52.5490
+26.66667   13.7254  43.5921  70.1961
+33.33333   31.3725  74.1176  84.7058
+40         60.7843  59.2157  78.4314
+46.66667   87.0588  86.2745  91.7647
+53.33333   96.0784  86.2745  86.6667
+60         96.8627  59.6078  60.0000
+66.66667   96.0784  32.9411  33.3333
+73.33333   76.4705  25.8824  18.0392
+80         96.4706  46.6667  13.7255
+86.66667   97.6471  64.3137   8.6275
+93.33333   98.8235  82.3529   3.5294
+100        96.8627  96.4705   9.8039
diff --git a/palettes/ocean_blue.spk b/palettes/ocean_blue.spk
new file mode 100644
index 0000000..169a7ca
--- /dev/null
+++ b/palettes/ocean_blue.spk
@@ -0,0 +1,4 @@
+   0.   0.0   0.0  25.0
+  10.   0.0   0.0  50.0
+  40.   0.0   0.0 100.0
+ 100.   0.0 100.0 100.0
diff --git a/palettes/ocean_temp.spk b/palettes/ocean_temp.spk
new file mode 100644
index 0000000..ee6413b
--- /dev/null
+++ b/palettes/ocean_temp.spk
@@ -0,0 +1,9 @@
+RGB_Mapping By_value
+ 
+! SetPt    Red  Green   Blue
+   -2.0   80.0    0.0  100.0
+    0.0   30.0   20.0  100.0
+   10.0    0.0   60.0   30.0
+   20.0  100.0  100.0    0.0
+   30.0  100.0    0.0    0.0
+   35.0   60.0    0.0    0.0
diff --git a/palettes/ocean_temp_bounds.spk b/palettes/ocean_temp_bounds.spk
new file mode 100644
index 0000000..afb0c63
--- /dev/null
+++ b/palettes/ocean_temp_bounds.spk
@@ -0,0 +1,11 @@
+RGB_Mapping By_value
+ 
+! SetPt    Red  Green   Blue
+   -2.001   40.0   40.0   40.0
+   -2.0   80.0    0.0  100.0
+    0.0   30.0   20.0  100.0
+   10.0    0.0   60.0   30.0
+   20.0  100.0  100.0    0.0
+   30.0  100.0    0.0    0.0
+   35.0   60.0    0.0    0.0
+   35.001   80.0   80.0   80.0
diff --git a/palettes/orange.spk b/palettes/orange.spk
new file mode 100644
index 0000000..f1a1ca4
--- /dev/null
+++ b/palettes/orange.spk
@@ -0,0 +1,2 @@
+0 100 50 0
+100 100 50 0
diff --git a/palettes/orange_blue.spk b/palettes/orange_blue.spk
new file mode 100644
index 0000000..cd1e75f
--- /dev/null
+++ b/palettes/orange_blue.spk
@@ -0,0 +1,15 @@
+! Reverse of Blue to Orange, 12 steps
+! http://geography.uoregon.edu/datagraphics/color_scales.htm
+     0.0   100.0    16.7     0.0
+     9.1   100.0    40.0    10.0
+    18.2   100.0    60.0    20.0
+    27.3   100.0    80.0    40.0
+    36.4   100.0    93.3    60.0
+    45.5   100.0   100.0    80.0
+    54.5    80.0   100.0   100.0
+    63.6    60.0    93.3   100.0
+    72.7    40.0    80.0   100.0
+    81.8    20.0    60.0   100.0
+    90.9    10.0    40.0   100.0
+   100.0     0.0    16.7   100.0
+
diff --git a/palettes/orange_dark.spk b/palettes/orange_dark.spk
new file mode 100644
index 0000000..58a43f7
--- /dev/null
+++ b/palettes/orange_dark.spk
@@ -0,0 +1,2 @@
+  0   100   30   10   ! dark orange 100   27    0 
+100   100   30   10     tan1           
diff --git a/palettes/orange_light.spk b/palettes/orange_light.spk
new file mode 100644
index 0000000..f8f1608
--- /dev/null
+++ b/palettes/orange_light.spk
@@ -0,0 +1,2 @@
+  0   100   65   51  ! light orange
+100   100   65   51 
diff --git a/palettes/orange_purple.spk b/palettes/orange_purple.spk
new file mode 100644
index 0000000..07a6094
--- /dev/null
+++ b/palettes/orange_purple.spk
@@ -0,0 +1,9 @@
+     0.0    32.8    15.2    53.1
+    12.5    50.0    44.9    67.2
+    25.0    69.5    66.8    82.0
+    37.5    84.4    85.2    91.8
+    50.0    96.5    96.5    96.5
+    62.5    99.2    87.5    71.1
+    75.0    98.8    71.9    38.7
+    87.5    87.5    50.8     7.8
+   100.0    69.9    34.4     2.3
diff --git a/palettes/orange_red.spk b/palettes/orange_red.spk
new file mode 100644
index 0000000..5cbc578
--- /dev/null
+++ b/palettes/orange_red.spk
@@ -0,0 +1,10 @@
+! Orange Red from colorbrewer
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+     0.0    99.6    96.5    92.2
+    14.3    99.2    90.6    78.1
+    28.6    98.8    82.8    61.7
+    42.9    98.8    73.0    51.6
+    57.1    93.4    39.5    28.1
+    71.4    84.0    18.8    12.1
+    85.7    69.9     0.0     0.0
+   100.0    49.6     0.0     0.0
diff --git a/palettes/osmc_bluescale.spk b/palettes/osmc_bluescale.spk
new file mode 100644
index 0000000..8c522cb
--- /dev/null
+++ b/palettes/osmc_bluescale.spk
@@ -0,0 +1,3 @@
+0 30 50 75
+100 79.2 91.8 94.9
+
diff --git a/palettes/osmc_land.spk b/palettes/osmc_land.spk
new file mode 100644
index 0000000..c1d8f43
--- /dev/null
+++ b/palettes/osmc_land.spk
@@ -0,0 +1,4 @@
+RGB_mapping Percent
+
+0  67.4 80.4 48.2
+100  67.4 80.4 48.2
\ No newline at end of file
diff --git a/palettes/osmc_terrestrial.spk b/palettes/osmc_terrestrial.spk
new file mode 100644
index 0000000..2756ea1
--- /dev/null
+++ b/palettes/osmc_terrestrial.spk
@@ -0,0 +1,15 @@
+  0.   0.  50.   0.
+ 60.  70.  70.   30.
+ 70   60 60 60
+ 80.  90 90 90
+100.  0 0 0 
+
+
+
+
+
+
+
+
+
+
diff --git a/palettes/paleo_psdi_value.spk b/palettes/paleo_psdi_value.spk
new file mode 100644
index 0000000..62424bf
--- /dev/null
+++ b/palettes/paleo_psdi_value.spk
@@ -0,0 +1,56 @@
+! Paleo Scale for Palmer Drought Index
+! contributed by Phil Cogbill phil.cogbill at noaa.gov
+
+! Set the type of palette
+RGB_Mapping By_value
+
+! Paleo PDSI Scale by Value
+! Phil Cogbill phil.cogbill at noaa.gov
+
+!   Level|   Red| Green|  Blue|
+!--------|------|------|------|
+
+! Dark Red
+!--------|------|------|------|
+      -16   37.6    1.2    1.2
+
+! Deep Red
+!--------|------|------|------|
+       -6   49.8    4.3    4.7
+
+! Red
+!--------|------|------|------|
+     -4.5   94.9    9.4    0.0
+
+! Orange
+!--------|------|------|------|
+     -2.5   98.8   56.9    1.2
+
+! Yellow
+!--------|------|------|------|
+     -1.5   99.2  100.0    4.3
+
+! White
+!--------|------|------|------|
+        0  100.0  100.0  100.0
+
+! Green Yellow
+!--------|------|------|------|
+      1.5   89.8   99.2   19.6
+
+! Light Green
+!--------|------|------|------|
+      2.5   69.8   99.6    0.0
+
+! Green
+!--------|------|------|------|
+      4.5   25.4   82.7    0.8
+
+! Deep Green
+!--------|------|------|------|
+        6  17.3   51.0    2.4
+
+! Dark Green
+!--------|------|------|------|
+       16   13.3   35.7    2.7
+
diff --git a/palettes/patterns4.pat b/palettes/patterns4.pat
new file mode 100644
index 0000000..96a5219
--- /dev/null
+++ b/palettes/patterns4.pat
@@ -0,0 +1,4 @@
+  1  LARGE_GRID               
+  2  ANGLED_GRID              
+  3  LITE_VERTICAL
+  4  LITE_HORIZONTAL          
diff --git a/palettes/pink.spk b/palettes/pink.spk
new file mode 100644
index 0000000..767f7e8
--- /dev/null
+++ b/palettes/pink.spk
@@ -0,0 +1,2 @@
+  0   100  60  70 
+100   100  60  70
diff --git a/palettes/pink_dark.spk b/palettes/pink_dark.spk
new file mode 100644
index 0000000..3896562
--- /dev/null
+++ b/palettes/pink_dark.spk
@@ -0,0 +1,2 @@
+  0   100   8   58 ! deep pink
+100   100   8   58
diff --git a/palettes/pink_light.spk b/palettes/pink_light.spk
new file mode 100644
index 0000000..1e1b2c8
--- /dev/null
+++ b/palettes/pink_light.spk
@@ -0,0 +1,2 @@
+  0   100   88   92 
+100   100   88   92
diff --git a/palettes/purple.spk b/palettes/purple.spk
new file mode 100644
index 0000000..1f5b02b
--- /dev/null
+++ b/palettes/purple.spk
@@ -0,0 +1,2 @@
+0 60 0 100
+100 60 0 100
diff --git a/palettes/purple_dark.spk b/palettes/purple_dark.spk
new file mode 100644
index 0000000..259603b
--- /dev/null
+++ b/palettes/purple_dark.spk
@@ -0,0 +1,2 @@
+  0  33   10   55     purple4                                                     
+100  33   10   55
diff --git a/palettes/purple_light.spk b/palettes/purple_light.spk
new file mode 100644
index 0000000..0fb8f0a
--- /dev/null
+++ b/palettes/purple_light.spk
@@ -0,0 +1,2 @@
+  0 83   51   100 
+100 83   51   100
diff --git a/palettes/purple_orange.spk b/palettes/purple_orange.spk
new file mode 100644
index 0000000..932cbc9
--- /dev/null
+++ b/palettes/purple_orange.spk
@@ -0,0 +1,8 @@
+     0.0    69.9    34.4     2.3
+    14.3    87.5    50.8     7.8
+    28.6    98.8    71.9    38.7
+    42.9    99.2    87.5    71.1
+    57.1    96.5    96.5    96.5
+    71.4    84.4    85.2    91.8
+    85.7    69.5    66.8    82.0
+   100.0    50.0    44.9    67.2
diff --git a/palettes/purple_red.spk b/palettes/purple_red.spk
new file mode 100644
index 0000000..401876b
--- /dev/null
+++ b/palettes/purple_red.spk
@@ -0,0 +1,12 @@
+!  Purple Red from colorbrewer
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+     0.0    96.5    95.3    97.3
+    12.5    90.2    87.9    93.4
+    25.0    82.8    72.3    85.2
+    37.5    78.5    57.8    77.7
+    50.0    87.1    39.5    68.8
+    62.5    90.2    16.0    53.9
+    75.0    80.5     7.0    33.6
+    87.5    59.4     0.0    26.2
+   100.0    40.2     0.0    12.1
+
diff --git a/palettes/rain_cmyk.spk b/palettes/rain_cmyk.spk
new file mode 100644
index 0000000..e25f4f9
--- /dev/null
+++ b/palettes/rain_cmyk.spk
@@ -0,0 +1,12 @@
+   0.000  74.902  70.196  65.490
+   9.091  65.882  37.255   0.000
+  18.182  76.863  47.451   0.000
+  27.273  99.608  70.196  26.275
+  36.364 100.000  90.980  29.804
+  45.455 100.000 100.000  72.941
+  54.545  81.961  92.941  87.843
+  63.636  61.961  85.098  79.216
+  72.727  44.314  78.824  83.137
+  81.818  29.412  53.333  74.510
+  90.909   4.706  17.647  51.373
+ 100.000   0.392  10.196  20.000
diff --git a/palettes/rain_hole_cmyk.spk b/palettes/rain_hole_cmyk.spk
new file mode 100644
index 0000000..c24d081
--- /dev/null
+++ b/palettes/rain_hole_cmyk.spk
@@ -0,0 +1,16 @@
+   0.000  74.902  69.020  65.490
+   6.667  76.471  43.922   3.529
+  13.333  83.137  60.000   8.235
+  20.000  90.196  76.471   6.667
+  26.667 100.000  94.118  55.294
+  33.333 100.000 100.000 100.000
+  40.000 100.000 100.000 100.000
+  46.667 100.000 100.000 100.000
+  53.333 100.000 100.000 100.000
+  60.000 100.000 100.000 100.000
+  66.667 100.000 100.000 100.000
+  73.333  72.941  89.804  84.314
+  80.000  53.333  73.333  85.098
+  86.667  29.412  53.333  74.510
+  93.333   4.314  23.922  56.863
+ 100.000   1.569  10.980  26.275
diff --git a/palettes/rainbow.spk b/palettes/rainbow.spk
new file mode 100644
index 0000000..cd436fa
--- /dev/null
+++ b/palettes/rainbow.spk
@@ -0,0 +1,6 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   33.0    0.0   60.0   30.0
+   66.0  100.0  100.0    0.0
+   90.0  100.0    0.0    0.0
+  100.0   60.0    0.0    0.0
diff --git a/palettes/rainbow2_cmyk.spk b/palettes/rainbow2_cmyk.spk
new file mode 100644
index 0000000..954cab6
--- /dev/null
+++ b/palettes/rainbow2_cmyk.spk
@@ -0,0 +1,13 @@
+   0.000  84.314   9.020  50.588
+   8.333  39.608  13.725  52.941
+  16.667  45.098  35.294  64.706
+  25.000  11.765  37.647  63.529
+  33.333  17.647  67.059  66.667
+  41.667  39.608  70.980  19.608
+  50.000  70.196  85.098  40.784
+  58.333 100.000 100.000  49.020
+  66.667  96.863  90.980  33.333
+  75.000  98.039  70.196  26.275
+  83.333  97.255  40.000   7.451
+  91.667  87.059   9.804  16.863
+ 100.000  49.020   5.490   2.745
diff --git a/palettes/rainbow_by_levels.spk b/palettes/rainbow_by_levels.spk
new file mode 100644
index 0000000..105b9f2
--- /dev/null
+++ b/palettes/rainbow_by_levels.spk
@@ -0,0 +1,9 @@
+RGB_Mapping By_level
+ 
+! Level    Red  Green   Blue
+      1   80.0    0.0  100.0
+      2   30.0   20.0  100.0
+      3    0.0   60.0   30.0
+      4  100.0  100.0    0.0
+      5  100.0    0.0    0.0
+      6   60.0    0.0    0.0
diff --git a/palettes/rainbow_cmyk.spk b/palettes/rainbow_cmyk.spk
new file mode 100644
index 0000000..c3a6c4c
--- /dev/null
+++ b/palettes/rainbow_cmyk.spk
@@ -0,0 +1,13 @@
+   0.000  21.176   1.961  18.039
+   8.333  39.608  13.725  52.941
+  16.667   3.529  22.745  50.196
+  25.000  44.314  65.098  80.392
+  33.333   9.412  58.824  29.804
+  41.667  39.608  71.373  19.608
+  50.000  70.196  83.137  40.784
+  58.333 100.000 100.000  49.020
+  66.667 100.000  90.980  29.804
+  75.000  98.039  70.196  26.275
+  83.333  97.255  40.000   7.451
+  91.667  87.059   9.804  16.863
+ 100.000  49.020   5.490   2.745
diff --git a/palettes/rainbow_rgb.spk b/palettes/rainbow_rgb.spk
new file mode 100644
index 0000000..0361797
--- /dev/null
+++ b/palettes/rainbow_rgb.spk
@@ -0,0 +1,9 @@
+
+  0   0   0  52
+ 14  39   0  91
+ 28   0  41 100
+ 42   9  98  91
+ 56  61 100  38
+ 70 100  83   0
+ 84 100  20   0
+100  61   0   0
diff --git a/palettes/red.spk b/palettes/red.spk
new file mode 100644
index 0000000..f9c2f8d
--- /dev/null
+++ b/palettes/red.spk
@@ -0,0 +1,2 @@
+0 100 0 0
+100 100 0 0
diff --git a/palettes/red_blue_centered.spk b/palettes/red_blue_centered.spk
new file mode 100644
index 0000000..ca95325
--- /dev/null
+++ b/palettes/red_blue_centered.spk
@@ -0,0 +1,14 @@
+! red_blue_centered.spk
+! (inverse of palette contributed by Ryo Furue as r_b.spk)
+! dark red -> red -> white -> blue -> dark blue
+!
+   0      40   0   0
+  20     100   0   0
+  30     100  45  45
+  44     100  90  90
+  49.001 100 100 100
+  50.999 100 100 100
+  56      90  90 100
+  70      45  70 100
+  80       0  50 100
+ 100       0  20  40
\ No newline at end of file
diff --git a/palettes/red_blue_gray_centered.spk b/palettes/red_blue_gray_centered.spk
new file mode 100644
index 0000000..f1b13df
--- /dev/null
+++ b/palettes/red_blue_gray_centered.spk
@@ -0,0 +1,14 @@
+! red_blue_gray_centered.spk
+! (inverse of palette contributed by Ryo Furue as r_b_gray.spk)
+! dark red -> red -> gray -> b -> dark b
+!
+   0      40   0   0
+  20     100   0   0
+  30     100  45  45
+  44     100  85  85
+  44.001  85  85  85
+  55.999  85  85  85
+  56      85  85 100
+  70      45  70 100
+  80       0  50 100
+ 100       0  20  40
diff --git a/palettes/red_blue_nowhite_centered.spk b/palettes/red_blue_nowhite_centered.spk
new file mode 100644
index 0000000..c55a384
--- /dev/null
+++ b/palettes/red_blue_nowhite_centered.spk
@@ -0,0 +1,14 @@
+! red_blue_nowhite_centered.spk
+! (inverse of palette contributed by Ryo Furue as r_b_nowhite.spk)
+! variation on red_blue.spk without white.
+! (inverse of palette contributed by Ryo Furue as r_b_nowhite.spk)
+! dark red -> red -> blue -> dark blue
+!
+   0      40   0   0
+  20     100   0   0
+  30     100  45  45
+  49.999 100  90  90
+  50.001  90  90 100
+  70      45  70 100
+  80       0  50 100
+ 100       0  20  40
diff --git a/palettes/red_dark.spk b/palettes/red_dark.spk
new file mode 100644
index 0000000..1b62bea
--- /dev/null
+++ b/palettes/red_dark.spk
@@ -0,0 +1,3 @@
+  0  55 0 0 
+100  55 0 0 
+
diff --git a/palettes/red_light.spk b/palettes/red_light.spk
new file mode 100644
index 0000000..a88a572
--- /dev/null
+++ b/palettes/red_light.spk
@@ -0,0 +1,2 @@
+  0  94   50   50 ! light coral  94   50   50
+100  94   50   50
diff --git a/palettes/red_orange.spk b/palettes/red_orange.spk
new file mode 100644
index 0000000..9c94f22
--- /dev/null
+++ b/palettes/red_orange.spk
@@ -0,0 +1,10 @@
+! Reverse of Orange Red from colorbrewer
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+     0.0    49.6     0.0     0.0
+    14.3    69.9     0.0     0.0
+    28.6    84.0    18.8    12.1
+    42.9    93.4    39.5    28.1
+    57.1    98.8    73.0    51.6
+    71.4    98.8    82.8    61.7
+    85.7    99.2    90.6    78.1
+   100.0    99.6    96.5    92.2
diff --git a/palettes/red_purple.spk b/palettes/red_purple.spk
new file mode 100644
index 0000000..103f50a
--- /dev/null
+++ b/palettes/red_purple.spk
@@ -0,0 +1,11 @@
+!  Red Purple from colorbrewer
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+     0.0    99.6    96.5    94.9
+    12.5    98.8    87.5    86.3
+    25.0    98.4    77.0    75.0
+    37.5    97.7    62.1    70.7
+    50.0    96.5    40.6    62.9
+    62.5    86.3    20.3    59.0
+    75.0    68.0     0.4    49.2
+    87.5    47.7     0.4    46.5
+   100.0    28.5     0.0    41.4
diff --git a/palettes/reds_cmyk.spk b/palettes/reds_cmyk.spk
new file mode 100644
index 0000000..6d5d79b
--- /dev/null
+++ b/palettes/reds_cmyk.spk
@@ -0,0 +1,8 @@
+   0.000  93.725  83.922  83.529
+  14.286  98.431  73.333  78.431
+  28.571  97.647  49.804  57.255
+  42.857  97.647  28.627  36.078
+  57.143  93.333  16.471  10.196
+  71.429  83.137   9.412  11.765
+  85.714  62.353   7.451  11.765
+ 100.000  38.039  11.373  10.980
diff --git a/palettes/redscale.spk b/palettes/redscale.spk
new file mode 100644
index 0000000..56c2a40
--- /dev/null
+++ b/palettes/redscale.spk
@@ -0,0 +1,2 @@
+0 95 0 0
+100 95 95 95
diff --git a/palettes/rev_cent_cmyk.spk b/palettes/rev_cent_cmyk.spk
new file mode 100644
index 0000000..d88fa4d
--- /dev/null
+++ b/palettes/rev_cent_cmyk.spk
@@ -0,0 +1,16 @@
+0          96.8627  96.4705   9.8039
+6.666667   98.8235  82.3529   3.5294
+13.33333   97.6471  64.3137   8.6275
+20         96.4706  46.6667  13.7255
+26.66667   76.4705  25.8824  18.0392
+33.33333   96.0784  32.9411  33.3333
+40         96.8627  59.6078  60.0000
+46.66667   96.0784  86.2745  86.6667
+53.33333   87.0588  86.2745  91.7647
+60         60.7843  59.2157  78.4314
+66.66667   31.3725  74.1176  84.7058
+73.33333   13.7254  43.5921  70.1961
+80          6.6667   8.6275  52.5490  
+86.66667    7.8431  24.3137   8.6275
+93.33333   26.2745  61.5686  21.5686
+100        72.1569  87.4510  27.0588
diff --git a/palettes/rnb.spk b/palettes/rnb.spk
new file mode 100644
index 0000000..cd436fa
--- /dev/null
+++ b/palettes/rnb.spk
@@ -0,0 +1,6 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   33.0    0.0   60.0   30.0
+   66.0  100.0  100.0    0.0
+   90.0  100.0    0.0    0.0
+  100.0   60.0    0.0    0.0
diff --git a/palettes/rnb2.spk b/palettes/rnb2.spk
new file mode 100644
index 0000000..b3ba4a7
--- /dev/null
+++ b/palettes/rnb2.spk
@@ -0,0 +1,7 @@
+ 0.    0.    0.   50.
+10.   70.0   0.0  80.0
+ 20.    0.    0.  100.
+ 40.    0.   98.  100.
+ 67.   97.  100.    3.
+ 90.  100.    3.    0.
+100.   60.    0.    0.
diff --git a/palettes/saz2.spk b/palettes/saz2.spk
new file mode 100644
index 0000000..fbdfce0
--- /dev/null
+++ b/palettes/saz2.spk
@@ -0,0 +1,9 @@
+    0.0   80.0    0.0  100.0
+   10.0   30.0   20.0  100.0
+   49.0    0.0  100.0    0.0
+   51.0  100.0  100.0    0.0
+   55.0  100.0   80.0    0.0
+   75.0  100.0    0.0    0.0
+   80.0   80.0    0.0    0.0
+   90.0   60.0   50.0   50.0
+  100.0  100.0   75.0   75.0
diff --git a/palettes/solid.pat b/palettes/solid.pat
new file mode 100644
index 0000000..711db31
--- /dev/null
+++ b/palettes/solid.pat
@@ -0,0 +1 @@
+1 SOLID
diff --git a/palettes/sunny_cmyk.spk b/palettes/sunny_cmyk.spk
new file mode 100644
index 0000000..7eac564
--- /dev/null
+++ b/palettes/sunny_cmyk.spk
@@ -0,0 +1,8 @@
+   0.000 100.000 100.000  27.843
+  14.286 100.000  90.980  20.392
+  28.571 100.000  81.961  15.686
+  42.857 100.000  72.941   0.000
+  57.143  99.608  61.961  19.608
+  71.429 100.000  49.020   0.000
+  85.714  90.980  31.765   0.000
+ 100.000  65.882  26.275   0.000
diff --git a/palettes/tan.spk b/palettes/tan.spk
new file mode 100644
index 0000000..e1ef3e2
--- /dev/null
+++ b/palettes/tan.spk
@@ -0,0 +1,2 @@
+  0  80   73   59  !   wheat3                                                      
+100  80   73   59                                             
diff --git a/palettes/tan_dark.spk b/palettes/tan_dark.spk
new file mode 100644
index 0000000..066cd18
--- /dev/null
+++ b/palettes/tan_dark.spk
@@ -0,0 +1,2 @@
+  0    55   40    3   !  DarkGoldenrod4                       
+100    55   40    3    
diff --git a/palettes/tan_light.spk b/palettes/tan_light.spk
new file mode 100644
index 0000000..9880cb7
--- /dev/null
+++ b/palettes/tan_light.spk
@@ -0,0 +1,2 @@
+  0   100   97   86   !  cornsilk1                                 
+100   100   97   86    
diff --git a/palettes/ten_by_levels.spk b/palettes/ten_by_levels.spk
new file mode 100644
index 0000000..8a9580f
--- /dev/null
+++ b/palettes/ten_by_levels.spk
@@ -0,0 +1,14 @@
+RGB_Mapping By_level
+ 
+! Level    Red  Green   Blue
+      1  100.0   10.0    0.0  ! bright red
+      2    0.0    0.0  100.0  ! blue
+      3    0.0   60.0   30.0  ! green
+      4  100.0   90.0    0.0  ! yellow
+      5   70.0    0.0  100.0  ! purple
+      6  100.0   55.0    0.0  ! orange 100.0   50.0    0.0
+      7    0.0  100.0  100.0  ! light blue
+      8   66.0   56.0   10.0  ! olive
+      9   50.0  100.0  10.0  ! light green 
+     10  100.0    0.0  100.0  ! magenta
+
diff --git a/palettes/terrestrial.spk b/palettes/terrestrial.spk
new file mode 100644
index 0000000..bf0872e
--- /dev/null
+++ b/palettes/terrestrial.spk
@@ -0,0 +1,14 @@
+  0.   0.  90.   0.
+ 30. 100. 100.   0.
+ 80.  75.  40.   0.
+100.  75.  70.  65.
+
+
+
+
+
+
+
+
+
+
diff --git a/palettes/thirty_by_levels.spk b/palettes/thirty_by_levels.spk
new file mode 100644
index 0000000..5ceaa4b
--- /dev/null
+++ b/palettes/thirty_by_levels.spk
@@ -0,0 +1,34 @@
+RGB_Mapping By_level
+ 
+! Level    Red  Green   Blue
+      1   80    0  100  ! violet
+      2   30   20  100  ! blue
+      3    0   60   30  ! green
+      4  100  100    0  ! yellow
+      5  100    0    0  ! bright red
+      6   60    0    0  ! dark red
+      7  100   75    0  ! gold
+      8   33   10   55  ! purple
+      9  100   50    0  ! orange
+     10    0   80   85  ! turq
+     11   70  100   30  ! light green
+     12   52   42   35  ! brown 
+     13    0    0   60  ! dark blue
+     14   80   73   59  ! tan
+     15  100    8   58  ! magenta
+     16   83   51  100  ! light violet
+     17   60   80  100  ! light blue
+     18   50  100  100  ! light turq
+     19  100   96   65  ! light yellow
+     20  100   70   80  ! pink
+     21   94   50   50  ! coral
+     22   90   90    0	! yellow-greenish
+     23   67   55   78  ! light-grey-violet
+     24  100   65   51  ! light coral
+     25   80   90  100  ! very light blue
+     26   90  100   65  ! very light green
+     27   86   69   67  ! light tan
+     28   40   50   90  ! light peri blue
+     29   76   79   80  ! grey
+     30  100   85   90  ! light pink
+ 
diff --git a/palettes/tiny_grid.pat b/palettes/tiny_grid.pat
new file mode 100644
index 0000000..ac2911a
--- /dev/null
+++ b/palettes/tiny_grid.pat
@@ -0,0 +1 @@
+1 TINY_GRID
diff --git a/palettes/tiny_open_squares.pat b/palettes/tiny_open_squares.pat
new file mode 100644
index 0000000..9e37145
--- /dev/null
+++ b/palettes/tiny_open_squares.pat
@@ -0,0 +1 @@
+1 TINY_OPEN_SQUARES
diff --git a/palettes/tiny_squares.pat b/palettes/tiny_squares.pat
new file mode 100644
index 0000000..a668bcf
--- /dev/null
+++ b/palettes/tiny_squares.pat
@@ -0,0 +1 @@
+1 TINY_SQUARES
diff --git a/palettes/tiny_triangles.pat b/palettes/tiny_triangles.pat
new file mode 100644
index 0000000..b5c4054
--- /dev/null
+++ b/palettes/tiny_triangles.pat
@@ -0,0 +1 @@
+1 TINY_TRIANGLES
diff --git a/palettes/topo.spk b/palettes/topo.spk
new file mode 100644
index 0000000..d98ca4f
--- /dev/null
+++ b/palettes/topo.spk
@@ -0,0 +1,24 @@
+
+! Palette for ocean/terrestrial elevation.
+! *jc* 11/00
+
+! Good levels for US elevation (in meters):
+! (-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,6000,1000)
+
+RGB_Mapping By_Value
+
+! Val    R    G    B
+-8000.   0.   0.  10. ! blue-black
+-4000.   0.   0.  50.
+-2000.   0.   0. 100. ! blue
+-300.   40.  70. 100. 
+-100.   50. 100. 100.
+ -50.   40.  80.  70.
+  -0.1  90. 100. 100. ! light green-blue
+   0.    0.  20.  00. ! dark green
+ 100.    0.  70.  30. ! light green
+ 300.   90. 100.   0. ! light yellow
+1200.   60.  30.   0. ! rust
+4000.   90.  90. 100. ! ice blue
+5000.  100. 100. 100. ! white
+
diff --git a/palettes/topo_blue_brown.spk b/palettes/topo_blue_brown.spk
new file mode 100644
index 0000000..9548e43
--- /dev/null
+++ b/palettes/topo_blue_brown.spk
@@ -0,0 +1,21 @@
+
+! Palette for ocean/terrestrial elevation.
+! *acm* 12/07 based on topo
+
+! Good levels for world elevation (in meters):
+! (-inf)(-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(0,1000,100)(1000,4000,1000)(inf)
+
+RGB_Mapping By_Value
+
+! Val    R    G    B
+-8000.   0.   0.  40. ! blue-black
+-4000.  30.  30. 100.
+-1000.  50.  50. 100. ! blue
+-500.   40.  70. 100. 
+-100.   50. 100. 100.
+ -50.   40.  80.  70.
+ -0.1   90. 100. 100. ! light green-blue
+  0.    75.  50.  18. ! range of browns
+ 1000.  87.  76.  49.
+ 5000.  96.  91.  76.
+ 6000. 100. 100. 100.
diff --git a/palettes/topo_light.spk b/palettes/topo_light.spk
new file mode 100644
index 0000000..836e0e3
--- /dev/null
+++ b/palettes/topo_light.spk
@@ -0,0 +1,24 @@
+
+! Palette for ocean/terrestrial elevation.
+! *jc* 11/00
+
+! Good levels for US elevation (in meters):
+! (-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(100,1000,100)(1000,6000,1000)
+
+RGB_Mapping By_Value
+
+! Val    R    G    B
+-8000.   0.   0.  40. ! blue-black
+-4000.  30.  30. 100.
+-1000.  50.  50. 100. ! blue
+-500.   40.  70. 100. 
+-100.   50. 100. 100.
+ -50.   40.  80.  70.
+  -0.1  90. 100. 100. ! light green-blue
+   0.    0.  20.  00. ! dark green
+ 100.    0.  70.  30. ! light green
+ 500.   90. 100.   0. ! light yellow
+1200.   60.  30.   0. ! rust
+4000.   90.  90. 100. ! ice blue
+5000.  100. 100. 100. ! white
+
diff --git a/palettes/topo_osmc_blue_brown.spk b/palettes/topo_osmc_blue_brown.spk
new file mode 100644
index 0000000..718859b
--- /dev/null
+++ b/palettes/topo_osmc_blue_brown.spk
@@ -0,0 +1,17 @@
+! topo_osmc_blue_brown
+! Palette for ocean/terrestrial elevation.
+! *acm* 12/07 based on topo
+
+! Good levels for world elevation (in meters):
+! (-inf)(-6000,-1000,1000)(-1000,-100,100)(-100,100,10)(0,1000,100)(1000,4000,1000)(inf)
+
+RGB_Mapping By_Value
+
+! Val    R    G    B
+-8000.   30 50 75
+ -0.1    79.2 91.8 94.9
+  0.    75.  50.  18. ! range of browns
+ 1000.  87.  76.  49.
+ 5000.  96.  91.  76.
+ 6000. 100. 100. 100.
+
diff --git a/palettes/vertical.pat b/palettes/vertical.pat
new file mode 100644
index 0000000..3df09f4
--- /dev/null
+++ b/palettes/vertical.pat
@@ -0,0 +1 @@
+  1  LITE_VERTICAL            
diff --git a/palettes/very_dark_terrestrial.spk b/palettes/very_dark_terrestrial.spk
new file mode 100644
index 0000000..e324059
--- /dev/null
+++ b/palettes/very_dark_terrestrial.spk
@@ -0,0 +1,6 @@
+  0.   0.  25.   0.
+ 30.  35.  35.   0.
+ 80.  37.  20.   0.
+ 90.  37.  35.  32.
+100.   0.   0.   0.
+
diff --git a/palettes/violet.spk b/palettes/violet.spk
new file mode 100644
index 0000000..1f5b02b
--- /dev/null
+++ b/palettes/violet.spk
@@ -0,0 +1,2 @@
+0 60 0 100
+100 60 0 100
diff --git a/palettes/violet_dark.spk b/palettes/violet_dark.spk
new file mode 100644
index 0000000..259603b
--- /dev/null
+++ b/palettes/violet_dark.spk
@@ -0,0 +1,2 @@
+  0  33   10   55     purple4                                                     
+100  33   10   55
diff --git a/palettes/violet_light.spk b/palettes/violet_light.spk
new file mode 100644
index 0000000..0fb8f0a
--- /dev/null
+++ b/palettes/violet_light.spk
@@ -0,0 +1,2 @@
+  0 83   51   100 
+100 83   51   100
diff --git a/palettes/warm_cmyk.spk b/palettes/warm_cmyk.spk
new file mode 100644
index 0000000..86cebe5
--- /dev/null
+++ b/palettes/warm_cmyk.spk
@@ -0,0 +1,8 @@
+0          96.0784  86.2745  86.6667
+16.66667   96.8627  59.6078  60.0000
+33.33333   96.0784  32.9411  33.3333
+50         76.4705  25.8824  18.0392
+66.66667   96.4706  46.6667  13.7255
+83.33333   97.6471  64.3137   8.6275
+93.33333   98.8235  82.3529   3.5294
+100        96.8627  96.4705   9.8039
diff --git a/palettes/weave.pat b/palettes/weave.pat
new file mode 100644
index 0000000..c76fe19
--- /dev/null
+++ b/palettes/weave.pat
@@ -0,0 +1 @@
+1 WEAVE
diff --git a/palettes/white.spk b/palettes/white.spk
new file mode 100644
index 0000000..ac3b987
--- /dev/null
+++ b/palettes/white.spk
@@ -0,0 +1,2 @@
+0 100 100 100
+100 100 100 100
diff --git a/palettes/white_centered.spk b/palettes/white_centered.spk
new file mode 100644
index 0000000..3c7e143
--- /dev/null
+++ b/palettes/white_centered.spk
@@ -0,0 +1,6 @@
+0     0  100  100
+20   20   20  100
+35  100  100  100
+65  100  100  100
+80  100   20   20
+100 100  100    0
diff --git a/palettes/yellow.spk b/palettes/yellow.spk
new file mode 100644
index 0000000..07d57eb
--- /dev/null
+++ b/palettes/yellow.spk
@@ -0,0 +1,2 @@
+0 100 100 0
+100 100 100 0
diff --git a/palettes/yellow_dark.spk b/palettes/yellow_dark.spk
new file mode 100644
index 0000000..36ace33
--- /dev/null
+++ b/palettes/yellow_dark.spk
@@ -0,0 +1,2 @@
+  0   100   75    0 ! gold 100   84    0
+100   100   75    0
diff --git a/palettes/yellow_green_blue.spk b/palettes/yellow_green_blue.spk
new file mode 100644
index 0000000..015ee2b
--- /dev/null
+++ b/palettes/yellow_green_blue.spk
@@ -0,0 +1,11 @@
+! Colorbrewer Yellow-Green_blue spectrum
+! http://www.personal.psu.edu/faculty/c/a/cab38/ColorBrewerBeta2.html
+   0.0    99.6    99.6    84.8
+    12.5    92.6    96.9    69.1
+    25.0    77.7    91.0    70.3
+    37.5    49.6    80.1    73.0
+    50.0    25.4    71.1    76.6
+    62.5    11.3    56.6    75.0
+    75.0    13.3    36.7    65.6
+    87.5    10.5    20.3    57.8
+   100.0     3.1    11.3    34.4
diff --git a/palettes/yellow_light.spk b/palettes/yellow_light.spk
new file mode 100644
index 0000000..daec617
--- /dev/null
+++ b/palettes/yellow_light.spk
@@ -0,0 +1,3 @@
+  0   100   96   65
+100   100   96   65
+ 
\ No newline at end of file
diff --git a/palettes/yellow_orange_brown.spk b/palettes/yellow_orange_brown.spk
new file mode 100644
index 0000000..68ea30e
--- /dev/null
+++ b/palettes/yellow_orange_brown.spk
@@ -0,0 +1,9 @@
+     0.0    99.6    99.6    89.5
+    12.5    99.6    96.5    73.4
+    25.0    99.2    88.7    56.6
+    37.5    99.2    76.6    30.9
+    50.0    99.2    59.8    16.0
+    62.5    92.2    43.8     7.8
+    75.0    79.7    29.7     0.8
+    87.5    59.8    20.3     1.6
+   100.0    39.8    14.5     2.3
diff --git a/platform_specific.mk.i386-apple-darwin b/platform_specific.mk.i386-apple-darwin
new file mode 100644
index 0000000..95a8510
--- /dev/null
+++ b/platform_specific.mk.i386-apple-darwin
@@ -0,0 +1,171 @@
+#
+# platform_specific_includes.mk.i386-apple-darwin
+#
+# This file is included in other Makefiles and defines
+# platform specific macros
+
+	GKS_INCLUDES	= -I../../ppl/include/xgks \
+			  -I../../xgks/src/lib \
+			  -Ipplinc/xgks \
+			  -I../../xgks/port 
+
+	INCLUDES        = -I. \
+			  -I../fmt/cmn/ \
+			  -I$(NETCDF4_DIR)/include \
+			  -I$(READLINE_DIR)/include \
+			  -I../common \
+			  -I../../fmt/cmn \
+			  -I../../ppl/include \
+			  -I../../fer/common \
+			  $(GKS_INCLUDES) \
+			  -I/usr/local/include
+
+	FINCLUDES	= -I../../ppl/tmap_inc \
+			  -I../include \
+			  -I../../fmt/cmn \
+			  -I../common \
+			  -I../../ppl/include \
+			  -I../../fer/common
+
+	PLATFORM = $(shell uname -s -r) 
+
+	CC              = gcc
+	CXX		= c++
+	FC		= gfortran
+	F77		= gfortran
+
+	RANLIB          = /usr/bin/ranlib
+
+	CPP		= /usr/bin/cpp
+
+	CPP_FLAGS       = $(INCLUDES) \
+			  -fPIC \
+			  -Dunix \
+			  -Dgfortran \
+			  -DNO_OPEN_SHARED \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_SNGL \
+			  -DX_REFRESH \
+			  -Dreclen_in_bytes \
+			  -DNO_OPEN_READONLY \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -Dxgks \
+			  -DSTAR_1_SUPPORTED \
+			  -DFULL_GUI_VERSION \
+			  -DX_REFRESH \
+			  -DXT_CODE \
+			  -DDARWIN  \
+			  -DMAC_SSIZE \
+			  -DLINUX \
+			  -DNO_PASSED_CONCAT \
+			  -Dcrptd_cat_argument \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DNEED_IAND \
+			  -DNO_PREPEND_STRING \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -Ddouble_p/
+
+# -DusingDODSf2cUnderscore needed if using netcdf library...
+# also consider -ffloat-store.
+	CFLAGS	= \
+			  $(CPP_FLAGS) \
+			  -Dlint \
+			  -D_SSIZE_T \
+			  -DVOID_SIGHANDLER \
+			  -D_POSIX_VERSION \
+			  -DLINUX \
+			  -DFULL_GUI_VERSION \
+			  -DX_REFRESH \
+			  -DXT_CODE \
+			  -Dsun4 
+
+	FFLAGS = $(CPP_FLAGS) \
+			  -fno-automatic \
+			  -fno-second-underscore \
+			  -fdollar-ok \
+			  -ffixed-line-length-132 \
+			  -ffpe-trap=overflow $(FINCLUDES) \
+			  -fdefault-real-8 \
+			  -fdefault-double-8
+
+	PPLUS_FFLAGS = \
+			  $(CPP_FLAGS) \
+			  -fno-automatic \
+			  -fno-second-underscore \
+			  -fdollar-ok \
+			  -ffixed-line-length-132 \
+			  $(FINCLUDES)
+
+
+	# Below this line are macro definitions used only for the final linking of the executable
+	# specify gfortran library. With gfortran 4.4, ssee notews in the i386-linux platform
+	# flags file.
+
+	LD		= gcc
+	LDFLAGS		= \
+			  -v \
+			  --verbose \
+			  -fPIC
+
+	SYSLIB		= \
+			  -L/usr/X11R6/lib -lX11 \
+			  /usr/local/gfortran/lib/libgfortran.a \
+			  -lcurl \
+			  -ldl \
+			  -L$(LIBZ_DIR)/lib -lz \
+			  -lm
+
+# -static-libgfortran can be used with gfortran 4.4 but not 4.1
+# /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgfortran.a
+
+	TMLIB		= ../lib/tmap_lib.a
+
+	GKSLIB		= ../xgks/src/lib/libxgks.a
+
+# For netCDF4 using new hdf5 and new zlib
+
+	CDFLIB		= \
+			  $(NETCDF4_DIR)/lib/libnetcdff.a \
+			  $(NETCDF4_DIR)/lib/libnetcdf.a \
+			  $(HDF5_DIR)/lib/libhdf5_hl.a \
+			  $(HDF5_DIR)/lib/libhdf5.a \
+			  -L$(LIBZ_DIR)/lib/ -lz
+
+	LINUX_OBJS	= \
+			  special/linux_routines.o \
+			  dat/*.o \
+			  ../fmt/src/x*.o \
+			  ../ppl/plot/ppldata.o
+
+# Use the home-built libncurses.so to build so
+# libtinfo.so is not a requirement from RHEL6
+# builds.
+# (But use the system ncurses.so.5 for running.)
+
+	TERMCAPLIB	= -L/usr/lib -lncurses
+
+	READLINELIB	= -L$(READLINE_DIR)/lib -lreadline 
+#			  $(READLINE_DIR)/lib/libhistory.a
+
+# cancel the default rule for .f -> .o to prevent objects from being built
+# from .f files that are out-of-date with respect to their corresponding .F file
+# %.o : %__.f
+
+# use cpp to preprocess the .F files to .f files and then compile the .f files
+# rename to __.f because removing .f also removes .F
+#%.o : %.F
+#	rm -f $*__.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*__.f
+#	$(F77) $(FFLAGS) -c $*__.f; mv $*__.o $*.o	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran coe
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+
+#
+# End of platform_specific_includes.mk.i386-apple-darwin
+#
diff --git a/platform_specific.mk.i386-linux b/platform_specific.mk.i386-linux
new file mode 100644
index 0000000..5f68d3f
--- /dev/null
+++ b/platform_specific.mk.i386-linux
@@ -0,0 +1,112 @@
+#
+# platform_specific.mk.i386-linux
+#
+# This file is included in Makefiles under the
+# fer, fmt, and ppl directories and defines platform specific macros
+#
+
+#
+# DIR_PREFIX, HDF5_DIR, and NETCDF4_DIR are from site_specific.mk
+# which should have been included prior to this include.
+#
+
+#
+# Directories for the libraries
+#
+ifeq ($(strip $(CAIRO_DIR)),)
+	CAIRO_LIBDIR	=
+#	This is only for code in Pango that did use the proper cairo extension
+	CAIRO_INCLUDE	= -I/usr/include/cairo
+else
+	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib
+#	The second include is only for code in Pango that did use the proper cairo include
+	CAIRO_INCLUDE	= -I$(CAIRO_DIR)/include -I$(CAIRO_DIR)/include/cairo
+endif
+
+ifeq ($(strip $(HDF5_DIR)),)
+	HDF5_LIBDIR	=
+else
+	HDF5_LIBDIR	= $(HDF5_DIR)/lib
+endif
+
+	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib
+
+#
+# Local defines
+#
+	MYINCLUDES	= -I$(PYTHONINCDIR) \
+			  -I$(DIR_PREFIX)/fer/common \
+			  -I$(DIR_PREFIX)/fer/grdel \
+			  -I$(DIR_PREFIX)/fer/cferbind \
+			  -I$(DIR_PREFIX)/fmt/cmn \
+			  -I$(DIR_PREFIX)/ppl/include \
+			  -I$(DIR_PREFIX)/ppl/tmap_inc \
+			  -I$(DIR_PREFIX)/pyfermod \
+			  -I$(DIR_PREFIX)/external_functions/ef_utility \
+			  $(CAIRO_INCLUDE) \
+			  -I/usr/include/pango-1.0 \
+			  -I/usr/include/glib-2.0 \
+			  -I/usr/lib/glib-2.0/include \
+			  -I$(NETCDF4_DIR)/include
+
+	MYDEFINES	= -Dcrptd_cat_argument \
+			  -Ddouble_p \
+			  -Dgfortran \
+			  -Dreclen_in_bytes \
+			  -Dunix \
+			  -Dxgks \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DINTERNAL_READ_FORMAT_BUG \
+			  -DLINUX \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNEED_IAND \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -DNO_OPEN_READONLY \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_OPEN_SHARED \
+			  -DNO_PASSED_CONCAT \
+			  -DNO_PREPEND_STRING \
+			  -DSTAR_1_SUPPORTED \
+			  -DVOID_SIGHANDLER \
+			  -DX_REFRESH \
+			  -DXT_CODE
+
+	CPP		= $(shell which cpp)
+	CC		= $(shell which gcc)
+	FC		= $(shell which gfortran)
+	F77		= $(shell which gfortran)
+	RANLIB		= $(shell which ranlib)
+
+	CPP_FLAGS	= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	CFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	FFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash \
+			  -fimplicit-none -fdefault-real-8 -fdefault-double-8
+	PPLUS_FFLAGS	= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash
+
+# LD and LD_DYN_FLAGS only used for generating ferret_ef_mem_subsc.so
+	LD		= $(shell which gfortran)
+	LD_DYN_FLAGS	= -m32 -fPIC -shared -rdynamic -Xlinker --no-undefined \
+			  -L $(DIR_PREFIX)/pyferret_install/lib/$(PYTHON_EXE)/site-packages/pyferret
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#
+# End of platform_specific.mk.i386-linux
+#
diff --git a/platform_specific.mk.i386-linux-gnu b/platform_specific.mk.i386-linux-gnu
new file mode 100644
index 0000000..2124329
--- /dev/null
+++ b/platform_specific.mk.i386-linux-gnu
@@ -0,0 +1,113 @@
+#
+# platform_specific.mk.i386-linux
+#
+# This file is included in Makefiles under the
+# fer, fmt, and ppl directories and defines platform specific macros
+#
+
+#
+# DIR_PREFIX, HDF5_DIR, and NETCDF4_DIR are from site_specific.mk
+# which should have been included prior to this include.
+#
+
+#
+# Directories for the libraries
+#
+ifeq ($(strip $(CAIRO_DIR)),)
+	CAIRO_LIBDIR	=
+#	This is only for code in Pango that did use the proper cairo extension
+	CAIRO_INCLUDE	= -I/usr/include/cairo
+else
+	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib
+#	The second include is only for code in Pango that did use the proper cairo include
+	CAIRO_INCLUDE	= -I$(CAIRO_DIR)/include -I$(CAIRO_DIR)/include/cairo
+endif
+
+ifeq ($(strip $(HDF5_DIR)),)
+	HDF5_LIBDIR	=
+else
+	HDF5_LIBDIR	= $(HDF5_DIR)/lib
+endif
+
+	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib
+
+#
+# Local defines
+#
+	MYINCLUDES	= -I$(PYTHONINCDIR) \
+			  -I$(DIR_PREFIX)/fer/common \
+			  -I$(DIR_PREFIX)/fer/grdel \
+			  -I$(DIR_PREFIX)/fer/cferbind \
+			  -I$(DIR_PREFIX)/fmt/cmn \
+			  -I$(DIR_PREFIX)/ppl/include \
+			  -I$(DIR_PREFIX)/ppl/tmap_inc \
+			  -I$(DIR_PREFIX)/pyfermod \
+			  -I$(DIR_PREFIX)/external_functions/ef_utility \
+			  $(CAIRO_INCLUDE) \
+			  -I/usr/include/pango-1.0 \
+			  -I/usr/include/glib-2.0 \
+			  -I/usr/lib/glib-2.0/include \
+                          -I/usr/lib/i386-linux-gnu/glib-2.0/include \
+			  -I$(NETCDF4_DIR)/include
+
+	MYDEFINES	= -Dcrptd_cat_argument \
+			  -Ddouble_p \
+			  -Dgfortran \
+			  -Dreclen_in_bytes \
+			  -Dunix \
+			  -Dxgks \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DINTERNAL_READ_FORMAT_BUG \
+			  -DLINUX \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNEED_IAND \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -DNO_OPEN_READONLY \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_OPEN_SHARED \
+			  -DNO_PASSED_CONCAT \
+			  -DNO_PREPEND_STRING \
+			  -DSTAR_1_SUPPORTED \
+			  -DVOID_SIGHANDLER \
+			  -DX_REFRESH \
+			  -DXT_CODE
+
+	CPP		= $(shell which cpp)
+	CC		= $(shell which gcc)
+	FC		= $(shell which gfortran)
+	F77		= $(shell which gfortran)
+	RANLIB		= $(shell which ranlib)
+
+	CPP_FLAGS	= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	CFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	FFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash \
+			  -fimplicit-none -fdefault-real-8 -fdefault-double-8
+	PPLUS_FFLAGS	= $(MYINCLUDES) $(MYDEFINES) -m32 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash
+
+# LD and LD_DYN_FLAGS only used for generating ferret_ef_mem_subsc.so
+	LD		= $(shell which gfortran)
+	LD_DYN_FLAGS	= -m32 -fPIC -shared -rdynamic -Xlinker --no-undefined \
+			  -L $(DIR_PREFIX)/pyferret_install/lib/$(PYTHON_EXE)/site-packages/pyferret
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#
+# End of platform_specific.mk.i386-linux
+#
diff --git a/platform_specific.mk.intel-mac b/platform_specific.mk.intel-mac
new file mode 100644
index 0000000..7fee2d4
--- /dev/null
+++ b/platform_specific.mk.intel-mac
@@ -0,0 +1,95 @@
+#
+# platform_specific.mk.intel-mac
+#
+# This file is included in Makefiles under the
+# fer, fmt, and ppl directories and defines platform specific macros
+#
+
+#
+# DIR_PREFIX, HDF5_DIR, and NETCDF4_DIR are from site_specific.mk
+# which should have been included prior to this include.
+#
+
+	CAIRO_LIBDIR	=
+	HDF5_LIBDIR	=
+	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib
+
+#
+# Local defines
+#
+	MYINCLUDES	= -I$(PYTHONINCDIR) \
+			  -I$(DIR_PREFIX)/fer/common \
+			  -I$(DIR_PREFIX)/fer/grdel \
+			  -I$(DIR_PREFIX)/fer/cferbind \
+			  -I$(DIR_PREFIX)/fmt/cmn \
+			  -I$(DIR_PREFIX)/ppl/include \
+			  -I$(DIR_PREFIX)/ppl/tmap_inc \
+			  -I$(DIR_PREFIX)/pyfermod \
+			  -I$(DIR_PREFIX)/external_functions/ef_utility \
+			  -I/usr/local/include/cairo \
+			  -I/usr/local/include/pango-1.0 \
+			  -I/usr/local/include/glib-2.0 \
+			  -I/usr/local/lib/glib-2.0/include \
+			  -I$(NETCDF4_DIR)/include
+
+	MYDEFINES	= -Dcrptd_cat_argument \
+			  -Ddouble_p \
+			  -Dgfortran \
+			  -Dreclen_in_bytes \
+			  -Dunix \
+			  -Dxgks \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DINTERNAL_READ_FORMAT_BUG \
+			  -DLINUX \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNEED_IAND \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -DNO_OPEN_READONLY \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_OPEN_SHARED \
+			  -DNO_PASSED_CONCAT \
+			  -DNO_PREPEND_STRING \
+			  -DSTAR_1_SUPPORTED \
+			  -DVOID_SIGHANDLER \
+			  -DX_REFRESH \
+			  -DXT_CODE
+
+	CPP		= $(shell which cpp)
+	CC		= $(shell which gcc)
+	FC		= $(shell which gfortran)
+	F77		= $(shell which gfortran)
+	RANLIB		= $(shell which ranlib)
+
+	CPP_FLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC
+	CFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC
+	FFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash \
+			  -fimplicit-none -fdefault-real-8 -fdefault-double-8
+	PPLUS_FFLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash
+
+# LD and LD_DYN_FLAGS only used for generating ferret_ef_mem_subsc.so
+	LD		= $(shell which gfortran)
+	LD_DYN_FLAGS	= -m64 -fPIC -shared -Wl,-bundle \
+			  -L $(DIR_PREFIX)/pyferret_install/lib/$(PYTHON_EXE)/site-packages/pyferret
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#
+# End of platform_specific.mk.x86_64-linux
+#
diff --git a/platform_specific.mk.x86_64-linux b/platform_specific.mk.x86_64-linux
new file mode 100644
index 0000000..2dcf35d
--- /dev/null
+++ b/platform_specific.mk.x86_64-linux
@@ -0,0 +1,117 @@
+#
+# platform_specific.mk.x86_64-linux
+#
+# This file is included in Makefiles under the
+# fer, fmt, and ppl directories and defines platform specific macros
+#
+
+#
+# DIR_PREFIX, HDF5_DIR, and NETCDF4_DIR are from site_specific.mk
+# which should have been included prior to this include.
+#
+
+#
+# Directories for the libraries.  Convention has the 64-bit libraries
+# in a .../lib64 directory, but they may be in a .../lib directory.
+#
+ifeq ($(strip $(CAIRO_DIR)),)
+	CAIRO_LIBDIR	=
+#	This is only for code in Pango that did use the proper cairo extension
+	CAIRO_INCLUDE	= -I/usr/include/cairo
+else
+#	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib
+	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib64
+#	The second include is only for code in Pango that did use the proper cairo include
+	CAIRO_INCLUDE	= -I$(CAIRO_DIR)/include -I$(CAIRO_DIR)/include/cairo
+endif
+
+ifeq ($(strip $(HDF5_DIR)),)
+	HDF5_LIBDIR	=
+else
+#	HDF5_LIBDIR	= $(HDF5_DIR)/lib
+	HDF5_LIBDIR	= $(HDF5_DIR)/lib64
+endif
+
+#	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib
+	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib64
+
+#
+# Local defines
+#
+	MYINCLUDES	= -I$(PYTHONINCDIR) \
+			  -I$(DIR_PREFIX)/fer/common \
+			  -I$(DIR_PREFIX)/fer/grdel \
+			  -I$(DIR_PREFIX)/fer/cferbind \
+			  -I$(DIR_PREFIX)/fmt/cmn \
+			  -I$(DIR_PREFIX)/ppl/include \
+			  -I$(DIR_PREFIX)/ppl/tmap_inc \
+			  -I$(DIR_PREFIX)/pyfermod \
+			  -I$(DIR_PREFIX)/external_functions/ef_utility \
+			  $(CAIRO_INCLUDE) \
+			  -I/usr/include/pango-1.0 \
+			  -I/usr/include/glib-2.0 \
+			  -I/usr/lib64/glib-2.0/include \
+			  -I$(NETCDF4_DIR)/include
+
+	MYDEFINES	= -Dcrptd_cat_argument \
+			  -Ddouble_p \
+			  -Dgfortran \
+			  -Dreclen_in_bytes \
+			  -Dunix \
+			  -Dxgks \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DINTERNAL_READ_FORMAT_BUG \
+			  -DLINUX \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNEED_IAND \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -DNO_OPEN_READONLY \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_OPEN_SHARED \
+			  -DNO_PASSED_CONCAT \
+			  -DNO_PREPEND_STRING \
+			  -DSTAR_1_SUPPORTED \
+			  -DVOID_SIGHANDLER \
+			  -DX_REFRESH \
+			  -DXT_CODE
+
+	CPP		= $(shell which cpp)
+	CC		= $(shell which gcc)
+	FC		= $(shell which gfortran)
+	F77		= $(shell which gfortran)
+	RANLIB		= $(shell which ranlib)
+
+	CPP_FLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	CFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	FFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash \
+			  -fimplicit-none -fdefault-real-8 -fdefault-double-8
+	PPLUS_FFLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash
+
+# LD and LD_DYN_FLAGS only used for generating ferret_ef_mem_subsc.so
+	LD		= $(shell which gfortran)
+	LD_DYN_FLAGS	= -m64 -fPIC -shared -rdynamic -Xlinker --no-undefined \
+			  -L $(DIR_PREFIX)/pyferret_install/lib64/$(PYTHON_EXE)/site-packages/pyferret \
+			  -L $(DIR_PREFIX)/pyferret_install/lib/$(PYTHON_EXE)/site-packages/pyferret
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#
+# End of platform_specific.mk.x86_64-linux
+#
diff --git a/platform_specific.mk.x86_64-linux-gnu b/platform_specific.mk.x86_64-linux-gnu
new file mode 100644
index 0000000..a7cf5bf
--- /dev/null
+++ b/platform_specific.mk.x86_64-linux-gnu
@@ -0,0 +1,118 @@
+#
+# platform_specific.mk.x86_64-linux
+#
+# This file is included in Makefiles under the
+# fer, fmt, and ppl directories and defines platform specific macros
+#
+
+#
+# DIR_PREFIX, HDF5_DIR, and NETCDF4_DIR are from site_specific.mk
+# which should have been included prior to this include.
+#
+
+#
+# Directories for the libraries.  Convention has the 64-bit libraries
+# in a .../lib64 directory, but they may be in a .../lib directory.
+#
+ifeq ($(strip $(CAIRO_DIR)),)
+	CAIRO_LIBDIR	=
+#	This is only for code in Pango that did use the proper cairo extension
+	CAIRO_INCLUDE	= -I/usr/include/cairo
+else
+	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib
+#	CAIRO_LIBDIR	= $(CAIRO_DIR)/lib64
+#	The second include is only for code in Pango that did use the proper cairo include
+	CAIRO_INCLUDE	= -I$(CAIRO_DIR)/include -I$(CAIRO_DIR)/include/cairo
+endif
+
+ifeq ($(strip $(HDF5_DIR)),)
+	HDF5_LIBDIR	=
+else
+	HDF5_LIBDIR	= $(HDF5_DIR)/lib
+#	HDF5_LIBDIR	= $(HDF5_DIR)/lib64
+endif
+
+	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib
+#	NETCDF4_LIBDIR	= $(NETCDF4_DIR)/lib64
+
+#
+# Local defines
+#
+	MYINCLUDES	= -I$(PYTHONINCDIR) \
+			  -I$(DIR_PREFIX)/fer/common \
+			  -I$(DIR_PREFIX)/fer/grdel \
+			  -I$(DIR_PREFIX)/fer/cferbind \
+			  -I$(DIR_PREFIX)/fmt/cmn \
+			  -I$(DIR_PREFIX)/ppl/include \
+			  -I$(DIR_PREFIX)/ppl/tmap_inc \
+			  -I$(DIR_PREFIX)/pyfermod \
+			  -I$(DIR_PREFIX)/external_functions/ef_utility \
+			  $(CAIRO_INCLUDE) \
+			  -I/usr/include/pango-1.0 \
+			  -I/usr/include/glib-2.0 \
+			  -I/usr/lib64/glib-2.0/include \
+                          -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
+			  -I$(NETCDF4_DIR)/include
+
+	MYDEFINES	= -Dcrptd_cat_argument \
+			  -Ddouble_p \
+			  -Dgfortran \
+			  -Dreclen_in_bytes \
+			  -Dunix \
+			  -Dxgks \
+			  -DG77_SIGNAL \
+			  -DG77 \
+			  -DINTERNAL_READ_FORMAT_BUG \
+			  -DLINUX \
+			  -DMANDATORY_FORMAT_WIDTHS \
+			  -DNEED_IAND \
+			  -DNO_DOUBLE_ESCAPE_SLASH \
+			  -DNO_OPEN_CARRIAGECONTROL \
+			  -DNO_OPEN_READONLY \
+			  -DNO_OPEN_RECORDTYPE \
+			  -DNO_OPEN_SHARED \
+			  -DNO_PASSED_CONCAT \
+			  -DNO_PREPEND_STRING \
+			  -DSTAR_1_SUPPORTED \
+			  -DVOID_SIGHANDLER \
+			  -DX_REFRESH \
+			  -DXT_CODE
+
+	CPP		= $(shell which cpp)
+	CC		= $(shell which gcc)
+	FC		= $(shell which gfortran)
+	F77		= $(shell which gfortran)
+	RANLIB		= $(shell which ranlib)
+
+	CPP_FLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	CFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4
+	FFLAGS		= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash \
+			  -fimplicit-none -fdefault-real-8 -fdefault-double-8
+	PPLUS_FFLAGS	= $(MYINCLUDES) $(MYDEFINES) -m64 -fPIC -fno-automatic -fdollar-ok \
+			  -ffixed-line-length-132 -fno-second-underscore -fno-backslash
+
+# LD and LD_DYN_FLAGS only used for generating ferret_ef_mem_subsc.so
+	LD		= $(shell which gfortran)
+	LD_DYN_FLAGS	= -m64 -fPIC -shared -rdynamic -Xlinker --no-undefined \
+			  -L $(DIR_PREFIX)/pyferret_install/lib64/$(PYTHON_EXE)/site-packages/pyferret \
+			  -L $(DIR_PREFIX)/pyferret_install/lib/$(PYTHON_EXE)/site-packages/pyferret
+
+## cancel the default rule for .f -> .o to prevent objects from being built
+## from .f files that are out-of-date with respect to their corresponding .F file
+#%.o : %.f
+#
+## use cpp to preprocess the .F files to .f files and then compile the .f files
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(FFLAGS) -c $*.f
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(FFLAGS) -c $*.F -o $*.o
+
+#
+# End of platform_specific.mk.x86_64-linux
+#
diff --git a/ppl/Makefile b/ppl/Makefile
new file mode 100644
index 0000000..04f5a3f
--- /dev/null
+++ b/ppl/Makefile
@@ -0,0 +1,43 @@
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+
+include ../site_specific.mk
+include ../platform_specific.mk.$(BUILDTYPE)
+
+DIRS	= tmapadds complot ourlib plot \
+	  plotlib pplepic pplusr symlib
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+#
+# Targets
+#
+
+all:
+	for i in $(DIRS) ; do \
+            if ! $(MAKE) -C $$i ; then \
+                exit 1 ; \
+            fi ; \
+        done
+
+
+clean:
+	for i in $(DIRS) ; do \
+            $(MAKE) -C $$i clean ; \
+        done
+
+#
+# End of Makefile
+#
diff --git a/ppl/complot/LIB_NAME b/ppl/complot/LIB_NAME
new file mode 100644
index 0000000..4193b4c
--- /dev/null
+++ b/ppl/complot/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libcmp.a
+ 
diff --git a/ppl/complot/Makefile b/ppl/complot/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/complot/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/complot/SOURCE_FILES b/ppl/complot/SOURCE_FILES
new file mode 100644
index 0000000..bedcb1a
--- /dev/null
+++ b/ppl/complot/SOURCE_FILES
@@ -0,0 +1,68 @@
+SRCS_F = \
+abmv.F\
+abmv_makedot.F\
+abplt.F\
+abplt_makedot.F\
+alphas.F\
+axis.F\
+axisl.F\
+baud.F\
+bell.F\
+check.F\
+chin.F\
+chout.F\
+circle.F\
+clear_vp.F\
+color.F\
+dashes.F\
+dashsz.F\
+englsh.F\
+erase.F\
+gksmv.F\
+gksmv_makedot.F\
+grid.F\
+hpabmv.F\
+igrinpt.F\
+line.F\
+line3.F\
+makedot.F\
+mark.F\
+marker.F\
+markh.F\
+metric.F\
+mirror.F\
+number.F\
+obliq3.F\
+opndev.F\
+origin.F\
+page.F\
+plot3.F\
+plotype.F\
+pltend.F\
+pltlun.F\
+pltnme.F\
+points.F\
+positon.F\
+prime.F\
+putchsun.F\
+range.F\
+range_dm.F\
+rangel.F\
+rotate.F\
+scale3.F\
+symbel.F\
+symbol.F\
+tabmv.F\
+teklun.F\
+teknme.F\
+tekpaus.F\
+tform.F\
+tformi.F\
+tktype.F\
+vectors.F\
+view3.F\
+window.F\
+xyzplt.F\
+zabmv.F\
+zbufft.F\
+zoom.F 
diff --git a/ppl/complot/abmv.F b/ppl/complot/abmv.F
new file mode 100644
index 0000000..3e69871
--- /dev/null
+++ b/ppl/complot/abmv.F
@@ -0,0 +1,107 @@
+      SUBROUTINE ABMV
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)abmv.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     Mod *JD* 4.5.91 to include PLTDAT.DAT in unix/vms system dependent way
+
+C     CALL ABMV
+C
+C     ALL PLOTTING EVENTUALLY MUST BE ACCOMPLISHED BY MOVING THE
+C     PEN FROM ONE LOCATION TO ANOTHER.  ABMV PERFORMS THIS FUNC-
+C     TION BY CALLING THE DRIVER ROUTINES FOR THE VARIOUS PLOTTING
+C     DEVICES.  THESE SUBROUTINES ARE LISTED BELOW:
+C        TABMV  - TEKTRONIX GRAPHICS TERMINAL
+C        PRABMV - PRINTRONIX PRINTER PLOTTER
+C        ZABMV  - ZETA PLOTTER
+C        BABMV  - BENSON PLOTTER
+C	 GKSMV  - GKS DRIVER
+C
+C
+C *kob* 9/98 - use external statemen to initialize block data rather than an
+C              included .DAT file.  the latter was causing mutliple 
+C              references 
+
+#ifdef unix
+      include 'PLTCOM.DAT'
+      external pltdat_block_data
+#else
+      include 'pplv11inc:PLTCOM.DAT'
+      include 'pplv11inc:PLTDAT_VMS.DAT'
+#endif
+C
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+C
+C     CHECK THE PLOT TYPE.
+C
+      GO TO(10,40,30,10,10,20,20),PTYPE + 3
+C
+C     PLOT ON THE TEKTERMINAL.
+C
+   10 CALL TABMV
+	GOTO 25
+20	CALL GKSMV
+C
+C     CHECK FOR OTHER PLOTTING DEVICES.
+C
+25      GOTO(40,50,50,50,30,50,30),PTYPE +3
+C
+C     PLOT ON THE PRINTRONIX PRINTER PLOTTER.
+C
+C
+C     PLOT ON THE ZETA PLOTTER.
+C
+   30 CALL ZABMV
+	GOTO 50
+C
+C	PLOT ON THE HP7475 PLOTTER
+C
+C
+40	CALL HPABMV
+   50 LPEN = PEN
+      RETURN
+C
+      END
diff --git a/ppl/complot/abmv_makedot.F b/ppl/complot/abmv_makedot.F
new file mode 100644
index 0000000..46847ce
--- /dev/null
+++ b/ppl/complot/abmv_makedot.F
@@ -0,0 +1,111 @@
+      SUBROUTINE ABMV_makedot
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)abmv.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     Mod *JD* 4.5.91 to include PLTDAT.DAT in unix/vms system dependent way
+*  
+*  8/2001  acm  for PLOT/SYMBOL=DOT
+*  Version of ABMV to be called by make_dot.  Call GPM for polymarker
+*  rather than GPL (polyline) 
+
+C     CALL ABMV
+C
+C     ALL PLOTTING EVENTUALLY MUST BE ACCOMPLISHED BY MOVING THE
+C     PEN FROM ONE LOCATION TO ANOTHER.  ABMV PERFORMS THIS FUNC-
+C     TION BY CALLING THE DRIVER ROUTINES FOR THE VARIOUS PLOTTING
+C     DEVICES.  THESE SUBROUTINES ARE LISTED BELOW:
+C        TABMV  - TEKTRONIX GRAPHICS TERMINAL
+C        PRABMV - PRINTRONIX PRINTER PLOTTER
+C        ZABMV  - ZETA PLOTTER
+C        BABMV  - BENSON PLOTTER
+C	 GKSMV_makedot  - GKS DRIVER calling polymarker
+C
+C
+C *kob* 9/98 - use external statemen to initialize block data rather than an
+C              included .DAT file.  the latter was causing mutliple 
+C              references 
+
+#ifdef unix
+      include 'PLTCOM.DAT'
+      external pltdat_block_data
+#else
+      include 'pplv11inc:PLTCOM.DAT'
+      include 'pplv11inc:PLTDAT_VMS.DAT'
+#endif
+C
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+C
+C     CHECK THE PLOT TYPE.
+C
+      GO TO(10,40,30,10,10,20,20),PTYPE + 3
+C
+C     PLOT ON THE TEKTERMINAL.
+C
+   10 CALL TABMV
+	GOTO 25
+20	CALL GKSMV_makedot
+C
+C     CHECK FOR OTHER PLOTTING DEVICES.
+C
+25      GOTO(40,50,50,50,30,50,30),PTYPE +3
+C
+C     PLOT ON THE PRINTRONIX PRINTER PLOTTER.
+C
+C
+C     PLOT ON THE ZETA PLOTTER.
+C
+   30 CALL ZABMV
+	GOTO 50
+C
+C	PLOT ON THE HP7475 PLOTTER
+C
+C
+40	CALL HPABMV
+   50 LPEN = PEN
+      RETURN
+C
+      END
diff --git a/ppl/complot/abplt.F b/ppl/complot/abplt.F
new file mode 100644
index 0000000..db83c5a
--- /dev/null
+++ b/ppl/complot/abplt.F
@@ -0,0 +1,295 @@
+      SUBROUTINE ABPLT
+                
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+****************************************************************
+* revised for FERRET
+* from PPLUS :
+*	Directory PMEL:[PLOT5.LIBRARY.COMPLOT]
+*	ABPLT.FOR;2               9   5-FEB-1985 11:33 
+* search for "FERRET" to find all revisions
+* *sh* 9/13/88 - rev 1.0 for FERRET 1.10+
+*	- if GKS (ptype>2) then bypass clipping at screen limits
+* 
+* *kob* 3/02 - need to add sgi to ifdef statement 
+****************************************************************
+*     CALL ABPLT
+
+*     THIS SUBROUTINE PERFORMS SCREEN CLIPPING AND THEN MOVES THE
+*     PEN FROM THE CURRENT POSITION TO A NEW POINT.
+
+
+******************************************************************
+* FERRET mod - for explicit declarations - 9-13-88
+C     DIMENSION AMXMN(2),BMXMN(2)
+      REAL AMXMN(2),BMXMN(2), binter, ainter
+      EQUIVALENCE (AMXMN(1),AMAX),(BMXMN(1),BMAX)
+
+#ifdef unix
+      include 'pltcom_dat.decl'
+      include 'PLTCOM.DAT'
+#else
+      INCLUDE 'tmap_pplv11inc:tmap_PLTCOM.DAT'
+      INCLUDE 'pplv11inc:pltcom.dat'
+#endif
+C end of FERRET mod
+******************************************************************
+
+C     CALCULATE THE NEW OFF-SCREEN FLAG.
+
+******************************************************************
+C FERRET mod - bypass GKS clipping - 9-13-88
+      IF ( ptype .LT. 3 ) THEN
+          OSFLG = 0
+          IF(ANEW - 0.001 .GT. AMAX)OSFLG = 1
+          IF(ANEW + 0.001 .LT. AMIN)OSFLG = 2
+          IF(BNEW - 0.001 .GT. BMAX)OSFLG = OSFLG + 4
+          IF(BNEW + 0.001 .LT. BMIN)OSFLG = OSFLG + 8
+       ELSE
+          OSFLG = 0
+          losflg = 0            ! reset by many PPLUS routines
+       ENDIF
+* end of FERRET mod
+******************************************************************
+
+C     CHECK THE PEN POSITION.
+
+       IF(.NOT. PENF)GO TO 90
+
+C     CHECK THE PLOTTING MODE.
+
+      IF(PMODE .EQ. POINT)GO TO 80
+
+C     CHECK THE OLD AND NEW POINTS TO SEE IF THEY ARE BOTH OUT-
+C     SIDE THE BOUNDARY OF THE SCREEN IN THE SAME DIRECTION.  IF
+C     SO, NO INTERCEPT EXISTS.
+
+#ifdef unix
+# ifdef NEED_IAND
+      IF(IAND(LOSFLG,OSFLG) .NE. 0)GO TO 100
+# else
+      IF(AND(LOSFLG,OSFLG) .NE. 0)GO TO 100
+# endif
+#else
+      IF(IAND(LOSFLG,OSFLG) .NE. 0)GO TO 100
+#endif
+C     CHECK THE OLD POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE SCREEN.  IF NOT, COMPUTE THE INTERCEPT.
+
+      IF(LOSFLG .EQ. 0)GO TO 30
+
+C     CHECK THE HORIZONTAL LIMITS OF THE SCREEN.
+
+#ifdef unix
+# ifdef NEED_IAND
+        if(ishft(losflg,-2) .eq. 0)goto 10
+# else
+        if(rshift(losflg,2) .eq. 0)goto 10
+# endif
+#else
+        if(ishft(losflg,-2) .eq. 0)goto 10
+#endif
+
+C    THE POINT IS OUTSIDE THE HORIZONTAL LIMITS OF THE SCREEN.
+C    CALCULATE THE INTERCEPT.
+       
+#ifdef unix
+# ifdef NEED_IAND
+        binter = bmxmn(ishft(losflg,-2))
+# else
+        binter = bmxmn(rshift(losflg,2))
+# endif
+#else
+        binter = bmxmn(ishft(losflg,-2))
+#endif
+      AINTER = (ANEW - AOLD) * (BINTER - BOLD) / (BNEW - BOLD) +
+     * AOLD
+    
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE SCREEN.
+
+      IF(AINTER + 0.001 .GE. AMIN .AND. AINTER - 0.001 .LE. AMAX)
+     * GO TO 20
+
+C     THE POINT IS OUTSIDE THE VERTICAL LIMITS OF THE SCREEN.
+C     CALCULATE THE INTERCEPT.
+
+#ifdef unix
+# ifdef NEED_IAND
+ 10         ainter = amxmn(iand(losflg,3))
+# else
+ 10         AINTER = AMXMN(AND(LOSFLG,3))
+# endif
+#else
+ 10         ainter = amxmn(iand(losflg,3))
+#endif
+      BINTER = (BNEW - BOLD) * (AINTER - AOLD) / (ANEW - AOLD) +
+     * BOLD
+
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE SCREEN.
+
+      IF(BINTER + 0.001 .LT. BMIN .OR. BINTER - 0.001 .GT. BMAX)
+     * GO TO 100
+
+C     PLOT TO THE INTERCEPT WITH THE PEN UP.
+
+  20  A = AINTER - AMIN
+      B = BINTER - BMIN
+      PEN = .FALSE.
+      CALL ABMV
+      GO TO 40
+
+C     CHECK THE OLD POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, PLOT TO THE INTERCEPT WITH THE PEN UP.
+
+  30  IF(LOWFLG .EQ. 0)GO TO 40
+      A = AOLD - AMIN
+      B = BOLD - BMIN
+      PEN = .FALSE.
+      CALL ABMV
+
+C      CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C      THE SCREEN.  IF NOT, COMPUTE THE INTERCEPT.
+
+  40  IF(OSFLG .EQ. 0)GO TO 70
+
+C     CHECK THE HORIZONTAL LIMITS OF THE SCREEN.
+#ifdef unix
+#if defined sun || defined sgi
+        if(rshift(osflg,2) .eq. 0)goto 50
+#else
+# ifdef NEED_IAND
+        IF(ISHFT(OSFLG,-2) .EQ. 0)GO TO 50
+# else
+        IF(LSHIFT(OSFLG,-2) .EQ. 0)GO TO 50
+# endif
+#endif
+#else
+        IF(ISHFT(OSFLG,-2) .EQ. 0)GO TO 50
+#endif
+
+C     THE POINT IS OUTSIDE THE HORIZONTAL LIMITS OF THE SCREEN.
+C     CALCULATE THE INTERCEPT.
+#ifdef unix
+#if defined sun || defined sgi
+        binter = bmxmn(rshift(osflg,2))
+#else
+# ifdef NEED_IAND
+        BINTER = BMXMN(ISHFT(OSFLG,-2))
+# else
+        BINTER = BMXMN(LSHIFT(OSFLG,-2))
+# endif
+#endif
+#else
+        BINTER = BMXMN(ISHFT(OSFLG,-2))
+#endif
+      AINTER = (ANEW - AOLD) * (BINTER - BOLD) / (BNEW - BOLD) +
+     * AOLD
+
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE SCREEN.
+
+      IF(AINTER + 0.001 .GE. AMIN .AND. AINTER - 0.001 .LE. AMAX)
+     * GO TO 60
+
+C     THE POINT IS OUTSIDE THE VERTICAL LIMITS OF THE SCREEN.
+C     CALCULATE THE INTERCEPT.
+#ifdef unix
+# ifdef NEED_IAND
+ 50    AINTER = AMXMN(IAND(OSFLG,3))
+# else
+ 50    AINTER = AMXMN(AND(OSFLG,3))
+# endif
+#else
+ 50    AINTER = AMXMN(IAND(OSFLG,3))
+#endif
+      BINTER = (BNEW - BOLD) * (AINTER - AOLD) / (ANEW - AOLD) +
+     * BOLD
+
+C     PLOT TO THE INTERCEPT WITH THE PEN DOWN.
+
+  60  A = AINTER - AMIN
+      B = BINTER - BMIN
+      PEN = .TRUE.
+      CALL ABMV
+      GO TO 100
+
+C     PLOT TO THE POINT WITH THE PEN DOWN.
+
+  70  A = ANEW - AMIN
+      B = BNEW - BMIN
+      PEN = .TRUE.
+      CALL ABMV
+      GO TO 100
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE SCREEN.  IF NOT, DO NOT PLOT IT.
+
+  80  IF(OSFLG .NE. 0)GO TO 100
+
+C     PLOT TO THE POINT WITH THE PEN UP AND THEN DRAW A DOT.
+
+      A = ANEW - AMIN
+      B = BNEW - BMIN
+      PEN = .FALSE.
+      CALL ABMV
+      PEN = .TRUE.
+      CALL ABMV
+      GO TO 100
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE SCREEN.  IF NOT, DO NOT PLOT IT.
+
+  90  IF(OSFLG .NE. 0)GO TO 100
+
+C     PLOT TO THE POINT WITH THE PEN UP.
+
+      A = ANEW - AMIN
+      B = BNEW - BMIN
+      PEN = .FALSE.
+      CALL ABMV
+
+C     MOVE THE COORDINATES OF THE NEW POINT TO THE OLD POINT.
+
+ 100  AOLD = ANEW
+      BOLD = BNEW
+      AOSOLD = A
+      BOSOLD = B
+      LOSFLG = OSFLG
+      RETURN
+
+      END
diff --git a/ppl/complot/abplt_makedot.F b/ppl/complot/abplt_makedot.F
new file mode 100644
index 0000000..f85dc25
--- /dev/null
+++ b/ppl/complot/abplt_makedot.F
@@ -0,0 +1,122 @@
+      SUBROUTINE ABPLT_makedot
+                
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+****************************************************************
+* revised for FERRET
+* from PPLUS :
+*	Directory PMEL:[PLOT5.LIBRARY.COMPLOT]
+*	ABPLT.FOR;2               9   5-FEB-1985 11:33 
+
+*  8/2001  acm  for PLOT/SYMBOL=DOT
+*  Simplified version of ABPLT to be called by make_dot.  no need
+*  to compute intercepts for points off-screen.  If off-screen do
+*  not plot
+*  10/2001 acm do buffering on GKS calls.  Also remove VMS includes.
+
+****************************************************************
+*     CALL ABPLT
+
+*     THIS SUBROUTINE PERFORMS SCREEN CLIPPING AND THEN MOVES THE
+*     PEN FROM THE CURRENT POSITION TO A NEW POINT.
+
+
+      include 'pltcom_dat.decl'
+      include 'PLTCOM.DAT'
+
+C end of FERRET mod
+******************************************************************
+
+C     CALCULATE THE NEW OFF-SCREEN FLAG.
+
+******************************************************************
+C FERRET mod - bypass GKS clipping - 9-13-88
+      IF ( ptype .LT. 3 ) THEN
+          OSFLG = 0
+          IF(ANEW - 0.001 .GT. AMAX)OSFLG = 1
+          IF(ANEW + 0.001 .LT. AMIN)OSFLG = 2
+          IF(BNEW - 0.001 .GT. BMAX)OSFLG = OSFLG + 4
+          IF(BNEW + 0.001 .LT. BMIN)OSFLG = OSFLG + 8
+       ELSE
+          OSFLG = 0
+          losflg = 0            ! reset by many PPLUS routines
+       ENDIF
+* end of FERRET mod
+******************************************************************
+
+C     CHECK THE PEN POSITION.
+
+       IF(.NOT. PENF)GO TO 90
+
+C     CHECK THE PLOTTING MODE.
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE SCREEN.  IF NOT, DO NOT PLOT IT.
+
+  80  IF(OSFLG .NE. 0)GO TO 100
+
+C     PLOT TO THE POINT WITH THE PEN UP AND THEN DRAW A DOT.
+
+      A = ANEW - AMIN
+      B = BNEW - BMIN
+c      PEN = .FALSE.
+c      CALL ABMV_makedot
+      PEN = .TRUE.
+      CALL ABMV_makedot
+      GO TO 100
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE SCREEN.  IF NOT, DO NOT PLOT IT.
+
+  90  IF(OSFLG .NE. 0)GO TO 100
+
+C     PLOT TO THE POINT WITH THE PEN UP.
+
+      A = ANEW - AMIN
+      B = BNEW - BMIN
+      PEN = .FALSE.
+      CALL ABMV_makedot
+
+C     MOVE THE COORDINATES OF THE NEW POINT TO THE OLD POINT.
+
+ 100  AOLD = ANEW
+      BOLD = BNEW
+      AOSOLD = A
+      BOSOLD = B
+      LOSFLG = OSFLG
+      RETURN
+
+      END
diff --git a/ppl/complot/alphas.F b/ppl/complot/alphas.F
new file mode 100644
index 0000000..18fcf78
--- /dev/null
+++ b/ppl/complot/alphas.F
@@ -0,0 +1,109 @@
+      SUBROUTINE ALPHAS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)alphas.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ALPHAS
+C
+C     IN CASE IT IS NECESSARY TO INPUT OR OUTPUT CHARACTER INFOR-
+C     MATION WHILE IN THE PROCESS OF CREATING A DISPLAY, COMPLOT
+C     MUST BE INFORMED.  A CALL TO THIS SUBROUTINE INDICATES THAT
+C     ALPHANUMERIC INFORMATION IS TO FOLLOW.  ON THE HP PLOTTER,
+C     ALPHAS TERMINATES THE CURRENT PLOT AND SENDS FURTHER OUTPUT
+C     TO THE TERMINAL.  ALPHAS HAS NO EFFECT ON THE ZETA AND GER-
+C     BER PLOTTERS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = ALPHA
+C
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+C
+      IF(SAVEF)CALL XYZPLT
+C
+C     CHECK THE PLOT TYPE.
+C
+      IF(PTYPE .EQ. 0.OR.PTYPE.EQ.-1.OR.PTYPE.GT.2)RETURN
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)GO TO 10
+C
+C     SELECT ALPHANUMERIC MODE ON THE TEKTERMINAL.
+C
+      CALL CHOUT(US,1)
+      GO TO 30
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+   10 IF(GRAPHF)THEN
+C
+C     SELECT ALPHANUMERIC MODE ON THE TEKTRONIX PLOTTER.
+C
+        CALL CHOUT(US,1)
+C
+C     TRANSMIT THE "PLOTTER OFF" COMMAND TO THE TEKTRONIX PLOTTER.
+C
+        CALL CHOUT(TEKOFF,5)
+      ENDIF
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+   30 CALL CHDMP
+C
+C     RESET THE GRAPHICS FLAG.
+C
+      GRAPHF = .FALSE.
+      RETURN
+C
+      END
diff --git a/ppl/complot/axis.F b/ppl/complot/axis.F
new file mode 100644
index 0000000..878a5cb
--- /dev/null
+++ b/ppl/complot/axis.F
@@ -0,0 +1,222 @@
+      SUBROUTINE AXIS(XALOW,XAHIGH,XAORG,YALOW,YAHIGH,YAORG,XATIC,
+     * YATIC,NATICX,NATICY)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)axis.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL AXIS(XLOW,XHIGH,XORG,YLOW,YHIGH,YORG,XTIC,YTIC,NSTICX,
+C    * NSTICY)
+C
+C     THIS SUBROUTINE DRAWS A SET OF X AND Y AXES IN THE PLOTTING
+C     AREA.  BOTH LARGE AND SMALL TICK MARKS MAY BE DRAWN ON THE
+C     AXES AT REGULAR INTERVALS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XLOW   - MINIMUM VALUE OF THE X-AXIS IN USER'S UNITS.
+C        XHIGH  - MAXIMUM VALUE OF THE X-AXIS IN USER'S UNITS.
+C        XORG   - VALUE OF X AT WHICH THE Y-AXIS CROSSES THE
+C                 X-AXIS IN USER'S UNITS.
+C        YLOW   - MINIMUM VALUE OF THE Y-AXIS IN USER'S UNITS.
+C        YHIGH  - MAXIMUM VALUE OF THE Y-AXIS IN USER'S UNITS.
+C        YORG   - VALUE OF Y AT WHICH THE X-AXIS CROSSES THE
+C                 Y-AXIS IN USER'S UNITS.
+C        XTIC   - DISTANCE BETWEEN LARGE TICK MARKS ON THE X-AXIS
+C                 IN USER'S UNITS.
+C        YTIC   - DISTANCE BETWEEN LARGE TICK MARKS ON THE Y-AXIS
+C                 IN USER'S UNITS.
+C        NSTICX - NUMBER OF SMALL TICK MARKS BETWEEN EACH OF THE
+C                 LARGE TICK MARKS ON THE X-AXIS.
+C        NSTICY - NUMBER OF SMALL TICK MARKS BETWEEN EACH OF THE
+C                 LARGE TICK MARKS ON THE Y-AXIS.
+C
+C     AXIS MAKES SEVERAL CHECKS ON THE PARAMETERS TO MAKE SURE
+C     THAT THEY ARE VALID.  THEY ARE ALTERED INTERNALLY IF NECES-
+C     SARY.
+C
+C
+C     TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      XLOW = XALOW
+      XHIGH = XAHIGH
+      XORG = XAORG
+      YLOW = YALOW
+      YHIGH = YAHIGH
+      YORG = YAORG
+      XTIC = ABS(XATIC)
+      YTIC = ABS(YATIC)
+      NSTICX = NATICX
+      NSTICY = NATICY
+C
+C     CHECK THE PARAMETERS TO MAKE SURE THAT THEY ARE VALID.
+C
+      IF(XLOW .GT. XHIGH)THEN
+        TEMP = XLOW
+        XLOW = XHIGH
+        XHIGH = TEMP
+      ENDIF
+      IF(YLOW .GT. YHIGH)THEN
+        TEMP = YLOW
+        YLOW = YHIGH
+        YHIGH = YLOW
+      ENDIF
+      IF(XORG .LT. XLOW)XORG = XLOW
+      IF(YORG .LT. YLOW)YORG = YLOW
+      IF(XORG .GT. XHIGH)XORG = XHIGH
+      IF(YORG .GT. YHIGH)YORG = YHIGH
+      IF(NSTICX .LT. 0)NSTICX = 0
+      IF(NSTICY .LT. 0)NSTICY = 0
+C
+C     SET VECTRS MODE.
+C
+      CALL VECTRS
+C
+C     START AT THE ORIGIN.
+C
+      X = XORG
+      Y = YORG
+      CALL PLOT(X,Y,0,0)
+C
+C     IF THERE ARE NO TICK MARKS ON THE Y-AXIS, DRAW THE ENTIRE
+C     AXIS.
+C
+      IF(YTIC .EQ. 0.0)THEN
+        CALL PLOT(X,YLOW,0,0)
+        CALL PLOT(X,YHIGH,1,0)
+        CALL PLOT(X,Y,0,0)
+      ELSE
+C
+        SMY = YTIC / FLOAT(NSTICY + 1)
+C
+        IF(YLOW .LT. YORG)THEN
+C
+C     DRAW THE NEGATIVE Y-AXIS.
+C
+   10     IF(NSTICY .EQ. 0)GO TO 30
+          DO 20 J=1,NSTICY
+          Y = Y - SMY
+          IF(Y .LT. YLOW)GO TO 40
+   20     CALL PLOT(X,Y,1,5)
+   30     Y = Y - SMY
+          IF(Y .LT. YLOW)GO TO 40
+          CALL PLOT(X,Y,1,6)
+          GO TO 10
+   40     CALL PLOT(X,YLOW,1,0)
+          Y = YORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+C
+        IF(YHIGH .GT. YORG)THEN
+C
+C     DRAW THE POSITIVE Y-AXIS.
+C
+   50     IF(NSTICY .EQ. 0)GO TO 70
+          DO 60 J=1,NSTICY
+          Y = Y + SMY
+          IF(Y .GT. YHIGH)GO TO 80
+   60     CALL PLOT(X,Y,1,5)
+   70     Y = Y + SMY
+          IF(Y .GT. YHIGH)GO TO 80
+          CALL PLOT(X,Y,1,6)
+          GO TO 50
+   80     CALL PLOT(X,YHIGH,1,0)
+          Y = YORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+      ENDIF
+C
+C     IF THERE ARE NO TICK MARKS ON THE X-AXIS, DRAW THE ENTIRE
+C     AXIS.
+C
+      IF(XTIC .EQ. 0.0)THEN
+        CALL PLOT(XLOW,Y,0,0)
+        CALL PLOT(XHIGH,Y,1,0)
+        CALL PLOT(X,Y,0,0)
+      ELSE
+C
+        SMX = XTIC / FLOAT(NSTICX + 1)
+C
+        IF(XLOW .LT. XORG)THEN
+C
+C     DRAW THE NEGATIVE X-AXIS.
+C
+   90     IF(NSTICX .EQ. 0)GO TO 110
+          DO 100 J=1,NSTICX
+          X = X - SMX
+          IF(X .LT. XLOW)GO TO 120
+  100     CALL PLOT(X,Y,1,7)
+  110     X = X - SMX
+          IF(X .LT. XLOW)GO TO 120
+          CALL PLOT(X,Y,1,8)
+          GO TO 90
+  120     CALL PLOT(XLOW,Y,1,0)
+          X = XORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+C
+        IF(XHIGH .GT. XORG)THEN
+C
+C     DRAW THE POSITIVE X-AXIS.
+C
+  130     IF(NSTICX .EQ. 0)GO TO 150
+          DO 140 J=1,NSTICX
+          X = X + SMX
+          IF(X .GT. XHIGH)GO TO 160
+  140     CALL PLOT(X,Y,1,7)
+  150     X = X + SMX
+          IF(X .GT. XHIGH)GO TO 160
+          CALL PLOT(X,Y,1,8)
+          GO TO 130
+  160     CALL PLOT(XHIGH,Y,1,0)
+          X = XORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+      ENDIF
+C
+C     THE AXES ARE COMPLETE.
+C
+      RETURN
+C
+      END
diff --git a/ppl/complot/axisl.F b/ppl/complot/axisl.F
new file mode 100644
index 0000000..a0c174f
--- /dev/null
+++ b/ppl/complot/axisl.F
@@ -0,0 +1,518 @@
+      SUBROUTINE AXISL(XLOW1,XHIGH1,XORG1,YLOW1,YHIGH1,YORG1,XTIC1,
+     * YTIC1,SMXTC1,SMYTC1,LINTX,LINTY,XUNIT1,YUNIT1,CSIZE,ICODE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)axisl.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C   SUBROUTINE AXISL WILL DRAW AND LABEL A SET OF AXES.
+C   THE PARAMETERS ARE DEFINED AS FOLLOWS:
+C   XLOW1,XLOW   -LOW X VALUE IN USER UNITS.
+C   XHIGH1,XHIGH -HIGH X VALUE IN USER UNITS.
+C   XORG1,XORG   -ORIGIN OF X AXIS (I.E. THE POINT AT WHICH THE Y
+C                 AXIS WILL MEET OR CROSS THE X AXIS).
+C   YLOW1,YLOW   -LOW Y VALUE IN USER UNITS.
+C   YHIGH1,YHIGH -HIGH Y VALUE IN USER UNITS.
+C   YORG1,YORG   -ORIGIN OF Y AXIS (I.E. THE POINT AT WHICH THE X
+C                 AXIS WILL MEET OR CROSS THE Y AXIS).
+C   XTIC1,XTIC   -THE DISTANCE IN USER UNITS BETWEEN MAJOR TICK MARKS
+C                 ON THE X AXIS.
+C   YTIC1,YTIC   -THE DISTANCE IN USER UNITS BETWEEN MAJOR TICK MARKS
+C                 ON THE Y AXIS.
+C   SMXTC1,SMXTIC-NUMBER OF MINOR TICKS BETWEEN MAJOR TICKS ON X AXIS.
+C   SMYTC1,SMYTIC-NUMBER OF MINOR TICKS BETWEEN MAJOR TICKS ON Y AXIS.
+C   LINTX        -LABELING INTERVAL ON THE X AXIS.
+C                 IF LINTX = N, LABEL PLACED EVERY N-TH TICK MARK.
+C                 IF LINTX = 0, NO LABELS WILL BE DRAWN.
+C                 IF LINTX IS NEGATIVE, ONLY END POINTS WILL BE LABELED.
+C   LINTY        -LABELING INTERVAL ON THE Y AXIS.
+C   XUNIT1,XUNIT -FACTOR TO BE DIVIDED INTO LABELING VALUE ON X AXIS.
+C   YUNIT1,YUNIT -FACTOR TO BE DIVIDED INTO LABELING VALUE ON Y AXIS.
+C   CSIZE        -THE SIZE OF THE CHARACTERS FOR THE LABELS.
+C   ICODE        -THE TYPE OF AXIS TO BE DRAWN
+C                 0 = STANDARD X-Y AXIS.
+C                 1 = SEMI LOG Y AXIS (X IS LINEAR).
+C                 2 = SEMI LOG X AXIS (Y IS LINEAR).
+C                 3 = LOG LOG AXIS.
+C
+C   OTHER VARIABLES USED IN THE ROUTINE ARE DEFINED AS:
+C   AINC  -TEMPORARY VARIABLE USED TO COMPUTE LOG SCALE INCREMENTS.
+C   BINC  -TEMPORARY VARIABLE USED TO COMPUTE LOG SCALE INCREMENTS.
+C   CFLAG -FLAG INDICATING THAT THE LOG INCREMENTS HAVE BEEN COMPUTED.
+C   CXSIZE-THE SIZE OF THE CHARACTERS FOR THE LABELS IN EQUIVALENT USER
+C          UNITS ON THE X AXIS.
+C   CYSIZE-THE SIZE OF THE CHARACTERS FOR THE LABELS IN EQUIVALENT USER
+C          UNITS ON THE Y AXIS.
+C   INC   -ARRAY OF 9 USED TO STORE THE LOG SCALE INCREMENTS.
+C   INDEX -INDEX VARIABLE USED TO COMPARE TO LINTX (OR LINTY) TO
+C          SEE THAT THE CORRECT LABELING INTERVAL IS USED.
+C   LOGX  -FLAG INDICATING THAT THE X AXIS IS A LOG SCALE (LOGX=1).
+C   LOGY  -FLAG INDICATING THAT THE Y AXIS IS A LOG SCALE (LOGY=1).
+C   SXFLAG-FLAG WHICH INDICATES THAT THE X LOG AXIS HAS BEEN STARTED.
+C          AFTER THE FIRST PART OF THE LOG AXIS IS DRAWN, ONLY WHOLE
+C          CYCLES ARE DRAWN, EXCEPT MAYBE A PARTIAL CYCLE AT THE END.
+C   SYFLAG-FLAG WHICH INDICATES THAT THE Y LOG AXIS HAS BEEN STARTED.
+C          AFTER THE FIRST PART OF THE LOG AXIS IS DRAWN, ONLY WHOLE
+C          CYCLES ARE DRAWN, EXCEPT MAYBE A PARTIAL CYCLE AT THE END.
+C   TEMP  -TEMPORARY VARIABLE USED SEVERAL TIMES.
+C   XHI   -USED TO DRAW X LOG AXIS.  EQUALS ALOG10 OF XHIGH.
+C   XINC  -THE DISTANCE IN USER UNITS BETWEEN MINOR TICK MARKS ON
+C          THE X AXIS (XTIC/(SMXTIC+1)).
+C   XLAB  -CONTAINS THE BCD REPRESENTATION OF THE X LABEL BEING PASSED
+C          TO SYMBOL.
+C   XOFF  -THE X OFFSET OF LABELS ON THE Y AXIS.
+C   XPOS  -THE CURRENT X POSITION, USUALLY EQUALS XPT MINUS A FRACTION
+C          OF AN INCH (USED FOR LABELING).
+C   XPT   -THE CURRENT X VALUE, USED FOR MANY THINGS.
+C   XPTS  -TEMPORARY VARIABLE USED IN LABELING, EQUALS XPT/XUNIT.
+C   YHI   -USED TO DRAW Y LOG AXIS.  EQUALS ALOG10 OF YHIGH.
+C   YINC  -THE DISTANCE IN USER UNITS BETWEEN MINOR TICK MARKS ON
+C          THE Y AXIS (YTIC/(SMYTIC+1)).
+C   YLAB  -CONTAINS THE BCD REPRESENTATION OF THE Y LABEL BEING PASSED
+C          TO SYMBOL.
+C   YOFF  -THE Y OFFSET OF LABELS ON THE X AXIS.
+C   YPOS  -THE CURRENT Y POSITION, USUALLY EQUALS YPT MINUS A FRACTION
+C          OF AN INCH (USED FOR LABELING).
+C   YPT   -THE CURRENT Y VALUE, USED FOR MANY THINGS.
+C   YPTS  -TEMPORARY VARIABLE USED IN LABELING, EQUALS YPT/YUNIT.
+C
+      REAL INC(9)
+      INTEGER SXFLAG,SYFLAG,CFLAG,SMXTIC,SMYTIC,SMXTC1,SMYTC1
+C
+	CHARACTER IFMT*6,XLAB*8,YLAB*8
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C******************************************************************
+C   AXISL MAKES SEVERAL CHECKS ON THE PARAMETERS TO MAKE SURE THAT
+C   THEY ARE VALID.   THEY ARE ALTERED INTERNALLY IF NECESSARY.
+C******************************************************************
+C
+C   TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      XLOW=XLOW1
+      XHIGH=XHIGH1
+      XORG=XORG1
+      YLOW=YLOW1
+      YHIGH=YHIGH1
+      YORG=YORG1
+      XTIC=ABS(XTIC1)
+      YTIC=ABS(YTIC1)
+      SMXTIC=SMXTC1
+      SMYTIC=SMYTC1
+      XUNIT=XUNIT1
+      YUNIT=YUNIT1
+C
+C   GET THE ADJUSTED CHARACTER SIZES.
+C
+      CXSIZE=CSIZE*FACTOR/XSCALE
+      CYSIZE=CSIZE*FACTOR/YSCALE
+C
+C   CHECK THE CALLING PARAMETERS.  MAKE SURE THEY ARE LEGAL.
+C
+      IF(SMXTIC .LT. 0) SMXTIC=0
+      IF(SMYTIC .LT. 0) SMYTIC=0
+      IF(XUNIT .EQ. 0.) XUNIT=1.
+      IF(YUNIT .EQ. 0.) YUNIT=1.
+C
+C   IF THE LOW IS BIGGER THAN THE HIGH, THEN CHANGE THEM.
+C
+      IF(XLOW .LE. XHIGH) GO TO 10
+      TEMP=XLOW
+      XLOW=XHIGH
+      XHIGH=TEMP
+10    IF(YLOW .LE. YHIGH) GO TO 20
+      TEMP=YLOW
+      YLOW=YHIGH
+      YHIGH=TEMP
+C
+C   MAKE SURE THE ORIGIN IS BETWEEN THE HIGH AND THE LOW.
+C
+20    IF(XORG .LT. XLOW) XORG=XLOW
+      IF(XORG .GT. XHIGH) XORG=XHIGH
+      IF(YORG .LT. YLOW) YORG=YLOW
+      IF(YORG .GT. YHIGH) YORG=YHIGH
+C
+C   SET SOME FLAGS
+C
+      SXFLAG=0
+      SYFLAG=0
+      CFLAG=0
+C
+C   SEE IF THE X OR Y AXES ARE LOG SCALES. IF SO, SET A FLAG.
+C
+      LOGX=0
+      LOGY=0
+      IF(ICODE.EQ.2 .OR. ICODE.EQ.3) LOGX=1
+      IF(ICODE.EQ.1 .OR. ICODE.EQ.3) LOGY=1
+C
+C   COMPUTE DISTANCE BETWEEN MINOR TICK MARKS
+C
+      XINC=XTIC
+      YINC=YTIC
+      IF(SMXTIC .NE. 0) XINC=XTIC/FLOAT(SMXTIC+1)
+      IF(SMYTIC .NE. 0) YINC=YTIC/FLOAT(SMYTIC+1)
+C
+C   SET VECTRS MODE.
+C
+      CALL VECTRS
+      YOFF=CYSIZE+70.0/YSCALE
+      IF(LOGX .EQ. 1) GO TO 200
+C
+C******************************************************************
+C   DRAW AND LABEL LINEAR X AXIS
+C******************************************************************
+C
+      IF(LINTX .EQ. 0) GO TO 30
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(XHIGH.GE.99999.995 .OR. XLOW.LE.-9999.995) IFMT='(E8.2)'
+      XPT=XTIC*FLOAT(LINTX)
+      IF(XPT .LE. 0.) XPT=XHIGH-XLOW
+      IF(XPT .LT. 0.00995) IFMT='(E8.2)'
+30    YPT=YORG
+      IF(LOGY.EQ.1) YPT=ALOG10(YPT)
+      YPOS=YORG-YOFF
+      IF(LOGY.EQ.1) YPOS=ALOG10(YORG)-YOFF
+      XPT=XLOW
+      CALL PLOT(XPT,YPT,0,0)
+      CALL PLOT(XPT,YPT,1,8)
+      IF(LINTX .EQ. 0) GO TO 60
+40    XPTS=XPT/XUNIT
+	WRITE(XLAB,IFMT)XPTS
+      XPOS=XPT-5.*CXSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,XLAB)
+      CALL PLOT(XPT,YPT,0,0)
+60    IF(XTIC .EQ. 0.) GO TO 90
+      INDEX=0
+      CALL PLOT(XPT,YPT,0,0)
+C
+C   DO THE SMALL TICK MARKS, IF ANY.
+C
+70    IF(SMXTIC .EQ. 0) GO TO 85
+      DO 80 I=1,SMXTIC
+      XPT=XPT+XINC
+      IF(XPT .GT. XHIGH) GO TO 90
+80    CALL PLOT(XPT,YPT,1,7)
+C
+C   NOW DO THE LARGE TICK MARK.
+C
+85    XPT=XPT+XINC
+      IF(XPT .GT. XHIGH) GO TO 90
+      CALL PLOT(XPT,YPT,1,8)
+C
+C   SEE IF IT IS TIME TO LABEL.
+C
+      IF(LINTX .LE. 0) GO TO 70
+      INDEX=INDEX+1
+      IF(INDEX .LT. LINTX) GO TO 70
+      GO TO 40
+C
+C   DRAW AND LABEL THE LAST TICK MARK.
+C
+90    XPT=XHIGH
+      CALL PLOT(XPT,YPT,1,8)
+      IF(LINTX .GE. 0) GO TO 300
+      XPTS=XPT/XUNIT
+      GO TO 270
+C
+C******************************************************************
+C   DRAW AND LABEL LOG X AXIS
+C******************************************************************
+C
+C
+C   COMPUTE THE INCREMENTS FOR A LOG AXIS.
+C
+200   AINC=1.
+      BINC=2.
+      DO 205 I=1,9
+      INC(I)=ALOG10(BINC)-ALOG10(AINC)
+      AINC=AINC+1.
+205   BINC=BINC+1.
+      CFLAG=1
+      YPT=YORG
+      IF(LOGY.EQ.1) YPT=ALOG10(YPT)
+      YPOS=YORG-YOFF
+      IF(LOGY.EQ.1) YPOS=ALOG10(YORG)-YOFF
+      XHI=ALOG10(XHIGH)
+      XPT=ALOG10(XLOW)
+      CALL PLOT(XPT,YPT,0,0)
+      CALL PLOT(XPT,YPT,1,8)
+      IF(LINTX .GE. 0) GO TO 220
+210   XPTS=(10.**XPT)/XUNIT
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(XPTS.GE.99999.995 .OR. XPTS.LT.0.00995) IFMT='(E8.2)'
+	WRITE(XLAB,IFMT)XPTS
+      XPOS=XPT-5.*CXSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,XLAB)
+      CALL PLOT(XPT,YPT,0,0)
+220   IF(XTIC .EQ. 0.) GO TO 260
+      INDEX=0
+      CALL PLOT(XPT,YPT,0,0)
+C
+C   WE START THE LOG AXIS AT XPT WHICH CURRENTLY EQUALS ALOG10(XLOW).
+C   DRAW AND PUT TICK MARKS ON UNTIL THE FIRST CYCLE IS REACHED (...,
+C   0.01,0.1,1.,10.,100.,...).  LABEL THIS FIRST CYCLE AND SET A
+C   FLAG INDICATING THE AXIS HAS BEEN STARTED (SXFLAG=1).  THE REST
+C   OF THE AXIS WILL BE DRAWN WITH WHOLE LOG CYCLES, EXCEPT OF COURSE
+C   THE END WHICH IS FROM THE LAST WHOLE CYCLE UNTIL ALOG10(XHIGH)
+C
+      IF(SXFLAG .EQ. 1) GO TO 240
+      TEMP=IFIX(XPT)
+      IF(TEMP .GT. XPT) TEMP=TEMP-1.
+      DO 230 I=1,8
+      TEMP=TEMP+INC(I)
+      IF(TEMP .LT. XPT) GO TO 230
+      IF(TEMP .GE. XHI) GO TO 260
+      CALL PLOT(TEMP,YPT,1,7)
+230   CONTINUE
+      XPT=TEMP
+      SXFLAG=1
+      GO TO 255
+C
+C   DO THE MINOR TICK MARKS.
+C
+240   DO 250 I=1,8
+      XPT=XPT+INC(I)
+      IF(XPT .GT. XHI) GO TO 260
+250   CALL PLOT(XPT,YPT,1,7)
+C
+C   NOW THE MAJOR TICK MARK.
+C
+255   XPT=XPT+INC(9)
+      IF(XPT .GT. XHI) GO TO 260
+      CALL PLOT(XPT,YPT,1,8)
+C
+C   SEE IF IT IS TIME TO LABEL.
+C
+      IF(LINTX .LE. 0) GO TO 240
+      INDEX=INDEX+1
+      IF(INDEX .LT. LINTX) GO TO 240
+      GO TO 210
+C
+C   DRAW AND LABEL THE LAST TICK MARK.
+C
+260   XPT=XHI
+      CALL PLOT(XPT,YPT,1,8)
+      IF(LINTX .GE. 0) GO TO 300
+      XPTS=(10.**XPT)/XUNIT
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(XPTS.GE.99999.995 .OR. XPTS.LT.0.00995) IFMT='(E8.2)'
+270	WRITE(XLAB,IFMT)XPTS
+      XPOS=XPT-5.*CXSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,XLAB)
+300   XOFF=8.0*CXSIZE+100.0/XSCALE
+      IF(LOGY .EQ. 1) GO TO 400
+C
+C******************************************************************
+C   DRAW AND LABEL LINEAR Y AXIS
+C******************************************************************
+C
+      IF(LINTY .EQ. 0) GO TO 305
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(YHIGH.GE.99999.995 .OR. YLOW.LE.-9999.995) IFMT='(E8.2)'
+      YPT=YTIC*FLOAT(LINTY)
+      IF(YPT .LE. 0.) YPT=YHIGH-YLOW
+      IF(YPT .LT. 0.00995) IFMT='(E8.2)'
+305   XPT=XORG
+      IF(LOGX.EQ.1) XPT=ALOG10(XPT)
+      XPOS=XORG-XOFF
+      IF(LOGX.EQ.1) XPOS=ALOG10(XORG)-XOFF
+      YPT=YLOW
+      CALL PLOT(XPT,YPT,0,0)
+      CALL PLOT(XPT,YPT,1,6)
+      IF(LINTY .EQ. 0) GO TO 320
+310   YPTS=YPT/YUNIT
+	WRITE(YLAB,IFMT)YPTS
+      YPOS=YPT-0.5*CYSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,YLAB)
+      CALL PLOT(XPT,YPT,0,0)
+320   IF(YTIC .EQ. 0.) GO TO 350
+      INDEX=0
+      CALL PLOT(XPT,YPT,0,0)
+C
+C   DO THE SMALL TICK MARKS, IF ANY.
+C
+330   IF(SMYTIC .EQ. 0) GO TO 345
+      DO 340 I=1,SMYTIC
+      YPT=YPT+YINC
+      IF(YPT .GT. YHIGH) GO TO 350
+340   CALL PLOT(XPT,YPT,1,5)
+C
+C   NOW DO THE LARGE TICK MARK.
+C
+345   YPT=YPT+YINC
+      IF(YPT .GT. YHIGH) GO TO 350
+      CALL PLOT(XPT,YPT,1,6)
+C
+C   SEE IF IT IS TIME TO LABEL.
+C
+      IF(LINTY .LE. 0) GO TO 330
+      INDEX=INDEX+1
+      IF(INDEX .LT. LINTY) GO TO 330
+      GO TO 310
+C
+C   DRAW AND LABEL THE LAST TICK MARK.
+C
+350   YPT=YHIGH
+      CALL PLOT(XPT,YPT,1,6)
+      IF(LINTY .GE. 0) GO TO 500
+      YPTS=YPT/YUNIT
+      GO TO 470
+C
+C******************************************************************
+C   DRAW AND LABEL LOG Y AXIS
+C******************************************************************
+C
+C
+C   COMPUTE THE INCREMENTS FOR A LOG AXIS, IF NECESSARY.
+C
+400   IF(CFLAG.EQ.1) GO TO 406
+      AINC=1.
+      BINC=2.
+      DO 405 I=1,9
+      INC(I)=ALOG10(BINC)-ALOG10(AINC)
+      AINC=AINC+1.
+405   BINC=BINC+1.
+406   XPT=XORG
+      IF(LOGX.EQ.1) XPT=ALOG10(XPT)
+      XPOS=XORG-XOFF
+      IF(LOGX.EQ.1) XPOS=ALOG10(XORG)-XOFF
+      YHI=ALOG10(YHIGH)
+      YPT=ALOG10(YLOW)
+      CALL PLOT(XPT,YPT,0,0)
+      CALL PLOT(XPT,YPT,1,6)
+      IF(LINTY .GE. 0) GO TO 420
+410   YPTS=(10.**YPT)/YUNIT
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(YPTS.GE.99999.995 .OR. YPTS.LT.0.00995) IFMT='(E8.2)'
+	WRITE(YLAB,IFMT)YPTS
+      YPOS=YPT-0.5*CYSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,YLAB)
+      CALL PLOT(XPT,YPT,0,0)
+420   IF(YTIC .EQ. 0.) GO TO 460
+      INDEX=0
+      CALL PLOT(XPT,YPT,0,0)
+C
+C   WE START THE LOG AXIS AT YPT WHICH CURRENTLY EQUALS ALOG10(YLOW).
+C   DRAW AND PUT TICK MARKS ON UNTIL THE FIRST CYCLE IS REACHED (...,
+C   0.01,0.1,1.,10.,100.,...).  LABEL THIS FIRST CYCLE AND SET A
+C   FLAG INDICATING THE AXIS HAS BEEN STARTED (SYFLAG=1).  THE REST
+C   OF THE AXIS WILL BE DRAWN WITH WHOLE LOG CYCLES, EXCEPT OF COURSE
+C   THE END WHICH IS FROM THE LAST WHOLE CYCLE UNTIL ALOG10(YHIGH)
+C
+      IF(SYFLAG .EQ. 1) GO TO 440
+      TEMP=IFIX(YPT)
+      IF(TEMP .GT. YPT) TEMP=TEMP-1.
+      DO 430 I=1,8
+      TEMP=TEMP+INC(I)
+      IF(TEMP .LT. YPT) GO TO 430
+      IF(TEMP .GE. YHI) GO TO 460
+      CALL PLOT(XPT,TEMP,1,5)
+430   CONTINUE
+      YPT=TEMP
+      SYFLAG=1
+      GO TO 455
+C
+C   DO THE MINOR TICK MARKS.
+C
+440   DO 450 I=1,8
+      YPT=YPT+INC(I)
+      IF(YPT .GT. YHI) GO TO 460
+450   CALL PLOT(XPT,YPT,1,5)
+C
+C   NOW THE MAJOR TICK MARK.
+C
+455   YPT=YPT+INC(9)
+      IF(YPT .GT. YHI) GO TO 460
+      CALL PLOT(XPT,YPT,1,6)
+C
+C   SEE IF IT IS TIME TO LABEL.
+C
+      IF(LINTY .LE. 0) GO TO 440
+      INDEX=INDEX+1
+      IF(INDEX .LT. LINTY) GO TO 440
+      GO TO 410
+C
+C   DRAW AND LABEL THE LAST TICK MARK.
+C
+460   YPT=YHI
+      CALL PLOT(XPT,YPT,1,6)
+      IF(LINTY .GE. 0) GO TO 500
+      YPTS=(10.**YPT)/YUNIT
+C
+C   IF THE LABEL FITS INTO AN F8.2 FORMAT, USE IT. OTHERWISE USE E8.2
+C
+      IFMT='(F8.2)'
+      IF(YPTS.GE.99999.995 .OR. YPTS.LT.0.00995) IFMT='(E8.2)'
+470	WRITE(YLAB,IFMT)YPTS
+      YPOS=YPT-0.5*CYSIZE
+      CALL SYMBOL(XPOS,YPOS,0.,CSIZE,8,YLAB)
+C
+C   MOVE TO THE ORIGIN.
+C
+500   XPT=XORG
+      IF(LOGX.EQ.1) XPT=ALOG10(XORG)
+      YPT=YORG
+      IF(LOGY.EQ.1) YPT=ALOG10(YORG)
+      CALL PLOT(XPT,YPT,0,0)
+      RETURN
+      END
diff --git a/ppl/complot/baud.F b/ppl/complot/baud.F
new file mode 100644
index 0000000..c8489a6
--- /dev/null
+++ b/ppl/complot/baud.F
@@ -0,0 +1,70 @@
+      SUBROUTINE BAUD(IRATE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)baud.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL BAUD(IRATE)
+C
+C     COMPLOT ASSUMES THAT A TEKTERMINAL IS OPERATING AT 2400
+C     BAUD.  THIS FACT IS USED TO COMPUTE THE NUMBER OF CHARAC-
+C     TERS THAT MUST BE TRANSMITTED TO THE DEVICE TO PRODUCE
+C     THE APPROPRIATE ERASE DELAY TIME OR DRAWING TIME.  THIS
+C     SUBROUTINE MAY BE CALLED TO RECALCULATE THE NUMBER OF
+C     CHARACTERS IF A BAUD RATE OTHER THAN 2400 IS BEING USED.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CHECK FOR A LEGAL BAUD RATE.
+C
+      IF(IRATE .LT. 110 .OR. IRATE .GT. 9600)RETURN
+      BAUDR = IRATE
+      RETURN
+C
+      END
diff --git a/ppl/complot/bell.F b/ppl/complot/bell.F
new file mode 100644
index 0000000..cac4230
--- /dev/null
+++ b/ppl/complot/bell.F
@@ -0,0 +1,68 @@
+      SUBROUTINE BELL
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)bell.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	include 'PLTCOM.DAT'	
+#else
+	include 'pplinc:PLTCOM.DAT'	
+#endif
+C
+C     CALL BELL
+C
+C     THIS SUBROUTINE RINGS THE BELL.
+C
+C
+C
+C     RING THE BELL.
+C
+      CALL CHOUT(BEL,1)
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+      CALL CHDMP
+      RETURN
+C
+      END
diff --git a/ppl/complot/check.F b/ppl/complot/check.F
new file mode 100644
index 0000000..4956b4c
--- /dev/null
+++ b/ppl/complot/check.F
@@ -0,0 +1,81 @@
+      SUBROUTINE CHECK(U,NAPTS,UMIN,UMAX)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)check.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL CHECK(U,NPTS,UMIN,UMAX)
+C
+C     THIS SUBROUTINE CHECKS AN ARRAY OF FLOATING-POINT NUMBERS
+C     AND RETURNS THE ALGEBRAIC MINIMUM AND MAXIMUM.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        U      - ARRAY CONTAINING THE FLOATING-POINT NUMBERS
+C                 TO BE CHECKED.
+C        NPTS   - NUMBER OF ENTRIES IN THE ARRAY.
+C        UMIN   - MINIMUM VALUE IN THE ARRAY.
+C        UMAX   - MAXIMUM VALUE IN THE ARRAY.
+C
+C
+      DIMENSION U(1)
+C
+      IF(NAPTS .EQ. 0)RETURN
+      NPTS = IABS(NAPTS)
+C
+C     INITIALIZE THE MINIMUM AND MAXIMUM TO THE FIRST ENTRY.
+C
+      UMIN = U(1)
+      UMAX = U(1)
+      IF(NPTS .EQ. 1)RETURN
+C
+C     CHECK THE REST OF THE ENTRIES FOR ALGEBRAICALLY SMALLER
+C     AND LARGER VALUES.
+C
+      DO 10 I=2,NPTS
+      IF(U(I) .LT. UMIN)UMIN = U(I)
+   10 IF(U(I) .GT. UMAX)UMAX = U(I)
+      RETURN
+C
+      END
diff --git a/ppl/complot/chin.F b/ppl/complot/chin.F
new file mode 100644
index 0000000..ac5ebc6
--- /dev/null
+++ b/ppl/complot/chin.F
@@ -0,0 +1,75 @@
+	SUBROUTINE CHIN(IN,NCH,ITERM)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)chin.F	1.1    3/10/88
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+#ifdef unix
+	integer IN(NCH)
+	character inc*2048
+C
+	IF(FILET(1:8).NE.'/dev/tty')RETURN
+	read(*,999)inc
+999	format(a)
+	do 10 i=1,nch
+	in(i)=ichar(inc(i:i))
+10	continue
+#else
+        BYTE IN(NCH),IOSB(4)
+        DIMENSION IPAR(6)
+        include '($IODEF)'
+C
+        IF(FILET(1:3).NE.'TI:'.and.FILET(1:3).NE.'TT:')RETURN
+        CALL SYS$ASSIGN('TT',CHAN,,)
+	CALL SYS$QIOW(,%VAL(CHAN),%VAL(IO$_TTYREADALL .OR. IO$M_NOECHO),,,,
+     *	IN,%VAL(NCH),,,,)
+        CALL SYS$DASSGN(%VAL(CHAN))
+#endif
+	RETURN
+	END
diff --git a/ppl/complot/chout.F b/ppl/complot/chout.F
new file mode 100644
index 0000000..d6b55e3
--- /dev/null
+++ b/ppl/complot/chout.F
@@ -0,0 +1,149 @@
+	SUBROUTINE CHOUT(CHR,ICNT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)chout.F	1.3    5/25/88
+C * v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+#ifdef unix
+	integer chr(icnt)
+	character*2048 buf
+#else
+	byte iosb(4),buf(80),chr(icnt)
+	include '($IODEF)'
+
+#endif
+C
+C	WRITES A SINGLE CHARACTER TO THE TERMINAL
+C	D. DENBO JUNE 1983  UPDATED MARCH 1984
+C
+	DATA IPT/1/
+	J=1
+#ifdef unix
+40	BUF(IPT:IPT)=CHAR(CHR(j))
+#else
+40	buf(ipt)=chr(j)
+#endif
+	IPT=IPT+1
+	J=J+1
+	IF(IPT.GT.80)THEN
+C
+#ifdef unix
+	IF(FILET(1:8).EQ.'/dev/tty')THEN
+	    do 50 i=1,80
+		istat=putch(buf(i:i))
+50	    continue
+#else
+        IF(FILET(1:3).EQ.'TT:')THEN
+            CALL SYS$ASSIGN('TT',CHAN,,)
+            CALL SYS$QIOW(,%VAL(CHAN),
+     *	    %VAL(IO$_WRITELBLK .OR. IO$M_NOFORMAT)
+     *      ,,,,BUF,%VAL(80),,,,)
+            CALL SYS$DASSGN(%VAL(CHAN))
+#endif
+	ELSE
+	    IF(.NOT.TEKOPN)THEN
+#ifdef unix
+		OPEN(LUTK,FILE=FILET,STATUS='NEW')
+#else
+                OPEN(LUTK,FILE=FILET,STATUS='NEW',
+     *		CARRIAGECONTROL='NONE')
+#endif
+		TEKOPN=.TRUE.
+	    ENDIF
+#if defined unix && ! defined F90_NO_FPUTC
+	    do 51 i=1,80
+		call fputc(LUTK,buf(i:i))
+51	    continue
+#else
+	    WRITE(LUTK,999)BUF
+999	    format(80a1)
+#endif
+	ENDIF
+	IPT=1
+	ENDIF
+	IF(J.LE.ICNT)GOTO 40
+	RETURN
+	ENTRY CHDMP
+#ifdef unix
+	IF(FILET(1:8).EQ.'/dev/tty')THEN
+	    do 60 i=1,ipt-1
+		istat=putch(buf(i:i))
+60	    continue
+	ELSE
+	    IF(.NOT.TEKOPN)THEN
+		OPEN(LUTK,FILE=FILET,STATUS='NEW')
+		TEKOPN=.TRUE.
+	    ENDIF
+	    do 61 i=1,ipt-1
+#ifndef F90_NO_FPUTC
+		call fputc(LUTK,buf(i:i))
+#else
+		WRITE(LUTK,'(a1)')(BUF(I:I))
+#endif
+61	    continue
+	ENDIF
+#else
+        IF(FILET(1:3).EQ.'TT:')THEN
+            CALL SYS$ASSIGN('TT',CHAN,,)
+            CALL SYS$QIOW(,%VAL(CHAN),
+     *		%VAL(IO$_WRITELBLK .OR. IO$M_NOFORMAT)
+     *      ,,,,BUF,%VAL(IPT-1),,,,)
+            CALL SYS$DASSGN(%VAL(CHAN))
+        ELSE
+            IF(.NOT.TEKOPN)THEN
+                OPEN(LUTK,FILE=FILET,STATUS='NEW',
+     *		CARRIAGECONTROL='NONE')
+                TEKOPN=.TRUE.
+            ENDIF
+            WRITE(LUTK,999)(BUF(I),I=1,IPT-1)
+        ENDIF
+#endif
+	IPT=1
+	RETURN
+	END
diff --git a/ppl/complot/circle.F b/ppl/complot/circle.F
new file mode 100644
index 0000000..4f4b932
--- /dev/null
+++ b/ppl/complot/circle.F
@@ -0,0 +1,121 @@
+      SUBROUTINE CIRCLE(XCENT,YCENT,DEG1,DEG2,XRAD,YRAD,PRECSN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)circle.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL CIRCLE(XCENT,YCENT,DEG1,DEG2,XRAD,YRAD,PRECSN)
+C
+C     THIS SUBROUTINE DRAWS AN ARC CENTERED AT A SPECIFIED LOCA-
+C     TION AND HAVING A SPECIFIED RADIUS IN THE X- AND Y-DIREC-
+C     TIONS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XCENT  - X-COORDINATE OF THE CENTER OF THE ARC IN USER'S
+C                 UNITS.
+C        YCENT  - Y-COORDINATE OF THE CENTER OF THE ARC IN USER'S
+C                 UNITS.
+C        DEG1   - INITIAL ANGLE OF THE ARC IN DEGREES RELATIVE TO
+C                 THE X-AXIS.
+C        DEG2   - FINAL ANGLE OF THE ARC IN DEGREES RELATIVE TO
+C                 THE X-AXIS.
+C        XRAD   - X-DIRECTION RADIUS OF THE ARC IN USER'S UNITS.
+C        YRAD   - Y-DIRECTION RADIUS OF THE ARC IN USER'S UNITS.
+C        PRECSN - LENGTH OF THE INDIVIDUAL LINE SEGMENTS IN THE
+C                 ARC IN INCHES (OR MM).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CONVERT THE INITIAL AND FINAL ANGLES TO RADIANS.
+C
+      ANGLE1 = 0.01745329251994 * DEG1
+      ANGLE2 = 0.01745329251994 * DEG2
+C
+C     MOVE TO THE INITIAL POINT ON THE ARC WITH THE PEN UP.
+C
+      X = XCENT + XRAD * COS(ANGLE1)
+      Y = YCENT + YRAD * SIN(ANGLE1)
+      CALL PLOT(X,Y,0,0)
+      RADIUS = AMAX1(ABS(XRAD * XSCALE),ABS(YRAD * YSCALE))
+C
+C     IF THE RADIUS IS ZERO, THE ARC CONSISTS OF A SINGLE POINT.
+C
+      IF(RADIUS .EQ. 0.0 .OR. ANGLE1 .EQ. ANGLE2)GO TO 30
+      CHANGE = ABS(PRECSN * FACTOR / RADIUS)
+      ANGLE = ANGLE1
+      IF(ANGLE1 .GT. ANGLE2)GO TO 20
+C
+C     DRAW THE COUNTER-CLOCKWISE ARC AS A SERIES OF SMALL LINE
+C     SEGMENTS.
+C
+   10 ANGLE = ANGLE + CHANGE
+      IF(ANGLE .GE. ANGLE2)GO TO 30
+      X = XCENT + XRAD * COS(ANGLE)
+      Y = YCENT + YRAD * SIN(ANGLE)
+      CALL PLOT(X,Y,1,0)
+      GO TO 10
+C
+C     DRAW THE CLOCKWISE ARC AS A SERIES OF SMALL LINE SEGMENTS.
+C
+   20 ANGLE = ANGLE - CHANGE
+      IF(ANGLE .LE. ANGLE2)GO TO 30
+      X = XCENT + XRAD * COS(ANGLE)
+      Y = YCENT + YRAD * SIN(ANGLE)
+      CALL PLOT(X,Y,1,0)
+      GO TO 20
+C
+C     MOVE TO THE FINAL POINT ON THE ARC.
+C
+   30 X = XCENT + XRAD * COS(ANGLE2)
+      Y = YCENT + YRAD * SIN(ANGLE2)
+      CALL PLOT(X,Y,1,0)
+      RETURN
+C
+      END
diff --git a/ppl/complot/clear_vp.F b/ppl/complot/clear_vp.F
new file mode 100644
index 0000000..db59b46
--- /dev/null
+++ b/ppl/complot/clear_vp.F
@@ -0,0 +1,93 @@
+	SUBROUTINE CLEAR_VP
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* clear full window or single viewport of it depending on plot state variables
+* (this routine to hide FERRET common from PPLUS)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  1/20/89
+* V200:  3/22/90 - check if WSID NE 0 before clearing wkstn (for CANC WIND/ALL)
+* V411:  9/5/95 - use CLEAR_WINDOW to clear the full screen
+*	(to avoid the XGKS memory leak from GCLRWK)
+*        9/9/97 - if batch is active, just clear workstation since XGKS
+*        doesn't delete metafile segments, and it avoids gdelseg warnings
+*        1.30.99 *js* Eliminated change of 9/9/97, since it caused memory
+*          leak and we don't seem to get warnings anymore.
+* V602:  1/2007 *acm* When writing metafiles in batch mode, we do want to
+*        skip the call to GDSG. The segments are in fact deleted by gclosews 
+*        (gclwk called in pltit when closing one plot and opening a new one)
+*        and that results in the error message when gdsg is called here.
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* PyFr *kms*  7/13 No need to delete segments when clearing the whole window
+*                  in PyFerret; FGD_GCLRWK deletes them all in PyFerret
+
+	include 'xplot_state.cmn'		! viewport info
+	include 'gkscm1_inc.decl'	! with wsid
+	include 'GKSCM1.INC'	! with wsid
+
+* internal variable declarations:
+	INTEGER	ivp, iseg
+
+	IF ( vp_num .EQ. mvp_dflt ) THEN
+
+*  clear entire screen
+	   IF ( wsid .NE. 0 ) THEN
+	      DO 110 ivp =  mvp_dflt, max_viewport
+*  and mark segment as deleted
+	         vp_seg0(ivp) = 0
+	         vp_segn(ivp) = 0
+ 110	      CONTINUE
+
+	      CALL FGD_GCLRWK(WSID,0)
+	   ENDIF
+
+	ELSE
+
+* clear viewport only - delete segments
+	   DO 200 iseg = vp_seg0(vp_num)+1 , vp_segn(vp_num)
+ 200	   CALL FGD_GDSG( iseg ) 
+* immediate update of screen to reflect deleted segments
+	   CALL FGD_GUWK( wsid, 1 )
+	ENDIF
+
+	vp_seg0( vp_num ) = curr_seg_name
+
+	RETURN
+	END
diff --git a/ppl/complot/color.F b/ppl/complot/color.F
new file mode 100644
index 0000000..97aa1f7
--- /dev/null
+++ b/ppl/complot/color.F
@@ -0,0 +1,210 @@
+      SUBROUTINE COLOR(ICODE)
+C**
+C**    @(#)color.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL COLOR(ICODE)
+C
+C     THIS SUBROUTINE SELECTS A PEN ON THE TEKTRONIX 4663 PLOTTER,
+C     THE HP PLOTTER, AND THE ZETA PLOTTER AND CONTROLS THE SIX-
+C     POSITION TURRET HEAD ON THE GERBER PLOTTER.  IT CAN BE USED
+C     TO CHANGE THE COLOR OF THE INK USED FOR PLOTTING.
+C
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Modified J Davison JISAO/PMEL/TMAP 3.23.89
+*	To accomodate GKS changes to bundled line attributes
+ 
+*  8/2001  acm  for PLOT/SYMBOL=DOT
+*  Call GSPMI for polymarker with call to GSPLI for polyline
+*      *acm* 10/01  remove VMS includes
+
+	integer	icode
+
+#ifdef unix
+        INTEGER TEKCLR(6),TK41XX(3)
+        INTEGER NUM(0:15),setlineindex
+#else
+	byte TEKCLR(6),TK41XX(3)
+        byte NUM(0:15)
+#endif
+	character*1 cnum(0:8)
+C
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+
+C
+	data cnum/'0','1','2','3','4','5','6','7','8'/
+        DATA NUM/48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63/
+c	DATA TEKCLR/'`','h','e','m','f','n'/,TK41XX/27,77,76/
+	DATA TEKCLR/96,104,101,109,102,110/,TK41XX/27,77,76/
+C	DATA TEKPEN/27,67,66,80/
+C
+C     CHECK THE PLOT TYPE.
+C
+       GO TO(10,50,40,10,10,20,20),PTYPE + 3
+C	GOTO (50,50,40,30,40),PTYPE + 3
+C
+10	IF(TTYPE.LT.0)GOTO 100
+	COLOUR=ICODE
+	IF(TTYPE.LT.4100)THEN
+	IF(COLOUR.LT.1.OR.COLOUR.GT.6)COLOUR=1
+C
+C	SEND SEQUENCE FOR TEK 4014 TERMINAL
+C
+	CALL CHOUT(ESC,1)
+	CALL CHOUT(TEKCLR(COLOUR),1)
+	ELSE
+	IF(COLOUR.LT.0.OR.COLOUR.GT.15)COLOUR=15
+C
+C	SEND SEQUENCE FOR TEK 41XX TERMINALS
+C
+
+CC	Mod for linux *jd* 12.96  
+CC	"Inconsistent structure for arg 1 in call to CHOUT" compiler error
+CC	as CHOUT is called with arg 1 a scalar, and also an array.
+CC	Will commence using the compile option -mismatch, where 
+CC	match of subroutine arguments is not forced.
+
+
+	CALL CHOUT(TK41XX,3)
+	CALL CHOUT(NUM(COLOUR),1)
+	ENDIF	
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+C   10 IF(TTYPE .EQ. -4663)THEN
+C        COLOUR = ICODE
+C
+C     CHECK FOR A LEGAL PEN COLOR CODE.
+C
+C        IF(COLOUR .LT. 1 .OR. COLOUR .GT. 2)COLOUR = 1
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+C        IF(.NOT. GRAPHF)THEN
+C
+C     TRANSMIT THE 'PLOTTER ON' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+C	CALL (TEKON,3)
+C        ENDIF
+C
+C     SELECT THE APPROPRIATE PEN.
+C
+C	CALL CHOUT(TEKPEN,4)
+C        CALL CHOUT(COLOUR + 48,1)
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+C        IF(.NOT. GRAPHF)THEN
+C
+C     TRANSMIT THE 'PLOTTER OFF' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+C	CALL CHOUT(TEKOFF,5)
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+C          CALL CHDMP
+C        ENDIF
+C      ENDIF
+C     CHECK FOR OTHER PLOTTING DEVICES.
+C
+	GOTO 100
+C
+C	GKS COLOR AND SETUP
+C
+20	COLOUR=ICODE
+
+        IF ( .NOT. GKSOPN )
+     .      STOP 'COLOR called when GKSOPN is .FALSE.'
+
+	CALL PPLGFLUSH
+#ifdef core
+        istat=setlineindex(icode)
+#else
+*	CALL GSPLCI(ICODE) ! original
+*	CALL GSPMCI(ICODE) ! acm 8/7/01 for reference,not called
+#endif
+
+1000	call FGD_GSPLI(max(icode,1)) ! JD 3.23.89 & 3.13.90
+	call FGD_GSPMI(max(icode,1)) ! acm 8/7/01  polymarker index
+
+100	GOTO(50,30,30,30,40,30,40),PTYPE + 3
+   40  COLOUR = ICODE
+	IF(.NOT.PLTFLG)THEN
+C	INITIALIZE THE BINARY BUFFER WITH WIDTH,HEIGHT
+C	OF THE PLOTTING AREA
+C
+	CALL BINBUF(ASIZE,BSIZE)
+	PLTFLG=.TRUE.
+	ENDIF
+C
+C	SELECT THE PEN
+C
+	CALL BINBUF(FLOAT(COLOUR),-1.)
+	PEN=.FALSE.
+	LPEN=.NOT.PEN
+      GOTO 30
+C
+50	COLOUR=ICODE
+C
+C	COLOR ON THE HP7475
+C
+	IF(COLOUR.LT.1.OR.COLOUR.GT.8)COLOUR=1
+	IF(.NOT.PLTFLG)THEN
+	CALL ZBUFFT('DF;',3)
+	PLTFLG=.TRUE.
+	ENDIF
+	CALL ZBUFFT('PU;SP',5)
+	CALL ZBUFFT(CNUM(COLOUR),1)
+	CALL ZBUFFT(';',1)
+	PEN=.FALSE.
+	LPEN=.NOT.PEN
+30	RETURN
+      END
diff --git a/ppl/complot/dashes.F b/ppl/complot/dashes.F
new file mode 100644
index 0000000..8d18963
--- /dev/null
+++ b/ppl/complot/dashes.F
@@ -0,0 +1,71 @@
+      SUBROUTINE DASHES
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dashes.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL DASHES
+C
+C     THIS SUBROUTINE CAUSES ALL SUBSEQUENT PLOTTING THAT IS
+C     DONE WITH THE PEN DOWN TO BE IN THE FORM OF DASHED LINES
+C     CONNECTING EACH OF THE SPECIFIED COORDINATES.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = DASH
+C
+C     REINITIALIZE THE SEGMENT COUNTER.
+C
+      IDSEG = 1
+      SEG = DSEG(1)
+      RETURN
+C
+      END
diff --git a/ppl/complot/dashsz.F b/ppl/complot/dashsz.F
new file mode 100644
index 0000000..f02a8f4
--- /dev/null
+++ b/ppl/complot/dashsz.F
@@ -0,0 +1,74 @@
+      SUBROUTINE DASHSZ(DN1,UP1,DN2,UP2)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dashsz.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL DASHSZ(DN1,UP1,DN2,UP2)
+C
+C     THIS SUBROUTINE SUPPLIES NEW VALUES FOR THE PARAMETERS
+C     WHICH SPECIFY THE LENGTHS OF THE INDIVIDUAL SEGMENTS OF
+C     A DASHED LINE.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SAVE THE NEW PARAMETERS IN AN ARRAY.
+C
+      DSEG(1) = FACTOR * DN1
+      DSEG(2) = FACTOR * UP1
+      DSEG(3) = FACTOR * DN2
+      DSEG(4) = FACTOR * UP2
+C
+C     REINITIALIZE THE SEGMENT COUNTER.
+C
+      IDSEG = 1
+      SEG = DSEG(1)
+      RETURN
+C
+      END
diff --git a/ppl/complot/englsh.F b/ppl/complot/englsh.F
new file mode 100644
index 0000000..68685c9
--- /dev/null
+++ b/ppl/complot/englsh.F
@@ -0,0 +1,66 @@
+      SUBROUTINE ENGLSH
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)englsh.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ENGLSH
+C
+C     THIS SUBROUTINE REVERSES THE EFFECT OF SUBROUTINE METRIC
+C     BY RESETTING AN INTERNAL CONVERSION FACTOR SO THAT ALL
+C     COMPLOT SUBROUTINES WHICH ARE SUBSEQUENTLY CALLED AND OR-
+C     DINARILY EXPECT TO RECEIVE PARAMETERS EXPRESSED IN INCHES
+C     WILL RESUME DOING SO.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+      FACTOR = 1000.0
+      RETURN
+C
+      END
diff --git a/ppl/complot/erase.F b/ppl/complot/erase.F
new file mode 100644
index 0000000..8b6b740
--- /dev/null
+++ b/ppl/complot/erase.F
@@ -0,0 +1,314 @@
+      SUBROUTINE ERASE
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)erase.F	1.2    3/18/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ERASE
+C
+C     THIS SUBROUTINE IS USED TO INDICATE THAT A DISPLAY HAS
+C     BEEN COMPLETED AND A NEW DISPLAY IS ABOUT TO BEGIN.  ON
+C     THE TEKTERMINAL, THE SCREEN IS ERASED AND THE ALPHA CUR-
+C     SOR IS MOVED TO THE UPPER LEFT-HAND CORNER OF THE SCREEN.
+C     ON THE PRINTRONIX PRINTER PLOTTER, THE RASTER BUFFER IS
+C     RE-INITIALIZED.  ON THE ZETA AND BENSON
+C     PLOTTERS, IF PLOTTING HAS BEEN DONE SINCE THE LAST CALL
+C     TO PLOTEND OR ERASE, THE PEN IS LIFTED AND MOVED TO THE
+C     LEFT MARGIN THREE INCHES ABOVE THE TOP OF THE LAST PLOT.
+C     IN ALL CASES, THE MODE IS SET TO ALPHAS.
+C
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+	include 'GKSCM1.INC'
+#else
+	include 'pplinc:PLTCOM.DAT'
+	include 'pplinc:GKSCM1.INC'
+#endif
+C
+	CHARACTER TERM(12)*10,TYPE*10
+#ifndef unix
+	integer*4 lib$get_symbol,len,stat
+	byte FIRSTB(15,12),SECNDB(15,12),FIRST(15),SECND(15)
+#else
+	INTEGER FIRSTB(15,12),SECNDB(15,12),FIRST(15),SECND(15)
+#endif
+	INTEGER ITERM(12),FIRSTL(12),SECNDL(12)
+	LOGICAL FRST
+	DATA TERM/'VT240','GVT+','ZENITH','TEK4010','TEK41XX','MAC',
+     *		  'TAB','TEK4105','TEK4014','HIREZ','HP2397','GP220'/
+	DATA ITERM/1,2,3,4,5,4,6,7,4,8,9,10/,FRST/.TRUE./,NTERM/12/
+C
+	DATA FIRSTB/27,91,63,51,56,104,9*0,
+     *		    28,27,12,12*0,
+     *		    27,91,50,74,11*0,
+     *		    27,12,13*0,
+     *		    27,37,33,48,27,76,86,48,27,83,69,49,3*0,
+     *		    29,27,12,12*0,
+     *		    27,37,33,48,27,76,86,48,27,12,5*0,
+     *		    27,91,50,74,27,49,9*0,
+     *		    27,42,100,102,27,42,100,99,27,91,51,56,104,27,12,
+     *		    15*0,
+     *		    15*0,
+     *              15*0/
+	DATA SECNDB/27,91,63,51,56,108,9*0,
+     *		    24,14*0,
+     *		    27,12,27,58,56,102,9*0,
+     *		    27,12,13*0,
+     *		    27,83,75,33,27,76,86,49,27,37,33,49,3*0,
+     *		    27,12,27,34,48,103,9*0,
+     *		    27,12,27,76,86,49,27,37,33,49,5*0,
+     *		    27,12,27,50,11*0,
+     *		    27,91,51,56,108,27,42,100,100,27,42,100,101,2*0,
+     *		    15*0,
+     *		    15*0,
+     *              15*0/
+	DATA FIRSTL/6,3,4,2,12,3,10,6,15,3*0/
+	DATA SECNDL/6,1,6,2,12,6,10,4,13,3*0/
+C
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = ALPHA
+C
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+C
+      IF(SAVEF)CALL XYZPLT
+C
+C     CHECK THE PLOT TYPE.
+C
+      GO TO(10,50,70,10,10,20,20),PTYPE + 3
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+   10 IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)GO TO 40
+C
+C     MOVE TO HOME POSITION AND ERASE THE SCREEN ON OTHER TEK-
+C     TRONICS GRAPHICS TERMINALS.
+C
+	IF(FRST)THEN
+#ifdef unix
+	call getenv('GRAPHTERM',TYPE)
+	LENS=lnblk(type,10)
+	IF(lens.le.0)then
+#else
+        STAT=LIB$GET_SYMBOL('GRAPHTERM',TYPE,LEN)
+        LENS=LEN
+        IF(.NOT.STAT)THEN
+#endif
+	ITYPE=1
+	ELSE
+	DO 14 I=1,NTERM
+	IF(TYPE(1:LENS).EQ.TERM(I))GOTO 11
+14	CONTINUE
+	I=1
+11	ITYPE=ITERM(I)
+	ENDIF
+	DO 12 I=1,15
+12	FIRST(I)=FIRSTB(I,ITYPE)
+	DO 13 I=1,15
+13	SECND(I)=SECNDB(I,ITYPE)
+	FRST=.FALSE.
+	ENDIF
+C
+	IF(HPSCLA.GT.700.)THEN
+	CALL CHOUT(FIRST,FIRSTL(ITYPE))
+	HPSCLA=100.
+	ELSE
+	CALL CHOUT(SECND,SECNDL(ITYPE))
+	HPSCLA=779.
+	ENDIF
+C
+C     TRANSMIT SYNC CHARACTERS WHILE THE PHOSPHORS IN THE SCREEN
+C     COOL DOWN.
+C
+        NDELAY = IFIX(0.7 * FLOAT(BAUDR / 10))
+        DO 30 J=1,NDELAY
+   30   CALL CHOUT(SYN,1)
+      CALL CHDMP
+      GO TO 60
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+   40 IF(.NOT. GRAPHF)THEN
+C
+C     TRANSMIT THE 'PLOTTER ON' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+        CALL CHOUT(TEKON,3)
+      ENDIF
+C
+C     MOVE TO HOME POSITION ON THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(HOME,5)
+C
+C     SELECT ALPHANUMERIC MODE ON THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(US,1)
+C
+C     TRANSMIT THE 'PLOTTER OFF' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(TEKOFF,5)
+      CALL CHDMP
+C
+C     RESET THE GRAPHICS FLAG.
+C
+60    GRAPHF = .FALSE.
+C
+C     CHECK FOR OTHER PLOTTING DEVICES.
+C
+	GOTO 25
+C
+C	GKS ERASE
+C
+20	CALL PPLGFLUSH
+	IF(HPSCLA.GT.700.)THEN
+	    HPSCLA=100.
+#ifdef core
+	    if(.not.gksopn)then
+		call crinit
+		gksopn=.true.
+	    endif
+	    call delallretainsegs()
+	    call newframe()
+	    call createretainseg(1)
+#else
+	    CALL FGD_GCLRWK(WSID,0)
+#endif
+	ELSE
+	    HPSCLA=779.
+	ENDIF
+25      GOTO(50,90,90,90,70,90,70),PTYPE + 3
+C
+C     CHECK THE PLOTTING FLAG.
+C
+   70 IF(PLTFLG)THEN
+C
+C     MOVE TO A NEW PLOTTING AREA AND RESET THE ZETA PLOTTER.
+C
+        PEN = .FALSE.
+        CALL ZABMV
+C
+C     WRITE OUT THE PLOTTING BUFFER.
+C
+        CALL BINFSH
+        PLTFLG = .FALSE.
+      ENDIF
+	GOTO 90
+50	IF(PLTFLG)THEN
+C
+C	RESET THE HP PLOTTER
+C
+	A=0.
+	B=0.
+	PEN=.FALSE.
+	CALL HPABMV
+	CALL ZBUFFT('SP0;',4)
+	OLDHTA=0
+	CALL HFLUSH
+	PLTFLG=.FALSE.
+	ENDIF
+C
+C     CHECK THE PLOTTING FLAG.
+C
+   90 LPEN = .FALSE.
+C
+C     INITIALIZE THE DATA VARIABLES FOR THE NEXT PLOT.
+C
+      A = 0.0
+      B = 0.0
+      AOLD = 0.0
+      BOLD = 0.0
+      COLD = 0.0
+C
+	IF(TTYPE.GT.0)THEN
+	IF(ASIZE / TWIDTH .GT. BSIZE / THIGHT)THEN
+	PLTOTA = TSCLA /ASIZE
+	PLTOTB =TSCLB /ASIZE * TWIDTH /THIGHT
+      ELSE
+        PLTOTA = TSCLA / BSIZE * THIGHT / TWIDTH
+        PLTOTB = TSCLB / BSIZE
+      ENDIF
+	ELSE
+	PLTOTA=TSCLA/(TWIDTH*FACTOR)
+	PLTOTB=TSCLB/(THIGHT*FACTOR)
+	ENDIF
+C
+C     RECOMPUTE THE HP PLOTTER CONVERSION FACTORS.
+C
+C
+C     RESTORE THE DEFAULT MINIMUM AND MAXIMUM ALLOWABLE VALUES OF
+C     A AND B.
+C
+      AMIN = 0.0
+      BMIN = 0.0
+      AMAX = ASIZE
+      BMAX = BSIZE
+C
+C     CALCULATE THE OFF-SCREEN FLAG.
+C
+      LOSFLG = 0
+      IF(AOLD - 0.001 .GT. AMAX)LOSFLG = 1
+      IF(AOLD + 0.001 .LT. AMIN)LOSFLG = 2
+      IF(BOLD - 0.001 .GT. BMAX)LOSFLG = LOSFLG + 4
+      IF(BOLD + 0.001 .LT. BMIN)LOSFLG = LOSFLG + 8
+C
+C     TRANSFORM THE ABSOLUTE ORIGIN TO THE USER'S COORDINATE SYS-
+C     TEM.
+C
+      CALL TFORMI(XOLD,YOLD,ZOLD)
+      IF(WINDOF)THEN
+C
+C     CALCULATE THE OFF-WINDOW FLAG.
+C
+        LOWFLG = 0
+        IF(XOLD .GT. XMAX)LOWFLG = 1
+        IF(XOLD .LT. XMIN)LOWFLG = 2
+        IF(YOLD .GT. YMAX)LOWFLG = LOWFLG + 4
+        IF(YOLD .LT. YMIN)LOWFLG = LOWFLG + 8
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/gksmv.F b/ppl/complot/gksmv.F
new file mode 100644
index 0000000..f23c464
--- /dev/null
+++ b/ppl/complot/gksmv.F
@@ -0,0 +1,122 @@
+	SUBROUTINE GKSMV
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*	Mod 1.9.90 J Davison to reduce the maximum #pts in any one call to 
+*	polyline to 100 as GKS 4.0 under VMS 5.2, i.e., DECWindows, blows up
+*	with too many points
+*
+C
+C	CALL GKSMV
+C
+C	This routine creates a binary file that can be used to
+c	construct device dependent plotting code
+c
+c v6.61 ACM 4/2010 Fix bug 1396 - dots between dashes on some displays.
+c                  Do not make a call to GPL on "move with the pen up".      
+
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'
+
+        IF ( .NOT. GKSOPN )
+     .      STOP 'GKSMV called when GKSOPN is .FALSE.'
+
+	IF(PEN)THEN
+	   CALL GKPLOT(A,B,1)
+	ELSE
+	   CALL GKPLOT(A,B,0)
+	ENDIF
+	RETURN
+	END
+
+*jd*	SUBROUTINE GKPLOT(XN,YN,IP,II) Number of args reduced to 3 for MAC 7.92
+	SUBROUTINE GKPLOT(XN,YN,IP)
+#ifdef core
+        if(ip.ne.0)then
+            call lineabs2(xn,yn)
+        else
+            call moveabs2(xn,yn)
+        endif
+#else
+*	*jd* 1.9.90  Max was 10,000
+	integer	max
+	parameter (max=100)
+*	*jd* 1.9.90
+
+	DIMENSION X(max),Y(max)
+
+	DATA IPT/0/
+
+	IF(IP.EQ.0)THEN
+	    CALL DOIT(IPT,X,Y)
+	    IPT=1
+	ELSE
+	    IPT=IPT+1
+	    IF(IPT.GT.max)THEN
+		CALL DOIT(max,X,Y)
+		IPT=2
+		X(1)=X(max)
+		Y(1)=Y(max)
+	    ENDIF
+	ENDIF
+	X(IPT)=XN
+	Y(IPT)=YN
+#endif
+	RETURN
+	ENTRY PPLGFLUSH
+#ifdef core
+        return
+        end
+#else
+	CALL DOIT(IPT,X,Y)
+	IPT=0
+	RETURN
+	END
+	SUBROUTINE DOIT(IPT,X,Y)
+	DIMENSION X(*),Y(*)
+	IF(IPT.LE.0)RETURN
+	IF(IPT.EQ.1)THEN
+	    X(2)=X(1)
+	    Y(2)=Y(1)
+	    IPT=2
+	ELSE
+	    CALL FGD_GPL(IPT,X,Y)
+	ENDIF
+	RETURN
+	END
+#endif
diff --git a/ppl/complot/gksmv_makedot.F b/ppl/complot/gksmv_makedot.F
new file mode 100644
index 0000000..e05d864
--- /dev/null
+++ b/ppl/complot/gksmv_makedot.F
@@ -0,0 +1,107 @@
+	SUBROUTINE GKSMV_makedot
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*	Mod 1.9.90 J Davison to reduce the maximum #pts in any one call to 
+*	polyline to 100 as GKS 4.0 under VMS 5.2, i.e., DECWindows, blows up
+*	with too many points
+
+*  8/2001  acm  for PLOT/SYMBOL=DOT
+*  Version of GKSMV to be called by make_dot.  Call GPM for polymarker
+*  rather than GPL (polyline) 
+*
+*  10/2001 Buffer calls to GPM.  Rename X and Y to xdot, ydot for clarity.
+C
+C	This routine creates a binary file that can be used to
+c	construct device dependent plotting code
+c
+c
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'
+
+        IF ( .NOT. GKSOPN )
+     .      STOP 'GKSMV_makedot called when GKSOPN is .FALSE.'
+
+	IF(PEN)THEN
+	  CALL GKPLOT_makedot(A,B,1)
+	ELSE
+	  CALL GKPLOT_makedot(A,B,0)
+	ENDIF
+
+	RETURN
+	END
+
+	SUBROUTINE GKPLOT_makedot(XN,YN,IP)
+#ifdef core
+        if(ip.ne.0)then
+            call lineabs2(xn,yn)
+        else
+            call moveabs2(xn,yn)
+        endif
+#else
+        INCLUDE         'makedot.cmn'    ! 10/01 *acm*
+
+	IF(IP.EQ.0)THEN
+	    CALL DOIT_makedot(ipt,xdot,ydot)
+	    IPT=1
+	ELSE
+	    IPT=IPT+1
+	    IF(ipt.GE.maxdot)THEN
+		CALL DOIT_makedot(ipt,xdot,ydot)
+		IPT=2
+		xdot(1)=xdot(maxdot)
+		ydot(1)=ydot(maxdot)
+	    ENDIF
+	ENDIF
+	xdot(IPT)=XN
+	ydot(IPT)=YN
+#endif
+	RETURN
+        END
+
+	SUBROUTINE DOIT_makedot(IPT,xdot,ydot)
+	DIMENSION xdot(*),ydot(*)
+	IF(IPT.LE.0)RETURN
+	IF(IPT.EQ.1)THEN
+	    xdot(2)=xdot(1)
+	    ydot(2)=ydot(1)
+	    IPT=2
+	ENDIF
+	CALL FGD_GPM(IPT,xdot,ydot)
+	RETURN
+	END
diff --git a/ppl/complot/grid.F b/ppl/complot/grid.F
new file mode 100644
index 0000000..e6b3f92
--- /dev/null
+++ b/ppl/complot/grid.F
@@ -0,0 +1,266 @@
+      SUBROUTINE GRID(XALOW,XAHIGH,XAORG,YALOW,YAHIGH,YAORG,XAGRID,
+     * YAGRID,NATICX,NATICY)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)grid.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL GRID(XLOW,XHIGH,XORG,YLOW,YHIGH,YORG,XGRID,YGRID,NSTICX,
+C    * NSTICY)
+C
+C     THIS SUBROUTINE DRAWS A SET OF X AND Y AXES IN THE PLOTTING
+C     AREA.  BOTH GRID LINES AND SMALL TICK MARKS MAY BE DRAWN ON
+C     THE AXES AT REGULAR INTERVALS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XLOW   - MINIMUM VALUE OF THE X-AXIS IN USER'S UNITS.
+C        XHIGH  - MAXIMUM VALUE OF THE X-AXIS IN USER'S UNITS.
+C        XORG   - VALUE OF X AT WHICH THE Y-AXIS CROSSES THE
+C                 X-AXIS IN USER'S UNITS.
+C        YLOW   - MINIMUM VALUE OF THE Y-AXIS IN USER'S UNITS.
+C        YHIGH  - MAXIMUM VALUE OF THE Y-AXIS IN USER'S UNITS.
+C        YORG   - VALUE OF Y AT WHICH THE X-AXIS CROSSES THE
+C                 Y-AXIS IN USER'S UNITS.
+C        XGRID  - DISTANCE BETWEEN GRID LINES ON THE X-AXIS IN
+C                 USER'S UNITS.
+C        YGRID  - DISTANCE BETWEEN GRID LINES ON THE Y-AXIS IN
+C                 USER'S UNITS.
+C        NSTICX - NUMBER OF SMALL TICK MARKS BETWEEN EACH OF THE
+C                 GRID LINES ON THE X-AXIS.
+C        NSTICY - NUMBER OF SMALL TICK MARKS BETWEEN EACH OF THE
+C                 GRID LINES ON THE Y-AXIS.
+C
+C     GRID MAKES SEVERAL CHECKS ON THE PARAMETERS TO MAKE SURE
+C     THAT THEY ARE VALID.  THEY ARE ALTERED INTERNALLY IF NECES-
+C     SARY.
+C
+C
+C     TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      XLOW = XALOW
+      XHIGH = XAHIGH
+      XORG = XAORG
+      YLOW = YALOW
+      YHIGH = YAHIGH
+      YORG = YAORG
+      XGRID = ABS(XAGRID)
+      YGRID = ABS(YAGRID)
+      NSTICX = NATICX
+      NSTICY = NATICY
+C
+C     CHECK THE PARAMETERS TO MAKE SURE THAT THEY ARE VALID.
+C
+      IF(XLOW .GT. XHIGH)THEN
+        TEMP = XLOW
+        XLOW = XHIGH
+        XHIGH = TEMP
+      ENDIF
+      IF(YLOW .GT. YHIGH)THEN
+        TEMP = YLOW
+        YLOW = YHIGH
+        YHIGH = YLOW
+      ENDIF
+      IF(XORG .LT. XLOW)XORG = XLOW
+      IF(YORG .LT. YLOW)YORG = YLOW
+      IF(XORG .GT. XHIGH)XORG = XHIGH
+      IF(YORG .GT. YHIGH)YORG = YHIGH
+      IF(NSTICX .LT. 0)NSTICX = 0
+      IF(NSTICY .LT. 0)NSTICY = 0
+C
+C     SET VECTRS MODE.
+C
+      CALL VECTRS
+C
+C     START AT THE ORIGIN.
+C
+      X = XORG
+      Y = YORG
+      CALL PLOT(X,Y,0,0)
+C
+C     IF THERE ARE NO GRID LINES ON THE Y-AXIS, DRAW THE ENTIRE
+C     AXIS.
+C
+      IF(YGRID .EQ. 0.0)THEN
+        CALL PLOT(X,YLOW,0,0)
+        CALL PLOT(X,YHIGH,1,0)
+        CALL PLOT(X,Y,0,0)
+      ELSE
+C
+        SMY = YGRID / FLOAT(NSTICY + 1)
+C
+        IF(YLOW .LT. YORG)THEN
+C
+C     DRAW THE NEGATIVE Y-AXIS.
+C
+          IF(NSTICY .EQ. 0)GO TO 30
+   10     DO 20 J=1,NSTICY
+          Y = Y - SMY
+          IF(Y .LT. YLOW)GO TO 30
+   20     CALL PLOT(X,Y,1,5)
+          Y = Y - SMY
+          IF(Y .GT. YLOW)GO TO 10
+   30     CALL PLOT(X,YLOW,1,0)
+          Y = YORG
+C
+C     DRAW THE GRID LINES ON THE NEGATIVE Y-AXIS.
+C
+   40     Y = Y - YGRID
+          IF(Y .LT. YLOW)GO TO 50
+          CALL PLOT(XLOW,Y,0,0)
+          CALL PLOT(XHIGH,Y,1,0)
+          Y = Y - YGRID
+          IF(Y .LT. YLOW)GO TO 50
+          CALL PLOT(XHIGH,Y,0,0)
+          CALL PLOT(XLOW,Y,1,0)
+          GO TO 40
+   50     Y = YORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+C
+        IF(YHIGH .GT. YORG)THEN
+C
+C     DRAW THE POSITIVE Y-AXIS.
+C
+          IF(NSTICY .EQ. 0)GO TO 80
+   60     DO 70 J=1,NSTICY
+          Y = Y + SMY
+          IF(Y .GT. YHIGH)GO TO 80
+   70     CALL PLOT(X,Y,1,5)
+          Y = Y + SMY
+          IF(Y .LT. YHIGH)GO TO 60
+   80     CALL PLOT(X,YHIGH,1,0)
+          Y = YORG
+C
+C     DRAW THE GRID LINES ON THE POSITIVE Y-AXIS.
+C
+   90     Y = Y + YGRID
+          IF(Y .GT. YHIGH)GO TO 100
+          CALL PLOT(XLOW,Y,0,0)
+          CALL PLOT(XHIGH,Y,1,0)
+          Y = Y + YGRID
+          IF(Y .GT. YHIGH)GO TO 100
+          CALL PLOT(XHIGH,Y,0,0)
+          CALL PLOT(XLOW,Y,1,0)
+          GO TO 90
+  100     Y = YORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+      ENDIF
+C
+C     IF THERE ARE NO GRID LINES ON THE X-AXIS, DRAW THE ENTIRE
+C     AXIS.
+C
+      IF(XGRID .EQ. 0.0)THEN
+        CALL PLOT(XLOW,Y,0,0)
+        CALL PLOT(XHIGH,Y,1,0)
+        CALL PLOT(X,Y,0,0)
+      ELSE
+C
+        SMX = XGRID / FLOAT(NSTICX + 1)
+C
+        IF(XLOW .LT. XORG)THEN
+C
+C     DRAW THE NEGATIVE X-AXIS.
+C
+          IF(NSTICX .EQ. 0)GO TO 130
+  110     DO 120 J=1,NSTICX
+          X = X - SMX
+          IF(X .LT. XLOW)GO TO 130
+  120     CALL PLOT(X,Y,1,7)
+          X = X - SMX
+          IF(X .GT. XLOW)GO TO 110
+  130     CALL PLOT(XLOW,Y,1,0)
+          X = XORG
+C
+C     DRAW THE GRID LINES ON THE NEGATIVE X-AXIS.
+C
+  140     X = X - XGRID
+          IF(X .LT. XLOW)GO TO 150
+          CALL PLOT(X,YLOW,0,0)
+          CALL PLOT(X,YHIGH,1,0)
+          X = X - XGRID
+          IF(X .LT. XLOW)GO TO 150
+          CALL PLOT(X,YHIGH,0,0)
+          CALL PLOT(X,YLOW,1,0)
+          GO TO 140
+  150     X = XORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+C
+        IF(XHIGH .GT. XORG)THEN
+C
+C     DRAW THE POSITIVE X-AXIS.
+C
+          IF(NSTICX .EQ. 0)GO TO 180
+  160     DO 170 J=1,NSTICX
+          X = X + SMX
+          IF(X .GT. XHIGH)GO TO 180
+  170     CALL PLOT(X,Y,1,7)
+          X = X + SMX
+          IF(X .LT. XHIGH)GO TO 160
+  180     CALL PLOT(XHIGH,Y,1,0)
+          X = XORG
+C
+C     DRAW THE GRID LINES ON THE POSITIVE X-AXIS.
+C
+  190     X = X + XGRID
+          IF(X .GT. XHIGH)GO TO 200
+          CALL PLOT(X,YLOW,0,0)
+          CALL PLOT(X,YHIGH,1,0)
+          X = X + XGRID
+          IF(X .GT. XHIGH)GO TO 200
+          CALL PLOT(X,YHIGH,0,0)
+          CALL PLOT(X,YLOW,1,0)
+          GO TO 190
+  200     X = XORG
+          CALL PLOT(X,Y,0,0)
+        ENDIF
+      ENDIF
+C
+C     THE AXES ARE COMPLETE.
+C
+      RETURN
+C
+      END
diff --git a/ppl/complot/hpabmv.F b/ppl/complot/hpabmv.F
new file mode 100644
index 0000000..da2973b
--- /dev/null
+++ b/ppl/complot/hpabmv.F
@@ -0,0 +1,108 @@
+	SUBROUTINE HPABMV
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)hpabmv.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	CALL HPABMV
+C
+C	THIS SUBROUTINE DRIVES THE HP7475 AND HP7470 PLOTTERS
+C	THE CORRDINATES OF THE NEW POSITION ARE RECEIVED IN A AND B
+C
+C	D. DENBO   MARCH 1984
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	IF(.NOT.PLTFLG)THEN
+	CALL ZBUFFT('DF;SP1;',7)
+	PLTFLG=.TRUE.
+	LPEN=.NOT.PEN
+	ENDIF
+	IF(PEN.AND..NOT.LPEN)THEN
+	CALL ZBUFFT('PD',2)
+	ELSE IF(.NOT.PEN.AND.LPEN)THEN
+	CALL ZBUFFT('PU',2)
+	ELSE 
+	CALL ZBUFFT(',',1)
+	ENDIF
+	DA=A-OLDHPA
+	DB=B-OLDHPB
+	IF(DA.EQ.0.AND.DB.EQ.0.)RETURN
+	CALL HPOUT(INT(A))
+	CALL ZBUFFT(',',1)
+	CALL HPOUT(INT(B))
+	OLDHPA=A
+	OLDHPB=B
+	RETURN
+	END
+#ifdef unix
+	SUBROUTINE HPOUT(IA)
+	character as*5
+	DO 10 I=5,1,-1
+	IA10=IA/10
+	AS(I:I)=char(IA-IA10*10+48)
+	IA=IA10
+	IF(IA.EQ.0)GOTO 11
+10	CONTINUE
+	I=1
+11	CALL ZBUFFT(AS(I:),6-I)
+	RETURN
+	END
+#else
+	SUBROUTINE HPOUT(IA)
+	BYTE AS(5)
+	DO 10 I=5,1,-1
+	IA10=IA/10
+	AS(I)=IA-IA10*10+48
+	IA=IA10
+	IF(IA.EQ.0)GOTO 11
+10	CONTINUE
+	I=1
+11	CALL ZBUFFT(AS(I),6-I)
+	RETURN
+	END
+#endif
diff --git a/ppl/complot/igrinpt.F b/ppl/complot/igrinpt.F
new file mode 100644
index 0000000..3b58264
--- /dev/null
+++ b/ppl/complot/igrinpt.F
@@ -0,0 +1,496 @@
+      FUNCTION IGRNPT(window_id, show_menu, X,Y)
+C** 
+C**    @(#)igrinpt.F	1.2    3/27/88
+
+*    modified 6/99 for Ferret V500 *sh* -- added new arguments and
+*       return COMMON XGRINPT with information about what was digitized
+*       New arguments:
+*               show_menu
+*    Note: this routine should really be split into two -- one to put up
+*       the choice menu, another to get the position input. Taking the lazy
+*       approach now ...
+*
+* v5.11 *kob* 5/00 - added ifdef to check for f90 - if so have to
+*                    initialize has_new_mouse w/in block data since it
+*                    exists in common
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     IGRNPT(X,Y)
+C
+C     THIS FUNCTION ALLOWS THE USER TO INPUT GRAPHICS INFORMATION
+C     FROM A TEKTRONIX GRAPHICS TERMINAL TO HIS PROGRAM.  ON ALL
+C     TEKTERMINALS OTHER THAN THE PLOTTERS, WHEN IGRNPT IS
+C     CALLED, A FULL-SCREEN CROSS-HAIR CURSOR APPEARS.  THE CROSS
+C     HAIR MAY BE POSITIONED ON THE SCREEN BY USE OF THE THUMB-
+C     WHEELS OR JOYSTICK AS APPROPRIATE.  THE USER CAN CAUSE THE
+C     COORDINATES OF THE CROSS HAIR TO BE SENT TO IGRNPT BY EN-
+C     TERING A CHARACTER FROM THE KEYBOARD.  THE ASCII CODE FOR
+C     THIS CHARACTER IS RETURNED AS THE VALUE OF THE FUNCTION, AND
+C     THE COORDINATES IN USER'S UNITS ARE RETURNED IN THE PARAM-
+C     ETERS.  ON THE TEKTRONIX PLOTTER, WHEN IGRNPT IS CALLED,
+C     THE PROMPT LIGHT (4662) OR POINT LIGHT (4663) IS TURNED ON.
+C     IF NECESSARY, THE PEN MAY BE POSITIONED BY USE OF THE JOY-
+C     STICK.  THE USER CAN CAUSE THE COORDINATES OF THE PEN TO BE
+C     SENT TO IGRNPT BY MOMENTARILY DEPRESSING THE CALL BUTTON
+C     (4662) OR A POINT FUNCTION (4663).  THE PEN POSITION (0 =
+C     UP, 1 = DOWN) IS RETURNED AS THE VALUE OF THE FUNCTION, AND
+C     THE COORDINATES IN USER'S UNITS ARE RETURNED IN THE PARAM-
+C     ETERS.
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mods J Davison 3.21.94 for xgks
+*	1) Change PET to 3
+*	2) Change echo area for xgks coords in GINCH and not call GINLC
+* 	*jd* linux port 12.96 change hp -> NEED_IAND for CPP choices
+
+C
+C V6.3 *acm* 9/09 Allow mouse clicks in windows other than window 1.
+C            Note we get wrong rewults if the plot is in a viewport.
+C
+        LOGICAL show_menu
+	INTEGER window_id
+#ifndef core
+C
+C	GKS DATA FOR CHOICE AND LOCATOR INPUT
+C
+	INTEGER*4 SIZES(5),PET
+	INTEGER*4 ERRIND,MODE,ESW,LDR,ISTAT,ICHOICE
+	INTEGER*4 XFORM,WSTYPE,DCUNIT,NULLI
+	INTEGER   CHCE(5)
+	CHARACTER*10 STRING(5)
+	CHARACTER*80 RECORD(10),CONID
+	REAL EAREA(4),LOCX,LOCY,WIND(4),VIEW(4),NULLR
+#else
+	include 'CORECM.INC'
+c
+	integer initializedevice,setechoposition
+	integer setecho,setechosurface
+	integer awtbuttongetloc2,terminatedevice
+	logical lablin
+#endif
+	CHARACTER*1 IMODE
+	DIMENSION IN(8)
+	INTEGER*2 T4662N(3),T4662F(3),T4663(6)
+C
+	include 'PLTCOM.DAT'
+        include 'xgrinpt.cmn'
+        integer iwkid
+C
+#ifndef core
+	DATA CHCE/70,76,82,67,32/
+#else
+	data lablin/.false./
+#endif
+C
+C
+C
+	DATA T4662N/27,67,75/,T4662F/27,67,76/,
+     *  T4663/27,67,65,71,49,59/
+
+
+CC	Linux port:
+	integer octal37
+
+#ifdef FORTRAN_90
+	data 	octal37/O'37'/
+#else
+	data 	octal37/'37'O/
+#endif
+
+#ifdef FORTRAN_90
+        external XGRINPT_BLKDAT
+#else
+        DATA has_new_mouse/ .FALSE. /   ! at program initialization
+#endif
+
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+C
+C     SET ALPHAS MODE.
+C
+      IMODE = PMODE
+      PMODE = ALPHA
+C
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+C
+      IF(SAVEF)CALL XYZPLT
+C
+C     RESTORE THE CURRENT PLOTTING MODE.
+C
+      PMODE = IMODE
+C
+C     CHECK THE PLOT TYPE.
+C
+	IF(PTYPE.GE.3)THEN
+#ifdef core
+c	    core device
+c
+c       locator stuff
+c
+        istat=initializedevice(LOCATOR,1)
+        istat=initializedevice(BUTTON,1)
+        istat=initializedevice(BUTTON,2)
+        istat=initializedevice(BUTTON,3)
+        istat=setechosurface(LOCATOR,1,vsurf)
+	if(lablin)then
+	    istat=setechoposition(LOCATOR,1,xsv,ysv)
+	    istat=setecho(LOCATOR,1,2)
+	else
+            istat=setecho(LOCATOR,1,1)
+	endif
+c
+        istat=awtbuttongetloc2(100000000,1,ibut,xout,yout)
+        istat=awtbuttongetloc2(250000,1,ibut2,xout2,yout2)
+        if(ibut2.ne.0.and.(.not.lablin))then
+c
+c       button pushed twice
+c
+            lablin=.true.
+	    xsv=xout
+	    ysv=yout
+        else
+            lablin=.false.
+        endif
+	if(bsize/asize .gt. 0.75)then
+	    aold=xout*bsize/0.75
+	    bold=bsize*yout/0.75
+	else
+	    aold=asize*xout
+	    bold=yout*asize
+	endif
+	if(lablin)then
+	    if(ibut.eq.1)then
+		igrnpt=70
+	    else
+		igrnpt=76
+	    endif
+	else
+	    if(ibut.eq.1)then
+		igrnpt=32
+	    else if(ibut.eq.2)then
+		igrnpt=67
+	    else
+		igrnpt=82
+	    endif
+	endif
+        istat=terminatedevice(BUTTON,1)
+        istat=terminatedevice(BUTTON,2)
+        istat=terminatedevice(BUTTON,3)
+        istat=terminatedevice(LOCATOR,1)
+#else
+C
+C	    GKS DEVICE
+C
+	    CALL PPLGFLUSH
+	    iwkid = window_id  
+	    CALL FGD_GQCHS(iwkid,1,10,ERRIND,MODE,ESW,ISTAT,ICHOICE,
+     *	    PET,EAREA,LDR,RECORD)
+	    STRING(5) = 'Left'
+	    STRING(4) = 'Center'
+	    STRING(3) = 'Right'
+	    STRING(2) = 'Line'
+	    STRING(1) = 'Arrow'
+	    SIZES(5) = 4
+	    SIZES(4) = 6
+	    SIZES(3) = 5
+	    SIZES(2) = 4
+	    SIZES(1) = 5
+
+            PET = 3
+	    EAREA(1)=10.0
+	    EAREA(2)=250.0
+	    EAREA(3)=10.0
+	    EAREA(4)=250.0
+
+	    LDR=5
+	    IRECSZ=10
+
+	    CALL FGD_GPREC(0,NULLI,0,NULLR,5,SIZES,STRING,IRECSZ,
+     *	    ISTAT,LDR,RECORD)
+	    CALL FGD_GINCH(iwkid,1,1,5,PET,EAREA(1),EAREA(2),EAREA(3),
+     *	    EAREA(4),LDR,RECORD)
+
+        IF (show_menu) THEN     ! **************
+	    CALL FGD_GRQCH(iwkid,1,ISTAT,ICHOICE)       ! put up menu and get answer
+        ELSE
+            ichoice = 5         ! always left justified
+        ENDIF                   ! **************
+	    IGRNPT=CHCE(ICHOICE)
+	    CALL FGD_GSVPIP(1,0,0)
+	    CALL FGD_GQLCS(iwkid,1,1,7,ERRIND,MODE,ESW,XFORM,
+     *	                   LOCX,LOCY,PET,EAREA,LDR,RECORD)
+	    PET = 3
+*           Note that FGD_GQDSP uses the window id 
+*           instead of window type as the first argument
+	    CALL FGD_GQDSP(iwkid,ERRIND,DCUNIT,DCX,DCY,IRSX,IRSY)
+	    EAREA(2)=DCX
+	    EAREA(4)=DCY
+
+	    CALL FGD_GSLCM(iwkid,1,0,1)
+	    CALL FGD_GRQLC(iwkid,1,ISTAT,XFORM,LOCX,LOCY)  ! get mouse click (X,Y)
+	    CALL FGD_GQNT(XFORM,ERRIND,WIND,VIEW)
+	    AOLD= LOCX
+	    BOLD= LOCY
+#endif
+	    GOTO 20
+	ENDIF
+      IF(.NOT.(IABS(PTYPE).EQ.2.OR.PTYPE.EQ.1))RETURN
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .EQ. 4006)RETURN
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+      IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)GO TO 10
+C
+C     SELECT CROSS-HAIR CURSOR ADDRESS INPUT MODE ON OTHER TEK-
+C     TRONIX GRAPHICS TERMINALS AND TURN ON THE CROSS HAIR.
+C
+        CALL CHOUT(ESC,1)
+        CALL CHOUT(26,1)
+C
+C     READ THE CHARACTER THAT IS ENTERED FROM THE KEYBOARD AND THE
+C     FOUR ADDITIONAL CHARACTERS GENERATED BY THE TEKTERMINAL.
+C
+	CALL CHDMP
+#ifdef unix
+	call chin(in,5,0)
+# ifdef NEED_IAND
+       IGRNPT = IAND(IN(1),127)
+# else
+       IGRNPT = AND(IN(1),127)
+# endif
+#else
+	call chin(inn,5,0)
+	do 100 ik=1,5
+100	in(ik)=inn(ik)
+	igrnpt = iand(in(1),'177'O)
+#endif
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .LT. 4100 .AND. TTYPE .NE. 4014)THEN
+#ifdef unix
+# ifdef NEED_IAND
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  10 BIT TEK401X
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2),octal37),5),IAND(IN(3),octal37)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4),octal37),5),IAND(IN(5),octal37)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  12 BIT TEK41XX
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2),octal37),7),ISHFT(IAND(IN(3),
+     *   octal37),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4),octal37),7),ISHFT(IAND(IN(5),
+     *   octal37),2))) / PLTOTB + BMIN
+# else
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  10 BIT TEK401X
+C
+        AOLD = FLOAT(OR(LSHIFT(AND(IN(2),31),5),AND(IN(3),31)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(OR(LSHIFT(AND(IN(4),31),5),AND(IN(5),31)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  12 BIT TEK41XX
+C
+        AOLD = FLOAT(OR(LSHIFT(AND(IN(2),31),7),LSHIFT(AND(IN(3),
+     *   31),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(OR(LSHIFT(AND(IN(4),31),7),LSHIFT(AND(IN(5),
+     *   31),2))) / PLTOTB + BMIN
+# endif
+#else
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  10 AIT TEK401X
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2),octal37),5),IAND(IN(3),octal37)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4),octal37),5),IAND(IN(5),octal37)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.  12 BIT TEK41XX
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2),octal37),7),ISHFT(IAND(IN(3),
+     *   octal37),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4),octal37),7),ISHFT(IAND(IN(5),
+     *   octal37),2))) / PLTOTB + BMIN
+#endif
+      ENDIF
+      GO TO 20
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+   10 IF(.NOT. GRAPHF)THEN
+C
+C     TRANSMIT THE 'PLOTTER ON' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+        CALL CHOUT(TEKON,3)
+      ENDIF
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .EQ. -4662)THEN
+C
+C     TURN ON THE PROMPT LIGHT ON THE TEKTRONIX 4662 PLOTTER AND
+C     READ THE SEVEN CHARACTERS GENERATED BY THE PLOTTER.  THEN
+C     TURN OFF THE PROMPT LIGHT.
+C
+        CALL CHOUT(T4662N,3)
+	CALL CHDMP
+#ifdef unix
+	call chin(in,7,0)
+#else
+	call chin(inn,7,0)
+#endif
+        CALL CHOUT(T4662F,3)
+      ELSE
+C
+C     SELECT OPERATOR DIGITIZE MODE ON THE TEKTRONIX 4663 PLOTTER
+C     AND READ THE SEVEN CHARACTERS GENERATED BY THE PLOTTER.
+C
+        CALL CHOUT(T4663,6)
+	CALL CHDMP
+#ifdef unix
+	call chin(in,7,0)
+#else
+	call chin(inn,7,0)
+#endif
+      ENDIF
+#ifdef unix
+#ifdef sun
+	igrnpt = rshift(and(in(7),4),2)
+#else
+# ifdef NEED_IAND
+      IGRNPT = ISHFT(IAND(IN(7),4),-2)
+# else
+      IGRNPT = LSHIFT(AND(IN(7),4),-2)
+# endif
+#endif
+#else
+	do 200 ik=1,7
+200	in(ik)=inn(ik)
+	igrnpt=ishft(iand(in(7),4),-2)	
+#endif
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+#ifdef unix
+#ifdef sun
+      AOLD=FLOAT(OR(OR(LSHIFT(AND(IN(1),31),7),LSHIFT(AND(IN(3),
+     * 31),2)),rSHIFT(AND(IN(5),31),3))) / PLTOTA + AMIN
+      BOLD=FLOAT(OR(OR(LSHIFT(AND(IN(2),31),7),LSHIFT(AND(IN(4),
+     * 31),2)),rSHIFT(AND(IN(6),31),3))) / PLTOTB + BMIN
+#else
+# ifdef NEED_IAND 
+      AOLD=FLOAT(IOR(IOR(ISHFT(IAND(IN(1),octal37),7),ISHFT(IAND(IN(3),
+     * octal37),2)),ISHFT(IAND(IN(5),octal37),-3))) / PLTOTA + AMIN
+      BOLD=FLOAT(IOR(IOR(ISHFT(IAND(IN(2),octal37),7),ISHFT(IAND(IN(4),
+     * octal37),2)),ISHFT(IAND(IN(6),octal37),-3))) / PLTOTB + BMIN
+# else
+      AOLD=FLOAT(OR(OR(LSHIFT(AND(IN(1),31),7),LSHIFT(AND(IN(3),
+     * 31),2)),LSHIFT(AND(IN(5),31),-3))) / PLTOTA + AMIN
+      BOLD=FLOAT(OR(OR(LSHIFT(AND(IN(2),31),7),LSHIFT(AND(IN(4),
+     * 31),2)),LSHIFT(AND(IN(6),31),-3))) / PLTOTB + BMIN
+# endif
+#endif
+#else
+      AOLD=FLOAT(IOR(IOR(ISHFT(IAND(IN(1),octal37),7),ISHFT(IAND(IN(3),
+     * octal37),2)),ISHFT(IAND(IN(5),octal37),-3))) / PLTOTA + AMIN
+      BOLD=FLOAT(IOR(IOR(ISHFT(IAND(IN(2),octal37),7),ISHFT(IAND(IN(4),
+     * octal37),2)),ISHFT(IAND(IN(6),octal37),-3))) / PLTOTB + BMIN
+C
+#endif
+C
+C     TRANSMIT THE 'PLOTTER OFF' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(TEKOFF,5)
+C
+C     TRANSFORM THE POINT TO THE USER'S COORDINATE SYSTEM.
+C
+   20 CALL TFORMI(XNEW,YNEW,ZNEW)
+      PENF = .FALSE.
+      SAVEF = .TRUE.
+      X = XNEW / XSCALE
+      Y = YNEW / YSCALE
+* ACM * How to detect if the plot is in a viewport and 
+*       therefore if the mouse click was outside the 
+*       viewport, the results of the mouse-click are
+*       garbage ??  This is not quite it...
+c      IF (AOLD.LT.1 .OR. BOLD.LT.1) THEN
+c         X = -1.0E+34
+c	 Y = -1.0E+34
+c      ENDIF
+
+* 6/99 send the results back to Ferret through COMMON
+        has_new_mouse = .TRUE.
+        xmouse = x
+        ymouse = y
+	wmouse = iwkid
+
+C
+C     RESET THE GRAPHICS FLAG.
+C
+      GRAPHF = .FALSE.
+C
+C     CHECK THE PLOTTING MODE.
+C
+      IF(PMODE .EQ. ALPHA)CALL ALPHAS
+      RETURN
+C
+      END
+
+
+
+
+
diff --git a/ppl/complot/line.F b/ppl/complot/line.F
new file mode 100644
index 0000000..e955d81
--- /dev/null
+++ b/ppl/complot/line.F
@@ -0,0 +1,79 @@
+      SUBROUTINE LINE(X,Y,IMARK,NAPTS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)line.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL LINE(X,Y,IMARK,NPTS)
+C
+C     THIS SUBROUTINE PLOTS A SERIES OF POINTS USING DATA SUP-
+C     PLIED IN ARRAYS.  THE CURRENT PLOTTING MODE IS USED TO
+C     DETERMINE THE MANNER IN WHICH THE POINTS ARE CONNECTED.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X,Y    - ARRAYS CONTAINING THE COORDINATES OF THE
+C                 POINTS TO BE PLOTTED IN USER'S UNITS.
+C        IMARK  - DATA MARK CODE (0-88).
+C        NPTS   - NUMBER OF POINTS TO BE PLOTTED.
+C
+C
+      DIMENSION X(1),Y(1)
+C
+      IF(NAPTS .EQ. 0)RETURN
+      NPTS = IABS(NAPTS)
+C
+C     MOVE TO THE FIRST POINT WITH THE PEN UP.
+C
+      CALL PLOT(X(1),Y(1),0,0)
+      CALL MARK(IMARK)
+      IF(NPTS .EQ. 1)RETURN
+C
+C     MOVE TO THE REST OF THE POINTS WITH THE PEN DOWN.
+C
+      DO 10 I=2,NPTS
+   10 CALL PLOT(X(I),Y(I),1,IMARK)
+      RETURN
+C
+      END
diff --git a/ppl/complot/line3.F b/ppl/complot/line3.F
new file mode 100644
index 0000000..00c1399
--- /dev/null
+++ b/ppl/complot/line3.F
@@ -0,0 +1,79 @@
+      SUBROUTINE LINE3(X,Y,Z,IMARK,NAPTS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)line3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL LINE3(X,Y,Z,IMARK,NPTS)
+C
+C     THIS SUBROUTINE PLOTS A SERIES OF POINTS USING DATA SUP-
+C     PLIED IN ARRAYS.  THE CURRENT PLOTTING MODE IS USED TO
+C     DETERMINE THE MANNER IN WHICH THE POINTS ARE CONNECTED.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X,Y,Z  - ARRAYS CONTAINING THE COORDINATES OF THE
+C                 POINTS TO BE PLOTTED IN USER'S UNITS.
+C        IMARK  - DATA MARK CODE (0-88).
+C        NPTS   - NUMBER OF POINTS TO BE PLOTTED.
+C
+C
+      DIMENSION X(1),Y(1),Z(1)
+C
+      IF(NAPTS .EQ. 0)RETURN
+      NPTS = IABS(NAPTS)
+C
+C     MOVE TO THE FIRST POINT WITH THE PEN UP.
+C
+      CALL PLOT3(X(1),Y(1),Z(1),0,0)
+      CALL MARK(IMARK)
+      IF(NPTS .EQ. 1)RETURN
+C
+C     MOVE TO THE REST OF THE POINTS WITH THE PEN DOWN.
+C
+      DO 10 I=2,NPTS
+   10 CALL PLOT3(X(I),Y(I),Z(I),1,IMARK)
+      RETURN
+C
+      END
diff --git a/ppl/complot/makedot.F b/ppl/complot/makedot.F
new file mode 100644
index 0000000..6d7c4dc
--- /dev/null
+++ b/ppl/complot/makedot.F
@@ -0,0 +1,119 @@
+      SUBROUTINE makedot
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C  Ansley Manke 8/2001
+C  Plot a single point making polymark calls rather than polyline
+C  based on XYZPLT
+C  10/2001 simplifications that go with buffering the GPM calls
+C  
+C     THIS SUBROUTINE PERFORMS WINDOW CLIPPING IAND THEN MOVES THE
+C     PEN FROM THE CURRENT POSITION TO A NEW POINT.
+
+******************************************************************
+C FERRET mod - for explicit declarations - 9-19-88
+C      DIMENSION XMXMN(2),YMXMN(2)
+      REAL XMXMN(2),YMXMN(2)
+      EQUIVALENCE (XMXMN(1),XMAX),(YMXMN(1),YMAX)
+      REAL xinter, yinter, zinter, dx, dy, dz, cosx, cosy, cosz, dist
+
+#ifdef unix
+      include 'pltcom_dat.decl'
+      include 'PLTCOM.DAT'
+#else
+      INCLUDE 'tmap_pplv11inc:tmap_PLTCOM.DAT'
+#endif
+C end of FERRET mod
+******************************************************************
+C     Check the plotting mode.
+
+      IF(PMODE .EQ. ALPHA)GO TO 30
+
+
+      XNEW = XTEMP
+      YNEW = YTEMP
+      ZNEW = ZTEMP
+
+  30  IF(.NOT. WINDOF)GO TO 40
+
+C     Calculate the new off-window flag.
+
+      OWFLG = 0
+      IF(XNEW .GT. XMAX)OWFLG = 1
+      IF(XNEW .LT. XMIN)OWFLG = 2
+      IF(YNEW .GT. YMAX)OWFLG = OWFLG + 4
+      IF(YNEW .LT. YMIN)OWFLG = OWFLG + 8
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, DO NOT PLOT IT.
+
+      IF(OWFLG .NE. 0)GO TO 50
+
+C     Transform the point to the screen coordinate system.
+
+  40  CALL TFORM(XNEW,YNEW,ZNEW)
+
+C     Plot the point.
+
+      CALL ABPLT_makedot
+
+C     Move the coordinates of the new point to the old point.
+
+  50  XOLD = XNEW
+      YOLD = YNEW
+      ZOLD = ZNEW
+      LOWFLG = OWFLG
+      SAVEF = .FALSE.
+
+C     CALCULATE THE OLD OFF-SCREEN FLAG.
+
+      LOSFLG = 0
+******************************************************************
+C FERRET mod - bypass GKS clipping - 9-19-88
+      IF ( ptype .LT. 3 ) THEN
+          IF(AOLD - 0.001 .GT. AMAX)LOSFLG = 1
+          IF(AOLD + 0.001 .LT. AMIN)LOSFLG = 2
+          IF(BOLD - 0.001 .GT. BMAX)LOSFLG = LOSFLG + 4
+          IF(BOLD + 0.001 .LT. BMIN)LOSFLG = LOSFLG + 8
+       ENDIF
+C end of FERRET mod
+******************************************************************
+
+
+  60  RETURN
+      END
+
+
diff --git a/ppl/complot/mark.F b/ppl/complot/mark.F
new file mode 100644
index 0000000..c7e8a57
--- /dev/null
+++ b/ppl/complot/mark.F
@@ -0,0 +1,176 @@
+      SUBROUTINE MARK(IMARK)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*  8/2001  acm  for PLOT/SYMBOL=DOT, call makedot
+*      *acm* 10/01  remove VMS includes
+
+*
+C**    @(#)mark.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+      CHARACTER IMODE*1
+      LOGICAL LARGE
+C
+C     THE NEXT LINE IS MACHINE DEPENDENT AND MAY BE REPLACED BY
+C     INTEGER MRKTAB(2,44),TABT(200)
+      INTEGER*2 MRKTAB(2,44),TABT(200)
+C
+	include 'PLTCOM.DAT'
+
+      DATA MRKTAB/    5,   9,  11,  15,  14,  15,  11,  12,
+     *               26,  31,  32,  37,  38,  43,  44,  49,
+     *                1,   5,  64,  67,   5,  15,  50,  54,
+     *                1,   9,  55,  63,  15,  19,  21,  25,
+     *               50,  53,  51,  54,  72,  77,  84,  98,
+     *               18,  22,  11,  19,  64,  66,  68,  71,
+     *               68,  70,  78,  83, 102, 106, 113, 118,
+     *              119, 124, 125, 130, 131, 136, 105, 110,
+     *              107, 112, 137, 139,  99, 106, 103, 108,
+     *              140, 144, 140, 147, 156, 163, 148, 155,
+     *              170, 183, 184, 189, 188, 193, 164, 169/
+C
+	DATA TABT/9,41,45,13,9,45,0,13,41,0,
+     *25,29,0,11,43,29,11,25,43,11,25,29,11,43,29,18,27,34,0,27,
+     *24,20,27,36,0,27,30,20,27,18,0,3,27,36,27,34,0,27,51,41,
+     *13,45,9,41,4,2,16,32,50,52,38,22,4,9,29,41,9,13,25,45,
+     *13,13,27,31,0,27,45,9,27,29,0,27,41,13,20,18,9,0,18,34,
+     *0,20,36,0,45,36,34,41,19,35,0,21,17,33,37,21,19,35,33,17,
+     *21,37,20,29,25,0,17,33,21,37,35,19,17,33,21,37,19,35,33,17,
+     *21,19,43,0,37,33,21,37,25,12,44,0,42,10,0,17,37,26,30,0,
+     *12,44,0,8,40,13,45,0,43,11,0,9,41,4,41,30,9,52,4,12,
+     *20,21,13,12,0,9,45,0,33,41,42,34,33,14,44,10,0,9,41,0,
+     *42,12,46,0,0,0,0,0,0,0/
+C
+C     CHECK THE DATA MARK CODE.  For PLOT/DOT, call makedot to call POLYMARK
+C
+      IF (IMARK .EQ. 99) CALL makedot
+
+      IF(IMARK .LT. 1 .OR. IMARK .GT. 88)RETURN
+C
+C     DETERMINE THE SIZE OF THE DATA MARK AND ITS CODE.
+C
+      JMARK = (IMARK + 1) / 2
+      LARGE = .FALSE.
+      IF(2 * JMARK .EQ. IMARK)LARGE = .TRUE.
+C
+C     GET CONTROL INFORMATION FROM THE POINTER TABLE.
+C
+      IPOINT = MRKTAB(1,JMARK)
+      ILAST = MRKTAB(2,JMARK)
+C
+C     SAVE THE CURRENT PLOTTING POSITION AS THE REFERENCE POINT.
+C
+      XREF = XTEMP
+      YREF = YTEMP
+C
+C     SET VECTORS MODE.
+C
+      IMODE = PMODE
+      PMODE = VECTOR
+C
+C     LIFT THE PEN BEFORE DRAWING THE FIRST LINE SEGMENT.
+C
+      PENF = .FALSE.
+C
+C     DRAW THE DATA MARK.
+C
+      DO 10 IPT=IPOINT,ILAST
+      IB = TABT(IPT)
+C
+C     CHECK FOR NO DISPLACEMENT.  THIS INDICATES THAT THE PEN IS
+C     TO BE LIFTED BEFORE DRAWING THE NEXT LINE SEGMENT.
+C
+      IF(IB .EQ. 0)THEN
+        PENF = .FALSE.
+      ELSE
+C
+C     CALCULATE THE DISPLACEMENT FROM THE REFERENCE POINT.
+C     FOR SPEED WE HAVE CODED THE NEXT TWO LINES USING THE NON STANDARD
+C     AND AND RS FUNCTIONS.  HOWEVER THESE LINES COULD BE REPLACED BY
+C
+#ifdef unix
+# ifdef NEED_IAND
+	movex = ishft(ib,-3) -3
+	movey = iand(ib,7) -3
+# else
+	movex = rshift(ib,3) - 3
+        MOVEY = AND(IB,7) - 3
+# endif
+#else
+	movex = ishft(ib,-3) -3
+	movey = iand(ib,7) -3
+#endif
+C
+C     IF THE DATA MARK IS LARGE, DOUBLE THE DISPLACEMENT.
+C
+        IF(LARGE)THEN
+          MOVEX = 2 * MOVEX
+          MOVEY = 2 * MOVEY
+        ENDIF
+C
+C     CALCULATE THE NEW POINT.
+C
+        XTEMP = HMARK * FLOAT(MOVEX) + XREF
+        YTEMP = HMARK * FLOAT(MOVEY) + YREF
+C
+C     PLOT TO THE POINT.
+C
+        CALL XYZPLT
+        PENF = .TRUE.
+      ENDIF
+   10 CONTINUE
+C
+C     RESTORE THE CURRENT PLOTTING POSITION.
+C
+      XTEMP = XREF
+      YTEMP = YREF
+      PENF = .FALSE.
+      CALL XYZPLT
+C
+C     RESTORE THE CURRENT PLOTTING MODE.
+C
+      PMODE = IMODE
+      RETURN
+C
+      END
+
diff --git a/ppl/complot/marker.F b/ppl/complot/marker.F
new file mode 100644
index 0000000..5e4237d
--- /dev/null
+++ b/ppl/complot/marker.F
@@ -0,0 +1,53 @@
+      SUBROUTINE marker(ICODE)
+C**
+C**    @(#)color.F	1.1    3/10/88
+
+C
+C     CALL MARKER(ICODE)
+C
+C     THIS SUBROUTINE SELECTS A MARKER TYPE FROM THOSE SET UP IN 
+C     WS_LINE_BUNDLES.
+C
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Ansley Manke 4/2002
+
+      INTEGER icode
+
+      CALL FGD_GSPMI(max(icode,1)) ! polymarker index
+
+      END
diff --git a/ppl/complot/markh.F b/ppl/complot/markh.F
new file mode 100644
index 0000000..cca1cff
--- /dev/null
+++ b/ppl/complot/markh.F
@@ -0,0 +1,66 @@
+      SUBROUTINE MARKH(HEIGHT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)markh.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL MARKH(HEIGHT)
+C
+C     THIS SUBROUTINE SPECIFIES THE SIZE OF A STANDARD DATA MARK.
+C
+C     THE PARAMETER AND ITS DEFINITION ARE LISTED BELOW:
+C        HEIGHT - HEIGHT OF A STANDARD DATA MARK IN INCHES (OR
+C                 MM).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+      HMARK = HEIGHT * FACTOR / 8.0
+      RETURN
+C
+      END
diff --git a/ppl/complot/metric.F b/ppl/complot/metric.F
new file mode 100644
index 0000000..55edef2
--- /dev/null
+++ b/ppl/complot/metric.F
@@ -0,0 +1,66 @@
+      SUBROUTINE METRIC
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)metric.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL METRIC
+C
+C     THIS SUBROUTINE CHANGES AN INTERNAL CONVERSION FACTOR SO
+C     THAT ALL COMPLOT SUBROUTINES WHICH ARE SUBSEQUENTLY CALLED
+C     AND ORDINARILY EXPECT TO RECEIVE PARAMETERS EXPRESSED IN
+C     INCHES WILL INSTEAD EXPECT TO RECEIVE THE PARAMETERS EX-
+C     PRESSED IN MILLIMETERS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+      FACTOR = 39.37
+      RETURN
+C
+      END
diff --git a/ppl/complot/mirror.F b/ppl/complot/mirror.F
new file mode 100644
index 0000000..7805b5f
--- /dev/null
+++ b/ppl/complot/mirror.F
@@ -0,0 +1,75 @@
+      SUBROUTINE MIRROR(IMIRA,IMIRB)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)mirror.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL MIRROR(IMIRA,IMIRB)
+C
+C     THIS SUBROUTINE SELECTS THE TYPE OF MIRROR IMAGE, IF ANY,
+C     WHICH WILL BE DRAWN.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        IMIRA  - HORIZONTAL MIRROR-IMAGE CODE (0 = OFF, NON-
+C                 ZERO = ON).
+C        IMIRB  - VERTICAL MIRROR-IMAGE CODE (0 = OFF, NON-ZERO
+C                 = ON).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE MIRROR-IMAGE FLAGS.
+C
+      MIRAF = .FALSE.
+      IF(IMIRA .NE. 0)MIRAF = .TRUE.
+      MIRBF = .FALSE.
+      IF(IMIRB .NE. 0)MIRBF = .TRUE.
+      RETURN
+C
+      END
diff --git a/ppl/complot/number.F b/ppl/complot/number.F
new file mode 100644
index 0000000..85a00c2
--- /dev/null
+++ b/ppl/complot/number.F
@@ -0,0 +1,94 @@
+	SUBROUTINE NUMBER(X,Y,DEG,CSIZE,NC,V)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)number.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	CHARACTER LAB*30,IFORM*10
+	LOGICAL FLAG
+	FLAG=.FALSE.
+200	VT=V*1.000001
+	IF(V.EQ.0)THEN
+	NCC=1
+	ELSE
+	VX=ALOG10(ABS(VT))
+	NCC=IFIX(VX)+SIGN(1.,VX)
+	END IF
+	IF(NC.GT.0)THEN
+	IF(NC.GE.IABS(NCC)+2)THEN
+	IF(NCC.GE.0)THEN
+	WRITE(IFORM,10)NC,NC-NCC-2
+10	FORMAT('(F',I2,'.',I2,')')
+	ELSE
+	WRITE(IFORM,10)NC,NC-2
+	END IF
+	ELSE
+	IF(NC.LT.7)GOTO 100
+	WRITE(IFORM,11)NC,NC-7
+11	FORMAT('(1PE',I2,'.',I2,')')
+	ENDIF
+	WRITE(LAB,IFORM)V
+	ELSE
+	NC=-NC
+	IF(NC.LT.NCC+1)GOTO 100
+	WRITE(IFORM,12)NC
+12	FORMAT('(I',I2,')')
+	WRITE(LAB,IFORM)IFIX(V)
+	END IF
+	IF(FLAG)THEN
+	CALL SYMBL(X,Y,DEG,CSIZE,NC,LAB)
+	ELSE
+	CALL SYMBOL(X,Y,DEG,CSIZE,NC,LAB)
+	END IF
+	RETURN
+100	LAB='******************************'
+	IF(FLAG)THEN
+	CALL SYMBL(X,Y,DEG,CSIZE,NC,LAB)
+	ELSE
+	CALL SYMBOL(X,Y,DEG,CSIZE,NC,LAB)
+	ENDIF
+	RETURN
+	ENTRY NUMBR(X,Y,DEG,CSIZE,NC,V)
+	FLAG=.TRUE.
+	GOTO 200
+	END
diff --git a/ppl/complot/obliq3.F b/ppl/complot/obliq3.F
new file mode 100644
index 0000000..6936a17
--- /dev/null
+++ b/ppl/complot/obliq3.F
@@ -0,0 +1,91 @@
+      SUBROUTINE OBLIQ3(DEGRES)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)obliq3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL OBLIQ3(DEGRES)
+C
+C     THIS SUBROUTINE ESTABLISHES CONTROL INFORMATION FOR OBLIQUE
+C     THREE-DIMENSIONAL PROJECTIONS WHERE THE PLANE OF PROJECTION
+C     IS PARALLEL TO THE XY-PLANE.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+      IF(DEGRES .NE. 0.0)THEN
+C
+C     SET THE VIEW FLAG.
+C
+        VIEWF = .TRUE.
+C
+C     CONVERT THE ANGLE OF PROJECTION TO RADIANS.
+C
+        TEMP = 0.01745329251994 * DEGRES
+C
+C     COMPUTE THE ELEMENTS OF THE TRANSFORMATION MATRIX.
+C
+        TAX = 1.0
+        TAY = 0.0
+        TAZ = -COS(TEMP)
+        TBX = 0.0
+        TBY = 1.0
+        TBZ = -SIN(TEMP)
+        TCX = 0.0
+        TCY = 0.0
+        TCZ = 0.0
+        VDIST = 0.0
+      ELSE
+C
+C     RESET THE VIEW FLAG.
+C
+        VIEWF = .FALSE.
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/opndev.F b/ppl/complot/opndev.F
new file mode 100644
index 0000000..b94f20f
--- /dev/null
+++ b/ppl/complot/opndev.F
@@ -0,0 +1,387 @@
+	subroutine opndev(termf,clear)
+C**
+C**    @(#)opndev.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*       Directory PMEL:[PLOT5.PPLV11.COMPLOT]OPNDEV.F -->.FOR via "PREPRS"
+* search for "TMAP" to find all revisions
+* *sh* 8/26/88 - rev 1.0 - for FERRET 1.10+
+* *sh* 1/20/89 - rev 1.1 - for FERRET 1.10+ from V11 of PPLUS
+*       - only delete segments currently in use to permit multiple viewports
+* *jd* 3.20.89 Modified for GKS metafiles to write private GCLRWK to metafile
+*	as metafile system doesn't write it for some unknown reason.
+* *jd* 7.12.90 Mod to not call CHOUT if dimension arg eq 0
+* *jd* 10.26.93 Mod to eliminate private GCLRWK for xgks
+* *jd* 12.96 Numerous comments including control characters of various
+* 	nature (eg ^) eliminated.  They confuse the linux F90 compiler
+
+
+*****************************************************
+
+C
+C	CALL OPNDEV(TERMF,CLEAR)
+C
+C	THIS SUBROUTINE IS USED TO OPEN A DEVICE FOR THE FIRST TIME
+C	AND TO OPEN THE DEVICE FOR ADDITIONAL INPUT.
+C
+C	TERMF  -- FOR INTERACTIVE / COMMAND SWITCH
+C		 IF TRUE THE COMMANDS ARE COMING FROM THE TERMINAL
+C	CLEAR -- LOGICAL IF TRUE CLEAR THE DEVICE  (I.E. START NEW)
+C
+C
+* TMAP mod 8/26/88
+!	include 'PLTCOM.DAT'
+!	include 'GKSCM1.INC'
+#ifdef unix
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'
+	include 'gkscm2.cmn' !jd 3.20.89 for private gclrwk
+#else
+	INCLUDE 'TMAP_PPLV11INC:PLTCOM_DAT.DECL'
+	INCLUDE 'PPLV11INC:PLTCOM.DAT'
+	INCLUDE 'TMAP_PPLV11INC:GKSCM1_INC.DECL'
+	INCLUDE 'PPLV11INC:GKSCM1.INC'
+	INCLUDE 'tmap_pplv11inc:tmap_gkscm2.inc' !JD 3.20.89 for private GCLRWK
+#endif
+
+	INTEGER	iseg, ivp, lens, itype, i, j, nterm, ndelay ! local declarations
+	integer	control_flag ! For private GCLRWK
+
+* special COMMON to let this routine know if FERRET is in control
+
+#ifdef unix
+	include 'ppl_in_ferret.cmn'
+#else
+	INCLUDE 'TMAP_PPLV11INC:PPL_IN_FERRET.CMN'
+#endif
+
+* end of TMAP mods 8/26/88 & 1/20/89
+C
+C	THIS IS A VAX/VMS SUBROUTINE AT THIS TIME
+C
+	LOGICAL CLEAR,TERMF
+	LOGICAL FRST,TRMOPN
+#ifndef unix
+	integer*4 lib$get_symbol,len,stat
+	byte FIRSTB(20,12),SECNDB(20,12),FIRST(20),SECND(20)
+	byte ER4010(2),ER41XX(8)
+#else
+        INTEGER FIRSTB(20,12),SECNDB(20,12),FIRST(20),SECND(20)
+        INTEGER ER4010(2),ER41XX(8)
+#endif
+	CHARACTER TERM(12)*10,TYPE*10
+	INTEGER ITERM(12),FIRSTL(12),SECNDL(12)
+	LOGICAL SEGMNL(12),SEGMN,FCLOSL(12),FCLOS
+C
+C
+	DATA ER4010/27,12/,ER41XX/27,83,75,33,27,83,69,49/
+	DATA TERM/'VT240','GVT+','ZENITH','TEK4010','TEK41XX','MAC',
+     *		  'TAB','TEK4105','TEK4014','HIREZ','HP2397','GP220'/
+	DATA ITERM/1,2,3,4,5,4,6,7,4,8,9,10/,FRST/.TRUE./,NTERM/12/
+C
+C
+C
+	DATA FIRSTB/27,91,63,51,56,104,14*0,
+     *		    28,19*0,
+     *		    27,91,50,74,16*0,
+     *		    20*0,
+     *		    27,37,33,48,27,76,86,48,27,83,86,33,49,7*0,
+     *		    29,19*0,
+     *		    27,37,33,48,27,76,86,48,12*0,
+     *		    27,91,50,74,27,49,14*0,
+     *		    27,42,100,102,27,42,100,99,27,91,51,56,104,7*0,
+     *		    29,19*0,
+     *		    20*0,
+     *              20*0/
+	DATA SECNDB/27,91,63,51,56,108,14*0,
+     *		    24,19*0,
+     *		    27,58,56,102,16*0,
+     *		    20*0,
+     *		    27,83,78,27,83,86,33,48,27,76,86,49,27,37,33,49,4*0,
+     *		    27,34,48,103,16*0,
+     *		    27,76,86,49,27,37,33,49,12*0,
+     *		    27,50,18*0,
+     *      27,91,51,56,108,27,42,100,100,27,42,100,101,7*0,
+     *		    2,19*0,
+     *		    20*0,
+     *              20*0/
+C
+C	DEVICE HAS SEGMNMENTS IF TRUE  (I.E. 4115, 4107)
+C
+	DATA SEGMNL/ .FALSE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		    .TRUE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		   .FALSE.,
+     *		 2*.FALSE./
+C
+C	DEVICE MUST BE ERASED TO GO BACK TO COMMAND
+C
+	DATA FCLOSL/ .TRUE.,
+     *		    .FALSE.,
+     *		     .TRUE.,
+     *		     .TRUE.,
+     *		    .FALSE.,
+     *		     .TRUE.,
+     *		    .FALSE.,
+     *		     .TRUE.,
+     *		    .FALSE.,
+     *		    .FALSE.,
+     *		  2*.FALSE./
+	DATA FIRSTL/6,1,4,0,13,1,8,6,13,1,2*0/
+	DATA SECNDL/6,1,4,0,16,4,8,2,13,1,2*0/
+C
+C	SET UP FOR SPECIFIC TERMINAL TYPE
+C
+	IF(FRST)THEN
+#ifdef unix
+            call getenv('GRAPHTERM',TYPE)
+            LENS=lnblk(type,10)
+            IF(lens.le.0)then
+#else
+	    stat=lib$get_symbol('GRAPHTERM',type,len)
+	    lens=len
+	    if(.not.stat)then
+#endif
+		ITYPE=1
+	    ELSE
+		DO 14 I=1,NTERM
+		IF(TYPE(1:LENS).EQ.TERM(I))GOTO 11
+14		CONTINUE
+		I=1
+11		ITYPE=ITERM(I)
+	    ENDIF
+	    DO 12 I=1,20
+12	    FIRST(I)=FIRSTB(I,ITYPE)
+	    DO 13 I=1,20
+13	    SECND(I)=SECNDB(I,ITYPE)
+	    FRST=.FALSE.
+	    SEGMN=SEGMNL(ITYPE)
+	    FCLOS=FCLOSL(ITYPE)
+	ENDIF
+C
+C
+	PMODE = ALPHA
+	IF(SAVEF)CALL XYZPLT
+C
+C	CHECK FOR PLOT-TYPE
+C
+	IF(PTYPE.EQ.1.OR.PTYPE.EQ.2)THEN
+C
+C	DEVICE IS A TEK TERMINAL COMPATIBLE
+C
+	    IF(.NOT.TRMOPN)THEN
+C
+C	OPEN DEVICE FOR GRAPHICS AND ERASE THE SCREEN
+C
+		if (firstl(itype) .gt. 0) CALL CHOUT(FIRST,FIRSTL(ITYPE))
+		TRMOPN=.TRUE.
+	    ENDIF
+	    IF(CLEAR)THEN
+		IF(SEGMN)THEN
+		    CALL CHOUT(ER41XX,8)
+		ELSE
+	            CALL CHOUT(ER4010,2)
+C
+C	TRANSMIT SYNC CHARACTERS FOR PHOSPHORE COOL DOWN.
+C
+c		    NDELAY=IFIX(0.7*FLOAT(BAUDR/10))
+c		    DO 30 J=1,NDELAY
+c30		    CALL CHOUT(SYN,1)
+		ENDIF
+	    ENDIF
+	    CALL CHDMP
+	ELSE IF(PTYPE.EQ.3.OR.PTYPE.EQ.4)THEN
+C
+C	DEVICE IS A GKS DEVICE
+C
+	    CALL PPLGFLUSH
+#ifdef core
+            if(.not.gksopn)then
+                call crinit
+                gksopn=.true.
+            endif
+c
+            if(clear)then
+                call delallretainsegs()
+                call newframe()
+                call createretainseg(1)
+            endif
+#else
+* TMAP mod 8/26/88, PPL_in_FERRET added 1/20/89
+	    IF(CLEAR) THEN
+	       IF ( PPL_in_FERRET ) THEN
+	         CALL CLEAR_VP
+	       ELSE
+		 control_flag = 0
+	         CALL FGD_GCLRWK(WSID,control_flag)
+	       ENDIF
+	    ENDIF
+* end of TMAP mods 8/26/88
+#endif
+	ENDIF
+	IF(PTYPE.EQ.0.OR.PTYPE.EQ.2.OR.PTYPE.EQ.4)THEN
+C
+C	THE OUTPUT IS A BINARY FILE
+C
+	    IF(PLTFLG)THEN
+C
+C	MOVE TO A NEW PLOTTING AREA
+C
+		PEN = .FALSE.
+		CALL ZABMV
+		IF(CLEAR)THEN
+		    CALL BINFSH
+		    PLTFLG = .FALSE.
+		ENDIF
+	    ENDIF
+	ENDIF
+	LPEN = .FALSE.
+C
+C     INITIALIZE THE DATA VARIABLES FOR THE NEXT PLOT.
+C
+	A = 0.0
+	B = 0.0
+	AOLD = 0.0
+	BOLD = 0.0
+	COLD = 0.0
+C
+	IF(TTYPE.GT.0)THEN
+	    IF(ASIZE / TWIDTH .GT. BSIZE / THIGHT)THEN
+		PLTOTA = TSCLA /ASIZE
+		PLTOTB =TSCLB /ASIZE * TWIDTH /THIGHT
+	    ELSE
+		PLTOTA = TSCLA / BSIZE * THIGHT / TWIDTH
+		PLTOTB = TSCLB / BSIZE
+	    ENDIF
+	ELSE
+	    PLTOTA=TSCLA/(TWIDTH*FACTOR)
+	    PLTOTB=TSCLB/(THIGHT*FACTOR)
+	ENDIF
+C
+C     RECOMPUTE THE HP PLOTTER CONVERSION FACTORS.
+C
+C
+C     RESTORE THE DEFAULT MINIMUM AND MAXIMUM ALLOWABLE VALUES OF
+C     A AND B.
+C
+	AMIN = 0.0
+	BMIN = 0.0
+	AMAX = ASIZE
+	BMAX = BSIZE
+C
+C     CALCULATE THE OFF-SCREEN FLAG.
+C
+	LOSFLG = 0
+	IF(AOLD - 0.001 .GT. AMAX)LOSFLG = 1
+	IF(AOLD + 0.001 .LT. AMIN)LOSFLG = 2
+	IF(BOLD - 0.001 .GT. BMAX)LOSFLG = LOSFLG + 4
+	IF(BOLD + 0.001 .LT. BMIN)LOSFLG = LOSFLG + 8
+C
+C     TRANSFORM THE ABSOLUTE ORIGIN TO THE USER'S COORDINATE SYS-
+C     TEM.
+C
+	CALL TFORMI(XOLD,YOLD,ZOLD)
+	IF(WINDOF)THEN
+C
+C     CALCULATE THE OFF-WINDOW FLAG.
+C
+	    LOWFLG = 0
+	    IF(XOLD .GT. XMAX)LOWFLG = 1
+	    IF(XOLD .LT. XMIN)LOWFLG = 2
+	    IF(YOLD .GT. YMAX)LOWFLG = LOWFLG + 4
+	    IF(YOLD .LT. YMIN)LOWFLG = LOWFLG + 8
+	ENDIF
+	RETURN
+C
+	ENTRY CLSDEV(TERMF,CLEAR)
+C
+C	THIS ROUTINE CLOSES THE DEVICE DEPENDING ON THE SITUATION
+C
+	IF(PTYPE.EQ.1.OR.PTYPE.EQ.2)THEN
+C
+C	DEVICE IS TEK TERMINAL COMPATIBLE
+C
+	    IF(FCLOS.OR.CLEAR)THEN
+C
+C	DEVICE REQUIRES THE TERMINAL CLEARED
+C
+		CALL CHOUT(ER4010,2)
+c		NDELAY=IFIX(0.7*FLOAT(BAUDR/10))
+c		DO 40 J=1,NDELAY
+c40		CALL CHOUT(SYN,1)
+	    ENDIF
+C
+C	GO TO COMMAND SCREEN
+C
+	    if (secndl (itype) .gt. 0) CALL CHOUT(SECND,SECNDL(ITYPE))
+	    TRMOPN=.FALSE.
+	    CALL CHDMP
+	ELSE IF(PTYPE.EQ.3.OR.PTYPE.EQ.4)THEN
+C
+C	DEVICE IS GKS
+C
+	    CALL PPLGFLUSH
+	ELSE IF((PTYPE.EQ.0.OR.PTYPE.EQ.2.OR.PTYPE.EQ.4)
+     *		.AND.CLEAR)THEN
+	    IF(PLTFLG)THEN
+		PEN=.FALSE.
+		CALL ZABMV
+		CALL BINFSH
+		PLTFLG=.FALSE.
+	    ENDIF
+	ENDIF
+	RETURN
+C
+	END
diff --git a/ppl/complot/origin.F b/ppl/complot/origin.F
new file mode 100644
index 0000000..a68c28c
--- /dev/null
+++ b/ppl/complot/origin.F
@@ -0,0 +1,73 @@
+      SUBROUTINE ORIGIN(AORG,BORG)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)origin.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ORIGIN(AORG,BORG)
+C
+C     THIS SUBROUTINE DEFINES THE LOCATION OF THE ORIGIN OF THE
+C     DISPLAY.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        AORG   - HORIZONTAL DISPLACEMENT OF THE ORIGIN IN IN-
+C                 CHES (OR MM).
+C        BORG   - VERTICAL DISPLACEMENT OF THE ORIGIN IN INCHES
+C                 (OR MM).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CONVERT THE PARAMETERS TO INTERNAL INCREMENTS.
+C
+      AORIGN = FACTOR * AORG
+      BORIGN = FACTOR * BORG
+      RETURN
+C
+      END
diff --git a/ppl/complot/page.F b/ppl/complot/page.F
new file mode 100644
index 0000000..35a88ea
--- /dev/null
+++ b/ppl/complot/page.F
@@ -0,0 +1,119 @@
+      SUBROUTINE PAGE
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)page.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL PAGE
+C
+C     THIS SUBROUTINE SETS ALPHAS MODE AND MOVES THE ALPHA CUR-
+C     SOR ON A TEKTERMINAL TO THE UPPER LEFT-HAND CORNER OF THE
+C     SCREEN (HOME POSITION).
+C     PAGE HAS NO EFFECT ON THE ZETA AND BENSON OR PRINTRONIX PLOTTERS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = ALPHA
+C
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+C
+      IF(SAVEF)CALL XYZPLT
+C
+C     CHECK THE PLOT TYPE.
+C
+      IF(PTYPE .EQ. 0 .OR. PTYPE .EQ. -1.OR.PTYPE.GT.2)RETURN
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)GO TO 10
+C
+C     MOVE TO HOME POSITION ON OTHER TEKTRONIX GRAPHICS TERMINALS.
+C
+        CALL CHOUT(HOME,5)
+C
+C     SELECT ALPHANUMERIC MODE ON OTHER TEKTRONIX GRAPHICS TER-
+C     MINALS.
+C
+        CALL CHOUT(US,1)
+      GO TO 30
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+   10 IF(.NOT.GRAPHF) THEN
+C
+C     TRANSMIT THE 'PLOTTER ON' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+        CALL CHOUT(TEKON,3)
+      ENDIF
+C
+C     MOVE TO HOME POSITION ON THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(HOME,5)
+C
+C     SELECT ALPHANUMERIC MODE ON THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(US,1)
+C
+C     TRANSMIT THE 'PLOTTER OFF' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+      CALL CHOUT(TEKOFF,5)
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+   30 CALL CHDMP
+C
+C     RESET THE GRAPHICS FLAG.
+C
+      GRAPHF = .FALSE.
+      RETURN
+C
+      END
diff --git a/ppl/complot/plot3.F b/ppl/complot/plot3.F
new file mode 100644
index 0000000..e3f55b3
--- /dev/null
+++ b/ppl/complot/plot3.F
@@ -0,0 +1,91 @@
+      SUBROUTINE PLOT3(X,Y,Z,IPEN,IMARK)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)plot3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL PLOT3(X,Y,Z,IPEN,IMARK)
+C
+C     THIS SUBROUTINE MOVES THE PEN FROM THE CURRENT POSITION TO
+C     A NEW POINT.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X,Y,Z  - COORDINATES OF THE NEW POINT IN USER'S UNITS.
+C        IPEN   - PEN POSITION (0 = PEN UP, NON-ZERO = PEN DOWN).
+C        IMARK  - DATA MARK CODE (0-88).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CHECK THE PLOTTING MODE TO INSURE THAT IT IS SET FOR GRAPH-
+C     ICS.
+C
+      IF(PMODE .EQ. ALPHA)PMODE = VECTOR
+C
+C     SCALE THE COORDINATES OF THE NEW POINT.
+C
+      XTEMP = X * XSCALE
+      YTEMP = Y * YSCALE
+      ZTEMP = Z * ZSCALE
+C
+C     SET THE PEN POSITION.
+C
+      PENF = .FALSE.
+      IF(IPEN .NE. 0)PENF = .TRUE.
+C
+C     PLOT TO THE POINT.
+C
+      CALL XYZPLT
+C
+C     DETERMINE WHETHER A DATA MARK SHOULD BE DRAWN.
+C
+      IF(IPEN .NE. 0)CALL MARK(IMARK)
+      RETURN
+C
+      END
diff --git a/ppl/complot/plotype.F b/ppl/complot/plotype.F
new file mode 100644
index 0000000..dc8394d
--- /dev/null
+++ b/ppl/complot/plotype.F
@@ -0,0 +1,123 @@
+      SUBROUTINE PLTYPE(ICODE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*	Modified 3.15.89 J Davison JISAO/PMEL/TMAP
+*	For GKS plots (pltype = 3 or 4) captures decision to write to
+*	GKS metafile, and sets up GKS as required.
+*
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     PLTTER DEPENDENT ROUTINE
+C     THIS ROUTINE MUST BE MODIFIED EVERY TIME NEW PLT DEVICES ARE ADDE
+C     OR OLD ONES ARE DELETED.
+C
+C
+C     CALL PLTYPE(ICODE)
+C
+C     THIS SUBROUTINE SELECTS THE DEVICE OR DEVICES THAT WILL BE
+C     USED FOR PLTTING.
+C
+C     THE VARIOUS COMBINATIONS OF PLTTING DEVICES THAT CAN BE
+C     DRIVEN BY COMPLT AND THE ASSOCIATED PLT TYPES ARE LISTED
+C     BELOW:
+C	 GKS AND ZETA PLOTTER               -    4
+C        GKS ONLY                           -    3
+C        TEKTERMINAL AND ZETA PLOTTER       -    2
+C        TEKTERMINAL ONLY                   -    1
+C        ZETA PLOTTER ONLY                  -    0
+C	 HP7475 PLOTTER ONLY		    -   -1
+C	 HP7475 PLOTTER AND TEKTERMINAL     -   -2
+C
+C
+	integer	icode
+
+#ifdef unix
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'cmrdl_inc.decl'
+	include 'CMRDL.INC'
+#else
+	INCLUDE 'TMAP_PPLV11INC:PLTCOM_DAT.DECL'
+	INCLUDE 'PPLV11INC:PLTCOM.DAT'
+	INCLUDE 'TMAP_PPLV11INC:CMRDL_INC.DECL'
+	INCLUDE 'PPLV11INC:CMRDL.INC'
+#endif
+
+	IF(PLTFLG)THEN
+	    PEN=.FALSE.
+	    IF(PTYPE.LT.0)THEN
+		A=0.
+		B=0.
+		CALL HPABMV
+		CALL ZBUFFT('SP0;',4)
+		OLDHTA=0
+		CALL HFLUSH
+	    ELSE IF(PTYPE.EQ.0.OR.PTYPE.EQ.2.OR.PTYPE.EQ.4)THEN
+		CALL ZABMV
+		CALL BINFSH
+	    ENDIF
+	    PLTFLG=.FALSE.
+	ENDIF
+      PTYPE = ICODE
+C
+C     CHECK FOR A LEGAL PLT TYPE.
+C
+      IF(IABS(PTYPE) .GT. 4)PTYPE = 0
+
+*     DETERMINE IF METAFILE WILL BE USED IN GKS, OPEN GKS IF NOT OPEN
+	if ((ptype .eq. 3 .or. ptype .eq. 4) .and. icom(1:6) .ne. 'CLSPLT') 
+     .		call set_gks_metafile
+C
+C
+C     REINITIALIZE THE TEKTERMINAL TYPE IN CASE THIS IS NOT THE
+C     FIRST TIME THIS SUBROUTINE HAS BEEN CALLED.
+C
+      CALL TKTYPE(4010)
+C
+C     INTIALIZE THE PRINTRONIX RASTER BUFFER IF NEEDED.
+C
+      RETURN
+C
+      END
diff --git a/ppl/complot/pltend.F b/ppl/complot/pltend.F
new file mode 100644
index 0000000..fcbea6a
--- /dev/null
+++ b/ppl/complot/pltend.F
@@ -0,0 +1,88 @@
+      SUBROUTINE PLTEND
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pltend.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL PLOTEND
+C
+C     THIS SUBROUTINE IS USED TO INDICATE THAT A DISPLAY HAS
+C     BEEN COMPLETED.  ON THE TEKTERMINAL, EXECUTION IS SUS-
+C     PENDED UNTIL THE USER RESPONDS BY ENTERING A CHARACTER
+C     FROM THE KEYBOARD.  THEN THE SCREEN IS ERASED AND THE
+C     ALPHA CURSOR IS MOVED TO THE UPPER LEFT-HAND CORNER OF
+C     THE SCREEN.  ON THE PRINTRONIX PRINTER PLOTTER, THE BUFFER
+C     IS DUMPED AND CONTROL IS RETURNED TO THE CALLING PROGRAM.
+C     ON THE ZETA AND BENSON PLOT-
+C     TERS, IF PLOTTING HAS BEEN DONE SINCE THE LAST CALL TO
+C     PLOTEND OR ERASE, THE PEN IS LIFTED AND MOVED TO THE
+C     LEFT MARGIN THREE INCHES ABOVE THE TOP OF THE LAST PLOT.
+C
+C
+#ifdef unix
+      include 'PLTCOM.DAT'
+#else
+      include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CHECK THE PLOT TYPE.
+C
+      IF(PTYPE .EQ. 1 .OR. IABS(PTYPE) .GE. 2)THEN
+	IF(PTYPE.GE.3)CALL PPLGFLUSH
+C
+C     PAUSE UNTIL THE USER RESPONDS.
+C
+        CALL PAGE
+        CALL CHOUT(BEL,1)
+        CALL CHOUT(BEL,1)
+	CALL CHDMP
+        CALL CHIN(IN,1,0)
+      ENDIF
+C
+C     TERMINATE THE PLOT.
+C
+      CALL ERASE
+      RETURN
+C
+      END
diff --git a/ppl/complot/pltlun.F b/ppl/complot/pltlun.F
new file mode 100644
index 0000000..3576f36
--- /dev/null
+++ b/ppl/complot/pltlun.F
@@ -0,0 +1,59 @@
+	SUBROUTINE PLTLUN(LUN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pltlun.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	CHANGE LUN OF ZETA PLOT  DO NOT CHANGE WHILE PLOT
+C	IS IN PROGRESS!!!!!
+C	D. DENBO JUNE 1983
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	LUHP=LUN
+	RETURN
+	END
diff --git a/ppl/complot/pltnme.F b/ppl/complot/pltnme.F
new file mode 100644
index 0000000..12e9fb6
--- /dev/null
+++ b/ppl/complot/pltnme.F
@@ -0,0 +1,72 @@
+	SUBROUTINE PLTNME(NME)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pltnme.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER NME*(*)
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	IF(PLTFLG)THEN
+	    PEN=.FALSE.
+	    IF(PTYPE.LT.0)THEN
+		A=0.
+		B=0.
+		CALL HPABMV
+		CALL ZBUFFT('SP0;',4)
+		OLDHTA=0
+		CALL HFLUSH
+	    ELSE IF(PTYPE.EQ.0.OR.PTYPE.EQ.2.OR.PTYPE.EQ.4)THEN
+		CALL ZABMV
+		CALL BINFSH
+	    ENDIF
+	    PLTFLG=.FALSE.
+	ENDIF
+	FILEZ=NME
+	RETURN
+	END
diff --git a/ppl/complot/points.F b/ppl/complot/points.F
new file mode 100644
index 0000000..d9b1aa0
--- /dev/null
+++ b/ppl/complot/points.F
@@ -0,0 +1,66 @@
+      SUBROUTINE POINTS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)points.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL POINTS
+C
+C     THIS SUBROUTINE CAUSES ALL SUBSEQUENT PLOTTING THAT IS
+C     DONE WITH THE PEN DOWN TO BE IN THE FORM OF DOTS AT EACH
+C     OF THE SPECIFIED COORDINATES.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = POINT
+      RETURN
+C
+      END
diff --git a/ppl/complot/positon.F b/ppl/complot/positon.F
new file mode 100644
index 0000000..2246441
--- /dev/null
+++ b/ppl/complot/positon.F
@@ -0,0 +1,217 @@
+      SUBROUTINE POSITN(X,Y)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)positon.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL POSITN(X,Y)
+C
+C     THIS SUBROUTINE DETERMINES THE CURRENT PLOTTING POSITION AND
+C     RETURNS THE COORDINATES TO THE USER'S PROGRAM IN USER'S UNITS.
+#ifdef unix
+C     IF THE PLOTTING DEVICES INCLUDE THE TEKTERMINAL AND IT IS IN
+#else
+C     IF THE PLOTTING DEVICES INCLUDE THE TEKTERMINAL AND IT IS IN
+#endif
+C     ALPHAS MODE, THE POSITION RETURNED IS THAT OF THE ALPHA CUR-
+C     SOR.
+C
+C
+	CHARACTER*1 IMODE
+      DIMENSION IN(7)
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+
+CC      Linux port:
+        integer octal37
+
+#ifdef FORTRAN_90
+        data    octal37/O'37'/
+#else
+        data    octal37/'37'O/
+#endif
+
+C
+C     SET ALPHAS MODE.
+C
+      IMODE = PMODE
+      PMODE = ALPHA
+C
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+C
+      IF(SAVEF)CALL XYZPLT
+C
+C     RESTORE THE CURRENT PLOTTING MODE.
+C
+      PMODE = IMODE
+C
+C     CHECK THE PLOT TYPE.
+C
+      IF(PTYPE .EQ. 0 .OR. PTYPE .EQ. -1.OR.PTYPE.GT.2)GO TO 20
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .EQ. 4006)GO TO 20
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+      CALL CHDMP
+      LHIA = 0
+      LHIB = 0
+      LLOBA = 0
+      IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)GO TO 10
+C
+C     SELECT ALPHA CURSOR ADDRESS INPUT MODE ON THE TEKTERMINAL
+C     AND READ THE FIVE CHARACTERS GENERATED BY THE TEKTERMINAL.
+C
+      CALL CHOUT(ESC,1)
+      CALL CHOUT(5,1)
+      CALL CHIN(IN,5,0)
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .GT. 0)THEN
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+#ifdef unix
+# ifdef NEED_IAND
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2), octal37),5),IAND(IN(3), octal37)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4), octal37),5),IAND(IN(5), octal37)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2), octal37),7),ISHFT(IAND(IN(3),
+     *    octal37),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4), octal37),7),ISHFT(IAND(IN(5),
+     *    octal37),2))) / PLTOTB + BMIN
+# else
+        AOLD = FLOAT(OR(LSHIFT(AND(IN(2), 31),5),AND(IN(3), 31)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(OR(LSHIFT(AND(IN(4), 31),5),AND(IN(5), 31)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+        AOLD = FLOAT(OR(LSHIFT(AND(IN(2), 31),7),LSHIFT(AND(IN(3),
+     *    31),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(OR(LSHIFT(AND(IN(4), 31),7),LSHIFT(AND(IN(5),
+     *    31),2))) / PLTOTB + BMIN
+# endif
+#else
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2), octal37),5),IAND(IN(3), octal37)
+     *   )) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4), octal37),5),IAND(IN(5), octal37)
+     *   )) / PLTOTB + BMIN
+      ELSE
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+        AOLD = FLOAT(IOR(ISHFT(IAND(IN(2), octal37),7),ISHFT(IAND(IN(3),
+     *    octal37),2))) / PLTOTA + AMIN
+        BOLD = FLOAT(IOR(ISHFT(IAND(IN(4), octal37),7),ISHFT(IAND(IN(5),
+     *    octal37),2))) / PLTOTB + BMIN
+#endif
+      ENDIF
+      GO TO 20
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+   10 IF(GRAPHF)THEN
+C
+C     SELECT GRAPHICAL INPUT MODE ON THE TEKTRONIX PLOTTER AND
+C     READ THE SEVEN CHARACTERS GENERATED BY THE PLOTTER.
+C
+        CALL CHOUT(ESC,1)
+        CALL CHOUT(IDTK,1)
+        CALL CHOUT(77,1)
+        CALL CHIN(IN,7,0)
+C
+C     CALCULATE THE COORDINATES OF THE POINT.
+C
+#ifdef unix
+#ifdef sun
+        AOLD = FLOAT(OR(OR(LSHIFT(AND(IN(1), 31),7),LSHIFT(AND(
+     *IN(3),31),2)),rSHIFT(AND(IN(5), 31),3)))/PLTOTA+AMIN
+        BOLD = FLOAT(OR(OR(LSHIFT(AND(IN(2), 31),7),LSHIFT(AND(
+     *IN(4),31),2)),rSHIFT(AND(IN(6), 31),3)))/PLTOTB+BMIN
+#else
+# ifdef NEED_IAND
+        AOLD = FLOAT(IOR(IOR(ISHFT(IAND(IN(1), octal37),7),ISHFT(IAND(
+     *IN(3),octal37),2)),ISHFT(IAND(IN(5), octal37),-3)))/PLTOTA+AMIN
+        BOLD = FLOAT(IOR(IOR(ISHFT(IAND(IN(2), octal37),7),ISHFT(IAND(
+     *IN(4),octal37),2)),ISHFT(IAND(IN(6), octal37),-3)))/PLTOTB+BMIN
+# else
+        AOLD = FLOAT(OR(OR(LSHIFT(AND(IN(1), 31),7),LSHIFT(AND(
+     *IN(3),31),2)),LSHIFT(AND(IN(5), 31),-3)))/PLTOTA+AMIN
+        BOLD = FLOAT(OR(OR(LSHIFT(AND(IN(2), 31),7),LSHIFT(AND(
+     *IN(4),31),2)),LSHIFT(AND(IN(6), 31),-3)))/PLTOTB+BMIN
+# endif
+#endif
+#else
+C
+        AOLD = FLOAT(IOR(IOR(ISHFT(IAND(IN(1), octal37),7),ISHFT(IAND(
+     *IN(3),octal37),2)),ISHFT(IAND(IN(5), octal37),-3)))/PLTOTA+AMIN
+        BOLD = FLOAT(IOR(IOR(ISHFT(IAND(IN(2), octal37),7),ISHFT(IAND(
+     *IN(4),octal37),2)),ISHFT(IAND(IN(6), octal37),-3)))/PLTOTB+BMIN
+#endif
+      ENDIF
+C
+C     TRANSFORM THE POINT TO THE USER'S COORDINATE SYSTEM.
+C
+   20 CALL TFORMI(XNEW,YNEW,ZNEW)
+      X = XNEW / XSCALE
+      Y = YNEW / YSCALE
+      RETURN
+C
+      END
diff --git a/ppl/complot/prime.F b/ppl/complot/prime.F
new file mode 100644
index 0000000..da717db
--- /dev/null
+++ b/ppl/complot/prime.F
@@ -0,0 +1,51 @@
+	SUBROUTINE PRIME(ICODE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)prime.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	THIS IS A DUMMY ROUTINE
+C
+	RETURN
+	END
diff --git a/ppl/complot/putchsun.F b/ppl/complot/putchsun.F
new file mode 100644
index 0000000..1256469
--- /dev/null
+++ b/ppl/complot/putchsun.F
@@ -0,0 +1,63 @@
+	subroutine putch(c)
+	character c*(*)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)putchsun.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	use sun fortran library putc call
+c
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+#ifndef F90_NO_FPUTC
+	ierr = fputc(0,c)
+#else
+	WRITE(0,999)c
+999	format(a1)
+#endif
+	call flush(0)
+	return
+	end
diff --git a/ppl/complot/range.F b/ppl/complot/range.F
new file mode 100644
index 0000000..c6faf33
--- /dev/null
+++ b/ppl/complot/range.F
@@ -0,0 +1,131 @@
+      SUBROUTINE RANGE(UAMIN,UAMAX,NAINTS,UMINR,UMAXR,DINT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)range.f	1.1    3/10/88
+C** V600:  1/06 *acm*  prevent values of LOG10(0.0)
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL RANGE(UMIN,UMAX,NINTS,UMINR,UMAXR,DINT)
+C
+C     THIS SUBROUTINE FINDS TWO VALUES FOR A VARIABLE SUCH THAT
+C     THE RANGE BETWEEN THEM IS EVENLY DIVISIBLE INTO APPROXI-
+C     MATELY A SPECIFIED NUMBER OF INTERVALS AND CONTAINS THE
+C     MINIMUM AND MAXIMUM VALUES OF THE VARIABLE.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        UMIN   - MINIMUM VALUE OF THE VARIABLE.
+C        UMAX   - MAXIMUM VALUE OF THE VARIABLE.
+C        NINTS  - APPROXIMATE NUMBER OF INTERVALS INTO WHICH THE
+C                 RANGE IS TO BE DIVIDED.
+C        UMINR  - MINIMUM VALUE OF THE RANGE.
+C        UMAXR  - MAXIMUM VALUE OF THE RANGE.
+C        DINT   - INTERVAL SIZE.
+C
+C
+C     TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      UMIN = UAMIN
+      UMAX = UAMAX
+      NINTS = IABS(NAINTS)
+C
+C     CHECK THE PARAMETERS TO MAKE SURE THAT THEY ARE VALID.
+C
+      IF(UMIN .GT. UMAX)THEN
+        TEMP = UMIN
+        UMIN = UMAX
+        UMAX = TEMP
+      ENDIF
+      IF(NINTS .EQ. 0)NINTS = 1
+C
+C     FIND THE APPROXIMATE SIZE OF THE INTERVAL.
+C
+      TEMP = (UMAX - UMIN) / FLOAT(NINTS)
+      IF(TEMP .EQ. 0.0)TEMP = UMAX
+C
+C     SCALE THE INTERVAL SIZE BY POWERS OF TEN TO A VALUE BETWEEN
+C     ONE AND TEN.
+C
+      IF (TEMP .EQ. 0.0) THEN
+         NT = 1
+      ELSE
+         NT = IFIX(ALOG10(TEMP))
+      ENDIF
+      IF(TEMP .LT. 1.0)NT = NT - 1
+      POW = 10.0 ** NT
+      TEMP = TEMP / POW
+C
+C     FIND THE CLOSEST PERMISSIBLE VALUE FOR THE INTERVAL SIZE.
+C
+      IF(TEMP .LT. SQRT(2.0))THEN
+        DINT = POW
+      ELSE IF(TEMP .LT. SQRT(10.0))THEN
+        DINT = 2.0 * POW
+      ELSE IF(TEMP .LT. SQRT(50.0))THEN
+        DINT = 5.0 * POW
+      ELSE
+        DINT = 10.0 * POW
+      ENDIF
+C
+C Note that for some values of these numbers, UMIN, UMAX, and DINT
+C the value of FM may be slightly larger or slightly smaller than
+C the intended value, and so may behave differently from one compiler/machine
+C to another (seen on Solaris vs Linux, in the Y axis of PLOT/i=1:12 1./i
+
+C     CALCULATE THE MINIMUM VALUE OF THE RANGE.
+C
+      FM = UMIN / DINT
+      M = IFIX(FM)
+      IF(FM .LT. 0.0)M = M - 1
+      UMINR = DINT * FLOAT(M)
+C
+C     CALCULATE THE MAXIMUM VALUE OF THE RANGE.
+C
+      FM = UMAX / DINT
+      M = IFIX(FM)
+      IF(FM .GT. 0.0)M = M + 1
+      UMAXR = DINT * FLOAT(M)
+      RETURN
+C
+      END
diff --git a/ppl/complot/range_dm.F b/ppl/complot/range_dm.F
new file mode 100644
index 0000000..bc6190d
--- /dev/null
+++ b/ppl/complot/range_dm.F
@@ -0,0 +1,123 @@
+      SUBROUTINE RANGE_DM(uamin,uamax,udel,uminr,umaxr,dint)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)range.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL RANGE_DM(umin,umax,udel,uminr,umaxr,dint)
+C
+C     This subroutine finds two values for a variable such that
+C     the range between them is evenly divisible into approxi-
+C     mately a specified number of intervals and contains the
+C     minimum and maximum values of the variable.
+C     Based on RANGE, but computed for output as degrees and minutes.
+C
+C     The various parameters and their definitions are listed
+C     below:
+C        UMIN   - previously computed minimum value of the range.
+C        UMAX   - previously computed minimum value of the range.
+C        UDEL  -  previous delta value.
+C        UMINR  - new minimum value of the range.
+C        UMAXR  - new maximum value of the range.
+C        DINT   - new interval size.
+C
+C  Calling argument declarations
+      REAL uamin, uamax, udel, uminr, umaxr, dint
+
+C Local variable declarations
+
+      REAL umin, umax, temp, fm
+      INTEGER m
+C
+C     Transfer the parameters to new variables.
+C
+      umin = uamin
+      umax = uamax
+C
+C     Check the parameters to make sure that they are valid.
+C
+      IF (umin .GT. umax) THEN
+        temp = umin
+        umin = umax
+        umax = temp
+      ENDIF
+C
+C
+C     Change to intervals appropriate for deg/minute formatting
+C     If the previously computed interval is less than 1 minute,
+C     make it 1 minute; change other intervals to correspond to
+C     2, 5, 10, 30 minutes, or whole degrees.
+C
+      IF (udel .LE. 0.01) THEN
+         dint = 1./120.   ! half minute 0.0083 deg
+      ELSE IF (udel .LE. 0.02) THEN
+         dint = 1./60.   ! one minute 0.01667 deg
+      ELSE IF (udel .LE. 0.05) THEN
+         dint = 2./60.   ! two minutes 0.0333 deg
+      ELSE IF (udel .LE. 0.1) THEN 
+         dint = 5./60.   ! five minutes 0.0833 deg
+      ELSE IF (udel .LE. 0.2) THEN
+         dint = 10./60.   ! ten minutes 0.1667 deg
+      ELSE IF (udel .LE. 0.5) THEN
+         dint = 15./60.   ! 15 minutes 0.25 deg
+      ELSE
+         dint = udel
+      ENDIF
+C
+C     recalculate the minimum value of the range.
+C
+      fm = umin / dint
+      m = IFIX(fm)
+      IF (fm .LT. 0.0) m = m - 1
+      uminr = dint * FLOAT(m)
+C
+C     recalculate the maximum value of the range.
+C
+      fm = umax / dint
+      m = IFIX (fm)
+      IF (fm .GT. 0.0) m = m + 1
+      umaxr = dint * FLOAT(m)
+C
+      RETURN
+      END
diff --git a/ppl/complot/rangel.F b/ppl/complot/rangel.F
new file mode 100644
index 0000000..7976912
--- /dev/null
+++ b/ppl/complot/rangel.F
@@ -0,0 +1,100 @@
+      SUBROUTINE RANGEL(UAMIN,UAMAX,UMINR,UMAXR)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)rangel.f	1.1    3/10/88
+C** V600:  1/06 *acm*  prevent values of LOG10(0.0)
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL RANGEL(UMIN,UMAX,UMINR,UMAXR)
+C
+C     THIS SUBROUTINE FINDS TWO VALUES FOR A VARIABLE SUCH THAT
+C     EACH IS AN INTEGER POWER OF TEN AND THE RANGE BETWEEN THEM
+C     CONTAINS THE MINIMUM AND MAXIMUM VALUES OF THE VARIABLE.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        UMIN   - MINIMUM VALUE OF THE VARIABLE.
+C        UMAX   - MAXIMUM VALUE OF THE VARIABLE.
+C        UMINR  - MINIMUM VALUE OF THE RANGE.
+C        UMAXR  - MAXIMUM VALUE OF THE RANGE.
+C
+C
+C     TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      UMIN = ABS(UAMIN)
+      UMAX = ABS(UAMAX)
+
+C
+C     CHECK THE PARAMETERS TO MAKE SURE THAT THEY ARE VALID.
+C
+      IF(UMIN .GT. UMAX)THEN
+        TEMP = UMIN
+        UMIN = UMAX
+        UMAX = TEMP
+      ENDIF
+C
+C     CALCULATE THE MINIMUM VALUE OF THE RANGE.
+C
+      IF (UMIN .EQ. 0.) THEN
+         FM = 0.
+      ELSE
+         FM = ALOG10(UMIN)
+      ENDIF
+      M = IFIX(FM)
+      IF(FM .LT. 0.0)M = M - 1
+      UMINR = 10.0 ** M
+C
+C     CALCULATE THE MAXIMUM VALUE OF THE RANGE.
+C
+      IF (UMAX .EQ. 0.) THEN
+         FM = 0.
+      ELSE
+         FM = ALOG10(UMAX)
+      ENDIF
+      M = IFIX(FM)
+      IF(FM .GT. 0.0)M = M + 1
+      UMAXR = 10.0 ** M
+      RETURN
+C
+      END
diff --git a/ppl/complot/rotate.F b/ppl/complot/rotate.F
new file mode 100644
index 0000000..be921ea
--- /dev/null
+++ b/ppl/complot/rotate.F
@@ -0,0 +1,88 @@
+      SUBROUTINE ROTATE(DEGRES)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)rotate.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ROTATE(DEGRES)
+C
+C     THIS SUBROUTINE CAUSES THE USER'S XYZ CARTESIAN COORDINATE
+C     SYSTEM TO BE ROTATED COUNTERCLOCKWISE THE SPECIFIED NUMBER
+C     OF DEGREES.  FOR TWO-DIMENSIONAL PLOTS, THE CENTER OF ROTA-
+C     TION IS THE USER'S ORIGIN.  FOR THREE-DIMENSIONAL PLOTS,
+C     THE CENTER OF ROTATION IS THE LINE PARALLEL TO THE VIEWING
+C     DIRECTION WHICH PASSES THROUGH THE REFERENCE POINT FOR THE
+C     PROJECTION CURRENTLY IN EFFECT.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+      REAL*8 TEMP
+C
+      IF(DEGRES .NE. 0.0)THEN
+C
+C     SET THE ROTATION FLAG.
+C
+        ROTAT = .TRUE.
+C
+C     CONVERT THE ROTATION TO RADIANS.
+C
+        TEMP = 0.01745329251994 * DEGRES
+C
+C     COMPUTE THE SINE AND COSINE.
+C
+        ROTSIN = SIN(TEMP)
+        ROTCOS = COS(TEMP)
+      ELSE
+C
+C     RESET THE ROTATION FLAG.
+C
+        ROTAT = .FALSE.
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/scale3.F b/ppl/complot/scale3.F
new file mode 100644
index 0000000..7e4a3af
--- /dev/null
+++ b/ppl/complot/scale3.F
@@ -0,0 +1,77 @@
+      SUBROUTINE SCALE3(XSCL,YSCL,ZSCL)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)scale3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL SCALE3(XSCL,YSCL,ZSCL)
+C
+C     THIS SUBROUTINE DEFINES SCALE FACTORS FOR SUBSEQUENT PLOT-
+C     TING.  THE SCALE FACTORS DETERMINE THE RELATIVE SIZE OF
+C     THE DISPLAY.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XSCL   - SCALE FACTOR TO CONVERT FROM USER'S UNITS TO
+C                 INCHES (OR MM) ON THE X-AXIS.
+C        YSCL   - SCALE FACTOR TO CONVERT FROM USER'S UNITS TO
+C                 INCHES (OR MM) ON THE Y-AXIS.
+C        ZSCL   - SCALE FACTOR TO CONVERT FROM USER'S UNITS TO
+C                 INCHES (OR MM) ON THE Z-AXIS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CONVERT THE SCALE FACTORS TO INTERNAL INCREMENTS.
+C
+      XSCALE = FACTOR * XSCL
+      YSCALE = FACTOR * YSCL
+      ZSCALE = FACTOR * ZSCL
+      RETURN
+C
+      END
diff --git a/ppl/complot/symbel.F b/ppl/complot/symbel.F
new file mode 100644
index 0000000..14e1b82
--- /dev/null
+++ b/ppl/complot/symbel.F
@@ -0,0 +1,602 @@
+ 	SUBROUTINE SYMBEL(X,Y,DEGRES,HEIGHT,NCHAR,STRING)
+C** 
+C**    @(#)symbel.tplate.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C       Mod *JD* 3.19.91 for unix -- use environment variable PLOTFONTS
+C       *jd* 7.92 variable IF renamed to KIF for MAC
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       *jd* 11.94 
+*       Modification uses TM_NUMBER to determine if "value" is a number rather
+*       than the ERR= branch of a READ which fails on AIX/xlf
+
+*	Mod *jd* 11.30.95 to fix ragged symbols to to precision loss
+*
+*       Mod *kob* 1.28.97 - Reorganization of the original code to remove
+*			    an illegal (f90) fortran forward reference into
+*			    the middle of a do loop.  This change was 
+*		            necessary to get this routine to compile on linux
+*			    and also to fix a plotting bug with the new 
+*			    solaris version (v4.0) of f77.  This change has 
+*			    occurred in the middle of releasing v4.45 of 
+*		  	    Ferret to the world.  Aix, Sgi, HP, OSF and SunOs
+*			    have already been released, and this change is
+*		            not a part of them.  This change is needed
+*			    to release linux and more importantly solaris.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *ACM* 6/02   When there is a period or decimal point in the text, make
+C              a GKS dot there too, so it'll show up in small labels.
+C *acm* 7/02   Take out the MARKER calls that made dots. This caused trouble 
+C              when making encapsulated postscript from postscript.  
+C
+C	CALL SYMBEL(X,Y,DEGRES,HEIGHT,NCHAR,STRING)
+C
+C	THIS SUBROUTINE DRAWS A STRING OF CHARACTERS.
+C
+C	THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C	BELOW:
+C        X,Y    - COORDINATES OF THE LOWER LEFT-HAND CORNER OF
+C                 THE FIRST CHARACTER IN USERS UNITS.
+C        DEGRES - ANGLE AT WHICH THE CHARACTERS ARE TO BE DRAWN
+C                 IN DEGREES RELATIVE TO THE X-AXIS.
+C        HEIGHT - HEIGHT OF THE CHARACTERS IN INCHES (OR MM).
+C        NCHAR  - NUMBER OF CHARACTERS TO BE DRAWN.
+C        STRING - ARRAY CONTAINING THE DISPLAY CODES OF THE
+C                 CHARACTERS TO BE DRAWN.
+C
+	DIMENSION SX(12000),SY(12000),ASCII(127,4),BASE(4),RAST(4)
+	INTEGER	  nsxsy
+        PARAMETER ( nsxsy = 12000 )
+	DIMENSION DTYPE(35),DLEN(35),IOFF(4),IFLEN(4),ITYPE(4)
+C
+	LOGICAL SYMROT,READIR,DOPLOT,COLRF
+c	CHARACTER PLTFIL*80
+	CHARACTER ICOM*2,ICHR*1,STRING*(*),DNME(35)*2,DNUM(35)*2
+	CHARACTER DNAME(35)*80,KIF(4)*2,IFN(4)*2
+	CHARACTER*1 KSUB,KSUPER,KBKSP,KCALL,PENS(16)
+
+        REAL XBASE, YBASE
+        INTEGER IPT
+#ifdef unix
+	INTEGER*2 SX,SY
+
+        integer       dirlen
+        character*255 fontdir
+#else
+	byte sx,sy
+#endif
+	INTEGER*2 ICNT,IBASE,IRAST
+*added for linux port
+	INTEGER*4 IBASE4,IRAST4
+	INTEGER*2 ASCII
+	INTEGER*2 DTYPE,DLEN,IOFF,IFLEN,ITYPE
+	INTEGER COLOLD
+	LOGICAL ASCFNT
+	CHARACTER*265 err_msg
+	INTEGER status
+
+C
+C
+	INCLUDE 'PLTCOM.DAT'
+        INCLUDE 'errmsg.parm'
+
+C
+	DATA DNUM,DNME/35*'@@',35*'@@'/
+#ifdef unix
+	DATA KSUB,KSUPER,KBKSP,KCALL/'_','^','\\','@'/
+#else
+	DATA KSUB,KSUPER,KBKSP,KCALL/'_','^','\','@'/
+#endif
+	DATA KIF,IFN/'SR','SG','@@','@@','01','12','@@','@@'/
+	DATA PENS/'1','2','3','4','5','6','7','8','9','A',
+     *	'B','C','D','E','F','G'/
+	DATA READIR/.FALSE./
+
+        LOGICAL TM_NUMBER                ! ** TMAP mod 11/94 **
+
+* Mod to specify external references for SCALE and RANGE * Linux *kob* 1.97
+        external scale, size
+
+* Initialize 
+
+        ICHR = ' '
+
+C
+C	DEFINE THE SCALE FACTOR TO BE THE AMOUNT OF MAGNIFICATION
+C	REQUIRED TO CONVERT THE CHARACTERS IN THE CHARACTER DEFI-
+C	NITION TABLE TO THE SIZE SPECIFIED BY THE USER.
+C
+        CALL INQSCL(XSCL,YSCL,ABIAS,BBIAS,XLO,YLO) ! Bug fix? 11.95
+        CALL SCALE(XSCL,YSCL,ABIAS,BBIAS,0.,0.)
+
+	COLRF=.FALSE.
+C	IF(.NOT.READIR)GOTO 2020
+
+* kob 1/97 - old 2020 code region now contained w/in if-then below.
+	IF(.NOT.READIR) THEN
+#ifdef unix
+C *JD* Mod below fix for unix  -- use environment variable 3.19.91	
+	   call getenv ('PLOTFONTS',fontdir)
+       	   dirlen = lnblk (fontdir,255)
+
+C *kob* 1/02 - cygwin 1.3.x requires "\" for unix directory accesses
+#ifdef __CYGWIN__
+	   OPEN(LUSY,FILE=fontdir(:dirlen)//'\fondat.dat',
+     *	        STATUS='OLD')
+#else
+	   OPEN(LUSY,FILE=fontdir(:dirlen)//'/fondat.dat',
+     *	        STATUS='OLD',ERR=5000)
+#endif
+
+#else
+	   open(lusy,file='plotfonts:fondat.dat',readonly,
+     *	       status='old',err=5000)
+#endif
+C
+C	FILE EXISTS
+C
+	   READ(LUSY,983,END=1009)(DNUM(IJ),DNME(IJ),DTYPE(IJ),
+     *	   DLEN(IJ),DNAME(IJ),IJ=1,35)
+#ifdef unix
+C Mod here from A to A9 for read of DNAME *JD* 3.8.91
+C983	   FORMAT(1X,2A2,I2,I5,A)
+983	   FORMAT(1X,2A2,I2,I5,A9)
+#else
+983	   format(1x,2a2,i2,i5,a30)
+#endif
+1009	   NFNT=IJ-1
+    	   CLOSE(LUSY)
+C
+C	READ DEFAULT FONT
+C
+	   IOFF(1)=0
+	   II=1
+	   ID=1
+	   READIR = .TRUE.			
+	   call SETFONT(fontdir,dirlen,dname,ifont,ii,kif,dnme,
+     .               ifn,dnum,itype,dtype,iflen, dlen,ioff,
+     .               icnt,ascii,base,rast,iadd,
+     .		     sx,sy,id)
+	ENDIF
+
+2000	SYMSC = HEIGHT * FACTOR / 21.0
+C
+C	ROTATE THE CHARACTER STRING.
+C
+	IF(DEGRES .NE. 0.0)GO TO 10
+C
+C	RESET THE CHARACTER ROTATION FLAG.
+C
+	SYMROT = .FALSE.
+	GO TO 20
+C
+C	SET THE CHARACTER ROTATION FLAG.
+C
+10	SYMROT = .TRUE.
+C
+C	CONVERT THE ROTATION TO RADIANS.
+C
+	TEMP = 0.01745329251994 * DEGRES
+C
+C	COMPUTE THE SINE AND COSINE.
+C
+	SYMSIN = SIN(TEMP)
+	SYMCOS = COS(TEMP)
+C
+C	SET VECTORS MODE.
+C
+20	PMODE = VECTOR
+C
+C	START AT THE LOWER LEFT-HAND CORNER OF THE FIRST CHARACTER.
+C
+	IF(NCHAR .EQ. 0) GOTO 300 	! Mod 11.30, was RETURN
+	XTEMP = (X - XLO) * XSCALE	! was X * XSCALE
+	YTEMP = (Y - YLO) * YSCALE	! was Y * YSCALE
+	PENF = .FALSE.
+	DOPLOT=NCHAR.GT.0
+	IF(DOPLOT)CALL XYZPLT
+C
+C	INITIALIZE CONTROL VARIABLES.
+C
+	XORG = XTEMP
+	YORG = YTEMP
+	XREF = 0.0
+	YREF = 0.0
+	CHARSC = 1.0
+	WIDTH = 0.0
+	SLANT = 0.0
+	IFONT = 1
+	ASCFNT=ITYPE(1).EQ.-1
+	SYMWID=0.0
+	NCH=IABS(NCHAR)
+C
+C	DRAW THE CHARACTERS IN THE STRING ONE BY ONE.
+C
+	JJ=0
+	DO 170 I=1,NCH
+	JJ=JJ+1
+	IF(JJ.GT.NCH)GOTO 180
+	ICHR = STRING(JJ:JJ)
+C
+C	CHECK FOR A CONTROL CHARACTER.
+C
+	IF(ICHAR(ICHR) .EQ.27)THEN
+	    ASCFNT=.FALSE.
+	    GOTO 170
+	ENDIF
+	IF(ICHAR(ICHR) .EQ. 0)GOTO 180
+#ifdef unix
+	IF(.NOT.ASCFNT.AND.(ICHR.EQ.'@'.OR.
+     *		(ICHR.GE.'\\'.AND.ICHR.LE.'_')))GOTO 80
+#else
+	IF(.NOT.ASCFNT.AND.(ICHR.EQ.'@'.OR.
+     *		(ICHR.GE.'\'.AND.ICHR.LE.'_')))GOTO 80
+#endif
+C
+C	CALCULATE POINTER
+C
+	IF(ITYPE(IFONT).LE.0)THEN
+C	    CHARACTER FONT
+	    ICODE = ASCII(ICHAR(ICHR),IFONT)
+	ELSE
+C	    SYMBOL FONT
+	    ICOM = STRING(JJ:JJ+1)
+	    JJ=JJ+1
+	    READ(ICOM,999,IOSTAT=ISTAT)II
+999	    FORMAT(I2)
+	    IF(ISTAT.EQ.0)THEN
+	    	ICODE = ASCII(II,IFONT)
+	    ELSE
+	        ICODE = 1
+	    ENDIF
+	ENDIF
+	IPOINT = ICODE+IOFF(IFONT)
+	IPT = 0
+
+	XMN=SX(IPOINT)
+	XMX=SY(IPOINT)
+	IF(XMN.GT.50.)XMN=XMN-100.
+	IF(XMX.GT.50.)XMX=XMX-100.
+	WIDTH=(XMX-XMN)*CHARSC*RAST(IFONT)
+	SYMWID=SYMWID+WIDTH
+	IF(.NOT.DOPLOT)GOTO 70
+	IPOINT=IPOINT+1
+	IF (IPOINT .GT. NSXSY) GOTO 70
+	PENF = .FALSE.
+C
+C	DRAW THE CHARACTER
+C
+ 30	CONTINUE
+	IX=SX(IPOINT)
+	IY=SY(IPOINT)
+	IF(IX.GT.50)IX=IX-100
+	IF(IY.GT.50)IY=IY-100
+	IY=-IY
+	IPOINT=IPOINT+1
+	IF (IPOINT .GT. NSXSY) GOTO 70
+        IPT = IPT + 1
+C
+C	CHECK FOR A CONTROL BYTE.
+C
+	IF(IX .EQ. 50)GO TO 60
+C
+C	CALCULATE THE NEW PEN COORDINATES RELATIVE TO THE LOWER
+C	LEFT-HAND CORNER OF THE FIRST CHARACTER.
+C
+	XY=FLOAT(IY)-BASE(IFONT)
+	XX=FLOAT(IX)-XMN+XY*SLANT
+	XSYM =XREF+XX*CHARSC*RAST(IFONT)
+	YSYM =YREF+XY*CHARSC*RAST(IFONT)
+C
+C	SCALE AND ROTATE THE NEW COORDINATES.
+C
+	IF(SYMROT)GO TO 40
+
+	XTEMP = XSYM * SYMSC + XORG
+	YTEMP = YSYM * SYMSC + YORG
+	GO TO 50
+40	XTEMP = (XSYM * SYMCOS - YSYM * SYMSIN) * SYMSC + XORG
+	YTEMP = (XSYM * SYMSIN + YSYM * SYMCOS) * SYMSC + YORG
+50	CONTINUE
+
+* for decimal points, find the average x and Y location; will
+* plot a point at this location.
+C  xxx  
+C  xxx  Dont do this: it causes trouble with encapsulated postscript.
+C  xxx  and anyway, it was to correct trouble with the postscript translation
+C  xxx  for one printer...
+C  xxx
+C  xxx        IF (ICHR .EQ. '.') THEN
+C  xxx           IF (IPT .EQ. 1) THEN
+C  xxx             XBASE = 0.
+C  xxx             YBASE = 0.
+C  xxx           ENDIF
+C  xxx           XBASE = XBASE + XTEMP
+C  xxx           YBASE = YBASE + YTEMP
+C  xxx        ENDIF
+
+C
+C	MOVE THE PEN TO THE NEW COORDINATES.
+C
+
+        CALL XYZPLT
+
+	PENF = .TRUE.
+	GO TO 30
+C
+C	CHECK FOR THE END OF THE CHARACTER.
+C
+60	IF(IY .EQ. -50)GO TO 70
+	PENF = .FALSE.
+	GO TO 30
+
+70	CONTINUE
+
+C  End of character
+C xxx If it was a decimal point, draw a tiny dot at its center.  
+C  xxx
+C  xxx        IF (ICHR .EQ. '.' .AND. IPT .GT. 1) THEN
+C  xxx           XBASE = XBASE/ FLOAT(IPT-1)
+C  xxx           YBASE = YBASE/ FLOAT(IPT-1)
+C  xxx           XBASE = XBASE/ XSCALE
+C  xxx           YBASE = YBASE/ YSCALE
+C  xxx           call marker (1)              ! could call with 7 for bigger dot.
+C  xxx           CALL PLOT(XBASE, YBASE, 0, 0)
+C  xxx           CALL MARK(99)
+C  xxx           call marker (1)
+C  xxx        ENDIF
+C
+C	ADJUST THE REFERENCE POSITION TO TAKE INTO ACCOUNT THE
+C	CHARACTER THAT WAS JUST DRAWN.
+C
+
+        XREF = XREF + WIDTH
+	IF(CHARSC .EQ. 1.0)GO TO 169
+C	XREF = XREF - 16.*(1.-CHARSC)*RAST(IFONT)
+	YREF = 0.0
+	CHARSC = 1.0
+	GO TO 169
+C
+C	PROCESS CONTROL CHARACTERS.
+C
+80	IF(ICHR .NE. KSUB)GO TO 150
+	CHARSC = 0.75
+C	XREF = XREF + 16.*(1.-CHARSC)*RAST(IFONT)
+	YREF=-11.*CHARSC*RAST(IFONT)
+	GO TO 169
+150	IF(ICHR .NE. KSUPER)GO TO 160
+	CHARSC = 0.75
+C	XREF = XREF + 16.*(1.-CHARSC)*RAST(IFONT)
+	YREF=21.-11.*CHARSC*RAST(IFONT)
+	GO TO 169
+160	IF(ICHR .NE. KBKSP)GO TO 310
+	SYMWID=SYMWID-WIDTH
+	XREF = XREF - WIDTH
+	WIDTH = 0.0
+	GOTO 169
+310	IF(ICHR.NE.KCALL)GOTO 169
+C
+C	UNPACK COMMAND
+C
+	ICOM = STRING(JJ+1:JJ+2)
+	JJ=JJ+2
+C
+C	PROCESS COMMAND
+C
+	CALL UPPER(ICOM,2)
+	IF(ICOM.EQ.'CL')THEN
+C
+C	    CLEAR ALL FONTS FROM THE BUFFERS
+C
+	    DO 1002 II=1,4
+	    IOFF(II)=12000
+	    IFLEN(II)=0
+	    KIF(II)='@@'
+	    IFN(II)='@@'
+	    ITYPE(II)=0
+	    BASE(II)=-9.
+1002	    RAST(II)=1.
+	    IOFF(1)=0
+	    GOTO 169
+        ELSE IF(ICOM(1:1).EQ.'C')THEN
+C
+C           LOOK FOR EXTENDED COLOR COMMAND OF THE FORM
+C           @Cnnn WHERE nnn IS A 3 DIGIT NUMBER
+C
+            IF(.NOT.COLRF)COLOLD=COLOUR
+            COLRF=.TRUE.
+C
+C           SEE IF THE FIRST CHARACTER IS A NUMBER
+C
+            DO 2050 K=1,9
+                IF(ICOM(2:2).EQ.PENS(K))GOTO 2051
+2050        CONTINUE
+C
+C           NO NUMBER FOUND - MUST BE A FONT CHANGE COMMAND
+C
+            IF(ICOM(2:2).NE.'0')GOTO 2010
+2051        JJ=JJ+2
+C
+C           GET THE 3 DIGIT NUMBER
+C
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(STRING(JJ-2:JJ)) ) GOTO 169  
+!** TMAP mod 11/94 **
+#endif
+            READ(STRING(JJ-2:JJ),'(I3)',ERR=169)K
+            IF(.NOT.DOPLOT)GOTO 169
+            CALL COLOR(K)
+	ELSE IF(ICOM(1:1).EQ.'P')THEN
+C
+C	    CHANGE PEN/COLOR
+C
+	    IF(.NOT.DOPLOT)GOTO 169
+	    IF(.NOT.COLRF)COLOLD=COLOUR
+	    COLRF=.TRUE.
+	    DO 2030 K=1,16
+	    IF(ICOM(2:2).EQ.PENS(K))GOTO 2031
+2030	    CONTINUE
+	    IF(ICOM(2:2).NE.'0')GOTO 2010
+	    K=1
+2031	    CALL COLOR(K)
+	    GOTO 169
+	ELSE IF(ICOM(1:1).EQ.'Z')THEN
+	    DO 2040 K=1,16
+	    IF(ICOM(2:2).EQ.PENS(K))GOTO 2041
+2040	    CONTINUE
+	    IF(ICOM(2:2).NE.'0')GOTO 2010
+	    K=0
+2041	    SLANT=SIN(K*0.08726646)
+	    GOTO 169
+	ENDIF
+C	SEARCH FOR FONT BY NAME THEN BY NUMBER
+2010	DO 1003 K=1,4
+	IF(ICOM.EQ.KIF(K).OR.ICOM.EQ.IFN(K))GOTO 302
+1003	CONTINUE
+C	NOT FOUND SEARCH MAIN DIRECTORY
+	DO 1004 ID=1,NFNT
+	IF(ICOM.EQ.DNME(ID).OR.ICOM.EQ.DNUM(ID))GOTO 1001
+1004	CONTINUE
+C	FONT NOT FOUND USE LAST FONT
+	GOTO 169
+1001	ILEN=DLEN(ID)
+C
+C	FIND WHERE FONT WILL FIT
+C
+	DO 1005 II=4,1,-1
+	IF(ILEN+IOFF(II).LE.12000) THEN
+* *kob* 1/97 setfont call takes place of branch to old 1010
+	    call SETFONT(fontdir,dirlen,dname,ifont,ii,kif,dnme,
+     .               ifn,dnum,itype,dtype,iflen, dlen,ioff,
+     .               icnt,ascii,base,rast,iadd,
+     .		     sx,sy,id)
+	    goto 169
+	ENDIF
+1005	CONTINUE
+C
+C	ERROR IF NO ROOM ANYWHERE!
+C
+	GOTO 169
+c1006	IF(.NOT.NEWFIL)THEN
+c	    INQUIRE(UNIT=LUHP,NAME=PLTFIL)
+c	    CLOSE(LUHP)
+c	ENDIF
+
+
+
+c	IF(.NOT.NEWFIL)THEN
+c	    IF(PTYPE.EQ.0 .OR. PTYPE.EQ.2 .OR. PTYPE.EQ.4)THEN
+c		OPEN(LUHP,FILE=PLTFIL,FORM='UNFORMATTED',STATUS='OLD',
+c     *		ACCESS='APPEND')
+c	    ELSE
+c		OPEN(LUHP,FILE=PLTFIL,STATUS='OLD',ACCESS='APPEND')
+c	    ENDIF
+c	ENDIF
+C
+C	DONE
+C
+C	IF(READIR)GOTO 169
+C	READIR=.TRUE.
+C	GOTO 2000
+C
+C	READ DIRECTORY
+C
+
+302	IFONT=K
+169	ASCFNT=ITYPE(IFONT).EQ.-1
+170	CONTINUE
+180	IF(.NOT.DOPLOT)THEN
+	    X=SYMWID*HEIGHT/21.
+	    GOTO 300 ! Mod 11.30, was RETURN
+	END IF
+C
+C	SCALE AND ROTATE THE FINAL COORDINATES.
+C
+	IF(SYMROT)GO TO 190
+	XTEMP = XREF * SYMSC + XORG
+	YTEMP = YORG
+	GO TO 200
+190	XTEMP = XREF * SYMCOS * SYMSC + XORG
+	YTEMP = XREF * SYMSIN * SYMSC + YORG
+C
+C	PLOT TO THE END OF THE CHARACTER STRING.
+C
+200	PENF = .FALSE.
+	CALL XYZPLT
+C
+C	RESET COLOR
+C
+	IF(COLRF.AND.(COLOLD.NE.COLOUR))CALL COLOR(COLOLD)
+300     CALL SCALE(XSCL,YSCL,ABIAS,BBIAS,XLO,YLO) ! bug fix(?) 11.95
+
+	RETURN
+C
+ 5000   IF (dirlen .GT. 1) THEN
+	   CALL WARN ('Could not open font file. Check the Ferret environment.')
+	   err_msg = fontdir(:dirlen)//'/fondat.dat'
+	ELSE
+	   CALL WARN ('Fonts directory is undefined. Check the Ferret environment.')
+	   err_msg = 'fondat.dat'
+	ENDIF
+
+        CALL errmsg (ferr_file_not_found, status, err_msg, *5002)
+
+ 5002	STOP
+
+	END
+	FUNCTION SYMWID(HEIGHT,NCHAR,STRING)
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER STRING*(*)
+	NC=-IABS(NCHAR)
+C
+C	THIS FUNCTION RETURNS THE WIDTH OF THE STRING WITHOUT DRAWING IT
+C
+	SS=0.
+	CALL SYMBEL(SS,0.,0.,HEIGHT,NC,STRING)
+	SYMWID=SS
+	RETURN
+	END
+
diff --git a/ppl/complot/symbol.F b/ppl/complot/symbol.F
new file mode 100644
index 0000000..de94b9e
--- /dev/null
+++ b/ppl/complot/symbol.F
@@ -0,0 +1,351 @@
+      SUBROUTINE SYMBOL(X,Y,DEGRES,HEIGHT,NCHAR,STRING)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)symbol.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL SYMBOL(X,Y,DEGRES,HEIGHT,NCHAR,STRING)
+C
+C     THIS SUBROUTINE DRAWS A STRING OF CHARACTERS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X,Y    - COORDINATES OF THE LOWER LEFT-HAND CORNER OF
+C                 THE FIRST CHARACTER IN USER'S UNITS.
+C        DEGRES - ANGLE AT WHICH THE CHARACTERS ARE TO BE DRAWN
+C                 IN DEGREES RELATIVE TO THE X-AXIS.
+C        HEIGHT - HEIGHT OF THE CHARACTERS IN INCHES (OR MM).
+C        NCHAR  - NUMBER OF CHARACTERS TO BE DRAWN.
+C        STRING - ARRAY CONTAINING THE DISPLAY CODES OF THE
+C                 CHARACTERS TO BE DRAWN.
+C
+C     THE TABLES THAT ARE USED TO DEFINE THE SYMBOL CHARACTER SET
+C     ARE DESCRIBED BELOW:
+C        TAB    - THIS TABLE CONSISTS OF A SERIES OF 6-BIT CODES
+C                 WHICH CONTAIN THE ACTUAL CHARACTER DEFINITIONS.
+C                 WHEN A CODE IS DIVIDED BY 7, THE TRUNCATED QUO-
+C                 TIENT IS THE VERTICAL DISPLACEMENT FROM THE
+C                 REFERENCE POSITION AND THE REMAINDER IS THE
+C                 HORIZONTAL DISPLACEMENT.  A CODE OF 63 INDI-
+C                 CATES THAT THE PEN IS TO BE RAISED.
+C        PNTTAB - THIS TABLE CONTAINS POINTERS TO THE START OF
+C                 EACH OF THE CHARACTER DEFINITIONS AND OTHER
+C                 INFORMATION NEEDED TO DRAW THE CHARACTERS.
+C                    I = 4 * CHARACTER DISPLAY CODE + 1
+C                    PNTTAB(I) = WIDTH OF THE CHARACTER (BITS
+C                       1-3)
+C                              = VERTICAL REFERENCE TRANSLATION
+C                       (BITS 4-6)
+C                    PNTTAB(I+1) = NUMBER OF CODES REQUIRED TO
+C                       DEFINE THE CHARACTER.
+C                    PNTTAB(I+2)+PNTTAB(I+3) = POINTER TO THE
+C                       FIRST CHARACTER DEFINITION CODE.
+C
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+      LOGICAL SYMROT
+C
+C	RSX-11M
+C
+C	LOGICAL*1 STRING(120),ASCII(128),NUM(64)
+C
+C	END RSX-11M
+C
+C	VAX/VMS
+C
+	CHARACTER STRING*(*)
+	INTEGER*2 ASCII(128),NUM(64)
+C
+C	END VAX/VMS
+C
+	INTEGER*2 TAB(2,477),TAB1(528),TAB2(426)
+	INTEGER*2 IPNT(64),WDTH(64)
+
+C	LINUX PORT
+	integer*4	i4_wdth
+
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	EQUIVALENCE (TAB1(1),TAB(1,1)),(TAB2(1),TAB(1,265))
+C
+	DATA WDTH/5,9,9,9,9,9,9,9,9,7,9,9,9,9,
+     *	9,9,9,9,9,9,9,9,9,9,9,9,9,7,7,9,9,9,9,
+     *	9,9,9,9,9,9,9,7,6,6,9,9,9,5,5,6,5,5,9,
+     *	9,9,7,9,9,9,9,9,9,9,7,5/
+	DATA NUM/11,8,11,8,7,7,6,10,8,8,6,8,3,5,
+     *	6,9,7,12,11,12,5,6,5,5,9,6,6,9,6,9,11,4,
+     *	10,12,4,16,12,5,2,11,2,4,4,18,5,0,8,5,3,
+     *	4,4,22,7,6,12,11,6,6,3,3,6,6,2,14/
+	DATA IPNT/1,12,20,31,39,46,53,59,69,77,85,
+     *	91,99,102,107,113,122,129,141,152,164,169,
+     *	175,180,185,194,200,206,215,221,230,241,245,
+     *	255,267,271,287,299,304,306,317,319,323,327,
+     *	345,0,350,358,363,366,370,374,396,403,409,421,
+     *	432,438,444,447,450,456,462,464/
+	DATA ASCII/32*46,55,53,61,44,52,62,49,42,43,
+     *	40,38,47,39,48,41,28,29,30,31,32,33,34,35,
+     *	36,37,1,64,59,45,60,56,46,2,3,4,5,6,7,8,9,10,
+     *	11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
+     *	26,27,50,63,51,57,54,58,2,3,4,5,6,7,8,9,10,11,
+     *	12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,
+     *	27,6*46/
+     	 DATA TAB1/0,13,1,14,2,13,1,12,0,13,10,0,0,17,1,18,2,17,1,16,
+     *	0,17,0,0,0,5,3,8,6,5,6,0,10,0,0,3,6,3,5,4,6,3,6,1,5,0,0,0,0,8,
+     * 5,8,6,7,6,5,5,4,0,4,6,2,4,0,2,0,0,2,0,6,2,8,4,8,6,6,4,8,0,8,
+     *	0,0,4,0,6,2,6,6,4,8,0,4,4,4,10,0,6,8,0,8,0,0,6,0,0,4,4,4,
+     *	10,0,6,8,0,8,0,0,3,3,6,3,6,2,4,0,2,0,0,2,0,6,2,8,4,8,6,6,
+     *	0,0,0,8,10,0,0,4,6,4,10,0,6,8,6,0,0,0,4,0,10,0,2,0,2,8,10,0,
+     *	0,8,4,8,0,3,0,2,2,0,4,0,6,2,6,8,0,8,0,0,10,0,0,2,6,8,10,0,
+     *	2,4,6,0,0,8,0,0,6,0,0,0,0,8,3,2,6,8,6,0,0,0,0,8,1,8,5,0,
+     *	6,0,6,8,4,0,6,2,6,6,4,8,2,8,0,6,0,2,2,0,4,0,0,0,0,8,5,8,
+     *	6,7,6,5,5,4,0,4,4,0,6,2,6,6,4,8,2,8,0,6,0,2,2,0,4,0,10,0,
+     *	4,2,6,0,0,0,0,8,5,8,6,7,6,5,5,4,0,4,10,0,3,4,6,1,6,0,0,1,
+     *	1,0,5,0,6,1,6,3,5,4,1,4,0,5,0,7,1,8,5,8,6,7,3,0,3,8,10,0,
+     *	0,8,6,8,0,8,0,2,2,0,4,0,6,2,6,8,0,8,0,6,3,0,6,6,6,8,0,8,
+     *	0,0,3,3,6,0,6,8,0,8,0,7,6,1,6,0,10,0,0,0,0,1,6,7,6,8,0,8,
+     *	3,5,6,8,10,0,3,5,3,0,0,8,6,8,6,7,0,1,0,0,6,0,3,0,4,1,4,7,
+     *	3,8,1,8,0,7,0,1,1,0,3,0,0,6,2,8,2,0,10,0,0,0,4,0,0,6,0,7,
+     *	1,8,5,8,6,7,6,6,0,1,0,0,6,0,0,1,1,0,5,0,6,1,6,4,5,5,2,5,
+     *	10,0,3,5,6,8,0,8,5,0,5,8,0,3,6,3,0,1,1,0,5,0,6,1,6,4,5,5,
+     *	1,5,0,4,0,8,6,8,0,3,1,4,5,4,6,3,6,1,5,0,1,0,0,1,0,7,1,8/
+	DATA TAB2/
+     *	5,8,6,7,0,7,0,8,6,8,2,0,1,4,0,3,0,1,1,0,5,0,6,1,6,3,5,4,
+     *	1,4,0,5,0,7,1,8,5,8,6,7,6,5,5,4,0,1,1,0,5,0,6,1,6,7,5,8,
+     *	1,8,0,7,0,5,1,4,5,4,6,5,0,4,6,4,10,0,3,7,3,1,0,4,6,4,0,4,
+     *	6,4,10,0,3,7,3,1,10,0,1,2,5,6,10,0,1,6,5,2,0,0,4,8,2,0,0,2,
+     *	0,6,2,8,0,0,2,2,2,6,0,8,1,2,2,1,4,1,5,2,5,3,4,4,2,4,1,5,
+     *	1,6,2,7,4,7,5,6,10,0,4,8,4,0,10,0,2,0,2,8,0,2,6,2,10,0,0,5,
+     *	6,5,0,10,1,10,2,11,2,13,1,14,0,13,1,12,2,13,0,13,1,14,
+     *	2,13,1,12,0,13,1,9,2,9,1,7,2,0,0,0,0,8,2,8,
+     *	0,0,2,0,2,8,0,8,0,6,0,7,1,8,2,8,3,7,3,6,2,5,1,5,0,6,10,0,
+     *	0,1,6,7,10,0,6,2,6,1,5,0,4,0,3,1,3,2,4,3,5,3,6,2,1,9,2,9,
+     *	1,7,10,0,4,9,5,9,4,7,3,1,0,4,3,7,10,0,0,4,6,4,2,3,3,5,3,8,
+     *	1,8,1,5,2,3,10,0,2,2,3,1,2,0,1,1,2,2,1,6,3,8,5,6,3,4,3,3,
+     *	10,0,3,2,4,1,3,0,2,1,3,2,0,4,3,7,6,4,10,0,3,7,3,0,3,7,3,0,
+     *	3,0,0,3,3,0,6,3,6,1,0,4,6,7,0,7,6,4,0,1,0,0,6,0,10,0,6,1,
+     *	0,4,6,7,0,7,6,4,0,1,10,0,0,0,6,0,0,8,4,0,0,17,1,18,2,17,
+     *	1,16,0,17,10,0,0,10,1,10,2,11,2,13,1,14,0,13,1,12,2,13/
+C
+C     DEFINE THE SCALE FACTOR TO BE THE AMOUNT OF MAGNIFICATION
+C     REQUIRED TO CONVERT THE CHARACTERS IN THE CHARACTER DEFI-
+C     NITION TABLE TO THE SIZE SPECIFIED BY THE USER.
+C
+      SYMSC = HEIGHT * FACTOR / 8.0
+100	SYMROT = .FALSE.
+C
+C     ROTATE THE CHARACTER STRING.
+C
+      IF(DEGRES .NE. 0.0)THEN
+C
+C     SET THE CHARACTER ROTATION FLAG.
+C
+        SYMROT = .TRUE.
+C
+C     CONVERT THE ROTATION TO RADIANS.
+C
+        TEMP = 0.01745329251994 * DEGRES
+C
+C     COMPUTE THE SINE AND COSINE.
+C
+        SYMSIN = SIN(TEMP)
+        SYMCOS = COS(TEMP)
+      ENDIF
+C
+C     SET VECTORS MODE.
+C
+      PMODE = VECTOR
+C
+C     START AT THE LOWER LEFT-HAND CORNER OF THE FIRST CHARACTER.
+C
+      XTEMP = X * XSCALE
+      YTEMP = Y * YSCALE
+      PENF = .FALSE.
+      CALL XYZPLT
+      IF(NCHAR .LE. 0)RETURN
+      XORG = XTEMP
+      YORG = YTEMP
+      XREF = 0.0
+C
+C     DRAW THE CHARACTERS IN THE STRING ONE BY ONE.
+C
+      DO 20 I=1,NCHAR
+C
+C     COMPUTE THE POINTER TABLE INDEX.
+C
+C
+C     GET CONTROL INFORMATION FROM THE POINTER TABLE.
+C
+C
+C	RSX-11M
+C
+C	ICH=ASCII(STRING(I))
+C
+C	END RSX-11M
+C
+C	VAX/VMS
+C
+	ICH=ASCII(ICHAR(STRING(I:I)))
+C
+C	END VAX/VMS
+C
+	IPOINT=IPNT(ICH)-1
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*ORIG	WIDTH=FLOAT(WDTH(ICH)) -- LINUX PORT...
+	i4_wdth = wdth(ich)
+	WIDTH=FLOAT(i4_wdth)
+
+	NUMCRD=NUM(ICH)
+      IF(NUMCRD .NE. 0)THEN
+        PENF = .FALSE.
+C
+C     DRAW THE CHARACTER.
+C
+        DO 10 J=1,NUMCRD
+C
+C     GET A CHARACTER DEFINITION CODE FROM THE TABLE.
+C
+	ICHX=TAB(1,IPOINT+J)
+	ICHY=TAB(2,IPOINT+J)
+C
+C     CHECK FOR THE CHARACTER THAT INDICATES THE PEN IS TO BE
+C     RAISED.
+C
+        IF(ICHX .EQ. 10)THEN
+          PENF = .FALSE.
+        ELSE
+C
+C     CALCULATE THE NEW PEN COORDINATES RELATIVE TO THE LOWER
+C     LEFT-HAND CORNER OF THE FIRST CHARACTER.
+C
+          XSYM = XREF + FLOAT(ICHX)
+	IF(ICHY.GE.10)THEN
+	YSYM=FLOAT(ICHY-12)
+	ELSE
+	YSYM=FLOAT(ICHY)
+	ENDIF
+C
+C     SCALE AND ROTATE THE NEW COORDINATES.
+C
+          IF(SYMROT)THEN
+            XTEMP = (XSYM * SYMCOS - YSYM * SYMSIN) * SYMSC + XORG
+            YTEMP = (XSYM * SYMSIN + YSYM * SYMCOS) * SYMSC + YORG
+          ELSE
+            XTEMP = XSYM * SYMSC + XORG
+            YTEMP = YSYM * SYMSC + YORG
+          ENDIF
+C
+C     MOVE THE PEN TO THE NEW COORDINATES.
+C
+          CALL XYZPLT
+          PENF = .TRUE.
+        ENDIF
+   10   CONTINUE
+      ENDIF
+C
+C     ADJUST THE REFERENCE POSITION TO TAKE INTO ACCOUNT THE
+C     CHARACTER THAT WAS JUST DRAWN.
+C
+      XREF = XREF + WIDTH
+   20 CONTINUE
+C
+C     SCALE AND ROTATE THE FINAL COORDINATES.
+C
+      IF(SYMROT)THEN
+        XTEMP = XREF * SYMCOS * SYMSC + XORG
+        YTEMP = XREF * SYMSIN * SYMSC + YORG
+      ELSE
+        XTEMP = XREF * SYMSC + XORG
+        YTEMP = YORG
+      ENDIF
+C
+C     PLOT TO THE END OF THE CHARACTER STRING.
+C
+      PENF = .FALSE.
+      CALL XYZPLT
+      RETURN
+C
+	ENTRY SYMBL(X,Y,DEGRES,HEIGHT,NCHAR,STRING)
+	SYMSC=HEIGHT*YSCALE/8.0
+	GOTO 100
+      END
diff --git a/ppl/complot/tabmv.F b/ppl/complot/tabmv.F
new file mode 100644
index 0000000..00955c9
--- /dev/null
+++ b/ppl/complot/tabmv.F
@@ -0,0 +1,321 @@
+      SUBROUTINE TABMV
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)tabmv.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	INTEGER*4 ITA,ITB
+C
+C     CALL TABMV
+C
+C     THIS SUBROUTINE DRIVES THE TEKTRONIX GRAPHICS TERMINAL.  THE
+C     COORDINATES OF THE NEW POSITION ARE RECEIVED IN VARIABLES A
+C     AND B.
+C
+C
+#ifdef unix
+	INTEGER*2 DUMMY(4)
+#else
+	byte dummy(4)
+#endif
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	DATA DUMMY/32,96,32,64/
+C
+C     CONVERT THE POSITION TO A TEKTERMINAL ADDRESS.
+C
+      ITA = IFIX(A * PLTOTA)
+      ITB = IFIX(B * PLTOTB)
+C
+C     CHECK THE GRAPHICS FLAG.
+C
+        IF(GRAPHF)THEN
+C
+C     CHECK THE PEN POSITION.
+C
+          IF(.NOT. PEN)CALL CHOUT(GS,1)
+        ELSE
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+          IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)THEN
+C
+C     TRANSMIT THE 'PLOTTER ON' COMMAND TO THE TEKTRONIX PLOTTER.
+C
+            CALL CHOUT(TEKON,3)
+            OLDHTA = 0
+            OLDHTB = 0
+          ENDIF
+C
+C     SELECT VECTORS MODE.
+C
+          CALL CHOUT(GS,1)
+          LHIA = 0
+          LHIB = 0
+          LLOBA = 0
+C
+C     SET THE GRAPHICS FLAG.
+C
+          GRAPHF = .TRUE.
+C
+C     CHECK THE PEN POSITION.
+C
+          IF(PEN)THEN
+C
+C     PLOT A DARK LINE SEGMENT SO THAT THE NEXT LINE SEGMENT
+C     PLOTTED WILL BE BRIGHT.
+C
+            CALL CHOUT(DUMMY,4)
+          ENDIF
+        ENDIF
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+      IF(TTYPE .GT. 0 .AND. TTYPE .LT. 4014)THEN
+C
+C     CALCULATE THE HIGH-ORDER B-BYTE.  10 BIT CODES FOR TEK401X
+C
+#ifdef unix
+#ifdef sun
+	ihib=or(and(rshift(itb,5),31),32)
+#else
+# ifdef NEED_IAND
+	IHIB=IOR(IAND(ISHFT(ITB,-5),31),32)
+# else
+	IHIB=OR(AND(LSHIFT(ITB,-5),31),32)
+# endif
+#endif
+#else
+	IHIB=IOR(IAND(ISHFT(ITB,-5),31),32)
+#endif
+C
+C     IF NO CHANGE, DO NOT TRANSMIT IT.
+C
+        IF(IHIB .NE. LHIB)THEN
+          CALL CHOUT(IHIB,1)
+          LHIB = IHIB
+        ENDIF
+C
+C     TRANSMIT THE LOW-ORDER B-BYTE.
+C
+#ifdef unix
+# ifdef NEED_IAND
+	CALL CHOUT(IOR(IAND(ITB,31),96),1)
+# else
+	CALL CHOUT(OR(AND(ITB,31),96),1)
+# endif
+#else
+	CALL CHOUT(IOR(IAND(ITB,31),96),1)
+#endif
+C
+C     CALCULATE THE HIGH-ORDER A-BYTE.
+C
+#ifdef unix
+#ifdef sun
+	IHIA=OR(AND(rSHIFT(ITA,5),31),32)
+#else
+# ifdef NEED_IAND
+	IHIA=IOR(IAND(ISHFT(ITA,-5),31),32)
+# else
+	IHIA=OR(AND(LSHIFT(ITA,-5),31),32)
+# endif
+#endif
+#else
+	IHIA=IOR(IAND(ISHFT(ITA,-5),31),32)
+#endif
+C
+C     IF NO CHANGE, DO NOT TRANSMIT IT.
+C
+        IF(IHIA .NE. LHIA)THEN
+          CALL CHOUT(IHIA,1)
+          LHIA = IHIA
+        ENDIF
+C
+C     TRANSMIT THE LOW-ORDER A-BYTE.
+C
+#ifdef unix
+# ifdef NEED_IAND
+	CALL CHOUT(IOR(IAND(ITA,31),64),1)
+# else
+	CALL CHOUT(OR(AND(ITA,31),64),1)
+# endif
+#else
+	CALL CHOUT(IOR(IAND(ITA,31),64),1)
+#endif
+      ELSE
+        ICH = 3
+C
+C     CALCULATE THE HIGH-ORDER B-BYTE.    12 BIT CODES FOR TEK41XX
+C
+#ifdef unix
+#ifdef sun
+        IHIB = OR(AND(rSHIFT(ITB,7), 31), 32)
+#else
+# ifdef NEED_IAND
+        IHIB = IOR(IAND(ISHFT(ITB,-7), 31), 32)
+# else
+        IHIB = OR(AND(LSHIFT(ITB,-7), 31), 32)
+# endif
+#endif
+#else
+        IHIB = IOR(IAND(ISHFT(ITB,-7), 31), 32)
+#endif
+C
+C     IF NO CHANGE, DO NOT TRANSMIT IT.
+C
+        IF(IHIB .NE. LHIB)THEN
+          CALL CHOUT(IHIB,1)
+          LHIB = IHIB
+          ICH = ICH + 1
+        ENDIF
+C
+C     CALCULATE THE EXTRA BYTE.
+C
+#ifdef unix
+# ifdef NEED_IAND
+        ILOBA=IOR(IOR(ISHFT(IAND(ITB,3),2),IAND(ITA,3)),96)
+# else
+        ILOBA=OR(OR(LSHIFT(AND(ITB,3),2),AND(ITA,3)),96)
+# endif
+#else
+        ILOBA=IOR(IOR(ISHFT(IAND(ITB,3),2),IAND(ITA,3)),96)
+#endif
+C
+C     IF NO CHANGE, DO NOT TRANSMIT IT.
+C
+        IF(ILOBA .NE. LLOBA)THEN
+          CALL CHOUT(ILOBA,1)
+          LLOBA = ILOBA
+          ICH = ICH + 1
+        ENDIF
+C
+C     TRANSMIT THE LOW-ORDER B-BYTE.
+C
+#ifdef unix
+#ifdef sun
+        CALL CHOUT(OR(AND(rSHIFT(ITB,2), 31), 96),1)
+#else
+# ifdef NEED_IAND
+        CALL CHOUT(IOR(IAND(ISHFT(ITB,-2), 31), 96),1)
+# else
+        CALL CHOUT(OR(AND(LSHIFT(ITB,-2), 31), 96),1)
+# endif
+#endif
+#else
+        CALL CHOUT(IOR(IAND(ISHFT(ITB,-2), 31), 96),1)
+#endif
+C
+C     CALCULATE THE HIGH-ORDER A-BYTE.
+C
+#ifdef unix
+#ifdef sun
+        IHIA = OR(AND(rSHIFT(ITA,7), 31), 32)
+#else
+# ifdef NEED_IAND
+        IHIA = IOR(IAND(ISHFT(ITA,-7), 31), 32)
+# else
+        IHIA = OR(AND(LSHIFT(ITA,-7), 31), 32)
+# endif
+#endif
+#else
+        IHIA = IOR(IAND(ISHFT(ITA,-7), 31), 32)
+#endif
+C
+C     IF NO CHANGE, DO NOT TRANSMIT IT.
+C
+        IF(IHIA .NE. LHIA)THEN
+          CALL CHOUT(IHIA,1)
+          LHIA = IHIA
+          ICH = ICH + 1
+        ENDIF
+C
+C     TRANSMIT THE LOW-ORDER A-BYTE.
+C
+#ifdef unix
+#ifdef sun
+        CALL CHOUT(OR(AND(rSHIFT(ITA,2), 31), 64),1)
+#else
+# ifdef NEED_IAND
+        CALL CHOUT(IOR(IAND(ISHFT(ITA,-2), 31), 64),1)
+# else
+        CALL CHOUT(OR(AND(LSHIFT(ITA,-2), 31), 64),1)
+# endif
+#endif
+#else
+        CALL CHOUT(IOR(IAND(ISHFT(ITA,-2), 31), 64),1)
+#endif
+C
+C     CHECK THE TEKTERMINAL TYPE.
+C
+        IF(TTYPE .EQ. -4662 .OR. TTYPE .EQ. -4663)THEN
+C
+C     TRANSMIT SYNC CHARACTERS WHILE THE PLOTTER DRAWS THE VECTOR.
+C
+          DA = TWIDTH * FLOAT(ITA - OLDHTA) / TSCLA
+          DB = THIGHT * FLOAT(ITB - OLDHTB) / TSCLB
+          OLDHTA = ITA
+          OLDHTB = ITB
+C
+C     NOMINAL VECTOR DRAWING TIMES FOR THE TEKTRONIX PLOTTER CAN
+C     BE DETERMINED AS FOLLOWS:
+C        T (IN MSEC) = 61.44 * L (IN INCHES) + 84.93
+C
+          NDELAY = IFIX((0.006144 * SQRT(DA * DA + DB * DB) +
+     *     0.0050958) * FLOAT(BAUDR))
+          IF(NDELAY .GE. ICH)THEN
+            DO 10 J=ICH,NDELAY
+   10       CALL CHOUT(SYN,1)
+          ENDIF
+        ENDIF
+      ENDIF
+      RETURN
+C
+      END
+
+
+
+
diff --git a/ppl/complot/teklun.F b/ppl/complot/teklun.F
new file mode 100644
index 0000000..d901fb5
--- /dev/null
+++ b/ppl/complot/teklun.F
@@ -0,0 +1,59 @@
+	SUBROUTINE TEKLUN(LUN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)teklun.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	CHANGE LUN OF TEK TERMINAL PLOT  DO NOT CHANGE WHILE PLOT
+C	IS IN PROGRESS!!!!!
+C	D. DENBO JUNE 1983
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	LUTK=LUN
+	RETURN
+	END
diff --git a/ppl/complot/teknme.F b/ppl/complot/teknme.F
new file mode 100644
index 0000000..5d3412c
--- /dev/null
+++ b/ppl/complot/teknme.F
@@ -0,0 +1,59 @@
+	SUBROUTINE TEKNME(NME)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)teknme.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER NME*(*)
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	IF(TEKOPN)CLOSE(LUTK)
+	TEKOPN=.FALSE.
+	FILET=NME
+	RETURN
+	END
diff --git a/ppl/complot/tekpaus.F b/ppl/complot/tekpaus.F
new file mode 100644
index 0000000..d6f2696
--- /dev/null
+++ b/ppl/complot/tekpaus.F
@@ -0,0 +1,83 @@
+      SUBROUTINE TEKPAS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)tekpaus.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL TEKPAS
+C
+C     THIS SUBROUTINE SETS ALPHAS MODE AND SUSPENDS EXECUTION
+C     TO ALLOW THE USER TO INSPECT THE PLOTTED OUTPUT.  EXECU-
+C     TION RESUMES WHEN A CHARACTER IS ENTERED FROM THE KEY-
+C     BOARD.  THIS CHARACTER IS DISCARDED.  ON THE HP PLOTTER,
+C     IN ADDITION TO SETTING ALPHAS MODE, TEKPAS TERMINATES
+C     THE CURRENT PLOT AND SENDS FURTHER OUTPUT TO THE TERMINAL.
+C     TEKPAS HAS NO EFFECT ON THE ZETA AND GERBER PLOTTERS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CHECK THE PLOT TYPE.
+C
+      IF(PTYPE .EQ. 1 .OR. IABS(PTYPE) .GE. 2)THEN
+C
+C     PAUSE UNTIL THE USER RESPONDS.
+C
+        CALL PAGE
+        CALL CHOUT(BEL,1)
+        CALL CHOUT(BEL,1)
+	CALL CHDMP
+        CALL CHIN(IN,1,0)
+      ENDIF
+C
+C     SET ALPHAS MODE.
+C
+      CALL ALPHAS
+      RETURN
+C
+      END
diff --git a/ppl/complot/tform.F b/ppl/complot/tform.F
new file mode 100644
index 0000000..747b732
--- /dev/null
+++ b/ppl/complot/tform.F
@@ -0,0 +1,125 @@
+      SUBROUTINE TFORM(X,Y,Z)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)tform.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL TFORM(X,Y,Z)
+C
+C     THIS SUBROUTINE TRANSFORMS THE COORDINATES OF A POINT
+C     FROM THE USER'S COORDINATE SYSTEM TO THE SCREEN COOR-
+C     DINATE SYSTEM.  PERSPECTIVE IS APPLIED IF APPROPRIATE.
+C
+C
+#ifdef unix
+      include 'PLTCOM.DAT'
+#else
+      include 'pplinc:PLTCOM.DAT'
+#endif
+      REAL*8 PERSPC
+C
+C     CHECK THE VIEW FLAG.
+C
+      IF(VIEWF)THEN
+C
+C     TRANSFORM THE POINT.
+C
+        ATEMP = X * TAX + Y * TAY + Z * TAZ - AREF
+        BTEMP = X * TBX + Y * TBY + Z * TBZ - BREF
+        COLD = X * TCX + Y * TCY + Z * TCZ - CREF
+C
+C     IF APPROPRIATE, APPLY PERSPECTIVE TO THE POINT.
+C
+        IF(VDIST .NE. 0.0)THEN
+          PERSPC = (VDIST - COLD) / VDIST
+          IF(PERSPC .EQ. 0.0)THEN
+            ATEMP = 0.0
+            BTEMP = 0.0
+          ELSE
+            ATEMP = ATEMP / PERSPC
+            BTEMP = BTEMP / PERSPC
+          ENDIF
+        ENDIF
+C
+C     CHECK THE ROTATION FLAG.
+C
+        IF(ROTAT)THEN
+C
+C     ROTATE AND TRANSLATE THE POINT.
+C
+          ANEW = ATEMP * ROTCOS - BTEMP * ROTSIN + AORIGN
+          BNEW = ATEMP * ROTSIN + BTEMP * ROTCOS + BORIGN
+        ELSE
+C
+C     TRANSLATE BUT DO NOT ROTATE THE POINT.
+C
+          ANEW = ATEMP + AORIGN
+          BNEW = BTEMP + BORIGN
+        ENDIF
+      ELSE
+C
+C     CHECK THE ROTATION FLAG.
+C
+        IF(ROTAT)THEN
+C
+C     ROTATE AND TRANSLATE THE POINT.
+C
+          ANEW = X * ROTCOS - Y * ROTSIN + AORIGN
+          BNEW = X * ROTSIN + Y * ROTCOS + BORIGN
+        ELSE
+C
+C     TRANSLATE BUT DO NOT ROTATE THE POINT.
+C
+          ANEW = X + AORIGN
+          BNEW = Y + BORIGN
+        ENDIF
+      ENDIF
+C
+C     CHECK THE MIRROR-IMAGE FLAGS.
+C
+      IF(MIRAF)ANEW = ASIZE - ANEW
+      IF(MIRBF)BNEW = BSIZE - BNEW
+      RETURN
+C
+      END
diff --git a/ppl/complot/tformi.F b/ppl/complot/tformi.F
new file mode 100644
index 0000000..fcf6387
--- /dev/null
+++ b/ppl/complot/tformi.F
@@ -0,0 +1,130 @@
+      SUBROUTINE TFORMI(X,Y,Z)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)tformi.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL TFORMI(X,Y,Z)
+C
+C     THIS SUBROUTINE TRANSFORMS THE COORDINATES OF A POINT
+C     FROM THE SCREEN COORDINATE SYSTEM TO THE USER'S COOR-
+C     DINATE SYSTEM.  PERSPECTIVE IS REMOVED IF APPROPRIATE.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+      REAL*8 PERSPC
+C
+      AROT = AOLD
+      BROT = BOLD
+C
+C     CHECK THE MIRROR-IMAGE FLAGS.
+C
+      IF(MIRAF)AROT = ASIZE - AROT
+      IF(MIRBF)BROT = BSIZE - BROT
+C
+C     CHECK THE VIEW FLAG.
+C
+      IF(VIEWF)THEN
+C
+C     CHECK THE ROTATION FLAG.
+C
+        IF(ROTAT)THEN
+C
+C     REVERSE TRANSLATE AND REVERSE ROTATE THE POINT.
+C
+          AROT = AROT - AORIGN
+          BROT = BROT - BORIGN
+          ATEMP = AROT * ROTCOS + BROT * ROTSIN
+          BTEMP = -AROT * ROTSIN + BROT * ROTCOS
+        ELSE
+C
+C     REVERSE TRANSLATE BUT DO NOT REVERSE ROTATE THE POINT.
+C
+          ATEMP = AROT - AORIGN
+          BTEMP = BROT - BORIGN
+        ENDIF
+C
+C     IF APPROPRIATE, REMOVE PERSPECTIVE FROM THE POINT.
+C
+        IF(VDIST .NE. 0.0)THEN
+          PERSPC = (VDIST - COLD) / VDIST
+          ATEMP = ATEMP * PERSPC
+          BTEMP = BTEMP * PERSPC
+        ENDIF
+C
+C     REVERSE TRANSFORM THE POINT.
+C
+        ATEMP = ATEMP + AREF
+        BTEMP = BTEMP + BREF
+        CTEMP = COLD + CREF
+        X = ATEMP * TAX + BTEMP * TBX + CTEMP * TCX
+        Y = ATEMP * TAY + BTEMP * TBY + CTEMP * TCY
+        Z = ATEMP * TAZ + BTEMP * TBZ + CTEMP * TCZ
+      ELSE
+C
+C     CHECK THE ROTATION FLAG.
+C
+        IF(ROTAT)THEN
+C
+C     REVERSE TRANSLATE AND REVERSE ROTATE THE POINT.
+C
+          AROT = AROT - AORIGN
+          BROT = BROT - BORIGN
+          X = AROT * ROTCOS + BROT * ROTSIN
+          Y = -AROT * ROTSIN + BROT * ROTCOS
+        ELSE
+C
+C     REVERSE TRANSLATE BUT DO NOT REVERSE ROTATE THE POINT.
+C
+          X = AROT - AORIGN
+          Y = BROT - BORIGN
+        ENDIF
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/tktype.F b/ppl/complot/tktype.F
new file mode 100644
index 0000000..cf990ba
--- /dev/null
+++ b/ppl/complot/tktype.F
@@ -0,0 +1,117 @@
+      SUBROUTINE TKTYPE(ICODE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)tktype.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL TKTYPE(ICODE)
+C
+C     COMPLOT ASSUMES THAT A TEKTERMINAL IS A 4010.  IF A DIF-
+C     FERENT TYPE OF TEKTRONIX GRAPHICS TERMINAL IS USED INSTEAD,
+C     THIS SUBROUTINE MUST BE CALLED TO MAKE THE APPROPRIATE
+C     CHANGES TO CONTROL INFORMATION.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     CHECK THE TEKTERMINAL MODEL.
+C
+	TTYPE=ICODE
+C
+      IF(ICODE .EQ. 4010)GO TO 40
+      IF(ICODE .EQ. 4014)GO TO 50
+      IF(ICODE .EQ. 4107)GO TO 50
+      IF(ICODE .EQ. 4115)GO TO 50
+      IF(ICODE .EQ. 4051)GO TO 70
+      IF(ICODE .EQ. 4052)GO TO 70
+      IF(ICODE .EQ. 4662)GO TO 170
+      RETURN
+C
+C     CHANGE CONTROL INFORMATION.
+C
+   40 TWIDTH = 7.5
+      THIGHT = 5.625
+      TSCLA = 1023.0
+      TSCLB = 779.0
+      GO TO 250
+C
+C     CHANGE CONTROL INFORMATION.
+C
+   50 TWIDTH = 7.8448
+      THIGHT = 6.0
+      TSCLA = 4095.0
+      TSCLB = 3132.0
+      GO TO 250
+C
+C     CHANGE CONTROL INFORMATION.
+C
+   70 TWIDTH = 7.875
+      THIGHT = 6.0
+      TSCLA = 1023.0
+      TSCLB = 779.0
+      GO TO 250
+  170 IDTK = 67
+      TTYPE = -4662
+C
+C     CHANGE CONTROL INFORMATION.
+C
+      TWIDTH = 15.0
+      THIGHT = 10.0
+      TSCLA = 4095.0
+      TSCLB = 2731.0
+  250 FACTOR = 1000.0
+C
+C     DEFINE THE DEFAULT DIMENSIONS OF THE PLOTTING AREA.
+C
+c
+c	keep from resizing the display
+c
+c      CALL SIZE(TWIDTH,THIGHT)
+      RETURN
+C
+      END
diff --git a/ppl/complot/vectors.F b/ppl/complot/vectors.F
new file mode 100644
index 0000000..cfd5764
--- /dev/null
+++ b/ppl/complot/vectors.F
@@ -0,0 +1,66 @@
+      SUBROUTINE VECTRS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)vectors.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL VECTRS
+C
+C     THIS SUBROUTINE CAUSES ALL SUBSEQUENT PLOTTING THAT IS
+C     DONE WITH THE PEN DOWN TO BE IN THE FORM OF SMOOTH LINES
+C     CONNECTING EACH OF THE SPECIFIED COORDINATES.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SET THE PLOTTING MODE.
+C
+      PMODE = VECTOR
+      RETURN
+C
+      END
diff --git a/ppl/complot/view3.F b/ppl/complot/view3.F
new file mode 100644
index 0000000..ea623d5
--- /dev/null
+++ b/ppl/complot/view3.F
@@ -0,0 +1,140 @@
+      SUBROUTINE VIEW3(XREF,YREF,ZREF,XDIR,YDIR,ZDIR,DIST)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)view3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL VIEW3(XREF,YREF,ZREF,XDIR,YDIR,ZDIR,DIST)
+C
+C     THIS SUBROUTINE ESTABLISHES CONTROL INFORMATION FOR THREE-
+C     DIMENSIONAL PROJECTIONS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XREF   - X-COORDINATE OF THE REFERENCE POINT FOR THE
+C                 PROJECTION IN USER'S UNITS.
+C        YREF   - Y-COORDINATE OF THE REFERENCE POINT FOR THE
+C                 PROJECTION IN USER'S UNITS.
+C        ZREF   - Z-COORDINATE OF THE REFERENCE POINT FOR THE
+C                 PROJECTION IN USER'S UNITS.
+C        XDIR   - X-DIRECTION NUMBER OF THE VIEWING DIRECTION
+C                 IN USER'S UNITS.
+C        YDIR   - Y-DIRECTION NUMBER OF THE VIEWING DIRECTION
+C                 IN USER'S UNITS.
+C        ZDIR   - Z-DIRECTION NUMBER OF THE VIEWING DIRECTION
+C                 IN USER'S UNITS.
+C        DIST   - DISTANCE IN THE VIEWING DIRECTION FROM THE
+C                 CENTER OF PROJECTION TO THE REFERENCE POINT
+C                 IN INCHES (OR MM).
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+      IF(XDIR .NE. 0.0 .OR. YDIR .NE. 0.0 .OR. ZDIR .NE. 0.0)
+     * THEN
+C
+C     SET THE VIEW FLAG.
+C
+        VIEWF = .TRUE.
+C
+C     SCALE THE DIRECTION NUMBERS.
+C
+        XABS = XDIR * XSCALE
+        YABS = YDIR * YSCALE
+        ZABS = ZDIR * ZSCALE
+C
+C     COMPUTE THE SINE AND COSINE OF THE ANGLES OF ROTATION.
+C
+        DISTA = SQRT(XABS * XABS + YABS * YABS + ZABS * ZABS)
+        DISTB = SQRT(XABS * XABS + ZABS * ZABS)
+        SINA = YABS / DISTA
+        COSA = DISTB / DISTA
+        IF(DISTB .EQ. 0.0)THEN
+          SINB = 0.0
+          COSB = 1.0
+        ELSE
+          SINB = XABS / DISTB
+          COSB = ZABS / DISTB
+        ENDIF
+C
+C     COMPUTE THE ELEMENTS OF THE TRANSFORMATION MATRIX.
+C
+        TAX = COSB
+        TAY = 0.0
+        TAZ = -SINB
+        TBX = -SINA * SINB
+        TBY = COSA
+        TBZ = -SINA * COSB
+        TCX = COSA * SINB
+        TCY = SINA
+        TCZ = COSA * COSB
+C
+C     SCALE THE REFERENCE POINT.
+C
+        XABS = XREF * XSCALE
+        YABS = YREF * YSCALE
+        ZABS = ZREF * ZSCALE
+C
+C     TRANSFORM THE REFERENCE POINT.
+C
+        AREF = XABS * TAX + YABS * TAY + ZABS * TAZ
+        BREF = XABS * TBX + YABS * TBY + ZABS * TBZ
+        CREF = XABS * TCX + YABS * TCY + ZABS * TCZ
+C
+C     CONVERT THE VIEW DISTANCE TO INTERNAL INCREMENTS.
+C
+        VDIST = FACTOR * DIST
+      ELSE
+C
+C     RESET THE VIEW FLAG.
+C
+        VIEWF = .FALSE.
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/window.F b/ppl/complot/window.F
new file mode 100644
index 0000000..7d2944f
--- /dev/null
+++ b/ppl/complot/window.F
@@ -0,0 +1,117 @@
+      SUBROUTINE WINDOW(XALOW,YALOW,XAHIGH,YAHIGH)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)window.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL WINDOW(XLOW,YLOW,XHIGH,YHIGH)
+C
+C     THIS SUBROUTINE DEFINES A PLOTTING AREA THAT HAS DIFFERENT
+C     BOUNDARIES THAN THE COMPLETE DISPLAY DEFINED BY SIZE.  AF-
+C     TER A CALL TO THIS SUBROUTINE, ALL SUBSEQUENT PLOTTING MUST
+C     LIE WITHIN BOTH SETS OF BOUNDARIES IN ORDER TO BE VISIBLE.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XLOW   - MINIMUM X-VALUE TO BE PLOTTED IN USER'S UNITS.
+C        YLOW   - MINIMUM Y-VALUE TO BE PLOTTED IN USER'S UNITS.
+C        XHIGH  - MAXIMUM X-VALUE TO BE PLOTTED IN USER'S UNITS.
+C        YHIGH  - MAXIMUM Y-VALUE TO BE PLOTTED IN USER'S UNITS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     TRANSFER THE PARAMETERS TO NEW VARIABLES.
+C
+      XLOW = XALOW
+      XHIGH = XAHIGH
+      YLOW = YALOW
+      YHIGH = YAHIGH
+      IF(XHIGH .NE. XLOW .AND. YHIGH .NE. YLOW)THEN
+C
+C     SET THE WINDOW FLAG.
+C
+        WINDOF = .TRUE.
+C
+C     SET THE MINIMUM AND MAXIMUM ALLOWABLE VALUES OF X AND Y.
+C
+        XMIN = XLOW * XSCALE
+        YMIN = YLOW * YSCALE
+        XMAX = XHIGH * XSCALE
+        YMAX = YHIGH * YSCALE
+C
+C     CHECK THE PARAMETERS TO MAKE SURE THAT THEY ARE VALID.
+C
+        IF(XMIN .GT. XMAX)THEN
+          TEMP = XMIN
+          XMIN = XMAX
+          XMAX = TEMP
+        ENDIF
+        IF(YMIN .GT. YMAX)THEN
+          TEMP = YMIN
+          YMIN = YMAX
+          YMAX = TEMP
+        ENDIF
+C
+C     CALCULATE THE OFF-WINDOW FLAG.
+C
+        LOWFLG = 0
+        IF(XOLD .GT. XMAX)LOWFLG = 1
+        IF(XOLD .LT. XMIN)LOWFLG = 2
+        IF(YOLD .GT. YMAX)LOWFLG = LOWFLG + 4
+        IF(YOLD .LT. YMIN)LOWFLG = LOWFLG + 8
+      ELSE
+C
+C     RESET THE WINDOW FLAG.
+C
+        WINDOF = .FALSE.
+        OWFLG = 0
+      ENDIF
+      RETURN
+C
+      END
diff --git a/ppl/complot/xyzplt.F b/ppl/complot/xyzplt.F
new file mode 100644
index 0000000..a6ad633
--- /dev/null
+++ b/ppl/complot/xyzplt.F
@@ -0,0 +1,394 @@
+      SUBROUTINE XYZPLT
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+****************************************************************
+C revised for FERRET
+C from PPLUS :
+C	Directory PMEL:[PLOT5.LIBRARY.COMPLOT]
+C	ABPLT.FOR;2               9   5-FEB-1985 11:33 
+C search for "FERRET" to find all revisions
+C *sh* 9/19/88 - rev 1.0 for FERRET 1.10+
+C	- if GKS (ptype>2) then bypass clipping at screen limits
+C !!! ALSO :  Routine overflows subscripts at label 70
+C	      70 XINTER = XMXMN(IAND(LOWFLG,3))
+C	      logic to deal with a pair of points whose connecting segment
+C		crosses the corner of the window is wrong
+C	      ...bounds checking is OFF to match Denbo's compile stmt
+C *acm* 10/11 Fix ticket 1545. Further fix for the case where the connecting 
+C             segment does not cross the corner, but e.g. one point is to the 
+C             left of the plot and the other above. See examples in ticket 
+C             1545. In this case at label 70, XINTER is set to zero, and that 
+C             value is used in computing YINTR and ZINTR. Once XYINTR is
+C             set to the xmin or xmax, then need to call TRANS again and
+C             define values before ABPLT is called.
+****************************************************************
+C     CALL XYZPLT
+
+C     THIS SUBROUTINE PERFORMS WINDOW CLIPPING IAND THEN MOVES THE
+C     PEN FROM THE CURRENT POSITION TO A NEW POINT.
+
+
+
+******************************************************************
+C FERRET mod - for explicit declarations - 9-19-88
+C      DIMENSION XMXMN(2),YMXMN(2)
+      REAL XMXMN(2),YMXMN(2)
+      EQUIVALENCE (XMXMN(1),XMAX),(YMXMN(1),YMAX)
+      REAL xinter, yinter, zinter, dx, dy, dz, cosx, cosy, cosz, dist
+
+      include 'pltcom_dat.decl'
+      include 'PLTCOM.DAT'
+
+C end of FERRET mod
+******************************************************************
+C     CHECK THE PLOTTING MODE.
+
+      IF(PMODE .EQ. ALPHA)GO TO 30
+
+C     CHECK THE PEN POSITION.
+
+      IF(PENF)GO TO 10
+
+C     TEMPORARILY STORE THE NEW POSITION.
+
+      XNEW = XTEMP
+      YNEW = YTEMP
+      ZNEW = ZTEMP
+      SAVEF = .TRUE.
+      RETURN
+
+C     CHECK THE PLOTTING MODE.
+
+  10  IF(PMODE .NE. POINT)GO TO 20
+      XNEW = XTEMP
+      YNEW = YTEMP
+      ZNEW = ZTEMP
+      GO TO 30
+
+C     IF THE LAST POINT WAS NOT PLOTTED BECAUSE THE PEN WAS UP,
+C     PLOT THE POINT NOW.
+
+  20  IF(.NOT. SAVEF)GO TO 60
+      PENF = .FALSE.
+  30  IF(.NOT. WINDOF)GO TO 40
+
+C     CALCULATE THE NEW OFF-WINDOW FLAG.
+
+      OWFLG = 0
+      IF(XNEW .GT. XMAX)OWFLG = 1
+      IF(XNEW .LT. XMIN)OWFLG = 2
+      IF(YNEW .GT. YMAX)OWFLG = OWFLG + 4
+      IF(YNEW .LT. YMIN)OWFLG = OWFLG + 8
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, DO NOT PLOT IT.
+
+      IF(OWFLG .NE. 0)GO TO 50
+
+C     TRANSFORM THE POINT TO THE SCREEN COORDINATE SYSTEM.
+
+  40  CALL TFORM(XNEW,YNEW,ZNEW)
+
+C     PLOT TO THE POINT.
+
+      CALL ABPLT
+
+C     MOVE THE COORDINATES OF THE NEW POINT TO THE OLD POINT.
+
+  50  XOLD = XNEW
+      YOLD = YNEW
+      ZOLD = ZNEW
+      LOWFLG = OWFLG
+      SAVEF = .FALSE.
+
+C     CHECK THE PLOTTING MODE.
+
+      IF(PMODE .EQ. POINT .OR. PMODE .EQ. ALPHA)RETURN
+      PENF = .TRUE.
+      IF(PMODE .NE. DASH)GO TO 60
+
+C     REINITIALIZE THE SEGMENT COUNTER.
+
+      IDSEG = 1
+      SEG = DSEG(1)
+  60  XNEW = XTEMP
+      YNEW = YTEMP
+      ZNEW = ZTEMP
+      IF(.NOT. WINDOF)GO TO 120
+
+C     CALCULATE THE NEW OFF-WINDOW FLAG.
+
+      OWFLG = 0
+      IF(XNEW .GT. XMAX)OWFLG = 1
+      IF(XNEW .LT. XMIN)OWFLG = 2
+      IF(YNEW .GT. YMAX)OWFLG = OWFLG + 4
+      IF(YNEW .LT. YMIN)OWFLG = OWFLG + 8
+
+C     CHECK THE OLD AND NEW POINTS TO SEE IF THEY ARE BOTH OUT-
+C     SIDE THE BOUNDARY OF THE WINDOW IN THE SAME DIRECTION.  IF
+C     SO, NO INTERCEPT EXISTS.
+
+# ifdef NEED_IAND
+       IF(IAND(LOWFLG,OWFLG) .NE. 0)GOTO 190
+# else
+       IF(AND(LOWFLG,OWFLG) .NE. 0)GOTO 190
+# endif
+
+C     CHECK THE OLD POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, COMPUTE THE INTERCEPT.
+
+      IF(LOWFLG .EQ. 0)GO TO 90
+
+C     CHECK THE HORIZONTAL LIMITS OF THE WINDOW.
+
+# ifdef NEED_IAND
+      IF(ISHFT(LOWFLG,-2) .EQ. 0)GO TO 70
+# else
+      IF(rSHIFT(LOWFLG,2) .EQ. 0)GO TO 70
+# endif
+
+C     THE POINT IS OUTSIDE THE HORIZONTAL LIMITS OF THE WINDOW.
+C     CALCULATE THE INTERCEPT.
+
+# ifdef NEED_IAND
+      YINTER = YMXMN(ISHFT(LOWFLG,-2))
+# else
+      YINTER = YMXMN(rSHIFT(LOWFLG,2))
+# endif
+
+      ZINTER = (ZNEW - ZOLD) * (YINTER - YOLD) / (YNEW - YOLD) +
+     * ZOLD
+      XINTER = (XNEW - XOLD) * (YINTER - YOLD) / (YNEW - YOLD) +
+     * XOLD
+
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE WINDOW
+
+      IF(XINTER + 0.001 .GE. XMIN .AND. XINTER - 0.001 .LE. XMAX)
+     * GOTO 80
+
+C     THE POINT IS OUTSIDE THE VERTICAL LIMITS OF THE WINDOW.
+C     CALCULATE THE INTERCEPT.
+
+      irecompute = 0
+# ifdef NEED_IAND
+ 70   XINTER = XMXMN(IAND(LOWFLG,3))
+      IF (IAND(LOWFLG,3) .LT.1 .OR. IAND(LOWFLG,3).GT.2) irecompute = 1
+# else
+ 70   XINTER = XMXMN(AND(LOWFLG,3))
+      IF (AND(LOWFLG,3) .LT.1 .OR. AND(LOWFLG,3).GT.2) irecompute = 1
+# endif
+
+      YINTER = (YNEW - YOLD) * (XINTER - XOLD) / (XNEW - XOLD) +
+     * YOLD
+      ZINTER = (ZNEW - ZOLD) * (XINTER - XOLD) / (XNEW - XOLD) +
+     * ZOLD
+
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE WINDOW.
+
+      IF(YINTER + 0.001 .LT. YMIN .OR. YINTER - 0.001 .GT. YMAX)
+     * GO TO 190
+
+C     TRANSFORM THE INTERCEPT TO THE SCREEN COORDINATE SYSTEM.
+
+  80  CALL TFORM(XINTER,YINTER,ZINTER)
+      XOLD = XINTER
+      YOLD = YINTER
+      ZOLD = ZINTER
+      AOLD = ANEW
+      BOLD = BNEW 
+
+C     CALCULATE THE OLD OFF-SCREEN FLAG.
+
+C     LOSFLG = 0
+******************************************************************
+C FERRET mod - bypass GKS clipping - 9-19-88
+      IF ( ptype .LT. 3 ) THEN
+          IF(AOLD - 0.001 .GT. AMAX)LOSFLG = 1
+          IF(AOLD + 0.001 .LT. AMIN)LOSFLG = 2
+          IF(BOLD - 0.001 .GT. BMAX)LOSFLG = LOSFLG + 4
+          IF(BOLD + 0.001 .LT. BMIN)LOSFLG = LOSFLG + 8
+       ENDIF
+C end of FERRET mod
+******************************************************************
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, COMPUTE THE INTERCEPT.
+
+ 90   IF(OWFLG .EQ. 0)GO TO 120
+
+C     CHECK THE HORIZONTAL LIMITS OF THE WINDOW.
+
+# ifdef NEED_IAND
+      IF(ISHFT(OWFLG,-2) .EQ. 0)GO TO 100
+# else
+      IF(rSHIFT(OWFLG,2) .EQ. 0)GO TO 100
+# endif
+
+C     THE POINT IS OUTSIDE THE HORIZONTAL LIMITS OF THE WINDOW.
+C     CALCULATE THE INTERCEPT.
+
+# ifdef NEED_IAND
+      YINTER = YMXMN(ISHFT(OWFLG,-2))
+# else
+      YINTER = YMXMN(rSHIFT(OWFLG,2))
+# endif
+
+      ZINTER = (ZNEW - ZOLD) * (YINTER - YOLD) / (YNEW - YOLD) +
+     * ZOLD
+      XINTER = (XNEW - XOLD) * (YINTER - YOLD) / (YNEW - YOLD) +
+     * XOLD
+
+C     CHECK THE INTERCEPT TO INSURE THAT IT IS ON THE BOUNDARY
+C     OF THE WINDOW.
+
+      IF(XINTER + 0.001 .GE. XMIN .AND. XINTER - 0.001 .LE. XMAX)
+     * GO TO 110
+
+C     THE POINT IS OUTSIDE THE VERTICAL LIMITS OF THE WINDOW.
+C     CALCULATE THE INTERCEPT.
+
+# ifdef NEED_IAND
+ 100  XINTER = XMXMN(IAND(OWFLG,3))
+# else
+ 100  XINTER = XMXMN(AND(OWFLG,3))
+# endif
+
+      YINTER = (YNEW - YOLD) * (XINTER - XOLD) / (XNEW - XOLD) +
+     * YOLD
+      ZINTER = (ZNEW - ZOLD) * (XINTER - XOLD) / (XNEW - XOLD) +
+     * ZOLD
+
+C recompute these now that we have a correct xinter and corrected yintr, zintr
+C and before calling abplt.
+
+      IF (irecompute .EQ. 1) THEN
+         CALL TFORM(XINTER,YINTER,ZINTER)
+         XOLD = XINTER
+         YOLD = YINTER
+         ZOLD = ZINTER
+         AOLD = ANEW
+         BOLD = BNEW 
+      ENDIF
+
+C     CHECK THE PLOTTING MODE.
+
+ 110  IF(PMODE .EQ. VECTOR)GO TO 160
+      DX = XINTER - XOLD
+      DY = YINTER - YOLD
+      DZ = ZINTER - ZOLD
+      GO TO 130
+
+C     CHECK THE PLOTTING MODE.
+
+ 120  IF(PMODE .EQ. VECTOR)GO TO 170
+      DX = XNEW - XOLD
+      DY = YNEW - YOLD
+      DZ = ZNEW - ZOLD
+
+C     INITIALIZE VARIABLES IN PREPARATION FOR DRAWING A DASHED
+C     LINE.
+
+ 130  DIST = SQRT(DX * DX + DY * DY + DZ * DZ)
+      IF(DIST .EQ. 0.0)GO TO 150
+      COSX = DX / DIST
+      COSY = DY / DIST
+      COSZ = DZ / DIST
+
+C     DRAW A DASHED LINE ONE SEGMENT AT A TIME.
+
+# ifdef NEED_IAND
+ 140  PENF = IAND(IDSEG,1) .NE. 0
+# else 
+ 140  PENF = AND(IDSEG,1) .NE. 0
+# endif
+
+      IF(SEG .GE. DIST)GO TO 150
+      XOLD = XOLD + SEG * COSX
+      YOLD = YOLD + SEG * COSY
+      ZOLD = ZOLD + SEG * COSZ
+
+C     TRANSFORM THE END OF THE SEGMENT TO THE SCREEN COORDINATE
+C     SYSTEM.
+
+      CALL TFORM(XOLD,YOLD,ZOLD)
+
+C     PLOT TO THE END OF THE SEGMENT.
+
+      CALL ABPLT
+      DIST = DIST - SEG
+
+# ifdef NEED_IAND
+      IDSEG = IAND(IDSEG,3) + 1
+# else
+      IDSEG = AND(IDSEG,3) + 1
+# endif
+
+      SEG = DSEG(IDSEG)
+      GO TO 140
+ 150  SEG = SEG - DIST
+
+C     CHECK THE NEW POINT TO SEE IF IT IS WITHIN THE BOUNDARY OF
+C     THE WINDOW.  IF NOT, PLOT TO THE INTERCEPT.
+
+      IF(OWFLG .EQ. 0)GO TO 170
+
+C     TRANSFORM THE INTERCEPT TO THE SCREEN COORDINATE SYSTEM.
+
+ 160  CALL TFORM(XINTER,YINTER,ZINTER)
+      GO TO 180
+
+C     TRANSFORM THE POINT TO THE SCREEN COORDINATE SYSTEM.
+
+ 170  CALL TFORM(XNEW,YNEW,ZNEW)
+
+C     PLOT TO THE POINT.
+
+ 180  CALL ABPLT
+
+C     MOVE THE COORDINATES OF THE NEW POINT TO THE OLD POINT.
+
+ 190  XOLD = XNEW
+      YOLD = YNEW
+      ZOLD = ZNEW
+      LOWFLG = OWFLG
+      RETURN 
+
+      END
+
+
diff --git a/ppl/complot/zabmv.F b/ppl/complot/zabmv.F
new file mode 100644
index 0000000..2a39b17
--- /dev/null
+++ b/ppl/complot/zabmv.F
@@ -0,0 +1,139 @@
+	SUBROUTINE ZABMV
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)zabmv.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+
+C	CALL ZABMV
+C
+C	This routine creates a binary file that can be used to
+c	construct device dependent plotting code
+c
+c	the file format is:
+c
+c	dimension x(63),y(63)
+c	write(luhp)x,y
+c
+c	where:
+c			x>0, y>0	is the coordinate to be
+c					moved to, pen down
+c
+c			x<0, y>0	is a pen up move to -x,y
+c
+c			x>0, y<0	select pen x
+c
+c			x<0, y<0	plot end
+c
+c	D. Denbo  February 1985
+c
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	IF(.NOT.PLTFLG)THEN
+	CALL BINBUF(ASIZE,BSIZE)
+C
+C	SELECT PEN 1
+C
+	CALL BINBUF(1.,-1.)
+	PLTFLG=.TRUE.
+	LPEN=.NOT.PEN
+	ENDIF
+	IF(PEN)THEN
+	CALL BINBUF(A,B)
+	ELSE
+	CALL BINBUF(-A-.001,B)
+	ENDIF
+	RETURN
+	END
+	SUBROUTINE BINBUF(XN,YN)
+C
+C	fills the file buffer with a flush function
+C
+	DIMENSION XB(63),YB(63)
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+#ifdef unix
+	CHARACTER ZFILE*81
+#endif
+	IF(NEWFIL)THEN
+#ifdef unix
+	len=lnblk(filez,81)
+	icnt=1
+100	write(zfile,999)filez(:len),fzcnt
+999	format(a,i3.3)
+	fzcnt=fzcnt+1
+	icnt=icnt+1
+	if(icnt.gt.100)stop 'can not open meta file'
+	OPEN(UNIT=LUHP,FILE=ZFILE,FORM='UNFORMATTED',
+     *	STATUS='NEW',ERR=100)
+#else
+	OPEN(UNIT=LUHP,FILE=FILEz,FORM='UNFORMATTED',
+     *	STATUS='NEW')
+#endif
+	NEWFIL=.FALSE.
+	IPT=1
+	ENDIF
+	XB(IPT)=XN
+	YB(IPT)=YN
+	IPT=IPT+1
+	IF(IPT.GT.63)THEN
+	WRITE(LUHP)XB,YB
+	IPT=1
+	ENDIF
+	RETURN
+	ENTRY BINFSH
+	XB(IPT)=-1.
+	YB(IPT)=-1.
+	WRITE(LUHP)XB,YB
+	CLOSE(LUHP)
+	NEWFIL=.TRUE.
+	IPT=1
+	RETURN
+	END
diff --git a/ppl/complot/zbufft.F b/ppl/complot/zbufft.F
new file mode 100644
index 0000000..5abaf75
--- /dev/null
+++ b/ppl/complot/zbufft.F
@@ -0,0 +1,109 @@
+	SUBROUTINE ZBUFFT(CHR,ICNT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)zbufft.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	character buff*64,blnk*1,zfile*81
+	character chr*(*)
+#else
+	character buff*64,blnk*1
+	byte chr(*)
+#endif
+C	
+C	WRITES CHAR TO CURRENT ZETA BUFFER EVENTUALLY TO BE
+C	WRITTEN TO LUN ATTACHED TO THE FILE
+C	D. DENBO  JUNE 1983   UPDATED MARCH 1984
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+	data blnk/' '/
+	J=1
+	IF (NEWFIL) THEN
+#ifdef unix
+	len=lnblk(filez,81)
+	jcnt=1
+100	write(zfile,998)filez(:len),fzcnt
+998	format(a,i3.3)
+	fzcnt=fzcnt+1
+	jcnt=jcnt+1
+	if(jcnt.gt.101)stop 'can not open hp file'
+	OPEN(UNIT=LUHP,FILE=zfile,STATUS='NEW',err=100)
+#else
+	OPEN(UNIT=LUHP,FILE=filez,STATUS='NEW')
+#endif
+	NEWFIL=.FALSE.
+	IPT=1
+	ENDIF
+#ifdef unix
+40	BUFF(IPT:IPT)=CHR(J:J)
+#else
+40	BUFF(IPT:IPT)=char(CHR(J))
+#endif
+	IPT=IPT+1
+	J=J+1
+	IF(IPT.GT.64)THEN
+	WRITE(LUHP,999)BUFF
+	IPT=1
+999	FORMAT(A64)
+	ENDIF
+	IF(J.LE.ICNT)GOTO 40
+	RETURN
+c	ENTRY ZFLUSH(CHR)
+c	DO 10 I=IPT,63
+c10	BUFF(I)=CHR(1)
+c	BUFF(64)='Z'
+30	WRITE(LUHP,999)BUFF
+	CLOSE(LUHP)
+	NEWFIL=.TRUE.
+	IPT=1
+	RETURN
+	ENTRY HFLUSH
+	DO 20 I=IPT,64
+20	BUFF(I:I)=BLNK
+	GOTO 30
+	END
diff --git a/ppl/complot/zoom.F b/ppl/complot/zoom.F
new file mode 100644
index 0000000..8f034fa
--- /dev/null
+++ b/ppl/complot/zoom.F
@@ -0,0 +1,148 @@
+      SUBROUTINE ZOOM(X1,Y1,X2,Y2)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)zoom.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL ZOOM(X1,Y1,X2,Y2)
+C
+C     THIS SUBROUTINE SELECTS THE BOUNDARIES OF THE AREA TO BE
+C     DISPLAYED ON THE SCREEN OF THE TEKTERMINAL OR THE HP PLOT-
+C     TER.  THIS AREA MUST BE SMALLER THAN, AND COMPLETELY CON-
+C     TAINED WITHIN, THE OVERALL PLOTTING AREA DEFINED BY SUB-
+C     ROUTINE SIZE.  SINCE THE AREA SELECTED FOR DISPLAY IS
+C     SCALED TO FILL THE ENTIRE SCREEN, GREATER DETAIL IS VIS-
+C     IBLE THAN WHEN THE ENTIRE PLOTTING AREA IS DISPLAYED.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X1     - X-COORDINATE OF THE FIRST CORNER OF THE SCREEN
+C                 IN USER'S UNITS.
+C        Y1     - Y-COORDINATE OF THE FIRST CORNER OF THE SCREEN
+C                 IN USER'S UNITS.
+C        X2     - X-COORDINATE OF THE OPPOSITE CORNER OF THE
+C                 SCREEN IN USER'S UNITS.
+C        Y2     - Y-COORDINATE OF THE OPPOSITE CORNER OF THE
+C                 SCREEN IN USER'S UNITS.
+C
+C
+#ifdef unix
+	include 'PLTCOM.DAT'
+#else
+	include 'pplinc:PLTCOM.DAT'
+#endif
+C
+C     SCALE AND TRANSFORM THE COORDINATES OF THE FIRST CORNER OF
+C     THE SCREEN.
+C
+      CALL TFORM(X1 * XSCALE,Y1 * YSCALE,ZTEMP)
+      AMN = ANEW
+      BMN = BNEW
+C
+C     SCALE AND TRANSFORM THE COORDINATES OF THE OPPOSITE CORNER
+C     OF THE SCREEN.
+C
+      CALL TFORM(X2 * XSCALE,Y2 * YSCALE,ZTEMP)
+      AMX = ANEW
+      BMX = BNEW
+C
+C     FIND THE MINIMUM AND MAXIMUM VALUE OF EACH TRANSFORMED
+C     COORDINATE.
+C
+      IF(AMN .GT. AMX)THEN
+        TEMP = AMN
+        AMN = AMX
+        AMX = TEMP
+      ENDIF
+      IF(BMN .GT. BMX)THEN
+        TEMP = BMN
+        BMN = BMX
+        BMX = TEMP
+      ENDIF
+C
+C     RESTORE THE DEFAULT MINIMUM AND MAXIMUM ALLOWABLE VALUES
+C     OF A AND B.
+C
+      AMIN = 0.0
+      BMIN = 0.0
+      AMAX = ASIZE
+      BMAX = BSIZE
+C
+C     IF THE COORDINATES ARE IN THE PLOTTING AREA, SET THEM AS
+C     THE MINIMUM AND MAXIMUM ALLOWABLE VALUES OF A AND B.
+C
+      IF(AMN .NE. AMX .AND. BMN .NE. BMX)THEN
+        IF(AMN .GT. AMIN)AMIN = AMN
+        IF(BMN .GT. BMIN)BMIN = BMN
+        IF(AMX .LT. AMAX)AMAX = AMX
+        IF(BMX .LT. BMAX)BMAX = BMX
+      ENDIF
+      ADIF = AMAX - AMIN
+      BDIF = BMAX - BMIN
+C
+C     RECOMPUTE THE TEKTERMINAL CONVERSION FACTORS.
+C
+      IF(ADIF / TWIDTH .GT. BDIF / THIGHT)THEN
+        PLTOTA = TSCLA / ADIF
+        PLTOTB = TSCLB / ADIF * TWIDTH / THIGHT
+      ELSE
+        PLTOTA = TSCLA / BDIF * THIGHT / TWIDTH
+        PLTOTB = TSCLB / BDIF
+      ENDIF
+C
+C     RECOMPUTE THE HP PLOTTER CONVERSION FACTORS.
+C
+      PLTOHA = HPSCLA / ADIF
+      PLTOHB = HPSCLB / BDIF
+C
+C     CALCULATE THE OFF-SCREEN FLAG.
+C
+      LOSFLG = 0
+      IF(AOLD - 0.001 .GT. AMAX)LOSFLG = 1
+      IF(AOLD + 0.001 .LT. AMIN)LOSFLG = 2
+      IF(BOLD - 0.001 .GT. BMAX)LOSFLG = LOSFLG + 4
+      IF(BOLD + 0.001 .LT. BMIN)LOSFLG = LOSFLG + 8
+      RETURN
+C
+      END
diff --git a/ppl/include/ARFILL.INC b/ppl/include/ARFILL.INC
new file mode 100644
index 0000000..741600c
--- /dev/null
+++ b/ppl/include/ARFILL.INC
@@ -0,0 +1,26 @@
+c
+c	arfill
+C** 
+C**    %W%    %G%
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	common/areafl/sqfflg
+c
+	logical sqfflg
+c
+c	sqfflg  if true use square fill option
+c
+c
+c*******************************************************************
+
+
+
+
diff --git a/ppl/include/AXIS.INC b/ppl/include/AXIS.INC
new file mode 100644
index 0000000..b4f75e5
--- /dev/null
+++ b/ppl/include/AXIS.INC
@@ -0,0 +1,96 @@
+c
+c	axis
+C** 
+C**    @(#)AXIS.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c v552 *acm* 3/03 new param IAXSET to restore axes after PLOT/AXES/set plot.
+c v554 *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+c V600 *acm* 2/06 add PPL XFOR('DMS') or 'DM' sets axis format deg/min/sec or deg/min
+c                 add xvaloff, yvaloff (see comments below)
+C      *kms* 7/10 changed name of common block from AXIS to AXISCMN 
+C                 to remove clash with AXIS function
+c
+	COMMON/AXISCMN/ XLO,XHI,XTIC,XLEN,XCSIZE, 
+     *	IAUTOX,ITYPEX,NMTCX,LINTX,LABELX,NSIGX,NTICX,XORG,XVALOFF,
+     *		     YLO,YHI,YTIC,YLEN,YCSIZE, 
+     *	IAUTOY,ITYPEY,NMTCY,LINTY,LABELY,NSIGY,NTICY,YORG,YVALOFF,
+     *	IAXON(4),IAXSET, HGRAT(4,2), VGRAT(4,2), HLINE, VLINE, 
+     *	SHRINKY, MOD_VS_X, MOD_VS_Y, HCOLOR(2), 
+     *  VCOLOR(2),XDMS,YDMS
+c
+c**	x axis variables
+c
+c	xlo	minimum value -- left end  (user units)
+c	xhi	maximum value -- right end (user units)
+c	xtic	distance between large tics  (user units)
+c	xlen	length of axis  (inches)
+c	xcsize	height of numeric labels  (inches)
+c	iautox	=0 use supplied xlo,xhi,xtic
+c		=1 calculate xlo,xhi,xtic from data and nticx
+c	itypex	=1 linear axis top and bottom
+c		=2 normal log axis top and bottom
+c		=3 normal log axis bottom, inverse log axis top 
+c	nmtcx	number of small tics between each large tic
+c	lintx	label interval of large tics, i.e. 2 every other tic
+c	labelx	=-1 label the bottom axis
+c		=0  suppress the labels
+c		=1  label the top axis
+c	nsigx	number of significant digits if ifrx = ' '
+c	nticx	number of large tics to try for if iautox=1
+c	xorg	position of left end of axis from left boundry (inches)
+c	xvaloff	add this amount to each x axis label. (x axis data was read as
+c               double precision and converted to single after applying an offset.)
+c	
+c**	y axis variables
+c
+c	ylo	minimum value -- bottom end  (user units)
+c	yhi	maximum value -- top end (user units)
+c	ytic	distance between large tics  (user units)
+c	ylen	length of axis  (inches)
+c	ycsize	height of numeric labels  (inches)
+c	iautoy	=0 use supplied ylo,yhi,ytic
+c		=1 calculate ylo,yhi,ytic from data and nticy
+c	itypey	=1 linear axis top and bottom
+c		=2 normal log axis top and bottom
+c		=3 normal log axis bottom, inverse log axis top 
+c	nmtcy	number of small tics between each large tic
+c	linty	label interval of large tics, i.e. 2 every other tic
+c	labely	=-1 label the left axis
+c		=0  suppress the labels
+c		=1  label the right axis
+c	nsigy	number of significant digits if ifry = ' '
+c	nticy	number of large tics to try for if iautoy=1
+c	yorg	position of bottom end of axis from bottom boundry (inches)
+c	yvaloff	add this amount to each y axis label. (y axis data was read as
+c               double precision and converted to single after applying an offset.)
+c
+c**	axis flags
+c       iaxset          =1 if axes have been reset (needed if plot/set/axes=,
+c                       so we can reset after the ppl plot)
+c	iaxon(1:4)	four flags controlling the plotting of each axis
+c			=0 suppress plotting of axis and character label
+c			=1 plot axis and character label
+c	iaxon(1)	top axis (x axis)
+c	iaxon(2)	bottom axis (x axis)
+c	iaxon(3)	left axis (y axis)
+c	iaxon(4)	right axis (y axis)
+c       HGRAT      draw horizontal tic lines across whole plot 0=no,1=dash,2=solid
+c       VGRAT      draw vertical tic lines across whole plot 0=no,1=dash,2=solid
+c       hline           flag: true if still need to draw horizontal tic lines
+c       vline           flag: true if still need to draw vertical tic lines
+c       SHRINKY         flag: true to allow auto-shrinking of y-axis tic labels
+c	MOD_VS_X        For PLOT/VS plots, data are treated as modulo, if they 
+c       MOD_VS_Y        have units of longitude.
+c       XDMS           = 0 for degrees in decimal deg.frac
+c                      = 1 for Degrees and minutes 
+c       YDMS           same as xdms, for vertical axis
+c
+c*******************************************************************
diff --git a/ppl/include/AXISL.INC b/ppl/include/AXISL.INC
new file mode 100644
index 0000000..e09b6d9
--- /dev/null
+++ b/ppl/include/AXISL.INC
@@ -0,0 +1,38 @@
+c
+c	axisl
+C** 
+C**    @(#)AXISL.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+*	Modified time word for whoi format to be 14 digits
+*	J Davison 11.19.95
+C      *kms* 7/10 changed name of common block from AXISL to AXISLCMN 
+C                 to remove clash with AXISL function
+
+	COMMON/AXISLCMN/IFRX,IFRY,IT1,IT2,ITSTRT,ITMIN,ITMAX
+
+*11.95	CHARACTER IFRX*20,IFRY*20,IT1*10,IT2*10,ITSTRT*10
+*11.95	CHARACTER ITMIN*10,ITMAX*10
+
+
+
+	CHARACTER IFRX*20,IFRY*20,IT1*14,IT2*14,ITSTRT*14
+	CHARACTER ITMIN*14,ITMAX*14
+c
+c	ifrx	format for x axis numeric label
+c	ifry	format for y axis numeric label
+c	it1	minimum time for t axis (YYMMDDHHMMSSCC) !11.95
+c	it2	maximum time for t axis (YYMMDDHHMMSSCC)
+c	itstrt	time of t=1,  TLO=1.-diff(it1,itstart)/dt (YYMMDDHHMMSSCC)
+c	itmin	minimum time for all lines in buffer
+c	itmax	maximum time for all lines in buffer
+c
+c*******************************************************************
diff --git a/ppl/include/AXISL.INC.pre_4digit b/ppl/include/AXISL.INC.pre_4digit
new file mode 100644
index 0000000..f55d4b4
--- /dev/null
+++ b/ppl/include/AXISL.INC.pre_4digit
@@ -0,0 +1,27 @@
+c
+c	axisl
+C** 
+C**    @(#)AXISL.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/AXISL/IFRX,IFRY,IT1,IT2,ITSTRT,ITMIN,ITMAX
+	CHARACTER IFRX*20,IFRY*20,IT1*10,IT2*10,ITSTRT*10
+	CHARACTER ITMIN*10,ITMAX*10
+c
+c	ifrx	format for x axis numeric label
+c	ifry	format for y axis numeric label
+c	it1	minimum time for t axis (YYMMDDHHMM)
+c	it2	maximum time for t axis (YYMMDDHHMM)
+c	itstrt	time of t=1,  TLO=1.-diff(it1,itstart)/dt (YYMMDDHHMM)
+c	itmin	minimum time for all lines in buffer
+c	itmax	maximum time for all lines in buffer
+c
+c*******************************************************************
diff --git a/ppl/include/AXLWID.INC b/ppl/include/AXLWID.INC
new file mode 100644
index 0000000..5352a1f
--- /dev/null
+++ b/ppl/include/AXLWID.INC
@@ -0,0 +1,22 @@
+c
+c	axlwid
+C** 
+C**    @(#)AXLWID.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/AXLWID/XWID,YWID
+c
+c	the width includes the tic and numeric axis label
+c
+c	xwid	current width of x axis in y direction (inches)
+c	ywid	current width of y axis in x direction (inches)
+c
+c*******************************************************************
diff --git a/ppl/include/BIBO.COM b/ppl/include/BIBO.COM
new file mode 100644
index 0000000..7605318
--- /dev/null
+++ b/ppl/include/BIBO.COM
@@ -0,0 +1,24 @@
+C
+CC  DEFINITION OF INDEXES USED FOR BIBO HEADER FORMAT
+C** 
+C**    @(#)BIBO.COM	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+      INTEGER NPTS,MIN,MAX,MEAN,PROJ,MOOR
+      INTEGER INST,DTYPE,STIME,SRATE,SLAT,SLON
+      INTEGER SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI
+      INTEGER WIND,SIG,HEAD,SCODE,PCODE,MODEN
+      INTEGER SPTIME
+      COMMON /BIBO/ NPTS,MIN,MAX,MEAN,PROJ,MOOR
+      COMMON /BIBO/ INST,DTYPE,STIME,SRATE,SLAT,SLON
+      COMMON /BIBO/ SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI
+      COMMON /BIBO/ WIND,SIG,HEAD,SCODE,PCODE,MODEN
+      COMMON /BIBO/ SPTIME
diff --git a/ppl/include/BIBO.DAT b/ppl/include/BIBO.DAT
new file mode 100644
index 0000000..c7658f5
--- /dev/null
+++ b/ppl/include/BIBO.DAT
@@ -0,0 +1,16 @@
+C** 
+C**    @(#)BIBO.DAT	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	DATA NPTS,MIN,MAX,MEAN,PROJ,MOOR/1,2,3,4,5,6/
+	DATA INST,DTYPE,STIME,SRATE,SLAT,SLON/8,10,11,14,15,16/
+	DATA SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI/17,18,19,20,21,22/
+	DATA WIND,SIG,HEAD,SCODE,PCODE,MODEN/23,24,25,131,132,133/
+	DATA SPTIME/136/
diff --git a/ppl/include/CDFTN5.INC b/ppl/include/CDFTN5.INC
new file mode 100644
index 0000000..60f801f
--- /dev/null
+++ b/ppl/include/CDFTN5.INC
@@ -0,0 +1,19 @@
+c
+c	cdftn5
+C** 
+C**    @(#)CDFTN5.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CDFTN5/LN
+c
+c	ln	logical unit used by COMRD5
+c
+c*******************************************************************
diff --git a/ppl/include/CEFTN5.INC b/ppl/include/CEFTN5.INC
new file mode 100644
index 0000000..11d207f
--- /dev/null
+++ b/ppl/include/CEFTN5.INC
@@ -0,0 +1,24 @@
+c
+c	ceftn5
+C** 
+C**    @(#)CEFTN5.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CEFTN5/ IN,IA,LT,CNAME,INTEMP
+	CHARACTER IN*80,IA*1,LT*1,CNAME*81,INTEMP*80
+c
+c	in	last physical line read using COMRD5
+c	ia	last character processed using COMRD5
+c	lt	logical end of input character
+c	cname	file name used for input
+c	intemp	last logical line read using COMRD5
+c
+c*******************************************************************
diff --git a/ppl/include/CMDCOM.INC b/ppl/include/CMDCOM.INC
new file mode 100644
index 0000000..6a1a7c7
--- /dev/null
+++ b/ppl/include/CMDCOM.INC
@@ -0,0 +1,44 @@
+	PARAMETER (IBFDIM=10)
+C** 
+C**    @(#)CMDCOM.INC	1.1    3/10/88
+C**
+C
+C	Common block for command line input, prompt and line
+C	count for both terminal and file.
+C
+C v5.51+ *acm* 3/03 Longer strings: changes for multi-line labels.
+
+	COMMON/CMDLNC/CMDFIL,PRMPT,CMFILE(8),CMDBUF(IBFDIM)
+	COMMON/CMDLNN/CMDLUN,INP,CMDLIN,ECHLUN,CMDLEV,LINCNT,
+     *		      CMLINE(0:8),MBUFF,BUFSZE,CMECHO(0:8),CMDEBG(0:8),
+     *		      CMQUIE(0:8),CMLOG(0:8),IFLEV,WHLEV,WHLINE(0:8),
+     *		      CMIFLV(0:8),CMWHLV(0:8),CMWHLN(0:8,8)
+	CHARACTER CMDFIL*80,PRMPT*30,CMFILE*80,CMDBUF*2048
+	INTEGER CMDLUN,CMDLIN,ECHLUN,CMDLEV,LINCNT,CMLINE,
+     *		      BUFSZE,IFLEV,WHLEV,WHLINE,CMIFLV,CMWHLV,CMWHLN
+	LOGICAL CMECHO,CMDEBG,CMQUIE,CMLOG
+c
+c	cmdfil	current command file name (char*80)
+c	prmpt	current interactive prompt (char*30)
+c	cmfile(8) storage of command file names up to 8 levels deep
+c	cmdbuf()  storage for commands to be executed
+c
+c	cmdlun	logical unit to read commands from (integer)
+c	inp	length of prompt in characters
+c	cmdlin	unused
+c	echlun	echo file logical unit (integer)
+c	cmdlev	current level of nesting for command files
+c	lincnt  curent position in current command file
+c	cmline(8) storage of line positions for 8 levels of command
+c	mbuff	next command to be read from cmdbuf
+c	bufsze	number of commands in cmdbuf
+c	cmecho	storage for old echo state
+c	cmdebg	storage for old debug state
+c	cmquie	storage for old quiet state
+c	cmlog	storage for old log state
+c	iflev	current if level count
+c	whlev	current while level count
+c	whline	current while return line numbers
+c	cmiflv	storage for if level count
+c	cmwhlv	storage for while level count
+c	cmwhln	storage for while return line numbers
diff --git a/ppl/include/CMRD.INC b/ppl/include/CMRD.INC
new file mode 100644
index 0000000..0f1866c
--- /dev/null
+++ b/ppl/include/CMRD.INC
@@ -0,0 +1,25 @@
+c
+c	cmrd
+C** 
+C**    @(#)CMRD.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CMRD/ P(20),M,N,IFLG(20),ISLEN,LBSTRT
+c
+c	p(1:20)	numerical parameters parsed by COMRD5
+c	m	number of numerical parameters 
+c	n	number of characters in LABEL
+c	iflg(1:20)	=0 corresponding parameter not set by COMRD5
+c			=1 corresponding parameter is set by COMRD5
+c	islen	length of STRING  (getcmd)
+c	lbstrt	start position of LABEL in STRING
+c
+c*******************************************************************
diff --git a/ppl/include/CMRDL.INC b/ppl/include/CMRDL.INC
new file mode 100644
index 0000000..cd9af6f
--- /dev/null
+++ b/ppl/include/CMRDL.INC
@@ -0,0 +1,30 @@
+c
+c	cmrdl
+C** 
+C**    @(#)CMRDL.INC	1.1    3/10/88
+C**
+C** v5.51+ *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CMRDL/ ICOM,LABEL,IFORM,STRING
+	CHARACTER ICOM*30,LABEL*2048,IFORM*80,STRING*2048
+c
+c	icom	command parsed by COMRD5
+c	label	character portion of line parsed
+c	iform	data format examples are:
+c		DSF
+c		BIBO
+c		EPIC
+c		UNF
+c		FREE
+c		(F5.0)
+c	string	input line used by GETCMD
+c
+c*******************************************************************
diff --git a/ppl/include/CMSTRT.INC b/ppl/include/CMSTRT.INC
new file mode 100644
index 0000000..becacc8
--- /dev/null
+++ b/ppl/include/CMSTRT.INC
@@ -0,0 +1,20 @@
+c
+c	cmstrt
+C** 
+C**    @(#)CMSTRT.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CMSTRT/SRTFIL
+	CHARACTER SRTFIL*81
+c
+c	srtfil	command file specified on initial VMS line
+c
+c*******************************************************************
diff --git a/ppl/include/COMDATF.INC b/ppl/include/COMDATF.INC
new file mode 100644
index 0000000..14e29f4
--- /dev/null
+++ b/ppl/include/COMDATF.INC
@@ -0,0 +1,13 @@
+C** 
+C**    @(#)COMDATF.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 EPIC
+C**
+C***********************************************************************
+C**
+C**
+          common /comefil/ datafile
+          character datafile*132
diff --git a/ppl/include/COMEPL.INC b/ppl/include/COMEPL.INC
new file mode 100644
index 0000000..d378995
--- /dev/null
+++ b/ppl/include/COMEPL.INC
@@ -0,0 +1,20 @@
+c
+c	comepl
+C** 
+C**    @(#)COMEPL.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	common /comepl/ lepic
+	logical lepic
+c
+c	lepic	pointer file is of EPIC format
+c
+c*******************************************************************
diff --git a/ppl/include/COMEPS.INC b/ppl/include/COMEPS.INC
new file mode 100644
index 0000000..6eb912a
--- /dev/null
+++ b/ppl/include/COMEPS.INC
@@ -0,0 +1,43 @@
+c
+c	comeps
+C** 
+C**    @(#)COMEPS.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+	common /comeps/ lstime,lsoffs,lsctd,lsnext
+	logical lstime,lsoffs,lsctd,lsnext
+c
+c**
+c
+c	lstime = .false. for EVAR/NOTIME (default) meaning to read the 
+c                        start time and delta-t from EPIC time series
+c                        headers and not use the time words on the file.
+c              = .true.  for EVAR/TIME meaning to read the time words
+c                        from the data file (for data which is not
+c                        evenly spaced in time).
+c	lsoffs = .true.  for EVAR/OFFSET (default) to offset EPIC time 
+c	                 series data so that data point is plotted at 
+c	                 center of time interval.
+c	       = .false  for EVAR/NOOFFSET meaning to plot data at
+c	                 the time on the data file (without offsetting
+c	                 to the center of the time interval).
+c	lsctd  = .true.  for FORMAT/CTD or EVAR/CTD or VAR/CTD meaning
+c	                 that the data is EPIC CTD data.
+c	         .false. for /NOCTD (default)
+c	lsnext = .true.  for EVAR/NEXT meaning that the next x variable
+c                        should be read from the same data file as the
+c	                 last data set was read from.  In this case, the
+c	                 y-variable must be the same as it was for the
+c                  last read.  This feature enables making CTD data
+c                        plots with multiple x-axes (e.g., P vs 
+c	                 T,S,sigma-T, Oxygen).  Only enabled for 
+c	                 EPIC CTD data.
+c	         .false. for /NONEXT (default)
+c
+c***********************************************************************
diff --git a/ppl/include/COMEPV.INC b/ppl/include/COMEPV.INC
new file mode 100644
index 0000000..09ecc10
--- /dev/null
+++ b/ppl/include/COMEPV.INC
@@ -0,0 +1,23 @@
+c
+c	comepv
+C** 
+C**    @(#)COMEPV.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+	common /comepv/ iepv1,iepv2,ieflg
+c
+c**
+c
+c	iepv1	EPIC generic variable code (integer) for x variable
+c	iepv2	EPIC generic variable code (integer) for y-variable
+c	ieflg	=0 Data format not 'EPIC' (Cleared with VARS)
+c		=1 Data format is 'EPIC' (iform(1:3)='EPI') (Set with
+c                  EVAR)
+c
+c***********************************************************************
diff --git a/ppl/include/COMTHDR.INC b/ppl/include/COMTHDR.INC
new file mode 100644
index 0000000..65564f4
--- /dev/null
+++ b/ppl/include/COMTHDR.INC
@@ -0,0 +1,12 @@
+C** 
+C**    @(#)COMTHDR.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+	common /comhdr/ header
+	common /comthdr/ theader
+	character*80 theader(8),header(8)
diff --git a/ppl/include/COMVAR.INC b/ppl/include/COMVAR.INC
new file mode 100644
index 0000000..485b6aa
--- /dev/null
+++ b/ppl/include/COMVAR.INC
@@ -0,0 +1,11 @@
+C** 
+C**    @(#)COMVAR.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+          COMMON /COMVAR/ NVARS,VARCD
+          CHARACTER*4 VARCD(20)
diff --git a/ppl/include/CONLAB.INC b/ppl/include/CONLAB.INC
new file mode 100644
index 0000000..d11b6e2
--- /dev/null
+++ b/ppl/include/CONLAB.INC
@@ -0,0 +1,21 @@
+c
+c	conlab
+C** 
+C**    @(#)CONLAB.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CONLAB/CONPRE,CONPST
+	CHARACTER CONPRE*10,CONPST*10
+c
+c	conpre	prefix characters to preceed the contour labels
+c	conpst	postfix characters appended to contour labels
+c
+c*******************************************************************
diff --git a/ppl/include/CONT.INC b/ppl/include/CONT.INC
new file mode 100644
index 0000000..8c587d1
--- /dev/null
+++ b/ppl/include/CONT.INC
@@ -0,0 +1,71 @@
+c
+c	cont
+C** 
+C**    @(#)CONT.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+* v581  *acm* 3/05 open levels (-INF) (INF)
+* V610  *acm* 3/08 - add new MODE NLEVELS
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V65 *acm   2/10 If Open-ended levels were used, symbol LEV_OPNLEVS saves 
+* the /LEV command needed to duplicate the levels
+* v683 *acm*	9/12 ribbon plots: RIBBON_FAST flag 
+
+
+	COMMON/CONT/ZLEV(ICNLEV),LDIG(ICNLEV),LWGT(ICNLEV),LCLR(ICNLEV),
+     *	NLEV,NLEV_DFLT,HGT,LEV_STD,LEV_MEAN,LEV_MIN,LEV_MAX,LEV_HIST,
+     *  NARC,IAUTOC,NLEV2,NSIGC,CANGLE,IVCOMP,
+     *  CONTOUR_FEWER,CENTERED,SET_DELTA,DELTA,NEGINF,POSINF,CONT_KEY,
+     *  OPENLEV,SET_STD,SET_MEAN,SET_MIN,SET_MAX,NEED_DATA_SCAN,USE_HIST,
+     *  LEV_STR,RIBBON_FAST
+
+c
+c	zlev()	array of levels to be contoured (user units)
+c	ldig()	number opf decimal places in the contour labels
+c		=0  no decimal
+c		=-2 no label
+c	lwgt()	=1 standard line
+c		=2 heavy line
+c		=3 dashed line
+c       lclr()  index of color to use
+c	nlev	number of levels to use
+c	hgt	height of contour labels (inches)
+c	narc	number of subsegments to replace each line segment of 
+c		contour.
+c	iautoc	=0  use supplied levels
+c		=1  compute levels from input data and nlev
+c	nlev2	actual number of levels to use 
+c	nsigc	number of significant digits for labels if iautoc=1
+c	cangle	angle to rotate the contour plot about its center.
+c	ivcomp	vector component to contour or surf
+c
+c 	These added 8.3.95 *jd*
+c	centered 	True if levels are to be centered around zero
+c	set_delta	True if DZ will be specified by the user
+c	delta		The specified DZ value
+*       neginf          The low level is open: lowest level specified to -inf
+*       posinf          The high level is open: hithest level specified to inf
+*       cont_key        Draw continuous color key - no a outline on the key boxes 
+*                        (previously this was in shade_vars.cmn)
+*	need_data_scan	true if we need to get min/max or mean/std from the data
+*       openlev		use open-ended levels
+*	set_std		flags: user-set mean and std for open-ended levels
+*	set_mean           or user indicated to compute from the data.
+*	lev_std		the values
+*	lev_mean
+*	set_min		flags: user-set min and/or max. if min and OPEN then 
+*	set_max            open only on top
+*	lev_min		the values of min and/or max.
+*	lev_max
+*	ribbon_fast	FAST for one color per point, default is interpolate
+*                       colors between points
+
+c*******************************************************************
+
diff --git a/ppl/include/CORECM.INC b/ppl/include/CORECM.INC
new file mode 100644
index 0000000..2bae7af
--- /dev/null
+++ b/ppl/include/CORECM.INC
@@ -0,0 +1,22 @@
+c
+c	suncore include file
+C** 
+C**    @(#)CORECM.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	include "/usr/include/f77/usercore77.h"
+c
+	common/corsurf/vsurf(VWSURFSIZE)
+	integer vsurf
+c
+c
+c	vsurf	the surface for core 
+c
diff --git a/ppl/include/CPFTN5.INC b/ppl/include/CPFTN5.INC
new file mode 100644
index 0000000..472a7e0
--- /dev/null
+++ b/ppl/include/CPFTN5.INC
@@ -0,0 +1,20 @@
+c
+c	cpftn5
+C** 
+C**    @(#)CPFTN5.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/CPFTN5/PRMPT
+	CHARACTER PRMPT*40
+c
+c	prmpt	prompt for COMRD5 input from a terminal
+c
+c*******************************************************************
diff --git a/ppl/include/DASHZZ.INC b/ppl/include/DASHZZ.INC
new file mode 100644
index 0000000..1721dbd
--- /dev/null
+++ b/ppl/include/DASHZZ.INC
@@ -0,0 +1,21 @@
+c
+c	dashzz
+C** 
+C**    @(#)DASHZZ.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/DASHZZ/ DASHLN,SPACLN,DSLAB
+c
+c	dashln	length of dash for dashed contour lines (inches)
+c	spacln	length of space for dashed contour lines (inches)
+c	dslab	minimum distance between labels  (inches)
+c
+c*******************************************************************
diff --git a/ppl/include/DATA.INC b/ppl/include/DATA.INC
new file mode 100644
index 0000000..408cbdb
--- /dev/null
+++ b/ppl/include/DATA.INC
@@ -0,0 +1,31 @@
+c
+c	data
+C** 
+C**    @(#)DATA.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/DATA/ ITYPEZ,JX,JY,JZ,LUNN,LINEN,NREC,NVAR, 
+     *	NGRP,CAY,NRNG 
+c
+c	itypez	=0 read data by rows (1st subscript varies fastest)
+c		=1 read data by columns (2nd varies fastest)
+c	jx	position of x variable in data file
+c	jy	position of y variable in data file
+c	jz	position of z variable in data file
+c	lunn	logical unit to read data on
+c	linen	number of data lines in buffer
+c	nrec	number of data records to read
+c	nvar	number of variables per group
+c	ngrp	number of groups per record
+c	cay	ZGRID interpolation method
+c	nrng	number of grid points to interpolate without data ZGRID
+c
+c*******************************************************************
diff --git a/ppl/include/DSFCOM.DAT b/ppl/include/DSFCOM.DAT
new file mode 100644
index 0000000..b0ef46e
--- /dev/null
+++ b/ppl/include/DSFCOM.DAT
@@ -0,0 +1,22 @@
+C	DSFCOM.FTN
+C** 
+C**    @(#)DSFCOM.DAT	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	CHARACTER NAME(4)*81
+	INTEGER*2 HLEN,HDPT,IBUF
+	INTEGER*4 DLEN,LBUF
+	common/dsfnme/ name
+	COMMON/DSFSVE/ INXT(4),IBKWD(4),IKEY(4)
+	COMMON/DSF/ BUF(128,4),IFRWD(4),IRW(4),HLEN(4),DLEN(4),LUN(4),
+     *	IHD(4),IBP(4),HDPT(4),DMIN(4),DMAX(4),DMEAN(4),CNAME
+	DIMENSION IBUF(256,4),LBUF(128,4)
+	EQUIVALENCE (BUF(1,1),IBUF(1,1))
+	EQUIVALENCE (BUF(1,1),LBUF(1,1))
diff --git a/ppl/include/DSFSVE.INC b/ppl/include/DSFSVE.INC
new file mode 100644
index 0000000..1e082a9
--- /dev/null
+++ b/ppl/include/DSFSVE.INC
@@ -0,0 +1,23 @@
+c
+c	dsfsve
+C** 
+C**    @(#)DSFSVE.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	CHARACTER NAME(4)*81
+	common/dsfnme/ name
+	COMMON/DSFSVE/ INXT(4),IBKWD(4),IKEY(4)
+c
+c	dname(1:81,1:4)	names of DSF formatted files
+c	inxt(1:4)	forward pointers for next header to read
+c	ibkwd(1:4)	backward pointers for last header read
+c
+c*******************************************************************
diff --git a/ppl/include/EPICLUN.INC b/ppl/include/EPICLUN.INC
new file mode 100644
index 0000000..d40f9ac
--- /dev/null
+++ b/ppl/include/EPICLUN.INC
@@ -0,0 +1,21 @@
+c
+c	epiclun
+C** 
+C**    @(#)EPICLUN.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	common /epiclun/ lun1, lun11, lun21
+c
+c	lun1	logical unit used by EPIC for data
+c	lun11	logical unit used by EPIC for pointer files
+c	lun21	logical unit used by EPIC for keyfile access
+c
+c*******************************************************************
diff --git a/ppl/include/F90_PLTCOM.DAT b/ppl/include/F90_PLTCOM.DAT
new file mode 100644
index 0000000..c3c7427
--- /dev/null
+++ b/ppl/include/F90_PLTCOM.DAT
@@ -0,0 +1,41 @@
+C** 
+C**    @(#)PLTCOM.DAT	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      REAL*8 ROTCOS,ROTSIN,VDIST
+      CHARACTER ALPHA*1,DASH*1,POINT*1,VECTOR*1
+      CHARACTER PMODE*1,FILEZ*81,FILET*81
+      INTEGER BEL,ESC,GS,SYN,US
+      LOGICAL GRAPHF,LPEN,MIRAF,MIRBF,PEN,PENF,PLTFLG,ROTAT,SAVEF,
+     * VIEWF,WINDOF,NEWFIL,TEKOPN,GKSOPN
+	INTEGER*4 OLDGZA,OLDGZB,OLDHTA,OLDHTB
+      INTEGER BAUDR,COLOUR,OSFLG,OWFLG,PTYPE,TTYPE,FZCNT
+C	byte  TEKON(3),TEKOFF(5),HOME(5)
+C	Mod made byte -> integer*1 above for linux *jd* 12.18.96
+	integer*1 TEKON(3),TEKOFF(5),HOME(5)
+
+C
+      PARAMETER (ALPHA='A',DASH='D',POINT='P',VECTOR='V')
+      PARAMETER (BEL=7,ESC=27,GS=29,SYN=22,US=31)
+C
+      COMMON /PLTCM1/ ROTCOS,ROTSIN,VDIST,
+     * A,AMAX,AMIN,ANEW,AOLD,AORIGN,AOSOLD,AREF,ASIZE,B,
+     * BAUDR,BMAX,BMIN,BNEW,BOLD,BORIGN,BOSOLD,BREF,BSIZE,COLD,COLOUR,
+     * CREF,DSEG(4),FACTOR,FZCNT,GKSOPN,GRAPHF,HMARK,HPSCLA,HPSCLB,
+     * IDSEG,IDTK,IPRIM,ISEQ,LHIA,LHIB,LLOBA,LOSFLG,LOWFLG,LPEN,
+     * LUHP,LUTK,LUSY,MIRAF,MIRBF,NEWFIL,OLDGZA,OLDGZB,OLDHTA,OLDHTB,
+     * OLDHPA,OLDHPB,OSFLG,OWFLG,PEN,PENF,PLTFLG,PLTOHA,PLTOHB,PLTOTA,
+     * PLTOTB,PTYPE,ROTAT,SAVEF,SEG,TAX,TAY,TAZ,TBX,TBY,
+     * TBZ,TCX,TCY,TCZ,TEKOPN,THIGHT,TSCLA,TSCLB,TTYPE,TWIDTH,
+     * VIEWF,XMAX,XMIN,XNEW,XOLD,XSCALE,XTEMP,YMAX,YMIN,YNEW,YOLD,
+     * YSCALE,YTEMP,WINDOF,ZNEW,ZOLD,ZSCALE,ZTEMP
+      COMMON /PLTCM2/ PMODE,FILEZ,FILET
+      COMMON /TEKCM1/ TEKON,TEKOFF,HOME
+C
diff --git a/ppl/include/FILNAM.INC b/ppl/include/FILNAM.INC
new file mode 100644
index 0000000..5ef00e8
--- /dev/null
+++ b/ppl/include/FILNAM.INC
@@ -0,0 +1,21 @@
+c
+c	filnam
+C** 
+C**    @(#)FILNAM.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/FILNAM/ MULTFL,ECHOFL
+	CHARACTER MULTFL*80,ECHOFL*80
+c
+c	multfl	name of actual file currently used for mult plots
+c	echofl	name of actual file currently used for echo
+c
+c*******************************************************************
diff --git a/ppl/include/GKSCM1.INC b/ppl/include/GKSCM1.INC
new file mode 100644
index 0000000..dc5cc24
--- /dev/null
+++ b/ppl/include/GKSCM1.INC
@@ -0,0 +1,43 @@
+c
+c	gkscm1
+C** 
+C**    @(#)GKSCM1.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*	JD Corrected for v1.1 typo SH found ie, YKYMX --> WKYMX
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+c
+	COMMON/GKSCM1/WSID,CONID,WSTYPE,ERRFIL,CHDEV,
+     *	CHPET,LCDEV,LCPET,WKSAUT,WKXMN,WKXMX,WKYMN,WKYMX
+	INTEGER WSID,CONID,WSTYPE,ERRFIL,CHDEV,CHPET,
+     *	LCDEV,LCPET
+	REAL*4 WKXMN,WKXMX,WKYMN,WKYMX
+	LOGICAL WKSAUT
+c
+c	GKS common block for workstation id, type and device
+c	and prompt-echo-type
+c
+c	wsid	workstation id
+c	conid	connection id
+c	wstype	workstation type
+c	errfil	logical unit for error file
+c	chdev	choice device for wsid
+c	chpet	choice prompt echo type for wsid
+c	lcdev	locator device for wsid
+c	lcpet	locator prompt echo type for wsid
+c	wksaut	if true use the default workstation viewport
+c		if false use wkxmn ... wkymx for workstation
+c		the viewport
+c	wkxmn	minimum x value for viewport (meters)
+c	wkxmx	maximum x value for viewport
+c	wkymn	minimum y value for viewport
+c	wkymx	maximum y value for viewport
+c
+c*******************************************************************
diff --git a/ppl/include/HAB.INC b/ppl/include/HAB.INC
new file mode 100644
index 0000000..7f38dc0
--- /dev/null
+++ b/ppl/include/HAB.INC
@@ -0,0 +1,23 @@
+c
+c	hab
+C** 
+C**    @(#)HAB.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/HAB/ IPLOT,IPAUSE,IHDCPY 
+c
+c	parameters used by subroutine HABIS
+c
+c	iplot	XXXX0YYYY0Z, XXXX=baud, YYYY=Tek model, Z=plot type
+c	ipause	=0 for no pause, =1 for a pause (after end of plot)
+c	ihdcpy	=0 for no hardcopy, =1 for a hard copy
+c
+c*******************************************************************
diff --git a/ppl/include/HD.INC b/ppl/include/HD.INC
new file mode 100644
index 0000000..529c5b1
--- /dev/null
+++ b/ppl/include/HD.INC
@@ -0,0 +1,60 @@
+c
+c	hd
+C** 
+C**    @(#)HD.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+
+	COMMON/HD/ XPTS,ZMIN,ZMAX,ZMEAN,ZSTD,XMIN,XMAX,NX,YMIN,YMAX,
+     *	NY,JTYPE,JLAB(16),NCH,IXLB(16),NCHX,IYLB(16),NCHY
+	DIMENSION IPTS(NMIPTS)
+	INTEGER*2 JLAB,IXLB,IYLB
+	INTEGER*4 IPTS
+	EQUIVALENCE (IPTS(1),XPTS)
+c
+c	DSF header for FORMAT= DSF files.  (note: not BIBO files)
+c
+c	xpts	actual number of points in data file (y and x) (real)
+c	zmin	minimum value for x and y  (real)
+c	zmax	maximum value for x and y  (real)
+c	zmean	mean for x and y  (real)
+c       zstd	std for xy array
+c	xmin	minimum x value  (real) (user units)
+c	xmax	maximum x value  (real) (user units)
+c	nx	number of x grid points (integer)
+c	ymin	minimum y value (real) (user units)
+c	ymax	maximum y value (real) (user units)
+c	ny	number of y grid points (integer)
+c	jtype	=0 2-d set (contour), =1 1-d set   (integer)
+c	jlab(16)main label hollerith (integer)
+c	nch	number of characters in jlab  (integer)
+c	ixlb(16)x axis label hollerith (integer)
+c	nchx	number of characters in ixlb  (integer)
+c	iylb(16)y axis label hollerith  (integer)
+c	nchy	number of characters in iylb  (integer)
+c
+c*******************************************************************
+C
+C	RSX-11M OR INT*2 DEFAULT
+C
+C      COMMON/HD/ IPTS(70) 
+C	INTEGER*2 IPTS
+C
+C	END RSX-11M
+C
+C
+C	VAX/VMS  OR INT*4 DEFAULT
+C
+C	COMMON/HD/ IPTS(38)
+C	INTEGER*4 IPTS
+C
+C	END VAX/VMS
+C
diff --git a/ppl/include/IK.LIS b/ppl/include/IK.LIS
new file mode 100644
index 0000000..248fe91
--- /dev/null
+++ b/ppl/include/IK.LIS
@@ -0,0 +1,62 @@
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]AXIS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]AXISL.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]AXLWID.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]BIBO.COM;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]BIBO.DAT;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CDFTN5.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CEFTN5.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CMDCOM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CMRD.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CMRDL.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CMSTRT.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMDATF.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMEPL.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMEPS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMEPV.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMTHDR.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]COMVAR.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CONLAB.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CONT.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CORECM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]CPFTN5.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]DASHZZ.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]DATA.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]DSFCOM.DAT;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]DSFSVE.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]EPICLUN.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]FILNAM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]GKSCM1.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]HAB.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]HD.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]IK.LIS;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]LABCOM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]LABELS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]LINES.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]LUNITS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]MISS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]MPLOT.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]MPLOTS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]MPLOTX.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PARAMPL5.DAT;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PEN.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PLT.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PLTCOM.DAT;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PLTL.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PPL.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PPLDAT.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]PRMCOM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]QGCOMMON.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]SWITCH.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]SYMKEY.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]SYSTEM.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]TAXIS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]TBLE.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]TICS.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]TICS2.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]VECTOR.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]VIEW.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]XYLABP.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]ZGRID.INC;1
+SCR1:[DAVISON.PPLUS.V1_1.TMAP_SOURCE.INCLUDE]ZGRIDD.INC;1
+
+Total of 60 files.
diff --git a/ppl/include/LABCOM.INC b/ppl/include/LABCOM.INC
new file mode 100644
index 0000000..8844f78
--- /dev/null
+++ b/ppl/include/LABCOM.INC
@@ -0,0 +1,32 @@
+c
+c	labcom
+C** 
+C**    @(#)LABCOM.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/LABCOM/ HLAB1,HXLAB,HYLAB,HLABS, 
+     *	ICOUNT,NLAB,ICROSS,IGTLAB
+c
+c	hlab1	character height for main label (inches)
+c	hxlab	character height for x axis character label (inches)
+c	hylab	character height for y axis character label (inches)
+c	hlabs	default character height for moveable labels (inches)
+c	icount	number of plots produced
+c	nlab	number of moveable labels
+c	icross	=0 no cross
+c		=1 draw through (0,0)
+c		=2 horizontal line through each YOFF
+c		=3 vertical line through each XOFF
+c		=4 horizontal and vertical through each XOFF and YOFF
+c	igtlab	=0 manual entry of graph labels
+c		=1 get labels from data headers (EPIC and BIBO only)
+c
+c*******************************************************************
diff --git a/ppl/include/LABELS.INC b/ppl/include/LABELS.INC
new file mode 100644
index 0000000..02710a7
--- /dev/null
+++ b/ppl/include/LABELS.INC
@@ -0,0 +1,33 @@
+c
+c	labels
+C** 
+C**    @(#)LABELS.INC	1.1    3/10/88
+C** v5.51+ *acm* 3/03 Longer strings: changes for multi-line labels.
+C** v5.8  *acm* 10/04 Font prefixes may be @P3, @C003, or @FN (font)
+C**                   so lengthen fontprefix, etc to store  @Cnnn.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplusC**
+* V683 *acm* 12/12 up the spacing between lines for multi-line labels
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/LABELS/ LAB1,XLAB,YLAB,LABS 
+	CHARACTER LAB1*2048,XLAB*2048,YLAB*2048,LABS(NLABS)*2048
+
+        CHARACTER fontprefix*5, penprefix*5, newfont*5, newpen*5
+        INTEGER nlablines
+        REAL*4 line_spacing
+        PARAMETER (nlablines=250,
+     .             line_spacing=1.6)
+        INTEGER lnbeg(nlablines), lnend(nlablines)
+c
+c	lab1	main label
+c	xlab	x axis character label
+c	ylab	y axis character label
+c	labs()	moveable labels
+c
+c*******************************************************************
diff --git a/ppl/include/LINES.INC b/ppl/include/LINES.INC
new file mode 100644
index 0000000..2cda8c7
--- /dev/null
+++ b/ppl/include/LINES.INC
@@ -0,0 +1,47 @@
+c
+c	lines
+C** 
+C**    @(#)LINES.INC	1.2    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+
+* V510 *sh* 3/00 - dimension lleng() using the larger value, NPOLYGON
+
+	COMMON/LINES/ IMARK(NLINES),HMARK(NLINES),ITYPE(NLINES),
+     *	XOFF(0:NLINES),YOFF(0:NLINES),XFCT(0:NLINES),YFCT(0:NLINES),
+     *	DN1(NLINES),UP1(NLINES),DN2(NLINES),UP2(NLINES),
+     *	LLENG(NPOLYGON),LNUM,IWIND 
+c
+c	xoff(0), yoff(0), etc are the offsets for the contour and view
+c	plots.
+c
+c	imark()	type of mark at each point  (0-88)
+c	hmark()	height of mark (inches)
+c	itype()	=0 no mark
+c		=1 mark data points
+c		=2 mark end points only
+c		=3 only mark  (no connecting line)
+c		=4 dashes
+c		=5 dashes with mark at end points
+c	xoff()	x offset
+c	yoff()	y offset
+c	xfct()	multiplicative factor for x
+c	yfct()	multiplicative factor for y
+c	dn1()	first down stroke for dashes (inches)
+c	up1()	first up stroke for dashes (inches)
+c	dn2()	second down stroke for dashes (inches)
+c	up2()	second up stroke for dashes (inches)
+c	lleng()	number of points in line
+c	lnum	total number of lines for buffer
+c	iwind	=0 windowing of data off
+c		=1 window data to XLO, XHI and YLO, YHI
+c
+c*******************************************************************
diff --git a/ppl/include/LUNITS.INC b/ppl/include/LUNITS.INC
new file mode 100644
index 0000000..5009153
--- /dev/null
+++ b/ppl/include/LUNITS.INC
@@ -0,0 +1,21 @@
+c
+c	lunits
+C** 
+C**    @(#)LUNITS.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/LUNITS/LTTOUT,LMULT,LERROR
+c
+c	lttout	logical unit for output to keyboard
+c	lmult	logical unit for multzzz.dat i/o
+c       lerror  logical unit for std error
+c
+c*******************************************************************
diff --git a/ppl/include/MISS.INC b/ppl/include/MISS.INC
new file mode 100644
index 0000000..8d2a6de
--- /dev/null
+++ b/ppl/include/MISS.INC
@@ -0,0 +1,28 @@
+c
+c	miss
+C** 
+C**    @(#)MISS.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/MISS/CMXLE,CMXEQ,CMXGE,CMYLE,CMYEQ,CMYGE,
+     *		    CMZLE,CMZEQ,CMZGE,
+     *		      XLE,  XEQ,  XGE,  YLE,  YEQ,  YGE,
+     *		      ZLE,  ZEQ,  ZGE
+	LOGICAL XLE,XEQ,XGE,YLE,YEQ,YGE,ZLE,ZEQ,ZGE
+c
+c	cmxle	value for good data check for xle test(user units)
+c	cmxeq	value for good data check for xeq test(user units)
+c		...etc...
+c	xle	test for x .le. cmxle for good data
+c	xeq	test for x .eq. cmxeq for good data
+c		...etc...
+c
+c*******************************************************************
diff --git a/ppl/include/MPLOT.INC b/ppl/include/MPLOT.INC
new file mode 100644
index 0000000..51cf26f
--- /dev/null
+++ b/ppl/include/MPLOT.INC
@@ -0,0 +1,38 @@
+c
+c	mplot
+C** 
+C**    @(#)MPLOT.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/MPLT/ MNX,MNY,IMULT,IMCNT,DXM(10),DYM(10), 
+     *	XLENM(10),YLENM(10),IXM,IYM,MXBOT,MYLEF,HTM,WDM 
+c
+c	mnx	number of mult plots in x direction
+c	mny	number of mult plots in y direction
+c	imult	=0 mult plotting off
+c		=1 mult plotting on
+c	imcnt	current plot of mnx*mny mult plots
+c	dxm(1:10)	spacing between plots x direction, 
+c			bndry to col1, ...,  (inches)
+c	dym(1:10)	spacing between plots y direction, 
+c		row1 to row2,...,last row to bottom (inches)
+c	xlenm(1:10)	length of x axis (inches)
+c	ylenm(1:10)	length of y axis
+c	ixm	current column -1
+c	iym	current row
+c	mxbot	=0 plot bottom x axis
+c		=1 don't plot bottom x axis
+c	mylef	=0 plot left y axis
+c		=1 don't plot left y axis
+c	htm	save height of plotting region (inches)
+c	wdm	save width of plotting region (inches)
+c
+c*******************************************************************
diff --git a/ppl/include/MPLOTS.INC b/ppl/include/MPLOTS.INC
new file mode 100644
index 0000000..df1578b
--- /dev/null
+++ b/ppl/include/MPLOTS.INC
@@ -0,0 +1,22 @@
+c
+c	mplots
+C** 
+C**    @(#)MPLOTS.INC	1.1    3/10/88
+C** v5.51+ *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/MPLOTS/XLABT,YLABT,LABT
+	CHARACTER*2048 XLABT,YLABT,LABT
+c
+c	xlabt	save x axis character label
+c	ylabt	save y axis character label
+c	labt	save main label
+c
+c*******************************************************************
diff --git a/ppl/include/MPLOTX.INC b/ppl/include/MPLOTX.INC
new file mode 100644
index 0000000..ae8a185
--- /dev/null
+++ b/ppl/include/MPLOTX.INC
@@ -0,0 +1,24 @@
+c
+c	mplotx
+C** 
+C**    @(#)MPLOTX.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/MPLOTX/XORGT,YORGT,XLENT,YLENT,LABXT,LABYT
+c
+c	xorgt	save x origin (inches)
+c	yorgt	save y origin (inches)
+c	xlent	save x axis length (inches)
+c	ylent	save y axis length (inches)
+c	labxt	save labelx
+c	labyt	save labely
+c
+c*******************************************************************
diff --git a/ppl/include/PARAMPL5.DAT b/ppl/include/PARAMPL5.DAT
new file mode 100644
index 0000000..5fcb8d6
--- /dev/null
+++ b/ppl/include/PARAMPL5.DAT
@@ -0,0 +1,32 @@
+C
+C** 
+C**    @(#)PARAMPL5.DAT	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+
+* V500:  4/99 *jd* increased NLINES from 200 to 5000
+* V510:  9/99 *sh* increased NLINES from 5000 to 30000
+*	Note: there are 19 separate PLOT+ COMMON variables that depend
+*	on NLINES. Few of these need to go beyond, say, 300 in size, but
+*	code changes are neede to prevent out-of-bounds arrays if these
+*	limits are set smaller than NLINES.
+*	3/00 *sh* - restored NLINES to 200. Added new parameter NPOLYGON
+
+
+
+	PARAMETER (IDSFRM=38)
+	PARAMETER (ICNLEV=500)
+	PARAMETER (NMIPTS=38)
+	PARAMETER (NLINES=200)
+	PARAMETER (NPOLYGON=100000)	! only used by lleng ("line length")
+	PARAMETER (NLABS=50)
+C
+C
diff --git a/ppl/include/PEN.INC b/ppl/include/PEN.INC
new file mode 100644
index 0000000..1157cd9
--- /dev/null
+++ b/ppl/include/PEN.INC
@@ -0,0 +1,29 @@
+c
+c	pen
+C** 
+C**    @(#)PEN.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+* V600 *acm* 5/06  num_line_colors for MODE LINECOLORS
+
+c
+	COMMON/PEN/ IPEN(0:NLINES),IP(4),num_line_colors
+c
+c	ipen(0:)pen to use for each line, ipen(0) is default
+c	ip(1:4)	misc flags
+c	ip(1)	=0 no box around plot
+c		=1 draw box
+c	ip(2)	=0 do not echo command input to echo file
+c		=1 echo on
+c	ip(3)	=0 interactive
+c		=1 batch
+c       num_line_colors = number of line colors allowed (see ws_fill_rep.F)
+c
+c*******************************************************************
diff --git a/ppl/include/PLT.INC b/ppl/include/PLT.INC
new file mode 100644
index 0000000..9aa9e15
--- /dev/null
+++ b/ppl/include/PLT.INC
@@ -0,0 +1,24 @@
+c
+c	plt
+C** 
+C**    @(#)PLT.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/PLT/ ICODE,WIDTH,HEIGHT,MOD,IR,LUN 
+c
+c	icode	plot type
+c	width	plot width (inches)
+c	height	plot height (inches)
+c	mod	tek model number
+c	ir	baud rate
+c	lun	output unit number (unused?)
+c
+c*******************************************************************
diff --git a/ppl/include/PLTCOM.DAT b/ppl/include/PLTCOM.DAT
new file mode 100644
index 0000000..5992348
--- /dev/null
+++ b/ppl/include/PLTCOM.DAT
@@ -0,0 +1,38 @@
+C** 
+C**    @(#)PLTCOM.DAT	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      REAL*8 ROTCOS,ROTSIN,VDIST
+      CHARACTER ALPHA*1,DASH*1,POINT*1,VECTOR*1
+      CHARACTER PMODE*1,FILEZ*81,FILET*81
+      INTEGER BEL,ESC,GS,SYN,US
+      LOGICAL GRAPHF,LPEN,MIRAF,MIRBF,PEN,PENF,PLTFLG,ROTAT,SAVEF,
+     * VIEWF,WINDOF,NEWFIL,TEKOPN,GKSOPN
+	INTEGER*4 OLDGZA,OLDGZB,OLDHTA,OLDHTB
+      INTEGER BAUDR,COLOUR,OSFLG,OWFLG,PTYPE,TTYPE,FZCNT
+	byte  TEKON(3),TEKOFF(5),HOME(5)
+C
+      PARAMETER (ALPHA='A',DASH='D',POINT='P',VECTOR='V')
+      PARAMETER (BEL=7,ESC=27,GS=29,SYN=22,US=31)
+C
+      COMMON /PLTCM1/ ROTCOS,ROTSIN,VDIST,
+     * A,AMAX,AMIN,ANEW,AOLD,AORIGN,AOSOLD,AREF,ASIZE,B,
+     * BAUDR,BMAX,BMIN,BNEW,BOLD,BORIGN,BOSOLD,BREF,BSIZE,COLD,COLOUR,
+     * CREF,DSEG(4),FACTOR,FZCNT,GKSOPN,GRAPHF,HMARK,HPSCLA,HPSCLB,
+     * IDSEG,IDTK,IPRIM,ISEQ,LHIA,LHIB,LLOBA,LOSFLG,LOWFLG,LPEN,
+     * LUHP,LUTK,LUSY,MIRAF,MIRBF,NEWFIL,OLDGZA,OLDGZB,OLDHTA,OLDHTB,
+     * OLDHPA,OLDHPB,OSFLG,OWFLG,PEN,PENF,PLTFLG,PLTOHA,PLTOHB,PLTOTA,
+     * PLTOTB,PTYPE,ROTAT,SAVEF,SEG,TAX,TAY,TAZ,TBX,TBY,
+     * TBZ,TCX,TCY,TCZ,TEKOPN,THIGHT,TSCLA,TSCLB,TTYPE,TWIDTH,
+     * VIEWF,XMAX,XMIN,XNEW,XOLD,XSCALE,XTEMP,YMAX,YMIN,YNEW,YOLD,
+     * YSCALE,YTEMP,WINDOF,ZNEW,ZOLD,ZSCALE,ZTEMP
+      COMMON /PLTCM2/ PMODE,FILEZ,FILET
+      COMMON /TEKCM1/ TEKON,TEKOFF,HOME
+C
diff --git a/ppl/include/PLTDAT_UNIX.DAT b/ppl/include/PLTDAT_UNIX.DAT
new file mode 100644
index 0000000..c59f300
--- /dev/null
+++ b/ppl/include/PLTDAT_UNIX.DAT
@@ -0,0 +1,30 @@
+C** 
+C**    @(#)PLTDAT.vms	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      DATA A/0.0/,AMAX/7500.0/,AMIN/0.0/,AOLD/0.0/,AORIGN/500.0/,
+     * AOSOLD/0.0/,ASIZE/7500.0/,B/0.0/,BAUDR/4800/,BMAX/5625.0/,
+     * BMIN/0.0/,BOLD/0.0/,BORIGN/750.0/,BOSOLD/0.0/,BSIZE/5625.0/,
+     * COLD/0.0/,COLOUR/1/,DSEG/150.0,100.0,150.0,100.0/,FACTOR/1000.0/,
+     * FZCNT/1/,GKSOPN/.FALSE./,GRAPHF/.FALSE./,HMARK/10./,HPSCLA/779./,
+     * HPSCLB/719.0/,IPRIM/0/,ISEQ/1/,LOSFLG/0/,LOWFLG/0/,LPEN/.FALSE./,
+     * LUHP/8/,LUTK/9/,LUSY/10/,MIRAF/.FALSE./,MIRBF/.FALSE./,
+     * NEWFIL/.TRUE./,OLDGZA/0/,OLDGZB/0/,OLDHTA/0/,OLDHTB/0/,
+     * OLDHPA/0.0/,OLDHPB/0.0/,OWFLG/0/,PLTFLG/.FALSE./,PLTOHA/.06/,
+     * PLTOHB/.07200/,PLTOTA/0.1364/,PLTOTB/0.1385/,
+     * PMODE/ALPHA/,PTYPE/0/,ROTAT/.FALSE./,SAVEF/.FALSE./,
+     * TEKOPN/.FALSE./,
+     * THIGHT/5.625/,TSCLA/1023.0/,TSCLB/779.0/,TTYPE/4010/,TWIDTH/7.5/,
+     * VIEWF/.FALSE./,XOLD/-0.5/,XSCALE/1000.0/,YOLD/-0.75/,
+     * YSCALE/1000.0/,WINDOF/.FALSE./,ZOLD/0.0/,ZSCALE/1000.0/,
+     * ZTEMP/0.0/
+	data filez/'zeta.plt'/,filet/'/dev/tty'/
+	DATA TEKON/27,67,69/,TEKOFF/27,67,70,22,22/,
+     * HOME/29,56,117,32,64/
diff --git a/ppl/include/PLTDAT_VMS.DAT b/ppl/include/PLTDAT_VMS.DAT
new file mode 100644
index 0000000..decf0a3
--- /dev/null
+++ b/ppl/include/PLTDAT_VMS.DAT
@@ -0,0 +1,30 @@
+C** 
+C**    @(#)PLTDAT.vms	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      DATA A/0.0/,AMAX/7500.0/,AMIN/0.0/,AOLD/0.0/,AORIGN/500.0/,
+     * AOSOLD/0.0/,ASIZE/7500.0/,B/0.0/,BAUDR/4800/,BMAX/5625.0/,
+     * BMIN/0.0/,BOLD/0.0/,BORIGN/750.0/,BOSOLD/0.0/,BSIZE/5625.0/,
+     * COLD/0.0/,COLOUR/1/,DSEG/150.0,100.0,150.0,100.0/,FACTOR/1000.0/,
+     * FZCNT/1/,GKSOPN/.FALSE./,GRAPHF/.FALSE./,HMARK/10./,HPSCLA/779./,
+     * HPSCLB/719.0/,IPRIM/0/,ISEQ/1/,LOSFLG/0/,LOWFLG/0/,LPEN/.FALSE./,
+     * LUHP/8/,LUTK/9/,LUSY/10/,MIRAF/.FALSE./,MIRBF/.FALSE./,
+     * NEWFIL/.TRUE./,OLDGZA/0/,OLDGZB/0/,OLDHTA/0/,OLDHTB/0/,
+     * OLDHPA/0.0/,OLDHPB/0.0/,OWFLG/0/,PLTFLG/.FALSE./,PLTOHA/.06/,
+     * PLTOHB/.07200/,PLTOTA/0.1364/,PLTOTB/0.1385/,
+     * PMODE/ALPHA/,PTYPE/0/,ROTAT/.FALSE./,SAVEF/.FALSE./,
+     * TEKOPN/.FALSE./,
+     * THIGHT/5.625/,TSCLA/1023.0/,TSCLB/779.0/,TTYPE/4010/,TWIDTH/7.5/,
+     * VIEWF/.FALSE./,XOLD/-0.5/,XSCALE/1000.0/,YOLD/-0.75/,
+     * YSCALE/1000.0/,WINDOF/.FALSE./,ZOLD/0.0/,ZSCALE/1000.0/,
+     * ZTEMP/0.0/
+	data filez/'sy:zeta.plt'/,filet/'TT:'/
+	DATA TEKON/27,67,69/,TEKOFF/27,67,70,22,22/,
+     * HOME/29,56,117,32,64/
diff --git a/ppl/include/PLTL.INC b/ppl/include/PLTL.INC
new file mode 100644
index 0000000..ab51afe
--- /dev/null
+++ b/ppl/include/PLTL.INC
@@ -0,0 +1,25 @@
+c
+c	pltl
+C** 
+C**    @(#)PLTL.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/PLTL/MAKEP
+	CHARACTER MAKEP*7
+c
+c	makep	plot type  from plot command
+c		CONTOUR
+c		PLOT
+c		PLOTV
+c		PLOTUV
+c		VELVCT
+c
+c*******************************************************************
diff --git a/ppl/include/PPL.INC b/ppl/include/PPL.INC
new file mode 100644
index 0000000..f5bbf51
--- /dev/null
+++ b/ppl/include/PPL.INC
@@ -0,0 +1,101 @@
+c
+c	ppl
+C** 
+C**    @(#)PPL.INC	1.2    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	common/ppl/ppts,pzmin,pzmax,pzmean,pxmin,pxmax,pnx,
+     *	pymin,pymax,pny,ptype,pxlab(20),pylab(20),pmlab(30),
+     *	pdate(4),ptime(4),pident(8),psrc(8),
+     *	varnme(8),vmean(4),vvar(4),vstd(4),vrms(4),vmin(4),vmax(4),
+     *	vdate(4),vtime(4),vjdate(4),vident(8),vlat(4),vlong(4),
+     *	vxmean,vxvar,vxmin,vxmax,vxjdat,vxlat,vxlong,
+     *	gtype(2),gornt(2),grid(8),
+     *	gxornt,
+     *	cmnta(30),cmntb(30),cmntc(30),cmntd(30),cmnte(30),
+     *	usera(8),userb(8),userc(8),userd(8)
+c
+	real	  ppts,pzmin,pzmax,pzmean,pxmin,pxmax,pymin,pymax
+	integer*4 pnx,pny,ptype
+	integer*4 pxlab,pylab,pmlab,pdate,ptime,pident,psrc
+	integer*4 varnme,vmean,vvar,vstd,vrms,vmin,vmax
+	integer*4 vdate,vtime,vjdate,vident,vlat,vlong
+	real	  vxmean,vxvar,vxmin,vxmax,vxjdat,vxlat,vxlong
+	integer*4 gtype,gornt,grid
+	real	  gxornt
+	integer*4 cmnta,cmntb,cmntc,cmntd,cmnte
+	integer*4 usera,userb,userc,userd
+c
+c	DSF header for FORMAT= PPLUS files.  (note: not BIBO files)
+c
+c	note:  all labels are integer hollerith!!
+c
+c	ppts	actual number of points in data file (y and x) (real)
+c	pzmin	minimum value for x and y  (real)
+c	pzmax	maximum value for x and y  (real)
+c	pzmean	mean for x and y  (real)
+c	pxmin	minimum x value  (real) (user units)
+c	pxmax	maximum x value  (real) (user units)
+c	pnx	number of x grid points (integer)
+c	pymin	minimum y value (real) (user units)
+c	pymax	maximum y value (real) (user units)
+c	pny	number of y grid points (integer)
+c	ptype	=2 2-d irregular rectangular grid
+c		=1 1-d set
+c		=0 2-d regular rectangular grid (integer)
+c		=-1 2-d second component of a vector regular grid
+c		=-2 2-d second component of a vector irregular grid
+c	pxlab	xaxis label 80
+c	pylab	y axis label 80
+c	pmlab	main title of plot 120
+c
+c	pdate	date of plot file creation 16
+c	ptime	time of plot file creation 16
+c	pident	identifier of plot file 32
+c	psrc	source of plot file 32
+c
+c	varnme	name of variable 32
+c	vmean	mean of var 16
+c	vvar	variance of variable 16
+c	vstd	standard deviation of variable 16
+c	vrms	root mean square of variable 16
+c	vmin	minimum of variable 16
+c	vmax	maximum of variable 16
+c	vdate	gregorian date 16
+c	vtime	time 16
+c	vjdate	julian date of var 16
+c	vident	variable identification 32
+c	vlat	latitude of variable (or grid) 16
+c	vlong	longitude of variable (or grid) 16
+c	vxmean	mean of variable (real)
+c	vxvar	variance of variable (real)
+c	vxmin	minimum of variable (real)
+c	vxmax	maximum of variable (real)
+c	vxjdat	julian date of var (real, modified)
+c	vxlat	latitude of variable (real)
+c	vxlong	longitude of variabel (real)
+c
+c	gtype	grid type 8
+c	gornt	orientation of grid 8
+c	grid	additional grid information 32
+c	gxornt	orientation of grid (real)
+c
+c	cmnta	comment a 120
+c	cmntb	comment b 120
+c	cmntc	comment c 120
+c	cmntd	comment d 120
+c	cmnte	comment e 120
+c	usera	user field a 32
+c	userb	user field b 32
+c	userc	user field c 32
+c	userd	user field d 32
+c
+c*******************************************************************
diff --git a/ppl/include/PPLDAT.INC b/ppl/include/PPLDAT.INC
new file mode 100644
index 0000000..08b27e7
--- /dev/null
+++ b/ppl/include/PPLDAT.INC
@@ -0,0 +1,28 @@
+
+* V533 *acm*9/01 - changes for dynamic pplus buffer, call PPLLDC, PPLLDX, PPLLDV
+*                  via pplld*_envelope.c which check ppl_nsize (new name for 
+*                  NSIZE) and allocate more if needed.  Now will pass X rather than
+*                  storing in common.
+c
+c	ppldat
+C** 
+C**    @(#)PPLDAT.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/PPLDTA/IBASE, PBUF, PPLMEM_NSIZE
+	INTEGER IBASE, PBUF, PPLMEM_NSIZE
+c
+c       pplmem_nsize  size of plot-data buffer allocated in pplld*envelope.c 
+c	ibase	current position in buffer for next data set
+c	pbuf	=0 buffer empty
+c		=1 buffer not empty
+c
+c*******************************************************************
diff --git a/ppl/include/PRMCOM.INC b/ppl/include/PRMCOM.INC
new file mode 100644
index 0000000..da4cc72
--- /dev/null
+++ b/ppl/include/PRMCOM.INC
@@ -0,0 +1,20 @@
+c
+c	prmcom
+C** 
+C**    @(#)PRMCOM.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/PRMCOM/PLTOPN
+	LOGICAL PLTOPN
+c
+c	pltopn	plot device is open
+c
+c*******************************************************************
diff --git a/ppl/include/QGCOMMON.INC b/ppl/include/QGCOMMON.INC
new file mode 100644
index 0000000..e026a7e
--- /dev/null
+++ b/ppl/include/QGCOMMON.INC
@@ -0,0 +1,57 @@
+c
+c	variable definitions
+C** 
+C**    @(#)QGCOMMON.INC	1.1    3/10/88
+C**
+c
+	integer QGPSI,QGZETA,QGRELIEF,QGTOP,QGBOT,QGVEL,QGSPD
+	integer QGTEMP,QGPPSI,QGPZETA
+c
+	parameter (QGPSI=1,QGZETA=2,QGPPSI=3,QGPZETA=4,QGRELIEF=6,
+     *		QGTOP=7,QGBOT=8,QGVEL=9,QGSPD=10,QGTEMP=11,
+     *		QGMXDLD=20,QGMXDLB=21,QGMXDLT=22,QGMXGLD=25,
+     *		QGSBLW=32,QGTRCR1=51,QGTRCR2=52,QGTRCR3=53)
+c
+c	plot file header storage
+c
+	parameter (k0=6,k01=7,k02=8)
+c
+	common/qghead/runid(6),restid(9),
+     *	titl(20,2),
+     *	tstart,tmax,dt,
+     *	m,n,kz,xbasin,theta,
+     *	alpha,beta,rf,
+     *	iltord,iltfreq,iltcnt,
+     *	ifdiff,ifpert,ifrst,iftop,ifbot,iftvv,ifrel,
+     *	rlat0,rlng0,t0,v0,dhor,ht,time0,r0,
+     *	hz(k0),
+     *	rhosur,scsig,sigz(k01),eigval(k0),ainv(k0,k0),amat(k0,k0),
+     *	tsurf,xc(k01),
+     *	salsur,eta(k01)
+c
+c
+	common/qgcom/openf,hlev(0:k01),tscale,xscale,yscale,xmin,ymin,
+     *	next,dtime,time,tstep,level,depth,field,ttyp,dtyp,iqgln,
+     *	rtime,leof,timeold,first,tbar(0:k01),sbar(0:k01),dlev(0:k0),
+     *	actdep,exclud(53),llgrd,idxgrd
+c
+	integer*4 rtime
+	integer ttyp,dtyp,field
+	logical next,openf,leof,first,exclud,llgrd,idxgrd
+c
+	common/qgstr/qfile,qhdr1,qhdr2,qhdr3,qtitle1,qtitle2,
+     *	qvars,qlabel,qlevel,qdate
+c
+	character qfile*255,qhdr1*120,qhdr2*120,qhdr3*120
+	character qtitle1*80,qtitle2*80,qvars*255
+	character qlabel*80,qlevel*30,qdate*30
+c
+	common/qgpntr/psi(0:k01),zeta(0:k01),ppsi(0:k01),pzeta(0:k01),
+     *	sblw(50),trc1(50),trc2(50),trc3(50),sblwd(50),trc1d(50),
+     *	trc2d(50),trc3d(50),wcount,t1count,t2count,t3count,top,bottom,
+     *	mxdld,mxdlb,mxdlt,mxgld
+c
+	integer psi,zeta,ppsi,pzeta,sblw,trc1,trc2,trc3,wcount,t1count
+	integer t2count,t3count,top,bottom,mxdld,mxdlb,mxdlt,mxgld
+	real sblwd,trc1d,trc2d,trc3d
+c
diff --git a/ppl/include/SWITCH.INC b/ppl/include/SWITCH.INC
new file mode 100644
index 0000000..17c645c
--- /dev/null
+++ b/ppl/include/SWITCH.INC
@@ -0,0 +1,33 @@
+C
+C	Common block for switch data
+C** 
+C**    @(#)SWITCH.INC	1.1    3/10/88
+C**
+C
+	COMMON/SWTCHC/SWITCH(20)
+	COMMON/SWTCHN/SMIN(20),DEFLTS(20),FLAG(20),NFLAGS
+	CHARACTER SWITCH*20
+	LOGICAL DEFLTS,FLAG
+	INTEGER SMIN,NFLAGS
+	LOGICAL SECHO,SDEBUG,SOVER,SERASE,SWAIT,SCENTR,SRIGHT,
+     *	        SLEFT,SUSER,SLATCH,SQUIET,SLOG,SYAXIS,STIME,
+     *		SOFFS,SCTD,SNEXT,SVECTR,SLINE,SFILL
+C
+	EQUIVALENCE ( SECHO,FLAG( 1)),(SDEBUG,FLAG( 2)),
+     *		    ( SOVER,FLAG( 3)),(SERASE,FLAG( 4)),
+     *		    ( SWAIT,FLAG( 5)),(SCENTR,FLAG( 6)),
+     *		    (SRIGHT,FLAG( 7)),( SLEFT,FLAG( 8)),
+     *		    ( SUSER,FLAG( 9)),(SLATCH,FLAG(10)),
+     *		    (SQUIET,FLAG(11)),(  SLOG,FLAG(12)),
+     *		    (SYAXIS,FLAG(13)),( STIME,FLAG(14)),
+     *		    ( SOFFS,FLAG(15)),(  SCTD,FLAG(16)),
+     *		    ( SNEXT,FLAG(17)),(SVECTR,FLAG(18)),
+     *		    ( SLINE,FLAG(19)),( SFILL,FLAG(20))
+
+c
+c	switch	legal qualifiers (character*20)
+c	smin	minimum length for qualifier (integer)
+c	deflts	default values for switches (logical)
+c	flag	results of switch parsing (logical)
+c	nflags	number of flags possible
+c
diff --git a/ppl/include/SYMKEY.INC b/ppl/include/SYMKEY.INC
new file mode 100644
index 0000000..0b2a8a5
--- /dev/null
+++ b/ppl/include/SYMKEY.INC
@@ -0,0 +1,12 @@
+C
+C	Common block for symbol key files
+C** 
+C**    @(#)SYMKEY.INC	1.1    3/10/88
+C**
+C
+	COMMON/SYMKEY/KEYLN1,KEYLN2
+	INTEGER KEYLN1,KEYLN2
+c
+c	keyln1	logical unit for system keyfile
+c	keyln2	logical unit for user keyfile
+c
diff --git a/ppl/include/SYSTEM.INC b/ppl/include/SYSTEM.INC
new file mode 100644
index 0000000..d34474a
--- /dev/null
+++ b/ppl/include/SYSTEM.INC
@@ -0,0 +1,27 @@
+C
+C	Common block for system flags etc...
+C** 
+C**    @(#)SYSTEM.INC	1.1    3/10/88
+C**
+C
+	COMMON/STATUS/ECHOF,DEBUGF,BATCHF,TERMF,ERRORF,SMKEY2,
+     *	DONEF,MEMBUF,LOGITF,QUIETF,LOGCMF,SKIPIF,SKIPWH
+	LOGICAL ECHOF,DEBUGF,BATCHF,TERMF,ERRORF,SMKEY2,DONEF,
+     *	MEMBUF,LOGITF,QUIETF,LOGCMF,SKIPIF,SKIPWH
+c
+c	echof	echo file output switch
+c	debugf	debug output mode
+c	batchf	batch mode (rsx only)
+c	termf	running from a terminal
+c	errorf	error found (unused)
+c	smkey2	reading from user keyfile
+c	donef	atend signals return to non-existant level
+c		i.e., return to original calling program without
+c		further action
+c	membuf	use STRING for input (GETLIN)
+c	logitf	logging of program use flag
+c	quietf	no messages to terminal if true
+c	logcmf	log commands to terminal from command file if true
+c	skipif	if .true. skip command lines  until else of endif
+c	skipwh	if .true. skip command lines until endw
+c
diff --git a/ppl/include/TAXIS.INC b/ppl/include/TAXIS.INC
new file mode 100644
index 0000000..314e478
--- /dev/null
+++ b/ppl/include/TAXIS.INC
@@ -0,0 +1,44 @@
+c
+c	taxis
+C** 
+C**    @(#)TAXIS.INC	1.2    3/15/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/TXSCOM/ TLO,DT,TCSIZE,ITYPET, 
+     *	NMTCT,LABELT,IFDB,ISDB,ITFLG,VANG,IVFLG,IAUTOT,
+     *	ITXTPE,ITXLBP
+c
+c	tlo	x value corresponding to the start time (index number)
+c	dt	sampling rate in minutes (minutes)
+c	tcsize	character height for time axis labels (inches)
+c	itypet	=0 use taxis0  hours/days
+c		=1 use taxis1  days/months
+c		=3 use taxis3  months/years
+c	nmtct	number of small tics
+c	labelt	position of labels and label type control
+c	ifdb	labeling interval primary labels
+c	isdb	labeling interval secondary labels
+c	itflg	=-1 y time axis on
+c		=0    time axis off
+c		=1  x time axis on
+c	vang	rotation angle for stick plots (degrees)
+c	ivflg	=0 normal line plot
+c		=1 PLOTV command used
+c		=2 PLOTUV command used
+c		=3 VELVCT command used
+c	iautot	=0 manual entry of time axis specifications
+c		=1 automatic selection of time axis specs (EPIC and BIBO only)
+c
+c	itxtpe  the type of label
+c
+c	itxlbp  the position of the label  labelt=itxtpe*itxlbp
+c
+c*******************************************************************
diff --git a/ppl/include/TBLE.INC b/ppl/include/TBLE.INC
new file mode 100644
index 0000000..40f5cb7
--- /dev/null
+++ b/ppl/include/TBLE.INC
@@ -0,0 +1,23 @@
+c
+c	tble
+C** 
+C**    @(#)TBLE.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+      COMMON /TBLE/PTAB(8,4),DTTAB(8,29),FTTAB(8,9),WTTAB(8,11)
+      COMMON /TBLE/STTAB(8,19),PCTAB(8,5),UNIT(4,15)
+c
+      COMMON /NTBLE/NPTAB,NDTTAB,NFTTAB,NWTTAB
+      COMMON /NTBLE/NSTTAB,NPCTAB,NUNIT
+c
+c	contains the data base for BIBO formated headers
+c	to be used with subroutine FILL
+c
diff --git a/ppl/include/TICS.INC b/ppl/include/TICS.INC
new file mode 100644
index 0000000..7ae480c
--- /dev/null
+++ b/ppl/include/TICS.INC
@@ -0,0 +1,28 @@
+c
+c	tics
+C** 
+C**    @(#)TICS.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY 
+c
+c	tsmx	small x axis tic size (inches)
+c	tlx	large x axis tic size (inches)
+c	tsmy	small y axis tic size (inches)
+c	tly	large y axis tic size (inches)
+c	ix	=-1 draw x tic in - y direction only
+c		=0  draw x tic in both directions
+c		=1  draw x tic in + y direction only
+c	iy	=-1 draw y tic in - x direction only
+c		=0  draw y tic in both directions
+c		=1  draw y tic in + x direction only
+c
+c*******************************************************************
diff --git a/ppl/include/TICS2.INC b/ppl/include/TICS2.INC
new file mode 100644
index 0000000..9fa6ba2
--- /dev/null
+++ b/ppl/include/TICS2.INC
@@ -0,0 +1,24 @@
+c
+c	tics2
+C** 
+C**    @(#)TICS2.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/TICS2/ITX,ITY 
+c
+c	itx	=-1 x tics on the outside of plotting region
+c		=0  x tics on both sides
+c		=1  x tics on inside
+c	ity	=-1 y tics on the outside of plotting region
+c		=0  y tics on both sides
+c		=1  y tics on inside
+c
+c*******************************************************************
diff --git a/ppl/include/VECTOR.INC b/ppl/include/VECTOR.INC
new file mode 100644
index 0000000..a8f2faf
--- /dev/null
+++ b/ppl/include/VECTOR.INC
@@ -0,0 +1,39 @@
+c
+c	vector
+C** 
+C**    @(#)VECTOR.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C ** v5.81 *acm* lengthen strings containing format to 40 characters.
+c
+	COMMON/VECTOR/VLEN,VUSRLN,VXLOC,VYLOC,VPOS,VMINLN,
+     *	ARMAX,ARMIN,HFACT,VSKPX,VSKPY,DENSITY,NEED_COS,TRNSPZ,
+     *	VAUTO,VUSER,VKEY,VFRMT
+c
+c	vlen	vector length (inches) used for key length
+c	vusrln	user unit value for vlen vector
+c	vauto	logical if true auto scale
+c	vxloc	x location for key
+c	vyloc	y location for key
+c	vuser	logical if true user units for position
+c	vkey	logical if true draw the key
+c	vpos	justification for key
+c	vfrmt	format to use for key label
+c	vskpx	skip x
+c	vskpy	skip y
+c	vminln	minimum vector size
+c	armax	size for maximum head size
+c	armin	size for minimum head size
+c	hfact	size factor for head
+c       density density parameter for flowlines
+c       need_cos flag for geographical correction 
+c       transpz flag for transpose (needed for geographical cosine correction)
+c
+c*******************************************************************
diff --git a/ppl/include/VIEW.INC b/ppl/include/VIEW.INC
new file mode 100644
index 0000000..d0d02c4
--- /dev/null
+++ b/ppl/include/VIEW.INC
@@ -0,0 +1,26 @@
+c
+c	view
+C** 
+C**    @(#)VIEW.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/VIEWS/VIEWX,VIEWY,VIEWZ,ZSCLE,XYSCLE,
+     *	VEWZMN,VEWZMX
+c
+c	viewx	x view point
+c	viewy	y view point
+c	viewz	z view point
+c	zscle	the scale for z  or 0
+c	xyscle	switch for what scale to use
+c	vewzmn	min z value for box
+c	vewzmx max z value for box
+c
+c*******************************************************************
diff --git a/ppl/include/XYLABP.INC b/ppl/include/XYLABP.INC
new file mode 100644
index 0000000..651b685
--- /dev/null
+++ b/ppl/include/XYLABP.INC
@@ -0,0 +1,34 @@
+c
+c	xylabp
+C** 
+C**    @(#)XYLABP.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/XYLABP/XLABS(NLABS),YLABS(NLABS),RLABS(NLABS),
+     *  LTYPE(NLABS),XLLABS(NLABS),YLLABS(NLABS),LLTYPE(NLABS),
+     *	RHLABS(NLABS),USRLBS(NLABS)
+	LOGICAL USRLBS
+c
+c	xlabs()	x position of moveable label (user units)
+c	ylabs() y position of moveable label (user units)
+c	rlabs()	angle to draw label (degrees)
+c	ltype()	=-1 x,y is at lower left of label
+c		=0  x,y is at lower center of label
+c		=1  x,y is at lower right of label
+c	xllabs()x position of line start (user units)
+c	yllabs()y position of line start (user units)
+c	lltype()=0 no line
+c		=1 normal line
+c		=2 fancy line
+c	rhlabs()character height for moveable label (inches)
+c	usrlbs()user units if true  (system units if false)
+c
+c*******************************************************************
diff --git a/ppl/include/ZGRID.INC b/ppl/include/ZGRID.INC
new file mode 100644
index 0000000..f28f10f
--- /dev/null
+++ b/ppl/include/ZGRID.INC
@@ -0,0 +1,27 @@
+c
+c	zgrid
+C** 
+C**    @(#)ZGRID.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+	COMMON/ZGRD/IZTYP,IZMRK,IZLEN
+c
+c	controls the plotting of the positions of ungridded x,y,z data
+c
+c	iztyp	=0 no points drawn
+c		=1 points drawn along the x axis
+c		=2 points drawn along the y axis
+c		=3 points drawn at each raw input value
+c	izmrk	=0 use the default mark
+c		=n use mark n to denote the location
+c	izlen	number of points in the x,y,z triplets
+c
+c*******************************************************************
diff --git a/ppl/include/ZGRIDD.INC b/ppl/include/ZGRIDD.INC
new file mode 100644
index 0000000..97b9540
--- /dev/null
+++ b/ppl/include/ZGRIDD.INC
@@ -0,0 +1,24 @@
+c
+c	zgridd
+C** 
+C**    @(#)ZGRIDD.INC	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C 9/2013 *ACM*	See ticket 2092. These arrays are the coordinate 
+C               data for 2D graphics. Increase the size to match
+C               Ferret's storage limit on irregular coordinates. 
+C
+	PARAMETER (IZSE=750000)
+	COMMON/ZGRIDD/XX(IZSE),YY(IZSE),ZZ(IZSE)
+c
+c	xx()	x variable as read in
+c	yy()	y variable as read in
+c	zz()	z variable as read in
+c*******************************************************************
diff --git a/ppl/ourlib/LIB_NAME b/ppl/ourlib/LIB_NAME
new file mode 100644
index 0000000..60fa008
--- /dev/null
+++ b/ppl/ourlib/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libour.a
+ 
diff --git a/ppl/ourlib/Makefile b/ppl/ourlib/Makefile
new file mode 100644
index 0000000..11a1564
--- /dev/null
+++ b/ppl/ourlib/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+ 
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/ourlib/SOURCE_FILES b/ppl/ourlib/SOURCE_FILES
new file mode 100644
index 0000000..3fc8eb5
--- /dev/null
+++ b/ppl/ourlib/SOURCE_FILES
@@ -0,0 +1,21 @@
+SRCS_F = \
+bibo5.F\
+datype5.F\
+deflt.F\
+dirrd.F\
+dsf.F\
+dtypi.F\
+init.F\
+krnd.F\
+lnblk.F\
+loadppl.F\
+logger.F\
+lpplot5.F\
+lstb5.F\
+mttime.F\
+ndig5.F\
+npbt5.F\
+squish.F\
+uninit.F\
+upper.F\
+wldfle.F 
diff --git a/ppl/ourlib/bibo5.F b/ppl/ourlib/bibo5.F
new file mode 100644
index 0000000..6066a27
--- /dev/null
+++ b/ppl/ourlib/bibo5.F
@@ -0,0 +1,212 @@
+      BLOCK DATA BIBO5
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)bibo5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+CC  DEFINITION OF INDEXES USED FOR BIBO HEADER FORMAT
+C
+      INTEGER NPTS,MIN,MAX,MEAN,PROJ,MOOR
+      INTEGER INST,DTYPE,STIME,SRATE,SLAT,SLON
+      INTEGER SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI
+      INTEGER WIND,SIG,HEAD,SCODE,PCODE,MODEN 
+      INTEGER SPTIME
+      COMMON /BIBO/ NPTS,MIN,MAX,MEAN,PROJ,MOOR
+      COMMON /BIBO/ INST,DTYPE,STIME,SRATE,SLAT,SLON
+      COMMON /BIBO/ SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI
+      COMMON /BIBO/ WIND,SIG,HEAD,SCODE,PCODE,MODEN
+      COMMON /BIBO/ SPTIME
+      DATA NPTS,MIN,MAX,MEAN,PROJ,MOOR /1,2,3,4,5,6/
+      DATA INST,DTYPE,STIME,SRATE,SLAT,SLON /8,10,11,14,15,16/
+      DATA SDEP,INDEP,IADEP,FILT,CUTLO,CUTHI /17,18,19,20,21,22/
+      DATA WIND,SIG,HEAD,SCODE,PCODE,MODEN /23,24,25,131,132,133/
+      DATA SPTIME/136/
+      END
+      BLOCK DATA TBLES
+
+      COMMON /TBLE/PTAB(8,4),DTTAB(8,29),FTTAB(8,9),WTTAB(8,11)
+      COMMON /TBLE/STTAB(8,19),PCTAB(8,5),UNIT(4,15)
+
+      COMMON /NTBLE/NPTAB,NDTTAB,NFTTAB,NWTTAB
+      COMMON /NTBLE/NSTTAB,NPCTAB,NUNIT
+
+      DATA PTAB
+     *   /2.0,0.0,4HCUE-,4HII  ,4H    ,4H    ,4H    ,4H    ,
+     1    3.0,0.0,4HSUPE,4HR CO,4HDE  ,4H    ,4H    ,4H    ,
+     2    4.0,0.0,4HCODE,4H    ,4H    ,4H    ,4H    ,4H    ,
+     3    6.0,0.0,4HSLEE,4HP   ,4H    ,4H    ,4H    ,4H    /
+      DATA DTTAB
+     1   /20.0,6.0,4H    ,4HATMO,4HSPHE,4HRIC ,4HPRES,4HSURE,
+     2    12.0,2.0,4H    ,4H  MA,4HJOR ,4HAXIS,4H CUR,4HRENT,
+     3    13.0,2.0,4H    ,4H  MI,4HNOR ,4HAXIS,4H CUR,4HRENT,
+     4    14.0,2.0,4H    ,4H  AL,4HONGS,4HHORE,4H CUR,4HRENT,
+     5    15.0,2.0,4H    ,4H CRO,4HSS-S,4HHORE,4H CUR,4HRENT,
+     6    26.0,8.0,4H    ,4H    ,4H WIN,4HD U ,4HVELO,4HCITY,
+     7    27.0,8.0,4H    ,4H    ,4H WIN,4HD V ,4HVELO,4HCITY,
+     8    28.0,7.0,4H    ,4H    ,4H    ,4H    ,4H   T,4HAU X,
+     9    29.0,7.0,4H    ,4H    ,4H    ,4H    ,4H   T,4HAU Y,
+     *    30.0,9.0,4H    ,4H    ,4H    ,4H   S,4HEA L,4HEVEL,
+     1    31.0,1.0,4H    ,4HDRY ,4HBULB,4H TEM,4HPERA,4HTURE,
+     2    16.0,8.0,4H    ,4H    ,4H MAJ,4HOR A,4HXIS ,4HWIND,
+     3    35.0,1.0,4H    ,4H    ,4H    ,4H TEM,4HPERA,4HTURE,
+     4    36.0,2.0,4H    ,4H    ,4H    ,4H  U ,4HVELO,4HCITY,
+     5    37.0,2.0,4H    ,4H    ,4H    ,4H  V ,4HVELO,4HCITY,
+     6    38.0,3.0,4H    ,4H    ,4H    ,4H    ,4HPRES,4HSURE,
+     7    17.0,8.0,4H    ,4H    ,4H MIN,4HOR A,4HXIS ,4HWIND,
+     8    43.0,10.,4H    ,4H    ,4H    ,4HCOND,4HUCTI,4HVITY,
+     9    18.0,7.0,4H  MA,4HJOR ,4HAXIS,4H WIN,4HD ST,4HRESS,
+     *    49.0,8.0,4H    ,4H    ,4H ALO,4HNGSH,4HORE ,4HWIND,
+     1    50.0,8.0,4H    ,4H    ,4HCROS,4HS-SH,4HORE ,4HWIND,
+     2    51.0,7.0,4H  AL,4HONGS,4HHORE,4H WIN,4HD ST,4HRESS,
+     3    52.0,7.0,4H CRO,4HSS-S,4HHORE,4H WIN,4HD ST,4HRESS,
+     4    53.0,0.0,4H  WI,4HND S,4HTRES,4HS DI,4HVERG,4HENCE,
+     5    54.0,0.0,4H    ,4H    ,4HWIND,4H STR,4HESS ,4HCURL,
+     6    55.0,9.0,4H    ,4H  AD,4HJUST,4HED S,4HEA L,4HEVEL,
+     7    19.0,7.0,4H  MI,4HNOR ,4HAXIS,4H WIN,4HD ST,4HRESS,
+     8    58.0,12.,4H    ,4H    ,4H    ,4HHEAT,4H CON,4HTENT,
+     9    59.0,13.,4H    ,4H    ,4H  DY,4HNAMI,4HC HE,4HIGHT/
+      DATA FTTAB
+     1   / 0.0,0.0,4H    ,4H    ,4H    ,4H    ,4H  -N,4HONE-,
+     2    10.0,0.0,4H    ,4H    ,4H RUN,4HNING,4H AVE,4HRAGE,
+     3    11.0,0.0,4H    ,4H    ,4H    ,4H  LO,4HW CO,4HSINE,
+     4    12.0,0.0,4H    ,4H    ,4H    ,4HLOW ,4HGAUS,4HSIAN,
+     5    20.0,0.0,4H    ,4H    ,4H    ,4H    ,4HDEME,4HANED,
+     6    21.0,0.0,4H    ,4H    ,4H    ,4H HIG,4HH CO,4HSINE,
+     7    22.0,0.0,4H    ,4H    ,4H RAW,4H - L,4HOW G,4HAUSS,
+     8    23.0,0.0,4H    ,4H    ,4HRAW ,4H- LO,4HW CO,4HSINE,
+     9    8*0./
+      DATA WTTAB
+     1   / 0.0,0.0,4H    ,4H    ,4H    ,4H    ,4H  -N,4HONE-,
+     2     2.0,0.0,4H    ,4H    ,4H    ,4H    ,4H  CO,4HSINE,
+     3     3.0,0.0,4H    ,4H    ,4H    ,4H COS,4HINE ,4H** 2,
+     4     4.0,0.0,4H    ,4H    ,4H    ,4H COS,4HINE ,4H** 3,
+     5     5.0,0.0,4H    ,4H    ,4H    ,4H COS,4HINE ,4H** 4,
+     6     6.0,0.0,4H    ,4H    ,4H    ,4H EXP,4HONEN,4HTIAL,
+     7     7.0,0.0,4H    ,4H    ,4H    ,4H    ,4HGAUS,4HSIAN,
+     8     8.0,0.0,4H    ,4H    ,4H    ,4H    ,4H TRI,4HPLET,
+     9     9.0,0.0,4H    ,4H    ,4H    ,4H    ,4H HAM,4HMING,
+     9    10.0,0.0,4H    ,4H    ,4H    ,4H LAN,4HCOZ ,4H** 2,
+     *    8*0./
+      DATA STTAB
+     1    /0.0,0.0,4H    ,4H    ,4H    ,4H    ,4H    ,4H    ,
+     2     1.0,0.0,4H    ,4HFOUR,4HIER ,4HCOEF,4HFICI,4HENTS,
+     3     2.0,0.0,4H    ,4H    ,4H    ,4HAUTO,4HSPEC,4HTRUM,
+     4     3.0,0.0,4H    ,4H    ,4H    ,4H  RE,4HGULA,4HR KE,
+     5     4.0,0.0,4H    ,4H    ,4H   N,4HORMA,4HLIZE,4HD KE,
+     6     5.0,0.0,4H    ,4H    ,4H    ,4H   C,4HW RO,4HTARY,
+     7     6.0,0.0,4H    ,4H    ,4H    ,4H  CC,4HW RO,4HTARY,
+     8     7.0,0.0,4H AUT,4HOSPE,4HCTRU,4HM CO,4HNFID,4HENCE,
+     9     8.0,0.0,4H    ,4HCROS,4HS-SP,4HECTR,4HAL P,4HHASE,
+     *     9.0,0.0,4HCROS,4HS-SP,4HECTR,4HAL C,4HOHER,4HENCE,
+     1    10.0,0.0,4H    ,4H    ,4HPHAS,4HE CO,4HNFID,4HENCE,
+     2    11.0,0.0,4H    ,4HCOHE,4HRENC,4HE CO,4HNFID,4HENCE,
+     3    12.0,0.0,4H    ,4H    ,4H    ,4H  CO,4HSPEC,4HTRUM,
+     4    13.0,0.0,4H    ,4H    ,4H    ,4H  QU,4HADRA,4HTURE,
+     5    14.0,0.0,4H   C,4HOSPE,4HCTRU,4HM CO,4HNFID,4HENCE,
+     6    15.0,0.0,4H   Q,4HUADR,4HATUR,4HE CO,4HNFID,4HENCE,
+     7    16.0,0.0,4H    ,4H    ,4H    ,4H   A,4HMPLI,4HTUDE,
+     8    17.0,0.0,4H    ,4H    ,4H    ,4H    ,4H   P,4HHASE,
+     9    8*0./
+      DATA PCTAB
+     1   / 0.0,0.0,4H    ,4H    ,4H    ,4H    ,4H    ,4H    ,
+     2     1.0,0.0,4H EMP,4HIRIC,4HAL D,4HECOM,4HPOSI,4HTION,
+     3    11.0,0.0,4H DYN,4HAMIC,4HAL D,4HECOM,4HPOSI,4HTION,
+     4    21.0,0.0,4H    ,4HCOMP,4HLEX ,4HDEMO,4HDULA,4HTION,
+     5    8*0.0/
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*      DATA UNIT
+*     1  /1H ,1H ,1H ,1H ,
+*     2   4H(DEG,4HREES,4H C) ,4H    ,
+*     3   4H(CM/,4HSEC),4H    ,4H    ,
+*     4   4H(DEC,4HIBAR,4HS)  ,4H    ,
+*     5   4H(DEG,4HREES,4H)   ,4H    ,
+*     6   4H(CM*,4HDEG ,4HC/SE,4HC)  ,
+*     7   4H(MIL,4HLIBA,4HRS) ,4H    ,
+*     8   4H(DYN,4HES/C,4HM**2,4H)   ,
+*     9   4H(MET,4HERS/,4HSEC),4H    ,
+*     *   4H(CEN,4HTIME,4HTERS,4H)   ,
+*     1   4H(MMH,4HOS/C,4HM)  ,4H    ,
+*     2   4H(0/0,4H0)  ,4H    ,4H    ,
+*     3   4H(JOU,4HLES/,4HM**2,4H)   ,
+*    4   4H(DYN,4H MET,4HERS),4H    ,
+*    5   4*0./
+
+      DATA NPTAB/4/,NDTTAB/29/,NFTTAB/8/,NWTTAB/10/
+      DATA NSTTAB/18/,NPCTAB/4/,NUNIT/14/
+
+      END
diff --git a/ppl/ourlib/datype5.F b/ppl/ourlib/datype5.F
new file mode 100644
index 0000000..0a8db43
--- /dev/null
+++ b/ppl/ourlib/datype5.F
@@ -0,0 +1,75 @@
+      REAL*8 FUNCTION DATYPE(JT,NCHAR)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)datype5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      DIMENSION LEN(48)
+	character type(48)*8,ty*8
+      DATA TYPE/'MAJ CRNT','MIN CRNT','ALG CRNT','CRS CRNT',
+     *     'MAJ WIND','MIN WIND','MAJ STRS','MIN STRS',
+     *     'ATM PRES','WET TEMP','DRY TEMP',
+     1     'WIND SPD','WIND DIR',' ',
+     1     'AIR U VL','AIR V VL','TAU X','TAU Y',
+     2     'SEA LVL','AIR TEMP','RTR SPD','VEC SPD','VANE DIR',
+     3     'TEMP','U VEL','V VEL','PRESSURE','TILT','EDDY KE',
+     4     'EDDY PE','SALNIITY','COND','ISO DPTH','SIGMA-T','X','Y',
+     5	   'MODE AMP','ALNG WND','CRS WND','ALG STRS','CRS STRS',
+     6     'WND STRD','WND STRC','AJD SLVL','ZONAL HF','PLOAR HF',
+     7     'HEAT CNT','DYN HGT'/
+      DATA LEN/8,8,8,8,8,8,8,8,8,8,8,8,8,1,8,8,5,5,7,8,7,7,8,4,5,
+     *     5,8,4,7,7,8,4,8,7,1,1,8,8,7,8,8,8,8,8,8,8,8,7/
+
+      IF(JT.GE.12 .AND. JT.LE.59)GO TO 100
+      write(ty,1000)JT
+ 1000 FORMAT(I3)
+	read(ty,999)datype
+999	format(a8)
+	NCHAR=3
+      GO TO 200
+
+  100 read(type(jt-11),999)datype
+      NCHAR=LEN(JT-11)
+      IF(NCHAR.LE.0)NCHAR=1
+ 200  RETURN
+      END
diff --git a/ppl/ourlib/deflt.F b/ppl/ourlib/deflt.F
new file mode 100644
index 0000000..04c7a86
--- /dev/null
+++ b/ppl/ourlib/deflt.F
@@ -0,0 +1,57 @@
+	SUBROUTINE DEFLT(FILE,NME)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)deflt.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER FILE*(*),NME*(*),TEMP*81
+	IF(INDEX(FILE,':').NE.0)RETURN
+	K=INDEX(NME,':')
+	IF(K.EQ.0)RETURN
+	TEMP=NME(1:K)
+	TEMP(K+1:)=FILE
+	FILE=TEMP
+	RETURN
+	END
diff --git a/ppl/ourlib/dirrd.F b/ppl/ourlib/dirrd.F
new file mode 100644
index 0000000..2946108
--- /dev/null
+++ b/ppl/ourlib/dirrd.F
@@ -0,0 +1,127 @@
+	SUBROUTINE DIRRD(SELSTR,LUN,FILEC,END)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dirrd.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	SUBROUTINE THAT WILL GET MULTIPLE COPIES OF A FILE BASED
+C	ON A SELECTION STRING
+C
+C	D.W. DENBO  MAR 1985
+C
+C	SELSTR -- 80 CHARACTER STRING CONTAINING WILD CARD FILE NAME
+C	LUN  -- INTEGER  (NOT USED)
+C	FILEC  -- 80 CHARACTER STRING CONTAINGING FILE NAME
+C	END    -- LOGICAL   FALSE NOT DONE  (FILEC CONTAINS NAME)
+C			    TRUE IF END OF LIST
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	LOGICAL FIRST,END
+	CHARACTER SELSTR*(*),FILEC*(*),FILE*80
+	INTEGER*4 STATUS,CONTEXT
+	DATA FIRST/.TRUE./
+	IF(FIRST)THEN
+	  J=INDEX(SELSTR,']')
+	  JLN=LNBLK(SELSTR,80)
+	  IF(SELSTR(J+1:).EQ.' ')THEN
+	    FILE=SELSTR(:J)//'*.*;*'
+	  ELSE IF(INDEX(SELSTR,'.').EQ.0)THEN
+	    FILE=SELSTR(:JLN)//'.*'
+	  ELSE
+	    FILE=SELSTR
+	  ENDIF
+	  CONTEXT=0
+	  FIRST=.FALSE.
+	ENDIF
+	END=.FALSE.
+
+C 	What is this?  Coitenly not unix... *jd* for Linux port
+#ifdef unix
+	status = 0
+#else
+	STATUS = LIB$FIND_FILE(FILE,FILEC,CONTEXT)
+#endif
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+***	IF(.NOT.STATUS)THEN
+	IF(STATUS .EQ. 0)THEN
+	  FIRST=.TRUE.
+	  END=.TRUE.
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/ourlib/dsf.F b/ppl/ourlib/dsf.F
new file mode 100644
index 0000000..9f3db24
--- /dev/null
+++ b/ppl/ourlib/dsf.F
@@ -0,0 +1,579 @@
+	SUBROUTINE RDHDSV(LN,IRQ,H,IACT,ILOC)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dsf.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	dimension H(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+        CALL CHKDSF(LN,0,I)
+	IF(INXT(I).LT.0)THEN
+	IACT=0
+	DLEN(I)=0
+	RETURN
+	ENDIF
+C	READ HEADER
+	TEMP=INXT(I)
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+C
+C	CHECK WHICH TYPE OF HEADER IT IS
+C
+	IF(IBUF(4,I).GT.0)THEN
+	DLEN(I)=IBUF(4,I)
+	ELSE
+	DLEN(I)=LBUF(13,I)
+	ENDIF
+	HLEN(I)=IBUF(3,I)
+	IBKWD(I)=IBUF(2,I)
+	IFRWD(I)=IBUF(1,I)
+	IACT=MIN0(HLEN(I)-16,IRQ)
+	INXT(I)=INXT(I)+1
+C	MOVE HEADER
+	IHD(I)=1
+	IMV=MIN0(IACT,112)
+	DO 20 J=1,IMV
+20	H(J+ILOC-1)=BUF(J+16,I)
+C	READ THE REST
+	DO 30 J=IMV+1,IACT,128
+	IMV2=MIN0(127,IACT-J)
+	READ(LN,REC=INXT(I))(H(K+ILOC-1),K=J,J+IMV2)
+30	INXT(I)=INXT(I)+1
+	INXT(I)=TEMP+(HLEN(I)-1)/128+1
+	RETURN
+	END
+
+	SUBROUTINE RDDDSV(LN,IRQ,DAT,IACT,ILOC)
+	dimension DAT(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,0,I)
+	IF(DLEN(I).LE.0)THEN
+	IACT=0
+	RETURN
+	ENDIF
+C	READ DATA
+	IACT=MIN0(IRQ,DLEN(I))
+	DLEN(I)=DLEN(I)-IACT
+	J=1
+	IF(IBP(I).EQ.1)GOTO 10
+C	COPY PARTIAL BUFFER
+	IMV=MIN0(128,IACT+IBP(I)-1)
+	DO 20 J=IBP(I),IMV
+20	DAT(J-IBP(I)+ILOC)=BUF(J,I)
+	J=IMV-IBP(I)+2
+	IBP(I)=IMV+1
+	IF(IBP(I).LE.128)GOTO 40
+10	KS=((IACT-J+1)/128)*128+J-1
+	DO 30 K=J,KS,128
+	READ(LN,REC=INXT(I))(DAT(JJ+ILOC-1),JJ=K,K+127)
+30	INXT(I)=INXT(I)+1
+	IF(KS.EQ.IACT)THEN
+	IBP(I)=1
+	ELSE
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	INXT(I)=INXT(I)+1
+C	MOVE THE REST
+	DO 50 J=KS+1,IACT
+50	DAT(J+ILOC-1)=BUF(J-KS,I)
+	IBP(I)=IACT-KS+1
+	ENDIF
+40	RETURN
+	END
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	SUBROUTINE OPNDSF(NME,DIR,LN)
+	CHARACTER NME*(*),DIR*(*),FILE*81
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+
+C	FIX for linux port.  Move initialization into block data
+	EXTERNAL DSFCOM_INIT
+
+C	CHECK IF FILE MATCHES
+	FILE=NME
+	DO 10 I=1,4
+	IF(FILE.EQ.NAME(I))GOTO 11
+	IF(NAME(I)(1:1).EQ.' ')GOTO 12
+10	CONTINUE
+C	ALL FULL DELETE A CLOSED FILE
+	DO 20 I=1,4
+	IF(LUN(I).EQ.0)GOTO 12
+20	CONTINUE
+	I=4
+C	NEW FILE 
+12	INXT(I)=1
+	NAME(I)=FILE
+	IBKWD(I)=0
+	IKEY(I)=0
+C	OPEN FILE
+11	LUN(I)=LN
+	IHD(I)=0
+	IBP(I)=1
+	IF(DIR.EQ.'RD')THEN
+	IRW(I)=0
+#ifdef unix
+	OPEN(LN,FILE=FILE,STATUS='OLD',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=512,ERR=200)
+#else
+	OPEN(LN,FILE=FILE,STATUS='OLD',readonly,ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=128,ERR=200)
+#endif
+	ELSE
+	IRW(I)=1
+#ifdef unix
+	OPEN(LN,FILE=FILE,STATUS='OLD',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=512,ERR=100)
+#else
+	OPEN(LN,FILE=FILE,STATUS='OLD',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=128,ERR=100)
+#endif
+	ENDIF
+	RETURN
+C	NEW FILE
+#ifdef unix
+100	OPEN(LN,FILE=FILE,STATUS='NEW',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=512,ERR=900)
+#else
+100	OPEN(LN,FILE=FILE,STATUS='NEW',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=128,ERR=900)
+#endif
+	INXT(I)=-1
+	IBUF(1,I)=-1
+	WRITE(LN,REC=1)(IBUF(J,I),J=1,256)
+	RETURN
+900	STOP 'FILE OPEN ERROR'
+200	continue
+#ifndef unix
+	CALL ERRSNS(IER)
+#endif
+	IF(IER.NE.44)THEN
+	INXT(I)=-1
+	ELSE
+C	POSITION FILE AND READ FILE NAME AND POINTER
+	OPEN(LN,FILE=FILE,STATUS='OLD')
+	DO 300 K=1,IKEY(I)
+	READ(LN,999,END=400)
+999	FORMAT(A24,6X,I4)
+300	CONTINUE
+	IKEY(I)=IKEY(I)+1
+	READ(LN,999,END=400)FILE,INXT(I)
+	CLOSE(LN)
+#ifdef unix
+	OPEN(LN,FILE=FILE,STATUS='OLD',ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=512,ERR=400)
+#else
+	OPEN(LN,FILE=FILE,STATUS='OLD',readonly,ACCESS='DIRECT',
+     *	FORM='UNFORMATTED',RECL=128,ERR=400)
+#endif
+	ENDIF
+	RETURN
+400	INXT(I)=-1
+	RETURN
+	END
+	SUBROUTINE WRDDSF(LN,ILEN,DAT)
+	DIMENSION DAT(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,1,I)
+	IF(IHD(I).NE.1)STOP 'NO HEADER'
+	IF(DLEN(I).EQ.0)THEN
+	DMIN(I)=1.E35
+	DMAX(I)=-DMIN(I)
+	DMEAN(I)=0.
+	ENDIF
+	DO 40 K=1,ILEN
+	IF(DAT(K).GE.1.E35)GOTO 40
+	IF(DMIN(I).GT.DAT(K))DMIN(I)=DAT(K)
+	IF(DMAX(I).LT.DAT(K))DMAX(I)=DAT(K)
+	DMEAN(I)=DMEAN(I)+DAT(K)
+40	CONTINUE
+	DLEN(I)=DLEN(I)+ILEN
+	K=1
+	IF(IBP(I).NE.1)THEN
+C	PARTIAL BUFFER EXISTS
+	KS=0
+	IF(IBP(I)+ILEN.LE.128)GOTO 50
+	K=130-IBP(I)
+	DO 10 J=IBP(I),128
+10	BUF(J,I)=DAT(J-IBP(I)+1)
+	WRITE(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	IBP(I)=1
+	INXT(I)=INXT(I)+1
+	ENDIF
+C	WRITE OUT FULL BUFFERS
+	KS=((ILEN-K+1)/128)*128+K-1
+	DO 20 J=K,KS,128
+	WRITE(LN,REC=INXT(I))(DAT(JJ),JJ=J,J+127)
+20	INXT(I)=INXT(I)+1
+C	FILL PARTIAL BUFFER
+50	KS=KS+1
+	IF(KS.GT.ILEN)RETURN
+	DO 30 J=KS,ILEN
+30	BUF(J-KS+IBP(I),I)=DAT(J)
+	IBP(I)=ILEN-KS+IBP(I)+1
+	RETURN
+	END
+	SUBROUTINE RDDDSF(LN,IRQ,DAT,IACT)
+	DIMENSION DAT(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,0,I)
+	IF(DLEN(I).LE.0)THEN
+	IACT=0
+	RETURN
+	ENDIF
+C	READ DATA
+	IACT=MIN0(IRQ,DLEN(I))
+	DLEN(I)=DLEN(I)-IACT
+	J=1
+	IF(IBP(I).EQ.1)GOTO 10
+C COPY PARTIAL BUFFER
+	IMV=MIN0(128,IACT+IBP(I)-1)
+	DO 20 J=IBP(I),IMV
+20	DAT(J-IBP(I)+1)=BUF(J,I)
+	J=IMV-IBP(I)+2
+	IBP(I)=IMV+1
+	IF(IBP(I).LE.128)GOTO 40
+10	KS=((IACT-J+1)/128)*128+J-1
+	DO 30 K=J,KS,128
+	READ(LN,REC=INXT(I))(DAT(JJ),JJ=K,K+127)
+30	INXT(I)=INXT(I)+1
+	IF(KS.EQ.IACT)THEN
+	IBP(I)=1
+	ELSE
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	INXT(I)=INXT(I)+1
+C	MOVE THE REST
+	DO 50 J=KS+1,IACT
+50	DAT(J)=BUF(J-KS,I)
+	IBP(I)=IACT-KS+1
+	ENDIF
+40	RETURN
+	END
+	SUBROUTINE WRHDSV(LN,ILEN,H,ILOC)
+	CHARACTER DTE*10,TME*10,FDTE*24
+	dimension H(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,1,I)
+C	POSITION FILE TO END
+11	IF(INXT(I).LT.0)GOTO 20
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	IBKWD(I)=INXT(I)
+	INXT(I)=IBUF(1,I)
+	GOTO 11
+20	INXT(I)=-INXT(I)
+	IHD(I)=1
+	HDPT(I)=INXT(I)
+C	FIRST BUFFER
+	DLEN(I)=0
+	HLEN(I)=ILEN+16
+	IBUF(2,I)=IBKWD(I)
+	IBUF(3,I)=HLEN(I)
+#ifdef unix
+	CALL FDATE(FDTE)
+	DTE=FDTE(5:11)//FDTE(23:24)
+	TME=FDTE(12:19)
+#else
+	call date(dte)
+	call time(tme)
+#endif
+	READ(DTE,999)(IBUF(J,I),J=5,9)
+	READ(TME,999)(IBUF(J,I),J=10,14)
+999	FORMAT(5A2)
+	DO 30 K=1,112
+30	BUF(16+K,I)=H(K+ILOC-1)
+	WRITE(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	INXT(I)=INXT(I)+1
+	DO 40 K=113,ILEN,128
+	WRITE(LN,REC=INXT(I))(H(J+ILOC-1),J=K,K+127)
+40	INXT(I)=INXT(I)+1
+	RETURN
+	END
+	SUBROUTINE CHKDSF(LN,JRW,I)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	DO 10 I=1,4
+	IF(LUN(I).EQ.LN)GOTO 11
+10	CONTINUE
+	GOTO 12
+11	IF(JRW.EQ.IRW(I))RETURN
+12	STOP 'DSF LN OR R/W'
+	END
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	SUBROUTINE RWDDSF(NME)
+	CHARACTER NME*(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	DO 10 I=1,4
+	IF(NME.EQ.NAME(I))GOTO 11
+10	CONTINUE
+	RETURN
+11	INXT(I)=1
+	IKEY(I)=0
+	RETURN
+	END
+	SUBROUTINE CLSDSF(LN)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	DO 10 I=1,4
+	IF(LUN(I).EQ.LN)GOTO 11
+10	CONTINUE
+	STOP
+11	IF(IRW(I).EQ.0)THEN
+C	READ STATUS
+	INXT(I)=IFRWD(I)
+	ELSE
+	IF(IBP(I).NE.1)THEN
+	WRITE(LN,REC=INXT(I))(IBUF(J,I),J=1,256)
+	INXT(I)=INXT(I)+1
+	ENDIF
+C	READ HEADER AND UPDATE
+	INXT(I)=-INXT(I)
+	READ(LN,REC=HDPT(I))(IBUF(J,I),J=1,256)
+	IBUF(1,I)=INXT(I)
+C
+C	OUTPUT NEW TYPE OF HEADER 
+C
+	IF(DLEN(I).GT.32767)THEN
+	IBUF(4,I)=-1
+	LBUF(13,I)=DLEN(I)
+	ELSE
+	IBUF(4,I)=DLEN(I)
+	ENDIF
+C
+C
+	BUF(17,I)=FLOAT(DLEN(I))
+	BUF(18,I)=DMIN(I)
+	BUF(19,I)=DMAX(I)
+	IF(DLEN(I).EQ.0)THEN
+	BUF(20,I)=0.
+	ELSE
+	BUF(20,I)=DMEAN(I)/BUF(17,I)
+	ENDIF
+	WRITE(LN,REC=HDPT(I))(IBUF(J,I),J=1,256)
+	IF(IBKWD(I).GT.0)THEN
+	READ(LN,REC=IBKWD(I))(IBUF(J,I),J=1,256)
+	IBUF(1,I)=-IBUF(1,I)
+	WRITE(LN,REC=IBKWD(I))(IBUF(J,I),J=1,256)
+	ENDIF
+	IBKWD(I)=HDPT(I)
+	ENDIF
+	CLOSE(LN)
+	LUN(I)=0
+	RETURN
+	END
+	SUBROUTINE WRHDSF(LN,ILEN,H)
+	CHARACTER DTE*10,TME*10,FDTE*24
+	DIMENSION H(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,1,I)
+C	POSITION FILE TO END
+11	IF(INXT(I).LT.0)GOTO 20
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	IBKWD(I)=INXT(I)
+	INXT(I)=IBUF(1,I)
+	GOTO 11
+20	INXT(I)=-INXT(I)
+	IHD(I)=1
+	HDPT(I)=INXT(I)
+C	FIRST BUFFER
+	DLEN(I)=0
+	HLEN(I)=ILEN+16
+	IBUF(2,I)=IBKWD(I)
+	IBUF(3,I)=HLEN(I)
+#ifdef unix
+	CALL FDATE(FDTE)
+	DTE=FDTE(5:11)//FDTE(23:24)
+	TME=FDTE(12:19)
+#else
+	call date(dte)
+	call time(tme)
+#endif
+	READ(DTE,999)(IBUF(J,I),J=5,9)
+	READ(TME,999)(IBUF(J,I),J=10,14)
+999	FORMAT(5A2)
+	DO 30 K=1,112
+30	BUF(16+K,I)=H(K)
+	WRITE(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	INXT(I)=INXT(I)+1
+	DO 40 K=113,ILEN,128
+	WRITE(LN,REC=INXT(I))(H(J),J=K,K+127)
+40	INXT(I)=INXT(I)+1
+	RETURN
+	END
+	SUBROUTINE WRDDSV(LN,ILEN,DAT,ILOC)
+	dimension DAT(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,1,I)
+	IF(IHD(I).NE.1)STOP 'NO HEADER'
+	IF(DLEN(I).EQ.0)THEN
+	DMIN(I)=1.E35
+	DMAX(I)=-DMIN(I)
+	DMEAN(I)=0.
+	ENDIF
+	DO 40 K=1,ILEN
+	IF(DAT(K+ILOC-1).GE.1.E35)GOTO 40
+	IF(DMIN(I).GT.DAT(K+ILOC-1))DMIN(I)=DAT(K+ILOC-1)
+	IF(DMAX(I).LT.DAT(K+ILOC-1))DMAX(I)=DAT(K+ILOC-1)
+	DMEAN(I)=DMEAN(I)+DAT(K+ILOC-1)
+40	CONTINUE
+	DLEN(I)=DLEN(I)+ILEN
+	K=1
+	IF(IBP(I).NE.1)THEN
+C	PARTIAL BUFFER EXISTS
+	KS=0
+	IF(IBP(I)+ILEN.LE.128)GOTO 50
+	K=130-IBP(I)
+	DO 10 J=IBP(I),128
+10	BUF(J,I)=DAT(J-IBP(I)+ILOC)
+	WRITE(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+	IBP(I)=1
+	INXT(I)=INXT(I)+1
+	ENDIF
+C	WRITE OUT FULL BUFFERS
+	KS=((ILEN-K+1)/128)*128+K-1
+	DO 20 J=K,KS,128
+	WRITE(LN,REC=INXT(I))(DAT(JJ+ILOC-1),JJ=J,J+127)
+20	INXT(I)=INXT(I)+1
+C	FILL PARTIAL BUFFER
+50	KS=KS+1
+	IF(KS.GT.ILEN)RETURN
+	DO 30 J=KS,ILEN
+30	BUF(J-KS+IBP(I),I)=DAT(J+ILOC-1)
+	IBP(I)=ILEN-KS+IBP(I)+1
+	RETURN
+	END
+	SUBROUTINE RDHDSF(LN,IRQ,H,IACT)
+	DIMENSION H(*)
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+	CALL CHKDSF(LN,0,I)
+	IF(INXT(I).LT.0)THEN
+	IACT=0
+	DLEN(I)=0
+	RETURN
+	ENDIF
+C	READ HEADER
+	TEMP=INXT(I)
+	READ(LN,REC=INXT(I))(BUF(J,I),J=1,128)
+C
+C	CHECK FOR DLEN TYPE
+C
+	IF(IBUF(4,I).GT.0)THEN
+	DLEN(I)=IBUF(4,I)
+	ELSE
+	DLEN(I)=LBUF(13,I)
+	ENDIF
+	HLEN(I)=IBUF(3,I)
+	IBKWD(I)=IBUF(2,I)
+	IFRWD(I)=IBUF(1,I)
+	IACT=MIN0(HLEN(I)-16,IRQ)
+	INXT(I)=INXT(I)+1
+C	MOVE HEADER
+	IHD(I)=1
+	IMV=MIN0(IACT,112)
+	DO 20 J=1,IMV
+20	H(J)=BUF(J+16,I)
+C	READ THE REST
+	DO 30 J=IMV+1,IACT,128
+	IMV2=MIN0(127,IACT-J)
+	READ(LN,REC=INXT(I))(H(K),K=J,J+IMV2)
+30	INXT(I)=INXT(I)+1
+	INXT(I)=TEMP+(HLEN(I)-1)/128+1
+	RETURN
+	END
+
+	BLOCK DATA DSFCOM_INIT
+#ifdef unix
+	INCLUDE 'DSFCOM.DAT'
+#else
+        INCLUDE 'pplinc:DSFCOM.DAT'
+#endif
+C	FIX for linux port.  Move initialization into block data
+	DATA NAME/4*' '/,INXT/4*0/,LUN/4*0/
+
+	END
+
+	
+
diff --git a/ppl/ourlib/dtypi.F b/ppl/ourlib/dtypi.F
new file mode 100644
index 0000000..793fb6a
--- /dev/null
+++ b/ppl/ourlib/dtypi.F
@@ -0,0 +1,66 @@
+	SUBROUTINE DTYPI(IN,OUT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dtypi.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	INTEGER OUT
+	character LIST(48)*2,inc*2
+	DATA LIST/'WJ','WI','WA','WC','AJ','AI','TJ','TI',
+     *	'AP','WB','DB','AS','AD','  ','AU','AV','TX','TY',
+     *	'SL','AT','RS','SP','RD','WT','WU','WV','WP','TL','  ','  ',
+     *	'SA','CO','ID','ST','XX','YY','MA','AA','AC','TA','TC','TD',
+     *	'TR','AS','ZF','PF','HC','DH'/
+	K=IN-11
+	read(list(k),999)out
+999	format(a2)
+	RETURN
+	ENTRY IDTYP(IN,OUT)
+	write(inc,999)in
+	DO 10 I=1,48
+	IF(INc.EQ.LIST(I))GOTO 11
+10	CONTINUE
+	RETURN
+11	OUT=I+11
+	RETURN
+	END
diff --git a/ppl/ourlib/init.F b/ppl/ourlib/init.F
new file mode 100644
index 0000000..a42cf7b
--- /dev/null
+++ b/ppl/ourlib/init.F
@@ -0,0 +1,175 @@
+	subroutine init(nme,key,n)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)init.F	1.1    3/10/88
+C** v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	vax/vms version of init
+c
+c	d. denbo   january 85
+c
+#ifdef unix
+	character key(1)*5,nme(1)*81,line*2048,yn*3
+	ic=iargc()
+	if(ic.gt.0)then
+	call getarg(1,line)
+	else
+	line=' '
+	endif
+	istp=2048
+#else
+	character key(1)*5,nme(1)*81,line*2048,cr*1,esc*1,yn*3
+	byte buf(2048),crb,escb
+	equivalence (line,buf(1)),(cr,crb),(esc,escb)
+	integer*4 lib$get_foreign,istat
+	data crb/13/,escb/27/
+	istat=lib$get_foreign(line,,)
+	istp=index(line,cr)
+	if(istp.eq.0)istp=index(line,esc)
+	if(istp.eq.0)istp=2048
+#endif
+	line(istp:istp)=' '
+	is=1
+100	k=index(line,'=')
+	if(k.le.0.or.k.ge.istp)goto 200
+	line(k:k)=' '
+	do 10 i=1,n
+	if(key(i).eq.line(is:k-1))goto 11
+10	continue
+	i=n+1
+11	if=0
+	do 20 j=k+1,istp
+	if(line(j:j).eq.'[')then
+	    if=1
+	    ibrk=index(line(j:),']')+j-1
+	    icma=index(line(j:),',')+j-1
+	    if(icma.gt.ibrk)if=0
+	endif
+	if(line(j:j).eq.','.and.if.eq.1)then
+	if=0
+	goto 20
+	endif
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       *jd* if stmt below placed entirely within ifdef for MAC 7.92 
+
+#ifdef unix
+	if(line(j:j).eq.','.or.line(j:j).eq.' '
+     *	.or.line(j:j).eq.':')goto 21
+#else
+	if(line(j:j).eq.','.or.line(j:j).eq.' '
+     *	.or.line(j:j).eq.'/')goto 21
+#endif
+
+20	continue
+21	if(i.le.n)nme(i)=line(k+1:j-1)
+	is=j+1
+	goto 100
+#ifdef unix
+200	k=index(line,':')
+#else
+200	k=index(line,'/')
+#endif
+	if(k.le.0.or.k.ge.istp)return
+	line(k:k)=' '
+	if(line(k+1:k+1).eq.'-')then
+	k=k+2
+	yn='no'
+	else
+	k=k+1
+	yn='yes'
+	endif
+	do 30 j=k,istp
+
+*       *jd* as above
+
+#ifdef unix
+	if(line(j:j).eq.' '.or.line(j:j).eq.','
+     *	.or.line(j:j).eq.':')goto 31
+#else
+	if(line(j:j).eq.' '.or.line(j:j).eq.','
+     *	.or.line(j:j).eq.'/')goto 31
+#endif
+30	continue
+31	do 40 i=1,n
+	if(key(i).eq.line(k:j-1))goto 41
+40	continue
+	goto 200
+41	nme(i)=yn
+	goto 200
+	end
diff --git a/ppl/ourlib/krnd.F b/ppl/ourlib/krnd.F
new file mode 100644
index 0000000..6dc4861
--- /dev/null
+++ b/ppl/ourlib/krnd.F
@@ -0,0 +1,50 @@
+      FUNCTION KRND(A)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)krnd.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      KRND=INT(SIGN(ABS(A)+0.5,A))
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
diff --git a/ppl/ourlib/lnblk.F b/ppl/ourlib/lnblk.F
new file mode 100644
index 0000000..c285d0d
--- /dev/null
+++ b/ppl/ourlib/lnblk.F
@@ -0,0 +1,65 @@
+      FUNCTION LNBLK(STRING, NCHAR)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+** 
+C**    @(#)lnblk.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+CC  THIS FUNCTION RETURNS THE CHARACTER POSITION
+CC  OF THE LAST NON-BLANK CHARACTER IN THE STRING.
+CC  CHARACTERS ARE NUMBERED STARTING WITH 1 AT THE
+CC  LEFT OF THE FIRST WORD AND ARE PACKED TEN WORD
+CC  WITH BLANK FILL. NCHAR TELLS LNBLK WHERE TO START
+CC  THE SEARCH FOR THE LAST NON BLANK CHARACTER
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER STRING*(*)
+	DO 10 I=NCHAR,1,-1
+	IF(STRING(I:I).NE.' ')GOTO 11
+10	CONTINUE
+	LNBLK=1
+	RETURN
+11	LNBLK=I
+      RETURN
+      END
diff --git a/ppl/ourlib/loadppl.F b/ppl/ourlib/loadppl.F
new file mode 100644
index 0000000..faa42c6
--- /dev/null
+++ b/ppl/ourlib/loadppl.F
@@ -0,0 +1,275 @@
+	subroutine ldgrid(xmin,xmax,nx,ymin,ymax,ny,itype,ang,gty,info)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)loadppl.f	1.3    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	load and read grid information into ppl header
+c
+	character info*(*),gty*(*),str*32
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	pxmin=xmin
+	pxmax=xmax
+	pnx=nx
+	pymin=ymin
+	pymax=ymax
+	pny=ny
+	ptype=itype
+	gxornt=ang
+	write(str,'(f5.1)')ang
+	read(str,999)gornt
+999	format(2a4)
+	read(gty,999)gtype
+	read(info,998)grid
+998	format(8a4)
+	return
+	entry gtgrid(xmin,xmax,nx,ymin,ymax,ny,itype,ang,gty,info)
+c
+	xmin=pxmin
+	xmax=pxmax
+	nx=pnx
+	ymin=pymin
+	ymax=pymax
+	ny=pny
+	itype=ptype
+	ang=gxornt
+	write(gty,999)gtype
+	write(info,998)grid
+	return
+	end
+c
+	subroutine ldcmnt(cma,cmb,cmc,cmd,cme)
+c
+c	load the 120 character comments for the ppl header
+c
+	character cma*(*),cmb*(*),cmc*(*),cmd*(*),cme*(*)
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	read(cma,999)cmnta
+999	format(30a4)
+	read(cmb,999)cmntb
+	read(cmc,999)cmntc
+	read(cmd,999)cmntd
+	read(cme,999)cmnte
+	return
+	entry gtcmnt(cma,cmb,cmc,cmd,cme)
+	write(cma,999)cmnta
+	write(cmb,999)cmntb
+	write(cmc,999)cmntc
+	write(cmd,999)cmntd
+	write(cme,999)cmnte
+	return
+	end
+c
+	subroutine lduser(usa,usb,usc,usd)
+c
+c	load the 32 character user strings into the ppl header
+c
+	character usa*(*),usb*(*),usc*(*),usd*(*)
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	read(usa,999)usera
+999	format(8a4)
+	read(usb,999)userb
+	read(usc,999)userc
+	read(usd,999)userd
+	return
+	entry gtuser(usa,usb,usc,usd)
+	write(usa,999)usera
+	write(usb,999)userb
+	write(usc,999)userc
+	write(usd,999)userd
+	return
+	end
+c
+	subroutine ldplid(ident,source,dte,tme)
+c
+c	load the plot identification information for the ppl header
+c
+	character ident*(*),source*(*),dte*(*),tme*(*)
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	read(ident,999)pident
+999	format(8a4)
+	read(source,999)psrc
+	read(dte,998)pdate
+998	format(4a4)
+	read(tme,998)ptime
+	return
+	entry gtplid(ident,source,dte,tme)
+	write(ident,999)pident
+	write(source,999)psrc
+	write(dte,998)pdate
+	write(tme,998)ptime
+	return
+	end
+c
+	subroutine ldvar(name,dte,tme,ident,
+     *		mean,var,std,rms,min,max,jdate,lat,long)
+c
+c	load the variable information into the ppl header
+c
+	character name*(*),dte*(*),tme*(*),ident*(*),str*16
+	real mean,var,std,rms,min,max,jdate,lat,long
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	vxmean=mean
+	vxvar=var
+	vxmin=min
+	vxmax=max
+	vxjdat=jdate
+	vxlat=lat
+	vxlong=long
+	read(name,999)varnme
+999	format(8a4)
+	read(dte,998)vdate
+998	format(4a4)
+	read(tme,998)vtime
+	read(ident,999)vident
+c
+c	format the variables
+c
+	write(str,1000)mean
+1000	format(1pg12.5)
+	read(str,998)vmean
+	write(str,1000)var
+	read(str,998)vvar
+	write(str,1000)std
+	read(str,998)vstd
+	write(str,1000)rms
+	read(str,998)vrms
+	write(str,1000)min
+	read(str,998)vmin
+	write(str,1000)max
+	read(str,998)vmax
+	write(str,1001)jdate
+1001	format(f8.2)
+	read(str,998)vjdate
+	ideg=abs(int(lat))
+	imin=(abs(lat)-ideg)*60
+	write(str,1002)ideg,imin
+1002	format(i3,'#',i3,' ')
+	k=8
+	if(imin.eq.0)k=4
+	if(lat.gt.0)then
+	    str=str(:k)//'N'
+	else
+	    str=str(:k)//'S'
+	endif
+	read(str,998)vlat
+	ideg=abs(int(long))
+	imin=(abs(long)-ideg)*60
+	write(str,1002)ideg,imin
+	k=8
+	if(imin.eq.0)k=4
+	if(long.gt.0)then
+	    str=str(:k)//'E'
+	else
+	    str=str(:k)//'W'
+	endif
+	read(str,998)vlong
+	return
+	entry gtvar(name,dte,tme,ident,
+     *		mean,var,std,rms,min,max,jdate,lat,long)
+c
+c	not all the formatted strings are returned here!
+c
+	mean=vxmean
+	var=vxvar
+	min=vxmin
+	max=vxmax
+	jdate=vxjdat
+	lat=vxlat
+	long=vxlong
+	write(name,999)varnme
+	write(dte,998)vdate
+	write(tme,998)vtime
+	write(ident,999)vident
+	return
+	end
+c
+	subroutine ldaxlb(xlab,ylab,mlab)
+c
+c	load the axis labels into the ppl header
+c
+	character xlab*(*),ylab*(*),mlab*(*)
+#ifdef unix
+	include 'PPL.INC'
+#else
+	include 'pplinc:PPL.INC'
+#endif
+c
+	read(xlab,999)pxlab
+999	format(20a4)
+	read(ylab,999)pylab
+	read(mlab,998)pmlab
+998	format(30a4)
+	return
+	entry gtaxlb(xlab,ylab,mlab)
+	write(xlab,999)pxlab
+	write(ylab,999)pylab
+	write(mlab,998)pmlab
+	return
+	end
diff --git a/ppl/ourlib/logger.F b/ppl/ourlib/logger.F
new file mode 100644
index 0000000..a718f2c
--- /dev/null
+++ b/ppl/ourlib/logger.F
@@ -0,0 +1,46 @@
+      SUBROUTINE LOGGER (PROGRAMNAME)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     Dummy version that does no logging
+
+      character*(*) programname
+
+      return
+      end
+
+
+
diff --git a/ppl/ourlib/lpplot5.F b/ppl/ourlib/lpplot5.F
new file mode 100644
index 0000000..7c774fd
--- /dev/null
+++ b/ppl/ourlib/lpplot5.F
@@ -0,0 +1,163 @@
+      SUBROUTINE LPPLOT(XARRAY,YARRAY,NPTS,XFACT,YFACT,XLOW,YLOW,
+     1    XORG,YORG,XTIC,YTIC,CHAR,LUN,NLINES)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)lpplot5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C         LPPLOT GENERATES A LINE PRINTER PLOT 101 COLUMNS WIDE BY
+C         NLINES LINES HIGH. IT DOES NOT DO A PAGE EJECT BEFORE HAND NOR
+C         DOES IT DO AXES LABELLING.  IT WILL LABEL TICK MARKS HOWEVER.
+C
+C         THE CALLING PARAMETERS ARE SIMILAR TO COMPLOT:
+C                 XARRAY:HOLDS THE X VALUE OF THE POINTS.
+C                 YARRAY:HOLDS THE Y VALUE OF THE POINTS.
+C                 NPTS:  THE NUMBER OF POINTS TO BE PLOTTED.
+C                 XFACT: NUMBER OF COLUMNS PER USER UNIT.
+C                 YFACT: NUMBER OF LINES PER USER UNIT.
+C                 XLOW:  LOWEST VALUE OF THE X AXIS.
+C                 YLOW:  LOWEST VALUE OF THE Y AXIS.
+C                 XORG:  THE X-COORDINATE WHERE THE AXES CROSS.
+C                 YORG:  THE Y-COORDINATE WHERE THE AXES CROSS.
+C                 XTIC:  THE DISTANCE BETWEEN X TICK MARKS IN
+C                        USER UNITS.
+C                 YTIC:  THE DISTANCE BETWEEN Y TICK MARKS IN
+C                        USER UNITS.
+C                 CHAR:  THE CHARACTER TO BE USED TO MARK A POINT.
+C                 LUN:   THE LOGICAL UNIT NUMBER ON WHICH TO PUT THE PLOT.
+C                 NLINES:HEIGHT OF THE PLOT IN LINES.
+C
+      DIMENSION XARRAY(1),YARRAY(1)
+
+#ifdef STAR_1_SUPPORTED
+      integer*1 DATBUF(101),PRBUFF(121),BLANK,STAR,EYE,CHAR
+#else
+      BYTE DATBUF(101),PRBUFF(121),BLANK,STAR,EYE,CHAR
+#endif
+
+      DIMENSION XLAB(20),LABLOC(20)
+      EQUIVALENCE(PRBUFF(11),DATBUF(1))
+      DATA BLANK/1H /,STAR/1H*/,EYE/1HI/
+
+      YINCD2=0.5/YFACT
+      LINORG=FLOAT(NLINES)+0.5-(YORG-YLOW)*YFACT
+      NXTICS=100.0/(XFACT*XTIC)+1
+
+      DO 700 LINE=1,NLINES
+
+      DO 50 JCOL=1,121
+   50 PRBUFF(JCOL)=BLANK
+      CALL XFILL(XORG,DATBUF,XFACT,XLOW,STAR)
+
+      IF(LINE.NE.LINORG)GO TO 200
+      DO 80 JCOL=1,101
+   80 DATBUF(JCOL)=STAR
+      DO 100 JTIC=1,NXTICS
+      XT=(JTIC-1)*XTIC+XLOW
+      JXT=(XT-XLOW)*XFACT+1.5
+      IF(JXT.GT.101)GO TO 200
+      DATBUF(JXT)=EYE
+      XLAB(JTIC)=XT
+      LABLOC(JTIC)=JXT+5
+  100 CONTINUE
+
+  200 IF(LINE.NE.LINORG+1)GO TO 250
+      DO 230 JTIC=1,NXTICS
+      L=LABLOC(JTIC)
+      IF(L.LT.1 .OR. L.GT.111)GO TO 230
+      CALL CODEA1(XLAB(JTIC),PRBUFF(L))
+  230 CONTINUE
+
+  250 YCENT=(NLINES-LINE)/YFACT+YLOW
+      DO 400 JVAL=1,NPTS
+      IF(ABS(YCENT-YARRAY(JVAL)).GT.YINCD2)GO TO 400
+      CALL XFILL(XARRAY(JVAL),DATBUF,XFACT,XLOW,CHAR)
+  400 CONTINUE
+
+      IF(AMOD(YCENT-YLOW,YTIC).LE.YINCD2)GO TO 500
+      WRITE(LUN,2000)PRBUFF
+ 2000 FORMAT(11X,121A1)
+      GO TO 700
+
+  500 WRITE(LUN,3000)YCENT,PRBUFF
+ 3000 FORMAT(1X,F10.2,121A1)
+
+  700 CONTINUE
+
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+
+      SUBROUTINE XFILL(X,DATBUF,XFACT,XLOW,CHAR)
+
+#ifdef STAR_1_SUPPORTED
+      integer*1 DATBUF(101),CHAR
+#else
+      BYTE DATBUF(101),CHAR
+#endif
+
+      JCOL=(X-XLOW)*XFACT+1.5
+      IF(JCOL.LT.1 .OR. JCOL.GT.101)RETURN
+      DATBUF(JCOL)=CHAR
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+
+      SUBROUTINE CODEA1(X,COBUFF)
+
+#ifdef STAR_1_SUPPORTED
+      integer*1 COBUFF(1)
+#else
+      BYTE COBUFF(1)
+#endif
+
+      CHARACTER STR*8
+      WRITE(STR,'(F8.1)')X
+      READ(STR,999)(COBUFF(I),I=1,8)
+999	FORMAT(8A1)
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
diff --git a/ppl/ourlib/lstb5.F b/ppl/ourlib/lstb5.F
new file mode 100644
index 0000000..29525a9
--- /dev/null
+++ b/ppl/ourlib/lstb5.F
@@ -0,0 +1,352 @@
+      SUBROUTINE LSTBBO(IUNIT,HEADR)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)lstb5.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+CC  DEFINITION OF INDEXES USED FOR BIBO FORMAT:
+C
+#ifdef unix
+	INCLUDE 'BIBO.COM'
+#else
+        INCLUDE 'pplinc:BIBO.COM'
+#endif
+C
+      COMMON /TBLE/PTAB(8,4),DTTAB(8,29),FTTAB(8,9),WTTAB(8,11)
+      COMMON /TBLE/STTAB(8,19),PCTAB(8,5),UNIT(4,15)
+      COMMON /NTBLE/NPTAB,NDTTAB,NFTTAB,NWTTAB
+      COMMON /NTBLE/NSTTAB,NPCTAB,NUNIT
+
+	REAL LINE1,LINE2,BLNK
+        DIMENSION HEADR(145),LINE1(11),LINE2(15)
+#ifdef unix
+	CHARACTER FDTE*24
+* 1/03 *kob* need to equiv blnk to iblnk for g77 as well
+#if defined FORTRAN_90 || defined G77
+	integer iblnk
+	equivalence (blnk,iblnk)
+	data iblnk/Z'20202020'/
+#else
+	data blnk/'    '/
+#endif
+	CALL FDATE(FDTE)
+#else
+	character dte*10,tme*10
+	data blnk/'    '/
+	call date(dte)
+	call time(tme)
+#endif
+
+      CALL FILL(PTAB,NPTAB,HEADR(PROJ),LINE1,IER)
+#ifdef unix
+      WRITE(IUNIT,1000)(LINE1(I),I=1,6),FDTE
+ 1000 FORMAT(/1X,'PROJECT: ',6A4,T57,A24)
+#else
+      WRITE(IUNIT,1000)(LINE1(I),I=1,6),dte,tme
+ 1000 FORMAT(/1X,'PROJECT: ',6A4,T57,a10,3x,a10)
+#endif
+C        FIND THE END OF THE COMMENT FIELD:
+      DO 200 I=1,5
+      J1=(5-I)*20+HEAD
+      J2=J1+19
+      DO 100 J=J1,J2
+      IF((HEADR(J).NE.BLNK).AND.(HEADR(J).NE.0.))GO TO 300
+  100 CONTINUE
+  200 CONTINUE
+      GO TO 320
+
+  300 WRITE(IUNIT,2000)(HEADR(K),K=HEAD,J2)
+ 2000 FORMAT(10(/1X,20A4))
+
+  320 WRITE(IUNIT,3000)
+ 3000 FORMAT(1X,'GEOGRAPHIC INFORMATION:',T35,
+     1   'DESCRIPTIVE INFORMATION:'/)
+
+      JLEFT=1
+      JRITE=1
+
+  400 CALL COL1(HEADR,JLEFT,LINE1)
+      CALL COL2(HEADR,JRITE,LINE2)
+      WRITE(IUNIT,5000)(LINE1(I),I=1,9),(LINE2(I),I=1,12)
+ 5000 FORMAT(1X,8A4,A1,11A4,A3)
+      JLEFT=JLEFT+1
+      JRITE=JRITE+1
+      IF(JRITE.LE.16)GO TO 400
+
+      WRITE(IUNIT,6000)
+ 6000 FORMAT(1X)
+      RETURN
+      END
+C*F45V1P0*
+
+      SUBROUTINE COL1(HEADR,JLEFT,LINE1)
+
+      DIMENSION HEADR(145),LINE1(11)
+
+      CHARACTER TE*50,NS(2)*1,EW(2)*1
+	REAL LINE1,BLNK
+C
+CC  DEFINITION OF INDEXES USED FOR BIBO FORMAT:
+C
+#ifdef unix
+	INCLUDE 'BIBO.COM'
+#else
+        INCLUDE 'pplinc:BIBO.COM'
+#endif
+
+* 1/03 *kob* need to equiv blnk to iblnk for g77 as well
+#if defined FORTRAN_90 || defined G77
+	integer iblnk
+	equivalence (blnk,iblnk)
+	data iblnk/Z'20202020'/
+#else
+	data blnk/'    '/
+#endif
+
+      DATA NS/'N','S'/,EW/'E','W'/
+      IF(JLEFT.LE.7)GO TO 100
+      DO 50 I=1,11
+   50 LINE1(I)=BLNK
+      RETURN
+
+  100 GO TO (1,2,3,4,5,6,7),JLEFT
+
+1     WRITE(TE,1000)HEADR(MOOR),HEADR(MOOR+1)
+ 1000 FORMAT('STATION ID:',T13,2A4)
+      GOTO 200
+
+2     WRITE(TE,2000)HEADR(INST),HEADR(INST+1)
+ 2000 FORMAT('INSTRUMENT:',T13,2A4)
+      GOTO 200
+
+    3 ILAT=HEADR(SLAT)/100.0
+	IF(HEADR(SLAT).GE.0.)THEN
+	INS=1
+	ELSE
+	INS=2
+	ENDIF
+      RLAT=ABS(HEADR(SLAT)-ILAT*100.0)
+      WRITE(TE,3000)IABS(ILAT),RLAT,NS(INS)
+ 3000 FORMAT('LATITUDE:',2X,I4,1X,F4.1,1X,A1)
+      GOTO 200
+
+    4 ILONG=HEADR(SLON)/100.0
+	IF(HEADR(SLON).GE.0.)THEN
+	IEW=1
+	ELSE
+	IEW=2
+	ENDIF
+      RLONG=ABS(HEADR(SLON)-ILONG*100.0)
+      WRITE(TE,4000)IABS(ILONG),RLONG,EW(IEW)
+ 4000 FORMAT('LONGITUDE:',1X,I4,1X,F4.1,1X,A1)
+      GOTO 200
+
+5     WRITE(TE,5000)HEADR(SDEP)
+ 5000 FORMAT('STA DEPTH:',T13,F8.2,' (METERS)')
+      GOTO 200
+
+6     WRITE(TE,6000)HEADR(INDEP)
+ 6000 FORMAT('NOM DEPTH:',T13,F8.2,' (METERS)')
+      GOTO 200
+
+7     WRITE(TE,7000)HEADR(IADEP)
+ 7000 FORMAT('ACT DEPTH:',T13,F8.2,' (METERS)')
+200   READ(TE,8000)LINE1
+8000	FORMAT(11A4)
+      RETURN
+      END
+C*F45V1P0*
+      SUBROUTINE COL2(HEADR,JRITE,LINE2)
+      DIMENSION HEADR(145),LINE2(15),LSTRNG(11)
+      CHARACTER TE*60,STR*20
+	REAL LINE2,LSTRNG
+C
+CC  DEFINITION OF INDEXES USED FOR BIBO FORMAT:
+C
+#ifdef unix
+	INCLUDE 'BIBO.COM'
+#else
+        INCLUDE 'pplinc:BIBO.COM'
+#endif
+      COMMON /TBLE/PTAB(8,4),DTTAB(8,29),FTTAB(8,9),WTTAB(8,11)
+      COMMON /TBLE/STTAB(8,19),PCTAB(8,5),UNIT(4,15)
+      COMMON /NTBLE/NPTAB,NDTTAB,NFTTAB,NWTTAB
+      COMMON /NTBLE/NSTTAB,NPCTAB,NUNIT
+
+
+      GO TO (1,2,3,4,5,6,61,7,8,9,10,11,12,13,14,15),JRITE
+
+    1 CALL FILL(DTTAB,NDTTAB,HEADR(DTYPE),LSTRNG,IER)
+      WRITE(TE,1000)(LSTRNG(I),I=1,10)
+ 1000 FORMAT('DATA:',T7,6A4,1X,4A4)
+      GOTO 200
+
+    2 IF(HEADR(SCODE).GT.0.0)GO TO 23
+      JRITE=JRITE+1
+      GO TO 3
+   23 CALL FILL(STTAB,NSTTAB,HEADR(SCODE),LSTRNG,IER)
+	WRITE(TE,3000)(LSTRNG(I),I=1,10)
+	GOTO 200
+
+    3 IF(HEADR(PCODE).GT.0.0)GO TO 33
+      JRITE=JRITE+1
+      GO TO 4
+   33 CALL FILL(PCTAB,NPCTAB,HEADR(PCODE),LSTRNG,IER)
+      WRITE(TE,3000)(LSTRNG(I),I=1,10)
+ 3000 FORMAT(T7,6A4,1X,4A4)
+      GOTO 200
+
+    4 IF(HEADR(MODEN).GT.0.0)GO TO 43
+      JRITE=JRITE+1
+      GO TO 5
+43    WRITE(TE,4000)IFIX(HEADR(MODEN))
+ 4000 FORMAT('MODE NUMBER:',T21,I10)
+      GOTO 200
+
+    5 WRITE(TE,4500)IFIX(HEADR(NPTS))
+ 4500 FORMAT('NUMBER OF POINTS:',T21,I10)
+      GOTO 200
+
+    6 CALL MTDAT(HEADR(STIME),STR)
+	WRITE(TE,4800)STR
+ 4800 FORMAT('DATA START TIME:',T20,A18,'(GMT)')
+      GOTO 200
+
+61	IF(HEADR(SPTIME).EQ.0.0)THEN
+	JRITE=JRITE+1
+	GOTO 7
+	ELSE
+	CALL MTDAT(HEADR(SPTIME),STR)
+	WRITE(TE,4900)STR
+4900	FORMAT('DATA STOP TIME:',T20,A18,'(GMT)')
+	ENDIF
+	GOTO 200
+
+    7 WRITE(TE,5000)HEADR(SRATE)
+ 5000 FORMAT('SAMPLING RATE:',T21,F10.2,' (MINUTES)')
+      GOTO 200
+
+    8 CALL FILL(FTTAB,NFTTAB,HEADR(FILT),LSTRNG,IER)
+      WRITE(TE,5500)(LSTRNG(I),I=1,6)
+ 5500 FORMAT('FILTER:',T7,6A4)
+      IF(HEADR(FILT).LE.0.0)JRITE=JRITE+2
+      GOTO 200
+
+    9 WRITE(TE,5800)HEADR(CUTLO)
+ 5800 FORMAT('LOW CUTOFF:',T21,1PE10.2,' (CPH)')
+      GOTO 200
+
+   10 WRITE(TE,5900)HEADR(CUTHI)
+ 5900 FORMAT('HIGH CUTOFF:',T21,1PE10.2,' (CPH)')
+      GOTO 200
+
+   11 IF(HEADR(WIND).GT.0.0)GO TO 113
+      JRITE=JRITE+2
+      GO TO 13
+  113 CALL FILL(WTTAB,NWTTAB,HEADR(WIND),LSTRNG,IER)
+      WRITE(TE,6000)(LSTRNG(I),I=1,6)
+ 6000 FORMAT('WINDOW:',T7,6A4)
+      GOTO 200
+
+   12 WRITE(TE,6300)HEADR(SIG)
+ 6300 FORMAT('WINDOW FALLOFF:',T21,1PE10.2,' (CPH)')
+      GOTO 200
+
+   13 WRITE(TE,6500)HEADR(MIN)
+ 6500 FORMAT('MINIMUM:',T21,1PE10.2)
+      GOTO 200
+
+   14 WRITE(TE,6800)HEADR(MAX)
+ 6800 FORMAT('MAXIMUM:',T21,1PE10.2)
+      GOTO 200
+
+   15 WRITE(TE,7000)HEADR(MEAN)
+ 7000 FORMAT('MEAN:',T21,1PE10.2)
+
+200   READ(TE,8000)LINE2
+8000  FORMAT(15A4)
+      RETURN
+      END
+C*F45V1P0*
+      SUBROUTINE FILL(TABLE,N,VALUE,STRING,IER)
+
+      COMMON /TBLE/PTAB(8,4),DTTAB(8,29),FTTAB(8,9),WTTAB(8,11)
+      COMMON /TBLE/STTAB(8,19),PCTAB(8,5),UNIT(4,15)
+      COMMON /NTBLE/NPTAB,NDTTAB,NFTTAB,NWTTAB
+      COMMON /NTBLE/NSTTAB,NPCTAB,NUNIT
+
+      DIMENSION TABLE(8,N),STRING(11)
+	character str*44
+	real blnk
+#if defined FORTRAN_90 || defined G77
+	integer iblnk
+	equivalence (blnk,iblnk)
+	data iblnk/Z'20202020'/
+#else
+	data blnk/'    '/
+#endif
+
+      IER=0
+      DO 100 I=1,N
+      IF(ABS(TABLE(1,I)-VALUE).LT. 0.01)GO TO 200
+  100 CONTINUE
+
+      WRITE(STR,1000)IFIX(VALUE)
+ 1000 FORMAT(14X,I10)
+	read(str,1223)STRING
+1223	format(11a4)
+      IER=1
+      K=1
+      GO TO 400
+
+  200 DO 300 J=1,6
+  300 STRING(J)=TABLE(J+2,I)
+      K=TABLE(2,I)+1
+
+  400 DO 500 J=7,10
+  500 STRING(J)=UNIT(J-6,K)
+      STRING(11)=BLNK
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
diff --git a/ppl/ourlib/mttime.F b/ppl/ourlib/mttime.F
new file mode 100644
index 0000000..fb810d6
--- /dev/null
+++ b/ppl/ourlib/mttime.F
@@ -0,0 +1,135 @@
+      SUBROUTINE MTDAT(IT,STR)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)mttime.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	REAL IT(3)
+      CHARACTER STR*(*),MONTH(12)*3
+      DATA MONTH/'JAN','FEB','MAR','APR','MAY','JUN',
+     *           'JUL','AUG','SEP','OCT','NOV','DEC'/
+      CALL MTMDY(IT,IM,ID,IY)
+      IH=IT(3)
+      WRITE(STR,999)MONTH(IM),ID,1900+IY,IH
+999   FORMAT(A3,I3,',',I4,I6.4)
+      RETURN
+      END
+      SUBROUTINE MTMDY(IT,IM,ID,IY)
+	REAL IT(3)
+      DIMENSION IMN(12)
+      DATA IMN/1,32,60,91,121,152,182,213,244,274,305,335/
+      IY=IT(1)
+      IJ=IT(2)
+      ITST=1
+      IF(IY-(IY/4)*4.EQ.0)ITST=0
+      IF(IJ.LT.61-ITST)THEN
+      IM=IJ/32+1
+      ID=IJ-IMN(IM)+1
+      ELSE
+      IM=INT((IJ+ITST)/30.6001+.02)+1
+      ID=IJ-IMN(IM)+ITST
+      END IF
+      RETURN
+      ENTRY MDYMT(IT,IM,ID,IY)
+      IT(1)=IY
+      IF(IY-(IY/4)*4.EQ.0)THEN
+      IF(IM.LT.3)THEN
+      IT(2)=IMN(IM)+ID-1
+      ELSE
+      IT(2)=IMN(IM)+ID
+      END IF
+      ELSE
+      IT(2)=IMN(IM)+ID-1
+      END IF
+      RETURN
+      END
+      INTEGER*4 FUNCTION MTMIN(MTIME)
+C     REVISED VERSION THAT WILL WORK FOR LEAP YEARS
+C     MINUTES SINCE 1-1-1970
+	REAL MTIME(3)
+	INTEGER*4 JDN
+      CALL MTMDY(MTIME,IM,ID,IY)
+      JH=MTIME(3)/100
+      JM=AMOD(MTIME(3),100.)
+      IF(IM.GT.2)THEN
+      IM=IM+1
+      ELSE
+      IY=IY-1
+      IM=IM+13
+      END IF
+#ifdef unix
+      JDN=INT(365.25*IY)+INT(30.6001*IM)+ID-25631
+#else
+      JDN=JINT(365.25*IY)+JINT(30.6001*IM)+ID-25631
+#endif
+      MTMIN=JDN*1440+JH*60+JM
+      RETURN
+      END
+      SUBROUTINE MINMT(NMS70,IT)
+C     REVISED VERSION THAT DOES LEAP YEAR CORRECTLY
+	REAL IT(3)
+	INTEGER*4 NMS70,JDN
+      JDN=(NMS70/1440)+25631
+      IY=INT((JDN-122.1)/365.25)
+#ifdef unix
+      IM=INT((JDN-INT(365.25*IY))/30.6001)
+      ID=JDN-INT(365.25*IY)-INT(30.6001*IM)
+#else
+      IM=INT((JDN-JINT(365.25*IY))/30.6001)
+      ID=JDN-JINT(365.25*IY)-JINT(30.6001*IM)
+#endif
+      IF(IM.LT.14)THEN
+      IM=IM-1
+      ELSE
+      IM=IM-13
+      IY=IY+1
+      END IF
+      CALL MDYMT(IT,IM,ID,IY)
+      LEFT=NMS70-(NMS70/1440)*1440
+      IH=(LEFT/60)
+      IM=LEFT-60*IH
+      IT(3)=IH*100+IM
+      RETURN
+      END
diff --git a/ppl/ourlib/ndig5.F b/ppl/ourlib/ndig5.F
new file mode 100644
index 0000000..0fc6db9
--- /dev/null
+++ b/ppl/ourlib/ndig5.F
@@ -0,0 +1,57 @@
+      FUNCTION NDIG(JDIG)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)ndig5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C        NDIG FINDS THE NUMBER OF DIGITS IN AN INTEGER
+      JXTRA=1
+      IF(JDIG.GE.10)GO TO 200
+      NDIG=1
+      JXTRA=2
+      IF(JDIG.GE.0)RETURN
+
+  200 NDIG=IFIX(ALOG10(ABS(FLOAT(JDIG))))+JXTRA
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
diff --git a/ppl/ourlib/npbt5.F b/ppl/ourlib/npbt5.F
new file mode 100644
index 0000000..6d0ede2
--- /dev/null
+++ b/ppl/ourlib/npbt5.F
@@ -0,0 +1,66 @@
+      FUNCTION NPBT(MTIME2,MTIME1,NMBP,JFLAG)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)npbt5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C         NPBT RETURNS THE NUMBER OF DATA POINTS BETWEEN TWO
+C         MILITARY TIMES, GIVEN THE SAMPLING RATE IN MINUTES.
+C
+C         MTIME2: THE LATER OF THE TWO TIMES.
+C         MTIME1: THE EARLIER OF THE TWO TIMES.
+C         NMBP:   THE NUMBER OF MINUTES BETWEEN POINTS(SAMPLING RATE).
+C         JFLAG:  0: COMPUTE THE NUMBER OF WHOLE SAMPLE INTERVALS
+C                 BETWEEN THE TIMES.
+C                 1: COMPUTE THE NUMBER OF WHOLE SAMPLE INTERVALS
+C                 THAT INCLUDES THE TIMES.
+
+C
+	REAL MTIME1(3),MTIME2(3)
+	INTEGER*4 MTMIN,MNDF
+      MNDF=MTMIN(MTIME2)-MTMIN(MTIME1)
+      NPBT=MNDF/NMBP
+      IF(JFLAG.EQ.1) NPBT=NPBT+1
+      RETURN
+      END
diff --git a/ppl/ourlib/squish.F b/ppl/ourlib/squish.F
new file mode 100644
index 0000000..9345946
--- /dev/null
+++ b/ppl/ourlib/squish.F
@@ -0,0 +1,92 @@
+      SUBROUTINE SQUISH(JSTRNG,JFIRST,NPOS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)squish.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	Removes blank characters starting at position JFIRST
+C	for the next NPOS characters and packs the characters
+C	back into the original string.  Good for getting rid
+C	of extra blanks.
+C
+C	JSTRNG -- character, input and output string
+C	JFIRST -- INT, position to begin processing
+C	NPOS -- INT, number of characters to process
+C
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER*1 JSTRNG*(*),KLPAR,KRPAR,JBLNK,JCH
+      LOGICAL REMOVE
+
+      DATA KLPAR/'('/,KRPAR/')'/,JBLNK/' '/
+
+      IF(NPOS.EQ.0)RETURN
+      LAST=IABS(NPOS)+JFIRST-1
+      REMOVE=.FALSE.
+      IF(NPOS.LT.0)REMOVE=.TRUE.
+      NEXT=JFIRST
+      NPAREN=0
+
+      DO 500 JPOS=JFIRST,LAST
+	JCH=JSTRNG(JPOS:JPOS)
+	JSTRNG(JPOS:JPOS)=JBLNK
+      IF(JCH.NE.KLPAR)GO TO 100
+      NPAREN=NPAREN+1
+      GO TO 150
+
+  100 IF(NPAREN.EQ.0)GO TO 200
+      IF(JCH.NE.KRPAR)GO TO 300
+      NPAREN=NPAREN-1
+  150 IF(REMOVE)JCH=JBLNK
+      GO TO 300
+
+  200 IF(JCH.EQ.JBLNK)GO TO 500
+  300 JSTRNG(NEXT:NEXT)=JCH
+      NEXT=NEXT+1
+  500 CONTINUE
+
+      RETURN
+      END
diff --git a/ppl/ourlib/uninit.F b/ppl/ourlib/uninit.F
new file mode 100644
index 0000000..8ba7232
--- /dev/null
+++ b/ppl/ourlib/uninit.F
@@ -0,0 +1,111 @@
+	subroutine uninit(pname,switch,sflag,smap,ns,
+     *	    name,nmap,nin,nout)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)uninit.f	1.1    3/10/88
+C** v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	subroutine uses iargc and getarg to determine what switches 
+c	have been set
+c
+c	pname	- calling program name (as called) char
+c	switch	- list of legal switches char*1
+c	sflag	- value of switch .true. if set
+c	smap	- points to name associated with switch int
+c	ns	- number of switches
+c	name	- list for non-switch arguements char(nin)*(*)
+c	nmap	- points to the switch associated with name
+c	nin	- length of name
+c	nout	- number of name at output
+c
+c
+	character pname*(*),switch(ns)*1,name(nin)*(*),arg*2048
+	logical sflag(ns)
+	integer smap(ns),nmap(nin)
+c
+c
+	do 10 i=1,ns
+	    sflag(i)=.false.
+	    smap(i)=0
+10	continue
+	do 20 i=1,nin
+	    name(i)=' '
+	    nmap(i)=0
+20	continue
+c
+c	get program name and number of args
+c
+	call getarg(0,pname)
+	iarg=iargc()
+c
+c	parse arguement list
+c
+	nout=0
+	ilast=0
+	do 30 i=1,iarg
+	    call getarg(i,arg)
+	    if(arg(1:1).eq.'-')then
+		k=lnblnk(arg)
+		do 40 kk=2,k
+		    do 50 j=1,ns
+			if(arg(kk:kk).eq.switch(j))then
+			    sflag(j)=.true.
+			    ilast=j
+			    goto 40
+			endif
+50		     continue
+40		continue
+	    else
+		nout=nout+1
+		if(nout.gt.nin)goto 30
+		if(ilast.ne.0)then
+		    smap(ilast)=nout
+		    nmap(nout)=ilast
+		    ilast=0
+		endif
+		name(nout)=arg
+	    endif
+30	continue
+	return
+	end
diff --git a/ppl/ourlib/upper.F b/ppl/ourlib/upper.F
new file mode 100644
index 0000000..164cf43
--- /dev/null
+++ b/ppl/ourlib/upper.F
@@ -0,0 +1,81 @@
+	SUBROUTINE UPPER(STRING,NC)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)upper.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	converts the string to upper case
+C
+C        STRING -- character*(*), input string
+C        NC -- maximum number of characters to convert
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *kms* 07/2010 unix version cleaned up and NC made the *maximum* 
+C               number of characters to convert
+
+#ifdef unix
+
+        CHARACTER STRING*(*)
+        INTEGER DELTA, EXACTN, I
+        DELTA = ICHAR('A') - ICHAR('a')
+        EXACTN = MIN(NC, LEN(STRING))
+        DO 100 I = 1,EXACTN
+            IF ( (STRING(I:I) .GE. 'a') .AND. 
+     .           (STRING(I:I) .LE. 'z') ) THEN
+                STRING(I:I) = CHAR(ICHAR(STRING(I:I)) + DELTA)
+            ENDIF
+ 100    CONTINUE
+
+#else
+
+	CHARACTER STRING*80
+	INTEGER*4 STR$UPCASE,ISTAT
+	ISTAT = STR$UPCASE(STRING(1:NC),STRING(1:NC))
+	IF(.NOT.ISTAT)CALL SYS$EXIT(%VAL(ISTAT))
+
+#endif
+
+	RETURN
+	END
diff --git a/ppl/ourlib/wldfle.F b/ppl/ourlib/wldfle.F
new file mode 100644
index 0000000..fda8469
--- /dev/null
+++ b/ppl/ourlib/wldfle.F
@@ -0,0 +1,131 @@
+	SUBROUTINE WLDFLE(DFN,FNM,EFN,ISTAT,IFLAG)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)wldfle.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	WLDFLE uses a file template with a supplied file name
+C	to create a new file name the uses the template to fill
+C	in an unspecified parts.  For example, you can use .EPIC
+C	as the template and whenever you do not explicitly specify
+C	a file extension .EPIC will be used.
+C
+C	DFN -- character, the template file name
+C	FNM -- character, the user supplied file name
+C	EFN -- character, the new file name (output)
+C	ISTAT -- INT*4, status flag =1 success
+C	IFLAG -- INT*$, a flag that gives a great deal of information
+C			regarding the way the substitution took place.
+C
+	IMPLICIT INTEGER*4 (L)
+	IMPLICIT INTEGER*2 (W)
+
+#ifdef STAR_1_SUPPORTED
+	IMPLICIT integer*1 (B)
+#else
+	IMPLICIT BYTE (B)
+#endif
+
+	CHARACTER DFN*(*),FNM*(*),EFN*(*),RSA*81
+#ifdef unix
+	EFN=FNM
+#else
+	INCLUDE '($RMSDEF)'
+	INCLUDE '($FABDEF)'
+	INCLUDE '($NAMDEF)'
+	INTEGER*4 MASK,ISTAT,IFLAG,SYS$PARSE
+	DATA MASK/0/
+C
+C	DEFINE THE FAB AND NAM
+C
+	RECORD /FABDEF/ FAB
+	RECORD /NAMDEF/ NAM
+C
+C	SET THE FAB
+C
+	FAB.FAB$B_BID=FAB$C_BID
+	FAB.FAB$B_BLN=FAB$C_BLN
+	FAB.FAB$L_DNA=%LOC(DFN)
+	FAB.FAB$B_DNS=MIN0(LEN(DFN),127)
+	FAB.FAB$L_FNA=%LOC(FNM)
+	FAB.FAB$B_FNS=MIN0(LEN(FNM),127)
+	EFN=' '
+	FAB.FAB$L_FOP=IBSET(MASK,FAB$V_OFP)
+	FAB.FAB$W_IFI=0
+	FAB.FAB$L_NAM=%LOC(NAM)
+C
+C	SET THE NAM
+C
+	NAM.NAM$B_BID=NAM$C_BID
+	NAM.NAM$B_BLN=NAM$C_BLN
+	NAM.NAM$L_ESA=%LOC(EFN)
+	NAM.NAM$B_ESS=MIN0(LEN(EFN),127)
+C	nam.nam$b_nop=IBSET(MASK,NAM$V_NOCONCEAL)
+	NAM.NAM$B_NOP=IBSET(MASK,NAM$V_SYNCHK)
+C
+C	NAM$V_SYNCHK
+C
+	NAM.NAM$L_RLF=0
+	NAM.NAM$L_RSA=%LOC(RSA)
+	NAM.NAM$B_RSL=81
+	NAM.NAM$L_FNB=0
+C
+C	call the system parsing routine
+C
+	ISTAT=SYS$PARSE(FAB)
+	I=NAM.NAM$B_ESL
+	EFN(I+1:)=' '
+	IFLAG=NAM.NAM$L_FNB
+	ISEM=INDEX(EFN,';')
+	L=IBITS(IFLAG,NAM$V_wild_ver,NAM$S_wild_ver)
+C
+C	if the version was wild carded, i.e. * then
+C	append a * to the file name
+C
+	IF(I.EQ.ISEM.AND.L.NE.0)THEN
+	    EFN(I+1:)='* '
+	ENDIF
+#endif
+	RETURN
+	END
diff --git a/ppl/plot/LIB_NAME b/ppl/plot/LIB_NAME
new file mode 100644
index 0000000..8da1d97
--- /dev/null
+++ b/ppl/plot/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libplt.a
+ 
diff --git a/ppl/plot/Makefile b/ppl/plot/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/plot/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/plot/SOURCE_FILES b/ppl/plot/SOURCE_FILES
new file mode 100644
index 0000000..a4b9fb8
--- /dev/null
+++ b/ppl/plot/SOURCE_FILES
@@ -0,0 +1,57 @@
+SRCS_F = \
+arrow.F\
+box.F\
+box_centers.F\
+check_2d_size.F\
+clsppl.F\
+cross.F\
+datlst.F\
+daxis.F\
+daxis2.F\
+dellev.F\
+drawvec.F\
+dsflab.F\
+dsflim.F\
+ferret_plot_complete.F\
+get_curvilinear_limits.F\
+get_vp_from_ferret.F\
+interrupt.F\
+labdrw.F\
+lev.F\
+level.F\
+levprs.F\
+levset.F\
+levsrt.F\
+linear.F\
+linfit.F\
+stmnmx.F\
+rsmnmx.F\
+mplot.F\
+mult.F\
+opnppl.F\
+plotnm.F\
+plotxy.F\
+plotxy_ribbon.F\
+plotz.F\
+pltit.F\
+pplcmd.F\
+pplcmd_f.F\
+ppldata.F\
+pplldc.F\
+pplldx.F\
+ppllist.F\
+pplus.F\
+prmtiv.F\
+rdseq.F\
+readsq.F\
+redsf.F\
+save.F\
+savezg.F\
+scale2.F\
+setax.F\
+setlab.F\
+size2.F\
+spwn.F\
+trans.F\
+vecfld.F\
+view.F 
diff --git a/ppl/plot/arrow.F b/ppl/plot/arrow.F
new file mode 100644
index 0000000..b98677f
--- /dev/null
+++ b/ppl/plot/arrow.F
@@ -0,0 +1,84 @@
+	SUBROUTINE ARROW(XL,YL,XL2,YL2,IAT,SHFT,XMN,CS,SN,XF,YF)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)arrow.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'LABCOM.INC'
+#else
+	INCLUDE 'pplinc:LABCOM.INC'
+#endif
+	IF(IAT.EQ.0)RETURN
+	IF(XL+SHFT*CS/XF.GE.XL2)THEN
+	    AX=-HLABS*.5
+	    AY=HLABS*.5
+	ELSE IF(XL+(XMN+SHFT*CS)/XF.LE.XL2)THEN
+	    AX=(HLABS*.5+XMN)
+	    AY=HLABS*.5
+	ELSE IF(YL+SHFT*SN/YF.GT.YL2)THEN
+	    AY=-HLABS*.5
+	    AX=XMN*.5
+	ELSE
+	    AY=HLABS*1.5
+	    AX=XMN*.5
+	ENDIF
+	XLT=XL+((SHFT+AX)*CS-AY*SN)/XF
+	YLT=YL+((SHFT+AX)*SN+AY*CS)/YF
+	IF(IAT.EQ.2)THEN
+	    HS=HLABS*0.5
+	    DNM=SQRT(((XL2-XLT)*XF)**2+((YL2-YLT)*YF)**2)
+	    CCS=(XL2-XLT)*XF/DNM
+	    SSN=(YL2-YLT)*YF/DNM
+	    XN=XL2+(-CCS-.5*SSN)*HS/XF
+	    YN=YL2+(-SSN+.5*CCS)*HS/YF
+	    CALL PLOT(XN,YN,0,0)
+	    CALL PLOT(XL2,YL2,1,0)
+	    XN=XL2+(-CCS+.5*SSN)*HS/XF
+	    YN=YL2+(-SSN-.5*CCS)*HS/YF
+	    CALL PLOT(XN,YN,1,0)
+	ENDIF
+	CALL PLOT(XL2,YL2,0,0)
+	CALL PLOT(XLT,YLT,1,0)
+	RETURN
+	END
diff --git a/ppl/plot/box.F b/ppl/plot/box.F
new file mode 100644
index 0000000..bd7d480
--- /dev/null
+++ b/ppl/plot/box.F
@@ -0,0 +1,97 @@
+      SUBROUTINE BOX 
+C** 
+C**    @(#)box.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     11.6.92 *jd* Mod to use viewport sizes when in FERRET
+
+#ifdef unix
+        include 'parampl5_dat.decl'
+	INCLUDE 'PARAMPL5.DAT'
+        include 'plt_inc.decl'
+	INCLUDE 'PLT.INC'
+        include 'pen_inc.decl'
+	INCLUDE 'PEN.INC'
+#else
+        INCLUDE 'TMAP_PPLV11INC:PARAMPL5_DAT.DECL'
+	INCLUDE 'PPLV11INC:PARAMPL5.DAT'
+        INCLUDE 'TMAP_PPLV11INC:PLT_INC.DECL'
+	INCLUDE 'PPLV11INC:PLT.INC'
+        INCLUDE 'TMAP_PPLV11INC:PEN_INC.DECL'
+	INCLUDE 'PPLV11INC:PEN.INC'
+#endif
+
+#ifdef unix
+        include 'ppl_in_ferret.cmn'
+#else
+        INCLUDE 'TMAP_PPLV11INC:PPL_IN_FERRET.CMN'
+#endif
+
+        real     vwidth,vheight,width2,height2
+
+C 	stmt added for linux *jd* 12.96
+	external scale
+
+*******************************************************************************
+
+        if (ppl_in_ferret) then
+           call get_view_size (vwidth,vheight)
+           width2 = vwidth
+           height2 = vheight
+        else
+           width2 = width
+           height2 = height
+        endif
+
+	CALL SCALE(1.,1.,0.,0.,0.,0.) 
+	IF(IP(1).NE.1)RETURN
+	CALL PLOT(.01,.01,0,0) 
+	CALL PLOT(WIDTH2-.02,.01,1,0) 
+	CALL PLOT(WIDTH2-.02,HEIGHT2-.04,1,0) 
+	CALL PLOT(.01,HEIGHT2-.04,1,0) 
+	CALL PLOT(.01,.01,1,0) 
+	RETURN 
+	END 
diff --git a/ppl/plot/box_centers.F b/ppl/plot/box_centers.F
new file mode 100644
index 0000000..5765433
--- /dev/null
+++ b/ppl/plot/box_centers.F
@@ -0,0 +1,80 @@
+	SUBROUTINE BOX_CENTERS( x_or_y, val1, n, centers, valid )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* PLOT+ routine for use inside FERRET:
+* Supply to PLOT+ the centers of n grid boxes from X or Y axis of the contour
+* data currently in PLOT+.  Pointers to the appropriate FERRET axes are in
+* COMMON.
+
+* programmer - ACM
+* (Adapted from box_bounds)
+*
+* for FERRET V62.00: 5/2009
+* V62  Fixing bug 1659, plotting with subspan modulo axis.
+
+	include 'ferret.parm'
+	include 'xbox_bounds.cmn'
+
+* calling argument declarations:
+	LOGICAL		valid
+	INTEGER		n
+	REAL		val1, centers(n)
+	CHARACTER	x_or_y*1
+
+* internal variable declarations:
+	INTEGER	ISUBSCRIPT, i, idim, isub1, isub0
+	DOUBLE PRECISION TM_WORLD
+
+* initialize
+	IF ( x_or_y .EQ. 'X' ) THEN
+	   idim = bb_xaxis
+	ELSEIF ( x_or_y .EQ. 'Y' ) THEN
+	   idim = bb_yaxis
+	ENDIF
+
+* determine starting subscript
+	isub1 = ISUBSCRIPT ( DBLE(val1), bb_grid, idim, round_dn )
+	isub0 = isub1 - 1
+
+* pass back box centers
+	DO 100 i = 1, n
+ 100	centers(i) = SNGL( TM_WORLD (isub0+i,bb_grid,idim,box_middle) )
+
+* always (the appearance of) success
+	valid = .TRUE.
+	RETURN
+	END
diff --git a/ppl/plot/check_2d_size.F b/ppl/plot/check_2d_size.F
new file mode 100644
index 0000000..e09c5b3
--- /dev/null
+++ b/ppl/plot/check_2d_size.F
@@ -0,0 +1,84 @@
+	SUBROUTINE CHECK_2D_SIZE (mx, my, err_string, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)check_2d_size.F	1.1    9/16/12
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c V685  *acm* 9/13 Fixing ticket 2092. Check that the pplus internal storage
+c                  for coordinate data will be enough for the grid and if not
+c                  return an error message. 
+c
+c	mx	dimensioned x size of z(mx,my)
+c	my	dimensioned y size of z
+c       status  returned 
+C
+C
+C
+	INTEGER		mx, my, status
+	CHARACTER	err_string*128
+
+        include 'errmsg.parm'
+	INCLUDE 'ZGRIDD.INC'
+
+	LOGICAL		ITS_CURVILINEAR
+
+	status = ferr_ok
+
+* This check is only needed for rectilinear grids
+
+        IF ( ITS_CURVILINEAR() ) RETURN
+
+	IF (mx .GT. IZSE) THEN
+	   err_string = 
+     .      'grid in horizontal direction too large for 2D graphics call'
+	   status = ferr_out_of_range
+	ENDIF
+
+	IF (my .GT. IZSE) THEN
+	   err_string = 
+     .      'grid in vertical direction too large for 2D graphics call'
+	   status = ferr_out_of_range
+	ENDIF
+
+	RETURN
+	END
diff --git a/ppl/plot/clsppl.F b/ppl/plot/clsppl.F
new file mode 100644
index 0000000..c8b274f
--- /dev/null
+++ b/ppl/plot/clsppl.F
@@ -0,0 +1,140 @@
+        SUBROUTINE CLSPPL
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Modified 9.27.88 J Davison TMAP/JISAO/PMEL
+*       to close GKS properly if it is opened.
+*       J Davison 11.28.88 modified for compatibility to v1.1 PPL
+*       k obrien 3.11.97 added ifdef for linux port to ignore "unlink"
+* V602: *acm* 1/07 Changes for metafile-batch mode
+*       *kms* 10/11 set GKSOPN and GKS_OPEN flags to .FALSE.
+*                   after closing GKS
+
+        include 'symkey_inc.decl'
+        include 'SYMKEY.INC'
+        include 'cmdcom_inc.decl'
+        include 'CMDCOM.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+        include 'gkscm2.cmn'
+
+#ifdef core
+        include 'CORECM.INC'
+#endif
+C
+C       CLOSES FILES USED BY PLOT5+
+C
+        CALL ATFLSH
+#ifdef unix
+        call dbmclose(keyln1)
+#ifndef F90_NO_UNLINK
+        call unlink('PPL$KEY.001.pag')
+        call unlink('PPL$KEY.001.dir')
+#endif
+        call close_gks !See bottom of this file. J Davison 9.27.88
+#else
+        call close_gks !See bottom of this file. J Davison 9.27.88
+        CLOSE(KEYLN1,DISP='DELETE')
+#endif
+#ifdef core
+        if(gksopn)then
+            call closeretainseg()
+            call deselectvwsurf(vsurf)
+            call terminatecore()
+        endif
+#endif
+ 
+        IF(PLTFLG)THEN
+            PEN = .FALSE.
+            CALL ZABMV
+            CALL BINFSH
+            PLTFLG = .FALSE.
+        ENDIF
+        GKSOPN = .FALSE.
+        GKS_OPEN = .FALSE.
+        RETURN
+        END
+
+        SUBROUTINE CLOSE_GKS
+
+*       Written to close GKS if it is open, deactivate and close workstations
+*       J Davison 9.27.88
+
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+        include 'gkscm2.cmn'
+
+        integer member,er_status,num_active,rmember,i,j,
+     .          num_open, istate
+
+********************************************************************************
+
+
+        CALL FGD_GQOPS(istate)  ! In batch mode the graphics may not be active now. 
+
+        if (gksopn) then 
+           if ( istate .GE. 2 ) then
+*
+*             *kms* Save the graphics to meta_file if appropriate
+              IF ( save_on_exit .AND. imgname_sent ) THEN
+                  CALL FGD_SAVE_WINDOW(meta_file)
+              ENDIF
+
+              member = 1
+              call FGD_GQACWK(member,er_status,num_active,rmember)
+              if (num_active .lt. 1) goto 20
+
+              do 10 i = 1,num_active
+                 call FGD_GQACWK(1,er_status,j,rmember)
+                 call FGD_GDAWK(rmember)
+ 10           continue
+
+ 20           call FGD_GQOPWK(member,er_status,num_open,rmember)
+              if (num_open .lt. 1) goto 40
+
+              do 30 i = 1,num_open
+                 call FGD_GQOPWK(1,er_status,j,rmember)
+                 call FGD_GCLWK(rmember)
+ 30           continue
+
+           endif    ! istate
+ 40        call FGD_GCLKS()
+        end if
+
+        return
+        end
diff --git a/ppl/plot/cross.F b/ppl/plot/cross.F
new file mode 100644
index 0000000..bec8fed
--- /dev/null
+++ b/ppl/plot/cross.F
@@ -0,0 +1,88 @@
+	SUBROUTINE CROSS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)cross.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'LINES.INC'
+#else
+	INCLUDE 'pplinc:PARAMPL5.DAT'
+	INCLUDE 'pplinc:AXIS.INC'
+	INCLUDE 'pplinc:LABCOM.INC'
+	INCLUDE 'pplinc:LINES.INC'
+#endif
+	IF(ICROSS.EQ.1)THEN
+	    IF(XLO.LT.0..AND.XHI.GT.0.)THEN
+		CALL PLOT(0.,YLO,0,0)
+		CALL PLOT(0.,YHI,1,0)
+	    ENDIF
+	    IF(YLO.LT.0..AND.YHI.GT.0.)THEN
+		CALL PLOT(XLO,0.,0,0)
+		CALL PLOT(XHI,0.,1,0)
+	    ENDIF
+	ELSE IF(ICROSS.NE.0)THEN
+	    IF(ICROSS.EQ.2.OR.ICROSS.EQ.4)THEN
+		DO 90 I=1,LNUM
+		DO 95 J=I+1,LNUM
+		IF(YOFF(I).EQ.YOFF(J))GOTO90
+95		CONTINUE
+		CALL PLOT (XLO,YOFF(I),0,0)
+		CALL PLOT (XHI,YOFF(I),1,0)
+90		CONTINUE
+	    ENDIF
+	    IF(ICROSS.GE.3)THEN
+		DO 100 I=1,LNUM
+		DO 105 J=I+1,LNUM
+		IF(XOFF(I).EQ.XOFF(J))GOTO 100
+105		CONTINUE
+		CALL PLOT(XOFF(I),YLO,0,0)
+		CALL PLOT(XOFF(I),YHI,1,0)
+100		CONTINUE
+	    ENDIF
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plot/datlst.F b/ppl/plot/datlst.F
new file mode 100644
index 0000000..1c31361
--- /dev/null
+++ b/ppl/plot/datlst.F
@@ -0,0 +1,115 @@
+      SUBROUTINE DATLST(LLUN,X,NSIZE,NXS,NYS) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)datlst.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	DIMENSION X(NSIZE)
+#ifdef unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'CMRD.INC'
+#else
+	INCLUDE 'pplinc:PARAMPL5.DAT'
+	INCLUDE 'pplinc:LINES.INC'
+	INCLUDE 'pplinc:HD.INC'
+	INCLUDE 'pplinc:CMRD.INC'
+#endif
+	IY=NSIZE/2
+	NXL=1 
+	NYL=1 
+	IF(M.GE.1.AND.IFLG(1).EQ.1)NXL=IFIX(P(1)) 
+	IF(M.GE.3.AND.IFLG(3).EQ.1)NYL=IFIX(P(3)) 
+	IF(JTYPE.LE.0.OR.JTYPE.EQ.2)THEN 
+	    NXH=NX 
+	    NYH=NY 
+	    IF(M.GE.2.AND.IFLG(2).EQ.1)NXH=IFIX(P(2)) 
+	    IF(M.GE.4.AND.IFLG(4).EQ.1)NYH=IFIX(P(4)) 
+	    IF(JTYPE.EQ.-1.OR.JTYPE.EQ.2)THEN
+		IF(M.GE.5.AND.IFLG(5).EQ.1.AND.P(5).EQ.2)THEN
+		    WRITE(LLUN,9994)'SECOND'
+9994		    FORMAT(9X,A6,' COMPONENT')
+		    IVLEN=NX*NY
+ 	ELSE
+		    WRITE(LLUN,9994)'FIRST'
+		    IVLEN=0
+		ENDIF
+	    ELSE
+		IVLEN=0
+	    ENDIF
+	    K=(NXH-NXL)/7+1 
+	    DO 100 K1=1,K 
+	    K8=(K1-1)*7+(NXL-1) 
+	    IM=NXH-K8 
+	    IF(IM.GT.7)IM=7 
+	    WRITE(LLUN,9999)(I+K8,I=1,IM) 
+9999	    FORMAT(9X,7I10) 
+	    DO 101 J=NYL,NYH 
+	    WRITE(LLUN,9998)J,(X(IVLEN+NXS*(J-1)+I+K8),I=1,IM) 
+101	    CONTINUE
+9998	    FORMAT(6X,I6,1P7E10.2) 
+	    WRITE(LLUN,'(/)') 
+100	    CONTINUE
+	ELSE 
+	    IBASE=1 
+	    NXH=32000 
+	    NYH=LNUM 
+	    IF(M.GE.2.AND.IFLG(2).EQ.1)NXH=IFIX(P(2)) 
+	    IF(M.GE.4.AND.IFLG(4).EQ.1)NYH=IFIX(P(4)) 
+	    DO 300 J=1,NYL-1 
+300	    IBASE=IBASE+LLENG(J) 
+	    DO 200 J=NYL,NYH 
+	    WRITE(LLUN,9997)J,LLENG(J) 
+9997	    FORMAT(//9X,'LINE=',I4,'  LENGTH=',I6) 
+	    WRITE(LLUN,9996) 
+9996	    FORMAT(11X,'I',10X,'X',15X,'Y') 
+	    IB=IBASE+LLENG(J)-1 
+	    IF(IB.GT.IBASE+NXH-1)IB=IBASE+NXH-1 
+	    WRITE(LLUN,9995)(I-IBASE+1,X(I),X(IY+I),I=IBASE+NXL-1,IB) 
+9995	    FORMAT(6X,I6,1P2E15.4) 
+	    IBASE=IBASE+LLENG(J) 
+200	    CONTINUE 
+	END IF 
+	RETURN
+	END 
diff --git a/ppl/plot/daxis.F b/ppl/plot/daxis.F
new file mode 100644
index 0000000..603901a
--- /dev/null
+++ b/ppl/plot/daxis.F
@@ -0,0 +1,229 @@
+      SUBROUTINE DAXIS(XF,YF,NMX,NMY,MAINLAB)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOT]DAXIS.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection from interrupts in lower routines
+*	  	  no explicit declarations - use FORT/WARN=NODECLARATIONS
+* v5.41 *acm* - 3/02  bug fix: xaxis2 call for log plots caused the tics for log 
+*               axes to be wrong.
+*               Also remove VMS include statements.
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks:
+*                  Pass new arguments to all axis routines, and set hline, vline
+*                  when done.
+C *acm* 11/05  new argument to xaxis1 and yaxis1 for deg/min/sec labels
+C        1/06  xvaloff,yvaloff add this amount to each x or y axis label. 
+C              (axis data was read as double precision and converted to single 
+C              after applying an offset.)
+C *acm* 5/09   Extra argument lets us skip the plot label (when redrawing
+C              axes after a POLY/OVERLAY)
+C *acm* 10/09  Fix bug 1708: YAXIS2 call for log plots caused the tics for the 
+*              right hand side log axes to be wrong when we have a depth axis.
+C *acm*  5/12  Only draw the axis labels the first time the axes are made.
+C              Axes are repeated so axis lines and graticule lines are on top
+C              of other plot elements but the labels dont need to be.
+C**
+C**    @(#)daxis.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'labels_inc.decl'
+	include 'LABELS.INC'
+	include 'labcom_inc.decl'
+	include 'LABCOM.INC'
+	include 'hab_inc.decl'
+	include 'HAB.INC'
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'tics_inc.decl'
+	include 'TICS.INC'
+	include 'tics2_inc.decl'
+	include 'TICS2.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+
+	CHARACTER IFX*20,IFY*20
+        integer ii, MAINLAB
+	LOGICAL noylab
+
+* TMAP interrupt flag
+	include 'xinterrupt.cmn'
+
+C If graticule lines are to be drawn across the plot at the tics
+C then only do them for one horizontal and one vertical axis.  
+C The dash lines interfere with each other if drawn from both 
+C sides. HLINE and VLINE control this. Draw a second axis after each 
+C axis that may have the graticule lines, so the axes themselves are 
+C always solid, black.
+
+        HLINE = .TRUE.
+        VLINE = .TRUE.
+           
+        do ii = 1, 2   ! first time thru do graticules, 
+                      ! second time dont, get black axes
+        
+        IF(IMCNT.LE.1)THEN
+	    CALL BOX
+	END IF
+C	SETUP AXIS
+	CALL SETLAB(XF,YF,LTT,LTB,LYL,LYR,LXT,LXB,IFX,IFY)
+
+	IF (ii .EQ. 2 .OR. mainlab .EQ. 0) THEN
+	   LTT = 0
+	   LTB = 0
+	   LYL = 0
+	   LYR = 0
+	   LXT = 0
+	   LXB = 0
+	ENDIF
+	noylab =  (ylab .EQ. ' ') 
+
+C
+C     DRAW AXIS, LEFT, RIGHT Y AXIS THEN TOP, BOTTOM XAXIS
+C
+	IF(MAKEP.EQ.'VIEW')GOTO 1000
+      IF(MYLEF.EQ.0.AND.IAXON(3).EQ.1)THEN
+	  IY=ITY
+C	  YAXIS1 = LINEAR ,  YAXIS2 = LOG
+C
+          IF(ITFLG.EQ.-1)THEN
+              CALL TAYIS(ITYPET,TLO,IT1,IT2,DT,NMTCT,LTB,IFDB,ISDB,
+     *        YF,XLO,XF,TCSIZE,XHI,HGRAT, HCOLOR, HLINE)
+            hline = .FALSE.
+	  ELSE IF(ITYPEY.EQ.1)THEN
+	   CALL YAXIS1(XLO,XF,YLO,YHI,YTIC,NMY,LINTY,1.,LYL,IFY,YF,
+     *	    YCSIZE,XHI,YDMS,HGRAT, HCOLOR, HLINE, YVALOFF, NOYLAB, 
+     *	    SHRINKY)
+            hline = .FALSE.
+	  ELSE
+            CALL YAXIS2(XLO,XF,YLO,YHI,0.,LYL,IFY,1,YF,YCSIZE,
+     .                    XHI,HGRAT, HCOLOR, HLINE)
+            hline = .FALSE.
+          END IF
+      END IF
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(IAXON(4).EQ.1)THEN
+	IY=-ITY
+        IF(ITFLG.EQ.-1)THEN
+            CALL TAYIS(ITYPET,TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,
+     *      YF,XHI,XF,TCSIZE,XLO,HGRAT, HCOLOR, HLINE)
+           hline = .FALSE.
+	ELSE IF(ITYPEY.EQ.1)THEN
+	    CALL YAXIS1(XHI,XF,YLO,YHI,YTIC,NMY,LINTY,1.,LYR,IFY,YF,
+     *     YCSIZE,XLO,YDMS,HGRAT, HCOLOR, HLINE, YVALOFF, NOYLAB,
+     *	    SHRINKY)
+           hline = .FALSE.
+	ELSE
+	   CALL YAXIS2(XHI,XF,YLO,YHI,0.,LYR,IFY,1,YF,YCSIZE,
+     .                    XLO,HGRAT, HCOLOR, HLINE)
+           hline = .FALSE.
+	ENDIF
+      ENDIF
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(IAXON(1).EQ.1)THEN
+          IX=-ITX
+C
+C	  XAXIS1 = LINEAR, XAXIS2 = LOG, TAXIS CALLS EITHER TAXIS0,
+C					 TAXIS1 OR TAXIS3
+C
+          IF(ITFLG.EQ.1)THEN
+              CALL TAXIS(ITYPET,TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,
+     *        XF,YHI,YF,TCSIZE,YLO,VGRAT, VCOLOR, VLINE)
+              vline = .FALSE.
+          ELSE IF (ITYPEX.EQ.1)THEN
+	      CALL XAXIS1(XLO,XHI,XTIC,NMX,LINTX,1.,LXT,IFX,XF,YHI,YF,
+     *	       XCSIZE,YLO,XDMS,VGRAT, VCOLOR, VLINE, XVALOFF)
+              vline = .FALSE.
+          ELSE
+	      CALL XAXIS2(XLO,XHI,0.,LXT,IFX,1,XF,YHI,YF,XCSIZE,
+     *                    YLO,VGRAT, VCOLOR, VLINE)
+              vline = .FALSE.
+          END IF
+      END IF
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(MXBOT.EQ.0.AND.IAXON(2).EQ.1)THEN
+          IX=ITX
+          IF(ITFLG.EQ.1)THEN
+              CALL TAXIS(ITYPET,TLO,IT1,IT2,DT,NMTCT,LTB,IFDB,ISDB,
+     *        XF,YLO,YF,TCSIZE,YHI,VGRAT, VCOLOR, VLINE)
+              vline = .FALSE.
+          ELSE IF (ITYPEX.EQ.1) THEN
+	      CALL XAXIS1(XLO,XHI,XTIC,NMX,LINTX,1.,LXB,IFX,XF,YLO,YF,
+     *	      XCSIZE,YHI,XDMS,VGRAT, VCOLOR, VLINE, XVALOFF)
+              vline = .FALSE.
+          ELSE
+	      CALL XAXIS2(XLO,XHI,0.,LXB,IFX,1,XF,YLO,YF,XCSIZE,
+     *                    YHI,VGRAT, VCOLOR, VLINE)
+              vline = .FALSE.
+          END IF
+      END IF
+      enddo  ! ii loop
+
+* TMAP interrupt re-entry
+ 3333	CONTINUE
+
+	IF(IWIND.GT.0)CALL WINDOW(XLO,YLO,XHI,YHI)
+	CALL CROSS
+	CALL WINDOW(0.,0.,0.,0.)
+C
+C	DRAW AXIS LABELS
+C
+1000	CONTINUE
+        IF (mainlab .EQ. 1) CALL LABDRW(XF,YF,IFX,IFY)
+	RETURN
+	END
diff --git a/ppl/plot/daxis2.F b/ppl/plot/daxis2.F
new file mode 100644
index 0000000..ee2087e
--- /dev/null
+++ b/ppl/plot/daxis2.F
@@ -0,0 +1,224 @@
+	SUBROUTINE DAXIS2(XF,YF,NMX,NMY)
+C** 
+C**    @(#)daxis2.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     MOD *JD* 10.91 to eliminate PLOT COMPLETE msg if in ferret
+*     MOD *sh* 6/99 with changes to IGRNPT call
+* v552 *acm* 3/03 Changes for multi-line labels.
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'MPLOT.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'TICS.INC'
+	INCLUDE 'TICS2.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'XYLABP.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'PRMCOM.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+******************************************************************************
+
+
+	CHARACTER OUT*255
+        INTEGER numlines, i, j
+
+c        CHARACTER fontprefix*3, penprefix*3, newfont*3, newpen*3
+c        INTEGER lnbeg(500), lnend(500), 
+c        REAL line_spacing
+c        line_spacing = 1.4
+
+	CALL VECTRS
+	DO 80 I=1,NLAB
+	IF(RHLABS(I).LT.0.0)THEN
+		HLB=HLABS
+	ELSE
+		HLB=RHLABS(I)
+	ENDIF
+	CS=COS(RLABS(I)*0.0175329252)
+	SN=SIN(RLABS(I)*0.0175329252)
+	IAT=0
+	SHFT=0.0
+
+
+        CALL tm_break_lines (labs(i), lnbeg, lnend, numlines)
+        nfont = 0
+        npen = 0
+        fontprefix = ""
+        penprefix = ""
+        DO 20 j = 1, numlines
+           CALL getlabfonts (labs(i), lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, ncr)
+
+	   NCR = lnend(j) - lnbeg(j) + 1
+	   XMN=SYMWID(HLB,NCR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 LABS(I)(lnbeg(j):lnend(j)))
+
+	   IF(USRLBS(I))THEN
+	       XFUSER=1.
+	       YFUSER=1.
+	       YLOUSR=0.
+	       XLOUSR=0.
+	   ELSE
+	       XFUSER=XF
+	       YFUSER=YF
+	       XLOUSR=XLO
+	       YLOUSR=YLO
+	   ENDIF
+	   IF(XLABS(I).LT.1.E35)THEN
+	       XL=XLABS(I)
+	       YL=YLABS(I)
+	       LTY=LTYPE(I)
+	       IF(LTY.GT.0)THEN
+		   SHFT=-XMN
+	       ELSE IF(LTY.EQ.0)THEN
+		   SHFT=-XMN*.5
+	       ENDIF
+	       CALL ARROW(XL/XFUSER+XLOUSR,YL/YFUSER+YLOUSR,
+     *	       XLLABS(I)/XFUSER+XLOUSR,YLLABS(I)/YFUSER+YLOUSR,
+     *	       LLTYPE(I),SHFT,XMN,CS,SN,XF,YF,HLB)
+	       GOTO 70
+	   ENDIF
+	   ICHAR=IGRNPT(.TRUE., XL,YL)	! show the choice menu
+	   LTY=-1
+	   IF(ICHAR.EQ.67.OR.ICHAR.EQ.99)THEN
+	       LTY=0
+	       SHFT=-XMN*.5
+	   ELSE IF(ICHAR.EQ.82.OR.ICHAR.EQ.114)THEN
+	       LTY=1
+	       SHFT=-XMN
+	   ELSE IF(ICHAR.EQ.76.OR.ICHAR.EQ.70.OR.ICHAR.EQ.108
+     *	   .OR.ICHAR.EQ.102)THEN
+	       IAT=1
+	       XL2=XL
+	       YL2=YL
+	       ICHARO=ICHAR
+	       ICHAR=IGRNPT(.FALSE., XL,YL) ! do not show the choice menu again
+	       IF(ICHAR.EQ.67.OR.ICHAR.EQ.99)THEN
+		   SHFT=-XMN*.5
+		   LTY=0
+	       ENDIF
+	       IF(ICHAR.EQ.82.OR.ICHAR.EQ.114)THEN
+		   SHFT=-XMN
+		   LTY=1
+	       ENDIF
+	       IF(ICHARO.EQ.70.OR.ICHARO.EQ.102)IAT=2
+	       CALL ARROW(XL,YL,XL2,YL2,IAT,SHFT,XMN,CS,SN,XF,YF,HLB)
+	       WRITE(OUT,998)I,(XL2-XLOUSR)*XFUSER,
+     .               (YL2-YLOUSR)*YFUSER,IAT
+998 	       FORMAT('C LLABS,',I2,2(',',1PE10.3),',',I2)
+	       CALL ECHO(OUT,40)
+	   ENDIF
+	   XL=(XL-XLOUSR)*XFUSER
+  	   YL=(YL-YLOUSR)*YFUSER
+	   IF(USRLBS(I))THEN
+	       WRITE(OUT,999)I,XL,YL,LTY,LABS(I)(:NCR)
+999	       FORMAT('C LABS,',I2,2(',',1PE10.3),',',I2,',','"',A,'"')
+	   ELSE
+	       WRITE(OUT,997)I,XL,YL,LTY,LABS(I)(:NCR)
+997	       FORMAT('C LABS/NOUSER,',I2,2(',',1PE10.3),',',I2,
+     *	       ',','"',A,'"')
+	   ENDIF
+	   NOUT=LNBLK(OUT,255)
+	   CALL ECHO(OUT,NOUT)
+70	   XL=XL/XFUSER+XLOUSR+SHFT*CS/XF + 
+     .         line_spacing*(j-1)*hlb*SN/xf
+	   YL=YL/YFUSER+YLOUSR+SHFT*SN/YF -
+     .         line_spacing*(j-1)*hlb*CS/yf
+
+           CALL SYMBEL(XL,YL,RLABS(i),HLB,NCR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 LABS(I)(lnbeg(j):lnend(j)))
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+           IF (npnew.GT.0) THEN
+              penprefix(1:3) = newpen(1:3)
+              npen = 3
+           ENDIF
+           IF (nfnew.GT.0) THEN
+              fontprefix(1:3) = newfont(1:3)
+              nfont = 3
+           ENDIF
+
+20      CONTINUE
+
+80	CONTINUE
+	IF(PLTOPN)RETURN
+	IF(IMULT.EQ.0.OR.IMCNT.EQ.MNX*MNY)THEN
+	    IF(SWAIT)THEN
+		CALL HABIS(IPLOT,IPAUSE,IHDCPY,INC)
+	    ELSE
+		CALL HABIS(IPLOT,0,IHDCPY,INC)
+	    ENDIF
+
+*     Mod is here
+        if (ppl_in_ferret) then   
+           call ferret_plot_complete (icount)
+        else
+	   IF(.NOT.QUIETF)WRITE(LTTOUT,'('' PLOT'',I8,
+     *         '' COMPLETE'')')ICOUNT
+	       IF(INC.EQ.27)THEN
+		  CALL ATFLSH
+	       ENDIF
+	endif
+
+        ENDIF
+	RETURN
+	END
+
diff --git a/ppl/plot/dellev.F b/ppl/plot/dellev.F
new file mode 100644
index 0000000..2066c30
--- /dev/null
+++ b/ppl/plot/dellev.F
@@ -0,0 +1,59 @@
+	SUBROUTINE DELLEV(J)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dellev.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+	DO 520 K=J+1,NLEV
+	ZLEV(K-1)=ZLEV(K)
+	LDIG(K-1)=LDIG(K)
+	LCLR(K-1)=LCLR(K)
+520	LWGT(K-1)=LWGT(K)
+	NLEV=NLEV-1
+	RETURN
+	END
diff --git a/ppl/plot/drawvec.F b/ppl/plot/drawvec.F
new file mode 100644
index 0000000..5caac20
--- /dev/null
+++ b/ppl/plot/drawvec.F
@@ -0,0 +1,142 @@
+	SUBROUTINE DRAWVEC (xtail,ytail,xhead,yhead,rlen,icntrl,xf,yf)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)drawvec.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	
+#ifdef unix
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'AXLWID.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'TAXIS.INC'
+#else
+        INCLUDE 'pplinc:AXIS.INC'
+        INCLUDE 'pplinc:AXLWID.INC'
+        INCLUDE 'pplinc:CMRD.INC'
+        INCLUDE 'pplinc:LABCOM.INC'
+        INCLUDE 'pplinc:TAXIS.INC'
+#endif
+	
+	REAL minvec,maxarw,minarw,maxvel
+	
+	CHARACTER veclab*20
+	
+C  headfact is ratio of arrowhead length to vector length
+	PARAMETER (headfact = 0.25)
+C  minvec is minimum plotted vector (point plotted otherwise)
+	PARAMETER (minvec = .0625)
+C maxarw is length of vector above which arrowhead is of fixed size
+	PARAMETER (maxarw = 2.0)
+C minarw is length of vector below which arrowhead is of fixed size
+	PARAMETER (minarw = .0625)
+C pi is the constant pi
+	PARAMETER (pi = 3.141592654)
+C arwang is angle between vector and arrowhead in radians
+	PARAMETER (arwang = pi/8.)
+	
+	dist(dx,dy) = SQRT(dx**2 + dy**2)
+	
+C If ictrl = -1 initialize maxvec, if = 1 display maxvec
+	
+	IF (icntrl .eq. 1) THEN
+	    maxvel = xtail
+	    xtail = xlo
+	    ytail = ylo - (XWID + 2.0*HXLAB * (1-ITFLG) + 2.5*HLAB1)/YF
+	    xhead = xlo + rlen*maxvel/XF
+	    yhead = ytail
+	    WRITE (veclab,1000) maxvel
+1000	    FORMAT(F7.3)
+	    xl = xhead + .125/xf
+	    yl = yhead
+	    CALL SYMBEL(XL,YL,0.,hlabs,7,veclab)
+	ENDIF
+	
+C  Calculate length of vector in user units and in inches
+	
+	userdx = xhead - xtail
+	userdy = yhead - ytail
+	userlen = dist(userdx,userdy)
+	
+	realdx = userdx*xf
+	realdy = userdy*yf
+	reallen = dist(realdx,realdy)
+	
+C  If vector is too small plot a point only
+	
+	IF (reallen .LT. minvec) THEN
+	    CALL PLOT(xtail,ytail,0,0)
+	    CALL PLOT(xtail,ytail,1,0)
+	    RETURN
+	ENDIF
+	
+C Determine factor of arrowhead length
+	
+	IF (reallen .GT. maxarw) THEN
+	    theadfact = maxarw*headfact/reallen
+	ELSE IF (reallen .LT. minarw) THEN
+	    theadfact = minarw*headfact/reallen
+	ELSE
+	    theadfact = headfact
+	ENDIF
+	
+C Calculate coordinates of arrowhead
+	
+	cosarw = cos(arwang)
+	sinarw = sin(arwang)
+	xarwrgt = xhead - theadfact*(realdx*cosarw-realdy*sinarw)/xf
+	yarwrgt = yhead - theadfact*(realdy*cosarw+realdx*sinarw)/yf
+	xarwlft = xhead - theadfact*(realdx*cosarw+realdy*sinarw)/xf
+	yarwlft = yhead - theadfact*(realdy*cosarw-realdx*sinarw)/yf
+	
+C Plot the vector
+	
+	CALL PLOT(xtail,ytail,0,0)
+	CALL PLOT(xhead,yhead,1,0)
+	CALL PLOT(xarwlft,yarwlft,0,0)
+	CALL PLOT(xhead,yhead,1,0)
+	CALL PLOT(xarwrgt,yarwrgt,1,0)
+	
+	RETURN
+	END
diff --git a/ppl/plot/dsflab.F b/ppl/plot/dsflab.F
new file mode 100644
index 0000000..c3d7abb
--- /dev/null
+++ b/ppl/plot/dsflab.F
@@ -0,0 +1,132 @@
+	SUBROUTINE DSFLAB
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dsflab.F	1.1    3/10/88
+C** v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	DSFLAB fills the PLOT5 labels with information from the
+C	BIBO header of a DSF file.
+C
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'BIBO.COM'
+	INCLUDE 'TBLE.INC'
+C
+	REAL STR(11)
+	CHARACTER MORINT*16,LAT*11,LON*11,NS*1,EW*1,DEP*10
+	INTEGER MORLEN,LATLEN,LONLEN,DEPLEN
+C	INCLUDE 'BIBO.DAT'
+C
+C	fill the XLAB 
+C
+	XLAB = 'Time (BIBO)'
+C
+C	fill the YLAB
+C
+	CALL FILL(DTTAB,NDTTAB,P(DTYPE),STR,IER)
+	WRITE(YLAB,'(6A4,1X,4A4)')(STR(I),I=1,10)
+	CALL LJUST(YLAB,2048,J)
+	WRITE(MORINT,'(4A4)')P(MOOR),P(MOOR+1),P(INST),P(INST+1)
+	CALL SQUISH(MORINT,1,16)
+	MORLEN=LNBLK(MORINT,16)
+	ILAT=P(SLAT)/100.0
+	IF(P(SLAT).GE.0)THEN
+	    NS='N'
+	ELSE
+	    NS='S'
+	ENDIF
+	RLAT=ABS(P(SLAT)-ILAT*100.0)
+	IF(RLAT.EQ.0.)THEN
+	    WRITE(LAT,999)IABS(ILAT),NS
+999	    FORMAT(I4,'#',A1)
+	ELSE
+	    WRITE(LAT,998)IABS(ILAT),RLAT,NS
+998	    FORMAT(I4,1X,F4.1,'#',A1)
+	ENDIF
+	CALL LJUST(LAT,11,LATLEN)
+	ILON=P(SLON)/100.0
+	IF(P(SLON).GE.0)THEN
+	    EW='E'
+	ELSE
+	    EW='W'
+	ENDIF
+	RLON=ABS(P(SLON)-ILON*100.0)
+	IF(RLON.EQ.0.)THEN
+	    WRITE(LON,999)IABS(ILON),EW
+	ELSE
+	    WRITE(LON,998)IABS(ILON),RLON,EW
+	ENDIF
+	CALL LJUST(LON,11,LONLEN)
+	WRITE(DEP,'(F10.1)')P(INDEP)
+	CALL LJUST(DEP,10,DEPLEN)
+C
+C	create main label
+C
+	LAB1=MORINT(1:MORLEN)//'  '//LAT(1:LATLEN)//', '//
+     *	    LON(1:LONLEN)//'  ('//DEP(1:DEPLEN)//' M)'
+	RETURN
+	END
+	SUBROUTINE LJUST(STR,INLEN,OUTLEN)
+C
+C	LJUST left justifies a string and returns its length
+C
+	INTEGER INLEN,OUTLEN
+
+#ifdef FORTRAN_90
+	character str*(*)
+#else
+	CHARACTER STR*2048
+#endif
+
+	IF(STR.EQ.' ')THEN
+	    OUTLEN=1
+	    RETURN
+	ENDIF
+100	IF(STR(1:1).NE.' ')GOTO 200
+	STR(1:INLEN)=STR(2:INLEN)
+	GOTO 100
+200	OUTLEN=LNBLK(STR,INLEN)
+	RETURN
+	END
diff --git a/ppl/plot/dsflim.F b/ppl/plot/dsflim.F
new file mode 100644
index 0000000..4bc6cc7
--- /dev/null
+++ b/ppl/plot/dsflim.F
@@ -0,0 +1,102 @@
+	SUBROUTINE DSFLIM
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dsflim.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	Subroutine called by REDSF to keep track of the maximum and
+C	minimum times for the data
+C
+#ifdef unix
+	INCLUDE 'BIBO.COM'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'DATA.INC'
+#else
+        INCLUDE 'pplinc:BIBO.COM'
+        INCLUDE 'pplinc:AXISL.INC'
+        INCLUDE 'pplinc:TAXIS.INC'
+        INCLUDE 'pplinc:CMRD.INC'
+        INCLUDE 'pplinc:DATA.INC'
+#endif
+C
+	INTEGER*4 MTMIN,TSTART,TSTOP,TIME
+	REAL STOP(3),TEMP(3)
+C
+	IF(LINEN.EQ.1)THEN
+	    CALL MTMDY(P(STIME),IM,ID,IY)
+	    WRITE(ITMIN,999)IY,IM,ID,IFIX(P(STIME+2))
+999	    FORMAT(3I2.2,I4.4)
+	    IF(IAUTOT.EQ.1)ITSTRT=ITMIN
+	    TSTOP=MTMIN(P(STIME))+(P(NPTS)-1)*P(SRATE)
+	    CALL MINMT(TSTOP,STOP)
+	    CALL MTMDY(STOP,IM,ID,IY)
+	    WRITE(ITMAX,999)IY,IM,ID,IFIX(STOP(3))
+	ELSE
+	    TSTART=MTMIN(P(STIME))
+	    TSTOP=TSTART+(P(NPTS)-1)*P(SRATE)
+	    CALL MINMT(TSTOP,STOP)
+C
+C	FIND TIME RANGE MINIMUM
+C
+	    READ(ITMIN,999)IY,IM,ID,IHR
+	    CALL MDYMT(TEMP,IM,ID,IY)
+	    TEMP(3)=IHR
+	    TIME=MTMIN(TEMP)
+	    IF(TSTART.LT.TIME)THEN
+		CALL MTMDY(P(STIME),IM,ID,IY)
+		WRITE(ITMIN,999)IY,IM,ID,IFIX(P(STIME+2))
+	    ENDIF
+	    READ(ITMAX,999)IY,IM,ID,IHR
+	    CALL MDYMT(TEMP,IM,ID,IY)
+	    TEMP(3)=IHR
+	    TIME=MTMIN(TEMP)
+	    IF(TSTOP.GT.TIME)THEN
+		CALL MTMDY(STOP,IM,ID,IY)
+		WRITE(ITMAX,999)IY,IM,ID,IFIX(STOP(3))
+	    ENDIF
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plot/ferret_plot_complete.F b/ppl/plot/ferret_plot_complete.F
new file mode 100644
index 0000000..c4b2d71
--- /dev/null
+++ b/ppl/plot/ferret_plot_complete.F
@@ -0,0 +1,67 @@
+      SUBROUTINE FERRET_PLOT_COMPLETE( n )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Display a diagnostic message indicating that PLOT+ has completed its plot.
+* This routine is to be called directly from PLOT+.
+* It requires an External declaration in the main program to ensure
+* that it is loaded at link time.
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+
+* Unix/RISC port - 10/91
+* V320: 12/29/94 - use SPLIT_LIST to redirect tty output for GUI
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+*       *acm* 3/12 cleanup ifdefs and unnecessary include files
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'xprog_state.cmn'
+	
+* calling argument declarations:
+	INTEGER n
+
+* local variable declarations:
+	INTEGER slen
+	CHARACTER LEFINT*5
+
+        IF ( mode_diagnostic ) CALL SPLIT_LIST(pttmode_ops,
+     .		ttout_lun, 'PPL plot '//LEFINT(n,slen)// 'complete', 0)
+
+        RETURN
+        END
diff --git a/ppl/plot/get_curvilinear_limits.F b/ppl/plot/get_curvilinear_limits.F
new file mode 100644
index 0000000..07c9a30
--- /dev/null
+++ b/ppl/plot/get_curvilinear_limits.F
@@ -0,0 +1,65 @@
+	SUBROUTINE GET_CURVILINEAR_LIMITS( xmin, xmax, ymin, ymax )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Copy the plot limits, stored in curvilinear common, to the arguments
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+
+* V450: 3/97
+*
+* 9/98 - *kob* - this routine was originaly located in fer/plt but because
+*                of linking difficulties w/ the newly organized source code
+*                it was deemed more apporpriate in this directory
+
+#ifdef unix
+	include 'xcurvilinear.cmn'
+#else
+#endif
+
+* calling argument declarations:
+	REAL xmin, xmax, ymin, ymax
+
+* internal variable declarations:
+
+	xmin = wwxmin
+	xmax = wwxmax
+	ymin = wwymin
+	ymax = wwymax
+
+	RETURN
+	END
diff --git a/ppl/plot/get_vp_from_ferret.F b/ppl/plot/get_vp_from_ferret.F
new file mode 100644
index 0000000..6f0ff7b
--- /dev/null
+++ b/ppl/plot/get_vp_from_ferret.F
@@ -0,0 +1,91 @@
+	SUBROUTINE GET_VP_FROM_FERRET(  xorg, yorg,
+     .					size, scale, xclip, yclip, xll, yll )
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* get viewport and window information from FERRET common
+* (this routine to hide FERRET common from PPLUS)
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 -  1/20/89
+* V200:  3/13/90 - allow wsid.eq.0 for all windows cancelled (metafile open)
+* V300:  3/20/93 - use ABS() to avoid negative size passed to PLOT+
+* V540:  *sh* 9/01 - call VP_AXLIM2LIM to translate axis-relative VP limits
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+	include 'ferret.parm'		! with unspecified_val4
+	include 'xplot_state.cmn'		! viewport info
+	include 'gkscm1_inc.decl'	! with wsid
+	include 'GKSCM1.INC'	! with wsid
+
+* calling argument declarations:
+	REAL xorg, yorg, size, scale, xclip, yclip, xll, yll
+
+* internal variable declarations:
+	LOGICAL clip
+	REAL  xoei,  yoei,  xcei,  ycei
+
+	xorg  = vp_xorg(vp_num)
+	yorg  = vp_yorg(vp_num)
+	size  = ABS(vp_size(vp_num))    ! 3/93 mod *sh*
+	scale = 1.0
+
+	clip    = vp_xclip(vp_num) .NE. unspecified_val4
+	IF ( clip ) THEN
+	   xclip = vp_xclip( vp_num )
+	   yclip = vp_yclip( vp_num )
+	ENDIF
+
+* let the system window manager deal with placing the window on the screen
+	xll = 0.0
+	yll = 0.0
+
+* 9/01 additions
+	IF (vp_by_axis( vp_num )) THEN
+           xoei = wn_xwhitelo(wsid)  ! ppl xorigin
+           yoei = wn_ywhitelo(wsid)  ! ppl yorigin
+           xcei = wn_xwhitehi(wsid)  ! white space to right of X axis
+           ycei = wn_ywhitehi(wsid)  ! white space for docmtn at top of plot
+* ... adjust limits given as axis positions to limits of viewport
+	   CALL VP_AXLIM2LIM( scale, xorg, yorg, xclip, yclip,
+     .                               xorg, yorg, xclip, yclip,
+     .                               xoei,  yoei,  xcei,  ycei )
+    
+	ENDIF
+
+	RETURN
+	END
diff --git a/ppl/plot/interrupt.F b/ppl/plot/interrupt.F
new file mode 100644
index 0000000..599da3d
--- /dev/null
+++ b/ppl/plot/interrupt.F
@@ -0,0 +1,67 @@
+	SUBROUTINE INTERRUPT ( * )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* send appropriate signals to indicate an interrupt has taken place
+* always take "abnormal" return
+
+* ... FERRET version ( different version for PPLUS )
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/24/89
+
+#ifdef unix
+	include 'errmsg.parm'
+	include 'xplot_state.cmn'
+#else
+	INCLUDE 'FERRET_CMN:ERRMSG.PARM'
+	INCLUDE 'FERRET_CMN:XPLOT_STATE.CMN'
+#endif
+
+* local variable declarations:
+	INTEGER	status
+
+* set flag indicating that interrupt was detected and resolved in PPLUS
+	ppl_interrupted = .TRUE.
+
+* issue interrupted message and set FERRET states to respond
+	CALL ERRMSG ( ferr_interrupt, status, ' ', *5000 )
+
+ 5000	RETURN 1
+	END
diff --git a/ppl/plot/labdrw.F b/ppl/plot/labdrw.F
new file mode 100644
index 0000000..d1b8de1
--- /dev/null
+++ b/ppl/plot/labdrw.F
@@ -0,0 +1,236 @@
+	SUBROUTINE LABDRW(XF,YF,IFX,IFY)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)labdrw.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* v552 3/03 Longer strings and changes for multi-line labels.
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'PLTL.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'MPLOT.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'TICS.INC'
+	INCLUDE 'TICS2.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'AXLWID.INC'
+
+	CHARACTER IFX*(*),IFY*(*)
+        INTEGER j, lablen, numlines, slen
+        REAL htnew, wid
+
+c        INTEGER lnbeg(500), lnend(500)
+c        CHARACTER fontprefix*3, penprefix*3, newfont*3, newpen*3
+c        REAL line_spacing
+
+c        line_spacing = 0.4
+
+        lablen = 2048
+
+C	DRAW LABELS
+	IF(MAKEP.EQ.'VIEW')GOTO 40
+	IF(LABELY.EQ.0.OR.ITFLG.EQ.-1)GOTO 20
+
+C  Y label. center each line 
+
+        CALL tm_break_lines (ylab, lnbeg, lnend, numlines)
+
+        IF(LABELY.LT.0.)THEN 
+        XL=XLO-(YWID+HYLAB)/XF
+           xl = xl - (numlines-1)*hylab/xf
+        ELSE
+           XL=XHI+(YWID+2.*HYLAB)/XF
+        ENDIF
+
+        nfont = 0
+        npen = 0
+        fontprefix = ""
+        penprefix = ""
+        DO 10 j = 1, numlines
+           CALL getlabfonts (ylab, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+	   YL=YLO+(YLEN-SYMWID(HYLAB, NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 ylab(lnbeg(j):lnend(j)) ))*.5/YF
+
+	   CALL SYMBEL(XL, YL, 90., HYLAB, NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 ylab(lnbeg(j):lnend(j)))
+
+           XL= xl + line_spacing*HYLAB/XF
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+           IF (npnew.GT.0) THEN
+              penprefix(1:3) = newpen(1:3)
+              npen = 3
+           ENDIF
+           IF (nfnew.GT.0) THEN
+              fontprefix(1:3) = newfont(1:3)
+              nfont = 3
+           ENDIF
+
+10      CONTINUE
+
+
+C  X label
+
+20	IF(LABELX.EQ.0.OR.ITFLG.EQ.1)GOTO 40
+        CALL tm_break_lines (xlab, lnbeg, lnend, numlines)
+
+	IF(LABELX.LT.0)THEN
+	    YL=YLO-(XWID+2.*HXLAB)/YF
+	ELSE
+	    YL=YHI+(XWID+HXLAB)/YF
+            IF (numlines .GT. 1) yl = yl + 
+     .           line_spacing*(numlines-1)* hxlab/yf
+	ENDIF
+
+        nfont = 0
+        npen = 0
+        fontprefix = ""
+        penprefix = ""
+
+        DO 30 j = 1, numlines
+cc For fixing bug 1582: missing label on horizontal axis. 
+cc This crept in with multi-line labels. no need for IF(LABELX.LT.0) here.
+cc	IF(LABELX.LT.0)THEN
+
+           CALL getlabfonts (xlab, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+	   XL=XLO+(XLEN-SYMWID(HXLAB,NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 xlab(lnbeg(j):lnend(j)) ))*.5/XF
+
+	   CALL SYMBEL(XL,YL,0.,HXLAB, NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 xlab(lnbeg(j):lnend(j)))
+
+           yl = yl - line_spacing* hxlab/yf
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+           IF (npnew.GT.0) THEN
+              penprefix(1:3) = newpen(1:3)
+              npen = 3
+           ENDIF
+           IF (nfnew.GT.0) THEN
+              fontprefix(1:3) = newfont(1:3)
+              nfont = 3
+           ENDIF
+
+cc        ENDIF
+30      CONTINUE
+
+C  Main label
+
+40      CALL tm_break_lines (lab1, lnbeg, lnend, numlines)
+
+* Adjust character size for the length of the longest line
+* This may have already been done in box_label, but not if
+* title was set by a PPL TITLE command.
+
+        htnew = hlab1
+        wid = 0.
+        DO 330 k = 1, numlines
+           slen = lnend(k) - lnbeg(k) + 1
+	   wid = MAX(wid, SYMWID(htnew, slen, lab1(lnbeg(k):lnend(k))))
+  330   CONTINUE
+
+* xsize in call to box_label is .75* x axis length
+
+        htnew = htnew * MIN(1., 1.25* .75*xlen/wid)
+
+C	Determine starting y position of main label
+
+        ITFLG2=0
+        IF(ITFLG.EQ.1)ITFLG2=1
+	IF (LABELX .GE. 0) THEN
+	  YTEMP = XWID - 1.9*ABS(XCSIZE) + 2.5*htnew
+	ELSE
+	  YTEMP = XWID + 2.0*HXLAB * (1-ITFLG2)
+     .	          + 2.5*htnew
+	ENDIF
+	YL=YLO-YTEMP/YF
+
+        nfont = 0
+        npen = 0
+        fontprefix = ""
+        penprefix = ""
+
+        DO 50 j = 1, numlines
+           CALL getlabfonts (lab1, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+	   XL=XLO+(XLEN-
+     .          SYMWID(htnew,NCHR,lab1(lnbeg(j):lnend(j))))*.5/XF
+
+	   CALL SYMBEL(XL,YL,0.,htnew, NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 lab1(lnbeg(j):lnend(j)))
+
+           yl = yl - line_spacing* htnew/yf
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+           IF (npnew.GT.0) THEN
+              penprefix(1:3) = newpen(1:3)
+              npen = 3
+           ENDIF
+           IF (nfnew.GT.0) THEN
+              fontprefix(1:3) = newfont(1:3)
+              nfont = 3
+           ENDIF
+50      CONTINUE
+
+70	RETURN
+	END
diff --git a/ppl/plot/lev.F b/ppl/plot/lev.F
new file mode 100644
index 0000000..f4bb4a1
--- /dev/null
+++ b/ppl/plot/lev.F
@@ -0,0 +1,265 @@
+	SUBROUTINE LEV
+C** 
+C**    @(#)lev.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'parampl5_dat.decl'
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+	CHARACTER PRSE*2048
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       *jd* rename variable IF to INTIF for MAC 7.92
+* 	*jd* 5.6.96 Add code to fix bug in specification of levels
+*	where level should be zero but round off error results in near but
+*	non zero value.
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* V600 *acm* 8/05 Fix bug 1335: move the initialization of LWGT(j) = 2 to 
+*                 before the possible resetting of zlev if posinf true.
+* V603 *acm* 7/07 As done in plotz.F, use TM_FPEQ to compare zlev(i) to 0.,
+*                 within machine accuracy.
+* V608 *acm*10/07 The above fix refered to TM_FPEQ( ABS(ZLEV(I)) ,0.) ) 
+*                 It should be ZLEV(I). Fixes bug 1546.
+* V610 *acm* 3/08 - add new MODE NLEVELS; default number of levels is now 40
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 7/13 Ticket 1990: fixes for number of digits. More precision needed 
+*                 (Lavelle examples) 
+* v686 *acm* 1/14 Fix ticket 2123: labeling color bar when there is just one level
+* v686 *acm* 2/14 Fix ticket 2124: Do the above fix only in the subroutine KEY.
+
+	parameter	(epsilon = 1e-6)
+
+
+	DIMENSION VAL(4),INTIF(4)
+        INTEGER ntop
+        LOGICAL   TM_FPEQ_SNGL
+
+
+	IF(LABEL.EQ.' ')THEN
+	    NLEV=NLEV_DFLT
+	    IAUTOC=1
+	    GOTO 10
+	ENDIF
+	CALL UPPER(LABEL,2048)
+C
+C	BEGIN PARSE
+C
+        posinf = .FALSE.
+        neginf = .FALSE.
+
+        ISTP=-1
+	IREL=0
+200	LABEL=LABEL(ISTP+2:)
+	IST=INDEX(LABEL,'(')+1
+	ISTP=INDEX(LABEL,')')-1
+	IF(IST.EQ.1)GOTO 10
+	IF(ISTP.EQ.-1)THEN
+	    CALL CMDERR(10,STRING,ISLEN,LBSTRT+IREL+IST-2)
+	    GOTO 10
+	ENDIF
+	PRSE=LABEL(IST:ISTP)
+	DO 11 I=1,4
+	VAL(I)=0.0
+11	INTIF(I)=0
+	CALL LEVPRS(PRSE,VAL,INTIF,IER,IPOS)
+	IERR=LBSTRT+IREL+IST+IPOS-2
+	IF(IER.NE.0)THEN
+	    CALL CMDERR(IER,STRING,ISLEN,IERR)
+	    RETURN
+	ENDIF
+	IREL=IREL+ISTP+1
+	CALL LEVSET(IST,VAL,INTIF,LWGH,NL)
+C
+C	TEST
+C
+	IF(LWGH.EQ.0)THEN
+	    IF(IAUTOC.EQ.1)NLEV=0
+	    IAUTOC=0
+C
+C	SET CONTOUR LEVELS
+C
+	    IF(INTIF(1).EQ.0)THEN
+		IAUTOC=1
+		NLEV=NLEV_DFLT
+		GOTO 200
+	    ENDIF
+	    IF(INTIF(3).EQ.1.AND.VAL(3).EQ.0.)THEN
+		DZ=(ZLEV(NLEV)-ZLEV(1))*0.00001
+		DO 500 I=1,NL
+		Z=VAL(1)+(VAL(2)-VAL(1))*(I-1)
+		DO 510 J=1,NLEV
+		IF(ABS(Z-ZLEV(J)).LE.DZ)THEN
+		    CALL DELLEV(J)
+		    GOTO 500
+		ENDIF
+510		CONTINUE
+500		CONTINUE
+	    ELSE
+C
+C	CREATE NEW LEVELS
+C
+		IF(NLEV+NL.GT.ICNLEV)THEN
+		    CALL CMDERR(11,STRING,ISLEN,IERR)
+		    RETURN
+		ENDIF
+		DO 100 I=1,NL
+		J=NLEV+I
+
+                LWGT(J)=2
+
+                IF (J.GT.1 .AND. posinf) THEN
+                   zlev(j) = zlev(j-1) + 1.
+                ELSE 
+                   ZLEV(J)=VAL(1)+VAL(3)*(I-1)
+CC		Bug fix for non zero levels that ought to be zero *jd*
+		   IF (ABS(ZLEV(J)) .LT. EPSILON*ABS(VAL(1))) ZLEV(J)=0.0	
+                   IF ( TM_FPEQ_SNGL( ABS(ZLEV(J)) ,0.) ) GOTO 100
+                ENDIF
+
+		IF(ZLEV(J).GT.0)THEN
+		   LWGT(J)=1
+	        ELSE
+		   LWGT(J)=3
+		ENDIF
+
+100		CONTINUE
+
+C
+C	FIND MIN AND MAX
+C
+		ZMIN=ZLEV(1)
+                IF (neginf) ZMIN = ZLEV(2)
+		ZMAX=ZMIN
+                ntop = nlev+nl
+                IF (posinf) ntop = ntop - 1
+		DO 110 I=2,ntop
+		IF(ZLEV(I).GT.ZMAX)ZMAX=ZLEV(I)
+		IF(ZLEV(I).LT.ZMIN)ZMIN=ZLEV(I)
+110		CONTINUE
+
+                IF (neginf) zlev(1) = zmin - 1.
+
+		DZ=ZMAX-ZMIN
+		IF(DZ.EQ.0.)DZ=ABS(ZMAX)
+		IF(DZ.EQ.0.)DZ=10000.0
+		JJ=NSIGC-IFIX(ALOG10(DZ)+0.5)
+		IF(JJ.LE.0) THEN
+		   IF (NSIGC .LT. 0) THEN
+		     JJ=nsigc+1
+		   ELSE
+		     JJ = -1
+		   ENDIF
+		ENDIF
+		DO 120 I=1,NL
+		J=NLEV+I
+		LCLR(J)=0
+		IF(INTIF(4).EQ.1)THEN
+		    LDIG(J)=VAL(4)
+		ELSE
+		    IF(ZLEV(J).EQ.0)THEN
+			LDIG(J)=-1
+		    ELSE
+			LDIG(J)=JJ
+		    ENDIF
+		ENDIF
+120		CONTINUE
+		NLEV=NLEV+NL
+C
+C	SORT
+C
+		CALL LEVSRT
+C
+C	CHECK FOR DUPLICATE LEVELS?
+C
+		DZ=DZ*0.00001
+		I=1
+		IF(NLEV.LE.1)GOTO 330
+320		J=I+1
+325		IF(ABS(ZLEV(I)-ZLEV(J)).LE.DZ)THEN
+		    CALL DELLEV(I)
+		ENDIF
+		J=J+1
+		IF(J.LE.NLEV)GOTO 325
+330		I=I+1
+		IF(I.LT.NLEV)GOTO 320
+	    ENDIF
+	ELSE IF(LWGH.EQ.5)THEN  ! DELETE a level
+	    DZ=(ZLEV(NLEV)-ZLEV(1))*0.00001
+	    DO 600 I=1,NL
+	    Z=VAL(1)+VAL(3)*(I-1)
+	    DO 610 J=1,NLEV
+	    IF(ABS(Z-ZLEV(J)).LE.DZ)THEN
+		CALL DELLEV(J)
+		GOTO 600
+	    ENDIF
+610	    CONTINUE
+600	    CONTINUE
+	ELSE
+	    IF(IAUTOC.EQ.1)GOTO 10
+C
+C	SET WEIGHTS
+C
+	    DZ=(ZLEV(NLEV)-ZLEV(1))*0.00001
+	    DO 400 I=1,NL
+	    Z=VAL(1)+VAL(3)*(I-1)
+	    DO 410 J=1,NLEV
+	    IF(ABS(Z-ZLEV(J)).LE.DZ)THEN
+		IF(LWGH.EQ.4)THEN
+		    LCLR(J)=VAL(4)
+		ELSE
+		    LWGT(J)=LWGH
+		ENDIF
+		GO TO 400
+	    ENDIF
+410	    CONTINUE
+400	    CONTINUE
+	ENDIF
+	GOTO 200
+10	RETURN
+	END
diff --git a/ppl/plot/level.F b/ppl/plot/level.F
new file mode 100644
index 0000000..1ddec26
--- /dev/null
+++ b/ppl/plot/level.F
@@ -0,0 +1,92 @@
+	SUBROUTINE LEVEL
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)level.F	1.1    3/10/88
+C** V600:  1/06 *acm*  prevent values of LOG10(0.0)
+* V610 *acm* 3/08 - add new MODE NLEVELS; default number of levels is now 40
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+	DO 2601 I=1,M 
+	IF(IFLG(I).NE.0)ZLEV(I)=P(I) 
+2601	CONTINUE 
+	NLEV=M 
+	IF(M.LE.1)THEN 
+	    NLEV=IFIX(P(1)) 
+	    IF(M.EQ.0)NLEV=NLEV_DFLT
+	    IAUTOC=1 
+	    GOTO 10 
+	ELSE 
+	    IAUTOC=0 
+            IF (ZLEV(1)-ZLEV(NLEV) .EQ. 0) THEN
+	       JJ=NSIGC
+            ELSE 
+	       JJ=NSIGC-IFIX(ALOG10(ABS(ZLEV(1)-ZLEV(NLEV)))+.5) 
+	    ENDIF
+            IF(JJ.LE.0)JJ=-1 
+	    DO 2602 I=1,NLEV 
+	    LCLR(I)=0
+	    IF(ZLEV(I).EQ.0.)THEN 
+	      LDIG(I)=-1 
+	    ELSE 
+		LDIG(I)=JJ
+	    END IF
+2602	    CONTINUE
+	END IF 
+	IFLG(1)=0 
+	DO 2603 I=1,NLEV 
+	LWGT(I)=2 
+	IF(ABS(ZLEV(I)).LT.ABS(ZLEV(1)-ZLEV(2))*1.E-5)GOTO 2603 
+	IF(ZLEV(I).GT.0.)THEN 
+	    LWGT(I)=1 
+	ELSE 
+	    LWGT(I)=3 
+	END IF 
+2603	CONTINUE 
+10	RETURN
+	END
diff --git a/ppl/plot/levprs.F b/ppl/plot/levprs.F
new file mode 100644
index 0000000..0dc0b04
--- /dev/null
+++ b/ppl/plot/levprs.F
@@ -0,0 +1,109 @@
+	SUBROUTINE LEVPRS(PRSE,VAL,INTIF,IER,IPOS)
+C** 
+C**    @(#)levprs.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	*jd* MOD 3.29.93 READ fails on SGI with comma in string.  Eliminate.
+*	*jd* MOD 11.1.94 READ fails on IBM AIX without it.  Put back in.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+* v581 *acm* 3/05 open levels (-INF) (INF)
+
+        INCLUDE 'cmndlen.inc'
+	INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+	LOGICAL BLNK
+	CHARACTER PRSE*(*)
+
+*       variable IF renamed to INTIF for MAC *jd* 7.92
+
+	DIMENSION VAL(4),INTIF(4)
+	IER=0
+	IPOS=1
+	I=1
+30	ICM=INDEX(PRSE,',')
+	IF(ICM.EQ.0)ICM=buflen+1
+	IBL=INDEX(PRSE,' ')
+	IF(IBL.EQ.0)IBL=buflen+1
+	ISTPP=MIN0(ICM,IBL,buflen)
+	BLNK=PRSE(ISTPP:ISTPP).EQ.' '
+	IF(ISTPP.NE.1)THEN
+		INTIF(I)=1
+                val(i) = 0
+                IF (prse(:istpp-1) .EQ. 'INF') THEN
+                   posinf = .TRUE.
+                   RETURN
+                ENDIF
+                IF (prse(:istpp-1) .EQ. '-INF') THEN
+                   neginf = .TRUE.
+                   RETURN
+                ENDIF
+		PRSE(ISTPP:ISTPP)=','
+
+#ifdef AIX_XLF
+		READ(PRSE(:ISTPP),996,ERR=1000)VAL(I)
+#else
+		READ(PRSE(:ISTPP-1),996,ERR=1000)VAL(I)
+#endif
+996		FORMAT(E20.0)
+	ENDIF
+20	ISTPP=ISTPP+1
+	IF(ISTPP.GT.buflen)GOTO 40
+	IF(PRSE(ISTPP:ISTPP).EQ.' '.OR.
+     *	(BLNK.AND.PRSE(ISTPP:ISTPP).EQ.','))GOTO 20
+	PRSE=PRSE(ISTPP:)
+	IPOS=IPOS+ISTPP-1
+	I=I+1
+	IF(I.LE.4)GOTO 30
+40	RETURN
+1000	IER=9
+	RETURN
+	END
diff --git a/ppl/plot/levset.F b/ppl/plot/levset.F
new file mode 100644
index 0000000..4b4e4f4
--- /dev/null
+++ b/ppl/plot/levset.F
@@ -0,0 +1,88 @@
+	SUBROUTINE LEVSET(IST,VAL,INTIF,LWGH,NL)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)levset.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+* V510 *sh* 3/00 - bug fix - "DEL" ignored because of misspelling of lwgh
+* V62+ *acm 6/09 - bug fix #1672 too few levels computed depending on the values
+* V62+ *acm 6/09 - rename variable IF to INTIF
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V631 *acm* 10/09 For the fix to bug 1672(present only in 32-bit linux), the
+*                  comparison must be done with TM_FPEQ. This was the cause of bug 1707.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+	INCLUDE 'CMRDL.INC'
+
+	DIMENSION VAL(4),INTIF(4)
+	LOGICAL TM_FPEQ_SNGL
+	REAL top
+
+	LWGH=0
+	IF(INDEX(LABEL(:IST),'DEL').NE.0)LWGH=5
+	IF(INDEX(LABEL(:IST),'PEN').NE.0)LWGH=4
+	IF(INDEX(LABEL(:IST),'DASH').NE.0)LWGH=3
+	IF(INDEX(LABEL(:IST),'DARK').NE.0)LWGH=2
+	IF(INDEX(LABEL(:IST),'LINE').NE.0)LWGH=1
+	IF(INTIF(2).EQ.0)THEN
+	   NL=1
+	ELSE
+	   IF(INTIF(3).EQ.0)THEN
+	      VAL(3)=VAL(2)-VAL(1)
+	      NL=2
+	   ELSE
+
+	      IF(VAL(3).NE.0.)THEN
+		 NL = INT((VAL(2)-VAL(1))/VAL(3))+1
+		 top = VAL(1)+(NL-1)*VAL(3)
+		 IF ( (top .LT. VAL(2)) .AND. 
+     .                (.NOT.TM_FPEQ_SNGL(val(2),top)) ) NL = NL + 1 
+	      ELSE
+		 NL=2
+	      ENDIF
+
+	   ENDIF
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plot/levsrt.F b/ppl/plot/levsrt.F
new file mode 100644
index 0000000..cbfd075
--- /dev/null
+++ b/ppl/plot/levsrt.F
@@ -0,0 +1,85 @@
+	SUBROUTINE LEVSRT
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)levsrt.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C***
+* v581 *acm* 3/05 open levels (-INF) (INF)
+
+	INCLUDE 'parampl5_dat.decl'
+	INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+        integer lstart, lend
+
+	LOGICAL BLNK
+
+        lstart = 1
+        IF (neginf) lstart = lstart + 1
+        lend = nlev
+        IF (posinf) lend = lend - 1
+c        IF (lstart+1 .GT. lend) GOTO 320
+
+300	BLNK=.FALSE.
+
+	DO 310 I=lstart+1,lend
+	IF(ZLEV(I-1).GT.ZLEV(I))THEN
+		BLNK=.TRUE.
+		Z=ZLEV(I)
+		J=LDIG(I)
+		K=LWGT(I)
+		JC=LCLR(I)
+		ZLEV(I)=ZLEV(I-1)
+		LDIG(I)=LDIG(I-1)
+		LWGT(I)=LWGT(I-1)
+		LCLR(I)=LCLR(I-1)
+		ZLEV(I-1)=Z
+		LDIG(I-1)=J
+		LWGT(I-1)=K
+		LCLR(I-1)=JC
+	ENDIF
+310	CONTINUE
+	IF(BLNK)GOTO 300
+320	RETURN
+	END
diff --git a/ppl/plot/linear.F b/ppl/plot/linear.F
new file mode 100644
index 0000000..fc8bb0a
--- /dev/null
+++ b/ppl/plot/linear.F
@@ -0,0 +1,427 @@
+	SUBROUTINE LINEAR(Z,NXSIZE,NYSIZE,NX,NY,X1,Y1,DX,DY,
+     *	XP,YP,ZP,N,CAY,NRNG)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)linear.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	This is a substitute routine for ZGRID, where the interpolation
+C	used is linear rather than a fancy spline or lagrangian fit.
+C	While the technique is crude the results are such that no
+C	spurious minimums or maximums will be created.  This routine
+C	expects the input data (XP,YP,ZP) to be ordered and complete.
+C
+C	The data may not have any interal gaps, but 1.0e35 is a valid
+C	missing data value.  The only exception to the data being
+C	complete is that the variable that varies fastest may end 
+C	early, however, the data must start together.
+C
+C	This subroutine expects the data to be on a grid for which the
+C	rows and columns can be unevenly spaced.  If the data is by
+C	rows then a row may be short or if by columns a column can be
+C	short.  (any other gaps will produce unpredictable results)
+C
+C	programmed by: D. W. Denbo    Mar 1986
+C	modified by: D. W. Denbo   July 1986
+C		added missing data types, and speeded it up
+C
+C
+#ifdef unix
+	INCLUDE 'MISS.INC'
+#else
+	INCLUDE 'pplinc:MISS.INC'
+#endif
+C
+	DIMENSION Z(NXSIZE,NYSIZE),XP(N),YP(N),ZP(N)
+	DIMENSION X(20000),Y(20000),IPNT(20000),IEND(20000)
+	DIMENSION IPS(20000),ODX(20000),ODY(20000)
+	LOGICAL XDIR,YDIR,XIN,YIN,XFAST,FLIP
+	INTEGER I,J,K,L
+C
+C	Set up for missing data
+C
+	BIG=0.9E35
+	ZP(N+1)=1.0E35
+C
+C	Scan the input series XP,YP to determine the structure
+C
+	NIX=1
+	NIY=1
+	X(1)=XP(1)
+	Y(1)=YP(1)
+	IPNT(1)=1
+C
+	XFAST=XP(1).NE.XP(2)
+	IF(XFAST)THEN
+	    DO 10 I=2,N
+	    IF(XP(I).EQ.XP(1))GOTO 11
+	    NIX=NIX+1
+	    X(NIX)=XP(I)
+10	    CONTINUE
+11	    DO 12 I=1,N
+C
+C	TEST FOR MISSING DATA
+C
+	    IF(ZLE.AND.ZP(I).LE.CMZLE)ZP(I)=1.E35
+	    IF(ZEQ.AND.ZP(I).EQ.CMZEQ)ZP(I)=1.E35
+	    IF(ZGE.AND.ZP(I).GE.CMZGE)ZP(I)=1.E35
+	    IF(YP(I).NE.Y(NIY))THEN
+		NIY=NIY+1
+		Y(NIY)=YP(I)
+		IPNT(NIY)=I
+	    ENDIF
+12	    CONTINUE
+	    IPNT(NIY+1)=N+1
+	ELSE
+	    DO 13 I=2,N
+	    IF(YP(I).EQ.YP(1))GOTO 14
+	    NIY=NIY+1
+	    Y(NIY)=YP(I)
+13	    CONTINUE
+14	    DO 15 I=1,N
+C
+C	TEST FOR MISSING DATA
+C
+	    IF(ZLE.AND.ZP(I).LE.CMZLE)ZP(I)=1.E35
+	    IF(ZEQ.AND.ZP(I).EQ.CMZEQ)ZP(I)=1.E35
+	    IF(ZGE.AND.ZP(I).GE.CMZGE)ZP(I)=1.E35
+	    IF(XP(I).NE.X(NIX))THEN
+		NIX=NIX+1
+		X(NIX)=XP(I)
+		IPNT(NIX)=I
+	    ENDIF
+15	    CONTINUE
+	    IPNT(NIX+1)=N+1
+	ENDIF
+C
+	IF(XFAST)THEN
+	    DO 420 I=1,NIY
+420	    IEND(I)=IPNT(I+1)
+	ELSE
+	    DO 421 I=1,NIX
+421	    IEND(I)=IPNT(I+1)
+	ENDIF
+C
+	XDIR=X(2).GT.X(1)
+	YDIR=Y(2).GT.Y(1)
+C
+C	Check for the beginning of the data being uneven
+C
+	IF(XFAST)THEN
+	    XST=XP(1)
+	    IF(XDIR)THEN
+		DO 200 I=1,NIY
+		IF(XST.LT.XP(IPNT(I)))XST=XP(IPNT(I))
+200		CONTINUE
+		DO 205 I=1,NIX-1
+		IF(X(I).GT.X(I+1))GOTO 206
+205		CONTINUE
+		I=NIX
+206		NIX=I
+	    ELSE
+		DO 210 I=1,NIY
+		IF(XST.GT.XP(IPNT(I)))XST=XP(IPNT(I))
+210		CONTINUE
+		DO 215 I=1,NIX-1
+		IF(X(I).LT.X(I+1))GOTO 216
+215		CONTINUE
+		I=NIX
+216		NIX=I
+	    ENDIF
+C
+C	    Fix the IX and X arrays if uneven
+C
+	    DO 220 I=1,NIX
+	    IF(XST.EQ.X(I))GOTO 221
+220	    CONTINUE
+221	    IF(I.EQ.1)GOTO 226
+	    DO 225 J=I,NIX
+	    JJ=J-I+1
+	    X(JJ)=X(J)
+225	    CONTINUE
+226	    CONTINUE
+	    NIX=NIX-I+1
+C
+C	    Setup the IXS array
+C
+	    DO 230 I=1,NIY
+	    DO 235 J=IPNT(I),IPNT(I+1)
+	    IF(XST.EQ.XP(J))GOTO 236
+235	    CONTINUE
+236	    IPS(I)=J-IPNT(I)
+230	    CONTINUE
+	ELSE
+	    YST=YP(1)
+	    IF(YDIR)THEN
+		DO 300 I=1,NIX
+		IF(YST.LT.YP(IPNT(I)))YST=YP(IPNT(I))
+300		CONTINUE
+		DO 305 I=1,NIY-1
+		IF(Y(I).GT.Y(I+1))GOTO 306
+305		CONTINUE
+		I=NIY
+306		NIY=I
+	    ELSE
+		DO 310 I=1,NIX
+		IF(YST.GT.YP(IPNT(I)))YST=YP(IPNT(I))
+310		CONTINUE
+		DO 315 I=1,NIY-1
+		IF(Y(I).LT.Y(I+1))GOTO 316
+315		CONTINUE
+		I=NIY
+316		NIY=I
+	    ENDIF
+C
+C	    Fix the IY and Y arrays if uneven
+C
+	    DO 320 I=1,NIY
+	    IF(YST.EQ.Y(I))GOTO 321
+320	    CONTINUE
+321	    IF(I.EQ.1)GOTO 326
+	    DO 325 J=I,NIY
+	    JJ=J-I+1
+	    Y(JJ)=Y(J)
+325	    CONTINUE
+326	    CONTINUE
+	    NIY=NIY-I+1
+C
+C	    Setup the IYS array
+C
+	    DO 330 I=1,NIX
+	    DO 335 J=IPNT(I),IPNT(I+1)
+	    IF(YST.EQ.YP(J))GOTO 336
+335	    CONTINUE
+336	    IPS(I)=J-IPNT(I)
+330	    CONTINUE
+	ENDIF
+C
+C	Sort the slowly varying index
+C
+	IF(XFAST)THEN
+405	    FLIP=.FALSE.
+	    DO 400 J=2,NIY
+	    IF(Y(J-1).GT.Y(J))THEN
+		FLIP=.TRUE.
+		YT=Y(J-1)
+		Y(J-1)=Y(J)
+		Y(J)=YT
+		I=IPNT(J-1)
+		IPNT(J-1)=IPNT(J)
+		IPNT(J)=I
+		I=IEND(J-1)
+		IEND(J-1)=IEND(J)
+		IEND(J)=I
+		I=IPS(J-1)
+		IPS(J-1)=IPS(J)
+		IPS(J)=I
+	    ENDIF
+400	    CONTINUE
+	    IF(FLIP)GOTO 405
+	    YDIR=.TRUE.
+	ELSE
+415	    FLIP=.FALSE.
+	    DO 410 J=2,NIX
+	    IF(X(J-1).GT.X(J))THEN
+		FLIP=.TRUE.
+		XT=X(J-1)
+		X(J-1)=X(J)
+		X(J)=XT
+		I=IPNT(J-1)
+		IPNT(J-1)=IPNT(J)
+		IPNT(J)=I
+		I=IEND(J-1)
+		IEND(J-1)=IEND(J)
+		IEND(J)=I
+		I=IPS(J-1)
+		IPS(J-1)=IPS(J)
+		IPS(J)=I
+	    ENDIF
+410	    CONTINUE
+	    IF(FLIP)GOTO 415
+	    XDIR=.TRUE.
+	ENDIF
+C
+C	Begin interpolation  (double linear)
+C
+C
+C	Set up limits for close enough 
+C
+	XERR=DX*1.E-4
+	YERR=DY*1.E-4
+	IF(XDIR)THEN
+	    X1E=X(1)-XERR
+	    XNE=X(NIX)+XERR
+	ELSE
+	    X1E=X(1)+XERR
+	    XNE=X(NIX)-XERR
+	ENDIF
+C
+	IF(YDIR)THEN
+	    Y1E=Y(1)-YERR
+	    YNE=Y(NIY)+YERR
+	ELSE
+	    Y1E=Y(1)+YERR
+	    YNE=Y(NIY)-YERR
+	ENDIF
+C
+	DO 50 J=1,NIX-1
+50	ODX(J)=1./(X(J+1)-X(J))
+	DO 51 J=1,NIY-1
+51	ODY(J)=1./(Y(J+1)-Y(J))
+C
+	DO 100 J=1,NX
+	XJ=X1+DX*(J-1)
+	DO 100 L=1,NY
+	YL=Y1+DY*(L-1)
+C
+C	Find where Z(J,L) is located
+C
+	XIN=.FALSE.
+	I=1
+	IF(XDIR)THEN
+	    IF(XJ.GE.X1E.AND.XJ.LE.XNE)THEN
+		XIN=.TRUE.
+		DO 110 I=2,NIX
+ 	IF(XJ-XERR.LE.X(I))GOTO 111
+110		CONTINUE
+111		I=I-1
+	    ELSE
+		IF(XJ.GT.X(NIX))I=NIX
+	    ENDIF
+	ELSE
+	    IF(XJ.LE.X1E.AND.XJ.GE.XNE)THEN
+		XIN=.TRUE.
+		DO 120 I=2,NIX
+		IF(XJ+XERR.GE.X(I))GOTO 121
+120		CONTINUE
+121		I=I-1
+	    ELSE
+		IF(XJ.LT.X(NIX))I=NIX
+	    ENDIF
+	ENDIF
+C
+	YIN=.FALSE.
+	K=1
+	IF(YDIR)THEN
+	    IF(YL.GE.Y1E.AND.YL.LE.YNE)THEN
+		YIN=.TRUE.
+		DO 130 K=2,NIY
+		IF(YL-YERR.LE.Y(K))GOTO 131
+130		CONTINUE
+131		K=K-1
+	    ELSE
+		IF(YL.GT.Y(NIY))K=NIY
+	    ENDIF
+	ELSE
+	    IF(YL.LE.Y1E.AND.YL.GE.YNE)THEN
+		YIN=.TRUE.
+		DO 140 K=2,NIY
+		IF(YL+YERR.GE.Y(K))GOTO 141
+140		CONTINUE
+141		K=K-1
+	    ELSE
+		IF(YL.LT.Y(NIY))K=NIY
+	    ENDIF
+	ENDIF
+C
+C	If inside then do the interpolation
+C
+	IF(XIN.AND.YIN)THEN
+C
+C	    Get the four corners
+C
+	    I00=IPOS(I  ,K  ,IPNT,IPS,IEND,XFAST,N)
+	    I01=IPOS(I  ,K+1,IPNT,IPS,IEND,XFAST,N)
+	    I10=IPOS(I+1,K  ,IPNT,IPS,IEND,XFAST,N)
+	    I11=IPOS(I+1,K+1,IPNT,IPS,IEND,XFAST,N)
+C
+	    IF(ZP(I00).GE.BIG.OR.ZP(I10).GE.BIG.OR.
+     *	    ZP(I01).GE.BIG.OR.ZP(I11).GE.BIG)THEN
+		Z(J,L)=1.0E35
+	    ELSE
+		DXI=(XJ-X(I))*ODX(I)
+		DYK=(YL-Y(K))*ODY(K)
+C
+C		Do it!
+C
+		Z(J,L)=ZP(I00)+(ZP(I10)-ZP(I00))*DXI
+     *			      +(ZP(I01)-ZP(I00))*DYK
+     *		+(ZP(I11)-ZP(I01)-ZP(I10)+ZP(I00))*DXI*DYK
+	    ENDIF
+	ELSE
+	    Z(J,L)=1.0E35
+C
+	    IF(YIN.AND.ABS(DX).GT.ABS(XJ-X(I)))THEN
+		I00=IPOS(I,K  ,IPNT,IPS,IEND,XFAST,N)
+		I01=IPOS(I,K+1,IPNT,IPS,IEND,XFAST,N)
+		IF(ZP(I00).LT.BIG.AND.ZP(I01).LT.BIG)THEN
+		    A=(ZP(I01)-ZP(I00))*ODY(K)
+		    B=ZP(I00)-A*Y(K)
+		    Z(J,L)=A*YL+B
+		ENDIF
+	    ELSE IF(XIN.AND.ABS(DY).GT.ABS(YL-Y(K)))THEN
+		I00=IPOS(I  ,K,IPNT,IPS,IEND,XFAST,N)
+		I10=IPOS(I+1,K,IPNT,IPS,IEND,XFAST,N)
+		IF(ZP(I00).LT.BIG.AND.ZP(I10).LT.BIG)THEN
+		    A=(ZP(I10)-ZP(I00))*ODX(I)
+		    B=ZP(I00)-A*X(I)
+		    Z(J,L)=A*XJ+B
+		ENDIF
+	    ENDIF
+	ENDIF
+100	CONTINUE
+	RETURN
+	END
+	FUNCTION IPOS(I,J,IPNT,IPS,IEND,FAST,N)
+	LOGICAL FAST
+	DIMENSION IPNT(20000),IPS(20000),IEND(20000)
+	IF(FAST)THEN
+	    IPOS=IPNT(J)+I-1+IPS(J)
+	    IF(IPOS.GE.IEND(J))IPOS=N+1
+	ELSE
+	    IPOS=IPNT(I)+J-1+IPS(I)
+	    IF(IPOS.GE.IEND(I))IPOS=N+1
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plot/linfit.F b/ppl/plot/linfit.F
new file mode 100644
index 0000000..06ab43a
--- /dev/null
+++ b/ppl/plot/linfit.F
@@ -0,0 +1,323 @@
+	SUBROUTINE LINFIT(ILNE,X,NSIZE,IBASE,PBUF)
+	DIMENSION X(NSIZE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)linfit.F	1.1    3/10/88
+C**
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'SYSTEM.INC'
+        INCLUDE 'cmndlen.inc'
+
+	CHARACTER OUT*80,SYM*120
+C
+C	DO A LEAST SQUARES FIT ON LINE 'ILNE', PLACE THE RESULT INTO
+C	THE ECHO FILE AND INTO 'LINEN+1' AND CLEAN UP VARIABLES
+C
+C	CALCULATE BASE FOR REGRESSION DATA
+C
+	CALL SETFIT(ILNE,X,NSIZE,IBASEJ,XIMIN,XIMAX)
+	NPTS=LLENG(ILNE)
+	CALL CORREL(X,NSIZE,IBASEJ,NPTS,XIMIN,XIMAX,R,A,B,AS,BS,VAR,STD)
+C
+C	WRITE RESULTS INTO GLOBAL SYMBOLS
+C
+	SYM='*PPL$LF_R2'
+	WRITE(OUT,'(F10.4)')R*R
+	CALL PUTSYM(SYM,OUT,10,IER)
+	SYM='*PPL$LF_A'
+	CALL PUTVAL(SYM,A,4,IER)
+	SYM='*PPL$LF_A_STDEV'
+	CALL PUTVAL(SYM,AS,4,IER)
+	SYM='*PPL$LF_B'
+	CALL PUTVAL(SYM,B,4,IER)
+	SYM='*PPL$LF_B_STDEV'
+	CALL PUTVAL(SYM,BS,4,IER)
+	SYM='*PPL$LF_VAR'
+	CALL PUTVAL(SYM,VAR,4,IER)
+	SYM='*PPL$LF_RES_VAR'
+	ST2=STD*STD
+	CALL PUTVAL(SYM,ST2,4,IER)
+C
+C	WRITE STATS INTO ECHO FILE AND ON SCREEN
+C
+	WRITE(OUT,999)
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,998)NPTS
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,997)XIMIN,XIMAX
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,996)R*R
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,995)A,AS
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,994)B,BS
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,993)VAR
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+	WRITE(OUT,992)STD*STD
+	IF(.NOT.QUIETF)WRITE(LTTOUT,991)OUT
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+999	FORMAT(
+     *	'C --  LINFIT RESULTS      Y = A + B*X')
+998	FORMAT(
+     *	'C --                 LENGTH = ',I10)
+997	FORMAT(
+     *	'C --  X LIMITS USED FOR FIT = ',1PG10.3,',',G10.3)
+996	FORMAT(
+     *	'C --                     R2 = ',0PF10.4)
+995	FORMAT(
+     *	'C --  REGRESSION COEFFS:  A = ',1PG10.3,'   ST-DEV = ',G10.3)
+994	FORMAT(
+     *	'C --                      B = ',  G10.3,'   ST-DEV = ',G10.3)
+993	FORMAT(
+     *	'C --         TOTAL VARIANCE = ',G10.3)
+992	FORMAT(
+     *	'C --      RESIDUAL VARIANCE = ',G10.3)
+991	FORMAT(1X,A70)
+C
+C	INSERT INTO NEXT LINE
+C
+	CALL GETFIT(X,NSIZE,IBASE,XIMIN,XIMAX,A,B,PBUF)
+	RETURN
+	END
+	SUBROUTINE GETFIT(X,NSIZE,IBASE,XIMIN,XIMAX,A,B,PBUF)
+	DIMENSION X(NSIZE)
+#ifdef  unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'SYSTEM.INC'
+#else
+        INCLUDE 'pplinc:PARAMPL5.DAT'
+        INCLUDE 'pplinc:LINES.INC'
+        INCLUDE 'pplinc:DATA.INC'
+        INCLUDE 'pplinc:CMRD.INC'
+        INCLUDE 'pplinc:LUNITS.INC'
+        INCLUDE 'CMDINC:SYSTEM.INC'
+#endif
+	CHARACTER OUT*80
+	LINEN=LINEN+1
+	XMIN=XIMIN
+	XMAX=XIMAX
+	IF(M.GE.4.AND.IFLG(4).EQ.1)XMIN=P(4)
+	IF(M.GE.5.AND.IFLG(5).EQ.1)XMAX=P(5)
+	YMIN=A+B*XMIN
+	YMAX=A+B*XMAX
+	IX=IBASE-1
+	IY=NSIZE/2+IX
+C
+C	LOAD FITTED LINE
+C
+	WRITE(OUT,996)XMIN,XMAX
+	IF(.NOT.QUIETF)WRITE(LTTOUT,997)OUT
+997	FORMAT(1X,A79)
+	NOUT=LNBLK(OUT,80)
+	CALL ECHO(OUT,NOUT)
+996	FORMAT(
+     *	'C -- X LIMITS USED FOR LINE = ',1PG10.3,',',G10.3)
+	X(IX+1)=XMIN
+	X(IY+1)=YMIN
+	X(IX+2)=XMAX
+	X(IY+2)=YMAX
+	LLENG(LINEN)=2
+	CALL STMNMX(X,NSIZE,XMIN,XMAX,YMIN,YMAX)
+	IBASE=IBASE+2
+	IF(.NOT.QUIETF)WRITE(LTTOUT,999)
+999	FORMAT(1X,'     2 POINTS READ')
+	lnum=linen
+	RETURN
+	END
+      SUBROUTINE CORREL (X,NSIZE,IBASE,N,XMN,XMX,R,A,B,AS,BS,VAR,STD)
+#ifdef  unix
+	INCLUDE 'MISS.INC'
+#else
+	INCLUDE 'pplinc:MISS.INC'
+#endif
+C
+C     COMPUTES THE SAMPLE CORRELATION, R, BETWEEN TWO ARRAYS OF VALUES
+C     (X,Y) WITH N DATA POINTS. CALCULATES CORRELATION SIGNIFICANCE
+C     PARAMETERS - T (UNCORRELATED POPULATION) AND Z (CORRELATED
+C     POPULATION).
+C     ALSO CALCULATES LINEAR REGRESSION COEFFICIENTS (A,B)
+C
+C     PROGRAMMED BY JIM HOLBROOK, AUG, 72.
+C
+      DIMENSION X(NSIZE)
+      IX=IBASE
+      IY=NSIZE/2+IX
+      XX=0.
+      YY=0.
+      XY=0.
+      X1=0.
+      Y1=0.
+	NN=N
+	N=0
+      DO 900 I=1,NN
+	XT=X(IX+I)
+	YT=X(IY+I)
+	IF(XT.LT.XMN.OR.XT.GT.XMX)GOTO 900
+	IF((XLE.AND.XT.LE.CMXLE).OR.
+     *	   (XEQ.AND.XT.EQ.CMXEQ).OR.
+     *	   (XGE.AND.XT.GE.CMXGE).OR.
+     *	   (YLE.AND.YT.LE.CMYLE).OR.
+     *	   (YEQ.AND.YT.EQ.CMYEQ).OR.
+     *	   (YGE.AND.YT.GE.CMYGE))GOTO 900
+	N=N+1
+      XY=XY+XT*YT
+      X1=X1+XT
+      Y1=Y1+YT
+      XX=XX+XT**2
+      YY=YY+YT**2
+900	CONTINUE
+      XN=N
+      A=(XX*Y1-X1*XY)/(XN*XX-X1*X1)
+      B=(XN*XY-X1*Y1)/(XN*XX-X1*X1)
+      S=(-2.0*(B*XY-A*B*X1+A*Y1)+B*B*XX+XN*A*A+YY)
+      S=SQRT(S/(XN-2))
+      AS=S*SQRT(XX/(XN*XX-X1*X1))
+      BS=S*SQRT(1.0/(XX-X1*X1/XN))
+      R1=XN*XY-X1*Y1
+      R2=(XN*XX-X1**2)*(XN*YY-Y1**2)
+ 903  R=R1/SQRT(R2)
+	VAR=(YY/N-(Y1/N)**2)
+      IF (ABS(R-1.) .LE. 1.E-6) R=1.
+      STD=VAR*(1-R*R)
+      STD=SQRT(STD)
+      RETURN
+      END
+	SUBROUTINE SETFIT(ILNE,X,NSIZE,JBASE,XIMIN,XIMAX)
+	DIMENSION X(NSIZE)
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'TAXIS.INC'
+
+	CHARACTER DATE*10
+	IF(ITFLG.EQ.1.AND.N.NE.0)THEN
+C
+C	PARSE THE LABEL FOR MIN AND MAX TIMES
+C
+200	IW=INDEX(LABEL,'W')
+	IF(IW.EQ.0)GOTO 100
+	ICM=INDEX(LABEL,',')
+	ISPC=INDEX(LABEL,' ')
+	IF(ICM.EQ.0)ICM=buflen+1
+	IF(ISPC.EQ.0)ISPC=buflen+1
+	IF(ICM.LT.IW)THEN
+		M=M+1
+		IFLG(M)=0
+		LABEL=LABEL(ICM+1:)
+	ELSE
+		IEND=MIN0(ICM,ISPC,N)
+		ILEN=IEND-IW-2
+		DATE=LABEL(IW+1:IEND-1)
+		IF(ILEN.LT.10)DATE(ILEN+1:)='0000000000'
+		M=M+1
+		IFLG(M)=1
+		P(M)=DIFF(ITSTRT,DATE)/DT+1.0
+		LABEL=LABEL(IEND+1:)
+	ENDIF
+	GOTO 200
+	ENDIF
+100	JBASE=0
+	DO 10 J=1,ILNE-1
+10	JBASE=JBASE+LLENG(J)
+C
+	N=LLENG(ILNE)
+C
+C	FIND XMIN, AND XMAX
+C
+	XMIN=1.E38
+	XMAX=-XMIN
+	DO 20 I=1,LLENG(ILNE)
+	IF((XLE.AND.X(JBASE+I).LE.CMXLE).OR.
+     *	   (XEQ.AND.X(JBASE+I).EQ.CMXEQ).OR.
+     *	   (XGE.AND.X(JBASE+I).GE.CMXGE))GOTO 20
+	IF(X(JBASE+I).LT.XMIN)XMIN=X(JBASE+I)
+	IF(X(JBASE+I).GT.XMAX)XMAX=X(JBASE+I)
+20	CONTINUE
+C
+C	TEST FOR MIN AND MAX
+C
+	IF(M.GE.2.AND.IFLG(2).EQ.1)THEN
+		XIMIN=P(2)
+	ELSE
+		XIMIN=XMIN
+	ENDIF
+	IF(M.GE.3.AND.IFLG(3).EQ.1)THEN
+		XIMAX=P(3)
+	ELSE
+		XIMAX=XMAX
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plot/mplot.F b/ppl/plot/mplot.F
new file mode 100644
index 0000000..74b4734
--- /dev/null
+++ b/ppl/plot/mplot.F
@@ -0,0 +1,225 @@
+      SUBROUTINE MPLOT(X,NSIZE) 
+	DIMENSION X(NSIZE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+
+* V54: *acm* 9/01 changes for dynamic allocation of PPLUS memory.
+*                 Pass array X to SAVEZ
+*      *acm* 10/01  remove VMS includes
+*
+C**    @(#)mplot.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'MPLOT.INC'
+	INCLUDE 'MPLOTX.INC'
+	INCLUDE 'MPLOTS.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'XYLABP.INC'
+	INCLUDE 'FILNAM.INC'
+	INCLUDE 'LUNITS.INC'
+
+C     SAVE ORGS AND HEIGHTS 
+	IF(IMCNT.EQ.0)THEN 
+	    XORGT=XORG 
+	    YORGT=YORG 
+	    XLENT=XLEN 
+	    YLENT=YLEN 
+	END IF 
+	IMCNT=IMCNT+1 
+	IXM=IXM+1 
+	IF(IXM.GT.MNX)THEN 
+	    IXM=1 
+	    IYM=IYM+1 
+	END IF 
+C     CALC XORG AND YORG 
+	XORG=DXM(1) 
+	DO 10 I=2,IXM 
+10	XORG=XORG+XLENM(I-1)+DXM(I) 
+	YORG=DYM(IYM) 
+	DO 20 I=IYM+1,MNY 
+20	YORG=YORG+DYM(I)+YLENM(I) 
+	XLEN=XLENM(IXM) 
+	YLEN=YLENM(IYM) 
+	LABYT=LABELY 
+	LABXT=LABELX 
+	LABT=LAB1 
+	XLABT=XLAB 
+	YLABT=YLAB 
+C     SET AXIS LABELLING 
+	IF(DXM(IXM).EQ.0)THEN 
+	    MYLEF=1 
+	    IF(LABELY.NE.0)THEN 
+		IF(DXM(IXM+1).EQ.0.)THEN 
+		    LABELY=0 
+		    YLAB=' ' 
+		ELSE 
+		    LABELY=1 
+		END IF 
+	    END IF 
+	END IF 
+	IF(DYM(IYM).EQ.0)THEN 
+	    LAB1=' ' 
+	    MXBOT=1 
+	    IF(LABELX.NE.0)THEN 
+		LAB1=' ' 
+		IF(IYM.EQ.1)THEN 
+		    LABELX=1 
+		ELSE IF(DYM(IYM-1).EQ.0.)THEN 
+		    LABELX=0 
+		    XLAB=' ' 
+		ELSE 
+		LABELX=1 
+		END IF 
+	    END IF 
+	END IF 
+C     SAVE PLOT ON FILE 
+#ifndef unix
+	OPEN(LMULT,FILE=MULTFL,STATUS='OLD',
+     *	ACCESS='APPEND',FORM='UNFORMATTED')
+#endif
+	WRITE(LMULT)IPTS,MXBOT,MYLEF
+	WRITE(LMULT)XLABS,YLABS,RLABS,LTYPE,XLLABS,YLLABS,LLTYPE,
+     *	RHLABS,USRLBS
+	CALL SAVE(LMULT)
+C
+	IF(IPTS(11).EQ.1)THEN
+	CALL SAVEXY(LMULT,X,NSIZE)
+	ELSE
+C
+	CALL SAVEZ(LMULT,X,IPTS(7),IPTS(10),X)
+	ENDIF
+	IF(IZTYP.NE.0)CALL SAVEZG(LMULT)
+C
+#ifndef unix
+	CLOSE(LMULT)
+#endif
+	IVFLG=0
+	LAB1=LABT
+      XLAB=XLABT 
+      YLAB=YLABT 
+      LABELX=LABXT 
+      LABELY=LABYT 
+      MXBOT=0 
+      MYLEF=0 
+      RETURN 
+      ENTRY MPLOT2(X,NSIZE)
+      IMULT=0 
+      IMCNT=0 
+      MNX=0 
+      MNY=1 
+      XORG=XORGT 
+      YORG=YORGT 
+      HEIGHT=HTM 
+      WIDTH=WDM 
+      XLEN=XLENT 
+      YLEN=YLENT 
+      MXBOT=0 
+      MYLEF=0 
+      LAB1=LABT 
+      XLAB=XLABT 
+      YLAB=YLABT 
+      LABELX=LABXT 
+      LABELY=LABYT 
+      RETURN 
+      END 
+	SUBROUTINE SAVEZ(LN,Z,NXS,NYS,X)
+	DIMENSION Z(NXS,NYS),X(*)
+
+	include 'PARAMPL5.DAT'
+	include 'HD.INC'
+	include 'PPLDAT.INC'
+
+        IF(JTYPE.EQ.0)THEN
+            WRITE(LN)Z
+        ELSE IF(JTYPE.EQ.-1)THEN
+            WRITE(LN)(X(K),K=1,2*NXS*NYS)
+        ELSE IF(JTYPE.EQ.2)THEN
+            WRITE(LN)(X(K),K=1,NXS*NYS+NXS+NYS)
+        ELSE
+            NXNY2=2*(NXS*NYS+NXS+NYS)
+            WRITE(LN)(X(K),K=1,NXNY2)
+        ENDIF
+        RETURN
+        ENTRY GETZ(LN,Z,NXS,NYS)
+        IF(JTYPE.EQ.0)THEN
+            READ(LN,END=200)Z
+        ELSE IF(JTYPE.EQ.-1)THEN
+            READ(LN,END=200)(X(K),K=1,2*NXS*NYS)
+        ELSE IF(JTYPE.EQ.2)THEN
+            READ(LN,END=200)(X(K),K=1,NXS*NYS+NXS+NYS)
+        ELSE
+            NXNY2=2*(NXS*NYS+NXS+NYS)
+            READ(LN,END=200)(X(K),K=1,NXNY2)
+        ENDIF
+200     RETURN
+	END
+	SUBROUTINE SAVEXY(LN,X,NSIZE)
+#ifdef unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+#else
+        INCLUDE 'pplinc:PARAMPL5.DAT'
+        INCLUDE 'pplinc:LINES.INC'
+#endif
+	DIMENSION X(NSIZE)
+	IBASE=0
+	IYB=NSIZE/2
+	DO 6002 I=1,LNUM
+	WRITE(LN)(X(IBASE+J),X(IYB+J),J=1,LLENG(I))
+	IBASE=IBASE+LLENG(I)
+6002	IYB=IYB+LLENG(I)
+	RETURN
+	ENTRY GETXY(LN,X,NSIZE)
+	IBASE=0
+	IYB=NSIZE/2
+	DO 6001 I=1,LNUM
+	READ(LN,END=200)(X(IBASE+J),X(IYB+J),J=1,LLENG(I))
+	IBASE=IBASE+LLENG(I)
+6001	IYB=IYB+LLENG(I)
+200	RETURN
+	END
diff --git a/ppl/plot/mult.F b/ppl/plot/mult.F
new file mode 100644
index 0000000..6db83e3
--- /dev/null
+++ b/ppl/plot/mult.F
@@ -0,0 +1,156 @@
+	SUBROUTINE MULT
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)mult.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'mplot_inc.decl'
+        include 'MPLOT.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'plt_inc.decl'
+        include 'PLT.INC'
+        include 'filnam_inc.decl'
+        include 'FILNAM.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'system_inc.decl'
+        include 'SYSTEM.INC'
+#else
+        INCLUDE 'tmap_pplv11inc:tmap_AXIS.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_MPLOT.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_CMRD.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_CMRDL.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_PLT.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_FILNAM.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_LUNITS.INC'
+        INCLUDE 'TMAP_PPLV11INC:SYSTEM_INC.DECL'
+        INCLUDE 'PPLV11INC:SYSTEM.INC'
+#endif
+	IF(IFLG(1).EQ.1)THEN
+	    MNX=P(1)
+	ELSE
+	   MNX=1
+	END IF
+	IF(IFLG(2).EQ.1.AND.M.GE.2)THEN
+	    MNY=P(2)
+	ELSE
+	    MNY=1
+	END IF
+	CALL STPRMP('multplt>',8)
+	IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *	'('' ENTER XLEN FOR COLS 1,2,...,NX'')')
+	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	DO 4901 I=1,MNX
+	IF(M.GE.I.AND.IFLG(I).EQ.1)THEN
+	    XLENM(I)=P(I)
+	ELSE
+	    XLENM(I)=XLEN
+	END IF
+4901	CONTINUE
+	IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *	'('' ENTER YLEN FOR ROWS 1,2,...,NY'')')
+	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	DO 4902 I=1,MNY
+	IF(M.GE.I.AND.IFLG(I).EQ.1)THEN
+	    YLENM(I)=P(I)
+	ELSE
+	    YLENM(I)=YLEN
+	END IF
+4902	CONTINUE
+	IF(.NOT.QUIETF)WRITE(LTTOUT,'('' ENTER PLOT SPACINGS'')')
+	IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *	'('' LEFT BNDRY TO COL 1,COL1 TO COL2,ETC...'')')
+	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	DO 4903 I=1,MNX
+	IF(M.GE.I.AND.IFLG(I).EQ.1)THEN
+	    DXM(I)=P(I)
+	ELSE IF(I.EQ.1)THEN
+	    DXM(1)=1.4
+	ELSE
+	    DXM(I)=DXM(1)
+	END IF
+4903	CONTINUE
+	IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *	'('' ROW1 TO ROW2,...,ROW NY TO BOTTOM'')')
+	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	CALL STPRMP('ppl+>',5)
+	DO 4904 I=1,MNY
+	IF(M.GE.I.AND.IFLG(I).EQ.1)THEN
+	    DYM(I)=P(I)
+	ELSE IF (I.EQ.1) THEN
+	    DYM(1)=1.2
+	ELSE
+	    DYM(I)=DYM(1)
+	END IF
+4904	CONTINUE
+	HTM=HEIGHT
+	WDM=WIDTH
+	WIDTH=DXM(1)
+	DO 4905 I=1,MNX
+4905	WIDTH=WIDTH+XLENM(I)+DXM(I)
+	HEIGHT=DYM(MNY)
+	DO 4906 I=1,MNY
+4906	HEIGHT=HEIGHT+YLENM(I)+DYM(I)
+	IF(.NOT.QUIETF)WRITE(LTTOUT,9987) WIDTH,HEIGHT
+9987	FORMAT(' PLOT IS',F6.2,' IN. WIDE AND',F6.2,' IN.HIGH')
+	IMCNT=0
+	IMULT=1
+	IXM=0
+	IYM=1
+#ifdef unix
+        open(lmult,status='scratch',form='unformatted')
+#else
+	OPEN(LMULT,FILE='MULTZZZ.DAT',STATUS='NEW',
+     *	FORM='UNFORMATTED')
+	INQUIRE(UNIT=LMULT,NAME=MULTFL)
+	CLOSE(LMULT)
+#endif
+10	RETURN
+	END
+
diff --git a/ppl/plot/opnppl.F b/ppl/plot/opnppl.F
new file mode 100644
index 0000000..40bdfe4
--- /dev/null
+++ b/ppl/plot/opnppl.F
@@ -0,0 +1,351 @@
+	SUBROUTINE OPNPPL(EFILE,ELUN,DLUN,MLUN,CLUN,LTT,
+     *			  KEY1,KEY2,EPLUN1,EPLUN2)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mod to set SYM='*PPL$PLTNME' to metafile.plt by default *jd* 1.7.94
+*	Mod to not reference "getlog" routine for linux port *kob* 3.11.97	
+*       Mod to set SYM='*PPL$PLTNME' to value of meta_file *js* 7.25.97
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+C**
+C**    @(#)opnppl.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+c	efile  -- echo file name
+c	elun   -- echo lun
+c	dlun   -- data lun
+c	mlun   -- mult file lun
+c	clun   -- command file lun
+c	ltt    -- terminal logical unit
+c	key1   -- first key file lun
+c	key2   -- second key file lun
+c	eplun1 -- first EPIC lun
+c	eplun2 -- second EPIC lun
+c
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'epiclun_inc.decl'
+        include 'EPICLUN.INC'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'plt_inc.decl'
+        include 'PLT.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'conlab_inc.decl'
+        include 'CONLAB.INC'
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'
+        include 'filnam_inc.decl'
+        include 'FILNAM.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'symkey_inc.decl'
+        include 'SYMKEY.INC'
+        include 'system_inc.decl'
+        include 'SYSTEM.INC'
+        include 'cmdcom_inc.decl'
+        include 'CMDCOM.INC'
+	include 'gkscm2.cmn'
+
+C
+C	USE OF IP FLAGS
+C
+C	IP(1)= BOX ON AND OFF  1=ON  0=OFF
+C
+#ifndef unix
+c       Set up structures for exit handler
+c
+        STRUCTURE /EXIT_DESCRIPTOR/
+            INTEGER LINK,
+     *      ADDR,
+     *      ARGS /1/,
+     *      STATUS_ADDR
+        END STRUCTURE
+        RECORD /EXIT_DESCRIPTOR/ HANDLER
+C
+        EXTERNAL PPLEXT
+        INTEGER*4 EXIT_STATUS
+C
+        BYTE BUF(80),CRB,ESCB
+#endif
+	CHARACTER EFILE*(*)
+C	CHARACTER EFILE*81
+	INTEGER ELUN,DLUN,MLUN,CLUN,LTT,KEY1,KEY2,EPLUN1,EPLUN2
+#ifndef unix
+	CHARACTER ESC*1,CR*1
+        INTEGER*4 LIB$GET_FOREIGN,STAT,LIB$GET_SYMBOL,LEN,IFLAG
+        INCLUDE '($JPIDEF)'
+#endif
+	CHARACTER TEMP*81,TERM*20,SYM*120
+C
+	CHARACTER TYPE*81
+C
+#ifdef unix
+        DATA CRB,ESCB/13,27/,TEMP/'/dev/tty'/,TERM/'/dev/tty'/
+#else
+        DATA CRB,ESCB/13,27/,TEMP/'TT:'/,TERM/'TT:'/
+        EQUIVALENCE (BUF(1),LABEL),(CR,CRB),(ESC,ESCB)
+C
+C       SET UP THE EXIT HANDLER
+C
+        HANDLER.ADDR = %LOC(PPLEXT)
+        HANDLER.STATUS_ADDR = %LOC(EXIT_STATUS)
+C
+C       EXTABLISH THE EXIT HANDLER
+C
+        CALL SYS$DCLEXH(HANDLER)
+#endif
+C
+C	SET UP THE LOGICAL UNITS
+C
+	LUNN=DLUN
+	LUN1=DLUN
+	LUN11=EPLUN1
+	LUN21=EPLUN2
+	LMULT=MLUN
+	LTTOUT=LTT
+	KEYLN1=KEY1
+	KEYLN2=KEY2
+	CMDLUN=CLUN
+	ECHLUN=ELUN
+C
+#ifndef unix
+	CALL ERRSET(64,.TRUE.,.FALSE.,.TRUE.,.FALSE.)
+	CALL ERRSET(44,.TRUE.,.FALSE.,.TRUE.,.FALSE.)
+	CALL ERRSET(36,.TRUE.,.FALSE.,.TRUE.,.FALSE.)
+	CALL ERRSET(30,,.FALSE.,,.FALSE.)
+#endif
+	CALL BAUD(IR)
+	CALL PLTYPE(ICODE)
+C
+#ifdef unix
+#ifndef F90_NO_GETLOG
+        call getlog(type)
+#endif
+        BATCHF = TYPE.EQ.' '
+C
+        call getenv('GRAPHTERM',type)
+        len=lnblk(type,81)
+#else
+        STAT=LIB$GETJPI(JPI$_MODE,,,ISTAT,TYPE,LEN)
+        BATCHF = TYPE(:LEN).EQ.'BATCH'
+C
+        STAT=LIB$GET_SYMBOL('GRAPHTERM',TYPE,LEN)
+#endif
+
+	IF(TYPE(1:LEN).EQ.'TEK41XX'.OR.TYPE(1:LEN).EQ.'TEK4105')THEN
+		MOD=4107
+		CALL TKTYPE(MOD)
+	ELSE IF(TYPE(1:LEN).EQ.'TEK4014')THEN
+		MOD=4014
+		CALL TKTYPE(MOD)
+	ENDIF
+C
+C	OPEN ECHO FILE
+C
+	IF(EFILE.NE.' ')THEN
+#ifdef unix
+            OPEN(ECHLUN,FILE=EFILE,STATUS='UNKNOWN')
+#else
+            OPEN(ECHLUN,FILE=EFILE,STATUS='NEW',CARRIAGECONTROL='LIST')
+#endif
+	ENDIF
+c
+c	open key file
+c
+#ifdef unix
+        call dbmopen('PPL$KEY.001',11,keyln1)
+c
+        IF(BATCHF)TERM='/dev/null'
+C
+C Don't open below -- problem w/ Ultrix *JD* 3.5.91
+C       OPEN(UNIT=LTTOUT,FILE=TERM,STATUS='UNKNOWN')
+#else
+        OPEN(KEYLN1,FILE='PPL$KEY.001',STATUS='NEW',
+     *  ORGANIZATION='INDEXED',ACCESS='KEYED',
+     *  RECORDTYPE='VARIABLE',FORM='FORMATTED',
+     *  KEY=(1:30:CHARACTER))
+c
+        IF(BATCHF)TERM='SYS$OUTPUT:'
+C
+        OPEN(UNIT=LTTOUT,FILE=TERM,STATUS='UNKNOWN',RECL=255)
+#endif
+C
+	CALL STPRMP('ppl+>',5)
+C
+C	SET DEFAULT SYMBOL DEFINITIONS
+C
+	SYM='*PPL$FORMAT'
+	ISYM=LNBLK(IFORM,80)
+	CALL PUTSYM(SYM,IFORM,ISYM,IER)
+	SYM='*PPL$PLTNME'
+	call putsym(sym, meta_file, LNBLK(meta_file,2048), ier)
+	SYM='*PPL$TEKNME'
+#ifdef unix
+        TEMP='/dev/tty'
+#else
+	TEMP='TT:'
+#endif
+	CALL PUTSYM(SYM,TEMP,8,IER)
+	SYM='*PPL$XLEN'
+	CALL PUTVAL(SYM,XLEN,4,IER)
+	SYM='*PPL$YLEN'
+	CALL PUTVAL(SYM,YLEN,4,IER)
+	SYM='*PPL$XORG'
+	CALL PUTVAL(SYM,XORG,4,IER)
+	SYM='*PPL$YORG'
+	CALL PUTVAL(SYM,YORG,4,IER)
+	SYM='*PPL$WIDTH'
+	CALL PUTVAL(SYM,WIDTH,4,IER)
+	SYM='*PPL$HEIGHT'
+	CALL PUTVAL(SYM,HEIGHT,4,IER)
+	SYM='*PPL$LINE_COUNT'
+	TEMP='0'
+	CALL PUTSYM(SYM,TEMP,1,IER)
+C
+C	SET PPL$XFACT, XOFF, YFACT AND YOFF
+C
+	ISYM=MIN0(1,NLINES)
+	DO 20 I=1,ISYM
+	WRITE(SYM,999)'XFACT',I
+999	FORMAT('*PPL$',A,'(',I3,')')
+	CALL PUTVAL(SYM,XFCT(I),4,IER)
+	WRITE(SYM,999)'XOFF',I
+	CALL PUTVAL(SYM,XOFF(I),4,IER)
+	WRITE(SYM,999)'YFACT',I
+	CALL PUTVAL(SYM,YFCT(I),4,IER)
+	WRITE(SYM,999)'YOFF',I
+	CALL PUTVAL(SYM,YOFF(I),4,IER)
+20	CONTINUE
+C
+C	STORE VIEW SYMBOLS
+C
+	WRITE(SYM,997)'X'
+997	FORMAT('*PPL$VIEW_',A)
+	TEMP='0.000'
+	CALL PUTSYM(SYM,TEMP,5,IER)
+	WRITE(SYM,997)'Y'
+	CALL PUTSYM(SYM,TEMP,5,IER)
+	WRITE(SYM,997)'Z'
+	CALL PUTSYM(SYM,TEMP,5,IER)
+10	CONTINUE
+	RETURN
+	END
+#ifndef unix
+        SUBROUTINE PPLEXT(STATUS)
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**     Subprogram called:
+C**             N/A
+C**
+C**     Parameters:
+C**             STATUS -- Exit status, passed from system
+C**
+C**     Description:
+C**             This routine closes all files and deletes temporary files
+C**
+C**     History:
+C**         Written:
+C**             2-AUG-86        by Donald W. Denbo
+C**         Modified:
+C**
+C**
+        INTEGER*4 STATUS
+#ifdef unix
+        include 'filnam_inc.decl'
+        include 'FILNAM.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'symkey_inc.decl'
+        include 'SYMKEY.INC'
+        include 'cmdcom_inc.decl'
+        include 'CMDCOM.INC'
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+#else
+        INCLUDE 'tmap_pplv11inc:tmap_FILNAM.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_LUNITS.INC'
+        INCLUDE 'TMAP_PPLV11INC:SYMKEY_INC.DECL'
+        INCLUDE 'PPLV11INC:SYMKEY.INC'
+        INCLUDE 'TMAP_PPLV11INC:CMDCOM_INC.DECL'
+        INCLUDE 'PPLV11INC:CMDCOM.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_PLTCOM.DAT'
+#endif
+C
+C       CLOSE ALL OPEN COMMAND FILES
+C
+        CALL ATFLSH
+        CLOSE(KEYLN1,DISP='DELETE')
+C
+C       CLOSE MULT FILE IF OPEN
+C
+        IF(MULTFL.NE.' ')THEN
+           CLOSE(LMULT,DISP='DELETE')
+        ENDIF
+        IF(PLTFLG)THEN
+C
+C       BINARY FILE IS OPEN
+C
+            PEN = .FALSE.
+            CALL ZABMV
+            CALL BINFSH
+        ENDIF
+        RETURN
+        END
+#endif
diff --git a/ppl/plot/plotnm.F b/ppl/plot/plotnm.F
new file mode 100644
index 0000000..6ba61b6
--- /dev/null
+++ b/ppl/plot/plotnm.F
@@ -0,0 +1,62 @@
+	SUBROUTINE PLOT(X,Y,IPEN,IDUM)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)plotnm.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	PLOT WITH MARK REMOVED
+C
+#ifdef unix
+	INCLUDE 'PLTCOM.DAT'
+#else
+	include 'pltinc:pltcom.dat'
+#endif
+	IF(PMODE.EQ.ALPHA)PMODE=VECTOR
+	XTEMP=X*XSCALE
+	YTEMP=Y*YSCALE
+	PENF=.FALSE.
+	IF(IPEN.NE.0)PENF=.TRUE.
+	CALL XYZPLT
+	RETURN
+	END
diff --git a/ppl/plot/plotxy.F b/ppl/plot/plotxy.F
new file mode 100644
index 0000000..8dc0ca1
--- /dev/null
+++ b/ppl/plot/plotxy.F
@@ -0,0 +1,344 @@
+	SUBROUTINE PLOTXY(X,NXS,XF,YF,IPV)
+C** 
+C**    @(#)plotxy.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C  ARRAY X HOLDS X AND Y'S FOR ALL LINES.  DIMENSIONED FOR NXS.
+C  ORDER AS FOLLOWS:  ALL X'S FOR LINE1, ALL X'S FOR LINE2,...
+C                     STARTING AT X(NXS/2+1), ALL Y'S FOR LINE1,
+C                     ALL Y'S FOR LINE2...
+C  XF AND YF ARE FACTORS TO CONVERT TO INCHES FROM USER UNITS
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Modified *jd* J Davison JISAO/PMEL/TMAP 3.22.89
+*	To exclude Denbo line dashing in favor of GKS line bundles 
+*	Mod *jd* 8.3.92 to add interrupts 
+*	Mod *sh* 11/97 to add PLOTPOL command
+
+*  ACM  8-30-2000 Go back to calling the line dash subroutine.   
+*  ACM 10/2012    Modulo-ing for PLOT/VS longitudes overlaid on a map.
+*  ACM  2/2013    ticket 2141. Fix the modulo operation when the longitude
+*                 range is over 360.
+
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+	DIMENSION X(NXS)
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'gkscm2.cmn' ! jd 3.22.89
+        include 'gkspar.inc'	! sh 11/97
+        include 'shade_vars.cmn'	! sh 11/97
+        INCLUDE 'makedot.cmn'    ! 10/01 *acm*
+
+	REAL MAXVEL
+
+        REAL	xadd, xaddlast, datx, daty
+
+	INTEGER xpolybase, ypolybase, zpolybase, polysizemax, nl,
+     .		nvertex, fill_ndx
+
+	INTEGER GET_NDX
+
+* GKS initialization vars
+	integer		error,trans_no,cflag
+        integer         my_trans
+        data            my_trans/20/
+	real	 	w(4),v(4),ndc(4),uc(4)
+	real		xinv,yinv
+
+	logical		valid
+
+*************************************
+
+	nl = lnum
+
+	xadd = 0.
+	xadlast = 0.	
+C
+C  JTYPE IS DATA TYPE (0 FOR 2D, 1 FOR 1D)
+C
+	IF(IPV.NE.0 .AND.JTYPE.NE.1) RETURN
+
+
+1000	IBASE=0
+	IY=NXS/2
+	CS=COS(VANG*.01745329252)
+	SN=SIN(VANG*.01745329252)
+	ZT=YF/XF
+	ICNT=1
+	IF(M.GE.2.AND.IFLG(2).NE.0)ICNT=P(2)
+
+	IF(MAKEP.EQ.'PLOTUV')THEN
+	  IBASE=IY
+	  IBASE1=0
+	  IBASE2=LLENG(1)+IY
+	  DO 90 I=1,LNUM,2
+	    CALL VECTRS
+	    CALL COLOR(IPEN(I))
+	    DO 95 J=1,LLENG(I),ICNT
+	      IF(XLE.AND.X(IBASE+J).LE.CMXLE)GOTO 95
+	      IF(XEQ.AND.X(IBASE+J).EQ.CMXEQ)GOTO 95
+	      IF(XGE.AND.X(IBASE+J).GE.CMXGE)GOTO 95
+	      IF(YLE.AND.X(IBASE2+J).LE.CMYLE)GOTO 95
+	      IF(YEQ.AND.X(IBASE2+J).EQ.CMYEQ)GOTO 95
+	      IF(YGE.AND.X(IBASE2+J).GE.CMYGE)GOTO 95
+	      YT= YFCT(I)*X(IBASE2+J)*CS + XFCT(I)*X(IBASE+J)*SN
+	      XT= (XFCT(I)*X(IBASE+J)*CS - YFCT(I)*X(IBASE2+J)*SN)*ZT
+	      CALL PLOT(X(IBASE1+J)+XOFF(I),YOFF(I),0,0)
+	      CALL PLOT(X(IBASE1+J)+XOFF(I)+XT,YOFF(I)+YT,1,0)
+	      if (interrupted) goto 51 ! *jd* 8.3.92
+95	    CONTINUE
+	    IBASE=IBASE2+LLENG(I+1)
+	    IBASE1=IBASE1+LLENG(I+1)+LLENG(I)
+90	  IBASE2=IBASE+LLENG(I+2)
+	  GOTO 51
+	END IF
+
+******** LOOP OVER LINES STORED
+	DO 50 I=1,nl
+	  CALL MARKH(HMARK(I))
+	  CALL COLOR(IPEN(I))
+
+C     SET PLOT MODE
+	  IF(IPV.EQ.1)THEN
+C     DRAW VECTORS
+	    CALL VECTRS
+	    DO 80 J=1,LLENG(I),ICNT
+	      IF(XLE.AND.X(IBASE+J).LE.CMXLE)GOTO 80
+	      IF(XEQ.AND.X(IBASE+J).EQ.CMXEQ)GOTO 80
+	      IF(XGE.AND.X(IBASE+J).GE.CMXGE)GOTO 80
+	      IF(YLE.AND.X(IY+IBASE+J).LE.CMYLE)GOTO 80
+	      IF(YEQ.AND.X(IY+IBASE+J).EQ.CMYEQ)GOTO 80
+	      IF(YGE.AND.X(IY+IBASE+J).GE.CMYGE)GOTO 80
+	      YT= YFCT(I)*X(IY+IBASE+J)*CS + XFCT(I)*X(IBASE+J)*SN
+	      XT=(XFCT(I)*X(IBASE+J)*CS - YFCT(I)*X(IY+IBASE+J)*SN)*ZT
+	      CALL PLOT(FLOAT(J)+XOFF(I),YOFF(I),0,0)
+	      CALL PLOT(FLOAT(J)+XOFF(I)+XT,YOFF(I)+YT,1,0)
+80          CONTINUE
+
+	  ELSE IF(IPV.EQ.2) THEN
+	    IF( m .ge. 1 .and. iflg(1) .ne. 0)then
+	       if( p(1) .gt. 0 )then
+		   rlenfact = p(1) * abs(xf)
+	       else
+		   rlenfact = -p(1) * abs(yf)
+	       endif
+	    else
+	       rlenfact = min( abs(xf), abs(yf))
+	    endif
+	    jcnt = 1
+	    if( m .ge. 2 .and. iflg(2) .ne. 0)jcnt = p(2)
+	    IF ( i .GT. 1) GOTO 50
+	    ibaseu = 0
+	    ibasev = iy
+	    ibasex = lleng(1)
+	    ibasey = iy + lleng(1)
+	    CALL COLOR(IPEN(1))
+	    maxvel = 0.0
+	    DO 100 j = 1,lleng(1),jcnt
+	      dist=sqrt(x(ibasev+j)**2+x(ibaseu+j)**2)
+	      if(dist.gt.maxvel)maxvel=dist
+	      ytail = x(ibasey+j)
+	      yhead = ytail + rlenfact*x(ibasev+j)/yf
+	      xtail = x(ibasex+j)
+	      xhead = xtail + rlenfact*x(ibaseu+j)/xf
+	      CALL DRAWVEC(xtail,ytail,xhead,yhead,rlenfact,0,xf,yf)
+100	    CONTINUE
+	    CALL DRAWVEC(maxvel,ytail,xhead,yhead,rlenfact,1,xf,yf)
+
+* standard line or point plot
+	  ELSEIF (ipv .EQ. 0) THEN
+!ACM 	    IF(ITYPE(I).GE.4 .and. .not.gks_open)THEN ! JD 3.22.89
+	    IF(ITYPE(I).GE.4)THEN ! JD 3.22.89
+	      CALL DASHSZ(DN1(I),UP1(I),DN2(I),UP2(I))
+	      CALL DASHES
+	    ELSE
+	      CALL VECTRS
+	    END IF
+	    IF(ITYPE(I).EQ.3)THEN 
+               CALL POINTS
+               IF (imark(i) .eq. 99) ipt = 0
+            ENDIF
+	    IF(.NOT.(XLE.OR.XEQ.OR.XGE.OR.YLE.OR.YEQ.OR.YGE))THEN
+C     DO NOT CHECK POINTS FOR MISSING DATA
+	      CALL TRANS(I,X(IBASE+1),X(IY+IBASE+1),XT,YT)
+	      CALL PLOT(XT,YT,0,0)
+	      IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+	      IM=0
+	      IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	      DO 60 J=IBASE+1,IBASE+LLENG(I)
+	        CALL TRANS(I,X(J),X(IY+J),XT,YT)
+	        CALL PLOT(XT,YT,1,0)
+60            CALL MARK(IM)
+	    ELSE
+C     CHECK POINTS FOR OUT OF RANGE   (CM)
+	      DO 70 J=IBASE+1,IBASE+LLENG(I)
+* ... locate first point
+		IF(XLE.AND.X(J).LE.CMXLE)GOTO 70
+		IF(XEQ.AND.X(J).EQ.CMXEQ)GOTO 70
+		IF(XGE.AND.X(J).GE.CMXGE)GOTO 70
+		IF(YLE.AND.X(IY+J).LE.CMYLE)GOTO 70
+		IF(YEQ.AND.X(IY+J).EQ.CMYEQ)GOTO 70
+		IF(YGE.AND.X(IY+J).GE.CMYGE)GOTO 70
+
+		datx = X(J)
+	        daty = X(IY+J)
+		IF (MOD_VS_X .AND. datx .LT. xlo) THEN
+		   xadd = 360.
+		   datx = datx + xadd
+		ELSE IF (MOD_VS_X .AND. datx .GT. xhi) THEN
+		   xadd = -360.
+		   datx = datx + xadd
+		ENDIF
+		xaddlast = xadd
+
+	        CALL TRANS(I,datx,daty,XT,YT)
+	        CALL PLOT(XT,YT,0,0)
+	        IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+ 	        IM=0
+	        IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	        GOTO 71
+70	      CONTINUE
+71	      IDN=1
+* ... plot remaining points
+	      DO 72 K=J+1,IBASE+LLENG(I)
+		IF((XLE.AND.X(K).LE.CMXLE).OR.
+     *		   (XEQ.AND.X(K).EQ.CMXEQ).OR.
+     *		   (XGE.AND.X(K).GE.CMXGE).OR.
+     *		 (YLE.AND.X(IY+K).LE.CMYLE).OR.
+     *		 (YEQ.AND.X(IY+K).EQ.CMYEQ).OR.
+     *		 (YGE.AND.X(IY+K).GE.CMYGE))THEN
+	          IDN=0
+	        ELSE
+
+	          IF (MOD_VS_X) THEN
+	          datx = X(K)
+	          daty = X(IY+K)
+
+		  IF (MOD_VS_X .AND. datx .LT. xlo) THEN 
+		     xadd = 360.
+		     datx = datx + xadd
+
+		  ELSE IF (MOD_VS_X .AND. datx .GT. xhi) THEN  
+		     xadd = -360.
+		     datx = datx + xadd
+
+		  ELSE
+		     xadd = 0.
+
+		  ENDIF
+
+* New modulo wrap: Plot to next point on the last wrap, then pick up the pen, go to 
+* the new point on new wrap, then go on.
+		  IF (xadd .NE. xaddlast) THEN
+		     datxlast = datx - xadd + xaddlast
+		     CALL TRANS(I,datxlast,daty,XT,YT)
+		     CALL PLOT(xt,yt,idn,0)
+		     CALL TRANS(I,datx,daty,XT,YT)
+		     CALL PLOT(XT,YT,0,0)
+		     CALL PLOT(XT,YT,IDN,0)
+		  ENDIF
+
+		  CALL TRANS(I,datx,daty,XT,YT)
+		  xaddlast = xadd
+	
+	          ELSE
+		     CALL TRANS(I,X(K),X(IY+K),XT,YT)
+		  ENDIF  ! mod_vs_x
+
+		  CALL PLOT(XT,YT,IDN,0)
+
+		  if (interrupted) goto 51 ! *jd* 8.3.92
+	          CALL MARK(IM)
+	          IF(IDN.EQ.0)THEN
+	            IDN=1
+	          END IF
+	        END IF
+72	      CONTINUE
+	    END IF
+	    IF(ITYPE(I).EQ.2.OR.ITYPE(I).EQ.5)CALL MARK(IMARK(I))
+
+	  END IF
+
+          IF (imark(i) .eq. 99) THEN
+             CALL doit_makedot(IPT,XDOT,YDOT)
+             IPT = 0
+          ENDIF
+	if (interrupted) go to 51 !*jd* 8.3.92
+50	IBASE=IBASE+LLENG(I)
+
+******** END OF LOOP OVER LINES STORED
+
+*** FINALIZE
+ 51	CONTINUE
+        IF (imark(i) .eq. 99) THEN
+          CALL doit_makedot(IPT,XDOT,YDOT)
+          IPT = 0
+        ENDIF
+
+        CALL COLOR(IPEN(0))
+	RETURN
+
+	END
diff --git a/ppl/plot/plotxy_ribbon.F b/ppl/plot/plotxy_ribbon.F
new file mode 100644
index 0000000..a346347
--- /dev/null
+++ b/ppl/plot/plotxy_ribbon.F
@@ -0,0 +1,411 @@
+	SUBROUTINE PLOTXY_RIBBON(X,NXS,XF,YF)
+C** 
+C**    @(#)plotxy.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C  ARRAY X HOLDS X AND Y'S FOR ALL LINES.  DIMENSIONED FOR NXS.
+C  ORDER AS FOLLOWS:  ALL X'S FOR LINE1, ALL X'S FOR LINE2,...
+C                     STARTING AT X(NXS/2+1), ALL Y'S FOR LINE1,
+C                     ALL Y'S FOR LINE2...
+C  XF AND YF ARE FACTORS TO CONVERT TO INCHES FROM USER UNITS
+C  
+C  Ribbon Plots: lines colored by a variable along the line.
+C  8/2012 ACM
+C  For a ribbon plot, x's are at the start, Y1 are the Y values, and
+C  Y2 are values by which to color the lines.
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+
+*  ACM 10/2012    Modulo-ing for PLOT/VS longitudes overlaid on a map.
+* 1/2013  *acm* Fix ticket 2029, call to WS_LINE_SPECTRUM was missing an 
+*               argument for setting up metafile plots.
+*  ACM  2/2013    ticket 2141. Fix the modulo operation when the longitude
+*                 range is over 360.
+
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+	INTEGER NXS
+	REAL X(*), XS, YS
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+	include 'gkscm1_inc.decl'   
+	include 'GKSCM1.INC'
+        include 'gkscm2.cmn'
+        include 'gkspar.inc'
+        include 'shade_vars.cmn'
+        include 'makedot.cmn'
+	include 'cont_inc.decl'
+	include 'CONT.INC'
+
+	REAL datum, xlast, ylast, frac, dx, dy, xi, yi, xhalf, yhalf
+	INTEGER xpolybase, ypolybase, zpolybase, polysizemax, nl,
+     .		nvertex, low_index, colr_ndx, last_colr_ndx, 
+     .		line_ndx, thick_offset, nseg, iseg, indx, inc
+	INTEGER GET_NDX, ibase, iline2
+
+	logical	isbad, last_bad, bad_blank, new_branch
+
+        real            xadd, xaddlast, datx, daty, datxlast,datylast
+        integer         ndx,type
+
+
+* GKS initialization vars
+	integer		error,trans_no,cflag
+        integer         my_trans
+        data            my_trans/20/
+	real	 	w(4),v(4),ndc(4),uc(4)
+	real		xinv,yinv
+
+*************************************
+
+	nl = lnum
+
+	xadd = 0.
+	xadlast = 0.
+	new_branch = .FALSE.
+C
+C  JTYPE IS DATA TYPE (0 FOR 2D, 1 FOR 1D)
+C
+	IF(JTYPE.NE.1) RETURN
+	I = 1
+
+	IBASE=0
+	IY=NXS/2
+	CS=COS(VANG*.01745329252)
+	SN=SIN(VANG*.01745329252)
+	ZT=YF/XF
+	ICNT=1
+	IF(M.GE.2.AND.IFLG(2).NE.0)ICNT=P(2)
+
+* Line 2 contains the variable on which to color. ZMAX and ZMIN are its 
+* range.  Set levels and set up color line bundles.
+
+C  Set the contour/color levels
+
+	CALL SET_LEVELS_SHADE_FILL (status)
+	shd_levels = MAX (nlev2-1,1)  ! as in shade_sub
+	
+* DETERMINE COLORS TO SET BUNDLED LINE REPRESENTATIONS
+	CALL WS_LINE_SPECTRUM (wsid,wstype, low_index)
+
+* For plotting missing values of the color-by variable.
+* Code -1 is for the default, thin black line (or gray? Set in ws_line_spectrum)
+* Code -2 is to lift the pen and make the segment blank.
+* If a palette, then use the first color. This was set up in ws_line_spectrum.
+
+	bad_blank = .FALSE.
+	IF (ribbon_miss(1) .EQ. -2) THEN 
+	   bad_blank = .TRUE.
+	ENDIF
+
+        ILINE2=IBASE+LLENG(I)
+
+	  CALL MARKH(HMARK(I))
+
+* IPEN contains the thickness setting.
+
+	  thick_offset = 0
+	  IF (ipen(i) .EQ. 2) thick_offset = (shd_levels+1) 
+	  IF (ipen(i) .EQ. 3) thick_offset = 2*(shd_levels+1) 
+
+C     SET PLOT MODE
+
+* standard line or point plot
+
+	    IF(ITYPE(I).GE.4)THEN ! JD 3.22.89
+	      CALL DASHSZ(DN1(I),UP1(I),DN2(I),UP2(I))
+	      CALL DASHES
+	    ELSE
+	      CALL VECTRS
+	    END IF
+	    IF(ITYPE(I).EQ.3)THEN 
+               CALL POINTS
+               IF (imark(i) .eq. 99) ipt = 0
+            ENDIF
+	    IF(.NOT.(XLE.OR.XEQ.OR.XGE.OR.YLE.OR.YEQ.OR.YGE))THEN
+C     DO NOT CHECK POINTS FOR MISSING DATA
+	      CALL TRANS(I,X(IBASE+1),X(IY+IBASE+1),XT,YT)
+	      CALL PLOT(XT,YT,0,0)
+	      IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+	      IM=0
+	      IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	      DO 60 J=IBASE+1,IBASE+LLENG(I)
+	        CALL TRANS(I,X(J),X(IY+J),XT,YT)
+	        CALL PLOT(XT,YT,1,0)
+60            CALL MARK(IM)
+	    ELSE
+C     CHECK POINTS FOR OUT OF RANGE   (CM)
+	      DO 70 J=IBASE+1,IBASE+LLENG(I)
+* ... locate first point
+		IF(XLE.AND.X(J).LE.CMXLE)GOTO 70
+		IF(XEQ.AND.X(J).EQ.CMXEQ)GOTO 70
+		IF(XGE.AND.X(J).GE.CMXGE)GOTO 70
+		IF(YLE.AND.X(IY+J).LE.CMYLE)GOTO 70
+		IF(YEQ.AND.X(IY+J).EQ.CMYEQ)GOTO 70
+		IF(YGE.AND.X(IY+J).GE.CMYGE)GOTO 70
+		
+		last_bad = .FALSE.
+	        colr_ndx = GET_NDX (X(IY+J+ILINE2),colr_ndx)
+
+	        line_ndx = colr_ndx + thick_offset + low_index - 1
+	        IF (colr_ndx .EQ. -999) THEN 
+		   colr_ndx = bad_ribbon_ndx
+		   line_ndx = colr_ndx + low_index - 1
+		   last_bad = .TRUE.
+		ENDIF
+
+		CALL COLOR (line_ndx) 
+		last_colr_ndx = colr_ndx
+	
+	        datx = X(J)
+	        daty = X(IY+J)
+		IF (MOD_VS_X .AND. datx .LT. xlo) THEN
+		   xadd = 360.
+		   datx = datx + xadd
+		ELSE IF (MOD_VS_X .AND. datx .GT. xhi) THEN
+		   xadd = -360.
+		   datx = datx + xadd
+		ENDIF
+		xaddlast = xadd
+
+	        CALL TRANS(I,datx,daty,XT,YT)
+	        CALL PLOT(XT,YT,0,0)
+		xlast = xt
+		ylast = yt
+		isbad = .FALSE.
+	        IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+ 	        IM=0
+	        IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	        GOTO 71
+70	      CONTINUE
+71	      IDN=1
+	      IF (last_bad .AND. bad_blank) IDN = 0
+* ... plot remaining points
+	      DO 72 K=J+1,IBASE+LLENG(I)
+		IF((XLE.AND.X(K).LE.CMXLE).OR.
+     *		   (XEQ.AND.X(K).EQ.CMXEQ).OR.
+     *		   (XGE.AND.X(K).GE.CMXGE).OR.
+     *		 (YLE.AND.X(IY+K).LE.CMYLE).OR.
+     *		 (YEQ.AND.X(IY+K).EQ.CMYEQ).OR.
+     *		 (YGE.AND.X(IY+K).GE.CMYGE))THEN
+	          IDN=0
+	        ELSE
+		
+	        CALL PLOT(XT,YT,IDN,0)
+
+		
+	          datx = X(K)
+	          daty = X(IY+K)
+
+
+
+		  IF (MOD_VS_X .AND. datx .LT. xlo) THEN 
+		     xadd = 360.
+		     datx = datx + xadd
+
+		  ELSE IF (MOD_VS_X .AND. datx .GT. xhi) THEN  
+		     xadd = -360.
+		     datx = datx + xadd
+
+		  ELSE
+		     xadd = 0.
+
+		  ENDIF
+
+		  IF (xadd .NE. xaddlast) THEN
+		     datxlast = datx - xadd + xaddlast
+		     CALL TRANS(I,datxlast,daty,XT,YT)
+		     CALL PLOT(xt,yt,idn,0)
+		     CALL TRANS(I,datx,daty,XT,YT)
+		     CALL PLOT(XT,YT,0,0)
+		     CALL PLOT(XT,YT,IDN,0)
+		     new_branch = .TRUE.
+		  ENDIF
+
+	          CALL TRANS(I,datx,daty,XT,YT)
+		  xaddlast = xadd
+
+		  xhalf = xlast + (xt - xlast)/2
+		  yhalf = ylast + (yt - ylast)/2
+
+		  IF (RIBBON_FAST .OR. last_bad .AND.(.NOT.new_branch)) THEN 
+! go halfway between the last point and this one, using previous color.
+                     IF (last_bad .AND. bad_blank) THEN 
+		        CALL PLOT(xhalf,yhalf,0,0)
+		     ELSE
+		        CALL PLOT(xhalf,yhalf,IDN,0)
+		     ENDIF
+		  ENDIF
+
+		  datum = X(IY+K+ILINE2)
+		  IF (datum .EQ. -3.E33) datum = CMZGE  ! This value set in pplldx.
+		  
+	          colr_ndx = GET_NDX (datum,colr_ndx)
+	          line_ndx = colr_ndx + thick_offset + low_index - 1
+
+	          IF (colr_ndx .EQ. -999 .AND.(.NOT.new_branch)) THEN
+		     isbad = .true.
+		     colr_ndx = bad_ribbon_ndx
+		     line_ndx = colr_ndx + low_index - 1
+
+		     IF (bad_blank .AND. .NOT.last_bad) CALL PLOT(xhalf,yhalf,IDN,0)
+		     IF (bad_blank) IDN = 0
+		  ENDIF
+		  
+	          IF (line_ndx .LT. 1) line_ndx = 1
+
+	          IF (colr_ndx .NE. last_colr_ndx) THEN
+		     
+* In default (not fast) mode, draw sub-segments filling in all the colors
+* corresponding to the index range between the color at this point and the
+* color at the previous point.
+
+		     IF (.NOT.RIBBON_FAST .AND. 
+     .                    .NOT.isbad .AND. .NOT.last_bad .AND.
+     .                    ABS(colr_ndx-last_colr_ndx) .GT. 1 .AND.
+     .                    (.NOT.new_branch)) THEN
+		        nseg = ABS(colr_ndx-last_colr_ndx) 
+		        frac = 1./FLOAT(nseg)
+		        dx = (xt-xlast)
+		        dx = (xt-xlast)* frac
+		        dy = (yt-ylast)
+		        dy = (yt-ylast)* frac
+		        indx = 1
+		        inc = 1
+		        IF (last_colr_ndx .GT. colr_ndx) inc = -1
+		        DO 80 iseg = last_colr_ndx+inc, colr_ndx, inc
+			   xi = xlast + dx*indx
+			   yi = ylast + dy*indx
+	                   line_ndx = iseg + thick_offset + low_index - 1
+		           IF (line_ndx .LT. 1) line_ndx = 1
+	                   CALL PLOT(xi,yi,IDN,0)
+	                   CALL COLOR (line_ndx) 
+	                   CALL PLOT(xi,yi,IDN,0)
+			   indx = indx + 1
+80	                CONTINUE
+			XT = xi  ! should already be??
+			YT = yi
+                     ELSEIF (.NOT.new_branch) THEN
+	                CALL PLOT(xhalf,yhalf,IDN,0)
+			CALL COLOR (line_ndx)
+	                CALL PLOT(xhalf,yhalf,IDN,0)
+	                CALL PLOT(XT,YT,IDN,0)
+		     ENDIF
+		  ENDIF
+
+	          CALL PLOT(XT,YT,IDN,0)
+
+	          IF (last_colr_ndx .EQ. bad_ribbon_ndx .AND. 
+     .		       colr_ndx .NE. bad_ribbon_ndx) THEN
+                     CALL COLOR (line_ndx) 
+		  ENDIF
+
+		  last_colr_ndx = colr_ndx
+		  last_bad = .FALSE.
+		  IF (isbad) last_bad = .TRUE.
+		  isbad = .FALSE.
+	  	  xlast = xt
+		  ylast = yt
+		  datxlast = datx
+		  datylast = daty
+
+		  if (interrupted) goto 51 ! *jd* 8.3.92
+		  IF (bad_blank .AND. colr_ndx.EQ.bad_ribbon_ndx) THEN
+		     nothing = 0
+		  ELSE
+	             CALL MARK(IM)
+	          ENDIF
+		  CALL PLOT(XT,YT,IDN,0) 
+
+	          IF(IDN.EQ.0)IDN=1
+		  new_branch = .FALSE.
+	        END IF
+72	      CONTINUE
+	    END IF
+	    IF(ITYPE(I).EQ.2.OR.ITYPE(I).EQ.5)CALL MARK(IMARK(I))
+
+          IF (imark(i) .eq. 99) THEN
+             CALL doit_makedot(IPT,XDOT,YDOT)
+             IPT = 0
+          ENDIF
+	if (interrupted) go to 51 !*jd* 8.3.92
+
+
+*** FINALIZE
+ 51	CONTINUE
+        IF (imark(i) .eq. 99) THEN
+          CALL doit_makedot(IPT,XDOT,YDOT)
+          IPT = 0
+        ENDIF
+
+        CALL COLOR(1)
+*       DO THE KEY
+        IF (do_key .AND. .NOT.interrupted) CALL key     ! 1/89 - *sh*
+        CALL shade_key_cont(0)
+
+	RETURN
+
+	END
+
+
+
diff --git a/ppl/plot/plotz.F b/ppl/plot/plotz.F
new file mode 100644
index 0000000..f9bfe9c
--- /dev/null
+++ b/ppl/plot/plotz.F
@@ -0,0 +1,377 @@
+	SUBROUTINE PLOTZ(Z,XF,YF,XLPLOT,YLPLOT,XHPLOT,YHPLOT)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C**     
+C**     @(#)plotz.F	1.4    9/9/88
+C**     
+C**     
+C***********************************************************************
+C**     
+C**     PLOT+ Scientific Graphics System
+C**     
+C***********************************************************************
+C**     
+C**     
+C       lots of places ---> PPLMOD_PPLCMD ---> PPLMOD_PLTIT ---> PPLMOD_PLOTZ
+C       
+C       This subroutine is called for CONTOUR, SHADE and FILL plots
+C       and puts the data on the proper grid and then plots it.
+C 
+C       Z      - actual 2D data array
+C       XF     - X factor ( page? length / X range )
+C       YF     - Y factor
+C       XLPLOT - lower X page? coordinate
+C       YLPLOT - lower Y page? coordinate
+C       XHPLOT - upper X page? coordinate
+C       YHPLOT - upper Y page? coordinate
+C       
+*       MOD *JD* to include AREA in TMAP PPL+
+*       MOD *JD* moved dimension z(nx,ny) from below subroutine statement to
+*       below includes so that CONTOUR will work on the MAC -- Ed Flinchem
+*       had to do this to make that work. 3.29.93 DIMENSION --> REAL as well.
+*       MOD *JD* To permit use of centered levels and specify the delta Z
+*       value as well.  Added variables to CONT.INC common 8.3.95  
+*	*jd* 8.28 fix bug in dz specification
+*	*jd* 2.96 Change centered option so that data not spanning zero
+*       is centered as well.
+*       *jc* 4.97 Major clean up and commenting
+*       *jc* 5.97 Added code for curvilinear coordinates
+* V510 4/00 *sh - corrected faulty logic for centered levels (delta wrong)
+* V540 10/01 *acm Set LWGT, LDIG when using previously defined levels; have 
+*                 not been set if previous call was SHADE
+* V540 10/01 *acm remove VMS include statements
+* V540 12/01 *acm* do NOT set LWGT, LDIG here; set them in SHADE
+* V541  5/02 *acm* Check that number levels not greater than size of 
+*                  LWGT, LDIG, and ZLEV; issue an error message.
+* V550 11/02 *acm* For fine grids, XLPLOT, XHPLOT, YLPLOT, YHPLOT computations
+*                  need to be done in double precision.
+* V550 11/02 *acm* New call to create LEVELS symbols, routine setlab_syms
+* V554  9/03 *acm* Fix precision bug double precision, for fine grids in 
+*                  curvlinear coordinates. See also pltit.F, setax.F
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* V581 *acm* 7/05 fix bug 1279: fill/lev=(n) gave exactly N not nlev2=approx N
+* V600 *acm* 1/06 prevent values of LOG10(0.0)
+* V602 *acm* 2/07 check status coming out of CONSEG; part of fix to bug 1485
+* V603 *acm* 5/07 Compute sig figs for labels along contours, and dash characteristics
+*                 even when re-using previous levels. Those levels may have come from
+*                 a previous SHADE plot as in SHADE/LINE and therefore the levels were
+*                 set but not the contour label and line characteristics.
+* V603 *acm* 7/07 Fix bug 1335, zero contours not dark. zlev(i) not seen as 0. Fix by 
+*                 using TM_FPEQ to compare zlev(i) to 0., within machine accuracy.
+* V604 *acm& 7/07 Fix bug 1519. The setting of levels info was incorrectly resetting the
+*                 highest and lowest level when doing (-inf) and (inf) levels spec.
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'ZGRIDD.INC'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'AXIS.INC'
+	include	'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'PEN.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'PLTL.INC'
+	include 'xcurvilinear.cmn'
+        INCLUDE 'errmsg.parm'
+
+* Argument declarations
+**	DIMENSION Z(NX,NY)
+	REAL	  Z(NX,NY)
+        REAL      XF,YF
+        REAL*8    XLPLOT,YLPLOT,XHPLOT,YHPLOT
+
+* Local declarations
+        INTEGER   status, slen1, slen2, nlev1
+        CHARACTER TM_FMT_SNGL*20, buff1*20, buff2*20, err_msg*40
+        REAL*8    DXFF, DXOF, DYFF, DYOF
+        REAL      XFF, XOF, YFF, YOF, DMIN, DMAX, DZMAX
+        LOGICAL   TM_FPEQ_SNGL
+
+	logical		valid
+
+C*       *jd* Linux port 12.96 add EXTERNAL calls below
+        external scale, range
+
+C	VAX/VMS
+C
+	DIMENSION IZMRKD(3)
+	DATA IZMRKD/12,16,3/
+
+C
+C  Set the contour/color levels
+
+        CALL SET_LEVELS_SHADE_FILL (status)
+	IF (status .NE. ferr_ok) GOTO 5000
+
+
+C       DRAW CONTOUR
+C
+C       from ppl/include/PPL.INC:
+C
+C       JTYPE: = 2 2-d irregular rectangular grid
+C              = 1 1-d set
+C              = 0 2-d regular rectangular grid (integer)
+C              =-1 2-d second component of a vector regular grid
+C              =-2 2-d second component of a vector irregular grid
+C
+C
+C       from ppl/include/ZGRID.INC:
+C
+C       controls for the plotting of the positions of ungridded x,y,z data
+C
+C       IZTYP: =0 no points drawn
+C              =1 points drawn along the x axis
+C              =2 points drawn along the y axis
+C              =3 points drawn at each raw input value
+C       
+C       IZMRK: =0 use the default mark
+C              =n use mark n to denote the location
+C
+C       IZLEN: number of points in the x,y,z triplets
+
+C
+C       If it's a 2-d irregular grid plot and points have been drawn
+C
+	if (abs(jtype).eq.2 .and. iztyp.ne.0) then
+
+	   call markh(hmark(1))
+
+	   if (izmrk.eq.0) then
+	      imrk=izmrkd(iztyp)
+	   else
+	      imrk=izmrk
+	   endif
+
+	   if (iztyp.eq.1) then
+
+	      do 200 i=1,nx
+		 call trans(0,z(i,ny+1),ylo,xt,y)
+		 call plot(xt,y,0,imrk)
+		 call mark(imrk)
+ 200	      continue
+
+	   else if (iztyp.eq.2) then
+
+	      do 210 j=1,ny
+		 call trans(0,xlo,z(j,ny+2),x,yt)
+		 call plot(x,yt,0,imrk)
+		 call mark(imrk)
+ 210	      continue
+
+	   else
+
+	      do 230 i=1,nx
+		 do 220 j=1,ny
+		    call trans(0,z(i,ny+1),z(j,ny+2),xt,yt)
+		    call plot(xt,yt,0,imrk)
+		    call mark(imrk)
+ 220		 continue
+ 230	      continue
+
+	   endif
+
+	endif
+
+C
+C       If there are some x,y,z triplets and points have been drawn
+C
+	IF (IZLEN.NE.0.AND.IZTYP.NE.0) THEN
+
+	   CALL MARKH(HMARK(1))
+
+	   IF (IZMRK.EQ.0) THEN
+	      IMRK=IZMRKD(IZTYP)
+	   ELSE
+	      IMRK=IZMRK
+	   ENDIF
+
+	   IF (IZTYP.EQ.1) THEN
+
+	      call trans(0,xx(1),ylo,xt,y)
+	      CALL PLOT(XT,Y,0,IMRK)
+	      CALL MARK(IMRK)
+	      DO 300 I=2,IZLEN
+		 IF (XT.NE.XX(I)) THEN
+		    call trans(0,xx(i),ylo,xt,y)
+		    CALL PLOT(xt,Y,0,IMRK)
+		    CALL MARK(IMRK)
+		 ENDIF
+ 300	      CONTINUE
+
+	   ELSE IF (IZTYP.EQ.2) THEN
+
+	      call trans(0,xlo,yy(1),x,yt)
+	      CALL PLOT(X,YT,0,IMRK)
+	      CALL MARK(IMRK)
+	      DO 310 I=2,IZLEN
+		 IF (YT.NE.YY(I)) THEN
+		    call trans(0,xlo,yy(i),x,yt)
+		    CALL PLOT(X,yt,0,IMRK)
+		    CALL MARK(IMRK)
+		 ENDIF
+ 310	      CONTINUE
+
+	   ELSE
+
+	      DO 320 I=1,IZLEN
+		 call trans(0,xx(i),yy(i),xt,yt)
+		 CALL PLOT(xt,yt,0,IMRK)
+		 CALL MARK(IMRK)
+ 320	      CONTINUE
+
+	   ENDIF
+
+	ENDIF
+
+	CALL SCALE(1.,1.,XORG,YORG,0.,0.)
+	IF (IWIND.NE.0) CALL WINDOW(0.0,0.0,XLEN,YLEN)
+	CALL COLOR(IPEN(1))
+
+
+C       Calculate the following quantities:
+C       ~FF - multiplication factors to go from axis to page coords?
+C       ~OF - page offset to the beginning of an axis?
+
+	call trans(0,xmin,ymin,xtm,ytm)
+	call trans(0,xmax,ymax,xtx,ytx)
+	DXFF = (XHPLOT - XLPLOT)/(xtx-xtm)
+	IF (TM_FPEQ_SNGL(xtx, xtm)) DXFF = 1.
+	DXOF = (XLPLOT) - DXFF*xtm
+	DYFF = (YHPLOT - YLPLOT)/(ytx-ytm)
+	IF (TM_FPEQ_SNGL(xtx, xtm)) DXFF = 1.
+	DYOF = (YLPLOT) - DYFF*ytm
+
+	XFF = DXFF
+	XOF = DXOF
+	YFF = DYFF
+	YOF = DYOF
+
+
+C       If this is a 2-D plot on an irregular grid, use TRANS() to 
+C       scale the points appropriately.  Values are returned in 
+C       the xx() and yy() arrays.
+C
+	IF (abs(jtype).eq.2) THEN
+       
+	   do 400 i=1,nx
+	      call trans(0,z(i,ny+1),ymin,xx(izlen+i),yt)
+ 400	   continue
+	   do 410 j=1,ny
+	      call trans(0,xmin,z(j,ny+2),xt,yy(izlen+j))
+ 410	   continue
+
+
+C       For all other plot types fill in XX() and YY() by
+C       multiplying the index value by the DX or DY delta values.
+
+	ELSE
+
+	   DX = (xtx - xtm)/(NX - 1)
+	   DY = (ytx - ytm)/(NY - 1)
+	   IF (NX .EQ. 1) DX = 1.
+	   IF (NY .EQ. 1) DY = 1.
+
+	   DO 500 I=1,NX
+	      XX(IZLEN+I)=DX*(I-1)+xtm
+ 500	   CONTINUE
+	   DO 510 J=1,NY
+	      YY(IZLEN+J)=DY*(J-1)+ytm
+ 510	   CONTINUE
+
+! TEST - fix XX if this is a subspan-modulo axis.
+           IF ( .NOT. curvilinear ) THEN
+              CALL box_centers ('X',xx(IZLEN+1),nx,xx(NX+IZLEN+1),valid)
+	      DO i = 1, nx
+	         xx(izlen+i) = xx(nx+izlen+i)
+	      ENDDO
+
+              CALL box_centers ('Y',yy(IZLEN+1),ny,yy(Ny+IZLEN+1),valid)
+	      DO j = 1, ny
+	         yy(izlen+j) = yy(ny+izlen+j)
+	      ENDDO
+	   ENDIF
+
+	ENDIF
+
+* Now that the levels are set, create the LEVELS symbols
+
+        CALL setlab_syms (ZLEV, MAX(NLEV2,1) )
+
+	 if (makep.eq.'CONTOUR') then
+c *kob* 8/97 had to move the continuation marker to col 5 - it was in col 8
+c       this bombed aix compiler, though it seems to work on others
+	    CALL CONSEG(Z,NX,NY,XX(IZLEN+1),YY(IZLEN+1),NX,NY,
+     1	 XFF,XOF,YFF,YOF,ZLEV,LDIG,LWGT,LCLR,NLEV2,HGT,
+     2	 NARC,CANGLE,status)
+             IF (status .NE. ferr_ok) GOTO 5002
+
+	 else if (makep.eq.'FILL') then
+            nlev1 = nlev
+            nlev = nlev2
+	    call arfill(z,xx(izlen+1),yy(izlen+1),nx,ny)
+            nlev = nlev1
+
+	 else
+*******     SQRFILL NOT A TMAP PPL+ COMMAND *jd* 2.19.99
+*******	    call sqrfill(z,xx(izlen+1),yy(izlen+1),nx,ny,
+*******     1	 zlev,nlev2)
+
+	 endif
+
+C
+C	END VAX/VMS
+C
+	CALL COLOR(IPEN(0))
+	CALL SCALE(XF,YF,XORG,YORG,XLO,YLO)
+
+	RETURN
+
+C  Error exit when too many levels specified.
+C  Arrays LWGT, LDIG, and ZLEV are length ICNLEV=500
+
+ 5000   ii = ICNLEV
+        buff1 = TM_FMT_SNGL (REAL(ICNLEV), 20, 20, slen1)
+        buff2 = TM_FMT_SNGL (REAL(NLEV2), 20, 20, slen2)
+        err_msg = '# of contour levels > '// buff1(1:slen1) //
+     .          '  (' // buff2(1:slen2) // ')'
+        CALL errmsg (ferr_out_of_range, status, err_msg, *5002)
+
+ 5002   return
+
+	END
diff --git a/ppl/plot/pltit.F b/ppl/plot/pltit.F
new file mode 100644
index 0000000..27af2e7
--- /dev/null
+++ b/ppl/plot/pltit.F
@@ -0,0 +1,508 @@
+ 	SUBROUTINE PLTIT(X,NXS)
+*   
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written per/x=178.5:179.5 uwndion is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.LIBRARY.PLOT]
+*	PLTIT.FOR;34              6  25-AUG-1987 15:23
+
+* search for "TMAP" to find all revisions
+* *sh* 6/30/88 - rev 1.0 - for FERRET 1.00+
+*	- added calls to SEG_ON and SEG_OFF to imbed graphics in a segment
+*	- this permits resizing of windows
+* *jd* 9.7.88  - rev 2.0  
+*	- Modified to call SHADE
+* *jd* 11.28.88
+*	- Modified to be compatible with version 1.1 PPL
+* *sh*  - added interrupt detection and "in FERRET" detection
+* *jd*  - added call to ALINE_SUB 10.17.89  (interrupts: 12.7.89)
+* *jd*	- mod to handle metafiles 11.6.89
+* *jd*	- mod to handle Ferret viewports 12.1.89
+* *sh*  - mod to permit cancelling of all GKS output windows from Ferret
+* *jd*  - mod to handle CLSPLT with metafiles
+* *jd*  - mod to include AREA 1.14.92
+* *jd*  - mod to add interrupts to PLOT calls
+* *jd*  - mod to protect colors used already in shade plots 10.01.92
+* *jd*  - mod to add PPLP version number in metafile
+* *jd*  - mod to eliminate version number in xgks version
+* *jd*  - mod to fix bug with WS not open error 11.4.93
+* *jd*  - mod to fix bug in FILL, borders being overwritten and not redrawn,
+*	  with call to daxis_box 8.18.95 - also use with SHADE
+* *jd*	- mod to put back use of daxis as cross and interior tics are
+*	  lost without it.
+* *sh*  - added commands PLOTPOL and FILLPOL
+* *jd*	- put in daxis after FILLPOL
+* *acm*	- 10/2000 add VECTOR/FLOWLINE, alias FLOWLINE
+* *acm* - 12/2001 send third argument to FLOWLINE, work array for the
+*         flag grid, now allocated in disp_set_up.F
+* *acm* - 10/02 After FILL plot (plotz) call WINDOW to restore values of
+*         XMIN, XMAX, YMIN, YMAX. Else DAXIS plot calls are not in range.
+* *acm* - 10/02 bug fix: start index of X as the third argument to FLOWLINE
+*         was icorrect for irregular-grid case (JTYPE .ne. -1) See PPLLDC.
+* *acm*   V550 11/02 For fine grids, XLPLOT, XHPLOT, YLPLOT, YHPLOT 
+*         computations need to be done in double precision.
+* *acm*   V550 12/02 For lines which are plotted with symbols, plot a 
+*            key having 3 points.
+* *acm*   v552  3/03 add word POLYGON so can say PPL FILLPOL, or PPL POLY
+ 
+* V554  9/03 *acm* Compute XLPLOT etc in double precision: for fine
+*                  grids in curvlinear coordinates; xtm, xtx are axis indices
+*                  (like 4000) and xhi, xlo are in the final curvilinear 
+*                  coordinates (like 0.0218) so adding xtm+xlo as R*4 loses 
+*                  the precision in xtm. See also plotz.F, setax.F
+* V602  1/07 *acm* true batch mode for metafiles; flag meta_batch
+*                  distinguises this case from other batch modes.
+* V6.11 4/08 *acm* Fixes for bug 1571
+* *acm* 5/09 *acm* Fixes for bug 1663. When redrawing axes after a POLY/OVERLAY
+*                  do not do any axis labels
+* V6.5  3/10 *acm* When re-plotting axes, do not redraw the main label.
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+* PyFr  11/11 *kms* added call to consider updating the drawing when done
+*
+*****************************************************
+
+* local variable declarations for PLTIT (for TMAP)
+	REAL	DIFF, x, xf, yf, xl, yl, xh, yh, xti, xtl, thi
+	REAL*8	XLPLOT,YLPLOT,XHPLOT,YHPLOT
+	REAL	xtm,ytm,xtx,ytx,minx,maxx,miny,maxy
+	INTEGER nxs, nmx, nmy, ivloc, ip1, ip2, ip3, ip4, a_line,
+     .          LABELX_save, LABELY_save, LABELT_save, MAINLAB
+
+* TMAP include files with explicit type declarations:
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+
+	DIMENSION X(NXS) ! Was VIRTUAL, changed for linux *jd*
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written per/x=178.5:179.5 uwndion is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+** V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	include 'plt_inc.decl'
+	include 'PLT.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'cmrd_inc.decl'
+	include 'CMRD.INC'
+	include 'prmcom_inc.decl'
+	include 'PRMCOM.INC'
+	include 'switch_inc.decl'
+	include 'SWITCH.INC'
+	include 'system_inc.decl'
+	include 'SYSTEM.INC'
+	include 'cont_inc.decl'  !added to get ivcomp v1.1
+	include 'CONT.INC'  !added to get ivcomp v1.1
+	include 'xinterrupt.cmn'	! 1/89 *sh* - interrupts
+	include 'labels_inc.decl'
+	include 'LABELS.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+
+
+* special COMMON to let this routine know if FERRET is in control
+
+	include 'ppl_in_ferret.cmn'
+	include 'aline.cmn'	! jd for aline call
+	include 'gkscm2.cmn' 
+	include 'shade_vars.cmn' 
+
+
+	LOGICAL CLEAR,CONTR,no_vpt_flag
+
+*	*jd* linux port 12.96 Add external stmt below
+	external size, scale
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+	mainlab = 1  ! Flag: Draw the main label in calls to DAXIS
+
+	IF(((MAKEP.EQ.'CONTOUR'.OR.MAKEP.EQ.'VIEW'.or.
+     *     makep.eq.'FILL'.or.makep.eq.'PIXEL'.or.
+     *       makep.eq.'SHADE')  
+     *	  .AND.JTYPE.EQ.1).OR.
+     *	  ((MAKEP.EQ.'VECTOR').AND.JTYPE.GT.-1).OR.
+     *	  ((MAKEP.EQ.'FLOWLINE').AND.JTYPE.GT.-1).OR.
+     *	  ((MAKEP.EQ.'PLOT'.OR.MAKEP.EQ.'PLOTV'.OR.
+     *	  MAKEP.EQ.'PLOTUV'.OR.MAKEP.EQ.'VELVCT'.OR.
+     *	  MAKEP.EQ.'PLOTPOL'.OR.MAKEP.EQ.'FILLPOL')
+     *	  .AND.JTYPE.NE.1))RETURN
+	CONTR=MAKEP.EQ.'CONTOUR'.OR.MAKEP.EQ.'VIEW'
+     *		.OR.MAKEP.EQ.'VECTOR'.or.makep.eq.'SHADE'   
+     *          .or.makep.eq.'FLOWLINE'
+     *          .or.makep.eq.'FILL'.or.makep.eq.'PIXEL'
+	CLEAR = .NOT.SOVER .AND. IMCNT.LE.1 .AND. .NOT.PLTOPN
+C	SETUP AXIS FOR ALL PLOT TYPES.
+
+*below	no_vpt_flag = .not.(vpt_was_set .and. ppl_viewports_active)!12.1.89 JD
+*	MOD TO PROTECT COLORS ALREADY USED IN SHADE & FILL - took out for now
+*	if (clear .and. no_vpt_flag) then
+*	   protect_used_colors = .false.
+*	   lo_color_ndx = 0
+*	else
+*	   protect_used_colors = .true.
+*	endif
+
+	IF(.NOT.SOVER .AND. .NOT.PLTOPN)CALL SIZE(WIDTH,HEIGHT)
+#ifdef unix
+*       call flush(lttout)
+#endif
+***********************************************
+* TMAP check that output window is active
+	IF ( PPL_in_FERRET ) CALL CK_GKS_ACTIVE( *4999 )
+***********************************************
+	CALL OPNDEV(TERMF,CLEAR)
+***********************************************
+* TMAP addition to turn on segment
+	IF ( PPL_in_FERRET ) CALL SEG_ON( )                              
+***********************************************
+	CALL COLOR(IPEN(0))
+	IF(.NOT.SOVER)THEN
+	    CALL SETAX(X,NXS,XF,YF,XL,YL,XH,YH,NMX,NMY,XTI,XTL)
+	    IF (ABS(XF) .GT. CMZGE .OR. ABS(YF) .GT. CMZGE) GOTO 3333  ! fill/contour but 1 grid point
+	    CALL DAXIS(XF,YF,NMX,NMY,MAINLAB)
+
+		XLPLOT=DBLE(XL) 
+		XHPLOT=DBLE(XH)
+		YLPLOT=DBLE(YL)
+		YHPLOT=DBLE(YH)
+
+		call trans (0,xmin,ymin,xtm,ytm)
+		call trans (0,xmax,ymax,xtx,ytx)
+
+		XLPLOT=(DBLE(xtm)-DBLE(XLO) )*DBLE(XF) 
+		XHPLOT=DBLE(XLEN)+(DBLE(xtx)-DBLE(XHI) )*DBLE(XF)
+		YLPLOT=(DBLE(ytm)-DBLE(YLO) )*DBLE(YF)
+		YHPLOT=DBLE(YLEN)+(DBLE(ytx)-DBLE(YHI) )*DBLE(YF)
+
+	    IF ( interrupted ) GOTO 3333		! 1/89 - *sh*
+	ELSE
+	    IF(ITFLG.NE.0)THEN
+		TLO = 1. - DIFF(IT1,ITSTRT)/DT
+	        THI=TLO+DIFF(IT1,IT2)/DT
+	    ENDIF
+	    IF(ITFLG.EQ.1)THEN
+		XTI=XHI
+		XTL=XLO
+		XHI=THI
+		XLO=TLO
+	    ELSE IF(ITFLG.EQ.-1)THEN
+		XTI=YHI
+		XTL=YLO
+		YHI=THI
+		YLO=TLO
+	    ENDIF
+	    IF(CONTR)THEN
+		call trans (0,xmin,ymin,xtm,ytm)
+		call trans (0,xmax,ymax,xtx,ytx)
+
+		XLPLOT=(DBLE(xtm)-DBLE(XLO) )*DBLE(XF) 
+		XHPLOT=DBLE(XLEN)+(DBLE(xtx)-DBLE(XHI) )*DBLE(XF)
+		YLPLOT=(DBLE(ytm)-DBLE(YLO) )*DBLE(YF)
+		YHPLOT=DBLE(YLEN)+(DBLE(ytx)-DBLE(YHI) )*DBLE(YF)
+
+	    ENDIF
+	ENDIF
+
+C	DRAW AXIS AND LABELS
+C	DO PLOTTING
+C
+	IF(IWIND.GT.0)CALL WINDOW(XLO,YLO,XHI,YHI)
+C
+	IF(MAKEP.EQ.'CONTOUR'.or.makep.eq.'FILL'.or.
+     *     makep.eq.'PIXEL')THEN
+	    IF(JTYPE.EQ.-1.AND.ivcomp.eq.2) then
+	   	IVLOC=NX*NY+1
+	    ELSE IF(JTYPE.EQ.-2.AND.ivcomp.eq.2) then
+		IVLOC=NX*NY+NX+NY+1
+	    ELSE
+		IVLOC=1
+	    ENDIF
+	    CALL PLOTZ(X(IVLOC),XF,YF,XLPLOT,YLPLOT,XHPLOT,YHPLOT)
+
+C  Call WINDOW to restore values of XMIN, XMAX, YMIN, YMAX. Plot axis again
+C  so any tics inside the box show up.
+
+	    IF(MAKEP.EQ.'FILL') THEN
+               IF(IWIND.GT.0)CALL WINDOW(XLO,YLO,XHI,YHI)
+	       mainlab = 0
+               CALL DAXIS(XF,YF,NMX,NMY,MAINLAB)
+	       CALL DAXIS_BOX
+            ENDIF
+
+	ELSE IF(MAKEP.EQ.'PLOT') THEN
+	   IPV = 0
+	   CALL PLOTXY(X,NXS,XF,YF,IPV)
+	   if (interrupted) go to 3333
+****    JD * ALINE CALL 
+	   CALL WINDOW(0.,0.,0.,0.)
+C
+	    do 100 a_line = 1,lnum
+		if (.not. aline_on(a_line)) goto 100
+
+		if (aline_user(a_line)) then
+		   minx = aline_minx(a_line)
+		   miny = aline_miny(a_line)
+		   maxx = aline_maxx(a_line)
+		   maxy = aline_maxy(a_line)
+		else
+		   call point_convert (aline_minx(a_line),aline_miny(a_line),
+     .		   minx,miny)
+		   call point_convert (aline_maxx(a_line),aline_maxy(a_line),
+     .		   maxx,maxy)
+		end if
+
+***  ACM 12/02 For lines which are plotted with symbols, plot a 
+***            key having 3 points.
+
+C		call aline_sub (x,nxs,a_line,minx,miny,maxx,maxy)
+		call line_key (x,nxs,a_line,minx,miny,maxx,maxy)
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+100	    continue
+****
+
+	ELSE IF(MAKEP.EQ.'RIBPLOT') THEN
+	   CALL PLOTXY_RIBBON(X,NXS,XF,YF)
+
+	ELSE IF(MAKEP.EQ.'VECTOR')THEN
+	    IF(JTYPE.EQ.-1)THEN
+		CALL VECFLD(X(1),X(NX*NY+1),NX,NY,X(1),X(1),XF,YF)
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+	    ELSE
+		IP1=NX*NY+1
+		IP2=IP1+NX
+		IP3=IP2+NY
+  		CALL VECFLD(X(1),X(IP3),NX,NY,X(IP1),X(IP2),XF,YF)
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+	    ENDIF
+****
+C ACM Add FLOWLINE call based on VECFLD
+
+	ELSE IF(MAKEP.EQ.'FLOW')THEN
+	    IF(JTYPE.EQ.-1)THEN
+		CALL FLOWLINE(X(1),X(NX*NY+1),X(2*NX*NY+1),
+     .            NX,NY,X(1),X(1),XF,YF)
+		IF ( interrupted ) GOTO 3333 
+	    ELSE
+		IP1=NX*NY+1
+		IP2=IP1+NX
+		IP3=IP2+NY
+                IP4=2*NX*NY + 2*(NX+NY)
+  		CALL FLOWLINE(X(1),X(IP3),X(IP4),NX,NY,X(IP1),
+     .             X(IP2),XF,YF)
+		IF ( interrupted ) GOTO 3333
+	    ENDIF
+        ELSE IF(MAKEP.EQ.'VELVCT')THEN
+c	    CALL VELVCT(X,NXS,XF,YF)
+	    IPV = 2
+	    CALL PLOTXY(X,NXS,XF,YF,IPV)
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+	ELSE IF(MAKEP.EQ.'PLOTV'.OR.MAKEP.EQ.'PLOTUV')THEN
+c	    CALL PLOTV(X,NXS,XF,YF)
+	    IPV=1
+	    CALL PLOTXY(X,NXS,XF,YF,IPV)
+
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+	ELSE IF(MAKEP.EQ.'VIEW')THEN
+	    IF(JTYPE.EQ.-1.AND.ivcomp.eq.2) then
+	   	IVLOC=NX*NY+1
+	    ELSE IF(JTYPE.EQ.-2.AND.ivcomp.eq.2) then
+		IVLOC=NX*NY+NX+NY+1
+	    ELSE
+		IVLOC=1
+	    ENDIF
+	    CALL VIEW(X(IVLOC))
+		IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+***************************************************
+* TMAP addition for SHADE call
+        else if (makep .eq. 'SHADE') then
+            IF(JTYPE.EQ.-1.AND.ivcomp.eq.2) then
+                IVLOC=NX*NY+1
+		IP1=NX*NY+1
+		IP2=IP1+NX
+		IP3=IP2+NY
+                IP4=2*NX*NY + 2*(NX+NY)
+            ELSE IF(JTYPE.EQ.-2.AND.ivcomp.eq.2) then
+                IVLOC=NX*NY+NX+NY+1
+            ELSE
+                IVLOC=1
+                IP4=NX*NY+1
+            ENDIF
+            call shade(x(ivloc), x(IP4) )
+	    IF ( interrupted ) GOTO 3333		! 1/89 - *sh*
+	    mainlab = 0
+	    CALL DAXIS(XF,YF,NMX,NMY,MAINLAB)
+	    CALL DAXIS_BOX
+***************************************************
+* TMAP addition for PLOTPOL call
+	ELSE IF(MAKEP.EQ.'PLOTPOL')THEN
+
+	   STOP  'PLOTPOL not yet implemented'
+c	    CALL PLOTPOL(X,NXS,XF,YF)
+	    IPV=3
+	    CALL PLOTXY(X,NXS,XF,YF,IPV)
+	    IF ( interrupted ) GOTO 3333
+***************************************************
+* TMAP addition for FILLPOL call
+	ELSE IF(MAKEP.EQ.'FILLPOL' .OR. MAKEP.EQ.'POLYGON')THEN
+	    CALL FILLPOL(X,NXS,XF,YF,iwind)
+	    IF ( interrupted ) GOTO 3333
+
+	    if (sline) then
+	       CALL WINDOW(0.,0.,0.,0.)
+	       
+*              Only one line at a time to label
+	       do 200 a_line = 1,1
+		  if (.not. aline_on(a_line)) goto 200
+		  
+		  if (aline_user(a_line)) then
+		     minx = aline_minx(a_line)
+		     miny = aline_miny(a_line)
+		     maxx = aline_maxx(a_line)
+		     maxy = aline_maxy(a_line)
+		  else
+		     call point_convert 
+     .	               (aline_minx(a_line),aline_miny(a_line),
+     .		        minx,miny)
+		     call point_convert 
+     .	               (aline_maxx(a_line),aline_maxy(a_line),
+     .                  maxx,maxy)
+		  end if
+		  call aline_sub (x,nxs,a_line,minx,miny,maxx,maxy)
+		  
+		  IF ( interrupted ) GOTO 3333 !*jd* 8.3.92
+ 200	       continue
+	    end if
+
+* Redraw the axes after the plot is drawn as polygons may
+* obscure axes and/or tics.
+            IF (.NOT. SOVER) THEN
+	       mainlab = 0
+               CALL DAXIS(XF,YF,NMX,NMY,mainlab) ! was MAINLAB
+	       CALL DAXIS_BOX
+	    ELSE
+* If it was an overlay, we still want to draw the axes but dont
+* redo labels (See bug 1663)
+               LABELX_save = LABELX
+               LABELY_save = LABELY
+               LABELT_save = LABELT
+               LABELX = 0
+               LABELY = 0
+               LABELT = 0
+	       mainlab = 0
+               CALL DAXIS(XF,YF,NMX,NMY,MAINLAB)
+	       CALL DAXIS_BOX
+               LABELX = LABELX_save
+               LABELY = LABELY_save
+               LABELT = LABELT_save
+	       mainlab = 1
+	    ENDIF
+***************************************************
+	ENDIF
+
+ 3333	CONTINUE					! 1/89 - *sh*
+* post-interrupt re-entry				! 1/89 - *sh*
+	CALL SCALE(XF,YF,XORG,YORG,XLO,YLO)
+C
+	CALL WINDOW(0.,0.,0.,0.)
+C
+	IF ( .NOT.interrupted ) CALL DAXIS2(XF,YF,NMX,NMY) ! 1/89 - *sh*
+	IF(ITFLG.EQ.1)THEN
+	    XHI=XTI
+	    XLO=XTL
+	ELSE IF(ITFLG.EQ.-1)THEN
+	    YHI=XTI
+	    YLO=XTL
+	ENDIF
+*************************************
+* TMAP addition: close segment and possibly write "** INTERRUPTED **" on plot
+	IF ( PPL_in_FERRET ) CALL SEG_OFF
+*       consider updating the drawing now
+        CALL FGD_CONSIDER_UPDATE(.FALSE.)
+*
+	IF ( interrupted ) CALL INTERRUPT( *5000 )	! 1/89 - *sh*
+ 4999	RETURN
+ 5000	CALL SAY_INTERRUPTED
+*************************************
+	RETURN
+	END
diff --git a/ppl/plot/pplcmd.F b/ppl/plot/pplcmd.F
new file mode 100644
index 0000000..afee681
--- /dev/null
+++ b/ppl/plot/pplcmd.F
@@ -0,0 +1,66 @@
+	SUBROUTINE PPLCMD(FROMI,LINEI,ISI,COMBUF,ICMDIM,ICMSZE)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.   
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V54: *acm* 9/01 changes for dynamic allocation of PPLUS memory.
+*                  This routine passes arguments through by a C "envelope" 
+*                  routine pplcmd_c, which gets the global pointer to PPLUS 
+*                  memory and passes it to pplcmd_f.F  which has the original code.
+*                  Put the strings in common to avoid wierdness with strings in C.
+* v541 *acm* 5/02  Slightly more graceful stop in case IDMDIM too large
+* v552 *acm* 3/03  cleanup in declarations
+
+c	SUBROUTINE PPLCMD(FROMI,LINEI,ISI,COMBUF,ICMDIM,ICMSZE)
+
+      INCLUDE 'pplcmd_strings.cmn'
+
+	CHARACTER FROMI*(*), LINEI*(*), COMBUF(ICMDIM)*(*)
+        INTEGER   ICMDIM,ISI,ICMSZE     
+
+c     internal parameter declarations:
+      INTEGER      i
+
+      IF (ICMDIM .GT. 5) GO TO 5000
+
+      DO i = 1, ICMDIM
+         PPLCOMBUF(i) = COMBUF(i)
+      ENDDO
+
+      PPLFROMI = FROMI
+      PPLLINEI = LINEI
+
+      CALL pplcmd_c  (ISI, ICMDIM, ICMSZE)
+
+      RETURN
+ 5000 STOP 'ICMDIM in PPLCMD too small'
+      END
diff --git a/ppl/plot/pplcmd_f.F b/ppl/plot/pplcmd_f.F
new file mode 100644
index 0000000..e50dc3a
--- /dev/null
+++ b/ppl/plot/pplcmd_f.F
@@ -0,0 +1,1888 @@
+	SUBROUTINE PPLCMD_F(ISI,ICMDIM,ICMSZE,pplmem)
+
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.   
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+C**
+
+C**    @(#)pplcmd.F   1.4    11/8/88 !Mod added 12.6.88 JD
+C**    @(#)pplcmd.F   1.3     9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*       Modified 8.12.88 J Davison TMAP/JISAO/PMEL   
+*       to include SHADE command.                    
+*	J Davison 11.28.88 Modified for compatibility to v1.1 PPL
+*	J Davison 05.04.89 Added pixmap call to capture color bitmap
+*	J Davison 10.04.89 Added aline call to plot a line
+*	J Davison 01.25.90 Modified CLSPLT to handle metafiles
+*	J Davison 04.10.90 Mod to support 'PEN N,0' command => color index 0
+*       J Davison 08.02.91 Mods to generate brain dead version of ppl
+*       J Davison 11.15.91 Mod to support 'COLOR' command
+*       J Davison 01.14.92 Mod to include AREA, SQFILL
+*	*jd* 10.16.92 Mod to add save & restore function for pen command
+*	*tc* 01.26.93 Mod to handle draftsman and spline_tension with
+*	     CONSET command.  use variables 9 (spl_ten) and 10 (drman).
+*	     by the way, the array size of p and iflg is 20 in cmrd.inc so
+*	     a command can handle up to 20 inputs.
+*	J Davison 11.09.93 Mod to add segments to advanced commands
+*	J Davison 01.06.94 Mod to use PLTNME to set metafile name
+*	J Davison 01.25.94 Mod to call PPLGFLUSH to flush output at each call
+*	J Davison 11.19.95 Mod for 4 digit year capability
+*	J Davison 11.29.95 Mod for century axis
+*	J Davison 10.15.98 Mod for pattern support: PATSET
+*       *jd* VVV  02.16.99 Mod to bring two versions of PPLCMD in line VVV
+*	S Hankin  11.25.97 Mod to add commands PLOTPOL and FILLPOL
+*       kob 9.98 - add external statement to force linker to find
+*                  block data statments
+*       J Davison 10.14.99 Mod to add CALENDAR command for multiple calendars
+* V510: *sh* 3/0 - bug fix: TXLABP 0 was interpreted as TXLABP 1 cuz
+*		of SIGN() call near top of this routine
+*       ACM 10/2000  Add VECTOR/FLOWLINE, alias FLOWLINE 
+* V530: *acm* 1/01 calendar info in calendar.cmn and calendar.decl
+* V54:  *acm* 9/01 changes for dynamic allocation of PPLUS memory.
+*                  This routine called by a C "envelope" routine PPLCMD
+*                  with the same arguments as the original PPLCMD.F, which
+*                  gets the global pointer to PPLUS memory and passes it to
+*                  this routine.   The only change here is that array pplmem
+*                  (old name was X)  is passed in rather than in PPLDAT.INC
+*      *acm* 10/01  remove VMS includes
+* v541 *acm*  5/02 add option to control outline on the shade key boxes (S_KEY)
+* v552 *acm*  3/03 Add poly
+* v552 *acm*  3/03 Longer strings: changes for multi-line labels
+* v552 *acm*  5/03 Add option to control whether cellarray calls are made for
+*                  shade plots (S_CELL)  Only used internally.
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+* v580 *acm* 8/04 allow PPL POLYGON as well as PPL FILLPOL after POLY/SET
+* V581 *acm* 4/05 fix bug 1214; clsplt needs to set meta_actv to false.
+* V581 *acm* 5/05 Add simple error checking to the text with XFOR, YFOR, and VECKEY
+*                 to see if they are a valid fortran format strings(bug1215). Note
+*                 this is just a first-pass checking: if mode ignore_error is on,
+*                 or if a plot command is issued without correcting the PPL call,
+*                 the bad format string is passed on to routines like numcde or
+*                 vecfld, where it will cause a crash.
+C *acm* 11/05     new options for XFOR, YFOR, 'DM' deg/min deg/min
+* V600: *acm* 11/05 add xdms,ydms for deg/min labels
+C        1/06  xvaloff,yvaloff add this amount to each x or y axis label. 
+C              (axis data was read as double precision and converted to single 
+C              after applying an offset.)
+C V600: *acm* 4/06 Change how RANGE_DM is applied when using DM or DMS axis labelling.
+C V600: *acm* 5/06 Allow seconds in DMS axis labelling; had removed this.
+C V600 *acm* 5/2006 LINECOLORS User can change the number of line colors.
+C V602  1/07 *acm* true batch mode for metafiles; flag meta_batch
+C                 distinguises this case from other batch modes.
+C V610 *acm* 11/2007 For build using PGI Fortran compilers at ECMWF 
+C                 The code testing the Format for axis labels balks at
+C                 writing a 0 using an F format. See changes at lines 
+C                 WRITE(err_msg,label,ERR=1999) 0.  Need to check for an I
+C                 format and write 0, else write 0.0.
+C V63  *acm* 10/09 Changes for gfortran build
+C V65  *acm*  1/10 New time-axis style for DAY and MONTH, DMY: adds the
+C                  year to DAY,MONTH or to MONTH.
+* V65   *acm* 2/10 Fix bug 1724: in metafile batch mode only, if some command
+*                  has opened the metafile but nothing plotted yet, and if
+*                  a SET MODE META:newname.plt is issued, just rename the metafile
+*                  that was opened. New RENAMPL command.
+C *acm*  3/10  Bug 670 fixed: New flag MULTICENFLAG for multi-decade plots, 
+C              do not make small tics by default.
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+c
+c	fromi	command file or device (/dev/tty or TT: for terminal)
+c	linei	input line for parameters
+c	isi	length of line in characters
+c	combuf() command buffer for executing commands from memory
+c	icmdim	dimensioned length of combuf
+c	icmsze	number of lines in combuf
+c
+        include 'comepl_inc.decl'  ! added 9.6.88 j davison 
+        include 'COMEPL.INC'  ! added 9.6.88 j davison 
+	include 'comeps_inc.decl'
+	include 'COMEPS.INC'
+	include 'comepv_inc.decl'
+	include 'COMEPV.INC'
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+	include 'PPLDAT.INC'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'labels_inc.decl'
+	include 'LABELS.INC'
+	include 'labcom_inc.decl'
+	include 'LABCOM.INC'
+	include 'cont_inc.decl'
+	include 'CONT.INC'
+	include 'dashzz_inc.decl'
+	include 'DASHZZ.INC'
+	include 'conlab_inc.decl'
+	include 'CONLAB.INC'
+	include 'plt_inc.decl'
+	include 'PLT.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'hab_inc.decl'
+	include 'HAB.INC'
+	include 'data_inc.decl'
+	include 'DATA.INC'
+	include 'cmrd_inc.decl'
+	include 'CMRD.INC'
+	include 'cmrdl_inc.decl'
+	include 'CMRDL.INC'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'tics_inc.decl'
+	include 'TICS.INC'
+	include 'tics2_inc.decl'
+	include 'TICS2.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	include 'xylabp_inc.decl'
+	include 'XYLABP.INC'
+	include 'view_inc.decl'
+	include 'VIEW.INC'
+	include 'zgrid_inc.decl'
+	include 'ZGRID.INC'
+	include 'filnam_inc.decl'
+	include 'FILNAM.INC'
+	include 'lunits_inc.decl'
+	include 'LUNITS.INC'
+	include 'vector_inc.decl'
+	include 'VECTOR.INC'
+	include 'system_inc.decl'
+	include 'SYSTEM.INC'
+	include 'cmdcom_inc.decl'
+	include 'CMDCOM.INC'
+	include 'symkey_inc.decl'
+	include 'SYMKEY.INC'
+	include 'switch_inc.decl'
+	include 'SWITCH.INC'
+	include 'prmcom_inc.decl'
+	include 'PRMCOM.INC'
+	include 'gkscm2.cmn'
+        include 'ARFILL.INC'
+	include 'calendar.decl'
+	include 'calendar.cmn'
+        INCLUDE 'pplcmd_strings.cmn'
+        INCLUDE 'cmndlen.inc'
+        INCLUDE 'errmsg.parm'
+
+* special COMMON to let this routine know if FERRET is in control
+        include 'ppl_in_ferret.cmn'
+                                     
+        real            pplmem(*)
+        logical         tmapdebug
+CCCCCCC Assign value below rather than initialize here.  F90 complains (linux)
+CCCCCCC data	        tmapdebug/.false./
+
+        common/tmdebug/ tmapdebug
+
+*       Declarations added J Davison 9.2.88                    
+        integer         icmdim,is,isi,icmsze,i,ier,isym        
+        integer         j,k,ic,ierr,lun1,lun11                 
+        integer         idum1,iy1,ix1,ix3                   
+        integer         lnblk,ws_state
+                                                               
+        real            xm,ym,xt,xdum1,xdum2,xdum3,xdum4       
+        real            xdum5,zmn,zmx,p1,x1,y1,y2,x3,x4     
+        real            diff,symwid,xmx,xmn,ymx,ymn,dd
+                                                               
+        external        lnblk,diff,symwid                      
+                                                               
+        logical         first_time_thru               
+        data            first_time_thru/.true./                
+
+*       End declarations 9.2.88
+                                
+*	Declarations added J Davison 11.30.88
+	real		xft,yft,xlt,ylt,xht,yht,xtit,xtlt
+	integer		nmxt,nmyt,ilen
+*	End declarations 11.30.88
+
+	integer	  ipen_save(0:nlines), cal_status
+	data	  ipen_save/1,nlines*1/
+        INTEGER   TM_LENSTR, TM_LENSTR1, slen
+
+	character strr*2048
+
+        LOGICAL TM_HAS_STRING
+	CHARACTER DTE*10,TEMP*2048,TEMP2*2048,FILE*81,FROM*80,LINE*2048
+	CHARACTER SYM*120,ICOM7*7
+	CHARACTER FROMI*10,LINEI*10
+	CHARACTER COMBUF(ICMDIM)*2048
+	CHARACTER YES*3,NO*2,err_msg*40
+	LOGICAL LEOF
+	LOGICAL IFLG1,IFLG2,LABON,VALOFF
+	DIMENSION X1(5),Y1(5),Y2(4),X3(2),IX3(5)
+	DIMENSION X4(4)
+	CHARACTER COMM(123)*7
+	EQUIVALENCE (DT,X3(1)),(ITYPET,IX3(1)),(TSMX,X4(1))
+	EQUIVALENCE (XLO,X1(1)),(YLO,Y1(1)),
+     *		(HLAB1,Y2(1))
+	INTEGER	ISTAT,IFLAG !Added back in -- deleted for some reason in v1.1
+	DATA YES,NO/'YES','NO'/
+	DATA FILE/' '/
+	DATA COMM/'AUTO','BAUD','EXIT','PLTYPE','RWDSEQ','SIZE',
+     *  'SMOOTH',
+     *  'TKTYPE','XLAB','YLAB','FORMAT','CONTOUR','PLOT','READSEQ',
+     *  'VARS','XAXIS','YAXIS','NLINES','LINE','LABS','LABSET',
+     *  'LEVELS','CLINE','CONSET','LIST','SKPSEQ','VIEW','ENTER',
+     *  'CROSS','PARAM',
+     *  'SAVE','GET','XFOR','YFOR','ORIGIN','WINDOW','RWD','RD','SKP',
+     *  'MULTPLT','METRIC','ENGLISH','LIMITS','PLOTV','TAXIS','RDCOM',
+     *  'PLOTUV','TICS','TMIN','TMAX','TSTART','PEN','AXLEN','AXLABP',
+     *  'AXLINT','AXTYPE','AXLSZE','AXNSIG','AXNMTC','AXATIC','ROTATE',
+     *  'C','BOX','RLABS','AXSET',' ','LLABS','LEV','DATPT','PLTNME',
+     *  'HLABS','CONPRE','CONPST','TRANSXY','MARKH','LINFIT','DFLTFNT',
+     *  'GRID','TEKNME','ECHO','VELVCT','TIME','TXTYPE','TXLSZE',
+     *  'TXLINT','TXNMTC','TXLABP','AUTOLAB','EVAR','DEBUG','RESET',
+     *  'TITLE','VPOINT','CLSPLT','VECTOR','VECSET','VECKEY','USR',
+     *  'SHADE','SHAKEY','SHASET','PIXMAP','ALINE','TMDEBUG','COLOR',
+     *  'SQFILL','FILL', 'PLOTPOL', 'FILLPOL', 'PATSET','CALENDA',
+     *  'FLOWLIN', 'S_KEY', 'S_CELL', 'POLYGON', 'XVALOFF', 'YVALOFF',
+     *  'LINECOL','RENAMPL','SHRINKY','RIBBON','RIBFAST','RIBMISS'/
+
+!  *  'SQFILL','AREA'/ NAME CHANGE *jd*
+ 
+	CHARACTER*15  TMPCHR
+	character*2048 set_name
+
+*	*jd* linux external stmt below inserted	
+	external scale
+
+* *kob* add external statment 9/98
+	EXTERNAL 
+     .          BIBO5,
+     .          TBLES,
+     .          DSFCOM_INIT,
+     .          PPLDAT,
+     .          WS_TYPES_INIT
+
+        include 'tmap_errors.parm'
+        include 'century.cmn'
+
+*****************************************************************************
+
+*  get strings out of common.
+      DO i = 1, ICMDIM
+        COMBUF(i) = PPLCOMBUF(i) 
+      ENDDO
+
+      FROMI = PPLFROMI
+      LINEI = PPLLINEI
+
+*       SETUP SHADE ROUTINE DEFAULTS             
+        if (first_time_thru) then                
+	   tmapdebug = .false.
+           first_time_thru = .false.             
+           call setup_defaults                   
+        end if                                   
+
+C
+C	SET UP LABELT STUFF
+C
+	IF ( LABELT .EQ. 0 ) THEN
+	   ITXLBP= 0		! 3/00 bug fix for "TXLABP 0"
+	ELSE
+	   ITXTPE=ABS(LABELT)
+	   ITXLBP=SIGN(1,LABELT)
+	ENDIF
+C
+C	INITIALIZE COMMAND BUFFER
+C
+	FROM=FROMI
+	LINE=LINEI
+	IS=ISI
+	MEMBUF=ICMSZE.GE.1
+	BUFSZE=ICMSZE
+	IF(MEMBUF)THEN
+!	    M=BUFDIM No longer defined in v1.1 -- see cmdcom.inc
+	    M=IBFDIM
+	    M=MIN0(M,BUFSZE)
+	    DO 30 I=1,M
+30	    CMDBUF(I)=COMBUF(I)
+	    FROM='$$MEMBUF$$'
+	    LINE=' '
+	    IS=0
+	ENDIF
+#ifdef unix
+        TERMF=FROM.EQ.'/dev/tty'
+#else
+        TERMF=FROM.EQ.'TT:'
+#endif
+	CMDLEV=0
+	CALL ATSTRT(FROM,LINE,IS,IER)
+C
+C	    ERROR OCCURRED WHILE OPENING 'FROM' AS INPUT FOR COMMANDS
+C
+	IF(IER.NE.0)RETURN
+C
+C	READ COMMAND FROM INPUT AND PARSE
+C
+	MBUFF=1
+10	call FGD_GQOPS(ws_state)
+!	If GKS WS is active, flush output buffer before leaving if just plotted
+	if (ws_state .ge. 3) then
+	  if (makep .eq. 'CONTOUR'
+     .	  .or.makep .eq. 'PLOT'
+     .	  .or.makep .eq. 'VIEW'
+     .	  .or.makep .eq. 'PLOTV'
+     .	  .or.makep .eq. 'PLOTUV'
+     .	  .or.makep .eq. 'VELVCT'
+     .	  .or.makep .eq. 'VECTOR'
+     .	  .or.makep .eq. 'FLOW'
+     .	  .or.makep .eq. 'SHADE'
+     .	  .or.makep .eq. 'FILL'
+     .	  .or.makep .eq. 'PLOTPOL'
+     .	  .or.makep .eq. 'FILLPOL'
+     .	  .or.makep .eq. 'POLYGON'
+     .	  .or. icom(1:1) .eq. '%') then
+             IF ( PPL_in_FERRET ) CALL SEG_ON( )
+             call pplgflush
+             IF ( PPL_in_FERRET ) CALL SEG_OFF
+	   endif
+	endif
+	makep = ' '
+        IF (makep .EQ. 'POLYGON') makep = 'FILLPOL'
+
+	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	IF (DONEF) RETURN
+
+C       Changed ICOM to CHAR*7 comparison for CALENDAR command. *jd* 10.99
+	ICOM7(1:7)=ICOM(1:7)
+	DO 20 I=1,123
+	    IF(ICOM7.EQ.COMM(I))GOTO 21
+20	CONTINUE
+	IF(ICOM(1:1).EQ.'%')THEN
+! 	   Mod 11.9.93 to insert advanced command output into segments
+*          TMAP check that output window is active
+           IF ( PPL_in_FERRET ) CALL CK_GKS_ACTIVE( *9999 ) 
+*          TMAP addition to turn on segment
+           IF ( PPL_in_FERRET ) CALL SEG_ON( )
+
+	   CALL PRMTIV(pplmem,pplmem_nsize)
+           IF ( PPL_in_FERRET ) CALL SEG_OFF
+	ELSE
+	    CALL SPWN
+	ENDIF
+	GOTO 10
+21	IFLG1=(M.GE.1.AND.IFLG(1).NE.0)
+	IFLG2=(M.GE.2.AND.IFLG(2).NE.0)
+	LABON=(LABEL.EQ.'ON'.OR.LABEL.EQ.'on')
+	VALOFF=(INDEX(LABEL,'OFF')+INDEX(LABEL,'off')).NE.0
+C       Mod below for brain dead version *JD* 8.2.91
+        if (tmapdebug) then
+	GOTO (100,200,300,500,600,700,900,1000,1100,1200,1300,
+     *	1400,1500,1600,1800,1900,2000,2100,2200,2300,2500,2600,
+     *	2700,2800,2900,3300,3400,3500,3600,4000,4200,4300,
+     *	4400,4500,4600,4700, 600,1600,3300,4900,5000,5100,5200,
+     *	5300,5400,5500,5700,5800,5900,6000,6100,6200,6300,6400,
+     *	6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,
+     *	7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,
+     *	8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,
+     *	9800,9900,9910,9920,9930,9940,9950,9110,9120,9130,9140,
+     *	9150,9160,9170,9180,9190,98,9191,9380,9171,9172,9173,
+     *  9174,9175,9390,9165,9166,9183,4401,4501,9192,9960,9970,
+     *  1550,9980,9990),I
+        else
+	GOTO (100,200,300,500,99,700,900,1000,1100,1200,1300,
+     *	1400,1500,99,1800,1900,2000,2100,2200,2300,2500,2600,
+     *	2700,2800,2900,99,3400,3500,3600,4000,4200,4300,
+     *	4400,4500,4600,4700,99,99,99,4900,5000,5100,5200,
+     *	5300,5400,5500,5700,5800,5900,6000,6100,6200,6300,6400,
+     *	6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,
+     *	7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,
+     *	8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,
+     *	9800,9900,9910,9920,9930,9940,9950,9110,9120,9130,9140,
+     *	9150,9160,9170,9180,9190,98,9191,9380,9171,9172,9173,
+     *  9174,9175,9390,9165,9166,9183,4401,4501,9192,9960,9970,
+     *  1550,9980,9990),I
+        end if
+        goto 10
+
+C     TMDEBUG
+ 98   call upper (label,2048)
+      if (label .eq. 'ON')  tmapdebug = .true.
+      if (label .eq. 'OFF') tmapdebug = .false.
+      goto 10
+C
+C     Brain dead response for RDing
+C
+ 99   IF(.NOT.QUIETF)WRITE(LTTOUT,
+     . '(1X,''COMMAND NOT SUPPORTED IN THIS VERSION OF PPLUS: '',A7)') 
+     . ICOM(:7)
+      GOTO 10
+C     AUTO
+100	IF(LABON)THEN
+	    IPAUSE=0
+	    IHDCPY=1
+	ELSE
+	    IPAUSE=1
+	    IHDCPY=0
+	END IF
+	GOTO 10
+C     BAUD
+200	IR=IFIX(P(1))
+	CALL BAUD(IR)
+	GOTO 10
+C     EXIT
+300	CALL ATFLSH
+	RETURN
+C     PLTYPE
+500	ICODE=IFIX(P(1))
+C       More brain dead mods:
+        IF (ICODE .NE. 3 .AND. .not. tmapdebug) THEN
+           IF(.NOT.QUIETF)WRITE(LTTOUT,'(1X,A)')
+     .          'PLTYPE 3 ONLY IS SUPPORTED IN THIS VERSION OF PPLUS'
+           GOTO 10
+        ENDIF
+	CALL PLTYPE(ICODE)
+	CALL TKTYPE(MOD)
+	GOTO 10
+C     SIZE
+700	WIDTH=P(1)
+	HEIGHT=P(2)
+	SYM='*PPL$WIDTH'
+	CALL PUTVAL(SYM,WIDTH,4,IER)
+	SYM='*PPL$HEIGHT'
+	CALL PUTVAL(SYM,HEIGHT,4,IER)
+	GOTO 10
+C     SMOOTH
+900	IF(M.EQ.0)GOTO 10
+	CALL SMOOTH(pplmem,NX,NY,NX,NY,IFIX(P(1)))
+	GOTO 10
+C     TKTYPE
+1000	MOD=IFIX(P(1))
+	CALL TKTYPE(MOD)
+	GOTO 10
+C     XLAB
+1100	XLAB=LABEL
+	GOTO 10
+C     YLAB
+1200	YLAB=LABEL
+	GOTO 10
+C     FORMAT
+1300	IFORM=LABEL
+	CALL UPPER(IFORM,80)
+	SYM='*PPL$FORMAT'
+	ISYM=LNBLK(IFORM,80)
+	CALL PUTSYM(SYM,IFORM,ISYM,IER)
+	LSCTD=SCTD
+	GOTO 10
+C     VARS
+1800	IEFLG=0
+	LSOFFS=SOFFS
+	LSTIME=STIME
+	LSNEXT=SNEXT
+	IF(IFLG(1).NE.0)NGRP=IFIX(P(1))
+	JX=0
+	JY=0
+	JZ=0
+	DO 1801 I=2,M
+	    IF(IFLG(I).EQ.0)GOTO 1801
+	    IF(P(I).EQ.1.)JX=I-1
+	    IF(P(I).EQ.2.)JY=I-1
+	    IF(P(I).EQ.3.)JZ=I-1
+1801	CONTINUE
+	NVAR=M-1
+	GOTO 10
+C     XAXIS
+1900	DO 1901 I=1,M
+	    IF(I.GE.4)GOTO 1902
+	    IF(IFLG(I).NE.0)X1(I)=P(I)
+1901	CONTINUE
+1902	IF(M.GT.0)THEN
+	    IAUTOX=0
+	    X1(3)=SIGN(ABS(X1(3)),X1(2)-X1(1))
+	ELSE
+	    IAUTOX=1
+	ENDIF
+	GOTO 10
+C     YAXIS
+2000	DO 2001 I=1,M
+	    IF(M.GE.4)GOTO 2002
+	    IF(IFLG(I).NE.0)Y1(I)=P(I)
+2001	CONTINUE
+2002	IF(M.GT.0)THEN
+	    IAUTOY=0
+	    Y1(3)=SIGN(ABS(Y1(3)),Y1(2)-Y1(1))
+	ELSE
+	    IAUTOY=1
+	ENDIF
+	GOTO 10
+C     NLINES
+2100	CALL RSMNMX
+	LINEN=0
+	IBASE=1
+	PBUF=0
+	LNUM=1
+	GOTO 10
+2200	I=IFIX(P(1))
+	IF(IFLG2)IMARK(I)=IFIX(P(2))
+	IF(M.GE.3.AND.IFLG(3).NE.0)ITYPE(I)=IFIX(P(3))
+        if(m.ge.4.and.iflg(4).ne.0)xoff(i)=p(4)     
+        if(m.ge.5.and.iflg(5).ne.0)yoff(i)=p(5)     
+        if(m.ge.6.and.iflg(6).ne.0)dn1(i)=p(6)      
+        if(m.ge.7.and.iflg(7).ne.0)up1(i)=p(7)      
+        if(m.ge.8.and.iflg(8).ne.0)dn2(i)=p(8)      
+        if(m.ge.9.and.iflg(9).ne.0)up2(i)=p(9)      
+	IF(M.GE.10.AND.IFLG(10).NE.0)IPEN(I)=IFIX(P(10))
+	GOTO 10
+
+!	All references to X2 deleted for 1.4 version of PPLCMD
+!	N=M
+!	IF(M.GE.10)N=9
+!	DO 2201 J=4,N
+!	    IF(J.LT.6)THEN
+!		K=J-3
+!	    ELSE
+!		K=J-1
+!	    ENDIF
+!	    IF(IFLG(J).NE.0)X2(I,K)=P(J)
+!2201	CONTINUE
+
+C     LABS
+2300	IF(P(1).EQ.0..OR.M.EQ.0)THEN
+	    DO 2301 I=1,NLABS
+		LLTYPE(I)=0
+2301	    RHLABS(I)=-1.0
+	    NLAB=0
+	ELSE
+	    I=IFIX(P(1))
+	    IF(N.NE.0)LABS(I)=LABEL
+	    USRLBS(I)=SUSER
+	    IF(IFLG2)THEN
+		XLABS(I)=P(2)
+		YLABS(I)=P(3)
+		IF(M.GE.4.AND.IFLG(4).NE.0)LTYPE(I)=P(4)
+	    ELSE
+		XLABS(I)=1.E35
+	    ENDIF
+	    IF(NLAB.LT.I)NLAB=I
+	END IF
+	GOTO 10
+C     LABSET
+2500	DO 2501 I=1,M
+	    IF(IFLG(I).NE.0)Y2(I)=P(I)
+2501	CONTINUE
+	GOTO 10
+C     LEVELS
+2600	CALL LEVEL
+	GOTO 10
+C     CLINE
+2700	DO 2701 I=1,M
+	    IF(IFLG(I).NE.0)LWGT(I)=IFIX(P(I))
+2701	CONTINUE
+	DO 2702 I=M+1,NLEV
+2702	LWGT(I)=1
+	GOTO 10
+C     CONSET
+2800	IF(IFLG1)HGT=P(1)
+	IF(IFLG2)NSIGC=IFIX(P(2))
+	IF(M.GE.3.AND.IFLG(3).NE.0)NARC=IFIX(P(3))
+	IF(M.GE.4.AND.IFLG(4).NE.0)DASHLN=P(4)
+	IF(M.GE.5.AND.IFLG(5).NE.0)SPACLN=P(5)
+	IF(M.GE.6.AND.IFLG(6).NE.0)CAY=P(6)
+	IF(M.GE.7.AND.IFLG(7).NE.0)NRNG=IFIX(P(7))
+	IF(M.GE.8.AND.IFLG(8).NE.0)DSLAB=P(8)
+! TMAP mod, spline fit:
+	if(m.ge.9.and.iflg(9).ne.0)spline_tension=p(9)
+! TMAP mod, horz contour labels:
+	if(m.ge.10.and.iflg(10).ne.0.and.p(10).ne.0.)draftsman=.true.	
+	if(m.ge.10.and.iflg(10).ne.0.and.p(10).eq.0.)draftsman=.false.	
+	GOTO 10
+C     CROSS
+3600	ICROSS=0
+	IF(LABON)ICROSS=1
+	IF(IFLG(1).EQ.1)ICROSS=ICROSS+INT(P(1))
+	GOTO 10
+C     PARAM
+4000	GOTO 10
+C	DO 4001 I=1,M
+C4001	IF(IFLG(I).EQ.1)A(I)=P(I)
+C	GOTO 10
+C     SAVE
+4200	IF(N.EQ.0)GOTO 10
+#ifdef unix
+        temp=label
+#else
+	CALL WLDFLE('SY:.PPL_SAVE',LABEL,TEMP,ISTAT,IFLAG)
+#endif
+	OPEN(UNIT=LMULT,FILE=TEMP,STATUS='NEW',
+     *	FORM='UNFORMATTED')
+C
+C	SAVE THE FOLLOWING COMMON BLOCKS:
+C
+C	HD
+C	MPLOT   (IMULT)
+C	PPLDAT  (IBASE AND PBUF)
+C	SWITCH  (DEFLTS AND FLAG)
+C	SYSTEM
+C	XYLABP
+C
+	WRITE(LMULT)IPTS,IMULT,IBASE,PBUF,DEFLTS,FLAG,ECHOF,DEBUGF,
+     *	BATCHF,ERRORF,DONEF,MEMBUF,LOGITF,QUIETF,LOGCMF,XLABS,YLABS,
+     *	RLABS,LTYPE,XLLABS,YLLABS,LLTYPE,RHLABS,USRLBS
+C
+	CALL SAVE(LMULT)
+	CLOSE(LMULT)
+	GOTO 10
+C	GET
+4300	IF(N.EQ.0)GOTO 10
+#ifdef unix
+        temp=label
+#else
+        CALL WLDFLE('SY:.PPL_SAVE',LABEL,TEMP,ISTAT,IFLAG)
+#endif
+	OPEN(UNIT=LMULT,FILE=TEMP,STATUS='OLD',
+     *	FORM='UNFORMATTED',ERR=4301)
+	IF(IMULT.EQ.1)THEN
+	    XM=HEIGHT
+	    YM=WIDTH
+	ENDIF
+C
+C	GET THE FOLLOWING COMMON BLOCKS:
+C
+C	HD
+C	MPLOT   (IMULT)
+C	PPLDAT  (IBASE AND PBUF)
+C	SWITCH  (DEFLTS AND FLAG)
+C	SYSTEM
+C	XYLABP
+C
+	READ(LMULT)IPTS,IMULT,IBASE,PBUF,DEFLTS,FLAG,ECHOF,DEBUGF,
+     *	BATCHF,ERRORF,DONEF,MEMBUF,LOGITF,QUIETF,LOGCMF,XLABS,YLABS,
+     *	RLABS,LTYPE,XLLABS,YLLABS,LLTYPE,RHLABS,USRLBS
+C
+	CALL GET(LMULT)
+	CLOSE(LMULT)
+	IF(IMULT.EQ.1)THEN
+	    HEIGHT=XM
+	    WIDTH=YM
+	ENDIF
+	CALL BAUD(IR)
+	CALL PLTYPE(ICODE)
+	CALL TKTYPE(MOD)
+	GOTO 10
+4301	IF(.NOT.QUIETF)WRITE(LTTOUT,'(1X,A30,'' NOT FOUND'')')LABEL
+	GOTO 10
+
+
+c For XFOR and YFOR, check if LABEL is a valid format: 
+c do a test write to the string err_msg, using label as a format
+c If format is (DM) then axis will be labelled with 
+c deg/min, or deg/min.ff decimal fraction of minutes.
+c****If it is XFOR(DM,ddd) then we will rotate the labes by ddd degrees.****
+
+C   RANGE_DM recomputes axis range and delta, so that it has
+C   good intervals when expressed as deg-min-sec (A previous 
+C   call to RANGE sets intervals based on degrees and decimal 
+C   fractions of degrees.) Reset only the delta, as the user may
+C   have explicitly set the lo and hi limit
+
+C     XFOR
+4400  i = STR_UPCASE (TMPCHR, LABEL(1:5))
+      i = TM_LENSTR1(LABEL) - 1
+      IF (TMPCHR(2:2) .EQ. 'D') THEN  ! degrees/mintues/seconds ?
+           IF (TMPCHR(2:3) .EQ. 'DM') THEN
+              xdms = 1
+              IF (TMPCHR(2:4) .EQ. 'DMS') xdms = 2 
+              CALL RANGE_DM(XLO,XHI,XTIC,xmn,xmx,dd)
+c              xlo = xmn
+c              xhi = xmx
+              xtic = dd
+           ELSE ! 'DD' resets to decimal degrees
+              xdms = 0
+           ENDIF
+           GOTO 10
+        ENDIF
+        xdms = 0
+        IFRX=LABEL
+        slen = TM_LENSTR(LABEL)
+        IF (slen .GT. 1) THEN
+           IF (TM_HAS_STRING( label, '(I')) THEN
+              WRITE(err_msg,label,ERR=1999) 0
+           ELSE
+              WRITE(err_msg,label,ERR=1999) 0.0
+           ENDIF
+        ENDIF
+	GOTO 10
+C     YFOR
+
+4500  i = STR_UPCASE (TMPCHR, LABEL(1:15))
+      i = TM_LENSTR1(LABEL) - 1
+      IF (TMPCHR(2:2) .EQ. 'D') THEN  ! degrees/mintues/seconds ?
+           IF (TMPCHR(2:3) .EQ. 'DM') THEN
+              ydms = 1
+              IF (TMPCHR(2:4) .EQ. 'DMS') ydms = 2 
+              CALL RANGE_DM(YLO,YHI,YTIC,ymn,ymx,dd)
+c              ylo = ymn
+c              yhi = ymx
+              ytic = dd
+           ELSE ! 'DD' resets to decimal degrees
+              ydms = 0
+           ENDIF
+           GOTO 10
+        ENDIF
+        ydms = 0
+        IFRY=LABEL
+        slen = TM_LENSTR(LABEL)
+        IF (slen .GT. 1) THEN
+           IF (TM_HAS_STRING( label, '(I')) THEN
+              WRITE(err_msg,label,ERR=1999) 0
+           ELSE
+              WRITE(err_msg,label,ERR=1999) 0.0
+           ENDIF
+        ENDIF
+	GOTO 10
+        
+C     XVALOFF
+4401  XVALOFF=P(1)
+      i = XVALOFF
+      IF (FLOAT(i) .NE. XVALOFF) THEN
+         err_msg = 'Offset must be an integer'
+         CALL ERRMSG (ferr_out_of_range, status, err_msg, *9999)
+      ENDIF
+      GOTO 10
+
+C     YVALOFF
+4501  YVALOFF=P(1)
+      i = YVALOFF
+      IF (FLOAT(i) .NE. YVALOFF) THEN
+         err_msg = 'Offset must be an integer'
+         CALL ERRMSG (ferr_out_of_range, status, err_msg, *9999)
+      ENDIF
+      GOTO 10
+
+C     ORIGIN
+4600	IF(IFLG1)XORG=P(1)
+	IF(IFLG2)YORG=P(2)
+	SYM='*PPL$XORG'
+	CALL PUTVAL(SYM,XORG,4,IER)
+	SYM='*PPL$YORG'
+	CALL PUTVAL(SYM,YORG,4,IER)
+	if(pltopn)then
+	    call setax(pplmem,pplmem_nsize,xft,yft,xlt,ylt,xht,yht,
+     .                 nmxt,nmyt,xtit,xtlt)
+     	    call scale(xft,yft,xorg,yorg,xlo,ylo)
+	endif
+	GOTO 10
+C     WINDOW
+4700	IWIND=0
+	IF(LABON) IWIND=1
+	GOTO 10
+C     METRIC
+5000	CALL METRIC
+	GOTO 10
+C     ENGLISH
+5100	CALL ENGLSH
+	GOTO 10
+C     LIMITS
+5200	CALL UPPER(LABEL,2048)
+	IF(INDEX(LABEL,'XLE').NE.0)THEN
+	    XLE=.NOT.VALOFF
+	    IF(IFLG1)CMXLE=P(1)
+	ELSE IF(INDEX(LABEL,'XEQ').NE.0)THEN
+	    XEQ=.NOT.VALOFF
+	    IF(IFLG1)CMXEQ=P(1)
+	ELSE IF(INDEX(LABEL,'XGE').NE.0)THEN
+	    XGE=.NOT.VALOFF
+	    IF(IFLG1)CMXGE=P(1)
+	ELSE IF(INDEX(LABEL,'YLE').NE.0)THEN
+	    YLE=.NOT.VALOFF
+	    IF(IFLG1)CMYLE=P(1)
+	ELSE IF(INDEX(LABEL,'YEQ').NE.0)THEN
+	    YEQ=.NOT.VALOFF
+	    IF(IFLG1)CMYEQ=P(1)
+	ELSE IF(INDEX(LABEL,'YGE').NE.0)THEN
+	    YGE=.NOT.VALOFF
+	    IF(IFLG1)CMYGE=P(1)
+	ELSE IF(INDEX(LABEL,'ZLE').NE.0)THEN
+	    ZLE=.NOT.VALOFF
+	    IF(IFLG1)CMZLE=P(1)
+	ELSE IF(INDEX(LABEL,'ZEQ').NE.0)THEN
+	    ZEQ=.NOT.VALOFF
+	    IF(IFLG1)CMZEQ=P(1)
+	ELSE IF(INDEX(LABEL,'ZGE').NE.0)THEN
+	    ZGE=.NOT.VALOFF
+	    IF(IFLG1)CMZGE=P(1)
+	ENDIF
+	GOTO 10
+C     TAXIS
+5400	ITFLG=0
+	IF(LABON)THEN
+	    IF(SYAXIS)THEN
+		ITFLG=-1
+	ELSE
+		ITFLG=1
+	    ENDIF
+	ENDIF
+	DO 5401 I=1,M
+	    IF(I.GE.3)GOTO 5402
+	    IF(IFLG(I).NE.0)X3(I)=P(I)
+5401	CONTINUE
+	GOTO 10
+5402	DO 5403 J=I,M
+	    IF(IFLG(J).NE.0)IX3(J-2)=IFIX(P(J))
+5403	CONTINUE
+	GOTO 10
+C     RDCOM
+5500	goto 10
+C     TICS
+5800	DO 5801 I=1,M
+	    IF(I.GT.4)GOTO 5802
+	    IF(IFLG(I).NE.0)X4(I)=P(I)
+5801	CONTINUE
+5802	IF(M.GE.5.AND.IFLG(5).EQ.1)ITX=P(5)
+	IF(M.GE.6.AND.IFLG(6).EQ.1)ITY=P(6)
+* The following lets the user plot small tics with PPL TICS
+	MULTICENFLAG = .FALSE.
+	GOTO 10
+C	TMIN
+5900	IF(N.NE.0)THEN
+	    IT1=LABEL(2:11)
+	    IF(ITSTRT.EQ.' ')ITSTRT=IT1
+	ENDIF
+
+C	Linux port. *jd* 12.96 F90 compiler has problem with the statement
+C	below "Invalid forward reference to 6102 detected at DT (end of stmt)"
+C	This is into an IF THEN ELSE clause.  As there is but one command 
+C	before another GOTO I have copied the code from line 6102 and 
+C	GOTO 10 right here.
+
+CCC	GOTO 6102
+	TLO=1.-DIFF(IT1,ITSTRT)/DT ! Needs to be == line 6102
+	GOTO 10
+C	TMAX
+6000	IF(N.NE.0)THEN
+	    IT2=LABEL(2:11)
+	ENDIF
+	GOTO 10
+C	TSTART
+6100	IF (IFORM(1:3).EQ.'EPI' .OR. IFORM(1:3).EQ.'BIB') THEN
+	    GOTO 10
+	ELSE
+	    IF(N.EQ.0)LABEL(2:)=IT1
+	    ITSTRT=LABEL(2:11)
+6102	    TLO=1.-DIFF(IT1,ITSTRT)/DT
+	    GOTO 10
+	ENDIF
+C	PEN
+6200	I=IFIX(P(1))
+	if (label .ne. ' ') then 
+	   call upnsquish (label,strr,end)
+	   if (strr .eq. 'SAVE') then
+	      ipen_save(i) = ipen(i)
+	      goto 6201
+	   elseif (strr .eq. 'RESTORE') then
+	      ipen(i) = ipen_save(i)
+	      goto 6201
+	   endif
+	endif
+	IF(M.LT.2.OR.IFLG(2).EQ.0)GOTO 10
+	IF(I.LT.1)I=0
+	IPEN(I)=IFIX(P(2))
+C       Do not change pen 0 to pen 19 anymore - KMS
+C       if (ipen(i) .eq. 0) ipen(i) = 19  !JD 10.16.92 [post atc] for 'PEN N,0'
+6201	GOTO 10
+C	AXLEN
+6300	IF(IFLG1)XLEN=P(1)
+	IF(IFLG2)YLEN=P(2)
+	SYM='*PPL$XLEN'
+	CALL PUTVAL(SYM,XLEN,4,IER)
+	SYM='*PPL$YLEN'
+	CALL PUTVAL(SYM,YLEN,4,IER)
+	if(pltopn)then
+	    call setax(pplmem,pplmem_nsize,xft,yft,xlt,ylt,xht,yht,nmxt,
+     *	    nmyt,xtit,xtlt)
+	    call scale(xft,yft,xorg,yorg,xlo,ylo)
+	endif
+	GOTO 10
+C	AXLABP
+6400	IF(IFLG1)LABELX=IFIX(P(1))
+	IF(IFLG2)LABELY=IFIX(P(2))
+	GOTO 10
+C	AXLINT
+6500	IF(IFLG1)LINTX=IFIX(P(1))
+	IF(IFLG2)LINTY=IFIX(P(2))
+	GOTO 10
+C	AXTYPE
+6600	IF(IFLG1)ITYPEX=IFIX(P(1))
+	IF(IFLG2)ITYPEY=IFIX(P(2))
+	GOTO 10
+C	AXLSZE
+6700	IF(IFLG1)XCSIZE=P(1)
+	IF(IFLG2)YCSIZE=P(2)
+	GOTO 10
+C	AXNSIG
+6800	IF(IFLG1)NSIGX=IFIX(P(1))
+	IF(IFLG2)NSIGY=IFIX(P(2))
+	GOTO 10
+C	AXNMTC
+6900	IF(IFLG1)NMTCX=IFIX(P(1))
+	IF(IFLG2)NMTCY=IFIX(P(2))
+	GOTO 10
+C	AXATIC
+7000	IF(IFLG1)NTICX=IFIX(P(1))
+	IF(IFLG2)NTICY=IFIX(P(2))
+	GOTO 10
+C	ROTATE
+7100	IF(LABON)THEN
+	    CALL ROTATE(90.)
+	ELSE
+	    CALL ROTATE(0.)
+	ENDIF
+	GOTO 10
+C	COMMENT COMMAND 'C'
+7200	GOTO 10
+C	BOX
+7300	IP(1)=0
+	IF(LABON)IP(1)=1
+	GOTO 10
+C	RLABS
+7400	I=IFIX(P(1))
+	IF(IFLG2)THEN
+	    RLABS(I)=P(2)
+	ELSE
+	    RLABS(I)=0.
+	ENDIF
+	GO TO 10
+C	AXSET
+7500	DO 7501 I=1,M
+7501	    IF(IFLG(I).NE.0) IAXON(I)=P(I)
+	    GOTO 10
+C	'BLANK COMMAND'
+7600	    CONTINUE
+	    GOTO 10
+C	LLABS
+7700	    IF(.NOT.IFLG1)GOTO 10
+	    I=P(1)
+	    IF(IFLG2)THEN
+		XLLABS(I)=P(2)
+		YLLABS(I)=P(3)
+	    ELSE
+		LLTYPE(I)=0
+	    ENDIF
+	    IF(M.GE.4.AND.IFLG(4).NE.0)LLTYPE(I)=P(4)
+	    GOTO 10
+C	LEV
+7800	    CALL LEV
+	    GOTO 10
+C	DATPT
+7900	    IF(IFLG1)IZTYP=P(1)
+	    IF(IFLG2)IZMRK=P(2)
+	    GOTO 10
+C	PLTNME
+*8000	    IF(N.EQ.0)THEN
+*		TEMP='ppl.meta'
+*	    ELSE
+*		TEMP=LABEL
+*	    ENDIF
+*	    CALL PLTNME(TEMP)
+*	    SYM='*PPL$PLTNME'
+*	    ISYM=LNBLK(TEMP,2048)
+*	    CALL PUTSYM(SYM,TEMP,ISYM,IER)
+*           Open a "metafile"
+*           *kms* First check if this is actually a rename
+8000        IF ( save_on_exit .AND. imgname_sent ) THEN
+               CALL FGD_SAVE_WINDOW(meta_file)
+            ENDIF
+            IF(N.EQ.0)THEN
+                meta_file='ferret.png'
+                TEMP='ferret.png'
+	    ELSE
+		meta_file=LABEL
+		TEMP=LABEL
+	    ENDIF
+*           *kms* Mark that the graphics are to be saved
+*                 and clear the active window
+            save_on_exit = .TRUE.
+            imgname_sent = .FALSE.
+            CALL OPEN_METAFILE
+	    SYM='*PPL$PLTNME'
+	    ISYM=LNBLK(TEMP,2048)
+	    CALL PUTSYM(SYM,TEMP,ISYM,IER)
+	    GOTO 10
+C	HLABS
+8100	    IF(.NOT.IFLG1)GOTO 10
+	    I=P(1)
+	    IF(IFLG2)THEN
+		RHLABS(I)=P(2)
+	    ELSE
+		RHLABS(I)=-1.0
+	    ENDIF
+	    GOTO 10
+C	CONPRE
+8200	    IF(N.EQ.0)THEN
+		CONPRE=' '
+	    ELSE
+		CONPRE=LABEL
+	    ENDIF
+	    GOTO 10
+C	CONPST
+8300	    IF(N.EQ.0)THEN
+		CONPST=' '
+	    ELSE
+		CONPST=LABEL
+	    ENDIF
+	    GOTO 10
+C	TRANSXY
+8400	    I=IFIX(P(1))
+	    IF(IFLG2)XFCT(I)=P(2)
+	    IF(M.GE.3.AND.IFLG(3).NE.0)XOFF(I)=P(3)
+	    IF(M.GE.4.AND.IFLG(4).NE.0)YFCT(I)=P(4)
+	    IF(M.GE.5.AND.IFLG(5).NE.0)YOFF(I)=P(5)
+	    IF(M.EQ.1)THEN
+		XFCT(I)=1.0
+		XOFF(I)=0.0
+		YFCT(I)=1.0
+		YOFF(I)=0.0
+	    ENDIF
+	    WRITE(SYM,997)'XFACT',I
+997	    FORMAT('*PPL$',A,'(',I3,')')
+	    CALL PUTVAL(SYM,XFCT(I),4,IER)
+	    WRITE(SYM,997)'XOFF',I
+	    CALL PUTVAL(SYM,XOFF(I),4,IER)
+	    WRITE(SYM,997)'YFACT',I
+	    CALL PUTVAL(SYM,YFCT(I),4,IER)
+	    WRITE(SYM,997)'YOFF',I
+	    CALL PUTVAL(SYM,YOFF(I),4,IER)
+	    GOTO 10
+C	MARKH
+8500	    I=IFIX(P(1))
+	    IF(IFLG2)HMARK(I)=P(2)
+	    IF(M.EQ.1)HMARK(I)=0.08
+	    GOTO 10
+C	LINFIT
+8600	    I=IFIX(P(1))
+	    IF(I.GT.LINEN.OR.LLENG(I).LE.2.OR.LINEN.GE.NLINES)THEN
+		IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *          '('' LINFIT ERROR -- NO ROOM OR LINE'',I3,
+     *          '' DOES NOT EXIST'')')
+		GOTO 10
+	    ENDIF
+	    CALL LINFIT(I,pplmem,pplmem_nsize,IBASE,PBUF)
+	    GOTO 10
+C	DFLTFNT
+8700	    IF(N.EQ.0)GOTO 10
+	    I=INDEX(LABEL,'@')
+	    DTE='@CL@'
+	    IF(I.EQ.0)THEN
+		DTE(5:)=LABEL
+	    ELSE
+		DTE(4:)=LABEL
+	    ENDIF
+	    XT=SYMWID(HLAB1,6,DTE)
+	    CONPRE=DTE(4:)
+	    GOTO 10
+C	GRID
+8800	    IF(N.EQ.0)CAY=ABS(CAY)
+	    CALL UPPER(LABEL,2048)
+	    IF(LABEL(1:1).EQ.'L')CAY=-ABS(CAY)
+	    GOTO 10
+C	TEKNME
+8900	    IF(N.EQ.0)THEN
+#ifdef unix
+                TEMP='/dev/tty'
+#else
+		TEMP='TT:'
+#endif
+	    ELSE
+		TEMP=LABEL
+	    ENDIF
+	    CALL TEKNME(TEMP)
+	    SYM='*PPL$TEKNME'
+	    ISYM=LNBLK(TEMP,2048)
+	    CALL PUTSYM(SYM,TEMP,ISYM,IER)
+	    GOTO 10
+C	ECHO
+9000	    ECHOF=LABON
+	    GOTO 10
+C	TIME
+9200	    IF(N.EQ.0)THEN
+		IAUTOT=1
+		GOTO 10
+	    ENDIF
+	    IAUTOT=0
+C
+C	GET TMIN,TMAX,TSTART FROM LABEL
+C
+C	IF NO FIRST PARAMETER SKIP TMIN PROCESSING
+C
+	    IF(M.GE.1.AND.IFLG(1).EQ.0)GOTO 9201
+	    IC=INDEX(LABEL,',')
+	    IF(IC.EQ.0)IC=buflen+1
+	    IS=INDEX(LABEL,' ')
+	    IS=MIN0(IS,IC)
+
+!*JD*	    IT1=LABEL(2:IS-1)
+	    TMPCHR = LABEL(1:IS-1)
+
+	    IF ( TMPCHR(12:12) .EQ. ' ' ) THEN
+		IT1=TMPCHR(2:11)         ! old format
+	 	IT1(11:14) = '0019'
+	    ELSE
+		IT1(1:12)=TMPCHR(4:15)   ! enhanced format
+		IF (tmpchr(11:12) .EQ. ' ') IT1(11:12)='00' 
+		IT1(13:14) = TMPCHR(2:3) ! century
+	    ENDIF
+
+	    IF(ITSTRT.EQ.' ')ITSTRT=IT1
+	    IF(IC.NE.0)IS=IS+1
+9210	    IF(LABEL(IS:IS).EQ.' ')THEN
+		IS=IS+1
+		IF(IS.GT.2048)GOTO 9203
+		GOTO 9210
+	    ELSE IF(LABEL(IS:IS).EQ.',')THEN
+		LABEL=LABEL(IS+1:)
+		GOTO 9202
+	    ELSE
+		LABEL=LABEL(IS:)
+	    ENDIF
+C
+C	IF NO SECOND PARAMETER SKIP TMAX PROCESSING
+C
+9201	    IF(M.GE.2.AND.IFLG(2).EQ.0)GOTO 9202
+	    IC=INDEX(LABEL,',')
+	    IF(IC.EQ.0)IC=buflen+1
+	    IS=INDEX(LABEL,' ')
+	    IS=MIN0(IS,IC)
+
+!*JD*	    IT2=LABEL(2:IS-1)
+	    TMPCHR = LABEL(1:IS-1)
+
+	    IF ( TMPCHR(12:12) .EQ. ' ' ) THEN
+		IT2=TMPCHR(2:11)         ! old format
+		IT2(11:14) = '0019'
+	    ELSE
+		IT2(1:12)=TMPCHR(4:15)   ! enhanced format
+		IF (TMPCHR(11:12) .EQ. ' ') IT2(11:12)='00' 
+		IT2(13:14) = TMPCHR(2:3) ! century
+	    ENDIF
+
+	    IF(IC.NE.0)IS=IS+1
+9220	    IF(LABEL(IS:IS).EQ.' ')THEN
+		IS=IS+1
+		IF(IS.GT.2048)GOTO 9203
+		GOTO 9220
+	    ELSE
+		LABEL=LABEL(IS:)
+	    ENDIF
+
+!*JD* 9202  ITSTRT=LABEL(2:11)
+9202	    TMPCHR = LABEL(1:15)
+
+	    IF ( TMPCHR(12:12) .EQ. ' ' ) THEN
+		ITSTRT=TMPCHR(2:11)         ! old format
+		ITSTRT(11:14) = '0019'
+	    ELSE
+		ITSTRT(1:12)=TMPCHR(4:15)   ! enhanced format
+		IF (TMPCHR(11:12) .EQ. ' ') ITSTRT(11:12)='00' 
+		ITSTRT(13:14) = TMPCHR(2:3) ! century
+	    ENDIF
+
+9203	    TLO=1.-DIFF(IT1,ITSTRT)/DT
+	    GOTO 10
+C	TXTYPE
+9300	    CALL UPPER(LABEL,2048)
+C
+C	IF NO FIRST PARAMETER SKIP PROCESSING
+C
+	    IF(M.GE.1.AND.IFLG(1).EQ.0)GOTO 9301
+	    IF(LABEL(1:1).EQ.'D')THEN
+		ITYPET=0
+	    ELSE IF(LABEL(1:1).EQ.'M')THEN
+		ITYPET=1
+	    ELSE
+		ITYPET=3
+	    ENDIF
+C
+C	PROCESS TIME AXIS STYLE
+C
+9301	    IF(ITYPET.EQ.0)THEN
+		IF(INDEX(LABEL,'HRD').NE.0)THEN
+		    ITXTPE=2
+		ELSE
+		    ITXTPE=1
+		ENDIF
+	    ELSE IF(ITYPET.EQ.1)THEN
+		IF(INDEX(LABEL,'DAYM').NE.0)THEN
+		    ITXTPE=2
+		ELSE
+		    ITXTPE=1
+		ENDIF
+		MONYRLAB = .FALSE.
+		IF (INDEX(LABEL,'DMY').NE.0) MONYRLAB = .TRUE.
+	    ELSE
+		IF(INDEX(LABEL,'MON1').NE.0)THEN
+		    ITXTPE=3
+		ELSE IF(INDEX(LABEL,'MONY').NE.0)THEN
+		    ITXTPE=2
+		ELSE
+		    ITXTPE=1
+		ENDIF
+
+*               Century axis mod
+	        CENFLAG = .FALSE.
+	        IF(INDEX(LABEL,'MULTIY').NE.0) CENFLAG = .TRUE.
+
+*               multi-decade axis mod
+	        MULTICENFLAG = .FALSE. 
+	        IF(INDEX(LABEL,'MULTID').NE.0) THEN
+		   CENFLAG = .TRUE. 
+		   MULTICENFLAG = .TRUE. 
+	        ENDIF
+	    ENDIF
+	    MONYRLAB = .FALSE.  ! Option for MON and DAY types. 
+	    IF (INDEX(LABEL,'DMY').NE.0) MONYRLAB = .TRUE.
+	    LABELT=ITXTPE*ITXLBP
+	    GOTO 10
+C	TXLSZE
+9400	    IF(IFLG1)TCSIZE=P(1)
+	    GOTO 10
+C	TXLINT
+9500	    IF(IFLG1)IFDB=P(1)
+	    IF(IFLG2)ISDB=P(2)
+	    GOTO 10
+C	TXNMTC
+9600	    IF(IFLG1)NMTCT=P(1)
+	    GOTO 10
+C	TXLABP
+9700	    IF(IFLG1)THEN
+		ITXLBP=P(1)
+		LABELT=ITXTPE*ITXLBP
+	    ENDIF
+	    GOTO 10
+C	AUTOLAB
+9800	    IGTLAB=0
+	    IF(LABON)IGTLAB=1
+	    GOTO 10
+C	EVAR
+9900	    CALL UPPER(LABEL,2048)
+	    LSOFFS=SOFFS
+	    LSTIME=STIME
+	    LSNEXT=SNEXT
+	    CALL EPICVAR
+	    GOTO 10
+C	DEBUG
+9910	    DEBUGF=LABON
+	    GOTO 10
+C	RESET
+9920	    LABEL='PPL$RESET'
+	    N=9
+	    GOTO 4300
+C	TITLE
+9930	    IF(N.EQ.0)THEN
+		LAB1=' '
+	    ELSE
+		LAB1=LABEL
+	    ENDIF
+	    IF(IFLG1)HLAB1=P(1)
+	    GOTO 10
+C	VPOINT
+9940	    IF(IFLG1)VIEWX=P(1)
+	    IF(IFLG2)VIEWY=P(2)
+	    IF(M.GE.3.AND.IFLG(3).NE.0)VIEWZ=P(3)
+	    WRITE(SYM,999)'X'
+999	    FORMAT('*PPL$VIEW_',A1)
+	    CALL PUTVAL(SYM,VIEWX,4,IER)
+	    WRITE(SYM,999)'Y'
+	    CALL PUTVAL(SYM,VIEWY,4,IER)
+	    WRITE(SYM,999)'Z'
+	    CALL PUTVAL(SYM,VIEWZ,4,IER)
+	    GOTO 10
+C	CLSPLT
+*           Close a metafile
+9950	    CALL PLTYPE(ICODE)
+            IF ( save_on_exit .AND. imgname_sent ) THEN
+                CALL FGD_SAVE_WINDOW(meta_file)
+            ENDIF
+            save_on_exit = .FALSE.
+            imgname_sent = .FALSE.
+            vpt_was_set = .FALSE.
+	    GOTO 10
+C	RENAMPL
+9960	    CONTINUE
+*	Close and rename the metafile; reopen.
+            IF ( save_on_exit .AND. imgname_sent ) THEN
+                CALL FGD_SAVE_WINDOW(meta_file)
+            ENDIF
+            strr = LABEL
+            CALL RENAME(strr, meta_file)
+*           *kms* Mark that the graphics are to be saved
+*                 and clear the active window
+            save_on_exit = .TRUE.
+            imgname_sent = .FALSE.
+            CALL OPEN_METAFILE
+	    GOTO 10
+C	SHRINKY
+9970	    CONTINUE
+*	Whether to shrink ylabels automatically so they will fit in margin.
+*       see YAXIS1
+            SHRINKY = .FALSE.      
+            IF (P(1) .EQ. 1) SHRINKY = .TRUE.      
+	    GOTO 10
+
+C	RIBFAST (RIBBON/FAST)  
+9980	    CONTINUE
+*	Plot style for ribbon plots: 
+*	 FAST for one color per point, default is interpolate
+*	 colors between points
+            RIBBON_FAST = .FALSE.      
+            IF (P(1) .EQ. 1) RIBBON_FAST = .TRUE.      
+	    GOTO 10
+
+C	RIBMISS (RIBBON/MISS=)  
+9990	    CONTINUE
+* Plot style for missing-data in ribbon plots: 
+* Default: thin black line. Can request /missing=dash, /missing=blank, 
+* /missing= color-palette (e.g. gray_light). The color palette 
+* will typically be a one-color plot, or if a multicolor palette 
+* is given its first color will be used.
+
+            CALL RIBBON_MISSING      
+	    GOTO 10
+
+C     RWDSEQ & RWD
+600	    CALL OPENF(FILE,IERR)
+	    IF(IERR.NE.0)GOTO 10
+	    SYM='*PPL$EOF'
+	    CALL PUTSYM(SYM,NO,2,IER)
+	    IF(IFORM(1:3).EQ.'DSF'.OR.IFORM(1:4).EQ.'BIBO'
+     *	    .OR.IFORM(1:3).EQ.'PPL')THEN
+	    CALL RWDDSF(FILE)
+	    GOTO 10
+	ELSE IF(IFORM(1:3).EQ.'EPI')THEN
+	    rewind (LUN11)
+	    GOTO 10
+	ENDIF
+	REWIND LUNN
+	GOTO 10
+C     CONTOUR
+1400	MAKEP='CONTOUR'
+	if(iflg1)then
+	    ivcomp=p(1)
+	else
+	    ivcomp=1
+	endif
+	if(iflg2)cangle=p(2)
+1401	continue
+#ifndef unix
+	IF(LOGITF)CALL LOGGER('PPLCONT')
+#endif
+	GOTO 6001
+C     PLOT
+1500	MAKEP='PLOT'
+	GOTO 6002
+C     Ribbon PLOT
+1550	MAKEP='RIBPLOT'
+	GOTO 6002
+C     READSEQ & RD
+1600	CALL OPENF(FILE,IERR)
+	IF(IERR.NE.0)GOTO 10
+	CALL RDSEQ(pplmem,pplmem_nsize,PBUF,IBASE,FILE)
+	GOTO 10
+C     LIST
+2900	CALL LIST(LTTOUT,pplmem,pplmem_nsize,LABEL)
+	GOTO 10
+C     SKPSEQ & SKP
+3300	CALL OPENF(FILE,IERR)
+	IF(IERR.NE.0)GOTO 10
+	SYM='*PPL$EOF'
+	CALL PUTSYM(SYM,NO,2,IER)
+	J=IFIX(P(1))
+	IF(M.EQ.0.OR.IFLG(1).EQ.0)J=1
+	IF(IFORM(1:3).EQ.'DSF'.OR.IFORM(1:4).EQ.'BIBO'
+     *	.OR.IFORM(1:3).EQ.'PPL')THEN
+	DO 3304 I=1,J
+	    CALL OPNDSF(FILE,'RD',LUNN)
+	    CALL RDHDSF(LUNN,1,XPTS,K)
+	    CALL CLSDSF(LUNN)
+	    IF(K.EQ.0)GOTO 3302
+3304	CONTINUE
+	ELSE IF(IFORM(1:3).EQ.'EPI')THEN
+	    CLOSE(LUNN)
+	    DO 3305 I=1,J
+		IF (LSCTD) THEN
+		    CALL EPICRD(IDUM1,IDUM1,LEOF,.FALSE.)
+		ELSE
+		    CALL EPICTRD(IDUM1,XDUM1,XDUM2,XDUM3,XDUM4,XDUM5,
+     *		    LEOF,.FALSE.)
+		ENDIF
+		IF(LEOF)GOTO 3302
+3305	    CONTINUE
+	ELSE IF(IFORM(1:3).NE.'UNF')THEN
+	    DO 3301 I=1,J
+3301	    READ(LUNN,*,END=3302)
+	ELSE
+	    DO 3303 I=1,J
+3303	    READ(LUNN,END=3302)
+	ENDIF
+	GOTO 10
+3302	IF(.NOT.QUIETF)WRITE(LTTOUT,'('' EOF'')')
+	SYM='*PPL$EOF'
+	CALL PUTSYM(SYM,YES,3,IER)
+	GOTO 10
+C	VIEW
+3400	MAKEP='VIEW'
+	IF(IFLG2)THEN
+	    XYSCLE=1
+	ELSE
+	    XYSCLE=P(2)
+	ENDIF
+	IF(IFLG1)THEN
+	    ZSCLE=P(1)
+	ELSE
+	    ZSCLE=0.
+	ENDIF
+	IF(M.GE.4.AND.(IFLG(3).NE.0.AND.IFLG(4).NE.0))THEN
+	    VEWZMN=P(3)
+	    VEWZMX=P(4)
+	    IF(ZMN.GT.ZMX)THEN
+		P1=VEWZMN
+		VEWZMN=VEWZMX
+		VEWZMX=P1
+	    ENDIF
+	ELSE
+	    VEWZMN=ZMIN
+	    VEWZMX=ZMAX
+	ENDIF
+	if(m.ge.5.and.iflg(5).ne.0)then
+	    ivcomp=p(5)
+	else
+	    ivcomp=1
+	endif
+	GOTO 1401
+C	ENTER
+3500	IF(.NOT.QUIETF)WRITE(LTTOUT,'('' ENTER X,Y OR "END"'')')
+	JTYPE=1
+	YMIN=1.E38
+	XMIN=YMIN
+	XMAX=-XMIN
+	YMAX=XMAX
+	LINEN=LINEN+1
+	CALL STPRMP('enter>',6)
+	DO 3501 I=0,pplmem_nsize-1
+3503	    CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	    IF(ICOM.EQ.'END')GOTO 3502
+	    pplmem(IBASE+I)=P(1)
+	    pplmem(pplmem_nsize/2+IBASE+I)=P(2)
+	    IF(P(1).GT.XMAX)XMAX=P(1)
+	    IF(P(1).LT.XMIN)XMIN=P(1)
+	    IF(P(2).GT.YMAX)YMAX=P(2)
+	    IF(P(2).LT.YMIN)YMIN=P(2)
+3501	CONTINUE
+3502	LLENG(LINEN)=I
+	NX=I
+	NY=1
+	CALL RDSEQ2(pplmem,pplmem_nsize,PBUF,IBASE,FILE)
+	CALL STPRMP('ppl+>',5)
+	GOTO 10
+C     MULTPLT
+4900	CALL MULT
+	GOTO 10
+C     PLOTV
+5300	MAKEP='PLOTV'
+5301	IF(IFLG(1).EQ.1)VANG=P(1)
+	GOTO 6002
+C	PLOTUV
+5700	MAKEP='PLOTUV'
+	GOTO 5301
+6002	CONTINUE
+#ifndef unix
+	IF(LOGITF)CALL LOGGER('PPLPLOT')
+#endif
+	IF(PBUF.EQ.0)THEN
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,'('' BUFF EMPTY'')')
+	    GOTO 10
+	ELSE
+	    LINEN=0
+	    IBASE=1
+	ENDIF
+6001	IF(N.NE.0)LAB1=LABEL
+	ICOUNT=ICOUNT+1
+	IF(IMULT.NE.1)THEN
+	    CALL PLTIT(pplmem,pplmem_nsize)
+	ELSE
+	    CALL MPLOT(pplmem,pplmem_nsize)
+	    IF(IMCNT.LT.MNX*MNY)GOTO 10
+#ifdef unix
+            rewind(lmult)
+#else
+	    OPEN(LMULT,FILE=MULTFL,STATUS='OLD',
+     *	    FORM='UNFORMATTED')
+#endif
+	    DO 6003 IMCNT=1,MNX*MNY
+		READ(LMULT,END=6004)IPTS,MXBOT,MYLEF
+		READ(LMULT,END=6004)XLABS,YLABS,RLABS,LTYPE,XLLABS,
+     *		YLLABS,LLTYPE,RHLABS,USRLBS
+		CALL GET(LMULT)
+		IF(JTYPE.EQ.1)THEN
+		    CALL GETXY(LMULT,pplmem,pplmem_nsize)
+		ELSE
+		    CALL GETZ(LMULT,pplmem,NX,NY)
+		ENDIF
+		IF(IZTYP.NE.0)CALL GETZG(LMULT)
+		CALL PLTIT(pplmem,pplmem_nsize)
+6003	    CONTINUE
+cc#ifdef unix
+ 6004         CLOSE(LMULT)
+cc#else
+cc6004	    CLOSE(LMULT,DISP='DELETE')
+cc#endif
+c
+c	show mult file is closed by clearing the file name
+c
+	    MULTFL=' '
+	    CALL MPLOT2(pplmem,pplmem_nsize)
+	ENDIF
+	GOTO 10
+C	VELVCT
+9100	MAKEP='VELVCT'
+	GOTO 5301
+C	VECTOR
+9110	MAKEP='VECTOR'
+	IF(IFLG1)VSKPX=P(1)
+	IF(IFLG2)VSKPY=P(2)
+	GOTO 6001
+C       FLOWLINE (VECTOR/FLOWLINE)
+9390	MAKEP='FLOW'
+	IF(IFLG1)DENSITY=P(1)
+	GOTO 6001
+C	VECSET
+9120	IF(IFLG1)VLEN=P(1)
+	IF(IFLG2)VUSRLN=P(2)
+	VAUTO=M.LT.2
+	GOTO 10
+C	VECKEY
+9130	IF(IFLG1)VXLOC=P(1)
+	IF(IFLG2)VYLOC=P(2)
+	IF(M.GE.3.AND.IFLG(3).NE.0)VPOS=P(3)
+	IF(N.GT.0)THEN
+           VFRMT=LABEL
+c Check if LABEL is a valid format: 
+c do a test write to the string err_msg, using label as a format
+           slen = TM_LENSTR(LABEL)
+           IF (slen .GT. 1) THEN 
+              IF (TM_HAS_STRING( label, '(I')) THEN
+                 WRITE(err_msg,label,ERR=1999) 0
+              ELSE
+                 WRITE(err_msg,label,ERR=1999) 0.0
+              ENDIF
+           ENDIF
+        ENDIF
+	VUSER=SUSER
+	VKEY=M.GE.2
+	GOTO 10
+c	usr
+9140	temp2=' '
+	call pplusr(label,ier,temp2)
+	IF(ier.ne.0)then
+	    ilen=lnblk(temp2,80)
+	    temp='USR: '//temp2(:ilen)
+	    if(.not.quietf)WRITE(LTTOUT,'(a)')temp(:ilen+5)
+	    temp2='C '//temp(:ilen+5)
+	    call echo(temp2,ilen+7)
+	endif
+	goto 10
+C	SHADE
+9150    MAKEP = 'SHADE'                                                       
+        IF(N.NE.0)LAB1=LABEL                                                  
+        ICOUNT=ICOUNT+1                                                       
+        IF(IMULT.NE.1)THEN                                                    
+            CALL PLTIT(pplmem,pplmem_nsize)                                               
+        ELSE                                                                  
+            CALL MPLOT(pplmem,pplmem_nsize)                                               
+            IF(IMCNT.LT.MNX*MNY)GOTO 10                                       
+            OPEN(LMULT,FILE=MULTFL,STATUS='OLD',                              
+     *      FORM='UNFORMATTED')                                               
+            DO 9151 IMCNT=1,MNX*MNY                                           
+            READ(LMULT,END=9152)IPTS,MXBOT,MYLEF                              
+	    READ(LMULT,END=9152)XLABS,YLABS,RLABS,LTYPE,XLLABS,YLLABS,LLTYPE, 
+     *	    RHLABS,USRLBS                                                     
+            CALL GET(LMULT)                                                   
+            IF(JTYPE.EQ.1)THEN                                                
+                CALL GETXY(LMULT,pplmem,pplmem_nsize)                                     
+            ELSE                                                              
+                CALL GETZ(LMULT,pplmem,NX,NY)                                      
+            ENDIF                                                             
+            IF(IZTYP.NE.0)CALL GETZG(LMULT)                                   
+            CALL PLTIT(pplmem,pplmem_nsize)                                               
+9151        CONTINUE    
+9152        CLOSE(LMULT)
+ 
+cc#ifdef FORTRAN_90                                           
+cc9152        CLOSE(LMULT,STATUS='DELETE')                             c
+cc#else
+cc9152        CLOSE(LMULT,DISP='DELETE')                             
+cc#endif
+c                                                                  
+c       show mult file is closed by clearing the file name         
+c                                                                  
+            MULTFL=' '                                             
+            CALL MPLOT2(pplmem,pplmem_nsize)                                   
+        ENDIF                                                      
+        GOTO 10                                                    
+C       SHAKEY                                                     
+9160    call shade_key                                             
+        goto 10                                                    
+C       SHASET                                                     
+9170    call shade_set                                             
+        goto 10
+                                                 
+C       S_KEY   (continuous color key)                                                   
+9165    ICODE=IFIX(P(1))
+        call shade_key_cont (ICODE)
+        call shade_key                                           
+        goto 10       
+                                
+C       SHADE_CELL   (use cellarray call for shade)                                                   
+9166    ICODE=IFIX(P(1))
+        call shade_cell (ICODE)
+        goto 10       
+
+c       area
+*!9171 makep='AREA' NAME CHANGE *jd*
+9171   makep='FILL'
+        if(iflg1)then
+            ivcomp=p(1)
+        else
+            ivcomp=1
+        endif
+        if(iflg2)cangle=p(2)
+        GOTO 6001
+
+ 9172	makep='PLOTPOL'
+        if(iflg1)then
+            ivcomp=p(1)
+        else
+            ivcomp=1
+        endif
+        if(iflg2)cangle=p(2)
+        GOTO 6001
+
+ 9173	makep='FILLPOL'
+        if(iflg1)then
+            ivcomp=p(1)
+        else
+            ivcomp=1
+        endif
+        if(iflg2)cangle=p(2)
+        GOTO 6001
+
+ 9183	makep='FILLPOL'   ! makep='POLYGON'
+        if(iflg1)then
+            ivcomp=p(1)
+        else
+            ivcomp=1
+        endif
+        if(iflg2)cangle=p(2)
+        GOTO 6001
+
+ 9174	call pattern_set
+	goto 10
+
+C  calendar
+ 9175	if(n.eq.0)then
+	   set_name='GREGORIAN'
+	else
+	   set_name=label
+	endif
+
+	call tm_set_current_calendar (set_name, cal_status)
+	if (cal_status .ne. merr_ok) GOTO 2999
+	goto 10
+
+#ifdef unix
+9180    continue
+#else
+9180    call pixmap                                             
+#endif
+        goto 10                                                    
+9190	call aline (pplmem,pplmem_nsize)
+	goto 10
+c COLOR
+9191    call set_one_color
+        goto 10
+c LINECOLORS
+9192    call set_num_linecolors
+        goto 10
+c sqfill
+ 9380   if(labon)sqfflg=.true.
+        if(VALOFF .or. n.eq.0)sqfflg=.false.
+        goto 10
+9999	RETURN
+
+c Format errors
+1999    slen = TM_LENSTR1(LABEL)
+        err_msg = 'Invalid format specification: '//LABEL(1:slen)
+        CALL errmsg (ferr_out_of_range, status, err_msg, *9999)
+
+c Calendar errors
+2999    slen = lnblk (set_name,16)
+	WRITE (err_msg, 9176) set_name(1:slen)
+ 9176	FORMAT('Calendar "',a, '" is invalid.')
+        CALL errmsg (ferr_unknown_arg, status, err_msg, *9999)
+
+
+	END
+	SUBROUTINE OPENF(FILE,IER)
+c  If format is EPIC:
+c  Opens EPIC file on unit=11 if label is not blank.
+c  Returns logical variable lepic in COMMON/COMEPL/ as true or false
+c  to indicate whether this is an EPIC file or simply a pointer file.
+c
+c  Programmed by N Soreide, Jun 85.
+c  Modified for pointer file, Oct 85.
+c  Patched up Feb 88
+c
+	character line*132
+
+*       Declarations added 9.6.88 J Davison          
+        integer ier,isym,lnblk,i,ix                  
+                                                     
+        external lnblk                               
+*       End declarations 9.6.88                      
+
+c
+c
+c  Get EPIC (RIM) file with data file names
+c
+	include 'comepl_inc.decl'
+	include 'COMEPL.INC'
+	include 'epiclun_inc.decl'
+	include 'EPICLUN.INC'
+	include 'data_inc.decl'
+	include 'DATA.INC'
+	include 'cmrd_inc.decl'
+	include 'CMRD.INC'
+	include 'cmrdl_inc.decl'
+	include 'CMRDL.INC'
+	include 'lunits_inc.decl'
+	include 'LUNITS.INC'
+	include 'system_inc.decl'
+	include 'SYSTEM.INC'
+
+	CHARACTER FILE*(*),SYM*120
+	IER=0
+	IF(N.EQ.0)THEN
+	    IF(FILE.EQ.' ')THEN
+		IF(.NOT.QUIETF)WRITE(LTTOUT,999)
+999		FORMAT(' NO FILE')
+		IER=1
+	    ELSE IF(IFORM(1:3).EQ.'EPI')THEN
+		CLOSE(LUN1)
+	    ENDIF
+	ELSE
+	    SYM='*PPL$INPUT_FILE'
+	    ISYM=LNBLK(LABEL,2048)
+	    CALL PUTSYM(SYM,LABEL,ISYM,IER)
+	    CLOSE(LUNN)
+#ifdef unix
+            FILE=LABEL
+#else
+	    I=INDEX(LABEL,':')
+	    IF(I.LE.0)THEN
+		FILE='SY:'
+		FILE(4:)=LABEL
+	    ELSE
+		FILE=LABEL
+	    ENDIF
+#endif
+	    IF(IFORM(1:3).EQ.'DSF'.OR.IFORM(1:3).EQ.'BIB'
+     *	    .OR.IFORM(1:3).EQ.'PPL')THEN
+	        RETURN
+	    ELSE IF(IFORM(1:3).EQ.'EPI')THEN
+C
+c  		Open EPIC file to read data file names
+c
+	    CLOSE(LUN1)
+	    CLOSE(LUN11)
+#ifdef unix
+            open (unit=LUN11, form='formatted', status='old',
+     1      file=FILE,err=100 )
+#else
+open (unit=LUN11, form='formatted', status='old',
+     1	    readonly,file=FILE,err=100 )
+#endif
+c
+c  Check whether this is EPIC file or other pointer file.
+c
+	    read (LUN11, 102) line
+102	    format (a)
+	    ix = index (line(1:132), 'EPIC')
+	    if (ix .ne. 0 .or. line(1:1).eq. ' ')then
+		lepic = .true.
+	    else
+		lepic = .false.
+	    endif
+	    rewind (LUN11)
+	ELSE IF(IFORM(1:3).NE.'UNF')THEN
+#ifdef unix
+            OPEN(UNIT=LUNN,FILE=FILE,STATUS='OLD',ERR=100)
+        ELSE
+            OPEN(UNIT=LUNN,FILE=FILE,STATUS='OLD',ERR=100,
+     *      FORM='UNFORMATTED')
+#else
+	    OPEN(UNIT=LUNN,FILE=FILE,STATUS='OLD',ERR=100,READONLY)
+	ELSE
+     	    OPEN(UNIT=LUNN,FILE=FILE,STATUS='OLD',ERR=100,READONLY,
+     *	    FORM='UNFORMATTED')
+#endif
+	ENDIF
+	ENDIF
+	RETURN
+100	IER=2
+	IF(.NOT.QUIETF)WRITE(LTTOUT,998)FILE
+998	FORMAT(1X,A30,' NOT FOUND')
+	RETURN
+	END
diff --git a/ppl/plot/ppldata.F b/ppl/plot/ppldata.F
new file mode 100644
index 0000000..d6dc2ed
--- /dev/null
+++ b/ppl/plot/ppldata.F
@@ -0,0 +1,237 @@
+	BLOCK DATA PPLDAT
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)ppldata.F	1.2    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	LIST OF INCLUDES FOR PPLUS
+C
+C     Mod *JD* 3.5.91 Change output unit for terminal to 6 from 5 --
+C     problem with buffered outout in unix -- see opnppl
+C     Mod *jd* 1.10.95 To DATA KEYLN1,KEYLN2 (line 201) at *sh* request
+C     for compatibility with Ferret use of symbols.
+* V510 4/99 *jd* increased initialization sizes for bigger NLINES
+* V510 9/99 *sh* increased initialization sizes for bigger NLINES
+*      3/00 *sh* reduceded initialization sizes for NLINES variables
+* 		(except lleng())
+* V610 2/08 *acm*increase default number of contour levels to NLEV=40 (MODE NLEVELS)
+* V610 2/08 *acm*keep default number of contour levels to old value of NLEV=10 
+*                If this is changed, also change it in fer/dat/xprog_state_data.F
+* V62  2/08 *acm*increase default number of contour levels to NLEV=30 (MODE NLEVELS)
+*                If this is changed, also change it in fer/dat/xprog_state_data.F
+
+	INCLUDE 'PARAMPL5.DAT'
+	include 'axis_inc.decl'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'AXLWID.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMDCOM.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'COMEPL.INC'
+	INCLUDE 'COMEPV.INC'
+	INCLUDE 'CONLAB.INC'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+	INCLUDE 'DASHZZ.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'DSFSVE.INC'
+	INCLUDE 'EPICLUN.INC'
+	INCLUDE 'FILNAM.INC'
+	INCLUDE 'GKSCM1.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'MPLOT.INC'
+	INCLUDE 'MPLOTS.INC'
+	INCLUDE 'MPLOTX.INC'
+	INCLUDE 'PEN.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'PLTL.INC'
+	INCLUDE 'PPLDAT.INC'
+	INCLUDE 'SWITCH.INC'
+	INCLUDE 'SYMKEY.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'TICS.INC'
+	INCLUDE 'TICS2.INC'
+	INCLUDE 'XYLABP.INC'
+	INCLUDE 'vector_inc.decl'
+	INCLUDE 'VECTOR.INC'
+	INCLUDE 'VIEW.INC'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'ZGRIDD.INC'
+C
+	DATA XLO,XHI,XTIC,XLEN,XCSIZE,IAUTOX,ITYPEX/3*0.,8.,.10,1,1/
+	DATA NMTCX,LINTX,LABELX,NSIGX,NTICX,XORG/0,2,-1,2,5,1.4/
+	DATA YLO,YHI,YTIC,YLEN,YCSIZE,IAUTOY,ITYPEY/3*0.,6.0,.10,1,1/
+	DATA NMTCY,LINTY,LABELY,NSIGY,NTICY,YORG/0,2,-1,2,5,1.2/
+	DATA IAXON/4*1/
+	DATA SHRINKY/.FALSE./
+C
+	DATA IFRX,IFRY,IT1,IT2,ITSTRT,ITMIN,ITMAX/2*' ',
+     *	5*'71010100000019'/ 
+C
+	DATA P,M,N,IFLG/20*0.,22*0/ 
+C
+	DATA ECHLUN,CMDLUN/23,24/
+C
+	DATA ICOM,LABEL,IFORM,STRING/2*' ','(3F10.2)',' '/
+C
+	DATA IEFLG/0/
+C
+	DATA CONPRE,CONPST/' ',' '/
+C
+C
+c*	DATA ZLEV,LDIG,LWGT,LCLR,NLEV,HGT/500*0.0,1500*0,40,.08/
+c*	DATA ZLEV,LDIG,LWGT,LCLR,NLEV,HGT/500*0.0,1500*0,10,.08/
+	DATA ZLEV,LDIG,LWGT,LCLR,NLEV,HGT/500*0.0,1500*0,30,.08/
+	DATA NARC,IAUTOC,NLEV2,NSIGC,CANGLE,IVCOMP/1,1,0,2,0.0,1/
+C
+	DATA DASHLN,SPACLN,DSLAB/.04,.04,5.0/
+C
+	DATA ITYPEZ,JX,JY,JZ,LUNN,LINEN,NREC/0,1,2,0,1,0,1/
+	DATA NVAR,NGRP,CAY,NRNG/2,1,5.0,5/
+C
+	DATA LUN1,LUN11,LUN21/1,11,21/
+C
+	DATA WSID,CONID,WSTYPE,ERRFIL/1,0,0,0/
+	DATA CHDEV,CHPET,LCDEV,LCPET/1,1,1,3/
+	DATA WKSAUT/.TRUE./
+C
+	DATA IPLOT,IPAUSE,IHDCPY/1,1,0/ 
+C
+	DATA XPTS,ZMIN,ZMAX,ZMEAN,XMIN,XMAX/6*0.0/
+	DATA NX,YMIN,YMAX,NY,JTYPE/1,2*0.0,1,1/
+C
+	DATA HLAB1,HXLAB,HYLAB,HLABS/.16,3*.12/ 
+	DATA ICOUNT,NLAB,ICROSS,IGTLAB/3*0,1/
+C
+C	FOR NLABS = 50
+C
+	DATA LAB1,XLAB,YLAB,LABS/3*' ',50*' '/
+C
+C	FOR NLINES=200 ! 3/00 *sh*
+C
+	DATA IMARK/0,2,4,18,20,22,26,28,30,48,190*0/
+	DATA HMARK,ITYPE/200*0.08,0,9*4,190*0/
+	DATA XOFF,YOFF,XFCT,YFCT/201*0.,201*0.,201*1.0,
+     .						   201*1.0/
+	DATA DN1/3*.15,.05,3*.15,.2,.1,.1,190*.15/
+	DATA UP1/3*.1,.05,.05,.15,.05,.1,.05,.1,190*.1/
+	DATA DN2/.15,.15,5*.05,3*.1,190*.15/
+	DATA UP2/3*.1,.05,.15,.05,.05,.1,.05,.1,190*.1/
+	DATA LLENG,LNUM,IWIND/100000*0,1,0/   ! lleng(NPOLYGON)
+	DATA IPEN,IP/201*1,0,1,2*0/
+
+C
+C       Mod *JD* 3.91 to set default tty output to unit 6, not 5
+C	DATA LTTOUT,LMULT/5,6/ original
+	DATA LTTOUT,LMULT/6,5/
+C
+	DATA CMXLE,CMXEQ,CMXGE/0.,0.,1.E35/
+	DATA XLE,XEQ,XGE/.FALSE.,.FALSE.,.TRUE./
+	DATA CMYLE,CMYEQ,CMYGE/0.,0.,1.E35/
+	DATA YLE,YEQ,YGE/.FALSE.,.FALSE.,.TRUE./
+	DATA CMZLE,CMZEQ,CMZGE/0.,0.,1.E35/
+	DATA ZLE,ZEQ,ZGE/.FALSE.,.FALSE.,.TRUE./
+C
+	DATA MNX,MNY,IMULT,IMCNT,DXM,DYM/4*0,10*1.4,10*1.2/
+	DATA XLENM,YLENM,IXM,IYM,MXBOT,MYLEF/10*5.5,10*4.,2*0,2*0/
+C
+	DATA ICODE,WIDTH,HEIGHT,MOD,IR,LUN/3,10.0,8.0,4010,110,8/
+C
+	DATA IBASE,PBUF/1,0/
+C
+	DATA NFLAGS/20/
+	DATA SWITCH/'ECHO', 'DEBUG', 'OVERLAY','ERASE',
+     *		    'WAIT','CENTER',   'RIGHT', 'LEFT',
+     *		    'USER', 'LATCH',   'QUIET',  'LOG',
+     *		   'YAXIS',  'TIME',  'OFFSET',  'CTD',
+     *		    'NEXT','VECTOR',    'LINE',  'FILL'/
+	DATA SMIN/       2,       1,         2,      2,
+     *			 1,       1,         1,      2,
+     *			 1,       2,         1,      2,
+     *		         1,	  1,         2,      1,
+     *			 2,       2,       2*0/
+	DATA DEFLTS/.FALSE.,  .FALSE.,  .FALSE., .TRUE.,
+     *		     .TRUE.,  .FALSE.,  .FALSE., .TRUE.,
+     *		     .TRUE.,  .FALSE.,  .FALSE.,.FALSE.,
+     *		    .FALSE.,  .FALSE.,   .TRUE.,.FALSE.,
+     *		    .FALSE.,  .FALSE.,2*.FALSE./
+C
+C*** Mod 1.10.95 *** DATA KEYLN1,KEYLN2/21,22/
+	DATA KEYLN1,KEYLN2/45,46/
+C
+	DATA ECHOF,DEBUGF,SMKEY2,LOGITF/.TRUE.,.FALSE.,.FALSE.,.FALSE./
+	DATA QUIETF,LOGCMF/.FALSE.,.FALSE./
+C
+	DATA TLO,DT,TCSIZE,ITYPET/1.,1440.,.10,3/
+	DATA NMTCT,LABELT,IFDB,ISDB,ITFLG/0,-1,1,1,0/
+	DATA VANG,IVFLG,IAUTOT/0.,0,1/ 
+C
+	DATA TSMX,TLX,TSMY,TLY,IX,IY/.125,.25,.125,.25,0,0/ 
+C
+	DATA ITX,ITY/2*-1/
+C
+C	FOR NLABS = 50
+C
+	DATA XLABS,YLABS,RLABS/50*1.E35,100*0.0/
+	DATA LTYPE,XLLABS,YLLABS,LLTYPE/50*-1,100*0.0,50*0/
+	DATA RHLABS/50*-1.0/
+C
+	DATA VAUTO,VUSER,VKEY/.TRUE.,.TRUE.,.FALSE./
+	DATA VLEN/0.5/
+	DATA VFRMT/'(1PG10.3)'/
+	DATA VPOS/-1/,VXLOC,VYLOC/0.,0./
+	DATA VSKPX,VSKPY/1,1/
+	DATA VMINLN,ARMAX,ARMIN,HFACT/.01,0.5,0.1,0.25/
+C
+	DATA IZTYP,IZMRK,IZLEN/3*0/
+C
+	END
diff --git a/ppl/plot/pplldc.F b/ppl/plot/pplldc.F
new file mode 100644
index 0000000..b39e112
--- /dev/null
+++ b/ppl/plot/pplldc.F
@@ -0,0 +1,221 @@
+	SUBROUTINE PPLLDC(K,Z,MX,MY,IMN,IMX,JMN,JMX,
+     *		PI,PJ,NX1,NY1,XMIN1,YMIN1,DX1,DY1,pplmem)
+#ifdef double_p
+	REAL*8 PI(*),PJ(*),Z(MX,MY),DX1,DY1
+#else
+	REAL PI(*),PJ(*),Z(MX,MY)
+#endif
+	REAL pplmem(*)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pplldc.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C              Mod *sh* 4.1.91 Bug fix in PPLLDV fixed, see below
+C              Mod *sh* 5.15.91 dx,dy put into common block
+C              Mod *sh* 3.7.97 *sh* replace limits if curvilinear plot
+* V54 *acm*9/01 - changes for dynamic pplus buffer, call PPLLDC via pplldc_envelope.c
+*                  which checks pplmem_nsize (new name for NSIZE) and allocates 
+*                  more if needed.
+*      *acm* 10/01  remove VMS includes* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+c
+c	k	=0 already on an equally spaced rectangular grid
+c		=1 on a unequally spaced, but rectangular grid
+c	z	input array
+c	mx	dimensioned x size of z(mx,my)
+c	my	dimensioned y size of z
+c	imn	initial x index value
+c	imx	final x index value
+c	jmn	initial y index value
+c	jmx	final y index value
+c	pi	x positions pi(mx)
+c	pj	y positions pj(my)
+c	nx1	number of x grid points in output buffer
+c	ny1	number of y grid points in output buffer
+c	xmin1	position of 1,1 in output grid
+c	ymin1	position of 1,1 in output grid
+c	dx	spacing of x grid points in output buffer
+c	dy	spacing of y grid points in output buffer
+C
+C
+C
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'ZGRIDD.INC'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'PPLDAT.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+	LOGICAL		ITS_CURVILINEAR
+	REAL		xmn, xmx, ymn, ymx
+
+	COMMON/LDDXDY/ DX,DY
+C
+	call rsmnmx
+	JTYPE=0
+	NX=NX1
+	NY=NY1
+	DX=DX1
+	DY=DY1
+	XMIN=XMIN1
+	YMIN=YMIN1
+	IF(K.EQ.1)THEN
+	    JTYPE=2
+	    XMIN=PI(1)
+	    XMAX=PI(MX)
+	    YMIN=PJ(1)
+	    YMAX=PJ(MY)
+	    NX=MX
+	    NY=MY
+	    DO 100 I=IMN,IMX
+	    DO 100 J=JMN,JMX
+100		pplmem(NX*(J-1)+I)=Z(I,J)
+	    IV=NX*NY
+	    DO 101 I=1,NX
+101		pplmem(IV+I)=PI(I)
+	    IV=IV+NX
+	    DO 102 J=1,NY
+102		pplmem(IV+J)=PJ(J)
+C
+	ELSE
+C
+C	DATA ALREADY GRIDDED
+C
+	    NX=IMX-IMN+1
+	    NY=JMX-JMN+1
+	    XMAX=XMIN+DX*(NX-1)
+	    YMAX=YMIN+DY*(NY-1)
+	    I=0
+	    DO 400 II=IMN,IMX
+	    I=I+1
+	    J=0
+	    DO 400 JJ=JMN,JMX
+	    J=J+1
+	    pplmem(NX*(J-1)+I)=Z(II,JJ)
+400	    CONTINUE
+	ENDIF
+	linen=0
+*
+* for a curvilinear plot the apparent min/max, which are in fact the min/max
+* index values, are wrong -- set symbols based on the true axis ranges
+	IF ( ITS_CURVILINEAR() ) THEN
+	   CALL GET_CURVILINEAR_LIMITS( xmn, xmx, ymn, ymx )
+	   call stmnmx(pplmem,pplmem_nsize,xmn,xmx,ymn,ymx)
+	ELSE
+	   call stmnmx(pplmem,pplmem_nsize,xmin,xmax,ymin,ymax)
+	ENDIF
+
+	RETURN
+        end
+
+	SUBROUTINE PPLLDV(K,Z,MX,MY,IMN,IMX,JMN,JMX,pplmem)
+!	ENTRY PPLLDV(K,Z,MX,MY,IMN,IMX,JMN,JMX)
+! ... start of copied from pplldc
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'ZGRIDD.INC'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'PPLDAT.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'DATA.INC'
+
+        REAL pplmem(*)
+
+#ifdef double_p
+	REAL*8 Z(MX,MY)
+#else
+	REAL Z(MX,MY)
+#endif
+
+	COMMON/LDDXDY/ DX,DY
+! ... end of copied from pplldc
+
+C
+C	LOAD THE SECOND SET OF GRID INFORMATION FOR VECTOR PLOTS
+C	OR FIRST SET OF COORDINATES FOR CURVILINEAR PLOTS
+C
+	IF(.NOT.(JTYPE.EQ.0.OR.JTYPE.EQ.2))RETURN
+	call rsmnmx
+	JTYPE=-1
+	IVLEN=NX*NY
+	IF(K.EQ.1)THEN
+	    JTYPE=-2
+	    IVLEN=NX*NY+NX+NY
+	    DO 500 I=IMN,IMX
+	    DO 500 J=JMN,JMX
+500	    pplmem(IVLEN+NX*(J-1)+I)=Z(I,J)
+	    IV=IVLEN+NX*NY
+	    DO 501 I=1,NX
+!501	    pplmem(IV+I)=PI(I)           ! illegal use of PI (not passed)
+501	    pplmem(IV+I)=pplmem(NX*NY+i) ! reuse coords from PPLLDC
+	    IV=IV+NX
+	    DO 502 J=1,NY
+!502	    pplmem(IV+J)=PJ(J)              ! illegal use of PJ (not passed)
+502	    pplmem(IV+J)=pplmem(NX*NY+nx+j) ! reuse coords from PPLLDC
+	ELSE
+C
+C	DATA ALREADY GRIDDED
+C
+	    NX=IMX-IMN+1
+	    NY=JMX-JMN+1
+	    XMAX=XMIN+DX*(NX-1)
+	    YMAX=YMIN+DY*(NY-1)
+	    I=0
+	    DO 700 II=IMN,IMX
+	    I=I+1
+	    J=0
+	    DO 700 JJ=JMN,JMX
+	    J=J+1
+	    pplmem(IVLEN+NX*(J-1)+I)=Z(II,JJ)
+700	    CONTINUE
+	ENDIF
+	linen=0
+	call stmnmx(pplmem,pplmem_nsize,xmin,xmax,ymin,ymax)
+	RETURN
+	END
diff --git a/ppl/plot/pplldx.F b/ppl/plot/pplldx.F
new file mode 100644
index 0000000..95cfe07
--- /dev/null
+++ b/ppl/plot/pplldx.F
@@ -0,0 +1,431 @@
+      subroutine pplldx(icode,xt,yt,npts,tstrt,tref,xdt,pplmem)
+
+
+C**
+C**    @(#)pplldx.F	1.2    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+c
+c	icode	0 use both x and y
+c		1 use x only
+c		2 use y only
+c
+c                  When saving polygon data, save npts per polygon with 
+c                  the data, not in the array lleng(): unlimited # polygons
+
+c               3 use both x and y, for polygons 
+c		4 use x only, for polygons
+c		5 use y only, for polygons
+c
+c	xt	x data
+c	yt	y data
+c	npts	number of xt and yt points
+c	tstrt	start time, corresponds to a value of xt=1.0
+c 	tref	added 11.95, a reference time (~tstart) ferret will set
+c	xdt	sample rate in minutes for x
+c	pplmem  data buffer for PPLUS data
+c
+c	tstrt and xdt are used only for TAXIS,ON.
+c
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*............. I changed the logicals on the includes - no impact ...sh
+* revised for FERRET
+* from PPLUS :
+
+*	Directory PMEL:[PLOT5.LIBRARY.PLOT]
+
+*	PPLLDX.FOR;1              7  25-AUG-1987 15:24
+
+* search for "FERRET" to find all revisions
+* *sh* 9/21/88 - rev 1.0 for FERRET 1.10+
+*	- extensive changes to code that determines time axis limits
+*	  previous version was based on a "minutes since 1970" calculation
+*	  that blew up on dates preceeding 1970.  Replaced with a "minutes
+*	  since BC" calculation
+* *sh* 2/20/89- rev 1.1 for FERRET 1.20
+*	- corrected bug in FERRET code: tmin,tstop calculation for linen>1
+*	- reference ALL time axes to the same T0='0101010000' date
+*	  instead of using T0 from first line (else overlays don't work)
+*       - added LIMITS screening - permitting different bad data indicators
+*	  in each data set
+* Note: calling PPLLDX modifies the XEQ and YEQ limits
+*	Mod *jd* 12.23.92 for MAC FERRET to change 8 args to 6 in stmnmx call
+* *sh* 10/25/93 - for version 3.01 of FERRET
+*	- corrected bug if Y axis was the time axis - data was not put through
+*	  the time/date translation pipeline
+* *sh*jd* 7.31.95 
+*	- Fixes bug where small axis ranges result in round off error 
+*	  creation.  Use TRANSLATE to catch.
+* *jd* 11.27.95 Mod for 4 digit year
+* *jd* 11.28.95 Add additional arg "tref" so reference time can be set
+*	        by Ferret, now that 1901 is insufficient
+* *jd* 11.30.95 Fix bug (again? see 10/25/93) where Y axis time axis
+*		limits are not computed
+* V510 *sh* 3/00 - allow loading of up to NPOLYGON lines (instead of NLINES)
+*		 - the X or Y inputs no longer both flagged as bad if either is
+* V540 *acm*9/01 - changes for dynamic pplus buffer, call PPLLDX via pplldx_envelope.c
+*                  which checks pplmem_nsize (new name for NSIZE) and allocates 
+*                  more if needed.
+*      *acm* 10/01 Remove VMS includes
+* V541 *acm*  4/02 Explicitly set itstart to be all 14 character places of tref:
+*                  itstrt = tref(1:14) Otherwise we only get the first 10 (why??)
+* V553 *acm*  6/03  For polygons, store the # of points in each polygon in the PPLUS
+*                   memory buffer, rather than in lleng.  This way the number of
+*                   polygons that may be plotted is unlimited. Mark this with the
+*                   value of icode (first argument to pplldx_envelope)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+*      *kms* 5/12 Always use generic REAL instead of specific SNGL 
+*                 (SNGL must have a double-precision or complex argument)
+
+* FERRET 9-21-88: replaced include files to make all declarations explicit
+! original:
+
+!	include 'pplinc:parampl5.dat'
+!	include 'pplinc:hd.inc'
+!	include 'pplinc:lines.inc'
+!	include 'pplinc:data.inc'
+!	include 'pplinc:axisl.inc'
+!	include 'pplinc:taxis.inc'
+!	include 'pplinc:cmrdl.inc'
+!	include 'pplinc:ppldat.inc'
+
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'cmrdl_inc.decl'
+	include 'CMRDL.INC'
+	include 'data_inc.decl'
+	include 'DATA.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	include 'PPLDAT.INC'
+
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+
+* 	Add external stmt for linux port
+	external range
+
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+c
+! original:
+!	dimension xt(*),yt(*),stop(3),temp(3),start(3)
+!	character tstrt*10
+!	integer*4 mtmin,tstart,tstop,time,tmin
+
+        REAL pplmem(*)
+
+#ifdef double_p
+	REAL*8 xt(*),yt(*), xdt
+#else
+	REAL xt(*),yt(*), xdt
+#endif
+	CHARACTER BC2WHOI*14, tstrt*(*), tref*(*)
+	REAL*8 	  WHOI2BC, tstart,tstop,time,tmin
+	INTEGER	icode, npts, i, ix, iy
+	REAL	DIFF, off, rate, xs, ys
+	LOGICAL  TM_FPEQ_SNGL
+	LOGICAL  flip			!  FERRET mod 10/93
+
+	REAL	    bad_flag
+	PARAMETER ( bad_flag = -3.E33 )
+
+	logical	translate 
+
+* end of 9-21 FERRET declaration changes
+
+* mod to SAVE certain variables *jd* 6.5.91
+        SAVE        tstart,tmin,tstop
+
+c
+	if(linen.eq.0)call rsmnmx
+	linen=linen+1
+	jtype=1
+	nx=npts
+	ny=1
+	flip = itflg .EQ. -1		!  FERRET mod 10/93
+
+
+
+**	if(ABS(itflg).eq.1)then		!  FERRET mod 10/93  "ABS"
+
+	translate = ABS(itflg).eq.1
+	if (translate) then	
+c
+c	time axis is on.
+c ** acm mod 9/01  Compare tref(1:1) rather than just tref. After
+c **               passing thru c routine, a blank tref is somehow different??
+
+	    if(linen.eq.1)then
+		iform='LDX'
+		if(iautot.eq.1 .AND. tref(1:1).NE.' ') itstrt=tref(1:14) 
+	    endif		
+c
+c	calculate offset and rate for time data
+c
+	    off=diff(itstrt,tstrt)/dt+1.0
+	    rate=xdt/dt
+**	else
+**	    off=1.0
+**	    rate=1.0
+	endif
+c
+c	load data
+c
+	ix=ibase-1
+	iy=ix+pplmem_nsize/2
+	if(icode.eq.0 .OR. icode.EQ.3) THEN
+	    do 100 i=1,npts
+	        xs = REAL(xt(i))
+	        ys = REAL(yt(i))
+* FERRET mod 10/93 - apply transformation to Y data
+* FERRET mod  3/00 - screen X and Y separately for missing values
+	        IF ( flip ) THEN
+
+	          IF ( yeq .AND. TM_FPEQ_SNGL(ys,cmyeq) ) THEN
+	             pplmem(iy+i) = bad_flag
+
+		  elseif (translate) then
+		     pplmem(iy+i)=(yt(i)-1.0)*rate+off
+		  else
+		     pplmem(iy+i)=yt(i)
+		  endif
+
+	          IF ( xeq .AND. TM_FPEQ_SNGL(xs,cmxeq)) THEN
+	             pplmem(ix+i) = bad_flag
+	          ELSE
+		     pplmem(ix+i)=xt(i)
+	          ENDIF
+
+	        ELSE
+	          IF ( yeq .AND. TM_FPEQ_SNGL(ys,cmyeq) ) THEN
+	             pplmem(iy+i) = bad_flag
+	          ELSE
+		     pplmem(iy+i)=yt(i)
+	          ENDIF
+
+	          IF ( xeq .AND. TM_FPEQ_SNGL(xs,cmxeq) ) THEN
+	             pplmem(ix+i) = bad_flag
+	          ELSEIF (translate) then
+		     pplmem(ix+i)=(xt(i)-1.0)*rate+off
+	          else
+		     pplmem(ix+i)=xt(i)
+		  endif
+
+		ENDIF
+* end of 10/93 FERRET mod
+* end of  3/00 FERRET mod
+
+100	    continue
+	else if(icode.eq.1)then
+	    do 200 i=1,npts
+	        xs = REAL(xt(i))
+* FERRET mod 2/89 - screen bad data
+	        IF ( ( xeq .AND. TM_FPEQ_SNGL(xs,cmxeq) ) ) THEN
+	           pplmem(ix+i) = bad_flag
+	           pplmem(iy+i) = i     ! 3/00 mod
+	           GOTO 200
+	        ENDIF
+* end of 2/89 FERRET mod
+		pplmem(iy+i)=i
+	        if (translate) then
+		   pplmem(ix+i)=(xt(i)-1.0)*rate+off
+	        else
+		   pplmem(ix+i)=xt(i)
+	        endif
+200	    continue
+	else
+	    do 300 i=1,npts
+	        ys = REAL(yt(i))
+* FERRET mod 2/89 - screen bad data
+	        IF ( ( yeq .AND. TM_FPEQ_SNGL(ys,cmyeq) ) ) THEN
+	           pplmem(ix+i) = bad_flag
+	           pplmem(iy+i) = bad_flag
+	           GOTO 300
+	        ENDIF
+* end of 2/89 FERRET mod
+		if (translate) then
+		   pplmem(ix+i)=(float(i)-1.0)*rate+off
+	        else
+		   pplmem(ix+i)=float(i)
+	        endif
+		pplmem(iy+i)=yt(i)
+300	    continue
+	endif
+* FERRET mod 2/89 - replace bad data LIMITS flags
+	cmxeq = bad_flag
+	cmyeq = bad_flag
+* end of 2/89 FERRET mod
+
+	xmin=1.0e36
+	xmax=-xmin
+	ymin=xmin
+	ymax=xmax
+	do 400 i=1,npts
+* FERRET mod 2/89 -*re-mod 3/00*  eliminate bad data from min/max calculation 
+	IF ( pplmem(ix+i).NE.bad_flag ) THEN
+ 	  if(xmin.gt.pplmem(ix+i)) xmin=pplmem(ix+i)
+	  if(xmax.lt.pplmem(ix+i)) xmax=pplmem(ix+i)
+	ENDIF
+	IF ( pplmem(iy+i).NE.bad_flag ) THEN
+	  if(ymin.gt.pplmem(iy+i)) ymin=pplmem(iy+i)
+	  if(ymax.lt.pplmem(iy+i)) ymax=pplmem(iy+i)
+	ENDIF
+400	continue
+c
+c	some variable definitions
+c
+c	tmin    time for xmin (endpoint of this line in minutes since BC)
+c	tstop   time for xmax (endpoint of this line in minutes since BC)
+c	itmin   earliest tmin for all lines (in WHOI format)
+c	itmax   latest  tstop for all lines (in WHOI format)
+c	itstart reference start time (if iautot the first lines tstrt) (???)
+c
+* FERRET 9-21-88: replaced code dependent on 1970 reference
+! original:
+!	if(itflg.eq.1)then
+!	    if(linen.eq.1)then
+!		read(itstrt,999)iy,im,id,ihr
+!999		format(3i2.2,i4.4)
+!		call mdymt(temp,im,id,iy)
+!		temp(3)=ihr
+!		tstart=mtmin(temp)
+!c
+!c	calc itmin
+!c
+!		tmin=tstart+(xmin-off)*dt
+!		call minmt(tmin,start)
+!		call mtmdy(start,im,id,iy)
+!		write(itmin,999)iy,im,id,ifix(start(3))
+!c
+!c	calc itmax
+!c
+!		tstop=tstart+(xmax-off)*dt
+!		call minmt(tstop,stop)
+!		call mtmdy(stop,im,id,iy)
+!		write(itmax,999)iy,im,id,ifix(stop(3))
+!	    else
+!		tmin=tstart+(xmin-off)*dt
+!		tstop=tstart+(xmax-off)*dt
+!		read(itmin,999)iy,im,id,ihr
+!		call mdymt(temp,im,id,iy)
+!		temp(3)=ihr
+!		time=mtmin(temp)
+!		if(tmin.lt.time)then
+!		    call minmt(tmin,start)
+!		    call mtmdy(start,im,id,iy)
+!		    write(itmin,999)iy,im,id,ifix(start(3))
+!		endif
+!c
+!		read(itmax,999)iy,im,id,ihr
+!		call mdymt(temp,im,id,iy)
+!		temp(3)=ihr
+!		time=mtmin(temp)
+!		if(tstop.gt.time)then
+!		    call minmt(tstop,stop)
+!		    call mtmdy(stop,im,id,iy)
+!		    write(itmax,999)iy,im,id,ifix(stop(3))
+!		endif
+!	    endif
+!	endif
+
+	if(translate)then  		! 11.30.95 WAS:	if(itflg.eq.1)then
+		if(itflg.eq.1) then 	! 11.30.95 for both x and y
+		   xymin  = xmin
+		   xymax  = xmax
+	        else 			! gotta be -1
+		   xymin  = ymin
+		   xymax  = ymax
+		endif
+
+	    if(linen.eq.1)then
+		tstart = WHOI2BC( itstrt )		! t=1 of time axis
+
+		tmin=tstart+(xymin-1.0)*dt		! start of plot axis
+		itmin = BC2WHOI( tmin )
+
+		tstop=tstart+(xymax-1.0)*dt		! end of plot axis
+		itmax = BC2WHOI( tstop )
+
+	    else
+
+		tmin=tstart+(xymin-1.0)*dt
+		tstop=tstart+(xymax-1.0)*dt
+
+		time = WHOI2BC( itmin )
+		if(tmin.lt.time)  itmin = BC2WHOI( tmin )   ! chg. plot start
+c
+		time = WHOI2BC( itmax )
+		if(tstop.gt.time) itmax = BC2WHOI( tstop )   ! chg. plot end
+	    endif
+	endif
+* end of FERRET 9-21 changes
+        
+	pbuf=1
+* ORIG	call stmnmx(pplmem,pplmem_nsize,xmin,xmax,ymin,ymax,0.,0.)
+	call stmnmx(pplmem,pplmem_nsize,xmin,xmax,ymin,ymax)
+
+	lnum = linen
+        IF (icode .LE. 2) THEN
+           lleng(linen)=npts
+ 	   if(linen.ge.NPOLYGON)then
+	       linen=NPOLYGON - 1
+	   else
+	       ibase=ibase+lleng(linen)
+	   endif
+        ELSE
+           ibase = ibase + npts
+        ENDIF
+
+	return
+	end
diff --git a/ppl/plot/ppllist.F b/ppl/plot/ppllist.F
new file mode 100644
index 0000000..83a2387
--- /dev/null
+++ b/ppl/plot/ppllist.F
@@ -0,0 +1,537 @@
+      SUBROUTINE LIST(LLUN,X,NSIZE,ARG)
+	DIMENSION X(NSIZE)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C**
+C**    @(#)list.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*	Modified to include SHADE and ALINE parameter listing J Davison
+*	11.9.89
+*	*jd* 3.19.93 Mod to include listing of T Craig's spline and draftsman
+*	*jd* 1.6.94  Mod to list PLTNME -- metafile name
+*	*jd* 11.20.95 Mod to accommodate 14 digit time string (format 9984).
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+*	Modified to include PATTERN  parameter listing J Davison 10.26.98
+*       Modified to include RGB mapping status *jd* 10.98/1.99
+* V510: *sh* 3/00 - restrict LIST LINES to at most NLINES
+*                 - fixed up LIST STATS format
+* V530: *acm* 1/01- list the allowable calendar names; do not point to 
+*		    "the loaded calendar".  calendar type goes with each grid.
+* V540: *sh* 9/01 - changed LIST YAXIS output to say "YROG+" instead of "XORG="
+* 3/99  *kob* had to move initialization of var solid off decl. line - for linux
+* V552 *acm* 3/03 For SHAKEY info, write out location of key, whether it was
+*                 automatically set or set by user with SHASET
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'labels_inc.decl'
+        include 'LABELS.INC'
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'
+        include 'cont_inc.decl'
+        include 'CONT.INC'
+        include 'dashzz_inc.decl'
+        include 'DASHZZ.INC'
+        include 'conlab_inc.decl'
+        include 'CONLAB.INC'
+        include 'plt_inc.decl'
+        include 'PLT.INC'
+        include 'hab_inc.decl'
+        include 'HAB.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'tics_inc.decl'
+        include 'TICS.INC'
+        include 'tics2_inc.decl'
+        include 'TICS2.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'xylabp_inc.decl'
+        include 'XYLABP.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'zgrid_inc.decl'
+        include 'ZGRID.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'vector_inc.decl'
+        include 'VECTOR.INC'
+        include 'system_inc.decl'
+        include 'SYSTEM.INC'
+        include 'shade_vars.cmn'
+        include 'aline.cmn'
+        include 'gkscm2.cmn'
+	include 'tmap_dims.parm'
+	include 'xtm_grid.cmn_text'
+        include 'calendar.decl'
+        include 'calendar.cmn'
+
+
+
+	integer		x_do_key,x_orient,solid, my_loc
+        DATA            solid/21/
+	logical		none
+	character*5	drafts_txt
+	character*6	x_user
+        character*10    mapping
+
+	COMMON/PLTCM2/PMODE,FILEZ,FILET
+	CHARACTER PMODE*1,FILEZ*81,FILET*81
+	CHARACTER ARG*(*),LST(24)*10,AUTO(2)*6,TYPEL(6)*12,CLEV(0:3)*4
+	CHARACTER TYPE(3)*7,JTY(-2:2)*30,TIC(-1:1)*7
+	CHARACTER LT(-1:1)*6,AT(0:2)*7,IZT(0:3)*8,TAXTYP(-1:1)*5
+	CHARACTER SYM*21,SYM2*21,SYM3*21,ONOFF(0:1)*3
+        CHARACTER POINTER1*4,POINTER2*25
+
+	DATA LST/'XAXIS','YAXIS','LINES','LABELS','STATS','LEVELS',
+     *'READ','CONSET','LABSET','TAXIS','TICS','DATA','PLOT','DATPT',
+     *'TRANSXY','LIMITS','VECTOR','SHASET','SHAKEY','ALINE','PLTNME',
+     *'PATSET','APATTERNS','CALENDAR'/
+
+	DATA AUTO/'MANUAL','AUTO'/,ONOFF/'OFF','ON'/
+	DATA TAXTYP/'YAXIS','OFF','XAXIS'/
+	DATA IZT/'OFF','X AXIS','Y AXIS','POINTS'/
+	DATA TYPEL/'NO MARK','MARK','END PTS','ONLY MARK',
+     *'DASH','DASH END PTS'/,CLEV/'    ','LINE','DARK','DASH'/
+	DATA TIC/'OUTSIDE','BOTH','INSIDE'/
+	DATA JTY/'VECTOR VARIABLE GRID','VECTOR','CONTOUR',
+     *		'LINES','CONTOUR VARIABLE GRID'/
+	DATA TYPE/'NORMAL','LOG','INV LOG'/
+	DATA LT/'LEFT','CENTER','RIGHT'/,AT/'NO LINE','LINE','FANCY'/
+
+***************************************************************************
+
+	IF(QUIETF)RETURN
+
+	CALL UPPER(ARG,30)
+
+	DO 10 I=1,24
+           IF(ARG.EQ.LST(I))GOTO 11
+ 10     CONTINUE
+
+        WRITE(LTTOUT,9986) ARG
+ 9986   FORMAT(' ILLEGAL LIST OPTION',2X,A10)
+        GOTO 5000
+
+ 11     GOTO (100,200,300,400,500,600,700,800,900,1000,1100,500,1300,
+     *       1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400),I
+
+
+C     XAXIS
+100   WRITE(LLUN,'(//9X,''XAXIS QUALITIES'')')
+      WRITE(LLUN,9999)XLO,XHI,XTIC,XLEN,XCSIZE,
+     *ONOFF(IAXON(1)),ONOFF(IAXON(2))
+9999  FORMAT(9X,'LO=',1PE9.2,' HI=',E9.2,' TIC=',E9.2,
+     *' LEN=',E9.2,' CSIZE=',E9.2,/,9X,' TOP AXIS= ',A3,
+     *' BOTTOM AXIS= ',A3)
+      WRITE(LLUN,9998)AUTO(IAUTOX+1),TYPE(ITYPEX),NMTCX,LINTX,
+     *LABELX,NSIGX,NTICX
+9998  FORMAT(9X,A6,2X,A6,' NMTC=',I3,' LINT=',I3,' LABEL=',
+     *I3,' NSIG=',I3,' NTIC=',I3)
+      IF(IFRX.EQ.' ')THEN
+      WRITE(LLUN,9988) 'X', XORG
+9988  FORMAT(9X,A1,'ORG=',1PE9.2,'  AUTO LABELLING')
+      ELSE
+      WRITE(LLUN,9987) 'X',XORG,IFRX
+9987  FORMAT(9X,A1,'ORG=',1PE9.2,'  LABEL FORMAT=',2X,A20)
+      ENDIF
+      GOTO 5000
+C     YAXIS
+200   WRITE(LLUN,'(//9X,''YAXIS QUALITIES'')')
+      WRITE(LLUN,9975)YLO,YHI,YTIC,YLEN,YCSIZE,
+     *ONOFF(IAXON(3)),ONOFF(IAXON(4))
+9975  FORMAT(9X,'LO=',1PE9.2,' HI=',E9.2,' TIC=',E9.2,
+     *' LEN=',E9.2,' CSIZE=',E9.2,/,9X,' LEFT AXIS= ',A3,
+     *' RIGHT AXIS= ',A3)
+      WRITE(LLUN,9998)AUTO(IAUTOY+1),TYPE(ITYPEY),NMTCY,LINTY,
+     *LABELY,NSIGY,NTICY
+      IF(IFRY.EQ.' ')THEN
+      WRITE(LLUN,9988) 'Y',YORG
+      ELSE
+      WRITE(LLUN,9987) 'Y',YORG,IFRY
+      ENDIF
+      GOTO 5000
+C     LINES
+300   WRITE(LLUN,9996)
+9996  FORMAT(//8X,'MARK',3X,'TYPE',5X,'MARKH',3X,'DN1',
+     *3X,'UP1',3X,'DN2',3X,'UP2',2X,'LEN',2X,'PEN')
+      DO 301 I=1,MIN(LNUM, NLINES)      ! 3/00 to allow large NPOLYGON
+      WRITE(LLUN,9997)IMARK(I),TYPEL(ITYPE(I)+1),HMARK(I),DN1(I),
+     *UP1(I),DN2(I),UP2(I),LLENG(I),IPEN(I)
+9997  FORMAT(8X,I2,1X,A12,5F6.3,I6,I4)
+301   CONTINUE
+	WRITE(LLUN,9981)IPEN(0)
+9981	FORMAT(/8X,'DEFAULT PEN= ',I2)
+      GOTO 5000
+C     LABELS
+400   WRITE(LLUN,9991)LAB1
+9991  FORMAT(1X,A79)
+      WRITE(LLUN,9991)XLAB
+      WRITE(LLUN,9991)YLAB
+	IF(NLAB.NE.0)WRITE(LLUN,9979)
+9979	FORMAT(/10X,'XPOS',7X,'YPOS',5X,'HGT',3X,'ROT',3X,'UNITS')
+      DO 403 I=1,NLAB
+	NCR=LNBLK(LABS(I),255)
+	IF(USRLBS(I))THEN
+	    SYM='USER'
+	ELSE
+	    SYM='SYSTEM'
+	ENDIF
+      WRITE(LLUN,9980)I,XLABS(I),YLABS(I),RHLABS(I),INT(RLABS(I)),
+     *SYM,LABS(I)(:NCR)
+9980	FORMAT(' LAB',I2,1P2E11.3,0PF6.3,I5,2X,A6,2X,A)
+	WRITE(LLUN,9974)XLLABS(I),YLLABS(I),AT(LLTYPE(I)),LT(LTYPE(I))
+9974	FORMAT(' LINE PT:',3X,1P2E10.3,2X,A7,5X,A6,' JUSTIFY LABEL')
+403	CONTINUE
+      GOTO 5000
+C     STATS
+500   WRITE(LLUN,9995)JTY(JTYPE)
+9995  FORMAT(//9X,'DATA OF TYPE',1X,A)
+      WRITE(LLUN,9994)XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX
+9994  FORMAT(19X,'MIN',12X,'MAX'/9X,'X',1P2E15.4/
+     *9X,'Y',2E15.4/9X,'Z',2E15.4)
+      IF(JTYPE.LE.0.OR.JTYPE.EQ.2)THEN
+      WRITE(LLUN,'(9X,''NX='',I4,'' NY='',I4)')NX,NY
+      ELSE
+      WRITE(LLUN,'(9X,''LINE'',I3,'' READ'')')LINEN
+      DO 501 I=1,LNUM
+      WRITE(LLUN,'(9X,''LINE='',I3,'' LEN='',I6)')I,LLENG(I)
+501	CONTINUE
+      END IF
+	IF(ARG.EQ.LST(12))GOTO 1200
+      GOTO 5000
+C     LEVELS
+600   WRITE(LLUN,'(//9X,''LEVEL'',7X,''TYPE'',7X,''NDIG'',7X,''PEN'')')
+      NL=NLEV2
+      IF(IAUTOC.EQ.0)NL=NLEV
+      DO 601 I=1,NL
+	NDEC=LDIG(I)
+	ICOLR=LCLR(I)
+      WRITE(LLUN,'(9X,1PE9.2,3X,A6,2I9)')ZLEV(I),CLEV(LWGT(I)),NDEC,
+     *ICOLR
+601	CONTINUE
+      GOTO 5000
+C     READ
+700   WRITE(LLUN,9990)IFORM,ITYPEZ,JTY(JTYPE)
+9990  FORMAT(//9X,'THE FORMAT IS'/9X,A80/9X,'ITYPEZ=',I2,
+     *'  DATA IS ',A7)
+      WRITE(LLUN,9989)JX,JY,JZ,NVAR,NGRP,NREC,LINEN,NX,NY
+9989  FORMAT(9X,'JX=',I2,'  JY=',I2,'  JZ=',I2/
+     *9X,'NO. VARS PER GROUP=',I6/9X,'NO. GRPS PER RECORD=',I6/
+     *9X,'NO. OF RECORDS=',I6/9X,'LINEN=',I6,'  NX=',I6,'  NY=',I6)
+      GOTO 5000
+C     CONSET
+800   if (draftsman) then
+	drafts_txt = 'TRUE '
+      else
+      	drafts_txt = 'FALSE'
+      end if
+      WRITE(LLUN,9993)HGT,NSIGC,NARC,DASHLN,SPACLN,CAY,NRNG,DSLAB,
+     *CANGLE,spline_tension,drafts_txt
+9993  FORMAT(//9X,'CONTOUR CONSTANTS'/9X,'HGT=',1PE9.2,' NSIG=',I3,
+     *' NARC=',I3,' DASHLN=',E9.2,/9X,'SPACLN=',E9.2,' CAY=',
+     *E9.2,' NRNG=',I3,' DSLAB=',E9.2,' ANGLE=',G9.2,
+     */9x,'SPLINE TENSION=',e9.2,' DRAFTSMAN=',a5)
+
+      WRITE(LLUN,9971)CONPRE,CONPST
+9971  FORMAT(9X,'LABEL PREFIX= ',A10,'   POSTFIX= ',A10)
+      GOTO 5000
+C     LABSET
+900   WRITE(LLUN,'(//9X,''LABEL CHAR HEIGHTS'')')
+      WRITE(LLUN,9992)HLAB1,HXLAB,HYLAB,HLABS
+9992  FORMAT(9X,'HLAB1=',1PE9.2,' HXLAB=',E9.2,' HYLAB=',
+     *E9.2,' HLABS=',E9.2)
+      GOTO 5000
+
+C     TAXIS
+1000  WRITE(LLUN,'(//9X,''TAXIS QUALITIES'')')
+      WRITE(LLUN,9985)TLO,DT,TCSIZE,ITYPET,VANG,
+     *ONOFF(IAXON(1)),ONOFF(IAXON(2))
+9985  FORMAT(9X,'LO=',1PE9.2,' DT=',E9.2,' CSIZE=',E9.2,
+     *' TYPE= TAXIS',I1,' VANG=',E9.2,/,9X,' TOP AXIS= ',A3,
+     *' BOTTOM AXIS= ',A3)
+
+      CALL TIME2(IT1,SYM)
+      CALL TIME2(IT2,SYM2)
+      CALL TIME2(ITSTRT,SYM3)
+
+      WRITE(LLUN,9984) IT1(13:14)//IT1(1:12),SYM,
+     *IT2(13:14)//IT2(1:12),SYM2,ITSTRT(13:14)//ITSTRT(1:12),
+     *SYM3,NMTCT,LABELT,
+     *IFDB,ISDB,TAXTYP(ITFLG),onoff(iautot)
+
+9984  FORMAT(9X,'  TMIN=',A14,1x,A21,/9X,'  TMAX=',A14,1x,A21/9X,
+     *'TSTART=',A14,1x,A21,/9X,'NMTC=',I3,' LABEL=',I3,' IFDB=',I3,
+     *' ISDB=',I3,' TAXIS= ',A5,' IAUTOT= ',a3)
+      GOTO 5000
+
+C     TICS
+1100  WRITE(LLUN,9983)TSMX,TLX,TSMY,TLY
+9983  FORMAT(9X,'SMALL XTIC=',1PE10.3,'   LARGE XTIC=',E10.3,
+     */9X,'SMALL YTIC=',E10.3,'   LARGE YTIC=',E10.3)
+      WRITE(LLUN,9982)TIC(ITX),TIC(ITY)
+9982  FORMAT(9X,'X AXIS TICS ',A7,'   Y AXIS TICS ',A7)
+	GOTO 5000
+C	DATA
+1200	CALL DATLST(LLUN,X,NSIZE,NX,NY)
+	GOTO 5000
+C	PLOT
+1300	WRITE(LLUN,9977)WIDTH,HEIGHT,MOD,IR
+9977	FORMAT(9X,'WIDTH= ',F7.2,'  HEIGHT= ',F7.2,'  TKTYPE=',I5
+     *	,'  BAUD=',I5)
+	WRITE(LLUN,9978)ONOFF(IWIND),ONOFF(IP(1)),ICROSS,ICODE
+9978	FORMAT(9X,'WINDOW= ',A3,'  BOX= ',A3,'  CROSS=',I2,
+     *	'  PLTYPE=',I3)
+***	WRITE(LLUN,9972)PMODE,FILEZ
+	WRITE(LLUN,9972)PMODE,meta_file
+9972	FORMAT(9X,'PLOT MODE= ',A3/9X,'PLOT FILE= ',A)
+	GOTO 5000
+C	DATPT
+1400	WRITE(LLUN,9973)IZT(IZTYP),IZMRK,IZLEN
+9973	FORMAT(9X,'GRID POINTS = ',A8,' MARK= ',I4,' LEN=',I10)
+	GOTO 5000
+C	TRANSXY
+1500	WRITE(LLUN,9970)
+9970	FORMAT(9X,'LINE',4X,'XFACT',5X,'XOFF',6X,'YFACT',4X,'YOFF')
+	DO 1501 I=1,LNUM
+	WRITE(LLUN,9969)I,XFCT(I),XOFF(I),YFCT(I),YOFF(I)
+9969	FORMAT(9X,I3,1X,1P4E10.2)
+1501	CONTINUE
+	GOTO 5000
+C	LIMITS
+1600	WRITE(LLUN,9976)XLE,CMXLE,XEQ,CMXEQ,XGE,CMXGE,
+     *	YLE,CMYLE,YEQ,CMYEQ,YGE,CMYGE,
+     *	ZLE,CMZLE,ZEQ,CMZEQ,ZGE,CMZGE
+9976	FORMAT(9X,'TEST',4X,'TRUE/FALSE',7X,'VALUE'//
+     *	10X,'XLE',8X,L1,8X,1PE11.3/
+     *	10X,'XEQ',8X,L1,8X,1PE11.3/
+     *	10X,'XGE',8X,L1,8X,1PE11.3/
+     *	10X,'YLE',8X,L1,8X,1PE11.3/
+     *	10X,'YEQ',8X,L1,8X,1PE11.3/
+     *	10X,'YGE',8X,L1,8X,1PE11.3/
+     *	10X,'ZLE',8X,L1,8X,1PE11.3/
+     *	10X,'ZEQ',8X,L1,8X,1PE11.3/
+     *	10X,'ZGE',8X,L1,8X,1PE11.3)
+	GOTO 5000
+C	VECTOR
+1700	WRITE(LLUN,9968)VLEN,VUSRLN,VAUTO
+9968	FORMAT(9X,'SCALE LENGTH = ',F5.3,'  SCALE = ',1PG10.3,
+     *	'  AUTO SCALE = ',L4)
+***     *	'  AUTO SCALE = ',L)
+	WRITE(LLUN,9967)VXLOC,VYLOC,VUSER,VKEY,LT(IFIX(VPOS)),VFRMT
+9967	FORMAT(9X,'XPOS = ',1PG10.3,'  YPOS = ',G10.3,
+     *	'  USER = ',L4,'  DRAW KEY = ',L4/9X,'JUSTIFY ',A8,2X,A20)
+***     *	'  USER = ',L,'  DRAW KEY = ',L/9X,'JUSTIFY ',A8,2X,A20)
+	goto 5000
+
+*	Mods to include shade and aline info JD 11.9.89
+C	SHASET info
+1800	if (.not. custom_colors) then
+	   write (llun,10011)
+	   goto 5000
+	end if
+10011	format (/9x/,'DEVICE DEFAULT COLORS ARE SET')
+
+        if (rgb_mapping .eq. percent) then
+            mapping = 'Percent'
+          else if (rgb_mapping .eq. by_value) then
+            mapping = 'By_value'
+          else if (rgb_mapping .eq. by_level) then
+            mapping = 'By_level'
+        end if
+
+        if (rgb_mapping .ne. by_level) then
+           write (llun,10001) mapping
+10001      format (/9x, 'RGB_MAPPING ', a,
+     .       //9x,'SET POINT',7x,'RED',7x,'GREEN',8x,'BLUE')
+        else
+           write (llun,11001) mapping
+11001      format (/9x, 'RGB_MAPPING ', a,
+     .       //9x,'    LEVEL',7x,'RED',7x,'GREEN',8x,'BLUE')
+        end if
+
+	if (rgb_mapping .ne. by_level) then
+           do 1801 i = 1,ncl
+              write (llun,10002) 
+     .          slvl(i),sr(i)*100.0,sg(i)*100.0,sb(i)*100.0,sa(i)*100.0
+ 1801      continue
+10002      format (9x,f9.1,5x,f5.1,7x,f5.1,7x,f5.1,7x,f5.1)
+        else
+           do 1802 i = 1,ncl
+              write (llun,11002) 
+     .             i,sr(i)*100.0,sg(i)*100.0,sb(i)*100.0,sa(i)*100.0
+ 1802      continue
+11002      format (9x,i9,5x,f5.1,7x,f5.1,7x,f5.1,7x,f5.1)
+        end if
+	goto 5000
+
+C	SHAKEY info
+1900	write (llun,10003) 
+10003	format (/9x,'DO KEY',2x,'ORIENT',2x,'LAB SIZE',2x,
+     .	'LAB INC',2x,'LAB DIG',2x,'LAB LEN')
+		
+	if (do_key) then                             
+	   x_do_key = 1
+	else
+	   x_do_key = 0
+	end if
+
+	if (vertical_key) then
+	   x_orient = 1
+	else
+	   x_orient = 0
+	end if
+
+	write (llun,10004) x_do_key,x_orient,klab_size,klab_incr,
+     .				klab_dig,klab_len
+10004	format (9x,i6,2x,i6,2x,f8.2,2x,i7,2x,i7,2x,i7)
+
+c  Write out location of key, whether it was user-located or automatically set
+
+
+        IF (kuser_loc(1) .OR. kuser_loc(2) .OR.
+     .      kuser_loc(3) .OR. kuser_loc(4) ) THEN
+            WRITE (llun,10005)
+        ELSE
+	   WRITE (llun,10007) 
+        ENDIF
+
+	write (llun,10006) kx_lo/1000.0,kx_hi/1000.0,     
+     .		              ky_lo/1000.0,ky_hi/1000.0
+
+10005	format (//9x,'X LO',5x,'X HI',5x,'Y LO',5x,'Y HI')
+10006	format (4x,4f9.2)
+10007	format (//9x,'DEFAULT KEY POSITIONING'/
+     .            9x,'X LO',5x,'X HI',5x,'Y LO',5x,'Y HI')
+	goto 5000
+
+C	ALINE info
+2000	none = .true.
+	do 2001 i = 1,lnum    
+	   if (aline_on(i)) none = .false.		
+2001	continue
+
+	if (none) then
+	   write (llun,10008)
+	   goto 5000
+	end if
+10008	format (//9x,'NO LINES SET')
+
+	write (llun,10009)
+10009	format (//9x,'LINE #',5x,'UNITS',5x,'X MIN',5x,'Y MIN',
+     .			5x,'X MAX',5x,'Y MAX')
+	do 2002 i = 1,lnum
+	   if (.not. aline_on(i)) goto 2002
+
+	   if (aline_user(i)) then
+	      x_user = '  USER'
+	   else
+	      x_user = 'NOUSER'
+	   end if
+
+	   write (llun,10010) i,x_user,aline_minx(i),aline_miny(i),
+     .				aline_maxx(i),aline_maxy(i)
+2002	continue
+10010	format (9x,i6,4x,a6,4f10.2)
+	goto 5000
+*	10011 format stmt is used above -- start with 10012
+
+*	PLTNME listing
+2100	write (llun,10012) meta_file
+
+10012   format (/9x,'METAFILE NAME'/9x,a)
+	goto 5000
+
+*       LIST CURRENT PATTERNS
+ 2200   write (llun,10014) 
+10014   format (/9x,'PATTERN ORDER',2x,'PATTERN NAME')
+
+	do 2201 i = 1,npat
+	   write (llun,10015) i, pattern_list(patterns(i))
+ 2201   end do
+10015   format (19x,i3,2x,a25)
+
+	goto 5000
+
+*       LIST AVAILABLE PATTERNS
+* 3/99  *kob* fix up format statment - caught by nag f90
+ 2300   write (llun,10016)
+10016   format (/9x,'AVAILABLE PATTERNS'/9x,'------------------')
+
+ 2301   write (llun,10017) pattern_list(solid)
+        do 2302 i = 1,20
+	   write (llun,10017) pattern_list(i)
+ 2302   end do
+10017   format (9x,a25)
+	goto 5000
+
+*       LIST CURRENT CALENDAR
+ 2400   write (llun,10018)
+10018   format (/9x,'SUPPORTED CALENDARS'/9x,'-------------------')
+
+        do 2401 i = 1, max_calendars
+              pointer1 = ' '
+              pointer2 = ' '
+        write (llun,10019) pointer1, allowed_calendars(i), pointer2
+ 2401   end do
+
+10019   format(9x,a,a,a)
+        goto 5000
+
+5000	RETURN
+      END
diff --git a/ppl/plot/pplus.F b/ppl/plot/pplus.F
new file mode 100644
index 0000000..3d8d1c9
--- /dev/null
+++ b/ppl/plot/pplus.F
@@ -0,0 +1,234 @@
+	PROGRAM PPLUS
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pplus.F	1.2    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     Mod *JD* 3.5.91 to use unit 6 rather than 5 for unix terminal lun
+C     Had problem with buffered output.  See also opnppl
+C v552 *acm* 3/03 Longer strings: changes for multi-line labels
+
+	INCLUDE 'PLT.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+C
+	CHARACTER FROM*80,TEMP*2048,LINE*2048,TYPE*81
+	CHARACTER COMBUF(5)*2048,FILE*81,DTE*24
+	DATA COMBUF/5*' '/,FILE/'echo.file'/
+
+C
+C	TURN ON LOGGING AND DO PPLUS LOGGING
+C
+	LOGITF=.TRUE.
+	CALL LOGGER('PPLUS')
+C
+C	INITIALIZE PLOT5+ AND SET LOGICAL UNITS
+C
+	ICODE=1
+#ifdef unix
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     Mod *JD* 3.91 Original has unit 5 for tty  -- change to 6
+C	CALL OPNPPL(FILE,23,1,16,24,5,1,2,11,21)
+	CALL OPNPPL(FILE,23,1,16,24,6,1,2,11,21)
+#else
+        CALL OPNPPL(FILE,23,1,6,24,5,20,22,11,21)
+#endif
+C
+C	CHECK FOR STARTUP FILE
+C
+#ifdef unix
+	call getenv('PPL$STARTUP',type)
+	len=lnblk(type,81)
+	IF(len.ge.1)THEN
+#else
+        STATUS=LIB$GET_SYMBOL('PPL$STARTUP',TYPE,LEN)
+        IF(STATUS.EQ.1)THEN
+#endif
+C
+C	    TURN OFF ECHO AND RUN PLOT5+
+C
+	    ECHOF=.FALSE.
+	    LINE=' '
+#ifdef unix
+	    from=type(1:len)
+#else
+	    CALL WLDFLE('SY:.PPC',TYPE(1:LEN),FROM,STATUS,IFLAG)
+#endif
+	    CALL PPLCMD(FROM,LINE,IS,COMBUF,5,0)
+	    ECHOF=.TRUE.
+	ENDIF
+C
+C	CHECK FOR COMMAND LINE COMMAND
+C
+#ifdef unix
+	ic=iargc()
+	if(ic.ge.1)then
+	    istp=1
+	    do 1 i=1,ic
+		call getarg(i,temp)
+		len=lnblk(temp,2048)
+		if(istp.eq.1)then
+		    line=temp(:len)
+		    istp=len+1
+		else
+		    line(istp:)=' '//temp(:len)
+		    istp=istp+len+1
+		endif
+1	    continue
+	else
+	    line=' '
+	    istp=1
+	endif
+	istp=istp-1
+#else
+        STAT=LIB$GET_FOREIGN(LINE,,ISTP)
+#endif
+	IS=1
+#ifdef unix
+	IF(INDEX(LINE(:ISTP),':Q').EQ.0)THEN
+*     Mod *JD* 3.19 to write to unit 6, not 5, as in the original
+C           WRITE(5,'(''  PLOT PLUS  V 1.1  05-MAR-88 (unix)'')') 
+            WRITE(6,'('' PLOTPLUS  V 1.1 March 91 (unix)'')') 
+	    CALL FDATE(DTE)
+C *JD*      WRITE(5,9999)DTE  
+	    WRITE(6,9999)DTE 
+9999	    FORMAT(2x,A24) 
+#else
+        IF(INDEX(LINE(:ISTP),'/Q').EQ.0)THEN
+            WRITE(LTTOUT,'('' PLOTPLUS  V 1.1 March 91 (vms)'')') 
+            CALL DATE(DTE)
+            CALL TIME(TME)
+            WRITE(5,9999)DTE,TME 
+9999        FORMAT(1x,A11,A15) 
+#endif
+	ENDIF
+	IF(LINE.EQ.' '.OR.ISTP.EQ.0)THEN
+C
+C	NO COMMAND ON LINE
+C
+#ifdef unix
+	    FROM='/dev/tty'
+#else
+	    FROM='TT:'
+#endif
+	    LINE=' '
+	ELSE
+	    TEMP=LINE(IS:ISTP)
+	    ISPC=INDEX(TEMP,' ')
+	    IF(ISPC.GT.0)THEN
+		FROM=TEMP(:ISPC-1)
+		LINE=TEMP(ISPC+1:)
+		IS=ISTP-IS+1-ISPC
+	    ELSE
+		FROM=TEMP
+		LINE=' '
+		IS=0
+	    ENDIF
+	    TEMP=FROM
+	    DEFLTS(1)=.TRUE.
+	    CALL GTQUAL(TEMP,ITLEN,IER,IPOS)
+	    ECHOF=SECHO
+	    DEBUGF=SDEBUG
+	    IF(SLATCH)THEN
+		SLATCH=.FALSE.
+		DO 100 I=1,NFLAGS
+100		DEFLTS(I)=FLAG(I)
+	    ENDIF
+#ifdef unix
+	    from=temp(1:itlen)
+#else
+	    CALL WLDFLE('SY:.PPC',TEMP(1:ITLEN),FROM,STATUS,IFLAG)
+#endif
+	    TERMF=.FALSE.
+	    DEFLTS(1)=.FALSE.
+	ENDIF
+
+C
+C	RUN PLOT5+ INTERACTIVE
+C
+	CALL PPLCMD(FROM,LINE,IS,COMBUF,5,0)
+C
+C	IF PPLCMD RETURNS THEN EXIT 
+C
+	CALL CLSPPL
+C *kob* 4/99 minor mod - add (0) to exit call
+	CALL EXIT(0)
+	END
+
+
diff --git a/ppl/plot/prmtiv.F b/ppl/plot/prmtiv.F
new file mode 100644
index 0000000..80595ab
--- /dev/null
+++ b/ppl/plot/prmtiv.F
@@ -0,0 +1,679 @@
+	SUBROUTINE PRMTIV(X,NXS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)prmtiv.F	1.1    3/10/88
+
+* modified 6/99 *sh*
+*	added mouse input (CALL IGRNPT) to %LABEL
+*	added %WHERE mouse input command
+* v552 3/03 *acm* changes for multi-line labels with %label, %xaxis, %yaxis
+*                   and remove VMS include statements.
+* v554 3/04 *acm* 5th arg of %xaxis, %yaxis should set the # of tics
+* v554 3/04 *acm* Need to send parameters used for making graticule lines
+*                 to xaxis, yaxis, initialized to values for graticule off.
+* v580 10/05 *acm* Fix for bug1003; pen may be changed by @Cnnn as well
+*                  as @Pn. In saving info about color/font changes from
+*                  one line to the next in multi-line lables, allow for
+*                  @Cnnn syntax.  (changes also in getlabfonts)
+* v580 11/05 *acm* Send new arg to xaxis1,yaxis1 DMS (arg is 0 here)
+C        1/06  xvaloff,yvaloff add this amount to each x or y axis label. 
+C              (axis data was read as double precision and converted to single 
+C              after applying an offset.)
+* V683 12/12 *acm* Fix for applying a font setting in multiple line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C	This subroutine does plot primitives.  They
+C	should be used with care since interactions are
+C	a very strong possibility.
+C
+C	These routines do not work with multplt!!!!
+C
+c
+c	%OPNPLT
+c		/overlay	do not erase last plot
+c
+c	%CLSPLT
+c		/wait		immediatly return to get next command
+c
+c	%RANGE
+c		min		minimum value of data to be ranged
+c		max		maximum value of data
+c		ntic		number of large increments
+c	ppl$range_low		new minimum range value
+c	ppl$range_high		new maximum range value
+c	ppl$range_inc		new increment
+c
+c	%PLTLIN
+c		n		plot line n using current scales
+c
+c	%LABEL
+c		/user		x and y in user or inches
+c		x		x position user or inches
+c		y		y position user or inches
+c		ipos		-1 left, 0 center, +1 right justify
+c		ang		angle to draw label degrees
+c		chsize		character size inches
+c		label		string to draw
+c
+c	%XAXIS
+c		/user		y in user or inches
+c		xlow		min value of x user
+c		xhigh		max value of x user
+c		xtic		large tic increment user
+c		y		y position user or inches
+c		nmstc		number of small tics
+c		lint		label interval (large tics)
+c		xunit		divisor for axis label
+c		ipos		-1 bottom, 0 none, +1 top of label
+c		csize		character size inches
+c		frmt		axis format char*20
+c
+c	%YAXIS
+c		/user		x in user or inches
+c		ylow		min value of y user
+c		yhigh		max value of y user
+c		ytic		large tic increment user
+c		x		x position user or inches
+c		nmstc		number of small tics
+c		lint		label interval (large tics)
+c		yunit		divisor for axis label
+c		ipos		-1 left, 0 none, +1 right of label
+c		csize		character size inches
+c		frmt		axis format char*20
+c
+c	%WHERE
+c		N/A
+
+	DIMENSION X(NXS)
+C
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'PEN.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'PLTL.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'TAXIS.INC'
+	include 'axis_inc.decl'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'PRMCOM.INC'
+	INCLUDE 'TICS.INC'
+	INCLUDE 'AXLWID.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'SWITCH.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'gkscm1_inc.decl'  ! with wsid for igrnpt
+	INCLUDE 'GKSCM1.INC'
+
+
+C
+C
+	CHARACTER FRMTX*20,SYM*120
+	LOGICAL SVQIET,SVLOG,CLEAR
+
+	LOGICAL mouse_input, need_justify, need_arrow
+	INTEGER	IGRNPT, idummy, ichoice, iat
+	REAL xp, yp, across
+        INTEGER numlines, i, j, dms
+        LOGICAL lineflag
+
+	EXTERNAL range, scale, size
+
+c        line_spacing = 1.4
+
+C***	OPNPLT
+C
+	IF(ICOM.EQ.'%OPNPLT')THEN
+	    SVQIET=QUIETF
+	    SVLOG=LOGCMF
+	    QUIETF=.TRUE.
+	    LOGCMF=.FALSE.
+	    CLEAR = .NOT.SOVER
+	    PLTOPN=.TRUE.
+	    IF(.NOT.SOVER)CALL SIZE(WIDTH,HEIGHT)
+	    CALL OPNDEV(TERMF,CLEAR)
+	    CALL COLOR(IPEN(0))
+C
+C***	CLSPLT
+C
+	ELSE IF(ICOM.EQ.'%CLSPLT')THEN
+	    QUIETF=SVQIET
+	    LOGCMF=SVLOG
+	    PLTOPN=.FALSE.
+	    IF(SWAIT)THEN
+		CALL HABIS(IPLOT,IPAUSE,IHDCPY,INC)
+	    ELSE
+		CALL HABIS(IPLOT,0,IHDCPY,INC)
+	    ENDIF
+C
+C***	RANGE
+C
+	ELSE IF(ICOM.EQ.'%RANGE')THEN
+	    RMIN=P(1)
+	    RMAX=P(2)
+	    NTIC=P(3)
+	    if(rmin.eq.rmax)then
+		rlow=rmin
+		rhigh=rmax
+	    else
+	        CALL RANGE(RMIN,RMAX,NTIC,RLOW,RHIGH,RINC)
+	    endif
+	    SYM='*PPL$RANGE_LOW'
+	    CALL PUTVAL(SYM,RLOW,4,IER)
+C
+	    SYM='*PPL$RANGE_HIGH'
+	    CALL PUTVAL(SYM,RHIGH,4,IER)
+C
+	    SYM='*PPL$RANGE_INC'
+	    CALL PUTVAL(SYM,RINC,4,IER)
+C
+C***	XAXIS
+C
+	ELSE IF(ICOM.EQ.'%XAXIS')THEN
+
+            dms = 0
+            DO 100 ii = 1, 4
+              hgrat(ii,1) = 0.
+              hgrat(ii,2) = 0.
+              vgrat(ii,1) = 0.
+              vgrat(ii,2) = 0.
+100         CONTINUE
+
+            hcolor(1) = 1 
+            hcolor(2) = 1
+            vcolor(1) = 1
+            vcolor(2) = 1
+            across = 0.
+            lineflag = .FALSE.
+
+	    CALL INQSCL(XFF,YFF,XOR,YOR,XLOW,YLOW)
+	    IF(M.GE.1.AND.IFLG(1).NE.0)THEN
+		XLOW=P(1)
+	    ELSE
+		XLOW=XLO
+	    ENDIF
+	    IF(M.GE.2.AND.IFLG(2).NE.0)THEN
+		XHIGH=P(2)
+	    ELSE
+		XHIGH=XHI
+	    ENDIF
+	    IF(M.GE.3.AND.IFLG(3).NE.0)THEN
+		XTICC=P(3)
+	    ELSE
+		XTICC=XTIC
+	    ENDIF
+	    IF(M.GE.4.AND.IFLG(4).NE.0)THEN
+		IF(SUSER)THEN
+		    Y=P(4)
+		ELSE
+		    Y=YLOW+P(4)/YFF
+		ENDIF
+	    ELSE
+		Y=YLOW
+	    ENDIF
+	    IF(M.GE.5.AND.IFLG(5).NE.0)THEN
+		NSMTCS=P(5)
+	    ELSE
+		NSMTCS=NMTCX
+	    ENDIF
+	    IF(M.GE.6.AND.IFLG(6).NE.0)THEN
+		LINTT=P(6)
+	    ELSE
+		LINTT=LINTX
+	    ENDIF
+	    IF(M.GE.7.AND.IFLG(7).NE.0)THEN
+		XUNIT=P(7)
+	    ELSE
+		XUNIT=1.
+	    ENDIF
+	    IF(M.GE.8.AND.IFLG(8).NE.0)THEN
+		IPOS=P(8)
+	    ELSE
+		IPOS=LABELX
+	    ENDIF
+	    IX=IPOS
+	    IF(M.GE.9.AND.IFLG(9).NE.0)THEN
+		CHSIZE=P(9)
+	    ELSE
+		CHSIZE=XCSIZE
+	    ENDIF
+	    IF(N.GT.0)THEN
+		FRMTX=LABEL(1:N)
+	    ELSE IF(IFRX.NE.' ')THEN
+		FRMTX=IFRX
+	    ELSE
+		CALL FRMT(XLOW,XHIGH,NSIGX,FRMTX)
+	    ENDIF
+	    XFF=XLEN/(XHIGH-XLOW)
+	    CALL SCALE(XFF,YFF,XOR,YOR,XLOW,YLOW)
+	    call color(ipen(0))
+	    CALL XAXIS1(XLOW,XHIGH,XTICC,NSMTCS,LINTT,XUNIT,
+     *		IPOS,FRMTX,XFF,Y,YFF,CHSIZE,across,dms,vgrat,
+     *		vcolor,vline,xvaloff)
+
+            CALL tm_break_lines (xlab, lnbeg, lnend, numlines)
+            nfont = 0
+            npen = 0
+            fontprefix = ""
+            penprefix = ""
+            DO 20 j = 1, numlines
+               CALL getlabfonts (xlab, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+	       IF(IPOS.LT.0)THEN
+		  YL=Y-(XWID+2.0*HXLAB)/YFF
+	       ELSE
+	 	  YL=Y+(XWID+HXLAB)/YFF
+	       ENDIF
+               YL = YL - line_spacing*(j-1)*HYLAB/yff
+	       XL=XLOW+(XLEN-SYMWID(HXLAB, NCHR+npen+nfont,
+     .                  penprefix(1:npen)//fontprefix(1:nfont)//
+     .                  xlab(lnbeg(j):lnend(j) )) )*.5/XFF
+
+               CALL SYMBEL(XL,YL,0.,HXLAB,NCHR+npen+nfont,
+     .                  penprefix(1:npen)//fontprefix(1:nfont)//
+     .                  xlab(lnbeg(j):lnend(j)))
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+               IF (npnew.GT.0) THEN
+                  penprefix(1:npnew) = newpen(1:npnew)
+                  npen = npnew
+               ENDIF
+               IF (nfnew.GT.0) THEN
+                  fontprefix(1:nfnew) = newfont(1:nfnew)
+                  nfont = nfnew
+               ENDIF
+
+  20        CONTINUE
+
+C
+C***	YAXIS
+C
+	ELSE IF(ICOM.EQ.'%YAXIS')THEN
+        
+            dms = 0
+            DO 200 ii = 1, 4
+              hgrat(ii,1) = 0.
+              hgrat(ii,2) = 0.
+              vgrat(ii,1) = 0.
+              vgrat(ii,2) = 0.
+200         CONTINUE
+
+            hcolor(1) = 1 
+            hcolor(2) = 1
+            vcolor(1) = 1
+            vcolor(2) = 1
+            across = 0.
+            lineflag = .FALSE.
+
+	    CALL INQSCL(XFF,YFF,XOR,YOR,XLOW,YLOW)
+	    IF(M.GE.1.AND.IFLG(1).NE.0)THEN
+		YLOW=P(1)
+	    ELSE
+		YLOW=YLO
+	    ENDIF
+	    IF(M.GE.2.AND.IFLG(2).NE.0)THEN
+		YHIGH=P(2)
+	    ELSE
+		YHIGH=YHI
+	    ENDIF
+	    IF(M.GE.3.AND.IFLG(3).NE.0)THEN
+		YTICC=P(3)
+	    ELSE
+		YTICC=YTIC
+	    ENDIF
+	    IF(M.GE.4.AND.IFLG(4).NE.0)THEN
+		IF(SUSER)THEN
+		    XX=P(4)
+		ELSE
+		    XX=XLOW+P(4)/XFF
+		ENDIF
+	    ELSE
+		XX=XLOW
+	    ENDIF
+	    IF(M.GE.5.AND.IFLG(5).NE.0)THEN
+		NSMTCS=P(5)
+	    ELSE
+		NSMTCS=NMTCY
+	    ENDIF
+	    IF(M.GE.6.AND.IFLG(6).NE.0)THEN
+		LINTT=P(6)
+	    ELSE
+		LINTT=LINTY
+	    ENDIF
+	    IF(M.GE.7.AND.IFLG(7).NE.0)THEN
+		YUNIT=P(7)
+	    ELSE
+		YUNIT=1.
+	    ENDIF
+	    IF(M.GE.8.AND.IFLG(8).NE.0)THEN
+		IPOS=P(8)
+	    ELSE
+		IPOS=LABELY
+	    ENDIF
+	    IY=IPOS
+	    IF(M.GE.9.AND.IFLG(9).NE.0)THEN
+		CHSIZE=P(9)
+	    ELSE
+		CHSIZE=YCSIZE
+	    ENDIF
+
+c	    IF(N.GT.0)THEN
+c		FRMTX=LABEL(1:N)
+c	    ELSE IF(IFRX.NE.' ')THEN  <-- bug here: check IFRY instead.
+c		FRMTX=IFRY
+c	    ELSE
+c		CALL FRMT(YLOW,YHIGH,NSIGY,FRMTX)
+c	    ENDIF
+
+
+	    IF(N.GT.0)THEN
+		FRMTX=LABEL(1:N)
+	    ELSE IF(IFRY.NE.' ')THEN
+		FRMTX=IFRY
+	    ELSE
+		CALL FRMT(YLOW,YHIGH,NSIGY,FRMTX)
+	    ENDIF
+
+	    YFF=YLEN/(YHIGH-YLOW)
+	    CALL SCALE(XFF,YFF,XOR,YOR,XLOW,YLOW)
+	    call color(ipen(0))
+	    CALL YAXIS1(XX,XFF,YLOW,YHIGH,YTICC,NSMTCS,LINTT,YUNIT,
+     *		IPOS,FRMTX,YFF,CHSIZE,across,dms,hgrat,hcolor,hline,
+     *          yvaloff,.FALSE.,SHRINKY)
+
+            CALL tm_break_lines (ylab, lnbeg, lnend, numlines)
+            nfont = 0
+            npen = 0
+            fontprefix = ""
+            penprefix = ""
+            DO 30 j = 1, numlines
+               CALL getlabfonts (ylab, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+	       IF(IPOS.LT.0)THEN
+	           XL=XX-(YWID+HYLAB)/XFF
+	       ELSE
+	           XL=XX+(YWID+2.0*HYLAB)/XFF
+	       ENDIF 
+               XL = XL + line_spacing*(j-1)*hylab/xff
+	       YL=YLOW+(YLEN-SYMWID(HYLAB,NCHR+npen+nfont,
+     .                  penprefix(1:npen)//fontprefix(1:nfont)//
+     .                  ylab(lnbeg(j):lnend(j) )) )*.5/XFF
+
+               CALL SYMBEL(XL,YL,90.,HYLAB,NCHR+npen+nfont,
+     .                  penprefix(1:npen)//fontprefix(1:nfont)//
+     .                  ylab(lnbeg(j):lnend(j)))
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+               IF (npnew.GT.0) THEN
+                  penprefix(1:npnew) = newpen(1:npnew)
+                  npen = npnew
+               ENDIF
+               IF (nfnew.GT.0) THEN
+                  fontprefix(1:nfnew) = newfont(1:nfnew)
+                  nfont = nfnew
+               ENDIF
+
+  30        CONTINUE
+
+C
+C***	PLTLIN
+C
+	ELSE IF(ICOM.EQ.'%PLTLIN')THEN
+	    IF(M.GE.1.AND.IFLG(1).NE.0)THEN
+		I=P(1)
+	    ELSE
+		I=1
+	    ENDIF
+	    IF(IWIND.GT.0)THEN
+	    	CALL INQSCL(XFF,YFF,XOR,YOR,XLOW,YLOW)
+		XHIGH=XLOW+XLEN/XFF
+		YHIGH=YLOW+YLEN/YFF
+		CALL WINDOW(XLOW,YLOW,XHIGH,YHIGH)
+	    ENDIF
+	IBASE=0
+	IY=NXS/2
+C
+	DO 50 J=1,I-1
+50	IBASE=IBASE+LLENG(J)
+C
+	  CALL MARKH(HMARK(I))
+	  CALL COLOR(IPEN(I))
+C
+C     SET PLOT MODE
+	    IF(ITYPE(I).GE.4)THEN
+	      CALL DASHSZ(DN1(I),UP1(I),DN2(I),UP2(I))
+	      CALL DASHES
+	    ELSE
+	      CALL VECTRS
+	    END IF
+	    IF(ITYPE(I).EQ.3)CALL POINTS
+	    IF(.NOT.(XLE.OR.XEQ.OR.XGE.OR.YLE.OR.YEQ.OR.YGE))THEN
+C     DO NOT CHECK POINTS FOR MISSING DATA
+	      CALL TRANS(I,X(IBASE+1),X(IY+IBASE+1),XT,YT)
+	      CALL PLOT(XT,YT,0,0)
+	      IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+	      IM=0
+	      IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	      DO 60 J=IBASE+1,IBASE+LLENG(I)
+	        CALL TRANS(I,X(J),X(IY+J),XT,YT)
+	        CALL PLOT(XT,YT,1,0)
+60            CALL MARK(IM)
+	    ELSE
+C     CHECK POINTS FOR OUT OF RANGE   (CM)
+	      DO 70 J=IBASE+1,IBASE+LLENG(I)
+		IF(XLE.AND.X(J).LE.CMXLE)GOTO 70
+		IF(XEQ.AND.X(J).EQ.CMXEQ)GOTO 70
+		IF(XGE.AND.X(J).GE.CMXGE)GOTO 70
+		IF(YLE.AND.X(IY+J).LE.CMYLE)GOTO 70
+		IF(YEQ.AND.X(IY+J).EQ.CMYEQ)GOTO 70
+		IF(YGE.AND.X(IY+J).GE.CMYGE)GOTO 70
+	        CALL TRANS(I,X(J),X(IY+J),XT,YT)
+	        CALL PLOT(XT,YT,0,0)
+	        IF(ITYPE(I).NE.0.AND.ITYPE(I).NE.4)CALL MARK(IMARK(I))
+ 	        IM=0
+	        IF(ITYPE(I).EQ.1.OR.ITYPE(I).EQ.3)IM=IMARK(I)
+	        GOTO 71
+70	      CONTINUE
+71	      IF=1
+	      DO 72 K=J+1,IBASE+LLENG(I)
+		IF((XLE.AND.X(K).LE.CMXLE).OR.
+     *		   (XEQ.AND.X(K).EQ.CMXEQ).OR.
+     *		   (XGE.AND.X(K).GE.CMXGE).OR.
+     *		 (YLE.AND.X(IY+K).LE.CMYLE).OR.
+     *		 (YEQ.AND.X(IY+K).EQ.CMYEQ).OR.
+     *		 (YGE.AND.X(IY+K).GE.CMYGE))THEN
+	          IF=0
+	        ELSE
+	          CALL TRANS(I,X(K),X(IY+K),XT,YT)
+	          CALL PLOT(XT,YT,IF,0)
+	          CALL MARK(IM)
+	          IF(IF.EQ.0)THEN
+	            IF=1
+	          END IF
+	        END IF
+72	      CONTINUE
+	    END IF
+	    IF(ITYPE(I).EQ.2.OR.ITYPE(I).EQ.5)CALL MARK(IMARK(I))
+ 	CALL COLOR(IPEN(0))
+	CALL WINDOW(0.,0.,0.,0.)
+C
+C***	%LABEL
+C
+	ELSE IF(ICOM.EQ.'%LABEL')THEN
+	    IF(N.EQ.0)RETURN
+
+* get missing inputs interactively -- through mouse input (6/99)
+* ... if the user **explicitly** omits the justification (iflg(3)) then
+*	put up menu (including arrow options)
+	    mouse_input = m.LE.2 .OR. iflg(1).EQ.0 .OR. iflg(2).EQ.0
+	    need_arrow = .FALSE.
+	    IF ( mouse_input ) THEN
+	      need_justify = m.GE.3 .AND. iflg(3).EQ.0
+	      ichoice = IGRNPT(wsid, need_justify, xp, yp)	! mouse input
+	      need_arrow =   ichoice.EQ.70 .OR. ichoice.EQ.102
+     .			.OR. ichoice.EQ.76 .OR. ichoice.EQ.108
+	      IF (need_arrow) THEN
+* ... user wants a line pointing to the text
+	         idummy = IGRNPT(wsid, .FALSE., p(1), p(2))
+	         p(3) = -1	! left justify
+	         IF( ichoice.EQ.70 .OR. ichoice.EQ.102 )THEN	 ! arow head?
+	           iat = 2
+	         ELSE
+	           iat = 1
+	         ENDIF
+	      ELSE
+* ... user just wants text
+	         p(1) = xp
+	         p(2) = yp
+	         IF (ichoice .EQ. 67 .OR. ichoice.EQ.99) THEN
+	           p(3) = 0	! center
+	         ELSE  IF (ichoice .EQ. 82 .OR. ichoice.EQ.114) THEN
+	           p(3) = 1	! right justify
+	         ELSE	
+	           p(3) = -1	! left justify
+	         ENDIF
+	      ENDIF
+	      iflg(1) = 1
+	      iflg(2) = 1
+	      iflg(3) = 1
+	      IF (m.LT.3) m = 3
+	    ENDIF
+
+C
+C	SET SCALE FOR LABEL
+C
+	    CALL INQSCL(XFF,YFF,XOR,YOR,XLOW,YLOW)
+	    IF(M.GE.3.AND.IFLG(3).NE.0)THEN
+		IPOS=P(3)
+	    ELSE
+	    	IPOS=-1
+	    ENDIF
+	    IF(M.GE.4.AND.IFLG(4).NE.0)THEN
+	    	ANG=P(4)
+	    ELSE
+	        ANG=0.
+	    ENDIF
+	    IF(M.GE.5.AND.IFLG(5).NE.0)THEN
+	    	CHSIZE=P(5)
+	    ELSE
+	    	CHSIZE=HLAB1
+	    ENDIF
+	    IF(SUSER .OR. mouse_input)THEN	! mouse is always /USER
+	    	XFUSER=1.
+		YFUSER=1.
+		YLOUSR=0.
+		XLOUSR=0.
+	    ELSE
+	    	XFUSER=XFF
+		YFUSER=YFF
+		XLOUSR=XLOW
+		YLOUSR=YLOW
+	    ENDIF
+	    CS=COS(ANG*0.0175329252)
+	    SN=SIN(ANG*0.0175329252)
+
+            CALL tm_break_lines (label, lnbeg, lnend, numlines)
+            nfont = 0
+            npen = 0
+            fontprefix = ""
+            penprefix = ""
+            DO 40 j = 1, numlines
+               CALL getlabfonts (label, lnbeg, lnend, j, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+
+	       XMN=SYMWID(CHSIZE,NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 label(lnbeg(j):lnend(j)))
+	       SHFT=0.0
+	       IF(IPOS.GT.0)THEN
+	   	   SHFT=-XMN
+	       ELSE IF(IPOS.EQ.0)THEN
+		   SHFT=-XMN*.5
+	       ENDIF
+
+	       XT=P(1)/XFUSER+XLOUSR+CS*SHFT/XFF + 
+     .             line_spacing*(j-1)*chsize*SN/xff
+	       YT=P(2)/YFUSER+YLOUSR+SN*SHFT/YFF - 
+     .             line_spacing*(j-1)*chsize*CS/yff
+
+	       IF (need_arrow .AND. j.EQ.1) CALL ARROW(p(1),p(2),xp,yp,
+     .				IAT,SHFT,XMN,CS,SN,XFF,YFF,chsize)
+
+               CALL SYMBEL(XT,YT,ANG,CHSIZE,NCHR+npen+nfont,
+     .                 penprefix(1:npen)//fontprefix(1:nfont)//
+     .                 label(lnbeg(j):lnend(j)))
+
+C  Set up to use any font settings from this line on subsequent lines.
+
+               IF (npnew.GT.0) THEN
+                  penprefix(1:npnew) = newpen(1:npnew)
+                  npen = npnew
+               ENDIF
+               IF (nfnew.GT.0) THEN
+                  fontprefix(1:nfnew) = newfont(1:nfnew)
+                  nfont = nfnew
+               ENDIF
+
+  40        CONTINUE
+C
+C
+C***	%WHERE
+C
+	ELSE IF(ICOM.EQ.'%WHERE')THEN
+	    idummy = IGRNPT(wsid, .FALSE., p(1), p(2))	! mouse input
+
+	ENDIF
+
+	RETURN
+	END
diff --git a/ppl/plot/rdseq.F b/ppl/plot/rdseq.F
new file mode 100644
index 0000000..5309237
--- /dev/null
+++ b/ppl/plot/rdseq.F
@@ -0,0 +1,288 @@
+	SUBROUTINE RDSEQ(X,NSIZE,PBUF,IBASE,FILE)
+	DIMENSION X(NSIZE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)rdseq.F	1.2    3/18/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'HD.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'EPICLUN.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+	INCLUDE 'COMTHDR.INC'
+	INCLUDE 'COMEPV.INC'
+	INCLUDE 'COMEPS.INC'
+
+	LOGICAL LEOF,LFIRST,LSTICK
+	CHARACTER*10 CEPIC1,CEPIC2,FILE*(*)
+	CHARACTER YES*3,NO*2,SYM*120,CSYM*6
+	INTEGER PBUF
+	DATA YES,NO/'YES','NO'/
+C
+	SYM='*PPL$EOF'
+	CALL PUTSYM(SYM,NO,2,IER)
+C
+	IF(LINEN.EQ.0)CALL RSMNMX
+	I=1
+	IF(IFLG(4).NE.0.AND.M.GE.4)I=P(4)
+	ITYPEZ=0
+	IF(IFLG(3).NE.0.AND.M.GE.3)ITYPEZ=IFIX(P(3))
+	ILOOP=I
+	IF (IEFLG.EQ.1 .AND. IEPV2.EQ.10) THEN
+	    ILOOP=I*2
+	    LSTICK=.TRUE.
+	ELSE
+	    LSTICK=.FALSE.
+	ENDIF
+	LFIRST=.TRUE.
+C_______
+	DO 1603 JJ=1,ILOOP
+	  IF(.NOT.SVECTR)THEN
+	    IF(IFLG(1).EQ.0)THEN
+		NX=NSIZE/2-IBASE
+	    ELSE
+		NX=IFIX(P(1))
+	    ENDIF
+	    IF(IFLG(2).EQ.0.OR.M.LT.2)THEN
+		NY=1
+	    ELSE
+		NY=IFIX(P(2))
+	    ENDIF
+	    IF(JZ.NE.0)THEN
+		IF(NX*NY.GT.NSIZE)THEN
+		    IF(.NOT.QUIETF)WRITE(LTTOUT,9993)NX*NY
+9993		    FORMAT(I10,' exceeds buffer')
+		    GOTO 10
+		ENDIF
+	    ELSE
+		NX=MIN0(NSIZE/2-IBASE,NX)
+	    ENDIF
+	  ENDIF
+	    NREC=NX*NY/NGRP
+	    LINEN=LINEN+1
+	    IF(IFORM(1:3).EQ.'DSF'.OR.IFORM(1:4).EQ.'BIBO'
+     *		.OR.IFORM(1:3).EQ.'PPL')THEN
+		CALL REDSF(X,NX,NY,NSIZE,IBASE,FILE)
+C
+	    ELSE IF(IFORM(1:3).EQ.'EPI')THEN
+		IF (LSCTD) THEN
+		    IF (LSNEXT) BACKSPACE (LUN11)
+		    CALL EPICRD (NCAST,NDATA,LEOF,.FALSE.)
+		    DO 1050 IDUM1=1,8
+1050		    THEADER(IDUM1)=HEADER(IDUM1)
+		ELSE
+		    IF (LSNEXT) BACKSPACE (LUN11)
+		    CALL EPICTRD(IDUM1,XDATE,XTIME,XDAT2,XTIM2,
+     1		            P(14),LEOF,.FALSE.)
+		    IF (P(14) .LE. 0.) THEN
+			P(14)=-P(14)
+			LSTIME=.TRUE.
+		     ENDIF
+		ENDIF
+		IF(LEOF)THEN
+		    LINEN=LINEN+1
+		    LLENG(LINEN)=0
+		    GOTO 110
+		ENDIF
+C
+C  GET U FOR STICK PLOT, SET UP FOR V ON NEXT PASS
+C
+		IF (LSTICK .AND. LFIRST) THEN
+		    IEPV1=9
+		    IEPV2=6
+		    BACKSPACE (LUN11)
+C
+C  GET V FOR STICK PLOT
+C
+		ELSE IF (LSTICK) THEN
+		    IEPV1=9
+		    IEPV2=7
+		ENDIF
+		IF (IEFLG .EQ. 1) CALL EPICVC
+C
+C           JX=JY=0 IMPLIES BOTH AXES ARE TIME AXES.  BYPASS THIS
+C           DATA SET.
+C
+		IF (JY.EQ.0 .AND. JX.EQ.0) THEN
+		    LINEN=LINEN+1
+		    LLENG(LINEN)=0
+		    GOTO 110
+		ENDIF
+		IF (IGTLAB .EQ. 1) THEN
+		    CALL EPICTLAB
+		    IF (LSTICK .AND. (.NOT.LFIRST)) THEN
+			IYLAB=MAX0 (INDEX(YLAB,',')+1, INDEX(YLAB,'(')-1)
+			YLAB(1:)=YLAB(IYLAB:)
+		    ENDIF
+		ENDIF
+		IF(ITFLG .NE. 0)THEN
+C
+C		Get end time adjusted by time offset if needed.
+C
+		    IF (LSOFFS) THEN
+			CALL EPICTIMC (XDAT2,XTIM2,CEPIC1)
+			CALL TIME1 (1,CEPIC1, 2,'          ',
+     1			            ICEPIC2,CEPIC2,P(14)/2.)
+			READ (CEPIC2,2003) XDAT2,XTIM2
+2003			FORMAT (F6.0,F4.0)
+		    ENDIF
+C
+C		Get time axis limits and set up for time variable.
+C
+		    CALL EPICTLIM (XDATE,XTIME,XDAT2,XTIM2)
+		    CALL EPICTIMC (XDATE,XTIME,ICOM)
+		    OFF=DIFF(ITSTRT,ICOM)/DT+1.
+		    P(14)=P(14)/DT
+		    IF (LSOFFS) OFF=OFF+P(14)/2.
+		ENDIF
+		IX=IBASE-1
+		CALL READSQ(X,NX,NY,NSIZE,IBASE,FILE)
+		IF (LSTICK .AND. LFIRST) REWIND LUN1
+C
+C	    SET NX TO ACTUAL NUMBER OF POINTS READ
+C
+		NX=LLENG(LINEN)
+C
+C	    IF SWITCH STIME IS FALSE, THE SEQUENCE NUMBER IS
+C	    TRANSFORMED INTO UNITS OF TSTRT AND DT.
+C
+C	    IF SWITCH STIME IS TRUE (MEANING TO READ DATE/TIME WORDS
+C	    FROM THE EPIC DATA FILE) THEN THE DATE/TIME WORDS WERE
+C	    TRANSFORMED IN ROUTINE READSQ WHERE THE DATA FILE WAS READ.
+C
+		IF (ITFLG.EQ.1 .AND. .NOT.LSTIME) THEN
+		    DO 2001 J=1,NX
+			X(IX+J)=(FLOAT(J)-1.0)*P(14)+OFF
+2001		    CONTINUE
+		ELSE IF (ITFLG.EQ.-1 .AND. .NOT.LSTIME) THEN
+		    IY=NSIZE/2 + IX
+		    DO 2002 J=1,NX
+			X(IY+J)=(FLOAT(J)-1.0)*P(14)+OFF
+2002		    CONTINUE
+		ENDIF
+		IF (LSTICK) THEN
+		    IEPV2=10
+		    IEPV1=9
+		    LFIRST=.NOT. LFIRST
+		ENDIF
+C
+	    ELSE
+		CALL READSQ(X,NX,NY,NSIZE,IBASE,FILE)
+	    ENDIF
+110	    IF(LLENG(LINEN).LE.0)THEN
+		LINEN=LINEN-1
+		IF(.NOT.QUIETF)WRITE(LTTOUT,'('' NO POINTS READ'')')
+		IF(LINEN.EQ.0)PBUF=0
+		SYM='*PPL$EOF'
+		CALL PUTSYM(SYM,YES,3,IER)
+		GOTO 10
+	    END IF
+	    IF(JTYPE.EQ.1)GOTO 1602
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,'('' CONTOUR DATA READ'')')
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,'('' NX='',I5,''  NY='',I5)')NX,NY
+	    LNUM=1
+	    IBASE=1
+	    LINEN=0
+	    CALL STMNMX(X,NSIZE,XMIN,XMAX,YMIN,YMAX)
+	    GOTO 10
+1602	    IF(.NOT.QUIETF)WRITE(LTTOUT,9990)LLENG(LINEN)
+9990	    FORMAT(1X,I6,' POINTS READ')
+	    WRITE (CSYM,9992)LLENG(LINEN)
+9992	    FORMAT (I6)
+	    SYM='*PPL$POINTS'
+	    CALL PUTSYM(SYM,CSYM,6,IER)
+	    PBUF=1
+	    CALL STMNMX(X,NSIZE,XMIN,XMAX,YMIN,YMAX)
+C
+C	IF THE NEXT LINE WILL OVERFLOW THE BUFFER
+C	SET UP LINEN SUCH THAT IT OVER WRITES THE LAST
+C	LINE
+C
+	    LNUM=LINEN
+	    IF(LINEN.GE.NLINES)THEN
+		LINEN=NLINES - 1
+	    ELSE
+		IBASE=IBASE+LLENG(LINEN)
+	    ENDIF
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,9991)LINEN
+9991	    FORMAT(' LINE',I3,' READ')
+1603	CONTINUE
+C_______
+10	RETURN
+	
+	ENTRY RDSEQ2(X,NSIZE,PBUF,IBASE,FILE)
+#ifdef unix
+	IF(.NOT.QUIETF)WRITE(LTTOUT,9990)LLENG(LINEN)
+	PBUF=1
+	CALL STMNMX(X,NSIZE,XMIN,XMAX,YMIN,YMAX)
+C
+C	IF THE NEXT LINE WILL OVERFLOW THE BUFFER
+C	SET UP LINEN SUCH THAT IT OVER WRITES THE LAST
+C	LINE
+C
+	LNUM=LINEN
+	IF(LINEN.GE.NLINES)THEN
+	    LINEN=NLINES - 1
+	ELSE
+	    IBASE=IBASE+LLENG(LINEN)
+	ENDIF
+	IF(.NOT.QUIETF)WRITE(LTTOUT,9991)LINEN
+	GOTO 10
+#else
+	GOTO 1602
+#endif
+	END
diff --git a/ppl/plot/readsq.F b/ppl/plot/readsq.F
new file mode 100644
index 0000000..c46d2bd
--- /dev/null
+++ b/ppl/plot/readsq.F
@@ -0,0 +1,359 @@
+        SUBROUTINE READSQ(X,NXS,NYS,NSIZE,IBASE,NAME)
+	DIMENSION X(NSIZE),XT(1000,20)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)readsq.F	1.2    3/18/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+#ifdef unix
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'zgridd_inc.decl'
+        include 'ZGRIDD.INC'
+        include 'zgrid_inc.decl'
+        include 'ZGRID.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'labels_inc.decl'
+        include 'LABELS.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'lunits_inc.decl'
+        include 'LUNITS.INC'
+        include 'system_inc.decl'
+        include 'SYSTEM.INC'
+        include 'comeps_inc.decl'
+        include 'COMEPS.INC'
+        include 'comthdr_inc.decl'
+        include 'COMTHDR.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+#else
+        INCLUDE 'tmap_pplv11inc:tmap_PARAMPL5.DAT'
+        INCLUDE 'tmap_pplv11inc:tmap_ZGRIDD.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_ZGRID.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_LINES.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_HD.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_DATA.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_CMRD.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_CMRDL.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_LABELS.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_MISS.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_LUNITS.INC'
+        INCLUDE 'TMAP_PPLV11INC:SYSTEM_INC.DECL'
+        INCLUDE 'PPLV11INC:SYSTEM.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_COMEPS.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_COMTHDR.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_TAXIS.INC'
+        INCLUDE 'tmap_pplv11inc:tmap_AXISL.INC'
+        INCLUDE 'TMAP_PPLV11INC:SWITCH_INC.DECL'
+        INCLUDE 'PPLV11INC:SWITCH.INC'
+#endif
+	INTEGER*4 IEPIC1,IEPIC2
+	CHARACTER NAME*(*)
+C     NREC=NUMBER OF RECORDS TO BE READ
+C     NGRP=NUMBER OF GROUPS TO BE READ PER RECORD
+C     NVAR=NUMBER OF VARIABLE PER GROUP
+	IX=IBASE-1
+	IY=NSIZE/2+IX
+	IF(SVECTR)THEN
+	    IVLEN=NX*NY
+	    IF(JX.GT.0.and.JZ.GT.0)THEN
+		IF(IZLEN.EQ.0)IZLEN=IZSE
+	    ELSE
+		IZLEN=NX*NY
+	    ENDIF
+	    NREC=IZLEN/NGRP
+	ELSE
+	    IVLEN=0
+	    IZLEN=0
+	    IF(JX.GT.0.AND.JZ.GT.0)THEN
+	    	CALL STPRMP('rd>',3)
+	    	IF(.NOT.QUIETF)WRITE(LTTOUT,'('' ENTER # PTS TO READ'')')
+	     	CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	    	CALL STPRMP('ppl+>',5)
+C
+C	RSX-11M
+C
+C	CLOSE(6)
+C	OPEN(LMULT,FILE='SY:QZZDAT.DAT',STATUS='NEW',FORM='UNFORMATTED')
+C
+C	END RSX-11M
+C
+	    	IF(IFLG(1).EQ.0)P(1)=IZSE
+	    	NREC=MIN0(IZSE,INT(P(1)))/NGRP
+	    END IF
+	ENDIF
+	II=1
+	JJ=1
+	DO 50 KK=1,NREC
+	IF(IFORM(1:3).NE.'UNF'.AND.IFORM(1:3).NE.'EPI')THEN
+	    IF(IFORM(1:4).EQ.'FREE')THEN
+		READ(LUNN,*,END=11,ERR=1000)((XT(K,J),J=1,NVAR),
+     *		K=1,NGRP)
+	    ELSE
+		READ(LUNN,IFORM,END=11,ERR=1000)((XT(K,J),J=1,NVAR),
+     *		K=1,NGRP)
+	    END IF
+	ELSE
+C     IF UNFORMATTED USE NGRP OR NREC WHICH EVER IS LARGER
+	    READ(LUNN,END=11,ERR=1000)((XT(K,J),J=1,NVAR),K=1,NGRP)
+	END IF
+	IF(JZ.GT.0)GOTO 100
+	IF(JX.GT.0)THEN
+	    IF(JY.GT.0)THEN
+		DO 20 I=1,NGRP
+		X(IX+II)=XT(I,JX)
+		X(IY+II)=XT(I,JY)
+20		II=II+1
+	    ELSE
+C
+C		If EPIC data and switch STIME (read EPIC time words),
+C		make time variable = a sequence number which is 1 for
+C		ITSTRT (usually first data point) and for which an
+C		increment of 1 is 1 DT unit (usually 1440 minutes).
+C		Offset by epico, which is delta-t for time series
+C		on data file header (to get to center of time interval
+C		if that is non-zero), unless lsoffs=.false.
+C
+		IF (LSTIME .AND. IFORM(1:3).EQ.'EPI') THEN
+		    IF (LSOFFS) THEN
+		        READ (THEADER(3)(61:78),222) EPICO
+222		        FORMAT (E18.0)
+		        EPICO=EPICO/2./DT
+		    ELSE
+		        EPICO=0.
+		    ENDIF
+		    READ (ITSTRT,221) EPDATE,EPTIME
+221		    FORMAT (F6.0,F4.0)
+		    CALL EPICSQ (EPDATE,EPTIME,IEPIC1)
+		    DO 200 I=1,NGRP
+		    X(IX+II)=XT(I,JX)
+		    CALL EPICSQ (XT(I,1),XT(I,2),IEPIC2)
+		    X(IY+II) = FLOAT(IEPIC2-IEPIC1) / DT + 1. + EPICO
+200		    II=II+1
+		ELSE
+		    DO 21 I=1,NGRP
+		    X(IX+II)=XT(I,JX)
+		    X(IY+II)=FLOAT(II)
+21		    II=II+1
+	    	ENDIF
+	    END IF
+	ELSE
+	    IF (LSTIME .AND. IFORM(1:3).EQ.'EPI') THEN
+		IF (LSOFFS) THEN
+		    READ (THEADER(3)(61:78),222) EPICO
+		    EPICO=EPICO/2./DT
+		ELSE
+		    EPICO=0.
+		ENDIF
+		READ (ITSTRT,221) EPDATE,EPTIME
+		CALL EPICSQ (EPDATE,EPTIME,IEPIC1)
+	        DO 210 I=1,NGRP
+		CALL EPICSQ (XT(I,1),XT(I,2),IEPIC2)
+		X(IX+II) = FLOAT(IEPIC2-IEPIC1) / DT + 1. + EPICO
+	        X(IY+II)=XT(I,JY)
+210	        II=II+1
+	    ELSE
+	        DO 22 I=1,NGRP
+	        X(IX+II)=FLOAT(II)
+	        X(IY+II)=XT(I,JY)
+22	        II=II+1
+	    ENDIF
+	END IF
+	GOTO 50
+100	IF(JX.LE.0)THEN
+	    DO 30 IC=1,NGRP
+	    X(IVLEN+NXS*(JJ-1)+II)=XT(IC,JZ)
+	    IF(ITYPEZ.EQ.0)THEN
+		II=II+1
+		IF(II.GT.NX)THEN
+		    JJ=JJ+1
+		    II=1
+		ENDIF
+	    ELSE
+		JJ=JJ+1
+		IF(JJ.GT.NY)THEN
+		    II=II+1
+		    JJ=1
+		ENDIF
+	    END IF
+30     CONTINUE
+	ELSE
+	    DO 31 IC=1,NGRP
+C
+C	RSX-11M
+C
+C	WRITE(LMULT)XT(IC,JX),XT(IC,JY),XT(IC,JZ)
+C
+C	END RSX-11M
+C
+C	VAX/VMS
+C
+	    XX(II)=XT(IC,JX)
+	    YY(II)=XT(IC,JY)
+	    ZZ(II)=XT(IC,JZ)
+	    II=II+1
+C
+C	END VAX/VMS
+C
+31	    CONTINUE
+	ENDIF
+50	CONTINUE
+11	LEN=(KK-1)*NGRP
+	LLENG(LINEN)=LEN
+	IF(LEN.LE.0)RETURN
+	IF(JZ.GT.0)GOTO 400
+	JTYPE=1
+	ZMIN=0.
+	ZMAX=ZMIN
+	XMIN=1.E38
+	YMIN=XMIN
+	XMAX=-XMIN
+	YMAX=XMAX
+	DO 23 I=1,LEN
+	IF((XLE.AND.X(IX+I).LE.CMXLE).OR.
+     *	   (XEQ.AND.X(IX+I).EQ.CMXEQ).OR.
+     *	   (XGE.AND.X(IX+I).GE.CMXGE).OR.
+     *	   (YLE.AND.X(IY+I).LE.CMYLE).OR.
+     *	   (YEQ.AND.X(IY+I).EQ.CMYEQ).OR.
+     *	   (YGE.AND.X(IY+I).GE.CMYGE))GOTO 23
+	IF(X(IX+I).LT.XMIN)XMIN=X(IX+I)
+	IF(X(IX+I).GT.XMAX)XMAX=X(IX+I)
+	IF(X(IY+I).LT.YMIN)YMIN=X(IY+I)
+	IF(X(IY+I).GT.YMAX)YMAX=X(IY+I)
+23	CONTINUE
+	RETURN
+400	JTYPE=0
+	IF(SVECTR)JTYPE=-1
+C
+C	RSX-11M
+C
+C	IF(JX.GT.0)THEN
+C	CLOSE(6)
+C	OPEN(LMULT,FILE='SY:ECHO.DAT',STATUS='OLD',ACCESS='APPEND',
+C     *	CARRIAGECONTROL='LIST')
+C	ENDIF
+C
+C	END RSX-11M
+C
+	IF(.NOT.SVECTR)THEN
+	    CALL STPRMP('rd>',3)
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,'('' ENTER XMIN,XMAX,YMIN,YMAX'')')
+	    CALL GETCMD(STRING,ISLEN,ICOM,P,IFLG,M,LABEL,N,LBSTRT)
+	    CALL STPRMP('ppl+>',5)
+	    XMIN=P(1)
+	    XMAX=P(2)
+	    YMIN=P(3)
+	    YMAX=P(4)
+	ENDIF
+	IF(JX.GT.0)THEN
+	    DX=(XMAX-XMIN)/FLOAT(NX-1)
+	    DY=(YMAX-YMIN)/FLOAT(NY-1)
+	    IZLEN=LEN
+C
+C	RSX-11M
+C
+C	CLOSE(LMULT)
+C	OPEN(LMULT,FILE='SY:QZZCMD.DAT',STATUS='NEW',FORM='UNFORMATTED')
+C	WRITE(LMULT)LEN,NX,NY,XMIN,YMIN,DX,DY,CAY,NRNG
+C	CLOSE(LMULT)
+C	CALL GETLUN(LTTOUT,DAT)
+C	WRITE(DV,'(I2)')DEV
+C	IF(DEV.LT.10)DV(1:1)='0'
+C	CMDLIN(28:29)=DV
+C	CALL SPAWN(MCR,,,,,,,CMDLIN,29)
+C	CALL STOP
+C	OPEN(LMULT,FILE='SY:QZZDAT.DAT',STATUS='OLD',FORM='UNFORMATTED')
+C	DO 500 I=1,NX
+C	DO 500 J=1,NY
+C	READ(LMULT)X(NXS*(J-1)+I)
+C500	CONTINUE
+C	CLOSE(LMULT,DISP='DELETE')
+C	OPEN(LMULT,FILE='SY:ECHO.DAT',STATUS='OLD',ACCESS='APPEND',
+C     *	CARRIAGECONTROL='LIST')
+C
+C	END RSX-11M
+C
+C	VAX/VMS
+C
+	    DO 500 I=1,NX
+	    DO 500 J=1,NY
+	    X(IVLEN+NXS*(J-1)+I)=0.0
+500	    CONTINUE
+	    IF(CAY.GE.0)THEN
+		CALL ZGRID(X(IVLEN+1),NX,NY,NX,NY,XMIN,YMIN,DX,DY,
+     *		XX,YY,ZZ,LEN,CAY,NRNG)
+	    ELSE
+		CALL LINEAR(X(IVLEN+1),NX,NY,NX,NY,XMIN,YMIN,DX,DY,
+     *		XX,YY,ZZ,LEN,CAY,NRNG)
+	    ENDIF
+C
+C	END VAX/VMS
+C
+	ENDIF
+	RETURN
+C	ERRORS
+1000	IF(.NOT.QUIETF)WRITE(LTTOUT,
+     *	'('' FATAL READ ERRORS IN READSEQ'')')
+	IF(.NOT.QUIETF)WRITE(LTTOUT,9999) NAME,IFORM
+9999	FORMAT('  NAME= ',A30,'   TYPE= ',A20)
+#ifndef unix
+	CALL ERRTST(64,I)
+#endif
+	RETURN
+	END
diff --git a/ppl/plot/redsf.F b/ppl/plot/redsf.F
new file mode 100644
index 0000000..1cccb80
--- /dev/null
+++ b/ppl/plot/redsf.F
@@ -0,0 +1,357 @@
+      SUBROUTINE REDSF(X,NXS,NYS,NSIZE,IBASE,FILE) 
+	DIMENSION X(NSIZE)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)redsf.F	1.3    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'HD.INC'
+	INCLUDE 'PPL.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'SWITCH.INC'
+
+	character sym*120,str*120,file*(*)
+C     NREC=NUMBER OF RECORDS TO BE READ 
+C     NGRP=NUMBER OF GROUPS TO BE READ PER RECORD 
+C     NVAR=NUMBER OF VARIABLE PER GROUP 
+	IX=IBASE-1
+	IY=NSIZE/2+IX
+C	SAVE THE REQUESTED NUMBER OF POINTS
+	NXT=NX
+	LEN=0
+	CALL OPNDSF(FILE,'RD',LUNN)
+	IF(IFORM(1:3).EQ.'PPL')THEN
+c
+c	read format pplus dsf data file
+c
+	    call rdhdsf(lunn,367,ppts,j)
+	    if(j.eq.0)goto 12
+c
+c	set hd values
+c
+	    nx=pnx
+	    ny=pny
+	    jtype=ptype
+	    xmin=pxmin
+	    ymin=pymin
+	    xmax=pxmax
+	    ymax=pymax
+	    zmin=pzmin
+	    zmax=pzmax
+c
+c	transfer plot labels
+c
+	    write(str,998)pxlab
+998	    format(20a4)
+	    write(sym,997)'XLAB'
+997	    format('*PPL$P_',a)
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+	    if(igtlab.eq.1)xlab=str
+c
+	    write(str,998)pylab
+	    write(sym,997)'YLAB'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+	    if(igtlab.eq.1)ylab=str
+c
+	    write(str,996)pmlab
+996	    format(30a4)
+	    write(sym,997)'LAB'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+	    if(igtlab.eq.1)lab1=str
+c
+c	plot file information
+c
+	    write(str,995)pdate
+995	    format(4a4)
+	    write(sym,997)'PDATE'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)ptime
+	    write(sym,997)'PTIME'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)pident
+994	    format(8a4)
+	    write(sym,997)'PIDENT'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)psrc
+	    write(sym,997)'PSOURCE'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+c	variable informationc
+c
+	    write(str,994)varnme
+	    write(sym,997)'VARNAME'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vmean
+	    write(sym,997)'VMEAN'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vvar
+	    write(sym,997)'VVAR'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vstd
+	    write(sym,997)'VSTD'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vrms
+	    write(sym,997)'VRMS'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vmin
+	    write(sym,997)'VMIN'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vmax
+	    write(sym,997)'VMAX'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vdate
+	    write(sym,997)'VDATE'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vtime
+	    write(sym,997)'VTIME'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vjdate
+	    write(sym,997)'VJDATE'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)vident
+	    write(sym,997)'VIDENT'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vlat
+	    write(sym,997)'VLAT'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,995)vlong
+	    write(sym,997)'VLONG'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+c	grid information
+c
+	    write(str,993)gtype
+993	    format(2a4)
+	    write(sym,997)'GTYPE'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,993)gornt
+	    write(sym,997)'GORIENT'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)grid
+	    write(sym,997)'GRID'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+c	misc comments and user fields
+c
+	    write(str,996)cmnta
+	    write(sym,997)'COMMENT_A'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,996)cmntb
+	    write(sym,997)'COMMENT_B'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,996)cmntc
+	    write(sym,997)'COMMENT_C'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,996)cmntd
+	    write(sym,997)'COMMENT_D'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,996)cmnte
+	    write(sym,997)'COMMENT_E'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)usera
+	    write(sym,997)'USER_A'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)userb
+	    write(sym,997)'USER_B'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)userc
+	    write(sym,997)'USER_C'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	    write(str,994)userd
+	    write(sym,997)'USER_D'
+	    len=lnblk(str,120)
+	    call putsym(sym,str,len,ier)
+c
+	ELSE IF(IFORM(1:3).EQ.'DSF')THEN
+	    CALL RDHDSF(LUNN,IDSFRM,XPTS,J)
+	    IF(J.EQ.0)GOTO 12
+	    WRITE(LAB1,'(16A2)')(JLAB(I),I=1,16)
+	    LAB1(NCH+1:)=' '
+	    WRITE(XLAB,'(16A2)')(IXLB(I),I=1,16)
+	    XLAB(NCHX+1:)=' '
+	    WRITE(YLAB,'(16A2)')(IYLB(I),I=1,16)
+	    YLAB(NCHY+1:)=' '
+	ELSE
+	    CALL RDHDSF(LUNN,20,P,J)
+	    IF(J.EQ.0)GOTO 12
+	    XPTS=P(1)
+	    ZMIN=P(2)
+	    ZMAX=P(3)
+	    ZMEAN=P(4)
+	    JTYPE=1
+	    NX=IFIX(XPTS)
+	    NY=1
+	    XMIN=1
+	    XMAX=NX
+	    YMIN=ZMIN
+	    YMAX=ZMAX
+C
+C	    GET DSF LABELS
+C
+	    IF(IGTLAB.EQ.1)CALL DSFLAB
+	    IF(ITFLG.EQ.1)THEN
+		CALL DSFLIM
+		CALL MTMDY(P(11),IM,ID,IYR)
+		WRITE(ICOM,999)IYR,IM,ID,IFIX(P(13))
+999		FORMAT(3I2.2,I4.4)
+		OFF=DIFF(ITSTRT,ICOM)/DT+1.
+		P(14)=P(14)/DT
+	    ELSE
+		P(14)=1.0
+		OFF=1.0
+	    ENDIF
+	ENDIF
+        if(jtype.eq.2 .or. jtype.eq.-2)then
+           if(svectr)then
+              jtype=-2
+              ivlen=nx*ny+nx+ny
+              call rdddsv(lunn,nsize,x,j,ivlen+1)
+              iv=ivlen+nx*ny
+              call rdddsv(lunn,nsize,x,j,iv+1)
+              call rdddsv(lunn,nsize,x,j,iv+nx+1)
+           else
+              call rdddsv(lunn,nsize,x,j,1)
+              iv=nx*ny
+              call rdddsv(lunn,nsize,x,j,iv+1)
+              call rdddsv(lunn,nsize,x,j,iv+nx+1)
+           endif
+        else if(jtype.eq.0 .or. jtype.eq.-1)then
+	    IF(SVECTR)THEN
+                jtype=-1
+		CALL RDDDSV(LUNN,NSIZE,X,J,NX*NY+1)
+	    ELSE
+		CALL RDDDSV(LUNN,NSIZE,X,J,1)
+	    ENDIF
+	ELSE
+	    IF(IFORM(1:4).EQ.'BIBO')THEN
+		CALL RDDDSV(LUNN,NXT,X,J,IY+1)
+C		SET NX TO ACTUAL NUMBER OF POINTS READ
+		NX=J
+		DO 2001 J=1,NX
+		X(IX+J)=(FLOAT(J)-1.0)*P(14)+OFF
+2001		CONTINUE
+	    ELSE
+C		SET TO READ BIBO FORMAT
+		NX=MIN0(NXT,NX)
+		CALL RDDDSV(LUNN,NX,X,J,IX+1)
+		ISKP=NX-NXT
+		IF(ISKP.GT.0)THEN
+C		    NEED TO SKIP SOME OF THE X VARIABLE USE Y AS DUMMY
+		    CALL RDDDSV(LUNN,ISKP,X,J,IY+1)
+		ENDIF
+		CALL RDDDSV(LUNN,NX,X,J,IY+1)
+	    ENDIF
+	ENDIF
+	LEN=NX*NY
+12	CALL CLSDSF(LUNN)
+	LLENG(LINEN)=LEN
+	RETURN
+	END 
diff --git a/ppl/plot/rsmnmx.F b/ppl/plot/rsmnmx.F
new file mode 100644
index 0000000..4682e92
--- /dev/null
+++ b/ppl/plot/rsmnmx.F
@@ -0,0 +1,110 @@
+	SUBROUTINE RSMNMX
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOT]MINMAX.FOR
+
+* search for "TMAP" to find all revisions
+* *sh* - 1/27/89 corrected bug: min/max search improperly rejects LIMITs points
+* *sh* - 12/8/93 corrected bug: vectors blow on divied by zero attempt
+* *jd* - 4.20.99 Don't delete symbols {X,Y}{MIN,MAX} in overlay plots
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+C
+C	RESET MIN MAX SYMBOLS AND SET LINE_COUNT TO ZERO
+C
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+
+	CHARACTER SYM*120,TEMP*2
+C
+	SYM='*PPL$LINE_COUNT'
+	TEMP='0'
+	CALL PUTSYM(SYM,TEMP,1,IER)
+C
+	DO 10 I=1,LNUM
+	WRITE(SYM,999)'XMIN',I
+999	FORMAT('*PPL$',A,'(',I2,')')
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'XMAX',I
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'YMIN',I
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'YMAX',I
+	CALL DELSYM(SYM,IER)
+C
+	WRITE(SYM,999)'XFIRST',I
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'XLAST',I
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'YFIRST',I
+	CALL DELSYM(SYM,IER)
+	WRITE(SYM,999)'YLAST',I
+	CALL DELSYM(SYM,IER)
+10	CONTINUE
+C
+*jd*begin
+	IF(.NOT.SOVER)THEN
+	   SYM='*PPL$XMIN'
+	   CALL DELSYM(SYM,IER)
+	   SYM='*PPL$XMAX'
+	   CALL DELSYM(SYM,IER)
+	   SYM='*PPL$YMIN'
+	   CALL DELSYM(SYM,IER)
+	   SYM='*PPL$YMAX'
+	   CALL DELSYM(SYM,IER)
+	ENDIF
+*jd*end
+	SYM='*PPL$ZMIN'
+	CALL DELSYM(SYM,IER)
+	SYM='*PPL$ZMAX'
+	CALL DELSYM(SYM,IER)
+	sym='*PPL$XHIGH'
+	CALL DELSYM(SYM,IER)
+	sym='*PPL$YHIGH'
+	CALL DELSYM(SYM,IER)
+	sym='*PPL$XLOW'
+	CALL DELSYM(SYM,IER)
+	sym='*PPL$YLOW'
+	CALL DELSYM(SYM,IER)
+	RETURN
+	END
diff --git a/ppl/plot/save.F b/ppl/plot/save.F
new file mode 100644
index 0000000..c51ead4
--- /dev/null
+++ b/ppl/plot/save.F
@@ -0,0 +1,316 @@
+	SUBROUTINE SAVE(LSV)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)save.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+        INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'AXISL.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'CONLAB.INC'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+	INCLUDE 'DASHZZ.INC'
+	INCLUDE 'DATA.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LINES.INC'
+	INCLUDE 'MISS.INC'
+	INCLUDE 'PEN.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'PLTL.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'TICS.INC'
+	INCLUDE 'TICS2.INC'
+	INCLUDE 'VECTOR.INC'
+	INCLUDE 'VIEW.INC'
+	INCLUDE 'ZGRID.INC'
+	INCLUDE 'SWITCH.INC'
+#else
+        INCLUDE 'pplinc:PARAMPL5.DAT'
+        INCLUDE 'pplinc:AXIS.INC'
+        INCLUDE 'pplinc:AXISL.INC'
+        INCLUDE 'pplinc:CMRD.INC'
+        INCLUDE 'pplinc:CMRDL.INC'
+        INCLUDE 'pplinc:CONLAB.INC'
+        INCLUDE 'pplinc:CONT.INC'
+        INCLUDE 'pplinc:DASHZZ.INC'
+        INCLUDE 'pplinc:DATA.INC'
+        INCLUDE 'pplinc:HAB.INC'
+        INCLUDE 'pplinc:LABCOM.INC'
+        INCLUDE 'pplinc:LABELS.INC'
+        INCLUDE 'pplinc:LINES.INC'
+        INCLUDE 'pplinc:MISS.INC'
+        INCLUDE 'pplinc:PEN.INC'
+        INCLUDE 'pplinc:PLT.INC'
+        INCLUDE 'pplinc:PLTL.INC'
+        INCLUDE 'pplinc:TAXIS.INC'
+        INCLUDE 'pplinc:TICS.INC'
+        INCLUDE 'pplinc:TICS2.INC'
+        INCLUDE 'PPLINC:VECTOR.INC'
+        INCLUDE 'pplinc:VIEW.INC'
+        INCLUDE 'pplinc:ZGRID.INC'
+        INCLUDE 'cmdinc:SWITCH.INC'
+#endif
+C
+C	WRITE OUT THE COMMON BLOCKS
+C
+C	AXIS
+C
+	WRITE(LSV)XLO,XHI,XTIC,XLEN,XCSIZE,
+     *	IAUTOX,ITYPEX,NMTCX,LINTX,LABELX,NSIGX,NTICX,XORG,
+     *		  YLO,YHI,YTIC,YLEN,YCSIZE,
+     *	IAUTOY,ITYPEY,NMTCY,LINTY,LABELY,NSIGY,NTICY,YORG,
+     *	IAXON
+C
+C	AXISL
+C
+	WRITE(LSV)IFRX,IFRY,IT1,IT2,ITSTRT,ITMIN,ITMAX
+C
+C	CMRD
+C
+	WRITE(LSV)P,M,N,IFLG
+C
+C	CMRDL
+C
+	WRITE(LSV)ICOM,LABEL,IFORM
+C
+C	CONLAB
+C
+	WRITE(LSV)CONPRE,CONPST
+C
+C	CONT
+C
+	WRITE(LSV)ZLEV,LDIG,LWGT,LCLR,NLEV,HGT,NARC,IAUTOC,NLEV2,NSIGC,
+     *	CANGLE,IVCOMP
+C
+C	DASHZZ
+C
+	WRITE(LSV)DASHLN,SPACLN,DSLAB
+C
+C	DATA
+C
+	WRITE(LSV)ITYPEZ,JX,JY,JZ,LUNN,LINEN,NREC,NVAR,NGRP,CAY,NRNG
+C
+C	HAB
+C
+	WRITE(LSV)IPLOT,IPAUSE,IHDCPY
+C
+C	LABCOM
+C
+	WRITE(LSV)HLAB1,HXLAB,HYLAB,HLABS,ICOUNT,NLAB,ICROSS,
+     *  IGTLAB
+C
+C	LABELS
+C
+	WRITE(LSV)LAB1,XLAB,YLAB,LABS
+C
+C	LINES
+C
+	WRITE(LSV)IMARK,HMARK,ITYPE,XOFF,YOFF,XFCT,YFCT,
+     *	DN1,UP1,DN2,UP2,LLENG,LNUM,IWIND
+C
+C	MISS
+C
+	WRITE(LSV)CMXLE,CMXEQ,CMXGE,CMYLE,CMYEQ,CMYGE,
+     *		  CMZLE,CMZEQ,CMZGE,
+     *		    XLE,  XEQ,  XGE,  YLE,  YEQ,  YGE,
+     *		    ZLE,  ZEQ,  ZGE
+C
+C	PEN
+C
+	WRITE(LSV)IPEN,IP
+C
+C	PLT
+C
+	WRITE(LSV)ICODE,WIDTH,HEIGHT,MOD,IR,LUN
+C
+C	PLTL
+C
+	WRITE(LSV)MAKEP
+C
+C	TAXIS
+C
+	WRITE(LSV)TLO,DT,TCSIZE,ITYPET,NMTCT,LABELT,
+     *	IFDB,ISDB,ITFLG,VANG,IVFLG,IAUTOT,ITXTPE,ITXLBP
+C
+C	TICS
+C
+	WRITE(LSV)TSMX,TLX,TSMY,TLY,IX,IY
+C
+C	TICS2
+C
+	WRITE(LSV)ITX,ITY
+C
+C	VECTOR
+C
+	WRITE(LSV)VLEN,VUSRLN,VAUTO,VXLOC,VYLOC,VUSER,VKEY,
+     *	VPOS,VFRMT,VSKPX,VSKPY,VMINLN,ARMAX,ARMIN,HFACT
+C
+C	VIEW
+C
+	WRITE(LSV)VIEWX,VIEWY,VIEWZ,ZSCLE,XYSCLE,VEWZMN,VEWZMX
+C
+C	ZGRID
+C
+	WRITE(LSV)IZTYP,IZMRK,IZLEN
+C
+C	SWITCH
+C
+	WRITE(LSV)FLAG
+C
+	RETURN
+	ENTRY GET(LSV)
+C
+C	READ IN THE COMMON BLOCKS
+C
+C	AXIS
+C
+	READ(LSV)XLO,XHI,XTIC,XLEN,XCSIZE,
+     *	IAUTOX,ITYPEX,NMTCX,LINTX,LABELX,NSIGX,NTICX,XORG,
+     *		  YLO,YHI,YTIC,YLEN,YCSIZE,
+     *	IAUTOY,ITYPEY,NMTCY,LINTY,LABELY,NSIGY,NTICY,YORG,
+     *	IAXON
+C
+C	AXISL
+C
+	READ(LSV)IFRX,IFRY,IT1,IT2,ITSTRT,ITMIN,ITMAX
+C
+C	CMRD
+C
+	READ(LSV)P,M,N,IFLG
+C
+C	CMRDL
+C
+	READ(LSV)ICOM,LABEL,IFORM
+C
+C	CONLAB
+C
+	READ(LSV)CONPRE,CONPST
+C
+C	CONT
+C
+	READ(LSV)ZLEV,LDIG,LWGT,LCLR,NLEV,HGT,NARC,IAUTOC,NLEV2,NSIGC,
+     *	CANGLE,IVCOMP
+C
+C	DASHZZ
+C
+	READ(LSV)DASHLN,SPACLN,DSLAB
+C
+C	DATA
+C
+	READ(LSV)ITYPEZ,JX,JY,JZ,LUNN,LINEN,NREC,NVAR,NGRP,CAY,NRNG
+C
+C	HAB
+C
+	READ(LSV)IPLOT,IPAUSE,IHDCPY
+C
+C	LABCOM
+C
+	READ(LSV)HLAB1,HXLAB,HYLAB,HLABS,ICOUNT,NLAB,ICROSS,
+     *  IGTLAB
+C
+C	LABELS
+C
+	READ(LSV)LAB1,XLAB,YLAB,LABS
+C
+C	LINES
+C
+	READ(LSV)IMARK,HMARK,ITYPE,XOFF,YOFF,XFCT,YFCT,
+     *	DN1,UP1,DN2,UP2,LLENG,LNUM,IWIND
+C
+C	MISS
+C
+	READ(LSV)CMXLE,CMXEQ,CMXGE,CMYLE,CMYEQ,CMYGE,
+     *		 CMZLE,CMZEQ,CMZGE,
+     *		   XLE,  XEQ,  XGE,  YLE,  YEQ,  YGE,
+     *		   ZLE,  ZEQ,  ZGE
+C
+C	PEN
+C
+	READ(LSV)IPEN,IP
+C
+C	PLT
+C
+	READ(LSV)ICODE,WIDTH,HEIGHT,MOD,IR,LUN
+C
+C	PLTL
+C
+	READ(LSV)MAKEP
+C
+C	TAXIS
+C
+	READ(LSV)TLO,DT,TCSIZE,ITYPET,NMTCT,LABELT,
+     *	IFDB,ISDB,ITFLG,VANG,IVFLG,IAUTOT,ITXTPE,ITXLBP
+C
+C	TICS
+C
+	READ(LSV)TSMX,TLX,TSMY,TLY,IX,IY
+C
+C	TICS2
+C
+	READ(LSV)ITX,ITY
+C
+C	VECTOR
+C
+	READ(LSV)VLEN,VUSRLN,VAUTO,VXLOC,VYLOC,VUSER,VKEY,
+     *	VPOS,VFRMT,VSKPX,VSKPY,VMINLN,ARMAX,ARMIN,HFACT
+C
+C	VIEW
+C
+	READ(LSV)VIEWX,VIEWY,VIEWZ,ZSCLE,XYSCLE,VEWZMN,VEWZMX
+C
+C	ZGRID
+C
+	READ(LSV)IZTYP,IZMRK,IZLEN
+C
+C	SWITCH
+C
+	READ(LSV)FLAG
+C
+	RETURN
+	END
diff --git a/ppl/plot/savezg.F b/ppl/plot/savezg.F
new file mode 100644
index 0000000..a23ae4e
--- /dev/null
+++ b/ppl/plot/savezg.F
@@ -0,0 +1,59 @@
+	SUBROUTINE SAVEZG(LUN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)savezg.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'ZGRIDD.INC'
+	INCLUDE 'ZGRID.INC'
+#else
+        INCLUDE 'pplinc:ZGRIDD.INC'
+        INCLUDE 'pplinc:ZGRID.INC'
+#endif
+	WRITE(LUN)(XX(I),YY(I),ZZ(I),I=1,IZLEN)
+	RETURN
+	ENTRY GETZG(LUN)
+	READ(LUN)(XX(I),YY(I),ZZ(I),I=1,IZLEN)
+	RETURN
+	END
diff --git a/ppl/plot/scale2.F b/ppl/plot/scale2.F
new file mode 100644
index 0000000..8d1425a
--- /dev/null
+++ b/ppl/plot/scale2.F
@@ -0,0 +1,117 @@
+      SUBROUTINE SCALE(XSCL,YSCL,ABIAS,BBIAS,XLO,YLO)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)scale2.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL SCALE(XSCL,YSCL,ABIAS,BBIAS,XLO,YLO)
+C
+C     THIS SUBROUTINE DEFINES SCALE FACTORS AND DISPLACEMENTS
+C     FOR SUBSEQUENT PLOTTING.  THE SCALE FACTORS DETERMINE THE
+C     RELATIVE SIZE OF THE DISPLAY, AND THE DISPLACEMENTS DETER-
+C     MINE ITS LOCATION WITHIN THE PLOTTING AREA.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        XSCL   - SCALE FACTOR TO CONVERT FROM USER'S UNITS TO
+C                 INCHES (OR MM) ON THE X-AXIS.
+C        YSCL   - SCALE FACTOR TO CONVERT FROM USER'S UNITS TO
+C                 INCHES (OR MM) ON THE Y-AXIS.
+C        ABIAS  - HORIZONTAL DISPLACMENT OF THE DISPLAY IN IN-
+C                 CHES (OR MM).
+C        BBIAS  - VERTICAL DISPLACEMENT OF THE DISPLAY IN INCHES
+C                 (OR MM).
+C        XLO    - MINIMUM X-VALUE TO BE PLOTTED IN USER'S UNITS.
+C        YLO    - MINIMUM Y-VALUE TO BE PLOTTED IN USER'S UNITS.
+C
+C
+#ifdef unix
+	INCLUDE 'PLTCOM.DAT'
+#else
+	INCLUDE 'pltinc:PLTCOM.DAT'
+#endif
+	SAVE XLOW,YLOW
+C
+C     CONVERT THE SCALE FACTORS TO INTERNAL INCREMENTS.
+C
+      XSCALE = FACTOR * XSCL
+      YSCALE = FACTOR * YSCL
+C
+C     CALCULATE THE LOCATION OF THE ORIGIN.
+C
+	XLOW = XLO * XSCALE
+	YLOW = YLO * YSCALE
+C
+      AORIGN = FACTOR * ABIAS - XLOW
+      BORIGN = FACTOR * BBIAS - YLOW
+C
+	IF(ROTAT)THEN
+	    T=AORIGN
+	    AORIGN=ASIZE-BORIGN
+	    BORIGN=T
+	ENDIF
+C
+      RETURN
+	ENTRY INQSCL(XSCL,YSCL,ABIAS,BBIAS,XLO,YLO)
+C
+C	INQUIRE SCALE
+C
+	XSCL = XSCALE / FACTOR
+	YSCL = YSCALE / FACTOR
+C
+	XLO = XLOW / XSCALE
+	YLO = YLOW / YSCALE
+C
+	IF(ROTAT)THEN
+	    TA=BORIGN
+	    TB=ASIZE-AORIGN
+	ELSE
+	    TA=AORIGN
+	    TB=BORIGN
+	ENDIF
+	ABIAS = (TA + XLOW) / FACTOR
+	BBIAS = (TB + YLOW) / FACTOR
+	RETURN
+C
+      END
diff --git a/ppl/plot/setax.F b/ppl/plot/setax.F
new file mode 100644
index 0000000..052d112
--- /dev/null
+++ b/ppl/plot/setax.F
@@ -0,0 +1,304 @@
+	SUBROUTINE SETAX(X,NXS,XF,YF,XL,YL,XH,YH,NMX,NMY,
+     *	XTI,XTL)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*	Modified J Davison 11.28.88 for compatibility to v1.1 PPL
+*
+*       Declarations added 9.6.88 J Davison                           
+*	Mod for 4 year digits *jd* 11.21.95
+*  
+* v5.41 *acm* - 3/02  If autoscaling is done on an axis, after the
+*                     scale settings are made, set XAXIS_MIN, XAXIS_MAX
+*                     or YAXIS_MIN, YAXIS_MAX
+*               Also remove VMS include statements.
+* v5.41 *acm*   6/20/02 remove unneeded calls to GETSYM.
+* V554  9/03 *acm* Fix precision bug double precision, for fine grids in 
+*                  curvlinear coordinates. See also pltit.F, plotz.F
+
+        real            x,diff,rxax,rxmon,rxchr,thi,xti,xtl
+        real            xmn,xmx,xt,yt
+        real*8		dxl, dxh, dxf, dyl, dyh, dyf
+                                                                      
+        integer         nxs,iy,nmx,i,ibasex,ibasey,len,j,nmy          
+                                                                      
+        external        diff                                          
+*       End declarations 9.6.88
+*	
+*	Declarations added 11.28.88
+	real		xtx,ytx,xtm,ytm
+*	End declarations 11.28.88
+
+	external RANGE
+
+C**
+C**    @(#)setax.F	1.2    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+	DIMENSION X(NXS)
+C	KTYPE = 0 -XY  1 -Z  2-VECTOR
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+
+	LOGICAL CONTR,VECTR
+	CHARACTER IT1TMP*14,IT2TMP*14
+
+C	SETUP AXIS FOR ALL PLOT TYPES.
+c	CONTR=MAKEP.EQ.'CONTOUR'.OR.MAKEP.EQ.'VIEW'.or.makep.eq.'SHADE'
+c     *	.OR.MAKEP.EQ.'VECTOR'
+
+	CONTR=MAKEP.EQ.'CONTOUR'.OR.MAKEP.EQ.'VIEW'
+     *		.OR.MAKEP.EQ.'VECTOR'.or.makep.eq.'SHADE'   
+     *          .or.makep.eq.'FLOWLINE'
+     *          .or.makep.eq.'FILL'.or.makep.eq.'PIXEL'
+
+
+	VECTR=MAKEP.EQ.'PLOTV'.OR.MAKEP.EQ.'PLOTUV'
+     *	.OR.MAKEP.EQ.'VELVCT'
+	IY=NXS/2
+	IF(ITFLG.NE.0)THEN
+	    IF (IAUTOT .EQ. 1 .AND.
+     1	        (IFORM(1:3).EQ.'EPI' .OR. IFORM(1:3).EQ.'BIB' .or.
+     2		iform(1:3).eq.'LDX')) THEN
+		CALL FIXTIM (ITMIN,ITMAX,IT1,IT2,ITYPET)
+		TLO = 1. - DIFF(IT1,ITSTRT)/DT
+	    ELSE
+		CALL FIXTIM (IT1,IT2,IT1TMP,IT2TMP,ITYPET)
+		IT1=IT1TMP
+		IT2=IT2TMP
+		TLO = 1. - DIFF(IT1,ITSTRT)/DT
+	    ENDIF
+C
+C	    CHANGE FROM 3-CHAR MON TO 1-CHAR MON IF INSUFFICIENT SPACE
+C
+	    RXAX=DIFF(IT1,IT2)/1440.
+	    IF(ITFLG.GT.0)THEN
+		RXMON=30.*XLEN/RXAX
+	    ELSE
+		RXMON=30.*YLEN/RXAX
+	    ENDIF
+	    RXCHR=TCSIZE*6.
+	    IF (RXCHR .GT. RXMON) then
+		itxtpe=3
+		labelt=itxtpe*itxlbp
+	    endif
+	    THI=TLO+DIFF(IT1,IT2)/DT
+	ENDIF
+	call trans(0,xmin,ymin,xtm,ytm)
+	call trans(0,xmax,ymax,xtx,ytx)
+	IF(ITFLG.EQ.1)THEN
+	    XTI=XHI
+	    XTL=XLO
+	    XHI=THI
+	    XLO=TLO
+	    DXF=XLEN/(XHI-XLO)
+	    IF(CONTR)THEN
+		DXL=(xtm-XLO)*DXF
+		DXH=XLEN+(xtx-XHI)*DXF
+	    ENDIF
+	ELSE
+	    IF(CONTR)THEN
+C	CONTOUR PLOT
+		IF(IAUTOX.EQ.1)THEN
+		    IF(ITYPEX.GT.1)THEN
+			CALL RANGEL(xtm,xtx,XLO,XHI)
+			XLO=ALOG10(ABS(XLO))
+			XHI=ALOG10(ABS(XHI))
+		    ELSE
+			CALL RANGE(xtm,xtx,NTICX,XLO,XHI,XTIC)
+		    ENDIF
+		    IF(xtm.gt.xtx)THEN
+			DXF=XLO
+			XLO=XHI
+			XHI=DXF
+			XTIC=-XTIC
+		    ENDIF
+		ENDIF
+		DXF=XLEN/(XHI-XLO)
+		DXL=(xtm-XLO)*DXF
+		DXL=(xtm-XLO)*DXF
+		DXH=XLEN+(xtx-XHI)*DXF
+		NMX=NMTCX              
+	    ELSE
+		IF(IAUTOX.EQ.0)GOTO 100
+		IF(VECTR)THEN
+		    XMN=1.
+		    XMX=LLENG(1)
+		    DO 50 I=1,LNUM
+			IF(XMX.LT.LLENG(I))XMX=LLENG(I)
+50		    CONTINUE
+		ELSE
+		    XMN=1.E38
+		    XMX=-XMN
+		    IBASEX=0
+		    IBASEY=IY
+		    DO 10 I=1,LNUM
+			LEN=LLENG(I)
+			DO 20 J=1,LEN
+			    IF((XLE.AND.X(IBASEX+J).LE.CMXLE).OR.
+     *			    (XEQ.AND.X(IBASEX+J).EQ.CMXEQ).OR.
+     *			    (XGE.AND.X(IBASEX+J).GE.CMXGE).OR.
+     *			    (YLE.AND.X(IBASEY+J).LE.CMYLE).OR.
+     *			    (YEQ.AND.X(IBASEY+J).EQ.CMYEQ).OR.
+     *			    (YGE.AND.X(IBASEY+J).GE.CMYGE))GOTO 20
+			    XT=X(IBASEX+J)*XFCT(I)+XOFF(I)
+			    IF(XT.LT.XMN)XMN=XT
+			    IF(XT.GT.XMX)XMX=XT
+20			CONTINUE
+			IBASEX=IBASEX+LEN
+			IBASEY=IBASEY+LEN
+10		    CONTINUE
+		ENDIF
+		IF(ITYPEX.GT.1)THEN
+		    CALL RANGEL(XMN,XMX,XLO,XHI)
+		    XLO=ALOG10(ABS(XLO))
+		    XHI=ALOG10(ABS(XHI))
+		ELSE
+		    CALL RANGE(XMN,XMX,NTICX,XLO,XHI,XTIC)
+		ENDIF
+	    ENDIF
+100	    DXF=XLEN/(XHI-XLO)
+	    NMX=NMTCX
+	ENDIF
+C	YAXIS
+	IF(ITFLG.EQ.-1)THEN
+	    XTI=YHI
+	    XTL=YLO
+	    YHI=THI
+	    YLO=TLO
+	    DYF=YLEN/(YHI-YLO)
+	    IF(CONTR)THEN
+		DYL=(ytm-YLO)*DYF
+		DYH=YLEN+(ytx-YHI)*DYF
+	    ENDIF
+	ELSE
+	    IF(CONTR)THEN
+C CONTOUR DATA
+		IF(IAUTOY.EQ.1)THEN
+		    IF(ITYPEY.GT.1)THEN
+			CALL RANGEL(ytm,ytx,YHI,YLO)
+			YHI=ALOG10(ABS(YHI))
+			YLO=ALOG10(ABS(YLO))
+		    ELSE
+			CALL RANGE(ytm,ytx,NTICY,YLO,YHI,YTIC)
+		    ENDIF
+		    IF(ytm.gt.ytx)THEN
+			DYF=YLO
+			YLO=YHI
+			YHI=DYF
+			YTIC=-YTIC
+		    ENDIF
+		ENDIF
+		DYF=YLEN/(YHI-YLO)
+		DYL=(ytm-YLO)*DYF
+		DYH=YLEN+(ytx-YHI)*DYF
+		NMY=NMTCY
+	    ELSE
+		IF(IAUTOY.EQ.0)GOTO 200
+		XMN=1.E38
+		XMX=-XMN
+		IBASEY=IY
+		IBASEX=0
+		DO 30 I=1,LNUM
+		    DO 40 J=1,LLENG(I)
+			IF((XLE.AND.X(IBASEX+J).LE.CMXLE).OR.
+     *			(XEQ.AND.X(IBASEX+J).EQ.CMXEQ).OR.
+     *			(XGE.AND.X(IBASEX+J).GE.CMXGE).OR.
+     *			(YLE.AND.X(IBASEY+J).LE.CMYLE).OR.
+     *			(YEQ.AND.X(IBASEY+J).EQ.CMYEQ).OR.
+     *			(YGE.AND.X(IBASEY+J).GE.CMYGE))GOTO 40
+			YT=X(IBASEY+J)*YFCT(I)+YOFF(I)
+			IF(YT.LT.XMN)XMN=YT
+			IF(YT.GT.XMX)XMX=YT
+40		    CONTINUE
+		    IBASEX=IBASEX+LLENG(I)
+30		IBASEY=IBASEY+LLENG(I)
+		IF(VECTR)THEN
+		    IF(ABS(XMX).GT.ABS(XMN))THEN
+			XMN=-ABS(XMX)
+		    ELSE
+			XMX=ABS(XMN)
+		    ENDIF
+		ENDIF
+		IF(ITYPEY.GT.1)THEN
+		    CALL RANGEL(XMN,XMX,YLO,YHI)
+		    YLO=ALOG10(ABS(YLO))
+		    YHI=ALOG10(ABS(YHI))
+		ELSE
+		    CALL RANGE(XMN,XMX,NTICY,YLO,YHI,YTIC)
+		ENDIF
+200		DYF=YLEN/(YHI-YLO)
+		NMY=NMTCY
+	    ENDIF
+	ENDIF
+
+        IF (IAUTOX .NE. 0) CALL setax_syms('X', xlo, xhi)
+        IF (IAUTOY .NE. 0) CALL setax_syms('Y', ylo, yhi)
+
+	XF = DXF
+	YF = DYF
+	XL = DXL
+	YL = DYL
+	XH = DXH
+	YH = DYH
+	RETURN
+	END
diff --git a/ppl/plot/setlab.F b/ppl/plot/setlab.F
new file mode 100644
index 0000000..6a3a4f7
--- /dev/null
+++ b/ppl/plot/setlab.F
@@ -0,0 +1,98 @@
+	SUBROUTINE SETLAB(XF,YF,LTT,LTB,LYL,LYR,LXT,LXB,IFX,IFY)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)setlab.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+#ifdef unix
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'TAXIS.INC'
+	INCLUDE 'AXISL.INC'
+#else
+        INCLUDE 'pplinc:AXIS.INC'
+        INCLUDE 'pplinc:TAXIS.INC'
+        INCLUDE 'pplinc:AXISL.INC'
+#endif
+	CHARACTER IFX*(*),IFY*(*)
+
+	EXTERNAL scale
+
+
+C     SETUP AXIS 
+	LTT=0 
+	LTB=0 
+	LYL=0 
+	LYR=0 
+	LXT=0 
+	LXB=0 
+	IF(LABELY.EQ.-1)THEN 
+	    LYL=-1 
+	ELSE IF(LABELY.EQ.1)THEN 
+	    LYR=1 
+	END IF 
+	IF(LABELX.EQ.-1)THEN 
+	    LXB=-1 
+	ELSE IF(LABELX.EQ.1)THEN 
+	    LXT=1 
+	END IF 
+	IF(LABELT.LT.0)THEN 
+	    LTB=LABELT 
+	ELSE IF(LABELT.GT.0)THEN 
+	    LTT=LABELT 
+	END IF 
+	CALL SCALE(XF,YF,XORG,YORG,XLO,YLO) 
+	IF(IFRX.EQ.' ')THEN 
+	    CALL FRMT(XLO,XHI,NSIGX,IFX) 
+	ELSE 
+	    IFX=IFRX
+	ENDIF 
+	IF(IFRY.EQ.' ')THEN 
+	    CALL FRMT(YLO,YHI,NSIGY,IFY) 
+	ELSE 
+	    IFY=IFRY
+	ENDIF 
+	RETURN
+	END
diff --git a/ppl/plot/size2.F b/ppl/plot/size2.F
new file mode 100644
index 0000000..b52338b
--- /dev/null
+++ b/ppl/plot/size2.F
@@ -0,0 +1,381 @@
+      SUBROUTINE SIZE(width,height)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for FERRET
+* from PPLUS :
+
+*       Directory PMEL:[PLOT5.LIBRARY.PLOT]
+
+*       SIZE2.FOR;14              9   5-APR-1987 12:26
+
+* search for "FERRET" to find all revisions
+* *sh* 6/30/88 - rev 1.0 for FERRET 1.00+
+*       - changed GKS size and location calculations to conform
+*       - to SET WINDOW in FERRET
+*       - note: the changes here are to correct a bug that SET WIND/SIZE=n 1
+*               is ignored if issued before the first GKS graphical output
+* *sh* 8/16/88 - rev 1.1 for FERRET 1.10
+*       - added immediate update of display after re-sizing
+* *sh* 8/26/88 - rev 1.1 for FERRET 1.10+
+*       - added code for SET WINDOW/VIEWPORT in FERRET
+* *jd* 9.7.88  - rev 2.0
+*       - Modified to properly handle those workstations (like TEK) that
+*               do not use meters in their device coordinates and those
+*               requiring ASAP deferral state
+* *sh* 9/13/88 - rev 2.1 for FERRET 1.10+
+*       - allow clipping flagged as OFF via vp_*clip.EQ.unspecified_val4
+* *sh* 9/29/88 - rev 2.2 for FERRET 1.10+
+*       - allow separate normalization transformation for each wsid (#=wsid)
+*         instead of all windows sharing #1
+* *jd* 11.28.88
+*       - Modified for compatibility to version 1.1 of PPL
+* *sh* 9/29/88
+*       - further PPLUS V11 compatibility mods - eliminated FERRET common
+* *jd* 03.15.89
+*       - Mod to improve GKS control -- removed GKS open and transferred to
+*         GKS_INIT_WS
+* *jd* 10.26.89
+*       - Mod to write workstation transform information to metafile
+* *jd* 03.22.90
+*       - Mod to accomodate having no open ws, but metafiles open, in Ferret
+* *jd* 03.25.92 
+*       - Mod to accommodate ATC GKS -- replaced GQDSP & GSWKVP
+* *jd* 10.26.93
+*       - Mod to eliminate private item (wsxform) for xgks
+* *sh* 4/9/97
+*       - check to make sure only GKSM metafiles (not CGM) get
+*         workstation sizing information
+* *am* 1/07 V6.02 true batch mode for metafiles; flag meta_batch
+*         distinguises this case from other batch modes.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+*     PLOTTER DEPENDENT ROUTINE
+*     CONTAINS PHYSICAL CHARACTERISTICS OF ALL LEGAL DEVICES.
+*
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C     CALL SIZE(WIDTH,HEIGHT)
+C
+C     THIS SUBROUTINE DEFINES THE DIMENSIONS OF THE TOTAL PLOT-
+C     TING AREA.  SUBSEQUENT TO A CALL TO SIZE, PLOTTING IS AL-
+C     LOWED ONLY WITHIN THESE LIMITS.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        WIDTH  - TOTAL WIDTH OF THE PLOTTING AREA IN INCHES (OR
+C                 MM).  WIDTH IS RESTRICTED TO A MAXIMUM OF 200
+C                 INCHES ON THE ZETA PLOTTER AND 200 INCHES ON THE
+C                 BENSON PLOTTER.
+C        HEIGHT - TOTAL HEIGHT OF THE PLOTTING AREA IN INCHES
+C                 (OR MM).  HEIGHT IS RESTRICTED TO A MAXIMUM OF
+C                 34 INCHES ON THE ZETA PLOTTER AND 38 INCHES ON
+C                 THE BENSON PLOTTER.
+C
+C     SIZE MAKES THE TEKTERMINAL AND PRINTRONIX PLOTTER APPEAR AS IF
+C     THEY WERE WIDTH INCHES (OR MM) WIDE AND HEIGHT INCHES (OR
+C     MM) HIGH.
+C
+C
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+        include 'pltcom_dat.decl'       ! with declarations
+        include 'PLTCOM.DAT'            ! with declarations
+        include 'gkscm1_inc.decl'       ! with declarations
+        include 'GKSCM1.INC'            ! with declarations
+        include 'gkscm2.cmn'            ! metafile info
+        include 'gkspar.inc'
+
+* special COMMON to let this routine know if FERRET is in control
+        include 'ppl_in_ferret.cmn'
+
+* If fortran 90, initialize in block data yabb *jd* Linux port 12.96
+#ifdef FORTRAN_90
+        external yabd
+#else
+        DATA ppl_in_ferret / .FALSE. /
+#endif
+        REAL width, height
+
+        LOGICAL TM_FPEQ_SNGL
+        LOGICAL clip
+        INTEGER ier, imeter, irx, iry
+        REAL    dmaxx, dmaxy, fcty, fctx, xln, yln, xmn, xmx, ymn, ymx,
+     .          t, scale, tmxclip, tmyclip, tmxorg, tmyorg, tmsize,
+     .          tmscale, tmxll, tmyll
+*       REAL    bigness
+
+        LOGICAL shrnkx,shrnky,first
+        SAVE fctx,fcty !Needed for Ultrix
+C
+        IF ( (width .LE. 0.0) .OR. (height .LE. 0.0) ) RETURN
+
+C
+C     INSURE THAT THE PARAMETERS ARE POSITIVE AND CONVERT THEM
+C     TO INTERNAL INCREMENTS.
+C
+        anew = factor * ABS(width)
+        bnew = factor * ABS(height)
+
+	IF ( TM_FPEQ_SNGL(ANEW,ASIZE) .AND. TM_FPEQ_SNGL(BNEW,BSIZE) ) THEN
+	   RETURN
+	end if
+	ASIZE=ANEW
+	BSIZE=BNEW
+C
+        IF (rotat) THEN
+           t=asize
+           asize=bsize
+           bsize=t
+        ENDIF
+C
+C     COMPUTE THE TEKTERMINAL CONVERSION FACTORS.
+C
+        IF (ttype .GT. 0) THEN
+           IF (asize / twidth .GT. bsize / thight) THEN
+              pltota = tscla / asize
+              pltotb = tsclb / asize * twidth / thight
+           ELSE
+              pltota = tscla / bsize * thight / twidth
+              pltotb = tsclb / bsize
+           ENDIF
+        ELSE
+           pltota=tscla/(twidth*factor)
+           pltotb=tsclb/(thight*factor)
+        ENDIF
+C
+C     SET THE MINIMUM AND MAXIMUM ALLOWABLE VALUES OF A AND B.
+C
+        amin = 0.0
+        bmin = 0.0
+        amax = asize
+        bmax = bsize
+        IF (ptype .GT. 2) THEN
+           IF (asize .GT. bsize) THEN
+              fcty=bsize/asize
+              fctx=1.0
+           ELSE
+              fctx=asize/bsize
+              fcty=1.0
+           ENDIF
+
+* FERRET insert 9/1/88 - modified 9/13/88 - and 1/19/89
+* use normalization transforms to allow viewports within output window
+
+* default window and viewport values (full window)
+           tmxorg  = 0.0
+           tmyorg  = 0.0
+           tmxclip = 1.0
+           tmyclip = 1.0
+           tmsize  = 1.0
+           tmscale = 1.0        ! full sized
+           tmxll   = 0.2
+           tmyll   = 0.2
+           clip    = .FALSE.
+
+* FERRET in control ?
+           IF ( ppl_in_ferret )
+     .        CALL GET_VP_FROM_FERRET(tmxorg, tmyorg, tmsize, tmscale,
+     .                                tmxclip, tmyclip, tmxll, tmyll)
+
+* The following calls to GSVP, GSWN, GSELNT refer to wsid but are not
+* restricted in action to a particular WS.  All WS use the same normalization
+* transform, the active one, set by SELNT.  In particular the metafile output
+* WS will be affected by these calls. jd 3.15.89
+*
+
+* set viewport in NDC to limits requested
+* 9/29 - "1" --> wsid *sh*
+
+           CALL FGD_GSVP(MAX(wsid,1),
+     .                   fctx*tmxorg, fctx*tmxclip, 
+     .                   fcty*tmyorg, fcty*tmyclip)
+
+* set world coordinate window to preserve 1:1 aspect
+           scale = 1.0 / SQRT( tmsize )
+           CALL FGD_GSWN(MAX(wsid,1),
+     .                   0.0, (tmxclip-tmxorg)*scale*asize,
+     .                   0.0, (tmyclip-tmyorg)*scale*bsize)
+
+* end of 9/1/88 and 9/13/88 FERRET mods
+c
+c set up the size of the display window
+c          Note: FGD_GQDSP uses the window id 
+c          instead of window type for the first argument
+c
+           CALL FGD_GQDSP(wsid,ier,imeter,dmaxx,dmaxy,irx,iry)
+C
+           IF ( wksaut ) THEN
+              xln=asize*2.54E-5
+              yln=bsize*2.54E-5
+
+* FERRET mod: all lines below beginning with "!" have been commented out for
+* FERRET: (ie. calculations for position and size of window have been changed)
+!               FIRST=.TRUE.
+!200            WKXMN=DMAXX-.0127-XLN
+!               WKYMN=.00635
+!C
+!               SHRNKX=.FALSE.
+!               SHRNKY=.FALSE.
+!               IF(WKXMN.LT.0)THEN
+!                   WKXMN=0.0
+!                   YLN=YLN*DMAXX/XLN
+!                   XLN=DMAXX
+!                   SHRNKX=.TRUE.
+!               ENDIF
+!               IF(WKYMN+YLN.GT.DMAXY)THEN
+!                   WKYMN=0.0
+!                   XLN=XLN*DMAXY/YLN
+!                   YLN=DMAXY
+!                   SHRNKY=.TRUE.
+!               ENDIF
+!               IF(FIRST.AND.SHRNKX.AND.SHRNKY)THEN
+!                   FIRST=.FALSE.
+!                   GOTO 200
+!               ENDIF
+* FERRET insert: ************************************************************
+* re-scale as requested by SET WINDOW command 
+* do not do this anymore
+*              xln = tmscale * xln
+*              yln = tmscale * yln
+*
+* ... too big to fit ?
+*             bigness = MIN( dmaxx/xln, dmaxy/yln )
+*             IF ( bigness .LT. 1.0 ) THEN
+*                xln = xln * bigness
+*                yln = yln * bigness
+*             ENDIF
+
+* let the system window manager deal with placing the window on the screen
+              wkxmn = 0.0
+              wkymn = 0.0
+
+* end of FERRET insert: ******************************************************
+C
+              wkxmx=wkxmn+xln
+              wkymx=wkymn+yln
+C
+C SET THE NDC WINDOW
+
+*             Next 5 lines *jd* 3.25.92
+*              IF (.NOT. ppl_in_ferret) THEN
+*                 CALL FGD_GSWN(1,0.0,asize,0.0,bsize)
+*                 CALL FGD_GSVP(1,0.0,fctx,0.0,fcty)
+*                 CALL FGD_GSELNT(1)
+*              ENDIF
+
+C
+C SET DEVICE (WORKSTATION) VIEWPORT
+C
+              IF ( wsid .GT. 0 ) THEN
+                 CALL FGD_GSWKWN(wsid,0.0,fctx,0.0,fcty)
+                 CALL SET_WINDOW_SIZE(wsid,wkxmn,wkxmx,wkymn,wkymx)
+              ENDIF
+           ELSE
+C
+C IF NOT AUTO WKXMN AND WKXMX ETC ARE FRACTIONS OF DMAXX AND DMAXY
+C
+              XMN=DMAXX*WKXMN
+              XMX=DMAXX*WKXMX
+              YMN=DMAXY*WKYMN
+              YMX=DMAXY*WKYMX
+              IF ( wsid .GT. 0 ) THEN
+                 CALL FGD_GSWKWN(wsid,0.0,fctx,0.0,fcty)
+                 CALL SET_WINDOW_SIZE(wsid,xmn,xmx,ymn,ymx)
+              ENDIF
+           ENDIF
+
+* select normalization transformation and turn on clipping
+* -- after the final size of the window has been set --
+
+           CALL FGD_GSELNT(MAX(wsid,1))
+           IF ( clip ) THEN
+              CALL FGD_GSCLIP(gclip)
+           ELSE
+              CALL FGD_GSCLIP(gnclip)
+           ENDIF
+
+* FERRET mod: force immediate update of display
+           IF ( wsid .GT. 0 )
+     .             CALL FGD_GUWK(wsid, 1)
+        ENDIF
+C
+C     CALCULATE THE OFF-SCREEN FLAG.
+C
+        losflg = 0
+        IF (aold - 0.001 .GT. amax) losflg = 1
+        IF (aold + 0.001 .LT. amin) losflg = 2
+        IF (bold - 0.001 .GT. bmax) losflg = losflg + 4
+        IF (bold + 0.001 .LT. bmin) losflg = losflg + 8
+
+        RETURN
+C
+        END
diff --git a/ppl/plot/spwn.F b/ppl/plot/spwn.F
new file mode 100644
index 0000000..0151851
--- /dev/null
+++ b/ppl/plot/spwn.F
@@ -0,0 +1,59 @@
+	SUBROUTINE SPWN
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)spwn.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C** v552 *acm* 3/03 Longer strings: changes for multi-line labels
+C    V6.06 ACM Write error messages to Standard Error, unit number is LERROR
+
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'LUNITS.INC'
+	INCLUDE 'SYSTEM.INC'
+C
+	IF(.NOT.QUIETF)WRITE(lerror,998)ICOM
+998	FORMAT(' **ERROR  COMMAND : ',A12,' NOT RECOGNIZED')
+c
+
+	RETURN
+	END
diff --git a/ppl/plot/stmnmx.F b/ppl/plot/stmnmx.F
new file mode 100644
index 0000000..7b19192
--- /dev/null
+++ b/ppl/plot/stmnmx.F
@@ -0,0 +1,256 @@
+	SUBROUTINE STMNMX(X,NSIZE,XMIN1,XMAX1,YMIN1,YMAX1)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOT]MINMAX.FOR
+
+* search for "TMAP" to find all revisions
+* *sh* - 1/27/89 corrected bug: min/max search improperly rejects LIMITs points
+* *sh* - 12/8/93 corrected bug: vectors blow on divied by zero attempt
+* *jd* - 4.20.99 Don't delete symbols {X,Y}{MIN,MAX} in overlay plots
+* V580 *acm* 8/04  Allow for PPL POLYGON as well as PPL FILLPOL after a POLY/SET command.
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	DIMENSION X(NSIZE)
+C**
+C**    @(#)minmax.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'data_inc.decl'
+        include 'DATA.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+
+	CHARACTER SYM*120,VAL*10
+C
+	SYM='*PPL$LINE_COUNT'
+	WRITE(VAL,'(I2)')LINEN
+	CALL PUTSYM(SYM,VAL,2,IER)
+C
+	IF(LINEN.EQ.0)THEN
+C
+C	CONTOUR FORM
+C
+*jd*begin
+	    IF (.NOT.SOVER) THEN
+	       SYM='*PPL$XMIN'
+	       CALL PUTVAL(SYM,XMIN1,4,IER)
+C       
+	       SYM='*PPL$XMAX'
+	       CALL PUTVAL(SYM,XMAX1,4,IER)
+C       
+	       SYM='*PPL$YMIN'
+	       CALL PUTVAL(SYM,YMIN1,4,IER)
+C       
+	       SYM='*PPL$YMAX'
+	       CALL PUTVAL(SYM,YMAX1,4,IER)
+	    ENDIF
+*jd*end
+
+c	find the min and max and the locations of them
+c
+	    ZMIN=1.E38
+            ZMAX=-ZMIN
+	    jmn=1
+	    jmx=1
+	    imx=1
+	    imn=1
+	    if(jtype.eq.-1)then
+		ivlen=nx*ny
+	    else
+		ivlen=nx*ny+nx+ny
+	    endif
+            DO 300 I=1,NX
+            DO 300 J=1,NY
+		if(jtype.ge.0)then
+* TMAP mods begin:
+* note: a major bug still exists here: X and Y screening set by LIMITS command
+*	are ignored
+*  LIMITS screening test for jtype.ge.0 moved from below
+                    XT=X(NX*(J-1)+I)
+        	    IF(ZLE.AND.XT.LE.CMZLE)GOTO 300
+        	    IF(ZEQ.AND.XT.EQ.CMZEQ)GOTO 300
+        	    IF(ZGE.AND.XT.GE.CMZGE)GOTO 300
+		else
+                    xtt1=x(nx*(j-1)+i)
+                    xtt2=x(ivlen+nx*(j-1)+i)
+*  ... LIMITS screening test for vector plots modified
+!	old code:   if (xtt1.ge.1.e35 .or. xtt2.ge.1.e35) goto 300
+        	    IF(ZLE.AND.xtt1.LE.CMZLE)GOTO 300
+        	    IF(ZEQ.AND.xtt1.EQ.CMZEQ)GOTO 300
+        	    IF(ZGE.AND.xtt1.GE.CMZGE)GOTO 300
+        	    IF(ZLE.AND.xtt2.LE.CMZLE)GOTO 300
+        	    IF(ZEQ.AND.xtt2.EQ.CMZEQ)GOTO 300
+        	    IF(ZGE.AND.xtt2.GE.CMZGE)GOTO 300
+		    xt=sqrt(xtt1**2+xtt2**2)
+		endif
+* end of TMAP mod
+        	IF(XT.LT.ZMIN)then
+		    ZMIN=XT
+		    jmn=j
+		    imn=i
+		endif
+        	IF(XT.GT.ZMAX)then
+		    ZMAX=XT
+		    jmx=j
+		    imx=i
+		endif
+300         CONTINUE
+	    if(abs(jtype).eq.2)then
+		ivlen=nx*ny
+		xhigh=x(ivlen+imx)
+		xlow=x(ivlen+imn)
+c
+		ivlen=ivlen+nx
+		yhigh=x(ivlen+jmx)
+		ylow=x(ivlen+jmn)
+	    else
+!*sh*		dx=(xmax-xmin)/(nx-1)
+		dx=(xmax-xmin)/MAX(nx-1,1)
+		xhigh=xmin+dx*(imx-1)
+		xlow=xmin+dx*(imn-1)
+c
+!*sh*		dy=(ymax-ymin)/(ny-1)
+		dy=(ymax-ymin)/MAX(ny-1,1)
+		yhigh=ymin+dy*(jmx-1)
+		ylow=ymin+dy*(jmn-1)
+	    endif
+c
+	    SYM='*PPL$ZMIN'
+	    CALL PUTVAL(SYM,ZMIN,4,IER)
+C
+	    SYM='*PPL$ZMAX'
+	    CALL PUTVAL(SYM,ZMAX,4,IER)
+c
+	    sym='*PPL$XHIGH'
+	    call putval(sym,xhigh,4,ier)
+c
+	    sym='*PPL$YHIGH'
+	    call putval(sym,yhigh,4,ier)
+c
+	    sym='*PPL$XLOW'
+	    call putval(sym,xlow,4,ier)
+c
+	    sym='*PPL$YLOW'
+	    call putval(sym,ylow,4,ier)
+
+C       Don't define line symbols for FILLPOL/POLYGON
+	ELSE if (makep .ne. 'FILLPOL' .AND. makep .ne. 'POLYGON') then
+C
+C	LINE DATA
+
+	    WRITE(SYM,998)'XMIN',LINEN
+998	    FORMAT('*PPL$',A,'(',I2,')')
+	    CALL PUTVAL(SYM,XMIN1,4,IER)
+C
+	    WRITE(SYM,998)'XMAX',LINEN
+	    CALL PUTVAL(SYM,XMAX1,4,IER)
+C
+	    WRITE(SYM,998)'YMIN',LINEN
+	    CALL PUTVAL(SYM,YMIN1,4,IER)
+C
+	    WRITE(SYM,998)'YMAX',LINEN
+	    CALL PUTVAL(SYM,YMAX1,4,IER)
+
+* If its a ribbon plot, we need the min and max of the color-by variable.
+	    IF (linen .EQ. 2) THEN
+	       zmin = ymin1
+	       zmax = ymax1
+	    ENDIF
+
+C
+C	SET FIRST - LAST VALUES
+C
+	    IBASEX=0
+	    IBASEY=NSIZE/2
+	    DO 10 I=1,LINEN-1
+	    LEN=LLENG(I)
+	    IBASEX=IBASEX+LEN
+	    IBASEY=IBASEY+LEN
+10	    CONTINUE
+	    LEN=LLENG(LINEN)
+	    DO 20 J=1,LEN
+	    IF((XLE.AND.X(IBASEX+J).LE.CMXLE).OR.
+     *		(XEQ.AND.X(IBASEX+J).EQ.CMXEQ).OR.
+     *		(XGE.AND.X(IBASEX+J).GE.CMXGE).OR.
+     *		(YLE.AND.X(IBASEY+J).LE.CMYLE).OR.
+     * 	(YEQ.AND.X(IBASEY+J).EQ.CMYEQ).OR.
+     *		(YGE.AND.X(IBASEY+J).GE.CMYGE))GOTO 20
+	    XT=X(IBASEX+J)*XFCT(I)+XOFF(I)
+	    YT=X(IBASEY+J)*YFCT(I)+YOFF(I)
+	    WRITE(SYM,998)'XFIRST',LINEN
+	    CALL PUTVAL(SYM,XT,4,IER)
+	    WRITE(SYM,998)'YFIRST',LINEN
+	    CALL PUTVAL(SYM,YT,4,IER)
+	    GOTO 30	
+20	    CONTINUE
+30	    DO 40 J=LEN,1,-1
+	    IF((XLE.AND.X(IBASEX+J).LE.CMXLE).OR.
+     *		(XEQ.AND.X(IBASEX+J).EQ.CMXEQ).OR.
+     *		(XGE.AND.X(IBASEX+J).GE.CMXGE).OR.
+     *		(YLE.AND.X(IBASEY+J).LE.CMYLE).OR.
+     *		(YEQ.AND.X(IBASEY+J).EQ.CMYEQ).OR.
+     *		(YGE.AND.X(IBASEY+J).GE.CMYGE))GOTO 40
+	    XT=X(IBASEX+J)*XFCT(I)+XOFF(I)
+	    YT=X(IBASEY+J)*YFCT(I)+YOFF(I)
+	    WRITE(SYM,998)'XLAST',LINEN
+	    CALL PUTVAL(SYM,XT,4,IER)
+	    WRITE(SYM,998)'YLAST',LINEN
+	    CALL PUTVAL(SYM,YT,4,IER)
+	    GOTO 50
+40	    CONTINUE
+	ENDIF
+50	RETURN
+	END
diff --git a/ppl/plot/trans.F b/ppl/plot/trans.F
new file mode 100644
index 0000000..84175b6
--- /dev/null
+++ b/ppl/plot/trans.F
@@ -0,0 +1,61 @@
+      SUBROUTINE TRANS(I,X,Y,XT,YT) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)trans.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'AXIS.INC'
+	INCLUDE 'LINES.INC'
+#else
+        INCLUDE 'pplinc:PARAMPL5.DAT'
+        INCLUDE 'pplinc:AXIS.INC'
+        INCLUDE 'pplinc:LINES.INC'
+#endif
+      XT=X*XFCT(I)+XOFF(I) 
+      YT=Y*YFCT(I)+YOFF(I) 
+      IF(ITYPEX.NE.1)XT=ALOG10(ABS(XT)) 
+      IF(ITYPEY.NE.1)YT=ALOG10(ABS(YT)) 
+      RETURN 
+      END 
diff --git a/ppl/plot/vecfld.F b/ppl/plot/vecfld.F
new file mode 100644
index 0000000..ecf345b
--- /dev/null
+++ b/ppl/plot/vecfld.F
@@ -0,0 +1,487 @@
+        SUBROUTINE VECFLD(U,V,NXS,NYS,PX,PY,XF,YF)
+
+C**
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	*sh* 04-16-90 	Mod to retain VUSRLN for user defined vector lengths
+*       *jd* 8.3.92     Mod to add interrupts
+*	*jd* 12.92	Mod to handle fields of 0 length vectors
+*	*sh* 12/8/93    corrected bug: vectors blow on divide by zero
+*       *acm*7/01	apply scaling to vectors when curv. coords.
+*       *acm*		NOTE: If this routine plots vectors directly along
+*                       the "edge" of the region for modulo axes, try setting
+*                       the region to one grid point less than the whole
+*                       globe, e.g. /X=0:357.5   When curv_coord_sub.F applies
+*			the modulo correction it "interpolates" between two 
+*			x values that are the same.  Also see notes in 
+*                       ~ansley/ans_ferret/curvilinear/curv_coord_sub.F
+*       *acm* 10/01    Remove VMS includes
+*       *acm* 10/24/01 Call mark(99) to plot a point when a vector is too small.
+*       *acm*  5/02    Bug fix: alen for curvilinear vectors could be 0.
+*       *ACM*  8/02    remove the call to plot a point with mark(99) -- need
+*                      to resolve PPLUS issues with polymark first
+*       *acm*  9/02    Yet another tweak on the length of curvlinear vectors.
+*                      Fix the computation of curv_len, page length of vector as 
+*                      it is drawn.
+*       *acm* 12/02    Restore call to mark(99) polymarker call when vector is
+*                      small.  Call doit_makedot after the loop, to plot points in the buffer.
+* v5.81 *acm* lengthen string containing format to 40 characters.
+* V6.63 *acm* 7/10 Save a symbol PPL_VECLEN containing the Vector Length value
+* V6.65 *acm* 10/10 Draw curvilinear vectors as straight lines.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V684 *adm* 12/12 Changes for VECTOR/MODULO on curvilinear plots.
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+C	ARRAY X HOLD 2 GRIDS, U(X) IN THE FIRST
+C	NX BY NY GRID AND V(Y) IN THE SECOND
+C
+        real xf,yf
+        integer nxs,nys
+	REAL U(NXS,NYS),V(NXS,NYS),PX(NXS),PY(NYS)
+C
+C
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'
+        include 'vector_inc.decl'
+        include 'VECTOR.INC'
+        include 'xcurvilinear.cmn'
+        include 'makedot.cmn'
+
+	real xfuser,yfuser,xlousr,ylousr,zave,xt,yt
+	real xx2,yy2,zz,vfact,xtm,ytm,xtx,ytx,xx1,yy1,vx,vy,vclen
+	real thfact,xn,yn,xl,yl,dy,dx, alen, big,lmin,lmax, xadd
+
+	logical done_nleft, done_nright
+	integer ic,i,j,lnblk,iln, overedge
+	integer TM_LENSTR1, slen, i1, i2
+
+	CHARACTER VECLAB*2048, buff*80, symbuff*120
+
+C
+C	VECTOR,X,Y,VFACT,LABEL
+C
+
+C     Curvilinear coordinates declarations
+        integer status, ii
+#ifdef double_p
+        real*8 x_curv(12), y_curv(12)
+#else
+        real x_curv(12), y_curv(12)
+#endif
+        real curv_len, xxc, yyc, tail_i, tail_j, head_i, head_j, 
+     .       head_len, tail_i_orig, tail_j_orig
+
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+*******************************************************************************
+
+         veclab = ' '
+	    IF(VUSER)THEN
+	    	XFUSER=1.
+		YFUSER=1.
+		YLOUSR=0.
+		XLOUSR=0.
+	    ELSE
+	    	XFUSER=XF
+		YFUSER=YF
+		XLOUSR=XLO
+		YLOUSR=YLO
+	    ENDIF
+	XT=VXLOC/XFUSER+XLOUSR
+	YT=VYLOC/YFUSER+YLOUSR
+	IF(VAUTO)THEN
+c
+c	use average vector length for scale if auto
+c
+	    IC=0
+	    ZAVE=0.0
+	    DO 10 I=1,NX,VSKPX
+	    DO 10 J=1,NY,VSKPY
+	    XX2=U(I,J)
+	    YY2=V(I,J)
+C
+C	TEST FOR MISSING DATA
+C
+	    IF((ZLE.AND.XX2.LE.CMZLE).OR.
+     *	       (ZEQ.AND.XX2.EQ.CMZEQ).OR.
+     *	       (ZGE.AND.XX2.GE.CMZGE).OR.
+     *	       (ZLE.AND.YY2.LE.CMZLE).OR.
+     *	       (ZEQ.AND.YY2.EQ.CMZEQ).OR.
+     *	       (ZGE.AND.YY2.GE.CMZGE))GOTO 10
+	    ZZ=SQRT(XX2**2+YY2**2)
+	    ZAVE=ZAVE+ZZ
+	    IC=IC+1
+10	    CONTINUE
+	    IF(IC.EQ.0)IC=1
+*	    Mod to handle field of length 0 vectors *jd* 12.92
+	    IF (zave .eq. 0.0) THEN 
+	       zave = 0.5
+	    else
+	       ZAVE=ZAVE/FLOAT(IC)
+	    ENDIF
+	    VFACT=VLEN/(2.0*ZAVE)
+	    vusrln = (2.0*ZAVE)		!  *sh* 4/90
+	ELSE
+	    VFACT=VLEN/VUSRLN
+	ENDIF
+
+	CALL COLOR(IPEN(1))
+	call trans(0,xmin,ymin,xtm,ytm)
+	call trans(0,xmax,ymax,xtx,ytx)
+!*sh*	DX=(xtx-xtm)/(NX-1)
+!*sh*	DY=(ytx-ytm)/(NY-1)
+	DX=(xtx-xtm)/MAX(NX-1,1)
+	DY=(ytx-ytm)/MAX(NY-1,1)
+        IPT = 0
+
+	big = ABS(CMZGE)
+	lmin = -1*big
+	lmax = big
+
+	done_nleft  = .FALSE.
+	done_nright = .FALSE.
+	xadd = 0.
+
+ 90	CONTINUE
+
+	DO 100 I=1,NX,VSKPX
+	DO 100 J=1,NY,VSKPY
+
+        IF (IPT .GT. maxdot) THEN
+           CALL doit_makedot(IPT,XDOT,YDOT)
+           IPT = 0
+        ENDIF
+
+	XX2=U(I,J)
+	YY2=V(I,J)
+C
+C	TEST FOR MISSING DATA
+C
+	IF((ZLE.AND.XX2.LE.CMZLE).OR.
+     *	   (ZEQ.AND.XX2.EQ.CMZEQ).OR.
+     *	   (ZGE.AND.XX2.GE.CMZGE).OR.
+     *	   (ZLE.AND.YY2.LE.CMZLE).OR.
+     *	   (ZEQ.AND.YY2.EQ.CMZEQ).OR.
+     *	   (ZGE.AND.YY2.GE.CMZGE))GOTO 100
+C
+C	TAIL LOCATION USER UNITS
+C
+	IF(JTYPE.EQ.-1)THEN
+	    XX1 = xtm + DX*(I-1)
+	    YY1 = ytm + DY*(J-1)
+	ELSE
+	    call trans(0,px(i),py(j),xx1,yy1)
+	ENDIF
+
+ 50    IF (curvilinear) THEN   
+
+C  vclen is approx vector length; without curviness.
+
+           vclen = SQRT( (U(I,J)**2) + (V(I,J)**2))
+
+C Set up to plot the vector in pieces to make a curve.
+
+           tail_i = xx1
+           tail_j = yy1
+           tail_i_orig = xx1
+           tail_j_orig = yy1
+           x_curv(1)=xx1
+           y_curv(1)=yy1
+           CALL CURV_COORD(x_curv, y_curv, 1, 1.0, 1.0, status) ! xform the pts
+	   IF (curv_missing) GOTO 100
+
+           xx1=x_curv(1)
+           yy1=y_curv(1)
+           xxc=x_curv(1)	! initialize, in case of bad data in loop 60 below
+           yyc=y_curv(1)
+           xx1orig = xx1
+           yy1orig = yy1
+
+           curv_len = 0.0
+           overedge = 0
+
+C Dont draw as a curve. Move to the tail now and when we have reached the end
+C then draw the line to the arrow head.
+
+           CALL PLOT(XX1+xadd,YY1,0,0)
+	   IF (xadd .EQ. 0) THEN
+	      lmin = MIN(lmin, XX1)
+              lmax = MAX(lmax, XX1)
+	   ENDIF
+
+           DO 60, ii=1, 500
+
+              head_i = tail_i + U(I,J)*vfact/10
+              head_j = tail_j + V(I,J)*vfact/10
+              head_i = tail_i + U(I,J)*vfact
+              head_j = tail_j + V(I,J)*vfact
+
+              IF (head_i .GT. xtx .AND. (.NOT. dim1_modulo)) THEN
+                 head_i = xtx
+                 overedge = 1
+              ENDIF
+              IF (head_j .GT. ytx .AND. (.NOT. dim2_modulo)) THEN
+                 head_j = ytx
+                 overedge = 1
+              ENDIF
+              IF (head_i .LT. xtm .AND. (.NOT. dim1_modulo)) THEN
+                 head_i = xtm
+                 overedge = 1
+              ENDIF
+              IF (head_j .LT. ytm .AND. (.NOT. dim2_modulo)) THEN
+                 head_j = ytm
+                 overedge = 1
+              ENDIF
+
+              x_curv(1) = head_i
+              y_curv(1) = head_j
+
+              CALL CURV_COORD(x_curv, y_curv, 1, 1.0, 1.0, status)
+	      IF (curv_missing) GOTO 100
+
+              IF (x_curv(1) .ne. cmzeq) xxc = x_curv(1)
+              IF (y_curv(1) .ne. cmzeq) yyc = y_curv(1) 
+
+C  curv_len is sum of vector pieces; actual vector length.  When 
+C  it is vclen we are done plotting the vector.
+
+C   Note: len = distance from xx1 to xxc, which in page units is
+C   equivalent to xxc = xx1 + (len/xf), or len = (xxc-xx1)* xf
+
+              curv_len = curv_len + 
+     .           SQRT( ( (xxc-xx1)*xf )**2  +  ( (yyc-yy1)*yf )**2 )
+
+C  If the line goes over the edge, draw to the edge but don't
+C  draw an arrow head.
+              IF (overedge .EQ. 1) THEN
+	         CALL PLOT(xxc+xadd,yyc,1,0)
+		 IF (xadd .EQ. 0) THEN
+	            lmin = MIN(lmin, xxc)
+	            lmax = MAX(lmax, xxc)
+		 ENDIF
+		 GO TO 80 
+              ENDIF
+
+              IF (curv_len .GE. vclen* vfact) GO TO 70
+
+              tail_i = head_i
+              tail_j = head_j
+              xx1 = xxc
+              yy1 = yyc
+
+ 60        CONTINUE
+
+ 70        CONTINUE
+           CALL PLOT(xxc+xadd,yyc,1,0)
+           IF (xadd .EQ. 0) THEN
+	      lmin = MIN(lmin, xxc)
+              lmax = MAX(lmax, xxc)
+	   ENDIF
+
+C     DRAW ARROW HEADS
+
+	   IF (xxc .NE. cmzeq  .AND. yyc .NE. cmzeq) THEN
+              head_len = 2.*curv_len/(xf+yf)
+              head_len = 2.*vclen*vfact/(xf+yf)
+              CALL vec_arrows(tail_i_orig, tail_j_orig, 
+     .           head_i, head_j, head_len, xadd)
+	   ENDIF	! draw arrow if xxc and yyc were ok
+   80	   CONTINUE	! vector went over edge
+
+        ELSE	! not curvilinear
+
+           XX2 = XX1 + XX2*VFACT/XF
+           YY2 = YY1 + YY2*VFACT/YF
+C
+C	CALC REAL LENGTH
+C
+           VX=(XX2-XX1)*XF
+           VY=(YY2-YY1)*YF
+           VCLEN=SQRT(VX**2+VY**2)
+C
+C	IF VECTOR IS TOO SMALL PLOT A POINT
+C
+           IF(VCLEN .LT. VMINLN)THEN
+	      CALL PLOT(XX1,YY1,0,0)
+	      CALL PLOT(XX1,YY1,1,0)
+              CALL MARK(99)
+	      GOTO 100
+           ENDIF
+C
+C	SET UP THE ARROW FACTOR HEAD LENGTH SCALE
+C
+           IF(VCLEN .GT. ARMAX)THEN
+	      THFACT=ARMAX*HFACT/VCLEN
+           ELSE IF(VCLEN .LT. ARMIN .AND. VCLEN.GT.0.)THEN
+	      THFACT=ARMIN*HFACT/VCLEN
+           ELSE
+	      THFACT=HFACT
+           ENDIF
+C
+C	DRAW ARROW HEADS
+C
+           XN=XX2+(-VX-.35*VY)*THFACT/XF
+           YN=YY2+(-VY+.35*VX)*THFACT/YF
+           CALL PLOT(XN,YN,0,0)
+           CALL PLOT(XX2,YY2,1,0)
+C
+           XN=XX2+(-VX+.35*VY)*THFACT/XF
+           YN=YY2+(-VY-.35*VX)*THFACT/YF
+           CALL PLOT(XN,YN,1,0)
+           CALL PLOT(XX2,YY2,1,0)
+C
+           CALL PLOT(XX1,YY1,1,0)
+        ENDIF
+
+100	CONTINUE
+	IF (interrupted) goto 3333 ! *jd* 8.3.92
+
+        CALL doit_makedot(IPT,XDOT,YDOT)
+
+
+C Go back to do modulo replications if curvilinear and /MODULO
+
+	IF (xmodulo .AND. curvilinear) THEN
+           xrange = 360
+c           IF (.NOT. units_degrees) xrange = wwxmax - wwxmin
+           nleft = 0
+           nright = 0
+           IF (lmin.GT.xlo .OR. lmax.GT.xhi ) nleft =  1
+	   IF (lmin.LT.xlo .OR. lmax.LT.xhi ) nright = 1
+
+           IF (nleft .GT. 0 .AND. .NOT.done_nleft) THEN
+              xadd = -1.* xrange
+	      done_nleft = .TRUE.
+	      GOTO 90
+	   ENDIF
+
+           IF (nright .GT. 0 .AND. .NOT.done_nright) THEN
+              xadd = xrange
+	      done_nright = .TRUE.
+	      GOTO 90
+	   ENDIF
+	ENDIF
+
+
+        IPT = 0
+C
+C	DRAW SCALE  MAKE SCALE .5 INCH LONG AT XT,YT
+C
+	IF(.NOT.VKEY)THEN
+	    CALL COLOR(IPEN(0))
+	    RETURN
+	ENDIF
+	CALL WINDOW(0.,0.,0.,0.)
+
+C Note don't need different arrow length for curvilinear case.
+C it is a standard half inch.
+
+	XX1=XT
+	YY1=YT
+	XX2=XT+VLEN/XF
+	YY2=YT
+        alen = vlen
+C
+C	DRAW ARROW 
+C
+	IF(alen.GT.ARMAX)THEN
+	    THFACT=ARMAX*HFACT/alen
+	ELSE IF(alen.LT.ARMIN .AND. alen .GT. 1.e-6)THEN
+	    THFACT=ARMIN*HFACT/alen
+	ELSE
+	    THFACT=HFACT
+	ENDIF
+	XN=XX2-THFACT*alen/XF
+	YN=YY2+.35*THFACT*alen/YF
+
+	CALL PLOT(XN,YN,0,0)
+	CALL PLOT(XX2,YY2,1,0)
+C
+	XN=XX2-THFACT*alen/XF
+	YN=YY2-.35*THFACT*alen/YF
+	CALL PLOT(XN,YN,1,0)
+	CALL PLOT(XX2,YY2,1,0)
+C
+	CALL PLOT(XX1,YY1,1,0)
+       
+C
+C	DRAW LABEL
+C
+	CALL COLOR(IPEN(0))
+	WRITE (VECLAB,VFRMT) VLEN/VFACT
+	ILN=LNBLK(VECLAB,20)
+	XL = XX2 + .125/XF
+	YL = YY2 - HLABS*0.5/YF
+	CALL SYMBEL(XL,YL,0.,HLABS,ILN,VECLAB)
+3333	IF(IWIND.GT.0)CALL WINDOW(XLO,YLO,XHI,YHI)
+
+C   Save the value in a symbol PPL_VECLEN
+	symbuff = 'PPL_VECLEN'
+	CALL GETSYM( symbuff, buff, i2, i1 )
+	IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+	slen = TM_LENSTR1(veclab)
+	CALL PUTSYM( symbuff, veclab, slen, i2)
+
+	RETURN
+	END
diff --git a/ppl/plot/view.F b/ppl/plot/view.F
new file mode 100644
index 0000000..6f847d1
--- /dev/null
+++ b/ppl/plot/view.F
@@ -0,0 +1,100 @@
+	SUBROUTINE VIEW(X)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)view.F	1.2    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'HD.INC'
+	INCLUDE 'CMRD.INC'
+	INCLUDE 'CMRDL.INC'
+	INCLUDE 'LABELS.INC'
+	INCLUDE 'LABCOM.INC'
+	INCLUDE 'HAB.INC'
+	INCLUDE 'PEN.INC'
+	INCLUDE 'PLT.INC'
+	INCLUDE 'VIEW.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+#else
+	INCLUDE 'pplinc:PARAMPL5.DAT'
+	INCLUDE 'pplinc:HD.INC'
+	INCLUDE 'pplinc:CMRD.INC'
+	INCLUDE 'pplinc:CMRDL.INC'
+	INCLUDE 'pplinc:LABELS.INC'
+	INCLUDE 'pplinc:LABCOM.INC'
+	INCLUDE 'pplinc:HAB.INC'
+	INCLUDE 'pplinc:PEN.INC'
+	INCLUDE 'pplinc:PLT.INC'
+	INCLUDE 'pplinc:VIEW.INC'
+	INCLUDE 'cmdinc:SYSTEM.INC'
+	INCLUDE 'cmdinc:SWITCH.INC'
+#endif
+	IF(NX.EQ.0.OR.NY.EQ.0)RETURN
+	call trans(0,xmin,ymin,xtm,ytm)
+	call trans(0,xmax,ymax,xtx,ytx)
+	IF(XYSCLE.EQ.1)THEN
+	    XM=xtm
+	    XMX=xtx
+	ELSE
+	    XM=ytm
+	    XMX=ytx
+	END IF
+	IF(ZSCLE.NE.0)THEN
+	    P1=1./ZSCLE
+	ELSE
+	    P1=(VEWZMX-VEWZMN)/(ytx-ytm)
+	END IF
+	XM=XM*P1
+	XMX=XMX*P1
+	YM=ytm*P1
+	YMX=ytx*P1
+C     TRANSFORM VIEWPOINT
+	XV=(XMX-XM)*(VIEWX-xtm)/(xtx-xtm)+XM
+	YV=(YMX-YM)*(VIEWY-ytm)/(ytx-ytm)+YM
+	ICOUNT=ICOUNT+1
+	CALL SURFCE(X,XM,XMX,NX,YM,YMX,NY,VEWZMN,VEWZMX,
+     *	XV,YV,VIEWZ)
+	RETURN
+	END
diff --git a/ppl/plotlib/LIB_NAME b/ppl/plotlib/LIB_NAME
new file mode 100644
index 0000000..73b989a
--- /dev/null
+++ b/ppl/plotlib/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libpll.a
+ 
diff --git a/ppl/plotlib/Makefile b/ppl/plotlib/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/plotlib/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/plotlib/SOURCE_FILES b/ppl/plotlib/SOURCE_FILES
new file mode 100644
index 0000000..921cb61
--- /dev/null
+++ b/ppl/plotlib/SOURCE_FILES
@@ -0,0 +1,48 @@
+SRCS_F = \
+arc.F\
+cmprmt.F\
+cmrdst.F\
+comrd5.F\
+conseg.F\
+conseg_section.F\
+contur.F\
+datpt.F\
+daywk1.F\
+diff.F\
+frmt.F\
+getlev.F\
+habis.F\
+hdcopy.F\
+iday.F\
+inside.F\
+itdiff.F\
+jday.F\
+lenc.F\
+neftn5.F\
+numcde.F\
+numcde_off.F\
+numdm1.F\
+plotny.F\
+plott7.F\
+reset_labsiz.F\
+scinot.F\
+smooth.F\
+smx1.F\
+smy1.F\
+surf.F\
+taxis.F\
+taxis0.F\
+taxis1.F\
+taxis3.F\
+tayis.F\
+tayis0.F\
+tayis1.F\
+tayis3.F\
+time1.F\
+time2.F\
+time3.F\
+xaxis1.F\
+xaxis2.F\
+yaxis1.F\
+yaxis2.F\
+zgrid.F 
diff --git a/ppl/plotlib/arc.F b/ppl/plotlib/arc.F
new file mode 100644
index 0000000..932abcc
--- /dev/null
+++ b/ppl/plotlib/arc.F
@@ -0,0 +1,147 @@
+	subroutine   arc(x,y,nask,eps,xx,yy,nret,
+     ,      ks,kmax,xl,yl,splxp,splyp,spls,spline_tension)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+*
+* *sh*  - 1/26/93 modified routine to call spline under tension fit
+*                 if spline_tension is not zero.  otherwise, it will
+*		  use the fit that this algorithm calculates (cubic).
+*******************************************************************
+C** 
+C**    @(#)arc.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c	given four successive points x(k),y(k),k=1,4 defining 3 segments, 
+c	the points xx(k),yy(k),k=1,nret are generated describing a curve 
+c	between points 2 and 3 trying to match slope with similar curves 
+c	from 1 to 2 and from 3 to 4. if the segment (2,3) is less than eps 
+c	in length,nret is set to 2 and points 2 and 3 only are returned in 
+c	arrays xx,yy.  otherwise nret = the input parameter nask. 
+c	the curve xx,yy is a cubic over segment (2,3). 
+c	if segment (1,2) is less than eps the second derivative at 
+c	point 2 is set to zero.   if segment (3,4) is less than eps 
+c	the second derivative at point 3 is set to zero.  these two 
+c	features may be used for starting and ending an open curve. 
+c	oceanography emr  december 1969 
+c 
+	dimension x(*),y(*)
+	dimension  xx(11),yy(11),slope(3),ds(3) 
+! TMAP mod, spline fit:
+	dimension xl(*),yl(*),splxp(*),splyp(*),spls(*)
+c 
+	if(nask-2) 10,10,20 
+10	nret=2 
+	xx(1)=x(2) 
+	yy(1)=y(2) 
+	xx(2)=x(3) 
+	yy(2)=y(3) 
+	return 
+c 
+20	continue
+c
+! TMAP mod, spline fit:
+	if (spline_tension.ne.0.) then
+	nret=nask
+	do 141, k=1,nret
+	  splt=(spls(ks)+float(k)/float(nret)*
+     *         (spls(ks+1)-spls(ks)))/spls(kmax)
+	  call kurv2(splt,xx(k),yy(k),kmax,xl,yl,
+     *         splxp,splyp,spls,spline_tension)
+141	continue
+	else
+c
+	pi=3.1415926 
+	hafpi =pi*.50 
+	angmax =pi*.25 
+	xcent = (x(2)+x(3))*.5 
+	ycent = (y(2)+y(3))*.5 
+	dx2= x(3)-x(2) 
+	dy2= y(3)-y(2) 
+	ds2 =  sqrt(dx2*dx2+dy2*dy2) 
+	if(ds2-eps)10,30,30 
+30	ang2=atan2(dy2,dx2) 
+	cos2 = cos(ang2) 
+	sin2 = sin(ang2) 
+c 
+	do 130 k=1,3,2 
+	dx = x(k+1)-x(k) 
+	dy = y(k+1)-y(k) 
+	ds(k)=sqrt(dx*dx + dy*dy) 
+	slope(k)=0. 
+	if(ds(k)-eps) 130,40,40 
+40	ang =(atan2(dy,dx) - ang2)*.5 
+	if(ang-hafpi) 60,60,50 
+50	ang = ang-pi 
+60	if(ang+hafpi) 70,80,80 
+70	ang = ang+pi 
+80	if(ang-angmax)100,100,90 
+90	ang=angmax 
+100	if(ang+angmax)110,120,120 
+110	ang=-angmax 
+120	slope(k)=sin(ang)/cos(ang) 
+130	continue 
+	if(ds(3)-eps)132,134,134 
+132	slope(3)=-slope(1)*.5 
+134	if(ds(1)-eps)136,138,138 
+136	slope(1)=-slope(3)*.5 
+138	continue 
+	c= .25*(slope(3)-slope(1)) 
+	d= .25*(slope(3)+slope(1)) 
+c 
+	nret=nask 
+	dx=2./(nret-1) 
+	xt=-1.-dx 
+	do 140 k=1,nret 
+	  xt=xt+dx
+	  yt=(c+d*xt)*(xt*xt-1.) 
+	  xx(k)=(xt*cos2-yt*sin2)*ds2*.5+xcent 
+	  yy(k)=(xt*sin2+yt*cos2)*ds2*.5+ycent 
+140	continue
+c
+! TMAP mod, spline fit:
+	endif
+c
+	return 
+	end 
diff --git a/ppl/plotlib/cmprmt.F b/ppl/plotlib/cmprmt.F
new file mode 100644
index 0000000..3bb643b
--- /dev/null
+++ b/ppl/plotlib/cmprmt.F
@@ -0,0 +1,59 @@
+	SUBROUTINE CMPRMT(PMT,N)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)cmprmt.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	COMMON/CPFTN5/PRMPT
+	CHARACTER PRMPT*40,PMT*(*),FRMT*12
+	IF(N.NE.0)THEN
+		WRITE(FRMT,999)N
+999		FORMAT('(A3,A',I2.2,',A4)')
+		WRITE(PRMPT,FRMT)'('' ',PMT,''',$)'
+	ELSE
+		PRMPT='('' *'',$)'
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plotlib/cmrdst.F b/ppl/plotlib/cmrdst.F
new file mode 100644
index 0000000..900edec
--- /dev/null
+++ b/ppl/plotlib/cmrdst.F
@@ -0,0 +1,113 @@
+      SUBROUTINE CMRDST(LUN,FILE,CH) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)cmrdst.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C 
+C     WRITTEN IN JULY 1980  THIS ROUTINE 
+C     ALLOWS ALTERNAME INPUT  LUN,NAME AND 
+C     TERMINATOR CHARACTER LT 
+C 
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+      COMMON/CDFTN5/LN 
+      COMMON/CEFTN5/IN,IA,LT,NAME,INTEMP
+      COMMON/CPFTN5/PRMPT
+      CHARACTER FILE*(*),CH*(*),IN*80,IA*1,LT*1,NAME*81,INTEMP*80
+      CHARACTER PRMPT*40
+
+#ifdef unix
+      external init_cdepftn5
+#else
+      DATA LN,LT,NAME/5,'|','TT:'/,PRMPT/'('' *'',$)'/
+#endif
+
+      LN=LUN 
+      IF(CH.NE.' ')LT=CH 
+      IF(FILE(1:1).EQ.' ')RETURN 
+      NAME=FILE 
+      CLOSE(LN) 
+#ifdef unix
+	IF(NAME.EQ.'/dev/tty')THEN
+#else
+	if(name.eq.'TT:')then
+#endif
+	OPEN(LN,FILE=NAME,STATUS='UNKNOWN') 
+	ELSE
+#ifdef unix
+	OPEN(LN,FILE=NAME,STATUS='OLD',ERR=1000)
+#else
+	OPEN(LN,FILE=NAME,STATUS='OLD',readonly,ERR=1000)
+#endif
+	ENDIF
+      RETURN 
+1000	WRITE(5,*)' ERROR OPENING: ',NAME
+	STOP
+      END 
+
+
+#ifdef unix
+
+CC    Created this for FORTRAN_90 compile, but will be acceptable by 
+CC    all UNIX
+
+      block data init_cdepftn5
+
+      COMMON/CDFTN5/LN 
+      COMMON/CEFTN5/IN,IA,LT,NAME,INTEMP
+      COMMON/CPFTN5/PRMPT
+
+      CHARACTER FILE*81,CH*1,IN*80,IA*1,LT*1,NAME*81,INTEMP*80
+      CHARACTER PRMPT*40
+
+      DATA LN,LT,NAME/5,'|','/dev/tty'/,PRMPT/'('' *'',$)'/
+      DATA IN/' '/ 
+
+      end
+
+#endif
+
+
+
diff --git a/ppl/plotlib/comrd5.F b/ppl/plotlib/comrd5.F
new file mode 100644
index 0000000..873e7c1
--- /dev/null
+++ b/ppl/plotlib/comrd5.F
@@ -0,0 +1,167 @@
+      SUBROUTINE COMRD5(ICOM,X,M,ILB,N,IFLAG) 
+C** 
+C**    @(#)comrd5.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     *jd 11.94 - modified for AIX port
+*       Modification uses TM_NUMBER to determine if "value" is a number rather
+*       than the ERR= branch of a READ which fails on AIX/xlf
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+      CHARACTER ICOM*(*),ILB*(*),IN*80,LT*1,JX*20,IF*8,IA*1 
+      CHARACTER NAME*81,INTEMP*80,PRMPT*40
+      DIMENSION X(*),IFLAG(*)
+#ifndef unix
+	byte iab
+	equivalence (iab,ia)
+#endif 
+      COMMON/CEFTN5/ IN,IA,LT,NAME,INTEMP
+      COMMON/CDFTN5/LN 
+      COMMON/CPFTN5/PRMPT
+
+
+#ifdef unix
+CC   If unix, initialize IN in block data stmt in cmrdst.F.  The block data
+CC   is declared external in subroutine CMRDST in that file.
+      DATA J,KM/0,80/
+#else
+      DATA J,KM,IN/0,80,' '/ 
+#endif
+
+C 
+      LOGICAL TM_NUMBER                ! ** TMAP mod 11/94 **
+C
+C     THIS ROUTINE WAS WRITTEN BY DON DENBO IN MAY, 1980 
+C     IT IS LIKE COMRD BUT WRITTEN IN FORTRAN 77 
+C     SEE MILELIB DOC FOR DETAILS. 
+C     MODIFIED FOR PDP 11 IN AUGUST 1983 BY D. DENBO
+C 
+      ICOM=' ' 
+      ILB=' ' 
+      M=0 
+      N=0 
+      IFLAG(1)=0 
+      IF(J.NE.0)GOTO 21 
+#ifdef unix
+	IF(NAME(1:3).EQ.'/dev/tty')WRITE(LN,PRMPT)
+#else
+	IF(NAME(1:3).EQ.'TT:')WRITE(LN,PRMPT)
+#endif
+      READ(LN,'(A80)',END=901)IN 
+      DO 20 KM=80,1,-1 
+      IF(IN(KM:KM).NE.' ')GOTO 21 
+20    CONTINUE 
+21	K=INDEX(IN(J+1:),LT)+J
+	IF(K.EQ.J)K=81
+	INTEMP=IN(J+1:K-1)
+ 	CALL NEFTN5(J,KM,IS)
+	GOTO (200,31,22,23,900),IS
+22    M=1 
+      GOTO 31 
+23    J0=J 
+#ifndef unix
+	jb=iab
+	iab=iand(jb,95)
+#endif
+      ICOM=IA 
+      DO 30 I=2,10 
+	CALL NEFTN5(J,KM,IS)
+#ifdef unix
+	GOTO (30,33,33,30,33),IS
+#else
+	goto (29,33,33,29,33),is
+29	jb=iab
+	iab=iand(j,95)
+#endif
+30	ICOM(I:I)=IA
+      J=J0 
+      ICOM=' ' 
+      GOTO 32 
+33    IF(IA.EQ.LT.OR.J.GT.KM)GOTO 900 
+31	CALL NEFTN5(J,KM,IS)
+	GOTO (200,31,32,300,900),IS
+32    M=M+1 
+      IFLAG(M)=0 
+      GOTO 31 
+300   ILB=IA 
+      N=1 
+      DO 60 J=J+1,KM 
+      IA=IN(J:J) 
+      IF(IA.EQ.LT)GOTO 900 
+      N=N+1 
+	ILB(N:N)=IA
+60    CONTINUE 
+      GOTO 900 
+200   M=M+1 
+      JX=IA 
+      K=1 
+90	CALL NEFTN5(J,KM,IS)
+	GOTO (80,81,81,80,81),IS
+ 80    K=K+1 
+	JX(K:K)=IA
+      GOTO 90 
+81	WRITE(IF,'(''(E'',I2,''.0)'')')K
+      IFLAG(M)=1 
+
+#ifdef AIX_XLF
+      IF ( .NOT.TM_NUMBER(JX) ) GOTO 40  ! ** TMAP mod 11/94 **
+#endif
+      READ(JX,IF,ERR=40)X(M) 
+40    IF(IA.EQ.LT.OR.J.GT.KM)GOTO 900 
+      IF(IA.EQ.',')GOTO 31 
+100	CALL NEFTN5(J,KM,IS)
+	GOTO (200,100,31,300,900),IS
+900   IF(IA.EQ.LT)RETURN 
+      J=0 
+      RETURN 
+c
+c	eof read
+c
+901   continue
+c	CLOSE(LN) 
+c	OPEN(LN,FILE=NAME,STATUS='UNKNOWN') 
+      RETURN 
+      END 
diff --git a/ppl/plotlib/conseg.F b/ppl/plotlib/conseg.F
new file mode 100644
index 0000000..7a785fc
--- /dev/null
+++ b/ppl/plotlib/conseg.F
@@ -0,0 +1,166 @@
+	subroutine conseg(z,nxs,nys,px,py,nx,ny,xf,xoff,yf,yoff,
+     *	zlev,ndecl,lwgtl,lclr,nlev,hgt,narc,ang,status) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)conseg.F	1.2    7/30/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c
+C 
+C       lots of places ---> PPLMOD_PPLCMD ---> PPLMOD_PLTIT 
+C       ---> PPLMOD_PLOTZ ---> PPLMOD_CONSEG
+C       
+C       This subroutine plots contours of grid z(i,j) in square segments
+C       of length lseg grid units per side.
+C       
+C       z      - actual 2-D array of data values to be contoured
+C       nxs    - number of X grid points
+C       nys    - number of Y grid points
+C       px     - array of grid points along the X axis
+C       py     - array of grid points along the Y axis
+C       nx     - number of X grid points
+C       ny     - number of Y grid points
+C       xf     - factor to go from X axis to page coordinates?
+C       xoff   - X axis offset in page coordinates?
+C       yf     - factor to go from Y axis to page coordinates?
+C       yoff   - Y axis offset in page coordinates?
+C       zlev   - array of contour level values (lo val --> hi val)
+C       ndecl  - number of decimal places in the contour labels
+C       lwgtl  - weight of the contour line
+C       lclr   - 
+C       nlev   - number of levels to use
+C       hgt    - height of characters of labels in inches
+C       narc   - number of arc subsegments to use in contouring
+C       ang    - angle to rotate the contour plot
+C       
+C       
+C	oceanography emr  dec/1969 
+C       *jc* 5.97 Major clean up and commenting
+C       *jc* 5.97 Added code for curvilinear coordinates
+C      *acm* v581 5/2005 Add CONTOUR/MOD capability for modulo
+C                 replications on curvilinear data
+C V602 *acm* 2/07 check status coming out of CURV_COORD_RANGE; part of fix to bug 1485
+C V617 *acm* 1/09 Initialize the status flag (fixes bug 1622)
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+        include 'xcurvilinear.cmn'
+        include 'errmsg.parm'
+
+	dimension z(nxs,nys),px(nx),py(ny)
+	dimension zlev(2),ndecl(2),lwgtl(2),lclr(2)
+
+        real xadd, lmin, lmax, big
+	integer error,trans_no, ilo, ihi, jlo, jhi, status
+	real xinv,yinv,w(4),v(4),ndc(4),uc(4)
+
+	status = ferr_ok
+
+C       Calculate center point about which to rotate plot
+C       Plot will be rotated by 'ang' degrees.
+
+	xc = (px(1)+px(nx))*0.5
+	yc = (py(1)+py(ny))*0.5
+
+* Get range of indices for the curvi X,Y coordinates actually needed for the 
+* hlimits, vlimits that were requested.
+
+*	GET PROPER SCALING, NDC COORDINATES, ETC FOR FILL
+        IF (curvilinear) THEN 
+	   CALL FGD_GQCNTN(error,trans_no)
+	   IF (error .NE. 0) GOTO 1000
+
+	   CALL FGD_GQNT(trans_no,error,w,v)
+	   IF (error .NE. 0) GOTO 1000
+
+	   CALL get_user_coords (w,v,ndc,uc,xinv,yinv)
+
+           CALL CURV_COORD_RANGE (uc, ilo, ihi, jlo, jhi, status )
+           IF (status .NE. ferr_ok) goto 1000
+        ENDIF
+      
+        big = ABS(CMXGE)
+        lmin = big
+        lmax = -1*big
+        xadd = 0.
+
+        CALL CONSEG_SECTION(xc, yc, nx, ny, nxs, nys, px, py, z, 
+     .    xf, xoff, yf, yoff, zlev, ndecl, lwgtl, lclr, nlev, hgt, 
+     .    narc, ang, ilo, ihi, jlo, jhi, xadd, lmin, lmax)
+
+        IF (xmodulo .AND. curvilinear) THEN
+           nleft = 0
+           nright = 0
+           IF (lmin .GT. uc(1) ) nleft =  1 + INT(lmin - uc(1) )/ 360
+           IF (lmax .LT. uc(2) ) nright = 1 + INT(uc(2) - lmax )/ 360
+
+           IF (nleft .GT. 0) THEN
+              xadd = 0.
+              DO 100 i = 1, nleft
+                 xadd = xadd - 360.
+                 CALL CONSEG_SECTION(xc, yc, nx, ny, nxs, nys, px, py,z,
+     .          xf, xoff, yf, yoff, zlev, ndecl, lwgtl, lclr, nlev, hgt, 
+     .          narc, ang, ilo, ihi, jlo, jhi, xadd, lmin, lmax)
+
+ 100          CONTINUE
+           ENDIF
+
+           IF (nright .GT. 0) THEN
+              xadd = 0.
+              DO 110 i = 1, nright
+                 xadd = xadd + 360.
+                 CALL CONSEG_SECTION(xc, yc, nx, ny, nxs, nys, px, py,z,
+     .          xf, xoff, yf, yoff, zlev, ndecl, lwgtl, lclr, nlev, hgt, 
+     .          narc, ang, ilo, ihi, jlo, jhi, xadd, lmin, lmax)
+ 110          CONTINUE
+           ENDIF
+
+
+        ENDIF   ! xmodulo
+
+
+
+1000    return 
+	end 
diff --git a/ppl/plotlib/conseg_section.F b/ppl/plotlib/conseg_section.F
new file mode 100644
index 0000000..baad1bd
--- /dev/null
+++ b/ppl/plotlib/conseg_section.F
@@ -0,0 +1,119 @@
+	subroutine CONSEG_SECTION(xc, yc, nx, ny, nxs, nys, px, py, z, 
+     .    xf, xoff, yf, yoff, zlev, ndecl, lwgtl, lclr, nlev, hgt, 
+     .    narc, ang, ilo, ihi, jlo, jhi, xadd, lmin, lmax)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 
+C  v581 5/2005 *acm* From conseg.F for one modulo replication of a contour plot
+C  v67  2/2011 *acm* Fix ticket 1799; do contouring in larger sections.
+
+	include 'MISS.INC'
+
+	dimension zz(285,285),z(nxs,nys),px(nx),py(ny)
+	dimension zlev(2),ndecl(2),lwgtl(2),lclr(2)
+        integer izz, lseg
+
+        izz = 285
+        lseg = (izz-1)-2
+
+C       Calculate the beginning and ending index values (iam,ibm) and
+C       the number of index values (nxx) along the X axis in this 
+C       zz() subregion.
+
+	ia = 1 
+ 40	ib = min0(ia+lseg,nx) 
+	lrem = nx-ib 
+	if (lrem*(lseg-lrem)) 60,60,50 
+ 50	ib = (1+ia+nx)/2 
+ 60	iam = max0(ia-1,1) 
+	ibm = min0(ib+1,nx) 
+	lxm = ibm-iam 
+	iim = 1+(ia-iam)
+	nxx = (ib-ia)+1 
+	
+	
+C       Calculate the beginning and ending index values (jam,jbm) and
+C       the number of index values (nyy) along the Y axis in this 
+C       zz() subregion.
+
+	ja=1 
+ 80	jb = min0(ja+lseg,ny) 
+	lrem = ny-jb 
+	if (lrem*(lseg-lrem)) 100,100,90 
+ 90	jb = (1+ja+ny)/2 
+ 100	jam = max0(ja-1,1) 
+	jbm = min0(jb+1,ny) 
+	lym = jbm-jam 
+	jjm = 1+(ja-jam)
+	nyy = (jb-ja)+1 
+	
+	
+C       Check all the z values for "goodness" and replace the bad ones with 1.e35 ?
+C       Fill in the zz() subregion with values from z().
+
+	do 130 i=iam,ibm 
+	   ii =  i-iam+1 
+	   do 120 j=jam,jbm 
+	      jj =  j-jam+1 
+	      if ((zle.and.z(i,j).le.cmzle).or.
+     1	   (zeq.and.z(i,j).eq.cmzeq).or.
+     2	   (zge.and.z(i,j).ge.cmzge)) then
+		 zz(ii,jj)=1.e35
+	      else
+		 zz(ii,jj)=z(i,j)
+	      endif
+ 120	   continue
+ 130	continue
+	   
+
+C       Actually contour the zz() subregion.
+
+	call contur(zz,izz,izz,px(iam),py(jam),nxx,nyy,xf,xoff,
+     .    yf,yoff,zlev,ndecl,lwgtl,lclr,nlev,hgt,narc,ang,xc,yc,
+     .    xadd,lmin,lmax) 
+
+C       This is the Y axis loop
+
+	ja = jb 
+	if (ja-ny) 80,160,160
+
+C       This is the X axis loop
+
+ 160	ia = ib 
+	if (ia-nx) 40,170,170 
+
+ 170	return 
+	end 
diff --git a/ppl/plotlib/contur.F b/ppl/plotlib/contur.F
new file mode 100644
index 0000000..4c7b9b9
--- /dev/null
+++ b/ppl/plotlib/contur.F
@@ -0,0 +1,908 @@
+        subroutine contur(z,nxs,nys,px,py,nx,ny,xf,xoff,yf,yoff,
+     *	zlev,ndecl,lwgtl,lclr,nlev,hgt,narc,ang,xct,yct,xadd,lmin,lmax)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]CONTUR.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+* *sh*  - 2/15/89 corrected ATAN error for vertical labels
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+* !!! ALSO :  Routine overflows bounds at line
+*		610	xx(l)= px(il)*xf + xoff
+*	      ...bounds checking is OFF to match Denbo's compile stmt
+* *sh*  - applied Don's 12/9/88 mods (creating v1.4 of code CONTUR)
+*		... replaced earlier ATAN patch with Don's version
+*
+* *tc*  - 1/15/93 put in option for 'draftsman' style (horz) contour labels, 
+*            ...logical variable draftsman turns on or off
+* *tc*  - 1/26/93 put in spline under tension fit for contour lines.  uses
+*                 spline_tension variable to determine tension.
+* *tc*  - 5/04/93 mod to correct bug resulting zag near labels, with tension
+*		  > 0, and recapture original behavior w tension=0.
+*
+* *jd	- 3/29/94 fix bug where specification of zero height contour labels
+*		  bombs out on ALPHA machines (divide by zero)
+* *jc*  - 3/26/99 added transformation to curvilinear coordinates
+*  v581 5/2005 *acm* Add CONTOUR/MOD capability for modulo replications for 
+*                    curvilinear data
+* V630  *acm* 9/09 change a message only
+C  v67  2/2011 *acm* Fix ticket 1799; do contouring in larger sections.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+****************************************************************************
+C**
+C**    @(#)contur.F	1.2    7/30/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     given heights z defined over a rectangular grid,contours are drawn
+c     at specified levels. there are provisions for labeling the
+c     contours,blanking regions of the rectangle,and making the contours
+c     more smooth flowing.
+c
+c     z(i,j),i=1,nx j=1,ny  is the input array of heights.points in
+c          undefined regions of z should be set to 1.e35
+c     x1,y1,xl,yl are the lower left and upper right corners of
+c          the grid on the plotter in inches.
+c     zlev(k),k=1,nlev is the array of levels to be contoured
+c     ndecl(k),k=1,nlev gives the number of decimal places in the
+c          contour labels. -1=no decimal. -2 or less=no label.
+c     lwgtl(k),k=1,nlev  gives the weight of the contour line.
+c          1 or less=standard line. 2=heavy line. 3=dotted line.
+c     hgt = height of characters of labels in inches.
+c     narc = 1,2,3 ... 10 .  an arc of narc subsegments  replaces each
+c     st line segment of a contour. the arc will match slopes with
+c     the adjacent arcs.   care should be taken here as overlapping of
+c     contours is possible when narc is used. narc=1 has no effect.
+c**
+c**	ang = angle to rotate the contour plot
+c**	xct = x center about which to rotate it
+c**	yct = y center about which to rotate plot
+c**
+c     ind10 should be dimensioned at least nx by ny/10 rounded up.
+c     kab should be dimensioned at least nx/10+2 by ny/10+2 .
+c     If these dimensions are raised, increase the size of workspace
+c     s, x, y, x_curv, y_curv proportionally.
+c
+c     oceanography emr   dec/69
+	dimension z(nxs,nys),px(nx),py(ny),s(6000),ind10(300,40)
+	dimension x(6000),y(6000)
+	dimension zmaxb(10,10),zminb(10,10),kab(40,40)
+
+	dimension  zlev(2),  ndecl(2),lwgtl(2),xc(11),yc(11),ixpon(10)
+	dimension lclr(2)
+
+	dimension isin(4),ind(4),xx(4),yy(4),zz(4),lused(4),kabov(4)
+	common/rotcon/xk,yk,snthta,csthta
+! TMAP mod, spline fit:
+! added gkscm2.cmn which includes spline_tension and draftsman
+
+	include 'gkscm2.cmn'
+	include 'dashzz_inc.decl'
+	include 'DASHZZ.INC'
+	include 'conlab_inc.decl'
+	include 'CONLAB.INC'
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+        include 'xcurvilinear.cmn'
+
+* TMAP interrupt flag
+
+	include 'xinterrupt.cmn'
+
+	integer*4 ixpon,ind10,jbit,ind1,indl
+	character frmt*20,str*40
+	integer colold
+! TMAP mod, horz contour labels:
+! set up arrays for storing labels and such.  mlab is the maximum number
+! of contour labels expected on any ONE contour line in the plot.
+	parameter (mlab=200)
+	real xlabp(mlab),ylabp(mlab),xlabc(mlab),ylabc(mlab),widthp
+        realxadd,lmin,lmax
+
+C	Place init into data stmt *jd* 12.96 linux
+	integer	nlabp,nlabc
+	data	nlabp /0/,nlabc /0/
+
+	integer iatime(3)
+! TMAP mod, spline fit:
+	parameter (msplsz=2000)
+	real splxp(msplsz),splyp(msplsz),spltmp(msplsz),spls(msplsz)
+	integer splier
+
+C     Curvilinear coordinates declarations
+        integer icurv, status
+#ifdef double_p
+	real*8 x_curv(6000), y_curv(6000)
+#else
+	real x_curv(6000), y_curv(6000)
+#endif
+c
+c     initialize
+c*******************************************************************************
+c
+	if(nlev)1200,1200,12
+12	pi=3.1415926
+
+c
+c	apply the rotation and scaling
+c
+	thta=ang*pi/180.
+	snthta=sin(thta)
+	csthta=cos(thta)
+	xxct=xct*xf+xoff
+	yyct=yct*yf+yoff
+	xk=-xxct*csthta+yyct*snthta+xxct
+	yk=-yyct*csthta-xxct*snthta+yyct
+c	dslab=100.
+c	dslab=5.
+	colold=colour
+	icolro=0
+	slab1f=.4
+	isin(1)=0
+	isin(2)=1
+	isin(3)=0
+	isin(4)=-1
+	big=.9e35
+	nxm1=nx-1
+	nym1=ny-1
+	hhgt = hgt /2.
+	ny10=(ny-1)/10+1
+	do 17 jbit=1,10
+17	ixpon(jbit)=4**(jbit-1)
+c
+c     get zmax,zmin,zrng,weezee
+c*******************************************************************************
+c
+	iblk=max0(nx/10+1,5)
+	jblk=max0(ny/10+1,5)
+	zmax=-1.e35
+	zmin=1.e35
+	ib=0
+	do 55 istrt=1,nx,iblk
+	ib=ib+1
+	iend=min0(istrt+iblk,nx)
+	jb=0
+	do 55 jstrt=1,ny,jblk
+	jb=jb+1
+	jend=min0(jstrt+jblk,ny)
+	zmaxbl=-1.e35
+	zminbl=1.e35
+	do 50 i=istrt,iend
+	do 50 j=jstrt,jend
+	zij=z(i,j)
+	if(zij.gt.big) go to 50
+	zmaxbl=amax1(zij,zmaxbl)
+	zminbl=amin1(zminbl,zij)
+50	continue
+	zmax=amax1(zmaxbl,zmax)
+	zmin=amin1(zminbl,zmin)
+	zmaxb(ib,jb)=zmaxbl
+	zminb(ib,jb)=zminbl
+55	continue
+	zrng=(zmax-zmin)*1.1
+	if(zrng)1200,1200,60
+60	weezee = zrng*.0002
+c
+c     main loop over all contour levels
+c*******************************************************************************
+c
+	do 1100  lev=1,nlev
+! TMAP mod, horz contour labels:
+! remember where the contour labels were for the previous contour line.
+! these will be compared to the location of labels on the current line to
+! determine any conflicts.
+	if (draftsman) then
+	  do 1102, k1=1,nlabc
+	    xlabp(k1)=xlabc(k1)
+	    ylabp(k1)=ylabc(k1)
+1102	  continue
+	  nlabp=nlabc
+	  nlabc=0
+	  widthp=width
+	endif
+	IF ( interrupted ) GOTO 1200		! TMAP interrupt processing
+	zc = zlev(lev)
+c**	if((zmax-zc)*(zc-zmin))1100,1100,70
+c** replace with a less prone to overflow calculation
+c**
+	if(zc.ge.zmax .or. zc.le.zmin)goto 1100
+70	ndec = ndecl(lev)
+	icolr=lclr(lev)
+	lwgt = lwgtl(lev)
+	do 75 i=1,nx
+	do 75 j=1,ny10
+75	ind10(i,j)=0
+c
+c     get label width
+c*******************************************************************************
+c
+	if(ndec.ge.0)then
+	    write(frmt,999)ndec
+999	    format('(a10,f20.',i2.2,',a10)')
+	    write(str,frmt)conpre,zc,conpst
+	else
+	    write(str,998)conpre,int(zc+sign(0.5,zc)),conpst
+998	    format(a10,i20,a10)
+	endif
+	call squish(str,1,40)
+	nchar=lnblk(str,40)
+	width=symwid(hgt,nchar,str)+hhgt
+	if(icolr.ne.icolro)then
+	    if(icolr.eq.0)then
+		call color(colold)
+	    else
+		call color(icolr)
+	    endif
+	    icolro=icolr
+	endif
+c	nchar = ndec+2
+c	if(nchar)120,120,100
+c100	abzrnd = abs(zc)+.5/10.**max0(0,ndec)
+c	do 110 k=1,10
+c	if(abzrnd-10**k)120,110,110
+c110	nchar=nchar+1
+c120	nchar=nchar+1
+c	if(ndec.lt.0)cthen
+c	    width= hgt *(nchar*9.+8.)/8.
+c	else
+c	    width= hgt *((nchar-1)*9.+13.)/8.
+c	endif
+c
+c     loop over the grid searching for a contour entering square ii,jj
+c     thru side 1 or 4.      (the contour must be unused)
+c*******************************************************************************
+c
+	ib=0
+	do 1010 istrt=1,nx,iblk
+	iend=min0(istrt+iblk,nx+1)
+	ib=ib+1
+	jb=0
+	do 1010 jstrt=1,ny,jblk
+	jb=jb+1
+	if(zmaxb(ib,jb).lt.zc .or. zminb(ib,jb).gt.zc) go to 1010
+	jend=min0(jstrt+jblk,ny+1)
+	do 200 i=istrt,iend
+	ikab=i-istrt+1
+	do 200 j=jstrt,jend
+	jkab=j-jstrt+1
+	kabij=10
+	if(i.gt.nx .or. j.gt.ny) go to 200
+	zij=z(i,j)
+	if(zij.gt.big) go to 200
+	if(abs(zij-zc).le.weezee) zij=zc+sign(weezee,zij-zc)
+	kabij=-1
+	if(zij.gt.zc) kabij=1
+200	kab(ikab,jkab)=kabij
+	iendm1=iend-1
+	jendm1=jend-1
+	do 1000 ii=istrt,iendm1
+	ikab=ii-istrt+1
+	do 1000 jj=jstrt,jendm1
+	jkab=jj-jstrt+1
+	i=ii
+	j=jj
+	kabij=kab(ikab,jkab)
+	kabip1=kab(ikab+1,jkab)
+	kabjp1=kab(ikab,jkab+1)
+	jwrd=(j-1)/10+1
+	j2bit=j-(jwrd-1)*10
+	ind1=ind10(i,jwrd)/ixpon(j2bit)
+	ind1=ind1-(ind1/4)*4
+	lused4=ind1/2
+	lused1=ind1-2*lused4
+	iretrn=300
+	ll=1
+	if(kabij+kabip1+lused1.eq.0) go to 540
+	ll=4
+	if(kabij+kabjp1+lused4.eq.0) go to 540
+	go to 1000
+300	continue
+340	lin = ll
+	k=1
+	nseg = 1
+c
+c     given entrance to square(i,j) on side lin, record the entrance
+c     point x(k),y(k).  set lin to used.
+c*******************************************************************************
+c
+350	lp1 = lin+1-(lin/4)*4
+	lp2 = lp1+1-(lp1/4)*4
+	lm1 = lp2+1-(lp2/4)*4
+	if(iretrn-360)355,360,360
+355	k=k+1
+	frac = (zc-zz(lin))/(zz(lp1)-zz(lin))
+	x(k) = xx(lin)+ (xx(lp1)-xx(lin))*frac
+	y(k) = yy(lin)+ (yy(lp1)-yy(lin))*frac
+	iind=i+lp2/4
+	jind=j+lp1/4
+	lhor = lin-(lin/2)*2
+	jwrd=(jind-1)/10+1
+	j2bit=jind-(jwrd-1)*10
+#ifdef unix
+        ind10(iind,jwrd)=ind10(iind,jwrd)+int(2.-lhor)*ixpon(j2bit)
+#else
+	ind10(iind,jwrd)=ind10(iind,jwrd)+jint(2.-lhor)*ixpon(j2bit)
+#endif
+c
+c     see if an exit exists on side l-1,l+1,or l+2. if so choose the one
+c     closest to side l. if the exit is already used terminate x,y.
+c*******************************************************************************
+c
+360	iretrn = 350
+	lexit = lm1
+	if(kabov(lin)+kabov(lm1))380,370,380
+370	if(kabov(lp1)+kabov(lp2))450,390,450
+380	if(kabov(lp1)+kabov(lp2))410,400,410
+390	flm1 = (zc-zz(lin))/(zz(lm1)-zc)
+	flp1 = (zc-zz(lp1))/(zz(lp2)-zc)
+	if(lused(lp1).eq.1) go to 450
+	if(flm1.le.flp1 .and. lused(lm1).eq.0) go to 450
+400	lexit = lp1
+	go to 450
+410	lexit = lp2
+	if(kabov(lp2)+kabov(lm1))470,450,470
+450	if(lused(lexit))530,530,460
+460	kmax=k+1
+	x(kmax)=x(2)
+	y(kmax)=y(2)
+	x(1) = x(k)
+	y(1)=y(k)
+	x(k+2)=x(3)
+	y(k+2)=y(3)
+	klosed=1
+	go to 700
+c
+c     no exit.  if nseg=1 reverse x,y and continue.
+c               if nseg=2 terminate x,y.
+c*******************************************************************************
+c
+470	if(kabov(lp2)+kabov(lm1)-15)480,480,500
+480	kda=lin
+	kdb=lp2
+	if(kabov(lp2)-5)495,495,490
+490	kda = lm1
+	kdb = lp1
+495	k=k+1
+	frac = (zc-zz(kda))/(zz(kdb)-zz(kda))
+	x(k) = xx(kda) + (xx(kdb)-xx(kda))*frac
+	y(k) = yy(kda) + (yy(kdb)-yy(kda))*frac
+500	if(nseg-1)510,510,505
+505	kmax=k
+	x(1)=x(2)
+	y(1)=y(2)
+	x(k+1)=x(k)
+	y(k+1)=y(k)
+	klosed=0
+	go to 700
+510	iretrn=360
+	nseg = 2
+	kh = 1+k/2
+	do 520 kk=2,kh
+	kkr = k+2-kk
+	xkk=x(kk)
+	ykk=y(kk)
+	x(kk)= x(kkr)
+	y(kk)= y(kkr)
+	x(kkr)=xkk
+520	y(kkr)=ykk
+	i=ii
+	j=jj
+	lexit=ll
+c
+c     find square entered by present exit. get xx,yy,zz,kabov for each
+c     corner and lused for each side.
+c*******************************************************************************
+c
+530	i= i+ isin(lexit)
+	jsub=5-lexit
+	j= j +isin(jsub)
+	lin=lexit+2 - ((lexit+1)/4)*4
+c
+c
+540	do 620 l=1,4
+	jl=j+(l-1)/2
+	lp1=l+1-(l/4)*4
+	il=i+(lp1-1)/2
+	ind(l)=0
+	zz(l)=1.e35
+	kabov(l)=10
+	if(il*(nx+1-il))610,610,550
+550	if(jl*(ny+1-jl))610,610,560
+560	if(z(il,jl)-big)570,610,610
+570	jwrd=(jl-1)/10+1
+	j2bit=jl-(jwrd-1)*10
+	indl=ind10(il,jwrd)/ixpon(j2bit)
+	ind(l)=indl-(indl/4)*4
+	zz(l)=z(il,jl)
+	if(abs(zz(l)-zc)-weezee)580,580,590
+580	zz(l)=zc+sign(weezee,zz(l)-zc)
+590	kabov(l)=-1
+	if(zz(l)-zc)610,610,600
+600	kabov(l)=1
+ 610    xx(l)= px(il)*xf + xoff
+620	yy(l)= py(jl)*yf + yoff
+	lused(4) = ind(1)/2
+	lused(1) = ind(1)-2*lused(4)
+	lused(2) = ind(2)/2
+	lused(3) = ind(4)-(ind(4)/2)*2
+	if(iretrn-350) 300,350,350
+c
+c     the arrays x,y are now complete. calculate distance s along
+c     the contour. start plotting the contour
+c*******************************************************************************
+c
+700	s(2)=0.
+	if(kmax-2)1000,1000,720
+
+c
+c     For the three argument contour command, the px and py arrays contain
+c     fractional indices instead of axis values.  At this point in the code,
+c     the x and y arrays contain the page coordinates.  Here we undo the
+c     factor(xf/yf) and offset(xoff/yoff) calculations to retrieve the fractional
+c     indices, call CURV_COORD() to converts these indices into the transformed
+c     axis values, and then reapply the offset and factor.
+c
+ 720    IF (curvilinear) THEN
+           DO 722 icurv=1, kmax
+              x_curv(icurv)=(x(icurv)-xoff)/xf
+              y_curv(icurv)=(y(icurv)-yoff)/yf
+ 722       CONTINUE
+
+           CALL CURV_COORD(x_curv, y_curv, kmax, 1.0, 1.0, status) ! xform the pts
+	   IF (curv_missing) GOTO 1000
+
+           DO 724 icurv=1, kmax
+              x(icurv)=(x_curv(icurv)+xadd)*xf + xoff
+              y(icurv)=y_curv(icurv)*yf + yoff
+              lmin = MIN(lmin, x_curv(icurv))
+              lmin = MAX(lmax, x_curv(icurv))
+ 724       CONTINUE
+        ENDIF
+
+        do 750 k=3,kmax
+	dxx = x(k)-x(k-1)
+	dyy = y(k)-y(k-1)
+750	s(k) = s(k-1)+ sqrt(dxx*dxx+dyy*dyy)
+	smax = s(kmax)
+	slab1 = smax*slab1f
+! TMAP mod, spline fit:
+! initialize spline work arrays if using spline under tension fit.
+	if (spline_tension.ne.0.) then
+	  call kurv1(kmax-1,x(2),y(2),0.,0.,3,splxp,splyp,
+     ,      spltmp,spls,spline_tension,splier)
+	  if (splier.ne.0) then
+	    print*,' error in pplmod_contur.F, call to kurv1 ',splier
+	  endif
+	endif
+! TMAP mod, horz contour labels:
+! this is where the initial offset is set for a contour label on a contour
+! line.  the first label is shifted in dslab-stest distance from the edge, not 
+! dslab as might be expected.  modify the stest line to get something you like.
+	if (draftsman) then
+	  stest = max1(0.0,dslab-slab1)                 ! original code
+c
+c	  stest = max1(0.0,dslab-dslab*0.5*		! shifted by 1/2 the
+c     .      (smax/dslab-float(int(smax/dslab))))	! excess of n dslab labels
+c
+c	  call itime(iatime)				! more of a random
+c	  slab1 = smax*0.4*rand(iatime(3)*k)+0.1	! starting point
+c	  stest = max1(0.0,dslab-slab1)			! iatime(3) is sec
+c
+c	  stest = max1(0.0,dslab-width)			! inset width
+c
+c	  stest = max1(0.0,dslab*(1.0-0.2))		! inset 0.2 * dslab
+c
+	else
+	  stest = max1(0.0,dslab-slab1)
+	endif
+	k=2
+	call plotny(x(2),y(2),3,0)
+c
+c     check conditions for labelling.
+c*******************************************************************************
+c
+755	if(ndec+2)900,900,760
+760	km1= max0(k-1,2)
+	stest = stest + s(k)-s(km1)
+	if(stest-dslab)900,770,770
+770	if(smax-s(k)-2.0*width)900,900,780
+780	kp1=k+1
+	if(lev.eq.1) go to 785
+	dlev=abs(zlev(lev)-zlev(lev-1))
+	xt = (x(k) - xoff)/xf
+	yt = (y(k) - yoff)/yf
+	do 781 i=1,nx-1
+	if(xt.ge.px(i) .and. xt.le.px(i+1))goto 782
+781	continue
+782	do 783 j=1,ny-1
+! TMAP mod 4/19/89 - applied fixes from DON
+!	if(yt.ge.py(i) .and. yt.le.py(i+1))goto 784	! original code
+	if(yt.ge.py(j) .and. yt.le.py(j+1))goto 784
+783	continue
+784	i=min0(i,nx-1)
+	j=min0(j,ny-1)
+	dx=(px(i+1)-px(i))*xf
+	dy=(py(j+1)-py(j))*yf
+	if(z(i+1,j).ge.big)then
+	    dzdx=0.0
+	else
+	    dzdx=(z(i+1,j)-z(i,j))/dx
+	endif
+	if(z(i,j+1).ge.big)then
+	    dzdy=0.0
+	else
+	    dzdy=(z(i,j+1)-z(i,j))/dy
+	endif
+c**	dzdg=sqrt(dzdx*dzdx+dzdy*dzdy)
+c** replace with a less prone to overflow calculation
+c**
+	dzdg=abs(dzdx)+abs(dzdy)
+! TMAP mod, horz contour labels:
+! this section checks to make sure that at this x,y, the contour label
+! will not hit another contour line if it gets written.  it does this
+! by comparing the amount of space between contour lines versus the 
+! width and height of the label.  this should work most of the time, but
+! not all the time because it only checks at this one point.  if the contour 
+! lines are very wigly, it's possible that a label could be written that would
+! overlie another contour line.  hopefully the check on space/arc would
+! remove this case though.
+	if (draftsman) then
+          if (dzdy.ne.0.) then
+	    cspacey=abs(dlev/dzdy)
+            if (cspacey.lt.hgt*1.05) go to 900
+	  endif
+	  if (dzdx.ne.0.) then
+	    cspacex=abs(dlev/dzdx)
+            if (cspacex.lt.width*1.05) go to 900
+	  endif
+        else
+	  if(dzdg.eq.0.) go to 785
+	  cspace=dlev/dzdg
+	  if(cspace.lt.hgt*.90) go to 900
+        endif
+785	continue
+	do 800 kk = kp1,kmax
+	dxx = x(kk)-x(k)
+	dyy = y(kk)-y(k)
+	space = sqrt(dxx*dxx+dyy*dyy)
+	ark =s(kk)-s(k)
+! TMAP mod, horz contour labels:
+! this section decides whether a label can fit along this section of contour 
+! line.  the label will fit if the gap in the contour line is EITHER wide enough 
+! (dxx >~ spacex) OR high enough (dyy >~ hgt) where spacex and spacey is the 
+! amount of space (in x or y) that is needed to write the label.  change spacex 
+! and spacey to alter the gap size.  spacex and spacey are also used farther 
+! below.  spacex=width is pretty straight forward.  spacey=hgt should be the
+! appropriate y space but this doesn't work so well.  adding a little extra
+! hgt was necessary and then the slope of the contour line needed to be taken
+! into account.  this was found by trial and error.
+	if (draftsman) then
+	  spacey=hgt+0.4*hgt+hgt*abs(dyy/space)*abs(dyy/space)
+	  spacex=width
+	  if(abs(dyy)-spacey)791,792,792
+791	  if(abs(dxx)-spacex)800,792,792
+792	  if(space/ark-.95)900,810,810
+	else
+	  if(space-width)800,790,790
+790	  if(space/ark-.95)900,810,810
+        endif
+800	continue
+	go to 900
+c
+c     draw the label
+c*******************************************************************************
+c
+! TMAP mod, horz contour labels:
+! move the stest=0. to just after symbel is called.  this has the same
+! effect and allows for further conflicts to be checked below without reseting
+! this parameter.  setting this parameter to 0. effectively causes the next
+! label to be written dslab distance over while not reseting stest indicates
+! that the label was not written and that there should only be a minor shift
+! before trying to write the label again.
+!810	stest=0.
+810	continue
+c	do 812 kkk=1,5
+c	dxx=x(kk-1)+(x(kk)-x(kk-1))*.2*kkk-x(k)
+c	dyy=y(kk-1)+(y(kk)-y(kk-1))*.2*kkk-y(k)
+c	space=sqrt(dxx*dxx+dyy*dyy)
+c	if(space-width)812,812,815
+c812	continue
+c815	continue
+c	xendl = x(k) + width*dxx/space
+c	yendl = y(k) + width*dyy/space
+	xa=x(kk-1)-x(k)
+	xb=x(kk)-x(kk-1)
+	ya=y(kk-1)-y(k)
+	yb=y(kk)-y(kk-1)
+	aa=xb*xb+yb*yb
+	bb=xa*xb+ya*yb
+	cc=xa*xa+ya*ya-width*width
+	zxy=(-bb+sqrt(bb*bb-aa*cc))/aa
+! TMAP mod, horz contour labels:
+! this section determines the x and y extent of the gap in the contour
+! line.  dxx and dyy depend on whether the label fits in an x-dir
+! gap or a y-dir gap.  basically, dxx =~ width of label and dyy =~ ya+yb
+! if x-dir and dyy =~ hgt and dxx =~ xa+xb if y-dir.  need to watch for
+! xb or yb equal to zero.  if there is a divide by zero, handle it a 
+! little differently.
+	if (draftsman) then
+          if (abs(dyy).ge.spacey.and.abs(dxx).ge.spacex) then
+            if (abs(dyy)/spacey.lt.abs(dxx)/spacex) then
+	      dxx=spacex*sign(1.0,(x(kk)-x(k)))
+	      if (xb.eq.0.) then
+	        dyy=spacey*sign(1.0,(y(kk)-y(k)))
+	        print *,' pplmod_contur.F, note xb.eq.0 in contur ',str(1:4)
+	      else
+	        dyy=ya+yb*(spacex-abs(xa))/abs(xb)
+	      endif
+            else
+	      dyy=spacey*sign(1.0,(y(kk)-y(k)))
+	      if (yb.eq.0.) then
+	        dxx=spacex*sign(1.0,(x(kk)-x(k)))
+	        print *,' pplmod_contur.F, note yb.eq.0 in contur ',str(1:4)
+	      else
+	        dxx=xa+xb*(spacey-abs(ya))/abs(yb)
+	      endif
+            endif
+	  elseif (abs(dyy).ge.spacey) then
+	    dyy=spacey*sign(1.0,(y(kk)-y(k)))
+	    if (yb.eq.0.) then
+	      dxx=spacex*sign(1.0,(x(kk)-x(k)))
+	      print *,' pplmod_contur.F, note yb.eq.0 in contur ',str(1:4)
+	    else
+	      dxx=xa+xb*(spacey-abs(ya))/abs(yb)
+	    endif
+          elseif (abs(dxx).ge.spacex) then
+	    dxx=spacex*sign(1.0,(x(kk)-x(k)))
+	    if (xb.eq.0.) then
+	      dyy=spacey*sign(1.0,(y(kk)-y(k)))
+	      print *,' pplmod_contur.F, note xb.eq.0 in contur ',str(1:4)
+	    else
+	      dyy=ya+yb*(spacex-abs(xa))/abs(xb)
+	    endif
+	  else
+	    print*,' error e1 in pplmod_contur.F'
+	    stop
+	  endif
+	else
+	  dxx=xa+xb*zxy
+	  dyy=ya+yb*zxy
+	endif
+	xendl=x(k)+dxx
+	yendl=y(k)+dyy
+! TMAP mod, spline fit:
+! modify xendl and yendl if doing a spline_tension fit.  xendl and yendl are
+! between fixed points.  x(k),y(k) and x(kk),y(kk) are fixed points and a spline
+! fit to those points will just return themselves, so don't bother.  if narc
+! is less than 2, then no interpolation points will be calculated and this
+! step can be skipped.  it is possible that the transformed xendl and yendl
+! will not satisfy all the label criteria for gap size, arc, etc.  if this
+! leads to labels looking poor, a fix will be needed.
+	if (narc.gt.1.and.spline_tension.ne.0.) then
+          splt=(spls(kk-1)-((x(kk)-xendl)**2+(y(kk)-yendl)**2)**0.5)/
+     /         spls(kmax-1)
+          call kurv2(splt,xs,ys,kmax-1,x(2),y(2),
+     *               splxp,splyp,spls,spline_tension)
+	  xendl=xs
+	  yendl=ys
+	endif
+c**
+c**	add rotation code for label
+c**
+	xst=x(k)*csthta-y(k)*snthta+xk
+	yst=y(k)*csthta+x(k)*snthta+yk
+	xstp=xendl*csthta-yendl*snthta+xk
+	ystp=yendl*csthta+xendl*snthta+yk
+	dxx=xstp-xst
+	dyy=ystp-yst
+c
+! TMAP mod, horz contour labels:
+! set angle, xlab, and ylab where xlab,ylab is the starting position where
+! the label should be written.  also, loops 818 and 819 make sure that the
+! contour label won't hit it's own contour line somewhere else.  this is not 
+! an issue with non-draftsman labels because the label is always along a 
+! segment of the contour line.  with draftsman labels, the label may only cut 
+! into a small segment of the contour line.  then later, the contour line may 
+! turn sharply, come back, and cross over the just written label.  if this is
+! the case, don't write the label.
+	if (draftsman) then
+	  angle = 0.
+	  xlab = (xst+xstp)*0.5-0.5*width+0.5*hhgt
+	  ylab = (yst+ystp)*0.5-0.5*hgt
+	  xcen = (xst+xstp)*0.5
+	  ycen = (yst+ystp)*0.5
+	  do 818 k1=1,k-1
+	    if ((abs(x(k1)  -xcen).lt.(width*0.5)).or.
+     .	        (abs(x(k1+1)-xcen).lt.(width*0.5))) then
+	      if ((ycen-y(k1))*(ycen-y(k1+1)).lt.0.) goto 900
+c	      if (abs(y(k1)-ycen).lt.hgt*0.5) goto 900
+c	      if (abs(y(k1+1)-ycen).lt.hgt*0.5) goto 900
+	    endif
+818	  continue
+	  do 819 k1=kk+1,kmax
+	    if ((abs(x(k1)  -xcen).lt.(width*0.5)).or.
+     .	        (abs(x(k1-1)-xcen).lt.(width*0.5))) then
+	      if ((ycen-y(k1))*(ycen-y(k1-1)).lt.0.) goto 900
+c	      if (abs(y(k1)-ycen).lt.hgt*0.5) goto 900
+c	      if (abs(y(k1-1)-ycen).lt.hgt*0.5) goto 900
+	    endif
+819	  continue
+	else
+	  angle = 90. 
+! TMAP patch - Don's version of ARCSIN fix - 4/19/89
+          if(dyy.lt.0.0)angle=-90.
+! end of TMAP patch 4/19/89
+	  if(dxx)820,830,820 
+820	  angle = atan(dyy/dxx)*180./pi 
+830	  if(dxx) 850,840,840 
+840	  if (width .eq. 0.0) then
+	     xlab = xst
+             ylab = yst
+          else
+             xlab = xst+ hhgt*(0.5*dxx+dyy)/width
+	     ylab = yst+ hhgt*(0.5*dyy-dxx)/width
+	  endif
+	  go to 860
+850	  if (width .eq. 0.0) then
+	     xlab = xstp
+             ylab = ystp
+          else
+	     xlab = xstp-hhgt*(0.5*dxx+dyy)/width
+	     ylab = ystp-hhgt*(0.5*dyy-dxx)/width
+	  endif
+	endif
+c
+! TMAP mod, horz contour labels:
+! this loop checks to make sure the current label is not going to conflict
+! with a label written on the previous contour line.  the current contour
+! label is compared with all nlabp previous labels on the previous contour
+! line.  if there is an overlap, then don't write the current label.  the
+! allowable 'closeness' can be adjusted by altering xdelc, ydelc, xdelp, and
+! ydelp where the labels are about width/widthp wide and hgt/hgt tall.  the
+! c at the end of the variable represents 'current' and the p represents the
+! previous contour line.  cen is where the center of the label is and del is
+! the amount of space from the center that the label wants all to itself.  line
+! 860 was altered from the original contur.F.  it used to point to the call
+! symbel line below.
+860	continue
+	if (draftsman) then
+	  xcenc=(xst+xstp)*0.5
+	  ycenc=(yst+ystp)*0.5
+	  xdelc=width *0.5+hgt*0.15
+	  ydelc=hgt   *0.5+hgt*0.12
+	  xdelp=widthp*0.5+hgt*0.15
+	  ydelp=hgt   *0.5+hgt*0.12
+	  do 861 k1=1,nlabp
+	    xcenp=xlabp(k1)+widthp*0.5
+	    ycenp=ylabp(k1)+hgt*0.5
+	    if (((xcenc-xdelc).lt.(xcenp+xdelp)).and.
+     .	        ((xcenc+xdelc).gt.(xcenp-xdelp)).and.
+     .	        ((ycenc+ydelc).gt.(ycenp-ydelp)).and.
+     .	        ((ycenc-ydelc).lt.(ycenp+ydelp))) goto 900
+861	  continue
+	endif
+! TMAP mod, horz contour labels:
+! draw the label and reset stest to 0. which indicates that the label has
+! been drawn.  the next label should be dslab distance over.
+!860	call symbel(xlab,ylab,angle,hgt,nchar,str)	! original code (860)
+	call symbel(xlab,ylab,angle,hgt,nchar,str)
+	stest=0.
+! TMAP mod, horz contour labels:
+! this section of code stores the contour label locations for the current
+! contour line so they can be compared to the labels for the next contour line
+	if (draftsman) then
+	  nlabc=nlabc+1
+	  xlabc(nlabc)=xlab
+	  ylabc(nlabc)=ylab
+	endif
+c
+        IF (curvilinear .AND. .NOT.curvilinear) THEN
+	print *, 'IF (curvilinear .AND. .NOT.curvilinear) in contur.F'
+           x_curv(1)=(xendl-xoff)/xf
+           y_curv(1)=(yendl-yoff)/yf
+
+           CALL CURV_COORD(x_curv, y_curv, 1, 1.0, 1.0, status) ! xform the pts
+	   IF (curv_missing) GOTO 1000
+
+           xendl=x_curv(1)*xf + xoff
+           yendl=y_curv(1)*yf + yoff
+        ENDIF
+
+	call plotny(xendl,yendl,3,0)
+! TMAP mod, spline fit:
+! if spline_tension.ne.0 then you want to do a spline fit in the area
+! of the label.  otherwise (original spline), just draw a straight line 
+! between the 2 points and don't do the spline.  the original way of
+! doing this is pretty ugly.
+        if (spline_tension.eq.0.) then
+	  call plotny(x(kk),y(kk),2,lwgt)		! original code
+	  k=kk						! original code
+	  go to 920					! original code
+        else
+	  k=kk-1					! start of new code
+	  call arc(x(k-1),y(k-1),narc+1,.001,xc,yc,npt,
+     ,      k-1,kmax-1,x(2),y(2),splxp,splyp,spls,spline_tension)
+c
+	  dendl=(xendl-x(k))**2+(yendl-y(k))**2
+	  do 911 kk1 = 2,npt-1
+	    if (((xc(kk1)-x(k))**2+(yc(kk1)-y(k))**2).gt.dendl)
+     .        call plotny(xc(kk1),yc(kk1),2,lwgt)
+911	  continue
+	  call plotny(x(kk),y(kk),2,lwgt)
+	  k=k+1
+	  goto 920					! end of new code
+        endif
+c
+c     plot the segment from xk,yk to  x(k+1),y(k+1).
+c*******************************************************************************
+c
+! TMAP mod, spline fit:
+! call arc with the ability to call the spline fit.  pass lots more variables.
+900	call arc(x(k-1),y(k-1),narc+1,.001,xc,yc,npt,
+     ,      k-1,kmax-1,x(2),y(2),splxp,splyp,spls,spline_tension)
+c
+c check for lines crossing the branch cut in curvilinear grids. Pick up the pen.
+	IF (curvilinear) THEN
+	   kk1 = 2
+	   IF (ABS(x_curv(k+1)-x_curv(k)) .GT. 190) call plotny(xc(kk1),yc(kk1),3,lwgt)
+	ENDIF
+
+	do 910 kk1 = 2,npt
+910	call plotny(xc(kk1),yc(kk1),2,lwgt)
+	k=k+1
+920	if(k-kmax)755,1000,1000
+1000	continue
+1010	continue
+c
+1100	continue
+1200	if(colour.ne.colold)call color(colold)
+	return
+	end
+
diff --git a/ppl/plotlib/datpt.F b/ppl/plotlib/datpt.F
new file mode 100644
index 0000000..f5510d3
--- /dev/null
+++ b/ppl/plotlib/datpt.F
@@ -0,0 +1,108 @@
+	subroutine datapt(xlow,ylow,xhigh,yhigh,xlplot,ylplot, 
+     1	xhplot,yhplot,xp,yp,zp,npts,imark,forml,hgtlab) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)datpt.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c 
+c     this routine posts data points xp(k),yp(k),zp(k),k=1,npts 
+c     on a plot.  complot routines size,scale,tktype etc. should 
+c     have already been called. 
+c 
+c     xlow,ylow:   the lower left corner of the plot in user units 
+c     xhigh,yhigh: upper right corner in user units 
+c     xlplot,ylplot:lower left corner of plot in inches. 
+c     xhplot,yhplot:upper right corner of plot in inches. 
+c     xp:          array containing x coordinates of data pts. 
+c     yp:          array containing y coordinates. 
+c     zp:          array containing z coordinates (this value is posted) 
+c     npts:        number of data points to be posted. 
+c     imark:       mark type. see complot documentation. 
+c     forml:       format to be used for the data pt label. 
+c                  example: (f10.3). label can be up to 30 chars long. 
+c     hgtlab:      height of the label in inches. use 0.0 for no label. 
+c 
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	dimension xp(npts),yp(npts),zp(npts)
+	character label*81,forml*(*) 
+ 
+c     statement functions: 
+	xloc(a)=(a-xlow)*xfact+xlplot 
+	yloc(a)=(a-ylow)*yfact+ylplot 
+ 
+	xfact=(xhplot-xlplot)/(xhigh-xlow) 
+	yfact=(yhplot-ylplot)/(yhigh-ylow) 
+ 
+	do 500 jpt=1,npts 
+	xinch=xloc(xp(jpt)) 
+	yinch=yloc(yp(jpt)) 
+ 
+	if(imark.le.0)go to 100 
+	call plot(xinch,yinch,0,0) 
+	call mark(imark) 
+ 
+100	if(hgtlab.le.0.0)go to 500 
+	read(label,forml)zp(jpt)
+	nchar=lnblk(label,81)
+	width=symwid(hgtlab,nchar,label) 
+ 
+	ybias=0.08 
+c        if no mark is specified then center the label 
+c        on the data point: 
+	if(imark.le.0)ybias=-0.5*hgtlab 
+	if(yinch+ybias.le.ylplot)ybias=ylplot-yinch+0.08 
+	if(yinch+ybias+hgtlab.ge.yhplot)ybias=-hgtlab-0.08 
+ 
+	xbias=-0.5*width 
+	if(xinch+xbias.le.xlplot)xbias=xlplot-xinch+0.08 
+	if(xinch+xbias+width.ge.xhplot)xbias=xhplot-xinch-width-0.08 
+ 
+	call symbel(xinch+xbias,yinch+ybias,0.0,hgtlab,nchar,label) 
+ 
+500	continue 
+ 
+	return 
+	end 
diff --git a/ppl/plotlib/daywk1.F b/ppl/plotlib/daywk1.F
new file mode 100644
index 0000000..d74d7d7
--- /dev/null
+++ b/ppl/plotlib/daywk1.F
@@ -0,0 +1,71 @@
+	SUBROUTINE DAYWK1(ITIME,DAY)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)daywk1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER ITIME*(*),WEEK(8)*3,DAY*(*)
+      DATA WEEK/'SUN','MON','TUE','WED','THU','FRI','SAT','SUN'/         
+C                                                                        
+C     THIS FUNCTION RETURNS THE FIRST THREE LETTERS OF THE DAY OF        
+C     THE WEEK, GIVEN A TIME IN WOODSHOLE FORMAT.                        
+C     IE. (000101000000)=3HMON                                     
+C     ALGORITHM TAKEN FROM HP-19C/HP-29C APPLICATIONS BOOK.              
+C                                                                        
+C                                                                        
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN)                      
+      IYP=IYR+1899                                                       
+      IF(IMON.GT.2) IYP=IYR+1900                                         
+      IMP=IMON+13                                                        
+      IF(IMON.GT.2) IMP=IMON+1                                           
+      NDAY=IFIX(365.25*FLOAT(IYP))+IFIX(30.6001*FLOAT(IMP))+IDAY         
+      NDAY=MOD(NDAY+5,7)                                                 
+      DAY=WEEK(NDAY+1)                                                
+C     RECALL 1900 IS NOT A LEAP YAER.                                    
+      IF(ITIME.LT.'0003010000') DAY=WEEK(NDAY+2)                      
+      RETURN                                                             
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **                              
+      END                                                                
diff --git a/ppl/plotlib/delay.F b/ppl/plotlib/delay.F
new file mode 100644
index 0000000..4e843ae
--- /dev/null
+++ b/ppl/plotlib/delay.F
@@ -0,0 +1,80 @@
+      SUBROUTINE DELAY(ISEC) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)delay.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     SUBROUTINE TO DELAY EXECUTION BY APPROX ISEC OF REAL TIME 
+#ifdef unix
+	integer NULL
+#else
+	byte NULL
+#endif
+	CHARACTER ID*8
+	DATA NULL/0/
+      DIMENSION I(3) 
+      CALL TIME(ID) 
+
+#ifdef unix
+      read(unit=id,fmt=100) i
+#else
+      DECODE(9,100,ID)I 
+#endif
+
+100   FORMAT(I2,1X,I2,1X,I2) 
+      IST=I(1)*3600+I(2)*60+I(3) 
+10    DO 20 K=1,100 
+20    CALL CHOUT(NULL,1) 
+      CALL CHDMP 
+      CALL TIME(ID) 
+#ifdef unix
+      read(unit=id,fmt=100) i
+#else
+      DECODE(9,100,ID)I 
+#endif
+
+      ISP=I(1)*3600+I(2)*60+I(3) 
+      IF(ISP-IST.LT.ISEC)GOTO 10 
+      RETURN 
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 ** 
+      END 
diff --git a/ppl/plotlib/diff.F b/ppl/plotlib/diff.F
new file mode 100644
index 0000000..5d50fab
--- /dev/null
+++ b/ppl/plotlib/diff.F
@@ -0,0 +1,78 @@
+	FUNCTION DIFF(IT1,IT2)
+C** 
+C**    @(#)diff.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mod J Davison 11.20.95 for 4 digit year and seconds
+
+	CHARACTER*(*) IT1,IT2
+*  *kob*     - Need the below to stop OSF/Linux crashing of v5.4 - w/ pplldx envelopes
+*              and c/fortran argument passing, need exact length strings to 
+*              pass into whoi2bc
+*  *kob* 1/10/02 - for some reason, also need to explicitely only use first 14
+*                  chars of IT1, IT2.  This only showed up as a problem with Linux
+*                  linked statically, for some odd reason
+	CHARACTER*14 IT1_14, IT2_14
+	INTEGER*4 JDAY
+	REAL*8 DATE2, DATE1, WHOI2BC, RDATE
+	
+	IT1_14 = IT1(:14)
+	IT2_14 = IT2(:14)
+	RDATE = WHOI2BC(IT2_14) - WHOI2BC(IT1_14)
+	DIFF  = RDATE
+
+*       Original code
+*	CALL TIME3(IT1,IY1,IM1,ID1,IH1,IMN1,ISC1,ICN1)
+*	CALL TIME3(IT2,IY2,IM2,ID2,IH2,IMN2,ISC2,ICN2)
+*#ifdef unix
+*	DIFF=FLOAT(JDAY(IY2,IM2,ID2,IH2,IMN2,ISC2,ICN2)-
+*     * JDAY(IY1,IM1,ID1,IH1,IMN1,ISC1,ICN1))
+*#else
+*	DIFF=FLOATJ(JDAY(IY2,IM2,ID2,IH2,IMN2,ISC2,ICN2)-
+*     * JDAY(IY1,IM1,ID1,IH1,IMN1,ISC1,ICN1))
+*#endif
+
+	RETURN
+	END
diff --git a/ppl/plotlib/double.F b/ppl/plotlib/double.F
new file mode 100644
index 0000000..8624b95
--- /dev/null
+++ b/ppl/plotlib/double.F
@@ -0,0 +1,158 @@
+	subroutine double(z,nxs,nys,nx,ny) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)double.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     the array z(i,j) i=1,nx j=1,ny  is expanded to twice its size , 
+c     that is, z(i,j) i=1,2*nx-1,2  j=1,2*ny-1,2.  the spaces are filled 
+c     using cubic polynomial interpolation.  undefined points of z 
+c     should be set to 1.e35 . 
+c     oceanography emr   december 1969. 
+c 
+c 
+	dimension z(nxs,nys) 
+	dimension  zz(4) 
+c 
+	nxd = 2*nx-1 
+	nyd = 2*ny-1 
+	nxdm2 =nxd-2 
+	nydm2 =nyd-2 
+	big =.9e35 
+	big2 = big*2. 
+c     spread existing points 
+c 
+c*******************************************************************************
+c 
+	do 20 ii = 1,nx 
+	i= 1+nx-ii 
+	id= i*2-1 
+	do 20 jj = 1,ny 
+	j= 1+ny-jj 
+	jd = j*2-1 
+20	z(id,jd)=z(i,j) 
+c 
+c     fill in half-way points of x-lines. 
+c*******************************************************************************
+c 
+	do 90 i=1,nxdm2,2 
+	do 90 j=1,nyd,2 
+	z(i+1,j) = 1.e35 
+	if(z(i,j)+z(i+2,j)-big)30,90,90 
+30	zz(2)=z(i,j) 
+	zz(3)=z(i+2,j) 
+	zz(1)=1.e35 
+	if(i-1)50,50,40 
+40	zz(1)= z(i-2,j) 
+50	zz(4)=1.e35 
+	if(i-nxdm2)60,70,70 
+60	zz(4)=z(i+4,j) 
+70	call gethlf(zz,zzhalf)
+80	z(i+1,j) = zzhalf 
+90	continue 
+c 
+c     fill in half-way points of y-lines 
+c*******************************************************************************
+c 
+	do 190 j = 1,nydm2,2 
+	do 190 i = 1,nxd,2 
+	z(i,j+1)=1.e35 
+	if(z(i,j)+z(i,j+2)-big)130,190,190 
+130	zz(2)= z(i,j) 
+	zz(3)= z(i,j+2) 
+	zz(1)=1.e35 
+	if(j-1)150,150,140 
+140	zz(1)= z(i,j-2) 
+150	zz(4)= 1.e35 
+	if(j-nydm2)160,170,170 
+160	zz(4) = z(i,j+4) 
+170	call gethlf(zz,zzhalf)
+180	z(i,j+1)= zzhalf 
+190	continue 
+c 
+c     fill in center-point of each square 
+c*******************************************************************************
+c 
+	do 300 i = 1,nxdm2,2 
+	do 300 j = 1,nydm2,2 
+	z(i+1,j+1) = 1.e35 
+	zsum = z(i,j)+z(i+2,j)+z(i  ,j+2)+z(i+2,j+2) 
+	if(zsum-big)245,210,210 
+210	if(zsum-big2)220,300,300 
+220	if(z(i,j)+z(i+2,j+2)-big) 230,240,240 
+230	z(i+1,j+1)  = (z(i,j)+z(i+2,j+2))*.5 
+	go to 300 
+240	z(i+1,j+1)  = (z(i+2,j)+z(i,j+2))*.5 
+	go to 300 
+245	zz(2)=  z(i,j+1) 
+	zz(3)=  z(i+2,j+1) 
+	zz(1)=1.e35 
+	if(i-1) 260,260,250 
+250	zz(1)= z(i-2,j+1) 
+260	zz(4)=1.e35 
+	if(i-nxdm2)270,280,280 
+270	zz(4) =  z(i+4,j+1) 
+280	call gethlf(zz,zzhalf)
+290	z(i+1,j+1) = zzhalf 
+300	continue 
+	return 
+	end
+	subroutine gethlf(zz,zzhalf)
+	dimension zz(4)
+	big =.9e35 
+c 
+c     interpolation to get zz(2.5) . 
+c*******************************************************************************
+c 
+400	if(zz(1)+zz(4)-big)420,430,430 
+420	zzhalf = .5625*(zz(2)+zz(3)) -.0625*(zz(1)+zz(4)) 
+	go to 480 
+430	if(zz(1)-big)440,450,450 
+440	zzhalf = .375*zz(3) +.75*zz(2) -.125*zz(1) 
+	go to 480 
+450	if(zz(4)-big) 460,470,470 
+460	zzhalf=  .375*zz(2)+.75*zz(3)-.125*zz(4) 
+	go to 480 
+470	zzhalf = .5*(zz(2)+zz(3)) 
+480	return
+	end 
diff --git a/ppl/plotlib/frmt.F b/ppl/plotlib/frmt.F
new file mode 100644
index 0000000..d6dc09e
--- /dev/null
+++ b/ppl/plotlib/frmt.F
@@ -0,0 +1,132 @@
+      SUBROUTINE FRMT(XMIN,XMAX,IPRES,IF) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)frmt.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* V530 *sh* 11/00 - added extra digits for E formats with close-spaced
+*       range -- like [9080,1020]
+*      *sh* 12/00 -- further tweak to use E format less often
+* V541 *acm* 3/02 -- bug fix: For small negative numbers, if label is negative 
+*                    need one more decimal place (ib)
+* V600 *acm* 1/06   prevent values of LOG10(0.0)
+* V68  *acm* 12/11  fix ticket 1907: precision of labels where axis range is in (-1,1)
+* V685 *acm* 7/13  Ticket 1990: fixes for number of digits. More precision needed 
+*                 (Lavelle examples) 
+
+      CHARACTER*(*) IF 
+
+      INTEGER nt
+      REAL    scale, xhi, xlo, x1, x2, pow
+
+C     THIS SUBROUTINE CHOOSE THE FORMAT   NOT ANSI STANDARD 
+
+      xhi = xmax
+      xlo = xmin
+      scale = 0
+
+      DX=ABS(XMAX-XMIN)
+      IF(DX.EQ.0.)DX=ABS(XMAX)
+      IF(DX.EQ.0.)DX=10000.0 
+      XX=ABS(XMAX) 
+      IF(XX.LT.ABS(XMIN))XX=ABS(XMIN) 
+      IF(XX.GE.100000..OR.XX.LT..001)GOTO 100 
+
+C When the range lies between -1 and 1, and their order
+C of magnitudes are not the same, the method didnt give enough
+C precision. Make the computation on scaled numbers, and
+C adjust back when creating the format.  (bug 1907)
+
+      IF (ABS(xhi) .LT. 1. .AND. ABS(xlo) .LT. 1.) THEN
+         scale = 1.
+	 IF (xlo .EQ. 0.) xlo = xhi
+	 IF (xhi .EQ. 0.) xhi = xlo
+	 IF (xhi .EQ. 0.) THEN
+	    xhi = 1000.
+	    xlo = 1000.
+	 ENDIF
+         X1 = ABS(ALOG10(ABS(xhi)))
+         X2 = ABS(ALOG10(ABS(xlo)))
+	 nt = IFIX(MAX(x1,x2))
+	 pow = 10.0 ** nt
+	 xhi = pow*xhi
+	 xlo = pow*xlo
+      ENDIF
+
+      DX=ABS(xhi-xlo)
+      IF(DX.EQ.0.)DX=ABS(xhi)
+      IF(DX.EQ.0.)DX=10000.0 
+      XX=ABS(xhi) 
+      IF(XX.LT.ABS(xlo))XX=ABS(xlo) 
+      IF(XX.GE.100000..OR.XX.LT..001)GOTO 100 
+200   IP=ABS(IPRES) 
+      ID=IP-IFIX(ALOG10(DX)+.5) 
+      IF(ID.LT.0)ID=0 
+      IB=IFIX(ALOG10(XX*1.00001)) 
+      IF (xlo .LT. 0 ) ib = ib + 1
+      IF (scale .NE. 0) id = id + nt
+
+* If delta is small, we need more precision.
+      IF (DX.LT.0.1) THEN
+         NT = NINT(ABS(ALOG10(DX)) + 0.5)
+	 IF (NT .GE. ID) ID = NT + 1
+      ENDIF
+
+
+      WRITE(IF,999)IB+ID+3,ID 
+999   FORMAT('(F',I2,'.',I1,')')
+      RETURN 
+100   IF(IPRES.LT.0)GOTO 200 
+
+* increased digits for ranges like [9080,1020] - 11/00
+        IF (XX .NE. 0.) ip = MAX(ipres,
+     .       (IFIX(ALOG10(xx*1.00001)) +1) - IFIX(ALOG10(dx)) )
+        
+      ID=ip-1 
+      IF(ID.LT.0)ID=0 
+      WRITE(IF,998) ID+7,ID 
+998   FORMAT('(1PE',I2,'.',I1,')') 
+      RETURN 
+      END 
diff --git a/ppl/plotlib/getlev.F b/ppl/plotlib/getlev.F
new file mode 100644
index 0000000..ad295d2
--- /dev/null
+++ b/ppl/plotlib/getlev.F
@@ -0,0 +1,75 @@
+	subroutine getlev(z,nxs,nys,nx,ny,dz,zlev,nlev) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)getlev.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     given the array z(1...nx,1...ny) and the contour interval dz 
+c     the array zlev(1...nlev) of contour levels is returned. 
+c 
+	dimension z(nxs,nys) 
+	dimension zlev(2) 
+	big=.9e35 
+c 
+	nfnd=0 
+	do 100 i=1,nx 
+	do 100 j=1,ny 
+	if(z(i,j)-big)70,100,100 
+70	nfnd=nfnd+1 
+	if(nfnd-1)80,80,90 
+80	zmin=z(i,j) 
+	zmax=zmin 
+90	zmin=amin1(zmin,z(i,j)) 
+	zmax=amax1(zmax,z(i,j)) 
+100	continue 
+c 
+	nlmin=zmin/dz+.5+sign(.5,zmin) 
+	zlev(1)=dz*nlmin 
+	do 200 k=1,51 
+	zlevk=zlev(1)+(k-1)*dz 
+	if(zlevk-zmax)190,210,210 
+190	zlev(k)=zlevk 
+200	continue 
+210	nlev=k-1 
+	return 
+	end 
diff --git a/ppl/plotlib/habis.F b/ppl/plotlib/habis.F
new file mode 100644
index 0000000..e1dca71
--- /dev/null
+++ b/ppl/plotlib/habis.F
@@ -0,0 +1,88 @@
+      SUBROUTINE HABIS(IPLOT,IPAUSE,IHDCPY,IN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)habis.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+#ifdef unix
+	INCLUDE 'PLTCOM.DAT'
+	INCLUDE 'SYSTEM.INC'
+#else
+	include '[-.complot]pltcom.dat'
+	include 'cmdinc:system.inc'
+	byte in
+#endif
+	CHARACTER INS*1
+C
+C     THIS ROUTINE IS OUR ALTERNATIVE TO PLOTEND.
+C         IPLOT=XXXX0YYYY0Z
+C             XXXX=BAUD
+C             YYYY=TEK MODEL
+C             Z=ITYPE (PLOT TYPE)
+C         IPAUSE = 0 FOR NO PAUSE
+C                = 1 FOR A  PAUSE
+C         IHDCPY= 0 FOR NO HARDCOPY
+C                = 1 FOR A HARD COPY
+C
+	CALL ALPHAS
+	CALL PAGE
+	IF(IHDCPY.EQ.1) CALL HDCOPY(IPLOT)
+	IF(IPAUSE.EQ.1.AND.(PTYPE.EQ.1.OR.IABS(PTYPE).GE.2)) THEN
+	    CALL CHOUT(BEL,1)
+	    CALL CHOUT(BEL,1)
+	    CALL CHDMP
+	    IF(PTYPE.GE.3)THEN
+#ifdef unix
+		OPEN(99,FILE='/dev/tty',STATUS='UNKNOWN')
+#else
+		OPEN(99,FILE='TT:',STATUS='UNKNOWN')
+#endif
+ 99		READ(99,'(A1)',ERR=99,END=100)INS
+100		IN=ICHAR(INS)
+	    ELSE
+		CALL CHIN(IN,1,0)
+	    ENDIF
+	ENDIF
+	call clsdev(termf,sover)
+	RETURN
+	END
diff --git a/ppl/plotlib/hdcopy.F b/ppl/plotlib/hdcopy.F
new file mode 100644
index 0000000..666da02
--- /dev/null
+++ b/ppl/plotlib/hdcopy.F
@@ -0,0 +1,76 @@
+      SUBROUTINE HDCOPY
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)hdcopy.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     CALL HDCOPY
+C
+C     THIS SUBROUTINE ACTIVATES THE HARD-COPY ACCESSORY FOR THE
+C     TEKTERMINAL.
+C
+C
+#ifdef unix
+	INCLUDE 'PLTCOM.DAT'
+#else
+	include 'pltinc:pltcom.dat'
+#endif
+C
+C     ACTIVATE THE HARD-COPY ACCESSORY.
+C
+      CALL CHOUT(ESC,1)
+      CALL CHOUT(23,1)
+C
+C     TRANSMIT SYNC CHARACTERS WHILE THE HARD COPY IS PRODUCED.
+C
+      NDELAY = IFIX(10.0 * FLOAT(BAUDR / 10))
+      DO 10 J=1,NDELAY
+   10 CALL CHOUT(SYN,1)
+C
+C     WRITE OUT THE CHARACTER BUFFER.
+C
+      CALL CHDMP
+      RETURN
+C
+      END
diff --git a/ppl/plotlib/iday.F b/ppl/plotlib/iday.F
new file mode 100644
index 0000000..0223aac
--- /dev/null
+++ b/ppl/plotlib/iday.F
@@ -0,0 +1,56 @@
+      FUNCTION IDAY(IY,IM,ID) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)iday.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      IF(IM.GT.2)THEN 
+      YR=FLOAT(IY) 
+      XM=FLOAT(IM+1) 
+      ELSE 
+      YR=FLOAT(IY-1) 
+      XM=FLOAT(IM+13) 
+      END IF 
+      IDAY=INT(365.25*YR)+INT(30.6001*XM)+ID 
+      RETURN 
+      END 
diff --git a/ppl/plotlib/inside.F b/ppl/plotlib/inside.F
new file mode 100644
index 0000000..10edfb0
--- /dev/null
+++ b/ppl/plotlib/inside.F
@@ -0,0 +1,87 @@
+	subroutine inside(x,y,xb,yb,nb,ind) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)inside.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     given a point x,y and the series xb(k),yb(k) (k=1...nb) defining 
+c     vertices of a closed polygon.  ind is set to 1 if the point is in 
+c     the polygon and 0 if outside.  each time a new set of bound points 
+c     is introduced ind should be set to 999 on input. 
+c     it is best to do a series of y for a single fixed x. 
+c     method ... a count is made of the no. of times the boundary cuts 
+c     the meridian thru (x,y) south of (x,y).   an odd count indicates 
+c     the point is inside , even indicates outside. 
+c     see a long way from euclid by constance reid  p 174 . 
+c     oceanography emr   oct/69 
+c 
+	dimension xb(2),yb(2),yc(20) 
+	if(nb)10,10,20 
+10	ind=1 
+	return 
+20	if(ind-999)30,40,30 
+30	if(x-xprev)40,300,40 
+c 
+40	xprev=x 
+	nc=0 
+	do 200 k=1,nb 
+	kp1=k+1-k*(k/nb) 
+	kw=k 
+	if(xb(k)-xb(kp1))60,200,50 
+50	kw=kp1 
+60	ke=k+kp1-kw 
+	if(x-xb(ke))80,90,200 
+80	if(x-xb(kw))200,200,90 
+90	nc=nc+1 
+	slope=(yb(ke)-yb(kw))/(xb(ke)-xb(kw)) 
+	yc(nc)=yb(kw)+(x-xb(kw))*slope 
+200	continue 
+c 
+300	ind=0 
+	if(nc)340,340,310 
+310	do 330 k=1,nc 
+	if(yc(k)-y)320,330,330 
+320	ind=1-ind 
+330	continue 
+340	return 
+	end 
diff --git a/ppl/plotlib/itdiff.F b/ppl/plotlib/itdiff.F
new file mode 100644
index 0000000..7fd9baf
--- /dev/null
+++ b/ppl/plotlib/itdiff.F
@@ -0,0 +1,57 @@
+      INTEGER*4 FUNCTION ITDIFF(ITM1,ITM2) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)itdiff.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     THIS FUNCTION RETURNS THE DIFFERENCE IN DAYS AND MINUTES 
+C     BETWEEN ITM1 AND ITM2.  LAST 5 DIGITS IS THE SECOND COUNT 
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER*(*) ITM1,ITM2
+      CALL TIME3(ITM1,IY1,IMN1,ID1,IH1,IM1) 
+      CALL TIME3(ITM2,IY2,IMN2,ID2,IH2,IM2) 
+      ITDIFF=(IDAY(IY2,IMN2,ID2)-IDAY(IY1,IMN1,ID1))*10000+ 
+     *(IH2-IH1)*60+(IM2-IM1) 
+      RETURN 
+      END 
diff --git a/ppl/plotlib/jday.F b/ppl/plotlib/jday.F
new file mode 100644
index 0000000..e51c1f3
--- /dev/null
+++ b/ppl/plotlib/jday.F
@@ -0,0 +1,68 @@
+	INTEGER*4 FUNCTION JDAY(IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+C** 
+C**    @(#)jday.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mod J Davison 11.22.95 For 4 digit year
+
+*       Year to be calendar year - 1900, eg, 1880 = -20, 2001 = 101
+	IYCEN = IYR + (ICEN - 19)*100
+
+	IF(IMON.GT.2)THEN
+	   IM=IMON+1
+	   IY=IYCEN
+	ELSE
+	   IM=IMON+13
+	   IY=IYCEN-1
+	ENDIF
+#ifdef unix
+	JDAY=(INT(365.25*IY)+INT(30.6001*IM)+IDAY)*1440+
+     *	IHR*60+IMIN
+#else
+	JDAY=(JINT(365.25*IY)+JINT(30.6001*IM)+IDAY)*1440+
+     *	IHR*60+IMIN
+#endif
+	RETURN
+	END
diff --git a/ppl/plotlib/lenc.F b/ppl/plotlib/lenc.F
new file mode 100644
index 0000000..5aa307e
--- /dev/null
+++ b/ppl/plotlib/lenc.F
@@ -0,0 +1,57 @@
+	FUNCTION LENC(LAB,NC)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)lenc.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER LAB*(*)
+	DO 20 I=NC,1,-1
+	IF(LAB(I:I).NE.' ')GOTO 21
+20	CONTINUE
+	LENC=0
+	RETURN
+21	LENC=I
+	RETURN
+	END
diff --git a/ppl/plotlib/neftn5.F b/ppl/plotlib/neftn5.F
new file mode 100644
index 0000000..28d10ff
--- /dev/null
+++ b/ppl/plotlib/neftn5.F
@@ -0,0 +1,70 @@
+      SUBROUTINE NEFTN5(J,KM,IS) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)neftn5.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+      COMMON/CEFTN5/ IN,IA,LT,NAME,INTEMP
+      CHARACTER IN*80,IA*1,LT*1,NAME*81,INTEMP*80
+C 
+C 
+C     WRITTEN IN MAY, 1980 BY DON DENBO IT IS A FTN5 
+C     UTILITY ROUTINE FORM COMRD5. 
+C 
+C 
+	IS=5
+      J=J+1 
+      IF(J.GT.KM)RETURN  
+      IA=IN(J:J) 
+      IF(IA.EQ.LT)RETURN  
+	IS=3
+      IF(IA.EQ.',')RETURN  
+	IS=2
+      IF(IA.EQ.' ')RETURN  
+	IS=4
+      IF(IA.EQ.'/')RETURN  
+	IS=1
+      IF(IA.GE.'+'.AND.IA.LE.'9')RETURN  
+	IS=4
+      RETURN  
+      END 
diff --git a/ppl/plotlib/numcde.F b/ppl/plotlib/numcde.F
new file mode 100644
index 0000000..6c1efaf
--- /dev/null
+++ b/ppl/plotlib/numcde.F
@@ -0,0 +1,269 @@
+	SUBROUTINE NUMCDE(XZ,STR,NC,FRMTZ,DMS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]NUMCDE.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 2/13/89 - added MOD 360. to LONE formatting
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+* *acm* - 1/ 6/04 - For longitude axes, do not label 0 degrees with E
+*            (so they are now consistent with latitude axes)
+* V600: *acm* 11/05 add xdms,ydms for deg/min labels
+* V600: *acm* 5/06 Allow seconds in DMS axis labelling; had removed this.
+* V63  *acm* 10/09 Changes for gfortran build
+
+C**
+C**    @(#)numcde.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     ROUTINE ADDS LEADING ZEROS TO A NUMBER IF
+C     LESS THAN ONE AND IFRMT=('0'....
+C
+c  Modified so that if FRMTZ has ",'LAT')" or ",'LON')" as last non-blank
+c  characters, XZ will be assumed to be either latitude (+ for N, - for S)
+c  or longitude (+0 to +180 for W, +180 to +360 for E, ie, continuous across
+c  dateline) in EPIC format. FRMT and X will be modified so that axis labels
+c  will be of the form 165 E or 6 S, etc.
+c  NNS, Jun 85.
+c
+	CHARACTER*(*) FRMTZ
+	CHARACTER*20 FRMT,STR,TEMP,STR_DMS
+        INTEGER TM_LENSTR1, dms, imin, isec, dot, deg
+        REAL val, frac, minutes, seconds
+C
+	FRMT=FRMTZ
+	TEMP=FRMTZ
+	CALL UPPER(TEMP,20)
+	X=XZ
+	ILAT = INDEX (TEMP, ',''LAT'')')
+	IF (ILAT .NE. 0) THEN
+	  IF (X .LT. 0) THEN
+	    X=-X
+	    FRMT (ILAT+1:) = '''#S'')'
+	  ELSE IF (X .EQ. 0.) THEN
+	    FRMT (ILAT+1:) = '''#'')'
+	  ELSE
+	    FRMT (ILAT+1:) = '''#N'')'
+	  ENDIF
+	ELSE
+	  ILON = INDEX (TEMP, ',''LON'')') + INDEX (TEMP, ',''LONW'')')
+	  ILONE = INDEX (TEMP, ',''LONE'')')
+	  IF (ILON .NE. 0) THEN
+	    IF (X .GT. 180.) THEN
+	      X=360.-X
+	      FRMT (ILON+1:) = '''#E'')'
+	    ELSE IF (X .EQ. 180.) THEN
+	      FRMT (ILON+1:) = '''#'')'
+	    ELSE IF (X .LT. 0.) THEN
+	      FRMT (ILON+1:) = '''#E'')'
+	      X = -X
+	    ELSE
+	      FRMT (ILON+1:) = '''#W'')'
+	    ENDIF
+	  ELSE IF (ILONE .NE. 0)THEN
+* TMAP insert 2/13/89
+* Further fixes for X LE -180  1/18/2013
+
+	    X = MOD( X, 360. )
+* ... end of TMAP insert
+	    IF (X .GT.180.) THEN
+	      X=360.-X
+	      FRMT (ILONE+1:) = '''#W'')'
+	    ELSE IF (ABS(X) .EQ. 180.) THEN
+	      FRMT (ILONE+1:) = '''#'')'
+	      X = ABS(X)
+	    ELSE IF (X .LT. -180.) THEN
+	      FRMT (ILONE+1:) = '''#E'')'
+	      X = 360.+X
+	    ELSE IF (X .LT. 0.) THEN
+	      FRMT (ILONE+1:) = '''#W'')'
+	      X = -X
+	    ELSE IF (X .NE. 0.) THEN
+	      FRMT (ILONE+1:) = '''#E'')'
+            ELSE
+	      FRMT (ILONE+1:) = '''#'')'
+	    ENDIF
+	  ENDIF
+	ENDIF
+C
+	FLAG=0
+	IF(FRMT(1:2).EQ.'(I'.OR.FRMT(1:2).EQ.'(i')THEN
+	    WRITE(STR,FRMT)IFIX(X+SIGN(.5,X))
+	ELSE
+	    WRITE(STR,FRMT)X
+	END IF
+C     STRIP OFF LEADING ZERO AND SET FLAG
+	IF(FRMT(1:4).EQ.'(''0''')THEN
+	    TEMP=STR(2:20)
+	    STR=TEMP
+	    FLAG=1
+	END IF
+C     LEFT JUSTIFY STRING
+	NC=0
+100	IF(STR(1:1).EQ.' ')THEN
+	    TEMP=STR(2:20)
+	    STR=TEMP
+	    NC=NC+1
+	    IF(NC.LE.20)GOTO 100
+	END IF
+C     ADD LEADING ZERO
+	IF(FLAG.EQ.1.AND.ABS(X).LT.1.1)THEN
+	    IF(STR(1:1).EQ.'.')THEN
+		TEMP='0'
+		TEMP(2:)=STR(1:19)
+	    ENDIF
+	    IF(STR(1:2).EQ.'+.'.OR.STR(1:2).EQ.'-.')THEN
+		TEMP=STR(1:1)
+		TEMP(2:2)='0'
+		TEMP(3:)=STR(2:18)
+	    ENDIF
+	    STR=TEMP
+	END IF
+	NC=LNBLK(STR,20)
+
+* Reformat the value into deg,min,sec if requested.
+* This means moving the degree symbol after the degrees
+* and putting the direction (N,S,E,W) at the end
+* For longitudes larger than 180, format them as is and
+* translate to west longitude afterwards.
+ 
+        STR_DMS = ' '
+        IF (dms .GE. 1) THEN
+            
+           dot = INDEX(str,'.')
+           deg = INDEX(str,'#')
+           IF (dot .EQ. 0) dot = TM_LENSTR1(str) +1
+           val = xz
+           IF (xz .LT. 0) val = x
+
+           ideg = INT(val)
+           frac = val - FLOAT(ideg)
+           minutes = 60.*frac
+           imin = INT(minutes+0.1)  ! sun at least, turns 40 into 39 sometimes...
+           frac = minutes - FLOAT(imin)
+           seconds = 60.* frac
+           isec = INT(seconds+0.1)
+
+           IF (xz .GT. 180.) THEN
+              ideg = 360-ideg
+              imin = 60-imin
+           ENDIF
+
+           IF (dms .EQ. 2) THEN  ! write as deg,min,sec
+              IF (ideg .LT. 100) THEN
+                 WRITE (STR_DMS, 1100) ideg, imin, isec,
+     .               str(deg+1:deg+1)
+              ELSE
+                 WRITE (STR_DMS, 1101) ideg, imin, isec, 
+     .               str(deg+1:deg+1)
+              ENDIF
+1100          FORMAT (I2.2, '#', I2.2, '''', I2.2, '''', '''', A1)
+1101          FORMAT (I3.3, '#', I2.2, '''', I2.2, '''', '''', A1)
+
+           ELSE IF (dms .EQ. 1) THEN  ! break into deg,min
+              IF (ideg .LT. 100) THEN
+                 WRITE (STR_DMS, 1200) ideg, imin, 
+     .               str(deg+1:deg+1)
+              ELSE
+                 WRITE (STR_DMS, 1201) ideg, imin, 
+     .               str(deg+1:deg+1)
+              ENDIF
+1200          FORMAT (I2.2, '#', I2.2, '''', A1)
+1201          FORMAT (I3.3, '#', I2.2, '''', A1)
+
+           ELSE IF (dms .EQ. 3) THEN  ! write as deg,min.frac
+
+* get number of digits from the format given by the format that came into this routine.
+* seeing if it is Fn.m.  If M=0, use minutes only. If M=1, then use one digit for the 
+* fractional part of the mintues, otherwise write two digits. Round rather than truncating
+* for degrees and fractions.
+
+              dot = INDEX(frmtz,'.')
+              READ (frmtz(dot+1:dot+1), *) digits
+              IF (digits .EQ. 0) THEN   ! degrees, minutes only
+                 imin = INT(minutes+0.5)
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1300) ideg, imin,
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1301) ideg, imin, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1300             FORMAT (I2.2, '#', I2.2, '''', A1)
+1301             FORMAT (I3.3, '#', I2.2, '''', A1)
+              ELSE IF (digits .EQ. 1) THEN  ! degrees,min.f
+
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1400) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1401) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1400             FORMAT (I2.2, '#', F4.1, '''', A1)
+1401             FORMAT (I3.3, '#', F4.1, '''', A1)
+              ELSE                          ! degrees,min.ff
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1500) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1501) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1500             FORMAT (I2.2, '#', F5.2, '''', A1)
+1501             FORMAT (I3.3, '#', F5.2, '''', A1)
+              ENDIF
+
+           ELSE 
+              STR_DMS = str
+           ENDIF
+           str = STR_DMS
+           NC=LNBLK(STR,20)
+
+        ENDIF
+
+	RETURN
+	END
diff --git a/ppl/plotlib/numcde_off.F b/ppl/plotlib/numcde_off.F
new file mode 100644
index 0000000..725f552
--- /dev/null
+++ b/ppl/plotlib/numcde_off.F
@@ -0,0 +1,256 @@
+	SUBROUTINE NUMCDE_OFF(XZ,STR,NC,FRMTZ,DMS,OFF)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]NUMCDE.FOR
+
+C**
+C**    from numcde.f
+C 1/2006 acm Add an offset to the value before formatting it 
+C V600: *acm* 5/06 Allow seconds in DMS axis labelling; had removed this.
+* V63  *acm* 10/09 Changes for gfortran build
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+c
+	CHARACTER*(*) FRMTZ
+	CHARACTER*20 FRMT,STR,TEMP,STR_DMS
+        INTEGER TM_LENSTR1, dms, imin, isec, dot, deg
+        REAL frac, minutes, seconds, off
+        REAL*8 val, x
+C
+	FRMT=FRMTZ
+	TEMP=FRMTZ
+	CALL UPPER(TEMP,20)
+	X=XZ + off
+
+	ILAT = INDEX (TEMP, ',''LAT'')')
+	IF (ILAT .NE. 0) THEN
+	  IF (X .LT. 0) THEN
+	    X=-X
+	    FRMT (ILAT+1:) = '''#S'')'
+	  ELSE IF (X .EQ. 0.) THEN
+	    FRMT (ILAT+1:) = '''#'')'
+	  ELSE
+	    FRMT (ILAT+1:) = '''#N'')'
+	  ENDIF
+	ELSE
+	  ILON = INDEX (TEMP, ',''LON'')') + INDEX (TEMP, ',''LONW'')')
+	  ILONE = INDEX (TEMP, ',''LONE'')')
+	  IF (ILON .NE. 0) THEN
+	    IF (X .GT. 180.) THEN
+	      X=360.-X
+	      FRMT (ILON+1:) = '''#E'')'
+	    ELSE IF (X .EQ. 180.) THEN
+	      FRMT (ILON+1:) = '''#'')'
+	    ELSE IF (X .LT. 0.) THEN
+	      FRMT (ILON+1:) = '''#E'')'
+	      X = -X
+	    ELSE
+	      FRMT (ILON+1:) = '''#W'')'
+	    ENDIF
+	  ELSE IF (ILONE .NE. 0)THEN
+* TMAP insert 2/13/89
+* Further fixes for X LE -180  1/18/2013
+	    X = MOD( X, 360. )
+* ... end of TMAP insert
+	    IF (X .GT.180.) THEN
+	      X=360.-X
+	      FRMT (ILONE+1:) = '''#W'')'
+	    ELSE IF (ABS(X) .EQ. 180.) THEN
+	      FRMT (ILONE+1:) = '''#'')'
+	      X = ABS(X)
+	    ELSE IF (X .LT. -180.) THEN
+	      FRMT (ILONE+1:) = '''#E'')'
+	      X = 360.+X
+	    ELSE IF (X .LT. 0.) THEN
+	      FRMT (ILONE+1:) = '''#W'')'
+	      X = -X
+	    ELSE IF (X .NE. 0.) THEN
+	      FRMT (ILONE+1:) = '''#E'')'
+            ELSE
+	      FRMT (ILONE+1:) = '''#'')'
+	    ENDIF
+	  ENDIF
+	ENDIF
+C
+	FLAG=0
+	IF(FRMT(1:2).EQ.'(I'.OR.FRMT(1:2).EQ.'(i')THEN
+            xr = x
+	    WRITE(STR,FRMT)IFIX(XR+SIGN(.5,off))
+	ELSE
+	    WRITE(STR,FRMT)X
+	END IF
+C     STRIP OFF LEADING ZERO AND SET FLAG
+	IF(FRMT(1:4).EQ.'(''0''')THEN
+	    TEMP=STR(2:20)
+	    STR=TEMP
+	    FLAG=1
+	END IF
+C     LEFT JUSTIFY STRING
+	NC=0
+100	IF(STR(1:1).EQ.' ')THEN
+	    TEMP=STR(2:20)
+	    STR=TEMP
+	    NC=NC+1
+	    IF(NC.LE.20)GOTO 100
+	END IF
+C     ADD LEADING ZERO
+	IF(FLAG.EQ.1.AND.ABS(X).LT.1.1)THEN
+	    IF(STR(1:1).EQ.'.')THEN
+		TEMP='0'
+		TEMP(2:)=STR(1:19)
+	    ENDIF
+	    IF(STR(1:2).EQ.'+.'.OR.STR(1:2).EQ.'-.')THEN
+		TEMP=STR(1:1)
+		TEMP(2:2)='0'
+		TEMP(3:)=STR(2:18)
+	    ENDIF
+	    STR=TEMP
+	END IF
+	NC=LNBLK(STR,20)
+
+* Reformat the value into deg,min,sec if requested.
+* This means moving the degree symbol after the degrees
+* and putting the direction (N,S,E,W) at the end
+* For longitudes larger than 180, format them as is and
+* translate to west longitude afterwards.
+ 
+        STR_DMS = ' '
+        IF (dms .GE. 1) THEN
+            
+           dot = INDEX(str,'.')
+           deg = INDEX(str,'#')
+           IF (dot .EQ. 0) dot = TM_LENSTR1(str) +1
+           val = xz + off
+           IF (val .LT. 0) val = x
+
+           ideg = INT(val)
+           frac = val - FLOAT(ideg)
+           minutes = 60.*frac
+           imin = INT(minutes+0.1)  ! sun at least, turns 40 into 39 sometimes...
+           frac = minutes - FLOAT(imin)
+           seconds = 60.* frac
+           isec = INT(seconds+0.1)
+
+           IF (ideg .GT. 180.) THEN
+              ideg = 360-ideg
+              imin = 60-imin
+           ENDIF
+
+           IF (dms .EQ. 2) THEN  ! write as deg,min,sec
+              IF (ideg .LT. 100) THEN
+                 WRITE (STR_DMS, 1100) ideg, imin, isec,
+     .               str(deg+1:deg+1)
+              ELSE
+                 WRITE (STR_DMS, 1101) ideg, imin, isec, 
+     .               str(deg+1:deg+1)
+              ENDIF
+1100          FORMAT (I2.2, '#', I2.2, '''', I2.2, '''', '''', A1)
+1101          FORMAT (I3.3, '#', I2.2, '''', I2.2, '''', '''', A1)
+
+           ELSE IF (dms .EQ. 1) THEN  ! break into deg,min
+              IF (ideg .LT. 100) THEN
+                 WRITE (STR_DMS, 1200) ideg, imin, 
+     .               str(deg+1:deg+1)
+              ELSE
+                 WRITE (STR_DMS, 1201) ideg, imin, 
+     .               str(deg+1:deg+1)
+              ENDIF
+1200          FORMAT (I2.2, '#', I2.2, '''', A1)
+1201          FORMAT (I3.3, '#', I2.2, '''', A1)
+
+           ELSE IF (dms .EQ. 3) THEN  ! write as deg,min.frac
+
+* get number of digits from the format given by the format that came into this routine.
+* seeing if it is Fn.m.  If M=0, use minutes only. If M=1, then use one digit for the 
+* fractional part of the mintues, otherwise write two digits. Round rather than truncating
+* for degrees and fractions.
+
+              dot = INDEX(frmtz,'.')
+              READ (frmtz(dot+1:dot+1), *) digits
+              IF (digits .EQ. 0) THEN   ! degrees, minutes only
+                 imin = INT(minutes+0.5)
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1300) ideg, imin,
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1301) ideg, imin, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1300             FORMAT (I2.2, '#', I2.2, '''', A1)
+1301             FORMAT (I3.3, '#', I2.2, '''', A1)
+              ELSE IF (digits .EQ. 1) THEN  ! degrees,min.f
+
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1400) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1401) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1400             FORMAT (I2.2, '#', F4.1, '''', A1)
+1401             FORMAT (I3.3, '#', F4.1, '''', A1)
+              ELSE                          ! degrees,min.ff
+                 IF (ideg .LT. 100) THEN
+                    WRITE (STR_DMS, 1500) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ELSE
+                    WRITE (STR_DMS, 1501) ideg, minutes, 
+     .               str(deg+1:deg+1)
+                 ENDIF
+1500             FORMAT (I2.2, '#', F5.2, '''', A1)
+1501             FORMAT (I3.3, '#', F5.2, '''', A1)
+              ENDIF
+
+           ELSE 
+              STR_DMS = str
+           ENDIF
+           str = STR_DMS
+           NC=LNBLK(STR,20)
+
+        ENDIF
+
+	RETURN
+	END
diff --git a/ppl/plotlib/numdm1.F b/ppl/plotlib/numdm1.F
new file mode 100644
index 0000000..4329b54
--- /dev/null
+++ b/ppl/plotlib/numdm1.F
@@ -0,0 +1,111 @@
+      FUNCTION NUMDM1(IT) 
+C** 
+C**    @(#)numdm1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Mod J Davison 11.22.95 for 4 digit years
+* 	Mod J Davison  2.6.96  fix bug re 400 year biz
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+*       J Davison 10.20.99   Modified to support multiple calendars.
+*  *acm* 12/00 Change calendars to match NetCDF standard 
+*  V5.70 *acm* 5/2004 Include the century in year iy, to get correct
+*              evaluation of whether it is a leap year! (Bug 882)
+* V68  *acm* 6/12  changes for double-precision ferret, single-precision pplus
+
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+C     THIS FUNCTION RETURNS NO. OF DAYS IN CURRENT MONTH
+
+#ifdef double_p
+	real*8 yeardays
+#else
+	real yeardays
+#endif
+      CHARACTER*(*) it
+
+      call time3(it,iy,im,idd,ih,ix,isec,icen) 
+      iy = icen* 100 + iy
+
+      CALL tm_get_calendar_attributes (calendar_id, num_months, 
+     .                 num_days, yeardays, month_names, days_in_month, 
+     .                 days_before_month, month_by_day)
+
+******************************************************************************
+* HANDLE GREGORIAN CALENDAR FIRST
+******************************************************************************
+       if (calendar_id .eq. gregorian) then
+         numdm1 = days_in_month(im) 
+
+         if(im.eq.2.and.iy.eq.4*(iy/4)
+     .        .and.mod(iy,100).ne.0)  numdm1=29	! centuries are not leap yrs
+
+         if(im.eq.2.and.iy.eq.400*(iy/400)) 
+     .        numdm1=29         ! every 400 years is tho...
+      
+******************************************************************************
+* HANDLE JULIAN CALENDAR 
+******************************************************************************
+       else if (calendar_id .eq. julian) then
+         numdm1 = days_in_month(im) 
+
+         if(im.eq.2.and.iy.eq.4*(iy/4))  numdm1=29
+      
+******************************************************************************
+* ALL OTHER SUPPORTED AND REGULAR CALENDARS
+******************************************************************************
+       else if (calendar_id .gt. gregorian .and. 
+     .		calendar_id .le. max_calendars) then
+
+         numdm1 = days_in_month(im) 
+      else
+         stop 'Illegal calendar in numdm1()'
+      end if
+
+      return 
+      end 
diff --git a/ppl/plotlib/plotny.F b/ppl/plotlib/plotny.F
new file mode 100644
index 0000000..45d2484
--- /dev/null
+++ b/ppl/plotlib/plotny.F
@@ -0,0 +1,129 @@
+	subroutine plotny(xp,yp,ics,itype) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)plotny.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     plots a line from present point to point xb,yb (in inches) 
+c     ics=3 pen up 
+c        =2 pen down 
+c     itype=0 or 1 ordinary line 
+c          =2 heavy line 
+c          =3 dotted line 
+c     must be initialized by call to plotny with pen up. 
+c     oceanography/emr   december 1969. 
+c     dotted line routine improved july/74 
+c 
+	common/rotcon/xk,yk,snthta,csthta
+#ifdef unix
+	include 'DASHZZ.INC'
+#else
+	include 'pplinc:dashzz.inc'
+#endif
+c	data dashln/.02/ , spacln/.04/ , dslab/5.0/
+	totlng=dashln+spacln 
+	xb=xp*csthta-yp*snthta+xk
+	yb=yp*csthta+xp*snthta+yk
+	if(ics-3)5,10,5 
+5	if(itype-2)10,20,30 
+c 
+c     ordinary line   itype=0 or 1. 
+c 
+10	call plot(xb,yb,3-ics,0) 
+	go to 100 
+c 
+c     heavy line   itype=2 
+c 
+20	dx=xb-xa 
+	dy=yb-ya 
+	ds=sqrt(dx*dx+dy*dy)+.001 
+	dxd=dx*.01/ds 
+	dyd=dy*.01/ds 
+	call plot(xb,yb,1,0) 
+	call plot(xb+dyd,yb-dxd,1,0) 
+	call plot(xa+dyd,ya-dxd,1,0) 
+	call plot(xa-dyd,ya+dxd,1,0) 
+	call plot(xb-dyd,yb+dxd,1,0) 
+	call plot(xb,yb,1,0) 
+	go to 100 
+c 
+c     dotted line   itype=3 
+c 
+30	sx=xb-xa 
+	sy=yb-ya 
+	sabsq=sx**2+sy**2 
+	if(sabsq.eq.0.) go to 100 
+	sab=sqrt(sabsq) 
+	cose=sx/sab 
+	sine=sy/sab 
+	if(stlng.lt.dashln) go to 35 
+	x=xa-(stlng-dashln)*cose 
+	y=ya-(stlng-dashln)*sine 
+	go to 50 
+35	x=xa-stlng*cose 
+	y=ya-stlng*sine 
+40	x=x+dashln*cose 
+	y=y+dashln*sine 
+	ssq=(x-xa)**2+(y-ya)**2 
+	if(ssq.lt.sabsq) go to 45 
+	call plot(xb,yb,1,0) 
+	stlng=dashln-(sqrt(ssq)-sab) 
+	go to 100 
+45	call plot(x,y,1,0) 
+50	x=x+spacln*cose 
+	y=y+spacln*sine 
+	ssq=(x-xa)**2+(y-ya)**2 
+	if(ssq.lt.sabsq) go to 55 
+	call plot(xb,yb,0,0) 
+	stlng=totlng-(sqrt(ssq)-sab) 
+	go to 100 
+55	call plot(x,y,0,0) 
+	go to 40 
+c 
+c     save point a for next time 
+c 
+100	xa=xb 
+	ya=yb 
+	if(ics.eq.3) stlng=dashln/2.0 
+	return 
+	end 
diff --git a/ppl/plotlib/plott7.F b/ppl/plotlib/plott7.F
new file mode 100644
index 0000000..7a4bba0
--- /dev/null
+++ b/ppl/plotlib/plott7.F
@@ -0,0 +1,149 @@
+	SUBROUTINE PLOTT7(X,Y,XFACT,YFACT,MPEN,MARK) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)plott7.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C 
+C v6.3 *acm* Fix bug 1668: The thick tics disappear due to pixel aliasing
+C            on some long-time-axis plots. Instead use the thick line type
+C            for these tics.  
+C 
+C     THIS ROUTINE DRAWS A LINE FROM THE PEN'S CURRENT 
+C     POSITION AND THEN MAKES A MARK.  SEE PLOT ROUTINE IN 
+C     COMPLOT DOCUMENTATION.  THIS SUBROUTINE IS THE SAME 
+C     AS PLOT EXCEPT THAT SOME OF THE MARKS HAVE BEEN 
+C     IMPROVED AND WE NEED TO SPECIFY XFACT AND YFACT. 
+C 
+C     THE MARKS, MARK=-3,-4,-5,-6,-7,-8 ARE ENLARGEMENTS OF THE 
+C     MARKS, MARK=3,4,5,6,7,8. 
+C 
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        INCLUDE 'pen_inc.decl'  ! with num_line_colors
+        INCLUDE 'PEN.INC'
+        include 'tics_inc.decl'
+	include 'TICS.INC'
+
+	integer ithick
+
+	ithick = num_line_colors + 1
+
+	CALL PLOT(X,Y,MPEN,0) 
+	CALL VECTRS 
+	MMARK=-MARK 
+	TY=TLY
+	TX=TLX
+	GO TO(100,100,100,100,500,600,700,800,900,1100),MMARK 
+100	STOP 'MARK' 
+C     TO DRAW HORIZONAL TIC OF LENGTH 0.125 AT (X,Y). 
+500	TY=TSMY
+C     TO DRAW HORIZONAL TIC OF LENGTH 0.25 AT (X,Y). 
+600	IF(IY.NE.0)THEN 
+	    CALL PLOT(X+IY*TY*.5/XFACT,Y,MPEN,0) 
+	ELSE 
+	    CALL PLOT(X-TY*.5/XFACT,Y,MPEN,0) 
+	    CALL PLOT(X+TY*.5/XFACT,Y,MPEN,0) 
+	END IF 
+	GOTO 1000
+C 
+C     TO DRAW VERTICAL TIC OF LENGTH 0.125 AT (X,Y). 
+700	TX=TSMX
+C     TO DRAW VERTICAL TIC OF LENGTH 0.25 AT (X,Y). 
+800	IF(IX.NE.0)THEN 
+	    CALL PLOT(X,Y+IX*TX*.5/YFACT,MPEN,0) 
+	ELSE 
+	    CALL PLOT(X,Y-TX*.5/YFACT,MPEN,0) 
+	    CALL PLOT(X,Y+TX*.5/YFACT,MPEN,0) 
+	END IF 
+	GOTO 1000
+C	TO DRAW TRIPLE THICK LARGE X TIC
+900	DX=0.005/XFACT
+        DX = 0.
+	DY=TX*0.5/YFACT
+	CALL COLOR(ithick)
+	IF(IX.NE.0)THEN
+	    CALL PLOT(X,Y+IX*DY,IPEN,0)
+	    CALL PLOT(X-DX,Y+IX*DY,IPEN,0)
+	    CALL PLOT(X-DX,Y,IPEN,0)
+	    CALL PLOT(X+DX,Y,IPEN,0)
+	    CALL PLOT(X+DX,Y+IX*DY,IPEN,0)
+	    CALL PLOT(X,Y+IX*DY,IPEN,0)
+	ELSE
+	    CALL PLOT(X,Y-DY,IPEN,0)
+	    CALL PLOT(X-DX,Y-DY,IPEN,0)
+	    CALL PLOT(X-DX,Y+DY,IPEN,0)
+	    CALL PLOT(X+DX,Y+DY,IPEN,0)
+	    CALL PLOT(X+DX,Y-DY,IPEN,0)
+	    CALL PLOT(X,Y-DY,IPEN,0)
+	    CALL PLOT(X,Y+DY,IPEN,0)
+	ENDIF
+	CALL COLOR(1)
+	GOTO 1000
+C	TO DRAW TRIPLE THICK LARGE Y TIC
+1100	DY=0.005/YFACT
+        DY = 0.
+	DX=TY*0.5/XFACT
+	CALL COLOR(ithick)
+	IF(IY.NE.0)THEN
+	    CALL PLOT(X+IY*DX,Y,IPEN,0)
+	    CALL PLOT(X+IY*DX,Y-DY,IPEN,0)
+	    CALL PLOT(X,Y-DY,IPEN,0)
+	    CALL PLOT(X,Y+DY,IPEN,0)
+	    CALL PLOT(X+IY*DX,Y+DY,IPEN,0)
+	    CALL PLOT(X+IY*DX,Y,IPEN,0)
+	ELSE
+	    CALL PLOT(X-DX,Y,IPEN,0)
+	    CALL PLOT(X-DX,Y-DY,IPEN,0)
+	    CALL PLOT(X+DX,Y-DY,IPEN,0)
+	    CALL PLOT(X+DX,Y+DY,IPEN,0)
+	    CALL PLOT(X-DX,Y+DY,IPEN,0)
+	    CALL PLOT(X-DX,Y,IPEN,0)
+	    CALL PLOT(X+DX,Y,IPEN,0)
+	ENDIF
+	CALL COLOR(1)
+1000	CALL PLOT(X,Y,IPEN,0) 
+	RETURN 
+	END 
diff --git a/ppl/plotlib/reset_labsiz.F b/ppl/plotlib/reset_labsiz.F
new file mode 100644
index 0000000..d2802e9
--- /dev/null
+++ b/ppl/plotlib/reset_labsiz.F
@@ -0,0 +1,91 @@
+
+        SUBROUTINE RESET_LABSIZ (ywid, ywidt, abssz, noylab)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* 11/2011 ACM Fixing ticket 1896:
+*
+* Use origin and label-size info that is in common to possibly
+* reset the axis-label size for a vertical axis, so the labels dont
+* run off the edge.
+
+* 5/12  Fix the way the size is rescaled.
+*       Issue a note when the label size is reset.
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	REAL ywid, ywidt, abssz
+	LOGICAL noylab
+
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'
+
+	REAL xl, frac, dhylab
+	CHARACTER*100 note
+	CHARACTER*120 argsym
+	INTEGER i1, i2, len
+
+* This is irrelevant if there is no margin anyway (viewport defined with /AXES
+* up against the edge of the page.)
+	IF (xorg .LT. 1.e-6) RETURN
+
+        dhylab = 2.5*hylab
+	IF (noylab) dhylab = 0.
+        xl = xorg-(ywid+ywidt+dhylab)
+        IF (xl.LT.0) THEN
+	   frac = xorg/(ywid+ywidt+dhylab)
+
+	   IF (frac .LT. 0) frac = 0.5  ! margin is too small for this method. Punt.
+	   WRITE (note, 100) abssz, abssz* frac
+	   CALL WARN (note)
+	   abssz = abssz* frac
+
+	i1 = 1
+	i2 = 1
+ 1710   CALL LSTSYM(argsym,note,len,i1,i2)	! get next symbol
+	IF(i2.EQ.0)THEN
+           IF(argsym(:12) .EQ. 'LAST_GO_FILE')THEN
+	      CALL WARN (note)
+	   ELSE
+              GOTO 1710
+	   ENDIF
+	      CALL LSTSYM(argsym,note,len,i1,i2) 
+	   ENDIF
+	ENDIF
+
+ 100	FORMAT ('Adjusting Y-axis label size from ', f5.3, ' to ', f5.3, 
+     .          ', to avoid running off page. ')
+	RETURN
+	END
diff --git a/ppl/plotlib/scinot.F b/ppl/plotlib/scinot.F
new file mode 100644
index 0000000..d1791f6
--- /dev/null
+++ b/ppl/plotlib/scinot.F
@@ -0,0 +1,145 @@
+	SUBROUTINE SCINOT(X,Y,DEG,CSZE,NCHR,STR,ITYPE,WID,XF,YF)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)scinot.f	1.2    6/13/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port
+C *acm* 11/05    Changes for deg-min-sec labelling. for these long
+C                labels make the character size a bit smaller.
+        REAL charsize
+	CHARACTER STR*(*),ITMP*20,ITMP2*10,SUB*20,IC*1
+	character ESTR*1,MESTR*2,lestr*1,lmestr*2
+	data lestr,lmestr/'e','-e'/
+	DATA ESTR,MESTR/'E','-E'/
+c
+        charsize = CSZE
+	IF(NCHR.GT.20)RETURN
+	ITMP=' '
+	ITMP2=' '
+	SUB=' '
+	NS=0
+	L=0
+	J=1
+	NE=0
+	DO 10 NM=1,20
+	IF(NM.GT.NCHR)GOTO 100
+	IC=STR(NM:NM)
+	IF(IC.EQ.' '.AND.J.EQ.1)GOTO 10
+	IF(IC.EQ.estr.or.ic.eq.lestr.OR.IC.EQ.' ')GOTO 100
+	IF(IC.EQ.'+'.OR.IC.EQ.'-')THEN
+		IF(J.NE.1)THEN
+			GOTO 100
+		ELSE
+			GOTO 20
+		ENDIF
+	ENDIF
+	IF((IC.LT.'0'.OR.IC.GT.'9').AND.IC.NE.'.')THEN
+		SUB=STR(NM:)
+		NC=J-1
+		NS=LNBLK(SUB,20)
+		GOTO 1000
+	ENDIF
+20	ITMP(J:J)=IC
+	J=J+1
+10	CONTINUE
+100	IF(IC.EQ.' '.OR.NM.GT.NCHR)GOTO 200
+	NE=2
+	IF(STR(1:1).NE.estr.AND.STR(1:2).NE.mestr
+     *	.and.str(1:1).ne.lestr.and.str(1:2).ne.lmestr)THEN
+	ITMP(J:J+1)=' x'
+	J=J+2
+	ENDIF
+200	NC=J-1
+	IF(NE.EQ.0)GOTO 1000
+	IF(IC.EQ.estr.or.ic.eq.lestr)NM=NM+1
+	IS=0
+	DO 60 K=NM,20
+	IF(K.GT.NCHR)GOTO 300
+	IC=STR(K:K)
+	IF(IC.EQ.' ')GOTO 60
+	IF(IC.EQ.'+')GOTO 60
+	IF(IC.EQ.'0'.AND.L+IS.EQ.0)GOTO 60
+	IF((IC.LT.'0'.OR.IC.GT.'9').AND.IC.NE.'-')THEN
+		SUB=STR(K:)
+		NS=LNBLK(SUB,20)
+		GOTO 300
+	ENDIF
+	IF(IC.EQ.'-')IS=-1
+	L=L+1
+	ITMP2(L:L)=IC
+60	CONTINUE
+300	IF(L.NE.0)GOTO 1000
+	L=1
+	ITMP2='0'
+1000  IF (ns .GT. 6) charsize = 0.9* charsize
+      C=COS(DEG*1.7453292E-2) 
+      S=SIN(DEG*1.7453292E-2) 
+      WID2=SYMWID(charsize,NE,'10') 
+      WID1=SYMWID(charsize,NC,ITMP)+WID2 
+      WID3=WID1+SYMWID(charsize*.75,L,ITMP2) 
+      WID=WID3+SYMWID(charsize,NS,SUB)
+      IF(ITYPE.EQ.3)RETURN 
+      GO TO (1,2,3)ITYPE+1 
+1     XL=X-WID*C*.5/XF+charsize*.5*S/XF 
+      YL=Y-WID*S*.5/YF-charsize*.5*C/YF 
+      GOTO 400 
+2     XL=X-WID*C/XF+charsize*.5*S/XF 
+      YL=Y-WID*S/YF-charsize*.5*C/YF 
+      GOTO 400 
+3     XL=X+charsize*.5*S/XF 
+      YL=Y-charsize*.5*C/YF 
+400   CALL SYMBEL(XL,YL,DEG,charsize,NC,ITMP) 
+	IF(NE.NE.0)THEN
+      CALL SYMBEL(XL+(WID1-WID2)*C/XF,YL+(WID1-WID2)*S/YF, 
+     *DEG,charsize,NE,'10') 
+      XLT=XL+WID1*C/XF-charsize*.625*S/XF 
+      YLT=YL+WID1*S/YF+charsize*.625*C/YF 
+      CALL SYMBEL(XLT,YLT,DEG,charsize*.75,L,ITMP2) 
+	ENDIF
+	XL=XL+WID3*C/XF
+	YL=YL+WID3*S/YF
+	CALL SYMBEL(XL,YL,DEG,charsize,NS,SUB)
+      RETURN 
+      END 
diff --git a/ppl/plotlib/smooth.F b/ppl/plotlib/smooth.F
new file mode 100644
index 0000000..7c75fd0
--- /dev/null
+++ b/ppl/plotlib/smooth.F
@@ -0,0 +1,81 @@
+	subroutine smooth(z,nxs,nys,nx,ny,nsm) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)smooth.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     given array z(i,j),i=1,nx , j=1,ny   and nsm=0,1,2,3 ... 
+c     laplacian smoothing is applied to z nsm times by means of the 
+c     operation z=z + .25*(av(zn,zs,ze,zw)-z) . 
+c     the sweep is alternately sw to ne and ne to sw. 
+c     zxx and zyy are assumed to be zero at edges 
+c     unused points in z should be .ge. 10**35 . 
+c     oceanography emr   oct/69   version no. 2  improved edging 
+c 
+	dimension z(nxs,nys)
+	if(nsm)400,400,20 
+20	big=.9e35 
+	r=.25/4. 
+	do 330 it=1,nsm 
+	itodd=it-(it/2)*2 
+	do 300 ii=1,nx 
+	i=itodd*ii+(1-itodd)*(nx+1-ii) 
+	iintp=(i-1)*(nx-i) 
+	do 300 jj=1,ny 
+	j=itodd*jj+(1-itodd)*(ny+1-jj) 
+	zij=z(i,j) 
+	if(zij-big)210,210,300 
+210	del2=0. 
+	if(iintp)230,230,215 
+215	del2x=z(i-1,j)+z(i+1,j)-zij-zij 
+	if(del2x-big)220,230,230 
+220	del2=del2x 
+230	if((j-1)*(ny-j))250,250,235 
+235	del2y=z(i,j-1)+z(i,j+1)-zij-zij 
+	if(del2y-big)240,250,250 
+240	del2=del2+del2y 
+250	z(i,j)=zij+del2*r 
+300	continue 
+330	continue 
+400	return 
+	end 
diff --git a/ppl/plotlib/smx1.F b/ppl/plotlib/smx1.F
new file mode 100644
index 0000000..34b56cf
--- /dev/null
+++ b/ppl/plotlib/smx1.F
@@ -0,0 +1,96 @@
+      SUBROUTINE SMX1(X,XHI,XTIC,NSMTCX,XFACT,YFACT,Y,
+     .                yacross,vgrat,vcolor,vline) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)smx1.f	1.1    3/10/88
+C**
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks:
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C 
+C     THIS SUBROUTINE PLOTS THE SMALL XTICS ON THE X AXIS. 
+C     IT DIFFERS FROM SMX IN THAT THE TICS ARE BIGGER. 
+C 
+
+        REAL yacross, dash1, dash2,dash3,dash4   ! for drawing the tic all the way across the plot
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid          ! solid lines across at tics
+        LOGICAL dashed         ! dashed lines across at tics
+
+        solid = (vgrat(1,2).LT.0 .AND. vgrat(2,2).LT.0 .AND.  
+     .            vgrat(3,2).LT.0 .AND.  vgrat(4,2).LT.0 )
+        dashed = (vgrat(1,2).GT.0 .OR. vgrat(2,2).GT.0 .OR.  
+     .            vgrat(3,2).GT.0 .OR.  vgrat(4,2).GT.0 )
+        IF (dashed) THEN
+           dash1 = vgrat(1,2)
+           dash2 = vgrat(2,2)
+           dash3 = vgrat(3,2)
+           dash4 = vgrat(4,2)
+        ENDIF
+
+      IF(NSMTCX.LT.1) RETURN 
+      SMTIC=XTIC/FLOAT(NSMTCX+1) 
+      DO 10 I=1,NSMTCX 
+          XTEMP=X+FLOAT(I)*SMTIC 
+          IF((XHI-XTEMP)/XTIC.GE.0) THEN
+             CALL PLOTT7(XTEMP,Y,XFACT,YFACT,1,-7) 
+
+             IF ((solid.OR.dashed) .AND. vline) THEN ! make line across
+                CALL COLOR(vcolor(2))
+                IF (dashed) THEN
+                   CALL DASHSZ(dash1,dash2,dash3,dash4)
+                   CALL DASHES
+                ENDIF
+                CALL PLOT(xtemp,Y,0,0) 
+                CALL PLOT(xtemp,yacross,1,0)
+                CALL PLOT(xtemp,Y,0,0) 
+                CALL COLOR(1)
+                CALL VECTRS
+             ENDIF
+          ENDIF
+
+   10 CONTINUE 
+      RETURN 
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 ** 
+      END 
diff --git a/ppl/plotlib/smy1.F b/ppl/plotlib/smy1.F
new file mode 100644
index 0000000..3c92d86
--- /dev/null
+++ b/ppl/plotlib/smy1.F
@@ -0,0 +1,98 @@
+      SUBROUTINE SMY1(X,XFACT,YFACT,Y,YHI,YTIC,NSMTCY,
+     .       xacross,hgrat,hcolor,hline) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)smy1.f	1.1    3/10/88
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks:
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C 
+C     THIS SUBROUTINE PLOTS THE SMALL YTICS ON THE Y AXIS. 
+C     THIS DIFERS FROM SMY IN THAT THE TICS ARE LARGER. 
+C 
+
+c arguments for making lines across the plot at tic marks.
+
+        REAL xacross, dash1, dash2, dash3, dash4  ! for drawing the tic all the way across the plot
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid          ! solid lines across at tics
+        LOGICAL dashed         ! dashed lines across at tics
+
+        solid = (hgrat(1,2).LT.0 .AND. hgrat(2,2).LT.0 .AND.  
+     .            hgrat(3,2).LT.0 .AND.  hgrat(4,2).LT.0 )
+        dashed = (hgrat(1,2).GT.0 .OR. hgrat(2,2).GT.0 .OR.  
+     .            hgrat(3,2).GT.0 .OR.  hgrat(4,2).GT.0 )
+        IF (dashed) THEN
+           dash1 = hgrat(1,2)
+           dash2 = hgrat(2,2)
+           dash3 = hgrat(3,2)
+           dash4 = hgrat(4,2)
+        ENDIF
+
+      IF(NSMTCY.LT.1) RETURN 
+      SMTIC=YTIC/FLOAT(NSMTCY+1) 
+      DO 10 I=1,NSMTCY 
+          YTEMP=Y+FLOAT(I)*SMTIC 
+          IF((YHI-YTEMP)/YTIC.GE.0) THEN
+             CALL PLOTT7(X,YTEMP,XFACT, YFACT,1,-5) 
+     
+             IF ((solid.OR.dashed) .AND. hline) THEN ! make line across
+                CALL COLOR(hcolor(2))
+                IF (dashed) THEN
+                   CALL DASHSZ(dash1,dash2,dash3,dash4)
+                   CALL DASHES
+                ENDIF
+                CALL PLOT(X,ytemp,0,0) 
+                CALL PLOT(xacross,ytemp,1,0)
+                CALL PLOT(X,ytemp,0,0) 
+                CALL COLOR(1)
+                CALL VECTRS
+             ENDIF
+          ENDIF
+
+   10     CONTINUE 
+      RETURN 
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 ** 
+      END 
diff --git a/ppl/plotlib/surf.F b/ppl/plotlib/surf.F
new file mode 100644
index 0000000..9605881
--- /dev/null
+++ b/ppl/plotlib/surf.F
@@ -0,0 +1,704 @@
+      SUBROUTINE SURF(V,A,XMIN,XMAX,M,YMIN,YMAX,N,ZMIN,ZMAX,
+     1DX,DY,DZ)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]SURF.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+C**
+C**    @(#)surf.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C SURF IS A FRONT END ROUTINE FOR SURFCE TO EVALUATE A FUNCTION
+C OF TWO VARIABLES AND STORE THE RESULTS IN AN ARRAY TO PASS TO
+C SURFCE.  THE CALLING STRING IS:
+C V    - THE FUNCTION NAME--MUST BE A FUNCTION OF (X,Y)
+C A    - A SINGLE DIMENSIONED ARRAY OF LENGTH M*N
+C XMIN - MINIMUM VALUE OF X.
+C XMAX - MAXIMUM VALUE OF X.
+C M    - THE NUMBER OF X VALUES I.E. THE NUMBER OF ROWS.
+C YMIN - MINIMUM VALUE OF Y.
+C YMAX - MAXIMUM VALUE OF Y.
+C N    - THE NUMBER OF Y VALUES I.E. THE NUMBER OF COLUMNS.
+C ZMIN - MINIMUM VALUE OF Z
+C ZMAX - THE MAXIMUM VALUE OF Z
+C DX   - THE X COORDINATE OF THE VIEW POINT.
+C DY   - THE Y COORDINATE OF THE VIEW POINT.
+C DZ   - THE Z COORDINATE OF THE VIEW POINT.
+C
+C THE FUNCTION IS EVALUATED AND STORED IN THE ARRAY A COLUMNWISE
+C WITH THE FIRST LOCATION FILLED WITH F(XMIN,YMIN).  THE X VALUE INCREAS
+C GOING DOWN A COLUMN AND THE Y VALUE INCREASES GOING ACROSS A ROW.
+	external v
+      DIMENSION A(1)
+
+* Mod to specify external references for SCALE and RANGE * Linux *jd* 12.96
+	external scale, size
+
+
+      DLTAX=(XMAX-XMIN)/(M-1)
+      DLTAY=(YMAX-YMIN)/(N-1)
+      Y=YMIN
+      IDX=1
+      DO 20 J=1,N
+      X=XMIN
+      DO 10 I=1,M
+      A(IDX)=V(X,Y)
+      IDX=IDX+1
+      X=X+DLTAX
+   10 CONTINUE
+      Y=Y+DLTAY
+   20 CONTINUE
+      CALL SURFCE(A,XMIN,XMAX,M,YMIN,YMAX,N,ZMIN,ZMAX,
+     1DX,DY,DZ)
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+      SUBROUTINE SURFCE(F,XMIN,XMAX,M,YMIN,YMAX,N,
+     1ZM,ZMX,DX,DY,DZ)
+C SURFCE WILL PRODUCE A PERSPECTIVE DRAWING OF A FUNCTION OF
+C 2 VARIABLES.  THE CALLING PARAMETERS ARE:
+C
+C  F   - A TWO DIMENSIONAL ARRAY OF DATA POINTS
+C      - IT IS ASSUMED THAT THERE WILL BE M ROWS
+C      - AND N COLUMNS.  IT IS ASSUMMED THAT THE ARRAY IS SET UP
+C      - COLUMNWISE WITH F(1) CORRESPONDING TO FUN(XMIN,YMIN).
+C      - THE COLUMNS MUST GO IN INCREASING X VALUES GOING DOWN
+C      - AND INCREASING Y VALUES GOING ACROSS.
+C  XM  - THE MINIMUM X VALUE
+C  XMX - THE MAXIMUM X VALUE
+C  M   - THE NUMBER OF INTERVALS IN THE X DIRECTION
+C  YM  - THE MINIMUM Y VALUE
+C  YMX - THE MAXIMUM Y VALUE
+C  N   - THE NUMBER OF INTERVALS IN THE Y DIRECTION
+C  ZM  - THE MINIMUM Z VALUE
+C  ZMX - THE MAXIMUM Z VALUE
+C  DX  - THE X COORDINATE OF THE VIEW POINT
+C  DY  - THE Y COORDINATE OF THE VIEW POINT
+C  DZ  - THE Z COORDINATE OF THE VIEW POINT
+C
+C  THE LABELED COMMON BLOCK USED IS FOR COMMUNICATION
+C BETWEEN THE SUBROUTINES HIDE, TRANSF, AND INTERCEPT
+C NONE OF THE VARIABLES NEED TO BE INITIALIZED BY
+C THE CALLING PROGRAM.
+C THIS SET OF SUBROUTINES WAS WRITTEN AT O.S.U. 10-1972
+C BY JEFF BALLANCE.  THE FORMULAS WERE GOTTEN FROM THE REFERENCE:
+C
+C ^THE PERSPECTIVE REPRESENTATION OF FUNCTIONS OF TWO VARIABLES,^
+C J.ACM (VOL. 15, NO. 2) APRIL 1968. PP. 193-204.
+      DIMENSION F(1)
+#ifdef unix
+	include 'plt_inc.decl'
+	include 'PLT.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+#else
+	INCLUDE 'TMAP_PPLV11INC:PLT_INC.DECL'
+	INCLUDE 'PPLV11INC:PLT.INC'
+	INCLUDE 'TMAP_PPLV11INC:MISS_INC.DECL'
+	INCLUDE 'PPLV11INC:MISS.INC'
+	INCLUDE 'TMAP_PPLV11INC:AXIS_INC.DECL'
+	INCLUDE 'PPLV11INC:AXIS.INC'
+#endif
+	LOGICAL SKIP
+      COMMON /LAB1/ CX,CY,CZ,QX,QY,QZ,DCQ,CALPHA,CBETA,CGAMMA,
+     1DSAOB,IFLG,XTEST,YTEST,ZTEST,DLTAX1,DLTAY1,DLTAX,DLTAY
+     2,ZMIN,ZMAX,XM,YM,DLTAXI,DLTAYI,MM,NN
+
+* TMAP interrupt flag
+#ifdef unix
+	include 'xinterrupt.cmn'
+#else
+	INCLUDE 'tmap_pplv11inc:tmap_xinterrupt.cmn'
+#endif
+
+* Mod to specify external references for SCALE and RANGE * Linux *jd* 12.96
+	external scale, size
+
+C  INITIALIZE SOME THINGS IN THE COMMON BLOCK
+      CX=DX
+      CY=DY
+      CZ=DZ
+      ZMIN=ZM
+      ZMAX=ZMX
+      XM=XMIN
+      YM=YMIN
+      MM=M
+      NN=N
+C COMPUTE THE EDGES CLOSEST TO THE VIEW POINT.
+      XTEST=CX
+      IF(XMAX.LT.XTEST) XTEST=XMAX
+      IF(XTEST.LT.XMIN) XTEST=XMIN
+      YTEST=CY
+      IF(YMAX.LT.YTEST) YTEST=YMAX
+      IF(YTEST.LT.YMIN) YTEST=YMIN
+      ZTEST=CZ
+      IF(ZMAX.LT.ZTEST) ZTEST=ZMAX
+      IF(ZTEST.LT.ZMIN) ZTEST=ZMIN
+C COMPUTE THE CENTER OF THE CUBE--THIS WILL BE POINT
+C ON THE LINE OF SIGHT THROUGH WHICH THE PERSPECTIVE
+C PLANE IS DEVELOPED PERPENDICULAR TO THE LINE OF
+C SIGHT.
+      QX=0.5*(XMAX+XMIN)
+      QY=0.5*(YMAX+YMIN)
+      QZ=0.5*(ZMAX+ZMIN)
+C COMPUTE THE LENGTH OF LINE CQ
+      CXQ=QX-CX
+      CYQ=QY-CY
+      CZQ=QZ-CZ
+      T=CXQ*CXQ+CYQ*CYQ+CZQ*CZQ
+      DCQ=SQRT(T)
+C COMPUTE COS(ALPHA),COS(BETA),COS(GAMMA) WHERE
+C (ALPHA,BETA,GAMMA) ARE THE ANGLES MADE WITH
+C X,Y,Z AXIS RESPECTIVELY BY CQ.
+      CALPHA=CXQ/DCQ
+      CBETA=CYQ/DCQ
+      CGAMMA=CZQ/DCQ
+C COMPUTE SIN(GAMMA)--IF ZERO USE DIFFERENT FORMULA
+C TO CALCULATE TRANSFORMED X AND Y WHICH USE SIN(BETA)
+      DSAOB=SQRT(T-CZQ*CZQ)/DCQ
+      IFLG=1
+      IF(DSAOB.NE.0.0) GO TO 10
+      IFLG=2
+      DSAOB=SQRT(T-CYQ*CYQ)/DCQ
+   10 DSAOB=1.0/DSAOB
+C DETERMINE MAX AND MIN OF PERSPECTIVE PLANE
+	XM1=1.E30
+	YM1=XM1
+	XMX1=-XM1
+	YMX1=XMX1
+      X=XMIN
+      DO 40 I=1,2
+      Y=YMIN
+      DO 30 J=1,2
+      Z=ZMIN
+      DO 20 K=1,2
+      CALL TRANSF(X,Y,Z,XX,YY)
+      IF(XX.LT.XM1) XM1=XX
+      IF(XMX1.LT.XX) XMX1=XX
+      IF(YY.LT.YM1) YM1=YY
+      IF(YMX1.LT.YY) YMX1=YY
+      Z=ZMAX
+   20 CONTINUE
+      Y=YMAX
+   30 CONTINUE
+      X=XMAX
+   40 CONTINUE
+      CALL SIZE(WIDTH,HEIGHT)
+C      SCAL=(WIDTH-1.0)/(XMX1-XM1)
+C THE SCALE FACTORS ARE CHOSEN TO BE THE SAME.
+C      SCAL1=(HEIGHT-1.0)/(YMX1-YM1)
+C      IF(SCAL1.LT.SCAL) SCAL=SCAL1
+C      CALL SCALE(SCAL,SCAL,0.50,0.50,XM1,YM1)
+	XF=XLEN/(XMX1-XM1)
+	YF=YLEN/(YMX1-YM1)
+	IF(YF.LT.XF)XF=YF
+	CALL SCALE(XF,XF,XORG,YORG,XM1,YM1)
+C DRAW LABEL FOR PLOT
+C DETERMINE DLTAX AND DLTAY
+      DLTAX=(XMAX-XMIN)/(M-1)
+      DLTAY=(YMAX-YMIN)/(N-1)
+      DLTAXI=1.0/DLTAX
+      DLTAYI=1.0/DLTAY
+C DO LINES PARALLEL TO X-AXIS FIRST
+      DLTAX1=DLTAX
+	DLTAX2=0.
+	DLTAY1=DLTAX2
+      DLTAY2=DLTAY
+C DO HORIZONTAL AND THEN VERTICAL LINES
+      M1=M-1
+      N1=N
+      IDXINC=M
+	IDXINT=1
+	INC=IDXINT
+	IDX=INC
+      DO 90 I=1,2
+	XXM=XMIN
+	X=XXM
+	YYM=YMIN
+	Y=YYM
+C LOOP THROUGH OUTER LOOP
+C MOVE TO THE FIRST POINT OF EACH LINE WITH THE PEN UP.
+      DO 80 J=1,N1
+      Z=F(IDX)
+	IF(ZLE.AND.(Z.LE.CMZLE).OR.
+     *	   ZEQ.AND.(Z.EQ.CMZEQ).OR.
+     *	   ZGE.AND.(Z.GE.CMZGE))THEN
+	    SKIP=.TRUE.
+	ELSE
+	    SKIP=.FALSE.
+	    CALL HIDE(X,Y,Z,PHI,F)
+	    CALL TRANSF(X,Y,Z,XX,YY)
+	    CALL PLOT(XX,YY,0,0)
+	ENDIF
+C LOOP THROUGH INNER LOOP
+      DO 70 K=1,M1
+	IF ( interrupted ) RETURN		! TMAP interrupt
+      PHIO=PHI
+      ZOLD=Z
+      X=X+DLTAX1
+      Y=Y+DLTAY1
+      IDX=IDX+INC
+      Z=F(IDX)
+	IF(ZLE.AND.(Z.LE.CMZLE).OR.
+     *	   ZEQ.AND.(Z.EQ.CMZEQ).OR.
+     *	   ZGE.AND.(Z.GE.CMZGE))THEN
+	    SKIP=.TRUE.
+	ELSE
+	    IF(SKIP)THEN
+C
+C	MOVE WITH PEN UP
+C
+		SKIP=.FALSE.
+		CALL HIDE(X,Y,Z,PHI,F)
+		CALL TRANSF(X,Y,Z,XX,YY)
+		CALL PLOT(XX,YY,0,0)
+	    ELSE
+		CALL MOVES(X,Y,Z,ZOLD,PHIO,PHI,F)
+	    ENDIF
+	ENDIF
+   70 CONTINUE
+	XXM=XXM+DLTAX2
+	X=XXM
+	YYM=YYM+DLTAY2
+	Y=YYM
+	IDXINT=IDXINT+IDXINC
+	IDX=IDXINT
+   80 CONTINUE
+	DLTAY2=0.
+	DLTAX1=DLTAY2
+      DLTAY1=DLTAY
+      DLTAX2=DLTAX
+C SET UP FOR MOVING IN OTHER DIRECTION
+      M1=N-1
+      N1=M
+	IDXINC=1
+	IDXINT=IDXINC
+	IDX=IDXINT
+      INC=M
+   90 CONTINUE
+C DRAW BASE
+	DLTAX2=DLTAX
+	DLTAX1=DLTAX2
+      DLTAY1=0.
+      DLTAY2=DLTAY
+      X=XMIN
+      Y=YMIN
+      Z=ZMIN
+      CALL HIDE(X,Y,Z,PHI,F)
+      CALL TRANSF(X,Y,Z,XX,YY)
+      CALL PLOT(XX,YY,0,0)
+C MOVE PEN TO XMIN,YMIN,ZMIN AND BEGIN
+      M1=MM-1
+      IDX=M
+      TEMP=N*M
+      DO 100 K=1,2
+      DO 110 I=1,2
+      DO 120 J=1,M1
+      PHIO=PHI
+      X=X+DLTAX1
+      Y=Y+DLTAY1
+      CALL MOVES(X,Y,Z,Z,PHIO,PHI,F)
+120   CONTINUE
+C DRAW VERT SEGMENT OF THE BASE
+      PHIO=PHI
+      ZOLD=Z
+      Z=F(IDX)
+	IF(ZLE.AND.(Z.LE.CMZLE).OR.
+     *	   ZEQ.AND.(Z.EQ.CMZEQ).OR.
+     *	   ZGE.AND.(Z.GE.CMZGE))Z=(ZMAX+ZMIN)*0.5
+	DLTAY1=0.
+	DLTAX1=DLTAY1
+      CALL TRANSF(X,Y,ZOLD,XX,YY)
+C MOVE PEN TO CORNER
+      CALL PLOT(XX,YY,0,0)
+C PLOT LINE
+      CALL MOVES(X,Y,Z,ZOLD,PHIO,PHI,F)
+C MOVE PEN BACK
+      CALL PLOT(XX,YY,0,0)
+C SET NEW VALUES
+      PHI=PHIO
+      DLTAX1=0.
+      DLTAY1=DLTAY2
+      M1=N-1
+      IDX=TEMP
+      Z=ZMIN
+110   CONTINUE
+	DLTAX1=-DLTAX
+	DLTAX2=DLTAX1
+      DLTAY2=-DLTAY
+      DLTAY1=0.
+      IDX=1+(N-1)*M
+      TEMP=1
+      M1=MM-1
+100   CONTINUE
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+      SUBROUTINE MOVES(X,Y,Z,ZOLD,PHIO,PHI,F)
+      DIMENSION F(1)
+
+* Mod to specify external references for SCALE and RANGE * Linux *jd* 12.96
+	external scale, size
+
+
+C MOVES PEN TO NEW POINT ( X,Y,Z )
+C SEE IF THE POINT IS HIDDEN
+      CALL HIDE(X,Y,Z,PHI,F)
+C TEST IF BOTH VIEWABLE OR NOT
+      IF(PHI.EQ.PHIO) GO TO 60
+C TEST FOR ONE VIEWABLE FROM TOP AND ONE FROM BOTTOM
+      IF(ABS(PHI).EQ.ABS(PHIO)) GO TO 50
+C O.K. ONE IS HIDEN AND OTHER NOT. FIND LEFT HAND
+C INTERCEPT.
+      CALL INTCEP(X,Y,Z,Z-ZOLD,F,X1,Y1,Z1,PHIO,-1.0)
+      CALL TRANSF(X1,Y1,Z1,XX,YY)
+      IPEN=ABS(PHIO)
+      CALL PLOT(XX,YY,IPEN,0)
+      GO TO 60
+C WE HAVE HIDDEN PART IN MIDDLE--VIEWABLE FROM TOP
+C ON ONE SIDE AND VIEWABLE FROM BOTTOM ON OTHER END
+   50 CALL INTCEP(X,Y,Z,Z-ZOLD,F,X1,Y1,Z1,PHIO,-1.0)
+      CALL TRANSF(X1,Y1,Z1,XX,YY)
+      CALL PLOT(XX,YY,1,0)
+C FIND RIGHT HAND INTERCEPT
+      CALL INTCEP(X,Y,Z,Z-ZOLD,F,X1,Y1,Z1,PHI,1.0)
+      CALL TRANSF(X1,Y1,Z1,XX,YY)
+      CALL PLOT(XX,YY,0,0)
+C MOVE TO POINT
+   60 IF(PHI.EQ.0.0) GO TO 70
+      CALL TRANSF(X,Y,Z,XX,YY)
+      CALL PLOT(XX,YY,1,0)
+70    RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+      SUBROUTINE HIDE(X,Y,Z,PHI,F)
+C HIDE TESTS TO SEE IF THE POINT (XB,YB,ZB) IS HIDDEN
+C FROM VIEW OF (CX,CY,CZ).  THIS IS DONE BY TRAVETSING
+C THE LINE FROM (XB,YB,ZB) TO (CX,CY,CZ) TO SEE IF THE
+C LINE INTERSECTS THE SURFCE.
+C
+C THE CALLING PARAMETERS ARE:
+C  X   - THE X VALUE OF THE POINT
+C  Y   - THE Y VALUE OF THE POINT
+C  Z   - THE Z VALUE OF THE POINT
+C  PHI - VARIABLE WITH THE FOLLOWING VALUES UPON RETURN
+C         0 IF THE POINT IS HIDDEN
+C        -1 IF THE POINT IS VIEWABLE FROM BELOW
+C         1 IF THE POINT IS VIEWABLE FROM ABOVE
+C  F   - THE ARRAY OF VALUES.
+      DIMENSION F(1)
+#ifdef unix
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+#else
+	INCLUDE 'TMAP_PPLV11INC:MISS_INC.DECL'
+	INCLUDE 'PPLV11INC:MISS.INC'
+#endif
+      COMMON/LAB1/CX,CY,CZ,QX,QY,QZ,DCQ,CALPHA,CBETA,CGAMMA,
+     1DSAOB,IFLG,XTEST,YTEST,ZTEST,DLTAX1,DLTAY1,DLTAX,DLTAY
+     2,ZMIN,ZMAX,XMIN,YMIN,DLTAXI,DLTAYI,M,N
+      DIMENSION CVIEW(3),VLTEST(3),POINT(3),CVPDST(3),DIST(3)
+      DIMENSION TEST(3)
+      EQUIVALENCE (CX,CVIEW(1)),(XB,POINT(1)),(YB,POINT(2)),
+     1(ZB,POINT(3)),(XDIST,DIST(1)),(YDIST,DIST(2)),(ZDIST,
+     2DIST(3)),(CXXB,CVPDST(1)),(CYYB,CVPDST(2)),(CZZB,
+     3CVPDST(3)),(XTEST,TEST(1))
+
+* Mod to specify external references for SCALE and RANGE * Linux *jd* 12.96
+	external scale, size
+
+C COMPUTE DX,DY,DZ OF THE LINE OF VIEW
+      XB=X
+      YB=Y
+      ZB=Z
+      DO 5 J=1,3
+	VLTEST(J)=TEST(J)-POINT(J)
+	TEMP=VLTEST(J)
+      IF(TEST(J).NE.0.0) TEMP=TEMP/TEST(J)
+      IF(ABS(TEMP).LT.1.0E-6) VLTEST(J)=0.0
+	CVPDST(J)=CVIEW(J)-POINT(J)
+	TEMP=CVPDST(J)
+      IF(CVIEW(J).NE.0.0) TEMP=TEMP/CVIEW(J)
+      IF(ABS(TEMP).LT.1.0E-6) CVPDST(J)=0.0
+    5 CONTINUE
+C MUST FIND THE POINT AT WHICH THE LINE OF SIGHT INTERSECTS
+C THE CUBE.
+      DO 20 J=1,3
+      DIST(J)=0.0
+      IF(CVPDST(J).EQ.0.0) GO TO 20
+      DIST(J)=VLTEST(J)
+      RATIO=DIST(J)/CVPDST(J)
+      DO 10 I=1,3
+      IF(I.EQ.J) GO TO 10
+	DIST(I)=RATIO*CVPDST(I)
+	TEMP=DIST(I)
+      IF(CVPDST(I).NE.0.0) TEMP=TEMP/CVPDST(I)
+      IF(ABS(TEMP).LT.1.0E-6) DIST(I)=0.0
+      IF(ABS(VLTEST(I)).LT.ABS(DIST(I))) GO TO 20
+   10 CONTINUE
+      GO TO 30
+   20 CONTINUE
+   30 IF(XDIST.EQ.0.0) GO TO 40
+C WE ARE NOT VIEWING ALONG LINE PARALLEL TO Y-Z PLANE
+	IDX=ABS(XDIST)/DLTAX+1.0
+	INUM=IDX
+      DX=XDIST/IDX
+      DY=YDIST/XDIST*DX
+      IF(ABS(DLTAY).LT.ABS(DY)) GO TO 50
+      GO TO 60
+C SEE IF ABOVE POINT
+   40 IF(YDIST.NE.0.0) GO TO 50
+C WE ARE RIGHT ABOVE OR BELOW POINT
+      PHI=SIGN(1.,CZZB)
+      RETURN
+50	IDY=ABS(YDIST)/DLTAY+1.0
+	INUM=IDY
+      DY=YDIST/IDY
+      DX=XDIST/YDIST*DY
+C STEP ALONG THE LINE OF SIGHT IN HALF STEPS.
+   60 DX=DX*0.5
+      DY=DY*0.5
+      INUM=INUM+INUM
+      DZ=ZDIST*SQRT((DX*DX+DY*DY)/(XDIST*XDIST+YDIST*YDIST))
+      XB=XB+DX
+      YB=YB+DY
+      ZB=ZB+DZ
+C COMPUTE THE INDICES OF THE GRID POINTS CONTAINING THE POINT.
+	FI=(XB-XMIN)*DLTAXI+1.0
+	I=FI
+	FJ=(YB-YMIN)*DLTAYI+1.0
+	J=FJ
+      I1=FI+0.995
+      J1=FJ+0.995
+C MAKE SURE THE INDICES DON"T GET TOO LARGE.
+      IF(I1.GT.M) I1=M
+      IF(J1.GT.N) J1=N
+C COMPUTE THE LINEAR ARRAY INDICES.
+      MI=(J-1)*M
+      MI1=(J1-1)*M
+      IDX=MI+I
+      IDX1=MI+I1
+      IDX2=MI1+I
+      IDX3=MI1+I1
+C USE A TWO STAGE LINEAR INTERPOLATION.
+      XFACT=(XB-(XMIN+(I-1)*DLTAX))*DLTAXI
+C
+C**	ADD TEST FOR DATA TO BE IGNORED IN THE HIDE ALGORITHM
+C
+C	IF(ZLE.AND.(F(IDX).LE.CMZLE).OR.
+C     *	   ZEQ.AND.(F(IDX).EQ.CMZEQ).OR.
+C     *	   ZGE.AND.(F(IDX).GE.CMZGE))GOTO
+C	IF(ZLE.AND.(F(IDX1).LE.CMZLE).OR.
+C     *	   ZEQ.AND.(F(IDX1).EQ.CMZEQ).OR.
+C     *	   ZGE.AND.(F(IDX1).GE.CMZGE))GOTO
+C	IF(ZLE.AND.(F(IDX2).LE.CMZLE).OR.
+C     *	   ZEQ.AND.(F(IDX2).EQ.CMZEQ).OR.
+C     *	   ZGE.AND.(F(IDX2).GE.CMZGE))GOTO
+C	IF(ZLE.AND.(F(IDX3).LE.CMZLE).OR.
+C     *	   ZEQ.AND.(F(IDX3).EQ.CMZEQ).OR.
+C     *	   ZGE.AND.(F(IDX3).GE.CMZGE))GOTO
+      Z1=F(IDX)+(F(IDX1)-F(IDX))*XFACT
+      Z2=F(IDX2)+(F(IDX3)-F(IDX2))*XFACT
+      ZZ=Z1+(Z2-Z1)*(YB-(YMIN+(J-1)*DLTAY))*DLTAYI
+C TEST THE FIRST DIFFERENCE TO MAKE SURE
+C WE AREN"T JUST ON THE BOUNDARY.  IF SO WE WANT THE POINT TO BE VIEWABL
+C BUT WITH THE SAME PHI VALUE AS THE LAST POINT I.E. + OR - 1.  BUT IF
+C THE LAST POINT WAS HIDDEN WE WANT THE CURRENT POINT VIEWABLE, SO THE
+C SIGN OF THE LAST PHI IS USED.  THIS CASE ONLY OCCURS WHEN
+C WE ARE ON THE BOUNDARY CLOSEST TO THE VIEWING POINT.
+      ARG=ZB-ZZ
+      IF(ARG.EQ.0.0) GO TO 90
+	PHIOLD=SIGN(1.,ARG)
+	PHI=PHIOLD
+C COMPUTE THE INDICES INCREMENT.
+      DFI=DX*DLTAXI
+      DFJ=DY*DLTAYI
+      DO 70 K=2,INUM
+C MOVE ALONG THE LINE OF SIGHT.
+      XB=XB+DX
+      YB=YB+DY
+      ZB=ZB+DZ
+C INCREMENT THE INDICES.
+      FI=FI+DFI
+      FJ=FJ+DFJ
+C COMPUTE THE INDICES OF THE GRID ABOUT THE POINT.
+      I=FI+0.005
+      J=FJ+0.005
+      I1=FI+0.995
+      J1=FJ+0.995
+C MAKE SURE THE INDICES DON"T GET TOO LARGE.
+      IF(I1.GT.M) I1=M
+      IF(J1.GT.N) J1=N
+C COMPUTE THE LINEAR ARRAY INDICES
+      MI=(J-1)*M
+      MI1=(J1-1)*M
+      IDX=MI+I
+      IDX1=MI+I1
+      IDX2=MI1+I
+      IDX3=MI1+I1
+C USE A TWO STAGE INTERPOLATION.
+      XFACT=(XB-(XMIN+(I-1)*DLTAX))*DLTAXI
+C
+C**	ADD TEST FOR DATA TO BE IGNORED IN THE HIDE ALGORITHM
+C
+	IF(ZLE.AND.(F(IDX).LE.CMZLE).OR.
+     *	   ZEQ.AND.(F(IDX).EQ.CMZEQ).OR.
+     *	   ZGE.AND.(F(IDX).GE.CMZGE))GOTO 70
+	IF(ZLE.AND.(F(IDX1).LE.CMZLE).OR.
+     *	   ZEQ.AND.(F(IDX1).EQ.CMZEQ).OR.
+     *	   ZGE.AND.(F(IDX1).GE.CMZGE))GOTO 70
+	IF(ZLE.AND.(F(IDX2).LE.CMZLE).OR.
+     *	   ZEQ.AND.(F(IDX2).EQ.CMZEQ).OR.
+     *	   ZGE.AND.(F(IDX2).GE.CMZGE))GOTO 70
+	IF(ZLE.AND.(F(IDX3).LE.CMZLE).OR.
+     *	   ZEQ.AND.(F(IDX3).EQ.CMZEQ).OR.
+     *	   ZGE.AND.(F(IDX3).GE.CMZGE))GOTO 70
+      Z1=F(IDX)+(F(IDX1)-F(IDX))*XFACT
+      Z2=F(IDX2)+(F(IDX3)-F(IDX2))*XFACT
+      ZZ=Z1+(Z2-Z1)*(YB-(YMIN+(J-1)*DLTAY))*DLTAYI
+      PHI=SIGN(1.,ZB-ZZ)
+C TEST THE VIEWABLILITY OF THE POINT, IF THE PHI"S ARE DIFFERENT
+C THE POINT IS NOT VIEWABLE.
+      IF(PHI.NE.PHIOLD) GO TO 80
+   70 CONTINUE
+      RETURN
+C THE POINT IS NOT VIEWABLE
+   80 PHI=0.0
+      RETURN
+   90 PHI=SIGN(1.,PHIOLD)
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+      SUBROUTINE INTCEP(X,Y,Z,DLTAZ,F,X1,Y1,Z1,PHI,DIR)
+C INTERCEPT COMPUTES THE INTERCEPT OF THE LINES OF
+C SIGHT WITH THE FIRST VIEWABLE POINT ALONG THE LINE
+C CONNECTING THE POINTS.  THE CALLING PARAMETERS ARE
+C
+C  X   - THE X VALUE OF NEXT POINT
+C  Y   - THE Y VALUE OF NEXT POINT
+C  F   - THE FUNCTION NAME
+C  Z   - THE Z VALUE OF NEXT POINT
+C  DLTAZ - THE DIFFERENCE IN THE TWO Z VALUES ALONG LINE OF
+C      - INTERPOLATION.
+C  X1  - THE X COORDINATE OF THE INTERCEPT POINT
+C  Y1  - THE Y COORDINATE OF THE INTERCEPT POINT
+C  Z1  - THE Z COORDINATE OF THE INTERCEPT POINT
+C  PHI - THE VIEWABLE VALUE WE WISH THE INTERCEPT
+C        POINT TO HAVE
+C  DIR - THIS VARIABLE WILL HAVE THE VALUE -1.0 IF
+C        PHI IS FROM LAST POINT AND 1.0 IF NEXT.
+      DIMENSION F(1)
+      COMMON/LAB1/CX,CY,CZ,QX,QY,QZ,DCQ,CALPHA,CBETA,CGAMMA,
+     1DSAOB,IFLG,XTEST,YTEST,ZTEST,DLTAX1,DLTAY1,DLTAX,DLTAY
+     2,ZMIN,ZMAX,XMIN,YMIN,DLTAXI,DLTAYI,M,N
+      DELX=DLTAX1*0.5
+      DELY=DLTAY1*0.5
+      DELZ=DLTAZ*0.5
+      X1=X-DELX
+      Y1=Y-DELY
+      Z1=Z-DELZ
+      DO 20 I=1,5
+      DELX=DELX*0.5
+      DELY=DELY*0.5
+      DELZ=DELZ*0.5
+      CALL HIDE(X1,Y1,Z1,PHIN,F)
+      IF(PHIN.EQ.PHI) GO TO 10
+C MOVE IN DIRECTION OF PHI
+      X1=X1+DIR*DELX
+      Y1=Y1+DIR*DELY
+      Z1=Z1+DIR*DELZ
+      GO TO 20
+C MOVE AWAY FROM PHI
+   10 X1=X1-DIR*DELX
+      Y1=Y1-DIR*DELY
+      Z1=Z1-DIR*DELZ
+   20 CONTINUE
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
+C*F45V1P0*
+      SUBROUTINE TRANSF(X,Y,Z,XX,YY)
+C THE ROUTINE TRANSF TRANSFORMS THE (X,Y,Z) TRIPLE INTO (X,Y) PAIR IN
+C THE VIEWING PLANE.  THE CALLING ARGUMENTS ARE:
+C  X  - THE X COORDINATE OF THE TRIPLE
+C  Y  - THE Y COORDINATE OF THE TRIPLE
+C  Z  - THE Z COORDINATE OF THE TRIPLE
+C  XX - THE X COORDINATE OF THE VIEWING PLANE POINT.
+C  YY - THE Y COORDINATE OF THE VIEWING PLANE POINT.
+      COMMON/LAB1/CX,CY,CZ,QX,QY,QZ,DCQ,CALPHA,CBETA,CGAMMA,DSAOB,IFLG
+     1,XTEST,YTEST,ZTEST,DLTAX1,DLTAY1,DLTAX,DLTAY
+     2,ZMIN,ZMAX,XMIN,YMIN,DLTAXI,DLTAYI,M,N
+
+* Mod to specify external references for SCALE and RANGE * Linux *jd* 12.96
+	external scale, size
+
+
+ 
+
+
+      CXX=X-CX
+      CYY=Y-CY
+      CZZ=Z-CZ
+      RK=DCQ/(CXX*CALPHA+CYY*CBETA+CZZ*CGAMMA)
+      IF(IFLG.EQ.2) GO TO 10
+      XX=((CX+RK*CXX-QX)*CBETA-(CY+RK*CYY-QY)*CALPHA)*DSAOB
+      YY=(CZ+RK*CZZ-QZ)*DSAOB
+      RETURN
+   10 XX=((QX-CX-RK*CXX)*CGAMMA+(CZ+RK*CZZ-QZ)*CALPHA)*DSAOB
+      YY=(CY+RK*CYY-QY)*DSAOB
+      RETURN
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **
+      END
diff --git a/ppl/plotlib/taxis.F b/ppl/plotlib/taxis.F
new file mode 100644
index 0000000..69300ab
--- /dev/null
+++ b/ppl/plotlib/taxis.F
@@ -0,0 +1,74 @@
+	SUBROUTINE TAXIS(IT,TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,
+     *	XF,YHI,YF,TCSIZE,yacross,vgrat,vcolor,vline)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)taxis.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 03/04  new arguments for plotting graticule lines across plot. 
+
+C If graticule lines are to be drawn across the plot at the tics
+C then only do them for one horizontal and one vertical axis.  
+C The dash lines interfere with each other if drawn from both 
+C sides. HLINE and VLINE control this. 
+
+	CHARACTER*(*) IT1,IT2
+        
+        REAL yacross
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+
+	GOTO (10,20,20,30)IT+1
+10	CALL TAXIS0(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,XF,YHI,YF,TCSIZE,
+     .              yacross,vgrat,vcolor,vline)
+	RETURN
+20	CALL TAXIS1(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,XF,YHI,YF,TCSIZE,
+     .              yacross,vgrat,vcolor,vline)
+	RETURN
+30	CALL TAXIS3(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,XF,YHI,YF,TCSIZE,
+     .              yacross,vgrat,vcolor,vline)
+	RETURN
+	END
diff --git a/ppl/plotlib/taxis0.F b/ppl/plotlib/taxis0.F
new file mode 100644
index 0000000..a4c995e
--- /dev/null
+++ b/ppl/plotlib/taxis0.F
@@ -0,0 +1,370 @@
+      SUBROUTINE TAXIS0(TLO,ITIME1,ITIME2,DT,NSMTIC,LABEL,IHDB,IDDB,
+     1    TFACT,Y,YFACT,CSIZE,yacross,vgrat,vcolor,vline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAXIS0.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+* *sh*  - 4/19/89 FERRET 1.21  (repeat of correction made earlier)
+*       - changed "mon" to "date" in calls to SYMWID and SYMBEL.
+*         "mon" is the wrong data type                          
+                                                                
+* *jd* Mod for 4 digit years 11.27.95
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 24/01/00 Y2k Bug -- Put century at start when comparing 
+C                 ITIME to ITIME2 at loop 10
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot. 
+C V65  *acm*  1/10 New time-axis style for DAY and MONTH, DMY: adds the
+C                  year to DAY,MONTH or to MONTH.
+C**
+C**    @(#)taxis0.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE DAY OF THE M
+C     AND THE MONTH.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  7708190100)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  EVEN HOURS.  (THAT IS THE LAST 4 DIGITS OF ITIME1
+C                  MUST BE 0)
+C         ITIME2 = END TIME (IE   7709072300)
+C                  THIS IS THE FIRST HOUR NOT TO BE PLOTTED, AND IT
+C                  MUST BE AN EVEN HOUR.
+C         DT = SAMPLING RATE IN MINUTES.
+C         NSMTIC = NUMBER OF SMALL TICS TO MAKE EACH HOUR.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                       3           4          5        6
+C                                    JUN 7
+C         IHDB = PRINT LABELS OF HOURS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IHDB = 0) PRINT NO DAY LABELS.
+C         IDDB = PRINT LABELS OF DAYS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IDDB = 0) PRINT NO MONTH LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW HOUR LABELS.
+C                 DAY LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C
+C     THIS ROUTINE WAS FIRST WRITTEN BY DAVID MANDEL IN JULY 1980.
+C
+	CHARACTER ITIME3*14,DATE*6,BUFF*14,YEAR*4
+	CHARACTER ITIME*14,ITIME1*(*),ITIME2*(*),SYM*21
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+* Parameters for drawing tics across plot
+
+        REAL yacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        INTEGER ltic, color1, color2
+
+* TMAP interrupt flag
+	include 'xinterrupt.cmn'
+        include 'century.cmn'  ! with MONYRLAB flag
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+
+	IF(ITIME1(9:10).NE.'00')STOP ',1'
+	IF(ITIME2(9:10).NE.'00')STOP ',2'
+     
+        IF(ITIME1(13:14)//ITIME1(1:12).GE.
+     .	   ITIME2(13:14)//ITIME2(1:12)) STOP',3'
+
+C set up for plotting graticules across at tic marks
+        
+        solid1 = (vgrat(1,1).LT.0 .AND. vgrat(2,1).LT.0 .AND.  
+     .            vgrat(3,1).LT.0 .AND.  vgrat(4,1).LT.0 )
+        solid2 = (vgrat(1,2).LT.0 .AND. vgrat(2,2).LT.0 .AND.  
+     .            vgrat(3,2).LT.0 .AND.  vgrat(4,2).LT.0 )
+        dashed1 = (vgrat(1,1).GT.0 .OR. vgrat(2,1).GT.0 .OR.  
+     .            vgrat(3,1).GT.0 .OR.  vgrat(4,1).GT.0 )
+        dashed2 = (vgrat(1,2).GT.0 .OR. vgrat(2,2).GT.0 .OR.  
+     .            vgrat(3,2).GT.0 .OR.  vgrat(4,2).GT.0 )
+
+        color1 = vcolor(1)
+        color2 = vcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = vgrat(1,1)
+           dash1_2 = vgrat(2,1)
+           dash1_3 = vgrat(3,1)
+           dash1_4 = vgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = vgrat(1,2)
+           dash2_2 = vgrat(2,2)
+           dash2_3 = vgrat(3,2)
+           dash2_4 = vgrat(4,2)
+        ENDIF
+C
+C     SET PARAMETERS.
+      TIC = 60./DT
+      NTIC = NSMTIC + 1
+	IF(NSMTIC.LT.0)THEN
+		IHVY=-8
+		INML=-7
+	ELSE
+		IHVY=-9
+		INML=-8
+		TDIST = TIC/NTIC
+	ENDIF
+	IF(LABEL+IX.EQ.0)THEN
+		YTEMP=0.0
+	ELSE
+		YTEMP=TLX*0.5
+	ENDIF
+	IF(IHDB.NE.0)THEN
+	FIHDB=0.0
+	ELSE
+	FIHDB=-1.4
+	ENDIF
+	YTEMP1=Y+LABEL*(0.9*CSIZE+YTEMP)/YFACT
+      IF(LABEL.LT.0) THEN
+      YTEMP2=Y-((4.0+FIHDB)*CSIZE+YTEMP)/YFACT
+      ELSE
+      YTEMP2=Y+((2.5+FIHDB)*CSIZE+YTEMP)/YFACT
+      ENDIF
+	IF(LABEL.NE.0)XWID=(4.0+FIHDB)*CSIZE+YTEMP
+      T=TLO
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      TDAY=T
+
+      CALL PLOT(TLO,Y,0,0)
+	IF(IHR.EQ.0)THEN
+	CALL PLOTT7(TLO,Y,TFACT,YFACT,1,IHVY)
+	ELSE
+	CALL PLOTT7(TLO,Y,TFACT,YFACT,1,INML)
+	ENDIF
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+      ITIME = ITIME3
+      IF(IABS(LABEL).NE.1.OR.IHR.NE.IHDB*(IHR/IHDB)) GO TO 11
+C      ELSE:
+          WRITE(SYM,80) IHR
+80	FORMAT(I2.2)
+	CALL SCINOT(T,YTEMP1,0.,CSIZE,2,SYM,0,WID,TFACT,YFACT)
+  11  CONTINUE    
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+c Set itime1, itime3 as above
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+      ITIME = ITIME3
+
+C      LOOP:
+       ltic = 0
+  110  CONTINUE
+
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+	ITIME=ITIME3
+
+	IF(ITIME(13:14)//ITIME(1:12) .LE.
+     .       ITIME2(13:14)//ITIME2(1:12)) THEN
+           IF(IHR.EQ.0) ltic = ltic + 1
+           GO TO 110
+        ENDIF
+     
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+	IF (ltic .EQ. 0) THEN   
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+        ENDIF
+
+! Restore the state of ITIME, ITIME3
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+      ITIME = ITIME3
+
+c ----
+
+C      LOOP:
+   10     CALL PLOT(T,Y,0,0)
+	  IF ( interrupted ) RETURN		! TMAP interrupt
+          DO 20 I=1,NSMTIC
+              CALL PLOTT7(T+FLOAT(I)*TDIST,Y,TFACT,YFACT,1,-7)
+     
+                 IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(T+FLOAT(I)*TDIST,y,0,0) 
+                    CALL PLOT(T+FLOAT(I)*TDIST,yacross,1,0)
+                    CALL PLOT(T+FLOAT(I)*TDIST,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+   20         CONTINUE
+          CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	IF(IHR.EQ.0)THEN
+	CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,IHVY)
+              IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(t+tic,y,0,0) 
+                 CALL PLOT(t+tic,yacross,1,0)
+                 CALL PLOT(t+tic,Y,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+      
+	ELSE
+	       CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,INML)
+     
+               IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                  CALL COLOR(color1)
+                  IF (dashed1) THEN
+                     CALL DASHSZ(dash1_1,dash2_1,dash1_3,dash1_4)
+                     CALL DASHES
+                  ENDIF
+                  CALL PLOT(t+tic,y,0,0) 
+                  CALL PLOT(t+tic,yacross,1,0)
+                  CALL PLOT(t+tic,Y,0,0) 
+                  CALL COLOR(1)
+                  CALL VECTRS
+               ENDIF
+
+	ENDIF
+C         THE LABELS
+          IF(IHDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 50
+          IF(IHR.NE.IHDB*(IHR/IHDB)) GO TO 50
+	WRITE(SYM,80) IHR
+	CALL SCINOT(T+TIC,YTEMP1,0.,CSIZE,2,SYM,0,WID,TFACT,YFACT)
+   50     CONTINUE
+          CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+          IF(IDDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 70
+              CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+              IF(IDAY.EQ.IDAY3) GO TO 70
+              IF(IDAY.NE.IDDB*(IDAY/IDDB))GO TO 60
+C             ELSE:
+	IF(T-TDAY.GT.180./DT)THEN
+           CALL TIME2(ITIME,SYM)
+	   READ(SYM,55) DATE, YEAR
+55	   FORMAT(6X,A6,1X,A4)
+65         FORMAT(A6,1X,A4)
+           IF (MONYRLAB) THEN
+	      WRITE (BUFF, 65) DATE, YEAR
+              TSYM=TDAY+(T+TIC-TDAY-SYMWID(CSIZE,14,BUFF)/TFACT)*.5
+              CALL SYMBEL(TSYM,YTEMP2,0.,CSIZE,14,BUFF)
+	   ELSE
+              TSYM=TDAY+(T+TIC-TDAY-SYMWID(1.5*CSIZE,6,DATE)/TFACT)*.5
+	      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,6,DATE)
+	   ENDIF
+	ENDIF
+   60   TDAY=T+TIC
+   70     CONTINUE
+          ITIME=ITIME3
+          T=T+TIC
+c          IF(ITIME.LE.ITIME2) GO TO 10
+
+          IF(ITIME(13:14)//ITIME(1:12) .LE.
+     .       ITIME2(13:14)//ITIME2(1:12)) GO TO 10
+     
+      IF(IDDB.EQ.0) RETURN
+	IF(IABS(LABEL).EQ.1.AND.IDAY.EQ.IDDB*(IDAY/IDDB)
+     .	.AND.IHR3.GE.4)THEN
+      CALL TIME2(ITIME,SYM)
+	READ(SYM,55) DATE
+* TMAP mod 9/17/89 *sh*                                 
+! original:  ("mon" --> "date")                           
+!      TSYM=TDAY+(T-TDAY-SYMWID(1.5*CSIZE,6,MON)/TFACT)*.5
+!      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,6,MON)
+
+        IF (MONYRLAB) THEN
+	   WRITE (BUFF, 65) DATE, YEAR
+           TSYM=TDAY+(T-TDAY-SYMWID(CSIZE,14,BUFF)/TFACT)*.5
+           CALL SYMBEL(TSYM,YTEMP2,0.,CSIZE,14,BUFF)
+	ELSE
+           TSYM=TDAY+(T-TDAY-SYMWID(1.5*CSIZE,6,DATE)/TFACT)*.5
+	   CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,6,DATE)
+	ENDIF
+
+* end of 9/17/89 TMAP mod
+      ENDIF
+      RETURN
+      END
+
diff --git a/ppl/plotlib/taxis1.F b/ppl/plotlib/taxis1.F
new file mode 100644
index 0000000..b738233
--- /dev/null
+++ b/ppl/plotlib/taxis1.F
@@ -0,0 +1,372 @@
+      SUBROUTINE TAXIS1(TLO,ITIME1,ITIME2,DT,NSMTIC,LABEL,IDDB,IMDB,
+     1    TFACT,Y,YFACT,CSIZE,yacross,vgrat,vcolor,vline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAXIS1.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+
+* *jd* Mod for 4 digit years
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+C *acm* 24/01/00 Y2k Bug -- Put century at start when comparing 
+C                 ITIME to ITIME2 at loop 10
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot. 
+C V65  *acm*  1/10 New time-axis style for DAY and MONTH, DMY: adds the
+C                  year to DAY,MONTH or to MONTH.
+
+C**
+C**    @(#)taxis1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE DAY OF THE M
+C     AND THE MONTH.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  7708190000)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  EVEN DAYS.  (THAT IS THE LAST 6 DIGITS OF ITIME1
+C                  MUST BE 0)
+C         ITIME2 = END TIME (IE   7709070000)
+C                  THIS IS THE FIRST DAY NOT TO BE PLOTTED, AND IT
+C                  MUST BE AN EVEN DAY.
+C         DT = SAMPLING RATE IN MINUTES.
+C         NSMTIC = NUMBER OF SMALL TICS TO MAKE EACH DAY.
+C                = 23 FOR HOURLY TICS.
+C                = 11 FOR BIHOURLY TICS.
+C                   ETC.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                       3           4          5        6
+C                                      JUN
+C         IABS(LABEL) = 2 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                     JUN  3     JUN  4      JUN  5    JUN  6
+C         IDDB = PRINT LABELS OF DAYS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IDDB = 0) PRINT NO DAY LABELS.
+C         IMDB = PRINT LABELS OF MONTHS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IMDB = 0) PRINT NO MONTH LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW DAY LABELS.
+C                 MONTH LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C     THERE WAS A MODIFICATION TO THIE IN JUNE 1980.  THE
+C     SOLE PURPOSE FOR THIS MODIFICATION WAS TO IMPROVE 'S
+C     EFFICIENCY.
+C
+	CHARACTER ITIME3*14
+	CHARACTER SYM*21,ITIME1*(*),ITIME*14,ITIME2*(*),MON*3,DAY*2,
+     .		  YEAR*4, BUFF*8
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+* Parameters for drawing tics across plot
+
+        REAL yacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+
+        INTEGER ltic, color1, color2
+
+	include 'xinterrupt.cmn'
+        include 'century.cmn'  ! with MONYRLAB flag
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+	IF(ITIME1(7:10).NE.'0000')STOP ',1'
+	IF(ITIME2(7:10).NE.'0000')STOP  ',1'
+
+C set up for plotting graticules across at tic marks
+        
+        solid1 = (vgrat(1,1).LT.0 .AND. vgrat(2,1).LT.0 .AND.  
+     .            vgrat(3,1).LT.0 .AND.  vgrat(4,1).LT.0 )
+        solid2 = (vgrat(1,2).LT.0 .AND. vgrat(2,2).LT.0 .AND.  
+     .            vgrat(3,2).LT.0 .AND.  vgrat(4,2).LT.0 )
+        dashed1 = (vgrat(1,1).GT.0 .OR. vgrat(2,1).GT.0 .OR.  
+     .            vgrat(3,1).GT.0 .OR.  vgrat(4,1).GT.0 )
+        dashed2 = (vgrat(1,2).GT.0 .OR. vgrat(2,2).GT.0 .OR.  
+     .            vgrat(3,2).GT.0 .OR.  vgrat(4,2).GT.0 )
+
+        color1 = vcolor(1)
+        color2 = vcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = vgrat(1,1)
+           dash1_2 = vgrat(2,1)
+           dash1_3 = vgrat(3,1)
+           dash1_4 = vgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = vgrat(1,2)
+           dash2_2 = vgrat(2,2)
+           dash2_3 = vgrat(3,2)
+           dash2_4 = vgrat(4,2)
+        ENDIF
+
+C
+C     SET PARAMETERS.
+
+*     *jd Number of arguments of TIME3 calls reduced to 6.  TIME3 uses only
+*     the first 6, 'seconds' are not handled.  Done for MAC 7.92
+
+ 
+      TIC = 1440./DT
+      NTIC = NSMTIC + 1
+	IF(NSMTIC.LT.0)THEN
+		IHVY=-8
+		INML=-7
+	ELSE
+		IHVY=-9
+		INML=-8
+		TDIST = TIC/NTIC
+	ENDIF
+	IF(LABEL+IX.EQ.0)THEN
+		YTEMP=0.0
+	ELSE
+		YTEMP=TLX*0.5
+	ENDIF
+	IF(IDDB.NE.0)THEN
+	FIDDB=0.0
+	ELSE
+	FIDDB=-1.4
+	ENDIF
+      IF(LABEL.LT.0) THEN
+      YTEMP1=Y-(1.4*CSIZE+YTEMP)/YFACT
+      YTEMP2=Y-((4.0+FIDDB)*CSIZE+YTEMP)/YFACT
+      ELSE
+      YTEMP1=Y+(0.4*CSIZE+YTEMP)/YFACT
+      YTEMP2=Y+((2.5+FIDDB)*CSIZE+YTEMP)/YFACT
+      ENDIF
+	IF(LABEL.NE.0)XWID=(4.0+FIDDB)*CSIZE+YTEMP
+
+      CALL PLOT(TLO,Y,0,0)
+	IF(IDAY.EQ.1)THEN
+	CALL PLOTT7(TLO,Y,TFACT,YFACT,1,IHVY)
+	ELSE
+	       CALL PLOTT7(TLO,Y,TFACT,YFACT,1,INML)
+	ENDIF
+
+      T=TLO
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      TMON=T
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+C      LOOP like loop 10 below
+      ltic = 0
+  110 CONTINUE
+      IF ( interrupted ) RETURN		! TMAP interrupt
+      
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,1440.)
+      CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+      ITIME=ITIME3
+      IF(ITIME(13:14)//ITIME(1:12) .LT. 
+     .       ITIME2(13:14)//ITIME2(1:12) ) THEN
+         IF (IDAY3.EQ.1) ltic = ltic + 1  !It is a large tic.
+         GO TO 110
+      ENDIF
+
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+      IF (ltic .EQ. 0) THEN   
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+      ENDIF
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+c ----
+
+C      LOOP:
+   10     CALL PLOT(T,Y,0,0)
+	  IF ( interrupted ) RETURN		! TMAP interrupt
+          DO 20 I=1,NSMTIC
+              CALL PLOTT7(T+FLOAT(I)*TDIST,Y,TFACT,YFACT,1,-7)
+              
+                 IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(T+FLOAT(I)*TDIST,y,0,0) 
+                    CALL PLOT(T+FLOAT(I)*TDIST,yacross,1,0)
+                    CALL PLOT(T+FLOAT(I)*TDIST,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+   20         CONTINUE
+          CALL TIME1(1,ITIME,2,' ',I3,ITIME3,1440.)
+          CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+	IF(IDAY3.EQ.1)THEN
+	   CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,IHVY)
+               
+                 IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                    CALL COLOR(color1)
+                    IF (dashed1) THEN
+                       CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(t+tic,y,0,0) 
+                    CALL PLOT(t+tic,yacross,1,0)
+                    CALL PLOT(t+tic,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+	ELSE
+	       CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,INML)
+
+              IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                 CALL COLOR(color2)
+                 IF (dashed2) THEN
+                    CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(t+tic,y,0,0) 
+                 CALL PLOT(t+tic,yacross,1,0)
+                 CALL PLOT(t+tic,Y,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+	ENDIF
+C         THE LABELS
+         CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+         IF(IDDB.EQ.0.OR.LABEL.EQ.0) GO TO 50
+         IF(IDAY.NE.IDDB*(IDAY/IDDB)) GO TO 50
+             CALL TIME2(ITIME,SYM)
+	READ(SYM,30) MON,DAY
+30	FORMAT(6X,A3,1X,A2,1X,A4)
+	IF(DAY(1:1).EQ.' ')THEN
+		NC=1
+		DAY=DAY(2:2)
+	ELSE
+		NC=2
+	ENDIF
+	IF(IABS(LABEL).EQ.1)THEN
+        TSYM=T+(TIC-SYMWID(CSIZE,NC,DAY)/TFACT)*.5
+        CALL SYMBEL(TSYM,YTEMP1,0.,CSIZE,NC,DAY)
+	ELSE
+	WRITE(SYM,40)MON,DAY
+40	FORMAT(A3,' ',A2)
+        TSYM=T+(TIC-SYMWID(CSIZE,6,SYM)/TFACT)*.5
+        CALL SYMBEL(TSYM,YTEMP1,0.,CSIZE,6,SYM)
+	ENDIF
+   50   CONTINUE
+          IF(IMDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 70
+              IF(IMON.EQ.IMON3) GO TO 70
+              IF(IMON.NE.IMDB*(IMON/IMDB)) GO TO 60
+C             ELSE:
+	IF(T-TMON.GT.4320./DT)THEN
+           CALL TIME2(ITIME,SYM)
+           READ(SYM,30)MON,DAY,YEAR
+           IF (monyrlab) THEN
+	      WRITE (buff, 100) mon, year
+ 100	      FORMAT (A3, ' ', A4)
+              TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,8,BUFF)/TFACT)*.5
+	      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,8,buff)
+	   ELSE
+              TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,3,MON)/TFACT)*.5
+	      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,3,MON)
+	   ENDIF
+	ENDIF
+   60         TMON=T+TIC
+   70     CONTINUE
+          ITIME=ITIME3
+          T=T+TIC
+c          IF(ITIME.LT.ITIME2) GO TO 10
+
+          IF(ITIME(13:14)//ITIME(1:12) .LT. 
+     .       ITIME2(13:14)//ITIME2(1:12) ) GO TO 10
+	     IF(IMDB.EQ.0) RETURN
+	     
+	IF(IABS(LABEL).EQ.1.AND.IMON.EQ.IMDB*(IMON/IMDB)
+     .	.AND.IDAY3.GE.4)THEN
+           CALL TIME2(ITIME,SYM)
+	   READ(SYM,30)MON,DAY, year
+           IF (monyrlab) THEN
+	      WRITE (buff, 100) mon, year
+              TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,8,BUFF)/TFACT)*.5
+	      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,8,buff)
+	   ELSE
+              TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,3,MON)/TFACT)*.5
+	      CALL SYMBEL(TSYM,YTEMP2,0.,1.5*CSIZE,3,MON)
+	   ENDIF
+     	ENDIF
+      RETURN
+      END
diff --git a/ppl/plotlib/taxis3.F b/ppl/plotlib/taxis3.F
new file mode 100644
index 0000000..8e234fe
--- /dev/null
+++ b/ppl/plotlib/taxis3.F
@@ -0,0 +1,462 @@
+      SUBROUTINE TAXIS3(TLO,ITIME1,ITIME2,DT,NDAY,LABEL,IMDB,IYDB,
+     1    TFACT,Y,YFACT,CSIZE,yacross,vgrat,vcolor,vline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAXIS3.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+
+
+* *jd* 11.21.95	Mod for 4 digit year
+* *jd* 11.29.95	Mod century axis
+* *jd* 2.8.96 Exclude consideration of seconds when comparing times and
+*		deciding whether to continue drawing time axis.  Ferret uses
+*		PPLLDX to compute time axis locations rather than the PPL
+*		TIME command.  It uses single precision reals which can be
+*		rounded.  Rounding can lead to the time axis being drawn too
+*		long.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* *sh* 9/99 - bug fix to "century axis" -- major tic interval (IYDB) may be
+*               equal to zero
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot.
+C *acm*  3/10  Bug 670 fixed: New flag MULTICENFLAG for multi-decade plots, 
+C              do not make small tics by default.
+
+
+C**
+C**    @(#)taxis3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE MONTH OF THE
+C     AND THE YEAR.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  770819000000)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  THE START OF A NEW MONTH.  (THAT IS THE LAST 6 DIGITS
+C                  MUST BE 0 AND THE 7'TH AND 8'TH DIGITS MUST BE 01)
+C         ITIME2 = END TIME (IE   770901000000)
+C                  THIS IS THE FIRST MONTH NOT TO BE PLOTTED, AND IT
+C                  MUST BE THE BEGINNING OF A NEW MONTH..
+C         DT = SAMPLING RATE IN MINUTES.
+C         NDAY = NUM OF DAYS BETWEN SMALL TICS.
+C                  IF NDAY = 2HWK THE TICS WILL BE OFFSET
+C                  TO CORRESPOND WITH THE START OF NEW WEEKS.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                      MAR         APR        MAY      JUN
+C                                      1980
+C         IABS(LABEL) = 2 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                     NOV 80     DEC 80      JAN 81    FEB 81
+C         IMDB = PRINT LABELS OF MONTHS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IMDB = 0) PRINT NO MONTH LABELS.
+C         IYDB = PRINT LABELS OF YEARS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IYDB = 0) PRINT NO YEAR LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW DAY LABELS.
+C                 YEAR LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C     THIS PROGRAM WAS FIRST WRITTEN BY DAVID MANDEL IN JULY 1980.
+C
+	CHARACTER ITIME1*(*),ITIME*14,ITIME2*(*),SYM*21,MON*3
+	CHARACTER CEN*2,YR*2,ITIME3*14
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+	LOGICAL*4 not_zero_size
+        include 'century.cmn'
+
+* Parameters for drawing tics across plot
+
+        REAL yacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        INTEGER ltic, color1, color2
+
+* TMAP interrupt flag
+	include 'xinterrupt.cmn'
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+
+	IF(ITIME1(5:10).NE.'010000')STOP ',1'
+	IF(ITIME2(5:10).NE.'010000')STOP ',2'
+
+C set up for plotting graticules across at tic marks
+        
+        solid1 = (vgrat(1,1).LT.0 .AND. vgrat(2,1).LT.0 .AND.  
+     .            vgrat(3,1).LT.0 .AND.  vgrat(4,1).LT.0 )
+        solid2 = (vgrat(1,2).LT.0 .AND. vgrat(2,2).LT.0 .AND.  
+     .            vgrat(3,2).LT.0 .AND.  vgrat(4,2).LT.0 )
+        dashed1 = (vgrat(1,1).GT.0 .OR. vgrat(2,1).GT.0 .OR.  
+     .            vgrat(3,1).GT.0 .OR.  vgrat(4,1).GT.0 )
+        dashed2 = (vgrat(1,2).GT.0 .OR. vgrat(2,2).GT.0 .OR.  
+     .            vgrat(3,2).GT.0 .OR.  vgrat(4,2).GT.0 )
+
+        color1 = vcolor(1)
+        color2 = vcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = vgrat(1,1)
+           dash1_2 = vgrat(2,1)
+           dash1_3 = vgrat(3,1)
+           dash1_4 = vgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = vgrat(1,2)
+           dash2_2 = vgrat(2,2)
+           dash2_3 = vgrat(3,2)
+           dash2_4 = vgrat(4,2)
+        ENDIF
+C
+C     SET PARAMETERS.
+
+*     *jd Number of arguments of TIME3 calls reduced to 6.  TIME3 uses only
+*     the first 6, 'seconds' are not handled.  Done for MAC 7.92
+
+
+	IF(LABEL+IX.EQ.0)THEN
+		YTEMP=0.0
+	ELSE
+		YTEMP=TLX*0.5
+	ENDIF
+	IF(IABS(LABEL).EQ.1)THEN
+	NC=3
+	ELSE IF(IABS(LABEL).EQ.3)THEN
+	NC=1
+	ELSE
+	NC=6
+	ENDIF
+	IF(NDAY.LT.0)THEN
+		IHVY=-8
+		INML=-7
+	ELSE
+		IHVY=-9
+		INML=-8
+	ENDIF
+
+	NOT_ZERO_SIZE = .NOT.(INML.EQ.-7.AND.TSMX.EQ.0)
+	IF (MULTICENFLAG) NOT_ZERO_SIZE = .FALSE.
+
+	IF(IMDB.NE.0)THEN
+	FIMDB=0.0
+	ELSE
+	FIMDB=-1.4
+	ENDIF
+      IF(LABEL.LT.0) THEN
+         YTEMP1=Y-(1.4*CSIZE+YTEMP)/YFACT
+         YTEMP2=Y-((4.0+FIMDB)*CSIZE+YTEMP)/YFACT
+	 IF (ix.EQ.1 .AND. ytemp.NE.0) ytemp1 = ytemp1 + tlx*0.4/YFACT
+	 IF (ix.EQ.1 .AND. ytemp.NE.0) ytemp2 = ytemp2 + tlx*0.4/YFACT
+      ELSE
+         YTEMP1=Y+(0.4*CSIZE+YTEMP)/YFACT
+         YTEMP2=Y+((2.5+FIMDB)*CSIZE+YTEMP)/YFACT
+	 IF (ix.EQ.1 .AND. ytemp.NE.0) ytemp1 = ytemp1 - tlx*0.4/YFACT
+	 IF (ix.EQ.1 .AND. ytemp.NE.0) ytemp2 = ytemp2 - tlx*0.4/YFACT
+      ENDIF
+
+      IF(LABEL.LT.0) THEN
+	 XTEMP1=X-(1.4*CSIZE+XTEMP)/XFACT
+	 XTEMP2=X-((4.0+FIMDB)*CSIZE+XTEMP)/XFACT
+	 IF (iy.EQ.1) xtemp1 = xtemp1 + iy*tly*0.4/xfact
+	 IF (iy.EQ.1) xtemp2 = xtemp2 + iy*tly*0.4/xfact
+      ELSE
+	 XTEMP1=X+(0.4*CSIZE+XTEMP)/XFACT
+	 XTEMP2=X+((2.5+FIMDB)*CSIZE+XTEMP)/XFACT
+	 IF (iy.EQ.1) xtemp1 = xtemp1 - iy*tly*0.4/xfact
+	 IF (iy.EQ.1) xtemp2 = xtemp2 - iy*tly*0.4/xfact
+      ENDIF
+
+      IF(LABEL.NE.0)XWID=(4.0+FIMDB)*CSIZE+YTEMP
+      T=TLO
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      TYR=T
+      CALL PLOT(TLO,Y,0,0)
+
+*       Century axis mod
+	IF (cenflag) THEN
+	   IF (IMON.NE.1) GOTO 10
+	   IF (IYDB .GT. 0) THEN
+	      IF (MOD(ICEN*100+IYR,IYDB).EQ.0) THEN
+	         CALL PLOTT7(TLO,Y,TFACT,YFACT,1,IHVY)
+	      ELSE
+	         IF(NOT_ZERO_SIZE) ! Don't plot zero length tic
+     .		   CALL PLOTT7(TLO,Y,TFACT,YFACT,1,INML)
+	      ENDIF
+           ENDIF
+	ELSE
+	   IF(IMON.EQ.1)THEN
+	      CALL PLOTT7(TLO,Y,TFACT,YFACT,1,IHVY)
+	   ELSE
+	      IF(NOT_ZERO_SIZE) ! Don't plot zero length tic
+     .		CALL PLOTT7(TLO,Y,TFACT,YFACT,1,INML)
+	   ENDIF
+	ENDIF
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      SECMON=FLOAT(NUMDM1(ITIME))*1440.
+
+C     LOOP:
+
+       ltic = 0
+  110  CONTINUE
+       CALL TIME1(1,ITIME,2,' ',I3,ITIME3,SECMON)
+       CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+       ITIME=ITIME3
+       SECMON=FLOAT(NUMDM1(ITIME))*1440.
+
+       IF( ITIME(13:14)// ITIME(1:10).LT.
+     .	     ITIME2(13:14)//ITIME2(1:10)) THEN
+           IF(IMON3.EQ.1) ltic = ltic + 1
+           GO TO 110
+       ENDIF
+
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+	IF (ltic .EQ. 0) THEN   
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+        ENDIF
+        
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+c ----
+
+C     LOOP:
+   10     CALL PLOT(T,Y,0,0)
+	  IF ( interrupted ) RETURN		! TMAP interrupt
+	SECMON=FLOAT(NUMDM1(ITIME))*1440.
+	TIC=SECMON/DT
+          CALL TIME1(1,ITIME,2,' ',I3,ITIME3,SECMON)
+          CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+*       Century axis mod
+	IF (cenflag) THEN
+	   IF (IMON3.NE.1) GOTO 11
+	
+	   IF (IYDB .GT. 0) THEN
+	      IF (MOD(ICEN3*100+IYR3,IYDB).EQ.0) THEN
+	         CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,IHVY)
+                 IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                    CALL COLOR(color1)
+                    IF (dashed1) THEN
+                       CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(t+tic,y,0,0) 
+                    CALL PLOT(t+tic,yacross,1,0)
+                    CALL PLOT(t+tic,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+	      ELSE
+	         IF(NOT_ZERO_SIZE) THEN
+     		   CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,INML) 
+                      IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                         CALL COLOR(color2)
+                         IF (dashed2) THEN
+                            CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                            CALL DASHES
+                         ENDIF
+                         CALL PLOT(T+TIC,y,0,0) 
+                         CALL PLOT(T+TIC,yacross,1,0)
+                         CALL PLOT(T+TIC*TDIST,Y,0,0) 
+                         CALL COLOR(1)
+                         CALL VECTRS
+                      ENDIF
+	      
+                 ENDIF
+              ENDIF
+          ENDIF
+	ELSE
+	   IF(IMON3.EQ.1)THEN
+	      CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,IHVY)
+              IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES 
+                 ENDIF
+                CALL PLOT(t+tic,y,0,0) 
+                 CALL PLOT(t+tic,yacross,1,0)
+                 CALL PLOT(t+tic,Y,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+	   ELSE
+	      IF(NOT_ZERO_SIZE) THEN
+                 CALL PLOTT7(T+TIC,Y,TFACT,YFACT,1,INML)
+                 IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(T+TIC,y,0,0) 
+                    CALL PLOT(T+TIC,yacross,1,0)
+                    CALL PLOT(T+TIC*TDIST,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+              ENDIF
+	   ENDIF
+	ENDIF
+
+C         THE LABELS
+11        CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+          IF(IMDB.EQ.0.OR.LABEL.EQ.0) GO TO 50
+          IF(IMON.NE.IMDB*(IMON/IMDB)) GO TO 50
+	  IF (cenflag) GOTO 50 ! No month labels for multiple years
+              CALL TIME2(ITIME,SYM)
+	READ(SYM,30)MON,CEN,YR
+30	FORMAT(6X,A3,4X,A2,A2)
+	WRITE(SYM,40)MON,YR
+   40         FORMAT(A3,' ',A2)
+        TSYM=T+(TIC-SYMWID(CSIZE,NC,SYM)/TFACT)*.5
+        CALL SYMBEL(TSYM,YTEMP1,0.,CSIZE,NC,SYM)
+   50     CONTINUE
+          IF(IYDB.EQ.0.OR.NC.EQ.6) GO TO 70
+              IF(IYR.EQ.IYR3) GO TO 70
+              IF((ICEN*100+IYR).NE.IYDB*((ICEN*100+IYR)/IYDB)) GO TO 60
+C             ELSE:
+	IF(T-TYR.GT.83333.33/DT)THEN
+                  CALL TIME2(ITIME,SYM)
+	READ(SYM,30)MON,CEN,YR
+	WRITE(SYM,55)CEN,YR
+   55             FORMAT(A2,A2)
+        TSYM=TYR+(T+TIC-TYR-SYMWID(1.4*CSIZE,4,SYM)/TFACT)*.5
+        CALL SYMBEL(TSYM,YTEMP2,0.,1.4*CSIZE,4,SYM)
+	ENDIF
+   60         TYR=T+TIC
+   70     CONTINUE
+          ITIME=ITIME3
+          T=T+TIC
+*** 2.8.96                       IF( ITIME(13:14)// ITIME(1:12).LT.
+*** Don't use seconds    .	     ITIME2(13:14)//ITIME2(1:12)) GO TO 10
+
+          IF( ITIME(13:14)// ITIME(1:10).LT.
+     .	     ITIME2(13:14)//ITIME2(1:10)) GO TO 10
+
+*     Draw complete time axis -- mods not to draw minor tics require it
+      CALL PLOT(TLO,Y,0,0)
+      CALL PLOT(T,Y,1,0)
+
+      IF(IYDB.EQ.0.OR.LABEL.EQ.0) GO TO 80
+C     ELSE:
+	IF(IABS(LABEL).NE.2.AND.IYR.EQ.IYDB*(IYR/IYDB)
+     .	.AND.IMON3.GE.4)THEN
+          CALL TIME2(ITIME,SYM)
+	READ(SYM,30)MON,CEN,YR
+	WRITE(SYM,55)CEN,YR
+        TSYM=TYR+(T-TYR-SYMWID(1.4*CSIZE,4,SYM)/TFACT)*.5
+        CALL SYMBEL(TSYM,YTEMP2,0.,1.4*CSIZE,4,SYM)
+	ENDIF
+C
+C     THE SECTION OF CODE THAT PUTS ON THE SMALL TIC MARKS.
+   80 	IF(NDAY.LE.0)RETURN
+	CALL TIME3(ITIME1,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	CALL TIME3(ITIME2,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+	IDELT=12*(IYR3-IYR)+IMON3-IMON
+	ITIME=ITIME1
+	TIC=NDAY*1440./DT
+	T1=TLO
+	DO 90 I=1,IDELT
+	T=T1
+	IDUDE=NUMDM1(ITIME)
+	NSTIC=IDUDE/NDAY
+	DO 100 J=1,NSTIC
+	T=T+TIC
+	CALL PLOT(T,Y,0,0)
+	CALL PLOTT7(T,Y,TFACT,YFACT,1,-7)
+C
+100	CONTINUE
+	IF(IMON.EQ.12)THEN
+	IYR=IYR+1
+	IMON=1
+	ELSE
+	IMON=IMON+1
+	ENDIF
+	WRITE(ITIME,999)IYR,IMON,IDAY,IMIN,ISEC
+999	FORMAT(5I2.2)
+	T1=T1+IDUDE*1440./DT
+90	CONTINUE
+      END
diff --git a/ppl/plotlib/tayis.F b/ppl/plotlib/tayis.F
new file mode 100644
index 0000000..32eb14b
--- /dev/null
+++ b/ppl/plotlib/tayis.F
@@ -0,0 +1,75 @@
+	SUBROUTINE TAYIS(IT,TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,
+     *	YF,XHI,XF,TCSIZE,xacross,hgrat,hcolor,hline)
+C** 
+C**    @(#)tayis.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 	Mod 11.27.95 For 4 digit years J Davison
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 03/04  new arguments for plotting graticule lines across plot. 
+C If graticule lines are to be drawn across the plot at the tics
+C then only do them for one horizontal and one vertical axis.  
+C The dash lines interfere with each other if drawn from both 
+C sides. HLINE and VLINE control this.
+
+        REAL xacross           ! to draw tic line across plot
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+
+	CHARACTER*(*) IT1,IT2
+	GOTO (10,20,20,30)IT+1
+10	CALL TAYIS0(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,YF,XHI,XF,TCSIZE,
+     .              xacross,hgrat,hcolor,hline)
+	RETURN
+20	CALL TAYIS1(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,YF,XHI,XF,TCSIZE,
+     .              xacross,hgrat,hcolor,hline)
+	RETURN
+30	CALL TAYIS3(TLO,IT1,IT2,DT,NMTCT,LTT,IFDB,ISDB,YF,XHI,XF,TCSIZE,
+     .              xacross,hgrat,hcolor,hline)
+	RETURN
+	END
diff --git a/ppl/plotlib/tayis0.F b/ppl/plotlib/tayis0.F
new file mode 100644
index 0000000..0c738a7
--- /dev/null
+++ b/ppl/plotlib/tayis0.F
@@ -0,0 +1,365 @@
+	SUBROUTINE TAYIS0(TLO,ITIME1,ITIME2,DT,NSMTIC,LABEL,IHDB,IDDB,
+     *	TFACT,X,XFACT,CSIZE,xacross,hgrat,hcolor,hline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAYIS0.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+* *sh*  - 8/11/89 FERRET 2.00 (modelled after TAXIS0 correction)
+*       - changed "mon" to "date" in calls to SYMWID and SYMBEL.
+*         "mon" is the wrong data type                          
+
+* *jd* Mod for 4 digit years 11.27.95
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 24/01/00 Y2k Bug --Put century at start when comparing 
+C                 ITIME to ITIME2 at loop 10
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot. 
+C V65  *acm*  1/10 New time-axis style for DAY and MONTH, DMY: adds the
+C                  year to DAY,MONTH or to MONTH.
+
+C**
+C**    @(#)tayis0.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE DAY OF THE M
+C     AND THE MONTH.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  7708190100)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  EVEN HOURS.  (THAT IS THE LAST 4 DIGITS OF ITIME1
+C                  MUST BE 0)
+C         ITIME2 = END TIME (IE   7709072300)
+C                  THIS IS THE FIRST HOUR NOT TO BE PLOTTED, AND IT
+C                  MUST BE AN EVEN HOUR.
+C         DT = SAMPLING RATE IN MINUTES.
+C         NSMTIC = NUMBER OF SMALL TICS TO MAKE EACH HOUR.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                       3           4          5        6
+C                                    JUN 7
+C         IHDB = PRINT LABELS OF HOURS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IHDB = 0) PRINT NO DAY LABELS.
+C         IDDB = PRINT LABELS OF DAYS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IDDB = 0) PRINT NO MONTH LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW HOUR LABELS.
+C                 DAY LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C
+C     THIS ROUTINE WAS FIRST WRITTEN BY DAVID MANDEL IN JULY 1980.
+C
+	CHARACTER ITIME3*14,DATE*6,BUFF*14,YEAR*4
+	CHARACTER ITIME*14,ITIME1*(*),ITIME2*(*),SYM*21
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+* Parameters for drawing tics across plot
+
+        REAL xacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        INTEGER ltic, color1, color2
+
+* TMAP interrupt flag
+
+	include 'xinterrupt.cmn'
+        include 'century.cmn'  ! with MONYRLAB flag
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+	IF(ITIME1(9:10).NE.'00')STOP ',1'
+	IF(ITIME2(9:10).NE.'00')STOP ',2'
+        IF(ITIME1(13:14)//ITIME1(1:12).GE.
+     .	   ITIME2(13:14)//ITIME2(1:12)) STOP',3'
+        
+        solid1 = (hgrat(1,1).LT.0 .AND. hgrat(2,1).LT.0 .AND.  
+     .            hgrat(3,1).LT.0 .AND.  hgrat(4,1).LT.0 )
+        solid2 = (hgrat(1,2).LT.0 .AND. hgrat(2,2).LT.0 .AND.  
+     .            hgrat(3,2).LT.0 .AND.  hgrat(4,2).LT.0 )
+        dashed1 = (hgrat(1,1).GT.0 .OR. hgrat(2,1).GT.0 .OR.  
+     .            hgrat(3,1).GT.0 .OR.  hgrat(4,1).GT.0 )
+        dashed2 = (hgrat(1,2).GT.0 .OR. hgrat(2,2).GT.0 .OR.  
+     .            hgrat(3,2).GT.0 .OR.  hgrat(4,2).GT.0 )
+
+        color1 = hcolor(1)
+        color2 = hcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = hgrat(1,1)
+           dash1_2 = hgrat(2,1)
+           dash1_3 = hgrat(3,1)
+           dash1_4 = hgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = hgrat(1,2)
+           dash2_2 = hgrat(2,2)
+           dash2_3 = hgrat(3,2)
+           dash2_4 = hgrat(4,2)
+        ENDIF
+C
+C     SET PARAMETERS.
+	TIC = 60./DT
+	NTIC = NSMTIC + 1
+	IF(NSMTIC.LT.0)THEN
+	    IHVY=-6
+	    INML=-5
+	ELSE
+	    IHVY=-10
+	    INML=-6
+	    TDIST = TIC/NTIC
+	ENDIF
+	IF(LABEL+IY.EQ.0)THEN
+	    XTEMP=0.0
+	ELSE
+	    XTEMP=TLY*0.5
+	ENDIF
+	IF(IHDB.NE.0)THEN
+	    FIHDB=0.0
+	ELSE
+	    FIHDB=-1.4
+	ENDIF
+	XTEMP1=X+LABEL*(0.9*CSIZE+XTEMP)/XFACT
+	IF(LABEL.LT.0) THEN
+	    XTEMP2=X-((4.0+FIHDB)*CSIZE+XTEMP)/XFACT
+	ELSE
+	    XTEMP2=X+((2.5+FIHDB)*CSIZE+XTEMP)/XFACT
+	ENDIF
+	IF(LABEL.NE.0)YWID=(4.0+FIHDB)*CSIZE+XTEMP
+	T=TLO
+	ITIME=ITIME1
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	TDAY=T
+	CALL PLOT(X,TLO,0,0)
+	IF(IHR.EQ.0)THEN
+	    CALL PLOTT7(X,TLO,XFACT,TFACT,1,IHVY)
+	ELSE
+	    CALL PLOTT7(X,TLO,XFACT,TFACT,1,INML)
+	ENDIF
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+	ITIME = ITIME3
+	IF(IABS(LABEL).NE.1.OR.IHR.NE.IHDB*(IHR/IHDB)) GO TO 11
+C      ELSE:
+	WRITE(SYM,80) IHR
+80	FORMAT(I2.2)
+	CALL SCINOT(XTEMP1,T,90.,CSIZE,2,SYM,0,WID,XFACT,TFACT)    
+ 11     CONTINUE
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+c Set itime1, itime3 as above
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+      ITIME = ITIME3
+
+C      LOOP:
+       ltic = 0
+  110  CONTINUE
+
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+	ITIME=ITIME3
+
+	IF(ITIME(13:14)//ITIME(1:12) .LE.
+     .       ITIME2(13:14)//ITIME2(1:12)) THEN
+           IF(IHR.EQ.0) ltic = ltic + 1
+           GO TO 110
+        ENDIF
+     
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+	IF (ltic .EQ. 0) THEN  
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+        ENDIF
+
+! Restore the state of ITIME, ITIME3
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+      ITIME = ITIME3
+c ----
+
+
+C      LOOP:
+10	CALL PLOT(X,T,0,0)
+	IF ( interrupted ) RETURN		! TMAP interrupt
+	DO 20 I=1,NSMTIC
+	CALL PLOTT7(X,T+FLOAT(I)*TDIST,XFACT,TFACT,1,-5)
+        
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,T+FLOAT(I)*TDIST,0,0) 
+                    CALL PLOT(xacross,T+FLOAT(I)*TDIST,1,0)
+                    CALL PLOT(x,T+FLOAT(I)*TDIST,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+20	CONTINUE
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	IF(IHR.EQ.0)THEN
+	    CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,IHVY)
+            
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL PLOT(xacross,t+tic,1,0)
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+	ELSE
+	    CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,INML)
+            
+                 IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                    CALL COLOR(color1)
+                    IF (dashed1) THEN
+                       CALL DASHSZ(dash1_1,dash2_1,dash1_3,dash1_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL PLOT(xacross,t+tic,1,0)
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+	ENDIF
+C         THE LABELS
+	IF(IHDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 50
+	IF(IHR.NE.IHDB*(IHR/IHDB)) GO TO 50
+	WRITE(SYM,80) IHR
+	CALL SCINOT(XTEMP1,T+TIC,90.,CSIZE,2,SYM,0,WID,XFACT,TFACT)
+50	CONTINUE
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,60.)
+	IF(IDDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 70
+	CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+	IF(IDAY.EQ.IDAY3) GO TO 70
+	IF(IDAY.NE.IDDB*(IDAY/IDDB))GO TO 60
+C             ELSE:
+	IF(T-TDAY.GT.180./DT)THEN
+	    CALL TIME2(ITIME,SYM)
+
+	   READ(SYM,55) DATE, YEAR
+55	   FORMAT(6X,A6,1X,A4)
+65         FORMAT(A6,1X,A4)
+           IF (MONYRLAB) THEN
+	      WRITE (BUFF, 65) DATE, YEAR
+              TSYM=TDAY+(T+TIC-TDAY-SYMWID(CSIZE,14,BUFF)/TFACT)*.5
+	      CALL SYMBEL(XTEMP2,TSYM,90.,CSIZE,14,BUFF)
+	   ELSE
+	      TSYM=TDAY+(T+TIC-TDAY-SYMWID(1.5*CSIZE,6,DATE)/TFACT)*.5
+	      CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,6,DATE)
+	   ENDIF
+
+	ENDIF
+60	TDAY=T+TIC
+70	CONTINUE
+	ITIME=ITIME3
+	T=T+TIC
+c	IF(ITIME.LE.ITIME2) GO TO 10
+        IF(ITIME(13:14)//ITIME(1:12) .LE.
+     .       ITIME2(13:14)//ITIME2(1:12)) GO TO 10
+	IF(IDDB.EQ.0) RETURN
+	IF(IABS(LABEL).EQ.1.AND.IDAY.EQ.IDDB*(IDAY/IDDB)
+     .	.AND.IHR3.GE.4)THEN
+	    CALL TIME2(ITIME,SYM)
+	    READ(SYM,55) DATE, YEAR
+* TMAP mod 8/11/89 *sh*                                 
+! original:  ("mon" --> "date")                           
+!	    TSYM=TDAY+(T-TDAY-SYMWID(1.5*CSIZE,6,MON)/TFACT)*.5
+!	    CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,6,MON)
+
+           IF (MONYRLAB) THEN
+	      WRITE (BUFF, 65) DATE, YEAR
+              TSYM=TDAY+(T-TDAY-SYMWID(CSIZE,14,BUFF)/TFACT)*.5
+	      CALL SYMBEL(XTEMP2,TSYM,90.,CSIZE,14,BUFF)
+	   ELSE
+	      TSYM=TDAY+(T-TDAY-SYMWID(1.5*CSIZE,6,DATE)/TFACT)*.5
+	      CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,6,DATE)
+	   ENDIF
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/plotlib/tayis1.F b/ppl/plotlib/tayis1.F
new file mode 100644
index 0000000..08c5fba
--- /dev/null
+++ b/ppl/plotlib/tayis1.F
@@ -0,0 +1,374 @@
+	SUBROUTINE TAYIS1(TLO,ITIME1,ITIME2,DT,NSMTIC,LABEL,IDDB,IMDB,
+     *	TFACT,X,XFACT,CSIZE,xacross,hgrat,hcolor,hline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAYIS1.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+C *acm* 1/24/00 Y2k Bug -- Put century at start  when comparing 
+C                 ITIME to ITIME2 at loop 10
+C *acm* 4/25/00 Further fix to the above - .LT. test rather than .LE.
+
+C
+* *jd* Mod for 4 digit years 11.27.95
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot. 
+C V65  *acm*  1/10 New time-axis style for DAY and MONTH, DMY: adds the
+C                  year to DAY,MONTH or to MONTH.
+C**
+C**    @(#)tayis1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE DAY OF THE M
+C     AND THE MONTH.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  7708190000)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  EVEN DAYS.  (THAT IS THE LAST 6 DIGITS OF ITIME1
+C                  MUST BE 0)
+C         ITIME2 = END TIME (IE   7709070000)
+C                  THIS IS THE FIRST DAY NOT TO BE PLOTTED, AND IT
+C                  MUST BE AN EVEN DAY.
+C         DT = SAMPLING RATE IN MINUTES.
+C         NSMTIC = NUMBER OF SMALL TICS TO MAKE EACH DAY.
+C                = 23 FOR HOURLY TICS.
+C                = 11 FOR BIHOURLY TICS.
+C                   ETC.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                       3           4          5        6
+C                                      JUN
+C         IABS(LABEL) = 2 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                     JUN  3     JUN  4      JUN  5    JUN  6
+C         IDDB = PRINT LABELS OF DAYS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IDDB = 0) PRINT NO DAY LABELS.
+C         IMDB = PRINT LABELS OF MONTHS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IMDB = 0) PRINT NO MONTH LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW DAY LABELS.
+C                 MONTH LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C     THERE WAS A MODIFICATION TO THIE IN JUNE 1980.  THE
+C     SOLE PURPOSE FOR THIS MODIFICATION WAS TO IMPROVE 'S
+C     EFFICIENCY.
+C
+	CHARACTER ITIME3*14
+	CHARACTER SYM*21,ITIME1*(*),ITIME*14,ITIME2*(*),MON*3,DAY*2,
+     .		  YEAR*4, BUFF*8
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+* Parameters for drawing tics across plot
+
+        REAL xacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        INTEGER ltic, color1, color2
+
+* TMAP interrupt flag
+
+	include 'xinterrupt.cmn'
+        include 'century.cmn'
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+	IF(ITIME1(7:10).NE.'0000')STOP ',1'
+	IF(ITIME2(7:10).NE.'0000')STOP ',2'
+
+C set up for plotting graticules across at tic marks
+        
+        solid1 = (hgrat(1,1).LT.0 .AND. hgrat(2,1).LT.0 .AND.  
+     .            hgrat(3,1).LT.0 .AND.  hgrat(4,1).LT.0 )
+        solid2 = (hgrat(1,2).LT.0 .AND. hgrat(2,2).LT.0 .AND.  
+     .            hgrat(3,2).LT.0 .AND.  hgrat(4,2).LT.0 )
+        dashed1 = (hgrat(1,1).GT.0 .OR. hgrat(2,1).GT.0 .OR.  
+     .            hgrat(3,1).GT.0 .OR.  hgrat(4,1).GT.0 )
+        dashed2 = (hgrat(1,2).GT.0 .OR. hgrat(2,2).GT.0 .OR.  
+     .            hgrat(3,2).GT.0 .OR.  hgrat(4,2).GT.0 )
+
+        color1 = hcolor(1)
+        color2 = hcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = hgrat(1,1)
+           dash1_2 = hgrat(2,1)
+           dash1_3 = hgrat(3,1)
+           dash1_4 = hgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = hgrat(1,2)
+           dash2_2 = hgrat(2,2)
+           dash2_3 = hgrat(3,2)
+           dash2_4 = hgrat(4,2)
+        ENDIF
+
+C     SET PARAMETERS.
+
+*     *jd Number of arguments of TIME3 calls reduced to 6.  TIME3 uses only
+*     the first 6, 'seconds' are not handled.  Done for MAC 7.92
+
+	TIC = 1440./DT
+	NTIC = NSMTIC + 1
+	IF(NSMTIC.LT.0)THEN
+	    IHVY=-6
+	    INML=-5
+	ELSE
+	    IHVY=-10
+	    INML=-6
+	    TDIST = TIC/NTIC
+	ENDIF
+	IF(LABEL+IY.EQ.0)THEN
+	    XTEMP=0.0
+	ELSE
+	    XTEMP=TLY*0.5
+	ENDIF
+	IF(IDDB.NE.0)THEN
+	    FIDDB=0.0
+	ELSE
+	    FIDDB=-1.4
+	ENDIF
+	IF(LABEL.LT.0) THEN
+	    XTEMP1=X-(1.4*CSIZE+XTEMP)/XFACT
+	    XTEMP2=X-((4.0+FIDDB)*CSIZE+XTEMP)/XFACT
+	ELSE
+* ... corrected tabulation error in next line *sh* 1/23/89
+	    XTEMP1=X+(0.4*CSIZE+XTEMP)/XFACT
+	    XTEMP2=X+((2.5+FIDDB)*CSIZE+XTEMP)/XFACT
+	ENDIF
+	IF(LABEL.NE.0)YWID=(4.0+FIDDB)*CSIZE+XTEMP
+
+
+	T=TLO
+	ITIME=ITIME1
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	TMON=T
+	CALL PLOT(X,TLO,0,0)
+	IF(IDAY.EQ.1)THEN
+	    CALL PLOTT7(X,TLO,XFACT,TFACT,1,IHVY)
+	ELSE
+	    CALL PLOTT7(X,TLO,XFACT,TFACT,1,INML)
+	ENDIF
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+C      LOOP like loop 10 below
+      ltic = 0
+  110 CONTINUE
+      IF ( interrupted ) RETURN		! TMAP interrupt
+      
+      CALL TIME1(1,ITIME,2,' ',I3,ITIME3,1440.)
+      CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+      ITIME=ITIME3
+      IF(ITIME(13:14)//ITIME(1:12) .LT. 
+     .       ITIME2(13:14)//ITIME2(1:12) ) THEN
+         IF (IDAY3.EQ.1) ltic = ltic + 1  !It is a large tic.
+         GO TO 110
+      ENDIF
+
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+	IF (ltic .EQ. 0) THEN   
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+        ENDIF
+c ----
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+C      LOOP:
+10	CALL PLOT(X,T,0,0)
+	IF ( interrupted ) RETURN		! TMAP interrupt
+	DO 20 I=1,NSMTIC
+	CALL PLOTT7(X,T+FLOAT(I)*TDIST,XFACT,TFACT,1,-5)
+        
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,T+FLOAT(I)*TDIST,0,0) 
+                    CALL PLOT(xacross,T+FLOAT(I)*TDIST,1,0)
+                    CALL PLOT(x,T+FLOAT(I)*TDIST,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+
+20	CONTINUE
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,1440.)
+	CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+	IF(IDAY3.EQ.1)THEN
+	    CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,IHVY)
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL PLOT(xacross,t+tic,1,0)
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+	ELSE
+	    CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,INML)
+
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL PLOT(xacross,t+tic,1,0)
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+	ENDIF
+C         THE LABELS
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	IF(IDDB.EQ.0.OR.LABEL.EQ.0) GO TO 50
+	IF(IDAY.NE.IDDB*(IDAY/IDDB)) GO TO 50
+	CALL TIME2(ITIME,SYM)
+	READ(SYM,30) MON,DAY
+30	FORMAT(6X,A3,1X,A2,1X,A4)
+	IF(DAY(1:1).EQ.' ')THEN
+	    NC=1
+	    DAY=DAY(2:2)
+	ELSE
+	    NC=2
+	ENDIF
+	IF(IABS(LABEL).EQ.1)THEN
+	    TSYM=T+(TIC-SYMWID(CSIZE,NC,DAY)/TFACT)*.5
+	    CALL SYMBEL(XTEMP1,TSYM,90.,CSIZE,NC,DAY)
+	ELSE
+	    WRITE(SYM,40)MON,DAY
+40	    FORMAT(A3,' ',A2)
+	    TSYM=T+(TIC-SYMWID(CSIZE,6,SYM)/TFACT)*.5
+	    CALL SYMBEL(XTEMP1,TSYM,90.,CSIZE,6,SYM)
+	ENDIF
+50	CONTINUE
+	IF(IMDB.EQ.0.OR.IABS(LABEL).NE.1) GO TO 70
+	IF(IMON.EQ.IMON3) GO TO 70
+	IF(IMON.NE.IMDB*(IMON/IMDB)) GO TO 60
+C             ELSE:
+	IF(T-TMON.GT.4320./DT)THEN
+	    CALL TIME2(ITIME,SYM)
+	    READ(SYM,30)MON,DAY, year
+            IF (monyrlab) THEN
+ 	       WRITE (buff, 100) mon, year
+ 100	       FORMAT (A3, ' ', A4)
+               TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,8,BUFF)/TFACT)*.5
+	       CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,8,buff)
+	    ELSE
+	       TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,3,MON)/TFACT)*.5
+	       CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,3,MON)
+            ENDIF
+	ENDIF
+60	TMON=T+TIC
+70	CONTINUE
+	ITIME=ITIME3
+	T=T+TIC
+c	IF(ITIME.LT.ITIME2) GO TO 10
+        IF(ITIME(13:14)//ITIME(1:12) .LT.
+     .       ITIME2(13:14)//ITIME2(1:12)) GO TO 10
+     
+	IF(IMDB.EQ.0) RETURN
+	IF(IABS(LABEL).EQ.1.AND.IMON.EQ.IMDB*(IMON/IMDB)
+     .	.AND.IDAY3.GE.4)THEN
+	    CALL TIME2(ITIME,SYM)
+	    READ(SYM,30)MON,DAY, year
+            IF (monyrlab) THEN
+ 	       WRITE (buff, 100) mon, year
+               TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,8,BUFF)/TFACT)*.5
+	       CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,8,buff)
+	    ELSE
+	       TSYM=TMON+(T+TIC-TMON-SYMWID(1.5*CSIZE,3,MON)/TFACT)*.5
+	       CALL SYMBEL(XTEMP2,TSYM,90.,1.5*CSIZE,3,MON)
+            ENDIF
+	ENDIF
+	RETURN
+	END
+
+	    
diff --git a/ppl/plotlib/tayis3.F b/ppl/plotlib/tayis3.F
new file mode 100644
index 0000000..1036a32
--- /dev/null
+++ b/ppl/plotlib/tayis3.F
@@ -0,0 +1,450 @@
+	SUBROUTINE TAYIS3(TLO,ITIME1,ITIME2,DT,NDAY,LABEL,IMDB,IYDB,
+     *	TFACT,X,XFACT,CSIZE,xacross,hgrat,hcolor,hline)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]TAYIS0.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+
+* *jd* Mod for 4 digit years 11.27.95
+* *jd* 11.29.95	Mod century axis
+* *jd* 2.8.96 Exclude consideration of seconds when comparing times and
+*		deciding whether to continue drawing time axis.  Ferret uses
+*		PPLLDX to compute time axis locations rather than the PPL
+*		TIME command.  It uses single precision reals which can be
+*		rounded.  Rounding can lead to the time axis being drawn too
+*		long.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C *acm* 03/04  new arguments and code for plotting graticule lines across plot. 
+C *acm*  3/10  Bug 670 fixed: New flag MULTICENFLAG for multi-decade plots, 
+C              do not make small tics by default.
+
+
+C**
+C**    @(#)tayis3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C     THIS ROUTINE PLOTS A TIME AXIS AND LABELS IT WITH THE MONTH OF THE
+C     AND THE YEAR.
+C     VARIBLES:
+C         TLO=X VALUE CORRESPONDING TO THE START TIME.
+C         ITIME1 = START TIME (IE.  770819000000)
+C                  WE RESTRICT THE PERMISSIBLE START TIMES TO BE
+C                  THE START OF A NEW MONTH.  (THAT IS THE LAST 6 DIGITS
+C                  MUST BE 0 AND THE 7'TH AND 8'TH DIGITS MUST BE 01)
+C         ITIME2 = END TIME (IE   770901000000)
+C                  THIS IS THE FIRST MONTH NOT TO BE PLOTTED, AND IT
+C                  MUST BE THE BEGINNING OF A NEW MONTH..
+C         DT = SAMPLING RATE IN MINUTES.
+C         NDAY = NUM OF DAYS BETWEN SMALL TICS.
+C                  IF NDAY = 2HWK THE TICS WILL BE OFFSET
+C                  TO CORRESPOND WITH THE START OF NEW WEEKS.
+C         LABEL > 0 IF LABELS ARE TO BE DRAWN ABOVE THE AXIS.
+C               = 0 IF NO LABELS ARE TO BE DRAWN.
+C               < 0 IF LABEL ARE TO BE DRAWN BELOW THE AXIS.
+C         IABS(LABEL) = 1 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                      MAR         APR        MAY      JUN
+C                                      1980
+C         IABS(LABEL) = 2 FOR LABELS OF THE STYLE
+C                  1..........1..........1..........1..........1
+C                     NOV 80     DEC 80      JAN 81    FEB 81
+C         IMDB = PRINT LABELS OF MONTHS DIVIBLE BY THIS NUMBER ONLY.
+C                IF(IMDB = 0) PRINT NO MONTH LABELS.
+C         IYDB = PRINT LABELS OF YEARS DIVISIBLE BY THIS NUMBER ONLY.
+C                IF(IYDB = 0) PRINT NO YEAR LABELS.
+C                THIS VARIBLE ONLY APPLYS WHEN IABS(LABEL) = 1
+C         TFACT = (LENGTH OF T AXIS IN INCHES)/(LENGTH OF T AXIS IN USER
+C         Y = Y COORDINATE OF TIME AXIS.
+C         YFACT = (LENGTH OF Y AXIS IN INCHES)/(LENGTH OF Y AXIS IN USER
+C         CSIZE = SIZE TO DRAW DAY LABELS.
+C                 YEAR LABELS WILL BE 1.5 TIMES AS LARGE.
+C
+C     THIS PROGRAM WAS FIRST WRITTEN BY DAVID MANDEL IN JULY 1980.
+C
+	CHARACTER ITIME1*(*),ITIME2*(*)
+	CHARACTER ITIME*14,SYM*21,MON*3
+	CHARACTER CEN*2,YR*2,ITIME3*14
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+	LOGICAL*4 not_zero_size
+        include 'century.cmn'
+        
+* Parameters for drawing tics across plot
+
+        REAL xacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid1, solid2   ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        INTEGER ltic, color1, color2
+
+* TMAP interrupt flag
+	include 'xinterrupt.cmn'
+
+C     CHECK THE PARAMETERS PASSED TO THE SUBROUTINE.
+	IF(ITIME1(5:10).NE.'010000')STOP ',1'
+	IF(ITIME2(5:10).NE.'010000')STOP ',2'
+        IF(ITIME1(13:14)//ITIME1(1:12).GE.
+     .	   ITIME2(13:14)//ITIME2(1:12)) STOP',3'
+
+C set up for plotting graticules across at tic marks
+
+        solid1 = (hgrat(1,1).LT.0 .AND. hgrat(2,1).LT.0 .AND.  
+     .            hgrat(3,1).LT.0 .AND.  hgrat(4,1).LT.0 )
+        solid2 = (hgrat(1,2).LT.0 .AND. hgrat(2,2).LT.0 .AND.  
+     .            hgrat(3,2).LT.0 .AND.  hgrat(4,2).LT.0 )
+        dashed1 = (hgrat(1,1).GT.0 .OR. hgrat(2,1).GT.0 .OR.  
+     .            hgrat(3,1).GT.0 .OR.  hgrat(4,1).GT.0 )
+        dashed2 = (hgrat(1,2).GT.0 .OR. hgrat(2,2).GT.0 .OR.  
+     .            hgrat(3,2).GT.0 .OR.  hgrat(4,2).GT.0 )
+
+        color1 = hcolor(1)
+        color2 = hcolor(2)
+
+        IF (dashed1) THEN
+           dash1_1 = hgrat(1,1)
+           dash1_2 = hgrat(2,1)
+           dash1_3 = hgrat(3,1)
+           dash1_4 = hgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = hgrat(1,2)
+           dash2_2 = hgrat(2,2)
+           dash2_3 = hgrat(3,2)
+           dash2_4 = hgrat(4,2)
+        ENDIF
+
+C     SET PARAMETERS.
+
+*     *jd Number of arguments of TIME3 calls reduced to 6.  TIME3 uses only
+*     the first 6, 'seconds' are not handled.  Done for MAC 7.92
+
+	IF(LABEL+IY.EQ.0)THEN
+	    XTEMP=0.0
+	ELSE
+	    XTEMP=TLY*0.5
+	ENDIF
+	IF(IABS(LABEL).EQ.1)THEN
+	    NC=3
+	ELSE IF(IABS(LABEL).EQ.3)THEN
+	    NC=1
+	ELSE
+	    NC=6
+	ENDIF
+	IF(NDAY.LT.0)THEN
+	    IHVY=-6
+ 	    INML=-5
+	ELSE
+	    IHVY=-10
+	    INML=-6
+	ENDIF
+
+	NOT_ZERO_SIZE = .NOT.(INML.EQ.-5.AND.TSMY.EQ.0)
+	IF (MULTICENFLAG) NOT_ZERO_SIZE = .FALSE.
+
+	IF(IMDB.NE.0)THEN
+	    FIMDB=0.0
+	ELSE
+	    FIMDB=-1.4
+	ENDIF
+	IF(LABEL.LT.0) THEN
+	    XTEMP1=X-(1.4*CSIZE+XTEMP)/XFACT
+	    XTEMP2=X-((4.0+FIMDB)*CSIZE+XTEMP)/XFACT
+	    IF (iy.eq.1) xtemp1 = xtemp1 + tly*0.4/xfact
+	    IF (iy.eq.1) xtemp2 = xtemp2 + tly*0.4/xfact
+	ELSE
+	    XTEMP1=X+(0.4*CSIZE+XTEMP)/XFACT
+	    XTEMP2=X+((2.5+FIMDB)*CSIZE+XTEMP)/XFACT
+	    IF (iy.eq.1) xtemp1 = xtemp1 - tly*0.4/xfact
+	    IF (iy.eq.1) xtemp2 = xtemp2 - tly*0.4/xfact
+	ENDIF
+	IF(LABEL.NE.0)YWID=(4.0+FIMDB)*CSIZE+XTEMP
+	T=TLO
+	ITIME=ITIME1
+	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	TYR=T
+	CALL PLOT(X,TLO,0,0)
+
+*       Century axis mod
+	IF (cenflag) THEN
+	   IF (IMON.NE.1) GOTO 10
+	
+	   IF (MOD(ICEN*100+IYR,IYDB).EQ.0) THEN
+	      CALL PLOTT7(X,TLO,XFACT,TFACT,1,IHVY)
+	   ELSE
+	      IF(NOT_ZERO_SIZE) ! Don't plot zero length tic
+     .		CALL PLOTT7(X,TLO,XFACT,TFACT,1,INML)
+	   ENDIF
+	ELSE
+	   IF(IMON.EQ.1)THEN
+	      CALL PLOTT7(X,TLO,XFACT,TFACT,1,IHVY)
+	   ELSE
+	      IF(NOT_ZERO_SIZE) ! Don't plot zero length tic
+     .		CALL PLOTT7(X,TLO,XFACT,TFACT,1,INML)
+	   ENDIF
+	ENDIF
+
+c ----  count number of large tics. If no large tics will be drawn
+c ----  then will want to draw graticule lines at the small ones.
+
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      SECMON=FLOAT(NUMDM1(ITIME))*1440.
+
+C     LOOP:
+
+       ltic = 0
+  110  CONTINUE
+       CALL TIME1(1,ITIME,2,' ',I3,ITIME3,SECMON)
+       CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+       ITIME=ITIME3
+       SECMON=FLOAT(NUMDM1(ITIME))*1440.
+
+       IF( ITIME(13:14)// ITIME(1:10).LT.
+     .	     ITIME2(13:14)//ITIME2(1:10)) THEN
+           IF(IMON3.EQ.1) ltic = ltic + 1
+           GO TO 110
+       ENDIF
+
+! IF no large tics, and if graticules at just the large tics were
+! requested, then plot graticules at the small tics
+
+	IF (ltic .EQ. 0) THEN   
+           IF ( (.NOT.solid2) .AND. (solid1) ) THEN
+              solid2 = solid1
+              color2 = color1
+           ENDIF
+           IF ( (.NOT.dashed2) .AND. (dashed1) ) THEN 
+              dashed2 = dashed1
+              dash2_1 = dash1_1
+              dash2_2 = dash1_2
+              dash2_3 = dash1_3
+              dash2_4 = dash1_4
+              color2 = color1
+           ENDIF
+        ENDIF
+        
+      ITIME=ITIME1
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+
+c ----
+
+C     LOOP:
+10	CALL PLOT(X,T,0,0)
+	IF ( interrupted ) RETURN		! TMAP interrupt
+	SECMON=FLOAT(NUMDM1(ITIME))*1440.
+	TIC=SECMON/DT
+	CALL TIME1(1,ITIME,2,' ',I3,ITIME3,SECMON)
+	CALL TIME3(ITIME3,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+
+*       Century axis mod
+	IF (cenflag) THEN
+	   IF (IMON3.NE.1) GOTO 11
+	
+	   IF (MOD(ICEN3*100+IYR3,IYDB).EQ.0) THEN
+	      CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,IHVY)
+
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL PLOT(xacross,t+tic,1,0)
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+	   ELSE
+	      IF(NOT_ZERO_SIZE) THEN ! Don't plot zero length tic
+      	         CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,INML)
+
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL PLOT(xacross,t+tic,1,0)
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+              ENDIF
+	   ENDIF
+	ELSE
+	   IF(IMON3.EQ.1)THEN
+	      CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,IHVY)
+
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 CALL COLOR(color1)
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL PLOT(xacross,t+tic,1,0)
+                 CALL PLOT(x,t+tic,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+	   ELSE
+	      IF(NOT_ZERO_SIZE) THEN  ! Don't plot zero length tic
+     		CALL PLOTT7(X,T+TIC,XFACT,TFACT,1,INML)
+     
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                    CALL COLOR(color2)
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL PLOT(xacross,t+tic,1,0)
+                    CALL PLOT(x,t+tic,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+              ENDIF
+
+	   ENDIF
+	ENDIF
+
+C         THE LABELS
+11	CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	IF(IMDB.EQ.0.OR.LABEL.EQ.0) GO TO 50
+	IF(IMON.NE.IMDB*(IMON/IMDB)) GO TO 50
+ 	IF (cenflag) GOTO 50 ! No month labels for multiple years
+
+	CALL TIME2(ITIME,SYM)
+	READ(SYM,30)MON,CEN,YR
+30	FORMAT(6X,A3,4X,A2,A2)
+	WRITE(SYM,40)MON,YR
+40	FORMAT(A3,' ',A2)
+        TSYM=T+(TIC-SYMWID(CSIZE,NC,SYM)/TFACT)*.5
+        CALL SYMBEL(XTEMP1,TSYM,90.,CSIZE,NC,SYM)
+50	CONTINUE
+	IF(IYDB.EQ.0.OR.NC.EQ.6) GO TO 70
+	IF(IYR.EQ.IYR3) GO TO 70
+	IF((ICEN*100+IYR).NE.IYDB*((ICEN*100+IYR)/IYDB)) GO TO 60
+C             ELSE:
+	IF(T-TYR.GT.83333.33/DT)THEN
+	    CALL TIME2(ITIME,SYM)
+	    READ(SYM,30)MON,CEN,YR
+	    WRITE(SYM,55)CEN,YR
+55	    FORMAT(A2,A2)
+	    TSYM=TYR+(T+TIC-TYR-SYMWID(1.4*CSIZE,4,SYM)/TFACT)*.5
+	    CALL SYMBEL(XTEMP2,TSYM,90.,1.4*CSIZE,4,SYM)
+	ENDIF
+60	TYR=T+TIC
+70	CONTINUE
+	ITIME=ITIME3
+	T=T+TIC
+
+*** 2.8.96                       IF( ITIME(13:14)// ITIME(1:12).LT.
+*** Don't use seconds    .	     ITIME2(13:14)//ITIME2(1:12)) GO TO 10
+
+          IF( ITIME(13:14)// ITIME(1:10).LT.
+     .	     ITIME2(13:14)//ITIME2(1:10)) GO TO 10
+
+*     Draw complete time axis -- mods not to draw minor tics require it
+      CALL PLOT(X,TLO,0,0)
+      CALL PLOT(X,T,1,0)
+
+	IF(IYDB.EQ.0.OR.LABEL.EQ.0) GO TO 80
+C     ELSE:
+	IF(IABS(LABEL).NE.2.AND.IYR.EQ.IYDB*(IYR/IYDB)
+     .	.AND.IMON3.GE.4)THEN
+	    CALL TIME2(ITIME,SYM)
+	    READ(SYM,30)MON,CEN,YR
+	    WRITE(SYM,55)CEN,YR
+	    TSYM=TYR+(T-TYR-SYMWID(1.4*CSIZE,4,SYM)/TFACT)*.5
+	    CALL SYMBEL(XTEMP2,TSYM,90.,1.4*CSIZE,4,SYM)
+	ENDIF
+C
+C     THE SECTION OF CODE THAT PUTS ON THE SMALL TIC MARKS.
+80	IF(NDAY.LE.0)RETURN
+	CALL TIME3(ITIME1,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+	CALL TIME3(ITIME2,IYR3,IMON3,IDAY3,IHR3,IMIN3,ISEC3,ICEN3)
+	IDELT=12*(IYR3-IYR)+IMON3-IMON
+	ITIME=ITIME1
+	TIC=NDAY*1440./DT
+	T1=TLO
+	DO 90 I=1,IDELT
+	T=T1
+	IDUDE=NUMDM1(ITIME)
+	NSTIC=IDUDE/NDAY
+	DO 100 J=1,NSTIC
+	T=T+TIC
+	CALL PLOT(X,T,0,0)
+	CALL PLOTT7(X,T,XFACT,TFACT,1,-5)
+C
+100	CONTINUE
+	IF(IMON.EQ.12)THEN
+	    IYR=IYR+1
+	    IMON=1
+	ELSE
+	    IMON=IMON+1
+	ENDIF
+	WRITE(ITIME,999)IYR,IMON,IDAY,IMIN,ISEC
+999	FORMAT(5I2.2)
+	T1=T1+IDUDE*1440./DT
+90	CONTINUE
+	END
diff --git a/ppl/plotlib/time1.F b/ppl/plotlib/time1.F
new file mode 100644
index 0000000..af7f650
--- /dev/null
+++ b/ppl/plotlib/time1.F
@@ -0,0 +1,146 @@
+      SUBROUTINE TIME1(I1,ITIME1,I2,ITIME2,I3,ITIME3,DT)               
+C start of FERRET mod
+C given a time, itime1, in WHOI format (ie, a date) and its corresponding time
+C step value, i1 - compute either the date (itime3)  corresponding to another
+C time step (i2) or the time step (i3) corresponding to another date (itime2)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* note DAYJ is not included in this module although it is in the TIME1.FOR file
+* from PPLUS :
+C	Directory PMEL:[PLOT5.LIBRARY.MILELIB]
+C	TIME1.FOR;2               5   2-FEB-1985 10:13 
+C search for "FERRET" to find all revisions
+C *sh* 9/23/88 - rev 1.0 for FERRET 1.10+
+C - eliminated JDAY and DAYJ which convert dates to and from minutes since
+C	  1970 ("J"="JULIAN") in favor of WHOI2BC and BC2WHOI based on Jan.1, 0
+C	  to work around JDAY bug with the year "00"
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C explicit declarations:
+      INTEGER		i1, i2, i3
+      INTEGER		iyr, imon, iday, ihr, imin
+      REAL		dt
+      REAL*8		WHOI2BC, t1, t2
+      CHARACTER*14      BC2WHOI
+C end of FERRET mods 9-22-88
+
+*	Mod J Davison 11.21.95 For 4 digit year
+
+                                           
+C     THIS ROUTINE DOES TIME CALCULATIONS.                             
+C         I1 = NUMBER OF A POINT IN OUR SERIES FOR WHICH THE TIME      
+C              OF OCCURRENCE OS KNOWN.                                 
+C         ITIME1 = THE KNOWN TIME OF OCCURRENCE IN WOODSHOLE FORMAT.   
+C         I2,ITIME2 = CONTROL VARIBLES.                                
+C             ONE OF THESE MUST BE 0.  THE OTHER MUST BE >= TO THE     
+C             THE CORRESPONDING 1 VARIBLE.  IF I2>0 I3=I2 AND          
+C             ITIME3= TIME PT I2 OCCURS.  IF ITIME2 .NE.0, I2=0,I3     
+C             =POINT TIME ITIME2 OCCURS, AND ITIME3 = EXACT TIME POINT 
+C             I3 OCCURS.                                               
+C         DT = SAMPLING RATE IN SECONDS.                               
+                                                                      
+C     THIS PROGRAM WAS MODIFIFIED IN JUNE,1980.  AT THAT TIME WE       
+C     TRYED TO IMPROVE THE EFFICIENCY OF THIS PROGRAM.                 
+                                                                      
+C     SETTING DEFAULTS.                                                
+      INTEGER*4 JTIME1,JT,JTIME2,JDAY
+      CHARACTER*(*) ITIME1,ITIME2,ITIME3
+      CHARACTER*14 ITIME
+
+C	FIND POINT AT WHICH ITIME2 OCCURS
+
+      IF(I2.EQ.0)THEN
+      CALL  TIME3(ITIME1,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      JTIME1=JDAY(IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      CALL TIME3(ITIME2,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      JTIME2=JDAY(IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)
+      I3=FLOAT(JTIME2-JTIME1)/DT+.5
+#ifdef unix
+      JTIME2=INT(FLOAT(I3)*DT)+JTIME1
+#else
+      JTIME2=JINT(FLOAT(I3)*DT)+JTIME1
+#endif
+      I3=I3+I1
+      CALL  DAYJ(JTIME2,IYR,IMON,IDAY,IHR,IMIN)
+      WRITE(ITIME3,999)IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN
+      ELSE
+30	I3=I2
+
+C	FIND ITIME3 BY POINT I2.
+
+C FERRET mod 9/23/88 *sh*
+C original code:
+C	CALL TIME3(ITIME1,IYR,IMON,IDAY,IHR,IMIN)
+C	JTIME1=JDAY(IYR,IMON,IDAY,IHR,IMIN)
+C	JTIME2=JTIME1+JINT(FLOAT(I3-I1)*DT)
+C	CALL DAYJ(JTIME2,IYR,IMON,IDAY,IHR,IMIN)
+C	WRITE(ITIME3,999)IYR,IMON,IDAY,IHR,IMIN
+C new code:
+        T1     = WHOI2BC( itime1 )
+        T2     = T1 + DBLE( (I3-I1) * DT )
+        ITIME3 = BC2WHOI( T2 )
+C end of FERRET mod 9/23/88 *sh*
+999	FORMAT(7I2.2)
+      ENDIF
+      RETURN
+      END
+
+*     *jd* 3.11.92 added subroutine DAYJ from plotlib/time1.f
+*     To prevent linking warnings 
+        SUBROUTINE DAYJ(JDAY,IY,IMN,ID,IH,IM)
+        INTEGER*4 JDAY,JDN
+        JDN=JDAY/1440
+        IY=INT((JDN-122.1)/365.25)
+#ifdef unix
+        IMN=INT((JDN-INT(365.25*IY))/30.6001)
+        ID=JDN-INT(365.25*IY)-INT(30.6001*IMN)
+#else
+        IMN=INT((JDN-JINT(365.25*IY))/30.6001)
+        ID=JDN-JINT(365.25*IY)-JINT(30.6001*IMN)
+#endif
+        IF(IMN.LT.14)THEN
+        IMN=IMN-1
+        ELSE
+        IMN=IMN-13
+        IY=IY+1
+        ENDIF
+        LEFT=JDAY-(JDAY/1440)*1440
+        IH=(LEFT/60)
+        IM=LEFT-60*IH
+        RETURN
+        END
+
+
diff --git a/ppl/plotlib/time2.F b/ppl/plotlib/time2.F
new file mode 100644
index 0000000..88368b0
--- /dev/null
+++ b/ppl/plotlib/time2.F
@@ -0,0 +1,81 @@
+      SUBROUTINE TIME2(ITIME,SYM)
+C** 
+C**    @(#)time2.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mod 11.20.95 J Davison to accommodate 4 digit year, and seconds
+*       J Davison 10.15.99   Modified to support multiple calendars.
+* V530 1/01 *acm* split calendar.cmn into .cmn and .decl
+
+      CHARACTER ITIME*(*),SYM*(*)
+C                                                                        
+
+#ifdef unix
+        include 'calendar.decl' 
+        include 'calendar.cmn'
+#else
+        INCLUDE 'TMAP_PPLV11INC:CALENDAR.CMN'
+#endif
+
+
+C     THIS ROUTINE TRANSLATES enhanced WOODSHOLE FORMATTED TIME
+C     INTO A PLOTABLE TYPE FORMAT.                                       
+C         IE.  77081904590118 BECOMES 4:59:01 AUG 19, 1877
+C     IN THE GREGORIAN CALENDAR, WHERE MONTH 8 IS 'AUG'. THE VALUES OF
+C     MONTH_NAMES IN THE CURRENT CALENDAR DETERMINES THE MONTH NAMES.
+C                                                                        
+
+**************************************************************************
+
+      CALL TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)                   
+
+*     WRITE(SYM,40) IHR,IMIN,ISEC,MONTH_NAMES(IMON),IDAY,ICEN,IYR         
+*  40 FORMAT(I2,':',I2.2,':',I2.2,' ',A3,' ',I2,',', I2.2, I2.2)
+ 
+      WRITE(SYM,40) IHR,IMIN,MONTH_NAMES(IMON),IDAY,ICEN,IYR         
+
+   40 FORMAT(I2,':',I2.2,' ',A3,' ',I2,',', I2.2, I2.2)
+      RETURN                                                             
+      END                                                                
diff --git a/ppl/plotlib/time3.F b/ppl/plotlib/time3.F
new file mode 100644
index 0000000..e04b8e8
--- /dev/null
+++ b/ppl/plotlib/time3.F
@@ -0,0 +1,61 @@
+      SUBROUTINE TIME3(ITIME,IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN)              
+C** 
+C**    @(#)time3.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Mod 11.20.95 J Davison to accommodate 4 digit year, and seconds
+
+
+C                                                                        
+C     THIS ROUTINE TAKES A GIVEN TIME IN WOODSHOLE FORMAT                
+C     AND BREAKS IT IN TO THE SECOND, MIN, HOUR, DAY, MONTH,             
+C     AND YEAR.                                                          
+C                                                                        
+	CHARACTER ITIME*(*)
+	READ(ITIME,'(7I2)') IYR,IMON,IDAY,IHR,IMIN,ISEC,ICEN
+
+      RETURN                                                             
+C**  THIS PROGRAM VALID ON FTN4 AND FTN5 **                              
+      END                                                                
diff --git a/ppl/plotlib/xaxis1.F b/ppl/plotlib/xaxis1.F
new file mode 100644
index 0000000..2bfe7df
--- /dev/null
+++ b/ppl/plotlib/xaxis1.F
@@ -0,0 +1,211 @@
+      SUBROUTINE XAXIS1(XLO,XHI,XTIC,NSMTCX,LINTX,XUNIT,LABEL,
+     *    IFORMT,XFACT,Y,YFACT,CSIZE,yacross,xdms,vgrat,vcolor,
+     *    vline, xvaloff)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]XAXIS1.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+*	*jd* 5.6.96 Fix axis labelling bug where roundoff at zero results 
+*			in small non-zero values
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+C *acm* 11/05  new argument to scinot deg/min/sec labels
+C        1/06  xvaloff,yvaloff add this amount to each x or y axis label. 
+C              (axis data was read as double precision and converted to single 
+C              after applying an offset.)
+
+C**
+C**    @(#)xaxis1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+
+        INTEGER xdms
+* Parameters for drawing tics across plot
+
+        REAL yacross, dash1, dash2,dash3,dash4, xvaloff
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid          ! solid lines across at tics
+        LOGICAL dashed         ! dashed lines across at tics
+	CHARACTER IFORMT*(*),XLAB*20
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+	parameter (epsilon = 1.e-6)
+
+
+* TMAP interrupt flag
+#ifdef unix
+	include 'xinterrupt.cmn'
+#else
+	INCLUDE 'tmap_pplv11inc:tmap_xinterrupt.cmn'
+#endif
+
+C     THIS ROUTINE DRAWS AN X AXIS.  IT LABELS THE AXIS BELOW
+C     IF LABEL=-1, ABOVE IF LABEL=1, AND NOT AT ALL
+C     IF LABEL=0.  IF LABEL.NE.0 IFORMT TELLS US WHAT FORMAT TO WRITE
+C     THE LABEL IN.  SEE NCHAR PARAMETER IN COMPLOT DOCUMENTATION
+C     FOR THE SUBROUTINE NUMBER FOR AN EXPLANATION OF THIS.
+C     MODIFICATION OF JULY 29,1979.
+C     WE HAVE CHANGED THE MEANING OF IFORMT.
+C     USE -10<=IFORMT<=+10 AS BEFORE OR BETTER YET:
+C     USE IFORMT = 10H(I7*BALL*)
+C                 = 7H(F10.2)  FOR EXAMPLE
+C     IN THIS OPTION OUR SUBROUTINE RECONIZES AN I FORMAT BY USING
+C     THE FACT THAT THE FIRST TWO CHARACTERS OF IFORMT ARE "(I".
+C     IN FACT IF YOU DIMENSION IFORMT IN THE CALLING PROGRAM YOU
+C     CAN EVEN USE FORMAT STATEMENTS THAT ARE LONGER THAN 10 CHARACTERS.
+C     HOWEVER, THE PRINTED LABEL MUST BE <=20 CHARACTERS.
+C
+CCC
+CCC     THE FOLLOWING SECTION OF CODE MAKES THIS ROUTINE UPWARD COMPATIABLE.
+        ABSSZ=ABS(CSIZE)
+        SIGSZ=SIGN(1.,CSIZE)
+C
+C	DRAW AXIS
+C
+	DIR=SIGN(1.,XTIC)
+	XT=INT(XLO/XTIC+SIGN(0.000001,DIR*XLO))*XTIC
+	IF(DIR*XT.LT.DIR*XLO)XT=XT+XTIC
+	ISTOP=IFIX((XHI-XT)/XTIC+0.000001)
+	CALL PLOT(XT,Y,0,0)
+	CALL SMX1(XT,XLO,-XTIC,NSMTCX,XFACT,YFACT,Y,
+     *    yacross,vgrat,vcolor,vline)
+	CALL PLOT(XLO,Y,1,0)
+	CALL PLOTT7(XT,Y,XFACT,YFACT,1,-8)
+	X=XT
+        
+        solid = (vgrat(1,1).LT.0 .AND. vgrat(2,1).LT.0 .AND.  
+     .            vgrat(3,1).LT.0 .AND.  vgrat(4,1).LT.0 )
+        dashed = (vgrat(1,1).GT.0 .OR. vgrat(2,1).GT.0 .OR.  
+     .            vgrat(3,1).GT.0 .OR.  vgrat(4,1).GT.0 )
+        IF (dashed) THEN
+           dash1 = vgrat(1,1)
+           dash2 = vgrat(2,1)
+           dash3 = vgrat(3,1)
+           dash4 = vgrat(4,1)
+        ENDIF
+
+	DO 100 I=1,ISTOP
+	IF ( interrupted ) RETURN		! TMAP interrupt
+	CALL SMX1(X,XHI,XTIC,NSMTCX,XFACT,YFACT,Y,
+     *    yacross,vgrat,vcolor,vline)
+        IF ((solid.OR.dashed) .AND. vline) THEN ! make line across
+           CALL COLOR(vcolor(1))
+           IF (dashed) THEN
+              CALL DASHSZ(dash1,dash2,dash3,dash4)
+              CALL DASHES
+           ENDIF
+           CALL PLOT(X,Y,0,0) 
+           CALL PLOT(X,yacross,1,0)
+           CALL PLOT(X,Y,0,0) 
+           CALL COLOR(1)
+           CALL VECTRS
+        ENDIF
+
+	X=X+XTIC
+	CALL PLOTT7(X,Y,XFACT,YFACT,1,-8)
+100	CONTINUE
+	CALL SMX1(X,XHI,XTIC,NSMTCX,XFACT,YFACT,Y,
+     *    yacross,vgrat,vcolor,vline)
+        
+        IF ((solid.OR.dashed) .AND. vline) THEN ! make line across
+           CALL COLOR(vcolor(1))
+           IF (dashed) THEN
+              CALL DASHSZ(dash1,dash2,dash3,dash4)
+              CALL DASHES
+           ENDIF
+           CALL PLOT(X,Y,0,0) 
+           CALL PLOT(X,yacross,1,0)
+           CALL PLOT(X,Y,0,0) 
+           CALL COLOR(1)
+           CALL VECTRS
+        ENDIF
+
+	CALL PLOT(XHI,Y,1,0)
+           
+C
+C	DRAW LABELS
+C
+	IF(LABEL.EQ.0)RETURN
+	IF(LABEL+IX.EQ.0)THEN
+		YTEMP=0.0
+	ELSE
+		YTEMP=TLX*0.5
+	ENDIF
+	XWID=1.9*ABSSZ+YTEMP
+	YTEMP=Y+LABEL*(1.40*ABSSZ+YTEMP)/YFACT
+	IF(DIR*XLO.LE.0.AND.DIR*XHI.GE.0)THEN
+		X=INT(XLO/(XTIC*LINTX)-0.000001)*XTIC*LINTX
+	ELSE
+		X=XT
+	ENDIF
+	ISTOP=INT((XHI-X)/(XTIC*LINTX)+0.000001)
+
+	x0 = x
+	DO 200 I=0,ISTOP
+	IF ( interrupted ) RETURN		! TMAP interrupt
+        TEMP=SIGSZ*X/XUNIT
+        IF (xvaloff .EQ. 0) THEN
+          CALL NUMCDE(TEMP,XLAB,NC,IFORMT,xdms)
+        ELSE
+          CALL NUMCDE_OFF (TEMP,XLAB,NC,IFORMT,xdms,xvaloff)
+        ENDIF
+        CALL SCINOT(X,YTEMP,0.,ABSSZ,NC,XLAB,0,WID,XFACT,YFACT)
+
+CC	Original code
+CC	X=X+XTIC*LINTX
+
+	X=x0+XTIC*LINTX*(i+1)
+	if (abs(x) .lt. epsilon*abs(x0)) x = 0.0
+
+200	CONTINUE
+	RETURN
+	END
diff --git a/ppl/plotlib/xaxis2.F b/ppl/plotlib/xaxis2.F
new file mode 100644
index 0000000..bf0f66d
--- /dev/null
+++ b/ppl/plotlib/xaxis2.F
@@ -0,0 +1,261 @@
+      SUBROUTINE XAXIS2(XLO,XHI,XUNIT,LABEL,IFORMT,IAXIS,
+     * XFACT,Y,YFACT,CSIZE,yacross,vgrat,vcolor,vline)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)xaxis2.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+* *acm* - 6/01   changes to allow plot qualifiers to set log axes,
+*                inverse log axes and log depth axes.
+C**
+
+	CHARACTER XLAB*20,IFORMT*(*),XFRMT*12
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+
+* Parameters for drawing tics across plot
+
+        REAL yacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4
+        REAL dash2_1, dash2_2, dash2_3, dash2_4 
+        REAL vgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        REAL xt
+        INTEGER vcolor(*)      ! pen number 
+        LOGICAL vline          ! If true, do the lines across.
+        LOGICAL solid1, solid2 ! solid lines across at tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at tics
+        
+C
+C     THIS ROUTINE PLOTS SEVERAL TYPES OF BASE 10 LOG XAXIS.
+C         X,YFACT,XFACT HAVE THEIR USUAL MEANINGS.
+C         IF CSIZE > 0 THE LABELS HAVE THAT HEIGHT.
+C         IF CSIZE < 0 THE LABELS HAVE HEIGHT -CSIZE AND HAVE
+C             NEGATIVE THEIR TRUE VALUE.
+C         XLO AND XHI ARE THE LOGS OF YOUR XLO AND XHI IN USER UNITS.
+C         XUNIT IS ALSO THE LOG OF WHAT IT IS IN USER UNITS.
+C         LABEL = -1 FOR LABELING  BELOW OF YOUR X AXIS.
+C         LABEL = +1 FOR LABELING ABOVE OF YOUR X AXIS.
+C         LABEL =  0 FOR NO LABELS.
+C         IFORMT = TO BE FILLED IN LATER.
+C
+C         IAXIS = STYLE OF AXIS.
+C               = 0 FOR NO AXIS.
+C               = 1 FOR A SIMPLE LOG AXIS WITH ONE LABEL PER DECADE.
+C                  IN THIS CASE XLO, XHI MUST= LOG(POWER OF 10)
+C                  AND IFORMT IS IGNORED.
+C                  XUNIT MUST = LOG(POWER OF 10)
+C               GE 2  THIS GIVES YOU THE INVERSE SCALE OF IAXIS =1
+C
+      IF(IAXIS.EQ.0) RETURN
+      ABSSZ=ABS(CSIZE)
+      TXLO=IFIX(1.0001*XLO)
+      TXHI=IFIX(1.0001*XHI)
+      TXUNIT=IFIX(1.0001*XUNIT)
+      NDEC=TXHI-TXLO
+!      IF(NDEC.LT.1) STOP 'XLO,XHI'
+
+      IF(NDEC.LT.1) THEN
+         NDEC = -1* ndec
+         SGN  = TXHI	! use SGN as a dummy
+         TXHI = TXLO
+         TXLO = SGN
+      ENDIF
+C
+C	DRAW AXIS
+C
+	IF(IAXIS.EQ.1)THEN
+		X=TXLO
+		SGN=+1.
+	ELSE
+		X=TXHI
+		SGN=-1.
+	ENDIF
+        
+        solid1 = (vgrat(1,1).LT.0 .AND. vgrat(2,1).LT.0 .AND.  
+     .            vgrat(3,1).LT.0 .AND.  vgrat(4,1).LT.0 )
+        solid2 = (vgrat(1,2).LT.0 .AND. vgrat(2,2).LT.0 .AND.  
+     .            vgrat(3,2).LT.0 .AND.  vgrat(4,2).LT.0 )
+        dashed1 = (vgrat(1,1).GT.0 .OR. vgrat(2,1).GT.0 .OR.  
+     .            vgrat(3,1).GT.0 .OR.  vgrat(4,1).GT.0 )
+        dashed2 = (vgrat(1,2).GT.0 .OR. vgrat(2,2).GT.0 .OR.  
+     .            vgrat(3,2).GT.0 .OR.  vgrat(4,2).GT.0 )
+
+        IF (dashed1) THEN
+           dash1_1 = vgrat(1,1)
+           dash1_2 = vgrat(2,1)
+           dash1_3 = vgrat(3,1)
+           dash1_4 = vgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = vgrat(1,2)
+           dash2_2 = vgrat(2,2)
+           dash2_3 = vgrat(3,2)
+           dash2_4 = vgrat(4,2)
+        ENDIF
+
+
+	IF  (IAXIS .LE. 3) THEN
+
+	   CALL PLOT(X,Y,0,0)
+	   CALL PLOTT7(X,Y,XFACT,YFACT,1,-8)
+	   DO 110 I=1,NDEC  ! large tics
+	      DO 100 J=2,9     ! small tics
+                 CALL PLOTT7(X+SGN*(I-1+ALOG10(FLOAT(J))),Y,XFACT,YFACT,1,-7)
+
+                 IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                    xt = X+SGN*(I-1+ALOG10(FLOAT(J)))
+                    CALL COLOR(vcolor(2))
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(xt,Y,0,0) 
+                    CALL PLOT(xt,yacross,1,0)
+                    CALL PLOT(xt,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+100           CONTINUE
+              CALL PLOTT7(X+SGN*I,Y,XFACT,YFACT,1,-8)
+         
+              IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                 xt = X+SGN*I
+                 CALL COLOR(vcolor(1))
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(xt,Y,0,0) 
+                 CALL PLOT(xt,yacross,1,0)
+                 CALL PLOT(xt,Y,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+110        CONTINUE
+	ELSE
+
+C  for DEPTH axes, X plot coordinates are reversed on page.
+
+           XTEMP = X + SGN* NDEC
+	   CALL PLOT(XTEMP,Y,0,0)
+	   CALL PLOTT7(XTEMP,Y,XFACT,YFACT,1,-8)
+	   DO 130 I=1,NDEC
+	      DO 120 J=2,9
+                 CALL PLOTT7(XTEMP+(I-1+ALOG10(FLOAT(J))),Y,XFACT,YFACT,1,-7)
+                 
+                 IF ((solid2.OR.dashed2) .AND. vline) THEN ! make line across
+                    xt = XTEMP+(I-1+ALOG10(FLOAT(J)))
+                    CALL COLOR(vcolor(2))
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(xt,Y,0,0) 
+                    CALL PLOT(xt,yacross,1,0)
+                    CALL PLOT(xt,Y,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+120           CONTINUE
+              CALL PLOTT7(XTEMP+I,Y,XFACT,YFACT,1,-8)
+
+              IF ((solid1.OR.dashed1) .AND. vline) THEN ! make line across
+                 xt = XTEMP+I
+                 CALL COLOR(vcolor(1))
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(xt,Y,0,0) 
+                 CALL PLOT(xt,yacross,1,0)
+                 CALL PLOT(xt,Y,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+130        CONTINUE
+
+c 120	   CALL PLOTT7(XTEMP+SGN*(I-1+ALOG10(FLOAT(J))),Y,XFACT,YFACT,1,-7)
+c 130	   CALL PLOTT7(XTEMP+SGN*I,Y,XFACT,YFACT,1,-8)
+
+        ENDIF
+C
+C	DRAW LABELS
+C
+	IF(LABEL.EQ.0)RETURN
+	IF(LABEL+IX.EQ.0)THEN
+		YTEMP=0.0
+	ELSE
+		YTEMP=TLX*0.5
+	ENDIF
+	IF(CSIZE.LT.0.)THEN
+		NC=5
+		XFRMT='(''-E'',I3)'
+	ELSE
+		NC=4
+		XFRMT='(''E'',I3)'
+	ENDIF
+	XWID=1.9*ABSSZ+YTEMP
+	YTEMP=Y+LABEL*(1.40*ABSSZ+YTEMP)/YFACT
+	DO 200 I=0,NDEC
+
+C	   WRITE(XLAB,XFRMT)IFIX(SGN*(X-TXUNIT+I))
+	   IF (SGN .GE. 0.) THEN
+	      WRITE(XLAB,XFRMT)IFIX(SGN*(X-TXUNIT+SGN*I))
+	      XTEMP = X + SGN*I
+	   ELSE
+	      WRITE(XLAB,XFRMT)IFIX((X-TYUNIT+SGN*(NDEC-I)))
+              XTEMP = X + SGN*(NDEC-I)
+           ENDIF
+
+	   CALL SCINOT(XTEMP,YTEMP,0.,ABSSZ,NC,XLAB,0,WID,XFACT,YFACT)
+200	CONTINUE
+	RETURN
+	END
diff --git a/ppl/plotlib/yaxis1.F b/ppl/plotlib/yaxis1.F
new file mode 100644
index 0000000..c3586f8
--- /dev/null
+++ b/ppl/plotlib/yaxis1.F
@@ -0,0 +1,295 @@
+      SUBROUTINE YAXIS1(X,XFACT,YLO,YHI,YTIC,NSMTCY,LINTY,YUNIT,LABEL,
+     *    IFORMT,YFACT,CSIZE,xacross,ydms,hgrat,hcolor,hline,
+     *    yvaloff, noylab, SHRINKY)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOTLIB]YAXIS1.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection
+*		  ... no explicit declarations (too much trouble !) so it must
+*		      be compiled with /WARNINGS=NODECLARATIONS
+*	*jd* 5.6.96 Fix axis labelling bug where roundoff at zero results 
+*			in small non-zero values
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+C *acm* 11/05  new argument to scinot deg/min/sec labels
+C        1/06  xvaloff,yvaloff add this amount to each x or y axis label. 
+C              (axis data was read as double precision and converted to single 
+C              after applying an offset.)
+
+* 11/2011 ACM Fixing ticket 1896: When needed, reset the size of numerical axis
+*             labes, so the labels dont run off the edge of the plot.
+
+C**
+C**    @(#)yaxis1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+        INTEGER ydms
+* Parameters for drawing tics across plot
+
+        REAL xacross, dash1, dash2, dash3, dash4
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid          ! solid lines across at tics
+        LOGICAL dashed         ! dashed lines across at tics
+	LOGICAL noylab
+	LOGICAL SHRINKY
+
+	CHARACTER IFORMT*(*),YLAB*20
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID 
+
+	parameter (epsilon = 1.e-6)
+
+* TMAP interrupt flag
+#ifdef unix
+	include 'xinterrupt.cmn'
+#else
+	INCLUDE 'tmap_pplv11inc:tmap_xinterrupt.cmn'
+#endif
+C
+C
+C     THIS ROUTINE DRAWS A Y AXIS.  IT LABELS THE AXIS ON THE LEFT
+C     IF LABEL=-1, ON THE RIGHT IF LABEL=1, AND NOT AT ALL
+C     IF LABEL=0.  IF LABEL.NE.0 IFORMT TELLS US WHAT FORMAT TO WRITE
+C     THE LABEL IN.  SEE NCHAR PARAMETER IN COMPLOT DOCUMENTATION
+C     FOR THE SUBROUTINE NUMBER FOR AN EXPLANATION OF THIS.
+C     IF CSIZE>0 THE LABELS HAVE THAT SIZE.  IF CSIZE<0 THE LABELS
+C     HAVE THE SIZE -CSIZE  AND HAVE THE NEGATIVE OF THEIR TRUE
+C     VALUES.
+C     MODIFICATION OF JULY 29,1979.
+C     WE HAVE CHANGED THE MEANING OF IFORMT.
+C     USE -10<=IFORMT<=+10 AS BEFORE OR BETTER YET:
+C     USE IFORMT = 10H(I7*BALL*)
+C                 = 7H(F10.2)  FOR EXAMPLE
+C     IN THIS OPTION OUR SUBROUTINE RECONIZES AN I FORMAT BY USING
+C     THE FACT THAT THE FIRST TWO CHARACTERS OF IFORMT ARE "(I".
+C     IN FACT IF YOU DIMENSION IFORMT IN THE CALLING PROGRAM YOU
+C     CAN EVEN USE FORMAT STATEMENTS THAT ARE LONGER THAN 10 CHARACTERS.
+C     HOWEVER, THE PRINTED LABEL MUST BE <=20 CHARACTERS.
+C
+C     THE FOLLOWING SECTION OF CODE MAKES THIS ROUTINE UPWARD COMPATIABLE.
+      ABSSZ=ABS(CSIZE)
+      SIGSZ=SIGN(1.,CSIZE)
+C
+C	DRAW AXIS
+C
+	DIR=SIGN(1.,YTIC)
+	YT=INT(YLO/YTIC+SIGN(0.000001,DIR*YLO))*YTIC
+	IF(DIR*YT.LT.DIR*YLO)YT=YT+YTIC
+	ISTOP=IFIX((YHI-YT)/YTIC+0.000001)
+	CALL PLOT(X,YT,0,0)
+	CALL SMY1(X,XFACT,YFACT,YT,YLO,-YTIC,NSMTCY,
+     .     xacross,hgrat,hcolor,hline)
+	CALL PLOT(X,YLO,1,0)
+	CALL PLOTT7(X,YT,XFACT,YFACT,1,-6)
+
+	Y=YT
+        
+        solid = (hgrat(1,1).LT.0 .AND. hgrat(2,1).LT.0 .AND.  
+     .            hgrat(3,1).LT.0 .AND.  hgrat(4,1).LT.0 )
+        dashed = (hgrat(1,1).GT.0 .OR. hgrat(2,1).GT.0 .OR.  
+     .            hgrat(3,1).GT.0 .OR.  hgrat(4,1).GT.0 )
+        IF (dashed) THEN
+           dash1 = hgrat(1,1)
+           dash2 = hgrat(2,1)
+           dash3 = hgrat(3,1)
+           dash4 = hgrat(4,1)
+        ENDIF
+
+	DO 100 I=1,ISTOP
+	IF ( interrupted ) RETURN		! TMAP interrupt
+	CALL SMY1(X,XFACT,YFACT,Y,YHI,YTIC,NSMTCY,
+     .     xacross,hgrat,hcolor,hline)
+        IF ((solid.OR.dashed) .AND. hline) THEN ! make line across
+           CALL COLOR(hcolor(1))
+           IF (dashed) THEN
+              CALL DASHSZ(dash1,dash2,dash3,dash4)
+              CALL DASHES
+           ENDIF
+           CALL PLOT(X,Y,0,0) 
+           CALL PLOT(xacross,Y,1,0)
+           CALL PLOT(X,Y,0,0) 
+           CALL COLOR(1)
+           CALL VECTRS
+        ENDIF
+
+	Y=Y+YTIC
+	CALL PLOTT7(X,Y,XFACT,YFACT,1,-6)
+100	CONTINUE
+	CALL SMY1(X,XFACT,YFACT,Y,YHI,YTIC,NSMTCY,
+     .     xacross,hgrat,hcolor,hline)
+        
+        IF ((solid.OR.dashed) .AND. hline) THEN ! make line across
+           CALL COLOR(hcolor(1))
+           IF (dashed) THEN
+              CALL DASHSZ(dash1,dash2,dash3,dash4)
+              CALL DASHES
+           ENDIF
+           CALL PLOT(X,Y,0,0) 
+           CALL PLOT(xacross,Y,1,0)
+           CALL PLOT(X,Y,0,0) 
+           CALL COLOR(1)
+           CALL VECTRS
+        ENDIF
+
+	CALL PLOT(X,YHI,1,0)
+
+C
+C	DRAW LABELS
+C
+	IF(LABEL.EQ.0)RETURN
+	IF(LABEL+IY.EQ.0)THEN
+		XTEMP=0.
+	ELSE
+		XTEMP=TLY*0.5
+	ENDIF
+	IF(LABEL.EQ.1)THEN
+           IF (yvaloff .EQ. 0.) THEN
+	      CALL NUMCDE(SIGSZ*YLO/YUNIT,YLAB,NC,IFORMT,ydms)
+           ELSE
+	      CALL NUMCDE_OFF(SIGSZ*YLO/YUNIT,YLAB,NC,IFORMT,ydms,
+     .              yvaloff)
+           ENDIF
+	   CALL SCINOT(0.,0.,0.,ABSSZ,NC,YLAB,3,WID,
+     .             XFACT,YFACT)
+
+           IF (yvaloff .EQ. 0.) THEN
+	      CALL NUMCDE(SIGSZ*YHI/YUNIT,YLAB,NC,IFORMT,ydms)
+           ELSE
+	      CALL NUMCDE_OFF(SIGSZ*YHI/YUNIT,YLAB,NC,IFORMT,ydms,
+     .              yvaloff)
+           ENDIF
+	   CALL SCINOT(0.,0.,0.,ABSSZ,NC,YLAB,3,WID1,
+     .             XFACT,YFACT)
+
+	   IF(YLO.LT.0..AND.YHI.GT.0.)THEN
+              IF (yvaloff .EQ. 0.) THEN
+                 CALL NUMCDE(0.,YLAB,NC,IFORMT,ydms)
+              ELSE
+                 CALL NUMCDE_OFF(0.,YLAB,NC,IFORMT,ydms,yvaloff)
+              ENDIF
+	      CALL SCINOT(0.,0.,0.,ABSSZ,NC,YLAB,3,WID2,
+     *			XFACT,YFACT)
+	   ELSE
+	      WID2=0.0
+	   ENDIF
+	   XTEMP=XTEMP+AMAX1(WID,WID1,WID2)
+	ENDIF
+	YWID=0.75*ABSSZ+XTEMP
+	XTEMP=X+LABEL*YWID/XFACT
+	IF(DIR*YLO.LE.0.AND.DIR*YHI.GE.0)THEN
+		Y=INT(YLO/(YTIC*LINTY)-0.000001)*YTIC*LINTY
+	ELSE
+		Y=YT
+	ENDIF
+	ISTOP=INT((YHI-Y)/(YTIC*LINTY)+0.000001)
+
+	y0 = y
+	YWIDT=0.
+        YSAVE = Y
+
+	IF (SHRINKY) THEN
+C First compute max axis-label width without writing labels 
+C (ITYPE=3 arg to SCINOT) 
+
+        DO 199 I=0,ISTOP
+	IF ( interrupted ) RETURN		! TMAP interrupt
+        TEMP=SIGSZ*Y/YUNIT
+        IF (yvaloff .EQ. 0) THEN
+           CALL NUMCDE(TEMP,YLAB,NC,IFORMT,YDMS)
+        ELSE
+           CALL NUMCDE_OFF(TEMP,YLAB,NC,IFORMT,YDMS,yvaloff)
+        ENDIF
+        CALL SCINOT(XTEMP,Y,0.,ABSSZ,NC,YLAB,3,WID,XFACT,YFACT)
+
+	Y=y0+YTIC*LINTY*(i+1)
+	if (abs(y) .lt. epsilon*abs(y0)) y = 0.0
+
+	IF(WID.GT.YWIDT)YWIDT=WID
+199	CONTINUE
+
+* Use origin and label-size info that is in common to possibly
+* reset the axis-label size for this axis only, so the labels dont
+* run off the edge. (Only do this if the axis is labeled on the left.
+* means we are ignoring axes at the right of the page, labeled on the right.)
+
+        IF (label .EQ. -1) CALL RESET_LABSIZ (YWID, YWIDT, ABSSZ, NOYLAB)
+
+	ENDIF !SHRINKY
+
+	YWIDT=0.
+	Y = YSAVE
+
+* Now make the labels.
+
+	DO 200 I=0,ISTOP
+	IF ( interrupted ) RETURN		! TMAP interrupt
+        TEMP=SIGSZ*Y/YUNIT
+        IF (yvaloff .EQ. 0) THEN
+           CALL NUMCDE(TEMP,YLAB,NC,IFORMT,YDMS)
+        ELSE
+           CALL NUMCDE_OFF(TEMP,YLAB,NC,IFORMT,YDMS,yvaloff)
+        ENDIF
+        CALL SCINOT(XTEMP,Y,0.,ABSSZ,NC,YLAB,1,WID,XFACT,YFACT)
+
+CC	Original code
+CC	Y=Y+YTIC*LINTY
+
+	Y=y0+YTIC*LINTY*(i+1)
+	if (abs(y) .lt. epsilon*abs(y0)) y = 0.0
+
+	IF(WID.GT.YWIDT)YWIDT=WID
+200	CONTINUE
+	IF(LABEL.LT.0)THEN 
+           IF (YDMS .GE. 2) ywidt = ywidt - symwid(abssz,1,'''')
+           YWID=YWID+YWIDT
+        ENDIF
+	RETURN
+	END
+
+
diff --git a/ppl/plotlib/yaxis2.F b/ppl/plotlib/yaxis2.F
new file mode 100644
index 0000000..1961f98
--- /dev/null
+++ b/ppl/plotlib/yaxis2.F
@@ -0,0 +1,267 @@
+      SUBROUTINE YAXIS2(X,XFACT,YLO,YHI,YUNIT,LABEL,IFORMT,IAXIS,
+     * YFACT,CSIZE,xacross,hgrat,hcolor,hline)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)yaxis2.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* *acm* - 6/01   changes to allow plot qualifiers to set log axes,
+*                inverse log axes and log depth axes.
+
+	CHARACTER YLAB*20,IFORMT*(*),YFRMT*12
+	COMMON/TICS/TSMX,TLX,TSMY,TLY,IX,IY
+	COMMON/AXLWID/XWID,YWID
+
+* Parameters for drawing tics across plot
+
+        REAL xacross
+        REAL dash1_1, dash1_2, dash1_3, dash1_4 
+        REAL dash2_1, dash2_2, dash2_3, dash2_4
+        REAL hgrat(4,2)        ! line type: 0=tics only, <0=line, >0=dash lengths 
+        REAL yt
+        INTEGER hcolor(*)      ! pen number 
+        LOGICAL hline          ! If true, do the lines across.
+        LOGICAL solid1,solid2  ! solid lines across at large, small tics
+        LOGICAL dashed1, dashed2 ! dashed lines across at large, small tics
+
+C
+C     THIS ROUTINE PLOTS SEVERAL TYPES OF BASE 10 LOG YAXIS.
+C         X,XFACT,YFACT HAVE THEIR USUAL MEANINGS.
+C         IF CSIZE > 0 THE LABELS HAVE THAT HEIGHT.
+C         IF CSIZE < 0 THE LABELS HAVE HEIGHT -CSIZE AND HAVE
+C             NEGATIVE THEIR TRUE VALUE.
+C         YLO AND YHI ARE THE LOGS OF YOUR YLO AND YHI IN USER UNITS.
+C         YUNIT IS ALSO THE LOG OF WHAT IT IS IN USER UNITS.
+C         LABEL = -1 FOR LABELING ON THE LEFT OF YOUR Y AXIS.
+C         LABEL = +1 FOR LABELING ON THE RIGHT OF YOUR Y AXIS.
+C         LABEL =  0 FOR NO LABELS.
+C         IFORMT = TO BE FILLED IN LATER.
+C
+C         IAXIS = STYLE OF AXIS.
+C                = 0 FOR NO AXIS
+C                = 1 FOR A SIMPLE LOG AXIS WITH ONE LABEL PER DECADE.
+C                  IN THIS CASE YLO, YHI MUST= LOG(POWER OF 10)
+C                  AND IFORMT IS IGNORED.
+C                  YUNIT MUST = LOG(POWER OF 10)
+C               GE 2  GIVES THE INVERSE SCALE OF IAXIS = 1
+
+      IF(IAXIS.EQ.0) RETURN
+      ABSSZ=ABS(CSIZE)
+      TYLO=IFIX(1.0001*YLO)
+      TYHI=IFIX(1.0001*YHI)
+      TYUNIT=IFIX(1.0001*YUNIT)
+      NDEC=TYHI-TYLO
+!      IF(NDEC.LT.1) STOP 'YLO,YHI'
+      IF(NDEC.LT.1) THEN
+         NDEC = -1* ndec
+         SGN  = TYHI	! use SGN as a dummy
+         TYHI = TYLO
+         TYLO = SGN
+      ENDIF
+
+C
+C	DRAW AXIS
+C
+	IF(IAXIS.EQ.1)THEN
+		Y=TYLO
+		SGN= 1.0
+	ELSE
+		Y=TYHI
+		SGN=-1.0
+	ENDIF
+ 
+        solid1 = (hgrat(1,1).LT.0 .AND. hgrat(2,1).LT.0 .AND.  
+     .            hgrat(3,1).LT.0 .AND.  hgrat(4,1).LT.0 )
+        solid2 = (hgrat(1,2).LT.0 .AND. hgrat(2,2).LT.0 .AND.  
+     .            hgrat(3,2).LT.0 .AND.  hgrat(4,2).LT.0 )
+        dashed1 = (hgrat(1,1).GT.0 .OR. hgrat(2,1).GT.0 .OR.  
+     .            hgrat(3,1).GT.0 .OR.  hgrat(4,1).GT.0 )
+        dashed2 = (hgrat(1,2).GT.0 .OR. hgrat(2,2).GT.0 .OR.  
+     .            hgrat(3,2).GT.0 .OR.  hgrat(4,2).GT.0 )
+        IF (dashed1) THEN
+           dash1_1 = hgrat(1,1)
+           dash1_2 = hgrat(2,1)
+           dash1_3 = hgrat(3,1)
+           dash1_4 = hgrat(4,1)
+        ENDIF
+        IF (dashed2) THEN
+           dash2_1 = hgrat(1,2)
+           dash2_2 = hgrat(2,2)
+           dash2_3 = hgrat(3,2)
+           dash2_4 = hgrat(4,2)
+        ENDIF
+
+	IF  (IAXIS .LE. 3) THEN
+	   CALL PLOT(X,Y,0,0)
+	   CALL PLOTT7(X,Y,XFACT,YFACT,1,-6)
+	   DO 110 I=1,NDEC    ! large tics
+
+	      DO 100 J=2,9    ! small tics
+
+                 CALL PLOTT7(X,Y+SGN*(I-1+ALOG10(FLOAT(J))),XFACT,YFACT,1,-5)
+
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                   yt = Y+SGN*(I-1+ALOG10(FLOAT(J)))
+                   CALL COLOR(hcolor(2))
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(X,yt,0,0) 
+                    CALL PLOT(xacross,yt,1,0)
+                    CALL PLOT(X,yt,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+             
+100           CONTINUE
+
+              CALL PLOTT7(X,Y+SGN*I,XFACT,YFACT,1,-6) ! draw large tic
+
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 yt = Y+SGN*I
+                 CALL COLOR(hcolor(1))
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(X,yt,0,0) 
+                 CALL PLOT(xacross,yt,1,0)
+                 CALL PLOT(X,yt,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+110        CONTINUE
+
+	ELSE
+
+C  for DEPTH axes, Y plot coordinates are reversed on page.
+
+           YTEMP = Y + SGN* NDEC
+	   CALL PLOT(X,YTEMP,0,0)
+	   CALL PLOTT7(X,YTEMP,XFACT,YFACT,1,-6)
+	   DO 130 I=1,NDEC      ! large tics
+	      DO 120 J=2,9      ! small tics
+                 CALL PLOTT7(X,YTEMP+(I-1+ALOG10(FLOAT(J))),XFACT,YFACT,1,-5)
+
+                 IF ((solid2.OR.dashed2) .AND. hline) THEN ! make line across
+                   yt = YTEMP+(I-1+ALOG10(FLOAT(J)))
+                   CALL COLOR(hcolor(2))
+                    IF (dashed2) THEN
+                       CALL DASHSZ(dash2_1,dash2_2,dash2_3,dash2_4)
+                       CALL DASHES
+                    ENDIF
+                    CALL PLOT(X,yt,0,0) 
+                    CALL PLOT(xacross,yt,1,0)
+                    CALL PLOT(X,yt,0,0) 
+                    CALL COLOR(1)
+                    CALL VECTRS
+                 ENDIF
+
+120           CONTINUE
+              CALL PLOTT7(X,YTEMP+I,XFACT,YFACT,1,-6)  ! make large tic
+              
+              IF ((solid1.OR.dashed1) .AND. hline) THEN ! make line across
+                 yt = ytemp+i
+                 CALL COLOR(hcolor(1))
+                 IF (dashed1) THEN
+                    CALL DASHSZ(dash1_1,dash1_2,dash1_3,dash1_4)
+                    CALL DASHES
+                 ENDIF
+                 CALL PLOT(X,yt,0,0) 
+                 CALL PLOT(xacross,yt,1,0)
+                 CALL PLOT(X,yt3/2/2004,0,0) 
+                 CALL COLOR(1)
+                 CALL VECTRS
+              ENDIF
+
+130        CONTINUE
+        ENDIF
+C
+C	DRAW LABELS
+C
+	IF(LABEL.EQ.0)RETURN
+	IF(LABEL+IY.EQ.0)THEN
+		XTEMP=0.0
+	ELSE
+		XTEMP=TLY*0.5
+	ENDIF
+	IF(LABEL.EQ.1)THEN
+		IPOS=2
+	ELSE
+		IPOS=1
+	ENDIF
+	YWID=0.75*ABSSZ+XTEMP
+	XTEMP=X+LABEL*YWID/XFACT
+	IF(CSIZE.LT.0.)THEN
+		NC=5
+		YFRMT='(''-E'',I3)'
+	ELSE
+		NC=4
+		YFRMT='(''E'',I3)'
+	ENDIF
+	YWIDT=0.0
+	DO 200 I=0,NDEC
+c	WRITE(YLAB,YFRMT)IFIX(SGN*(Y-TYUNIT+I))	! wrong nums for log depth axis 
+
+	IF (SGN .GE. 0) THEN
+            WRITE(YLAB,YFRMT)IFIX((Y-TYUNIT+SGN*I))
+            YTEMP = Y + SGN*I
+
+C  for DEPTH axes, Y plot coordinates are reversed on page.
+
+        ELSE IF (SGN .LT. 0.)THEN
+            WRITE(YLAB,YFRMT)IFIX((Y-TYUNIT+SGN*(NDEC-I)))
+            YTEMP = Y + SGN*(NDEC-I)
+        ENDIF
+
+	CALL SCINOT(XTEMP,YTEMP,0.,ABSSZ,NC,YLAB,IPOS,WID,XFACT,YFACT)
+
+	IF(WID.GT.YWIDT)YWIDT=WID
+200	CONTINUE
+	YWID=YWID+YWIDT
+	RETURN
+	END
diff --git a/ppl/plotlib/zgrid.F b/ppl/plotlib/zgrid.F
new file mode 100644
index 0000000..d8b6b80
--- /dev/null
+++ b/ppl/plotlib/zgrid.F
@@ -0,0 +1,412 @@
+	subroutine zgrid(z,nxsize,nysize,nx,ny,x1,y1,dx,dy, 
+     1	xp,yp,zp,n,cay,nrng) 
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)zgrid.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+c     sets up square grid for contouring , given arbitrarily placed 
+c     data points. laplace interpolation is used. 
+c     the method used here was lifted directly from notes left by 
+c     mr ian crain formerly with the comp.science div. 
+c     info on relaxation soln of laplace eqn supplied by dr t murty. 
+c     fortran ii   oceanography/emr   dec/68   jdt 
+c 
+c     z = 2-d array of hgts to be set up. points outside region to be 
+c     contoured should be initialized to 10**35 . the rest should be 0.0 
+c     nx,ny = max subscripts of z in x and y directions . 
+c     x1,y1 = coordinates of z(1,1) 
+c     dx,dy = x and y increments . 
+c     xp,yp,zp = arrays giving position and hgt of each data point. 
+c     n = size of arrays xp,yp and zp . 
+c 
+c     modification feb/69   to get smoother results a portion of the 
+c     beam eqn  was added to the laplace eqn giving 
+c     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 . 
+c     k=0 gives pure laplace solution.  k=inf. gives pure spline solution. 
+c     cayin = k = amount of spline eqn (between 0 and inf.) 
+c     nrng...grid points more than nrng grid spaces from the nearest 
+c            data point are set to undefined. 
+c 
+c     modification dec23/69   data pts no longer moved to grid pts. 
+c 
+c     modification may 5 79  common blocks work1 and work2 must 
+c     be dimension at least n points long by the user.  common 
+c     block work3 must be dimensioned at least ny points long. 
+c 
+c	modification june 17,1985 - handles data values of 1e35. if at
+c	least one data value near a grid point is equal to 1e35, the z
+c	array is initialized to 1e35 at that grid point
+c	- by g.r. halliwell
+c
+c*******************************************************************************
+c 
+c	vax/vms
+c
+	dimension z(nxsize,nysize),xp(n),yp(n),zp(n),
+     .	zpij(50000),knxt(50000)
+c
+c	end vax/vms
+c
+c	rsx-11m
+c
+c	virtual z(nxsize,nysize),xp(n),yp(n),zp(n),zpij(10000),knxt(10000)
+c
+c	end rsx-11m
+c
+	dimension imnew(1000),kksav(500)
+ 
+	itmax=100 
+	eps=.002 
+	big=.9e35 
+c 
+c     get zbase which will make all zp values positive by 20*(zmax-zmin) 
+c*******************************************************************************
+c 
+c**   grh modification
+	zmin=big
+	zmax=-big
+	do 20 k=1,n 
+	if(zp(k).ge.1e35)goto 20
+c**
+	if(zp(k)-zmax)14,14,12 
+12	zmax=zp(k) 
+14	if(zp(k)-zmin)16,20,20 
+16	zmin=zp(k) 
+20	continue 
+	zrange=zmax-zmin 
+	zbase=zrange*20.-zmin 
+	hrange=amin1(dx*(nx-1) , dy*(ny-1)) 
+	derzm=2.*zrange/hrange 
+c 
+c     set pointer array knxt 
+c*******************************************************************************
+c 
+	do 60 kk=1,n 
+	k=1+n-kk 
+	knxt(k)=0 
+	i= (xp(k)-x1)/dx + 1.5 
+	if(i*(nx+1-i))60,60,35 
+35	j= (yp(k)-y1)/dy + 1.5 
+	if(j*(ny+1-j))60,60,40 
+40	if(z(i,j)-big)45,60,60 
+45	knxt(k)=n+1 
+	if(z(i,j))55,55,50 
+50	knxt(k)= z(i,j)+.5 
+55	z(i,j)=k 
+60	continue 
+c 
+c     affix each data point zp to its nearby grid point.  take avg zp if 
+c     more than one zp nearby the grid point. add zbase and complement. 
+	do 80 k=1,n 
+	if(knxt(k))80,80,65 
+65	npt=0 
+c**   grh modification
+	imask=0
+c**
+	zsum=0. 
+	i= (xp(k)-x1)/dx + 1.5 
+	j =(yp(k)-y1)/dy + 1.5 
+	kk=k 
+70	npt=npt+1 
+c**   grh modification
+	kksav(npt)=kk
+	if(zp(kk).gt.big)imask=1
+c**
+	zsum=zsum+ zp(kk) 
+	knxt(kk)=-knxt(kk) 
+	kk = -knxt(kk) 
+	if(kk-n)70,70,75 
+c**	grh modification
+75	if(imask.eq.0)then
+	z(i,j) = -zsum/npt-zbase 
+	else
+	z(i,j) = 1.e35
+	do 76 i=1,npt
+76	knxt(kksav(i))=0
+	endif
+c**
+80	continue 
+c 
+c     initially set each unset grid point to value of nearest known pt. 
+c*******************************************************************************
+c 
+	do 110 i=1,nx 
+	do 110 j=1,ny 
+	if(z(i,j))110,100,110 
+100	z(i,j) = -1.e35 
+110	continue 
+	do 199 iter=1,nrng 
+	nnew=0 
+	do 197 i=1,nx 
+	do 197 j=1,ny 
+	if(z(i,j)+big)152,192,192 
+152	if(j-1)162,162,153 
+153	if(jmnew)154,154,162 
+154	zijn=abs(z(i,j-1)) 
+	if(zijn-big)195,162,162 
+162	if(i-1)172,172,163 
+163	if(imnew(j))164,164,172 
+164	zijn=abs(z(i-1,j)) 
+	if(zijn-big)195,172,172 
+172	if(j-ny)173,182,182 
+173	zijn=abs(z(i,j+1)) 
+	if(zijn-big)195,182,182 
+182	if(i-nx)183,192,192 
+183	zijn=abs(z(i+1,j)) 
+	if(zijn-big)195,192,192 
+192	imnew(j)=0 
+	jmnew=0 
+	go to 197 
+195	imnew(j)=1 
+	jmnew=1 
+	z(i,j)=zijn 
+	nnew=nnew+1 
+197	continue 
+	if(nnew)200,200,199 
+199	continue 
+200	continue 
+	do 202 i=1,nx 
+	do 202 j=1,ny 
+	abz=abs(z(i,j)) 
+	if(abz-big)202,201,201 
+201	z(i,j)=abz 
+202	continue 
+c 
+c     improve the non-data points by applying point over-relaxation 
+c     using the laplace-spline equation  (carres method is used) 
+c*******************************************************************************
+c 
+	dzrmsp=zrange 
+	relax=1.0 
+	do 4000 iter=1,itmax 
+	dzrms=0. 
+	dzmax=0. 
+	npg =0 
+	do 2000 i=1,nx 
+	do 2000 j=1,ny 
+	z00=z(i,j) 
+	if(z00-big)205,2000,2000 
+205	if(z00)2000,208,208 
+208	wgt=0. 
+	zsum=0. 
+c 
+	im=0 
+	if(i-1)570,570,510 
+510	zim=abs(z(i-1,j)) 
+	if(zim-big)530,570,570 
+530	im=1 
+	wgt=wgt+1. 
+	zsum=zsum+zim 
+	if(i-2)570,570,540 
+540	zimm=abs(z(i-2,j)) 
+	if(zimm-big)560,570,570 
+560	wgt=wgt+cay 
+	zsum=zsum-cay*(zimm-2.*zim) 
+570	if(nx-i)700,700,580 
+580	zip=abs(z(i+1,j)) 
+	if(zip-big)600,700,700 
+600	wgt=wgt+1. 
+	zsum=zsum+zip 
+	if(im)620,620,610 
+610	wgt=wgt+4.*cay 
+	zsum=zsum+2.*cay*(zim+zip) 
+620	if(nx-1-i)700,700,630 
+630	zipp=abs(z(i+2,j)) 
+	if(zipp-big)650,700,700 
+650	wgt=wgt+cay 
+	zsum=zsum-cay*(zipp-2.*zip) 
+700	continue 
+c 
+	jm=0 
+	if(j-1)1570,1570,1510 
+1510	zjm=abs(z(i,j-1)) 
+	if(zjm-big)1530,1570,1570 
+1530	jm=1 
+	wgt=wgt+1. 
+	zsum=zsum+zjm 
+	if(j-2)1570,1570,1540 
+1540	zjmm=abs(z(i,j-2)) 
+	if(zjmm-big)1560,1570,1570 
+1560	wgt=wgt+cay 
+	zsum=zsum-cay*(zjmm-2.*zjm) 
+1570	if(ny-j)1700,1700,1580 
+1580	zjp=abs(z(i,j+1)) 
+	if(zjp-big)1600,1700,1700 
+1600	wgt=wgt+1. 
+	zsum=zsum+zjp 
+	if(jm)1620,1620,1610 
+1610	wgt=wgt+4.*cay 
+	zsum=zsum+2.*cay*(zjm+zjp) 
+1620	if(ny-1-j)1700,1700,1630 
+1630	zjpp=abs(z(i,j+2)) 
+	if(zjpp-big)1650,1700,1700 
+1650	wgt=wgt+cay 
+	zsum=zsum-cay*(zjpp-2.*zjp) 
+1700	continue 
+c 
+	dz=zsum/wgt-z00 
+	npg=npg+1 
+	dzrms=dzrms+dz*dz 
+	dzmax=amax1(abs(dz),dzmax) 
+	z(i,j)=z00+dz*relax 
+2000	continue 
+c 
+c 
+c     shift data points zp progressively back to their proper places as 
+c     the shape of surface z becomes evident. 
+c*******************************************************************************
+c 
+	if(iter-(iter/10)*10) 3600,3020,3600 
+3020	do 3400 k=1,n 
+	knxt(k) =iabs(knxt(k)) 
+	if(knxt(k))3400,3400,3030 
+3030	x=(xp(k)-x1)/dx 
+	i=x+1.5 
+	x= x+1.-i 
+	y=(yp(k)-y1)/dy 
+	j=y+1.5 
+	y=y+1.-j 
+	zpxy = zp(k)+zbase 
+	z00 = abs(z(i,j)) 
+c 
+	zw=1.e35 
+	if(i-1)3120,3120,3110 
+3110	zw = abs(z(i-1,j)) 
+3120	ze=1.e35 
+	if(i-nx)3130,3140,3140 
+3130	ze = abs(z(i+1,j)) 
+3140	if(ze-big)3160,3150,3150 
+3150	if(zw-big)3180,3170,3170 
+3160	if(zw-big)3200,3190,3190 
+3170	ze=z00 
+	zw=z00 
+	go to 3200 
+3180	ze=2.*z00-zw 
+	go to 3200 
+3190	zw = 2.*z00-ze 
+c 
+3200	zs=1.e35 
+	if(j-1)3220,3220,3210 
+3210	zs = abs(z(i,j-1)) 
+3220  	zn= 1.e35 
+	if(j-ny)3230,3240,3240 
+3230	zn = abs(z(i,j+1)) 
+3240	if(zn-big)3260,3250,3250 
+3250	if(zs-big)3280,3270,3270 
+3260	if(zs-big)3300,3290,3290 
+3270	zn= z00 
+	zs= z00 
+	go to 3300 
+3280	zn = 2.*z00-zs 
+	go to 3300 
+3290	zs = 2.*z00-zn 
+c 
+3300	a=(ze-zw)*.5 
+	b=(zn-zs)*.5 
+	c=(ze+zw)*.5-z00 
+	d=(zn+zs)*.5-z00 
+	zxy=z00+a*x+b*y+c*x*x+d*y*y 
+	delz=z00-zxy 
+	delzm=derzm*(abs(x)*dx+abs(y)*dy)*.80 
+	if(delz-delzm)3355,3355,3350 
+3350	delz=delzm 
+3355	if(delz+delzm)3360,3365,3365 
+3360	delz=-delzm 
+3365	zpij(k)=zpxy+delz 
+3400	continue 
+c 
+	do 3500 k=1,n 
+	if(knxt(k))3500,3500,3410 
+3410	npt=0 
+	zsum = 0. 
+	i= (xp(k)-x1)/dx + 1.5 
+	j= (yp(k)-y1)/dy + 1.5 
+	kk = k 
+3420	npt = npt+1 
+	zsum = zsum + zpij(kk) 
+	knxt(kk)= -knxt(kk) 
+	kk = -knxt(kk) 
+	if(kk-n)3420,3420,3430 
+3430	z(i,j) =  -zsum/npt 
+3500	continue 
+3600	continue 
+c 
+c     test for convergence 
+c*******************************************************************************
+c 
+	if(npg.eq.0)goto 4010
+	dzrms=sqrt(dzrms/npg) 
+	root =dzrms/dzrmsp 
+	dzrmsp=dzrms 
+	dzmaxf=dzmax/zrange 
+	if(iter-(iter/10)*10-2)3715,3710,3715 
+3710	dzrms8 = dzrms 
+3715	if(iter-(iter/10)*10)4000,3720,4000 
+3720	root = sqrt(sqrt(sqrt(dzrms/dzrms8))) 
+	if(root-.9999)3730,4000,4000 
+3730	if(dzmaxf/(1.-root)-eps)4010,4010,3740 
+c 
+c     improve the relaxation factor. 
+c*******************************************************************************
+c 
+3740	if((iter-20)*(iter-40)*(iter-60))4000,3750,4000 
+3750	if(relax-1.-root)3760,4000,4000 
+3760	tpy =(root+relax-1.)/relax 
+	rootgs = tpy*tpy/root 
+	relaxn= 2./(1.+sqrt(1.-rootgs)) 
+	if(iter-60)3780,3785,3780 
+3780	relaxn= relaxn-.25*(2.-relaxn) 
+3785	relax = amax1(relax,relaxn) 
+4000	continue 
+4010	continue 
+c 
+c     remove zbase from array z and return. 
+c 
+	do 4500 i=1,nx 
+	do 4500 j=1,ny 
+	if(z(i,j)-big)4400,4500,4500 
+4400	z(i,j)=abs(z(i,j))-zbase 
+4500	continue 
+	return 
+	end 
diff --git a/ppl/pplepic/LIB_NAME b/ppl/pplepic/LIB_NAME
new file mode 100644
index 0000000..8da9334
--- /dev/null
+++ b/ppl/pplepic/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libepi.a
+ 
diff --git a/ppl/pplepic/Makefile b/ppl/pplepic/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/pplepic/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/pplepic/SOURCE_FILES b/ppl/pplepic/SOURCE_FILES
new file mode 100644
index 0000000..c1be1b2
--- /dev/null
+++ b/ppl/pplepic/SOURCE_FILES
@@ -0,0 +1,28 @@
+SRCS_F = \
+efile.F\
+ekeycls.F\
+ekeyopn.F\
+ekeyrd.F\
+epicrd.F\
+epicsq.F\
+epictimc.F\
+epictlab.F\
+epictlim.F\
+epictrd.F\
+epicv.F\
+epicvar.F\
+epicvc.F\
+fixtim.F\
+frsthd.F\
+geo.F\
+geo1.F\
+geochar.F\
+hdrt1.F\
+lenstr.F\
+nxthdr.F\
+readhd.F\
+readthd.F\
+stripit.F\
+upcase.F\
+varck.F\
+varkey.F 
diff --git a/ppl/pplepic/efile.F b/ppl/pplepic/efile.F
new file mode 100644
index 0000000..a42f10f
--- /dev/null
+++ b/ppl/pplepic/efile.F
@@ -0,0 +1,143 @@
+	subroutine efile (datafile,dat,leof)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)efile.f	1.1.1.1    7/30/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Reads lines of a Time Series or CTD-type EPIC file and returns
+c  the line itself (line), the data file specifications (datafile) and the
+c  data type info (dat).  If eof is encountered, leof is set to true.
+c
+c  Programmed by N. Soreide, Apr 86.
+c
+	common /epiclun/ lun1,lun11,lun21
+c
+c  Internal COMMON block
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	common /cefile/ ndiski,ndiskf,ndiri,ndirf,nfili,nfilf,ifirst 
+	logical leof,lrim
+	character direct*20, filename*22, disk*4
+	character line*132, dat*(*), datafile*(*)
+	common /comerd/ line
+	data nline /132/
+#ifdef unix
+	external init_cefile
+#else
+	data ifirst /1/
+#endif
+	data lrim/.true./
+c
+	if (lun11 .eq. 0) lun11=11
+C
+	if (.not. lrim ) then
+	    read (lun11, 102, end=310) datafile
+	    datafile=datafile(1:lenstr(datafile))
+	    return
+310	    leof = .true.
+	return
+	endif
+c
+210	read (lun11, 102, end=300)line
+102	format (a)
+c
+	if (ifirst .eq. 1) then
+		ndat = index (line(1:nline), 'DAT ')
+		if (ndat .ne. 0) then
+			read (lun11, 102) line
+			read (lun11, 102) line
+			dat(1:3)=line(ndat:ndat+2)
+		endif
+		ndiri=index(line(1:nline), 'DIRECT')
+		if (ndiri .eq. 0) go to 210
+		ndiski=index (line(1:nline), 'DISK')
+		nfili = index (line(1:nline), 'FILE')
+		read(lun11, 102) line(1:nline)
+		read(lun11, 102) line(1:nline)
+		nfilf=nline
+		ifirst = 0
+	endif
+c
+		if (index(line,'[') .eq. 0) goto 210
+		filename(1:) = line(nfili:nfilf)
+		nfirblk=index(filename(1:),' ')
+		if (nfirblk .ne. 0) filename(1:)=filename(1:nfirblk)
+		ndirf = index (line(ndiri:nline),']') + ndiri - 1
+		direct(1:) = line(ndiri:ndirf)
+		if (ndiski .eq. 0) then
+			disk(1:) = 'DH:'
+		else
+			ndiskf = index (line(ndiski:nline),' ') + ndiski - 1
+			disk(1:) = line (ndiski:ndiskf)
+		endif
+		nk=lenstr(disk)
+		nd=lenstr(direct)
+		nf=lenstr(filename)
+c
+c  Check for "[" at start of directory name
+c
+		if (direct(1:1) .ne. '[') go to 210
+c
+		datafile=disk(1:nk)//direct(1:nd)//filename(1:nf)
+	return
+300	if (ifirst .eq. 0) then
+	    leof = .true.
+	    ifirst = 1
+	    return
+	else
+	    rewind lun11
+	    lrim = .false.
+	    read (lun11,102)datafile
+	    datafile=datafile(1:lenstr(datafile))
+	    return
+	endif
+	end
+
+#ifdef unix
+	block data init_cefile
+
+	common /cefile/ ndiski,ndiskf,ndiri,ndirf,nfili,nfilf,ifirst 
+	data ifirst /1/
+	end
+#endif
diff --git a/ppl/pplepic/ekeycls.F b/ppl/pplepic/ekeycls.F
new file mode 100644
index 0000000..8ac86c0
--- /dev/null
+++ b/ppl/pplepic/ekeycls.F
@@ -0,0 +1,53 @@
+	subroutine ekeycls
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)ekeycls.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Closes EPICKEY file (Unit lun21).
+c
+c  Programmed by N. Soreide, Oct 85.
+c
+	common /epiclun/ lun1,lun11,lun21
+	close (lun21)
+	return
+	end
diff --git a/ppl/pplepic/ekeyopn.F b/ppl/pplepic/ekeyopn.F
new file mode 100644
index 0000000..ff1b06f
--- /dev/null
+++ b/ppl/pplepic/ekeyopn.F
@@ -0,0 +1,65 @@
+	subroutine ekeyopn
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)ekeyopn.F	1.1.1.1    7/30/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Opens EPICKEY file on Unit lun21. Contains CTD Cast Data Header variable
+c  codes.
+c
+	common /epiclun/ lun1,lun11,lun21
+c
+	if (lun21 .eq. 0) lun21 = 21
+c
+#ifdef unix
+	OPEN (UNIT=LUN21, 
+     *	FILE='/usr/local/lib/epic/epickey.values',
+     *	FORM='FORMATTED', STATUS='OLD')
+#else
+        OPEN (UNIT=LUN21, FILE='DISK1:[NNS.EPIC]EPICKEY.DAT',
+     1 ACCESS='KEYED', FORM='FORMATTED', KEY=(1:4:CHARACTER),
+     2 ORGANIZATION='INDEXED', RECL=132, RECORDTYPE='VARIABLE',
+     3 SHARED, READONLY, STATUS='OLD', CARRIAGECONTROL='LIST')
+#endif
+C
+	return
+	end
diff --git a/ppl/pplepic/ekeyrd.F b/ppl/pplepic/ekeyrd.F
new file mode 100644
index 0000000..288355b
--- /dev/null
+++ b/ppl/pplepic/ekeyrd.F
@@ -0,0 +1,79 @@
+	subroutine ekeyrd (varcd, labsml, label, comment)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)ekeyrd.F	1.1.1.1    7/30/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Reads EPICKEY file (Unit lun21) to get short graph label, full label and
+c  comment for variable code varcd.
+c
+c  Programmed by N. Soreide, Oct 85.
+c
+	common /epiclun/ lun1,lun11,lun21
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C
+C *kob* 1/03 - g77 port requires format of nX, rather than just X.  
+C              Assuming 1x is proper
+	character varcd*(*), labsml*(*), label*(*), comment*(*)
+#ifdef unix
+	character varrd*4
+#endif
+c
+	if (lun21 .eq. 0) lun21=21
+#ifdef unix
+	rewind(lun21)
+10	read (lun21, 100,err=200,end=200) varrd, labsml, label, comment
+100	format (a4, 1x, a3, 1x, a25, 1x, a97)
+	if(varrd.ne.varcd)goto 10
+#else
+        read (lun21, 100, key=varcd, err=200) labsml, label, comment
+100     format (4x, x, a3, x, a25, x, a97)
+#endif
+	return
+c
+200	labsml(1:)=' '
+	label(1:)=' '
+	comment(1:)=' '
+	return
+	end
diff --git a/ppl/pplepic/epicrd.F b/ppl/pplepic/epicrd.F
new file mode 100644
index 0000000..4f9f396
--- /dev/null
+++ b/ppl/pplepic/epicrd.F
@@ -0,0 +1,112 @@
+	subroutine epicrd (ncast, ndata, leof, prhead)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epicrd.F	1.1.1.1    10/21/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Reads name of a data file from unit lun11 (an EPIC file or other pointer
+C  file for CTD data opened by subroutine epicopn).  If end-of-file
+c  encountered on unit lun11,  leof is set .true.. Opens data file on unit
+c  lun1 and reads header.  Prints header on output file if prhead is true,
+c  not if false.  Reads number of variables and variable codes.  Returns
+c  nvars and varcd(i) in common/comvar/.
+c
+c  Programmed by N Soreide, Jun 85.
+c  Modified for other pointer file and variable info, NNS, Oct 85.
+c
+	character direct*20, filename*14, datafile*132, disk*11
+	logical leof,prhead
+c
+	common /epiclun/ lun1,lun11,lun21
+c
+c Subroutine READHD
+	character*80 header(8),buffer(8)
+	common /comhdr/ header
+	common/dummy/buffer
+c
+c  Subroutine EPICRD 
+	character*4 varcd(20)
+	common/comvar/ nvars,varcd
+	common/comefil/datafile
+	character line*132, dat*3
+	common /comerd/ line
+c
+c  Subroutine EPICOPN EPIC file indicator
+	logical lepic
+	common /comepl/ lepic
+c
+c  Read data file name, open data file and read CTD header.
+c
+	if (lun1 .eq. 0) lun1 = 1
+	if (lun11 .eq. 0) lun11=11
+c
+	call efile(datafile,dat,leof)
+	if (leof) goto 300
+c
+	call upcase(datafile,132)
+#ifdef unix
+	open (unit=lun1, form='unformatted', status='old',
+     *	file=datafile)
+#else
+	call upcase(datafile,80)
+	open (unit=lun1, form='unformatted', status='old',
+     *	readonly,file=datafile)
+#endif
+c
+   	ndfile=lenstr(datafile)
+	if (prhead) write (6,103) datafile(1:ndfile)
+103	format (/ ' Data file name is ', a /)
+c
+c  Read header, get number of variables and variable codes.
+c
+	call readhd (lun1, 0, ncast, ndata, 0, prhead, .false., .false.)
+	read (header(3)(79:80), 602) nvars
+602	format (i2)
+	read (header(5), 603) (varcd(i),i=1,nvars)
+603	format (20a4)
+	return
+c
+c  End-of-file encountered on list of data file names (EPIC file)
+c
+300	continue
+	return
+	end
diff --git a/ppl/pplepic/epicsq.F b/ppl/pplepic/epicsq.F
new file mode 100644
index 0000000..aca1da5
--- /dev/null
+++ b/ppl/pplepic/epicsq.F
@@ -0,0 +1,74 @@
+	subroutine epicsq (xd,xt,iseq)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epicsq.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Input:
+c  xd,xt = EPIC date, time words (type REAL) (xd=yymmdd and xt=hhmm).
+c
+c  Output:
+c  iseq = Sequence number in minutes from a date which is approximately
+c         the start of the century.  (type INTEGER*4)
+c
+c  Uses MILELIB function JDAY to perform calculations.  Used to get
+c  EPIC time words into a sequence number for PPLUS.
+c
+c  Programmed by N. Soreide, Dec 86.
+c
+	integer*4 jday,iseq
+c
+	idate=xd+.001
+	itime=xt+.001
+c
+	iy=idate/10000
+	im1=idate-iy*10000
+	im=im1/100
+	id=im1-im*100
+	ihr=itime/100
+	imin=itime-ihr*100
+c
+	iseq = jday (iy, im, id, ihr, imin)
+c
+	return
+	end
+
diff --git a/ppl/pplepic/epictimc.F b/ppl/pplepic/epictimc.F
new file mode 100644
index 0000000..819fff0
--- /dev/null
+++ b/ppl/pplepic/epictimc.F
@@ -0,0 +1,59 @@
+	subroutine epictimc (xdate,xtime,icom)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epictimc.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Takes real numbers xdate,xtime (EPIC date/time) and writes
+c  character date date/time in WHOI format (yymmddhhmm) for PLOT5.
+c
+c  Programmed by N. Soreide, May 86.
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	character icom*(*)
+c
+	write (icom,100) ifix(xdate+.5),ifix(xtime+.5)
+100	format (i6.6,i4.4)
+	return
+	end
diff --git a/ppl/pplepic/epictlab.F b/ppl/pplepic/epictlab.F
new file mode 100644
index 0000000..00777d8
--- /dev/null
+++ b/ppl/pplepic/epictlab.F
@@ -0,0 +1,229 @@
+	subroutine epictlab
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epictlab.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Reads PLOT5 x- and y-axis labels from EPIC key file for EPIC time series
+c  data.  Also extracts plot title from time series header:  "description"
+c  at "locaion (depth zz m)", where description is descript field if it's
+c  non-blank, project/experiment/mooring otherwise.
+c
+c  Sets PPLUS symbols for depth, lat, long, comment lines from header,
+c  xlab, ylab, project, mooring, descript from header.
+c
+c  Sets PPLUS symbols for CTD report-generator graph title with
+c  info from first 4 lines of CTD header.
+c
+c  Programmed by N. Soreide, May 86.
+c  Modified to set PPLUS symbol PPL$EPIC_DATAFILE(n), NNS, Aug 87.
+c  Modified for CTD report-generator, NNS, Dec 87.
+c
+#ifdef unix
+	include 'PARAMPL5.DAT'
+	include 'COMDATF.INC'
+	include 'COMEPV.INC'
+	include 'COMEPS.INC'
+	include 'COMVAR.INC'
+	include 'COMTHDR.INC'
+	include 'LABELS.INC'
+	include 'DATA.INC'
+#else
+	include 'pplinc:parampl5.dat'
+	include 'epicinc:comdatf.inc'
+	include 'epicinc:comepv.inc'
+	include 'epicinc:comeps.inc'
+	include 'epicinc:comvar.inc'
+	include 'epicinc:comthdr.inc'
+	include 'pplinc:labels.inc'
+	include 'pplinc:data.inc'
+#endif
+	character labsml*3,comment*97,cloc*8,sym*30
+	character chalat*8,chalon*9,chapro*10,chaexp*5,chamoo*5
+	character chadep*7
+	character ctdcast*19,ctddate*14,ctdtime*13,ctdlat*12,ctdlon*14
+	character cnumber*3,dnumber*3
+	equivalence (chalat,theader(1)(6:13)),
+     1	(chalon,theader(1)(22:30)),
+     1	(chapro,theader(2)(36:45)),
+     1	(chaexp,theader(2)(48:52)),
+     1	(chamoo,theader(1)(48:52)),
+     1	(chadep,theader(1)(39:45))
+	equivalence (ctdcast,theader(1)(1:19)),
+     1	(ctddate,theader(1)(23:36)),
+     1	(ctdlat,theader(2)(1:12)),
+     1	(ctdlon,theader(2)(15:28)),
+     1	(ctdtime,theader(1)(40:52))
+c
+c  Read x- and y-axis labels from EPIC key file.
+c
+	call ekeyopn
+	if (jx .gt. 0) then
+	    call ekeyrd (varcd(jx),labsml,xlab,comment)
+	    write (sym,100) 'XLAB',linen
+100	    format ('*PPL$EPIC_', A, '(', I2.2, ')')
+	    nchars=lenstr(xlab)
+	    call putsym(sym,xlab(1:nchars),nchars,ier)
+	endif
+	if (jy .gt. 0) then
+	    call ekeyrd (varcd(jy),labsml,ylab,comment)
+	    write (sym,100) 'YLAB',linen
+	    nchars=lenstr(ylab)
+	    call putsym(sym,ylab(1:nchars),nchars,ier)
+	endif
+	call ekeycls
+c
+c  Read Graph Title and set PPLUS symbols
+c
+	if (lsctd) then
+	    write (sym,100) 'LATITUDE',linen
+	    call putsym(sym,ctdlat,12,ier)
+	    write (sym,100) 'LONGITUDE',linen
+	    call putsym(sym,ctdlon,14,ier)
+	    write (sym,100) 'CAST',linen
+	    call putsym(sym,ctdcast,19,ier)
+	    write (sym,100) 'DATE',linen
+	    call putsym(sym,ctddate,14,ier)
+	    write (sym,100) 'TIME',linen
+	    call putsym(sym,ctdtime,13,ier)
+c
+	    write (sym,100) 'CTD1HD',linen
+	    call putsym(sym,theader(1)(1:52),52,ier)
+	    write (sym,100) 'CTD2HD',linen
+	    call putsym(sym,theader(2)(1:52),52,ier)
+	    write (sym,100) 'CTD3HD',linen
+	    call putsym(sym,theader(3)(1:52),52,ier)
+	    write (sym,100) 'CTD4HD',linen
+	    call putsym(sym,theader(4)(1:52),52,ier)
+c
+c  Get cast number into a PPLUS global symbol.  Strip blanks and
+c  leading zeros from the cast number.
+c
+	    cnumber(1:3)=theader(1)(17:29)
+	    if (cnumber(1:1) .eq. '0') then
+		if (cnumber(2:2) .eq. '0') then
+		    dnumber(1:)=cnumber(3:3)
+		    idnum=1
+		else
+		    dnumber(1:)=cnumber(2:3)
+		    idnum=2
+		endif
+	    else
+		dnumber=cnumber
+		idnum=3
+	    endif
+	    call stripit(dnumber(1:idnum),idnum,' ',cnumber,icnum)
+	    if (icnum .eq. 0) then
+		cnumber(1:1)=' '
+		icnum=1
+	    endif
+	    write (sym,100) 'CASTNUM',linen
+	    call putsym(sym,cnumber(1:icnum),icnum,ier)
+	else
+	    ipro=lenstr(chapro)
+	    iexp=lenstr(chaexp)
+	    imoo=lenstr(chamoo)
+	    idep=lenstr(chadep)
+	    write (sym,100) 'LATITUDE',linen
+	    call putsym(sym,chalat,8,ier)
+	    write (sym,100) 'LONGITUDE',linen
+	    call putsym(sym,chalon,9,ier)
+	    write (sym,100) 'PROJECT',linen
+	    call putsym(sym,chapro,10,ier)
+	    write (sym,100) 'EXPERIMENT',linen
+	    call putsym(sym,chaexp,5,ier)
+	    write (sym,100) 'MOORING',linen
+	    call putsym(sym,chamoo,5,ier)
+	    write (sym,100) 'DEPTH',linen
+	    call putsym(sym,chadep,7,ier)
+	    write (sym,100) 'COMMENT_DATA',linen
+	    call putsym(sym,theader(6),lenstr(theader(6)),ier)
+	endif
+	write (sym,100) 'COMMENT_FIRST',linen
+	call putsym(sym,theader(7),lenstr(theader(7)),ier)
+	write (sym,100) 'COMMENT_SECOND',linen
+	call putsym(sym,theader(8),lenstr(theader(8)),ier)
+	write (sym,100) 'DATAFILE',linen
+	call putsym(sym,datafile,lenstr(datafile),ier)
+C
+	if (lsctd) then
+	    lab1(1:)=ctdcast//' '// ctddate//' '//
+     1	    ctdlat//' '//ctdlon
+	else
+	    xlat=geo1(theader(1)(5:13))
+	    xlon=geo1(theader(1)(22:30))
+	    call geochar(xlat,xlon,cloc)
+	    nd=lenstr(theader(4)(1:26))
+	    write (sym,100) 'DESCRIPT',linen
+	    call putsym(sym,theader(4)(1:26),26,ier)
+	    if (nd.eq.0) then
+c
+c  descript is blank, so use proj/exp/moorname where these aren't blank.
+c
+		if (ipro .eq. 0) then
+		    nlab=0
+		else
+		    lab1(1:22)=chapro
+		    nlab=lenstr(lab1(1:22))
+		endif
+		if (iexp .ne. 0) then
+		    lab1(nlab+1:22)=' / '//chaexp(1:iexp)
+		    nlab=lenstr(lab1(1:22))
+		endif
+		if (imoo .ne. 0) then
+		    lab1(nlab+1:22)=' / '//chamoo(1:imoo)
+		endif
+		nlab=lenstr(lab1(1:22))
+	    else
+c
+c  use descript for title
+c
+		lab1 (1:26)=theader(4)(1:26)
+		nlab=nd
+	    endif
+	    lab1(nlab+1:)=' at ' //
+     1	    cloc // ' (' // theader(1)(33:45)
+     1	    // ')'
+	    lab1(1:)='@TR'//lab1
+	endif
+	return
+	end
diff --git a/ppl/pplepic/epictlim.F b/ppl/pplepic/epictlim.F
new file mode 100644
index 0000000..c906a63
--- /dev/null
+++ b/ppl/pplepic/epictlim.F
@@ -0,0 +1,91 @@
+	subroutine epictlim (xdate,xtime,xdat2,xtim2)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epictlim.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Called by PLOT5's RDSEQ.  Input is starting xdate,xtime and
+c  ending xdat2,xtim2 for EPIC time series.  Output is itmin,itmax
+c  which is range of times for all time series currently in buffer.
+c
+c  Programmed by N. Soreide, May 86.
+c
+#ifdef unix
+	include 'AXISL.INC'
+	include 'TAXIS.INC'
+	include 'DATA.INC'
+#else
+	include 'pplinc:axisl.inc'
+	include 'pplinc:taxis.inc'
+	include 'pplinc:data.inc'
+#endif
+c
+	if (linen .eq. 1) then
+c
+c  First series in buffer
+c
+	    call epictimc (xdate,xtime,itmin)
+	    if (iautot .eq. 1) itstrt=itmin
+	    call epictimc (xdat2,xtim2,itmax)
+	else
+c
+c  Find time range minimum
+c
+	    read (itmin,100) xd,xt
+100	    format (f6.0,f4.0)
+	    if (xdate .lt. xd) then
+	        call epictimc (xdate,xtime,itmin)
+	    else if (xdate.eq.xd .and. xtime.lt.xt) then
+		call epictimc (xdate,xtime,itmin)
+	    endif
+c
+c  Find time range maximum
+c
+	    read (itmax,100) xd,xt
+	    if (xdat2 .gt. xd) then
+		call epictimc (xdat2,xtim2,itmax)
+	    else if (xdat2.eq.xd .and. xtim2.gt.xt) then
+		call epictimc(xdat2,xtim2,itmax)
+	    endif
+	endif
+	return
+	end
diff --git a/ppl/pplepic/epictrd.F b/ppl/pplepic/epictrd.F
new file mode 100644
index 0000000..756c02a
--- /dev/null
+++ b/ppl/pplepic/epictrd.F
@@ -0,0 +1,132 @@
+	subroutine epictrd (ndata, di, ti, df, tf, dt, leof, prhead)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epictrd.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Reads name of a time series data file from unit lun11 (an EPIC file or other
+c  pointer file opened by subroutine epicopn).  If end-of-file encountered on
+c  unit lun11,leof is set .true.. Opens data file on unit lun1 and reads header.
+c  Prints header on output file if prhead is true, not if false.  Reads
+c  number of variables and variable codes.  Returns nvars and varcd(i) in
+c  common/comvar/.
+c
+c  Programmed by N Soreide, Jun 85.
+c  Modified for other pointer file and variable info, NNS, Oct 85.
+c  Modified from epicrd for time series data, NNS, Mar 86.
+c
+	logical leof,prhead
+c
+c Subroutine READHD
+	character*80 theader(8)
+	common /comthdr/ theader
+c
+c  Subroutine EPICRD 
+	character*4 varcd(20)
+	common/comvar/ nvars,varcd
+	common/comefil/datafile
+	common/comedat/dat
+	character line*132, dat*3, datafile*132
+	common /comerd/ line
+c
+c  Subroutine EPICOPN EPIC file indicator
+	logical lepic
+	common /comepl/ lepic
+c
+	common /epiclun/ lun1,lun11,lun21
+c
+	data nline /132/
+c
+c  Read data file name, open data file and read CTD header.
+c
+	if (lun1 .eq. 0) lun1=1
+	if (lun11 .eq. 0) lun11=11
+c
+	leof=.false.
+c
+	if (lepic) then
+		call efile (datafile, dat, leof)
+		if (leof) return
+	else
+		read (lun11, 102, end=300) datafile
+102		format (a)
+	endif
+c
+#ifdef unix
+	open (unit=lun1, form='unformatted', status='old', 
+     *	file=datafile)
+#else
+	open (unit=lun1, form='unformatted', status='old', 
+     *	readonly,file=datafile)
+#endif
+c
+c  Check that this is time series data
+c
+	rewind lun1
+	read (lun1) theader(1)
+	read (lun1) theader(2)
+	if (theader(2)(78:78) .ne. 'T') then
+		write (6,104) theader(2)(78:78)
+104		format (//' This is not time series data.',
+     *		' Header type is ', a, ' - STOP')
+		stop
+	endif
+	rewind lun1
+c
+c  Read header, get number of variables and variable codes.
+c
+	if (prhead) write (6,103) datafile(1:lenstr(datafile))
+103	format (/ ' Data file name is ', a /)
+c
+	call readthd (lun1, 0, ndata, di, ti, df, tf, dt, prhead,
+     *	.false., .false.)
+	read (theader(3)(79:80), 602) nvars
+602	format (i2)
+	read (theader(5), 603) (varcd(i),i=1,nvars)
+603	format (20a4)
+	return
+c
+c  End-of-file encountered on list of data file names (EPIC file)
+c
+300	leof=.true.
+	return
+	end
diff --git a/ppl/pplepic/epicv.F b/ppl/pplepic/epicv.F
new file mode 100644
index 0000000..ec52914
--- /dev/null
+++ b/ppl/pplepic/epicv.F
@@ -0,0 +1,123 @@
+	subroutine epicv (ev,iev)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epicv.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Translates character variable memonics in the PLOT5 EVAR command into
+c  generic variable codes (integer) used in EPIC subroutine VARCK.
+c
+c  If the input variable memonic is unrecognized, then the character 
+c  EVAR argument could contain a numeric column number.  If this is so,
+c  then iev is set equal to this column number + 10000, to flag it as
+c  a colunn number and not a generic integer variable code.
+c
+c  If numeric data can not be read from the character EVAR argument,
+c  then the output generic code will be -1.
+c
+c  Programmed by N. Soreide, May 86.
+c
+#ifdef unix
+	include 'TAXIS.INC'
+#else
+	include 'pplinc:taxis.inc'
+#endif
+	character *(*) ev
+c
+	iev=-1
+	if (index (ev,'STK') .ne. 0) then
+		iev=10
+	else if (index (ev,'TIM') .ne. 0) then
+		iev=9
+		itflg=1
+	else if (index (ev,'DYN') .ne. 0) then
+		iev=8
+	else if (index (ev,'SIG') .ne. 0) then
+		iev=3
+	else if (index (ev,'SAL') .ne. 0) then
+		iev=2
+	else if (index (ev,'OX') .ne. 0) then
+		iev=4
+	else if (index (ev,'CO') .ne. 0) then
+		iev=5
+	else if (index (ev,'P') .ne. 0) then
+		iev=0
+	else if (index (ev,'T') .ne. 0) then
+		iev=1
+	else if (index (ev,'U') .ne. 0) then
+		iev=6
+	else if (index (ev,'V') .ne. 0) then
+		iev=7
+c
+c  See if character input is of form "Cn" where n is the column number 
+c  (add 10000 to flag it as a column number) or of the form "En" where
+c  n is the variable code from the EPICKEY file (add 20000 to flag it
+c  as an EPICKEY variable code).
+c
+c       If the read is unsuccessful, then set the code to unknown (-1).
+c
+        else if (index(ev,'C') .ne. 0) then
+            ichev=lenstr(ev)
+            read (ev(2:ichev),*,err=100) iev
+            iev=iev+10000
+        else if (index(ev,'E') .ne. 0) then
+            ichev=lenstr(ev)
+            read (ev(2:ichev),*,err=100) iev
+            iev=iev+20000
+	else
+c
+c       If the character input to EVAR is unrecognized at this point, try
+c       to read the column number from the character input.  If this is 
+c       is successful, add 10000 to the column number to flag it as
+c       a column number and not a generic integer variable code.
+c
+c       If the read is unsuccessful, then set the code to unknown (-1).
+c
+	    ichev=lenstr(ev)
+	    read (ev(1:ichev),*,err=100) iev
+	    iev=iev+10000
+	endif
+	return
+c
+100	iev=-1
+	return
+	end
diff --git a/ppl/pplepic/epicvar.F b/ppl/pplepic/epicvar.F
new file mode 100644
index 0000000..490f0e4
--- /dev/null
+++ b/ppl/pplepic/epicvar.F
@@ -0,0 +1,133 @@
+	subroutine epicvar
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epicvar.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Interprets PLOT5 EVAR command, which allows user to select EPIC variables
+c  for plotting.
+c
+c  EVAR ?		Lists variable choices for user.
+c  EVAR TIM,T		Selects x=time and y=temperature
+c  EVAR			Selects x=time and y=first variable after time/date
+c  EVAR STK     \_______
+c  EVAR TIM STK /       Selects stick plots vs time
+c  EVAR TIM,Cn          Selects x=time and y=variable in column n
+c  EVAR TIM,En          Selects x=time and y=variable with EPICKEY
+c                       variable code n.
+c
+c  Called in COMND.
+c
+c  Programmed by N. Soreide, May 86.
+c
+#ifdef unix
+	include 'CMRD.INC'
+	include 'CMRDL.INC'
+	include 'TAXIS.INC'
+	include 'COMEPV.INC'
+	include 'COMEPS.INC'
+#else
+	include 'pplinc:CMRD.INC'
+	include 'pplinc:CMRDL.INC'
+	include 'pplinc:TAXIS.INC'
+	include 'epicinc:COMEPV.INC'
+	include 'epicinc:COMEPS.INC'
+#endif
+	character ev1*5,ev2*5
+c
+	itflg=0
+	ieflg=1
+c
+	if (index(label(1:n),'?') .ne. 0) then
+c
+c  Put out parameter list if parameter1 is ?
+c
+	    write (5,100)
+100	    format (' Pressure        P'/
+     1	                   ' Temperature     T'/
+     2	                   ' Salinity        SAL'/
+     3	                   ' Sigma-T         SIG'/
+     4	                   ' Oxygen          OX'/
+     5	                   ' Conductivity    CO'/
+     6	                   ' U               U'/
+     7	                   ' V               V'/
+     8	                   ' Dynamic Ht      DYN'/
+     9	                   ' Time            TIM'/
+     1	                   ' Stick Plots     STK'/)
+c
+c  If EVAR and no parameters, then use x=time, y=first variable after time
+c
+	else if (n .eq. 0) then
+	    iepv1=9
+	    iepv2=-1
+	    if (lsctd) iepv1=-1
+c
+c  EVAR with parameters
+c
+	else
+	    isp1=index(label(1:n),' ')
+	    ico1=index(label(1:n),',')
+	    if (isp1.eq.0 .and. ico1.eq.0) then
+		write (5,101)
+101		format (' EVAR command must have 2 parameters')
+		return
+	    else if (isp1 .eq. 0) then
+		is=ico1
+	    else if (ico1 .eq. 0) then
+		is=isp1
+	    else
+		is=min0(isp1,ico1)
+	    endif
+	    ev1(1:)=label(1:is-1)
+	    ev2(1:)=label(is+1:n)
+	    call epicv (ev1,iepv1)
+	    call epicv (ev2,iepv2)
+	endif
+c
+c  If x-variable is STK, make x=TIM, and y=STK
+c
+	if (iepv1 .eq. 10) then
+	    iepv1=9
+	    iepv2=10
+	endif
+	return
+	end
diff --git a/ppl/pplepic/epicvc.F b/ppl/pplepic/epicvc.F
new file mode 100644
index 0000000..cb7d34d
--- /dev/null
+++ b/ppl/pplepic/epicvc.F
@@ -0,0 +1,116 @@
+	subroutine epicvc
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)epicvc.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Gets column numbers for variables specified by the PLOT5 EVAR command.
+c  Called in RDSEQ for each EPIC data file read.  For EVAR/NOCTD, the
+c  default x is time and threis no default for y.  For 	EVAR/CTD, the
+c  default for y is the variable in column 1 (usually pressure)
+c  and the default for x is the variable in column 2.
+c  The file is omitted  if selected data is not on the data file.
+c
+c  Programmed by N. Soreide, May 86.
+c  Modified for CTD data 1/87, NNS.
+c
+#ifdef unix
+	include 'DATA.INC'
+	include 'COMTHDR.INC'
+	include 'COMEPV.INC'
+	include 'COMEPS.INC'
+#else
+	include 'pplinc:data.inc'
+	include 'epicinc:comthdr.inc'
+	include 'epicinc:comepv.inc'
+	include 'epicinc:comeps.inc'
+#endif
+	logical varok,varck
+c
+c  Set jz=0 since EVAR is not used for contour data.
+c
+        jz=0
+c
+c  If iepv1 is .ge. 20000, then EPICKEY variable code = iepv1-20000.
+c  If iepv1 is .ge. 10000, then column number = iepv1-10000.
+c
+c  Get x variable column number.  If not in data file, set jx=0
+c  to get time as x-axis variable (in RDSEQ).  If iepv1=9, set
+c  jx=0 for time as x-axis variable.
+c
+	if (iepv1.eq.-1 .or. iepv1.eq.15 .or. iepv1.eq.9) then
+		jx=0
+        else if (iepv1 .ge. 20000) then
+                call varkey (theader,iepv1-20000,jx)
+	else if (iepv1 .ge. 10000) then
+		jx=iepv1-10000
+	else
+		varok=varck(theader,-iepv1,jx)
+		if (.not. varok) jx=0
+	endif
+c
+c  If iepv2 is .ge. 10000, then column number = iepv1-10000.
+c
+c  Get y variable column number.  If not in data file or iepv2=9, set 
+c  jy=0 get time as y-variable.  If iepv2 is -1, use first
+c  variable after date/time for y-variable.
+c
+	if (iepv2 .eq. -1) then
+		jy=3
+	else if (iepv2 .eq. 9) then
+		jy=0
+        else if (iepv2 .ge. 20000) then
+                call varkey (theader,iepv2-20000,jy)
+	else if (iepv2 .ge. 10000) then
+		jy=iepv2-10000
+	else
+		varok=varck(theader,-iepv2,jy)
+		if (.not. varok) jy=0
+	endif
+	nvar=max0 (jx,jy)
+	if (lsctd) then
+	    if (iepv1 .eq. -1) jx=2
+	    if (iepv2 .eq. -1) jy=1
+	endif
+	ngrp=1
+	return
+	end
diff --git a/ppl/pplepic/fixtim.F b/ppl/pplepic/fixtim.F
new file mode 100644
index 0000000..47bdc2a
--- /dev/null
+++ b/ppl/pplepic/fixtim.F
@@ -0,0 +1,119 @@
+	subroutine fixtim (it1,it2,itnew1,itnew2,itype)
+C** 
+C**    @(#)fixtim.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Input:
+c	it1,it2 = input range of times in PLOT5's WHOI format (yyddmmhhmm)
+c	itype   = PLOT5 axis type 0 even hours		ending     00
+c                                 1 even days		ending   0000
+c                                 3 even months		ending 010000
+c  Output:
+c	itnew1,itnew2 = range of times which suit the input axis type and
+c                       include the input range of times (yymmddhhmm)
+c
+c  Uses subroutines TIME1 (sequence # <--> WHOI times and NUMDM1
+c  (# days in month) from PLOT5's MILELIB.
+c
+c  Programmed by N. Soreide, May 86.
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Mod J Davison 11.21.95 For 4 digit years
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C 
+C *acm* 4/22/02  replace ALL places lower than the desired round-off
+C                with 00.  e.g. if 950115013303 is to be expressed
+C                in even hours, make it 950115010000 not 950115010003
+
+c
+	character*(*) it1,it2,itnew1,itnew2
+	character*14 cdum
+c
+	if (itype .eq. 3) then
+cc acm	    itnew1=it1(1:4)//'010000'//it1(11:14)
+	    itnew1=it1(1:4)//'01000000'//it1(13:14)
+
+	    if (it2(5:10) .eq. '010000') then
+		itnew2=it2
+	    else
+		dt=1440.
+		nm=numdm1(it2)
+		read (it2(5:6),*) id
+		iseq=nm-id+2
+cc		call time1 (1, it2(1:6)//'0000'//it2(11:14), iseq,
+cc     1		                cdum, idum, itnew2, dt)
+		call time1 (1, it2(1:6)//'000000'//it2(13:14), iseq,
+     1		                cdum, idum, itnew2, dt)
+	    endif
+
+	else if (itype .eq. 1) then
+cc	    itnew1=it1(1:6)//'0000'//it1(11:14)
+	    itnew1=it1(1:6)//'000000'//it1(13:14)
+	    if (it2(7:10) .eq. '0000') then
+		itnew2=it2
+	    else
+		dt=1440.
+		iseq=2
+cc		call time1 (1, it2(1:6)//'0000'//it2(11:14), iseq,
+cc     1		                cdum, idum, itnew2, dt)
+		call time1 (1, it2(1:6)//'000000'//it2(13:14), iseq,
+     1		                cdum, idum, itnew2, dt)
+	    endif
+	else if (itype .eq. 0) then
+cc	    itnew1=it1(1:8)//'00'//it1(11:14)
+	    itnew1=it1(1:8)//'0000'//it1(13:14)
+	    if (it2(9:10) .eq. '00') then
+		itnew2=it2
+	    else
+		dt=60.
+		iseq=2
+cc		call time1 (1, it2(1:8)//'00'//it2(11:14), iseq,
+cc     1		                cdum, idum, itnew2, dt)
+		call time1 (1, it2(1:8)//'0000'//it2(13:14), iseq,
+     1		                cdum, idum, itnew2, dt)
+	    endif
+	endif
+	return
+	end
+
diff --git a/ppl/pplepic/frsthd.F b/ppl/pplepic/frsthd.F
new file mode 100644
index 0000000..f7e2286
--- /dev/null
+++ b/ppl/pplepic/frsthd.F
@@ -0,0 +1,83 @@
+      SUBROUTINE FRSTHD(ITAPEI,NCAST,NDATA)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)frsthd.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C  THIS SUBROUTINE WILL READ 1  HEADER FROM A  CAST THAT IS LOCATED ON
+C  TAPE ITAPEI. IT WILL RETURN THE VALUES FOR CAST NUMBER AND NUMBER OF 
+C  DATA POINTS IN NCAST AND NDATA.  HEADER INFORMATION WIL BE RETURNED 
+C  IN HEADER.
+C
+C  PROGRAMMED 10/84 BY M. VERSCHELL
+C
+      CHARACTER*80 HEADER(8)
+      COMMON /COMHDR/ HEADER
+C
+C  READ IN HEADER FROM TAPE ITAPEI
+C
+      READ (ITAPEI) HEADER(1)
+      GOTO 100
+   99 READ (ITAPEI,END=9000) HEADER(1)
+  100 DO 150 J=2,8
+      READ (ITAPEI,END=9000) HEADER(J)
+  150 CONTINUE 
+C
+C  IF HEADER READ IN CORRECTLY, ISOLATE AND CONVERT NCAST AND NDATA
+C
+      READ(HEADER(1)(17:19),200) NCAST
+  200 FORMAT(I3)
+      READ(HEADER(3)(55:60),300) NDATA
+  300 FORMAT(I6)
+      RETURN
+C
+C  HERE BEGINS THE ERROR HANDLING CODE
+C
+ 9000 WRITE (6,9100) NERROR
+ 9100 FORMAT(1X,'FORTRAN RUN TIME ERROR #',I2)
+      IF (NERROR .EQ. -1) WRITE (6,9200)
+ 9200 FORMAT(1X,'END OF FILE READ BEFORE ALL OF HEADER READ')
+      IF (NERROR .EQ. 29) WRITE (6,9300)
+ 9300 FORMAT(1X,'TAPE 1 NOT ASSIGNED (FOR001.DAT NOT FOUND)')
+      IF (NERROR .EQ. 61) WRITE (6,9400)
+ 9400 FORMAT(1X,'ERROR IN CONVERSION OF NCAST OR NDATA')
+      STOP
+      END
diff --git a/ppl/pplepic/geo.F b/ppl/pplepic/geo.F
new file mode 100644
index 0000000..7031b94
--- /dev/null
+++ b/ppl/pplepic/geo.F
@@ -0,0 +1,69 @@
+	FUNCTION GEO (SLAT,NSLAT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)geo.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C
+C  RECEIVES CHARACTER LATITUDE OR LONGITUDE (D[DD MM.M]S) AND RETURNS 
+C  REAL NUMBER LATITUDE OR LONGITUDE IN DEGREES (+ FOR NORTH, - FOR SOUTH)
+C  (+ FOR WEST, 360-LONGITUDE FOR EAST)
+C
+C  PROGRAMMED BY N SOREIDE, SEP 84
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER SLAT*(*), HEMI*1
+C	CHARACTER HOLD*15
+	HOLD = 110
+	RM = 0.
+	IF (NSLAT.EQ.1 .AND. SLAT(1:1).EQ.'0') THEN
+		GEO=0.
+	ELSE
+		HEMI = SLAT(NSLAT:nslat)
+		read(slat(1:nslat-1),*)RD, RM
+		GEO = RD + RM/60.
+		IF (HEMI .EQ. 'S') GEO = -GEO
+		IF (HEMI .EQ. 'E') GEO = 360.-GEO
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/pplepic/geo1.F b/ppl/pplepic/geo1.F
new file mode 100644
index 0000000..715176e
--- /dev/null
+++ b/ppl/pplepic/geo1.F
@@ -0,0 +1,59 @@
+	function geo1 (lat)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)geo1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Receives lat (character*8,9 with hemisphere designation).  Finds geo1
+c  as a real number in EPIC lat/long notation.  Just like function GEO,
+c  except GEO wants lat as character(8,9) not character*8,9.
+c
+c  Programmed by N. Soreide, Apr 86.
+c
+	character *(*) lat
+	character clat(9)
+	nc=lenstr(lat)
+	read (lat,100) (clat(j),j=1,nc)
+100	format (9a1)
+	geo1 = geo (clat,nc)
+	return
+	end
diff --git a/ppl/pplepic/geochar.F b/ppl/pplepic/geochar.F
new file mode 100644
index 0000000..138d14d
--- /dev/null
+++ b/ppl/pplepic/geochar.F
@@ -0,0 +1,72 @@
+	subroutine geochar (xlat, xlon, title)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)geochar.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Receives xlat, xlon as EPIC real numbers.  Returns formatted character
+c  string title with the latitude and longitude (eg." 2N 110W", "10N  95W")
+c  in 8 characters.
+c
+c  Programmed by N. Soreide, Apr 86.
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	character title*(*)
+c
+	if (xlat .gt. 0) then
+	  write (title(1:4),100) ifix(xlat+.5001)
+100	  format (i2,'N ')
+	else
+	  write (title(1:4),101) ifix(-xlat+.5001)
+101	  format (i2,'S ')
+	endif
+	if (xlon .gt. 180.) then
+	  write (title(5:8),102) ifix(360.-xlon+.499)
+102	  format (i3,'E')
+	else
+	  write (title(5:8),103) ifix(xlon+.499)
+103	  format (i3,'W')
+	endif
+	return
+	end
diff --git a/ppl/pplepic/hdrt1.F b/ppl/pplepic/hdrt1.F
new file mode 100644
index 0000000..03b0d15
--- /dev/null
+++ b/ppl/pplepic/hdrt1.F
@@ -0,0 +1,74 @@
+      SUBROUTINE HDRT1 (ITAPEI, NDATA, DI, TI, DF, TF, DT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)hdrt1.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C
+C  THIS SUBROUTINE WILL READ FIRST HEADER FROM AN EPIC TIME SERIES DATA FILE ON
+C  TAPE ITAPEI. IT WILL RETURN INITIAL AND FINAL DATES (TI,TF) AND DT.
+C  THE WHOLE HEADER WIL BE RETURNED IN THEADER.
+C
+C  PROGRAMMED 10/84 BY M. VERSCHELL
+C
+C  MODIFIED 3/86, NNS.
+C
+C *kob* 1/03 - g77 port requires format of nX, rather than just X.  
+C              Assuming 1x is proper
+      CHARACTER*80 THEADER(8)
+      COMMON /COMTHDR/ THEADER
+C
+C  READ IN HEADER FROM TAPE ITAPEI
+C
+      READ (ITAPEI) THEADER(1)
+      GOTO 100
+  100 DO 150 J=2,8
+      READ (ITAPEI) THEADER(J)
+  150 CONTINUE 
+C
+C  IF HEADER READ IN CORRECTLY, ISOLATE AND CONVERT STARTING TIME 
+C
+      READ(THEADER(1)(55:78),200) DI,TI,DF,TF
+  200 FORMAT(F6.0,1X,F4.0,2X,F6.0,1X,F4.0)
+      READ(THEADER(3)(55:78),300) NDATA,DT
+  300 FORMAT(I6,E18.0)
+      RETURN
+      END
diff --git a/ppl/pplepic/lenstr.F b/ppl/pplepic/lenstr.F
new file mode 100644
index 0000000..661ceee
--- /dev/null
+++ b/ppl/pplepic/lenstr.F
@@ -0,0 +1,62 @@
+	function lenstr (string)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)lenstr.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Returns length of character string WITHOUT trailing blanks.
+c  Returns length as zero if string is all blanks.
+c
+c  Programmed by N Soreide, Jun 85.
+c
+	character*(*) string
+	l=len (string)
+	do 200 i=l,1,-1
+	  if (string(i:i).ne.' ') then
+	    lenstr=i
+	    return
+	  endif
+200	continue
+	lenstr=0
+	return
+	end
+
diff --git a/ppl/pplepic/nxthdr.F b/ppl/pplepic/nxthdr.F
new file mode 100644
index 0000000..5fac3c9
--- /dev/null
+++ b/ppl/pplepic/nxthdr.F
@@ -0,0 +1,74 @@
+      SUBROUTINE NXTHDR(ITAPEI)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)nxthdr.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C  THIS SUBROUTINE WILL READ IN THE NEXT HEADER IN A MULTI HEADER 
+C  FILE. IT WILL PLACE THE DATA IN ARRAY BUFFER.
+C
+C  PROGRAMMED 10/84 NY M.VERSCHELL
+C
+      CHARACTER*80 BUFFER(8)
+      COMMON /comnxt/ BUFFER
+C  
+C  READ IN NEXT HEADER
+C
+      READ (ITAPEI,END=99) BUFFER(1)
+      GOTO 100
+   99 READ (ITAPEI,END=9000) BUFFER(1)
+  100 DO 150 J=2,8
+      READ (ITAPEI,END=9000) BUFFER(J)
+  150 CONTINUE 
+	RETURN
+C
+C  HERE BEGINS THE ERROR HANDLING CODE
+C
+ 9000 WRITE (6,9100) NERROR
+ 9100 FORMAT(1X,'FORTRAN RUN TIME ERROR #',I2)
+      IF (NERROR .EQ. -1) WRITE (6,9200)
+ 9200 FORMAT(1X,'END OF FILE READ BEFORE ALL OF HEADER READ')
+      IF (NERROR .EQ. 29) WRITE (6,9300)
+ 9300 FORMAT(1X,'TAPE 1 NOT ASSIGNED (FOR001.DAT NOT FOUND)')
+      IF (NERROR .EQ. 61) WRITE (6,9400)
+ 9400 FORMAT(1X,'ERROR IN CONVERSION OF NCAST OR NDATA')
+      STOP
+      END
diff --git a/ppl/pplepic/readhd.F b/ppl/pplepic/readhd.F
new file mode 100644
index 0000000..7e81bbf
--- /dev/null
+++ b/ppl/pplepic/readhd.F
@@ -0,0 +1,109 @@
+      SUBROUTINE READHD(ITAPEI,ITAPEO,NCAST,NDATA,NCAST1,IPRNT,
+     1IWRITE,EXKEEP)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)readhd.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C  THIS SUBROUTINE WILL CALL FIRSTHDR TO READ IN A HEADER FROM TAPE
+C  ITAPEI, AND WILL CONTINUE TO READ IN HEADERS AS LONG AS THE 'HEADER
+C  FOLLOWING' FLAG IS SET (LINE 2 COL 79). IF IPRNT IS TRUE, ALL 
+C  HEADERS WILL BE WRITTEN TOP OUTPUT TAPE 6. IF IWRITE IS TRUE, THE
+C  FIRST HEADER WILL BE WRITTEN TO TAPE ITAPEO
+C
+C  WRITTEN 10/84 BY M. VERSCHELL
+C
+      LOGICAL IPRNT,IWRITE,EXKEEP
+      CHARACTER*80 HEADER(8),BUFFER(8)
+      COMMON /COMHDR/ HEADER
+      COMMON /DUMMY/BUFFER
+      CHARACTER*1 BLANK
+      DATA BLANK/' '/
+C
+C  READ IN FIRST HEADER, REPEAT UNTIL REQUESTED CAST (NCAST1) IS FOUND
+C
+  100 CALL FRSTHD(ITAPEI,NCAST,NDATA)
+      IF ((NCAST .NE. NCAST1).AND.(NCAST1 .NE. 0)) THEN
+  150   IF (HEADER(2)(79:79).EQ.'N') THEN
+          READ (ITAPEI,END=175) HEADER(1)
+          GOTO 190
+  175     READ (ITAPEI) HEADER(1)
+  190     DO 195 J=2,8
+          READ (ITAPEI) HEADER(J)
+  195     CONTINUE 
+          GOTO 150
+        ELSE
+          DO 197 I=1,NDATA
+            READ(ITAPEI,END=197) DUM
+  197     CONTINUE
+        ENDIF
+        GOTO 100
+      ENDIF
+C
+C  PRINT OR WRITE IT OUT AS REQUESTED
+C
+      IF (IPRNT) WRITE(6,200) NCAST,NDATA,(HEADER(I),I=1,8)
+CCCC  BUG IN CODE ... 200 FORMAT(1X,'NCAST='I3,'  NDATA=',I5/8(1X,A80/)/)
+  200 FORMAT(1X,'NCAST=',I3,'  NDATA=',I5/8(1X,A80/)/)
+      IF (IWRITE) THEN
+        DO 300 I=1,8
+          IF ((.NOT.EXKEEP).AND.(I.EQ.2)) THEN
+            WRITE (ITAPEO) HEADER(I)(1:78),BLANK,HEADER(I)(80:80)
+          ELSE
+            WRITE (ITAPEO) HEADER(I)
+          ENDIF
+  300   CONTINUE
+      ENDIF
+C
+C  IF N FLAG SET READ IN NEXT HEADER
+C
+      IF (HEADER(2)(79:79).EQ.'N') THEN
+  400   CALL NXTHDR(ITAPEI)
+        IF (IPRNT) WRITE (6,200) (BUFFER(I),I=1,8)
+        IF ((EXKEEP).AND.(IWRITE)) THEN
+          DO 500 I=1,8
+            WRITE (ITAPEO) HEADER(I)
+  500     CONTINUE
+        ENDIF
+        IF (BUFFER(2)(79:79).EQ.'N') GOTO 400
+      ENDIF
+      RETURN
+      END
diff --git a/ppl/pplepic/readthd.F b/ppl/pplepic/readthd.F
new file mode 100644
index 0000000..bf819d6
--- /dev/null
+++ b/ppl/pplepic/readthd.F
@@ -0,0 +1,101 @@
+      SUBROUTINE READTHD(ITAPEI,ITAPEO,NDATA,DI,TI,DF,TF,DT,IPRNT,
+     1IWRITE,EXKEEP)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)readthd.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C
+C  THIS SUBROUTINE WILL CALL HDRT1 TO READ IN A TIME SERIES HEADER FROM TAPE
+C  ITAPEI, AND WILL CONTINUE TO READ IN HEADERS AS LONG AS THE 'HEADER
+C  FOLLOWING' FLAG IS SET (LINE 2 COL 79). IF IPRNT IS TRUE, ALL 
+C  HEADERS WILL BE WRITTEN TOP OUTPUT TAPE 6. IF IWRITE IS TRUE, THE
+C  FIRST HEADER WILL BE WRITTEN TO TAPE ITAPEO
+C
+C  WRITTEN 10/84 BY M. VERSCHELL
+C
+      LOGICAL IPRNT,IWRITE,EXKEEP
+      CHARACTER*80 THEADER(8)
+      COMMON /COMTHDR/ THEADER
+      CHARACTER*80 THEAD2(8)
+      COMMON /comnxt/ THEAD2
+
+      CHARACTER*1 BLANK
+      DATA BLANK/' '/
+C
+C  READ IN FIRST HEADER, REPEAT UNTIL REQUESTED CAST (NCAST1) IS FOUND
+C
+  100 CALL HDRT1 (ITAPEI,NDATA,DI,TI,DF,TF,DT)
+C
+C  PRINT OR WRITE IT OUT AS REQUESTED
+C
+      IF (IPRNT) THEN
+        WRITE(6,200) (THEADER(I),I=1,8)
+  200   FORMAT(8(1X,A80/)/)
+      ENDIF
+      IF (IWRITE) THEN
+        DO 300 I=1,8
+          IF ((.NOT.EXKEEP).AND.(I.EQ.2)) THEN
+            WRITE (ITAPEO) THEADER(I)(1:78),BLANK,THEADER(I)(80:80)
+          ELSE
+            WRITE (ITAPEO) THEADER(I)
+          ENDIF
+  300   CONTINUE
+      ENDIF
+C
+C  IF N FLAG SET READ IN NEXT HEADER
+C
+        IF (THEADER(2)(79:79).EQ.'N') THEN
+400       CALL NXTHDR(ITAPEI)
+          IF (IPRNT) THEN
+            IF (THEAD2(2)(78:78) .EQ. 'P') WRITE (6,201)
+201         FORMAT (/' Composite series composed of these pieces:'/)
+            WRITE (6,200) (THEAD2(I),I=1,8)
+          ENDIF
+          IF ((EXKEEP).AND.(IWRITE)) THEN
+            DO 500 I=1,8
+            WRITE (ITAPEO) THEADER(I)
+  500       CONTINUE
+          ENDIF
+          IF (THEAD2(2)(79:79).EQ.'N') GOTO 400
+        ENDIF
+      RETURN
+      END
diff --git a/ppl/pplepic/stripit.F b/ppl/pplepic/stripit.F
new file mode 100644
index 0000000..958319a
--- /dev/null
+++ b/ppl/pplepic/stripit.F
@@ -0,0 +1,76 @@
+        subroutine stripit (instring,inlength,cchar,outstring,il)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)stripit.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Removes character cchar from instring(1:inlength).
+c
+c  Input:
+c       instring = input string
+c       inlength = length of input string
+c       cchar = character to remove from instring
+c  Output:
+c       outstring = output string, equal to input string with character
+c                   cchar removed remaining string compressed.
+c       il = length of output string
+c
+        character*(*) instring,outstring
+        character*1 cchar
+c
+        outstring=instring
+        il=inlength
+c
+c  Get rid of "cchar"
+c
+200         i=index(outstring(1:il),cchar)
+            if (i.eq.0) goto 300
+            if (i .eq. 1) then
+                outstring(1:il)=outstring(i+1:il)
+                il=il-1
+            else
+                outstring(1:il)=outstring(1:i-1)//outstring(i+1:il)
+                il=il-1
+            endif
+            goto 200
+300     return
+        end
diff --git a/ppl/pplepic/upcase.F b/ppl/pplepic/upcase.F
new file mode 100644
index 0000000..e520e24
--- /dev/null
+++ b/ppl/pplepic/upcase.F
@@ -0,0 +1,77 @@
+	subroutine upcase (string,nc)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)upcase.F	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Converts the n characters in chrstr to upper case.
+c
+c	converts the string to upper case
+C
+c	STRING -- character*80, input string
+C	nc -- length of string
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+#ifdef unix
+	CHARACTER STRING*(*),CHR(26)
+	DATA CHR/'A','B','C','D','E','F','G','H','I',
+     1	'J','K','L','M','N','O','P','Q','R','S','T',
+     2	'U','V','W','X','Y','Z'/
+	AA=ICHAR('a')
+	DO 100 I=1,NC
+	IF(STRING(I:I).GE.'a'.AND.STRING(I:I).LE.'z')THEN
+	K=ICHAR(STRING(I:I))-AA+1
+	STRING(I:I)=CHR(K)
+	ENDIF
+100	CONTINUE
+#else
+        character string(nc),temp
+c
+        do 200 i=1,nc
+          istr = str$upcase (temp, string(i))
+          string(i)=temp
+200     continue
+#endif
+	RETURN
+	END
diff --git a/ppl/pplepic/varck.F b/ppl/pplepic/varck.F
new file mode 100644
index 0000000..a8349b1
--- /dev/null
+++ b/ppl/pplepic/varck.F
@@ -0,0 +1,122 @@
+	FUNCTION VARCK (HEADER, CHOICE, YCOLUMN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)varck.f	1.1.1.1    7/30/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+C
+C  READS EPIC HEADER TO FIND THE COLUMN NUMBER (YCOLUMN) OF THE
+C  GENERIC VARIABLE CHOICE.  IF CHOICE IS NEGATIVE, NO MESSAGE
+C  IS PRINTED ON OUTPUT (UNIT6) WHEN THE SELECTED VARIABLE IS NOT
+C  FOUND ON THE DATA FILE.
+C
+C  EXTRACTED FROM M. VERSCHELL'S PLOTSETUP BY N SOREIDE, JUN 85.
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+	CHARACTER*(*) HEADER(8)
+	LOGICAL VARCK
+	INTEGER*4 CHOICE,YCOLUMN,ICNT,CODEVAL(0:8),VARCODE
+c
+C  CODEVAL setup
+c    This identifies the variable code range a variable type can be
+c    found in. The range is the number:number+9. If the number is 999
+c    then the variable is a special case, and must be dealt with 
+c    specially.
+c
+c  Generic variable codes are given here.  Routine will return column
+c  number of the variable:
+c
+c                    Generic   
+c                      Code    Description
+c		     ------   -----------
+c			0     Pressure
+c			1     Temperature
+c			2     Salinity
+c			3     Sigma-T
+c			4     Oxygen
+c			5     Conductivity
+c			6     U
+c			7     V
+c			8     Dynamic Height
+c			9     Other
+c
+      DATA CODEVAL /0,20,40,999,60,50,999,999,10/
+c
+C
+	ICABS=IABS(CHOICE)
+	READ (HEADER(3)(79:80),101) NVARS
+101	FORMAT (I2)
+      DO 300 ICNT=1,NVARS
+        READ(HEADER(5)(ICNT*4-3:ICNT*4),1030) VARCODE
+ 1030   FORMAT(I4)
+        IF (ICABS .EQ. 3) THEN
+          IF (VARCODE .EQ. 70) GOTO 400
+        ELSE IF (ICABS .EQ. 6) THEN
+          IF((VARCODE.EQ.320).OR.(VARCODE.EQ.322).OR.(VARCODE.EQ.324)
+     >       .OR.(VARCODE.EQ.326).OR.(VARCODE.EQ.330)
+     >       .OR.(VARCODE.EQ.332).OR.(VARCODE.EQ.334)
+     >       .OR.(VARCODE.EQ.336).OR.(VARCODE.EQ.420)
+     >       .OR.(VARCODE.EQ.340)
+     >       .OR.(VARCODE.EQ.422)) GOTO 400
+        ELSE IF (ICABS .EQ. 7) THEN
+          IF((VARCODE.EQ.321).OR.(VARCODE.EQ.323).OR.(VARCODE.EQ.325)
+     >       .OR.(VARCODE.EQ.327).OR.(VARCODE.EQ.331)
+     >       .OR.(VARCODE.EQ.333).OR.(VARCODE.EQ.335)
+     >       .OR.(VARCODE.EQ.337).OR.(VARCODE.EQ.421)
+     >       .OR.(VARCODE.EQ.341)
+     >       .OR.(VARCODE.EQ.423)) GOTO 400
+        ELSE IF (ICABS .EQ. 9) THEN
+          IF ((YCOLUMN .EQ. ICNT).AND.(VARCODE .NE. 0)) GOTO 400
+        ELSE 
+          IF((VARCODE.GE.CODEVAL(ICABS)).AND.
+     >       (VARCODE.LE.(CODEVAL(ICABS)+9))) GOTO 400
+        ENDIF
+  300 CONTINUE
+  310    IF (CHOICE .GT. 0) WRITE(6,1040) 
+ 1040 FORMAT(/' There is no match for this variable. Cast OMITTED.'/)
+	VARCK = .FALSE.
+	RETURN
+c
+  400 YCOLUMN = ICNT
+	VARCK = .TRUE.
+	RETURN
+	END
diff --git a/ppl/pplepic/varkey.F b/ppl/pplepic/varkey.F
new file mode 100644
index 0000000..8d25c21
--- /dev/null
+++ b/ppl/pplepic/varkey.F
@@ -0,0 +1,67 @@
+	subroutine varkey (theader, ikey, jy)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)varkey.f	1.1    3/10/88
+C**
+C**
+C***********************************************************************        C**
+C**                 EPIC
+C**
+C***********************************************************************        C**
+C**
+c
+c  Locates EPICKEY variable code ikey in EPIC header theader and returns
+c  the column number in variable jy.  If the variable code is not found,
+c  jy=0.
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	character*(*) theader(8)
+c
+	read (theader(3)(79:80),*) nvars
+c
+	do 200 i=1,nvars
+	    iend=i*4
+	    read (theader(5)(iend-3:iend),*) ivar
+	    if (ivar .eq. ikey) goto 210
+200	continue
+	jy=0
+	return
+c
+210	jy=i
+	return
+	end
diff --git a/ppl/pplusr/LIB_NAME b/ppl/pplusr/LIB_NAME
new file mode 100644
index 0000000..659253a
--- /dev/null
+++ b/ppl/pplusr/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libusr.a
+ 
diff --git a/ppl/pplusr/Makefile b/ppl/pplusr/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/pplusr/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/pplusr/SOURCE_FILES b/ppl/pplusr/SOURCE_FILES
new file mode 100644
index 0000000..ffc525d
--- /dev/null
+++ b/ppl/pplusr/SOURCE_FILES
@@ -0,0 +1,2 @@
+SRCS_F = \
+pplusr.F 
diff --git a/ppl/pplusr/pplusr.F b/ppl/pplusr/pplusr.F
new file mode 100644
index 0000000..28313b0
--- /dev/null
+++ b/ppl/pplusr/pplusr.F
@@ -0,0 +1,59 @@
+	subroutine pplusr(command,ier,msg)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)pplusr.f	1.1    3/10/88
+C**
+c
+c
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C v552 *acm* 3/03 Longer strings: changes for multi-line labels
+	character command*(*),msg*(*)
+	integer   ier
+c
+	character com*30,args*2048
+c
+	ier=1
+	msg='usr command not implemented at this location'
+	com='*QG$MSG'
+	ilen=lnblk(msg,80)
+	call putsym(com,msg,ilen,ier2)
+	com='*QG$IER'
+	write(args,'(i1)')ier
+	call putsym(com,args,1,ier2)
+	return
+	end
+c
diff --git a/ppl/symlib/LIB_NAME b/ppl/symlib/LIB_NAME
new file mode 100644
index 0000000..07d7db4
--- /dev/null
+++ b/ppl/symlib/LIB_NAME
@@ -0,0 +1,2 @@
+LIB = ../../lib/libsym.a
+ 
diff --git a/ppl/symlib/Makefile b/ppl/symlib/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/symlib/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/symlib/SOURCE_FILES b/ppl/symlib/SOURCE_FILES
new file mode 100644
index 0000000..11f4b9d
--- /dev/null
+++ b/ppl/symlib/SOURCE_FILES
@@ -0,0 +1,25 @@
+SRCS_F = \
+atend.F\
+atflsh.F\
+atstrt.F\
+charin.F\
+cmderr.F\
+cmljst.F\
+copy.F\
+dbmsubs.F\
+delsym.F\
+echo.F\
+getcmd.F\
+getlin.F\
+getsym.F\
+gtqual.F\
+lstsym.F\
+parse.F\
+parsev.F\
+parsex.F\
+putsym.F\
+putval.F\
+setsym.F\
+stprmp.F\
+symcnv.F\
+symsub.F 
diff --git a/ppl/symlib/atend.F b/ppl/symlib/atend.F
new file mode 100644
index 0000000..96f9f07
--- /dev/null
+++ b/ppl/symlib/atend.F
@@ -0,0 +1,142 @@
+	SUBROUTINE ATEND
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)atend.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL ATEND
+C**
+C**	Parameters:
+C**
+C**	Description:
+C**		ATEND closes the currently open command file and user
+C**		key file and returns to the previous command file.
+C**
+C**	History:
+C**	    Written: 
+C**		26-JAN-86	by Donald W. Denbo
+C**	    Modified:
+C**		15-JUN-86	by Donald W. Denbo
+C**		  changes for memory buffer added
+C**
+C*** V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	include 'SYSTEM.INC'
+	include 'CMDCOM.INC'
+	include 'SYMKEY.INC'
+	INCLUDE 'LUNITS.INC'
+
+	CHARACTER KFILE*30,SYM*120
+	DONEF=CMDLEV.EQ.1
+	IF(DONEF)THEN
+C
+C	DONE -- FINISH UP AND EXIT
+C
+	    RETURN
+	ENDIF
+C
+C	CLOSE USER KEY FILE AND CURRENT COMMAND FILE
+C
+	call dbmclear(keyln2)
+	keyln2=keyln2-1
+	CLOSE(CMDLUN)
+C
+C	RESET COMMAND FILE 
+C
+	CMDLEV=CMDLEV-1
+	IFLEV=CMIFLV(CMDLEV)
+	WHLEV=CMWHLV(CMDLEV)
+	SKIPIF=.FALSE.
+	SKIPWH=.FALSE.
+	DO 10 I=1,WHLEV
+10	WHLINE(I)=CMWHLN(CMDLEV,I)
+	CMDFIL=CMFILE(CMDLEV)
+	LINCNT=CMLINE(CMDLEV)
+	ECHOF=CMECHO(CMDLEV)
+	DEBUGF=CMDEBG(CMDLEV)
+	QUIETF=CMQUIE(CMDLEV)
+	LOGCMF=CMLOG(CMDLEV)
+#ifdef unix
+	IF(CMDFIL.EQ.'/dev/tty')THEN
+#else
+	if(cmdfil.eq.'TT:')then
+#endif
+	    TERMF=.TRUE.
+	    IF(.NOT.QUIETF)WRITE(LTTOUT,997)
+997	    FORMAT(' Control returned to keyboard')
+#ifdef unix
+	    OPEN(CMDLUN,FILE=CMDFIL,STATUS='OLD')
+#endif
+	ELSE IF(CMDFIL.EQ.'$$MEMBUF$$')THEN
+	    TERMF=.FALSE.
+	    MEMBUF=.TRUE.
+	ELSE
+C
+C	OPEN OLD COMMAND FILE AND SKIP TO CORRECT LINE
+C
+#ifdef unix
+	    OPEN(CMDLUN,FILE=CMDFIL,STATUS='OLD')
+#else
+	    open(cmdlun,file=cmdfil,readonly,status='old')
+#endif
+	    DO 100 I=1,LINCNT
+	    READ(CMDLUN,998)
+998	    FORMAT(1X)
+100	    CONTINUE
+	ENDIF
+	ISYM=LNBLK(CMDFIL,80)
+	SYM='*PPL$COMMAND_FILE'
+	CALL PUTSYM(SYM,CMDFIL,ISYM,IER)
+	IF(CMDLEV.GT.1)THEN
+C
+C	OPEN OLD USER KEY FILE
+C
+	    WRITE(KFILE,999)CMDLEV
+999	    FORMAT('PPL$KEY.',I3.3)
+	    call dbmopen(kfile,11,keyln2)
+	ELSE
+	    SMKEY2=.FALSE.
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/atflsh.F b/ppl/symlib/atflsh.F
new file mode 100644
index 0000000..2148a7e
--- /dev/null
+++ b/ppl/symlib/atflsh.F
@@ -0,0 +1,73 @@
+	SUBROUTINE ATFLSH
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)atflsh.F	1.2    5/26/88
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL ATFLSH
+C**
+C**	Parameters:
+C**
+C**	Description:
+C**		ATFLSH deletes all temporary user key files and returns to
+C**		the lowest level of command files.
+C**
+C**	History:
+C**	    Written: 
+C**		26-JAN-86	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+#ifdef unix
+	include 'CMDCOM.INC'
+#else
+	INCLUDE 'cmdinc:CMDCOM.INC'
+#endif
+C
+C	CALL ATEND REPEATEDLY
+C
+	DO 100 I=CMDLEV,2,-1
+	CALL ATEND
+100	CONTINUE
+	RETURN
+	END
diff --git a/ppl/symlib/atstrt.F b/ppl/symlib/atstrt.F
new file mode 100644
index 0000000..e721f96
--- /dev/null
+++ b/ppl/symlib/atstrt.F
@@ -0,0 +1,176 @@
+	SUBROUTINE ATSTRT(FILE,LINE,LEN,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)atstrt.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL ATSTRT(FILE,LINE,LEN,IER)
+C**
+C**	Parameters:
+C**		FILE -- File to open for next command file (char*80)
+C**		LINE -- String containing symbols to be passed (char*2048)
+C**		LEN  -- Length of LINE
+C**		IER  -- Error code
+C**			0 = success
+C**			9 = command file open error
+C**
+C**	Description:
+C**		Opens FILE as the next command file.  Also updates
+C**		CMDLEV and creates the appropriate user key file.
+C**
+C**	History:
+C**	    Written: 
+C**		26-JAN-86	by Donald W. Denbo
+C**	    Modified:
+C**		15-JUN-86	by Donald W. Denbo
+C**		  Changes to support memory buffer added
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'CMDCOM.INC'
+	INCLUDE 'SYMKEY.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+	INCLUDE 'LUNITS.INC'
+
+	CHARACTER FILE*(*),LINE*(*),TO*80,TEMP*2048
+	CHARACTER SYM*120
+	INTEGER LEN
+	IER=0
+	CMDLEV=CMDLEV+1
+	IF(CMDLEV.GT.1)THEN
+	    IF(.NOT.(TERMF.OR.MEMBUF))THEN
+		close(cmdlun)
+		CMLINE(CMDLEV-1)=LINCNT
+	    ENDIF
+	    MEMBUF=.FALSE.
+	    TERMF=.FALSE.
+	    WRITE(TO,999)CMDLEV
+999	    FORMAT('PPL$KEY.',I3.3)
+	    SMKEY2=.TRUE.
+	    keyln2=keyln2+1
+	    call dbmopen(to,11,keyln2)
+	ENDIF
+	CMFILE(CMDLEV)=FILE
+	CMECHO(CMDLEV-1)=ECHOF
+	CMDEBG(CMDLEV-1)=DEBUGF
+	CMQUIE(CMDLEV-1)=QUIETF
+	CMLOG(CMDLEV-1)=LOGCMF
+	CMIFLV(CMDLEV-1)=IFLEV
+	CMWHLV(CMDLEV-1)=WHLEV
+	DO 20 I=1,WHLEV
+20	CMWHLN(CMDLEV-1,I)=WHLINE(I)
+	IFLEV=0
+	WHLEV=0
+	DEBUGF=SDEBUG
+	QUIETF=SQUIET
+	LOGCMF=SLOG
+	CMDFIL=FILE
+	IF(CMDLEV.GT.1)ECHOF=SECHO
+	LINCNT=0
+	ISYM=LNBLK(FILE,80)
+	SYM='*PPL$COMMAND_FILE'
+	CALL PUTSYM(SYM,FILE,ISYM,IER)
+	IF(.NOT.MEMBUF)THEN
+#ifdef unix
+	    OPEN(CMDLUN,FILE=FILE,STATUS='OLD',ERR=1000)
+#else
+	    OPEN(CMDLUN,FILE=FILE,STATUS='OLD',readonly,ERR=1000)
+#endif
+	ENDIF
+C
+C	PROCESS COMMAND LINE
+C
+	IL=LEN
+	IF(LEN.GT.0.AND.LINE.NE.' ')THEN
+C
+C	    PROCESS AND PARSE COMMAND LINE
+C
+	    ICNT=1
+100	    ISPC=INDEX(LINE,' ')
+	    IF(LINE(1:1).EQ.'"')THEN
+C
+C		QUOTED STRING, FIND CLOSING QUOTE
+C
+		IQTE=0
+		TEMP=LINE(2:)
+		LINE=TEMP
+200		ISPC=INDEX(LINE(IQTE+1:),'"')+IQTE
+		IF(LINE(ISPC+1:ISPC+1).EQ.'"')THEN
+		    TEMP=LINE(:ISPC)
+		    TEMP(ISPC+1:)=LINE(ISPC+2:)
+		    LINE=TEMP
+		    IQTE=ISPC
+		    IL=IL-1
+		    GOTO 200
+		ENDIF
+	    ENDIF
+	    WRITE(TO,997)ICNT
+997	    FORMAT('P(',I3.3,')')
+	    CALL PUTSYM(TO,LINE,ISPC-1,IER)
+	    TEMP=LINE(ISPC+1:)
+	    IL=IL-ISPC
+	    DO 10 I=1,IL
+	    IF(TEMP(I:I).NE.' ')GOTO 11
+10	    CONTINUE
+	    RETURN
+11	    LINE=TEMP(I:)
+	    ICNT=ICNT+1
+	    IL=IL-I+1
+	    GOTO 100
+	ENDIF
+	RETURN
+C
+C	ERROR IN OPENING 'FILE' AS COMMAND INPUT
+C
+1000	IF(.NOT.QUIETF)WRITE(LTTOUT,996)FILE
+996	FORMAT(' - Command file not found - '/1X,A79)
+	CALL ATEND
+	IER=9
+	RETURN
+	END
diff --git a/ppl/symlib/charin.F b/ppl/symlib/charin.F
new file mode 100644
index 0000000..38402cc
--- /dev/null
+++ b/ppl/symlib/charin.F
@@ -0,0 +1,108 @@
+	SUBROUTINE CHARIN(STR,IN,PRMT,INPL)
+C** 
+C**    @(#)charin.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL CHARIN(STR,IN,PRMP,INP)
+C**
+C**	Parameters:
+C**		STR -- Output string (char*IN or byte(IN))
+C**		IN -- Maximum input string length
+C**		PRMP -- Prompt for terminal input
+C**		INP -- Prompt lenght in characters
+C**
+C**	Description:
+C**		CHARIN prompts the user for input from the terminal.
+C**
+C**	History:
+C**	    Written: 
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**		30-MAY-1986	by Donald W. Denbo
+C**		  Changes made for VAX/VMS version
+C**
+C**
+C     Mod *JD* 3.5.91 problems with buffered terminal output in unix
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     Mod *jd* 8.30.93 to handle FORTRAN read error you get w XGKS if the 
+*	window is clicked with the mouse.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+
+#ifdef unix
+	include 'CMDCOM.INC'
+	include 'LUNITS.INC'
+#else
+	include 'pplv11inc:CMDCOM.INC'
+	include 'pplv11inc:lunits.inc'
+#endif
+	character str*(*),prmt*(*)
+#ifdef unix
+	write(LTTOUT,999)prmt(:inpl)
+C     Mod format *JD* 3.5.91 get problem with output held in buffer
+# ifdef FORTRAN_90
+999	format(a)
+# else
+999	format(1x,a,$) !original
+# endif
+C OK in Sun?? 999	format(a)
+	call flush(LTTOUT)
+C Leave this out JD 3.5.91	call flush(LTTOUT)
+100	read(CMDLUN,998,err=100,end=100)str(:in)
+998	format(a)
+#else
+        INTEGER*2 IOSB(4)
+        BYTE INB(2048),PRMTB(30)
+        INCLUDE '($IODEF)'
+        STR=' '
+        READ(PRMT,'(30A1)')PRMTB
+        CALL SYS$ASSIGN('TT',CHAN,,)
+        CALL SYS$QIOW(,%VAL(CHAN),%VAL(IO$_READPROMPT),IOSB,,,
+     *  INB,%VAL(IN),,,PRMTB,%VAL(INP))
+        CALL SYS$DASSGN(%VAL(CHAN))
+        WRITE(STR,'(2048A1)')(INB(I),I=1,IOSB(2))
+#endif
+	RETURN
+	END
diff --git a/ppl/symlib/cmderr.F b/ppl/symlib/cmderr.F
new file mode 100644
index 0000000..ae3ef6c
--- /dev/null
+++ b/ppl/symlib/cmderr.F
@@ -0,0 +1,131 @@
+
+	SUBROUTINE CMDERR(IER,LINE,ILEN,IPOS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C      @(#)cmderr.F	1.2    5/26/88
+C  
+C  
+C                                                                      *
+C  
+C  		    PLOT+ Scientific Graphics System
+C  
+C                                                                      *
+C  
+C  
+C  	Subprogram called:
+C  		CALL CMDERR(IER,LINE,ILEN,IPOS)
+C  
+C  	Parameters:
+C  		IER -- Error code
+C  			0 = no error
+C  			1 = symbol not found
+C  			2 = unmatched single quote in parse
+C  			3 = qualifier not found
+C  			4 = then missing
+C  			5 = nesting error for IF statement
+C  			6 = logical operator not found
+C  			7 = unmatched double quote in expression
+C  			8 = nesting error for WHILE statement
+C  			9 = syntax error
+C  		       10 = unmatched (in LEV command
+C  		       11 = exceeds maximum number of levels
+C  		LINE -- Command line
+C  		ILEN -- Length of LINE
+C  		IPOS -- Position to mark
+C  
+C  	Description:
+C  		Routine to print the input line and point to the
+C  		offending element.  This command will abort the
+C  		program if BATCHF is true.
+C  
+C  	History:
+C  	    Written: 
+C  		5-JAN-86	by Donald W. Denbo
+C  	    Modified:
+C  
+C       11-Dec-2003 ACM Add the string **ERROR before the error message,
+C                       to be consistent with Ferret error messages.
+C  
+C    V6.06 ACM Write error messages to Standard Error, unit number is LERROR
+
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'CMDCOM.INC'
+	INCLUDE 'LUNITS.INC'
+
+	CHARACTER LINE*(*),frmt*30
+	CHARACTER ERRMES(11)*30
+	DATA ERRMES/'Symbol not found','Unmatched ''',
+     *	'Qualifier not recognized','THEN missing',
+     *	'IF levels improperly nested','No operator found',
+     *	'Unmatched "','WHILE levels improperly nested',
+     *	'Syntax error','Unmatched (','Maximum no. levels exceeded'/
+	IF(IER.EQ.0)RETURN
+	WRITE(LERROR,999)' **ERROR',ERRMES(IER)
+999	FORMAT(A8,1X,A30)
+	WRITE(LERROR,998)' ',LINE(:ILEN)
+998	FORMAT(A1,1X,A)
+	IF(IPOS.LE.ILEN)THEN
+	    WRITE(FRMT,997)IPOS
+997	    FORMAT('(A1,',I3.3,'X,''^'')')
+	    WRITE(LERROR,FRMT)' '
+	ENDIF
+	IF(ECHOF)THEN
+	    WRITE(ECHLUN,999)'C ERROR',ERRMES(IER)
+	    WRITE(ECHLUN,998)'C',LINE(:ILEN)
+	    IF(IPOS.LE.ILEN)WRITE(ECHLUN,FRMT)'C'
+	ENDIF
+
+C *kob* 4/99 minor mod - add (0) to exit call
+C *js* 9/00 Problems with exit call in cygwin, just halt instead
+#ifdef __CYGWIN__
+	IF(BATCHF)STOP
+#else
+	IF(BATCHF)CALL EXIT(0)
+#endif
+	IF(.NOT.TERMF)THEN
+C
+C	     If not interactive abort command file
+C	     Return to lowest level
+C
+	    IF(.NOT.ECHOF)THEN
+		WRITE(ECHLUN,999)'C **ERROR',ERRMES(IER)
+		WRITE(ECHLUN,998)'C',LINE(:ILEN)
+		IF(IPOS.LE.ILEN)WRITE(ECHLUN,FRMT)'C'
+	    ENDIF
+	    CALL ATFLSH
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/cmljst.F b/ppl/symlib/cmljst.F
new file mode 100644
index 0000000..4a77398
--- /dev/null
+++ b/ppl/symlib/cmljst.F
@@ -0,0 +1,76 @@
+	SUBROUTINE CMLJST(LINE,ILEN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)cmljst.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL CMLJST(LINE,ILEN)
+C**
+C**	Parameters:
+C**		line -- input string to be left jusified
+C**		ilen -- length of input string on input and output
+C**
+C**	Description:
+C**		Removes blank spaces and tabs from LINE
+C**
+C**	History:
+C**	    Written: 
+C**		6-SEP-86	by Donald W. Denbo
+C**	    Modified:
+C**
+C** 
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER LINE*(*)
+	INTEGER ILEN
+	IF(LINE(:ILEN).EQ.' ')RETURN
+100	J=ICHAR(LINE(1:1))
+	IF(J.EQ.9.OR.J.EQ.32)THEN
+	    ILEN=ILEN-1
+	    LINE=LINE(2:)
+	    GOTO 100
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/copy.F b/ppl/symlib/copy.F
new file mode 100644
index 0000000..ed56f12
--- /dev/null
+++ b/ppl/symlib/copy.F
@@ -0,0 +1,107 @@
+	SUBROUTINE COPY(FROM,TO,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)copy.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL COPY(FROM,TO,IER)
+C**
+C**	Parameters:
+C**		FROM -- File to be copied (char*80)
+C**		TO   -- File to be created (char*80)
+C**		IER  -- Error code
+C**			0 = success
+C**			10 = spawn error
+C**			20 = wait error
+C**			2 = error - unlikly results to be expected
+C**			4 = severe error - possible PIP abort
+C**
+C**	Description:
+C**		COPY executes the MCR PIP command to copy a file.
+C**
+C**	History:
+C**	    Written: 
+C**		22-JAN-86	by Donald W. Denbo
+C**	    Modified:
+C**		30-MAY-86	by Donald W. Denbo
+C**		  Changes made for VAX/VMS version
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER FROM*(*),TO*(*)
+c
+c	rsx-11m
+c
+c	INTEGER*2 WAIT,ERROR,FLAG,STATUS,IER
+c	CHARACTER CMD*80
+c	WRITE(CMD,999)TO,FROM
+c999	FORMAT('PIP ',A30,'=',A30)
+c	CALL SQUISH(CMD,5,61)
+c	WAIT=0
+c	FLAG=0
+c	CALL TISPWN(CMD,WAIT,ERROR,FLAG,STATUS)
+c	IF(ERROR.EQ.0.AND.STATUS.EQ.1)THEN
+c	    IER=0
+c	ELSE
+c	    IER=10*ERROR+STATUS
+c	ENDIF
+c
+c	end rsx-11m
+c
+c	vax/vms
+c
+	CHARACTER CMD*200	
+	INTEGER IER
+	WRITE(CMD,999)FROM,TO
+999	FORMAT('$COPY ',A80,' ',A80)
+#ifndef unix
+	CALL LIB$SPAWN(CMD)
+#endif
+	IER=0
+	RETURN
+	END
+
+
diff --git a/ppl/symlib/dbmsubs.F b/ppl/symlib/dbmsubs.F
new file mode 100644
index 0000000..e33867b
--- /dev/null
+++ b/ppl/symlib/dbmsubs.F
@@ -0,0 +1,265 @@
+	subroutine dbmopen(file,flen,lun)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)dbmsubs.f	1.2    5/26/88
+C**
+c**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V685 *acm* 1/13 Increase number of symbols, # short to 5000,
+*                 # long to 500. Move the test for all-symbols-set
+*                 outside the loop. (Should do proper error handling...)
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	character file*(*)
+	integer flen,lun
+c
+	return
+	end
+c
+	subroutine dbmstore(lun,sym,ilen,value,len,ier)
+c
+	integer VSHORT,VLONG
+	parameter (VSHORT=5000,VLONG=500)
+c
+	character sym*(*),value*(*)
+	integer lun,ilen,len,ier
+c
+c	have two regions of storage long (2048 characters)
+c	and short (132 characters),  this should minimize
+c	space requirements on a fortran system
+c
+	character syml(VLONG)*120,syms(VSHORT)*120
+	character vall(VLONG)*2048,vals(VSHORT)*132
+	integer lunl(VLONG),luns(VSHORT)
+	integer lenl(VLONG),lens(VSHORT)
+	logical long
+c
+	data lunl/VLONG*-1/,luns/VSHORT*-1/
+	data mxlong/1/,mxshort/1/
+c
+c	look for sym in LONG list
+c
+	ier=0
+	do 10 i=1,mxlong
+	    if(lunl(i).eq.lun)then
+		if(syml(i).eq.sym)then
+		    vall(i)=value
+		    lenl(i)=len
+		    return
+		endif
+	    endif
+10	continue
+c
+c	look for sym in SHORT list
+c
+	do 20 i=1,mxshort
+	    if(luns(i).eq.lun)then
+		if(syms(i).eq.sym)then
+		    if(len.le.132)then
+			vals(i)=value
+			lens(i)=len
+			return
+		    else
+c
+c	insert into long list
+c
+			luns(i)=-1
+		    endif
+		endif
+	    endif
+20	continue
+c
+c	sym not found in any list
+c
+	if(len.le.132)then
+	    do 30 i=1,mxshort+1
+		if(luns(i).eq.-1)then
+		    luns(i)=lun
+		    syms(i)=sym
+		    vals(i)=value
+		    lens(i)=len
+		    mxshort=max0(i,mxshort)
+		    if(mxshort.gt.VSHORT)stop 'exceeded symbol storage'
+		    return
+		endif
+30	    continue
+            stop 'exceeded symbol storage'
+	    return
+	else
+	    do 40 i=1,mxlong+1
+		if(lunl(i).eq.-1)then
+		    lunl(i)=lun
+		    syml(i)=sym
+		    vall(i)=value
+		    lenl(i)=len
+		    mxlong=max0(i,mxlong)
+		    if(mxlong.gt.VLONG)stop 'exceeded symbol storage'
+		    return
+		endif
+40	    continue
+            stop 'exceeded symbol storage'
+	    return
+	endif
+	return
+c
+	entry dbmdelete(lun,sym,ilen,ier)
+c
+	ier=0
+	do 50 i=1,mxlong
+	    if(lunl(i).eq.lun)then
+		if(syml(i).eq.sym)then
+		    lunl(i)=-1
+		    return
+		endif
+	    endif
+50	continue
+c
+	do 60 i=1,mxshort
+	    if(luns(i).eq.lun)then
+		if(syms(i).eq.sym)then
+		    luns(i)=-1
+		    return
+		endif
+	    endif
+60	continue
+	return
+c
+	entry dbmfetch(lun,sym,ilen,value,len,ier)
+c
+	ier=0
+	do 70 i=1,mxlong
+	    if(lunl(i).eq.lun)then
+		if(syml(i).eq.sym)then
+		    value=vall(i)
+		    len=lenl(i)
+		    return
+		endif
+	    endif
+70	continue
+c
+	do 80 i=1,mxshort
+	    if(luns(i).eq.lun)then
+		if(syms(i).eq.sym)then
+		    value=vals(i)
+		    len=lens(i)
+		    return
+		endif
+	    endif
+80	continue
+	len=0
+	ier=1
+	return
+c
+	entry dbmfirstkey(lun,sym,ilen,ier)
+c
+	ier=0
+	do 90 i=1,mxlong
+	    if(lunl(i).eq.lun)then
+		sym=syml(i)
+		ilen=lnblk(sym,120)
+		inext=i+1
+		long=.true.
+		return
+	    endif
+90	continue
+c
+	do 100 i=1,mxshort
+	    if(luns(i).eq.lun)then
+		sym=syms(i)
+		ilen=lnblk(sym,120)
+		inext=i+1
+		long=.false.
+		return
+	    endif
+100	continue
+	ier=1
+	ilen=0
+	return
+c
+	entry dbmnextkey(lun,sym,ilen,ier)
+c
+	ier=0
+	if(long)then
+	    do 110 i=inext,mxlong
+		if(lunl(i).eq.lun)then
+		    sym=syml(i)
+		    ilen=lnblk(sym,120)
+		    inext=i+1
+		    long=.true.
+		    return
+		endif
+110	    continue
+	    long=.false.
+	    do 115 i=1,mxshort
+		if(luns(i).eq.lun)then
+		    sym=syms(i)
+		    ilen=lnblk(sym,120)
+		    inext=i+1
+		    return
+		endif
+115	    continue
+	    ilen=0
+	    ier=1
+	else
+	    do 120 i=inext,mxshort
+		if(luns(i).eq.lun)then
+		    sym=syms(i)
+		    ilen=lnblk(sym,120)
+		    inext=i+1
+		    return
+		endif
+120	    continue
+	endif
+	ilen=0
+	ier=1
+	return
+c
+	entry dbmclose(lun)
+	return
+c
+	entry dbmclear(lun)
+c
+	do 130 i=1,mxlong
+	    if(lunl(i).eq.lun)lunl(i)=-1
+130	continue
+c
+	do 140 i=1,mxshort
+	    if(luns(i).eq.lun)luns(i)=-1
+140	continue
+	return
+	end
diff --git a/ppl/symlib/delsym.F b/ppl/symlib/delsym.F
new file mode 100644
index 0000000..9e8acc8
--- /dev/null
+++ b/ppl/symlib/delsym.F
@@ -0,0 +1,85 @@
+	SUBROUTINE DELSYM(SYM,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)delsym.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL DELSYM(SYM,IER)
+C**
+C**	Parameters:
+C**		SYM -- Symbol name (char*120)
+C**		IER -- error code
+C**			0 = sucess
+C**			1 = symbol not found
+C**
+C**	Description:
+C**		Deletes symbol from table.  Does not recover space.
+C**
+C**	History:
+C**	    Written:
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SYMKEY.INC'
+
+	LOGICAL SYS
+	CHARACTER SYM*(*)
+	CALL SYMCNV(SYM,SYS)
+	IER=0
+	IF(SYS)GOTO 100
+	IF(SMKEY2)THEN
+	    ilen=lnblk(sym,30)
+	    call dbmdelete(keyln2,sym,ilen,ier)
+	    RETURN
+	ENDIF
+100	ilen=lnblk(sym,30)
+	call dbmdelete(keyln1,sym,ilen,ier)
+	RETURN
+	END
diff --git a/ppl/symlib/echo.F b/ppl/symlib/echo.F
new file mode 100644
index 0000000..7379219
--- /dev/null
+++ b/ppl/symlib/echo.F
@@ -0,0 +1,101 @@
+	SUBROUTINE ECHO(LINE,ILEN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)echo.F	1.3    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL ECHO(LINE,ILEN)
+C**
+C**	Parameters:
+C**		LINE -- Command string to be echoed.
+C**		ILEN -- Length of LINE
+C**
+C**	Description:
+C**		Writes LINE on the current ECHO file.  If LINE is too
+C**		long a continuation line is also written.
+C**
+C**	History:
+C**	    Written: 
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+#ifdef unix
+	include 'CMDCOM.INC'
+#else
+	INCLUDE 'cmdinc:CMDCOM.INC'
+#endif
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER LINE*(*),LEV*5
+	LOGICAL LEVF
+	LEVF=CMDLEV.GT.1
+	IF(LEVF)THEN
+	    WRITE(LEV,999)CMDLEV
+999	    FORMAT('C ',I1,'- ')
+	ENDIF
+	K=1
+200	KS=MIN0(K+69,ILEN)
+	IF(KS.NE.ILEN)THEN
+	    IF(LEVF)THEN
+		WRITE(ECHLUN,998)LEV,LINE(K:KS)
+998		FORMAT(A5,A70,'-')
+	    ELSE
+		WRITE(ECHLUN,996)LINE(K:KS)
+996		FORMAT(A70,'-')
+	    ENDIF
+	ELSE
+	    IF(LEVF)THEN
+		WRITE(ECHLUN,997)LEV,LINE(K:ILEN)
+997		FORMAT(A5,A)
+	    ELSE
+		WRITE(ECHLUN,995)LINE(K:ILEN)
+995		FORMAT(A)
+	    ENDIF
+	    RETURN
+	ENDIF
+	K=KS+1
+	GOTO 200
+	END
diff --git a/ppl/symlib/getcmd.F b/ppl/symlib/getcmd.F
new file mode 100644
index 0000000..47fe07b
--- /dev/null
+++ b/ppl/symlib/getcmd.F
@@ -0,0 +1,352 @@
+	SUBROUTINE GETCMD(LINE,ILEN,COM,X,IFLG,M,LABEL,N,LBSTRT)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)getcmd.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL GETCMD(LINE,ILEN,COM,X,IF,M,LABEL,N,LBSTRT)
+C**
+C**	Parameters:
+C**		LINE -- Line from command input file (char*2048)
+C**		ILEN -- Length of LINE
+C**		COM -- Command value parsed  (char*120)
+C**		X -- Numerical array
+C**		IF -- Flag array
+C**		M -- Length of numerical and flag array
+C**		LABEL -- Label part of the command line  (char*2048)
+C**		N -- Length of LABEL
+C**		LBSTRT -- Start position of LABEL
+C**
+C**	Description:
+C**		Gets the next command from the command input, echos the
+C**		input line.  Substitutes the symbols found and parses
+C**		the resultant string.  Some of the system commands are
+C**		also executed within this routine.  They are SET, SHOW,
+C**		LIST, IF, ELSE, ENDIF, WHILE, ENDW, @.  Any other
+C**		commands are parsed further and the values of X and
+C**		LABEL to the calling routine.
+C**
+C**	History:
+C**	    Written: 
+C**		22-DEC-85	by Donald W. Denbo
+C**	    Modified:
+C**		30-MAY-86	by Donald W. Denbo
+C**		  Adds the call to PARSEX, thus enabling the parsing
+C**		  of numerical values.  LIST command changed to LISTSYM.
+C**		15-JUN-86	by Donald W. Denbo
+C**		  Changes made to support memory buffer added
+C**		 6-SEP-86	by Donald W. Denbo
+C**		  Changes made to support IF ... ELSE ... ENDIF
+C**		      and made to support WHILE ... ENDW
+C**
+C**
+C     *JD* 8.2.91 Mod to support brain dead PPL -- no @ usage
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+* v685 *acm* 1/13 Fix ticket 1298. If a label comes in containing single
+*                 quotes, just pass that on. It's not a symbol translation.
+* PyFr *kms*  7/13 IF argument renamed to IFLG
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+        logical         tmapdebug
+        common/tmdebug/ tmapdebug
+
+	INCLUDE 'CMDCOM.INC'
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SWITCH.INC'
+	INCLUDE 'LUNITS.INC'
+        INCLUDE 'cmndlen.inc'
+
+	CHARACTER COM*(*),LABEL*(*),LINE*(*),SYM*120,VALUE*2048,FILE*80
+	CHARACTER ICOM*2048
+	LOGICAL RESULT,NUM,islab
+	DIMENSION X(*),IFLG(*)
+	INTEGER LBSTRT,WHCNT
+	integer*4 status,iflag
+
+C
+C	GET NEXT COMMAND LINE
+C
+	DONEF=.FALSE.
+1000	IF(MEMBUF)THEN
+	    IF(MBUFF.GT.BUFSZE)THEN
+		DONEF=.TRUE.
+		RETURN
+	    ENDIF
+	    LINE=CMDBUF(MBUFF)
+	    MBUFF=MBUFF+1
+	    ILEN=LNBLK(LINE,2048)
+	ELSE
+	    CALL GETLIN(LINE,ILEN)
+	ENDIF
+	IF(.NOT.TERMF.AND.LOGCMF)WRITE(LTTOUT,999)LINE(:ILEN)
+999	FORMAT(1X,A)
+	IF(DONEF)RETURN
+	IF(ECHOF.AND..NOT.DEBUGF)CALL ECHO(LINE,ILEN)
+
+	CALL SYMSUB(LINE,ILEN,IER,SYM,IPOS)
+	IF(DEBUGF)CALL ECHO(LINE,ILEN)
+	CALL CMLJST(LINE,ILEN)
+	CALL PARSE(LINE,ILEN,ICOM,LABEL,N,LBSTRT)
+	islab = (ICOM.EQ.'%LABEL') .OR. (icom.EQ.'TITLE') .OR.
+     .          (ICOM.EQ.'XLAB') .OR. (icom.EQ.'YLAB')
+	IF((IER.NE.0).AND..NOT.(SKIPIF.OR.SKIPWH.OR.islab))THEN
+	    CALL CMDERR(IER,LINE,ILEN,IPOS)
+	    GOTO 1000
+	ENDIF
+C
+C	CHECK FOR ELSE AND ENDIF // IF SKIPIF IS TRUE
+C
+	IF(SKIPIF)THEN
+	    IF(ICOM.EQ.'IF')THEN
+		IFCNT=IFCNT+1
+	    ELSE IF(ICOM.EQ.'ELSE'.AND.IFCNT.EQ.0)THEN
+		SKIPIF=.FALSE.
+	    ELSE IF(ICOM.EQ.'ENDIF')THEN
+		IF(IFCNT.EQ.0)THEN
+		    SKIPIF=.FALSE.
+		    IFLEV=IFLEV-1
+		ELSE
+		    IFCNT=IFCNT-1
+		ENDIF
+	    ENDIF
+	    GOTO 1000
+	ENDIF
+	IF(SKIPWH)THEN
+	    IF(ICOM.EQ.'WHILE')THEN
+		WHCNT = WHCNT + 1
+	    ELSE IF(ICOM.EQ.'ENDW')THEN
+		IF(WHCNT.EQ.0)THEN
+		    SKIPWH=.FALSE.
+		    WHLEV=WHLEV-1
+		ELSE
+		    WHCNT=WHCNT-1
+		ENDIF
+	    ENDIF
+	    GOTO 1000
+	ENDIF
+C
+C	CHECK FOR QUALIFIERS AND OPTIONALLY LATCH NEW DEFAULTS
+C
+	CALL GTQUAL(ICOM,ICLEN,IER,IPOS)
+	IF(IER.NE.0)THEN
+	    CALL CMDERR(IER,LINE,ILEN,IPOS)
+	    GOTO 1000
+	ENDIF
+	IF(SLATCH)THEN
+	    SLATCH=.FALSE.
+	    DO 200 I=1,NFLAGS
+200	    DEFLTS(I)=FLAG(I)
+	ENDIF
+	COM=ICOM(1:ICLEN)
+C
+C	TEST FOR LOCAL COMMANDS
+C
+	IF(COM.EQ.'SHOW')THEN
+	    SYM=LABEL(:N)
+	    CALL GETSYM(SYM,VALUE,NC,IER)
+	    IF(IER.EQ.0)THEN
+		IF(.NOT.QUIETF)WRITE(LTTOUT,997)SYM,VALUE(1:NC)
+997		FORMAT(1X,A30,' = ',A)
+	    ELSE
+		CALL CMDERR(IER,LINE,ILEN,LBSTRT)
+	    ENDIF
+	ELSE IF(COM.EQ.'SET')THEN
+	    CALL SETSYM(LABEL,N,IER,IST2)
+	    IF(IER.NE.0)THEN
+		CALL CMDERR(IER,LINE,ILEN,LBSTRT+IST2)
+	    ENDIF
+	ELSE IF(COM.EQ.'LISTSYM')THEN
+	    ILST=0
+100	    CALL LSTSYM(SYM,VALUE,NC,ILST,IER)
+	    IF(IER.EQ.0)THEN
+		IF(.NOT.QUIETF)WRITE(LTTOUT,986)ILST,SYM,VALUE(1:NC)
+986		FORMAT(I5,2X,A30,3X,A)
+		GOTO 100
+	    ENDIF
+	ELSE IF(COM.EQ.'DELETE')THEN
+	    SYM=LABEL(:N)
+	    CALL DELSYM(SYM,IER)
+	    IF(IER.NE.0)THEN
+		CALL CMDERR(IER,LINE,ILEN,LBSTRT+IST2)
+	    ENDIF
+	ELSE IF(COM(1:1).EQ.'@')THEN
+C     Brain dead exclusion of @ mod
+            if (.not.tmapdebug) then
+	       IF(.NOT.QUIETF)WRITE(LTTOUT,'(1X,A)')
+     .             'COMMAND NOT SUPPORTED IN THIS VERSION OF PPLUS: @'
+               COM = ' '
+               RETURN 
+            end if
+	    ISPC=INDEX(LINE,' ')-1
+	    ICMA=INDEX(LINE,',')-1
+#ifdef unix
+	    ISLSH=INDEX(LINE,':')-1
+#else
+	    islsh=index(line,'/')-1
+#endif
+	    IF(ISPC.LE.0)ISPC=buflen+1
+	    IF(ICMA.LE.0)ICMA=buflen+1
+	    IF(ISLSH.LE.0)ISLSH=buflen+1
+	    I=MIN0(ISPC,ICMA,ISLSH,ILEN)
+	    FILE=LINE(2:I)
+	    IF(ILEN.LT.I+2)THEN
+		LABEL=' '
+		I=0
+	    ELSE
+		I=MIN0(ISPC,ICMA,ILEN)
+		LABEL=LINE(I+2:ILEN)
+		I=ILEN-I-1
+	    ENDIF
+	    VALUE=FILE
+	    ivlen=lnblk(value,2048)
+#ifdef unix
+	    file=value
+#else
+	    CALL WLDFLE('SY:.PPC',VALUE(1:ivlen),FILE,STATUS,IFLAG)
+#endif
+	    CALL ATSTRT(FILE,LABEL,I,IER)
+	ELSE IF(COM.EQ.'RETURN')THEN
+	    CALL ATEND
+	    IF(DONEF)RETURN
+	ELSE IF(COM.EQ.'IF')THEN
+	    VALUE=LINE(4:ILEN)
+	    LABEL=VALUE
+	    CALL UPPER(VALUE,2048)
+	    ITHEN=INDEX(VALUE,'THEN')
+	    IF(ITHEN.LE.0)THEN
+		CALL CMDERR(4,LINE,ILEN,LBSTRT)
+		GOTO 1000
+	    ENDIF
+C
+C	CALL IF PARSING ROUTINE
+C
+	    CALL PARSEV(LABEL,VALUE,ITHEN-1,RESULT,IER,IPOS)
+	    IF(IER.NE.0)THEN
+		CALL CMDERR(IER,LINE,ILEN,LBSTRT+IPOS)
+		GOTO 1000
+	    ENDIF
+	    IFLEV=IFLEV+1
+	    IFCNT=0
+	    SKIPIF=.NOT.RESULT
+	ELSE IF(COM.EQ.'INC')THEN
+	    NN=N
+	    VALUE=LABEL
+	    CALL EXPEVL(VALUE,N,XX,NUM,IER)
+	    IF(NUM)THEN
+		XX=XX+1.0
+	    ELSE
+		XX=1.0
+	    ENDIF
+	    WRITE(VALUE,998)XX
+998	    FORMAT(1PE13.5)
+	    LABEL(NN+1:)=VALUE
+	    CALL SETSYM(LABEL,NN+13,IER,IST2)
+	ELSE IF(COM.EQ.'DEC')THEN
+	    NN=N
+	    VALUE=LABEL
+	    CALL EXPEVL(VALUE,N,XX,NUM,IER)
+	    IF(NUM)THEN
+		XX=XX-1.0
+	    ELSE
+		XX=0.0
+	    ENDIF
+	    WRITE(VALUE,998)XX
+	    LABEL(NN+1:)=VALUE
+	    CALL SETSYM(LABEL,NN+13,IER,IST2)
+	ELSE IF(COM.EQ.'ELSE')THEN
+	    IF(IFLEV.GT.0)THEN
+		SKIPIF=.TRUE.
+	    ELSE
+		CALL CMDERR(5,LINE,ILEN,1)
+	    ENDIF
+	ELSE IF(COM.EQ.'ENDIF')THEN
+	    IF(IFLEV.GT.0)THEN
+		SKIPIF=.FALSE.
+		IFLEV=IFLEV-1
+	    ELSE
+		CALL CMDERR(5,LINE,ILEN,1)
+	    ENDIF
+	ELSE IF(COM.EQ.'WHILE')THEN
+	    VALUE=LINE(7:ILEN)
+	    LABEL=VALUE
+	    CALL UPPER(VALUE,2048)
+	    ITHEN=INDEX(VALUE,'THEN')
+	    IF(ITHEN.LE.0)THEN
+		CALL CMDERR(4,LINE,ILEN,LBSTRT)
+		GOTO 1000
+	    ENDIF
+C
+C	CALL IF PARSING ROUTINE
+C
+	    CALL PARSEV(LABEL,VALUE,ITHEN-1,RESULT,IER,IPOS)
+	    IF(IER.NE.0)THEN
+		CALL CMDERR(IER,LINE,ILEN,LBSTRT+IPOS)
+		GOTO 1000
+	    ENDIF
+	    WHLEV=WHLEV+1
+	    WHCNT=0
+	    SKIPWH=.NOT.RESULT
+	    WHLINE(WHLEV)=LINCNT-1
+	ELSE IF(COM.EQ.'ENDW')THEN
+	    IF(WHLEV.LT.1)THEN
+		CALL CMDERR(8,LINE,ILEN,1)
+		GOTO 1000
+	    ENDIF
+	    REWIND(CMDLUN)
+	    DO 300 I=1,WHLINE(WHLEV)
+	    READ(CMDLUN,996)
+996	    FORMAT(1X)
+300	    CONTINUE
+	    LINCNT=WHLINE(WHLEV)
+	    WHLEV=WHLEV-1
+	ELSE
+	    CALL PARSEX(LINE,ILEN,X,IFLG,M,LABEL,N)
+	    LABEL(N+1:)=' '
+	    RETURN
+	ENDIF
+	GOTO 1000
+	END
diff --git a/ppl/symlib/getlin.F b/ppl/symlib/getlin.F
new file mode 100644
index 0000000..b77c1ff
--- /dev/null
+++ b/ppl/symlib/getlin.F
@@ -0,0 +1,107 @@
+	SUBROUTINE GETLIN(LINE,ILEN)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)getlin.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL GETLIN(LINE,ILEN)
+C**
+C**	Parameters:
+C**		LINE -- Line from command input device   (char*2048)
+C**		ILEN -- Length of LINE
+C**
+C**	Description:
+C**		Gets the next line from the command input device.
+C**
+C**	History:
+C**	    Written: 
+C**		21-DEC-85	by Donald W. Denbo
+C**	    Modified:
+C**
+C*** v552 *acm* 3/03 Longer strings: changes for multi-line labels
+C**
+	INCLUDE 'CMDCOM.INC'
+	INCLUDE 'SYSTEM.INC'
+
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER PMPT*30,LINE*(*),IN*2048
+	IP=INP
+	PMPT=PRMPT
+	K=1
+100	IN=' '
+#ifdef unix
+	IF(CMDFIL(1:8).EQ.'/dev/tty')THEN
+#else
+	if(cmdfil(1:3).eq.'TT:')then
+#endif
+	    CALL CHARIN(IN,2048,PMPT,IP)
+	ELSE
+	    READ(CMDLUN,999,END=901)IN
+999	    FORMAT(A)
+	    LINCNT=LINCNT+1
+	ENDIF
+	ILEN=LNBLK(IN,lenlab)
+	LINE(K:K+ILEN-1)=IN(1:ILEN)
+	IF(IN(ILEN:ILEN).EQ.'-')THEN
+	    K=K+ILEN-1
+C
+C	SINCE LF IS FIRST CHARACTER
+C
+	    PMPT=PRMPT
+	    PMPT(2:2)='_'
+	    PMPT(3:)=PRMPT(2:)
+	    IP=INP+1
+	    GOTO 100
+	ENDIF
+	ILEN=K+ILEN-1
+	RETURN
+C
+C	EOF READ GO UP ONE LEVEL IN COMMAND FILE STRUCTURE
+C
+901	CALL ATEND
+	IF(DONEF)RETURN
+	GOTO 100
+	END
diff --git a/ppl/symlib/getsym.F b/ppl/symlib/getsym.F
new file mode 100644
index 0000000..240bf71
--- /dev/null
+++ b/ppl/symlib/getsym.F
@@ -0,0 +1,168 @@
+	SUBROUTINE GETSYM(STR,LABEL,NC,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)getsym.F	1.3    5/31/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL GETSYM(STR,LABEL,NC,IER)
+C**
+C**	Parameters:
+C**		STR -- 120 CHARACTER SYMBOL  (char*120)
+C**		LABEL -- Value of symbol (char*2048)
+C**		NC -- length of LABEL
+C**		IER -- error code
+C**			0 = success
+C**			1 = symbol not found
+C**
+C**	Description:
+C**		Gets value for symbol.
+C**
+C**	History:
+C**	    Written:  
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SYMKEY.INC'
+	CHARACTER STR*(*),LABEL*(*),DTE*24
+
+	CHARACTER adate*8, atime*10, zone*5
+	CHARACTER*3 month_names(12)
+	INTEGER ival(8)
+        DATA month_names/
+     .  'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'/
+
+	LOGICAL SYS
+	CALL SYMCNV(STR,SYS)
+
+	IER=0
+	LABEL=' '
+C
+C	Check for special symbols
+C
+	IF(STR.EQ.'TIME')THEN
+
+#ifdef gfortran
+	   CALL  DATE_AND_TIME(adate, atime, zone, ival)
+	   WRITE (label, 101) ival(5), ival(6), ival(7)
+  101	   FORMAT (I2.2, ':', I2.2 ':', I2.2)
+           NC = 8
+#else
+
+#ifdef unix
+#ifdef F90_DATE_TIME
+            CALL FTIME(dte)
+            label=dte(1:8)
+            NC=8
+#else
+            CALL fdate(dte)
+            label=dte(12:19)
+            NC=9
+#endif
+#else
+            call time(label)
+            NC=8
+#endif
+#endif
+
+	ELSE IF(STR.EQ.'DATE')THEN
+
+#ifdef gfortran
+	   CALL  DATE_AND_TIME(adate, atime, zone, ival)
+* reformat the output
+	   WRITE (label, 102) ival(3), month_names(ival(2)), ival(1)
+  102	   FORMAT (I2.2, '-', A3, '-', I4.4)
+           NC = 11
+#else
+
+#ifdef unix
+            CALL FDATE(dte)
+#ifdef F90_DATE_TIME
+            label=dte(4:6)//' '//dte(1:2)//' '//dte(8:9)
+            NC=9
+#else
+            label=dte(5:11)//dte(21:24)
+            NC=11
+#endif
+#else
+            call date(label)
+            nc=9
+#endif
+#endif
+
+	ELSE
+C
+C	Otherwise get symbol value from file
+C
+	    CALL GTSYM2(STR,LABEL,NC,SYS,IER)
+	ENDIF
+	RETURN
+	END
+	SUBROUTINE GTSYM2(STR,LABEL,NC,SYS,IER)
+
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SYMKEY.INC'
+
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER STR*(*),LABEL*(*),dummy*120
+	LOGICAL SYS
+	ilen=lnblk(str,120)
+	IF(SYS)GOTO 100
+	IF(SMKEY2)THEN
+	    call dbmfetch(keyln2,str,ilen,label,nc,ier)
+	    if(ier.ne.0)goto 100
+	    RETURN
+	ENDIF
+100	call dbmfetch(keyln1,str,ilen,label,nc,ier)
+	RETURN
+	END
diff --git a/ppl/symlib/gtqual.F b/ppl/symlib/gtqual.F
new file mode 100644
index 0000000..a483fd5
--- /dev/null
+++ b/ppl/symlib/gtqual.F
@@ -0,0 +1,132 @@
+	SUBROUTINE GTQUAL(LINE,ILEN,IER,IPOS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)gtqual.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL GTQUAL(LINE,ILEN,IER,IPOS)
+C**
+C**	Parameters:
+C**		LINE -- Input line containing qualifiers (char*2048)
+C**		ILEN -- Length of command portion
+C**		IER  -- Error code =0 no error
+C**       =3 qualifier not found
+C**		IPOS -- Position of bad qualifier
+C**
+C**	Description:
+C**		GTQUAL parses the command and qualifiers and sets the
+C**		appropriate flag in the switch common blocks
+C**
+C**	History:
+C**	    Written: 
+C**		2-AUG-86	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C       Mod *JD* 3.22.91 to permit use of / in command qualifiers for unix.
+C       Not a complete fix as will screw up unix paths elsewhere in PPL
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+
+	INCLUDE 'SWITCH.INC'
+
+	CHARACTER LINE*(*)
+	LOGICAL TEST
+C
+C	SET DEFULTS
+C
+	IER=0
+	IDONE=LNBLK(LINE,2048)
+C       Mod to allow Ferret to work in Unix as is -- using "/" for
+C       qualifiers -- test mode only J Davison 3.22.91  3 ifdefs commented out
+C*JD*#ifdef unix
+C	ILEN = INDEX(LINE,':')-1
+C#else
+	ilen = index(line,'/')-1
+C#endif
+	IF(ILEN.LE.0)ILEN=IDONE
+	DO 10 I=1,NFLAGS
+10	FLAG(I)=DEFLTS(I)
+C
+C	PARSE LINE
+C
+	N=0
+	IS=1
+C*JD*#ifdef  unix
+C20	ISLSH = INDEX(LINE(IS:),':')+IS-1
+C#else
+20	islsh = index(line(is:),'/')+is-1
+C#endif
+	IF(ISLSH.GE.IS)THEN
+C
+C	QUALIFIER FOUND
+C
+C*JD*#ifdef unix
+C	    IEND = INDEX(LINE(ISLSH+1:),':')+ISLSH
+C#else
+	    iend = index(line(islsh+1:),'/')+islsh
+C#endif
+	    IF(IEND.LE.ISLSH)IEND=IDONE+1
+	    TEST=LINE(ISLSH+1:ISLSH+2).NE.'NO'
+	    IF(TEST)THEN
+		ISLSH=ISLSH+1
+	    ELSE
+		ISLSH=ISLSH+3
+	    ENDIF
+	    LLEN=IEND-ISLSH
+C
+C	CHECK FOR LEGAL QUALIFIER
+C
+	    DO 30 J=1,NFLAGS
+	    IF(LLEN.LT.SMIN(J))GOTO 30
+	    IF(LINE(ISLSH:IEND-1).EQ.SWITCH(J)(1:LLEN))GOTO 31
+30	    CONTINUE
+	    IER=3
+	    IPOS=ISLSH
+	    RETURN
+31	    FLAG(J)=TEST
+	    IS=IEND
+	    GOTO 20
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/lstsym.F b/ppl/symlib/lstsym.F
new file mode 100644
index 0000000..84d3efd
--- /dev/null
+++ b/ppl/symlib/lstsym.F
@@ -0,0 +1,91 @@
+	SUBROUTINE LSTSYM(STR,LABEL,NC,ILST,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)lstsym.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL LSTSYM(STR,LABEL,NC,ILST,IER)
+C**
+C**	Parameters:
+C**		STR -- Symbol name (char*120)
+C**		LABEL -- Symbol value (char*2048)
+C**		NC -- length of LABEL
+C**		ILST -- Initially run with ILST = 0
+C**			Output is a counter
+C**		IER -- error code
+C**			0 = success
+C**			1 = error or end of file
+C**
+C**	Description:
+C**		Gets the symbol values one by one until all have been
+C**		accessed.
+C**
+C**	History:
+C**	    Written:
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'SYMKEY.INC'
+
+	CHARACTER STR*(*),LABEL*(*)
+	IF(ILST.EQ.0)THEN
+	    call dbmfirstkey(keyln1,str,ilen,ier)
+	else
+	    call dbmnextkey(keyln1,str,ilen,ier)
+	endif
+	if(ier.ne.0)goto 2000
+	call dbmfetch(keyln1,str,ilen,label,nc,ier)
+	str(ilen+1:)=' '
+	ILST=ILST+1
+	IER=0
+	RETURN
+2000	IER=1
+	RETURN
+	END
diff --git a/ppl/symlib/parse.F b/ppl/symlib/parse.F
new file mode 100644
index 0000000..d25580e
--- /dev/null
+++ b/ppl/symlib/parse.F
@@ -0,0 +1,103 @@
+	SUBROUTINE PARSE(LINE,ILEN,ICOM,LAB,N,IST)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)parse.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL PARSE(LINE,ILEN,ICOM,LAB,N)
+C**
+C**	Parameters:
+C**		LINE -- Line to be parsed   (char*2048)
+C**		ILEN -- Length of ILEN
+C**		ICOM -- Command from LINE   (char*2048)
+C**		LAB -- rest of LINE  (char*2048)
+C**		N -- Length of LAB
+C**		IST -- Start position of LAB
+C**
+C**	Description:
+C**		Remove the command from LINE and places the rest of LINE
+C**		in LAB.
+C**
+C**	History:
+C**	    Written: 
+C**		22-DEC-85	by Donald W. Denbo
+C**	    Modified:
+C**
+C*
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C * v552 *acm* 3/03 Longer strings: changes for multi-line labels
+C v580 *acm* 8/04 Change use of 256 to buflen+1, 
+C                 where buflen is defined in cmndlen.inc
+
+        INCLUDE 'cmndlen.inc'
+
+	CHARACTER ICOM*(*),LAB*(*),LINE*(*)
+	ICOM=' '
+	LAB=' '
+C
+C	Search for the fist space or comma
+C
+	N=0
+	IST=0
+	ISPC=INDEX(LINE,' ')
+	IF(ISPC.EQ.0)ISPC=buflen+1
+	ICMA=INDEX(LINE,',')
+	IF(ICMA.EQ.0)ICMA=buflen+1
+	I=MIN0(ISPC,ICMA,buflen+1,ILEN+1)
+	ICOM=LINE(:I-1)
+	CALL UPPER(ICOM,2048)
+100	I=I+1
+	IF(I.GT.ILEN)RETURN
+	IF(LINE(I:I).EQ.' ')GOTO 100
+	IF(LINE(I:I).EQ.'"')I=I+1
+	LAB=LINE(I:)
+	IST=I
+	N=ILEN-I+1
+	IF(LAB(N:N).EQ.'"')THEN
+	    LAB(N:N)=' '
+	    N=N-1
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/parsev.F b/ppl/symlib/parsev.F
new file mode 100644
index 0000000..c3a44ff
--- /dev/null
+++ b/ppl/symlib/parsev.F
@@ -0,0 +1,324 @@
+	SUBROUTINE PARSEV(LINE,UPLINE,ILEN,RESULT,IER,IPOS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)parsev.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		call parsev(line,upline,ilen,result,ier,ipos)
+C**
+C**	Parameters:
+C**		line -- input line (char*2048)
+C**		upline -- input line capitals (char*2048)
+C**		ilen -- length of line
+C** 	result -- output (logical)
+C**		ier -- error code
+C**		       6 = no operator found
+C**		ipos -- position error was found in line
+C**
+C**	Description:
+C**		Parses the logical expression for both if and while
+C**		statements.  Returns a logical result, either true or
+C**		false.
+C**
+C**	History:
+C**	    Written: 
+C**		3-SEP-86	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+        INCLUDE 'cmndlen.inc'
+
+	CHARACTER LINE*(*),UPLINE*(*),EXP1*2048,EXP2*2048
+	LOGICAL RESULT,NUM1,NUM2,NUM
+	IER=0
+C
+C	CHECK FOR OPERATORS
+C
+	IEQ=INDEX(UPLINE,'.EQ.')
+	IF(IEQ.LE.0)THEN
+	    IEQ=buflen+1
+	ELSE
+	    ISW=1
+	ENDIF
+	INE=INDEX(UPLINE,'.NE.')
+	IF(INE.LE.0)THEN
+	    INE=buflen+1
+	ELSE
+	    ISW=2
+	ENDIF
+	ILT=INDEX(UPLINE,'.LT.')
+	IF(ILT.LE.0)THEN
+	    ILT=buflen+1
+	ELSE
+	    ISW=3
+	ENDIF
+	IGT=INDEX(UPLINE,'.GT.')
+	IF(IGT.LE.0)THEN
+	    IGT=buflen+1
+	ELSE
+	    ISW=4
+	ENDIF
+	ILE=INDEX(UPLINE,'.LE.')
+	IF(ILE.LE.0)THEN
+	    ILE=buflen+1
+	ELSE
+	    ISW=5
+	ENDIF
+	IGE=INDEX(UPLINE,'.GE.')
+	IF(IGE.LE.0)THEN
+	    IGE=buflen+1
+	ELSE
+	    ISW=6
+	ENDIF
+	IOP=MIN0(IEQ,INE,ILT,IGT,ILE,IGE)
+	IF(IOP.GE.buflen+1)THEN
+C
+C	NO OPERATOR FOUND
+C
+	    IER=6
+	    IPOS=1
+	    RETURN
+	ENDIF
+C
+C	GET EXPRESSIONS
+C
+	I=1
+100	IF(LINE(I:I).NE.' ')GOTO 110
+	I=I+1
+	GOTO 100
+110	EXP1=LINE(I:IOP-1)
+	LEN1=LNBLK(EXP1,IOP-I)
+	I=IOP+4
+120	IF(LINE(I:I).NE.' ')GOTO 130
+	I=I+1
+	GOTO 120
+130	EXP2=LINE(I:ILEN)
+	LEN2=LNBLK(EXP2,ILEN-I+1)
+C
+C	EVALUATE EXPRESSIONS
+C
+	CALL EXPEVL(EXP1,LEN1,X1,NUM1,IER)
+	CALL EXPEVL(EXP2,LEN2,X2,NUM2,IER)
+	NUM=NUM1.AND.NUM2
+C
+C	DO TEST
+C
+	IF(NUM)THEN
+	    GOTO(201,202,203,204,205,206)ISW
+201	    RESULT=X1.EQ.X2
+     	    GOTO 210
+202	    RESULT=X1.NE.X2
+	    GOTO 210
+203	    RESULT=X1.LT.X2
+	    GOTO 210
+204	    RESULT=X1.GT.X2
+	    GOTO 210
+205	    RESULT=X1.LE.X2
+	    GOTO 210
+206	    RESULT=X1.GE.X2
+210	    CONTINUE
+	ELSE
+	    GOTO(301,302,303,304,305,306)ISW
+301	    RESULT=EXP1(:LEN1).EQ.EXP2(:LEN2)
+	    GOTO 310
+302	    RESULT=EXP1(:LEN1).NE.EXP2(:LEN2)
+	    GOTO 310
+303	    RESULT=EXP1(:LEN1).LT.EXP2(:LEN2)
+	    GOTO 310
+304	    RESULT=EXP1(:LEN1).GT.EXP2(:LEN2)
+	    GOTO 310
+305	    RESULT=EXP1(:LEN1).LE.EXP2(:LEN2)
+	    GOTO 310
+306	    RESULT=EXP1(:LEN1).GE.EXP2(:LEN2)
+310	    CONTINUE
+	ENDIF
+	RETURN
+	END
+	SUBROUTINE EXPEVL(STRING,SLEN,X,NUM,IER)
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		call expevl(string,slen,x,num,ier)
+C**
+C**	Parameters:
+C**		string -- input expression (char*2048)
+C**		slen  -- length of string
+C**		x -- numeric result
+C**		num -- logical for number (logical)
+C**		ier -- error code
+C**		       7 = unmatched "
+C**
+C**	Description:
+C**		Evaluates expression.
+C**
+C**	History:
+C**	    Written: 
+C**		3-SEP-86	by Donald W. Denbo
+C**	    Modified:
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       *jd* 11.94 - modified for AIX port
+*       Modification uses TM_NUMBER to determine if "value" is a number rather
+*       than the ERR= branch of a READ which fails on AIX/xlf
+
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER STRING*(*),TEMP*2048,FRMT*120
+	INTEGER SLEN
+	LOGICAL NUM
+
+        LOGICAL TM_NUMBER                ! ** TMAP mod 11/94 **
+
+	NUM=.FALSE.
+C
+C	CHECK FOR STRING
+C
+	IER=0
+	SLEN=LNBLK(STRING,SLEN)
+	STRING=STRING(:SLEN)
+	IF(STRING(1:1).EQ.'"')THEN
+	    IF(STRING(SLEN:SLEN).NE.'"')THEN
+		IER=7
+		RETURN
+	    ENDIF
+	    TEMP=STRING(2:SLEN-1)
+	    SLEN=SLEN-2
+	ELSE
+C
+C	CHECK FOR NUMBER
+C
+	    if(slen.eq.1)then
+
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(string) ) GOTO 100 ! TMAP Mod
+#endif
+		read(string,'(i1)',err=100)jk
+		x=jk
+	    else
+	        WRITE(FRMT,999)SLEN
+999	    FORMAT('(E',I3.3,'.0)')
+
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(string) ) GOTO 100 ! TMAP Mod
+#endif
+	    READ(STRING,FRMT,ERR=100)X
+	    endif
+	    NUM=.TRUE.
+	    RETURN
+	ENDIF
+200	IF(SLEN.EQ.0)GOTO 300
+	if(slen.eq.1)then
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(temp) ) GOTO 300 ! TMAP Mod
+#endif
+	    read(temp,'(i1)',err=300)jk
+	    x=jk
+	else
+	    WRITE(FRMT,999)SLEN
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(temp) ) GOTO 300 ! TMAP Mod
+#endif
+	    READ(TEMP,FRMT,ERR=300)X
+	endif
+	NUM=.TRUE.
+300	STRING=TEMP
+	RETURN
+100	CALL GETSYM(STRING(:30),TEMP,SLEN,IER2)
+	IF(IER2.NE.0)THEN
+	    STRING=' '
+	    SLEN=0
+	    RETURN
+	ENDIF
+	GOTO 200
+	END
diff --git a/ppl/symlib/parsex.F b/ppl/symlib/parsex.F
new file mode 100644
index 0000000..72294c1
--- /dev/null
+++ b/ppl/symlib/parsex.F
@@ -0,0 +1,195 @@
+	SUBROUTINE PARSEX(LINE,ILEN,X,INTIF,M,LABEL,N)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)parsex.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL PARSEX(LINE,ILEN,X,IF,M,LABEL,N)
+C**
+C**	Parameters:
+C**		LINE -- Line to be parsed   (char*2048)
+C**		ILEN -- Length of LINE
+C**		X -- Numerical array
+C**		INTIF -- Flag array
+C**			=0 X() not changed
+C**			=1 X() replaced
+C**		M -- Length of numerical and flag array
+C**		LABEL -- Character portion of LINE  (char*2048)
+C**		N -- Length of LABEL
+C**
+C**	Description:
+C**		Parses the numerical values in LINE placing the results
+C**		in X and sets the flag array IF appropriatly.  The
+C**		character information starting after the last valid 
+C**		number in placed in LABEL.
+C**
+C**	History:
+C**	    Written: 
+C**		30-MAY-85	by Donald W. Denbo
+C**	    Modified:
+C**
+C*
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* v580 *acm* 8/04 Change use of 256 to buflen+1, 
+*                 where buflen is defined in cmndlen.inc
+
+        INCLUDE 'cmndlen.inc'
+
+	CHARACTER LABEL*(*),LINE*(*),FRMT*30
+	DIMENSION X(*),INTIF(*)
+
+*
+*
+*     *jd* variable IF renamed to INTIF for MAC 7.92
+*     *jd* 11.94 -  modified for AIX port
+*       Modification uses TM_NUMBER to determine if "value" is a number rather
+*       than the ERR= branch of a READ which fails on AIX/xlf
+
+        LOGICAL TM_NUMBER                ! ** TMAP mod 11/94 **
+        INTEGER i                        ! ** TMAP mod 6/03 to init INTIF
+C
+	LOGICAL FIRST
+C
+C	Initialize output values
+C
+	LABEL = ' '
+	N=0
+        DO 90 I = 1, 20
+	INTIF(I)=0
+   90   CONTINUE
+	M=1
+	IF(ILEN.LE.0)THEN
+	    M=0
+	    RETURN
+	ENDIF
+	FIRST=.TRUE.
+	I=1
+C
+C	Search for space or comma  (legal seperator)
+C
+100	IOLD=I
+	ISPC=INDEX(LINE(I:),' ')+I-1
+	IF(ISPC.EQ.I-1)ISPC=buflen+1
+	ICMA=INDEX(LINE(I:),',')+I-1
+	IF(ICMA.EQ.I-1) ICMA=buflen+1
+	J=MIN0(ISPC,ICMA,ILEN+1)
+
+* *acm 3/06 If i=j, see if what we have is a comma then space. 
+*           Previously a space then comma was interpreted as
+*           if it were two commas.  Check for just one comma
+*           between elements, and can have any number of spaces.
+
+        IF (i .EQ. j) THEN
+           ICMA = INDEX(line(iold:i),',')
+           IF (ICMA .NE. 0 .AND.
+     .         INDEX(line(icma+1:i),',') .EQ. 0) THEN
+              i = i + 1
+              GOTO 100
+           ENDIF
+        ENDIF
+C
+C	Try to read a number,  if it fails put the rest into
+C	LABEL if first is not true
+C
+	IF(I-J.EQ.0.OR.LINE(I:J-1).EQ.' ')THEN
+	    INTIF(M)=0
+	ELSE
+C
+C	Test for LINE(I:I) being +,-,., or 0-9.
+C	That is a legal number
+C
+	    ITST=ICHAR(LINE(I:I))
+	    IF(.NOT.(ITST.EQ.43.OR.ITST.EQ.45.OR.ITST.EQ.46
+     *		.OR.(ITST.GE.48.AND.ITST.LE.57)))GOTO 1000
+	    IWID=J-I
+	    if(iwid.eq.1)then
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(LINE(I:J-1)) ) GOTO 1000  ! TMAP mod 11/94
+#endif
+		read(line(i:j-1),'(i1)',err=1000)jk
+		x(m)=jk
+	    else
+	    WRITE(FRMT,999)IWID
+999	    FORMAT('(F',I3.3,'.0)')
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(LINE(I:J-1)) ) GOTO 1000  ! TMAP mod 11/94
+#endif
+	    READ(LINE(I:J-1),FRMT,ERR=1000)X(M)
+	    endif
+	    INTIF(M)=1
+	ENDIF
+	FIRST=.FALSE.
+	I=J
+200	I=I+1
+	IF(I.GT.ILEN)RETURN
+	IF(LINE(I:I).EQ.' ')GOTO 200
+	M=M+1
+	GOTO 100
+C
+C	Error trying to read a number
+C	clear the error and put the rest in LABEL
+C
+1000	continue
+#ifndef unix
+	CALL ERRTST(64,I)
+#endif
+	IF(FIRST)THEN
+	    FIRST=.FALSE.
+	    I=J
+	    M=M-1
+	    GOTO 200
+	ENDIF
+	M=M-1
+	I=IOLD
+	IF(LINE(I:I).EQ.'"')I=I+1
+	LABEL=LINE(I:)
+	N=ILEN-I+1
+	IF(LABEL(N:N).EQ.'"')THEN
+	    LABEL(N:N)=' '
+	    N=N-1
+	ENDIF
+	RETURN
+	END
diff --git a/ppl/symlib/putsym.F b/ppl/symlib/putsym.F
new file mode 100644
index 0000000..4404034
--- /dev/null
+++ b/ppl/symlib/putsym.F
@@ -0,0 +1,90 @@
+	SUBROUTINE PUTSYM(STR,LABEL,NC,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)putsym.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL PUTSYM(STR,LABEL,NC,IER)
+C**
+C**	Parameters:
+C**		STR -- Symbol name (char*120)
+C**		LABEL -- Value of symbol (char*2048)
+C**		NC -- length of LABEL
+C**		IER -- error code
+C**			0 = sucess
+C**			1 = error other than symbol not found
+C**
+C**	Description:
+C**		Updates or creates the value for symbol STR.
+C**
+C**	History:
+C**	    Written:
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SYMKEY.INC'
+
+	LOGICAL SYS
+	INTEGER LUN
+	CHARACTER STR*(*),LABEL*(*)
+	
+	INTEGER symlen
+	PARAMETER (symlen = 120)
+
+	CALL SYMCNV(STR,SYS)
+	IER=0
+	LUN=KEYLN1
+	ilen=lnblk(str,symlen)
+	IF(SYS)GOTO 100
+	IF(SMKEY2)LUN=KEYLN2
+100	call dbmstore(lun,str,ilen,label,nc,ier)
+	RETURN
+	END
diff --git a/ppl/symlib/putval.F b/ppl/symlib/putval.F
new file mode 100644
index 0000000..ce2a596
--- /dev/null
+++ b/ppl/symlib/putval.F
@@ -0,0 +1,87 @@
+	SUBROUTINE PUTVAL(STR,X,IPRES,IER)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)putval.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL PUTVAL(STR,X,IPRES,IER)
+C**
+C**	Parameters:
+C**		STR -- Symbol name (char*120)
+C**		X -- Real value of symbol
+C**		IPRES -- number of digits, i.e, 1PG10.IPRES
+C**		IER -- error code
+C**			0 = sucess
+C**			1 = error other than symbol not found
+C**
+C**	Description:
+C**		Updates or creates the value for symbol STR.
+C**
+C**	History:
+C**	    Written:
+C**		14-JAN-1987	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C * v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+	CHARACTER STR*(*),VAL*2048,FRMT*120
+	IP=IPRES
+	IF(IPRES.GT.10.OR.IPRES.LT.0)IP=4
+	IL=IP+7
+	WRITE(FRMT,999)IL,IP
+999	FORMAT('(1PG',I3.3,'.',I3.3,')')
+	WRITE(VAL,FRMT)X
+100	IF(VAL(1:1).EQ.' ')THEN
+	    VAL=VAL(2:)
+	    IL=IL-1
+	    GOTO 100
+	ENDIF
+	NC=LNBLK(VAL,IL)
+	CALL PUTSYM(STR,VAL,NC,IER)
+	RETURN
+	END
diff --git a/ppl/symlib/setsym.F b/ppl/symlib/setsym.F
new file mode 100644
index 0000000..8028403
--- /dev/null
+++ b/ppl/symlib/setsym.F
@@ -0,0 +1,369 @@
+	SUBROUTINE SETSYM(LINE,ILEN,IER,IST)
+C** 
+C**    @(#)setsym.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL SETSYM(LINE,ILEN,IER,IST)
+C**
+C**	Parameters:
+C**		LINE -- Line containing symbol and value (char*2048)
+C**		ILEN -- Length of LINE
+C**		IER  -- Error code
+C**			0 = success
+C**			1 = symbol not found
+C**		IST -- relative position of sym in LINE
+C**
+C**	Description:
+C**		Parses LINE and sets the symbol defined with the value
+C**		specified.
+C**
+C**	History:
+C**	    Written:
+C**		22-DEC-85	by Donald W. Denbo
+C**	    Modified:
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+** TMAP mod **
+* *sh* 10/27/94 - modified for AIX port
+*	Modification uses TM_NUMBER to determine if "value" is a number rather
+*	than the ERR= branch of a READ which fails on AIX/xlf
+* *jd* 11.3.94 Fixed(?) the fix -- permit read if text is a number
+**************
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+
+	CHARACTER LINE*(*),VALUE*2048,SYM*120,OPR*1,ARG(4)*120
+	CHARACTER FUNCT*30,FRMT*30
+	LOGICAL NUM,FUNC
+
+	LOGICAL TM_NUMBER		! ** TMAP mod 10/94 **
+C
+C	PARSE LINE 
+C
+	IST=0
+	NUM=.TRUE.
+	ISPC=INDEX(LINE(:ILEN),' ')
+	IF(ISPC.EQ.0.)ISPC=ILEN+1
+	IPARN=INDEX(LINE(:ILEN),')')
+	IF(IPARN.EQ.0.OR.IPARN.GT.ISPC)THEN
+	    I=ISPC-1
+	ELSE
+	    I=IPARN
+	ENDIF
+	SYM=LINE(:I)
+	N=0
+100	I=I+1
+	IF(I.GT.ILEN)GOTO 120
+	IF(LINE(I:I).EQ.' ')GOTO 100
+C
+C	I=START OF VALUE
+C
+	FUNC=LINE(I:I).EQ.'$'
+C
+	IF(LINE(I:I).EQ.'"')THEN
+	    I=I+1
+	    NUM=.FALSE.
+	ENDIF
+	VALUE=LINE(I:ILEN)
+	N=ILEN-I+1
+	IF(VALUE(N:N).EQ.'"')THEN
+	    VALUE(N:N)=' '
+	    N=N-1
+	ENDIF
+C
+C	TEST FOR ALGEBRA AND DECODE IF IT HAS CORRECT SYNTAX
+C
+	IF(FUNC)THEN
+	    FUNCT=VALUE
+	    CALL UPPER(FUNCT,30)
+C
+C	PARSE FUNCTION ARGUEMENTS
+C
+	    I=INDEX(VALUE,'(')+1
+	    J=INDEX(VALUE,')')-1
+	    VALUE=VALUE(I:J)
+	    N=J-I+1
+	    K=1
+300	    CALL CMLJST(VALUE,N)
+	    IF(VALUE(1:1).EQ.'"')THEN
+		II=INDEX(VALUE(2:),'"')
+		ARG(K)=VALUE(2:II)
+		I=INDEX(VALUE(II+1:),',')+II-1
+		IF(I.EQ.II-1)I=N
+	    ELSE
+		I=INDEX(VALUE,',')-1
+		IF(I.EQ.-1)I=N
+		ARG(K)=VALUE(:I)
+	    ENDIF
+	    IF(I.LT.N)THEN
+		K=K+1
+		VALUE=VALUE(I+2:)
+		N=N-I-1
+		GOTO 300
+	    ENDIF
+C
+C	$EDIT(symbol,arguement)
+C
+	    IF(FUNCT(1:3).EQ.'$ED')THEN
+		CALL GETSYM(ARG(1),VALUE,N,IER)
+		CALL UPPER(ARG(2),30)
+		IF(INDEX(ARG(2),'UP').NE.0)THEN
+		    CALL UPPER(VALUE,N)
+		ENDIF
+		IF(INDEX(ARG(2),'TR').NE.0)THEN
+		    CALL CMLJST(VALUE,N)
+		    N=LNBLK(VALUE,N)
+		ENDIF
+		IF(INDEX(ARG(2),'COM').NE.0)THEN
+		    CALL CMPRSS(VALUE,N)
+		ENDIF
+		IF(INDEX(ARG(2),'COL').NE.0)THEN
+		    CALL SQUISH(VALUE,1,N)
+		    N=LNBLK(VALUE,N)
+		ENDIF
+C
+C	$EXTRACT(start,length,symbol)
+C
+	    ELSE IF(FUNCT(1:3).EQ.'$EX')THEN
+		CALL GETSYM(ARG(3),VALUE,N,IER)
+		CALL RDFLT(ARG(1),X)
+		I=INT(X)
+		CALL RDFLT(ARG(2),X)
+		J=INT(X)
+		VALUE=VALUE(I:I+J)
+		N=J
+C
+C	$INTEGER(symbol)
+C
+	    ELSE IF(FUNCT(1:3).EQ.'$IN')THEN
+		CALL GETSYM(ARG(1),VALUE,N,IER)
+		CALL RDFLT(VALUE,X)
+		WRITE(VALUE,'(I10)')INT(X+0.5)
+		N=10
+		CALL CMLJST(VALUE,N)
+		N=LNBLK(VALUE,N)
+C
+C	$LENGTH(symbol)
+C
+	    ELSE IF(FUNCT(1:3).EQ.'$LE')THEN
+		CALL GETSYM(ARG(1),VALUE,N,IER)
+		WRITE(VALUE,'(I10)')N
+		N=10
+		CALL CMLJST(VALUE,N)
+		N=LNBLK(VALUE,N)
+C
+C	$LOCATE(substring,symbol)
+C
+	    ELSE IF(FUNCT(1:3).EQ.'$LO')THEN
+		CALL GETSYM(ARG(2),VALUE,N,IER)
+		K=LNBLK(ARG(1),30)
+		I=INDEX(VALUE(:N),ARG(1)(:K))
+		WRITE(VALUE,'(I10)')I
+		N=10
+		CALL CMLJST(VALUE,N)
+		N=LNBLK(VALUE,N)
+C
+C	$ELEMENT(position,delimeter,symbol)
+C
+	    ELSE IF(FUNCT(1:3).EQ.'$EL')THEN
+		CALL GETSYM(ARG(3),VALUE,N,IER)
+		CALL RDFLT(ARG(1),X)
+		K=INT(X)
+		I=1
+400		CALL CMLJST(VALUE,N)
+		J=INDEX(VALUE(:N),ARG(2)(1:1))
+		IF(J.EQ.0)THEN
+		    IF(K.EQ.I)THEN
+			J=N+1
+		    ELSE
+			VALUE=ARG(2)(1:1)
+			N=1
+			GOTO 410
+		    ENDIF
+		ENDIF
+		IF(K.EQ.I)THEN
+		    VALUE=VALUE(:J-1)
+		    N=LNBLK(VALUE,J-1)
+		    GOTO 410
+		ELSE
+		    VALUE=VALUE(J+1:)
+		    N=N-J
+		    I=I+1
+		ENDIF
+		GOTO 400
+410		CONTINUE
+	    ENDIF
+	ELSE IF(NUM)THEN
+	    I=INDEX(VALUE,' ')
+	    K=I-1
+	    if(k.eq.1)then
+#ifdef AIX_XLF
+	       IF ( .NOT.TM_NUMBER(value(:k)) ) GOTO 120! ** TMAP mod 10/94 **
+#endif
+		read(value(:k),'(i1)',err=120)jk
+		x1=jk
+	    else
+	    WRITE(FRMT,999)K
+999	    FORMAT('(F',I3.3,'.0)')
+#ifdef AIX_XLF
+	    IF ( .NOT.TM_NUMBER(value(:i-1)) ) GOTO 120	! ** TMAP mod 10/94 **
+#endif
+	    READ(VALUE(:I-1),FRMT,ERR=120)X1
+	    endif
+200	    I=I+1
+	    IF(I.GT.N)GOTO 120
+	    IF(VALUE(I:I).EQ.' ')GOTO 200
+	    OPR=VALUE(I:I)
+	    IOPR=I
+210	    I=I+1
+	    IF(I.GT.N)GOTO 120
+	    IF(VALUE(I:I).EQ.' ')GOTO 210
+	    IST=INDEX(VALUE(I:),' ')+I-2
+	    K=IST-I+1
+	    WRITE(FRMT,999)K
+#ifdef AIX_XLF
+	    IF ( .NOT.TM_NUMBER(value(i:ist)) ) GOTO 120	! ** TMAP mod 10/94 **
+#endif
+	    READ(VALUE(I:IST),FRMT,ERR=120)X2
+	    IF(OPR.EQ.'+')THEN
+		X=X1+X2
+	    ELSE IF(OPR.EQ.'-')THEN
+		X=X1-X2
+	    ELSE IF(OPR.EQ.'*')THEN
+		X=X1*X2
+	    ELSE IF(OPR.EQ.'/')THEN
+		X=X1/X2
+	    ELSE
+		GOTO 120
+	    ENDIF
+	    CALL PUTVAL(SYM,X,4,IER)
+	    RETURN
+	ENDIF
+120	CALL PUTSYM(SYM,VALUE,N,IER)
+	RETURN
+	END
+	SUBROUTINE CMPRSS(STR,LEN)
+C
+C	REMOVE EXTRA BLANKS
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER STR*(*),TEMP*2048
+	LOGICAL BLANK
+	K=1
+	BLANK=.FALSE.
+	DO 100 J=1,LEN
+	    IF(STR(J:J).EQ.' ')THEN
+		IF(.NOT.BLANK)THEN
+		    BLANK=.TRUE.
+		ELSE
+		    GOTO 100
+		ENDIF
+	    ELSE
+		BLANK=.FALSE.
+	    ENDIF
+	    TEMP(K:K)=STR(J:J)
+	    K=K+1
+100	CONTINUE
+	STR=TEMP(:K-1)
+	LEN=K-1
+	RETURN
+	END
+	SUBROUTINE RDINT(STR,K)
+	CHARACTER STR*(*),FRMT*30
+	N=LNBLK(STR,30)
+	if(n.eq.0)then
+	    k=0
+	    return
+	endif
+	WRITE(FRMT,999)N
+999	FORMAT('(I',I2.2,')')
+	READ(STR,FRMT)K
+	RETURN
+	END
+	SUBROUTINE RDFLT(STR,X)
+        LOGICAL TM_NUMBER                ! ** TMAP mod 11/94 **
+C
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+	CHARACTER STR*(*),FRMT*30
+	N=LNBLK(STR,30)
+	IF(N.EQ.0)THEN
+C
+C	DEFAULT VALUE IF NO NUMBER IS 1.0
+C
+100	    X=1.0
+	    RETURN
+	ENDIF
+	if(n.eq.1)then
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(str) ) GOTO 100  ! ** TMAP mod 11/94 **
+#endif
+	    read(str,'(i1)',err=1000)jk
+	    x=jk
+	else
+	WRITE(FRMT,999)N
+999	FORMAT('(F',I2.2,'.0)')
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(str) ) GOTO 100  ! ** TMAP mod 11/94 **
+#endif
+	READ(STR,FRMT,ERR=1000)X
+	endif
+
+C       7/97 added following in - needed to preven reseting of x *kob*
+	RETURN
+C	Change above err=100 stmts to err=1000 and copy that line
+C	for FORTRAN 90 on linux *jd* 1.21.97
+1000	x=1.0
+
+	RETURN
+	END
+
diff --git a/ppl/symlib/stprmp.F b/ppl/symlib/stprmp.F
new file mode 100644
index 0000000..e606fe8
--- /dev/null
+++ b/ppl/symlib/stprmp.F
@@ -0,0 +1,94 @@
+	SUBROUTINE STPRMP(PMT,N)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)stprmp.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL STPRMP(PMT,N)
+C**
+C**	Parameters:
+C**		PMT -- Prompt to be used when input is from a terminal
+C**			(char*30)
+C**		N -- Lenght of the prompt
+C**
+C**	Description:
+C**		Sets the prompt for the GETLIN subroutine.
+C**
+C**	History:
+C**	    Written: 
+C**		21-DEC-85	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+#ifdef unix
+	INCLUDE 'CMDCOM.INC'
+	CHARACTER PMT*(*)
+	IF(N.NE.0)THEN
+	    PRMPT=PMT
+	    INP=N
+	ELSE
+	    PRMPT='*'
+	    INP=1
+	ENDIF
+#else
+	INCLUDE 'cmdinc:CMDCOM.INC'
+        CHARACTER PMT*30,FRMT*12,LF*1
+        BYTE CRB,LFB
+        EQUIVALENCE (LFB,LF)
+        DATA LFB/10/
+        IF(N.NE.0)THEN
+            PRMPT=LF
+            PRMPT(2:)=PMT
+            INP=N+1
+        ELSE
+            PRMPT=LF
+            PRMPT(2:2)='*'
+            INP=2
+        ENDIF
+#endif
+	RETURN
+	END
diff --git a/ppl/symlib/symcnv.F b/ppl/symlib/symcnv.F
new file mode 100644
index 0000000..8a57acb
--- /dev/null
+++ b/ppl/symlib/symcnv.F
@@ -0,0 +1,132 @@
+	SUBROUTINE SYMCNV(SYM,SYS)
+C** 
+C**    @(#)symcnv.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL SYMCNV(SYM,SYS)
+C**
+C**	Parameters:
+C**		SYM -- Symbol name (char*120)
+C**		SYS -- Symbol is SYSTEM type (logical)
+C**
+C**	Description:
+C**		Converts the symbol name to upper case and evaluates the
+C**		form SYM(#) to SYM#.
+C**
+C**	History:
+C**	    Written:
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       *jd* 11.94 - modified for AIX port
+*       Modification uses TM_NUMBER to determine if "value" is a number rather
+*       than the ERR= branch of a READ which fails on AIX/xlf
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* v580 *acm* 9/04 Longer strings: changes for multi-line labels; symbols may be *2048.
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+        LOGICAL TM_NUMBER      
+
+	LOGICAL SYS,SYS2
+	CHARACTER SYM*(*),FRMT*120,SYM2*120,VALUE*2048
+	INTEGER symlen
+	PARAMETER (symlen = 120)
+	SYS=.FALSE.
+	IF(SYM(1:1).EQ.'*')THEN
+	    SYS=.TRUE.
+	    FRMT=SYM(2:)
+	    SYM=FRMT
+	ENDIF
+200	I=INDEX(SYM,'(')+1
+	J=INDEX(SYM,')')-1
+	CALL UPPER(SYM,symlen)
+	IF(I.EQ.1.OR.J.EQ.-1)RETURN
+	if(i.eq.j)then
+
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(sym(i:j)) ) GOTO 100  ! TMAP mod
+#endif
+	    read(sym(i:j),'(i1)',err=100)jk
+	    frmt=sym(i:j)
+	else
+	WRITE(FRMT,999)J-I+1
+999	FORMAT('(E',I2.2,'.0)')
+#ifdef AIX_XLF
+            IF ( .NOT.TM_NUMBER(sym(i:j)) ) GOTO 100  ! TMAP mod
+#endif
+	READ(SYM(I:J),FRMT,ERR=100)X
+	WRITE(FRMT,998)IFIX(X+0.5)
+998	FORMAT(I2.2)
+	endif
+	IF(FRMT(1:1).EQ.'0')THEN
+	    SYM(I-1:)=FRMT(2:)
+	ELSE
+	    SYM(I-1:)=FRMT
+	ENDIF
+	RETURN
+100	SYM2=SYM(I:J)
+	ILEN=J-I+1
+	CALL CMLJST(SYM2,ILEN)
+	SYS2=SYM2(1:1).EQ.'*'
+	IF(SYS2)THEN
+	    FRMT=SYM2(2:)
+	    SYM2=FRMT
+	ENDIF
+	CALL GTSYM2(SYM2,VALUE,NC,SYS2,IER)
+	IF(IER.NE.0)THEN
+	    SYM(I:)=' '
+	    RETURN
+	ELSE
+	    SYM(I:)=VALUE(:NC)
+	    SYM(I+NC:)=')'
+	ENDIF
+	GOTO 200
+	END
+
+
diff --git a/ppl/symlib/symsub.F b/ppl/symlib/symsub.F
new file mode 100644
index 0000000..2e9e9d9
--- /dev/null
+++ b/ppl/symlib/symsub.F
@@ -0,0 +1,108 @@
+	SUBROUTINE SYMSUB(LINE,ILEN,IER,SYM,IPOS)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+C**    @(#)symsub.f	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL SYMSUB(LINE,ILEN,IER,SYM)
+C**
+C**	Parameters:
+C**		LINE -- String to have symbols substituted (char*2048)
+C**		ILEN -- length of LINE before and after substitution
+C**		IER -- error code
+C**			0 = success
+C**			1 = symbol not found
+C**			2 = unmatched '
+C**		SYM -- Symbol not found
+C**		IPOS -- position of error
+C**
+C**	Description:
+C**		Substitutes the values of symbols found in LINE.  Only
+C**		symbols of the form 'sym' are substitued.  A double '
+C**		is enterpretated as a single '.
+C**
+C**	History:
+C**	    Written: 
+C**		15-DEC-1985	by Donald W. Denbo
+C**	    Modified:
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+C* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+
+	CHARACTER LINE*(*),STR*2048,SYM*(*),GET*2048
+	IER=0
+	INXT=1
+100	IST=INDEX(LINE(INXT:),'''')+INXT-1
+	IF(IST.EQ.INXT-1.OR.IST.GT.ILEN)RETURN
+	STR=LINE(:IST-1)
+	ISP=INDEX(LINE(IST+1:),'''')+IST
+	IF(ISP.EQ.IST)THEN
+C	    UNMATCHED '
+	    IER=2
+	    IPOS=IST
+	    RETURN
+	ELSE IF((ISP-IST).EQ.1)THEN
+C	    DOUBLE '
+	    STR(IST:)=LINE(ISP:ILEN)
+	    ILEN=ILEN-1
+	    INXT=IST+1
+	ELSE
+C	    EXTRACT SYMBOL AND SUBSTITUTE
+	    SYM=LINE(IST+1:ISP-1)
+	    CALL GETSYM(SYM,GET,NC,IER)
+	    IF(IER.EQ.0)THEN
+		STR(IST:)=GET(:NC)
+		STR(IST+NC:)=LINE(ISP+1:ILEN)
+		ILEN=ILEN-(ISP-IST+1)+NC
+		INXT=IST
+	    ELSE
+		IPOS=IST+1
+		RETURN
+	    ENDIF
+	ENDIF
+	LINE=STR(1:ILEN)
+	GOTO 100
+	END
diff --git a/ppl/tmap_inc/aline.cmn b/ppl/tmap_inc/aline.cmn
new file mode 100644
index 0000000..4ad2b1d
--- /dev/null
+++ b/ppl/tmap_inc/aline.cmn
@@ -0,0 +1,10 @@
+*	Common block for ALINE command
+*	J Davison 10.16.89
+
+	logical		aline_on(NLINES),aline_user(NLINES)
+	real*4		aline_minx(NLINES),aline_miny(NLINES)
+	real*4		aline_maxx(NLINES),aline_maxy(NLINES)
+
+	common/ALINE_CMN/ aline_on,aline_user,aline_minx,aline_miny,
+     .			aline_maxx,aline_maxy
+
diff --git a/ppl/tmap_inc/axis_inc.decl b/ppl/tmap_inc/axis_inc.decl
new file mode 100644
index 0000000..04bb9b4
--- /dev/null
+++ b/ppl/tmap_inc/axis_inc.decl
@@ -0,0 +1,56 @@
+* AXIS_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* v552 *acm* 3/03 new param IAXSET to restore axes after PLOT/AXES/set plot.
+* v554: *acm* 2/04 add /HGRAT /VGRAT to draw optional graticule lines at tic marks
+* V600: *acm* 11/05 add XDMS,YDMS for deg/min/sec labels
+* V600: *acm*  2/06 add XVALOFF,YVALOFF for deg/min/sec labels
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+* V683 *acm*  9/12 MOD_VS_X and MOD_VS_Y. For PLOT/VS plots, data are treated as 
+*               modulo, if they have units of longitude.
+
+	REAL*4	XLO
+	REAL*4	XHI
+	REAL*4	XTIC
+	REAL*4	XLEN
+	REAL*4	XCSIZE
+	INTEGER	IAUTOX
+	INTEGER	ITYPEX
+	INTEGER	NMTCX
+	INTEGER	LINTX
+	INTEGER	LABELX
+	INTEGER	NSIGX
+	INTEGER	NTICX
+	REAL*4	XORG
+	REAL*4	YLO
+	REAL*4	YHI
+	REAL*4	YTIC
+	REAL*4	YLEN
+	REAL*4	YCSIZE
+	INTEGER	IAUTOY
+	INTEGER	ITYPEY
+	INTEGER	NMTCY
+	INTEGER	LINTY
+	INTEGER	LABELY
+	INTEGER	NSIGY
+	INTEGER	NTICY
+	REAL*4	YORG
+	INTEGER	IAXON
+        INTEGER IAXSET
+        REAL*4    HGRAT
+        REAL*4    VGRAT
+        INTEGER HCOLOR
+        INTEGER VCOLOR
+        LOGICAL HLINE
+        LOGICAL VLINE
+        LOGICAL SHRINKY
+	LOGICAL MOD_VS_X
+	LOGICAL MOD_VS_Y
+        INTEGER XDMS
+        INTEGER YDMS
+        REAL*4    XVALOFF
+        REAL*4    YVALOFF
+c
+* requires: INCLUDE 'PPLV11INC:AXIS.INC'                                    
diff --git a/ppl/tmap_inc/axisl_inc.decl b/ppl/tmap_inc/axisl_inc.decl
new file mode 100644
index 0000000..117885c
--- /dev/null
+++ b/ppl/tmap_inc/axisl_inc.decl
@@ -0,0 +1,4 @@
+* AXISL_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:AXISL.INC'                                   
diff --git a/ppl/tmap_inc/axlwid_inc.decl b/ppl/tmap_inc/axlwid_inc.decl
new file mode 100644
index 0000000..e00640f
--- /dev/null
+++ b/ppl/tmap_inc/axlwid_inc.decl
@@ -0,0 +1,6 @@
+* AXLWID_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	XWID
+	REAL*4	YWID
+* requires: INCLUDE 'PPLV11INC:AXLWID.INC'                                  
diff --git a/ppl/tmap_inc/bibo_dat.decl b/ppl/tmap_inc/bibo_dat.decl
new file mode 100644
index 0000000..8f72c69
--- /dev/null
+++ b/ppl/tmap_inc/bibo_dat.decl
@@ -0,0 +1,33 @@
+* BIBO_DAT.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+
+	INTEGER	NPTS
+	INTEGER	MIN
+	INTEGER	MAX
+	INTEGER	MEAN
+	REAL*4	PROJ
+	INTEGER	MOOR
+	INTEGER	INST
+	REAL*4	DTYPE
+	REAL*4	STIME
+	REAL*4	SRATE
+	REAL*4	SLAT
+	REAL*4	SLON
+	REAL*4	SDEP
+	INTEGER	INDEP
+	INTEGER	IADEP
+	REAL*4	FILT
+	REAL*4	CUTLO
+	REAL*4	CUTHI
+	REAL*4	WIND
+	REAL*4	SIG
+	REAL*4	HEAD
+	REAL*4	SCODE
+	REAL*4	PCODE
+	INTEGER	MODEN
+	REAL*4	SPTIME
+* requires: INCLUDE 'PPLV11INC:BIBO.DAT'     
diff --git a/ppl/tmap_inc/calendar.cmn b/ppl/tmap_inc/calendar.cmn
new file mode 100644
index 0000000..deb0325
--- /dev/null
+++ b/ppl/tmap_inc/calendar.cmn
@@ -0,0 +1,36 @@
+C 	calendar.cmn
+C
+C	Common variables used in multiple calendar support
+C	J Davison 10.99
+C	V 1.0
+C
+C	0.00000000000000000000000000000000000000000000000000000000000000001
+C *acm* 12/00  Split into calendar.cmn and calendar.decl
+C *acm* 1/ 01  add cals_days_before_month and cals_month_by_day
+
+	common / all_calendar_specs /
+     .                  max_calendars,
+     .			max_months,
+     .			max_days,
+     .			num_months, 
+     .                  num_days,
+     .			days_before_month,
+     .			month_by_day,
+     .			days_in_month,
+     .			month_names,
+
+     .			allowed_calendars,
+     .			gregorian,
+     .			noleap,
+     .			julian,
+     .			d360,
+     .			all_leap,
+     .                  cals_num_days,
+     .                  cals_yeardays,
+     .			cals_num_months,
+     .			cals_month_names,
+     .			cals_days_in_month,
+     .                  cals_days_before_month,
+     .                  cals_month_by_day,
+     .			calendar_id
+
diff --git a/ppl/tmap_inc/calendar.decl b/ppl/tmap_inc/calendar.decl
new file mode 100644
index 0000000..1845620
--- /dev/null
+++ b/ppl/tmap_inc/calendar.decl
@@ -0,0 +1,66 @@
+C 	calendar.decl
+C
+C *acm* 12/00  Split off from calendar.cmn
+C  * acm * declarations for individual calendar attributes.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+
+C	*******************************************************************
+C 	Parameters dimensioning calendar data structures
+C	*******************************************************************
+	integer		max_calendars, mxcals,
+     .			max_months, mxmnths,
+     .			max_days, mxdays,
+     .			calendar_id
+	parameter      (mxcals  = 5,
+     .			mxmnths = 12,
+     .			mxdays  = 366)
+
+C	*******************************************************************
+C	Information about each calendar
+C	*******************************************************************
+	integer		num_months, 
+     .                  num_days,
+     .			days_before_month(mxmnths),
+     .			month_by_day(mxdays),
+     .			days_in_month(mxmnths)
+
+	character*3	month_names(mxmnths)
+
+
+C	*******************************************************************
+C	Calendar names as recognized (NetCDF standards, plus a couple local ones)
+C	*******************************************************************
+	character*16	allowed_calendars(mxcals)
+	
+C	*******************************************************************
+C	Variables with specs for all calendars.  These define each calendar
+C	where month and year length are constant.  Exceptions as in the
+C	Gregorian calendar (in leap years) are handled in individual
+C	date/time subroutines: see these for that exception handling --
+C	
+C        fmt/src/tm_break_date.F
+C	 fmt/src/tm_secs_to_date.F
+C	 fmt/src/tm_secs_from_bc.F
+C	 ppl/plotlib/numdm1.F
+C	*******************************************************************
+	integer		cals_num_days(mxcals),
+     .			cals_num_months(mxcals),
+     .			cals_days_in_month(mxmnths,mxcals),
+     .			cals_days_before_month(mxmnths,mxcals),
+     .			cals_month_by_day(mxdays,mxcals)
+
+	REAL*4		cals_yeardays(mxcals)
+
+	character*3	cals_month_names(mxmnths,mxcals)
+
+C	*******************************************************************
+C	Integers below have calendar names, see calendar_blkdat.F
+C	for value assignments.  They are used as calendar indices.
+C	*******************************************************************
+	integer		gregorian
+        integer		noleap
+        integer		julian
+        integer		d360
+        integer		all_leap
diff --git a/ppl/tmap_inc/cdftn5_inc.decl b/ppl/tmap_inc/cdftn5_inc.decl
new file mode 100644
index 0000000..1035f08
--- /dev/null
+++ b/ppl/tmap_inc/cdftn5_inc.decl
@@ -0,0 +1,5 @@
+* CDFTN5_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	LN
+* requires: INCLUDE 'PPLV11INC:CDFTN5.INC'                                  
diff --git a/ppl/tmap_inc/ceftn5_inc.decl b/ppl/tmap_inc/ceftn5_inc.decl
new file mode 100644
index 0000000..ef30a8d
--- /dev/null
+++ b/ppl/tmap_inc/ceftn5_inc.decl
@@ -0,0 +1,4 @@
+* CEFTN5_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by J Davison 11/88
+* requires: INCLUDE 'PPLV11INC:CEFTN5.INC'                                  
diff --git a/ppl/tmap_inc/century.cmn b/ppl/tmap_inc/century.cmn
new file mode 100644
index 0000000..36b247b
--- /dev/null
+++ b/ppl/tmap_inc/century.cmn
@@ -0,0 +1,10 @@
+C 	century.cmn
+C
+C	Common variables used in modifications to time axis labeling 
+C
+C *acm*  3/10  Bug 670 fixed: New flag MULTICENFLAG for multi-decade plots, 
+C              do not make small tics by default.
+
+
+	LOGICAL*4 cenflag, monyrlab, multicenflag
+	COMMON/CENTURY/cenflag, monyrlab, multicenflag
diff --git a/ppl/tmap_inc/cmdcom_inc.decl b/ppl/tmap_inc/cmdcom_inc.decl
new file mode 100644
index 0000000..880286b
--- /dev/null
+++ b/ppl/tmap_inc/cmdcom_inc.decl
@@ -0,0 +1,6 @@
+* CMDCOM_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	INP,IBFDIM
+	INTEGER	MBUFF
+* requires: INCLUDE 'PPLV11INC:CMDCOM.INC'                                
diff --git a/ppl/tmap_inc/cmndlen.inc b/ppl/tmap_inc/cmndlen.inc
new file mode 100644
index 0000000..3a85417
--- /dev/null
+++ b/ppl/tmap_inc/cmndlen.inc
@@ -0,0 +1,13 @@
+c
+C** 
+C**    cmndlen.inc
+C**
+C** v5.8 *acm* 8/04 
+C**
+
+        INTEGER buflen 
+        PARAMETER (buflen=2048)
+c
+c	buflen	length of the command buffer
+
+c*******************************************************************
diff --git a/ppl/tmap_inc/cmrd_inc.decl b/ppl/tmap_inc/cmrd_inc.decl
new file mode 100644
index 0000000..fc79396
--- /dev/null
+++ b/ppl/tmap_inc/cmrd_inc.decl
@@ -0,0 +1,10 @@
+* CMRD_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	P
+	INTEGER	M
+	INTEGER	N
+	INTEGER	IFLG
+	INTEGER	ISLEN
+	INTEGER	LBSTRT
+* requires: INCLUDE 'PPLV11INC:CMRD.INC'                                    
diff --git a/ppl/tmap_inc/cmrdl_inc.decl b/ppl/tmap_inc/cmrdl_inc.decl
new file mode 100644
index 0000000..607d77f
--- /dev/null
+++ b/ppl/tmap_inc/cmrdl_inc.decl
@@ -0,0 +1,4 @@
+* CMRDL_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:CMRDL.INC'                                   
diff --git a/ppl/tmap_inc/cmstrt_inc.decl b/ppl/tmap_inc/cmstrt_inc.decl
new file mode 100644
index 0000000..8ad0b50
--- /dev/null
+++ b/ppl/tmap_inc/cmstrt_inc.decl
@@ -0,0 +1,4 @@
+* CMSTRT_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by J Davison 11/88
+* requires: INCLUDE 'PPLV11INC:CMSTRT.INC'                                  
diff --git a/ppl/tmap_inc/comdatf_inc.decl b/ppl/tmap_inc/comdatf_inc.decl
new file mode 100644
index 0000000..9fa680d
--- /dev/null
+++ b/ppl/tmap_inc/comdatf_inc.decl
@@ -0,0 +1,4 @@
+* COMDATF_INC.DECL - converted to Unix 2.26.91        
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:COMDATF.INC'                              
diff --git a/ppl/tmap_inc/comepl_inc.decl b/ppl/tmap_inc/comepl_inc.decl
new file mode 100644
index 0000000..d4df5d1
--- /dev/null
+++ b/ppl/tmap_inc/comepl_inc.decl
@@ -0,0 +1,4 @@
+* COMEPL_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:COMEPL.INC'                                  
diff --git a/ppl/tmap_inc/comeps_inc.decl b/ppl/tmap_inc/comeps_inc.decl
new file mode 100644
index 0000000..9735d27
--- /dev/null
+++ b/ppl/tmap_inc/comeps_inc.decl
@@ -0,0 +1,4 @@
+* COMEPS_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:COMEPS.INC'                               
diff --git a/ppl/tmap_inc/comepv_inc.decl b/ppl/tmap_inc/comepv_inc.decl
new file mode 100644
index 0000000..3d9ed4e
--- /dev/null
+++ b/ppl/tmap_inc/comepv_inc.decl
@@ -0,0 +1,7 @@
+* COMEPV_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	IEPV1
+	INTEGER	IEPV2
+	INTEGER	IEFLG
+* requires: INCLUDE 'PPLV11INC:COMEPV.INC'                               
diff --git a/ppl/tmap_inc/comthdr_inc.decl b/ppl/tmap_inc/comthdr_inc.decl
new file mode 100644
index 0000000..cc089f2
--- /dev/null
+++ b/ppl/tmap_inc/comthdr_inc.decl
@@ -0,0 +1,4 @@
+* COMTHDR_INC.DECL - converted to Unix 2.26.91        
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:COMTHDR.INC'                              
diff --git a/ppl/tmap_inc/comvar_inc.decl b/ppl/tmap_inc/comvar_inc.decl
new file mode 100644
index 0000000..39933af
--- /dev/null
+++ b/ppl/tmap_inc/comvar_inc.decl
@@ -0,0 +1,5 @@
+* COMVAR_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	NVARS
+* requires: INCLUDE 'PPLV11INC:COMVAR.INC'                               
diff --git a/ppl/tmap_inc/conlab_inc.decl b/ppl/tmap_inc/conlab_inc.decl
new file mode 100644
index 0000000..1a4780c
--- /dev/null
+++ b/ppl/tmap_inc/conlab_inc.decl
@@ -0,0 +1,4 @@
+* CONLAB_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:CONLAB.INC'                                  
diff --git a/ppl/tmap_inc/cont_inc.decl b/ppl/tmap_inc/cont_inc.decl
new file mode 100644
index 0000000..f27cfa8
--- /dev/null
+++ b/ppl/tmap_inc/cont_inc.decl
@@ -0,0 +1,40 @@
+* CONT_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+c  v581 *acm* 3/05 add flags for use of open levels (-INF) (INF)
+*  V610 *acm* 3/08 - add new MODE NLEVELS
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V65 *acm   2/10 If Open-ended levels were used, symbol LEV_OPNLEVS saves 
+* the /LEV command needed to duplicate the levels
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+* v683 *acm*	9/12 ribbon plots: RIBBON_FAST flag for style of ribbon plots
+
+	REAL*4	ZLEV,CANGLE
+	INTEGER	LDIG,IVCOMP
+	INTEGER	LWGT
+	INTEGER	LCLR
+	INTEGER	NLEV
+	INTEGER	NLEV_DFLT
+	REAL*4	HGT
+	INTEGER	NARC
+	INTEGER	IAUTOC
+	INTEGER	NLEV2
+	INTEGER	NSIGC
+	INTEGER CONTOUR_FEWER
+	
+*	Following added 8.3.95 *jd*
+	LOGICAL*4 CENTERED,SET_DELTA,NEGINF,POSINF,CONT_KEY
+	REAL*4	DELTA
+
+* For open-ended color/contour levels
+	CHARACTER*120 lev_str
+	LOGICAL OPENLEV,SET_STD,SET_MEAN,SET_MIN,SET_MAX,NEED_DATA_SCAN,
+     .          USE_HIST
+	REAL*4	LEV_STD,LEV_MEAN,LEV_MIN,LEV_MAX,LEV_HIST
+
+* For ribbon-plots: line plots colored-by a variable
+	LOGICAL RIBBON_FAST
+* requires: INCLUDE 'CONT.INC'                                    
+
diff --git a/ppl/tmap_inc/cpftn5_inc.decl b/ppl/tmap_inc/cpftn5_inc.decl
new file mode 100644
index 0000000..93f3c5e
--- /dev/null
+++ b/ppl/tmap_inc/cpftn5_inc.decl
@@ -0,0 +1,4 @@
+* CPFTN5_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by J Davison 11/88
+* requires: INCLUDE 'PPLV11INC:CPFTN5.INC'                                  
diff --git a/ppl/tmap_inc/dashzz_inc.decl b/ppl/tmap_inc/dashzz_inc.decl
new file mode 100644
index 0000000..b03c11a
--- /dev/null
+++ b/ppl/tmap_inc/dashzz_inc.decl
@@ -0,0 +1,7 @@
+* DASHZZ_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	DASHLN
+	REAL*4	SPACLN
+	REAL*4	DSLAB
+* requires: INCLUDE 'PPLV11INC:DASHZZ.INC'                                  
diff --git a/ppl/tmap_inc/data_inc.decl b/ppl/tmap_inc/data_inc.decl
new file mode 100644
index 0000000..788373d
--- /dev/null
+++ b/ppl/tmap_inc/data_inc.decl
@@ -0,0 +1,16 @@
+* DATA_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+	INTEGER	ITYPEZ
+	INTEGER	JX
+	INTEGER	JY
+	INTEGER	JZ
+	INTEGER	LUNN
+	INTEGER	LINEN
+	INTEGER	NREC
+	INTEGER	NVAR
+	INTEGER	NGRP
+	REAL*4	CAY
+	INTEGER	NRNG
+* requires: INCLUDE 'PPLV11INC:DATA.INC'                                    
diff --git a/ppl/tmap_inc/dsfcom_dat.decl b/ppl/tmap_inc/dsfcom_dat.decl
new file mode 100644
index 0000000..a5239d3
--- /dev/null
+++ b/ppl/tmap_inc/dsfcom_dat.decl
@@ -0,0 +1,16 @@
+* DSFCOM_DAT.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	INXT
+	INTEGER	IBKWD
+	INTEGER	IKEY
+	REAL*4	BUF
+	INTEGER	IFRWD
+	INTEGER	IRW
+	INTEGER	LUN
+	INTEGER	IHD
+	INTEGER	IBP
+	REAL*4	DMIN
+	REAL*4	DMAX
+	REAL*4	DMEAN
+* requires: INCLUDE 'PPLV11INC:DSFCOM.DAT'  
diff --git a/ppl/tmap_inc/dsfsve_inc.decl b/ppl/tmap_inc/dsfsve_inc.decl
new file mode 100644
index 0000000..09bf38b
--- /dev/null
+++ b/ppl/tmap_inc/dsfsve_inc.decl
@@ -0,0 +1,6 @@
+* DSFSVE_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	INXT,IKEY
+	INTEGER	IBKWD
+* requires: INCLUDE 'PPLV11INC:DSFSVE.INC'                                  
diff --git a/ppl/tmap_inc/echo_dat.decl b/ppl/tmap_inc/echo_dat.decl
new file mode 100644
index 0000000..8da8730
--- /dev/null
+++ b/ppl/tmap_inc/echo_dat.decl
@@ -0,0 +1,4 @@
+* ECHO_DAT.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PMEL:[PLOT5.LIBRARY.PLOT]ECHO.DAT'                                    
diff --git a/ppl/tmap_inc/epiclun_inc.decl b/ppl/tmap_inc/epiclun_inc.decl
new file mode 100644
index 0000000..49ee218
--- /dev/null
+++ b/ppl/tmap_inc/epiclun_inc.decl
@@ -0,0 +1,7 @@
+* EPICLUN_INC.DECL - converted to Unix 2.26.91        
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	LUN1
+	INTEGER	LUN11
+	INTEGER	LUN21
+* requires: INCLUDE 'PPLV11INC:EPICLUN.INC'                                 
diff --git a/ppl/tmap_inc/filnam_inc.decl b/ppl/tmap_inc/filnam_inc.decl
new file mode 100644
index 0000000..8e6b7ec
--- /dev/null
+++ b/ppl/tmap_inc/filnam_inc.decl
@@ -0,0 +1,4 @@
+* FILNAM_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:FILNAM.INC'                                  
diff --git a/ppl/tmap_inc/gkscm1_inc.decl b/ppl/tmap_inc/gkscm1_inc.decl
new file mode 100644
index 0000000..5586915
--- /dev/null
+++ b/ppl/tmap_inc/gkscm1_inc.decl
@@ -0,0 +1,4 @@
+* GKSCM1_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:GKSCM1.INC'                                  
diff --git a/ppl/tmap_inc/gkscm2.cmn b/ppl/tmap_inc/gkscm2.cmn
new file mode 100644
index 0000000..746c4b3
--- /dev/null
+++ b/ppl/tmap_inc/gkscm2.cmn
@@ -0,0 +1,35 @@
+*       GKSCM2.INC
+
+*       Common block used to provide information for GKS metafiles
+*       J Davison JISAO/PMEL/TMAP
+*  Ferret v5.80  New variables pixx and pixy to save the size of the 
+*                window in pixels.  Needed for PPL$XPIXEL, PPL$YPIXEL 
+*                when in gif or batch mode.
+* v6.8 Increase meta_file string to 2048, matching other filename strings.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+
+        integer        ws_lun,tmp_wsid
+        integer        tmp_lun
+        integer        item_gclrwk,item_ws_xform,item_pplpver
+        integer        item_ndx_range,item_spectrum,item_protect
+        integer        item_fill_ndx
+        integer        lbtype,lbcolor
+        integer        pixx,pixy
+
+        real*4         lbwidth,spline_tension
+
+        logical        gks_open, vpt_was_set
+        logical        draftsman, save_on_exit, imgname_sent
+
+        character*2048 meta_file
+        character*24   ws_file,tmp_file
+
+      common /gkscm2/ meta_file,gks_open,ws_lun,ws_file,item_gclrwk,
+     .                item_ws_xform,tmp_wsid,tmp_lun,tmp_file,
+     .                lbtype,lbwidth,lbcolor,pixx,pixy,vpt_was_set,
+     .                item_ndx_range,item_spectrum,item_protect,
+     .                item_fill_ndx,item_pplpver,draftsman,
+     .                save_on_exit,imgname_sent,spline_tension
+
diff --git a/ppl/tmap_inc/gkspar.inc b/ppl/tmap_inc/gkspar.inc
new file mode 100644
index 0000000..7d2bd9e
--- /dev/null
+++ b/ppl/tmap_inc/gkspar.inc
@@ -0,0 +1,445 @@
+C***********************************************************************
+C***********************************************************************
+C***********************************************************************
+C*		Copyright IBM Corporation 1989
+C*
+C*                      All Rights Reserved
+C*
+C* Permission to use, copy, modify, and distribute this software and its
+C* documentation for any purpose and without fee is hereby granted,
+C* provided that the above copyright notice appear in all copies and that
+C* both that copyright notice and this permission notice appear in
+C* supporting documentation, and that the name of IBM not be
+C* used in advertising or publicity pertaining to distribution of the
+C* software without specific, written prior permission.
+C*
+C* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+C* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+C* IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+C* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+C* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+C* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+C* SOFTWARE.
+C*
+C*****                                                             *****
+C*****   Product:     graPHIGS GKS-CO Demonstration Program        *****
+C*****                                                             *****
+C*****   File Name:   gkspar.inc                                   *****
+C*****                                                             *****
+C*****   Descriptive Name: This file contains mnemonic FORTRAN     *****
+C*****                     names and their values for GKS          *****
+C*****                     enumeration types. Each enumeration     *****
+C*****                     type is a variable initialized          *****
+C*****                     through a parameter statement. The      *****
+C*****                     last two sections (font types and       *****
+C*****                     color table indexes) are not standard   *****
+C*****                     GKS FORTRAN enumerations, but were      *****
+C*****                     added specifically for use by the       *****
+C*****                     GKSDEMO program.                        *****
+C*****                                                             *****
+C***********************************************************************
+C***********************************************************************
+C***********************************************************************
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Aspect Source Flag: Bundled, Individual                   *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GBUNDL,GINDIV
+      PARAMETER     (GBUNDL = 0, GINDIV = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Attribute Control Flag: Current, Specified                *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GCURNT,GSPEC
+      PARAMETER     (GCURNT = 0, GSPEC = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Clear Control Flag: Conditionally, Always                 *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GCONDI,GALWAY
+      PARAMETER     (GCONDI = 0, GALWAY = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Clipping Indicator: No Clip, Clip                         *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNCLIP,GCLIP
+      PARAMETER     (GNCLIP = 0, GCLIP = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Color Available: Monochrome, Color                        *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GMONOC,GCOLOR
+      PARAMETER     (GMONOC = 0, GCOLOR = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Coordinate Switch: WC,NDC                                 *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GWC,GNDC
+      PARAMETER     (GWC = 0, GNDC = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Deferral Mode: ASAP, BNIG, BNIL, ASTI                     *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GASAP,GBNIG,GBNIL,GASTI
+      PARAMETER     (GASAP = 0, GBNIG = 1, GBNIL = 2, GASTI = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Detectability: Undetectable, Detectable                   *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GUNDET,GDETEC
+      PARAMETER     (GUNDET = 0, GDETEC = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Device Coordinate Units: Meters, Other                    *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GMETRE,GOTHU
+      PARAMETER     (GMETRE = 0, GOTHU = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Displace Surface Empty: Not Empty, Empty                  *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNEMPT,GEMPTY
+      PARAMETER     (GNEMPT = 0, GEMPTY = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Dynamic Modification: Implicit Regeneration, Immediate    *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GIRG,GIMM
+      PARAMETER     (GIRG = 0, GIMM = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Echo Switch: No Echo, Echo                                *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNECHO,GECHO
+      PARAMETER     (GNECHO = 0, GECHO = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Fill Area Interior Style: Hollow, Solid, Pattern, Hatch   *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GHOLLO,GSOLID,GPATTR,GHATCH
+      PARAMETER     (GHOLLO = 0, GSOLID = 1, GPATTR = 2, GHATCH = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   GDP Attributes: Polyline, Polymarker, Text, Fill Area     *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GPLATT, GPMATT, GTXATT, GFAATT
+      PARAMETER     (GPLATT = 0, GPMATT = 1, GTXATT = 2, GFAATT = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Highlighting: Normal, Highlighted                         *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNORML,GHILIT
+      PARAMETER     (GNORML = 0, GHILIT = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Initial Choice Prompt Flag: Off, On                       *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GPROFF,GPRON
+      PARAMETER     (GPROFF = 0, GPRON = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Input Device Status: None, OK, No Pick or No Choice       *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNONE, GOK, GNPICK, GNCHOI
+      PARAMETER     (GNONE = 0, GOK = 1, GNPICK = 2, GNCHOI = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Input Class: None, Locator, Stroke, Valuator, Choice,     *****
+C*****                Pick, String                                 *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNCLAS,GLOCAT,GSTROK,GVALUA,GCHOIC,GPICK,GSTRIN
+      PARAMETER     (GNCLAS = 0, GLOCAT = 1, GSTROK = 2, GVALUA = 3)
+      PARAMETER     (GCHOIC = 4, GPICK = 5, GSTRIN = 6)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Implicit Regeneration Mode: Suppressed, Allowed           *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GSUPPD,GALLOW
+      PARAMETER     (GSUPPD = 0, GALLOW = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Level of GKS: 0a, 0b, 0c, 1a, 1b, 1c, 2a, 2b, 2c          *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GL0A,GL0B,GL0C,GL1A,GL1B,GL1C,GL2A,GL2B,GL2C
+      PARAMETER     (GL0A = 0, GL0B = 1, GL0C = 2, GL1A = 3, GL1B = 4)
+      PARAMETER     (GL1C = 5, GL2A = 6, GL2B = 7, GL2C = 8)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Line Type: Solid, Dash, Dot, Dash-Dot                     *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GLSOLI,GLDASH,GLDOT,GLDASD
+      PARAMETER     (GLSOLI = 1, GLDASH = 2, GLDOT = 3, GLDASD = 4)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Marker Type: Period, Plus, Asterisk, Circle, Cross        *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GPOINT,GPLUS,GAST,GOMARK,GXMARK
+      PARAMETER     (GPOINT = 1, GPLUS = 2, GAST = 3, GOMARK = 4)
+      PARAMETER     (GXMARK = 5)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   New Frame Action Necessary: No, Yes                       *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNO,GYES
+      PARAMETER     (GNO = 0, GYES = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Operating Mode: Request, Sample, Event                    *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GREQU,GSAMPL,GEVENT
+      PARAMETER     (GREQU = 0, GSAMPL = 1, GEVENT = 2)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Operating State Value: GKCL, GKOP, WSOP, WSAC, SGOP       *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GGKCL,GGKOP,GWSOP,GWSAC,GSGOP
+      PARAMETER     (GGKCL = 0, GGKOP = 1, GWSOP = 2, GWSAC = 3)
+      PARAMETER     (GSGOP = 4)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Polyline/Fill Area Control Flag: Polyline, Fill Area      *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GPLINE,GFILLA
+      PARAMETER     (GPLINE = 0, GFILLA = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Presence of Invalid Values: Absent, Present               *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GABSNT,GPRSNT
+      PARAMETER     (GABSNT = 0, GPRSNT = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Regeneration Flag: Postpone, Perform                      *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GPOSTP,GPERFO
+      PARAMETER     (GPOSTP = 0, GPERFO = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Relative Input Priority: Higher, Lower                    *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GHIGHR,GLOWER
+      PARAMETER     (GHIGHR = 0, GLOWER = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Simultaneous Events Flag: No More, More                   *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNMORE, GMORE
+      PARAMETER     (GNMORE = 0, GMORE = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Text Alignment Horizontal                                 *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GAHNOR,GALEFT,GACENT,GARITE
+      PARAMETER     (GAHNOR = 0, GALEFT = 1, GACENT = 2, GARITE = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Text Alignment Vertical: Normal, Top, Cap, Half, Base,    *****
+C*****                            Bottom                           *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GAVNOR,GATOP,GACAP,GAHALF,GABASE,GABOTT
+      PARAMETER     (GAVNOR = 0, GATOP = 1, GACAP = 2, GAHALF =3)
+      PARAMETER     (GABASE = 4, GABOTT = 5)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Text Path: Right, Left, Up, Down                          *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GRIGHT, GLEFT, GUP, GDOWN
+      PARAMETER     (GRIGHT = 0, GLEFT = 1, GUP = 2, GDOWN = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Text Precision: String, Character, Stroke                 *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GSTRP,GCHARP,GSTRKP
+      PARAMETER     (GSTRP = 0, GCHARP = 1, GSTRKP = 2)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Type of Returned Value: Set, Realized                     *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GSET,GREALI
+      PARAMETER     (GSET = 0, GREALI = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Update State: Not Pending, Pending                        *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GNPEND,GPEND
+      PARAMETER     (GNPEND = 0, GPEND = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Vector / Rastor / Other Type of Display                   *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GVECTR,GRASTR,GOTHWK
+      PARAMETER     (GVECTR = 0, GRASTR = 1, GOTHWK = 2)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Visibility: Visible, Invisible                            *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GINVIS,GVISI
+      PARAMETER     (GINVIS = 0, GVISI = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Workstation Category: Output, Input, Input/Output,        *****
+C*****                         WISS, Metafile Output, Metafile     *****
+C*****                         Input                               *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GOUTPT,GINPUT,GOUTIN,GWISS,GMO,GMI
+      PARAMETER     (GOUTPT = 0, GINPUT = 1, GOUTIN = 2, GWISS = 3)
+      PARAMETER     (GMO = 4, GMI = 5)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Workstation State: Inactive, Active                       *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GINACT, GACTIV
+      PARAMETER     (GINACT = 0, GACTIV = 1)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Font Type:  Font 1, Font 2, Font 3                        *****
+C*****                                                             *****
+C*****     Note: This is not a standard GKS enumeration - it       *****
+C*****           was added to the standard list specifically       *****
+C*****           for use by the GKSDEMO program example.           *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GFONT1,GFONT2,GFONT3
+      PARAMETER     (GFONT1 = 1, GFONT2 = 2, GFONT3 = 3)
+ 
+C***********************************************************************
+C*****                                                             *****
+C*****   Color Table Indexes as Set by GKSDEMO Program             *****
+C*****                                                             *****
+C*****     Note: This is not a standard GKS enumeration - it       *****
+C*****           was added to the standard list specifically       *****
+C*****           for use by the GKSDEMO program example.           *****
+C*****                                                             *****
+C***********************************************************************
+ 
+      INTEGER*4     GBLACK,GRED,GGREEN,GBLUE,GYELOW,GORNGE,GMAGNT
+      INTEGER*4     GLMGNT,GLBLUE,GLTURQ,GGRAYB,GLGREN,GMGREN
+      INTEGER*4     GMRED,GGRAY,GWHITE
+      PARAMETER     (GBLACK = 0, GRED = 1, GGREEN = 2, GBLUE = 3)
+      PARAMETER     (GYELOW = 4, GORNGE = 5, GMAGNT = 6)
+      PARAMETER     (GLMGNT = 7, GLBLUE = 8, GLTURQ = 9)
+      PARAMETER     (GGRAYB = 10, GLGREN = 11, GMGREN = 12)
+      PARAMETER     (GMRED = 13, GGRAY = 14, GWHITE = 15)
+ 
diff --git a/ppl/tmap_inc/hab_inc.decl b/ppl/tmap_inc/hab_inc.decl
new file mode 100644
index 0000000..182d6d5
--- /dev/null
+++ b/ppl/tmap_inc/hab_inc.decl
@@ -0,0 +1,7 @@
+* HAB_INC.DECL - converted to Unix 2.26.91            
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	IPLOT
+	INTEGER	IPAUSE
+	INTEGER	IHDCPY
+* requires: INCLUDE 'PPLV11INC:HAB.INC'                                     
diff --git a/ppl/tmap_inc/hd_inc.decl b/ppl/tmap_inc/hd_inc.decl
new file mode 100644
index 0000000..df6483e
--- /dev/null
+++ b/ppl/tmap_inc/hd_inc.decl
@@ -0,0 +1,21 @@
+* HD_INC.DECL - converted to Unix 2.26.91             
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+
+	REAL*4	XPTS
+	REAL*4	ZMIN
+	REAL*4	ZMAX
+	REAL*4	ZMEAN
+	REAL*4	ZSTD
+	REAL*4	XMIN
+	REAL*4	XMAX
+	INTEGER	NX
+	REAL*4	YMIN
+	REAL*4	YMAX
+	INTEGER	NY
+	INTEGER	JTYPE
+	INTEGER	NCH
+	INTEGER	NCHX
+	INTEGER	NCHY
+* requires: INCLUDE 'HD.INC'                                      
diff --git a/ppl/tmap_inc/labcom_inc.decl b/ppl/tmap_inc/labcom_inc.decl
new file mode 100644
index 0000000..9742825
--- /dev/null
+++ b/ppl/tmap_inc/labcom_inc.decl
@@ -0,0 +1,12 @@
+* LABCOM_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	HLAB1
+	REAL*4	HXLAB
+	REAL*4	HYLAB
+	REAL*4	HLABS
+	INTEGER	ICOUNT
+	INTEGER	NLAB
+	INTEGER	ICROSS
+	INTEGER	IGTLAB
+* requires: INCLUDE 'PPLV11INC:LABCOM.INC'                                  
diff --git a/ppl/tmap_inc/labels_inc.decl b/ppl/tmap_inc/labels_inc.decl
new file mode 100644
index 0000000..c860256
--- /dev/null
+++ b/ppl/tmap_inc/labels_inc.decl
@@ -0,0 +1,4 @@
+* LABELS_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:LABELS.INC'                                  
diff --git a/ppl/tmap_inc/lines_inc.decl b/ppl/tmap_inc/lines_inc.decl
new file mode 100644
index 0000000..6a08372
--- /dev/null
+++ b/ppl/tmap_inc/lines_inc.decl
@@ -0,0 +1,21 @@
+* LINES_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+	INTEGER	IMARK
+	REAL*4	HMARK
+	INTEGER	ITYPE
+	REAL*4	XOFF
+	REAL*4	YOFF
+	REAL*4	XFCT
+	REAL*4	YFCT
+	REAL*4	DN1
+	REAL*4	UP1
+	REAL*4	DN2
+	REAL*4	UP2
+	INTEGER	LLENG
+	INTEGER	LNUM
+	INTEGER	IWIND
+* requires: INCLUDE 'PPLV11INC:LINES.INC'                                   
diff --git a/ppl/tmap_inc/lunits_inc.decl b/ppl/tmap_inc/lunits_inc.decl
new file mode 100644
index 0000000..015bf97
--- /dev/null
+++ b/ppl/tmap_inc/lunits_inc.decl
@@ -0,0 +1,8 @@
+* LUNITS_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* v6.06 ACM add lerror; unit number for std error
+	INTEGER	LTTOUT
+	INTEGER	LMULT
+	INTEGER	LERROR
+* requires: INCLUDE 'PPLV11INC:LUNITS.INC'                                  
diff --git a/ppl/tmap_inc/makedot.cmn b/ppl/tmap_inc/makedot.cmn
new file mode 100644
index 0000000..3e0df94
--- /dev/null
+++ b/ppl/tmap_inc/makedot.cmn
@@ -0,0 +1,11 @@
+C   Common block for makedot GKS polymarker routines: gkplt_makedot, and plotxy
+C   (lines of code from gkplt_makedot; keep in common so X and Y are buffers)
+C   ACM 10/17/01
+
+*	*jd* 1.9.90  Max was 10,000
+	integer	maxdot, ipt
+	parameter (maxdot=10000)
+    
+	REAL*4 xdot(maxdot),ydot(maxdot)
+        COMMON/MAKEDOT_CMN/ipt, xdot, ydot
+
diff --git a/ppl/tmap_inc/miss_inc.decl b/ppl/tmap_inc/miss_inc.decl
new file mode 100644
index 0000000..23b2409
--- /dev/null
+++ b/ppl/tmap_inc/miss_inc.decl
@@ -0,0 +1,13 @@
+* MISS_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	CMXLE
+	REAL*4	CMXEQ
+	REAL*4	CMXGE
+	REAL*4	CMYLE
+	REAL*4	CMYEQ
+	REAL*4	CMYGE
+	REAL*4	CMZLE
+	REAL*4	CMZEQ
+	REAL*4	CMZGE
+* requires: INCLUDE 'PPLV11INC:MISS.INC'                                    
diff --git a/ppl/tmap_inc/mplot_inc.decl b/ppl/tmap_inc/mplot_inc.decl
new file mode 100644
index 0000000..67a6e29
--- /dev/null
+++ b/ppl/tmap_inc/mplot_inc.decl
@@ -0,0 +1,18 @@
+* MPLOT_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	MNX
+	INTEGER	MNY
+	INTEGER	IMULT
+	INTEGER	IMCNT
+	REAL*4	DXM
+	REAL*4	DYM
+	REAL*4	XLENM
+	REAL*4	YLENM
+	INTEGER	IXM
+	INTEGER	IYM
+	INTEGER	MXBOT
+	INTEGER	MYLEF
+	REAL*4	HTM
+	REAL*4	WDM
+* requires: INCLUDE 'PPLV11INC:MPLOT.INC'                                   
diff --git a/ppl/tmap_inc/mplots_inc.decl b/ppl/tmap_inc/mplots_inc.decl
new file mode 100644
index 0000000..7fad104
--- /dev/null
+++ b/ppl/tmap_inc/mplots_inc.decl
@@ -0,0 +1,4 @@
+* MPLOTS_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:MPLOTS.INC'                                  
diff --git a/ppl/tmap_inc/mplotx_inc.decl b/ppl/tmap_inc/mplotx_inc.decl
new file mode 100644
index 0000000..8771b94
--- /dev/null
+++ b/ppl/tmap_inc/mplotx_inc.decl
@@ -0,0 +1,10 @@
+* MPLOTX_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	XORGT
+	REAL*4	YORGT
+	REAL*4	XLENT
+	REAL*4	YLENT
+	INTEGER	LABXT
+	INTEGER	LABYT
+* requires: INCLUDE 'PPLV11INC:MPLOTX.INC'                                  
diff --git a/ppl/tmap_inc/parampl5_dat.decl b/ppl/tmap_inc/parampl5_dat.decl
new file mode 100644
index 0000000..738f7e5
--- /dev/null
+++ b/ppl/tmap_inc/parampl5_dat.decl
@@ -0,0 +1,13 @@
+* PARAMPL5_DAT.DECL - converted to Unix 2.26.91       
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+
+* V510: *sh* 3/00 -- added NPOLYGON
+
+	INTEGER IDSFRM
+	INTEGER	ICNLEV
+	INTEGER	NMIPTS
+	INTEGER	NLINES
+	INTEGER	NPOLYGON
+	INTEGER	NLABS
+* requires: INCLUDE 'PPLV11INC:PARAMPL5.DAT'       
diff --git a/ppl/tmap_inc/pen_inc.decl b/ppl/tmap_inc/pen_inc.decl
new file mode 100644
index 0000000..b600c55
--- /dev/null
+++ b/ppl/tmap_inc/pen_inc.decl
@@ -0,0 +1,9 @@
+* PEN_INC.DECL - converted to Unix 2.26.91            
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V600 *acm* 5/06  num_line_colors for MODE LINECOLORS
+
+	INTEGER	IPEN
+	INTEGER	IP
+        INTEGER num_line_colors
+* requires: INCLUDE 'PPLV11INC:PEN.INC'                                     
diff --git a/ppl/tmap_inc/plt_inc.decl b/ppl/tmap_inc/plt_inc.decl
new file mode 100644
index 0000000..00ec74a
--- /dev/null
+++ b/ppl/tmap_inc/plt_inc.decl
@@ -0,0 +1,12 @@
+* PLT_INC.DECL - converted to Unix 2.26.91            
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+	INTEGER	ICODE
+	REAL*4	WIDTH
+	REAL*4	HEIGHT
+	INTEGER	MOD
+	INTEGER	IR
+	INTEGER	LUN
+* requires: INCLUDE 'PPLV11INC:PLT.INC'                                     
diff --git a/ppl/tmap_inc/pltcom_dat.decl b/ppl/tmap_inc/pltcom_dat.decl
new file mode 100644
index 0000000..2d1a364
--- /dev/null
+++ b/ppl/tmap_inc/pltcom_dat.decl
@@ -0,0 +1,80 @@
+* PLTCOM_DAT.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+
+	REAL*4	A
+	REAL*4	AMAX
+	REAL*4	AMIN
+	REAL*4	ANEW
+	REAL*4	AOLD
+	REAL*4	AORIGN
+	REAL*4	AOSOLD
+	REAL*4	AREF
+	REAL*4	ASIZE
+	REAL*4	B
+	REAL*4	BMAX
+	REAL*4	BMIN
+	REAL*4	BNEW
+	REAL*4	BOLD
+	REAL*4	BORIGN
+	REAL*4	BOSOLD
+	REAL*4	BREF
+	REAL*4	BSIZE
+	REAL*4	COLD
+	REAL*4	CREF
+	REAL*4	DSEG
+	REAL*4	FACTOR
+	REAL*4	HMARK
+	REAL*4	HPSCLA
+	REAL*4	HPSCLB
+	INTEGER	IDSEG
+	INTEGER	IDTK
+	INTEGER	IPRIM
+	INTEGER	ISEQ
+	INTEGER	LHIA
+	INTEGER	LHIB
+	INTEGER	LLOBA
+	INTEGER	LOSFLG
+	INTEGER	LOWFLG
+	INTEGER	LUHP,LUSY
+	INTEGER	LUTK
+	REAL*4	OLDHPA
+	REAL*4	OLDHPB
+	REAL*4	PLTOHA
+	REAL*4	PLTOHB
+	REAL*4	PLTOTA
+	REAL*4	PLTOTB
+	REAL*4	SEG
+	REAL*4	TAX
+	REAL*4	TAY
+	REAL*4	TAZ
+	REAL*4	TBX
+	REAL*4	TBY
+	REAL*4	TBZ
+	REAL*4	TCX
+	REAL*4	TCY
+	REAL*4	TCZ
+	REAL*4	THIGHT
+	REAL*4	TSCLA
+	REAL*4	TSCLB
+	REAL*4	TWIDTH
+	REAL*4	XMAX
+	REAL*4	XMIN
+	REAL*4	XNEW
+	REAL*4	XOLD
+	REAL*4	XSCALE
+	REAL*4	XTEMP
+	REAL*4	YMAX
+	REAL*4	YMIN
+	REAL*4	YNEW
+	REAL*4	YOLD
+	REAL*4	YSCALE
+	REAL*4	YTEMP
+	REAL*4	ZNEW
+	REAL*4	ZOLD
+	REAL*4	ZSCALE
+	REAL*4	ZTEMP
+* requires: INCLUDE 'PPLV11INC:PLTCOM.DAT'      
diff --git a/ppl/tmap_inc/pltdat_dat.decl b/ppl/tmap_inc/pltdat_dat.decl
new file mode 100644
index 0000000..63c1f66
--- /dev/null
+++ b/ppl/tmap_inc/pltdat_dat.decl
@@ -0,0 +1,4 @@
+* PLTDAT_DAT.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PMEL:[PLOT5.LIBRARY.COMPLOT]PLTDAT.DAT'                               
diff --git a/ppl/tmap_inc/pltl_inc.decl b/ppl/tmap_inc/pltl_inc.decl
new file mode 100644
index 0000000..78a690c
--- /dev/null
+++ b/ppl/tmap_inc/pltl_inc.decl
@@ -0,0 +1,4 @@
+* PLTL_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:PLTL.INC'                                    
diff --git a/ppl/tmap_inc/ppl_in_ferret.cmn b/ppl/tmap_inc/ppl_in_ferret.cmn
new file mode 100644
index 0000000..74636dc
--- /dev/null
+++ b/ppl/tmap_inc/ppl_in_ferret.cmn
@@ -0,0 +1,5 @@
+* COMMON flag loaded by data statement to determine if PPLUS is running under
+* the control of FERRET (esp. re: window and viewport sizing)
+
+	COMMON / XPPL_IN_FERRET / PPL_in_FERRET, PPL_viewports_active
+	LOGICAL PPL_in_FERRET, PPL_viewports_active
diff --git a/ppl/tmap_inc/ppl_inc.decl b/ppl/tmap_inc/ppl_inc.decl
new file mode 100644
index 0000000..7a4620d
--- /dev/null
+++ b/ppl/tmap_inc/ppl_inc.decl
@@ -0,0 +1,6 @@
+* PPL_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by J Davison 11/88
+kkk - deliberate syntax error - this file is untested (though probably ok)*sh*
+kkk - check for undeclared variables ...
+* requires: INCLUDE 'PPLV11INC:PPL.INC'                                  
diff --git a/ppl/tmap_inc/pplcmd_strings.cmn b/ppl/tmap_inc/pplcmd_strings.cmn
new file mode 100644
index 0000000..ea4c0d2
--- /dev/null
+++ b/ppl/tmap_inc/pplcmd_strings.cmn
@@ -0,0 +1,10 @@
+*	pass char variables from pplcmd.F through to pplcmd_f.F,
+*       bypassing pplcmd_c.c
+*  v5.33 acm 9/01
+*  v5.51+acm 3/03 Longer strings: changes for multi-line labels.
+
+
+      CHARACTER*1 PPLFROMI, PPLLINEI
+      CHARACTER*2048 PPLCOMBUF(5)
+
+      COMMON/PPLSTRINGS/ PPLFROMI, PPLLINEI, PPLCOMBUF
diff --git a/ppl/tmap_inc/pplp_ver_date.cmn b/ppl/tmap_inc/pplp_ver_date.cmn
new file mode 100644
index 0000000..d62bd37
--- /dev/null
+++ b/ppl/tmap_inc/pplp_ver_date.cmn
@@ -0,0 +1,8 @@
+*	pplp_ver_date.cmn
+*	J Davison 2.24.93
+
+	character*5	  pplp_ver
+	character*8	  pplp_make_date
+	common/pplp_rev/  pplp_ver,pplp_make_date
+
+
diff --git a/ppl/tmap_inc/prmcom_inc.decl b/ppl/tmap_inc/prmcom_inc.decl
new file mode 100644
index 0000000..b7f6665
--- /dev/null
+++ b/ppl/tmap_inc/prmcom_inc.decl
@@ -0,0 +1,4 @@
+* PRMCOM_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:PRMCOM.INC'                                  
diff --git a/ppl/tmap_inc/save_colors.cmn b/ppl/tmap_inc/save_colors.cmn
new file mode 100644
index 0000000..240ff36
--- /dev/null
+++ b/ppl/tmap_inc/save_colors.cmn
@@ -0,0 +1,17 @@
+*	SAVE_COLORS.INC
+
+*	Common block used to provide information for saving set line colors
+*       in batch mode.
+*	Ansley Manke PMEL/TMAP
+*	requires PARAMPL5.DAT with NLINES
+*  Ferret v6.16  1/2009
+*  PyFr *kms* 5/13 Added alpha channel (opaque)
+
+	integer	saved_line_colors ! flag
+	integer	ndx_save_colors(NLINES)
+	real*4	val_red(NLINES), val_green(NLINES), 
+     .          val_blue(NLINES), val_opaque(NLINES)
+
+	common/save_colr/ saved_line_colors, ndx_save_colors, 
+     .                    val_red, val_green, 
+     .                    val_blue, val_opaque
diff --git a/ppl/tmap_inc/shade_vars.cmn b/ppl/tmap_inc/shade_vars.cmn
new file mode 100644
index 0000000..7d41652
--- /dev/null
+++ b/ppl/tmap_inc/shade_vars.cmn
@@ -0,0 +1,138 @@
+*	TMAP_SHADE_VARS.INC
+*
+*	Variables used in the SHADE suite of routines
+*	J Davison JISAO/PMEL/NOAA
+*	7.9.88
+*	*jd* 10.23.98 Add pattern support variables
+*	*sh* 12/99 - reordered COMMON (variable "pattern_list" to end) to
+*		ensure contiguous 8-byte organization
+
+*	I_LO,I_HI,J_LO,J_HI are the lo and hi indices of the grid data
+*	X_LO,X_HI,Y_LO,Y_HI are the corresponding lon & lat coordinates
+*	BAD_VAL	is the value used for bad data or missing data
+
+*	FILL_MISSING determines whether missing values will be area filled
+* 	EVEN_HISTO determines whether even histogram or linear transform used
+*	DO_KEY determines whether the key is done or not
+*	VERTICAL_KEY determines whether the key is vertical or horizontal
+*	KUSER_LOC indicates whether user key locations are to be used
+*       ANNOTATE_KEY Flag: annotate min/max data field when open-ended levels used
+*	CUSTOM_COLORS determines whether a custom color map is to be defined
+
+*	SHD_MIN,SHD_MAX are the minimum and maximum data values shaded
+*	SHD_LEVELS is the number of levels to use in shading
+
+*	KX_LO,KX_HI,KY_LO,KY_HI are the world coordinates of the key diagonals
+*	KLAB_SIZE is the size of key labels in units of single key width/height
+*	KLAB_DIG is the number of sig digits (>0) or decimal places (<0) in key
+*	KLAB_LEN is the maximum length (in characters) of any one key label
+*	KLAB_INCR is the number of color bars between adjacent labels
+
+*	SLVL is a spectrum level in percent from 0 to 100 
+*	SR,SG,SB,SA  are the rgba values specified in the spectrum table
+*	SPEC_SIZE is the number of spectrum levels allowed to be specified
+*	NCL is the number of color levels specified in the spectrum table
+*	LO_COLOR_NDX is the minimum color index used in shading
+*	HI_COLOR_NDX is the maximum color index used in shading
+*	AREA_BUNDLES determines whether bundles will be used in shading
+*	PROTECT_USED_COLORS if true causes SHADE/FILL to preserve colors used
+*	MNCL,MSLVL,MSR,MSG,MSB,MSA are shaset levels stored for later use in mem.
+*	RGB_MAPPING sets (0,1,2)->(interpolated,atomic,data-based) color scale
+*	PERCENT, BY_LEVEL, BY_VALUE are the integers just named
+*	MRGB_MAPPING is rgb_mapping stored for later use in mem.
+
+*	** PATTERN SUPPORT VARIABLES **
+*
+*	PATTERN_NUM is the number of pattern levels allowed to be specified
+* 	PATTERNS is the array of specified pattern indices (positive values)
+*	NPAT is the number of pattern levels specified in the pattern table
+*	DEFAULT_PATTERNS are the indices of a default pattern list
+*	PATTERN_LIST is the list of named patterns
+*	MNPAT,MPATTERNS are patterns stored for later use in memory.
+
+
+*	** FILL OPTIMIZATION SUPPORT **
+
+*	ILAST is the index of the level (ie color) of the last buffered polygon
+*	BUFFER_MAX is the maximum number of polygons that can be buffered
+*	BUFFER_EMPTY is .true. if no polygons are currently buffered
+*	NUM_BUFFERED is the number of currently buffered polygons
+*	UPPERFLG is true when the upper triangle calls drawpoly
+*	UPPER_FIRST is true when the upper triangle is first cell in a buffer
+
+* 
+*	*jd* 10.23.98 Add pattern support variables
+*	*sh* 12/99 - reordered COMMON (variable "pattern_list" to end) to
+*		ensure contiguous 8-byte organization
+* v541 *acm*  5/02 add option to control outline on the shade key boxes (cont_key)
+* V550 *acm*  9/02 Let SPEC_SIZE be 250, so folks can set at least as many 
+*                  colors as they can use 
+* 2/03 *kob* g77 port - move position of cont_key var in common block.  g77
+*                       complained that padding was necessary otherwise
+* 4/03 V552 *acm* Shade key improvements; kuser_loc is 4-dimensional 
+* v581 *acm*  3/05 move cont_key to CONT.INC - continuous key for any color plot
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+*	ribbon_miss	rgb codes for the missing-value rep. on ribbon plots.
+* PyFr *kms* 5/13 Add alpha channel (opaque) variables SA,MSA
+* PyFr *kms* 7/13 Add overriding_alpha for overriding alpha/opacity (/OPACITY=)
+
+	integer		spec_size,max_windows,pattern_num
+	parameter	(spec_size=250,max_windows=12,pattern_num=50)
+
+	integer		i_lo,i_hi,j_lo,j_hi,shd_levels,lo_color_ndx
+	integer		klab_dig,klab_len,klab_incr,ncl,hi_color_ndx
+	integer		mncl,rgb_mapping,percent,by_level,by_value
+	integer		mrgb_mapping, annotate_key
+
+	integer		patterns(pattern_num),npat
+	integer		default_patterns(pattern_num)
+	integer		mpatterns(pattern_num),mnpat
+	integer		bad_ribbon_ndx
+
+	character*25	pattern_list(21)
+
+	REAL*4		x_lo,x_hi,y_lo,y_hi
+	REAL*4		bad_val,shd_min,shd_max
+	REAL*4		kx_lo,kx_hi,ky_lo,ky_hi,klab_size
+	REAL*4		sr(spec_size),sg(spec_size),sb(spec_size),sa(spec_size)
+	REAL*4		slvl(spec_size)
+	REAL*4		msr(spec_size),msg(spec_size),msb(spec_size),msa(spec_size)
+	REAL*4		mslvl(spec_size)
+	REAL*4		ribbon_miss(4)
+	REAL*4		overriding_alpha
+
+	logical		fill_missing,even_histo,do_key,area_bundles
+	logical		vertical_key,kuser_loc(4),custom_colors
+	logical		protect_used_colors
+
+	logical		buffer_empty, upperflg, upper_first
+	integer		ilast, buffer_max, num_buffered
+	parameter	(buffer_max=50)
+
+	REAL*4		xbuff(4,buffer_max), ybuff(4,buffer_max)
+        logical         use_cell
+
+	common/shade_vars/ i_lo,i_hi,j_lo,j_hi,
+     .			   x_lo,x_hi,y_lo,y_hi,
+     .			   bad_val, bad_ribbon_ndx,
+     .			   fill_missing,even_histo,do_key,vertical_key,
+     .			   kuser_loc,custom_colors,
+     .			   shd_min,shd_max,shd_levels,
+     .			   kx_lo,kx_hi,ky_lo,ky_hi,
+     .			   klab_size,klab_dig,klab_len,klab_incr,
+     .			   ncl,slvl,sr,sg,sb,sa,overriding_alpha,
+     .			   lo_color_ndx(max_windows),
+     .			   hi_color_ndx(max_windows),
+     .			   area_bundles,protect_used_colors,
+     .			   mncl,mslvl,msr,msg,msb,msa,
+     .			   patterns,npat,mpatterns,mnpat,
+     .			   default_patterns,
+     .			   rgb_mapping, percent, by_level, by_value,
+     .			   mrgb_mapping, annotate_key, ilast,
+     .			   buffer_empty, num_buffered,
+     .		     	   xbuff, ybuff, ribbon_miss,
+     .			   upperflg, upper_first,use_cell,
+     .			   pattern_list
+
diff --git a/ppl/tmap_inc/switch_inc.decl b/ppl/tmap_inc/switch_inc.decl
new file mode 100644
index 0000000..7e7d1a6
--- /dev/null
+++ b/ppl/tmap_inc/switch_inc.decl
@@ -0,0 +1,4 @@
+* SWITCH_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:SWITCH.INC'                                
diff --git a/ppl/tmap_inc/symbol_dat.decl b/ppl/tmap_inc/symbol_dat.decl
new file mode 100644
index 0000000..81315a4
--- /dev/null
+++ b/ppl/tmap_inc/symbol_dat.decl
@@ -0,0 +1,4 @@
+* SYMBOL_DAT.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PMEL:[PLOT5.LIBRARY.SYMLIB]SYMBOL.DAT'                                
diff --git a/ppl/tmap_inc/symkey_inc.decl b/ppl/tmap_inc/symkey_inc.decl
new file mode 100644
index 0000000..931dd23
--- /dev/null
+++ b/ppl/tmap_inc/symkey_inc.decl
@@ -0,0 +1,4 @@
+* SYMKEY_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:SYMKEY.INC'                                
diff --git a/ppl/tmap_inc/system_inc.decl b/ppl/tmap_inc/system_inc.decl
new file mode 100644
index 0000000..1827f74
--- /dev/null
+++ b/ppl/tmap_inc/system_inc.decl
@@ -0,0 +1,4 @@
+* SYSTEM_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* requires: INCLUDE 'PPLV11INC:SYSTEM.INC'                                
diff --git a/ppl/tmap_inc/taxis_inc.decl b/ppl/tmap_inc/taxis_inc.decl
new file mode 100644
index 0000000..37a73d0
--- /dev/null
+++ b/ppl/tmap_inc/taxis_inc.decl
@@ -0,0 +1,18 @@
+* TAXIS_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	TLO
+	REAL*4	DT
+	REAL*4	TCSIZE
+	INTEGER	ITYPET
+	INTEGER	NMTCT
+	INTEGER	LABELT
+	INTEGER	IFDB
+	INTEGER	ISDB
+	INTEGER	ITFLG
+	REAL*4	VANG
+	INTEGER	IVFLG
+	INTEGER	IAUTOT
+	INTEGER	ITXTPE
+	INTEGER	ITXLBP
+* requires: INCLUDE 'PPLV11INC:TAXIS.INC'                                   
diff --git a/ppl/tmap_inc/tble_inc.decl b/ppl/tmap_inc/tble_inc.decl
new file mode 100644
index 0000000..55e4c3c
--- /dev/null
+++ b/ppl/tmap_inc/tble_inc.decl
@@ -0,0 +1,18 @@
+* TBLE_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	PTAB
+	REAL*4	DTTAB
+	REAL*4	FTTAB
+	REAL*4	WTTAB
+	REAL*4	STTAB
+	REAL*4	PCTAB
+	REAL*4	UNIT
+	INTEGER	NPTAB
+	INTEGER	NDTTAB
+	INTEGER	NFTTAB
+	INTEGER	NWTTAB
+	INTEGER	NSTTAB
+	INTEGER	NPCTAB
+	INTEGER	NUNIT
+* requires: INCLUDE 'PPLV11INC:TBLE.INC'                                    
diff --git a/ppl/tmap_inc/tics2_inc.decl b/ppl/tmap_inc/tics2_inc.decl
new file mode 100644
index 0000000..6088b7c
--- /dev/null
+++ b/ppl/tmap_inc/tics2_inc.decl
@@ -0,0 +1,6 @@
+* TICS2_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	ITX
+	INTEGER	ITY
+* requires: INCLUDE 'PPLV11INC:TICS2.INC'                                   
diff --git a/ppl/tmap_inc/tics_inc.decl b/ppl/tmap_inc/tics_inc.decl
new file mode 100644
index 0000000..39f675c
--- /dev/null
+++ b/ppl/tmap_inc/tics_inc.decl
@@ -0,0 +1,10 @@
+* TICS_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	TSMX
+	REAL*4	TLX
+	REAL*4	TSMY
+	REAL*4	TLY
+	INTEGER	IX
+	INTEGER	IY
+* requires: INCLUDE 'PPLV11INC:TICS.INC'                                    
diff --git a/ppl/tmap_inc/vector_inc.decl b/ppl/tmap_inc/vector_inc.decl
new file mode 100644
index 0000000..4cda044
--- /dev/null
+++ b/ppl/tmap_inc/vector_inc.decl
@@ -0,0 +1,29 @@
+* VECTOR_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+* *acm* 4/01    add DENSITY for flowlines
+* *acm* 5/31/01 add NEED_COS and TRANSPZ  for flowlines
+* *acm* 6/ 4/01 add FXLOC, FYLOC  for flowlines key
+* *acm* 1/13/12 For DP Ferret/ SP Pplus: explicitly declare REALs 
+*               as single-precision
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+	REAL*4	VLEN
+	REAL*4	VUSRLN
+	REAL*4	VXLOC
+	REAL*4	VYLOC
+	REAL*4	VPOS
+	REAL*4	VMINLN
+	REAL*4	ARMAX
+	REAL*4	ARMIN
+	REAL*4	HFACT
+        INTEGER DENSITY
+	INTEGER VSKPX
+	INTEGER VSKPY
+        LOGICAL NEED_COS
+	LOGICAL TRNSPZ
+	LOGICAL VAUTO
+	LOGICAL VKEY
+	LOGICAL VUSER
+	CHARACTER VFRMT*30
+* requires: INCLUDE 'PPLV11INC:VECTOR.INC'                                  
diff --git a/ppl/tmap_inc/view_inc.decl b/ppl/tmap_inc/view_inc.decl
new file mode 100644
index 0000000..027d153
--- /dev/null
+++ b/ppl/tmap_inc/view_inc.decl
@@ -0,0 +1,11 @@
+* VIEW_INC.DECL - converted to Unix 2.26.91           
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	VIEWX
+	REAL*4	VIEWY
+	REAL*4	VIEWZ
+	REAL*4	ZSCLE
+	REAL*4	XYSCLE
+	REAL*4	VEWZMN
+	REAL*4	VEWZMX
+* requires: INCLUDE 'PPLV11INC:VIEW.INC'                                    
diff --git a/ppl/tmap_inc/ws_types.cmn b/ppl/tmap_inc/ws_types.cmn
new file mode 100644
index 0000000..0dc5e70
--- /dev/null
+++ b/ppl/tmap_inc/ws_types.cmn
@@ -0,0 +1,26 @@
+*	WS_TYPES.INC
+
+*	Include file to define supported gks workstation types
+*	J Davison
+
+	integer		ws_xwindow,
+     .			ws_uis,
+     .			ws_meta_in,
+     .			ws_meta_out,
+     .			ws_ps_mono,
+     .			ws_ps_color,
+     .			ws_tek4014,
+     .			ws_tek4107
+
+	common/wstypes/	ws_xwindow,
+     .                  ws_uis,
+     .                  ws_meta_in,
+     .                  ws_meta_out,
+     .                  ws_ps_mono,
+     .                  ws_ps_color,
+     .                  ws_tek4014,
+     .                  ws_tek4107
+
+  
+
+
diff --git a/ppl/tmap_inc/xgrinpt.cmn b/ppl/tmap_inc/xgrinpt.cmn
new file mode 100644
index 0000000..d00ee81
--- /dev/null
+++ b/ppl/tmap_inc/xgrinpt.cmn
@@ -0,0 +1,8 @@
+* information about mouse actions that have just occured
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        COMMON / XGRINPT / has_new_mouse, wmouse, xmouse, ymouse
+        LOGICAL has_new_mouse
+	INTEGER wmouse
+	REAL*4	xmouse, ymouse
+
diff --git a/ppl/tmap_inc/xinterrupt.cmn b/ppl/tmap_inc/xinterrupt.cmn
new file mode 100644
index 0000000..9acce66
--- /dev/null
+++ b/ppl/tmap_inc/xinterrupt.cmn
@@ -0,0 +1,5 @@
+* COMMON to communicate asynchronous interrupts to PPLUS routines
+* *sh* 1/23/89
+	COMMON /XINTERRUPT/ interrupted
+
+	LOGICAL interrupted
diff --git a/ppl/tmap_inc/xylabp_inc.decl b/ppl/tmap_inc/xylabp_inc.decl
new file mode 100644
index 0000000..8dffa83
--- /dev/null
+++ b/ppl/tmap_inc/xylabp_inc.decl
@@ -0,0 +1,12 @@
+* XYLABP_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	REAL*4	XLABS
+	REAL*4	YLABS
+	REAL*4	RLABS
+	INTEGER	LTYPE
+	REAL*4	XLLABS
+	REAL*4	YLLABS
+	INTEGER	LLTYPE
+	REAL*4	RHLABS
+* requires: INCLUDE 'PPLV11INC:XYLABP.INC'                                  
diff --git a/ppl/tmap_inc/zgrid_inc.decl b/ppl/tmap_inc/zgrid_inc.decl
new file mode 100644
index 0000000..41c42c2
--- /dev/null
+++ b/ppl/tmap_inc/zgrid_inc.decl
@@ -0,0 +1,7 @@
+* ZGRID_INC.DECL - converted to Unix 2.26.91          
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	IZTYP
+	INTEGER	IZMRK
+	INTEGER	IZLEN
+* requires: INCLUDE 'PPLV11INC:ZGRID.INC'                                   
diff --git a/ppl/tmap_inc/zgridd_inc.decl b/ppl/tmap_inc/zgridd_inc.decl
new file mode 100644
index 0000000..8c65f7f
--- /dev/null
+++ b/ppl/tmap_inc/zgridd_inc.decl
@@ -0,0 +1,8 @@
+* ZGRIDD_INC.DECL - converted to Unix 2.26.91         
+* COMMON for PLOT+ with all variables declared
+* created for TMAP usage by Steve Hankin 7/88
+	INTEGER	IZSE
+	REAL*4	XX
+	REAL*4	YY
+	REAL*4	ZZ
+* requires: INCLUDE 'PPLV11INC:ZGRIDD.INC'                                  
diff --git a/ppl/tmapadds/LIB_NAME b/ppl/tmapadds/LIB_NAME
new file mode 100644
index 0000000..11df86a
--- /dev/null
+++ b/ppl/tmapadds/LIB_NAME
@@ -0,0 +1 @@
+LIB = ../../lib/libtmapadds.a 
diff --git a/ppl/tmapadds/Makefile b/ppl/tmapadds/Makefile
new file mode 100644
index 0000000..5817849
--- /dev/null
+++ b/ppl/tmapadds/Makefile
@@ -0,0 +1,49 @@
+#
+# Site-specific defines
+#
+include ../../site_specific.mk
+
+#
+# include platform specific definitions of:
+#       CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
+#
+include ../../platform_specific.mk.$(BUILDTYPE)
+
+include ./SOURCE_FILES
+include ./LIB_NAME
+
+#
+# Macros
+#
+
+OBJS = $(SRCS_C:.c=.o) $(SRCS_F:.F=.o)
+
+# change the standard rules for .F -> .o builds so $(PPLUS_FFLAGS) is used
+
+#%.o : %.F
+#	rm -f $*.f
+#	$(CPP) -P -traditional $(CPP_FLAGS) $(<F) | sed -e 's/de    /de /g' | sed -e 's/de         /de /g' > $*.f
+#	$(F77) $(PPLUS_FFLAGS) -c $*.f	 
+
+# Directly compile the .F source files to the .o object files
+# since gfortran can handle the C compiler directives in Fortran code
+%.o : %.F
+	$(FC) $(PPLUS_FFLAGS) -c $*.F -o $*.o
+
+
+#
+# Targets
+#
+
+all:	$(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(RANLIB) $@
+
+clean:
+	rm -f *.o $(LIB)
+
+#
+# End of Makefile
+#
diff --git a/ppl/tmapadds/SOURCE_FILES b/ppl/tmapadds/SOURCE_FILES
new file mode 100644
index 0000000..86feac6
--- /dev/null
+++ b/ppl/tmapadds/SOURCE_FILES
@@ -0,0 +1,92 @@
+SRCS_F = \
+aline.F\
+aline_sub.F\
+arfill.F\
+arfill_section.F\
+bad_xy_coord.F\
+buffer_fillpoly.F\
+bc2whoi.F\
+calendar_blkdat.F\
+cmdini.F\
+compute_histo_bins.F\
+compute_mnstd.F\
+daxis_box.F\
+drawpoly.F\
+fillpol.F\
+fillpoly.F\
+flowline.F\
+flowline_sub.F\
+flush_buffered_fillpoly.F\
+getlabfonts.F\
+get_ndx.F\
+get_pix.F\
+get_user_coords.F\
+get_world_coords.F\
+hatch_fill_rep.F\
+key.F\
+key_annotate.F\
+key_lo_inf_horz.F\
+key_hi_inf_horz.F\
+key_lo_inf_vert.F\
+key_hi_inf_vert.F\
+kurv.F\
+line_key.F\
+new_gks_window.F\
+open_gks_ws.F\
+open_metafile.F\
+pattern_set.F\
+pltdat_block_data.F\
+point_convert.F\
+pplld_pts.F\
+ppllocator.F\
+pplp_ver_data.F\
+restore_saved_line_colors.F\
+ribbon_missing.F\
+save_line_color.F\
+save_rgb_blkdat.F\
+say_interrupted.F\
+set_default_colors.F\
+set_default_nlevels.F\
+set_fill_area_rep.F\
+set_fill_ndx.F\
+set_gks_metafile.F\
+set_levels_shade_fill.F\
+set_num_linecolors.F\
+set_one_color.F\
+set_open_levels.F\
+set_override_opacity.F\
+set_pat_size.F\
+set_regular_plot.F\
+set_window_size.F\
+setax_syms.F\
+setfont.F\
+setlab_syms.F\
+setup_color_table.F\
+setup_defaults.F\
+shade.F\
+shade_cell.F\
+shade_fill_it.F\
+shade_key.F\
+shade_key_cont.F\
+shade_set.F\
+shade_sub.F\
+strmar.F\
+upnsquish.F\
+use_linear_levels.F\
+vec_arrows.F\
+whoi2bc.F\
+ws_fill_rep.F\
+ws_line_bundles.F\
+ws_line_spectrum.F\
+ws_types_init.F\
+xgrinpt_blkdat.F\
+yabd.F 
+SRCS_C = \
+its_gksm.c\
+pplcmd_c.c\
+pplldc_envelope.c\
+pplldv_envelope.c\
+pplldx_envelope.c\
+pplld_pts_envelope.c\
+reallo_envelope.c\
+reallo_ppl_memory.c
diff --git a/ppl/tmapadds/aline.F b/ppl/tmapadds/aline.F
new file mode 100644
index 0000000..99567de
--- /dev/null
+++ b/ppl/tmapadds/aline.F
@@ -0,0 +1,132 @@
+	SUBROUTINE ALINE (x,nxs)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Processes ALINE command buffer and manages aline database
+*	J Davison 10.16.89
+*	11.9.93 Mod to put immediate mode output in segments
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+
+        IMPLICIT NONE
+	include 	'parampl5_dat.decl'            
+	include 	'PARAMPL5.DAT'            
+	include 	'cmrd_inc.decl'            
+	include 	'CMRD.INC'            
+	include 	'cmrdl_inc.decl'            
+	include 	'CMRDL.INC'            
+	include 	'lines_inc.decl'            
+	include 	'LINES.INC'            
+	include 	'aline.cmn'            
+	include 	'switch_inc.decl'            
+	include 	'SWITCH.INC'            
+
+* special COMMON to let this routine know if FERRET is in control
+        include 'ppl_in_ferret.cmn'
+  
+	integer		nxs,end,a_line,i
+	real		x(nxs),minx,miny,maxx,maxy
+	character*2048	str
+
+********************************************************************************
+
+	call upnsquish (label,str,end)
+                                
+*	IF NO LABEL, EXECUTE ALINE COMMAND IMMEDIATELY
+	if (end .eq. 0) then
+
+*	   CANCEL ALL SET LINES IF COMMAND IS SIMPLY 'ALINE'
+	   if (m .eq. 0) then
+	      do 10 i = 1,nlines
+		 aline_on(i) = .false.
+10	      continue
+	   end if 
+
+*	   OTHERWISE REQUIRE ALL ARGUMENTS   
+	   if (m .ne. 5) return
+	   
+	   if (p(1) .gt. 0 .and. p(1) .le. nlines) then
+	      a_line = p(1)
+	   else                   
+	      a_line = 1               
+	   end if 
+
+*	   HANDLE /USER & /NOUSER COORDINATES PROPERLY
+	   if (suser) then
+	      minx = p(2)
+	      miny = p(3)
+	      maxx = p(4)
+	      maxy = p(5)
+	   else
+	      call point_convert (p(2),p(3),minx,miny)
+	      call point_convert (p(4),p(5),maxx,maxy)
+	   end if
+
+!          Mod 11.9.93 to insert aline immediate output into segments
+*          TMAP check that output window is active
+           IF ( PPL_in_FERRET ) CALL CK_GKS_ACTIVE( *9999 )
+*          TMAP addition to turn on segment
+           IF ( PPL_in_FERRET ) CALL SEG_ON( )
+
+	   call aline_sub (x,nxs,a_line,minx,miny,maxx,maxy)
+           IF ( PPL_in_FERRET ) CALL SEG_OFF
+9999	   return
+	end if
+
+*	IF LABEL = 'ON' THEN SET ALINE FOR THIS LINE#                          
+	if (str(1:2) .eq. 'ON') then
+	   if (m .eq. 5 .and. p(1) .gt. 0 .and. p(1) .le. nlines) then
+	      a_line			= p(1)
+	      aline_on(a_line)		= .true.
+	      aline_user(a_line)	= suser
+	      aline_minx(a_line)	= p(2)
+	      aline_miny(a_line)	= p(3)
+	      aline_maxx(a_line)	= p(4)
+	      aline_maxy(a_line)	= p(5)
+	   end if
+	   return
+	end if
+
+*	IF LABEL = 'OFF' THEN CANCEL ALINE FOR THIS LINE#
+	if (str(1:3) .eq. 'OFF') then
+	   a_line 			= p(1)
+	   aline_on(a_line)		= .false.
+	end if
+
+	return
+
+	end
+
+
diff --git a/ppl/tmapadds/aline_sub.F b/ppl/tmapadds/aline_sub.F
new file mode 100644
index 0000000..45b91d9
--- /dev/null
+++ b/ppl/tmapadds/aline_sub.F
@@ -0,0 +1,177 @@
+	SUBROUTINE ALINE_SUB (x,nxs,a_line,axmin,aymin,axmax,aymax)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Modified PPLMOD_PLTIT and PPLMOD_PLOTXY to execute the ALINE command 
+*	where a line is drawn of a particular type as specified.
+*	J Davison 10.4.89
+
+*  v5.4 *acm* 10/18/01  When plotting SYM=DOT clear buffer at end: doit_makedot
+*                       Remove VMS include statements
+
+        IMPLICIT NONE
+
+*****************************************************
+* local variable declarations for PLTIT (for TMAP)
+	REAL  	x
+	INTEGER nxs
+* TMAP include files with explicit type declarations:
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+
+CCCCC	VIRTUAL X(NXS)		(*jd* 12.96 for linux port) 
+	dimension X(NXS)     
+
+	real 		cs,sn,xt,yt,oldx(4)
+	real		axmin,aymin,axmax,aymax
+	integer  	icnt,im,j,ibase,iy,a_line
+	logical		old_swait
+
+
+C	KTYPE = 1 -XY  0 -Z  2-VECTOR
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	include 'plt_inc.decl'
+	include 'PLT.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'cmrd_inc.decl'
+	include 'CMRD.INC'
+	include 'prmcom_inc.decl'
+	include 'PRMCOM.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+	include 'switch_inc.decl'
+	include 'SWITCH.INC'
+	include 'system_inc.decl'
+	include 'SYSTEM.INC'
+	include 'cont_inc.decl'  !added to get ivcomp v1.1
+	include 'CONT.INC'  !added to get ivcomp v1.1
+        include 'gkscm2.cmn' ! jd 3.22.89
+        INCLUDE 'makedot.cmn'    ! 10/01 *acm*
+
+	CALL COLOR(IPEN(0))
+!	CALL SETAX(X,NXS,XF,YF,XL,YL,XH,YH,NMX,NMY,XTI,XTL)
+
+	oldx(1) 	= x(1)
+	x(1) 		= axmin
+	oldx(2) 	= x(2)
+	x(2) 		= axmax
+
+	oldx(3)		= x(nxs/2+1)
+	x(nxs/2+1) 	= aymin
+	oldx(4)		= x(nxs/2+2)
+        x(nxs/2+2) 	= aymax
+
+	IBASE=0
+	IY=NXS/2
+	CS=COS(VANG*.01745329252)
+	SN=SIN(VANG*.01745329252)
+!	ZT=YF/XF
+	ICNT=1
+
+	old_swait = swait
+	swait = .false.
+	CALL MARKH(HMARK(a_line))
+	CALL COLOR(IPEN(a_line))
+
+c acm  Put back to old PPL  ACM 8/2000
+c acm	IF(ITYPE(a_line).GE.4 .and. .not.gks_open)THEN ! JD 3.22.89 NEW PPL
+c acm!	IF(ITYPE(a_line).GE.4) THEN ! OLD PPL (PRE JD 89 GKS)
+
+	IF(ITYPE(a_line).GE.4) THEN ! OLD PPL (PRE JD 89 GKS)
+	   CALL DASHSZ(DN1(a_line),UP1(a_line),DN2(a_line),UP2(a_line))
+	   CALL DASHES
+	ELSE
+	   CALL VECTRS
+	END IF
+
+	IF(ITYPE(a_line).EQ.3)CALL POINTS
+
+	CALL TRANS(1,X(IBASE+1),X(IY+IBASE+1),XT,YT)                
+	CALL PLOT(XT,YT,0,0)
+	IF (ITYPE(a_line).NE.0.AND.ITYPE(a_line).NE.4) 
+     .	CALL MARK(IMARK(a_line))
+	IM=0
+	IF (ITYPE(a_line).EQ.1.OR.ITYPE(a_line).EQ.3)IM=IMARK(a_line)
+	DO 60 J=1,2
+	   CALL TRANS(1,X(J),X(IY+J),XT,YT)
+	   CALL PLOT(XT,YT,1,0)
+60      CALL MARK(IM)
+	IF (ITYPE(a_line).EQ.2.OR.ITYPE(a_line).EQ.5) 
+     .	CALL MARK(IMARK(a_line))
+ 	CALL COLOR(IPEN(0))
+
+	x(1) 		= oldx(1)
+	x(2) 		= oldx(2)
+
+	x(nxs/2+1) 	= oldx(3)
+        x(nxs/2+2) 	= oldx(4)
+
+	swait = old_swait
+
+!	CALL SCALE(XF,YF,XORG,YORG,XLO,YLO)
+C
+	CALL WINDOW(0.,0.,0.,0.)
+C
+!	IF(ITFLG.EQ.1)THEN
+!	    XHI=XTI
+!	    XLO=XTL
+!	ELSE IF(ITFLG.EQ.-1)THEN
+!	    YHI=XTI
+!	    YLO=XTL
+!	ENDIF
+
+
+c          IF (imark(a_line) .eq. 99) THEN
+c             CALL doit_makedot(IPT,XDOT,YDOT)
+c             IPT = 0
+c          ENDIF
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/arfill.F b/ppl/tmapadds/arfill.F
new file mode 100644
index 0000000..56fb61f
--- /dev/null
+++ b/ppl/tmapadds/arfill.F
@@ -0,0 +1,217 @@
+      subroutine arfill(z,x,y,nx,ny)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*	
+*     The variable nlev2 is passed here as nlev *jd*
+*
+C** 
+C**    @(#)arfill.F	1.6    2/6/91
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C     lots of places ---> PPLMOD_PPLCMD ---> PPLMOD_PLTIT 
+C              ---> PPLMOD_PLOTZ ---> PPLMOD_ARFILL
+C
+C     This subroutine ...
+C
+C     z      - actual 2-D array of data values to be contoured
+C     x      - array of grid points along the X axis
+C     y      - array of grid points along the Y axis
+C     nx     - number of X grid points
+C     ny     - number of Y grid points
+C
+C
+*	MODS JD 1.13.92 To fit into TMAP PPL+
+*	Mod  *jd* 10.26.93 eliminate private item for meta_shade_set in xgks
+*			 - not replaced with appropriate code yet
+* 	Mod *jd * 1.30.96  Fix bug in fill --- missing value flag is 
+*				unrecognized.
+C     V4.50 *jc* 5.97 Major cleanup and commenting
+C     V4.50 *jc* 5.97 Add curvilinear coordinates code
+C     v5.00 *jd* 2.99 Add fill optimization 
+*     V5.81 ACM 3/05  Other routines (drawpoly, buffer_fillpoly, flush_buffered_fillpoly)
+*                     removed to their own files.
+*     v5.81 *acm* 4/05 Changes for FILL/MOD. Draw replications for curvilinear datasets
+C V602 *acm* 2/07 check status coming out of CURV_COORD_RANGE; part of fix to bug 1485
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+
+        IMPLICIT NONE
+	include 	'ARFILL.INC'
+        include         'GKSCM1.INC'
+        include         'gkscm2.cmn'
+        include         'miss_inc.decl'
+        include         'MISS.INC'
+        include         'xcurvilinear.cmn'
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+        include         'shade_vars.cmn'
+	include		'parampl5_dat.decl'
+	include		'PARAMPL5.DAT'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+        INCLUDE         'errmsg.parm'
+
+        integer nx,ny
+        real z(nx,ny),x(nx),y(ny)
+
+        real x_extra,y_extra
+        integer i,nnx,nny, ilo, ihi, jlo, jhi, status
+	real xadd,xinv,yinv,w(4),v(4),ndc(4),uc(4)
+
+        real lmin, lmax
+
+        real big, xrange
+        integer error, nleft, nright, trans_no
+
+C     *jd* mod to allow filling single level fields
+        if (nlev .le. 1) return
+
+	shd_levels = nlev - 1
+	shd_levels = MAX(nlev2-1,1) ! this is how it is in SHADE.F
+
+C     DETERMINE PATTERNS OR COLORS TO SET BUNDLED FILL AREA REPRESENTATIONS
+        call set_fill_area_rep(wsid,wstype)
+
+C     The FILL command does not deal with curvilinear modulo axes properly.
+C     The problem is seen in polar projections where the longitude 0E and
+C     longitude 360E are not connected: a small pie wedge is left blank.
+C
+C     To remedy this, we should test for modulo_curvilinear axes and
+C     replicate the appropriate row/column in the z array before 
+C     breaking the data up into small triangles (or squares) which
+C     are then fed to drawpoly().
+C
+C     If an axis is modulo_curvi we will increase nnx(nny) by one and
+C     create an extra point for the end of that axis
+C     This code works properly for regularly gridded axes.  For irregular
+C     axes it is as good a guess as any.
+
+C acm 4/05 When plotting curvilinear data with FILL/MODULO put this logic into effect
+
+        IF (xmodulo) dim1_modulo = .TRUE.
+        if (curvilinear .and. dim1_modulo) then
+           x_extra = x(nx) + (x(nx)-x(nx-1))
+           nnx = nx+1
+        else
+           nnx = nx
+        endif
+ 
+        if (curvilinear .and. dim2_modulo) then
+           y_extra = y(ny) + (y(ny)-y(ny-1))
+           nny = ny+1
+        else
+           nny = ny
+        endif
+
+* Get range of indices for the curvi X,Y coordinates actually needed for the 
+* hlimits, vlimits that were requested.
+
+
+*	GET PROPER SCALING, NDC COORDINATES, ETC FOR FILL
+	CALL FGD_GQCNTN(error,trans_no)
+	IF (error .NE. 0) GOTO 1000
+
+	CALL FGD_GQNT(trans_no,error,w,v)
+	IF (error .NE. 0) GOTO 1000
+
+	CALL get_user_coords (w,v,ndc,uc,xinv,yinv)
+
+        IF (curvilinear) THEN
+           CALL CURV_COORD_RANGE (uc, ilo, ihi, jlo, jhi, status )
+           IF (status .NE. ferr_ok) GOTO 1000
+        ENDIF
+      
+        big = ABS(badx)
+        lmin = big
+        lmax = -1*big
+        xadd = 0.
+
+       CALL ARFILL_SECTION(x, y, z, zlev, nx, ny, nlev, nnx, nny, 
+     .       x_extra, y_extra, lmin, lmax, ilo, ihi, jlo, jhi, xadd, 
+     .       status)
+
+       if (status .eq. ferr_interrupt) go to 1000
+
+        IF (xmodulo .AND. curvilinear) THEN
+           xrange = 360
+           IF (.NOT. units_degrees) xrange = wwxmax - wwxmin
+           nleft = 0
+           nright = 0
+           IF (lmin .GT. uc(1) ) nleft =  1 + INT(lmin - uc(1) )/ xrange
+           IF (lmax .LT. uc(2) ) nright = 1 + INT(uc(2) - lmax )/ xrange
+           nleft = MAX(nleft,1)
+           nright = MAX(nright,1)
+
+           IF (nleft .GT. 0) THEN
+              xadd = 0.
+              DO 100 i = 1, nleft
+                 xadd = xadd - xrange
+                 CALL ARFILL_SECTION(x, y, z, zlev, nx, ny, nlev, 
+     .               nnx, nny, x_extra, y_extra, lmin, lmax, ilo, 
+     .               ihi, jlo, jhi, xadd, status)
+                 IF (status .EQ. ferr_interrupt) GOTO 1000
+ 100          CONTINUE
+           ENDIF
+
+           IF (nright .GT. 0) THEN
+              xadd = 0.
+              DO 110 i = 1, nright
+                 xadd = xadd + xrange
+                 CALL ARFILL_SECTION(x, y, z, zlev, nx, ny, nlev, 
+     .               nnx, nny, x_extra, y_extra, lmin, lmax, ilo, 
+     .               ihi, jlo, jhi, xadd, status)
+                 IF (status .EQ. ferr_interrupt) GOTO 1000
+ 110          CONTINUE
+           ENDIF
+         
+        ENDIF   ! xmodulo
+C     
+C     Generate a color/gray scale key.
+C     Restore standard key style afterward (do this here, to 
+C     catch both contour and contour/set calls).
+C     
+        if (do_key .AND. .NOT.interrupted .AND. status .EQ. ferr_ok) THEN
+            call key ! 1/89 - *sh*
+           CALL SHADE_KEY_CONT (0)
+        ENDIF
+
+1000    return
+        end
diff --git a/ppl/tmapadds/arfill_section.F b/ppl/tmapadds/arfill_section.F
new file mode 100644
index 0000000..8e4004a
--- /dev/null
+++ b/ppl/tmapadds/arfill_section.F
@@ -0,0 +1,200 @@
+      subroutine arfill_section(x, y, z, zlev, nx, ny, nlev, nnx, nny, 
+     .       x_extra, y_extra, lmin, lmax, ilo, ihi, jlo, jhi, xadd, 
+     .       status)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*	
+*     extracted from arfill.F, fill a section of a modulo (curvilinear) plot.
+*
+* ACM 4/13/05
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+
+        IMPLICIT NONE
+
+      REAL z(nx,ny),x(nx),y(ny),zlev(nlev), x_extra, y_extra, 
+     .     xadd, lmin, lmax
+      INTEGER nx, ny, nlev, nnx, nny, ilo, ihi, jlo, jhi, status
+
+      integer i, j, ii, jj, itop, jtop
+      real xt(5), yt(5), zt(5)
+
+	include 	'ARFILL.INC'
+        include         'GKSCM1.INC'
+        include         'gkscm2.cmn'
+        include         'miss_inc.decl'
+        include         'MISS.INC'
+        include         'xcurvilinear.cmn'
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+        include         'shade_vars.cmn'
+        INCLUDE         'errmsg.parm'
+
+
+*  check for consistency: data range 1:ny, index range jlo:jhi  
+*  If inconsistent, use whole Y range given by ny
+
+      IF (curvilinear) THEN
+         IF (jlo .LT. 1 .OR. jhi .GT. nny+1) THEN  
+            jlo = 1
+            jtop = nny
+         ELSE
+            jtop = jhi 
+            IF (jhi .EQ. nny+1) jtop = nny
+         ENDIF
+      ELSE
+         jlo = 1
+         jtop = nny
+      ENDIF
+
+*  Likewise for X, if this is not an x modulo plot
+
+      IF (curvilinear .AND. (.NOT. xmodulo) ) THEN
+         IF (ilo .LT. 1 .OR. ihi .GT. nnx+1) THEN  
+            ilo = 1
+            itop = nnx
+         ELSE
+            itop = ihi 
+            IF (ihi .EQ. nnx+1) itop = nnx
+         ENDIF
+      ELSE
+         ilo = 1
+         itop = nnx
+      ENDIF
+
+
+C     Divide the region into rectangles or triangles and feed these
+C     small elements to drawpoly()
+
+      buffer_empty = .true.
+      status = ferr_no_range  ! will be returned if nothing is plotted.
+
+      do 200 j=jlo,jtop-1
+         jj = j
+         do 100 i=ilo,itop-1
+            ii = i
+
+            IF (interrupted) THEN
+              status = ferr_interrupt
+              RETURN
+            ENDIF
+     
+C     For curvilinear modulo axes:
+C     Replicate the first point in a column/row if necessary
+            if (i.eq.nnx) ii = 1
+            if (j.eq.nny) jj = 1
+
+            zt(1)=z(ii,jj)
+            xt(1) = x(i)
+            yt(1) = y(j)
+
+            if (sqfflg) then
+c     
+c     do a square
+c     
+               zt(2)=z(ii+1,jj)
+               if (i.eq.nx) then
+                  xt(2)=x_extra
+                  zt(2)=z(ilo,jj)
+               else
+                  xt(2)=x(i+1)
+               end if
+               yt(2)=yt(1)
+              
+               zt(3)=z(ii+1,jj+1)
+               if (i.eq.nx) then
+                  xt(3)=x_extra
+                  zt(3)=z(ilo,jj+1)
+               else
+                  xt(3)=x(i+1)
+               end if
+
+               if (j.eq.ny) then
+                  yt(3)=y_extra
+               else
+                  yt(3)=y(j+1)
+               endif
+               
+               zt(4)=z(ii,jj+1)
+               xt(4)=xt(1)
+               yt(4)=yt(3) 
+
+               call drawpoly(xt,yt,zt,zlev,nlev,4,xadd,lmin,lmax)
+
+            else
+c     
+c     do upper triangle
+c     
+              upperflg = .true.
+
+              zt(2)=z(ii+1,jj+1)
+              if (i.eq.nx) then
+                 xt(2) = x_extra
+                 zt(2) = z(ilo,jj+1)
+              else
+                 xt(2)=x(i+1)
+              end if
+              if (j.eq.ny) then
+                 yt(2)=y_extra
+              else
+                 yt(2)=y(j+1)
+              end if
+
+              zt(3)=z(ii,jj+1)
+              xt(3)=xt(1)
+              yt(3)=yt(2)
+     
+              call drawpoly(xt,yt,zt,zlev,nlev,3,xadd,lmin,lmax)
+c     
+c     do lower triangle
+c     
+              upperflg = .false.
+
+              zt(3)=z(ii+1,jj)
+              xt(3)=xt(2)
+              yt(3)=yt(1)
+     
+           call drawpoly(xt,yt,zt,zlev,nlev,3,xadd,lmin,lmax)
+
+         endif
+
+ 100     continue
+         if (.not. buffer_empty) call flush_buffered_fillpoly(xadd,
+     .                     lmin, lmax)
+         status = ferr_ok
+ 200  continue
+      
+      return
+      end
diff --git a/ppl/tmapadds/bad_xy_coord.F b/ppl/tmapadds/bad_xy_coord.F
new file mode 100644
index 0000000..d1485bf
--- /dev/null
+++ b/ppl/tmapadds/bad_xy_coord.F
@@ -0,0 +1,82 @@
+	LOGICAL FUNCTION BAD_XY_COORD (i,j,xs,py,ndx)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Screens 2D plot points where the coordinates of the grid cell are
+*	invalid
+
+*	*sh* 4/97 - extracted from "get_ndx" which previously checked both
+*	for bad data values and for bad coordinates. With curvilinear coord
+*	translations included in the logic these two functions needed to be
+*	separated
+
+        IMPLICIT NONE
+	include	'parampl5_dat.decl'
+	include	'PARAMPL5.DAT'
+	include	'miss_inc.decl'
+	include	'MISS.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+	include	'cont_inc.decl'
+	include	'CONT.INC'
+	include	'shade_vars.cmn'
+
+	integer	i,j,ndx
+
+	real    xs(nx+1),py(4)
+	real    get_ndx
+
+********************************************************************************
+
+*	      CHECK AGAINST 'LIMITS' VALUES AND FIND COLOR INDEX
+	      if((xle.and.xs(i).le.cmxle) 	.or.
+     .		 (xeq.and.xs(i).eq.cmxeq) 	.or.
+     .		 (xge.and.xs(i+1).ge.cmxge) 	.or.
+     .		 (yle.and.py(1).le.cmyle) 	.or.
+     .		 (yeq.and.py(1).eq.cmyeq) 	.or.
+     .		 (yge.and.py(2).ge.cmyge) ) THEN
+
+	         get_ndx = bad_val
+	         BAD_XY_COORD = .TRUE.
+
+	      ELSE
+
+		 BAD_XY_COORD = .FALSE.
+
+	      end if
+
+	      return
+	end
diff --git a/ppl/tmapadds/bc2whoi.F b/ppl/tmapadds/bc2whoi.F
new file mode 100644
index 0000000..4c8c459
--- /dev/null
+++ b/ppl/tmapadds/bc2whoi.F
@@ -0,0 +1,83 @@
+	CHARACTER*14 FUNCTION BC2WHOI( num_minutes )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* convert minutes since 01-JAN-0000 00:00:00 to a WHOI-formatted of the form
+* yymmddhhmm
+
+* Written 9/20/88 By Steve Hankin for PMEL/TMAP
+
+* version 0.0 - based on TM_SECS_TO_DATE by Mark Verschell
+* version 0.1 - calls TMAP library routines TM_SECS_TO_DATE and TM_BREAK_DATE
+* version 0.2 - 1/19/89: remove century from year for WHOI format
+* Mod J Davison 11.22.95 Return century, add seconds, for 4 digit year 
+* Mod J Davison 10.15.99 Add multi calendar support. Call new routine.
+* 
+*  *acm* 12/00 Change calendars to match NetCDF standard
+
+      IMPLICIT NONE
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+* Argument definition
+	INTEGER		year, month, day, hour, minute, second, status
+	INTEGER		century
+	REAL*8		num_minutes
+
+* Local Definition
+	CHARACTER*20	TM_SECS_TO_DATE, date
+
+******************************************************************************
+
+* convert to date string of the form dd-mmm-yyyy:hh:mm:ss
+	date = TM_SECS_TO_DATE (num_minutes * 60.D0, calendar_id )
+
+* break into individual integer date values
+	CALL TM_BREAK_DATE ( date, calendar_id, year, month, day, 
+     .                       hour, minute, second, status)
+
+* kludge for WHOI format limitation - year doesn't contain century
+
+	century = year/100
+	year = MOD(year,100)
+
+* Put results into WHOI string
+	WRITE (BC2WHOI,3000) year, month, day, hour, minute,
+     .	second, century
+3000	FORMAT(7I2.2)
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/buffer_fillpoly.F b/ppl/tmapadds/buffer_fillpoly.F
new file mode 100644
index 0000000..44f3c54
--- /dev/null
+++ b/ppl/tmapadds/buffer_fillpoly.F
@@ -0,0 +1,35 @@
+
+
+C======================================================================
+
+      subroutine buffer_fillpoly (xarg,yarg,npts,index)
+
+        IMPLICIT NONE
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+        include         'shade_vars.cmn'
+
+*     J Davison 2.4.99
+
+*     BUFFER_FILLPOLY() called when entire grid cell is a single color; when
+*     color changes construct new polygon from individual cells and fill
+*     it in FLUSH_BUFFERED_FILLPOLY().
+
+      real xarg(*), yarg(*)
+      integer npts, index, i
+
+      buffer_empty = .false.
+      num_buffered = num_buffered + 1
+
+      if (npts .eq. 3 .and. num_buffered .eq. 1)
+     .     upper_first = upperflg
+
+      do 10 i = 1, npts
+         xbuff(i,num_buffered) = xarg(i)         
+         ybuff(i,num_buffered) = yarg(i)
+ 10   end do
+
+      ilast = index + 1
+
+      return
+      end
diff --git a/ppl/tmapadds/calendar_blkdat.F b/ppl/tmapadds/calendar_blkdat.F
new file mode 100644
index 0000000..b09b916
--- /dev/null
+++ b/ppl/tmapadds/calendar_blkdat.F
@@ -0,0 +1,175 @@
+	BLOCK DATA CALENDAR_BLKDAT
+
+C 	calendar_blkdat.F
+C
+C	Calendar-specific initialization used in multiple calendar support
+C	J Davison 10.99
+C	V 1.0
+C   12/00 *acm* change the calendar names to match those in the NetCDF standard
+C         (plus two of our own, for testing)
+C        - also don't initialize "the calendar" -- each time axis may have
+C          its own calendar ID; calendar attributes are set for a given
+C          calendar as needed.
+C
+
+C   5/1/2001  *acm* shorten data statement for cals_month_by_day for some compilers
+C  10/1/2001  *acm* change name of 360-day calendar to 360_DAY
+*      *acm* 10/01  remove VMS includes
+C   v554 2/3/2004  *acm* add an index to identify calendar type of d360
+C   v570 5/ 2004   *acm* new calendar all_leap=366_day
+
+        IMPLICIT NONE
+        include 'calendar.decl'
+        include 'calendar.cmn'
+
+C	*******************************************************************
+C       Calendar parameters needed by calendar.cmn
+C	*******************************************************************
+
+	DATA max_calendars/mxcals/
+        DATA max_months/mxmnths/
+        DATA max_days/mxdays/
+
+
+C	*******************************************************************
+C       Supported calendars are those below --
+C	*******************************************************************
+C	Calendar name as recognized by Ferret (see tm_set_current_calendar,
+C       tm_get_calendar_id).   
+
+	data	allowed_calendars
+     .  /
+     1	'GREGORIAN',
+     2  'NOLEAP',
+     3  'JULIAN',
+     4  '360_DAY',
+     5  'ALL_LEAP'
+     .  /
+
+C	Calendar index corresponding to calendar names:
+	data    gregorian   /1/
+        data    noleap      /2/
+        data    julian      /3/
+        data    d360        /4/
+        data    all_leap    /5/
+
+C	*******************************************************************
+C	Array values are ordered by calendar indices.  Each row specifies
+C	values for a single calendar.  The first row assigns values for
+C	calendar 1 (Gregorian), the second for calendar 2 (Common), and
+C	so on as declared in the index integers immediately above.
+
+C	Here, each row identifies the number of months in the calendar:
+C	*******************************************************************
+	data    cals_num_months 
+     .	/ 
+     1	12,
+     2	12,
+     3	12,
+     4	12,
+     5	12    
+     .  /
+
+C	*******************************************************************
+C	Each row identifies the number of days in the calendar year:
+C	*******************************************************************
+	data	cals_num_days
+     .	/ 
+     1	365,
+     2  365,  
+     5  365,  
+     4  360,  
+     5  366   
+     .  /
+
+C	*******************************************************************
+C	Each row identifies the exact number of days in the calendar year:
+C	*******************************************************************
+	data	cals_yeardays
+     .	/ 
+     1	365.2425,
+     2  365.,  
+     3  365.25,  
+     4  360. ,  
+     5  366. 
+     .  /
+ 
+C	*******************************************************************
+C	Each row names the months for one calendar.  Row must have 
+C	'max_months' values.  Fill with blanks if necessary.
+C	*******************************************************************
+	data	cals_month_names 
+     .	/ 
+     1	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC',
+
+     2	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC',
+
+     3	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC',
+
+     4	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC',
+
+     5	'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
+     .    'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'
+
+     .  /
+
+C	*******************************************************************
+C	Each row identifies the number of days in each month for a
+C	single calendar.  Row must have 'max_months' values.  Fill with 
+C	zeros if necessary.
+C	*******************************************************************
+	data	cals_days_in_month
+     .	/   
+     1	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
+     2  31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
+     3  31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
+     4  12*30,
+     5  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+     .  /
+
+
+C	*******************************************************************
+C	Each row identifies the number of days before each month for a
+C	single calendar.  Row must have 'max_months' values.  Fill with 
+C	zeros if necessary.
+C       See output_cals_by.f  to generate this from cals_days_in_month.
+C	*******************************************************************
+	data	cals_days_before_month
+     .	/   
+     1   0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334,
+     2   0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334,
+     3   0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334,
+     4   0,  30,  60,  90, 120, 150, 180, 210, 240, 270, 300, 330,
+     5   0,  31,  60,  91, 121, 152, 182, 213, 244, 274, 305, 335
+     .  /
+
+
+C	*******************************************************************
+C	Each block identifies the month in which the given day appears for
+C       a single calendar.  Each must have 'max_days' values.  Fill with 
+C	zeros if necessary.  
+C       See output_cals_by.f  to generate this from cals_days_in_month
+C	*******************************************************************
+	data	cals_month_by_day
+     .	/   
+C Calendar 1, GREGORIAN
+     .   31*1,  28*2,  31*3, 30*4, 31*5, 30*6, 31*7, 31*8, 30*9,
+     .   31*10, 30*11, 31*12, 0,
+C Calendar 2, NOLEAP
+     .   31*1,  28*2,  31*3, 30*4, 31*5, 30*6, 31*7, 31*8, 30*9,
+     .   31*10, 30*11, 31*12, 0,
+C Calendar 3, JULIAN
+     .   31*1,  28*2,  31*3, 30*4, 31*5, 30*6, 31*7, 31*8, 30*9,
+     .   31*10, 30*11, 31*12, 0,
+C Calendar 4, 360_DAY
+     .   30*1, 30*2, 30*3, 30*4, 30*5, 30*6, 30*7, 30*8, 30*9,
+     .   30*10, 30*11, 30*12, 6*0,
+C Calendar 5, ALL_LEAP
+     .   31*1,  29*2,  31*3, 30*4, 31*5, 30*6, 31*7, 31*8, 30*9,
+     .   31*10, 30*11, 31*12/
+
+      end
diff --git a/ppl/tmapadds/cmdini.F b/ppl/tmapadds/cmdini.F
new file mode 100644
index 0000000..6739ba6
--- /dev/null
+++ b/ppl/tmapadds/cmdini.F
@@ -0,0 +1,188 @@
+	SUBROUTINE CMDINI
+C** 
+C**    @(#)cmdini.F	1.2    5/26/88
+C**
+C**
+C***********************************************************************
+C**
+C**		    PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C**	Subprogram called:
+C**		CALL CMDINI
+C**
+C**	Parameters:
+C**
+C**	Description:
+C**		Initializes the logical units and files necessary for
+C**		both the command file and key file reads.
+C**
+C**	History:
+C**	    Written: 
+C**		26-JAN-86	by Donald W. Denbo
+C**	    Modified:
+C**		30-MAY-1986	by Donald W. Denbo
+C**		  Changes made for VAX/VMS version
+C**
+C**
+        IMPLICIT NONE
+	INCLUDE 'SYSTEM.INC'
+	INCLUDE 'SYMKEY.INC'
+        INCLUDE 'cmdcom_inc.decl'
+	INCLUDE 'CMDCOM.INC'
+        INCLUDE 'lunits_inc.decl'
+	INCLUDE 'LUNITS.INC'
+
+	CHARACTER FROM*80,TO*80,TEMP*2048,LINE*2048,CR*1,ESC*1
+	INTEGER*4 STATUS,IFLAG, IER, IS, itlen, ISTP, ISPC
+
+        INTEGER*4 lnblk
+
+* 1/03 *kob* - g77 port requires that equivalence line comes before 
+*              variable declaration
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+
+	EQUIVALENCE (BUF(1),LINE),(CR,CRB),(ESC,ESCB)
+
+#ifdef STAR_1_SUPPORTED
+	integer*1 BUF(80),CRB,ESCB
+#else
+	BYTE BUF(80),CRB,ESCB
+#endif
+
+	DATA CRB,ESCB/13,27/
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Next two lines' variables init'd in PPLDATA.F *jd* 2.93
+*	DATA ECHOF,DEBUGF,SMKEY2/.TRUE.,.FALSE.,.FALSE./
+*	DATA KEYLN1,KEYLN2,ECHLUN,CMDLUN/21,22,23,24/
+
+c	DATA FROM,TO/'PL5KEY:SYMBOL.KEY','SY:SYSTEM.KEY'/
+C	EQUIVALENCE (BUF(1),LINE),(CR,CRB),(ESC,ESCB)
+C
+#ifndef unix
+	CALL ERRSET(36,.TRUE.,.FALSE.,.TRUE.,.FALSE.)
+#endif
+C
+C	OPEN KEY FILE FOR SYMBOLS
+C
+C**	CALL COPY(FROM,TO,IER)
+C**	IF(IER.NE.0)THEN
+C**	    WRITE(LTTOUT,999)IER
+C**999	    FORMAT(' Symbol key file copy error ',I3)
+C**	    CALL EXIT
+C**	ENDIF
+#ifdef aix
+*	OPEN(KEYLN1,FILE='PPL$KEY.001',STATUS='NEW')
+#else
+# ifdef NO_OPEN_RECORDTYPE
+	OPEN(KEYLN1,FILE='PPL$KEY.001',STATUS='NEW')
+# else
+	OPEN(KEYLN1,FILE='PPL$KEY.001',STATUS='NEW',
+     *  ORGANIZATION='INDEXED',ACCESS='KEYED',
+     *  RECORDTYPE='VARIABLE',FORM='FORMATTED')
+# endif
+#endif
+*	Following not allowed in f77 on DEC -- is it a don't care?? *jd* 2.93
+*     *  KEY=(1:30:CHARACTER))
+C
+C	OPEN ECHO FILE
+C
+#ifdef NO_OPEN_CARRIAGECONTROL
+	OPEN(ECHLUN,FILE='ECHO',STATUS='NEW')
+#else
+	OPEN(ECHLUN,FILE='ECHO',STATUS='NEW',CARRIAGECONTROL='LIST')
+#endif
+
+C
+C	GET COMMAND LINE
+C
+c
+c	rsx-11m
+c
+c	CALL GETMCR(BUF)
+c	ICR=INDEX(LINE,CR)-1
+c	IESC=INDEX(LINE,ESC)-1
+c	ISTP=MAX0(ICR,IESC)
+c	IS=INDEX(LINE,' ')+1
+c	IF(IESC.GT.0)BATCHF=.TRUE.
+c	IF(IS.GE.ISTP.OR.IS.EQ.1)THEN
+c
+c	end rsx-11m
+c
+c	vax/vms
+c
+#ifndef unix
+	STAT=LIB$GET_FOREIGN(LINE,,ISTP)
+#endif
+	IS=1
+	IF(LINE.EQ.' '.OR.ISTP.EQ.0)THEN
+c
+c	end vax/vms
+c
+C
+C	NO FILE NAME READ
+C
+	    FROM='TT:'
+	    LINE=' '
+	    TERMF=.TRUE.
+	ELSE
+	    TEMP=LINE(IS:ISTP)
+	    ISPC=INDEX(TEMP,' ')
+	    IF(ISPC.GT.0)THEN
+		FROM=TEMP(:ISPC-1)
+		LINE=TEMP(ISPC+1:)
+		IS=ISTP-IS+1-ISPC
+	    ELSE
+		FROM=TEMP
+		LINE=' '
+		IS=0
+	    ENDIF
+	    TEMP=FROM
+	    itlen=lnblk(temp,2048)
+	    CALL WLDFLE('SY:.PPC',TEMP(1:itlen),FROM,STATUS,IFLAG)
+	    TERMF=.FALSE.
+	ENDIF
+C
+C	SET COMMAND READ
+C
+	CMDLEV=0
+	CALL ATSTRT(FROM,LINE,IS,IER)
+	RETURN
+	END
diff --git a/ppl/tmapadds/compute_histo_bins.F b/ppl/tmapadds/compute_histo_bins.F
new file mode 100644
index 0000000..fd4cbb1
--- /dev/null
+++ b/ppl/tmapadds/compute_histo_bins.F
@@ -0,0 +1,99 @@
+	SUBROUTINE compute_histo_bins (z, wrk, badz, nsize, status)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+* For histogram-based levels, compute the histogram bins. Sort the data and 
+* compute the color levels so that each color band contains approximately 
+* equal numbers of data points. This form of color management best brings out 
+* the fine structure in the data. 
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        IMPLICIT NONE
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'cont_inc.decl'
+	include 'CONT.INC'
+
+* nlev	number of levels to use, from cont.inc
+* zmin	in hd.inc, min and max of the data
+* zmax
+
+* calling argument declarations:
+	INTEGER nsize, status
+#ifdef double_p
+	REAL*8 z(*), wrk(*), badz
+#else
+	REAL z(*), wrk(*), badz
+#endif
+
+* internal variable declarations:
+
+      INTEGER i, ngood, ibin, n_per_bin
+
+      ngood = 0
+      DO i = 1, nsize
+         wrk(i) = z(i)
+         IF (wrk(i) .NE. badz) ngood = ngood + 1
+      ENDDO
+
+      CALL HEAP2_V (wrk, badz, nsize)
+
+* nlev refers to the edges of the color bins; make the
+* user's input refer to the number of bins.
+
+      nlev = nlev + 1  
+      nlev2 = nlev
+      IF (ngood .LT. nlev) nlev2 = ngood
+
+      n_per_bin = ngood/ (nlev2-1)
+
+      ibin = 1
+      DO i = 1, ngood, n_per_bin
+         zlev(ibin) = wrk(i)
+         ibin = ibin + 1
+      ENDDO
+      zlev(1) = wrk(1)
+      zlev(nlev2) = wrk(ngood)
+
+!      ... could smooth these some.
+
+      IAUTOC = 0  ! levels are already set so dont do it in set_levels.
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/compute_mnstd.F b/ppl/tmapadds/compute_mnstd.F
new file mode 100644
index 0000000..72193f3
--- /dev/null
+++ b/ppl/tmapadds/compute_mnstd.F
@@ -0,0 +1,137 @@
+	SUBROUTINE compute_mnstd(z, badz, need_std, nsize, status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+C**
+C**
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V664:  8/10 - implement robust method for computing variances (bug 1745)
+* V666:  1/11 - fix bug 1778: missing data not treated correctly. Dont use CMZGE,
+*               so variance result is the same as other Ferret variance calculations
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        IMPLICIT NONE
+	include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'cont_inc.decl'
+	include 'CONT.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+
+
+
+* calling argument declarations:
+	LOGICAL need_std
+	INTEGER nsize, status
+#ifdef double_p
+	REAL*8 z(*), badz
+#else
+	REAL z(*), badz
+#endif
+
+* internal variable declarations:
+#ifdef double_p
+	REAL*8 sum, dev, sumsq_dev, variance
+#else
+	REAL sum, dev, sumsq_dev, variance
+#endif
+
+	REAL*8 x, xmean, sum2, sumc, variance_c, xdelta
+	INTEGER i, n
+
+c  Already have zmin, zmax
+
+        IF (.not. need_std .AND. centered) THEN
+	   zstd = lev_std
+	   zmean = 0.
+	   GOTO 5000
+	ENDIF
+
+c Compute data mean.
+
+        sum = 0.0
+        n = 0
+        DO 100 i = 1, nsize
+	   x = z(i)
+	   IF ( x .NE. badz) THEN
+  	      sum = sum + Z(i)
+              n = n + 1
+	   ENDIF
+ 100    CONTINUE
+        IF (n .EQ. 0) GOTO 5000
+#ifdef double_p
+        zmean = sum/DBLE(n)
+#else
+        zmean = sum/FLOAT(n)
+#endif
+
+        IF (need_std) THEN
+
+* Compute variance. See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+
+* On-line algorithm with mean subtracted first. Noted as the most robust.
+* Since we always compute the mean first anyway, use it.
+
+	   n = 0
+	   xmean = 0.D0
+	   sum2 = 0.D0
+ 
+	   DO i = 1, nsize
+	      x = Z(i)
+	      IF ( x .NE. badz) THEN
+                 n = n + 1
+		 x = x - zmean
+                 xdelta = x - xmean
+                 xmean = xmean + xdelta/FLOAT(n)
+                 sum2 = sum2 + xdelta*(x - xmean)  ! This expression uses the new value of mean
+ 	      ENDIF
+	   ENDDO
+           variance_c = sum2/FLOAT(n - 1)
+	   zstd = SQRT(variance_c)
+
+        ENDIF
+
+* If user is resetting the mean, do that here
+	IF (centered) zmean = 0.
+
+ 5000	RETURN
+	
+ 5010   status = 0
+	RETURN
+	END
diff --git a/ppl/tmapadds/daxis_box.F b/ppl/tmapadds/daxis_box.F
new file mode 100644
index 0000000..7f9c7d7
--- /dev/null
+++ b/ppl/tmapadds/daxis_box.F
@@ -0,0 +1,123 @@
+      SUBROUTINE DAXIS_BOX
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* revised for TMAP
+* from PPLUS :
+*	Directory PMEL:[PLOT5.PPLV11.PLOT]DAXIS.FOR
+
+* search for "TMAP" to find all revisions
+* *sh*  - 1/23/89 added interrupt detection from interrupts in lower routines
+*	  	  no explicit declarations - use FORT/WARN=NODECLARATIONS
+* *jd*  - 8.18.95 Modification of DAXIS to draw only the plot border -- no
+*		  tic marks or labels, for FILL & SHADE
+* *jd*  -12.18.96 Add external statement for subroutine SCALE.  Is intrinsic
+*                 function in f90 on linux.
+
+        IMPLICIT NONE
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'labels_inc.decl'
+	include 'LABELS.INC'
+	include 'labcom_inc.decl'
+	include 'LABCOM.INC'
+	include 'hab_inc.decl'
+	include 'HAB.INC'
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'tics_inc.decl'
+	include 'TICS.INC'
+	include 'tics2_inc.decl'
+	include 'TICS2.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	CHARACTER IFX*20,IFY*20
+
+* TMAP interrupt flag
+	include 'xinterrupt.cmn'
+
+CCC     For linux install *jd* 12.96
+        external scale
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+	
+C
+C     DRAW AXIS, LEFT, RIGHT Y AXIS THEN TOP, BOTTOM XAXIS
+C
+
+	IF(IWIND.GT.0)CALL WINDOW(0.,0.,0.,0.)
+
+*	scale axis
+      	call scale(1.,1.,0.,0.,0.,0.)
+
+      IF(MYLEF.EQ.0.AND.IAXON(3).EQ.1)THEN
+	call plot (xorg,yorg,0,0)
+	call plot (xorg,yorg+ylen,1,0)
+      END IF
+
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(IAXON(4).EQ.1)THEN
+	call plot (xorg+xlen,yorg,0,0)
+	call plot (xorg+xlen,yorg+ylen,1,0)
+      ENDIF
+
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(IAXON(1).EQ.1)THEN
+	call plot (xorg,yorg+ylen,0,0)
+	call plot (xorg+xlen,yorg+ylen,1,0)
+      END IF
+
+	IF ( interrupted ) GOTO 3333		! TMAP interrupt
+      IF(MXBOT.EQ.0.AND.IAXON(2).EQ.1)THEN
+	call plot (xorg,yorg,0,0)
+	call plot (xorg+xlen,yorg,1,0)
+      END IF
+
+* TMAP interrupt re-entry
+ 3333	CONTINUE
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/drawpoly.F b/ppl/tmapadds/drawpoly.F
new file mode 100644
index 0000000..9c6d6fa
--- /dev/null
+++ b/ppl/tmapadds/drawpoly.F
@@ -0,0 +1,211 @@
+      subroutine drawpoly(x, y, z, zlev, nlev, nsides, xadd, lmin, lmax)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c:    Extracted from arfill.F
+c:    Output polygon (rectangle or triangle) for contour display.
+c:
+*     v5.81 *acm* 4/05 Changes for FILL/MOD. Draw replications for curvilinear datasets
+*     v6.4  *acm*11/09 For curvi plots, dont buffer polygons of a single color. This 
+*                      resulted in drawing rectangles across what should be curvi portions
+*                      of the grid (bug 1505).
+
+      IMPLICIT NONE
+      real x(*), y(*), z(*)
+      integer i,j,npoly,nlev,nsides 
+      real xadd, lmin, lmax
+      real zlev(nlev)
+      real xpoly(20), ypoly(20),zmin,zmax,f
+c
+        include         'miss_inc.decl'
+        include         'MISS.INC'
+        include         'shade_vars.cmn'
+        include         'xcurvilinear.cmn'
+
+      zmin=  1e30
+      zmax= -1e30
+
+      do 10 i = 1,nsides
+         if ((zle .and. z(i) .le. cmzle)  .or.
+     .        (zeq .and. z(i) .eq. cmzeq)  .or.
+     .        (zge .and. z(i) .ge. cmzge)) then
+            
+            if (.not. buffer_empty) call flush_buffered_fillpoly (xadd,
+     .                    lmin, lmax)
+            return
+         end if
+         
+         zmin=amin1(zmin,z(i))
+         zmax=amax1(zmax,z(i))
+ 10   continue
+      
+      do 100 i = 1, nlev-1
+
+*        ENTIRE CELL IS OUTSIDE PRESET LEVELS
+         if ((zmin.gt.zlev(i+1)) .or. (zmax.lt.zlev(i))) goto 100
+
+*        ENTIRE CELL IS A SINGLE COLOR
+         if ((zmin.ge.zlev(i)) .and. (zmax.le.zlev(i+1))) then
+
+            if ((i .ne. ilast .and. .not. buffer_empty) 
+     .           .or. num_buffered .ge. buffer_max
+     .           .or. curvilinear) then
+
+               call flush_buffered_fillpoly (xadd, lmin, lmax)
+            end if
+
+            call buffer_fillpoly (x, y, nsides, i-1)
+            return
+         endif
+
+*        CELL IS MORE THAN ONE COLOR. FLUSH BUFFER AND FILL IN THIS CELL.
+         if (.not. buffer_empty) call flush_buffered_fillpoly (xadd,
+     .                     lmin, lmax)
+
+         x(nsides+1)=x(1)
+         y(nsides+1)=y(1)
+         z(nsides+1)=z(1)
+         npoly=0
+c
+         do 80 j=1,nsides
+
+            if (z(j).lt.zlev(i)) then
+c
+c z(j) is below
+c
+               if (z(j+1).gt.zlev(i+1)) then
+c
+c z(j+1) is above
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i+1))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+
+               else if ((z(j+1).ge.zlev(i)) .and. 
+     *                 (z(j+1).le.zlev(i+1))) then
+c
+c z(j+1) is inside
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+c
+                  npoly=npoly+1
+                  xpoly(npoly)=x(j+1)
+                  ypoly(npoly)=y(j+1)
+
+               endif
+
+            else if (z(j).gt.zlev(i+1)) then
+c
+c z(j) is above
+c
+               if (z(j+1).lt.zlev(i)) then
+c
+c z(j+1) is below
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i+1))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+
+               else if ((z(j+1).ge.zlev(i)) .and. 
+     *                 (z(j+1).le.zlev(i+1))) then
+c
+c z(j+1) is inside
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i+1))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+c
+                  npoly=npoly+1
+                  xpoly(npoly)=x(j+1)
+                  ypoly(npoly)=y(j+1)
+
+               endif
+
+            else
+c
+c z(j) is inside
+c
+               if (z(j+1).gt.zlev(i+1)) then
+c
+c z(j+1) is above
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i+1))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+
+               else if(z(j+1).lt.zlev(i))then
+c
+c z(j+1) is below
+c
+                  npoly=npoly+1
+                  f=(z(j)-zlev(i))/(z(j)-z(j+1))
+                  xpoly(npoly)=x(j) - f*(x(j)-x(j+1))
+                  ypoly(npoly)=y(j) - f*(y(j)-y(j+1))
+
+               else
+c
+c z(j+1) is inside
+c
+                  npoly=npoly+1
+                  xpoly(npoly)=x(j+1)
+                  ypoly(npoly)=y(j+1)
+
+               endif
+
+            endif
+
+ 80      continue
+
+         call fillpoly(xpoly, ypoly, npoly, i-1, xadd, lmin, lmax)
+
+ 100   continue
+
+      return 
+      end
diff --git a/ppl/tmapadds/fillpol.F b/ppl/tmapadds/fillpol.F
new file mode 100644
index 0000000..e34b419
--- /dev/null
+++ b/ppl/tmapadds/fillpol.F
@@ -0,0 +1,399 @@
+	SUBROUTINE FILLPOL(X,NXS,XF,YF)
+C** 
+C**    @(#)fillpol.F	1.0    11/30/97
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C
+C  ARRAY X HOLDS X AND Y'S FOR ALL LINES.  DIMENSIONED FOR NXS+npoly
+C  ORDER AS FOLLOWS:  ALL X'S FOR LINE1, ALL X'S FOR LINE2,...
+C                     STARTING AT X(NXS/2+1), ALL Y'S FOR LINE1,
+C                     ALL Y'S FOR LINE2...
+C  XF AND YF ARE FACTORS TO CONVERT TO INCHES FROM USER UNITS
+C
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	*sh* 11/97 based on SHADESUB and PLOTXY
+*
+* *kob* 3/28/99 - declare subroutine range as external, otherwise F90 tries to
+*                 use it as an intrinsic function - more cleanup work
+* V510 *sh* 3/00 - changes to accomodate NPOLYGON > NLINES
+*		 - involved eliminating CALL TRANS, which means that there
+*			isn't a need to copy the X,y coords to x/ypolybase
+* V510 4/00 *sh - corrected faulty logic for centered levels (delta wrong)
+* V552 3/03 *acm* allow clipping to be set on or off via IWIND (ppl window off)
+* V552 3/03 *acm* Check for too many levels, as is done for FILL and CONTOUR plots.
+* V553 *acm*  6/03  For polygons, store the # of points in each polygon in the PPLUS
+*                   memory buffer, rather than in lleng.  This way the number of
+*                   polygons that may be plotted is unlimited. 
+* v554 *acm*  2/04  After levels are set, call setlab_syms to set the LEVELS symbols
+
+* v570  4/04*acm* Fix for the section marked correction for rounding errors. 
+*                 Use TM_FPEQ_SNGL to see if values are equal or close.  Also fixes 
+*                 this adjustment when the range has negative values; was incorrect.
+* v580  8/04*acm* Fix bug 957 poly/lev=1 of a constant field needs zlev(1) to be set.
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* V600 *acm* 8/06 Fix bugs 843, 844: poly/line and reversed axes. Apply xinv and
+*                 yinv to coordinates when drawing the lines.
+* V62  *acm* 5/09 Fixing bug 1661: if the plot is TRANSPOSED, then apply 
+*                 xinv, yinv to the opposite axis.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        IMPLICIT NONE
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+        INTEGER NXS
+	REAL X(*), XF, YF
+
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'pltl_inc.decl'
+        include 'PLTL.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'taxis_inc.decl'
+        include 'TAXIS.INC'
+        include 'axisl_inc.decl'
+        include 'AXISL.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'gkscm1_inc.decl'	! sh 11/97
+        include 'GKSCM1.INC'		! sh 11/97
+!        include 'gkscm2.cmn' ! jd 3.22.89
+        include 'gkspar.inc'	! sh 11/97
+        include 'shade_vars.cmn'	! sh 11/97
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+        include         'errmsg.parm'
+	include 'PPLDAT.INC'		! with ibase
+	include 'vector_inc.decl' ! with TRANSPZ
+        include 'VECTOR.INC'
+
+
+* 3/99 *kob*
+	EXTERNAL RANGE
+
+	INTEGER xpolybase, ypolybase, zpolybase, polysizemax, nl,
+     .		nvertex, fill_ndx, xvertexbase			! 11/97
+
+	INTEGER GET_NDX
+
+* GKS initialization vars
+* v491 *kob* removed unnecessary variable declarations
+	integer		error,trans_no,cflag
+        integer         my_trans
+        data            my_trans/20/
+	real	 	w(4),v(4),ndc(4),uc(4)
+	real		xinv,yinv, tmp
+
+*jd*
+	real            zzmin, zzmax, zt
+	integer         status, nlm1
+	real		dz,znp,zmp
+	integer		i,j,uprdn, llen, ptsbase
+	logical         line_it, fill_it
+        integer         slen1, slen2, ICNT, ii, IY
+        CHARACTER       TM_FMT_SNGL*20, buff1*20, buff2*20, err_msg*40
+
+        real             epsilon
+        parameter       (epsilon = 1e-6)
+
+*************************************
+
+C       Check switches
+	line_it = sline
+	
+	if (sline .and. sfill) then
+	   fill_it = .true.
+	else if (sline .and. .not. sfill) then
+	   fill_it = .false.
+	else
+	   fill_it = .true.
+	end if
+
+* INITIALIZE
+	nl = lnum - 1	! # lines over which to loop: last line is color info
+
+* determine temp memory buffer location for points translated to plot coords
+* ... layout is xline1, xline2, ..., xlinenl, xcolor , bufferspace ...
+*               yline1, yline2, ..., ylinenl, ycolor , bufferspace ...
+*     "zpolybase" is the offset to the ycolor array
+	xpolybase = 1
+        ptsbase = ibase - lnum 
+	DO 2010  I=1,nl
+        llen = x(ptsbase+i-1)
+ 2010	xpolybase = xpolybase+llen
+
+        llen = x(ibase-1)      ! Length of color array
+
+	zpolybase = ptsbase - llen - 1 + nxs/2
+	xpolybase = xpolybase + llen	! skip past color array
+	ypolybase = xpolybase + nxs/2
+
+        xvertexbase = xpolybase + lnum	! skip past list of lengths
+
+	polysizemax = nxs - ypolybase	! unused buffer space
+	fill_ndx = 0
+
+* set up GKS environment (code copied from SHADE_SUB)
+
+*	GET PROPER SCALING, NDC COORDINATES, ETC FOR FILL
+	call FGD_GQCNTN(error,trans_no)
+	if (error .ne. 0) goto 1100
+
+	call FGD_GQNT(trans_no,error,w,v)
+	if (error .ne. 0) goto 1100
+
+	call get_user_coords (w,v,ndc,uc,xinv,yinv)
+	
+* Fixing bug 1661: if the plot is TRANSPOSED, then apply this
+* fix to the opposite axis.
+
+	IF (trnspz) THEN
+	   tmp = xinv
+	   xinv = yinv
+	   yinv = tmp
+	ENDIF
+
+*	NOW SET THE CLIPPING RECTANGLE AROUND THEM AND PATTERN SIZE
+* v4.91 *kob* had to add <cr> after first line below
+
+	call FGD_GSWN(my_trans,uc(1)*xinv,uc(2)*xinv,uc(3)*yinv,uc(4)*yinv)
+        call FGD_GSVP(my_trans,ndc(1),ndc(2),ndc(3),ndc(4))
+	if (fill_it) call FGD_GSELNT(my_trans)
+
+	call FGD_GQCLIP(error,cflag,ndc)
+	if (error .ne. 0) goto 1000
+	if (cflag .NE. iwind) call FGD_GSCLIP(iwind)
+
+*************************************
+
+* original PLOT+ code 
+	IBASE=0
+	IY=NXS/2
+	ZT=YF/XF
+	ICNT=1
+	IF(M.GE.2.AND.IFLG(2).NE.0)ICNT=P(2)
+
+C *jd* 
+* FIND LIMITS
+	zmin = 1e33
+	zmax = -1e33
+	zzmin = 1e33
+	zzmax = -1e33
+	nlm1  = nl - 1
+
+cc	do 100 i = 0, nlm1 	      
+cc	   if (ZEQ.AND.x(zpolybase+i).EQ.CMZEQ) GOTO 100
+cc	   if (x(zpolybase+i) .gt. zzmax) zzmax = x(zpolybase+i)
+cc	   if (x(zpolybase+i) .lt. zzmin) zzmin = x(zpolybase+i)
+cc 100	end do
+
+	do 100 i = 0, nlm1 	      
+	   if (ZEQ.AND.x(zpolybase+1+i).EQ.CMZEQ) GOTO 101
+	   if (x(zpolybase+1+i) .gt. zzmax) zzmax = x(zpolybase+1+i)
+	   if (x(zpolybase+1+i) .lt. zzmin) zzmin = x(zpolybase+1+i)
+ 101       continue
+ 100	end do
+
+        IF (zzmin .NE. 1e33) zmin = zzmin  ! Needed for annotating open-ended levels
+        IF (zzmax .NE. -1e33) zmax = zzmax
+
+C  Set the contour/color levels
+C  ... here we need to call SET_LEVELS_SHADE_FILL if IAUTOC EQ 0 -- levs have been
+C      set already.
+
+        IF (IAUTOC .EQ. 0 .OR. 
+     .      ((zzmin .NE. 1e33) .AND. (zzmax .NE. -1e33)) ) THEN
+           CALL SET_LEVELS_SHADE_FILL (status)
+           IF (status .NE. ferr_ok) GOTO 5000
+	ELSE
+	   IF (sover) THEN
+	      IF (zzmin .EQ. 1e33) zmin = 1e36
+	      IF (zzmax .EQ. -1e33) zma x= CMZLE - 10
+	      CALL SET_LEVELS_SHADE_FILL (status)  !?
+	   ENDIF 
+	ENDIF
+
+*	DETERMINE PATTERNS OR COLORS TO SET BUNDLED FILL AREA REPRESENTATIONS
+
+*       Allow shading single level fields 
+        if (nlev2 .lt. 1) goto 1000
+        shd_levels = max (nlev2 - 1,1)
+
+	call set_fill_area_rep (wsid,wstype)
+
+	CALL MARKH(HMARK(1))
+	CALL COLOR(IPEN(1))
+
+******** LOOP OVER LINES STORED
+
+	DO 200 I=1,nl
+          llen = x(ptsbase+i-1)
+* will this polygon fit in the buffer?
+	  IF (llen .GT. polysizemax) THEN
+	     WRITE (6,*) 'Too much polygon data to plot at once'
+	     GOTO 200
+	  ENDIF 
+
+* assemble the vertices into arrays in units of plot coordinates
+* note: all points in the polygon are guaranteed to be "valid"
+	   nvertex = 0
+
+	   DO 150 J=IBASE+1,IBASE+llen
+!	      CALL TRANS(I,X(J),X(IY+J),XT,YT)
+!	      nvertex = nvertex + 1
+!	      x(xvertexbase+nvertex-1) = xt
+!	      x(ypolybase+nvertex-1) = yt
+	      nvertex = nvertex + 1
+	      x(xvertexbase+nvertex-1) = x(j)
+	      x(ypolybase+nvertex-1) = x(iy+j)
+ 150	   CONTINUE
+
+	   if (fill_it) then
+*             Determine the color index for the fill
+	      if (ZEQ.AND.x(zpolybase+i).EQ.CMZEQ) GOTO 157
+
+	      fill_ndx = GET_NDX (x(zpolybase+i),fill_ndx)
+	      if (fill_ndx .eq. -999) goto 157
+
+*             Draw the filled polygon
+	      CALL SET_FILL_NDX (fill_ndx)
+
+	      IF ( XEQ ) THEN 
+	         do 155 j = xvertexbase, xvertexbase+nvertex-1
+		    IF (X(J).EQ.CMXEQ) GOTO 157
+ 155	         continue
+	      ENDIF
+
+	      IF ( YEQ ) THEN 
+	         do 156 j = ypolybase, ypolybase+nvertex-1
+		    IF (X(J).EQ.CMYEQ) GOTO 157
+ 156	         continue
+	      ENDIF
+
+	      if (nvertex .gt. 2) then
+		 if (line_it) call FGD_GSELNT(my_trans)
+		 CALL FGD_GFA(nvertex, x(xvertexbase), x(ypolybase)) 
+	      end if
+	   end if
+
+ 157	   if (line_it) then
+*             Outline the polygon
+
+	      nvertex = 0
+	      DO 158 J=IBASE+1,IBASE+llen
+		 nvertex = nvertex + 1
+		 IF (XEQ.AND.X(xvertexbase+nvertex-1).EQ.CMXEQ) GOTO 199
+		 IF (YEQ.AND.X(ypolybase+nvertex-1).EQ.CMYEQ) GOTO 199
+ 158	      CONTINUE
+
+	      if (fill_it) call FGD_GSELNT(trans_no)
+	      nvertex = 0
+
+	      DO 160 J=IBASE+1,IBASE+llen
+		 nvertex = nvertex + 1
+		 if (nvertex .eq. 1) then
+		    uprdn = 0
+		 else
+		    uprdn = 1
+		 end if
+		 call plot (xinv*x(xvertexbase+nvertex-1),
+     .	                    yinv*x(ypolybase+nvertex-1),uprdn,0)
+ 160	      continue
+	      call plot (xinv*x(xvertexbase), yinv*x(ypolybase),1,0)
+	   end if
+
+	   if (interrupted) go to 1000 !*jd* 8.3.92
+ 199    IBASE=IBASE+llen	! prepare for next line
+ 200	CONTINUE
+
+******** END OF LOOP OVER LINES STORED
+
+
+* ... restore GKS transforms following FILLPOL 
+ 1000   call FGD_GSELNT(trans_no)
+        call FGD_GSCLIP(cflag)
+
+* ... and DO THE KEY
+	if (fill_it .and. do_key .AND. .NOT.interrupted) then
+	   call color(ipen(0))
+	   call key
+	end if
+
+ 1100	CALL COLOR(IPEN(0))
+
+* We use lnum as a counter, but we do not use the lleng array
+* or other contstructs that used to treat each polygon as a plot line.
+ 
+        lnum = 1
+
+	RETURN
+
+C  Error exit when too many levels specified.
+C  Arrays LWGT, LDIG, and ZLEV are length ICNLEV=500
+
+ 5000   ii = ICNLEV
+        buff1 = TM_FMT_SNGL (REAL(ICNLEV), 20, 20, slen1)
+        buff2 = TM_FMT_SNGL (REAL(NLEV2), 20, 20, slen2)
+        err_msg = '# of levels > '// buff1(1:slen1) //
+     .          '  (' // buff2(1:slen2) // ')'
+        CALL errmsg (ferr_out_of_range, status, err_msg, *5002)
+ 5002   return
+
+	END
+
+
+
diff --git a/ppl/tmapadds/fillpoly.F b/ppl/tmapadds/fillpoly.F
new file mode 100644
index 0000000..3ed68da
--- /dev/null
+++ b/ppl/tmapadds/fillpoly.F
@@ -0,0 +1,389 @@
+**   subroutine fillpoly(x,y,npts,index) *jc*
+
+      subroutine fillpoly(xarg,yarg,npts,index,xadd,lmin,lmax)
+
+      IMPLICIT NONE
+      real xarg(*),yarg(*)
+      integer npts,index
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+C** 
+C**    @(#)fillpoly.F	1.2   1/27/91
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C      lots of places ---> PPLMOD_PPLCMD ---> PPLMOD_PLTIT 
+C              ---> PPLMOD_PLOTZ ---> PPLMOD_ARFILL ---> PPLMOD_FILLPOLY
+C       
+C
+C     call fillpoly(x,y,npts,index)
+C
+C     This subroutine creates a color filled convex polygon using the
+C     using the coordinates.
+C
+C     THE VARIOUS PARAMETERS AND THEIR DEFINITIONS ARE LISTED
+C     BELOW:
+C        X,Y    - COORDINATES OF THE POLYGON`S CORNERS IN USER'S UNITS.
+*	 ?? jd ?? Coordinates in inches from origin == nouser ??
+
+C        npts   - number of vertices
+C        index  - color index (0 - max_color)
+C
+C
+
+*	MOD *JD* to include in TMAP PPL+ 1.14.92
+*	Mod *jd* 10.12.92 for new hatching scheme
+*	Mod *jd* 11.09.92 to get viewport size right for clipping
+*     V4.50 *jc* 04.25.97 add 'curvilinear' capability
+*                'x' and 'y' are  arrays of 50 to match xt, yt, etc.
+*                (What is the maximum number of vertices in a polygon?)
+*       Mod *jd* 02.16.99 Make arrays 128 not 50 for better FILL optimization
+*     v5.51 *acm* 2/3/03 Get viewport sizing as in shade routines, using
+*                        gks calls; else the clipping is wrong for fill 
+*                        plots in viewports that were defined with /AXES.
+*     v5.81 *acm* 4/05 Changes for FILL/MOD. Draw replications for curvilinear datasets
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+#ifdef double_p
+      real*8 x(128),y(128), xplus
+#else
+      real x(128),y(128), xplus
+#endif
+      real xt(128),yt(128),xc(128),yc(128),xtrns,ytrns
+      integer i,nout,fill_ndx
+      real xadd, lmin, lmax
+
+	include 'PLTCOM.DAT'
+	include 'pltcom_dat.decl'
+	include 'shade_vars.cmn'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'
+        include 'gkscm2.cmn' 
+        INCLUDE 'gkspar.inc'
+        include 'xcurvilinear.cmn'
+	include 'ppl_in_ferret.cmn'	
+
+      common/plyclp/acmin,acmax,bcmin,bcmax
+      real acmin,acmax,bcmin,bcmax
+
+      real vwidth,vheight,amax2,bmax2
+
+*  From shade_sub; to use GKS calls to get scaling 
+
+	INTEGER		error, trans_no, status
+	REAL	 	w(4), v(4), wc(4)
+
+	xplus = xadd
+
+*     Get viewport width and height in ferret; otherwise leave it alone
+
+      IF (ppl_in_ferret) THEN
+
+*    Do scaling as in shade_sub, using gks calls.
+*    Get proper scaling, world coordinates, etc for fill
+
+	CALL FGD_GQCNTN(error,trans_no)
+	IF (error .NE. 0) GOTO 1000
+	CALL FGD_GQNT(trans_no,error,w,v)
+	IF (error .NE. 0) GOTO 1000
+
+*     Get world coordinates for for clipping region.
+
+	CALL get_world_coords (w,v,wc)
+
+      else
+	 amax2 = amax
+	 bmax2 = bmax
+      endif
+
+
+*     We're not sure if the xarg and yarg indices are needed in the calling routine
+*     so copy all of the values to the x() and y() arrays.
+*
+*     pplmod_fillpoly doesn't use the 'inverse' flag.  (Should it?)
+         DO 1 i=1,npts
+#ifdef double_p
+            x(i) = DBLE(xarg(i))
+            y(i) = DBLE(yarg(i))
+#else
+            x(i) = xarg(i)
+            y(i) = yarg(i)
+#endif
+ 1       CONTINUE 
+         
+*     Curvilinear section
+      IF (curvilinear) THEN
+
+         CALL CURV_COORD(x, y, npts, 1.0, 1.0, status) ! xform the pts
+	 IF (curv_missing) RETURN
+
+* add offset for modulo transformation.
+
+           DO 48, i = 1, npts
+              x(i) = x(i) + xplus
+ 48        CONTINUE
+
+* What is the max and min x coordinate value covered by this call?
+
+           DO 49, i = 1, npts
+              lmin = MIN(lmin, x(i))
+              lmax = MAX(lmax, x(i))
+ 49        CONTINUE
+      ENDIF
+c
+c scale and transform the vertices
+
+*jd* begin -- temporary -- no projections permitted
+
+      do 5 i=1,npts
+
+	    if (itypex .gt. 1) then
+	       xtemp = xlen*log10(x(i)/xlo)/log10(xhi/xlo)
+	    else
+	       xtemp = xlen*(x(i) - xlo)/(xhi-xlo)
+	    endif
+
+	    if (itypey .gt. 1) then
+	       ytemp = ylen*log10(y(i)/ylo)/log10(yhi/ylo)
+	    else
+	       ytemp = ylen*(y(i) - ylo)/(yhi-ylo)
+	    endif
+
+            XTEMP = xtemp * XSCALE
+            YTEMP = ytemp * YSCALE
+*         endif
+c
+         call tform(xtemp,ytemp,ztemp)
+         xt(i)=anew
+         yt(i)=bnew
+c
+ 5    continue
+c
+c find clipping region
+c
+      if(windof)then
+         acmin = wc(1)
+         acmax = wc(2)
+         bcmin = wc(3)
+         bcmax = wc(4)
+      else
+         acmin = amin
+         acmax = amax2
+         bcmin = bmin
+         bcmax = bmax2
+      endif
+c
+c clip polygon
+c
+      call clippoly(xt,yt,npts,xc,yc,nout)
+c
+      if(nout.eq.0) return
+c
+
+*jd begin
+	fill_ndx = index + 2
+
+	call set_fill_ndx (fill_ndx) 
+	call FGD_GFA(nout,xc,yc)
+
+*      goto (10,50,30,10,10,20,20),ptype+3
+*c
+*c tekterminal
+*c
+* 10   goto 100
+*c
+*c window device X11
+*c
+*#ifdef X11
+* 20   if(havex)then
+*         if(.not.gksopn)then
+*            call xwinit
+*         endif
+*         call fillpolyx(xc,yc,nout,index)
+*      endif
+*#else
+* 20   continue
+*#endif
+*c
+*c check for other devices
+*c
+*100   goto (50,50,50,50,30,50,30),ptype+3
+*c
+*c meta file
+*c
+* 30   if(wrtclr)then
+*c
+*c write color map
+*c
+*         wrtclr=.false.
+*         call binbuf(float(numclr),-2.)
+*         do 31 i=1,numclr,2
+*            call binbuf(float(rdclr(i)),float(rdclr(i+1)))
+* 31      continue
+*         do 32 i=1,numclr,2
+*            call binbuf(float(grnclr(i)),float(grnclr(i+1)))
+* 32      continue
+*         do 33 i=1,numclr,2
+*            call binbuf(float(blclr(i)),float(blclr(i+1)))
+* 33      continue
+*      endif
+*c
+*c write poly
+*c
+*      call binbuf(float(index),-3.)
+*      call binbuf(float(nout),-3.)
+*      do 34 i=1,nout
+*         call binbuf(xc(i),yc(i))
+* 34   continue
+*c
+*jd end
+
+ 50   return
+*     FATAL ERROR
+1000  RETURN
+      END
+c
+c
+c
+      subroutine clippoly(xt,yt,npts,xc,yc,nout)
+
+      IMPLICIT NONE
+      real xt(*),yt(*),xc(*),yc(*)
+      integer npts,nout
+c
+      real x,y
+      logical inregion
+      integer i0,i1
+
+      nout = 0
+      do 10 i0 = 1,npts
+         i1 = i0+1
+         if(i1.gt.npts)i1=1
+         if(inregion(xt(i0),yt(i0))) then
+            call putunique(xt(i0),yt(i0),xc,yc,nout)
+            if(inregion(xt(i1),yt(i1)))then
+               call putunique(xt(i1),yt(i1),xc,yc,nout)
+            else
+               call getinterp(xt(i0),yt(i0),xt(i1),yt(i1),x,y)
+               call putunique(x,y,xc,yc,nout)
+            endif
+         else
+            if(inregion(xt(i1),yt(i1))) then
+               call getinterp(xt(i1),yt(i1),xt(i0),yt(i0),x,y)
+               call putunique(x,y,xc,yc,nout)
+               call putunique(xt(i1),yt(i1),xc,yc,nout)
+            endif
+         endif
+ 10   continue
+
+      if(nout .le. 2) nout = 0
+      return
+      end
+c
+c
+c
+      logical function inregion(x,y)
+
+      IMPLICIT NONE
+      real x,y
+c
+      common/plyclp/acmin,acmax,bcmin,bcmax
+      real acmin,acmax,bcmin,bcmax
+c
+      inregion = ((x.ge.acmin) .and. (x.le.acmax)) .and. 
+     *           ((y.ge.bcmin) .and. (y.le.bcmax))
+      return
+      end
+c
+c
+c
+      subroutine putunique(x, y, xc, yc, nout)
+
+      IMPLICIT NONE
+      real x,y,xc(*),yc(*)
+      integer nout,i
+c
+      if(nout .eq. 0) goto 100
+      do 10 i=1,nout
+         if((x.eq.xc(i)) .and. (y.eq.yc(i)))return
+ 10   continue
+ 100  nout = nout + 1
+      xc(nout)=x
+      yc(nout)=y
+      return
+      end
+c
+c
+c
+      subroutine getinterp(xin,yin,xout,yout,x,y)
+
+      IMPLICIT NONE
+      real xin,yin,xout,yout,x,y
+c
+      common/plyclp/acmin,acmax,bcmin,bcmax
+      real acmin,acmax,bcmin,bcmax
+c
+      real f
+c
+      if(xout.lt.acmin)then
+         f = (acmin - xin)/(xout - xin)
+      else if(xout.gt.acmax) then
+         f = (acmax - xin)/(xout - xin)
+      else
+         goto 100
+      endif
+      x = xin + (f * (xout - xin))
+      y = yin + (f * (yout - yin))
+      if((y.ge.bcmin).and.(y.le.bcmax))return
+ 100  if(yout.lt.bcmin) then
+         f = (bcmin - yin)/(yout - yin)
+      else
+         f = (bcmax - yin)/(yout - yin)
+      endif
+      x = xin + (f * (xout - xin))
+      y = yin + (f * (yout - yin))
+      return
+      end
+
+
diff --git a/ppl/tmapadds/flowline.F b/ppl/tmapadds/flowline.F
new file mode 100644
index 0000000..fc0bf84
--- /dev/null
+++ b/ppl/tmapadds/flowline.F
@@ -0,0 +1,118 @@
+        SUBROUTINE flowline (u, v, flag, nxs, nys, px, py, xf, yf)
+
+
+C**
+C**    @(#)flowline.F	    9/19/00
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  ACM  implementing algorighm from grads -- gxstrm.c
+*       draw flowlines 
+
+C  From GrADS code, gxstrm.c
+C  and based on vecfld.F
+
+C void gxstrm (float *u, float *v, float *c, int is, int js,
+C   float uund, float vund, float cund, int flag, float *shdlvs,
+C   int *shdcls, int shdcnt, int den) 
+
+
+*  v4 2-oct-01 remove VMS includes
+*  ACM 12/01  remove ref to jscl; not used.
+*  ACM 12/01  remove GET_MEMORY call.  This is now done, with other 
+*             PPLUS memory allocation, in disp_set_up.F on the call 
+*             from xeq_vector.  Also clean up the declarations.
+* ACM  9/9/02 Make px and py declarations px(*); for regular grids these
+*             are dummy arrays.
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. (not implemented in flowline plots)
+
+
+        IMPLICIT NONE
+	include		'parampl5_dat.decl'
+	include		'PARAMPL5.DAT'
+
+	include 'tmap_dims.parm'
+	include 'ferret.parm'
+	include 'errmsg.parm'
+	include 'vector_inc.decl'
+	include 'VECTOR.INC'
+        INCLUDE 'xcurvilinear.cmn'
+
+
+*******************************************************************************
+
+
+C  Calling argument declarations
+
+      REAL xf, yf, px(*),py(*)
+      REAL U(NXS,NYS),V(NXS,NYS), FLAG(*)
+      INTEGER nxs, nys
+
+C  Local declarations
+
+      INTEGER siz, i, iscl, jscl, status
+
+
+C   Size of the flag grid, allocated in disp_set_up.F
+
+      i = MAX(NXS,NYS)
+      iscl = 200/i
+      iscl = iscl + density - 5
+      IF (iscl .LT.  1) iscl = 1
+      IF (iscl .GT. 10) iscl =10
+
+      siz = i*i*iscl*iscl + i*iscl   ! see ii1index in flowline_sub
+
+      CALL flowline_sub (u, v, flag, siz, density, nxs, nys, 
+     .                   px, py, xf, yf)
+
+      IF (curv_missing) THEN
+ 5100	 CALL ERRMSG(ferr_not_implemented, status,
+     .     'Missing curvilienar coordinate data in VECTOR/FLOW command', 
+     .     *5000)
+      ENDIF
+ 5000 RETURN
+
+      END
diff --git a/ppl/tmapadds/flowline_sub.F b/ppl/tmapadds/flowline_sub.F
new file mode 100644
index 0000000..196871a
--- /dev/null
+++ b/ppl/tmapadds/flowline_sub.F
@@ -0,0 +1,867 @@
+      SUBROUTINE flowline_sub (u, v, startflag, siz, den, nxs, nys,
+     .                         px, py, xf, yf)
+
+
+C**
+C**    @(#)flowline_sub.F	    10/03/00
+C**
+C**
+C***********************************************************************
+C**
+C**              PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  ACM  From vecfld.F  9/00
+*       and from GrADS module gxstrm.c
+*       Draw flowlines based on a velocity field.
+*  ACM  June 08, 2001  remove extra declaration of i, and
+*       change MAX(1, x + 1) to MAX(1., x + 1)
+*  ACM  Aug 2001 remove subroutine strmar to separate file (arrow-drawing)
+*      *acm* 10/01  remove VMS includes
+*  ACM  12/01 bug fix: jjndex not jjindex!
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+        IMPLICIT NONE
+        include 'ferret.parm'
+        include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+        include 'lines_inc.decl'
+        include 'LINES.INC'
+        include 'pen_inc.decl'
+        include 'PEN.INC'
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'miss_inc.decl'
+        include 'MISS.INC'
+        include 'switch_inc.decl'
+        include 'SWITCH.INC'
+        include 'hd_inc.decl'
+        include 'HD.INC'
+        include 'axis_inc.decl'
+        include 'AXIS.INC'
+        include 'labcom_inc.decl'
+        include 'LABCOM.INC'
+        include 'vector_inc.decl'
+        include 'VECTOR.INC'
+        include 'xcurvilinear.cmn'
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+
+
+*******************************************************************************
+
+
+
+C	ARRAY X HOLD 2 GRIDS, U(X) IN THE FIRST
+C	NX BY NY GRID AND V(Y) IN THE SECOND
+C       startflag is a work array.
+C
+C  Calling argument declarations
+
+      INTEGER siz, den, nxs, nys
+      REAL xf, yf, px(nxs),py(nys), u(nx,ny), v(nx,ny), startflag(*)
+
+C  From from GrADS module gxstrm.c
+C See http://grads.sourcearchive.com/documentation/2.0.a7.1-3/main.html 
+C void gxstrm (float *u, float *v, float *c, int is, int js,
+C   float uund, float vund, float cund, int flag, float *shdlvs,
+C   int *shdcls, int shdcnt, int den)
+
+C  Changes:
+C  Trans to Fortran
+C  No colorizing the lines
+C  Curvlinear coordinate transformation
+C  Allow irregular grids  (ITYPE not -1)
+
+C  Local declarations
+      INTEGER is, js
+
+      REAL up, vp, x, y, xx, yy, uv1, uv2, uv, vv1, vv2, vv, auv, avv, 
+     .     xsav, ysav, xold, yold, fact, rscl, xxsv, yysv, xtm, ytm, 
+     .     xtx, ytx, upsv, vpsv, xup, yup, xinterp, yinterp, 
+     .     vel, velmean, sqsum, cos_factor, dx, dy, count, sd, xxc, yyc,
+     .     upi, upj, upij, vpi, vpj, vpij, xfuser, yfuser, ylousr,
+     .     xlousr, xt, yt, xx1, yy1, xl, yl, vfact
+      INTEGER LNBLK, TM_LENSTR1, 
+     .     i, i1, ii, jj, ii1, ij1, i2, j2, mx, my, ipt, acnt, icol, 
+     .     scol, dis, iindex, jjndex, ii1index, iacc, iisav, iscl, imn, 
+     .     jmn, j, iz, jz, iss, jss, imx, jmx, iln, slen
+      LOGICAL TM_FPEQ_SNGL, bflg
+
+      CHARACTER*120 veclab, buff, symbuff
+      EXTERNAL lnblk
+
+C     Curvilinear coordinates declarations
+      INTEGER status
+#ifdef double_p
+      REAL*8 x_curv, y_curv
+#else
+      REAL x_curv, y_curv
+#endif
+
+C First check that the curvilinear coordinate data is all present and accounted for.
+
+      curv_missing = .FALSE.
+      IF (curvilinear) THEN
+         do j = 1, ny
+         do i = 1, nx
+            x_curv = i
+	    y_curv = j
+	    CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+	    IF (curv_missing) GOTO 5100
+	 enddo
+	 enddo
+      ENDIF
+
+C  From vector
+      CALL COLOR(IPEN(1))
+
+*  Get offset for true grid
+
+      CALL trans(0,xmin,ymin,xtm,ytm)
+      CALL trans(0,xmax,ymax,xtx,ytx)
+
+      dx=(xtx-xtm)/MAX(nx-1,1)
+      dy=(ytx-ytm)/MAX(ny-1,1)
+
+      scol = -9
+      icol = 1
+
+      is = nx
+      js = ny
+
+C   Figure out the interval for the flag grid
+
+      i = nx
+      IF (ny .GT. i) i = ny
+      iscl = 200/i
+      iscl = iscl + den - 5
+      if (iscl .LT. 1) iscl=1
+      if (iscl .GT. 10) iscl=10
+      fact = 0.5/REAL(iscl)
+      rscl = REAL(iscl)
+ 
+      iss = nx*iscl
+      jss = ny*iscl
+
+C  Get mean velocity for scaling the arrows
+
+      sqsum = 0.
+      vel = 0.
+      velmean = 0.
+      count = 0.
+      DO i = 1, nx
+         DO j = 1, ny 
+            up = u(i,j)
+            vp = v(i,j)
+            IF (ZLE .AND. (up .LE. CMZLE .OR. vp .LE. CMZLE)) GO TO 89
+            IF (ZEQ .AND. (up .EQ. CMZEQ .OR. vp .EQ. CMZEQ)) GO TO 89
+            IF (ZGE .AND. (up .GE. CMZGE .OR. vp .GE. CMZGE)) GO TO 89
+
+            vel = up*up + vp*vp
+            sqsum = sqsum + vel
+            vel = sqrt(vel)
+
+            vel = max(vel, vel)
+            velmean = velmean + vel
+            count = count + 1.
+
+  89        CONTINUE
+         ENDDO
+      ENDDO 
+      IF (count .GT. 0.) THEN
+        velmean = velmean/ count
+        sd = sqrt(sqsum/ count - velmean* velmean)
+      ENDIF
+
+      IF (vauto) THEN
+         vfact = 2./velmean
+      ELSE
+         vfact = 2./vusrln
+      ENDIF
+
+C  Initialize the flag grid
+
+      DO i = 1, siz
+         startflag(i) = 0.
+      ENDDO
+
+C   Loop through flag grid to look for start of flowlines.  
+C     To start requires no flowlines drawn within surrounding 
+C     flag boxes. 
+
+      i2 = 1
+      j2 = 1
+      DO i=1, siz
+         dis = 2
+         IF (den .LT. 5) dis = 3
+         IF (den .GT. 5) dis = 1
+         imn = i2 - dis
+         imx = i2 + dis + 1 
+         jmn = j2 - dis
+         jmx = j2 + dis + 1
+         IF (imn .LT. 1) imn = 1
+         IF (imx .GT. iss) imx = iss
+         IF (jmn .LT. 1) jmn = 1
+         IF (jmx .GT. jss) jmx = jss
+         iacc = 0
+         DO jz = jmn, jmx
+            ipt = jz*iss + imn
+            DO iz = imn, imx
+              iacc = iacc + INT(startflag(ipt))
+              ipt = ipt + 1
+            ENDDO
+         ENDDO
+         IF (iacc .EQ. 0) THEN
+            x = REAL((i2-1))/rscl
+            y = REAL((j2-1))/rscl
+
+            xsav = x
+            ysav = y
+
+            IF(JTYPE.EQ.-1)THEN
+               xx = dx* x + xtm
+               yy = dy* y + ytm
+            ELSE
+               mx = INT(x)
+               my = INT(y) 
+               xup = x - FLOAT(mx)
+               yup = y - FLOAT(my)
+               IF (mx+2 .LE. nxs) THEN
+                 xinterp = px(mx+1) + xup* (px(mx+2) - px(mx+1))
+               ELSE
+                  xinterp = px(nxs)
+               ENDIF
+
+               IF (my+2 .LE. nys) THEN
+                  yinterp = py(my+1) + yup* (py(my+2) - py(my+1))
+               ELSE
+                  yinterp = py(nys)
+               ENDIF
+
+	       call trans(0,xinterp,yinterp,xx,yy)
+            ENDIF
+
+            IF (curvilinear) THEN
+               x_curv = xx
+               y_curv = yy
+               CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status) ! xform the pts
+
+               xxc=x_curv
+               yyc=y_curv
+               CALL plot (xxc,yyc,0,0)
+            ELSE
+               CALL plot (xx,yy,0,0)
+            ENDIF
+
+            xxsv = xx 
+            yysv = yy
+            iisav = -999
+            iacc = 0
+            acnt = 0
+            bflg = .FALSE.
+
+            DO WHILE (x .GT. 0.0 .AND. x .LT. REAL(is-1) .AND. 
+     .                y .GT. 0.0 .AND. y .LT. REAL(js-1)) 
+               ii = INT(x) 
+               jj = INT(y)
+               xx = x - REAL(ii)
+               yy = y - REAL(jj)
+
+               iindex = ii + 1		! ACM: indices must start at 1 not 0.
+               jjndex = jj + 1
+
+               IF (jtype .NE. -1) THEN 
+
+                  IF (iindex .LT. nxs) THEN
+                     dx = px(iindex+1) - px(iindex)
+                  ELSE 
+                     dx = px(iindex) - px(iindex-1)
+                  ENDIF
+                  IF (jjndex .LT. nys) THEN
+                     dy = py(jjndex+1) - py(jjndex)
+                  ELSE 
+                     dy = py(jjndex) - py(jjndex-1)
+                  ENDIF
+
+               ENDIF
+
+               up  = u(iindex,jjndex)
+               upi = u(iindex+1,jjndex)
+               upj = u(iindex,jjndex+1)
+               upij= u(iindex+1,jjndex+1)
+
+               vp  = v(iindex,jjndex)
+               vpi = v(iindex+1,jjndex)
+               vpj = v(iindex,jjndex+1)
+               vpij= v(iindex+1,jjndex+1)
+
+               IF (ZLE .AND.
+     .               (up .LE. CMZLE .OR. upi .LE. CMZLE .OR.
+     .                upj.LE. CMZLE .OR. upij.LE. CMZLE .OR.          
+     .                vp .LE. CMZLE .OR. vpi .LE. CMZLE .OR.
+     .                vpj.LE. CMZLE .OR. vpij.LE. CMZLE)) GO TO 19
+
+               IF (ZEQ .AND.
+     .               (up .EQ. CMZEQ .OR. upi .EQ. CMZEQ .OR.
+     .                upj.EQ. CMZEQ .OR. upij.EQ. CMZEQ .OR.          
+     .                vp .EQ. CMZEQ .OR. vpi .EQ. CMZEQ .OR.
+     .                vpj.EQ. CMZEQ .OR. vpij.EQ. CMZEQ)) GO TO 19
+
+               IF (ZGE .AND.
+     .               (up .GE. CMZGE .OR. upi .GE. CMZGE .OR.
+     .                upj.GE. CMZGE .OR. upij.GE. CMZGE .OR.          
+     .                vp .GE. CMZGE .OR. vpi .GE. CMZGE .OR.
+     .                vpj.GE. CMZGE .OR. vpij.GE. CMZGE)) GO TO 19
+
+               uv1 = up  + (upi - up)* xx
+               uv2 = upj + (upij - upj)* xx
+               uv  = uv1 + (uv2 - uv1)* yy
+
+               vv1 = vp  + (vpi - vp)* xx
+               vv2 = vpj + (vpij - vpj)* xx
+               vv  = vv1 + (vv2-vv1)*yy
+
+               auv = ABS(uv) 
+               avv = ABS(vv)
+               IF (auv .LT. 0.001 .AND. avv .LT. 0.001) GO TO 19
+
+               IF (auv .GT. avv) THEN
+                  uv = uv*fact/auv
+                  vv = vv*fact/auv
+               ELSE
+                  uv = uv*fact/avv
+                  vv = vv*fact/avv
+               ENDIF
+
+C From re_orient.F
+C will we need COS(latitude) corrections ? ( the true dx may be dx*COS(lat) )
+C compute COS(lat) correction at this latitude
+
+               IF ( need_cos ) THEN
+  
+                  IF (JTYPE.EQ.-1)THEN
+                     xx = dx* x + xtm
+                     yy = dy* y + ytm
+                  ELSE
+                     mx = INT(x)
+                     my = INT(y) 
+                    xinterp = px(mx+1)
+                     yinterp = py(my+1)
+                     call trans(0,xinterp,yinterp,xx,yy)
+                  ENDIF
+
+                  cos_factor = COS( deg2rad * yy )
+                  IF (trnspz) cos_factor = 1./COS( deg2rad * xx )
+                  IF ( cos_factor .LT. 1.E-6 ) cos_factor = 1.E-6 !arbitrary fix /0
+               ELSE
+                 cos_factor = 1.0
+               ENDIF
+
+               x = x + uv/cos_factor
+               y = y + vv/cos_factor
+
+C  Correction for irregular grids and rectangular regions
+C  and for latitude.
+
+               IF (jtype .NE. -1) THEN	! get local dx, dy
+                  mx = MAX(1., x + 1)
+                  my = MAX(1., y + 1)
+                  IF (mx .LT. nxs) THEN
+                     dx = px(mx+1) - px(mx)
+                  ELSE 
+                     dx = px(mx) - px(mx-1)
+                  ENDIF
+                  IF (my .LT. nys) THEN
+                     dy = py(my+1) - py(my)
+                  ELSE 
+                     dy = py(my) - py(my-1)
+                  ENDIF
+               ENDIF
+
+               IF (.NOT. curvilinear) THEN
+                  IF (.NOT. trnspz) THEN
+                     x = x + uv/ (dx*cos_factor/dy)
+                     y = y + vv/ (dy/(dx*cos_factor))
+                  ELSE
+                     x = x + uv/ (dx/(dy*cos_factor))
+                     y = y + vv/ (dy*cos_factor/dx)
+                  ENDIF
+               ENDIF
+
+               ii1 = INT(x*rscl)
+               ij1 = INT(y*rscl)
+               ii1 = ij1*iss + ii1
+               ii1index = ii1 + 1
+
+               IF (ii1 .LT. 0  .OR.  ii1 .GE. siz) GO TO 19
+               IF (startflag(ii1index) .EQ. 1.) GO TO 19
+
+               IF (ii1index .NE. iisav .AND. iisav.GT.0)
+     .             startflag(iisav) = 1.
+               IF (ii1index .EQ. iisav) THEN
+                  iacc = iacc + 1
+               ELSE
+                  iacc = 0
+               ENDIF
+
+               IF (iacc .GT. 10) GO TO 19
+
+               iisav = ii1index
+
+               IF (JTYPE.EQ.-1)THEN
+                  xx = dx* x + xtm
+                  yy = dy* y + ytm
+
+               ELSE
+                  mx = INT(x)
+                  my = INT(y) 
+                  xup = x - FLOAT(mx)
+                  yup = y - FLOAT(my)
+                  IF (mx+2 .LE. nxs) THEN
+                     xinterp = px(mx+1) + xup* (px(mx+2) - px(mx+1))
+                  ELSE
+                     xinterp = px(nxs)
+                  ENDIF
+
+                  IF (my+2 .LE. nys) THEN
+                     yinterp = py(my+1) + yup* (py(my+2) - py(my+1))
+                  ELSE
+                     yinterp = py(nys)
+                  ENDIF
+
+                  call trans(0,xinterp,yinterp,xx,yy)
+               ENDIF
+
+               IF (icol .GT. -1) THEN
+                  IF (bflg) THEN
+                     
+                     IF (curvilinear) THEN
+                        x_curv = xold
+                        y_curv = xold
+                        CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, 
+     .                      status) ! xform the pts
+                        xxc=x_curv
+                        yyc=y_curv
+                        CALL plot (xxc,yyc,0,0)
+                     ELSE
+                        CALL plot(xold,yold,0,0)
+                     ENDIF
+
+                     bflg = .FALSE.
+                  ENDIF
+
+                  IF (curvilinear) THEN
+                     x_curv = xx
+                     y_curv = yy
+                     CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, 
+     .                   status) ! xform the pts
+                     xxc=x_curv
+                     yyc=y_curv
+                     CALL plot (xxc,yyc,1,0)
+                  ELSE
+                     CALL plot(xx,yy,1,0)
+
+                  ENDIF
+               ELSE
+                  bflg = .TRUE.
+               ENDIF
+
+               xold = xx
+               yold = yy
+               acnt = acnt + 1
+
+C  Draw arrow heads
+
+               IF (acnt .GT. 20) THEN
+
+                 vel = SQRT(upsv*upsv + vpsv*vpsv)* vfact
+                 IF (icol .GT. -1) 
+     .              CALL strmar (xxsv, yysv, xx, yy, vel, xf, yf)
+                  acnt = 0
+               ENDIF
+
+               xxsv = xx 
+               yysv = yy
+               upsv = up
+               vpsv = vp
+            ENDDO
+
+   19       CONTINUE
+            bflg = .FALSE.
+
+C  The curve was stopped (either vel too small, or crosses another curve
+C  or runs into an edge or bad data)  Go the other direction from where
+C  we began the curve.
+
+            x = xsav 
+            y = ysav
+            xx = dx* x + xtm
+            yy = dy* y + ytm
+
+            IF(JTYPE.EQ.-1)THEN
+               xx = dx* x + xtm
+               yy = dy* y + ytm
+            ELSE
+               mx = INT(x)
+               my = INT(y) 
+               xup = x - FLOAT(mx)
+               yup = y - FLOAT(my)
+               IF (mx+2 .LE. nxs) THEN
+                  xinterp = px(mx+1) + xup* (px(mx+2) - px(mx+1))
+               ELSE
+                  xinterp = px(nxs)
+               ENDIF
+
+               IF (my+2 .LE. nys) THEN
+                  yinterp = py(my+1) + yup* (py(my+2) - py(my+1))
+               ELSE
+                  yinterp = py(nys)
+               ENDIF
+
+	       call trans(0,xinterp,yinterp,xx,yy)
+            ENDIF
+
+            IF (curvilinear) THEN
+               x_curv = xx
+               y_curv = yy
+               CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status) ! xform the pts
+               xxc=x_curv
+               yyc=y_curv
+               CALL plot (xxc,yyc,0,0)
+            ELSE
+               CALL plot (xx,yy,0,0)
+            ENDIF
+
+            xxsv = xx
+            yysv = yy
+
+            iisav = -999
+            iacc = 0
+            acnt = 19
+
+            DO WHILE (x .GT. 0.0 .AND. x .LT. REAL(is-1) .AND. 
+     .                y .GT. 0.0 .AND. y .LT. REAL(js-1)) 
+               ii = INT(x)
+               jj = INT(y)
+               xx = x - REAL(ii)
+               yy = y - REAL(jj)
+
+               iindex = ii + 1
+               jjndex = jj + 1
+
+               up  = u(iindex,  jjndex)
+               upi = u(iindex+1,jjndex)
+               upj = u(iindex,  jjndex+1)
+               upij= u(iindex+1,jjndex+1)
+
+               vp  = v(iindex,  jjndex)
+               vpi = v(iindex+1,jjndex)
+               vpj = v(iindex,  jjndex+1)
+               vpij= v(iindex+1,jjndex+1)
+
+               IF (ZLE .AND.
+     .               (up .LE. CMZLE .OR. upi .LE. CMZLE .OR.
+     .                upj.LE. CMZLE .OR. upij.LE. CMZLE .OR.          
+     .                vp .LE. CMZLE .OR. vpi .LE. CMZLE .OR.
+     .                vpj.LE. CMZLE .OR. vpij.LE. CMZLE)) GO TO 29
+
+               IF (ZEQ .AND.
+     .               (up .EQ. CMZEQ .OR. upi .EQ. CMZEQ .OR.
+     .                upj.EQ. CMZEQ .OR. upij.EQ. CMZEQ .OR.          
+     .                vp .EQ. CMZEQ .OR. vpi .EQ. CMZEQ .OR.
+     .                vpj.EQ. CMZEQ .OR. vpij.EQ. CMZEQ)) GO TO 29
+
+               IF (ZGE .AND.
+     .               (up .GE. CMZGE .OR. upi .GE. CMZGE .OR.
+     .                upj.GE. CMZGE .OR. upij.GE. CMZGE .OR.          
+     .                vp .GE. CMZGE .OR. vpi .GE. CMZGE .OR.
+     .                vpj.GE. CMZGE .OR. vpij.GE. CMZGE)) GO TO 29
+
+               uv1 = up  + (upi - up)* xx
+               uv2 = upj + (upij - upj)* xx
+               uv  = uv1 + (uv2 - uv1)* yy
+
+               vv1 = vp  + (vpi - vp)* xx
+               vv2 = vpj + (vpij - vpj)* xx
+               vv  = vv1 + (vv2 - vv1)* yy
+
+               auv = ABS(uv) 
+               avv = ABS(vv) 
+
+               IF (auv .LT. 0.001 .AND. avv .LT. 0.001) GO TO 29
+               IF (auv .GT. avv) THEN
+                  uv = uv* fact/ auv
+                  vv = vv* fact/ auv
+               ELSE
+                  uv = uv* fact/ avv
+                  vv = vv* fact/ avv
+               ENDIF
+
+
+C From re_orient.F
+C will we need COS(latitude) corrections ? ( the true dx may be dx*COS(lat) )
+C compute COS(lat) correction at this latitude
+
+           IF ( need_cos ) THEN
+
+               IF (JTYPE.EQ.-1)THEN
+                  xx = dx* x + xtm
+                  yy = dy* y + ytm
+               ELSE
+                  mx = INT(x)
+                  my = INT(y) 
+                  xinterp = px(mx+1)
+                  yinterp = py(my+1)
+                  call trans(0,xinterp,yinterp,xx,yy)
+              ENDIF
+
+              cos_factor = COS( deg2rad * yy )
+              IF (trnspz) cos_factor = 1./COS( deg2rad * xx )
+              IF ( cos_factor .LT. 1.E-6 ) cos_factor = 1.E-6 !arbitrary fix /0
+           ELSE
+              cos_factor = 1.0
+           ENDIF
+
+C  travelling the other direction, so subtract 
+
+               x = x - uv/cos_factor
+               y = y - vv/cos_factor
+
+C  Correction for irregular grids and rectangular regions.
+C  and for latitude
+
+               IF (jtype .NE. -1) THEN	! get local dx, dy
+                  mx = MAX(1., x + 1)
+                  my = MAX(1., y + 1)
+                  IF (mx .LT. nxs) THEN
+                     dx = px(mx+1) - px(mx)
+                  ELSE 
+                     dx = px(mx) - px(mx-1)
+                  ENDIF
+                  IF (my .LT. nys) THEN
+                     dy = py(my+1) - py(my)
+                  ELSE 
+                     dy = py(my) - py(my-1)
+                  ENDIF
+               ENDIF
+
+C  travelling the other direction, so subtract 
+ 
+               IF (.NOT. curvilinear) THEN
+                  IF (.NOT. trnspz) THEN
+                     x = x - uv/ (dx*cos_factor/dy)
+                     y = y - vv/ (dy/(dx*cos_factor))
+                  ELSE
+                     x = x - uv/ (dx/(dy*cos_factor))
+                     y = y - vv/ (dy*cos_factor/dx)
+                  ENDIF
+               ENDIF
+
+               ii1 = INT(x*rscl)
+               ij1 = INT(y*rscl)
+               ii1 = ij1*iss + ii1
+
+               ii1index = ii1 + 1
+
+               IF (ii1 .LT. 0  .OR.  ii1 .GE. siz) GO TO 29
+               IF (startflag(ii1index) .EQ. 1.) GO TO 29
+
+               IF (ii1 .NE. iisav .AND. iisav .GT. 0)startflag(iisav) =1. 
+
+               IF (ii1index .EQ. iisav) THEN
+                  iacc = iacc + 1
+               ELSE
+                  iacc = 0
+               ENDIF
+
+               IF (iacc .GT. 10) GO TO 29
+               iisav = ii1index
+
+               IF(JTYPE.EQ.-1)THEN      
+                  xx = dx* x + xtm
+                  yy = dy* y + ytm
+
+               ELSE
+                  mx = INT(x)
+                  my = INT(y) 
+                  xup = x - FLOAT(mx)
+                  yup = y - FLOAT(my)
+                  IF (mx+2 .LE. nxs) THEN
+                     xinterp = px(mx+1) + xup* (px(mx+2) - px(mx+1))  
+                  ELSE
+                     xinterp = px(nxs)
+                  ENDIF
+
+                  IF (my+2 .LE. nys) THEN
+                     yinterp = py(my+1) + yup* (py(my+2) - py(my+1))
+                  ELSE
+                     yinterp = py(nys)
+                  ENDIF
+
+                  call trans(0,xinterp,yinterp,xx,yy)
+               ENDIF
+
+
+               IF (icol .GT. -1) THEN
+                  IF (bflg) THEN
+
+                     IF (curvilinear) THEN
+                        x_curv = xold
+                        y_curv = xold
+                        CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, 
+     .                      status) ! xform the pts
+                        xxc=x_curv
+                        yyc=y_curv
+                        CALL plot (xxc,yyc,0,0)
+                     ELSE
+                        CALL plot(xold,yold,0,0)
+                     ENDIF
+                     bflg = .FALSE.
+                  ENDIF
+
+                  IF (curvilinear) THEN
+                     x_curv = xx
+                     y_curv = yy
+                     CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, 
+     .                   status) ! xform the pts
+                     xxc=x_curv
+                     yyc=y_curv
+                     CALL plot (xxc,yyc,1,0)
+                  ELSE
+                     CALL plot(xx,yy,1,0)
+         
+                  ENDIF
+               ELSE
+                  bflg = .TRUE.
+               ENDIF
+
+               xold = xx
+               yold = yy
+               acnt = acnt + 1
+
+C  Draw arrow head
+               IF (acnt .GT. 20) THEN
+                 vel = SQRT(upsv*upsv + vpsv*vpsv)* vfact
+                 IF (icol .GT. -1) 
+     .              CALL strmar(xx, yy, xxsv, yysv, vel, xf, yf)
+                  acnt = 0
+               ENDIF
+
+               xxsv = xx 
+               yysv = yy
+               upsv = up
+               vpsv = vp
+            ENDDO
+   29       CONTINUE
+
+         ENDIF
+         i2 = i2 + 1
+         IF (i2 .EQ. iss) THEN
+            i2 = 1
+            j2 = j2 + 1
+         ENDIF
+
+      ENDDO
+
+C  From vector
+C
+C	DRAW SCALE  make arrow scale at XT,YT
+C
+
+C  Make a label containing the scale factor. 
+C  Save it in a symbol even if the label not drawn.
+
+	CALL COLOR(IPEN(0))
+	WRITE (VECLAB,66) 1./vfact
+  66    FORMAT ('flow arrow scale', 1pg8.2)
+
+C   Save the value in a symbol PPL_VECLEN
+	symbuff = 'PPL_VECLEN'
+	CALL GETSYM( symbuff, buff, i2, i1 )
+	IF ( i1 .EQ. 0 ) CALL DELSYM(symbuff,i1)
+	slen = TM_LENSTR1(veclab)
+	CALL PUTSYM( symbuff, veclab, slen, i2)
+
+	IF(.NOT. VKEY)THEN
+	    CALL COLOR(IPEN(0))
+	    RETURN
+	ENDIF
+	CALL WINDOW(0.,0.,0.,0.)
+     
+	    IF(VUSER)THEN
+	    	XFUSER=1.
+		YFUSER=1.
+		YLOUSR=0.
+		XLOUSR=0.
+	    ELSE
+	    	XFUSER=XF
+		YFUSER=YF
+		XLOUSR=XLO
+		YLOUSR=YLO
+	    ENDIF
+
+	XT=VXLOC/XFUSER+XLOUSR
+	YT=VYLOC/YFUSER+YLOUSR
+        
+        XX1 = XT + 0.1/XFUSER  
+	YY1 = YT 
+
+C  Make a sample line and label it with the scale factor. 
+
+        CALL PLOT (xx1,yy1,0,0)
+        CALL PLOT (xt,yy1,1,0)
+
+C	DRAW LABEL
+
+	CALL COLOR(IPEN(0))
+	ILN=LNBLK(VECLAB,30)
+c	XL = XX1 + 2.* hlabs/XF+0.2/xf
+	XL = XX1 + .125/XF
+	YL = YY1 - HLABS*0.5/YF
+	CALL SYMBEL(XL,YL,0.,HLABS,ILN,VECLAB)
+
+3333	IF(IWIND.GT.0)CALL WINDOW(XLO,YLO,XHI,YHI)
+
+      RETURN
+* error exit
+ 5100 curv_missing = .TRUE.
+      RETURN
+      END
diff --git a/ppl/tmapadds/flush_buffered_fillpoly.F b/ppl/tmapadds/flush_buffered_fillpoly.F
new file mode 100644
index 0000000..19bbf07
--- /dev/null
+++ b/ppl/tmapadds/flush_buffered_fillpoly.F
@@ -0,0 +1,231 @@
+
+C =========================================================================
+
+      subroutine flush_buffered_fillpoly (xadd, lmin, lmax)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+c:    Extracted from arfill.F
+*     v5.81 *acm* 4/05 Changes for FILL/MOD. Draw replications for curvilinear datasets
+
+        IMPLICIT NONE
+        include         'xinterrupt.cmn' ! 1/89 *sh*
+        include         'ppl_in_ferret.cmn'
+        include         'shade_vars.cmn'
+	include 	'ARFILL.INC'
+        include         'xcurvilinear.cmn'
+
+ 
+*     J Davison 2.4.99
+
+*     BUFFER_FILLPOLY() called when entire grid cell is a single color; when
+*     color changes construct new polygon from individual cells and fill
+*     it in FLUSH_BUFFERED_FILLPOLY().
+
+      real xadd, lmin, lmax
+
+      real xarg(2*buffer_max+2), yarg(2*buffer_max+2)
+      integer m, ndx, neo, noe
+      logical even
+
+      if (sqfflg) then
+*        ********************* RECTANGLES ********************
+         if (curvilinear) then
+
+*           FIRST POINT IS LOWER LEFT CORNER OF FIRST RECTANGLE
+            xarg(1) = xbuff(1,1)
+            yarg(1) = ybuff(1,1)
+           
+*           FOLLOWED BY LOWER RIGHT CORNER OF ALL RECTANGLES
+            do 10 m = 1, num_buffered
+               xarg(m+1) = xbuff(2,m)
+               yarg(m+1) = ybuff(2,m)
+ 10         end do
+            
+*           PICK THE UPPER RIGHT CORNER OF THE LAST RECTANGLE
+            xarg(num_buffered+2) = xbuff(3,num_buffered)
+            yarg(num_buffered+2) = ybuff(3,num_buffered)
+ 
+*           THEN RETURN ALONG UPPER LEFT CORNER OF EACH RECTANGLE
+            ndx = 2*num_buffered + 3
+
+            do 20 m = num_buffered, 1, -1
+               xarg(ndx-m) = xbuff(4,m)
+               yarg(ndx-m) = ybuff(4,m)
+ 20         end do
+
+            call fillpoly (xarg, yarg, 2*num_buffered+2, ilast-1, 
+     .                     xadd, lmin, lmax)
+          else
+            xarg(1) = xbuff(1,1)
+            yarg(1) = ybuff(1,1)
+
+            xarg(2) = xbuff(2,num_buffered)
+            yarg(2) = ybuff(2,num_buffered)
+
+            xarg(3) = xbuff(3,num_buffered)
+            yarg(3) = ybuff(3,num_buffered)
+
+            xarg(4) = xbuff(4,1)
+            yarg(4) = ybuff(4,1)
+
+            call fillpoly (xarg, yarg, 4, ilast-1, xadd, lmin, lmax)
+         end if
+      else
+*        ******************* TRIANGLES *******************
+         
+         if (num_buffered .eq. 1) then
+            
+            xarg(1) = xbuff(1,1)
+            yarg(1) = ybuff(1,1)
+
+            xarg(2) = xbuff(2,1)
+            yarg(2) = ybuff(2,1)
+
+            xarg(3) = xbuff(3,1)
+            yarg(3) = ybuff(3,1)
+
+            call fillpoly (xarg, yarg, 3, ilast-1, xadd, lmin, lmax)
+            goto 1000
+         end if
+            
+         if (mod(num_buffered,2) .eq. 0) then
+            even = .true.
+         else
+            even = .false.
+         end if
+         
+         if (curvilinear) then
+
+*           INDICES DEPEND ON WHETHER THERE ARE AN EVEN OR ODD # OF PTS
+            if (even) then
+               neo = num_buffered
+               noe = num_buffered - 1
+            else
+               neo = num_buffered - 1
+               noe = num_buffered
+            end if
+
+*           FIRST POINT IS LEFT CORNER OF FIRST TRIANGLE
+            xarg(1) = xbuff(1,1)
+            yarg(1) = ybuff(1,1)
+               
+*           FOLLOWED BY RIGHT CORNER OF ALL TRIANGLES
+            do 110 m = 2, neo, 2
+               xarg(m/2+1) = xbuff(3,m)
+               yarg(m/2+1) = ybuff(3,m)
+ 110        end do
+               
+*           PICK THE RIGHT CORNER OF THE LAST TRIANGLE
+            xarg(neo/2+2) = xbuff(2,num_buffered)
+            yarg(neo/2+2) = ybuff(2,num_buffered)
+               
+*           THEN RETURN ALONG LEFT CORNER OF EACH TRIANGLE
+            ndx = 2*num_buffered + 5
+            
+            do 120 m = noe, 1, -2
+               xarg((ndx-m)/2) = xbuff(3,m)
+               yarg((ndx-m)/2) = ybuff(3,m)
+ 120        end do
+
+            call fillpoly (xarg, yarg, num_buffered+2, ilast-1,
+     .                     xadd, lmin, lmax)
+         else
+            if (upper_first .and. even) then
+               xarg(1) = xbuff(1,1)
+               yarg(1) = ybuff(1,1)
+               
+               xarg(2) = xbuff(3,num_buffered)
+               yarg(2) = ybuff(3,num_buffered)
+               
+               xarg(3) = xbuff(2,num_buffered)
+               yarg(3) = ybuff(2,num_buffered)
+               
+               xarg(4) = xbuff(3,1)
+               yarg(4) = ybuff(3,1)
+
+               call fillpoly (xarg, yarg, 4, ilast-1, xadd, lmin, lmax)
+            else if (upper_first .and. .not.even) then
+
+               xarg(1) = xbuff(1,1)
+               yarg(1) = ybuff(1,1)
+               
+               xarg(2) = xbuff(1,num_buffered)
+               yarg(2) = ybuff(1,num_buffered)
+               
+               xarg(3) = xbuff(2,num_buffered)
+               yarg(3) = ybuff(2,num_buffered)
+               
+               xarg(4) = xbuff(3,1)
+               yarg(4) = ybuff(3,1)
+
+               call fillpoly (xarg, yarg, 4, ilast-1, xadd, lmin, lmax)
+            else if (.not.upper_first .and. even) then
+
+               xarg(1) = xbuff(1,1)
+               yarg(1) = ybuff(1,1)
+               
+               xarg(2) = xbuff(1,num_buffered)
+               yarg(2) = ybuff(1,num_buffered)
+               
+               xarg(3) = xbuff(2,num_buffered)
+               yarg(3) = ybuff(2,num_buffered)
+               
+               xarg(4) = xbuff(2,1)
+               yarg(4) = ybuff(2,1)
+
+               call fillpoly (xarg, yarg, 4, ilast-1, xadd, lmin, lmax)
+            else if (.not.upper_first .and. .not.even) then
+
+               xarg(1) = xbuff(1,1)
+               yarg(1) = ybuff(1,1)
+               
+               xarg(2) = xbuff(3,num_buffered)
+               yarg(2) = ybuff(3,num_buffered)
+               
+               xarg(3) = xbuff(2,num_buffered)
+               yarg(3) = ybuff(2,num_buffered)
+               
+               xarg(4) = xbuff(2,1)
+               yarg(4) = ybuff(2,1)
+
+               call fillpoly (xarg, yarg, 4, ilast-1, xadd, lmin, lmax)
+            end if
+         end if
+      end if
+      
+ 1000 buffer_empty = .true.
+      num_buffered = 0
+      
+      return
+      end
diff --git a/ppl/tmapadds/get_ndx.F b/ppl/tmapadds/get_ndx.F
new file mode 100644
index 0000000..4c64db4
--- /dev/null
+++ b/ppl/tmapadds/get_ndx.F
@@ -0,0 +1,135 @@
+	INTEGER FUNCTION GET_NDX (datum,ndx)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Gets bundle index for fill area calls
+*	J Davison 5.17.90
+*	Mod *jd* 10.1.92 to use 1 fill index                    
+
+* 	Mod *sh* 4/97 -- removed checks on valid coordinates from this routine
+*		to a separate new routine, BAD_XY_COORD
+
+* 	Mod *sh* 11/97 -- changed calling args by eliminating "i,j" so this
+*		routine can be used for 1D (polygon fill) as well as 2D
+*		Also: bug in this code: if there is no valid
+*	        index for datum then "bad_val" was returned. But bad_val is
+*		a REAL!!   Now return -999 instead (quick hack).
+*		Also had to add explicit range checks since whatever logic
+*		made rng chks mysteriously unnecessary using REAL bad_flag has
+*		changed
+*  V5.71 *acm*  6/15/04 Use TM_FPEQ_SNGL when checking whether a single-level zlev is
+*               the same as datum.
+*  v581 *acm* 3/05 open levels (-INF) (INF)
+*  V62+ *acm* 6/09 fix bug 1671: data level exactly matching top of upper level 
+*                  wasnt plotted on SHADE and POLY plots
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        IMPLICIT NONE
+	include		'parampl5_dat.decl'
+	include		'PARAMPL5.DAT'
+	include		'miss_inc.decl'
+	include		'MISS.INC'
+        include         'hd_inc.decl'
+        include         'HD.INC'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+	include		'shade_vars.cmn'
+
+* Calling argument declarations
+	integer		ndx
+        real            datum
+
+* Local variable declarations
+	real	        test
+	integer		lev1, levn
+        logical         TM_FPEQ_SNGL
+
+********************************************************************************
+
+*	      CHECK AGAINST 'LIMITS' VALUES AND FIND COLOR INDEX
+
+              lev1 = 1
+              levn = nlev2
+              IF (neginf) lev1 = 2
+              IF (posinf) levn = nlev2 - 1
+
+	      if(
+     .		 (zle.and.datum.le.cmzle) 	.or.
+     .		 (zeq.and.datum.eq.cmzeq) 	.or.
+     .		 (zge.and.datum.ge.cmzge)) then
+
+	         get_ndx = -999
+* ... 12/4/97 added range checks
+
+	      else if (datum .lt. zlev(lev1) .AND. (.NOT.neginf) ) then
+	         get_ndx = -999
+	      else if (datum .gt. zlev(levn) .AND. (.NOT.posinf) ) then
+	         get_ndx = -999
+* ... 12/4/97
+
+c	      else if (levn - lev1 .LE. 1) then
+	      else if (levn .LE. 1) then
+		 if ( TM_FPEQ_SNGL(datum, zlev(lev1)) ) then
+		    get_ndx = 2
+		 else
+		    get_ndx = -999
+		 endif
+	      else   
+                 IF (( datum .LT. zlev(lev1) ) .AND. neginf ) THEN
+                    get_ndx = 2
+                 ELSE IF ( (datum .GT. zlev(levn) ) .AND. posinf) THEN
+                    get_ndx = nlev2
+                 ELSE
+	            call locator (zlev(lev1),lev1,levn,datum,ndx)
+
+	            if (ndx .eq. levn) THEN
+		       IF (datum .eq. zlev(levn)) then 
+		          get_ndx = levn
+		       else
+                          IF (posinf) then
+	                     get_ndx = nlev2
+	                  else
+                             get_ndx = -999
+			  endif
+                       endif
+	            else
+	               get_ndx = ndx + 1
+	            end if
+                 ENDIF
+	      end if
+
+	return
+	end
diff --git a/ppl/tmapadds/get_pix.F b/ppl/tmapadds/get_pix.F
new file mode 100644
index 0000000..8ef78cf
--- /dev/null
+++ b/ppl/tmapadds/get_pix.F
@@ -0,0 +1,61 @@
+	SUBROUTINE get_pix(wsid,x_pixel_dim, y_pixel_dim)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* ACM 8/26/04
+*	Routine to get window size in pixels, saved by set_window_size,
+*       for gif windows where gqpxad does not work.
+*       
+
+        IMPLICIT NONE
+	INCLUDE 'gkscm2.cmn'
+
+* Calling arguments
+
+        INTEGER wsid
+        INTEGER x_pixel_dim, y_pixel_dim
+
+* Internal variables
+        INTEGER ierr,conid,wstype
+
+*******************************************************************************
+c	call FGD_GQWKC(wsid,ierr,conid,wstype)
+
+        x_pixel_dim = pixx
+        y_pixel_dim = pixy
+
+	RETURN
+	END
+
diff --git a/ppl/tmapadds/get_user_coords.F b/ppl/tmapadds/get_user_coords.F
new file mode 100644
index 0000000..d5c906e
--- /dev/null
+++ b/ppl/tmapadds/get_user_coords.F
@@ -0,0 +1,104 @@
+	SUBROUTINE GET_USER_COORDS (w,v,ndc,uc,xinv,yinv)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Finds user coordinates given world coordinates and ancillary ppl info.
+*	J Davison 5.17.90
+
+        IMPLICIT NONE
+	include		'axis_inc.decl'
+	include		'AXIS.INC'
+
+	real	 	w(4),v(4),vc(4),ndc(4),wc(4),uc(4)
+	real		nax,nay,nbx,nby,wax,way,wbx,wby,uax,uay,ubx,uby
+	real		xinv,yinv
+
+********************************************************************************
+
+*	GET VIEWPORT COORDS OF PLOT ACTIVE REGION CORNERS
+	nax = (v(2) - v(1)) / (w(2) - w(1))
+	nbx = v(1) - w(1)*nax
+	nay = (v(4) - v(3)) / (w(4) - w(3))
+	nby = v(3) - w(3)*nay
+	
+	vc(1) = nax* xorg*1000.0  + nbx
+	vc(2) = nax*(xorg + xlen)*1000.0 + nbx
+	vc(3) = nay* yorg*1000.0  + nby
+	vc(4) = nay*(yorg + ylen)*1000.0 + nby
+
+*	FIND APPROPRIATE CORNERS TO CLIP
+	ndc(1) = vc(1)	
+	ndc(2) = vc(2)
+	ndc(3) = vc(3)
+	ndc(4) = vc(4)
+
+*	WHAT WORLD COORDINATES ARE THESE?
+	wax = (w(2) - w(1)) / (v(2) - v(1))
+	wbx = w(1) - v(1)*wax
+	way = (w(4) - w(3)) / (v(4) - v(3))
+	wby = w(3) - v(3)*way
+	
+	wc(1) = wax*ndc(1) + wbx
+	wc(2) = wax*ndc(2) + wbx
+	wc(3) = way*ndc(3) + wby
+	wc(4) = way*ndc(4) + wby
+
+*	WHAT ARE THE USER COORDS OF THESE POINTS?
+	uax = (xhi - xlo) / (xlen*1000.0)
+	ubx = xlo - (xorg*1000.0) * uax
+	uay = (yhi - ylo) / (ylen*1000.0)
+	uby = ylo - (yorg*1000.0) * uay
+	
+	uc(1) = uax*wc(1) + ubx
+	uc(2) = uax*wc(2) + ubx
+	uc(3) = uay*wc(3) + uby
+	uc(4) = uay*wc(4) + uby
+
+*	ARE AXES INVERTED?
+	if (uc(1) .gt. uc(2)) then
+	   xinv = -1.0
+	else
+	   xinv =  1.0
+	endif
+
+	if (uc(3) .gt. uc(4)) then
+	   yinv = -1.0
+	else
+	   yinv =  1.0
+	endif
+
+	return
+	end
diff --git a/ppl/tmapadds/get_world_coords.F b/ppl/tmapadds/get_world_coords.F
new file mode 100644
index 0000000..b902172
--- /dev/null
+++ b/ppl/tmapadds/get_world_coords.F
@@ -0,0 +1,80 @@
+	SUBROUTINE GET_WORLD_COORDS (w,v,wc)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Finds world coordinates for setting viewport clipping
+*    ACM 1/24/03  based on get_user_coords
+
+        IMPLICIT NONE
+	include		'axis_inc.decl'
+	include		'AXIS.INC'
+
+	real	 	w(4),v(4),vc(4),ndc(4),wc(4),uc(4)
+	real		nax,nay,nbx,nby,wax,way,wbx,wby,uax,uay,ubx,uby
+	real		xinv,yinv
+
+c  from get_user_coords:  want to use wc below for clipping region.
+
+*	GET VIEWPORT COORDS OF PLOT ACTIVE REGION CORNERS
+	nax = (v(2) - v(1)) / (w(2) - w(1))
+	nbx = v(1) - w(1)*nax
+	nay = (v(4) - v(3)) / (w(4) - w(3))
+	nby = v(3) - w(3)*nay
+	
+	vc(1) = nax* xorg*1000.0  + nbx
+	vc(2) = nax*(xorg + xlen)*1000.0 + nbx
+	vc(3) = nay* yorg*1000.0  + nby
+	vc(4) = nay*(yorg + ylen)*1000.0 + nby
+
+*	FIND APPROPRIATE CORNERS TO CLIP
+	ndc(1) = vc(1)	
+	ndc(2) = vc(2)
+	ndc(3) = vc(3)
+	ndc(4) = vc(4)
+
+*	WHAT WORLD COORDINATES ARE THESE?
+	wax = (w(2) - w(1)) / (v(2) - v(1))
+	wbx = w(1) - v(1)*wax
+	way = (w(4) - w(3)) / (v(4) - v(3))
+	wby = w(3) - v(3)*way
+	
+	wc(1) = wax*ndc(1) + wbx
+	wc(2) = wax*ndc(2) + wbx
+	wc(3) = way*ndc(3) + wby
+	wc(4) = way*ndc(4) + wby
+
+	return
+	end
diff --git a/ppl/tmapadds/getlabfonts.F b/ppl/tmapadds/getlabfonts.F
new file mode 100644
index 0000000..1adfe28
--- /dev/null
+++ b/ppl/tmapadds/getlabfonts.F
@@ -0,0 +1,109 @@
+      SUBROUTINE getlabfonts (lab, lnbeg, lnend, jln, npnew, nfnew, 
+     .           newfont, newpen, nchr)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* v580 10/05 *acm* Fix for bug1003; pen may be changed by @Cnnn as well
+*                  as @Pn. In saving info about color/font changes from
+*                  one line to the next in multi-line lables, allow for
+*                  @Cnnn syntax.
+* V683 12/12 *acm* Fix for applying a font setting in multiple line labels
+
+* Argument declarations
+
+      IMPLICIT NONE
+      CHARACTER*(*) lab, newfont, newpen
+      INTEGER lnbeg(*), lnend(*), npnew, nfnew, nchr, jln
+
+* Local variable definitions
+
+      CHARACTER*1 fcode, fnext
+      INTEGER TM_LOC_STRING, ioc, loc, nloc
+      LOGICAL digit, isc
+
+      npnew = 0
+      nfnew = 0
+      newfont = ""
+      newpen = ""
+
+      nchr = lnend(jln) - lnbeg(jln) + 1
+      ioc = 0
+      loc = TM_LOC_STRING(lab(lnbeg(jln):lnend(jln)),"@",ioc)
+
+      IF ( loc .GT. 0) THEN
+         fcode = lab(lnbeg(jln)+loc:lnbeg(jln)+loc)
+	 fnext = lab(lnbeg(jln)+loc+1:lnbeg(jln)+loc+1)
+
+	 digit = (fcode .EQ. 'C'  .OR.  fcode .EQ. 'c') 
+	 digit = ( fnext .GE. '0' .AND. fnext .LE. '9')
+	 isc = ((fcode .EQ. 'C'  .OR.  fcode .EQ. 'c') .AND.digit) 
+
+         IF (fcode .EQ. 'P'  .OR.  fcode .EQ. 'p') THEN
+            newpen(1:3) = lab(lnbeg(jln)+loc-1:lnbeg(jln)+loc+1)
+            npnew = 3
+         ELSE IF ((fcode .EQ. 'C'  .OR.  fcode .EQ. 'c') .AND.digit) THEN
+            newpen(1:5) = lab(lnbeg(jln)+loc-1:lnbeg(jln)+loc+3)
+            npnew = 5
+         ELSE
+            newfont(1:3) = lab(lnbeg(jln)+loc-1:lnbeg(jln)+loc+1)
+            nfnew = 3
+
+         ENDIF
+         nloc = loc
+
+! Save the last pen and font change on this line.
+
+         DO WHILE (nloc .NE. 0) 
+            ioc = ioc + 1
+            nloc = TM_LOC_STRING(lab(lnbeg(jln):lnend(jln)),"@",ioc)
+            IF (nloc .GT. 0) THEN
+               fcode = lab(lnbeg(jln)+nloc:lnbeg(jln)+nloc)
+               IF (fcode .EQ. 'P'  .OR.  fcode .EQ. 'p') THEN
+                 newpen(1:3) = lab(lnbeg(jln)+nloc-1:lnbeg(jln)+nloc+1)
+                 npnew = 3
+               ELSE IF (fcode .EQ. 'C'  .OR.  fcode .EQ. 'c') THEN
+                 newpen(1:5) = lab(lnbeg(jln)+nloc-1:lnbeg(jln)+nloc+3)
+                 npnew = 5
+               ELSE
+
+                 newfont(1:3) = lab(lnbeg(jln)+nloc-1:lnbeg(jln)+nloc+1)
+                 nfnew = 3
+               ENDIF
+            ENDIF
+         ENDDO
+      ENDIF
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/gxstrm.c b/ppl/tmapadds/gxstrm.c
new file mode 100644
index 0000000..0b39e4c
--- /dev/null
+++ b/ppl/tmapadds/gxstrm.c
@@ -0,0 +1,253 @@
+/* Included in the Ferret source repository only for reference */
+/* Code is available at
+   http://grads.sourcearchive.com/documentation/2.0.a7.1-3/main.html */
+
+
+#include <Python.h> /* make sure Python.h is first */
+#include <stdio.h>
+#include <malloc.h>
+#include <math.h>
+#include "gx.h"
+
+void gxstrm (float *u, float *v, float *c, int is, int js,
+   float uund, float vund, float cund, int flag, float *shdlvs,
+   int *shdcls, int shdcnt, int den) {
+float *up, *vp; 
+float x,y,xx,yy,uv1,uv2,uv,vv1,vv2,vv,auv,avv,xsav,ysav,xold,yold;
+int i,j,ii,jj,ipen,ii1,ij1,i2,j2,ipt,acnt,icol,scol,kk,dis;
+int *it,siz,iacc,iisav,iscl,imn,imx,jmn,jmx,iz,jz,iss,jss,bflg;
+float fact,rscl,xxsv,yysv,*cp,cv1,cv2,cv;
+
+  scol = -9;
+  icol = 1;
+
+  /* Figure out the interval for the flag grid */
+
+  i = is;
+  if (js>i) i = js;
+  iscl = 200/i;
+  iscl = iscl + den - 5;
+  if (iscl<1) iscl=1;
+  if (iscl>10) iscl=10;
+  fact = 0.5/((float)iscl);
+  rscl = (float)iscl;
+ 
+  /* Allocate memory for the flag grid */
+
+  iss = is*iscl; jss = js*iscl;
+  siz = iss*jss;
+  it = (int *)malloc(sizeof(int) * siz);
+  if (it==NULL) {
+    printf ("Cannot allocate memory for streamline function\n");
+    return;
+  }
+  for (i=0; i<siz; i++) *(it+i) = 0;
+
+  /* Loop through flag grid to look for start of streamlines.  
+     To start requires no streams drawn within surrounding 
+     flag boxes.  */
+
+  i2 = 0;
+  j2 = 0;
+  for (i=0; i<siz; i++) {
+    dis = 2;
+    if (den<5) dis = 3;
+    if (den>5) dis = 1;
+    imn = i2-dis; imx = i2+dis+1; 
+    jmn = j2-dis; jmx = j2+dis+1;
+    if (imn<0) imn = 0;
+    if (imx>iss) imx = iss;
+    if (jmn<0) jmn = 0;
+    if (jmx>jss) jmx = jss;
+    iacc = 0;
+    for (jz=jmn; jz<jmx; jz++) {
+      ipt = jz*iss+imn;
+      for (iz=imn; iz<imx; iz++) {
+        iacc = iacc + *(it+ipt);
+        ipt++;
+      }
+    }
+    if (iacc==0){
+      x = ((float)i2)/rscl;
+      y = ((float)j2)/rscl;
+      xsav = x;
+      ysav = y;
+      gxconv (x+1.0,y+1.0,&xx,&yy,3);
+      gxplot (xx,yy,3);
+      xxsv = xx; yysv = yy;
+      iisav = -999;
+      iacc = 0;
+      acnt = 0;
+      bflg = 0;
+      while (x>=0.0 && x<(float)(is-1) && y>=0.0 && y<(float)(js-1)) {
+        ii = (int)x;
+        jj = (int)y;
+        xx = x - (float)ii;
+        yy = y - (float)jj;
+        up = u + jj*is+ii;      
+        vp = v + jj*is+ii;
+        if (*up==uund || *(up+1)==uund ||
+            *(up+is)==uund || *(up+is+1)==uund) break;
+        if (*vp==vund || *(vp+1)==vund ||
+            *(vp+is)==vund || *(vp+is+1)==vund) break;
+        if (flag) {
+          cp = c + jj*is+ii;
+          if (*cp==cund || *(cp+1)==cund ||
+              *(cp+is)==cund || *(cp+is+1)==cund) icol = 15;
+          else {
+            cv1 = *cp + (*(cp+1)-*cp)*xx;
+            cv2 = *(cp+is) + (*(cp+is+1)-*(cp+is))*xx;
+            cv = cv1 + (cv2-cv1)*yy;
+            icol = gxshdc(shdlvs,shdcls,shdcnt,cv);
+          }
+          if (icol!=scol && icol>-1) gxcolr(icol);
+          scol = icol;
+        }
+        uv1 = *up + (*(up+1)-*up)*xx;
+        uv2 = *(up+is) + (*(up+is+1)-*(up+is))*xx;
+        uv = uv1 + (uv2-uv1)*yy;
+        vv1 = *vp + (*(vp+1)-*vp)*xx;
+        vv2 = *(vp+is) + (*(vp+is+1)-*(vp+is))*xx;
+        vv = vv1 + (vv2-vv1)*yy;
+        auv = fabs(uv); avv=fabs(vv);
+        if (auv<0.1 && avv<0.1) break;
+        if (auv>avv) {
+          vv = vv*fact/auv;
+          uv = uv*fact/auv;
+        } else {
+          uv = uv*fact/avv;
+          vv = vv*fact/avv;
+        }
+        x = x + uv;
+        y = y + vv;
+        ii1 = (int)(x*rscl);
+        ij1 = (int)(y*rscl);
+        ii1 = ij1*iss + ii1;
+        if (ii1<0 || ii1>=siz) break;
+        if (*(it+ii1)==1) break;
+        if (ii1!=iisav && iisav>-1) *(it+iisav) = 1;
+        if (ii1==iisav) iacc++;
+        else iacc = 0;
+        if (iacc>10) break;
+        iisav = ii1;
+        gxconv (x+1.0,y+1.0,&xx,&yy,3);
+        if (icol>-1) {
+          if (bflg) {gxplot(xold,yold,3); bflg=0;}
+          gxplot (xx,yy,2);
+        } else bflg = 1;
+        xold = xx;
+        yold = yy;
+        acnt++;
+        if (acnt>20) {
+          if (icol>-1) strmar (xxsv,yysv,xx,yy);
+          acnt = 0;
+        }
+        xxsv = xx; yysv = yy;
+      }
+      bflg = 0;
+      x = xsav; y = ysav;
+      gxconv (x+1.0,y+1.0,&xx,&yy,3);
+      gxplot (xx,yy,3);
+      xxsv = xx;
+      yysv = yy;
+      iisav = -999;
+      iacc = 0;
+      acnt = 19;
+      while (x>=0.0 && x<(float)(is-1) && y>=0.0 && y<(float)(js-1)) {
+        ii = (int)x;
+        jj = (int)y;
+        xx = x - (float)ii;
+        yy = y - (float)jj;
+        up = u + jj*is+ii;      
+        vp = v + jj*is+ii;
+        if (*up==uund || *(up+1)==uund ||
+            *(up+is)==uund || *(up+is+1)==uund) break;
+        if (*vp==vund || *(vp+1)==vund ||
+            *(vp+is)==vund || *(vp+is+1)==vund) break;
+        if (flag) {
+          cp = c + jj*is+ii;
+          if (*cp==cund || *(cp+1)==cund ||
+              *(cp+is)==cund || *(cp+is+1)==cund) icol = 15;
+          else {
+            cv1 = *cp + (*(cp+1)-*cp)*xx;
+            cv2 = *(cp+is) + (*(cp+is+1)-*(cp+is))*xx;
+            cv = cv1 + (cv2-cv1)*yy;
+            icol = gxshdc(shdlvs,shdcls,shdcnt,cv);
+          }
+          if (icol!=scol && icol>-1) gxcolr(icol);
+          scol = icol;
+        }
+        uv1 = *up + (*(up+1)-*up)*xx;
+        uv2 = *(up+is) + (*(up+is+1)-*(up+is))*xx;
+        uv = uv1 + (uv2-uv1)*yy;
+        vv1 = *vp + (*(vp+1)-*vp)*xx;
+        vv2 = *(vp+is) + (*(vp+is+1)-*(vp+is))*xx;
+        vv = vv1 + (vv2-vv1)*yy;
+        auv = fabs(uv); avv=fabs(vv);
+        if (auv<0.1 && avv<0.1) break;
+        if (auv>avv) {
+          vv = vv*fact/auv;
+          uv = uv*fact/auv;
+        } else {
+          uv = uv*fact/avv;
+          vv = vv*fact/avv;
+        }
+        x = x - uv;
+        y = y - vv;
+        ii1 = (int)(x*rscl);
+        ij1 = (int)(y*rscl);
+        ii1 = ij1*iss + ii1;
+        if (ii1<0 || ii1>=siz) break;
+        if (*(it+ii1)==1) break;
+        if (ii1!=iisav && iisav>-1) *(it+iisav) = 1;
+        if (ii1==iisav) iacc++;
+        else iacc = 0;
+        if (iacc>10) break;
+        iisav = ii1;
+        gxconv (x+1.0,y+1.0,&xx,&yy,3);
+        if (icol>-1) {
+          if (bflg) {gxplot(xold,yold,3); bflg=0;}
+          gxplot (xx,yy,2);
+        } else bflg = 1;
+        xold = xx;
+        yold = yy;
+        acnt++;
+        if (acnt>20) {
+          if (icol>-1) strmar(xx,yy,xxsv,yysv);
+          acnt = 0;
+        }
+        xxsv = xx; yysv = yy;
+      }
+    }
+    i2++;
+    if (i2==iss) { i2 = 0; j2++; }
+  }
+  free (it);
+}
+
+static float a150 = 150.0*3.1416/180.0;
+
+void strmar (float xx1, float yy1, float xx2, float yy2) {
+float dir;
+  dir = atan2(yy2-yy1,xx2-xx1);
+  gxplot (xx2,yy2,3);
+  gxplot (xx2+0.05*cos(dir+a150),yy2+0.05*sin(dir+a150),2);
+  gxplot (xx2,yy2,3);
+  gxplot (xx2+0.05*cos(dir-a150),yy2+0.05*sin(dir-a150),2);
+  gxplot (xx2,yy2,3);
+}
+
+/* Given a shade value, return the relevent color */
+
+int gxshdc (float *shdlvs, int *shdcls, int shdcnt, float val) {
+int i;
+
+  if (shdcnt==0) return(1);
+  if (shdcnt==1) return(shdcls[0]);
+  if (val<shdlvs[1]) return(shdcls[0]);
+  for (i=1; i<shdcnt-1; i++) {
+    if (val>=shdlvs[i] && val<shdlvs[i+1])
+                 return(shdcls[i]); 
+  }
+  return(shdcls[shdcnt-1]);
+}
diff --git a/ppl/tmapadds/hatch_fill_rep.F b/ppl/tmapadds/hatch_fill_rep.F
new file mode 100644
index 0000000..4bf5f17
--- /dev/null
+++ b/ppl/tmapadds/hatch_fill_rep.F
@@ -0,0 +1,80 @@
+	SUBROUTINE HATCH_FILL_REP (zwsid)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Setup the fill area indices for hatching
+
+*	J Davison JISAO/PMEL/TMAP
+*	9.2.88/3.15.89
+*	*jd* 2.14.92 mod to support atc gks
+*	*jd* 10.12.92 mod for new hatching scheme
+
+
+        IMPLICIT NONE
+  	include 'gkspar.inc'
+        include 'shade_vars.cmn'
+
+	integer		zwsid,patt,ndx
+
+*******************************************************************************
+
+
+*	USE AREA BUNDLES IF SET
+	if (area_bundles) then
+
+*	   MISSING VALUE IS SOLID FILL
+	   call FGD_GSFAR(zwsid,1,gsolid,1,1)
+
+*	   GO THRU AVAILABLE HATCHING LEVELS 
+	   do 10 ndx = 1,shd_levels
+#ifdef atc_gks
+	      patt = -1000 - (ndx-1)*9/(shd_levels)
+#else
+	      patt = -1 - (ndx-1)*9/(shd_levels)
+#endif
+	      call FGD_GSFAR(zwsid,ndx+1,ghatch,patt,1)
+10	   continue
+	else
+#ifdef atc_gks
+	   call guesc020 (zwsid,gsalws)
+#endif
+	   call FGD_GSFAIS(ghatch)
+	   call FGD_GSFACI(1)
+	endif
+
+	return
+
+	end
diff --git a/ppl/tmapadds/its_gksm.c b/ppl/tmapadds/its_gksm.c
new file mode 100644
index 0000000..6f1b555
--- /dev/null
+++ b/ppl/tmapadds/its_gksm.c
@@ -0,0 +1,48 @@
+/*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.  
+*
+*/
+
+
+
+/* 
+ * boolean function returns 1 or 0 to tell if the given
+ * GKS workstation is a GKSM metafile workstation
+ */
+
+int its_gksm_(int *wkid)
+{
+    return 0;
+}
+
diff --git a/ppl/tmapadds/key.F b/ppl/tmapadds/key.F
new file mode 100644
index 0000000..8189b16
--- /dev/null
+++ b/ppl/tmapadds/key.F
@@ -0,0 +1,725 @@
+	SUBROUTINE KEY 
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Generates color/gray scale key
+* 	J Davison JISAO/PMEL/NOAA
+*	7.20.88
+
+*	Modified to PPL_KEY to fit into ppl
+*	J Davison 8.17.88
+*	Mod introducing xmaxx and ymaxx to limit size of key JD 4.11.90
+*	Mod to control font thickness JD 8.3.90
+*	Mod to support ATC individual fill area reps *jd* 4.2.92
+*       Mod to support single level chosen by user 8.25.92 *jd*
+*	Mod to protect colors used already *jd* 10.1.92
+*	Mod to use new hatch scheme *jd* 10.12.92 - cancelled 10.22.92
+*	Mod to use SYMBEL rather than GTX for key labels *jd* 3.4.93
+* 	Mod to provide identical endpoint values for a constant field/jd/5.96
+*       Mod for FILLPOL *jd* 3.99
+* v541 *acm*  5/02 add option to control outline on the shade key boxes (cont_key)
+*                  also remove VMS INCLUDES
+* 552 *acm* 4/03 Shade key improvements: 
+* 	1) Larger default label size 
+*       2) Can change the location of the labels from right to left and
+*           top to bottom, by sending a negative value for the label size.
+* 	3) The labels are right-justified (may not look it, depending on font) 
+*           for vertical shade keys that are labelled on the left
+*       4) Do not have to set all four corners when changing the size and
+*           location of the shade key -- can reset any of the four, and
+*           others will be filled in by making the key the default size
+*           in that direction.  See shade_key.F 
+* v553 *acm* Fix bug where length of the first numeric key label was not
+*           taken into account when determining label size: computing max_len
+* V553 *acm* 9/03 Introduce flag check_0. On Linux, there may be a 
+*           be a level of -6.E-07 or some such, where it should be 0.
+*           Check whether the numbers for the labels are all small,
+*           in which case we leave things alone; otherwise use TM_FPEQ_SNGL
+*           to see if the value should be exactly 0.  
+* V554 *acm* 11/03 Call TM_FMT_SNGL_digits rather than TM_FMT_SNGL: if the shakey
+*                  parameter klab_dig is negative, requesting an exact
+*                  number of decimal places.  The change is to force the
+*                  same number of digits for all labels. -- more consistent 
+*                  output, better justification.
+* V580 *acm* 7/04  When the user has set the location and size of the colorbar,
+*                  the position of the labels was too close to the edge of the
+*                  vertical colorbar.
+* V580 *acm* 8/04  Allow for PPL POLYGON as well as PPL FILLPOL after a POLY/SET command.
+* V580 *acm* 11/04 Make the default key label size 0.1, to match axis labels. Change
+*                  setting so the key labels do not go so close to the edge of the plot.
+* V580 *acm* 11/04 Fix bug 906: default number of digits did not distinguish different 
+*                  levels; got repeated labels 370, 371, 371, 372, 372,...
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* V600 *acm* 8/05 fix bug 1330; vertical position of key labels, -0.5*karht was missing 
+*                 on definition of yy
+* V600 *acm* 9/05 fix bug 1339, with (-inf) (inf) levels and the shakey setting klab_dig=0,
+*                 we had an infinite loop on DO 30. Start the loop at ndx = lev1+1, not 1.
+* V600 *acm* 1/06 Among the changes when we added TM_FMT_SNGL_digits, when checking whether more 
+*                 digits are needed, keep track of digits added; need to increase the  
+*                 argument klab_len by the same amount in subsequent calls to TM_FMT_SNGL_DIGITS  
+*                 when we are writing the numeric labels on the key. 
+* V610 *acm* 3/08 For larger default number of levels, make fewer labels when the key is short.
+* V630 *acm* 9/09 Fix color key labels that run off the edge of the plot 
+* V670 *acm* 2/11 Fix ticket 1798. The fix to 1339 starting label loops at ndx=lev1+1 
+*                 was not applied to loop 20 for horizontal keys.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 4/13 For horizontal keys check that there is room for the labels and adjust
+*                 label size and/or increment
+* PyFr *kms*  7/13 Use XCSIZE or YCSIZE (which scales with plot text size) as the 
+*                  (maximum, default) character height for the key labels; 
+*                  rename and remove local vars px and py equivalenced to local 
+*                  vars kpx and kpy; comment out calls to TM_FMT_SNGL_DIGITS 
+*                  that are immediately followed by a call to TM_FMT_SNGL
+* v686 *acm* 1/14 Fix ticket 2123: labeling color bar when there is just one level.
+*                 Remove the special code that labeled the top and bottom of a single-level
+*                 color key with the lower boundary of the level. See the 5/96 commend above) 
+*                 Instead label with the upper and lower edges of that color level.
+* v686 *acm* 1/14 Fixes for labels on horizontal keys: make sure they don't get too small, and
+*                 don't let them run over each other. Locate the horizontal colorbar close to
+*                 the plot with labels above them. Behavior of args to SHAKEY is unchanged.
+* v686 *acm* 2/14 Fix ticket 2124: Do the fix for 2124 only here, not in subr. LEV.
+
+        IMPLICIT NONE
+	include 	'parampl5_dat.decl'
+	include 	'PARAMPL5.DAT'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+        include 	'pltcom_dat.decl'
+        include 	'PLTCOM.DAT'
+        include 	'pltl_inc.decl'
+        include 	'PLTL.INC'
+
+        include         'axis_inc.decl'
+        include         'AXIS.INC'
+        include         'plt_inc.decl'
+        include         'PLT.INC'
+        include         'pen_inc.decl'
+        include         'PEN.INC'
+
+        include         'shade_vars.cmn'
+        include         'gkscm1_inc.decl'
+        include         'GKSCM1.INC'
+        include         'gkscm2.cmn'
+
+	include        'gkspar.inc'
+
+	integer		ndx,str_len,max_len,incr,lab_digits, nhi, ncount,
+     .                  lab_add, nlab, i, kount, lev1, levn, nspace
+
+	real		x_inc,y_inc,px(4),py(4),rem,kpx(5),kpy(5),flaty(5),flatx(5)
+	real		xmaxx,ymaxx,vwidth,vheight,karht, ksiz_test
+	real		xx,yy,xxx,yyy, xx1, xxn, xxlen
+        real            kx_lo_def, kx_hi_def, ky_lo_def, ky_hi_def,
+     .                  val, del, x_inc_inf, y_inc_inf, frac, fixx, inc_min
+        real*8          val_n, val_last
+	character*12	text, TM_FMT_SNGL, TM_FMT_SNGL_DIGITS, 
+     .			txt_out, blanks
+        character*20    buff
+	logical		TM_FPEQ_SNGL, TM_DFPEQ, ITSA_AXIS_VIEW, windof_hold, 
+     .                  check_0, increase_digits, nofill, cont_key_keep, no_lines
+
+	external	TM_FMT_SNGL, TM_FMT_SNGL_DIGITS
+
+	include 	'ppl_in_ferret.cmn'	
+
+        DATA      blanks/'            '/
+
+*******************************************************************************
+
+*	CANCEL WINDOW ON IF SET
+	windof_hold = windof
+	windof = .false.
+
+	cont_key_keep = cont_key
+
+* Decide whether to check for small numeric values in the key labels.
+* If delta is large, we dont want 0.000005 to be labelled in an exponential
+* format (it is zero with a bit of noise). But if all the numbers are 
+* small, label them as is. 
+
+        del = 1
+        check_0 = .TRUE.
+
+        lev1 = 1
+        levn = nlev2
+	IF (levn.EQ.1) ZLEV(2) = zlev(1)
+        IF (neginf) lev1 = 2
+        IF (posinf) levn = nlev2 - 1
+
+	nofill = (levn .EQ. 1 .AND. zlev(1) .GE. 1.e33)
+	IF (nofill) GOTO 2000
+
+        IF (shd_levels .GT. 1) del = zlev(lev1+1) - zlev(lev1)
+        IF (TM_FPEQ_SNGL(del,0.)) check_0 = .FALSE.
+        
+! IF (INF) levels, will force triangles to be at least 5% of length of colorbar
+
+        frac = 0.05
+        ncount = 1./frac
+
+* See if klab_dig is enough digits to distinguish the levels. 
+
+        lab_digits = klab_dig
+        lab_add = 0
+        increase_digits = .TRUE.
+
+	kount = 0
+        DO WHILE (increase_digits .AND. ABS(lab_digits) .LE. klab_len .AND.kount.LT.10)
+           buff = ' '
+           val = zlev(lev1)
+           IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+ 	   buff = 
+     .        TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+5,str_len)
+
+           READ (buff,*) val_last
+           increase_digits = .FALSE.
+
+           max_len = 0
+	   DO 30 ndx = lev1+1, shd_levels
+             val = zlev(ndx)
+             IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+	     buff = 
+     .          TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+5,str_len)
+
+             READ (buff,*) val_n
+             IF ( TM_DFPEQ(val_last, val_n) ) increase_digits = .TRUE.
+             val_last = val_n
+             IF (max_len .lt. str_len) max_len = str_len
+   30      CONTINUE
+
+           IF (increase_digits) THEN
+              IF (lab_digits .GT. 0) lab_digits = lab_digits + 1
+              IF (lab_digits .LT. 0) lab_digits = lab_digits - 1
+              lab_add = lab_add + 1
+           ENDIF
+	   kount = kount + 1
+        ENDDO
+
+	IF (vertical_key) GOTO 1000
+
+*	MAKE A HORIZONTAL KEY
+* Define default x and y lo and hi locations
+
+        if (ppl_in_ferret) then
+           call get_view_size (vwidth,vheight)
+
+           IF (ITSA_AXIS_VIEW(1)) vheight = (ylen + yorg )* 1.15
+
+           if (vheight .le. ylen + yorg) goto 2000
+
+           rem = vheight - (ylen + yorg)
+
+           kx_lo_def = 1000.0 *  xorg
+           kx_hi_def = 1000.0 * (xorg + xlen)
+
+           ky_lo_def = 1000.0 * (yorg + ylen)
+           ky_hi_def = 1000.0 * (yorg + ylen + 0.16*rem)
+
+        else
+           rem = height - (ylen + yorg)
+	   ymaxx = 0.25*ylen
+           kx_lo_def = 1000.0 *  xorg 
+           kx_hi_def = 1000.0 * (xorg + xlen)
+           ky_lo_def = 1000.0 * (yorg + ylen + 0.25*min (rem,ymaxx))
+           ky_hi_def = yorg+ylen+ymaxx
+           ky_hi_def = height-0.1*rem
+           ky_hi_def = 1000.0 * min (yorg+ylen+ymaxx,height-0.1*rem)
+        end if
+
+        IF (kuser_loc(1) .OR. kuser_loc(2) .OR. 
+     .      kuser_loc(3) .OR. kuser_loc(4)) THEN  
+
+! Some or all of kx_lo,kx_hi,ky_lo,ky_hi  are already set
+
+           IF ((.NOT.kuser_loc(1)) .AND. (.NOT.kuser_loc(2))) THEN
+              kx_lo = kx_lo_def
+              kx_hi = kx_hi_def
+           ELSEIF ((.NOT.kuser_loc(1)) .AND. kuser_loc(2) ) THEN
+              kx_lo = kx_hi - (kx_hi_def - kx_lo_def)
+           ELSEIF (kuser_loc(1) .AND. (.NOT.kuser_loc(2)) ) THEN
+              kx_hi = kx_lo + (kx_hi_def - kx_lo_def)
+           ENDIF 
+
+           IF ((.NOT.kuser_loc(3)) .AND. (.NOT.kuser_loc(4)) ) THEN
+              ky_lo = ky_lo_def
+              ky_hi = ky_hi_def
+           ELSEIF ((.NOT.kuser_loc(3)) .AND. kuser_loc(4) ) THEN
+              ky_lo = ky_hi - 0.4*(ky_hi_def - ky_lo_def)
+           ELSEIF (kuser_loc(3) .AND. (.NOT.kuser_loc(4)) ) THEN
+              ky_hi = ky_lo + 0.4*(ky_hi_def - ky_lo_def)
+           ENDIF
+	   y_inc = 0.1 * (ky_hi - ky_lo)
+
+* When not kuser_loc, we will use the default locations
+
+        ELSE
+           kx_lo = kx_lo_def
+           kx_hi = kx_hi_def
+           ky_lo = ky_lo_def
+           ky_hi = ky_hi_def
+	   y_inc = 0.25 * (ky_hi - ky_lo)
+        ENDIF
+
+	x_inc = (kx_hi - kx_lo)/MAX (1.0, real (shd_levels))
+        
+        x_inc_inf = x_inc
+
+! IF (INF) levels, force triangles to be at least 5% of length of colorbar
+
+        IF (neginf .AND. posinf) THEN
+           IF (shd_levels .GT. ncount) THEN 
+              x_inc_inf = frac* (kx_hi - kx_lo)
+              x_inc = (1.-2.*frac)*(kx_hi - kx_lo)/ REAL(shd_levels-2)
+              kx_lo = kx_lo + (x_inc_inf-x_inc)
+           ENDIF
+        ELSEIF (neginf .OR. posinf) THEN
+           IF (shd_levels .GT. ncount) THEN 
+              x_inc_inf = frac* (kx_hi - kx_lo)
+              x_inc = (1.-frac)*(kx_hi - kx_lo)/ REAL(shd_levels-1)
+              IF (neginf) kx_lo = kx_lo + (x_inc_inf-x_inc)
+           ENDIF
+        ENDIF
+
+* Dont draw lines between color levels when they will be too close together (see ticket 1535)
+
+c	inc_min = 50
+c	no_lines = .FALSE.
+c	IF ( (x_inc .LT. inc_min) .AND. (INT(0.5 + inc_min/x_inc) .GE. 2) ) no_lines = .TRUE.
+c	IF ( (INT(0.5 + inc_min/x_inc) .GE. 2) ) no_lines = .TRUE.
+c	IF ( no_lines ) cont_key = .TRUE.
+
+*	SET CHARACTER HEIGHT IN WORLD COORDINATES, AND INCR INDEX
+
+* make sure there is a space between one label and the next
+	 max_len = max_len+1  
+
+	if (klab_incr .eq. 0) then
+	   incr = (shd_levels/25) + 1
+           IF (width/vwidth .GT. 1.5) incr = 2*incr
+	else
+	   incr = klab_incr
+	end if
+
+	karht = amin1 (xcsize*1000.0,
+     .		1.0*x_inc*real(incr)/real(max_len))/1000.0
+	if (klab_size .NE. 0) karht = ABS(klab_size)  
+
+* Is there room for the labels at their current size?
+* If not adjust the size and/or increment
+
+        IF (incr .GT. 0) THEN
+
+	   xx1 = (kx_lo + x_inc*real(lev1-1))/1000.0 - xorg
+	   xxn = (kx_lo + x_inc*real(shd_levels))/1000.0
+     .		 + karht*real(max_len) - xorg
+	   xxlen = xxn-xx1
+	   nlab = INT( 0.5+(shd_levels-lev1)/incr )
+	
+	   IF (nlab*max_len*karht .GT. xxlen) THEN
+	      karht = 0.85*xxlen/FLOAT(nlab*max_len)
+	   ENDIF
+
+	   ksiz_test = 0.06 * xcsize
+           IF (klab_size .NE. 0) THEN
+	      IF (ABS(klab_size) .LT. ksiz_test) ksiz_test = ABS(klab_size)
+	   ENDIF
+
+	   IF (karht .LT. ksiz_test) THEN
+	      incr = incr*1.5
+	      nlab = INT( 0.5+(shd_levels-lev1)/incr )
+	      karht = 0.85*xxlen/FLOAT(nlab*max_len)
+	   ENDIF
+
+	   ksiz_test = 0.075 * xcsize
+           IF (klab_size .NE. 0) ksiz_test = ABS(klab_size)
+	   kount = 0
+	   DO WHILE (karht .LT. ksiz_test .AND. karht.GT.0. .AND. kount.LT.10)
+	      incr = incr+1
+	      nlab = INT( 0.5+(shd_levels-lev1)/incr )
+	      karht = 0.85*xxlen/FLOAT(nlab*max_len)
+	      kount = kount + 1
+	   ENDDO
+	   IF (karht .GT. ksiz_test) karht = ksiz_test
+	ENDIF
+
+*	GENERATE THE KEY FOR EACH COLOR/SHADE
+	max_len = 0
+	val = zlev(lev1)
+	IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+C	text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)  
+	text = TM_FMT_SNGL (val,lab_digits,klab_len+lab_add,str_len)  
+        if (max_len .lt. str_len) max_len = str_len
+        
+        nhi = MAX(2,shd_levels+1)
+	do 10 ndx = 2, nhi
+	   kpx(1) = kx_lo + real (ndx - 2) * x_inc
+	   kpx(2) = kx_lo + real (ndx - 2) * x_inc
+	   kpx(3) = kx_lo + real (ndx - 1) * x_inc
+	   kpx(4) = kx_lo + real (ndx - 1) * x_inc
+
+	   kpy(1) = ky_hi
+	   kpy(2) = ky_hi - 4.0 * y_inc 
+	   kpy(3) = ky_hi - 4.0 * y_inc
+	   kpy(4) = ky_hi
+
+           IF (kuser_loc(3) .OR. kuser_loc(4)) THEN
+              kpy(2) = ky_lo
+              kpy(3) = ky_lo
+              kpy(1) = ky_hi
+              kpy(4) = ky_hi
+           ENDIF
+
+           IF ( (ndx.EQ.2) .AND. (annotate_key.EQ.1) .AND. 
+     .          (.NOT.neginf) ) CALL key_annotate 
+     .          (kpx, kpy, lab_digits, karht, 1, 2)
+
+           IF ( (ndx.EQ.nhi) .AND. (annotate_key.EQ.1) .AND.
+     .          (.NOT.posinf) ) CALL key_annotate 
+     .          (kpx, kpy, lab_digits, karht, 2, 2)
+
+           IF (neginf .AND. (ndx .EQ. 2) ) THEN
+              CALL key_lo_inf_horz (kpx, kpy, ndx, x_inc_inf, 
+     .          annotate_key, lab_digits, karht)
+
+           ELSE IF (posinf .AND. (ndx .EQ. nhi) ) THEN
+              CALL key_hi_inf_horz (kpx, kpy, ndx, x_inc_inf, 
+     .          annotate_key, lab_digits, karht)
+
+           ELSE
+
+*	      CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+              CALL set_fill_ndx (ndx)
+              CALL FGD_GFA(4,kpx,kpy)
+
+              kpx(5) = kpx(1)
+              kpy(5) = kpy(1)
+              IF (.NOT. cont_key) CALL FGD_GPL(5,kpx,kpy)
+
+           ENDIF ! neginf or posinf
+
+           IF (ndx .GE. lev1 .AND. ndx .LE. levn) THEN
+              val = zlev(ndx)
+              IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+C	      text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)
+	      text = TM_FMT_SNGL (val,lab_digits,klab_len+lab_add,str_len)
+	      if (max_len .lt. str_len) max_len = str_len
+           ENDIF
+10	continue
+
+        IF (incr .GT. 0) THEN
+
+	do 20 ndx = lev1,shd_levels+1,incr
+
+*	   WRITE OUT CORRESPONDING VALUE
+
+             val = zlev(ndx)
+             IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+C	     text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)
+	     text = TM_FMT_SNGL (val,lab_digits,klab_len+lab_add,str_len)
+
+             IF (ndx .EQ. 1 .AND. neginf) text = " "
+             IF (ndx .EQ. shd_levels+1 .AND. posinf) text = " "
+
+	   xx = (kx_lo + x_inc*real(ndx-1))/1000.0
+     .		 - karht*real(str_len)/2.0 - xorg
+	   yy = (ky_hi - 5.0 * y_inc)/1000.0 - yorg - 1.5*karht
+           IF (kuser_loc(3) .OR. kuser_loc(4) ) 
+     .            yy = (ky_lo - y_inc)/1000.0-yorg-1.5*karht
+
+* If klab_size negative put the key labels on the top rather than the 
+* bottom of the key
+
+           IF (klab_size .LE. 0) THEN
+              yy = (ky_hi)/1000.0 - yorg + karht
+           ENDIF
+
+*	   FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+	   if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	      call point_convert (xx,yy,xxx,yyy)
+	   else if (makep .eq. 'FILL') then
+	      xxx = xx
+	      yyy = yy
+	   endif
+
+	   call symbel (xxx,yyy,0.0,karht,str_len,text(1:str_len))
+
+20	continue
+        ENDIF
+
+*  Set these to actual locations that were used for PPL LIST SHAKEY
+        ky_hi = kpy(1)
+        ky_lo = kpy(2)
+
+	goto 2000
+
+*	MAKE A VERTICAL KEY 
+1000	CONTINUE
+
+* Define default x and y lo and hi locations
+
+
+        if (ppl_in_ferret) then
+           call get_view_size (vwidth,vheight)
+
+           IF (ITSA_AXIS_VIEW(1)) vwidth = (xlen + xorg )* 1.15
+           if (vwidth .le. xlen + xorg) goto 2000
+
+	   rem = vwidth - (xlen + xorg)
+	   xmaxx = 0.25*xlen
+
+           kx_lo_def = 1000.0 * (xorg + xlen + 0.2*min (rem,xmaxx))
+           kx_hi_def = 1000.0 * min (xorg + xlen + xmaxx,vwidth-0.08*rem)
+           ky_lo_def = 1000.0 *  yorg
+           ky_hi_def = 1000.0 * (yorg + ylen)
+        else
+	   rem = width - (xlen + xorg)
+	   xmaxx = 0.25*xlen
+           kx_lo_def = 1000.0 * (xorg + xlen + 0.2*min (rem,xmaxx))
+           kx_hi_def = 1000.0 * min (xorg + xlen + xmaxx,width-0.08*rem)
+           ky_lo_def = 1000.0 *  yorg
+           ky_hi_def = 1000.0 * (yorg + ylen)
+        end if
+
+        IF (kuser_loc(1) .OR. kuser_loc(2) .OR. 
+     .      kuser_loc(3) .OR. kuser_loc(4)) THEN  
+
+! Some or all of kx_lo,kx_hi,ky_lo,ky_hi  are already set
+
+           IF ((.NOT.kuser_loc(1)) .AND. (.NOT.kuser_loc(2))) THEN
+              kx_lo = kx_lo_def
+              kx_hi = kx_hi_def
+           ELSEIF ((.NOT.kuser_loc(1)) .AND. kuser_loc(2) ) THEN
+              kx_lo = kx_hi - 0.4*(kx_hi_def - kx_lo_def)
+           ELSEIF (kuser_loc(1) .AND. (.NOT.kuser_loc(2)) ) THEN
+              kx_hi = kx_lo + 0.4*(kx_hi_def - kx_lo_def)
+           ENDIF 
+
+           IF ((.NOT.kuser_loc(3)) .AND. (.NOT.kuser_loc(4))) THEN
+              ky_lo = ky_lo_def
+              ky_hi = ky_hi_def
+           ELSEIF ((.NOT.kuser_loc(3)) .AND. kuser_loc(4) ) THEN
+              ky_lo = ky_hi - (ky_hi_def - ky_lo_def)
+           ELSEIF (kuser_loc(3) .AND. (.NOT.kuser_loc(4)) ) THEN
+              ky_hi = ky_lo + (ky_hi_def - ky_lo_def)
+           ENDIF 
+
+* When not kuser_loc, we will use the default locations
+
+        ELSE
+           kx_lo = kx_lo_def
+           kx_hi = kx_hi_def
+           ky_lo = ky_lo_def
+           ky_hi = ky_hi_def
+        ENDIF
+
+	x_inc = 0.1 * (kx_hi - kx_lo)
+	y_inc = (ky_hi - ky_lo)/MAX (1.0, REAL (shd_levels))
+
+        y_inc_inf = y_inc
+
+! IF (INF) levels, force triangles to be at least 5% of length of colorbar
+
+        IF (neginf .AND. posinf) THEN
+           IF (shd_levels .GT. ncount) THEN 
+              y_inc_inf = frac* (ky_hi - ky_lo)
+              y_inc = (1.-2.*frac)*(ky_hi - ky_lo)/ REAL(shd_levels-2)
+              ky_lo = ky_lo + (y_inc_inf-y_inc)
+           ENDIF
+        ELSE IF (neginf .OR. posinf) THEN
+           IF (shd_levels .GT. ncount) THEN 
+              y_inc_inf = frac* (ky_hi - ky_lo)
+              y_inc = (1.-frac)*(ky_hi - ky_lo)/ REAL(shd_levels-1)
+              IF (NEGINF) ky_lo = ky_lo + (y_inc_inf-y_inc)
+           ENDIF
+        ENDIF
+
+* Don't draw lines between color levels when they will be too close together (see ticket 1535)
+
+c	inc_min = 50
+c	no_lines = .FALSE.
+c	IF ( (y_inc .LT. inc_min) .AND. (INT(0.5 + inc_min/y_inc) .GE. 2) ) no_lines = .TRUE.
+c	IF ( (INT(0.5 + inc_min/y_inc) .GE. 2) ) no_lines = .TRUE.
+c	IF ( no_lines ) cont_key = .TRUE.
+
+*	SET CHARACTER HEIGHT IN WORLD COORDINATES, AND INCR INDEX
+        if (klab_size .eq. 0.0) then
+	   karht = amin1 (ycsize*1000.0,500.0*rem/real(max_len))/1000.0
+	else
+	   karht = ABS(klab_size)
+	end if
+
+	if (klab_incr .eq. 0) then
+	   incr = (shd_levels/25) + 1
+           IF (height/vheight .GT. 1.5) incr = 2*incr   ! short plot, fewer labels
+	else
+	   incr = klab_incr
+	end if
+	
+! The default locations often make the labels run off to the right. 
+! Check for this and move the key over
+
+	IF ((kx_hi_def/1000 + max_len*karht ) .GT. width) THEN
+	   fixx = (kx_hi_def/1000 + max_len*karht  - width) *1000
+           kx_lo_def = kx_lo_def - fixx
+           kx_hi_def = kx_hi_def - fixx
+        ENDIF
+
+*	GENERATE THE KEY FOR EACH COLOR/SHADE
+	max_len = 0
+
+        val = zlev(lev1)
+        IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+	text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)
+
+	if (max_len .lt. str_len) max_len = str_len	
+
+        nhi = MAX(2,shd_levels+1)
+	do 1010 ndx = 2, nhi
+	   kpx(1) = kx_lo
+	   kpx(2) = kx_lo + 4.0*x_inc
+	   kpx(3) = kx_lo + 4.0*x_inc
+	   kpx(4) = kx_lo
+
+           IF ( kuser_loc(1) .OR. kuser_loc(2)) THEN
+              kpx(1) = kx_lo
+              kpx(4) = kx_lo
+              kpx(2) = kx_hi
+              kpx(3) = kx_hi
+           ENDIF
+
+	   kpy(1) = ky_lo + real (ndx - 2) * y_inc
+	   kpy(2) = ky_lo + real (ndx - 2) * y_inc
+	   kpy(3) = ky_lo + real (ndx - 1) * y_inc
+	   kpy(4) = ky_lo + real (ndx - 1) * y_inc
+
+           IF ( (ndx.EQ.2) .AND. (annotate_key.EQ.1) .AND.
+     .          (.NOT. neginf) ) CALL key_annotate 
+     .          (kpx, kpy, lab_digits, karht, 1, 1)
+
+           IF ( (ndx.EQ.nhi) .AND. (annotate_key.EQ.1) .AND.
+     .          (.NOT. posinf) ) CALL key_annotate 
+     .          (kpx, kpy, lab_digits, karht, 2, 1)
+
+           IF (neginf .AND. (ndx .EQ. 2) ) THEN
+              CALL key_lo_inf_vert (kpx, kpy, ndx, y_inc_inf, 
+     .          annotate_key, lab_digits, karht)
+     
+           ELSE IF (posinf .AND. (ndx .EQ. nhi) ) THEN
+              CALL key_hi_inf_vert (kpx, kpy, ndx, y_inc_inf, 
+     .          annotate_key, lab_digits, karht)
+
+           ELSE
+
+*	   CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+	      call set_fill_ndx (ndx)
+	      call FGD_GFA(4,kpx,kpy)
+
+              kpx(5) = kpx(1)
+              kpy(5) = kpy(1)
+              IF (.NOT. cont_key) call FGD_GPL(5,kpx,kpy)
+
+           ENDIF ! neginf or posinf
+
+           IF (ndx .GE. lev1 .AND. ndx .LE. levn) THEN
+              val = zlev(ndx)
+              IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+	      text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)
+	      if (max_len .lt. str_len) max_len = str_len
+           ENDIF
+1010	continue
+
+        IF (incr .GT. 0) THEN
+        do 1020 ndx = lev1,shd_levels+1,incr
+*	   WRITE OUT CORRESPONDING VALUE
+             val = zlev(ndx)
+             IF (TM_FPEQ_SNGL(val,0.) .AND. check_0) val = 0.
+	     text = TM_FMT_SNGL_DIGITS (val,lab_digits,klab_len+lab_add,str_len)
+             IF (ndx .EQ. 1 .AND. neginf) text = " "
+             IF (ndx .EQ. levn+1 .AND. posinf) text = " "
+
+	   xx = (kx_lo + 5.0*x_inc)/1000.0 - xorg 
+	   xx = (kx_lo + 4.5*x_inc)/1000.0 - xorg 
+	   xx = (kpx(2) + 500*karht)/1000.0 - xorg 
+	   IF (val .LT. 0. )xx = (kpx(2) + 100*karht)/1000.0 - xorg 
+
+           IF (kuser_loc(1) .OR. kuser_loc(2)) 
+     .              xx = (kx_hi+2.*x_inc)/1000 - xorg
+
+* If klab_size negative put the key labels on the left rather than 
+* the right of the key
+
+           IF (klab_size .LT. 0) THEN
+	      xx = (kx_lo)/1000.0 - xorg -(REAL(str_len)+1.)* karht
+              txt_out = text
+
+* If the key labels are to the right, right-justify them.
+
+           ELSE
+              nspace = max_len - str_len
+              txt_out = text
+              IF (nspace .GT. 0 .AND. del.GT.1)THEN 
+                 txt_out = blanks(1:nspace)//text(1:str_len)
+                 str_len = max_len
+              ENDIF
+           ENDIF
+
+	   yy = (ky_lo + y_inc*real (ndx-1))/1000.0 - yorg - 0.5*karht
+!	   yy = (ky_lo + y_inc*real (ndx-1))/1000.0 - yorg   (this caused bug 1330!)
+
+*	   FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+
+	   if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+              call point_convert (xx,yy,xxx,yyy)
+	   else if (makep .eq. 'FILL') then
+	      xxx = xx
+	      yyy = yy
+	   endif
+	   call symbel (xxx,yyy,0.0,karht,str_len,txt_out(1:str_len))
+
+1020	continue
+        ENDIF
+
+*  Set these to actual locations that were used for PPL LIST SHAKEY
+        kx_lo = kpx(1)
+        kx_hi = kpx(2)
+
+2000	windof = windof_hold
+	cont_key = cont_key_keep
+
+	return
+	end
diff --git a/ppl/tmapadds/key_annotate.F b/ppl/tmapadds/key_annotate.F
new file mode 100644
index 0000000..52fe225
--- /dev/null
+++ b/ppl/tmapadds/key_annotate.F
@@ -0,0 +1,156 @@
+      SUBROUTINE key_annotate (px, py, lab_digits, height, lohi, vh)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Label the color key with high and low values at each end
+* (only if they're valid values) 
+** V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 5/13  changes for ribbon plots
+
+*  kpx		corners of box of color in colorbar
+*  kpy
+*  lab_digits	digits used in key labels
+*  height	size of label
+*  lohi		1 = lo, 2 = hi
+*  vh		1 = vert, 2 = horiz
+
+      IMPLICIT NONE
+      INCLUDE 	'parampl5_dat.decl'
+      INCLUDE 	'PARAMPL5.DAT'
+      INCLUDE   'cont_inc.decl'
+      INCLUDE	'CONT.INC'           ! with cont_key
+      INCLUDE	'axis_inc.decl' 
+      INCLUDE	'AXIS.INC'           ! with xorg, yorg
+      INCLUDE	'PLTL.INC'           ! with makep
+      INCLUDE	'hd_inc.decl'
+      INCLUDE	'HD.INC'             ! with zmin, zmax
+
+* Calling arguments
+      REAL px(*),py(*), h_inc, height
+      INTEGER lab_digits, lohi, vh
+
+* Internal declerations
+      INTEGER maxlen, slen, ldigits
+      REAL x1, x2, x3, x4, y1, y2, y3, y4
+      REAL delx, xx, yy, xxx, yyy
+      CHARACTER*20 TM_FMT_SNGL_DIGITS, text
+
+* If min and max values havent been set then return.
+      IF (zmin .EQ. 1e33 .OR. zmax .EQ. -1*1e33) RETURN
+
+* save px and py values
+      y1 = py(1)
+      y2 = py(2)
+      y3 = py(3)
+      y4 = py(4)
+
+      x1 = px(1)
+      x2 = px(2)
+      x3 = px(3)
+      x4 = px(4)
+
+* Annotate min and max on vertical colorbar
+      IF (lohi .EQ. 1 .AND. vh .EQ. 1 .AND. 
+     .    zmin .NE. 1e33) THEN
+         px(1) = px(1) +  (x3 - x1)/2.
+
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmin,ldigits,maxlen,slen)
+	 xx = px(1)/1000.0 - xorg - (slen/2)* height
+         yy = py(1)/1000.0 - yorg - 2.1* height
+	 
+      ENDIF
+
+      IF (lohi .EQ. 2 .AND. vh .EQ. 1 .AND. 
+     .    zmax .NE. -1*1e33) THEN
+         px(1) = px(1) +  (x3 - x1)/2.
+
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmax,ldigits,maxlen,slen)
+	 xx = px(1)/1000.0 - xorg - (slen/2)* height
+         yy = py(3)/1000.0 - yorg + 1.1* height
+	 
+      ENDIF
+
+* Annotate min and max on horizontal colorbar
+      IF (lohi .EQ. 1 .AND. vh .EQ. 2) THEN
+         py(1) = py(1) +  (y3 - y1)/2.
+
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmin,ldigits,maxlen,slen)
+	 xx = px(1)/1000.0 - xorg - (slen+1)* height
+         yy = py(1)/1000.0 - yorg - 0.5* height
+	 
+      ENDIF
+
+* Annotate max
+      IF (lohi .EQ. 2 .AND. vh .EQ. 2) THEN
+         py(3) = y2 + (y1 - y2)/2.
+
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmax,ldigits,maxlen,slen)
+	 xx = px(3)/1000.0 - xorg + 0.5* height
+         yy = py(3)/1000.0 - yorg - 0.5* height
+	 
+      ENDIF
+
+* FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+      if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	 call point_convert (xx,yy,xxx,yyy)
+      else if (makep .eq. 'FILL') then
+         xxx = xx
+	 yyy = yy
+      endif
+
+      call symbel (xxx,yyy,0.,height,slen,text(1:slen))
+
+* Restore px, py
+
+      py(1) = y1
+      py(2) = y2
+      py(3) = y3
+      py(4) = y4
+
+      px(1) = x1
+      px(2) = x2
+      px(3) = x3
+      px(4) = x4
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/key_hi_inf_horz.F b/ppl/tmapadds/key_hi_inf_horz.F
new file mode 100644
index 0000000..ece4596
--- /dev/null
+++ b/ppl/tmapadds/key_hi_inf_horz.F
@@ -0,0 +1,129 @@
+      SUBROUTINE key_hi_inf_horz (px, py, ndx, h_inc,
+     .          annotate_key, lab_digits, height)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Make the top box (triangle) for the color key when the upper level is
+* value-to-infinity
+*
+*  v581 *acm* 3/05 open levels (-INF) (INF)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 5/13  changes for ribbon plots
+
+      IMPLICIT NONE
+      INCLUDE 	'parampl5_dat.decl'
+      INCLUDE 	'PARAMPL5.DAT'
+      INCLUDE   'cont_inc.decl'
+      INCLUDE	'CONT.INC'           ! with cont_key
+      INCLUDE	'axis_inc.decl'
+      INCLUDE	'AXIS.INC'
+      INCLUDE	'PLTL.INC'
+      INCLUDE	'hd_inc.decl'
+      INCLUDE	'HD.INC'             ! with zmin, zmax
+
+
+* Calling arguments
+      REAL px(*),py(*), h_inc, height
+      INTEGER ndx, annotate_key, lab_digits
+
+* Internal declerations
+      INTEGER maxlen, slen, ldigits
+      REAL x1, x2, x3, x4, y1, y2, y3, y4
+      REAL dely, xx, yy, xxx, yyy
+      CHARACTER*20 TM_FMT_SNGL_DIGITS, text
+
+* save px and py values
+
+      y1 = py(1)
+      y2 = py(2)
+      y3 = py(3)
+      y4 = py(4)
+
+      x1 = px(1)
+      x2 = px(2)
+      x3 = px(3)
+      x4 = px(4)
+
+* triangle
+
+      dely = y1 - y2
+
+      py(3) = y2 + dely/2.
+      px(3) = px(1) + h_inc
+
+*	   CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+       call set_fill_ndx (ndx)
+       call FGD_GFA(3,px,py)
+
+* Outline
+       px(4) = px(1)
+       py(4) = py(1)
+       IF (.NOT. cont_key) call FGD_GPL(4,px,py)
+
+* Annotate max
+
+      IF (annotate_key .GT. 0.) THEN
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmax,ldigits,maxlen,slen)
+	 xx = px(3)/1000.0 - xorg + 0.5* height
+         yy = py(3)/1000.0 - yorg - 0.5* height
+	 
+* FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+         if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	    call point_convert (xx,yy,xxx,yyy)
+         else if (makep .eq. 'FILL') then
+	    xxx = xx
+	    yyy = yy
+         endif
+
+         call symbel (xxx, yyy,0.,height,slen,text(1:slen))
+      ENDIF
+
+
+* Restore px, py
+
+      py(1) = y1
+      py(2) = y2
+      py(3) = y3
+      py(4) = y4
+
+      px(1) = x1
+      px(2) = x2
+      px(3) = x3
+      px(4) = x4
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/key_hi_inf_vert.F b/ppl/tmapadds/key_hi_inf_vert.F
new file mode 100644
index 0000000..d454c94
--- /dev/null
+++ b/ppl/tmapadds/key_hi_inf_vert.F
@@ -0,0 +1,125 @@
+      SUBROUTINE key_hi_inf_vert (px, py, ndx, v_inc,
+     .          annotate_key, lab_digits, height)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Make the top box (triangle) for the color key when the upper level is 
+* value-to-infinity
+*
+*  v581 *acm* 3/05 open levels (-INF) (INF)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 5/13  changes for ribbon plots
+
+      IMPLICIT NONE
+      INCLUDE 	'parampl5_dat.decl'
+      INCLUDE 	'PARAMPL5.DAT'
+      INCLUDE   'cont_inc.decl'
+      INCLUDE	'CONT.INC'           ! with cont_key
+      INCLUDE	'axis_inc.decl'
+      INCLUDE	'AXIS.INC'
+      INCLUDE	'PLTL.INC'
+      INCLUDE	'hd_inc.decl'
+      INCLUDE	'HD.INC'             ! with zmin, zmax
+
+
+* Calling arguments
+      REAL px(*),py(*), h_inc, height, v_inc
+      INTEGER ndx, annotate_key, lab_digits
+
+* Internal declerations
+      INTEGER maxlen, slen, ldigits
+      REAL x1, x2, x3, x4, y1, y2, y3, y4
+      REAL delx, xx, yy, xxx, yyy
+      CHARACTER*20 TM_FMT_SNGL_DIGITS, text
+
+* save px and py values
+
+      y1 = py(1)
+      y2 = py(2)
+      y3 = py(3)
+      y4 = py(4)
+
+      x1 = px(1)
+      x2 = px(2)
+      x3 = px(3)
+      x4 = px(4)
+
+      delx = x3 - x1
+
+      px(3) = x1 + delx/2.
+      py(3) = py(1) + v_inc
+
+*	   CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+       call set_fill_ndx (ndx)
+       call FGD_GFA(3,px,py)
+
+
+* Outline
+       px(4) = px(1)
+       py(4) = py(1)
+       IF (.NOT. cont_key) call FGD_GPL(4,px,py)
+
+      IF (annotate_key .GT. 0) THEN
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmax,ldigits,maxlen,slen)
+	 xx = px(3)/1000.0 - xorg - (slen/2)* height
+         yy = py(3)/1000.0 - yorg + 1.1* height
+	 
+* FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+         if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	    call point_convert (xx,yy,xxx,yyy)
+         else if (makep .eq. 'FILL') then
+	    xxx = xx
+	    yyy = yy
+         endif
+
+         call symbel (xxx, yyy,0.,height,slen,text(1:slen))
+      ENDIF
+
+* Restore px, py
+
+      py(1) = y1
+      py(2) = y2
+      py(3) = y3
+      py(4) = y4
+
+      px(1) = x1
+      px(2) = x2
+      px(3) = x3
+      px(4) = x4
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/key_lo_inf_horz.F b/ppl/tmapadds/key_lo_inf_horz.F
new file mode 100644
index 0000000..5f03ef0
--- /dev/null
+++ b/ppl/tmapadds/key_lo_inf_horz.F
@@ -0,0 +1,131 @@
+      SUBROUTINE key_lo_inf_horz (px, py, ndx, h_inc,
+     .          annotate_key, lab_digits, height)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Make the lowest box (triangle) for the color key when the low level is 
+* value-to-minus-infinity
+*
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 5/13  changes for ribbon plots
+
+      IMPLICIT NONE
+      INCLUDE 	'parampl5_dat.decl'
+      INCLUDE 	'PARAMPL5.DAT'
+      INCLUDE   'cont_inc.decl'
+      INCLUDE	'CONT.INC'           ! with cont_key
+      INCLUDE	'axis_inc.decl'
+      INCLUDE	'AXIS.INC'
+      INCLUDE	'PLTL.INC'
+      INCLUDE	'hd_inc.decl'
+      INCLUDE	'HD.INC'             ! with zmin, zmax
+
+* Calling arguments
+      REAL px(*),py(*), h_inc, height
+      INTEGER ndx, annotate_key, lab_digits
+
+* Internal declerations
+      INTEGER maxlen, slen, ldigits
+      REAL x1, x2, x3, x4, y1, y2, y3, y4
+      REAL dely, xx, yy, xxx, yyy
+      CHARACTER*20 TM_FMT_SNGL_DIGITS, text
+
+* save px and py values
+      y1 = py(1)
+      y2 = py(2)
+      y3 = py(3)
+      y4 = py(4)
+
+      x1 = px(1)
+      x2 = px(2)
+      x3 = px(3)
+      x4 = px(4)
+
+      dely = y1 - y2
+
+* triangle
+
+      py(1) = y2 + dely/2.
+      py(2) = y3
+      py(3) = y4
+
+      px(2) = px(3)
+      px(1) = px(2) - h_inc
+
+*	   CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+       call set_fill_ndx (ndx)
+       call FGD_GFA(3,px,py)
+
+* Outline
+       px(4) = px(1)
+       py(4) = py(1)
+       IF (.NOT. cont_key) call FGD_GPL(4,px,py)
+       
+
+* Annotate min
+      IF (annotate_key .GT. 0) THEN
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmin,ldigits,maxlen,slen)
+	 xx = px(1)/1000.0 - xorg - (slen + 0.5)* height
+         yy = py(1)/1000.0 - yorg - 0.5*height
+	 
+* FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+         if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	    call point_convert (xx,yy,xxx,yyy)
+         else if (makep .eq. 'FILL') then
+	    xxx = xx
+	    yyy = yy
+         endif
+
+         call symbel (xxx,yyy,0.,height,slen,text(1:slen))
+      ENDIF
+
+
+* Restore px, py
+
+      py(1) = y1
+      py(2) = y2
+      py(3) = y3
+      py(4) = y4
+
+      px(1) = x1
+      px(2) = x2
+      px(3) = x3
+      px(4) = x4
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/key_lo_inf_vert.F b/ppl/tmapadds/key_lo_inf_vert.F
new file mode 100644
index 0000000..94b93c5
--- /dev/null
+++ b/ppl/tmapadds/key_lo_inf_vert.F
@@ -0,0 +1,130 @@
+      SUBROUTINE key_lo_inf_vert (px, py, ndx, v_inc,
+     .          annotate_key, lab_digits, height)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* Make the lowest box (triangle) for the color key when the low level is 
+* value-to-minus-infinity
+*
+*  v581 *acm* 3/05 open levels (-INF) (INF)
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V685 *acm* 5/13  changes for ribbon plots
+
+      IMPLICIT NONE
+      INCLUDE 	'parampl5_dat.decl'
+      INCLUDE 	'PARAMPL5.DAT'
+      INCLUDE   'cont_inc.decl'
+      INCLUDE	'CONT.INC'           ! with cont_key
+      INCLUDE	'axis_inc.decl' 
+      INCLUDE	'AXIS.INC'           ! with xorg, yorg
+      INCLUDE	'PLTL.INC'           ! with makep
+      INCLUDE	'hd_inc.decl'
+      INCLUDE	'HD.INC'             ! with zmin, zmax
+
+
+* Calling arguments
+      REAL px(*),py(*), h_inc, height, v_inc
+      INTEGER ndx, annotate_key, lab_digits
+
+* Internal declerations
+      INTEGER maxlen, slen, ldigits
+      REAL x1, x2, x3, x4, y1, y2, y3, y4
+      REAL delx, xx, yy, xxx, yyy
+      CHARACTER*20 TM_FMT_SNGL_DIGITS, text
+
+* save px and py values
+      y1 = py(1)
+      y2 = py(2)
+      y3 = py(3)
+      y4 = py(4)
+
+      x1 = px(1)
+      x2 = px(2)
+      x3 = px(3)
+      x4 = px(4)
+
+* triangle.
+
+      delx = x3 - x1
+
+      px(1) = px(1) + delx/2.
+      px(2) = x3
+      px(3) = x4
+
+      py(1) = py(3) - v_inc
+      py(2) = py(3)
+
+*	   CALL FILL AREA FOR THIS COLOR/GRAY VALUE
+       call set_fill_ndx (ndx)
+       call FGD_GFA(3,px,py)
+
+* Outline
+       px(4) = px(1)
+       py(4) = py(1)
+       IF (.NOT. cont_key) call FGD_GPL(4,px,py)
+ 
+* Annotate min
+      IF (annotate_key .GT. 0) THEN
+         maxlen = 20
+         ldigits = lab_digits+1
+         text = TM_FMT_SNGL_DIGITS (zmin,ldigits,maxlen,slen)
+	 xx = px(1)/1000.0 - xorg - (slen/2)* height
+         yy = py(1)/1000.0 - yorg - 1.5* height
+	 
+* FILL AND SHADE USE DIFFERENT COORD SYSTEMS -- *jd* 6.4.93
+         if (makep .eq. 'SHADE' .or. makep .eq. 'FILLPOL' .OR.
+     .         makep .EQ. 'POLYGON' .or. makep .eq. 'RIBPLOT') then
+	    call point_convert (xx,yy,xxx,yyy)
+         else if (makep .eq. 'FILL') then
+	    xxx = xx
+	    yyy = yy
+         endif
+
+         call symbel (xxx,yyy,0.,height,slen,text(1:slen))
+      ENDIF
+
+* Restore px, py
+
+      py(1) = y1
+      py(2) = y2
+      py(3) = y3
+      py(4) = y4
+
+      px(1) = x1
+      px(2) = x2
+      px(3) = x3
+      px(4) = x4
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/kurv.F b/ppl/tmapadds/kurv.F
new file mode 100644
index 0000000..2f73705
--- /dev/null
+++ b/ppl/tmapadds/kurv.F
@@ -0,0 +1,718 @@
+      subroutine kurv1 (n,x,y,slp1,slpn,islpsw,xp,yp,temp,s,
+     *                  sigma,ierr)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     *tc* 1.26.93  added this 'spline under tension' package.
+*                   called by pplmod_contur and pplmod_arc to interpolate 
+*                   on contour lines.
+
+      IMPLICIT NONE
+      integer n,islpsw,ierr
+      real x(n),y(n),slp1,slpn,xp(n),yp(n),temp(n),s(n),
+     *     sigma
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this subroutine determines the parameters necessary to
+c compute a spline under tension forming a curve in the
+c plane and passing through a sequence of pairs (x(1),y(1)),
+c ...,(x(n),y(n)). for actual computation of points on the
+c curve it is necessary to call the subroutine kurv2.
+c
+c on input--
+c
+c   n is the number of points to be interpolated (n.ge.2).
+c
+c   x is an array containing the n x-coordinates of the
+c   points.
+c
+c   y is an array containing the n y-coordinates of the
+c   points. (adjacent x-y pairs must be distinct, i. e.
+c   either x(i) .ne. x(i+1) or y(i) .ne. y(i+1), for
+c   i = 1,...,n-1.)
+c
+c   slp1 and slpn contain the desired values for the angles
+c   (in radians) of the slope at (x(1),y(1)) and (x(n),y(n))
+c   respectively. the angles are measured counter-clock-
+c   wise from the x-axis and the positive sense of the curve
+c   is assumed to be that moving from point 1 to point n.
+c   the user may omit values for either or both of these
+c   parameters and signal this with islpsw.
+c
+c   islpsw contains a switch indicating which slope data
+c   should be used and which should be estimated by this
+c   subroutine,
+c          = 0 if slp1 and slpn are to be used,
+c          = 1 if slp1 is to be used but not slpn,
+c          = 2 if slpn is to be used but not slp1,
+c          = 3 if both slp1 and slpn are to be estimated
+c              internally.
+c
+c   xp and yp are arrays of length at least n.
+c
+c   temp is an array of length at least n which is used
+c   for scratch storage.
+c
+c   s is an array of length at least n.
+c
+c and
+c
+c   sigma contains the tension factor. this value indicates
+c   the curviness desired. if abs(sigma) is nearly zero
+c   (e.g. .001) the resulting curve is approximately a cubic
+c   spline. if abs(sigma) is large (e. g. 50.) the resulting
+c   curve is nearly a polygonal line. if sigma equals zero a
+c   cubic spline results. a standard value for sigma is
+c   approximately 1. in absolute value.
+c
+c on output--
+c
+c   xp and yp contain information about the curvature of the
+c   curve at the given nodes.
+c
+c   s contains the polygonal arclengths of the curve.
+c
+c   ierr contains an error flag,
+c        = 0 for normal return,
+c        = 1 if n is less than 2,
+c        = 2 if adjacent coordinate pairs coincide.
+c
+c and
+c
+c   n, x, y, slp1, slpn, islpsw, and sigma are unaltered.
+c
+c this subroutine references package modules ceez, terms,
+c and snhcsh.
+c
+c-----------------------------------------------------------
+c
+      INTEGER i, ibak, im1, nm1, np1
+      REAL c1, c2, c3, dels, dels1, dels2, delsn, delsnm, 
+     .     delt, diag, diag1, diag2, diagin, 
+     .     dx1, dx2, dy1, dy2, sdiag1, sdiag2, sigmap, 
+     .     slpp1x, slpp1y, slppnx, slppny, sx, sy
+
+      nm1 = n-1
+      np1 = n+1
+      ierr = 0
+      if (n .le. 1) go to 11
+c
+c determine polygonal arclengths
+c
+      s(1) = 0.
+      do 1 i = 2,n
+        im1 = i-1
+    1   s(i) = s(im1)+sqrt((x(i)-x(im1))**2+
+     *         (y(i)-y(im1))**2)
+c
+c denormalize tension factor
+c
+      sigmap = abs(sigma)*float(n-1)/s(n)
+c
+c approximate end slopes
+c
+      if (islpsw .ge. 2) go to 2
+      slpp1x = cos(slp1)
+      slpp1y = sin(slp1)
+      go to 4
+    2 dels1 = s(2)-s(1)
+      dels2 = dels1+dels1
+      if (n .gt. 2) dels2 = s(3)-s(1)
+      if (dels1 .eq. 0. .or. dels2 .eq. 0.) go to 12
+      call ceez (dels1,dels2,sigmap,c1,c2,c3,n)
+      sx = c1*x(1)+c2*x(2)
+      sy = c1*y(1)+c2*y(2)
+      if (n .eq. 2) go to 3
+      sx = sx+c3*x(3)
+      sy = sy+c3*y(3)
+    3 delt = sqrt(sx*sx+sy*sy)
+      slpp1x = sx/delt
+      slpp1y = sy/delt
+    4 if (islpsw .eq. 1 .or. islpsw .eq. 3) go to 5
+      slppnx = cos(slpn)
+      slppny = sin(slpn)
+      go to 7
+    5 delsn = s(n)-s(nm1)
+      delsnm = delsn+delsn
+      if (n .gt. 2) delsnm = s(n)-s(n-2)
+      if (delsn .eq. 0. .or. delsnm .eq. 0.) go to 12
+      call ceez (-delsn,-delsnm,sigmap,c1,c2,c3,n)
+      sx = c1*x(n)+c2*x(nm1)
+      sy = c1*y(n)+c2*y(nm1)
+      if (n .eq. 2) go to 6
+      sx = sx+c3*x(n-2)
+      sy = sy+c3*y(n-2)
+    6 delt = sqrt(sx*sx+sy*sy)
+      slppnx = sx/delt
+      slppny = sy/delt
+c
+c set up right hand sides and tridiagonal system for xp and
+c yp and perform forward elimination
+c
+    7 dx1 = (x(2)-x(1))/s(2)
+      dy1 = (y(2)-y(1))/s(2)
+      call terms (diag1,sdiag1,sigmap,s(2))
+      xp(1) = (dx1-slpp1x)/diag1
+      yp(1) = (dy1-slpp1y)/diag1
+      temp(1) = sdiag1/diag1
+      if (n .eq. 2) go to 9
+      do 8 i = 2,nm1
+        dels2 = s(i+1)-s(i)
+        if (dels2 .eq. 0.) go to 12
+        dx2 = (x(i+1)-x(i))/dels2
+        dy2 = (y(i+1)-y(i))/dels2
+        call terms (diag2,sdiag2,sigmap,dels2)
+        diag = diag1+diag2-sdiag1*temp(i-1)
+        diagin = 1./diag
+        xp(i) = (dx2-dx1-sdiag1*xp(i-1))*diagin
+        yp(i) = (dy2-dy1-sdiag1*yp(i-1))*diagin
+        temp(i) = sdiag2*diagin
+        dx1 = dx2
+        dy1 = dy2
+        diag1 = diag2
+    8   sdiag1 = sdiag2
+    9 diag = diag1-sdiag1*temp(nm1)
+      xp(n) = (slppnx-dx1-sdiag1*xp(nm1))/diag
+      yp(n) = (slppny-dy1-sdiag1*yp(nm1))/diag
+c
+c perform back substitution
+c
+      do 10 i = 2,n
+        ibak = np1-i
+        xp(ibak) = xp(ibak)-temp(ibak)*xp(ibak+1)
+   10   yp(ibak) = yp(ibak)-temp(ibak)*yp(ibak+1)
+      return
+c
+c too few points
+c
+   11 ierr = 1
+      return
+c
+c coincident adjacent points
+c
+   12 ierr = 2
+      return
+      end
+c
+c
+c
+      subroutine kurv2 (t,xs,ys,n,x,y,xp,yp,s,sigma)
+c
+      IMPLICIT NONE
+      integer n
+      real t,xs,ys,x(n),y(n),xp(n),yp(n),s(n),sigma
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this subroutine performs the mapping of points in the
+c interval (0.,1.) onto a curve in the plane. the subroutine
+c kurv1 should be called earlier to determine certain
+c necessary parameters. the resulting curve has a parametric
+c representation both of whose components are splines under
+c tension and functions of the polygonal arclength
+c parameter.
+c
+c on input--
+c
+c   t contains a real value to be mapped to a point on the
+c   curve. the interval (0.,1.) is mapped onto the entire
+c   curve, with 0. mapping to (x(1),y(1)) and 1. mapping
+c   to (x(n),y(n)). values outside this interval result in
+c   extrapolation.
+c
+c   n contains the number of points which were specified
+c   to determine the curve.
+c
+c   x and y are arrays containing the x- and y-coordinates
+c   of the specified points.
+c
+c   xp and yp are the arrays output from kurv1 containing
+c   curvature information.
+c
+c   s is an array containing the polygonal arclengths of
+c   the curve.
+c
+c and
+c
+c   sigma contains the tension factor (its sign is ignored).
+c
+c the parameters n, x, y, xp, yp, s, and sigma should be
+c input unaltered from the output of kurv1.
+c
+c on output--
+c
+c   xs and ys contain the x- and y-coordinates of the image
+c   point on the curve.
+c
+c none of the input parameters are altered.
+c
+c this subroutine references package modules intrvl and
+c snhcsh.
+c
+
+      integer i, im1, intrvl
+      real    c1, c2, d, del1, del2, dels, dummy, 
+     *        s1, s2, sigdel, sigmap, ss, sumx, sumy, tn
+c-----------------------------------------------------------
+c
+c determine interval
+c
+      tn = s(n)*t
+      im1 = intrvl(tn,s,n)
+      i = im1+1
+c
+c denormalize tension factor
+c
+      sigmap = abs(sigma)*float(n-1)/s(n)
+c
+c set up and perform interpolation
+c
+      del1 = tn-s(im1)
+      del2 = s(i)-tn
+      dels = s(i)-s(im1)
+      sumx = (x(i)*del1+x(im1)*del2)/dels
+      sumy = (y(i)*del1+y(im1)*del2)/dels
+      if (sigmap .ne. 0.) go to 1
+      d = del1*del2/(6.*dels)
+      c1 = (del1+dels)*d
+      c2 = (del2+dels)*d
+      xs = sumx-xp(i)*c1-xp(im1)*c2
+      ys = sumy-yp(i)*c1-yp(im1)*c2
+      return
+    1 sigdel = sigmap*dels
+      call snhcsh(ss,dummy,sigdel,-1)
+      call snhcsh(s1,dummy,sigmap*del1,-1)
+      call snhcsh(s2,dummy,sigmap*del2,-1)
+      d = sigdel*sigmap*(1.+ss)
+      c1 = del1*(s1-ss)/d
+      c2 = del2*(s2-ss)/d
+      xs = sumx+xp(i)*c1+xp(im1)*c2
+      ys = sumy+yp(i)*c1+yp(im1)*c2
+      return
+      end
+c
+c
+c
+      subroutine ceez (del1,del2,sigma,c1,c2,c3,n)
+c
+      IMPLICIT NONE
+      real del1,del2,sigma,c1,c2,c3
+      integer n
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this subroutine determines the coefficients c1, c2, and c3
+c used to determine endpoint slopes. specifically, if
+c function values y1, y2, and y3 are given at points x1, x2,
+c and x3, respectively, the quantity c1*y1 + c2*y2 + c3*y3
+c is the value of the derivative at x1 of a spline under
+c tension (with tension factor sigma) passing through the
+c three points and having third derivative equal to zero at
+c x1. optionally, only two values, c1 and c2 are determined.
+c
+c on input--
+c
+c   del1 is x2-x1 (.gt. 0.).
+c
+c   del2 is x3-x1 (.gt. 0.). if n .eq. 2, this parameter is
+c   ignored.
+c
+c   sigma is the tension factor.
+c
+c and
+c
+c   n is a switch indicating the number of coefficients to
+c   be returned. if n .eq. 2 only two coefficients are
+c   returned. otherwise all three are returned.
+c
+c on output--
+c
+c   c1, c2, and c3 contain the coefficients.
+c
+c none of the input parameters are altered.
+c
+c this subroutine references package module snhcsh.
+c
+
+      real coshm1, coshm2, del, delm, delp, denom, dummy,
+     *     sinhmm, sinhmp
+
+c-----------------------------------------------------------
+c
+      if (n .eq. 2) go to 2
+      if (sigma .ne. 0.) go to 1
+      del = del2-del1
+c
+c tension .eq. 0.
+c
+      c1 = -(del1+del2)/(del1*del2)
+      c2 = del2/(del1*del)
+      c3 = -del1/(del2*del)
+      return
+c
+c tension .ne. 0.
+c
+    1 call snhcsh (dummy,coshm1,sigma*del1,1)
+      call snhcsh (dummy,coshm2,sigma*del2,1)
+      delp = sigma*(del2+del1)/2.
+      delm = sigma*(del2-del1)/2.
+      call snhcsh (sinhmp,dummy,delp,-1)
+      call snhcsh (sinhmm,dummy,delm,-1)
+      denom = coshm1*(del2-del1)-2.*del1*delp*delm*
+     *        (1.+sinhmp)*(1.+sinhmm)
+      c1 = 2.*delp*delm*(1.+sinhmp)*(1.+sinhmm)/denom
+      c2 = -coshm2/denom
+      c3 = coshm1/denom
+      return
+c
+c two coefficients
+c
+    2 c1 = -1./del1
+      c2 = -c1
+      return
+      end
+c
+c
+c
+      subroutine snhcsh (sinhm,coshm,x,isw)
+c
+      IMPLICIT NONE
+      integer isw
+      real sinhm,coshm,x
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this subroutine returns approximations to
+c       sinhm(x) = sinh(x)/x-1
+c       coshm(x) = cosh(x)-1
+c and
+c       coshmm(x) = (cosh(x)-1-x*x/2)/(x*x)
+c with relative error less than 1.0e-6
+c
+c on input--
+c
+c   x contains the value of the independent variable.
+c
+c   isw indicates the function desired
+c           = -1 if only sinhm is desired,
+c           =  0 if both sinhm and coshm are desired,
+c           =  1 if only coshm is desired,
+c           =  2 if only coshmm is desired,
+c           =  3 if both sinhm and coshmm are desired.
+c
+c on output--
+c
+c   sinhm contains the value of sinhm(x) if isw .le. 0 or
+c   isw .eq. 3 (sinhm is unaltered if isw .eq.1 or isw .eq.
+c   2).
+c
+c   coshm contains the value of coshm(x) if isw .eq. 0 or
+c   isw .eq. 1 and contains the value of coshmm(x) if isw
+c   .ge. 2 (coshm is unaltered if isw .eq. -1).
+c
+c and
+c
+c   x and isw are unaltered.
+c
+c-----------------------------------------------------------
+c
+      real sp13, sp12, sp11, sp10, 
+     *     sp24, sp23, sp22, sp21, sp20,
+     *     sp33, sp32, sp31, sq32, sq31, sq30, 
+     *     sp43, sp42, sp41, sq42, sq41, sq40,
+     *     cp4, cp3, cp2, cp1, cp0,
+     *     ax, expx, xs
+
+      data sp13/.3029390e-5/,
+     *     sp12/.1975135e-3/,
+     *     sp11/.8334261e-2/,
+     *     sp10/.1666665e0/
+      data sp24/.3693467e-7/,
+     *     sp23/.2459974e-5/,
+     *     sp22/.2018107e-3/,
+     *     sp21/.8315072e-2/,
+     *     sp20/.1667035e0/
+      data sp33/.6666558e-5/,
+     *     sp32/.6646307e-3/,
+     *     sp31/.4001477e-1/,
+     *     sq32/.2037930e-3/,
+     *     sq31/-.6372739e-1/,
+     *     sq30/.6017497e1/
+      data sp43/.2311816e-4/,
+     *     sp42/.2729702e-3/,
+     *     sp41/.9868757e-1/,
+     *     sq42/.1776637e-3/,
+     *     sq41/-.7549779e-1/,
+     *     sq40/.9110034e1/
+      data cp4/.2982628e-6/,
+     *     cp3/.2472673e-4/,
+     *     cp2/.1388967e-2/,
+     *     cp1/.4166665e-1/,
+     *     cp0/.5000000e0/
+c
+      ax = abs(x)
+      if (isw .ge. 0) go to 5
+c
+c sinhm approximation
+c
+      if (ax .gt. 4.45) go to 2
+      xs = ax*ax
+      if (ax .gt. 2.3) go to 1
+c
+c sinhm approximation on (0.,2.3)
+c
+      sinhm = xs*(((sp13*xs+sp12)*xs+sp11)*xs+sp10)
+      return
+c
+c sinhm approximation on (2.3,4.45)
+c
+    1 sinhm = xs*((((sp24*xs+sp23)*xs+sp22)*xs+sp21)
+     .               *xs+sp20)
+      return
+    2 if (ax .gt. 7.65) go to 3
+c
+c sinhm approximation on (4.45,7.65)
+c
+      xs = ax*ax
+      sinhm = xs*(((sp33*xs+sp32)*xs+sp31)*xs+1.)/
+     .             ((sq32*xs+sq31)*xs+sq30)
+      return
+    3 if (ax .gt. 10.1) go to 4
+c
+c sinhm approximation on (7.65,10.1)
+c
+      xs = ax*ax
+      sinhm = xs*(((sp43*xs+sp42)*xs+sp41)*xs+1.)/
+     .             ((sq42*xs+sq41)*xs+sq40)
+      return
+c
+c sinhm approximation above 10.1
+c
+    4 sinhm = exp(ax)/(ax+ax)-1.
+      return
+c
+c coshm and (possibly) sinhm approximation
+c
+    5 if (isw .ge. 2) go to 7
+      if (ax .gt. 2.3) go to 6
+      xs = ax*ax
+      coshm = xs*((((cp4*xs+cp3)*xs+cp2)*xs+cp1)*xs+cp0)
+      if (isw .eq. 0) sinhm = xs*(((sp13*xs+sp12)*xs+sp11)
+     .                              *xs+sp10)
+      return
+    6 expx = exp(ax)
+      coshm = (expx+1./expx)/2.-1.
+      if (isw .eq. 0) sinhm = (expx-1./expx)/(ax+ax)-1.
+      return
+c
+c coshmm and (possibly) sinhm approximation
+c
+    7 xs = ax*ax
+      if (ax .gt. 2.3) go to 8
+      coshm = xs*(((cp4*xs+cp3)*xs+cp2)*xs+cp1)
+      if (isw .eq. 3) sinhm = xs*(((sp13*xs+sp12)*xs+sp11)
+     .                              *xs+sp10)
+      return
+    8 expx = exp(ax)
+      coshm = ((expx+1./expx-xs)/2.-1.)/xs
+      if (isw .eq. 3) sinhm = (expx-1./expx)/(ax+ax)-1.
+      return
+      end
+c
+c
+c
+      subroutine terms (diag,sdiag,sigma,del)
+c
+      IMPLICIT NONE
+      real diag,sdiag,sigma,del
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this subroutine computes the diagonal and superdiagonal
+c terms of the tridiagonal linear system associated with
+c spline under tension interpolation.
+c
+c on input--
+c
+c   sigma contains the tension factor.
+c
+c and
+c
+c   del contains the step size.
+c
+c on output--
+c
+c                sigma*del*cosh(sigma*del) - sinh(sigma*del)
+c   diag = del*--------------------------------------------.
+c                     (sigma*del)**2 * sinh(sigma*del)
+c
+c                   sinh(sigma*del) - sigma*del
+c   sdiag = del*----------------------------------.
+c                (sigma*del)**2 * sinh(sigma*del)
+c
+c and
+c
+c   sigma and del are unaltered.
+c
+c this subroutine references package module snhcsh.
+c
+
+      real coshm, denom, sigdel, sinhm
+
+c-----------------------------------------------------------
+c
+      if (sigma .ne. 0.) go to 1
+      diag = del/3.
+      sdiag = del/6.
+      return
+    1 sigdel = sigma*del
+      call snhcsh (sinhm,coshm,sigdel,0)
+      denom = sigma*sigdel*(1.+sinhm)
+      diag = (coshm-sinhm)/denom
+      sdiag = sinhm/denom
+      return
+      end
+c
+c
+c
+      integer function intrvl (t,x,n)
+c
+      IMPLICIT NONE
+      integer n
+      real t,x(n)
+c
+c                                 coded by alan kaylor cline
+c                           from fitpack -- january 26, 1987
+c                        a curve and surface fitting package
+c                      a product of pleasant valley software
+c                  8603 altus cove, austin, texas 78759, usa
+c
+c this function determines the index of the interval
+c (determined by a given increasing sequence) in which
+c a given value lies.
+c
+c on input--
+c
+c   t is the given value.
+c
+c   x is a vector of strictly increasing values.
+c
+c and
+c
+c   n is the length of x (n .ge. 2).
+c
+c on output--
+c
+c   intrvl returns an integer i such that
+c
+c          i =  1       if         e   t .lt. x(2)  ,
+c          i =  n-1     if x(n-1) .le. t            ,
+c          otherwise       x(i)  .le. t .le. x(i+1),
+c
+c none of the input parameters are altered.
+c
+
+      integer i, il, ih
+      real    tt
+
+c-----------------------------------------------------------
+c
+      save i
+      data i /1/
+c
+      tt = t
+c
+c check for illegal i
+c
+      if (i .ge. n) i = n/2
+c
+c check old interval and extremes
+c
+      if (tt .lt. x(i)) then
+        if (tt .le. x(2)) then
+          i = 1
+          intrvl = 1
+          return
+        else
+          il = 2
+          ih = i
+        end if
+      else if (tt .le. x(i+1)) then
+        intrvl = i
+        return
+      else if (tt .ge. x(n-1)) then
+        i = n-1
+        intrvl = n-1
+        return
+      else
+        il = i+1
+        ih = n-1
+      end if
+c
+c binary search loop
+c
+    1 i = (il+ih)/2
+      if (tt .lt. x(i)) then
+         ih = i
+      else if (tt .gt. x(i+1)) then
+         il = i+1
+      else
+         intrvl = i
+         return
+      end if
+      go to 1
+      end
diff --git a/ppl/tmapadds/line_key.F b/ppl/tmapadds/line_key.F
new file mode 100644
index 0000000..5c7d5cd
--- /dev/null
+++ b/ppl/tmapadds/line_key.F
@@ -0,0 +1,184 @@
+	SUBROUTINE LINE_KEY (x,nxs,a_line,axmin,aymin,axmax,aymax)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Modified PPLMOD_PLTIT and PPLMOD_PLOTXY to execute the ALINE command 
+*	where a line is drawn of a particular type as specified.
+*	J Davison 10.4.89
+
+*  v5.5 *acm* 12/02 For dot plots -- plot a symbol in the middle as well.
+*                   Taken from aline_sub, but put a third symbol in
+*                   the middle of the line the key of a line-plot  
+
+        IMPLICIT NONE
+
+*****************************************************
+* local variable declarations for PLTIT (for TMAP)
+	REAL  	x
+	INTEGER nxs
+* TMAP include files with explicit type declarations:
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+
+CCCCC	VIRTUAL X(NXS)		(*jd* 12.96 for linux port) 
+	dimension X(NXS)     
+
+	real 		cs,sn,xt,yt,oldx(4)
+	real		axmin,aymin,axmax,aymax
+	integer  	icnt,im,j,ibase,iy,a_line, npt
+	logical		old_swait
+
+
+C	KTYPE = 1 -XY  0 -Z  2-VECTOR
+	include 'lines_inc.decl'
+	include 'LINES.INC'
+	include 'pen_inc.decl'
+	include 'PEN.INC'
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'taxis_inc.decl'
+	include 'TAXIS.INC'
+	include 'axisl_inc.decl'
+	include 'AXISL.INC'
+	include 'plt_inc.decl'
+	include 'PLT.INC'
+	include 'pltl_inc.decl'
+	include 'PLTL.INC'
+	include 'mplot_inc.decl'
+	include 'MPLOT.INC'
+	include 'cmrd_inc.decl'
+	include 'CMRD.INC'
+	include 'prmcom_inc.decl'
+	include 'PRMCOM.INC'
+	include 'miss_inc.decl'
+	include 'MISS.INC'
+	include 'switch_inc.decl'
+	include 'SWITCH.INC'
+	include 'system_inc.decl'
+	include 'SYSTEM.INC'
+	include 'cont_inc.decl'  !added to get ivcomp v1.1
+	include 'CONT.INC'  !added to get ivcomp v1.1
+        include 'gkscm2.cmn' ! jd 3.22.89
+        INCLUDE 'makedot.cmn'    ! 10/01 *acm*
+
+	CALL COLOR(IPEN(0))
+!	CALL SETAX(X,NXS,XF,YF,XL,YL,XH,YH,NMX,NMY,XTI,XTL)
+
+	oldx(1) 	= x(1)
+	x(1) 		= axmin
+	oldx(2) 	= x(2)
+	x(2) 		= axmax
+
+	oldx(3)		= x(nxs/2+1)
+	x(nxs/2+1) 	= aymin
+	oldx(4)		= x(nxs/2+2)
+        x(nxs/2+2) 	= aymax
+
+	IBASE=0
+	IY=NXS/2
+	CS=COS(VANG*.01745329252)
+	SN=SIN(VANG*.01745329252)
+!	ZT=YF/XF
+	ICNT=1
+
+	old_swait = swait
+	swait = .false.
+	CALL COLOR(IPEN(a_line))
+	CALL MARKH(HMARK(a_line))
+
+	IF(ITYPE(a_line).GE.4) THEN ! OLD PPL (PRE JD 89 GKS)
+	   CALL DASHSZ(DN1(a_line),UP1(a_line),DN2(a_line),UP2(a_line))
+	   CALL DASHES
+	ELSE
+	   CALL VECTRS
+	END IF
+
+	IF(ITYPE(a_line).EQ.3)CALL POINTS
+
+	CALL TRANS(1,X(IBASE+1),X(IY+IBASE+1),XT,YT)                
+	CALL PLOT(XT,YT,0,0)
+	IF (ITYPE(a_line).NE.0.AND.ITYPE(a_line).NE.4) 
+     .	CALL MARK(IMARK(a_line))
+	IM=0
+	IF (ITYPE(a_line).EQ.1.OR.ITYPE(a_line).EQ.3)IM=IMARK(a_line)
+
+* ACM changes for dot plots -- plot a symbol in the middle as well.
+        NPT = 2
+        IF ( ITYPE(a_line).EQ.1 .OR. ITYPE(a_line).EQ.3) THEN
+           NPT = 3
+           X(3) = X(2)
+           X(IY+3) = X(IY+2)
+           X(2) = 0.5*(X(1) + X(3))
+           X(IY+2) = 0.5*(X(IY+1) + X(IY+3))
+        ENDIF
+
+	DO 60 J=1,NPT
+	   CALL TRANS(1,X(J),X(IY+J),XT,YT)
+	   CALL PLOT(XT,YT,1,0)
+60      CALL MARK(IM)
+	IF (ITYPE(a_line).EQ.2.OR.ITYPE(a_line).EQ.5) 
+     .	CALL MARK(IMARK(a_line))
+
+	x(1) 		= oldx(1)
+	x(2) 		= oldx(2)
+
+	x(nxs/2+1) 	= oldx(3)
+        x(nxs/2+2) 	= oldx(4)
+
+	swait = old_swait
+
+!	CALL SCALE(XF,YF,XORG,YORG,XLO,YLO)
+C
+	CALL WINDOW(0.,0.,0.,0.)
+C
+!	IF(ITFLG.EQ.1)THEN
+!	    XHI=XTI
+!	    XLO=XTL
+!	ELSE IF(ITFLG.EQ.-1)THEN
+!	    YHI=XTI
+!	    YLO=XTL
+!	ENDIF
+
+        IF (imark(a_line) .eq. 99) THEN
+           CALL doit_makedot(IPT,XDOT,YDOT)
+           IPT = 0
+        ENDIF
+
+ 	CALL COLOR(IPEN(0))
+	RETURN
+	END
diff --git a/ppl/tmapadds/new_gks_window.F b/ppl/tmapadds/new_gks_window.F
new file mode 100644
index 0000000..eea4fac
--- /dev/null
+++ b/ppl/tmapadds/new_gks_window.F
@@ -0,0 +1,74 @@
+      SUBROUTINE NEW_GKS_WINDOW (ws_id,xname,window_title,status)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*     Modifies connection id string, opens GKS workstation.  Permits multiple 
+*     windows on workstation screen.  Modified from GKS-3D FORTRAN Binding
+*     Manual example 19-1.  For VMS simply open the workstation.
+*     J Davison 5.13.91
+*     *jd* 3.26.92  Modified to accommodate ATC GKS as well as DEC
+*     *jd* 12.21.93 Modified to accommodate xgks
+*  V600 *acm* 9/05 append window_title to window name
+
+      IMPLICIT NONE
+
+* Calling arguments
+      integer         ws_id,status
+      character*(*)   xname, window_title
+
+* Internal declarations
+      integer         TM_LENSTR1, nlen
+      character*2     kwsid
+      character*88    window_name
+
+      include         'gkspar.inc' 
+      
+      write (unit=kwsid,fmt='(i2)') ws_id
+
+      window_name = 'FERRET_'//kwsid(2:2)
+      nlen = TM_LENSTR1(window_title)
+      IF (nlen .GT. 1 .OR. window_title .NE. '_')
+     .    window_name = 'FERRET_'//kwsid(2:2)//'_'//window_title
+      call FGD_GESSPN(window_name)
+      call FGD_GOPWK(ws_id,6,4)
+
+*     SET DEFERRAL STATE TO GENERATE OUTPUT AS SOON AS POSSIBLE
+      call FGD_GSDS(ws_id,gasap,gsuppd)
+      status = 3   ! Meaningless but may be used later
+      return 
+      end
+      
+
diff --git a/ppl/tmapadds/open_gks_ws.F b/ppl/tmapadds/open_gks_ws.F
new file mode 100644
index 0000000..f736c8e
--- /dev/null
+++ b/ppl/tmapadds/open_gks_ws.F
@@ -0,0 +1,182 @@
+        SUBROUTINE OPEN_GKS_WS
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*
+*       Routine to open GKS if not open, the workstation.
+*       Taken out of SIZE2 and modified for metafile.
+*       J Davison JISAO/PMEL/TMAP
+*       3.15.89
+*       12.20.89 *sh* - added GKS_X_CONID code for FERRET
+*       03.25.91 *jd* - mod to separate ws & metafile opening into two
+*       subroutines rather than 1 with 2 entry points
+*       *jd* 3.10.92 Mod to handle ATC GKS
+*       *jd* 8.6.93 Mod to use XGKS
+*       *sh* 3.4.97 (& 7/97) Mod to support metafile-only (no X) output
+*       through a cuckoo's egg implantation of meta_wsid in place of wsid
+*            8-4-97 -- substituted this edited version which didn't get
+*            into CVS. This version calls open_gks_ws as long as not in
+*            batch mode.
+*  v5.4 *acm* 8/2001  add polymarker call for PLOT/SYMBOL=DOT
+*             here  set polymarker area attributes to bundled.
+*      *acm* 10/01  remove VMS includes
+*  V600 *acm* 9/05 append window_title to window name. If no title
+*                   has been defined, set it to the session date:time.
+*                   Save window_title in xplot_setup.cmn for use in subsequent
+*                   windows. Also define a symbol WIN_TITLE
+*       *acm* 3/12 6D Ferret (common uses nferdims in tmap_dims.parm)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+
+        IMPLICIT NONE
+        integer      TM_LENSTR, TM_LENSTR1, s1, nlen, asf(13), error,
+     .               clen, ier, status
+
+        character*88 window_name
+
+        include 'pltcom_dat.decl'! with declarations
+        include 'PLTCOM.DAT'! with declarations
+        include 'gkscm1_inc.decl'! with declarations
+        include 'GKSCM1.INC'! with declarations
+        include 'gkscm2.cmn'! with declarations
+        include 'ppl_in_ferret.cmn'
+        include 'ws_types.cmn'
+        include 'shade_vars.cmn'
+        include 'xtoday.cmn'            ! with today_date and today_time
+	include 'tmap_dims.parm'
+        include 'xplot_setup.cmn'
+
+        character       GKS_X_CONID*16, xwind_id*16
+        external        gks_x_conid
+        include        'gkspar.inc'
+
+#ifdef sun
+        BYTE      NULL
+        BYTE      cstring(64) ! c-type Hollerith string buffer
+#else
+        INTEGER*1 NULL
+        INTEGER*1 cstring(64) ! c-type Hollerith string buffer
+#endif
+        PARAMETER ( NULL = 0 )
+
+
+********************************************************************************
+C
+C       OPEN AND INITIALIZE GKS
+C
+        CALL FGD_GOPKS(1)
+        IF (wstype .EQ. ws_tek4014 .OR. wstype .EQ. ws_tek4107) THEN
+           CALL FGD_GOPWK(WSID, 0, 0)
+        ELSE IF ( ppl_in_ferret .AND. ((wstype. EQ. ws_xwindow)
+     .                            .OR. (wstype .EQ. 0)) ) THEN
+* ... remote node connection option for FERRET
+           xwind_id = GKS_X_CONID( wsid )
+* If the window title has not yet been initialized, do so using the
+* date and time of the Ferret session.
+           clen = 64
+           CALL TM_FTOC_STRNG(window_title, cstring, clen)
+           IF ( cstring(1) .EQ. NULL ) THEN
+              s1 = 1
+              IF (today_date(1:1) .EQ. ' ') s1 = 2
+              nlen = TM_LENSTR1(today_date)
+              window_title = today_date(s1:nlen)//'_'//today_time
+           ENDIF
+           nlen = TM_LENSTR(window_title)
+           IF ( (nlen .GT. 1) .OR.
+     .         ((nlen .EQ. 1) .AND. (window_title .NE. '_')) )
+     .        window_name = 'FERRET_1'//'_'//window_title
+           ier = 0
+           CALL SETSYM ("WIN_TITLE "//window_title(:nlen),
+     .                  nlen+10, ier, status)
+           CALL FGD_GESSPN(window_name)
+           CALL FGD_GOPWK(WSID,6,4)
+        ELSE IF ( ppl_in_ferret ) THEN
+           CALL FGD_GESSPN('FERRET_1')
+           CALL FGD_GOPWK(WSID,6,4)
+        ELSE
+           CALL FGD_GESSPN('PPLP')
+           CALL FGD_GOPWK(WSID,6,4)
+        ENDIF
+        CALL FGD_GACWK(WSID)
+        IF ( save_on_exit ) THEN
+*          Inform the graphics engine of the image filename
+           CALL OPEN_METAFILE
+        ENDIF
+
+*       SET DEFERRAL STATE TO GENERATE OUTPUT AS SOON AS POSSIBLE
+        call FGD_GSDS(wsid,gasap,gsuppd)
+
+        GKSOPN=.TRUE.
+        gks_open = .true.  ! another open flag needed, PLTCOM.DAT has problems
+        LPEN=.NOT.PEN
+
+*       SET POLYLINE AND FILL AREA ATTRIBUTES BUNDLED
+        call FGD_GQASF(error,asf)
+        if (error .ne. 0) goto 1000
+
+        asf(1)  = gbundl
+        asf(2)  = gbundl
+        asf(3)  = gbundl
+
+*       SET POLYMARKER AREA ATTRIBUTES BUNDLED *acm* 8/2001
+*       (see ws_line_bundld.F and ps_line_bundle.F)
+
+        asf(4)  = gbundl
+        asf(5)  = gbundl
+        asf(6)  = gbundl
+
+        if (area_bundles) then
+           asf(11) = gbundl
+           asf(12) = gbundl
+           asf(13) = gbundl
+        else
+           asf(11) = gindiv
+           asf(12) = gindiv
+           asf(13) = gindiv
+           call FGD_GSFAIS(gsolid)
+        endif
+        call FGD_GSASF(asf)
+
+*       SET UP DEFAULT LINE BUNDLES FOR WS
+        call ws_line_bundles (wsid,wstype)
+
+        return
+
+*       FATAL ERROR -- NEED GKS ERROR HANDLING IN PPL...
+1000    return
+
+        end
+
diff --git a/ppl/tmapadds/open_metafile.F b/ppl/tmapadds/open_metafile.F
new file mode 100644
index 0000000..3ada1ca
--- /dev/null
+++ b/ppl/tmapadds/open_metafile.F
@@ -0,0 +1,30 @@
+*
+* Metafiles no longer supported.  All graphics files are now created
+* by the graphics delegate.  This routine informs the graphics engine
+* of the image filename given in meta_file and sets save_on_exit to
+* .TRUE.
+*
+        SUBROUTINE OPEN_METAFILE
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+        IMPLICIT NONE
+        INCLUDE 'gkscm2.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+*       If the image filename has already been sent, ignore this call.
+        IF ( imgname_sent ) RETURN
+
+*       Send the image filename to currently active window.
+        CALL FGD_SETIMGNAME(meta_file, imgname_sent)
+
+        IF ( imgname_sent ) THEN
+*           If successful, clear the currently active window
+            CALL FGD_GCLRWK(activewindow, 0)
+*           Make sure the save_on_exit flag is set
+            save_on_exit = .TRUE.
+        ENDIF
+
+        RETURN
+        END
+
diff --git a/ppl/tmapadds/pattern_set.F b/ppl/tmapadds/pattern_set.F
new file mode 100644
index 0000000..cd8707d
--- /dev/null
+++ b/ppl/tmapadds/pattern_set.F
@@ -0,0 +1,405 @@
+        SUBROUTINE PATTERN_SET
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+        
+*       Sets the patterns for SHADE/FILL
+*       J Davison JISAO/PMEL/TMAP 10.23.98
+*
+*       *acm* 9/02 Check that the number of levels in a pattern file isn't
+*                  larger than pattern_num (see shade_vars.cmn), the number 
+*                  of pattern levels allowed to be specified in a
+*                  pattern file.
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+        include 'cmrdl_inc.decl'            
+        include 'CMRDL.INC'            
+        include 'gkscm1_inc.decl'            
+        include 'GKSCM1.INC'            
+        include 'gkscm2.cmn'            
+        include 'cmrd_inc.decl'
+        include 'CMRD.INC'
+        include 'gkspar.inc'
+
+       	logical         there
+        integer         beg,end,beg_eq                        
+        character*2048  str                                
+
+******************************************************************************
+
+*	PROCESS LEVELS AS SPECIFIED
+      	call upnsquish (label,str,end)
+        call squish (label,1,2048)
+        
+	if (m .eq. 1 .or. (m .eq. 0 .and. end .eq. 0)) then
+	   call pattern_levels (str,end)
+	   goto 10
+	end if
+
+*	IF A PATTERN IS TO BE READ, DO THAT AND SET LEVELS
+	beg = index (str,'PATTERN')
+        beg_eq = index (str,'=')
+	if (beg .ne. 0 .and. 
+     .       (beg_eq .gt. beg .or. beg_eq .eq. 0)) then
+	   call pattern_read (label,beg,end,there)
+	   if (.not.there) return
+	   goto 10
+	end if
+
+*	IF A PATTERN IS TO BE SAVED, DO THAT
+	beg = index (str,'SAVE')
+        beg_eq = index (str,'=')
+	if (beg .ne. 0 .and. 
+     .       (beg_eq .gt. beg .or. beg_eq .eq. 0)) then
+           call pattern_save (label,beg,end)
+	   goto 10
+	end if
+
+*	SET LEVELS FOR DEFAULT PATTERNS
+	beg = index (str,'DEFAULT')
+	if (beg .ne. 0) then
+	   call pattern_default
+	   goto 10
+	end if
+
+ 10     return
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE PATTERN_LEVELS (str,end)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+
+	include 'errmsg.parm'
+
+* 3/99 *kob* 	move var init off of decl list  - cleaning up after jerry.
+	integer		i,j,ndx,npatp1,solid
+        DATA            solid/21/
+
+        integer         beg,end,andx,status,named_ndx
+        character*2048   str   
+        character*100   err_msg                             
+
+        logical    recognized
+
+*******************************************************************************
+
+*	NO PARAMETERS RESETS TO ZERO PATTERNS -- SOLID COLORS
+	if (m .eq. 0) then 
+           npat = 1
+           patterns(1) = solid
+           return
+	end if
+
+        ndx = int(p(1))
+
+*	FIRST PARAMETER NEGATIVE DELETES THAT LEVEL
+ 	if (ndx .lt. 0) then
+           andx = abs(ndx)
+           if (andx .le. npat) then
+              npat = npat - 1
+              
+              do 5 i = andx, npat
+                 patterns(i) = patterns(i+1)
+ 5            end do
+              
+              if (npat .eq. 0) then
+                 write (6,'(/a/a/)') 
+     .         ' PPL+ note: You have removed all patterns.'
+     .        ,' The pattern list will be reset to SOLID'
+                 
+                 npat = 1
+                 patterns(1) = solid
+              end if
+
+              return
+           else
+              write (6,'(/a,i2,a/)') 
+     .             ' PPL+ error: Pattern ',andx,
+     .             ' is not available to be removed'
+              return
+           end if
+        end if
+
+*       NEED PROPER SET OF ARGUMENTS OTHERWISE
+        if (end .eq. 0) then
+           write (6,'(/a/a/)') 
+     .          ' PPL+ error: The syntax to set a pattern', 
+     .          ' is the sequence ORDER and then the PATTERN name'
+           return
+        end if
+
+*	REJECT INDEX OUTSIDE CURRENT LIST + 1
+        npatp1 = npat + 1
+	if (ndx .le. 0 .or. ndx .gt. npatp1) then
+           
+          write (6,'(/a,i2,a/a,i2/)') 
+     .     ' PPL+ error: The pattern position you specified, ', 
+     .     ndx,',',' is outside the valid range of 1 to ', npatp1
+           return
+        end if
+
+*	REJECT PATTERNS WITH UNRECOGNIZED NAME        
+        recognized = .false.
+        do 10 i = 1, 21
+           beg = index (pattern_list(i),str(1:end))
+           if (beg .eq. 0) goto 10
+
+           recognized = .true.
+           named_ndx = i
+           goto 11
+ 10     CONTINUE
+        if (.not. recognized) then
+           write (6,'(/a/a/)') ' PPL+ error: The pattern name ' 
+     .        //str(1:end)//' is not valid.',
+     .        ' Use the PPL command LIST APATTERNS for available '
+     .        //'pattern names'
+           
+           return
+        end if
+
+*	REPLACE OLDER PATTERN WITH NEW, ADD PATTERN TO TOP, IF SPECIFIED
+ 11     if (ndx .eq. p(1)) then
+           patterns(ndx) = named_ndx
+           if (ndx .eq. npat + 1) npat = npat + 1
+           IF (npat .GT. pattern_num) GOTO 1000
+       else
+*	IF NEW, INSERT INTO PROPER LOCATION IN PATTERN LIST
+           do 15 j = npat,ndx+1,-1
+              patterns(j+1) = patterns(j)
+ 15        end do
+
+           npat = npat + 1
+           IF (npat .GT. pattern_num) GOTO 1000
+           patterns(ndx+1) = named_ndx
+        end if
+
+
+ 5000	RETURN
+        
+ 1000	WRITE (err_msg, 110)  pattern_num 
+  110   FORMAT ('Too many levels in .pat file. Max is',i4)
+        CALL ERRMSG( ferr_prog_limit, status, err_msg, *5000 )
+	END
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+        SUBROUTINE PATTERN_DEFAULT
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+        integer  i
+
+******************************************************************************
+
+*	'DEFAULT' RESETS PATTERN SEQUENCE TO DEFAULT PATTERN SEQUENCE
+        npat = 20
+        do 1 i = 1, npat
+           patterns(i) = default_patterns(i)
+ 1      end do
+        
+        return
+        end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+	SUBROUTINE PATTERN_READ (str,beg,end,there)
+
+        IMPLICIT NONE
+        include 	'tmap_errors.parm'    
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+        include         'shade_vars.cmn'
+
+	logical		there, recognized
+	integer		beg,end,i,j,speclen,lnblk,status,ndx,named_ndx
+	character*2048	str,sfile,instr,label,specdir,tm_inq_path
+
+	external 	lnblk
+
+*******************************************************************************
+
+*	IF NO FILE NAME GIVEN, READ IN FROM MEMORY
+	if (end .lt. 9) then
+	   if (mnpat .eq. 0) goto 100
+	   npat = mnpat
+
+	   do 4 i = 1,npat
+	      patterns(i) = mpatterns(i)
+4	   end do
+
+	   there = .true.
+	   return
+	endif
+
+	sfile = tm_inq_path (str(beg+8:end),'FER_PALETTE','.pat',
+     .	.false.,status)
+*	type *, sfile,str(beg+8:end),status,merr_ok
+	if (status .ne. merr_ok) go to 100
+	there = .true.
+
+*	OPEN THE FILE
+#ifdef atc_gks
+ 5      open (70,file=sfile,status='old',err=100)
+#else
+#ifdef NO_OPEN_READONLY
+ 5      open (70,file=sfile,status='old',err=100)
+#else
+ 5      open (70,file=sfile,readonly,status='old',err=100)
+#endif
+#endif
+*	READ IN THE PATTERNS AND SET THEM
+        npat = 0
+10	read (70,'(a)',end=30,err=90) instr
+	do 15 i = 1,80
+	   if (instr(i:i) .ne. ' ') then
+	      j = i
+	      goto 20
+	   end if
+15	end do
+	goto 10
+
+*	PERMIT COMMENTS 
+20	if (instr(j:j) .eq. '!') goto 10
+	call parsex (instr(j:j+79),80,p,iflg,m,label,n)
+      	call upnsquish (label,str,end)
+
+*	REJECT PATTERNS WITH UNRECOGNIZED NAME        
+        recognized = .false.
+        do 25 i = 1, 21
+           beg = index (pattern_list(i),str(1:end))
+           if (beg .eq. 0) goto 25
+
+           recognized = .true.
+           named_ndx = i
+           goto 27
+ 25     CONTINUE
+        if (.not. recognized) then
+           write (6,'(/a/a/)') ' PPL+ error: The pattern name ' 
+     .        //str(1:end)//' is not valid.',
+     .        ' Use the PPL command LIST APATTERNS for available '
+     .        //'pattern names'
+                      
+           return
+        end if
+
+ 27     ndx = int(p(1))
+        patterns(ndx) = named_ndx
+        npat = npat + 1
+	goto 10
+
+30	close (70)
+	return
+
+*	ERROR WITH FILE ACCESS
+90	close (70)
+100	there = .false.
+	write (6,'(/a/)') ' PPL+ error: Unable to read "' //
+     .	str(beg+8:end)//'.pat" to set shade and fill patterns.'
+
+	return
+
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE PATTERN_SAVE (str,beg,end)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+	integer		beg,end,i
+	character*2048	str,sfile
+
+*******************************************************************************
+
+*	WRITE TO MEMORY IF NO FILE NAME GIVEN
+	if (end .lt. 6) then
+	   mnpat = npat
+
+	   do 10 i = 1,npat
+	      mpatterns(i) = patterns(i)
+10	   end do
+	   goto 101
+	end if
+
+#ifdef unix
+	sfile = str(beg+5:end)//'.pat'
+
+*	OPEN THE FILE
+
+#   ifdef atc_gks
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	err=100)
+#   else
+#ifdef NO_OPEN_CARRIAGECONTROL
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	err=100)
+#else
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	carriagecontrol='list',err=100)
+#endif
+#   endif
+#else
+	sfile = 'fer_palette:'//str(beg+5:end)//'.spk'
+
+*	OPEN THE FILE
+#ifdef NO_OPEN_CARRIAGECONTROL
+	open (70,file=sfile,status='new',form='formatted',
+     .	err=100)
+#else
+	open (70,file=sfile,status='new',form='formatted',
+     .	carriagecontrol='list',err=100)
+#endif
+#endif
+*	WRITE OUT THE SPECTRUM
+	do i = 1,npat
+	   write (70,'(i3,2x,a25)') i, pattern_list(patterns(i))
+	end do
+
+	close (70)
+	return
+
+100	write (6,'(/a/)') ' PPL+ error: Unable to save pattern list ' //
+     .	str(beg+9:end)//'.pat"'
+101	return
+	end
+
diff --git a/ppl/tmapadds/pltdat_block_data.F b/ppl/tmapadds/pltdat_block_data.F
new file mode 100644
index 0000000..bd92d47
--- /dev/null
+++ b/ppl/tmapadds/pltdat_block_data.F
@@ -0,0 +1,34 @@
+	block data pltdat_block_data
+
+C	Initialization of PLTCOM.DAT common block.  Must be done in 
+C	a block data stmt in FORTRAN 90.  *jd* Linux port 12.96
+C       All ports should have this, not just Linux (for sh libs) *js* 8.97
+
+      IMPLICIT NONE
+
+      include 'pltcom_dat.decl'
+      include 'PLTCOM.DAT'
+
+      DATA A/0.0/,AMAX/7500.0/,AMIN/0.0/,AOLD/0.0/,AORIGN/500.0/,
+     * AOSOLD/0.0/,ASIZE/7500.0/,B/0.0/,BAUDR/4800/,BMAX/5625.0/,
+     * BMIN/0.0/,BOLD/0.0/,BORIGN/750.0/,BOSOLD/0.0/,BSIZE/5625.0/,
+     * COLD/0.0/,COLOUR/1/,DSEG/150.0,100.0,150.0,100.0/,FACTOR/1000.0/,
+     * FZCNT/1/,GKSOPN/.FALSE./,GRAPHF/.FALSE./,HMARK/10./,HPSCLA/779./,
+     * HPSCLB/719.0/,IPRIM/0/,ISEQ/1/,LOSFLG/0/,LOWFLG/0/,LPEN/.FALSE./,
+     * LUHP/8/,LUTK/9/,LUSY/10/,MIRAF/.FALSE./,MIRBF/.FALSE./,
+     * NEWFIL/.TRUE./,OLDGZA/0/,OLDGZB/0/,OLDHTA/0/,OLDHTB/0/,
+     * OLDHPA/0.0/,OLDHPB/0.0/,OWFLG/0/,PLTFLG/.FALSE./,PLTOHA/.06/,
+     * PLTOHB/.07200/,PLTOTA/0.1364/,PLTOTB/0.1385/,
+     * PMODE/ALPHA/,PTYPE/0/,ROTAT/.FALSE./,SAVEF/.FALSE./,
+     * TEKOPN/.FALSE./,
+     * THIGHT/5.625/,TSCLA/1023.0/,TSCLB/779.0/,TTYPE/4010/,TWIDTH/7.5/,
+     * VIEWF/.FALSE./,XOLD/-0.5/,XSCALE/1000.0/,YOLD/-0.75/,
+     * YSCALE/1000.0/,WINDOF/.FALSE./,ZOLD/0.0/,ZSCALE/1000.0/,
+     * ZTEMP/0.0/
+	data filez/'zeta.plt'/,filet/'/dev/tty'/
+	DATA TEKON/27,67,69/,TEKOFF/27,67,70,22,22/,
+     * HOME/29,56,117,32,64/
+
+	end
+
+
diff --git a/ppl/tmapadds/point_convert.F b/ppl/tmapadds/point_convert.F
new file mode 100644
index 0000000..bba6537
--- /dev/null
+++ b/ppl/tmapadds/point_convert.F
@@ -0,0 +1,61 @@
+	SUBROUTINE POINT_CONVERT (xno_uzr,yno_uzr,xuzr,yuzr)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Converts a point (x,y) in /nouser coordinates to /user
+*	J Davison 10.17.89
+
+        IMPLICIT NONE
+	include		'plt_inc.decl'
+	include		'PLT.INC'
+	include		'axis_inc.decl'
+	include		'AXIS.INC'
+
+	real		xno_uzr,yno_uzr,xuzr,yuzr,xf,yf
+
+********************************************************************************
+
+	xf = (xhi - xlo)/xlen
+	yf = (yhi - ylo)/ylen
+
+	xuzr = xno_uzr*xf + xlo
+	yuzr = yno_uzr*yf + ylo
+                                                                               
+	if (itypex .gt. 1) xuzr = 10.0**xuzr
+	if (itypey .gt. 1) yuzr = 10.0**yuzr
+
+	return
+	end
diff --git a/ppl/tmapadds/pplcmd_c.c b/ppl/tmapadds/pplcmd_c.c
new file mode 100644
index 0000000..70ea531
--- /dev/null
+++ b/ppl/tmapadds/pplcmd_c.c
@@ -0,0 +1,77 @@
+/*  pplcmd_c.c  
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides the global pointer to the
+   PLOT+ memory buffer "X". The buffer size has been set if needed in 
+   pplldc when called by pplldc. Call the PLOT+ pplcmd routine -- 
+   the original arguments are simply passed through, with a new argument, 
+   the PPLUS memory buffer
+
+*		SUBROUTINE pplcmd(K,Z,MX,MY,IMN,IMX,JMN,JMX,pplmem)
+
+*/
+/*******************/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/* Called by FORTRAN subroutine pplcmd.  PPLCMD has its original
+   input arguments, but all it does is put string variables in
+   common and call pplcmd_c.
+   
+   Get ppl_memory and pass it to pplcmd_f, which has all the original code.
+ */
+
+void FORTRAN (pplcmd_c)(int*isi, int *icmdim, int *icmsze)
+
+/*******************/
+
+{
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+extern float *ppl_memory;
+
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+  pplcmd_f(isi, icmdim, icmsze, ppl_memory);
+#else
+  pplcmd_f_(isi, icmdim, icmsze, ppl_memory);
+#endif
+
+  return;
+}
diff --git a/ppl/tmapadds/pplld_pts.F b/ppl/tmapadds/pplld_pts.F
new file mode 100644
index 0000000..6ce67d2
--- /dev/null
+++ b/ppl/tmapadds/pplld_pts.F
@@ -0,0 +1,82 @@
+      subroutine pplld_pts(npts,pplmem)
+C**
+C**    @(#)pplld_pts.F	1.2    9/8/88
+C**
+C**
+C***********************************************************************
+C**
+C**                 PLOT+ Scientific Graphics System
+C**
+C***********************************************************************
+C**
+C**
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+c
+c	icode	0 use both x and y
+c		1 use x only
+c		2 use y only
+c	xt	x data
+c	yt	y data
+c	npts	number of xt and yt points
+c	tstrt	start time, corresponds to a value of xt=1.0
+c 	tref	added 11.95, a reference time (~tstart) ferret will set
+c	xdt	sample rate in minutes for x
+c	pplmem  data buffer for PPLUS data
+c
+c	tstrt and xdt are used only for TAXIS,ON.
+c
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* From pplldx_envelope.  After pplldx_envelope has been called for all
+* polygons by polygon_set_up, this routine is called to save the number
+* of points in each polygon in the PPLUS dynamic memory.
+
+
+        IMPLICIT NONE
+	include 'PPLDAT.INC'
+
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+        REAL pplmem(*)
+      	INTEGER	npts
+
+	pplmem(ibase) = FLOAT(npts)
+        ibase = ibase + 1
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/pplld_pts_envelope.c b/ppl/tmapadds/pplld_pts_envelope.c
new file mode 100644
index 0000000..faaf31d
--- /dev/null
+++ b/ppl/tmapadds/pplld_pts_envelope.c
@@ -0,0 +1,82 @@
+/* pplld_pts_envelope.c
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides the global pointer
+   to the PLOT+ memory buffer "X" (called ppl_memory here, X in plot routines). 
+   If the current buffer size is too small this routine ensures that it 
+   gets enlarged. The final act is  to call the PLOT+ PPLLD_PTS routine -- 
+   the original arguments are simply passed through, with a new argument: 
+   the PPLUS memory buffer.
+
+*	subroutine pplld_pts(npts,xdt)
+*/
+
+/*******************/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/*******************/
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+  extern float *ppl_memory; 
+  
+/* pplld_pts_envelope: this routine, called from FORTRAN, will check the
+   memory available for plotting, allocate more if needed, and call pplld_pts.
+ */
+
+void FORTRAN(pplld_pts_envelope)(int *npts,int *plot_mem_used) 
+{  
+/* local variable declaration */
+  int pmemsize;
+/*
+  Is the currently allocated size of PLOT+ memory sufficient?
+  If not, then allocate a larger array
+  Note need to check if the reallocation is successful.
+*/
+
+  FORTRAN(get_ppl_memory_size)(&pmemsize);
+
+  if (*plot_mem_used > pmemsize) reallo_ppl_memory(plot_mem_used); 
+
+  FORTRAN(pplld_pts) (npts, ppl_memory);
+
+return;
+}
diff --git a/ppl/tmapadds/pplldc_envelope.c b/ppl/tmapadds/pplldc_envelope.c
new file mode 100644
index 0000000..a8d3472
--- /dev/null
+++ b/ppl/tmapadds/pplldc_envelope.c
@@ -0,0 +1,91 @@
+/* pplldc_envelope.c
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides the global pointer
+   to the PLOT+ memory buffer "X". If the current buffer size is too
+   small this routine ensures that it gets enlarged. The final act is 
+   to call the PLOT+ PPLLDC routine -- the original arguments are simply 
+   passed through, with a new argument: the PPLUS memory buffer
+
+*	SUBROUTINE PPLLDC(K,Z,MX,MY,IMN,IMX,JMN,JMX,
+*		PI,PJ,NX1,NY1,XMIN1,YMIN1,DX1,DY1)
+*	REAL PI(*),PJ(*),Z(MX,MY)
+*
+
+*/
+/*******************/
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret. */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+extern float *ppl_memory;
+
+#ifdef double_p
+void FORTRAN(pplldc_envelope)(int *k, double *z, int *mx, int *my,int *imn, int *imx,
+             int *jmn, int *jmx, double *pi, double *pj,int *nx1, int *ny1,
+			 double *xmin1, double *ymin1, double *dx1, double *dy1, 
+			 int *plot_mem_used)
+#else
+void FORTRAN(pplldc_envelope)(int *k, float *z, int *mx, int *my,int *imn, int *imx,
+             int *jmn, int *jmx, float *pi, float *pj,int *nx1, int *ny1,
+			 float *xmin1, float *ymin1, float *dx1, float *dy1, 
+			 int *plot_mem_used)
+#endif
+
+{  
+/* local variable declarations */
+  int pmemsize;
+
+/*
+  Is the currently allocated size of PLOT+ memory sufficient?
+  If not, then allocate a larger array
+  Note need to check if the reallocation is successful.
+*/
+
+  FORTRAN(get_ppl_memory_size)(&pmemsize);
+
+  if (*plot_mem_used > pmemsize) reallo_ppl_memory(plot_mem_used); 
+
+  FORTRAN(pplldc) (k, z, mx, my, imn, imx, jmn, jmx, pi, pj, nx1, ny1, 
+                   xmin1, ymin1, dx1, dy1, ppl_memory);
+return;
+}
diff --git a/ppl/tmapadds/pplldv_envelope.c b/ppl/tmapadds/pplldv_envelope.c
new file mode 100644
index 0000000..6621cb7
--- /dev/null
+++ b/ppl/tmapadds/pplldv_envelope.c
@@ -0,0 +1,80 @@
+/*  pplldv_envelope.c
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides the global pointer to the
+   PLOT+ memory buffer "X". The buffer size has been set if needed in 
+   pplldc_envelope when called by pplldc. Call the PLOT+ pplldv routine -- 
+   the original arguments are simply passed through, with a new argument, 
+   the PPLUS memory buffer
+
+*		SUBROUTINE PPLLDV(K,Z,MX,MY,IMN,IMX,JMN,JMX,pplmem)
+
+*/
+/*******************/
+
+/* *kob* 10/03 v553 - gcc v3.x needs wchar.h included */
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret. */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+
+/* pplldv_envelope: this routine, called from FORTRAN, calls pplldv with ppl_memory
+ */
+
+#ifdef double_p
+void FORTRAN(pplldv_envelope)(int *K, double *Z, int *MX, int *MY, int *IMN,int *IMX,
+                              int *JMN,int *JMX)
+#else
+void FORTRAN(pplldv_envelope)(int *K, float *Z, int *MX, int *MY, int *IMN,int *IMX,
+                              int *JMN,int *JMX)
+
+#endif
+/*******************/
+
+{
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+  extern float *ppl_memory;
+
+  FORTRAN(pplldv) (K,Z,MX,MY,IMN,IMX,JMN,JMX,ppl_memory);
+
+  return;
+}
diff --git a/ppl/tmapadds/pplldx_envelope.c b/ppl/tmapadds/pplldx_envelope.c
new file mode 100644
index 0000000..e2502c0
--- /dev/null
+++ b/ppl/tmapadds/pplldx_envelope.c
@@ -0,0 +1,91 @@
+/* pplldx_envelope.c
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides the global pointer
+   to the PLOT+ memory buffer "X" (called ppl_memory here, X in plot routines). 
+   If the current buffer size is too small this routine ensures that it 
+   gets enlarged. The final act is  to call the PLOT+ PPLLDX routine -- 
+   the original arguments are simply passed through, with a new argument: 
+   the PPLUS memory buffer.
+
+*	subroutine pplldx(icode,xt,yt,npts,tstrt,tref,xdt)
+*/
+
+/*******************/
+/* *acm*  1/12      - Ferret 6.8 ifdef double_p for double-precision ferret. */
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/*******************/
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+  extern float *ppl_memory; 
+  
+/* pplldx_envelope: this routine, called from FORTRAN, will check the
+   memory available for plotting, allocate more if needed, and call pplldx.
+ */
+
+#ifdef double_p
+void FORTRAN(pplldx_envelope)(int *icode, double *xt, double *yt, int *npts,
+                              char *tstrt, char *tref, double *xdt, 
+							  int *plot_mem_used) 
+#else
+void FORTRAN(pplldx_envelope)(int *icode, float *xt, float *yt, int *npts,
+                              char *tstrt, char *tref, float *xdt, 
+							  int *plot_mem_used) 
+#endif
+{  
+/* local variable declaration */
+  int pmemsize;
+/*
+  Is the currently allocated size of PLOT+ memory sufficient?
+  If not, then allocate a larger array
+  Note need to check if the reallocation is successful.
+*/
+
+  FORTRAN(get_ppl_memory_size)(&pmemsize);
+
+  if (*plot_mem_used > pmemsize) reallo_ppl_memory(plot_mem_used); 
+
+  FORTRAN(pplldx) (icode, xt, yt, npts, tstrt, tref, xdt, ppl_memory);
+
+return;
+}
diff --git a/ppl/tmapadds/ppllocator.F b/ppl/tmapadds/ppllocator.F
new file mode 100644
index 0000000..b59360f
--- /dev/null
+++ b/ppl/tmapadds/ppllocator.F
@@ -0,0 +1,111 @@
+	SUBROUTINE LOCATOR (x1,lo_dim,hi_dim,x2,ndx_lo)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to determine nearest neighbor index (lower index)
+*	on GRID1 for points on GRID2.
+
+*	Taken from Numerical Recipes, Chapter 3, Section "Search With
+*	Correlated Values"
+
+*	J Davison JISAO/PMEL/NOAA
+*	5.3.88/8.29.88
+
+
+        IMPLICIT NONE
+	integer		lo_dim,hi_dim,ndx_lo,ndx_mid,ndx_hi,inc
+
+	real*4		x1(lo_dim:hi_dim),x2
+
+	logical		ascnd
+
+********************************************************************************
+
+*	TRUE IF ASCENDING GRID COORDINATES, FALSE OTHERWISE
+	ascnd = x1(hi_dim) .gt. x1(lo_dim)
+	
+*	IF INITIAL GUESS IS NO GOOD, GO IMMEDIATELY TO BISECTION
+	if (ndx_lo .lt. lo_dim .or. ndx_lo .gt. hi_dim) then
+	   ndx_lo = lo_dim - 1
+	   ndx_hi = hi_dim + 1
+	   goto 3
+	end if
+
+	inc = 1
+
+*	QUICKLY GET A GOOD ESTIMATE FOR LOCATION IN GRID1
+	if (x2 .ge. x1(ndx_lo) .eqv. ascnd) then
+*	   HUNT UP FOR PLACEMENT IN GRID
+1	   ndx_hi = ndx_lo + inc
+	   
+	   if (ndx_hi .gt. hi_dim) then 
+*	      HUNT OVER -- OFF HIGH END OF GRID
+	      ndx_hi = hi_dim + 1
+	   else if (x2 .ge. x1(ndx_hi) .eqv. ascnd) then
+	      ndx_lo = ndx_hi
+	      inc    = inc + inc
+	      goto 1
+	   end if
+	else
+*	   HUNT DOWN FOR PLACEMENT
+	   ndx_hi = ndx_lo
+2	   ndx_lo = ndx_hi - inc
+
+	   if (ndx_lo .lt. lo_dim) then
+*	      FALL OFF LOW END OF GRID -- HUNT IS OVER
+	      ndx_lo = lo_dim - 1
+	   else if (x2 .lt. x1(ndx_lo) .eqv. ascnd) then
+	      ndx_hi = ndx_lo
+	      inc = inc + inc
+	      goto 2
+	   end if	
+	end if
+
+*	USE BISECTION TO DETERMINE EXACT LOCATION IN GRID
+3	if (ndx_hi - ndx_lo .eq. 1) return
+
+	ndx_mid = (ndx_hi + ndx_lo)/2
+!	if (x2 .gt. x1(ndx_mid) .eqv. ascnd) then ** JD 9.13.89 
+	if (x2 .ge. x1(ndx_mid) .eqv. ascnd) then
+	   ndx_lo = ndx_mid
+	else
+	   ndx_hi = ndx_mid
+	end if
+
+	goto 3
+
+
+	end
diff --git a/ppl/tmapadds/pplmem.h b/ppl/tmapadds/pplmem.h
new file mode 100644
index 0000000..bdb08d1
--- /dev/null
+++ b/ppl/tmapadds/pplmem.h
@@ -0,0 +1,101 @@
+/* pplmem.h 
+   Declarations for routines that allow dynamic PPLUS memory buffer 
+   9/18/01 *acm*
+
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+/* Easier way of handling FORTRAN calls with underscore/no underscore */
+#ifndef FORTRAN
+#ifdef NO_ENTRY_NAME_UNDERSCORES
+#define FORTRAN(a) a
+#else
+#define FORTRAN(a) a##_
+#endif
+#endif
+
+
+void FORTRAN(pplcmd_c)(int *, int *, int *);
+void FORTRAN(pplcmd_f)(int *, int *, int *, float * );
+
+#ifdef double_p
+void FORTRAN(pplldx_envelope)(int *, double *, double *, int *, 
+                       char *, char *, double *, int *);
+
+void FORTRAN(pplldx)( int *, double *, double *, int *, 
+                       char *, char *, double *, float * );
+
+
+void FORTRAN(pplldc_envelope)(int *, double *, int *, int *, int *, int *,
+                       int *, int *, double *, double *, int *, int *,
+                       double *, double *, double *, double *, int *);
+
+void FORTRAN(pplldc)( int *, double *, int *, int *, int *, int *, 
+                       int *, int *, double *, double *, int *, int *, 
+                       double *, double *, double *, double *, float *);
+
+void FORTRAN(pplldv_envelope)(int *, double *, int *, int *, int *, 
+                       int *, int *, int *);
+
+void FORTRAN(pplldv)( int *, double *, int *, int *, int *, int *, 
+                       int *, int *, float *);
+#else
+void FORTRAN(pplldx_envelope)(int *, float *, float *, int *, 
+                       char *, char *, float *, int *);
+
+void FORTRAN(pplldx)( int *, float *, float *, int *, 
+                       char *, char *, float *, float * );
+
+
+void FORTRAN(pplldc_envelope)(int *, float *, int *, int *, int *, int *,
+                       int *, int *, float *, float *, int *, int *,
+                       float *, float *, float *, float *, int *);
+
+void FORTRAN(pplldc)( int *, float *, int *, int *, int *, int *, 
+                       int *, int *, float *, float *, int *, int *, 
+                       float *, float *, float *, float *, float *);
+
+void FORTRAN(pplldv_envelope)(int *, float *, int *, int *, int *, 
+                       int *, int *, int *);
+
+void FORTRAN(pplldv)( int *, float *, int *, int *, int *, int *, 
+                       int *, int *, float *);
+#endif
+
+void FORTRAN(save_ppl_memory_size)(int *);
+void FORTRAN(get_ppl_memory_size)(int *);
+
+void reallo_ppl_memory( int * );
+
diff --git a/ppl/tmapadds/pplp_ver_data.F b/ppl/tmapadds/pplp_ver_data.F
new file mode 100644
index 0000000..17c34d9
--- /dev/null
+++ b/ppl/tmapadds/pplp_ver_data.F
@@ -0,0 +1,50 @@
+	BLOCK DATA PPLP_VER_DATA
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Block data date is generated by the PPLP make processe
+*	J Davison 2.24.93
+
+        IMPLICIT NONE
+	include 'pplp_ver_date.cmn'
+
+	data 	pplp_ver/'v3.0 '/,
+     .		pplp_make_date/'04/01/93'/
+
+	end
+
+
+
diff --git a/ppl/tmapadds/reallo_envelope.c b/ppl/tmapadds/reallo_envelope.c
new file mode 100644
index 0000000..02a7969
--- /dev/null
+++ b/ppl/tmapadds/reallo_envelope.c
@@ -0,0 +1,77 @@
+/* reallo_envelope.c
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+   This intermediate "envelope" routine provides access to the global pointer
+   to the PLOT+ memory buffer "X" (called ppl_memory here, X in plot routines). 
+   If the current buffer size is too small this routine ensures that it 
+   gets enlarged.  Called by polygon_set_up so all memory is allocated 
+   at one time.
+
+*	subroutine reallo(icode,xt,yt,npts,tstrt,tref,xdt)
+*/
+
+/*******************/
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/*******************/
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+  extern float *ppl_memory; 
+  
+/* reallo_envelope: this routine, called from FORTRAN, will check the
+   memory available for plotting and allocate more if needed.
+ */
+
+void FORTRAN(reallo_envelope)(int *plot_mem_used) 
+{  
+/* local variable declaration */
+  int pmemsize;
+/*
+  Is the currently allocated size of PLOT+ memory sufficient?
+  If not, then allocate a larger array
+  Note need to check if the reallocation is successful.
+*/
+
+  FORTRAN(get_ppl_memory_size)(&pmemsize);
+  if (*plot_mem_used > pmemsize) reallo_ppl_memory(plot_mem_used); 
+
+return;
+}
diff --git a/ppl/tmapadds/reallo_ppl_memory.c b/ppl/tmapadds/reallo_ppl_memory.c
new file mode 100644
index 0000000..77089ea
--- /dev/null
+++ b/ppl/tmapadds/reallo_ppl_memory.c
@@ -0,0 +1,81 @@
+/*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+*  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+NOTE: Needs error checking to see that the realloc actually worked.
+
+* reallo_ppl_memory.c
+
+   Enlarge the memory allocated to the PLOT+ buffer.
+   Ferret v5.52 *acm* 6/5/04 fix typo in print statement 
+*/
+
+#include <Python.h> /* make sure Python.h is first */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "pplmem.h"
+
+/* The global pointer to PLOT+ memory is declared as extern here
+   (Defined in fermain_c.c)
+*/
+  extern float *ppl_memory; 
+  
+
+void reallo_ppl_memory(int *this_size)
+{
+  
+/* local variable declaration */
+  int current_size;
+
+/* allocate or reallocate PLOT+ memory buffer */
+
+  FORTRAN(get_ppl_memory_size)(&current_size);
+
+/* free the currently allocated memory */
+  if (current_size != 0)
+      free ( (void *) ppl_memory );
+/* allocate new ammount of memory */
+  ppl_memory = (float *) malloc(sizeof(float) * *this_size );
+
+/* Check that the memory was allocated OK*/
+
+  if ( ppl_memory == (float *)0 ) {
+    printf("Unable to allocate the requested %d words of PLOT memory.\n",*this_size);
+    exit(0);
+   }
+/* save the size of what was allocated */
+  FORTRAN(save_ppl_memory_size) (this_size);
+
+  return;
+}
diff --git a/ppl/tmapadds/restore_saved_line_colors.F b/ppl/tmapadds/restore_saved_line_colors.F
new file mode 100644
index 0000000..7721ca7
--- /dev/null
+++ b/ppl/tmapadds/restore_saved_line_colors.F
@@ -0,0 +1,62 @@
+        SUBROUTINE restore_saved_line_colors (zwsid)
+
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Restores saved RGB values - changes for single color indices
+*       for metafile batch mode (cuckoos egg trick makes this necessary)
+* V616  *acm* 1/00 
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        IMPLICIT NONE
+	include 'parampl5_dat.decl'
+	include 'PARAMPL5.DAT'
+	include 'save_colors.cmn'
+        INCLUDE 'pen_inc.decl'  ! with num_line_colors
+        INCLUDE 'PEN.INC'
+
+	INTEGER	zwsid
+	INTEGER j
+
+	do 40 j = 1, num_line_colors     
+           IF (ndx_save_colors(j) .EQ. j) 
+     .	       CALL FGD_GSCR(zwsid,j,val_red(j),val_green(j),
+     .                               val_blue(j),val_opaque(j))
+  40	CONTINUE
+
+        RETURN
+	END
+
+
diff --git a/ppl/tmapadds/ribbon_missing.F b/ppl/tmapadds/ribbon_missing.F
new file mode 100644
index 0000000..f55883e
--- /dev/null
+++ b/ppl/tmapadds/ribbon_missing.F
@@ -0,0 +1,185 @@
+        SUBROUTINE RIBBON_MISSING
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*       Sets the options for missing-data representation in RIBBON plots
+*       (see shade_set for color spectra)
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+        include 	'cmrdl_inc.decl'            
+        include 	'CMRDL.INC'            
+        include 	'gkscm1_inc.decl'            
+        include 	'GKSCM1.INC'            
+        include 	'gkscm2.cmn'            
+
+	include        'gkspar.inc'
+
+
+       	logical		there
+        integer         beg,end                            
+        character*2048   str                                
+
+******************************************************************************
+
+      	call upnsquish (label,str,end)
+        call squish (label,1,2048)
+
+*	If a spectrum is to be read, do that and set color
+	beg = index (str,'SPECTRUM')
+	if (beg .ne. 0) then
+	   call RIBBON_READ (label,beg,end,there)
+	   if (.not.there) return
+	end if
+
+*	Otherwise: if default colors requested, set them
+	beg = index (str,'DEFAULT')
+	if (beg .ne. 0) then
+	   ribbon_miss(1) = -1.
+	   ribbon_miss(2) = -1.
+	   ribbon_miss(3) = -1.
+	   ribbon_miss(4) = -1.
+	end if
+
+*	Otherwise: if user has said BLANK, mark this with -2.
+	beg = index (str,'BLANK')
+	if (beg .ne. 0) then
+	   ribbon_miss(1) = -2.
+	   ribbon_miss(2) = -2.
+	   ribbon_miss(3) = -2.
+	   ribbon_miss(4) = -2.
+	end if
+
+	return
+	end
+
+
+	SUBROUTINE RIBBON_READ (str,beg,end,there)
+
+*	Mod *jd* 10.92 to allow memory reads
+*	Mod *jd* 3.1.93 to use tm_inq_path
+
+        include 	'tmap_errors.parm'    
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+        include         'shade_vars.cmn'
+
+	logical		there
+	integer		beg,end,i,j,speclen,lnblk,status
+        integer         test_end
+	character*2048	str,sfile,instr,label,specdir,tm_inq_path
+        character*2048   test_str
+	external 	lnblk
+
+        integer         mapping,percentage,value,level 
+        INTEGER         TM_LENSTR1, ilen, slen
+*******************************************************************************
+
+*       DEFAULT MAPPING IS PERCENT FOR COMPATIBILITY WITH ORIGINAL SYSTEM
+        rgb_mapping = percent
+
+*	If no file name given, or its default, the line is black.
+	if (end .lt. 10) then
+	   there = .true.
+	   return
+	endif
+
+	sfile = tm_inq_path (str(beg+9:end),'FER_PALETTE','.spk',
+     .	.false.,status)
+
+	if (status .ne. merr_ok) go to 100
+	there = .true.
+
+*	OPEN THE FILE
+
+#ifdef NO_OPEN_READONLY
+ 5      open (70,file=sfile,status='old',err=100)
+#else
+ 5      open (70,file=sfile,readonly,status='old',err=100)
+#endif
+
+	rgb_mapping = percent  ! always: 
+
+*	NOW READ IN THE FIRST LEVEL AND SET THE RGB 
+10	read (70,'(a)',end=30,err=90) instr
+	do 15 i = 1,80
+	   if (instr(i:i) .ne. ' ') then
+	      j = i
+	      goto 20
+	   end if
+15	end do
+	goto 10
+
+*	PERMIT COMMENTS 
+20	if (instr(j:j) .eq. '!') goto 10
+
+*       IGNORE MAPPING
+        if (index(test_str, 'RGB_MAPPING') .ne. 0) goto 10
+
+* read first color, set color by percent.
+	call upnsquish (instr,test_str,test_end)
+ 
+        call parsex (instr(j:j+79),80,p,iflg,m,label,n)
+	
+* Leave the values as percentages. Will be calling SET_ONE_COLOR
+* which expects this.
+
+	if (p(1) .GE. 0. .and. p(1) .LE. 100.) THEN
+	   ribbon_miss(1) = p(2)
+	   ribbon_miss(2) = p(3)
+	   ribbon_miss(3) = p(4)
+           if ( m .eq. 5 ) then
+              ribbon_miss(4) = p(5)
+           else
+              ribbon_miss(4) = 100.0
+           endif
+	ENDIF
+	goto 30
+
+30	close (70)
+	return
+
+*	ERROR WITH FILE ACCESS
+90	close (70)
+100	continue
+	CALL WARN ('Unable to read ' //str(beg+9:end)//
+     .	'.spk" to set missing-color for ribbon plot.')
+	CALL WARN ('Defaulting to thin black line')
+
+	return
+
+	end
+
diff --git a/ppl/tmapadds/save_line_color.F b/ppl/tmapadds/save_line_color.F
new file mode 100644
index 0000000..050454c
--- /dev/null
+++ b/ppl/tmapadds/save_line_color.F
@@ -0,0 +1,57 @@
+        SUBROUTINE save_line_color (ndx, vred,vgreen,vblue)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Saves the RGB values for a single color index
+*       for metafile batch mode (cuckoos egg trick makes this necessary)
+* V616  *acm* 1/00 
+
+        IMPLICIT NONE
+	include         'parampl5_dat.decl'
+	include         'PARAMPL5.DAT'
+	include         'save_colors.cmn'
+
+	integer		ndx
+	real		vred, vgreen, vblue
+
+	ndx_save_colors(ndx) = ndx
+	val_red(ndx) = vred
+	val_green(ndx) = vgreen
+	val_blue(ndx) = vblue
+
+        return
+	end
+
+
diff --git a/ppl/tmapadds/save_rgb_blkdat.F b/ppl/tmapadds/save_rgb_blkdat.F
new file mode 100644
index 0000000..5466e42
--- /dev/null
+++ b/ppl/tmapadds/save_rgb_blkdat.F
@@ -0,0 +1,53 @@
+	BLOCK DATA SAVE_RGB_BLKDAT
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that INCLUDEs this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* 1/2009 *ACM
+C
+
+C	*******************************************************************
+C       Initialize space that saves the rgb colors
+C	*******************************************************************
+
+        IMPLICIT NONE
+	INCLUDE         'parampl5_dat.decl'
+	INCLUDE         'PARAMPL5.DAT'
+	INCLUDE         'save_colors.cmn'
+
+	DATA	ndx_save_colors/  NLINES*0/
+	DATA	val_red/  NLINES*0./
+	DATA	val_green/  NLINES*0./
+	DATA	val_blue/  NLINES*0./
+      end
diff --git a/ppl/tmapadds/say_interrupted.F b/ppl/tmapadds/say_interrupted.F
new file mode 100644
index 0000000..c7c89a4
--- /dev/null
+++ b/ppl/tmapadds/say_interrupted.F
@@ -0,0 +1,69 @@
+	SUBROUTINE SAY_INTERRUPTED
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* write a text string "**INTERRUPTED**" on the plot
+
+* programmer - steve hankin
+* NOAA/PMEL, Seattle, WA - Tropical Modeling and Analysis Program
+* written for VAX computer under VMS operating system
+*
+* revision 0.0 - 1/24/89
+
+        IMPLICIT NONE
+	include 'axis_inc.decl'
+	include 'AXIS.INC'
+
+	REAL	x, y, ang, ht, wid, strwid
+	CHARACTER string*32
+!	REAL	SYMWID		! used once to determine string width
+
+	DATA	ang   / 0.0  /
+	DATA	ht    / 0.25 /
+	DATA	string/ '@TI** INTERRUPTED **' /
+	DATA	strwid/ 3.595 /	! result of "SYMWID( ht, 17, string(4:) )"
+
+	wid = strwid * ((xhi-xlo)/xlen)
+	x   = (xlo+xhi-wid)*.5 
+	y   = (ylo+yhi)*.5
+
+	CALL SYMBEL( x, y, ang, ht, 20, string )
+
+* *kms* 12/2011 - add call to update the window to show this message
+        CALL FGD_CONSIDER_UPDATE(.TRUE.)
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/set_default_colors.F b/ppl/tmapadds/set_default_colors.F
new file mode 100644
index 0000000..2c719ff
--- /dev/null
+++ b/ppl/tmapadds/set_default_colors.F
@@ -0,0 +1,66 @@
+	SUBROUTINE SET_DEFAULT_COLORS (zwsid,zwstype,ndx_lo,range)
+	
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Sets the color map between ndx_lo and ndx_hi to ws default
+*	J Davison JISAO/PMEL/TMAP 8.1.89
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+	integer		zwsid,ndx_lo,range,ndx_hi,zwstype,err,ndx
+	real		r_val,g_val,b_val,a_val
+
+********************************************************************************
+
+	ndx_hi	= ndx_lo + range - 1
+
+*	SET ALL COLORS TO THE DEFAULT
+	do 50 ndx = ndx_lo,ndx_hi
+
+*	   WHAT IS THE DEFAULT COLOR FOR EACH NDX?
+	   call FGD_GQPCR(zwstype,ndx,err,r_val,g_val,b_val,a_val)
+	   if (err .eq. 0) then
+
+*	   SET THE COLOR OF THIS NDX
+              if ( overriding_alpha .GE. 0.0 ) a_val = overriding_alpha
+   	      call FGD_GSCR(zwsid,ndx,r_val,g_val,b_val,a_val)
+	   endif
+50	end do
+
+	return
+	end
diff --git a/ppl/tmapadds/set_default_nlevels.F b/ppl/tmapadds/set_default_nlevels.F
new file mode 100644
index 0000000..96f7e6c
--- /dev/null
+++ b/ppl/tmapadds/set_default_nlevels.F
@@ -0,0 +1,54 @@
+	SUBROUTINE SET_DEFAULT_NLEVELS (nlevels)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V610 *acm* 3/08 - add new MODE NLEVELS; default number of levels is still 10,
+* see fer/dat/xprog_state_data.F. Store a new setting for the default number of 
+* contour/fill levels, set by MODE NLEVELS 
+
+        IMPLICIT NONE
+
+        INTEGER nlevels
+
+	INCLUDE 'parampl5_dat.decl'
+	INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'cont_inc.decl'
+	INCLUDE 'CONT.INC'
+
+        NLEV_DFLT = nlevels
+
+	RETURN
+	END
+
diff --git a/ppl/tmapadds/set_fill_area_rep.F b/ppl/tmapadds/set_fill_area_rep.F
new file mode 100644
index 0000000..df9dbc8
--- /dev/null
+++ b/ppl/tmapadds/set_fill_area_rep.F
@@ -0,0 +1,80 @@
+        SUBROUTINE SET_FILL_AREA_REP (zwsid,zwstype)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Setup the fill area indices for patterns or colors depending on
+*       workstation characteristics
+*
+*       J Davison JISAO/PMEL/TMAP
+*       9.2.88
+*       JD modified 3.15.89 to support additional workstation types
+*       2.18.92 *jd* mod to support ATC GKS
+*       *kms* 11/20111 - change to only using ws_fill_rep
+
+        IMPLICIT NONE
+        INCLUDE 'ws_types.cmn'
+
+        INTEGER zwsid,zwstype
+
+* ifdef atc_gks
+*       if (zwstype/100 .eq. ws_xwindow/100 .or. zwstype .eq. ws_uis) then
+* else
+*       if (zwstype .eq. ws_xwindow .or. zwstype .eq. ws_uis) then
+* endif
+*          XWINDOW (OR UIS) WS
+*          call ws_fill_rep (zwsid,zwstype)
+*       else if (zwstype .eq. ws_ps_mono .or. zwstype .eq. ws_tek4014) then
+*          MONOCHROME HATCHING
+*          call hatch_fill_rep (zwsid)
+*       else if (zwstype .eq. ws_tek4107) then
+*          TEK 4107
+*          call tek4107_fill_rep (zwsid)
+*       else
+*          SETUP DEFAULT FILL AREA BUNDLES
+*          call ws_fill_rep (zwsid,zwstype)
+*       end if
+
+        IF ( zwstype .EQ. 0 ) THEN
+*          MONOCHROME HATCHING
+           CALL HATCH_FILL_REP(zwsid)
+        ELSE
+*          XWINDOW (OR UIS) WS
+           CALL WS_FILL_REP(zwsid,zwstype)
+        ENDIF
+
+        RETURN
+
+        END
diff --git a/ppl/tmapadds/set_fill_ndx.F b/ppl/tmapadds/set_fill_ndx.F
new file mode 100644
index 0000000..05859e8
--- /dev/null
+++ b/ppl/tmapadds/set_fill_ndx.F
@@ -0,0 +1,81 @@
+	SUBROUTINE SET_FILL_NDX (fill_ndx)
+
+*	Sets fill index appropriately.  DEC uses bundled indices,
+*	at this date ATC has too few to use them, so must use individual
+*	attributes.
+
+*	J Davison 10.12.92
+*       *jd* 7.31.97 mode to change call to gqlwk to query_xgks_wkstn
+*       *jd* 10.98 handle "atomic" colors
+* 3/99 *kob* 	move var init off of decl list  - cleaning up after jerry.
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+	include		'gkscm1_inc.decl'
+	include		'GKSCM1.INC'
+        include        'gkspar.inc'
+
+	integer		fill_ndx,style,pattern_ndx,solid
+	DATA            solid/21/
+        integer         max_pline,max_pmark,max_text,max_fill_area
+        integer         max_pattern,max_color,error,color_ndx
+	real		incr,spc,min_spc,delta_spc
+  
+	parameter	(min_spc=0.05,delta_spc=0.01)
+
+*******************************************************************************
+
+	if (area_bundles) then
+*	   USE SET FILL AREA INDEX
+	   call FGD_GSFAI(fill_ndx+lo_color_ndx(wsid))
+	else
+*	   HOW MANY COLORS HAVE WE?
+           call FGD_GQLWK (wstype,error,max_pline,max_pmark,
+     .              max_text,max_fill_area,max_pattern,max_color)
+
+	   if (max_color .gt. 2) then 
+*	      CAN STILL USE COLOR INDICES -- BUT INDIVIDUAL
+	      
+*             USE ATOMIC COLORS?
+	      if (rgb_mapping .ne. by_level) then
+*                SMOOTH OUT COLORS TO FULL RANGE
+	         call FGD_GSFACI(fill_ndx+lo_color_ndx(wsid)-2)
+	      else
+*                USE ATOMIC COLORS -- REUSE AS NECESSARY
+		 color_ndx = mod((fill_ndx - 2),ncl) + 2
+		 call FGD_GSFACI(color_ndx+lo_color_ndx(wsid)-2)
+	      end if
+	   else
+#ifdef atc_gks
+*	      OTHERWISE USE HATCHING SCHEME
+	      incr = real (fill_ndx/2) - 1.0
+
+*	      SEQUENTIAL INDICES ARE HATCHING ROTATED 90 DEGREES
+	      if (mod(fill_ndx,2) .eq. 0) then
+	            style = -1005
+		    spc = min_spc + incr*delta_spc
+	      else
+		    style = -1004
+		    spc = (min_spc + incr*delta_spc) * 0.707
+	      endif
+
+	      call FGD_GSFASI(style)
+	      call guesc061 (wsid,1,spc)
+#endif
+	   endif
+	endif
+
+#ifdef xgks
+	pattern_ndx = mod((fill_ndx - 2),npat) + 1
+
+	if (patterns(pattern_ndx) .eq. solid) then
+	   call FGD_GSFAIS(GSOLID)
+	else
+	   call FGD_GSFAIS(GHATCH)
+	   call FGD_GSFASI(-1 * patterns(pattern_ndx))
+	end if
+#endif
+
+	return
+	end
+
diff --git a/ppl/tmapadds/set_gks_metafile.F b/ppl/tmapadds/set_gks_metafile.F
new file mode 100644
index 0000000..1ed6157
--- /dev/null
+++ b/ppl/tmapadds/set_gks_metafile.F
@@ -0,0 +1,181 @@
+        SUBROUTINE SET_GKS_METAFILE
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       J Davison JISAO/PMEL/TMAP
+*       3.15.89
+
+*       For GKS plots (pltype = 3 or 4) captures WS type and whether to open a
+*       GKS metafile, or not.  Opens GKS if not open, and activates/deactivates
+*       metafile WS.
+
+*       *JD* 4.22.91 No need for metafile wstype w new metafile translator
+*       *jd* 3.10.92 Mod to handle ATC GKS methods
+*       *jd* 10.7.92 Mod to use wstype default (GKS3Dwstype) in DEC
+*       *jd* 2.24.93 Mod to add PPLP version numbers in metafile
+*       *jd* 8.10.93 Mod to add XGKS options for WS types
+*       *jd* 10.26.93 Mod to eliminate version number from xgks
+*       *jd* 12.8.93 Mod to put line color rep info into metafile for xgks
+*       *sh* 3.4.97 Mod to support metafile-only (no X) output through a
+*               cuckoo's egg implantation of meta_wsid in place of wsid
+*       *js* 7.25.97 Added 'C' callable save_metafile_name to save string
+*               in variable 'meta_file'
+*       *acm* 2.08 Added 'C' callable get_metafile_name to retrieve string
+*               in variable 'meta_file' and return it.
+* v552 *acm* 3/03 Longer strings.
+* V608 *acm*10/07  true batch mode for metafiles; flag meta_batch
+*         distinguises this case from other batch modes.
+* V610  *acm* 3/08 Fixes for metafile batch mode
+* V68   *acm* 4/11 change how flag meta_batch is computed (different Makefile)
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+        IMPLICIT NONE
+        include 'pltcom_dat.decl'
+        include 'PLTCOM.DAT'
+        include 'cmrdl_inc.decl'
+        include 'CMRDL.INC'
+        include 'gkscm1_inc.decl'
+        include 'GKSCM1.INC'
+        include 'gkscm2.cmn'
+        include 'ws_types.cmn'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'pen_inc.decl'  ! with num_line_colors
+        INCLUDE 'PEN.INC'
+
+        integer         beg,iend,defws,ndx,type,error
+        real            red,green,blue
+        character*2048  str
+        character*5     kdefws
+
+        LOGICAL xwindows
+
+*************************************************************************
+
+*       DETERMINE IF WINDOWING IS X OR NOT
+        xwindows = .true.
+
+*       MASSAGE COMMAND STRING OF FORM "WS=xxx,META"
+        CALL UPNSQUISH(label,str,iend)
+
+*       OPEN GKS AND WS IF NOT ALREADY OPEN
+        IF ( gksopn ) GOTO 10
+
+*       DEFINE DEFAULT WS TYPE
+        CALL GETENV('XGKSwstype',kdefws)
+
+        IF (kdefws .NE. ' ') THEN
+           READ(UNIT=kdefws,FMT='(i5)') defws
+        ELSE
+           defws = ws_xwindow
+        ENDIF
+
+*       EXTRACT WS INFO FROM PLTYPE STRING ARGUMENT
+        beg = INDEX(str,'WS')
+
+*       USE DEFAULT IF WS TYPE NOT SPECIFIED BELOW
+        IF (beg .EQ. 0) THEN
+           wstype = defws
+        ELSE IF ( INDEX(str(beg+3:beg+6),'VSII') .NE. 0 ) THEN
+           IF (xwindows) THEN
+              wstype = ws_xwindow
+           ELSE 
+              wstype = ws_uis
+           ENDIF
+        ELSE IF ( INDEX(str(beg+3:beg+9),'TEK4014') .NE. 0 ) THEN
+           wstype = ws_tek4014
+        ELSE IF ( INDEX(str(beg+3:beg+9),'TEK4107') .NE. 0 ) THEN
+           wstype = ws_tek4107
+        ENDIF
+        CALL OPEN_GKS_WS
+
+*       EXTRACT METAFILE CMD FROM PLTYPE STRING ARGUMENT
+10      beg = INDEX(str,'META')
+        IF ( beg .NE. 0 ) THEN
+           IF ( .NOT. imgname_sent ) THEN
+               CALL OPEN_METAFILE
+           ENDIF
+        END IF
+
+        RETURN
+        END
+
+
+*
+* Save the image filename in meta_file.  Set the save_on_exit
+* flags to .TRUE. so the image will be saved.  Do not call
+* OPEN_METAFILE at this time since this is only called on
+* on start-up and there is no active window at this time.
+* Instead, set imgname_sent to .FALSE.
+*
+        SUBROUTINE SAVE_METAFILE_NAME(mname, clen)
+        IMPLICIT NONE
+        INCLUDE 'gkscm2.cmn'
+        INTEGER clen
+#ifdef sun
+        byte mname(clen) 
+#else   
+        integer*1 mname(clen)
+#endif  
+        CALL TM_CTOF_STRNG(mname, meta_file, clen)
+        save_on_exit = .TRUE.
+        imgname_sent = .FALSE.
+        RETURN
+        END
+
+
+        SUBROUTINE GET_METAFILE_NAME(filename)
+        IMPLICIT NONE
+        INCLUDE 'gkscm2.cmn'
+        CHARACTER*(*) filename
+        filename = meta_file
+        RETURN
+        END
+
+
+*
+* This function is for setting save_on_exit to .FALSE. before
+* starting plot_plus, thus preventing creation of an empty
+* image file.
+*
+        SUBROUTINE CANCEL_SAVEONEXIT
+        IMPLICIT NONE
+        INCLUDE 'gkscm2.cmn'
+        save_on_exit = .FALSE.
+        RETURN
+        END
+
diff --git a/ppl/tmapadds/set_levels_shade_fill.F b/ppl/tmapadds/set_levels_shade_fill.F
new file mode 100644
index 0000000..e871eae
--- /dev/null
+++ b/ppl/tmapadds/set_levels_shade_fill.F
@@ -0,0 +1,279 @@
+      SUBROUTINE set_levels_shade_fill (status)
+	
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V631  *acm*10/09 Fix bug 1704: LEVELS=xD was incorrect.
+* V663  *acm* 5/10 Fix bug 1744: hang if /LEVELS=v and all missing data.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+        IMPLICIT NONE
+	include		'parampl5_dat.decl'
+	include		'PARAMPL5.DAT'
+	include		'axis_inc.decl'
+	include		'AXIS.INC'
+	include		'plt_inc.decl'
+	include		'PLT.INC'
+	include		'miss_inc.decl'
+	include		'MISS.INC'
+	include		'hd_inc.decl'
+	include		'HD.INC'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+        include         'errmsg.parm'
+	
+* argument declarations
+	INTEGER		status
+
+* local declarations
+	REAL		dmin, dmax, dz, fm, znp, zmp, dzmax
+	INTEGER		i, m, jj
+        LOGICAL		TM_FPEQ_SNGL
+
+        EXTERNAL range
+
+	status = ferr_ok
+	lev_str = 'none'
+C       
+C       IAUTOC = 1 means: compute levels from input data and number
+C                         of levels
+
+	IF (IAUTOC.EQ.1) THEN
+
+	   IF (ZMIN.EQ.ZMAX) THEN
+
+C             NLEV2=0 is the code in pplmod_plotz
+	      NLEV2=1
+              zlev(1) = zmin
+
+	   ELSE IF (ZMIN .GT. CMZGE .AND. ZMAX .LE. CMZLE) THEN  ! all missing
+
+C             NLEV2=0 is the code in pplmod_plotz
+	      NLEV2=1
+              zlev(1) = zmin
+
+	   ELSE
+C       
+C       If set_delta is .true. the delta value has been set
+C       elsewhere and we should calculate the max and min values
+C       of the range based on this delta.
+C       (This portion stolen from RANGE)
+
+	      if (set_delta) then 
+
+		 dz = delta
+C       
+C       CALCULATE THE MINIMUM VALUE OF THE RANGE
+C       
+		 FM = (zmin) / DZ
+		 M = IFIX(FM)
+		 IF (FM .LT. 0.0) M = M - 1
+		 znp = DZ * FLOAT(M)
+C       
+C       CALCULATE THE MAXIMUM VALUE OF THE RANGE.
+C       
+		 FM = (zmax) / DZ
+		 M = IFIX(FM)
+		 IF(FM .GT. 0.0)M = M + 1
+		 zmp = DZ * FLOAT(M)
+C
+C       Set levels centered about zero if centered is .true.
+C
+	         if (centered) then
+		    if (abs(znp) .gt. abs(zmp)) then
+		       zmp = -znp
+		    else
+		       znp = -zmp
+		    endif
+	         endif
+
+              else if (openlev) then
+	         CALL set_open_levels
+
+C       Else we should allow RANGE to determine the max and min range
+C       values and also the appropriate delta value. (ZNP, ZMP, DZ)
+
+	      else
+
+	         znp = zmin
+	         zmp = zmax
+	         if (centered) then
+		    if (abs(znp) .gt. abs(zmp)) then
+		       zmp = -znp + zmean
+		    else
+		       znp = -zmp + zmean
+		    endif
+	         endif
+		 CALL RANGE(znp,zmp,NLEV,ZNP,ZMP,DZ)
+
+	      endif
+
+              IF (.NOT.openlev) THEN
+	      NLEV2=(ZMP-ZNP)/DZ+1 
+
+c *acm* 4/08 Set jj as in plotz
+
+              IF (TM_FPEQ_SNGL((ZNP + DZ*(NLEV2-1)), ZMP) .EQV. .FALSE.) THEN
+                 IF (ZNP + DZ*(NLEV2-1) .LT. ZMP) NLEV2 = NLEV2 + 1
+	      ENDIF
+
+	      IF (ZMP-ZNP .EQ. 0) THEN
+                 JJ=NSIGC
+              ELSE
+                 JJ=NSIGC-IFIX(ALOG10(ABS(ZMP-ZNP))+.5)
+              ENDIF
+              IF (JJ.LE.0) JJ=-1
+
+c *acm* 3/04 under g77 on linux this incorrectly uses
+c            low-order bits to reset NLEV2 example:
+c             yes?shade/lev=c {-1.1, 1.1}* ysequence({1,1})
+
+c       4/04  But, dont just skip this, use TM_FPEQ_SNGL to see if
+c             values are equal... 
+c       4/04  Also fix the negative-range case.
+
+	      IF ( (ZNP + DZ*(NLEV2-1) .LT. ZMP) .AND. 
+     .              .NOT. TM_FPEQ_SNGL(ZNP + DZ*(NLEV2-1), ZMP) ) THEN
+		 NLEV2 = NLEV2 + 1
+	      ENDIF
+
+              IF (NLEV2 .GT. ICNLEV) GO TO 5000
+
+C acm 12/01  Set LWGT for future contour line overlays.
+
+	      DO 100 I=1,NLEV2 
+
+                 LWGT(I)=2
+                 LDIG(I)=-1
+                 ZLEV(I)=ZNP+DZ*FLOAT(I-1)
+                 IF (ABS(ZLEV(I)).LT.1.E-5*DZ) GOTO 100
+                 IF (ZLEV(I).GT.0.) THEN
+                    LWGT(I)=1
+                 ELSE
+                    LWGT(I)=3
+                 END IF
+                 LDIG(I)=JJ
+
+
+ 100	      CONTINUE 
+
+              endif  ! openlev
+
+	   ENDIF
+
+C       
+C       Else IAUTOC != 1 means: use supplied levels
+C       
+
+C       
+	ELSE  ! iautoc = 0
+
+C	FIND MIN AND MAX as in lev.F from the Z levels.
+
+	   DMIN=ZLEV(1)
+	   IF (neginf) DMIN = ZLEV(2)
+	   DMAX=DMIN
+           DZMAX = 0.
+	   DO 110 I=2,NLEV
+	      IF(ZLEV(I).GT.DMAX)DMAX=ZLEV(I)
+	      IF(ZLEV(I).LT.DMIN)DMIN=ZLEV(I)
+              DZ = ZLEV(I)-ZLEV(I-1)
+              IF (DZ .GT. DZMAX) DZMAX = DZ
+110        CONTINUE
+
+	   IF (DMIN.EQ.DMAX) THEN
+c	      NLEV2=0
+	      NLEV2=1
+	   ELSE
+	   
+	   IF (openlev) THEN
+	      CALL set_open_levels
+	   ELSE
+	      NLEV2=NLEV
+              IF (neginf) zlev(1) = MIN( zlev(1), zmin-1. )
+              IF (posinf) zlev(nlev) = MAX (zlev(nlev), zmax+1. )
+
+C Compute the digits in the contour levels, and line characteristics
+C these will not have been set before on, say a previous SHADE plot
+C 8/07 ACM. Do this computation only for auto-level setting. If the user
+C      has set levels, this is already done (and the values are different).
+
+              IF (iautoc .EQ. 1) THEN
+                 znp = dmin
+                 zmp = dmax
+                 dz = 0
+                 IF (set_delta) THEN
+                    dz = delta
+	            IF (ZNP + DZMAX*(NLEV2-1) .LT. ZMP) NLEV2 = NLEV2 + 1
+                 ENDIF
+
+	         IF (ZMP-ZNP .EQ. 0) THEN
+                    JJ=NSIGC
+                 ELSE
+                    JJ=NSIGC-IFIX(ALOG10(ABS(ZMP-ZNP))+.5)
+                 ENDIF
+                 IF (JJ.LE.0) JJ=-1
+
+                 IF (NLEV2 .GT. ICNLEV) GO TO 5000
+
+	         DO 106 I=1,NLEV2
+		    LWGT(I)=2
+		    LDIG(I)=-1
+		    IF (ABS(ZLEV(I)).LT.1.E-5*DZMAX) GOTO 106
+                    IF ( TM_FPEQ_SNGL( ABS(ZLEV(I)) ,0.) ) GOTO 106
+		    IF (ZLEV(I).GT.0.) THEN
+		       LWGT(I)=1
+		    ELSE
+		       LWGT(I)=3
+		    END IF
+		    LDIG(I)=JJ
+ 106	         CONTINUE
+   
+	      ENDIF
+	   ENDIF
+
+        ENDIF  ! openlev
+	END IF
+
+* Now that the levels are set, create the LEVELS symbols
+
+        CALL setlab_syms (ZLEV, MAX(NLEV2,1) )
+
+	RETURN
+ 5000   status = ferr_out_of_range
+        RETURN
+
+	END
diff --git a/ppl/tmapadds/set_num_linecolors.F b/ppl/tmapadds/set_num_linecolors.F
new file mode 100644
index 0000000..864bd77
--- /dev/null
+++ b/ppl/tmapadds/set_num_linecolors.F
@@ -0,0 +1,81 @@
+        SUBROUTINE SET_NUM_LINECOLORS 
+        
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  5/2006 ACM
+*  v6.00 Sets the number of line colors that will be allowed.
+* V602: *acm* 1/07 Changes for metafile-batch mode
+
+        IMPLICIT NONE
+	INCLUDE 'cmrd_inc.decl'
+        INCLUDE 'CMRD.INC'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'plt_inc.decl'
+        INCLUDE 'PLT.INC'
+        INCLUDE 'pen_inc.decl'
+        INCLUDE 'PEN.INC'
+        INCLUDE 'gkscm1_inc.decl'            
+        INCLUDE 'GKSCM1.INC'     
+        INCLUDE 'gkscm2.cmn'                   
+
+******************************************************************************
+
+        INTEGER no_plots_yet
+
+*	If no args, reset to default number of 6 colors
+	IF (m .EQ. 0) THEN
+           num_line_colors = 6
+
+*	Else set to value in P(1) 
+        ELSE IF (p(1) .GE. 6) THEN
+           num_line_colors = p(1)
+        ELSE 
+           num_line_colors = 6
+        ENDIF
+
+        no_plots_yet = 0
+        no_plots_yet = p(2)
+
+* For metafiles, setup line bundles here so we can 
+* save the color definitions.
+
+        IF ( gks_open .AND. no_plots_yet .EQ. 1 ) 
+     .      CALL WS_LINE_BUNDLES (wsid, wstype)
+
+        RETURN
+	END
+
+
diff --git a/ppl/tmapadds/set_one_color.F b/ppl/tmapadds/set_one_color.F
new file mode 100644
index 0000000..ed4c09b
--- /dev/null
+++ b/ppl/tmapadds/set_one_color.F
@@ -0,0 +1,123 @@
+        SUBROUTINE SET_ONE_COLOR
+        
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Sets the RGB values for a single color index
+*       J Davison JISAO/PMEL/TMAP 11.15.91
+*       *jd* 3.10.92 Brought over to Sun
+*	*jd* 1.14.94 Mod for background setting in xgks
+*       *js* 7.31.97 mod to change call to gqlwk to query_xgks_wkstn
+* V610  *acm* 3/08 Fixes for metafile batch mode
+*       *kms* 10/11 white is gks color 0 and black is gks color 1
+*             (opposite of XWindows).  Since gks colors are used
+*             in the graphics delegate, switch these values.
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+* PyFr *kms* 5/13 Add alpha channel (opaque), allow background color (0) to be set
+
+        IMPLICIT NONE
+#   ifndef atc_gks
+        include        'gkspar.inc'
+#   endif
+	include		'cmrd_inc.decl'
+        include         'CMRD.INC'
+	include		'gkscm1_inc.decl'
+        include         'GKSCM1.INC'
+	include		'gkscm2.cmn'
+	include         'parampl5_dat.decl'
+	include         'PARAMPL5.DAT'
+	include         'save_colors.cmn'
+        INCLUDE         'pen_inc.decl'  ! with num_line_colors
+        INCLUDE         'PEN.INC'
+
+	integer		ndx,i,err
+        integer         max_pline,max_pmark,max_text,max_fill_area
+        integer         max_pattern,max_color
+	real		val(4)
+
+	integer		type, error
+	REAL		rd, gr, bl
+
+
+******************************************************************************
+*	IF NO ARGS, RESET COLORS
+	if (m .eq. 0) then
+           call FGD_GQLWK (wstype,err,max_pline,max_pmark,
+     .              max_text,max_fill_area,max_pattern,max_color)
+	   if (err .ne. 0) goto 1000
+
+	   do 5 i = 0,num_line_colors
+	      call FGD_GQPCR(wstype,i,err,val(1),val(2),val(3),val(4))
+	      if (err .ne. 0) goto 5
+	      call FGD_GSCR(wsid,i,val(1),val(2),val(3),val(4))
+5	   continue
+	   goto 1000
+	end if
+
+
+
+*	ELSE SET COLOR P(1) to RGBA: P(2), P(3), P(4), P(5)
+*       where p(5) is optional (default 1.0)
+	if ( (m .lt. 4) .or. (m .gt. 5) ) goto 1000
+	
+	if (p(1) .ge. 0.0 .and. p(1) .le. 255) then
+	   ndx = ifix (p(1))
+	else
+	   goto 1000
+	end if
+
+        val(4) = 1.0
+	do 10 i = 1,m-1
+	   if (p(i+1) .ge. 0.0 .and. p(i+1) .le. 100.0) then
+	      val(i) = p(i+1)/100.0
+	   else
+	      goto 1000
+	   end if
+10	continue
+
+	CALL FGD_GSCR(wsid,ndx,val(1),val(2),val(3),val(4))
+*       color zero is always the color of the background for this window
+	if (ndx .eq. 0)
+     .     CALL FGD_REDRAW_BACKGROUND(wsid)
+
+ 1000   continue
+
+        call FGD_GUWK(wsid,gpostp)
+
+        return
+	end
+
+
diff --git a/ppl/tmapadds/set_open_levels.F b/ppl/tmapadds/set_open_levels.F
new file mode 100644
index 0000000..651923e
--- /dev/null
+++ b/ppl/tmapadds/set_open_levels.F
@@ -0,0 +1,452 @@
+      SUBROUTINE set_open_levels
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* V630  *acm* 9/09 Introduction of syntax for variance-based and histogram levels
+* V65 *acm   2/10 If Open-ended levels were used, symbol LEV_OPNLEVS saves 
+* the /LEV command needed to duplicate the levels
+* v663 *acm* 7/10 Fix bug where min value was not inside the lowest level.
+* v671 *acm* 6/11 For centered levels if there is (-inf) force (inf) and vice versa.
+* v673 *acm* 10/11 Fix cut-and-paste bug on first setting of nlev3.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+      IMPLICIT NONE
+      include 'parampl5_dat.decl'
+      include 'PARAMPL5.DAT'
+      include 'axis_inc.decl'
+      include 'AXIS.INC'
+      include 'plt_inc.decl'
+      include 'PLT.INC'
+      include 'miss_inc.decl'
+      include 'MISS.INC'
+      include 'hd_inc.decl'
+      include 'HD.INC'
+      include 'cont_inc.decl'
+      include 'CONT.INC'
+      include 'errmsg.parm'
+
+      LOGICAL         TM_FPEQ_SNGL
+      REAL    dz, fm, znp, zmp, dzf, znpf, zmpf, 
+     .        znpclo,zmpclo, dzc, dzclo, dzchi, 
+     .        twostd, density_factor, zlast, zmpchi, znpchi
+      INTEGER TM_LENSTR1, m, jj, nlevf, nlevc, nlev3, half_ncoarse, 
+     .        slen, llen, dlen, hlen, if1, if2, i, i1, i2, ilev, 
+     .        index, k, levcount
+
+      CHARACTER*10 TM_FMT_SNGL, lo_str, del_str, hi_str
+
+      EXTERNAL RANGE
+
+      IF (USE_HIST) THEN  ! compute levels based on histograms.
+        GOTO 3000
+      ENDIF
+
+! (approx) number of fine and coarse levels.
+
+      nlevf = 0.8* nlev
+      nlevc = MAX(0.1*FLOAT(nlev), 1.)
+
+      IF (centered) THEN
+
+	 twostd = 2.* zstd
+	 znp = -1*twostd
+	 zmp = twostd
+	 CALL RANGE(znp,zmp,nlevf,znpf,zmpf,dzf)  ! fine levels
+
+! Create centered fine levels surrounded by centered coarse levels.
+
+         density_factor = 4.
+         dzc = dzf* density_factor
+	 half_ncoarse = nlevc/2
+
+	 znpclo = lev_mean + znpf - dzc* half_ncoarse
+	 zmpclo = lev_mean + znpf
+	 znpchi = lev_mean + zmpf
+	 zmpchi = lev_mean + zmpf + dzc* half_ncoarse
+
+         IF (zmax .LT. znpclo  .OR.  zmin .GT. zmpchi) THEN
+
+	    zmp = 0.6* MAX( ABS(zmin), ABS(zmax) )
+	    znp = -1* zmp
+	    CALL RANGE(znp,zmp,nlevf,znpf,zmpf,dzf)  ! fine levels
+
+! Create centered fine levels surrounded by centered coarse levels.
+
+            density_factor = 4.
+            dzc = dzf* density_factor
+	    half_ncoarse = nlevc/2
+
+	    znpclo = lev_mean + znpf - dzc* half_ncoarse
+	    zmpclo = lev_mean + znpf
+	    znpchi = lev_mean + zmpf
+	    zmpchi = lev_mean + zmpf + dzc* half_ncoarse
+
+         ENDIF
+
+      ELSE  ! not centered
+
+         znp = zmean - zstd
+         zmp = zmean + zstd
+
+         CALL RANGE(znp,zmp,nlevf,znpf,zmpf,dzf)  ! fine levels
+
+         znp = zmean - 2.* zstd
+         zmp = zmean - zstd
+         IF (znp .LT. zmin) znp = zmin
+         IF (zmp .LT. zmin) zmp = znpf
+         CALL RANGE(znp,zmp,nlevc,znpclo,zmpclo,dzclo)  ! coarse levels
+
+         znp = zmean + zstd
+         zmp = zmean + 2.* zstd
+         IF (zmp .GT. zmax) zmp = zmpf
+         IF (znp .GT. zmax) znp = zmax
+         CALL RANGE(znp,zmp,nlevc,znpchi,zmpchi,dzchi)  ! coarse levels
+         dzc = (dzclo + dzchi)/ 2  ! are they always equal??
+
+      ENDIF  ! centered or not centered
+
+      lev_str = ' '
+      slen = 0
+
+c Set jj as in plotz based on fine levels.
+      
+      IF (zmpf-znpf .EQ. 0) then
+         jj = nsigc
+      ELSE
+         jj = nsigc - IFIX(ALOG10(ABS(zmpf-znpf)) + .5)
+      ENDIF 
+      IF (jj .LE. 0) jj= -1
+
+      ! -inf
+      IF (zmin .LT. znpclo) THEN
+         neginf = .TRUE.
+         ilev = 2
+	 lev_str = '(-inf)'
+	 slen = 6
+      ELSE 
+         ilev = 1
+      ENDIF
+
+      nlev2 =1 
+
+      nlev3 = NINT((zmpclo-znpclo)/ dzc) + 1
+      nlev2 = nlev2 + nlev3
+
+      do 101 i = 1, nlev3 
+
+         ldig(ilev) = -1
+         zlev(ilev) = znpclo + dzc* FLOAT(i-1)
+         IF (zlev(ilev) .GT. znpf) goto 102
+
+         ldig(ilev) = jj
+	 IF (centered) THEN
+	    ilev = ilev + 1
+         ELSE
+	    IF (zlev(ilev) .GT. zmax) GOTO 2000
+
+         IF (zlev(ilev)+ dzc* FLOAT(i) .GE. zmin) 
+     .	    ilev = ilev + 1
+         ENDIF
+
+ 101  CONTINUE 
+ 102  CONTINUE 
+
+      IF (neginf) THEN
+         zlev(1) = MIN( zlev(2), zmin-1. )
+         ldig(1) = ldig(2)
+      ENDIF
+
+      nlev3 = NINT((zmpf-znpf)/ dzf) + 1
+      nlev2 = nlev2 + nlev3
+
+      IF (zlev(ilev-1) .GT. znpf) ilev = ilev - 1
+      IF (ilev.GT.1 .AND. zlev(ilev-1).GT.znpf) ilev = ilev - 1
+
+      i1 = 1
+      IF (ilev .GT. 1) THEN
+         zlev(ilev) = znpf + dzf* FLOAT(i1-1)
+         DO WHILE ((zlev(ilev) .LT. zlev(ilev-1)) ) 
+	    i1 = 2
+	    zlev(ilev) = znpchi + dzc* FLOAT(i1-1)
+	 ENDDO
+      ENDIF 
+
+      IF (zlev(1) .GT. znpf) THEN
+	 ilev = 1
+	 i1 = 2
+      ENDIF
+
+      lo_str = TM_FMT_SNGL(znpclo, 3, 10, llen)
+      del_str = TM_FMT_SNGL(dzc, 3, 10, dlen)
+      IF (ilev .GT. 1) THEN
+         hi_str = TM_FMT_SNGL(zlev(ilev-1), 3, 10, hlen)
+      ELSE
+         hi_str = TM_FMT_SNGL(zlev(ilev), 3, 10, hlen)
+	 IF (zlev(ilev) .EQ. 0) hi_str = 
+     .         TM_FMT_SNGL(zlev(ilev-1), 3, 10, hlen)
+      ENDIF
+      lev_str = lev_str(:slen)//'('//lo_str(:llen)//
+     .          ','//hi_str(:hlen)//','//del_str(:dlen)//')'
+      slen = TM_LENSTR1(lev_str)
+      if1 = ilev
+
+      DO 103 i=i1,nlev3 
+
+         ldig(ilev) = -1
+         zlev(ilev) = znpf + dzf* FLOAT(i-1)
+         IF (zlev(ilev) .GT. znpchi) goto 104
+
+         ldig(ilev) = jj
+
+	 IF (centered) THEN
+	    ilev = ilev + 1
+         ELSE
+	    IF (zlev(ilev) .GT. zmax) GOTO 2000
+
+         IF (zlev(ilev)+ dzf* FLOAT(i) .GE. zmin) 
+     .	    ilev = ilev + 1
+         ENDIF
+
+ 103  CONTINUE 
+ 104  CONTINUE 
+
+* If min is still less than the lowest lev, add an open level
+* at the start of the list.
+
+      IF (zlev(1) .GT. zmin) THEN
+         neginf = .TRUE.
+	 DO i = ilev, 2, -1
+	    zlev(i) = zlev(i-1)
+	    ldig(i) = ldig(i-1)
+	 ENDDO
+	 
+         zlev(1) = zmin-1.
+	 ilev = ilev + 1
+      ENDIF
+      nlev3 = NINT((zmpchi-znpchi)/ dzc) + 1
+      nlev2 = nlev2 + nlev3
+
+      IF (zlev(ilev-1) .GT. znpchi) ilev = ilev - 1
+      IF (zlev(ilev-1) .GT. znpchi) ilev = ilev - 1
+
+      if2 = ilev
+      IF (centered) if2 = ilev-1
+      lo_str = TM_FMT_SNGL(zlev(if1), 3, 10, llen)
+      del_str = TM_FMT_SNGL(dzf, 3, 10, dlen)
+      hi_str = TM_FMT_SNGL(zlev(if2), 3, 10, hlen)
+      IF (zlev(if2) .EQ. 0.) hi_str = TM_FMT_SNGL(zlev(if2-1), 3, 10, hlen)
+      lev_str = lev_str(:slen)//'('//lo_str(:llen)//
+     .          ','//hi_str(:hlen)//','//del_str(:dlen)//')'
+      slen = TM_LENSTR1(lev_str)
+      if1 = ilev
+
+      i1 = 1
+      IF (ilev .GT. 1) THEN
+         zlev(ilev) = znpchi + dzc* FLOAT(i1-1)
+         DO WHILE ((zlev(ilev) .LT. zlev(ilev-1)) ) 
+	    i1 = 2
+	    zlev(ilev) = znpchi + dzc* FLOAT(i1-1)
+	 ENDDO
+      ENDIF 
+
+      DO 105 i=i1,nlev3 
+
+         ldig(ilev) = -1
+         zlev(ilev) = znpchi + dzc* FLOAT(i-1)
+         ldig(ilev) = jj
+
+	 IF (centered) THEN
+	    ilev = ilev + 1
+	 ELSE
+	    IF (zlev(ilev) .GT. zmax) GOTO 2000
+
+            IF (zlev(ilev)+ dzc* FLOAT(i) .GE. zmin) 
+     .	       ilev = ilev + 1
+         ENDIF
+
+ 105  CONTINUE 
+
+ 2000 CONTINUE
+
+      lo_str = TM_FMT_SNGL(zlev(if1), 3, 10, llen)
+      del_str = TM_FMT_SNGL(dzc, 3, 10, dlen)
+      hi_str = TM_FMT_SNGL(zlev(ilev-1), 3, 10, hlen)
+      IF (zlev(ilev-1) .EQ. 0) 
+     .          hi_str = TM_FMT_SNGL(zlev(ilev-2), 3, 10, hlen)
+      lev_str = lev_str(:slen)//'('//lo_str(:llen)//
+     .          ','//hi_str(:hlen)//','//del_str(:dlen)//')'
+      slen = TM_LENSTR1(lev_str)
+      if1 = ilev
+
+* If needed then add (inf)
+* If centered and there is (-inf) then add (inf)
+
+      nlev2 = ilev
+      IF ((zmax .GT. zmpchi) .OR. (centered .AND. neginf)) THEN
+         posinf = .TRUE.
+         zlev(nlev2) = MAX (zlev(nlev2-1)+1, zmax + 1. )
+	 lev_str = lev_str(:slen)//'(inf)'
+         slen = TM_LENSTR1(lev_str)
+      ELSE   
+         zlev(nlev2) = zmpchi
+      ENDIF
+
+      IF ((centered .AND. posinf) .AND.(.NOT.neginf)) THEN
+         neginf = .TRUE.
+	 DO 106 i = nlev2, 1, -1
+           ldig(i+1) = ldig(i)
+           zlev(i+1) = zlev(i)
+ 106     CONTINUE 
+	 nlev2 = nlev2 + 1
+	 zlev(1) =  MIN (zlev(1)-1, zmin - 1. )
+	 lev_str = '(-inf)'//lev_str(:slen)
+         slen = TM_LENSTR1(lev_str)
+      ENDIF
+
+      ldig(nlev2) = ldig(nlev2-1)
+
+      IF (centered .AND. (.NOT.posinf)) THEN
+         IF (zlev(nlev2) .EQ. zlev(nlev2-1)) THEN
+	    ilev = ilev - 1
+	    nlev2 = nlev2 - 1
+	 ENDIF
+      ENDIF
+
+* if centered and there is (inf) then add (-inf) if its not there.
+
+      IF ( (centered .AND. posinf) .AND. (.NOT.neginf) ) THEN
+         DO 107 i=ilev,1,-1
+            ldig(i+1) = ldig(i)
+            zlev(i+1) = zlev(i)
+ 107     CONTINUE 
+         ilev = ilev + 1
+	 nlev2 = ilev
+	 neginf = .TRUE.
+	 lev_str = '(-inf)'//lev_str(:slen)
+         slen = TM_LENSTR1(lev_str)
+      ENDIF
+
+* If a min or max was explicitly set, then chop off the 
+* levels with that setting.
+
+ 3000 CONTINUE
+      IF (set_min) THEN
+         neginf = .FALSE.
+         IF (lev_min .LT. zlev(1)) THEN
+            zlev(1) = lev_min
+         ELSE
+            index = 1
+            DO i = nlev2, 1, -1
+               IF (lev_min .LE. zlev(i)) index = i
+            ENDDO
+            IF (index .GT. 1) THEN
+               DO 108 i = index, nlev2
+                  zlev(i-index+1) = zlev(i)
+                  ldig(i-index+1) = ldig(i)
+ 108           CONTINUE 
+               nlev2 = nlev2-index+1
+            ENDIF
+         ENDIF
+      ENDIF
+
+      IF (set_max) THEN
+         posinf = .FALSE.
+         IF (lev_max .LT. zlev(nlev2)) THEN
+            zlev(nlev2) = lev_max
+         ELSE
+            index = nlev2
+            DO i = 1, nlev2
+                  IF (lev_max .GE. zlev(i)) index = i
+            ENDDO
+            IF (index .LT. nlev2) nlev2 = index
+         ENDIF
+      ENDIF
+
+* Remove duplicate levels
+      levcount = nlev2
+      zlast = zlev(1)
+      do 530 i = 2, nlev2 
+         IF ( TM_FPEQ_SNGL(zlev(i), zlast) .AND. i.LT.levcount ) THEN
+            do 520 k = i,levcount
+               zlev(k-1) = zlev(k)
+               ldig(k-1) = ldig(k)
+ 520        CONTINUE
+            levcount = levcount-1
+         ENDIF
+         zlast = zlev(i)
+ 530  CONTINUE
+      nlev2 = levcount
+
+* Finally, because of rounding when computing nlev3, when making centered 
+* levels there can still be different numbers of levels above and below 
+* zero. Force centered levels.
+
+      IF (centered) THEN
+         i1 = 1
+	 i2 = nlev2
+	 IF (neginf) i1 = 2
+	 IF (posinf) i2 = nlev2-1
+	 IF (.NOT. TM_FPEQ_SNGL(ABS(zlev(i1)), zlev(i2) ) ) THEN
+	    IF (ABS(zlev(i1)) .GT. zlev(i2)) THEN
+	       DO 109 i = nlev2+1, i2+1, -1
+	         zlev(i) = zlev(i-1)
+                 ldig(i) = ldig(i-1)
+ 109	       CONTINUE
+	       zlev(nlev2) = ABS(zlev(i1))
+               ldig(nlev2) = ldig(i1)
+	    ELSE
+	       DO 110 i = nlev2+1, i1, -1
+	         zlev(i) = zlev(i-1)
+                 ldig(i) = ldig(i-1)
+ 110	       CONTINUE
+	       zlev(nlev2) = -1.*zlev(i2)
+	       ldig(nlev2) = ldig(i2)
+
+	    ENDIF
+	    nlev2 = nlev2 + 1
+	 ENDIF
+      ENDIF
+
+* Set lwgt - as in lev.F
+      DO 111 i = 1, nlev2
+         IF (zlev(i).GT.0.) THEN
+            lwgt(i) = 1
+         ELSE
+            lwgt(i) = 3
+         ENDIF
+	 IF (TM_FPEQ_SNGL(zlev(i), 0.)) lwgt(i) = 2 
+ 111  CONTINUE
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/set_override_opacity.F b/ppl/tmapadds/set_override_opacity.F
new file mode 100644
index 0000000..ca8c86b
--- /dev/null
+++ b/ppl/tmapadds/set_override_opacity.F
@@ -0,0 +1,50 @@
+        SUBROUTINE SET_OVERRIDE_OPACITY(opaq_frac)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+        IMPLICIT NONE
+        INCLUDE 'shade_vars.cmn'
+
+        REAL*4 opaq_frac
+        INTEGER istat
+
+*     -1.0 means do not use the overriding opacity
+*     otherwise the opacity fraction must be in [0.0,1.0]
+        IF ( (opaq_frac .NE. -1.0) .AND. 
+     .       ((opaq_frac .LT. 0.0) .OR. (opaq_frac .GT. 1.0)) )
+     .     STOP 'Invalid opaq_frac given to SET_OVERRIDE_OPACITY'
+        overriding_alpha = opaq_frac
+        RETURN
+        END
diff --git a/ppl/tmapadds/set_pat_size.F b/ppl/tmapadds/set_pat_size.F
new file mode 100644
index 0000000..f8ff05b
--- /dev/null
+++ b/ppl/tmapadds/set_pat_size.F
@@ -0,0 +1,66 @@
+	SUBROUTINE SET_PAT_SIZE (wsid,xsize,ysize)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Sets the pattern size for patterned fill area calls -- needed
+*	to keep sizes appropriate to the output device. 
+
+*	XSIZE,YSIZE are x and y pattern size in pixels
+
+*	J Davison JISAO/PMEL/TMAP
+*	10.28.88
+
+        IMPLICIT NONE
+	real		window(4),vport(4),xres,yres
+        integer         wsid,error,xform,cols,rows,xsize,ysize
+
+********************************************************************************
+
+*	FIND OUT THE DEVICE "RESOLUTION" IN WORLD COORDS/PIXEL
+	call FGD_GQCNTN(error,xform)
+	call FGD_GQNT(xform,error,window,vport)
+
+	call FGD_GQPXAD(wsid,window(1),window(4),window(2),
+     .	window(3),error,cols,rows)
+
+	xres = abs((window(2) - window(1)))/real (cols)
+	yres = abs((window(4) - window(3)))/real (rows)
+
+*	SET PATTERN SIZE TO XSIZE BY YSIZE PIXELS
+	call gspa(real (xsize)*xres,real (ysize)*yres)
+
+	return
+	end
diff --git a/ppl/tmapadds/set_regular_plot.F b/ppl/tmapadds/set_regular_plot.F
new file mode 100644
index 0000000..283bcb9
--- /dev/null
+++ b/ppl/tmapadds/set_regular_plot.F
@@ -0,0 +1,50 @@
+	SUBROUTINE SET_REGULAR_PLOT
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Reset the plot type to 0. Called by disp_set_up.F
+* ACM 10/2005  for the fix to bug 1347.
+*               
+
+        IMPLICIT NONE
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+	INCLUDE 'hd_inc.decl'
+	INCLUDE 'HD.INC'
+
+	JTYPE=0
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/set_window_size.F b/ppl/tmapadds/set_window_size.F
new file mode 100644
index 0000000..54d97d6
--- /dev/null
+++ b/ppl/tmapadds/set_window_size.F
@@ -0,0 +1,70 @@
+        SUBROUTINE SET_WINDOW_SIZE (ws_id,xmin,xmax,ymin,ymax)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*      Routine to handle resizing windows -- uses GSWKVP for DEC GKS and 
+*      GUESC -5304 in ATC GKS.  ATC doesn't resize the window with GSWKVP.
+*      J Davison 3.24.92
+*      Mod 8.27.93 to handle XGKS resizing
+*      Mod 3.15.94 *jd* to call X event processing 
+*      *sh* 3.5.97 Mod to support metafile-only (no X) output through a
+*                cuckoo's egg implantation of meta_wsid in place of wsid
+*      *acm* 8/27/04 New returns from resize_xgks_window; pixx,pixy which are
+*                    the size of the window in pixels.  Save these in common 
+*                    gkscm2.cmn, so that in gif and batch modes we can return 
+*                    them in symbols PPL$XPIXEL and PPL$YPIXEL.
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+*
+
+        IMPLICIT NONE
+        INCLUDE 'gkspar.inc'
+        INCLUDE 'ws_types.cmn'
+        INCLUDE 'gkscm2.cmn'
+        INCLUDE 'fgrdel.cmn'
+
+        INTEGER ws_id
+        REAL*4  xmin, xmax, ymin, ymax
+
+*       set the window size
+        CALL FGD_GSWKVP(ws_id, xmin, xmax, ymin, ymax);
+*       pixx and pixy used for PPL$XPIXEL and PPL$YPIXEL
+        pixx = NINT((xmax - xmin) * windowdpix(ws_id) * 100.0 / 2.54);
+        pixy = NINT((ymax - ymin) * windowdpiy(ws_id) * 100.0 / 2.54);
+
+        RETURN
+        END
+
diff --git a/ppl/tmapadds/setax_syms.F b/ppl/tmapadds/setax_syms.F
new file mode 100644
index 0000000..42de576
--- /dev/null
+++ b/ppl/tmapadds/setax_syms.F
@@ -0,0 +1,77 @@
+      SUBROUTINE setax_syms(dir, axlo, axhi)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  v5.41  *acm* set XAXIS_MIN, XAXIS_MAX, YAXIS_MIN, YAXIS_MAX if 
+*               they have not already been set.  Called by setax.
+** v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+*  v552 *acm* 4/03 buff was too short a string
+*  v608 *acm* 10/07 Formatting very small numbers resulted in 0.
+*               (bug 1542). Use same formatting as in axis_end_syms.F
+
+      IMPLICIT NONE
+
+* Calling argument declarations
+      REAL axlo, axhi
+      CHARACTER*1 dir
+
+* Internal arguments
+
+      CHARACTER axval*255, ppl_buff*2048, buff*30
+      INTEGER TM_LENSTR1, nc, ier, ilen, ist
+
+      buff = dir//'AXIS_MIN'
+      CALL GETSYM(buff,axval,nc,ier)
+      IF (ier .EQ. 1) THEN
+         WRITE ( buff, '(1PG15.7)' ) axlo
+         ppl_buff = dir // 'AXIS_MIN '// buff
+         ier = 0
+         ist = 0
+         ilen = TM_LENSTR1(ppl_buff)
+         CALL SETSYM (ppl_buff, ilen, ier, ist)
+      ENDIF
+
+      buff = dir//'AXIS_MAX'
+      CALL GETSYM(buff,axval,nc,ier)
+      IF (ier .EQ. 1) THEN
+         WRITE ( buff, '(1PG15.7)' ) axhi
+         ppl_buff = dir // 'AXIS_MAX '// buff
+         ier = 0
+         ist = 0
+         ilen = TM_LENSTR1(ppl_buff)
+         CALL SETSYM (ppl_buff, ilen, ier, ist)
+      ENDIF
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/setfont.F b/ppl/tmapadds/setfont.F
new file mode 100644
index 0000000..950d91f
--- /dev/null
+++ b/ppl/tmapadds/setfont.F
@@ -0,0 +1,147 @@
+	SUBROUTINE SETFONT(fontdir,dirlen,dname,ifont,ii,kif,dnme,
+     .               ifn,dnum,itype,dtype,iflen, dlen,ioff,
+     .               icnt,ascii,base,rast,iadd,
+     .		     sx,sy,id)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Created 1.28.97 *kob*
+*
+*	Code in this routine taken from old pplmod_symbel.F routine.  This
+*	was necessary to reorganize the symbel routine to remove an illegal
+*	forward reference into a do loop.  This routine makes the 
+*	pplmod_symbel a little cleaner.  This change has 
+*	occurred in the middle of releasing v4.45 of 
+*	Ferret to the world.  Aix, Sgi, HP, OSF and SunOs
+*	have already been released, and this change is
+*	not a part of them.
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+
+        IMPLICIT NONE
+
+	DIMENSION SX(12000),SY(12000),ASCII(127,4),BASE(4),RAST(4)
+	DIMENSION DTYPE(35),DLEN(35),IOFF(4),IFLEN(4),ITYPE(4)
+C
+        REAL BASE, RAST
+        INTEGER IFONT, II, IADD, ID
+	LOGICAL SYMROT,READIR,PLOT,COLRF
+c	CHARACTER PLTFIL*80
+	CHARACTER ICOM*2,ICHR*1,STRING*120,DNME(35)*(*),DNUM(35)*(*)
+	CHARACTER DNAME(35)*(*),KIF(4)*(*),IFN(4)*(*)
+	CHARACTER*1 KSUB,KSUPER,KBKSP,KCALL,PENS(16)
+
+* 1/03 *kob* - Add temp character buffer for g77 arbitrary text
+*              concatenations
+	CHARACTER*2048 temp_charbuff
+
+#ifdef unix
+	INTEGER*2 SX,SY
+
+        integer       dirlen
+        character*255 fontdir
+#else
+	byte sx,sy
+#endif
+	INTEGER*2 ICNT,IBASE,IRAST
+*added for linux port
+	INTEGER*4 IBASE4,IRAST4 
+	INTEGER*2 ASCII
+	INTEGER*2 DTYPE,DLEN,IOFF,IFLEN,ITYPE
+	INTEGER COLOLD
+	LOGICAL ASCFNT
+        INTEGER IJ
+	INTEGER TM_LENSTR1, tlen
+C
+C
+	INCLUDE 'pltcom_dat.decl'
+	INCLUDE 'PLTCOM.DAT'
+
+
+#ifdef unix
+ 1010	continue
+* 1/03 *kob* 
+	temp_charbuff = DNAME(id)
+	OPEN(LUSY,FILE=fontdir(:dirlen)//'/'//temp_charbuff,STATUS='OLD',
+     *	FORM='UNFORMATTED',ERR=5000)
+#else
+1010	open(lusy,file=dname(id),status='old',readonly,
+     *	form='unformatted',err=5000)
+#endif
+C
+C	SETUP FOR NEW FONT
+C
+	IFONT=II
+	KIF(II)=DNME(ID)
+	IFN(II)=DNUM(ID)
+	ITYPE(II)=DTYPE(ID)
+	IFLEN(II)=DLEN(ID)
+C
+C	SETUP IOFF
+C
+	IF(II.EQ.4)GOTO 1008
+	DO 1007 IJ=II+1,4
+	IOFF(IJ)=12000
+	KIF(IJ)='@@'
+	IFN(IJ)='@@'
+1007	IFLEN(IJ)=0
+	IOFF(II+1)=IOFF(II)+IFLEN(II)
+C
+C	READ NEW FONT
+C
+ 1008	READ(LUSY,ERR=5010)ICNT,IBASE,IRAST
+	IBASE4 = IBASE
+	IRAST4 = IRAST
+	READ(LUSY,ERR=5010)(ASCII(IJ,II),IJ=1,127)
+	BASE(II)=FLOAT(IBASE4)
+	RAST(II)=21./FLOAT(IRAST4)
+	IADD=IOFF(II)+1
+	READ(LUSY,ERR=5010)(SX(IJ),IJ=IADD,IADD+DLEN(ID)-1)
+	READ(LUSY,ERR=5010)(SY(IJ),IJ=IADD,IADD+DLEN(ID)-1)
+	CLOSE(LUSY)
+	return
+
+ 5000	temp_charbuff = DNAME(ID)
+	tlen = TM_LENSTR1(temp_charbuff)
+	write(6,*) "setfont: Couldn't open font file:"//
+     .               fontdir(:dirlen)//'/'//temp_charbuff(:tlen)
+	stop
+ 5010	temp_charbuff = DNAME(ID)
+	tlen = TM_LENSTR1(temp_charbuff)
+	write(6,*) "setfont: Read error on font file:"//
+     .               fontdir(:dirlen)//'/'//temp_charbuff(:tlen)
+	stop
+	end
diff --git a/ppl/tmapadds/setlab_syms.F b/ppl/tmapadds/setlab_syms.F
new file mode 100644
index 0000000..3ed6922
--- /dev/null
+++ b/ppl/tmapadds/setlab_syms.F
@@ -0,0 +1,166 @@
+      SUBROUTINE setlab_syms (zlevels, nlevels)
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or 'bug fixes'.
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP 'AS IS' AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*  v5.5  *acm* 11/2002 New symbols to save levels
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+* V581 *acm* 3/05 fix bug 1205: If delta was set by user (with SHADE/LEV=.4d), then 
+*                 use the given delta rather than trying to compute it for LEV_DEL
+* V62 *acm*  5/08 Fix bug 1581. NLEV used is acutally one less
+* V65 *acm   2/10 If Open-ended levels were used, symbol LEV_OPNLEVS saves 
+* the /LEV command needed to duplicate the levels
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V686 *acm* 11/13 Allow symbol names to be up to 120 characters long
+
+*    LEV_MIN  - lowest level used on last CONTOUR, SHADE, or FILL call.
+*    LEV_MAX -  highest level used last
+*    LEV_DEL - either the value or 'irregular'
+*    LEV_NUM - Number of levels used
+*    LEV_ALL - ?? list of all the levels used
+
+*    (LEV_TEXT - full text string of last levels used, set in routine LEV.F)
+
+        IMPLICIT NONE
+	include 	'parampl5_dat.decl'
+	include 	'PARAMPL5.DAT'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+
+* Calling argument declarations
+
+      REAL zlevels(*)
+      INTEGER nlevels
+
+* Internal arguments
+
+      REAL zmax, zmin, dz, diff, diff_dz
+
+      CHARACTER ppl_buff*2048, TM_FMT_SNGL*10, buff*10, symbuff*120
+      INTEGER TM_LENSTR1, STR_SAME, i, ier, ilen, slen, ist
+      LOGICAL TM_FPEQ_SNGL, reglevs
+
+* Lowest and highest Z level
+
+      zmin = zlevels(1)
+      buff = TM_FMT_SNGL(zmin, -2, 10, slen)
+
+      ppl_buff = 'LEV_MIN '//buff
+      ilen = TM_LENSTR1(ppl_buff)
+      ier = 0
+      ist = 0
+      CALL SETSYM (ppl_buff, ilen, ier, ist)
+
+      zmax = zlevels(nlevels)
+      buff = TM_FMT_SNGL(zmax, -2, 10, slen)
+
+      ppl_buff = 'LEV_MAX '//buff
+      ilen = TM_LENSTR1(ppl_buff)
+      ier = 0
+      ist = 0
+      CALL SETSYM (ppl_buff, ilen, ier, ist)
+
+* Number of levels used 
+
+      zmax = MAX(nlevels-1,1)
+      buff = TM_FMT_SNGL(zmax, -2, 10, slen)
+
+      ppl_buff = 'LEV_NUM '//buff
+      ilen = TM_LENSTR1(ppl_buff)
+      ier = 0
+      ist = 0
+      CALL SETSYM (ppl_buff, ilen, ier, ist)
+      
+* If set_delta is .true. the delta value has been set
+* elsewhere. use the delta given.
+
+      IF (set_delta) THEN
+	 dz = delta
+         buff = TM_FMT_SNGL(dz, -2, 10, slen)
+
+* Otherwise, check if levels are regularly spaced 
+
+      ELSE
+         dz = zlevels(2) - zlevels(1)
+      
+         IF (nlevels .EQ. 1) THEN
+            buff = 'none'
+         ELSE IF (nlevels .EQ. 2) THEN
+            buff = TM_FMT_SNGL(dz, -2, 10, slen)
+         ELSE
+            reglevs = .TRUE.
+            DO 100 i=3,nlevels
+               diff = ABS( zlevels(i)-zlevels(i-1) )
+               diff_dz = ABS(diff - dz)
+               IF(TM_FPEQ_SNGL(diff_dz, dz)) reglevs=.FALSE.
+  100       CONTINUE
+            IF (reglevs) THEN
+               buff = TM_FMT_SNGL(dz, -2, 10, slen)
+            ELSE
+               buff = 'irregular'
+            ENDIF
+         ENDIF
+
+      ENDIF
+
+      ppl_buff = 'LEV_DEL '//buff
+      ilen = TM_LENSTR1(ppl_buff)
+      ier = 0
+      ist = 0
+      CALL SETSYM (ppl_buff, ilen, ier, ist)
+ 
+* If Open-ended levels were used, symbol LEV_OPNLEVS saves the /LEV 
+* command needed to duplicate the levels
+
+      symbuff = 'LEV_OPNLEVS'
+      CALL GETSYM( symbuff, ppl_buff, ist, ier )
+      IF ( ier .EQ. 0 ) THEN
+         IF (STR_SAME(lev_str, 'none') .EQ. 0 ) THEN 
+	    lev_str = ppl_buff
+	 ELSE
+            CALL DELSYM(symbuff,ier)
+	 ENDIF
+      ENDIF
+
+      IF (STR_SAME(lev_str, 'none') .NE. 0 ) THEN
+         ilen = TM_LENSTR1(lev_str)
+         ppl_buff = 'LEV_OPNLEVS '//lev_str
+         ilen = TM_LENSTR1(ppl_buff)
+         ier = 0
+         ist = 0
+         CALL SETSYM (ppl_buff, ilen, ier, ist)
+      ENDIF
+
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/setup_color_table.F b/ppl/tmapadds/setup_color_table.F
new file mode 100644
index 0000000..a125e76
--- /dev/null
+++ b/ppl/tmapadds/setup_color_table.F
@@ -0,0 +1,206 @@
+	SUBROUTINE SETUP_COLOR_TABLE (zwsid,ndx_lo,range)
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Sets the color map between ndx_lo and ndx_hi -- GKS FORTRAN binding
+*	J Davison JISAO/PMEL/TMAP 4.29.88/6.15.88
+
+*	Completely rewritten J Davison 7.27.89
+*	Mod JD 4.18.90 allowing only one shade level
+*       Mod JD 10.98 setup by percent, by_value, or by_level
+* V63  *acm* 10/09 Changes for gfortran build
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        IMPLICIT NONE
+        include         'parampl5_dat.decl'
+        include         'PARAMPL5.DAT'
+        include         'shade_vars.cmn'
+        include         'cont_inc.decl'
+        include         'CONT.INC'
+
+	integer	zwsid,ndx_lo,range,ndx,t_cl,cl_0
+	integer	ndx_hi,ndx_lop1,ndx_him1
+
+ 	real	del_lvl,lvl
+	real	r_inc,g_inc,b_inc,a_inc,r_val,g_val,b_val,a_val
+
+******************************************************************************
+	
+	if (rgb_mapping .eq. percent) then
+*          SMOOTHLY INTERPOLATE COLORS TO RANGE
+	   ndx_hi       = ndx_lo + range - 1
+	   ndx_lop1	= ndx_lo + 1
+	   ndx_him1	= ndx_hi - 1
+
+	   if (range .eq. 2) goto 100
+	   if (range .le. 1) goto 101
+	   cl_0	        = 1
+	   lvl	        = 0.0
+	   del_lvl	= 100.0/real (range - 1)
+
+*	   SET ALL COLORS IN SPECTRUM EXCEPT FIRST AND LAST
+
+	   do 50 ndx = ndx_lop1,ndx_him1
+	      lvl = lvl + del_lvl
+	   
+*	      LOCATE THIS LEVEL IN THE SPECIFIED SPECTRUM LEVELS
+	      do 10 t_cl = cl_0,ncl-1
+		 if (lvl .lt. slvl(t_cl+1)) then
+		    cl_0 = t_cl
+		    goto 20
+		 end if
+ 10	      end do
+
+*             FIND THE R,G,B,A VALUES TO SET THIS LEVEL
+ 20	      r_inc	= (sr(cl_0+1) - sr(cl_0))/(slvl(cl_0+1) - slvl(cl_0))
+	      g_inc	= (sg(cl_0+1) - sg(cl_0))/(slvl(cl_0+1) - slvl(cl_0))
+	      b_inc	= (sb(cl_0+1) - sb(cl_0))/(slvl(cl_0+1) - slvl(cl_0))
+	      a_inc	= (sa(cl_0+1) - sa(cl_0))/(slvl(cl_0+1) - slvl(cl_0))
+	      
+	      r_val	= sr(cl_0) + r_inc*(lvl - slvl(cl_0))
+	      g_val	= sg(cl_0) + g_inc*(lvl - slvl(cl_0))
+	      b_val	= sb(cl_0) + b_inc*(lvl - slvl(cl_0))
+	      a_val	= sa(cl_0) + a_inc*(lvl - slvl(cl_0))
+
+*             NOW SET THE COLOR OF THIS INDEX/LEVEL
+              IF ( overriding_alpha .GE. 0.0 ) a_val = overriding_alpha
+	      call FGD_GSCR(zwsid,ndx,r_val,g_val,b_val,a_val)
+ 50	   end do
+
+*	   SET R,G,B,A FOR FIRST AND LAST LEVELS
+ 100       IF ( overriding_alpha .GE. 0.0 ) THEN
+              call FGD_GSCR(zwsid,ndx_hi,sr(ncl),sg(ncl),sb(ncl),overriding_alpha)
+           ELSE
+              call FGD_GSCR(zwsid,ndx_hi,sr(ncl),sg(ncl),sb(ncl),sa(ncl))
+           ENDIF
+ 101       IF ( overriding_alpha .GE. 0.0 ) THEN
+              call FGD_GSCR(zwsid,ndx_lo,sr(1),sg(1),sb(1),overriding_alpha)
+           ELSE
+              call FGD_GSCR(zwsid,ndx_lo,sr(1),sg(1),sb(1),sa(1))
+           ENDIF
+
+	else if (rgb_mapping .eq. by_value) then
+	   if (ncl .eq. 0) then
+	      ncl = 2
+	      slvl(1) = zlev(1)
+	      slvl(2) = zlev(nlev2)
+	   end if
+
+*          SMOOTHLY INTERPOLATE COLORS TO RANGE
+	   ndx_hi       = ndx_lo + range - 1
+	   ndx_lop1	= ndx_lo + 1
+	   ndx_him1	= ndx_hi - 1
+
+	   if (range .eq. 2) goto 200
+	   if (range .le. 1) goto 201
+	   cl_0	        = 1
+
+*	   SET ALL COLORS IN SPECTRUM EXCEPT FIRST AND LAST
+	   do 150 ndx = ndx_lo,ndx_hi
+	      lvl = zlev(ndx - ndx_lo + 1)
+	   
+*	      LOCATE THIS LEVEL IN THE SPECIFIED SPECTRUM LEVELS
+	      if (lvl .lt. slvl(1)) then
+                 IF ( overriding_alpha .GE. 0.0 ) THEN
+                    call FGD_GSCR(zwsid,ndx,sr(1),sg(1),sb(1),overriding_alpha)
+                 ELSE
+                    call FGD_GSCR(zwsid,ndx,sr(1),sg(1),sb(1),sa(1))
+                 ENDIF
+	      else if  (lvl .ge. slvl(ncl)) then
+                 IF ( overriding_alpha .GE. 0.0 ) THEN
+                    call FGD_GSCR(zwsid,ndx,sr(ncl),sg(ncl),sb(ncl),overriding_alpha)
+                 ELSE
+                    call FGD_GSCR(zwsid,ndx,sr(ncl),sg(ncl),sb(ncl),sa(ncl))
+                 ENDIF
+	      else
+		 do 110 t_cl = cl_0,ncl-1
+		    if (lvl .lt. slvl(t_cl+1)) then
+		       cl_0 = t_cl
+		       goto 120
+		    end if
+ 110		 end do
+
+*                FIND THE R,G,B VALUES TO SET THIS LEVEL
+ 120		 r_inc	= (sr(cl_0+1) - sr(cl_0))
+     .  	      /(slvl(cl_0+1) - slvl(cl_0))
+
+		 g_inc	= (sg(cl_0+1) - sg(cl_0))
+     .  	      /(slvl(cl_0+1) - slvl(cl_0))
+
+		 b_inc	= (sb(cl_0+1) - sb(cl_0))
+     .  	      /(slvl(cl_0+1) - slvl(cl_0))
+		 
+		 a_inc	= (sa(cl_0+1) - sa(cl_0))
+     .  	      /(slvl(cl_0+1) - slvl(cl_0))
+		 
+		 r_val	= sr(cl_0) + r_inc*(lvl - slvl(cl_0))
+		 g_val	= sg(cl_0) + g_inc*(lvl - slvl(cl_0))
+		 b_val	= sb(cl_0) + b_inc*(lvl - slvl(cl_0))
+		 a_val	= sa(cl_0) + a_inc*(lvl - slvl(cl_0))
+
+*                NOW SET THE COLOR OF THIS INDEX/LEVEL
+                 IF ( overriding_alpha .GE. 0.0 ) a_val = overriding_alpha
+		 call FGD_GSCR(zwsid,ndx,r_val,g_val,b_val,a_val)
+	      end if
+ 150	   end do
+
+	   goto 2000
+
+*	   SET R,G,B FOR FIRST AND LAST LEVELS
+ 200       IF ( overriding_alpha .GE. 0.0 ) THEN
+              call FGD_GSCR(zwsid,ndx_hi,sr(ncl),sg(ncl),sb(ncl),overriding_alpha)
+           ELSE
+              call FGD_GSCR(zwsid,ndx_hi,sr(ncl),sg(ncl),sb(ncl),sa(ncl))
+           ENDIF
+ 201       IF ( overriding_alpha .GE. 0.0 ) THEN
+              call FGD_GSCR(zwsid,ndx_lo,sr(1),sg(1),sb(1),overriding_alpha)
+           ELSE
+              call FGD_GSCR(zwsid,ndx_lo,sr(1),sg(1),sb(1),sa(1))
+           ENDIF
+
+	else if (rgb_mapping .eq. by_level) then
+*	   ATOMIC COLORS -- AS MANY COLORS AS SET IN COLOR PALETTE
+	   do 1000 ndx = ndx_lo, ndx_lo + ncl - 1
+	      r_val = sr(ndx - ndx_lo + 1)    
+	      g_val = sg(ndx - ndx_lo + 1)    
+	      b_val = sb(ndx - ndx_lo + 1)    
+	      a_val = sa(ndx - ndx_lo + 1)    
+
+              IF ( overriding_alpha .GE. 0.0 ) a_val = overriding_alpha
+	      call FGD_GSCR(zwsid,ndx,r_val,g_val,b_val,a_val)
+ 1000	   end do
+	end if
+
+ 2000	return
+	end
diff --git a/ppl/tmapadds/setup_defaults.F b/ppl/tmapadds/setup_defaults.F
new file mode 100644
index 0000000..54c3ba7
--- /dev/null
+++ b/ppl/tmapadds/setup_defaults.F
@@ -0,0 +1,213 @@
+        SUBROUTINE SETUP_DEFAULTS
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*       Sets ppl+ defaults & the options for SHADE for initial calls 
+*       J Davison JISAO/PMEL/TMAP 8.24.88/7.27.89
+*	*jd* 2.11.92 Initialize item_* variables here
+*	*jd* 5.28.92 Inititalize sqfill to on for AREA command
+*	*jd* Use area bundles for DEC , but not for ATC -- too few available
+* 	*jd* Set default values for CENTERED & SET_DELTA in CONT.INC 8.15.95
+*       *jd* Set default values for patterns 10.98
+*       *jd* Initialize rgb_mapping 10.98
+* 3/99 *kob* 	move var init off of decl list  - cleaning up after jerry.
+* V552 5/03 *acm* Move shade key setup to routine SHADE_KEY
+* V553 6/03 *acm* Keep the initialization of do_key here.
+* V65 *acm   2/10 If Open-ended levels were used, symbol LEV_OPNLEVS saves 
+* the /LEV command needed to duplicate the levels
+* PyFr *kms* 5/13 Add alpha channel (opaque) variables SA
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+        include         'parampl5_dat.decl'
+        include         'PARAMPL5.DAT'
+        include         'axis_inc.decl'
+        include         'AXIS.INC'
+        include         'plt_inc.decl'
+        include         'PLT.INC'
+        include         'gkscm2.cmn'
+        include         'ARFILL.INC'
+        include         'cont_inc.decl'
+        INCLUDE         'CONT.INC'
+
+	real		rem
+	external	ws_types_init,pplp_ver_data
+
+        integer         i,solid
+        DATA            solid/21/
+        integer         set_default_patterns(20)
+        DATA            set_default_patterns
+     .          /1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20/
+
+        character*25    set_pattern_list(21)
+        DATA            set_pattern_list
+     . /'TINY_TRIANGLES', 
+     .  'TINY_GRID',
+     .  'TINY_OPEN_SQUARES',
+     .	'TINY_SQUARES',
+     .	'LITE_HORIZONTAL',
+     .	'LITE_VERTICAL',
+     .	'DARK_HORIZONTAL',
+     .	'DARK_VERTICAL',
+     .	'DARK_UP_LEFT_TO_RIGHT',
+     .	'LITE_UP_LEFT_TO_RIGHT',
+     .	'DARK_UP_RIGHT_TO_LEFT',
+     .	'LITE_UP_RIGHT_TO_LEFT',
+     .	'LARGE_GRID',
+     .	'ANGLED_GRID',
+     .	'DOUBLE_VERTICAL',
+     .	'DOUBLE_HORIZONTAL',
+     .	'BALL_BEARINGS',
+     .	'WEAVE',
+     .	'FISH_SCALE',
+     .	'BRICK',
+     .  'SOLID'/
+
+******************************************************************************
+
+*	INITIALIZE WS/METAFILE THINGS
+	ws_lun  = 111
+	ws_file = 'ppl_port'
+
+	tmp_wsid = 102
+	tmp_lun  = 17
+	tmp_file = 'meta.tmp'
+
+	vpt_was_set = .false.
+
+	item_gclrwk    = 101
+	item_ws_xform  = 102
+	item_ndx_range = 103
+	item_spectrum  = 104
+	item_protect   = 105
+	item_fill_ndx  = 106
+	item_pplpver   = 107
+
+	bad_val = 1
+
+*	SHADE DEFAULT COLORS
+	ncl = 6
+	custom_colors = .true.
+*#ifdef atc_gks
+	area_bundles  = .false.
+*#else
+*	area_bundles  = .true.
+*#endif
+	mncl = 0
+
+*       RGB MAPPING PARAMETERS
+        percent  = 0
+        by_value = 1
+        by_level = 2
+
+        rgb_mapping = percent
+
+	slvl(1) = 0.0
+	sr(1) = 0.8
+	sg(1) = 0.0
+	sb(1) = 1.0
+	sa(1) = 1.0
+
+	slvl(2) = 10.0
+	sr(2) = 0.3
+	sg(2) = 0.2
+	sb(2) = 1.0
+	sa(2) = 1.0
+
+	slvl(3) = 33.0
+	sr(3) = 0.0
+	sg(3) = 0.6
+	sb(3) = 0.3
+	sa(3) = 1.0
+
+	slvl(4) = 66.0
+	sr(4) = 1.0
+	sg(4) = 1.0
+	sb(4) = 0.0
+	sa(4) = 1.0
+
+	slvl(5) = 90.0
+	sr(5) = 1.0
+	sg(5) = 0.0
+	sb(5) = 0.0
+	sa(5) = 1.0
+
+	slvl(6) = 100.0
+	sr(6) = 0.6
+	sg(6) = 0.0
+	sb(6) = 0.0
+	sa(6) = 1.0
+
+* negative overriding_alpha means not activated
+        overriding_alpha = -1.0;
+
+*       DO THE KEY --- move most of this setup to routine SHADE_KEY; values
+*       need to be initialized with each call.
+
+	do_key	     	= .true.
+
+*	when open-ended levels; create the /LEV command needed to 
+*	duplicate them.
+
+	lev_str = 'none'
+
+*	INITIALIZE SQFFLG TO TRUE
+	sqfflg = .true.
+
+*       INITIALIZE DRAFTSMAN AND SPLINE_TENSION
+        draftsman=.false.
+        spline_tension=0.
+
+*	INITIALIZE CONT.INC ADD ONS
+	centered  = .false.
+	set_delta = .false.
+
+*       DEFAULTS FOR PATTERN SUPPORT
+        do 10 i = 1, 20
+           default_patterns(i) = set_default_patterns(i)
+           pattern_list(i) = set_pattern_list(i)
+ 10     end do
+
+*       DEFAULT PATTERN IS SOLID ("pattern" 21)
+        npat = 1
+        patterns(1) = solid
+        pattern_list(solid) = set_pattern_list(solid)
+
+	return
+	end
+
+
+
+
diff --git a/ppl/tmapadds/shade.F b/ppl/tmapadds/shade.F
new file mode 100644
index 0000000..cf548f7
--- /dev/null
+++ b/ppl/tmapadds/shade.F
@@ -0,0 +1,183 @@
+	SUBROUTINE SHADE (z, cells)
+
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Modified of PLOTZ to get data into proper grids for 
+*	SHADE command
+
+*	J Davison 8.26.88
+*
+*	Mod JD 4.18.90 to allow data all of the same value to be shaded. 
+*       MOD *JD* To permit use of centered levels and specify the delta Z
+*       value as well.  Added variables to CONT.INC common 8.3.95  
+*	   *jd 8.28 fix bug in dz specification
+*	*jd* 2.96 Change centered option so that data not spanning zero
+*			is centered as well.
+*	*jd* 5.96 Fix bug where if shade/lev=N option is used with constant 
+*	field, no shade results
+*       *jd* 1.98 Fix bug: shade misses top level, when top level is lt 0.
+* V510 4/00 *sh - corrected faulty logic for centered levels (delta wrong)
+* V550 11/02*acm* To use cellarray calls for rectangular shade plots, pass 
+*                 cells in as a work array.  Remove VAX includes
+* V550 12/02*acm* After levels are set, call setlab_syms to create the LEVELS symbols
+* V552  3/03*acm* Check for too many levels, as is done for FILL and CONTOUR plots.
+* v552  6/03*acm* Rename the array used for cellarray call.
+* v554  3/04*acm* In the section marked correction for rounding errors, under g77 
+*                 on linux this incorrectly uses low-order bits to reset NLEV2
+* v570  4/04*acm* The fix above went too far.  Use TM_FPEQ to see if
+*                 values are equal or close.  Also fixes this adjustment
+*                 when the range has negative values; was always incorrect.
+* v580  8/04*acm* Fix bug 957 shade/lev=1 of a constant field needs zlev(1) to be set.
+* v581  4/05*acm* For cellarray plots JTYPE had erroneously been set to 1 (?!)
+* v581 *acm* 3/05 open levels (-INF) (INF)
+* v611 *acm* 4/08 Fix bug 1567: Set jj as in PLOTZ so SHADE/LINE gets labels with 
+*                 enough precision
+* v68  *acm* 4/08 Allow shade, vector plots of degenerate regions - world region 
+*              within a grid cell
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+
+        IMPLICIT NONE
+	include		'parampl5_dat.decl'
+	include		'PARAMPL5.DAT'
+
+	include		'axis_inc.decl'
+	include		'AXIS.INC'
+	include		'plt_inc.decl'
+	include		'PLT.INC'
+	include		'miss_inc.decl'
+	include		'MISS.INC'
+	include		'hd_inc.decl'
+	include		'HD.INC'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+	include		'zgrid_inc.decl'
+	include		'ZGRID.INC'
+	include		'zgridd_inc.decl'
+	include		'ZGRIDD.INC'
+        include         'errmsg.parm'
+        include         'shade_vars.cmn'
+
+	real		dx,dy,dz,z(nx,ny),znp,zmp
+
+	integer		status, i, ii, j, cells(*), slen1, slen2
+        CHARACTER       TM_FMT_SNGL*20, buff1*20, buff2*20, err_msg*40
+        REAL             epsilon
+        parameter       (epsilon = 1e-6)
+
+C       Add external stmt for linux port *jd* 12.96 RANGE is intrinsic fcn
+        external range
+
+******************************************************************************
+
+C
+C  Set the contour/color levels
+
+        CALL SET_LEVELS_SHADE_FILL (status)
+	IF (status .NE. ferr_ok) GOTO 5000
+
+C       DRAW
+C
+C       from ppl/include/PPL.INC:
+C
+C       JTYPE: = 2 2-d irregular rectangular grid
+C              = 1 1-d set
+C              = 0 2-d regular rectangular grid (integer)
+C              =-1 2-d second component of a vector regular grid
+C              =-2 2-d second component of a vector irregular grid
+C
+
+C  WHY HAD JTYPE BEEN SET TO 1 HERE??!! 
+
+c        IF (use_cell) JTYPE = 1
+        IF (use_cell) JTYPE = 0
+
+C       If it's a 2-d irregular grid, the irregular grid values
+C       are also stored in the Z array.  Pass them to shade_sub.
+	
+	IF (JTYPE.EQ.2 .OR. JTYPE.EQ.-2) THEN
+
+	   CALL SHADE_SUB(Z,Z(1,NY+1),Z(1,NY+2),XX(IZSE-NX-1),
+     .        YY(IZSE-NY-1), cells)
+
+C       For all other plot types fill in XX() and YY() by
+C       multiplying the index value by the DX or DY delta values.
+
+	ELSE
+
+	   IF (NX .EQ. 1) THEN
+              DX = 1.
+           ELSE
+	      DX = (XMAX - XMIN)/(NX - 1)
+           ENDIF
+	   IF (NY .EQ. 1) THEN
+              DY = 1.
+           ELSE
+	      DY = (YMAX - YMIN)/(NY - 1)
+           ENDIF
+
+	   DO 500 I=1,NX
+	      XX(IZLEN+I)=DX*(I-1)+XMIN
+ 500	   CONTINUE
+	   DO 510 J=1,NY
+	      YY(IZLEN+J)=DY*(J-1)+YMIN
+ 510	   CONTINUE
+
+c *kob* 8/97 had to move the continuation marker to col 5 - it was in col 8
+c       this bombed aix compiler, though it seems to work on others
+	   CALL SHADE_SUB(Z,XX(IZLEN+1),YY(IZLEN+1),XX(IZLEN+NX+1),
+     1	       YY(IZLEN+NY+1), cells)
+
+	ENDIF
+
+	RETURN
+
+C  Error exit when too many levels specified.
+C  Arrays LWGT, LDIG, and ZLEV are length ICNLEV=500
+
+ 5000   ii = ICNLEV
+        buff1 = TM_FMT_SNGL (REAL(ICNLEV), 20, 20, slen1)
+        buff2 = TM_FMT_SNGL (REAL(NLEV2), 20, 20, slen2)
+        err_msg = '# of shade levels > '// buff1(1:slen1) //
+     .          '  (' // buff2(1:slen2) // ')'
+        CALL errmsg (ferr_out_of_range, status, err_msg, *5002)
+ 5002   RETURN
+	END
+
+
+
+
diff --git a/ppl/tmapadds/shade_cell.F b/ppl/tmapadds/shade_cell.F
new file mode 100644
index 0000000..a35fd55
--- /dev/null
+++ b/ppl/tmapadds/shade_cell.F
@@ -0,0 +1,57 @@
+        SUBROUTINE SHADE_CELL (flag)
+        
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Sets the flag to use CELLARRAY plot -- determined in disp_set_up
+*       called on the Ferret side from xeq_shade.
+*       ACM  5/03
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+
+        INTEGER flag
+
+*******************************************************************************
+
+*       default is no cellarray call.
+
+	use_cell	= .FALSE.
+
+	IF  (m .GE. 1 .AND. p(1) .EQ. 1.)  use_cell = .TRUE.
+	RETURN
+	END
diff --git a/ppl/tmapadds/shade_fill_it.F b/ppl/tmapadds/shade_fill_it.F
new file mode 100644
index 0000000..cfa8b9e
--- /dev/null
+++ b/ppl/tmapadds/shade_fill_it.F
@@ -0,0 +1,245 @@
+      SUBROUTINE SHADE_FILL_IT (data, nxdim, nydim, px, py, xs, ys, 
+     .                          xinv, yinv, xadd, lmin, lmax, 
+     .                          ilo, ihi, jlo, jhi, maxpt_ov2, status)
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+* 2/23/2005 acm
+* Do the fill for a shade plot, perhaps with a modulo offset in X
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V687 *acm* 3/14 tickets 2151 and 2147: allow missing coordinate data in 3-arg 
+*                 and 4-arg plot commands. 
+
+       IMPLICIT NONE
+       INCLUDE 'miss_inc.decl'
+       INCLUDE 'MISS.INC'
+       INCLUDE 'parampl5_dat.decl'
+       INCLUDE 'PARAMPL5.DAT'
+       INCLUDE 'hd_inc.decl'
+       INCLUDE 'HD.INC'
+       INCLUDE 'ferret.parm'
+       INCLUDE 	'xinterrupt.cmn'	! 1/89 *sh*
+       INCLUDE 'errmsg.parm'
+       INCLUDE 'xcurvilinear.cmn'
+
+       INTEGER nxdim, nydim, ilo, ihi, jlo, jhi, maxpt_ov2, status
+       REAL    data(nxdim,nydim), px(*), py(*), xs(*), ys(*), 
+     .         lmin, lmax, xinv, yinv, xadd
+
+* local definitions
+
+      REAL    minrowx, maxrowx, big
+      INTEGER GET_NDX, i, j,i1, fill_ndx, npt, pt1, next_ndx,
+     .        itop, jtop
+      REAL    ddat
+      INTEGER nothing
+      LOGICAL BAD_XY_COORD, first, xfield_is_modulo
+      CHARACTER*128 buff
+
+#ifdef double_p
+      real*8 x_curv(200), y_curv(200)
+#else
+      real x_curv(200), y_curv(200)
+#endif
+
+      big = ABS(CMZGE)
+
+      status = ferr_ok
+      lmin = -1*big
+      lmax = big
+
+
+*  check for consistency: data range 1:ny, index range jlo:jhi  
+*  If inconsistent, use whole Y range given by ny
+
+      IF (curvilinear) THEN
+         IF (jlo .LT. 1 .OR. jhi .GT. ny+1) THEN  
+            jlo = 1
+            jtop = ny
+         ELSE
+            jtop = jhi 
+            IF (jhi .EQ. ny+1) jtop = ny
+         ENDIF
+      ELSE
+         jlo = 1
+         jtop = ny
+      ENDIF
+
+*  Likewise for X, if this is not an x modulo plot
+
+      IF (curvilinear .AND. (.NOT. xmodulo) ) THEN
+c      IF (curvilinear ) THEN
+         IF (ilo .LT. 1 .OR. ihi .GT. nx+1) THEN  
+            ilo = 1
+            itop = nx
+         ELSE
+            itop = ihi 
+            IF (ihi .EQ. nx+1) itop = nx
+         ENDIF
+      ELSE
+         ilo = 1
+         itop = nx
+      ENDIF
+
+*	LAY FILL DOWN ON SCREEN IN PROPER PLACE
+
+        first = .TRUE.  ! for curvilinear curv_coord_add_sub
+	DO 50 j = jlo, jtop
+
+! initialize these so that the check in BAD_XY_COORD doesn't get caught
+! in a loop
+           py(1) = ys(j)
+           py(2) = ys(j+1)
+           py(3) = ys(j+1)
+           py(4) = ys(j)
+
+* ... initialize for outer DO...WHILE loop
+	   i = 0
+
+           minrowx = big
+           maxrowx = -1.*big
+
+
+* ... outer: DO WHILE i LE itop ...
+40	   i = i + 1					! To line 50 JD 5.16.90
+	   IF (i .EQ. itop+1) GOTO 49
+
+	   IF ( interrupted ) GOTO 3333			! 1/89 - *sh*
+
+* ... initialize for inner DO...WHILE loop
+	   IF (.NOT.curvilinear) THEN
+* ... note that for curvilinear plots the screening of coordinates is NOT
+*	applied. This represents a minor bug/feature since the user might
+*	expect the PLOT+ limits command still to apply.
+*	(It was just too much trouble for the potential benefit *sh*)
+	      IF (BAD_XY_COORD(i,j,xs,py,fill_ndx)) GOTO 40
+	   ENDIF
+	   ddat = data(i,j)
+	   fill_ndx = GET_NDX (data(i,j),fill_ndx)
+	   IF (fill_ndx .EQ. -999) GOTO 40
+	   pt1 = i
+	   npt = 1
+
+* ... inner: DO WHILE fill_ndx remains unchanged ...
+* ... find the largest box from this row that is all this color (optimization)
+* ... Note: further optimization is possible (especially for very noisy fields)
+*	    for curvilinear plots. Since each polygon "tube" shares 2 vertices
+*	    with the one that preceded it on the row, we are unnecessarily
+*	    computing the curvilinear position of these points TWICE in calls
+*	    to CURV_COORD
+45	      i = i + 1
+	      IF (i .EQ. itop+1) GOTO 48
+	      IF ( curvilinear ) THEN
+	         npt = i + 1
+	         IF ( npt .GE. maxpt_ov2 ) GOTO 48
+	      ENDIF
+
+              next_ndx = GET_NDX (data(i,j),next_ndx)
+	      IF (.NOT.curvilinear) THEN
+	         IF (BAD_XY_COORD(i,j,xs,py,fill_ndx)) GOTO 48
+	      ENDIF
+              IF (curvilinear) GOTO 48  ! each cell on its own.
+	      IF (fill_ndx .EQ. next_ndx) GOTO 45
+* ... inner: end loop
+
+* found last cell in chain - now assign the vertices of the polygon
+48	   IF ( curvilinear ) THEN
+* ... after transformation this will be a curvy "tube" of one color
+	      npt = i - pt1 + 1
+* ... polygon chain begins along upper edge of row of cells
+	      DO 51 i1 = 1, npt
+	         x_curv(i1) = xs(pt1+i1-1)
+	         y_curv(i1) = ys(j+1)
+ 51	      CONTINUE
+* ... and returns (closes) along lower edge of row of cells
+	      DO 52 i1 = npt+1, 2*npt
+	         x_curv(i1) = x_curv(2*npt+1-i1)
+	         y_curv(i1) = ys(j)
+ 52	      CONTINUE
+	      npt = 2*npt
+	      CALL CURV_COORD_ADD (x_curv, y_curv, npt, xinv, yinv, xadd,
+     .            first, xfield_is_modulo, status) ! xform the pts
+	      IF (curv_missing) THEN
+	         i = i - 1
+		 GOTO 40
+              ENDIF
+	      
+	      IF ( status .NE. 0 ) RETURN
+              minrowx = MIN( minrowx, x_curv(1) )
+              minrowx = MIN( minrowx, x_curv(2) )
+              maxrowx = MAX( maxrowx, x_curv(1) )
+              maxrowx = MAX( maxrowx, x_curv(2) )
+
+	      DO 522 i1 = 1, npt
+		 px(i1) = x_curv(i1)
+		 py(i1) = y_curv(i1)
+ 522	      CONTINUE
+	   ELSE
+* ... always a rectangle -- just save the corners
+	      px(1) = xs(pt1)
+	      px(2) = xs(pt1)
+	      px(3) = xs(i)
+	      px(4) = xs(i)
+	      py(1) = ys(j)
+	      py(2) = ys(j+1)
+	      py(3) = ys(j+1)
+	      py(4) = ys(j)
+	      npt = 4
+	   ENDIF
+	   pt1 = i	! index of left edge of first cell of next color
+	   i = i - 1
+
+	   CALL set_fill_ndx (fill_ndx)
+	   CALL FGD_GFA(npt,px,py)
+
+	   GOTO 40
+
+* For each y, what is the max and min x coordinate value covered
+* by all the rows and columns?
+* We want to save the minimum of the high coords for each row,
+* and the maximum of the low coords for each row 
+
+49         IF (minrowx .LT. big) lmin = MAX(lmin, minrowx)
+           IF (maxrowx .GT. -1.*big) lmax = MIN(lmax, maxrowx)
+
+50	CONTINUE
+
+        RETURN
+
+3333    status = ferr_interrupt
+        RETURN
+
+* error exit
+ 5000	RETURN
+	END 
diff --git a/ppl/tmapadds/shade_key.F b/ppl/tmapadds/shade_key.F
new file mode 100644
index 0000000..f4c9edd
--- /dev/null
+++ b/ppl/tmapadds/shade_key.F
@@ -0,0 +1,143 @@
+        SUBROUTINE SHADE_KEY
+        
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Sets the options for SHADE key -- size,location,etc
+*       J Davison JISAO/PMEL/TMAP 8.24.88
+* v541 *acm*  5/02 add option to control outline on the shade key boxes
+*                  also remove VMS INCLUDES
+
+* 552 *acm* 4/03 Shade key improvements: Do not have to set all four corners 
+*           when changing the size and location of the shade key -- can 
+*           reset any of the four, and others will be filled in by making 
+*           the key the default size in that direction.  See key.F
+* v581 *acm* 3/05 put flag cont_key into common CONT.INC
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+        include         'axis_inc.decl'
+        include         'AXIS.INC'
+        include         'plt_inc.decl'
+        include         'PLT.INC'
+	include 	'parampl5_dat.decl'
+	include 	'PARAMPL5.DAT'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+
+        INTEGER i
+
+*******************************************************************************
+
+
+! From setup_defaults -- which is called only the first time from pplcmd_f
+
+*      key defaults
+
+c	do_key	     	= .true.   ! Still initialize this in setup_defaults.F
+        vertical_key 	= .true.
+        do 100 i = 1, 4
+           kuser_loc(i) = .false.
+  100   continue
+
+	klab_size = 0.0
+	klab_dig  = 3
+	klab_len  = 9
+	klab_incr = 0
+!c Make annotate_key setting persist: Once it has been
+!c set, reset it to 0 only if explicitly turned off, see m.EQ.11 below
+!c	annotate_key = 0  
+
+	if (m .ge. 1 .and. iflg(1) .ne. 0 .and. p(1).eq.0.0) 
+     .	do_key = .false.
+	if (m .ge. 1 .and. iflg(1) .ne. 0 .and. p(1).eq.1.0) 
+     .	do_key = .TRUE.
+
+	if (m .ge. 2 .and. iflg(2) .ne. 0 .and. p(2).eq.0.0) 
+     .	vertical_key = .false.
+	if (m .ge. 2 .and. iflg(2) .ne. 0 .and. p(2).eq.1.0) 
+     .	vertical_key = .TRUE.
+
+	if (m .ge. 3 .and. iflg(3) .ne. 0) klab_size = p(3)
+	if (m .ge. 4 .and. iflg(4) .ne. 0) klab_incr = ifix (p(4))
+	if (m .ge. 5 .and. iflg(5) .ne. 0) klab_dig  = ifix (p(5))
+	if (m .ge. 6 .and. iflg(6) .ne. 0) klab_len  = ifix (p(6))
+
+* Set the user-indicated corners of the shade key. If a location is
+* not marked, it will be set in key.F
+
+        DO 1000 i = 1, 4
+           kuser_loc(i) = (iflg(i+6) .NE. 0)           
+ 1000   CONTINUE
+
+	IF (m .GE. 7) THEN
+
+          IF (iflg(7) .NE. 0 .AND. iflg(8) .NE. 0 
+     .	     .AND. iflg(9) .NE. 0 .AND. iflg(10) .NE. 0) THEN
+	      kx_lo = p(7) * 1000.
+	      kx_hi = p(8) * 1000.
+	      ky_lo = p(9) * 1000.
+	      ky_hi = p(10)* 1000.
+           ELSE 
+
+              IF (iflg(7).NE.0 .AND. iflg(8).EQ.0) kx_lo = p(7) * 1000.
+              IF (iflg(7).EQ.0 .AND. iflg(8).NE.0) kx_hi = p(8) * 1000.
+              IF (iflg(7).NE.0 .AND. iflg(8).NE.0) THEN
+	         kx_lo = p(7) * 1000.
+	         kx_hi = p(8) * 1000.
+              ENDIF
+  
+              IF (iflg(9).NE.0 .AND. iflg(10).EQ.0) ky_lo = p(9) * 1000.
+              IF (iflg(9).EQ.0 .AND. iflg(10).NE.0) ky_hi = p(10) * 1000.
+              IF (iflg(9).NE.0 .AND. iflg(10).NE.0) THEN
+	         ky_lo = p(9) * 1000.
+	         ky_hi = p(10) * 1000.
+              ENDIF
+           ENDIF
+        ENDIF
+
+        IF (m .GE. 11) THEN
+           annotate_key = 0
+	   IF (p(11) .EQ. 1) annotate_key = 1
+	ENDIF
+
+        DO 3000 i = 1, 4
+           iflg(i+6) = 0  ! Reset for subsequent plots
+ 3000   CONTINUE
+
+	return
+	end
diff --git a/ppl/tmapadds/shade_key_cont.F b/ppl/tmapadds/shade_key_cont.F
new file mode 100644
index 0000000..132e685
--- /dev/null
+++ b/ppl/tmapadds/shade_key_cont.F
@@ -0,0 +1,62 @@
+        SUBROUTINE SHADE_KEY_CONT (icode)
+        
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Sets up for continuous SHADE key
+*
+* v541 *acm*  5/02 add option to control outline on the shade key boxes
+* v581 *acm* 3/05 put flag cont_key into common CONT.INC
+
+        IMPLICIT NONE
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+	include 	'parampl5_dat.decl'
+	include 	'PARAMPL5.DAT'
+	include		'cont_inc.decl'
+	include		'CONT.INC'
+*********************************************
+        INTEGER icode
+
+	p(11) = icode
+
+        IF (icode .EQ. 1) THEN
+           cont_key = .TRUE.
+        ELSE
+           cont_key = .FALSE.
+        ENDIF
+
+	return
+	end
diff --git a/ppl/tmapadds/shade_set.F b/ppl/tmapadds/shade_set.F
new file mode 100644
index 0000000..540d623
--- /dev/null
+++ b/ppl/tmapadds/shade_set.F
@@ -0,0 +1,628 @@
+        SUBROUTINE SHADE_SET
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*       Sets the options for SHADE -- fill_missing, custom_colors
+*       J Davison JISAO/PMEL/TMAP 8.24.88
+*	Completely rewritten J Davison 7.27.89
+*       *JD* 4.22.91 Take out fill area rep setting for metafiles -- 
+*				new translator
+*	*jd* 3.93 Exchange DEFAULT and SPECTRUM code positions for FERRET
+*	*jd* SPECTRA is now FER_PALETTE
+*       *jd* eliminate call meta_protect for xgks -- but haven't replaced
+*			functionality with other code
+*	*jd* 6.94 add option to have comments in .spk files -- !-begun lines
+*       *jd* 10.98 Add control for rgb interpolation, atomic colors, or data
+*                 based levels in color bar
+*       *acm* 9/02 Check that the number of levels in a palette file isn't 
+*                  larger than SPEC_SIZE (see shade_vars.cmn), the number 
+*                  of spectrum levels allowed to be specified in a palette file.
+* v552 *acm* 3/03 Longer strings: changes for multi-line labels.
+* V602: *acm* 1/07 Changes for metafile-batch mode
+* V608: *acm*11/07 the text for RGB_mapping must be palette, by_value, or by_level; issue
+*                  a warning if its not one of these. Fixes bug 1549
+* V610  *acm* 3/08 Fixes for metafile batch mode
+* PyFr *kms* 5/13 Add alpha channel (opaque) variables SA,MSA
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+        include 	'cmrdl_inc.decl'            
+        include 	'CMRDL.INC'            
+        include 	'gkscm1_inc.decl'            
+        include 	'GKSCM1.INC'            
+        include 	'gkscm2.cmn'            
+	include         'gkspar.inc'
+
+       	logical		there
+        integer         beg,end,istate
+        character*2048   str                                
+
+******************************************************************************
+
+      	call upnsquish (label,str,end)
+        call squish (label,1,2048)
+
+*	IF NO LABELS IN THE SHASET COMMAND THEN PROCESS LEVELS AS SPECIFIED
+	if (end .eq. 0) then
+	   call shade_levels
+	   goto 10
+	end if
+
+*	IF RGB MAPPING MODIFIED, SET FLAG
+	beg = index (str,'RGB_MAPPING')
+	if (beg .ne. 0) then
+	   call shade_mapping  (str)
+	   goto 10
+	end if
+
+*	IF A SPECTRUM IS TO BE READ, DO THAT AND SET LEVELS
+	beg = index (str,'SPECTRUM')
+	if (beg .ne. 0) then
+	   call shade_read (label,beg,end,there)
+	   if (.not.there) return
+	   goto 10
+	end if
+
+*	OTHERWISE: IF DEFAULT COLORS REQUESTED, SET THEM
+	beg = index (str,'DEFAULT')
+	if (beg .ne. 0) then
+	   call shade_default
+	   goto 10
+	end if
+
+*	IF A SPECTRUM IS TO BE SAVED, DO THAT
+	beg = index (str,'SAVE')
+	if (beg .ne. 0) then
+	   call shade_save (label,beg,end)
+	   return
+	end if
+
+*	IF A SPECTRUM IS TO BE PROTECTED OR UNPROTECTED, DO THAT
+	if (str .eq. 'PROTECT' .or. str .eq. 'RESET') then
+	   call shade_protect_reset (str)
+	   return
+	end if
+
+10      CALL FGD_GQOPS(istate)  ! In batch mode the graphics may not be active now. 
+        IF (istate .GE. 2) THEN
+
+*       SET THE SHADES                                                
+        IF ( .NOT. protect_used_colors )
+     .     CALL set_fill_area_rep(wsid,wstype)
+
+        ENDIF
+	return
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_LEVELS 
+
+        IMPLICIT NONE
+        include         'parampl5_dat.decl'
+        include         'PARAMPL5.DAT'
+        include         'cont_inc.decl'
+        include         'CONT.INC'
+        include         'shade_vars.cmn'
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+
+	include 'errmsg.parm'
+
+	integer		i,j, status
+
+        CHARACTER*100   err_msg
+
+*******************************************************************************
+
+	custom_colors = .true.
+
+*	NO PARAMETERS RESETS SPECTRUM TO GRAY SCALE
+	if (m .eq. 0) then
+           if (rgb_mapping .eq. by_value) then
+              ncl = 0
+           else
+              ncl = 2
+              if (rgb_mapping .eq. by_level) then
+                 slvl(1) = 1.0
+                 slvl(2) = 2.0
+              else
+                 slvl(1) = 0.0
+                 slvl(2) = 100.0
+              end if
+           end if
+           
+           sr(1) = 0.0
+           sg(1) = 0.0
+           sb(1) = 0.0
+           sa(1) = 1.0
+           
+           sr(2) = 1.0
+           sg(2) = 1.0
+           sb(2) = 1.0
+           sa(2) = 1.0
+           
+           return
+        end if
+        
+*       LISTING ONLY THE FIRST PARAMETER DELETES THAT LEVEL
+	if (m .eq. 1) then
+           if (rgb_mapping .eq. percent .and. 
+     .          (p(1) .eq. 0.0 .or. abs(p(1)) .ge. 100.0)) return
+
+           if (ncl .eq. 1) then
+              ncl = 0
+           else if (ncl .gt. 1) then
+              do 5 i = 1,ncl
+                 if (p(1) .eq. slvl(i)) then
+                    ncl = ncl - 1
+                    do 1 j = i,ncl
+                       slvl(j) = slvl(j+1)
+                       sr(j) = sr(j+1)       
+                       sg(j) = sg(j+1)       
+                       sb(j) = sb(j+1)       
+                       sa(j) = sa(j+1)       
+ 1                  end do
+                    return
+                 end if
+ 5            end do
+           end if
+        end if
+
+*	NEED COMPLETE SET OF ARGUMENTS OTHERWISE
+	if ( (m .lt. 4) .or. (m .gt. 5) ) return
+
+*	REJECT PERCENT OF SPECTRUM OUTSIDE 0 TO 100	
+	if (rgb_mapping .eq. percent .and. 
+     .       (p(1) .lt. 0.0 .or. p(1) .gt. 100.0)) return
+
+*	REJECT PERCENT OF R,G,B,A OUTSIDE 0 TO 100
+	if (p(2) .lt. 0.0 .or. p(2) .gt. 100.0) return
+	if (p(3) .lt. 0.0 .or. p(3) .gt. 100.0) return
+	if (p(4) .lt. 0.0 .or. p(4) .gt. 100.0) return
+        if ( (m .eq. 5) .and. 
+     .       (p(5) .lt. 0.0 .or. p(5) .gt. 100.0) ) return
+
+*	IF FIRST VALUE, ENTER INTO TABLE
+        if (ncl .eq. 0) then
+           slvl(1) = p(1)
+           sr(1) = p(2)/100.0
+           sg(1) = p(3)/100.0
+           sb(1) = p(4)/100.0
+           if ( m .eq. 5 ) then
+              sa(1) = p(5)/100.0
+           else
+              sa(1) = 1.0
+           endif
+           ncl = 1
+
+           return
+        end if
+       
+*	REPLACE OLDER VALUES WITH NEW IF RESPECIFIED
+	do 10 i = 1,ncl
+	   if (p(1) .eq. slvl(i)) then
+	      sr(i) = p(2)/100.0
+	      sg(i) = p(3)/100.0
+	      sb(i) = p(4)/100.0
+              if ( m .eq. 5 ) then
+                 sa(i) = p(5)/100.0
+              else
+                 sa(i) = 1.0
+              endif
+
+	      return
+	   end if
+10	end do
+
+*	IF NEW, INSERT INTO PROPER LOCATION IN SPECTRUM
+	do 20 i = 1,ncl-1
+	   if (p(1) .lt. slvl(i+1)) then  
+	      do 15 j = ncl,i+1,-1
+		 slvl(j+1) = slvl(j)
+		 sr(j+1) = sr(j)
+		 sg(j+1) = sg(j)
+		 sb(j+1) = sb(j)
+                 sa(j+1) = sa(j)
+15	      end do
+	      ncl = ncl + 1
+              IF (ncl .GT. spec_size) GOTO 1000
+
+	      slvl(i+1) = p(1)
+	      sr(i+1) = p(2)/100.0
+	      sg(i+1) = p(3)/100.0
+	      sb(i+1) = p(4)/100.0
+              if ( m .eq. 5 ) then
+                 sa(i+1) = p(5)/100.0
+              else
+                 sa(i+1) = 1.0
+              endif
+
+	      return
+	   end if
+20	end do
+          
+        if (p(1) .gt. slvl(ncl)) then 
+           ncl = ncl + 1
+           IF (ncl .GT. spec_size) GOTO 1000
+           
+           slvl(ncl) = p(1)
+           sr(ncl) = p(2)/100.0
+           sg(ncl) = p(3)/100.0
+           sb(ncl) = p(4)/100.0
+           if ( m .eq. 5 ) then
+              sa(ncl) = p(5)/100.0
+           else
+              sa(ncl) = 1.0
+           endif
+        end if
+ 
+ 5000	RETURN
+        
+ 1000	WRITE (err_msg, 110)  spec_size 
+  110   FORMAT ('Too many spectrum levels in .spk file. Max is', i4)
+        CALL ERRMSG( ferr_prog_limit, status,
+     .		err_msg, *5000 )
+	END
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_DEFAULT
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+
+*******************************************************************************
+
+	custom_colors = .false.
+	return
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_MAPPING  (str)
+
+* Set mapping for color bar:
+*     PERCENT    -> 0
+*     BY_VALUE   -> 1
+*     BY_LEVEL   -> 2
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+        character*2048   str
+
+*******************************************************************************
+
+	if (index (str, 'PERCENT') .ne. 0) then
+           rgb_mapping = percent
+           goto 10
+	end if
+
+        if (index (str, 'BY_VALUE') .ne. 0) then
+           rgb_mapping = by_value
+           goto 10
+	end if
+
+        if (index (str, 'BY_LEVEL') .ne. 0) then
+           rgb_mapping = by_level
+           goto 10
+	end if
+
+ 10     return
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_READ (str,beg,end,there)
+
+*	Mod *jd* 10.92 to allow memory reads
+*	Mod *jd* 3.1.93 to use tm_inq_path
+
+        IMPLICIT NONE
+        include 	'tmap_errors.parm'    
+	include		'cmrd_inc.decl'
+	include		'CMRD.INC'
+        include         'shade_vars.cmn'
+
+	logical		there
+	integer		beg,end,i,j,speclen,lnblk,status
+        integer         test_end
+	character*2048	str,sfile,instr,label,specdir,tm_inq_path
+        character*2048   test_str
+	external 	lnblk
+
+        integer         mapping,percentage,value,level 
+        INTEGER         TM_LENSTR1, ilen, slen
+*******************************************************************************
+
+*       DEFAULT MAPPING IS PERCENT FOR COMPATIBILITY WITH ORIGINAL SYSTEM
+        rgb_mapping = percent
+        ncl = 0
+
+*	IF NO FILE NAME GIVEN, READ IN FROM MEMORY
+	if (end .lt. 10) then
+	   if (mncl .eq. 0) goto 100
+
+	   custom_colors = .true.
+	   ncl = mncl
+           rgb_mapping = mrgb_mapping
+
+	   do 4 i = 1,ncl
+	      slvl(i) = mslvl(i)
+	      sr(i) = msr(i)/100.0
+	      sg(i) = msg(i)/100.0
+	      sb(i) = msb(i)/100.0
+	      sa(i) = msa(i)/100.0
+4	   end do
+
+	   there = .true.
+	   return
+	endif
+************** Modified to use tm_inq_path *jd* 3.1.93 ***************
+*#ifdef unix
+*        call getenv ('SPECTRA',specdir)
+*        speclen = lnblk (specdir,2048)
+*	sfile = specdir(:speclen)//'/'//str(beg+9:end)//'.spk'
+*	inquire (file=sfile,exist=there)
+*	if (there) goto 5
+
+*	sfile = str(beg+9:end)//'.spk'
+*	inquire (file=sfile,exist=there)
+*	if (.not.there) goto 100
+*#else
+*	sfile = 'spectra:'//str(beg+9:end)//'.spk'
+*	inquire (file=sfile,exist=there)
+*	if (.not.there) goto 100
+*#endif
+***************** end mod 3.1.93 **************************************
+
+	sfile = tm_inq_path (str(beg+9:end),'FER_PALETTE','.spk',
+     .	.false.,status)
+*	type *, sfile,str(beg+9:end),status,merr_ok
+	if (status .ne. merr_ok) go to 100
+	there = .true.
+
+*	OPEN THE FILE
+#ifdef atc_gks
+ 5      open (70,file=sfile,status='old',err=100)
+#else
+#ifdef NO_OPEN_READONLY
+ 5      open (70,file=sfile,status='old',err=100)
+#else
+ 5      open (70,file=sfile,readonly,status='old',err=100)
+#endif
+#endif
+
+*	NOW READ IN THE LEVELS AND SET THEM
+10	read (70,'(a)',end=30,err=90) instr
+	do 15 i = 1,80
+	   if (instr(i:i) .ne. ' ') then
+	      j = i
+	      goto 20
+	   end if
+15	end do
+	goto 10
+
+*	PERMIT COMMENTS 
+20	if (instr(j:j) .eq. '!') goto 10
+
+*       DETERMINE MAPPING
+        call upnsquish (instr,test_str,test_end)
+ 
+        if (index(test_str, 'RGB_MAPPING') .ne. 0) then
+ 
+           percentage     = index (test_str, 'PERCENT')
+           value          = index (test_str, 'BY_VALUE')
+           level          = index (test_str, 'BY_LEVEL') 
+
+           if (percentage .ne. 0) then
+              rgb_mapping = percent
+           else if (value .ne. 0) then
+              rgb_mapping = by_value
+           else if (level .ne. 0) then
+              rgb_mapping = by_level
+           else
+              ilen = TM_LENSTR1(instr)
+              slen = TM_LENSTR1(sfile)
+              CALL WARN ('RGB_Mapping type not recognized, given '//
+     .         'in palette file '//sfile(1:slen)//' as '//instr(1:ilen))
+              CALL WARN ('Must be percent, by_value or by_level. '//
+     .         'Defaulting to percent')
+           endif
+              
+
+*	   RESET SPECTRUM TO GRAY SCALE
+           if (rgb_mapping .eq. by_value) then
+              ncl = 0
+           else
+              ncl = 2
+              if (rgb_mapping .eq. by_level) then
+                 slvl(1) = 1.0
+                 slvl(2) = 2.0
+              else
+                 slvl(1) = 0.0
+                 slvl(2) = 100.0
+              end if
+           end if
+           
+           sr(1) = 0.0
+           sg(1) = 0.0
+           sb(1) = 0.0
+           sa(1) = 1.0
+           
+           sr(2) = 1.0
+           sg(2) = 1.0
+           sb(2) = 1.0
+           sa(2) = 1.0
+           
+           goto 10
+        end if
+        
+        call parsex (instr(j:j+79),80,p,iflg,m,label,n)
+	call shade_levels
+	goto 10
+
+30	close (70)
+	return
+
+*	ERROR WITH FILE ACCESS
+90	close (70)
+100	there = .false.
+	write (6,'(/a/)') ' PPL+ error: Unable to read "' //
+     .	str(beg+9:end)//'.spk" to set shade and fill colors.'
+
+	return
+
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_SAVE (str,beg,end)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+
+	integer		beg,end,i
+	character*2048	str,sfile
+
+
+*******************************************************************************
+
+*	WRITE TO MEMORY IF NO FILE NAME GIVEN
+	if (end .lt. 6) then
+	   mncl = ncl
+           mrgb_mapping = rgb_mapping
+
+	   do 10 i = 1,ncl
+	      mslvl(i) = slvl(i)
+	      msr(i) = sr(i)*100.0
+ 	      msg(i) = sg(i)*100.0
+	      msb(i) = sb(i)*100.0
+	      msa(i) = sa(i)*100.0
+10	   end do
+	   goto 101
+	end if
+
+#ifdef unix
+	sfile = str(beg+5:end)//'.spk'
+
+*	OPEN THE FILE
+
+#   ifdef atc_gks
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	err=100)
+#   else
+#ifdef NO_OPEN_CARRIAGECONTROL
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	err=100)
+#else
+	open (70,file=sfile,status='unknown',form='formatted',
+     .	carriagecontrol='list',err=100)
+#endif
+#   endif
+#else
+	sfile = 'fer_palette:'//str(beg+5:end)//'.spk'
+
+*	OPEN THE FILE
+#ifdef NO_OPEN_CARRIAGECONTROL
+	open (70,file=sfile,status='new',form='formatted',
+     .	err=100)
+#else
+	open (70,file=sfile,status='new',form='formatted',
+     .	carriagecontrol='list',err=100)
+#endif
+#endif
+*	WRITE OUT THE SPECTRUM
+        if (rgb_mapping .eq. percent) then
+           write(70,'(a/" "/"! SetPt    Red  Green   Blue  Opacity")') 
+     .          'RGB_Mapping Percent'
+
+        else if (rgb_mapping .eq. by_value) then
+           write(70,'(a/" "/"! SetPt    Red  Green   Blue  Opacity")') 
+     .          'RGB_Mapping By_value'
+
+        else if (rgb_mapping .eq. by_level) then
+           write(70,'(a/" "/"! Level    Red  Green   Blue  Opacity")') 
+     .          'RGB_Mapping By_level'
+        end if
+
+        if (rgb_mapping .ne. by_level) then
+           do i = 1,ncl
+              write (70,'(5f7.1)') slvl(i),
+     .             sr(i)*100.0,sg(i)*100.0,sb(i)*100.0,sa(i)*100.0
+           end do
+        else
+           do i = 1,ncl
+              write (70,'(i7,4f7.1)') i,
+     .             sr(i)*100.0,sg(i)*100.0,sb(i)*100.0,sa(i)*100.0
+           end do
+        end if
+        
+	close (70)
+	return
+
+100	write (6,'(/a/)') ' PPL+ error: Unable to save spectrum ' //
+     .	str(beg+9:end)//'.spk"'
+101	return
+	end
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+	SUBROUTINE SHADE_PROTECT_RESET (str)
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+	include		'gkscm1_inc.decl'
+	include		'GKSCM1.INC'
+        include         'gkscm2.cmn'
+
+	character*2048	str
+
+*******************************************************************************
+
+*	PROTECT PREVIOUSLY USED COLORS
+	if (str .eq. 'PROTECT') then
+	   protect_used_colors = .true.
+	else if (str .eq. 'RESET') then
+*	SET THEM TO BE REUSED
+	   protect_used_colors = .false.
+	   lo_color_ndx(wsid) = 0
+	   hi_color_ndx(wsid) = 0
+	endif
+
+	return
+	end
diff --git a/ppl/tmapadds/shade_sub.F b/ppl/tmapadds/shade_sub.F
new file mode 100644
index 0000000..69fd64e
--- /dev/null
+++ b/ppl/tmapadds/shade_sub.F
@@ -0,0 +1,479 @@
+	SUBROUTINE SHADE_SUB (data,xc,yc,xs,ys, cells)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*
+*       lots of places ---> PPLMOD_PPLCMD ---> PPLMOD_PLTIT
+*               ---> PPLADD_SHADE ---> PPLADD_SHADE_SUB()
+*
+*	Uses GKS calls to display an image using fill area, with
+*	a range of colors if available on the workstation, or grey scale 
+*	(or other available) patterns if not.  FORTRAN binding is used.
+
+*	J Davison JISAO/PMEL/TMAP 6.15.88
+
+*	Modified to fit into PPL as the SHADE command routine
+*	J Davison 8.12.88
+
+*	*sh*  1/23/89 - added interrupt detection
+*	*jd*  3.15.89 - modified to provide for metafile output and also
+*			to support more workstations
+*	*jd*  7.17.89 - to fix transform error
+*	*jd*  8.28.89 - to certify clipping on for shade
+*	*jd* 12.13.89 - to fill edge cells completely -- clipping prevents
+*			fill area overflowing plot axes
+*	*jd*   1.2.90 -	get box boundaries from Ferret if in Ferret; can have
+*			irregular grids there
+*	*jd*  5.16.90 - to speed up the shade execution, wait while repeated
+*			cells of same color are added to list to fill.  Also
+*			extracted part of code into 2 subroutines to clean up.
+*       *jd*  4.11.91 - calls to write shd_levels & shade settings to metafile
+*                       as private items and NOT set color rep or fill area
+*                       rep explicitly in the metafile
+*	*jd*  4.2.92  - Includes decision to NOT use area bundles if more
+*			than 20 in ATC GKS
+*	*jd*  7.31.92 - Mod to allow shading of single level fields
+*	*jd*  10.1.92 - Accommodate protection of used colors
+*	*jd*  10.12.92- Handle lack of sufficient fill area indices in ATC
+*			GKS when using hatching. -- cancel this 10.22.92 
+*	*jd*  10.26.930 Eliminate meta_shade_set but don't replace with
+*				code to retain function, yet
+*	*jd*  01.27.94  Fix bug in assigning shd_levels -- always >= 1
+*	*sh*  03.07.97  Allow external transformation to curvilinear coords
+*	*sh*  25.11.97  changed calling args of GET_NDX by eliminating "i,j"
+*			and by returning -999 for no index found
+*       *acm* 11/02     V5.50 For rectangular shade plots with no pattern
+*                       calls, use cellarray call for the shade.
+*       *acm*  1/03     v5.50 Remove debug line that stopped Ferret for large
+*                             cellarray plots (!)
+*       *acm* 1/27/03   Bug fix in cellarray plots, which had not taken the
+*                       possible /HLIMITS and /VLIMITS into account.
+* v5.51*acm*  1/30/03  Comment out the cellarray implementation; xgks doesnt
+*                      completely implement it & has a precision bug for 
+*                      large plots.  see comment lines: c no_cellarray
+* V5.54 *acm* 2/11/04  For cellarray plots, if the data is all missing or
+*                      outside the range of the axes that have been plotted,
+*                      do not make the cellarray call.
+*  V5.54 *acm* 2/11/04 For cellarray plots, make sure the edges of the rectangle 
+*                      of data corresponds to the correct part of the box drawn
+*                      by the axes. (/hlim or /vlim plots)
+* V5.61 *acm* 4/16/04  For cellarray plots, fix treatment of half-cells around
+*                      the edges of the plot.  
+* V5.81 *acm* 3/05     For curvilinear plots, do a partial solution for the question
+*                      of modulo longitude axes: Determine the index range needed
+*                      to plot the requested /HLIM/VLIM range. New routine SHADE_FILL_IT
+*                      uses only that range, checks to see if a branch point has been 
+*                      crossed, and makes the plot call.  For curvilinear plots, do not 
+*                      gather up whole groups of cells of the same color but do each 
+*                      separately, checking for the branch cut.  Make more calls to 
+*                      SHADE_FILL_IT as needed to fill the longitude range.
+C V602 *acm* 2/07 check status coming out of CURV_COORD_RANGE; part of fix to bug 1485
+* V603 *acm* 5/07 Fix part 1 of bug 1302; if xmodulo is true, then set dim1_modulo true.
+* V6.8 *acm* 7/9/2012 For batch graphics on RHEL6, change ITS_BATCH_GRAPHICS
+*                     from logical to integer, then batch = ITS_BATCH_GRAPHICS().NE.0
+
+        IMPLICIT NONE
+	INCLUDE		'parampl5_dat.decl'
+	INCLUDE		'PARAMPL5.DAT'
+        INCLUDE         'shade_vars.cmn'
+	INCLUDE		'axis_inc.decl'
+	INCLUDE		'AXIS.INC'
+	INCLUDE		'miss_inc.decl'
+	INCLUDE		'MISS.INC'
+        INCLUDE         'hd_inc.decl'
+        INCLUDE         'HD.INC'
+	INCLUDE		'cont_inc.decl'
+	INCLUDE		'CONT.INC'
+	INCLUDE		'gkscm1_inc.decl'
+	INCLUDE		'GKSCM1.INC'
+	INCLUDE		'gkscm2.cmn'
+        INCLUDE         'pen_inc.decl'
+        INCLUDE         'PEN.INC'
+	INCLUDE         'gkspar.inc'
+	INCLUDE 	'xinterrupt.cmn'	! 1/89 *sh*
+	INCLUDE 	'ppl_in_ferret.cmn'
+        INCLUDE         'switch_inc.decl'
+        INCLUDE         'SWITCH.INC'
+        INCLUDE         'xcurvilinear.cmn'
+        INCLUDE         'errmsg.parm'
+
+	INTEGER		error,i,j,k,trans_no,cflag
+
+        INTEGER         my_trans,fill_ndx,GET_NDX
+        DATA            my_trans/20/
+
+C       data statement of my_trans added for linux port *jd* 12.96
+
+	REAL		data(nx,ny),xc(nx),yc(ny),xs(nx+1),ys(ny+1)
+	REAL	 	w(4),v(4),ndc(4),uc(4)
+	REAL		xinv,yinv, cx1, cx2, cy1, cy2, half
+
+	logical		valid
+
+        INTEGER		cells(*), pmax
+        INTEGER         j1, jn, jd, my, mx
+	LOGICAL		REGULARLY_SPACED,
+     .                  irregular, plot_cell, do_cell
+
+* declarations for curvilinear coordinates
+	LOGICAL		ITS_CURVILINEAR, ITS_CURV_EDGES
+	INTEGER		status
+	INTEGER		maxpts, maxpt_ov2, nright, nleft, 
+     .                  ilo, ihi, jlo, jhi
+	PARAMETER     ( maxpts = 200,
+     .			maxpt_ov2 = maxpts / 2 )
+	REAL		px(maxpts), py(maxpts), xadd, xrange, lmin, lmax
+
+*	PARAMETER	(my_trans = 10)
+	EXTERNAL	GET_NDX
+
+*	MY_TRANS is the normalization transformation used in laying down the
+*	area fill overlay.
+
+******************************************************************************
+
+*       *sh* (3/97) are we doing a curvilinear plot?
+	IF (ppl_in_ferret) THEN
+	   curvilinear = ITS_CURVILINEAR()
+	ELSE
+	   curvilinear = .FALSE.
+	ENDIF
+
+*	*jd* mod to allow shading single level fields 
+	IF (nlev2 .LT. 1) GOTO 1000
+	shd_levels = MAX (nlev2 - 1,1)
+
+*	DETERMINE PATTERNS OR COLORS TO SET BUNDLED FILL AREA REPRESENTATIONS
+	CALL set_fill_area_rep (wsid,wstype)
+
+*	GET PROPER SCALING, NDC COORDINATES, ETC FOR FILL
+	CALL FGD_GQCNTN(error,trans_no)
+	IF (error .NE. 0) GOTO 1000
+
+	CALL FGD_GQNT(trans_no,error,w,v)
+	IF (error .NE. 0) GOTO 1000
+
+	CALL get_user_coords (w,v,ndc,uc,xinv,yinv)
+
+*	NOW SET THE CLIPPING RECTANGLE AROUND THEM AND PATTERN SIZE
+
+	CALL FGD_GSWN(my_trans,uc(1)*xinv,uc(2)*xinv,uc(3)*yinv,uc(4)*yinv)
+	CALL FGD_GSVP(my_trans,ndc(1),ndc(2),ndc(3),ndc(4))
+	CALL FGD_GSELNT(my_trans)
+
+	CALL FGD_GQCLIP(error,cflag,ndc)
+	IF (error .NE. 0) GOTO 1000
+	IF (cflag .NE. gclip) CALL FGD_GSCLIP(gclip)
+
+*	SET UP COORDINATES FOR CENTER OF EACH GRID BOX
+
+        irregular = .FALSE.
+
+**** X coordinates ***
+	IF (ppl_in_ferret) THEN			!	JD 1.2.90	
+
+* "curvilinear" indicates a 3-argument SHADE command: "SHADE vals, xpos, ypos"
+	   IF ( curvilinear ) THEN
+              irregular = .FALSE.
+* ... Indices have been passed to this routine instead of coordinates
+*     The coordinates are inside Ferret - gotten through CURV_COORDS below 
+	      IF ( ITS_CURV_EDGES(1) ) THEN
+* ... User gave Ferret edge points as coords -- set indices to point to them
+* 	e.g. 1, 2, 3, ..., N+1
+	         DO 11 i = 1, nx
+ 11	         xs(i) = xc(i)
+	         xs(nx+1) = xs(nx) + 1
+	      ELSE
+* ... User gave Ferret grid points as coords -- set indices to index midpoints
+* 	e.g. 0.5, 1.5, ...,N+.5
+	         xs(1) = (xc(1) - (xc(2) - xc(1))/2.0)
+	         DO 12 i = 1,nx-1
+	            xs(i+1) = (xc(i) + (xc(i+1) - xc(i))/2.0)
+12	         CONTINUE
+	         xs(nx+1) = (xc(nx) + (xc(nx) - xc(nx-1))/2.0)
+	      ENDIF
+
+* normal rectangular grid (non-curvilinear)
+	   ELSE
+	      CALL box_bounds ('X',xc(1),nx,xs,valid)
+	      IF (.NOT. valid) THEN
+	         interrupted = .true.
+	         GOTO 3333
+	      ENDIF
+	   ENDIF
+	   DO 20 i = 1,nx+1
+	      xs(i) = xs(i)*xinv
+20	   CONTINUE
+	ELSE
+	   xs(1) = (xc(1) - (xc(2) - xc(1))/2.0)*xinv
+	   DO 30 i = 1,nx-1
+	      xs(i+1) = (xc(i) + (xc(i+1) - xc(i))/2.0)*xinv
+30	   CONTINUE
+	   xs(nx+1) = (xc(nx) + (xc(nx) - xc(nx-1))/2.0)*xinv
+	ENDIF
+
+        IF (.NOT.curvilinear .AND. .NOT.irregular) 
+     .      irregular = .NOT. REGULARLY_SPACED(xc, nx)
+
+**** Y coordinates *** (see doc of logic in X coordinates)
+	IF (ppl_in_ferret) THEN			!	JD 1.2.90
+	   IF ( curvilinear ) THEN
+	      IF ( ITS_CURV_EDGES(2) ) THEN
+	         DO 21 i = 1, ny
+ 21	         ys(i) = yc(i)
+	         ys(ny+1) = ys(ny) + 1
+	      ELSE
+	         ys(1) = (yc(1) - (yc(2) - yc(1))/2.0)
+	         DO 22 i = 1,ny-1
+	            ys(i+1) = (yc(i) + (yc(i+1) - yc(i))/2.0)
+22	         CONTINUE
+	         ys(ny+1) = (yc(ny) + (yc(ny) - yc(ny-1))/2.0)
+	      ENDIF
+	   ELSE
+	      CALL box_bounds ('Y',yc(1),ny,ys,valid)
+	      IF (.NOT. valid) THEN
+	         interrupted = .true.
+	         GOTO 3333
+	      ENDIF
+	      DO 31 j = 1,ny+1
+	         ys(j) = ys(j)*yinv
+31	      CONTINUE
+	   ENDIF
+	ELSE
+	   ys(1) = (yc(1) - (yc(2) - yc(1))/2.0)*yinv
+	   DO 35 j = 1,ny-1
+	      ys(j+1) = (yc(j) + (yc(j+1) - yc(j))/2.0)*yinv
+35	   CONTINUE
+	   ys(ny+1) = (yc(ny) + (yc(ny) - yc(ny-1))/2.0)*yinv
+*								END 12.13.89
+	ENDIF
+        IF (.NOT.curvilinear .AND. .NOT.irregular) 
+     .      irregular = .NOT. REGULARLY_SPACED(yc, ny)
+
+
+*       WRITE OUT SHD_LEVELS & SHADE SETTINGS TO METAFILE (4.91)
+c
+c* For cellarray shade plots:
+c
+c*       For version 5.52 cellarray called only for gif batch mode.
+c*       cellarray call is for rectangular, evenly spaced grids,
+c*       to be filled with solid colors. Use previously-implemented 
+c*       calls tha use fillarea when there is meta or ps output.
+c*       use_cell is determined in disp_set_up, called on the Ferret 
+c*       side from xeq_shade.
+
+* See ticket 2039:  When the cellarray plot is one of several in viewports,
+* the colors in the cellarray image are off by one. Have not found the cause. 
+* Work around it by refusing to make a cellarray call except for the first 
+* color map, either the first plot on the page, or if a PPL SHASET RESET has 
+* been issued.
+
+      do_cell = use_cell .AND. (lo_color_ndx(wsid).EQ.num_line_colors+1)
+
+      IF (do_cell) THEN
+      
+* Collect color indices in cellarray cells array.
+* Set the data rectangle to represent whole grid cells.
+
+        half = (xc(2) - xc(1)) / 2.
+        cx1 = (uc(1) - half)* xinv   
+        cx2 = (uc(2) + half)* xinv   
+
+        half = (yc(2) - yc(1)) / 2.
+        cy1 = (uc(3) - half)* yinv
+        cy2 = (uc(4) + half)* yinv
+
+* Get the number of grid cells to be plotted 
+
+        mx = 0
+        my = 0
+
+        plot_cell = .TRUE.
+        DO 60 i = 1, nx
+           IF (xc(i) .GE. cx1 .AND. xc(i) .LE. cx2) mx = mx + 1
+  60    CONTINUE
+        DO 65 j = 1, ny
+           IF (yc(j) .GE. cy1 .AND. yc(j) .LE. cy2) my = my + 1
+  65    CONTINUE
+
+* none of the data is in the range of the axes we are plotting; 
+* dont make the cellarray call.
+
+        IF ( (mx .EQ. 0) .OR. (my .EQ. 0) ) plot_cell = .FALSE.
+
+* load the color array
+
+        k = 0
+        pmax = 0
+        j1 = ny
+        jn = 1
+        jd = -1
+
+        IF (yinv .LT. 0) THEN
+           j1 = 1
+           jn = ny
+           jd = 1
+        ENDIF
+
+        DO 80 j = j1,jn,jd
+	   DO 70 i = 1,nx
+
+           IF ( interrupted ) GOTO 3333			! 1/89 - *sh*
+
+           IF (xc(i) .GT. cx1 .AND. xc(i) .LE. cx2  .AND.
+     .         yc(j) .GT. cy1 .AND. yc(j) .LE. cy2 ) THEN
+
+              fill_ndx  = GET_NDX (data(i,j),fill_ndx)
+              k = k + 1
+ 
+              IF (fill_ndx .NE. -999) THEN
+                 cells(k) = fill_ndx + lo_color_ndx(wsid)-2
+                 pmax = max (cells(k), pmax)
+
+              ELSE
+                 cells(k) = 0
+              ENDIF
+
+           ENDIF
+
+70         CONTINUE
+80      CONTINUE
+
+c If all the data is missing don't make the cellarray call
+
+        IF (pmax .EQ. 0) plot_cell = .FALSE.
+
+*  Render the field using the cellarray primitive call.  
+
+         IF (plot_cell) THEN
+            DO 90 i = 0, pmax
+               CALL FGD_GSFACI(i)
+90          CONTINUE
+
+* If the data rectangle doesnt take up the whole plot box, reset
+* the world coordinates of the corners to match the data rectangle.
+
+            half = (xc(2) - xc(1)) / 2.
+            IF (cx1 .LT. xc(1) - half ) cx1 = xc(1)  - half
+            IF (cx2 .GT. xc(nx) + half) cx2 = xc(nx) + half
+
+            half = (yc(2) - yc(1)) / 2.
+            IF (cy1 .LT. yc(1) - half ) cy1 = yc(1)  - half
+            IF (cy2 .GT. yc(ny) + half) cy2 = yc(ny) + half
+            IF (yinv .LT. 0) THEN
+               half = -1*cy1  ! temp. storage to switch values
+               cy1 = -1*cy2
+               cy2 = half
+            ENDIF
+            CALL FGD_GCA(cx1, cy1, cx2, cy2, mx,my, 1,1, mx,my, cells)
+         ENDIF
+
+      ELSE  ! non-cellarray:
+
+* SHADE plot, when either a pattern is used or 
+* we have curvilinear coordinates
+
+*	LAY FILL DOWN ON SCREEN IN PROPER PLACE
+
+* Get range of indices for the curvi X,Y coordinates actually needed for the 
+* hlimits, vlimits that were requested.
+
+        IF (curvilinear) THEN
+           CALL CURV_COORD_RANGE (uc, ilo, ihi, jlo, jhi, status )
+           IF (status .NE. ferr_ok) GOTO 1000
+           IF (xmodulo) dim1_modulo = .TRUE.
+        ENDIF
+
+        xadd = 0.
+        CALL SHADE_FILL_IT (data, nx, ny, px, py, xs, ys, xinv, yinv, 
+     .                   xadd, lmin, lmax, ilo, ihi, jlo, jhi, 
+     .                   maxpt_ov2, status)
+        IF (status .EQ. ferr_interrupt) GOTO 3333
+
+*	MODULO REPLICATIONS TO FILL OUT uc(1) TO uc(2)
+
+        IF (xmodulo .AND. curvilinear) THEN
+           xrange = 360
+           IF (.NOT. units_degrees) xrange = wwxmax - wwxmin
+           nleft = 0
+           nright = 0
+           IF (lmin .GT. uc(1) ) nleft =  1 + INT(lmin - uc(1) )/ xrange
+           IF (lmax .LT. uc(2) ) nright = 1 + INT(uc(2) - lmax )/ xrange
+
+           IF (nleft .GT. 0) THEN
+              xadd = 0.
+              DO 100 i = 1, nleft
+                 xadd = xadd - xrange
+                 CALL SHADE_FILL_IT (data, nx, ny, px, py, xs, ys,
+     .                         xinv, yinv,  xadd, lmin, lmax, ilo, 
+     .                         ihi, jlo, jhi, maxpt_ov2, status)
+                 IF (status .EQ. ferr_interrupt) GOTO 3333
+ 100          CONTINUE
+           ENDIF
+
+           IF (nright .GT. 0) THEN
+              xadd = 0.
+              DO 110 i = 1, nright
+                 xadd = xadd + xrange
+                 CALL SHADE_FILL_IT (data, nx, ny, px, py, xs, ys,
+     .                         xinv, yinv,  xadd, lmin, lmax, ilo, 
+     .                         ihi, jlo, jhi, maxpt_ov2, status)
+                 IF (status .EQ. ferr_interrupt) GOTO 3333
+ 110          CONTINUE
+           ENDIF
+
+
+        ENDIF   ! xmodulo
+
+      ENDIF	! use_cell
+
+ 3333	CONTINUE					! 1/89 - *sh*
+* post-interrupt re-entry				! 1/89 - *sh*
+
+*	BACK TO PREVIOUS CLIPPING
+	CALL FGD_GSCLIP(cflag)
+
+*	BACK TO OLD TRANSFORM
+	CALL FGD_GSELNT(trans_no)
+
+*	DO THE KEY
+	IF (do_key .AND. .NOT.interrupted) CALL key	! 1/89 - *sh*
+        CALL shade_key_cont(0)
+
+	RETURN
+*	Fatal error
+1000	RETURN
+	END
diff --git a/ppl/tmapadds/strmar.F b/ppl/tmapadds/strmar.F
new file mode 100644
index 0000000..d4ff33a
--- /dev/null
+++ b/ppl/tmapadds/strmar.F
@@ -0,0 +1,125 @@
+      subroutine strmar (xx1, yy1, xx2, yy2, vel, xf, yf) 
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any             or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*       *acm* 8/2001 separated from flowline_sub.F
+*                    strmar came from NCAR streamline code.
+*  *acm*  12/7/01 Trap cases with dx=dy=0; atan2 fcn returns NAN under OSF.
+*                 Declare all variables.
+*  *acm&   3/06   change the scale of arrow heads; values are actually the same.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+
+      IMPLICIT NONE
+      REAL a160
+      PARAMETER (a160 = 160.0*3.1416/180.0)
+      REAL xf, yf
+      REAL arrlen, vel, dir, xx1, xx2, yy1, yy2, small, fac
+
+        include 'vector_inc.decl'
+        include 'VECTOR.INC'
+        include 'xcurvilinear.cmn'
+
+C     Curvilinear coordinates declarations
+      INTEGER status
+#ifdef double_p
+      real*8 x_curv, y_curv
+#else
+      real x_curv, y_curv
+#endif
+      REAL addx1, addy1, addx2, addy2, xxc, yyc, xxd, yyd, xxe, yye
+
+      DATA small/1.e-6/
+
+*  If the points are too close together, return
+
+      IF (ABS(xx2-xx1) .LT. small   .AND. 
+     .    ABS(yy2-yy1) .LT. small) RETURN
+
+*  Set directions for arrows.
+
+      dir = atan2(yy2-yy1, xx2-xx1)
+
+*  Set arrow length scale based on vel.
+*  factor of 0.2 is for the fact that the arrow is 0.2 of 
+*  the velocity arrows for regular vectors
+
+      arrlen = vel/(xf+yf)
+      IF (.NOT. curvilinear) arrlen = 0.2* arrlen
+
+      addx1 = arrlen* cos(dir+a160)
+      addy1 = arrlen* sin(dir+a160)
+      addx2 = arrlen* cos(dir-a160)
+      addy2 = arrlen* sin(dir-a160)
+
+      IF (curvilinear) THEN
+
+          x_curv = xx2
+          y_curv = yy2
+          CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+          xxc=x_curv
+          yyc=y_curv
+          CALL plot (xxc, yyc, 0, 0)
+
+          x_curv = xx2 + addx1
+          y_curv = yy2 + addy1
+          CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+          xxd = x_curv
+          yyd = y_curv
+
+          CALL plot (xxd, yyd, 1, 0)
+          CALL plot (xxc, yyc, 0, 0)
+
+          x_curv = xx2 + addx2
+          y_curv = yy2 + addy2
+          CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+          xxe = x_curv
+          yye = y_curv
+
+          CALL plot (xxe, yye, 1, 0)
+          CALL plot (xxc, yyc, 0, 0)
+
+      ELSE
+
+         CALL plot (xx2, yy2, 0, 0)
+         CALL plot (xx2+addx1, yy2+addy1, 1, 0)
+         CALL plot (xx2, yy2, 0, 0)
+         CALL plot (xx2+addx2, yy2+addy2, 1, 0)
+         CALL plot (xx2, yy2, 0, 0)
+
+      ENDIF
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/upnsquish.F b/ppl/tmapadds/upnsquish.F
new file mode 100644
index 0000000..9eba575
--- /dev/null
+++ b/ppl/tmapadds/upnsquish.F
@@ -0,0 +1,87 @@
+
+	SUBROUTINE UPNSQUISH (instr,outstr,len_out)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	J Davison 3.15.89 JISAO/PMEL/TMAP
+*	Routine to convert variable length string to upper case
+*	and left justify, throwing away all blanks, and returning 
+*	the length of the resulting string.  
+
+        IMPLICIT NONE
+	integer		len_in,len_out,i
+	character*(*)	instr,outstr
+
+	integer		mask
+	data		mask/Z'DF'/
+
+********************************************************************************
+
+	len_in = len (instr)
+	outstr = ' '
+
+	len_out = 0
+	do 10 i = 1,len_in
+	   if (instr(i:i) .eq. ' ') goto 10
+
+	   len_out = len_out + 1
+	   if (instr(i:i) .lt. 'a' .or. instr(i:i) .gt. 'z' ) then     
+	      outstr(len_out:len_out) = instr(i:i)
+           else                                                         
+#ifdef unix
+
+#ifdef NEED_IAND
+#ifdef FORTRAN_90
+C	*jd* Mod for linux port *jd* 12.96
+	outstr(len_out:len_out) = 
+     x	char(iand(mask,ichar(instr(i:i))))
+#else
+	outstr(len_out:len_out) = 
+     x	char(iand('DF'x,ichar(instr(i:i))))
+#endif
+#else
+              outstr(len_out:len_out) = 
+     .              char(and('DF'x,ichar(instr(i:i))))
+#endif
+#else
+              outstr(len_out:len_out) = 
+     .              char(iand('DF'x,ichar(instr(i:i))))
+#endif
+           end if      
+10	continue
+
+	return
+	end
diff --git a/ppl/tmapadds/use_linear_levels.F b/ppl/tmapadds/use_linear_levels.F
new file mode 100644
index 0000000..e046d3f
--- /dev/null
+++ b/ppl/tmapadds/use_linear_levels.F
@@ -0,0 +1,69 @@
+	SUBROUTINE use_linear_levels
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+
+C**
+C**
+* V663  *acm* 7/10 
+*       For variance-based levels, if the values are too large, then
+*       we couldnt compute std dev. Revert to classic linear levels.
+
+        IMPLICIT NONE
+	include 'parampl5_dat.decl'
+        include 'PARAMPL5.DAT'
+	include 'hd_inc.decl'
+	include 'HD.INC'
+	include 'cont_inc.decl'
+	include 'CONT.INC'
+
+
+* internal variable declarations:
+	REAL datum, sum, dev, sumsq_dev
+	INTEGER ngood
+
+c  Already have data mean; and min and max.  Set openlev to false,
+c  and will call default levels.
+
+        openlev = .FALSE.
+
+* If user requested centered levels, do that here
+	IF (centered) zmean = 0.
+
+ 5000	RETURN
+	
+	RETURN
+	END
diff --git a/ppl/tmapadds/vec_arrows.F b/ppl/tmapadds/vec_arrows.F
new file mode 100644
index 0000000..530d36a
--- /dev/null
+++ b/ppl/tmapadds/vec_arrows.F
@@ -0,0 +1,127 @@
+      SUBROUTINE vec_arrows (xx1, yy1, xx2, yy2, vel, xadd) 
+
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any             or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+
+*       *acm* 8/01/2001  based on strmar which came from NCAR streamline code.
+*    
+*  Called by vecfld.
+*  Plot arrowheads for vectors in vel in curvilinear coordinates.
+*  arguments xx1,yy1,xx2,yy2 are arrow ends in world coordinates.
+*  argument vclen is vector velocity, already in curvilinear system.
+
+*  *acm*  12/7/01 Trap cases with dx=dy=0; atan2 fcn returns NAN under OSF.
+*                 Also remove VMS includes.
+*                 Declare all variables.
+* V68  *acm* 1/12  changes for double-precision ferret, single-precision pplus
+* V684 *adm* 12/12 Changes for VECTOR/MODULO on curvilinear plots.
+
+      IMPLICIT NONE
+
+*  Argument declarations.
+      REAL xx1, yy1, xx2, yy2, vel, xadd
+
+      REAL a160
+      PARAMETER (a160 = 160.0*3.1416/180.0)
+      REAL arrlen
+
+        include 'vector_inc.decl'
+        include 'VECTOR.INC'
+        include 'xcurvilinear.cmn'
+
+C     Curvilinear coordinates declarations
+      INTEGER status
+#ifdef double_p
+      real*8 x_curv, y_curv
+#else
+      real x_curv, y_curv
+#endif
+
+      REAL small, dir, addx1, addy1, addx2, addy2, xxc, yyc, xxd, yyd
+
+      DATA small/1.e-6/
+
+*  If the points are too close together, return
+
+      IF (ABS(xx2-xx1) .LT. small   .AND. 
+     .    ABS(yy2-yy1) .LT. small) RETURN
+
+*  Set directions for arrows.
+
+      x_curv = xx2
+      y_curv = yy2
+      CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+      xxc=x_curv
+      yyc=y_curv
+
+      x_curv = xx1
+      y_curv = yy1
+      CALL curv_coord (x_curv, y_curv, 1, 1.0, 1.0, status)
+      xxd=x_curv
+      yyd=y_curv
+
+*  Set arrow direction
+
+      dir = atan2(yyc-yyd, xxc-xxd)
+
+*  Set arrow length scale based on vel.
+
+      arrlen = 0.2* vel
+      addx1 = arrlen* cos(dir+a160)
+      addy1 = arrlen* sin(dir+a160)
+      addx2 = arrlen* cos(dir-a160)
+      addy2 = arrlen* sin(dir-a160)
+
+      IF (curvilinear) THEN
+	  xxc = xxc + xadd
+
+          CALL plot (xxc, yyc, 0, 0)
+          CALL plot (xxc+addx1, yyc+addy1, 1, 0)
+          CALL plot (xxc, yyc, 0, 0)
+          CALL plot (xxc+addx2, yyc+addy2, 1, 0)
+          CALL plot (xxc, yyc, 0, 0)
+          
+      ELSE
+
+         CALL plot (xx2, yy2, 0, 0)
+         CALL plot (xx2+addx1, yy2+addy1, 1, 0)
+         CALL plot (xx2, yy2, 0, 0)
+         CALL plot (xx2+addx2, yy2+addy2, 1, 0)
+         CALL plot (xx2, yy2, 0, 0)
+
+      ENDIF
+
+      RETURN
+      END
diff --git a/ppl/tmapadds/whoi2bc.F b/ppl/tmapadds/whoi2bc.F
new file mode 100644
index 0000000..df301fe
--- /dev/null
+++ b/ppl/tmapadds/whoi2bc.F
@@ -0,0 +1,82 @@
+	REAL*8 FUNCTION WHOI2BC( whoi )
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+* Convert a WHOI-formatted date of yymmddhhmm to minutes since 1-JAN-0000
+*
+* Steve Hankin - NOAA/PMEL/TMAP
+*
+* version 0.0 - based on TM_SECS_FROM_BC by Mark Verschell
+* version 0.1 - calls TM_SECS_FROM_BC
+* version 0.2 - bug fix: add 1900 to year
+* Mod 11.22.95 J Davison for 4 digit year 
+*
+C *kob* 04/07/96 passed in character strings had to be declared 
+C                with "*(*)" for the linux port 
+* Mod J Davison 10.15.99 Add multi calendar support. Call new routine.
+*  *acm* 12/00 Change calendars to match NetCDF standard 
+
+      IMPLICIT NONE
+      INCLUDE 'calendar.decl'
+      INCLUDE 'calendar.cmn'
+
+
+* Argument definitions
+	CHARACTER*(*)	whoi
+*
+* Local Definition
+	INTEGER		year, month, day, hour, minute, second
+	INTEGER		century
+	REAL*8		TM_SECS_FROM_BC
+
+
+	integer         status
+
+****************************************************************************
+
+* read the WHOI-formatted string
+	READ ( whoi, 3000 ) year, month, day, hour, minute, second, century
+ 3000	FORMAT (7I2.2)
+!!!!!	second = 0
+	year = year + century*100
+
+* call TMAP library routine and convert seconds to minutes
+	WHOI2BC = TM_SECS_FROM_BC ( calendar_id,
+     .    year, month, day, hour, minute, second, status )
+     .		  / 60.D0
+
+	RETURN
+	END
diff --git a/ppl/tmapadds/ws_fill_rep.F b/ppl/tmapadds/ws_fill_rep.F
new file mode 100644
index 0000000..ea9b7ab
--- /dev/null
+++ b/ppl/tmapadds/ws_fill_rep.F
@@ -0,0 +1,163 @@
+	SUBROUTINE WS_FILL_REP (zwsid,zwstype)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Setup the fill area indices for patterns or colors for generic WS
+
+*	J Davison JISAO/PMEL/TMAP
+*	9.2.88/3.15.89
+*	*jd* 2.19.92 mods to support atc gks -- use/not use area bundles
+*	*jd* 10.1.92 mod to support protected color indices
+*	*jd* 12.3.93 mod to set color reps in metafiles as well as window ws
+* 	*jd* 7.21.95 bug fix where if meta_clsplt has been invoked to close
+*			the metafile, error messages are emitted when trying
+*			to setup the color table for the closed ws
+*       *js* 7.31.97 mod to change call to gqlwk to query_xgks_wkstn
+* V600 *acm* 5/06  num_line_colors for MODE LINECOLORS. Number of line colors 
+*                  no longer fixed at 6.
+
+        IMPLICIT NONE
+        include         'shade_vars.cmn'
+        include         'gkscm1_inc.decl'
+        include         'gkscm2.cmn'
+        include         'GKSCM1.INC'
+	include         'gkspar.inc'
+        include         'parampl5_dat.decl'
+        include         'PARAMPL5.DAT'
+        include         'plt_inc.decl'
+        include         'PLT.INC'
+	include		'pen_inc.decl'
+        include         'PEN.INC'  ! with num_linecolors
+
+	integer		zwsid,zwstype,error
+	integer		patt,ndx
+	integer		max_pline,max_pmark,max_text,max_fill_area
+	integer		max_pattern,max_color,usable_colors
+
+	integer		wsmgr_reserve,line_color_reserve
+C	data		wsmgr_reserve/6/,line_color_reserve/6/
+
+C	data stmt added for linux *jd* 12.96
+
+
+*******************************************************************************
+
+        line_color_reserve = num_line_colors
+        wsmgr_reserve = num_line_colors
+
+*	WHAT IS AVAILABLE ON THIS WORKSTATION?
+	call FGD_GQLWK (zwstype,error,max_pline,max_pmark,
+     .	            max_text,max_fill_area,max_pattern,max_color)
+	if (error .ne. 0) goto 1000
+
+	if (max_color .eq. 2) then
+*	   USE PATTERNS -- NOT ENOUGH COLORS AVAILABLE
+	   if (area_bundles) then
+*	      MISSING VALUE PATTERN
+	      call FGD_GSFAR(zwsid,1,gpattr,2,1)
+
+*	      LOWEST DATA PATTERN IS BLACK
+	      call FGD_GSFAR(zwsid,2,gsolid,1,1)
+
+	      if (shd_levels .eq. 1) goto 30
+*	      GO THRU AVAILABLE PATTERNS
+	      do 10 ndx = 1,shd_levels - 1
+#ifdef atc_gks
+	         call gspa (1.0,1.0)
+	         call gsparf (0.0,0.0)
+	         patt = 1 + ndx*9/(shd_levels-1)
+#else
+	         patt = 28 - ndx*14/(shd_levels-1)
+#endif
+	         call FGD_GSFAR(zwsid,ndx+2,gpattr,patt,1)
+10	      continue
+	   else
+	      call hatch_fill_rep (zwsid)
+	   endif
+	else
+
+*	   USE COLORS
+*	   type *, 'protect_used_colors', protect_used_colors
+	   if (protect_used_colors) then
+	      lo_color_ndx(zwsid) = max(hi_color_ndx(zwsid) + 1,
+     .						line_color_reserve + 1)
+	      protect_used_colors = .false.
+	   else
+	      lo_color_ndx(zwsid) = max(line_color_reserve + 1,
+     .						lo_color_ndx(zwsid))
+	   endif
+
+	   usable_colors = max_color - wsmgr_reserve - lo_color_ndx(zwsid)
+
+	   if (usable_colors .lt. shd_levels) then
+c	      write (6,'(/a)') ' PPL+ error: You''re attempting to use '//
+	      write (6,'(/a)') ' PPL warning: You''re attempting to use '//
+     .           'more colors than are available.'
+	      write (6,'(a/)') '             Using PPL SHASET RESET to re-use'//
+     .		 ' protected colors may help.'
+	      lo_color_ndx(zwsid) = max (line_color_reserve + 1,
+     .				  max_color - wsmgr_reserve - shd_levels)
+	   endif
+	   hi_color_ndx(zwsid) = lo_color_ndx(zwsid) + shd_levels - 1
+
+*	   type *, 'max_color, usable_colors, lo_color_ndx(zwsid),'// 
+*     .						' hi_color_ndx(zwsid)'
+*	   type *,  max_color, usable_colors, lo_color_ndx(zwsid), 
+*     .						  hi_color_ndx(zwsid)
+
+*	CHOOSE CUSTOM COLORS OR THE DEFAULT SELECTION
+	   if (custom_colors) then
+	      call setup_color_table (zwsid,lo_color_ndx(zwsid),shd_levels)
+	   else
+	      call set_default_colors (zwsid,zwstype,lo_color_ndx(zwsid),
+     .							shd_levels)
+	   end if
+
+	   if (.not. area_bundles) goto 30
+
+*	   NOW SET THE FILL REP
+	   do 20 ndx = 1,shd_levels
+	      call FGD_GSFAR(zwsid, ndx+lo_color_ndx(zwsid)+1, gsolid,
+     .                       1, lo_color_ndx(zwsid)-1+ndx)
+20	   continue
+	end if
+
+30	return
+
+*	FATAL ERROR
+1000	return
+
+	end
diff --git a/ppl/tmapadds/ws_line_bundles.F b/ppl/tmapadds/ws_line_bundles.F
new file mode 100644
index 0000000..cb1ab64
--- /dev/null
+++ b/ppl/tmapadds/ws_line_bundles.F
@@ -0,0 +1,117 @@
+        SUBROUTINE WS_LINE_BUNDLES(zwsid,zwstype)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that INCLUDEs this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*       Routine to set up the line bundles for generic WSs.
+*       J Davison JISAO/PMEL/TMAP 3.23.89
+*       *jd* 2.19.92 mod to support atc gks
+*       *jd* 8.10.93 mod to support XGKS line colors -- force setting
+*       *js* 7.31.97 mod to change call to gqlwk to query_xgks_wkstn
+
+*       *acm* 8/2001  add polymarker call for PLOT/SYMBOL=DOT  
+*       *acm* 4/2002  add polymarker calls for circles of different sizes
+*                     and colors 1-6 are colored dots, 7-12 are small circles
+*                     13-18 are larger circles.  /THICK makes them thicker.
+
+* gsplr: wkid, line index, line type, linewidth scale factor, color index
+* gspmr: wkid, marker index, marker type(dot=1), size (const for dot), color index
+
+*        *acm* 12/4/02 NOTE: With changes to gksm2ps.c which multiply the 
+*              size of the dots by 4, the output is consistent from 
+*              ferret metafiles transformed to postscript, from 
+*              "ferret -batch" output, and gif files.
+*       *acm* 2/2003 polymarker dot line bundles had not been set for pen > 6
+*  v600 *acm* 5/2006 User can change the number of line colors.
+*  PyFr *kms* 5/13 Add alpha channel (opaque)
+*  PyFr *kms* 7/13 Add white as color 7, grays start with 8; remove setup for monochrome
+
+        IMPLICIT NONE
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'plt_inc.decl'
+        INCLUDE 'PLT.INC'
+        INCLUDE 'pen_inc.decl'  ! with num_line_colors
+        INCLUDE 'PEN.INC'
+        INCLUDE 'save_colors.cmn'
+
+        integer zwsid, zwstype
+        integer j, fktr, marktype, index
+        real    thickness, dotsize, grey, frac
+
+*******************************************************************************
+
+        marktype = 1    ! polymarker type 1=dot
+
+*       COLOR WORKSTATIONS:
+*       pre-defined colors
+        call FGD_GSCR(zwsid,2,1.0,0.0,0.0,1.0)
+        call FGD_GSCR(zwsid,3,0.0,1.0,0.0,1.0)
+        call FGD_GSCR(zwsid,4,0.0,0.0,1.0,1.0)
+        call FGD_GSCR(zwsid,5,0.0,1.0,1.0,1.0)
+        call FGD_GSCR(zwsid,6,1.0,0.0,1.0,1.0) 
+        call FGD_GSCR(zwsid,7,1.0,1.0,1.0,1.0) 
+     
+! Set up initial values for further colors as grey
+! range them between 0.6,0.6,0.6 and 0.9,0.9,0.9
+
+        IF (num_line_colors .GT. 7) THEN
+           frac = (0.8-0.4)/FLOAT(num_line_colors - 7)
+           grey = 0.8
+           DO 40 j = 8, num_line_colors
+              call FGD_GSCR(zwsid,j,grey,grey,grey,1.0)
+              grey = grey - frac
+  40       CONTINUE
+        ENDIF
+
+        IF (saved_line_colors .GT. 0) THEN
+           CALL restore_saved_line_colors (zwsid)
+        ENDIF
+
+! Set line bundles
+
+        do 20 j = 1, num_line_colors
+           do 10 fktr = 1,3     ! thickness
+              index = (fktr-1)*num_line_colors+j
+              dotsize = 6.0 + fktr
+              CALL FGD_GSPMR(zwsid, index, marktype, dotsize, j)
+              thickness = fktr
+              CALL FGD_GSPLR(zwsid, index, 1, thickness, j)
+10         continue
+20      continue
+
+        return
+
+        end
diff --git a/ppl/tmapadds/ws_line_spectrum.F b/ppl/tmapadds/ws_line_spectrum.F
new file mode 100644
index 0000000..24cb1c0
--- /dev/null
+++ b/ppl/tmapadds/ws_line_spectrum.F
@@ -0,0 +1,188 @@
+	SUBROUTINE WS_LINE_SPECTRUM (zwsid,zwstype, low_index)
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that INCLUDEs this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Routine to set up the line bundles for color-line plots
+* PyFr *kms* 5/13 Add alpha channel (opaque)
+
+        IMPLICIT NONE
+	include 'pltcom_dat.decl'
+	include 'PLTCOM.DAT'
+	include 'gkscm1_inc.decl'
+	include 'GKSCM1.INC'
+	include 'gkscm2.cmn'
+	include 'ppl_in_ferret.cmn'
+        include 'ws_types.cmn'
+        include 'shade_vars.cmn'
+	include 'tmap_dims.parm'
+        include 'xplot_setup.cmn'
+        INCLUDE 'gkspar.inc'
+        INCLUDE 'parampl5_dat.decl'
+        INCLUDE 'PARAMPL5.DAT'
+        INCLUDE 'plt_inc.decl'
+        INCLUDE 'PLT.INC'
+        INCLUDE 'pen_inc.decl'  ! with num_line_colors
+        INCLUDE 'PEN.INC'
+	INCLUDE 'save_colors.cmn'
+	INCLUDE 'errmsg.parm'
+
+	integer		zwsid,zwstype,i,j, low_index
+
+#ifdef atc_gks
+	integer 	ltype(6)
+	data	 	ltype/1,2,3,4,-1001,-1004/
+#else
+	integer 	ltype(6)
+	data		ltype/1,2,3,4,-3,-4/
+#endif
+
+	integer		max_pline,max_pmark,max_text,max_fill_area
+	integer		max_pattern,max_color,error
+	integer		fktr, marktype, index, line_color_reserve,
+     .			icolr, nthick, status, usable_colors, ndx
+
+	real	thickness, dotsize, frac, r_val,g_val,b_val,a_val
+	CHARACTER*100   err_msg
+
+
+*******************************************************************************
+*	WHAT IS AVAILABLE ON THIS WORKSTATION?
+	call FGD_GQLWK (zwstype,error,max_pline,max_pmark,
+     .	            max_text,max_fill_area,max_pattern,max_color)
+	if (error .ne. 0) goto 1000
+
+        marktype = 1    ! polymarker type 1=dot
+
+*	COLOR OR MONOCHROME?
+	if (max_color .le. 2) goto 100
+
+*	COLOR WORKSTATIONS:
+
+* Set up a color spectrum in the remaining space.
+
+	IF ((max_color - num_line_colors) .LT. 0) GOTO 200
+
+	line_color_reserve = num_line_colors
+	
+*   USE COLORS
+        if (protect_used_colors) then
+           lo_color_ndx(zwsid) = MAX(hi_color_ndx(zwsid) + 1, line_color_reserve + 1)
+           protect_used_colors = .false.
+        else
+           lo_color_ndx(zwsid) = MAX(line_color_reserve + 1, lo_color_ndx(zwsid))
+        endif
+
+        usable_colors = max_color - line_color_reserve - lo_color_ndx(zwsid)
+
+        if (usable_colors .lt. shd_levels+1) then
+           write (6,'(/a)') ' PPL warning: You''re attempting to use '//
+     .           'more colors than are available.'
+           write (6,'(a/)') '             Using PPL SHASET RESET to re-use'//
+     .		 ' protected colors may help.'
+           lo_color_ndx(zwsid) = max (line_color_reserve + 1,
+     .       max_color - line_color_reserve - (shd_levels+1))
+        endif
+        hi_color_ndx(zwsid) = lo_color_ndx(zwsid) + (shd_levels+1) - 1
+
+* Plus one more for the bad-value color (e.g. missing data drawn as gray)
+
+        hi_color_ndx(zwsid) = hi_color_ndx(zwsid) + 1
+	bad_ribbon_ndx = (shd_levels+1) + 1
+
+*	CHOOSE CUSTOM COLORS OR THE DEFAULT SELECTION
+        if (custom_colors) then
+           call setup_color_table (zwsid,lo_color_ndx(zwsid),shd_levels)
+        else
+           call set_default_colors (zwsid,zwstype,lo_color_ndx(zwsid),
+     .							shd_levels)
+        end if
+
+
+* Set line bundles
+
+	nthick = 3
+	low_index = MAX(num_line_colors* nthick + 2, lo_color_ndx(zwsid))
+
+	do 20 j = 1, shd_levels
+	   do 10 fktr = 1,nthick     ! thickness
+              index = low_index + (fktr-1) * (shd_levels+1) + j
+              icolr = j + lo_color_ndx(zwsid) - 1
+              dotsize = 6.0 + fktr
+              CALL FGD_GSPMR(zwsid, index, marktype, dotsize, icolr)
+              thickness = fktr
+              CALL FGD_GSPLR(zwsid, index, 1, thickness, icolr)
+10	   continue
+20	continue
+
+* Initialize the color for bad-data asc
+
+        r_val = 0.75
+        g_val = 0.75
+        b_val = 0.75
+        a_val = 1.00
+
+* What is ribbon_miss?  If user asked for a palette with /missing= 
+* then set that color.
+
+	IF (ribbon_miss(1) .GE. 0.) THEN
+           r_val = ribbon_miss(1)/100.
+           g_val = ribbon_miss(2)/100.
+           b_val = ribbon_miss(3)/100.
+           a_val = ribbon_miss(4)/100.
+	ENDIF
+	ndx = lo_color_ndx(zwsid)+shd_levels
+	CALL FGD_GSCR(zwsid,ndx,r_val,g_val,b_val,a_val)
+
+	do 40 j = shd_levels + 1, shd_levels + 1
+	   do 30 fktr = 1,nthick     ! thickness
+              index = low_index + (fktr-1) * (shd_levels+1) + j
+              icolr = j + lo_color_ndx(zwsid) - 1
+              dotsize = 6.0 + fktr
+              CALL FGD_GSPMR(zwsid, index, marktype, dotsize, icolr)
+              thickness = fktr
+              CALL FGD_GSPLR(zwsid, index, 1, thickness, icolr)
+30	   continue
+40	continue
+
+* ERROR
+1000	return
+
+ 100    err_msg = 'Not a color worksatation, cannot set spectrum for color lines'
+        CALL errmsg (ferr_out_of_range, status, err_msg, *1000)
+
+ 200    err_msg = 'Too many colors in color spectrum for ribbon plot'
+        CALL errmsg (ferr_out_of_range, status, err_msg, *1000)
+	end
diff --git a/ppl/tmapadds/ws_types_init.F b/ppl/tmapadds/ws_types_init.F
new file mode 100644
index 0000000..95437f6
--- /dev/null
+++ b/ppl/tmapadds/ws_types_init.F
@@ -0,0 +1,102 @@
+	BLOCK DATA WS_TYPES_INIT
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Initialize wstype constants for either DEC or ATC GKS
+*	J Davison 2.13.92
+*	Mod to support XGKS *jd* 8.10.93
+
+        IMPLICIT NONE
+#   ifndef atc_gks
+#      ifndef xgks
+	include		'/usr/include/GKS3D/GKS3Dforbnd.f'
+#      else
+	include		'gkspar.inc'
+#      endif
+#   endif
+	include		'ws_types.cmn'
+        include         'gkscm2.cmn'
+
+*******************************************************************************
+
+#ifdef atc_gks
+*	ATC GKS values for workstation types
+
+        data         	ws_xwindow/5350/,
+     .			ws_uis/-1/,
+     .                  ws_meta_in/1001/,
+     .                  ws_meta_out/1002/,
+     .                  ws_ps_mono/1901/,
+     .                  ws_ps_color/1901/,
+     .                  ws_tek4014/2500/,
+     .                  ws_tek4107/3100/
+#elif xgks
+*	 XGKS values for workstation types
+
+      data              ws_xwindow/4/,
+     .			ws_uis/-1/,
+     .                  ws_meta_in/-1/,
+     .                  ws_meta_out/-1/,
+     .                  ws_ps_mono/-1/,
+     .                  ws_ps_color/-1/,
+     .                  ws_tek4107/-1/
+#else
+*	DEC GKS values for workstation types
+
+      data              ws_xwindow/0/,
+     .			ws_uis/gvsii/,
+     .                  ws_meta_in/gminpt/,
+     .                  ws_meta_out/gmoutp/,
+     .                  ws_ps_mono/gptsc/,
+     .                  ws_ps_color/gcptsc/,
+     .                  ws_tek4014/gteko/,
+     .                  ws_tek4107/gt41o/
+#endif
+
+*	INITIALIZE METAFILE NAME
+
+	data		meta_file/'ferret.png'/
+	data		save_on_exit/.FALSE./
+	data		imgname_sent/.FALSE./
+
+
+	end
+
+
+
+
+
+
diff --git a/ppl/tmapadds/xgrinpt_blkdat.F b/ppl/tmapadds/xgrinpt_blkdat.F
new file mode 100644
index 0000000..12ac95d
--- /dev/null
+++ b/ppl/tmapadds/xgrinpt_blkdat.F
@@ -0,0 +1,54 @@
+#ifdef FORTRAN_90
+
+	BLOCK DATA XGRINPT_BLKDAT
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Yet another block data, for linux/f90 install
+*       Initialize has_new_mouse in here
+*
+*       v5.11 *kob* 5/00 
+
+        IMPLICIT NONE
+	include 'xgrinpt.cmn'
+
+	DATA	has_new_mouse/ .FALSE. /   ! at program initialization
+	end
+#else
+	subroutine xgrinpt_foobar
+	return
+	end
+#endif
diff --git a/ppl/tmapadds/yabd.F b/ppl/tmapadds/yabd.F
new file mode 100644
index 0000000..0889edc
--- /dev/null
+++ b/ppl/tmapadds/yabd.F
@@ -0,0 +1,56 @@
+#ifdef FORTRAN_90
+
+	BLOCK DATA YABD
+
+*
+*
+*  This software was developed by the Thermal Modeling and Analysis
+*  Project(TMAP) of the National Oceanographic and Atmospheric
+*  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+*  hereafter referred to as NOAA/PMEL/TMAP.
+*
+*  Access and use of this software shall impose the following
+*  obligations and understandings on the user. The user is granted the
+*  right, without any fee or cost, to use, copy, modify, alter, enhance
+*  and distribute this software, and any derivative works thereof, and
+*  its supporting documentation for any purpose whatsoever, provided
+*  that this entire notice appears in all copies of the software,
+*  derivative works and supporting documentation.  Further, the user
+*  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+*  the use of this software or in any product that includes this
+*  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+*  in any advertising or publicity to endorse or promote any products
+*  or commercial entity unless specific written permission is obtained
+*  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+*  is not obligated to provide the user with any support, consulting,
+*  training or assistance of any kind with regard to the use, operation
+*  and performance of this software nor to provide the user with any
+*  updates, revisions, new versions or "bug fixes".
+*
+*  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+*  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+*  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+*  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+*  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+*  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+*
+*
+*	Yet another block data, for linux/f90 install
+*	Initialize ppl_in_ferret here
+*	*jd* 12.96
+
+        IMPLICIT NONE
+
+* special COMMON to let this routine know if FERRET is in control
+	include 'ppl_in_ferret.cmn'
+
+	DATA	PPL_in_FERRET / .FALSE. /	
+
+	end
+#else
+	subroutine yabd_foobar
+	return
+	end
+#endif
diff --git a/pviewmod/.project b/pviewmod/.project
new file mode 100644
index 0000000..4790165
--- /dev/null
+++ b/pviewmod/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>pviewmod</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>
diff --git a/pviewmod/.pydevproject b/pviewmod/.pydevproject
new file mode 100644
index 0000000..0a8d68f
--- /dev/null
+++ b/pviewmod/.pydevproject
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/pviewmod</path>
+</pydev_pathproperty>
+
+</pydev_project>
diff --git a/pviewmod/README.txt b/pviewmod/README.txt
new file mode 100644
index 0000000..6fbb9df
--- /dev/null
+++ b/pviewmod/README.txt
@@ -0,0 +1,2 @@
+This is an Eclipse PyDev project module; thus
+the reason for the .project and .pydevproject files.
diff --git a/pviewmod/__init__.py b/pviewmod/__init__.py
new file mode 100644
index 0000000..386f260
--- /dev/null
+++ b/pviewmod/__init__.py
@@ -0,0 +1,244 @@
+'''
+The PipedViewer class is used to create, send commands, and shutdown viewers 
+in this module.  Currently, the only known viewer types are "PipedViewerPQ" 
+and "PipedImagerPQ".
+
+This package was developed by the Thermal Modeling and Analysis Project 
+(TMAP) of the National Oceanographic and Atmospheric Administration's (NOAA) 
+Pacific Marine Environmental Lab (PMEL).
+'''
+
+from multiprocessing import Pipe
+import sys
+
+class PipedViewer(object):
+    '''
+    Creates and starts a PipedViewer of one of the supported viewer 
+    types.  Provides methods for interacting with the PipedViewer.
+    '''
+    def __init__(self, viewertype):
+        '''
+        Create and start a PipedViewer of one of the supported viewer 
+        types.  The viewer will probably not be displayed until the 
+        { "action":"show" } command is submitted to the viewer cmndpipe 
+        using submitCommand.
+
+        Currently supported viewer types are:
+            "PipedViewerPQ": PipedViewerPQ using PyQt4
+            "PipedImagerPQ": PipedImagerPQ using PyQt4
+        '''
+        super(PipedViewer, self).__init__()
+        (self.__cmndrecvpipe, self.__cmndsendpipe) = Pipe(False)
+        (self.__rspdrecvpipe, self.__rspdsendpipe) = Pipe(False)
+        if viewertype == "PipedViewerPQ":
+            try:
+                from pipedviewerpq import PipedViewerPQProcess
+            except ImportError:
+                raise TypeError("The PQ viewers requires PyQt4")
+            self.__vprocess = PipedViewerPQProcess(self.__cmndrecvpipe,
+                                                   self.__rspdsendpipe)
+        elif viewertype == "PipedImagerPQ":
+            try:
+                from pipedimagerpq import PipedImagerPQProcess
+            except ImportError:
+                raise TypeError("The PQ viewers requires PyQt4")
+            self.__vprocess = PipedImagerPQProcess(self.__cmndrecvpipe,
+                                                   self.__rspdsendpipe)
+        else:
+            raise TypeError("Unknown viewer type %s" % str(viewertype))
+        self.__vprocess.start()
+        self.__shutdown = False
+
+    def submitCommand(self, cmnd):
+        '''
+        Submit the command cmnd to the command pipe for the viewer.
+        '''
+        self.__cmndsendpipe.send(cmnd)
+
+    def checkForResponse(self, timeout = 0.0):
+        '''
+        Check for a response from the viewer.  The argument timeout
+        (a number) is the maximum time in seconds to block (default:
+        0.0; returns immediately).  If timeout is None, it will block
+        until something is read.  Returns the response from the viewer,
+        or None if there was no response in the allotted time.
+        '''
+        if self.__rspdrecvpipe.poll(timeout):
+            response = self.__rspdrecvpipe.recv()
+        else:
+            response = None
+        return response
+
+    def waitForViewerExit(self):
+        '''
+        Wait for all the submitted commands to be consumed and the
+        viewer  to return.  The command { "action":"exit" } should
+        have been the last command submitted to the command pipe
+        before calling this method.
+        '''
+        self.__cmndsendpipe.close()
+        self.__rspdrecvpipe.close()
+        self.__vprocess.join()
+
+    def getViewerExitCode(self):
+        return self.__vprocess.exitcode
+
+
+if __name__ == "__main__":
+    # vertices of a pentagon (roughly) centered in a 1000 x 1000 square
+    pentagonpts = ( (504.5, 100.0), (100.0, 393.9),
+                    (254.5, 869.4), (754.5, 869.4),
+                    (909.0, 393.9),  )
+    # create the list of commands to submit
+    drawcmnds = []
+    drawcmnds.append( { "action":"setTitle", "title":"Tester" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"clear", "color":"black"} )
+    drawcmnds.append( { "action":"dpi"} )
+    drawcmnds.append( { "action":"antialias", "antialias":True } )
+    drawcmnds.append( { "action":"resize",
+                        "width":500,
+                        "height":500 } )
+    drawcmnds.append( { "action":"beginView",
+                        "viewfracs":{"left":0.0, "right":0.5,
+                                     "top":0.5, "bottom":1.0},
+                        "clip":True } )
+    drawcmnds.append( { "action":"drawRectangle",
+                        "left": 5, "right":245, 
+                        "top":245, "bottom":495,
+                        "fill":{"color":"green", "alpha":128} } )
+    mypentapts = [ (.25 * ptx, .25 * pty + 250) for (ptx, pty) in pentagonpts ]
+    drawcmnds.append( { "action":"drawPolygon",
+                        "points":mypentapts,
+                        "fill":{"color":"blue"},
+                        "outline":{"color":"black",
+                                   "width": 5,
+                                   "style":"solid",
+                                   "capstyle":"round",
+                                   "joinstyle":"round" } } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=480",
+                        "font":{"family":"Times", "size":50},
+                        "fill":{"color":"red"},
+                        "location":(50,480) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=430",
+                        "font":{"family":"Times", "size":50},
+                        "fill":{"color":"red"},
+                        "location":(50,430) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=380",
+                        "font":{"family":"Times", "size":50},
+                        "fill":{"color":"red"},
+                        "location":(50,380) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=330",
+                        "font":{"family":"Times", "size":50},
+                        "fill":{"color":"red"},
+                        "location":(50,330) } )
+    drawcmnds.append( { "action":"endView" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"beginView",
+                        "viewfracs":{"left":0.0, "right":1.0,
+                                     "top":0.0, "bottom":1.0},
+                        "clip":True } )
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (100,  50),
+                                   (100, 150),
+                                   (100, 250),
+                                   (100, 350),
+                                   (100, 450) ),
+                        "symbol":".",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (150,  50),
+                                   (150, 150),
+                                   (150, 250),
+                                   (150, 350),
+                                   (150, 450) ),
+                        "symbol":"o",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (200,  50),
+                                   (200, 150),
+                                   (200, 250),
+                                   (200, 350),
+                                   (200, 450) ),
+                        "symbol":"+",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (250,  50),
+                                   (250, 150),
+                                   (250, 250),
+                                   (250, 350),
+                                   (250, 450) ),
+                        "symbol":"x",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (300,  50),
+                                   (300, 150),
+                                   (300, 250),
+                                   (300, 350),
+                                   (300, 450) ),
+                        "symbol":"*",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (350,  50),
+                                   (350, 150),
+                                   (350, 250),
+                                   (350, 350),
+                                   (350, 450) ),
+                        "symbol":"^",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (400,  50),
+                                   (400, 150),
+                                   (400, 250),
+                                   (400, 350),
+                                   (400, 450) ),
+                        "symbol":"#",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawMultiline",
+                        "points":( (350,  50),
+                                   (200, 150),
+                                   (400, 250),
+                                   (300, 350),
+                                   (150, 250),
+                                   (100, 450) ),
+                        "pen": {"color":"white",
+                                "width":3,
+                                "style":"dash",
+                                "capstyle":"round",
+                                "joinstyle":"round"} } )
+    drawcmnds.append( { "action":"endView" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"exit" } )
+    # Test each known viewer.
+    for viewername in ( "PipedViewerPQ", ):
+        print "Testing Viewer %s" % viewername
+        # create the viewer
+        pviewer = PipedViewer(viewername)
+        # submit the commands, pausing after each "show" command
+        for cmd in drawcmnds:
+            print "Command: %s" % str(cmd)
+            pviewer.submitCommand(cmd)
+            response = pviewer.checkForResponse()
+            while response:
+                print "Response: %s" % str(response)
+                response = pviewer.checkForResponse()
+            if cmd["action"] == "show":
+                raw_input("Press Enter to continue")
+        # end of the commands - shut down and check return value
+        pviewer.waitForViewerExit()
+        result = pviewer.getViewerExitCode()
+        if result != 0:
+            sys.exit(result)
+        else:
+            print "Done with %s" % viewername
diff --git a/pviewmod/cmndhelperpq.py b/pviewmod/cmndhelperpq.py
new file mode 100644
index 0000000..3939dc0
--- /dev/null
+++ b/pviewmod/cmndhelperpq.py
@@ -0,0 +1,448 @@
+'''
+CmndHelperPQ is a helper class for dealing with commands
+sent to a PyQt piped viewer.
+
+This package was developed by the Thermal Modeling and Analysis
+Project (TMAP) of the National Oceanographic and Atmospheric
+Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
+'''
+
+from PyQt4.QtCore import Qt, QPointF, QSizeF
+from PyQt4.QtGui import QBrush, QColor, QFont, QPainterPath, QPen
+
+
+class SidesRectF(object):
+    '''
+    Trivial helper class for defining a rectangle with floating point
+    values for the left-x, top-y, right-x, and bottom-y edges.
+    '''
+    def __init__(self, left, top, right, bottom):
+        '''
+        Create a SidesRectF with the given left, top, right,
+        and bottom as float values.
+        '''
+        super(SidesRectF, self).__init__()
+        self.__left = float(left)
+        self.__top = float(top)
+        self.__right = float(right)
+        self.__bottom = float(bottom)
+
+    def left(self):
+        '''
+        Return the left value as a float.
+        '''
+        return self.__left
+
+    def setLeft(self, val):
+        '''
+        Set the SidesRectF left as a float value of the argument.
+        '''
+        self.__left = float(val)
+
+    def top(self):
+        '''
+        Return the top value as a float.
+        '''
+        return self.__top
+
+    def setTop(self, val):
+        '''
+        Set the SidesRectF top as a float value of the argument.
+        '''
+        self.__top = float(val)
+
+    def right(self):
+        '''
+        Return the right value as a float.
+        '''
+        return self.__right
+
+    def setRight(self, val):
+        '''
+        Set the SidesRectF right as a float value of the argument.
+        '''
+        self.__right = float(val)
+
+    def bottom(self):
+        '''
+        Return the bottom value as a float.
+        '''
+        return self.__bottom
+
+    def setBottom(self, val):
+        '''
+        Set the SidesRectF bottom as a float value of the argument.
+        '''
+        self.__bottom = float(val)
+
+
+class SymbolPath(object):
+    '''
+    Trivial helper class for defining a symbol
+    '''
+    def __init__(self, painterpath, isfilled):
+        '''
+        Create a SymbolPath representing a symbol.
+
+        Arguments:
+            painterpath: the QPainterPath representing this symbol
+            isfilled: if True, the symbol should be drawn with a
+                    solid brush; if False, the symbol should be
+                    drawn with a solid pen
+        '''
+        super(SymbolPath, self).__init__()
+        self.__painterpath = painterpath
+        self.__isfilled = isfilled
+
+    def painterPath(self):
+        '''
+        Return the QPainterPath for this symbol
+        '''
+        return self.__painterpath
+
+    def isFilled(self):
+        '''
+        Return True if the symbol should be drawn with a solid brush;
+        return False if the symbol should be drawn with a solid pen.
+        '''
+        return self.__isfilled
+
+
+class CmndHelperPQ(object):
+    '''
+    Helper class of static methods for dealing with commands
+    sent to a PyQt piped viewer.
+    '''
+    def __init__(self, viewer):
+        '''
+        Creates a cmndpipe command helper.  The widget viewer
+        is only used for determining the default font and for
+        translation of error messages.
+        '''
+        super(CmndHelperPQ, self).__init__()
+        self.__viewer = viewer
+        self.__symbolpaths = { }
+
+    def getFontFromCmnd(self, fontinfo):
+        '''
+        Returns a QFont based on the information in the dictionary
+        fontinfo.
+
+        Recognized keys in the font dictionary are:
+            "family": font family name (string)
+            "size": text size in points (1/72 inches)
+            "italic": italicize? (False/True)
+            "bold": make bold? (False/True)
+            "underline": underline?  (False/True)
+        '''
+        try:
+            myfont = QFont(fontinfo["family"])
+        except KeyError:
+            myfont = self.__viewer.font()
+        try:
+            myfont.setPointSizeF(fontinfo["size"])
+        except KeyError:
+            pass
+        try:
+            myfont.setItalic(fontinfo["italic"])
+        except KeyError:
+            pass
+        try:
+            myfont.setBold(fontinfo["bold"])
+        except KeyError:
+            pass
+        try:
+            myfont.setUnderline(fontinfo["underline"])
+        except KeyError:
+            pass
+        return myfont
+
+    def getBrushFromCmnd(self, brushinfo):
+        '''
+        Returns a QBrush based on the information in the dictionary
+        brushinfo.  A ValueError is raised if the value for the
+        "style" key, if given, is not recognized.
+
+        Recognized keys in the fill dictionary are:
+            "color": color name or 24-bit RGB integer value
+                         (eg, 0xFF0088)
+            "alpha": alpha value from 0 (transparent) to 255 (opaque)
+            "style": brush style name ("solid", "dense1" to "dense7",
+                         "none", "hor", "ver", "cross",
+                         "bdiag", "fdiag", "diagcross")
+        '''
+        try:
+            mycolor = self.getColorFromCmnd(brushinfo)
+            mybrush = QBrush(mycolor)
+        except KeyError:
+            mybrush = QBrush()
+        try:
+            mystyle = brushinfo["style"]
+            if mystyle == "solid":
+                mystyle = Qt.SolidPattern
+            elif mystyle == "dense1":
+                mystyle = Qt.Dense1Pattern
+            elif mystyle == "dense2":
+                mystyle = Qt.Dense2Pattern
+            elif mystyle == "dense3":
+                mystyle = Qt.Dense3Pattern
+            elif mystyle == "dense4":
+                mystyle = Qt.Dense4Pattern
+            elif mystyle == "dense5":
+                mystyle = Qt.Dense5Pattern
+            elif mystyle == "dense6":
+                mystyle = Qt.Dense6Pattern
+            elif mystyle == "dense7":
+                mystyle = Qt.Dense7Pattern
+            elif mystyle == "none":
+                mystyle = Qt.NoBrush
+            elif mystyle == "hor":
+                mystyle = Qt.HorPattern
+            elif mystyle == "ver":
+                mystyle = Qt.VerPattern
+            elif mystyle == "cross":
+                mystyle = Qt.CrossPattern
+            elif mystyle == "bdiag":
+                mystyle = Qt.BDiagPattern
+            elif mystyle == "fdiag":
+                mystyle = Qt.FDiagPattern
+            elif mystyle == "diagcross":
+                mystyle = Qt.DiagCrossPattern
+            else:
+                raise ValueError( self.__viewer.tr( \
+                      "Unknown brush style %1").arg(str(mystyle)) )
+            mybrush.setStyle(mystyle)
+        except KeyError:
+            pass
+        return mybrush
+
+    def getPenFromCmnd(self, peninfo):
+        '''
+        Returns a QPen based on the information in the dictionary
+        peninfo.  A ValueError is raised if the value for the
+        "style", "capstyle", or "joinstyle" key, if given, is not
+        recognized.
+
+        Recognized keys in the outline dictionary are:
+            "color": color name or 24-bit RGB integer value
+                         (eg, 0xFF0088)
+            "alpha": alpha value from 0 (transparent) to 255 (opaque)
+            "width": pen width in points (1/72 inches); possibly 
+                     further scaled by the width scaling factor 
+            "style": pen style name ("solid", "dash", "dot", "dashdot",
+                         "dashdotdot")
+            "capstyle": pen cap style name ("square", "flat", "round")
+            "joinstyle": pen join style name ("bevel", "miter", "round")
+        '''
+        try:
+            mycolor = self.getColorFromCmnd(peninfo)
+            mypen = QPen(mycolor)
+        except KeyError:
+            mypen = QPen()
+        try:
+            penwidth  = float(peninfo["width"])
+            penwidth *= self.__viewer.widthScalingFactor()
+            mypen.setWidthF(penwidth)
+        except KeyError:
+            pass
+        try:
+            mystyle = peninfo["style"]
+            if mystyle == "solid":
+                mystyle = Qt.SolidLine
+            elif mystyle == "dash":
+                mystyle = Qt.DashLine
+            elif mystyle == "dot":
+                mystyle = Qt.DotLine
+            elif mystyle == "dashdot":
+                mystyle = Qt.DashDotLine
+            elif mystyle == "dashdotdot":
+                mystyle = Qt.DashDotDotLine
+            else:
+                raise ValueError( self.__viewer.tr( \
+                      "Unknown pen style %1").arg(str(mystyle)) )
+            mypen.setStyle(mystyle)
+        except KeyError:
+            pass
+        try:
+            mystyle = peninfo["capstyle"]
+            if mystyle == "square":
+                mystyle = Qt.SquareCap
+            elif mystyle == "flat":
+                mystyle = Qt.FlatCap
+            elif mystyle == "round":
+                mystyle = Qt.RoundCap
+            else:
+                raise ValueError( self.__viewer.tr( \
+                      "Unknown pen cap style %1").arg(str(mystyle)) )
+            mypen.setCapStyle(mystyle)
+        except KeyError:
+            pass
+        try:
+            mystyle = peninfo["joinstyle"]
+            if mystyle == "bevel":
+                mystyle = Qt.BevelJoin
+            elif mystyle == "miter":
+                mystyle = Qt.MiterJoin
+            elif mystyle == "round":
+                mystyle = Qt.RoundJoin
+            else:
+                raise ValueError( self.__viewer.tr( \
+                      "Unknown pen join style %1").arg(str(mystyle)) )
+            mypen.setJoinStyle(mystyle)
+        except KeyError:
+            pass
+        return mypen
+
+    def getSymbolFromCmnd(self, symbol):
+        '''
+        Returns a SymbolPath of the specified symbol.
+        Recognized symbols are:
+            '.' (period): filled circle
+            'o' (lowercase oh): unfilled circle
+            '+': plus mark
+            'x' (lowercase ex): x mark
+            '*': asterisk
+            '^': triangle
+            "#": square
+
+        The path is drawn for a 100 x 100 unit square where
+        the origin is in the center of the square.
+        '''
+        # check if this symbol has already been created
+        try:
+            sympath = self.__symbolpaths[symbol]
+            return sympath
+        except KeyError:
+            pass
+        # new symbol - create a SymbolPath for it
+        if symbol == '.':
+            path = QPainterPath()
+            path.addEllipse(-20.0, -20.0, 40.0, 40.0)
+            sympath = SymbolPath(path, True)
+        elif symbol == 'o':
+            path = QPainterPath()
+            path.addEllipse(-40.0, -40.0, 80.0, 80.0)
+            sympath = SymbolPath(path, False)
+        elif symbol == 'x':
+            path = QPainterPath( QPointF(-30.0, -30.0) )
+            path.lineTo( 30.0,  30.0)
+            path.moveTo(-30.0,  30.0)
+            path.lineTo( 30.0, -30.0)
+            sympath = SymbolPath(path, False)
+        elif symbol == '+':
+            path = QPainterPath( QPointF(0.0, -40.0) )
+            path.lineTo(  0.0, 40.0)
+            path.moveTo(-40.0,  0.0)
+            path.lineTo( 40.0,  0.0)
+            sympath = SymbolPath(path, False)
+        elif symbol == '*':
+            path = QPainterPath( QPointF(0.0, -40.0) )
+            path.lineTo(  0.0,    40.0)
+            path.moveTo(-34.641, -20.0)
+            path.lineTo( 34.641,  20.0)
+            path.moveTo(-34.641,  20.0)
+            path.lineTo( 34.641, -20.0)
+            sympath = SymbolPath(path, False)
+        elif symbol == '^':
+            path = QPainterPath( QPointF(-40.0, 30.0) )
+            path.lineTo( 0.0, -39.282)
+            path.lineTo(40.0,  30.0)
+            path.closeSubpath()
+            sympath = SymbolPath(path, False)
+        elif symbol == '#':
+            path = QPainterPath()
+            path.addRect(-35.0, -35.0, 70.0, 70.0)
+            sympath = SymbolPath(path, False)
+        else:
+            raise ValueError( self.tr( \
+                  "Unrecognized symbol '%1'").arg(str(symbol)) )
+        # save and return the SymbolPath
+        self.__symbolpaths[symbol] = sympath
+        return sympath
+
+    def getSizeFromCmnd(self, sizeinfo):
+        '''
+        Returns a QSizeF based on the information in the dictionary
+        sizeinfo.  Recognized keys are "width" and "height", and
+        correspond to those float values in the QSizeF.  Values not
+        given in sizeinfo are assigned as zero in the returned QSizeF.
+        '''
+        myrect = QSizeF(0.0, 0.0)
+        try:
+            myrect.setWidth(float(sizeinfo["width"]))
+        except KeyError:
+            pass
+        try:
+            myrect.setHeight(float(sizeinfo["height"]))
+        except KeyError:
+            pass
+        return myrect
+
+    def getSidesFromCmnd(self, rectinfo):
+        '''
+        Returns a SidesQRectF based on the information in the dictionary
+        rectinfo.  Recognized keys are "left", "top", "right", and "bottom",
+        and correspond to those float values in the SidesQRectF.  Default
+        values: "left": 0.0, "top": 0.0, "right":1.0, "bottom":1.0
+        '''
+        myrect = SidesRectF(left=0.0, top=0.0, right=1.0, bottom=1.0)
+        try:
+            myrect.setLeft(float(rectinfo["left"]))
+        except KeyError:
+            pass
+        try:
+            myrect.setTop(float(rectinfo["top"]))
+        except KeyError:
+            pass
+        try:
+            myrect.setRight(float(rectinfo["right"]))
+        except KeyError:
+            pass
+        try:
+            myrect.setBottom(float(rectinfo["bottom"]))
+        except KeyError:
+            pass
+        return myrect
+
+    def getColorFromCmnd(self, colorinfo):
+        '''
+        Returns a QColor based on the information in the dictionary
+        colorinfo.  Raises a KeyError if the "color" key is not given.
+
+        Recognized keys are:
+            "color": color name or 24-bit RGB integer value
+                         (eg, 0xFF0088)
+            "alpha": alpha value from 0 (transparent) to 255 (opaque)
+        '''
+        colordata = colorinfo["color"]
+        mycolor = QColor(colordata)
+        if not mycolor.isValid():
+            raise ValueError( self.__scene.tr( \
+                  "Invalid color '%1'").arg(str(colordata)) )
+        try:
+            mycolor.setAlpha(int(colorinfo["alpha"]))
+        except KeyError:
+            pass
+        return mycolor
+
+    def computeARGB32PreMultInt(self, color):
+        '''
+        Returns the Format_ARGB32_Premultiplied integer value
+        of the given QColor.
+        '''
+        (redint, greenint, blueint, alphaint) = color.getRgb()
+        # Multiply the RGB values by the alpha factor
+        alphafactor = alphaint / 255.0
+        redint = int( redint * alphafactor + 0.5 )
+        if redint > alphaint:
+            redint = alphaint
+        greenint = int( greenint * alphafactor + 0.5 )
+        if greenint > alphaint:
+            greenint = alphaint
+        blueint = int( blueint * alphafactor + 0.5 )
+        if blueint > alphaint:
+            blueint = alphaint
+        fillint = ((alphaint * 256 + redint) * 256 + \
+                   greenint) * 256 + blueint
+        return fillint
+
diff --git a/pviewmod/pipedimagerpq.py b/pviewmod/pipedimagerpq.py
new file mode 100644
index 0000000..52abdc8
--- /dev/null
+++ b/pviewmod/pipedimagerpq.py
@@ -0,0 +1,891 @@
+'''
+PipedImagerPQ is a graphics viewer application written in PyQt4
+that receives its images and commands primarily from another
+application through a pipe.  A limited number of commands are
+provided by the viewer itself to allow saving and some manipulation
+of the displayed image.  The controlling application, however, may
+be unaware of these modifications made to the image.
+
+PipedImagerPQProcess is used to create and run a PipedImagerPQ.
+
+This package was developed by the Thermal Modeling and Analysis
+Project (TMAP) of the National Oceanographic and Atmospheric
+Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
+'''
+
+import sip
+try:
+    sip.setapi('QVariant', 2)
+except AttributeError:
+    pass
+
+from PyQt4.QtCore import Qt, QPointF, QRectF, QSize, QString, QTimer
+from PyQt4.QtGui  import QAction, QApplication, QBrush, QColor, QDialog, \
+                         QFileDialog, QImage, QLabel, QMainWindow, \
+                         QMessageBox, QPainter, QPalette, QPen, QPixmap, \
+                         QPolygonF, QPushButton, QScrollArea
+
+from cmndhelperpq import CmndHelperPQ
+from scaledialogpq import ScaleDialogPQ
+from multiprocessing import Pipe, Process
+import sys
+import time
+import os
+import signal
+
+
+class PipedImagerPQ(QMainWindow):
+    '''
+    A PyQt graphics viewer that receives images and commands through
+    a pipe.
+
+    A command is a dictionary with string keys.  For example,
+        { "action":"save",
+          "filename":"ferret.png",
+          "fileformat":"png" }
+
+    The command { "action":"exit" } will shutdown the viewer and is
+    the only way the viewer can be closed.  GUI actions can only hide
+    the viewer.
+    '''
+
+    def __init__(self, cmndpipe, rspdpipe):
+        '''
+        Create a PyQt viewer which reads commands from the Pipe
+        cmndpipe and writes responses back to rspdpipe.
+        '''
+        super(PipedImagerPQ, self).__init__()
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+        # ignore Ctrl-C
+        signal.signal(signal.SIGINT, signal.SIG_IGN)
+        # unmodified image for creating the scene
+        self.__sceneimage = None
+        # bytearray of data for the above image
+        self.__scenedata = None
+        # flag set if in the process of reading image data from commands
+        self.__loadingimage = False
+        # width and height of the unmodified scene image
+        # when the image is defined
+        # initialize the width and height to values that will create
+        # a viewer (mainWindow) of the right size
+        self.__scenewidth = int(10.5 * self.physicalDpiX())
+        self.__sceneheight = int(8.5 * self.physicalDpiY())
+        # initial default color for the background (opaque white)
+        self.__lastclearcolor = QColor(0xFFFFFF)
+        self.__lastclearcolor.setAlpha(0xFF)
+        # scaling factor for creating the displayed scene
+        self.__scalefactor = 1.0
+        # automatically adjust the scaling factor to fit the window frame?
+        self.__autoscale = True
+        # minimum label width and height (for minimum scaling factor)
+        # and minimum image width and height (for error checking)
+        self.__minsize = 128
+        # create the label, that will serve as the canvas, in a scrolled area
+        self.__scrollarea = QScrollArea(self)
+        self.__label = QLabel(self.__scrollarea)
+        # set the initial label size and other values for the scrolled area
+        self.__label.setMinimumSize(self.__scenewidth, self.__sceneheight)
+        self.__label.resize(self.__scenewidth, self.__sceneheight)
+        # setup the scrolled area
+        self.__scrollarea.setWidget(self.__label)
+        self.__scrollarea.setBackgroundRole(QPalette.Dark)
+        self.setCentralWidget(self.__scrollarea)
+        # default file name and format for saving the image
+        self.__lastfilename = "ferret.png"
+        self.__lastformat = "png"
+        # control whether the window will be destroyed or hidden
+        self.__shuttingdown = False
+        # command helper object
+        self.__helper = CmndHelperPQ(self)
+        # create the menubar
+        self.createActions()
+        self.createMenus()
+        # set the initial size of the viewer
+        self.__framedelta = 4
+        mwwidth = self.__scenewidth + self.__framedelta
+        mwheight = self.__sceneheight + self.__framedelta \
+                 + self.menuBar().height() \
+                 + self.statusBar().height()
+        self.resize(mwwidth, mwheight)
+        # check the command queue any time there are no window events to deal with
+        self.__timer = QTimer(self)
+        self.__timer.timeout.connect(self.checkCommandPipe)
+        self.__timer.setInterval(0)
+        self.__timer.start()
+
+    def createActions(self):
+        '''
+        Create the actions used by the menus in this viewer.  Ownership
+        of the actions are not transferred in addAction, thus the need
+        to maintain references here.
+        '''
+        self.__scaleact = QAction(self.tr("&Scale"), self,
+                                shortcut=self.tr("Ctrl+S"),
+                                statusTip=self.tr("Scale the image (canvas and image change size)"),
+                                triggered=self.inquireSceneScale)
+        self.__saveact = QAction(self.tr("Save &As..."), self,
+                                shortcut=self.tr("Ctrl+A"),
+                                statusTip=self.tr("Save the image to file"),
+                                triggered=self.inquireSaveFilename)
+        self.__redrawact = QAction(self.tr("&Redraw"), self,
+                                shortcut=self.tr("Ctrl+R"),
+                                statusTip=self.tr("Clear and redraw the image"),
+                                triggered=self.redrawScene)
+        self.__aboutact = QAction(self.tr("&About"), self,
+                                statusTip=self.tr("Show information about this viewer"),
+                                triggered=self.aboutMsg)
+        self.__aboutqtact = QAction(self.tr("About &Qt"), self,
+                                statusTip=self.tr("Show information about the Qt library"),
+                                triggered=self.aboutQtMsg)
+        self.__exitact = QAction(self.tr("&Exit"), self,
+                                statusTip=self.tr("Shut down the viewer"),
+                                triggered=self.exitViewer)
+
+    def createMenus(self):
+        '''
+        Create the menu items for the viewer
+        using the previously created actions.
+        '''
+        menuBar = self.menuBar()
+        sceneMenu = menuBar.addMenu(menuBar.tr("&Image"))
+        sceneMenu.addAction(self.__scaleact)
+        sceneMenu.addAction(self.__saveact)
+        sceneMenu.addAction(self.__redrawact)
+        # sceneMenu.addSeparator()
+        # sceneMenu.addAction(self.__hideact)
+        helpMenu = menuBar.addMenu(menuBar.tr("&Help"))
+        helpMenu.addAction(self.__aboutact)
+        helpMenu.addAction(self.__aboutqtact)
+        helpMenu.addSeparator()
+        helpMenu.addAction(self.__exitact)
+
+    def resizeEvent(self, event):
+        '''
+        Monitor resizing in case auto-scaling of the image is selected.
+        '''
+        if self.__autoscale:
+            if self.autoScaleScene():
+                # continue with the window resize
+                event.accept()
+            else:
+                # another resize coming in, so ignore this one
+                event.ignore()
+        else:
+            # continue with the window resize
+            event.accept()
+
+    def closeEvent(self, event):
+        '''
+        Override so the viewer cannot be closed from the
+        user selecting the windowframe close ('X') button.
+        Instead only hide the window.
+        '''
+        if self.__shuttingdown:
+            event.accept()
+        else:
+            event.ignore()
+            self.hide()
+
+    def exitViewer(self):
+        '''
+        Close and exit the viewer.
+        '''
+        self.__timer.stop()
+        self.__shuttingdown = True
+        self.close()
+
+    def aboutMsg(self):
+        QMessageBox.about(self, self.tr("About PipedImagerPQ"),
+            self.tr("\n" \
+            "PipedImagerPQ is a graphics viewer application that " \
+            "receives its displayed image and commands primarily from " \
+            "another application through a pipe.  A limited number " \
+            "of commands are provided by the viewer itself to allow " \
+            "saving and some manipulation of the displayed image.  " \
+            "The controlling application, however, may be unaware " \
+            "of these modifications made to the image. " \
+            "\n\n" \
+            "Normally, the controlling program will exit the viewer " \
+            "when it is no longer needed.  The Help -> Exit menu item " \
+            "should not normally be used.  It is provided when problems " \
+            "occur and the controlling program cannot shut down the " \
+            "viewer properly. " \
+            "\n\n" \
+            "PipedImagerPQ was developed by the Thermal Modeling and Analysis " \
+            "Project (TMAP) of the National Oceanographic and Atmospheric " \
+            "Administration's (NOAA) Pacific Marine Environmental Lab (PMEL). "))
+
+    def aboutQtMsg(self):
+        QMessageBox.aboutQt(self, self.tr("About Qt"))
+
+    def updateScene(self):
+        '''
+        Clear the displayed scene using self.__lastclearcolor,
+        then draw the scaled current image.
+        '''
+        # get the scaled scene size
+        labelwidth = int(self.__scalefactor * self.__scenewidth + 0.5)
+        labelheight = int(self.__scalefactor * self.__sceneheight + 0.5)
+        # Create the new pixmap for the label to display
+        newpixmap = QPixmap(labelwidth, labelheight)
+        newpixmap.fill(self.__lastclearcolor)
+        if self.__sceneimage != None:
+            # Draw the scaled image to the pixmap
+            painter = QPainter(newpixmap)
+            trgrect = QRectF(0.0, 0.0, float(labelwidth),
+                                       float(labelheight))
+            srcrect = QRectF(0.0, 0.0, float(self.__scenewidth),
+                                       float(self.__sceneheight))
+            painter.drawImage(trgrect, self.__sceneimage, srcrect, Qt.AutoColor)
+            painter.end()
+        # Assign the new pixmap to the label
+        self.__label.setPixmap(newpixmap)
+        # set the label size and values
+        # so the scrollarea knows of the new size
+        self.__label.setMinimumSize(labelwidth, labelheight)
+        self.__label.resize(labelwidth, labelheight)
+        # update the label from the new pixmap
+        self.__label.update()
+       
+    def clearScene(self, bkgcolor=None):
+        '''
+        Deletes the scene image and fills the label with bkgcolor.
+        If bkgcolor is None or an invalid color, the color used is 
+        the one used from the last clearScene or redrawScene call 
+        with a valid color (or opaque white if a color has never 
+        been specified).
+        '''
+        # get the color to use for clearing (the background color)
+        if bkgcolor:
+            if bkgcolor.isValid():
+                    self.__lastclearcolor = bkgcolor
+        # Remove the image and its bytearray
+        self.__sceneimage = None
+        self.__scenedata = None
+        # Update the scene label using the current clearing color and image
+        self.updateScene()
+
+    def redrawScene(self, bkgcolor=None):
+        '''
+        Clear and redraw the displayed scene.
+        '''
+        # get the background color
+        if bkgcolor:
+            if bkgcolor.isValid():
+                    self.__lastclearcolor = bkgcolor
+        # Update the scene label using the current clearing color and image
+        QApplication.setOverrideCursor(Qt.WaitCursor)
+        self.statusBar().showMessage( self.tr("Redrawing image") )
+        try:
+            self.updateScene()
+        finally:
+            self.statusBar().clearMessage()
+            QApplication.restoreOverrideCursor()
+
+    def resizeScene(self, width, height):
+        '''
+        Resize the scene to the given width and height in units of pixels.
+        If the size changes, this deletes the current image and clear the
+        displayed scene.
+        '''
+        newwidth = int(width + 0.5)
+        if newwidth < self.__minsize:
+            newwidth = self.__minsize
+        newheight = int(height + 0.5)
+        if newheight < self.__minsize:
+            newheight = self.__minsize
+        if (newwidth != self.__scenewidth) or (newheight != self.__sceneheight):
+            # set the new size for the empty scene
+            self.__scenewidth = newwidth
+            self.__sceneheight = newheight
+            # If auto-scaling, set scaling factor to 1.0 and resize the window
+            if self.__autoscale:
+                self.__scalefactor = 1.0
+                barheights = self.menuBar().height() + self.statusBar().height()
+                self.resize(newwidth + self.__framedelta, 
+                            newheight + self.__framedelta + barheights)
+            # clear the scene with the last clearing color
+            self.clearScene(None)
+
+    def loadNewSceneImage(self, imageinfo):
+        '''
+        Create a new scene image from the information given in this
+        and subsequent dictionaries imageinfo.  The image is created
+        from multiple calls to this function since there is a limit
+        on the size of a single object passed through a pipe.
+        
+        The first imageinfo dictionary given when creating an image
+        must define the following key and value pairs:
+            "width": width of the image in pixels
+            "height": height of the image in pixels
+            "stride": number of bytes in one line of the image
+                      in the bytearray
+        The scene image data is initialized to all zero (transparent)
+        at this time.
+
+        This initialization call must be followed by (multiple) calls
+        to this method with imageinfo dictionaries defining the key
+        and value pairs:
+            "blocknum": data block number (1, 2, ... numblocks)
+            "numblocks": total number of image data blocks
+            "startindex": index in the bytearray of image data
+                          where this block of image data starts
+            "blockdata": this block of data as a bytearray
+
+        On receipt of the last block of data (blocknum == numblocks)
+        the scene image will be created and the scene will be updated. 
+
+        Raises:
+            KeyError - if one of the above keys is not given
+            ValueError - if a value for a key is not valid
+        '''
+        if not self.__loadingimage:
+            # prepare for a new image data from subsequent calls
+            # get dimensions of the new image
+            imgwidth = int( imageinfo["width"] )
+            imgheight = int( imageinfo["height"] )
+            imgstride = int( imageinfo["stride"] )
+            if (imgwidth < self.__minsize) or (imgheight < self.__minsize):
+                raise ValueError( self.tr("image width and height cannot be less than %1") \
+                                      .arg(str(self.__minsize)) )
+            # Newer PyQt versions allow separate specification of the stride
+            if imgstride != 4 * imgwidth:
+                raise ValueError( self.tr("image stride is not four times the image width") )
+            # create the bytearray to contain the new scene data
+            # automatically initialized to zero
+            self.__scenedata = bytearray(imgstride * imgheight)
+            self.__scenewidth = imgwidth
+            self.__sceneheight = imgheight
+            # set the flag for subsequent calls to this method
+            self.__loadingimage = True
+            # change the cursor to warn the user this may take some time
+            QApplication.setOverrideCursor(Qt.WaitCursor)
+            # put up an appropriate status message
+            self.statusBar().showMessage( self.tr("Loading new image") )
+            return
+        # loading an image; add the next block of data
+        blocknum = int( imageinfo["blocknum"] )
+        numblocks = int( imageinfo["numblocks"] )
+        startindex = int( imageinfo["startindex"] )
+        blockdata = imageinfo["blockdata"]
+        if (blocknum < 1) or (blocknum > numblocks):
+            self.statusBar().clearMessage()
+            QApplication.restoreOverrideCursor()
+            raise ValueError( self.tr("invalid image data block number or number of blocks") )
+        if (startindex < 0) or (startindex >= len(self.__scenedata)):
+            self.statusBar().clearMessage()
+            QApplication.restoreOverrideCursor()
+            raise ValueError( self.tr("invalid start index for an image data block") )
+        blocksize = len(blockdata)
+        endindex = startindex + blocksize
+        if (blocksize < 1) or (endindex > len(self.__scenedata)):
+            self.statusBar().clearMessage()
+            QApplication.restoreOverrideCursor()
+            raise ValueError( self.tr("invalid length of an image data block") )
+        # update the status message to show progress
+        self.statusBar().showMessage( self.tr("Loading new image (block %1 of %2)") \
+                                          .arg(str(blocknum)).arg(str(numblocks)) )
+        # assign the data
+        self.__scenedata[startindex:endindex] = blockdata
+        # if this is the last block of data, create and display the scene image
+        if blocknum == numblocks:
+            self.__loadingimage = False
+            self.statusBar().showMessage( self.tr("Creating new image") )
+            try:
+                self.__sceneimage = QImage(self.__scenedata,
+                                           self.__scenewidth,
+                                           self.__sceneheight,
+                                           QImage.Format_ARGB32_Premultiplied)
+                self.statusBar().showMessage( self.tr("Drawing new image") )
+                # update the displayed scene in the label
+                self.updateScene()
+            finally:
+                # clear the status message
+                self.statusBar().clearMessage()
+                # restore the cursor back to normal
+                QApplication.restoreOverrideCursor()
+
+    def inquireSceneScale(self):
+        '''
+        Prompt the user for the desired scaling factor for the scene.
+        '''
+        labelwidth = int(self.__scenewidth * self.__scalefactor + 0.5)
+        labelheight = int(self.__sceneheight * self.__scalefactor + 0.5)
+        scaledlg = ScaleDialogPQ(self.__scalefactor, labelwidth, labelheight,
+                        self.__minsize, self.__minsize, self.__autoscale, self)
+        if scaledlg.exec_():
+            (newscale, autoscale, okay) = scaledlg.getValues()
+            if okay:
+                if autoscale:
+                    self.__autoscale = True
+                    self.autoScaleScene()
+                else:
+                    self.__autoscale = False
+                    self.scaleScene(newscale, False)
+
+    def autoScaleScene(self):
+        '''
+        Selects a scaling factor that maximizes the scene within the window 
+        frame without requiring scroll bars.  Intended to be called when
+        the window size is changed by the user and auto-scaling is turn on.
+
+        Returns:
+            True if the scene was resized
+            False if the a new resize command was issued
+        '''
+        barheights = self.menuBar().height() + self.statusBar().height()
+
+        # get the size for the central widget
+        cwheight = self.height() - barheights - self.__framedelta
+        heightsf = float(cwheight) / float(self.__sceneheight)
+
+        cwwidth = self.width() - self.__framedelta
+        widthsf = float(cwwidth) / float(self.__scenewidth)
+
+        if heightsf < widthsf:
+            factor = heightsf
+        else:
+            factor = widthsf
+
+        newcwheight = int(factor * self.__sceneheight + 0.5)
+        newcwwidth = int(factor * self.__scenewidth + 0.5)
+
+        # if the window does not have the correct aspect ratio, resize it so 
+        # it will; this will generate another call to this method.  Otherwise,
+        # scale the scene and be done.
+        if self.isMaximized() or \
+           ( (abs(cwheight - newcwheight) <= self.__framedelta) and \
+             (abs(cwwidth - newcwwidth) <= self.__framedelta) ):
+            self.scaleScene(factor, False)
+            return True
+        else:
+            self.resize(newcwwidth + self.__framedelta, 
+                        newcwheight + self.__framedelta + barheights)
+            return False
+
+    def scaleScene(self, factor, resizewin):
+        '''
+        Scales both the horizontal and vertical directions by factor.
+        Scaling factors are not accumulative.  So if the scene was
+        already scaled, that scaling is "removed" before this scaling
+        factor is applied.  If resizewin is True, the main window is 
+        resized to accommodate this new scaled scene size.
+        '''
+        newfactor = float(factor)
+        newlabwidth = int(newfactor * self.__scenewidth + 0.5)
+        newlabheight = int(newfactor * self.__sceneheight + 0.5)
+        if (newlabwidth < self.__minsize) or (newlabheight < self.__minsize):
+            # Set to minimum size
+            if self.__scenewidth <= self.__sceneheight:
+                newfactor = float(self.__minsize) / float(self.__scenewidth)
+            else:
+                newfactor = float(self.__minsize) / float(self.__sceneheight)
+            newlabwidth = int(newfactor * self.__scenewidth + 0.5)
+            newlabheight = int(newfactor * self.__sceneheight + 0.5)
+        oldlabwidth = int(self.__scalefactor * self.__scenewidth + 0.5)
+        oldlabheight = int(self.__scalefactor * self.__sceneheight + 0.5)
+        if (newlabwidth != oldlabwidth) or (newlabheight != oldlabheight):
+            # Set the new scaling factor
+            self.__scalefactor = newfactor
+            # Update the scene label using the current clearing color and image
+            QApplication.setOverrideCursor(Qt.WaitCursor)
+            self.statusBar().showMessage( self.tr("Scaling image") )
+            try:
+                self.updateScene()
+            finally:
+                self.statusBar().clearMessage()
+                QApplication.restoreOverrideCursor()
+        if resizewin:
+            # resize the main window (if possible)
+            barheights = self.menuBar().height() + self.statusBar().height()
+            mwheight = newlabheight + barheights + self.__framedelta
+            mwwidth = newlabwidth + self.__framedelta
+            # Do not exceed the available real estate on the screen.
+            # If autoscaling is in effect, the resize will trigger 
+            # any required adjustments.
+            scrnrect = QApplication.desktop().availableGeometry()
+            if mwwidth > 0.95 * scrnrect.width():
+                mwwidth = int(0.9 * scrnrect.width() + 0.5)
+            if mwheight > 0.95 * scrnrect.height():
+                mwheight = int(0.9 * scrnrect.height() + 0.5)
+            self.resize(mwwidth, mwheight)
+
+    def inquireSaveFilename(self):
+        '''
+        Prompt the user for the name of the file into which to save the scene.
+        The file format will be determined from the filename extension.
+        '''
+        formattypes = [ ( "png",
+                          self.tr("PNG - Portable Networks Graphics (*.png)") ),
+                        ( "jpeg",
+                          self.tr("JPEG - Joint Photographic Experts Group (*.jpeg *.jpg *.jpe)") ),
+                        ( "tiff",
+                          self.tr("TIFF - Tagged Image File Format (*.tiff *.tif)") ),
+                        ( "bmp",
+                          self.tr("BMP - Windows Bitmap (*.bmp)") ),
+                        ( "ppm",
+                          self.tr("PPM - Portable Pixmap (*.ppm)") ),
+                        ( "xpm",
+                          self.tr("XPM - X11 Pixmap (*.xpm)") ),
+                        ( "xbm",
+                          self.tr("XBM - X11 Bitmap (*.xbm)") ), ]
+        # tr returns QStrings so the following does not work
+        # filters = ";;".join( [ t[1] for t in formattypes ] )
+        filters = QString(formattypes[0][1])
+        for typePair in formattypes[1:]:
+            filters.append(";;")
+            filters.append(typePair[1])
+        # getSaveFileNameAndFilter does not want to accept a default filter
+        # for (fmt, fmtQName) in formattypes:
+        #     if self.__lastformat == fmt:
+        #         dfltfilter = fmtQName
+        #         break
+        # else:
+        #     dfltfilter = formattypes[0][1]
+        # getSaveFileNameAndFilter is a PyQt (but not Qt?) method
+        (fileName, fileFilter) = QFileDialog.getSaveFileNameAndFilter(self,
+                                      self.tr("Save the current image as "),
+                                      self.__lastfilename, filters)
+        if fileName:
+            for (fmt, fmtQName) in formattypes:
+                if fmtQName.compare(fileFilter) == 0:
+                    fileFormat = fmt
+                    break
+            else:
+                raise RuntimeError( self.tr("Unexpected file format name '%1'") \
+                                        .arg(fileFilter) )
+            self.saveSceneToFile(fileName, fileFormat, None, None)
+            self.__lastfilename = fileName
+            self.__lastformat = fileFormat
+
+    def saveSceneToFile(self, filename, imageformat, transparent, rastsize):
+        '''
+        Save the current scene to the named file.
+        
+        If imageformat is empty or None, the format is guessed from
+        the filename extension.
+
+        If transparent is False, the entire scene is initialized
+        to the last clearing color.
+
+        If given, rastsize is the pixels size of the saved image.
+        If rastsize is not given, the saved image will be saved
+        at the current scaled image size.  
+        '''
+        # This could be called when there is no image present.
+        # If this is the case, ignore the call.
+        if ( self.__sceneimage == None ):
+            return
+        if not imageformat:
+            # Guess the image format from the filename extension
+            # This is only done to silently change gif to png
+            fileext = ( os.path.splitext(filename)[1] ).lower()
+            if fileext == '.gif':
+                myformat = 'gif'
+            else:
+                # let QImage figure out the format
+                myformat = None
+        else:
+            myformat = imageformat.lower()
+
+        if myformat == 'gif':
+            # Silently convert gif filename and format to png
+            myformat = 'png'
+            myfilename = os.path.splitext(filename)[0] + ".png"
+        else:
+            myfilename = filename
+        # set the cursor and status message to indicate a save is happending
+        QApplication.setOverrideCursor(Qt.WaitCursor)
+        self.statusBar().showMessage( self.tr("Saving image") )
+        try:
+            if rastsize:
+                imagewidth = int(rastsize.width() + 0.5)
+                imageheight = int(rastsize.height() + 0.5)
+            else:
+                imagewidth = int(self.__scenewidth * self.__scalefactor + 0.5)
+                imageheight = int(self.__sceneheight * self.__scalefactor + 0.5)
+            image = QImage( QSize(imagewidth, imageheight),
+                            QImage.Format_ARGB32_Premultiplied )
+            # Initialize the image
+            if not transparent:
+                # Clear the image with self.__lastclearcolor
+                fillint = self.__helper.computeARGB32PreMultInt(self.__lastclearcolor)
+            else:
+                fillint = 0
+            image.fill(fillint)
+            # draw the scaled scene to this QImage
+            painter = QPainter(image)
+            trgrect = QRectF(0.0, 0.0, float(imagewidth),
+                                       float(imageheight))
+            srcrect = QRectF(0.0, 0.0, float(self.__scenewidth),
+                                       float(self.__sceneheight))
+            painter.drawImage(trgrect, self.__sceneimage, srcrect, Qt.AutoColor)
+            painter.end()
+            # save the image to file
+            image.save(myfilename, myformat)
+        finally:
+            self.statusBar().clearMessage()
+            QApplication.restoreOverrideCursor()
+
+    def checkCommandPipe(self):
+        '''
+        Get and perform commands waiting in the pipe.
+        Stop when no more commands or if more than 50
+        milliseconds have passed.
+        '''
+        try:
+            starttime = time.clock()
+            # Wait up to 2 milliseconds waiting for a command.
+            # This prevents unchecked spinning when there is
+            # nothing to do (Qt immediately calling this method
+            # again only for this method to immediately return).
+            while self.__cmndpipe.poll(0.002):
+                cmnd = self.__cmndpipe.recv()
+                self.processCommand(cmnd)
+                # Continue to try to process commands until
+                # more than 50 milliseconds have passed.
+                # This reduces Qt overhead when there are lots
+                # of commands waiting in the queue.
+                if (time.clock() - starttime) > 0.050:
+                    break
+        except Exception:
+            # EOFError should never arise from recv since
+            # the call is after poll returns True
+            (exctype, excval) = sys.exc_info()[:2]
+            if excval:
+                self.__rspdpipe.send("**ERROR %s: %s" % (str(exctype), str(excval)))
+            else:
+                self.__rspdpipe.send("**ERROR %s" % str(exctype))
+            self.exitViewer()
+
+    def processCommand(self, cmnd):
+        '''
+        Examine the action of cmnd and call the appropriate
+        method to deal with this command.  Raises a KeyError
+        if the "action" key is missing.
+        '''
+        try:
+            cmndact = cmnd["action"]
+        except KeyError:
+            raise ValueError( self.tr("Unknown command %1").arg(str(cmnd)) )
+
+        if cmndact == "clear":
+            try:
+                bkgcolor = self.__helper.getColorFromCmnd(cmnd)
+            except KeyError:
+                bkgcolor = None
+            self.clearScene(bkgcolor)
+        elif cmndact == "exit":
+            self.exitViewer()
+        elif cmndact == "hide":
+            self.hide()
+        elif cmndact == "screenInfo":
+            scrnrect = QApplication.desktop().availableGeometry()
+            info = ( self.physicalDpiX(), self.physicalDpiY(),
+                     scrnrect.width(), scrnrect.height() )
+            self.__rspdpipe.send(info)
+        elif cmndact == "redraw":
+            try:
+                bkgcolor = self.__helper.getColorFromCmnd(cmnd)
+            except KeyError:
+                bkgcolor = None
+            self.redrawScene(bkgcolor)
+        elif cmndact == "rescale":
+            newscale = float(cmnd["factor"])
+            if newscale <= 0.0:
+                raise ValueError("invalid scaling factor")
+            self.scaleScene(newscale, True)
+        elif cmndact == "resize":
+            mysize = self.__helper.getSizeFromCmnd(cmnd)
+            self.resizeScene(mysize.width(), mysize.height())
+        elif cmndact == "newImage":
+            self.loadNewSceneImage(cmnd)
+        elif cmndact == "save":
+            filename = cmnd["filename"]
+            fileformat = cmnd.get("fileformat", None)
+            try:
+                bkgcolor = self.__helper.getColorFromCmnd(cmnd)
+            except KeyError:
+                bkgcolor = None
+            rastsize = self.__helper.getSizeFromCmnd(cmnd["rastsize"])
+            self.saveSceneToFile(filename, fileformat, bkgcolor, rastsize)
+        elif cmndact == "setTitle":
+            self.setWindowTitle(cmnd["title"])
+        elif cmndact == "imgname":
+            value = cmnd.get("name", None)
+            if value:
+                self.__lastfilename = value;
+            value = cmnd.get("format", None)
+            if value:
+                self.__lastformat = value.lower();
+        elif cmndact == "show":
+            if self.isHidden():
+                self.showNormal()
+        else:
+            raise ValueError( self.tr("Unknown command action %1") \
+                                  .arg(str(cmndact)) )
+
+
+class PipedImagerPQProcess(Process):
+    '''
+    A Process specifically tailored for creating a PipedImagerPQ.
+    '''
+    def __init__(self, cmndpipe, rspdpipe):
+        '''
+        Create a Process that will produce a PipedImagerPQ
+        attached to the given Pipes when run.
+        '''
+        Process.__init__(self)
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+
+    def run(self):
+        '''
+        Create a PipedImagerPQ that is attached
+        to the Pipe of this instance.
+        '''
+        self.__app = QApplication(["PipedImagerPQ"])
+        self.__viewer = PipedImagerPQ(self.__cmndpipe, self.__rspdpipe)
+        result = self.__app.exec_()
+        self.__cmndpipe.close()
+        self.__rspdpipe.close()
+        SystemExit(result)
+
+
+#
+# The following are for testing this module
+#
+
+class _CommandSubmitterPQ(QDialog):
+    '''
+    Testing dialog for controlling the addition of commands to a pipe.
+    Used for testing PipedImagerPQ in the same process as the viewer.
+    '''
+    def __init__(self, parent, cmndpipe, rspdpipe, cmndlist):
+        '''
+        Create a QDialog with a single QPushButton for controlling
+        the submission of commands from cmndlist to cmndpipe.
+        '''
+        QDialog.__init__(self, parent)
+        self.__cmndlist = cmndlist
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+        self.__nextcmnd = 0
+        self.__button = QPushButton("Submit next command", self)
+        self.__button.pressed.connect(self.submitNextCommand)
+        self.show()
+
+    def submitNextCommand(self):
+        '''
+        Submit the next command from the command list to the command pipe,
+        or shutdown if there are no more commands to submit.
+        '''
+        try:
+            cmndstr = str(self.__cmndlist[self.__nextcmnd])
+            if len(cmndstr) > 188:
+                cmndstr = cmndstr[:188] + '...'
+            print "Command: %s" % cmndstr
+            self.__cmndpipe.send(self.__cmndlist[self.__nextcmnd])
+            self.__nextcmnd += 1
+            while self.__rspdpipe.poll():
+                print "Response: %s" % str(self.__rspdpipe.recv())
+        except IndexError:
+            self.__rspdpipe.close()
+            self.__cmndpipe.close()
+            self.close()
+
+
+if __name__ == "__main__":
+    # vertices of a pentagon (roughly) centered in a 1000 x 1000 square
+    pentagonpts = ( (504.5, 100.0), (100.0, 393.9),
+                    (254.5, 869.4), (754.5, 869.4),
+                    (909.0, 393.9),  )
+    linepts = ( (350,  50),
+                (200, 150),
+                (400, 250),
+                (300, 350),
+                (150, 250),
+                (100, 450) )
+    # start PyQt
+    app = QApplication(["PipedImagerPQ"])
+    # create the list of commands to submit
+    drawcmnds = []
+    drawcmnds.append( { "action":"setTitle", "title":"Tester" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"clear", "color":"black"} )
+    drawcmnds.append( { "action":"screenInfo"} )
+    # create the image to be displayed
+    image = QImage(500, 500, QImage.Format_ARGB32_Premultiplied)
+    # initialize a black background
+    image.fill(0xFF000000)
+    # draw some things in the image
+    painter = QPainter(image)
+    painter.setBrush( QBrush(QColor(0, 255, 0, 128), Qt.SolidPattern) )
+    painter.setPen( QPen(QBrush(QColor(255, 0, 0, 255), Qt.SolidPattern),
+                         5.0, Qt.SolidLine, Qt.SquareCap, Qt.MiterJoin) )
+    painter.drawRect( QRectF(5.0, 255.0, 240.0, 240.0) )
+    painter.setBrush( QBrush(QColor(0, 0, 255, 255), Qt.SolidPattern) )
+    painter.setPen( QPen(QBrush(QColor(0, 0, 0, 255), Qt.SolidPattern),
+                         5.0, Qt.DashLine, Qt.RoundCap, Qt.RoundJoin) )
+    painter.drawPolygon( QPolygonF(
+            [ QPointF(.25 * ptx, .25 * pty + 250) for (ptx, pty) in pentagonpts ] ) )
+    painter.setBrush( Qt.NoBrush )
+    painter.setPen( QPen(QBrush(QColor(255, 255, 255, 255), Qt.SolidPattern),
+                         3.0, Qt.DashLine, Qt.RoundCap, Qt.RoundJoin) )
+    painter.drawPolyline( QPolygonF(
+            [ QPointF(pts, pty) for (pts, pty) in linepts ] ) )
+    painter.end()
+    # add the image command
+    imgwidth = image.width()
+    imgheight = image.height()
+    imgstride = image.bytesPerLine()
+    # not a good way to get the pixel data
+    imgdata = bytearray(imgheight * imgstride)
+    k = 0
+    for pty in xrange(imgheight):
+        for ptx in xrange(imgwidth):
+            pixval = image.pixel(ptx, pty)
+            (aval, rgbval) = divmod(pixval, 256 * 256 * 256)
+            (rval, gbval) = divmod(rgbval, 256 * 256)
+            (gval, bval) = divmod(gbval, 256)
+            imgdata[k] = bval
+            k += 1
+            imgdata[k] = gval
+            k += 1
+            imgdata[k] = rval
+            k += 1
+            imgdata[k] = aval
+            k += 1
+    blocksize = 2000
+    numblocks = (imgheight * imgstride + blocksize - 1) // blocksize
+    drawcmnds.append( { "action":"newImage",
+                        "width":imgwidth,
+                        "height":imgheight,
+                        "stride":imgstride } )
+    for k in xrange(numblocks):
+        if k < (numblocks - 1):
+            blkdata = imgdata[k*blocksize:(k+1)*blocksize]
+        else:
+            blkdata = imgdata[k*blocksize:]
+        drawcmnds.append( { "action":"newImage",
+                            "blocknum":k+1,
+                            "numblocks":numblocks,
+                            "startindex":k*blocksize,
+                            "blockdata":blkdata } )
+    # finish the command list
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"exit" } )
+    # create a PipedImagerPQ in this process
+    cmndrecvpipe, cmndsendpipe = Pipe(False)
+    rspdrecvpipe, rspdsendpipe = Pipe(False)
+    viewer = PipedImagerPQ(cmndrecvpipe, rspdsendpipe)
+    # create a command submitter dialog
+    tester = _CommandSubmitterPQ(viewer, cmndsendpipe,
+                                   rspdrecvpipe, drawcmnds)
+    tester.show()
+    # let it all run
+    result = app.exec_()
+    if result != 0:
+        sys.exit(result)
+
diff --git a/pviewmod/pipedviewerpq.py b/pviewmod/pipedviewerpq.py
new file mode 100644
index 0000000..1c99e57
--- /dev/null
+++ b/pviewmod/pipedviewerpq.py
@@ -0,0 +1,1707 @@
+'''
+PipedViewerPQ is a graphics viewer application written in PyQt4
+that receives its drawing and other commands primarily from another
+application through a pipe.  A limited number of commands are
+provided by the viewer itself to allow saving and some manipulation
+of the displayed image.  The controlling application, however, may
+be unaware of these modifications made to the image.
+
+PipedViewerPQProcess is used to create and run a PipedViewerPQ.
+
+This package was developed by the Thermal Modeling and Analysis
+Project (TMAP) of the National Oceanographic and Atmospheric
+Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
+'''
+
+import sip
+try:
+    sip.setapi('QVariant', 2)
+except AttributeError:
+    pass
+
+from PyQt4.QtCore import Qt, QPointF, QRect, QRectF, QSize, QSizeF, \
+                         QString, QTimer
+from PyQt4.QtGui  import QAction, QApplication, QBrush, QColor, QDialog, \
+                         QFileDialog, QFont, QImage, QLabel, QMainWindow, \
+                         QMessageBox, QPainter, QPalette, QPen, QPicture, \
+                         QPixmap, QPolygonF, QPrinter, QPushButton, \
+                         QScrollArea, QTextDocument
+
+try:
+    from PyQt4.QtSvg  import QSvgGenerator
+    HAS_QSvgGenerator = True
+except ImportError:
+    HAS_QSvgGenerator = False
+
+from cmndhelperpq import CmndHelperPQ
+from scaledialogpq import ScaleDialogPQ
+from multiprocessing import Pipe, Process
+import sys
+import time
+import os
+import signal
+import math
+
+
+class PipedViewerPQ(QMainWindow):
+    '''
+    A PyQt graphics viewer that receives generic drawing commands
+    through a pipe.  Uses a list of QPictures to record the drawings
+    which are then used to display, manipulate, and save the image.
+
+    A drawing command is a dictionary with string keys that will be
+    interpreted into the appropriate PyQt command(s).  For example,
+        { "action":"drawText",
+          "text":"Hello",
+          "font":{"family":"Times", "size":100, "italic":True},
+          "fill":{"color":0x880000, "style":"cross"},
+          "outline":{"color":"black"},
+          "location":(250,350) }
+
+    The command { "action":"exit" } will shutdown the viewer and is
+    the only way the viewer can be closed.  GUI actions can only hide
+    the viewer.
+    '''
+
+    def __init__(self, cmndpipe, rspdpipe):
+        '''
+        Create a PyQt viewer which reads commands from the Pipe
+        cmndpipe and writes responses back to rspdpipe.
+        '''
+        super(PipedViewerPQ, self).__init__()
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+        # ignore Ctrl-C
+        signal.signal(signal.SIGINT, signal.SIG_IGN)
+        # default scene size
+        self.__scenewidth = int(10.5 * self.physicalDpiX())
+        self.__sceneheight = int(8.5 * self.physicalDpiY())
+        # scaling factor for line widths and symbol sizes
+        self.setWidthScalingFactor(0.75)
+        # initial default color for the background (opaque white)
+        self.__lastclearcolor = QColor(0xFFFFFF)
+        self.__lastclearcolor.setAlpha(0xFF)
+        # List of QPictures creating the current scene
+        self.__viewpics = [ ]
+        self.__segid = None
+        # QPicture/QPainter pair for the current view
+        self.__activepicture = None
+        self.__activepainter = None
+        # Antialias when drawing?
+        self.__antialias = True
+        # data for recreating the current view
+        self.__fracsides = None
+        self.__clipit = True
+        # number of drawing commands in the active painter
+        self.__drawcount = 0
+        # Limit the number of drawing commands per picture
+        # to avoid the appearance of being "stuck"
+        self.__maxdraws = 1024
+        # scaling factor for creating the displayed scene
+        self.__scalefactor = 1.0
+        # automatically adjust the scaling factor to fit the window frame?
+        self.__autoscale = True
+        # values used to decide if the scene needs to be updated 
+        self.__lastpicdrawn = 0
+        self.__createpixmap = True
+        self.__clearpixmap = True
+        # Calculations of modified rectangular regions in QPictures
+        # currently do not account for width and height of QPictures
+        # played inside them.  So keep a expansion value.
+        self.__maxsymbolwidth = 0.0
+        self.__maxsymbolheight = 0.0
+        # create the label, that will serve as the canvas, in a scrolled area
+        self.__scrollarea = QScrollArea(self)
+        self.__label = QLabel(self.__scrollarea)
+        # set the initial label size and other values for the scrolled area
+        self.__label.setMinimumSize(self.__scenewidth, self.__sceneheight)
+        self.__label.resize(self.__scenewidth, self.__sceneheight)
+        # setup the scrolled area
+        self.__scrollarea.setWidget(self.__label)
+        self.__scrollarea.setBackgroundRole(QPalette.Dark)
+        self.setCentralWidget(self.__scrollarea)
+        self.__minsize = 128
+        # default file name and format for saving the image
+        self.__lastfilename = "ferret.png"
+        self.__lastformat = "png"
+        self.__addedannomargin = 12
+        # Control whether the window will be destroyed or hidden
+        self.__shuttingdown = False
+        # command helper object
+        self.__helper = CmndHelperPQ(self)
+        # Create the menubar
+        self.createActions()
+        self.createMenus()
+        # Set the initial size of the viewer
+        self.__framedelta = 4
+        mwwidth = self.__scenewidth + self.__framedelta
+        mwheight = self.__sceneheight + self.__framedelta \
+                 + self.menuBar().height() \
+                 + self.statusBar().height()
+        self.resize(mwwidth, mwheight)
+        # check the command queue any time there are no window events to deal with
+        self.__timer = QTimer(self)
+        self.__timer.timeout.connect(self.checkCommandPipe)
+        self.__timer.setInterval(0)
+        self.__timer.start()
+
+    def createActions(self):
+        '''
+        Create the actions used by the menus in this viewer.  Ownership
+        of the actions are not transferred in addAction, thus the need
+        to maintain references here.
+        '''
+        self.__scaleact = QAction(self.tr("&Scale"), self,
+                                shortcut=self.tr("Ctrl+S"),
+                                statusTip=self.tr("Scale the image (canvas and image change size)"),
+                                triggered=self.inquireSceneScale)
+        self.__saveact = QAction(self.tr("Save &As..."), self,
+                                shortcut=self.tr("Ctrl+A"),
+                                statusTip=self.tr("Save the image to file"),
+                                triggered=self.inquireSaveFilename)
+        self.__redrawact = QAction(self.tr("&Redraw"), self,
+                                shortcut=self.tr("Ctrl+R"),
+                                statusTip=self.tr("Clear and redraw the image"),
+                                triggered=self.redrawScene)
+        self.__aboutact = QAction(self.tr("&About"), self,
+                                statusTip=self.tr("Show information about this viewer"),
+                                triggered=self.aboutMsg)
+        self.__aboutqtact = QAction(self.tr("About &Qt"), self,
+                                statusTip=self.tr("Show information about the Qt library"),
+                                triggered=self.aboutQtMsg)
+        self.__exitact = QAction(self.tr("&Exit"), self,
+                                statusTip=self.tr("Shut down the viewer"),
+                                triggered=self.exitViewer)
+
+    def createMenus(self):
+        '''
+        Create the menu items for the viewer
+        using the previously created actions.
+        '''
+        menuBar = self.menuBar()
+        sceneMenu = menuBar.addMenu(menuBar.tr("&Image"))
+        sceneMenu.addAction(self.__scaleact)
+        sceneMenu.addAction(self.__saveact)
+        sceneMenu.addAction(self.__redrawact)
+        # sceneMenu.addSeparator()
+        # sceneMenu.addAction(self.__hideact)
+        helpMenu = menuBar.addMenu(menuBar.tr("&Help"))
+        helpMenu.addAction(self.__aboutact)
+        helpMenu.addAction(self.__aboutqtact)
+        helpMenu.addSeparator()
+        helpMenu.addAction(self.__exitact)
+
+    def showEvent(self, event):
+        '''
+        When the viewer is going to be shown, make sure all
+        the current pictures are displayed in the scene.
+        '''
+        # update, ignoring the visibility flags
+        self.drawLastPictures(True)
+        event.accept()
+
+    def resizeEvent(self, event):
+        '''
+        Monitor resizing in case auto-scaling of the image is selected.
+        '''
+        if self.__autoscale:
+            if self.autoScaleScene():
+                # continue with the window resize
+                event.accept()
+            else:
+                # another resize coming in, so ignore this one
+                event.ignore()
+        else:
+            # continue with the window resize
+            event.accept()
+
+    def closeEvent(self, event):
+        '''
+        Override so the viewer cannot be closed from the
+        user selecting the windowframe close ('X') button.
+        Instead only hide the window.
+        '''
+        if self.__shuttingdown:
+            event.accept()
+        else:
+            event.ignore()
+            self.hide()
+
+    def exitViewer(self):
+        '''
+        Close and exit the viewer.
+        '''
+        self.__timer.stop()
+        self.__shuttingdown = True
+        self.close()
+
+    def aboutMsg(self):
+        QMessageBox.about(self, self.tr("About PipedViewerPQ"),
+            self.tr("\n" \
+            "PipedViewerPQ is a graphics viewer application that " \
+            "receives its drawing and other commands primarily from " \
+            "another application through a pipe.  A limited number " \
+            "of commands are provided by the viewer itself to allow " \
+            "saving and some manipulation of the displayed image.  " \
+            "The controlling application, however, may be unaware " \
+            "of these modifications made to the image. " \
+            "\n\n" \
+            "Normally, the controlling program will exit the viewer " \
+            "when it is no longer needed.  The Help -> Exit menu item " \
+            "should not normally be used.  It is provided when problems " \
+            "occur and the controlling program cannot shut down the " \
+            "viewer properly. " \
+            "\n\n" \
+            "PipedViewerPQ was developed by the Thermal Modeling and Analysis " \
+            "Project (TMAP) of the National Oceanographic and Atmospheric " \
+            "Administration's (NOAA) Pacific Marine Environmental Lab (PMEL). "))
+
+    def aboutQtMsg(self):
+        QMessageBox.aboutQt(self, self.tr("About Qt"))
+
+    def paintScene(self, painter, first, leftx, uppery, scalefactor,
+                   statusmsg, returnregion):
+        '''
+        Draws the pictures self.__viewpics[first:] using the QPainter
+        painter.  This QPainter should have been initialized
+        appropriately for the QPaintDevice to which it is painting
+        (e.g., QImage.fill with the desired background color).
+
+        The point (leftx, uppery) is the offset of the origin after
+        scaling using scalefactor.  (All are floating point values.)
+
+        The status bar will be updated with a message derived from
+        statusmsg before drawing each picture.  Upon completion, the
+        status bar will be cleared.
+
+        If returnregion is True, a list of QRect objects describing
+        the modified regions will be computed and returned.  If
+        returnregion is False, the modified region will not be computed
+        and an empty list will be returned.
+
+        The call to painter.end() will need to be made after calling
+        this function.
+        '''
+        # change the cursor to warn the user this may take some time
+        QApplication.setOverrideCursor(Qt.WaitCursor)
+        # create the incomplete status message
+        if (first + 1) < len(self.__viewpics):
+            mymsg = self.tr("%s (piece %%1 of %%2)" % statusmsg)
+            endstr = str(len(self.__viewpics))
+        else:
+            mymsg = self.tr("%s (piece %%1)" % statusmsg)
+            endstr = None
+        # get the origin for drawing the pictures after scaling
+        myorigin = QPointF(leftx, uppery)
+        # set the scaling factor for the pictures
+        painter.scale(scalefactor, scalefactor)
+        modrects = [ ]
+        # draw the appropriate pictures
+        k = first
+        for (viewpic, _) in self.__viewpics[first:]:
+            k += 1
+            # show the progress message
+            if endstr != None:
+                self.statusBar().showMessage( mymsg.arg(str(k)).arg(endstr) )
+            else:
+                self.statusBar().showMessage( mymsg.arg(str(k)) )
+            # draw the picture
+            painter.drawPicture(myorigin, viewpic)
+            if returnregion:
+                picrect = viewpic.boundingRect()
+                if picrect.isValid():
+                    # Expand the region to account for possible symbols
+                    xval = picrect.x() - 0.5 * self.__maxsymbolwidth
+                    yval = picrect.y() - 0.5 * self.__maxsymbolheight
+                    width = picrect.width() + self.__maxsymbolwidth
+                    height = picrect.height() + self.__maxsymbolheight
+                    # Scale and translate the region, then convert to integer
+                    xval = int( math.floor(xval * scalefactor + leftx) )
+                    width = int( math.ceil(width * scalefactor) )
+                    yval = int( math.floor(yval * scalefactor + uppery) )
+                    height = int( math.ceil(height * scalefactor) )
+                    # Add this rectangle to the list
+                    modrects.append( QRect(xval, yval, width, height) )
+        # done - clear the status message
+        self.statusBar().clearMessage()
+        # restore the cursor back to normal
+        QApplication.restoreOverrideCursor()
+        return modrects
+
+    def drawLastPictures(self, ignorevis):
+        '''
+        Update the scene with pictures yet to be drawn.
+        If ignorevis is True, the update will be done
+        even if the viewer is not visible; otherwise
+        drawing to the scene label is only done if the
+        viewer is visible.
+        '''
+        if not ignorevis:
+            if self.isHidden() or self.isMinimized():
+                # Not shown, so do not waste time drawing
+                return
+        if self.__createpixmap:
+            # Create and assign a cleared pixmap
+            mypixmap = QPixmap(self.__label.size())
+            mypixmap.fill(self.__lastclearcolor)
+            self.__label.setPixmap(mypixmap)
+            self.__createpixmap = False
+            self.__clearpixmap = False
+            wascleared = True
+        elif self.__clearpixmap:
+            # Clear the existing pixmap
+            self.__label.pixmap().fill(self.__lastclearcolor)
+            self.__clearpixmap = False
+            wascleared = True
+        elif len(self.__viewpics) > self.__lastpicdrawn:
+            # New pictures to add to an existing scene
+            wascleared = False
+        else:
+            # Nothing changed so just return
+            return
+        # Only create the QPainter if there are pictures
+        # to draw (this is more than just a clear)
+        if len(self.__viewpics) > self.__lastpicdrawn:
+            painter = QPainter(self.__label.pixmap())
+            modrects = self.paintScene(painter, self.__lastpicdrawn, \
+                                       0.0, 0.0, self.__scalefactor, \
+                                       "Drawing", not wascleared)
+            painter.end()
+        # Notify the label of changes to the scene
+        if wascleared:
+            # the entire scene changed
+            self.__label.update()
+        else:
+            # the scene changed only in the modrects areas
+            for rect in modrects:
+                self.__label.update(rect)
+        # Update the record of which pictures have been displayed
+        self.__lastpicdrawn = len(self.__viewpics)
+
+    def clearScene(self, bkgcolor):
+        '''
+        Removes all view pictures, and fills the scene with bkgcolor.
+        If bkgcolor is None or an invalid color, the color used is 
+        the one used from the last clearScene or redrawScene call 
+        with a valid color (or opaque white if a color has never 
+        been specified).
+        '''
+        # If there is an active View with content,
+        # end it now, but do not update the scene
+        if self.__activepainter and (self.__drawcount > 0):
+            self.endView(False)
+            restartview = True
+        else:
+            restartview = False
+        # get the color to use for clearing (the background color)
+        if bkgcolor:
+            if bkgcolor.isValid():
+                self.__lastclearcolor = bkgcolor
+        # Delete all the pictures from the list and
+        # mark that the pixmap needs to be cleared
+        self.__viewpics[:] = [ ]
+        self.__maxsymbolwidth = 0.0
+        self.__maxsymbolheight = 0.0
+        self.__clearpixmap = True
+        self.__lastpicdrawn = 0
+        # Update the scene label if visible
+        self.drawLastPictures(False)
+        # If there was an non-empty active View, restart it
+        if restartview:
+            self.beginViewFromSides(self.__fracsides, self.__clipit)
+
+    def redrawScene(self, bkgcolor=None):
+        '''
+        Clear the scene using the given background color and redraw all 
+        the pictures to the displayed scene.  If bkgcolor is None or an 
+        invalid color, the color used is the one used from the last 
+        clearScene or redrawScene call with a valid color (or opaque 
+        white if a color has never been specified).
+        '''
+        # If there is an active View, end it now, but do not update the scene
+        if self.__activepainter:
+            self.endView(False)
+            hadactiveview = True
+        else:
+            hadactiveview = False
+        if bkgcolor:
+            if bkgcolor.isValid():
+                self.__lastclearcolor = bkgcolor
+        # mark that the pixmap needs to be cleared
+        # and all the pictures redrawn
+        self.__clearpixmap = True
+        self.__lastpicdrawn = 0
+        # Update the scene label if visible
+        self.drawLastPictures(False)
+        # If there was an active View, restart it in this new system
+        if hadactiveview:
+            self.beginViewFromSides(self.__fracsides, self.__clipit)
+
+    def resizeScene(self, width, height):
+        '''
+        Resize the scene to the given width and height in units of pixels.
+        '''
+        newwidth = int(width + 0.5)
+        if newwidth < self.__minsize:
+            newwidth = self.__minsize
+        newheight = int(height + 0.5)
+        if newheight < self.__minsize:
+            newheight = self.__minsize
+        if (newwidth != self.__scenewidth) or (newheight != self.__sceneheight):
+            # Resize the label and set label values
+            # so the scrollarea knows of the new size
+            labelwidth = int(newwidth * self.__scalefactor + 0.5)
+            labelheight = int(newheight * self.__scalefactor + 0.5)
+            self.__label.setMinimumSize(labelwidth, labelheight)
+            self.__label.resize(labelwidth, labelheight)
+            # mark that the pixmap needs to be recreated
+            self.__scenewidth = newwidth
+            self.__sceneheight = newheight
+            self.__createpixmap = True
+            # If auto-scaling, set scaling factor to 1.0 and resize the window
+            if self.__autoscale:
+                self.__scalefactor = 1.0
+                barheights = self.menuBar().height() + self.statusBar().height()
+                self.resize(newwidth + self.__framedelta, 
+                            newheight + self.__framedelta + barheights)
+                # the resize should redraw the scene
+            else:
+                # Redraw the scene from the beginning using the scaling factor
+                self.redrawScene()
+
+
+    def inquireSceneScale(self):
+        '''
+        Prompt the user for the desired scaling factor for the scene.
+        '''
+        labelwidth = int(self.__scenewidth * self.__scalefactor + 0.5)
+        labelheight = int(self.__sceneheight * self.__scalefactor + 0.5)
+        scaledlg = ScaleDialogPQ(self.__scalefactor, labelwidth, labelheight,
+                       self.__minsize, self.__minsize, self.__autoscale, self)
+        if scaledlg.exec_():
+            (newscale, autoscale, okay) = scaledlg.getValues()
+            if okay:
+                if autoscale:
+                    self.__autoscale = True
+                    self.autoScaleScene()
+                else:
+                    self.__autoscale = False
+                    self.scaleScene(newscale, False)
+
+    def autoScaleScene(self):
+        '''
+        Selects a scaling factor that maximizes the scene within the window 
+        frame without requiring scroll bars.  Intended to be called when
+        the window size is changed by the user and auto-scaling is turn on.
+
+        Returns:
+            True if the scene was resized
+            False if the a new resize command was issued
+        '''
+        barheights = self.menuBar().height() + self.statusBar().height()
+
+        # get the size for the central widget
+        cwheight = self.height() - barheights - self.__framedelta
+        heightsf = float(cwheight) / float(self.__sceneheight)
+
+        cwwidth = self.width() - self.__framedelta
+        widthsf = float(cwwidth) / float(self.__scenewidth)
+
+        if heightsf < widthsf:
+            factor = heightsf
+        else:
+            factor = widthsf
+
+        newcwheight = int(factor * self.__sceneheight + 0.5)
+        newcwwidth = int(factor * self.__scenewidth + 0.5)
+
+        # if the window does not have the correct aspect ratio, resize it so 
+        # it will; this will generate another call to this method.  Otherwise,
+        # scale the scene and be done.
+        if self.isMaximized() or \
+           ( (abs(cwheight - newcwheight) <= self.__framedelta) and \
+             (abs(cwwidth - newcwwidth) <= self.__framedelta) ):
+            self.scaleScene(factor, False)
+            return True
+        else:
+            self.resize(newcwwidth + self.__framedelta, 
+                        newcwheight + self.__framedelta + barheights)
+            return False
+
+    def scaleScene(self, factor, resizewin):
+        '''
+        Scales both the horizontal and vertical directions by factor.
+        Scaling factors are not accumulative.  So if the scene was
+        already scaled, that scaling is "removed" before this scaling
+        factor is applied.  If resizewin is True, the main window is 
+        resized to accommodate this new scaled scene size.
+        '''
+        newfactor = float(factor)
+        newlabwidth = int(newfactor * self.__scenewidth + 0.5)
+        newlabheight = int(newfactor * self.__sceneheight + 0.5)
+        if (newlabwidth < self.__minsize) or (newlabheight < self.__minsize):
+            # Set to minimum size
+            if self.__scenewidth <= self.__sceneheight:
+                newfactor = float(self.__minsize) / float(self.__scenewidth)
+            else:
+                newfactor = float(self.__minsize) / float(self.__sceneheight)
+            newlabwidth = int(newfactor * self.__scenewidth + 0.5)
+            newlabheight = int(newfactor * self.__sceneheight + 0.5)
+        oldlabwidth = int(self.__scalefactor * self.__scenewidth + 0.5)
+        oldlabheight = int(self.__scalefactor * self.__sceneheight + 0.5)
+        if (newlabwidth != oldlabwidth) or (newlabheight != oldlabheight):
+            # Set the new scaling factor
+            self.__scalefactor = newfactor
+            # Resize the label and set label values
+            # so the scrollarea knows of the new size
+            self.__label.setMinimumSize(newlabwidth, newlabheight)
+            self.__label.resize(newlabwidth, newlabheight)
+            # mark that the pixmap needs to be recreated
+            self.__createpixmap = True
+            # Redraw the scene from the beginning
+            self.redrawScene()
+        if resizewin:
+            # resize the main window (if possible)
+            barheights = self.menuBar().height() + self.statusBar().height()
+            mwheight = newlabheight + barheights + self.__framedelta
+            mwwidth = newlabwidth + self.__framedelta
+            # Do not exceed the available real estate on the screen.
+            # If autoscaling is in effect, the resize will trigger 
+            # any required adjustments.
+            scrnrect = QApplication.desktop().availableGeometry()
+            if mwwidth > 0.95 * scrnrect.width():
+                mwwidth = int(0.9 * scrnrect.width())
+            if mwheight > 0.95 * scrnrect.height():
+                mwheight = int(0.9 * scrnrect.height())
+            self.resize(mwwidth, mwheight)
+
+    def inquireSaveFilename(self):
+        '''
+        Prompt the user for the name of the file into which to save the scene.
+        The file format will be determined from the filename extension.
+        '''
+        formattypes = [ ( "png",
+                          self.tr("PNG - Portable Networks Graphics (*.png)") ),
+                        ( "jpeg",
+                          self.tr("JPEG - Joint Photographic Experts Group (*.jpeg *.jpg *.jpe)") ),
+                        ( "tiff",
+                          self.tr("TIFF - Tagged Image File Format (*.tiff *.tif)") ),
+                        ( "pdf",
+                          self.tr("PDF - Portable Document Format (*.pdf)") ),
+                        ( "ps",
+                          self.tr("PS - PostScript (*.ps)") ),
+                        ( "bmp",
+                          self.tr("BMP - Windows Bitmap (*.bmp)") ),
+                        ( "ppm",
+                          self.tr("PPM - Portable Pixmap (*.ppm)") ),
+                        ( "xpm",
+                          self.tr("XPM - X11 Pixmap (*.xpm)") ),
+                        ( "xbm",
+                          self.tr("XBM - X11 Bitmap (*.xbm)") ), ]
+        if HAS_QSvgGenerator:
+            formattypes.insert(5, ( "svg",
+                          self.tr("SVG - Scalable Vector Graphics (*.svg)") ) )
+        # tr returns QStrings so the following does not work
+        # filters = ";;".join( [ t[1] for t in formattypes ] )
+        filters = QString(formattypes[0][1])
+        for typePair in formattypes[1:]:
+            filters.append(";;")
+            filters.append(typePair[1])
+        # getSaveFileNameAndFilter does not want to accept a default filter
+        # for (fmt, fmtQName) in formattypes:
+        #     if self.__lastformat == fmt:
+        #         dfltfilter = fmtQName
+        #         break
+        # else:
+        #     dfltfilter = formattypes[0][1]
+        # getSaveFileNameAndFilter is a PyQt (but not Qt?) method
+        (fileName, fileFilter) = QFileDialog.getSaveFileNameAndFilter(self,
+                                      self.tr("Save the current image as "),
+                                      self.__lastfilename, filters)
+        if fileName:
+            for (fmt, fmtQName) in formattypes:
+                if fmtQName.compare(fileFilter) == 0:
+                    fileFormat = fmt
+                    break
+            else:
+                raise RuntimeError( self.tr("Unexpected file format name '%1'") \
+                                        .arg(fileFilter) )
+            self.saveSceneToFile(fileName, fileFormat, None, 
+                                 None, None, None)
+            self.__lastfilename = fileName
+            self.__lastformat = fileFormat
+
+    def saveSceneToFile(self, filename, imageformat, transparent, 
+                        vectsize, rastsize, annotations):
+        '''
+        Save the current scene to the named file.  If imageformat
+        is empty or None, the format is guessed from the filename
+        extension.
+
+        If transparent is False, the entire scene is initialized
+        to the last clearing color used, using a filled rectangle 
+        for vector images.
+
+        If given, vectsize is the size in inches of a saved vector 
+        image.  If vectsize is not given, a vector image will be 
+        saved at the current displayed scaled image size, unless
+        specified otherwise if showPrintDialog is True.  
+
+        If given, rastsize is the pixels size of a saved raster 
+        image.  If rastsize is not given, a raster image will be 
+        saved at the current displayed scaled image size.  
+
+        If annotations is not None, the strings given in the tuple
+        are to be displayed above the image.  These annotations add 
+        height, as needed, to the saved image (i.e., vectsize or 
+        rastsize gives the height of the image below these annotations).
+        '''
+        # This could be called when there is no scene present.
+        # If this is the case, ignore the call.
+        if len(self.__viewpics) == 0:
+            return
+        if not imageformat:
+            # Guess the image format from the filename extension
+            # to determine if it is a vector type, and if so,
+            # which type. All the raster types use a QImage, which
+            # does this guessing of format when saving the image.
+            fileext = ( os.path.splitext(filename)[1] ).lower()
+            if fileext == '.pdf':
+                # needs a PDF QPrinter
+                myformat = 'pdf'
+            elif fileext == '.ps':
+                # needs a PS QPrinter
+                myformat = 'ps'
+            elif fileext == '.svg':
+                # needs a QSvgGenerator
+                myformat = 'svg'
+            elif fileext == '.plt':
+                # check for plt (gks metafile) - needs to be changed to pdf
+                myformat = 'plt'
+            elif fileext == '.gif':
+                # check for gif - needs to be changed to png
+                myformat = 'gif'
+            else:
+                # use a QImage and let it figure out the format
+                myformat = None
+        else:
+            myformat = imageformat.lower()
+
+        if myformat == 'plt':
+            # Silently convert plt filename and format to pdf
+            myformat = 'pdf'
+            myfilename = os.path.splitext(filename)[0] + ".pdf"
+        elif myformat == 'gif':
+            # Silently convert gif filename and format to png
+            myformat = 'png'
+            myfilename = os.path.splitext(filename)[0] + ".png"
+        else:
+            myfilename = filename
+
+        # The RHEL5 distribution of Qt4 does not have a QSvgGenerator
+        if (not HAS_QSvgGenerator) and (myformat == 'svg'):
+            raise ValueError( self.tr("Your version of Qt does not " \
+                                      "support generation of SVG files") )
+
+        if annotations:
+            annopicture = QPicture()
+            annopainter = QPainter(annopicture)
+            annotextdoc = QTextDocument()
+            # Leave room for the added margins to the width
+            annotextdoc.setTextWidth(self.__scenewidth - 2.0 * self.__addedannomargin)
+            annotextdoc.setHtml("<p>" + "<br />".join(annotations) + "</p>")
+            annotextdoc.drawContents(annopainter)
+            annopainter.end()
+            annosize = annotextdoc.documentLayout().documentSize()
+        else:
+            annopicture = None
+            annosize = None
+
+        if (myformat == 'ps') or (myformat == 'pdf'):
+            # Setup the QPrinter that will be used to create the PS or PDF file
+            printer = QPrinter(QPrinter.HighResolution)
+            printer.setOutputFileName(myfilename)
+            # The print format is automatically set from the
+            # filename extension; so the following is actually
+            # only needed for absent or strange extensions
+            if myformat == 'ps':
+                printer.setOutputFormat(QPrinter.PostScriptFormat)
+            else:
+                printer.setOutputFormat(QPrinter.PdfFormat)
+            # Print to file in color
+            printer.setColorMode(printer.Color)
+            # get the width and height in inches of the image to be produced
+            if vectsize:
+                imagewidth = vectsize.width()
+                imageheight = vectsize.height()
+            else:
+                imagewidth = self.__scenewidth * self.__scalefactor \
+                             / float(self.physicalDpiX())
+                imageheight = self.__sceneheight * self.__scalefactor \
+                              / float(self.physicalDpiY())
+            # Add in any height needed for the annotations
+            if annopicture:
+                annoheight = (annosize.height() + 2 * self.__addedannomargin) * \
+                             imageheight / self.__sceneheight
+                imageheight += annoheight
+            # Set the image size
+            try:
+                # Set custom paper size to just fit around the image
+                # printer.setPaperSize(QSizeF(imagewidth, imageheight),
+                #                      QPrinter.Inch)
+                # The above has issues with Qt 4.6 at GFDL - 
+                # still puts it on the default letter size page.
+                # So just always use a letter size page.
+                printer.setPaperSize(QPrinter.Letter)
+            except AttributeError:
+                # setPaperSize introduced in 4.4 and made setPageSize 
+                # obsolete; but RHEL5 Qt4 is 4.2, so set to letter size
+                printer.setPageSize(QPrinter.Letter)
+            # No margins (setPageMargins introduced in 4.4)
+            printer.setFullPage(True)
+            # Default orientation
+            if ( imagewidth > imageheight ):
+                printer.setOrientation(QPrinter.Landscape)
+            else:
+                printer.setOrientation(QPrinter.Portrait)
+            # also get the image size in units of printer dots
+            printres = printer.resolution()
+            printwidth = int(imagewidth * printres + 0.5)
+            printheight = int(imageheight * printres + 0.5)
+            # Set up to draw to the QPrinter
+            painter = QPainter(printer)
+            if not transparent:
+                # Draw a rectangle filling the entire scene
+                # with the last clearing color.
+                # Only draw if not completely transparent
+                if (self.__lastclearcolor.getRgb())[3] > 0:
+                    painter.fillRect(QRectF(0, 0, printwidth, printheight), 
+                                     self.__lastclearcolor)
+            # Scaling printfactor for the scene to the saved image
+            widthscalefactor = imagewidth * self.physicalDpiX() / float(self.__scenewidth)
+            # Check if there are annotations to add
+            if annopicture:
+                # Scale the scene now for the annotations
+                painter.scale(widthscalefactor, widthscalefactor)
+                # factor that makes it work after scaling (12.5 = 1200 / 96)
+                printfactor = printres / self.physicalDpiX()
+                # Draw a solid white rectangle with black outline for the annotations
+                painter.setBrush(QBrush(Qt.white, Qt.SolidPattern))
+                painter.setPen(QPen(QBrush(Qt.black, Qt.SolidPattern), 
+                                    2.0 * printfactor, Qt.SolidLine, Qt.SquareCap, Qt.MiterJoin))
+                painter.drawRect(QRectF(1.0 * printfactor, 1.0 * printfactor, 
+                    (self.__scenewidth - 2.0) * printfactor, 
+                    ((annosize.height() + 2.0 * self.__addedannomargin) - 2.0) * printfactor))
+                # And add the annotations within this box
+                painter.drawPicture(QPointF(self.__addedannomargin * printfactor,
+                                            self.__addedannomargin * printfactor), 
+                                    annopicture)
+                # Draw the scene to the printer - scaling already in effect
+                self.paintScene(painter, 0, 0.0, 
+                        (annosize.height() + 2.0 * self.__addedannomargin) * printfactor, 
+                        1.0, "Saving", False)
+            else:
+                # No annotations so just do the normal drawing
+                self.paintScene(painter, 0, 0.0, 0.0, 
+                                widthscalefactor, "Saving", False)                
+            painter.end()
+        elif myformat == 'svg':
+            # if HAS_QSvgGenerator is False, it should never get here
+            generator = QSvgGenerator()
+            generator.setFileName(myfilename)
+            if vectsize:
+                imagewidth = int(vectsize.width() * self.physicalDpiX() + 0.5)
+                imageheight = int(vectsize.height() * self.physicalDpiY() + 0.5)
+            else:
+                imagewidth = int(self.__scenewidth * self.__scalefactor + 0.5)
+                imageheight = int(self.__sceneheight * self.__scalefactor + 0.5)
+            # Add in any height needed for the annotations
+            if annopicture:
+                annoheight = (annosize.height() + 2 * self.__addedannomargin) * \
+                             imageheight / self.__sceneheight
+                imageheight += annoheight
+            # Set the image size
+            generator.setResolution(
+                    int(0.5 * (self.physicalDpiX() + self.physicalDpiY()) + 0.5) )
+            generator.setSize( QSize(imagewidth, imageheight) )
+            generator.setViewBox( QRect(0, 0, imagewidth, imageheight) )
+            # paint the scene to this QSvgGenerator
+            painter = QPainter(generator)
+            if not transparent:
+                # Draw a rectangle filling the entire scene
+                # with the last clearing color.
+                # Only draw if not completely transparent
+                if (self.__lastclearcolor.getRgb())[3] > 0:
+                    painter.fillRect( QRectF(0, 0, imagewidth, imageheight),
+                                      self.__lastclearcolor )
+            # Scaling printfactor for the scene to the saved image
+            widthscalefactor = imagewidth / float(self.__scenewidth)
+            # Check if there are annotations to add
+            if annopicture:
+                # Scale the scene now for the annotations
+                painter.scale(widthscalefactor, widthscalefactor)
+                # Draw a solid white rectangle with black outline for the annotations
+                painter.setBrush(QBrush(Qt.white, Qt.SolidPattern))
+                painter.setPen(QPen(QBrush(Qt.black, Qt.SolidPattern), 
+                                    2.0, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin))
+                painter.drawRect(QRectF(1.0, 1.0, 
+                            self.__scenewidth - 2.0, 
+                            annosize.height() + 2.0 * self.__addedannomargin - 2.0))
+                # And add the annotations within this box
+                painter.drawPicture(QPointF(self.__addedannomargin,self.__addedannomargin), 
+                                    annopicture)
+                # Draw the scene to the printer - scaling already in effect
+                self.paintScene(painter, 0, 
+                                0.0, annosize.height() + 2.0 * self.__addedannomargin, 
+                                1.0, "Saving", False)
+            else:
+                # No annotations so just do the normal drawing
+                self.paintScene(painter, 0, 0.0, 0.0, 
+                                widthscalefactor, "Saving", False)                
+            painter.end()
+        else:
+            if rastsize:
+                imagewidth = int(rastsize.width() + 0.5)
+                imageheight = int(rastsize.height() + 0.5)
+            else:
+                imagewidth = int(self.__scenewidth * self.__scalefactor + 0.5)
+                imageheight = int(self.__sceneheight * self.__scalefactor + 0.5)
+            # Add in any height needed for the annotations
+            if annopicture:
+                annoheight = (annosize.height() + 2 * self.__addedannomargin) * \
+                             imageheight / self.__sceneheight
+                imageheight += annoheight
+            # Create the image
+            image = QImage( QSize(imagewidth, imageheight),
+                            QImage.Format_ARGB32_Premultiplied )
+            # Initialize the image
+            # Note that completely transparent gives black for formats not supporting 
+            # the alpha channel (JPEG) whereas ARGB32 with 0x00FFFFFF gives white
+            if not transparent:
+                # Clear the image with self.__lastclearcolor
+                fillint = self.__helper.computeARGB32PreMultInt(self.__lastclearcolor)
+            else:
+                fillint = 0
+            image.fill(fillint)
+            # paint the scene to this QImage
+            painter = QPainter(image)
+            # Scaling printfactor for the scene to the saved image
+            widthscalefactor = imagewidth / float(self.__scenewidth)
+            # Check if there are annotations to add
+            if annopicture:
+                # Scale the scene now for the annotations
+                painter.scale(widthscalefactor, widthscalefactor)
+                # Draw a solid white rectangle with black outline for the annotations
+                painter.setBrush(QBrush(Qt.white, Qt.SolidPattern))
+                painter.setPen(QPen(QBrush(Qt.black, Qt.SolidPattern), 
+                                    2.0, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin))
+                painter.drawRect(QRectF(1.0, 1.0, 
+                            self.__scenewidth - 2.0, 
+                            annosize.height() + 2.0 * self.__addedannomargin - 2.0))
+                # And add the annotations within this box
+                painter.drawPicture(QPointF(self.__addedannomargin,self.__addedannomargin), 
+                                    annopicture)
+                # Draw the scene to the printer - scaling already in effect
+                self.paintScene(painter, 0, 
+                                0.0, annosize.height() + 2.0 * self.__addedannomargin, 
+                                1.0, "Saving", False)
+            else:
+                # No annotations so just do the normal drawing
+                self.paintScene(painter, 0, 0.0, 0.0, 
+                                widthscalefactor, "Saving", False)                
+            painter.end()
+            # save the image to file
+            image.save(myfilename, myformat)
+
+    def checkCommandPipe(self):
+        '''
+        Get and perform commands waiting in the pipe.
+        Stop when no more commands or if more than 50
+        milliseconds have passed.
+        '''
+        try:
+            starttime = time.clock()
+            # Wait up to 2 milliseconds waiting for a command.
+            # This prevents unchecked spinning when there is
+            # nothing to do (Qt immediately calling this method
+            # again only for this method to immediately return).
+            while self.__cmndpipe.poll(0.002):
+                cmnd = self.__cmndpipe.recv()
+                self.processCommand(cmnd)
+                # Continue to try to process commands until
+                # more than 50 milliseconds have passed.
+                # This reduces Qt overhead when there are lots
+                # of commands waiting in the queue.
+                if (time.clock() - starttime) > 0.050:
+                    break
+        except Exception:
+            # EOFError should never arise from recv since
+            # the call is after poll returns True
+            (exctype, excval) = sys.exc_info()[:2]
+            if excval:
+                self.__rspdpipe.send("**ERROR %s: %s" % (str(exctype), str(excval)))
+            else:
+                self.__rspdpipe.send("**ERROR %s" % str(exctype))
+            self.exitViewer()
+
+    def processCommand(self, cmnd):
+        '''
+        Examine the action of cmnd and call the appropriate
+        method to deal with this command.  Raises a KeyError
+        if the "action" key is missing.
+        '''
+        try:
+            cmndact = cmnd["action"]
+        except KeyError:
+            raise ValueError( self.tr("Unknown command %1").arg(str(cmnd)) )
+
+        if cmndact == "clear":
+            try:
+                bkgcolor = self.__helper.getColorFromCmnd(cmnd)
+            except KeyError:
+                bkgcolor = None
+            self.clearScene(bkgcolor)
+        elif cmndact == "exit":
+            self.exitViewer()
+        elif cmndact == "hide":
+            self.hide()
+        elif cmndact == "screenInfo":
+            scrnrect = QApplication.desktop().availableGeometry()
+            info = ( self.physicalDpiX(), self.physicalDpiY(),
+                     scrnrect.width(), scrnrect.height() )
+            self.__rspdpipe.send(info)
+        elif cmndact == "antialias":
+            self.__antialias = bool(cmnd.get("antialias", True))
+        elif cmndact == "update":
+            self.updateScene()
+        elif cmndact == "redraw":
+            try:
+                bkgcolor = self.__helper.getColorFromCmnd(cmnd)
+            except KeyError:
+                bkgcolor = None
+            self.redrawScene(bkgcolor)
+        elif cmndact == "rescale":
+            newscale = float(cmnd["factor"])
+            if newscale <= 0.0:
+                raise ValueError("invalid scaling factor")
+            self.scaleScene(newscale, True)
+        elif cmndact == "resize":
+            mysize = self.__helper.getSizeFromCmnd(cmnd)
+            self.resizeScene(mysize.width(), mysize.height())
+        elif cmndact == "save":
+            filename = cmnd["filename"]
+            fileformat = cmnd.get("fileformat", None)
+            transparent = cmnd.get("transparent", False)
+            vectsize = self.__helper.getSizeFromCmnd(cmnd["vectsize"])
+            rastsize = self.__helper.getSizeFromCmnd(cmnd["rastsize"])
+            annotations = cmnd["annotations"]
+            self.saveSceneToFile(filename, fileformat, transparent, 
+                                 vectsize, rastsize, annotations)
+        elif cmndact == "setWidthFactor":
+            newfactor = float(cmnd.get("factor", -1.0))
+            if newfactor <= 0.0:
+                raise ValueError( self.tr("Invalid width factor") )
+            self.setWidthScalingFactor(newfactor)
+        elif cmndact == "setTitle":
+            self.setWindowTitle(cmnd["title"])
+        elif cmndact == "imgname":
+            value = cmnd.get("name", None)
+            if value:
+                self.__lastfilename = value;
+            value = cmnd.get("format", None)
+            if value:
+                self.__lastformat = value.lower();
+        elif cmndact == "show":
+            if self.isHidden():
+                self.showNormal()
+        elif cmndact == "beginView":
+            self.beginView(cmnd)
+        elif cmndact == "clipView":
+            self.clipView(cmnd)
+        elif cmndact == "endView":
+            self.endView(True)
+        elif cmndact == "beginSegment":
+            self.beginSegment(cmnd["segid"])
+        elif cmndact == "endSegment":
+            self.endSegment(True)
+        elif cmndact == "deleteSegment":
+            self.deleteSegment(cmnd["segid"])
+        elif cmndact == "drawMultiline":
+            self.drawMultiline(cmnd)
+        elif cmndact == "drawPoints":
+            self.drawPoints(cmnd)
+        elif cmndact == "drawPolygon":
+            self.drawPolygon(cmnd)
+        elif cmndact == "drawRectangle":
+            self.drawRectangle(cmnd)
+        elif cmndact == "drawText":
+            self.drawSimpleText(cmnd)
+        else:
+            raise ValueError( self.tr("Unknown command action %1") \
+                                  .arg(str(cmndact)) )
+
+    def beginView(self, cmnd):
+        '''
+        Setup a new viewport and window for drawing on a portion
+        (possibly all) of the scene.  Recognized keys from cmnd
+        are:
+            "viewfracs": a dictionary of sides positions (see
+                    CmndHelperPQ.getSidesFromCmnd) giving the
+                    fractions [0.0, 1.0] of the way through the
+                    scene for the sides of the new View.
+            "clip": clip to the new View? (default: True)
+
+        Note that the view fraction values are based on (0,0) being the
+        top left corner and (1,1) being the bottom right corner.  Thus,
+        left < right and top < bottom.
+
+        Raises a KeyError if the "viewfracs" key is not given.
+        '''
+        # Get the view rectangle in fractions of the full scene
+        fracsides = self.__helper.getSidesFromCmnd(cmnd["viewfracs"])
+        # Should graphics be clipped to this view?
+        try:
+            clipit = cmnd["clip"]
+        except KeyError:
+            clipit = True
+        self.beginViewFromSides(fracsides, clipit)
+
+    def beginViewFromSides(self, fracsides, clipit):
+        '''
+        Setup a new viewport and window for drawing on a portion
+        (possibly all) of the scene.  The view in fractions of
+        the full scene are given in fracsides.  Sets the clipping
+        rectangle to this view.  If clipit is True, graphics
+        will be clipped to this view.
+        '''
+        # If a view is still active, automatically end it
+        if self.__activepainter:
+            self.endView(True)
+        # Get the location for the new view in terms of scene pixels.
+        width = float(self.__scenewidth)
+        height = float(self.__sceneheight)
+        leftpixel = fracsides.left() * width
+        rightpixel = fracsides.right() * width
+        bottompixel = fracsides.bottom() * height
+        toppixel = fracsides.top() * height
+        # perform the checks after turning into units of pixels
+        # to make sure the values are significantly different
+        if (0.0 > leftpixel) or (leftpixel >= rightpixel) or (rightpixel > width):
+            raise ValueError( self.tr("Invalid left, right view fractions: " \
+                                      "left in pixels = %1, right in pixels = %2") \
+                                  .arg(str(leftpixel)).arg(str(rightpixel)) )
+        if (0.0 > toppixel) or (toppixel >= bottompixel) or (bottompixel > height):
+            raise ValueError( self.tr("Invalid bottom, top view fractions: " \
+                                      "top in pixels = %1, bottom in pixels = %2") \
+                                  .arg(str(toppixel)).arg(str(bottompixel)) )
+        # Create the view rectangle in device coordinates
+        vrectf = QRectF(leftpixel, toppixel,
+                       rightpixel - leftpixel, bottompixel - toppixel)
+        # Create the new picture and painter
+        self.__activepicture = QPicture()
+        self.__activepainter = QPainter(self.__activepicture)
+        # Set the clip rectangle to that of the view; this also activates clipping
+        self.__activepainter.setClipRect(vrectf, Qt.ReplaceClip)
+        # Disable clipping if not desired at this time
+        if not clipit:
+            self.__activepainter.setClipping(False)
+        # Note that __activepainter has to end before __activepicture will
+        # draw anything.  So no need to add it to __viewpics until then.
+        self.__drawcount = 0
+        # Save the current view sides and clipit setting for recreating the view.
+        # Just save the original objects (assume calling functions do not keep them)
+        self.__fracsides = fracsides
+        self.__clipit = clipit
+
+    def clipView(self, cmnd):
+        '''
+        If cmnd["clip"] is True, activates clipping to the
+        current view rectangle.  If cmnd["clip"] is False,
+        disable clipping in this view.
+
+        Raises a KeyError if the "clip" key is not given.
+        '''
+        if cmnd["clip"]:
+            self.__activepainter.setClipping(True)
+            self.__clipit = True
+        else:
+            self.__activepainter.setClipping(False)
+            self.__clipit = False
+
+    def endView(self, update):
+        '''
+        Ends the current view and appends it to the list of pictures
+        drawn in the scene.  If update is True, the displayed scene
+        is updated.
+        '''
+        self.__activepainter.end()
+        self.__activepainter = None
+        # Only save the active picture if it contains something
+        if self.__drawcount > 0:
+            self.__viewpics.append((self.__activepicture, self.__segid))
+            self.__drawcount = 0
+        if update:
+            # update the scene
+            self.drawLastPictures(False)
+        self.__activepicture = None
+
+    def beginSegment(self, segid):
+        '''
+        Associates a segment ID with the current empty view
+        (picture) and all future views until endSegment is 
+        called.  If the current view is not empty, the current 
+        view is ended and a new view started.  If there is not
+        a active view, the segment ID is just saved for the
+        next active view.
+        '''
+        if self.__activepainter and (self.__drawcount > 0):
+            self.endView(True)
+            self.beginViewFromSides(self.__fracsides, self.__clipit)
+        self.__segid = segid
+        
+    def endSegment(self, update):
+        '''
+        Ends the current active view and starts a new view.
+        Removes the current segment ID associated with views.
+        '''
+        if self.__activepainter and (self.__drawcount > 0):
+            self.endView(update)
+            self.beginViewFromSides(self.__fracsides, self.__clipit)
+        if update:
+            self.drawLastPictures(False)
+        self.__segid = None
+
+    def deleteSegment(self, segid):
+        '''
+        Removes all pictures associated with the given segment ID
+        '''
+        # if deleting the current segment, end the current segment
+        if segid == self.__segid:
+            self.endSegment(False)
+        # Go through all the pictures, determining which to save
+        newpicts = [ ]
+        for (viewpic, vsegid) in self.__viewpics:
+            if vsegid != segid:
+                newpicts.append((viewpic, vsegid))
+            else:
+                # picture was deleted, so will need to 
+                # regenerate the scene from the beginning
+                self.__clearpixmap = True
+                self.__lastpicdrawn = 0
+        self.__viewpics[:] = newpicts
+        # Do NOT update since there may be more segments to be deleted
+        # Rely on the receiving an update or redraw command at the end 
+
+    def updateScene(self):
+        '''
+        Updates the displayed graphics to include all drawn elements.
+        '''
+        # If there is an active picture containing something,
+        # end the view, thus adding and display this picture,
+        # then restart the view.
+        if self.__drawcount > 0:
+            self.endView(True)
+            self.beginViewFromSides(self.__fracsides, self.__clipit)
+        self.drawLastPictures(False)
+
+    def drawMultiline(self, cmnd):
+        '''
+        Draws a collection of connected line segments.
+
+        Recognized keys from cmnd:
+            "points": consecutive endpoints of the connected line
+                    segments as a list of (x, y) coordinates
+            "pen": dictionary describing the pen used to draw the
+                    segments (see CmndHelperPQ.getPenFromCmnd)
+
+        The coordinates are device coordinates from the upper left corner.
+
+        Raises:
+            KeyError if the "points" or "pen" key is not given
+            ValueError if there are fewer than two endpoints given
+        '''
+        ptcoords = cmnd["points"]
+        if len(ptcoords) < 2:
+            raise ValueError("fewer that two endpoints given")
+        endpts = QPolygonF( [ QPointF(xypair[0], xypair[1]) \
+                                  for xypair in ptcoords ] )
+        mypen = self.__helper.getPenFromCmnd(cmnd["pen"])
+        self.__activepainter.setRenderHint(QPainter.Antialiasing,
+                                           self.__antialias)
+        self.__activepainter.setBrush(Qt.NoBrush)
+        self.__activepainter.setPen(mypen)
+        self.__activepainter.drawPolyline(endpts)
+        self.__drawcount += 1
+        # Limit the number of drawing commands per picture
+        if self.__drawcount >= self.__maxdraws:
+            self.updateScene()
+
+    def drawPoints(self, cmnd):
+        '''
+        Draws a collection of discrete points using a single symbol
+        for each point.
+
+        Recognized keys from cmnd:
+            "points": point centers as a list of (x,y) coordinates
+            "symbol": name of the symbol to use
+                    (see CmndHelperPQ.getSymbolFromCmnd)
+            "size": size of the symbol in points (1/72 inches); possibly
+                    further scaled by the width scaling factor
+            "color": color name or 24-bit RGB integer value (eg, 0xFF0088)
+            "alpha": alpha value from 0 (transparent) to 255 (opaque)
+
+        The coordinates are device coordinates from the upper left corner.
+
+        Raises a KeyError if the "symbol", "points", or "size" key
+        is not given.
+        '''
+        ptcoords = cmnd["points"]
+        ptsize = cmnd["size"]
+        sympath = self.__helper.getSymbolFromCmnd(cmnd["symbol"])
+        self.__activepainter.setRenderHint(QPainter.Antialiasing,
+                                           self.__antialias)
+        try:
+            mycolor = self.__helper.getColorFromCmnd(cmnd)
+            mybrush = QBrush(mycolor, Qt.SolidPattern)
+        except KeyError:
+            mybrush = QBrush(Qt.SolidPattern)
+        if sympath.isFilled():
+            self.__activepainter.setBrush(mybrush)
+            self.__activepainter.setPen(Qt.NoPen)
+        else:
+            self.__activepainter.setBrush(Qt.NoBrush)
+            # pen width is 15% of the width of the symbol
+            mypen = QPen(mybrush, 15.0, Qt.SolidLine,
+                         Qt.SquareCap, Qt.BevelJoin)
+            self.__activepainter.setPen(mypen)
+        # Unmodified symbols are 100x100 pixels 
+        scalefactor = ptsize * self.widthScalingFactor() / 100.0
+        if self.__maxsymbolwidth < 100.0 * scalefactor:
+            self.__maxsymbolwidth = 100.0 * scalefactor
+        if self.__maxsymbolheight < 100.0 * scalefactor:
+            self.__maxsymbolheight = 100.0 * scalefactor
+        for xyval in ptcoords:
+            # save so the translation and scale are not permanent
+            self.__activepainter.save()
+            try:
+                self.__activepainter.translate( QPointF(xyval[0], xyval[1]) )
+                self.__activepainter.scale(scalefactor, scalefactor)
+                self.__activepainter.drawPath(sympath.painterPath())
+            finally:
+                self.__activepainter.restore()
+        self.__drawcount += len(ptcoords)
+        # Limit the number of drawing commands per picture
+        if self.__drawcount >= self.__maxdraws:
+            self.updateScene()
+
+    def drawPolygon(self, cmnd):
+        '''
+        Draws a polygon item to the viewer.
+
+        Recognized keys from cmnd:
+            "points": the vertices of the polygon as a list of (x,y)
+                    coordinates
+            "fill": dictionary describing the brush used to fill the
+                    polygon; see CmndHelperPQ.getBrushFromCmnd
+                    If not given, the polygon will not be filled.
+            "outline": dictionary describing the pen used to outline
+                    the polygon; see CmndHelperPQ.getPenFromCmnd
+                    If not given, the border will be drawn with a
+                    cosmetic pen identical to the brush used to fill
+                    the polygon.
+
+        The coordinates are device coordinates from the upper left corner.
+
+        Raises a KeyError if the "points" key is not given.
+        '''
+        mypoints = cmnd["points"]
+        mypolygon = QPolygonF( [ QPointF(xypair[0], xypair[1]) \
+                                     for xypair in mypoints ] )
+        self.__activepainter.setRenderHint(QPainter.Antialiasing,
+                                           False)
+        try:
+            mybrush = self.__helper.getBrushFromCmnd(cmnd["fill"])
+        except KeyError:
+            mybrush = Qt.NoBrush
+        try:
+            mypen = self.__helper.getPenFromCmnd(cmnd["outline"])
+        except KeyError:
+            if ( mybrush == Qt.NoBrush ):
+                raise ValueError( self.tr('drawPolygon called without a Brush or Pen') )
+            # Use a cosmetic Pen matching the brush
+            mypen = QPen(mybrush, 0.0, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin)
+        self.__activepainter.setBrush(mybrush)
+        self.__activepainter.setPen(mypen)
+        self.__activepainter.drawPolygon(mypolygon)
+        self.__drawcount += 1
+        # Limit the number of drawing commands per picture
+        if self.__drawcount >= self.__maxdraws:
+            self.updateScene()
+
+    def drawRectangle(self, cmnd):
+        '''
+        Draws a rectangle in the current view using the information
+        in the dictionary cmnd.
+
+        Recognized keys from cmnd:
+            "left": x-coordinate of left edge of the rectangle
+            "bottom": y-coordinate of the bottom edge of the rectangle
+            "right": x-coordinate of the right edge of the rectangle
+            "top": y-coordinate of the top edge of the rectangle
+            "fill": dictionary describing the brush used to fill the
+                    rectangle; see CmndHelperPQ.getBrushFromCmnd
+                    If not given, the rectangle will not be filled.
+            "outline": dictionary describing the pen used to outline
+                    the rectangle; see CmndHelperPQ.getPenFromCmnd
+                    If not given, the border will be drawn with a
+                    cosmetic pen identical to the brush used to fill
+                    the rectangle.
+
+        The coordinates are device coordinates from the upper left corner.
+
+        Raises a ValueError if the width or height of the rectangle
+        is not positive.
+        '''
+        # get the left, bottom, right, and top values
+        # any keys not given get a zero value
+        sides = self.__helper.getSidesFromCmnd(cmnd)
+        width = sides.right() - sides.left()
+        if width <= 0.0:
+            raise ValueError("width of the rectangle in not positive")
+        height = sides.bottom() - sides.top()
+        if height <= 0.0:
+            raise ValueError("height of the rectangle in not positive")
+        myrect = QRectF(sides.left(), sides.top(), width, height)
+        self.__activepainter.setRenderHint(QPainter.Antialiasing,
+                                           False)
+        try:
+            mybrush = self.__helper.getBrushFromCmnd(cmnd["fill"])
+        except KeyError:
+            mybrush = Qt.NoBrush
+        try:
+            mypen = self.__helper.getPenFromCmnd(cmnd["outline"])
+        except KeyError:
+            if ( mybrush == Qt.NoBrush ):
+                raise ValueError( self.tr('drawPolygon called without a Brush or Pen') )
+            # Use a cosmetic Pen matching the brush
+            mypen = QPen(mybrush, 0.0, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin)
+        self.__activepainter.setBrush(mybrush)
+        self.__activepainter.setPen(mypen)
+        self.__activepainter.drawRect(myrect)
+        self.__drawcount += 1
+        # Limit the number of drawing commands per picture
+        if self.__drawcount >= self.__maxdraws:
+            self.updateScene()
+
+    def drawSimpleText(self, cmnd):
+        '''
+        Draws a "simple" text item in the current view.
+        Raises a KeyError if the "text" or "location" key is not given.
+
+        Recognized keys from cmnd:
+            "text": string to displayed
+            "font": dictionary describing the font to use;  see
+                    CmndHelperPQ.getFontFromCmnd.  If not given
+                    the default font for this viewer is used.
+            "fill": dictionary describing the pen used to draw the
+                    text; see CmndHelperPQ.getPenFromCmnd.
+                    If not given, the default pen for this viewer
+                    is used.
+            "rotate": clockwise rotation of the text in degrees
+            "location": (x,y) location for the baseline of the
+                    start of text.  The coordinates are device
+                    coordinates from the upper left corner.
+        '''
+        mytext = cmnd["text"]
+        startpt = cmnd["location"]
+        self.__activepainter.setRenderHint(QPainter.Antialiasing,
+                                           self.__antialias)
+        self.__activepainter.setBrush(Qt.NoBrush)
+        try:
+            mypen = self.__helper.getPenFromCmnd(cmnd["fill"])
+            self.__activepainter.setPen(mypen)
+        except KeyError:
+            pass
+        # save so the font, translation, and rotation are not permanent
+        self.__activepainter.save()
+        try:
+            try:
+                myfont = self.__helper.getFontFromCmnd(cmnd["font"])
+                self.__activepainter.setFont(myfont)
+            except KeyError:
+                pass
+            # Move the coordinate system so the origin is at the start
+            # of the text so that rotation is about this point
+            self.__activepainter.translate(startpt[0], startpt[1])
+            try:
+                rotdeg = cmnd["rotate"]
+                self.__activepainter.rotate(rotdeg)
+            except KeyError:
+                pass
+            self.__activepainter.drawText(0, 0, mytext)
+            self.__drawcount += 1
+        finally:
+            # return the painter to the default state
+            self.__activepainter.restore()
+        # Limit the number of drawing commands per picture
+        if self.__drawcount >= self.__maxdraws:
+            self.updateScene()
+
+    def setWidthScalingFactor(self, factor):
+        '''
+        Assign the scaling factor for line widths and symbol sizes 
+        to convert from points (1/72 inches) to pixels, and to apply 
+        any additional width scaling specified by factor. 
+        '''
+        self.__widthfactor  = (self.physicalDpiX() + self.physicalDpiY()) / 144.0
+        self.__widthfactor *= factor
+        
+    def widthScalingFactor(self):
+        '''
+        Return the scaling factor for line widths and symbol sizes 
+        to convert from points (1/72 inches) to pixels, and to apply 
+        any additional width scaling specified by setWidthFactor. 
+        '''
+        return self.__widthfactor 
+
+
+class PipedViewerPQProcess(Process):
+    '''
+    A Process specifically tailored for creating a PipedViewerPQ.
+    '''
+    def __init__(self, cmndpipe, rspdpipe):
+        '''
+        Create a Process that will produce a PipedViewerPQ
+        attached to the given Pipes when run.
+        '''
+        Process.__init__(self)
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+
+    def run(self):
+        '''
+        Create a PipedViewerPQ that is attached
+        to the Pipe of this instance.
+        '''
+        self.__app = QApplication(["PipedViewerPQ"])
+        self.__viewer = PipedViewerPQ(self.__cmndpipe, self.__rspdpipe)
+        result = self.__app.exec_()
+        self.__cmndpipe.close()
+        self.__rspdpipe.close()
+        SystemExit(result)
+
+
+#
+# The following are for testing this (and the cmndhelperpq) modules
+#
+
+class _CommandSubmitterPQ(QDialog):
+    '''
+    Testing dialog for controlling the addition of commands to a pipe.
+    Used for testing PipedViewerPQ in the same process as the viewer.
+    '''
+    def __init__(self, parent, cmndpipe, rspdpipe, cmndlist):
+        '''
+        Create a QDialog with a single QPushButton for controlling
+        the submission of commands from cmndlist to cmndpipe.
+        '''
+        QDialog.__init__(self, parent)
+        self.__cmndlist = cmndlist
+        self.__cmndpipe = cmndpipe
+        self.__rspdpipe = rspdpipe
+        self.__nextcmnd = 0
+        self.__button = QPushButton("Submit next command", self)
+        self.__button.pressed.connect(self.submitNextCommand)
+        self.show()
+
+    def submitNextCommand(self):
+        '''
+        Submit the next command from the command list to the command pipe,
+        or shutdown if there are no more commands to submit.
+        '''
+        try:
+            print "Command: %s" % str(self.__cmndlist[self.__nextcmnd])
+            self.__cmndpipe.send(self.__cmndlist[self.__nextcmnd])
+            self.__nextcmnd += 1
+            while self.__rspdpipe.poll():
+                print "Response: %s" % str(self.__rspdpipe.recv())
+        except IndexError:
+            self.__rspdpipe.close()
+            self.__cmndpipe.close()
+            self.close()
+
+
+if __name__ == "__main__":
+    # vertices of a pentagon (roughly) centered in a 1000 x 1000 square
+    pentagonpts = ( (504.5, 100.0), (100.0, 393.9),
+                    (254.5, 869.4), (754.5, 869.4),
+                    (909.0, 393.9),  )
+
+    # create the list of commands to submit
+    drawcmnds = []
+    drawcmnds.append( { "action":"setTitle", "title":"Tester" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"clear", "color":"black"} )
+    drawcmnds.append( { "action":"screenInfo"} )
+    drawcmnds.append( { "action":"antialias", "antialias":True } )
+    drawcmnds.append( { "action":"resize",
+                        "width":500,
+                        "height":500 } )
+    drawcmnds.append( { "action":"beginView",
+                        "viewfracs":{"left":0.0, "right":0.5,
+                                     "top":0.5, "bottom":1.0},
+                        "clip":True } )
+    drawcmnds.append( { "action":"drawRectangle",
+                        "left": 5, "right":245, 
+                        "top":245, "bottom":495,
+                        "fill":{"color":"green", "alpha":128} } )
+    mypentapts = [ (.25 * ptx, .25 * pty + 250) for (ptx, pty) in pentagonpts ]
+    drawcmnds.append( { "action":"drawPolygon",
+                        "points":mypentapts,
+                        "fill":{"color":"blue"},
+                        "outline":{"color":"black",
+                                   "width": 5,
+                                   "style":"solid",
+                                   "capstyle":"round",
+                                   "joinstyle":"round" } } )
+    drawcmnds.append( { "action":"beginSegment",
+                        "segid":"text" } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=480",
+                        "font":{"family":"Times", "size":16},
+                        "fill":{"color":"red"},
+                        "location":(50,480) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=430",
+                        "font":{"family":"Times", "size":16},
+                        "fill":{"color":"red"},
+                        "location":(50,430) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=380",
+                        "font":{"family":"Times", "size":16},
+                        "fill":{"color":"red"},
+                        "location":(50,380) } )
+    drawcmnds.append( { "action":"drawText",
+                        "text":"y=330",
+                        "font":{"family":"Times", "size":16},
+                        "fill":{"color":"red"},
+                        "location":(50,330) } )
+    drawcmnds.append( { "action":"endSegment" } )
+    drawcmnds.append( { "action":"endView" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"beginView",
+                        "viewfracs":{"left":0.0, "right":1.0,
+                                     "top":0.0, "bottom":1.0},
+                        "clip":True } )
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (100,  50),
+                                   (100, 150),
+                                   (100, 250),
+                                   (100, 350),
+                                   (100, 450) ),
+                        "symbol":".",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (150,  50),
+                                   (150, 150),
+                                   (150, 250),
+                                   (150, 350),
+                                   (150, 450) ),
+                        "symbol":"o",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (200,  50),
+                                   (200, 150),
+                                   (200, 250),
+                                   (200, 350),
+                                   (200, 450) ),
+                        "symbol":"+",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (250,  50),
+                                   (250, 150),
+                                   (250, 250),
+                                   (250, 350),
+                                   (250, 450) ),
+                        "symbol":"x",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (300,  50),
+                                   (300, 150),
+                                   (300, 250),
+                                   (300, 350),
+                                   (300, 450) ),
+                        "symbol":"*",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (350,  50),
+                                   (350, 150),
+                                   (350, 250),
+                                   (350, 350),
+                                   (350, 450) ),
+                        "symbol":"^",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawPoints",
+                        "points":( (400,  50),
+                                   (400, 150),
+                                   (400, 250),
+                                   (400, 350),
+                                   (400, 450) ),
+                        "symbol":"#",
+                        "size":20,
+                        "color":"magenta" })
+    drawcmnds.append( { "action":"drawMultiline",
+                        "points":( (350,  50),
+                                   (200, 150),
+                                   (400, 250),
+                                   (300, 350),
+                                   (150, 250),
+                                   (100, 450) ),
+                        "pen": {"color":"white",
+                                "width":3,
+                                "style":"dash",
+                                "capstyle":"round",
+                                "joinstyle":"round"} } )
+    drawcmnds.append( { "action":"endView" } )
+    drawcmnds.append( { "action":"show" } )
+    drawcmnds.append( { "action":"deleteSegment",
+                        "segid":"text" } )
+    drawcmnds.append( { "action":"update" } )
+    drawcmnds.append( { "action":"show" } )
+    annotations = ( "The 1<sup>st</sup> CO<sub>2</sub> annotations line",
+                    "Another line with <i>lengthy</i> details that should " + \
+                    "wrap to a 2<sup>nd</sup> annotation line",
+                    "<b>Final</b> annotation line" )
+    drawcmnds.append( { "action":"save",
+                        "filename":"test.pdf",
+                        "vectsize":{"width":7.0, "height":7.0},
+                        "rastsize":{"width":750, "height":750},
+                        "annotations":annotations } )
+    drawcmnds.append( { "action":"save",
+                        "filename":"test.png",
+                        "vectsize":{"width":7.0, "height":7.0},
+                        "rastsize":{"width":750, "height":750},
+                        "annotations":annotations } )
+    drawcmnds.append( { "action":"exit" } )
+
+    # start PyQt
+    app = QApplication(["PipedViewerPQ"])
+    # create a PipedViewerPQ in this process
+    cmndrecvpipe, cmndsendpipe = Pipe(False)
+    rspdrecvpipe, rspdsendpipe = Pipe(False)
+    viewer = PipedViewerPQ(cmndrecvpipe, rspdsendpipe)
+    # create a command submitter dialog
+    tester = _CommandSubmitterPQ(viewer, cmndsendpipe,
+                                 rspdrecvpipe, drawcmnds)
+    tester.show()
+    # let it all run
+    result = app.exec_()
+    if result != 0:
+        sys.exit(result)
+
diff --git a/pviewmod/pyferretbindings.py b/pviewmod/pyferretbindings.py
new file mode 100644
index 0000000..db29adf
--- /dev/null
+++ b/pviewmod/pyferretbindings.py
@@ -0,0 +1,975 @@
+'''
+The PyFerretBindings class is a base class providing common
+methods in PipedViewer bindings for PyFerret graphics methods.
+
+The PViewerPQPyFerretBindings class is a subclass of PyFerretBindings
+using PipedViewerPQ as the viewer.
+
+The PImagerPQPyFerretBindings class is a subclass of PyFerretBindings
+using PipedImagerPQ as the viewer.  Note that PipedImagerPQ only
+displays completed images and does not understand many of the commands
+(including all the drawing commands) given here.
+
+This package was developed by the Thermal Modeling and Analysis Project
+(TMAP) of the National Oceanographic and Atmospheric Administration's (NOAA)
+Pacific Marine Environmental Lab (PMEL).
+'''
+
+from pyferret.graphbind.abstractpyferretbindings import AbstractPyFerretBindings
+from pipedviewer import PipedViewer
+
+
+class PyFerretBindings(AbstractPyFerretBindings):
+    '''
+    Common methods in PipedViewer bindings for PyFerret graphical
+    functions.  The createWindow method should be defined in a
+    subclass in order to create a valid bindings class for PyFerret.
+    '''
+
+    def __init__(self):
+        '''
+        Create an instance of the the PipedViewer bindings for PyFerret
+        graphical functions.  The createWindow method should be called
+        to associate a new PipedViewer with these bindings.
+        '''
+        super(PyFerretBindings, self).__init__()
+        self.__window = None
+
+    def createPipedViewerWindow(self, viewertype, title, visible):
+        '''
+        Creates a PipedViewer of viewertype as the window of this
+        instance of the bindings.
+
+        Arguments:
+            viewertype: type of PipedViewer to use 
+            title: display title for the Window
+            visible: display Window on start-up?
+
+        Raises a RuntimeError if an active window is already associated
+        with these bindings, or if there were problems with creating
+        the window.
+
+        Returns True.
+        '''
+        if self.__window != None:
+            raise RuntimeError("createWindow called from bindings " \
+                               "with an active window")
+        self.__window = PipedViewer(viewertype)
+        self.__window.submitCommand( { "action":"setTitle",
+                                      "title":str(title) } )
+        if visible:
+            self.__window.submitCommand( {"action":"show"} )
+        self.checkForErrorResponse()
+        return True
+
+    def submitCommand(self, cmnd):
+        '''
+        Submits the given command to PipedViewer.
+
+        Provided for use by functions defined in subclasses.
+        '''
+        self.__window.submitCommand(cmnd)
+
+    def checkForResponse(self, timeout=0.0):
+        '''
+        Checks the response pipe for an object within the given
+        timeout number of in seconds.  If timeout is None, this
+        method will wait indefinitely for something to be given
+        on the responds pipe.  If nothing is obtained within the
+        given timeout, None is returned.
+
+        Provided for use by functions defined in subclasses.
+        '''
+        result = self.__window.checkForResponse(timeout)
+        return result
+
+    def checkForErrorResponse(self):
+        '''
+        Checks the response pipe for a message.  If anything is found,
+        a RuntimeError is raised with the string of the full response.
+        '''
+        fullresponse = None
+        response = self.__window.checkForResponse()
+        while response:
+            if fullresponse:
+                fullresponse += '\n'
+                fullresponse += str(response)
+            else:
+                fullresponse = str(response)
+            response = self.__window.checkForResponse()
+        if fullresponse:
+            raise RuntimeError(fullresponse)
+
+    # The remaining methods are common implementations of the required binding methods
+
+    def deleteWindow(self):
+        '''
+        Shuts down the PipedViewer.
+
+        Returns True.
+        '''
+        try:
+            self.__window.submitCommand( { "action":"exit" } )
+            self.checkForErrorResponse()
+            self.__window.waitForViewerExit()
+        finally:
+            self.__window = None
+        return True
+
+    def setImageName(self, imagename, formatname):
+        '''
+        Assigns the name and format of the image file to be created.
+
+        Arguments:
+            imagename  - name for the image file (can be NULL)
+            imgnamelen - actual length of imagename (zero if NULL)
+            formatname - name of the image format (case insensitive,
+                         can be NULL)
+            fmtnamelen - actual length of formatname (zero if NULL)
+       
+        If formatname is empty or NULL, the filename extension of
+        imagename, if it exists and is recognized, will determine
+        the format.
+
+        This method only gives the default name of the image file
+        to be created by the saveWindow method.  The saveWindow
+        method must be called to save the image.
+        '''
+        cmnd = { "action":"imgname" }
+        if imagename:
+            cmnd["name"] = imagename
+        if formatname:
+            cmnd["format"] = formatname
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def setAntialias(self, antialias):
+        '''
+        Turns on (antilaias True) or off (antialias False) anti-aliasing
+        in future drawing commands. 
+        '''
+        cmnd = { "action":"antialias",
+                 "antialias":bool(antialias) }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+        
+    def beginView(self, leftfrac, bottomfrac, rightfrac, topfrac, clipit):
+        '''
+        Start a view in the PipedViewer Window.  The view fractions
+        start at (0.0, 0.0) in the left top corner and increase to
+        (1.0, 1.0) in the right bottom corner; thus leftfrac must be less
+        than rightfrac and topfrac must be less than bottomfrac.
+
+        Arguments:
+            leftfrac:    [0,1] fraction of the Window width
+                         for the left side of the View
+            bottomfrac:  [0,1] fraction of the Window height
+                         for the bottom side of the View
+            rightfrac:   [0,1] fraction of the Window width
+                         for the right side of the View
+            topfrac:     [0,1] fraction of the Window height
+                         for the top side of the View
+            clipit:      clip drawings to this View?
+        '''
+        leftfracflt = float(leftfrac)
+        bottomfracflt = float(bottomfrac)
+        rightfracflt = float(rightfrac)
+        topfracflt = float(topfrac)
+        if (0.0 > leftfracflt) or (leftfracflt >= rightfracflt) or (rightfracflt > 1.0):
+            raise ValueError("leftfrac (%f) and rightfrac (%f) must be in [0.0, 1.0] " \
+                             "with leftfrac < rightfrac" % (leftfracflt, rightfracflt))
+        if (0.0 > topfracflt) or (topfracflt >= bottomfracflt) or (bottomfracflt > 1.0):
+            raise ValueError("topfrac (%f) and bottomfrac (%f) must be in [0.0, 1.0] " \
+                             "with topfrac < bottomfrac" % (topfracflt, bottomfracflt))
+        cmnd = { "action":"beginView",
+                 "viewfracs":{"left":leftfracflt, "right":rightfracflt,
+                              "top":topfracflt, "bottom":bottomfracflt }, 
+                 "clip":bool(clipit) }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def clipView(self, clipit):
+        '''
+        Enable or disable clipping to the current View.
+
+        Arguments:
+            clipit: clip drawings to the current View?
+        '''
+        cmnd = { "action":"clipView",
+                 "clip":bool(clipit) }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def endView(self):
+        '''
+        Close a View in the PipedViewer Window
+        '''
+        self.__window.submitCommand( { "action":"endView" } )
+        self.checkForErrorResponse()
+
+    def beginSegment(self, segid):
+        '''
+        Creates a "Segment object" for the given Window.
+        A Segment is just a group of drawing commands.
+
+        Arguments:
+            segid: ID for the Segment
+        '''
+        cmnd = { "action":"beginSegment",
+                 "segid":segid }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def endSegment(self):
+        '''
+        End the current "Segment" for the Window.
+        '''
+        cmnd = { "action":"endSegment" }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def deleteSegment(self, segid):
+        '''
+        Deletes the drawing commands in the indicated Segment.
+
+        Arguments:
+            segid: ID for the Segment to be deleted
+        '''
+        cmnd = { "action":"deleteSegment",
+                 "segid":segid }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def updateWindow(self):
+        '''
+        Indicates the viewer should update the graphics displayed.
+        '''
+        cmnd = { "action":"update" }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def clearWindow(self, bkgcolor):
+        '''
+        Clears the Window of all drawings.  The window is 
+        initialized to all bkgcolor (the background color).
+ 
+        Arguments:
+            bkgcolor: initialize (fill) the Window with this Color
+        '''
+        if bkgcolor:
+            # Make a copy of the bkgcolor dictionary
+            cmnd = dict(bkgcolor)
+        else:
+            cmnd = { }
+        cmnd["action"] = "clear"
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def redrawWindow(self, bkgcolor):
+        '''
+        Redraw the current drawing except using bkgcolor as the
+        background color (the initialization color for the Window). 
+        
+        Arguments:
+            bkgcolor: initialize (fill) the Window with this Color
+                      before redrawing the current drawing.
+        '''
+        if bkgcolor:
+            # Make a copy of the bkgcolor dictionary
+            cmnd = dict(bkgcolor)
+        else:
+            cmnd = { }
+        cmnd["action"] = "redraw"
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def resizeWindow(self, width, height):
+        '''
+        Sets the current size of the Window.
+
+        Arguments:
+            width: width of the Window, in "device units"
+            height: height of the window in "device units"
+
+        "device units" is pixels at the current window DPI
+        '''
+        cmnd = { "action":"resize",
+                 "width":width,
+                 "height":height }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def scaleWindow(self, scale):
+        '''
+        Sets the current scaling factor for the Window.
+
+        Arguments:
+            scale: scaling factor to use
+        '''
+        cmnd = { "action":"rescale",
+                 "factor":scale }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def windowScreenInfo(self):
+        '''
+        Returns the four-tuple (dpix, dpiy, screenwidth, screenheight) for
+        the default screen (display) of this Window
+           dpix: dots (pixels) per inch, in the horizontal (X) direction
+           dpiy: dots (pixels) per inch, in the vertical (Y) direction
+           screenwidth: width of the screen (display) in pixels (dots)
+           screenheight: height of the screen (display) in pixels (dots)
+        '''
+        cmnd = { "action":"screenInfo" }
+        self.__window.submitCommand(cmnd)
+        response = None
+        try:
+            # Wait indefinitely for a response
+            # Make sure it is a valid response
+            response = self.__window.checkForResponse(None)
+            if (type(response) != tuple) or (len(response) != 4):
+                raise ValueError
+            dpix = float(response[0])
+            dpiy = float(response[1])
+            screenwidth = int(response[2])
+            screenheight = int(response[3])
+            if (dpix <= 0.0) or (dpiy <= 0.0) or \
+               (screenwidth <= 0) or (screenheight <= 0):
+                raise ValueError
+        except Exception:
+            if not response:
+                # error raised before a response obtained
+                raise
+            fullresponse = str(response)
+            response = self.__window.checkForResponse()
+            while response:
+                fullresponse += '\n'
+                fullresponse += response
+                response = self.__window.checkForResponse()
+            raise RuntimeError(fullresponse)
+        return (dpix, dpiy, screenwidth, screenheight)
+
+    def showWindow(self, visible):
+        '''
+        Display or hide a Window.
+
+        Arguments:
+            visible: display (if True) or
+                     hide (if False) the Window
+        '''
+        if visible:
+            cmnd = { "action":"show" }
+        else:
+            cmnd = { "action":"hide" }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def saveWindow(self, filename, fileformat, transparent,
+                   xinches, yinches, xpixels, ypixels, annotations):
+        '''
+        Save the contents of the window to a file.  This might be called
+        when there is no image to save; in this case the call should be
+        ignored.
+
+        Arguments:
+            filename: name of the file to create
+            fileformat: name of the format to use
+            transparent: use a transparent background?
+            xinches: horizontal size of vector image in inches
+            yinches: vertical size of vector image in inches
+            xpixels: horizontal size of raster image in pixels
+            ypixels: vertical size of raster image in pixels
+            annotations: tuple of annotation strings
+
+        If fileformat is None or empty, the fileformat
+        is guessed from the filename extension.
+
+        If transparent is False, the entire scene is initialized
+        to the last clearing color.  If transparent is True, the
+        entire scene is initialized as transparent.
+
+        If annotations is not None, the strings given in the tuple
+        are to be displayed above the image.  These annotations add 
+        height, as needed, to the saved image (i.e., yinches or 
+        ypixels is the height of the image below these annotations).
+        '''
+        cmnd = { }
+        cmnd["action"] = "save"
+        cmnd["filename"] = filename
+        if fileformat:
+            cmnd["fileformat"] = fileformat
+        cmnd["transparent"] = transparent
+        cmnd["vectsize"] = { "width":xinches, "height":yinches }
+        cmnd["rastsize"] = { "width":xpixels, "height":ypixels }
+        cmnd["annotations"] = annotations
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def createColor(self, redfrac, greenfrac, bluefrac, opaquefrac):
+        '''
+        Returns a Color object from fractional [0.0, 1.0]
+        intensities of the red, green, and blue channels.
+        The opaquefrac is used to set the alpha channel.
+
+        Arguments:
+            redfrac: fractional [0.0, 1.0] red intensity
+            greenfrac: fractional [0.0, 1.0] green intensity
+            bluefrac: fractional [0.0, 1.0] blue intensity
+            opaquefrac: fractional [0.0, 1.0] opaqueness
+                (0.0 is transparent; 1.0 is opaque) of the color.
+                For output that does not support an alpha channel,
+                this will be silently ignored and the color will
+                be completely opaque.
+
+        Raises an error if unable to create the Color object.
+        '''
+        if (redfrac < 0.0) or (redfrac > 1.0):
+            raise ValueError("redfrac must be a value in [0.0, 1.0]")
+        if (greenfrac < 0.0) or (greenfrac > 1.0):
+            raise ValueError("greenfrac must be a value in [0.0, 1.0]")
+        if (bluefrac < 0.0) or (bluefrac > 1.0):
+            raise ValueError("bluefrac must be a value in [0.0, 1.0]")
+        if (opaquefrac < 0.0) or (opaquefrac > 1.0):
+            raise ValueError("opaquefrac must be a value in [0.0, 1.0]")
+        redint = int( 256.0 * redfrac )
+        if redint == 256:
+            redint = 255
+        greenint = int( 256.0 * greenfrac )
+        if greenint == 256:
+            greenint = 255
+        blueint = int( 256.0 * bluefrac )
+        if blueint == 256:
+            blueint = 255
+        colorint = (redint * 256 + greenint) * 256 + blueint
+        opaqueint = int( 256.0 * opaquefrac )
+        if opaqueint == 256:
+            opaqueint = 255
+        return { "color":colorint, "alpha":opaqueint }
+
+    def deleteColor(self, color):
+        '''
+        Delete a Color object created by createColor
+
+        Arguments:
+            color: Color to be deleted
+        '''
+        del color
+
+    def createFont(self, familyname, fontsize, italic, bold, underlined):
+        '''
+        Returns a Font object.
+
+        Arguments:
+            familyname: name of the font family (e.g., "Helvetica", "Times");
+                        None or an empty string uses the default font
+            fontsize: desired size of the font (scales with view size)
+            italic: use the italic version of the font?
+            bold: use the bold version of the font?
+            underlined: use the underlined version of the font?
+
+        Raises an error if unable to create the Font object.
+        '''
+        fontdict = { "size":fontsize,
+                     "italic":italic,
+                     "bold":bold,
+                     "underlined":underlined }
+        if familyname:
+            fontdict["family"] = familyname
+        return fontdict
+
+    def deleteFont(self, font):
+        '''
+        Delete a Font object created by createFont
+
+        Arguments:
+            font: Font to be deleted
+        '''
+        del font
+
+    def createPen(self, color, width, style, capstyle, joinstyle):
+        '''
+        Returns a Pen object.
+
+        Arguments:
+            color: Color to use
+            width: line width (scales with view size)
+            style: line style name (e.g., "solid", "dash")
+            capstyle: end-cap style name (e.g., "square")
+            joinstyle: join style name (e.g., "bevel")
+
+        Raises an error if unable to create the Pen object.
+        '''
+        if color:
+            pen = dict(color)
+        else:
+            pen = { }
+        if width:
+            pen["width"] = width
+        if style:
+            pen["style"] = style
+        if capstyle:
+            pen["capstyle"] = capstyle
+        if joinstyle:
+            pen["joinstyle"] = joinstyle
+        return pen
+
+    def replacePenColor(self, pen, newcolor):
+        '''
+        Replaces the color in pen with newcolor.
+        
+        Arguments:
+            pen: Pen object to modify
+            newcolor: Color to use
+
+        Raises an error if unable to replace the Color in the Pen.
+        '''
+        pen.update(newcolor)
+
+    def deletePen(self, pen):
+        '''
+        Delete a Pen object created by createPen
+
+        Arguments:
+            pen: Pen to be deleted
+        '''
+        del pen
+
+    def createBrush(self, color, style):
+        '''
+        Returns a Brush object.
+
+        Arguments:
+            color: Color to use
+            style: fill style name (e.g., "solid", "cross")
+
+        Raises an error if unable to create the Brush object.
+        '''
+        if color:
+            brush = dict(color)
+        else:
+            brush = { }
+        if style:
+            brush["style"] = style
+        return brush
+
+    def replaceBrushColor(self, brush, newcolor):
+        '''
+        Replaces the color in brush with newcolor.
+        
+        Arguments:
+            brush: Brush object to modify
+            newcolor: Color to use
+
+        Raises an error if unable to replace the Color in the Brush.
+        '''
+        brush.update(newcolor)
+
+    def deleteBrush(self, brush):
+        '''
+        Delete a Brush object created by createBrush
+
+        Arguments:
+            brush: Brush to be deleted
+        '''
+        del brush
+
+    def createSymbol(self, symbolname):
+        '''
+        Returns a Symbol object.
+
+        Arguments:
+            symbolname: name of the symbol.
+                Currently supported values are:
+                '.' (period): filled circle
+                'o' (lowercase oh): unfilled circle
+                '+': plus mark
+                'x' (lowercase ex): x mark
+                '*': asterisk
+                '^': triangle
+                "#": square
+
+        Raises an error if unable to create the Symbol object.
+        '''
+        return symbolname
+
+    def deleteSymbol(self, symbol):
+        '''
+        Delete a Symbol object created by createSymbol
+
+        Arguments:
+            symbol: Symbol to be deleted
+        '''
+        del symbol
+
+    def setWidthFactor(self, widthfactor):
+        '''
+        Assigns the scaling factor to be used for pen widths,
+        symbols sizes, and font sizes
+
+        Arguments:
+            widthfactor: positive float giving the new scaling factor to use
+        '''
+        newfactor = float(widthfactor)
+        if newfactor <= 0.0:
+            raise ValueError("Width scaling factor must be positive")
+        cmnd = { "action":"setWidthFactor",
+                 "factor":widthfactor }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+        
+    def drawMultiline(self, ptsx, ptsy, pen):
+        '''
+        Draws connected line segments.
+
+        Arguments:
+            ptsx: X-coordinates of the endpoints
+            ptsy: Y-coordinates of the endpoints
+            pen: the Pen to use to draw the line segments
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        if len(ptsx) != len(ptsy):
+            raise ValueError("the lengths of ptsx and ptsy are not the same")
+        points = list(zip(ptsx, ptsy))
+        cmnd = { "action":"drawMultiline",
+                 "points":points,
+                 "pen":pen }
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def drawPoints(self, ptsx, ptsy, symbol, color, ptsize):
+        '''
+        Draws discrete points.
+
+        Arguments:
+            ptsx: X-coordinates of the points
+            ptsy: Y-coordinates of the points
+            symbol: the Symbol to use to draw a point
+            color: color of the Symbol (default color if None or empty)
+            ptsize: size of the symbol (scales with view size)
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        if len(ptsx) != len(ptsy):
+            raise ValueError("the lengths of ptsx and ptsy are not the same")
+        points = list(zip(ptsx, ptsy))
+        if color:
+            # make a copy of the color dictionary
+            cmnd = dict(color)
+        else:
+            cmnd = { }
+        cmnd["action"] = "drawPoints"
+        cmnd["points"] = points
+        cmnd["symbol"] = symbol
+        cmnd["size"] = ptsize
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def drawPolygon(self, ptsx, ptsy, brush, pen):
+        '''
+        Draws a polygon.
+
+        Arguments:
+            ptsx: X-coordinates of the vertices
+            ptsy: Y-coordinates of the vertices
+            brush: the Brush to use to fill the polygon; if None
+                    the polygon will not be filled
+            pen: the Pen to use to outline the polygon; if None
+                    the polygon will not be outlined
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        if len(ptsx) != len(ptsy):
+            raise ValueError("the lengths of ptsx and ptsy are not the same")
+        points = list(zip(ptsx, ptsy))
+        cmnd = { "action":"drawPolygon", "points":points }
+        if brush:
+            cmnd["fill"] = brush
+        if pen:
+            cmnd["outline"] = pen
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def drawRectangle(self, left, bottom, right, top, brush, pen):
+        '''
+        Draws a rectangle.
+
+        Arguments:
+            left: X-coordinate of the left edge
+            bottom: Y-coordinate of the bottom edge
+            right: X-coordinate of the right edge
+            top: Y-coordinate of the top edge
+            brush: the Brush to use to fill the polygon; if None
+                    the polygon will not be filled
+            pen: the Pen to use to outline the polygon; if None
+                    the polygon will not be outlined
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        cmnd = { "action":"drawRectangle",
+                 "left":left, "bottom":bottom,
+                 "right":right, "top": top }
+        if brush:
+            cmnd["fill"] = brush
+        if pen:
+            cmnd["outline"] = pen
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+    def drawText(self, text, startx, starty, font, color, rotate):
+        '''
+        Draws text.
+
+        Arguments:
+            text: the text string to draw
+            startx: the X-coordinate of the beginning baseline
+            starty: the Y-coordinate of the beginning baseline
+            font: the font to use
+            color: the color to use as a solid brush or pen
+            rotate: the angle of the text baseline in degrees
+                    clockwise from horizontal
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        cmnd = { "action":"drawText", "text":text,
+                 "location":(startx,starty) }
+        if font:
+            cmnd["font"] = font
+        if color:
+            pen = dict(color)
+            pen["style"] = "solid"
+            cmnd["fill"] = pen
+        if rotate != 0.0:
+            cmnd["rotate"] = rotate
+        self.__window.submitCommand(cmnd)
+        self.checkForErrorResponse()
+
+
+class PViewerPQPyFerretBindings(PyFerretBindings):
+    '''
+    PyFerretBindings using a PipedViewerPQ as the viewer.
+    '''
+
+    def createWindow(self, title, visible):
+        '''
+        Creates PyFerret bindings using a PipedViewerPQ.
+
+        Arguments:
+            title: display title for the Window
+            visible: display Window on start-up?
+
+        Raises a RuntimeError if an active window is already associated
+        with these bindings, or if there were problems with creating
+        the window.
+
+        Returns True.
+        '''
+        result = self.createPipedViewerWindow("PipedViewerPQ",
+                                              title, visible)
+        return result
+
+
+class PImagerPQPyFerretBindings(PyFerretBindings):
+    '''
+    PyFerretBindings using PipedImagerPQ as the viewer.
+
+    Note that PipedImagerPQ only displays completed images
+    and at this time does not understand many of the commands
+    (including all the drawing commands) given in the base
+    class PyFerretBindings.  However, the associated methods
+    were left as-is in case future versions did implement
+    these commands.
+
+    The additional method newSceneImage sends image data
+    for the new scene to be displayed.
+    '''
+
+    def createWindow(self, title, visible):
+        '''
+        Creates PyFerret bindings using a PipedImagerPQ.
+
+        Arguments:
+            title: display title for the Window
+            visible: display Window on start-up?
+
+        Raises a RuntimeError if an active window is already associated
+        with these bindings, or if there were problems with creating
+        the window.
+
+        Returns True.
+        '''
+        result = self.createPipedViewerWindow("PipedImagerPQ",
+                                              title, visible)
+        return result
+
+
+    def newSceneImage(self, width, height, stride, imagedata):
+        '''
+        Create and display the scene created from the given
+        image data.
+
+        Arguments:
+            width: width of the scene in pixels
+            height: height of the scene in pixels
+            stride: number of bytes in a single row of the image
+            imagedata: a bytearray of the image data given in
+                       premultiplied ARGB32 format in native
+                       btye order
+        '''
+        lenimgdata = stride * height
+        if len(imagedata) < lenimgdata:
+            raise RuntimeError("newSceneImage: imagedata is too short")
+        cmnd = { "action":"newImage",
+                 "width":width,
+                 "height":height,
+                 "stride":stride }
+        self.submitCommand(cmnd)
+        self.checkForErrorResponse()
+        blocksize = 8192
+        numblocks = (lenimgdata + blocksize - 1) // blocksize
+        for k in xrange(numblocks):
+            if k < (numblocks - 1):
+                blkdata = imagedata[k*blocksize:(k+1)*blocksize]
+            else:
+                blkdata = imagedata[k*blocksize:]
+            cmnd = { "action":"newImage",
+                     "blocknum":k+1,
+                     "numblocks":numblocks,
+                     "startindex":k*blocksize,
+                     "blockdata":blkdata }
+            self.submitCommand(cmnd)
+            self.checkForErrorResponse()
+
+
+#
+# The following is for testing this module
+#
+
+if __name__ == "__main__":
+    import pyferret
+    import pyferret.graphbind
+
+    # x and y coordinates of the vertices of a pentagon
+    # (roughly) centered in a 1000 x 1000 square
+    pentaptsx = ( 504.5, 100.0, 254.5, 754.5, 909.0, )
+    pentaptsy = ( 100.0, 393.9, 869.4, 869.4, 393.9, )
+    mypentax = [ 0.25 * ptx for ptx in pentaptsx ]
+    mypentay = [ 0.25 * pty + 250 for pty in pentaptsy ]
+
+    # RGBA tuples of the colors to create
+    colorvals = ( (0.0, 0.0, 0.0, 1.0),   #  0 opaque black
+                  (1.0, 1.0, 1.0, 1.0),   #  1 opaque white
+                  (1.0, 0.0, 0.0, 1.0),   #  2 opaque red
+                  (1.0, 1.0, 0.0, 1.0),   #  3 opaque yellowish
+                  (0.0, 1.0, 0.0, 1.0),   #  4 opaque green
+                  (0.0, 1.0, 1.0, 1.0),   #  5 opaque cyan
+                  (0.0, 0.0, 1.0, 1.0),   #  6 opaque blue
+                  (1.0, 0.0, 1.0, 1.0),   #  7 opaque magenta
+                  (0.0, 0.0, 0.0, 0.5),   #  8 translucent black
+                  (1.0, 1.0, 1.0, 0.5),   #  9 translucent white
+                  (1.0, 0.0, 0.0, 0.5),   # 10 translucent red
+                  (1.0, 1.0, 0.0, 0.5),   # 11 translucent yellowish
+                  (0.0, 1.0, 0.0, 0.5),   # 12 translucent green
+                  (0.0, 1.0, 1.0, 0.5),   # 13 translucent cyan
+                  (0.0, 0.0, 1.0, 0.5),   # 14 translucent blue
+                  (1.0, 0.0, 1.0, 0.5),   # 15 translucent magenta
+                  (1.0, 1.0, 1.0, 0.0),   # 16 transparent "white"
+                )
+
+    # Initiate pyferret, but stay in python
+    pyferret.init(None, False)
+    for viewertype in ( "PipedViewerPQ", ):
+        print "Testing bindings for %s" % viewertype
+        # Create a viewer window
+        title = viewertype + "Tester"
+        bindinst = pyferret.graphbind.createWindow(viewertype, title, True)
+        # Resize the window to 500 x 500 pixels
+        bindinst.resizeWindow(500, 500)
+        # Turn on anti-aliasing
+        bindinst.setAntialias(True)
+        # Create the one font that will be used here
+        myfont = bindinst.createFont(None, 50, False, False, False)
+        # Create a list of colors that will be used here
+        mycolors = [ bindinst.createColor(r, g, b, a) \
+                     for (r, g, b, a) in colorvals ]
+        # Clear the window in black
+        bindinst.clearWindow(mycolors[0])
+        # Create a view in the bottom left corner
+        bindinst.beginView(0.0, 1.0, 0.5, 0.0, True)
+        # Draw a translucent green rectangle over most of the view
+        mybrush = bindinst.createBrush(mycolors[12], "solid")
+        bindinst.drawRectangle(5, 495, 245, 245, mybrush, None)
+        bindinst.deleteBrush(mybrush)
+        # Draw a blue polygon with solid black outline
+        mybrush = bindinst.createBrush(mycolors[6], "solid")
+        mypen = bindinst.createPen(mycolors[0], 5, "solid", "round", "round")
+        bindinst.drawPolygon(mypentax, mypentay, mybrush, mypen)
+        bindinst.deletePen(mypen)
+        bindinst.deleteBrush(mybrush)
+        # Draw some red text strings
+        bindinst.drawText("y=480", 50, 480, myfont, mycolors[2], 0)
+        bindinst.drawText("y=430", 50, 430, myfont, mycolors[2], 0)
+        bindinst.drawText("y=380", 50, 380, myfont, mycolors[2], 0)
+        bindinst.drawText("y=330", 50, 330, myfont, mycolors[2], 0)
+        # End of this view
+        bindinst.endView()
+        # Window should already be shown, but just to make sure
+        bindinst.showWindow(True)
+        raw_input("Press Enter to continue")
+        # Create a view of the whole window
+        bindinst.beginView(0.0, 1.0, 1.0, 0.0, True)
+        # Draw magenta points using various symbols
+        ptsy = (50, 150, 250, 350, 450)
+        ptsx = (100, 100, 100, 100, 100)
+        mysymbol = bindinst.createSymbol(".")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (150, 150, 150, 150, 150)
+        mysymbol = bindinst.createSymbol("o")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (200, 200, 200, 200, 200)
+        mysymbol = bindinst.createSymbol("+")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (250, 250, 250, 250, 250)
+        mysymbol = bindinst.createSymbol("x")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (300, 300, 300, 300, 300)
+        mysymbol = bindinst.createSymbol("*")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (350, 350, 350, 350, 350)
+        mysymbol = bindinst.createSymbol("^")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        ptsx = (400, 400, 400, 400, 400)
+        mysymbol = bindinst.createSymbol("#")
+        bindinst.drawPoints(ptsx, ptsy, mysymbol, mycolors[7], 20)
+        bindinst.deleteSymbol(mysymbol)
+        # Draw a white dash line between some of the points
+        mypen = bindinst.createPen(mycolors[1], 3, "dash", "round", "round")
+        ptsx = (350, 200, 400, 300, 150, 100)
+        ptsy = ( 50, 150, 250, 350, 250, 450)
+        bindinst.drawMultiline(ptsx, ptsy, mypen)
+        bindinst.deletePen(mypen)
+        # End of this view
+        bindinst.endView()
+        # Window should already be shown, but just to make sure
+        bindinst.showWindow(True)
+        raw_input("Press Enter to continue")
+        try:
+            while 1:
+                bindinst.deleteColor(mycolors.pop())
+        except IndexError:
+            pass
+        bindinst.deleteFont(myfont)
+        bindinst.deleteWindow()
+        print "Done with bindings for %s" % viewertype
+
diff --git a/pviewmod/scaledialogpq.py b/pviewmod/scaledialogpq.py
new file mode 100644
index 0000000..6b28128
--- /dev/null
+++ b/pviewmod/scaledialogpq.py
@@ -0,0 +1,220 @@
+'''
+Dialog for obtaining scaling information from the user.
+
+This package was developed by the Thermal Modeling and Analysis Project
+(TMAP) of the National Oceanographic and Atmospheric Administration's (NOAA)
+Pacific Marine Environmental Lab (PMEL).
+'''
+
+from PyQt4.QtCore import SIGNAL, Qt
+from PyQt4.QtGui  import QApplication, QButtonGroup, QDialog, \
+                         QDialogButtonBox, QGridLayout, QGroupBox, \
+                         QLabel, QLineEdit, QMessageBox, QRadioButton
+
+
+class ScaleDialogPQ(QDialog):
+    '''
+    Dialog for obtaining scaling information from the user.
+    Validates that the resulting width and height values
+    are not smaller than the specified minimums.
+    '''
+
+    def __init__(self, scale, width, height,
+                 minwidth, minheight, autoscale, parent=None):
+        '''
+        Creates a scaling dialog, with scale as the current
+        scaling value which gives a pixmap of size width and
+        height.  The minimum acceptable width and heights are
+        given by minwidth and minheight.  Values are assumed to
+        be in units of pixels.  The value of autoscale sets the
+        default value of "Scale image to fir window frame".
+        '''
+        super(ScaleDialogPQ, self).__init__(parent)
+
+        self.__scale = float(scale)
+        self.__pixwidth = float(width)
+        self.__inchwidth = float(width) / float(self.physicalDpiX())
+        self.__pixheight = float(height)
+        self.__inchheight = float(height) / float(self.physicalDpiY())
+        self.__minpixwidth = int(minwidth)
+        self.__minpixheight = int(minheight)
+        self.__autoscale = bool(autoscale)
+
+        self.FLTSTR_FORMAT = "%#.3f"
+
+        self.setWindowTitle(self.tr("Image Size Scaling"))
+
+        # auto-scaling option at the top
+        autoscalelabel = QLabel(self.tr("Scale image to fit window frame?"), 
+                                self)
+        autoscalelabel.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.__autoyesbtn = QRadioButton(self.tr("&Yes"), self)
+        self.__autonobtn = QRadioButton(self.tr("&No"), self)
+        autoscalebtngrp = QButtonGroup(self)
+        autoscalebtngrp.addButton(self.__autoyesbtn)
+        autoscalebtngrp.addButton(self.__autonobtn)
+
+        # put the manual scaling settings into their own box
+        self.__grpbox = QGroupBox(self.tr("Fixed scaling"), self)
+
+        # create the widgets going inside this group box
+        messagelabel = QLabel(
+            self.tr("Scaling factor (both horiz. and vert.) for the image"), 
+            self.__grpbox)
+        messagelabel.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+
+        scalelabel = QLabel(self.tr("&Scale: "), self.__grpbox)
+        self.__scaleedit = QLineEdit(self.FLTSTR_FORMAT % self.__scale, 
+                                     self.__grpbox)
+        scalelabel.setBuddy(self.__scaleedit)
+
+        widthbegin = QLabel(self.tr("Width: "), self.__grpbox)
+        self.__pixwidthlabel = QLabel(str(int(self.__pixwidth + 0.5)), 
+                                      self.__grpbox)
+        widthmiddle = QLabel(self.tr("pixels, or"), self.__grpbox)
+        self.__inchwidthlabel = QLabel(self.FLTSTR_FORMAT % self.__inchwidth, 
+                                       self.__grpbox)
+        widthend = QLabel(self.tr("inches on the screen"), self.__grpbox)
+        minwidthlabel = QLabel(self.tr("(must not be less than %1 pixels)") \
+                               .arg(str(self.__minpixwidth)), self.__grpbox)
+
+        heightbegin = QLabel(self.tr("Height:"), self.__grpbox)
+        self.__pixheightlabel = QLabel(str(int(self.__pixheight + 0.5)), 
+                                       self.__grpbox)
+        heightmiddle = QLabel(self.tr("pixels, or"), self.__grpbox)
+        self.__inchheightlabel = QLabel(self.FLTSTR_FORMAT % self.__inchheight, 
+                                        self.__grpbox)
+        heightend = QLabel(self.tr("inches on the screen"), self.__grpbox)
+        minheightlabel = QLabel(self.tr("(must not be less than %1 pixels)") \
+                               .arg(str(self.__minpixheight)), self.__grpbox)
+
+        # layout the widgets in this group box
+        layout = QGridLayout()
+
+        layout.addWidget(messagelabel, 0, 0, 1, 5)
+
+        layout.addWidget(scalelabel, 1, 0, 1, 1)
+        layout.addWidget(self.__scaleedit, 1, 1, 1, 4)
+
+        layout.addWidget(widthbegin, 2, 0, 1, 1)
+        layout.addWidget(self.__pixwidthlabel, 2, 1, 1, 1)
+        layout.addWidget(widthmiddle, 2, 2, 1, 1)
+        layout.addWidget(self.__inchwidthlabel, 2, 3, 1, 1)
+        layout.addWidget(widthend, 2, 4, 1, 1)
+
+        layout.addWidget(minwidthlabel, 3, 1, 1, 4)
+
+        layout.addWidget(heightbegin, 4, 0, 1, 1)
+        layout.addWidget(self.__pixheightlabel, 4, 1, 1, 1)
+        layout.addWidget(heightmiddle, 4, 2, 1, 1)
+        layout.addWidget(self.__inchheightlabel, 4, 3, 1, 1)
+        layout.addWidget(heightend, 4, 4, 1, 1)
+
+        layout.addWidget(minheightlabel, 5, 1, 1, 4)
+
+        # assign this layout to the group box
+        self.__grpbox.setLayout(layout)
+
+        # layout the widgets in the dialog (outside the group box)
+        layout = QGridLayout()
+        layout.addWidget(autoscalelabel, 0, 0, 1, 1)
+        layout.addWidget(self.__autoyesbtn, 0, 1, 1, 1)
+        layout.addWidget(self.__autonobtn, 0, 2, 1, 1)
+        layout.addWidget(self.__grpbox, 1, 0, 1, 3)
+        
+        buttonbox = QDialogButtonBox(QDialogButtonBox.Ok |
+                                     QDialogButtonBox.Cancel |
+                                     QDialogButtonBox.Reset,
+                                     Qt.Horizontal, self)
+
+        layout.addWidget(buttonbox, 2, 0, 1, 3)
+
+        self.setLayout(layout)
+
+        # The OK button is not the default here in Qt4.2
+        okbutton = buttonbox.button(QDialogButtonBox.Ok)
+        okbutton.setDefault(True)
+
+        self.connect(self.__autoyesbtn, SIGNAL("clicked(bool)"), self.setAutoScale)
+        self.connect(self.__autonobtn, SIGNAL("clicked(bool)"), self.unsetAutoScale)
+
+        self.connect(self.__scaleedit, SIGNAL("textChanged(QString)"), self.updateValues)
+        self.connect(buttonbox, SIGNAL("accepted()"), self.checkValues)
+        self.connect(buttonbox, SIGNAL("rejected()"), self.reject)
+        resetbutton = buttonbox.button(QDialogButtonBox.Reset)
+        self.connect(resetbutton, SIGNAL("clicked()"), self.resetValues)
+
+        # initialize the state from autoscale
+        if self.__autoscale:
+            self.__autoyesbtn.setChecked(True)
+            self.setAutoScale(True)
+        else:
+            self.__autonobtn.setChecked(True)
+            self.unsetAutoScale(True)
+
+    def setAutoScale(self, checked):
+        if checked:
+            self.__grpbox.setEnabled(False)
+
+    def unsetAutoScale(self, checked):
+        if checked:
+            self.__grpbox.setEnabled(True)
+            self.__scaleedit.setFocus()
+            self.__scaleedit.selectAll()
+
+    def updateValues(self, newstring):
+        (newscale, okay) = newstring.toFloat()
+        if okay:
+            newval = self.__pixwidth * newscale / self.__scale
+            self.__pixwidthlabel.setText(str(int(newval + 0.5)))
+            newval = self.__inchwidth * newscale / self.__scale
+            self.__inchwidthlabel.setText(self.FLTSTR_FORMAT % newval)
+            newval = self.__pixheight * newscale / self.__scale
+            self.__pixheightlabel.setText(str(int(newval + 0.5)))
+            newval = self.__inchheight * newscale / self.__scale
+            self.__inchheightlabel.setText(self.FLTSTR_FORMAT % newval)
+
+    def checkValues(self):
+        okay = self.getValues()[2]
+        if okay:
+            self.accept()
+        else:
+            QMessageBox.warning(self, self.tr("Invalid value"),
+                                self.tr("Scale value is not valid"))
+
+    def getValues(self):
+        if self.__autoyesbtn.isChecked():
+            return (0.0, True, True)
+        (newscale, okay) = self.__scaleedit.text().toFloat()
+        if not okay:
+            return (0.0, False, False)
+        newwidth = self.__pixwidth * newscale / self.__scale
+        newwidth = int(newwidth + 0.5)
+        newheight = self.__pixheight * newscale / self.__scale
+        newheight = int(newheight + 0.5)
+        if (newwidth < self.__minpixwidth) or (newheight < self.__minpixheight):
+            return (0.0, False, False)
+        return (newscale, False, True)
+
+    def resetValues(self):
+        self.__scaleedit.setText(self.FLTSTR_FORMAT % self.__scale)
+        self.__pixwidthlabel.setText(str(int(self.__pixwidth + 0.5)))
+        self.__inchwidthlabel.setText(self.FLTSTR_FORMAT % self.__inchwidth)
+        self.__pixheightlabel.setText(str(int(self.__pixheight + 0.5)))
+        self.__inchheightlabel.setText(self.FLTSTR_FORMAT % self.__inchheight)
+        if self.__autoscale:
+            self.__autoyesbtn.setChecked(True)
+            self.setAutoScale(True)
+        else:
+            self.__autonobtn.setChecked(True)
+            self.unsetAutoScale(True)
+
+
+if __name__ == "__main__":
+    app = QApplication(["tester"])
+    resizedialog = ScaleDialogPQ(1.0, 500, 300, 75, 50, False)
+    retval = resizedialog.exec_()
+    print "retval = %d" % retval
+    if retval == QDialog.Accepted:
+        rettuple = resizedialog.getValues()
+        print "getValues returned: %s" % str(rettuple)
diff --git a/pyfermod/__init__.py b/pyfermod/__init__.py
new file mode 100644
index 0000000..1bd7ba5
--- /dev/null
+++ b/pyfermod/__init__.py
@@ -0,0 +1,1908 @@
+"""
+A Python module for running Ferret.
+
+A Python extension module that interfaces with Ferret functionality
+and provides methods for Ferret external functions written in Python.
+
+In this module:
+    init or start must first be called to initialize Ferret
+    resize can be used to resize Ferret's allocated memory block
+    run is used to submit individual Ferret commands or enter
+            into Ferret's command prompting mode
+    get and getdata are used to retrieve (a copy of) a Ferret
+            numeric data array
+    put and putdata is used to add (a copy of) a numeric data
+            array into Ferret
+    stop can be used to shutdown Ferret and free the allocated
+            memory.
+
+The FERR_* values are the possible values of err_int in the return
+values from the run command.  The err_int return value FERR_OK
+indicates no errors.
+
+For writing Ferret external functions in Python, see the help message
+printed by ferret_pyfunc().  Methods available to these external
+functions provided by this module are:
+    get_axis_coordinates returns the "world" coordinates for an axis
+            of an argument to the external function.
+    get_axis_box_sizes returns the "box sizes", in "world" coordinate
+            units, for an axis of an argument to the external function.
+    get_axis_box_limits returns the "box limits", in "world" coordinate
+            units, for an axis of an argument to the external function.
+    get_axis_info returns a dictionary of information about the axis
+            of an argument to the external function.
+    get_arg_one_val returns the value of an argument that is the type
+            FLOAT_ONEVAL or STRING_ONEVAL.
+"""
+
+import sys
+import os
+import atexit
+try:
+    import rlcompleter
+except ImportError:
+    pass
+import readline
+import numpy
+import numpy.ma
+import StringIO
+
+# import everything from libpyferret so constants
+# in that module are seen as part of this module
+from libpyferret import *
+
+# also define some calendar type string constants
+CALTYPE_360DAY = 'CALTYPE_360DAY'
+CALTYPE_NOLEAP = 'CALTYPE_NOLEAP'
+CALTYPE_GREGORIAN = 'CALTYPE_GREGORIAN'
+CALTYPE_JULIAN = 'CALTYPE_JULIAN'
+CALTYPE_ALLLEAP = 'CALTYPE_ALLLEAP'
+CALTYPE_NONE = 'CALTYPE_NONE'
+
+# register the libpyferret._quit function with atexit to ensure
+# open viewer windows do not hang a Python shutdown
+atexit.register(libpyferret._quit)
+
+# bindings for the PyQt-based graphics engines
+import pipedviewer.pyferretbindings
+
+# the following should be in this (pyferret) directory, which should be examined first
+import filenamecompleter
+import graphbind
+import regrid
+
+
+def init(arglist=None, enterferret=True):
+    """
+    Interprets the traditional Ferret options given in arglist and
+    starts pyferret appropriately.  Defines all the standard Ferret
+    Python external functions.  If ${HOME}/.ferret exists, that
+    script is then executed.
+
+    If '-script' is given with a script filename, this method calls
+    the run method with the ferret go command, the script filename,
+    and any arguments, and then exits completely (exits python).
+
+    Otherwise, if enterferret is False, this method just returns the
+    success return value of the run method: (FERR_OK, '')
+
+    If enterferret is True (unless '-python' is given in arglist)
+    this routine calls the run method with no arguments in order to
+    enter into Ferret command-line processing.  The value returned
+    from call to the run method is then returned.
+    """
+
+    ferret_help_message = \
+    """
+
+    Usage:  pyferret  [-memsize <N>]  [-nodisplay]  [-nojnl]  [-noverify]
+                      [-secure]  [-server]  [-python]  [-version]  [-help]
+                      [-quiet]  [-batch [<filename>]]  [-transparent]
+                      [-script <scriptname> [ <scriptarg> ... ]]
+
+       -memsize:     initialize the memory cache size to <N> (default 25.6)
+                     mega (10^6) floats (where 1 float = 8 bytes)
+
+       -nodisplay    do not display to the console; a drawing can be saved
+                     using the FRAME command in any of the supported file
+                     formats.  The /QUALITY option of SET WINDOW will be
+                     ignored when this is specified.  The deprecated
+                     command-line options -unmapped and -gif are now
+                     aliases of this option.
+
+       -nojnl:       on startup do not open a journal file (can be turned
+                     on later with SET MODE JOURNAL)
+
+       -noverify:    on startup turn off verify mode (can be turned on
+                     later with SET MODE VERIFY)
+
+       -secure:      restrict Ferret's capabilities (e.g., SPAWN and
+                     EXIT /TOPYTHON are not permitted)
+
+       -server:      run Ferret in server mode
+
+       -python:      start at the Python prompt instead of the Ferret prompt.
+                     The ferret prompt can be obtained using 'pyferret.run()'
+
+       -version:     print the Ferret header with version number and quit
+
+       -help:        print this help message and quit
+
+       -quiet        do not display the startup header or
+                     warning of import failures
+
+       -batch:       draw to <filename> (default "ferret.png") instead of
+                     displaying to the console.  The file format will be
+                     guessed from the filename extension.  When using this
+                     option, new windows should not be created and the
+                     FRAME command should not be used.
+
+                     Use of -batch (and -transparent) is not recommended.
+                     Instead use the -nodisplay option and the FRAME
+                     /FILE=<filename> [ /TRANSPARENT ] command.
+
+       -transparent: use a transparent background instead of opaque white
+                     when saving to the file given by -batch
+
+       -script:      execute the script <scriptname> with any arguments specified,
+                     and exit (THIS MUST BE SPECIFIED LAST)
+
+    """
+
+    my_metaname = None
+    my_transparent = False
+    my_unmapped = False
+    my_memsize = 25.6
+    my_journal = True
+    my_verify = True
+    my_restrict = False
+    my_server = False
+    my_quiet = False
+    my_enterferret = enterferret
+    script = None
+    # To be compatible with traditional Ferret command-line options
+    # (that are still supported), we need to parse the options by hand.
+    if arglist:
+        print_help = False
+        just_exit = False
+        try:
+            k = 0
+            while k < len(arglist):
+                opt = arglist[k]
+                if opt == "-memsize":
+                    k += 1
+                    try:
+                        my_memsize = float(arglist[k])
+                    except:
+                        raise ValueError("a positive number must be given for a -memsize value")
+                    if my_memsize <= 0.0:
+                        raise ValueError("a positive number must be given for a -memsize value")
+                elif opt == "-batch":
+                    my_metaname = "ferret.png"
+                    k += 1
+                    # -batch has an optional argument
+                    try:
+                        if arglist[k][0] != '-':
+                            my_metaname = arglist[k]
+                        else:
+                            k -= 1
+                    except:
+                        k -= 1
+                elif opt == "-transparent":
+                    my_transparent = True
+                elif opt == "-nodisplay":
+                    my_unmapped = True
+                elif opt == "-gif":
+                    my_unmapped = True
+                elif opt == "-unmapped":
+                    my_unmapped = True
+                elif opt == "-nojnl":
+                    my_journal = False
+                elif opt == "-noverify":
+                    my_verify = False
+                elif opt == "-secure":
+                    my_restrict = True
+                elif opt == "-server":
+                    my_server = True
+                elif opt == "-quiet":
+                    my_quiet = True
+                elif opt == "-python":
+                    my_enterferret = False
+                elif opt == "-version":
+                    just_exit = True
+                    break
+                elif (opt == "-help") or (opt == "-h") or (opt == "--help"):
+                    print_help = True
+                    break
+                elif opt == "-script":
+                    k += 1
+                    try:
+                        script = arglist[k:]
+                        if len(script) == 0:
+                            raise ValueError("a script filename must be given for the -script value")
+                    except:
+                        raise ValueError("a script filename must be given for the -script value")
+                    break
+                else:
+                    raise ValueError("unrecognized option '%s'" % opt)
+                k += 1
+        except ValueError, errmsg:
+            # print the error message, then print the help message
+            print >>sys.stderr, "\n%s" % errmsg
+            print_help = True
+        if print_help:
+            # print the help message, then mark for exiting
+            print >>sys.stderr, ferret_help_message
+            just_exit = True
+        if just_exit:
+            # print the ferret header then exit completely
+            start(journal=False, verify=False, unmapped=True)
+            result = run("exit /program")
+            # should not get here
+            raise SystemExit
+
+    # Use tab completion for readline (for Ferret) by default
+    readline.parse_and_bind('tab: complete');
+
+    # Execute the $PYTHONSTARTUP file, if it exists and -secure not given
+    if not my_restrict:
+        try:
+            execfile(os.getenv('PYTHONSTARTUP', ''));
+        except IOError:
+            pass;
+
+    # Create the list of standard ferret PyEFs to create
+    std_pyefs = [ ]
+    # The stats_* functions - depend on scipy
+    try:
+        import scipy
+        std_pyefs.extend((
+                  "stats.stats_beta_cdf",
+                  "stats.stats_beta_isf",
+                  "stats.stats_beta_pdf",
+                  "stats.stats_beta_ppf",
+                  "stats.stats_beta_rvs",
+                  "stats.stats_beta_sf",
+                  "stats.stats_binom_cdf",
+                  "stats.stats_binom_isf",
+                  "stats.stats_binom_pmf",
+                  "stats.stats_binom_ppf",
+                  "stats.stats_binom_rvs",
+                  "stats.stats_binom_sf",
+                  "stats.stats_cauchy_cdf",
+                  "stats.stats_cauchy_isf",
+                  "stats.stats_cauchy_pdf",
+                  "stats.stats_cauchy_ppf",
+                  "stats.stats_cauchy_rvs",
+                  "stats.stats_cauchy_sf",
+                  "stats.stats_chi_cdf",
+                  "stats.stats_chi_isf",
+                  "stats.stats_chi_pdf",
+                  "stats.stats_chi_ppf",
+                  "stats.stats_chi_rvs",
+                  "stats.stats_chi_sf",
+                  "stats.stats_chi2_cdf",
+                  "stats.stats_chi2_isf",
+                  "stats.stats_chi2_pdf",
+                  "stats.stats_chi2_ppf",
+                  "stats.stats_chi2_rvs",
+                  "stats.stats_chi2_sf",
+                  "stats.stats_expon_cdf",
+                  "stats.stats_expon_isf",
+                  "stats.stats_expon_pdf",
+                  "stats.stats_expon_ppf",
+                  "stats.stats_expon_rvs",
+                  "stats.stats_expon_sf",
+                  "stats.stats_exponweib_cdf",
+                  "stats.stats_exponweib_isf",
+                  "stats.stats_exponweib_pdf",
+                  "stats.stats_exponweib_ppf",
+                  "stats.stats_exponweib_rvs",
+                  "stats.stats_exponweib_sf",
+                  "stats.stats_f_cdf",
+                  "stats.stats_f_isf",
+                  "stats.stats_f_pdf",
+                  "stats.stats_f_ppf",
+                  "stats.stats_f_rvs",
+                  "stats.stats_f_sf",
+                  "stats.stats_gamma_cdf",
+                  "stats.stats_gamma_isf",
+                  "stats.stats_gamma_pdf",
+                  "stats.stats_gamma_ppf",
+                  "stats.stats_gamma_rvs",
+                  "stats.stats_gamma_sf",
+                  "stats.stats_geom_cdf",
+                  "stats.stats_geom_isf",
+                  "stats.stats_geom_pmf",
+                  "stats.stats_geom_ppf",
+                  "stats.stats_geom_rvs",
+                  "stats.stats_geom_sf",
+                  "stats.stats_hypergeom_cdf",
+                  "stats.stats_hypergeom_isf",
+                  "stats.stats_hypergeom_pmf",
+                  "stats.stats_hypergeom_ppf",
+                  "stats.stats_hypergeom_rvs",
+                  "stats.stats_hypergeom_sf",
+                  "stats.stats_invgamma_cdf",
+                  "stats.stats_invgamma_isf",
+                  "stats.stats_invgamma_pdf",
+                  "stats.stats_invgamma_ppf",
+                  "stats.stats_invgamma_rvs",
+                  "stats.stats_invgamma_sf",
+                  "stats.stats_laplace_cdf",
+                  "stats.stats_laplace_isf",
+                  "stats.stats_laplace_pdf",
+                  "stats.stats_laplace_ppf",
+                  "stats.stats_laplace_rvs",
+                  "stats.stats_laplace_sf",
+                  "stats.stats_lognorm_cdf",
+                  "stats.stats_lognorm_isf",
+                  "stats.stats_lognorm_pdf",
+                  "stats.stats_lognorm_ppf",
+                  "stats.stats_lognorm_rvs",
+                  "stats.stats_lognorm_sf",
+                  "stats.stats_nbinom_cdf",
+                  "stats.stats_nbinom_isf",
+                  "stats.stats_nbinom_pmf",
+                  "stats.stats_nbinom_ppf",
+                  "stats.stats_nbinom_rvs",
+                  "stats.stats_nbinom_sf",
+                  "stats.stats_norm_cdf",
+                  "stats.stats_norm_isf",
+                  "stats.stats_norm_pdf",
+                  "stats.stats_norm_ppf",
+                  "stats.stats_norm_rvs",
+                  "stats.stats_norm_sf",
+                  "stats.stats_pareto_cdf",
+                  "stats.stats_pareto_isf",
+                  "stats.stats_pareto_pdf",
+                  "stats.stats_pareto_ppf",
+                  "stats.stats_pareto_rvs",
+                  "stats.stats_pareto_sf",
+                  "stats.stats_poisson_cdf",
+                  "stats.stats_poisson_isf",
+                  "stats.stats_poisson_pmf",
+                  "stats.stats_poisson_ppf",
+                  "stats.stats_poisson_rvs",
+                  "stats.stats_poisson_sf",
+                  "stats.stats_randint_cdf",
+                  "stats.stats_randint_isf",
+                  "stats.stats_randint_pmf",
+                  "stats.stats_randint_ppf",
+                  "stats.stats_randint_rvs",
+                  "stats.stats_randint_sf",
+                  "stats.stats_t_cdf",
+                  "stats.stats_t_isf",
+                  "stats.stats_t_pdf",
+                  "stats.stats_t_ppf",
+                  "stats.stats_t_rvs",
+                  "stats.stats_t_sf",
+                  "stats.stats_uniform_cdf",
+                  "stats.stats_uniform_isf",
+                  "stats.stats_uniform_pdf",
+                  "stats.stats_uniform_ppf",
+                  "stats.stats_uniform_rvs",
+                  "stats.stats_uniform_sf",
+                  "stats.stats_weibull_cdf",
+                  "stats.stats_weibull_isf",
+                  "stats.stats_weibull_pdf",
+                  "stats.stats_weibull_ppf",
+                  "stats.stats_weibull_rvs",
+                  "stats.stats_weibull_sf",
+                  "stats.stats_cdf",
+                  "stats.stats_isf",
+                  "stats.stats_pdf",
+                  "stats.stats_pmf",
+                  "stats.stats_ppf",
+                  "stats.stats_rvs",
+                  "stats.stats_sf",
+                  "stats.stats_chisquare",
+                  "stats.stats_fit",
+                  "stats.stats_kstest1",
+                  "stats.stats_kstest2",
+                  "stats.stats_linregress",
+                  "stats.stats_pearsonr",
+                  "stats.stats_percentilesofscores",
+                  "stats.stats_probplotvals",
+                  "stats.stats_stats",
+                  "stats.stats_scoresatpercentiles",
+                  "stats.stats_spearmanr",
+                  "stats.stats_ttest1",
+                  "stats.stats_ttest2ind",
+                  "stats.stats_ttest2rel",
+                  "stats.stats_zscore",
+                  "stats.stats_helper",
+                  ))
+    except ImportError:
+        if not my_quiet:
+            print >>sys.stderr, "    WARNING: Unable to import scipy;\n" \
+                                "             most stats_* Ferret functions will not be added."
+    # stats_* functions that do not need scipy
+    std_pyefs.append("stats.stats_histogram")
+    # shapefile_* functions
+    try:
+        import shapefile
+        std_pyefs.extend((
+                  "fershp.shapefile_readxy",
+                  "fershp.shapefile_readxyval",
+                  "fershp.shapefile_readxyz",
+                  "fershp.shapefile_readxyzval",
+                  "fershp.shapefile_writeval",
+                  "fershp.shapefile_writexyval",
+                  "fershp.shapefile_writexyzval",
+                  ))
+    except ImportError:
+        if not my_quiet:
+            print >>sys.stderr, "    WARNING: Unable to import shapefile;\n" \
+                                "             shapefile_* Ferret functions will not be added."
+    # regrid functions
+    try:
+        import ESMP
+        std_pyefs.extend((
+                  "regrid.curv2rect",
+                  "regrid.curv3srect",
+                  ))
+    except ImportError:
+        if not my_quiet:
+            print >>sys.stderr, "    WARNING: Unable to import ESMP;\n" \
+                                "             curv2rect* Ferret functions will not be added.\n" \
+                                "             Use curv_to_rect* functions instead"
+
+    # start ferret without journaling
+    start(memsize=my_memsize, journal=False, verify=my_verify,
+          restrict=my_restrict, server=my_server, metaname=my_metaname,
+          transparent=my_transparent, unmapped=my_unmapped, quiet=my_quiet)
+
+    # define all the Ferret standard Python external functions
+    for fname in std_pyefs:
+        result = run("define pyfunc pyferret.%s" % fname)
+
+    # run the ${HOME}/.ferret script if it exists and not restricted environment
+    if not my_restrict:
+        home_val = os.getenv('HOME')
+        if home_val:
+            init_script = os.path.join(home_val, '.ferret')
+            if os.path.exists(init_script):
+                try:
+                    result = run('go "%s"; exit /topy' % init_script)
+                except:
+                    print >>sys.stderr, " **Error: exception raised in runnning script %s" % init_script
+                    result = run('exit /program')
+                    # should not get here
+                    raise SystemExit
+
+    # if a command-line script is given, run the script and exit completely
+    if script != None:
+        # put double quotes around every script argument
+        script_line = '"' + '" "'.join(script) + '"'
+        try:
+            result = run('go %s; exit /program' % script_line)
+        except:
+            print >>sys.stderr, " **Error: exception raised in running script %s" % script_line
+        # If exception or if returned early, force shutdown
+        result = run('exit /program')
+        # should not get here
+        raise SystemExit
+
+    # if journaling desired, now turn on journaling
+    if my_journal:
+        result = run("set mode journal")
+
+    # if they don't want to enter ferret, return the success value from run
+    if not my_enterferret:
+        return (libpyferret.FERR_OK, '')
+
+    # otherwise, go into Ferret command-line processing until "exit /topy" or "exit /program"
+    result = run()
+    return result
+
+
+def start(memsize=25.6, journal=True, verify=True, restrict=False,
+          server=False, metaname=None, transparent=False,
+          unmapped=False, quiet=False):
+    """
+    Initializes Ferret.  This allocates the initial amount of memory
+    for Ferret (from Python-managed memory), opens the journal file,
+    if requested, and sets Ferret's verify mode.  If restrict is True,
+    some Ferret commands will not be available (to provide a secured
+    session).  Once restrict is set, it cannot be unset.  If server
+    is True, Ferret will be run in server mode.  If metaname is not
+    empty this value is used as the initial filename for automatic
+    output of graphics, and the graphics viewer will not be displayed.
+    If unmapped is True, the graphics viewer will not be displayed.
+    If quiet is True, the Ferret start-up header is not displayed.
+    This routine does NOT run any user initialization scripts.
+
+    Arguments:
+        memsize:     the size, in mega (10^6) floats (where 1 float
+                     = 8 bytes) to allocate for Ferret's memory block
+        journal:     turn on Ferret's journal mode?
+        verify:      turn on Ferret's verify mode?
+        restrict:    restrict Ferret's capabilities?
+        server:      put Ferret in server mode?
+        metaname:    filename for Ferret graphics; can be None or empty
+        transparent: autosave (e.g., on exit) image files with a
+                     transparent background?
+        unmapped:    hide the graphics viewer?
+        quiet:       do not display the Ferret start-up header?
+    Returns:
+        True is successful
+        False if Ferret has already been started
+    Raises:
+        ValueError if memsize if not a positive number
+        MemoryError if unable to allocate the needed memory
+        IOError if unable to open the journal file
+    """
+    # check memsize
+    try:
+        flt_memsize = float(memsize)
+        if flt_memsize <= 0.0:
+            raise ValueError
+    except:
+        raise ValueError("memsize must be a positive number")
+    # check metaname
+    if metaname == None:
+        str_metaname = ""
+    elif not isinstance(metaname, str):
+        raise ValueError("metaname must either be None or a string")
+    elif metaname.isspace():
+        str_metaname = ""
+    else:
+        str_metaname = metaname
+    # Get the known viewer bindings
+    knownengines = graphbind.knownPyFerretEngines()
+    # Add PViewerPQPyFerretBindings, as "PipedViewerPQ" to the known bindings
+    if not ("PipedViewerPQ" in knownengines):
+        graphbind.addPyFerretBindings("PipedViewerPQ",
+                  pipedviewer.pyferretbindings.PViewerPQPyFerretBindings)
+    # Add PImagerPQPyFerretBindings, as "PipedImagerPQ" to the known bindings
+    if not ("PipedImagerPQ" in knownengines):
+        graphbind.addPyFerretBindings("PipedImagerPQ",
+                  pipedviewer.pyferretbindings.PImagerPQPyFerretBindings)
+    # the actual call to ferret's start
+    return libpyferret._start(flt_memsize, bool(journal), bool(verify),
+                              bool(restrict), bool(server), str_metaname,
+                              bool(transparent), bool(unmapped), bool(quiet))
+
+
+def resize(memsize):
+    """
+    Resets the the amount of memory allocated for Ferret from Python-managed memory.
+
+    Arguments:
+        memsize: the new size, in mega (10^) floats (where a "float" is 8 bytes),
+                 for Ferret's memory block
+    Returns:
+        True if successful - Ferret has the new amount of memory
+        False if unsuccessful - Ferret has the previous amount of memory
+    Raises:
+        ValueError if memsize if not a positive number
+        MemoryError if Ferret has not been started or has been stopped
+    """
+    # check memsize
+    try:
+        flt_memsize = float(memsize)
+        if flt_memsize <= 0.0:
+            raise ValueError
+    except:
+        raise ValueError("memsize must be a positive number")
+    # the actual call
+    return libpyferret._resize(flt_memsize)
+
+
+def run(command=None):
+    """
+    Runs a Ferret command just as if entering a command at the Ferret prompt.
+
+    If the command is not given, is None, or is a blank string, Ferret will
+    prompt you for commands until "EXIT /TOPYTHON" is given.  In this case,
+    the return tuple will be for the last error, if any, that occurred in
+    the sequence of commands given to Ferret.
+
+    Arguments:
+        command: the Ferret command to be executed.
+    Returns:
+        (err_int, err_string)
+            err_int: one of the FERR_* data values (FERR_OK if there are no errors)
+            err_string: error or warning message (can be empty)
+        Error messages normally start with "**ERROR"
+        Warning messages normally start with "*** NOTE:"
+    Raises:
+        ValueError if command is neither None nor a String
+        MemoryError if Ferret has not been started or has been stopped
+    """
+    # check command
+    if command == None:
+        str_command = ""
+    elif not isinstance(command, str):
+        raise ValueError("command must either be None or a string")
+    elif command.isspace():
+        str_command = ""
+    else:
+        str_command = command
+    # if going into Ferret-command mode,
+    # use the filename completer for readline name completion
+    if str_command == "":
+        old_completer = readline.get_completer()
+        filename_completer_obj = filenamecompleter.FilenameCompleter()
+        readline.set_completer(filename_completer_obj.complete)
+    # the actual Ferret function call
+    retval = libpyferret._run(str_command)
+    # return to the original readline completer
+    if str_command == "":
+        readline.set_completer(old_completer)
+        del filename_completer_obj
+    return retval
+
+
+def metastr(datadict):
+    """
+    Creates a string representation of the metadata in a data dictionary.
+    Print this string to show a nicely formatted display of the metadata.
+
+    Arguments:
+        datadict: a data dictionary, as returned by the getdata method.
+    Returns:
+        the string representation of the metadata in datadict.
+    Raises:
+        TypeError if datadict is not a dictionary
+    """
+    uc_month = { 1: "JAN", 2:"FEB", 3:"MAR", 4:"APR", 5:"MAY", 6:"JUN",
+                 7:"JUL", 8:"AUG", 9:"SEP", 10:"OCT", 11:"NOV", 12:"DEC" }
+    if not isinstance(datadict, dict):
+        raise TypeError("datadict is not a dictionary")
+    # specify an order of output for standard keys, leaving out "data"
+    keylist = [ "name", "title", "dset", "data_unit", "missing_value",
+                "axis_names", "axis_types", "axis_units", "axis_coords" ]
+    # append non-standard keys in alphabetical order
+    for key in sorted(datadict.keys()):
+        if (key != "data") and (key not in keylist):
+            keylist.append(key)
+    # create the metadata string using StringIO
+    strbuf = StringIO.StringIO()
+    for key in keylist:
+        try:
+            # make sure the key:value pair exists
+            val = datadict[key]
+            # just in case the key is not a string (for printing)
+            keystr = str(key)
+            if keystr == "axis_coords":
+                print >>strbuf, keystr + ":"
+                for (idx, item) in enumerate(val):
+                    # add the axis name (which will be present if coordinates
+                    # are given) as a label for the axis coordinates
+                    itemlabel = "   '" + datadict["axis_names"][idx] + "': "
+                    if datadict["axis_types"][idx] == libpyferret.AXISTYPE_TIME:
+                        # add a translation of each of the time 6-tuples
+                        strlist = [ ]
+                        for subitem in item:
+                            strlist.append(" %s = %02d-%3s-%04d %02d:%02d:%02d" % \
+                                           (str(subitem),
+                                                subitem[libpyferret.TIMEARRAY_DAYINDEX],
+                                       uc_month[subitem[libpyferret.TIMEARRAY_MONTHINDEX]],
+                                                subitem[libpyferret.TIMEARRAY_YEARINDEX],
+                                                subitem[libpyferret.TIMEARRAY_HOURINDEX],
+                                                subitem[libpyferret.TIMEARRAY_MINUTEINDEX],
+                                                subitem[libpyferret.TIMEARRAY_SECONDINDEX],) )
+                        if len(strlist) == 0:
+                           strlist.append("[]")
+                        else:
+                           strlist[0] = "[" + strlist[0][1:]
+                           strlist[-1] = strlist[-1] + "]"
+                    else:
+                        # just print the values of non-time axis coordinates
+                        strlist = str(item).split('\n')
+                    # adjust the subsequent-line-indent if multiple lines
+                    itemstr = itemlabel + strlist[0]
+                    indent = " " * len(itemlabel)
+                    for addstr in strlist[1:]:
+                        itemstr += "\n" + indent + addstr
+                    print >>strbuf, itemstr
+            elif keystr == "axis_types":
+                # add a translation of the axis type number
+                valstr = "("
+                for (idx, item) in enumerate(val):
+                    if idx > 0:
+                        valstr += ", "
+                    valstr += str(item)
+                    if item == libpyferret.AXISTYPE_LONGITUDE:
+                        valstr += "=longitude"
+                    elif item == libpyferret.AXISTYPE_LATITUDE:
+                        valstr += "=latitude"
+                    elif item == libpyferret.AXISTYPE_LEVEL:
+                        valstr += "=level"
+                    elif item == libpyferret.AXISTYPE_TIME:
+                        valstr += "=time"
+                    elif item == libpyferret.AXISTYPE_CUSTOM:
+                        valstr += "=custom"
+                    elif item == libpyferret.AXISTYPE_ABSTRACT:
+                        valstr += "=abstract"
+                    elif item == libpyferret.AXISTYPE_NORMAL:
+                        valstr += "=unused"
+                valstr += ")"
+                print >>strbuf, keystr + ": " + valstr
+            elif keystr == "missing_value":
+                # print the one value in the missing value array
+                print >>strbuf, keystr + ": " + str(val[0])
+            else:
+                # just print as "key: value", except
+                # adjust the subsequent-line-indent if multiple lines
+                strlist = str(val).split('\n')
+                valstr = strlist[0]
+                indent = " " * (len(keystr) + 2)
+                for addstr in strlist[1:]:
+                    valstr += "\n" + indent + addstr
+                print >>strbuf, keystr + ": " + valstr
+        except KeyError:
+            # known key not present - ignore
+            pass
+    strval = strbuf.getvalue()
+    strbuf.close()
+    return strval
+
+
+def getdata(name, create_mask=True):
+    """
+    Returns the numeric array and axes information for the data variable
+    described in name as a dictionary.
+
+    Arguments:
+        name: the name of the numeric data to retrieve
+        create_mask: return the numeric data array as a MaskedArray object?
+    Returns:
+        A dictionary contains the numeric data array and axes information.
+        Note that 'name' is not assigned, which is required for the putdata
+        method.  The dictionary contains the following key/value pairs:
+            'title' : the string passed in the name argument
+            'data': the numeric data array.  If create_mask is True, this
+                    will be a NumPy float64 MaskedArray object with the
+                    masked array properly assigned.  If create_mask is False,
+                    this will just be a NumPy float64 ndarray.
+            'missing_value': the missing data value.  This will be a NumPy
+                    float64 ndarray containing a single value.
+            'data_unit': a string describing the unit of the data.
+            'axis_types': a list of integer values describing the type of
+                    each axis.  Possible values are the following constants
+                    defined by the pyferret module:
+                        AXISTYPE_LONGITUDE
+                        AXISTYPE_LATITUDE
+                        AXISTYPE_LEVEL
+                        AXISTYPE_TIME
+                        AXISTYPE_CUSTOM   (axis units not recognized by Ferret)
+                        AXISTYPE_ABSTRACT (axis is unit-less integer values)
+                        AXISTYPE_NORMAL   (axis is normal to the data)
+            'axis_names': a list of strings giving the name of each axis
+            'axis_units': a list of strings giving the unit of each axis.
+                    If the axis type is AXISTYPE_TIME, this names the calendar
+                    used for the timestamps, as one of the following strings
+                    defined by the pyferret module:
+                        CALTYPE_360DAY
+                        CALTYPE_NOLEAP
+                        CALTYPE_GREGORIAN
+                        CALTYPE_JULIAN
+                        CALTYPE_ALLLEAP
+                        CALTYPE_NONE    (calendar not specified)
+            'axis_coords': a list of NumPy ndarrays giving the coordinate values
+                    for each axis.  If the axis type is neither AXISTYPE_TIME
+                    nor AXISTYPE_NORMAL, a NumPy float64 ndarray is given.  If
+                    the axis is type AXISTYPE_TIME, a NumPy integer ndarray of
+                    shape (N,6) where N is the number of time points.  The six
+                    integer values per time point are the day, month, year, hour,
+                    minute, and second of the associate calendar for this time
+                    axis.  The following constants defined by the pyferret module
+                    give the values of these six indices:
+                        TIMEARRAY_DAYINDEX
+                        TIMEARRAY_MONTHINDEX
+                        TIMEARRAY_YEARINDEX
+                        TIMEARRAY_HOURINDEX
+                        TIMEARRAY_MINUTEINDEX
+                        TIMEARRAY_SECONDINDEX
+                    (Thus, axis_coords[t, pyferret.TIMEARRAY_YEARINDEX]
+                     gives the year of time point t.)
+        Note: a relative time axis will be of type AXISTYPE_CUSTOM, with a unit
+              indicating the starting point, such as 'days since 01-JAN-2000'
+    Raises:
+        ValueError if the data name is invalid
+        MemoryError if Ferret has not been started or has been stopped
+    See also:
+        get
+    """
+    # lists of units (in uppercase) for checking if a custom axis is actual a longitude axis
+    UC_LONGITUDE_UNITS = [ "DEG E", "DEG_E", "DEG EAST", "DEG_EAST",
+                           "DEGREES E", "DEGREES_E", "DEGREES EAST", "DEGREES_EAST",
+                           "DEG W", "DEG_W", "DEG WEST", "DEG_WEST",
+                           "DEGREES W", "DEGREES_W", "DEGREES WEST", "DEGREES_WEST" ]
+    # lists of units (in uppercase) for checking if a custom axis is actual a latitude axis
+    UC_LATITUDE_UNITS  = [ "DEG N", "DEG_N", "DEG NORTH", "DEG_NORTH",
+                           "DEGREES N", "DEGREES_N", "DEGREES NORTH", "DEGREES_NORTH",
+                           "DEG S", "DEG_S", "DEG SOUTH", "DEG_SOUTH",
+                           "DEGREES S", "DEGREES_S", "DEGREES SOUTH", "DEGREES_SOUTH" ]
+    # check name
+    if not isinstance(name, str):
+        raise ValueError("name must be a string")
+    elif name.isspace():
+        raise ValueError("name cannot be an empty string")
+    # get the data and related information from Ferret
+    vals = libpyferret._get(name)
+    # break apart the tuple to simplify (returning a dictionary would have been better)
+    data = vals[0]
+    bdfs = vals[1]
+    data_unit = vals[2]
+    axis_types = vals[3]
+    axis_names = vals[4]
+    axis_units = vals[5]
+    axis_coords = vals[6]
+    # A custom axis could be standard axis that is not in Ferret's expected order,
+    # so check the units
+    for k in xrange(libpyferret.MAX_FERRET_NDIM):
+        if axis_types[k] == libpyferret.AXISTYPE_CUSTOM:
+            uc_units = axis_units[k].upper()
+            if uc_units in UC_LONGITUDE_UNITS:
+                axis_types[k] = libpyferret.AXISTYPE_LONGITUDE
+            elif uc_units in UC_LATITUDE_UNITS:
+                axis_types[k] = libpyferret.AXISTYPE_LATITUDE
+    # libpyferret._get returns a copy of the data, so no need to force a copy
+    if create_mask:
+        if numpy.isnan(bdfs[0]):
+            # NaN comparisons always return False, even to another NaN
+            datavar = numpy.ma.array(data, fill_value=bdfs[0], mask=numpy.isnan(data))
+        else:
+            # since values in data and bdfs[0] are all float64 values assigned by Ferret,
+            # using equality should work correctly
+            datavar = numpy.ma.array(data, fill_value=bdfs[0], mask=( data == bdfs[0] ))
+    else:
+        datavar = data
+    return { "title": name, "data":datavar, "missing_value":bdfs, "data_unit":data_unit,
+             "axis_types":axis_types, "axis_names":axis_names, "axis_units":axis_units,
+             "axis_coords":axis_coords }
+
+
+def get(name, create_mask=True):
+    """
+    Returns the numeric data array described in name as a TransientVariable object.
+
+    Arguments:
+        name: the name of the numeric data array to retrieve
+        create_mask: create the mask for the TransientVariable object?
+    Returns:
+        A cdms2 TransientVariable object (cdms2.tvariable) containing the
+        numeric data.  The data, axes, and missing value will be assigned.
+        If create_mask is True (or not given), the mask attribute will be
+        assigned using the missing value.
+    Raises:
+        ImportError: if the cdms2 or cdtime modules cannot be found (use getdata instead)
+        ValueError:  if the data name is invalid
+        MemoryError: if Ferret has not been started or has been stopped
+    See also:
+        getdata (does not need cdms2 or cdtime)
+    """
+    # Check (again) if able to import cdms2/cdtime.
+    # If the imports were successful before, these imports do nothing
+    try:
+        import cdms2
+        import cdtime
+    except ImportError:
+        raise ImportError("cdms2 or cdtime not found; pyferret.get not available.\n" \
+                          "             Use pyferret.getdata instead.")
+
+    # lists of units (in lowercase) for checking if a custom axis can be represented by a cdtime.reltime
+    # the unit must be followed by "since" and something else
+    LC_TIME_UNITS = [ "s", "sec", "secs", "second", "seconds",
+                      "mn", "min", "mins", "minute", "minutes",
+                      "hr", "hour", "hours",
+                      "dy", "day", "days",
+                      "mo", "month", "months",
+                      "season", "seasons",
+                      "yr", "year", "years" ]
+    lc_month_nums = { "jan":1, "feb":2, "mar":3, "apr":4, "may":5, "jun":6,
+                      "jul":7, "aug":8, "sep":9, "oct":10, "nov":11, "dec":12 }
+    # get the data and related information from Ferret,
+    # building on what was done in getdata
+    data_dict = getdata(name, create_mask)
+    data = data_dict["data"]
+    bdfs = data_dict["missing_value"]
+    data_unit = data_dict["data_unit"]
+    axis_types = data_dict["axis_types"]
+    axis_names = data_dict["axis_names"]
+    axis_units = data_dict["axis_units"]
+    axis_coords = data_dict["axis_coords"]
+    # create the axis list for this variable
+    var_axes = [ ]
+    for k in xrange(libpyferret.MAX_FERRET_NDIM):
+        if axis_types[k] == libpyferret.AXISTYPE_LONGITUDE:
+            newaxis = cdms2.createAxis(axis_coords[k], id=axis_names[k])
+            newaxis.units = axis_units[k]
+            newaxis.designateLongitude()
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_LATITUDE:
+            newaxis = cdms2.createAxis(axis_coords[k], id=axis_names[k])
+            newaxis.units = axis_units[k]
+            newaxis.designateLatitude()
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_LEVEL:
+            newaxis = cdms2.createAxis(axis_coords[k], id=axis_names[k])
+            newaxis.units = axis_units[k]
+            newaxis.designateLevel()
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_TIME:
+            # create the time axis from cdtime.comptime (component time) objects
+            time_coords = axis_coords[k]
+            timevals = [ ]
+            for t in xrange(time_coords.shape[0]):
+                day = time_coords[t, libpyferret.TIMEARRAY_DAYINDEX]
+                month = time_coords[t, libpyferret.TIMEARRAY_MONTHINDEX]
+                year = time_coords[t, libpyferret.TIMEARRAY_YEARINDEX]
+                hour = time_coords[t, libpyferret.TIMEARRAY_HOURINDEX]
+                minute = time_coords[t, libpyferret.TIMEARRAY_MINUTEINDEX]
+                second = time_coords[t, libpyferret.TIMEARRAY_SECONDINDEX]
+                timevals.append( cdtime.comptime(year,month,day,hour,minute,second) )
+            newaxis = cdms2.createAxis(timevals, id=axis_names[k])
+            # designate the calendar
+            if axis_units[k] == CALTYPE_360DAY:
+                calendar_type = cdtime.Calendar360
+            elif axis_units[k] == CALTYPE_NOLEAP:
+                calendar_type = cdtime.NoLeapCalendar
+            elif axis_units[k] == CALTYPE_GREGORIAN:
+                calendar_type = cdtime.GregorianCalendar
+            elif axis_units[k] == CALTYPE_JULIAN:
+                calendar_type = cdtime.JulianCalendar
+            else:
+                if axis_units[k] == CALTYPE_ALLLEAP:
+                    raise ValueError("The all-leap calendar not support by cdms2")
+                if axis_units[k] == CALTYPE_NONE:
+                    raise ValueError("Undesignated calendar not support by cdms2")
+                raise RuntimeError("Unexpected calendar type of %s" % axis_units[k])
+            newaxis.designateTime(calendar=calendar_type)
+            # and finally append it to the axis list
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_CUSTOM:
+            # Check a custom axis for relative time units.  Note that getdata has
+            # already dealt with longitude or latitude not in Ferret's standard position.
+            lc_vals = axis_units[k].lower().split()
+            if (len(lc_vals) > 2) and (lc_vals[1] == "since") and (lc_vals[0] in LC_TIME_UNITS):
+                # (unit) since (start_date)
+                datevals = lc_vals[2].split("-")
+                try:
+                    # try to convert dd-mon-yyyy Ferret-style start_date to yyyy-mm-dd
+                    day_num = int(datevals[0])
+                    mon_num = lc_month_nums[datevals[1]]
+                    year_num = int(datevals[2])
+                    lc_vals[2] = "%04d-%02d-%02d" % (year_num, mon_num, day_num)
+                    relunit = " ".join(lc_vals)
+                except (IndexError, KeyError, ValueError):
+                    # use the relative time unit as given
+                    relunit = " ".join(lc_vals)
+                timevals = [ ]
+                for t in xrange(axis_coords[k].shape[0]):
+                    dtval = cdtime.reltime(axis_coords[k][t], relunit)
+                    timevals.append(dtval)
+                newaxis = cdms2.createAxis(timevals, id=axis_names[k])
+                newaxis.designateTime()
+            else:
+                newaxis = cdms2.createAxis(axis_coords[k], id=axis_names[k])
+                newaxis.units = axis_units[k]
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_ABSTRACT:
+            newaxis = cdms2.createAxis(axis_coords[k], id=axis_names[k])
+            var_axes.append(newaxis)
+        elif axis_types[k] == libpyferret.AXISTYPE_NORMAL:
+            var_axes.append(None)
+        else:
+            raise RuntimeError("Unexpected axis type of %d" % axis_types[k])
+    # getdata returns a copy of the data, thus createVariable does not
+    # need to force a copy.  The mask, if request, was created by getdata.
+    datavar = cdms2.createVariable(data, fill_value=bdfs[0], axes=var_axes,
+                                   attributes={"name":name, "units":data_unit})
+    return datavar
+
+
+def put(datavar, axis_pos=None):
+    """
+    Creates a Ferret data variable with a copy of the data given in the
+    AbstractVariable object datavar.
+
+    Arguments:
+
+        datavar:  a cdms2 AbstractVariable describing the data variable
+                  to be created in Ferret.  Any masked values in the data
+                  of datavar will be set to the missing value for datavar
+                  before extracting the data as 64-bit floating-point
+                  values for Ferret.  In addition to the data and axes
+                  described in datavar, the following attributes are used:
+                      id: the code name for the variable in Ferret (eg,
+                          'SST').  This name must be present and, ideally,
+                          should not contain spaces, quotes, or algebraic
+                          symbols.
+                      name: the title name of the variable in Ferret (eg,
+                          'Sea Surface Temperature').  If not present, the
+                          value of the id attribute is used.
+                      units: the unit name for the data.  If not present,
+                          no units are associated with the data.
+                      dset: Ferret dataset name or number to be associated
+                          with this new variable.  If not given or blank,
+                          the variable is associated with the current dataset.
+                          If None or 'None', the variable is not associated
+                          with any dataset.
+
+        axis_pos: a six-tuple giving the Ferret positions for each axis in
+                  datavar.  If the axes in datavar are in (forecast, ensemble,
+                  time, level, lat., long.) order, the tuple (F_AXIS, E_AXIS,
+                  T_AXIS, Z_AXIS, Y_AXIS, X_AXIS) should be used for proper
+                  axis handling in Ferret.  If not given (or None), the first
+                  longitude axis will be made the X_AXIS, the first latitude
+                  axis will be made the Y_AXIS, the first level axis will be
+                  made the Z_AXIS, the first time axis will be made the T_AXIS,
+                  the second time axis will be made the F_AXIS, and any remaining
+                  axes are then filled into the remaining unassigned positions.
+
+    Returns:
+        None
+
+    Raises:
+        ImportError:    if the cdms2 or cdtime modules cannot be found (use putdata instead)
+        AttributeError: if datavar is missing a required method or attribute
+        MemoryError:    if Ferret has not been started or has been stopped
+        ValueError:     if there is a problem with the contents of the arguments
+
+    See also:
+        putdata (does not require cdms2 or cdtime)
+    """
+    # Check (again) if able to import cdms2/cdtime.
+    # If the imports were successful before, these imports do nothing
+    try:
+        import cdms2
+        import cdtime
+    except ImportError:
+        raise ImportError("cdms2 or cdtime not found; pyferret.put not available.\n" \
+                          "             Use pyferret.putdata instead.")
+
+
+    #
+    # code name for the Ferret variable
+    codename = datavar.id.strip()
+    if codename == "":
+        raise ValueError("The id attribute must be a non-blank string")
+    #
+    # title name for the Ferret variable
+    try:
+        titlename = datavar.name.strip()
+    except AttributeError:
+        titlename = codename
+    #
+    # units for the data
+    try:
+        data_unit = datavar.units.strip()
+    except AttributeError:
+        data_unit = ""
+    #
+    # missing data value
+    missingval = datavar.getMissing()
+    #
+    # Ferret dataset for the variable; None / 'None' is different from blank / empty
+    try:
+        dset_str = str(datavar.dset).strip()
+    except AttributeError:
+        dset_str = ""
+    #
+    # get the list of axes and initialize the axis information lists
+    axis_list = datavar.getAxisList()
+    if len(axis_list) > libpyferret.MAX_FERRET_NDIM:
+        raise ValueError("More than %d axes is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+    axis_types = [ libpyferret.AXISTYPE_NORMAL ] * libpyferret.MAX_FERRET_NDIM
+    axis_names = [ "" ] * libpyferret.MAX_FERRET_NDIM
+    axis_units = [ "" ] * libpyferret.MAX_FERRET_NDIM
+    axis_coords = [ None ] * libpyferret.MAX_FERRET_NDIM
+    for k in xrange(len(axis_list)):
+        #
+        # get the information for this axis
+        axis = axis_list[k]
+        axis_names[k] = axis.id.strip()
+        try:
+            axis_units[k] = axis.units.strip()
+        except AttributeError:
+            axis_units[k] = ""
+        axis_data = axis.getData()
+        #
+        # assign the axis information
+        if axis.isLongitude():
+            axis_types[k] = libpyferret.AXISTYPE_LONGITUDE
+            axis_coords[k] = axis_data
+        elif axis.isLatitude():
+            axis_types[k] = libpyferret.AXISTYPE_LATITUDE
+            axis_coords[k] = axis_data
+        elif axis.isLevel():
+            axis_types[k] = libpyferret.AXISTYPE_LEVEL
+            axis_coords[k] = axis_data
+        elif axis.isTime():
+            #
+            # try to create a time axis reading the values as cdtime comptime objects
+            try:
+                time_coords = numpy.empty((len(axis_data),6), dtype=numpy.int32, order="C")
+                for t in xrange(len(axis_data)):
+                    tval = axis_data[t]
+                    time_coords[t, libpyferret.TIMEARRAY_DAYINDEX] = tval.day
+                    time_coords[t, libpyferret.TIMEARRAY_MONTHINDEX] = tval.month
+                    time_coords[t, libpyferret.TIMEARRAY_YEARINDEX] = tval.year
+                    time_coords[t, libpyferret.TIMEARRAY_HOURINDEX] = tval.hour
+                    time_coords[t, libpyferret.TIMEARRAY_MINUTEINDEX] = tval.minute
+                    time_coords[t, libpyferret.TIMEARRAY_SECONDINDEX] = int(tval.second)
+                axis_types[k] = libpyferret.AXISTYPE_TIME
+                axis_coords[k] = time_coords
+                # assign the axis_units value to the CALTYPE_ calendar type string
+                calendar_type = axis.getCalendar()
+                if calendar_type == cdtime.Calendar360:
+                    axis_units[k] = CALTYPE_360DAY
+                elif calendar_type == cdtime.NoLeapCalendar:
+                    axis_units[k] = CALTYPE_NOLEAP
+                elif calendar_type == cdtime.GregorianCalendar:
+                    axis_units[k] = CALTYPE_GREGORIAN
+                elif calendar_type == cdtime.JulianCalendar:
+                    axis_units[k] = CALTYPE_JULIAN
+                else:
+                    if calendar_type == cdtime.MixedCalendar:
+                        raise ValueError("The cdtime.MixedCalendar not support by pyferret")
+                    raise ValueError("Unknown cdtime calendar %s" % str(calendar_type))
+            except AttributeError:
+                axis_types[k] = libpyferret.AXISTYPE_CUSTOM
+            #
+            # if not comptime objects, assume reltime objects - create as a custom axis
+            if axis_types[k] == libpyferret.AXISTYPE_CUSTOM:
+                time_coords = numpy.empty((len(axis_data),), dtype=numpy.float64)
+                for t in xrange(len(axis_data)):
+                    time_coords[t] = axis_data[t].value
+                axis_coords[k] = timecoords
+                # assign axis_units as the reltime units - makes sure all are the same
+                axis_units[k] = axis_data[0].units
+                for t in xrange(1, len(axis_data)):
+                    if axis_data[t].units != axis_units[k]:
+                        raise ValueError("Relative time axis does not have a consistent start point")
+        #
+        # cdms2 will create an axis if None (normal axis) was given, so create a
+        # custom or abstract axis only if it does not look like a cdms2-created axis
+        elif not ( (axis_units[k] == "") and (len(axis_data) == 1) and (axis_data[0] == 0.0) and \
+                   (axis_data.dtype == numpy.dtype('float64')) and \
+                   axis_names[k].startswith("axis_") and axis_names[k][5:].isdigit() ):
+            axis_types[k] = libpyferret.AXISTYPE_CUSTOM
+            axis_coords[k] = axis_data
+            # if a unitless integer value axis, it is abstract instead of custom
+            if axis_units[k] == "":
+                axis_int_vals = numpy.array(axis_data, dtype=int)
+                if numpy.allclose(axis_data, axis_int_vals):
+                    axis_types[k] = libpyferret.AXISTYPE_ABSTRACT
+    #
+    # datavar is an embelished masked array
+    datavar_dict = { 'name': codename, 'title': titlename, 'dset': dset_str, 'data': datavar,
+                     'missing_vaue': missingval, 'data_unit': data_unit, 'axis_types': axis_types,
+                     'axis_names': axis_names, 'axis_units': axis_units, 'axis_coords': axis_coords }
+    #
+    # use putdata to set defaults, rearrange axes, and add copies
+    # of data in the appropriate format to Ferret
+    putdata(datavar_dict, axis_pos)
+    return None
+
+
+def putdata(datavar_dict, axis_pos=None):
+    """
+    Creates a Ferret data variable with a copy of the data given in the dictionary
+    datavar_dict, reordering the data and axes according to tuple axis_pos.
+
+    Arguments:
+
+        datavar_dict: a dictionary with the following keys and associated values:
+            'name': the code name for the variable in Ferret (eg, 'SST').
+                    Must be given.
+            'title': the title name for the variable in Ferret (eg, 'Sea Surface
+                    Temperature').  If not given, the value of 'name' is used.
+            'dset' : the Ferret dataset name or number to associate with this new data
+                    variable.  If blank or not given, the current dataset is used.  If
+                    None or 'None', no dataset will be associated with the new variable.
+            'data': a NumPy numeric ndarray or masked array.  The data will be saved
+                    in Ferret as a 64-bit floating-point values.  Must be given.
+            'missing_value': the missing data value.  This will be saved in Ferret as
+                    a 64-bit floating-point value.  If not given, Ferret's default
+                    missing value (-1.0E34) will be used.
+            'data_unit': a string describing the unit of the data.  If not given, no
+                    unit will be assigned.
+            'axis_types': a list of integer values describing the type of each axis.
+                    Possible values are the following constants defined by the pyferret
+                    module:
+                        AXISTYPE_LONGITUDE
+                        AXISTYPE_LATITUDE
+                        AXISTYPE_LEVEL
+                        AXISTYPE_TIME
+                        AXISTYPE_CUSTOM   (axis units not interpreted by Ferret)
+                        AXISTYPE_ABSTRACT (axis is unit-less integer values)
+                        AXISTYPE_NORMAL   (axis is normal to the data)
+                    If not given, AXISTYPE_ABSTRACT will be used if the data array
+                    has data for that axis (shape element greater than one); otherwise,
+                    AXISTYPE_NORMAL will be used.
+            'axis_names': a list of strings giving the name of each axis.  If not given,
+                    Ferret will generate names if needed.
+            'axis_units': a list of strings giving the unit of each axis.
+                    If the axis type is AXISTYPE_TIME, this names the calendar
+                    used for the timestamps, as one of the following strings
+                    defined by the pyferret module:
+                        CALTYPE_360DAY
+                        CALTYPE_NOLEAP
+                        CALTYPE_GREGORIAN
+                        CALTYPE_JULIAN
+                        CALTYPE_ALLLEAP
+                        CALTYPE_NONE    (calendar not specified)
+                    If not given, 'DEGREES_E' will be used for AXISTYPE_LONGITUDE,
+                    'DEGREES_N' for AXISTYPE_LATITUDE, CALTYPE_GREGORIAN for
+                    AXISTYPE_TIME, and no units will be given for other axis types.
+            'axis_coords': a list of arrays of coordinates for each axis.
+                    If the axis type is neither AXISTYPE_TIME nor AXISTYPE_NORMAL,
+                    a one-dimensional numeric list or ndarray should be given (the
+                    values will be stored as floating-point values).
+                    If the axis is type AXISTYPE_TIME, a two-dimension list or ndarray
+                    with shape (N,6), where N is the number of time points, should be
+                    given.  The six integer values per time point are the day, month,
+                    year, hour, minute, and second of the associate calendar for this
+                    time axis.  The following constants defined by the pyferret module
+                    give the values of these six indices:
+                        TIMEARRAY_DAYINDEX
+                        TIMEARRAY_MONTHINDEX
+                        TIMEARRAY_YEARINDEX
+                        TIMEARRAY_HOURINDEX
+                        TIMEARRAY_MINUTEINDEX
+                        TIMEARRAY_SECONDINDEX
+                    (Thus, axis_coords[t, pyferret.TIMEARRAY_YEARINDEX] gives the year of
+                     time point t.)
+                    An array of coordinates must be given if the axis does not have a type
+                    of AXISTYPE_NORMAL or AXISTYPE_ABSTRACT (or if axis types are not given).
+            Note: a relative time axis should be given as type AXISTYPE_CUSTOM, with a
+                  unit indicating the starting point, such as 'days since 01-JAN-2000'
+
+        axis_pos: a six-tuple giving the Ferret positions for each axis in datavar.
+            If the axes in datavar are in (forecast, ensemble, time, level, lat., long.)
+            order, the tuple (F_AXIS, E_AXIS, T_AXIS, Z_AXIS, Y_AXIS, X_AXIS) should be
+            used for proper axis handling in Ferret.  If not given (or None), the first
+            longitude axis will be made the X_AXIS, the first latitude axis will be made
+            the Y_AXIS, the first level axis will be made the Z_AXIS, the first time axis
+            will be made the T_AXIS, the second time axis will be made the F_AXIS, and any
+            remaining axes are then filled into the remaining unassigned positions.
+
+    Returns:
+        None
+
+    Raises:
+        KeyError: if datavar_dict is missing a required key
+        MemoryError: if Ferret has not been started or has been stopped
+        ValueError:  if there is a problem with the value of a key
+
+    See also:
+        put
+    """
+    #
+    # code name for the variable
+    codename = datavar_dict.get('name', '')
+    if codename != None:
+        codename = str(codename).strip()
+    if not codename:
+        raise ValueError("The value of 'name' must be a non-blank string")
+    #
+    # title for the variable
+    titlename = str(datavar_dict.get('title', codename)).strip()
+    #
+    # Ferret dataset for the variable; None gets turned into the string 'None'
+    dset_str = str(datavar_dict.get('dset', '')).strip()
+    #
+    # value for missing data
+    missingval = float(datavar_dict.get('missing_value', -1.0E34))
+    #
+    # data units
+    data_unit = str(datavar_dict.get('data_unit', '')).strip()
+    #
+    # axis types
+    axis_types = [ libpyferret.AXISTYPE_NORMAL ] * libpyferret.MAX_FERRET_NDIM
+    given_axis_types = datavar_dict.get('axis_types', None)
+    if given_axis_types:
+        if len(given_axis_types) > libpyferret.MAX_FERRET_NDIM:
+            raise ValueError("More than %d axes (in the types) is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+        for k in xrange(len(given_axis_types)):
+            axis_types[k] = given_axis_types[k]
+    #
+    # axis names
+    axis_names = [ "" ] * libpyferret.MAX_FERRET_NDIM
+    given_axis_names = datavar_dict.get('axis_names', None)
+    if given_axis_names:
+        if len(given_axis_names) > libpyferret.MAX_FERRET_NDIM:
+            raise ValueError("More than %d axes (in the names) is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+        for k in xrange(len(given_axis_names)):
+            axis_names[k] = given_axis_names[k]
+    #
+    # axis units
+    axis_units = [ "" ] * libpyferret.MAX_FERRET_NDIM
+    given_axis_units = datavar_dict.get('axis_units', None)
+    if given_axis_units:
+        if len(given_axis_units) > libpyferret.MAX_FERRET_NDIM:
+            raise ValueError("More than %d axes (in the units) is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+        for k in xrange(len(given_axis_units)):
+            axis_units[k] = given_axis_units[k]
+    # axis coordinates
+    axis_coords = [ None ] * libpyferret.MAX_FERRET_NDIM
+    given_axis_coords = datavar_dict.get('axis_coords', None)
+    if given_axis_coords:
+        if len(given_axis_coords) > libpyferret.MAX_FERRET_NDIM:
+            raise ValueError("More than %d axes (in the coordinates) is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+        for k in xrange(len(given_axis_coords)):
+            axis_coords[k] = given_axis_coords[k]
+    #
+    # data array
+    datavar = datavar_dict['data']
+    #
+    # For any axis with data (shape > 1), if AXISTYPE_NORMAL (presumably from not being specified),
+    # change to AXISTYPE_ABSTRACT.  Note that a shape == 1 could either be normal or a singleton axis.
+    try:
+        shape = datavar.shape
+        if len(shape) > libpyferret.MAX_FERRET_NDIM:
+            raise ValueError("More than %d axes (in the data) is not supported in Ferret at this time" % libpyferret.MAX_FERRET_NDIM)
+        for k in xrange(len(shape)):
+            if (shape[k] > 1) and (axis_types[k] == libpyferret.AXISTYPE_NORMAL):
+                axis_types[k] = libpyferret.AXISTYPE_ABSTRACT
+    except AttributeError:
+        raise ValueError("The value of 'data' must be a NumPy ndarray (or derived from an ndarray)")
+    #
+    # assign any defaults on the axis information not given,
+    # and make a copy of the axis coordinates (to ensure they are well-behaved)
+    for k in xrange(libpyferret.MAX_FERRET_NDIM):
+        if axis_types[k] == libpyferret.AXISTYPE_LONGITUDE:
+            if not axis_units[k]:
+                axis_units[k] = "DEGREES_E"
+            axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.float64, copy=1)
+            if axis_coords[k].shape[0] != shape[k]:
+                raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+        elif axis_types[k] == libpyferret.AXISTYPE_LATITUDE:
+            if not axis_units[k]:
+                axis_units[k] = "DEGREES_N"
+            axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.float64, copy=1)
+            if axis_coords[k].shape[0] != shape[k]:
+                raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+        elif axis_types[k] == libpyferret.AXISTYPE_LEVEL:
+            axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.float64, copy=1)
+            if axis_coords[k].shape[0] != shape[k]:
+                raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+        elif axis_types[k] == libpyferret.AXISTYPE_TIME:
+            if not axis_units[k]:
+                axis_units[k] = CALTYPE_GREGORIAN
+            axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.int32, order='C', copy=1)
+            if axis_coords[k].shape[0] != shape[k]:
+                raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+            if axis_coords[k].shape[1] != 6:
+                raise ValueError("number of components (second index) for time axis %d is not 6" % (k+1))
+        elif axis_types[k] == libpyferret.AXISTYPE_CUSTOM:
+            axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.float64, copy=1)
+            if axis_coords[k].shape[0] != shape[k]:
+                raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+        elif axis_types[k] == libpyferret.AXISTYPE_ABSTRACT:
+            if axis_coords[k] != None:
+                axis_coords[k] = numpy.array(axis_coords[k], dtype=numpy.float64, copy=1)
+                if axis_coords[k].shape[0] != shape[k]:
+                    raise ValueError("number of coordinates for axis %d does not match the number of data points" % (k+1))
+            else:
+                # axis needed but not specified
+                axis_coords[k] = numpy.arange(1.0, float(shape[k]) + 0.5, 1.0, dtype=numpy.float64)
+        elif axis_types[k] == libpyferret.AXISTYPE_NORMAL:
+            axis_coords[k] = None
+        else:
+            raise RuntimeError("Unexpected axis_type of %d" % axis_types[k])
+    #
+    # figure out the desired axis order
+    if axis_pos != None:
+        # start with the positions provided by the user
+        ferr_axis = list(axis_pos)
+        if len(ferr_axis) < len(shape):
+            raise ValueError("axis_pos, if given, must provide a position for each axis in the data")
+        # append undefined axes positions, which were initialized to AXISTYPE_NORMAL
+        if not libpyferret.X_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.X_AXIS)
+        if not libpyferret.Y_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.Y_AXIS)
+        if not libpyferret.Z_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.Z_AXIS)
+        if not libpyferret.T_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.T_AXIS)
+        if not libpyferret.E_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.E_AXIS)
+        if not libpyferret.F_AXIS in ferr_axis:
+            ferr_axis.append(libpyferret.F_AXIS)
+        # intentionally left as 6 (instead of MAX_FERRET_NDIM) since new axes will need to be appended
+        if len(ferr_axis) != 6:
+            raise ValueError("axis_pos can contain at most one of each of the pyferret integer values X_AXIS, Y_AXIS, Z_AXIS, or T_AXIS")
+    else:
+        ferr_axis = [ -1 ] * libpyferret.MAX_FERRET_NDIM
+        # assign positions of longitude/latitude/level/time
+        for k in xrange(len(axis_types)):
+            if axis_types[k] == libpyferret.AXISTYPE_LONGITUDE:
+                if not libpyferret.X_AXIS in ferr_axis:
+                    ferr_axis[k] = libpyferret.X_AXIS
+            elif axis_types[k] == libpyferret.AXISTYPE_LATITUDE:
+                if not libpyferret.Y_AXIS in ferr_axis:
+                    ferr_axis[k] = libpyferret.Y_AXIS
+            elif axis_types[k] == libpyferret.AXISTYPE_LEVEL:
+                if not libpyferret.Z_AXIS in ferr_axis:
+                    ferr_axis[k] = libpyferret.Z_AXIS
+            elif axis_types[k] == libpyferret.AXISTYPE_TIME:
+                if not libpyferret.T_AXIS in ferr_axis:
+                    ferr_axis[k] = libpyferret.T_AXIS
+                elif not libpyferret.F_AXIS in ferr_axis:
+                    ferr_axis[k] = libpyferret.F_AXIS
+        # fill in other axes types in unused positions
+        if not libpyferret.X_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.X_AXIS
+        if not libpyferret.Y_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.Y_AXIS
+        if not libpyferret.Z_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.Z_AXIS
+        if not libpyferret.T_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.T_AXIS
+        if not libpyferret.E_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.E_AXIS
+        if not libpyferret.F_AXIS in ferr_axis:
+            ferr_axis[ferr_axis.index(-1)] = libpyferret.F_AXIS
+        try:
+            ferr_axis.index(-1)
+            raise RuntimeError("Unexpected undefined axis position (MAX_FERRET_NDIM increased?) in ferr_axis " + str(ferr_axis))
+        except ValueError:
+            # expected result
+            pass
+    #
+    # get the missing data value as a 64-bit float
+    bdfval = numpy.array(missingval, dtype=numpy.float64)
+    #
+    # if a masked array, make sure the masked values are set
+    # to the missing value, and get the ndarray underneath
+    try:
+        if numpy.any(datavar.mask):
+            datavar.data[datavar.mask] = bdfval
+        data = datavar.data
+    except AttributeError:
+        data = datavar
+    #
+    # get the data as an ndarray of MAX_FERRET_NDIM dimensions
+    # adding new axes still reference the original data array - just creates new shape and stride objects
+    for k in xrange(len(shape), libpyferret.MAX_FERRET_NDIM):
+        data = data[..., numpy.newaxis]
+    #
+    # swap data axes and axis information to give (X_AXIS, Y_AXIS, Z_AXIS, T_AXIS, E_AXIS, F_AXIS) axes
+    # swapping axes still reference the original data array - just creates new shape and stride objects
+    k = ferr_axis.index(libpyferret.X_AXIS)
+    if k != 0:
+        data = data.swapaxes(0, k)
+        ferr_axis[0], ferr_axis[k] = ferr_axis[k], ferr_axis[0]
+        axis_types[0], axis_types[k] = axis_types[k], axis_types[0]
+        axis_names[0], axis_names[k] = axis_names[k], axis_names[0]
+        axis_units[0], axis_units[k] = axis_units[k], axis_units[0]
+        axis_coords[0], axis_coords[k] = axis_coords[k], axis_coords[0]
+    k = ferr_axis.index(libpyferret.Y_AXIS)
+    if k != 1:
+        data = data.swapaxes(1, k)
+        ferr_axis[1], ferr_axis[k] = ferr_axis[k], ferr_axis[1]
+        axis_types[1], axis_types[k] = axis_types[k], axis_types[1]
+        axis_names[1], axis_names[k] = axis_names[k], axis_names[1]
+        axis_units[1], axis_units[k] = axis_units[k], axis_units[1]
+        axis_coords[1], axis_coords[k] = axis_coords[k], axis_coords[1]
+    k = ferr_axis.index(libpyferret.Z_AXIS)
+    if k != 2:
+        data = data.swapaxes(2, k)
+        ferr_axis[2], ferr_axis[k] = ferr_axis[k], ferr_axis[2]
+        axis_types[2], axis_types[k] = axis_types[k], axis_types[2]
+        axis_names[2], axis_names[k] = axis_names[k], axis_names[2]
+        axis_units[2], axis_units[k] = axis_units[k], axis_units[2]
+        axis_coords[2], axis_coords[k] = axis_coords[k], axis_coords[2]
+    k = ferr_axis.index(libpyferret.T_AXIS)
+    if k != 3:
+        data = data.swapaxes(3, k)
+        ferr_axis[3], ferr_axis[k] = ferr_axis[k], ferr_axis[3]
+        axis_types[3], axis_types[k] = axis_types[k], axis_types[3]
+        axis_names[3], axis_names[k] = axis_names[k], axis_names[3]
+        axis_units[3], axis_units[k] = axis_units[k], axis_units[3]
+        axis_coords[3], axis_coords[k] = axis_coords[k], axis_coords[3]
+    k = ferr_axis.index(libpyferret.E_AXIS)
+    if k != 4:
+        data = data.swapaxes(4, k)
+        ferr_axis[4], ferr_axis[k] = ferr_axis[k], ferr_axis[4]
+        axis_types[4], axis_types[k] = axis_types[k], axis_types[4]
+        axis_names[4], axis_names[k] = axis_names[k], axis_names[4]
+        axis_units[4], axis_units[k] = axis_units[k], axis_units[4]
+        axis_coords[4], axis_coords[k] = axis_coords[k], axis_coords[4]
+    # F_AXIS must now be ferr_axis[5]
+    # assumes MAX_FERRET_NDIM == 6; extend the logic if axes are added
+    # would rather not assume X_AXIS == 0, Y_AXIS == 1, Z_AXIS == 2,
+    #                         T_AXIS == 3, E_AXIS == 4, F_AXIS == 5
+    #
+    # now make a copy of the data as (contiguous) 64-bit floats in Fortran order
+    fdata = numpy.array(data, dtype=numpy.float64, order='F', copy=1)
+    #
+    # libpyferret._put will throw an Exception if there is a problem
+    libpyferret._put(codename, titlename, fdata, bdfval, data_unit, dset_str,
+                  axis_types, axis_names, axis_units, axis_coords)
+    return None
+
+
+def stop():
+    """
+    Runs a series of Ferret commands to return Ferret to
+    its default state, then shuts down and releases all
+    memory used by Ferret.  After calling this function do
+    not call any Ferret functions except start, which will
+    restart Ferret and re-enable the other functions.
+
+    Returns:
+        False if Ferret has not been started or has already been stopped
+        True otherwise
+    """
+    # If it had been started, shut down ESMP and delete the log file
+    try:
+        regrid.ESMPControl().stopESMP(True)
+    except ImportError:
+        pass
+    # Continue with Ferret shutdown
+    return libpyferret._stop()
+
+
+def _readline(myprompt):
+    """
+    Prompts the user for input and returns the line read.
+
+    Used for reading commands in the Ferret command loop.
+    Just uses the built-in function raw_input.  Since the
+    readline module was imported, readline features are
+    provided.
+
+    Arguments:
+        myprompt - prompt string to use
+    Returns:
+        the string read in, or None if EOFError occurs
+    """
+    try:
+        if myprompt:
+            myline = raw_input(myprompt)
+        else:
+            myline = raw_input()
+    except EOFError:
+        myline = None
+
+    return myline
+
+
+def ferret_pyfunc():
+    """
+    A dummy function (which just returns this help message) used to document the
+    requirements of python modules used as Ferret external functions (using the
+    Ferret command: DEFINE PYFUNC [/NAME=<alias>] <module.name>).  Two methods,
+    ferret_init and ferret_compute, must be provided by such a module:
+
+
+    ferret_init(efid)
+        Arguments:
+            efid - Ferret's integer ID of this external function
+
+        Returns a dictionary defining the following keys:
+            "numargs":      number of input arguments [1 - 9; required]
+            "descript":     string description of the function [required]
+            "restype":      one of FLOAT_ARRAY or STRING_ARRAY, indicating whether
+                            the result is an array of floating-point values or strings
+                            [optional, default FLOAT_ARRAY]
+            "resstrlen":    if the result type is an array of strings, this specifies
+                            the (maximum) length of the strings in the array
+                            [optional, default: 128]
+            "axes":         6-tuple (X,Y,Z,T,E,F) of result grid axis defining values,
+                            which are:
+                                    AXIS_ABSTRACT:        indexed, ferret_result_limits
+                                                          called to define the axis,
+                                    AXIS_CUSTOM:          ferret_custom_axes called to
+                                                          define the axis,
+                                    AXIS_DOES_NOT_EXIST:  does not exist in (normal to)
+                                                          the results grid,
+                                    AXIS_IMPLIED_BY_ARGS: same as the corresponding axis
+                                                          in one or more arguments,
+                                    AXIS_REDUCED:         reduced to a single point
+                            [optional; default: AXIS_IMPLIED_BY_ARGS for each axis]
+            "piecemeal":    6-tuple (X,Y,Z,T,E,F) of True or False indicating if it is
+                            acceptable to break up the calculation, if needed, along the
+                            corresponding axis [optional; default: False for each axis]
+            "argnames":     N-tuple of names for the input arguments
+                            [optional; default: (A, B, ...)]
+            "argdescripts": N-tuple of descriptions for the input arguments
+                            [optional; default: no descriptions]
+            "argtypes":     N-tuple of FLOAT_ARRAY, FLOAT_ONEVAL, STRING_ARRAY, or
+                            STRING_ONEVAL, indicating whether the input argument is
+                            an array of floating-point values, a single floating point
+                            value, an array of strings, or a single string value.
+                            [optional; default: FLOAT_ARRAY for every argument]
+            "influences":   N-tuple of 6-tuples of booleans indicating whether the
+                            corresponding input argument's (X,Y,Z,T,E,F) axis influences
+                            the result grid's (X,Y,Z,T,E,F) axis.  [optional; default,
+                            and when None is given for a 6-tuple: True for every axis]
+                      NOTE: If the "influences" value for an axis is True (which is the
+                            default), the "axes" value for this axis must be either
+                            AXIS_IMPLIED_BY_ARGS (the default) or AXIS_REDUCED.
+            "extends":      N-tuple of 6-tuples of pairs of integers.  The n-th tuple,
+                            if not None, gives the (X,Y,Z,T,E,F) extension pairs for the
+                            n-th argument.  An extension pair, if not None, is the
+                            number of points extended in the (low,high) indices for
+                            that axis of that argument beyond the implied axis of the
+                            result grid.  Thus,
+                                    (None, (None, None, None, (-1,1)), None, None, None)
+                            means the T axis of the second argument is extended by two
+                            points (low dimension lowered by 1, high dimension raised
+                            by 1) beyond the implied axis of the result.
+                            [optional; default: no extensions assigned]
+                      NOTE: If an "extends" pair is given for an axis, the "axes"
+                            value for this axis must be AXIS_IMPLIED_BY_ARGS
+                            (the default).  The "extends" pair more precisely means
+                            the axis in the argument, exactly as provided in the
+                            Ferret command, is larger by the indicated amount from
+                            the implied result grid axis.
+
+        If an exception is raised, Ferret is notified that an error occurred using
+        the message of the exception.
+
+
+    ferret_compute(efid, result_array, result_bdf, input_arrays, input_bdfs)
+        Arguments:
+            efid         - Ferret's integer ID of this external function
+            result_array - a writeable NumPy float64 ndarray of six dimensions (X,Y,Z,T,E,F)
+                           to contain the results of this computation.  The shape and
+                           strides of this array has been configured so that only (and
+                           all) the data points that should be assigned are accessible.
+            result_bdf   - a NumPy ndarray of one dimension containing the bad-data-flag
+                           value for the result array.
+            input_arrays - tuple of read-only NumPy float64 ndarrays of six dimensions
+                           (X,Y,Z,T,E,F) containing the given input data.  The shape and
+                           strides of these array have been configured so that only (and
+                           all) the data points that should be accessible are accessible.
+            input_bdfs   - a NumPy ndarray of one dimension containing
+                           the bad-data-flag values for each of the input arrays.
+
+        Any return value is ignored.
+
+        If an exception is raised, Ferret is notified that an error occurred using
+        the message of the exception.
+
+
+    If the dictionary returned from ferret_init assigned a result axis as AXIS_ABSTRACT,
+    then the ferret_result_limits method must also be defined:
+
+
+    ferret_result_limits(efid)
+        Arguments:
+            efid - Ferret's integer ID of this external function
+
+        Returns a (X,Y,Z,T,E,F) 6-tuple of either None or (low, high) pairs of integers.
+        If an axis was not designated as AXIS_ABSTRACT, None should be given for that axis.
+        If an axis was designated as AXIS_ABSTRACT, a (low, high) pair of integers should
+        be given, and are used as the low and high Ferret indices for that axis.
+        [The indices of the NumPy ndarray to be assigned will be from 0 until (high-low)].
+
+        If an exception is raised, Ferret is notified that an error occurred using
+        the message of the exception.
+
+
+    If the dictionary returned from ferret_init assigned a result axis as AXIS_CUSTOM,
+    then the ferret_custom_axes method must also be defined:
+
+
+    ferret_custom_axes(efid)
+        Arguments:
+            efid - Ferret's integer ID of this external function
+
+        Returns a (X,Y,Z,T,E,F) 6-tuple of either None or a (low, high, delta, unit_name,
+        is_modulo) tuple.  If an axis was not designated as AXIS_CUSTOM, None should be
+        given for that axis.  If an axis was designated as AXIS_CUSTOM, a (low, high,
+        delta, unit_name, is_modulo) tuple should be given where low and high are the
+        "world" coordinates (floating point) limits for the axis, delta is the step
+        increments in "world" coordinates, unit_name is a string used in describing the
+        "world" coordinates, and is_modulo is either True or False, indicating if this
+        is a modulo ("periodic" or "wrapping") coordinate system.
+
+        If an exception is raised, Ferret is notified that an error occurred using
+        the message of the exception.
+
+    """
+    return ferret_pyfunc.__doc__
+
+
+def get_axis_coordinates(efid, arg, axis):
+    """
+    Returns the "world" coordinates for an axis of an argument to an external function
+
+    Arguments:
+        efid: the Ferret id of the external function
+        arg: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9)
+        axis: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS,
+                                                          T_AXIS, E_AXIS, F_AXIS)
+    Returns:
+        a NumPy float64 ndarray containing the "world" coordinates,
+        or None if the values cannot be determined at the time this was called
+    Raises:
+        ValueError if efid, arg, or axis is invalid
+    """
+    # check the efid
+    try:
+        int_id = int(efid)
+        if int_id < 0:
+            raise ValueError
+    except:
+        raise ValueError("efid must be a positive integer value")
+    # check the arg index
+    try:
+        int_arg = int(arg)
+        if (int_arg < libpyferret.ARG1) or (int_arg > libpyferret.ARG9):
+            raise ValueError
+    except:
+        raise ValueError("arg must be an integer value in [%d,%d]" % (libpyferret.ARG1,libpyferret.ARG9))
+    # check the axis index
+    try:
+        int_axis = int(axis)
+        if (int_axis < libpyferret.X_AXIS) or (int_axis > libpyferret.F_AXIS):
+            raise ValueError
+    except:
+        raise ValueError("axis must be an integer value in [%d,%d]" % (libpyferret.X_AXIS,libpyferret.F_AXIS))
+    # make the actual call
+    return libpyferret._get_axis_coordinates(int_id, int_arg, int_axis)
+
+
+def get_axis_box_sizes(efid, arg, axis):
+    """
+    Returns the "box sizes", in "world" coordinate units,
+    for an axis of an argument to an external function
+
+    Arguments:
+        efid: the Ferret id of the external function
+        arg: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9)
+        axis: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS,
+                                                          T_AXIS, E_AXIS, F_AXIS)
+    Returns:
+        a NumPy float64 ndarray containing the "box sizes",
+        or None if the values cannot be determined at the time this was called
+    Raises:
+        ValueError if efid, arg, or axis is invalid
+    """
+    # check the efid
+    try:
+        int_id = int(efid)
+        if int_id < 0:
+            raise ValueError
+    except:
+        raise ValueError("efid must be a positive integer value")
+    # check the arg index
+    try:
+        int_arg = int(arg)
+        if (int_arg < libpyferret.ARG1) or (int_arg > libpyferret.ARG9):
+            raise ValueError
+    except:
+        raise ValueError("arg must be an integer value in [%d,%d]" % (libpyferret.ARG1,libpyferret.ARG9))
+    # check the axis index
+    try:
+        int_axis = int(axis)
+        if (int_axis < libpyferret.X_AXIS) or (int_axis > libpyferret.F_AXIS):
+            raise ValueError
+    except:
+        raise ValueError("axis must be an integer value in [%d,%d]" % (libpyferret.X_AXIS,libpyferret.F_AXIS))
+    # make the actual call
+    return libpyferret._get_axis_box_sizes(int_id, int_arg, int_axis)
+
+
+def get_axis_box_limits(efid, arg, axis):
+    """
+    Returns the "box limits", in "world" coordinate units,
+    for an axis of an argument to an external function
+
+    Arguments:
+        efid: the Ferret id of the external function
+        arg: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9)
+        axis: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS,
+                                                          T_AXIS, E_AXIS, F_AXIS)
+    Returns:
+        a tuple of two NumPy float64 ndarrays containing the low and high "box limits",
+        or None if the values cannot be determined at the time this was called
+    Raises:
+        ValueError if efid, arg, or axis is invalid
+    """
+    # check the efid
+    try:
+        int_id = int(efid)
+        if int_id < 0:
+            raise ValueError
+    except:
+        raise ValueError("efid must be a positive integer value")
+    # check the arg index
+    try:
+        int_arg = int(arg)
+        if (int_arg < libpyferret.ARG1) or (int_arg > libpyferret.ARG9):
+            raise ValueError
+    except:
+        raise ValueError("arg must be an integer value in [%d,%d]" % (libpyferret.ARG1,libpyferret.ARG9))
+    # check the axis index
+    try:
+        int_axis = int(axis)
+        if (int_axis < libpyferret.X_AXIS) or (int_axis > libpyferret.F_AXIS):
+            raise ValueError
+    except:
+        raise ValueError("axis must be an integer value in [%d,%d]" % (libpyferret.X_AXIS,libpyferret.F_AXIS))
+    # make the actual call
+    return libpyferret._get_axis_box_limits(int_id, int_arg, int_axis)
+
+
+def get_axis_info(efid, arg, axis):
+    """
+    Returns information about the axis of an argument to an external function
+
+    Arguments:
+        efid: the Ferret id of the external function
+        arg: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9)
+        axis: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS,
+                                                          T_AXIS, E_AXIS, F_AXIS)
+    Returns:
+        a dictionary defining the following keys:
+            "name": name string for the axis coordinate
+            "unit": name string for the axis unit
+            "backwards": boolean - reversed axis?
+            "modulo": float - modulo length of axis, or 0.0 if not modulo
+            "regular": boolean - evenly spaced axis?
+            "size": number of coordinates on this axis, or -1 if the value
+                    cannot be determined at the time this was called
+    Raises:
+        ValueError if efid, arg, or axis is invalid
+    """
+    # check the efid
+    try:
+        int_id = int(efid)
+        if int_id < 0:
+            raise ValueError
+    except:
+        raise ValueError("efid must be a positive integer value")
+    # check the arg index
+    try:
+        int_arg = int(arg)
+        if (int_arg < libpyferret.ARG1) or (int_arg > libpyferret.ARG9):
+            raise ValueError
+    except:
+        raise ValueError("arg must be an integer value in [%d,%d]" % (libpyferret.ARG1,libpyferret.ARG9))
+    # check the axis index
+    try:
+        int_axis = int(axis)
+        if (int_axis < libpyferret.X_AXIS) or (int_axis > libpyferret.F_AXIS):
+            raise ValueError
+    except:
+        raise ValueError("axis must be an integer value in [%d,%d]" % (libpyferret.X_AXIS,libpyferret.F_AXIS))
+    # make the actual call
+    return libpyferret._get_axis_info(int_id, int_arg, int_axis)
+
+
+def get_arg_one_val(efid, arg):
+    """
+    Returns the value of the indicated FLOAT_ONEVAL or STRING_ONEVAL argument.
+    Can be called from the ferret_result_limits or ferret_custom_axes method
+    of an external function.
+
+    Arguments:
+        efid: the Ferret id of the external function
+        arg: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9)
+    Returns:
+        the value of the argument, either as a float (if a FLOAT_ONEVAL)
+        or a string (if STRING_ONEVAL)
+    Raises:
+        ValueError if efid or arg is invalid, or if the argument type is not
+        FLOAT_ONEVAL or STRING_ONEVAL
+    """
+    # check the efid
+    try:
+        int_id = int(efid)
+        if int_id < 0:
+            raise ValueError
+    except:
+        raise ValueError("efid must be a positive integer value")
+    # check the arg index
+    try:
+        int_arg = int(arg)
+        if (int_arg < libpyferret.ARG1) or (int_arg > libpyferret.ARG9):
+            raise ValueError
+    except:
+        raise ValueError("arg must be an integer value in [%d,%d]" % (libpyferret.ARG1,libpyferret.ARG9))
+    # make the actual call
+    return libpyferret._get_arg_one_val(int_id, int_arg)
+
diff --git a/pyfermod/copy_pystat_data.c b/pyfermod/copy_pystat_data.c
new file mode 100644
index 0000000..40b0fca
--- /dev/null
+++ b/pyfermod/copy_pystat_data.c
@@ -0,0 +1,73 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+#include "pyferret.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * This function copies the data from the ndarray given by data_ndarray_ptr 
+ * to the array of doubles given by dest.  The argument data_ndarray_ptr 
+ * is a pointer to a PyObject pointer that is a float64 ndarray containing
+ * the array of data for this static variable.
+ */
+void copy_pystat_data_(double dest[], void *data_ndarray_ptr)
+{
+    PyObject *data_ndarray;
+    double *data;
+    npy_intp num_items;
+
+    data_ndarray = *( (PyObject **) data_ndarray_ptr);
+
+    /* Sanity check:
+     *    PyArray_Size returns 0 if the object is not an appropriate type
+     *    ISFARRAY_RO checks if it is F-contiguous, aligned, and in machine byte-order 
+     */
+    num_items = PyArray_Size(data_ndarray);
+    if ( (num_items < 1) || (PyArray_TYPE(data_ndarray) != NPY_DOUBLE) ||
+         (! PyArray_ISFARRAY_RO(data_ndarray)) || (! PyArray_CHKFLAGS(data_ndarray, NPY_OWNDATA)) ) {
+        fflush(stdout);
+        fputs("Unexpected data_ndarray pointer passed to copy_pystat_data_\n", stderr);
+        fflush(stderr);
+        abort();
+    }
+    data = (double *)PyArray_DATA(data_ndarray);
+    memcpy(dest, data, (size_t)num_items * sizeof(double));
+}
+
diff --git a/pyfermod/decref_pyobj.c b/pyfermod/decref_pyobj.c
new file mode 100644
index 0000000..02f2194
--- /dev/null
+++ b/pyfermod/decref_pyobj.c
@@ -0,0 +1,44 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#include "pyferret.h"
+
+void decref_pyobj_(void *pyobj_ptr_ptr)
+{
+   PyObject *pyobj;
+
+   pyobj = *( (PyObject **) pyobj_ptr_ptr);
+   Py_DECREF(pyobj);
+}
diff --git a/pyfermod/eofanal/.project b/pyfermod/eofanal/.project
new file mode 100644
index 0000000..07a91d1
--- /dev/null
+++ b/pyfermod/eofanal/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>eofanal</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>
diff --git a/pyfermod/eofanal/.pydevproject b/pyfermod/eofanal/.pydevproject
new file mode 100644
index 0000000..d5f5006
--- /dev/null
+++ b/pyfermod/eofanal/.pydevproject
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?><pydev_project>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/eofanal</path>
+</pydev_pathproperty>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+
+</pydev_project>
diff --git a/pyfermod/eofanal/__init__.py b/pyfermod/eofanal/__init__.py
new file mode 100644
index 0000000..ad92205
--- /dev/null
+++ b/pyfermod/eofanal/__init__.py
@@ -0,0 +1,10 @@
+'''
+Empirical-orthogonal-function analysis functions designed for use in PyFerret, 
+especially for Python external functions for PyFerret.
+
+ at author: Karl Smith
+'''
+
+# Import classes given in modules in this package so they are all seen here.
+from eofanalysis import InvalidStateError, EOFAnalysis
+
diff --git a/pyfermod/eofanal/eofanalysis.py b/pyfermod/eofanal/eofanalysis.py
new file mode 100644
index 0000000..ae2a7ba
--- /dev/null
+++ b/pyfermod/eofanal/eofanalysis.py
@@ -0,0 +1,623 @@
+#! python
+#
+
+'''
+Module defining the EOFAnalysis class for performing an 
+empirical orthogonal function analysis of space-time data.  
+Also defines the InvalidStateError exception that is 
+raised by some methods in the EOFAnalysis class.
+
+ at author: Karl M. Smith
+'''
+
+import math
+import numpy
+import numpy.linalg
+
+
+
+class InvalidStateError(Exception):
+    '''
+    Exception raised by methods of the EOFAnalysis class when
+    an instance is not in a proper state for that function call.
+    For example, results-reporting methods raise this error if
+    called prior to calling the analyze method.
+    '''
+    pass
+
+
+
+class EOFAnalysis(object):
+    '''
+    Class for performing an Empirical Orthogonal Function (EOF) analysis 
+    of space-time data.  Create an instance of this class with the desired 
+    space-time data array.  Call the analyze method of this instance to 
+    perform the analysis.  Result-reporting methods can then be called to 
+    obtain the results the of analysis.  The separate initialization, 
+    analysis, and result-reporting methods allow for the creation of 
+    methods to modify the input data prior to analysis, and methods to 
+    modify the results prior to reporting.
+    '''
+
+
+    def __init__(self, spacetimedata):
+        '''
+        Initializes an EOFAnalysis instance using the given space-time data.
+
+        Arguments:
+            spacetimedata - matrix-like object of data where each column 
+                    is a time series at a given location.  Thus the shape 
+                    of the (row-major) data array should be (NT, NL) where 
+                    where NT is the number of time values at each location 
+                    and NL is the number of locations.
+
+        Returns:
+            an EOFAnalysis instance using the given space-time data.
+
+        Raises:
+            TypeError of ValueError - if spacetimedata cannot be made into
+                    a (2D) numpy.matrix of numeric values.  See: numpy.matrix
+            UserWarning - if there is one one time value in each time 
+                    series.
+        '''
+        # matrix of averages of each time series
+        self.__tavg = None
+        # F matrix in EOF analysis = (origvals - tavg)
+        self.__fmat = None
+        # R matrix = F.T * F / NT (matrix multiplication)
+        # (matrix of covariance means) - not saved
+        # eigenvalues of R ordered from smallest to largest
+        self.__eigvals = None
+        # eigenvectors in columns of R corresponding to the eigenvalues
+        self.__eigvecs = None
+        # fraction significance of the corresponding EOFs
+        self.__fracsignifs = None
+        # minimum fraction ever considered significant; 0.01 == 1%
+        self.__minsignif = 0.01
+        # copy of the original space-time values as an matrix
+        self.__origvals = numpy.matrix(spacetimedata, dtype=numpy.float64);
+        if self.__origvals.shape[0] == 1:
+            raise UserWarning('Only one time value in each time series')
+
+
+    def analyze(self):
+        '''
+        Perform the empirical orthogonal function analysis of the
+        space-time data contained in this EOFAnalysis instance.
+
+        Arguments:
+            None
+
+        Returns:
+            None
+
+        Raises:
+            eofanlysis.InvalidStateError - if the instance has not been 
+                    properly initialized with space-time data.
+            numpy.linlag.LinAlgError - if there is a problem with the 
+                    analysis (diagonalizing the matrix of covariance means).
+            UserWarning - if there is no variation found in the time series
+     		    (no significant eigenvalues)
+        '''
+        if self.__origvals == None:
+            raise InvalidStateError(
+                    'instance data has not been properly initialized')
+        # Create a matrix with each row containing the mean value
+        # of each time-series in the original data.
+        self.__tavg = numpy.average(self.__origvals, axis=0)
+        # F is the data adjusted so each time series has a zero mean value.
+        # self.__tavg is automatically repeated in the following 
+        self.__fmat = self.__origvals - self.__tavg
+        # R is the matrix of mean covariances over time = F.T * F / NT
+        # R has shape (NP, NP)
+        # Since fmat is a matrix, this is performing matrix multiplication.
+        rmat = self.__fmat.T * self.__fmat / float(self.__fmat.shape[0])
+        # Compute the eigenvalues and eigenvactors of the R matrix.
+        # The numpy.linalg.eigh function returns eigenvalues from smallest 
+        # to largest, so the significant EOFs are the last eigenvectors.
+        # The eigenvectors are in the columns of the eigvectors matrix.
+        (eigvals, eigvecs) = numpy.linalg.eigh(rmat)
+        # Just making sure eigvals is an array and eigvecs is a matrix.
+        self.__eigvals = numpy.array(eigvals, copy=False)
+        self.__eigvecs = numpy.matrix(eigvecs, copy=False)
+        # Compute the fraction significance of each EOF, which is the 
+        # fraction each eigenvalue adds to the sum of all the eigenvalues.
+        # Because R = R.T, all eigenvalues are non-negative or negligible
+        # real values.
+        eigvalsum = numpy.sum(self.__eigvals)
+        if eigvalsum >= 1.0E-10:
+            self.__fracsignifs = self.__eigvals / numpy.sum(self.__eigvals)
+        else:
+            # No significant eigenvalues == no significant EOFs
+            self.__fracsignifs = numpy.zeros(self.__eigvals.shape)
+            raise UserWarning(
+     		'No variation in time series (no significant eigenvalues)')
+
+
+    def signiffracs(self):
+        '''
+        Returns the significances of each of the empirical orthogonal
+        functions (EOFs).  These values are the fraction of the total
+        variability explained by each of the EOFs.
+
+        Arguments:
+            None
+
+        Returns:
+            an array of length NL, the number of locations (and thus,
+            the maximum number of EOFs possible), giving the significance
+            of the corresponding EOF.  Ordered from most significant to
+            least significant.
+
+        Raises:
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__fracsignifs == None:
+            raise InvalidStateError('analyze method has not been called')
+        # Return a copy of the computed significance of each EOF
+        # ordered from largest to smallest (reversed).
+        return numpy.array(self.__fracsignifs[::-1])
+
+
+    def minsignif(self):
+        '''
+        Returns the current minimum fractional significance value used for
+        determining which empirical orthogonal functions are significant.
+
+        Arguments:
+            None
+
+        Returns:
+            the current minimum fractions significance value
+        '''
+        return self.__minsignif
+
+
+    def setminsignif(self, minsignif):
+        '''
+        Resets the minimum fractional significance value used for
+        determining which empirical orthogonal functions are significant.
+
+        Arguments:
+            minsignif - value in the range [1.0E-6, 1.0 - 1.0E-6].
+                    The 1.0E-6 (0.0001%) restriction is to circumvent
+                    issues with numerical accuracy in the calculating
+                    eigenvalues.
+
+        Returns:
+            None
+
+        Raises:
+            ValueError - if the value cannot be interpreted as a
+                    numerical value, if the value is less than 1.0E-6,
+                    or if the value is greater than (1.0 - 1.0E-6).
+        '''
+        newsignif = float(minsignif)
+        if newsignif < 1.0E-6:
+            raise ValueError('minsignif is less than 1.0E-6')
+        if newsignif > 1.0 - 1.0E-6:
+            raise ValueError('minsignif is greater than (1.0 - 1.0E-6)')
+        self.__minsignif = newsignif
+
+
+    def numeofs(self):
+        '''
+        Returns the number of significant empirical orthogonal functions
+        (EOFs).  These are EOFs with a fraction significance not less
+        than the current minimum significance value, which by default is
+        0.01 (1%).  See: EOFAnalysis.minsignif and EOFAnalysis.setminsignif
+
+        Arguments:
+            None
+
+        Returns:
+            the number of significant EOFs.
+
+        Raises:
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__fracsignifs == None:
+            raise InvalidStateError('analyze method has not been called')
+        # The fracsignifs are ordered from smallest to largest.
+        # Optimized for the usual case where most EOFs are insignificant.
+        for k in xrange(len(self.__fracsignifs)):
+            if self.__fracsignifs[-(k+1)] < self.__minsignif:
+                return k
+        return len(self.__fracsignifs)
+
+
+    def eofvec(self, num):
+        '''
+        Returns an empirical orthogonal function (EOF) as an array of
+        location values in units of the original data.  Different EOFs
+        are orthogonal to each other.  The square of the norm of an
+        EOF is the eigenvalue associated with that EOF.
+
+        Arguments:
+            num -   positive integer giving the number of the EOF to
+                    return.  A value of one gives the most influential
+                    EOF, two gives the second-most influential EOF, etc.
+
+        Returns:
+            the requested EOF as a 1-D array of location values
+            in units of the original data.
+
+        Raises:
+            ValueError - if num is not a positive integer or if num
+                    is larger than the number of significant EOFs.
+                    See: EOFAnalysis.numeofs
+            eofanalysis.InvalidStateError - if the analyze method has 
+                    not been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__eigvals == None:
+            raise InvalidStateError('analyze method has not been called')
+        eofnum = int(num)
+        if eofnum <= 0:
+            raise ValueError('num is not a positive integer')
+        if eofnum > len(self.__eigvals):
+            raise ValueError('num is larger than the number of EOFs')
+        # Eigenvalues are order from smallest to largest; thus, the
+        # most significant EOF is derived from the last eigenvector.
+        eofnum *= -1
+        if self.__fracsignifs[eofnum] < self.__minsignif:
+            raise ValueError(
+                    'num is larger than the number of significant EOFs')
+        # Eigenvectors are in the columns of the eigenvector matrix.
+        # Multiply by the square root of the eigenvector to convert 
+        # to units of the original data.
+        eofvector = numpy.array(self.__eigvecs[:,eofnum]).squeeze() \
+                    * math.sqrt(self.__eigvals[eofnum])
+        return eofvector
+
+
+    def tafvec(self, num):
+        '''
+        Returns the time-amplitude function (TAF) associated with an
+        empirical orthogonal function (EOF) as a unitless array.  TAFs
+        are orthogonal to each other.  The square of the norm of a TAF 
+        equals the number of time values in each time series.
+
+        Arguments:
+            num -   positive integer giving the number of the TAF to
+                    return.  A value of one gives the TAF associated
+                    with the most influential EOF, two gives the TAF
+                    associated with the second-most influential EOF, etc.
+
+        Returns:
+            the requested TAF as a 1-D array of unitless values.  The
+            length of the array is NT, the number of time values in each
+            time series.
+
+        Raises:
+            ValueError - if num is not a positive integer or is larger 
+                    than the number of significant EOFs.
+                    See: EOFAnalysis.numeofs
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__eigvals == None:
+            raise InvalidStateError('analyze method has not been called')
+        eofnum = int(num)
+        if eofnum <= 0:
+            raise ValueError('num is not a positive integer')
+        if eofnum > len(self.__eigvals):
+            raise ValueError('num is larger than the number of EOFs')
+        # Eigenvalues are order from smallest to largest; thus, the
+        # most significant EOF is derived from the last eigenvector.
+        eofnum *= -1
+        if self.__fracsignifs[eofnum] < self.__minsignif:
+            raise ValueError(
+                    'num is larger than the number of significant EOFs')
+        # Time series are in the columns of the F matrix and eigenvectors are
+        # in the columns of the eigenvector matrix.  Matrix multiplication
+        # is being performed, and then the product is turned into a 1-D array.
+        # Divide by the square root of the eigenvalue to  partially normalize
+        # the vector.
+        tafvector = numpy.array(self.__fmat * self.__eigvecs[:,eofnum]) \
+                         .squeeze() / math.sqrt(self.__eigvals[eofnum])
+        return tafvector
+
+
+    def nullvec(self, num):
+        '''
+        Returns a vector of the null-space in this empirical orthogonal 
+        function (EOF) analysis.  These are the eigenvectors corresponding 
+        to EOFs with negligible significance.  Null-space vectors have a 
+        norm of one and are orthogonal to each other.
+
+        Since null-space vectors are orthogonal to the data, there are no 
+        time amplitude functions (TAFs) associated with these vectors.
+        (Or, if you prefer, the TAF is an array of zeros.)
+
+        Arguments:
+            num -   positive integer giving the number of the null-space 
+                    vector to return.  There is no hierarchy for ordering 
+                    null-space vectors.  The number of null-space vectors 
+                    present is the number of locations less the number of
+                    significant EOFs.  See: EOFAnalysis.numeofs
+
+        Returns:
+            the requested null-space vector as a 1-D array of location values.
+
+        Raises:
+            ValueError - if num is not a positive integer or is larger
+                    than the number of null-space vectors.
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__eigvals == None:
+            raise InvalidStateError('analyze method has not been called')
+        nullnum = int(num)
+        if nullnum <= 0:
+            raise ValueError('num is not a positive integer')
+        if nullnum > len(self.__eigvals):
+            raise ValueError('num is larger than the number of locations')
+        nullnum -= 1
+        if self.__fracsignifs[nullnum] >= self.__minsignif:
+            raise ValueError(
+                    'num is larger than the number of null-space vectors')
+        nullvector = numpy.array(self.__eigvecs[:,nullnum]).squeeze()
+        return nullvector
+
+
+    def datapiece(self, num):
+        '''
+        Returns a space-time matrix of computed data that is the portion of
+        the original data explained by the indicated empirical orthogonal
+        function (EOF) and corresponding time-amplitude function (TAF).
+
+        When the argument is zero, a matrix of repeated time-series
+        averages is returned.
+
+        When the argument is positive, the value returned will be the 
+        same as TAFmat * EOFmat.T, where TAFmat is a column matrix of
+        the TAF values and EOFmat.T is a row matrix of the EOF values.
+        However, a simplified formula is actually used in this method.  
+
+        Summing the returned matrices for all significant EOFs will produce 
+        a space-time matrix with negligible difference from the original data.  
+        However, see EOFAnalysis.dataexplaned for a direct method for 
+        obtaining these sums.
+
+        Arguments:
+            num -   non-negative integer.  If zero, returns the matrix of
+                    repeated time-series averages; if positive, specifies
+                    the EOF and TAF to use for computing the contribution.
+                    A value of one computes the most significant contribution,
+                    two gives the second-most significant contribution, etc.
+
+        Returns:
+            the computed space-time data contribution as designated by
+            the argument.
+
+        Raises:
+            ValueError - if num is not a non-negative integer or is larger
+                    than the number of EOFs.  See: EOFAnalysis.numeofs
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__eigvals == None:
+            raise InvalidStateError('analyze method has not been called')
+        eofnum = int(num)
+        if eofnum == 0:
+            # return a copy of the matrix with repeated time-series averages
+            return self.__tavg.repeat(self.__origvals.shape[0], axis = 0)
+        if eofnum < 0:
+            raise ValueError('num is not a non-negative integer')
+        if eofnum > len(self.__eigvals):
+            raise ValueError('num is larger than the number of EOFs')
+        # Eigenvalues are order from smallest to largest; thus, the
+        # most significant EOF is derived from the last eigenvector.
+        eofnum *= -1
+        # Get the eofnum most significant eigenvectors as a matrix
+        # vect shape = (np, 1)
+        vect = self.__eigvecs[:,eofnum]
+        # Project fmat - shape (nt, np) - into the subspace defined by this
+        # eigenvector.  Using matrix multiplication; amat shape (nt, 1)
+        amat = self.__fmat * vect
+        # Bring this projection back into the complete space.
+        # Matrix multiplication; vect.T shape (1, np); datapart shape (nt, np)
+        datapart = amat * vect.T
+        return datapart
+
+
+    def dataexplained(self, num):
+        '''
+        Returns a space-time matrix of computed data that is the portion
+        of the original data explained by the indicated number of the
+        most-influential empirical orthogonal functions (EOFs) and their
+        corresponding time amplitude functions (TAFs).
+
+        This will be the same as the sum of the return values from
+        EOFAnalysis.datapiece called with arguments from zero to num.
+        However, a simplified formula is actually used in this method.  
+
+        Arguments:
+            num -   non-negative integer.  If zero, returns the matrix of
+                    repeated time-series averages; if positive, specifies
+                    the number of most-influential EOFs and TAFs to use in 
+                    creating the computed data.  A value of one uses only 
+                    the most influential EOF and TAF, two uses the two 
+                    most-influential EOFs and TAFs, etc.
+
+        Returns:
+            the computed space-time data that can be directly compared
+            to the original location-time data.
+
+        Raises:
+            ValueError - if num is not a non-negative integer or is larger 
+                    than the number of EOFs.  See: EOFAnalysis.numeofs
+            eofanalysis.InvalidStateError - if the analyze method has not 
+                    been called.  See: EOFAnalysis.analyze
+        '''
+        if self.__eigvals == None:
+            raise InvalidStateError('analyze method has not been called')
+        eofnum = int(num)
+        if eofnum == 0:
+            # return a copy of the matrix with repeated time-series averages
+            return self.__tavg.repeat(self.__origvals.shape[0], axis = 0)
+        if eofnum < 0:
+            raise ValueError('num is not a positive integer')
+        if eofnum > len(self.__eigvals):
+            raise ValueError('num is larger than the number of EOFs')
+        # Eigenvalues are order from smallest to largest; thus, the
+        # most significant EOF is derived from the last eigenvector.
+        eofnum *= -1
+        # Get the eofnum most significant eigenvectors as a matrix;
+        # shape = (np, num)
+        vecmat = self.__eigvecs[:,-1:eofnum-1:-1]
+        # Project fmat - shape (nt, np) - into the subspace defined by these
+        # eigenvectors.  Using matrix multiplication; amat shape = (nt, num)
+        amat = self.__fmat * vecmat
+        # Bring this projection back into the complete space and add the
+        # time averages to make the result comparable to the original data
+        # Matrix multiplication; vecmat.T shape (num, np) and expdata shape
+        # (nt, np)
+        expdata = (amat * vecmat.T) + self.__tavg
+        return expdata
+
+
+#
+# The following is just for test "by-hand" and to serve as some examples.
+# See test_eofanalysis.py for tests using the unittest module.
+#
+
+if __name__ == '__main__':
+    import pprint
+    formatter = pprint.PrettyPrinter()
+
+    # five years of quarter-monthly data
+    months = numpy.arange(0.0, 60.0, 0.25)
+
+    # create time series on an annual cycle
+    cosT = numpy.cos(months * numpy.pi / 6.0)
+    sinT = numpy.sin(months * numpy.pi / 6.0)
+
+    print
+    print 'spacetime = [ cosT, sinT + 1 ]'
+    spacetimedata = numpy.matrix([cosT,
+                                  sinT + 1.0]).T
+    eofanal = EOFAnalysis(spacetimedata)
+    eofanal.analyze()
+    defminsignif = eofanal.minsignif();
+    eofanal.setminsignif(0.1)
+    fracsignifs = eofanal.signiffracs()
+    print 'EOF fractional significances:'
+    print formatter.pformat(fracsignifs)
+    numeofs = eofanal.numeofs()
+    print 'Number of significant EOFs: %d' % numeofs
+    totalcontrib = eofanal.datapiece(0)
+    for k in xrange(1, numeofs+1):
+        eofvec = eofanal.eofvec(k)
+        sqnorm = numpy.dot(eofvec, eofvec)
+        print 'EOF %d has norm^2: %#.4f' % (k, sqnorm)
+        print formatter.pformat(eofvec)
+        tafvec = eofanal.tafvec(k)
+        sqnorm = numpy.dot(tafvec, tafvec)
+        print 'TAF %d has norm^2: %#.4f' % (k, sqnorm)
+        print formatter.pformat(tafvec)
+        tafeof = numpy.outer(tafvec, eofvec) 
+        contrib = eofanal.datapiece(k)
+        if numpy.allclose(contrib, tafeof):
+            print 'datapiece(%d) all close to expected values' % k
+        else:
+            raise ValueError(
+                    'datapiece(%d):\n    expected\n%s\n    found\n%s' % \
+                    (k, formatter.pformat(tafeof),
+                        formatter.pformat(contrib)))
+        totalcontrib += contrib
+        expdata = eofanal.dataexplained(k)
+        if numpy.allclose(expdata, totalcontrib):
+            print 'dataexplained(%d) all close to expected values' % k
+        else:
+            raise ValueError(
+                    'dataexplained(%d):\n    expected\n%s\n    found\n%s' % \
+                    (k, formatter.pformat(totalcontrib),
+                        formatter.pformat(expdata)))
+        datadeltas = numpy.array(numpy.abs(spacetimedata - expdata)).flatten()
+        maxdiff = numpy.max(datadeltas)
+        rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+        print 'Max and RMS diff btwn data explained by %d most' % k
+        print '    influential EOFs and actual data: %#.8f, %#.8f' % \
+              (maxdiff, rmsdiff)
+    datadeltas = numpy.array(numpy.abs(spacetimedata - totalcontrib)).flatten()
+    maxdiff = numpy.max(datadeltas)
+    rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+    print 'Max and RMS diff btwn sum of all significant'
+    print '    data pieces and actual data: %#.8f, %#.8f' % \
+          (maxdiff, rmsdiff)
+
+    print
+    print 'spacetime = [ cosT * cosT, cosT * sinT + 1, cosT * sinT + 2, sinT * sinT + 3 ]'
+    spacetimedata = numpy.matrix([ cosT * cosT,
+                                   cosT * sinT + 1.0,
+                                   cosT * sinT + 2.0,
+                                   sinT * sinT + 3.0 ]).T
+    eofanal = EOFAnalysis(spacetimedata)
+    eofanal.analyze()
+    fracsignifs = eofanal.signiffracs()
+    print 'EOF fractional significances:'
+    print formatter.pformat(fracsignifs)
+    numeofs = eofanal.numeofs()
+    print 'Number of significant EOFs: %d' % numeofs
+    totalcontrib = eofanal.datapiece(0)
+    for k in xrange(1, numeofs+1):
+        eofvec = eofanal.eofvec(k)
+        sqnorm = numpy.dot(eofvec, eofvec)
+        print 'EOF %d has norm^2: %#.4f' % (k, sqnorm)
+        print formatter.pformat(eofvec)
+        tafvec = eofanal.tafvec(k)
+        sqnorm = numpy.dot(tafvec, tafvec)
+        print 'TAF %d has norm^2: %#.4f' % (k, sqnorm)
+        print formatter.pformat(tafvec)
+        tafeof = numpy.outer(tafvec, eofvec) 
+        contrib = eofanal.datapiece(k)
+        if numpy.allclose(contrib, tafeof):
+            print 'datapiece(%d) all close to expected values' % k
+        else:
+            raise ValueError(
+                    'datapiece(%d):\n    expected\n%s\n    found\n%s' % \
+                    (k, formatter.pformat(tafeof),
+                        formatter.pformat(contrib)))
+        totalcontrib += contrib
+        expdata = eofanal.dataexplained(k)
+        if numpy.allclose(expdata, totalcontrib):
+            print 'dataexplained(%d) all close to expected values' % k
+        else:
+            raise ValueError(
+                    'dataexplained(%d):\n    expected\n%s\n    found\n%s' % \
+                    (k, formatter.pformat(totalcontrib),
+                        formatter.pformat(expdata)))
+        datadeltas = numpy.array(numpy.abs(spacetimedata - expdata)).flatten()
+        maxdiff = numpy.max(datadeltas)
+        rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+        print 'Max and RMS diff btwn data explained by %d most' % k
+        print '    influential EOFs and actual data: %#.8f, %#.8f' % \
+              (maxdiff, rmsdiff)
+    datadeltas = numpy.array(numpy.abs(spacetimedata - totalcontrib)).flatten()
+    maxdiff = numpy.max(datadeltas)
+    rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+    print 'Max and RMS diff btwn sum of all significant'
+    print '    data pieces and actual data: %#.8f, %#.8f' % \
+          (maxdiff, rmsdiff)
+
+    fmat = spacetimedata - eofanal.datapiece(0)
+    for k in xrange(1, spacetimedata.shape[1] - numeofs + 1):
+        nullvec = eofanal.nullvec(k)
+        sqnorm = numpy.dot(nullvec, nullvec)
+        print 'Null-space vector %d has norm^2: %#.4f' % (k, sqnorm)
+        print formatter.pformat(nullvec)
+        tafvec = numpy.array(fmat * numpy.matrix(nullvec).T).squeeze()
+        sqnorm = numpy.dot(tafvec, tafvec)
+        print 'F * NSV %d has norm^2: %#.4f' % (k, sqnorm)
+        # print formatter.pformat(tafvec)
+
+    import cPickle
+
+    eofpicklestring = cPickle.dumps(eofanal)
+    print 'length of the eofanal pickle string: %d' % len(eofpicklestring)
+    neweofanal = cPickle.loads(eofpicklestring)
+    print 'unpickled eofanal.numeofs() = %d' % neweofanal.numeofs()
+
diff --git a/pyfermod/eofanal/eofanalysistests.py b/pyfermod/eofanal/eofanalysistests.py
new file mode 100644
index 0000000..84dd74e
--- /dev/null
+++ b/pyfermod/eofanal/eofanalysistests.py
@@ -0,0 +1,340 @@
+'''
+Tests for the eofanalysis module.
+
+ at author: Karl Smith
+'''
+
+import eofanalysis
+import math
+import numpy
+import unittest
+
+
+class EOFAnalysisTests(unittest.TestCase):
+    '''
+    Tests of the eofanalysis.EOFAnalysis
+    and eofanalysis.InvalidStateError classes
+    '''
+
+    def setUp(self):
+        '''
+        Create some repeatedly used test data
+        '''
+        self.t_steps   = numpy.arange(0.0, 60.0, 0.25)
+        self.cos_t     = numpy.cos(self.t_steps * numpy.pi / 6.0)
+        self.sin_t     = numpy.sin(self.t_steps * numpy.pi / 6.0)
+        self.csmat     = numpy.matrix([self.cos_t,
+                                       self.sin_t + 1.0]).T
+        self.ccssmat   = numpy.matrix([self.cos_t * self.cos_t,
+                                       self.cos_t * self.sin_t + 1.0,
+                                       self.cos_t * self.sin_t + 2.0,
+                                       self.sin_t * self.sin_t + 3.0]).T
+        self.onetmat   = numpy.matrix([self.cos_t])
+        self.onelocmat = self.onetmat.T 
+        self.novarmat  = numpy.matrix([self.cos_t, self.cos_t, self.cos_t])
+
+
+    def test01InvalidStateError(self):
+        '''
+        Tests initialization of InvalidStateError instances.
+        '''
+        err = eofanalysis.InvalidStateError("Test case")
+        self.assertNotEqual(err, None)
+
+
+    def test02init(self):
+        '''
+        Tests initialization of EOFAnalysis instances.
+        '''
+        # check instantiation from a matrix
+        eofanalysis.EOFAnalysis(self.csmat)
+        # check instantiation from an numpy.array
+        eofanalysis.EOFAnalysis(numpy.array([self.cos_t, 
+                                             self.sin_t]).T)
+        # check instantiation from a list of lists
+        eofanalysis.EOFAnalysis([[1.0, 0.0, 0.0, 0.0],
+                                 [0.5, 0.5, 0.5, 0.5],
+                                 [0.0, 0.0, 0.0, 1.0]])
+        # check instantiation from a string
+        eofanalysis.EOFAnalysis("1.0, 0.0, 0.0, 0.0 ; " + \
+                                "0.5, 0.5, 0.5, 0.5 ; " + \
+                                "0.0, 0.0, 0.0, 1.0")
+        # check TypeError raised if spacetimedata is not given
+        self.assertRaises(TypeError, eofanalysis.EOFAnalysis)
+        # check ValueError raised if spacetime is not valid
+        self.assertRaises(ValueError, eofanalysis.EOFAnalysis,
+                          numpy.matrix([['a', 'b', 'c'],
+                                        ['d', 'e', 'f']]))
+        # check UserWarning raised if one time value in each time series
+        self.assertRaises(UserWarning, eofanalysis.EOFAnalysis, self.onetmat)
+        # no problems if only one location, however
+        eofanalysis.EOFAnalysis(self.onelocmat)
+
+
+    def test03analyze(self):
+        '''
+        Tests the EOFAnalysis.analyze method.
+        '''
+        # check a valid case
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        # check UserError raised if constant time series
+        novaranal = eofanalysis.EOFAnalysis(self.novarmat)
+        self.assertRaises(UserWarning, novaranal.analyze)
+
+
+    def test04signiffracs(self):
+        '''
+        Tests the EOFAnalysis.signiffracs method.
+        '''
+        # check a trivial case with one location
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        onelocfracs = onelocanal.signiffracs()
+        self.assertTrue(numpy.allclose(onelocfracs, 1.0))
+        # check a valid case with all significant EOFs
+        csanal = eofanalysis.EOFAnalysis(self.csmat)
+        csanal.analyze()
+        csfracs = csanal.signiffracs()
+        self.assertTrue(numpy.allclose(csfracs, [0.5, 0.5]))
+        # check a valid case with some insignificant EOFs
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        ccssfracs = ccssanal.signiffracs()
+        self.assertTrue(numpy.allclose(ccssfracs, [0.5, 0.5, 0.0, 0.0]))
+        # check a warned case where no significant EOFs
+        novaranal = eofanalysis.EOFAnalysis(self.novarmat)
+        try:
+            novaranal.analyze()
+        except UserWarning:
+            pass
+        novarfracs = novaranal.signiffracs()
+        self.assertTrue(numpy.allclose(novarfracs, 0.0))
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.signiffracs)
+
+
+    def test05minsignif(self):
+        '''
+        Test of the EOFAnalysis.minsignif and EOFAnalysis.setminsignif methods.
+        '''
+        csanal = eofanalysis.EOFAnalysis(self.csmat)
+        dfltminsignif = csanal.minsignif()
+        # Check the default value
+        self.assertAlmostEqual(dfltminsignif, 0.01)
+        # Reset the value and check that it took
+        csanal.setminsignif(0.05)
+        resetminsignif = csanal.minsignif()
+        self.assertAlmostEqual(resetminsignif, 0.05)
+        # Try resetting to invalid values
+        self.assertRaises(ValueError, csanal.setminsignif, 0.00000001)
+        self.assertRaises(ValueError, csanal.setminsignif, 0.99999999)
+
+
+    def test06numeofs(self):
+        '''
+        Tests the EOFAnalysis.numeofs method.
+        '''
+        # check a trivial case with one location
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        self.assertEqual(onelocanal.numeofs(), 1)
+        # check a valid case with all significant EOFs
+        csanal = eofanalysis.EOFAnalysis(self.csmat)
+        csanal.analyze()
+        self.assertEqual(csanal.numeofs(), 2)
+        # check a valid case with some insignificant EOFs
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        self.assertEqual(ccssanal.numeofs(), 2)
+        # check a warned case where no significant EOFs
+        novaranal = eofanalysis.EOFAnalysis(self.novarmat)
+        try:
+            novaranal.analyze()
+        except UserWarning:
+            pass
+        self.assertEqual(novaranal.numeofs(), 0)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.numeofs)
+
+
+    def test07eofvec(self):
+        '''
+        Tests of the EOFAnalysis.eofvec method.  More extensive tests
+        are accomplished in test_datapiece.
+        '''
+        # check a trivial case
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        oneloceof1 = onelocanal.eofvec(1)
+        self.assertTrue(numpy.allclose(oneloceof1, math.sqrt(0.5)))
+        # check a "simple" case
+        csanal = eofanalysis.EOFAnalysis(self.csmat)
+        csanal.analyze()
+        cseof1 = csanal.eofvec(1)
+        cseof2 = csanal.eofvec(2)
+        if cseof1[0] < 1.0E-10:
+            self.assertTrue(numpy.allclose(cseof1, [0.0, math.sqrt(0.5)]))
+            self.assertTrue(numpy.allclose(cseof2, [math.sqrt(0.5), 0.0]))
+        else:
+            self.assertTrue(numpy.allclose(cseof1, [math.sqrt(0.5), 0.0]))
+            self.assertTrue(numpy.allclose(cseof2, [0.0, math.sqrt(0.5)]))
+        # check a EOF properties of a more complicated example
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        ccsseof1 = ccssanal.eofvec(1)
+        ccsseof2 = ccssanal.eofvec(2)
+        self.assertAlmostEqual(numpy.dot(ccsseof1, ccsseof1), 0.25)
+        self.assertAlmostEqual(numpy.dot(ccsseof1, ccsseof2), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccsseof2, ccsseof2), 0.25)
+        # check ValueError raised for invalid EOF numbers
+        self.assertRaises(ValueError, ccssanal.eofvec, -1)
+        self.assertRaises(ValueError, ccssanal.eofvec, 0)
+        self.assertRaises(ValueError, ccssanal.eofvec, 3)
+        self.assertRaises(ValueError, ccssanal.eofvec, 5)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.eofvec, 1)
+
+
+    def test08tafvec(self):
+        '''
+        Test of the EOFAnalysis.tafvec method.  More extensive tests
+        are accomplished in test_datapiece.
+        '''
+        # check a trivial case
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        oneloctaf1 = onelocanal.tafvec(1)
+        self.assertTrue(numpy.allclose(oneloctaf1, math.sqrt(2.0) * self.cos_t))
+        # check a "simple" case
+        csanal = eofanalysis.EOFAnalysis(self.csmat)
+        csanal.analyze()
+        cstaf1 = csanal.tafvec(1)
+        cstaf2 = csanal.tafvec(2)
+        if cstaf1[0] < 1.0E-10:
+            self.assertTrue(numpy.allclose(cstaf1, math.sqrt(2.0) * self.sin_t))
+            self.assertTrue(numpy.allclose(cstaf2, math.sqrt(2.0) * self.cos_t))
+        else:
+            self.assertTrue(numpy.allclose(cstaf1, math.sqrt(2.0) * self.cos_t))
+            self.assertTrue(numpy.allclose(cstaf2, math.sqrt(2.0) * self.sin_t))
+        # check a EOF properties of a more complicated example
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        ccsstaf1 = ccssanal.tafvec(1)
+        ccsstaf2 = ccssanal.tafvec(2)
+        self.assertAlmostEqual(numpy.dot(ccsstaf1, ccsstaf1), 240.0)
+        self.assertAlmostEqual(numpy.dot(ccsstaf1, ccsstaf2), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccsstaf2, ccsstaf2), 240.0)
+        # check ValueError raised for invalid TAF numbers
+        self.assertRaises(ValueError, ccssanal.tafvec, -1)
+        self.assertRaises(ValueError, ccssanal.tafvec, 0)
+        self.assertRaises(ValueError, ccssanal.tafvec, 3)
+        self.assertRaises(ValueError, ccssanal.tafvec, 5)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.tafvec, 1)
+
+    
+    def test09nullvec(self):
+        '''
+        Test of the EOFAnalysis.nullvec method.
+        '''
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        ccsseof1 = ccssanal.eofvec(1)
+        ccsseof2 = ccssanal.eofvec(2)
+        ccssnv1 = ccssanal.nullvec(1)
+        ccssnv2 = ccssanal.nullvec(2)
+        self.assertAlmostEqual(numpy.dot(ccssnv1, ccssnv1), 1.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv1, ccssnv2), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv2, ccssnv2), 1.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv1, ccsseof1), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv1, ccsseof2), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv2, ccsseof1), 0.0)
+        self.assertAlmostEqual(numpy.dot(ccssnv2, ccsseof2), 0.0)
+        # check ValueError raised for invalid null vector numbers
+        self.assertRaises(ValueError, ccssanal.nullvec, -1)
+        self.assertRaises(ValueError, ccssanal.nullvec, 0)
+        self.assertRaises(ValueError, ccssanal.nullvec, 3)
+        self.assertRaises(ValueError, ccssanal.nullvec, 5)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.nullvec, 1)
+
+
+    def test10datapiece(self):
+        '''
+        Tests of the EOFAnalysis.datapiece method.
+        '''
+        # Test a trivial example
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        self.assertTrue(numpy.allclose(onelocanal.datapiece(1),
+                                       self.onelocmat))
+        # Test the results from a valid example
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        datatotal = ccssanal.datapiece(0)
+        for k in xrange(1, ccssanal.numeofs()+1):
+            eofvec = ccssanal.eofvec(k)
+            tafvec = ccssanal.tafvec(k)
+            tafeof = numpy.outer(tafvec, eofvec)
+            datapiece = ccssanal.datapiece(k)
+            self.assertTrue(numpy.allclose(datapiece, tafeof), 
+                            "Not True: datapiece(%d) == tafvec(%d).T * eofvec(%d)" % \
+                            (k,k,k))
+            datatotal += datapiece
+        self.assertTrue(numpy.allclose(datatotal, self.ccssmat),
+                        "Not True: Sum[k=0->numeofs](datapiece(k)) == OriginalData")
+        self.assertTrue(numpy.allclose(ccssanal.datapiece(3), 0.0),
+                        "Not True: datapiece of insignificant EOF is insignificant")
+        self.assertTrue(numpy.allclose(ccssanal.datapiece(4), 0.0),
+                        "Not True: datapiece of insignificant EOF is insignificant")
+        # check ValueError raised for invalid EOF numbers
+        self.assertRaises(ValueError, ccssanal.datapiece, -1)
+        self.assertRaises(ValueError, ccssanal.datapiece, 5)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.datapiece, 0)
+
+
+    def test11dataexplained(self):
+        '''
+        Tests of the EOFAnalysis.dataexplained method.
+        '''
+        # Test a trivial example
+        onelocanal = eofanalysis.EOFAnalysis(self.onelocmat)
+        onelocanal.analyze()
+        self.assertTrue(numpy.allclose(onelocanal.dataexplained(1),
+                                       self.onelocmat))
+        # Test the results from a valid example
+        ccssanal = eofanalysis.EOFAnalysis(self.ccssmat)
+        ccssanal.analyze()
+        datatotal = numpy.matrix(numpy.zeros(self.ccssmat.shape))
+        for k in xrange(ccssanal.numeofs()+1):
+            datatotal += ccssanal.datapiece(k)
+            dataexpld = ccssanal.dataexplained(k)
+            self.assertTrue(numpy.allclose(dataexpld, datatotal), 
+                "Not True: dataexplained(%d) == Sum[k=0->%d](datapiece(k))" % \
+                (k,k))
+        self.assertTrue(numpy.allclose(ccssanal.dataexplained(3), self.ccssmat),
+                        "Not True: dataexplained of insignif EOF is OriginalData")
+        self.assertTrue(numpy.allclose(ccssanal.dataexplained(4), self.ccssmat),
+                        "Not True: dataexplained of insignif EOF is OriginalData")
+        # check ValueError raised for invalid EOF numbers
+        self.assertRaises(ValueError, ccssanal.dataexplained, -1)
+        self.assertRaises(ValueError, ccssanal.dataexplained, 5)
+        # check InvalidStateError raised if analyze had not been called
+        noanal = eofanalysis.EOFAnalysis(self.csmat)
+        self.assertRaises(eofanalysis.InvalidStateError, noanal.dataexplained, 0)
+
+
+
+if __name__ == "__main__":
+    '''
+    Run the unit tests in this module.
+    '''
+    unittest.main()
diff --git a/pyfermod/eofanal/eofdatapiece.py b/pyfermod/eofanal/eofdatapiece.py
new file mode 100644
index 0000000..59e4371
--- /dev/null
+++ b/pyfermod/eofanal/eofdatapiece.py
@@ -0,0 +1,179 @@
+'''
+PyFerret external function providing data partitioned into pieces 
+along the ensemble axis.  Each partition is the data explained by 
+a single Empirical Orthogonal Function (EOF) and its corresponding 
+Time Amplitude Funtion (TAF)
+
+ at author: Karl Smith
+'''
+
+import numpy
+import pyferret
+import pyferret.eofanal as eofanal
+
+def ferret_init(efid):
+    '''
+    Initializes the eofdatapiece function. 
+    '''
+    init_dict = { }
+    init_dict["numargs"] = 3
+    init_dict["descript"] = "Partitions data into EOF * TAF pieces " + \
+        "(parts of data explained) along the ensemble axis"
+    init_dict["argnames"] = ("Data",
+                             "MinSignif",
+                             "MaxEOFs")
+    init_dict["argdescripts"] = (
+        "Time-location data; defined on T and one or more of X, Y, Z",
+        "Minimum fraction-of-data-explained considered significant",
+        "Maximum number of EOFs to consider (-1 for all signficant EOFS)")
+    init_dict["argtypes"] = (pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ONEVAL,
+                             pyferret.FLOAT_ONEVAL)
+    # X, Y, Z, and T match input; E axis added as an abstract axis
+    axes = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    axes[pyferret.E_AXIS] = pyferret.AXIS_ABSTRACT
+    axes[pyferret.F_AXIS] = pyferret.AXIS_DOES_NOT_EXIST;
+    init_dict["axes"] = axes
+    part_influence = [ True ] * pyferret.MAX_FERRET_NDIM
+    part_influence[pyferret.E_AXIS] = False
+    part_influence[pyferret.F_AXIS] = False
+    no_influence = [ False ] * pyferret.MAX_FERRET_NDIM
+    init_dict["influences"] = (part_influence,
+                               no_influence,
+                               no_influence)
+    init_dict["piecemeal"] =  [ False ] * pyferret.MAX_FERRET_NDIM
+
+    return init_dict
+
+
+def ferret_result_limits(efid):
+    '''
+    Provides the bounds of the E abstract axis.
+    The maximum number of EOFs is the number of locations. 
+    '''
+    maxeofs = pyferret.get_arg_one_val(efid, pyferret.ARG3)
+    if maxeofs > 0.95:
+        maxeofs = int(maxeofs + 0.1)
+    else:
+        maxeofs = 1
+        for axis in (pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS):
+            axis_info = pyferret.get_axis_info(efid, pyferret.ARG1, axis);
+            if axis_info:
+                npts = axis_info.get("size", -1)
+                if npts > 0:
+                    maxeofs *= npts
+    result_limits = [ None ] * pyferret.MAX_FERRET_NDIM
+    result_limits[pyferret.E_AXIS] = (1, maxeofs+1)
+    return result_limits
+
+
+def ferret_compute(efid, result, result_bdf, inputs, input_bdfs):
+    '''
+    Assign result with EOF * TAF (piece of data explained) up to 
+    the number of significant EOFs.  The X,Y,Z,T data is given in
+    inputs[0], the minimum fraction-of-data-explained considered
+    significant is given as a single value in inputs[1].  The 
+    maximum number of EOFs to consider is given as a single value
+    in inputs[2] (-1 for all significant).
+    '''
+    # verify no ensemble or forecast axis on the input data
+    if inputs[pyferret.ARG1].shape[pyferret.E_AXIS] > 1:
+        raise ValueError("Input data cannot have an ensemble axis")
+    if inputs[pyferret.ARG1].shape[pyferret.F_AXIS] > 1:
+        raise ValueError("Input data cannot have a forecast axis")
+    # number of time steps in the input data
+    ntime = inputs[pyferret.ARG1].shape[pyferret.T_AXIS]
+    if ntime < 2:
+        raise ValueError("Input data time axis does not exist or is a singleton")
+    # Get the minimum fraction-data-explained and verify it is reasonable
+    min_signif = float(inputs[1])
+    if (min_signif < 1.0E-6) or (min_signif > (1.0 - 1.0E-6)):
+        raise ValueError("MinSignif must be in [0.000001, 0.999999]")
+    # Get the maximum number of EOFs to consider
+    maxeofs = float(inputs[2])
+    if maxeofs > 0.95:
+        maxeofs = int(maxeofs + 0.1)
+    else:
+        maxeofs = -1
+    # Get the mask of where the data is defined
+    defined_data = ( numpy.fabs(inputs[pyferret.ARG1] - 
+                                input_bdfs[pyferret.ARG1]) >= 1.0E-5 )
+    # Get the mask of where the data is defined for every time step
+    defd_mask = numpy.logical_and.reduce(defined_data, axis=pyferret.T_AXIS)
+    for t in xrange(ntime):    
+        defined_data[:, :, :, t] = defd_mask 
+    # Convert to time-location (a 2-D array), 
+    # eliminating locations with missing time steps, 
+    # and taking the transpose so time is the first axis
+    timeloc = inputs[pyferret.ARG1][defined_data]\
+                    .reshape((-1, ntime)).T
+    # Create the EOFAnalysis object and analyze the data
+    eofs = eofanal.EOFAnalysis(timeloc)
+    eofs.setminsignif(min_signif)
+    eofs.analyze()
+    # Initialize the result to all-undefined
+    result[:] = result_bdf
+    # Remove the E and F singleton axes from the defined mask
+    defined_data = defined_data.reshape(defined_data.shape[:4])
+    # Assign the EOF-TAF products for the significant EOFs 
+    # The values at m=0 are the time-series averages
+    numeofs = eofs.numeofs()
+    if (maxeofs > 0) and (numeofs > maxeofs):
+        numeofs = maxeofs
+    for k in xrange(numeofs+1):
+        timeloc_piece = eofs.datapiece(k)
+        loctime_piece = numpy.array(timeloc_piece.T).reshape(-1)
+        result[:, :, :, :, k, 0][defined_data] = loctime_piece
+    # The EOF-TAF pieces for insignificant EOFs are left as undefined 
+    return
+
+
+if __name__ == "__main__":
+    # Just verify ferret_init does not raise an error
+    defdict = ferret_init(0)
+    # Create some data
+    yaxis = numpy.linspace(-80.0, 80.0, 17)
+    zaxis = numpy.linspace(0.0, 250.0, 6)
+    taxis = numpy.linspace(0.0, 8760.0, 25)
+    ydata = 20.0 * numpy.square(numpy.cos(numpy.deg2rad(yaxis)))
+    zdata = 1.0 / numpy.log10(5.0 * zaxis + 10.0)
+    yzdata = numpy.outer(ydata, zdata)
+    tdata = (taxis / 87600.0) + 1.0
+    yztdata = numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+    ydata = numpy.square(numpy.sin(2.0 * numpy.deg2rad(yaxis)))
+    yzdata = numpy.outer(ydata, zdata)
+    tdata = -5.0 * numpy.cos((tdata - 2190.0) * numpy.pi / 4380.0)
+    yztdata += numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+    yztdata += 6.0
+    print "time series at Y = 0.0, Z = 0.0"
+    print str(yztdata[0, 8, 0, :, 0, 0])
+    print "depth series at Y = 0.0, T = start of April"
+    print str(yztdata[0, 8, :, 6, 0, 0])
+    print "latitude series at Z = 0.0, T = start of April"
+    print str(yztdata[0, :, 0, 6, 0, 0])
+    # Create the result array and the other ferret_compute arguments
+    result = numpy.zeros((1, 17, 6, 25, 17*6, 1))
+    resbdf = numpy.array([1.0E20])
+    inputs = (yztdata, 0.001, -1)
+    inpbdfs = (-1.0E34, -1.0E34, -1.0E34)
+    # Check ferret_compute
+    ferret_compute(0, result, resbdf, inputs, inpbdfs)
+    piecesum = numpy.zeros((1, 17, 6, 25))
+    lastone = 0
+    for m in xrange(17 * 6):
+        if numpy.allclose(result[:, :, :, :, m, 0], resbdf):
+            break;
+        print "EOF-TAF piece %d" % m
+        print "    time series at Y = 0.0, Z = 0.0"
+        print "    " + str(result[0, 8, 0, :, m, 0])
+        print "    depth series at Y = 0.0, T = start of April"
+        print "    " + str(result[0, 8, :, 6, m, 0])
+        print "    latitude series at Z = 0.0, T = start of April"
+        print "    " + str(result[0, :, 0, 6, m, 0])
+        lastone = m
+        piecesum += result[:, :, :, :, m, 0]
+    if numpy.allclose(piecesum, yztdata[:, :, :, :, 0, 0]):
+        print "sum of %d pieces all close to input data" % lastone
+    else:
+        print "sum %d pieces different from input data" % lastone
+
diff --git a/pyfermod/eofanal/eofdatasum.py b/pyfermod/eofanal/eofdatasum.py
new file mode 100644
index 0000000..81d0369
--- /dev/null
+++ b/pyfermod/eofanal/eofdatasum.py
@@ -0,0 +1,179 @@
+'''
+PyFerret external function providing data partitioned into summed 
+pieces along the ensemble axis.  The data at ensemble value 'm'  
+is the data explained by the 'm' most-significant Empirical Orthogonal 
+Functions (EOFs) and their corresponding Time Amplitude Functions 
+(TAFs).
+
+ at author: Karl Smith
+'''
+
+
+import numpy
+import pyferret
+import pyferret.eofanal as eofanal
+
+def ferret_init(efid):
+    '''
+    Initializes the eofdatasum function. 
+    '''
+    init_dict = { }
+    init_dict["numargs"] = 3
+    init_dict["descript"] = "Partitions data into EOF * TAF sums " + \
+        "(total data explained) along the ensemble axis"
+    init_dict["argnames"] = ("Data",
+                             "MinSignif",
+                             "MaxEOFs")
+    init_dict["argdescripts"] = (
+        "Time-location data; defined on T and one or more of X, Y, Z",
+        "Minimum fraction-of-data-explained considered significant",
+        "Maximum number of EOFs to consider (-1 for all signficant EOFS)")
+    init_dict["argtypes"] = (pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ONEVAL,
+                             pyferret.FLOAT_ONEVAL)
+    # X, Y, Z, and T match input; E axis added as an abstract axis
+    axes = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    axes[pyferret.E_AXIS] = pyferret.AXIS_ABSTRACT
+    axes[pyferret.F_AXIS] = pyferret.AXIS_DOES_NOT_EXIST;
+    init_dict["axes"] = axes
+    part_influence = [ True ] * pyferret.MAX_FERRET_NDIM
+    part_influence[pyferret.E_AXIS] = False
+    part_influence[pyferret.F_AXIS] = False
+    no_influence = [ False ] * pyferret.MAX_FERRET_NDIM
+    init_dict["influences"] = (part_influence,
+                               no_influence,
+                               no_influence)
+    init_dict["piecemeal"] =  [ False ] * pyferret.MAX_FERRET_NDIM
+
+    return init_dict
+
+
+def ferret_result_limits(efid):
+    '''
+    Provides the bounds of the E abstract axis.  
+    The maximum number of EOFs is the number of locations. 
+    '''
+    maxeofs = pyferret.get_arg_one_val(efid, pyferret.ARG3)
+    if maxeofs > 0.95:
+        maxeofs = int(maxeofs + 0.1)
+    else:
+        maxeofs = 1
+        for axis in (pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS):
+            axis_info = pyferret.get_axis_info(efid, pyferret.ARG1, axis);
+            if axis_info:
+                npts = axis_info.get("size", -1)
+                if npts > 0:
+                    maxeofs *= npts
+    result_limits = [ None ] * pyferret.MAX_FERRET_NDIM
+    result_limits[pyferret.E_AXIS] = (1, maxeofs+1)
+    return result_limits
+
+
+def ferret_compute(efid, result, result_bdf, inputs, input_bdfs):
+    '''
+    Assign result with the partial sums of EOF * TAF (data explained
+    by the most significant EOFs) up to the number of significant 
+    EOFs.  The X,Y,Z,T data is given in inputs[0], the minimum 
+    fraction-of-data-explained considered significant is given as a 
+    single value in inputs[1].
+    '''
+    # verify no ensemble or forecast axis on the input data
+    if inputs[pyferret.ARG1].shape[pyferret.E_AXIS] > 1:
+        raise ValueError("Input data cannot have an ensemble axis")
+    if inputs[pyferret.ARG1].shape[pyferret.F_AXIS] > 1:
+        raise ValueError("Input data cannot have a forecast axis")
+    # number of time steps in the input data
+    ntime = inputs[pyferret.ARG1].shape[pyferret.T_AXIS]
+    if ntime < 2:
+        raise ValueError("Input data time axis does not exist or is a singleton")
+    # Get the minimum fraction-data-explained and verify it is reasonable
+    min_signif = float(inputs[1])
+    if (min_signif < 1.0E-6) or (min_signif > (1.0 - 1.0E-6)):
+        raise ValueError("MinSignif must be in [0.000001, 0.999999]")
+    # Get the maximum number of EOFs to consider
+    maxeofs = float(inputs[2])
+    if maxeofs > 0.95:
+        maxeofs = int(maxeofs + 0.1)
+    else:
+        maxeofs = -1
+    # Get the mask of where the data is defined
+    defined_data = ( numpy.fabs(inputs[pyferret.ARG1] - 
+                                input_bdfs[pyferret.ARG1]) >= 1.0E-5 )
+    # Get the mask of where the data is defined for every time step
+    defd_mask = numpy.logical_and.reduce(defined_data, axis=pyferret.T_AXIS)
+    for t in xrange(ntime):    
+        defined_data[:, :, :, t] = defd_mask 
+    # Convert to time-location (a 2-D array), 
+    # eliminating locations with missing time steps, 
+    # and taking the transpose so time is the first axis
+    timeloc = inputs[pyferret.ARG1][defined_data]\
+                    .reshape((-1, ntime)).T
+    # Create the EOFAnalysis object and analyze the data
+    eofs = eofanal.EOFAnalysis(timeloc)
+    eofs.setminsignif(min_signif)
+    eofs.analyze()
+    # Initialize the result to all-undefined
+    result[:] = result_bdf
+    # Remove the E and F singleton axes from the defined mask
+    defined_data = defined_data.reshape(defined_data.shape[:4])
+    # Assign the sums of the EOF-TAF products for the significant EOFs
+    # The values at m=0 are the time-series averages
+    numeofs = eofs.numeofs()
+    if (maxeofs > 0) and (numeofs > maxeofs):
+        numeofs = maxeofs
+    for k in xrange(numeofs+1):
+        timeloc_sum = eofs.dataexplained(k)
+        loctime_sum = numpy.array(timeloc_sum.T).reshape(-1)
+        result[:, :, :, :, k, 0][defined_data] = loctime_sum
+    # The EOF-TAF sums for insignificant EOFs are left as undefined 
+    return
+
+
+if __name__ == "__main__":
+    # Just verify ferret_init does not raise an error
+    defdict = ferret_init(0)
+    # Create some data
+    yaxis = numpy.linspace(-80.0, 80.0, 17)
+    zaxis = numpy.linspace(0.0, 250.0, 6)
+    taxis = numpy.linspace(0.0, 8760.0, 25)
+    ydata = 20.0 * numpy.square(numpy.cos(numpy.deg2rad(yaxis)))
+    zdata = 1.0 / numpy.log10(5.0 * zaxis + 10.0)
+    yzdata = numpy.outer(ydata, zdata)
+    tdata = (taxis / 87600.0) + 1.0
+    yztdata = numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+    ydata = numpy.square(numpy.sin(2.0 * numpy.deg2rad(yaxis)))
+    yzdata = numpy.outer(ydata, zdata)
+    tdata = -5.0 * numpy.cos((tdata - 2190.0) * numpy.pi / 4380.0)
+    yztdata += numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+    yztdata += 6.0
+    print "time series at Y = 0.0, Z = 0.0"
+    print str(yztdata[0, 8, 0, :, 0, 0])
+    print "depth series at Y = 0.0, T = start of April"
+    print str(yztdata[0, 8, :, 6, 0, 0])
+    print "latitude series at Z = 0.0, T = start of April"
+    print str(yztdata[0, :, 0, 6, 0, 0])
+    # Create the result array and the other ferret_compute arguments
+    result = numpy.zeros((1, 17, 6, 25, 17*6, 1))
+    resbdf = numpy.array([1.0E20])
+    inputs = (yztdata, 0.001, -1)
+    inpbdfs = (-1.0E34, -1.0E34, -1.0E34)
+    # Check ferret_compute
+    ferret_compute(0, result, resbdf, inputs, inpbdfs)
+    lastone = 0
+    for m in xrange(17 * 6):
+        if numpy.allclose(result[:, :, :, :, m, 0], resbdf):
+            break;
+        print "EOF-TAF sum %d" % m
+        print "    time series at Y = 0.0, Z = 0.0"
+        print "    " + str(result[0, 8, 0, :, m, 0])
+        print "    depth series at Y = 0.0, T = start of April"
+        print "    " + str(result[0, 8, :, 6, m, 0])
+        print "    latitude series at Z = 0.0, T = start of April"
+        print "    " + str(result[0, :, 0, 6, m, 0])
+        lastone = m
+    if numpy.allclose(result[:, :, :, :, lastone, 0], 
+                     yztdata[:, :, :, :, 0, 0]):
+        print "sum %d all close to input data" % lastone
+    else:
+        print "sum %d different from input data" % lastone
+
diff --git a/pyfermod/fershp/__init__.py b/pyfermod/fershp/__init__.py
new file mode 100644
index 0000000..79f0059
--- /dev/null
+++ b/pyfermod/fershp/__init__.py
@@ -0,0 +1,341 @@
+"""
+Helper functions for pyferret shapefile external functions.
+"""
+
+import numpy
+import shapefile
+import os
+import os.path
+import pyferret.fershp.mapprj
+
+
+def createprjfile(shapefile_mapprj, shapefile_name):
+    """
+    Creates a map projection (.prj) file for a shapefile.
+
+    Arguments:
+        shapefile_mapprj - either the common name or the WKT
+                           description of the map projection;
+                           if None or blank, "WGS 84" is used.
+        shapefile_name   - name of the shapefile; any filename
+                           extensions are ignored.
+    Raises:
+        ValueError if the map projection is invalid.
+    """
+    # If the string given looks like a WKT description, just use it;
+    # otherwise, try to convert the name into a description.
+    if (not shapefile_mapprj) or shapefile_mapprj.isspace():
+        prj_descript = pyferret.fershp.mapprj.name_to_descript("WGS 84")
+    elif shapefile_mapprj.startswith('GEOGCS["') or \
+         shapefile_mapprj.startswith('PROJCS["'):
+        prj_descript = shapefile_mapprj
+    else:
+        prj_descript = pyferret.fershp.mapprj.name_to_descript(shapefile_mapprj)
+    (sfname, ext) = os.path.splitext(shapefile_name)
+    prjfile = file("%s.prj" % sfname, "w")
+    print >>prjfile, prj_descript
+    prjfile.close()
+
+
+def quadxycentroids(xvals, yvals):
+    """
+    Returns the centroids of X,Y-quadrilaterals whose vertices
+    are given by xvals and yvals.
+
+    Arguments:
+        xvals - 2D array of X values of the quadrilateral vertices
+        yvals - 2D array of Y values of the quadrilateral vertices
+        Quadrilaterals are defined by the (xvals, yvals) of
+        [i,j] -> [i,j+1] -> [i+1,j+1] -> [i+1,j] -> [i,j]
+
+    Returns:
+        Two 2D arrays of X values and Y values of the quadrilateral
+        centroids.  The size of each dimension is decreased by one.
+
+    Raises:
+        ValueError if the arguments are invalid
+    """
+    xarray = numpy.asarray(xvals, dtype=float)
+    yarray = numpy.asarray(yvals, dtype=float)
+    if len(xarray.shape) < 2:
+        raise ValueError("xvals and yvals must be (at least) two dimensional")
+    if xarray.shape != yarray.shape:
+        raise ValueError("xvals and yvals must have the same dimensions")
+    sixareas  = xarray[:-1,:-1] * yarray[:-1,1:]  - xarray[:-1,1:]  * yarray[:-1,:-1]
+    sixareas += xarray[:-1,1:]  * yarray[1:,1:]   - xarray[1:,1:]   * yarray[:-1,1:]
+    sixareas += xarray[1:,1:]   * yarray[1:,:-1]  - xarray[1:,:-1]  * yarray[1:,1:]
+    sixareas += xarray[1:,:-1]  * yarray[:-1,:-1] - xarray[:-1,:-1] * yarray[1:,:-1]
+    sixareas *= 3.0
+    cenxs  = ( xarray[:-1,:-1] * yarray[:-1,1:]  - xarray[:-1,1:]  * yarray[:-1,:-1] ) \
+             * ( xarray[:-1,:-1] + xarray[:-1,1:]  )
+    cenxs += ( xarray[:-1,1:]  * yarray[1:,1:]   - xarray[1:,1:]   * yarray[:-1,1:] ) \
+             * ( xarray[:-1,1:]  + xarray[1:,1:]   )
+    cenxs += ( xarray[1:,1:]   * yarray[1:,:-1]  - xarray[1:,:-1]  * yarray[1:,1:] ) \
+             * ( xarray[1:,1:]   + xarray[1:,:-1]  )
+    cenxs += ( xarray[1:,:-1]  * yarray[:-1,:-1] - xarray[:-1,:-1] * yarray[1:,:-1] ) \
+             * ( xarray[1:,:-1]  + xarray[:-1,:-1] )
+    cenxs /= sixareas
+    cenys  = ( xarray[:-1,:-1] * yarray[:-1,1:]  - xarray[:-1,1:]  * yarray[:-1,:-1] ) \
+             * ( yarray[:-1,:-1] + yarray[:-1,1:]  )
+    cenys += ( xarray[:-1,1:]  * yarray[1:,1:]   - xarray[1:,1:]   * yarray[:-1,1:] ) \
+             * ( yarray[:-1,1:]  + yarray[1:,1:]   )
+    cenys += ( xarray[1:,1:]   * yarray[1:,:-1]  - xarray[1:,:-1]  * yarray[1:,1:] ) \
+             * ( yarray[1:,1:]   + yarray[1:,:-1]  )
+    cenys += ( xarray[1:,:-1]  * yarray[:-1,:-1] - xarray[:-1,:-1] * yarray[1:,:-1] ) \
+             * ( yarray[1:,:-1]  + yarray[:-1,:-1] )
+    cenys /= sixareas
+    return (cenxs, cenys)
+
+
+def quadxycenters(xvals, yvals):
+    """
+    Returns the average centers of X,Y-quadrilaterals whose vertices
+    are given by xvals and yvals.
+
+    Arguments:
+        xvals - 2D array of X values of the quadrilateral vertices
+        yvals - 2D array of Y values of the quadrilateral vertices
+        Quadrilaterals are defined by the (xvals, yvals) of
+        [i,j] -> [i,j+1] -> [i+1,j+1] -> [i+1,j] -> [i,j]
+
+    Returns:
+        Two 2D arrays of X values and Y values of the quadrilateral
+        average centers.  The size of each dimension is decreased by one.
+
+    Raises:
+        ValueError if the arguments are invalid
+    """
+    xarray = numpy.asarray(xvals, dtype=float)
+    yarray = numpy.asarray(yvals, dtype=float)
+    if len(xarray.shape) < 2:
+        raise ValueError("xvals and yvals must be (at least) two dimensional")
+    if xarray.shape != yarray.shape:
+        raise ValueError("xvals and yvals must have the same dimensions")
+    cenxs  = 0.25 * ( xarray[:-1,:-1] + xarray[:-1,1:] + xarray[1:,1:] + xarray[1:,:-1] )
+    cenys  = 0.25 * ( yarray[:-1,:-1] + yarray[:-1,1:] + yarray[1:,1:] + yarray[1:,:-1] )
+    return (cenxs, cenys)
+
+
+def addquadxyvalues(sfwriter, pt0, pt1, pt2, pt3, zcoord, vals):
+    """
+    Adds a quadrilateral shape to sfwriter defined by the X,Y vertices
+    pt0 - pt1 - pt2 - pt3 - pt0, and possibly the common Z coordinate
+    (or array of Z coordinates) zcoord, along with the associated values
+    in vals.
+
+    Arguments:
+       sfwriter - the shapefile.Writer object to add the shape and values to
+       pt1, pt2,
+       pt3, pt4 - the (X,Y) numeric coordinates of the vertices of the simple
+                  quadrilateral; in sequence, but not necessarily the correct
+                  winding.  Any coordinates after the first two in each point
+                  are ignored.
+       zcoord   - the numeric Z coordinate or array of numeric Z coordinates
+                  for this quadrilateral; may be None
+       vals     - the list of values to be associated with this shape.  The
+                  fields for these values must already have been created in
+                  sfwriter.
+
+    Note: the winding of the quadrilateral is determined only using the X and
+          Y coordinates, even when multiple Z coordinates are provided.
+    """
+    # Get the correct polygon type
+    if zcoord != None:
+        shapetype = shapefile.POLYGONZ
+    else:
+        shapetype = shapefile.POLYGON
+    x0 = float(pt0[0]); y0 = float(pt0[1])
+    x1 = float(pt1[0]); y1 = float(pt1[1])
+    x2 = float(pt2[0]); y2 = float(pt2[1])
+    x3 = float(pt3[0]); y3 = float(pt3[1])
+    # Compute 2 * signed area of this simple quadrilateral
+    dqarea  = x0 * y1 - x1 * y0
+    dqarea += x1 * y2 - x2 * y1
+    dqarea += x2 * y3 - x3 * y2
+    dqarea += x3 * y0 - x0 * y3
+    # Create the correctly ordered array of coordinates for this single shape part
+    part = [ ]
+    if dqarea < 0.0:
+        # negative means clockwise which is desired direction
+        part.append([ x0, y0 ])
+        part.append([ x1, y1 ])
+        part.append([ x2, y2 ])
+        part.append([ x3, y3 ])
+        part.append([ x0, y0 ])
+    else:
+        # positive means counterclockwise so reverse ordering
+        part.append([ x0, y0 ])
+        part.append([ x3, y3 ])
+        part.append([ x2, y2 ])
+        part.append([ x1, y1 ])
+        part.append([ x0, y0 ])
+    # Append the Z coordinate(s) if given
+    if zcoord != None:
+        try:
+            # First try it as a single Z coordinate for all points
+            z = float(zcoord)
+            for pt in part:
+                pt.append(z)
+        except TypeError:
+            if len(zcoord) != 4:
+                raise ValueError("zcoord must be None, a single value, or a list of four values")
+            # Assume it is an array of numbers
+            if dqarea < 0.0:
+                zvals = list(zcoord) + [ zcoord[0] ]
+            else:
+                zvals = [ zcoord[0] ] + list(zcoord[::-1])
+            for (pt, z) in zip(part, zvals):
+                pt.append(float(z))
+    # Add the shape
+    sfwriter.poly([ part, ], shapetype)
+    # Add the values for this shape
+    sfwriter.record(*vals)
+
+
+#
+# The following is only for testing this module from the command line
+#
+if __name__ == "__main__":
+
+    shapefilename = "testsf"
+    wgs84_descript = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'
+    wgs84upsnorth_descript = 'PROJCS["WGS 84 / UPS North",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",90],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.994],PARAMETER["false_easting",2000000],PARAMETER["false_northing",2000000],UNIT["metre",1]]'
+
+    # Test createprjfile
+    createprjfile(None, "%s.jnk" % shapefilename)
+    prjfile = file("%s.prj" % shapefilename, "r")
+    datalines = prjfile.readlines()
+    prjfile.close()
+    if len(datalines) != 1:
+        raise ValueError("None for mapprj: more than one line given in the .prj file")
+    descript = datalines[0].strip()
+    if descript != wgs84_descript:
+        raise ValueError("None for mapprj:\n" \
+                         "    expect: %s\n" \
+                         "    found:  %s" % (wgs84_descript, descript))
+    del prjfile, datalines, descript
+
+    prjjunk = 'GEOGCS["Junk",DATUM["Junk"]]'
+    createprjfile(prjjunk, "%s.jnk" % shapefilename)
+    prjfile = file("%s.prj" % shapefilename, "r")
+    datalines = prjfile.readlines()
+    prjfile.close()
+    if len(datalines) != 1:
+        raise ValueError("Junk for mapprj: more than one line given in the .prj file")
+    descript = datalines[0].strip()
+    if descript != prjjunk:
+        raise ValueError("Junk for mapprj:\n" \
+                         "    expect: %s\n" \
+                         "    found:  %s" % (prjjunk, descript))
+    del prjjunk, prjfile, datalines, descript
+
+    createprjfile("WGS 84 / UPS North", "%s.jnk" % shapefilename)
+    prjfile = file("%s.prj" % shapefilename, "r")
+    datalines = prjfile.readlines()
+    prjfile.close()
+    if len(datalines) != 1:
+        raise ValueError("'WGS 84 / UPS North' for mapprj: more than one line given in the .prj file")
+    descript = datalines[0].strip()
+    if descript != wgs84upsnorth_descript:
+        raise ValueError("'WGS 84 / UPS North' for mapprj:\n" \
+                         "    expect: %s\n" \
+                         "    found:  %s" % (wgs84upsnorth_descript, descript))
+    del prjfile, datalines, descript
+    print "createprjfile: SUCCESS"
+
+    # Test quadxycentroids
+    xvals = ( ( 0, 1 ), ( 3, 4 ) )
+    yvals = ( ( 0, 2 ), ( 1, 3 ) )
+    expectx = [ [ 2.0 ] ]
+    expecty = [ [ 1.5 ] ]
+    (centx, centy) = quadxycentroids(xvals, yvals)
+    if not numpy.allclose(centx, expectx):
+        raise ValueError("Centroid X values: expected %s; found %s" % \
+                          (str(expectx), str(centx)))
+    if not numpy.allclose(centy, expecty):
+        raise ValueError("Centroid Y values: expected %s; found %s" % \
+                          (str(expecty), str(centy)))
+    del xvals, yvals, expectx, expecty, centx, centy
+    xvals = ( ( 0, 1 ), ( 2, 3 ) )
+    yvals = ( ( 0, 2 ), ( 1, 5 ) )
+    expectx = [ [ 39.0 / 24.0 ] ]
+    expecty = [ [ 49.0 / 24.0 ] ]
+    (centx, centy) = quadxycentroids(xvals, yvals)
+    if not numpy.allclose(centx, expectx):
+        raise ValueError("Centroid X values: expected %s; found %s" % \
+                          (str(expectx), str(centx)))
+    if not numpy.allclose(centy, expecty):
+        raise ValueError("Centroid Y values: expected %s; found %s" % \
+                          (str(expecty), str(centy)))
+    del xvals, yvals, expectx, expecty, centx, centy
+    print "quadxycentroids: SUCCESS"
+
+    # Test quadxycenters
+    xvals = ( ( 0, 1 ), ( 3, 4 ) )
+    yvals = ( ( 0, 2 ), ( 1, 3 ) )
+    expectx = [ [ 2.0 ] ]
+    expecty = [ [ 1.5 ] ]
+    (centx, centy) = quadxycenters(xvals, yvals)
+    if not numpy.allclose(centx, expectx):
+        raise ValueError("Centroid X values: expected %s; found %s" % \
+                          (str(expectx), str(centx)))
+    if not numpy.allclose(centy, expecty):
+        raise ValueError("Centroid Y values: expected %s; found %s" % \
+                          (str(expecty), str(centy)))
+    del xvals, yvals, expectx, expecty, centx, centy
+    xvals = ( ( 0, 1 ), ( 2, 3 ) )
+    yvals = ( ( 0, 2 ), ( 1, 5 ) )
+    expectx = [ [ 1.5 ] ]
+    expecty = [ [ 2.0 ] ]
+    (centx, centy) = quadxycenters(xvals, yvals)
+    if not numpy.allclose(centx, expectx):
+        raise ValueError("Centroid X values: expected %s; found %s" % \
+                          (str(expectx), str(centx)))
+    if not numpy.allclose(centy, expecty):
+        raise ValueError("Centroid Y values: expected %s; found %s" % \
+                          (str(expecty), str(centy)))
+    del xvals, yvals, expectx, expecty, centx, centy
+    print "quadxycenters: SUCCESS"
+
+    # Test addquadxyvalues
+    coords = [ [0.0, 0.0], [1.0, 0.0], [1.0, -1.0], [2.0, 1.0] ]
+    zval = [ -5.34, -4.23, -3.12, -2.01 ]
+    vals = [ 3.28573, 7.46952 ]
+    expectedxy = [ coords[0], coords[3], coords[2], coords[1], coords[0] ]
+    expectedz = [ zval[0], zval[3], zval[2], zval[1], zval[0] ]
+    # Create the shapefile
+    sfwriter = shapefile.Writer(shapefile.POLYGONZ)
+    sfwriter.field("VAL0", "N", 20, 7)
+    sfwriter.field("VAL1", "N", 20, 7)
+    # Add the shape and values and save the shapefile
+    addquadxyvalues(sfwriter, coords[0], coords[1], coords[2], coords[3], zval, vals)
+    sfwriter.save(shapefilename)
+    del zval, coords, sfwriter
+    # Read the shapefile and check the shape and values
+    sfreader = shapefile.Reader(shapefilename)
+    shapes = sfreader.shapes()
+    if len(shapes) != 1:
+        raise ValueError("Expected one shape; found %d" % len(shapes))
+    if shapes[0].shapeType != shapefile.POLYGONZ:
+        raise ValueError("Expected shapetype %d; found %d" % \
+                         (shapefile.POLYGONZ, shapes[0].shapeType))
+    if not numpy.allclose(shapes[0].points, expectedxy):
+        raise ValueError("Expected (X,Y) coordinates %s; found %s" % \
+                         (str(expectedxy), str(shapes[0].points)))
+    if not numpy.allclose(shapes[0].z, expectedz):
+        raise ValueError("Expected Z coordinates %s; found %s" % \
+                         (str(expectedz), str(shapes[0].z)))
+    records = sfreader.records()
+    if len(records) != 1:
+        raise ValueError("Expected one set of records; found %d" % len(records))
+    if not numpy.allclose(records[0], vals):
+        raise ValueError("Expected record values %s; found %s" % \
+                         (str(vals), str(records[0])))
+    del expectedxy, expectedz, sfreader, shapes, records
+    os.remove("%s.dbf" % shapefilename)
+    os.remove("%s.shp" % shapefilename)
+    os.remove("%s.shx" % shapefilename)
+    os.remove("%s.prj" % shapefilename)
+
+    print "addquadxyvalues: SUCCESS"
+
diff --git a/pyfermod/fershp/mapprj.py b/pyfermod/fershp/mapprj.py
new file mode 100644
index 0000000..a5a5abd
--- /dev/null
+++ b/pyfermod/fershp/mapprj.py
@@ -0,0 +1,2712 @@
+"""
+Map projection file utility functions
+"""
+
+def name_to_descript(mapprj_name):
+    """
+    Returns the map projection file contents of the given common name
+    (case insensitive).  Raises a ValueError is the common name is unknown.
+    """
+    # get the dictionary key from the given name
+    prjname = mapprj_name.upper()
+    # get the description (None returned if not present)
+    descript = _DESCRIPT_DICT.get(prjname)
+    if not descript:
+        raise ValueError('Unknown map projection name "%s"' % mapprj_name)
+    return descript
+
+
+_DESCRIPT_DICT = {
+    'ADINDAN':
+        'GEOGCS["Adindan",DATUM["Adindan",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ADINDAN / UTM ZONE 37N':
+        'PROJCS["Adindan / UTM zone 37N",GEOGCS["Adindan",DATUM["Adindan",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ADINDAN / UTM ZONE 38N':
+        'PROJCS["Adindan / UTM zone 38N",GEOGCS["Adindan",DATUM["Adindan",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AFGOOYE':
+        'GEOGCS["Afgooye",DATUM["Afgooye",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'AFGOOYE / UTM ZONE 38N':
+        'PROJCS["Afgooye / UTM zone 38N",GEOGCS["Afgooye",DATUM["Afgooye",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AFGOOYE / UTM ZONE 39N':
+        'PROJCS["Afgooye / UTM zone 39N",GEOGCS["Afgooye",DATUM["Afgooye",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AGADEZ':
+        'GEOGCS["Agadez",DATUM["Agadez",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'AGD66':
+        'GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'AGD66 / AMG ZONE 48':
+        'PROJCS["AGD66 / AMG zone 48",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 49':
+        'PROJCS["AGD66 / AMG zone 49",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 50':
+        'PROJCS["AGD66 / AMG zone 50",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 51':
+        'PROJCS["AGD66 / AMG zone 51",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 52':
+        'PROJCS["AGD66 / AMG zone 52",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 53':
+        'PROJCS["AGD66 / AMG zone 53",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 54':
+        'PROJCS["AGD66 / AMG zone 54",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 55':
+        'PROJCS["AGD66 / AMG zone 55",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 56':
+        'PROJCS["AGD66 / AMG zone 56",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 57':
+        'PROJCS["AGD66 / AMG zone 57",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD66 / AMG ZONE 58':
+        'PROJCS["AGD66 / AMG zone 58",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84':
+        'GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'AGD84 / AMG ZONE 48':
+        'PROJCS["AGD84 / AMG zone 48",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 49':
+        'PROJCS["AGD84 / AMG zone 49",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 50':
+        'PROJCS["AGD84 / AMG zone 50",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 51':
+        'PROJCS["AGD84 / AMG zone 51",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 52':
+        'PROJCS["AGD84 / AMG zone 52",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 53':
+        'PROJCS["AGD84 / AMG zone 53",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 54':
+        'PROJCS["AGD84 / AMG zone 54",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 55':
+        'PROJCS["AGD84 / AMG zone 55",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 56':
+        'PROJCS["AGD84 / AMG zone 56",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 57':
+        'PROJCS["AGD84 / AMG zone 57",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AGD84 / AMG ZONE 58':
+        'PROJCS["AGD84 / AMG zone 58",GEOGCS["AGD84",DATUM["Australian_Geodetic_Datum_1984",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'AIN EL ABD':
+        'GEOGCS["Ain el Abd",DATUM["Ain_el_Abd_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'AIN EL ABD / BAHRAIN GRID':
+        'PROJCS["Ain el Abd / Bahrain Grid",GEOGCS["Ain el Abd",DATUM["Ain_el_Abd_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AIN EL ABD / UTM ZONE 37N':
+        'PROJCS["Ain el Abd / UTM zone 37N",GEOGCS["Ain el Abd",DATUM["Ain_el_Abd_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AIN EL ABD / UTM ZONE 38N':
+        'PROJCS["Ain el Abd / UTM zone 38N",GEOGCS["Ain el Abd",DATUM["Ain_el_Abd_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AIN EL ABD / UTM ZONE 39N':
+        'PROJCS["Ain el Abd / UTM zone 39N",GEOGCS["Ain el Abd",DATUM["Ain_el_Abd_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'AMERSFOORT':
+        'GEOGCS["Amersfoort",DATUM["Amersfoort",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ARATU':
+        'GEOGCS["Aratu",DATUM["Aratu",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ARATU / UTM ZONE 22S':
+        'PROJCS["Aratu / UTM zone 22S",GEOGCS["Aratu",DATUM["Aratu",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARATU / UTM ZONE 23S':
+        'PROJCS["Aratu / UTM zone 23S",GEOGCS["Aratu",DATUM["Aratu",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARATU / UTM ZONE 24S':
+        'PROJCS["Aratu / UTM zone 24S",GEOGCS["Aratu",DATUM["Aratu",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1950':
+        'GEOGCS["Arc 1950",DATUM["Arc_1950",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ARC 1950 / UTM ZONE 34S':
+        'PROJCS["Arc 1950 / UTM zone 34S",GEOGCS["Arc 1950",DATUM["Arc_1950",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1950 / UTM ZONE 35S':
+        'PROJCS["Arc 1950 / UTM zone 35S",GEOGCS["Arc 1950",DATUM["Arc_1950",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1950 / UTM ZONE 36S':
+        'PROJCS["Arc 1950 / UTM zone 36S",GEOGCS["Arc 1950",DATUM["Arc_1950",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1960':
+        'GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ARC 1960 / UTM ZONE 35N':
+        'PROJCS["Arc 1960 / UTM zone 35N",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ARC 1960 / UTM ZONE 35S':
+        'PROJCS["Arc 1960 / UTM zone 35S",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1960 / UTM ZONE 36N':
+        'PROJCS["Arc 1960 / UTM zone 36N",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ARC 1960 / UTM ZONE 36S':
+        'PROJCS["Arc 1960 / UTM zone 36S",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ARC 1960 / UTM ZONE 37N':
+        'PROJCS["Arc 1960 / UTM zone 37N",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ARC 1960 / UTM ZONE 37S':
+        'PROJCS["Arc 1960 / UTM zone 37S",GEOGCS["Arc 1960",DATUM["Arc_1960",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ATF (PARIS)':
+        'GEOGCS["ATF (Paris)",DATUM["Ancienne_Triangulation_Francaise",SPHEROID["Plessis 1817",6376523,308.64]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'ATF (PARIS) / NORD DE GUERRE':
+        'PROJCS["ATF (Paris) / Nord de Guerre",GEOGCS["ATF (Paris)",DATUM["Ancienne_Triangulation_Francaise",SPHEROID["Plessis 1817",6376523,308.64]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",55],PARAMETER["central_meridian",6],PARAMETER["scale_factor",0.99950908],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'ATS77':
+        'GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ATS77 / MTM NOVA SCOTIA ZONE 4':
+        'PROJCS["ATS77 / MTM Nova Scotia zone 4",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",61.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ATS77 / MTM NOVA SCOTIA ZONE 5':
+        'PROJCS["ATS77 / MTM Nova Scotia zone 5",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",64.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ATS77 / NEW BRUNSWICK STEREOGRAPHIC':
+        'PROJCS["ATS77 / New Brunswick Stereographic",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",-66.5],PARAMETER["scale_factor",0.999912],PARAMETER["false_easting",300000],PARAMETER["false_northing",800000],UNIT["metre",1]]',
+    'ATS77 / PRINCE EDWARD ISL. STEREOGRAPHIC':
+        'PROJCS["ATS77 / Prince Edward Isl. Stereographic",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",47.25],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.999912],PARAMETER["false_easting",700000],PARAMETER["false_northing",400000],UNIT["metre",1]]',
+    'ATS77 / UTM ZONE 19N':
+        'PROJCS["ATS77 / UTM zone 19N",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ATS77 / UTM ZONE 20N':
+        'PROJCS["ATS77 / UTM zone 20N",GEOGCS["ATS77",DATUM["Average_Terrestrial_System_1977",SPHEROID["Average Terrestrial System 1977",6378135,298.257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BARBADOS':
+        'GEOGCS["Barbados",DATUM["Barbados",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BATAVIA':
+        'GEOGCS["Batavia",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BATAVIA (JAKARTA)':
+        'GEOGCS["Batavia (Jakarta)",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Jakarta",106.807719444444],UNIT["degree",0.0174532925199433]]',
+    'BATAVIA (JAKARTA) / NEIEZ':
+        'PROJCS["Batavia (Jakarta) / NEIEZ",GEOGCS["Batavia (Jakarta)",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Jakarta",106.807719444444],UNIT["degree",0.0174532925199433]],PROJECTION["Mercator_1SP"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",110],PARAMETER["scale_factor",0.997],PARAMETER["false_easting",3900000],PARAMETER["false_northing",900000],UNIT["metre",1]]',
+    'BATAVIA / UTM ZONE 48S':
+        'PROJCS["Batavia / UTM zone 48S",GEOGCS["Batavia",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'BATAVIA / UTM ZONE 49S':
+        'PROJCS["Batavia / UTM zone 49S",GEOGCS["Batavia",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'BATAVIA / UTM ZONE 50S':
+        'PROJCS["Batavia / UTM zone 50S",GEOGCS["Batavia",DATUM["Batavia",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'BEDUARAM':
+        'GEOGCS["Beduaram",DATUM["Beduaram",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BEIJING 1954':
+        'GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BEIJING 1954 / GAUSS-KRUGER 13N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 13N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 14N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 14N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 15N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 15N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 16N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 16N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 17N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 17N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 18N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 18N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 19N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 19N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 20N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 20N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 21N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 21N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 22N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 22N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER 23N':
+        'PROJCS["Beijing 1954 / Gauss-Kruger 23N",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 13':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 13",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",13500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 14':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 14",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",14500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 15':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 15",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",15500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 16':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 16",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",16500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 17':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 17",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",17500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 18':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 18",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",18500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 19':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 19",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",19500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 20':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 20",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",20500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 21':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 21",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",21500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 22':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 22",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",22500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BEIJING 1954 / GAUSS-KRUGER ZONE 23':
+        'PROJCS["Beijing 1954 / Gauss-Kruger zone 23",GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",23500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BELGE 1950':
+        'GEOGCS["Belge 1950",DATUM["Reseau_National_Belge_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BELGE 1950 (BRUSSELS)':
+        'GEOGCS["Belge 1950 (Brussels)",DATUM["Reseau_National_Belge_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Brussels",4.367975],UNIT["degree",0.0174532925199433]]',
+    'BELGE 1950 (BRUSSELS) / BELGE LAMBERT 50':
+        'PROJCS["Belge 1950 (Brussels) / Belge Lambert 50",GEOGCS["Belge 1950 (Brussels)",DATUM["Reseau_National_Belge_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Brussels",4.367975],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49.8333333333333],PARAMETER["standard_parallel_2",51.1666666666667],PARAMETER["latitude_of_origin",90],PARAMETER["central_meridian",0],PARAMETER["false_easting",150000],PARAMETER["false_ [...]
+    'BELGE 1972':
+        'GEOGCS["Belge 1972",DATUM["Reseau_National_Belge_1972",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BELGE 1972 / BELGE LAMBERT 72':
+        'PROJCS["Belge 1972 / Belge Lambert 72",GEOGCS["Belge 1972",DATUM["Reseau_National_Belge_1972",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP_Belgium"],PARAMETER["standard_parallel_1",49.8333333333333],PARAMETER["standard_parallel_2",51.1666666666667],PARAMETER["latitude_of_origin",90],PARAMETER["central_meridian",4.35693972222222],PARAMETER["false_easting",150000.01256],PARAMETER["false [...]
+    'BERMUDA 1957':
+        'GEOGCS["Bermuda 1957",DATUM["Bermuda_1957",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BERN 1898':
+        'GEOGCS["Bern 1898",DATUM["Bern_1898",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BERN 1898 (BERN)':
+        'GEOGCS["Bern 1898 (Bern)",DATUM["Bern_1898",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Bern",7.43958333333333],UNIT["degree",0.0174532925199433]]',
+    'BERN 1898 (BERN) / SWISS OLD GRID':
+        'PROJCS["Bern 1898 (Bern) / Swiss Old Grid",GEOGCS["Bern 1898 (Bern)",DATUM["Bern_1898",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Bern",7.43958333333333],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Mercator"],PARAMETER["latitude_of_center",46.9524055555556],PARAMETER["longitude_of_center",0],PARAMETER["azimuth",90],PARAMETER["rectified_grid_angle",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BERN 1898 / SWISS NEW GRID':
+        'PROJCS["Bern 1898 / Swiss New Grid",GEOGCS["Bern 1898",DATUM["Bern_1898",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Mercator"],PARAMETER["latitude_of_center",46.9524055555556],PARAMETER["longitude_of_center",7.43958333333333],PARAMETER["azimuth",90],PARAMETER["rectified_grid_angle",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'BERN 1938':
+        'GEOGCS["Bern 1938",DATUM["Bern_1938",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BOGOTA':
+        'GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'BOGOTA (BOGOTA)':
+        'GEOGCS["Bogota (Bogota)",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Bogota",-74.0809166666667],UNIT["degree",0.0174532925199433]]',
+    'BOGOTA / COLOMBIA BOGOTA ZONE':
+        'PROJCS["Bogota / Colombia Bogota zone",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4.59904722222222],PARAMETER["central_meridian",-74.0809166666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",1000000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'BOGOTA / COLOMBIA EAST':
+        'PROJCS["Bogota / Colombia East",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4.59904722222222],PARAMETER["central_meridian",-68.0809166666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",1000000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'BOGOTA / COLOMBIA EAST CENTRAL ZONE':
+        'PROJCS["Bogota / Colombia East Central zone",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4.59904722222222],PARAMETER["central_meridian",-71.0809166666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",1000000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'BOGOTA / COLOMBIA WEST ZONE':
+        'PROJCS["Bogota / Colombia West zone",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4.59904722222222],PARAMETER["central_meridian",-77.0809166666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",1000000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'BOGOTA / UTM ZONE 17N':
+        'PROJCS["Bogota / UTM zone 17N",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BOGOTA / UTM ZONE 18N':
+        'PROJCS["Bogota / UTM zone 18N",GEOGCS["Bogota",DATUM["Bogota",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'BUKIT RIMPAH':
+        'GEOGCS["Bukit Rimpah",DATUM["Bukit_Rimpah",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CAMACUPA':
+        'GEOGCS["Camacupa",DATUM["Camacupa",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CAMACUPA / TM 11.30 SE':
+        'PROJCS["Camacupa / TM 11.30 SE",GEOGCS["Camacupa",DATUM["Camacupa",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",11.5],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAMACUPA / TM 12 SE':
+        'PROJCS["Camacupa / TM 12 SE",GEOGCS["Camacupa",DATUM["Camacupa",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",12],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAMACUPA / UTM ZONE 32S':
+        'PROJCS["Camacupa / UTM zone 32S",GEOGCS["Camacupa",DATUM["Camacupa",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAMACUPA / UTM ZONE 33S':
+        'PROJCS["Camacupa / UTM zone 33S",GEOGCS["Camacupa",DATUM["Camacupa",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE':
+        'GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CAMPO INCHAUSPE / ARGENTINA 1':
+        'PROJCS["Campo Inchauspe / Argentina 1",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-72],PARAMETER["scale_factor",1],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 2':
+        'PROJCS["Campo Inchauspe / Argentina 2",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",1],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 3':
+        'PROJCS["Campo Inchauspe / Argentina 3",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-66],PARAMETER["scale_factor",1],PARAMETER["false_easting",3500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 4':
+        'PROJCS["Campo Inchauspe / Argentina 4",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",1],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 5':
+        'PROJCS["Campo Inchauspe / Argentina 5",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-60],PARAMETER["scale_factor",1],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 6':
+        'PROJCS["Campo Inchauspe / Argentina 6",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",1],PARAMETER["false_easting",6500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAMPO INCHAUSPE / ARGENTINA 7':
+        'PROJCS["Campo Inchauspe / Argentina 7",GEOGCS["Campo Inchauspe",DATUM["Campo_Inchauspe",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-54],PARAMETER["scale_factor",1],PARAMETER["false_easting",7500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CAPE':
+        'GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CAPE / UTM ZONE 34S':
+        'PROJCS["Cape / UTM zone 34S",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAPE / UTM ZONE 35S':
+        'PROJCS["Cape / UTM zone 35S",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CAPE / UTM ZONE 36S':
+        'PROJCS["Cape / UTM zone 36S",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CARTHAGE':
+        'GEOGCS["Carthage",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CARTHAGE (PARIS)':
+        'GEOGCS["Carthage (Paris)",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'CARTHAGE (PARIS) / TUNISIA MINING GRID':
+        'PROJCS["Carthage (Paris) / Tunisia Mining Grid",GEOGCS["Carthage (Paris)",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Tunisia_Mining_Grid"],PARAMETER["latitude_of_origin",38.81924],PARAMETER["central_meridian",7.84257],PARAMETER["false_easting",270.66603],PARAMETER["false_northing",581.95123],UNIT["kilometre",1000]]',
+    'CARTHAGE / NORD TUNISIE':
+        'PROJCS["Carthage / Nord Tunisie",GEOGCS["Carthage",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",36],PARAMETER["central_meridian",9.9],PARAMETER["scale_factor",0.999625544],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'CARTHAGE / SUD TUNISIE':
+        'PROJCS["Carthage / Sud Tunisie",GEOGCS["Carthage",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",33.3],PARAMETER["central_meridian",9.9],PARAMETER["scale_factor",0.999625769],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'CARTHAGE / UTM ZONE 32N':
+        'PROJCS["Carthage / UTM zone 32N",GEOGCS["Carthage",DATUM["Carthage",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'CHUA':
+        'GEOGCS["Chua",DATUM["Chua",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CONAKRY 1905':
+        'GEOGCS["Conakry 1905",DATUM["Conakry_1905",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CORREGO ALEGRE':
+        'GEOGCS["Corrego Alegre",DATUM["Corrego_Alegre",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'CORREGO ALEGRE / UTM ZONE 23S':
+        'PROJCS["Corrego Alegre / UTM zone 23S",GEOGCS["Corrego Alegre",DATUM["Corrego_Alegre",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'CORREGO ALEGRE / UTM ZONE 24S':
+        'PROJCS["Corrego Alegre / UTM zone 24S",GEOGCS["Corrego Alegre",DATUM["Corrego_Alegre",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    "COTE D'IVOIRE":
+        'GEOGCS["Cote d\'Ivoire",DATUM["Cote_d_Ivoire",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DATUM 73':
+        'GEOGCS["Datum 73",DATUM["Datum_73",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DATUM 73 / UTM ZONE 29N':
+        'PROJCS["Datum 73 / UTM zone 29N",GEOGCS["Datum 73",DATUM["Datum_73",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DEALUL PISCULUI 1933':
+        'GEOGCS["Dealul Piscului 1933",DATUM["Dealul_Piscului_1933",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DEALUL PISCULUI 1933/ STEREO 33':
+        'PROJCS["Dealul Piscului 1933/ Stereo 33",GEOGCS["Dealul Piscului 1933",DATUM["Dealul_Piscului_1933",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",45.9],PARAMETER["central_meridian",25.3924658888889],PARAMETER["scale_factor",0.9996667],PARAMETER["false_easting",500000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'DEALUL PISCULUI 1970':
+        'GEOGCS["Dealul Piscului 1970",DATUM["Dealul_Piscului_1970",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DEALUL PISCULUI 1970/ STEREO 70':
+        'PROJCS["Dealul Piscului 1970/ Stereo 70",GEOGCS["Dealul Piscului 1970",DATUM["Dealul_Piscului_1970",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",46],PARAMETER["central_meridian",25],PARAMETER["scale_factor",0.99975],PARAMETER["false_easting",500000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'DEIR EZ ZOR':
+        'GEOGCS["Deir ez Zor",DATUM["Deir_ez_Zor",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DHDN':
+        'GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DHDN / GERMANY ZONE 1':
+        'PROJCS["DHDN / Germany zone 1",GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",1],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DHDN / GERMANY ZONE 2':
+        'PROJCS["DHDN / Germany zone 2",GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",6],PARAMETER["scale_factor",1],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DHDN / GERMANY ZONE 3':
+        'PROJCS["DHDN / Germany zone 3",GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",1],PARAMETER["false_easting",3500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DHDN / GERMANY ZONE 4':
+        'PROJCS["DHDN / Germany zone 4",GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",12],PARAMETER["scale_factor",1],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DHDN / GERMANY ZONE 5':
+        'PROJCS["DHDN / Germany zone 5",GEOGCS["DHDN",DATUM["Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",1],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'DOUALA':
+        'GEOGCS["Douala",DATUM["Douala",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'DOUALA / UTM ZONE 32N':
+        'PROJCS["Douala / UTM zone 32N",GEOGCS["Douala",DATUM["Douala",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50':
+        'GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ED50 / TM 0 N':
+        'PROJCS["ED50 / TM 0 N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / TM 5 NE':
+        'PROJCS["ED50 / TM 5 NE",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",5],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 28N':
+        'PROJCS["ED50 / UTM zone 28N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 29N':
+        'PROJCS["ED50 / UTM zone 29N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 30N':
+        'PROJCS["ED50 / UTM zone 30N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 31N':
+        'PROJCS["ED50 / UTM zone 31N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 32N':
+        'PROJCS["ED50 / UTM zone 32N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 33N':
+        'PROJCS["ED50 / UTM zone 33N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 34N':
+        'PROJCS["ED50 / UTM zone 34N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 35N':
+        'PROJCS["ED50 / UTM zone 35N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 36N':
+        'PROJCS["ED50 / UTM zone 36N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 37N':
+        'PROJCS["ED50 / UTM zone 37N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED50 / UTM ZONE 38N':
+        'PROJCS["ED50 / UTM zone 38N",GEOGCS["ED50",DATUM["European_Datum_1950",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ED87':
+        'GEOGCS["ED87",DATUM["European_Datum_1987",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'EGYPT 1907':
+        'GEOGCS["Egypt 1907",DATUM["Egypt_1907",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'EGYPT 1907 / EXTENDED PURPLE BELT':
+        'PROJCS["Egypt 1907 / Extended Purple Belt",GEOGCS["Egypt 1907",DATUM["Egypt_1907",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",700000],PARAMETER["false_northing",1200000],UNIT["metre",1]]',
+    'EGYPT 1907 / PURPLE BELT':
+        'PROJCS["Egypt 1907 / Purple Belt",GEOGCS["Egypt 1907",DATUM["Egypt_1907",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",700000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'EGYPT 1907 / RED BELT':
+        'PROJCS["Egypt 1907 / Red Belt",GEOGCS["Egypt 1907",DATUM["Egypt_1907",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",31],PARAMETER["scale_factor",1],PARAMETER["false_easting",615000],PARAMETER["false_northing",810000],UNIT["metre",1]]',
+    'ETRS89':
+        'GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ETRS89 / UTM ZONE 28N':
+        'PROJCS["ETRS89 / UTM zone 28N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 29N':
+        'PROJCS["ETRS89 / UTM zone 29N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 30N':
+        'PROJCS["ETRS89 / UTM zone 30N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 31N':
+        'PROJCS["ETRS89 / UTM zone 31N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 32N':
+        'PROJCS["ETRS89 / UTM zone 32N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 33N':
+        'PROJCS["ETRS89 / UTM zone 33N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 34N':
+        'PROJCS["ETRS89 / UTM zone 34N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 35N':
+        'PROJCS["ETRS89 / UTM zone 35N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 36N':
+        'PROJCS["ETRS89 / UTM zone 36N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 37N':
+        'PROJCS["ETRS89 / UTM zone 37N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ETRS89 / UTM ZONE 38N':
+        'PROJCS["ETRS89 / UTM zone 38N",GEOGCS["ETRS89",DATUM["European_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'FAHUD':
+        'GEOGCS["Fahud",DATUM["Fahud",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'FAHUD / UTM ZONE 39N':
+        'PROJCS["Fahud / UTM zone 39N",GEOGCS["Fahud",DATUM["Fahud",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'FAHUD / UTM ZONE 40N':
+        'PROJCS["Fahud / UTM zone 40N",GEOGCS["Fahud",DATUM["Fahud",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'FD58':
+        'GEOGCS["FD58",DATUM["Final_Datum_1958",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'FD58 / IRAQ ZONE':
+        'PROJCS["FD58 / Iraq zone",GEOGCS["FD58",DATUM["Final_Datum_1958",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",32.5],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",1500000],PARAMETER["false_northing",1166200],UNIT["metre",1]]',
+    'GANDAJIKA 1970':
+        'GEOGCS["Gandajika 1970",DATUM["Gandajika_1970",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GAROUA':
+        'GEOGCS["Garoua",DATUM["Garoua",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GAROUA / UTM ZONE 33N':
+        'PROJCS["Garoua / UTM zone 33N",GEOGCS["Garoua",DATUM["Garoua",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'GD49':
+        'GEOGCS["GD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GD49 / NEW ZEALAND MAP GRID':
+        'PROJCS["GD49 / New Zealand Map Grid",GEOGCS["GD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["New_Zealand_Map_Grid"],PARAMETER["latitude_of_origin",-41],PARAMETER["central_meridian",173],PARAMETER["false_easting",2510000],PARAMETER["false_northing",6023150],UNIT["metre",1]]',
+    'GD49 / NORTH ISLAND GRID':
+        'PROJCS["GD49 / North Island Grid",GEOGCS["GD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-39],PARAMETER["central_meridian",175.5],PARAMETER["scale_factor",1],PARAMETER["false_easting",300000],PARAMETER["false_northing",400000],UNIT["yard (Sears)",0.914398414616029]]',
+    'GD49 / SOUTH ISLAND GRID':
+        'PROJCS["GD49 / South Island Grid",GEOGCS["GD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-44],PARAMETER["central_meridian",171.5],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",500000],UNIT["yard (Sears)",0.914398414616029]]',
+    'GDA94':
+        'GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GDA94 / MGA ZONE 48':
+        'PROJCS["GDA94 / MGA zone 48",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 49':
+        'PROJCS["GDA94 / MGA zone 49",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 50':
+        'PROJCS["GDA94 / MGA zone 50",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 51':
+        'PROJCS["GDA94 / MGA zone 51",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 52':
+        'PROJCS["GDA94 / MGA zone 52",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 53':
+        'PROJCS["GDA94 / MGA zone 53",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 54':
+        'PROJCS["GDA94 / MGA zone 54",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 55':
+        'PROJCS["GDA94 / MGA zone 55",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 56':
+        'PROJCS["GDA94 / MGA zone 56",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 57':
+        'PROJCS["GDA94 / MGA zone 57",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GDA94 / MGA ZONE 58':
+        'PROJCS["GDA94 / MGA zone 58",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'GGRS87':
+        'GEOGCS["GGRS87",DATUM["Greek_Geodetic_Reference_System_1987",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GGRS87 / GREEK GRID':
+        'PROJCS["GGRS87 / Greek Grid",GEOGCS["GGRS87",DATUM["Greek_Geodetic_Reference_System_1987",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'GREEK':
+        'GEOGCS["Greek",DATUM["Greek",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'GREEK (ATHENS)':
+        'GEOGCS["Greek (Athens)",DATUM["Greek",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Athens",23.7163375],UNIT["degree",0.0174532925199433]]',
+    'GUYANE FRANCAISE':
+        'GEOGCS["Guyane Francaise",DATUM["Guyane_Francaise",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'HD72':
+        'GEOGCS["HD72",DATUM["Hungarian_Datum_1972",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'HD72 / EOV':
+        'PROJCS["HD72 / EOV",GEOGCS["HD72",DATUM["Hungarian_Datum_1972",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Mercator"],PARAMETER["latitude_of_center",47.1443937222222],PARAMETER["longitude_of_center",19.0485717777778],PARAMETER["azimuth",90],PARAMETER["rectified_grid_angle",90],PARAMETER["scale_factor",0.99993],PARAMETER["false_easting",650000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'HERAT NORTH':
+        'GEOGCS["Herat North",DATUM["Herat_North",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'HITO XVIII 1963':
+        'GEOGCS["Hito XVIII 1963",DATUM["Hito_XVIII_1963",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'HU TZU SHAN':
+        'GEOGCS["Hu Tzu Shan",DATUM["Hu_Tzu_Shan",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ID74':
+        'GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ID74 / UTM ZONE 46N':
+        'PROJCS["ID74 / UTM zone 46N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 46S':
+        'PROJCS["ID74 / UTM zone 46S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 47N':
+        'PROJCS["ID74 / UTM zone 47N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 47S':
+        'PROJCS["ID74 / UTM zone 47S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 48N':
+        'PROJCS["ID74 / UTM zone 48N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 48S':
+        'PROJCS["ID74 / UTM zone 48S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 49N':
+        'PROJCS["ID74 / UTM zone 49N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 49S':
+        'PROJCS["ID74 / UTM zone 49S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 50N':
+        'PROJCS["ID74 / UTM zone 50N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 50S':
+        'PROJCS["ID74 / UTM zone 50S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 51N':
+        'PROJCS["ID74 / UTM zone 51N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 51S':
+        'PROJCS["ID74 / UTM zone 51S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 52N':
+        'PROJCS["ID74 / UTM zone 52N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 52S':
+        'PROJCS["ID74 / UTM zone 52S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 53N':
+        'PROJCS["ID74 / UTM zone 53N",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 53S':
+        'PROJCS["ID74 / UTM zone 53S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'ID74 / UTM ZONE 54S':
+        'PROJCS["ID74 / UTM zone 54S",GEOGCS["ID74",DATUM["Indonesian_Datum_1974",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'INDIAN 1954':
+        'GEOGCS["Indian 1954",DATUM["Indian_1954",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'INDIAN 1954 / UTM ZONE 46N':
+        'PROJCS["Indian 1954 / UTM zone 46N",GEOGCS["Indian 1954",DATUM["Indian_1954",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1954 / UTM ZONE 47N':
+        'PROJCS["Indian 1954 / UTM zone 47N",GEOGCS["Indian 1954",DATUM["Indian_1954",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1954 / UTM ZONE 48N':
+        'PROJCS["Indian 1954 / UTM zone 48N",GEOGCS["Indian 1954",DATUM["Indian_1954",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1960':
+        'GEOGCS["Indian 1960",DATUM["Indian_1960",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'INDIAN 1960 / TM 106 NE':
+        'PROJCS["Indian 1960 / TM 106 NE",GEOGCS["Indian 1960",DATUM["Indian_1960",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",106],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1960 / UTM ZONE 48N':
+        'PROJCS["Indian 1960 / UTM zone 48N",GEOGCS["Indian 1960",DATUM["Indian_1960",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1960 / UTM ZONE 49N':
+        'PROJCS["Indian 1960 / UTM zone 49N",GEOGCS["Indian 1960",DATUM["Indian_1960",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1975':
+        'GEOGCS["Indian 1975",DATUM["Indian_1975",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'INDIAN 1975 / UTM ZONE 47N':
+        'PROJCS["Indian 1975 / UTM zone 47N",GEOGCS["Indian 1975",DATUM["Indian_1975",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'INDIAN 1975 / UTM ZONE 48N':
+        'PROJCS["Indian 1975 / UTM zone 48N",GEOGCS["Indian 1975",DATUM["Indian_1975",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'JAD69':
+        'GEOGCS["JAD69",DATUM["Jamaica_1969",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'JAD69 / JAMAICA NATIONAL GRID':
+        'PROJCS["JAD69 / Jamaica National Grid",GEOGCS["JAD69",DATUM["Jamaica_1969",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",18],PARAMETER["central_meridian",-77],PARAMETER["scale_factor",1],PARAMETER["false_easting",250000],PARAMETER["false_northing",150000],UNIT["metre",1]]',
+    'JAMAICA 1875':
+        'GEOGCS["Jamaica 1875",DATUM["Jamaica_1875",SPHEROID["Clarke 1880",6378249.13884613,293.466307655625]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'JAMAICA 1875 / JAMAICA (OLD GRID)':
+        'PROJCS["Jamaica 1875 / Jamaica (Old Grid)",GEOGCS["Jamaica 1875",DATUM["Jamaica_1875",SPHEROID["Clarke 1880",6378249.13884613,293.466307655625]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",18],PARAMETER["central_meridian",-77],PARAMETER["scale_factor",1],PARAMETER["false_easting",550000],PARAMETER["false_northing",400000],UNIT["Clarke\'s foot",0.3047972651151]]',
+    'KALIANPUR':
+        'GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KALIANPUR / INDIA ZONE 0':
+        'PROJCS["Kalianpur / India zone 0",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",39.5],PARAMETER["central_meridian",68],PARAMETER["scale_factor",0.998461538461539],PARAMETER["false_easting",2355500],PARAMETER["false_northing",2590000],UNIT["Indian yard",0.914398553970127]]',
+    'KALIANPUR / INDIA ZONE I':
+        'PROJCS["Kalianpur / India zone I",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",32.5],PARAMETER["central_meridian",68],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",3000000],PARAMETER["false_northing",1000000],UNIT["Indian yard",0.914398553970127]]',
+    'KALIANPUR / INDIA ZONE IIA':
+        'PROJCS["Kalianpur / India zone IIa",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",26],PARAMETER["central_meridian",74],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",3000000],PARAMETER["false_northing",1000000],UNIT["Indian yard",0.914398553970127]]',
+    'KALIANPUR / INDIA ZONE IIB':
+        'PROJCS["Kalianpur / India zone IIb",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",26],PARAMETER["central_meridian",90],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",3000000],PARAMETER["false_northing",1000000],UNIT["Indian yard",0.914398553970127]]',
+    'KALIANPUR / INDIA ZONE IIIA':
+        'PROJCS["Kalianpur / India zone IIIa",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",19],PARAMETER["central_meridian",80],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",3000000],PARAMETER["false_northing",1000000],UNIT["Indian yard",0.914398553970127]]',
+    'KALIANPUR / INDIA ZONE IVA':
+        'PROJCS["Kalianpur / India zone IVa",GEOGCS["Kalianpur",DATUM["Kalianpur",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",12],PARAMETER["central_meridian",80],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",3000000],PARAMETER["false_northing",1000000],UNIT["Indian yard",0.914398553970127]]',
+    'KANDAWALA':
+        'GEOGCS["Kandawala",DATUM["Kandawala",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KERTAU':
+        'GEOGCS["Kertau",DATUM["Kertau",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KERTAU / R.S.O. MALAYA (CH)':
+        'PROJCS["Kertau / R.S.O. Malaya (ch)",GEOGCS["Kertau",DATUM["Kertau",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",4],PARAMETER["longitude_of_center",102.25],PARAMETER["azimuth",323.0257905],PARAMETER["rectified_grid_angle",323.130102361111],PARAMETER["scale_factor",0.99984],PARAMETER["false_easting",40000],PARAMETER["false_northing",0],UNIT["cha [...]
+    'KERTAU / SINGAPORE GRID':
+        'PROJCS["Kertau / Singapore Grid",GEOGCS["Kertau",DATUM["Kertau",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Cassini_Soldner"],PARAMETER["latitude_of_origin",1.28764666666667],PARAMETER["central_meridian",103.853002222222],PARAMETER["false_easting",30000],PARAMETER["false_northing",30000],UNIT["metre",1]]',
+    'KERTAU / UTM ZONE 47N':
+        'PROJCS["Kertau / UTM zone 47N",GEOGCS["Kertau",DATUM["Kertau",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KERTAU / UTM ZONE 48N':
+        'PROJCS["Kertau / UTM zone 48N",GEOGCS["Kertau",DATUM["Kertau",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KKJ':
+        'GEOGCS["KKJ",DATUM["Kartastokoordinaattijarjestelma",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KKJ / FINLAND UNIFORM COORDINATE SYSTEM':
+        'PROJCS["KKJ / Finland Uniform Coordinate System",GEOGCS["KKJ",DATUM["Kartastokoordinaattijarjestelma",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",3500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KKJ / FINLAND ZONE 1':
+        'PROJCS["KKJ / Finland zone 1",GEOGCS["KKJ",DATUM["Kartastokoordinaattijarjestelma",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KKJ / FINLAND ZONE 2':
+        'PROJCS["KKJ / Finland zone 2",GEOGCS["KKJ",DATUM["Kartastokoordinaattijarjestelma",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",24],PARAMETER["scale_factor",1],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KKJ / FINLAND ZONE 4':
+        'PROJCS["KKJ / Finland zone 4",GEOGCS["KKJ",DATUM["Kartastokoordinaattijarjestelma",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",30],PARAMETER["scale_factor",1],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'KOC':
+        'GEOGCS["KOC",DATUM["Kuwait_Oil_Company",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KOC LAMBERT':
+        'PROJCS["KOC Lambert",GEOGCS["KOC",DATUM["Kuwait_Oil_Company",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",32.5],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.99878640776699],PARAMETER["false_easting",1500000],PARAMETER["false_northing",1166200],UNIT["metre",1]]',
+    'KUDAMS':
+        'GEOGCS["KUDAMS",DATUM["Kuwait_Utility",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'KUDAMS / KTM':
+        'PROJCS["KUDAMS / KTM",GEOGCS["KUDAMS",DATUM["Kuwait_Utility",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",48],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LA CANOA':
+        'GEOGCS["La Canoa",DATUM["La_Canoa",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LA CANOA / UTM ZONE 20N':
+        'PROJCS["La Canoa / UTM zone 20N",GEOGCS["La Canoa",DATUM["La_Canoa",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LA CANOA / UTM ZONE 21N':
+        'PROJCS["La Canoa / UTM zone 21N",GEOGCS["La Canoa",DATUM["La_Canoa",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LAKE':
+        'GEOGCS["Lake",DATUM["Lake",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LEIGON':
+        'GEOGCS["Leigon",DATUM["Leigon",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LEIGON / GHANA METRE GRID':
+        'PROJCS["Leigon / Ghana Metre Grid",GEOGCS["Leigon",DATUM["Leigon",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4.66666666666667],PARAMETER["central_meridian",-1],PARAMETER["scale_factor",0.99975],PARAMETER["false_easting",274319.51],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LIBERIA 1964':
+        'GEOGCS["Liberia 1964",DATUM["Liberia_1964",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LIETUVOS KOORDINOEI SISTEMA 1994':
+        'PROJCS["Lietuvos Koordinoei Sistema 1994",GEOGCS["LKS94 (ETRS89)",DATUM["Lithuania_1994_ETRS89",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",24],PARAMETER["scale_factor",0.9998],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LISBON':
+        'GEOGCS["Lisbon",DATUM["Lisbon",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LISBON (LISBON)':
+        'GEOGCS["Lisbon (Lisbon)",DATUM["Lisbon",SPHEROID["International 1924",6378388,297]],PRIMEM["Lisbon",-9.13190611111111],UNIT["degree",0.0174532925199433]]',
+    'LISBON (LISBON)/PORTUGUESE NATIONAL GRID':
+        'PROJCS["Lisbon (Lisbon)/Portuguese National Grid",GEOGCS["Lisbon (Lisbon)",DATUM["Lisbon",SPHEROID["International 1924",6378388,297]],PRIMEM["Lisbon",-9.13190611111111],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",39.6666666666667],PARAMETER["central_meridian",1],PARAMETER["scale_factor",1],PARAMETER["false_easting",200000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'LKS94 (ETRS89)':
+        'GEOGCS["LKS94 (ETRS89)",DATUM["Lithuania_1994_ETRS89",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LOMA QUINTANA':
+        'GEOGCS["Loma Quintana",DATUM["Loma_Quintana",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LOME':
+        'GEOGCS["Lome",DATUM["Lome",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LOME / UTM ZONE 31N':
+        'PROJCS["Lome / UTM zone 31N",GEOGCS["Lome",DATUM["Lome",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LUZON 1911':
+        'GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'LUZON 1911 / PHILIPPINES ZONE I':
+        'PROJCS["Luzon 1911 / Philippines zone I",GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LUZON 1911 / PHILIPPINES ZONE II':
+        'PROJCS["Luzon 1911 / Philippines zone II",GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",119],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LUZON 1911 / PHILIPPINES ZONE III':
+        'PROJCS["Luzon 1911 / Philippines zone III",GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",121],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LUZON 1911 / PHILIPPINES ZONE IV':
+        'PROJCS["Luzon 1911 / Philippines zone IV",GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'LUZON 1911 / PHILIPPINES ZONE V':
+        'PROJCS["Luzon 1911 / Philippines zone V",GEOGCS["Luzon 1911",DATUM["Luzon_1911",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",125],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    "M'PORALOKO":
+        'GEOGCS["M\'poraloko",DATUM["M_poraloko",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    "M'PORALOKO / UTM ZONE 32N":
+        'PROJCS["M\'poraloko / UTM zone 32N",GEOGCS["M\'poraloko",DATUM["M_poraloko",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    "M'PORALOKO / UTM ZONE 32S":
+        'PROJCS["M\'poraloko / UTM zone 32S",GEOGCS["M\'poraloko",DATUM["M_poraloko",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'MADRID 1870 (MADRID)':
+        'GEOGCS["Madrid 1870 (Madrid)",DATUM["Madrid_1870",SPHEROID["Struve 1860",6378298.3,294.73]],PRIMEM["Madrid",-3.68793888888889],UNIT["degree",0.0174532925199433]]',
+    'MADRID 1870 (MADRID) / SPAIN':
+        'PROJCS["Madrid 1870 (Madrid) / Spain",GEOGCS["Madrid 1870 (Madrid)",DATUM["Madrid_1870",SPHEROID["Struve 1860",6378298.3,294.73]],PRIMEM["Madrid",-3.68793888888889],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.9988085293],PARAMETER["false_easting",600000],PARAMETER["false_northing",600000],UNIT["metre",1]]',
+    'MADZANSUA':
+        'GEOGCS["Madzansua",DATUM["Madzansua",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MAHE 1971':
+        'GEOGCS["Mahe 1971",DATUM["Mahe_1971",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MAKASSAR':
+        'GEOGCS["Makassar",DATUM["Makassar",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MAKASSAR (JAKARTA)':
+        'GEOGCS["Makassar (Jakarta)",DATUM["Makassar",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Jakarta",106.807719444444],UNIT["degree",0.0174532925199433]]',
+    'MAKASSAR (JAKARTA) / NEIEZ':
+        'PROJCS["Makassar (Jakarta) / NEIEZ",GEOGCS["Makassar (Jakarta)",DATUM["Makassar",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Jakarta",106.807719444444],UNIT["degree",0.0174532925199433]],PROJECTION["Mercator_1SP"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",110],PARAMETER["scale_factor",0.997],PARAMETER["false_easting",3900000],PARAMETER["false_northing",900000],UNIT["metre",1]]',
+    'MALONGO 1987':
+        'GEOGCS["Malongo 1987",DATUM["Malongo_1987",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MALONGO 1987 / UTM ZONE 32S':
+        'PROJCS["Malongo 1987 / UTM zone 32S",GEOGCS["Malongo 1987",DATUM["Malongo_1987",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'MANOCA':
+        'GEOGCS["Manoca",DATUM["Manoca",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MASSAWA':
+        'GEOGCS["Massawa",DATUM["Massawa",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MASSAWA / UTM ZONE 37N':
+        'PROJCS["Massawa / UTM zone 37N",GEOGCS["Massawa",DATUM["Massawa",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MERCHICH':
+        'GEOGCS["Merchich",DATUM["Merchich",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MERCHICH / NORD MAROC':
+        'PROJCS["Merchich / Nord Maroc",GEOGCS["Merchich",DATUM["Merchich",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",33.3],PARAMETER["central_meridian",-5.4],PARAMETER["scale_factor",0.999625769],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'MERCHICH / SAHARA':
+        'PROJCS["Merchich / Sahara",GEOGCS["Merchich",DATUM["Merchich",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",26.1],PARAMETER["central_meridian",-5.4],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1200000],PARAMETER["false_northing",400000],UNIT["metre",1]]',
+    'MERCHICH / SUD MAROC':
+        'PROJCS["Merchich / Sud Maroc",GEOGCS["Merchich",DATUM["Merchich",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",29.7],PARAMETER["central_meridian",-5.4],PARAMETER["scale_factor",0.999615596],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'MGI':
+        'GEOGCS["MGI",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MGI (FERRO)':
+        'GEOGCS["MGI (Ferro)",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Ferro",-17.6666666666667],UNIT["degree",0.0174532925199433]]',
+    'MGI (FERRO) / AUSTRIA CENTRAL ZONE':
+        'PROJCS["MGI (Ferro) / Austria Central Zone",GEOGCS["MGI (Ferro)",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Ferro",-17.6666666666667],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",31],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MGI (FERRO) / AUSTRIA EAST ZONE':
+        'PROJCS["MGI (Ferro) / Austria East Zone",GEOGCS["MGI (Ferro)",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Ferro",-17.6666666666667],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",34],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MGI (FERRO) / AUSTRIA WEST ZONE':
+        'PROJCS["MGI (Ferro) / Austria West Zone",GEOGCS["MGI (Ferro)",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Ferro",-17.6666666666667],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",28],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MHAST':
+        'GEOGCS["Mhast",DATUM["Mhast",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MHAST / UTM ZONE 32S':
+        'PROJCS["Mhast / UTM zone 32S",GEOGCS["Mhast",DATUM["Mhast",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'MINNA':
+        'GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MINNA / NIGERIA EAST BELT':
+        'PROJCS["Minna / Nigeria East Belt",GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4],PARAMETER["central_meridian",12.5],PARAMETER["scale_factor",0.99975],PARAMETER["false_easting",1110369.7],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MINNA / NIGERIA MID BELT':
+        'PROJCS["Minna / Nigeria Mid Belt",GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4],PARAMETER["central_meridian",8.5],PARAMETER["scale_factor",0.99975],PARAMETER["false_easting",670553.98],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MINNA / NIGERIA WEST BELT':
+        'PROJCS["Minna / Nigeria West Belt",GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",4],PARAMETER["central_meridian",4.5],PARAMETER["scale_factor",0.99975],PARAMETER["false_easting",230738.26],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MINNA / UTM ZONE 31N':
+        'PROJCS["Minna / UTM zone 31N",GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MINNA / UTM ZONE 32N':
+        'PROJCS["Minna / UTM zone 32N",GEOGCS["Minna",DATUM["Minna",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MONTE MARIO':
+        'GEOGCS["Monte Mario",DATUM["Monte_Mario",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MONTE MARIO (ROME)':
+        'GEOGCS["Monte Mario (Rome)",DATUM["Monte_Mario",SPHEROID["International 1924",6378388,297]],PRIMEM["Rome",12.4523333333333],UNIT["degree",0.0174532925199433]]',
+    'MONTE MARIO (ROME) / ITALY ZONE 1':
+        'PROJCS["Monte Mario (Rome) / Italy zone 1",GEOGCS["Monte Mario (Rome)",DATUM["Monte_Mario",SPHEROID["International 1924",6378388,297]],PRIMEM["Rome",12.4523333333333],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MONTE MARIO (ROME) / ITALY ZONE 2':
+        'PROJCS["Monte Mario (Rome) / Italy zone 2",GEOGCS["Monte Mario (Rome)",DATUM["Monte_Mario",SPHEROID["International 1924",6378388,297]],PRIMEM["Rome",12.4523333333333],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",2520000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'MOZNET':
+        'GEOGCS["Moznet",DATUM["Moznet_ITRF94",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'MOZNET / UTM ZONE 36S':
+        'PROJCS["Moznet / UTM zone 36S",GEOGCS["Moznet",DATUM["Moznet_ITRF94",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'MOZNET / UTM ZONE 37S':
+        'PROJCS["Moznet / UTM zone 37S",GEOGCS["Moznet",DATUM["Moznet_ITRF94",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'NAD MICHIGAN / MICHIGAN CENTRAL':
+        'PROJCS["NAD Michigan / Michigan Central",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.1833333333333],PARAMETER["standard_parallel_2",45.7],PARAMETER["latitude_of_origin",43.3166666666667],PARAMETER["central_meridian",-84.3333333333333],PARAMETER["false_easting",2000000],PARAMETER[" [...]
+    'NAD MICHIGAN / MICHIGAN EAST':
+        'PROJCS["NAD Michigan / Michigan East",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-83.6666666666667],PARAMETER["scale_factor",0.999942857],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD MICHIGAN / MICHIGAN NORTH':
+        'PROJCS["NAD Michigan / Michigan North",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.4833333333333],PARAMETER["standard_parallel_2",47.0833333333333],PARAMETER["latitude_of_origin",44.7833333333333],PARAMETER["central_meridian",-87],PARAMETER["false_easting",2000000],PARAMETER["fals [...]
+    'NAD MICHIGAN / MICHIGAN OLD CENTRAL':
+        'PROJCS["NAD Michigan / Michigan Old Central",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-85.75],PARAMETER["scale_factor",0.999909091],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD MICHIGAN / MICHIGAN SOUTH':
+        'PROJCS["NAD Michigan / Michigan South",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.1],PARAMETER["standard_parallel_2",43.6666666666667],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-84.3333333333333],PARAMETER["false_easting",2000000],PARAMETER["false_northing [...]
+    'NAD MICHIGAN / MICHIGAN WEST':
+        'PROJCS["NAD Michigan / Michigan West",GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-88.75],PARAMETER["scale_factor",0.999909091],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27':
+        'GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NAD27 / ALABAMA EAST':
+        'PROJCS["NAD27 / Alabama East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30.5],PARAMETER["central_meridian",-85.8333333333333],PARAMETER["scale_factor",0.99996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALABAMA WEST':
+        'PROJCS["NAD27 / Alabama West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-87.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 1':
+        'PROJCS["NAD27 / Alaska zone 1",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",57],PARAMETER["longitude_of_center",-133.666666666667],PARAMETER["azimuth",323.130102361111],PARAMETER["rectified_grid_angle",323.130102361111],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",16404166.67],PARAMETER [...]
+    'NAD27 / ALASKA ZONE 10':
+        'PROJCS["NAD27 / Alaska zone 10",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",53.8333333333333],PARAMETER["standard_parallel_2",51.8333333333333],PARAMETER["latitude_of_origin",51],PARAMETER["central_meridian",-176],PARAMETER["false_easting",3000000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / ALASKA ZONE 2':
+        'PROJCS["NAD27 / Alaska zone 2",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-142],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 3':
+        'PROJCS["NAD27 / Alaska zone 3",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-146],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 4':
+        'PROJCS["NAD27 / Alaska zone 4",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-150],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 5':
+        'PROJCS["NAD27 / Alaska zone 5",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-154],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 6':
+        'PROJCS["NAD27 / Alaska zone 6",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-158],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 7':
+        'PROJCS["NAD27 / Alaska zone 7",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-162],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",700000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 8':
+        'PROJCS["NAD27 / Alaska zone 8",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-166],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ALASKA ZONE 9':
+        'PROJCS["NAD27 / Alaska zone 9",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-170],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ARIZONA CENTRAL':
+        'PROJCS["NAD27 / Arizona Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-111.916666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ARIZONA EAST':
+        'PROJCS["NAD27 / Arizona East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-110.166666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ARIZONA WEST':
+        'PROJCS["NAD27 / Arizona West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-113.75],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ARKANSAS NORTH':
+        'PROJCS["NAD27 / Arkansas North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.2333333333333],PARAMETER["standard_parallel_2",34.9333333333333],PARAMETER["latitude_of_origin",34.3333333333333],PARAMETER["central_meridian",-92],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNI [...]
+    'NAD27 / ARKANSAS SOUTH':
+        'PROJCS["NAD27 / Arkansas South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.7666666666667],PARAMETER["standard_parallel_2",33.3],PARAMETER["latitude_of_origin",32.6666666666667],PARAMETER["central_meridian",-92],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey [...]
+    'NAD27 / BLM 14N (FEET)':
+        'PROJCS["NAD27 / BLM 14N (feet)",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1640416.67],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / BLM 15N (FEET)':
+        'PROJCS["NAD27 / BLM 15N (feet)",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1640416.67],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / BLM 16N (FEET)':
+        'PROJCS["NAD27 / BLM 16N (feet)",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1640416.67],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / BLM 17N (FEET)':
+        'PROJCS["NAD27 / BLM 17N (feet)",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1640416.67],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / CALIFORNIA ZONE I':
+        'PROJCS["NAD27 / California zone I",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.6666666666667],PARAMETER["standard_parallel_2",40],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-122],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surv [...]
+    'NAD27 / CALIFORNIA ZONE II':
+        'PROJCS["NAD27 / California zone II",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.8333333333333],PARAMETER["standard_parallel_2",38.3333333333333],PARAMETER["latitude_of_origin",37.6666666666667],PARAMETER["central_meridian",-122],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0 [...]
+    'NAD27 / CALIFORNIA ZONE III':
+        'PROJCS["NAD27 / California zone III",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.4333333333333],PARAMETER["standard_parallel_2",37.0666666666667],PARAMETER["latitude_of_origin",36.5],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["U [...]
+    'NAD27 / CALIFORNIA ZONE IV':
+        'PROJCS["NAD27 / California zone IV",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.25],PARAMETER["standard_parallel_2",36],PARAMETER["latitude_of_origin",35.3333333333333],PARAMETER["central_meridian",-119],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0 [...]
+    'NAD27 / CALIFORNIA ZONE V':
+        'PROJCS["NAD27 / California zone V",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35.4666666666667],PARAMETER["standard_parallel_2",34.0333333333333],PARAMETER["latitude_of_origin",33.5],PARAMETER["central_meridian",-118],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US su [...]
+    'NAD27 / CALIFORNIA ZONE VI':
+        'PROJCS["NAD27 / California zone VI",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",33.8833333333333],PARAMETER["standard_parallel_2",32.7833333333333],PARAMETER["latitude_of_origin",32.1666666666667],PARAMETER["central_meridian",-116.25],PARAMETER["false_easting",2000000],PARAMETER["false_northing [...]
+    'NAD27 / CALIFORNIA ZONE VII':
+        'PROJCS["NAD27 / California zone VII",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.4166666666667],PARAMETER["standard_parallel_2",33.8666666666667],PARAMETER["latitude_of_origin",34.1333333333333],PARAMETER["central_meridian",-118.333333333333],PARAMETER["false_easting",4186692.58],PARAMETER[" [...]
+    'NAD27 / COLORADO CENTRAL':
+        'PROJCS["NAD27 / Colorado Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.75],PARAMETER["standard_parallel_2",38.45],PARAMETER["latitude_of_origin",37.8333333333333],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot [...]
+    'NAD27 / COLORADO NORTH':
+        'PROJCS["NAD27 / Colorado North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.7166666666667],PARAMETER["standard_parallel_2",40.7833333333333],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0], [...]
+    'NAD27 / COLORADO SOUTH':
+        'PROJCS["NAD27 / Colorado South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.4333333333333],PARAMETER["standard_parallel_2",37.2333333333333],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0], [...]
+    'NAD27 / CONNECTICUT':
+        'PROJCS["NAD27 / Connecticut",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.8666666666667],PARAMETER["standard_parallel_2",41.2],PARAMETER["latitude_of_origin",40.8333333333333],PARAMETER["central_meridian",-72.75],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / DELAWARE':
+        'PROJCS["NAD27 / Delaware",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38],PARAMETER["central_meridian",-75.4166666666667],PARAMETER["scale_factor",0.999995],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / FLORIDA EAST':
+        'PROJCS["NAD27 / Florida East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",24.3333333333333],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / FLORIDA NORTH':
+        'PROJCS["NAD27 / Florida North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.75],PARAMETER["standard_parallel_2",29.5833333333333],PARAMETER["latitude_of_origin",29],PARAMETER["central_meridian",-84.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304 [...]
+    'NAD27 / FLORIDA WEST':
+        'PROJCS["NAD27 / Florida West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",24.3333333333333],PARAMETER["central_meridian",-82],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / GEORGIA EAST':
+        'PROJCS["NAD27 / Georgia East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-82.1666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / GEORGIA WEST':
+        'PROJCS["NAD27 / Georgia West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-84.1666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / HAWAII ZONE 1':
+        'PROJCS["NAD27 / Hawaii zone 1",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",18.8333333333333],PARAMETER["central_meridian",-155.5],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / HAWAII ZONE 2':
+        'PROJCS["NAD27 / Hawaii zone 2",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",20.3333333333333],PARAMETER["central_meridian",-156.666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / HAWAII ZONE 3':
+        'PROJCS["NAD27 / Hawaii zone 3",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.1666666666667],PARAMETER["central_meridian",-158],PARAMETER["scale_factor",0.99999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / HAWAII ZONE 4':
+        'PROJCS["NAD27 / Hawaii zone 4",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.8333333333333],PARAMETER["central_meridian",-159.5],PARAMETER["scale_factor",0.99999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / HAWAII ZONE 5':
+        'PROJCS["NAD27 / Hawaii zone 5",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.6666666666667],PARAMETER["central_meridian",-160.166666666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / IDAHO CENTRAL':
+        'PROJCS["NAD27 / Idaho Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-114],PARAMETER["scale_factor",0.999947368],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / IDAHO EAST':
+        'PROJCS["NAD27 / Idaho East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-112.166666666667],PARAMETER["scale_factor",0.999947368],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / IDAHO WEST':
+        'PROJCS["NAD27 / Idaho West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-115.75],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ILLINOIS EAST':
+        'PROJCS["NAD27 / Illinois East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-88.3333333333333],PARAMETER["scale_factor",0.999975],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / ILLINOIS WEST':
+        'PROJCS["NAD27 / Illinois West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-90.1666666666667],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / INDIANA EAST':
+        'PROJCS["NAD27 / Indiana East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-85.6666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / INDIANA WEST':
+        'PROJCS["NAD27 / Indiana West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-87.0833333333333],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / IOWA NORTH':
+        'PROJCS["NAD27 / Iowa North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.2666666666667],PARAMETER["standard_parallel_2",42.0666666666667],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-93.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey f [...]
+    'NAD27 / IOWA SOUTH':
+        'PROJCS["NAD27 / Iowa South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.7833333333333],PARAMETER["standard_parallel_2",40.6166666666667],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-93.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foo [...]
+    'NAD27 / KANSAS NORTH':
+        'PROJCS["NAD27 / Kansas North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.7833333333333],PARAMETER["standard_parallel_2",38.7166666666667],PARAMETER["latitude_of_origin",38.3333333333333],PARAMETER["central_meridian",-98],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT[ [...]
+    'NAD27 / KANSAS SOUTH':
+        'PROJCS["NAD27 / Kansas South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.5666666666667],PARAMETER["standard_parallel_2",37.2666666666667],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-98.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNI [...]
+    'NAD27 / KENTUCKY NORTH':
+        'PROJCS["NAD27 / Kentucky North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.9666666666667],PARAMETER["standard_parallel_2",38.9666666666667],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-84.25],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US sur [...]
+    'NAD27 / KENTUCKY SOUTH':
+        'PROJCS["NAD27 / Kentucky South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.7333333333333],PARAMETER["standard_parallel_2",37.9333333333333],PARAMETER["latitude_of_origin",36.3333333333333],PARAMETER["central_meridian",-85.75],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0], [...]
+    'NAD27 / LOUISIANA NORTH':
+        'PROJCS["NAD27 / Louisiana North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",31.1666666666667],PARAMETER["standard_parallel_2",32.6666666666667],PARAMETER["latitude_of_origin",30.6666666666667],PARAMETER["central_meridian",-92.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0], [...]
+    'NAD27 / LOUISIANA SOUTH':
+        'PROJCS["NAD27 / Louisiana South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",29.3],PARAMETER["standard_parallel_2",30.7],PARAMETER["latitude_of_origin",28.6666666666667],PARAMETER["central_meridian",-91.3333333333333],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US sur [...]
+    'NAD27 / MAINE EAST':
+        'PROJCS["NAD27 / Maine East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",43.8333333333333],PARAMETER["central_meridian",-68.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MAINE WEST':
+        'PROJCS["NAD27 / Maine West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.8333333333333],PARAMETER["central_meridian",-70.1666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MARYLAND':
+        'PROJCS["NAD27 / Maryland",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.3],PARAMETER["standard_parallel_2",39.45],PARAMETER["latitude_of_origin",37.8333333333333],PARAMETER["central_meridian",-77],PARAMETER["false_easting",800000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609 [...]
+    'NAD27 / MASSACHUSETTS ISLAND':
+        'PROJCS["NAD27 / Massachusetts Island",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.2833333333333],PARAMETER["standard_parallel_2",41.4833333333333],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-70.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["US s [...]
+    'NAD27 / MASSACHUSETTS MAINLAND':
+        'PROJCS["NAD27 / Massachusetts Mainland",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.7166666666667],PARAMETER["standard_parallel_2",42.6833333333333],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-71.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["US [...]
+    'NAD27 / MINNESOTA CENTRAL':
+        'PROJCS["NAD27 / Minnesota Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.6166666666667],PARAMETER["standard_parallel_2",47.05],PARAMETER["latitude_of_origin",45],PARAMETER["central_meridian",-94.25],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot", [...]
+    'NAD27 / MINNESOTA NORTH':
+        'PROJCS["NAD27 / Minnesota North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.0333333333333],PARAMETER["standard_parallel_2",48.6333333333333],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",-93.1],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US sur [...]
+    'NAD27 / MINNESOTA SOUTH':
+        'PROJCS["NAD27 / Minnesota South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.7833333333333],PARAMETER["standard_parallel_2",45.2166666666667],PARAMETER["latitude_of_origin",43],PARAMETER["central_meridian",-94],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / MISSISSIPPI EAST':
+        'PROJCS["NAD27 / Mississippi East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",29.6666666666667],PARAMETER["central_meridian",-88.8333333333333],PARAMETER["scale_factor",0.99996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MISSISSIPPI WEST':
+        'PROJCS["NAD27 / Mississippi West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30.5],PARAMETER["central_meridian",-90.3333333333333],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MISSOURI CENTRAL':
+        'PROJCS["NAD27 / Missouri Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",35.8333333333333],PARAMETER["central_meridian",-92.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MISSOURI EAST':
+        'PROJCS["NAD27 / Missouri East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",35.8333333333333],PARAMETER["central_meridian",-90.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MISSOURI WEST':
+        'PROJCS["NAD27 / Missouri West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.1666666666667],PARAMETER["central_meridian",-94.5],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / MONTANA CENTRAL':
+        'PROJCS["NAD27 / Montana Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.8833333333333],PARAMETER["standard_parallel_2",46.45],PARAMETER["latitude_of_origin",45.8333333333333],PARAMETER["central_meridian",-109.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US s [...]
+    'NAD27 / MONTANA NORTH':
+        'PROJCS["NAD27 / Montana North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.7166666666667],PARAMETER["standard_parallel_2",47.85],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",-109.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.30 [...]
+    'NAD27 / MONTANA SOUTH':
+        'PROJCS["NAD27 / Montana South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46.4],PARAMETER["standard_parallel_2",44.8666666666667],PARAMETER["latitude_of_origin",44],PARAMETER["central_meridian",-109.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304 [...]
+    'NAD27 / MTM ZONE 1':
+        'PROJCS["NAD27 / MTM zone 1",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-53],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 10':
+        'PROJCS["NAD27 / MTM zone 10",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-79.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 11':
+        'PROJCS["NAD27 / MTM zone 11",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-82.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 12':
+        'PROJCS["NAD27 / MTM zone 12",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 13':
+        'PROJCS["NAD27 / MTM zone 13",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-84],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 14':
+        'PROJCS["NAD27 / MTM zone 14",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 15':
+        'PROJCS["NAD27 / MTM zone 15",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-90],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 16':
+        'PROJCS["NAD27 / MTM zone 16",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 17':
+        'PROJCS["NAD27 / MTM zone 17",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-96],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 2':
+        'PROJCS["NAD27 / MTM zone 2",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-56],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 3':
+        'PROJCS["NAD27 / MTM zone 3",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-58.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 4':
+        'PROJCS["NAD27 / MTM zone 4",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-61.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 5':
+        'PROJCS["NAD27 / MTM zone 5",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-64.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 6':
+        'PROJCS["NAD27 / MTM zone 6",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-67.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 7':
+        'PROJCS["NAD27 / MTM zone 7",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-70.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 8':
+        'PROJCS["NAD27 / MTM zone 8",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-73.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / MTM ZONE 9':
+        'PROJCS["NAD27 / MTM zone 9",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-76.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / NEBRASKA NORTH':
+        'PROJCS["NAD27 / Nebraska North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.85],PARAMETER["standard_parallel_2",42.8166666666667],PARAMETER["latitude_of_origin",41.3333333333333],PARAMETER["central_meridian",-100],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surv [...]
+    'NAD27 / NEBRASKA SOUTH':
+        'PROJCS["NAD27 / Nebraska South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.2833333333333],PARAMETER["standard_parallel_2",41.7166666666667],PARAMETER["latitude_of_origin",39.6666666666667],PARAMETER["central_meridian",-99.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],U [...]
+    'NAD27 / NEVADA CENTRAL':
+        'PROJCS["NAD27 / Nevada Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-116.666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEVADA EAST':
+        'PROJCS["NAD27 / Nevada East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-115.583333333333],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEVADA WEST':
+        'PROJCS["NAD27 / Nevada West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-118.583333333333],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW HAMPSHIRE':
+        'PROJCS["NAD27 / New Hampshire",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.5],PARAMETER["central_meridian",-71.6666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW JERSEY':
+        'PROJCS["NAD27 / New Jersey",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.8333333333333],PARAMETER["central_meridian",-74.6666666666667],PARAMETER["scale_factor",0.999975],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW MEXICO CENTRAL':
+        'PROJCS["NAD27 / New Mexico Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-106.25],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW MEXICO EAST':
+        'PROJCS["NAD27 / New Mexico East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-104.333333333333],PARAMETER["scale_factor",0.999909091],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW MEXICO WEST':
+        'PROJCS["NAD27 / New Mexico West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-107.833333333333],PARAMETER["scale_factor",0.999916667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW YORK CENTRAL':
+        'PROJCS["NAD27 / New York Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-76.5833333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW YORK EAST':
+        'PROJCS["NAD27 / New York East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-74.3333333333333],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NEW YORK LONG ISLAND':
+        'PROJCS["NAD27 / New York Long Island",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.0333333333333],PARAMETER["standard_parallel_2",40.6666666666667],PARAMETER["latitude_of_origin",40.5],PARAMETER["central_meridian",-74],PARAMETER["false_easting",1000000],PARAMETER["false_northing",0],UNIT["US  [...]
+    'NAD27 / NEW YORK WEST':
+        'PROJCS["NAD27 / New York West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-78.5833333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / NORTH CAROLINA':
+        'PROJCS["NAD27 / North Carolina",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.3333333333333],PARAMETER["standard_parallel_2",36.1666666666667],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surve [...]
+    'NAD27 / NORTH DAKOTA NORTH':
+        'PROJCS["NAD27 / North Dakota North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.4333333333333],PARAMETER["standard_parallel_2",48.7333333333333],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",-100.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US s [...]
+    'NAD27 / NORTH DAKOTA SOUTH':
+        'PROJCS["NAD27 / North Dakota South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46.1833333333333],PARAMETER["standard_parallel_2",47.4833333333333],PARAMETER["latitude_of_origin",45.6666666666667],PARAMETER["central_meridian",-100.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing" [...]
+    'NAD27 / OHIO NORTH':
+        'PROJCS["NAD27 / Ohio North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.4333333333333],PARAMETER["standard_parallel_2",41.7],PARAMETER["latitude_of_origin",39.6666666666667],PARAMETER["central_meridian",-82.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey f [...]
+    'NAD27 / OHIO SOUTH':
+        'PROJCS["NAD27 / Ohio South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.7333333333333],PARAMETER["standard_parallel_2",40.0333333333333],PARAMETER["latitude_of_origin",38],PARAMETER["central_meridian",-82.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foo [...]
+    'NAD27 / OKLAHOMA NORTH':
+        'PROJCS["NAD27 / Oklahoma North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35.5666666666667],PARAMETER["standard_parallel_2",36.7666666666667],PARAMETER["latitude_of_origin",35],PARAMETER["central_meridian",-98],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey f [...]
+    'NAD27 / OKLAHOMA SOUTH':
+        'PROJCS["NAD27 / Oklahoma South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",33.9333333333333],PARAMETER["standard_parallel_2",35.2333333333333],PARAMETER["latitude_of_origin",33.3333333333333],PARAMETER["central_meridian",-98],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNI [...]
+    'NAD27 / OREGON NORTH':
+        'PROJCS["NAD27 / Oregon North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.3333333333333],PARAMETER["standard_parallel_2",46],PARAMETER["latitude_of_origin",43.6666666666667],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / OREGON SOUTH':
+        'PROJCS["NAD27 / Oregon South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.3333333333333],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / PENNSYLVANIA NORTH':
+        'PROJCS["NAD27 / Pennsylvania North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.8833333333333],PARAMETER["standard_parallel_2",41.95],PARAMETER["latitude_of_origin",40.1666666666667],PARAMETER["central_meridian",-77.75],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["U [...]
+    'NAD27 / PENNSYLVANIA SOUTH':
+        'PROJCS["NAD27 / Pennsylvania South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.9333333333333],PARAMETER["standard_parallel_2",40.8],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-77.75],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US [...]
+    'NAD27 / PUERTO RICO':
+        'PROJCS["NAD27 / Puerto Rico",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",18.4333333333333],PARAMETER["standard_parallel_2",18.0333333333333],PARAMETER["latitude_of_origin",17.8333333333333],PARAMETER["central_meridian",-66.4333333333334],PARAMETER["false_easting",500000],PARAMETER["false_northi [...]
+    'NAD27 / RHODE ISLAND':
+        'PROJCS["NAD27 / Rhode Island",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.0833333333333],PARAMETER["central_meridian",-71.5],PARAMETER["scale_factor",0.9999938],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / SCOPQ ZONE 2':
+        'PROJCS["NAD27 / SCoPQ zone 2",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-55.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / SOUTH CAROLINA NORTH':
+        'PROJCS["NAD27 / South Carolina North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",33.7666666666667],PARAMETER["standard_parallel_2",34.9666666666667],PARAMETER["latitude_of_origin",33],PARAMETER["central_meridian",-81],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US su [...]
+    'NAD27 / SOUTH CAROLINA SOUTH':
+        'PROJCS["NAD27 / South Carolina South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",32.3333333333333],PARAMETER["standard_parallel_2",33.6666666666667],PARAMETER["latitude_of_origin",31.8333333333333],PARAMETER["central_meridian",-81],PARAMETER["false_easting",2000000],PARAMETER["false_northing", [...]
+    'NAD27 / SOUTH DAKOTA NORTH':
+        'PROJCS["NAD27 / South Dakota North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.4166666666667],PARAMETER["standard_parallel_2",45.6833333333333],PARAMETER["latitude_of_origin",43.8333333333333],PARAMETER["central_meridian",-100],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0 [...]
+    'NAD27 / SOUTH DAKOTA SOUTH':
+        'PROJCS["NAD27 / South Dakota South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.8333333333333],PARAMETER["standard_parallel_2",44.4],PARAMETER["latitude_of_origin",42.3333333333333],PARAMETER["central_meridian",-100.333333333333],PARAMETER["false_easting",2000000],PARAMETER["false_northing", [...]
+    'NAD27 / ST. CROIX':
+        'PROJCS["NAD27 / St. Croix",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",18.4333333333333],PARAMETER["standard_parallel_2",18.0333333333333],PARAMETER["latitude_of_origin",17.8333333333333],PARAMETER["central_meridian",-66.4333333333334],PARAMETER["false_easting",500000],PARAMETER["false_northing [...]
+    'NAD27 / TENNESSEE':
+        'PROJCS["NAD27 / Tennessee",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35.25],PARAMETER["standard_parallel_2",36.4166666666667],PARAMETER["latitude_of_origin",34.6666666666667],PARAMETER["central_meridian",-86],PARAMETER["false_easting",100000],PARAMETER["false_northing",0],UNIT["US survey foot [...]
+    'NAD27 / TEXAS CENTRAL':
+        'PROJCS["NAD27 / Texas Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.1166666666667],PARAMETER["standard_parallel_2",31.8833333333333],PARAMETER["latitude_of_origin",29.6666666666667],PARAMETER["central_meridian",-100.333333333333],PARAMETER["false_easting",2000000],PARAMETER["false_nor [...]
+    'NAD27 / TEXAS NORTH':
+        'PROJCS["NAD27 / Texas North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.65],PARAMETER["standard_parallel_2",36.1833333333333],PARAMETER["latitude_of_origin",34],PARAMETER["central_meridian",-101.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.3048 [...]
+    'NAD27 / TEXAS NORTH CENTRAL':
+        'PROJCS["NAD27 / Texas North Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",32.1333333333333],PARAMETER["standard_parallel_2",33.9666666666667],PARAMETER["latitude_of_origin",31.6666666666667],PARAMETER["central_meridian",-97.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing" [...]
+    'NAD27 / TEXAS SOUTH':
+        'PROJCS["NAD27 / Texas South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",26.1666666666667],PARAMETER["standard_parallel_2",27.8333333333333],PARAMETER["latitude_of_origin",25.6666666666667],PARAMETER["central_meridian",-98.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT [...]
+    'NAD27 / TEXAS SOUTH CENTRAL':
+        'PROJCS["NAD27 / Texas South Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",28.3833333333333],PARAMETER["standard_parallel_2",30.2833333333333],PARAMETER["latitude_of_origin",27.8333333333333],PARAMETER["central_meridian",-99],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0 [...]
+    'NAD27 / UTAH CENTRAL':
+        'PROJCS["NAD27 / Utah Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.0166666666667],PARAMETER["standard_parallel_2",40.65],PARAMETER["latitude_of_origin",38.3333333333333],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surv [...]
+    'NAD27 / UTAH NORTH':
+        'PROJCS["NAD27 / Utah North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.7166666666667],PARAMETER["standard_parallel_2",41.7833333333333],PARAMETER["latitude_of_origin",40.3333333333333],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT [...]
+    'NAD27 / UTAH SOUTH':
+        'PROJCS["NAD27 / Utah South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.2166666666667],PARAMETER["standard_parallel_2",38.35],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey [...]
+    'NAD27 / UTM ZONE 10N':
+        'PROJCS["NAD27 / UTM zone 10N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 11N':
+        'PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 12N':
+        'PROJCS["NAD27 / UTM zone 12N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 13N':
+        'PROJCS["NAD27 / UTM zone 13N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 14N':
+        'PROJCS["NAD27 / UTM zone 14N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 15N':
+        'PROJCS["NAD27 / UTM zone 15N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 16N':
+        'PROJCS["NAD27 / UTM zone 16N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 17N':
+        'PROJCS["NAD27 / UTM zone 17N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 18N':
+        'PROJCS["NAD27 / UTM zone 18N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 19N':
+        'PROJCS["NAD27 / UTM zone 19N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 20N':
+        'PROJCS["NAD27 / UTM zone 20N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 21N':
+        'PROJCS["NAD27 / UTM zone 21N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 22N':
+        'PROJCS["NAD27 / UTM zone 22N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 3N':
+        'PROJCS["NAD27 / UTM zone 3N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 4N':
+        'PROJCS["NAD27 / UTM zone 4N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 5N':
+        'PROJCS["NAD27 / UTM zone 5N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 6N':
+        'PROJCS["NAD27 / UTM zone 6N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 7N':
+        'PROJCS["NAD27 / UTM zone 7N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 8N':
+        'PROJCS["NAD27 / UTM zone 8N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / UTM ZONE 9N':
+        'PROJCS["NAD27 / UTM zone 9N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD27 / VERMONT':
+        'PROJCS["NAD27 / Vermont",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.5],PARAMETER["central_meridian",-72.5],PARAMETER["scale_factor",0.999964286],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / VIRGINIA NORTH':
+        'PROJCS["NAD27 / Virginia North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.0333333333333],PARAMETER["standard_parallel_2",39.2],PARAMETER["latitude_of_origin",37.6666666666667],PARAMETER["central_meridian",-78.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surv [...]
+    'NAD27 / VIRGINIA SOUTH':
+        'PROJCS["NAD27 / Virginia South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.7666666666667],PARAMETER["standard_parallel_2",37.9666666666667],PARAMETER["latitude_of_origin",36.3333333333333],PARAMETER["central_meridian",-78.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],U [...]
+    'NAD27 / WASHINGTON NORTH':
+        'PROJCS["NAD27 / Washington North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.5],PARAMETER["standard_parallel_2",48.7333333333333],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",-120.833333333333],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US surv [...]
+    'NAD27 / WASHINGTON SOUTH':
+        'PROJCS["NAD27 / Washington South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.8333333333333],PARAMETER["standard_parallel_2",47.3333333333333],PARAMETER["latitude_of_origin",45.3333333333333],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0 [...]
+    'NAD27 / WEST VIRGINIA NORTH':
+        'PROJCS["NAD27 / West Virginia North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39],PARAMETER["standard_parallel_2",40.25],PARAMETER["latitude_of_origin",38.5],PARAMETER["central_meridian",-79.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609 [...]
+    'NAD27 / WEST VIRGINIA SOUTH':
+        'PROJCS["NAD27 / West Virginia South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.4833333333333],PARAMETER["standard_parallel_2",38.8833333333333],PARAMETER["latitude_of_origin",37],PARAMETER["central_meridian",-81],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US sur [...]
+    'NAD27 / WISCONSIN CENTRAL':
+        'PROJCS["NAD27 / Wisconsin Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.25],PARAMETER["standard_parallel_2",45.5],PARAMETER["latitude_of_origin",43.8333333333333],PARAMETER["central_meridian",-90],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0 [...]
+    'NAD27 / WISCONSIN NORTH':
+        'PROJCS["NAD27 / Wisconsin North",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.5666666666667],PARAMETER["standard_parallel_2",46.7666666666667],PARAMETER["latitude_of_origin",45.1666666666667],PARAMETER["central_meridian",-90],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UN [...]
+    'NAD27 / WISCONSIN SOUTH':
+        'PROJCS["NAD27 / Wisconsin South",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.7333333333333],PARAMETER["standard_parallel_2",44.0666666666667],PARAMETER["latitude_of_origin",42],PARAMETER["central_meridian",-90],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey  [...]
+    'NAD27 / WYOMING EAST':
+        'PROJCS["NAD27 / Wyoming East",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.6666666666667],PARAMETER["central_meridian",-105.166666666667],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / WYOMING EAST CENTRAL':
+        'PROJCS["NAD27 / Wyoming East Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.6666666666667],PARAMETER["central_meridian",-107.333333333333],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / WYOMING WEST':
+        'PROJCS["NAD27 / Wyoming West",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.6666666666667],PARAMETER["central_meridian",-110.083333333333],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 / WYOMING WEST CENTRAL':
+        'PROJCS["NAD27 / Wyoming West Central",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.6666666666667],PARAMETER["central_meridian",-108.75],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219]]',
+    'NAD27 MICHIGAN':
+        'GEOGCS["NAD27 Michigan",DATUM["NAD_Michigan",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NAD83':
+        'GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NAD83 / ALABAMA EAST':
+        'PROJCS["NAD83 / Alabama East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30.5],PARAMETER["central_meridian",-85.8333333333333],PARAMETER["scale_factor",0.99996],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALABAMA WEST':
+        'PROJCS["NAD83 / Alabama West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-87.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 1':
+        'PROJCS["NAD83 / Alaska zone 1",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",57],PARAMETER["longitude_of_center",-133.666666666667],PARAMETER["azimuth",323.130102361111],PARAMETER["rectified_grid_angle",323.130102361111],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",5000000],PARAMETER["false_nort [...]
+    'NAD83 / ALASKA ZONE 10':
+        'PROJCS["NAD83 / Alaska zone 10",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",53.8333333333333],PARAMETER["standard_parallel_2",51.8333333333333],PARAMETER["latitude_of_origin",51],PARAMETER["central_meridian",-176],PARAMETER["false_easting",1000000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 2':
+        'PROJCS["NAD83 / Alaska zone 2",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-142],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 3':
+        'PROJCS["NAD83 / Alaska zone 3",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-146],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 4':
+        'PROJCS["NAD83 / Alaska zone 4",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-150],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 5':
+        'PROJCS["NAD83 / Alaska zone 5",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-154],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 6':
+        'PROJCS["NAD83 / Alaska zone 6",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-158],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 7':
+        'PROJCS["NAD83 / Alaska zone 7",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-162],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 8':
+        'PROJCS["NAD83 / Alaska zone 8",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-166],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ALASKA ZONE 9':
+        'PROJCS["NAD83 / Alaska zone 9",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",54],PARAMETER["central_meridian",-170],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ARIZONA  EAST':
+        'PROJCS["NAD83 / Arizona  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-110.166666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",213360],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ARIZONA CENTRAL':
+        'PROJCS["NAD83 / Arizona Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-111.916666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",213360],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ARIZONA WEST':
+        'PROJCS["NAD83 / Arizona West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-113.75],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",213360],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ARKANSAS NORTH':
+        'PROJCS["NAD83 / Arkansas North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.2333333333333],PARAMETER["standard_parallel_2",34.9333333333333],PARAMETER["latitude_of_origin",34.3333333333333],PARAMETER["central_meridian",-92],PARAMETER["false_easting",400000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ARKANSAS SOUTH':
+        'PROJCS["NAD83 / Arkansas South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.7666666666667],PARAMETER["standard_parallel_2",33.3],PARAMETER["latitude_of_origin",32.6666666666667],PARAMETER["central_meridian",-92],PARAMETER["false_easting",400000],PARAMETER["false_northing",400000],UNIT["metre",1]]',
+    'NAD83 / CALIFORNIA ZONE 1':
+        'PROJCS["NAD83 / California zone 1",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.6666666666667],PARAMETER["standard_parallel_2",40],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-122],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'NAD83 / CALIFORNIA ZONE 2':
+        'PROJCS["NAD83 / California zone 2",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.8333333333333],PARAMETER["standard_parallel_2",38.3333333333333],PARAMETER["latitude_of_origin",37.6666666666667],PARAMETER["central_meridian",-122],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000],UN [...]
+    'NAD83 / CALIFORNIA ZONE 3':
+        'PROJCS["NAD83 / California zone 3",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.4333333333333],PARAMETER["standard_parallel_2",37.0666666666667],PARAMETER["latitude_of_origin",36.5],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'NAD83 / CALIFORNIA ZONE 4':
+        'PROJCS["NAD83 / California zone 4",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.25],PARAMETER["standard_parallel_2",36],PARAMETER["latitude_of_origin",35.3333333333333],PARAMETER["central_meridian",-119],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'NAD83 / CALIFORNIA ZONE 5':
+        'PROJCS["NAD83 / California zone 5",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35.4666666666667],PARAMETER["standard_parallel_2",34.0333333333333],PARAMETER["latitude_of_origin",33.5],PARAMETER["central_meridian",-118],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000],UNIT["metre",1]]',
+    'NAD83 / CALIFORNIA ZONE 6':
+        'PROJCS["NAD83 / California zone 6",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",33.8833333333333],PARAMETER["standard_parallel_2",32.7833333333333],PARAMETER["latitude_of_origin",32.1666666666667],PARAMETER["central_meridian",-116.25],PARAMETER["false_easting",2000000],PARAMETER["false_northing",500000] [...]
+    'NAD83 / COLORADO CENTRAL':
+        'PROJCS["NAD83 / Colorado Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.75],PARAMETER["standard_parallel_2",38.45],PARAMETER["latitude_of_origin",37.8333333333333],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",914401.8289],PARAMETER["false_northing",304800.6096],UNIT["metre",1]]',
+    'NAD83 / COLORADO NORTH':
+        'PROJCS["NAD83 / Colorado North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.7833333333333],PARAMETER["standard_parallel_2",39.7166666666667],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",914401.8289],PARAMETER["false_northing",304800. [...]
+    'NAD83 / COLORADO SOUTH':
+        'PROJCS["NAD83 / Colorado South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.4333333333333],PARAMETER["standard_parallel_2",37.2333333333333],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-105.5],PARAMETER["false_easting",914401.8289],PARAMETER["false_northing",304800. [...]
+    'NAD83 / CONNECTICUT':
+        'PROJCS["NAD83 / Connecticut",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.8666666666667],PARAMETER["standard_parallel_2",41.2],PARAMETER["latitude_of_origin",40.8333333333333],PARAMETER["central_meridian",-72.75],PARAMETER["false_easting",304800.6096],PARAMETER["false_northing",152400.3048],UNIT["met [...]
+    'NAD83 / DELAWARE':
+        'PROJCS["NAD83 / Delaware",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38],PARAMETER["central_meridian",-75.4166666666667],PARAMETER["scale_factor",0.999995],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / FLORIDA  EAST':
+        'PROJCS["NAD83 / Florida  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",24.3333333333333],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / FLORIDA  WEST':
+        'PROJCS["NAD83 / Florida  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",24.3333333333333],PARAMETER["central_meridian",-82],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / FLORIDA NORTH':
+        'PROJCS["NAD83 / Florida North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.75],PARAMETER["standard_parallel_2",29.5833333333333],PARAMETER["latitude_of_origin",29],PARAMETER["central_meridian",-84.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / GEORGIA  EAST':
+        'PROJCS["NAD83 / Georgia  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-82.1666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / GEORGIA WEST':
+        'PROJCS["NAD83 / Georgia West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",30],PARAMETER["central_meridian",-84.1666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",700000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / HAWAII  ZONE 1':
+        'PROJCS["NAD83 / Hawaii  zone 1",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",18.8333333333333],PARAMETER["central_meridian",-155.5],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / HAWAII  ZONE 2':
+        'PROJCS["NAD83 / Hawaii  zone 2",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",20.3333333333333],PARAMETER["central_meridian",-156.666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / HAWAII  ZONE 3':
+        'PROJCS["NAD83 / Hawaii  zone 3",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.1666666666667],PARAMETER["central_meridian",-158],PARAMETER["scale_factor",0.99999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / HAWAII  ZONE 4':
+        'PROJCS["NAD83 / Hawaii  zone 4",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.8333333333333],PARAMETER["central_meridian",-159.5],PARAMETER["scale_factor",0.99999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / HAWAII  ZONE 5':
+        'PROJCS["NAD83 / Hawaii  zone 5",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",21.6666666666667],PARAMETER["central_meridian",-160.166666666667],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / IDAHO  CENTRAL':
+        'PROJCS["NAD83 / Idaho  Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-114],PARAMETER["scale_factor",0.999947368],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / IDAHO  EAST':
+        'PROJCS["NAD83 / Idaho  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-112.166666666667],PARAMETER["scale_factor",0.999947368],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / IDAHO  WEST':
+        'PROJCS["NAD83 / Idaho  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-115.75],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",800000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ILLINOIS  EAST':
+        'PROJCS["NAD83 / Illinois  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-88.3333333333333],PARAMETER["scale_factor",0.999975],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / ILLINOIS  WEST':
+        'PROJCS["NAD83 / Illinois  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-90.1666666666667],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",700000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / INDIANA  EAST':
+        'PROJCS["NAD83 / Indiana  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-85.6666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",100000],PARAMETER["false_northing",250000],UNIT["metre",1]]',
+    'NAD83 / INDIANA  WEST':
+        'PROJCS["NAD83 / Indiana  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-87.0833333333333],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",900000],PARAMETER["false_northing",250000],UNIT["metre",1]]',
+    'NAD83 / IOWA NORTH':
+        'PROJCS["NAD83 / Iowa North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.2666666666667],PARAMETER["standard_parallel_2",42.0666666666667],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-93.5],PARAMETER["false_easting",1500000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'NAD83 / IOWA SOUTH':
+        'PROJCS["NAD83 / Iowa South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.7833333333333],PARAMETER["standard_parallel_2",40.6166666666667],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-93.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / KANSAS NORTH':
+        'PROJCS["NAD83 / Kansas North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.7833333333333],PARAMETER["standard_parallel_2",38.7166666666667],PARAMETER["latitude_of_origin",38.3333333333333],PARAMETER["central_meridian",-98],PARAMETER["false_easting",400000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / KANSAS SOUTH':
+        'PROJCS["NAD83 / Kansas South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.5666666666667],PARAMETER["standard_parallel_2",37.2666666666667],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-98.5],PARAMETER["false_easting",400000],PARAMETER["false_northing",400000],UNIT["m [...]
+    'NAD83 / KENTUCKY NORTH':
+        'PROJCS["NAD83 / Kentucky North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.9666666666667],PARAMETER["standard_parallel_2",37.9666666666667],PARAMETER["latitude_of_origin",37.5],PARAMETER["central_meridian",-84.25],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / KENTUCKY SOUTH':
+        'PROJCS["NAD83 / Kentucky South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.9333333333333],PARAMETER["standard_parallel_2",36.7333333333333],PARAMETER["latitude_of_origin",36.3333333333333],PARAMETER["central_meridian",-85.75],PARAMETER["false_easting",500000],PARAMETER["false_northing",500000],UNIT [...]
+    'NAD83 / LOUISIANA NORTH':
+        'PROJCS["NAD83 / Louisiana North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",32.6666666666667],PARAMETER["standard_parallel_2",31.1666666666667],PARAMETER["latitude_of_origin",30.5],PARAMETER["central_meridian",-92.5],PARAMETER["false_easting",1000000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / LOUISIANA SOUTH':
+        'PROJCS["NAD83 / Louisiana South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.7],PARAMETER["standard_parallel_2",29.3],PARAMETER["latitude_of_origin",28.5],PARAMETER["central_meridian",-91.3333333333333],PARAMETER["false_easting",1000000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MAINE  EAST':
+        'PROJCS["NAD83 / Maine  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",43.6666666666667],PARAMETER["central_meridian",-68.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MAINE  WEST':
+        'PROJCS["NAD83 / Maine  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.8333333333333],PARAMETER["central_meridian",-70.1666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",900000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MARYLAND':
+        'PROJCS["NAD83 / Maryland",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.45],PARAMETER["standard_parallel_2",38.3],PARAMETER["latitude_of_origin",37.6666666666667],PARAMETER["central_meridian",-77],PARAMETER["false_easting",400000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MASSACHUSETTS ISLAND':
+        'PROJCS["NAD83 / Massachusetts Island",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.4833333333333],PARAMETER["standard_parallel_2",41.2833333333333],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-70.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MASSACHUSETTS MAINLAND':
+        'PROJCS["NAD83 / Massachusetts Mainland",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.6833333333333],PARAMETER["standard_parallel_2",41.7166666666667],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-71.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",750000],UNIT["metre",1]]',
+    'NAD83 / MICHIGAN CENTRAL':
+        'PROJCS["NAD83 / Michigan Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.7],PARAMETER["standard_parallel_2",44.1833333333333],PARAMETER["latitude_of_origin",43.3166666666667],PARAMETER["central_meridian",-84.3666666666667],PARAMETER["false_easting",6000000],PARAMETER["false_northing",0],UNIT["m [...]
+    'NAD83 / MICHIGAN NORTH':
+        'PROJCS["NAD83 / Michigan North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.0833333333333],PARAMETER["standard_parallel_2",45.4833333333333],PARAMETER["latitude_of_origin",44.7833333333333],PARAMETER["central_meridian",-87],PARAMETER["false_easting",8000000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MICHIGAN SOUTH':
+        'PROJCS["NAD83 / Michigan South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.6666666666667],PARAMETER["standard_parallel_2",42.1],PARAMETER["latitude_of_origin",41.5],PARAMETER["central_meridian",-84.3666666666667],PARAMETER["false_easting",4000000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MINNESOTA CENTRAL':
+        'PROJCS["NAD83 / Minnesota Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.05],PARAMETER["standard_parallel_2",45.6166666666667],PARAMETER["latitude_of_origin",45],PARAMETER["central_meridian",-94.25],PARAMETER["false_easting",800000],PARAMETER["false_northing",100000],UNIT["metre",1]]',
+    'NAD83 / MINNESOTA NORTH':
+        'PROJCS["NAD83 / Minnesota North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.6333333333333],PARAMETER["standard_parallel_2",47.0333333333333],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",-93.1],PARAMETER["false_easting",800000],PARAMETER["false_northing",100000],UNIT["metre",1]]',
+    'NAD83 / MINNESOTA SOUTH':
+        'PROJCS["NAD83 / Minnesota South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.2166666666667],PARAMETER["standard_parallel_2",43.7833333333333],PARAMETER["latitude_of_origin",43],PARAMETER["central_meridian",-94],PARAMETER["false_easting",800000],PARAMETER["false_northing",100000],UNIT["metre",1]]',
+    'NAD83 / MISSISSIPPI EAST':
+        'PROJCS["NAD83 / Mississippi East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",29.5],PARAMETER["central_meridian",-88.8333333333333],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MISSISSIPPI WEST':
+        'PROJCS["NAD83 / Mississippi West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",29.5],PARAMETER["central_meridian",-90.3333333333333],PARAMETER["scale_factor",0.99995],PARAMETER["false_easting",700000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MISSOURI  EAST':
+        'PROJCS["NAD83 / Missouri  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",35.8333333333333],PARAMETER["central_meridian",-90.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",250000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MISSOURI  WEST':
+        'PROJCS["NAD83 / Missouri  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36.1666666666667],PARAMETER["central_meridian",-94.5],PARAMETER["scale_factor",0.999941177],PARAMETER["false_easting",850000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MISSOURI CENTRAL':
+        'PROJCS["NAD83 / Missouri Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",35.8333333333333],PARAMETER["central_meridian",-92.5],PARAMETER["scale_factor",0.999933333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MONTANA':
+        'PROJCS["NAD83 / Montana",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",45],PARAMETER["latitude_of_origin",44.25],PARAMETER["central_meridian",-109.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 1':
+        'PROJCS["NAD83 / MTM zone 1",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-53],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 10':
+        'PROJCS["NAD83 / MTM zone 10",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-79.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 11':
+        'PROJCS["NAD83 / MTM zone 11",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-82.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 12':
+        'PROJCS["NAD83 / MTM zone 12",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 13':
+        'PROJCS["NAD83 / MTM zone 13",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-84],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 14':
+        'PROJCS["NAD83 / MTM zone 14",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 15':
+        'PROJCS["NAD83 / MTM zone 15",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-90],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 16':
+        'PROJCS["NAD83 / MTM zone 16",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 17':
+        'PROJCS["NAD83 / MTM zone 17",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-96],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 2':
+        'PROJCS["NAD83 / MTM zone 2",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-56],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 3':
+        'PROJCS["NAD83 / MTM zone 3",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-58.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 4':
+        'PROJCS["NAD83 / MTM zone 4",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-61.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 5':
+        'PROJCS["NAD83 / MTM zone 5",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-64.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 6':
+        'PROJCS["NAD83 / MTM zone 6",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-67.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 7':
+        'PROJCS["NAD83 / MTM zone 7",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-70.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 8':
+        'PROJCS["NAD83 / MTM zone 8",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-73.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / MTM ZONE 9':
+        'PROJCS["NAD83 / MTM zone 9",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-76.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEBRASKA':
+        'PROJCS["NAD83 / Nebraska",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43],PARAMETER["standard_parallel_2",40],PARAMETER["latitude_of_origin",39.8333333333333],PARAMETER["central_meridian",-100],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEVADA  EAST':
+        'PROJCS["NAD83 / Nevada  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-115.583333333333],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",200000],PARAMETER["false_northing",8000000],UNIT["metre",1]]',
+    'NAD83 / NEVADA CENTRAL':
+        'PROJCS["NAD83 / Nevada Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-116.666666666667],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",6000000],UNIT["metre",1]]',
+    'NAD83 / NEVADA WEST':
+        'PROJCS["NAD83 / Nevada West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",34.75],PARAMETER["central_meridian",-118.583333333333],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",800000],PARAMETER["false_northing",4000000],UNIT["metre",1]]',
+    'NAD83 / NEW HAMPSHIRE':
+        'PROJCS["NAD83 / New Hampshire",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.5],PARAMETER["central_meridian",-71.6666666666667],PARAMETER["scale_factor",0.999966667],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW JERSEY':
+        'PROJCS["NAD83 / New Jersey",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.8333333333333],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",150000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW MEXICO CENTRAL':
+        'PROJCS["NAD83 / New Mexico Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-106.25],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW MEXICO EAST':
+        'PROJCS["NAD83 / New Mexico East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-104.333333333333],PARAMETER["scale_factor",0.999909091],PARAMETER["false_easting",165000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW MEXICO WEST':
+        'PROJCS["NAD83 / New Mexico West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",31],PARAMETER["central_meridian",-107.833333333333],PARAMETER["scale_factor",0.999916667],PARAMETER["false_easting",830000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW YORK  EAST':
+        'PROJCS["NAD83 / New York  East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.8333333333333],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",150000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW YORK  WEST':
+        'PROJCS["NAD83 / New York  West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-78.5833333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",350000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW YORK CENTRAL':
+        'PROJCS["NAD83 / New York Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40],PARAMETER["central_meridian",-76.5833333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",250000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NEW YORK LONG ISLAND':
+        'PROJCS["NAD83 / New York Long Island",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.0333333333333],PARAMETER["standard_parallel_2",40.6666666666667],PARAMETER["latitude_of_origin",40.1666666666667],PARAMETER["central_meridian",-74],PARAMETER["false_easting",300000],PARAMETER["false_northing",0],UNIT[" [...]
+    'NAD83 / NORTH CAROLINA':
+        'PROJCS["NAD83 / North Carolina",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.1666666666667],PARAMETER["standard_parallel_2",34.3333333333333],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",609601.22],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NORTH DAKOTA NORTH':
+        'PROJCS["NAD83 / North Dakota North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.7333333333333],PARAMETER["standard_parallel_2",47.4333333333333],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",-100.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / NORTH DAKOTA SOUTH':
+        'PROJCS["NAD83 / North Dakota South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.4833333333333],PARAMETER["standard_parallel_2",46.1833333333333],PARAMETER["latitude_of_origin",45.6666666666667],PARAMETER["central_meridian",-100.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT[ [...]
+    'NAD83 / OHIO NORTH':
+        'PROJCS["NAD83 / Ohio North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.7],PARAMETER["standard_parallel_2",40.4333333333333],PARAMETER["latitude_of_origin",39.6666666666667],PARAMETER["central_meridian",-82.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / OHIO SOUTH':
+        'PROJCS["NAD83 / Ohio South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.0333333333333],PARAMETER["standard_parallel_2",38.7333333333333],PARAMETER["latitude_of_origin",38],PARAMETER["central_meridian",-82.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / OKLAHOMA NORTH':
+        'PROJCS["NAD83 / Oklahoma North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.7666666666667],PARAMETER["standard_parallel_2",35.5666666666667],PARAMETER["latitude_of_origin",35],PARAMETER["central_meridian",-98],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / OKLAHOMA SOUTH':
+        'PROJCS["NAD83 / Oklahoma South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35.2333333333333],PARAMETER["standard_parallel_2",33.9333333333333],PARAMETER["latitude_of_origin",33.3333333333333],PARAMETER["central_meridian",-98],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / OREGON NORTH':
+        'PROJCS["NAD83 / Oregon North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46],PARAMETER["standard_parallel_2",44.3333333333333],PARAMETER["latitude_of_origin",43.6666666666667],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / OREGON SOUTH':
+        'PROJCS["NAD83 / Oregon South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44],PARAMETER["standard_parallel_2",42.3333333333333],PARAMETER["latitude_of_origin",41.6666666666667],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / PENNSYLVANIA NORTH':
+        'PROJCS["NAD83 / Pennsylvania North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.95],PARAMETER["standard_parallel_2",40.8833333333333],PARAMETER["latitude_of_origin",40.1666666666667],PARAMETER["central_meridian",-77.75],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / PENNSYLVANIA SOUTH':
+        'PROJCS["NAD83 / Pennsylvania South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.9666666666667],PARAMETER["standard_parallel_2",39.9333333333333],PARAMETER["latitude_of_origin",39.3333333333333],PARAMETER["central_meridian",-77.75],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT[ [...]
+    'NAD83 / PUERTO RICO & VIRGIN IS.':
+        'PROJCS["NAD83 / Puerto Rico & Virgin Is.",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",18.4333333333333],PARAMETER["standard_parallel_2",18.0333333333333],PARAMETER["latitude_of_origin",17.8333333333333],PARAMETER["central_meridian",-66.4333333333334],PARAMETER["false_easting",200000],PARAMETER["false_n [...]
+    'NAD83 / RHODE ISLAND':
+        'PROJCS["NAD83 / Rhode Island",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",41.0833333333333],PARAMETER["central_meridian",-71.5],PARAMETER["scale_factor",0.99999375],PARAMETER["false_easting",100000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / SCOPQ ZONE 2':
+        'PROJCS["NAD83 / SCoPQ zone 2",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-55.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",304800],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / SOUTH CAROLINA':
+        'PROJCS["NAD83 / South Carolina",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",34.8333333333333],PARAMETER["standard_parallel_2",32.5],PARAMETER["latitude_of_origin",31.8333333333333],PARAMETER["central_meridian",-81],PARAMETER["false_easting",609600],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / SOUTH DAKOTA NORTH':
+        'PROJCS["NAD83 / South Dakota North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.6833333333333],PARAMETER["standard_parallel_2",44.4166666666667],PARAMETER["latitude_of_origin",43.8333333333333],PARAMETER["central_meridian",-100],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["m [...]
+    'NAD83 / SOUTH DAKOTA SOUTH':
+        'PROJCS["NAD83 / South Dakota South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.4],PARAMETER["standard_parallel_2",42.8333333333333],PARAMETER["latitude_of_origin",42.3333333333333],PARAMETER["central_meridian",-100.333333333333],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT[" [...]
+    'NAD83 / TENNESSEE':
+        'PROJCS["NAD83 / Tennessee",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.4166666666667],PARAMETER["standard_parallel_2",35.25],PARAMETER["latitude_of_origin",34.3333333333333],PARAMETER["central_meridian",-86],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / TEXAS CENTRAL':
+        'PROJCS["NAD83 / Texas Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",31.8833333333333],PARAMETER["standard_parallel_2",30.1166666666667],PARAMETER["latitude_of_origin",29.6666666666667],PARAMETER["central_meridian",-100.333333333333],PARAMETER["false_easting",700000],PARAMETER["false_northing",30 [...]
+    'NAD83 / TEXAS NORTH':
+        'PROJCS["NAD83 / Texas North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.1833333333333],PARAMETER["standard_parallel_2",34.65],PARAMETER["latitude_of_origin",34],PARAMETER["central_meridian",-101.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",1000000],UNIT["metre",1]]',
+    'NAD83 / TEXAS NORTH CENTRAL':
+        'PROJCS["NAD83 / Texas North Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",33.9666666666667],PARAMETER["standard_parallel_2",32.1333333333333],PARAMETER["latitude_of_origin",31.6666666666667],PARAMETER["central_meridian",-98.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",2000000] [...]
+    'NAD83 / TEXAS SOUTH':
+        'PROJCS["NAD83 / Texas South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",27.8333333333333],PARAMETER["standard_parallel_2",26.1666666666667],PARAMETER["latitude_of_origin",25.6666666666667],PARAMETER["central_meridian",-98.5],PARAMETER["false_easting",300000],PARAMETER["false_northing",5000000],UNIT["m [...]
+    'NAD83 / TEXAS SOUTH CENTRAL':
+        'PROJCS["NAD83 / Texas South Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.2833333333333],PARAMETER["standard_parallel_2",28.3833333333333],PARAMETER["latitude_of_origin",27.8333333333333],PARAMETER["central_meridian",-99],PARAMETER["false_easting",600000],PARAMETER["false_northing",4000000],U [...]
+    'NAD83 / UTAH CENTRAL':
+        'PROJCS["NAD83 / Utah Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.65],PARAMETER["standard_parallel_2",39.0166666666667],PARAMETER["latitude_of_origin",38.3333333333333],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",2000000],UNIT["metre",1]]',
+    'NAD83 / UTAH NORTH':
+        'PROJCS["NAD83 / Utah North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",41.7833333333333],PARAMETER["standard_parallel_2",40.7166666666667],PARAMETER["latitude_of_origin",40.3333333333333],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",1000000],UNIT["m [...]
+    'NAD83 / UTAH SOUTH':
+        'PROJCS["NAD83 / Utah South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.35],PARAMETER["standard_parallel_2",37.2166666666667],PARAMETER["latitude_of_origin",36.6666666666667],PARAMETER["central_meridian",-111.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",3000000],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 10N':
+        'PROJCS["NAD83 / UTM zone 10N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 11N':
+        'PROJCS["NAD83 / UTM zone 11N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 12N':
+        'PROJCS["NAD83 / UTM zone 12N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 13N':
+        'PROJCS["NAD83 / UTM zone 13N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 14N':
+        'PROJCS["NAD83 / UTM zone 14N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 15N':
+        'PROJCS["NAD83 / UTM zone 15N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 16N':
+        'PROJCS["NAD83 / UTM zone 16N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 17N':
+        'PROJCS["NAD83 / UTM zone 17N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 18N':
+        'PROJCS["NAD83 / UTM zone 18N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 19N':
+        'PROJCS["NAD83 / UTM zone 19N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 20N':
+        'PROJCS["NAD83 / UTM zone 20N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 21N':
+        'PROJCS["NAD83 / UTM zone 21N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 22N':
+        'PROJCS["NAD83 / UTM zone 22N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 23N':
+        'PROJCS["NAD83 / UTM zone 23N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 3N':
+        'PROJCS["NAD83 / UTM zone 3N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 4N':
+        'PROJCS["NAD83 / UTM zone 4N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 5N':
+        'PROJCS["NAD83 / UTM zone 5N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 6N':
+        'PROJCS["NAD83 / UTM zone 6N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 7N':
+        'PROJCS["NAD83 / UTM zone 7N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 8N':
+        'PROJCS["NAD83 / UTM zone 8N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / UTM ZONE 9N':
+        'PROJCS["NAD83 / UTM zone 9N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / VERMONT':
+        'PROJCS["NAD83 / Vermont",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",42.5],PARAMETER["central_meridian",-72.5],PARAMETER["scale_factor",0.999964286],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / VIRGINIA NORTH':
+        'PROJCS["NAD83 / Virginia North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",39.2],PARAMETER["standard_parallel_2",38.0333333333333],PARAMETER["latitude_of_origin",37.6666666666667],PARAMETER["central_meridian",-78.5],PARAMETER["false_easting",3500000],PARAMETER["false_northing",2000000],UNIT["metre",1]]',
+    'NAD83 / VIRGINIA SOUTH':
+        'PROJCS["NAD83 / Virginia South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",37.9666666666667],PARAMETER["standard_parallel_2",36.7666666666667],PARAMETER["latitude_of_origin",36.3333333333333],PARAMETER["central_meridian",-78.5],PARAMETER["false_easting",3500000],PARAMETER["false_northing",1000000],UNI [...]
+    'NAD83 / WASHINGTON NORTH':
+        'PROJCS["NAD83 / Washington North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.7333333333333],PARAMETER["standard_parallel_2",47.5],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",-120.833333333333],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WASHINGTON SOUTH':
+        'PROJCS["NAD83 / Washington South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.3333333333333],PARAMETER["standard_parallel_2",45.8333333333333],PARAMETER["latitude_of_origin",45.3333333333333],PARAMETER["central_meridian",-120.5],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["m [...]
+    'NAD83 / WEST VIRGINIA NORTH':
+        'PROJCS["NAD83 / West Virginia North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.25],PARAMETER["standard_parallel_2",39],PARAMETER["latitude_of_origin",38.5],PARAMETER["central_meridian",-79.5],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WEST VIRGINIA SOUTH':
+        'PROJCS["NAD83 / West Virginia South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",38.8833333333333],PARAMETER["standard_parallel_2",37.4833333333333],PARAMETER["latitude_of_origin",37],PARAMETER["central_meridian",-81],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WISCONSIN CENTRAL':
+        'PROJCS["NAD83 / Wisconsin Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.5],PARAMETER["standard_parallel_2",44.25],PARAMETER["latitude_of_origin",43.8333333333333],PARAMETER["central_meridian",-90],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WISCONSIN NORTH':
+        'PROJCS["NAD83 / Wisconsin North",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46.7666666666667],PARAMETER["standard_parallel_2",45.5666666666667],PARAMETER["latitude_of_origin",45.1666666666667],PARAMETER["central_meridian",-90],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WISCONSIN SOUTH':
+        'PROJCS["NAD83 / Wisconsin South",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.0666666666667],PARAMETER["standard_parallel_2",42.7333333333333],PARAMETER["latitude_of_origin",42],PARAMETER["central_meridian",-90],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WYOMING EAST':
+        'PROJCS["NAD83 / Wyoming East",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.5],PARAMETER["central_meridian",-105.166666666667],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",200000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAD83 / WYOMING EAST CENTRAL':
+        'PROJCS["NAD83 / Wyoming East Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.5],PARAMETER["central_meridian",-107.333333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",400000],PARAMETER["false_northing",100000],UNIT["metre",1]]',
+    'NAD83 / WYOMING WEST':
+        'PROJCS["NAD83 / Wyoming West",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.5],PARAMETER["central_meridian",-110.083333333333],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",800000],PARAMETER["false_northing",100000],UNIT["metre",1]]',
+    'NAD83 / WYOMING WEST CENTRAL':
+        'PROJCS["NAD83 / Wyoming West Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",40.5],PARAMETER["central_meridian",-108.75],PARAMETER["scale_factor",0.9999375],PARAMETER["false_easting",600000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAHRWAN 1967':
+        'GEOGCS["Nahrwan 1967",DATUM["Nahrwan_1967",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NAHRWAN 1967 / UTM ZONE 38N':
+        'PROJCS["Nahrwan 1967 / UTM zone 38N",GEOGCS["Nahrwan 1967",DATUM["Nahrwan_1967",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAHRWAN 1967 / UTM ZONE 39N':
+        'PROJCS["Nahrwan 1967 / UTM zone 39N",GEOGCS["Nahrwan 1967",DATUM["Nahrwan_1967",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAHRWAN 1967 / UTM ZONE 40N':
+        'PROJCS["Nahrwan 1967 / UTM zone 40N",GEOGCS["Nahrwan 1967",DATUM["Nahrwan_1967",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NAPARIMA 1972':
+        'GEOGCS["Naparima 1972",DATUM["Naparima_1972",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NAPARIMA 1972 / UTM ZONE 20N':
+        'PROJCS["Naparima 1972 / UTM zone 20N",GEOGCS["Naparima 1972",DATUM["Naparima_1972",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NDG (PARIS)':
+        'GEOGCS["NDG (Paris)",DATUM["Nord_de_Guerre",SPHEROID["Plessis 1817",6376523,308.64]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'NGN':
+        'GEOGCS["NGN",DATUM["National_Geodetic_Network",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NGN / UTM ZONE 38N':
+        'PROJCS["NGN / UTM zone 38N",GEOGCS["NGN",DATUM["National_Geodetic_Network",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NGN / UTM ZONE 39N':
+        'PROJCS["NGN / UTM zone 39N",GEOGCS["NGN",DATUM["National_Geodetic_Network",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NGO 1948':
+        'GEOGCS["NGO 1948",DATUM["NGO_1948",SPHEROID["Bessel Modified",6377492.018,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NORD SAHARA 1959':
+        'GEOGCS["Nord Sahara 1959",DATUM["Nord_Sahara_1959",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NORD SAHARA 1959 / UTM ZONE 29N':
+        'PROJCS["Nord Sahara 1959 / UTM zone 29N",GEOGCS["Nord Sahara 1959",DATUM["Nord_Sahara_1959",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NORD SAHARA 1959 / UTM ZONE 30N':
+        'PROJCS["Nord Sahara 1959 / UTM zone 30N",GEOGCS["Nord Sahara 1959",DATUM["Nord_Sahara_1959",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NORD SAHARA 1959 / UTM ZONE 31N':
+        'PROJCS["Nord Sahara 1959 / UTM zone 31N",GEOGCS["Nord Sahara 1959",DATUM["Nord_Sahara_1959",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NORD SAHARA 1959 / UTM ZONE 32N':
+        'PROJCS["Nord Sahara 1959 / UTM zone 32N",GEOGCS["Nord Sahara 1959",DATUM["Nord_Sahara_1959",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'NSWC 9Z-2':
+        'GEOGCS["NSWC 9Z-2",DATUM["NSWC_9Z_2",SPHEROID["NWL 9D",6378145,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NTF':
+        'GEOGCS["NTF",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'NTF (PARIS)':
+        'GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'NTF (PARIS) / CENTRE FRANCE':
+        'PROJCS["NTF (Paris) / Centre France",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99987742],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'NTF (PARIS) / CORSE':
+        'PROJCS["NTF (Paris) / Corse",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",46.85],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99994471],PARAMETER["false_easting",234.358],PARAMETER["false_northing",185861.369],UNIT["metre",1]]',
+    'NTF (PARIS) / FRANCE I':
+        'PROJCS["NTF (Paris) / France I",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",55],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.999877341],PARAMETER["false_easting",600000],PARAMETER["false_northing",1200000],UNIT["metre",1]]',
+    'NTF (PARIS) / FRANCE II':
+        'PROJCS["NTF (Paris) / France II",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99987742],PARAMETER["false_easting",600000],PARAMETER["false_northing",2200000],UNIT["metre",1]]',
+    'NTF (PARIS) / FRANCE III':
+        'PROJCS["NTF (Paris) / France III",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.999877499],PARAMETER["false_easting",600000],PARAMETER["false_northing",3200000],UNIT["metre",1]]',
+    'NTF (PARIS) / FRANCE IV':
+        'PROJCS["NTF (Paris) / France IV",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",46.85],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99994471],PARAMETER["false_easting",234.358],PARAMETER["false_northing",4185861.369],UNIT["metre",1]]',
+    'NTF (PARIS) / NORD FRANCE':
+        'PROJCS["NTF (Paris) / Nord France",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",55],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.999877341],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'NTF (PARIS) / SUD FRANCE':
+        'PROJCS["NTF (Paris) / Sud France",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.999877499],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1]]',
+    'OBSERVATARIO':
+        'GEOGCS["Observatario",DATUM["Observatario",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'OS(SN)80':
+        'GEOGCS["OS(SN)80",DATUM["OS_SN_1980",SPHEROID["Airy 1830",6377563.396,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'OSGB 1936':
+        'GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",6377563.396,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'OSGB 1936 / BRITISH NATIONAL GRID':
+        'PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",6377563.396,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.999601272],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["metre",1]]',
+    'OSGB70':
+        'GEOGCS["OSGB70",DATUM["OSGB_1970_SN",SPHEROID["Airy 1830",6377563.396,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'PADANG':
+        'GEOGCS["Padang",DATUM["Padang_1884",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'PADANG (JAKARTA)':
+        'GEOGCS["Padang (Jakarta)",DATUM["Padang_1884",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Jakarta",106.807719444444],UNIT["degree",0.0174532925199433]]',
+    'PALESTINE 1923':
+        'GEOGCS["Palestine 1923",DATUM["Palestine_1923",SPHEROID["Clarke 1880 (Benoit)",6378300.79,293.466234570509]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'POINTE NOIRE':
+        'GEOGCS["Pointe Noire",DATUM["Pointe_Noire",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'POINTE NOIRE / UTM ZONE 32S':
+        'PROJCS["Pointe Noire / UTM zone 32S",GEOGCS["Pointe Noire",DATUM["Pointe_Noire",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'PSAD56':
+        'GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'PSAD56 / PERU CENTRAL ZONE':
+        'PROJCS["PSAD56 / Peru central zone",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-9.5],PARAMETER["central_meridian",-76],PARAMETER["scale_factor",0.99932994],PARAMETER["false_easting",720000],PARAMETER["false_northing",1039979.159],UNIT["metre",1]]',
+    'PSAD56 / PERU EAST ZONE':
+        'PROJCS["PSAD56 / Peru east zone",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-9.5],PARAMETER["central_meridian",-70.5],PARAMETER["scale_factor",0.99952992],PARAMETER["false_easting",1324000],PARAMETER["false_northing",1040084.558],UNIT["metre",1]]',
+    'PSAD56 / PERU WEST ZONE':
+        'PROJCS["PSAD56 / Peru west zone",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-6],PARAMETER["central_meridian",-80.5],PARAMETER["scale_factor",0.99983008],PARAMETER["false_easting",222000],PARAMETER["false_northing",1426834.743],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 17S':
+        'PROJCS["PSAD56 / UTM zone 17S",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 18N':
+        'PROJCS["PSAD56 / UTM zone 18N",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 18S':
+        'PROJCS["PSAD56 / UTM zone 18S",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 19N':
+        'PROJCS["PSAD56 / UTM zone 19N",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 19S':
+        'PROJCS["PSAD56 / UTM zone 19S",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 20N':
+        'PROJCS["PSAD56 / UTM zone 20N",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 20S':
+        'PROJCS["PSAD56 / UTM zone 20S",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'PSAD56 / UTM ZONE 21N':
+        'PROJCS["PSAD56 / UTM zone 21N",GEOGCS["PSAD56",DATUM["Provisional_South_American_Datum_1956",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942':
+        'GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 10N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 10N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 11N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 11N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 12N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 12N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 13N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 13N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 14N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 14N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 15N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 15N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 16N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 16N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 17N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 17N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 18N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 18N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 19N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 19N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 20N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 20N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 21N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 21N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 22N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 22N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 23N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 23N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 24N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 24N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 25N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 25N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 26N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 26N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 27N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 27N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 28N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 28N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 29N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 29N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 2N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 2N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 30N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 30N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 31N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 31N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 32N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 32N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 3N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 3N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 4N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 4N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 5N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 5N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 6N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 6N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 7N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 7N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 8N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 8N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER 9N':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger 9N",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 10':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 10",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",1],PARAMETER["false_easting",10500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 11':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 11",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",1],PARAMETER["false_easting",11500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 12':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 12",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",1],PARAMETER["false_easting",12500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 13':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 13",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",13500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 14':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 14",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",14500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 15':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 15",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",15500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 16':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 16",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",16500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 17':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 17",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",17500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 18':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 18",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",18500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 19':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 19",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",19500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 2':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 2",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",1],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 20':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 20",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",20500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 21':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 21",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",21500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 22':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 22",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",22500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 23':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 23",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",23500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 24':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 24",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",1],PARAMETER["false_easting",24500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 25':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 25",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",1],PARAMETER["false_easting",25500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 26':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 26",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",1],PARAMETER["false_easting",26500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 27':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 27",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",1],PARAMETER["false_easting",27500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 28':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 28",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",1],PARAMETER["false_easting",28500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 29':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 29",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",1],PARAMETER["false_easting",29500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 3':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 3",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",1],PARAMETER["false_easting",3500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 30':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 30",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",1],PARAMETER["false_easting",30500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 31':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 31",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",1],PARAMETER["false_easting",31500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 32':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 32",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",1],PARAMETER["false_easting",32500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 4':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 4",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 5':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 5",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 6':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 6",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",1],PARAMETER["false_easting",6500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 7':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 7",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",1],PARAMETER["false_easting",7500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 8':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 8",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",1],PARAMETER["false_easting",8500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1942 / GAUSS-KRUGER ZONE 9':
+        'PROJCS["Pulkovo 1942 / Gauss-Kruger zone 9",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",1],PARAMETER["false_easting",9500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995':
+        'GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 10N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 10N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 11N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 11N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 12N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 12N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 13N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 13N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 14N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 14N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 15N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 15N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 16N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 16N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 17N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 17N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 18N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 18N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 19N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 19N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 20N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 20N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 21N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 21N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 22N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 22N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 23N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 23N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 24N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 24N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 25N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 25N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 26N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 26N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 27N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 27N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 28N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 28N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 29N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 29N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 30N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 30N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 31N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 31N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 32N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 32N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 4N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 4N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 5N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 5N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 6N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 6N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 7N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 7N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 8N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 8N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER 9N':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger 9N",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",1],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 10':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 10",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",1],PARAMETER["false_easting",10500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 11':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 11",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",1],PARAMETER["false_easting",11500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 12':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 12",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",1],PARAMETER["false_easting",12500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 13':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 13",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",13500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 14':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 14",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",1],PARAMETER["false_easting",14500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 15':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 15",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",1],PARAMETER["false_easting",15500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 16':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 16",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",1],PARAMETER["false_easting",16500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 17':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 17",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",1],PARAMETER["false_easting",17500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 18':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 18",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",1],PARAMETER["false_easting",18500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 19':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 19",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",1],PARAMETER["false_easting",19500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 20':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 20",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",20500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 21':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 21",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",1],PARAMETER["false_easting",21500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 22':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 22",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",1],PARAMETER["false_easting",22500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 23':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 23",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",1],PARAMETER["false_easting",23500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 24':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 24",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",1],PARAMETER["false_easting",24500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 25':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 25",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",1],PARAMETER["false_easting",25500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 26':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 26",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",1],PARAMETER["false_easting",26500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 27':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 27",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",1],PARAMETER["false_easting",27500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 28':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 28",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",1],PARAMETER["false_easting",28500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 29':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 29",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",1],PARAMETER["false_easting",29500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 30':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 30",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",1],PARAMETER["false_easting",30500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 31':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 31",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",1],PARAMETER["false_easting",31500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 32':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 32",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",1],PARAMETER["false_easting",32500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 4':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 4",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",4500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 5':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 5",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 6':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 6",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",1],PARAMETER["false_easting",6500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 7':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 7",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",1],PARAMETER["false_easting",7500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 8':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 8",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",1],PARAMETER["false_easting",8500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'PULKOVO 1995 / GAUSS-KRUGER ZONE 9':
+        'PROJCS["Pulkovo 1995 / Gauss-Kruger zone 9",GEOGCS["Pulkovo 1995",DATUM["Pulkovo_1995",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",1],PARAMETER["false_easting",9500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'QATAR':
+        'GEOGCS["Qatar",DATUM["Qatar",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'QATAR / QATAR NATIONAL GRID':
+        'PROJCS["Qatar / Qatar National Grid",GEOGCS["Qatar 1948",DATUM["Qatar_1948",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",24.45],PARAMETER["central_meridian",51.2166666666667],PARAMETER["scale_factor",0.99999],PARAMETER["false_easting",200000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'QATAR 1948':
+        'GEOGCS["Qatar 1948",DATUM["Qatar_1948",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'QORNOQ':
+        'GEOGCS["Qornoq",DATUM["Qornoq",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'RD / NETHERLANDS NEW':
+        'PROJCS["RD / Netherlands New",GEOGCS["Amersfoort",DATUM["Amersfoort",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",52.1561605555556],PARAMETER["central_meridian",5.38763888888889],PARAMETER["scale_factor",0.9999079],PARAMETER["false_easting",155000],PARAMETER["false_northing",463000],UNIT["metre",1]]',
+    'RD / NETHERLANDS OLD':
+        'PROJCS["RD / Netherlands Old",GEOGCS["Amersfoort",DATUM["Amersfoort",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Oblique_Stereographic"],PARAMETER["latitude_of_origin",52.1561605555556],PARAMETER["central_meridian",5.38763888888889],PARAMETER["scale_factor",0.9999079],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'RT38':
+        'GEOGCS["RT38",DATUM["Stockholm_1938",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'RT38 (STOCKHOLM)':
+        'GEOGCS["RT38 (Stockholm)",DATUM["Stockholm_1938",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Stockholm",18.0582777777778],UNIT["degree",0.0174532925199433]]',
+    'RT38 2.5 GON W':
+        'PROJCS["RT38 2.5 gon W",GEOGCS["RT38",DATUM["Stockholm_1938",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15.8082777777778],PARAMETER["scale_factor",1],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'RT90':
+        'GEOGCS["RT90",DATUM["Rikets_koordinatsystem_1990",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'RT90 2.5 GON W':
+        'PROJCS["RT90 2.5 gon W",GEOGCS["RT90",DATUM["Rikets_koordinatsystem_1990",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15.8082777777778],PARAMETER["scale_factor",1],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69':
+        'GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SAD69 / UTM ZONE 17S':
+        'PROJCS["SAD69 / UTM zone 17S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 18N':
+        'PROJCS["SAD69 / UTM zone 18N",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 18S':
+        'PROJCS["SAD69 / UTM zone 18S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 19N':
+        'PROJCS["SAD69 / UTM zone 19N",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 19S':
+        'PROJCS["SAD69 / UTM zone 19S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 20N':
+        'PROJCS["SAD69 / UTM zone 20N",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 20S':
+        'PROJCS["SAD69 / UTM zone 20S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 21N':
+        'PROJCS["SAD69 / UTM zone 21N",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 21S':
+        'PROJCS["SAD69 / UTM zone 21S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 22N':
+        'PROJCS["SAD69 / UTM zone 22N",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 22S':
+        'PROJCS["SAD69 / UTM zone 22S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 23S':
+        'PROJCS["SAD69 / UTM zone 23S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 24S':
+        'PROJCS["SAD69 / UTM zone 24S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAD69 / UTM ZONE 25S':
+        'PROJCS["SAD69 / UTM zone 25S",GEOGCS["SAD69",DATUM["South_American_Datum_1969",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAMBOJA':
+        'GEOGCS["Samboja",DATUM["Samboja",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SAMBOJA / UTM ZONE 50S':
+        'PROJCS["Samboja / UTM zone 50S",GEOGCS["Samboja",DATUM["Samboja",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAPPER HILL 1943':
+        'GEOGCS["Sapper Hill 1943",DATUM["Sapper_Hill_1943",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SAPPER HILL 1943 / UTM ZONE 20S':
+        'PROJCS["Sapper Hill 1943 / UTM zone 20S",GEOGCS["Sapper Hill 1943",DATUM["Sapper_Hill_1943",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SAPPER HILL 1943 / UTM ZONE 21S':
+        'PROJCS["Sapper Hill 1943 / UTM zone 21S",GEOGCS["Sapper Hill 1943",DATUM["Sapper_Hill_1943",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SCHWARZECK':
+        'GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SCHWARZECK / UTM ZONE 33S':
+        'PROJCS["Schwarzeck / UTM zone 33S",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'SEGORA':
+        'GEOGCS["Segora",DATUM["Segora",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SERINDUNG':
+        'GEOGCS["Serindung",DATUM["Serindung",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 15':
+        'PROJCS["South African Coordinate System zone 15",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 17':
+        'PROJCS["South African Coordinate System zone 17",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",17],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 19':
+        'PROJCS["South African Coordinate System zone 19",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",19],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 21':
+        'PROJCS["South African Coordinate System zone 21",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 23':
+        'PROJCS["South African Coordinate System zone 23",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",23],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 25':
+        'PROJCS["South African Coordinate System zone 25",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",25],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 27':
+        'PROJCS["South African Coordinate System zone 27",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 29':
+        'PROJCS["South African Coordinate System zone 29",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",29],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 31':
+        'PROJCS["South African Coordinate System zone 31",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",31],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH AFRICAN COORDINATE SYSTEM ZONE 33':
+        'PROJCS["South African Coordinate System zone 33",GEOGCS["Cape",DATUM["Cape",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 11':
+        'PROJCS["South West African Coord. System zone 11",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",11],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 13':
+        'PROJCS["South West African Coord. System zone 13",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",13],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 15':
+        'PROJCS["South West African Coord. System zone 15",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",15],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 17':
+        'PROJCS["South West African Coord. System zone 17",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",17],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 19':
+        'PROJCS["South West African Coord. System zone 19",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",19],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 21':
+        'PROJCS["South West African Coord. System zone 21",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",21],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 23':
+        'PROJCS["South West African Coord. System zone 23",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",23],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SOUTH WEST AFRICAN COORD. SYSTEM ZONE 25':
+        'PROJCS["South West African Coord. System zone 25",GEOGCS["Schwarzeck",DATUM["Schwarzeck",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator_South_Orientated"],PARAMETER["latitude_of_origin",-22],PARAMETER["central_meridian",25],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["German legal metre",1.0000135965]]',
+    'SUDAN':
+        'GEOGCS["Sudan",DATUM["Sudan",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'SUDAN / UTM ZONE 35N':
+        'PROJCS["Sudan / UTM zone 35N",GEOGCS["Sudan",DATUM["Sudan",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'SUDAN / UTM ZONE 36N':
+        'PROJCS["Sudan / UTM zone 36N",GEOGCS["Sudan",DATUM["Sudan",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'TANANARIVE':
+        'GEOGCS["Tananarive",DATUM["Tananarive_1925",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TANANARIVE (PARIS)':
+        'GEOGCS["Tananarive (Paris)",DATUM["Tananarive_1925",SPHEROID["International 1924",6378388,297]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'TANANARIVE (PARIS) / LABORDE GRID':
+        'PROJCS["Tananarive (Paris) / Laborde Grid",GEOGCS["Tananarive (Paris)",DATUM["Tananarive_1925",SPHEROID["International 1924",6378388,297]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]],PROJECTION["Oblique_Mercator"],PARAMETER["latitude_of_center",-21],PARAMETER["longitude_of_center",49],PARAMETER["azimuth",21],PARAMETER["rectified_grid_angle",21],PARAMETER["scale_factor",0.9995],PARAMETER["false_easting",400000],PARAMETER["false_northing",800000],UNIT["metre",1]]',
+    'TANANARIVE / UTM ZONE 38S':
+        'PROJCS["Tananarive / UTM zone 38S",GEOGCS["Tananarive",DATUM["Tananarive_1925",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'TANANARIVE / UTM ZONE 39S':
+        'PROJCS["Tananarive / UTM zone 39S",GEOGCS["Tananarive",DATUM["Tananarive_1925",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'TC(1948)':
+        'GEOGCS["TC(1948)",DATUM["Trucial_Coast_1948",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TC(1948) / UTM ZONE 39N':
+        'PROJCS["TC(1948) / UTM zone 39N",GEOGCS["TC(1948)",DATUM["Trucial_Coast_1948",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'TC(1948) / UTM ZONE 40N':
+        'PROJCS["TC(1948) / UTM zone 40N",GEOGCS["TC(1948)",DATUM["Trucial_Coast_1948",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'TETE':
+        'GEOGCS["Tete",DATUM["Tete",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TETE / UTM ZONE 36S':
+        'PROJCS["Tete / UTM zone 36S",GEOGCS["Tete",DATUM["Tete",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'TETE / UTM ZONE 37S':
+        'PROJCS["Tete / UTM zone 37S",GEOGCS["Tete",DATUM["Tete",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'TIMBALAI 1948':
+        'GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TIMBALAI 1948 / R.S.O. BORNEO (CH)':
+        'PROJCS["Timbalai 1948 / R.S.O. Borneo (ch)",GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",4],PARAMETER["longitude_of_center",115],PARAMETER["azimuth",53.3158204722222],PARAMETER["rectified_grid_angle",53.1301023611111],PARAMETER["scale_factor",0.99984],PARAMETER["false_easting",0],PARAMETER[" [...]
+    'TIMBALAI 1948 / R.S.O. BORNEO (FT)':
+        'PROJCS["Timbalai 1948 / R.S.O. Borneo (ft)",GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",4],PARAMETER["longitude_of_center",115],PARAMETER["azimuth",53.3158204722222],PARAMETER["rectified_grid_angle",53.1301023611111],PARAMETER["scale_factor",0.99984],PARAMETER["false_easting",0],PARAMETER[" [...]
+    'TIMBALAI 1948 / R.S.O. BORNEO (M)':
+        'PROJCS["Timbalai 1948 / R.S.O. Borneo (m)",GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Hotine_Oblique_Mercator"],PARAMETER["latitude_of_center",4],PARAMETER["longitude_of_center",115],PARAMETER["azimuth",53.3158204722222],PARAMETER["rectified_grid_angle",53.1301023611111],PARAMETER["scale_factor",0.99984],PARAMETER["false_easting",0],PARAMETER["f [...]
+    'TIMBALAI 1948 / UTM ZONE 49N':
+        'PROJCS["Timbalai 1948 / UTM zone 49N",GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'TIMBALAI 1948 / UTM ZONE 50N':
+        'PROJCS["Timbalai 1948 / UTM zone 50N",GEOGCS["Timbalai 1948",DATUM["Timbalai_1948",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'TM65':
+        'GEOGCS["TM65",DATUM["TM65",SPHEROID["Airy Modified 1849",6377340.189,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TM65 / IRISH NATIONAL GRID':
+        'PROJCS["TM65 / Irish National Grid",GEOGCS["TM65",DATUM["TM65",SPHEROID["Airy Modified 1849",6377340.189,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",53.5],PARAMETER["central_meridian",-8],PARAMETER["scale_factor",1.000035],PARAMETER["false_easting",200000],PARAMETER["false_northing",250000],UNIT["metre",1]]',
+    'TM75':
+        'GEOGCS["TM75",DATUM["TM75",SPHEROID["Airy Modified 1849",6377340.189,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TOKYO':
+        'GEOGCS["Tokyo",DATUM["Tokyo",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TRINIDAD 1903':
+        'GEOGCS["Trinidad 1903",DATUM["Trinidad_1903",SPHEROID["Clarke 1858",6378293.63924683,294.260676369257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'TRINIDAD 1903 / TRINIDAD GRID':
+        'PROJCS["Trinidad 1903 / Trinidad Grid",GEOGCS["Trinidad 1903",DATUM["Trinidad_1903",SPHEROID["Clarke 1858",6378293.63924683,294.260676369257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Cassini_Soldner"],PARAMETER["latitude_of_origin",10.4416666666667],PARAMETER["central_meridian",-61.3333333333333],PARAMETER["false_easting",430000],PARAMETER["false_northing",325000],UNIT["link",0.201166194975966]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7001':
+        'GEOGCS["Unknown datum based upon ellipsoid 7001",DATUM["Not_specified_based_on_ellipsoid_7001",SPHEROID["Airy 1830",6377563.396,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7002':
+        'GEOGCS["Unknown datum based upon ellipsoid 7002",DATUM["Not_specified_based_on_ellipsoid_7002",SPHEROID["Airy Modified 1849",6377340.189,299.32496]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7003':
+        'GEOGCS["Unknown datum based upon ellipsoid 7003",DATUM["Not_specified_based_on_ellipsoid_7003",SPHEROID["Australian National Spheroid",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7004':
+        'GEOGCS["Unknown datum based upon ellipsoid 7004",DATUM["Not_specified_based_on_ellipsoid_7004",SPHEROID["Bessel 1841",6377397.155,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7005':
+        'GEOGCS["Unknown datum based upon ellipsoid 7005",DATUM["Not_specified_based_on_ellipsoid_7005",SPHEROID["Bessel Modified",6377492.018,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7006':
+        'GEOGCS["Unknown datum based upon ellipsoid 7006",DATUM["Not_specified_based_on_ellipsoid_7006",SPHEROID["Bessel Namibia",6377483.865,299.15281]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7007':
+        'GEOGCS["Unknown datum based upon ellipsoid 7007",DATUM["Not_specified_based_on_ellipsoid_7007",SPHEROID["Clarke 1858",6378293.63924683,294.260676369257]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7008':
+        'GEOGCS["Unknown datum based upon ellipsoid 7008",DATUM["Not_specified_based_on_ellipsoid_7008",SPHEROID["Clarke 1866",6378206.4,294.978698213901]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7009':
+        'GEOGCS["Unknown datum based upon ellipsoid 7009",DATUM["Not_specified_based_on_ellipsoid_7009",SPHEROID["Clarke 1866 Michigan",6378450.0472441,294.978684676652]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7010':
+        'GEOGCS["Unknown datum based upon ellipsoid 7010",DATUM["Not_specified_based_on_ellipsoid_7010",SPHEROID["Clarke 1880 (Benoit)",6378300.79,293.466234570509]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7011':
+        'GEOGCS["Unknown datum based upon ellipsoid 7011",DATUM["Not_specified_based_on_ellipsoid_7011",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7012':
+        'GEOGCS["Unknown datum based upon ellipsoid 7012",DATUM["Not_specified_based_on_ellipsoid_7012",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7013':
+        'GEOGCS["Unknown datum based upon ellipsoid 7013",DATUM["Not_specified_based_on_ellipsoid_7013",SPHEROID["Clarke 1880 (Arc)",6378249.145,293.46631]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7014':
+        'GEOGCS["Unknown datum based upon ellipsoid 7014",DATUM["Not_specified_based_on_ellipsoid_7014",SPHEROID["Clarke 1880 (SGA 1922)",6378249.2,293.46598]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7015':
+        'GEOGCS["Unknown datum based upon ellipsoid 7015",DATUM["Not_specified_based_on_ellipsoid_7015",SPHEROID["Everest 1830 (1937 Adjustment)",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7016':
+        'GEOGCS["Unknown datum based upon ellipsoid 7016",DATUM["Not_specified_based_on_ellipsoid_7016",SPHEROID["Everest 1830 (1967 Definition)",6377298.556,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7017':
+        'GEOGCS["Unknown datum based upon ellipsoid 7017",DATUM["Not_specified_based_on_ellipsoid_7017",SPHEROID["Everest 1830 (1975 Definition)",6377301.243,300.801737341596]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7018':
+        'GEOGCS["Unknown datum based upon ellipsoid 7018",DATUM["Not_specified_based_on_ellipsoid_7018",SPHEROID["Everest 1830 Modified",6377304.063,300.8017]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7019':
+        'GEOGCS["Unknown datum based upon ellipsoid 7019",DATUM["Not_specified_based_on_ellipsoid_7019",SPHEROID["GRS 1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7020':
+        'GEOGCS["Unknown datum based upon ellipsoid 7020",DATUM["Not_specified_based_on_ellipsoid_7020",SPHEROID["Helmert 1906",6378200,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7021':
+        'GEOGCS["Unknown datum based upon ellipsoid 7021",DATUM["Not_specified_based_on_ellipsoid_7021",SPHEROID["Indonesian National Spheroid",6378160,298.247]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7022':
+        'GEOGCS["Unknown datum based upon ellipsoid 7022",DATUM["Not_specified_based_on_ellipsoid_7022",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7024':
+        'GEOGCS["Unknown datum based upon ellipsoid 7024",DATUM["Not_specified_based_on_ellipsoid_7024",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7025':
+        'GEOGCS["Unknown datum based upon ellipsoid 7025",DATUM["Not_specified_based_on_ellipsoid_7025",SPHEROID["NWL 9D",6378145,298.25]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7026':
+        'GEOGCS["Unknown datum based upon ellipsoid 7026",DATUM["Not_specified_based_on_ellipsoid_7026",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7027':
+        'GEOGCS["Unknown datum based upon ellipsoid 7027",DATUM["Not_specified_based_on_ellipsoid_7027",SPHEROID["Plessis 1817",6376523,308.64]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7028':
+        'GEOGCS["Unknown datum based upon ellipsoid 7028",DATUM["Not_specified_based_on_ellipsoid_7028",SPHEROID["Struve 1860",6378298.3,294.73]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7029':
+        'GEOGCS["Unknown datum based upon ellipsoid 7029",DATUM["Not_specified_based_on_ellipsoid_7029",SPHEROID["War Office",6378300.583,296]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7030':
+        'GEOGCS["Unknown datum based upon ellipsoid 7030",DATUM["Not_specified_based_on_ellipsoid_7030",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7031':
+        'GEOGCS["Unknown datum based upon ellipsoid 7031",DATUM["Not_specified_based_on_ellipsoid_7031",SPHEROID["GEM 10C",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7032':
+        'GEOGCS["Unknown datum based upon ellipsoid 7032",DATUM["Not_specified_based_on_ellipsoid_7032",SPHEROID["OSU86F",6378136.2,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7033':
+        'GEOGCS["Unknown datum based upon ellipsoid 7033",DATUM["Not_specified_based_on_ellipsoid_7033",SPHEROID["OSU91A",6378136.3,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7034':
+        'GEOGCS["Unknown datum based upon ellipsoid 7034",DATUM["Not_specified_based_on_ellipsoid_7034",SPHEROID["Clarke 1880",6378249.13884613,293.466307655625]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7035':
+        'GEOGCS["Unknown datum based upon ellipsoid 7035",DATUM["Not_specified_based_on_ellipsoid_7035",SPHEROID["Sphere",6371000,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'UNKNOWN DATUM BASED UPON ELLIPSOID 7036':
+        'GEOGCS["Unknown datum based upon ellipsoid 7036",DATUM["Not_specified_based_on_ellipsoid_7036",SPHEROID["GRS 1967",6378160,298.247167427]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'VOIROL 1875':
+        'GEOGCS["Voirol 1875",DATUM["Voirol_1875",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'VOIROL 1875 (PARIS)':
+        'GEOGCS["Voirol 1875 (Paris)",DATUM["Voirol_1875",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'VOIROL 1875 / NORD ALGERIE (ANCIENNE)':
+        'PROJCS["Voirol 1875 / Nord Algerie (ancienne)",GEOGCS["Voirol 1875",DATUM["Voirol_1875",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",36],PARAMETER["central_meridian",2.7],PARAMETER["scale_factor",0.999625544],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'VOIROL 1875 / SUD ALGERIE (ANCIENNE)':
+        'PROJCS["Voirol 1875 / Sud Algerie (ancienne)",GEOGCS["Voirol 1875",DATUM["Voirol_1875",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",33.3],PARAMETER["central_meridian",2.7],PARAMETER["scale_factor",0.999625769],PARAMETER["false_easting",500000],PARAMETER["false_northing",300000],UNIT["metre",1]]',
+    'VOIROL UNIFIE':
+        'GEOGCS["Voirol Unifie",DATUM["Voirol_Unifie_1960",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'VOIROL UNIFIE (PARIS)':
+        'GEOGCS["Voirol Unifie (Paris)",DATUM["Voirol_Unifie_1960",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Paris",2.5969213],UNIT["grad",0.015707963267949]]',
+    'VOIROL UNIFIE / NORD ALGERIE':
+        'PROJCS["Voirol Unifie / Nord Algerie",GEOGCS["Voirol Unifie",DATUM["Voirol_Unifie_1960",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",36],PARAMETER["central_meridian",2.7],PARAMETER["scale_factor",0.999625544],PARAMETER["false_easting",500135],PARAMETER["false_northing",300090],UNIT["metre",1]]',
+    'VOIROL UNIFIE / SUD ALGERIE':
+        'PROJCS["Voirol Unifie / Sud Algerie",GEOGCS["Voirol Unifie",DATUM["Voirol_Unifie_1960",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",33.3],PARAMETER["central_meridian",2.7],PARAMETER["scale_factor",0.999625769],PARAMETER["false_easting",500135],PARAMETER["false_northing",300090],UNIT["metre",1]]',
+    'WGS 72':
+        'GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'WGS 72 / UTM ZONE 10N':
+        'PROJCS["WGS 72 / UTM zone 10N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 10S':
+        'PROJCS["WGS 72 / UTM zone 10S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 11N':
+        'PROJCS["WGS 72 / UTM zone 11N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 11S':
+        'PROJCS["WGS 72 / UTM zone 11S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 12N':
+        'PROJCS["WGS 72 / UTM zone 12N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 12S':
+        'PROJCS["WGS 72 / UTM zone 12S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 13N':
+        'PROJCS["WGS 72 / UTM zone 13N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 13S':
+        'PROJCS["WGS 72 / UTM zone 13S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 14N':
+        'PROJCS["WGS 72 / UTM zone 14N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 14S':
+        'PROJCS["WGS 72 / UTM zone 14S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 15N':
+        'PROJCS["WGS 72 / UTM zone 15N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 15S':
+        'PROJCS["WGS 72 / UTM zone 15S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 16N':
+        'PROJCS["WGS 72 / UTM zone 16N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 16S':
+        'PROJCS["WGS 72 / UTM zone 16S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 17N':
+        'PROJCS["WGS 72 / UTM zone 17N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 17S':
+        'PROJCS["WGS 72 / UTM zone 17S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 18N':
+        'PROJCS["WGS 72 / UTM zone 18N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 18S':
+        'PROJCS["WGS 72 / UTM zone 18S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 19N':
+        'PROJCS["WGS 72 / UTM zone 19N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 19S':
+        'PROJCS["WGS 72 / UTM zone 19S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 1N':
+        'PROJCS["WGS 72 / UTM zone 1N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 1S':
+        'PROJCS["WGS 72 / UTM zone 1S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 20N':
+        'PROJCS["WGS 72 / UTM zone 20N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 20S':
+        'PROJCS["WGS 72 / UTM zone 20S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 21N':
+        'PROJCS["WGS 72 / UTM zone 21N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 21S':
+        'PROJCS["WGS 72 / UTM zone 21S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 22N':
+        'PROJCS["WGS 72 / UTM zone 22N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 22S':
+        'PROJCS["WGS 72 / UTM zone 22S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 23N':
+        'PROJCS["WGS 72 / UTM zone 23N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 23S':
+        'PROJCS["WGS 72 / UTM zone 23S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 24N':
+        'PROJCS["WGS 72 / UTM zone 24N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 24S':
+        'PROJCS["WGS 72 / UTM zone 24S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 25N':
+        'PROJCS["WGS 72 / UTM zone 25N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 25S':
+        'PROJCS["WGS 72 / UTM zone 25S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 26N':
+        'PROJCS["WGS 72 / UTM zone 26N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 26S':
+        'PROJCS["WGS 72 / UTM zone 26S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 27N':
+        'PROJCS["WGS 72 / UTM zone 27N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 27S':
+        'PROJCS["WGS 72 / UTM zone 27S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 28N':
+        'PROJCS["WGS 72 / UTM zone 28N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 28S':
+        'PROJCS["WGS 72 / UTM zone 28S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 29N':
+        'PROJCS["WGS 72 / UTM zone 29N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 29S':
+        'PROJCS["WGS 72 / UTM zone 29S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 2N':
+        'PROJCS["WGS 72 / UTM zone 2N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 2S':
+        'PROJCS["WGS 72 / UTM zone 2S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 30N':
+        'PROJCS["WGS 72 / UTM zone 30N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 30S':
+        'PROJCS["WGS 72 / UTM zone 30S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 31N':
+        'PROJCS["WGS 72 / UTM zone 31N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 31S':
+        'PROJCS["WGS 72 / UTM zone 31S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 32N':
+        'PROJCS["WGS 72 / UTM zone 32N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 32S':
+        'PROJCS["WGS 72 / UTM zone 32S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 33N':
+        'PROJCS["WGS 72 / UTM zone 33N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 33S':
+        'PROJCS["WGS 72 / UTM zone 33S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 34N':
+        'PROJCS["WGS 72 / UTM zone 34N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 34S':
+        'PROJCS["WGS 72 / UTM zone 34S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 35N':
+        'PROJCS["WGS 72 / UTM zone 35N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 35S':
+        'PROJCS["WGS 72 / UTM zone 35S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 36N':
+        'PROJCS["WGS 72 / UTM zone 36N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 36S':
+        'PROJCS["WGS 72 / UTM zone 36S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 37N':
+        'PROJCS["WGS 72 / UTM zone 37N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 37S':
+        'PROJCS["WGS 72 / UTM zone 37S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 38N':
+        'PROJCS["WGS 72 / UTM zone 38N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 38S':
+        'PROJCS["WGS 72 / UTM zone 38S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 39N':
+        'PROJCS["WGS 72 / UTM zone 39N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 39S':
+        'PROJCS["WGS 72 / UTM zone 39S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 3N':
+        'PROJCS["WGS 72 / UTM zone 3N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 3S':
+        'PROJCS["WGS 72 / UTM zone 3S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 40N':
+        'PROJCS["WGS 72 / UTM zone 40N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 40S':
+        'PROJCS["WGS 72 / UTM zone 40S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 41N':
+        'PROJCS["WGS 72 / UTM zone 41N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 41S':
+        'PROJCS["WGS 72 / UTM zone 41S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 42N':
+        'PROJCS["WGS 72 / UTM zone 42N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 42S':
+        'PROJCS["WGS 72 / UTM zone 42S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 43N':
+        'PROJCS["WGS 72 / UTM zone 43N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 43S':
+        'PROJCS["WGS 72 / UTM zone 43S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 44N':
+        'PROJCS["WGS 72 / UTM zone 44N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 44S':
+        'PROJCS["WGS 72 / UTM zone 44S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 45N':
+        'PROJCS["WGS 72 / UTM zone 45N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 45S':
+        'PROJCS["WGS 72 / UTM zone 45S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 46N':
+        'PROJCS["WGS 72 / UTM zone 46N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 46S':
+        'PROJCS["WGS 72 / UTM zone 46S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 47N':
+        'PROJCS["WGS 72 / UTM zone 47N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 47S':
+        'PROJCS["WGS 72 / UTM zone 47S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 48N':
+        'PROJCS["WGS 72 / UTM zone 48N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 48S':
+        'PROJCS["WGS 72 / UTM zone 48S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 49N':
+        'PROJCS["WGS 72 / UTM zone 49N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 49S':
+        'PROJCS["WGS 72 / UTM zone 49S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 4N':
+        'PROJCS["WGS 72 / UTM zone 4N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 4S':
+        'PROJCS["WGS 72 / UTM zone 4S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 50N':
+        'PROJCS["WGS 72 / UTM zone 50N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 50S':
+        'PROJCS["WGS 72 / UTM zone 50S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 51N':
+        'PROJCS["WGS 72 / UTM zone 51N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 51S':
+        'PROJCS["WGS 72 / UTM zone 51S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 52N':
+        'PROJCS["WGS 72 / UTM zone 52N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 52S':
+        'PROJCS["WGS 72 / UTM zone 52S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 53N':
+        'PROJCS["WGS 72 / UTM zone 53N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 53S':
+        'PROJCS["WGS 72 / UTM zone 53S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 54N':
+        'PROJCS["WGS 72 / UTM zone 54N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 54S':
+        'PROJCS["WGS 72 / UTM zone 54S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 55N':
+        'PROJCS["WGS 72 / UTM zone 55N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 55S':
+        'PROJCS["WGS 72 / UTM zone 55S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 56N':
+        'PROJCS["WGS 72 / UTM zone 56N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 56S':
+        'PROJCS["WGS 72 / UTM zone 56S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 57N':
+        'PROJCS["WGS 72 / UTM zone 57N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 57S':
+        'PROJCS["WGS 72 / UTM zone 57S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 58N':
+        'PROJCS["WGS 72 / UTM zone 58N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 58S':
+        'PROJCS["WGS 72 / UTM zone 58S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 59N':
+        'PROJCS["WGS 72 / UTM zone 59N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 59S':
+        'PROJCS["WGS 72 / UTM zone 59S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 5N':
+        'PROJCS["WGS 72 / UTM zone 5N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 5S':
+        'PROJCS["WGS 72 / UTM zone 5S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 60N':
+        'PROJCS["WGS 72 / UTM zone 60N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 60S':
+        'PROJCS["WGS 72 / UTM zone 60S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 6N':
+        'PROJCS["WGS 72 / UTM zone 6N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 6S':
+        'PROJCS["WGS 72 / UTM zone 6S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 7N':
+        'PROJCS["WGS 72 / UTM zone 7N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 7S':
+        'PROJCS["WGS 72 / UTM zone 7S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 8N':
+        'PROJCS["WGS 72 / UTM zone 8N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 8S':
+        'PROJCS["WGS 72 / UTM zone 8S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 9N':
+        'PROJCS["WGS 72 / UTM zone 9N",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72 / UTM ZONE 9S':
+        'PROJCS["WGS 72 / UTM zone 9S",GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE':
+        'GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'WGS 72BE / UTM ZONE 10N':
+        'PROJCS["WGS 72BE / UTM zone 10N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 10S':
+        'PROJCS["WGS 72BE / UTM zone 10S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 11N':
+        'PROJCS["WGS 72BE / UTM zone 11N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 11S':
+        'PROJCS["WGS 72BE / UTM zone 11S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 12N':
+        'PROJCS["WGS 72BE / UTM zone 12N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 12S':
+        'PROJCS["WGS 72BE / UTM zone 12S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 13N':
+        'PROJCS["WGS 72BE / UTM zone 13N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 13S':
+        'PROJCS["WGS 72BE / UTM zone 13S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 14N':
+        'PROJCS["WGS 72BE / UTM zone 14N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 14S':
+        'PROJCS["WGS 72BE / UTM zone 14S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 15N':
+        'PROJCS["WGS 72BE / UTM zone 15N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 15S':
+        'PROJCS["WGS 72BE / UTM zone 15S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 16N':
+        'PROJCS["WGS 72BE / UTM zone 16N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 16S':
+        'PROJCS["WGS 72BE / UTM zone 16S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 17N':
+        'PROJCS["WGS 72BE / UTM zone 17N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 17S':
+        'PROJCS["WGS 72BE / UTM zone 17S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 18N':
+        'PROJCS["WGS 72BE / UTM zone 18N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 18S':
+        'PROJCS["WGS 72BE / UTM zone 18S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 19N':
+        'PROJCS["WGS 72BE / UTM zone 19N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 19S':
+        'PROJCS["WGS 72BE / UTM zone 19S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 1N':
+        'PROJCS["WGS 72BE / UTM zone 1N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 1S':
+        'PROJCS["WGS 72BE / UTM zone 1S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 20N':
+        'PROJCS["WGS 72BE / UTM zone 20N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 20S':
+        'PROJCS["WGS 72BE / UTM zone 20S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 21N':
+        'PROJCS["WGS 72BE / UTM zone 21N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 21S':
+        'PROJCS["WGS 72BE / UTM zone 21S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 22N':
+        'PROJCS["WGS 72BE / UTM zone 22N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 22S':
+        'PROJCS["WGS 72BE / UTM zone 22S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 23N':
+        'PROJCS["WGS 72BE / UTM zone 23N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 23S':
+        'PROJCS["WGS 72BE / UTM zone 23S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 24N':
+        'PROJCS["WGS 72BE / UTM zone 24N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 24S':
+        'PROJCS["WGS 72BE / UTM zone 24S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 25N':
+        'PROJCS["WGS 72BE / UTM zone 25N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 25S':
+        'PROJCS["WGS 72BE / UTM zone 25S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 26N':
+        'PROJCS["WGS 72BE / UTM zone 26N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 26S':
+        'PROJCS["WGS 72BE / UTM zone 26S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 27N':
+        'PROJCS["WGS 72BE / UTM zone 27N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 27S':
+        'PROJCS["WGS 72BE / UTM zone 27S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 28N':
+        'PROJCS["WGS 72BE / UTM zone 28N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 28S':
+        'PROJCS["WGS 72BE / UTM zone 28S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 29N':
+        'PROJCS["WGS 72BE / UTM zone 29N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 29S':
+        'PROJCS["WGS 72BE / UTM zone 29S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 2N':
+        'PROJCS["WGS 72BE / UTM zone 2N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 2S':
+        'PROJCS["WGS 72BE / UTM zone 2S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 30N':
+        'PROJCS["WGS 72BE / UTM zone 30N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 30S':
+        'PROJCS["WGS 72BE / UTM zone 30S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 31N':
+        'PROJCS["WGS 72BE / UTM zone 31N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 31S':
+        'PROJCS["WGS 72BE / UTM zone 31S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 32N':
+        'PROJCS["WGS 72BE / UTM zone 32N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 32S':
+        'PROJCS["WGS 72BE / UTM zone 32S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 33N':
+        'PROJCS["WGS 72BE / UTM zone 33N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 33S':
+        'PROJCS["WGS 72BE / UTM zone 33S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 34N':
+        'PROJCS["WGS 72BE / UTM zone 34N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 34S':
+        'PROJCS["WGS 72BE / UTM zone 34S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 35N':
+        'PROJCS["WGS 72BE / UTM zone 35N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 35S':
+        'PROJCS["WGS 72BE / UTM zone 35S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 36N':
+        'PROJCS["WGS 72BE / UTM zone 36N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 36S':
+        'PROJCS["WGS 72BE / UTM zone 36S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 37N':
+        'PROJCS["WGS 72BE / UTM zone 37N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 37S':
+        'PROJCS["WGS 72BE / UTM zone 37S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 38N':
+        'PROJCS["WGS 72BE / UTM zone 38N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 38S':
+        'PROJCS["WGS 72BE / UTM zone 38S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 39N':
+        'PROJCS["WGS 72BE / UTM zone 39N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 39S':
+        'PROJCS["WGS 72BE / UTM zone 39S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 3N':
+        'PROJCS["WGS 72BE / UTM zone 3N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 3S':
+        'PROJCS["WGS 72BE / UTM zone 3S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 40N':
+        'PROJCS["WGS 72BE / UTM zone 40N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 40S':
+        'PROJCS["WGS 72BE / UTM zone 40S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 41N':
+        'PROJCS["WGS 72BE / UTM zone 41N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 41S':
+        'PROJCS["WGS 72BE / UTM zone 41S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 42N':
+        'PROJCS["WGS 72BE / UTM zone 42N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 42S':
+        'PROJCS["WGS 72BE / UTM zone 42S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 43N':
+        'PROJCS["WGS 72BE / UTM zone 43N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 43S':
+        'PROJCS["WGS 72BE / UTM zone 43S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 44N':
+        'PROJCS["WGS 72BE / UTM zone 44N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 44S':
+        'PROJCS["WGS 72BE / UTM zone 44S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 45N':
+        'PROJCS["WGS 72BE / UTM zone 45N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 45S':
+        'PROJCS["WGS 72BE / UTM zone 45S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 46N':
+        'PROJCS["WGS 72BE / UTM zone 46N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 46S':
+        'PROJCS["WGS 72BE / UTM zone 46S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 47N':
+        'PROJCS["WGS 72BE / UTM zone 47N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 47S':
+        'PROJCS["WGS 72BE / UTM zone 47S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 48N':
+        'PROJCS["WGS 72BE / UTM zone 48N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 48S':
+        'PROJCS["WGS 72BE / UTM zone 48S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 49N':
+        'PROJCS["WGS 72BE / UTM zone 49N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 49S':
+        'PROJCS["WGS 72BE / UTM zone 49S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 4N':
+        'PROJCS["WGS 72BE / UTM zone 4N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 4S':
+        'PROJCS["WGS 72BE / UTM zone 4S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 50N':
+        'PROJCS["WGS 72BE / UTM zone 50N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 50S':
+        'PROJCS["WGS 72BE / UTM zone 50S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 51N':
+        'PROJCS["WGS 72BE / UTM zone 51N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 51S':
+        'PROJCS["WGS 72BE / UTM zone 51S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 52N':
+        'PROJCS["WGS 72BE / UTM zone 52N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 52S':
+        'PROJCS["WGS 72BE / UTM zone 52S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 53N':
+        'PROJCS["WGS 72BE / UTM zone 53N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 53S':
+        'PROJCS["WGS 72BE / UTM zone 53S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 54N':
+        'PROJCS["WGS 72BE / UTM zone 54N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 54S':
+        'PROJCS["WGS 72BE / UTM zone 54S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 55N':
+        'PROJCS["WGS 72BE / UTM zone 55N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 55S':
+        'PROJCS["WGS 72BE / UTM zone 55S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 56N':
+        'PROJCS["WGS 72BE / UTM zone 56N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 56S':
+        'PROJCS["WGS 72BE / UTM zone 56S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 57N':
+        'PROJCS["WGS 72BE / UTM zone 57N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 57S':
+        'PROJCS["WGS 72BE / UTM zone 57S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 58N':
+        'PROJCS["WGS 72BE / UTM zone 58N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 58S':
+        'PROJCS["WGS 72BE / UTM zone 58S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 59N':
+        'PROJCS["WGS 72BE / UTM zone 59N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 59S':
+        'PROJCS["WGS 72BE / UTM zone 59S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 5N':
+        'PROJCS["WGS 72BE / UTM zone 5N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 5S':
+        'PROJCS["WGS 72BE / UTM zone 5S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 60N':
+        'PROJCS["WGS 72BE / UTM zone 60N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 60S':
+        'PROJCS["WGS 72BE / UTM zone 60S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 6N':
+        'PROJCS["WGS 72BE / UTM zone 6N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 6S':
+        'PROJCS["WGS 72BE / UTM zone 6S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 7N':
+        'PROJCS["WGS 72BE / UTM zone 7N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 7S':
+        'PROJCS["WGS 72BE / UTM zone 7S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 8N':
+        'PROJCS["WGS 72BE / UTM zone 8N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 8S':
+        'PROJCS["WGS 72BE / UTM zone 8S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 9N':
+        'PROJCS["WGS 72BE / UTM zone 9N",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 72BE / UTM ZONE 9S':
+        'PROJCS["WGS 72BE / UTM zone 9S",GEOGCS["WGS 72BE",DATUM["WGS_1972_Transit_Broadcast_Ephemeris",SPHEROID["NWL 10D",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84':
+        'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'WGS 84 / TM 36 SE':
+        'PROJCS["WGS 84 / TM 36 SE",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",36],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UPS NORTH':
+        'PROJCS["WGS 84 / UPS North",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",90],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.994],PARAMETER["false_easting",2000000],PARAMETER["false_northing",2000000],UNIT["metre",1]]',
+    'WGS 84 / UPS SOUTH':
+        'PROJCS["WGS 84 / UPS South",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.994],PARAMETER["false_easting",2000000],PARAMETER["false_northing",2000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 10N':
+        'PROJCS["WGS 84 / UTM zone 10N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 10S':
+        'PROJCS["WGS 84 / UTM zone 10S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 11N':
+        'PROJCS["WGS 84 / UTM zone 11N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 11S':
+        'PROJCS["WGS 84 / UTM zone 11S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 12N':
+        'PROJCS["WGS 84 / UTM zone 12N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 12S':
+        'PROJCS["WGS 84 / UTM zone 12S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 13N':
+        'PROJCS["WGS 84 / UTM zone 13N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 13S':
+        'PROJCS["WGS 84 / UTM zone 13S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 14N':
+        'PROJCS["WGS 84 / UTM zone 14N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 14S':
+        'PROJCS["WGS 84 / UTM zone 14S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 15N':
+        'PROJCS["WGS 84 / UTM zone 15N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 15S':
+        'PROJCS["WGS 84 / UTM zone 15S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 16N':
+        'PROJCS["WGS 84 / UTM zone 16N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 16S':
+        'PROJCS["WGS 84 / UTM zone 16S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 17N':
+        'PROJCS["WGS 84 / UTM zone 17N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 17S':
+        'PROJCS["WGS 84 / UTM zone 17S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 18N':
+        'PROJCS["WGS 84 / UTM zone 18N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 18S':
+        'PROJCS["WGS 84 / UTM zone 18S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 19N':
+        'PROJCS["WGS 84 / UTM zone 19N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 19S':
+        'PROJCS["WGS 84 / UTM zone 19S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 1N':
+        'PROJCS["WGS 84 / UTM zone 1N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 1S':
+        'PROJCS["WGS 84 / UTM zone 1S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 20N':
+        'PROJCS["WGS 84 / UTM zone 20N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 20S':
+        'PROJCS["WGS 84 / UTM zone 20S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 21N':
+        'PROJCS["WGS 84 / UTM zone 21N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 21S':
+        'PROJCS["WGS 84 / UTM zone 21S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 22N':
+        'PROJCS["WGS 84 / UTM zone 22N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 22S':
+        'PROJCS["WGS 84 / UTM zone 22S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 23N':
+        'PROJCS["WGS 84 / UTM zone 23N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 23S':
+        'PROJCS["WGS 84 / UTM zone 23S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 24N':
+        'PROJCS["WGS 84 / UTM zone 24N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 24S':
+        'PROJCS["WGS 84 / UTM zone 24S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 25N':
+        'PROJCS["WGS 84 / UTM zone 25N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 25S':
+        'PROJCS["WGS 84 / UTM zone 25S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 26N':
+        'PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 26S':
+        'PROJCS["WGS 84 / UTM zone 26S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 27N':
+        'PROJCS["WGS 84 / UTM zone 27N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 27S':
+        'PROJCS["WGS 84 / UTM zone 27S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 28N':
+        'PROJCS["WGS 84 / UTM zone 28N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 28S':
+        'PROJCS["WGS 84 / UTM zone 28S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 29N':
+        'PROJCS["WGS 84 / UTM zone 29N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 29S':
+        'PROJCS["WGS 84 / UTM zone 29S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 2N':
+        'PROJCS["WGS 84 / UTM zone 2N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 2S':
+        'PROJCS["WGS 84 / UTM zone 2S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 30N':
+        'PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 30S':
+        'PROJCS["WGS 84 / UTM zone 30S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 31N':
+        'PROJCS["WGS 84 / UTM zone 31N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 31S':
+        'PROJCS["WGS 84 / UTM zone 31S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 32N':
+        'PROJCS["WGS 84 / UTM zone 32N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 32S':
+        'PROJCS["WGS 84 / UTM zone 32S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 33N':
+        'PROJCS["WGS 84 / UTM zone 33N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 33S':
+        'PROJCS["WGS 84 / UTM zone 33S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 34N':
+        'PROJCS["WGS 84 / UTM zone 34N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 34S':
+        'PROJCS["WGS 84 / UTM zone 34S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",21],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 35N':
+        'PROJCS["WGS 84 / UTM zone 35N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 35S':
+        'PROJCS["WGS 84 / UTM zone 35S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 36N':
+        'PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 36S':
+        'PROJCS["WGS 84 / UTM zone 36S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 37N':
+        'PROJCS["WGS 84 / UTM zone 37N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 37S':
+        'PROJCS["WGS 84 / UTM zone 37S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",39],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 38N':
+        'PROJCS["WGS 84 / UTM zone 38N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 38S':
+        'PROJCS["WGS 84 / UTM zone 38S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 39N':
+        'PROJCS["WGS 84 / UTM zone 39N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 39S':
+        'PROJCS["WGS 84 / UTM zone 39S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",51],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 3N':
+        'PROJCS["WGS 84 / UTM zone 3N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 3S':
+        'PROJCS["WGS 84 / UTM zone 3S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 40N':
+        'PROJCS["WGS 84 / UTM zone 40N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 40S':
+        'PROJCS["WGS 84 / UTM zone 40S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 41N':
+        'PROJCS["WGS 84 / UTM zone 41N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 41S':
+        'PROJCS["WGS 84 / UTM zone 41S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",63],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 42N':
+        'PROJCS["WGS 84 / UTM zone 42N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 42S':
+        'PROJCS["WGS 84 / UTM zone 42S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 43N':
+        'PROJCS["WGS 84 / UTM zone 43N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 43S':
+        'PROJCS["WGS 84 / UTM zone 43S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 44N':
+        'PROJCS["WGS 84 / UTM zone 44N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 44S':
+        'PROJCS["WGS 84 / UTM zone 44S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 45N':
+        'PROJCS["WGS 84 / UTM zone 45N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 45S':
+        'PROJCS["WGS 84 / UTM zone 45S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",87],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 46N':
+        'PROJCS["WGS 84 / UTM zone 46N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 46S':
+        'PROJCS["WGS 84 / UTM zone 46S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 47N':
+        'PROJCS["WGS 84 / UTM zone 47N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 47S':
+        'PROJCS["WGS 84 / UTM zone 47S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",99],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 48N':
+        'PROJCS["WGS 84 / UTM zone 48N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 48S':
+        'PROJCS["WGS 84 / UTM zone 48S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",105],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 49N':
+        'PROJCS["WGS 84 / UTM zone 49N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 49S':
+        'PROJCS["WGS 84 / UTM zone 49S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 4N':
+        'PROJCS["WGS 84 / UTM zone 4N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 4S':
+        'PROJCS["WGS 84 / UTM zone 4S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 50N':
+        'PROJCS["WGS 84 / UTM zone 50N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 50S':
+        'PROJCS["WGS 84 / UTM zone 50S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 51N':
+        'PROJCS["WGS 84 / UTM zone 51N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 51S':
+        'PROJCS["WGS 84 / UTM zone 51S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 52N':
+        'PROJCS["WGS 84 / UTM zone 52N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 52S':
+        'PROJCS["WGS 84 / UTM zone 52S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 53N':
+        'PROJCS["WGS 84 / UTM zone 53N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 53S':
+        'PROJCS["WGS 84 / UTM zone 53S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 54N':
+        'PROJCS["WGS 84 / UTM zone 54N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 54S':
+        'PROJCS["WGS 84 / UTM zone 54S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 55N':
+        'PROJCS["WGS 84 / UTM zone 55N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 55S':
+        'PROJCS["WGS 84 / UTM zone 55S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 56N':
+        'PROJCS["WGS 84 / UTM zone 56N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 56S':
+        'PROJCS["WGS 84 / UTM zone 56S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 57N':
+        'PROJCS["WGS 84 / UTM zone 57N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 57S':
+        'PROJCS["WGS 84 / UTM zone 57S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",159],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 58N':
+        'PROJCS["WGS 84 / UTM zone 58N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 58S':
+        'PROJCS["WGS 84 / UTM zone 58S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",165],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 59N':
+        'PROJCS["WGS 84 / UTM zone 59N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 59S':
+        'PROJCS["WGS 84 / UTM zone 59S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",171],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 5N':
+        'PROJCS["WGS 84 / UTM zone 5N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 5S':
+        'PROJCS["WGS 84 / UTM zone 5S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 60N':
+        'PROJCS["WGS 84 / UTM zone 60N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 60S':
+        'PROJCS["WGS 84 / UTM zone 60S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",177],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 6N':
+        'PROJCS["WGS 84 / UTM zone 6N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 6S':
+        'PROJCS["WGS 84 / UTM zone 6S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 7N':
+        'PROJCS["WGS 84 / UTM zone 7N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 7S':
+        'PROJCS["WGS 84 / UTM zone 7S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-141],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 8N':
+        'PROJCS["WGS 84 / UTM zone 8N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 8S':
+        'PROJCS["WGS 84 / UTM zone 8S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-135],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 9N':
+        'PROJCS["WGS 84 / UTM zone 9N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'WGS 84 / UTM ZONE 9S':
+        'PROJCS["WGS 84 / UTM zone 9S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-129],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1]]',
+    'YACARE':
+        'GEOGCS["Yacare",DATUM["Yacare",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'YOFF':
+        'GEOGCS["Yoff",DATUM["Yoff",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'YOFF / UTM ZONE 28N':
+        'PROJCS["Yoff / UTM zone 28N",GEOGCS["Yoff",DATUM["Yoff",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+    'ZANDERIJ':
+        'GEOGCS["Zanderij",DATUM["Zanderij",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]',
+    'ZANDERIJ / UTM ZONE 21N':
+        'PROJCS["Zanderij / UTM zone 21N",GEOGCS["Zanderij",DATUM["Zanderij",SPHEROID["International 1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-57],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]',
+}
+
+#
+# The rest of this is for testing from the command line
+#
+if __name__ == "__main__":
+    wgs84_descript = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'
+
+    descript = name_to_descript("wgs 84")
+    if descript != wgs84_descript:
+        raise ValueError("'wgs 84' as an argument:\n" \
+                         "    expect: %s\n"
+                         "    found:  %s" % (wgs84_descript, descript))
+
+    num_descripts = len(_DESCRIPT_DICT)
+    if num_descripts != 1337:
+        raise ValueError("Number of entries in _DESCRIPT_DICT: expect: 1337, found: %d" % num_descripts)
+
+    print "mapprj: SUCCESS"
diff --git a/pyfermod/fershp/shapefile_readxy.py b/pyfermod/fershp/shapefile_readxy.py
new file mode 100644
index 0000000..ccc1e81
--- /dev/null
+++ b/pyfermod/fershp/shapefile_readxy.py
@@ -0,0 +1,126 @@
+"""
+Returns the X and Y (presumably longitude,latitude)
+coordinates from the points in the indicated shapefile.
+The missing value separates coordinates between shapes.
+"""
+
+import numpy
+import pyferret
+import shapefile
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_readxy PyEF
+    """
+    retdict = { "numargs": 2,
+                "descript": "Returns X,Y coordinates of shapes from shapefile.  "
+                            "Missing value separates shapes.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "MAXPTS", ),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "Max. number of points to return (-1 for all, but reads shapefile twice)", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_readxy PyEF
+    """
+    maxpts = pyferret.get_arg_one_val(efid, pyferret.ARG2)
+    maxpts = int(maxpts)
+    if maxpts == -1:
+        shapefile_name = pyferret.get_arg_one_val(efid, pyferret.ARG1)
+        sf = shapefile.Reader(shapefile_name)
+        maxpts = 0
+        for shp in sf.shapes():
+            maxpts += len(shp.points) + 1
+    elif maxpts < 1:
+        raise ValueError("MAXPTS must be a positive integer or -1")
+    return ( (1, maxpts), (1, 2), None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Read the shapefile named in inputs[0] and assign result[:,0,0,0]
+    with the X coordinates, and result[:,1,0,0] with the Y coordinates
+    of the shapes contained in the shapefile.  The missing value,
+    resbdf, is assigned as the coordinates of a point separating
+    different shapes.
+    """
+    result[:,:,:,:,:,:] = resbdf
+    sf = shapefile.Reader(inputs[0])
+    try:
+        pt_index = 0
+        for shp in sf.shapes():
+            for pt in shp.points:
+                result[pt_index,:2,0,0,0,0] = pt[:2]
+                pt_index += 1
+            # missing value coordinates (already assigned) separating shapes
+            pt_index += 1
+    except IndexError:
+        # hit the maximum number of points
+        pass
+
+
+#
+# The rest of this is for testing from the command line
+#
+if __name__ == "__main__":
+    import time
+
+    # make sure ferret_init does not cause problems
+    info = ferret_init(0)
+
+    resbdf = numpy.array([-9999.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([-8888.0, -7777.0], dtype=numpy.float64)
+    maxpts = 3200 * 2400
+    result = -6666.0 * numpy.ones((maxpts,2,1,1,1,1), dtype=numpy.float64, order='F')
+    print "ferret_compute start: time = %s" % time.asctime()
+    ferret_compute(0, result, resbdf, ("tl_2010_us_county10", maxpts, ), inpbdfs)
+    print "ferret_compute done; time = %s" % time.asctime()
+    good_x = numpy.logical_and((-180.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= -65.0))
+    good_x = numpy.logical_or(good_x,
+                 numpy.logical_and((172.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= 180.0)))
+    good_y = numpy.logical_and((17.0 <= result[:,1,0,0,0,0]), (result[:,1,0,0,0,0] <= 72.0))
+    if numpy.logical_xor(good_x, good_y).any():
+        raise ValueError("good_x != good_y")
+    missing_x = ( result[:,0,0,0,0,0] == resbdf )
+    if numpy.logical_xor(good_x, numpy.logical_not(missing_x)).any():
+        raise ValueError("good_x != not missing_x")
+    missing_y = ( result[:,1,0,0,0,0] == resbdf )
+    if numpy.logical_xor(good_y, numpy.logical_not(missing_y)).any():
+        raise ValueError("good_y != not missing_y")
+    count = 0
+    at_end = False
+    shape_num = 0
+    total = 0
+    for k in xrange(result.shape[0]):
+        if missing_x[k]:
+            if count == 0:
+                at_end = True
+            else:
+                # print "Count[%d] = %d" % (shape_num, count)
+                shape_num += 1
+                total += count + 1
+                count = 0
+        elif at_end:
+            raise ValueError("More than one missing value between shapes")
+        else:
+            count += 1
+    total += count
+    print "total (including missing-value separators) = %d" % total
+    print "out of a maximum of %d" %  result.shape[0]
+    print "number of shapes = %d" % shape_num
+    print "shapefile_readxy: SUCCESS"
+
diff --git a/pyfermod/fershp/shapefile_readxyval.py b/pyfermod/fershp/shapefile_readxyval.py
new file mode 100644
index 0000000..7a63cd5
--- /dev/null
+++ b/pyfermod/fershp/shapefile_readxyval.py
@@ -0,0 +1,171 @@
+"""
+Returns X and Y coordinates (presumably longitude and
+latitude), as well as a value for shapes from a shapefile.
+The missing value separates coordinates between shapes.
+"""
+
+import numpy
+import pyferret
+import shapefile
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_readxyval PyEF
+    """
+    retdict = { "numargs": 3,
+                "descript": "Returns X, Y, and a value from shapes in a shapefile.  "
+                            "Missing value separates shapes.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "VALNAME", "MAXPTS", ),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "Name of value to retrieve",
+                                  "Max. number of points to return (-1 for all, but reads shapefile twice)", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_readxyval PyEF
+    """
+    maxpts = pyferret.get_arg_one_val(efid, pyferret.ARG3)
+    maxpts = int(maxpts)
+    if maxpts == -1:
+        shapefile_name = pyferret.get_arg_one_val(efid, pyferret.ARG1)
+        sf = shapefile.Reader(shapefile_name)
+        maxpts = 0
+        for shp in sf.shapes():
+            maxpts += len(shp.points) + 1
+    elif maxpts < 1:
+        raise ValueError("MAXPTS must be a positive integer or -1")
+    return ( (1, maxpts), (1, 3), None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Read the shapefile named in inputs[0] and assign result[:,0,0,0]
+    with the X coordinates, result[:,1,0,0] with the Y coordinates
+    of the shapes contained in the shapefile.  The missing value,
+    resbdf, is assigned as the coordinates of a point separating
+    different shapes.  Also assigns result[:,2,0,0] with the value
+    of the field named in inputs[1] associated with each shape.
+    """
+    # Initialize all results to the missing value flag to make it easier later on
+    result[:,:,:,:,:,:] = resbdf
+
+    # Open the shapefile for reading and read the metadata
+    sf = shapefile.Reader(inputs[0])
+
+    # Find the index of the desired field in the shapefile
+    fieldname = inputs[1].strip()
+    # No function currently in the shapefile module to do this, so a bit of a hack here
+    # Each field in shapefile is a tuple (name, type, size, precision)
+    for k in xrange(len(sf.fields)):
+        if sf.fields[k][0] == fieldname:
+            break
+    else:
+        print "Known fields (name, type, size, precision):"
+        for field in sf.fields:
+            if field[0] != 'DeletionFlag':
+                print "    %s" % str(field)
+        raise ValueError("No field with the name '%s' found" % fieldname)
+    if sf.fields[0][0] == 'DeletionFlag':
+        field_index = k - 1
+    else:
+        field_index = k
+
+    # Retrieve the coordinates of the shapes
+    num_shapes = 0
+    try:
+        pt_index = 0
+        for shp in sf.shapes():
+            num_shapes += 1
+            for pt in shp.points:
+                result[pt_index,:2,0,0,0,0] = pt[:2]
+                pt_index += 1
+            # missing value coordinates (already assigned) separating shapes
+            pt_index += 1
+    except IndexError:
+        # hit the maximum number of points
+        pass
+    if num_shapes < 1:
+        raise ValueError("No shapes found")
+
+    # Retrieve the field values
+    rec_index = 0
+    for rec in sf.records():
+        result[rec_index,2,0,0,0,0] = float(rec[field_index])
+        rec_index += 1
+        # only get field values for shapes that were read
+        if rec_index >= num_shapes:
+            break
+
+
+#
+# The rest of this is for testing from the command line
+#
+if __name__ == "__main__":
+    import time
+
+    # make sure ferret_init does not cause problems
+    info = ferret_init(0)
+
+    resbdf = numpy.array([-9999.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([-8888.0, -7777.0], dtype=numpy.float64)
+    maxpts = 3200 * 2400
+    result = -6666.0 * numpy.ones((maxpts,3,1,1,1,1), dtype=numpy.float64, order='F')
+    print "ferret_compute start: time = %s" % time.asctime()
+    # INTPTLAT10 == latitude of an internal point in each county
+    ferret_compute(0, result, resbdf, ("tl_2010_us_county10", "INTPTLAT10", maxpts, ), inpbdfs)
+    print "ferret_compute done; time = %s" % time.asctime()
+    good_x = numpy.logical_and((-180.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= -65.0))
+    good_x = numpy.logical_or(good_x,
+                 numpy.logical_and((172.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= 180.0)))
+    good_y = numpy.logical_and((17.0 <= result[:,1,0,0,0,0]), (result[:,1,0,0,0,0] <= 72.0))
+    if numpy.logical_xor(good_x, good_y).any():
+        raise ValueError("good_x != good_y")
+    missing_x = ( result[:,0,0,0,0,0] == resbdf )
+    if numpy.logical_xor(good_x, numpy.logical_not(missing_x)).any():
+        raise ValueError("good_x != not missing_x")
+    missing_y = ( result[:,1,0,0,0,0] == resbdf )
+    if numpy.logical_xor(good_y, numpy.logical_not(missing_y)).any():
+        raise ValueError("good_y != not missing_y")
+    count = 0
+    at_end = False
+    shape_num = 0
+    total = 0
+    for k in xrange(result.shape[0]):
+        if missing_x[k]:
+            if count == 0:
+                at_end = True
+            else:
+                # print "Count[%d] = %d" % (shape_num, count)
+                shape_num += 1
+                total += count + 1
+                count = 0
+        elif at_end:
+            raise ValueError("More than one missing value between shapes")
+        else:
+            count += 1
+    total += count
+    good_val = numpy.logical_and((17.0 <= result[:,2,0,0,0,0]), (result[:,2,0,0,0,0] <= 72.0))
+    missing_val = ( result[:,2,0,0,0,0] == resbdf )
+    if numpy.logical_xor(good_val, numpy.logical_not(missing_val)).any():
+        raise ValueError("good_val != not missing_val")
+    num_good = len(result[:,2,0,0,0,0][good_val])
+    if num_good != shape_num:
+        raise ValueError("number of values: expected %d, found %d" % (shape_num, num_good))
+    print "shapefile_readxyval: SUCCESS"
+
diff --git a/pyfermod/fershp/shapefile_readxyz.py b/pyfermod/fershp/shapefile_readxyz.py
new file mode 100644
index 0000000..1340a28
--- /dev/null
+++ b/pyfermod/fershp/shapefile_readxyz.py
@@ -0,0 +1,87 @@
+"""
+Returns the X, Y, and Z (presumably longitude, latitude, level)
+coordinates from the points in the indicated shapefile.
+The missing value separates coordinates between shapes.
+"""
+
+import numpy
+import pyferret
+import shapefile
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_readxyz PyEF
+    """
+    retdict = { "numargs": 2,
+                "descript": "Returns X,Y,Z coordinates of shapes from shapefile.  "
+                            "Missing value separates shapes.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "MAXPTS", ),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "Max. number of points to return (-1 for all, but reads shapefile twice)", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_readxyz PyEF
+    """
+    maxpts = pyferret.get_arg_one_val(efid, pyferret.ARG2)
+    maxpts = int(maxpts)
+    if maxpts == -1:
+        shapefile_name = pyferret.get_arg_one_val(efid, pyferret.ARG1)
+        sf = shapefile.Reader(shapefile_name)
+        maxpts = 0
+        for shp in sf.shapes():
+            maxpts += len(shp.points) + 1
+    elif maxpts < 1:
+        raise ValueError("MAXPTS must be a positive integer or -1")
+    return ( (1, maxpts), (1, 3), None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Read the shapefile named in inputs[0] and assign result[:,0,0,0]
+    the X coordinates, result[:,1,0,0] with the Y coordinates, and
+    result[:,2,0,0] with the Z coordinates of the shapes contained
+    in the shapefile.  The missing value, resbdf, is assigned as the
+    coordinates of a point separating different shapes.
+    """
+    result[:,:,:,:,:,:] = resbdf
+    sf = shapefile.Reader(inputs[0])
+    try:
+        pt_index = 0
+        for shp in sf.shapes():
+            for (pt,z) in zip(shp.points,shp.z):
+                result[pt_index,:2,0,0,0,0] = pt[:2]
+                result[pt_index, 2,0,0,0,0] = z
+                pt_index += 1
+            # missing value coordinates (already assigned) separating shapes
+            pt_index += 1
+    except IndexError:
+        # hit the maximum number of points
+        pass
+
+
+#
+# The rest of this is for testing from the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not cause problems
+    info = ferret_init(0)
+
+    # this is tested under shapefile_writexyzval
+    print "shapefile_readxyz: SUCCESS (limited)"
+    print "    run shapefile_writexyzval for full test"
+
diff --git a/pyfermod/fershp/shapefile_readxyzval.py b/pyfermod/fershp/shapefile_readxyzval.py
new file mode 100644
index 0000000..5c9d739
--- /dev/null
+++ b/pyfermod/fershp/shapefile_readxyzval.py
@@ -0,0 +1,129 @@
+"""
+Returns X, Y, and Z coordinates (presumably longitude,
+latitude, and level), as well as a value for shapes from
+a shapefile.  The missing value separates coordinates
+between shapes.
+"""
+
+import numpy
+import pyferret
+import shapefile
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_readxyzval PyEF
+    """
+    retdict = { "numargs": 3,
+                "descript": "Returns X, Y, Z, and a value from shapes in a shapefile.  "
+                            "Missing value separates shapes.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "VALNAME", "MAXPTS", ),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "Name of value to retrieve",
+                                  "Max. number of points to return (-1 for all, but reads shapefile twice)", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_readxyzval PyEF
+    """
+    maxpts = pyferret.get_arg_one_val(efid, pyferret.ARG3)
+    maxpts = int(maxpts)
+    if maxpts == -1:
+        shapefile_name = pyferret.get_arg_one_val(efid, pyferret.ARG1)
+        sf = shapefile.Reader(shapefile_name)
+        maxpts = 0
+        for shp in sf.shapes():
+            maxpts += len(shp.points) + 1
+    elif maxpts < 1:
+        raise ValueError("MAXPTS must be a positive integer or -1")
+    return ( (1, maxpts), (1, 4), None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Read the shapefile named in inputs[0] and assign result[:,0,0,0]
+    with the X coordinates, result[:,1,0,0] with the Y coordinates,
+    and result[:,2,0,0] with the Z coordinates of the shapes contained
+    in the shapefile.  The missing value, resbdf, is assigned as the
+    coordinates of a point separating different shapes.  Also assigns
+    result[:,3,0,0] with the value of the field named in inputs[1]
+    associated with each shape.
+    """
+    # Initialize all results to the missing value flag to make it easier later on
+    result[:,:,:,:,:,:] = resbdf
+
+    # Open the shapefile for reading and read the metadata
+    sf = shapefile.Reader(inputs[0])
+
+    # Find the index of the desired field in the shapefile
+    fieldname = inputs[1].strip()
+    # No function currently in the shapefile module to do this, so a bit of a hack here
+    # Each field in shapefile is a tuple (name, type, size, precision)
+    for k in xrange(len(sf.fields)):
+        if sf.fields[k][0] == fieldname:
+            break
+    else:
+        print "Known fields (name, type, size, precision):"
+        for field in sf.fields:
+            if field[0] != 'DeletionFlag':
+                print "    %s" % str(field)
+        raise ValueError("No field with the name '%s' found" % fieldname)
+    if sf.fields[0][0] == 'DeletionFlag':
+        field_index = k - 1
+    else:
+        field_index = k
+
+    # Retrieve the coordinates of the shapes
+    num_shapes = 0
+    try:
+        pt_index = 0
+        for shp in sf.shapes():
+            num_shapes += 1
+            for (pt, z) in zip(shp.points, shp.z):
+                result[pt_index,:2,0,0,0,0] = pt[:2]
+                result[pt_index, 2,0,0,0,0] = z
+                pt_index += 1
+            # missing value coordinates (already assigned) separating shapes
+            pt_index += 1
+    except IndexError:
+        # hit the maximum number of points
+        pass
+    if num_shapes < 1:
+        raise ValueError("No shapes found")
+
+    # Retrieve the field values
+    rec_index = 0
+    for rec in sf.records():
+        result[rec_index,3,0,0,0,0] = float(rec[field_index])
+        rec_index += 1
+        # only get field values for shapes that were read
+        if rec_index >= num_shapes:
+            break
+
+
+#
+# The rest of this is for testing from the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not cause problems
+    info = ferret_init(0)
+
+    # this is tested under shapefile_writexyzval
+    print "shapefile_readxyzval: SUCCESS (limited)"
+    print "    run shapefile_writexyzval for full test"
+
diff --git a/pyfermod/fershp/shapefile_writeval.py b/pyfermod/fershp/shapefile_writeval.py
new file mode 100644
index 0000000..68e5a1e
--- /dev/null
+++ b/pyfermod/fershp/shapefile_writeval.py
@@ -0,0 +1,148 @@
+"""
+Creates a shapefile with a given root name using data from a given value
+array.  The shapes are quadrilaterals in the X,Y-plane at a given Z (if
+this axis is used).  The vertices of the quadrilaterals are the values
+of the bounding boxes of the X and Y axes of the given value array.  The
+value(s) associated with each shape comes from the value array.
+"""
+
+import pyferret
+import pyferret.fershp
+import shapefile
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_writeval PyEF
+    """
+    retdict = { "numargs": 4,
+                "descript": "Writes a shapefile of XY quadrilaterals associated with given values",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "VALUE", "VALNAME", "MAPPRJ"),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "Shape values; X and Y axes required, " \
+                                      "Z axis optional, T axis undefined or singleton",
+                                  "Name for the shape value",
+                                  "Common name or WKT description of map projection; " \
+                                      "if blank, WGS 84 is used", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.STRING_ONEVAL,
+                              pyferret.STRING_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_writeval PyEF
+    """
+    return ( (1, 1), None, None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Create the shapefile named in inputs[0] using the values array
+    given in inputs[1].  The bounding box limits of the X and Y axes
+    of inputs[1] are used to create the quadrilaterals.  The values
+    in inputs[1] are used as the values associated with each shape
+    using the field name given in inputs[2].  Either a common name
+    or a WKT description of the map projection for the coordinated
+    should be given in inputs[3].  If blank, WGS 84 is used.  If
+    successful, fills result (which might as well be a 1x1x1x1 array)
+    with zeros.  If a problem occurs, an error will be raised.
+    """
+    shapefile_name = inputs[0]
+    values = inputs[1]
+    missing_value = inpbdfs[1]
+    field_name = inputs[2].strip()
+    if not field_name:
+        field_name = "VALUE"
+    map_projection = inputs[3]
+
+    # Verify the shapes are as expected
+    if (values.shape[3] != 1) or (values.shape[4] != 1) or (values.shape[5] != 1):
+        raise ValueError("The T, E, and F axes of VALUE must be undefined or singleton axes")
+
+    # Get the X axis box limits for the quadrilateral coordinates
+    x_box_limits = pyferret.get_axis_box_limits(efid, pyferret.ARG2, pyferret.X_AXIS)
+    if x_box_limits == None:
+        raise ValueError("Unable to determine the X axis box limits")
+    lowerxs = x_box_limits[0]
+    upperxs = x_box_limits[1]
+
+    # Get the Y axis box limits for the quadrilateral coordinates
+    y_box_limits = pyferret.get_axis_box_limits(efid, pyferret.ARG2, pyferret.Y_AXIS)
+    if y_box_limits == None:
+        raise ValueError("Unable to determine the y axis box limits")
+    lowerys = y_box_limits[0]
+    upperys = y_box_limits[1]
+
+    # Get the elevation/depth coordinates, or None if they do not exist
+    z_coords = pyferret.get_axis_coordinates(efid, pyferret.ARG2, pyferret.Z_AXIS)
+
+    # Create polygons with a single field value
+    if z_coords == None:
+        sfwriter = shapefile.Writer(shapefile.POLYGON)
+    else:
+        sfwriter = shapefile.Writer(shapefile.POLYGONZ)
+    sfwriter.field(field_name, "N", 20, 7)
+
+    # Write out the shapes and the records
+    shape_written = False
+    if z_coords == None:
+        for j in xrange(len(lowerys)):
+            for i in xrange(len(lowerxs)):
+                if values[i, j, 0, 0, 0, 0] != missing_value:
+                    pyferret.fershp.addquadxyvalues(sfwriter,
+                                    ( lowerxs[i], lowerys[j] ),
+                                    ( lowerxs[i], upperys[j] ),
+                                    ( upperxs[i], upperys[j] ),
+                                    ( upperxs[i], lowerys[j] ),
+                                    None,
+                                    [ float(values[i, j, 0, 0, 0, 0]) ])
+                    shape_written = True
+    else:
+        for k in xrange(len(z_coords)):
+            for j in xrange(len(lowerys)):
+                for i in xrange(len(lowerxs)):
+                    if values[i, j, k, 0, 0, 0] != missing_value:
+                        pyferret.fershp.addquadxyvalues(sfwriter,
+                                        ( lowerxs[i], lowerys[j] ),
+                                        ( lowerxs[i], upperys[j] ),
+                                        ( upperxs[i], upperys[j] ),
+                                        ( upperxs[i], lowerys[j] ),
+                                        z_coords[k],
+                                        [ float(values[i, j, k, 0, 0, 0]) ])
+                        shape_written = True
+    if not shape_written:
+        raise ValueError("All values are missing values")
+    sfwriter.save(shapefile_name)
+
+    # Create the .prj file from the map projection common name or the WKT description
+    pyferret.fershp.createprjfile(map_projection, shapefile_name)
+    result[:, :, :, :, :, :] = 0
+
+
+#
+# The following is only for testing this module from the command line
+#
+if __name__ == "__main__":
+    # make sure these calls do not generate errors
+    info = ferret_init(0)
+    del info
+    limits = ferret_result_limits(0)
+    del limits
+    # Testing ferret_compute difficult due to call
+    # to get_axis_box_limits and get_axis_coordinates
+
+    print "shapefile_writeval: SUCCESS (limited)"
diff --git a/pyfermod/fershp/shapefile_writexyval.py b/pyfermod/fershp/shapefile_writexyval.py
new file mode 100644
index 0000000..1c81188
--- /dev/null
+++ b/pyfermod/fershp/shapefile_writexyval.py
@@ -0,0 +1,327 @@
+"""
+Creates a shapefile with a given root name using data from given
+X, Y, and value arrays (curvilinear-type data).  The shapes are
+quadrilaterals in the X,Y-plane derived from the X and Y arrays;
+i.e., vertices are the (i,j), (i,j+1), (i+1,j+1), and (i+1,j)
+elements of the X and Y coordinates.  The value associated with
+each quadrilateral comes from the value array; i.e., the (i,j)
+element of the value for the previously mentioned quadrilateral.
+Quadrilaterals associated with missing values are omitted from
+the shapefile.
+"""
+
+import shapefile
+import pyferret
+import pyferret.fershp
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_writexyval PyEF
+    """
+    retdict = { "numargs": 6,
+                "descript": "Writes a shapefile of XY quadrilaterals from the curvilinear data arrays.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "GRIDX", "GRIDY", "VALUE", "VALNAME", "MAPPRJ"),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "X values (longitudes) for the quad. grid; must be 2D on X and Y axes",
+                                  "Y values (latitudes) for the quad. grid; must be 2D on X and Y axes",
+                                  "Shape values; must be 2D on X and Y axes",
+                                  "Name for the shape value",
+                                  "Common name or WKT description of map projection; " \
+                                      "if blank, WGS 84 is used", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.STRING_ONEVAL,
+                              pyferret.STRING_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_writexyval PyEF
+    """
+    return ( (1, 1), None, None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Create the shapefile named in inputs[0] using the grid X coordinates given
+    in inputs[1], grid Y coordinates given in inputs[2], and shape values given
+    in inputs[3].  The X,Y coordinates are used for the quadrilaterals vertices
+    and must have an additional value along each dimension.  The value [i,j]
+    is used for the quadrilateral with diagonal corners [i, j] and [i+1, j+1].
+    Quadrilateral associated with missing values are omitted from the shapefile.
+    The field name for the value in the shapefile given in inputs[4].  Either a
+    common name or a WKT description of the map projection for the coordinates
+    should be given in inputs[5].  If blank, WGS 84 is used.  If successful,
+    fills result (which might as well be a 1x1x1x1 array) with zeros.  If a
+    problem occurs, an error will be raised.
+    """
+    shapefile_name = inputs[0]
+    grid_xs = inputs[1]
+    grid_ys = inputs[2]
+    grid_vals = inputs[3]
+    missing_val = inpbdfs[3]
+    field_name = inputs[4].strip()
+    if not field_name:
+        field_name = "VALUE"
+    map_projection = inputs[5]
+
+    # Verify the shapes are as expected
+    if (grid_vals.shape[2] != 1) or (grid_vals.shape[3] != 1) or \
+       (grid_vals.shape[4] != 1) or (grid_vals.shape[5] != 1):
+        raise ValueError("The Z, T, E, and F axes of VALUE must be undefined or singleton axes")
+    exp_shape = ( grid_vals.shape[0] + 1, grid_vals.shape[1] + 1, 1, 1, 1, 1 )
+    if (grid_xs.shape != exp_shape) or (grid_ys.shape != exp_shape):
+         raise ValueError('GRIDX and GRIDY must have one more value along both X and Y axes compared to VALUE')
+
+    # Create polygons with a single field value
+    sfwriter = shapefile.Writer(shapefile.POLYGON)
+    sfwriter.field(field_name, "N", 20, 7)
+
+    # Add the shapes with their values
+    shape_written = False
+    for j in xrange(grid_vals.shape[1]):
+        for i in xrange(grid_vals.shape[0]):
+            if grid_vals[i, j, 0, 0, 0, 0] != missing_val:
+                shape_written = True
+                pyferret.fershp.addquadxyvalues(sfwriter,
+                         (grid_xs[i,   j,   0, 0, 0, 0], grid_ys[i,   j,   0, 0, 0, 0]),
+                         (grid_xs[i,   j+1, 0, 0, 0, 0], grid_ys[i,   j+1, 0, 0, 0, 0]),
+                         (grid_xs[i+1, j+1, 0, 0, 0, 0], grid_ys[i+1, j+1, 0, 0, 0, 0]),
+                         (grid_xs[i+1, j,   0, 0, 0, 0], grid_ys[i+1, j,   0, 0, 0, 0]),
+                         None, [ float(grid_vals[i, j, 0, 0, 0, 0]) ])
+    if not shape_written:
+        raise ValueError("All values are missing values")
+    sfwriter.save(shapefile_name)
+
+    # Create the .prj file from the map projection common name or the WKT description
+    pyferret.fershp.createprjfile(map_projection, shapefile_name)
+    result[:, :, :, :, :, :] = 0
+
+
+#
+# The following is only for testing this module from the command line
+#
+if __name__ == "__main__":
+    import numpy
+    import os
+
+    shapefilename = "tripolar"
+    fieldname = "AREA"
+    wgs84_descript = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'
+
+    # Real world longitudes and latitudes of tripolar coordinates X=80W:60E:10 + 100E:120W:10,Y=45N:90N:5
+    geolon_c = numpy.array([
+        [ -100.0,-100.0,-100.0,-100.0,-100.0,-100.0,-100.0,-100.0,  80.0,  80.0,
+            80.0,  80.0,  80.0,  80.0,  80.0,  80.0,  80.0,  80.0,  80.0,  80.0,
+            80.0,  80.0, 260.0, 260.0, 260.0, 260.0, 260.0, 260.0, 260.0, 260.0, ],
+        [  -92.1, -87.7, -82.4, -75.7, -66.7, -53.8, -34.9, -10.0,  14.9,  33.8,
+            46.7,  55.7,  62.4,  67.7,  72.1,  87.9,  92.3,  97.6, 104.3, 113.3,
+           126.2, 145.1, 170.0, 194.9, 213.8, 226.7, 235.7, 242.4, 247.7, 252.1, ],
+        [  -86.0, -78.5, -70.2, -60.9, -50.2, -38.1, -24.5, -10.0,   4.5,  18.1,
+            30.2,  40.9,  50.2,  58.5,  66.0,  94.0, 101.5, 109.8, 119.1, 129.8,
+           141.9, 155.5, 170.0, 184.5, 198.1, 210.2, 220.9, 230.2, 238.5, 246.0, ],
+        [  -82.3, -73.1, -63.6, -53.7, -43.3, -32.5, -21.4, -10.0,   1.4,  12.5,
+            23.3,  33.7,  43.6,  53.1,  62.3,  97.7, 106.9, 116.4, 126.3, 136.7,
+           147.5, 158.6, 170.0, 181.4, 192.5, 203.3, 213.7, 223.6, 233.1, 242.3, ],
+        [  -80.5, -70.6, -60.7, -50.7, -40.6, -30.5, -20.3, -10.0,   0.3,  10.5,
+            20.6,  30.7,  40.7,  50.6,  60.5,  99.5, 109.4, 119.3, 129.3, 139.4,
+           149.5, 159.7, 170.0, 180.3, 190.5, 200.6, 210.7, 220.7, 230.6, 240.5, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0,  100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, ],
+    ], dtype=numpy.float64)
+    geolon_c = geolon_c.T[:, :, numpy.newaxis, numpy.newaxis, numpy.newaxis, numpy.newaxis]
+    geolat_c = numpy.array([
+        [ 72.35, 75.41, 78.20, 80.77, 83.20, 85.52, 87.78, 90.00, 87.78, 85.52,
+          83.20, 80.77, 78.20, 75.41, 72.35, 72.35, 75.41, 78.20, 80.77, 83.20,
+          85.52, 87.78, 90.00, 87.78, 85.52, 83.20, 80.77, 78.20, 75.41, 72.35, ],
+        [ 71.85, 74.69, 77.25, 79.54, 81.58, 83.30, 84.53, 85.00, 84.53, 83.30,
+          81.58, 79.54, 77.25, 74.69, 71.85, 71.85, 74.69, 77.25, 79.54, 81.58,
+          83.30, 84.53, 85.00, 84.53, 83.30, 81.58, 79.54, 77.25, 74.69, 71.85, ],
+        [ 70.51, 72.81, 74.83, 76.56, 77.99, 79.08, 79.76, 80.00, 79.76, 79.08,
+          77.99, 76.56, 74.83, 72.81, 70.51, 70.51, 72.81, 74.83, 76.56, 77.99,
+          79.08, 79.76, 80.00, 79.76, 79.08, 77.99, 76.56, 74.83, 72.81, 70.51, ],
+        [ 68.71, 70.29, 71.67, 72.83, 73.76, 74.44, 74.86, 75.00, 74.86, 74.44,
+          73.76, 72.83, 71.67, 70.29, 68.71, 68.71, 70.29, 71.67, 72.83, 73.76,
+          74.44, 74.86, 75.00, 74.86, 74.44, 73.76, 72.83, 71.67, 70.29, 68.71, ],
+        [ 66.80, 67.60, 68.30, 68.90, 69.37, 69.72, 69.93, 70.00, 69.93, 69.72,
+          69.37, 68.90, 68.30, 67.60, 66.80, 66.80, 67.60, 68.30, 68.90, 69.37,
+          69.72, 69.93, 70.00, 69.93, 69.72, 69.37, 68.90, 68.30, 67.60, 66.80, ],
+        [ 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00,
+          65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00,
+          65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, ],
+        [ 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
+          60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
+          60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, ],
+        [ 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
+          55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
+          55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, ],
+        [ 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
+          50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
+          50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, ],
+        [ 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
+          45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
+          45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, ],
+    ], dtype=numpy.float64)
+    geolat_c = geolat_c.T[:, :, numpy.newaxis, numpy.newaxis, numpy.newaxis, numpy.newaxis]
+
+    # Make the value an approximate sphere surface area (in square degrees) of the quadrilateral
+    vals  = geolon_c[:-1, :-1] * geolat_c[:-1,  1:]
+    vals -= geolon_c[:-1,  1:] * geolat_c[:-1, :-1]
+    vals += geolon_c[:-1,  1:] * geolat_c[ 1:,  1:]
+    vals -= geolon_c[ 1:,  1:] * geolat_c[:-1,  1:]
+    vals += geolon_c[ 1:,  1:] * geolat_c[ 1:, :-1]
+    vals -= geolon_c[ 1:, :-1] * geolat_c[ 1:,  1:]
+    vals += geolon_c[ 1:, :-1] * geolat_c[:-1, :-1]
+    vals -= geolon_c[:-1, :-1] * geolat_c[ 1:, :-1]
+    vals = 0.5 * numpy.fabs(vals)
+    vals *= numpy.cos( 0.25 * numpy.deg2rad(geolat_c[:-1, :-1] + \
+                                            geolat_c[:-1,  1:] + \
+                                            geolat_c[ 1:,  1:] + \
+                                            geolat_c[ 1:, :-1]) )
+
+    # Assign the value of the rectangles between 60E and 100E with the missing value
+    resbdf = numpy.array([-99999.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([-88888.0, -77777.0, -66666.0, -55555.0, -44444.0, -33333.0], dtype=numpy.float64)
+    vals[14,:,0,0] = inpbdfs[3]
+
+    # Make sure these calls do not generate errors
+    info = ferret_init(0)
+    del info
+    limits = ferret_result_limits(0)
+    del limits
+
+    # Create the shapefile
+    result = numpy.ones((1,1,1,1,1,1), dtype=numpy.float64)
+    ferret_compute(0, result, resbdf, (shapefilename, geolon_c, geolat_c, vals, fieldname, ""), inpbdfs)
+
+    # Read the shapefile back in and check
+    sfreader = shapefile.Reader(shapefilename)
+    shapes = sfreader.shapes()
+    records = sfreader.records()
+    explen = (vals.shape[0] - 1) * vals.shape[1]
+    if len(shapes) != explen:
+        raise ValueError("Expected %d shapes; found %d" % (explen, len(shapes)))
+    if len(records) != explen:
+        raise ValueError("Expected %d records; found %d" % (explen, len(records)))
+    # Create the expected arrays of shape coordinates and values
+    exppoints = []
+    expvals = []
+    for j in xrange(vals.shape[1]):
+        for i in xrange(vals.shape[0]):
+            if vals[i, j, 0, 0, 0, 0] != inpbdfs[3]:
+                exppoints.append( numpy.array([ [ geolon_c[i,   j,   0, 0, 0, 0], 
+                                                  geolat_c[i,   j,   0, 0, 0, 0] ],
+                                                [ geolon_c[i+1, j,   0, 0, 0, 0], 
+                                                  geolat_c[i+1, j,   0, 0, 0, 0] ],
+                                                [ geolon_c[i+1, j+1, 0, 0, 0, 0], 
+                                                  geolat_c[i+1, j+1, 0, 0, 0, 0] ],
+                                                [ geolon_c[i,   j+1, 0, 0, 0, 0], 
+                                                  geolat_c[i,   j+1, 0, 0, 0, 0] ],
+                                                [ geolon_c[i,   j,   0, 0, 0, 0], 
+                                                  geolat_c[i,   j,   0, 0, 0, 0] ] ]) )
+                expvals.append(vals[i, j, 0, 0, 0, 0])
+    # Verify these arrays - does not depend on the same ordering of the shapes
+    for (shape, record) in zip(shapes, records):
+        for k in range(len(exppoints)):
+            if numpy.allclose(shape.points, exppoints[k], rtol=1.0E-4):
+                break
+        else:
+            raise ValueError("Unexpected vertices %s" % str(shape.points))
+        if not numpy.allclose(record, expvals[k], rtol=1.0E-4):
+            raise ValueError("Expected value %s; found %s for shape.points %s" % \
+                             (str(expvals[k]), str(record), str(shape.points)))
+        junk = exppoints.pop(k)
+        junk = expvals.pop(k)
+    # Verify the projection file
+    prjfile = file("%s.prj" % shapefilename, "r")
+    datalines = prjfile.readlines()
+    prjfile.close()
+    if len(datalines) != 1:
+        raise ValueError("Number of lines in the .prj file: expected: 1, found %d" % len(datalines))
+    descript = datalines[0].strip()
+    if descript != wgs84_descript:
+        raise ValueError("Description in the .prj file:\n" \
+                         "    expect: %s\n" \
+                         "    found:  %s" % (wgs84_descript, descript))
+
+    # Shapefile data files no longer needed
+    os.remove("%s.dbf" % shapefilename)
+    os.remove("%s.shp" % shapefilename)
+    os.remove("%s.shx" % shapefilename)
+    os.remove("%s.prj" % shapefilename)
+
+    # Commented-out code used for further testing
+    testcode = """
+    sortedvals = numpy.sort(vals[ vals != inpbdfs[3] ])
+    numvals = sortedvals.shape[0]
+    limits = [ sortedvals[1 * numvals // 5],
+               sortedvals[2 * numvals // 5],
+               sortedvals[3 * numvals // 5],
+               sortedvals[4 * numvals // 5], ]
+    print str( [ sortedvals[0] ] + limits + [ sortedvals[-1] ] )
+
+    partvals = vals.copy()
+    partvals[ partvals >= limits[0] ] = inpbdfs[3]
+    ferret_compute(0, result, resbdf, (shapefilename + "_1",
+                                       geolon_c, geolat_c, partvals,
+                                       fieldname, ""), inpbdfs)
+
+    partvals = vals.copy()
+    partvals[ partvals <  limits[0] ] = inpbdfs[3]
+    partvals[ partvals >= limits[1] ] = inpbdfs[3]
+    ferret_compute(0, result, resbdf, (shapefilename + "_2",
+                                       geolon_c, geolat_c, partvals,
+                                       fieldname, ""), inpbdfs)
+
+    partvals = vals.copy()
+    partvals[ partvals <  limits[1] ] = inpbdfs[3]
+    partvals[ partvals >= limits[2] ] = inpbdfs[3]
+    ferret_compute(0, result, resbdf, (shapefilename + "_3",
+                                       geolon_c, geolat_c, partvals,
+                                       fieldname, ""), inpbdfs)
+    partvals = vals.copy()
+    partvals[ partvals <  limits[2] ] = inpbdfs[3]
+    partvals[ partvals >= limits[3] ] = inpbdfs[3]
+    ferret_compute(0, result, resbdf, (shapefilename + "_4",
+                                       geolon_c, geolat_c, partvals,
+                                       fieldname, ""), inpbdfs)
+
+    partvals = vals.copy()
+    partvals[ partvals <  limits[3] ] = inpbdfs[3]
+    ferret_compute(0, result, resbdf, (shapefilename + "_5",
+                                       geolon_c, geolat_c, partvals,
+                                       fieldname, ""), inpbdfs)
+    """
+
+    print "shapefile_writexyval: SUCCESS"
+
diff --git a/pyfermod/fershp/shapefile_writexyzval.py b/pyfermod/fershp/shapefile_writexyzval.py
new file mode 100644
index 0000000..2ceb600
--- /dev/null
+++ b/pyfermod/fershp/shapefile_writexyzval.py
@@ -0,0 +1,364 @@
+"""
+Creates a shapefile with a given root name using data from given
+X, Y, Z, and value arrays (curvilinear-type data).  The shapes
+are quadrilaterals derived from the X and Y arrays which can have
+varying Z coordinates; i.e., vertices are the (i,j), (i,j+1),
+(i+1,j+1), and (i+1,j) elements of the X, Y, and Z coordinates.
+The value associated with each quadrilateral comes from the value
+array; i.e., the (i,j) element of the value for the previously
+mentioned quadrilateral.  Quadrilaterals associated with missing
+values are omitted from the shapefile.
+"""
+
+import shapefile
+import pyferret
+import pyferret.fershp
+
+def ferret_init(efid):
+    """
+    Initialization for the shapefile_writexyzval PyEF
+    """
+    retdict = { "numargs": 7,
+                "descript": "Writes a shapefile of XY quadrilaterals with Z coordinates from the curvilinear data arrays.",
+                "restype": pyferret.FLOAT_ARRAY,
+                "axes": ( pyferret.AXIS_ABSTRACT,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST,
+                          pyferret.AXIS_DOES_NOT_EXIST, ),
+                "argnames": ( "SHAPEFILE", "GRIDX", "GRIDY", "GRIDZ", "VALUE", "VALNAME", "MAPPRJ"),
+                "argdescripts": ( "Shapefile name (any extension given is ignored)",
+                                  "X values (longitudes) for the quad. grid; must be 2D on X and Y axes",
+                                  "Y values (latitudes) for the quad. grid; must be 2D on X and Y axes",
+                                  "Z values (levels) for the quad. grid; must be 2D on X and Y axes",
+                                  "Shape values; must be 2D on X and Y axes",
+                                  "Name for the shape value",
+                                  "Common name or WKT description of map projection; " \
+                                      "if blank, WGS 84 is used", ),
+                "argtypes": ( pyferret.STRING_ONEVAL,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.FLOAT_ARRAY,
+                              pyferret.STRING_ONEVAL,
+                              pyferret.STRING_ONEVAL, ),
+                "influences": ( (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False),
+                                (False, False, False, False, False, False), ),
+              }
+    return retdict
+
+
+def ferret_result_limits(efid):
+    """
+    Abstract axis limits for the shapefile_writexyzval PyEF
+    """
+    return ( (1, 1), None, None, None, None, None, )
+
+
+def ferret_compute(efid, result, resbdf, inputs, inpbdfs):
+    """
+    Create the shapefile named in inputs[0] using the grid X coordinates
+    given in inputs[1], grid Y coordinates given in inputs[2], grid Z
+    coordinates given in inputs[3], and shape values given in inputs[4].
+    The X, Y, and Z coordinates are used for the quadrilaterals vertices
+    and must have an additional value along each dimension.  The value
+    [i, j] is used for the quadrilateral with diagonal corners [i, j] and
+    [i+1, j+1].  Quadrilateral associated with missing values are omitted
+    from the shapefile.  The field name for the value in the shapefile
+    given in inputs[5].  Either a common name or a WKT description of the
+    map projection for the coordinates should be given in inputs[6].  If
+    blank, WGS 84 is used.  If successful, fills result (which might as
+    well be a 1x1x1x1 array) with zeros.  If a problem occurs, an error
+    will be raised.
+    """
+    shapefile_name = inputs[0]
+    grid_xs = inputs[1]
+    grid_ys = inputs[2]
+    grid_zs = inputs[3]
+    grid_vals = inputs[4]
+    missing_val = inpbdfs[4]
+    field_name = inputs[5].strip()
+    if not field_name:
+        field_name = "VALUE"
+    map_projection = inputs[6]
+
+    # Verify the shapes are as expected
+    if (grid_vals.shape[2] != 1) or (grid_vals.shape[3] != 1) or \
+       (grid_vals.shape[4] != 1) or (grid_vals.shape[5] != 1):
+        raise ValueError("The Z, T, E, and F axes of VALUE must be undefined or singleton axes")
+    exp_shape = ( grid_vals.shape[0] + 1, grid_vals.shape[1] + 1, 1, 1, 1, 1 )
+    if (grid_xs.shape != exp_shape) or \
+       (grid_ys.shape != exp_shape) or \
+       (grid_zs.shape != exp_shape):
+         raise ValueError('GRIDX, GRIDY, and GRIDZ must have one more value ' \
+                          'along both X and Y axes compared to VALUE')
+
+    # Create polygons with a single field value
+    sfwriter = shapefile.Writer(shapefile.POLYGONZ)
+    sfwriter.field(field_name, "N", 20, 7)
+
+    # Add the shapes with their values
+    shape_written = False
+    for j in xrange(grid_vals.shape[1]):
+        for i in xrange(grid_vals.shape[0]):
+            if grid_vals[i, j, 0, 0, 0, 0] != missing_val:
+                shape_written = True
+                pyferret.fershp.addquadxyvalues(sfwriter,
+                         (grid_xs[i,   j,   0, 0, 0, 0], grid_ys[i,   j,   0, 0, 0, 0]),
+                         (grid_xs[i,   j+1, 0, 0, 0, 0], grid_ys[i,   j+1, 0, 0, 0, 0]),
+                         (grid_xs[i+1, j+1, 0, 0, 0, 0], grid_ys[i+1, j+1, 0, 0, 0, 0]),
+                         (grid_xs[i+1, j,   0, 0, 0, 0], grid_ys[i+1, j,   0, 0, 0, 0]),
+                         ( grid_zs[i,   j,   0, 0, 0, 0],
+                           grid_zs[i,   j+1, 0, 0, 0, 0],
+                           grid_zs[i+1, j+1, 0, 0, 0, 0],
+                           grid_zs[i+1, j,   0, 0, 0, 0] ),
+                         [ float(grid_vals[i, j, 0, 0, 0, 0]) ])
+    if not shape_written:
+        raise ValueError("All values are missing values")
+    sfwriter.save(shapefile_name)
+
+    # Create the .prj file from the map projection common name or the WKT description
+    pyferret.fershp.createprjfile(map_projection, shapefile_name)
+    result[:, :, :, :, :, :] = 0
+
+
+#
+# The following is only for testing this module from the command line
+#
+if __name__ == "__main__":
+    import numpy
+    import numpy.random
+    import os
+
+    shapefilename = "tripolarwz"
+    fieldname = "AREA"
+    wgs84_descript = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'
+
+    # real world longitudes and latitudes of tripolar coordinates X=80W:60E:10 + 100E:120W:10,Y=45N:85N:5
+    geolon_c = numpy.array([
+        [  -92.1, -87.7, -82.4, -75.7, -66.7, -53.8, -34.9, -10.0,  14.9,  33.8,
+            46.7,  55.7,  62.4,  67.7,  72.1,  87.9,  92.3,  97.6, 104.3, 113.3,
+           126.2, 145.1, 170.0, 194.9, 213.8, 226.7, 235.7, 242.4, 247.7, 252.1, 267.9, ],
+        [  -86.0, -78.5, -70.2, -60.9, -50.2, -38.1, -24.5, -10.0,   4.5,  18.1,
+            30.2,  40.9,  50.2,  58.5,  66.0,  94.0, 101.5, 109.8, 119.1, 129.8,
+           141.9, 155.5, 170.0, 184.5, 198.1, 210.2, 220.9, 230.2, 238.5, 246.0, 274.0, ],
+        [  -82.3, -73.1, -63.6, -53.7, -43.3, -32.5, -21.4, -10.0,   1.4,  12.5,
+            23.3,  33.7,  43.6,  53.1,  62.3,  97.7, 106.9, 116.4, 126.3, 136.7,
+           147.5, 158.6, 170.0, 181.4, 192.5, 203.3, 213.7, 223.6, 233.1, 242.3, 277.7, ],
+        [  -80.5, -70.6, -60.7, -50.7, -40.6, -30.5, -20.3, -10.0,   0.3,  10.5,
+            20.6,  30.7,  40.7,  50.6,  60.5,  99.5, 109.4, 119.3, 129.3, 139.4,
+           149.5, 159.7, 170.0, 180.3, 190.5, 200.6, 210.7, 220.7, 230.6, 240.5, 279.5, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 280.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 280.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0,  100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 280.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 280.0, ],
+        [  -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0,   0.0,  10.0,
+            20.0,  30.0,  40.0,  50.0,  60.0, 100.0, 110.0, 120.0, 130.0, 140.0,
+           150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 280.0, ],
+    ], dtype=numpy.float64)
+    geolon_c = geolon_c.T[:, :, numpy.newaxis, numpy.newaxis, numpy.newaxis, numpy.newaxis]
+    geolat_c = numpy.array([
+        [ 71.85, 74.69, 77.25, 79.54, 81.58, 83.30, 84.53, 85.00, 84.53, 83.30,
+          81.58, 79.54, 77.25, 74.69, 71.85, 71.85, 74.69, 77.25, 79.54, 81.58,
+          83.30, 84.53, 85.00, 84.53, 83.30, 81.58, 79.54, 77.25, 74.69, 71.85, 71.85, ],
+        [ 70.51, 72.81, 74.83, 76.56, 77.99, 79.08, 79.76, 80.00, 79.76, 79.08,
+          77.99, 76.56, 74.83, 72.81, 70.51, 70.51, 72.81, 74.83, 76.56, 77.99,
+          79.08, 79.76, 80.00, 79.76, 79.08, 77.99, 76.56, 74.83, 72.81, 70.51, 70.51, ],
+        [ 68.71, 70.29, 71.67, 72.83, 73.76, 74.44, 74.86, 75.00, 74.86, 74.44,
+          73.76, 72.83, 71.67, 70.29, 68.71, 68.71, 70.29, 71.67, 72.83, 73.76,
+          74.44, 74.86, 75.00, 74.86, 74.44, 73.76, 72.83, 71.67, 70.29, 68.71, 68.71, ],
+        [ 66.80, 67.60, 68.30, 68.90, 69.37, 69.72, 69.93, 70.00, 69.93, 69.72,
+          69.37, 68.90, 68.30, 67.60, 66.80, 66.80, 67.60, 68.30, 68.90, 69.37,
+          69.72, 69.93, 70.00, 69.93, 69.72, 69.37, 68.90, 68.30, 67.60, 66.80, 66.80, ],
+        [ 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00,
+          65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00,
+          65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, 65.00, ],
+        [ 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
+          60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
+          60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, ],
+        [ 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
+          55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
+          55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, ],
+        [ 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
+          50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
+          50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, ],
+        [ 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
+          45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
+          45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, ],
+    ], dtype=numpy.float64)
+    geolat_c = geolat_c.T[:, :, numpy.newaxis, numpy.newaxis, numpy.newaxis, numpy.newaxis]
+
+    # Just create random elevations in [0.0,100.0)
+    levels = 100.0 * numpy.random.rand(*(geolon_c.shape))
+    levels = numpy.array(levels, dtype=numpy.float64, order='F')
+
+    # Make the value an approximate sphere surface area (in square degrees) of the quadrilateral
+    vals  = geolon_c[:-1, :-1] * geolat_c[:-1,  1:]
+    vals -= geolon_c[:-1,  1:] * geolat_c[:-1, :-1]
+    vals += geolon_c[:-1,  1:] * geolat_c[ 1:,  1:]
+    vals -= geolon_c[ 1:,  1:] * geolat_c[:-1,  1:]
+    vals += geolon_c[ 1:,  1:] * geolat_c[ 1:, :-1]
+    vals -= geolon_c[ 1:, :-1] * geolat_c[ 1:,  1:]
+    vals += geolon_c[ 1:, :-1] * geolat_c[:-1, :-1]
+    vals -= geolon_c[:-1, :-1] * geolat_c[ 1:, :-1]
+    vals = 0.5 * numpy.fabs(vals)
+    vals *= numpy.cos( 0.25 * numpy.deg2rad(geolat_c[:-1, :-1] + \
+                                            geolat_c[:-1,  1:] + \
+                                            geolat_c[ 1:,  1:] + \
+                                            geolat_c[ 1:, :-1]) )
+
+    # make sure these calls do not generate errors
+    info = ferret_init(0)
+    del info
+    limits = ferret_result_limits(0)
+    del limits
+
+    # check that ferret_compute does not cause any errors
+    resbdf = numpy.array([-99999.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([-88888.0, -77777.0, -66666.0, -55555.0, -44444.0, -33333.0, -22222.0], dtype=numpy.float64)
+    result = numpy.ones((1,1,1,1,1,1), dtype=numpy.float64)
+    ferret_compute(0, result, resbdf, (shapefilename, geolon_c, geolat_c, levels, vals, fieldname, ""), inpbdfs)
+    if result[0,0,0,0,0,0] != 0.0:
+        raise ValueError("ferret_compute result array value: expected 0.0, found %f" % result[0,0,0,0,0,0])
+
+    # create the expected arrays returned from shapefile.Reader
+    # as well as from shapefile_readxyz and shapefile_readxyzval
+    exppoints = []
+    expzs = []
+    expvals = []
+    expcurvals = [ [], [], [], [] ]
+    for j in xrange(vals.shape[1]):
+        for i in xrange(vals.shape[0]):
+            # add the values expected to be returned from shapefile.Reader
+            exppoints.append( numpy.array([ [ geolon_c[i,   j,   0, 0, 0, 0], 
+                                              geolat_c[i,   j,   0, 0, 0, 0] ],
+                                            [ geolon_c[i+1, j,   0, 0, 0, 0], 
+                                              geolat_c[i+1, j,   0, 0, 0, 0] ],
+                                            [ geolon_c[i+1, j+1, 0, 0, 0, 0], 
+                                              geolat_c[i+1, j+1, 0, 0, 0, 0] ],
+                                            [ geolon_c[i,   j+1, 0, 0, 0, 0], 
+                                              geolat_c[i,   j+1, 0, 0, 0, 0] ],
+                                            [ geolon_c[i,   j,   0, 0, 0, 0], 
+                                              geolat_c[i,   j,   0, 0, 0, 0] ] ]) )
+            expzs.append( numpy.array([ levels[i,   j,   0, 0, 0, 0],
+                                        levels[i+1, j,   0, 0, 0, 0],
+                                        levels[i+1, j+1, 0, 0, 0, 0],
+                                        levels[i,   j+1, 0, 0, 0, 0],
+                                        levels[i,   j,   0, 0, 0, 0] ]) )
+            expvals.append(vals[i, j, 0, 0, 0, 0])
+            # add the expected values returned from shapefile_readxyz and shapefile_readxyzval
+            expcurvals[0].extend(exppoints[-1][:,0])
+            expcurvals[0].append(resbdf[0])
+            expcurvals[1].extend(exppoints[-1][:,1])
+            expcurvals[1].append(resbdf[0])
+            expcurvals[2].extend(expzs[-1])
+            expcurvals[2].append(resbdf[0])
+            expcurvals[3].append(expvals[-1])
+    # shapefile_readxyz and shapefile_readxyzval return numpy.float64 arrays
+    expcurvals[0] = numpy.array(expcurvals[0], dtype=numpy.float64)
+    expcurvals[1] = numpy.array(expcurvals[1], dtype=numpy.float64)
+    expcurvals[2] = numpy.array(expcurvals[2], dtype=numpy.float64)
+    expcurvals[3] = numpy.array(expcurvals[3], dtype=numpy.float64)
+
+    # check the values read using shapefile.Reader
+    sfreader = shapefile.Reader(shapefilename)
+    shapes = sfreader.shapes()
+    records = sfreader.records()
+    explen = vals.shape[0] * vals.shape[1]
+    if len(shapes) != explen:
+        raise ValueError("Expected %d shapes; found %d" % (explen, len(shapes)))
+    if len(records) != explen:
+        raise ValueError("Expected %d records; found %d" % (explen, len(records)))
+    # this does not assume any order that the shapes were written
+    for (shape, record) in zip(shapes, records):
+        for k in range(len(exppoints)):
+            if numpy.allclose(shape.points, exppoints[k], rtol=1.0E-4):
+                break
+        else:
+            raise ValueError("Unexpected X,Y vertices %s" % str(shape.points))
+        if not numpy.allclose(shape.z, expzs[k], rtol=1.0E-4, atol=1.0E-5):
+            raise ValueError("Expected Zs %s; found %s for shape.points %s" % \
+                             (str(expzs[k]), str(shape.z), str(shape.points)))
+        if not numpy.allclose(record, expvals[k], rtol=1.0E-4):
+            raise ValueError("Expected value %s; found %s for shape.points %s" % \
+                             (str(expvals[k]), str(record), str(shape.points)))
+        junk = exppoints.pop(k)
+        junk = expzs.pop(k)
+        junk = expvals.pop(k)
+    prjfile = file("%s.prj" % shapefilename, "r")
+    datalines = prjfile.readlines()
+    prjfile.close()
+    if len(datalines) != 1:
+        raise ValueError("Number of lines in the .prj file: expected: 1, found %d" % len(datalines))
+    descript = datalines[0].strip()
+    if descript != wgs84_descript:
+        raise ValueError("Description in the .prj file:\n" \
+                         "    expect: %s\n" \
+                         "    found:  %s" % (wgs84_descript, descript))
+
+    print "shapefile_writexyzval: SUCCESS"
+
+    # Check the result for calling ferret_compute of shapefile_readxyz
+    # in this directory.  This assumes the ordering of the shapes does
+    # not change, which appears to be the case but is not required.
+    import shapefile_readxyz
+    maxpts = len(expcurvals[0])
+    result = -11111.0 * numpy.ones((maxpts, 3, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    shapefile_readxyz.ferret_compute(0, result, resbdf, (shapefilename, maxpts), inpbdfs[:2])
+    if not numpy.allclose(result[:,0,0,0,0,0], expcurvals[0], rtol=1.0E-4):
+        raise ValueError("Xs from shapefile_readxyz:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[0]), str(result[:,0,0,0,0,0])))
+    if not numpy.allclose(result[:,1,0,0,0,0], expcurvals[1], rtol=1.0E-4):
+        raise ValueError("Ys from shapefile_readxyz:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[1]), str(result[:,1,0,0,0,0])))
+    if not numpy.allclose(result[:,2,0,0,0,0], expcurvals[2], rtol=1.0E-4, atol=1.0E-5):
+        raise ValueError("Zs from shapefile_readxyz:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[2]), str(result[:,2,0,0,0,0])))
+
+    print "shapefile_readxyz: SUCCESS"
+
+    # Check the result for calling ferret_compute of shapefile_readxyzval
+    # in this directory.  This assumes the ordering of the shapes does
+    # not change, which appears to be the case but is not required.
+    import shapefile_readxyzval
+    result = -11111.0 * numpy.ones((maxpts, 4, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    shapefile_readxyzval.ferret_compute(0, result, resbdf, (shapefilename, fieldname, maxpts), inpbdfs[:3])
+    if not numpy.allclose(result[:,0,0,0,0,0], expcurvals[0], rtol=1.0E-4):
+        raise ValueError("Xs from shapefile_readxyzval:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[0]), str(result[:,0,0,0,0,0])))
+    if not numpy.allclose(result[:,1,0,0,0,0], expcurvals[1], rtol=1.0E-4):
+        raise ValueError("Ys from shapefile_readxyzval:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[1]), str(result[:,1,0,0,0,0])))
+    if not numpy.allclose(result[:,2,0,0,0,0], expcurvals[2], rtol=1.0E-4, atol=1.0E-5):
+        raise ValueError("Zs from shapefile_readxyzval:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[2]), str(result[:,2,0,0,0,0])))
+    numvals = len(expcurvals[3])
+    if not numpy.allclose(result[:numvals,3,0,0,0,0], expcurvals[3], rtol=1.0E-4):
+        raise ValueError("Values from shapefile_readxyzval:\n   expected\n%s\n   found\n%s" % \
+                         (str(expcurvals[3]), str(result[:numvals,3,0,0,0,0])))
+    if not numpy.allclose(result[numvals:,3,0,0,0,0], resbdf, rtol=1.0E-4):
+        raise ValueError("Extra values from shapefile_readxyzval: expected all %s\n   found\n%s" % \
+                         (str(float(resbdf[0])), str(result[numvals:,3,0,0,0,0])))
+
+    print "shapefile_readxyzval: SUCCESS"
+
+    os.remove("%s.dbf" % shapefilename)
+    os.remove("%s.shp" % shapefilename)
+    os.remove("%s.shx" % shapefilename)
+    os.remove("%s.prj" % shapefilename)
+
+
diff --git a/pyfermod/filenamecompleter.py b/pyfermod/filenamecompleter.py
new file mode 100644
index 0000000..de88340
--- /dev/null
+++ b/pyfermod/filenamecompleter.py
@@ -0,0 +1,195 @@
+#! python
+#
+
+"""
+Module that defines a readline completer class with a complete 
+method that returns filenames matching the given partial name.
+Thus the readline suggestions from using this completer will 
+be names of existing files that match the partially specified 
+directory/file name.
+"""
+
+import os.path
+
+class FilenameCompleter(object):
+    """
+    A readline completer class whose complete method returns 
+    filenames matching the given partial name.  Thus the readline 
+    suggestions from using this completer will be names of existing 
+    files that match the partially specified directory/file name.
+    """
+    def __init__(self):
+        self.__matches = []
+
+    def complete(self, text, state):
+        """
+        Returns a filename matching the partial name given in text.
+
+        If the partial name contains one single-quote character or 
+        one double-quote character, everything after that quote 
+        character is used as the beginning of the directory/file
+        name to match (the "match string").  Otherwise, everything 
+        after the last whitespace character is used as the match
+        string.  In any case, any trailing whitespace characters 
+        in the match string are removed.
+
+        An initial component of ~/ or ~user/ in the match string
+        is substituted with the home directory of the current or 
+        specified user, respectively.
+        See: os.path.expanduser
+
+        Any environment variable names (such as ${HOME}) given in 
+        the match string are substituted with the corresponding 
+        value of the environment variable.
+        See: os.path.expandvars
+
+        If state is zero, a listing of the files matching the 
+        match string is obtained, then sorted alphabetically, 
+        and saved.  The first matching name is returned.
+
+        If state is greater than zero, the name at that index 
+        from the last saved listing is returned (and, thus, the
+        value of text is ignored).  If state is larger than the 
+        number of names in the last saved listing, None is returned.
+        """
+        if state == 0:
+            # first call; get the substring to match
+            if text.count("'") == 1:
+                parttext = text[text.index("'") + 1:].rstrip()
+            elif text.count('"') == 1:
+                parttext = text[text.index('"') + 1:].rstrip()
+            else:
+                # use the last space-separated piece
+                pieces = text.rsplit(None, 1)
+                if len(pieces) == 0:
+                   parttext = ''
+                elif len(pieces) == 1:
+                   parttext = pieces[0]
+                else:
+                   parttext = pieces[1]
+            # expand any initial ~ or ~user
+            exptext = os.path.expanduser(parttext)
+            # expand any environment variables names
+            exptext = os.path.expandvars(exptext)
+            # split the match string into the directory path and (partial) filename
+            (head, tail) = os.path.split(exptext)
+            try:
+                if head == '':
+                    # use the contents of the current directory
+                    dirlist = os.listdir(os.curdir)
+                else:
+                    # use the contents of the directory given by head
+                    dirlist = os.listdir(head)
+            except OSError:
+                dirlist = []
+            if tail == '':
+                # use all the names given
+                filteredlist = dirlist
+            else:
+                # match only those names beginning with the string in tail
+                lentail = len(tail)
+                filteredlist = [ fnam for fnam in dirlist 
+                                 if fnam[:lentail] == tail ]
+            # sort the filtered list of names
+            filteredlist.sort()
+            if head == '':
+                # just use the names with no directory path
+                self.__matches = filteredlist
+            else:
+                # prefix with the directory path
+                self.__matches = [ os.path.join(head, fnam) 
+                                   for fnam in filteredlist ]
+        # Return the name at the index given by state
+        try:
+            return self.__matches[state]
+        except IndexError:
+            return None
+
+
+#
+#  The following is just for testing
+#
+
+if __name__ == '__main__':
+    completer = FilenameCompleter()
+
+    # Test an empty string
+    actdirlist = os.listdir(os.curdir)
+    actdirlist.sort()
+    print 'Contents of current directory'
+    cmpdirlist = []
+    k = 0
+    fnam = completer.complete('', 0)
+    while fnam != None:
+        print '    %s' % fnam
+        cmpdirlist.append(fnam)
+        k += 1
+        fnam = completer.complete('', k)
+    if cmpdirlist != actdirlist:
+        raise ValueError('Empty text failure; expected: %s, found: %s' % \
+                         (str(actdirlist), str(cmpdirlist)))
+
+    # Test with a tilde string
+    tildedir = '~' + os.sep
+    print ''
+    print 'Contents of %s' % tildedir
+    tildenames = []
+    k = 0
+    fnam = completer.complete(tildedir, 0)
+    while fnam != None:
+        print '    %s' % fnam
+        tildenames.append(fnam)
+        k += 1
+        fnam = completer.complete(tildedir, k)
+    
+    # Test with an environment variable
+    homedir = '$HOME' + os.sep
+    print ''
+    print 'Contents of %s' % homedir
+    homenames = []
+    k = 0
+    fnam = completer.complete(homedir, 0)
+    while fnam != None:
+        print '    %s' % fnam
+        homenames.append(fnam)
+        k += 1
+        fnam = completer.complete(homedir, k)
+
+    # ~ and $HOME should be the same
+    if tildenames != homenames:
+        raise ValueError('%s and %s lists do not match' % (tildedir, homedir))
+
+    # Try with $HOME/bin/
+    bindir = '$HOME' + os.sep + 'bin' + os.sep
+    print ''
+    print 'Contents of %s' % bindir
+    binnames = []
+    k = 0
+    fnam = completer.complete(bindir, 0)
+    while fnam != None:
+        print '    %s' % fnam
+        binnames.append(fnam)
+        k += 1
+        fnam = completer.complete(bindir, k)
+    if binnames == homenames:
+        raise ValueError('%s and %s lists match' % (bindir, homedir))
+
+    # Try with an invalid directory
+    invalid_name = 'hopefully' + os.sep + 'a' + os.sep + 'non' + os.sep \
+                 + 'existant' + os.sep + 'directory' + os.sep + 'name'
+    fnam = completer.complete(invalid_name, 0)
+    if fnam != None:
+        raise ValueError('complete "%s" failure; expected: None, found: %s' % \
+                         (invalid_name, fnam))
+
+    # Try with an unreadable directory (on unix systems)
+    invalid_name = '/lost+found/'
+    fnam = completer.complete(invalid_name, 0)
+    if fnam != None:
+        raise ValueError('complete "%s" failure; expected: None, found: %s' % \
+                         (invalid_name, fnam))
+
+    # All tests successful
+    print ''
+    print 'Success'
+
diff --git a/pyfermod/graphbind/.project b/pyfermod/graphbind/.project
new file mode 100644
index 0000000..d7b7608
--- /dev/null
+++ b/pyfermod/graphbind/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>graphbind</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>
diff --git a/pyfermod/graphbind/.pydevproject b/pyfermod/graphbind/.pydevproject
new file mode 100644
index 0000000..d3e61e8
--- /dev/null
+++ b/pyfermod/graphbind/.pydevproject
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/graphbind</path>
+</pydev_pathproperty>
+</pydev_project>
diff --git a/pyfermod/graphbind/__init__.py b/pyfermod/graphbind/__init__.py
new file mode 100644
index 0000000..8e439b3
--- /dev/null
+++ b/pyfermod/graphbind/__init__.py
@@ -0,0 +1,111 @@
+'''
+Maintains a dictionary of classes which can be used to bind PyFerret
+graphics calls to a particular graphics engine.
+
+When a new Window is needed, the createWindow function in this module
+is called.  This function creates an instance of the appropriate
+bindings class, its createWindow method is called, and the bindings 
+instance is returned.
+
+Other methods of the bindings instance are called directly to perform
+graphics operations on this Window.
+'''
+
+from abstractpyferretbindings import AbstractPyFerretBindings
+
+__pyferret_bindings_classes = { }
+
+def addPyFerretBindings(engine_name, bindings_class):
+    '''
+    Adds the given class to the dictionary of available bindings.
+
+    Arguments:
+        engine_name: a string identifying the bindings class
+                and graphics engine
+        bindings_class: a subclass of AbstractPyFerretBindings
+                providing the bindings for a graphics engine
+
+    Raises:
+        ValueError if bindings for engine_name already exist
+        TypeError if bindings_class is not a subclass of
+                AbstractPyFerretBindings
+    '''
+    try:
+        _ = __pyferret_bindings_classes[engine_name]
+        raise ValueError("Bindings already exist for graphics engine '%s'" \
+                         % engine_name)
+    except KeyError:
+        pass
+    if not issubclass(bindings_class, AbstractPyFerretBindings):
+        raise TypeError("bindings_class argument is not a " \
+                        "subclass of AbstractPyFerretBindings")
+    __pyferret_bindings_classes[engine_name] = bindings_class
+
+def knownPyFerretEngines():
+    '''
+    Returns a tuple of all the known engine names.
+    '''
+    return tuple( __pyferret_bindings_classes.keys() )
+    
+def createWindow(engine_name, title, visible):
+    '''
+    Creates an instance of the bindings class associated with
+    engine_name and calls the createWindow method of that
+    instance of the class.  The instance of the bindings class
+    is then returned.
+
+    Arguments:
+        engine_name: string identifying the bindings class and
+                     graphics engine to use for the Window
+        title: display title for the Window
+        visible: display Window on start-up?
+
+    Returns the instance of the binding class associated with
+    the newly created Window if the createWindow method of the
+    instance returns True.  Otherwise the bindings instance is
+    deleted and None is returned.
+
+    Raises a ValueError if engine_name does not have any bindings.
+    '''
+    try:
+        bindclass = __pyferret_bindings_classes[engine_name]
+    except KeyError:
+        raise ValueError("Unknown graphics engine '%s'" % engine_name)
+    bindinst = bindclass()
+    if not bindinst.createWindow(title, visible):
+        del bindinst
+        return None
+    return bindinst
+
+
+if __name__ == "__main__":
+
+    class TestBindings(AbstractPyFerretBindings):
+        engine_name = "TestEngine"
+
+        def __init__(self):
+            super(TestBindings, self).__init__()
+
+        def createWindow(self, title, visible):
+            return True
+
+    addPyFerretBindings(TestBindings.engine_name, TestBindings)
+    bindinst = createWindow(TestBindings.engine_name, "test", False)
+    if not bindinst:
+        raise RuntimeError("Unsuccessful creation of a Window")
+    try:
+        addPyFerretBindings(TestBindings.engine_name, TestBindings)
+        raise RuntimeError("Adding bindings with the same name succeeded")
+    except ValueError:
+        pass
+    try:
+        addPyFerretBindings("GenericObject", object)
+        raise RuntimeError("Adding object for a bindings class succeeded")
+    except TypeError:
+        pass
+    known_engines = knownPyFerretEngines()
+    if (len(known_engines) != 1) or \
+       (known_engines[0] != TestBindings.engine_name):
+        raise RuntimeError("Unexpected tuple of known engines: %s" % \
+                           str(known_engines))
+    print "Success"
diff --git a/pyfermod/graphbind/abstractpyferretbindings.py b/pyfermod/graphbind/abstractpyferretbindings.py
new file mode 100644
index 0000000..4f9975e
--- /dev/null
+++ b/pyfermod/graphbind/abstractpyferretbindings.py
@@ -0,0 +1,491 @@
+'''
+Defines the abstract base class for bindings to the graphics calls
+from PyFerret.  Specific engine bindings should create a subclass of
+AbstractPyFerretBindings and re-implement the methods to call the 
+methods or functions for that engine.  This class definition should 
+then be registered with PyFerret (pyferret.graphbind.addPyFerretBindings).
+
+When PyFerret creates a Window for an engine, it first creates an
+instance of the appropriate bindings class and then calls the 
+"createWindow" method on that instance.  Thus instance variables
+will be for the one window associated with the bindings instance.
+'''
+
+class AbstractPyFerretBindings(object):
+    '''
+    Abstract base class for providing bindings to graphics calls
+    from PyFerret for a graphics engine.  The methods defined in
+    this class should all be re-implemented in a subclass for
+    proper PyFerret behavior. 
+    '''
+
+    def __init__(self):
+        '''
+        When PyFerret creates a Window for an engine, it creates
+        an instance of the appropriate bindings class, then calls
+        the createWindow method of this instance created.  Thus 
+        instance variables will be for the one window associated
+        with the bindings instance.
+        '''
+        super(AbstractPyFerretBindings, self).__init__()
+
+    def createWindow(self, title, visible):
+        '''
+        Creates a "Window object" for this graphics engine.  Here,
+        a Window is the complete drawing area.  However, no drawing
+        will be performed on a Window, only on Views (see beginView).
+        Initializes the graphics engine if needed.
+
+        Arguments:
+            title: display title for the Window
+            visible: display Window on start-up?
+
+        Returns True if a Window was successfully created.
+        '''
+        return False
+
+    def deleteWindow(self):
+        '''
+        Deletes the Window associated with this instance of the bindings.
+        When this call returns True, the Window should not be visible,
+        all resources associated with this Window should have been released,
+        After calling this function, this instance of the bindings should
+        be deleted and considered no longer usable.
+        '''
+        return False
+
+    def setImageName(self, imagename, imgnamelen, formatname, fmtnamelen):
+        '''
+        Assigns the name and format of the image file to be created.
+
+        Arguments:
+            imagename  - name for the image file (can be NULL)
+            imgnamelen - actual length of imagename (zero if NULL)
+            formatname - name of the image format (case insensitive,
+                         can be NULL)
+            fmtnamelen - actual length of formatname (zero if NULL)
+       
+        If formatname is empty or NULL, the filename extension of
+        imagename, if it exists and is recognized, will determine
+        the format.
+
+        This method only suggests the name of the image file to
+        be created.  A file using the given name may or may not
+        be open from this call.
+
+        If a file was opened from this call (image data written
+        to file as it is being drawn), the saveWindow method may
+        not be supported.
+
+        If a file was not opened from this call, the saveWindow
+        method must be called to save the image.  Thus, the 
+        filename provided here may only be used as a default
+        filename.
+        '''
+        raise AttributeError('not implemented')
+
+    def setAntialias(self, antialias):
+        '''
+        Turns on (antilaias True) or off (antialias False) anti-aliasing
+        in future drawing commands.  May not be implemented and thus raise
+        an AttributeError.
+        '''
+        raise AttributeError('not implemented')
+
+    def beginView(self, leftfrac, bottomfrac, rightfrac, topfrac,
+                        clipit):
+        '''
+        Creates a "View object" for the given Window.  The view fractions
+        start at (0.0, 0.0) in the left top corner and increase to
+        (1.0, 1.0) in the right bottom corner; thus leftfrac must be less
+        than rightfrac and topfrac must be less than bottomfrac.
+
+        Arguments:
+            leftfrac:    [0,1] fraction of the Window width
+                         for the left side of the View
+            bottomfrac:  [0,1] fraction of the Window height
+                         for the bottom side of the View
+            rightfrac:   [0,1] fraction of the Window width
+                         for the right side of the View
+            topfrac:     [0,1] fraction of the Window height
+                         for the top side of the View
+            clipit:      clip drawing to this View?
+        '''
+        raise AttributeError('not implemented')
+
+    def clipView(self, clipit):
+        '''
+        Enable or disable clipping to the current View.
+
+        Arguments:
+            clipit: clip drawings to the current View?
+        '''
+        raise AttributeError('not implemented')
+
+    def endView(self):
+        '''
+        Closes the current View.  When this call returns, the graphics 
+        drawn to the View should be visible in its Window.
+        '''
+        raise AttributeError('not implemented')
+
+    def beginSegment(self, segid):
+        '''
+        Creates a "Segment object" for the given Window.
+        A Segment is just a group of drawing commands.
+
+        Arguments:
+            segid: ID for the Segment
+        '''
+        raise AttributeError('not implemented')
+
+    def endSegment(self):
+        '''
+        End the current "Segment" for the Window.
+        '''
+        raise AttributeError('not implemented')
+
+    def deleteSegment(self, segid):
+        '''
+        Deletes the drawing commands in the indicated Segment.
+
+        Arguments:
+            segid: ID for the Segment to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def updateWindow(self):
+        '''
+        Indicates the viewer should update the graphics displayed.
+        '''
+        raise AttributeError('not implemented')
+
+    def clearWindow(self, bkgcolor):
+        '''
+        Clears the Window of all drawings.  The window is 
+        initialized to all bkgcolor (the background color).
+ 
+        Arguments:
+            bkgcolor: initialize (fill) the Window with this Color
+        '''
+        raise AttributeError('not implemented')
+
+    def redrawWindow(self, bkgcolor):
+        '''
+        Redraw the current drawing except using bkgcolor as the
+        background color (the initialization color for the Window). 
+        
+        Arguments:
+            bkgcolor: initialize (fill) the Window with this Color
+                      before redrawing the current drawing.
+        '''
+        raise AttributeError('not implemented')
+
+    def windowScreenInfo(self):
+        '''
+        Returns the four-tuple (dpix, dpiy, screenwidth, screenheight) for
+        the default screen (display) of this Window
+           dpix: dots (pixels) per inch, in the horizontal (X) direction
+           dpiy: dots (pixels) per inch, in the vertical (Y) direction
+           screenwidth: width of the screen (display) in pixels (dots)
+           screenheight: height of the screen (display) in pixels (dots)
+        '''
+        raise AttributeError('not implemented')
+
+    def resizeWindow(self, width, height):
+        '''
+        Sets the current size of the Window.
+
+        Arguments:
+            width: width of the Window, in "device units"
+            height: height of the window in "device units"
+
+        "device units" is pixels at the current window DPI
+        '''
+        raise AttributeError('not implemented')
+
+    def scaleWindow(self, scale):
+        '''
+        Sets the scaling factor for the Window
+
+        Arguments:
+            scale: scaling factor to use
+        '''
+        raise AttributeError('not implemented')
+
+    def showWindow(self, visible):
+        '''
+        Display or hide a Window.  A graphics engine that does not
+        have the ability to display a Window should ignore this call.
+
+        Arguments:
+            visible: display (if True) or hide (if False) the Window
+        '''
+        raise AttributeError('not implemented')
+
+    def saveWindow(self, filename, fileformat, transparent, 
+                   xinches, yinches, xpixels, ypixels, annotations):
+        '''
+        Save the contents of the window to a file.  This might be called
+        when there is no image to save; in this case the call should be
+        ignored.
+
+        Arguments:
+            filename: name of the file to create
+            fileformat: name of the format to use
+            transparent: use a transparent background?
+            xinches: horizontal size of vector image in inches
+            yinches: vertical size of vector image in inches
+            xpixels: horizontal size of raster image in pixels
+            ypixels: vertical size of raster image in pixels
+            annotations: tuple of annotation strings
+
+        If fileformat is NULL, the fileformat is guessed from the
+        filename extension.
+
+        If transparent is False, the entire scene is initialized
+        to the last clearing color.  If transparent is True, the
+        entire scene is initialized as transparent.
+
+        If annotations is not None, the strings given in the tuple
+        are to be displayed above the image.  These annotations add 
+        height, as needed, to the saved image (i.e., yinches or 
+        ypixels is the height of the image below these annotations).
+        '''
+        raise AttributeError('not implemented')
+
+    def createColor(self, redfrac, greenfrac, bluefrac, opaquefrac):
+        '''
+        Returns a Color object from fractional [0.0, 1.0] intensities
+        of the red, green, and blue channels.
+
+        Arguments:
+            redfrac: fractional [0.0, 1.0] red intensity
+            greenfrac: fractional [0.0, 1.0] green intensity
+            bluefrac: fractional [0.0, 1.0] blue intensity
+            opaquefrac: fractional [0.0, 1.0] opaqueness
+                (0.0 is transparent; 1.0 is opaque) of the color.
+                If the graphics engine does not support this
+                feature (alpha channel), this may be silently
+                ignored and the color be completely opaque.
+
+        Raises an error if unable to create the Color object.
+        '''
+        raise AttributeError('not implemented')
+
+    def deleteColor(self, color):
+        '''
+        Delete a Color object created by createColor
+
+        Arguments:
+            color: Color to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def createFont(self, familyname, fontsize, italic, bold, underlined):
+        '''
+        Returns a Font object.
+
+        Arguments:
+            familyname: name of the font family (e.g., "Helvetica", "Times")
+            fontsize: desired size of the font (scales with view size)
+            italic: use the italic version of the font?
+            bold: use the bold version of the font?
+            underlined: use the underlined version of the font?
+
+        Raises an error if unable to create the Font object.
+        '''
+        raise AttributeError('not implemented')
+
+    def deleteFont(self, font):
+        '''
+        Delete a Font object created by createFont
+
+        Arguments:
+            font: Font to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def createPen(self, color, width, style, capstyle, joinstyle):
+        '''
+        Returns a Pen object.
+
+        Arguments:
+            color: Color to use
+            width: line width (scales with view size)
+            style: line style name (e.g., "solid", "dash")
+            capstyle: end-cap style name (e.g., "square")
+            joinstyle: join style name (e.g., "bevel")
+
+        Raises an error if unable to create the Pen object.
+        '''
+        raise AttributeError('not implemented')
+
+    def replacePenColor(self, pen, newcolor):
+        '''
+        Replaces the color in pen with newcolor.
+        
+        Arguments:
+            pen: Pen object to modify
+            newcolor: Color to use
+
+        Raises an error if unable to replace the Color in the Pen.
+        '''
+        raise AttributeError('not implemented')
+
+    def deletePen(self, pen):
+        '''
+        Delete a Pen object created by createPen
+
+        Arguments:
+            pen: Pen to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def createBrush(self, color, style):
+        '''
+        Returns a Brush object.
+
+        Arguments:
+            color: Color to use
+            style: fill style name (e.g., "solid", "cross")
+
+        Raises an error if unable to create the Brush object.
+        '''
+        raise AttributeError('not implemented')
+
+    def replaceBrushColor(self, brush, newcolor):
+        '''
+        Replaces the color in brush with newcolor.
+        
+        Arguments:
+            brush: Brush object to modify
+            newcolor: Color to use
+
+        Raises an error if unable to replace the Color in the Brush.
+        '''
+        raise AttributeError('not implemented')
+
+    def deleteBrush(self, brush):
+        '''
+        Delete a Brush object created by createBrush
+
+        Arguments:
+            brush: Brush to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def createSymbol(self, symbolname):
+        '''
+        Returns a Symbol object.
+
+        Arguments:
+            symbolname: name of the symbol (e.g., ".", "+")
+
+        Raises an error if unable to create the Symbol object.
+        '''
+        raise AttributeError('not implemented')
+
+    def deleteSymbol(self, symbol):
+        '''
+        Delete a Symbol object created by createSymbol
+
+        Arguments:
+            symbol: Symbol to be deleted
+        '''
+        raise AttributeError('not implemented')
+
+    def setWidthFactor(self, widthfactor):
+        '''
+        Assigns the scaling factor to be used for pen widths,
+        symbols sizes, and font sizes
+
+        Arguments:
+            widthfactor: positive float giving the new scaling factor to use
+        '''
+        raise AttributeError('not implemented')
+
+    def drawMultiline(self, ptsx, ptsy, pen):
+        '''
+        Draws connected line segments.
+
+        Arguments:
+            ptsx: X-coordinates of the endpoints
+            ptsy: Y-coordinates of the endpoints
+            pen: the Pen to use to draw the line segments
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        raise AttributeError('not implemented')
+
+    def drawPoints(self, ptsx, ptsy, symbol, color, ptsize):
+        '''
+        Draws discrete points.
+
+        Arguments:
+            ptsx: X-coordinates of the points
+            ptsy: Y-coordinates of the points
+            symbol: the Symbol to use to draw a point
+            color: color of the Symbol (default color if None or empty)
+            ptsize: size of the symbol (scales with view size)
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        raise AttributeError('not implemented')
+
+    def drawPolygon(self, ptsx, ptsy, brush, pen):
+        '''
+        Draws a polygon.
+
+        Arguments:
+            ptsx: X-coordinates of the vertices
+            ptsy: Y-coordinates of the vertices
+            brush: the Brush to use to fill the polygon; if None
+                    the polygon will not be filled
+            pen: the Pen to use to outline the polygon; if None
+                    the polygon will not be outlined
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        raise AttributeError('not implemented')
+
+    def drawRectangle(self, left, bottom, right, top, brush, pen):
+        '''
+        Draws a rectangle.
+
+        Arguments:
+            left: X-coordinate of the left edge
+            bottom: Y-coordinate of the bottom edge
+            right: X-coordinate of the right edge
+            top: Y-coordinate of the top edge
+            brush: the Brush to use to fill the polygon; if None
+                    the polygon will not be filled
+            pen: the Pen to use to outline the polygon; if None
+                    the polygon will not be outlined
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        raise AttributeError('not implemented')
+
+    def drawText(self, text, startx, starty, font, color, rotate):
+        '''
+        Draws text.
+
+        Arguments:
+            text: the text string to draw
+            startx: the X-coordinate of the beginning baseline
+            starty: the Y-coordinate of the beginning baseline
+            font: the font to use
+            color: the color to use as a solid brush or pen
+            rotate: the angle of the text baseline in degrees
+                    clockwise from horizontal
+
+        Coordinates are measured from the upper left corner
+        in "device units" (pixels at the current window DPI).
+        '''
+        raise AttributeError('not implemented')
+
diff --git a/pyfermod/libpyferret.c b/pyfermod/libpyferret.c
new file mode 100644
index 0000000..753afd5
--- /dev/null
+++ b/pyfermod/libpyferret.c
@@ -0,0 +1,1838 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#include <numpy/arrayobject.h>
+
+#include <ctype.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "ferret.h"
+#include "ferret_shared_buffer.h"
+#include "EF_Util.h"
+#include "grdel.h"
+#include "pyferret.h"
+
+/* global pyferret Python module object used for readline */
+PyObject *pyferret_module_pyobject = NULL;
+
+/* global pyferret.graphbind Python module object used for createWindow */
+PyObject *pyferret_graphbind_module_pyobject = NULL;
+
+/* Ferret's OK return status value */
+#define FERR_OK 3
+
+/* Special return value from libpyferret._run indicating the program should shut down */
+#define FERR_EXIT_PROGRAM -3
+
+/* Ferret's unspecified integer value */
+#define UNSPECIFIED_INT4 -999
+
+/* Length given to the abstract axis */
+#define ABSTRACT_AXIS_LEN 9999999
+
+/* Flag of this Ferret's start/stop state */
+static int ferretInitialized = 0;
+
+/*
+ * for memory management in this module
+ * double *, instead of DFTYPE *, is used for ferMemory 
+ * to create a warning if DFTYPE is not double.
+ */
+static size_t ferMemSize;
+static double *ferMemory = NULL;
+static float  *pplMemory = NULL;
+
+/* for recovering from seg faults */
+static void (*segv_handler)(int);
+static jmp_buf jumpbuffer;
+static void pyefcn_signal_handler(int signum)
+{
+    longjmp(jumpbuffer, 1);
+}
+
+/* 
+ * Ctrl-C handler that just calls the CTRLC_AST Fortran subroutine 
+ * defined in fer/gnl/ctrl_c.F (which has no arguments). 
+ */
+static void pyferret_sigint_handler(int signum) {
+    /* ignore any further Ctrl-C entries until done */
+    signal(SIGINT, SIG_IGN);
+    /* Now call the Fortran routine */
+    ctrlc_ast_();
+    /* Go back to catching Ctrl-C */
+    signal(SIGINT, pyferret_sigint_handler);
+}
+
+static char pyferretStartDocstring[] =
+    "Initializes Ferret.  This allocates the initial amount of memory for \n"
+    "Ferret (from Python-managed memory), opens the journal file, if requested, \n"
+    "and sets Ferret's verify mode.  If restrict is True, some Ferret commands \n"
+    "will not be available (to provide a secured session).  Once restrict is set, \n"
+    "it cannot be unset.  If server is True, Ferret will be run in server mode. \n"
+    "If metaname is empty (and not in server mode), Ferret's graphics will be \n"
+    "displayed by default;  otherwise, this value is used as the initial filename \n"
+    "for output graphics.  This routine does NOT run any user initialization scripts. \n"
+    "\n"
+    "Required arguments: \n"
+    " (none) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    memsize = <float>: the size, in megadoubles (where a double is 8 bytes), \n"
+    "                       to allocate for Ferret's memory cache (default 25.6) \n"
+    "    journal = <bool>: journal Ferret commands? (default True) \n"
+    "    verify = <bool>: echo Ferret commands? (default True) \n"
+    "    restrict = <bool>: restrict Ferret's capabilities? (default False) \n"
+    "    server = <bool>: run Ferret in server mode? (default False) \n"
+    "    metaname = <string>: filename for Ferret graphics (default empty) \n"
+    "    unmapped = <bool>: hide the graphics viewer? (default False) \n"
+    "    quiet = <bool>: do not print the ferret header? (default False) \n"
+    "\n"
+    "Returns: \n"
+    "    True is successful \n"
+    "    False if Ferret has already been started \n"
+    "\n"
+    "Raises: \n"
+    "    MemoryError if unable to allocate the needed memory \n"
+    "    IOError if unable to open the journal file \n";
+
+static PyObject *pyferretStart(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *argNames[] = {"memsize", "journal", "verify", "restrict", "server",
+                               "metaname", "transparent", "unmapped", "quiet", NULL};
+    double mwMemSize = 25.6;
+    PyObject *pyoJournal = NULL;
+    PyObject *pyoVerify = NULL;
+    PyObject *pyoRestrict = NULL;
+    PyObject *pyoServer = NULL;
+    PyObject *pyoTransparent = NULL;
+    PyObject *pyoUnmapped = NULL;
+    PyObject *pyoQuiet = NULL;
+    char *metaname = NULL;
+    int journalFlag = 1;
+    int verifyFlag = 1;
+    int restrictFlag = 0;
+    int serverFlag = 0;
+    int transparentFlag = 0;
+    int unmappedFlag = 0;
+    int quietFlag = 0;
+    int pplMemSize;
+    size_t blksiz;
+    int status;
+    int ttoutLun = TTOUT_LUN;
+    int one_cmnd_mode_int;
+    PyObject *modulename;
+
+    /* If already initialized, return False */
+    if ( ferretInitialized ) {
+        Py_INCREF(Py_False);
+        return Py_False;
+    }
+
+    /* Import the function-pointer table for the PyArray_* functions */
+    import_array1(NULL);
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "|dO!O!O!O!sO!O!O!",
+                 argNames, &mwMemSize, &PyBool_Type, &pyoJournal,
+                 &PyBool_Type, &pyoVerify, &PyBool_Type, &pyoRestrict,
+                 &PyBool_Type, &pyoServer, &metaname,
+                 &PyBool_Type, &pyoTransparent, &PyBool_Type, &pyoUnmapped,
+                 &PyBool_Type, &pyoQuiet) )
+        return NULL;
+
+    /* Interpret the booleans - Py_False and Py_True are singleton non-NULL objects, so just use == */
+    if ( pyoJournal == Py_False )
+        journalFlag = 0;
+    if ( pyoVerify == Py_False )
+        verifyFlag = 0;
+    if ( pyoRestrict == Py_True )
+        restrictFlag = 1;
+    if ( pyoServer == Py_True )
+        serverFlag = 1;
+    if ( pyoTransparent == Py_True )
+        transparentFlag = 1;
+    if ( pyoUnmapped == Py_True )
+        unmappedFlag = 1;
+    if ( pyoQuiet == Py_True )
+        quietFlag = 1;
+
+    if ( metaname[0] == '\0' )
+        metaname = NULL;
+
+    /* Deal with the restrict and server flags right away */
+    if ( restrictFlag != 0 )
+        set_secure();
+    if ( serverFlag != 0 )
+        set_server();
+
+    /* Initialize the shared buffer sBuffer */
+    set_shared_buffer();
+
+    /* Initial allocation of PPLUS memory */
+    pplMemSize = 0.5 * 1.0E6;
+    pplMemory = (float *) PyMem_Malloc((size_t)pplMemSize * (size_t)sizeof(float));
+    if ( pplMemory == NULL )
+        return PyErr_NoMemory();
+    set_ppl_memory(pplMemory, pplMemSize);
+
+    /* Initial allocation of Ferret memory - multiples of 100 PMAX_MEM_BLKS */
+    blksiz  = (size_t) ((mwMemSize * 1.0E6 + (double)PMAX_MEM_BLKS - 1.0) / (double)PMAX_MEM_BLKS);
+    blksiz  = (blksiz + 99) / 100;
+    blksiz *= 100;
+    ferMemSize = blksiz * (size_t)PMAX_MEM_BLKS;
+    /* Check for overflow */
+    if ( blksiz != ferMemSize / (size_t)PMAX_MEM_BLKS )
+        return PyErr_NoMemory();
+    ferMemory = (double *) PyMem_Malloc(ferMemSize * (size_t)sizeof(double));
+    if ( ferMemory == NULL )
+        return PyErr_NoMemory();
+    set_fer_memory(ferMemory, ferMemSize);
+
+    if ( (metaname != NULL) || (unmappedFlag != 0) ) {
+       /*
+        * Set the default graphics filename for saving before ending.
+        * Make a copy of the name just in case set_batch_graphics_ changes
+        * something.  This also hides the graphics viewer.
+        */
+       char my_meta_name[2048];
+       if ( metaname != NULL ) {
+           strncpy(my_meta_name, metaname, 2048);
+           my_meta_name[2047] = '\0';
+       }
+       else {
+           my_meta_name[0] = '\0';
+       }
+       set_batch_graphics_(my_meta_name);
+    }
+
+    /* Set the default autosave transparency */
+    fgd_set_transparency_(&transparentFlag);
+
+    /* Initialize stuff: keyboard, todays date, grids, GFDL terms, PPL brain */
+    initialize_();
+
+    /* Open the output journal file, if appropriate */
+    if ( journalFlag != 0 ) {
+        init_journal_(&status);
+        if ( status != FERR_OK ) {
+            PyErr_SetString(PyExc_IOError, "Unable to open the journal file ferret.jnl");
+            return NULL;
+        }
+    }
+    else
+        no_journal_();
+
+    /* Set the verify flag */
+    if ( verifyFlag == 0 )
+        turnoff_verify_(&status);
+
+    /* Get the PyObject representing the pyferret module */
+    modulename = PyString_FromString("pyferret");
+    if ( modulename == NULL ) {
+        return NULL;
+    }
+    pyferret_module_pyobject = PyImport_Import(modulename);
+    Py_DECREF(modulename);
+    if ( pyferret_module_pyobject == NULL ) {
+        return NULL;
+    }
+
+    /* Get the PyObject representing the pyferret.graphbind module */
+    modulename = PyString_FromString("pyferret.graphbind");
+    if ( modulename == NULL ) {
+        Py_DECREF(pyferret_module_pyobject);
+        return NULL;
+    }
+    pyferret_graphbind_module_pyobject = PyImport_Import(modulename);
+    Py_DECREF(modulename);
+    if ( pyferret_graphbind_module_pyobject == NULL ) {
+        return NULL;
+    }
+
+    /* Set and possibly output program name and revision number */
+    proclaim_c_(&ttoutLun, "\t", &quietFlag);
+
+    /* Set so that ferret_dispatch returns after every command */
+    one_cmnd_mode_int = 1;
+    set_one_cmnd_mode_(&one_cmnd_mode_int);
+
+    /* Success - return True */
+    ferretInitialized = 1;
+    Py_INCREF(Py_True);
+    return Py_True;
+}
+
+
+/*
+ * Helper function to reallocate Ferret's memory from Python.
+ * Argument: the new number of floats of Ferret's memory cache is given by
+ *           blksiz * PMAX_MEM_BLKS (defined in ferret.h as 2000)
+ * Returns: zero if fails, non-zero if successful
+ */
+static int resizeFerretMemory(int blksiz)
+{
+    size_t actual_blksiz;
+    size_t newFerMemSize;
+
+    /* Get the new size for the memory and check for overflow */
+    if ( blksiz <= 0 )
+        return 0;
+    actual_blksiz = (blksiz  + 99)/ 100;
+    actual_blksiz *= 100;
+    newFerMemSize = actual_blksiz * (size_t)PMAX_MEM_BLKS;
+    if ( actual_blksiz != newFerMemSize / (size_t)PMAX_MEM_BLKS )
+        return 0;
+
+    /*
+     * Free the old memory and allocate new memory rather than use
+     * realloc since the contents of the old memory isn't needed.
+     * This could also result in a better garbage collection.
+     */
+    PyMem_Free(ferMemory);
+    ferMemory = (double *) PyMem_Malloc(newFerMemSize * (size_t)sizeof(double));
+    if ( ferMemory == NULL ) {
+        ferMemory = (double *) PyMem_Malloc(ferMemSize * (size_t)sizeof(double));
+        if ( ferMemory == NULL ) {
+            fprintf(stderr, "**ERROR: Unable to restore Ferret's memory cache of %f Mdoubles\n", (double)ferMemSize / 1.0E6);
+            exit(1);
+        }
+        return 0;
+    }
+
+    /* Reallocation successful; assign the new memory */
+    ferMemSize = newFerMemSize;
+    set_fer_memory(ferMemory, ferMemSize);
+    return 1;
+}
+
+
+static char pyferretResizeMemoryDocstring[] =
+    "Reset the the amount of memory allocated for Ferret from Python-managed memory. \n"
+    "\n"
+    "Required arguments: \n"
+    "    memsize = <float>: the new size, in megadouble (where a double is 8 bytes), \n"
+    "                       for Ferret's memory cache \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    True if successful - Ferret has the new amount of memory \n"
+    "    False if unsuccessful - Ferret has the previous amount of memory \n"
+    "\n"
+    "Raises: \n"
+    "    MemoryError if Ferret has not been started or has been stopped \n";
+
+static PyObject *pyferretResizeMemory(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *argNames[] = {"memsize", NULL};
+    double mwMemSize;
+
+    /* If not initialized, raise a MemoryError */
+    if ( ! ferretInitialized ) {
+        PyErr_SetString(PyExc_MemoryError, "Ferret not started");
+        return NULL;
+    }
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "d", argNames, &mwMemSize) )
+        return NULL;
+
+    /* Reallocate the new amount of memory for Ferret */
+    if ( resizeFerretMemory((int) ((mwMemSize * 1.0E6 + (double)PMAX_MEM_BLKS - 1.0) / (double)PMAX_MEM_BLKS)) == 0 ) {
+        Py_INCREF(Py_False);
+        return Py_False;
+    }
+
+    /* Success - return True */
+    Py_INCREF(Py_True);
+    return Py_True;
+}
+
+
+static char pyferretRunCommandDocstring[] =
+    "Runs a Ferret command just as if entering a command at the Ferret prompt. \n"
+    "\n"
+    "If an empty string is given, Ferret will prompt you for commands \n"
+    "until either the \"EXIT\" or the \"EXIT /TOPYTHON\" command is given. \n"
+    "If \"EXIT /TOPYTHON\" is given, the return tuple will be for the last \n"
+    "error, if any, that occurred in the sequence of commands submitted. \n"
+    "\n"
+    "Required arguments: \n"
+    "    command = <string>: the Ferret command to be run \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "   (err_int, err_string) \n"
+    "       err_int: one of the FERR_* data values (FERR_OK if there are no errors) \n"
+    "       err_string: error or warning message (can be empty) \n"
+    "   Error messages normally start with \"**ERROR\" \n"
+    "   Warning messages normally start with \"*** NOTE:\" \n"
+    "\n"
+    "Raises: \n"
+    "    MemoryError if Ferret has not been started or has been stopped \n";
+
+static PyObject *pyferretRunCommand(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *argNames[] = {"command", NULL};
+    const char *command;
+    const char *iter_command;
+    int  one_cmnd_mode_int;
+    void (*oldsighand)(int);
+    int  cmnd_stack_level;
+    char errmsg[2112];
+    int  errval;
+
+    /* If not initialized, raise a MemoryError */
+    if ( ! ferretInitialized ) {
+        PyErr_SetString(PyExc_MemoryError, "Ferret not started");
+        return NULL;
+    }
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "s", argNames, &command) )
+        return NULL;
+
+    /* Clear the last error message and value */
+    clear_fer_last_error_info_();
+
+    /* If an empty string, temporarily turn off the one-command mode */
+    if ( command[0] == '\0' ) {
+        one_cmnd_mode_int = 0;
+        set_one_cmnd_mode_(&one_cmnd_mode_int);
+    }
+    else
+        one_cmnd_mode_int = 1;
+
+    /* Let ferret deal with ctrl-C while in ferret mode */
+    oldsighand = signal(SIGINT, pyferret_sigint_handler);
+    if ( oldsighand == SIG_ERR ) {
+        PyErr_SetString(PyExc_SystemError, "Unable to catch SIGTERM while in Ferret");
+        return NULL;
+    }
+    /* do-loop only for dealing with Ferret "SET MEMORY /SIZE=..." resize command */
+    iter_command = command;
+    do {
+        cmnd_stack_level = 0;
+        /* Run the Ferret command */
+        ferret_dispatch_c(ferMemory, iter_command, sBuffer);
+
+        if ( sBuffer->flags[FRTN_ACTION] == FACTN_MEM_RECONFIGURE ) {
+            /* resize, then re-enter if not single-command mode */
+            if ( resizeFerretMemory(sBuffer->flags[FRTN_IDATA1]) == 0 ) {
+                printf("Unable to resize Ferret's memory cache to %f Mdoubles\n",
+                       (double)(sBuffer->flags[FRTN_IDATA1]) * (double)PMAX_MEM_BLKS / 1.0E6);
+                printf("Ferret's memory cache remains at %f Mdoubles\n",
+                       (double)(ferMemSize) / 1.0E6);
+            }
+            cmnd_stack_level = sBuffer->flags[FRTN_IDATA2];
+        }
+        else {
+            /*
+             * Not a memory resize command; probably an exit command.
+             * Do not allow return to the Python prompt if in restricted mode
+             * (is_secure_() returns non-zero).
+             */
+            if ( is_secure_() == 0 )
+               break;
+            if ( sBuffer->flags[FRTN_ACTION] == FACTN_EXIT ) {
+               signal(SIGTERM, oldsighand);
+               exit(0);
+            }
+        }
+        /* submit an empty command to continue on with whaterever was going on */
+        iter_command = "";
+    } while ( (one_cmnd_mode_int == 0) || (cmnd_stack_level > 0) );
+    signal(SIGINT, oldsighand);
+
+    /* Set back to single command mode */
+    if ( one_cmnd_mode_int == 0 ) {
+        one_cmnd_mode_int = 1;
+        set_one_cmnd_mode_(&one_cmnd_mode_int);
+    }
+
+    if ( sBuffer->flags[FRTN_ACTION] == FACTN_EXIT ) {
+        /* plain "EXIT" Ferret command - instigate an orderly shutdown */
+
+        /* return Py_BuildValue("is", FERR_EXIT_PROGRAM, "EXIT"); */
+
+        /*
+         * python -i -c ... intercepts the Python sys.exit() call and stays in python,
+         * so just do a C exit() from python
+         */
+        exit(0);
+    }
+
+    /* Get the last error message (null terminated) and value */
+    get_fer_last_error_info_(&errval, errmsg, 2112);
+
+    /* Return the tuple of the last error value and message */
+    return Py_BuildValue("is", errval, errmsg);
+}
+
+
+static char pyferretGetDataDocstring[] =
+    "Returns the numeric data array described in the argument. \n"
+    "\n"
+    "Required arguments: \n"
+    "    name = <string>: the name of the numeric data array to return \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    A tuple containing: \n"
+    "        a NumPy float64 ndarray containing a copy of the numeric data requested, \n"
+    "        a NumPy float64 ndarray containing the bad-data-flag value(s) for the data, \n"
+    "        a string giving the units for the data \n"
+    "        a tuple of six integers giving the AXISTYPE codes of the axes, \n"
+    "        a tuple of six strings giving the names of the axes, \n"
+    "        a tuple of six strings giving the units of a non-calendar-time data axis, or \n"
+    "                                       the CALTYPE_ calendar name of a calendar-time axis, \n"
+    "        a tuple of six ndarrays giving the coordinates for the data axes \n"
+    "            (ndarray of N doubles for non-calendar-time, non-normal axes, \n"
+    "             ndarray of (N,6) integers for calendar-time axes, or \n"
+    "             None for normal axes) \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if the data name is invalid \n"
+    "    MemoryError if Ferret has not been started or has been stopped \n";
+
+static PyObject *pyferretGetData(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *argNames[] = {"name", NULL};
+    char        *name;
+    int          lendataname;
+    char         dataname[1024];
+    int          arraystart;
+    int          memlo[MAX_FERRET_NDIM], memhi[MAX_FERRET_NDIM];
+    int          steplo[MAX_FERRET_NDIM], stephi[MAX_FERRET_NDIM], incr[MAX_FERRET_NDIM];
+    char         dataunit[64];
+    int          lendataunit;
+    AXISTYPE     axis_types[MAX_FERRET_NDIM];
+    char         errmsg[2112];
+    int          lenerrmsg;
+    double       badval;
+    int          i, j, k, l, m, n, q;
+    npy_intp     shape[MAX_FERRET_NDIM];
+    npy_intp     new_shape[2];
+    int          strides[MAX_FERRET_NDIM];
+    PyObject    *data_ndarray;
+    double      *ferdata;
+    double      *npydata;
+    PyObject    *badval_ndarray;
+    PyObject    *axis_coords[MAX_FERRET_NDIM];
+    char         axis_units[MAX_FERRET_NDIM][64];
+    char         axis_names[MAX_FERRET_NDIM][64];
+    CALTYPE      calendar_type;
+
+    /* If not initialized, raise a MemoryError */
+    if ( ! ferretInitialized ) {
+        PyErr_SetString(PyExc_MemoryError, "Ferret not started");
+        return NULL;
+    }
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "s", argNames, &name) )
+        return NULL;
+
+    /* Make a copy of dataname just to be sure it isn't altered */
+    lendataname = strlen(name);
+    if ( lendataname > 1020 ) {
+        PyErr_SetString(PyExc_ValueError, "name too long");
+        return NULL;
+    }
+    strcpy(dataname, name);
+
+    /*
+     * Retrieve the memory parameters describing the data array requested.
+     * Assumes Unix standard for passing strings to Fortran (appended array lengths).
+     */
+    get_data_array_params_(dataname, &lendataname, ferMemory, &arraystart, memlo, memhi,
+                           steplo, stephi, incr, dataunit, &lendataunit, axis_types,
+                           &badval, errmsg, &lenerrmsg, 1024, 64, 2112);
+    if ( lenerrmsg > 0 ) {
+        errmsg[lenerrmsg] = '\0';
+        PyErr_SetString(PyExc_ValueError, errmsg);
+        return NULL;
+    }
+
+    /* null terminate the data unit name */
+    dataunit[lendataunit] = '\0';
+
+    /* Get the shape of the array */
+    for (k = 0; k < MAX_FERRET_NDIM; k++)
+        shape[k] = (npy_intp) ((stephi[k] - steplo[k] + incr[k]) / (incr[k]));
+
+    /* Get the strides through the memory (as a double *) */
+    strides[0] = 1;
+    for (k = 1; k < MAX_FERRET_NDIM; k++)
+        strides[k] = strides[k-1] * (memhi[k-1] - memlo[k-1] + 1);
+
+    /* Get the actual starting point in the array */
+    for (k = 0; k < MAX_FERRET_NDIM; k++)
+        arraystart += (strides[k]) * (steplo[k] - memlo[k]);
+
+    /* Convert to strides through places in memory to be read */
+    for (k = 0; k < MAX_FERRET_NDIM; k++)
+        strides[k] *= incr[k];
+
+    /* Create a new NumPy double ndarray (Fortran ordering) with the same shape */
+    data_ndarray = PyArray_EMPTY(MAX_FERRET_NDIM, shape, NPY_DOUBLE, 1);
+    if ( data_ndarray == NULL ) {
+        return NULL;
+    }
+
+    /*
+     * Assign the data in the new ndarray.
+     * Note: if MAX_FERRET_NDIM changes, this needs editing.
+     */
+    ferdata = ferMemory + arraystart;
+    npydata = PyArray_DATA(data_ndarray);
+    q = 0;
+    for (n = 0; n < (int)(shape[5]); n++) {
+      for (m = 0; m < (int)(shape[4]); m++) {
+        for (l = 0; l < (int)(shape[3]); l++) {
+          for (k = 0; k < (int)(shape[2]); k++) {
+            for (j = 0; j < (int)(shape[1]); j++) {
+              for (i = 0; i < (int)(shape[0]); i++) {
+                npydata[q] = ferdata[ i * strides[0] + 
+                                      j * strides[1] + 
+                                      k * strides[2] + 
+                                      l * strides[3] +
+                                      m * strides[4] +
+                                      n * strides[5] ];
+                q++;
+              }
+            }
+          }
+        }
+      }
+    }
+
+    /* Create a new NumPy float ndarray with the bad-data-flag value(s) */
+    new_shape[0] = 1;
+    badval_ndarray = PyArray_SimpleNew(1, new_shape, NPY_DOUBLE);
+    if ( badval_ndarray == NULL ) {
+       Py_DECREF(data_ndarray);
+       return NULL;
+    }
+    npydata = PyArray_DATA(badval_ndarray);
+    npydata[0] = badval;
+
+    /* Create the axis coordinates array objects */
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        switch( axis_types[k] ) {
+        case AXISTYPE_LONGITUDE:
+        case AXISTYPE_LATITUDE:
+        case AXISTYPE_LEVEL:
+        case AXISTYPE_CUSTOM:
+        case AXISTYPE_ABSTRACT:
+            /* array of doubles, possibly with a units string */
+            axis_coords[k] = PyArray_SimpleNew(1, &(shape[k]), NPY_DOUBLE);
+            if ( axis_coords[k] == NULL ) {
+                while ( k > 0 ) {
+                    k--;
+                    Py_DECREF(axis_coords[k]);
+                }
+                Py_DECREF(badval_ndarray);
+                Py_DECREF(data_ndarray);
+                return NULL;
+            }
+            /* get the coordinates and the units string */
+            q = k+1;
+            j = (int) shape[k];
+            get_data_array_coords_((double *)PyArray_DATA(axis_coords[k]), axis_units[k],
+                                   axis_names[k], &q, &j, errmsg, &lenerrmsg, 64, 64, 2112);
+            if ( lenerrmsg > 0 ) {
+                errmsg[lenerrmsg] = '\0';
+                PyErr_SetString(PyExc_ValueError, errmsg);
+                Py_DECREF(axis_coords[k]);
+                while ( k > 0 ) {
+                    k--;
+                    Py_DECREF(axis_coords[k]);
+                }
+                Py_DECREF(badval_ndarray);
+                Py_DECREF(data_ndarray);
+                return NULL;
+            }
+            break;
+        case AXISTYPE_TIME:
+            /* array of 6-tuples of integers in C order, so: [N][6] in C or (6,N) in Fortran */
+            new_shape[0] = shape[k];
+            new_shape[1] = 6;
+            axis_coords[k] = PyArray_SimpleNew(2, new_shape, NPY_INT);
+            if ( axis_coords[k] == NULL ) {
+                while ( k > 0 ) {
+                    k--;
+                    Py_DECREF(axis_coords[k]);
+                }
+                Py_DECREF(badval_ndarray);
+                Py_DECREF(data_ndarray);
+                return NULL;
+            }
+            /* get the time coordinate integers */
+            q = k+1;
+            j = (int) shape[k];
+            get_data_array_time_coords_((int (*)[6])PyArray_DATA(axis_coords[k]), &calendar_type, axis_names[k],
+                                        &q, &j, errmsg, &lenerrmsg, 64, 2112);
+            if ( lenerrmsg > 0 ) {
+                errmsg[lenerrmsg] = '\0';
+                PyErr_SetString(PyExc_ValueError, errmsg);
+                Py_DECREF(axis_coords[k]);
+                while ( k > 0 ) {
+                    k--;
+                    Py_DECREF(axis_coords[k]);
+                }
+                Py_DECREF(badval_ndarray);
+                Py_DECREF(data_ndarray);
+                return NULL;
+            }
+            /* set the axis units to the name of the calendar */
+            switch( calendar_type ) {
+            case CALTYPE_NONE:
+                strcpy(axis_units[k], "CALTYPE_NONE");
+                break;
+            case CALTYPE_360DAY:
+                strcpy(axis_units[k], "CALTYPE_360DAY");
+                break;
+            case CALTYPE_NOLEAP:
+                strcpy(axis_units[k], "CALTYPE_NOLEAP");
+                break;
+            case CALTYPE_GREGORIAN:
+                strcpy(axis_units[k], "CALTYPE_GREGORIAN");
+                break;
+            case CALTYPE_JULIAN:
+                strcpy(axis_units[k], "CALTYPE_JULIAN");
+                break;
+            case CALTYPE_ALLLEAP:
+                strcpy(axis_units[k], "CALTYPE_ALLLEAP");
+                break;
+            default:
+                sprintf(errmsg, "Unexpected calendar type of %d", calendar_type);
+                PyErr_SetString(PyExc_ValueError, errmsg);
+                Py_DECREF(axis_coords[k]);
+                while ( k > 0 ) {
+                    k--;
+                    Py_DECREF(axis_coords[k]);
+                }
+                Py_DECREF(badval_ndarray);
+                Py_DECREF(data_ndarray);
+                return NULL;
+            }
+            break;
+        case AXISTYPE_NORMAL:
+            /* axis normal to the results - no coordinates */
+            Py_INCREF(Py_None);
+            axis_coords[k] = Py_None;
+            axis_units[k][0] = '\0';
+            axis_names[k][0] = '\0';
+            break;
+        default:
+            sprintf(errmsg, "Unexpected axis type of %d", axis_types[k]);
+            PyErr_SetString(PyExc_RuntimeError, errmsg);
+            while ( k > 0 ) {
+                k--;
+                Py_DECREF(axis_coords[k]);
+            }
+            Py_DECREF(badval_ndarray);
+            Py_DECREF(data_ndarray);
+            return NULL;
+        }
+    }
+
+    /*
+     * Return a tuple (stealing references for PyObjects) of data_ndarray,
+     * badval_ndarray, dataunit, axis_types, axis_names, axis_units, and axis_coords.
+     * Note: if MAX_FERRET_NDIM changes, this needs editing.
+     */
+    return Py_BuildValue("NNs(iiiiii)(ssssss)(ssssss)(NNNNNN)", data_ndarray, badval_ndarray, dataunit,
+              axis_types[0], axis_types[1], axis_types[2], axis_types[3], axis_types[4], axis_types[5],
+              axis_names[0], axis_names[1], axis_names[2], axis_names[3], axis_names[4], axis_names[5],
+              axis_units[0], axis_units[1], axis_units[2], axis_units[3], axis_units[4], axis_units[5],
+              axis_coords[0], axis_coords[1], axis_coords[2], axis_coords[3], axis_coords[4], axis_coords[5]);
+}
+
+
+static char pyferretPutDataDocstring[] =
+    "Creates a Ferret data variable with the numeric data array described in the arguments. \n"
+    "\n"
+    "Required arguments: \n"
+    "    codename = <string>: the code name of the Ferret data variable to create (eg, \"SST\") \n"
+    "    title = <string>: the title of the Ferret data variable to create (eg, \"Sea Surface Temperature\") \n"
+    "    data = <ndarray>: the array containing the numeric data \n"
+    "    bdfval = <ndarray>: the bad-data-flag value for the data \n"
+    "    units = <string>: the units for the data \n"
+    "    dset = <string>: the dataset name or number to be associates with this variable; \n"
+    "                     give an empty strip associated with the current dataset \n"
+    "                     or 'None' to not associate with any dataset \n"
+    "    axis_types = <6-tuple of int>: the AXISTYPE codes for the axes \n"
+    "    axis_names = <6-tuple of string>: the names of the axes \n"
+    "    axis_units = <6-tuple of string>: the units of a non-calendar-time axis, or \n"
+    "                                      the CALTYPE_ calendar name of a calendar-time axis \n"
+    "    axis_coords = <6-tuple of ndarray>: the axis coordinates \n"
+    "                                        (ndarray of N doubles for a non-calendar-time, non-normal axis, or \n"
+    "                                         ndarray of (N,6) integers for a calendar-time axis; \n"
+    "                                         None - or any object - for a normal axis) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    None \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if there is a problem with the argument data passed \n"
+    "    MemoryError if Ferret has not been started or has been stopped \n";
+
+static PyObject *pyferretPutData(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *argNames[] = {"codename", "title", "data", "bdfval", "units", "dset",
+                               "axis_types", "axis_names", "axis_units", "axis_coords", NULL};
+    char        *codename;
+    char        *title;
+    PyObject    *data_ndarray;
+    PyObject    *bdfval_ndarray;
+    char        *units;
+    char        *dset;
+    PyObject    *axis_types_tuple;
+    PyObject    *axis_names_tuple;
+    PyObject    *axis_units_tuple;
+    PyObject    *axis_coords_tuple;
+    double       bdfval;
+    int          k;
+    PyObject    *seqitem;
+    AXISTYPE     axis_types[MAX_FERRET_NDIM];
+    char        *strptr;
+    char         axis_names[MAX_FERRET_NDIM][64];
+    char         axis_units[MAX_FERRET_NDIM][64];
+    int          num_coords[MAX_FERRET_NDIM];
+    void        *axis_coords[MAX_FERRET_NDIM];
+    CALTYPE      calendar_type;
+    int          axis_nums[MAX_FERRET_NDIM];
+    int          axis_starts[MAX_FERRET_NDIM];
+    int          axis_ends[MAX_FERRET_NDIM];
+    int          len_codename;
+    int          len_title;
+    int          len_units;
+    int          len_dset;
+    char         errmsg[2048];
+    int          len_errmsg;
+
+    /* If not initialized, raise a MemoryError */
+    if ( ! ferretInitialized ) {
+        PyErr_SetString(PyExc_MemoryError, "Ferret not started");
+        return NULL;
+    }
+
+    /* Parse the arguments, checking if an Exception was raised - borrowed references to the PyObjects */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "ssOOssOOOO", argNames, &codename, &title,
+                                       &data_ndarray, &bdfval_ndarray, &units, &dset, &axis_types_tuple,
+                                       &axis_names_tuple, &axis_units_tuple, &axis_coords_tuple) )
+        return NULL;
+
+    /* PyArray_Size returns 0 if the object is not an appropriate type */
+    /* ISFARRAY_RO checks if it is F-contiguous, aligned, and in machine byte-order */
+    if ( (PyArray_Size(data_ndarray) < 1) || (PyArray_TYPE(data_ndarray) != NPY_DOUBLE) ||
+         (! PyArray_ISFARRAY_RO(data_ndarray)) || (! PyArray_CHKFLAGS(data_ndarray, NPY_OWNDATA)) ) {
+        PyErr_SetString(PyExc_ValueError, "data is not an appropriate ndarray of type float64");
+        return NULL;
+    }
+
+    /* PyArray_Size returns 0 if the object is not an appropriate type */
+    /* ISBEHAVED_RO checks if it is aligned and in machine byte-order */
+    if ( (PyArray_Size(bdfval_ndarray) < 1) || (PyArray_TYPE(bdfval_ndarray) != NPY_DOUBLE) ||
+         (! PyArray_ISBEHAVED_RO(bdfval_ndarray)) ) {
+        PyErr_SetString(PyExc_ValueError, "bdfval is not an appropriate ndarray of type float64");
+        return NULL;
+    }
+    /* Just get bdfval from the data in bdfval_ndarray */
+    bdfval = ((double *) PyArray_DATA(bdfval_ndarray))[0];
+
+    /* Get the axis types out of the tuple */
+    axis_types_tuple = PySequence_Fast(axis_types_tuple, "axis_types is not a tuple or list");
+    if ( axis_types_tuple == NULL ) {
+        return NULL;
+    }
+    if ( PySequence_Fast_GET_SIZE(axis_types_tuple) != MAX_FERRET_NDIM ) {
+        PyErr_SetString(PyExc_ValueError, "axis_types does not have the expected number of items");
+        Py_DECREF(axis_types_tuple);
+        return NULL;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        seqitem = PySequence_Fast_GET_ITEM(axis_types_tuple, k); /* borrowed reference */
+        axis_types[k] = (int) PyInt_AsLong(seqitem);
+        if ( (axis_types[k] != AXISTYPE_LONGITUDE) &&
+             (axis_types[k] != AXISTYPE_LATITUDE) &&
+             (axis_types[k] != AXISTYPE_LEVEL) &&
+             (axis_types[k] != AXISTYPE_TIME) &&
+             (axis_types[k] != AXISTYPE_CUSTOM) &&
+             (axis_types[k] != AXISTYPE_ABSTRACT) &&
+             (axis_types[k] != AXISTYPE_NORMAL) ) {
+            PyErr_SetString(PyExc_ValueError, "Invalid axis_types item");
+            Py_DECREF(axis_types_tuple);
+            return NULL;
+        }
+    }
+    Py_DECREF(axis_types_tuple);
+
+    /* Get the axis names out of the tuple */
+    axis_names_tuple = PySequence_Fast(axis_names_tuple, "axis_names is not a tuple or list");
+    if ( axis_names_tuple == NULL ) {
+        return NULL;
+    }
+    if ( PySequence_Fast_GET_SIZE(axis_names_tuple) != MAX_FERRET_NDIM ) {
+        PyErr_SetString(PyExc_ValueError, "axis_names does not have the expected number of items");
+        Py_DECREF(axis_names_tuple);
+        return NULL;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        seqitem = PySequence_Fast_GET_ITEM(axis_names_tuple, k); /* borrowed reference */
+        strptr = PyString_AsString(seqitem);
+        if ( strptr == NULL ) {
+            PyErr_Clear();
+            PyErr_SetString(PyExc_ValueError, "Invalid axis_names item");
+            Py_DECREF(axis_names_tuple);
+            return NULL;
+        }
+        strncpy(axis_names[k], strptr, 64);
+        axis_names[k][63] = '\0';
+    }
+    Py_DECREF(axis_names_tuple);
+
+    /* Get the axis units out of the tuple */
+    axis_units_tuple = PySequence_Fast(axis_units_tuple, "axis_units is not a tuple or list");
+    if ( axis_units_tuple == NULL ) {
+        return NULL;
+    }
+    if ( PySequence_Fast_GET_SIZE(axis_units_tuple) != MAX_FERRET_NDIM ) {
+        PyErr_SetString(PyExc_ValueError, "axis_units does not have the expected number of items");
+        Py_DECREF(axis_units_tuple);
+        return NULL;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        seqitem = PySequence_Fast_GET_ITEM(axis_units_tuple, k); /* borrowed reference */
+        strptr = PyString_AsString(seqitem);
+        if ( strptr == NULL ) {
+            PyErr_Clear();
+            PyErr_SetString(PyExc_ValueError, "Invalid axis_units item");
+            Py_DECREF(axis_units_tuple);
+            return NULL;
+        }
+        strncpy(axis_units[k], strptr, 64);
+        axis_units[k][63] = '\0';
+    }
+    Py_DECREF(axis_units_tuple);
+
+    /* Get the axis coordinates ndarray out of the tuple */
+    axis_coords_tuple = PySequence_Fast(axis_coords_tuple, "axis_coords is not a tuple or list");
+    if ( axis_coords_tuple == NULL ) {
+        return NULL;
+    }
+    if ( PySequence_Fast_GET_SIZE(axis_coords_tuple) != MAX_FERRET_NDIM ) {
+        PyErr_SetString(PyExc_ValueError, "axis_coords does not have the expected number of items");
+        Py_DECREF(axis_coords_tuple);
+        return NULL;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        seqitem = PySequence_Fast_GET_ITEM(axis_coords_tuple, k); /* borrowed reference */
+        switch( axis_types[k] ) {
+        case AXISTYPE_LONGITUDE:
+        case AXISTYPE_LATITUDE:
+        case AXISTYPE_LEVEL:
+        case AXISTYPE_CUSTOM:
+        case AXISTYPE_ABSTRACT:
+            /* float64 N-ndarray containing the axis coordinates */
+            /* PyArray_Size returns 0 if the object is not an appropriate type */
+            /* ISCARRAY_RO checks if it is C-contiguous, aligned and in machine byte-order */
+            num_coords[k] = PyArray_Size(seqitem);
+            if ( num_coords[k] < 1 ) {
+                PyErr_SetString(PyExc_ValueError, "a standard axis of axis_coords has an invalid number of coordinates");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            if ( PyArray_TYPE(seqitem) != NPY_DOUBLE ) {
+                PyErr_SetString(PyExc_ValueError, "a standard axis of axis_coords has an invalid type");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            if ( ! PyArray_ISCARRAY_RO(seqitem) ) {
+                PyErr_SetString(PyExc_ValueError, "a standard axis of axis_coords is not an appropriate ndarray");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            axis_coords[k] = PyArray_DATA(seqitem);
+            get_axis_num_(&(axis_nums[k]), &(axis_starts[k]), &(axis_ends[k]), axis_names[k],
+                          axis_units[k], axis_coords[k], &(num_coords[k]), &(axis_types[k]),
+                          errmsg, &len_errmsg, strlen(axis_names[k]), strlen(axis_units[k]), 2048);
+            if ( len_errmsg > 0 ) {
+                errmsg[len_errmsg] = '\0';
+                PyErr_SetString(PyExc_ValueError, errmsg);
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            break;
+        case AXISTYPE_TIME:
+            /* int32 (N,6)-ndarray containing component time values; the calendar given in axis_units */
+            /* PyArray_Size returns 0 if the object is not an appropriate type */
+            /* ISCARRAY_RO checks if it is C-contiguous, aligned and in machine byte-order */
+            num_coords[k] = PyArray_Size(seqitem);
+            if ( (num_coords[k] < 1) || ((num_coords[k] % 6) != 0) ) {
+                PyErr_SetString(PyExc_ValueError, "an absolute-time axis of axis_coords has an invalid number of coordinates");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            if ( (PyArray_TYPE(seqitem) != NPY_INT) &&
+                 ((PyArray_TYPE(seqitem) != NPY_LONG) || (NPY_SIZEOF_LONG != 4)) ) {
+                PyErr_SetString(PyExc_ValueError, "an absolute-time axis of axis_coords has an invalid type");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            if ( ! PyArray_ISCARRAY_RO(seqitem) ) {
+                PyErr_SetString(PyExc_ValueError, "an absolute-time axis of axis_coords is not an appropriate ndarray");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            num_coords[k] /= 6;
+            if ( strcmp(axis_units[k], "CALTYPE_NONE") == 0 ) {
+                calendar_type = CALTYPE_NONE;
+            }
+            else if ( strcmp(axis_units[k], "CALTYPE_360DAY") == 0 ) {
+                calendar_type = CALTYPE_360DAY;
+            }
+            else if ( strcmp(axis_units[k], "CALTYPE_NOLEAP") == 0 ) {
+                calendar_type = CALTYPE_NOLEAP;
+            }
+            else if ( strcmp(axis_units[k], "CALTYPE_GREGORIAN") == 0 ) {
+                calendar_type = CALTYPE_GREGORIAN;
+            }
+            else if ( strcmp(axis_units[k], "CALTYPE_JULIAN") == 0 ) {
+                calendar_type = CALTYPE_JULIAN;
+            }
+            else if ( strcmp(axis_units[k], "CALTYPE_ALLLEAP") == 0 ) {
+                calendar_type = CALTYPE_ALLLEAP;
+            }
+            else {
+                PyErr_SetString(PyExc_ValueError, "unknown calendar");
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            axis_coords[k] = PyArray_DATA(seqitem);
+            get_time_axis_num_(&(axis_nums[k]), &(axis_starts[k]), &(axis_ends[k]),
+                               axis_names[k], &calendar_type, axis_coords[k], &(num_coords[k]),
+                               errmsg, &len_errmsg, strlen(axis_names[k]), 2048);
+            if ( len_errmsg > 0 ) {
+                errmsg[len_errmsg] = '\0';
+                PyErr_SetString(PyExc_ValueError, errmsg);
+                Py_DECREF(axis_coords_tuple);
+                return NULL;
+            }
+            break;
+        case AXISTYPE_NORMAL:
+            /* axis normal to the results - ignore sequence item (probably None) */
+            axis_nums[k] = 0;   /* ferret.parm value for a normal line (mnormal) */
+            axis_starts[k] = 0;
+            axis_ends[k] = 0;
+            break;
+        default:
+            PyErr_SetString(PyExc_ValueError, "Unexpected axis_type when processing axis coordinates");
+            Py_DECREF(axis_coords_tuple);
+            return NULL;
+        }
+    }
+
+    /* The information in axis_coords_tuple no longer needed */
+    Py_DECREF(axis_coords_tuple);
+
+    /* Assign the data in the XPYVAR_INFO common block */
+    len_codename = strlen(codename);
+    len_title = strlen(title);
+    len_units = strlen(units);
+    len_dset = strlen(dset);
+    add_pystat_var_(&data_ndarray, codename, title, units, &bdfval, dset,
+                    axis_nums, axis_starts, axis_ends, errmsg, &len_errmsg,
+                    len_codename, len_title, len_units, len_dset, 2048);
+    if ( len_errmsg > 0 ) {
+        errmsg[len_errmsg] = '\0';
+        PyErr_SetString(PyExc_ValueError, errmsg);
+        return NULL;
+    }
+
+    /*
+     * Increase the reference count to data_ndarray to keep it around.
+     * A pointer to it is stored in the XPYVAR_INFO common block.
+     * The reference count will be decremented by Ferret when no longer needed.
+     */
+    Py_INCREF(data_ndarray);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+static char pyferretStopDocstring[] =
+    "Runs a series of Ferret commands to return Ferret to \n"
+    "its default state, then shuts down and releases all \n"
+    "memory used by Ferret.  After calling this function do \n"
+    "not call any Ferret functions except start, which will \n"
+    "restart Ferret and re-enable the other functions. \n"
+    "\n"
+    "Required arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    False if Ferret has not been started or has already been stopped \n"
+    "    True otherwise \n";
+
+static PyObject *pyferretStop(PyObject *self)
+{
+    /* If not initialized, return False */
+    if ( ! ferretInitialized ) {
+        Py_INCREF(Py_False);
+        return Py_False;
+    }
+
+    /* Set to uninitialized */
+    ferretInitialized = 0;
+
+    /* Release the references to the pyferret and pyferret.graphbind modules */
+    Py_DECREF(pyferret_graphbind_module_pyobject);
+    pyferret_graphbind_module_pyobject = NULL;
+    Py_DECREF(pyferret_module_pyobject);
+    pyferret_module_pyobject = NULL;
+
+    /* Run commands to clear/reset Ferret's state */
+    ferret_dispatch_c(ferMemory, "SET GRID ABSTRACT", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL WINDOW /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL VARIABLE /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL SYMBOL /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL DATA /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL REGION /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "CANCEL MEMORY /ALL", sBuffer);
+    ferret_dispatch_c(ferMemory, "EXIT /PROGRAM", sBuffer);
+
+    /* Free memory allocated inside Ferret */
+    finalize_();
+
+    /* Free memory allocated for Ferret */
+    PyMem_Free(ferMemory);
+    ferMemory = NULL;
+    ferMemSize = 0;
+    PyMem_Free(pplMemory);
+    pplMemory = NULL;
+
+    /* Return True */
+    Py_INCREF(Py_True);
+    return Py_True;
+}
+
+
+static char pyferretQuitDocstring[] =
+    "Shuts down and release all memory used by Ferret. \n"
+    "This function is intended to be used with the atexit module \n"
+    "to ensure an open viewer window does not hang Python shutdown. \n"
+    "\n"
+    "Required arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    None \n";
+
+static PyObject *pyferretQuit(PyObject *self)
+{
+    /* If not initialized, nothing to do; just return None */
+    if ( ! ferretInitialized ) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    /* Set to uninitialized */
+    ferretInitialized = 0;
+
+    /* Release the references to the pyferret and pyferret.graphbind modules */
+    Py_DECREF(pyferret_graphbind_module_pyobject);
+    pyferret_graphbind_module_pyobject = NULL;
+    Py_DECREF(pyferret_module_pyobject);
+    pyferret_module_pyobject = NULL;
+
+    /* Let Ferret do its orderly shutdown - including closing viewers */
+    ferret_dispatch_c(ferMemory, "EXIT /PROGRAM", sBuffer);
+
+    /* Free memory allocated inside Ferret */
+    finalize_();
+
+    /* Free memory allocated for Ferret */
+    PyMem_Free(ferMemory);
+    ferMemory = NULL;
+    ferMemSize = 0;
+    PyMem_Free(pplMemory);
+    pplMemory = NULL;
+
+    /* Return None */
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+static char pyefcnGetAxisCoordinatesDocstring[] =
+    "Returns the \"world\" coordinates for an axis of an argument to an external function\n"
+    "\n"
+    "Required arguments: \n"
+    "    id = <int>: the ferret id of the external function \n"
+    "    arg = <int>: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9) \n"
+    "    axis = <int>: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS, \n"
+    "                                                              T_AXIS, E_AXIS, F_AXIS) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    a NumPy float64 ndarray containing the \"world\" coordinates, \n"
+    "    or None if the values cannot be determined at the time this was called \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if id, arg, or axis is invalid \n";
+
+static PyObject *pyefcnGetAxisCoordinates(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char      *argNames[] = {"id", "arg", "axis", NULL};
+    int               id, arg, axis;
+    ExternalFunction *ef_ptr;
+    int               steplo[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               stephi[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               incr[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               lo, hi;
+    npy_intp          shape[1];
+    PyObject         *coords_ndarray;
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "iii", argNames, &id, &arg, &axis) )
+        return NULL;
+
+    /* Check for obvious errors in the arguments passed */
+    ef_ptr = ef_ptr_from_id_ptr(&id);
+    if ( (ef_ptr == NULL) || ! ef_ptr->already_have_internals ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid ferret external function id");
+        return NULL;
+    }
+    if ( (arg < 0) || (arg >= EF_MAX_ARGS) ||
+         ((arg >= ef_ptr->internals_ptr->num_reqd_args) && ! ef_ptr->internals_ptr->has_vari_args) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid argument index");
+        return NULL;
+    }
+    if ( (axis < 0) || (axis >= MAX_FERRET_NDIM) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid axis index");
+        return NULL;
+    }
+
+    /* Catch seg faults from indiscriminately calling this function */
+    if ( setjmp(jumpbuffer) == 1 ) {
+        signal(SIGSEGV, segv_handler);
+        PyErr_SetString(PyExc_ValueError, "Invalid function call - probably not from a ferret external function call");
+        return NULL;
+    }
+    segv_handler = signal(SIGSEGV, pyefcn_signal_handler);
+    if ( segv_handler == SIG_ERR ) {
+        PyErr_SetString(PyExc_ValueError, "Unable to catch SIGSEGV");
+        return NULL;
+    }
+
+    /* Get the subscripts for all of the arguments */
+    ef_get_arg_subscripts_6d_(&id, steplo, stephi, incr);
+
+    /* Restore the original segv handler */
+    signal(SIGSEGV, segv_handler);
+
+    /* Check the indices for the coordinates of the desired axis of the argument */
+    if ( (steplo[arg][axis] == UNSPECIFIED_INT4) || (stephi[arg][axis] == UNSPECIFIED_INT4) ||
+         ((steplo[arg][axis] == 1) && (stephi[arg][axis] == ABSTRACT_AXIS_LEN)) ) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    /* Create a NumPy float64 ndarray to get the memory for the coordinates */
+    if ( incr[arg][axis] == 0 ) {
+        if ( steplo[arg][axis] <= stephi[arg][axis] )
+            incr[arg][axis] = 1;
+        else
+            incr[arg][axis] = -1;
+    }
+    shape[0] = (Py_ssize_t) ((stephi[arg][axis] - steplo[arg][axis] + incr[arg][axis]) / incr[arg][axis]);
+    coords_ndarray = PyArray_SimpleNew(1, shape, NPY_DOUBLE);
+    if ( coords_ndarray == NULL ) {
+        return NULL;
+    }
+
+    /* Get the full range of world coordinates for the requested axis */
+    lo = steplo[arg][axis];
+    hi = stephi[arg][axis];
+    arg++;
+    axis++;
+    ef_get_coordinates_(&id, &arg, &axis, &lo, &hi, (double *)PyArray_DATA(coords_ndarray));
+
+    return coords_ndarray;
+}
+
+
+static char pyefcnGetAxisBoxSizesDocstring[] =
+    "Returns the \"box sizes\", in \"world\" coordinate units, \n"
+    "for an axis of an argument to an external function \n"
+    "\n"
+    "Required arguments: \n"
+    "    id = <int>: the ferret id of the external function \n"
+    "    arg = <int>: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9) \n"
+    "    axis = <int>: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS, \n"
+    "                                                              T_AXIS, E_AXIS, F_AXIS) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    a NumPy float64 ndarray containing the \"box sizes\", \n"
+    "    or None if the values cannot be determined at the time this was called \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if id, arg, or axis is invalid \n";
+
+static PyObject *pyefcnGetAxisBoxSizes(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char      *argNames[] = {"id", "arg", "axis", NULL};
+    int               id, arg, axis;
+    ExternalFunction *ef_ptr;
+    int               steplo[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               stephi[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               incr[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               lo, hi;
+    npy_intp          shape[1];
+    PyObject         *sizes_ndarray;
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "iii", argNames, &id, &arg, &axis) )
+        return NULL;
+
+    /* Check for obvious errors in the arguments passed */
+    ef_ptr = ef_ptr_from_id_ptr(&id);
+    if ( (ef_ptr == NULL) || ! ef_ptr->already_have_internals ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid ferret external function id");
+        return NULL;
+    }
+    if ( (arg < 0) || (arg >= EF_MAX_ARGS) ||
+         ((arg >= ef_ptr->internals_ptr->num_reqd_args) && ! ef_ptr->internals_ptr->has_vari_args) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid argument index");
+        return NULL;
+    }
+    if ( (axis < 0) || (axis >= MAX_FERRET_NDIM) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid axis index");
+        return NULL;
+    }
+
+    /* Catch seg faults from indiscriminately calling this function */
+    if ( setjmp(jumpbuffer) == 1 ) {
+        signal(SIGSEGV, segv_handler);
+        PyErr_SetString(PyExc_ValueError, "Invalid function call - probably not from a ferret external function call");
+        return NULL;
+    }
+    segv_handler = signal(SIGSEGV, pyefcn_signal_handler);
+    if ( segv_handler == SIG_ERR ) {
+        PyErr_SetString(PyExc_ValueError, "Unable to catch SIGSEGV");
+        return NULL;
+    }
+
+    /* Get the subscripts for all of the arguments */
+    ef_get_arg_subscripts_6d_(&id, steplo, stephi, incr);
+
+    /* Restore the original segv handler */
+    signal(SIGSEGV, segv_handler);
+
+    /* Check the indices for the coordinates of the desired axis of the argument */
+    if ( (steplo[arg][axis] == UNSPECIFIED_INT4) || (stephi[arg][axis] == UNSPECIFIED_INT4) ||
+         ((steplo[arg][axis] == 1) && (stephi[arg][axis] == ABSTRACT_AXIS_LEN)) ) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    /* Create a NumPy float64 ndarray to get the memory for the box sizes */
+    if ( incr[arg][axis] == 0 ) {
+        if ( steplo[arg][axis] <= stephi[arg][axis] )
+            incr[arg][axis] = 1;
+        else
+            incr[arg][axis] = -1;
+    }
+    shape[0] = (Py_ssize_t) ((stephi[arg][axis] - steplo[arg][axis] + incr[arg][axis]) / incr[arg][axis]);
+    sizes_ndarray = PyArray_SimpleNew(1, shape, NPY_DOUBLE);
+    if ( sizes_ndarray == NULL ) {
+        return NULL;
+    }
+
+    /* Get the full range of box sizes for the requested axis */
+    lo = steplo[arg][axis];
+    hi = stephi[arg][axis];
+    arg++;
+    axis++;
+    ef_get_box_size_(&id, &arg, &axis, &lo, &hi, (double *)PyArray_DATA(sizes_ndarray));
+
+    return sizes_ndarray;
+}
+
+
+static char pyefcnGetAxisBoxLimitsDocstring[] =
+    "Returns the \"box limits\", in \"world\" coordinate units, \n"
+    "for an axis of an argument to an external function \n"
+    "\n"
+    "Required arguments: \n"
+    "    id = <int>: the ferret id of the external function \n"
+    "    arg = <int>: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9) \n"
+    "    axis = <int>: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS, \n"
+    "                                                              T_AXIS, E_AXIS, F_AXIS) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    a tuple of two NumPy float64 ndarrays containing the low and high \"box limits\", \n"
+    "    or None if the values cannot be determined at the time this was called \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if id, arg, or axis is invalid \n";
+
+static PyObject *pyefcnGetAxisBoxLimits(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char      *argNames[] = {"id", "arg", "axis", NULL};
+    int               id, arg, axis;
+    ExternalFunction *ef_ptr;
+    int               steplo[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               stephi[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               incr[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               lo, hi;
+    npy_intp          shape[1];
+    PyObject         *low_limits_ndarray, *high_limits_ndarray;
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "iii", argNames, &id, &arg, &axis) )
+        return NULL;
+
+    /* Check for obvious errors in the arguments passed */
+    ef_ptr = ef_ptr_from_id_ptr(&id);
+    if ( (ef_ptr == NULL) || ! ef_ptr->already_have_internals ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid ferret external function id");
+        return NULL;
+    }
+    if ( (arg < 0) || (arg >= EF_MAX_ARGS) ||
+         ((arg >= ef_ptr->internals_ptr->num_reqd_args) && ! ef_ptr->internals_ptr->has_vari_args) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid argument index");
+        return NULL;
+    }
+    if ( (axis < 0) || (axis >= MAX_FERRET_NDIM) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid axis index");
+        return NULL;
+    }
+
+    /* Catch seg faults from indiscriminately calling this function */
+    if ( setjmp(jumpbuffer) == 1 ) {
+        signal(SIGSEGV, segv_handler);
+        PyErr_SetString(PyExc_ValueError, "Invalid function call - probably not from a ferret external function call");
+        return NULL;
+    }
+    segv_handler = signal(SIGSEGV, pyefcn_signal_handler);
+    if ( segv_handler == SIG_ERR ) {
+        PyErr_SetString(PyExc_ValueError, "Unable to catch SIGSEGV");
+        return NULL;
+    }
+
+    /* Get the subscripts for all of the arguments */
+    ef_get_arg_subscripts_6d_(&id, steplo, stephi, incr);
+
+    /* Restore the original segv handler */
+    signal(SIGSEGV, segv_handler);
+
+    /* Check the indices for the coordinates of the desired axis of the argument */
+    if ( (steplo[arg][axis] == UNSPECIFIED_INT4) || (stephi[arg][axis] == UNSPECIFIED_INT4) ||
+         ((steplo[arg][axis] == 1) && (stephi[arg][axis] == ABSTRACT_AXIS_LEN)) ) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    /* Create two NumPy float64 ndarrays to get the memory for the box limits */
+    if ( incr[arg][axis] == 0 ) {
+        if ( steplo[arg][axis] <= stephi[arg][axis] )
+            incr[arg][axis] = 1;
+        else
+            incr[arg][axis] = -1;
+    }
+    shape[0] = (Py_ssize_t) ((stephi[arg][axis] - steplo[arg][axis] + incr[arg][axis]) / incr[arg][axis]);
+    low_limits_ndarray = PyArray_SimpleNew(1, shape, NPY_DOUBLE);
+    if ( low_limits_ndarray == NULL ) {
+        return NULL;
+    }
+    high_limits_ndarray = PyArray_SimpleNew(1, shape, NPY_DOUBLE);
+    if ( high_limits_ndarray == NULL ) {
+        Py_DECREF(low_limits_ndarray);
+        return NULL;
+    }
+
+    /* Get the full range of box limits for the requested axis */
+    lo = steplo[arg][axis];
+    hi = stephi[arg][axis];
+    arg++;
+    axis++;
+    ef_get_box_limits_(&id, &arg, &axis, &lo, &hi, (double *)PyArray_DATA(low_limits_ndarray), 
+                                                   (double *)PyArray_DATA(high_limits_ndarray));
+
+    return Py_BuildValue("NN", low_limits_ndarray, high_limits_ndarray); /* Steals the references to the two ndarrays */
+}
+
+
+static char pyefcnGetAxisInfoDocstring[] =
+    "Returns information about the axis of an argument to an external function \n"
+    "\n"
+    "Required arguments: \n"
+    "    id = <int>: the ferret id of the external function \n"
+    "    arg = <int>: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9) \n"
+    "    axis = <int>: the index (zero based) of the axis (can use X_AXIS, Y_AXIS, Z_AXIS, \n"
+    "                                                              T_AXIS, E_AXIS, F_AXIS) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    a dictionary defining the following keys: \n"
+    "        \"name\": name string for the axis coordinate \n"
+    "        \"unit\": name string for the axis unit \n"
+    "        \"backwards\": boolean - reversed axis? \n"
+    "        \"modulo\": float - length of a modulo (periodic,wrapping) axis, \n"
+    "                          or 0.0 if not a modulo axis\n"
+    "        \"regular\": boolean - evenly spaced axis? \n"
+    "        \"size\": number of coordinates on this axis, or -1 if the value \n"
+    "                  cannot be determined at the time this was called \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if id, arg, or axis is invalid \n";
+
+static PyObject *pyefcnGetAxisInfo(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char      *argNames[] = {"id", "arg", "axis", NULL};
+    int               id, arg, axis;
+    ExternalFunction *ef_ptr;
+    int               steplo[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               stephi[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               incr[EF_MAX_COMPUTE_ARGS][MAX_FERRET_NDIM];
+    int               num_coords;
+    char              name[80];
+    char              unit[80];
+    int               backwards;
+    int               modulo;
+    int               regular;
+    double            modulolen;
+    PyObject         *backwards_bool;
+    PyObject         *regular_bool;
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "iii", argNames, &id, &arg, &axis) )
+        return NULL;
+
+    /* Check for obvious errors in the arguments passed */
+    ef_ptr = ef_ptr_from_id_ptr(&id);
+    if ( (ef_ptr == NULL) || ! ef_ptr->already_have_internals ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid ferret external function id");
+        return NULL;
+    }
+    if ( (arg < 0) || (arg >= EF_MAX_ARGS) ||
+         ((arg >= ef_ptr->internals_ptr->num_reqd_args) && ! ef_ptr->internals_ptr->has_vari_args) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid argument index");
+        return NULL;
+    }
+    if ( (axis < 0) || (axis >= MAX_FERRET_NDIM) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid axis index");
+        return NULL;
+    }
+
+    /* Catch seg faults from indiscriminately calling this function */
+    if ( setjmp(jumpbuffer) == 1 ) {
+        signal(SIGSEGV, segv_handler);
+        PyErr_SetString(PyExc_ValueError, "Invalid function call - probably not from a ferret external function call");
+        return NULL;
+    }
+    segv_handler = signal(SIGSEGV, pyefcn_signal_handler);
+    if ( segv_handler == SIG_ERR ) {
+        PyErr_SetString(PyExc_ValueError, "Unable to catch SIGSEGV");
+        return NULL;
+    }
+
+    /* Get the subscripts for all of the arguments */
+    ef_get_arg_subscripts_6d_(&id, steplo, stephi, incr);
+
+    /* Restore the original segv handler */
+    signal(SIGSEGV, segv_handler);
+
+    /* Check the indices for the coordinates of the desired axis of the argument */
+    if ( (steplo[arg][axis] == UNSPECIFIED_INT4) || (stephi[arg][axis] == UNSPECIFIED_INT4) ||
+         ((steplo[arg][axis] == 1) && (stephi[arg][axis] == ABSTRACT_AXIS_LEN)) ) {
+        num_coords = -1;
+    }
+    else {
+        if ( incr[arg][axis] == 0 ) {
+            if ( steplo[arg][axis] <= stephi[arg][axis] )
+                incr[arg][axis] = 1;
+            else
+                incr[arg][axis] = -1;
+        }
+        num_coords = (stephi[arg][axis] - steplo[arg][axis] + incr[arg][axis]) / incr[arg][axis];
+    }
+
+    /* Get the rest of the info */
+    arg++;
+    axis++;
+    ef_get_single_axis_info_(&id, &arg, &axis, name, unit, &backwards, &modulo, &regular, 80, 80);
+    if ( modulo != 0 )
+        ef_get_axis_modulo_len_(&id, &arg, &axis, &modulolen);
+    else
+        modulolen = 0.0;
+
+    /* Assign the Python bool objects */
+    if ( backwards != 0 )
+        backwards_bool = Py_True;
+    else
+        backwards_bool = Py_False;
+    if ( regular != 0 )
+        regular_bool = Py_True;
+    else
+        regular_bool = Py_False;
+
+    /* Using O for the booleans to increment the references to these objects */
+    return Py_BuildValue("{sssssOsdsOsi}", "name", name, "unit", unit,
+                                           "backwards", backwards_bool, "modulo", modulolen,
+                                           "regular", regular_bool, "size", num_coords);
+}
+
+
+static char pyefcnGetArgOneValDocstring[] =
+    "Returns the value of the indicated FLOAT_ONEVAL or STRING_ONEVAL argument. \n"
+    "\n"
+    "Required arguments: \n"
+    "    id = <int>: the ferret id of the external function \n"
+    "    arg = <int>: the index (zero based) of the argument (can use ARG1, ARG2, ..., ARG9) \n"
+    "\n"
+    "Optional arguments: \n"
+    "    (none) \n"
+    "\n"
+    "Returns: \n"
+    "    the value of the argument, either as a float (if a FLOAT_ONEVAL) \n"
+    "    or a string (if STRING_ONEVAL) \n"
+    "\n"
+    "Raises: \n"
+    "    ValueError if id or arg is invalid, or if the argument type is not \n"
+    "               FLOAT_ONEVAL or STRING_ONEVAL \n";
+
+static PyObject *pyefcnGetArgOneVal(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char      *argNames[] = {"id", "arg", NULL};
+    int               id, arg;
+    ExternalFunction *ef_ptr;
+    PyObject         *modname;
+    PyObject         *usermod;
+    PyObject         *initdict;
+    PyObject         *typetuple;
+    PyObject         *typeobj;
+    double            float_val;
+    PyObject         *valobj;
+    char              str_val[2048];
+    int               k;
+
+    /* Parse the arguments, checking if an Exception was raised */
+    if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "ii", argNames, &id, &arg) )
+        return NULL;
+
+    /* Check for obvious errors in the arguments passed */
+    ef_ptr = ef_ptr_from_id_ptr(&id);
+    if ( (ef_ptr == NULL) || ! ef_ptr->already_have_internals ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid ferret external function id");
+        return NULL;
+    }
+    if ( (arg < 0) || (arg >= EF_MAX_ARGS) ||
+         ((arg >= ef_ptr->internals_ptr->num_reqd_args) && ! ef_ptr->internals_ptr->has_vari_args) ) {
+        PyErr_SetString(PyExc_ValueError, "Invalid argument index");
+        return NULL;
+    }
+
+    /* Get the Python module (should already be imported) */
+    modname = PyString_FromString(ef_ptr->path);
+    if ( modname == NULL )
+        return NULL;
+    usermod = PyImport_Import(modname);
+    Py_DECREF(modname);
+    if ( usermod == NULL )
+        return NULL;
+
+     /* Call the initialization method to get the argument types */
+    initdict = PyObject_CallMethod(usermod, INIT_METHOD_NAME, "i", id);
+    Py_DECREF(usermod);
+    if ( initdict == NULL )
+        return NULL;
+    typetuple = PyDict_GetItemString(initdict, "argtypes"); /* borrowed reference */
+    if ( typetuple == NULL ) {
+        /* Key not present; no exception raised */
+        Py_DECREF(initdict);
+        PyErr_SetString(PyExc_ValueError, "argtype is neither FLOAT_ONEVAL nor STRING_ONEVAL");
+        return NULL;
+    }
+
+    /* Get the type of this argument */
+    typeobj = PySequence_GetItem(typetuple, (Py_ssize_t) arg);
+    if ( typeobj == NULL ) {
+        PyErr_Clear();
+        Py_DECREF(initdict);
+        PyErr_SetString(PyExc_ValueError, "argtype is neither FLOAT_ONEVAL nor STRING_ONEVAL");
+        return NULL;
+    }
+    switch( (int) PyInt_AsLong(typeobj) ) {
+        case FLOAT_ONEVAL:
+            k = arg + 1;
+            ef_get_one_val_(&id, &k, &float_val);
+            valobj = PyFloat_FromDouble(float_val);
+            break;
+        case STRING_ONEVAL:
+        case STRING_ARG:
+            k = arg + 1;
+            /* Assumes gcc standard for passing Hollerith strings */
+            ef_get_arg_string_(&id, &k, str_val, 2048);
+            for (k = 2048; k > 0; k--)
+                if ( ! isspace(str_val[k-1]) )
+                    break;
+            valobj = PyString_FromStringAndSize(str_val, k);
+            break;
+        default:
+            PyErr_Clear();   /* Just to be safe */
+            PyErr_SetString(PyExc_ValueError, "argtype is neither FLOAT_ONEVAL nor STRING_ONEVAL");
+            valobj = NULL;
+    }
+    Py_DECREF(typeobj);
+    Py_DECREF(initdict);
+    return valobj;
+}
+
+
+/* List of Python functions and their docstrings available in this module */
+static struct PyMethodDef pyferretMethods[] = {
+    {"_start", (PyCFunction) pyferretStart, METH_VARARGS | METH_KEYWORDS, pyferretStartDocstring},
+    {"_run", (PyCFunction) pyferretRunCommand, METH_VARARGS | METH_KEYWORDS, pyferretRunCommandDocstring},
+    {"_get", (PyCFunction) pyferretGetData, METH_VARARGS | METH_KEYWORDS, pyferretGetDataDocstring},
+    {"_put", (PyCFunction) pyferretPutData, METH_VARARGS | METH_KEYWORDS, pyferretPutDataDocstring},
+    {"_resize", (PyCFunction) pyferretResizeMemory, METH_VARARGS | METH_KEYWORDS, pyferretResizeMemoryDocstring},
+    {"_stop", (PyCFunction) pyferretStop, METH_NOARGS, pyferretStopDocstring},
+    {"_quit", (PyCFunction) pyferretQuit, METH_NOARGS, pyferretQuitDocstring},
+    {"_get_axis_coordinates", (PyCFunction) pyefcnGetAxisCoordinates, METH_VARARGS | METH_KEYWORDS, pyefcnGetAxisCoordinatesDocstring},
+    {"_get_axis_box_sizes", (PyCFunction) pyefcnGetAxisBoxSizes, METH_VARARGS | METH_KEYWORDS, pyefcnGetAxisBoxSizesDocstring},
+    {"_get_axis_box_limits", (PyCFunction) pyefcnGetAxisBoxLimits, METH_VARARGS | METH_KEYWORDS, pyefcnGetAxisBoxLimitsDocstring},
+    {"_get_axis_info", (PyCFunction) pyefcnGetAxisInfo, METH_VARARGS | METH_KEYWORDS, pyefcnGetAxisInfoDocstring},
+    {"_get_arg_one_val", (PyCFunction) pyefcnGetArgOneVal, METH_VARARGS | METH_KEYWORDS, pyefcnGetArgOneValDocstring},
+    {NULL, (PyCFunction) NULL, 0, NULL}
+};
+
+static char pyferretModuleDocstring[] =
+"An extension module enabling the use of Ferret from Python \n";
+
+/* For the libpyferret module, this function must be named initlibpyferret */
+PyMODINIT_FUNC initlibpyferret(void)
+{
+    char names[64][32];
+    int  values[64];
+    int  numvals;
+    int  k;
+
+    /* Create the module with the indicated methods */
+    PyObject *mod = Py_InitModule3("libpyferret", pyferretMethods, pyferretModuleDocstring);
+
+    /* Add ferret parameter values */
+    get_ferret_params_(names, values, &numvals);
+    for (k = 0; k < numvals; k++) {
+        PyModule_AddIntConstant(mod, names[k], values[k]);
+    }
+
+    /* Add parameters for the python EF argument types */
+    PyModule_AddIntConstant(mod, "FLOAT_ARRAY", FLOAT_ARRAY);
+    PyModule_AddIntConstant(mod, "FLOAT_ONEVAL", FLOAT_ONEVAL);
+    PyModule_AddIntConstant(mod, "STRING_ARRAY", STRING_ARRAY);
+    PyModule_AddIntConstant(mod, "STRING_ONEVAL", STRING_ONEVAL);
+
+    /* Add parameters for the python axis functions */
+    PyModule_AddIntConstant(mod, "X_AXIS", 0);
+    PyModule_AddIntConstant(mod, "Y_AXIS", 1);
+    PyModule_AddIntConstant(mod, "Z_AXIS", 2);
+    PyModule_AddIntConstant(mod, "T_AXIS", 3);
+    PyModule_AddIntConstant(mod, "E_AXIS", 4);
+    PyModule_AddIntConstant(mod, "F_AXIS", 5);
+    PyModule_AddIntConstant(mod, "ARG1", 0);
+    PyModule_AddIntConstant(mod, "ARG2", 1);
+    PyModule_AddIntConstant(mod, "ARG3", 2);
+    PyModule_AddIntConstant(mod, "ARG4", 3);
+    PyModule_AddIntConstant(mod, "ARG5", 4);
+    PyModule_AddIntConstant(mod, "ARG6", 5);
+    PyModule_AddIntConstant(mod, "ARG7", 6);
+    PyModule_AddIntConstant(mod, "ARG8", 7);
+    PyModule_AddIntConstant(mod, "ARG9", 8);
+
+    /* Parameters for interpreting axis data */
+    PyModule_AddIntConstant(mod, "AXISTYPE_LONGITUDE",    AXISTYPE_LONGITUDE);
+    PyModule_AddIntConstant(mod, "AXISTYPE_LATITUDE",     AXISTYPE_LATITUDE);
+    PyModule_AddIntConstant(mod, "AXISTYPE_LEVEL",        AXISTYPE_LEVEL);
+    PyModule_AddIntConstant(mod, "AXISTYPE_TIME",         AXISTYPE_TIME);
+    PyModule_AddIntConstant(mod, "AXISTYPE_CUSTOM",       AXISTYPE_CUSTOM);
+    PyModule_AddIntConstant(mod, "AXISTYPE_ABSTRACT",     AXISTYPE_ABSTRACT);
+    PyModule_AddIntConstant(mod, "AXISTYPE_NORMAL",       AXISTYPE_NORMAL);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_DAYINDEX",    TIMEARRAY_DAYINDEX);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_MONTHINDEX",  TIMEARRAY_MONTHINDEX);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_YEARINDEX",   TIMEARRAY_YEARINDEX);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_HOURINDEX",   TIMEARRAY_HOURINDEX);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_MINUTEINDEX", TIMEARRAY_MINUTEINDEX);
+    PyModule_AddIntConstant(mod, "TIMEARRAY_SECONDINDEX", TIMEARRAY_SECONDINDEX);
+
+    /* Parameter giving the maximum number of axis allowed in Ferret */
+    PyModule_AddIntConstant(mod, "MAX_FERRET_NDIM", MAX_FERRET_NDIM);
+
+    /* Private parameter return value from libpyferret._run indicating the program should shut down */
+    PyModule_AddIntConstant(mod, "_FERR_EXIT_PROGRAM", FERR_EXIT_PROGRAM);
+}
+
diff --git a/pyfermod/pyefcn_compute.c b/pyfermod/pyefcn_compute.c
new file mode 100644
index 0000000..877818b
--- /dev/null
+++ b/pyfermod/pyefcn_compute.c
@@ -0,0 +1,446 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include "pyferret.h"
+#include "EF_Util.h"
+
+/*
+ * See pyferret.h for information on this function
+ */
+void pyefcn_compute(int id, char modname[], double *data[], int numarrays,
+                    int memlo[][MAX_FERRET_NDIM], int memhi[][MAX_FERRET_NDIM],
+                    int steplo[][MAX_FERRET_NDIM], int stephi[][MAX_FERRET_NDIM],
+                    int incr[][MAX_FERRET_NDIM], double badvals[], char errmsg[])
+{
+    PyObject *nameobj;
+    PyObject *usermod;
+    PyObject *initdict;
+    PyObject *typetuple;
+    PyObject *typeobj;
+    int       j, k;
+    int       datatypes[EF_MAX_COMPUTE_ARGS+1];
+    int       resstrlen;
+    npy_intp  shape[MAX_FERRET_NDIM];
+    npy_intp  strides[MAX_FERRET_NDIM];
+    int       itemsize;
+    int       flags;
+    double   *dataptr;
+    int       maxlength;
+    int       length;
+    double   *dptr;
+    npy_intp  d0, d1, d2, d3, d4, d5;
+    npy_intp  indices[MAX_FERRET_NDIM];
+    PyObject *ndarrays[EF_MAX_COMPUTE_ARGS];
+    PyObject *inpbadvals_ndarray;
+    PyObject *resbadval_ndarray;
+    PyObject *idobj;
+    PyObject *inpobj;
+    PyObject *result;
+    char     *strptr;
+
+    /* Sanity check */
+    if ( (numarrays < 2) || (numarrays > EF_MAX_COMPUTE_ARGS) ) {
+        sprintf(errmsg, "Unexpected number of arrays (%d) passed to pyefcn_compute", numarrays);
+        return;
+    }
+
+    /* Import the user's Python module */
+    nameobj = PyString_FromString(modname);
+    if ( nameobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Problems creating a Python string from the module name: %s", modname);
+        return;
+    }
+    usermod = PyImport_Import(nameobj);
+    Py_DECREF(nameobj);
+    if ( usermod == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Unable to import module: %s", modname);
+        return;
+    }
+
+    /* Call the initialization method to find out the data types */
+    initdict = PyObject_CallMethod(usermod, INIT_METHOD_NAME, "i", id);
+    if ( initdict == NULL ) {
+        Py_DECREF(usermod);
+        sprintf(errmsg, "Error when calling %s in %s: %s", INIT_METHOD_NAME, modname, pyefcn_get_error());
+        return;
+    }
+    /* Get the result type - default FLOAT_ARRAY */
+    typeobj = PyDict_GetItemString(initdict, "restype"); /* borrowed reference */
+    if ( typeobj != NULL )
+        datatypes[0] = (int) PyInt_AsLong(typeobj);
+    else
+        datatypes[0] = FLOAT_ARRAY;
+    /* Get the (maximum) length of strings in a string result array - default 128 */
+    typeobj = PyDict_GetItemString(initdict, "resstrlen"); /* borrowed reference */
+    if ( typeobj != NULL )
+        resstrlen = (int) PyInt_AsLong(typeobj);
+    else
+        resstrlen = 128;
+    /* Find out the argument types */
+    typetuple = PyDict_GetItemString(initdict, "argtypes"); /* borrowed reference */
+    /* If typetuple is NULL, the key is not present but no error was raised */
+    j = 1;
+    if ( typetuple != NULL ) {
+        for ( ; j < numarrays; j++) {
+            /* Get the type of this argument */
+            typeobj = PySequence_GetItem(typetuple, (Py_ssize_t) (j-1));
+            if ( typeobj == NULL ) {
+                PyErr_Clear();
+                break;
+            }
+            datatypes[j] = (int) PyInt_AsLong(typeobj);
+            Py_DECREF(typeobj);
+        }
+    }
+    /* Assign the default FLOAT_ARRAY for any unspecified types */
+    for ( ; j < numarrays; j++)
+        datatypes[j] = FLOAT_ARRAY;
+    Py_DECREF(initdict);
+
+    /* Create the Python objects for the inputs and result. */
+    for (j = 0; j < numarrays; j++) {
+        switch( datatypes[j] ) {
+            case FLOAT_ARRAY:
+            case FLOAT_ARG:
+                /* Get the dimensions of the array */
+                for (k = 0; k < MAX_FERRET_NDIM; k++)
+                    shape[k] = (npy_intp) ((stephi[j][k] - steplo[j][k] + incr[j][k]) / (incr[j][k]));
+                /* Get the strides through the passed memory as a (double *) */
+                strides[0] = 1;
+                for (k = 0; k < MAX_FERRET_NDIM - 1; k++)
+                    strides[k+1] = strides[k] * (npy_intp) (memhi[j][k] - memlo[j][k] + 1);
+                /* Get the actual starting point in the array */
+                dataptr = data[j];
+                for (k = 0; k < MAX_FERRET_NDIM; k++)
+                    dataptr += strides[k] * (npy_intp) (steplo[j][k] - memlo[j][k]);
+                /* Convert to strides through places in memory to be assigned, and as a (byte *) */
+                itemsize = sizeof(double);
+                for (k = 0; k < MAX_FERRET_NDIM; k++)
+                    strides[k] *= (npy_intp) (incr[j][k] * itemsize);
+                /* Get the flags for the array - only results can be written to; others are read-only */
+                for (k = 0; k < MAX_FERRET_NDIM; k++)
+                    if ( (incr[j][k] != 1) || (steplo[j][k] != memlo[j][k]) )
+                        break;
+                if ( k < MAX_FERRET_NDIM )
+                    flags = NPY_ALIGNED | NPY_NOTSWAPPED;
+                else
+                    flags = NPY_F_CONTIGUOUS | NPY_ALIGNED | NPY_NOTSWAPPED;
+                if ( j == 0 )
+                    flags = flags | NPY_WRITEABLE;
+                /* Create a PyArray object around the array */
+                ndarrays[j] = PyArray_New(&PyArray_Type, MAX_FERRET_NDIM, shape, NPY_DOUBLE,
+                                          strides, dataptr, itemsize, flags, NULL);
+                if ( ndarrays[j] == NULL ) {
+                    /* Problem - release references to the previous PyArray objects, assign errmsg, and return */
+                    PyErr_Clear();
+                    sprintf(errmsg, "Unable to create ndarray[%d]", j);
+                    while ( j > 0 ) {
+                        j--;
+                        Py_DECREF(ndarrays[j]);
+                    }
+                    Py_DECREF(usermod);
+                    return;
+                }
+                break;
+            case FLOAT_ONEVAL:
+                assert( j > 0 );
+                /* Simple double argument; just create a PyFloat for this argument */
+                ndarrays[j] = PyFloat_FromDouble(data[j][0]);
+                if ( ndarrays[j] == NULL ) {
+                    /* Problems - Release references to the previous PyArray objects, assign errmsg, and return. */
+                    PyErr_Clear();
+                    sprintf(errmsg, "Problems creating a Python float from input argument %d", j);
+                    while ( j > 0 ) {
+                        j--;
+                        Py_DECREF(ndarrays[j]);
+                    }
+                    Py_DECREF(usermod);
+                    return;
+                }
+                break;
+            case STRING_ARRAY:
+                /* Get the dimensions of the array */
+                for (k = 0; k < MAX_FERRET_NDIM; k++)
+                    shape[k] = (npy_intp) ((stephi[j][k] - steplo[j][k] + incr[j][k]) / (incr[j][k]));
+                /* Get the strides through the passed memory as a (double *) */
+                strides[0] = 1;
+                for (k = 0; k < MAX_FERRET_NDIM - 1; k++)
+                    strides[k+1] = strides[k] * (npy_intp) (memhi[j][k] - memlo[j][k] + 1);
+                if ( j == 0 ) {
+                    /* result argument - create PyArray of string to hold results to be assigned */
+                    itemsize = resstrlen * sizeof(char);
+                    ndarrays[j] = PyArray_New(&PyArray_Type, MAX_FERRET_NDIM, shape, NPY_STRING,
+                                              NULL, NULL, itemsize, NPY_FARRAY, NULL);
+                    if ( ndarrays[j] == NULL ) {
+                        /* Problem - release references to the previous PyArray objects, assign errmsg, and return */
+                        PyErr_Clear();
+                        sprintf(errmsg, "Unable to create ndarray[%d]", j);
+                        /* First array creation attempt  - no other ndarray element */
+                        Py_DECREF(usermod);
+                        return;
+                    }
+                }
+                else {
+                    /* Get the actual starting point in the array */
+                    dataptr = data[j];
+                    for (k = 0; k < MAX_FERRET_NDIM; k++)
+                        dataptr += strides[k] * (npy_intp) (steplo[j][k] - memlo[j][k]);
+                    /* Input argument - get the length of the longest string */
+                    /* This needs to be modified if MAX_FERRET_NDIM changes */
+                    maxlength = 0;
+                    for (d5 = 0; d5 < shape[5] * strides[5]; d5 += strides[5]) {
+                      for (d4 = 0; d4 < shape[4] * strides[4]; d4 += strides[4]) {
+                        for (d3 = 0; d3 < shape[3] * strides[3]; d3 += strides[3]) {
+                          for (d2 = 0; d2 < shape[2] * strides[2]; d2 += strides[2]) {
+                            for (d1 = 0; d1 < shape[1] * strides[1]; d1 += strides[1]) {
+                              for (d0 = 0; d0 < shape[0] * strides[0]; d0 += strides[0]) {
+                                /*
+                                 * The data array values are pointers to strings,
+                                 * but is cast as an array of doubles
+                                 */
+                                dptr = dataptr + d0 + d1 + d2 + d3 + d4 + d5;
+                                length = strlen(*((char **) dptr));
+                                if ( maxlength < length )
+                                    maxlength = length;
+                              }
+                            }
+                          }
+                        }
+                      }
+                    }
+                    /* Convert to the next larger multiple of 8 */
+                    maxlength  = (maxlength + 8) / 8;
+                    maxlength *= 8;
+                    /* Create a PyArray object of strings to hold a copy of the data */
+                    itemsize = maxlength * sizeof(char);
+                    ndarrays[j] = PyArray_New(&PyArray_Type, MAX_FERRET_NDIM, shape, NPY_STRING,
+                                              NULL, NULL, itemsize, NPY_FARRAY_RO, NULL);
+                    if ( ndarrays[j] == NULL ) {
+                        /* Problem - release references to the previous PyArray objects, assign errmsg, and return */
+                        PyErr_Clear();
+                        sprintf(errmsg, "Unable to create ndarray[%d]", j);
+                        while ( j > 0 ) {
+                            j--;
+                            Py_DECREF(ndarrays[j]);
+                        }
+                        Py_DECREF(usermod);
+                        return;
+                    }
+                    /* Assign all the strings in the array */
+                    /* This needs to be modified if MAX_FERRET_NDIM changes */
+                    indices[5] = 0;
+                    for (d5 = 0; d5 < shape[5] * strides[5]; d5 += strides[5]) {
+                      indices[4] = 0;
+                      for (d4 = 0; d4 < shape[4] * strides[4]; d4 += strides[4]) {
+                        indices[3] = 0;
+                        for (d3 = 0; d3 < shape[3] * strides[3]; d3 += strides[3]) {
+                          indices[2] = 0;
+                          for (d2 = 0; d2 < shape[2] * strides[2]; d2 += strides[2]) {
+                            indices[1] = 0;
+                            for (d1 = 0; d1 < shape[1] * strides[1]; d1 += strides[1]) {
+                              indices[0] = 0;
+                              for (d0 = 0; d0 < shape[0] * strides[0]; d0 += strides[0]) {
+                                dptr = dataptr + d0 + d1 + d2 + d3 + d4 + d5;
+                                strcpy((char *) PyArray_GetPtr((PyArrayObject *) (ndarrays[j]), indices), 
+                                                               *((char **) dptr));
+                                (indices[0])++;
+                              }
+                              (indices[1])++;
+                            }
+                            (indices[2])++;
+                          }
+                          (indices[3])++;
+                        }
+                        (indices[4])++;
+                      }
+                      (indices[5])++;
+                    }
+
+                }
+                break;
+            case STRING_ONEVAL:
+            case STRING_ARG:
+                assert( j > 0 );
+                /* String argument; just create a PyString for this argument */
+                ndarrays[j] = PyString_FromString(*((char **) (data[j])));
+                if ( ndarrays[j] == NULL ) {
+                    /* Problems - Release references to the previous PyArray objects, assign errmsg, and return. */
+                    PyErr_Clear();
+                    sprintf(errmsg, "Problems creating a Python string from input argument %d", j);
+                    while ( j > 0 ) {
+                        j--;
+                        Py_DECREF(ndarrays[j]);
+                    }
+                    Py_DECREF(usermod);
+                    return;
+                }
+                break;
+            default:
+                /* Unknown type - Release references to the previous PyArray objects, assign errmsg, and return. */
+                PyErr_Clear();
+                sprintf(errmsg, "Unexpected error: unknown datatypes[%d] of %d", j, datatypes[j]);
+                while ( j > 0 ) {
+                    j--;
+                    Py_DECREF(ndarrays[j]);
+                }
+                Py_DECREF(usermod);
+                return;
+        }
+    }
+
+    /* Create a tuple with all the input arrays */
+    inpobj = PyTuple_New((Py_ssize_t) (numarrays-1));
+    for (j = 1; j < numarrays; j++) {
+        PyTuple_SET_ITEM(inpobj, (Py_ssize_t)(j-1), ndarrays[j]); /* Steals a reference to ndarrays[j] */
+    }
+
+    /* Create PyArray objects around the input bad values array and the result bad value */
+    shape[0] = numarrays - 1;
+    strides[0] = sizeof(double);
+    itemsize = sizeof(double);
+    flags = NPY_FARRAY_RO;
+    inpbadvals_ndarray = PyArray_New(&PyArray_Type, 1, shape, NPY_DOUBLE,
+                                     strides, &(badvals[1]), itemsize, flags, NULL);
+    if ( inpbadvals_ndarray == NULL ) {
+        /* Problem - release references to the previous PyArray objects, assign errmsg, and return */
+        PyErr_Clear();
+        Py_DECREF(inpobj);
+        Py_DECREF(ndarrays[0]);
+        Py_DECREF(usermod);
+        strcpy(errmsg, "Unable to create input badvals ndarray");
+        return;
+    }
+    shape[0] = 1;
+    resbadval_ndarray = PyArray_New(&PyArray_Type, 1, shape, NPY_DOUBLE,
+                                    strides, badvals, itemsize, flags, NULL);
+    if ( resbadval_ndarray == NULL ) {
+        /* Problem - release references to the previous PyArray objects, assign errmsg, and return */
+        PyErr_Clear();
+        Py_DECREF(inpbadvals_ndarray);
+        Py_DECREF(inpobj);
+        Py_DECREF(ndarrays[0]);
+        Py_DECREF(usermod);
+        strcpy(errmsg, "Unable to create result badvals ndarray");
+        return;
+    }
+
+    /* ferret ID argument */
+    idobj = PyInt_FromLong((long)id);
+
+    /* Call the ferret_compute function in the module */
+    nameobj = PyString_FromString(COMPUTE_METHOD_NAME);
+    result = PyObject_CallMethodObjArgs(usermod, nameobj, idobj, ndarrays[0], resbadval_ndarray,
+                                                                 inpobj, inpbadvals_ndarray, NULL);
+
+    /* Release all the PyObjects no longer needed */
+    Py_XDECREF(result);
+    Py_DECREF(nameobj);
+    Py_DECREF(idobj);
+    Py_DECREF(resbadval_ndarray);
+    Py_DECREF(inpbadvals_ndarray);
+    Py_DECREF(inpobj);
+    Py_DECREF(usermod);
+
+    /* If the ferret_compute call was unsuccessful (raised an exception), assign errmsg from its message */
+    if ( result == NULL ) {
+        sprintf(errmsg, "Error when calling %s in %s: %s", COMPUTE_METHOD_NAME, modname, pyefcn_get_error());
+        Py_DECREF(ndarrays[0]);
+        return;
+    }
+
+    /*
+     * If the return type is an array of strings, assign
+     * the Ferret array with copies of the NumPy strings
+     */
+    if ( datatypes[0] == STRING_ARRAY ) {
+        /* Get the dimensions of the array */
+        for (k = 0; k < MAX_FERRET_NDIM; k++)
+            shape[k] = (npy_intp) ((stephi[0][k] - steplo[0][k] + incr[0][k]) / (incr[0][k]));
+        /* Get the strides through the passed memory as a (double *) */
+        strides[0] = 1;
+        for (k = 0; k <= MAX_FERRET_NDIM - 1; k++)
+            strides[k+1] = strides[k] * (npy_intp) (memhi[0][k] - memlo[0][k] + 1);
+        /* Get the actual starting point in the array */
+        dataptr = data[0];
+        for (k = 0; k < MAX_FERRET_NDIM; k++)
+            dataptr += strides[k] * (npy_intp) (steplo[0][k] - memlo[0][k]);
+        /* Assign all the strings in the array */
+        /* This needs to be modified if MAX_FERRET_NDIM changes */
+        indices[5] = 0;
+        for (d5 = 0; d5 < shape[5] * strides[5]; d5 += strides[5]) {
+          indices[4] = 0;
+          for (d4 = 0; d4 < shape[4] * strides[4]; d4 += strides[4]) {
+            indices[3] = 0;
+            for (d3 = 0; d3 < shape[3] * strides[3]; d3 += strides[3]) {
+              indices[2] = 0;
+              for (d2 = 0; d2 < shape[2] * strides[2]; d2 += strides[2]) {
+                indices[1] = 0;
+                for (d1 = 0; d1 < shape[1] * strides[1]; d1 += strides[1]) {
+                  indices[0] = 0;
+                  for (d0 = 0; d0 < shape[0] * strides[0]; d0 += strides[0]) {
+                    strptr = (char *) PyArray_GetPtr((PyArrayObject *) (ndarrays[0]), indices);
+                    for (j = 0; j < resstrlen; j++)
+                        if ( strptr[j] == '\0' )
+                            break;
+                    dptr = dataptr + d0 + d1 + d2 + d3 + d4 + d5;
+                    ef_put_string_(strptr, &j, (char **) dptr);
+                    (indices[0])++;
+                  }
+                  (indices[1])++;
+                }
+                (indices[2])++;
+              }
+              (indices[3])++;
+            }
+            (indices[4])++;
+          }
+          (indices[5])++;
+        }
+
+    }
+    Py_DECREF(ndarrays[0]);
+
+    errmsg[0] = '\0';
+    return;
+}
+
diff --git a/pyfermod/pyefcn_custom_axes.c b/pyfermod/pyefcn_custom_axes.c
new file mode 100644
index 0000000..09b033a
--- /dev/null
+++ b/pyfermod/pyefcn_custom_axes.c
@@ -0,0 +1,200 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+#include "pyferret.h"
+#include "EF_Util.h"
+
+static const char *AXIS_NAMES[MAX_FERRET_NDIM] = { "X", "Y", "Z", "T", "E", "F" };
+
+/*
+ * See pyferret.h for information on this function
+ */
+void pyefcn_custom_axes(int id, char modname[], char errmsg[])
+{
+    PyObject  *valobj;
+    PyObject  *usermod;
+    PyObject  *seqobj;
+    int        seqlen;
+    int        k, q;
+    int        call_made;
+    PyObject  *subseqobj;
+    int        subseqlen;
+    PyObject  *itemobj;
+    double     values[3];
+    char      *strptr;
+    char       unit_name[EF_MAX_NAME_LENGTH];
+    int        is_modulo;
+
+    /*
+     * Import the user's Python module
+     */
+    valobj = PyString_FromString(modname);
+    if ( valobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Problems creating a Python string from the module name: %s", modname);
+        return;
+    }
+    usermod = PyImport_Import(valobj);
+    /* valobj no longer needed */
+    Py_DECREF(valobj);
+    /* check for errors */
+    if ( usermod == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Unable to import module: %s", modname);
+        return;
+    }
+
+    /*
+     * Call the ferret_custom_axes method in the user's python module with the ferret function ID as the sole argument
+     */
+    valobj = PyObject_CallMethod(usermod, CUSTOM_AXES_METHOD_NAME, "i", id);
+    /* usermod no longer needed */
+    Py_DECREF(usermod);
+    /* check for errors */
+    if ( valobj == NULL ) {
+        sprintf(errmsg, "Error when calling %s in %s: %s", CUSTOM_AXES_METHOD_NAME, modname, pyefcn_get_error());
+        return;
+    }
+
+    /*
+     * Process the contents of the tuple returned, which cannot be None, since one of the axes needs to be assigned
+     */
+    seqobj = PySequence_Fast(valobj, "custom axes tuple");
+    /* valobj no longer needed - PySequence_Fast has either incremented the reference count or made a copy as a tuple */
+    Py_DECREF(valobj);
+    if ( seqobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Invalid return value (not a tuple or list) from %s in %s", CUSTOM_AXES_METHOD_NAME, modname);
+        return;
+    }
+    seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+    if ( seqlen > MAX_FERRET_NDIM ) {
+        Py_DECREF(seqobj);
+        sprintf(errmsg, "Invalid return value (tuple or list with more than %d items) from %s in %s", 
+                        MAX_FERRET_NDIM, CUSTOM_AXES_METHOD_NAME, modname);
+        return;
+    }
+
+    /* Process each item in the tuple returned */
+    call_made = 0;
+    for (k = 0; k < seqlen; k++) {
+        valobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) k); /* borrowed reference */
+        /* None is acceptable here */
+        if ( valobj != Py_None ) {
+            subseqobj = PySequence_Fast(valobj, "custom axes item");
+            if ( subseqobj == NULL ) {
+                PyErr_Clear();
+                Py_DECREF(seqobj);
+                sprintf(errmsg, "Invalid custom axes value (not None, a tuple, or a list) for the %s axis", AXIS_NAMES[k]);
+                return;
+            }
+            subseqlen = (int) PySequence_Fast_GET_SIZE(subseqobj);
+            /* If given, it must have at least three items */
+            if ( subseqlen < 3 ) {
+                Py_DECREF(subseqobj);
+                Py_DECREF(seqobj);
+                sprintf(errmsg, "Invalid custom axes value (not a tuple of at least three values) for the %s axis", AXIS_NAMES[k]);
+                return;
+            }
+            /* Get the low, high, delta floating point values */
+            for (q = 0; q < 3; q++) {
+                itemobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) q); /* borrowed reference */
+                values[q] = PyFloat_AsDouble(itemobj);
+                if ( PyErr_Occurred() ) {
+                    PyErr_Clear();
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    if ( q == 0 )
+                        sprintf(errmsg, "Invalid custom axes low value (not a float) for the %s axis", AXIS_NAMES[k]);
+                    else if ( q == 1 )
+                        sprintf(errmsg, "Invalid custom axes high value (not a float) for the %s axis", AXIS_NAMES[k]);
+                    else
+                        sprintf(errmsg, "Invalid custom axes delta value (not a float) for the %s axis", AXIS_NAMES[k]);
+                    return;
+                }
+            }
+            /* Get the unit name, if given */
+            strcpy(unit_name, " ");
+            if ( subseqlen > 3 ) {
+                itemobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) 3); /* borrowed reference */
+                strptr = PyString_AsString(itemobj);
+                if ( strptr == NULL ) {
+                    PyErr_Clear();
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    sprintf(errmsg, "Invalid custom axes unit_name value (not a string) for the %s axis", AXIS_NAMES[k]);
+                    return;
+                }
+                if ( strptr[0] != '\0' ) {
+                    strncpy(unit_name, strptr, EF_MAX_NAME_LENGTH);
+                    unit_name[EF_MAX_NAME_LENGTH-1] = '\0';
+                }
+            }
+            /* get the is_modulo value, if given */
+            is_modulo = 0;
+            if ( subseqlen > 4 ) {
+                itemobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) 4); /* borrowed reference */
+                /* must being either the Py_False singleton or the Py_True singleton */
+                if ( itemobj == Py_True ) {
+                    is_modulo = 1;
+                }
+                else if ( itemobj != Py_False ) {
+                    PyErr_Clear();
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    sprintf(errmsg, "Invalid custom axes is_modulo value (not True or False) for the %s axis", AXIS_NAMES[k]);
+                    return;
+                }
+            }
+            /* Make the assignment for this axis */
+            Py_DECREF(subseqobj);
+            q = k+1;
+            ef_set_custom_axis_sub_(&id, &q, &(values[0]), &(values[1]), &(values[2]), unit_name, &is_modulo);
+            call_made = 1;
+        }
+    }
+    Py_DECREF(seqobj);
+
+    /* Make sure ef_set_custom_axis_sub_ was called at least once */
+    if ( ! call_made )
+        sprintf(errmsg, "No custom axis value were given in the tuple returned from %s in %s", CUSTOM_AXES_METHOD_NAME, modname);
+    else
+        errmsg[0] = '\0';
+    return;
+}
+
diff --git a/pyfermod/pyefcn_get_error.c b/pyfermod/pyefcn_get_error.c
new file mode 100644
index 0000000..ae577c5
--- /dev/null
+++ b/pyfermod/pyefcn_get_error.c
@@ -0,0 +1,81 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#include "pyferret.h"
+
+/*
+ * See pyferret.h for information on this function
+ */
+char *pyefcn_get_error()
+{
+    /* returned error string thus must be static */
+    static char errmsg[512];
+
+    PyObject *exc_type;
+    PyObject *exc_value;
+    PyObject *exc_traceback;
+    PyObject *exc_string;
+
+    /* Initialize errmsg to no message */
+    errmsg[0] = '\0';
+
+    /* Check for an exception */
+    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
+    if ( exc_type != NULL ) {
+        /* Exception found and cleared - first normalize exc_value */
+        PyErr_NormalizeException(&exc_type, &exc_value, &exc_traceback);
+        /* Now exc_value is guaranteed to be an Exception object of class (or subclass of) exc_type */
+        if ( exc_value != NULL ) {
+            /* Get the string by calling Python str method with the exception */
+            exc_string = PyObject_Str(exc_value);
+            if ( exc_string != NULL ) {
+                strcpy(errmsg, PyString_AsString(exc_string));
+                Py_DECREF(exc_string);
+            }
+        }
+        /* Since there was an exception, make sure errmsg is not empty */
+        if ( errmsg[0] == '\0' ) {
+            strcpy(errmsg, "Exception raised with no message");
+        }
+    }
+
+    /* Decrement references to non-NULL objects */
+    Py_XDECREF(exc_type);
+    Py_XDECREF(exc_value);
+    Py_XDECREF(exc_traceback);
+
+    return errmsg;
+}
+
diff --git a/pyfermod/pyefcn_init.c b/pyfermod/pyefcn_init.c
new file mode 100644
index 0000000..61696ca
--- /dev/null
+++ b/pyfermod/pyefcn_init.c
@@ -0,0 +1,705 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+#include "pyferret.h"
+#include "EF_Util.h"
+
+static const char *AXIS_NAMES[MAX_FERRET_NDIM] = { "X", "Y", "Z", "T", "E", "F" };
+
+/*
+ * See pyferret.h for information on this function
+ */
+void pyefcn_init(int id, char modname[], char errmsg[])
+{
+    PyObject  *valobj;
+    PyObject  *usermod;
+    PyObject  *initdict;
+    int        num_args;
+    int        restype;
+    int        resstrlen;
+    char      *strptr;
+    char       descript[EF_MAX_DESCRIPTION_LENGTH];
+    PyObject  *seqobj;
+    int        seqlen;
+    int        j, k, q;
+    int        axisvals[MAX_FERRET_NDIM];
+    int        axisredu[MAX_FERRET_NDIM];
+    int        rsltaxes[MAX_FERRET_NDIM];
+    PyObject  *itemobj;
+    char       name[EF_MAX_NAME_LENGTH];
+    int        argtype;
+    PyObject  *subseqobj;
+    int        subseqlen;
+    PyObject  *subsubseqobj;
+    int        subsubseqlen;
+    int        deltas[2];
+    int        val;
+    PyObject  *keysobj;
+
+    /*
+     * Import the user's Python module
+     */
+    valobj = PyString_FromString(modname);
+    if ( valobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Problems creating a Python string from the module name: %s", modname);
+        return;
+    }
+    usermod = PyImport_Import(valobj);
+    /* valobj no longer needed */
+    Py_DECREF(valobj);
+    /* check for errors */
+    if ( usermod == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Unable to import module: %s", modname);
+        return;
+    }
+
+    /*
+     * Call the initialization method in the user's python module
+     * with the ferret function ID as the sole argument
+     */
+    initdict = PyObject_CallMethod(usermod, INIT_METHOD_NAME, "i", id);
+    /* usermod no longer needed */
+    Py_DECREF(usermod);
+    /* check for errors */
+    if ( initdict == NULL ) {
+        sprintf(errmsg, "Error when calling %s in %s: %s", INIT_METHOD_NAME, modname, pyefcn_get_error());
+        return;
+    }
+
+    /*
+     * Process the contents of the dictionary returned
+     */
+    if ( ! PyDict_Check(initdict) ) {
+        Py_DECREF(initdict);
+        sprintf(errmsg, "Invalid return value (not a dictionary) from %s in %s",
+                        INIT_METHOD_NAME, modname);
+        return;
+    }
+
+    /*
+     * "numargs": number of input arguments [1 - 9, required]
+     */
+    valobj = PyDict_GetItemString(initdict, "numargs"); /* borrowed reference */
+    if ( valobj == NULL ) {
+        Py_DECREF(initdict);
+        sprintf(errmsg, "\"numargs\" not defined in the dictionary returned from %s in %s",
+                        INIT_METHOD_NAME, modname);
+        return;
+    }
+    num_args = (int) PyInt_AsLong(valobj);
+    if ( (num_args < 1) || (num_args > EF_MAX_ARGS) ) {
+        PyErr_Clear();
+        Py_DECREF(initdict);
+        strcpy(errmsg, "Invalid \"numargs\" value (not an integer [0-9])");
+        return;
+    }
+    ef_set_num_args_(&id, &num_args);
+
+    /*
+     * "descript": string description of the function [required]
+     */
+    valobj = PyDict_GetItemString(initdict, "descript"); /* borrowed reference */
+    if ( valobj == NULL ) {
+        Py_DECREF(initdict);
+        sprintf(errmsg, "\"descript\" not defined in the dictionary returned from %s in %s",
+                        INIT_METHOD_NAME, modname);
+        return;
+    }
+    strptr = PyString_AsString(valobj);
+    if ( strptr == NULL ) {
+        PyErr_Clear();
+        Py_DECREF(initdict);
+        strcpy(errmsg, "Invalid \"descript\" value (not a string)");
+        return;
+    }
+    strncpy(descript, strptr, EF_MAX_DESCRIPTION_LENGTH);
+    descript[EF_MAX_DESCRIPTION_LENGTH - 1] = '\0';
+    ef_set_desc_sub_(&id, descript);
+
+    /*
+     * "restype": type of the result argument [optional, default: FLOAT_ARRAY]
+     */
+    valobj = PyDict_GetItemString(initdict, "restype"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        restype = (int) PyInt_AsLong(valobj);
+        if ( restype == FLOAT_ARRAY ) {
+            restype = FLOAT_RETURN;
+        }
+        else if ( restype == STRING_ARRAY ) {
+            restype = STRING_RETURN;
+        }
+        else {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"restype\" value (not FLOAT_ARRAY nor STRING_ARRAY)");
+            return;
+        }
+    }
+    else {
+        /* Key not present but no error raised */
+        restype = FLOAT_RETURN;
+    }
+    ef_set_result_type_(&id, &restype);
+
+    /*
+     * "resstrlen": (maximum) length of strings in the result string array [optional]
+     * Not used here; just check the value if given.  Default assigned by pyefcn_compute
+     */
+    valobj = PyDict_GetItemString(initdict, "resstrlen"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        resstrlen = (int) PyInt_AsLong(valobj);
+        if ( resstrlen < 1 ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"resstrlen\" value (not a positive integer)");
+            return;
+        }
+    }
+
+    /*
+     * "axes": 6-tuple (X,Y,Z,T,E,F) of result grid axis defining values:
+     *             AXIS_ABSTRACT: indexed, ferret_result_limits called to define the axis,
+     *             AXIS_CUSTOM: ferret_custom_axis called to define the axis,
+     *             AXIS_DOES_NOT_EXIST: does not exist in (normal to) the results grid,
+     *             AXIS_IMPLIED_BY_ARGS: same as the corresponding axis in one or more arguments,
+     *             AXIS_REDUCED: reduced to a single point
+     *         [optional, default: AXIS_IMPLIED_BY_ARGS for each value]
+     */
+    valobj = PyDict_GetItemString(initdict, "axes"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "axes value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"axes\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > MAX_FERRET_NDIM ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            sprintf(errmsg, "Invalid \"axes\" value (tuple or list with more than %d items)",
+                             MAX_FERRET_NDIM);
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        axisvals[k] = IMPLIED_BY_ARGS;
+        axisredu[k] = RETAINED;
+        rsltaxes[k] = IMPLIED_BY_ARGS;
+        if ( k < seqlen ) {
+            itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) k); /* borrowed reference */
+            switch( (int) PyInt_AsLong(itemobj) ) {
+                case IMPLIED_BY_ARGS:
+                    break;
+                case ABSTRACT:
+                    axisvals[k] = ABSTRACT;
+                    rsltaxes[k] = ABSTRACT;
+                    break;
+                case CUSTOM:
+                    axisvals[k] = CUSTOM;
+                    rsltaxes[k] = CUSTOM;
+                    break;
+                case NORMAL:
+                    axisvals[k] = NORMAL;
+                    rsltaxes[k] = NORMAL;
+                    break;
+                case REDUCED:
+                    axisredu[k] = REDUCED;
+                    rsltaxes[k] = REDUCED;
+                    break;
+                case -1:
+                    PyErr_Clear();
+                    /* FALLTHRU */
+                default:
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Invalid \"axes\" value (not one of the AXIS_* values) for the %s axis",
+                                    AXIS_NAMES[k]);
+                    return;
+            }
+        }
+    }
+    Py_XDECREF(seqobj);
+    ef_set_axis_inheritance_6d_(&id, &(axisvals[0]), &(axisvals[1]), &(axisvals[2]), 
+                                     &(axisvals[3]), &(axisvals[4]), &(axisvals[5]));
+    ef_set_axis_reduction_6d_(&id, &(axisredu[0]), &(axisredu[1]), &(axisredu[2]), 
+                                   &(axisredu[3]), &(axisredu[4]), &(axisredu[5]));
+
+    /*
+     * "piecemeal": 6-tuple (X,Y,Z,T,E,F) allow breaking calculations along this result grid axis?
+     *         [optional, default: False for each value]
+     */
+    valobj = PyDict_GetItemString(initdict, "piecemeal"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "piecemeal value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"piecemeal\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > MAX_FERRET_NDIM ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            sprintf(errmsg, "Invalid \"piecemeal\" value (tuple or list with more than %d items)",
+                             MAX_FERRET_NDIM);
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (k = 0; k < MAX_FERRET_NDIM; k++) {
+        axisvals[k] = NO;
+        if ( k < seqlen ) {
+            itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) k); /* borrowed reference */
+            /* Must be one of the singleton objects Py_True or Py_False to be accepted */
+            if ( itemobj == Py_True ) {
+                axisvals[k] = YES;
+            }
+            else if ( itemobj != Py_False ) {
+                PyErr_Clear();
+                Py_DECREF(seqobj);
+                Py_DECREF(initdict);
+                strcpy(errmsg, "Invalid \"piecemeal\" value (not True or False)");
+                return;
+            }
+        }
+    }
+    Py_XDECREF(seqobj);
+    ef_set_piecemeal_ok_6d_(&id, &(axisvals[0]), &(axisvals[1]), &(axisvals[2]), 
+                                 &(axisvals[3]), &(axisvals[4]), &(axisvals[5]));
+
+    /*
+     * "argnames": N-tuple of names for the input arguments [optional, default: (A, B, ...)]
+     */
+    valobj = PyDict_GetItemString(initdict, "argnames"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "argnames value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argnames\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > num_args ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argnames\" value (tuple or list with too many items)");
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (j = 0; j < num_args; j++) {
+        /* Assign a default name */
+        name[0] = (char) ('A' + j);
+        name[1] = '\0';
+        if ( j < seqlen ) {
+            /* Get the name from the tuple */
+            itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) j); /* borrowed reference */
+            strptr = PyString_AsString(itemobj);
+            if ( strptr != NULL ) {
+                strncpy(name, strptr, EF_MAX_NAME_LENGTH);
+                name[EF_MAX_NAME_LENGTH-1] = '\0';
+            }
+            else {
+                Py_DECREF(seqobj);
+                Py_DECREF(initdict);
+                sprintf(errmsg, "Invalid \"argnames\" value (not a string) for the ARG%d", j+1);
+                return;
+            }
+        }
+        q = j+1;
+        ef_set_arg_name_sub_(&id, &q, name);
+    }
+    Py_XDECREF(seqobj);
+
+    /*
+     * "argdescripts": N-tuple of descriptions for the input arguments [optional, default: no descriptions]
+     */
+    valobj = PyDict_GetItemString(initdict, "argdescripts"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "argdescripts value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argdescripts\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > num_args ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argdescripts\" value (tuple or list with too many items)");
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (j = 0; j < num_args; j++) {
+        /* Assign the default description */
+        descript[0] = '\0';
+        if ( j < seqlen ) {
+            /* Get the description from the tuple */
+            itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) j); /* borrowed reference */
+            strptr = PyString_AsString(itemobj);
+            if ( strptr != NULL ) {
+                strncpy(descript, strptr, EF_MAX_DESCRIPTION_LENGTH);
+                descript[EF_MAX_DESCRIPTION_LENGTH-1] = '\0';
+            }
+            else {
+                PyErr_Clear();
+                Py_DECREF(seqobj);
+                Py_DECREF(initdict);
+                sprintf(errmsg, "Invalid \"argdescripts\" value (not a string) for the ARG%d", j+1);
+                return;
+            }
+        }
+        q = j + 1;
+        ef_set_arg_desc_sub_(&id, &q, descript);
+    }
+    Py_XDECREF(seqobj);
+
+    /*
+     * "argtypes": N-tuple of types for the input arguments [optional, default: FLOAT_ARRAY]
+     *             FLOAT_ARRAY, FLOAT_ONEVAL, STRING_ARRAY, and STRING_ONEVAL are supported
+     *             FLOAT_ARG and STRING_ARG as accepted for backward compatibility.
+     *             FLOAT_ARG is treated like FLOAT_ARRAY, and STRING_ARG like STRING_ONEVAL.
+     * Note: the distiction between array values and single values is only important for
+     *       pyferret: how to get the (string) values from ferret.  Ferret only expects to
+     *       find FLOAT_ARG or STRING_ARG.
+     */
+    valobj = PyDict_GetItemString(initdict, "argtypes"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "argtypes value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argtypes\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > num_args ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"argtypes\" value (tuple or list with too many items)");
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (j = 0; j < num_args; j++) {
+        /* FLOAT_ARG is the default */
+        argtype = FLOAT_ARG;
+        if ( j < seqlen ) {
+            /* Get the type from the tuple */
+            itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) j); /* borrowed reference */
+            switch( (int) PyInt_AsLong(itemobj) ) {
+                case FLOAT_ONEVAL:
+                case FLOAT_ARRAY:
+                case FLOAT_ARG:
+                    argtype = FLOAT_ARG;
+                    break;
+                case STRING_ONEVAL:
+                case STRING_ARRAY:
+                case STRING_ARG:
+                    argtype = STRING_ARG;
+                    break;
+                default:
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Unknown \"argtypes\" value for ARG%d", j+1);
+                    return;
+            }
+        }
+        q = j+1;
+        ef_set_arg_type_(&id, &q, &argtype);
+    }
+    Py_XDECREF(seqobj);
+
+    /*
+     * "influences": N-tuple of 6-tuples of booleans indicating whether the corresponding input
+     *               argument's (X,Y,Z,T,E,F) axis influences the result grid's (X,Y,Z,T,E,F) axis.
+     *               [optional, None for a 6-tuple and default: True for each value]
+     */
+    valobj = PyDict_GetItemString(initdict, "influences"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "influences value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"influences\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > num_args ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"influences\" value (tuple or list with too many items)");
+            return;
+        }
+    }
+    else {
+        seqobj = NULL;
+        seqlen = -1;
+    }
+    for (j = 0; j < num_args; j++) {
+        for (k = 0; k < MAX_FERRET_NDIM; k++)
+            axisvals[k] = YES;
+        if ( j < seqlen ) {
+            valobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) j); /* borrowed reference */
+            /* None is acceptable here: treat as (True, True, True, True) */
+            if ( valobj != Py_None ) {
+                subseqobj = PySequence_Fast(valobj, "influences item");
+                if ( subseqobj == NULL ) {
+                    PyErr_Clear();
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Invalid \"influences\" value (not None, a tuple, or a list) "
+                                    "for ARG%d", j+1);
+                    return;
+                }
+                subseqlen = (int) PySequence_Fast_GET_SIZE(subseqobj);
+                if ( subseqlen > MAX_FERRET_NDIM ) {
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Invalid \"influences\" value (tuple or list with more than %d items) "
+                                    "for ARG%d", MAX_FERRET_NDIM, j+1);
+                    return;
+                }
+                for (k = 0; k < subseqlen; k++) {
+                    itemobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) k); /* borrowed reference */
+                    /* Must be one of the singleton objects Py_True or Py_False to be accepted */
+                    if ( itemobj == Py_False ) {
+                        axisvals[k] = NO;
+                    }
+                    else if ( itemobj != Py_True ) {
+                        PyErr_Clear();
+                        Py_DECREF(subseqobj);
+                        Py_DECREF(seqobj);
+                        Py_DECREF(initdict);
+                        sprintf(errmsg, "Invalid \"influences\" value (not True or False) for the %s axis "
+                                        "of ARG%d", AXIS_NAMES[k], j+1);
+                        return;
+                    }
+                }
+                Py_DECREF(subseqobj);
+            }
+        }
+        for (q = 0; q < MAX_FERRET_NDIM; q++) {
+            if ( (axisvals[q] == YES) && (rsltaxes[q] != IMPLIED_BY_ARGS) && (rsltaxes[q] != REDUCED) ) {
+                Py_DECREF(seqobj);
+                Py_DECREF(initdict);
+                sprintf(errmsg, "Invalid YES \"influences\" value (result axis not IMPLIED_BY_ARGS or REDUCED) "
+                                "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                return;
+            }
+        }
+        q = j+1;
+        ef_set_axis_influence_6d_(&id, &q, &(axisvals[0]), &(axisvals[1]), &(axisvals[2]), 
+                                           &(axisvals[3]), &(axisvals[4]), &(axisvals[5]));
+    }
+    Py_XDECREF(seqobj);
+
+    /*
+     * "extends": N-tuple of 6-tuples of pairs of integers.  The n-th tuple, if not None,
+     *            gives the (X,Y,Z,T,E,F) extension pairs (which may be None) for the n-th
+     *            argument.  [optional, default: no extensions assigned]
+     *
+     * Note: if not given, not assigned (instead of defaults assigned as above).
+     */
+    valobj = PyDict_GetItemString(initdict, "extends"); /* borrowed reference */
+    if ( valobj != NULL ) {
+        seqobj = PySequence_Fast(valobj, "extends value");
+        if ( seqobj == NULL ) {
+            PyErr_Clear();
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"extends\" value (not a tuple or list)");
+            return;
+        }
+        seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+        if ( seqlen > num_args ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(initdict);
+            strcpy(errmsg, "Invalid \"extends\" value (tuple or list with too many items)");
+            return;
+        }
+        for (j = 0; j < seqlen; j++) {
+            valobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) j); /* borrowed reference */
+	    /* None is acceptable here */
+            if ( valobj != Py_None ) {
+                subseqobj = PySequence_Fast(valobj, "extends item");
+                if ( subseqobj == NULL ) {
+                    PyErr_Clear();
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Invalid \"extends\" value (not None, a tuple, or a list) "
+                                    "for ARG%d", j+1);
+                    return;
+                }
+                subseqlen = (int) PySequence_Fast_GET_SIZE(subseqobj);
+                if ( subseqlen > MAX_FERRET_NDIM ) {
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    Py_DECREF(initdict);
+                    sprintf(errmsg, "Invalid \"extends\" value (tuple or list with more than %d items) "
+                                    "for ARG%d", MAX_FERRET_NDIM, j+1);
+                    return;
+                }
+                for (k = 0; k < subseqlen; k++) {
+                    valobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) k); /* borrowed reference */
+	            /* None is acceptable here */
+                    if ( valobj != Py_None ) {
+                        subsubseqobj = PySequence_Fast(valobj, "extends item's item");
+                        if ( subsubseqobj == NULL ) {
+                            PyErr_Clear();
+                            Py_DECREF(subseqobj);
+                            Py_DECREF(seqobj);
+                            Py_DECREF(initdict);
+                            sprintf(errmsg, "Invalid \"extends\" value (not None, a tuple, or a list) "
+                                            "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                            return;
+                        }
+                        subsubseqlen = PySequence_Fast_GET_SIZE(subsubseqobj);
+                        if ( subsubseqlen > 2 ) {
+                            Py_DECREF(subsubseqobj);
+                            Py_DECREF(subseqobj);
+                            Py_DECREF(seqobj);
+                            Py_DECREF(initdict);
+                            sprintf(errmsg, "Invalid \"extends\" value (tuple or list with more that two items) "
+                                            "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                        }
+                        deltas[0] = 0; deltas[1] = 0;
+                        for (q = 0; q < subsubseqlen; q++) {
+                            itemobj = PySequence_Fast_GET_ITEM(subsubseqobj, (Py_ssize_t) q); /* borrowed reference */
+                            val = PyInt_AsLong(itemobj);
+                            if ( PyErr_Occurred() ) {
+                                PyErr_Clear();
+                                Py_DECREF(subsubseqobj);
+                                Py_DECREF(subseqobj);
+                                Py_DECREF(seqobj);
+                                Py_DECREF(initdict);
+                                if ( q == 0 )
+                                    sprintf(errmsg, "Invalid first \"extends\" value (not an int) "
+                                                    "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                                else
+                                    sprintf(errmsg, "Invalid second \"extends\" value (not an int) "
+                                                    "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                                return;
+                            }
+                            deltas[q] = val;
+                        }
+                        if ( rsltaxes[k] != IMPLIED_BY_ARGS ) {
+                            Py_DECREF(subsubseqobj);
+                            Py_DECREF(subseqobj);
+                            Py_DECREF(seqobj);
+                            Py_DECREF(initdict);
+                            sprintf(errmsg, "Invalid \"extends\" value (result axis not IMPLIED_BY_ARGS) "
+                                            "for the %s axis of ARG%d", AXIS_NAMES[k], j+1);
+                            return;
+                        }
+                        q = j+1;
+                        val = k+1;
+                        ef_set_axis_extend_(&id, &q, &val, &(deltas[0]), &(deltas[1]));
+                        Py_DECREF(subsubseqobj);
+                    }
+                }
+                Py_DECREF(subseqobj);
+            }
+        }
+        Py_DECREF(seqobj);
+    }
+
+    /* Iterate over all the keys to check for unknown keys (eg, typos) */
+    keysobj = PyDict_Keys(initdict);
+    seqobj = PySequence_Fast(keysobj, "dictionary keys");
+    seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+    for (k = 0; k < seqlen; k++) {
+        itemobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) k); /* borrowed reference */
+        strptr = PyString_AsString(itemobj);
+        if ( strptr == NULL ) {
+            Py_DECREF(seqobj);
+            Py_DECREF(keysobj);
+            Py_DECREF(initdict);
+            sprintf(errmsg, "Invalid key (not a string) in the dictionary returned from %s in %s",
+                            INIT_METHOD_NAME, modname);
+            return;
+        }
+        if ( (strcmp(strptr, "numargs") != 0) && (strcmp(strptr, "descript") != 0) &&
+             (strcmp(strptr, "restype") != 0) && (strcmp(strptr, "resstrlen") != 0) &&
+             (strcmp(strptr, "axes") != 0) && (strcmp(strptr, "argnames") != 0) &&
+             (strcmp(strptr, "argdescripts") != 0) && (strcmp(strptr, "argtypes") != 0) &&
+             (strcmp(strptr, "influences") != 0) && (strcmp(strptr, "extends") != 0) &&
+             (strcmp(strptr, "piecemeal") != 0) ) {
+            sprintf(errmsg, "Invalid key \"%s\" in the dictionary returned from %s in %s",
+                            strptr, INIT_METHOD_NAME, modname);
+            Py_DECREF(seqobj);
+            Py_DECREF(keysobj);
+            Py_DECREF(initdict);
+            return;
+        }
+    }
+    Py_DECREF(seqobj);
+    Py_DECREF(keysobj);
+
+    /* initdict no longer needed */
+    Py_DECREF(initdict);
+
+    /* Success */
+    errmsg[0] = '\0';
+    return;
+}
+
diff --git a/pyfermod/pyefcn_result_limits.c b/pyfermod/pyefcn_result_limits.c
new file mode 100644
index 0000000..e1bcb03
--- /dev/null
+++ b/pyfermod/pyefcn_result_limits.c
@@ -0,0 +1,160 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h>
+#define PY_ARRAY_UNIQUE_SYMBOL pyferret_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+#include "pyferret.h"
+#include "EF_Util.h"
+
+static const char *AXIS_NAMES[MAX_FERRET_NDIM] = { "X", "Y", "Z", "T", "E", "F" };
+
+/*
+ * See pyferret.h for information on this function
+ */
+void pyefcn_result_limits(int id, char modname[], char errmsg[])
+{
+    PyObject  *valobj;
+    PyObject  *usermod;
+    PyObject  *seqobj;
+    int        seqlen;
+    int        k, q;
+    int        call_made;
+    PyObject  *subseqobj;
+    int        subseqlen;
+    PyObject  *itemobj;
+    int        limits[2];
+
+    /*
+     * Import the user's Python module
+     */
+    valobj = PyString_FromString(modname);
+    if ( valobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Problems creating a Python string from the module name: %s", modname);
+        return;
+    }
+    usermod = PyImport_Import(valobj);
+    /* valobj no longer needed */
+    Py_DECREF(valobj);
+    /* check for errors */
+    if ( usermod == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Unable to import module: %s", modname);
+        return;
+    }
+
+    /*
+     * Call the ferret_result_limits method in the user's python module with the ferret function ID as the sole argument
+     */
+    valobj = PyObject_CallMethod(usermod, RESULT_LIMITS_METHOD_NAME, "i", id);
+    /* usermod no longer needed */
+    Py_DECREF(usermod);
+    /* check for errors */
+    if ( valobj == NULL ) {
+        sprintf(errmsg, "Error when calling %s in %s: %s", RESULT_LIMITS_METHOD_NAME, modname, pyefcn_get_error());
+        return;
+    }
+
+    /*
+     * Process the contents of the tuple returned, which cannot be None, since one of the axes needs to be assigned
+     */
+    seqobj = PySequence_Fast(valobj, "limits tuple");
+    /* valobj no longer needed - PySequence_Fast has either incremented the reference count or made a copy as a tuple */
+    Py_DECREF(valobj);
+    if ( seqobj == NULL ) {
+        PyErr_Clear();
+        sprintf(errmsg, "Invalid return value (not a tuple or list) from %s in %s", RESULT_LIMITS_METHOD_NAME, modname);
+        return;
+    }
+    seqlen = (int) PySequence_Fast_GET_SIZE(seqobj);
+    if ( seqlen > MAX_FERRET_NDIM ) {
+        Py_DECREF(seqobj);
+        sprintf(errmsg, "Invalid return value (tuple or list with more than %d items) from %s in %s", 
+                        MAX_FERRET_NDIM, RESULT_LIMITS_METHOD_NAME, modname);
+        return;
+    }
+
+    /* Process each item in the tuple returned */
+    call_made = 0;
+    for (k = 0; k < seqlen; k++) {
+        valobj = PySequence_Fast_GET_ITEM(seqobj, (Py_ssize_t) k); /* borrowed reference */
+        /* None is acceptable here */
+        if ( valobj != Py_None ) {
+            subseqobj = PySequence_Fast(valobj, "limits item");
+            if ( subseqobj == NULL ) {
+                PyErr_Clear();
+                Py_DECREF(seqobj);
+                sprintf(errmsg, "Invalid result limits value (not None, a tuple, or a list) for the %s axis", AXIS_NAMES[k]);
+                return;
+            }
+            subseqlen = (int) PySequence_Fast_GET_SIZE(subseqobj);
+            /* If given, it must be a pair */
+            if ( subseqlen != 2 ) {
+                Py_DECREF(subseqobj);
+                Py_DECREF(seqobj);
+                sprintf(errmsg, "Invalid result limits value (not a pair of values) for the %s axis", AXIS_NAMES[k]);
+                return;
+            }
+            for (q = 0; q < 2; q++) {
+                itemobj = PySequence_Fast_GET_ITEM(subseqobj, (Py_ssize_t) q); /* borrowed reference */
+                limits[q] = (int) PyInt_AsLong(itemobj);
+                if ( PyErr_Occurred() ) {
+                    PyErr_Clear();
+                    Py_DECREF(subseqobj);
+                    Py_DECREF(seqobj);
+                    if ( q == 0 )
+                        sprintf(errmsg, "Invalid result limits low value (not an int) for the %s axis", AXIS_NAMES[k]);
+                    else
+                        sprintf(errmsg, "Invalid result limits high value (not an int) for the %s axis", AXIS_NAMES[k]);
+                    return;
+                }
+            }
+            Py_DECREF(subseqobj);
+            q = k+1;
+            ef_set_axis_limits_(&id, &q, &(limits[0]), &(limits[1]));
+            call_made = 1;
+        }
+    }
+    Py_DECREF(seqobj);
+
+    /* Make sure ef_set_axis_limits_ was called at least once */
+    if ( ! call_made )
+        sprintf(errmsg, "No result limits were given in the tuple returned from %s in %s", RESULT_LIMITS_METHOD_NAME, modname);
+    else
+        errmsg[0] = '\0';
+    return;
+}
+
diff --git a/pyfermod/pyferret.h b/pyfermod/pyferret.h
new file mode 100644
index 0000000..770531c
--- /dev/null
+++ b/pyfermod/pyferret.h
@@ -0,0 +1,318 @@
+#ifndef PYFERRET_H_
+#define PYFERRET_H_
+
+/* Python.h should already have been included */
+
+/* Ferret memory cache */
+extern double *memory;
+
+/* PlotPlus memory */
+extern float *ppl_memory;
+
+/* global pyferret Python module object used for readline */
+extern PyObject *pyferret_module_pyobject;
+
+/* global pyferret.graphbind Python module object used for createWindow */
+extern PyObject *pyferret_graphbind_module_pyobject;
+
+#define MAX_FERRET_NDIM 6
+
+/* Enumerated type to assist in creating cdms2.axis objects */
+typedef enum AXISTYPE_ {
+    AXISTYPE_LONGITUDE = 1,
+    AXISTYPE_LATITUDE = 2,
+    AXISTYPE_LEVEL = 3,
+    AXISTYPE_TIME = 4,
+    AXISTYPE_CUSTOM = 5,
+    AXISTYPE_ABSTRACT = 6,
+    AXISTYPE_NORMAL = 7,
+} AXISTYPE;
+
+/* Indices of a time integer array to assist in create cdtime objects */
+typedef enum TIMEARRAY_INDEX_ {
+    TIMEARRAY_DAYINDEX  = 0,
+    TIMEARRAY_MONTHINDEX = 1,
+    TIMEARRAY_YEARINDEX = 2,
+    TIMEARRAY_HOURINDEX = 3,
+    TIMEARRAY_MINUTEINDEX = 4,
+    TIMEARRAY_SECONDINDEX = 5,
+} TIMEARRAY_INDEX;
+
+/* Enumerated type to assist in creating time cdms2.axis objects */
+typedef enum CALTYPE_ {
+    CALTYPE_NONE = -1,
+    CALTYPE_360DAY = 0,
+    CALTYPE_NOLEAP = 50000,
+    CALTYPE_GREGORIAN = 52425,
+    CALTYPE_JULIAN = 52500,
+    CALTYPE_ALLLEAP = 60000,
+} CALTYPE;
+
+/* Prototypes for library C functions */
+void set_fer_memory(double *mem, size_t mem_size);
+void set_ppl_memory(float *mem, int mem_size);
+void set_shared_buffer(void);
+void decref_pyobj_(void *pyobj_ptr_ptr);
+void copy_pystat_data_(double dest[], void *data_ndarray_ptr);
+
+/* Prototypes for library Fortan functions accessed from C routines */
+void add_pystat_var_(void *data_ndarray_ptr_ptr, char codename[], char title[], char units[],
+                     double *bdfval, char dset[], int axis_nums[MAX_FERRET_NDIM],
+                     int axis_starts[MAX_FERRET_NDIM], int axis_ends[MAX_FERRET_NDIM],
+                     char errmsg[], int *lenerrmsg, int len_codename, int len_title,
+                     int len_units, int len_dset, int maxlen_errmsg);
+void clear_fer_last_error_info_(void);
+void ef_get_single_axis_info_(int *id, int *argnum, int *axisnum,
+                              char axisname[], char axisunit[],
+                              int *backwards_axis, int *modulo_axis, int *regular_axis,
+                              int maxlen_axisname, int maxlen_axisunit);
+void finalize_(void);
+void ef_get_arg_type_(int *id, int *argnum, int *argtype);
+void ef_get_arg_string_(int *id, int *argnum, char *argtext, int maxlen_argtext);
+void ef_get_one_val_(int *id, int *arg, double *val);
+void get_axis_num_(int *axisnum, int *axisstart, int *axisend, char axisname[], char axisunit[],
+                   double axiscoords[], int *numcoords, AXISTYPE *axistype, char *errmsg,
+                   int *lenerrmsg, int maxlen_axisname, int maxlen_axisunit, int maxlen_errmsg);
+void get_data_array_params_(char dataname[], int *lendataname, double *memory, int *arraystart,
+                            int memlo[MAX_FERRET_NDIM], int memhi[MAX_FERRET_NDIM],
+                            int steplo[MAX_FERRET_NDIM], int stephi[MAX_FERRET_NDIM],
+                            int incr[MAX_FERRET_NDIM], char dataunit[], int *lendataunit,
+                            AXISTYPE axtypes[MAX_FERRET_NDIM], double *badval, char errmsg[],
+                            int *lenerrmsg, int maxlen_dataname, int maxlen_dataunit, int maxlen_errmsg);
+void get_data_array_coords_(double axiscoords[], char axisunit[], char axisname[],
+                            int *axisnum, int *numcoords, char errmsg[], int *lenerrmsg,
+                            int maxlen_axisunit, int maxlen_axisname, int maxlen_errmsg);
+void get_data_array_time_coords_(int timecoords[][6], CALTYPE *caltype, char axisname[],
+                                 int *axisnum, int *numcoords, char errmsg[], int *lenerrmsg,
+                                 int maxlen_axisname, int maxlen_errmsg);
+void get_fer_last_error_info_(int *errval, char errmsg[], int maxlen_errmsg);
+void get_ferret_params_(char errnames[][32], int errvals[], int *numvals);
+void get_time_axis_num_(int *axisnum, int *axisstart, int *axisend, char axisname[],
+                        CALTYPE *calendartype, int axiscoords[][6], int *numcoords,
+                        char *errmsg, int *lenerrmsg, int maxlen_axisname, int maxlen_errmsg);
+void init_journal_(int *status);
+void initialize_(void);
+void no_journal_(void);
+void proclaim_c_(int *ttoutLun, char *leader, int *quiet);
+void set_one_cmnd_mode_(int *one_cmnd_mode_int);
+void turnoff_verify_(int *status);
+
+/* Functions for Python-backed external functions */
+
+#define INIT_METHOD_NAME "ferret_init"
+#define COMPUTE_METHOD_NAME "ferret_compute"
+#define CUSTOM_AXES_METHOD_NAME "ferret_custom_axes"
+#define RESULT_LIMITS_METHOD_NAME "ferret_result_limits"
+
+/* My external function argument types */
+#define FLOAT_ARRAY 9
+#define FLOAT_ONEVAL 17
+#define STRING_ARRAY 10
+#define STRING_ONEVAL 18
+
+/*
+ * Initialization routine for the ferret python external function associated
+ * with the python module "modname".  This function calls the "ferret_init"
+ * method in the module to get a dictionary of information in order to assign
+ * the result grid information in ferret.  The signature of the ferret_init
+ * method should be:
+ *
+ * ferdict = ferret_init(id)
+ *
+ * where the argument, id, is ferret's integer ID of this external function
+ * and the return value, ferdict, is a dictionary defining:
+ *     "numargs": number of input arguments [1 - 9, required]
+ *     "descript": string description of the function [required]
+ *     "restype": One of FLOAT_ARRAY or STRING_ARRAY, indicating whether the result is an
+ *                array of floating-point values or strings [optional, default FLOAT_ARRAY]
+ *     "resstrlen": If the result type is an array of strings, this specifies the (maximum)
+ *                  length of the strings in the array [optional, default: 128]
+ *     "axes": 6-tuple (X,Y,Z,T,E,F) of result grid axis defining values (defined in the 
+ *             pyferret module), which are:
+ *                 AXIS_ABSTRACT: indexed, ferret_result_limits called to define the axis,
+ *                 AXIS_CUSTOM: ferret_custom_axes called to define the axis,
+ *                 AXIS_DOES_NOT_EXIST: does not exist in (normal to) the results grid,
+ *                 AXIS_IMPLIED_BY_ARGS: same as the corresponding axis in one or more arguments,
+ *                 AXIS_REDUCED: reduced to a single point
+ *             [optional, default: AXIS_IMPLIED_BY_ARGS for each axis]
+ *     "piecemeal": 6-tuple (X,Y,Z,T,E,F) of True or False indicating if it is
+ *                  acceptable to break up the calculation, if needed, along the
+ *                  corresponding axis [optional; default: False for each axis]
+ *     "argnames": N-tuple of names for the input arguments [optional, default: (A, B, ...)]
+ *     "argdescripts": N-tuple of descriptions for the input arguments
+ *                     [optional, default: no descriptions]
+ *     "argtypes": N-tuple of FLOAT_ARRAY, FLOAT_ONEVAL, STRING_ARRAY, or STRING_ONEVAL,
+ *                 indicating whether the input argument is an array of floating-point values,
+ *                 a single floating point value, an array of strings, or a single string value.
+ *                 [optional; default: FLOAT_ARRAY for every argument]
+ *     "influences": N-tuple of 6-tuples of booleans indicating whether the corresponding input
+ *                   argument's (X,Y,Z,T,E,F) axis influences the result grid's (X,Y,Z,T,E,F) axis.
+ *                   [optional, default and when None is given for a 6-tuple: True for every axis]
+ *     "extends": N-tuple of 6-tuples of pairs of integers.  The n-th tuple, if not None, gives
+ *                the (X,Y,Z,T,E,F) extension pairs for the n-th argument.  An extension pair, if not
+ *                None, is the number of points to extend in the (low,high) direction for that axis
+ *                of that argument when passed to the ferret_compute function.  Thus,
+ *                    (None, (None, None, None, (-1,1)), None, None, None)
+ *                will expand the T axis of the second argument by 2 points (low dimension lowered
+ *                by 1, high dimension raised by 1).  [optional, default: no extensions assigned]
+ *
+ * If an exception is raised, Ferret is notified that an error occurred using
+ * the message of the exception.
+ *
+ * Arguments for the pyefcn_init function:
+ *     id - ferret's id for the function associated with this python module
+ *     modname - name of the Python module, null terminated.  This module name should
+ *               be in a form appropriate for the python import statement; eg,
+ *               "package.module" ('.' to separate module containers; no extension).
+ *     errmsg - a character array to contain any error messages generated
+ *              which should be null terminated
+ *
+ * Returns an empty error message if and only if successful.
+ */
+void pyefcn_init(int id, char modname[], char errmsg[]);
+
+
+/*
+ * Interface function for calling the ferret_result_limits method in the python
+ * module "modname".  The values returned by this method are used to assign the
+ * limits in ferret of result grid axes that were designated as AXIS_ABSTRACT in
+ * the dictionary returned from the call to the ferret_init method in this module.
+ * The pyferret method get_axis_coordinates may be useful in determining the values
+ * to return.  The signature of the ferret_result_limits method should be:
+ *
+ * limits_tuple = ferret_result_limits(id)
+ *
+ * where the argument, id, is ferret's integer ID of this external function and the
+ * return value, limits_tuple, is a (X,Y,Z,T,E,F) 6-tuple of either None or (low, high)
+ * pairs of integers.  If an axis was not designated as AXIS_ABSTRACT, None should
+ * be given for that axis.  If an axis was designated as AXIS_ABSTRACT, a (low, high)
+ * pair of two integers should be given, which are used as the low and high Ferret
+ * indices for that axis.  [The indices of the NumPy ndarray to be assigned will be
+ * from 0 until (high-low)].
+ *
+ * If an exception is raised, Ferret is notified that an error occurred using
+ * the message of the exception.
+ *
+ *
+ * Arguments for the pyefcn_result_limits function:
+ *     id - ferret's id for the function associated with this python module
+ *     modname - name of the Python module, null terminated.  This module name should
+ *               be in a form appropriate for the python import statement; eg,
+ *               "package.module" ('.' to separate module containers; no extension).
+ *     errmsg - a character array to contain any error messages generated
+ *              which should be null terminated
+ *
+ * Returns an empty error message if and only if successful.
+ */
+void pyefcn_result_limits(int id, char modname[], char errmsg[]);
+
+
+/*
+ * Interface function for calling the ferret_custom_axes method in the python
+ * module "modname".  The values returned by this method are used to assign in
+ * ferret the data for result grid axes that were designated as AXIS_CUSTOM in
+ * the dictionary returned from the call to the ferret_init method in this module.
+ * The pyferret method get_axis_coordinates may be useful in determining the values
+ * to return.  The signature of the ferret_custom_axes method should be:
+ *
+ * data_tuple = ferret_custom_axes(id)
+ *
+ * where the argument, id, is ferret's integer ID of this external function and 
+ * the return value, data_tuple, is a (X,Y,Z,T,E,F) 6-tuple of either None or a 
+ * (low, high, delta, unit_name, is_modulo) tuple.  If an axis was not designated as 
+ * AXIS_CUSTOM, None should be given for that axis.  If an axis was designated as 
+ * AXIS_CUSTOM, a (low, high, delta, unit_name, is_modulo) tuple should be given where 
+ * low and high are the "world" coordinates (floating point) limits for the axis, 
+ * delta is the step increments in "world" coordinates, unit_name is a string used in 
+ * describing the "world" coordinates, and is_modulo is either True or False, indicating 
+ * if this is a modulo ("wrapping") coordinate system.
+ *
+ * If an exception is raised, Ferret is notified that an error occurred using
+ * the message of the exception.
+ *
+ *
+ * Arguments for the pyefcn_custom_axes function:
+ *     id - ferret's id for the function associated with this python module
+ *     modname - name of the Python module, null terminated.  This module name should
+ *               be in a form appropriate for the python import statement; eg,
+ *               "package.module" ('.' to separate module containers; no extension).
+ *     errmsg - a character array to contain any error messages generated
+ *              which should be null terminated
+ *
+ * Returns an empty error message if and only if successful.
+ */
+void fer_pyefcn_custom_axes(int id, char modname[], char errmsg[]);
+
+
+/*
+ * Compute interface function for the ferret python external function
+ * associated with the python module "modname".  This function calls the
+ * "ferret_compute" method in the module to assign the result data grid.
+ * The signature of the ferret_compute method should be:
+ *
+ *     ferret_compute(id, result_array, result_badval, input_arrays, input_badvals)
+ *
+ * where:
+ *     id - ferret's integer ID of this external function
+ *     result_array - a writeable NumPy float64 ndarray of six
+ *         dimensions (X,Y,Z,T,E,F) to contain the results of this
+ *         computation.  The shape and strides of this array has
+ *         been configured so that only (and all) the data points
+ *         that should be assigned are accessible.
+ *     result_badval - a NumPy ndarray of one dimension containing
+ *         the bad-data-flag value for the result array.
+ *     input_arrays - tuple of read-only NumPy float64 ndarrays of
+ *         six dimensions (X,Y,Z,T,E,F) containing the given input data.
+ *         The shape and strides of these array have been configured
+ *         so that only (and all) the data points that should be
+ *         accessible are accessible.
+ *     input_badvals - a NumPy ndarray of one dimension containing
+ *         the bad-data-flag values for each of the input arrays.
+ *
+ * Any return value from ferret_compute is ignored.
+ * If an exception is raised, Ferret is notified that an error occurred using
+ * the message of the exception.
+ *
+ *
+ * Arguments for the pyefcn_compute function:
+ *
+ *     id - ferret's id for the function associated with this python module
+ *     modname - name of the Python module, null-terminated.  This module name should
+ *               be in a form appropriate for the python import statement; eg,
+ *               "parent.module" ('.' to separate module containers; no extension).
+ *     arrays - an array of Fortran double-precision grid arrays.  The first array, 
+ *              arrays[0], is the Fortran array to be assigned with the result grid 
+ *              data.  The remaining arrays are the input grid data Fortran arrays.
+ *              The Fortran dimensions of these arrays are:
+ *                      arrays[k](memlo[k][0]:memhi[k][0],  - X
+ *                                memlo[k][1]:memhi[k][1],  - Y
+ *                                memlo[k][2]:memhi[k][2],  - Z
+ *                                memlo[k][3]:memhi[k][3],  - T
+ *                                memlo[k][4]:memhi[k][4],  - E
+ *                                memlo[k][5]:memhi[k][5])  - F
+ *     numarrays - the number of arrays given above (including the results array).
+ *     memlo, memhi - Fortran array dimensions as given above.
+ *     steplo, stephi, incr - for loop limits and increments for assigning
+ *             Fortran data arrays.  Loops start at steplo, increment by incr,
+ *             and stop *after* stephi.  The ([k][0], [k][1], [k][2], [k][3],
+ *             [k][4], [k][5]) values are for the (X,Y,Z,T,E,F) axes of arrays[k].
+ *     badvals - the bad-data-flag value for each of the arrays.
+ *     errmsg - a character array to contain any error messages generated,
+ *             which should be null-terminated
+ *
+ * Returns an empty error message if and only if successful.
+ */
+void pyefcn_compute(int id, char modname[], double *arrays[], int numarrays,
+                    int memlo[][MAX_FERRET_NDIM], int memhi[][MAX_FERRET_NDIM],
+                    int steplo[][MAX_FERRET_NDIM], int stephi[][MAX_FERRET_NDIM],
+                    int incr[][MAX_FERRET_NDIM], double badvals[], char errmsg[]);
+
+/*
+ * Returns the message from a Python exception, and clear the exception.
+ * If an exception was raised with no message, a default error message
+ * ("Exception raised with no message") is returned.  If an exception had
+ * not been raised, an empty string is returned.
+ */
+char *pyefcn_get_error(void);
+
+#endif
diff --git a/pyfermod/regrid/.project b/pyfermod/regrid/.project
new file mode 100644
index 0000000..c840999
--- /dev/null
+++ b/pyfermod/regrid/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>regrid</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>
diff --git a/pyfermod/regrid/.pydevproject b/pyfermod/regrid/.pydevproject
new file mode 100644
index 0000000..c20252d
--- /dev/null
+++ b/pyfermod/regrid/.pydevproject
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/regrid</path>
+</pydev_pathproperty>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+</pydev_project>
diff --git a/pyfermod/regrid/README.txt b/pyfermod/regrid/README.txt
new file mode 100644
index 0000000..6fbb9df
--- /dev/null
+++ b/pyfermod/regrid/README.txt
@@ -0,0 +1,2 @@
+This is an Eclipse PyDev project module; thus
+the reason for the .project and .pydevproject files.
diff --git a/pyfermod/regrid/__init__.py b/pyfermod/regrid/__init__.py
new file mode 100644
index 0000000..dda46c7
--- /dev/null
+++ b/pyfermod/regrid/__init__.py
@@ -0,0 +1,151 @@
+'''
+Regridders designed for use in PyFerret, especially for Python external
+functions for PyFerret.  Includes the singleton class ESMPControl to
+safely start and stop ESMP once, and only once, in a Python session.
+
+ at author: Karl Smith
+'''
+
+import numpy
+
+# Import classes given in modules in this package so they are all seen here.
+try:
+    from esmpcontrol import ESMPControl
+    from regrid2d import CurvRectRegridder
+    from regrid3d import CurvRect3DRegridder
+except ImportError:
+    # No ESMP, but do not raise an error until attempting to actually use it
+    pass
+
+
+def quadCornersFrom3D(ptx3d, pty3d):
+    '''
+    Converts 3D formats of curvilinear corner coordinates to 2D format.
+
+    In 3D formats, quad[i,j] is formed by consecutive corner points
+    in the sequence:
+        (ptx3d[i,j,0], pty3d[i,j,0]),
+        (ptx3d[i,j,1], pty3d[i,j,1]),
+        (ptx3d[i,j,2], pty3d[i,j,2]),
+        (ptx3d[i,j,3], pty3d[i,j,3]),
+        (ptx3d[i,j,0], pty3d[i,j,0]),
+    thus graphically represented, using the third indices, as:
+          3 --- 2        1 --- 2
+         /     /   or   /     /
+        0 --- 1        0 --- 3
+    Neighboring quadrilaterals must share edges, thus their 3D corner
+    coordinates values must also satisfy:
+        quad[i+1,j,0] is the same as quad[i,j,1] or quad[i,j,3]
+        quad[i,j+j,0] is the same as quad[i,j,3] or quad[i,j,1]
+        quad[i+1,j+1,0] is the same as quad[i,j,2]
+
+    In the 2D format, quad[i,j] is former by consecutive corner points
+    in the sequence:
+        (ptx[i,   j],   pty[i,   j]) ,
+        (ptx[i+1, j],   pty[i+1, j]) ,
+        (ptx[i+1, j+1], pty[i+1, j+1]) ,
+        (ptx[i,   j+1], pty[i,   j+1]) ,
+        (ptx[i,   j],   pty[i,   j])
+    The shape value of the first two dimensions for the 2D corner point
+    arrays is one larger than the corresponding shape value for the 3D
+    corner points.
+
+    Arguments:
+        ptx3d - 3D quadrilateral corner X coordinates
+        pty3d - 3D quadrilateral corner Y coordinates
+    Returns:
+        (ptx, pty) where
+        ptx - 2D quadrilateral corner X coordinates
+        pty - 2D quadrilateral corner Y coordiantes
+    Raises:
+        ValueError if ptx3d or pty3d do not fit one of the expected formats
+    '''
+    # relative and absolute tolerances to be used in numpy.allclose
+    rtol = 1.0E-4
+    atol = 1.0E-6
+
+    if ptx3d.shape != pty3d.shape:
+        raise ValueError("ptx3d and pty3d in quadCornersFrom3D must have the same shape ")
+    corners_shape = (ptx3d.shape[0] + 1, ptx3d.shape[1] + 1)
+
+    if not (numpy.allclose(ptx3d[1:, 1:, 0], ptx3d[:-1, :-1, 2], rtol, atol) and \
+            numpy.allclose(pty3d[1:, 1:, 0], pty3d[:-1, :-1, 2], rtol, atol)):
+        raise ValueError("Unexpected ptx3d, pty3d values in quadCornersFrom3D")
+
+    # Check if corners are: 
+    #     3 --- 2        1 --- 2 
+    #    /     /   or   /     / 
+    #   0 --- 1        0 --- 3 
+    # and assign appropriately. 
+    if numpy.allclose(ptx3d[1:, :, 0], ptx3d[:-1, :, 1], rtol, atol) and \
+       numpy.allclose(pty3d[1:, :, 0], pty3d[:-1, :, 1], rtol, atol) and \
+       numpy.allclose(ptx3d[:, 1:, 0], ptx3d[:, :-1, 3], rtol, atol) and \
+       numpy.allclose(pty3d[:, 1:, 0], pty3d[:, :-1, 3], rtol, atol):
+        ptx = numpy.empty(corners_shape, dtype=numpy.float64)
+        ptx[0, 0] = ptx3d[0, 0, 0]
+        ptx[0, 1:] = ptx3d[0, :, 3]
+        ptx[1:, 0] = ptx3d[:, 0, 1]
+        ptx[1:, 1:] = ptx3d[:, :, 2]
+        pty = numpy.empty(corners_shape, dtype=numpy.float64)
+        pty[0, 0] = pty3d[0, 0, 0]
+        pty[0, 1:] = pty3d[0, :, 3]
+        pty[1:, 0] = pty3d[:, 0, 1]
+        pty[1:, 1:] = pty3d[:, :, 2]
+    elif numpy.allclose(ptx3d[1:, :, 0], ptx3d[:-1, :, 3], rtol, atol) and \
+         numpy.allclose(pty3d[1:, :, 0], pty3d[:-1, :, 3], rtol, atol) and \
+         numpy.allclose(ptx3d[:, 1:, 0], ptx3d[:, :-1, 1], rtol, atol) and \
+         numpy.allclose(pty3d[:, 1:, 0], pty3d[:, :-1, 1], rtol, atol):
+        ptx = numpy.empty(corners_shape, dtype=numpy.float64)
+        ptx[0, 0] = ptx3d[0, 0, 0]
+        ptx[0, 1:] = ptx3d[0, :, 1]
+        ptx[1:, 0] = ptx3d[:, 0, 3]
+        ptx[1:, 1:] = ptx3d[:, :, 2]
+        pty = numpy.empty(corners_shape, dtype=numpy.float64)
+        pty[0, 0] = pty3d[0, 0, 0]
+        pty[0, 1:] = pty3d[0, :, 1]
+        pty[1:, 0] = pty3d[:, 0, 3]
+        pty[1:, 1:] = pty3d[:, :, 2]
+    else:
+        raise ValueError("Unexpected ptx3d, pty3d values in quadCornersFrom3D")
+
+    return (ptx, pty)
+
+
+def quadCentroids(ptx, pty):
+    '''
+    Returns the centroids of quadrilaterals using the Surveyor's formula.
+    The quadilaterals are defined from the 2D corner point numpy arrays
+    ptx and pty, which must have the same shape, where quad[i,j] is formed
+    by joined consecutive x,y points in the sequence:
+    ( ptx[i,   j],   pty[i,   j] ) ,
+    ( ptx[i+1, j],   pty[i+1, j] ) ,
+    ( ptx[i+1, j+1], pty[i+1, j+1] ) ,
+    ( ptx[i,   j+1], pty[i,   j+1] ) ,
+    ( ptx[i,   j],   pty[i,   j] )
+    The ctrx and ctry arrays returned will have a shape one smaller in the
+    first two dimensions compared to ptx and pty.
+    '''
+    if ptx.shape != pty.shape:
+        raise ValueError("ptx and pty in quadCentroids must have the same shape")
+
+    side0010 = ptx[:-1, :-1] * pty[1:,  :-1] - ptx[1:,  :-1] * pty[:-1, :-1]
+    side1011 = ptx[1:,  :-1] * pty[1:,  1:]  - ptx[1:,  1:]  * pty[1:,  :-1]
+    side1101 = ptx[1:,  1:]  * pty[:-1, 1:]  - ptx[:-1, 1:]  * pty[1:,  1:]
+    side0100 = ptx[:-1, 1:]  * pty[:-1, :-1] - ptx[:-1, :-1] * pty[:-1, 1:]
+
+    area = 0.5 * (side0010 + side1011 + side1101 + side0100)
+
+    ctrx  = (ptx[:-1, :-1] + ptx[1:,  :-1]) * side0010
+    ctrx += (ptx[1:,  :-1] + ptx[1:,  1:])  * side1011
+    ctrx += (ptx[1:,  1:]  + ptx[:-1, 1:])  * side1101
+    ctrx += (ptx[:-1, 1:]  + ptx[:-1, :-1]) * side0100
+    ctrx /= 6.0 * area
+
+    ctry  = (pty[:-1, :-1] + pty[1:,  :-1]) * side0010
+    ctry += (pty[1:,  :-1] + pty[1:,  1:])  * side1011
+    ctry += (pty[1:,  1:]  + pty[:-1, 1:])  * side1101
+    ctry += (pty[:-1, 1:]  + pty[:-1, :-1]) * side0100
+    ctry /= 6.0 * area
+
+    return (ctrx, ctry)
+
diff --git a/pyfermod/regrid/curv2rect.py b/pyfermod/regrid/curv2rect.py
new file mode 100644
index 0000000..c33330c
--- /dev/null
+++ b/pyfermod/regrid/curv2rect.py
@@ -0,0 +1,216 @@
+'''
+PyFerret Python External Function (PyEF) for regridding data from
+a curvilinear longitude, latitude grid to a rectilinear longitude,
+latitude grid.  Uses the Ferret2DRegridder class, which in turn
+uses ESMP/ESMF, to perform the regridding.
+
+ at author: Karl Smith
+'''
+import numpy
+import pyferret
+import ESMP
+import pyferret.regrid as regrid
+
+
+def ferret_init(efid):
+    '''
+    Initializes the curv2rect function.  Either center or corner curvilinear
+    coordinates must be given; both may be given.  If only corner coordinates
+    are given, center coordinates are positioned at the centroid of each cell
+    as computed using the Surveyor's Formula.  If conservative regridding is
+    used, corners must be given.
+    '''
+    init_dict = { }
+    init_dict["numargs"] = 7
+    init_dict["descript"] = \
+        "Regrids data from curvilinear lon,lat center " \
+        "and/or corner grid to rectilinear using ESMP/ESMF"
+    init_dict["argnames"] = ("CurvData",
+                             "CurvCenterLons",
+                             "CurvCenterLats",
+                             "CurvCornerLons",
+                             "CurvCornerLats",
+                             "TemplateRectVar",
+                             "Method")
+    init_dict["argdescripts"] = (
+        "Curvilinear X,Y data positioned at centers",
+        "Curvilinear center longitudes on an X,Y grid",
+        "Curvilinear center latitudes on an X,Y grid",
+        "Curvilinear corner longitudes on an X,Y (maybe Z) grid",
+        "Curvilinear corner latitudes on an X,Y (maybe Z) grid",
+        "Template variable on the desired rectilinear grid",
+        "Regrid method: BILINEAR, PATCH, CONSERVE")
+    init_dict["argtypes"] = (pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.STRING_ONEVAL)
+    no_influence = [ False ] * pyferret.MAX_FERRET_NDIM
+    full_influence = [ True ] * pyferret.MAX_FERRET_NDIM
+    part_influence = full_influence[:]
+    part_influence[pyferret.X_AXIS] = False
+    part_influence[pyferret.Y_AXIS] = False
+    init_dict["influences"] = (part_influence,
+                               no_influence,
+                               no_influence,
+                               no_influence,
+                               no_influence,
+                               full_influence,
+                               no_influence)
+    # okay to break up along Z, T, E, and F result axes
+    init_dict["piecemeal"] = (False, False, True, True, True, True)
+
+    return init_dict
+
+
+def ferret_compute(efid, result, result_bdf, inputs, input_bdfs):
+    '''
+    Performs the regridding for the curv2rect function.
+
+    Arguments:
+        result     - numpy array for rectilinear data values to be assigned
+        result_bdf - numpy array of the missing-data value for result
+        inputs     - numpy arrays (CurvData,
+                                   CurvCenterLons, CurvCenterLats,
+                                   CurvCornerLons, CurvCornerLats.
+                                   TemplateRectVar, Method)
+        input_bdfs - numpy arrays of missing-data values for the
+                     corresponding inputs array
+    '''
+    # Get the regridding method to use
+    methodstr = pyferret.get_arg_one_val(efid, pyferret.ARG7).upper()
+    if methodstr == "BILINEAR":
+        method = ESMP.ESMP_REGRIDMETHOD_BILINEAR
+    elif methodstr == "PATCH":
+        method = ESMP.ESMP_REGRIDMETHOD_PATCH
+    elif methodstr == "CONSERVE":
+        method = ESMP.ESMP_REGRIDMETHOD_CONSERVE
+    else:
+        raise ValueError("Unknown method %s" % methodstr)
+
+    # Get the template data and missing value
+    template_data = inputs[pyferret.ARG6]
+    template_undef = input_bdfs[pyferret.ARG6]
+
+    # Get the rectilinear center longitudes and latitudes
+    rect_center_lons = pyferret.get_axis_coordinates(efid,
+                                    pyferret.ARG6, pyferret.X_AXIS)
+    rect_center_lats = pyferret.get_axis_coordinates(efid,
+                                    pyferret.ARG6, pyferret.Y_AXIS)
+
+    # Get the rectilinear corner longitudes
+    lo, hi = pyferret.get_axis_box_limits(efid, pyferret.ARG6, pyferret.X_AXIS)
+    if not numpy.allclose(lo[1:], hi[:-1]):
+        raise ValueError("Unexpected ARG6 X_AXIS box limit values " \
+                         "returned from pyferret.get_axis_box_limits")
+    rect_corner_lons = numpy.empty((lo.shape[0] + 1), dtype=numpy.float64)
+    rect_corner_lons[0] = lo[0]
+    rect_corner_lons[1:] = hi
+
+    # Get the rectilinear corner latitudes
+    lo, hi = pyferret.get_axis_box_limits(efid, pyferret.ARG6, pyferret.Y_AXIS)
+    if not numpy.allclose(lo[1:], hi[:-1]):
+        raise ValueError("Unexpected ARG6 Y_AXIS box limit values " \
+                         "returned from pyferret.get_axis_box_limits")
+    rect_corner_lats = numpy.empty((lo.shape[0] + 1), dtype=numpy.float64)
+    rect_corner_lats[0] = lo[0]
+    rect_corner_lats[1:] = hi
+
+    # Get the curvilinear data
+    curv_data = inputs[pyferret.ARG1]
+    curv_centers_shape = (curv_data.shape[0], curv_data.shape[1])
+    if (curv_data.shape[2:] != template_data.shape[2:]):
+        raise ValueError("Curvilinear data and template variable " \
+                         "must have same Z, T, E, and F axes")
+    curv_undef = input_bdfs[pyferret.ARG1]
+
+    # Get the curvilinear centers arrays
+    lons = inputs[pyferret.ARG2].squeeze()
+    lats = inputs[pyferret.ARG3].squeeze()
+    if (lons.shape == curv_centers_shape) and (lats.shape == curv_centers_shape):
+        curv_center_lons = lons
+        curv_center_lats = lats
+    elif (lons.shape == ()) and (lats.shape == ()):
+        curv_center_lons = None
+        curv_center_lats = None
+    else:
+        raise ValueError("Curvilinear center points must have " \
+                         "appropriate shape or be singletons")
+
+    # Get the curvilinear corners arrays
+    lons = inputs[pyferret.ARG4].squeeze()
+    lats = inputs[pyferret.ARG5].squeeze()
+    corners_shape = (curv_data.shape[0] + 1, curv_data.shape[1] + 1)
+    corners_shape_3d = (curv_data.shape[0], curv_data.shape[1], 4)
+    if (lons.shape == corners_shape) and (lats.shape == corners_shape):
+        curv_corner_lons = lons
+        curv_corner_lats = lats
+    elif (lons.shape == corners_shape_3d) and (lats.shape == corners_shape_3d):
+        curv_corner_lons, curv_corner_lats = regrid.quadCornersFrom3D(lons, lats)
+    elif method == ESMP.ESMP_REGRIDMETHOD_CONSERVE:
+        raise ValueError("CONSERVE method requires " \
+                         "curvilinear grid corner coordinates")
+    elif (lons.shape == ()) and (lats.shape == ()):
+        curv_corner_lons = None
+        curv_corner_lats = None
+    else:
+        raise ValueError("Curvilinear corner points must have " \
+                         "appropriate shape or be singletons")
+
+    # If curvilinear center point coordinates not given, 
+    # generate them from the curvilinear corner points
+    if curv_center_lons is None:
+        if not curv_corner_lons is None:
+            curv_center_lons, curv_center_lats = \
+                regrid.quadCentroids(curv_corner_lons, curv_corner_lats)
+        else:
+            raise ValueError("Valid center or corner curvilinear " \
+                             "grid coordinates must be given")
+
+    # Make sure ESMP is, or has been, initialized
+    regrid.ESMPControl().startCheckESMP()
+
+    # Create the regridder used repeatedly in this function 
+    regridder = regrid.CurvRectRegridder()
+    last_curv_center_ignore = None
+    last_rect_center_ignore = None
+
+    # Increment the depth index last
+    # most likely to change the undefined (e.g., land) mask 
+    for d_idx in xrange(curv_data.shape[2]):
+        # Arrays are probably in Fortran order, so increment last indices last
+        for f_idx in xrange(curv_data.shape[5]):
+            for e_idx in xrange(curv_data.shape[4]):
+                for t_idx in xrange(curv_data.shape[3]):
+                    # Determine curvilinear center points to ignore from undefined data
+                    curv_center_ignore = ( numpy.abs(curv_data[:, :, d_idx, t_idx,
+                                                e_idx, f_idx] - curv_undef) < 1.0E-7 )
+                    # If mask has changed, need to recreate the curvilinear grid
+                    if (last_curv_center_ignore is None) or \
+                       numpy.any(curv_center_ignore != last_curv_center_ignore):
+                        regridder.createCurvGrid(curv_center_lons, curv_center_lats,
+                                                 curv_center_ignore, curv_corner_lons,
+                                                 curv_corner_lats, None)
+                        last_curv_center_ignore = curv_center_ignore
+                    # Determine rectilinear center points to ignore from undefined data
+                    rect_center_ignore = ( numpy.abs(template_data[:, :, d_idx, t_idx,
+                                                e_idx, f_idx] - template_undef) < 1.0E-7 )
+                    # If mask has changed, need to recreate the rectilinear grid
+                    if (last_rect_center_ignore is None) or \
+                       numpy.any(rect_center_ignore != last_rect_center_ignore):
+                        regridder.createRectGrid(rect_center_lons, rect_center_lats,
+                                                 rect_center_ignore, rect_corner_lons,
+                                                 rect_corner_lats, None)
+                        last_rect_center_ignore = rect_center_ignore
+                    # Assign the curvilinear data
+                    regridder.assignCurvField(curv_data[:, :, d_idx, t_idx, e_idx, f_idx])
+                    # Allocate space for the rectilinear data from the regridding
+                    regridder.assignRectField(None)
+                    # Regrid and assign the rectilinear data to the results array
+                    regrid_data = regridder.regridCurvToRect(result_bdf, method)
+                    result[:, :, d_idx, t_idx, e_idx, f_idx] = regrid_data
+
+    return
+
diff --git a/pyfermod/regrid/curv3srect.py b/pyfermod/regrid/curv3srect.py
new file mode 100644
index 0000000..4b12eb6
--- /dev/null
+++ b/pyfermod/regrid/curv3srect.py
@@ -0,0 +1,246 @@
+'''
+PyFerret Python External Function (PyEF) for regridding data from
+a curvilinear longitude, latitude, bathymetry/zeta/sigma grid to
+a rectilinear, longitude, latitude, depth grid.  Uses the
+Ferret3DRegridder class, which in turn uses ESMP/ESMF, to perform
+the regridding.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import pyferret
+import ESMP
+import pyferret.regrid as regrid
+
+
+def ferret_init(efid):
+    '''
+    Initializes the curv3srect function.  The curvilinear data is assumed
+    to be positioned at the curvilinear coordinates provided.
+    '''
+    init_dict = { }
+    init_dict["numargs"] = 7
+    init_dict["descript"] = \
+        "Regrids data from curvilinear lon, lat, sigma, bathymetry, zeta " \
+        "(centers) grid to rectilinear lon, lat, depth using ESMP/ESMF"
+    init_dict["argnames"] = ("CurvData",
+                             "CurvLons",
+                             "CurvLats",
+                             "CurvBaths",
+                             "CurvZetas",
+                             "TemplateRectVar",
+                             "Method")
+    init_dict["argdescripts"] = (
+        "Curvilinear X,Y,Z,[T,E,F] data where Z is sigma values",
+        "Longitudes of curvilinear data on an X,Y grid",
+        "Latitudes of curvilinear data on an X,Y grid",
+        "Bathymetry (as depths) of curvilinear data on an X,Y grid",
+        "Water surface elevations of curvilinear data on an X,Y,[T] grid (optional)",
+        "Template variable on the desired rectilinear X,Y,Z,[T,E,F] grid " \
+            "where Z is depths",
+        "Regrid method: BILINEAR, PATCH")
+    init_dict["argtypes"] = (pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.FLOAT_ARRAY,
+                             pyferret.STRING_ONEVAL)
+    no_influence = [ False ] * pyferret.MAX_FERRET_NDIM
+    full_influence = [ True ] * pyferret.MAX_FERRET_NDIM
+    part_influence = full_influence[:]
+    part_influence[pyferret.X_AXIS] = False
+    part_influence[pyferret.Y_AXIS] = False
+    part_influence[pyferret.Z_AXIS] = False
+    time_influence = no_influence[:]
+    time_influence[pyferret.T_AXIS] = True
+    init_dict["influences"] = (part_influence,
+                               no_influence,
+                               no_influence,
+                               no_influence,
+                               time_influence,
+                               full_influence,
+                               no_influence)
+    # okay to break up along T, E, and F result axes
+    init_dict["piecemeal"] = (False, False, False, True, True, True)
+
+    return init_dict
+
+
+def ferret_compute(efid, result, result_bdf, inputs, input_bdfs):
+    '''
+    Performs the regridding for the curv3srect function.
+
+    Arguments:
+        result     - rectilinear data values to be assigned
+        result_bdf - missing-data value for result
+        inputs     - (CurvData, CurvLons, CurvLats, CurvBaths,
+                      CurvZetas, TemplateRectVar, Method)
+        input_bdfs - missing-data values for the corresponding inputs array
+    '''
+    # Get the regridding method to use
+    methodstr = pyferret.get_arg_one_val(efid, pyferret.ARG7).upper()
+    if methodstr == "BILINEAR":
+        method = ESMP.ESMP_REGRIDMETHOD_BILINEAR
+    elif methodstr == "PATCH":
+        method = ESMP.ESMP_REGRIDMETHOD_PATCH
+    else:
+        raise ValueError("Unknown method %s (CONSERVE not supported)" % methodstr)
+
+    # Get the template data and missing value
+    template_data = inputs[pyferret.ARG6]
+    template_undef = input_bdfs[pyferret.ARG6]
+
+    # Get the rectilinear center longitudes, latitudes, and depths
+    rect_center_lons = pyferret.get_axis_coordinates(efid,
+                                    pyferret.ARG6, pyferret.X_AXIS)
+    rect_center_lats = pyferret.get_axis_coordinates(efid,
+                                    pyferret.ARG6, pyferret.Y_AXIS)
+    rect_center_depths = pyferret.get_axis_coordinates(efid,
+                                      pyferret.ARG6, pyferret.Z_AXIS)
+
+    # Get the rectilinear corner longitudes
+    lo, hi = pyferret.get_axis_box_limits(efid, pyferret.ARG6, pyferret.X_AXIS)
+    if not numpy.allclose(lo[1:], hi[:-1]):
+        raise ValueError("Unexpected ARG6 X_AXIS box limit values " \
+                         "returned from pyferret.get_axis_box_limits")
+    rect_corner_lons = numpy.empty((lo.shape[0] + 1), dtype=numpy.float64)
+    rect_corner_lons[0] = lo[0]
+    rect_corner_lons[1:] = hi
+
+    # Get the rectilinear corner latitudes
+    lo, hi = pyferret.get_axis_box_limits(efid, pyferret.ARG6, pyferret.Y_AXIS)
+    if not numpy.allclose(lo[1:], hi[:-1]):
+        raise ValueError("Unexpected ARG6 Y_AXIS box limit values " \
+                         "returned from pyferret.get_axis_box_limits")
+    rect_corner_lats = numpy.empty((lo.shape[0] + 1), dtype=numpy.float64)
+    rect_corner_lats[0] = lo[0]
+    rect_corner_lats[1:] = hi
+
+    # Get the rectilinear corner depths
+    lo, hi = pyferret.get_axis_box_limits(efid, pyferret.ARG6, pyferret.Z_AXIS)
+    if not numpy.allclose(lo[1:], hi[:-1]):
+        raise ValueError("Unexpected ARG6 Z_AXIS box limit values " \
+                         "returned from pyferret.get_axis_box_limits")
+    rect_corner_depths = numpy.empty((lo.shape[0] + 1), dtype=numpy.float64)
+    rect_corner_depths[0] = lo[0]
+    rect_corner_depths[1:] = hi
+
+    # Get the curvilinear data
+    curv_data = inputs[pyferret.ARG1]
+    if curv_data.shape[3:] != template_data.shape[3:]:
+        raise ValueError("Curvilinear data and template variable " \
+                         "must have same T, E, and F axes")
+    curv_undef = input_bdfs[pyferret.ARG1]
+
+    # Get the curvilinear centers arrays - squeeze removes the singleton axes
+    curv_center_lons  = inputs[pyferret.ARG2].squeeze()
+    curv_center_lats  = inputs[pyferret.ARG3].squeeze()
+    curv_center_baths = inputs[pyferret.ARG4].squeeze()
+    curv_centers_shape = curv_data.shape[:2]
+    if (curv_center_lons.shape  != curv_centers_shape) or \
+       (curv_center_lats.shape  != curv_centers_shape) or \
+       (curv_center_baths.shape != curv_centers_shape):
+        raise ValueError("Curvilinear data, longitude, latitudes, and " \
+                         "and bathymetry must have same X and Y axes")
+
+    # Squeeze should remove a singleton Z axis in zetas
+    curv_center_zetas = inputs[pyferret.ARG5].squeeze()
+    # If only one time step, squeeze would have also removed it.
+    # So if no time axis, put one in.
+    if len(curv_center_zetas.shape) == 2:
+        curv_center_zetas = curv_center_zetas[:,:,numpy.newaxis]
+    # Allow zeta to be omitted by giving a single-point array
+    if curv_center_zetas.shape == ():
+        curv_center_zetas = None
+    elif curv_center_zetas.shape != (curv_data.shape[0],
+                                     curv_data.shape[1],
+                                     curv_data.shape[3]):
+        raise ValueError("Curvilinear data and zetas " \
+                         "must have same X, Y, and T axes")
+
+    # Get the sigma values from the Z axis of curv_data
+    curv_center_sigmas = pyferret.get_axis_coordinates(efid,
+                                      pyferret.ARG1, pyferret.Z_AXIS)
+
+    curv_centers_shape = curv_data.shape[:3]
+    # Expand the sigmas to 3D (adding X and Y axes) to simplify
+    # calculation of curvilinear depths
+    curv_center_sigmas = numpy.repeat(curv_center_sigmas,
+                                      curv_centers_shape[0] * \
+                                      curv_centers_shape[1]) \
+                              .reshape(curv_centers_shape, order='F')
+    # Expand the curvilinear longitude, latitude, and bathymetry
+    # arrays to 3D (adding Z axis)
+    curv_center_lons = numpy.tile(curv_center_lons.flatten('F'),
+                                  curv_centers_shape[2]) \
+                            .reshape(curv_centers_shape, order='F')
+    curv_center_lats = numpy.tile(curv_center_lats.flatten('F'),
+                                  curv_centers_shape[2]) \
+                            .reshape(curv_centers_shape, order='F')
+    curv_center_baths = numpy.tile(curv_center_baths.flatten('F'),
+                                   curv_centers_shape[2]) \
+                             .reshape(curv_centers_shape, order='F')
+
+    # Make sure ESMP is, or has been, initialized
+    regrid.ESMPControl().startCheckESMP()
+
+    # Create the regridder used repeatedly in this function 
+    regridder3d = regrid.CurvRect3DRegridder()
+    last_rect_center_ignore = None
+
+    if curv_center_zetas == None:
+        # Create the curvilinear depths array
+        curv_center_depths = curv_center_sigmas * curv_center_baths
+        last_curv_center_ignore = None
+        
+    # Increment the time index last since zeta is time dependent
+    for t_idx in xrange(curv_data.shape[3]):
+
+        if curv_center_zetas != None:
+            # Expand the zetas for this time step to 3D - adding Z axis
+            zetas = numpy.tile(curv_center_zetas[:,:,t_idx].flatten('F'),
+                               curv_centers_shape[2]) \
+                         .reshape(curv_centers_shape, order='F')
+            # Create the curvilinear depths array
+            curv_center_depths = curv_center_sigmas * (curv_center_baths + \
+                                                       zetas) - zetas
+            # Different curvilinear depths, so need to recreate the curvilinear grid
+            last_curv_center_ignore = None
+
+        # Arrays are probably in Fortran order, so increment last indices last
+        for f_idx in xrange(curv_data.shape[5]):
+            for e_idx in xrange(curv_data.shape[4]):
+                # Determine curvilinear center points to ignore from undefined data
+                curv_center_ignore = ( numpy.abs(curv_data[:, :, :, t_idx,
+                                        e_idx, f_idx] - curv_undef) < 1.0E-7 )
+                # If mask has changed, need to recreate the curvilinear grid
+                if (last_curv_center_ignore is None) or \
+                   numpy.any(curv_center_ignore != last_curv_center_ignore):
+                    regridder3d.createCurvGrid(curv_center_lons, curv_center_lats,
+                                               curv_center_depths, curv_center_ignore,
+                                               True, None, None, None, None)
+                    last_curv_center_ignore = curv_center_ignore
+                # Determine rectilinear center points to ignore from undefined data
+                rect_center_ignore = ( numpy.abs(template_data[:, :, :, t_idx,
+                                        e_idx, f_idx] - template_undef) < 1.0E-7 )
+                # If mask has changed, need to recreate the rectilinear grid
+                if (last_rect_center_ignore is None) or \
+                   numpy.any(rect_center_ignore != last_rect_center_ignore):
+                    regridder3d.createRectGrid(rect_center_lons, rect_center_lats,
+                                               rect_center_depths, rect_center_ignore,
+                                               True,
+                                               rect_corner_lons, rect_corner_lats,
+                                               rect_corner_depths, None)
+                    last_rect_center_ignore = rect_center_ignore
+                # Assign the curvilinear data
+                regridder3d.assignCurvField(curv_data[:, :, :, t_idx, e_idx, f_idx])
+                # Allocate space for the rectilinear data from the regridding
+                regridder3d.assignRectField(None)
+                # Regrid and assign the rectilinear data to the results array
+                regrid_data = regridder3d.regridCurvToRect(result_bdf, method)
+                result[:, :, :, t_idx, e_idx, f_idx] = regrid_data
+
+    return
+
diff --git a/pyfermod/regrid/esmpcontrol.py b/pyfermod/regrid/esmpcontrol.py
new file mode 100644
index 0000000..649e710
--- /dev/null
+++ b/pyfermod/regrid/esmpcontrol.py
@@ -0,0 +1,103 @@
+'''
+Singleton class for starting and stopping ESMP (using ESMP.ESMP_Intialize
+and ESMP.ESMP_Finalize) once, and only once, in a Python session.
+
+ at author: Karl Smith
+'''
+
+import os
+import atexit
+import ESMP
+
+class ESMPControl(object):
+    '''
+    This singleton class and its pair of methods startCheckESMP
+    and stopESMP are designed to called ESMP.ESMP_Initialize and
+    ESMP.ESMP_Finalize once, and only once, in a Python session.
+
+    When ESMP is initialized in the first call to startCheckESMP,
+    stopESMP is registered with atexit to ensure ESMP is always
+    finalized prior to exiting Python.  If startCheckESMP was
+    called, and then stopESMP was called, any subsequent calls
+    to startCheckESMP will return False to prevent attempts to 
+    reinitialization.
+    '''
+
+    # The singleton instance for this class
+    __singleton = None
+
+    def __new__(cls):
+        '''
+        Returns the singleton instance of this class,
+        creating it if it does not already exist.
+        '''
+        # If this is the first call, create the singleton object 
+        # and initialize its attributes.
+        if cls.__singleton == None:
+            cls.__singleton = super(ESMPControl, cls).__new__(cls)
+            cls.__singleton.__esmp_initialized = False
+            cls.__singleton.__esmp_finalized = False
+        return cls.__singleton
+
+
+    def startCheckESMP(self):
+        '''
+        Calls ESMP.ESMP_Initialize and registers stopESMP with atexit
+        when called the first time.  Subsequent calls only return
+        whether or not ESMP is initialized.  Registering stopESMP with
+        atexit ensures the ESMP.ESMP_Finalize will always be called
+        prior to exiting Python.
+
+        Arguments:
+            None
+        Returns:
+            True  - if ESMP_Initialize has been called, either as a
+                    result of this call or from a previous call
+            False - if stopESMP has called ESMP_Finalize
+        '''
+        # Return False if attempting to re-initialize
+        if self.__esmp_finalized:
+            return False
+        # Call ESMP_Initialize if not already done previously 
+        if not self.__esmp_initialized:
+            ESMP.ESMP_Initialize()
+            atexit.register(self.stopESMP)
+            self.__esmp_initialized = True
+        # Return True if ESMP_Intialize had already or has now been called
+        return True
+
+
+    def stopESMP(self, delete_log=False):
+        '''
+        Calls ESMP.ESMP_Finalize if ESMP had been initialized using
+        startCheckESMP.  This function is registered with atexit
+        by startCheckESMP when it calls ESMP.ESMP_Initialize to
+        ensure ESMP.ESMP_Finalize is always called before exiting
+        Python.  However, this function can be called directly
+        (presumably to delete the log file) before exiting without
+        causing problems.
+
+        Arguments:
+            delete_log: if True, the ESMF log file 'PET0.ESMF_LogFile'
+                        will be deleted after ESMP.ESMP_Finalize is
+                        called.  Any failure to delete the log file
+                        is silently ignored.
+        Returns:
+            None
+        '''
+        # If ESMP not initialize, or already finalized, just return
+        if not self.__esmp_initialized:
+            return
+        if self.__esmp_finalized:
+            return
+        # Call ESMP_Finalize and set flags indicating this has been done
+        ESMP.ESMP_Finalize()
+        self.__esmp_initialized = False
+        self.__esmp_finalized = True
+        # Optionally delete the ESMF log file
+        if delete_log:
+            try:
+                os.remove('PET0.ESMF_LogFile')
+            except Exception:
+                pass
+
diff --git a/pyfermod/regrid/esmpcontroltests.py b/pyfermod/regrid/esmpcontroltests.py
new file mode 100644
index 0000000..f45bba3
--- /dev/null
+++ b/pyfermod/regrid/esmpcontroltests.py
@@ -0,0 +1,48 @@
+'''
+Tests of ESMPControl singleton class
+
+ at author: Karl Smith
+'''
+import unittest
+from esmpcontrol import ESMPControl
+
+
+class Test(unittest.TestCase):
+    '''
+    Tests of ESMPControl singleton class
+    '''
+
+
+    def test01ESMPControlNew(self):
+        '''
+        Test of ESMPControl constructor
+        '''
+        ctrl1 = ESMPControl()
+        ctrl2 = ESMPControl()
+        self.assertTrue(ctrl1 is ctrl2, "ESMPControl is not a singleton")
+
+
+    def test02ESMPControlStartStop(self):
+        '''
+        Test of ESMPControl.startCheckESMP
+        '''
+        ctrl = ESMPControl()
+        # calling stopESMP before calling startCheckESMP should not cause any problems
+        ctrl.stopESMP(False)
+        self.assertTrue(ctrl.startCheckESMP(),
+                        "First call to startCheckESMP did not return True")
+        self.assertTrue(ctrl.startCheckESMP(),
+                        "Second call to startCheckESMP did not return True")
+        ctrl.stopESMP(True)
+        self.assertFalse(ctrl.startCheckESMP(),
+                         "Call to startCheckESMP after stopESMP did not return False")
+        # another call to stopESMP should not cause any problems
+        ctrl.stopESMP(False)
+        # creating another instance should have no effect
+        ctrl2 = ESMPControl()
+        self.assertFalse(ctrl2.startCheckESMP(),
+                         "Call to startCheckESMP from a 'new' instance after stopESMP did not return False")
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/pyfermod/regrid/regrid2d.py b/pyfermod/regrid/regrid2d.py
new file mode 100644
index 0000000..fe24ae7
--- /dev/null
+++ b/pyfermod/regrid/regrid2d.py
@@ -0,0 +1,774 @@
+'''
+Regridder for converting data between a curvilinear longitude,
+latitude grid and a rectilinear longitude, latitude grid.
+Uses the ESMP interface to ESMF to perform the regridding.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import ESMP
+
+
+class CurvRectRegridder(object):
+    '''
+    Regridder for regridding data between a 2D curvilinear grid, where
+    the longitude and latitude of each grid corner and/or center point
+    is explicitly defined, and a 2D rectilinear grid, where the grid
+    corners are all intersections of a given set of strictly increasing
+    longitudes with a set of strictly increasing latitudes.
+
+    For these grids, the center point [i, j] is taken to be the center
+    point of the quadrilateral defined by connecting consecutive corner
+    points in the sequence (corner_pt[i, j], corner_pt[i+1, j],
+    corner_pt[i+1, j+1], corner_pt([i, j+1], corner_pt[i, j]).
+
+    Uses the ESMP interface to ESMF to perform the regridding.  Prior
+    to calling any instance methods in the CurvRectRegridder class, the
+    ESMP module must be imported and ESMP.ESMP_Initialize() must have
+    been called.  When a CurvRectRegridder instance is no longer needed,
+    the finalize method of the instance should be called to free ESMP
+    resources associated with the instance.  When ESMP is no longer
+    required, the ESMP.ESMP_Finalize() method should be called to free
+    all ESMP and ESMF resources.
+
+    See the ESMPControl singleton class to simplify initializing and
+    finalizing ESMP once, and only once, for a Python session.
+    '''
+
+
+    def __init__(self):
+        '''
+        Initializes to an empty regridder.  The ESMP module must be
+        imported and ESMP.ESMP_Initialize() called (possibly through
+        invoking ESMPControl().startCheckESMP()) prior to calling
+        any methods in this instance.
+        '''
+        # tuples giving the shape of the grid (defined by number of cells)
+        self.__curv_shape = None
+        self.__rect_shape = None
+        # ESMP_Grid objects describing the grids
+        self.__curv_grid = None
+        self.__rect_grid = None
+        # ESMP_Field objects providing the source or regridded data
+        self.__curv_dest_field = None
+        self.__curv_src_field = None
+        self.__rect_dest_field = None
+        self.__rect_src_field = None
+        # handles to regridding operations between the fields/grids
+        self.__curv_to_rect_handles = { }
+        self.__rect_to_curv_handles = { }
+
+
+    def createCurvGrid(self, center_lons, center_lats, center_ignore=None,
+                       corner_lons=None, corner_lats=None, corner_ignore=None):
+        '''
+        Create the curvilinear grid as an ESMP_Grid using the provided center
+        longitudes and latitudes as the grid center points, and, if given,
+        the grid corner longitudes and latitudes as the grid corner points.
+        Curvilinear data is assigned to the center points.  Grid point
+        coordinates are assigned as coord[i,j] = ( lons[i,j], lats[i,j] ).
+
+        For these grids, the center point [i, j] is taken to be the center
+        point of the quadrilateral defined by connecting consecutive corner
+        points in the sequence (corner_pt[i, j], corner_pt[i+1, j],
+        corner_pt[i+1, j+1], corner_pt([i ,j+1], corner_pt[i, j]).
+
+        Any previous ESMP_Grid, ESMP_Field, or ESMP regridding procedures
+        are destroyed.
+
+        Arguments:
+            center_lons:   2D array of longitudes, in degrees,
+                           for each of the curvilinear center points
+            center_lats:   2D array of latitudes, in degrees,
+                           for each of the curvilinear center points
+            center_ignore: 2D array of boolean-like values, indicating if
+                           the corresponding grid center point should be
+                           ignored in the regridding; if None, no grid
+                           center points will be ignored
+            corner_lons:   2D array of longitudes, in degrees,
+                           for each of the curvilinear corner points
+            corner_lats:   2D array of latitudes, in degrees,
+                           for each of the curvilinear corner points
+            corner_ignore: 2D array of boolean-like values, indicating if
+                           the corresponding grid corner point should be
+                           ignored in the regridding; if None, no grid
+                           corner points will be ignored
+        Returns:
+            None
+        Raises:
+            ValueError: if the shape (dimensionality) of an argument is
+                        invalid, or if a value in an argument is invalid
+            TypeError:  if an argument is not array-like
+        '''
+        # Make sure center_lons is an appropriate array-like argument
+        center_lons_array = numpy.array(center_lons, dtype=numpy.float64, copy=False)
+        if len(center_lons_array.shape) != 2:
+            raise ValueError("center_lons must be two-dimensional")
+
+        # Make sure center_lats is an appropriate array-like argument
+        center_lats_array = numpy.array(center_lats, dtype=numpy.float64, copy=False)
+        if center_lats_array.shape != center_lons_array.shape:
+            raise ValueError("center_lats and center_lons must have the same shape")
+
+        if center_ignore == None:
+            # Using all points, no mask created
+            center_ignore_array = None
+        else:
+            # Make sure ignore_pts is an appropriate array-like argument
+            center_ignore_array = numpy.array(center_ignore, dtype=numpy.bool, copy=False)
+            if center_ignore_array.shape != center_lons_array.shape:
+                raise ValueError("center_ignore and center_lons must have the same shape")
+            # If not actually ignoring any points, do not create a mask
+            if not center_ignore_array.any():
+                center_ignore_array = None
+
+        if (corner_lons != None) and (corner_lats != None):
+            # Corner points specified
+
+            # Make sure corner_lons is an appropriate array-like argument
+            corner_lons_array = numpy.array(corner_lons, dtype=numpy.float64, copy=False)
+            if corner_lons_array.shape != (center_lons_array.shape[0] + 1,
+                                           center_lons_array.shape[1] + 1):
+                raise ValueError("corner_lons must have one more point along " \
+                                 "each dimension when compared to center_lons")
+
+            # Make sure corner_lats is an appropriate array-like argument
+            corner_lats_array = numpy.array(corner_lats, dtype=numpy.float64, copy=False)
+            if corner_lats_array.shape != corner_lons_array.shape:
+                raise ValueError("corner_lats and corner_lons must have the same shape")
+
+            if corner_ignore == None:
+                # Using all points, no mask created
+                corner_ignore_array = None
+            else:
+                # Make sure ignore_pts is an appropriate array-like argument
+                corner_ignore_array = numpy.array(corner_ignore, dtype=numpy.bool, copy=False)
+                if corner_ignore_array.shape != corner_lons_array.shape:
+                    raise ValueError("corner_ignore and corner_lons must have the same shape")
+                # If not actually ignoring any points, do not create a mask
+                if not corner_ignore_array.any():
+                    corner_ignore_array = None
+
+        elif corner_lons != None:
+            raise ValueError("corner_lons given without corner_lats")
+        elif corner_lats != None:
+            raise ValueError("corner_lats given without corner_lons")
+        elif corner_ignore != None:
+            raise ValueError("corner_ignore given without corner_lons and corner_lats")
+        else:
+            # No corner points specified
+            corner_lats_array = None
+            corner_lons_array = None
+            corner_ignore_array = None
+
+        # If a centers mask is given and corner points are given, 
+        # but a corners mask is not given, create a mask ignoring 
+        # all corners around an ignored center
+        if (corner_ignore_array == None) and (corner_lons_array != None) \
+                and (center_ignore_array != None):
+            corner_ignore_array = numpy.zeros((center_ignore_array.shape[0]+1, 
+                                               center_ignore_array.shape[1]+1),
+                                              dtype=numpy.bool, order='F')
+            corner_ignore_array[:-1,:-1] = center_ignore_array
+            corner_ignore_array[1:,:-1] = numpy.logical_or(corner_ignore_array[1:,:-1], 
+                                                           center_ignore_array)
+            corner_ignore_array[1:,1:] = numpy.logical_or(corner_ignore_array[1:,1:], 
+                                                           center_ignore_array)
+            corner_ignore_array[:-1,1:] = numpy.logical_or(corner_ignore_array[:-1,1:], 
+                                                           center_ignore_array)
+
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any curvilinear ESMP_Fields
+        if self.__curv_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_src_field)
+            self.__curv_src_field = None
+        if self.__curv_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_dest_field)
+            self.__curv_dest_field = None
+        # Destroy any previous curvilinear ESMP_Grid
+        if self.__curv_grid != None:
+            ESMP.ESMP_GridDestroy(self.__curv_grid);
+            self.__curv_grid = None
+
+        # Create the curvilinear longitude, latitude ESMP_Grid using
+        # ESMP_GridCreateNoPeriDim for the typical case (not the
+        # whole world) in Ferret.
+        self.__curv_shape = center_lons_array.shape
+        grid_shape = numpy.array(self.__curv_shape, dtype=numpy.int32)
+        self.__curv_grid = ESMP.ESMP_GridCreateNoPeriDim(grid_shape,
+                                         ESMP.ESMP_COORDSYS_SPH_DEG,
+                                         ESMP.ESMP_TYPEKIND_R8)
+
+        if corner_lons_array != None:
+            # Allocate space for the grid corner coordinates
+            ESMP.ESMP_GridAddCoord(self.__curv_grid, ESMP.ESMP_STAGGERLOC_CORNER)
+
+            # Retrieve the grid corner coordinate arrays in the ESMP_Grid
+            grid_lon_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 0,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+            grid_lat_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 1,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+
+            # Assign the longitudes and latitudes of the grid corners in the ESMP_Grid
+            grid_lon_coords[:] = corner_lons_array.flatten('F')
+            grid_lat_coords[:] = corner_lats_array.flatten('F')
+
+            # Add a mask if not considering all the corner points
+            if corner_ignore_array != None:
+                # Allocate space for the grid corners mask
+                ESMP.ESMP_GridAddItem(self.__curv_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+                # Retrieve the grid corners mask array in the ESMP_Grid
+                ignore_mask = ESMP.ESMP_GridGetItem(self.__curv_grid,
+                                                    ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CORNER)
+                # Assign the mask in the ESMP_Grid; 
+                # False (turns into zero) means use the point;
+                # True (turns into one) means ignore the point
+                ignore_mask[:] = corner_ignore_array.flatten('F')
+
+        # Allocate space for the grid center coordinates
+        ESMP.ESMP_GridAddCoord(self.__curv_grid, ESMP.ESMP_STAGGERLOC_CENTER)
+
+        # Retrieve the grid center coordinate arrays in the ESMP_Grid
+        grid_lon_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 0,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+        grid_lat_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 1,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+
+        # Assign the longitudes and latitudes of the grid centers in the ESMP_Grid
+        grid_lon_coords[:] = center_lons_array.flatten('F')
+        grid_lat_coords[:] = center_lats_array.flatten('F')
+
+        # Add a mask if not considering all the center points
+        if center_ignore_array != None:
+            # Allocate space for the grid centers mask
+            ESMP.ESMP_GridAddItem(self.__curv_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+            # Retrieve the grid centers mask array in the ESMP_Grid
+            ignore_mask = ESMP.ESMP_GridGetItem(self.__curv_grid,
+                                                ESMP.ESMP_GRIDITEM_MASK,
+                                                ESMP.ESMP_STAGGERLOC_CENTER)
+            # Assign the mask in the ESMP_Grid; 
+            # False (turns into zero) means use the point;
+            # True (turns into one) means ignore the point
+            ignore_mask[:] = center_ignore_array.flatten('F')
+
+
+    def assignCurvField(self, data=None):
+        '''
+        Possibly creates, and possible assigns, an appropriate curvilinear
+        ESMP_Field located at the center points of the grid.  An ESMP_Field
+        is created if and only if it is not already present; thus allowing
+        the "weights" computed from a previous regridding to be reused.
+
+        If data is not None, assigns the data values to the curvilinear
+        source ESMP_Field, creating the ESMP_field if it does not exist.
+
+        If data is None, only creates the curvilinear destination ESMP_Field
+        if it does not exist.
+
+        Arguments:
+            data: 2D array of data values to be assigned in an
+                  ESMP_Field for the grid center points; if None,
+                  no data in any ESMP_Field is modified.
+        Returns:
+            None
+        Raises:
+            ValueError: if data is not None, and if the shape
+                        (dimensionality) of data is invalid or
+                        if a value in data is not numeric
+            TypeError:  if data, if not None, is not array-like
+        '''
+        if data == None:
+
+            # Create the curvilinear destination ESMP_Field if it does not exist
+            if self.__curv_dest_field == None:
+                self.__curv_dest_field = ESMP.ESMP_FieldCreateGrid(self.__curv_grid,
+                                                        "curv_dest_field",
+                                                        ESMP.ESMP_TYPEKIND_R8,
+                                                        ESMP.ESMP_STAGGERLOC_CENTER)
+
+        else:
+
+            # Make sure data is an appropriate array-like argument
+            data_array = numpy.array(data, dtype=numpy.float64, copy=True)
+            if data_array.shape != self.__curv_shape:
+                raise ValueError("data must have the same shape " \
+                                 "as the center points arrays")
+
+            # Create the curvilinear source ESMP_Field if it does not exist
+            if self.__curv_src_field == None:
+                self.__curv_src_field = ESMP.ESMP_FieldCreateGrid(self.__curv_grid,
+                                                       "curv_src_field",
+                                                       ESMP.ESMP_TYPEKIND_R8,
+                                                       ESMP.ESMP_STAGGERLOC_CENTER)
+
+            # Retrieve the field data array in the ESMP_Field
+            field_ptr = ESMP.ESMP_FieldGetPtr(self.__curv_src_field)
+
+            # Assign the data to the field array in the ESMP_Field
+            field_ptr[:] = data_array.flatten('F')
+
+
+    def createRectGrid(self, center_lons, center_lats, center_ignore= None,
+                       corner_lons=None, corner_lats=None, corner_ignore=None):
+        '''
+        Create the rectilinear grid as an ESMP_Grid using the provided center
+        longitudes and latitudes as the grid center points, and, if given,
+        the grid corner longitudes and latitudes as the grid corner points.
+        Rectilinear data is assigned to the center points.  Grid point
+        coordinates are assigned as coord[i,j] = ( lons[i], lats[j] ).
+
+        For these grids, the center point [i,j] is taken to be the center
+        point of the quadrilateral defined by connecting consecutive corner
+        points in the sequence ( corner_pt[i, j], corner_pt[i+1, j],
+        corner_pt[i+1, j+1], corner_pt([i, j+1], corner_pt[i, j] ).
+
+        Any previous ESMP_Grid, ESMP_Field, or ESMP regridding procedures
+        are destroyed.
+
+        Arguments:
+            center_lons:   1D array of longitudes, in degrees,
+                           for each of the rectilinear grid cells
+                           center planes
+            center_lats:   1D array of latitudes, in degrees,
+                           for each of the rectilinear grid cells
+                           center planes
+            center_ignore: 2D array of boolean-like values, indicating if
+                           the corresponding grid center point should be
+                           ignored in the regridding; if None, no grid
+                           center points will be ignored
+            corner_lons:   1D array of longitudes, in degrees,
+                           for each of the rectilinear grid cells
+                           corner planes
+            corner_lats:   1D array of latitudes, in degrees,
+                           for each of the rectilinear grid cells
+                           corner planes
+            corner_ignore: 2D array of boolean-like values, indicating if
+                           the corresponding grid corner point should be
+                           ignored in the regridding; if None, no grid
+                           corner points will be ignored
+        Returns:
+            None
+        Raises:
+            ValueError: if the shape (dimensionality) of an argument is
+                        invalid, or if a value in an argument is invalid
+            TypeError:  if an argument is not array-like
+        '''
+        # Make sure center_lons is an appropriate array-like argument
+        center_lons_array = numpy.array(center_lons, dtype=numpy.float64, copy=False)
+        if len(center_lons_array.shape) != 1:
+            raise ValueError("center_lons must be one-dimensional")
+
+        # Make sure center_lats is an appropriate array-like argument
+        center_lats_array = numpy.array(center_lats, dtype=numpy.float64, copy=True)
+        if len(center_lats_array.shape) != 1:
+            raise ValueError("center_lats must be one-dimensional")
+
+        if center_ignore == None:
+            # Using all center points, no mask created
+            center_ignore_array = None
+        else:
+            # Make sure center_ignore is an appropriate array-like argument
+            center_ignore_array = numpy.array(center_ignore, dtype=numpy.bool, copy=False)
+            if center_ignore_array.shape != (center_lons_array.shape[0],
+                                             center_lats_array.shape[0]):
+                raise ValueError("center_ignore must have the shape " \
+                                 "( len(center_lons), len(center_lats) )")
+            # If not actually ignoring any center points, do not create a mask
+            if not center_ignore_array.any():
+                center_ignore_array = None
+
+        if (corner_lons != None) and (corner_lats != None):
+            # Corner points specified
+
+            # Make sure corner_lons is an appropriate array-like argument
+            corner_lons_array = numpy.array(corner_lons, dtype=numpy.float64, copy=False)
+            if corner_lons_array.shape != (center_lons_array.shape[0] + 1, ):
+                raise ValueError("corner_lons must have shape ( len(center_lons) + 1, )")
+
+            # Make sure corner_lats is an appropriate array-like argument
+            corner_lats_array = numpy.array(corner_lats, dtype=numpy.float64, copy=True)
+            if corner_lats_array.shape != (center_lats_array.shape[0] + 1, ):
+                raise ValueError("corner_lats must have shape ( len(center_lats) + 1, )")
+
+            if corner_ignore == None:
+                # Using all corner points, no mask created
+                corner_ignore_array = None
+            else:
+                # Make sure corner_ignore is an appropriate array-like argument
+                corner_ignore_array = numpy.array(corner_ignore, dtype=numpy.bool, copy=False)
+                if corner_ignore_array.shape != (corner_lons_array.shape[0],
+                                                 corner_lats_array.shape[0]):
+                    raise ValueError("corner_ignore must have the shape " \
+                                     "( len(corner_lons), len(corner_lats) )")
+                # If not actually ignoring any points, do not create a mask
+                if not corner_ignore_array.any():
+                    corner_ignore_array = None
+
+        elif corner_lons != None:
+            raise ValueError("corner_lons given without corner_lats")
+        elif corner_lats != None:
+            raise ValueError("corner_lats given without corner_lons")
+        elif corner_ignore != None:
+            raise ValueError("corner_ignore given without corner_lons and corner_lats")
+        else:
+            # No corner points specified
+            corner_lats_array = None
+            corner_lons_array = None
+            corner_ignore_array = None
+
+        # If a centers mask is given and corner points are given, 
+        # but a corners mask is not given, create a mask ignoring 
+        # all corners around an ignored center
+        if (corner_ignore_array == None) and (corner_lons_array != None) \
+                and (center_ignore_array != None):
+            corner_ignore_array = numpy.zeros((center_ignore_array.shape[0]+1, 
+                                               center_ignore_array.shape[1]+1),
+                                              dtype=numpy.bool, order='F')
+            corner_ignore_array[:-1,:-1] = center_ignore_array
+            corner_ignore_array[1:,:-1] = numpy.logical_or(corner_ignore_array[1:,:-1], 
+                                                           center_ignore_array)
+            corner_ignore_array[1:,1:] = numpy.logical_or(corner_ignore_array[1:,1:], 
+                                                           center_ignore_array)
+            corner_ignore_array[:-1,1:] = numpy.logical_or(corner_ignore_array[:-1,1:], 
+                                                           center_ignore_array)
+
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any rectilinear ESMP_Fields
+        if self.__rect_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_src_field)
+            self.__rect_src_field = None
+        if self.__rect_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_dest_field)
+            self.__rect_dest_field = None
+        # Destroy any previous rectilinear ESMP_Grid
+        if self.__rect_grid != None:
+            ESMP.ESMP_GridDestroy(self.__rect_grid);
+            self.__rect_grid = None
+
+        # Create the rectilinear longitude, latitude grid using
+        # ESMP_GridCreateNoPeriDim for the typical case (not the
+        # whole world) in Ferret.
+        self.__rect_shape = (center_lons_array.shape[0],
+                             center_lats_array.shape[0])
+        grid_shape = numpy.array(self.__rect_shape, dtype=numpy.int32)
+        self.__rect_grid = ESMP.ESMP_GridCreateNoPeriDim(grid_shape,
+                                         ESMP.ESMP_COORDSYS_SPH_DEG,
+                                         ESMP.ESMP_TYPEKIND_R8)
+
+        if corner_lons_array != None:
+            # Allocate space for the grid corner coordinates
+            ESMP.ESMP_GridAddCoord(self.__rect_grid, ESMP.ESMP_STAGGERLOC_CORNER)
+
+            # Retrieve the grid corner coordinate arrays in the ESMP_Grid
+            grid_lon_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 0,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+            grid_lat_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 1,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+
+            # Assign the longitudes and latitudes of the grid corners in the ESMP_Grid
+            # numpy.tile([a,b,c], 2) = [a,b,c,a,b,c]
+            grid_lon_coords[:] = numpy.tile(corner_lons_array, corner_lats_array.shape[0])
+            # numpy.repeat([a,b,c], 2) = [a,a,b,b,c,c]
+            grid_lat_coords[:] = numpy.repeat(corner_lats_array, corner_lons_array.shape[0])
+
+            # Add a mask if not considering all the corner points
+            if corner_ignore_array != None:
+                # Allocate space for the grid corners mask
+                ESMP.ESMP_GridAddItem(self.__rect_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER)
+                # Retrieve the grid corners mask array in the ESMP_Grid
+                ignore_mask = ESMP.ESMP_GridGetItem(self.__rect_grid,
+                                                    ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CORNER)
+                # Assign the mask in the ESMP_Grid; 
+                # False (turns into zero) means use the point;
+                # True (turns into one) means ignore the point;
+                # flatten in column-major (F) order to match lon-lat assignment order
+                ignore_mask[:] = corner_ignore_array.flatten('F')
+
+        # Allocate space for the grid center coordinates
+        ESMP.ESMP_GridAddCoord(self.__rect_grid, ESMP.ESMP_STAGGERLOC_CENTER)
+
+        # Retrieve the grid corner coordinate arrays in the ESMP_Grid
+        grid_lon_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 0,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+        grid_lat_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 1,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+
+        # Assign the longitudes and latitudes of the grid centers in the ESMP_Grid
+        # numpy.tile([a,b,c], 2) = [a,b,c,a,b,c]
+        grid_lon_coords[:] = numpy.tile(center_lons_array, center_lats_array.shape[0])
+        # numpy.repeat([a,b,c], 2) = [a,a,b,b,c,c]
+        grid_lat_coords[:] = numpy.repeat(center_lats_array, center_lons_array.shape[0])
+
+        # Add a mask if not considering all the center points
+        if center_ignore_array != None:
+            # Allocate space for the grid centers mask
+            ESMP.ESMP_GridAddItem(self.__rect_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER)
+            # Retrieve the grid centers mask array in the ESMP_Grid
+            ignore_mask = ESMP.ESMP_GridGetItem(self.__rect_grid,
+                                                ESMP.ESMP_GRIDITEM_MASK,
+                                                ESMP.ESMP_STAGGERLOC_CENTER)
+            # Assign the mask in the ESMP_Grid; 
+            # False (turns into zero) means use the point;
+            # True (turns into one) means ignore the point;
+            # flatten in column-major (F) order to match lon-lat assignment order
+            ignore_mask[:] = center_ignore_array.flatten('F')
+
+
+    def assignRectField(self, data=None):
+        '''
+        Possibly creates, and possible assigns, an appropriate rectilinear
+        ESMP_Field located at the center points of the grid.  An ESMP_Field
+        is created if and only if it is not already present; thus allowing
+        the "weights" computed from a previous regridding to be reused.
+
+        If data is not None, assigns the data values to the rectilinear
+        source ESMP_Field, creating the ESMP_field if it does not exist.
+
+        If data is None, only creates the rectilinear destination ESMP_Field
+        if it does not exist.
+
+        Arguments:
+            data: 2D array of data values to be assigned in an
+                  ESMP_Field for the grid center points; if None,
+                  no data in any ESMP_Field is modified.
+        Returns:
+            None
+        Raises:
+            ValueError: if data is not None, and if the shape
+                        (dimensionality) of data is invalid or
+                        if a value in data is not numeric
+            TypeError:  if data, if not None, is not array-like
+        '''
+        if data == None:
+
+            # Create the rectilinear destination ESMP_Field if it does not exist
+            if self.__rect_dest_field == None:
+                self.__rect_dest_field = ESMP.ESMP_FieldCreateGrid(self.__rect_grid,
+                                                        "rect_dest_field",
+                                                        ESMP.ESMP_TYPEKIND_R8,
+                                                        ESMP.ESMP_STAGGERLOC_CENTER)
+
+        else:
+
+            # Make sure data is an appropriate array-like argument
+            data_array = numpy.array(data, dtype=numpy.float64, copy=True)
+            if len(data_array.shape) != 2:
+                raise ValueError("data must be two-dimensional")
+            if data_array.shape != self.__rect_shape:
+                raise ValueError("data must have the same shape " \
+                                 "as the center points arrays")
+
+            # Create the rectilinear source ESMP_Field if it does not exist
+            if self.__rect_src_field == None:
+                self.__rect_src_field = ESMP.ESMP_FieldCreateGrid(self.__rect_grid,
+                                                       "rect_src_field",
+                                                       ESMP.ESMP_TYPEKIND_R8,
+                                                       ESMP.ESMP_STAGGERLOC_CENTER)
+
+            # Retrieve the field data array in the ESMP_Field
+            field_ptr = ESMP.ESMP_FieldGetPtr(self.__rect_src_field)
+
+            # Assign the data to the field array in the ESMP_Field
+            field_ptr[:] = data_array.flatten('F')
+
+
+    def regridCurvToRect(self, undef_val,
+                         method=ESMP.ESMP_REGRIDMETHOD_BILINEAR):
+        '''
+        Regrids from the curvilinear source ESMP_Field to the rectilinear
+        destination ESMP_Field using the given regridding method.  Reuses
+        the appropriate regridding procedure if one already exists;
+        otherwise a new regridding procedure is created and stored.
+
+        Prior to calling this method, the curvilinear source ESMP_Field
+        must be created by calling createCurvGrid, then assignCurvField
+        with valid data.  The rectilinear destination ESMP_Field must
+        also have been created by calling createRectGrid, and then
+        assignRectField with no data argument (or None for data).
+
+        Arguments:
+            undef_val: numpy array containing one numeric value to
+                       be used as the undefined data value in the
+                       returned array
+            method:    one of the ESMP regridding method identifiers,
+                       such as:
+                           ESMP.ESMP_REGRIDMETHOD_BILINEAR
+                           ESMP.ESMP_REGRIDMETHOD_CONSERVE
+                           ESMP.ESMP_REGRIDMETHOD_PATCH
+                       Conservative regridding requires that both
+                       corner and center point coordinates are
+                       defined in the grids.
+        Returns:
+            data: a 2D numpy array of data values located at the rectilinear
+                  grid centers representing the regridded curvilinear
+                  ESMP_Field data.  The undefined data value will be
+                  assigned to unassigned data points.
+        Raises:
+            ValueError: if either the curvilinear source ESMP_Field or
+                        the rectilinear destination ESMP_Field does not
+                        exist.
+        '''
+        # Check that the source and destination fields exist
+        if self.__curv_src_field == None:
+            raise ValueError("Curvilinear source ESMP_Field does not exist")
+        if self.__rect_dest_field == None:
+            raise ValueError("Rectilinear destination ESMP_Field does not exist")
+        # Check if a regrid procedure handle already exists for this method
+        handle = self.__curv_to_rect_handles.get(method, None)
+        # If no handle found, create one
+        if handle == None:
+            # Assign the value in the masks marking points to be ignored
+            ignore_mask_value = numpy.array([1], dtype=numpy.int32)
+            # Generate the procedure handle
+            handle = ESMP.ESMP_FieldRegridStore(self.__curv_src_field,
+                                                self.__rect_dest_field,
+                                                ignore_mask_value, ignore_mask_value,
+                                                method, ESMP.ESMP_UNMAPPEDACTION_IGNORE)
+            # Save the handle for this method for future regrids
+            self.__curv_to_rect_handles[method] = handle
+        # Initialize the destination field values with the undefined data value
+        field_ptr = ESMP.ESMP_FieldGetPtr(self.__rect_dest_field)
+        field_ptr[:] = undef_val
+        # Perform the regridding, zeroing out only the 
+        # destination fields values that will be assigned
+        ESMP.ESMP_FieldRegrid(self.__curv_src_field, self.__rect_dest_field,
+                              handle, ESMP.ESMP_REGION_SELECT)
+        # Make a copy of the destination field values to return, reshaped to 2D
+        result = numpy.array(field_ptr, dtype=numpy.float64, copy=True)
+        result = result.reshape(self.__rect_shape, order='F')
+
+        return result
+
+
+    def regridRectToCurv(self, undef_val,
+                         method=ESMP.ESMP_REGRIDMETHOD_BILINEAR):
+        '''
+        Regrids from the rectilinear source ESMP_Field to the curvilinear
+        destination ESMP_Field using the given regridding method.  Reuses
+        the appropriate regridding procedure if one already exists;
+        otherwise a new regridding procedure is created and stored.
+
+        Prior to calling this method, the rectilinear source ESMP_Field
+        must be created by calling createRectGrid, then assignRectField
+        with valid data.  The curvilinear destination ESMP_Field must
+        also have been created by calling createCurvGrid, and then
+        assignCurvField with no data argument (or None for data).
+
+        Arguments:
+            undef_val: numpy array containing one numeric value to
+                       be used as the undefined data value in the
+                       returned array
+            method:    one of the ESMP regridding method identifiers,
+                       such as:
+                           ESMP.ESMP_REGRIDMETHOD_BILINEAR
+                           ESMP.ESMP_REGRIDMETHOD_CONSERVE
+                           ESMP.ESMP_REGRIDMETHOD_PATCH
+                       Conservative regridding requires that both
+                       corner and center point coordinates are
+                       defined in the grids.
+        Returns:
+            data: a 2D array of data values located at the curvilinear
+                  grid centers representing the regridded rectilinear
+                  ESMP_Field data.  The undefined data value will be
+                  assigned to unassigned data points.
+        Raises:
+            ValueError: if either the rectilinear source ESMP_Field or
+                        the curvilinear destination ESMP_Field does not
+                        exist.
+        '''
+        # Check that the source and destination fields exist
+        if self.__rect_src_field == None:
+            raise ValueError("Rectilinear source ESMP_Field does not exist")
+        if self.__curv_dest_field == None:
+            raise ValueError("Curvilinear destination ESMP_Field does not exist")
+        # Check if a regrid procedure handle already exists for this method
+        handle = self.__rect_to_curv_handles.get(method, None)
+        # If no handle found, create one
+        if handle == None:
+            # Assign the value in the masks marking points to be ignored
+            ignore_mask_value = numpy.array([1], dtype=numpy.int32)
+            # Generate the procedure handle
+            handle = ESMP.ESMP_FieldRegridStore(self.__rect_src_field,
+                                                self.__curv_dest_field,
+                                                ignore_mask_value, ignore_mask_value,
+                                                method, ESMP.ESMP_UNMAPPEDACTION_IGNORE)
+            # Save the handle for this method for future regrids
+            self.__rect_to_curv_handles[method] = handle
+        # Initialize the destination field values with the undefined data value
+        field_ptr = ESMP.ESMP_FieldGetPtr(self.__curv_dest_field)
+        field_ptr[:] = undef_val
+        # Perform the regridding, zeroing out only the 
+        # destination fields values that will be assigned
+        ESMP.ESMP_FieldRegrid(self.__rect_src_field, self.__curv_dest_field,
+                              handle, ESMP.ESMP_REGION_SELECT)
+        # Make a copy of the destination field values to return, reshaped to 2D
+        result = numpy.array(field_ptr, dtype=numpy.float64, copy=True)
+        result = result.reshape(self.__curv_shape, order='F')
+
+        return result
+
+
+    def finalize(self):
+        '''
+        Destroys any ESMP_Grid, ESMP_Field, and ESMP regridding
+        procedures present in this instance.  If ESMP is no longer
+        needed, ESMP.ESMP_Finalize() (possibly by invoking
+        ESMPControl().stopESMP()) should be called to free any
+        ESMP and ESMF resources.
+
+        Arguments:
+            None
+        Returns:
+            None
+        '''
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any ESMP_Fields
+        if self.__rect_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_src_field)
+            self.__rect_src_field = None
+        if self.__rect_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_dest_field)
+            self.__rect_dest_field = None
+        if self.__curv_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_src_field)
+            self.__curv_src_field = None
+        if self.__curv_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_dest_field)
+            self.__curv_dest_field = None
+        # Destroy any ESMP_Grids
+        if self.__rect_grid != None:
+            ESMP.ESMP_GridDestroy(self.__rect_grid);
+            self.__rect_grid = None
+        if self.__curv_grid != None:
+            ESMP.ESMP_GridDestroy(self.__curv_grid);
+            self.__curv_grid = None
+        # clear the shape attributes just to be complete
+        self.__rect_shape = None
+        self.__curv_shape = None
+
+
diff --git a/pyfermod/regrid/regrid2dexample.py b/pyfermod/regrid/regrid2dexample.py
new file mode 100644
index 0000000..21e9589
--- /dev/null
+++ b/pyfermod/regrid/regrid2dexample.py
@@ -0,0 +1,954 @@
+'''
+A Python program for testing the regrid2d.CurvRectRegridder class "by hand"
+and also serves as a coding example of using this class.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import ESMP
+from esmpcontrol import ESMPControl
+from regrid2d import CurvRectRegridder
+
+
+def createExampleCurvData():
+    '''
+    Creates and returns example longitude, latitudes, and data for a curvilinear
+    grid.  Uses the GFDL tripolar grid.  Assigns grid center point data[i,j]
+        = cos(lon[i,j]) * cos(3.6 * (lat[i,j] - 65.0)) for areas over ocean,
+        = 1.0E20 for areas over land.
+
+    Arguments:
+        None
+    Returns:
+        (corner_lons, corner_lats, center_lons, center_lats, data) where:
+        corner_lons: numpy 2D array of curvilinear corner point longitude coordinates
+        corner_lats: numpy 2D array of curvilinear corner point latitude coordinates
+        center_lons: numpy 2D array of curvilinear center point longitude coordinates
+        center_lats: numpy 2D array of curvilinear center point latitude coordinates
+        data:        numpy 2D array of curvilinear center point data values
+    '''
+    # longitude centerpoints for the GFDL tripolar grid in the region 20W:20E, 65N:85N
+    corner_lons = numpy.array( (
+        ( -20.500, -19.500, -18.500, -17.500, -16.500, -15.500, -14.500, -13.500, -12.500, -11.500,
+          -10.500,  -9.500,  -8.500,  -7.500,  -6.500,  -5.500,  -4.500,  -3.500,  -2.500,  -1.500,
+           -0.500,   0.500,   1.500,   2.500,   3.500,   4.500,   5.500,   6.500,   7.500,   8.500,
+            9.500,  10.500,  11.500,  12.500,  13.500,  14.500,  15.500,  16.500,  17.500,  18.500,
+           19.500,  20.500, ),
+        ( -20.502, -19.502, -18.502, -17.502, -16.501, -15.501, -14.501, -13.501, -12.501, -11.500,
+          -10.500,  -9.500,  -8.500,  -7.499,  -6.499,  -5.499,  -4.499,  -3.499,  -2.498,  -1.498,
+           -0.498,   0.502,   1.502,   2.503,   3.503,   4.503,   5.503,   6.503,   7.504,   8.504,
+            9.504,  10.504,  11.504,  12.504,  13.505,  14.505,  15.505,  16.505,  17.505,  18.505,
+           19.505,  20.505, ),
+        ( -20.521, -19.519, -18.517, -17.515, -16.513, -15.511, -14.509, -13.507, -12.505, -11.503,
+          -10.501,  -9.499,  -8.497,  -7.495,  -6.493,  -5.491,  -4.489,  -3.487,  -2.485,  -1.483,
+           -0.481,   0.521,   1.523,   2.525,   3.526,   4.528,   5.530,   6.532,   7.533,   8.535,
+            9.537,  10.538,  11.540,  12.541,  13.543,  14.544,  15.545,  16.547,  17.548,  18.549,
+           19.550,  20.551, ),
+        ( -20.560, -19.555, -18.549, -17.544, -16.538, -15.532, -14.526, -13.521, -12.515, -11.509,
+          -10.503,  -9.497,  -8.491,  -7.485,  -6.479,  -5.474,  -4.468,  -3.462,  -2.456,  -1.451,
+           -0.445,   0.560,   1.566,   2.571,   3.577,   4.582,   5.587,   6.592,   7.597,   8.601,
+            9.606,  10.611,  11.615,  12.619,  13.623,  14.627,  15.631,  16.634,  17.638,  18.641,
+           19.644,  20.647, ),
+        ( -20.624, -19.612, -18.601, -17.589, -16.578, -15.566, -14.554, -13.542, -12.530, -11.518,
+          -10.506,  -9.494,  -8.482,  -7.470,  -6.458,  -5.446,  -4.434,  -3.422,  -2.411,  -1.399,
+           -0.388,   0.624,   1.635,   2.646,   3.657,   4.667,   5.678,   6.688,   7.698,   8.707,
+            9.717,  10.726,  11.735,  12.744,  13.752,  14.760,  15.768,  16.775,  17.782,  18.789,
+           19.795,  20.801, ),
+        ( -20.714, -19.694, -18.674, -17.654, -16.634, -15.614, -14.593, -13.573, -12.552, -11.531,
+          -10.510,  -9.490,  -8.469,  -7.448,  -6.427,  -5.407,  -4.386,  -3.366,  -2.346,  -1.326,
+           -0.306,   0.714,   1.733,   2.752,   3.771,   4.789,   5.807,   6.824,   7.842,   8.858,
+            9.875,  10.890,  11.906,  12.921,  13.935,  14.949,  15.962,  16.975,  17.987,  18.998,
+           20.009,  21.019, ),
+        ( -20.835, -19.804, -18.773, -17.742, -16.710, -15.678, -14.646, -13.614, -12.581, -11.549,
+          -10.516,  -9.484,  -8.451,  -7.419,  -6.386,  -5.354,  -4.322,  -3.290,  -2.258,  -1.227,
+           -0.196,   0.835,   1.865,   2.894,   3.924,   4.952,   5.980,   7.008,   8.035,   9.061,
+           10.086,  11.111,  12.135,  13.158,  14.180,  15.202,  16.222,  17.242,  18.260,  19.278,
+           20.295,  21.311, ),
+        ( -20.991, -19.946, -18.901, -17.855, -16.809, -15.762, -14.715, -13.667, -12.620, -11.572,
+          -10.524,  -9.476,  -8.428,  -7.380,  -6.333,  -5.285,  -4.238,  -3.191,  -2.145,  -1.099,
+           -0.054,   0.991,   2.036,   3.079,   4.122,   5.164,   6.205,   7.245,   8.284,   9.322,
+           10.360,  11.396,  12.430,  13.464,  14.497,  15.528,  16.558,  17.586,  18.613,  19.639,
+           20.663,  21.686, ),
+        ( -21.190, -20.127, -19.063, -17.999, -16.933, -15.868, -14.802, -13.735, -12.668, -11.601,
+          -10.534,  -9.466,  -8.399,  -7.332,  -6.265,  -5.198,  -4.132,  -3.067,  -2.001,  -0.937,
+            0.127,   1.190,   2.251,   3.312,   4.372,   5.431,   6.488,   7.545,   8.599,   9.653,
+           10.704,  11.755,  12.803,  13.850,  14.895,  15.939,  16.980,  18.019,  19.057,  20.093,
+           21.126,  22.158, ),
+        ( -21.437, -20.351, -19.265, -18.177, -17.089, -16.000, -14.910, -13.819, -12.728, -11.637,
+          -10.546,  -9.454,  -8.363,  -7.272,  -6.181,  -5.090,  -4.000,  -2.911,  -1.823,  -0.735,
+            0.351,   1.437,   2.521,   3.603,   4.684,   5.764,   6.841,   7.917,   8.991,  10.063,
+           11.133,  12.200,  13.266,  14.329,  15.389,  16.447,  17.503,  18.555,  19.605,  20.653,
+           21.697,  22.739, ),
+        ( -21.741, -20.629, -19.514, -18.398, -17.281, -16.163, -15.044, -13.924, -12.803, -11.682,
+          -10.561,  -9.439,  -8.318,  -7.197,  -6.076,  -4.956,  -3.837,  -2.719,  -1.602,  -0.486,
+            0.629,   1.741,   2.852,   3.962,   5.069,   6.173,   7.276,   8.376,   9.473,  10.567,
+           11.659,  12.748,  13.833,  14.915,  15.994,  17.070,  18.142,  19.211,  20.276,  21.337,
+           22.394,  23.448, ),
+        ( -22.116, -20.969, -19.821, -18.670, -17.518, -16.364, -15.208, -14.052, -12.895, -11.737,
+          -10.579,  -9.421,  -8.263,  -7.105,  -5.948,  -4.792,  -3.636,  -2.482,  -1.330,  -0.179,
+            0.969,   2.116,   3.260,   4.401,   5.540,   6.675,   7.808,   8.937,  10.062,  11.184,
+           12.301,  13.415,  14.525,  15.630,  16.731,  17.827,  18.919,  20.006,  21.088,  22.165,
+           23.237,  24.304, ),
+        ( -22.574, -21.387, -20.196, -19.003, -17.808, -16.610, -15.411, -14.210, -13.008, -11.805,
+          -10.602,  -9.398,  -8.195,  -6.992,  -5.790,  -4.589,  -3.390,  -2.192,  -0.997,   0.196,
+            1.387,   2.574,   3.758,   4.939,   6.116,   7.288,   8.457,   9.621,  10.780,  11.934,
+           13.083,  14.226,  15.364,  16.496,  17.623,  18.743,  19.857,  20.965,  22.067,  23.162,
+           24.251,  25.333, ),
+        ( -23.136, -21.899, -20.657, -19.412, -18.164, -16.913, -15.659, -14.404, -13.147, -11.888,
+          -10.630,  -9.370,  -8.112,  -6.853,  -5.596,  -4.341,  -3.087,  -1.836,  -0.588,   0.657,
+            1.899,   3.136,   4.369,   5.597,   6.820,   8.037,   9.249,  10.454,  11.653,  12.846,
+           14.031,  15.210,  16.381,  17.544,  18.700,  19.848,  20.988,  22.120,  23.244,  24.359,
+           25.466,  26.564, ),
+        ( -23.827, -22.529, -21.225, -19.917, -18.604, -17.287, -15.966, -14.643, -13.318, -11.992,
+          -10.664,  -9.336,  -8.008,  -6.682,  -5.357,  -4.034,  -2.713,  -1.396,  -0.083,   1.225,
+            2.529,   3.827,   5.119,   6.404,   7.683,   8.954,  10.217,  11.472,  12.719,  13.956,
+           15.185,  16.404,  17.613,  18.813,  20.002,  21.181,  22.350,  23.508,  24.655,  25.792,
+           26.918,  28.033, ),
+        ( -24.681, -23.309, -21.929, -20.542, -19.149, -17.751, -16.348, -14.941, -13.532, -12.120,
+          -10.707,  -9.293,  -7.880,  -6.468,  -5.059,  -3.652,  -2.249,  -0.851,   0.542,   1.929,
+            3.309,   4.681,   6.045,   7.400,   8.746,  10.081,  11.406,  12.720,  14.023,  15.313,
+           16.591,  17.857,  19.110,  20.350,  21.577,  22.790,  23.990,  25.176,  26.348,  27.507,
+           28.652,  29.783, ),
+        ( -25.747, -24.284, -22.810, -21.326, -19.834, -18.334, -16.828, -15.316, -13.800, -12.281,
+          -10.761,  -9.239,  -7.719,  -6.200,  -4.684,  -3.172,  -1.666,  -0.166,   1.326,   2.810,
+            4.284,   5.747,   7.199,   8.639,  10.065,  11.478,  12.876,  14.259,  15.627,  16.979,
+           18.314,  19.633,  20.934,  22.219,  23.486,  24.735,  25.967,  27.182,  28.379,  29.559,
+           30.721,  31.866, ),
+        ( -27.094, -25.518, -23.927, -22.322, -20.705, -19.077, -17.440, -15.795, -14.143, -12.488,
+          -10.830,  -9.170,  -7.512,  -5.857,  -4.205,  -2.560,  -0.923,   0.705,   2.322,   3.927,
+            5.518,   7.094,   8.653,  10.196,  11.720,  13.224,  14.709,  16.174,  17.617,  19.038,
+           20.437,  21.814,  23.168,  24.500,  25.809,  27.095,  28.359,  29.600,  30.819,  32.015,
+           33.190,  34.344, ),
+        ( -28.821, -27.106, -25.368, -23.610, -21.834, -20.042, -18.235, -16.418, -14.591, -12.757,
+          -10.919,  -9.081,  -7.243,  -5.409,  -3.582,  -1.765,   0.042,   1.834,   3.610,   5.368,
+            7.106,   8.821,  10.514,  12.181,  13.822,  15.436,  17.022,  18.579,  20.107,  21.605,
+           23.074,  24.512,  25.920,  27.298,  28.647,  29.966,  31.256,  32.518,  33.751,  34.957,
+           36.136,  37.289, ),
+        ( -31.083, -29.193, -27.269, -25.315, -23.333, -21.326, -19.298, -17.251, -15.189, -13.118,
+          -11.040,  -8.960,  -6.882,  -4.811,  -2.749,  -0.702,   1.326,   3.333,   5.315,   7.269,
+            9.193,  11.083,  12.939,  14.757,  16.538,  18.279,  19.980,  21.640,  23.260,  24.838,
+           26.376,  27.874,  29.331,  30.749,  32.129,  33.470,  34.775,  36.044,  37.278,  38.478,
+           39.646,  40.781, ),
+        ( -34.122, -32.014, -29.854, -27.645, -25.391, -23.096, -20.766, -18.406, -16.022, -13.620,
+          -11.208,  -8.792,  -6.380,  -3.978,  -1.594,   0.766,   3.096,   5.391,   7.645,   9.854,
+           12.014,  14.122,  16.176,  18.175,  20.115,  21.998,  23.823,  25.590,  27.299,  28.952,
+           30.549,  32.092,  33.583,  35.022,  36.412,  37.754,  39.050,  40.302,  41.512,  42.681,
+           43.812,  44.906, ),
+        ( -38.339, -35.964, -33.503, -30.961, -28.342, -25.652, -22.899, -20.092, -17.240, -14.357,
+          -11.455,  -8.545,  -5.643,  -2.760,   0.092,   2.899,   5.652,   8.342,  10.961,  13.503,
+           15.964,  18.339,  20.626,  22.826,  24.938,  26.963,  28.903,  30.759,  32.536,  34.234,
+           35.859,  37.412,  38.898,  40.319,  41.679,  42.980,  44.227,  45.423,  46.569,  47.669,
+           48.725,  49.740, ),
+      ), dtype=numpy.float64)
+
+    # latitude centerpoints for the GFDL tripolar grid in the region 20W:20E, 65N:85N
+    corner_lats = numpy.array( (
+        ( 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500,
+          64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500,
+          64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500,
+          64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500, 64.500,
+          64.500, 64.500, ),
+        ( 65.492, 65.493, 65.495, 65.496, 65.497, 65.498, 65.498, 65.499, 65.500, 65.500,
+          65.500, 65.500, 65.500, 65.500, 65.499, 65.498, 65.498, 65.497, 65.496, 65.495,
+          65.493, 65.492, 65.490, 65.488, 65.486, 65.484, 65.482, 65.480, 65.477, 65.474,
+          65.472, 65.469, 65.466, 65.462, 65.459, 65.455, 65.452, 65.448, 65.444, 65.440,
+          65.436, 65.431, ),
+        ( 66.476, 66.480, 66.484, 66.488, 66.491, 66.493, 66.495, 66.497, 66.499, 66.499,
+          66.500, 66.500, 66.499, 66.499, 66.497, 66.495, 66.493, 66.491, 66.488, 66.484,
+          66.480, 66.476, 66.471, 66.465, 66.460, 66.453, 66.447, 66.440, 66.432, 66.424,
+          66.416, 66.407, 66.398, 66.389, 66.379, 66.368, 66.357, 66.346, 66.334, 66.322,
+          66.310, 66.297, ),
+        ( 67.460, 67.467, 67.474, 67.479, 67.485, 67.489, 67.493, 67.496, 67.498, 67.499,
+          67.500, 67.500, 67.499, 67.498, 67.496, 67.493, 67.489, 67.485, 67.479, 67.474,
+          67.467, 67.460, 67.452, 67.443, 67.434, 67.424, 67.413, 67.401, 67.389, 67.376,
+          67.362, 67.348, 67.333, 67.317, 67.301, 67.283, 67.266, 67.247, 67.228, 67.208,
+          67.188, 67.167, ),
+        ( 68.445, 68.455, 68.464, 68.472, 68.479, 68.485, 68.490, 68.494, 68.497, 68.499,
+          68.500, 68.500, 68.499, 68.497, 68.494, 68.490, 68.485, 68.479, 68.472, 68.464,
+          68.455, 68.445, 68.434, 68.421, 68.408, 68.394, 68.379, 68.364, 68.347, 68.329,
+          68.310, 68.290, 68.269, 68.247, 68.225, 68.201, 68.176, 68.151, 68.124, 68.097,
+          68.068, 68.039, ),
+        ( 69.430, 69.442, 69.454, 69.464, 69.473, 69.481, 69.487, 69.492, 69.496, 69.499,
+          69.500, 69.500, 69.499, 69.496, 69.492, 69.487, 69.481, 69.473, 69.464, 69.454,
+          69.442, 69.430, 69.416, 69.400, 69.384, 69.366, 69.347, 69.327, 69.305, 69.282,
+          69.258, 69.233, 69.206, 69.179, 69.150, 69.120, 69.088, 69.056, 69.022, 68.987,
+          68.951, 68.914, ),
+        ( 70.415, 70.430, 70.444, 70.456, 70.467, 70.477, 70.484, 70.491, 70.495, 70.498,
+          70.500, 70.500, 70.498, 70.495, 70.491, 70.484, 70.477, 70.467, 70.456, 70.444,
+          70.430, 70.415, 70.398, 70.379, 70.359, 70.338, 70.315, 70.290, 70.264, 70.236,
+          70.207, 70.177, 70.145, 70.111, 70.076, 70.039, 70.002, 69.962, 69.921, 69.879,
+          69.835, 69.790, ),
+        ( 71.400, 71.418, 71.434, 71.449, 71.462, 71.473, 71.482, 71.489, 71.494, 71.498,
+          71.500, 71.500, 71.498, 71.494, 71.489, 71.482, 71.473, 71.462, 71.449, 71.434,
+          71.418, 71.400, 71.380, 71.358, 71.335, 71.310, 71.282, 71.254, 71.223, 71.191,
+          71.156, 71.121, 71.083, 71.044, 71.002, 70.960, 70.915, 70.869, 70.821, 70.771,
+          70.720, 70.667, ),
+        ( 72.385, 72.406, 72.425, 72.441, 72.456, 72.468, 72.479, 72.487, 72.493, 72.498,
+          72.500, 72.500, 72.498, 72.493, 72.487, 72.479, 72.468, 72.456, 72.441, 72.425,
+          72.406, 72.385, 72.362, 72.337, 72.310, 72.281, 72.250, 72.217, 72.182, 72.145,
+          72.105, 72.064, 72.021, 71.976, 71.928, 71.879, 71.828, 71.775, 71.720, 71.663,
+          71.604, 71.543, ),
+        ( 73.370, 73.393, 73.415, 73.434, 73.450, 73.464, 73.476, 73.486, 73.493, 73.497,
+          73.500, 73.500, 73.497, 73.493, 73.486, 73.476, 73.464, 73.450, 73.434, 73.415,
+          73.393, 73.370, 73.344, 73.316, 73.285, 73.252, 73.217, 73.179, 73.140, 73.098,
+          73.053, 73.007, 72.958, 72.907, 72.853, 72.798, 72.740, 72.680, 72.618, 72.553,
+          72.487, 72.418, ),
+        ( 74.354, 74.380, 74.404, 74.425, 74.444, 74.460, 74.473, 74.484, 74.492, 74.497,
+          74.500, 74.500, 74.497, 74.492, 74.484, 74.473, 74.460, 74.444, 74.425, 74.404,
+          74.380, 74.354, 74.325, 74.293, 74.259, 74.222, 74.183, 74.141, 74.096, 74.049,
+          74.000, 73.947, 73.893, 73.835, 73.776, 73.714, 73.649, 73.582, 73.512, 73.441,
+          73.366, 73.290, ),
+        ( 75.337, 75.367, 75.393, 75.417, 75.438, 75.455, 75.470, 75.482, 75.491, 75.497,
+          75.500, 75.500, 75.497, 75.491, 75.482, 75.470, 75.455, 75.438, 75.417, 75.393,
+          75.367, 75.337, 75.305, 75.270, 75.232, 75.191, 75.147, 75.100, 75.051, 74.998,
+          74.943, 74.885, 74.825, 74.761, 74.695, 74.626, 74.554, 74.480, 74.403, 74.323,
+          74.241, 74.156, ),
+        ( 76.320, 76.352, 76.382, 76.408, 76.431, 76.450, 76.467, 76.480, 76.490, 76.496,
+          76.500, 76.500, 76.496, 76.490, 76.480, 76.467, 76.450, 76.431, 76.408, 76.382,
+          76.352, 76.320, 76.284, 76.245, 76.203, 76.157, 76.109, 76.057, 76.002, 75.944,
+          75.883, 75.819, 75.752, 75.682, 75.609, 75.533, 75.454, 75.372, 75.288, 75.200,
+          75.109, 75.016, ),
+        ( 77.300, 77.336, 77.369, 77.398, 77.423, 77.445, 77.463, 77.478, 77.489, 77.496,
+          77.500, 77.500, 77.496, 77.489, 77.478, 77.463, 77.445, 77.423, 77.398, 77.369,
+          77.336, 77.300, 77.261, 77.218, 77.171, 77.121, 77.067, 77.010, 76.950, 76.886,
+          76.819, 76.748, 76.674, 76.597, 76.517, 76.433, 76.347, 76.257, 76.164, 76.068,
+          75.968, 75.866, ),
+        ( 78.279, 78.319, 78.355, 78.387, 78.415, 78.439, 78.459, 78.475, 78.487, 78.495,
+          78.499, 78.499, 78.495, 78.487, 78.475, 78.459, 78.439, 78.415, 78.387, 78.355,
+          78.319, 78.279, 78.235, 78.187, 78.136, 78.080, 78.021, 77.958, 77.892, 77.821,
+          77.747, 77.670, 77.589, 77.504, 77.416, 77.324, 77.229, 77.131, 77.029, 76.924,
+          76.816, 76.704, ),
+        ( 79.254, 79.299, 79.339, 79.374, 79.405, 79.432, 79.455, 79.473, 79.486, 79.495,
+          79.499, 79.499, 79.495, 79.486, 79.473, 79.455, 79.432, 79.405, 79.374, 79.339,
+          79.299, 79.254, 79.206, 79.153, 79.096, 79.035, 78.969, 78.900, 78.826, 78.749,
+          78.667, 78.582, 78.493, 78.400, 78.303, 78.203, 78.099, 77.991, 77.880, 77.766,
+          77.648, 77.526, ),
+        ( 80.226, 80.275, 80.320, 80.359, 80.394, 80.424, 80.449, 80.469, 80.484, 80.494,
+          80.499, 80.499, 80.494, 80.484, 80.469, 80.449, 80.424, 80.394, 80.359, 80.320,
+          80.275, 80.226, 80.172, 80.113, 80.050, 79.982, 79.909, 79.832, 79.751, 79.666,
+          79.576, 79.482, 79.384, 79.282, 79.175, 79.066, 78.952, 78.834, 78.713, 78.588,
+          78.459, 78.327, ),
+        ( 81.192, 81.247, 81.297, 81.342, 81.381, 81.415, 81.443, 81.465, 81.482, 81.494,
+          81.499, 81.499, 81.494, 81.482, 81.465, 81.443, 81.415, 81.381, 81.342, 81.297,
+          81.247, 81.192, 81.131, 81.066, 80.995, 80.919, 80.838, 80.753, 80.663, 80.568,
+          80.469, 80.365, 80.257, 80.144, 80.028, 79.907, 79.782, 79.654, 79.521, 79.385,
+          79.245, 79.102, ),
+        ( 82.150, 82.213, 82.269, 82.320, 82.364, 82.403, 82.435, 82.460, 82.480, 82.493,
+          82.499, 82.499, 82.493, 82.480, 82.460, 82.435, 82.403, 82.364, 82.320, 82.269,
+          82.213, 82.150, 82.082, 82.008, 81.928, 81.843, 81.753, 81.657, 81.556, 81.451,
+          81.341, 81.226, 81.106, 80.982, 80.854, 80.721, 80.584, 80.444, 80.299, 80.151,
+          79.999, 79.843, ),
+        ( 83.097, 83.169, 83.234, 83.292, 83.343, 83.387, 83.424, 83.454, 83.477, 83.492,
+          83.499, 83.499, 83.492, 83.477, 83.454, 83.424, 83.387, 83.343, 83.292, 83.234,
+          83.169, 83.097, 83.019, 82.935, 82.845, 82.748, 82.646, 82.539, 82.426, 82.307,
+          82.184, 82.056, 81.923, 81.786, 81.644, 81.499, 81.349, 81.195, 81.037, 80.875,
+          80.710, 80.541, ),
+        ( 84.028, 84.111, 84.187, 84.255, 84.315, 84.367, 84.411, 84.446, 84.472, 84.490,
+          84.499, 84.499, 84.490, 84.472, 84.446, 84.411, 84.367, 84.315, 84.255, 84.187,
+          84.111, 84.028, 83.937, 83.840, 83.736, 83.626, 83.510, 83.388, 83.260, 83.127,
+          82.989, 82.845, 82.698, 82.545, 82.389, 82.228, 82.064, 81.895, 81.723, 81.547,
+          81.368, 81.186, ),
+        ( 84.932, 85.031, 85.121, 85.203, 85.275, 85.338, 85.391, 85.434, 85.466, 85.488,
+          85.499, 85.499, 85.488, 85.466, 85.434, 85.391, 85.338, 85.275, 85.203, 85.121,
+          85.031, 84.932, 84.826, 84.712, 84.591, 84.464, 84.330, 84.190, 84.044, 83.894,
+          83.738, 83.578, 83.413, 83.244, 83.071, 82.894, 82.714, 82.530, 82.343, 82.153,
+          81.959, 81.763, ),
+      ), dtype=numpy.float64)
+
+    # longitude centerpoints for the GFDL tripolar grid in the region 20W:20E, 65N:85N
+    center_lons = numpy.array( (
+        ( -20.000, -19.000, -18.000, -17.000, -16.000, -15.000, -14.000, -13.000, -12.000, -11.000,
+          -10.000,  -9.000,  -8.000,  -7.000,  -6.000,  -5.000,  -4.000,  -3.000,  -2.000,  -1.000,
+            0.000,   1.000,   2.000,   3.000,   4.000,   5.000,   6.000,   7.000,   8.000,   9.000,
+           10.000,  11.000,  12.000,  13.000,  14.000,  15.000,  16.000,  17.000,  18.000,  19.000,
+           20.000, ),
+        ( -20.009, -19.008, -18.007, -17.006, -16.005, -15.004, -14.004, -13.003, -12.002, -11.001,
+          -10.000,  -8.999,  -7.998,  -6.997,  -5.996,  -4.996,  -3.995,  -2.994,  -1.993,  -0.992,
+            0.009,   1.010,   2.010,   3.011,   4.012,   5.013,   6.013,   7.014,   8.015,   9.016,
+           10.016,  11.017,  12.018,  13.018,  14.019,  15.019,  16.020,  17.021,  18.021,  19.022,
+           20.022, ),
+        ( -20.036, -19.033, -18.029, -17.026, -16.022, -15.018, -14.015, -13.011, -12.007, -11.004,
+          -10.000,  -8.996,  -7.993,  -6.989,  -5.985,  -4.982,  -3.978,  -2.974,  -1.971,  -0.967,
+            0.036,   1.040,   2.043,   3.046,   4.050,   5.053,   6.056,   7.059,   8.062,   9.065,
+           10.068,  11.071,  12.073,  13.076,  14.078,  15.081,  16.083,  17.085,  18.088,  19.090,
+           20.091, ),
+        ( -20.085, -19.077, -18.068, -17.060, -16.052, -15.043, -14.035, -13.026, -12.017, -11.009,
+          -10.000,  -8.991,  -7.983,  -6.974,  -5.965,  -4.957,  -3.948,  -2.940,  -1.932,  -0.923,
+            0.085,   1.093,   2.101,   3.109,   4.116,   5.124,   6.131,   7.139,   8.146,   9.153,
+           10.159,  11.166,  12.172,  13.178,  14.184,  15.190,  16.195,  17.200,  18.205,  19.210,
+           20.214, ),
+        ( -20.158, -19.142, -18.127, -17.111, -16.096, -15.080, -14.064, -13.048, -12.032, -11.016,
+          -10.000,  -8.984,  -7.968,  -6.952,  -5.936,  -4.920,  -3.904,  -2.889,  -1.873,  -0.858,
+            0.158,   1.173,   2.187,   3.202,   4.216,   5.230,   6.244,   7.257,   8.270,   9.283,
+           10.296,  11.308,  12.319,  13.331,  14.342,  15.352,  16.362,  17.372,  18.381,  19.389,
+           20.397, ),
+        ( -20.258, -19.233, -18.208, -17.182, -16.157, -15.131, -14.105, -13.079, -12.053, -11.026,
+          -10.000,  -8.974,  -7.947,  -6.921,  -5.895,  -4.869,  -3.843,  -2.818,  -1.792,  -0.767,
+            0.258,   1.282,   2.306,   3.330,   4.354,   5.376,   6.399,   7.421,   8.442,   9.463,
+           10.483,  11.503,  12.522,  13.540,  14.558,  15.575,  16.591,  17.607,  18.622,  19.636,
+           20.649, ),
+        ( -20.390, -19.352, -18.314, -17.276, -16.237, -15.198, -14.159, -13.119, -12.080, -11.040,
+          -10.000,  -8.960,  -7.920,  -6.881,  -5.841,  -4.802,  -3.763,  -2.724,  -1.686,  -0.648,
+            0.390,   1.427,   2.463,   3.499,   4.534,   5.569,   6.603,   7.636,   8.668,   9.699,
+           10.730,  11.759,  12.788,  13.815,  14.842,  15.868,  16.892,  17.915,  18.937,  19.958,
+           20.978, ),
+        ( -20.558, -19.505, -18.450, -17.395, -16.340, -15.284, -14.227, -13.171, -12.114, -11.057,
+          -10.000,  -8.943,  -7.886,  -6.829,  -5.773,  -4.716,  -3.660,  -2.605,  -1.550,  -0.495,
+            0.558,   1.611,   2.663,   3.715,   4.765,   5.814,   6.863,   7.910,   8.956,  10.001,
+           11.044,  12.086,  13.127,  14.166,  15.204,  16.240,  17.274,  18.307,  19.338,  20.368,
+           21.396, ),
+        ( -20.770, -19.696, -18.621, -17.545, -16.469, -15.392, -14.314, -13.236, -12.157, -11.079,
+          -10.000,  -8.921,  -7.843,  -6.764,  -5.686,  -4.608,  -3.531,  -2.455,  -1.379,  -0.304,
+            0.770,   1.843,   2.915,   3.985,   5.054,   6.122,   7.188,   8.253,   9.316,  10.377,
+           11.437,  12.494,  13.550,  14.603,  15.655,  16.704,  17.751,  18.796,  19.838,  20.878,
+           21.916, ),
+        ( -21.032, -19.933, -18.833, -17.731, -16.629, -15.525, -14.421, -13.316, -12.211, -11.106,
+          -10.000,  -8.894,  -7.789,  -6.684,  -5.579,  -4.475,  -3.371,  -2.269,  -1.167,  -0.067,
+            1.032,   2.130,   3.226,   4.320,   5.412,   6.503,   7.591,   8.677,   9.761,  10.843,
+           11.922,  12.998,  14.072,  15.142,  16.210,  17.275,  18.337,  19.396,  20.451,  21.504,
+           22.553, ),
+        ( -21.355, -20.225, -19.094, -17.961, -16.826, -15.690, -14.553, -13.416, -12.278, -11.139,
+          -10.000,  -8.861,  -7.722,  -6.584,  -5.447,  -4.310,  -3.174,  -2.039,  -0.906,   0.225,
+            1.355,   2.483,   3.608,   4.732,   5.852,   6.970,   8.086,   9.198,  10.307,  11.413,
+           12.515,  13.614,  14.709,  15.801,  16.888,  17.972,  19.051,  20.126,  21.197,  22.264,
+           23.327, ),
+        ( -21.751, -20.583, -19.414, -18.242, -17.068, -15.893, -14.716, -13.538, -12.359, -11.180,
+          -10.000,  -8.820,  -7.641,  -6.462,  -5.284,  -4.107,  -2.932,  -1.758,  -0.586,   0.583,
+            1.751,   2.915,   4.077,   5.235,   6.390,   7.542,   8.689,   9.833,  10.972,  12.107,
+           13.238,  14.363,  15.484,  16.600,  17.710,  18.815,  19.915,  21.010,  22.098,  23.181,
+           24.259, ),
+        ( -22.236, -21.023, -19.806, -18.587, -17.365, -16.141, -14.915, -13.688, -12.459, -11.230,
+          -10.000,  -8.770,  -7.541,  -6.312,  -5.085,  -3.859,  -2.635,  -1.413,  -0.194,   1.023,
+            2.236,   3.445,   4.650,   5.851,   7.048,   8.239,   9.426,  10.607,  11.782,  12.951,
+           14.115,  15.272,  16.423,  17.567,  18.704,  19.834,  20.957,  22.073,  23.182,  24.283,
+           25.377, ),
+        ( -22.831, -21.562, -20.289, -19.012, -17.731, -16.448, -15.161, -13.873, -12.583, -11.292,
+          -10.000,  -8.708,  -7.417,  -6.127,  -4.839,  -3.552,  -2.269,  -0.988,   0.289,   1.562,
+            2.831,   4.094,   5.353,   6.605,   7.851,   9.091,  10.324,  11.550,  12.768,  13.978,
+           15.180,  16.374,  17.559,  18.735,  19.903,  21.062,  22.211,  23.351,  24.481,  25.602,
+           26.714, ),
+        ( -23.565, -22.228, -20.886, -19.537, -18.184, -16.827, -15.466, -14.102, -12.736, -11.368,
+          -10.000,  -8.632,  -7.264,  -5.898,  -4.534,  -3.173,  -1.816,  -0.463,   0.886,   2.228,
+            3.565,   4.895,   6.217,   7.532,   8.838,  10.136,  11.424,  12.702,  13.970,  15.228,
+           16.475,  17.711,  18.936,  20.149,  21.351,  22.541,  23.719,  24.885,  26.038,  27.180,
+           28.310, ),
+        ( -24.477, -23.057, -21.629, -20.193, -18.749, -17.300, -15.846, -14.388, -12.927, -11.464,
+          -10.000,  -8.536,  -7.073,  -5.612,  -4.154,  -2.700,  -1.251,   0.193,   1.629,   3.057,
+            4.477,   5.888,   7.289,   8.678,  10.057,  11.423,  12.777,  14.117,  15.444,  16.757,
+           18.056,  19.340,  20.609,  21.864,  23.102,  24.326,  25.534,  26.727,  27.904,  29.066,
+           30.212, ),
+        ( -25.623, -24.100, -22.565, -21.019, -19.464, -17.899, -16.328, -14.751, -13.170, -11.586,
+          -10.000,  -8.414,  -6.830,  -5.249,  -3.672,  -2.100,  -0.536,   1.019,   2.565,   4.100,
+            5.623,   7.133,   8.629,  10.110,  11.575,  13.023,  14.454,  15.868,  17.262,  18.638,
+           19.995,  21.333,  22.650,  23.948,  25.226,  26.484,  27.723,  28.941,  30.140,  31.319,
+           32.479, ),
+        ( -27.083, -25.432, -23.764, -22.079, -20.381, -18.670, -16.949, -15.219, -13.483, -11.743,
+          -10.000,  -8.257,  -6.517,  -4.781,  -3.051,  -1.330,   0.381,   2.079,   3.764,   5.432,
+            7.083,   8.716,  10.328,  11.919,  13.488,  15.033,  16.554,  18.051,  19.523,  20.969,
+           22.390,  23.784,  25.152,  26.495,  27.811,  29.102,  30.367,  31.607,  32.822,  34.012,
+           35.179, ),
+        ( -28.977, -27.166, -25.328, -23.467, -21.584, -19.683, -17.766, -15.836, -13.896, -11.950,
+          -10.000,  -8.050,  -6.104,  -4.164,  -2.234,  -0.317,   1.584,   3.467,   5.328,   7.166,
+            8.977,  10.762,  12.516,  14.240,  15.932,  17.591,  19.215,  20.806,  22.362,  23.883,
+           25.369,  26.820,  28.237,  29.619,  30.968,  32.284,  33.568,  34.819,  36.040,  37.231,
+           38.392, ),
+        ( -31.494, -29.480, -27.425, -25.334, -23.210, -21.056, -18.876, -16.676, -14.459, -12.232,
+          -10.000,  -7.768,  -5.541,  -3.324,  -1.124,   1.056,   3.210,   5.334,   7.425,   9.480,
+           11.494,  13.466,  15.394,  17.275,  19.110,  20.897,  22.635,  24.325,  25.966,  27.560,
+           29.106,  30.606,  32.060,  33.470,  34.837,  36.162,  37.446,  38.691,  39.898,  41.069,
+           42.204, ),
+        ( -34.940, -32.671, -30.337, -27.943, -25.493, -22.993, -20.449, -17.869, -15.262, -12.636,
+          -10.000,  -7.364,  -4.738,  -2.131,   0.449,   2.993,   5.493,   7.943,  10.337,  12.671,
+           14.940,  17.141,  19.274,  21.336,  23.327,  25.247,  27.098,  28.879,  30.594,  32.242,
+           33.828,  35.352,  36.817,  38.226,  39.581,  40.884,  42.138,  43.344,  44.506,  45.626,
+           46.705, ),
+      ), dtype=numpy.float64)
+
+    # latitude centerpoints for the GFDL tripolar grid in the region 20W:20E, 65N:85N
+    center_lats = numpy.array( (
+        ( 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000,
+          65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000,
+          65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000,
+          65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000, 65.000,
+          65.000, ),
+        ( 65.985, 65.988, 65.990, 65.993, 65.995, 65.996, 65.998, 65.999, 65.999, 66.000,
+          66.000, 66.000, 65.999, 65.999, 65.998, 65.996, 65.995, 65.993, 65.990, 65.988,
+          65.985, 65.982, 65.979, 65.975, 65.971, 65.967, 65.962, 65.957, 65.952, 65.946,
+          65.941, 65.935, 65.928, 65.922, 65.915, 65.908, 65.900, 65.893, 65.885, 65.877,
+          65.868, ),
+        ( 66.971, 66.976, 66.981, 66.986, 66.989, 66.993, 66.995, 66.997, 66.999, 67.000,
+          67.000, 67.000, 66.999, 66.997, 66.995, 66.993, 66.989, 66.986, 66.981, 66.976,
+          66.971, 66.964, 66.958, 66.950, 66.943, 66.934, 66.925, 66.915, 66.905, 66.895,
+          66.883, 66.871, 66.859, 66.846, 66.833, 66.818, 66.804, 66.789, 66.773, 66.757,
+          66.740, ),
+        ( 67.957, 67.965, 67.972, 67.979, 67.984, 67.989, 67.993, 67.996, 67.998, 68.000,
+          68.000, 68.000, 67.998, 67.996, 67.993, 67.989, 67.984, 67.979, 67.972, 67.965,
+          67.957, 67.948, 67.938, 67.927, 67.915, 67.903, 67.889, 67.875, 67.860, 67.844,
+          67.827, 67.810, 67.791, 67.772, 67.752, 67.731, 67.710, 67.687, 67.664, 67.640,
+          67.615, ),
+        ( 68.943, 68.954, 68.963, 68.972, 68.979, 68.986, 68.991, 68.995, 68.998, 68.999,
+          69.000, 68.999, 68.998, 68.995, 68.991, 68.986, 68.979, 68.972, 68.963, 68.954,
+          68.943, 68.931, 68.918, 68.904, 68.888, 68.872, 68.854, 68.835, 68.816, 68.795,
+          68.773, 68.750, 68.725, 68.700, 68.674, 68.646, 68.618, 68.588, 68.557, 68.526,
+          68.493, ),
+        ( 69.929, 69.943, 69.955, 69.965, 69.975, 69.982, 69.989, 69.994, 69.997, 69.999,
+          70.000, 69.999, 69.997, 69.994, 69.989, 69.982, 69.975, 69.965, 69.955, 69.943,
+          69.929, 69.915, 69.898, 69.881, 69.862, 69.841, 69.820, 69.797, 69.772, 69.746,
+          69.719, 69.690, 69.660, 69.629, 69.596, 69.562, 69.527, 69.490, 69.452, 69.413,
+          69.373, ),
+        ( 70.916, 70.932, 70.946, 70.959, 70.970, 70.979, 70.987, 70.992, 70.997, 70.999,
+          71.000, 70.999, 70.997, 70.992, 70.987, 70.979, 70.970, 70.959, 70.946, 70.932,
+          70.916, 70.898, 70.879, 70.858, 70.836, 70.811, 70.785, 70.758, 70.729, 70.698,
+          70.665, 70.631, 70.596, 70.558, 70.520, 70.479, 70.437, 70.393, 70.348, 70.302,
+          70.253, ),
+        ( 71.902, 71.921, 71.938, 71.952, 71.965, 71.976, 71.984, 71.991, 71.996, 71.999,
+          72.000, 71.999, 71.996, 71.991, 71.984, 71.976, 71.965, 71.952, 71.938, 71.921,
+          71.902, 71.882, 71.860, 71.835, 71.809, 71.781, 71.751, 71.719, 71.685, 71.650,
+          71.612, 71.572, 71.531, 71.488, 71.443, 71.396, 71.347, 71.297, 71.244, 71.190,
+          71.134, ),
+        ( 72.889, 72.910, 72.929, 72.945, 72.960, 72.972, 72.982, 72.990, 72.996, 72.999,
+          73.000, 72.999, 72.996, 72.990, 72.982, 72.972, 72.960, 72.945, 72.929, 72.910,
+          72.889, 72.866, 72.840, 72.812, 72.783, 72.750, 72.716, 72.680, 72.641, 72.601,
+          72.558, 72.513, 72.466, 72.416, 72.365, 72.312, 72.256, 72.199, 72.139, 72.077,
+          72.014, ),
+        ( 73.875, 73.899, 73.920, 73.939, 73.955, 73.969, 73.980, 73.989, 73.995, 73.999,
+          74.000, 73.999, 73.995, 73.989, 73.980, 73.969, 73.955, 73.939, 73.920, 73.899,
+          73.875, 73.849, 73.820, 73.789, 73.755, 73.719, 73.681, 73.640, 73.596, 73.550,
+          73.502, 73.452, 73.399, 73.343, 73.286, 73.226, 73.163, 73.099, 73.032, 72.962,
+          72.891, ),
+        ( 74.860, 74.887, 74.910, 74.931, 74.950, 74.965, 74.978, 74.987, 74.994, 74.999,
+          75.000, 74.999, 74.994, 74.987, 74.978, 74.965, 74.950, 74.931, 74.910, 74.887,
+          74.860, 74.831, 74.799, 74.764, 74.727, 74.686, 74.643, 74.598, 74.549, 74.498,
+          74.445, 74.388, 74.329, 74.268, 74.203, 74.137, 74.067, 73.995, 73.921, 73.844,
+          73.764, ),
+        ( 75.845, 75.874, 75.900, 75.924, 75.944, 75.961, 75.975, 75.986, 75.994, 75.998,
+          76.000, 75.998, 75.994, 75.986, 75.975, 75.961, 75.944, 75.924, 75.900, 75.874,
+          75.845, 75.812, 75.777, 75.738, 75.696, 75.652, 75.604, 75.553, 75.500, 75.443,
+          75.384, 75.321, 75.256, 75.188, 75.117, 75.043, 74.966, 74.887, 74.805, 74.720,
+          74.632, ),
+        ( 76.828, 76.860, 76.890, 76.915, 76.938, 76.957, 76.972, 76.984, 76.993, 76.998,
+          77.000, 76.998, 76.993, 76.984, 76.972, 76.957, 76.938, 76.915, 76.890, 76.860,
+          76.828, 76.792, 76.752, 76.710, 76.664, 76.614, 76.562, 76.506, 76.447, 76.384,
+          76.319, 76.250, 76.178, 76.103, 76.025, 75.943, 75.859, 75.772, 75.681, 75.588,
+          75.492, ),
+        ( 77.809, 77.845, 77.878, 77.906, 77.931, 77.952, 77.969, 77.983, 77.992, 77.998,
+          78.000, 77.998, 77.992, 77.983, 77.969, 77.952, 77.931, 77.906, 77.878, 77.845,
+          77.809, 77.769, 77.726, 77.679, 77.628, 77.573, 77.515, 77.454, 77.388, 77.320,
+          77.247, 77.172, 77.093, 77.010, 76.924, 76.835, 76.743, 76.647, 76.548, 76.446,
+          76.341, ),
+        ( 78.788, 78.828, 78.864, 78.896, 78.924, 78.947, 78.966, 78.981, 78.991, 78.998,
+          79.000, 78.998, 78.991, 78.981, 78.966, 78.947, 78.924, 78.896, 78.864, 78.828,
+          78.788, 78.744, 78.696, 78.644, 78.588, 78.528, 78.464, 78.395, 78.324, 78.248,
+          78.168, 78.085, 77.998, 77.908, 77.814, 77.716, 77.615, 77.510, 77.402, 77.291,
+          77.176, ),
+        ( 79.765, 79.809, 79.849, 79.884, 79.915, 79.941, 79.962, 79.979, 79.991, 79.998,
+          80.000, 79.998, 79.991, 79.979, 79.962, 79.941, 79.915, 79.884, 79.849, 79.809,
+          79.765, 79.716, 79.662, 79.604, 79.542, 79.475, 79.404, 79.329, 79.250, 79.166,
+          79.079, 78.987, 78.892, 78.793, 78.690, 78.583, 78.472, 78.358, 78.240, 78.118,
+          77.993, ),
+        ( 80.736, 80.786, 80.831, 80.870, 80.904, 80.934, 80.957, 80.976, 80.989, 80.997,
+          81.000, 80.997, 80.989, 80.976, 80.957, 80.934, 80.904, 80.870, 80.831, 80.786,
+          80.736, 80.682, 80.622, 80.558, 80.488, 80.414, 80.335, 80.252, 80.164, 80.072,
+          79.976, 79.875, 79.770, 79.661, 79.547, 79.430, 79.309, 79.184, 79.056, 78.923,
+          78.788, ),
+        ( 81.702, 81.758, 81.808, 81.853, 81.892, 81.925, 81.952, 81.973, 81.988, 81.997,
+          82.000, 81.997, 81.988, 81.973, 81.952, 81.925, 81.892, 81.853, 81.808, 81.758,
+          81.702, 81.641, 81.574, 81.501, 81.424, 81.341, 81.253, 81.160, 81.063, 80.960,
+          80.854, 80.742, 80.626, 80.506, 80.382, 80.253, 80.121, 79.984, 79.844, 79.700,
+          79.552, ),
+        ( 82.660, 82.723, 82.781, 82.831, 82.876, 82.914, 82.945, 82.969, 82.986, 82.997,
+          83.000, 82.997, 82.986, 82.969, 82.945, 82.914, 82.876, 82.831, 82.781, 82.723,
+          82.660, 82.590, 82.514, 82.432, 82.344, 82.251, 82.152, 82.049, 81.939, 81.825,
+          81.706, 81.583, 81.455, 81.322, 81.185, 81.044, 80.899, 80.750, 80.597, 80.440,
+          80.280, ),
+        ( 83.604, 83.678, 83.744, 83.803, 83.855, 83.899, 83.935, 83.963, 83.984, 83.996,
+          84.000, 83.996, 83.984, 83.963, 83.935, 83.899, 83.855, 83.803, 83.744, 83.678,
+          83.604, 83.524, 83.437, 83.343, 83.243, 83.138, 83.026, 82.909, 82.786, 82.658,
+          82.525, 82.387, 82.245, 82.098, 81.947, 81.792, 81.633, 81.470, 81.303, 81.133,
+          80.959, ),
+        ( 84.530, 84.617, 84.695, 84.765, 84.826, 84.879, 84.922, 84.956, 84.980, 84.995,
+          85.000, 84.995, 84.980, 84.956, 84.922, 84.879, 84.826, 84.765, 84.695, 84.617,
+          84.530, 84.436, 84.335, 84.226, 84.111, 83.989, 83.862, 83.728, 83.589, 83.445,
+          83.296, 83.142, 82.984, 82.822, 82.655, 82.485, 82.310, 82.133, 81.951, 81.767,
+          81.579, ),
+      ), dtype=numpy.float64)
+
+    # model salinity data at the center points of the GFDL tripolar grid in the region 20W:20E, 65N:85N
+    # used here only for the land mask (values set to 1.0E20)
+    salt_center_data = numpy.array( (
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 34.775, 34.895, 35.043,
+          35.134, 35.151, 35.142, 35.128, 35.118, 35.100, 35.085, 35.097, 35.124, 35.151,
+          35.173, 35.195, 35.223, 35.254, 35.283, 35.285, 35.258, 35.227, 35.192, 35.157,
+          35.125, 35.069, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 34.499, 34.611, 34.769,
+          34.864, 34.890, 34.921, 34.959, 34.981, 34.992, 35.018, 35.064, 35.115, 35.150,
+          35.170, 35.183, 35.201, 35.228, 35.256, 35.268, 35.261, 35.248, 35.226, 35.185,
+          35.129, 35.061, 34.990, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 33.520, 33.618, 33.716, 33.803, 33.887, 33.986, 34.135, 34.307, 34.478, 34.638,
+          34.728, 34.782, 34.831, 34.865, 34.880, 34.899, 34.946, 35.023, 35.100, 35.157,
+          35.185, 35.196, 35.203, 35.214, 35.230, 35.242, 35.245, 35.242, 35.232, 35.207,
+          35.161, 35.099, 35.034, 35.004, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 33.521, 33.613, 33.731, 33.882, 34.050, 34.222, 34.411, 34.558, 34.641, 34.699,
+          34.733, 34.755, 34.774, 34.790, 34.814, 34.859, 34.935, 35.035, 35.125, 35.181,
+          35.206, 35.213, 35.216, 35.218, 35.223, 35.228, 35.231, 35.232, 35.229, 35.217,
+          35.192, 35.153, 35.094, 35.032, 34.987, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 33.439, 33.597, 33.783, 33.992, 34.211, 34.397, 34.538, 34.623, 34.663, 34.681,
+          34.690, 34.701, 34.719, 34.752, 34.807, 34.887, 34.982, 35.075, 35.144, 35.185,
+          35.204, 35.212, 35.216, 35.218, 35.220, 35.221, 35.221, 35.221, 35.218, 35.209,
+          35.189, 35.152, 35.090, 35.021, 34.961, 34.911, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 33.225, 33.418, 33.639, 33.823, 33.985, 34.169, 34.375, 34.522, 34.591, 34.613,
+          34.622, 34.639, 34.676, 34.737, 34.815, 34.908, 34.999, 35.071, 35.123, 35.157,
+          35.179, 35.192, 35.200, 35.205, 35.206, 35.206, 35.205, 35.203, 35.199, 35.193,
+          35.178, 35.145, 35.079, 35.004, 34.950, 34.925, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, ),
+        ( 33.024, 33.210, 33.468, 33.712, 33.918, 34.081, 34.237, 34.377, 34.466, 34.512,
+          34.545, 34.586, 34.644, 34.719, 34.804, 34.890, 34.962, 35.013, 35.049, 35.078,
+          35.104, 35.129, 35.152, 35.170, 35.183, 35.189, 35.189, 35.184, 35.177, 35.168,
+          35.152, 35.125, 35.085, 35.029, 34.986, 34.957, 34.919, 34.897, 34.882, 1.0E20,
+          1.0E20, ),
+        ( 32.896, 33.029, 33.250, 33.533, 33.811, 34.006, 34.117, 34.198, 34.278, 34.362,
+          34.451, 34.540, 34.624, 34.699, 34.770, 34.832, 34.879, 34.910, 34.932, 34.957,
+          34.989, 35.027, 35.066, 35.102, 35.129, 35.149, 35.160, 35.164, 35.160, 35.149,
+          35.135, 35.118, 35.096, 35.068, 35.037, 35.013, 34.988, 34.958, 34.929, 34.906,
+          34.892, ),
+        ( 32.860, 32.935, 33.105, 33.373, 33.672, 33.922, 34.095, 34.205, 34.284, 34.359,
+          34.436, 34.518, 34.603, 34.677, 34.735, 34.777, 34.806, 34.829, 34.851, 34.878,
+          34.913, 34.953, 34.994, 35.030, 35.061, 35.089, 35.111, 35.128, 35.136, 35.135,
+          35.127, 35.115, 35.101, 35.086, 35.068, 35.047, 35.021, 34.996, 34.972, 34.948,
+          34.929, ),
+        ( 1.0E20, 32.914, 33.031, 33.245, 33.497, 33.746, 33.972, 34.156, 34.282, 34.368,
+          34.433, 34.493, 34.553, 34.618, 34.685, 34.746, 34.791, 34.824, 34.851, 34.876,
+          34.902, 34.929, 34.958, 34.986, 35.015, 35.042, 35.066, 35.086, 35.102, 35.110,
+          35.111, 35.106, 35.096, 35.083, 35.068, 35.051, 35.034, 35.017, 35.002, 34.988,
+          34.974, ),
+        ( 1.0E20, 32.894, 32.963, 33.084, 33.233, 33.417, 33.667, 33.911, 34.108, 34.257,
+          34.375, 34.473, 34.553, 34.623, 34.694, 34.772, 34.841, 34.882, 34.900, 34.912,
+          34.926, 34.943, 34.963, 34.984, 35.004, 35.023, 35.041, 35.058, 35.072, 35.081,
+          35.084, 35.082, 35.074, 35.060, 35.040, 35.017, 34.994, 34.975, 34.970, 34.965,
+          34.963, ),
+        ( 1.0E20, 32.873, 32.904, 32.930, 32.942, 33.084, 33.292, 33.501, 33.682, 33.848,
+          34.022, 34.201, 34.352, 34.462, 34.561, 34.678, 34.811, 34.908, 34.943, 34.954,
+          34.962, 34.973, 34.985, 34.999, 35.013, 35.027, 35.039, 35.049, 35.056, 35.059,
+          35.058, 35.051, 35.038, 35.018, 34.986, 34.938, 34.833, 34.746, 34.756, 34.839,
+          34.887, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.745, 32.793, 32.889, 33.012, 33.142, 33.288,
+          33.473, 33.691, 33.882, 34.033, 34.174, 34.330, 34.507, 34.703, 34.878, 34.964,
+          34.987, 34.997, 35.005, 35.014, 35.021, 35.028, 35.033, 35.036, 35.037, 35.034,
+          35.026, 35.012, 34.994, 34.963, 34.882, 34.696, 34.517, 34.458, 34.499, 34.601,
+          34.732, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.748, 32.764, 32.805, 32.854, 32.898, 32.955,
+          33.041, 33.173, 33.330, 33.495, 33.668, 33.858, 34.067, 34.292, 34.526, 34.764,
+          34.942, 34.994, 35.008, 35.014, 35.019, 35.021, 35.022, 35.020, 35.016, 35.010,
+          35.003, 34.990, 34.963, 34.883, 34.724, 34.517, 34.403, 34.380, 34.411, 34.477,
+          34.587, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.833, 32.839, 32.844, 32.855, 32.861, 32.866,
+          32.883, 32.930, 33.015, 33.132, 33.279, 33.458, 33.662, 33.884, 34.113, 34.343,
+          34.573, 34.800, 34.959, 34.999, 35.008, 35.012, 35.013, 35.013, 35.012, 1.0E20,
+          1.0E20, 1.0E20, 1.0E20, 34.401, 34.380, 34.346, 34.311, 34.298, 34.306, 34.337,
+          34.387, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.859, 32.856, 32.839, 32.816, 32.794,
+          32.785, 32.801, 32.852, 32.941, 33.068, 33.229, 33.422, 33.635, 33.858, 34.076,
+          34.279, 34.469, 34.681, 34.902, 34.984, 35.000, 35.003, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 34.209, 34.218, 34.240, 34.277,
+          34.320, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.827, 32.796, 32.730,
+          32.686, 32.682, 32.717, 32.794, 32.914, 33.075, 33.272, 33.492, 33.709, 33.916,
+          34.107, 34.278, 34.428, 34.585, 34.747, 34.822, 1.0E20, 1.0E20, 1.0E20, 1.0E20,
+          1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 34.208, 34.206, 34.209, 34.221, 34.240,
+          34.264, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.557,
+          32.551, 32.562, 32.605, 32.690, 32.822, 32.999, 33.202, 33.411, 33.610, 33.787,
+          33.943, 34.076, 34.186, 34.270, 34.315, 34.291, 34.194, 34.133, 34.099, 34.089,
+          34.102, 34.122, 1.0E20, 1.0E20, 1.0E20, 34.229, 34.217, 34.206, 34.201, 34.202,
+          34.210, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 1.0E20, 1.0E20, 32.417, 32.416, 32.417, 32.419, 32.430,
+          32.443, 32.469, 32.520, 32.610, 32.742, 32.912, 33.109, 33.309, 33.493, 33.646,
+          33.767, 33.863, 33.938, 33.993, 34.029, 34.039, 34.033, 34.015, 33.998, 33.992,
+          34.000, 34.008, 34.009, 34.031, 34.073, 34.127, 34.160, 34.177, 34.186, 34.196,
+          34.213, ),
+        ( 1.0E20, 1.0E20, 1.0E20, 32.404, 32.397, 32.387, 32.378, 32.371, 32.368, 32.367,
+          32.377, 32.404, 32.457, 32.542, 32.660, 32.808, 32.974, 33.145, 33.308, 33.452,
+          33.573, 33.672, 33.748, 33.804, 33.844, 33.870, 33.888, 33.902, 33.914, 33.928,
+          33.948, 33.973, 34.003, 34.038, 34.076, 34.112, 34.144, 34.172, 34.199, 34.230,
+          34.271, ),
+        ( 32.486, 32.454, 32.419, 32.385, 32.354, 32.330, 32.312, 32.302, 32.297, 32.300,
+          32.311, 32.339, 32.389, 32.462, 32.561, 32.680, 32.812, 32.948, 33.083, 33.208,
+          33.322, 33.422, 33.507, 33.577, 33.636, 33.687, 33.733, 33.774, 33.811, 33.846,
+          33.881, 33.918, 33.958, 33.999, 34.038, 34.075, 34.113, 34.152, 34.195, 34.243,
+          34.300, ),
+      ), dtype=numpy.float64)
+
+    # Create the land (True) / ocean (False) center point mask from the salt data 
+    over_land = ( salt_center_data >= 256.0 )
+    # Synthesize the data values for the curvilinear grid center points
+    data = numpy.cos(numpy.deg2rad(center_lons)) * \
+           numpy.cos(3.6 * numpy.deg2rad(center_lats - 65.0))
+    # Reassign the values that are over land
+    data[over_land] = 1.0E20
+
+    # All the data is given as [lat][lon], so return the transpose of the arrays
+    return (corner_lons.T, corner_lats.T, center_lons.T, center_lats.T, data.T)
+
+
+def createExampleRectData():
+    '''
+    Creates and returns example longitude, latitudes, and data for a rectilinear
+    grid.  Covers approximately the same region given by createExampleCurvData.
+    Assigns grid center point data[i,j]
+        = cos(lon[i,j]) * cos(3.6 * (lat[i,j] - 65.0)) for areas over ocean,
+        = 1.0E34 for areas over land.
+
+    Arguments:
+        None
+    Returns:
+        (corner_lons, corner_lats, center_lons, center_lats, data) where:
+        corner_lons: numpy 1D array of longitudes of rectilinear corner planes
+        corner_lats: numpy 1D array of latitudes of rectilinear corner planes
+        center_lons: numpy 1D array of longitudes of rectilinear center planes
+        center_lats: numpy 1D array of latitudes of rectilinear center planes
+        data:        numpy 2D array of rectilinear center point data values
+    '''
+    # average annual salinity data at the center points of the rectilinear grid 
+    # 19.5W:19.5E:1.0, 65.5N:84.5N:1.0
+    # used here only for the land mask (values set to 1.0E34)
+    salt_center_data = numpy.array( (
+        ( 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 34.502, 34.615, 34.683,
+          34.679, 34.714, 34.795, 34.891, 34.908, 34.961, 34.941, 34.976, 35.021, 35.050,
+          35.109, 35.159, 35.160, 35.125, 35.112, 34.919, 34.891, 34.981, 34.882, 34.630,
+          33.866, 33.155, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 34.018, 1.0E34, 34.321, 1.0E34, 1.0E34, 34.455, 34.534, 34.543, 34.580, 34.650,
+          34.716, 34.743, 34.858, 34.939, 34.962, 34.948, 34.987, 34.995, 35.061, 35.073,
+          35.108, 35.160, 35.169, 35.138, 35.126, 34.991, 34.986, 34.976, 34.758, 34.708,
+          34.511, 33.723, 32.282, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 34.527, 34.459, 34.534, 34.451, 34.449, 34.564, 34.576, 34.618, 34.604, 34.638,
+          34.642, 34.699, 34.782, 34.964, 34.977, 34.996, 34.986, 35.012, 35.031, 35.047,
+          35.095, 35.123, 35.146, 35.123, 35.122, 35.104, 35.070, 35.092, 34.945, 34.755,
+          34.086, 33.745, 33.530, 33.223, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 34.088, 34.272, 34.313, 34.537, 34.617, 34.624, 34.706, 34.673, 34.692, 34.723,
+          34.781, 34.867, 34.901, 34.997, 34.999, 35.019, 35.036, 35.051, 35.090, 35.091,
+          35.111, 35.116, 35.123, 35.122, 35.121, 35.097, 35.067, 35.022, 35.046, 35.019,
+          34.726, 34.435, 34.405, 33.903, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 33.676, 33.810, 34.164, 34.428, 34.597, 34.587, 34.694, 34.722, 34.674, 34.769,
+          34.780, 34.780, 34.906, 34.984, 34.912, 35.038, 35.061, 35.073, 35.085, 35.093,
+          35.087, 35.122, 35.104, 35.099, 35.116, 35.128, 35.097, 35.084, 35.063, 35.053,
+          35.045, 35.027, 34.945, 34.712, 34.448, 34.382, 34.133, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 32.305, 32.585, 33.430, 34.153, 34.316, 34.408, 34.473, 34.496, 34.592, 34.787,
+          34.694, 34.684, 34.778, 34.670, 34.779, 34.985, 34.933, 35.045, 35.068, 34.976,
+          35.076, 35.093, 35.094, 35.101, 35.111, 35.103, 35.107, 35.096, 35.104, 35.095,
+          35.093, 35.055, 35.048, 35.004, 35.001, 34.705, 34.402, 34.307, 34.372, 34.294, ),
+        ( 33.298, 32.975, 33.267, 33.629, 33.799, 34.054, 33.829, 33.755, 33.696, 34.181,
+          34.324, 34.399, 34.318, 34.354, 34.438, 34.553, 34.747, 34.723, 34.806, 34.919,
+          34.982, 35.045, 35.055, 35.068, 35.078, 35.096, 35.081, 35.086, 35.075, 35.086,
+          35.081, 35.057, 35.044, 35.015, 34.958, 34.824, 34.735, 34.718, 34.728, 34.769, ),
+        ( 28.105, 29.990, 31.815, 32.463, 31.622, 33.312, 32.423, 32.791, 32.356, 33.881,
+          34.186, 34.055, 34.377, 34.398, 34.367, 34.426, 34.449, 34.416, 34.594, 34.626,
+          34.649, 34.733, 34.806, 34.900, 34.951, 35.059, 35.077, 35.033, 35.036, 35.078,
+          35.104, 35.068, 35.045, 35.013, 34.973, 34.881, 34.889, 34.967, 34.959, 34.982, ),
+        ( 31.406, 32.084, 32.798, 33.643, 32.759, 34.690, 32.999, 31.737, 34.213, 34.307,
+          34.486, 34.695, 34.260, 34.275, 33.731, 34.507, 34.299, 34.543, 34.439, 34.526,
+          34.578, 34.629, 34.636, 34.700, 34.724, 34.912, 34.976, 34.990, 34.995, 35.086,
+          35.085, 35.060, 35.070, 35.051, 35.004, 34.974, 34.948, 34.910, 34.857, 34.917, ),
+        ( 1.0E34, 30.750, 27.245, 31.925, 32.227, 34.169, 34.192, 32.716, 34.416, 34.127,
+          34.355, 34.446, 34.585, 34.459, 34.368, 34.711, 34.466, 34.565, 34.596, 34.600,
+          34.611, 34.630, 34.647, 34.628, 34.709, 34.872, 34.945, 34.983, 35.015, 35.033,
+          35.050, 35.048, 35.076, 35.052, 35.058, 35.018, 34.938, 34.635, 34.515, 34.509, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 1.0E34, 31.190, 31.372, 32.543, 32.013, 33.165, 33.239,
+          33.776, 33.138, 33.716, 33.752, 33.990, 34.530, 34.435, 34.529, 34.473, 34.644,
+          34.588, 34.683, 34.666, 34.722, 34.650, 34.775, 34.690, 34.951, 34.748, 34.986,
+          34.926, 34.908, 34.950, 34.993, 34.709, 34.704, 34.556, 34.493, 34.461, 34.363, ),
+        ( 1.0E34, 1.0E34, 30.850, 29.813, 30.600, 30.757, 29.950, 31.813, 33.114, 29.808,
+          31.363, 32.004, 33.087, 33.194, 33.541, 33.219, 33.639, 34.460, 33.944, 34.465,
+          34.410, 34.328, 34.559, 34.619, 34.736, 34.820, 34.931, 34.976, 34.959, 34.978,
+          34.939, 34.995, 34.793, 34.584, 34.382, 33.950, 1.0E34, 33.794, 34.030, 34.131, ),
+        ( 1.0E34, 1.0E34, 30.732, 29.499, 29.585, 29.906, 30.385, 29.942, 30.701, 31.643,
+          30.812, 32.183, 31.762, 31.644, 31.312, 32.599, 33.452, 33.868, 34.386, 34.501,
+          34.668, 34.623, 34.619, 34.811, 34.744, 34.906, 34.890, 34.939, 34.919, 34.773,
+          34.619, 34.328, 33.889, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 33.359, ),
+        ( 1.0E34, 1.0E34, 30.836, 31.386, 30.957, 30.987, 30.169, 29.891, 30.260, 30.652,
+          31.087, 30.988, 30.675, 30.949, 31.426, 31.795, 32.825, 33.460, 33.803, 34.377,
+          34.052, 34.130, 34.269, 34.091, 34.316, 34.466, 34.559, 34.429, 34.310, 34.326,
+          33.749, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 31.548, 31.176, 30.850, 30.800, 30.382, 30.196, 30.663,
+          30.157, 30.553, 30.538, 31.745, 31.467, 34.325, 32.348, 32.389, 32.391, 32.426,
+          33.053, 33.440, 33.754, 34.092, 34.098, 34.181, 34.494, 34.042, 34.519, 34.437,
+          33.853, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 30.153, 30.359, 30.328, 30.670, 30.451,
+          31.039, 32.220, 32.273, 31.958, 32.034, 32.082, 32.200, 32.108, 32.116, 32.294,
+          32.758, 33.232, 33.337, 33.485, 33.391, 33.403, 33.847, 33.087, 33.505, 33.622,
+          32.403, 34.123, 33.898, 34.422, 34.132, 33.988, 33.674, 33.688, 1.0E34, 1.0E34, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 30.939, 31.403,
+          30.826, 30.750, 31.006, 30.940, 31.011, 31.304, 31.941, 31.769, 29.121, 23.200,
+          32.445, 33.454, 33.141, 33.831, 33.980, 33.775, 33.204, 33.365, 33.386, 33.333,
+          32.736, 32.677, 33.089, 34.106, 34.156, 33.509, 33.732, 33.290, 33.623, 32.771, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 30.818, 1.0E34, 31.268, 31.090, 30.944, 31.070, 31.003,
+          31.950, 31.340, 29.934, 32.188, 32.185, 1.0E34, 1.0E34, 32.298, 1.0E34, 32.601,
+          33.448, 33.656, 1.0E34, 1.0E34, 1.0E34, 33.991, 33.329, 34.127, 33.703, 32.428,
+          33.421, 33.633, 33.228, 33.841, 33.923, 1.0E34, 1.0E34, 32.853, 1.0E34, 1.0E34, ),
+        ( 1.0E34, 1.0E34, 1.0E34, 32.490, 1.0E34, 31.849, 31.168, 32.160, 30.490, 1.0E34,
+          31.953, 32.030, 32.474, 32.373, 1.0E34, 32.130, 1.0E34, 1.0E34, 32.440, 32.559,
+          1.0E34, 1.0E34, 1.0E34, 31.751, 1.0E34, 32.795, 32.864, 32.936, 32.800, 33.676,
+          33.670, 1.0E34, 33.023, 33.761, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 33.290, 33.543, ),
+        ( 32.120, 32.370, 1.0E34, 31.970, 1.0E34, 31.880, 31.790, 32.100, 31.580, 31.684,
+          31.727, 31.768, 32.365, 32.332, 32.380, 1.0E34, 1.0E34, 32.598, 1.0E34, 1.0E34,
+          1.0E34, 31.811, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 1.0E34,
+          1.0E34, 1.0E34, 33.465, 1.0E34, 1.0E34, 1.0E34, 1.0E34, 31.944, 1.0E34, 1.0E34, ),
+    ), dtype=numpy.float64)
+
+    # Rectilinear grid longitude edges covering center points 19.5W:19.5E:1.0
+    corner_lons = numpy.linspace(-20.0, 20.0, 41)
+
+    # Rectilinear grid latitude edges covering center points 65.5N:84.5N:1.0
+    corner_lats = numpy.linspace(65.0, 85.0, 21)
+
+    # Compute the center point longitudes and latitudes from the edges
+    center_lons = 0.5 * (corner_lons[:-1] + corner_lons[1:])
+    center_lats = 0.5 * (corner_lats[:-1] + corner_lats[1:])
+
+    # Synthesize the data values for the rectilinear grid center points
+    center_2d_lons, center_2d_lats = numpy.meshgrid(center_lons, center_lats)
+    data = numpy.cos(numpy.deg2rad(center_2d_lons)) * \
+           numpy.cos(3.6 * numpy.deg2rad(center_2d_lats - 65.0))
+
+    # Reassign the values that are over land
+    over_land = ( salt_center_data >= 256.0 )
+    data[over_land] = 1.0E34
+
+    # The 2D data array was generated as [lat][lon], so return the transpose
+    return (corner_lons, corner_lats, center_lons, center_lats, data.T)
+
+
+def printDiffs(grid_lons, grid_lats, undef_val, max_negl,
+               expect_data, found_data):
+    '''
+    Prints significant differences between expect_data and found_data
+    along with the location of these differences
+
+    Arguments:
+        grid_lons:   numpy 2D array of grid longitudes
+        grid_lats:   numpy 2D array of grid latitudes
+        undef_val:   numpy array of one value; the undefined data value
+        max_negl:    maximumum negligible absolute difference
+        expect_data: numpy 2D array of expected data values
+        found_data:  numpy 2D array of data values to check
+    Returns:
+        None
+    Raises:
+        ValueError:  if the array shapes do not match
+    '''
+    if len(grid_lons.shape) != 2:
+        raise ValueError("grid_lons is not 2D")
+    if grid_lats.shape != grid_lons.shape:
+        raise ValueError("grid_lats.shape != grid_lons.shape")
+    if expect_data.shape != grid_lons.shape:
+        raise ValueError("expect_data.shape != grid_lons.shape")
+    if found_data.shape != grid_lons.shape:
+        raise ValueError("found_data.shape != grid_lons.shape")
+    different = ( numpy.abs(expect_data - found_data) > max_negl )
+    diff_lons = grid_lons[different]
+    diff_lats = grid_lats[different]
+    diff_expect = expect_data[different]
+    diff_found = found_data[different]
+    diff_list = [ ]
+    for (lon, lat, expect, found) in zip(diff_lons, diff_lats, diff_expect, diff_found):
+        if expect == undef_val:
+            # most serious - should have been masked out
+            diff_list.append([2, lon, lat, expect, found])
+        elif found == undef_val:
+            # least serious - destination not covered by source
+            diff_list.append([0, lon, lat, expect, found])
+        else:
+            # might be of concern
+            diff_list.append([1, lon, lat, expect, found])
+    # order primarily from least to most serious, 
+    # secondarily smallest to largest longitude,
+    # thirdly smallest to largest latitude
+    diff_list.sort()
+    num_not_undef = 0
+    num_undef = 0
+    num_diff = 0
+    for (_, lon, lat, expect, found) in diff_list:
+        if expect == undef_val:
+            num_not_undef += 1
+            print "lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#6.3f" \
+                  % (lon, lat, found)
+        elif found == undef_val:
+            num_undef += 1
+            print "lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found =  undef" \
+                  % (lon, lat, expect)
+        else:
+            num_diff += 1
+            print "lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found = %#6.3f, " \
+                  "diff = %#6.3f" % (lon, lat, expect, found, found - expect)
+    print "%3d undefined when defined might be expected" % num_undef
+    print "%3d with absolute difference > %#.3f" % (num_diff, max_negl)
+    print "%3d defined when undefined expected" % num_not_undef
+    print "%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1])
+
+
+# main routine - for testing "by hand"
+if __name__ == '__main__':
+    try:
+        while True:
+            print 'cw2r: curvilinear with corners to rectilinear'
+            print 'co2r: curvilinear without corners to rectilinear'
+            print 'r2cw: rectilinear to curvilinear with corners'
+            print 'r2co: rectilinear to curvilinear without corners'
+            print 'Ctrl-D to quit'
+            direction = raw_input('Regrid test to run? ')
+            direction = direction.strip().lower()
+            if direction in ('cw2r', 'co2r', 'r2cw', 'r2co'):
+                break
+    except EOFError:
+        raise SystemExit(0)
+
+    # Synthesize test data
+    (curv_corner_lons, curv_corner_lats,
+     curv_center_lons, curv_center_lats, curv_data) = createExampleCurvData()
+    curv_center_ignore = (curv_data >= 256.0)
+    (rect_corner_lons, rect_corner_lats,
+     rect_center_lons, rect_center_lats, rect_data) = createExampleRectData()
+    rect_center_ignore = (rect_data >= 256.0)
+    undef_val = numpy.array([-1.0E10], dtype=numpy.float64)
+
+    # Create the expected results on the curvilinear grid
+    curv_expect_data = curv_data.copy()
+    curv_expect_data[curv_center_ignore] = undef_val
+
+    # Create the expected results on the rectilinear grid
+    rect_expect_data = rect_data.copy()
+    rect_expect_data[rect_center_ignore] = undef_val
+
+    # Initialize ESMP
+    if not ESMPControl().startCheckESMP():
+        raise RuntimeError("Unexpected failure to start ESMP")
+
+    # Create the regridder
+    regridder = CurvRectRegridder()
+
+    if direction in ('cw2r', 'r2cw'):
+        # Create the curvilinear grid with corner and center points
+        regridder.createCurvGrid(curv_center_lons, curv_center_lats, curv_center_ignore,
+                                 curv_corner_lons, curv_corner_lats, None)
+    elif direction in ('co2r', 'r2co'):
+        # Create the curvilinear grid with only center points
+        regridder.createCurvGrid(curv_center_lons, curv_center_lats, curv_center_ignore,
+                                 None, None, None)
+    else:
+        raise ValueError("unexpected direction of %s" % direction)
+
+    # Create the rectilinear grid with corner and center points
+    regridder.createRectGrid(rect_center_lons, rect_center_lats, rect_center_ignore,
+                             rect_corner_lons, rect_corner_lats, None)
+
+    if direction in ('cw2r', 'co2r'):
+
+        print ""
+        if direction == 'cw2r':
+            print "Examining rectilinear results from curvilinear with corners"
+        else:
+            print "Examining rectilinear results from curvilinear without corners"
+
+        # Create the curvilinear source field
+        regridder.assignCurvField(curv_data)
+
+        # Create the rectilinear destination field
+        regridder.assignRectField()
+
+        # Generate the 2D rectilinear longitudes and latitudes arrays only to 
+        # simplify printing differences; not used for regridding
+        rect_2d_center_lats, rect_2d_center_lons = \
+            numpy.meshgrid(rect_center_lats, rect_center_lons)
+
+        # Regrid from curvilinear to rectilinear using the bilinear method
+        rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus bilinear regridded (found) differences"
+        printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.001,
+                   rect_expect_data, rect_regrid_data)
+
+        # Regrid from curvilinear to rectilinear using the patch method
+        rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus patch regridded (found) differences"
+        printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.001,
+                   rect_expect_data, rect_regrid_data)
+
+        if direction == 'cw2r':
+            # Regrid from curvilinear to rectilinear using the conserve method
+            # Corners required for this method
+            rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+            # Print the differences between the expected and regrid data
+            print ""
+            print "analytic (expect) versus conserve regridded (found) differences"
+            printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.05,
+                       rect_expect_data, rect_regrid_data)
+
+    elif direction in ('r2cw', 'r2co'):
+
+        print ""
+        if direction == 'r2cw':
+            print "Examining curvilinear with corners results from rectilinear"
+        else:
+            print "Examining curvilinear without corners results from rectilinear"
+
+        # Create the rectilinear source field
+        regridder.assignRectField(rect_data)
+
+        # Create the curvilinear destination field
+        regridder.assignCurvField(None)
+
+        # Regrid from rectilinear to curvilinear using the bilinear method
+        curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        # Print the differences between the expected and regrid data
+        # Ignore the edges of the regions
+        print ""
+        print "analytic (expect) versus bilinear regridded (found) differences"
+        printDiffs(curv_center_lons[1:-1, 1:-1],
+                   curv_center_lats[1:-1, 1:-1],
+                   undef_val, 0.001,
+                   curv_expect_data[1:-1, 1:-1],
+                   curv_regrid_data[1:-1, 1:-1])
+
+        # Regrid from rectilinear to curvilinear using the patch method
+        curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+        # Print the differences between the expected and regrid data
+        # Ignore the edges of the regions
+        print ""
+        print "analytic (expect) versus patch regridded (found) differences"
+        printDiffs(curv_center_lons[1:-1 ,1:-1],
+                   curv_center_lats[1:-1, 1:-1],
+                   undef_val, 0.001,
+                   curv_expect_data[1:-1, 1:-1],
+                   curv_regrid_data[1:-1, 1:-1])
+
+        if direction == 'r2cw':
+            # Regrid from rectilinear to curvilinear using the conserve method
+            # Corners required for this method
+            curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+            # Print the differences between the expected and regrid data
+            # Ignore the edges of the regions
+            print ""
+            print "analytic (expect) versus conserve regridded (found) differences"
+            printDiffs(curv_center_lons[1:-1,1:-1],
+                       curv_center_lats[1:-1,1:-1],
+                       undef_val, 0.1,
+                       curv_expect_data[1:-1,1:-1],
+                       curv_regrid_data[1:-1,1:-1])
+
+    else:
+
+        raise ValueError("unexpected direction of %s" % direction)
+
+    # Done with this regridder
+    regridder.finalize()
+
+    # Done with ESMP - delete the ESMP log file
+    ESMPControl().stopESMP(True)
diff --git a/pyfermod/regrid/regrid2dexample2.py b/pyfermod/regrid/regrid2dexample2.py
new file mode 100644
index 0000000..63dad01
--- /dev/null
+++ b/pyfermod/regrid/regrid2dexample2.py
@@ -0,0 +1,308 @@
+'''
+A Python program for testing the regrid2d.CurvRectRegridder class "by hand"
+and also serves as a coding example of using this class.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import ESMP
+from esmpcontrol import ESMPControl
+from regrid2d import CurvRectRegridder
+
+
+def createExampleData():
+    '''
+    Creates and returns example longitude, latitudes, and data for the rectilinear
+    grid longitude 100W:75W:0.2, latitude 15N:35N:0.2 (a region encompassing the 
+    Gulf of Mexico).  Assigns grid point 
+       data[i,j] = -1.0 * sin(lon[i,j] + 15) * cos(lat[i,j] - 10.0)) for areas over ocean,
+                 = 1.0E20 for areas over land.
+
+    Arguments:
+        None
+    Returns:
+        (lons, lats, data, ignore, undef) where:
+            lons: numpy 2D array of longitude coordinates
+            lats: numpy 2D array of latitude coordinates
+            data: numpy 2D array of data values
+            ignore: numpy 2D array of booleans; True over land, False over ocean
+    '''
+    # land=0, ocean=1 mask for 100W:75W:0.2 (rows), 15N:35N:0.2 (columns)
+    gom_mask = numpy.array(
+    ( (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,0,1,0,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,0,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1),
+      (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1),
+    ), dtype=numpy.bool)
+    ignore = numpy.logical_not(gom_mask)
+
+    # Create the 2D arrays on longitudes and latitudes
+    (lons, lats) = numpy.meshgrid(numpy.linspace(-100.0, -75.0, 126), numpy.linspace(15.0, 35.0, 101))
+
+    # Synthesize data values for the given longitudes and latitudes
+    data = -1.0 * numpy.sin(numpy.deg2rad(lons + 15.0)) * numpy.cos(numpy.deg2rad(lats - 10.0))
+    # Reassign the values that are over land
+    data[ ignore ] = 1.0E20
+
+    # All the 2D data is given as [lat][lon], so return the transpose of the arrays
+    return (lons.T, lats.T, data.T, ignore.T)
+
+
+def printDiffs(grid_lons, grid_lats, undef_val, max_negl,
+               expect_data, found_data):
+    '''
+    Prints significant differences between expect_data and found_data
+    along with the location of these differences
+
+    Arguments:
+        grid_lons:   numpy 2D array of grid longitudes
+        grid_lats:   numpy 2D array of grid latitudes
+        undef_val:   numpy array of one value; the undefined data value
+        max_negl:    maximumum negligible absolute difference
+        expect_data: numpy 2D array of expected data values
+        found_data:  numpy 2D array of data values to check
+    Returns:
+        None
+    Raises:
+        ValueError:  if the array shapes do not match
+    '''
+    if len(grid_lons.shape) != 2:
+        raise ValueError("grid_lons is not 2D")
+    if grid_lats.shape != grid_lons.shape:
+        raise ValueError("grid_lats.shape != grid_lons.shape")
+    if expect_data.shape != grid_lons.shape:
+        raise ValueError("expect_data.shape != grid_lons.shape")
+    if found_data.shape != grid_lons.shape:
+        raise ValueError("found_data.shape != grid_lons.shape")
+    different = ( numpy.abs(expect_data - found_data) > max_negl )
+    diff_lons = grid_lons[different]
+    diff_lats = grid_lats[different]
+    diff_expect = expect_data[different]
+    diff_found = found_data[different]
+    diff_list = [ ]
+    for (lon, lat, expect, found) in zip(diff_lons, diff_lats, diff_expect, diff_found):
+        if expect == undef_val:
+            # most serious - should have been masked out
+            diff_list.append([2, lon, lat, expect, found])
+        elif found == undef_val:
+            # least serious - destination not covered by source
+            diff_list.append([0, lon, lat, expect, found])
+        else:
+            # might be of concern
+            diff_list.append([1, lon, lat, expect, found])
+    # order primarily from least to most serious, 
+    # secondarily smallest to largest longitude,
+    # thirdly smallest to largest latitude
+    diff_list.sort()
+    num_not_undef = 0
+    num_undef = 0
+    num_diff = 0
+    for (_, lon, lat, expect, found) in diff_list:
+        if expect == undef_val:
+            num_not_undef += 1
+            print "lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#8.5f" \
+                  % (lon, lat, found)
+        elif found == undef_val:
+            num_undef += 1
+            print "lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found =  undef" \
+                  % (lon, lat, expect)
+        else:
+            num_diff += 1
+            print "lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found = %#8.5f, " \
+                  "diff = %#8.5f" % (lon, lat, expect, found, found - expect)
+    print "%3d undefined when defined might be expected" % num_undef
+    print "%3d with absolute difference > %#.5f" % (num_diff, max_negl)
+    print "%3d defined when undefined expected" % num_not_undef
+    print "%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1])
+
+
+# main routine - for testing "by hand"
+if __name__ == '__main__':
+    max_negl = 1.0E-4
+
+    # Synthesize test data
+    (lons, lats, data, ignore) = createExampleData()
+
+    # Assign the value to be used for undefined values in the result
+    undef_val = numpy.array([-1.0E32])
+
+    # Initialize ESMP
+    if not ESMPControl().startCheckESMP():
+        raise RuntimeError("Unexpected failure to start ESMP")
+
+    # Create the regridder
+    regridder = CurvRectRegridder()
+
+    # "curvilinear" corners every other starting on edges
+    curv_corner_lons = numpy.array(lons[::2, ::2])
+    curv_corner_lats = numpy.array(lats[::2, ::2])
+    curv_corner_ignore = numpy.array(ignore[::2, ::2])
+    # "curvilinear" centers every other starting one in
+    curv_center_lons = numpy.array(lons[1:-1:2, 1:-1:2])
+    curv_center_lats = numpy.array(lats[1:-1:2, 1:-1:2])
+    curv_center_ignore = numpy.array(ignore[1:-1:2, 1:-1:2])
+    # "curvilinear" data at the centers
+    curv_data = numpy.array(data[1:-1:2, 1:-1:2])
+
+    # rectilinear corners every other starting one in
+    rect_corner_lons = numpy.array(lons[1:-1:2, 0])
+    rect_corner_lats = numpy.array(lats[0, 1:-1:2])
+    rect_corner_ignore = numpy.array(ignore[1:-1:2, 1:-1:2])
+    # rectilinear centers every other starting two in
+    rect_center_lons = numpy.array(lons[2:-2:2, 0]).squeeze()
+    rect_center_lats = numpy.array(lats[0, 2:-2:2]).squeeze()
+    rect_center_ignore = numpy.array(ignore[2:-2:2, 2:-2:2])
+
+    # expected results at the rectilinear centers for checking
+    rect_expect_data = numpy.array(data[2:-2:2, 2:-2:2])
+    rect_expect_data[ ignore[2:-2:2, 2:-2:2] ] = undef_val
+    
+    # Create the curvilinear grid with corner and center points
+    regridder.createCurvGrid(curv_center_lons, curv_center_lats, curv_center_ignore,
+                             curv_corner_lons, curv_corner_lats, None)
+#                             curv_corner_lons, curv_corner_lats, curv_corner_ignore)
+
+    # Create the rectilinear grid with corner and center points
+    regridder.createRectGrid(rect_center_lons, rect_center_lats, rect_center_ignore,
+                             rect_corner_lons, rect_corner_lats, None)
+#                             rect_corner_lons, rect_corner_lats, rect_corner_ignore)
+
+    # Create the curvilinear source field
+    regridder.assignCurvField(curv_data)
+
+    # Create the rectilinear destination field
+    regridder.assignRectField(None)
+
+    # Generate the 2D rectilinear longitudes and latitudes arrays only to 
+    # simplify printing differences; not used for regridding
+    rect_2d_center_lats, rect_2d_center_lons = \
+        numpy.meshgrid(rect_center_lats, rect_center_lons)
+
+    # Regrid from curvilinear to rectilinear using the bilinear method
+    rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+    # Print the differences between the expected and regrid data
+    print ""
+    print "analytic (expect) versus bilinear regridded (found) differences"
+    printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+               rect_expect_data, rect_regrid_data)
+
+    # Regrid from curvilinear to rectilinear using the patch method
+    rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+    # Print the differences between the expected and regrid data
+    print ""
+    print "analytic (expect) versus patch regridded (found) differences"
+    printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+               rect_expect_data, rect_regrid_data)
+
+    # Regrid from curvilinear to rectilinear using the conserve method
+    # Corners required for this method
+    rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+    # Print the differences between the expected and regrid data
+    print ""
+    print "analytic (expect) versus conserve regridded (found) differences"
+    printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+               rect_expect_data, rect_regrid_data)
+
+    # Done with this regridder
+    regridder.finalize()
+
+    # Done with ESMP - delete the ESMP log file
+    ESMPControl().stopESMP(True)
diff --git a/pyfermod/regrid/regrid2dtests.py b/pyfermod/regrid/regrid2dtests.py
new file mode 100644
index 0000000..c242c8f
--- /dev/null
+++ b/pyfermod/regrid/regrid2dtests.py
@@ -0,0 +1,452 @@
+'''
+Unit tests for CurvRectRegridder
+
+ at author: Karl Smith
+'''
+import unittest
+import numpy
+import ESMP
+from esmpcontrol import ESMPControl
+from regrid2d import CurvRectRegridder
+
+
+class CurvRectRegridderTests(unittest.TestCase):
+    '''
+    Unit tests for the CurvRectRegridder class
+    '''
+
+    # flag to indicate when to call ESMPControl().stopESMP()
+    last_test = False
+
+
+    def setUp(self):
+        '''
+        Create some repeatedly used test data.
+        '''
+        # Use tuples for the arrays to make sure the NumPy 
+        # arrays created in the class methods are always used;
+        # not arrays that happened to be passed as input.
+        # Also verifies passed data is not modified.
+
+        # Rectilinear coordinates, data. and flags
+        crn_lons = numpy.linspace(-110, -90, 11)
+        crn_lats = numpy.linspace(0, 32, 9)
+        ctr_lons = 0.5 * (crn_lons[:-1] + crn_lons[1:])
+        ctr_lats = 0.5 * (crn_lats[:-1] + crn_lats[1:])
+        ctr_lats_mat, ctr_lons_mat = numpy.meshgrid(ctr_lats, ctr_lons)
+        data = -2.0 * numpy.sin(numpy.deg2rad(ctr_lons_mat)) \
+                    * numpy.cos(numpy.deg2rad(ctr_lats_mat))
+        ctr_flags = numpy.zeros(data.shape, dtype=numpy.int32)
+        ctr_flags[:2, :2] = 1
+        crn_flags = numpy.zeros((crn_lons.shape[0], crn_lats.shape[0]), dtype=numpy.int32)
+        crn_flags[:2, :2] = 1
+
+        # Turn rectilinear arrays into tuples
+        self.rect_corner_lons = tuple(crn_lons)
+        self.rect_corner_lats = tuple(crn_lats)
+        self.rect_center_lons = tuple(ctr_lons)
+        self.rect_center_lats = tuple(ctr_lats)
+        self.rect_center_ignr = tuple([tuple(subarr) for subarr in ctr_flags.tolist()])
+        self.rect_corner_ignr = tuple([tuple(subarr) for subarr in crn_flags.tolist()])
+        self.rect_data = tuple([tuple(subarr) for subarr in data.tolist()])
+
+        # Curvilinear coordindates - one step further out on all sides of the region
+        crn_lons = numpy.linspace(-112, -88, 13)
+        crn_lats = numpy.linspace(-4, 36, 11)
+        crn_lats_mat, crn_lons_mat = numpy.meshgrid(crn_lats, crn_lons)
+        ctr_lons = 0.5 * (crn_lons[:-1] + crn_lons[1:])
+        ctr_lats = 0.5 * (crn_lats[:-1] + crn_lats[1:])
+        ctr_lats_mat, ctr_lons_mat = numpy.meshgrid(ctr_lats, ctr_lons)
+        # Pull coordinates in some towards the center
+        crn_lons = crn_lons_mat * numpy.cos(numpy.deg2rad(crn_lats_mat - 16.0) / 2.0)
+        crn_lats = crn_lats_mat * numpy.cos(numpy.deg2rad(crn_lons_mat + 100.0) / 2.0)
+        ctr_lons = ctr_lons_mat * numpy.cos(numpy.deg2rad(ctr_lats_mat - 16.0) / 2.0)
+        ctr_lats = ctr_lats_mat * numpy.cos(numpy.deg2rad(ctr_lons_mat + 100.0) / 2.0)
+        # Curvilinear data and flags
+        data = -2.0 * numpy.sin(numpy.deg2rad(ctr_lons)) \
+                    * numpy.cos(numpy.deg2rad(ctr_lats))
+        ctr_flags = numpy.zeros(data.shape, dtype=numpy.int32)
+        ctr_flags[:3, :3] = 1
+        crn_flags = numpy.zeros(crn_lons.shape, dtype=numpy.int32)
+        crn_flags[:3, :3] = 1
+
+        # Turn curvilinear arrays into tuples
+        self.curv_corner_lons = tuple([tuple(subarr) for subarr in crn_lons.tolist()])
+        self.curv_corner_lats = tuple([tuple(subarr) for subarr in crn_lats.tolist()])
+        self.curv_center_lons = tuple([tuple(subarr) for subarr in ctr_lons.tolist()])
+        self.curv_center_lats = tuple([tuple(subarr) for subarr in ctr_lats.tolist()])
+        self.curv_center_ignr = tuple([tuple(subarr) for subarr in ctr_flags.tolist()])
+        self.curv_corner_ignr = tuple([tuple(subarr) for subarr in crn_flags.tolist()])
+        self.curv_data = tuple([tuple(subarr) for subarr in data.tolist()])
+
+        # undef_val must be a numpy array
+        self.undef_val = numpy.array([1.0E10], dtype=numpy.float64)
+
+        if not ESMPControl().startCheckESMP():
+            self.fail("startCheckESMP did not succeed - test called after last_test set to True")
+
+
+    def test01CurvRectRegridderInit(self):
+        '''
+        Test of the CurvRectRegridder.__init__ method.
+        '''
+        regridder = CurvRectRegridder()
+        self.assertTrue(regridder != None, "CurvRectRegridder() returned None")
+        regridder.finalize()
+
+
+    def test02CreateCurvGrid(self):
+        '''
+        Tests the CurvRectRegridder.createCurvGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr, self.curv_corner_lons,
+                                 self.curv_corner_lats, self.curv_corner_ignr)
+
+        # Test without flags 
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 None, self.curv_corner_lons, self.curv_corner_lats)
+
+        # Test without corners
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr)
+
+        # Test without corners or flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats)
+
+        # TODO: Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test03AssignCurvField(self):
+        '''
+        Tests the CurvRectRegridder.assignCurvGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr, self.curv_corner_lons,
+                                 self.curv_corner_lats, self.curv_corner_ignr)
+        regridder.assignCurvField()
+        regridder.assignCurvField(self.curv_data)
+
+        # Test without flags 
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 None, self.curv_corner_lons, self.curv_corner_lats)
+        regridder.assignCurvField(self.curv_data)
+        regridder.assignCurvField()
+
+        # Test without corners
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr)
+        regridder.assignCurvField(self.curv_data)
+        regridder.assignCurvField()
+
+        # Test without corners or flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats)
+        regridder.assignCurvField()
+        regridder.assignCurvField(self.curv_data)
+
+        # TODO: Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test04CreateRectGrid(self):
+        '''
+        Tests the CurvRectRegridder.createRectGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr, self.rect_corner_lons,
+                                 self.rect_corner_lats, self.rect_corner_ignr)
+
+        # Test without flags
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 None, self.rect_corner_lons, self.rect_corner_lats)
+
+        # Test without corners
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr)
+
+        # Test without corners or flags 
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats)
+
+        # TODO: Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test05AssignRectField(self):
+        '''
+        Tests the CurvRectRegridder.assignRectGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr, self.rect_corner_lons,
+                                 self.rect_corner_lats, self.rect_corner_ignr)
+        regridder.assignRectField(self.rect_data)
+        regridder.assignRectField()
+
+        # Test without flags
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 None, self.rect_corner_lons, self.rect_corner_lats)
+        regridder.assignRectField()
+        regridder.assignRectField(self.rect_data)
+
+        # Test without corners
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr)
+        regridder.assignRectField()
+        regridder.assignRectField(self.rect_data)
+
+        # Test without corners or flags 
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats)
+        regridder.assignRectField(self.rect_data)
+        regridder.assignRectField()
+
+        # TODO: Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test06RegridCurvToRectConserve(self):
+        '''
+        Tests the CurvRectRegridder.regridCurvToRect method using conservative regridding
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data, using conservative regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr, self.curv_corner_lons,
+                                 self.curv_corner_lats, self.curv_corner_ignr)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr, self.rect_corner_lons,
+                                 self.rect_corner_lats, self.rect_corner_ignr)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val, 
+                                                 ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.rect_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        mismatch_found = False
+        # Couple "good" points next to ignored data area are a bit wonky
+        expect_data[2, 0] = self.undef_val
+        regrid_data[2, 0] = self.undef_val
+        expect_data[2, 1] = self.undef_val
+        regrid_data[2, 1] = self.undef_val
+        for i in xrange(expect_data.shape[0]):
+            for j in xrange(expect_data.shape[1]):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0007:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                          "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+                           self.rect_center_lons[i], self.rect_center_lats[j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def test07RegridCurvToRectBilinear(self):
+        '''
+        Tests the CurvRectRegridder.regridCurvToRect method using bilinear regridding
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with only center data and no flags, using bilinear regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        mismatch_found = False
+        # one point falls outside the curvilinear centerpoints grid?
+        expect_data[5, 0] = self.undef_val
+        for i in xrange(expect_data.shape[0]):
+            for j in xrange(expect_data.shape[1]):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0003:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                          "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+                           self.rect_center_lons[i], self.rect_center_lats[j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def test08RegridCurvToRectPatch(self):
+        '''
+        Tests the CurvRectRegridder.regridCurvToRect method using patch regridding
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with only center data, and flags only on rectilinear centers,
+        # using patch regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_PATCH)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.rect_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        # one point falls outside the curvilinear centerpoints grid?
+        expect_data[5, 0] = self.undef_val
+        mismatch_found = False
+        for i in xrange(expect_data.shape[0]):
+            for j in xrange(expect_data.shape[1]):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0011:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                          "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+                           self.rect_center_lons[i], self.rect_center_lats[j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def test09RegridRectToCurvConserve(self):
+        '''
+        Tests the CurvRectRegridder.regridRectToCurv method using conservative regridding
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with all corner and center data, using conservative regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr, self.curv_corner_lons,
+                                 self.curv_corner_lats, self.curv_corner_ignr)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_ignr, self.rect_corner_lons,
+                                 self.rect_corner_lats, self.rect_corner_ignr)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.curv_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        # Couple "good" points next to ignored area are a bit wonky
+        expect_data[1, 3] = self.undef_val
+        regrid_data[1, 3] = self.undef_val
+        expect_data[2, 3] = self.undef_val
+        regrid_data[2, 3] = self.undef_val
+        mismatch_found = False
+        # Ignore outermost edges of curvilinear grid since
+        # they aren't really well covered by the rectilinear grid
+        # Also ignore the second east-most edge;
+        # also not well covered and errors are larger 
+        for i in xrange(1, expect_data.shape[0] - 2):
+            for j in xrange(1, expect_data.shape[1] - 1):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0004:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
+                          "lat = %7.3f" % (expect_data[i, j], regrid_data[i, j], 
+                          self.curv_center_lons[i][j], self.curv_center_lats[i][j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def test10RegridRectToCurvBilinear(self):
+        '''
+        Tests the CurvRectRegridder.regridRectToCurv method using bilinear regridding
+        '''
+        regridder = CurvRectRegridder()
+
+        # Test with only center data and no flags, using bilinear regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        mismatch_found = False
+        # Ignore outermost edges of curvilinear grid since
+        # they aren't really well covered by the rectilinear grid
+        # Also ignore the second east-most edge and second south-most edge;
+        # also not covered
+        for i in xrange(1, expect_data.shape[0] - 2):
+            for j in xrange(2, expect_data.shape[1] - 1):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0003:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
+                          "lat = %7.3f" % (expect_data[i, j], regrid_data[i, j],
+                          self.curv_center_lons[i][j], self.curv_center_lats[i][j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def test11RegridRectToCurvPatch(self):
+        '''
+        Tests the CurvRectRegridder.regridRectToCurv method using patch regridding
+        '''
+        # Mark as the last test so ESMPControl().stopESMP will be called
+        self.last_test = True
+
+        regridder = CurvRectRegridder()
+
+        # Test with only center data, and flags only on curvilinear centers,
+        # using patch regridding
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_ignr)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_PATCH)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.curv_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        mismatch_found = False
+        # Ignore outermost edges of curvilinear grid since
+        # they aren't really well covered by the rectilinear grid
+        # Also ignore the second east-most edge and second south-most edge;
+        # also not covered
+        for i in xrange(1, expect_data.shape[0] - 2):
+            for j in xrange(2, expect_data.shape[1] - 1):
+                if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0011:
+                    mismatch_found = True
+                    print "expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
+                          "lat = %7.3f" % (expect_data[i, j], regrid_data[i, j],
+                          self.curv_center_lons[i][j], self.curv_center_lats[i][j])
+        if mismatch_found:
+            self.fail("data mismatch found")
+
+
+    def tearDown(self):
+        '''
+        Finalize ESMP if it has been initialized and if this is the last test
+        '''
+        if self.last_test:
+            ESMPControl().stopESMP(True)
+
+
+if __name__ == "__main__":
+    '''
+    Run the unit tests in this module.
+    '''
+    unittest.main()
+
diff --git a/pyfermod/regrid/regrid3d.py b/pyfermod/regrid/regrid3d.py
new file mode 100644
index 0000000..b2b8c50
--- /dev/null
+++ b/pyfermod/regrid/regrid3d.py
@@ -0,0 +1,1033 @@
+'''
+Regridder for converting data between a curvilinear longitude,
+latitude, depth (or elevation) grid and a rectilinear longitude,
+latitude, depth (or elevation) grid.  Uses the ESMP interface
+to ESMF to perform the regridding.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import ESMP
+
+
+class CurvRect3DRegridder(object):
+    '''
+    Regridder for regridding data between a 3D curvilinear grid, where
+    the longitude, latitude, and depth (or elevation) of each grid corner
+    and/or center point is explicitly defined, and a 3D rectilinear grid,
+    where the grid corners are all intersections of sets of strictly
+    increasing longitudes, strictly increasing latitudes, and strictly
+    increasing depths (or elevations).  The rectilinear grid centers are
+    the intersections of averaged consecutive longitude pairs, averaged
+    consecutive latitude pairs, and averages consecutive depth (or
+    elevation) pairs.
+
+    For these grids, the center point [i, j, k] is taken to be the center
+    point of the quadrilaterally-faced hexahedron defined by the corner
+    points: corner_pt[i, j, k], corner_pt[i+1, j, k], corner_pt[i+1, j+1, k],
+    corner_pt([i, j+1, k], corner_pt[i, j, k+1], corner_pt[i+1, j, k+1],
+    cornmer_pt[i+1, j+1, k+1], and corner_pt[i, j+1, k+1].
+
+    Uses the ESMP interface to ESMF to perform the regridding.  Cartesian
+    grids are used in ESMP to perform this regridding, assuming a spherical
+    earth with radius 6371.007 kilometers.
+
+    Prior to calling any instance methods in the CurvRect3DRegridder class,
+    the ESMP module must be imported and ESMP.ESMP_Initialize() must have
+    been called.  When a CurvRect3DRegridder instance is no longer needed,
+    the finalize method of the instance should be called to free ESMP
+    resources associated with the instance.  When ESMP is no longer
+    required, the ESMP.ESMP_Finalize() method should be called to free
+    all ESMP and ESMF resources.
+
+    See the ESMPControl singleton class to simplify initializing and
+    finalizing ESMP once, and only once, for a Python session.
+    '''
+
+
+    def __init__(self, earth_radius=6371.007, debug=False):
+        '''
+        Initializes to an empty regridder.  The ESMP module must be
+        imported and ESMP.ESMP_Initialize() called (possibly through
+        invoking ESMPControl().startCheckESMP()) prior to calling
+        any methods in this instance.
+
+        Arguments:
+            earth_rad_km: earth radius, in kilometers, to use in computing
+                          cartesian coordinates for the regridding process.
+                          The precision of this value is not critical and
+                          the authalic radius given as the default should
+                          suffice for most purposes.
+        '''
+        # Call the no-argument __init__ of the superclass
+        super(CurvRect3DRegridder, self).__init__()
+        # Radius of the earth, in kilometers, to use in regridding
+        self.__earth_rad = earth_radius
+        self.__debug = debug
+        # tuples giving the shape of the grid (defined by number of cells)
+        self.__curv_shape = None
+        self.__rect_shape = None
+        # ESMP_Grid objects describing the grids
+        self.__curv_grid = None
+        self.__rect_grid = None
+        # ESMP_Field objects providing the source or regridded data
+        self.__curv_dest_field = None
+        self.__curv_src_field = None
+        self.__rect_dest_field = None
+        self.__rect_src_field = None
+        # handles to regridding operations between the fields/grids
+        self.__curv_to_rect_handles = { }
+        self.__rect_to_curv_handles = { }
+
+
+    def createCurvGrid(self, center_lons, center_lats, center_levs,
+                       center_ignore=None, levels_are_depths=True,
+                       corner_lons=None, corner_lats=None,
+                       corner_levs=None, corner_ignore=None):
+        '''
+        Create the curvilinear grid as an ESMP_Grid using the provided center
+        longitudes, latitudes, and depths (or elevations) as the grid
+        center points, and, if given, the grid corner longitudes, latitudes,
+        and depths (or elevations) as the grid corner points.  Curvilinear
+        data is assigned to the center points.  Grid point coordinate
+        coord[i,j,k] is assigned from lon[i,j,k], lat[i,j,k], and levs[i,j,k].
+
+        Center point [i,j,k] is taken to be the center point of the
+        quadrilaterally-faced hexahedron defined by the corner points:
+        corner_pt[i, j, k], corner_pt[i+1, j, k], corner_pt[i+1, j+1, k],
+        corner_pt([i, j+1, k], corner_pt[i, j, k+1], corner_pt[i+1, j, k+1],
+        corner_pt[i+1, j+1, k+1], and corner_pt[i, j+1, k+1].
+
+        Any previous ESMP_Grid, ESMP_Field, or ESMP regridding procedures
+        are destroyed.
+
+        Arguments:
+            center_lons:       3D array of longitudes, in degrees,
+                               for each of the curvilinear center points
+            center_lats:       3D array of latitudes, in degrees,
+                               for each of the curvilinear center points
+            center_levs:       3D array of levels, in meters from the earth
+                               radius, for each of the curvilinear center
+                               points
+            center_ignore:     3D array of boolean-like values, indicating
+                               if the corresponding grid center point should
+                               be ignored in the regridding; if None, no
+                               grid center points will be ignored
+            levels_are_depths: True -  levels are depths and subtracted from
+                                       the earth radius;
+                               False - levels are elevations and added to
+                                       the earth radius
+            corner_lons:       3D array of longitudes, in degrees,
+                               for each of the curvilinear corner points
+            corner_lats:       3D array of latitudes, in degrees,
+                               for each of the curvilinear corner points
+            corner_levs:       3D array of levels, in meters from the earth radius,
+                               for each of the curvilinear corner points
+            corner_ignore:     3D array of boolean-like values, indicating
+                               if the corresponding grid corner point should
+                               be ignored in the regridding; if None, no
+                               grid corner points will be ignored
+        Returns:
+            None
+        Raises:
+            ValueError: if the shape (dimensionality) of an argument is
+                        invalid, or if a value in an argument is invalid
+            TypeError:  if an argument is not array-like
+        '''
+        # Make sure center_lons is an appropriate array-like argument
+        center_lons_array = numpy.array(center_lons, dtype=numpy.float64, copy=False)
+        if len(center_lons_array.shape) != 3:
+            raise ValueError("center_lons must be three-dimensional")
+
+        # Make sure center_lats is an appropriate array-like argument
+        center_lats_array = numpy.array(center_lats, dtype=numpy.float64, copy=False)
+        if center_lats_array.shape != center_lons_array.shape:
+            raise ValueError("center_lats and center_lons must have the same shape")
+
+        # Make sure center_lats is an appropriate array-like argument
+        center_levs_array = numpy.array(center_levs, dtype=numpy.float64, copy=False)
+        if center_levs_array.shape != center_lons_array.shape:
+            raise ValueError("center_levs and center_lons must have the same shape")
+
+        if center_ignore == None:
+            # Using all points, no mask created
+            center_ignore_array = None
+        else:
+            # Make sure ignore_pts is an appropriate array-like argument
+            center_ignore_array = numpy.array(center_ignore, dtype=numpy.bool, copy=False)
+            if center_ignore_array.shape != center_lons_array.shape:
+                raise ValueError("center_ignore and center_lons must have the same shape")
+            # If not actually ignoring any points, do not create a mask
+            if not center_ignore_array.any():
+                center_ignore_array = None
+
+        # Mask for X,Y,Z coordinates to compute
+        if center_ignore_array != None:
+            good_centers = numpy.logical_not(center_ignore_array).flatten('F')
+        else:
+            good_centers = numpy.array([True] * (center_lons_array.shape[0] * \
+                                                 center_lons_array.shape[1] * \
+                                                 center_lons_array.shape[2]) )
+
+        if (corner_lons != None) and (corner_lats != None) and (corner_levs != None):
+            # Corner points specified
+
+            # Make sure corner_lons is an appropriate array-like argument
+            corner_lons_array = numpy.array(corner_lons, dtype=numpy.float64, copy=False)
+            if corner_lons_array.shape != (center_lons_array.shape[0] + 1,
+                                           center_lons_array.shape[1] + 1,
+                                           center_lons_array.shape[2] + 1):
+                raise ValueError("corner_lons must have one more point along " \
+                                 "each dimension when compared to center_lons")
+
+            # Make sure corner_lats is an appropriate array-like argument
+            corner_lats_array = numpy.array(corner_lats, dtype=numpy.float64, copy=False)
+            if corner_lats_array.shape != corner_lons_array.shape:
+                raise ValueError("corner_lats and corner_lons must have the same shape")
+
+            # Make sure corner_lats is an appropriate array-like argument
+            corner_levs_array = numpy.array(corner_levs, dtype=numpy.float64, copy=False)
+            if corner_levs_array.shape != corner_lons_array.shape:
+                raise ValueError("corner_levs and corner_lons must have the same shape")
+
+            if corner_ignore == None:
+                # Using all points, no mask created
+                corner_ignore_array = None
+            else:
+                # Make sure ignore_pts is an appropriate array-like argument
+                corner_ignore_array = numpy.array(corner_ignore, dtype=numpy.bool, copy=False)
+                if corner_ignore_array.shape != corner_lons_array.shape:
+                    raise ValueError("corner_ignore and corner_lons must have the same shape")
+                # If not actually ignoring any points, do not create a mask
+                if not corner_ignore_array.any():
+                    corner_ignore_array = None
+
+            # Mask for X,Y,Z coordinates to compute
+            if corner_ignore_array != None:
+                good_corners = numpy.logical_not(corner_ignore_array).flatten('F')
+            else:
+                good_corners = numpy.array([True] * (corner_lons_array.shape[0] * \
+                                                     corner_lons_array.shape[1] * \
+                                                     corner_lons_array.shape[2]) )
+
+        elif (corner_lons != None) or (corner_lats != None) or (corner_levs != None):
+            raise ValueError("one or two, but not all three, of corner_lons, " \
+                             "corner_lats, and corner_levs are given")
+        elif corner_ignore != None:
+            raise ValueError("corner_ignore given without corner_lons, " \
+                             "corner_lats, and corner_levs")
+        else:
+            # No corner points specified
+            corner_lons_array = None
+            corner_lats_array = None
+            corner_levs_array = None
+            corner_ignore_array = None
+
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any curvilinear ESMP_Fields
+        if self.__curv_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_src_field)
+            self.__curv_src_field = None
+        if self.__curv_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_dest_field)
+            self.__curv_dest_field = None
+        # Destroy any previous curvilinear ESMP_Grid
+        if self.__curv_grid != None:
+            ESMP.ESMP_GridDestroy(self.__curv_grid);
+            self.__curv_grid = None
+
+        # Create the curvilinear 3D cartesian coordinates ESMP_Grid
+        # using ESMP_GridCreateNoPeriDim for the typical case (not
+        # the whole world) in Ferret.
+        self.__curv_shape = center_lons_array.shape
+        grid_shape = numpy.array(self.__curv_shape, dtype=numpy.int32)
+        self.__curv_grid = ESMP.ESMP_GridCreateNoPeriDim(grid_shape,
+                                         ESMP.ESMP_COORDSYS_CART,
+                                         ESMP.ESMP_TYPEKIND_R8)
+
+        if corner_lons_array != None:
+            # Allocate space for the grid corner coordinates
+            ESMP.ESMP_GridAddCoord(self.__curv_grid, ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+
+            # Retrieve the grid corner coordinate arrays in the ESMP_Grid
+            grid_x_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 0,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+            grid_y_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 1,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+            grid_z_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 2,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+
+            # Assign the cartesian coordinates of the grid corners in the ESMP_Grid
+            lons = corner_lons_array.flatten('F')
+            lons = numpy.deg2rad(lons[good_corners])
+            lats = corner_lats_array.flatten('F')
+            lats = numpy.deg2rad(lats[good_corners])
+            levs = corner_levs_array.flatten('F')
+            levs = levs[good_corners] / 1000.0
+            if levels_are_depths:
+                levs *= -1.0
+            levs += self.__earth_rad
+            levs /= self.__earth_rad
+            # XY plane through the prime meridian, Z toward central atlantic
+            # 0 lon, 0 lat = (0, 0, R); 90 lon, 0 lat = (R, 0, 0); * lon, 90 lat = (0, R, 0)
+            cos_lats = numpy.cos(lats)
+            grid_x_coords[:] = 0.0
+            grid_x_coords[good_corners] = levs * numpy.sin(lons) * cos_lats
+            grid_y_coords[:] = 0.0
+            grid_y_coords[good_corners] = levs * numpy.sin(lats)
+            grid_z_coords[:] = 0.0
+            grid_z_coords[good_corners] = levs * numpy.cos(lons) * cos_lats
+
+            if self.__debug:
+                fout = open("curv_corner_xyz.txt", "w")
+                try:
+                    print >>fout, "curv_corner_x = %s" % \
+                        self.__myArrayStr(grid_x_coords, corner_lons_array.shape)
+                    print >>fout, "curv_corner_y = %s" % \
+                        self.__myArrayStr(grid_y_coords, corner_lons_array.shape)
+                    print >>fout, "curv_corner_z = %s" % \
+                        self.__myArrayStr(grid_z_coords, corner_lons_array.shape)
+                finally:
+                    fout.close()
+            
+            # Add a mask if not considering all the corner points
+            if corner_ignore_array != None:
+                # Allocate space for the grid corners mask
+                ESMP.ESMP_GridAddItem(self.__curv_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+                # Retrieve the grid corners mask array in the ESMP_Grid
+                ignore_mask = ESMP.ESMP_GridGetItem(self.__curv_grid,
+                                                    ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+                # Assign the mask in the ESMP_Grid; 
+                # False (turns into zero) means use the point;
+                # True (turns into one) means ignore the point
+                ignore_mask[:] = corner_ignore_array.flatten('F')
+
+        # Allocate space for the grid center coordinates
+        ESMP.ESMP_GridAddCoord(self.__curv_grid, ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        # Retrieve the grid center coordinate arrays in the ESMP_Grid
+        grid_x_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 0,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+        grid_y_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 1,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+        grid_z_coords = ESMP.ESMP_GridGetCoordPtr(self.__curv_grid, 2,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        # Assign the cartesian coordinates of the grid corners in the ESMP_Grid
+        lons = center_lons_array.flatten('F')
+        lons = numpy.deg2rad(lons[good_centers])
+        lats = center_lats_array.flatten('F')
+        lats = numpy.deg2rad(lats[good_centers])
+        levs = center_levs_array.flatten('F')
+        levs = levs[good_centers] / 1000.0
+        if levels_are_depths:
+            levs *= -1.0
+        levs += self.__earth_rad
+        levs /= self.__earth_rad
+        # XY plane through the prime meridian, Z toward central atlantic
+        # 0 lon, 0 lat = (0, 0, R); 90 lon, 0 lat = (R, 0, 0); * lon, 90 lat = (0, R, 0)
+        cos_lats = numpy.cos(lats)
+        grid_x_coords[:] = 0.0
+        grid_x_coords[good_centers] = levs * numpy.sin(lons) * cos_lats
+        grid_y_coords[:] = 0.0
+        grid_y_coords[good_centers] = levs * numpy.sin(lats)
+        grid_z_coords[:] = 0.0
+        grid_z_coords[good_centers] = levs * numpy.cos(lons) * cos_lats
+
+        if self.__debug:
+            fout = open("curv_center_xyz.txt", "w")
+            try:
+                print >>fout, "curv_center_x = %s" % \
+                    self.__myArrayStr(grid_x_coords, self.__curv_shape)
+                print >>fout, "curv_center_y = %s" % \
+                    self.__myArrayStr(grid_y_coords, self.__curv_shape)
+                print >>fout, "curv_center_z = %s" % \
+                    self.__myArrayStr(grid_z_coords, self.__curv_shape)
+            finally:
+                fout.close()
+
+        # Add a mask if not considering all the center points
+        if center_ignore_array != None:
+            # Allocate space for the grid centers mask
+            ESMP.ESMP_GridAddItem(self.__curv_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+            # Retrieve the grid centers mask array in the ESMP_Grid
+            ignore_mask = ESMP.ESMP_GridGetItem(self.__curv_grid,
+                                                ESMP.ESMP_GRIDITEM_MASK,
+                                                ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+            # Assign the mask in the ESMP_Grid; 
+            # False (turns into zero) means use the point;
+            # True (turns into one) means ignore the point
+            ignore_mask[:] = center_ignore_array.flatten('F')
+
+
+    def assignCurvField(self, data=None):
+        '''
+        Possibly creates, and possible assigns, an appropriate curvilinear
+        ESMP_Field located at the center points of the grid.  An ESMP_Field
+        is created if and only if it is not already present; thus allowing
+        the "weights" computed from a previous regridding to be reused.
+
+        If data is not None, assigns the data values to the curvilinear
+        source ESMP_Field, creating the ESMP_field if it does not exist.
+
+        If data is None, only creates the curvilinear destination ESMP_Field
+        if it does not exist.
+
+        Arguments:
+            data: 3D array of data values to be assigned in an
+                  ESMP_Field for the grid center points; if None,
+                  no data in any ESMP_Field is modified.
+        Returns:
+            None
+        Raises:
+            ValueError: if data is not None, and if the shape
+                        (dimensionality) of data is invalid or
+                        if a value in data is not numeric
+            TypeError:  if data, if not None, is not array-like
+        '''
+        if data == None:
+
+            # Create the curvilinear destination ESMP_Field if it does not exist
+            if self.__curv_dest_field == None:
+                self.__curv_dest_field = ESMP.ESMP_FieldCreateGrid(self.__curv_grid,
+                                                        "curv_dest_field",
+                                                        ESMP.ESMP_TYPEKIND_R8,
+                                                        ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        else:
+
+            # Make sure data is an appropriate array-like argument
+            data_array = numpy.array(data, dtype=numpy.float64, copy=True)
+            if data_array.shape != self.__curv_shape:
+                raise ValueError("data must have the same shape " \
+                                 "as the center points arrays")
+
+            # Create the curvilinear source ESMP_Field if it does not exist
+            if self.__curv_src_field == None:
+                self.__curv_src_field = ESMP.ESMP_FieldCreateGrid(self.__curv_grid,
+                                                       "curv_src_field",
+                                                       ESMP.ESMP_TYPEKIND_R8,
+                                                       ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+            # Retrieve the field data array in the ESMP_Field
+            field_ptr = ESMP.ESMP_FieldGetPtr(self.__curv_src_field)
+
+            # Assign the data to the field array in the ESMP_Field;
+            # flatten in the same order as the grid coordinates
+            field_ptr[:] = data_array.flatten('F')
+
+            if self.__debug:
+                fout = open("curv_data.txt", "w")
+                try:
+                    print >>fout, "curv_data = %s" % \
+                        self.__myArrayStr(field_ptr, self.__curv_shape)
+                finally:
+                    fout.close()
+
+
+    def createRectGrid(self, center_lons, center_lats, center_levs,
+                       center_ignore=None, levels_are_depths=True,
+                       corner_lons=None, corner_lats=None, corner_levs=None,
+                       corner_ignore=None):
+        '''
+        Create the rectilinear grid as an ESMP_Grid using the provided cell
+        center and edge longitudes, latitudes, and levels to define the grid
+        center and corner points.  Rectilinear data is assigned to the center
+        points.  Grid point [i,j,k] is assigned from lons[i], lats[j], and
+        levs[k].
+
+        Center point [i,j,k] is taken to be the center point of the
+        quadrilaterally-faced hexahedron defined by the corner points:
+        corner_pt[i, j, k], corner_pt[i+1, j, k], corner_pt[i+1, j+1, k],
+        corner_pt([i, j+1, k], corner_pt[i, j, k+1], corner_pt[i+1, j, k+1],
+        corner_pt[i+1, j+1, k+1], and corner_pt[i, j+1, k+1].
+
+        Any previous ESMP_Grid, ESMP_Field, or ESMP regridding procedures
+        are destroyed.
+
+        Arguments:
+            center_lons:       1D array of longitudes, in degrees,
+                               for each of the rectilinear grid cells center
+                               planes
+            center_lats:       1D array of latitudes, in degrees,
+                               for each of the rectilinear grid cells center
+                               planes
+            center_levs:       1D array of levels, in meters from the earth
+                               radius, for each of the rectilinear grid cells
+                               center planes
+            center_ignore:     3D array of boolean-like values, indicating if
+                               the corresponding grid center point should be
+                               ignored in the regridding; if None, no grid
+                               center points will be ignored
+            levels_are_depths: True -  levels are depths and subtracted from
+                                       the earth radius,
+                               False - levels are elevations and added to
+                                       the earth radius
+            corner_lons:       1D array of longitudes, in degrees,
+                               for each of the rectilinear grid cells corner
+                               planes
+            corner_lats:       1D array of latitudes, in degrees,
+                               for each of the rectilinear grid cells corner
+                               planes
+            corner_levs:       1D array of levels, in meters from the earth
+                               radius, for each of the rectilinear grid cells
+                               corner planes
+            corner_ignore:     3D array of boolean-like values, indicating if
+                               the corresponding grid corner point should be
+                               ignored in the regridding; if None, no grid
+                               corner points will be ignored
+        Returns:
+            None
+        Raises:
+            ValueError: if the shape (dimensionality) of an argument is
+                        invalid, or if a value in an argument is invalid
+            TypeError:  if an argument is not array-like
+        '''
+        # Make sure center_lons is an appropriate array-like argument
+        center_lons_array = numpy.array(center_lons, dtype=numpy.float64, copy=False)
+        if len(center_lons_array.shape) != 1:
+            raise ValueError("center_lons must be one-dimensional")
+
+        # Make sure center_lats is an appropriate array-like argument
+        center_lats_array = numpy.array(center_lats, dtype=numpy.float64, copy=True)
+        if len(center_lats_array.shape) != 1:
+            raise ValueError("center_lats must be one-dimensional")
+
+        # Make sure center_levs is an appropriate array-like argument
+        center_levs_array = numpy.array(center_levs, dtype=numpy.float64, copy=True)
+        if len(center_levs_array.shape) != 1:
+            raise ValueError("center_levs must be one-dimensional")
+
+        if center_ignore == None:
+            # Using all center points, no mask created
+            center_ignore_array = None
+        else:
+            # Make sure center_ignore is an appropriate array-like argument
+            center_ignore_array = numpy.array(center_ignore, dtype=numpy.bool, copy=False)
+            if center_ignore_array.shape != (center_lons_array.shape[0],
+                                             center_lats_array.shape[0],
+                                             center_levs_array.shape[0]):
+                raise ValueError("center_ignore must have the shape " \
+                                 "( len(center_lons), len(center_lats), len(center_levs) )")
+            # If not actually ignoring any center points, do not create a mask
+            if not center_ignore_array.any():
+                center_ignore_array = None
+
+        if (corner_lons != None) and (corner_lats != None) and (corner_levs != None):
+            # Corner points specified
+
+            # Make sure corner_lons is an appropriate array-like argument
+            corner_lons_array = numpy.array(corner_lons, dtype=numpy.float64, copy=False)
+            if corner_lons_array.shape != (center_lons_array.shape[0] + 1, ):
+                raise ValueError("corner_lons must have shape ( len(center_lons) + 1, )")
+
+            # Make sure corner_lats is an appropriate array-like argument
+            corner_lats_array = numpy.array(corner_lats, dtype=numpy.float64, copy=True)
+            if corner_lats_array.shape != (center_lats_array.shape[0] + 1, ):
+                raise ValueError("corner_lats must have shape ( len(center_lats) + 1, )")
+
+            # Make sure corner_levs is an appropriate array-like argument
+            corner_levs_array = numpy.array(corner_levs, dtype=numpy.float64, copy=True)
+            if corner_levs_array.shape != (center_levs_array.shape[0] + 1, ):
+                raise ValueError("corner_levs must have shape ( len(center_levs) + 1, )")
+
+            if corner_ignore == None:
+                # Using all corner points, no mask created
+                corner_ignore_array = None
+            else:
+                # Make sure corner_ignore is an appropriate array-like argument
+                corner_ignore_array = numpy.array(corner_ignore, dtype=numpy.bool, copy=False)
+                if corner_ignore_array.shape != (corner_lons_array.shape[0],
+                                                 corner_lats_array.shape[0],
+                                                 corner_levs_array.shape[0]):
+                    raise ValueError("corner_ignore must have the shape " \
+                                     "( len(corner_lons), len(corner_lats), len(corner_levs) )")
+                # If not actually ignoring any points, do not create a mask
+                if not corner_ignore_array.any():
+                    corner_ignore_array = None
+
+        elif (corner_lons != None) or (corner_lats != None) or (corner_levs != None):
+            raise ValueError("one or two, but not all three, of corner_lons, " \
+                             "corner_lats, and corner_levs are given")
+        elif corner_ignore != None:
+            raise ValueError("corner_ignore given without corner_lons, " \
+                             "corner_lats, and corner_levs")
+        else:
+            # No corner points specified
+            corner_lons_array = None
+            corner_lats_array = None
+            corner_levs_array = None
+            corner_ignore_array = None
+
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any rectilinear ESMP_Fields
+        if self.__rect_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_src_field)
+            self.__rect_src_field = None
+        if self.__rect_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_dest_field)
+            self.__rect_dest_field = None
+        # Destroy any previous rectilinear ESMP_Grid
+        if self.__rect_grid != None:
+            ESMP.ESMP_GridDestroy(self.__rect_grid);
+            self.__rect_grid = None
+
+        # Create the rectilinear 3D cartesian coordinates ESMP_Grid
+        # using ESMP_GridCreateNoPeriDim for the typical case (not
+        # the whole world) in Ferret.
+        self.__rect_shape = (center_lons_array.shape[0],
+                             center_lats_array.shape[0],
+                             center_levs_array.shape[0])
+        grid_shape = numpy.array(self.__rect_shape, dtype=numpy.int32)
+        self.__rect_grid = ESMP.ESMP_GridCreateNoPeriDim(grid_shape,
+                                         ESMP.ESMP_COORDSYS_CART,
+                                         ESMP.ESMP_TYPEKIND_R8)
+
+        if corner_lons_array != None:
+            # Allocate space for the grid corner coordinates
+            ESMP.ESMP_GridAddCoord(self.__rect_grid, ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+
+            # Retrieve the grid corner coordinate arrays in the ESMP_Grid
+            grid_x_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 0,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+            grid_y_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 1,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+            grid_z_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 2,
+                                                      ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+
+            # Assign the cartesian coordinates of the grid corners in the ESMP_Grid
+            # numpy.tile([a,b,c], 2) = [a,b,c,a,b,c]
+            # numpy.repeat([a,b,c], 2) = [a,a,b,b,c,c]
+            corner_shape = (corner_lons_array.shape[0],
+                            corner_lats_array.shape[0],
+                            corner_levs_array.shape[0])
+            lons = numpy.deg2rad(corner_lons_array)
+            cos_lons = numpy.tile(numpy.cos(lons),
+                                  corner_shape[1] * corner_shape[2])
+            sin_lons = numpy.tile(numpy.sin(lons),
+                                  corner_shape[1] * corner_shape[2])
+            lats = numpy.deg2rad(corner_lats_array)
+            cos_lats = numpy.tile(numpy.repeat(numpy.cos(lats), corner_shape[0]),
+                                  corner_shape[2])
+            sin_lats = numpy.tile(numpy.repeat(numpy.sin(lats), corner_shape[0]),
+                                  corner_shape[2])
+            levs = corner_levs_array / 1000.0
+            if levels_are_depths:
+                levs *= -1.0
+            levs += self.__earth_rad
+            levs /= self.__earth_rad
+            levs = numpy.repeat(levs, corner_shape[0] * corner_shape[1])
+            # XY plane through the prime meridian, Z toward central atlantic
+            # 0 lon, 0 lat = (0, 0, R); 90 lon, 0 lat = (R, 0, 0); * lon, 90 lat = (0, R, 0)
+            grid_x_coords[:] = levs * sin_lons * cos_lats
+            grid_y_coords[:] = levs * sin_lats
+            grid_z_coords[:] = levs * cos_lons * cos_lats
+
+            if self.__debug:
+                fout = open("rect_corner_xyz.txt", "w")
+                try:
+                    print >>fout, "rect_corner_x = %s" % \
+                        self.__myArrayStr(grid_x_coords, corner_shape)
+                    print >>fout, "rect_corner_y = %s" % \
+                        self.__myArrayStr(grid_y_coords, corner_shape)
+                    print >>fout, "rect_corner_z = %s" % \
+                        self.__myArrayStr(grid_z_coords, corner_shape)
+                finally:
+                    fout.close()
+
+            # Add a mask if not considering all the corner points
+            if (corner_ignore_array != None):
+                # Allocate space for the grid corners mask
+                ESMP.ESMP_GridAddItem(self.__rect_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                        ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+                # Retrieve the grid corners mask array in the ESMP_Grid
+                ignore_mask = ESMP.ESMP_GridGetItem(self.__rect_grid,
+                                                    ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CORNER_VFACE)
+                # Assign the mask in the ESMP_Grid; 
+                # False (turns into zero) means use the point;
+                # True (turns into one) means ignore the point;
+                # flatten in column-major (F) order to match lon-lat-lev assignment order
+                ignore_mask[:] = corner_ignore_array.flatten('F')
+
+        # Allocate space for the grid center coordinates
+        ESMP.ESMP_GridAddCoord(self.__rect_grid, ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        # Retrieve the grid center coordinate arrays in the ESMP_Grid
+        grid_x_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 0,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+        grid_y_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 1,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+        grid_z_coords = ESMP.ESMP_GridGetCoordPtr(self.__rect_grid, 2,
+                                                  ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        # Assign the cartesian coordinates of the grid centers in the ESMP_Grid
+        # numpy.tile([a,b,c], 2) = [a,b,c,a,b,c]
+        # numpy.repeat([a,b,c], 2) = [a,a,b,b,c,c]
+        lons = numpy.deg2rad(center_lons_array)
+        cos_lons = numpy.tile(numpy.cos(lons),
+                              center_lats_array.shape[0] * center_levs_array.shape[0])
+        sin_lons = numpy.tile(numpy.sin(lons),
+                              center_lats_array.shape[0] * center_levs_array.shape[0])
+        lats = numpy.deg2rad(center_lats_array)
+        cos_lats = numpy.tile(numpy.repeat(numpy.cos(lats),
+                                           center_lons_array.shape[0]),
+                              center_levs_array.shape[0])
+        sin_lats = numpy.tile(numpy.repeat(numpy.sin(lats),
+                                           center_lons_array.shape[0]),
+                              center_levs_array.shape[0])
+        levs = center_levs_array / 1000.0
+        if levels_are_depths:
+            levs *= -1.0
+        levs += self.__earth_rad
+        levs /= self.__earth_rad
+        levs = numpy.repeat(levs, center_lons_array.shape[0] * center_lats_array.shape[0])
+        # XY plane through the prime meridian, Z toward central atlantic
+        # 0 lon, 0 lat = (0, 0, R); 90 lon, 0 lat = (R, 0, 0); * lon, 90 lat = (0, R, 0)
+        grid_x_coords[:] = levs * sin_lons * cos_lats
+        grid_y_coords[:] = levs * sin_lats
+        grid_z_coords[:] = levs * cos_lons * cos_lats
+
+        if self.__debug:
+            try:
+                fout = open("rect_center_xyz.txt", "w")
+                print >>fout, "rect_center_x = %s" % \
+                    self.__myArrayStr(grid_x_coords, self.__rect_shape)
+                print >>fout, "rect_center_y = %s" % \
+                    self.__myArrayStr(grid_y_coords, self.__rect_shape)
+                print >>fout, "rect_center_z = %s" % \
+                    self.__myArrayStr(grid_z_coords, self.__rect_shape)
+            finally:
+                fout.close()
+
+        # Add a mask if not considering all the center points
+        if (center_ignore_array != None):
+            # Allocate space for the grid centers mask
+            ESMP.ESMP_GridAddItem(self.__rect_grid, ESMP.ESMP_GRIDITEM_MASK,
+                                                    ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+            # Retrieve the grid centers mask array in the ESMP_Grid
+            ignore_mask = ESMP.ESMP_GridGetItem(self.__rect_grid,
+                                                ESMP.ESMP_GRIDITEM_MASK,
+                                                ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+            # Assign the mask in the ESMP_Grid; 
+            # False (turns into zero) means use the point;
+            # True (turns into one) means ignore the point;
+            # flatten in column-major (F) order to match lon-lat-lev assignment order
+            ignore_mask[:] = center_ignore_array.flatten('F')
+
+
+    def assignRectField(self, data=None):
+        '''
+        Possibly creates, and possible assigns, an appropriate rectilinear
+        ESMP_Field located at the center points of the grid.  An ESMP_Field
+        is created if and only if it is not already present; thus allowing
+        the "weights" computed from a previous regridding to be reused.
+
+        If data is not None, assigns the data values to the rectilinear
+        source ESMP_Field, creating the ESMP_field if it does not exist.
+
+        If data is None, only creates the rectilinear destination ESMP_Field
+        if it does not exist.
+
+        Arguments:
+            data: 3D array of data values to be assigned in an
+                  ESMP_Field for the grid center points; if None,
+                  no data in any ESMP_Field is modified.
+        Returns:
+            None
+        Raises:
+            ValueError: if data is not None, and if the shape
+                        (dimensionality) of data is invalid or
+                        if a value in data is not numeric
+            TypeError:  if data, if not None, is not array-like
+        '''
+        if data == None:
+
+            # Create the rectilinear destination ESMP_Field if it does not exist
+            if self.__rect_dest_field == None:
+                self.__rect_dest_field = ESMP.ESMP_FieldCreateGrid(self.__rect_grid,
+                                                        "rect_dest_field",
+                                                        ESMP.ESMP_TYPEKIND_R8,
+                                                        ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+        else:
+
+            # Make sure data is an appropriate array-like argument
+            data_array = numpy.array(data, dtype=numpy.float64, copy=True)
+            if data_array.shape != self.__rect_shape:
+                raise ValueError("data must have the shape " \
+                                 "( len(center_lats), len(center_lats), len(center_levs) ) ")
+
+            # Create the rectilinear source ESMP_Field if it does not exist
+            if self.__rect_src_field == None:
+                self.__rect_src_field = ESMP.ESMP_FieldCreateGrid(self.__rect_grid,
+                                                       "rect_src_field",
+                                                       ESMP.ESMP_TYPEKIND_R8,
+                                                       ESMP.ESMP_STAGGERLOC_CENTER_VCENTER)
+
+            # Retrieve the field data array in the ESMP_Field
+            field_ptr = ESMP.ESMP_FieldGetPtr(self.__rect_src_field)
+
+            # Assign the data to the field array in the ESMP_Field;
+            # flatten in column-major (F) order to match lon-lat-lev assignment order
+            field_ptr[:] = data_array.flatten('F')
+            if self.__debug:
+                fout = open("rect_data.txt", "w")
+                try:
+                    print >>fout, "rect_data = %s" % \
+                        self.__myArrayStr(field_ptr, self.__rect_shape)
+                finally:
+                    fout.close()
+
+
+    def regridCurvToRect(self, undef_val,
+                         method=ESMP.ESMP_REGRIDMETHOD_BILINEAR):
+        '''
+        Regrids from the curvilinear source ESMP_Field to the rectilinear
+        destination ESMP_Field using the given regridding method.  Reuses
+        the appropriate regridding procedure if one already exists;
+        otherwise a new regridding procedure is created and stored.
+
+        Prior to calling this method, the curvilinear source ESMP_Field
+        must be created by calling createCurvGrid, then assignCurvField
+        with valid data.  The rectilinear destination ESMP_Field must
+        also have been created by calling createRectGrid, and then
+        assignRectField with no data argument (or None for data).
+
+        Arguments:
+            undef_val: numpy array containing one numeric value to
+                       be used as the undefined data value in the
+                       returned array
+            method:    one of the ESMP regridding method identifiers,
+                       such as:
+                           ESMP.ESMP_REGRIDMETHOD_BILINEAR
+                           ESMP.ESMP_REGRIDMETHOD_CONSERVE
+                           ESMP.ESMP_REGRIDMETHOD_PATCH
+                       Conservative regridding requires that both
+                       corner and center point coordinates are
+                       defined in the grids.
+        Returns:
+            data: a 3D numpy array of data values located at the
+                  rectilinear grid centers representing the regridded
+                  curvilinear ESMP_Field data.  The undefined data
+                  value will be assigned to unassigned data points.
+        Raises:
+            ValueError: if either the curvilinear source ESMP_Field
+                        or the rectilinear destination ESMP_Field
+                        does not exist.
+        '''
+        # Check that the source and destination fields exist
+        if self.__curv_src_field == None:
+            raise ValueError("Curvilinear source ESMP_Field does not exist")
+        if self.__rect_dest_field == None:
+            raise ValueError("Rectilinear destination ESMP_Field does not exist")
+
+        # Check if a regrid procedure handle already exists for this method
+        handle = self.__curv_to_rect_handles.get(method, None)
+        # If no handle found, create one
+        if handle == None:
+            # Assign the value in the masks marking points to be ignored
+            ignore_mask_value = numpy.array([1], dtype=numpy.int32)
+            # Generate the procedure handle
+            handle = ESMP.ESMP_FieldRegridStore(self.__curv_src_field,
+                                                self.__rect_dest_field,
+                                                ignore_mask_value, ignore_mask_value,
+                                                method, ESMP.ESMP_UNMAPPEDACTION_IGNORE)
+            # Save the handle for this method for future regrids
+            self.__curv_to_rect_handles[method] = handle
+
+        # Initialize the destination field values with the undefined data value
+        field_ptr = ESMP.ESMP_FieldGetPtr(self.__rect_dest_field)
+        field_ptr[:] = undef_val
+
+        # Perform the regridding, zeroing out only the 
+        # destination fields values that will be assigned
+        ESMP.ESMP_FieldRegrid(self.__curv_src_field, self.__rect_dest_field,
+                              handle, ESMP.ESMP_REGION_SELECT)
+
+        # Make a copy of the destination field values to return, reshaped to 3D
+        result = numpy.array(field_ptr, dtype=numpy.float64, copy=True)
+        if self.__debug:
+            fout = open("regr_rect_data.txt", "w")
+            try:
+                print >>fout, "regr_rect_data = %s" % \
+                    self.__myArrayStr(result, self.__rect_shape)
+            finally:
+                fout.close()
+
+        result = result.reshape(self.__rect_shape, order='F')
+
+        return result
+
+
+    def regridRectToCurv(self, undef_val,
+                         method=ESMP.ESMP_REGRIDMETHOD_BILINEAR):
+        '''
+        Regrids from the rectilinear source ESMP_Field to the curvilinear
+        destination ESMP_Field using the given regridding method.  Reuses
+        the appropriate regridding procedure if one already exists;
+        otherwise a new regridding procedure is created and stored.
+
+        Prior to calling this method, the rectilinear source ESMP_Field
+        must be created by calling createRectGrid, then assignRectField
+        with valid data.  The curvilinear destination ESMP_Field must
+        also have been created by calling createCurvGrid, and then
+        assignCurvField with no data argument (or None for data).
+
+        Arguments:
+            undef_val: numpy array containing one numeric value to
+                       be used as the undefined data value in the
+                       returned array
+            method:    one of the ESMP regridding method identifiers,
+                       such as:
+                           ESMP.ESMP_REGRIDMETHOD_BILINEAR
+                           ESMP.ESMP_REGRIDMETHOD_CONSERVE
+                           ESMP.ESMP_REGRIDMETHOD_PATCH
+                       Conservative regridding requires that both
+                       corner and center point coordinates are
+                       defined in the grids.
+        Returns:
+            data: a 3D array of data values located at the curvilinear
+                  grid centers representing the regridded rectilinear
+                  ESMP_Field data.  The undefined data value will be
+                  assigned to unassigned data points.
+        Raises:
+            ValueError: if either the rectilinear source ESMP_Field
+                        or the curvilinear destination ESMP_Field
+                        does not exist.
+        '''
+        # Check that the source and destination fields exist
+        if self.__rect_src_field == None:
+            raise ValueError("Rectilinear source ESMP_Field does not exist")
+        if self.__curv_dest_field == None:
+            raise ValueError("Curvilinear destination ESMP_Field does not exist")
+
+        # Check if a regrid procedure handle already exists for this method
+        handle = self.__rect_to_curv_handles.get(method, None)
+        # If no handle found, create one
+        if handle == None:
+            # Assign the value in the masks marking points to be ignored
+            ignore_mask_value = numpy.array([1], dtype=numpy.int32)
+            # Generate the procedure handle
+            handle = ESMP.ESMP_FieldRegridStore(self.__rect_src_field,
+                                                self.__curv_dest_field,
+                                                ignore_mask_value, ignore_mask_value,
+                                                method, ESMP.ESMP_UNMAPPEDACTION_IGNORE)
+            # Save the handle for this method for future regrids
+            self.__rect_to_curv_handles[method] = handle
+
+        # Initialize the destination field values with the undefined data value
+        field_ptr = ESMP.ESMP_FieldGetPtr(self.__curv_dest_field)
+        field_ptr[:] = undef_val
+
+        # Perform the regridding, zeroing out only the 
+        # destination fields values that will be assigned
+        ESMP.ESMP_FieldRegrid(self.__rect_src_field, self.__curv_dest_field,
+                              handle, ESMP.ESMP_REGION_SELECT)
+
+        # Make a copy of the destination field values to return, reshaped to 3D
+        result = numpy.array(field_ptr, dtype=numpy.float64, copy=True)
+        if self.__debug:
+            fout = open("regr_curv_data.txt", "w")
+            try:
+                print >>fout, "regr_curv_data = %s" % \
+                    self.__myArrayStr(result, self.__curv_shape)
+            finally:
+                fout.close()
+        result = result.reshape(self.__curv_shape, order='F')
+
+        return result
+
+
+    def finalize(self):
+        '''
+        Destroys any ESMP_Grid, ESMP_Field, and ESMP regridding
+        procedures present in this instance.  If ESMP is no longer
+        needed, ESMP.ESMP_Finalize() should be called to free any
+        ESMP and ESMF resources.
+
+        Arguments:
+            None
+        Returns:
+            None
+        '''
+        # Release any regridding procedures and clear the dictionaries
+        for handle in self.__rect_to_curv_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__rect_to_curv_handles.clear()
+        for handle in self.__curv_to_rect_handles.values():
+            ESMP.ESMP_FieldRegridRelease(handle)
+        self.__curv_to_rect_handles.clear()
+        # Destroy any ESMP_Fields
+        if self.__rect_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_src_field)
+            self.__rect_src_field = None
+        if self.__rect_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__rect_dest_field)
+            self.__rect_dest_field = None
+        if self.__curv_src_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_src_field)
+            self.__curv_src_field = None
+        if self.__curv_dest_field != None:
+            ESMP.ESMP_FieldDestroy(self.__curv_dest_field)
+            self.__curv_dest_field = None
+        # Destroy any ESMP_Grids
+        if self.__rect_grid != None:
+            ESMP.ESMP_GridDestroy(self.__rect_grid);
+            self.__rect_grid = None
+        if self.__curv_grid != None:
+            ESMP.ESMP_GridDestroy(self.__curv_grid);
+            self.__curv_grid = None
+        # clear the shape attributes just to be complete
+        self.__rect_shape = None
+        self.__curv_shape = None
+
+
+    def __myArrayStr(self, arr, shape):
+        '''
+        Private utility method for debug printing of data arrays
+
+        Arguments:
+            arr -   numpy array (3D array flattened in Fortran order)
+                    to be printed
+            shape - tuple giving the 3D shape for the arr
+        Returns:
+            string representation of arr as
+                "numpy.array([...]).reshape((...), order='F')"
+            with newlines providing a block structure of the data.
+            Data values are printed in format %#10.6f
+        '''
+        mystr = 'numpy.array([\n'
+        k = 0
+        for val in arr:
+            mystr += '%#10.6f,' % val
+            k += 1
+            if k % shape[0] == 0:
+                mystr += '\n'
+            if k % (shape[0] * shape[1]) == 0:
+                mystr += '\n'
+        if mystr[-2:] == '\n\n':
+            mystr = mystr[:-1] + ']'
+        elif mystr[-1] == '\n':
+            mystr += ']'
+        else:
+            mystr += '\n]'
+        mystr += ").reshape(%s, order='F')" % str(shape)
+        return mystr
+
diff --git a/pyfermod/regrid/regrid3dexample.py b/pyfermod/regrid/regrid3dexample.py
new file mode 100644
index 0000000..e08eac9
--- /dev/null
+++ b/pyfermod/regrid/regrid3dexample.py
@@ -0,0 +1,588 @@
+'''
+A Python program for testing the regrid3d.CurvRect3DRegridder class "by hand"
+and also serves as a coding example of using this class.
+
+ at author: Karl Smith
+'''
+
+import numpy
+import ESMP
+from esmpcontrol import ESMPControl
+from regrid3d import CurvRect3DRegridder
+
+
+GULF_MEX_LONS = (262.0, 278.0, 0.5)
+GULF_MEX_LATS = (18.0, 31.0, 0.5)
+# Gulf of Mexico Relief of the Surface of the Earth (meters) 98W:82W:0.5 (columns), 18N:31N:0.5 (rows)
+GULF_MEX_ROSE = (
+      ( 1627.1,  2130.9,  1317.9,   373.8,   125.7,    45.0,    25.0,    20.0,    25.0,    25.0,
+          15.0,    15.0,    25.0,    25.0,    40.0,    74.3,   169.7,   179.7,   151.3,    23.0,
+          -3.2, -1638.9, -3668.0, -4098.9, -3075.3, -3017.9, -4554.6, -4969.7, -4961.6, -5008.2,
+       -4759.7, -4932.3, -4016.7, ),
+      ( 1951.7,  1669.0,   685.7,    63.4,    50.7,   779.4,   400.0,   -70.7,   -49.0,   -16.2,
+          -6.1,     2.0,    -9.6,     5.0,    69.7,    80.1,   194.7,   210.2,   110.6,     6.1,
+          -0.3,  -192.5, -1587.3, -4357.8, -4401.9, -4397.7, -2980.1, -2035.6,  -463.5, -2265.7,
+       -4933.4, -4959.4, -4490.4, ),
+      ( 2220.5,  2654.2,  1232.2,    60.8,   -10.0,  -217.9, -1170.2,  -807.9,  -599.1,  -388.8,
+        -101.1,   -40.1,   -14.0,    -8.1,    19.9,    65.0,   139.4,   175.8,   115.2,    40.3,
+           0.0,  -220.1,  -919.6, -4284.3, -4502.4, -4474.9, -4418.9, -3648.0, -2258.9, -2581.0,
+       -2998.4, -3578.1, -3493.9, ),
+      ( 2593.1,  2368.9,  1097.8,    29.9,  -225.9, -1889.3, -2357.3, -1504.2, -1161.4,  -939.7,
+        -702.9,  -141.0,   -47.9,   -29.0,   -13.1,    29.7,    94.8,   150.0,   110.0,    70.5,
+           0.0,  -340.6, -1551.1, -4353.5, -4516.0, -4534.5, -4455.3, -4438.0, -4153.9, -3078.7,
+       -3004.0, -3228.8, -3595.4, ),
+      ( 1944.0,   923.6,   191.8,   -12.8, -1599.3, -2398.4, -2802.9, -1996.6, -1597.9, -1039.4,
+       -1061.3, -1345.8,   -62.4,   -25.9,   -21.1,    -9.9,    79.4,   120.0,    65.3,    30.5,
+          -1.0,  -278.2,  -994.7, -1794.1, -4315.4, -4438.8, -4437.1, -4443.0, -4378.4, -3605.0,
+       -3977.6, -4239.2, -2402.8, ),
+      (  459.9,   210.9,    -9.9,  -588.9, -1913.3, -2591.4, -3053.4, -2975.4, -2016.1, -1992.1,
+       -1619.8, -1926.1,   -38.2,   -23.6,   -23.0,    -0.1,    30.0,    30.2,    24.8,    15.0,
+          10.0,     5.0,  -262.5, -1178.6, -2949.8, -4621.6, -4421.9, -4450.7, -4401.8, -4361.9,
+       -4401.3, -4437.3, -3876.6, ),
+      (  108.9,    23.3,   -97.1, -1136.2, -2098.3, -2602.7, -3192.4, -3178.5, -2608.1, -2588.1,
+       -2597.9,  -660.0,    -9.9,   -40.1,   -29.0,   -10.1,     5.0,    10.0,    10.0,    10.0,
+          10.0,    10.0,     0.0,  -276.1, -1413.3, -4101.5, -3835.0, -4424.2, -4415.9, -4443.6,
+       -4443.1, -4460.6, -4399.8, ),
+      (   69.7,   -10.0,  -402.6, -1785.3, -2391.5, -2800.2, -3278.6, -3408.0, -3111.9, -3002.1,
+       -3014.9,  -782.6,   -44.6,   -17.9,   -21.9,   -29.0,   -21.0,   -14.0,   -12.0,     0.0,
+           0.0,   -10.0,   -10.0,  -103.2, -1775.1, -2001.9, -2965.9, -3711.9, -3032.2, -2801.0,
+          -3.1,  -920.6, -1273.1, ),
+      (   64.0,   -10.0, -1313.9, -2190.4, -2769.9, -2899.3, -3317.6, -3536.4, -3564.0, -3364.1,
+       -3331.0, -1715.7,   -13.2,   -47.9,   -19.7,   -46.2,   -45.9,   -40.0,   -33.1,    -3.1,
+         -24.9,    -4.2,   -10.0,  -202.8, -1409.1, -1982.8,  -298.8,     0.0,  -575.5,  -339.9,
+          -3.9,   -10.0,   -10.0, ),
+      (   -8.5,   -10.0, -1714.1, -2321.6, -2790.2, -3072.8, -3446.8, -3621.8, -3639.0, -3635.0,
+       -3581.5, -3569.9, -3367.2, -1055.4,  -227.7,  -117.0,   -53.2,   -47.7,   -61.2,   -55.2,
+         -53.0,   -50.0,  -133.0,  -507.9, -1065.2, -1840.9, -2201.4,  -907.3,   192.0,    32.1,
+          -2.2,   -10.0,   -10.0, ),
+      (    7.2,   -45.9, -1526.8, -2196.7, -2588.5, -3178.9, -3593.6, -3630.1, -3623.9, -3628.0,
+       -3621.0, -3619.0, -3709.8, -3908.8, -3558.9, -1507.3,  -237.2,   -45.2,    -4.3,   -62.2,
+         -48.1,   -32.1,  -394.2,  -807.6, -1193.3, -1139.0, -2075.7, -2395.8, -2128.4, -1034.6,
+          42.3,   112.0,   125.4, ),
+      (  134.6,   -39.1, -1078.0, -2179.4, -2595.1, -3002.4, -3565.4, -3618.1, -3666.8, -3679.0,
+       -3648.2, -3598.0, -3597.9, -3602.0, -3695.7, -3695.5, -1106.2,  -725.6,   -12.7,   -10.0,
+         -92.3,  -151.6,  -591.2,  -977.7, -2939.2, -1435.4, -3011.0, -2948.8, -2399.3, -2182.2,
+       -1800.0, -1789.0, -1570.9, ),
+      (   55.0,   -35.2,  -838.4, -1609.6, -2488.7, -3268.8, -3594.0, -3613.1, -3724.5, -3727.1,
+       -3714.9, -3671.4, -3739.6, -3718.0, -3655.8, -3607.0, -3826.2, -3652.7, -3069.2,  -352.8,
+        -181.9,  -396.3,  -994.3, -1254.2, -3228.1, -3401.8, -3468.6, -2829.9, -2184.4, -1017.2,
+       -1006.6,  -808.0, -1059.1, ),
+      (   -8.7,   -18.7,  -141.0, -1008.6, -2264.6, -3205.6, -3619.4, -3620.2, -3654.8, -3655.1,
+       -3631.0, -3622.0, -3611.0, -3609.0, -3616.1, -3611.1, -3600.8, -3851.1, -3622.7, -2515.4,
+       -1578.2, -1492.1, -1769.6, -3051.5, -3383.7, -3415.2, -3402.4, -3268.5, -1954.1,  -192.3,
+         -40.4,   -13.9,   -34.0, ),
+      (    2.1,   -10.0,   -65.5,  -487.2, -1596.1, -2703.7, -3579.7, -3627.0, -3628.0, -3612.1,
+       -3609.9, -3578.6, -3542.4, -3511.9, -3587.7, -3583.2, -3545.1, -3585.9, -3544.5, -3302.6,
+       -3388.8, -3189.2, -3241.8, -3287.6, -3321.9, -3363.9, -3249.2, -2189.4,  -127.6,   -33.0,
+         -43.8,   -35.9,   -10.0, ),
+      (   17.1,     2.0,   -25.7,  -129.9, -1088.0, -1432.3, -3386.1, -3450.0, -3524.9, -3534.9,
+       -3478.5, -3322.9, -3172.3, -3173.0, -3485.8, -3474.6, -3377.6, -3338.1, -3346.9, -3323.2,
+       -3332.8, -3348.0, -3326.2, -3248.5, -3205.8, -3292.8, -3125.2,  -576.5,   -10.0,   -95.3,
+         -54.2,   -34.1,   -10.1, ),
+      (   17.2,     5.1,   -26.6,   -16.6,  -984.4, -1684.9, -2579.5, -3005.0, -3172.7, -3123.2,
+       -2726.5, -2209.1, -2458.3, -2407.9, -3268.3, -3300.9, -3207.9, -3135.3, -3060.5, -2991.1,
+       -3029.2, -3116.5, -3162.7, -3184.2, -3205.8, -3252.9, -2952.0,  -322.8,   -16.8,  -100.2,
+         -44.2,   -30.0,   -12.1, ),
+      (   13.1,   -10.0,   -29.0,   -98.8, -1000.0, -1589.9, -1674.0, -1989.6, -1577.0, -1851.7,
+       -1797.0, -1904.0, -1999.0, -2290.0, -2206.1, -2795.8, -2937.9, -2917.3, -2723.1, -2597.1,
+       -2752.5, -2909.1, -2999.6, -3094.5, -3177.6, -3381.8, -2460.4,  -200.7,   -85.4,   -73.2,
+         -36.1,   -16.1,     0.9, ),
+      (   14.0,    -9.7,   -41.8,  -140.8,  -789.2, -1386.5, -1399.6, -1211.4, -1293.0, -1023.3,
+       -1212.6, -1503.1, -1733.2, -1991.2, -1894.8, -1864.4, -2391.9, -2511.8, -2282.3, -2586.4,
+       -2724.9, -2879.5, -2959.6, -3129.6, -3203.8, -3205.9,  -817.6,  -102.9,   -89.2,   -50.3,
+         -33.1,    -9.1,     7.8, ),
+      (   19.3,    -9.6,   -28.7,   -67.7,  -205.8,  -796.4,  -994.9,  -950.1,  -881.5,  -601.2,
+        -796.9,  -869.5,  -814.3, -1010.9, -1083.3, -1199.0, -1203.9, -1873.3, -1800.9, -2018.7,
+       -2598.2, -2898.5, -3047.9, -3258.1, -3224.9, -1994.5,  -406.1,  -116.8,   -65.2,   -39.1,
+         -17.2,    13.8,    20.2, ),
+      (   41.6,    14.1,    -5.8,   -28.8,   -43.9,   -61.6,   -58.8,   -89.9,   -80.0,  -100.0,
+        -103.2,  -105.9,  -134.1,  -203.9,  -211.7,  -228.9,  -537.9, -1026.6, -1397.3, -2180.6,
+       -2476.4, -2800.7, -2668.6, -2293.7, -1026.3,  -600.2,  -230.9,   -80.6,   -44.1,   -29.0,
+          -9.1,     8.9,    38.4, ),
+      (  105.0,    44.1,     7.2,     0.0,    -7.9,   -27.9,   -31.0,   -28.0,   -41.9,   -47.0,
+         -47.0,   -49.0,   -49.0,   -39.0,   -29.0,   -37.9,  -196.6,  -395.4,  -885.8, -1677.7,
+       -2276.7, -1953.6,  -873.2,  -570.8,  -303.7,  -200.0,  -100.1,   -50.1,   -33.1,   -23.1,
+         -10.1,    36.6,    35.8, ),
+      (   85.3,    81.1,    31.2,    15.0,    11.1,     2.1,    -7.0,   -17.9,   -19.0,   -20.0,
+         -22.0,   -25.0,   -18.0,   -10.0,    -3.0,    -8.0,   -24.8,   -11.4,   -77.7,  -502.6,
+       -1330.0, -1583.2,  -704.2,  -377.0,  -219.5,   -99.1,   -42.1,   -34.1,   -28.0,   -14.1,
+          -4.1,    16.4,    25.0, ),
+      (  189.7,    83.3,    79.0,    45.2,    29.9,    15.0,   -10.7,    -1.3,   -12.0,    -9.0,
+         -12.0,    -9.0,    -1.0,    -1.0,     1.0,     1.0,    -0.3,    -9.0,   -13.9,   -42.7,
+         -51.4,  -109.8,  -397.0,  -187.9,   -58.6,   -20.2,    -9.0,   -20.1,   -19.0,    -4.2,
+          11.8,    24.0,    36.4, ),
+      (  210.0,   148.8,   104.6,    76.4,    56.2,    26.2,    14.1,     8.1,     1.1,     2.9,
+           5.0,     3.1,     6.0,     1.0,     3.0,     3.0,    -9.6,    -0.3,   -10.0,   -24.8,
+         -28.1,   -28.0,   -95.3,   -58.0,   -31.1,     4.8,     8.9,     0.1,    -1.0,    16.0,
+          12.0,    32.1,    24.7, ),
+      (  259.9,   163.1,   111.3,    66.4,   105.2,    97.8,    20.5,    30.1,    20.2,    17.1,
+          12.0,    14.0,     8.0,     7.0,     9.0,     6.1,    15.9,    20.1,     9.0,    14.8,
+          -1.0,     4.2,    -0.8,     3.8,    17.9,    46.0,    53.6,    21.5,    39.1,    32.4,
+          34.1,    31.9,    19.2, ),
+      (  272.2,   149.6,   114.9,   130.2,    88.9,    55.0,    95.1,    92.3,    93.1,    58.1,
+          52.1,    23.1,    11.9,    71.1,    66.6,    91.5,    70.5,    76.5,    59.7,    54.1,
+          11.9,    68.2,    64.6,    76.9,    37.2,    37.3,    44.9,    63.2,    76.9,    67.6,
+          51.2,    33.1,     9.2, ),
+)
+
+
+def createExampleCurvData():
+    '''
+    Creates and returns example longitude, latitudes, depth, and data
+    for a curvilinear grid.  Assigns grid center point data[i,j,k]
+        = -2 * sin(lon[i,j,k] + 20) * cos(lat[i,j,k]) / log(depth[i,j,k] + 10)
+            for valid center points
+        = 1.0E20 for invalid center points
+
+    Arguments:
+        None
+    Returns:
+        (corner_lons, corner_lats, corner_depths, corner_invalid,
+         center_lons, center_lats, center_depths, center_invalid, data) where:
+        corner_lons:    numpy 3D array of curvilinear corner point longitude coordinates
+        corner_lats:    numpy 3D array of curvilinear corner point latitude coordinates
+        corner_depths:  numpy 3D array of curvilinear corner point depth coordinates
+        corner_invalid: numpy 3D array of logicals indicating invalid corner points
+        center_lons:    numpy 3D array of curvilinear center point longitude coordinates
+        center_lats:    numpy 3D array of curvilinear center point latitude coordinates
+        center_depths:  numpy 3D array of curvilinear center point depth coordinates
+        center_invalid: numpy 3D array of logicals indicating invalid center points
+        data:           numpy 3D array of curvilinear center point data values
+    '''
+    # Longitudes for the Gulf of Mexico ROSE data
+    start = GULF_MEX_LONS[0]
+    end = GULF_MEX_LONS[1]
+    delta = GULF_MEX_LONS[2]
+    # numpy.arange does not include the ending value
+    end += 0.5 * delta
+    center_lons = numpy.arange(start, end, delta)
+    corner_lons = numpy.arange(start - 0.5 * delta, end + 0.5 * delta, delta)
+
+    # Latitudes for the Gulf of Mexico ROSE data
+    start = GULF_MEX_LATS[0]
+    end = GULF_MEX_LATS[1]
+    delta = GULF_MEX_LATS[2]
+    # numpy.arange does not include the ending value
+    end += 0.5 * delta
+    center_lats = numpy.arange(start, end, delta)
+    corner_lats = numpy.arange(start - 0.5 * delta, end + 0.5 * delta, delta)
+
+    # arbitrary depths as sigma coordinates
+    center_sigmas = numpy.array(    (0.200, 0.030, 0.075, 0.150, 0.300, 0.450, 0.600, 0.800) )
+    corner_sigmas = numpy.array( (0.015, 0.025, 0.053, 0.113, 0.225, 0.375, 0.525, 0.700, 0.900) )
+    center_shape = (center_lons.shape[0], center_lats.shape[0], center_sigmas.shape[0])
+    corner_shape = (corner_lons.shape[0], corner_lats.shape[0], corner_sigmas.shape[0])
+
+    # Expand longitudes, latitudes, and sigmas to 3D arrays
+    center_lons = numpy.tile(center_lons, center_shape[1] * center_shape[2]) \
+                       .reshape(center_shape, order='F')
+    center_lats = numpy.tile(numpy.repeat(center_lats, center_shape[0]),
+                             center_shape[2]) \
+                       .reshape(center_shape, order='F')
+    center_sigmas = numpy.repeat(center_sigmas, center_shape[0] * center_shape[1]) \
+                         .reshape(center_shape, order='F')
+    corner_lons = numpy.tile(corner_lons, corner_shape[1] * corner_shape[2]) \
+                       .reshape(corner_shape, order='F')
+    corner_lats = numpy.tile(numpy.repeat(corner_lats, corner_shape[0]),
+                             corner_shape[2]) \
+                       .reshape(corner_shape, order='F')
+    corner_sigmas = numpy.repeat(corner_sigmas, corner_shape[0] * corner_shape[1]) \
+                         .reshape(corner_shape, order='F')
+
+    # Add a zeta coordinate (sea swell above earth radius) - less than 1.0 meter
+    zeta = -1.0 * numpy.sin(numpy.deg2rad(center_lons)) * numpy.cos(numpy.deg2rad(center_lats))
+
+    # Convert sigma, zeta coordinates to center depths
+    # Modify the depths so nothing more than 325 meters deep to better match rectilinear data
+    gulf_mex_center_rose = numpy.array(GULF_MEX_ROSE).flatten()
+    gulf_mex_center_rose[ (gulf_mex_center_rose < -325.0) ] = -325.0
+    gulf_mex_center_rose = numpy.tile(gulf_mex_center_rose, center_shape[2]) \
+                                .reshape(center_shape, order='F')
+    center_invalid = ( gulf_mex_center_rose > -10.0 )
+    center_depths = center_sigmas * (zeta - gulf_mex_center_rose) - zeta
+
+    # Compute the data values for these center points
+    insea = numpy.logical_not(center_invalid)
+    data = numpy.empty(center_shape, dtype=numpy.float64, order='F')
+    data[center_invalid] = 1.0E20
+    data[insea] = -2.0 * numpy.sin(numpy.deg2rad(center_lons[insea] + 20.0)) \
+                       * numpy.cos(numpy.deg2rad(center_lats[insea])) \
+                       / numpy.log10(center_depths[insea] + 10.0)
+
+    # Convert sigma, zeta coordinates to corner depths
+    # Estimate the corner depths using the center depths;
+    # edges not too critical since most are over land
+    gulf_mex_corner_rose = numpy.zeros((corner_shape[0], corner_shape[1]),
+                                       dtype=numpy.float64, order='F')
+    gulf_mex_corner_rose[1:-1,1:-1] = ( gulf_mex_center_rose[:-1, :-1, 0] + \
+                                        gulf_mex_center_rose[1:,  :-1, 0] + \
+                                        gulf_mex_center_rose[1:,  1:,  0] + \
+                                        gulf_mex_center_rose[:-1, 1:,  0] ) / 4.0
+    gulf_mex_corner_rose[ 0, 1:-1] = 2.0 * gulf_mex_corner_rose[ 1, 1:-1] - gulf_mex_corner_rose[ 2, 1:-1]
+    gulf_mex_corner_rose[-1, 1:-1] = 2.0 * gulf_mex_corner_rose[-2, 1:-1] - gulf_mex_corner_rose[-3, 1:-1]
+    gulf_mex_corner_rose[:,  0] = 2.0 * gulf_mex_corner_rose[:,  1] - gulf_mex_corner_rose[:,  2]
+    gulf_mex_corner_rose[:, -1] = 2.0 * gulf_mex_corner_rose[:, -2] - gulf_mex_corner_rose[:, -3]
+    gulf_mex_corner_rose = numpy.tile(gulf_mex_corner_rose.flatten('F'), corner_shape[2]) \
+                                .reshape(corner_shape, order='F')
+    zeta = -1.0 * numpy.sin(numpy.deg2rad(corner_lons)) * numpy.cos(numpy.deg2rad(corner_lats))
+    corner_invalid = ( gulf_mex_corner_rose > -10.0 )
+    corner_depths = corner_sigmas * (zeta - gulf_mex_corner_rose) - zeta
+
+    return (corner_lons, corner_lats, corner_depths, corner_invalid,
+            center_lons, center_lats, center_depths, center_invalid, data)
+
+
+def createExampleRectData():
+    '''
+    Creates and returns example longitude, latitudes, depth, and data
+    for a rectilinear grid.  Covers approximately the same region given
+    by createExampleCurvData.  Assigns grid center point data[i,j,k]
+        = -2 * sin(lon[i] + 20) * cos(lat[j]) / log(depth[k] + 10)
+            for valid center points
+        = 1.0E34 for invalid center points
+
+    Arguments:
+        None
+    Returns:
+        (corner_lons, corner_lats, corner_depths,
+         center_lons, center_lats, center_depths, data) where:
+        corner_lons:    numpy 1D array of rectilinear corner plane longitudes
+        corner_lats:    numpy 1D array of rectilinear corner plane latitudes
+        corner_depths:  numpy 1D array of rectilinear corner plane depths
+        corner_invalid: numpy 3D array of logicals indicating invalid corner points
+        center_lons:    numpy 1D array of rectilienar center plane longitudes
+        center_lats:    numpy 1D array of rectilinear center plane latitudes
+        center_depths:  numpy 1D array of rectilinear center plane depths
+        center_invalid: numpy 3D array of logicals indicating invalid center points
+        data:           numpy 3D array of rectilinear center point data values
+    '''
+    # Longitudes for the Gulf of Mexico ROSE data
+    start = GULF_MEX_LONS[0]
+    end = GULF_MEX_LONS[1]
+    delta = GULF_MEX_LONS[2]
+    # numpy.arange does not include the ending value
+    end += 0.5 * delta
+    center_lons = numpy.arange(start, end, delta)
+    corner_lons = numpy.arange(start - 0.5 * delta, end + 0.5 * delta, delta)
+    # Latitudes for the Gulf of Mexico ROSE data
+    start = GULF_MEX_LATS[0]
+    end = GULF_MEX_LATS[1]
+    delta = GULF_MEX_LATS[2]
+    # numpy.arange does not include the ending value
+    end += 0.5 * delta
+    center_lats = numpy.arange(start, end, delta)
+    corner_lats = numpy.arange(start - 0.5 * delta, end + 0.5 * delta, delta)
+    # Arbitrarily chosen depths
+    center_depths = numpy.array(   (10.0,  25.0,  50.0, 100.0, 150.0, 250.0) )
+    # Edges for these irregularily spaced depths      
+    corner_depths = numpy.array( (5.0,  17.5,  37.5,  75.0, 125.0, 200.0, 300.0) )
+
+    # Create the data values
+    center_shape = (center_lons.shape[0], center_lats.shape[0], center_depths.shape[0])
+    center_3d_lons = numpy.tile(center_lons, center_shape[1] * center_shape[2]) \
+                          .reshape(center_shape, order='F')
+    center_3d_lats = numpy.tile(numpy.repeat(center_lats, center_shape[0]),
+                                center_shape[2]) \
+                          .reshape(center_shape, order='F')
+    center_3d_depths = numpy.repeat(center_depths, center_shape[0] * center_shape[1]) \
+                            .reshape(center_shape, order='F')
+    data = -2.0 * numpy.sin(numpy.deg2rad(center_3d_lons + 20.0)) \
+                * numpy.cos(numpy.deg2rad(center_3d_lats)) \
+                / numpy.log10(center_3d_depths + 10.0)
+           
+    # Use GULD_MEX_ROSE as a land mask to mark undefined data
+    gulf_mex_center_rose = numpy.array(GULF_MEX_ROSE).flatten()
+    gulf_mex_center_rose = numpy.tile(gulf_mex_center_rose, center_shape[2]) \
+                                .reshape(center_shape, order='F')
+    center_invalid = numpy.logical_or( ( gulf_mex_center_rose > -10.0 ),
+                                       ( center_3d_depths > -gulf_mex_center_rose ) )
+    data[ center_invalid ] = 1.0E34
+
+    # Convert sigma, zeta coordinates in corner depths
+    # Estimate the corner depths using the center depths;
+    # edges not too critical since most are over land
+    corner_shape = (corner_lons.shape[0], corner_lats.shape[0], corner_depths.shape[0])
+    corner_3d_depths = numpy.repeat(corner_depths, corner_shape[0] * corner_shape[1]) \
+                            .reshape(corner_shape, order='F')
+    gulf_mex_corner_rose = numpy.zeros((corner_shape[0], corner_shape[1]),
+                                       dtype=numpy.float64, order='F')
+    gulf_mex_corner_rose[1:-1,1:-1] = ( gulf_mex_center_rose[:-1, :-1, 0] + \
+                                        gulf_mex_center_rose[1:,  :-1, 0] + \
+                                        gulf_mex_center_rose[1:,  1:,  0] + \
+                                        gulf_mex_center_rose[:-1, 1:,  0] ) / 4.0
+    gulf_mex_corner_rose[ 0, 1:-1] = 2.0 * gulf_mex_corner_rose[ 1, 1:-1] - gulf_mex_corner_rose[ 2, 1:-1]
+    gulf_mex_corner_rose[-1, 1:-1] = 2.0 * gulf_mex_corner_rose[-2, 1:-1] - gulf_mex_corner_rose[-3, 1:-1]
+    gulf_mex_corner_rose[:,  0] = 2.0 * gulf_mex_corner_rose[:,  1] - gulf_mex_corner_rose[:,  2]
+    gulf_mex_corner_rose[:, -1] = 2.0 * gulf_mex_corner_rose[:, -2] - gulf_mex_corner_rose[:, -3]
+    gulf_mex_corner_rose = numpy.tile(gulf_mex_corner_rose.flatten('F'), corner_shape[2]) \
+                                .reshape(corner_shape, order='F')
+    corner_invalid = numpy.logical_or( ( gulf_mex_corner_rose > -10.0 ),
+                                       ( corner_3d_depths > -gulf_mex_corner_rose ) )
+
+    return (corner_lons, corner_lats, corner_depths, corner_invalid,
+            center_lons, center_lats, center_depths, center_invalid, data)
+
+
+def printDiffs(grid_lons, grid_lats, grid_depths, undef_val, max_negl,
+                 expect_data, found_data):
+    '''
+    Prints significant differences between expect_data and found_data
+    along with the location of these differences
+
+    Arguments:
+        grid_lons:   numpy 3D array of grid longitudes
+        grid_lats:   numpy 3D array of grid latitudes
+        grid_depths: numpy 3D array of grid depths
+        undef_val:   numpy array of one value; the undefined data value
+        max_negl:    maximumum negligible absolute difference
+        expect_data: numpy 3D array of expected data values
+        found_data:  numpy 3D array of data values to check
+    Returns:
+        None
+    Raises:
+        ValueError:  if the array shapes do not match
+    '''
+    if len(grid_lons.shape) != 3:
+        raise ValueError("grid_lons is not 3D")
+    if grid_lats.shape != grid_lons.shape:
+        raise ValueError("grid_lats.shape != grid_lons.shape")
+    if grid_depths.shape != grid_lons.shape:
+        raise ValueError("grid_depth.shape != grid_lons.shape")
+    if expect_data.shape != grid_lons.shape:
+        raise ValueError("expect_data.shape != grid_lons.shape")
+    if found_data.shape != grid_lons.shape:
+        raise ValueError("found_data.shape != grid_lons.shape")
+    different = ( numpy.abs(expect_data - found_data) > max_negl )
+    diff_lons = grid_lons[different]
+    diff_lats = grid_lats[different]
+    diff_depths = grid_depths[different]
+    diff_expect = expect_data[different]
+    diff_found = found_data[different]
+    diff_list = [ ]
+    for (lon, lat, depth, expect, found) in \
+            zip(diff_lons, diff_lats, diff_depths, diff_expect, diff_found):
+        if expect == undef_val:
+            # most serious - should have been masked out
+            diff_list.append([2, lon, lat, depth, expect, found])
+        elif found == undef_val:
+            # least serious - destination not covered by source
+            diff_list.append([0, lon, lat, depth, expect, found])
+        else:
+            # might be of concern
+            diff_list.append([1, lon, lat, depth, expect, found])
+    # order primarily from least to most serious, 
+    # secondarily smallest to largest longitude,
+    # thirdly smallest to largest latitude
+    # fourthly highest to deepest
+    diff_list.sort()
+    num_not_undef = 0
+    num_undef = 0
+    num_diff = 0
+    for (_, lon, lat, depth, expect, found) in diff_list:
+        if expect == undef_val:
+            num_not_undef += 1
+            print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect =  undef, " \
+                  "found = %#6.3f" % (lon, lat, depth, found)
+        elif found == undef_val:
+            num_undef += 1
+            # print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
+            #       "found =  undef" % (lon, lat, depth, expect)
+        else:
+            num_diff += 1
+            print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
+                  "found = %#6.3f, diff = %#6.3f" \
+                  % (lon, lat, depth, expect, found, found - expect)
+    print "%3d undefined when defined might be expected" % num_undef
+    print "%3d with absolute difference > %#.3f" % (num_diff, max_negl)
+    print "%3d defined when undefined expected" % num_not_undef
+    print "%3d values in the grid" \
+            % (expect_data.shape[0] * expect_data.shape[1] * expect_data.shape[2])
+
+
+if __name__ == '__main__':
+    try:
+        while True:
+            print 'cw2r: curvilinear with corners to rectilinear'
+            print 'co2r: curvilinear without corners to rectilinear'
+            print 'r2cw: rectilinear to curvilinear with corners'
+            print 'r2co: rectilinear to curvilinear without corners'
+            print 'Ctrl-D to quit'
+            direction = raw_input('Regrid test to run? ')
+            direction = direction.strip().lower()
+            if direction in ('cw2r', 'co2r', 'r2cw', 'r2co'):
+                break
+    except EOFError:
+        raise SystemExit(0)
+
+    # Synthesize curvilinear test data
+    (curv_corner_lons, curv_corner_lats, curv_corner_depths, curv_corner_ignore,
+     curv_center_lons, curv_center_lats, curv_center_depths, curv_center_ignore,
+     curv_data) = createExampleCurvData()
+
+    # Synthesize rectilinear test data
+    (rect_corner_lons, rect_corner_lats, rect_corner_depths, rect_corner_ignore,
+     rect_center_lons, rect_center_lats, rect_center_depths, rect_center_ignore,
+     rect_data) = createExampleRectData()
+
+    undef_val = numpy.array([-1.0E10], dtype=numpy.float64)
+
+    # Create the expected results on the curvilinear grid
+    curv_expect_data = curv_data.copy()
+    curv_expect_data[curv_center_ignore] = undef_val
+
+    # Create the expected results on the rectilinear grid
+    rect_expect_data = rect_data.copy()
+    rect_expect_data[rect_center_ignore] = undef_val
+
+    # Initialize ESMP
+    if not ESMPControl().startCheckESMP():
+        raise RuntimeError("Unexpected failure to start ESMP")
+
+    # Create the regridder
+    regridder = CurvRect3DRegridder()
+
+    if direction in ('cw2r', 'r2cw'):
+        # Create the curvilinear grid with corner and center points
+        regridder.createCurvGrid(curv_center_lons, curv_center_lats, curv_center_depths,
+                                 curv_center_ignore, True, curv_corner_lons, curv_corner_lats,
+                                 curv_corner_depths, curv_corner_ignore)
+    elif direction in ('co2r', 'r2co'):
+        # Create the curvilinear grid with only center points
+        regridder.createCurvGrid(curv_center_lons, curv_center_lats, curv_center_depths,
+                                 curv_center_ignore, True)
+    else:
+        raise ValueError("unexpected direction of %s" % direction)
+
+    # Create the rectilinear grid with corner and center points
+    regridder.createRectGrid(rect_center_lons, rect_center_lats, rect_center_depths,
+                             rect_center_ignore, True, rect_corner_lons, rect_corner_lats,
+                             rect_corner_depths, rect_corner_ignore)
+
+    if direction in ('cw2r', 'co2r'):
+
+        print ""
+        if direction == 'cw2r':
+            print "Examining rectilinear results from curvilinear with corners"
+        else:
+            print "Examining rectilinear results from curvilinear without corners"
+
+        # Create the curvilinear source field
+        regridder.assignCurvField(curv_data)
+
+        # Create the rectilinear destination field
+        regridder.assignRectField()
+
+        # Generate the 3D rectilinear longitude, latitude, and depth arrays
+        # only to simplify printing differences; not used in regridding
+        rect_center_shape = (rect_center_lons.shape[0], rect_center_lats.shape[0],
+                             rect_center_depths.shape[0])
+        rect_3d_center_lons = numpy.tile(rect_center_lons,
+                                         rect_center_shape[1] * rect_center_shape[2]) \
+                                   .reshape(rect_center_shape, order='F')
+        rect_3d_center_lats = numpy.tile(numpy.repeat(rect_center_lats,
+                                                      rect_center_shape[0]),
+                                         rect_center_shape[2]) \
+                                   .reshape(rect_center_shape, order='F')
+        rect_3d_center_depths = numpy.repeat(rect_center_depths,
+                                             rect_center_shape[0] * rect_center_shape[1]) \
+                                     .reshape(rect_center_shape, order='F')
+
+        if direction == 'cw2r':
+            # Regrid from curvilinear to rectilinear using the conserve method
+            # Corners required for this method
+            rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+            # Print the differences between the expected and regrid data
+            print ""
+            print "analytic (expect) versus conserve regridded (found) differences"
+            printDiffs(rect_3d_center_lons,
+                       rect_3d_center_lats,
+                       rect_3d_center_depths,
+                       undef_val, 0.001,
+                       rect_expect_data,
+                       rect_regrid_data)
+
+        # Regrid from curvilinear to rectilinear using the bilinear method
+        rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus bilinear regridded (found) differences"
+        printDiffs(rect_3d_center_lons,
+                   rect_3d_center_lats,
+                   rect_3d_center_depths,
+                   undef_val, 0.12,
+                   rect_expect_data,
+                   rect_regrid_data)
+
+        # Regrid from curvilinear to rectilinear using the patch method
+        rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus patch regridded (found) differences"
+        printDiffs(rect_3d_center_lons,
+                   rect_3d_center_lats,
+                   rect_3d_center_depths,
+                   undef_val, 1.0, 
+                   rect_expect_data,
+                   rect_regrid_data)
+
+    elif direction in ('r2cw', 'r2co'):
+
+        print ""
+        if direction == 'r2cw':
+            print "Examining curvilinear with corners results from rectilinear"
+        else:
+            print "Examining curvilinear without corners results from rectilinear"
+
+        # Create the rectilinear source field
+        regridder.assignRectField(rect_data)
+
+        # Create the curvilinear destination field
+        regridder.assignCurvField(None)
+
+        if direction == 'r2cw':
+            # Regrid from rectilinear to curvilinear using the conserve method
+            # Corners required for this method
+            curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+            # Print the differences between the expected and regrid data
+            print ""
+            print "analytic (expect) versus conserve regridded (found) differences"
+            printDiffs(curv_center_lons[:,:,1:-1],
+                       curv_center_lats[:,:,1:-1],
+                       curv_center_depths[:,:,1:-1],
+                       undef_val, 0.001,
+                       curv_expect_data[:,:,1:-1],
+                       curv_regrid_data[:,:,1:-1])
+
+        # Regrid from rectilinear to curvilinear using the bilinear method
+        curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus bilinear regridded (found) differences"
+        printDiffs(curv_center_lons[:,:,1:-1],
+                   curv_center_lats[:,:,1:-1],
+                   curv_center_depths[:,:,1:-1],
+                   undef_val, 0.25,
+                   curv_expect_data[:,:,1:-1],
+                   curv_regrid_data[:,:,1:-1])
+
+        # Regrid from rectilinear to curvilinear using the patch method
+        curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+        # Print the differences between the expected and regrid data
+        print ""
+        print "analytic (expect) versus patch regridded (found) differences"
+        printDiffs(curv_center_lons[:,:,1:-1],
+                   curv_center_lats[:,:,1:-1],
+                   curv_center_depths[:,:,1:-1],
+                   undef_val, 1.1,
+                   curv_expect_data[:,:,1:-1],
+                   curv_regrid_data[:,:,1:-1])
+
+    else:
+        raise ValueError("unexpected direction of %s" % direction)
+
+    # Done with this regridder
+    regridder.finalize()
+
+    # Done with ESMP    
+    ESMPControl().stopESMP(True)
+
diff --git a/pyfermod/regrid/regrid3dtests.py b/pyfermod/regrid/regrid3dtests.py
new file mode 100644
index 0000000..c2f1f2d
--- /dev/null
+++ b/pyfermod/regrid/regrid3dtests.py
@@ -0,0 +1,594 @@
+'''
+Unit tests for CurvRect3DRegridder
+
+ at author: Karl Smith
+'''
+import unittest
+import numpy
+import ESMP
+from esmpcontrol import ESMPControl
+from regrid3d import CurvRect3DRegridder
+
+
+class CurvRect3DRegridderTests(unittest.TestCase):
+    '''
+    Unit tests for the CurvRect3DRegridder class
+    '''
+
+    # flag to indicate when to call ESMPControl().stopESMP()
+    last_test = False
+
+
+    def setUp(self):
+        '''
+        Create some repeatedly used test data.
+        '''
+        # Use tuples for the arrays to make sure the NumPy 
+        # arrays created in the class methods are always used;
+        # not arrays that happened to be passed as input.
+        # Also verifies passed data is not modified.
+
+        # Rectilinear coordinates and data
+        crn_lons = numpy.linspace(-16.0,  16.0, 17)
+        crn_lats = numpy.linspace(-11.0,  11.0, 12)
+        crn_levs = numpy.linspace( 10.0, 100.0, 10)
+        crn_shape = (crn_lons.shape[0], crn_lats.shape[0], crn_levs.shape[0])
+
+        ctr_lons = 0.5 * (crn_lons[:-1] + crn_lons[1:])
+        ctr_lats = 0.5 * (crn_lats[:-1] + crn_lats[1:])
+        ctr_levs = 0.5 * (crn_levs[:-1] + crn_levs[1:])
+        ctr_shape = (ctr_lons.shape[0], ctr_lats.shape[0], ctr_levs.shape[0])
+
+        # Create in C order so the tuplets are [lon][lat][lev] 
+        ctr_lons_mat = numpy.repeat(ctr_lons, ctr_shape[1] * ctr_shape[2]) \
+                            .reshape(ctr_shape)
+        ctr_lats_mat = numpy.repeat(numpy.tile(ctr_lats, ctr_shape[0]),
+                                    ctr_shape[2]) \
+                            .reshape(ctr_shape)
+        ctr_levs_mat = numpy.tile(ctr_levs, ctr_shape[0] * ctr_shape[1]) \
+                            .reshape(ctr_shape)
+
+        data = 2.0 * numpy.cos(numpy.deg2rad(ctr_lons_mat + 20.0)) \
+                   * numpy.cos(numpy.deg2rad(ctr_lats_mat + 15.0)) \
+                   / numpy.log10(ctr_levs_mat + 10.0)
+
+        ctr_flags = numpy.zeros(ctr_shape, dtype=numpy.int32)
+        ctr_flags[ 0,  0, :] = 1
+        ctr_flags[ 0, -1, :] = 1
+        ctr_flags[-1, -1, :] = 1
+
+        crn_flags = numpy.zeros(crn_shape, dtype=numpy.int32)
+        crn_flags[ 0,  0, :] = 1
+        crn_flags[ 0, -1, :] = 1
+        crn_flags[-1, -1, :] = 1
+
+        self.rect_corner_lons = tuple(crn_lons)
+        self.rect_corner_lats = tuple(crn_lats)
+        self.rect_corner_levs = tuple(crn_levs)
+        self.rect_center_lons = tuple(ctr_lons)
+        self.rect_center_lats = tuple(ctr_lats)
+        self.rect_center_levs = tuple(ctr_levs)
+        self.rect_center_ignr = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in ctr_flags.tolist()])
+        self.rect_corner_ignr = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in crn_flags.tolist()])
+        self.rect_data        = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in data.tolist()])
+
+        # Curvilinear coordinates and data - expanded out a step on all region sides
+        crn_lons = numpy.linspace(-18.0,  18.0, 19)
+        crn_lats = numpy.linspace(-13.0,  13.0, 14)
+        crn_levs = numpy.linspace(  0.0, 110.0, 12)
+        crn_shape = (crn_lons.shape[0], crn_lats.shape[0], crn_levs.shape[0])
+
+        ctr_lons = 0.5 * (crn_lons[:-1] + crn_lons[1:])
+        ctr_lats = 0.5 * (crn_lats[:-1] + crn_lats[1:])
+        ctr_levs = 0.5 * (crn_levs[:-1] + crn_levs[1:])
+        ctr_shape = (ctr_lons.shape[0], ctr_lats.shape[0], ctr_levs.shape[0])
+
+        # Create in C order so the tuplets are [lon][lat][lev] 
+        crn_lons_mat = numpy.repeat(crn_lons, crn_shape[1] * crn_shape[2]) \
+                            .reshape(crn_shape)
+        crn_lats_mat = numpy.repeat(numpy.tile(crn_lats, crn_shape[0]),
+                                    crn_shape[2]) \
+                            .reshape(crn_shape)
+        crn_levs_mat = numpy.tile(crn_levs, crn_shape[0] * crn_shape[1]) \
+                            .reshape(crn_shape)
+
+        # Create in C order so the tuplets are [lon][lat][lev] 
+        ctr_lons_mat = numpy.repeat(ctr_lons, ctr_shape[1] * ctr_shape[2]) \
+                            .reshape(ctr_shape)
+        ctr_lats_mat = numpy.repeat(numpy.tile(ctr_lats, ctr_shape[0]),
+                                    ctr_shape[2]) \
+                            .reshape(ctr_shape)
+        ctr_levs_mat = numpy.tile(ctr_levs, ctr_shape[0] * ctr_shape[1]) \
+                            .reshape(ctr_shape)
+
+        # Tweak the coordinates some, pulling in near edges of the region
+        crn_lons = crn_lons_mat * numpy.cos(numpy.deg2rad(crn_lats_mat))
+        crn_lats = crn_lats_mat * numpy.cos(numpy.deg2rad(crn_lons_mat))
+        crn_levs = crn_levs_mat * numpy.cos(numpy.deg2rad(crn_lats_mat) / 2.0) \
+                                * numpy.cos(numpy.deg2rad(crn_lons_mat) / 2.0) \
+                                * numpy.cos(numpy.deg2rad(crn_levs_mat - 55.0) / 5.0)
+
+        ctr_lons = ctr_lons_mat * numpy.cos(numpy.deg2rad(ctr_lats_mat))
+        ctr_lats = ctr_lats_mat * numpy.cos(numpy.deg2rad(ctr_lons_mat))
+        ctr_levs = ctr_levs_mat * numpy.cos(numpy.deg2rad(ctr_lats_mat) / 2.0) \
+                                * numpy.cos(numpy.deg2rad(ctr_lons_mat) / 2.0) \
+                                * numpy.cos(numpy.deg2rad(ctr_levs_mat - 55.0) / 5.0)
+
+        data = 2.0 * numpy.cos(numpy.deg2rad(ctr_lons + 20.0)) \
+                   * numpy.cos(numpy.deg2rad(ctr_lats + 15.0)) \
+                   / numpy.log10(ctr_levs + 10.0)
+
+        ctr_flags = numpy.zeros(ctr_shape, dtype=numpy.int32)
+        ctr_flags[ :2,  :2, :] = 1
+        ctr_flags[ :2, -2:, :] = 1
+        ctr_flags[-2:, -2:, :] = 1
+
+        crn_flags = numpy.zeros(crn_shape, dtype=numpy.int32)
+        crn_flags[ :2,  :2, :] = 1
+        crn_flags[ :2, -2:, :] = 1
+        crn_flags[-2:, -2:, :] = 1
+ 
+        self.curv_corner_lons = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in crn_lons.tolist()])
+        self.curv_corner_lats = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in crn_lats.tolist()])
+        self.curv_corner_levs = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in crn_levs.tolist()])
+        self.curv_center_lons = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in ctr_lons.tolist()])
+        self.curv_center_lats = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in ctr_lats.tolist()])
+        self.curv_center_levs = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in ctr_levs.tolist()])
+        self.curv_center_ignr = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in ctr_flags.tolist()])
+        self.curv_corner_ignr = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in crn_flags.tolist()])
+        self.curv_data        = tuple([tuple([tuple(subsubarr) for subsubarr in subarr])
+                                       for subarr in data.tolist()])
+
+        # undef_val must be a numpy array
+        self.undef_val = numpy.array([1.0E10], dtype=numpy.float64)
+
+        if not ESMPControl().startCheckESMP():
+            self.fail("startCheckESMP did not succeed - test called after last_test set to True")
+
+
+    def test01CurvRectRegridderInit(self):
+        '''
+        Test of the CurvRect3DRegridder.__init__ method.
+        '''
+        regridder = CurvRect3DRegridder()
+        self.assertTrue(regridder != None, "CurvRect3DRegridder() returned None")
+        regridder.finalize()
+
+
+    def test02CreateCurvGrid(self):
+        '''
+        Tests the CurvRect3DRegridder.createCurvGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRect3DRegridder()
+
+        # Test with all corner and center data
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr,
+                                 True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs, self.curv_corner_ignr)
+
+        # Test without flags 
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, None, True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs)
+
+        # Test without corners
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr)
+
+        # Test without corners or flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+
+        # Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test03AssignCurvField(self):
+        '''
+        Tests the CurvRect3DRegridder.assignCurvGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRect3DRegridder()
+
+        # Test with all corner and center data
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr,
+                                 True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs, self.curv_corner_ignr)
+        regridder.assignCurvField()
+        regridder.assignCurvField(self.curv_data)
+
+        # Test without flags 
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, None, True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs)
+        regridder.assignCurvField(self.curv_data)
+        regridder.assignCurvField()
+
+        # Test without corners
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr)
+        regridder.assignCurvField(self.curv_data)
+        regridder.assignCurvField()
+
+        # Test without corners or flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+        regridder.assignCurvField()
+        regridder.assignCurvField(self.curv_data)
+
+        # Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test04CreateRectGrid(self):
+        '''
+        Tests the CurvRect3DRegridder.createRectGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRect3DRegridder()
+
+        # Test with all corner and center data
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr,
+                                 True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs, self.rect_corner_ignr)
+
+        # Test without flags
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, None, True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs)
+
+        # Test without corners
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr)
+
+        # Test without corners or flags 
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+
+        # Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test05AssignRectField(self):
+        '''
+        Tests the CurvRect3DRegridder.assignRectGrid method.
+        Since nothing is returned from this method, just
+        checks for unexpected/expected Errors being raised.
+        '''
+        regridder = CurvRect3DRegridder()
+
+        # Test with all corner and center data
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr,
+                                 True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs, self.rect_corner_ignr)
+        regridder.assignRectField(self.rect_data)
+        regridder.assignRectField()
+
+        # Test without flags
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, None, True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs)
+        regridder.assignRectField()
+        regridder.assignRectField(self.rect_data)
+
+        # Test without corners
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr)
+        regridder.assignRectField()
+        regridder.assignRectField(self.rect_data)
+
+        # Test without corners or flags 
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+        regridder.assignRectField(self.rect_data)
+        regridder.assignRectField()
+
+        # Test invalid cases
+
+        # Done with this regridder
+        regridder.finalize()
+
+
+    def test06RegridCurvToRectBilinear(self):
+        '''
+        Tests the CurvRect3DRegridder.regridCurvToRect method.
+        '''
+        margin = 1
+        delta = 1.0
+      
+        regridder = CurvRect3DRegridder()
+
+        # Test with only center data but no flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.rect_center_lons[i], 
+                              self.rect_center_lats[j], self.rect_center_levs[k])
+        if mismatch_found:
+            self.fail("data mismatch found for bilinear regridding without flags")
+
+        # Test with only center data and with flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.rect_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.rect_center_lons[i], 
+                              self.rect_center_lats[j], self.rect_center_levs[k])
+        if mismatch_found:
+            self.fail("data mismatch found for bilinear regridding with flags")
+
+
+    def test07RegridCurvToRectConserve(self):
+        '''
+        Tests the CurvRect3DRegridder.regridCurvToRect method.
+        '''
+        margin = 1
+        delta = 1.0
+      
+        regridder = CurvRect3DRegridder()
+
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, None, True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, None, True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val, 
+                                                 ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.rect_center_lons[i], 
+                              self.rect_center_lats[j], self.rect_center_levs[k])
+        if mismatch_found:
+            self.fail("data mismatch found for conservative regridding")
+
+
+
+    def test08RegridCurvToRectPatch(self):
+        '''
+        Tests the CurvRect3DRegridder.regridCurvToRect method.
+        '''
+        margin = 1
+        delta = 1.0
+      
+        regridder = CurvRect3DRegridder()
+
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+        regridder.assignCurvField(self.curv_data)
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+        regridder.assignRectField()
+        regrid_data = regridder.regridCurvToRect(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_PATCH)
+        expect_data = numpy.array(self.rect_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.rect_center_lons[i], 
+                              self.rect_center_lats[j], self.rect_center_levs[k])
+        if mismatch_found:
+            self.fail("data mismatch found for patch regridding")
+
+
+    def test09RegridRectToCurvBilinear(self):
+        '''
+        Tests the CurvRect3DRegridder.regridRectToCurv method.
+        '''
+        margin = 2
+        delta = 1.0
+
+        regridder = CurvRect3DRegridder()
+
+        # Test with only center data but no flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
+        if mismatch_found:
+            self.fail("data mismatch found for bilinear regridding without flags")
+
+        # Test with only center data and with flags
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, self.curv_center_ignr)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, self.rect_center_ignr)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        undef_flags = numpy.array(self.rect_center_ignr, dtype=numpy.bool)
+        expect_data[undef_flags] = self.undef_val
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
+        if mismatch_found:
+            self.fail("data mismatch found for bilinear regridding with flags")
+
+
+    def test10RegridRectToCurvConserve(self):
+        '''
+        Tests the CurvRect3DRegridder.regridRectToCurv method.
+        '''
+        margin = 2
+        delta = 1.0
+
+        regridder = CurvRect3DRegridder()
+
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs, None, True,
+                                 self.curv_corner_lons, self.curv_corner_lats,
+                                 self.curv_corner_levs)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs, None, True,
+                                 self.rect_corner_lons, self.rect_corner_lats,
+                                 self.rect_corner_levs)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
+        if mismatch_found:
+            self.fail("data mismatch found for conservative regridding")
+
+
+    def test11RegridRectToCurvPatch(self):
+        '''
+        Tests the CurvRect3DRegridder.regridRectToCurv method.
+        '''
+        margin = 2
+        delta = 1.0
+
+        # Mark as the last test so ESMPControl().stopESMP will be called
+        self.last_test = True
+
+        regridder = CurvRect3DRegridder()
+
+        regridder.createCurvGrid(self.curv_center_lons, self.curv_center_lats,
+                                 self.curv_center_levs)
+        regridder.assignCurvField()
+        regridder.createRectGrid(self.rect_center_lons, self.rect_center_lats,
+                                 self.rect_center_levs)
+        regridder.assignRectField(self.rect_data)
+        regrid_data = regridder.regridRectToCurv(self.undef_val,
+                                                 ESMP.ESMP_REGRIDMETHOD_PATCH)
+        expect_data = numpy.array(self.curv_data, dtype=numpy.float64)
+        mismatch_found = False
+        for i in xrange(margin, expect_data.shape[0] - margin):
+            for j in xrange(margin, expect_data.shape[1] - margin):
+                for k in xrange(margin, expect_data.shape[2] - margin):
+                    if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                        mismatch_found = True
+                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                              regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
+        if mismatch_found:
+            self.fail("data mismatch found for patch regridding")
+
+
+    def tearDown(self):
+        '''
+        Finalize ESMP if it has been initialized and if this is the last test
+        '''
+        if self.last_test:
+            ESMPControl().stopESMP(False)
+
+
+if __name__ == "__main__":
+    '''
+    Run the unit tests in this module.
+    '''
+    unittest.main()
+
diff --git a/pyfermod/regrid/regridtests.py b/pyfermod/regrid/regridtests.py
new file mode 100644
index 0000000..7d1a516
--- /dev/null
+++ b/pyfermod/regrid/regridtests.py
@@ -0,0 +1,113 @@
+'''
+Tests of the regrid.__init__ functions
+
+ at author: Karl Smith
+'''
+import unittest
+import numpy
+import __init__ as regrid
+
+class RegridTests(unittest.TestCase):
+    '''
+    Tests of the regrid.__init__ functions
+    '''
+
+
+    def testQuadCornersFrom3D(self):
+        '''
+        Test of regrid.quadCornersFrom3D
+        '''
+        xedges = numpy.linspace(2.0, 10.0, 5)
+        yedges = numpy.linspace(15.0, 75.0, 7)
+        expect_ptsy, expect_ptsx = numpy.meshgrid(yedges, xedges)
+
+        ptsx3d = numpy.empty((xedges.shape[0] - 1, yedges.shape[0] - 1, 4))
+        ptsy3d = numpy.empty((xedges.shape[0] - 1, yedges.shape[0] - 1, 4))
+
+        ptsx3d[:, :, 0] = expect_ptsx[:-1, :-1]
+        ptsx3d[:, :, 1] = expect_ptsx[1:, :-1]
+        ptsx3d[:, :, 2] = expect_ptsx[1:, 1:]
+        ptsx3d[:, :, 3] = expect_ptsx[:-1, 1:]
+        ptsy3d[:, :, 0] = expect_ptsy[:-1, :-1]
+        ptsy3d[:, :, 1] = expect_ptsy[1:, :-1]
+        ptsy3d[:, :, 2] = expect_ptsy[1:, 1:]
+        ptsy3d[:, :, 3] = expect_ptsy[:-1, 1:]
+        ptsx, ptsy = regrid.quadCornersFrom3D(ptsx3d, ptsy3d)
+        self.assertTrue(numpy.allclose(expect_ptsx, ptsx),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ptsx), str(ptsx)))
+        self.assertTrue(numpy.allclose(expect_ptsy, ptsy),
+                        "Expected Y coordinates:\n%s\nFound Y coordinates:\n%s" % \
+                        (str(expect_ptsy), str(ptsy)))
+
+        ptsx3d[:, :, 0] = expect_ptsx[:-1, :-1]
+        ptsx3d[:, :, 3] = expect_ptsx[1:, :-1]
+        ptsx3d[:, :, 2] = expect_ptsx[1:, 1:]
+        ptsx3d[:, :, 1] = expect_ptsx[:-1, 1:]
+        ptsy3d[:, :, 0] = expect_ptsy[:-1, :-1]
+        ptsy3d[:, :, 3] = expect_ptsy[1:, :-1]
+        ptsy3d[:, :, 2] = expect_ptsy[1:, 1:]
+        ptsy3d[:, :, 1] = expect_ptsy[:-1, 1:]
+        ptsx, ptsy = regrid.quadCornersFrom3D(ptsx3d, ptsy3d)
+        self.assertTrue(numpy.allclose(expect_ptsx, ptsx),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ptsx), str(ptsx)))
+        self.assertTrue(numpy.allclose(expect_ptsy, ptsy),
+                        "Expected Y coordinates:\n%s\nFound Y coordinates:\n%s" % \
+                        (str(expect_ptsy), str(ptsy)))
+
+
+    def testQuadCentroids(self):
+        '''
+        Test of regrid.quadCentroids
+        '''
+        xedges = numpy.linspace(2.0, 10.0, 5)
+        xcenters = 0.5 * (xedges[:-1] + xedges[1:])
+        yedges = numpy.linspace(15.0, 75.0, 7)
+        ycenters = 0.5 * (yedges[:-1] + yedges[1:])
+        ptsx, ptsy = numpy.meshgrid(xedges, yedges)
+        expect_ctrx, expect_ctry = numpy.meshgrid(xcenters, ycenters)
+        ctrx, ctry = regrid.quadCentroids(ptsx, ptsy)
+        self.assertTrue(numpy.allclose(expect_ctrx, ctrx),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctrx), str(ctrx)))
+        self.assertTrue(numpy.allclose(expect_ctry, ctry),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctry), str(ctry)))
+
+        for k in xrange(1, ptsx.shape[0]):
+            ptsx[k, :] += 3.0 * k
+        for k in xrange(expect_ctrx.shape[0]):
+            expect_ctrx[k, :] += 1.5 * (2 * k + 1)
+        for k in xrange(1, ptsy.shape[1]):
+            ptsy[:, k] += 4.0 * k
+        for k in xrange(expect_ctry.shape[1]):
+            expect_ctry[:, k] += 2.0 * (2 * k + 1)
+        ctrx, ctry = regrid.quadCentroids(ptsx, ptsy)
+        self.assertTrue(numpy.allclose(expect_ctrx, ctrx),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctrx), str(ctrx)))
+        self.assertTrue(numpy.allclose(expect_ctry, ctry),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctry), str(ctry)))
+
+        for k in xrange(1, ptsx.shape[1]):
+            ptsx[:, k] += 5.0 * k
+        for k in xrange(expect_ctrx.shape[1]):
+            expect_ctrx[:, k] += 2.5 * (2 * k + 1)
+        for k in xrange(1, ptsy.shape[0]):
+            ptsy[k, :] += 7.0 * k
+        for k in xrange(expect_ctry.shape[0]):
+            expect_ctry[k, :] += 3.5 * (2 * k + 1)
+        ctrx, ctry = regrid.quadCentroids(ptsx, ptsy)
+        self.assertTrue(numpy.allclose(expect_ctrx, ctrx),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctrx), str(ctrx)))
+        self.assertTrue(numpy.allclose(expect_ctry, ctry),
+                        "Expected X coordinates:\n%s\nFound X coordinates:\n%s" % \
+                        (str(expect_ctry), str(ctry)))
+
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/pyfermod/set_memory.c b/pyfermod/set_memory.c
new file mode 100644
index 0000000..ab620c9
--- /dev/null
+++ b/pyfermod/set_memory.c
@@ -0,0 +1,69 @@
+/*
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <Python.h> /* make sure Python.h is first */
+#include "ferret.h"
+#include "ferret_shared_buffer.h"
+#include "pyferret.h"
+
+/* create the extern pointers to the allocated memory */
+double *memory;
+float *ppl_memory;
+sharedMem *sBuffer;
+
+/* assign the memory for ferret's use */
+void set_fer_memory(double *mem, size_t mem_size)
+{
+    int max_mem_blks = PMAX_MEM_BLKS;
+    int mem_blk_size;
+
+    memory = mem;
+    mem_blk_size = (int)(mem_size / (size_t)max_mem_blks);
+    init_memory_( &mem_blk_size, &max_mem_blks );
+}
+
+/* assign the memory for plot plus' use */
+void set_ppl_memory(float *mem, int mem_size)
+{
+    ppl_memory = mem;
+    save_ppl_memory_size_( &mem_size );
+}
+
+/* assign the shared buffer */
+void set_shared_buffer()
+{
+    static sharedMem myBuffer;
+
+    sBuffer = &myBuffer;
+}
diff --git a/pyfermod/stats/__init__.py b/pyfermod/stats/__init__.py
new file mode 100644
index 0000000..6d04751
--- /dev/null
+++ b/pyfermod/stats/__init__.py
@@ -0,0 +1,1790 @@
+"""
+Helper functions for pyferret stats external functions.
+"""
+import math
+import numpy
+try:
+    import scipy.stats
+    import scipy.special
+except ImportError:
+    # do not raise an error until actually used
+    pass
+import pyferret
+
+
+def getdistname(distribname=None):
+    """
+    Translates probability distribution names into scipy.stats names.
+    Arguments:
+        distribname - the distribution name, or None.
+    Returns:
+        If distribname is given (and not None), the "scipy.stats" name for
+            the probability distribution given in distribname, or None if
+            the probability distribution name is not recognized or supported.
+        If distribname is not given (or None), returns a list of string
+            tuples, where the first name in each tuple is the scipy.stats
+            name, the second name is a "full name" and any other names are
+            other recognized aliases.
+    """
+    namelist = (
+                 ( "beta", "Beta", ),
+                 ( "binom", "Binomial", ),
+                 ( "cauchy", "Cauchy", ),
+                 ( "chi", "Chi", ),
+                 ( "chi2", "Chi-Square", ),
+                 ( "expon", "Exponential", ),
+                 ( "exponweib", "Exponentiated-Weibull", ),
+                 ( "f", "F", "Fisher", ),
+                 ( "gamma", "Gamma", ),
+                 ( "geom", "Geometric", "Shifted-Geometric", ),
+                 ( "hypergeom", "Hypergeometric", ),
+                 ( "invgamma", "Inverse-Gamma", ),
+                 ( "laplace", "Laplace", ),
+                 ( "lognorm", "Log-Normal", ),
+                 ( "nbinom", "Negative-Binomial", ),
+                 ( "norm", "Normal", ),
+                 ( "pareto", "Pareto", ),
+                 ( "poisson", "Poisson", ),
+                 ( "randint", "Random-Integer", "Discrete-Uniform", ),
+                 ( "t", "Students-T", ),
+                 ( "uniform", "Uniform", ),
+                 ( "weibull_min", "Weibull", ),
+               )
+    if distribname == None:
+        return namelist
+    lcdistname = str(distribname).lower()
+    # Testing below verifies the above names are all recognized in the following
+    if lcdistname == "beta":
+        return "beta"
+    if (lcdistname == "binom") or (lcdistname == "binomial"):
+        return "binom"
+    if lcdistname == "cauchy":
+        return "cauchy"
+    if lcdistname == "chi":
+        return "chi"
+    if (lcdistname == "chi2") or (lcdistname == "chi-square"):
+        return "chi2"
+    if (lcdistname == "expon") or (lcdistname == "exponential"):
+        return "expon"
+    if (lcdistname == "exponweib") or (lcdistname == "exponentiated-weibull"):
+        return "exponweib"
+    if (lcdistname == "f") or (lcdistname == "fisher"):
+        return "f"
+    if lcdistname == "gamma":
+        return "gamma"
+    if (lcdistname == "geom") or (lcdistname == "geometric") or (lcdistname == "shifted-geometric"):
+        return "geom"
+    if (lcdistname == "hypergeom") or (lcdistname == "hypergeometric"):
+        return "hypergeom"
+    if (lcdistname == "invgamma") or (lcdistname == "inverse-gamma"):
+        return "invgamma"
+    if lcdistname == "laplace":
+        return "laplace"
+    if (lcdistname == "lognorm") or (lcdistname == "log-normal"):
+        return "lognorm"
+    if (lcdistname == "nbinom") or (lcdistname == "negative-binomial"):
+        return "nbinom"
+    if (lcdistname == "norm") or (lcdistname == "normal"):
+        return "norm"
+    if lcdistname == "pareto":
+        return "pareto"
+    if lcdistname == "poisson":
+        return "poisson"
+    if (lcdistname == "randint") or (lcdistname == "random-integer") or (lcdistname == "discrete-uniform"):
+        return "randint"
+    if (lcdistname == "t") or (lcdistname == "students-t"):
+        return "t"
+    if lcdistname == "uniform":
+        return "uniform"
+    if (lcdistname == "weibull_min") or (lcdistname == "weibull"):
+        return "weibull_min"
+    return None
+
+
+def getdistparams(distname, params, tostd=False):
+    """
+    Converts between "standard" parameters for a probability function and
+    the tuple of numeric parameters expected for the scipy.stats function.
+
+    Arguments:
+        distname - the "scipy.stats" name for the probability distribution
+        params - the parameters for the probability distribution, or None
+        tostd - convert from scipy.stats to standard parameters?
+
+    Returns:
+        If params is None, a list of string pairs describing the standard
+        parameters for the distribution.
+
+        If tostd is False, a tuple of scipy.stats parameters corresponding
+        to the standard parameters given in params.  The given parameters
+        are explicitly converted to the correct type (thus strings could
+        be given) and error checking is performed.  Additional offset and
+        scaling parameters, if appropriate, can be given.
+
+        If tostd is True, a tuple of standard parameters corresponding
+        to the scipy.stats parameters given in params.  No explicit type
+        conversion or error checking is performed.  Offset and scaling
+        parameters, if appropriate, are assumed to be given.
+
+    Raises:
+        ValueError if the parameters are inappropriate for the probabiity
+        distribution.
+    """
+    if distname == "beta":
+        if params == None:
+            return ( ( "ALPHA", "first shape", ),
+                     ( "BETA", "second shape", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], params[3], )
+        if (len(params) < 2) or (len(params) > 4):
+            raise ValueError("Two to four parameters expected for the Beta distribution")
+        alpha = float(params[0])
+        beta = float(params[1])
+        if (alpha <= 0.0) or (beta <= 0.0):
+            raise ValueError("Invalid parameter(s) for the Beta distribution")
+        offset = 0.0
+        scaling = 1.0
+        try:
+            offset = float(params[2])
+            scaling = float(params[3])
+        except IndexError:
+            pass
+        return ( alpha, beta, offset, scaling, )
+    if distname == "binom":
+        if params == None:
+            return ( ( "N", "number of trials", ),
+                     ( "P", "success probability in each trial", ), )
+        if tostd:
+            return ( params[0], params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Binomial distribution")
+        nflt = float(params[0])
+        prob = float(params[1])
+        if (nflt < 0.0) or (prob < 0.0) or (prob > 1.0):
+            raise ValueError("Invalid parameter(s) for the Binomial distribution")
+        return ( nflt, prob, )
+    if distname == "cauchy":
+        if params == None:
+            return ( ( "M", "location (median)", ),
+                     ( "GAMMA", "scale (half-width at half-maximum)", ), )
+        if tostd:
+            return ( params[0], params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Cauchy distribution")
+        m = float(params[0])
+        gamma = float(params[1])
+        if gamma <= 0.0:
+            raise ValueError("Invalid parameter for the Cauchy distribution")
+        return ( m, gamma, )
+    if distname == "chi":
+        if params == None:
+            return ( ( "DF", "degrees of freedom", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], )
+        if (len(params) < 1) or (len(params) > 3):
+            raise ValueError("One to three parameters expected for the Chi distribution")
+        degfree = float(params[0])
+        if degfree <= 0.0:
+            raise ValueError("Invalid parameter for the Chi distribution")
+        offset = 0.0
+        scaling = 1.0
+        try:
+            offset = float(params[1])
+            scaling = float(params[2])
+        except IndexError:
+            pass
+        return ( degfree, offset, scaling, )
+    if distname == "chi2":
+        if params == None:
+            return ( ( "DF", "degrees of freedom", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], )
+        if (len(params) < 1) or (len(params) > 3):
+            raise ValueError("One to three parameters expected for the Chi-Square distribution")
+        degfree = float(params[0])
+        if degfree <= 0.0:
+            raise ValueError("Invalid parameter for the Chi-Square distribution")
+        offset = 0.0
+        scaling = 1.0
+        try:
+            offset = float(params[1])
+            scaling = float(params[2])
+        except IndexError:
+            pass
+        return ( degfree, offset, scaling, )
+    if distname == "expon":
+        if params == None:
+            return ( ( "LAMBDA", "rate (inverse scale)", ), )
+        if tostd:
+            return ( 1.0 / params[1], params[0], )
+        if (len(params) < 1) or (len(params) > 2):
+            raise ValueError("One or two parameters expected for the Exponential distribution")
+        lambdaflt = float(params[0])
+        if lambdaflt <= 0.0:
+            raise ValueError("Invalid parameter for the Exponential distribution")
+        try:
+            offset = float(params[1])
+        except IndexError:
+            offset = 0.0
+        return ( offset, 1.0 / lambdaflt, )
+    if distname == "exponweib":
+        if params == None:
+            return ( ( "K", "Weibull shape", ),
+                     ( "LAMBDA", "scale", ),
+                     ( "ALPHA", "power shape", ), )
+        if tostd:
+            return ( params[1], params[3], params[0], params[2], )
+        if (len(params) < 3) or (len(params) > 4):
+            raise ValueError("Three or four parameters expected for the Exponentiated-Weibull distribution")
+        k =  float(params[0])
+        lambdaflt = float(params[1])
+        alpha = float(params[2])
+        if (k <= 0.0) or (lambdaflt <= 0.0) or (alpha <= 0):
+            raise ValueError("Invalid parameter(s) for the Exponentiated-Weibull distribution")
+        try:
+            offset = float(params[3])
+        except IndexError:
+            offset = 0.0
+        return ( alpha, k, offset, lambdaflt, )
+    if distname == "f":
+        if params == None:
+            return ( ( "DFN", "numerator degrees of freedom", ),
+                     ( "DFD", "denominator degrees of freedom", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], params[3], )
+        if (len(params) < 2) or (len(params) > 4):
+            raise ValueError("Two to four parameters expected for the F distribution")
+        dfnum = float(params[0])
+        dfdenom = float(params[1])
+        if (dfnum <= 0.0) or (dfdenom <= 0.0):
+           raise ValueError("Invalid parameter(s) for the F distribution")
+        offset = 0.0
+        scaling = 1.0
+        try:
+            offset = float(params[2])
+            scaling = float(params[3])
+        except IndexError:
+            pass
+        return ( dfnum, dfdenom, offset, scaling, )
+    if distname == "gamma":
+        if params == None:
+            return ( ( "ALPHA", "shape", ),
+                     ( "THETA", "scale", ), )
+        if tostd:
+            return ( params[0], params[2], params[1], )
+        if (len(params) < 2) or (len(params) > 3):
+            raise ValueError("Two or three parameters expected for the Gamma distribution")
+        alpha = float(params[0])
+        theta = float(params[1])
+        if (alpha <= 0.0) or (theta <= 0.0):
+            raise ValueError("Invalid parameter(s) for the Gamma distribution")
+        try:
+            offset = float(params[2])
+        except IndexError:
+            offset = 0.0
+        return ( alpha, offset, theta, )
+    if distname == "geom":
+        if params == None:
+            return ( ( "P", "success probability", ), )
+        if tostd:
+            return ( params[0], )
+        if len(params) != 1:
+            raise ValueError("One parameter expected for the Shifted-Geometric distribution")
+        prob = float(params[0])
+        if (prob < 0.0) or (prob > 1.0):
+            raise ValueError("Invalid parameter for the Shifted-Geometric distribution")
+        return ( prob, )
+    if distname == "hypergeom":
+        if params == None:
+            return ( ( "NTOTAL", "total number of items", ),
+                     ( "NGOOD", "total number of 'success' items", ),
+                     ( "NDRAWN", "number of items selected", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], )
+        if len(params) != 3:
+           raise ValueError("Three parameters expected for the Hypergeometric distribution")
+        numtotal = float(params[0])
+        numgood = float(params[1])
+        numdrawn = float(params[2])
+        if (numtotal <= 0.0) or (numgood < 0.0) or (numdrawn < 0.0):
+           raise ValueError("Invalid parameter(s) for the Hypergeometric distribution")
+        return ( numtotal, numgood, numdrawn, )
+    if distname == "invgamma":
+        if params == None:
+            return ( ( "ALPHA", "shape", ),
+                     ( "BETA", "scale", ), )
+        if tostd:
+            return ( params[0], params[2], params[1], )
+        if (len(params) < 2) or (len(params) > 3):
+            raise ValueError("Two or three parameters expected for the Inverse-Gamma distribution")
+        alpha = float(params[0])
+        beta = float(params[1])
+        if (alpha <= 0.0) or (beta <= 0.0):
+            raise ValueError("Invalid parameter(s) for the Inverse-Gamma distribution")
+        try:
+            offset = float(params[2])
+        except IndexError:
+            offset = 0.0
+        return ( alpha, offset, beta, )
+    if distname == "laplace":
+        if params == None:
+            return ( ( "MU", "location (mean)", ),
+                     ( "B", "scale", ), )
+        if tostd:
+            return ( params[0], params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Laplace distribution")
+        mu = float(params[0])
+        b = float(params[1])
+        if b <= 0.0:
+            raise ValueError("Invalid parameters for the Laplace distribution")
+        return ( mu, b, )
+    if distname == "lognorm":
+        if params == None:
+            return ( ( "MU", "log-scale (mean of the natural log of the distribution)", ),
+                     ( "SIGMA", "shape (std. dev. of the natural log of the distribution)", ), )
+        if tostd:
+            return ( math.log(params[2]), params[0], params[1], )
+        if (len(params) < 2) or (len(params) > 3):
+            raise ValueError("Two or three parameters expected for the Log-Normal distribution")
+        mu = math.exp(float(params[0]))
+        sigma = float(params[1])
+        if sigma <= 0.0:
+            raise ValueError("Invalid parameter for the Log-Normal distribution")
+        try:
+            offset = float(params[2])
+        except IndexError:
+            offset = 0.0
+        return ( sigma, offset, mu, )
+    if distname == "nbinom":
+        if params == None:
+            return ( ( "N", "number of successes to stop", ),
+                     ( "P", "success probability in each trial", ), )
+        if tostd:
+            return ( params[0], params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Negative-Binomial distribution")
+        numsuccess = float(params[0])
+        prob = float(params[1])
+        if (numsuccess < 1.0) or (prob <= 0.0) or (prob > 1.0):
+            raise ValueError("Invalid parameter(s) for the Negative-Binomial distribution")
+        return ( numsuccess, prob, )
+    if distname == "norm":
+        if params == None:
+            return ( ( "MU", "mean value", ),
+                     ( "SIGMA", "standard deviation", ), )
+        if tostd:
+            return ( params[0], params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Normal distribution")
+        mu = float(params[0])
+        sigma = float(params[1])
+        if sigma <= 0.0:
+            raise ValueError("Invalid parameter for the Normal distribution")
+        return ( mu, sigma, )
+    if distname == "pareto":
+        if params == None:
+            return ( ( "XM", "scale (minimum abscissa value)", ),
+                     ( "ALPHA", "shape", ), )
+        if tostd:
+            return ( params[2], params[0], params[1], )
+        if (len(params) < 2) or (len(params) > 3):
+            raise ValueError("Two or three parameters expected for the Pareto distribution")
+        xm =  float(params[0])
+        alpha = float(params[1])
+        if (xm <= 0.0) or (alpha <= 0.0):
+            raise ValueError("Invalid parameter(s) for the Pareto distribution")
+        try:
+            offset = float(params[2])
+        except IndexError:
+            offset = 0.0
+        return ( alpha, offset, xm, )
+    if distname == "poisson":
+        if params == None:
+            return ( ( "MU", "expected number of occurences", ), )
+        if tostd:
+            return ( params[0], )
+        if len(params) != 1:
+            raise ValueError("One parameter expected for the Poisson distribution")
+        mu = float(params[0])
+        if mu <= 0.0:
+            raise ValueError("Invalid parameter for the Poisson distribution")
+        return ( mu, )
+    if distname == "randint":
+        if params == None:
+            return ( ( "MIN", "minimum integer", ),
+                     ( "MAX", "maximum integer (included)", ), )
+        if tostd:
+            return ( params[0], params[1] - 1, )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Random-Integer distribution")
+        min = int(params[0])
+        max = int(params[1])
+        # randint takes int values, thus float values are truncated
+        # this could lead to unexpected behavior (eg, one might expect
+        # (0.9,10.1) to be treated as [1,11) but instead it becomes [0,10)
+        minflt = float(params[0])
+        maxflt = float(params[1])
+        if (min >= max) or (min != minflt) or (max != maxflt):
+            raise ValueError("Invalid parameters for the Random-Integer distribution")
+        return ( min, max + 1, )
+    if distname == "t":
+        if params == None:
+            return ( ( "DF", "degrees of freedom", ), )
+        if tostd:
+            return ( params[0], params[1], params[2], )
+        if (len(params) < 1) or (len(params) > 3):
+            raise ValueError("One to three parameters expected for the Students-T distribution")
+        degfree = float(params[0])
+        if degfree <= 0.0:
+            raise ValueError("Invalid parameter for the Students-T distribution")
+        offset = 0.0
+        scaling = 1.0
+        try:
+            offset = float(params[1])
+            scaling = float(params[2])
+        except IndexError:
+            pass
+        return ( degfree, offset, scaling, )
+    if distname == "uniform":
+        if params == None:
+            return ( ( "MIN", "minimum", ),
+                     ( "MAX", "maximum", ), )
+        if tostd:
+            return ( params[0], params[0] + params[1], )
+        if len(params) != 2:
+            raise ValueError("Two parameters expected for the Uniform distribution")
+        min = float(params[0])
+        max = float(params[1])
+        if min >= max:
+            raise ValueError("Invalid parameters for the Uniform distribution")
+        # these are the "loc" and "scale" parameters for the uniform distribution
+        return ( min, max - min, )
+    if distname == "weibull_min":
+        if params == None:
+            return ( ( "K", "shape", ),
+                     ( "LAMBDA", "scale", ), )
+        if tostd:
+            return ( params[0], params[2], params[1], )
+        if (len(params) < 2) or (len(params) > 3):
+            raise ValueError("Two or three parameters expected for the Weibull distribution")
+        k =  float(params[0])
+        lambdaflt = float(params[1])
+        if (k <= 0.0) or (lambdaflt <= 0.0):
+            raise ValueError("Invalid parameter(s) for the Weibull distribution")
+        try:
+            offset = float(params[2])
+        except IndexError:
+            offset = 0.0
+        return ( k, offset, lambdaflt, )
+    return None
+
+
+def getdistrib(distribname, distribparams):
+    """
+    Creates and returns scipy.stats "frozen" probability distribution
+    object.  Converts the "standard" parameters (including ordering)
+    for a distribution to appropriate parameters for calling the
+    constructor of the scipy.stats frozen distribution object.
+
+    Arguments:
+       distribname - name of the probability distribution
+       distribparams - tuple/list/array of standard input parameters
+
+    Returns:
+       the scipy.stats "frozen" probability distribution object
+           described by distribname and distribparams
+
+    Raises:
+       ValueError if the distribution name is not recognized by this
+                  routine or if the distribution parameters are invalid
+    """
+    if (distribname == None) or (distribparams == None):
+        raise ValueError("Neither distribname nor distribparams can be None")
+    distscipyname = getdistname(distribname)
+    if distscipyname == None:
+        raise ValueError("Unknown probability function %s" % str(distribname))
+    distscipyparams = getdistparams(distscipyname, distribparams)
+    if distscipyparams == None:
+        raise ValueError("Unknown (for params) probability function %s" % str(distribname))
+    distfunc = eval("scipy.stats.%s" % distscipyname)
+    distrib = distfunc(*distscipyparams)
+    return distrib
+
+
+def getfitparams(values, distribname, estparams):
+    """
+    Returns a tuple of "standard" parameters (including ordering) for a
+    continuous probability distribution type named in distribname that
+    best fits the distribution of data given in values (a 1-D array of
+    data with no missing values).  Initial estimates for these "standard"
+    parameters are given in estparams.
+    """
+    if (distribname == None) or (estparams == None):
+        raise ValueError("Neither distribname nor estparams can be None")
+    distscipyname = getdistname(distribname)
+    if distscipyname == None:
+        raise ValueError("Unknown probability function %s" % str(distribname))
+    estscipyparams = getdistparams(distscipyname, estparams)
+    if estscipyparams == None:
+        raise ValueError("Unknown (for params) probability function %s" % str(distribname))
+    try:
+        fitfunc = eval("scipy.stats.%s.fit" % distscipyname)
+    except AttributeError:
+        raise ValueError("No fit function for probability function %s" % str(distribname))
+    if distscipyname == "uniform":
+        # "params" keyword for the uniform distribution does not work as expected
+        fitscipyparams = fitfunc(values, loc=estscipyparams[0], scale=estscipyparams[1])
+    else:
+        fitscipyparams = fitfunc(values, params=estscipyparams)
+    return getdistparams(distscipyname, fitscipyparams, tostd=True)
+
+
+def getinitdict(distribname, funcname):
+    """
+    Returns a dictionary appropriate for the return value of ferret_init
+    in a Ferret stats_<disribname>_<funcname> PyEF
+
+    Arguments:
+       distribname - name of the probability distribution
+       funcname - name of the scipy.stats probability distribution function
+    """
+    # generate a long function name from the scipy.stats function name
+    if ( funcname == "cdf" ):
+        funcaction = "calculate"
+        funcreturn = "cumulative density function values"
+    elif ( funcname == "isf" ):
+        funcaction = "calculate"
+        funcreturn = "inversion survival function values"
+    elif ( funcname == "pdf" ):
+        funcaction = "calculate"
+        funcreturn = "probability distribution function values"
+    elif ( funcname == "pmf" ):
+        funcaction = "calculate"
+        funcreturn = "probability mass function values"
+    elif ( funcname == "ppf" ):
+        funcaction = "calculate"
+        funcreturn = "percent point function values"
+    elif ( funcname == "sf" ):
+        funcaction = "calculate"
+        funcreturn = "survival function values"
+    elif ( funcname == "rvs" ):
+        funcaction = "assign"
+        funcreturn = "random variates"
+    else:
+        raise ValueError("Unsupported scipy.stats function name '%s'" % funcname)
+    # Get the distribution parameters information
+    distscipyname = getdistname(distribname)
+    paramdescripts = getdistparams(distscipyname, None)
+    numargs = len(paramdescripts) + 1
+    descript = "Returns array of %s for %s prob. distrib." % (funcreturn, distribname)
+    axes = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    argtypes = [ pyferret.FLOAT_ARRAY ] * numargs
+    influences = [ [ True ] * pyferret.MAX_FERRET_NDIM ] * numargs
+    if ( numargs == 2 ):
+        # info for distributions with one parameter
+        argnames = ( "PTS", paramdescripts[0][0], )
+        argdescripts = ( "Point(s) at which to %s the %s" % (funcaction, funcreturn),
+                         "Parameter(s) defining the %s" % paramdescripts[0][1], )
+    elif (numargs == 3):
+        # info for distributions with two parameters
+        argnames = ( "PTS", paramdescripts[0][0], paramdescripts[1][0], )
+        argdescripts = ( "Point(s) at which to %s the %s" % (funcaction, funcreturn),
+                         "Parameter(s) defining the %s" % paramdescripts[0][1],
+                         "Parameter(s) defining the %s" % paramdescripts[1][1], )
+    elif (numargs == 4):
+        # info for distributions with three parameters
+        argnames = ( "PTS", paramdescripts[0][0], paramdescripts[1][0], paramdescripts[2][0], )
+        argdescripts = ( "Point(s) at which to %s the %s" % (funcaction, funcreturn),
+                         "Parameter(s) defining the %s" % paramdescripts[0][1],
+                         "Parameter(s) defining the %s" % paramdescripts[1][1],
+                         "Parameter(s) defining the %s" % paramdescripts[2][1], )
+    else:
+        raise ValueError("Unexpected number of arguments: %d" % numargs)
+    # Create and return the dictionary
+    return { "numargs": numargs,
+             "descript": descript,
+             "axes": axes,
+             "argnames": argnames,
+             "argdescripts": argdescripts,
+             "argtypes": argtypes,
+             "influences": influences, }
+
+
+def getdistribfunc(distrib, funcname):
+    """
+    Returns the distrib.funcname function for recognized funcnames
+    """
+    if ( funcname == "cdf" ):
+        return distrib.cdf
+    elif ( funcname == "isf" ):
+        return distrib.isf
+    elif ( funcname == "pdf" ):
+        return distrib.pdf
+    elif ( funcname == "pmf" ):
+        return distrib.pmf
+    elif ( funcname == "ppf" ):
+        return distrib.ppf
+    elif ( funcname == "sf" ):
+        return distrib.sf
+    elif ( funcname == "rvs" ):
+        return distrib.rvs
+    else:
+        raise ValueError("Unsupported scipy.stats function name '%s'" % funcname)
+
+
+def assignresultsarray(distribname, funcname, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the funcname function values for the distribname
+    probability distributions defined by parameters in inputs[1:]
+    using the abscissa or template values given in inputs[0].
+    """
+    # get the masks for the PTS data
+    pts = inputs[0]
+    badmask = ( numpy.fabs(pts - inpbdfs[0]) < 1.0E-7 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(pts))
+    goodmask = numpy.logical_not(badmask)
+    # figure out the axes for the parameters
+    numparams = len(inputs) - 1
+    if numparams > 0:
+        par1axis = -1
+        for k in xrange(pyferret.MAX_FERRET_NDIM):
+            if inputs[1].shape[k] > 1:
+                if par1axis != -1:
+                    raise ValueError("Parameters arrays can have only one defined, non-singular axis")
+                par1axis = k
+        if par1axis >= 0:
+            if pts.shape[par1axis] > 1:
+                raise ValueError("Unexpected error: shape[%d] of PTS and PAR1 both > 1" % par1axis)
+        par1vals = inputs[1].reshape(-1)
+        # temporary results array for a given first parameter
+        tmp1result = numpy.empty(pts.shape, dtype=numpy.float64, order='F')
+        tmp1result[badmask] = resbdf
+    if numparams > 1:
+        par2axis = -1
+        for k in xrange(pyferret.MAX_FERRET_NDIM):
+            if inputs[2].shape[k] > 1:
+                if par2axis != -1:
+                    raise ValueError("Parameters arrays can have only one defined, non-singular axis")
+                par2axis = k
+        if par2axis >= 0:
+            if pts.shape[par2axis] > 1:
+                raise ValueError("Unexpected error: shape[%d] of PTS and PAR2 both > 1" % par2axis)
+            if par1axis == par2axis:
+                raise ValueError("Unexpected error: shape[%d] of PAR1 and PAR2 both > 1" % par2axis)
+        par2vals = inputs[2].reshape(-1)
+        # temporary results array for a given second parameter and all of the first parameters
+        if par1axis == -1:
+            tmp2result = tmp1result
+        else:
+            shape = list(tmp1result.shape)
+            shape[par1axis] = len(par1vals)
+            tmp2result = numpy.empty(shape, dtype=numpy.float64, order='F')
+    if numparams > 2:
+        par3axis = -1
+        for k in xrange(pyferret.MAX_FERRET_NDIM):
+            if inputs[3].shape[k] > 1:
+                if par3axis != -1:
+                    raise ValueError("Parameters arrays can have only one defined, non-singular axis")
+                par3axis = k
+        if par3axis >= 0:
+            if pts.shape[par3axis] > 1:
+                raise ValueError("Unexpected error: shape[%d] of PTS and PAR3 both > 1" % par3axis)
+            if par1axis == par3axis:
+                raise ValueError("Unexpected error: shape[%d] of PAR1 and PAR3 both > 1" % par3axis)
+            if par2axis == par3axis:
+                raise ValueError("Unexpected error: shape[%d] of PAR2 and PAR3 both > 1" % par3axis)
+        par3vals = inputs[3].reshape(-1)
+        # temporary results array for a given third parameter and all of the first and second parameters
+        if par2axis == -1:
+            tmp3result = tmp2result
+        else:
+            shape = list(tmp2result.shape)
+            shape[par2axis] = len(par2vals)
+            tmp3result = numpy.empty(shape, dtype=numpy.float64, order='F')
+    # deal with each number of parameters separately when assigning results
+    if numparams == 1:
+        for j in xrange(len(par1vals)):
+            try:
+                if math.isnan(par1vals[j]) or (math.fabs(par1vals[j] - inpbdfs[1]) < 1.0E-7):
+                    raise ValueError
+                distrib = getdistrib(distribname, ( par1vals[j], ))
+                distribfunc = getdistribfunc(distrib, funcname)
+                if funcname == "rvs":
+                    tmp1result[goodmask] = getdistribfunc(distrib, funcname)(len(pts[goodmask]))
+                else:
+                    tmp1result[goodmask] = getdistribfunc(distrib, funcname)(pts[goodmask])
+            except ValueError:
+                tmp1result[goodmask] = resbdf
+            # Appropriately assign the tmp1result to result
+            if par1axis == -1:
+                result[:, :, :, :, :, :] = tmp1result
+            elif par1axis == 0:
+                result[j, :, :, :, :, :] = tmp1result[0, :, :, :, :, :]
+            elif par1axis == 1:
+                result[:, j, :, :, :, :] = tmp1result[:, 0, :, :, :, :]
+            elif par1axis == 2:
+                result[:, :, j, :, :, :] = tmp1result[:, :, 0, :, :, :]
+            elif par1axis == 3:
+                result[:, :, :, j, :, :] = tmp1result[:, :, :, 0, :, :]
+            elif par1axis == 4:
+                result[:, :, :, :, j, :] = tmp1result[:, :, :, :, 0, :]
+            elif par1axis == 5:
+                result[:, :, :, :, :, j] = tmp1result[:, :, :, :, :, 0]
+            else:
+                raise ValueError("Unexpected par1axis of %d" % par1axis)
+    elif numparams == 2:
+        for k in xrange(len(par2vals)):
+            for j in xrange(len(par1vals)):
+                try:
+                    if math.isnan(par2vals[k]) or (math.fabs(par2vals[k] - inpbdfs[2]) < 1.0E-7) or \
+                       math.isnan(par1vals[j]) or (math.fabs(par1vals[j] - inpbdfs[1]) < 1.0E-7):
+                        raise ValueError
+                    distrib = getdistrib(distribname, ( par1vals[j], par2vals[k], ))
+                    distribfunc = getdistribfunc(distrib, funcname)
+                    if funcname == "rvs":
+                        tmp1result[goodmask] = getdistribfunc(distrib, funcname)(len(pts[goodmask]))
+                    else:
+                        tmp1result[goodmask] = getdistribfunc(distrib, funcname)(pts[goodmask])
+                except ValueError:
+                    tmp1result[goodmask] = resbdf
+                # Appropriately assign the tmp1result to tmp2result
+                if par1axis == -1:
+                    # in this case tmp2result is tmp1result
+                    pass
+                elif par1axis == 0:
+                    tmp2result[j, :, :, :, :, :] = tmp1result[0, :, :, :, :, :]
+                elif par1axis == 1:
+                    tmp2result[:, j, :, :, :, :] = tmp1result[:, 0, :, :, :, :]
+                elif par1axis == 2:
+                    tmp2result[:, :, j, :, :, :] = tmp1result[:, :, 0, :, :, :]
+                elif par1axis == 3:
+                    tmp2result[:, :, :, j, :, :] = tmp1result[:, :, :, 0, :, :]
+                elif par1axis == 4:
+                    tmp2result[:, :, :, :, j, :] = tmp1result[:, :, :, :, 0, :]
+                elif par1axis == 5:
+                    tmp2result[:, :, :, :, :, j] = tmp1result[:, :, :, :, :, 0]
+                else:
+                    raise ValueError("Unexpected par1axis of %d" % par1axis)
+            # Appropriately assign the tmp2result to result
+            if par2axis == -1:
+                result[:, :, :, :, :, :] = tmp2result
+            elif par2axis == 0:
+                result[k, :, :, :, :, :] = tmp2result[0, :, :, :, :, :]
+            elif par2axis == 1:
+                result[:, k, :, :, :, :] = tmp2result[:, 0, :, :, :, :]
+            elif par2axis == 2:
+                result[:, :, k, :, :, :] = tmp2result[:, :, 0, :, :, :]
+            elif par2axis == 3:
+                result[:, :, :, k, :, :] = tmp2result[:, :, :, 0, :, :]
+            elif par2axis == 4:
+                result[:, :, :, :, k, :] = tmp2result[:, :, :, :, 0, :]
+            elif par2axis == 5:
+                result[:, :, :, :, :, k] = tmp2result[:, :, :, :, :, 0]
+            else:
+                raise ValueError("Unexpected par2axis of %d" % par2axis)
+    elif numparams == 3:
+        for q in xrange(len(par3vals)):
+            for k in xrange(len(par2vals)):
+                for j in xrange(len(par1vals)):
+                    try:
+                        if math.isnan(par3vals[q]) or (math.fabs(par3vals[q] - inpbdfs[3]) < 1.0E-7) or \
+                           math.isnan(par2vals[k]) or (math.fabs(par2vals[k] - inpbdfs[2]) < 1.0E-7) or \
+                           math.isnan(par1vals[j]) or (math.fabs(par1vals[j] - inpbdfs[1]) < 1.0E-7):
+                            raise ValueError
+                        distrib = getdistrib(distribname, ( par1vals[j], par2vals[k], par3vals[q], ))
+                        distribfunc = getdistribfunc(distrib, funcname)
+                        if funcname == "rvs":
+                            tmp1result[goodmask] = getdistribfunc(distrib, funcname)(len(pts[goodmask]))
+                        else:
+                            tmp1result[goodmask] = getdistribfunc(distrib, funcname)(pts[goodmask])
+                    except ValueError:
+                        tmp1result[goodmask] = resbdf
+                    # Appropriately assign the tmp1result to tmp2result
+                    if par1axis == -1:
+                        # in this case tmp2result is tmp1result
+                        pass
+                    elif par1axis == 0:
+                        tmp2result[j, :, :, :, :, :] = tmp1result[0, :, :, :, :, :]
+                    elif par1axis == 1:
+                        tmp2result[:, j, :, :, :, :] = tmp1result[:, 0, :, :, :, :]
+                    elif par1axis == 2:
+                        tmp2result[:, :, j, :, :, :] = tmp1result[:, :, 0, :, :, :]
+                    elif par1axis == 3:
+                        tmp2result[:, :, :, j, :, :] = tmp1result[:, :, :, 0, :, :]
+                    elif par1axis == 4:
+                        tmp2result[:, :, :, :, j, :] = tmp1result[:, :, :, :, 0, :]
+                    elif par1axis == 5:
+                        tmp2result[:, :, :, :, :, j] = tmp1result[:, :, :, :, :, 0]
+                    else:
+                        raise ValueError("Unexpected par1axis of %d" % par1axis)
+                # Appropriately assign the tmp2result to tmp3result
+                if par2axis == -1:
+                    # in this case tmp3result is tmp2result
+                    pass
+                elif par2axis == 0:
+                    tmp3result[k, :, :, :, :, :] = tmp2result[0, :, :, :, :, :]
+                elif par2axis == 1:
+                    tmp3result[:, k, :, :, :, :] = tmp2result[:, 0, :, :, :, :]
+                elif par2axis == 2:
+                    tmp3result[:, :, k, :, :, :] = tmp2result[:, :, 0, :, :, :]
+                elif par2axis == 3:
+                    tmp3result[:, :, :, k, :, :] = tmp2result[:, :, :, 0, :, :]
+                elif par2axis == 4:
+                    tmp3result[:, :, :, :, k, :] = tmp2result[:, :, :, :, 0, :]
+                elif par2axis == 5:
+                    tmp3result[:, :, :, :, :, k] = tmp2result[:, :, :, :, :, 0]
+                else:
+                    raise ValueError("Unexpected par2axis of %d" % par2axis)
+            # Appropriately assign the tmp3result to result
+            if par3axis == -1:
+                result[:, :, :, :, :, :] = tmp3result
+            elif par3axis == 0:
+                result[q, :, :, :, :, :] = tmp3result[0, :, :, :, :, :]
+            elif par3axis == 1:
+                result[:, q, :, :, :, :] = tmp3result[:, 0, :, :, :, :]
+            elif par3axis == 2:
+                result[:, :, q, :, :, :] = tmp3result[:, :, 0, :, :, :]
+            elif par3axis == 3:
+                result[:, :, :, q, :, :] = tmp3result[:, :, :, 0, :, :]
+            elif par3axis == 4:
+                result[:, :, :, :, q, :] = tmp3result[:, :, :, :, 0, :]
+            elif par3axis == 5:
+                result[:, :, :, :, :, q] = tmp3result[:, :, :, :, :, 0]
+            else:
+                raise ValueError("Unexpected par3axis of %d" % par3axis)
+    else:
+        raise ValueError("Unexpected number of parameters: %d" % numparams)
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # Test getdistname names
+    namelist = getdistname(None)
+    if len(namelist) < 22:
+        raise ValueError("Too few of distributions: expected at least 22; found %d" % \
+                         len(distdescripts))
+    for nametuple in namelist:
+        for name in nametuple:
+            statsname = getdistname(name)
+            if statsname != nametuple[0]:
+                raise ValueError("getdistname(%s): expected %s; found %s" % \
+                                 (name, nametuple[0], statsname))
+
+    # Test the distribution scipy name and parameters given to getdistrib
+    # give the expected distribution.  (Primarily that the parameters
+    # are interpreted and assigned correctly.)
+    # Testing of the long names is performed by the stats_helper.py script.
+    # Testing of assignresultsarray is done in the stats_norm_*.py scipts.
+
+    # Beta distribution
+    distname = "beta"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d" % \
+                         (distname, len(descript)))
+    del descript
+
+    alpha = 1.5
+    beta = 2.75
+    distparms = [ alpha, beta ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( alpha / (alpha + beta),
+                      alpha * beta / ((alpha + beta)**2 * (alpha + beta + 1.0)),
+                      2.0 * (beta - alpha) / (2.0 + alpha + beta) *
+                          math.sqrt((1.0 + alpha + beta) / (alpha * beta)),
+                      6.0 * (alpha**3 + alpha**2 * (1.0 - 2.0 * beta) + \
+                          beta**2 * (1.0 + beta) - 2.0 * alpha * beta * (2.0 + beta)) / \
+                          (alpha * beta * (alpha + beta + 2.0) * (alpha + beta + 3.0)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del alpha, beta, foundstats, expectedstats
+
+    # append the default loc and scale to the expected params
+    distparms.append(0.0)
+    distparms.append(1.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Binomial distribution
+    distname = "binom"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    ntrials = 20.0
+    prob = 0.25
+    distparms = [ ntrials, prob ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( ntrials * prob,
+                      ntrials * prob * (1.0 - prob),
+                      (1.0 - 2.0 * prob) / math.sqrt(ntrials * prob * (1.0 - prob)),
+                      (1.0 - 6.0 * prob * (1.0 - prob)) / (ntrials * prob * (1.0 - prob)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del ntrials, prob, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no binom.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Cauchy distribution
+    distname = "cauchy"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    m = 5.0
+    gamma = 2.0
+    distparms = [ m, gamma ]
+    distf = getdistrib(distname, distparms)
+    # mean, variance, skew, kurtosis undefined; instead check some pdf values
+    xvals = numpy.arange(0.0, 10.1, 0.5)
+    foundpdfs = distf.pdf(xvals)
+    expectedpdfs = (gamma / numpy.pi) / ((xvals - m)**2 + gamma**2)
+    if not numpy.allclose(foundpdfs, expectedpdfs):
+        print "%s: FAIL" % distname
+        raise ValueError("pdfs(0.0:10.1:0.5) of %s(%#.1f,%#.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedpdfs), str(foundpdfs)))
+    del m, gamma, xvals, foundpdfs, expectedpdfs
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Chi distribution
+    distname = "chi"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    degfree = 10
+    distparms = [ degfree ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    mean = math.sqrt(2.0) * scipy.special.gamma(0.5 * (degfree + 1.0)) / \
+                            scipy.special.gamma(0.5 * degfree)
+    variance = degfree - mean**2
+    stdev = math.sqrt(variance)
+    skew = mean * (1.0 - 2.0 * variance) / stdev**3
+    expectedstats = ( mean,
+                      variance,
+                      skew,
+                      2.0 * (1.0 - mean * stdev * skew - variance) / variance,
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%d.0): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del degfree, foundstats, mean, variance, stdev, skew, expectedstats
+
+    # append the default loc and scale to the expected params
+    distparms.append(0.0)
+    distparms.append(1.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.4, atol=0.4):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Chi-squared distribution
+    distname = "chi2"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    degfreestr = "10"
+    distparms = [ degfreestr ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    degfree = float(degfreestr)
+    expectedstats = ( degfree,
+                      2.0 * degfree,
+                      math.sqrt(8.0 / degfree),
+                      12.0 / degfree,
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%s): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del degfreestr, foundstats, expectedstats
+
+    # append the default loc and scale to the expected (numeric) params
+    distparms = [ degfree, 0.0, 1.0 ]
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.4, atol=0.4):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del degfree, distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Exponential distribution
+    distname = "expon"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    lambdaflt = 11.0
+    distparms = [ lambdaflt ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( 1.0 / lambdaflt, 1.0 / lambdaflt**2, 2.0, 6.0 )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del lambdaflt, foundstats, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Exponentiated Weibull distribution
+    distname = "exponweib"
+    descript = getdistparams(distname, None)
+    if len(descript) != 3:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 3; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    k = 3.0
+    lambdaflt = 5.0
+    alpha = 2.5
+    distparms = [ k, lambdaflt, alpha ]
+    distf = getdistrib(distname, distparms)
+    # don't know the formula for the mean, variance, skew, kurtosis
+    # instead check some cdf values
+    xvals = numpy.arange(0.0, 10.1, 0.5)
+    foundcdfs = distf.cdf(xvals)
+    expectedcdfs = numpy.power(1.0 - numpy.exp(-1.0 * numpy.power(xvals / lambdaflt, k)), alpha)
+    if not numpy.allclose(foundcdfs, expectedcdfs):
+        print "%s: FAIL" % distname
+        raise ValueError("cdfs(0.0:10.1:0.5) of %s(%#.1f,%#.1f%#.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], distparms[2], str(expectedcdfs), str(foundcdfs)))
+    del k, lambdaflt, alpha, xvals, foundcdfs, expectedcdfs
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # F distribution
+    distname = "f"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    dofn = 7.0
+    dofd = 11.0   # needs to be larger than 8.0 for kurtosis formula
+    distparms = [ dofn, dofd ]
+    distf = getdistrib(distname, distparms)
+    # foundstats = distf.stats("mvsk")
+    foundstats = distf.stats("mv")
+    expectedstats = ( dofd / (dofd - 2.0),
+                      2.0 * dofd**2 * (dofn + dofd - 2.0) / \
+                          (dofn * (dofd - 2.0)**2 * (dofd - 4.0)),
+                      # ((2.0 * dofn + dofd - 2.0) / (dofd - 6.0)) * \
+                      #     math.sqrt(8.0 * (dofd - 4.0) / (dofn * (dofn + dofd - 2.0))),
+                      # 12.0 * (20.0 * dofd - 8.0 * dofd**2 + dofd**3 + 44.0 * dofn - 32.0 * dofn * dofd + \
+                      #     5.0 * dofd**2 * dofn - 22.0 * dofn**2 + 5.0 * dofd * dofn**2 - 16.0) / \
+                      #     (dofn * (dofd - 6.0) * (dofd - 8.0) * (dofn + dofd - 2)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        # raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    # since skew and kurtosis is not coming out as expected, check some pdf values
+    xvals = numpy.arange(0.5, 10.1, 0.5)
+    foundpdfs = distf.pdf(xvals)
+    factor = scipy.special.gamma(0.5 * (dofn + dofd)) / \
+             (scipy.special.gamma(0.5 * dofn) * scipy.special.gamma(0.5 *dofd))
+    factor *= math.pow(dofn, 0.5 * dofn) * math.pow(dofd, 0.5 * dofd)
+    expectedpdfs = factor * numpy.power(xvals, 0.5 * dofn - 1.0) / \
+                   numpy.power(dofd + dofn * xvals, 0.5 * (dofn + dofd))
+    if not numpy.allclose(foundpdfs, expectedpdfs):
+        print "%s: FAIL" % distname
+        raise ValueError("pdfs(0.5:10.1:0.5) of %s(%#.1f,%#.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedpdfs), str(foundpdfs)))
+    del dofn, dofd, foundstats, expectedstats, xvals, foundpdfs, factor, expectedpdfs
+
+    # append the default loc and scale to the expected params
+    distparms.append(0.0)
+    distparms.append(1.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.2, atol=0.4):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Gamma distribution
+    distname = "gamma"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    alpha = 5.0
+    theta = 3.0
+    distparms = [ alpha, theta ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( alpha * theta, alpha * theta**2, 2.0 / math.sqrt(alpha), 6.0 / alpha )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del alpha, theta, foundstats, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    fitparms = getfitparams(sample, distname, distparms)
+    if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+        print "%s: FAIL" % distname
+        raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                      (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms, sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Geometric distribution
+    distname = "geom"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    prob = 0.25
+    distparms = [ prob ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( 1.0 / prob,
+                     (1.0 - prob) / prob**2,
+                     (2.0 - prob) / math.sqrt(1.0 - prob),
+                     6.0 + prob**2 / (1.0 - prob),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del prob, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no geom.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Hypergeometric distribution
+    distname = "hypergeom"
+    descript = getdistparams(distname, None)
+    if len(descript) != 3:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 3; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    numtotal = 29.0
+    numgood = 13.0
+    numdrawn = 17.0
+    distparms = [ numtotal, numgood, numdrawn ]
+    distf = getdistrib(distname, distparms)
+    # foundstats = distf.stats("mvsk")
+    foundstats = distf.stats("mvs")
+    expectedstats = ( numdrawn * numgood / numtotal,
+                      numdrawn * numgood * (numtotal - numdrawn) * (numtotal - numgood) / \
+                          (numtotal**2 * (numtotal - 1.0)),
+                      math.sqrt(numtotal - 1.0) * (numtotal - 2.0 * numdrawn) * (numtotal - 2.0 * numgood) / \
+                          (math.sqrt(numdrawn * numgood * (numtotal - numdrawn) * (numtotal - numgood)) * \
+                              (numtotal - 2.0)),
+                      # (numtotal**2 * (numtotal - 1.0) / \
+                      #         (numdrawn * (numtotal - 2.0) * (numtotal - 3.0) * (numtotal - numdrawn))) * \
+                      #     ((numtotal * (numtotal + 1.0) - 6.0 * numtotal * (numtotal - numdrawn)) / \
+                      #      (numgood * (numtotal - numgood)) + \
+                      #      3.0 * numdrawn * (numtotal - numdrawn) * (numtotal + 6.0) / numtotal**2 - 6.0),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], distparms[2], str(expectedstats), str(foundstats)))
+    del numtotal, numgood, numdrawn, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no hypergeom.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Inverse-Gamma distribution
+    distname = "invgamma"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    alpha = 7.0  # must be > 4 for the kurtosis formula
+    beta = 3.0
+    distparms = [ alpha, beta ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( beta / (alpha - 1.0),
+                      beta**2 / ((alpha - 1.0)**2 * (alpha - 2.0)),
+                      4.0 * math.sqrt(alpha - 2.0) / (alpha - 3.0),
+                      (30.0 * alpha - 66.0)/ ((alpha - 3.0) * (alpha - 4.0)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del alpha, beta, foundstats, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.2, atol=0.4):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Laplace distribution
+    distname = "laplace"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    mu = 5.0
+    b = 3.0
+    distparms = [ mu, b ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( mu, 2.0 * b**2, 0.0, 3.0 )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del mu, b, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    fitparms = getfitparams(sample, distname, distparms)
+    if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+        print "%s: FAIL" % distname
+        raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                      (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms, sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Log-normal distribution
+    distname = "lognorm"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    mu = 0.8
+    sigma = 0.5
+    distparms = [ mu, sigma ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( math.exp(mu + 0.5 * sigma**2),
+                      math.exp(2.0 * mu + sigma**2) * (math.exp(sigma**2) - 1.0),
+                      (2.0 + math.exp(sigma**2)) * math.sqrt(math.exp(sigma**2) - 1.0),
+                      math.exp(4.0 * sigma**2) + 2.0 * math.exp(3.0 * sigma**2) + 3.0 * math.exp(2.0 * sigma**2) - 6,
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del mu, sigma, foundstats, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Negative-binomial distribution
+    distname = "nbinom"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    numsuccess = 5.0
+    prob = 0.25
+    distparms = [ numsuccess, prob ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( numsuccess * (1.0 - prob) / prob,
+                      numsuccess * (1.0 - prob) / prob**2,
+                      (2.0 - prob) / math.sqrt(numsuccess * (1.0 - prob)),
+                      (prob**2 - 6.0 * prob + 6.0) / (numsuccess * (1.0 - prob)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del numsuccess, prob, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no nbinom.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Normal distribution
+    distname = "norm"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    mu = 5.0
+    sigma = 3.0
+    distparms = numpy.array([ mu, sigma ], dtype=numpy.float64)
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( mu, sigma**2, 0.0, 0.0 )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del mu, sigma, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    fitparms = getfitparams(sample, distname, distparms)
+    if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+        print "%s: FAIL" % distname
+        raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                      (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms, sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Pareto distribution
+    distname = "pareto"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    xm = 3.0
+    alpha = 5.0  # must be larger than 4 for kurtosis formula
+    distparms = [ xm, alpha ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( alpha * xm / (alpha - 1.0),
+                      xm**2 * alpha / ((alpha - 1.0)**2 * (alpha - 2.0)),
+                      2.0 * ((alpha + 1.0) / (alpha - 3.0)) * math.sqrt((alpha - 2.0) / alpha),
+                      6.0 * (alpha**3 + alpha**2 - 6.0 * alpha - 2.0) / \
+                          (alpha * (alpha - 3.0) * (alpha - 4.0)),
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del xm, alpha, foundstats, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Poisson distribution
+    distname = "poisson"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    mu = 7.0
+    distparms = [ mu ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( mu, mu, 1.0 / math.sqrt(mu), 1.0 / mu )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del mu, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no poisson.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Random Integer (Discrete Uniform) distribution
+    distname = "randint"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    a = -5.0
+    b = 13.0
+    distparms = [ a, b ]
+    distf = getdistrib(distname, distparms)
+    # foundstats = distf.stats("mvsk")
+    foundstats = distf.stats("mvs")
+    n = b - a + 1.0
+    # expectedstats = ( 0.5 * (a + b), (n**2 - 1.0) / 12.0, 0.0, -6.0 * (n**2 + 1) / (5.0 * (n**2 - 1)) )
+    expectedstats = ( 0.5 * (a + b), (n**2 - 1.0) / 12.0, 0.0, )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        # raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+        raise ValueError("(mean, var, skew) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    xvals = numpy.arange(a - 1.0, b + 1.1, 1.0)
+    expectedpmfs = numpy.ones((n+2,), dtype=float) / n
+    expectedpmfs[0] = 0.0
+    expectedpmfs[n+1] = 0.0
+    foundpmfs = distf.pmf(xvals)
+    if not numpy.allclose(foundpmfs, expectedpmfs):
+        print "%s: FAIL" % distname
+        raise ValueError("pmfs(%.1f:%.1f:1.0) of %s(%.1f, %.1f): expected %s; found %s" % \
+              (a - 1.0, b + 1.1, distname, distparms[0], distparms[1], str(expectedpmfs), str(foundpmfs)))
+    del a, b, foundstats, n, expectedstats, xvals, expectedpmfs, foundpmfs
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # no randint.fit function
+    del distparms, distf, newparms
+
+    print "%s: PASS" % distname
+
+
+    # Student's-t distribution
+    distname = "t"
+    descript = getdistparams(distname, None)
+    if len(descript) != 1:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    degfree = 11.0
+    distparms = [ degfree ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( 0.0, degfree / (degfree - 2.0), 0.0, 6.0 / (degfree - 4.0) )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                          (distname, distparms[0], str(expectedstats), str(foundstats)))
+    del degfree, foundstats, expectedstats
+
+    # append the default loc and scale to the expected params
+    distparms.append(0.0)
+    distparms.append(1.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    fitparms = getfitparams(sample, distname, distparms)
+    if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+        print "%s: FAIL" % distname
+        raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                      (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms, sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Uniform distribution
+    distname = "uniform"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    a = -5.0
+    b = 13.0
+    distparms = [ a, b ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    expectedstats = ( 0.5 * (a + b), (b - a)**2 / 12.0, 0.0, -6.0 / 5.0 )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del a, b, foundstats, expectedstats
+
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    sample = distf.rvs(25000)
+    fitparms = getfitparams(sample, distname, distparms)
+    if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+        print "%s: FAIL" % distname
+        raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                      (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms, sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # Weibull distribution
+    distname = "weibull_min"
+    descript = getdistparams(distname, None)
+    if len(descript) != 2:
+        print "%s: FAIL" % distname
+        raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                         (distname, len(descript)))
+    del descript
+
+    k = 3.0
+    lambdaflt = 5.0
+    distparms = [ k, lambdaflt ]
+    distf = getdistrib(distname, distparms)
+    foundstats = distf.stats("mvsk")
+    gam1 = scipy.special.gamma(1.0 + 1.0 / k)
+    gam2 = scipy.special.gamma(1.0 + 2.0 / k)
+    gam3 = scipy.special.gamma(1.0 + 3.0 / k)
+    gam4 = scipy.special.gamma(1.0 + 4.0 / k)
+    mu = lambdaflt * gam1
+    sigma = lambdaflt * math.sqrt(gam2 - gam1**2)
+    expectedstats = ( mu,
+                      sigma**2,
+                      (lambdaflt**3 * gam3  - 3.0 * mu * sigma**2 - mu**3) / sigma**3,
+                      (gam4 - 4.0 * gam1 * gam3 - 3.0 * gam2**2 + 12.0 * gam1**2 * gam2 - 6.0 * gam1**4) / \
+                      (gam2 - gam1**2)**2,
+                    )
+    if not numpy.allclose(foundstats, expectedstats):
+        print "%s: FAIL" % distname
+        raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                          (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+    del k, lambdaflt, foundstats, gam1, gam2, gam3, gam4, mu, sigma, expectedstats
+
+    # append the default loc to the expected params
+    distparms.append(0.0)
+    newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+    if not numpy.allclose(newparms, distparms):
+        print "%s: FAIL" % distname
+        raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+    # sample = distf.rvs(25000)
+    # fitparms = getfitparams(sample, distname, distparms)
+    # print "%s fitparams: %s" % (distname, str(fitparms))
+    # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+    #     print "%s: FAIL" % distname
+    #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+    #                                   (distname, str(distparms), str(fitparms)))
+    del distparms, distf, newparms # , sample, fitparms
+
+    print "%s: PASS" % distname
+
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/create_stats_funcs.sh b/pyfermod/stats/create_stats_funcs.sh
new file mode 100755
index 0000000..960a9af
--- /dev/null
+++ b/pyfermod/stats/create_stats_funcs.sh
@@ -0,0 +1,66 @@
+#! /bin/env python2.6
+#
+
+import os.path
+import scipy.stats
+import pyferret.stats
+
+def create_script(scriptname, distribname, distriblongname, funcname, funcreturn):
+    """
+    Creates scriptname from 'stats_template' using remaining arguments
+    for replacement strings in the template file.
+    """
+    templatefile = file("stats_template", "r")
+    scriptfile = file(scriptname, "w")
+    for line in templatefile:
+        line = line.replace("<distribname>", distribname)
+        line = line.replace("<distriblongname>", distriblongname)
+        line = line.replace("<funcname>", funcname)
+        line = line.replace("<funcreturn>", funcreturn)
+        print >>scriptfile, line,
+    templatefile.close()
+    scriptfile.close()
+
+def create_all_scripts():
+    """
+    Creates the valid stats_<distribname>_<funcname>.py scripts, if they do
+    not already exist, for all the supported distributions and functions.
+    """
+    # List of supported distributions
+    distnamelist = pyferret.stats.getdistname(None)
+    # List of supported functions
+    funcnamelist  = [ ( "cdf", "cumulative density function values", ),
+                      ( "isf", "inverse survival function values", ),
+                      ( "pdf", "probability distribution function values", ),
+                      ( "pmf", "probability mass function values", ),
+                      ( "ppf", "percent point function values", ),
+                      ( "sf",  "survival function values", ),
+                      ( "rvs", "random variates", ), ]
+    # Loop of the list of distributions and functions, creating the script
+    # if it does not exist and if the function exists for that distribution.
+    for nametuple in distnamelist:
+        distname = nametuple[0]
+        distlongname = nametuple[1]
+        for (funcname, funcreturn) in funcnamelist:
+            try:
+                # Verify the function exists for the distribution.
+                # This raises an AttributeError is it does not.
+                statsfunc = eval("scipy.stats.%s.%s" % (distname,funcname))
+                if distname == "weibull_min":
+                    scriptname = "stats_weibull_%s.py" % funcname
+                else:
+                    scriptname = "stats_%s_%s.py" % (distname, funcname)
+                # Verify the script does not already exist.
+                if not os.path.exists(scriptname):
+                    create_script(scriptname, distname, distlongname,
+                                              funcname, funcreturn)
+            except AttributeError:
+                # function does not exist for the distribution - skip
+                pass
+
+if __name__ == "__main__":
+    # create all scripts from the 'stats_template' file
+    if not os.path.exists("stats_template"):
+        raise ValueError("The file 'stats_template' does not exist")
+    create_all_scripts()
+
diff --git a/pyfermod/stats/stats_beta_cdf.py b/pyfermod/stats/stats_beta_cdf.py
new file mode 100644
index 0000000..ca56eec
--- /dev/null
+++ b/pyfermod/stats/stats_beta_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_beta_isf.py b/pyfermod/stats/stats_beta_isf.py
new file mode 100644
index 0000000..b7cbdf0
--- /dev/null
+++ b/pyfermod/stats/stats_beta_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_beta_pdf.py b/pyfermod/stats/stats_beta_pdf.py
new file mode 100644
index 0000000..b46070b
--- /dev/null
+++ b/pyfermod/stats/stats_beta_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_beta_ppf.py b/pyfermod/stats/stats_beta_ppf.py
new file mode 100644
index 0000000..74bbcbf
--- /dev/null
+++ b/pyfermod/stats/stats_beta_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_beta_rvs.py b/pyfermod/stats/stats_beta_rvs.py
new file mode 100644
index 0000000..c160164
--- /dev/null
+++ b/pyfermod/stats/stats_beta_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_beta_sf.py b/pyfermod/stats/stats_beta_sf.py
new file mode 100644
index 0000000..2255c25
--- /dev/null
+++ b/pyfermod/stats/stats_beta_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Beta probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Beta"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_beta_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_beta_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_cdf.py b/pyfermod/stats/stats_binom_cdf.py
new file mode 100644
index 0000000..7cfd9ba
--- /dev/null
+++ b/pyfermod/stats/stats_binom_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_isf.py b/pyfermod/stats/stats_binom_isf.py
new file mode 100644
index 0000000..2be303d
--- /dev/null
+++ b/pyfermod/stats/stats_binom_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_pmf.py b/pyfermod/stats/stats_binom_pmf.py
new file mode 100644
index 0000000..8a6d10a
--- /dev/null
+++ b/pyfermod/stats/stats_binom_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_ppf.py b/pyfermod/stats/stats_binom_ppf.py
new file mode 100644
index 0000000..710f26c
--- /dev/null
+++ b/pyfermod/stats/stats_binom_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_rvs.py b/pyfermod/stats/stats_binom_rvs.py
new file mode 100644
index 0000000..a045c86
--- /dev/null
+++ b/pyfermod/stats/stats_binom_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_binom_sf.py b/pyfermod/stats/stats_binom_sf.py
new file mode 100644
index 0000000..94ac0f2
--- /dev/null
+++ b/pyfermod/stats/stats_binom_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Binomial"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_binom_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_binom_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_cdf.py b/pyfermod/stats/stats_cauchy_cdf.py
new file mode 100644
index 0000000..a83952f
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_isf.py b/pyfermod/stats/stats_cauchy_isf.py
new file mode 100644
index 0000000..bd915d3
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_pdf.py b/pyfermod/stats/stats_cauchy_pdf.py
new file mode 100644
index 0000000..c2cbb2b
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_ppf.py b/pyfermod/stats/stats_cauchy_ppf.py
new file mode 100644
index 0000000..3efab83
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_rvs.py b/pyfermod/stats/stats_cauchy_rvs.py
new file mode 100644
index 0000000..45f4cbc
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cauchy_sf.py b/pyfermod/stats/stats_cauchy_sf.py
new file mode 100644
index 0000000..14192d6
--- /dev/null
+++ b/pyfermod/stats/stats_cauchy_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Cauchy probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Cauchy"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cauchy_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_cauchy_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_cdf.py b/pyfermod/stats/stats_cdf.py
new file mode 100644
index 0000000..ae4d60c
--- /dev/null
+++ b/pyfermod/stats/stats_cdf.py
@@ -0,0 +1,87 @@
+"""
+Returns the array of cumulative distribution function values
+for a probability distribution and set of abscissa values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_cdf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns cumulative distribution function values for a probability distribution",
+                "axes": axes_values,
+                "argnames": ("PTS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Points at which to calculate the cumulative distribution function values",
+                                 "Name of a probability distribution",
+                                 "Parameters for this probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+		"influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the cumulative distribution function values for
+    the probability distribution indicated by inputs[1] (a string) using
+    the parameters given in inputs[2] at the abscissa values given by
+    inputs[0].  For undefined abscissa values, the result value will be
+    undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.cdf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution along the Y axis
+    dimen = 25
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    xvals = numpy.linspace(mu - 2.5 * sigma, mu + 2.5 * sigma, dimen)
+    cdfvals = distf.cdf(xvals)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    abscissa = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 3:
+            abscissa[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            abscissa[0, j, 0, 0, 0, 0] = xvals[j]
+            expected[0, j, 0, 0, 0, 0] = cdfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_chi2_cdf.py b/pyfermod/stats/stats_chi2_cdf.py
new file mode 100644
index 0000000..d6e4d65
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi2_isf.py b/pyfermod/stats/stats_chi2_isf.py
new file mode 100644
index 0000000..3380805
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi2_pdf.py b/pyfermod/stats/stats_chi2_pdf.py
new file mode 100644
index 0000000..d0a9e2e
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi2_ppf.py b/pyfermod/stats/stats_chi2_ppf.py
new file mode 100644
index 0000000..d586f87
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi2_rvs.py b/pyfermod/stats/stats_chi2_rvs.py
new file mode 100644
index 0000000..3d3dcf2
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi2_sf.py b/pyfermod/stats/stats_chi2_sf.py
new file mode 100644
index 0000000..71e7721
--- /dev/null
+++ b/pyfermod/stats/stats_chi2_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Chi-Square probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi-Square"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi2_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi2_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_cdf.py b/pyfermod/stats/stats_chi_cdf.py
new file mode 100644
index 0000000..8271c82
--- /dev/null
+++ b/pyfermod/stats/stats_chi_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_isf.py b/pyfermod/stats/stats_chi_isf.py
new file mode 100644
index 0000000..ee7e574
--- /dev/null
+++ b/pyfermod/stats/stats_chi_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_pdf.py b/pyfermod/stats/stats_chi_pdf.py
new file mode 100644
index 0000000..12dc89d
--- /dev/null
+++ b/pyfermod/stats/stats_chi_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_ppf.py b/pyfermod/stats/stats_chi_ppf.py
new file mode 100644
index 0000000..215fc97
--- /dev/null
+++ b/pyfermod/stats/stats_chi_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_rvs.py b/pyfermod/stats/stats_chi_rvs.py
new file mode 100644
index 0000000..f45f163
--- /dev/null
+++ b/pyfermod/stats/stats_chi_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chi_sf.py b/pyfermod/stats/stats_chi_sf.py
new file mode 100644
index 0000000..9364d0c
--- /dev/null
+++ b/pyfermod/stats/stats_chi_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Chi probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Chi"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chi_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_chi_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_chisquare.py b/pyfermod/stats/stats_chisquare.py
new file mode 100644
index 0000000..11737d5
--- /dev/null
+++ b/pyfermod/stats/stats_chisquare.py
@@ -0,0 +1,154 @@
+"""
+Performs a chi-square test that a sample with the observed
+counts of categorical data comes from a population with the
+given expected counts or relative frequencies of that data.
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_chisquare Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns chi-square test stat. and prob. (and num. good categories, N) " \
+                            "that sample counts of cat. data matches pop. expected counts. ",
+                "axes": axes_values,
+                "argnames": ( "SAMPLE_CNTS", "EXPECT_CNTS", "DELTA_DEGFREE", ),
+                "argdescripts": ( "Sample counts of categorical data",
+                                  "Expected counts or relative frequencies (will be adjusted)",
+                                  "Difference from standard (N-1) degrees of freedom (num. computed parameters)", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, pyferret.FLOAT_ONEVAL, ),
+                "influences": ( false_influences, false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_chisquare Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 3, 1, "X2,P,N", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a chi-square test that a sample with the observed counts
+    of categorical data, given in inputs[0], comes from a population
+    with the expected counts or relative frequencies given in inputs[1].
+    The difference from the standard (n-1) degrees of freedom (eg, the
+    number of population parameters estimated from the sample) are given
+    in inputs[2].  The test statistic value and probability are returned
+    in result.  The counts arrays must either have the same shape or both
+    have a single defined non-sigular axis of the same size.  Categories
+    that contain undefined counts are elimated before performing the
+    test.  Population values that are used in the test are adjust so
+    their sum equals the sum of the sample counts used in the test.
+    """
+    if inputs[0].shape != inputs[1].shape :
+        shp0 = inputs[0].squeeze().shape
+        shp1 = inputs[1].squeeze().shape
+        if (len(shp0) > 1) or (len(shp1) > 1) or (shp0 != shp1):
+            raise ValueError("SAMPLE_CNTS and EXPECT_CNTS must either have identical dimensions " \
+                             "or both have only one defined non-singular axis of the same length")
+    samcnts = inputs[0].reshape(-1)
+    popcnts = inputs[1].reshape(-1)
+    badsam = ( numpy.fabs(samcnts - inpbdfs[0]) < 1.0E-5 )
+    badsam = numpy.logical_or(badsam, numpy.isnan(samcnts))
+    goodsam = numpy.logical_not(badsam)
+    badpop = ( numpy.fabs(popcnts - inpbdfs[1]) < 1.0E-5 )
+    badpop = numpy.logical_or(badpop, numpy.isnan(popcnts))
+    goodpop = numpy.logical_not(badpop)
+    goodmask = numpy.logical_and(goodsam, goodpop)
+    samcnts = numpy.array(samcnts[goodmask], dtype=numpy.float64)
+    numgood = len(samcnts)
+    if numgood < 2:
+        raise ValueError("Not enough defined counts in common in SAMPLE_CNTS and EXPECT_CNTS")
+    popcnts = numpy.array(popcnts[goodmask], dtype=numpy.float64)
+    # Adjust the expected counts so its sum matches the sum of the sample
+    # counts;  thus expected counts can be proportions instead of counts
+    # and removes issues about missing values.  Get the adjustment factor
+    # from the means instead of the sums for accuracy.
+    popcnts = popcnts * (samcnts.mean() / popcnts.mean())
+    ddof = int(float(inputs[2]) + 0.5)
+    fitparams = scipy.stats.chisquare(samcnts, popcnts, ddof)
+    result[:] = resbdf
+    # chi-square test statistic
+    result[0] = fitparams[0]
+    # probability
+    result[1] = fitparams[1]
+    # number of good categories
+    result[2] = numgood
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get a sample histogram and expected frequencies
+    ddof  = 3
+    nbins = 90
+    ssize = 100 * nbins
+    distf = scipy.stats.weibull_min(2.0, 5.0)
+    chival = 1000.0
+    while chival > 100.0:
+        sample = distf.rvs(ssize)
+        bedges = distf.isf(numpy.linspace(0.95,0.05,nbins+1))
+        (histgr, retedges) = numpy.histogram(sample, bins=bedges)
+        histgr = numpy.array(histgr, dtype=numpy.float64)
+        exphist = numpy.ones((nbins,), dtype=numpy.float64) * histgr.mean()
+        chival = ((histgr - exphist)**2 / exphist).sum()
+        print "created a sample with chival = %f" % chival
+    prob = scipy.stats.chi2(nbins - 1 - ddof).sf(chival)
+    expect = numpy.array([chival, prob, nbins], dtype=numpy.float64)
+    print "sample histogram = \n%s" % str(histgr)
+    print "expect histogram value for all bins = %f" % exphist[0]
+    print "expect result = %s" % str(expect)
+
+    # setup for the call to ferret_compute - one non-singular axis
+    inpbdfs = numpy.array([-9999.0, -8888.0, -7777.0], dtype=numpy.float64)
+    resbdf = numpy.array([-6666.0], dtype=numpy.float64)
+    samhist = inpbdfs[0] * numpy.ones((1, 1, 2 * nbins, 1, 1, 1), dtype=numpy.float64, order='F')
+    samhist[0, 0, ::2, 0, 0, 0] = histgr
+    pophist = numpy.ones((1, 2 * nbins, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ddofarr = numpy.array([ddof], dtype=numpy.float64)
+    result = -5555.0 * numpy.ones((3, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the result
+    ferret_compute(0, result, resbdf, (samhist, pophist, ddofarr), inpbdfs)
+    result = result.reshape(-1)
+    print " found result = %s" % str(result)
+    if not numpy.allclose(result, expect):
+        raise ValueError("Unexpected result")
+
+    # setup for the call to ferret_compute - multiple dimensions
+    inpbdfs = numpy.array([-9999.0, -8888.0, -7777.0], dtype=numpy.float64)
+    resbdf = numpy.array([-6666.0], dtype=numpy.float64)
+    samhist = inpbdfs[0] * numpy.ones((1, 2, nbins, 1, 1, 1), dtype=numpy.float64, order='F')
+    samhist[0, 0, ::2, 0, 0, 0] = histgr[0:nbins//2]
+    samhist[0, 1, 1::2, 0, 0, 0] = histgr[nbins//2:]
+    pophist = numpy.ones((1, 2, nbins, 1, 1, 1), dtype=numpy.float64, order='F')
+    ddofarr = numpy.array([ddof], dtype=numpy.float64)
+    result = -5555.0 * numpy.ones((3, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the result
+    ferret_compute(0, result, resbdf, (samhist, pophist, ddofarr), inpbdfs)
+    result = result.reshape(-1)
+    print " found result = %s" % str(result)
+    if not numpy.allclose(result, expect):
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_expon_cdf.py b/pyfermod/stats/stats_expon_cdf.py
new file mode 100644
index 0000000..308c06c
--- /dev/null
+++ b/pyfermod/stats/stats_expon_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_expon_isf.py b/pyfermod/stats/stats_expon_isf.py
new file mode 100644
index 0000000..784d363
--- /dev/null
+++ b/pyfermod/stats/stats_expon_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_expon_pdf.py b/pyfermod/stats/stats_expon_pdf.py
new file mode 100644
index 0000000..d2ff90c
--- /dev/null
+++ b/pyfermod/stats/stats_expon_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_expon_ppf.py b/pyfermod/stats/stats_expon_ppf.py
new file mode 100644
index 0000000..b88f82a
--- /dev/null
+++ b/pyfermod/stats/stats_expon_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_expon_rvs.py b/pyfermod/stats/stats_expon_rvs.py
new file mode 100644
index 0000000..4a04015
--- /dev/null
+++ b/pyfermod/stats/stats_expon_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_expon_sf.py b/pyfermod/stats/stats_expon_sf.py
new file mode 100644
index 0000000..d959651
--- /dev/null
+++ b/pyfermod/stats/stats_expon_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Exponential probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponential"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_expon_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_expon_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_cdf.py b/pyfermod/stats/stats_exponweib_cdf.py
new file mode 100644
index 0000000..74236a0
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_isf.py b/pyfermod/stats/stats_exponweib_isf.py
new file mode 100644
index 0000000..17bd932
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_pdf.py b/pyfermod/stats/stats_exponweib_pdf.py
new file mode 100644
index 0000000..001ea69
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_ppf.py b/pyfermod/stats/stats_exponweib_ppf.py
new file mode 100644
index 0000000..7a9f0e7
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_rvs.py b/pyfermod/stats/stats_exponweib_rvs.py
new file mode 100644
index 0000000..48d6525
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_exponweib_sf.py b/pyfermod/stats/stats_exponweib_sf.py
new file mode 100644
index 0000000..86282c7
--- /dev/null
+++ b/pyfermod/stats/stats_exponweib_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Exponentiated-Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Exponentiated-Weibull"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_exponweib_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_exponweib_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_cdf.py b/pyfermod/stats/stats_f_cdf.py
new file mode 100644
index 0000000..53ab69c
--- /dev/null
+++ b/pyfermod/stats/stats_f_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_isf.py b/pyfermod/stats/stats_f_isf.py
new file mode 100644
index 0000000..8f404f7
--- /dev/null
+++ b/pyfermod/stats/stats_f_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_pdf.py b/pyfermod/stats/stats_f_pdf.py
new file mode 100644
index 0000000..edd192c
--- /dev/null
+++ b/pyfermod/stats/stats_f_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_ppf.py b/pyfermod/stats/stats_f_ppf.py
new file mode 100644
index 0000000..090e5d9
--- /dev/null
+++ b/pyfermod/stats/stats_f_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_rvs.py b/pyfermod/stats/stats_f_rvs.py
new file mode 100644
index 0000000..c29836d
--- /dev/null
+++ b/pyfermod/stats/stats_f_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_f_sf.py b/pyfermod/stats/stats_f_sf.py
new file mode 100644
index 0000000..d91d04c
--- /dev/null
+++ b/pyfermod/stats/stats_f_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the F probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "F"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_f_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_f_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_fit.py b/pyfermod/stats/stats_fit.py
new file mode 100644
index 0000000..a55fb6a
--- /dev/null
+++ b/pyfermod/stats/stats_fit.py
@@ -0,0 +1,105 @@
+"""
+Returns parameter values for a specified probability distribution type
+that best describe the distribution of a given array of values.
+"""
+import math
+import numpy
+import pyferret
+import pyferret.stats
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_fit python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns parameters for a probability distribution that best fit all defined data values",
+                "axes": axes_values,
+                "argnames": ( "VALS", "PDNAME", "PDPARAMS", ),
+                "argdescripts": ( "Values to fit with the probability distribution",
+                                  "Name of the probability distribution type to use",
+                                  "Initial parameter estimates for this probability distribution", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define the limits and (unit)name of the custom axis of the array
+    containing the returned parameters.  A "location" and a "scale"
+    parameter, if not considered one of the "standard" parameters, is
+    appended to the "standard" parameters.
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 5, 1, "PDPARAMS", False, )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with parameters for the probability distribution type
+    indicated by inputs[1] (a string) that best fit the distribution of
+    values given in inputs[0].  Parameter estimates given in inputs[2]
+    will be used to initialize the fitting method.  Undefined values will
+    be eliminated before the fit is attempted.
+    """
+    distribname = inputs[1]
+    estparams = inputs[2].reshape(-1)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = inputs[0][goodmask]
+    # values is a flattened array
+    fitparams = pyferret.stats.getfitparams(values, distribname, estparams)
+    result[:] = resbdf
+    if fitparams != None:
+        for k in xrange(len(fitparams)):
+            result[k] = fitparams[k]
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution in the YZ plane
+    ydimen = 100
+    zdimen = 125
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    sample = distf.rvs(ydimen * zdimen)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-9999.0, -8888.0, -7777.0], dtype=numpy.float64)
+    resbdf = numpy.array([-6666.0], dtype=numpy.float64)
+    values = numpy.empty((1, ydimen, zdimen, 1, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    for j in xrange(ydimen):
+        for k in xrange(zdimen):
+            if (index % 103) == 13:
+                values[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                values[0, j, k, 0, 0, 0] = sample[index]
+            index += 1
+    result = -5555.0 * numpy.ones((5,), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (values, pfname, pfparams), inpbdfs)
+    if (abs(result[0] - mu) > 0.2) or \
+       (abs(result[1] - sigma) > 0.2) or \
+       (abs(result[2] - resbdf[0]) > 1.0E-5) or \
+       (abs(result[3] - resbdf[0]) > 1.0E-5) or \
+       (abs(result[4] - resbdf[0]) > 1.0E-5):
+        expected = ( mu, sigma, resbdf[0], resbdf[0], resbdf[0], )
+        raise ValueError("Norm fit fail; expected params: %s; found %s" % (str(expected), str(result)))
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_gamma_cdf.py b/pyfermod/stats/stats_gamma_cdf.py
new file mode 100644
index 0000000..4955bd0
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_gamma_isf.py b/pyfermod/stats/stats_gamma_isf.py
new file mode 100644
index 0000000..b724f5e
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_gamma_pdf.py b/pyfermod/stats/stats_gamma_pdf.py
new file mode 100644
index 0000000..ff03966
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_gamma_ppf.py b/pyfermod/stats/stats_gamma_ppf.py
new file mode 100644
index 0000000..6c1a9e6
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_gamma_rvs.py b/pyfermod/stats/stats_gamma_rvs.py
new file mode 100644
index 0000000..dbd2383
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_gamma_sf.py b/pyfermod/stats/stats_gamma_sf.py
new file mode 100644
index 0000000..eae64aa
--- /dev/null
+++ b/pyfermod/stats/stats_gamma_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Gamma"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_gamma_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_gamma_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_cdf.py b/pyfermod/stats/stats_geom_cdf.py
new file mode 100644
index 0000000..6c77af5
--- /dev/null
+++ b/pyfermod/stats/stats_geom_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_isf.py b/pyfermod/stats/stats_geom_isf.py
new file mode 100644
index 0000000..f51b7fe
--- /dev/null
+++ b/pyfermod/stats/stats_geom_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_pmf.py b/pyfermod/stats/stats_geom_pmf.py
new file mode 100644
index 0000000..e1e9d94
--- /dev/null
+++ b/pyfermod/stats/stats_geom_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_ppf.py b/pyfermod/stats/stats_geom_ppf.py
new file mode 100644
index 0000000..9c4be55
--- /dev/null
+++ b/pyfermod/stats/stats_geom_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_rvs.py b/pyfermod/stats/stats_geom_rvs.py
new file mode 100644
index 0000000..1f2377f
--- /dev/null
+++ b/pyfermod/stats/stats_geom_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_geom_sf.py b/pyfermod/stats/stats_geom_sf.py
new file mode 100644
index 0000000..22d61a1
--- /dev/null
+++ b/pyfermod/stats/stats_geom_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Geometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Geometric"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_geom_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_geom_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_helper.py b/pyfermod/stats/stats_helper.py
new file mode 100644
index 0000000..c902c23
--- /dev/null
+++ b/pyfermod/stats/stats_helper.py
@@ -0,0 +1,143 @@
+"""
+Returns an array of strings describing
+the parameters for a probability distribution.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_helper Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_ABSTRACT
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 1,
+                "descript": "Help on probability distribution names or parameters",
+                "restype": pyferret.STRING_ARRAY,
+                "resstrlen": 256,
+                "axes": axes_values,
+                "argnames": ( "PDNAME", ),
+                "argdescripts": ( "Name of a probability distribution (or blank for all)", ),
+                "argtypes": ( pyferret.STRING_ONEVAL, ),
+                "influences": ( false_influences, ),
+              }
+    return retdict
+
+
+def ferret_result_limits(id):
+    """
+    Return the limits of the abstract X axis
+    """
+    # Get the maximum number of string pairs that will be return -
+    # either distribution short names and long names with parameter names
+    # or parameter names and descriptions; the number of distributions far
+    # exceeds the number of parameters for any distribution
+    distnamelist = pyferret.stats.getdistname(None)
+    # One intro string and at least one empty line at the end
+    max_num_string_pairs = len(distnamelist) + 2
+
+    axis_lims = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_lims[0] = ( 1, max_num_string_pairs )
+    return axis_lims
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with parameter desciption strings for the
+    probability distribution indicated by inputs[0] (a string).
+    """
+    max_num_string_pairs = ferret_result_limits(id)[0][1]
+    distribname = inputs[0].strip()
+    if distribname:
+        # list the parameters with descriptions for this distribution
+        distname = pyferret.stats.getdistname(distribname)
+        paramlist = pyferret.stats.getdistparams(distname, None)
+        result[0] = "Parameters of probability distribution %s" % distribname
+        for k in xrange(len(paramlist)):
+            result[k+1] = "(%d) %s: %s" % (k+1, paramlist[k][0], paramlist[k][1])
+        for k in xrange(len(paramlist)+1, max_num_string_pairs):
+            result[k] = ""
+    else:
+        # list the all the distributions with parameter list arguments
+        distnamelist = pyferret.stats.getdistname(None)
+        result[0] = "Supported probability distributions"
+        for k in xrange(len(distnamelist)):
+            # create the parameter argument string
+            paramlist = pyferret.stats.getdistparams(distnamelist[k][0], None)
+            numparams = len(paramlist)
+            if numparams == 1:
+                paramstr = "(%s)" % paramlist[0][0]
+            elif numparams == 2:
+                paramstr = "(%s,%s)" % (paramlist[0][0], paramlist[1][0])
+            elif numparams == 3:
+                paramstr = "(%s,%s,%s)" % (paramlist[0][0], paramlist[1][0],
+                                           paramlist[2][0])
+            elif numparams == 4:
+                paramstr = "(%s,%s,%s)" % (paramlist[0][0], paramlist[1][0],
+                                           paramlist[2][0], paramlist[3][0])
+            else:
+                raise ValueError("Unexpected number of parameters: %s" % numparams)
+            # create the help string
+            numnames = len(distnamelist[k])
+            if numnames == 2:
+                result[k+1] = "   %s: %s%s" % \
+                    (distnamelist[k][0], distnamelist[k][1], paramstr)
+            elif numnames == 3:
+                result[k+1] = "   %s: %s or %s%s" % \
+                    (distnamelist[k][0], distnamelist[k][1],
+                     distnamelist[k][2], paramstr)
+            elif numnames == 4:
+                result[k+1] = "   %s: %s, %s, or %s%s" % \
+                    (distnamelist[k][0], distnamelist[k][1],
+                     distnamelist[k][2], distnamelist[k][3], paramstr)
+            else:
+                raise ValueError("Unexpected number of names: %s" % numnames)
+        for k in xrange(len(distnamelist)+1, max_num_string_pairs):
+            result[k] = ""
+
+
+def print_help():
+    """
+    Print the stats_helper messages to console (using print in Python).
+    This is also designed to test the other functions of this module.
+    """
+    info = ferret_init(0)
+    stype = "S%d" % info["resstrlen"]
+    sizetuple = ferret_result_limits(0)
+    max_strings = sizetuple[0][1]
+    distrib_array = numpy.empty((max_strings,), \
+                                dtype=numpy.dtype(stype), order='F')
+    # Some initialization for testing
+    for k in xrange(max_strings):
+        distrib_array[k] = "Unassigned %d" % k
+    # Get the list of distributions (string of spaces for testing)
+    pfname = "    "
+    ferret_compute(0, distrib_array, None, ( pfname, ), None)
+    # Print all the distribution short and long names, and the empty line at the end
+    for j in xrange(max_strings):
+        print distrib_array[j]
+    # Now go through all the distributions
+    params_array = numpy.empty((max_strings,), \
+                               dtype=numpy.dtype('S128'), order='F')
+    # Skip intro line, and empty line at end
+    for j in xrange(1, max_strings-1):
+        # Some initialization for testing
+        for k in xrange(max_strings):
+            params_array[k] = "Unassigned %d" % k
+        # Use the distribution long name (second word, remove the param list)
+        pfname = distrib_array[j].split()[1].split('(')[0]
+        ferret_compute(0, params_array, None, ( pfname, ), None)
+        for k in xrange(max_strings):
+            print params_array[k]
+            # Stop after printing an empty line
+            if not params_array[k]:
+                break;
+
+
+# For testing this module at the command line
+if __name__ == "__main__":
+    print_help()
+
diff --git a/pyfermod/stats/stats_histogram.py b/pyfermod/stats/stats_histogram.py
new file mode 100644
index 0000000..703781f
--- /dev/null
+++ b/pyfermod/stats/stats_histogram.py
@@ -0,0 +1,115 @@
+"""
+Returns histogram bin counts for a given array of values.
+"""
+import numpy
+import pyferret
+
+# The following is just to circumvent to call to pyferret.get_axis_info for testing
+DOING_UNIT_TEST = False
+
+def ferret_init(id):
+    """
+    Initialization for the stats_histogram Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns unweighted histogram bin counts for all defined data values",
+                "axes": axes_values,
+                "argnames": ("VALS", "BINS_TEMPLATE"),
+                "argdescripts": ("Values to put into bins and then count",
+                                 "Template argument whose one defined axis gives midpoints of bins"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with histogram bin counts of data in inputs[0].  Bin
+    limits are defined using the values of the one defined non-singular
+    axis associated with inputs[1].  The argument inputs[1] is otherwise
+    unused.  Undefined values in inputs[0] are eliminated before binning.
+    """
+    # get the box limits of the one defined non-singular axis of the second argument
+    if DOING_UNIT_TEST:
+        limits_func = my_get_box_limits
+    else:
+        limits_func = pyferret.get_axis_box_limits
+    limits_tuple = None
+    axis_used = None
+    for axis_num in (pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS, 
+                     pyferret.T_AXIS, pyferret.E_AXIS, pyferret.F_AXIS):
+        this_tuple = limits_func(id, pyferret.ARG2, axis_num)
+        if (this_tuple != None) and (len(this_tuple[0]) > 1):
+            if limits_tuple != None:
+               raise ValueError("BINS_TEMPLATE has more than one defined non-singular axis")
+            limits_tuple = this_tuple
+            axis_used = axis_num
+    if limits_tuple == None:
+        raise ValueError("BINS_TEMPLATE does not have a defined non-singular axis")
+    # get the histogram bin limits from the axis box limits
+    if not numpy.allclose(limits_tuple[0][1:], limits_tuple[1][:-1]):
+        raise ValueError("Unexpected error: gaps exist between axis box limits")
+    bin_edges = numpy.empty( ( len(limits_tuple[1]) + 1, ), dtype=numpy.float64)
+    bin_edges[0] = limits_tuple[0][0]
+    bin_edges[1:] = limits_tuple[1]
+    # get the clean data as a flattened array
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = inputs[0][goodmask]
+    # compute the histogram and assign the counts to result
+    (hist, edges) = numpy.histogram(values, bins=bin_edges)
+    if axis_used == pyferret.X_AXIS:
+        result[:,0,0,0,0,0] = hist
+    elif axis_used == pyferret.Y_AXIS:
+        result[0,:,0,0,0,0] = hist
+    elif axis_used == pyferret.Z_AXIS:
+        result[0,0,:,0,0,0] = hist
+    elif axis_used == pyferret.T_AXIS:
+        result[0,0,0,:,0,0] = hist
+    elif axis_used == pyferret.E_AXIS:
+        result[0,0,0,0,:,0] = hist
+    elif axis_used == pyferret.F_AXIS:
+        result[0,0,0,0,0,:] = hist
+    else:
+        raise ValueError("Unexpected axis_used value: %d" % axis_used)
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    DOING_UNIT_TEST = True
+    # create the my_get_box_limits function for testing
+    def my_get_box_limits(id, argnum, axisnum):
+        if id != 0:
+            raise ValueError("Unexpected my_get_box_limits argnum; expected: 0, found: %d" % \
+                              argnum)
+        if argnum != pyferret.ARG2:
+            raise ValueError("Unexpected my_get_box_limits argnum; expected: %d, found: %d" % \
+                              (pyferret.ARG2, argnum))
+        if axisnum != pyferret.Z_AXIS:
+            return None
+        limits = numpy.array([1.0, 2.0, 3.0, 4.0, 6.0, 9.0], dtype=numpy.float64)
+        return (limits[:-1], limits[1:])
+    # create the input values array with values on the edges and outside
+    values = numpy.arange(0.0, 10.2, 0.1, dtype=numpy.float64).reshape((1,6,1,17,1,1), order='F')
+    # create the expected results array
+    expected = -1.0 * numpy.ones((1,1,5,1,1,1), dtype=numpy.float64, order='F')
+    expected[0,0,:,0,0,0] = (10.0, 10.0, 10.0, 20.0, 31.0)
+    # make sure no errors when ferret_init called
+    info = ferret_init(0)
+    # make the call to ferret_compute
+    result = 999.0 * expected
+    resbdf = numpy.array([-1.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, -1.0], dtype=numpy.float64)
+    ferret_compute(0, result, resbdf, (values, None), inpbdfs)
+    # verify the results
+    if not numpy.allclose(result, expected):
+        raise ValueError("Unexpected results; expected:\n%s\nfound:\n%s" % (str(expected), str(result)))
+    print "Success"
+
diff --git a/pyfermod/stats/stats_hypergeom_cdf.py b/pyfermod/stats/stats_hypergeom_cdf.py
new file mode 100644
index 0000000..471e803
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_hypergeom_isf.py b/pyfermod/stats/stats_hypergeom_isf.py
new file mode 100644
index 0000000..72bf7a1
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_hypergeom_pmf.py b/pyfermod/stats/stats_hypergeom_pmf.py
new file mode 100644
index 0000000..3f10e64
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_hypergeom_ppf.py b/pyfermod/stats/stats_hypergeom_ppf.py
new file mode 100644
index 0000000..af08fc2
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_hypergeom_rvs.py b/pyfermod/stats/stats_hypergeom_rvs.py
new file mode 100644
index 0000000..d59c37c
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_hypergeom_sf.py b/pyfermod/stats/stats_hypergeom_sf.py
new file mode 100644
index 0000000..91bd0fc
--- /dev/null
+++ b/pyfermod/stats/stats_hypergeom_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Hypergeometric probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Hypergeometric"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_hypergeom_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_hypergeom_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_cdf.py b/pyfermod/stats/stats_invgamma_cdf.py
new file mode 100644
index 0000000..97d48ed
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_isf.py b/pyfermod/stats/stats_invgamma_isf.py
new file mode 100644
index 0000000..3e4fcd7
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_pdf.py b/pyfermod/stats/stats_invgamma_pdf.py
new file mode 100644
index 0000000..de93351
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_ppf.py b/pyfermod/stats/stats_invgamma_ppf.py
new file mode 100644
index 0000000..7cfa0ef
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_rvs.py b/pyfermod/stats/stats_invgamma_rvs.py
new file mode 100644
index 0000000..17c6837
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_invgamma_sf.py b/pyfermod/stats/stats_invgamma_sf.py
new file mode 100644
index 0000000..ddb3994
--- /dev/null
+++ b/pyfermod/stats/stats_invgamma_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Inverse-Gamma probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Inverse-Gamma"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_invgamma_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_invgamma_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_isf.py b/pyfermod/stats/stats_isf.py
new file mode 100644
index 0000000..9845828
--- /dev/null
+++ b/pyfermod/stats/stats_isf.py
@@ -0,0 +1,86 @@
+"""
+Returns the array of inverse survival function values for
+a probability distribution and set of quantile values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_isf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns inverse survival function values for a probability distribution",
+                "axes": axes_values,
+                "argnames": ("PROBS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Probabilities (0-1) at which to calculate the inverse survival function values",
+                                 "Name of a probability distribution",
+                                 "Parameters for this probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the inverse survival function values for the probability
+    distribution indicated by inputs[1] (a string) using the parameters given in
+    inputs[2] at the quantile values given by inputs[0].  For undefined quantile
+    values, the result value will be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.isf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution along the Y axis
+    dimen = 25
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    qvals = numpy.linspace(0.05, 0.95, dimen)
+    isfvals = distf.isf(qvals)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    quantile = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 3:
+            quantile[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            quantile[0, j, 0, 0, 0, 0] = qvals[j]
+            expected[0, j, 0, 0, 0, 0] = isfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (quantile, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_kstest1.py b/pyfermod/stats/stats_kstest1.py
new file mode 100644
index 0000000..c4022de
--- /dev/null
+++ b/pyfermod/stats/stats_kstest1.py
@@ -0,0 +1,135 @@
+"""
+Performs a two-sided Kolmogorov-Smirnov test that the provided
+sample comes from the given probability distribution function.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_kstest1 PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns two-sided Kolmogorov-Smirnov test stat. and prob. " \
+                            "that sample comes from a pop. with given prob. distrib.",
+                "axes": axes_values,
+                "argnames": ( "SAMPLE", "PDNAME", "PDPARAMS", ),
+                "argdescripts": ( "Sample data array",
+                                  "Name of a continuous probability distribution",
+                                  "Parameters for this continuous probability distribution"),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_kstest1 Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "KS,P", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a two-sided Kolmogorov-Smirnov test that the provided sample
+    comes from a population with the given probability distribution function.
+    The sample is given in inputs[0], the probability distribution function
+    name is given in inputs[1] (a string), and the "standard" parameters for
+    this probability distribution function are given in inputs[2].  The test
+    statistic value and two-tailed probability are returned in result.
+    Undefined data given in inputs[0] are removed before performing the test.
+    """
+    # get the scipy.stats distribution name from the given distribution name
+    if inputs[1] == None:
+        raise ValueError("The name of a probability distribution function not given")
+    distscipyname = pyferret.stats.getdistname(inputs[1])
+    if distscipyname == None:
+        raise ValueError("Unknown or unsupported probability distribution function %s" % inputs[1])
+    # get the scipy.stats distribution parameters from the given "standard" parameters
+    if inputs[2] == None:
+        raise ValueError("Paramaters for the probability distribution function not given")
+    distscipyparams = pyferret.stats.getdistparams(distscipyname, inputs[2].reshape(-1))
+    if distscipyparams == None:
+        raise ValueError("Unknown or unsupported (for params) probability distribution function %s" % inputs[1])
+    # get the valid sample values
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = inputs[0][goodmask]
+    # perform the test and assign the results
+    fitparams = scipy.stats.kstest(values, distscipyname, distscipyparams)
+    result[:] = resbdf
+    # Kolmogorov-Smirnov test statistic
+    result[0] = fitparams[0]
+    # probability
+    result[1] = fitparams[1]
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Set the seed to reproduce a problematic distribution
+    # import numpy.random
+    # numpy.random.seed(3333333)
+
+    # Get a random sample from the compared distribution and from another distribution
+    ydim = 200
+    zdim = 150
+    mu = 5.0
+    sigma = 0.5
+    rvsc = scipy.stats.norm(mu, sigma).rvs(ydim * zdim)
+    rvsu = scipy.stats.uniform(loc=(mu + 3.0 * sigma), scale=(3.0 * sigma)).rvs(ydim * zdim)
+
+    # setup for the call to ferret_compute
+    distname = "norm"
+    distparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-9999.0, -1.0, -2.0], dtype=numpy.float64)
+    resbdf  = numpy.array([-8888.0], dtype=numpy.float64)
+    sampc = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    sampu = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if (index % 71) == 3:
+                sampc[0, j, k, 0, 0, 0] = inpbdfs[0]
+                sampu[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                sampc[0, j, k, 0, 0, 0] = rvsc[index]
+                sampu[0, j, k, 0, 0, 0] = rvsu[index]
+            index += 1
+    resultc = -7777.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    resultu = -7777.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute with data from the distribution and check the results
+    ferret_compute(0, resultc, resbdf, (sampc, distname, distparams), inpbdfs)
+    resultc = resultc.reshape(-1)
+    print "from same dist result: %s" % str(resultc)
+    if (resultc[0] < 0.00) or (resultc[0] > 0.01) or \
+       (resultc[1] < 0.10) or (resultc[1] > 1.00):
+        raise ValueError("Unexpected result")
+
+    # call ferret_compute with data from a different distribution and check the results
+    ferret_compute(0, resultu, resbdf, (sampu, distname, distparams), inpbdfs)
+    resultu = resultu.reshape(-1)
+    print "from diff dist result:  %s" % str(resultu)
+    if (resultu[0] < 0.99) or (resultu[0] > 1.00) or \
+       (resultu[1] < 0.00) or (resultu[1] > 0.01):
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_kstest2.py b/pyfermod/stats/stats_kstest2.py
new file mode 100644
index 0000000..103ae95
--- /dev/null
+++ b/pyfermod/stats/stats_kstest2.py
@@ -0,0 +1,125 @@
+"""
+Performs a two-sided Kolmogorov-Smirnov test that two samples
+come from the same continuous probability distribution.
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_kstest2 PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns two-sided Kolmogorov-Smirnov test stat. and prob. " \
+                            "that two samples comes from the same prob. distrib.",
+                "axes": axes_values,
+                "argnames": ( "SAMPLEA", "SAMPLEB", ),
+                "argdescripts": ( "First sample data array",
+                                  "Second sample data array", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_kstest2 Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "KS,P", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a two-sided Kolmogorov-Smirnov test that two samples come
+    from the same continuous probability distribution.  The samples are
+    given in inputs[0] and inputs[1].  The test statistic value and
+    two-tailed probability are returned in result.  Undefined data given
+    in each sample are removed (independently from each other) before
+    performing the test.  Note that the samples do not need to be the
+    same size; thus there are no restrictions on the relative dimensions
+    of sample arrays.
+    """
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    sampa = inputs[0][goodmask]
+    badmask = ( numpy.fabs(inputs[1] - inpbdfs[1]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[1]))
+    goodmask = numpy.logical_not(badmask)
+    sampb = inputs[1][goodmask]
+    fitparams = scipy.stats.ks_2samp(sampa, sampb)
+    result[:] = resbdf
+    # Kolmogorov-Smirnov test statistic
+    result[0] = fitparams[0]
+    # probability
+    result[1] = fitparams[1]
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get two random samples from the same distribution
+    ydim = 250
+    zdim = 150
+    distf = scipy.stats.weibull_min(2.0, 5.0)
+    sampa = distf.rvs(ydim * zdim)
+    sampb = distf.rvs(ydim * zdim)
+
+    # Get a distribution from a different distribution
+    sampu = scipy.stats.uniform(loc=7.0, scale=5.0).rvs(ydim * zdim)
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    arraya = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    arrayb = numpy.empty((ydim, 1, 1, zdim, 1, 1), dtype=numpy.float64, order='F')
+    arrayu = numpy.empty((ydim, 1, 1, zdim, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if (index % 23) == 3:
+                arraya[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                arraya[0, j, k, 0, 0, 0] = sampa[index]
+            if (index % 53) == 3:
+                arrayb[j, 0, 0, k, 0, 0] = inpbdfs[1]
+                arrayu[j, 0, 0, k, 0, 0] = inpbdfs[1]
+            else:
+                arrayb[j, 0, 0, k, 0, 0] = sampb[index]
+                arrayu[j, 0, 0, k, 0, 0] = sampu[index]
+            index += 1
+    resultb = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    resultu = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute with the samples from the same distribution and check the results
+    ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+    resultb = resultb.reshape(-1)
+    print "from same dist result: %s" % str(resultb)
+    if (resultb[0] < 0.00) or (resultb[0] > 0.01) or \
+       (resultb[1] < 0.10) or (resultb[1] > 1.00):
+        raise ValueError("Unexpected result")
+
+    # call ferret_compute with data from different distributions and check the results
+    ferret_compute(0, resultu, resbdf, (sampa, sampu), inpbdfs)
+    resultu = resultu.reshape(-1)
+    print "from diff dist result: %s" % str(resultu)
+    if (resultu[0] < 0.98) or (resultu[0] > 1.00) or \
+       (resultu[1] < 0.00) or (resultu[1] > 0.01):
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_laplace_cdf.py b/pyfermod/stats/stats_laplace_cdf.py
new file mode 100644
index 0000000..fa8a778
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_laplace_isf.py b/pyfermod/stats/stats_laplace_isf.py
new file mode 100644
index 0000000..711fbf6
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_laplace_pdf.py b/pyfermod/stats/stats_laplace_pdf.py
new file mode 100644
index 0000000..442bdcd
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_laplace_ppf.py b/pyfermod/stats/stats_laplace_ppf.py
new file mode 100644
index 0000000..1ac7c86
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_laplace_rvs.py b/pyfermod/stats/stats_laplace_rvs.py
new file mode 100644
index 0000000..21e84d6
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_laplace_sf.py b/pyfermod/stats/stats_laplace_sf.py
new file mode 100644
index 0000000..6993ade
--- /dev/null
+++ b/pyfermod/stats/stats_laplace_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Laplace probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Laplace"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_laplace_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_laplace_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_linregress.py b/pyfermod/stats/stats_linregress.py
new file mode 100644
index 0000000..9677919
--- /dev/null
+++ b/pyfermod/stats/stats_linregress.py
@@ -0,0 +1,153 @@
+"""
+Returns parameters resulting from a linear regression of one set
+of given data against another set of given data.
+"""
+import math
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_linregress python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns slope, intercept, correlation coeff (r), and num good pts for a linear regression",
+                "axes": axes_values,
+                "argnames": ( "XVALS", "YVALS", ),
+                "argdescripts": ( "Abscissa values for the linear regression fit",
+                                  "Ordinate values for the linear regression fit", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define the limits and (unit)name of the custom axis of the
+    array containing the returned parameters.  The values returned
+    are from the scipy.stats.linregress function: slope, intercept,
+    and correlation coefficient; plus the number of defined points
+    used in the fitting.  The probability of zero slope and
+    standard error of the estimate computed by linregress are not
+    returned.  (The standard error of the estimate returned is
+    incorrect.  The value returned is close but larger than the
+    square of the correct value.)
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 4, 1, "M,B,R,N", False, )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with parameters for the linear regression of the
+    ordinate values given inputs[1] to the abscissa values given in
+    inputs[0].  If the input arrays inputs[0] and inputs[1] do not
+    have the same shape (the same lengths of each of the four axes),
+    then then must each have only one defined non-singular axis with
+    matching lengths.  Result is assigned the slope, intercept, and
+    sample correlation coefficient from scipy.stats.linregress as
+    well as the number of defined points used in the fitting.  The
+    probability of zero slope and standard error of the estimate
+    computed by linregress are not returned.  (The standard error of
+    the estimate returned is incorrect.  The value returned is close
+    but larger than the square of the correct value.)
+    """
+    if inputs[0].shape != inputs[1].shape :
+        shp0 = inputs[0].squeeze().shape
+        shp1 = inputs[1].squeeze().shape
+        if (len(shp0) > 1) or (len(shp1) > 1) or (shp0 != shp1):
+            raise ValueError("XVALS and YVALS must either have identical dimensions or "\
+                             "both have only one defined non-singular axis of the same length")
+    abscissa = inputs[0].reshape(-1)
+    ordinate = inputs[1].reshape(-1)
+    badmaska = ( numpy.fabs(abscissa - inpbdfs[0]) < 1.0E-5 )
+    badmaska = numpy.logical_or(badmaska, numpy.isnan(abscissa))
+    badmasko = ( numpy.fabs(ordinate - inpbdfs[1]) < 1.0E-5 )
+    badmasko = numpy.logical_or(badmasko, numpy.isnan(ordinate))
+    goodmask = numpy.logical_not(numpy.logical_or(badmaska, badmasko))
+    xvals = numpy.array(abscissa[goodmask], dtype=numpy.float64)
+    numpts = len(xvals)
+    if numpts < 2:
+        raise ValueError("Not enough defined points in common in XVALS and YVALS")
+    yvals = numpy.array(ordinate[goodmask], dtype=numpy.float64)
+    fitparams = scipy.stats.linregress(xvals, yvals)
+    result[:] = resbdf
+    # slope
+    result[0] = fitparams[0]
+    # intercept
+    result[1] = fitparams[1]
+    # correlation coefficient
+    result[2] = fitparams[2]
+    # ignore the probability of zero coefficient (fitparams[3]) and
+    # the incorrect standard error of the estimate (fitparams[4])
+    # number of good pts
+    result[3] = numpts
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # just make sure these calls don't throw errors
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+    # create some data to fit
+    slope = -5.0
+    intercept = 15.0
+    xvals = numpy.arange(0.0, 10.0, 0.01)
+    fuzz = scipy.stats.norm(0.0, 0.01).rvs(1000)
+    yvals = slope * xvals + intercept + fuzz
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    abscissa = numpy.empty((1, 1000, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ordinate = numpy.empty((1, 1, 1000, 1, 1, 1), dtype=numpy.float64, order='F')
+    goodvals = numpy.empty((1000,), dtype=bool)
+    index = 0
+    numgood = 0
+    for j in xrange(1000):
+        if (index % 53) == 13:
+            abscissa[0, j, 0, 0, 0, 0] = inpbdfs[0]
+        else:
+            abscissa[0, j, 0, 0, 0, 0] = xvals[j]
+        if (index % 73) == 13:
+            ordinate[0, 0, j, 0, 0, 0] = inpbdfs[1]
+        else:
+            ordinate[0, 0, j, 0, 0, 0] = yvals[j]
+        if ((index % 53) == 13) or ((index % 73) == 13):
+            goodvals[index] = False
+        else:
+            goodvals[index] = True
+            numgood += 1
+        index += 1
+    result = -5555.0 * numpy.ones((4,), dtype=numpy.float64)
+    ferret_compute(0, result, resbdf, ( abscissa, ordinate, ), inpbdfs)
+    xvals = xvals[goodvals]
+    xave = xvals.mean()
+    yvals = yvals[goodvals]
+    yave = yvals.mean()
+    m = (xvals * yvals - xave * yave).sum() / (xvals * xvals - xave * xave).sum()
+    b = yave - m * xave
+    yxdeltas = yvals - (m * xvals + b)
+    yxsumsq = (yxdeltas * yxdeltas).sum()
+    # std_err_est = math.sqrt(yxsumsq / float(numgood - 2))
+    ydeltas = yvals - yave
+    ysumsq = (ydeltas * ydeltas).sum()
+    rsq = 1.0 - (yxsumsq / ysumsq)
+    r = math.sqrt(rsq)
+    if m < 0.0:
+        r *= -1.0
+    expected = numpy.array([m, b, r, numgood], dtype=numpy.float64)
+    if not numpy.allclose(result, expected, rtol=1.0E-5, atol=1.0E-5):
+        raise ValueError("Linear regression fail\nexpected params:\n%s\nfound params:\n%s" % \
+                         (str(expected), str(result)))
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_lognorm_cdf.py b/pyfermod/stats/stats_lognorm_cdf.py
new file mode 100644
index 0000000..cde60a3
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_lognorm_isf.py b/pyfermod/stats/stats_lognorm_isf.py
new file mode 100644
index 0000000..ab64ec6
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_lognorm_pdf.py b/pyfermod/stats/stats_lognorm_pdf.py
new file mode 100644
index 0000000..df8431d
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_lognorm_ppf.py b/pyfermod/stats/stats_lognorm_ppf.py
new file mode 100644
index 0000000..01fbb01
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_lognorm_rvs.py b/pyfermod/stats/stats_lognorm_rvs.py
new file mode 100644
index 0000000..c7659ed
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_lognorm_sf.py b/pyfermod/stats/stats_lognorm_sf.py
new file mode 100644
index 0000000..a11348c
--- /dev/null
+++ b/pyfermod/stats/stats_lognorm_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Log-Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Log-Normal"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_lognorm_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_lognorm_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_cdf.py b/pyfermod/stats/stats_nbinom_cdf.py
new file mode 100644
index 0000000..a4803ef
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_isf.py b/pyfermod/stats/stats_nbinom_isf.py
new file mode 100644
index 0000000..4666dd1
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_pmf.py b/pyfermod/stats/stats_nbinom_pmf.py
new file mode 100644
index 0000000..fc3fe16
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_ppf.py b/pyfermod/stats/stats_nbinom_ppf.py
new file mode 100644
index 0000000..7768c1c
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_rvs.py b/pyfermod/stats/stats_nbinom_rvs.py
new file mode 100644
index 0000000..0b904f9
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_nbinom_sf.py b/pyfermod/stats/stats_nbinom_sf.py
new file mode 100644
index 0000000..e5e51e1
--- /dev/null
+++ b/pyfermod/stats/stats_nbinom_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Negative-Binomial probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Negative-Binomial"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_nbinom_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_nbinom_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_norm_cdf.py b/pyfermod/stats/stats_norm_cdf.py
new file mode 100644
index 0000000..b5744b6
--- /dev/null
+++ b/pyfermod/stats/stats_norm_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_norm_isf.py b/pyfermod/stats/stats_norm_isf.py
new file mode 100644
index 0000000..4904174
--- /dev/null
+++ b/pyfermod/stats/stats_norm_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_norm_pdf.py b/pyfermod/stats/stats_norm_pdf.py
new file mode 100644
index 0000000..d7de63f
--- /dev/null
+++ b/pyfermod/stats/stats_norm_pdf.py
@@ -0,0 +1,79 @@
+"""
+Returns the array of probability distribution function values
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+import scipy.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution in the YZ plane, MUs on the X axis, SIGMAs on the T
+    xdim = 6
+    ydim = 25
+    zdim = 15
+    tdim = 4
+    yzvals = numpy.linspace(0.0, 100.0, ydim * zdim)
+    mus = numpy.linspace(20.0, 45.0, xdim)
+    sigmas = numpy.linspace(8.0, 14.0, tdim)
+    pdfs = numpy.empty((xdim, ydim, zdim, tdim, 1, 1), dtype=numpy.float64, order='F')
+    for i in xrange(xdim):
+        for q in xrange(tdim):
+            distf = scipy.stats.norm(mus[i], sigmas[q])
+            values = distf.pdf(yzvals)
+            pdfs[i, :, :, q, 0, 0] = values.reshape((ydim, zdim), order='F')
+    # configure arrays for ferret_compute
+    yzvals = numpy.array(yzvals, dtype=numpy.float64).reshape((1, ydim, zdim, 1, 1, 1), order='F')
+    mus = numpy.array(mus, dtype=numpy.float64).reshape((xdim, 1, 1, 1, 1, 1), order='F')
+    sigmas = numpy.array(sigmas, dtype=numpy.float64).reshape((1, 1, 1 , tdim, 1, 1), order='F')
+    inpbdfs = numpy.array([-9999.0, -8888.0, -7777.0], dtype=numpy.float64)
+    resbdf = numpy.array([-6666.0], dtype=numpy.float64)
+    # Throw in some undefined values
+    index = 0
+    for k in xrange(zdim):
+        for j in xrange(ydim):
+            if (index % 13) == 3:
+                abscissa[0, j, k, 0, 0, 0] = inpbdfs[0]
+                pdfs[:, j, k, :, 0, 0] = resbdf[0]
+    mus[4, 0, 0, 0, 0, 0] = inpbdfs[1]
+    pdfs[4, :, :, :, 0, 0] = resbdf[0]
+    sigmas[0, 0, 0, 1, 0, 0] = inpbdfs[2]
+    pdfs[:, :, :, 1, 0, 0] = resbdf[0]
+    # Get the result from ferret_compute and compare
+    result = -5555.0 * numpy.ones((xdim, ydim, zdim, tdim, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (yzvals, mus, sigmas), inpbdfs)
+    if not numpy.allclose(result, pdfs):
+        print "Expect (flattened) =\n%s" % str(pdfs.reshape(-1))
+        print "Result (flattened) =\n%s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_norm_ppf.py b/pyfermod/stats/stats_norm_ppf.py
new file mode 100644
index 0000000..98149c6
--- /dev/null
+++ b/pyfermod/stats/stats_norm_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_norm_rvs.py b/pyfermod/stats/stats_norm_rvs.py
new file mode 100644
index 0000000..60128d8
--- /dev/null
+++ b/pyfermod/stats/stats_norm_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_norm_sf.py b/pyfermod/stats/stats_norm_sf.py
new file mode 100644
index 0000000..d10d04c
--- /dev/null
+++ b/pyfermod/stats/stats_norm_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Normal probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Normal"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_norm_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_norm_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_cdf.py b/pyfermod/stats/stats_pareto_cdf.py
new file mode 100644
index 0000000..2f3f426
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_isf.py b/pyfermod/stats/stats_pareto_isf.py
new file mode 100644
index 0000000..c5b77eb
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_pdf.py b/pyfermod/stats/stats_pareto_pdf.py
new file mode 100644
index 0000000..2c9993d
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_ppf.py b/pyfermod/stats/stats_pareto_ppf.py
new file mode 100644
index 0000000..9321a92
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_rvs.py b/pyfermod/stats/stats_pareto_rvs.py
new file mode 100644
index 0000000..e55ab65
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pareto_sf.py b/pyfermod/stats/stats_pareto_sf.py
new file mode 100644
index 0000000..533cf21
--- /dev/null
+++ b/pyfermod/stats/stats_pareto_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Pareto probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Pareto"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pareto_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_pareto_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_pdf.py b/pyfermod/stats/stats_pdf.py
new file mode 100644
index 0000000..710cfa3
--- /dev/null
+++ b/pyfermod/stats/stats_pdf.py
@@ -0,0 +1,87 @@
+"""
+Returns the array of probability density function values for a
+continuous probability distribution and set of abscissa values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pdf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns probability density function values for a continuous probability distribution",
+                "axes": axes_values,
+                "argnames": ("PTS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Points at which to calculate the probability density function values",
+                                 "Name of a continuous probability distribution",
+                                 "Parameters for this continuous probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the probability density function values for the
+    continuous probability distribution indicated by inputs[1] (a string)
+    using the parameters given in inputs[2] at the abscissa values given
+    by inputs[0].  For undefined abscissa values, the result value will
+    be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.pdf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution along the Y axis
+    dimen = 25
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    xvals = numpy.linspace(mu - 2.5 * sigma, mu + 2.5 * sigma, dimen)
+    pdfvals = distf.pdf(xvals)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    abscissa = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 3:
+            abscissa[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            abscissa[0, j, 0, 0, 0, 0] = xvals[j]
+            expected[0, j, 0, 0, 0, 0] = pdfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_pearsonr.py b/pyfermod/stats/stats_pearsonr.py
new file mode 100644
index 0000000..75e17b3
--- /dev/null
+++ b/pyfermod/stats/stats_pearsonr.py
@@ -0,0 +1,145 @@
+"""
+Returns the Pearson product-moment correlation
+coefficient between two samples of data.
+"""
+import math
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pearsonr PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns Pearson correlation coeff, and num good points, between two samples of data",
+                "axes": axes_values,
+                "argnames": ( "SAMPLEA", "SAMPLEB", ),
+                "argdescripts": ( "First array of sample data",
+                                  "Second array of sample data", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_pearsonr Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "R,N", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the Pearson product-moment correlation
+    coefficient, and the number of good points, between the two
+    samples of data given in inputs[0] and inputs[1].  Values
+    compared are only from positions that are defined in both
+    arrays.
+    """
+    if inputs[0].shape != inputs[1].shape :
+        shp0 = inputs[0].squeeze().shape
+        shp1 = inputs[1].squeeze().shape
+        if (len(shp0) > 1) or (len(shp1) > 1) or (shp0 != shp1):
+            raise ValueError("SAMPLEA and SAMPLEB must either have identical dimensions or "\
+                             "both have only one defined non-singular axis of the same length")
+    sampa = inputs[0].reshape(-1)
+    sampb = inputs[1].reshape(-1)
+    bada = ( numpy.fabs(sampa - inpbdfs[0]) < 1.0E-5 )
+    bada = numpy.logical_or(bada, numpy.isnan(sampa))
+    badb = ( numpy.fabs(sampb - inpbdfs[1]) < 1.0E-5 )
+    badb = numpy.logical_or(badb, numpy.isnan(sampb))
+    goodmask = numpy.logical_not(numpy.logical_or(bada, badb))
+    valsa = numpy.array(sampa[goodmask], dtype=numpy.float64)
+    numpts = len(valsa)
+    if numpts < 2:
+        raise ValueError("Not enough defined points in common in SAMPLEA and SAMPLEB")
+    valsb = numpy.array(sampb[goodmask], dtype=numpy.float64)
+    fitparams = scipy.stats.pearsonr(valsa, valsb)
+    result[:] = resbdf
+    # correlation coefficient
+    result[0] = fitparams[0]
+    # ignore the probability of uncorrelated
+    # number of good pts
+    result[1] = numpts
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get a random sample from a normal distribution
+    ydim = 83
+    zdim = 17
+    samplesize = ydim * zdim
+    sampa = scipy.stats.norm(5.0, 2.0).rvs(samplesize)
+
+    # Create a correlated distribution
+    sampc = -2.0 * sampa + 15.0
+    pccc = -1.0
+
+    # Create an uncorrelated distribution and approx. Pearson Correlation Coeff.
+    sampu = scipy.stats.norm(5.0, 2.0).rvs(samplesize)
+    pccu  = (sampa - sampa.mean()) / math.sqrt(sampa.var())
+    pccu *= (sampu - sampu.mean()) / math.sqrt(sampu.var())
+    pccu  = pccu.mean()
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    inputa = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    inputc = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    inputu = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    numgood = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if (index % 23) == 3:
+                inputa[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                inputa[0, j, k, 0, 0, 0] = sampa[index]
+            if (index % 31) == 3:
+                inputc[0, j, k, 0, 0, 0] = inpbdfs[1]
+                inputu[0, j, k, 0, 0, 0] = inpbdfs[1]
+            else:
+                inputc[0, j, k, 0, 0, 0] = sampc[index]
+                inputu[0, j, k, 0, 0, 0] = sampu[index]
+            if ((index % 23) != 3) and ((index % 31) != 3):
+                numgood += 1
+            index += 1
+    resultc = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectc = numpy.empty((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectc[0,0,0,0,0,0] = pccc
+    expectc[1,0,0,0,0,0] = numgood
+    resultu = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectu = numpy.empty((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    # this is only approximate since all the values were not used
+    expectu[0,0,0,0,0,0] = pccu
+    expectu[1,0,0,0,0,0] = numgood
+
+    # call ferret_compute with correlated data and check the results
+    ferret_compute(0, resultc, resbdf, (inputa, inputc), inpbdfs)
+    if not numpy.allclose(resultc, expectc):
+        raise ValueError("Unexpected result; expected: %s; found %s" % \
+                         (str(expectc.reshape(-1)), str(resultc.reshape(-1))))
+
+    # call ferret_compute with uncorrelated data and check the results
+    ferret_compute(0, resultu, resbdf, (inputa, inputu), inpbdfs)
+    if not numpy.allclose(resultu, expectu, atol=0.02):
+        raise ValueError("Unexpected result; expected: %s; found %s" % \
+                         (str(expectu.reshape(-1)), str(resultu.reshape(-1))))
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_percentilesofscores.py b/pyfermod/stats/stats_percentilesofscores.py
new file mode 100644
index 0000000..8a36286
--- /dev/null
+++ b/pyfermod/stats/stats_percentilesofscores.py
@@ -0,0 +1,102 @@
+"""
+Returns interpolated percentiles through a sample of scores (values)
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_percentilesofscores.py Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns interpolated percentiles (0-100) through a sample for given scores (values)",
+                "axes": axes_values,
+                "argnames": ( "SAMPLE", "SCORES", ),
+                "argdescripts": ( "Sample of scores (values)",
+                                  "Scores (values) to find percentiles through sample", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, true_influences, ),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with interpolated percentiles through a sample
+    that correspond to given scores.  The sample scores are given
+    in inputs[0], and the scores to find percentiles of are given
+    in inputs[1].  Undefined values in inputs[0] are eliminated
+    before using them in scipy.stats.percentileofscore.  Undefined
+    values in inputs[1] return corresponding undefined values in
+    result.
+    """
+    # make sure result has the expected dimensions
+    if result.shape != inputs[1].shape:
+        raise ValueError("Unexpected error; SCORES dimen: %s; result dimen: %s" % \
+                         (str(inputs[1].shape), str(result.shape)))
+    # get the clean sample data as a flattened array
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = inputs[0][goodmask]
+    # get the mask for the good scores
+    badmask = ( numpy.fabs(inputs[1] - inpbdfs[1]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[1]))
+    goodmask = numpy.logical_not(badmask)
+    # percentileofscore doesn't take an array for the scores
+    # so do them one at a time
+    prcnts = [ ]
+    for score in inputs[1][goodmask]:
+        prcnts.append(scipy.stats.percentileofscore(values, score))
+    result[goodmask] = prcnts
+    result[badmask] = resbdf
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    ydim = 10
+    zdim = 12
+    offset = 32.5
+    inpbdfs = numpy.array([-1.0, -2.0], dtype=numpy.float64)
+    resbdf = numpy.array([-3.0], dtype=numpy.float64)
+    sample = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    # valid sample values are [1:100:1] + offset
+    pval = 1
+    index = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if ((index % 7) == 3) or (pval > 100):
+                sample[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                sample[0, j, k, 0, 0, 0] = pval + offset
+                pval += 1
+            index += 1
+    if pval != 101:
+        raise ValueError("Unexpected final pval of %d (ydim,zdim too small)" % pval)
+    scores = numpy.empty((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    scores[:,:,:,:,:,:] = inpbdfs[1]
+    expected[:,:,:,:,:,:] = resbdf
+    for k in ( 1, 2, 3, 5, 6, 7, 9 ):
+        scores[0, 0, k, 0, 0, 0] = 10.0 * k + offset
+        expected[0, 0, k, 0, 0, 0] = 10.0 * k
+    result = -888.0 * numpy.ones((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (sample, scores), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_pmf.py b/pyfermod/stats/stats_pmf.py
new file mode 100644
index 0000000..4bc133d
--- /dev/null
+++ b/pyfermod/stats/stats_pmf.py
@@ -0,0 +1,86 @@
+"""
+Returns the array of probability density function values for a
+discrete probability distribution and set of abscissa values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_pmf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns probability mass function values for a discrete probability distribution",
+                "axes": axes_values,
+                "argnames": ("PTS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Points at which to calculate the probability mass function values",
+                                 "Name of a discrete probability distribution",
+                                 "Parameters for this discrete probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the probability mass function values for the discrete
+    probability distribution indicated by inputs[1] (a string) using the
+    parameters given in inputs[2] at the abscissa values given by inputs[0].
+    For undefined abscissa values, the result value will be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.pmf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Binomial distribution along the Y axis
+    numtrials = 25
+    prob = 0.15
+    dimen = 26
+    distf = scipy.stats.binom(numtrials, prob)
+    xvals = numpy.arange(0, dimen)
+    pmfvals = distf.pmf(xvals)
+
+    pfname = "binom"
+    pfparams = numpy.array([numtrials, prob], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    abscissa = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 2:
+            abscissa[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            abscissa[0, j, 0, 0, 0, 0] = xvals[j]
+            expected[0, j, 0, 0, 0, 0] = pmfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_poisson_cdf.py b/pyfermod/stats/stats_poisson_cdf.py
new file mode 100644
index 0000000..1f9dc86
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_poisson_isf.py b/pyfermod/stats/stats_poisson_isf.py
new file mode 100644
index 0000000..47c29ef
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_poisson_pmf.py b/pyfermod/stats/stats_poisson_pmf.py
new file mode 100644
index 0000000..9cbf1c8
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_poisson_ppf.py b/pyfermod/stats/stats_poisson_ppf.py
new file mode 100644
index 0000000..ba09965
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_poisson_rvs.py b/pyfermod/stats/stats_poisson_rvs.py
new file mode 100644
index 0000000..0e1f6d3
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_poisson_sf.py b/pyfermod/stats/stats_poisson_sf.py
new file mode 100644
index 0000000..101eb0d
--- /dev/null
+++ b/pyfermod/stats/stats_poisson_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Poisson probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Poisson"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_poisson_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_poisson_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_ppf.py b/pyfermod/stats/stats_ppf.py
new file mode 100644
index 0000000..92faea7
--- /dev/null
+++ b/pyfermod/stats/stats_ppf.py
@@ -0,0 +1,86 @@
+"""
+Returns the array of percent point function values for
+a probability distribution and set of quantile values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_ppf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns percent point function (inverse of cdf) values for a probability distribution",
+                "axes": axes_values,
+                "argnames": ("PROBS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Probabilities (0-1) at which to calculate the percent point function values",
+                                 "Name of a probability distribution",
+                                 "Parameters for this probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the percent point function values for the probability
+    distribution indicated by inputs[1] (a string) using the parameters given
+    in inputs[2] at the quantile values given by inputs[0].  For undefined
+    quantile values, the result value will be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.ppf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution along the Y axis
+    dimen = 25
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    qvals = numpy.linspace(0.05, 0.95, dimen)
+    ppfvals = distf.ppf(qvals)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    quantile = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 2:
+            quantile[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            quantile[0, j, 0, 0, 0, 0] = qvals[j]
+            expected[0, j, 0, 0, 0, 0] = ppfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (quantile, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_probplotvals.py b/pyfermod/stats/stats_probplotvals.py
new file mode 100644
index 0000000..8882212
--- /dev/null
+++ b/pyfermod/stats/stats_probplotvals.py
@@ -0,0 +1,162 @@
+"""
+Returns an array containing the order statistic medians for a given 
+probability distribution along the X axis in the first Y axis value, 
+and ordered response data of a given sample along the X axis in the
+second Y axis value.  The order statistic medians are the percent 
+probability function values of the probability distribution at 
+regularily-spaced intervals.  The ordered response data is the sorted 
+sample values.  If the sample comes from a probability distribution 
+of the type given, the plot of the ordered response data against the 
+order statistic medians should give a straight line whose slope is 
+the offset from, and whose intercept is the scaling of, the given 
+distribution.  Thus, the slope, intercept, and correlation coefficient
+(r) of this fitted line are returned and the first three X elements
+of the third Y axis value.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_probplotvals Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    axes_values[1] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns [j=1] order statistic medians, " \
+                                    "[j=2] ordered response data, and " \
+                                    "[j=3] slope, intercept, and corr. coeff. of fitted line",
+                "axes": axes_values,
+                "argnames": ("SAMPLE", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Sample values for the ordered response data",
+                                 "Name of a continuous probability distribution for the order statistic medians",
+                                 "Parameters for this continuous probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (false_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Custom axis information for stats_probplot_values Ferret PyEF
+    """
+    size = 1
+    for axis in ( pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS, 
+                  pyferret.T_AXIS, pyferret.E_AXIS, pyferret.F_AXIS ):
+        axis_info = pyferret.get_axis_info(id, pyferret.ARG1, axis)
+        # Note: axes normal to the data have size = -1
+        num = axis_info.get("size", -1)
+        if num > 1:
+            size *= num
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = (1, size, 1, "VALUE_NUM", False, )
+    axis_defs[1] = (1, 3, 1, "OSM,ORD,P", False, )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns to result[:,0] the order statistic medians for
+    the probability distribution named in inputs[1] with 
+    parameters given in inputs[2].  Assigns to result[:,1] 
+    the ordered response data of the sample values given in 
+    inputs[0].  Assigns to result[:3,2] the slope, intercept, 
+    and correlation coefficient of the line fitted to a plot
+    of result[:,1] against result[:,0].  Undefined values 
+    in inputs[0] are removed at the beginning of this
+    computation.
+    """
+    distribname = inputs[1]
+    distname = pyferret.stats.getdistname(distribname)
+    if distname == None:
+        raise ValueError("Unknown probability function %s" % distribname)
+    distribparams = inputs[2].reshape(-1)
+    distparams = pyferret.stats.getdistparams(distname, distribparams)
+    if distparams == None:
+        raise ValueError("Unknown (for params) probability function %s" % distribname)
+
+    sample = inputs[0].reshape(-1)
+    badmask = ( numpy.fabs(sample - inpbdfs[0]) < 1.0E-5 )
+    goodmask = numpy.logical_not(numpy.logical_or(badmask, numpy.isnan(sample)))
+    ppdata = scipy.stats.probplot(sample[goodmask], distparams, distname, fit=1)
+    result[:] = resbdf
+    result[goodmask,0,0,0,0,0] = ppdata[0][0]
+    result[goodmask,1,0,0,0,0] = ppdata[0][1]
+    result[:3,2,0,0,0,0] = ppdata[1]
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Sample from a normal distribution
+    ydim = 23
+    zdim = 13
+    inpundefval = -1.0E+10
+    outundefval = -2.0E+10
+
+    # select a random sample from a normal distribution
+    size = ydim * zdim
+    sample = scipy.stats.norm(5.0, 2.0).rvs(size)
+    ordata = numpy.sort(sample)
+
+    # compare to the standard normal distribution (mu = 0.0, sigma = 1.0)
+    uvals = numpy.empty(size)
+    uvals[-1] = numpy.power(0.5, 1.0 / size)
+    uvals[0] = 1.0 - uvals[-1]
+    uvals[1:-1] = (numpy.arange(2.0, size-0.5, 1.0) - 0.3175) / (size + 0.365)
+    osmeds = scipy.stats.norm(0.0, 1.0).ppf(uvals)
+
+    # set up for a call to ferret_compute
+    pfname = "norm"
+    pfparams = numpy.array([0.0, 1.0], dtype=numpy.float64)
+    inpbdfs = numpy.array([inpundefval, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([outundefval], dtype=numpy.float64)
+    inputarr = numpy.empty((1, ydim + 1, zdim + 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty(((ydim + 1) * (zdim + 1), 3, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    n = 0
+    index = 0
+    for j in xrange(ydim + 1):
+        for k in xrange(zdim + 1):
+            if (k == j) or (k == j+1) or (n >= size):
+                inputarr[0, j, k, 0, 0, 0] = inpbdfs[0]
+                expected[index, 0, 0, 0, 0, 0] = resbdf[0]
+                expected[index, 1, 0, 0, 0, 0] = resbdf[0]
+            else:
+                inputarr[0, j, k, 0, 0, 0] = sample[n]
+                expected[index, 0, 0, 0, 0, 0] = osmeds[n]
+                expected[index, 1, 0, 0, 0, 0] = ordata[n]
+                n += 1
+            index += 1
+    if n < size:
+        raise ValueError("Unexpected result: not all values assigned")
+    fitdata = scipy.stats.linregress(osmeds, ordata)
+    expected[:3,2,0,0,0,0] = fitdata[:3]
+    expected[3:,2,0,0,0,0] = resbdf[0]
+    result = -888888.0 * numpy.ones(((ydim + 1) * (zdim + 1), 3, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the results
+    ferret_compute(0, result, resbdf, (inputarr, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        if not numpy.allclose(result[:,0,0,0,0,0], expected[:,0,0,0,0,0]):
+            print "Expected[:,0,0,0,0,0] =\n%s" % str(expected[:,0,0,0,0,0])
+            print "Result[:,0,0,0,0,0] =\n%s" % str(result[:,0,0,0,0,0])
+        if not numpy.allclose(result[:,1,0,0,0,0], expected[:,1,0,0,0,0]):
+            print "Expected[:,1,0,0,0,0] =\n%s" % str(expected[:,1,0,0,0,0])
+            print "Result[:,1,0,0,0,0] =\n%s" % str(result[:,1,0,0,0,0])
+        if not numpy.allclose(result[:3,2,0,0,0,0], expected[:3,2,0,0,0,0]):
+            print "Expected[:3,2,0,0,0,0] =\n%s" % str(expected[:3,2,0,0,0,0])
+            print "Result[:3,2,0,0,0,0] =\n%s" % str(result[:3,2,0,0,0,0])
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
diff --git a/pyfermod/stats/stats_randint_cdf.py b/pyfermod/stats/stats_randint_cdf.py
new file mode 100644
index 0000000..31e6912
--- /dev/null
+++ b/pyfermod/stats/stats_randint_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_randint_isf.py b/pyfermod/stats/stats_randint_isf.py
new file mode 100644
index 0000000..2947ead
--- /dev/null
+++ b/pyfermod/stats/stats_randint_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_randint_pmf.py b/pyfermod/stats/stats_randint_pmf.py
new file mode 100644
index 0000000..9b783be
--- /dev/null
+++ b/pyfermod/stats/stats_randint_pmf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability mass function values
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "pmf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_pmf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_pmf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_randint_ppf.py b/pyfermod/stats/stats_randint_ppf.py
new file mode 100644
index 0000000..ee6aa25
--- /dev/null
+++ b/pyfermod/stats/stats_randint_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_randint_rvs.py b/pyfermod/stats/stats_randint_rvs.py
new file mode 100644
index 0000000..bf6f51d
--- /dev/null
+++ b/pyfermod/stats/stats_randint_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_randint_sf.py b/pyfermod/stats/stats_randint_sf.py
new file mode 100644
index 0000000..9f6c94c
--- /dev/null
+++ b/pyfermod/stats/stats_randint_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Random-Integer probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Random-Integer"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_randint_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_randint_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_rvs.py b/pyfermod/stats/stats_rvs.py
new file mode 100644
index 0000000..64462f2
--- /dev/null
+++ b/pyfermod/stats/stats_rvs.py
@@ -0,0 +1,100 @@
+"""
+Returns the array of random variates for a probability distribution
+assigned to positions corresponding to defined values in an input array.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_rvs python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns random variates for a probability distribution",
+                "axes": axes_values,
+                "argnames": ("TEMPLATE", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Template array for the array of random variates to be returned",
+                                 "Name of a probability distribution",
+                                 "Parameters for this probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with random variates of the probability distribution
+    indicated by inputs[1] (a string) using the parameters given in
+    inputs[2].  Random variates will be assigned to positions corresponding
+    to defined positions in inputs[0].  For positions where the inputs[0]
+    value is undefined, the result value will be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # result[goodmask] is a flattened array
+    result[goodmask] = distrib.rvs(len(result[goodmask]))
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Get a large sample from a normal distribution with small variance
+    # so the mean and stdev will be very close
+    mu = 5.0
+    sigma = 0.5
+    # probability of randomly choosing -65536.0 is essentially zero
+    undefval = -65536.0
+    xdim = 19
+    ydim = 21
+    zdim = 17
+    tdim = 23
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([undefval], dtype=numpy.float64)
+    # template initialized to all zero != impbdfs[0]
+    template = numpy.zeros((xdim, ydim, zdim, tdim, 1, 1), dtype=numpy.float64, order='F')
+    expectedgood = numpy.empty((xdim, ydim, zdim, tdim, 1, 1), dtype=bool, order='F')
+    index = 0
+    for i in xrange(xdim):
+        for j in xrange(ydim):
+            for k in xrange(zdim):
+                for l in xrange(tdim):
+                    if (index % 53) == 1:
+                        template[i, j, k, l, 0, 0] = inpbdfs[0]
+                        expectedgood[i, j, k, l, 0, 0] = False
+                    else:
+                        expectedgood[i, j, k, l, 0, 0] = True
+                    index += 1
+    result = -8888.0 * numpy.ones((xdim, ydim, zdim, tdim, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (template, pfname, pfparams), inpbdfs)
+    resultgood = ( result != resbdf )
+    if numpy.any( resultgood !=  expectedgood ):
+        raise ValueError("Assigned random variates does not match template")
+    mean = numpy.mean(result[resultgood])
+    if abs(mean - 5.0) > 5.0E-3:
+        raise ValueError("Mean of random sample: expected: 5.0; found: %f" % mean)
+    stdev = numpy.std(result[resultgood])
+    if abs(stdev - 0.5) > 5.0E-3:
+        raise ValueError("Standard deviation of random sample: expected: 0.5; found: %f" % stdev)
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_scoresatpercentiles.py b/pyfermod/stats/stats_scoresatpercentiles.py
new file mode 100644
index 0000000..6db011a
--- /dev/null
+++ b/pyfermod/stats/stats_scoresatpercentiles.py
@@ -0,0 +1,101 @@
+"""
+Returns interpolated scores (values) at percentiles through a sample
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_scoresatpercentiles.py Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns interpolated scores (values) that are given percentiles through a sample",
+                "axes": axes_values,
+                "argnames": ( "SAMPLE", "PERCENTILES", ),
+                "argdescripts": ( "Sample of scores (values)",
+                                  "Percentiles (0-100) through sample to find scores (values) of", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, true_influences, ),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with interpolated scores that are given percentiles
+    through a sample.  The sample scores are given in inputs[0], and the
+    percentiles are given in inputs[1].  Undefined values in inputs[0]
+    are eliminated before using it in scipy.stats.scoreatpercentile.
+    Undefined values in inputs[1] return corresponding undefined values
+    in result.
+    """
+    # make sure result has the expected dimensions
+    if result.shape != inputs[1].shape:
+        raise ValueError("Unexpected error; PERCENTILE dimen: %s; result dimen: %s" % \
+                         (str(inputs[1].shape), str(result.shape)))
+    # get the clean sample data as a flattened array
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = inputs[0][goodmask]
+    # get the mask for the good percentiles
+    badmask = ( numpy.fabs(inputs[1] - inpbdfs[1]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[1]))
+    goodmask = numpy.logical_not(badmask)
+    # scoreatpercentile doesn't take an array for the percentiles
+    # so do them one at a time
+    scores = [ ]
+    for prcnt in inputs[1][goodmask]:
+        scores.append(scipy.stats.scoreatpercentile(values, prcnt))
+    result[goodmask] = scores
+    result[badmask] = resbdf
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    ydim = 10
+    zdim = 12
+    offset = 32.5
+    inpbdfs = numpy.array([-1.0, -2.0], dtype=numpy.float64)
+    resbdf = numpy.array([-3.0], dtype=numpy.float64)
+    sample = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    # valid sample values are [0:100:1] + offset
+    pval = 0
+    index = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if ((index % 7) == 3) or (pval > 100):
+                sample[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                sample[0, j, k, 0, 0, 0] = pval + offset
+                pval += 1
+            index += 1
+    if pval != 101:
+        raise ValueError("Unexpected final pval of %d (ydim,zdim too small)" % pval)
+    prcnts = numpy.empty((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    prcnts[:,:,:,:,:,:] = inpbdfs[1]
+    expected[:,:,:,:,:,:] = resbdf
+    for k in ( 1, 2, 3, 5, 6, 7, 9 ):
+        prcnts[0, 0, k, 0, 0, 0] = 10.0 * k
+        expected[0, 0, k, 0, 0, 0] = 10.0 * k + offset
+    result = -888.0 * numpy.ones((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (sample, prcnts), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_sf.py b/pyfermod/stats/stats_sf.py
new file mode 100644
index 0000000..e8248b1
--- /dev/null
+++ b/pyfermod/stats/stats_sf.py
@@ -0,0 +1,86 @@
+"""
+Returns the array of survival function values for a
+probability distribution and set of abscissa values.
+"""
+import numpy
+import scipy.stats
+import pyferret
+import pyferret.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_sf python-backed ferret external function
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 3,
+                "descript": "Returns survival function (1-cdf) values for a probability distribution",
+                "axes": axes_values,
+                "argnames": ("PTS", "PDNAME", "PDPARAMS"),
+                "argdescripts": ("Points at which to calculate the survival function values",
+                                 "Name of a probability distribution",
+                                 "Parameters for this probability distribution"),
+                "argtypes": (pyferret.FLOAT_ARRAY, pyferret.STRING_ONEVAL, pyferret.FLOAT_ARRAY),
+                "influences": (true_influences, false_influences, false_influences),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the survival function values for the probability
+    distribution indicated by inputs[1] (a string) using the parameters
+    given in inputs[2] at the abscissa values given by inputs[0].  For
+    undefined abscissa values, the result value will be undefined.
+    """
+    distribname = inputs[1]
+    distribparams = inputs[2].reshape(-1)
+    distrib = pyferret.stats.getdistrib(distribname, distribparams)
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # array[goodmask] is a flattened array
+    result[goodmask] = distrib.sf(inputs[0][goodmask])
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Normal distribution along the Y axis
+    dimen = 25
+    mu = 5.0
+    sigma = 2.0
+    distf = scipy.stats.norm(mu, sigma)
+    xvals = numpy.linspace(mu - 2.5 * sigma, mu + 2.5 * sigma, dimen)
+    sfvals = distf.sf(xvals)
+
+    pfname = "norm"
+    pfparams = numpy.array([mu, sigma], dtype=numpy.float64)
+    inpbdfs = numpy.array([-1.0, 0.0, 0.0], dtype=numpy.float64)
+    resbdf = numpy.array([-2.0], dtype=numpy.float64)
+    abscissa = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    for j in xrange(dimen):
+        if (j % 7) == 3:
+            abscissa[0, j, 0, 0, 0, 0] = inpbdfs[0]
+            expected[0, j, 0, 0, 0, 0] = resbdf[0]
+        else:
+            abscissa[0, j, 0, 0, 0, 0] = xvals[j]
+            expected[0, j, 0, 0, 0, 0] = sfvals[j]
+    result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+    if not numpy.allclose(result, expected):
+        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+        print "Result (flattened) = %s" % str(result.reshape(-1))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_spearmanr.py b/pyfermod/stats/stats_spearmanr.py
new file mode 100644
index 0000000..8a9df06
--- /dev/null
+++ b/pyfermod/stats/stats_spearmanr.py
@@ -0,0 +1,143 @@
+"""
+Returns Spearman's rank correlation coefficient between two samples of data.
+"""
+import math
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_spearmanr PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns Spearman's rank correlation coeff, " \
+                            "and num good points, between two samples of data",
+                "axes": axes_values,
+                "argnames": ( "SAMPLEA", "SAMPLEB", ),
+                "argdescripts": ( "First array of sample data",
+                                  "Second array of sample data", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_spearmanr Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "R,N", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with Spearman's rank correlation coefficient,
+    and the number of good point, between the two samples of
+    data given in inputs[0] and inputs[1].  Values compared are
+    only from positions that are defined in both arrays.
+    """
+    if inputs[0].shape != inputs[1].shape :
+        shp0 = inputs[0].squeeze().shape
+        shp1 = inputs[1].squeeze().shape
+        if (len(shp0) > 1) or (len(shp1) > 1) or (shp0 != shp1):
+            raise ValueError("SAMPLEA and SAMPLEB must either have identical dimensions or "\
+                             "both have only one defined non-singular axis of the same length")
+    sampa = inputs[0].reshape(-1)
+    sampb = inputs[1].reshape(-1)
+    bada = ( numpy.fabs(sampa - inpbdfs[0]) < 1.0E-5 )
+    bada = numpy.logical_or(bada, numpy.isnan(sampa))
+    badb = ( numpy.fabs(sampb - inpbdfs[1]) < 1.0E-5 )
+    badb = numpy.logical_or(badb, numpy.isnan(sampb))
+    goodmask = numpy.logical_not(numpy.logical_or(bada, badb))
+    valsa = numpy.array(sampa[goodmask], dtype=numpy.float64)
+    numpts = len(valsa)
+    if numpts < 2:
+        raise ValueError("Not enough defined points in common in SAMPLEA and SAMPLEB")
+    valsb = numpy.array(sampb[goodmask], dtype=numpy.float64)
+    fitparams = scipy.stats.spearmanr(valsa, valsb)
+    result[:] = resbdf
+    # correlation coefficient
+    result[0] = fitparams[0]
+    # ignore the probability of uncorrelated
+    # number of good pts
+    result[1] = numpts
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get a random sample from a normal distribution
+    ydim = 83
+    zdim = 17
+    samplesize = ydim * zdim
+    sampa = scipy.stats.norm(15.0, 2.0).rvs(samplesize)
+
+    # Create a correlated distribution
+    sampc = -numpy.log(sampa)
+
+    # Create an uncorrelated distribution
+    sampu = scipy.stats.norm(15.0, 2.0).rvs(samplesize)
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    inputa = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    inputc = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    inputu = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    numgood = 0
+    numpos = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if (index % 23) == 3:
+                inputa[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                inputa[0, j, k, 0, 0, 0] = sampa[index]
+            if (index % 31) == 3:
+                inputc[0, j, k, 0, 0, 0] = inpbdfs[1]
+                inputu[0, j, k, 0, 0, 0] = inpbdfs[1]
+            else:
+                inputc[0, j, k, 0, 0, 0] = sampc[index]
+                inputu[0, j, k, 0, 0, 0] = sampu[index]
+            if ((index % 23) != 3) and ((index % 31) != 3):
+                numgood += 1
+                if sampa[index] > 0.0:
+                    numpos += 1
+            index += 1
+    resultc = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectc = numpy.empty((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectc[0,0,0,0,0,0] = -1.0
+    expectc[1,0,0,0,0,0] = numpos
+    resultu = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    expectu = numpy.empty((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    # rough expected correlation coefficient for uncorrelated
+    expectu[0,0,0,0,0,0] = 0.0
+    expectu[1,0,0,0,0,0] = numgood
+
+    # call ferret_compute with correlated data and check the results
+    ferret_compute(0, resultc, resbdf, (inputa, inputc), inpbdfs)
+    if not numpy.allclose(resultc, expectc):
+        raise ValueError("Unexpected result; expected: %s; found %s" % \
+                         (str(expectc.reshape(-1)), str(resultc.reshape(-1))))
+
+    # call ferret_compute with uncorrelated data and check the results
+    ferret_compute(0, resultu, resbdf, (inputa, inputu), inpbdfs)
+    if not numpy.allclose(resultu, expectu, atol=0.08):
+        raise ValueError("Unexpected result; expected: %s; found %s" % \
+                         (str(expectu.reshape(-1)), str(resultu.reshape(-1))))
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_stats.py b/pyfermod/stats/stats_stats.py
new file mode 100644
index 0000000..e11e01a
--- /dev/null
+++ b/pyfermod/stats/stats_stats.py
@@ -0,0 +1,106 @@
+"""
+Returns the (unweighted) mean, variance, skew, and kurtoses
+of an array of values
+"""
+import math
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_stats.py Ferret PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 1,
+                "descript": "Returns the (unweighted) mean, variance, skew, and excess kurtosis of an array of values",
+                "axes": axes_values,
+                "argnames": ( "VALUES", ),
+                "argdescripts": ( "Array of values to find the statistical values of", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_stats.py Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 4, 1, "M,V,S,K", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result with the (unweighted) mean, variance, skew, and
+    excess kurtosis of the sample given in inputs[0].  Undefined
+    values in inputs[0] are eliminated before using them in python
+    methods.
+    """
+    # get the clean sample data as a flattened array
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = numpy.array(inputs[0][goodmask], dtype=numpy.float64)
+    # Use the numpy/scipy methods which includes some guards
+    result[:] = resbdf
+    result[0] = numpy.mean(values)
+    result[1] = numpy.var(values)
+    result[2] = scipy.stats.skew(values)
+    result[3] = scipy.stats.kurtosis(values)
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # get a sample of non-normal data
+    ydim = 83
+    zdim = 17
+    samplesize = 1300
+    sample = scipy.stats.weibull_min(2.0, 5.0).rvs(samplesize)
+
+    # use the traditional formulae (reasonable sample)
+    mean = sample.mean()
+    deltas = sample - mean
+    vari = numpy.power(deltas, 2).mean()
+    skew = numpy.power(deltas, 3).mean() / math.pow(vari, 1.5)
+    kurt = (numpy.power(deltas, 4).mean() / math.pow(vari, 2)) - 3.0
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0], dtype=numpy.float64)
+    resbdf = numpy.array([-8888.0], dtype=numpy.float64)
+    input = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    sindex = 0
+    iindex = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if ((iindex % 13) == 3) or (sindex >= samplesize):
+                input[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                input[0, j, k, 0, 0, 0] = sample[sindex]
+                sindex += 1
+            iindex += 1
+    if sindex != samplesize:
+        raise ValueError("Unexpected final sindex of %d (ydim,zdim too small)" % sindex)
+    expected = numpy.array((mean, vari, skew, kurt), dtype=numpy.float64).reshape((4, 1, 1, 1, 1, 1), order='F')
+    result = -7777.0 * numpy.ones((4, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the results
+    ferret_compute(0, result, resbdf, (input, ), inpbdfs)
+    if not numpy.allclose(result, expected):
+        raise ValueError("Unexpected result; expected: %s; found: %s" % \
+                         (str(expected), str(result)))
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_t_cdf.py b/pyfermod/stats/stats_t_cdf.py
new file mode 100644
index 0000000..7625693
--- /dev/null
+++ b/pyfermod/stats/stats_t_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_t_isf.py b/pyfermod/stats/stats_t_isf.py
new file mode 100644
index 0000000..994953b
--- /dev/null
+++ b/pyfermod/stats/stats_t_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_t_pdf.py b/pyfermod/stats/stats_t_pdf.py
new file mode 100644
index 0000000..c4afa18
--- /dev/null
+++ b/pyfermod/stats/stats_t_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_t_ppf.py b/pyfermod/stats/stats_t_ppf.py
new file mode 100644
index 0000000..7ef0cae
--- /dev/null
+++ b/pyfermod/stats/stats_t_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_t_rvs.py b/pyfermod/stats/stats_t_rvs.py
new file mode 100644
index 0000000..b9ead72
--- /dev/null
+++ b/pyfermod/stats/stats_t_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_t_sf.py b/pyfermod/stats/stats_t_sf.py
new file mode 100644
index 0000000..c028e60
--- /dev/null
+++ b/pyfermod/stats/stats_t_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Students-T probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Students-T"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_t_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_t_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_template b/pyfermod/stats/stats_template
new file mode 100644
index 0000000..b121286
--- /dev/null
+++ b/pyfermod/stats/stats_template
@@ -0,0 +1,28 @@
+"""
+Returns the array of <funcreturn>
+for the <distriblongname> probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "<distriblongname>"
+FUNC_NAME = "<funcname>"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_<distribname>_<funcname> Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_<distribname>_<funcname> Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_ttest1.py b/pyfermod/stats/stats_ttest1.py
new file mode 100644
index 0000000..b1f0a2e
--- /dev/null
+++ b/pyfermod/stats/stats_ttest1.py
@@ -0,0 +1,140 @@
+"""
+Performs a two-sided T-test that the provided sample
+comes from a population with the given mean(s).
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_ttest1 PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    axes_values[1] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns [i=1] two-sided T-test stat. and [i=2] prob. " \
+                            "for sample data coming from pop. with given mean(s).",
+                "axes": axes_values,
+                "argnames": ( "SAMPLE", "POPMEANS", ),
+                "argdescripts": ( "Sample data to compare",
+                                  "Proposed population means (averages)", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_ttest1 Ferret PyEF
+    """
+    arglen = 1
+    for axis in ( pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS, 
+                  pyferret.T_AXIS, pyferret.E_AXIS, pyferret.F_AXIS ):
+        axis_info = pyferret.get_axis_info(id, pyferret.ARG2, axis)
+        num = axis_info.get("size", -1)
+        if num > 0:
+            arglen *= num
+    # if all axes have undefined lengths, assume it is a single value
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "T,P", False )
+    axis_defs[1] = (1, arglen, 1, "MEAN_INDEX", False)
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a two-sided T-test that the provided sampe comes from a
+    population with the given mean values.  The sample is given in
+    inputs[0] and the mean values are given in inputs[1].  The test
+    statistic value and two-tailed probability are returned in result
+    along the first axis for each mean along the second axis.
+    Undefined data in inputs[0] are removed before performing the test.
+    """
+    # get the valid sample values as 64-bit floats
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    values = numpy.array(inputs[0][goodmask], dtype=numpy.float64)
+    # get the good mean values
+    # need to flatten so the mask is one-dimensional
+    means = inputs[1].reshape(-1)
+    badmask = ( numpy.fabs(means - inpbdfs[1]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(means))
+    goodmask = numpy.logical_not(badmask)
+    means = numpy.array(means[goodmask], dtype=numpy.float64)
+    # perform the test and assign the results
+    fitparams = scipy.stats.ttest_1samp(values, means)
+    result[:] = resbdf
+    # T-test statistics
+    result[0, goodmask, 0, 0, 0, 0] = fitparams[0]
+    # probabilities
+    result[1, goodmask, 0, 0, 0, 0] = fitparams[1]
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Get a random sample from a normal distribution
+    ydim = 200
+    zdim = 150
+    mu = 5.0
+    sigma = 2.0
+    sample = scipy.stats.norm(mu, sigma).rvs(ydim * zdim)
+    means = numpy.linspace(mu - sigma, mu + sigma, 5)
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf  = numpy.array([-7777.0], dtype=numpy.float64)
+    samparr = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    trimsamp = [ ]
+    index = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if (index % 71) == 3:
+                samparr[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                samparr[0, j, k, 0, 0, 0] = sample[index]
+                trimsamp.append(sample[index])
+            index += 1
+
+    # computing each t-stat and p-val individually to check array arg return
+    tvals = [ ]
+    pvals = [ ]
+    for m in means:
+       (t, p) = scipy.stats.ttest_1samp(trimsamp, m)
+       tvals.append(t)
+       pvals.append(p)
+
+    meanarr = inpbdfs[1] * numpy.ones((1, 2, 5, 1, 1, 1), dtype=numpy.float64, order='F')
+    expect = resbdf * numpy.ones((2, 10, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    meanarr[0, 0, 1, 0, 0, 0] = means[0]
+    expect[:, 1, 0, 0, 0, 0] = [ tvals[0], pvals[0] ]
+    meanarr[0, 0, 3, 0, 0, 0] = mu - 0.5 * sigma
+    expect[:, 3, 0, 0, 0, 0] = [ tvals[1], pvals[1] ]
+    meanarr[0, 1, 0, 0, 0, 0] = mu
+    expect[:, 5, 0, 0, 0, 0] = [ tvals[2], pvals[2] ]
+    meanarr[0, 1, 2, 0, 0, 0] = mu + 0.5 * sigma
+    expect[:, 7, 0, 0, 0, 0] = [ tvals[3], pvals[3] ]
+    meanarr[0, 1, 4, 0, 0, 0] = mu + sigma
+    expect[:, 9, 0, 0, 0, 0] = [ tvals[4], pvals[4] ]
+    result = -6666.0 * numpy.ones((2, 10, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the results
+    ferret_compute(0, result, resbdf, (samparr, meanarr), inpbdfs)
+    if not numpy.allclose(result, expect):
+        print "expect[:,:,0,0,0,0]:\n   %s" % str(expect[:, :, 0, 0, 0, 0])
+        print "result[:,:,0,0,0,0]:\n   %s" % str(result[:, :, 0, 0, 0, 0])
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_ttest2ind.py b/pyfermod/stats/stats_ttest2ind.py
new file mode 100644
index 0000000..68f486e
--- /dev/null
+++ b/pyfermod/stats/stats_ttest2ind.py
@@ -0,0 +1,129 @@
+"""
+Performs a two-sided T-test that two independent samples
+come from (normal) distributions with the same mean.
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_ttest2ind PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns two-sided T-test stat. and prob. that two independent " \
+                            "samples comes from (normal) distribs. with the same mean",
+                "axes": axes_values,
+                "argnames": ( "SAMPLEA", "SAMPLEB", ),
+                "argdescripts": ( "First sample data array",
+                                  "Second sample data array", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_ttest2ind Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 2, 1, "T,P", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a two-sided T-test that two independent samples come from
+    (normal) distributions with the same mean.  The samples are given
+    in inputs[0] and inputs[1].  The test statistic value and two-tailed
+    probability are returned in result.  Undefined data given in each
+    sample are removed (independently from each other) before performing
+    the test.  Note that the samples do not need to be the same size;
+    thus there are no restrictions on the relative dimensions of sample
+    arrays.
+    """
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    sampa = inputs[0][goodmask]
+    badmask = ( numpy.fabs(inputs[1] - inpbdfs[1]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[1]))
+    goodmask = numpy.logical_not(badmask)
+    sampb = inputs[1][goodmask]
+    fitparams = scipy.stats.ttest_ind(sampa, sampb)
+    result[:] = resbdf
+    # T-test statistic
+    result[0] = fitparams[0]
+    # probability
+    result[1] = fitparams[1]
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get random samples from normal distribution
+    # with the same mean and with a different mean
+    ydima = 250
+    zdima = 150
+    sampa = scipy.stats.norm(5.0,2.0).rvs(ydima * zdima)
+    ydimb = 175
+    zdimb = 75
+    sampb = scipy.stats.norm(5.0,0.5).rvs(ydimb * zdimb)
+    sampu = scipy.stats.norm(5.5,0.5).rvs(ydimb * zdimb)
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    arraya = numpy.empty((1, ydima, zdima, 1, 1, 1), dtype=numpy.float64, order='F')
+    arrayb = numpy.empty((ydimb, 1, 1, zdimb, 1, 1), dtype=numpy.float64, order='F')
+    arrayu = numpy.empty((ydimb, 1, 1, zdimb, 1, 1), dtype=numpy.float64, order='F')
+    index = 0
+    for j in xrange(ydima):
+        for k in xrange(zdima):
+            if (index % 23) == 3:
+                arraya[0, j, k, 0, 0, 0] = inpbdfs[0]
+            else:
+                arraya[0, j, k, 0, 0, 0] = sampa[index]
+            index += 1
+    index = 0
+    for j in xrange(ydimb):
+        for k in xrange(zdimb):
+            if (index % 53) == 3:
+                arrayb[j, 0, 0, k, 0, 0] = inpbdfs[1]
+                arrayu[j, 0, 0, k, 0, 0] = inpbdfs[1]
+            else:
+                arrayb[j, 0, 0, k, 0, 0] = sampb[index]
+                arrayu[j, 0, 0, k, 0, 0] = sampu[index]
+            index += 1
+    resultb = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    resultu = -6666.0 * numpy.ones((2, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute with the samples from distribs with the same mean and check
+    ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+    resultb = resultb.reshape(-1)
+    print "result from same mean: %s" % str(resultb)
+    if (abs(resultb[0]) > 2.0) or \
+       (resultb[1] <  0.1) or (resultb[1] > 1.0):
+        raise ValueError("Unexpected result")
+
+    # call ferret_compute with the samples from distribs with different means and check
+    ferret_compute(0, resultu, resbdf, (arraya, arrayu), inpbdfs)
+    resultu = resultu.reshape(-1)
+    print "result from diff mean: %s" % str(resultu)
+    if (resultu[0] > -20.0) or \
+       (resultu[1] < 0.0) or (resultu[1] > 1.0E-5):
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_ttest2rel.py b/pyfermod/stats/stats_ttest2rel.py
new file mode 100644
index 0000000..8fae395
--- /dev/null
+++ b/pyfermod/stats/stats_ttest2rel.py
@@ -0,0 +1,138 @@
+"""
+Performs a two-sided T-test that two related (paired) samples
+come from (normal) distributions with the same mean.
+"""
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_ttest2rel PyEF
+    """
+    axes_values = [ pyferret.AXIS_DOES_NOT_EXIST ] * pyferret.MAX_FERRET_NDIM
+    axes_values[0] = pyferret.AXIS_CUSTOM
+    false_influences = [ False ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 2,
+                "descript": "Returns two-sided T-test stat. and prob. (and num good pairs) that two " \
+                            "related (paired) samples comes from (normal) distribs. with the same mean.",
+                "axes": axes_values,
+                "argnames": ( "SAMPLEA", "SAMPLEB", ),
+                "argdescripts": ( "First sample data array",
+                                  "Second sample data array", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, pyferret.FLOAT_ARRAY, ),
+                "influences": ( false_influences, false_influences, ),
+              }
+    return retdict
+
+
+def ferret_custom_axes(id):
+    """
+    Define custom axis of the stats_ttest2rel Ferret PyEF
+    """
+    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
+    axis_defs[0] = ( 1, 3, 1, "T,P,N", False )
+    return axis_defs
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Performs a two-sided T-test that two related (paired) samples come
+    from (normal) distributions with the same mean.  The samples are
+    given in inputs[0] and inputs[1].  The test statistic value, two-
+    tailed probability, and number of good pairs are returned in result.
+    Sample pairs with undefined data in either element are removed prior
+    to testing.  The samples must either have the same shape or both
+    have a single defined non-sigular axis of the same size.
+    """
+    if inputs[0].shape != inputs[1].shape :
+        shp0 = inputs[0].squeeze().shape
+        shp1 = inputs[1].squeeze().shape
+        if (len(shp0) > 1) or (len(shp1) > 1) or (shp0 != shp1):
+            raise ValueError("SAMPLEA and SAMPLEB must either have identical dimensions or "\
+                             "both have only one defined non-singular axis of the same length")
+    sampa = inputs[0].reshape(-1)
+    sampb = inputs[1].reshape(-1)
+    bada = ( numpy.fabs(sampa - inpbdfs[0]) < 1.0E-5 )
+    bada = numpy.logical_or(bada, numpy.isnan(sampa))
+    badb = ( numpy.fabs(sampb - inpbdfs[1]) < 1.0E-5 )
+    badb = numpy.logical_or(badb, numpy.isnan(sampb))
+    goodmask = numpy.logical_not(numpy.logical_or(bada, badb))
+    valsa = numpy.array(sampa[goodmask], dtype=numpy.float64)
+    numpts = len(valsa)
+    if numpts < 2:
+        raise ValueError("Not enough defined points in common in SAMPLEA and SAMPLEB")
+    valsb = numpy.array(sampb[goodmask], dtype=numpy.float64)
+    fitparams = scipy.stats.ttest_rel(valsa, valsb)
+    result[:] = resbdf
+    # T-test statistic
+    result[0] = fitparams[0]
+    # probability
+    result[1] = fitparams[1]
+    # number of good points
+    result[2] = numpts
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init and ferret_custom_axes do not have problems
+    info = ferret_init(0)
+    info = ferret_custom_axes(0)
+
+    # Get a random sample from a normal distribution
+    size = 200
+    mu = 5.0
+    sigma = 2.0
+    sampa = scipy.stats.norm(mu, sigma).rvs(size)
+    # Create a paired sample with the same mean
+    sampb = sampa + scipy.stats.norm(0.0, sigma).rvs(size)
+    # Create a paired sample with a different mean
+    sampu = sampa + 0.01 * sigma
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0, -8888.0], dtype=numpy.float64)
+    resbdf = numpy.array([-7777.0], dtype=numpy.float64)
+    arraya = numpy.empty((1, size, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    arrayb = numpy.empty((1, 1, size, 1, 1, 1), dtype=numpy.float64, order='F')
+    arrayu = numpy.empty((1, 1, size, 1, 1, 1), dtype=numpy.float64, order='F')
+    numgood = 0
+    for j in xrange(size):
+        if (j % 23) == 3:
+            arraya[0, j, 0, 0, 0, 0] = inpbdfs[0]
+        else:
+            arraya[0, j, 0, 0, 0, 0] = sampa[j]
+        if (j % 52) == 3:
+            arrayb[0, 0, j, 0, 0, 0] = inpbdfs[1]
+            arrayu[0, 0, j, 0, 0, 0] = inpbdfs[1]
+        else:
+            arrayb[0, 0, j, 0, 0, 0] = sampb[j]
+            arrayu[0, 0, j, 0, 0, 0] = sampu[j]
+        if ((j % 23) != 3) and ((j % 52) != 3):
+            numgood += 1
+    resultb = -6666.0 * numpy.ones((3, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+    resultu = -6666.0 * numpy.ones((3, 1, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute with the samples with the same mean and check
+    ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+    resultb = resultb.reshape(-1)
+    print "result from same mean:\n   %s" % str(resultb)
+    if (abs(resultb[0]) > 2.0) or \
+       (resultb[1] < 0.1) or (resultb[1] > 1.0) or \
+       (abs(resultb[2] - numgood) > 1.0E-5):
+        raise ValueError("Unexpected result")
+
+    # call ferret_compute with samples with different means and check
+    ferret_compute(0, resultu, resbdf, (arraya, arrayu), inpbdfs)
+    resultu = resultu.reshape(-1)
+    print "result from diff mean:\n   %s" % str(resultu)
+    if (resultu[0] > -2000.0) or \
+       (resultu[1] < 0.00) or (resultu[1] > 0.0001) or \
+       (abs(resultb[2] - numgood) > 1.0E-5):
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/pyfermod/stats/stats_uniform_cdf.py b/pyfermod/stats/stats_uniform_cdf.py
new file mode 100644
index 0000000..4bc158e
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_uniform_isf.py b/pyfermod/stats/stats_uniform_isf.py
new file mode 100644
index 0000000..d8f1621
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_uniform_pdf.py b/pyfermod/stats/stats_uniform_pdf.py
new file mode 100644
index 0000000..dfd36f0
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_uniform_ppf.py b/pyfermod/stats/stats_uniform_ppf.py
new file mode 100644
index 0000000..4844239
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_uniform_rvs.py b/pyfermod/stats/stats_uniform_rvs.py
new file mode 100644
index 0000000..37d9f2d
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_uniform_sf.py b/pyfermod/stats/stats_uniform_sf.py
new file mode 100644
index 0000000..b279066
--- /dev/null
+++ b/pyfermod/stats/stats_uniform_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Uniform probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Uniform"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_uniform_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_uniform_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_cdf.py b/pyfermod/stats/stats_weibull_cdf.py
new file mode 100644
index 0000000..22df4fd
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_cdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of cumulative density function values
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "cdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_cdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_cdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_isf.py b/pyfermod/stats/stats_weibull_isf.py
new file mode 100644
index 0000000..89683b7
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_isf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of inverse survival function values
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "isf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_isf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_isf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_pdf.py b/pyfermod/stats/stats_weibull_pdf.py
new file mode 100644
index 0000000..21ffc0f
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_pdf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of probability distribution function values
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "pdf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_pdf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_pdf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_ppf.py b/pyfermod/stats/stats_weibull_ppf.py
new file mode 100644
index 0000000..5be0492
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_ppf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of percent point function values
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "ppf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_ppf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_ppf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_rvs.py b/pyfermod/stats/stats_weibull_rvs.py
new file mode 100644
index 0000000..983d834
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_rvs.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of random variates
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "rvs"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_rvs Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_rvs Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_weibull_sf.py b/pyfermod/stats/stats_weibull_sf.py
new file mode 100644
index 0000000..99b608a
--- /dev/null
+++ b/pyfermod/stats/stats_weibull_sf.py
@@ -0,0 +1,28 @@
+"""
+Returns the array of survival function values
+for the Weibull probability distribution
+using the given arrays for the abscissa or template
+values and each of the parameters values.
+"""
+import numpy
+import pyferret
+import pyferret.stats
+
+DISTRIB_NAME = "Weibull"
+FUNC_NAME = "sf"
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_weibull_min_sf Ferret PyEF
+    """
+    return pyferret.stats.getinitdict(DISTRIB_NAME, FUNC_NAME)
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Result array assignment for the stats_weibull_min_sf Ferret PyEF
+    """
+    pyferret.stats.assignresultsarray(DISTRIB_NAME, FUNC_NAME,
+                                      result, resbdf, inputs, inpbdfs)
+
diff --git a/pyfermod/stats/stats_zscore.py b/pyfermod/stats/stats_zscore.py
new file mode 100644
index 0000000..a324e52
--- /dev/null
+++ b/pyfermod/stats/stats_zscore.py
@@ -0,0 +1,91 @@
+"""
+Returns the array of standard scores for an array of data.  The
+standard score are for the standard distribution centered of the
+mean value of the data with the same variance as the data.
+"""
+import math
+import numpy
+import pyferret
+import scipy.stats
+
+
+def ferret_init(id):
+    """
+    Initialization for the stats_zscore PyEF
+    """
+    axes_values = [ pyferret.AXIS_IMPLIED_BY_ARGS ] * pyferret.MAX_FERRET_NDIM
+    true_influences = [ True ] * pyferret.MAX_FERRET_NDIM
+    retdict = { "numargs": 1,
+                "descript": "Returns standard scores for data values relative to " \
+                            "a normal distribution with same mean and variance as the data",
+                "axes": axes_values,
+                "argnames": ( "VALUES", ),
+                "argdescripts": ( "Array of data values", ),
+                "argtypes": ( pyferret.FLOAT_ARRAY, ),
+                "influences": ( true_influences, ),
+              }
+    return retdict
+
+
+def ferret_compute(id, result, resbdf, inputs, inpbdfs):
+    """
+    Assigns result standard scores of data values given in inputs[0]
+    relative to a normal distribution with the same mean and variance
+    as the data.  For undefined data values, the result value will
+    be undefined.
+    """
+    badmask = ( numpy.fabs(inputs[0] - inpbdfs[0]) < 1.0E-5 )
+    badmask = numpy.logical_or(badmask, numpy.isnan(inputs[0]))
+    goodmask = numpy.logical_not(badmask)
+    result[badmask] = resbdf
+    # convert to 64-bit for precision in calculating the mean and variance
+    sample = numpy.array(inputs[0][goodmask], dtype=numpy.float64)
+    # array[goodmask] is a flattened array
+    result[goodmask] = scipy.stats.zscore(sample)
+
+
+#
+# The rest of this is just for testing this module at the command line
+#
+if __name__ == "__main__":
+    # make sure ferret_init does not have problems
+    info = ferret_init(0)
+
+    # Get a random sample and the expected standard scores
+    ydim = 83
+    zdim = 17
+    samplesize = 1300
+    sample = scipy.stats.norm(5.0, 2.0).rvs(samplesize)
+    zscores = (sample - sample.mean()) / math.sqrt(sample.var(0))
+
+    # setup for the call to ferret_compute
+    inpbdfs = numpy.array([-9999.0], dtype=numpy.float64)
+    resbdf = numpy.array([-8888.0], dtype=numpy.float64)
+    input = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    expected = numpy.empty((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+    sindex = 0
+    iindex = 0
+    for j in xrange(ydim):
+        for k in xrange(zdim):
+            if ((iindex % 13) == 3) or (sindex >= samplesize):
+                input[0, j, k, 0, 0, 0] = inpbdfs[0]
+                expected[0, j, k, 0, 0, 0] = resbdf
+            else:
+                input[0, j, k, 0, 0, 0] = sample[sindex]
+                expected[0, j, k, 0, 0, 0] = zscores[sindex]
+                sindex += 1
+            iindex += 1
+    if sindex != samplesize:
+        raise ValueError("Unexpected final sindex of %d (ydim,zdim too small)" % sindex)
+    result = -7777.0 * numpy.ones((1, ydim, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+
+    # call ferret_compute and check the results
+    ferret_compute(0, result, resbdf, (input, ), inpbdfs)
+    if not numpy.allclose(result, expected, rtol=2.0E-7, atol=2.0E-7):
+        print "expected (flattened) =\n%s" % str(expected.reshape(-1, order='F'))
+        print "result (flattened) =\n%s" % str(result.reshape(-1, order='F'))
+        raise ValueError("Unexpected result")
+
+    # All successful
+    print "Success"
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..8e133c8
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,184 @@
+from numpy.distutils.core import setup, Extension
+import distutils.sysconfig
+import sys
+import os
+import os.path
+
+# (Non-standard) Directories containing .h include files
+incdir_list = [ "pyfermod",
+                os.path.join("fer", "common"),
+                os.path.join("fmt", "cmn"),
+                os.path.join("fer", "ef_utility"),
+                os.path.join("fer", "grdel"), ]
+
+# NETCDF4_LIBDIR must be given, either for the static library or the shared-object library
+netcdf4_libdir = os.getenv("NETCDF4_LIBDIR")
+if netcdf4_libdir:
+    netcdf4_libdir = netcdf4_libdir.strip()
+if not netcdf4_libdir:
+    raise ValueError("Environment variable NETCDF4_LIBDIR is not defined")
+# HDF5_LIBDIR is only given if the HDF5 and NetCDF libraries are to be statically linked in
+hdf5_libdir = os.getenv("HDF5_LIBDIR")
+if hdf5_libdir:
+    hdf5_libdir = hdf5_libdir.strip()
+# CAIRO_LIBDIR is only given if the cairo library is to be statically linked in
+cairo_libdir = os.getenv("CAIRO_LIBDIR")
+if cairo_libdir:
+    cairo_libdir = cairo_libdir.strip()
+# The location of libpython2.x.so, in case it is not in a standard location
+python_libdir = os.path.split(
+                   distutils.sysconfig.get_python_lib(standard_lib=True))[0]
+# The list of additional directories to examine for libraries
+libdir_list = [ "lib", netcdf4_libdir, ]
+if hdf5_libdir:
+    libdir_list.append(hdf5_libdir)
+if cairo_libdir:
+    libdir_list.append(cairo_libdir)
+libdir_list.append(python_libdir)
+
+# Get the list of ferret static libraries
+# Stripping off the "lib" prefix and the ".a" suffix
+fer_lib_list = [ ]
+for libname in os.listdir("lib"):
+    if (libname[:3] == "lib") and (libname[-2:] == ".a"):
+        fer_lib_list.append(libname[3:-2])
+# Create the list of libraries to link
+# fer_lib_list is included multiple times to resolve interdependencies
+lib_list = fer_lib_list[:]
+lib_list.extend(fer_lib_list)
+lib_list.extend(fer_lib_list)
+lib_list.extend(fer_lib_list)
+lib_list.extend(fer_lib_list)
+# Add required system libraries to the list to link in
+lib_list.append("python%i.%i" % sys.version_info[:2])
+
+# Linking in the rest of the system libraries were moved to addn_link_flags
+# in order to make sure the appropriate netcdff, netcdf, hdf5_hl, hdf5, and
+# cairo libraries are used.
+#
+# lib_list.extend( ( "netcdff", "netcdf", "hdf5_hl", "hdf5",
+#                    "cairo", "gfortran", "curl", "z", "dl", "m", ) )
+
+# Link to the appropriate netcdf libraries.
+# The hdf5 libraries are only used to resolve netcdf library function
+# calls when statically linking in the netcdf libraries.
+if hdf5_libdir:
+    netcdff_lib = "-Wl," + os.path.join(netcdf4_libdir, "libnetcdff.a")
+    netcdf_lib = "-Wl," + os.path.join(netcdf4_libdir, "libnetcdf.a")
+    hdf5_hl_lib = "-Wl," + os.path.join(hdf5_libdir, "libhdf5_hl.a")
+    hdf5_lib = "-Wl," + os.path.join(hdf5_libdir, "libhdf5.a")
+    addn_link_args = [ netcdff_lib, netcdf_lib, hdf5_hl_lib, hdf5_lib, ]
+else:
+    addn_link_args = [ "-lnetcdff", "-lnetcdf", ]
+
+# The Pango text-rendering libraries
+addn_link_args.extend([ "-lpangocairo-1.0", "-lpango-1.0", "-lgobject-2.0" ])
+
+# Link to the appropriate cairo library.
+# The pixman-1, freetype, fontconfig, png12, Xrender, and X11 libraries
+# are only used to resolve cairo library function calls when statically
+# linking in the cairo-1.8.8 library.
+if cairo_libdir:
+    cairo_lib = "-Wl," + os.path.join(cairo_libdir, "libcairo.a")
+    addn_link_args.extend([ cairo_lib, "-lpixman-1", "-lfreetype",
+                            "-lfontconfig", "-lpng12", "-lXrender", 
+                            "-lX11", ])
+else:
+   addn_link_args.append("-lcairo")
+
+# Link in the appropriate system libraries 
+if hdf5_libdir:
+   addn_link_args.append("-lcurl -lz")
+addn_link_args.extend([ "-lgfortran", "-ldl", "-lm", "-fPIC", ])
+
+# Get the list of C source files in pyfermod
+src_list = [ ]
+for srcname in os.listdir("pyfermod"):
+    if srcname[-2:] == ".c":
+        src_list.append(os.path.join("pyfermod", srcname))
+
+# Get the list of additional objects to be linked in
+addnobjs_list = [ ]
+dirname = os.path.join("fer", "ef_utility")
+for srcname in os.listdir(dirname):
+    if srcname[-2:] == ".o":
+        addnobjs_list.append(os.path.join(dirname, srcname))
+dirname = os.path.join("fer", "special")
+for srcname in ( "fakes3.o", "ferret_dispatch.o", "ferret_query_f.o",
+                 "gui_fakes.o", "linux_routines.o", ):
+    addnobjs_list.append(os.path.join(dirname, srcname))
+for srcname in os.listdir(dirname):
+    if (srcname[0] == 'x') and (srcname[-7:] == "_data.o"):
+        addnobjs_list.append(os.path.join(dirname, srcname))
+
+# Create the pyferret.libpyferret Extension
+ext_mods = [ Extension("pyferret.libpyferret", include_dirs = incdir_list,
+                                               sources = src_list,
+                                               extra_objects = addnobjs_list,
+                                               library_dirs = libdir_list,
+                                               libraries = lib_list,
+                                               extra_link_args = addn_link_args), ]
+
+pyferret_version = os.getenv("PYFERRET_VERSION")
+if pyferret_version == None:
+    raise ValueError("Environment variable PYFERRET_VERSION is not defined")
+
+# Configure the setup
+setup(name = "pyferret",
+      version = pyferret_version,
+      description = "Python module providing Ferret functionality",
+      long_description = "Python module providing Ferret functionality",
+      author = "Karl M. Smith",
+      author_email = "karl.smith at noaa.gov",
+      url = "http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret",
+      license = "Public Domain",
+      requires = [ "numpy", ],
+      packages = [ "pyferret", "pyferret.eofanal", "pyferret.fershp",
+                   "pyferret.graphbind", "pyferret.regrid", "pyferret.stats", ],
+      package_dir = { "pyferret":"pyfermod", },
+      ext_modules = ext_mods)
+
+setup(name = "pipedviewer",
+      version = "1.0.1",
+      description = "Graphics viewer controlled by a command pipe",
+      long_description = "A graphics viewer application that receives its " \
+                         "drawing and other commands primarily from another " \
+                         "application through a pipe.  A limited number of " \
+                         "commands are provided by the viewer itself to allow " \
+                         "saving and some manipulation of the displayed scene.  " \
+                         "The controlling application, however, will be unaware " \
+                         "of these modifications made to the scene.",
+      author = "Karl M. Smith",
+      author_email = "karl.smith at noaa.gov",
+      url = "http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret",
+      license = "Public Domain",
+      requires = [ "multiprocessing", ],
+      packages = [ "pipedviewer", ],
+      package_dir = { "pipedviewer":"pviewmod", })
+
+setup(name = "gcircle",
+      version = "0.0.1",
+      description = "Module of functions involving great circles with " \
+                    "points given in longitudes and latitudes (thus " \
+                    "assuming a spheroid model of the earth).",
+      long_description = "Module of functions involving great circles with " \
+                         "points given in longitudes and latitudes (thus " \
+                         "assuming a spheroid model of the earth).",
+      author = "Karl M. Smith",
+      author_email = "karl.smith at noaa.gov",
+      url = "http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret",
+      license = "Public Domain",
+      requires = [ "numpy", ],
+      py_modules = [ "gcircle", ])
+
+setup(name = "ferretmagic",
+      version = pyferret_version,
+      description = "iPython notebook extension for PyFerret",
+      long_description = "iPython notebook extension for PyFerret " \
+                         "updated for this version of PyFerret.",
+      author = "Patrick Brockmann, Karl M. Smith",
+      url = "https://github.com/PBrockmann/ipython-ferretmagic",
+      license = "Public Domain",
+      requires = [ "pyferret", ],
+      py_modules = [ "ferretmagic", ])
+
diff --git a/site_specific.mk b/site_specific.mk
new file mode 100644
index 0000000..9479ceb
--- /dev/null
+++ b/site_specific.mk
@@ -0,0 +1,74 @@
+## Site-dependent definitions included in Makefiles
+## Also verify the values in external_functions/ef_utility/site_specific.mk
+
+## Full path name of the directory containing this file (the ferret root directory).
+## Do not use $(shell pwd) since this is included in Makefiles in other directories.
+DIR_PREFIX	= $(HOME)/pyferret-1.0.2-source
+
+## Machine type for which to build Ferret/PyFerret
+##   x86_64-linux      for 64-bit RHEL
+##   x86_64-linux-gnu  for 64-bit Ubuntu and many "free" Linux systems
+##   i386-linux        for 32-bit RHEL
+##   i386-linux-gnu    for 32-bit Ubuntu and many "free" Linux systems
+##   i386-apple-darwin for MacOS
+BUILDTYPE	= $(HOSTTYPE)
+# BUILDTYPE	= x86_64-linux
+# BUILDTYPE	= x86_64-linux-gnu
+# BUILDTYPE	= i386-linux
+# BUILDTYPE	= i386-linux-gnu
+# BUILDTYPE	= i386-apple-darwin
+# BUILDTYPE	= intel-mac
+
+## Python 2.x executable to invoke for build and install.
+PYTHON_EXE	= python2.6
+# PYTHON_EXE	= python2.7
+## The assignment of PYTHONINCDIR should not need any modifications
+PYTHONINCDIR   := $(shell $(PYTHON_EXE) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()")
+
+## Installation directory for built Ferret.  Using the "install"
+## Makefile target circumvents the need to create the fer_*.tar.gz
+## files just for creating a Ferret installation.
+INSTALL_FER_DIR	= $(FER_DIR)
+
+## Installation directory for Cairo-1.8.8 static libraries
+## (contains include and lib or lib64 subdirectories) for RHEL5.
+## Do not give a location on other systems.  For these systems
+## the system-wide shared-object Cairo libraries which are also
+## used by Qt4 must be used.
+# CAIRO_DIR	=
+CAIRO_DIR	= /usr/local/cairo_188
+
+## Installation directory for HDF5 static libraries
+## (contains include and lib or lib64 subdirectories)
+## Do not give a location if linking to netcdf shared-object libraries
+# HDF5_DIR	= /usr
+# HDF5_DIR	= /usr/local
+HDF5_DIR	= /usr/local/hdf5_189
+# HDF5_DIR	= /usr/local/hdf5-1.8.9
+# HDF5_DIR	= 
+
+## Installation directory for NetCDF static or shared object libraries
+## (contains include and lib or lib64 subdirectories)
+## If HDF5_DIR (above) is empty, the shared-object netcdf libraries will be used.
+# NETCDF4_DIR	= /usr
+# NETCDF4_DIR	= /usr/local
+NETCDF4_DIR	= /usr/local/netcdf_4311
+# NETCDF4_DIR	= /usr/local/netcdf-4.3.1.1
+
+## Java home directory - this may be predefined
+## from your shell environment.  If JAVA_HOME is defined,
+## $(JAVA_HOME)/bin/javac and $(JAVA_HOME)/bin/jar is
+## called to build threddsBrowser.jar; otherwise, it just
+## uses javac and jar (from the path).
+# JAVA_HOME	= /usr/java/default
+# JAVA_HOME	= /usr/java/latest
+# JAVA_HOME	= /usr/lib/jvm/default-java
+# JAVA_HOME	= /usr/lib/jvm/java-oracle
+# JAVA_HOME	= /usr/lib/jvm/java-sun
+JAVA_HOME	= /usr/lib/jvm/java
+# JAVA_HOME	= /Library/Java/JavaVirtualMachines/jdk1.7.jdk/Contents/Home
+
+# PyFerret version number - do not change this
+PYFERRET_VERSION = 1.0.2
+
+##
diff --git a/threddsBrowser/.classpath b/threddsBrowser/.classpath
new file mode 100644
index 0000000..ce52bc4
--- /dev/null
+++ b/threddsBrowser/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="unittests"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="lib" path="toolsUI/toolsUI-4.1.jar" sourcepath="/home/porter/ksmith/workspace/netcdf-java-4.1/src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/threddsBrowser/.project b/threddsBrowser/.project
new file mode 100644
index 0000000..9fbe662
--- /dev/null
+++ b/threddsBrowser/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ThreddsBrowser</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/threddsBrowser/.settings/org.eclipse.jdt.core.prefs b/threddsBrowser/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..31c5aed
--- /dev/null
+++ b/threddsBrowser/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sun Jun 20 10:12:34 PDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/threddsBrowser/.settings/scoped_pref_store.prefs b/threddsBrowser/.settings/scoped_pref_store.prefs
new file mode 100644
index 0000000..db2da74
--- /dev/null
+++ b/threddsBrowser/.settings/scoped_pref_store.prefs
@@ -0,0 +1,3 @@
+#Mon Jun 21 09:17:18 PDT 2010
+EnableVPG=false
+eclipse.preferences.version=1
diff --git a/threddsBrowser/Makefile b/threddsBrowser/Makefile
new file mode 100644
index 0000000..ff138eb
--- /dev/null
+++ b/threddsBrowser/Makefile
@@ -0,0 +1,31 @@
+#
+# Makefile for creating threddsBrowser.jar
+#
+
+#
+# For the possible definition of JAVA_HOME
+#
+include ../site_specific.mk
+
+TOOLSUI_JAR = toolsUI/toolsUI-4.1.jar
+
+JAVA_SOURCE_FILES = $(wildcard src/gov/noaa/pmel/ferret/threddsBrowser/*.java)
+
+.PHONY : all
+all : threddsBrowser.jar
+
+.PHONY : clean
+clean : 
+	rm -fr threddsBrowser.jar bin
+
+threddsBrowser.jar : $(JAVA_SOURCE_FILES) Makefile
+	rm -fr threddsBrowser.jar bin
+	mkdir bin
+ifdef JAVA_HOME
+	$(JAVA_HOME)/bin/javac -sourcepath src -classpath bin:$(TOOLSUI_JAR) -d bin $(JAVA_SOURCE_FILES)
+	$(JAVA_HOME)/bin/jar cf threddsBrowser.jar -C bin gov/noaa/pmel/ferret/threddsBrowser
+else
+	javac -sourcepath src -classpath bin:$(TOOLSUI_JAR) -d bin $(JAVA_SOURCE_FILES)
+	jar cf threddsBrowser.jar -C bin gov/noaa/pmel/ferret/threddsBrowser
+endif
+
diff --git a/threddsBrowser/README b/threddsBrowser/README
new file mode 100644
index 0000000..7f97a65
--- /dev/null
+++ b/threddsBrowser/README
@@ -0,0 +1,23 @@
+
+This is an Eclipse Java project directory, thus the reason for
+the .classpath and .project files, and .settings directory.
+The Makefile was created to mimic the standard Eclipse build,
+thus the reason for the separate src and bin directory trees.
+
+To successfully create threddsBrowser.jar using Makefile,
+the environment variable JAVA_HOME needs to be defined as
+the location of a Java 6 Development Kit.
+
+Also, the toolsUI jar file given by TOOLSUI_JAR in
+Makefile needs to be present.  The latest release version
+of the toolsUI jar file can be downloaded from
+    http://www.unidata.ucar.edu/software/netcdf-java/
+
+The resulting threddsBrowser.jar as well as the toolsUI
+jar file need to be put into the $FER_LIBS directory (or
+the $FER_DIR/lib directory for older versions of ferret).
+The toolsUI jar file is accessed using the name toolsUI.jar,
+so, if not already given by this name, add a symbolic link
+named toolsUI.jar pointing to the actual toolsUI jar file:
+    ln -s <actual_name> toolsUI.jar
+
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/BrowserDefaults.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/BrowserDefaults.java
new file mode 100644
index 0000000..89a39f3
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/BrowserDefaults.java
@@ -0,0 +1,302 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.awt.Dimension;
+import java.io.File;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import ucar.util.prefs.PreferencesExt;
+
+/**
+ * Default settings for a ThreddsBrowser
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class BrowserDefaults {
+
+	/** XMLStore key for a Dimension giving the size of the browser JPanel */
+	public static final String BROWSER_SIZE = "BrowserSize";
+
+	/** XMLStore key for an int giving the location of the divider between the tree viewer and the HTML viewer */
+	public static final String DIVIDER_LOCATION = "DividerLocation";
+
+	/** XMLStore key for a String giving a space/comma/semicolon separated list of acceptable filename extensions for local datasets */ 
+	public static final String DATASET_FILENAME_EXTENSIONS = "DatasetFilenameExtensions";
+
+	/** XMLStore key for a String given the default directory for the local directory file chooser */
+	public static final String LOCAL_BROWSE_DIRNAME = "LocalBrowseDirname";
+
+	/** XMLStore key for a List of Strings giving locations for the drop-down list */
+	public static final String LOCATION_STRINGS_LIST = "LocationStringsList";
+
+	/** Initial Strings for the drop-down list of locations */
+	private Collection<String> locations;
+
+	/** Location of the split pane divider */
+	private int dividerLocation;
+
+	/** Initial directory of the local browse file chooser */ 
+	private File localBrowseDir;
+
+	/** String of acceptable filename extensions for datasets */
+	private String extensionsString;
+
+	/** Size of the ThreddsBrowser */
+	private Dimension browserSize;
+	
+	/**
+	 * Get the defaults for ThreddsBrowser from the given preferences and the initial
+	 * locations environment variable.
+	 * A location String will appear only once in the locations collection and 
+	 * will be in the order when they first appear:
+	 * <ol>
+	 * <li> in the locations list saved in stored preferences </li>
+	 * <li> in the value of the locations environment variable</li>
+	 * </ol>
+	 * @param prefs the stored preferences; may be null
+	 * @param defLocsEnvName the name of the locations environment variable whose
+	 * value is a space-separated list of possibly-quoted locations; may be null
+	 */
+	public BrowserDefaults(PreferencesExt prefs, String defLocsEnvName) {
+		// Get the list from the store preferences
+		List<String> locationsList = null;
+		if ( prefs != null ) {
+			@SuppressWarnings("unchecked")
+			List<String> locsList = (List<String>) prefs.getList(LOCATION_STRINGS_LIST, null);
+			locationsList = locsList;
+		}
+
+		// Use a LinkedHashSet to maintain ordered single copies of the locations
+		locations = new LinkedHashSet<String>();
+		if ( locationsList != null ) {
+			for (String loc : locationsList) {
+				if ( (loc != null) && ! loc.isEmpty() ) {
+					locations.add(loc);
+				}
+			}
+		}
+
+		// Add locations from the environment variable
+		try {
+			String locsEnvValue = System.getenv(defLocsEnvName);
+			// space separated, possibly double- or single-quoted, values - does not recognize escaping
+			String patStr = "\\s*\"([^\"]*?)\"|\\s*'([^']*?)'|\\s*(\\S*)";
+			Pattern p = Pattern.compile(patStr);
+			Matcher m = p.matcher(locsEnvValue);
+			while ( m.find() ) {
+				String loc = m.group(1);
+				if ( loc == null )
+					loc = m.group(2);
+				if ( loc == null )
+					loc = m.group(3);
+				if ( (loc != null) && ! loc.isEmpty() )
+					locations.add(loc);
+			}
+		} catch (Exception e) {
+			; // nothing to add
+		}
+
+		// Location of the split pane divider 
+		dividerLocation = 400;
+		if ( prefs != null ) {
+			int loc = prefs.getInt(DIVIDER_LOCATION, dividerLocation);
+			if ( loc > 0 ) {
+				dividerLocation = loc;
+			}
+		}
+
+		// Local browse directory
+		localBrowseDir = null;
+		if ( prefs != null ) {
+			String localBrowseDirname = (String) prefs.getBean(LOCAL_BROWSE_DIRNAME, null);
+			if ( localBrowseDirname != null ) {
+				File localDir = new File(localBrowseDirname + File.separator);
+				if ( localDir.isDirectory() ) {
+					localBrowseDir = localDir;
+				}
+			}
+		}
+
+		// String of acceptable filename extensions for displayed datasets
+		extensionsString = "cdf, nc, ncd, des, dat, txt";
+		if ( prefs != null ) {
+			String newStr = (String) prefs.getBean(DATASET_FILENAME_EXTENSIONS, extensionsString);
+			// Make sure the string is in a standard, clean format
+			extensionsString = createExtensionsString(parseExtensionsString(newStr));
+		}
+
+		// Size of the browser
+		browserSize = new Dimension(800, 500);
+		if ( prefs != null ) {
+	    	Dimension size = (Dimension) prefs.getBean(BROWSER_SIZE, browserSize);
+	    	if ( (size.getHeight() > 0.0) && (size.getWidth() > 0.0) ) {
+	    		browserSize = size;
+	    	}
+		}
+	}
+
+	/**
+	 * @return the complete Collection of Strings for the drop-down list of locations 
+	 */
+	public Collection<String> getLocationStrings() {
+		return locations;
+	}
+
+	/**
+	 * @return the location of the split pane divider
+	 */
+	public int getDividerLocation() {
+		return dividerLocation;
+	}
+
+	/**
+	 * @return the initial directory of the local file chooser
+	 */
+	public File getLocalBrowseDir() {
+		return localBrowseDir;
+	}
+
+	/**
+	 * @return the String of acceptable filename extensions for datasets
+	 */
+	public String getExtensionsString() {
+		return extensionsString;
+	}
+
+	/**
+	 * @return the preferred size for the ThreddsBrowser
+	 */
+	public Dimension getBrowserSize() {
+		return browserSize;
+	}
+
+	/**
+	 * Save the initial list of locations string to a PreferencesExt that can be used
+	 * in the construction of a BrowserDefaults object.
+	 * @param prefs save the List of location strings in here.
+	 * @param locationsList the List of location strings to save; cannot be null.
+	 */
+	public static void saveLocationsList(PreferencesExt prefs, List<String> locationsList) {
+		prefs.putList(LOCATION_STRINGS_LIST, locationsList);
+	}
+
+	/**
+	 * Save the split pane divider location to a PerferencesExt that can be used
+	 * in the construction of a BrowserDefaults object.
+	 * @param prefs save the divider location here.
+	 * @param dividerLoc the divider location to save.
+	 */
+	public static void saveDividerLocation(PreferencesExt prefs, int dividerLoc) {
+		prefs.putInt(DIVIDER_LOCATION, dividerLoc);
+	}
+
+	/**
+	 *
+	 * Save the initial directory for the local file chooser to a PerferencesExt 
+	 * that can be used in the construction of a BrowserDefaults object.
+	 * @param prefs save the local directory here.
+	 * @param localDir the local directory to save; can be null.
+	 */
+	public static void saveLocalBrowseDir(PreferencesExt prefs, File localDir) {
+		if ( localDir != null ) {
+			prefs.putBeanObject(LOCAL_BROWSE_DIRNAME, localDir.getPath());
+		}
+	}
+
+	/**
+	 * Save the String of acceptable filename extensions for datasets to a PreferencesExt
+	 * that can be used in the construction of a BrowserDefaults object.
+	 * @param prefs save the filename extensions String here.
+	 * @param extsString the filename extensions String to save; cannot be null.
+	 */
+	public static void saveExtensionsString(PreferencesExt prefs, String extsString) {
+		prefs.putBeanObject(DATASET_FILENAME_EXTENSIONS, extsString);
+	}
+
+	/**
+	 * Save the size of the browser to a PreferencesExt
+	 * that can be used in the construction of a BrowserDefaults object.
+	 * @param prefs save the browser size here.
+	 * @param size the browser size to save; cannot be null.
+	 */
+	public static void saveBrowserSize(PreferencesExt prefs, Dimension size) {
+		prefs.putBeanObject(BROWSER_SIZE, size);
+	}
+
+	/**
+	 * Parses a String of comma/semicolon/space-separated acceptable filename extensions
+	 * for datasets and produces a Collection of the individual extension Strings.
+	 * @param extsString the String of comma/semicolon/space-separated extensions; cannot be null.
+	 * @return a Collection of the acceptable filename extension Strings.  
+	 * Will not be null but may be empty.
+	 */
+	public static Collection<String> parseExtensionsString(String extsString) {
+		// Parse the returned string to get the individual extensions
+		String[] extensions = extsString.split("\\s*[\\s;,]\\s*");
+		LinkedHashSet<String> extsSet = new LinkedHashSet<String>(extensions.length);
+		for (String ext : extensions) {
+			if ( ! ext.isEmpty() ) {
+				extsSet.add(ext);
+			}
+		}
+		return extsSet;
+	}
+
+	/**
+	 * Creates String of comma-space separated acceptable filename extensions for 
+	 * datasets from a Collection of individual extension Strings.
+	 * @param extsColl the Collection of individual extension Strings; cannot be null.
+	 * @return the String of comma-space separated acceptable filename extensions.
+	 * Will not be null but may be empty.
+	 */
+	public static String createExtensionsString(Collection<String> extsColl) {
+		StringBuilder extBuilder = new StringBuilder();
+		boolean first = true;
+		for (String ext : extsColl) {
+			if ( (ext == null) || ext.isEmpty() )
+				continue;
+			if ( first )
+				first = false;
+			else
+				extBuilder.append(", ");
+			extBuilder.append(ext);
+		}
+		return extBuilder.toString();
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ExtensionFileFilter.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ExtensionFileFilter.java
new file mode 100644
index 0000000..05b53d3
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ExtensionFileFilter.java
@@ -0,0 +1,91 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.Collection;
+import java.util.HashSet;
+
+/**
+ * A file filter based on a set of filename extensions
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class ExtensionFileFilter extends HashSet<String> implements FileFilter {
+	private static final long serialVersionUID = -5282011356208993578L;
+
+	/**
+	 * Create a file filter with an empty set of extensions;
+	 * thus all files are accepted.
+	 */
+	public ExtensionFileFilter() {
+	}
+
+	/**
+	 * Create a file filter from the given Collection of extensions.
+	 * If this set of extensions is empty, all files are accepted.
+	 * @param extensionsSet the set of acceptable extensions. 
+	 * Cannot be null.
+	 * The extensions should <b> not </b> contain the '.'
+	 */
+	public ExtensionFileFilter(Collection<String> extensionsSet) {
+		super(extensionsSet);
+	}
+
+	/**
+	 * @return true if fileToCheck is a file with an extension given in 
+	 * the set of extension (if not empty) used to construct this object.
+	 * If that set of extensions is empty, all files are accepted.  
+	 * Hidden files/directories always return false.
+	 * Visible directories always return true.
+	 */
+	@Override
+	public boolean accept(File fileToCheck) {
+		if ( fileToCheck.isHidden() )
+			return false;
+		if ( size() == 0 )
+			return true;
+		if ( fileToCheck.isDirectory() )
+			return true;
+		String name = fileToCheck.getName();
+		int loc = name.lastIndexOf('.') + 1;
+		if ( (loc <= 0) || (loc >= name.length()) )
+			return false;
+		String ext = name.substring(loc);
+		if ( contains(ext) )
+			return true;
+		return false;
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/HTMLViewer.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/HTMLViewer.java
new file mode 100644
index 0000000..03347d2
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/HTMLViewer.java
@@ -0,0 +1,116 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkListener;
+
+/**
+ * Used to display HTML in a scrolled JEditorPane
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class HTMLViewer extends JScrollPane {
+
+	private static final long serialVersionUID = -8436110289990707935L;
+
+	private static final String HTML_HEADER_STRING =
+		"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" +
+		"<html>\n" +
+		"<head>\n" +
+		"<meta http-equiv=\"Content-Type\" content=\"text/html\">\n" +
+		"</head>\n" +
+		"<body>\n";
+
+	private static final String HTML_FOOTER_STRING =
+		"</body>\n" +
+		"</html\n";
+
+	private JEditorPane htmlEditor;
+
+	/**
+	 * Creates this JScrolledPane containing a non-editable JEditorPane
+	 */
+	public HTMLViewer() {
+		// Editor of view HTML description of the selected dataset
+		htmlEditor = new JEditorPane();
+	    htmlEditor.setEditable(false);
+	    setViewportView(htmlEditor);
+	}
+
+	/**
+	 * Adds a hyperlinkListener to the JEditorPane component.
+	 * @see JEditorPane#addHyperlinkListener(HyperlinkListener)
+	 * @param hyperlinkListener the listener to add
+	 */
+	public void addHyperlinkListener(HyperlinkListener hyperlinkListener) {
+		// Just pass this on to the JEditorPane
+		htmlEditor.addHyperlinkListener(hyperlinkListener);
+	}
+
+	/**
+	 * Reset the displayed page to a new empty HTML document.
+	 * This will reset the style sheet to the default.
+	 */
+	public void clearPage() {
+		htmlEditor.setContentType("text/html");
+		htmlEditor.setDocument(htmlEditor.getEditorKit().createDefaultDocument());
+		htmlEditor.setText(HTML_HEADER_STRING + HTML_FOOTER_STRING);
+	}
+
+	/**
+	 * Displays the given string as the body of an HTML page in the current 
+	 * document in the HTMLViwer.  Standard HTML header (up to and including 
+	 * the <body> tag) and footer (the </body> tag and after) tags are added 
+	 * to the given string before displaying. 
+	 */
+	public void showHTMLBodyText(String htmlBodyString) {
+		htmlEditor.setText(HTML_HEADER_STRING + htmlBodyString + HTML_FOOTER_STRING);
+	}
+
+	/**
+	 * Opens and displays the HTML page at the given URL.
+	 * @see JEditorPane#setPage(URL)
+	 * @param url URL of the page to display
+	 * @throws IOException if the JEditorPane thows one
+	 */
+	public void setPage(URL url) throws IOException {
+		// Just pass this on to the JEditorPane
+		htmlEditor.setPage(url);
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirInvDatasetImpl.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirInvDatasetImpl.java
new file mode 100644
index 0000000..8b94483
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirInvDatasetImpl.java
@@ -0,0 +1,68 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import thredds.catalog.InvDatasetImpl;
+
+/**
+ * An InvDatasetImpl that overrides hasNestedDatasets to always return true.
+ * The only purpose of this class is to create an InvDatasetImpl that will
+ * always be shown as a folder in a {@link thredds.catalog.ui.CatalogTreeView}.
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class LocalDirInvDatasetImpl extends InvDatasetImpl {
+
+	/**
+	 * Creates an InvDatsetImpl with null for the dataType and the urlPath.
+	 * The hasNestedDatasets method of this InvDatasetImpl is overridden to
+	 * always return true. 
+	 * @param parent parent dataset
+	 * @param name display name of the dataset
+	 * @param serviceName default service (may be null)
+	 */
+	public LocalDirInvDatasetImpl(InvDatasetImpl parent, String name, String serviceName) {
+		super(parent, name, null, serviceName, null);
+	}
+
+	/**
+	 * Always returns true so this dataset will be displayed as a folder in
+	 * a {@link thredds.catalog.ui.CatalogTreeView}.
+	 * @return true
+	 */
+	@Override
+	public boolean hasNestedDatasets() {
+		return true;
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanMonitor.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanMonitor.java
new file mode 100644
index 0000000..251b291
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanMonitor.java
@@ -0,0 +1,253 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.concurrent.ExecutionException;
+
+import javax.swing.JComponent;
+import javax.swing.ProgressMonitor;
+
+import thredds.catalog.InvCatalogImpl;
+
+/**
+ * A monitor that sets up and runs a LocalDirTreeScanner, displays the scan progress, and fires
+ * off a PropertyChange event when the scan is complete.
+ * 
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class LocalDirTreeScanMonitor extends PropertyChangeSupport implements PropertyChangeListener {
+	private static final long serialVersionUID = 6099749370566968112L;
+
+	/** Maximum length of a truncated path String */
+	private final static int MAX_TRUNCATED_PATH_LENGTH = 60;
+
+	/** root of the local directory tree to scan */
+	File rootDir;
+	/** flag so that the final property change event sent to the ThreddsBrowser is sent only once */
+	boolean completed;
+	/** scanner/catalog builder for the local directory tree */
+	LocalDirTreeScanner scanner;
+	/** dialog for displaying the progress of the scan */
+	ProgressMonitor scanMonitor;
+
+	/**
+	 * Create a LocalDirTreeScanner as well as a ProgressMonitor.  The LocalDirTreeScanner will scan
+	 * and build a catalog for the local directory tree rooted at localDir using datasetFilter as the
+	 * file filter.  The ProgressMonitor will report the progress of this scan.  The scan is started
+	 * (in the background) by calling the runScan method.  A PropertyChange event is fired off to all 
+	 * registered PropertyChangeListeners when the scan is complete.  Possible values for this event are:
+	 * <ul>
+	 * <li> "Done": successful completion; getOldValue returns localDir, getNewValue returns the generated catalog
+	 * <li> "Canceled": scan canceled or interrupted; getOldValue returns localDir, getNewValue returns null 
+	 * 					(if canceled) or the InterruptedException (if interrupted, probably from being canceled)
+	 * <li> "Died": scan threw an exception; getOldValue returns localDir, getNewValue returns the cause of
+	 * 				the ExecutionException (ie, the exception thrown by the scanner) 
+	 * </ul>
+	 * @param parent the parent of the ProgressMonitor
+	 * @param localDir the root of the local directory tree to scan
+	 * @param datasetFilter the file filter for the scan; if null, all files are accepted
+	 * @throws IOException if localDir is not a valid directory
+	 */
+	LocalDirTreeScanMonitor(JComponent parent, File localDir, FileFilter datasetFilter) throws IOException {
+		super(new Object());
+		rootDir = localDir;
+		completed = false;
+		// Create the actual scanner/catalog builder
+		scanner = new LocalDirTreeScanner(rootDir, datasetFilter);
+		// Have the scanner notify us when PropertyChange events are fired off
+		scanner.addPropertyChangeListener(this);
+		// Create a ProgressMonitor to go with the scanner (being a SwingWorker, progress values are [0,100])
+		scanMonitor = new ProgressMonitor(parent, "Examining the local directory:                    ", 
+										  truncatedPathname(rootDir, rootDir, MAX_TRUNCATED_PATH_LENGTH), 0, 100);
+		/*
+		 *  If taking more than 0.5 s, always popup the progress dialog.  Changed from defaults because the progress
+		 *  estimate could easily be quite poor if there are lots of files in the last couple of directories.
+		 */
+		scanMonitor.setMillisToDecideToPopup(500);
+		scanMonitor.setMillisToPopup(500);
+	}
+
+	/**
+	 * Starts a background scan and build of the local directory tree catalog.
+	 */
+	public void runScan() {
+		scanner.execute();
+	}
+
+	/**
+	 * @return the total number of entries in the returned catalog.  If canceled,
+	 * the total number of entries examined prior to cancellation.
+	 */
+	public int getNumCatalogEntries() {
+		return scanner.getNumCatalogEntries();
+	}
+
+	/**
+	 * This gets called when a property changes in the LocalDirTreeScanner 
+	 * (a SwingWorker) or the ProgressMonitor associated with this object.
+	 */
+	@Override
+	public void propertyChange(PropertyChangeEvent evt) {
+		// If already fired off the final property change event just return
+		if ( completed )
+			return;
+
+		// If the scanner has completed, fire off the final property change event
+		if ( scanner.isDone() ) {
+			completed = true;
+			scanMonitor.close();
+			if ( scanner.isCancelled() ) {
+				firePropertyChange("Canceled", rootDir, null);
+			}
+			else {
+				try {
+					InvCatalogImpl catalog = scanner.get();
+					firePropertyChange("Done", rootDir, catalog);
+				} catch (InterruptedException e) {
+					// scanner was interrupted (probably from a cancel)
+					firePropertyChange("Canceled", rootDir, e);
+				} catch (ExecutionException e) {
+					// scanner threw an exception
+					firePropertyChange("Died", rootDir, e.getCause());
+				}
+			}
+			return;
+		}
+
+		/* 
+		 * If the cancel button on the ProgressMonitor has been pressed, cancel the scan and let
+		 * the resulting propertyChange event trigger the firing of the final property change event.
+		 * This depends on the scanner firing off PropertyChange events often enough to quickly 
+		 * detect this change.  Once the ProgressMonitor is canceled, isCanceled will always return 
+		 * true and so all event handling will stop here.
+		 */
+		if ( scanMonitor.isCanceled() ) {
+			scanner.cancel(true);
+			return;
+		}
+
+		// If a progress update from the scanner, update the ProgressMonitor's progress bar
+		if ( "progress".equals(evt.getPropertyName()) ) {
+            int progress = (Integer) evt.getNewValue();
+            scanMonitor.setProgress(progress);
+            return;
+        }
+
+		// If an update in the directory being examined, update the ProgressMonitor's note
+		if ( "Directory".equals(evt.getPropertyName()) ) {
+			File dir = (File) evt.getNewValue();
+			scanMonitor.setNote(truncatedPathname(dir, rootDir, MAX_TRUNCATED_PATH_LENGTH));
+		}
+	}
+
+	/**
+	 * Return a short pathname for the given File.  The name is truncated by using ellipses in
+	 * the middle of the path to try keep the length from of the returned String from exceeding 
+	 * MmaxLength.  If parent is given, the truncated name starts with the parent directory's 
+	 * name if the given File is a directory under parent.
+	 * @param fil the File to use
+	 * @param parent the parent File to use as for a relative path (can be null)
+	 * @param the maximum length of the returned short pathname
+	 * @return the short pathname
+	 */
+	public static String truncatedPathname(File fil, File parent, int maxLength) {
+		String filename = fil.getPath();
+		// If parent is given and fil is under parent, always use the relative path
+		if ( parent != null ) {
+			String parentPath = parent.getPath();
+			if ( filename.startsWith(parentPath) ) {
+				String parentName = parent.getName();
+				filename = parentName + filename.substring(parentPath.length());
+			}
+		}
+
+		// If short enough, use the complete name
+		if ( filename.length() <= maxLength )
+			return filename;
+
+		// Break up the path into each directory name components 
+		// (a leading '/' will give an empty first component)
+		String[] components = filename.split(File.separator);
+		// If just a simple name with no path, just return the filename
+		if ( components.length < 2 )
+			return filename;
+
+		// Initialize to "..." + File.separator + final_name
+		int numPre = 0;
+		int numPost = 1;
+		int firstPost = components.length - 1;
+		int accumLength = components[firstPost].length() + 4;
+
+		// If this shortest name is no shorter than the full filename, return the full filename
+		if ( filename.length() <= accumLength )
+			return filename;
+
+		// Construct the truncated name
+		while ( (numPre + numPost < components.length) && (accumLength < maxLength) ) {
+			if (numPre <= numPost ) {
+				accumLength += components[numPre].length() + 1;
+				if ( accumLength <= maxLength ) {
+					numPre += 1;
+				}
+			}
+			else {
+				accumLength += components[firstPost - 1].length() + 1;
+				if ( accumLength <= maxLength ) {
+					firstPost -= 1;
+					numPost += 1;
+				}
+			}
+		}
+
+		// Build the new truncated pathname
+		StringBuilder strBuilder = new StringBuilder();
+		for (int k = 0; k < numPre; k++) {
+			strBuilder.append(components[k]);
+			strBuilder.append(File.separator);
+		}
+		strBuilder.append("...");
+		for (int k = firstPost; k < components.length; k++) {
+			strBuilder.append(File.separator);
+			strBuilder.append(components[k]);
+		}
+
+		return strBuilder.toString();
+	}
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanner.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanner.java
new file mode 100644
index 0000000..72ddaa8
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocalDirTreeScanner.java
@@ -0,0 +1,294 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.SwingWorker;
+
+import thredds.catalog.InvCatalogImpl;
+import thredds.catalog.InvDataset;
+import thredds.catalog.InvDatasetImpl;
+import thredds.catalog.InvService;
+import thredds.catalog.ServiceType;
+
+/**
+ * Scanner for a local directory to generate a complete catalog of the tree implemented as a SwingWorker.
+ * Calling the execute on this SwingWorker will generate a complete catalog of the directory tree rooted 
+ * at the local directory given in the constructor that pass the file filter given in the constructor.
+ * This catalog can then be retrieved by the get method.  Progress is based on the percentage of the number 
+ * of entries in the root directory, possibly plus its immediate subdirectories, that have been examined.
+ * Progress is reported (as with all SwingWorkers) by firing PropertyChange events with the property name 
+ * "progress" and a new value in [0,100].  The currently directory being examined is reported by firing 
+ * PropertyChange events with the property name "Directory" and the File object representing the directory 
+ * as the new value.
+ * 
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class LocalDirTreeScanner extends SwingWorker<InvCatalogImpl, File> {
+	/** root of the local directory tree to scan */
+	private File localDir;
+	/** filter for the files/directories added to the catalog; can be null */
+	private FileFilter datasetFilter;
+	/** the progress total number of files/directories in localDir and its subdirectory passing the file filter */
+	private int numToExamine;
+	/** the subdirectory depth to count entries for progress */
+	private int countDepth;
+	/** the progress examined number of files/directories in localDir and its subdirectory passing the file filter */
+	private int numExamined;
+	/** the actual number of files/directories under localDir in the catalog */
+	private int actualCount;
+
+	
+	/**
+	 * Create a scanner/catalog builder ready to scan the local directory tree rooted at localDir
+	 * @param localDir local root directory of the tree to scan
+	 * @param datasetFilter filter for the files/directories added to the catalog; 
+	 * can be null, in which case all files/directories are added
+	 * @throws IOException if localDir is not a valid directory
+	 */
+	public LocalDirTreeScanner(File localDir, FileFilter datasetFilter) throws IOException {
+		if ( ! localDir.isDirectory() )
+			throw new IOException("Not a valid local directory: " + localDir.getPath());
+		this.localDir = localDir;
+		this.datasetFilter = datasetFilter;
+		numToExamine = 0;
+		countDepth = 0;
+		numExamined = 0;
+		actualCount = 0;
+	}
+
+	/**
+	 * Generate a complete catalog of the directory tree rooted at the local
+	 * directory given in the constructor of this class.
+	 */
+	@Override
+	protected InvCatalogImpl doInBackground() throws Exception {
+		// Send notice that we are examining the local tree root directory
+		setProgress(0);
+		publish(localDir);
+
+		// Initial the progress variables
+		computeNumToExamine();
+		numExamined = 0;
+		if ( isCancelled() )
+			return null;
+
+	    // Create the service for the catalog and datasets
+	    InvService service = new InvService("file:", ServiceType.FILE.toString(), "file:", null, null);
+
+	    // Create a new catalog
+		InvCatalogImpl catalog = new InvCatalogImpl(localDir.getPath(), null, localDir.toURI());
+		catalog.addService(service);
+
+		// Create the top-level dataset.  Since an access will be created in finish() 
+		// for each dataset with a URI path, don't add URI paths to directories
+		InvDatasetImpl topDataset = new LocalDirInvDatasetImpl(null, localDir.getName(), service.getName());
+		topDataset.setID(localDir.getPath());
+		topDataset.setCatalog(catalog);
+
+		// Recurse into the tree, adding InvDatasetImpl objects to the datasets field
+		addContentDatasets(topDataset, localDir, datasetFilter, service, 0);
+		if ( isCancelled() )
+			return null;
+		// Send notice that we are back to the root of the local directory tree
+		publish(localDir);
+
+		// Add this dataset to the catalog
+		catalog.addDataset(topDataset);
+
+		// Finish construction of the catalog
+		if ( ! catalog.finish() )
+			throw new IOException("Unable to finish construction of the catalog from " + localDir.getPath());
+
+		// Set the progress value to complete
+		setProgress(100);
+
+		return catalog;
+	}
+
+	/**
+	 * Using the local directory tree root and file filter used in the construction of this object,
+	 * assigns numToExamine and countDepth appropriately.  The value of numToExamine will be the 
+	 * one (for the root directory) plus the number of files and directories in this root directory, 
+	 * possibly plus the number of file and directories in the immediate subdirectories of this root 
+	 * directory.  The value of countDepth will be one (if only subdirectories of the root directory
+	 * is counted) or two (if subdirectories of these directories are also counted).
+	 * @throws IOException if localDir cannot be examined
+	 */
+	private void computeNumToExamine() throws IOException {
+		numToExamine = 1;
+
+		// Get the number of entries in localDir
+		File[] dirArray = localDir.listFiles(datasetFilter);
+		if ( dirArray == null )
+			throw new IOException("Unable to examine " + localDir.getPath());
+		numToExamine += dirArray.length;
+
+		// Decide whether to stop at this level or go into its subdirectories
+		if ( numToExamine >= 20 ) {
+			countDepth = 1;
+			return;
+		}
+
+		for (File subDir : dirArray) {
+			if ( subDir.isDirectory() ) {
+				if ( isCancelled() )
+					return;
+
+				// Add the number of entries in this subdirectory of localDir
+				try {
+					File[] subDirArray = subDir.listFiles(datasetFilter);
+					if ( subDirArray != null ) {
+						numToExamine += subDirArray.length;
+					}
+				} catch (Exception e) {
+					; // don't care
+				}
+			}
+		}
+		countDepth = 2;
+	}
+
+	/**
+	 * Adds datasets to parentDataset for each file/directory in parentDir that passes the filter.
+	 * When subdirectories are encountered, this method calls itself with the subdirectory dataset
+	 * and subdirectory File, thus filling out the full directory tree rooted at parentDir.
+	 * @param parentDataset add new child datasets to this dataset
+	 * @param parentDir directory to examine
+	 * @param datasetFilter filter on the files/directories to be added to the catalog.  
+	 * If null, all files/directories are added.
+	 * @param serviceName service name to be added to the InvDatasetImpl objects created
+	 * @param level the recursion level
+	 * @throws IOException if any of the file system operations throws one or if parentDir 
+	 * is unable to be read
+	 */
+	private void addContentDatasets(InvDatasetImpl parentDataset, File parentDir, FileFilter datasetFilter, 
+									InvService service, int level) throws IOException {
+		// Get the list of files and directories in this directory
+		File[] contentsArray = null;
+		try {
+			contentsArray = parentDir.listFiles(datasetFilter);
+		} catch (SecurityException e) {
+			;  // if don't have permission to read the directory, leave contentsArray null
+		}
+
+		// If there was a problem getting the contents of this directory, or it is empty, just go continue on to the next item
+		if ( (contentsArray == null) || (contentsArray.length == 0) ) {
+			return;
+		}
+		actualCount += contentsArray.length;
+
+		// Sort the array of files and directories
+		if ( contentsArray.length > 1 ) {
+			List<File> contentsList = Arrays.asList(contentsArray);
+			Collections.sort(contentsList);
+		}
+
+		// Add to the parent's datasets array a dataset for each file/dir returned
+		List<InvDataset> datasets = parentDataset.getDatasets();
+		for (File child : contentsArray) {
+			if ( isCancelled() )
+				return;
+			if ( child.isDirectory() ) {
+				InvDatasetImpl childDataset;
+				// Limited the level of recursion (mainly for infinite loops from symbolic links)
+				if ( level < 16 ) {
+					// Send notice of the new directory being examine
+					publish(child);
+					// Create the dataset with a null urlPath argument so no access created
+					childDataset = new LocalDirInvDatasetImpl(parentDataset, child.getName(), service.getName());
+					childDataset.setID(child.getPath());
+					// Add the contents of this directory 
+					addContentDatasets(childDataset, child, datasetFilter, service, level + 1);
+					// Send notice that we are back to the parent directory
+					publish(parentDir);
+				}
+				else {
+					// Create the dataset with a null urlPath argument so no access created
+					childDataset = new LocalDirInvDatasetImpl(parentDataset, child.getName() + " (not examined)", service.getName());
+					childDataset.setID(child.getPath());					
+				}
+				// Add this dataset to the parent's dataset
+				datasets.add(childDataset);
+			}
+			else {
+				// Get the URI string
+				String uriPathString = child.toURI().toString();
+				// Remove the base string from the service
+				String serviceBaseString = service.getBase();
+				if ( ! uriPathString.startsWith(serviceBaseString) )
+					throw new IOException("Unexpected URI string of child: " + uriPathString + "\n" +
+										  "under service URI string: " + serviceBaseString);
+				uriPathString = uriPathString.substring(serviceBaseString.length());
+				// Create the dataset with this urlPath argument so an appropriate access is created
+				InvDatasetImpl childDataset = new InvDatasetImpl(parentDataset, child.getName(), null, service.getName(), uriPathString);
+				childDataset.setID(child.getPath());
+				childDataset.setDataSize(child.length());
+				childDataset.setLastModifiedDate(new Date(child.lastModified()));
+				// Add this dataset to the parent's dataset
+				datasets.add(childDataset);
+			}
+			if ( level < countDepth ) {
+				// Update the progress
+				numExamined += 1;
+				setProgress((100 * numExamined) / numToExamine);
+			}
+		}
+	}
+
+	/**
+	 * @return the total number of entries in the returned catalog.  If canceled,
+	 * the total number of entries examined prior to cancellation.
+	 */
+	public int getNumCatalogEntries() {
+		return actualCount;
+	}
+
+	/**
+	 * Receives a lists of the directory Files that have been examined.
+	 * A method generates a PropertyChange event with the name "Directory"
+	 * and a new value of the last File in the list.
+	 */
+	@Override
+	protected void process(List<File> fileList) {
+		firePropertyChange("Directory", null, fileList.get(fileList.size() - 1));
+	}
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelector.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelector.java
new file mode 100644
index 0000000..fecc529
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelector.java
@@ -0,0 +1,184 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.Vector;
+
+import javax.swing.JOptionPane;
+
+import ucar.util.prefs.PreferencesExt;
+
+/**
+ * Maintains locations and filename extensions for a ThreddsBrowser.  Prompts the user for selecting
+ * a location and, if applicable, filename extensions of datasets to be displayed in a ThreddsBrowser. 
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class LocationSelector {
+
+	/** the ThreddsBrowser associated with this location selector */
+	private ThreddsBrowser tBrowser;
+
+	/** list of saved locations */
+	private Vector<String> savedLocations;
+
+	/** Default directory for the local directory file chooser */ 
+	private File localBrowseDir;
+
+	/** A comma/semicolon/space separated list of acceptable filename extensions for local datasets */
+	private String extensionsString;
+
+	/**
+	 * Maintains locations and filename extensions for the given ThreddsBrowser.  Prompts the user for selecting
+	 * a location and, if applicable, filename extensions of datasets to be displayed in this ThreddsBrowser. 
+	 */
+	public LocationSelector(ThreddsBrowser tBrowser) {
+		if ( tBrowser == null )
+			throw new NullPointerException("null ThreddsBrowser given to the LocationSelector constructor");
+		this.tBrowser = tBrowser;
+		savedLocations = null;
+		localBrowseDir = null;
+		extensionsString = null;
+	}
+
+	/**
+	 * Reset the default values in the browser to those given in the BrowserDefaults.
+	 * @param defs the BrowserDefaults to use; cannot be null
+	 */
+	public void resetDefaults(BrowserDefaults defs) {
+		// Set the saved locations
+		Collection<String> locations = defs.getLocationStrings();
+		if ( savedLocations == null ) {
+			savedLocations = new Vector<String>(locations);
+		}
+		else {
+			savedLocations.removeAllElements();
+			savedLocations.addAll(locations);
+		}
+
+		// Get the directory for the local directory file chooser 
+		localBrowseDir = defs.getLocalBrowseDir();
+
+		// Get the string of acceptable filename extensions for displayed datasets
+		extensionsString = defs.getExtensionsString();
+	}
+
+	/**
+	 * Save all the current settings of this ThreddsBrowser to prefs.
+	 */
+	public void savePreferences(PreferencesExt prefs) {
+		// Save the list of locations
+		if ( savedLocations != null )
+			BrowserDefaults.saveLocationsList(prefs, savedLocations);
+
+		// Save the default directory for the local directory file chooser
+		if ( localBrowseDir != null )
+			BrowserDefaults.saveLocalBrowseDir(prefs, localBrowseDir);
+
+		// Save the standard String of extensions
+		if ( extensionsString != null )
+			BrowserDefaults.saveExtensionsString(prefs, extensionsString);
+	}
+
+	/**
+	 * Request a new location to be displayed in the associated ThreddsBrowser.
+	 * If args is not null and not empty, uses args[0] as the new location to be shown;
+	 * otherwise, brings up a dialog prompting the user to select a new location.
+	 * The location can be a URI string, URL string, or local directory pathname.
+	 * If the location is a local directory, the user will then be prompted for the
+	 * filename extensions of datasets to display.
+	 */
+	public void selectLocation(String [] args) {
+		// Get the location to be shown from the arguments, if given
+		String location = null;
+		if ( (args != null) && (args.length > 0) ) {
+			location = args[0].trim();
+			if ( location.isEmpty() )
+				location = null;
+		}
+
+		// If arguments not given or the first argument is blank, prompt the user for the location
+		if ( location == null ) {
+			LocationSelectorDialog selectorDialog = new LocationSelectorDialog(tBrowser, savedLocations, localBrowseDir);
+			location = selectorDialog.selectLocation();
+			selectorDialog.dispose();
+		}
+		// Just return if user canceled out of the dialog
+		if ( location == null ) 
+			return;
+
+		// Add/move this location to the top of the saved list.
+		if ( savedLocations == null )
+			savedLocations = new Vector<String>();
+		else
+			savedLocations.remove(location);
+		savedLocations.add(0, location);
+
+		// Create a URI from the given location string
+		URI uri;
+		try {
+			uri = new URI(location);
+		} catch (URISyntaxException e) {
+			// If problems, assume this is a local file pathname
+			File locFile = new File(location);
+			uri = locFile.toURI();
+		}
+
+		// Check if local directory or a Thredds server
+		String scheme = uri.getScheme();
+		if ( (scheme == null) || "file".equals(scheme) ) {
+			// Save this new default location for the local file browser
+			localBrowseDir = new File(uri.getPath());
+			// Get the filename extensions of datasets in this local directory
+			String newExtensions = JOptionPane.showInputDialog(tBrowser, "Show datasets with the filename extension\n" +
+															   "(give none to show all files):", extensionsString);
+			// Just return if user canceled out of the dialog
+			if ( newExtensions == null )
+				return;
+			// Clean and save the new extensions
+			Collection<String> extsColl = BrowserDefaults.parseExtensionsString(newExtensions);
+			extensionsString = BrowserDefaults.createExtensionsString(extsColl);
+			// Show the datasets in this local directory
+			tBrowser.showLocalLocation(localBrowseDir, new ExtensionFileFilter(extsColl));
+		}
+		else {
+			// Show the datasets from this Thredds server 
+			tBrowser.showThreddsServerLocation(location);
+		}
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelectorDialog.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelectorDialog.java
new file mode 100644
index 0000000..732d832
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/LocationSelectorDialog.java
@@ -0,0 +1,404 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.util.Vector;
+
+import javax.swing.Box;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.WindowConstants;
+
+/**
+ * Dialog for selecting a location to display in a ThreddsBrowser.
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class LocationSelectorDialog extends JDialog implements ActionListener, FocusListener {
+	private static final long serialVersionUID = 5072476287316578226L;
+
+	/** Radio button for using the saved locations combo box */
+	private JRadioButton savedLocsButton;
+	/** Combo box of saved locations */
+	private JComboBox savedLocsComboBox;
+	/** Radio button for using the new location text field */
+	private JRadioButton newLocButton;
+	/** Text field for entering a new location */
+	private JTextField newLocTextField;
+	/** Radio button for selecting the root of a local directory tree */
+	private JRadioButton localDirTreeButton;
+	/** Select button to dismiss the dialog, using the selected location */
+	private JButton selectButton;
+	/** Cancel button to dismiss the dialog without selecting a location */
+	private JButton cancelButton;
+	/** Last radio button selected */
+	private JRadioButton lastSelectedRadioButton;
+	/** Default for the local directory file selector */
+	private File localBrowseDir;
+
+	/**
+	 * Creates, but does not bring up, a LocationSelectorDialog with the given parameters.
+	 * Use the selectLocation method to bring up the dialog and retrieve the location to use.
+	 * @param parent create the dialog in the Frame for this component; can be null.
+	 * @param savedLocations use these locations for the drop-down list of saved locations; 
+	 * can be null or empty.
+	 * @param localBrowseDir use this directory as the default root of the local 
+	 * directory tree; can be null.
+	 */
+	public LocationSelectorDialog(Component parent, Vector<String> savedLocations, File localBrowseDir) {
+		super(JOptionPane.getFrameForComponent(parent), "Select a Location to Display", true);
+		this.localBrowseDir = localBrowseDir;
+
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.anchor = GridBagConstraints.NORTHWEST;
+
+		// Label for the radio buttons
+		gbc.gridx = 0;     gbc.gridy = 0;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+		gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.NONE;
+		gbc.insets = new Insets(10,10,10,10);
+		add(new JLabel("Select a location to display in the browser:"), gbc);
+
+		// Radio button for the drop-down list of saved locations
+		savedLocsButton = new JRadioButton("Saved locations:");
+	    savedLocsButton.setFocusPainted(false);
+	    savedLocsButton.addActionListener(this);
+ 		gbc.gridx = 0;     gbc.gridy = 1;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+		gbc.weightx = 0.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.VERTICAL;
+		gbc.insets = new Insets(6,10,6,5);
+		add(savedLocsButton, gbc);
+
+		// JComboBox of the saved locations
+		if ( savedLocations != null )
+			savedLocsComboBox = new JComboBox(savedLocations);
+		else
+			savedLocsComboBox = new JComboBox();
+		savedLocsComboBox.setEditable(false);
+		savedLocsComboBox.addActionListener(this);
+		savedLocsComboBox.addFocusListener(this);
+		gbc.gridx = 1;     gbc.gridy = 1;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+		gbc.weightx = 1.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.insets = new Insets(5,5,5,10);
+		add(savedLocsComboBox, gbc);
+
+		// Radio button for entering a new location in a TextField
+		newLocButton = new JRadioButton("New location:");
+	    newLocButton.setFocusPainted(false);
+	    newLocButton.addActionListener(this);
+		gbc.gridx = 0;     gbc.gridy = 2;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+		gbc.weightx = 0.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.VERTICAL;
+		gbc.insets = new Insets(5,10,5,5);
+		add(newLocButton, gbc);
+
+		// JTextField to enter a new location
+		newLocTextField = new JTextField(40);
+		newLocTextField.addFocusListener(this);
+		gbc.gridx = 1;     gbc.gridy = 2;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+		gbc.weightx = 1.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.insets = new Insets(5,5,5,10);
+		add(newLocTextField, gbc);
+
+		// Radio button to select the root directory of a local directory tree
+		localDirTreeButton = new JRadioButton("Find a local directory to be the root of a tree of datasets ...");
+	    localDirTreeButton.setFocusPainted(false);
+	    localDirTreeButton.addActionListener(this);
+		gbc.gridx = 0;     gbc.gridy = 3;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+		gbc.weightx = 1.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.insets = new Insets(5,10,5,10);
+		add(localDirTreeButton, gbc);
+
+		// Group these radio buttons
+		ButtonGroup radioGroup = new ButtonGroup();
+		radioGroup.add(savedLocsButton);
+		radioGroup.add(newLocButton);
+		radioGroup.add(localDirTreeButton);
+
+		// Separator between the radio buttons and the select/cancel buttons
+		gbc.gridx = 0;     gbc.gridy = 4;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+		gbc.weightx = 1.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(5,0,5,0);
+		add(new JSeparator(), gbc);
+
+		// Create a horizontal panel with Select and Cancel buttons equally spaced
+		JPanel horizPanel = new JPanel(new GridLayout(1,0));
+        // Horizontal space
+        horizPanel.add(Box.createHorizontalGlue());
+        // Select button
+        selectButton = new JButton("Select");
+        selectButton.setFocusPainted(false);
+        selectButton.addActionListener(this);
+        horizPanel.add(selectButton);
+        // Horizontal space
+        horizPanel.add(Box.createHorizontalGlue());
+        // Cancel button
+        cancelButton = new JButton("Cancel");
+        cancelButton.setFocusPainted(false);
+        cancelButton.addActionListener(this);
+        horizPanel.add(cancelButton);
+        // Horizontal space
+        horizPanel.add(Box.createHorizontalGlue());
+
+        // Add the horizontal panel
+		gbc.gridx = 0;     gbc.gridy = 5;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+		gbc.weightx = 1.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(5,10,10,10);
+        add(horizPanel, gbc);
+
+       // Final touches to the dialog
+        getRootPane().setDefaultButton(selectButton);
+        pack();
+        setLocationRelativeTo(parent);
+
+        // Treat the dialog close ("X") button the same as the cancel button
+        setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+		addWindowListener(new WindowAdapter() {
+			@Override
+			public void windowClosing(WindowEvent evt) {
+				cancelButton.doClick();
+			}
+		});
+
+	}
+
+	/**
+	 * Display this LocationSelectorDialog and retrieve the location to use.
+	 * @return the selected location as a trimmed, non-empty String, 
+	 * or null if the user canceled the dialog.
+	 */
+	public String selectLocation() {
+		// Set the saved locations radio button as the default
+		savedLocsButton.doClick();
+		
+		// Because this dialog is modal, the following will block 
+		// (but still allow event processing) until this dialog is dismissed
+		setVisible(true);
+
+		// Get the value associated with the last selected radio button
+		String selectedLocation = null;
+		if ( lastSelectedRadioButton == savedLocsButton ) {
+			// Get the location from the saved locations combo box
+			selectedLocation = (String) savedLocsComboBox.getSelectedItem();
+		}
+		else if ( lastSelectedRadioButton == newLocButton ) {
+			// Get the location from the new location text field
+			selectedLocation = newLocTextField.getText();
+		}
+		else if ( lastSelectedRadioButton == localDirTreeButton ) {
+			// Create a file chooser opened to the default local directory
+			JFileChooser chooser = new JFileChooser(localBrowseDir);
+
+			// Customize the file chooser for directories
+			chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+			chooser.setDialogTitle("Directory to be Root of a Local Dataset Tree");
+			chooser.setApproveButtonToolTipText("Use the selected directory as the root of a local dataset tree");
+
+			// Ugly hack to rename the label "File Name:" to "Selected Dir:" and 
+			// to get rid of the file filter panel with the label "Files of Type:".
+			// This will fail in locales that do not use exactly these strings
+			// or if these components are not nested in JPanels.
+			// More stuff might be removed if the file filter label and combo box 
+			// are not in their own JPanel.
+			for ( Component comp : chooser.getComponents() ) {
+				checkComponentForFileLabel(comp);
+			}
+
+			// Get the selected directory
+			if ( chooser.showDialog(this, "Use Selected Dir") == JFileChooser.APPROVE_OPTION ) {
+				localBrowseDir = chooser.getSelectedFile();
+				selectedLocation = localBrowseDir.getPath();
+			}
+		}
+
+		// Trim the location; if blank, set to null
+		if ( selectedLocation != null ) {
+			selectedLocation = selectedLocation.trim();
+			if ( selectedLocation.isEmpty() )
+				selectedLocation = null;
+		}
+
+		// Return the selected location, which will be null if a dialog was canceled
+		return selectedLocation;
+	}
+
+	/**
+	 * If comp is a JLabel with text "File Name:", change the text to "Selected Dir:";
+	 * if comp is a JLabel with text "Files of Type:", remove the JPanel that contains
+	 * this component from it's JPanel; otherwise, if comp is a JPanel, call this 
+	 * function on each of its components.
+	 */
+	private int checkComponentForFileLabel(Component comp) {
+		if ( JLabel.class.isInstance(comp) ) {
+			JLabel label = (JLabel) comp;
+			if ( "File Name:".equals(label.getText()) ) {
+				// Rename this label and continue on
+				label.setText("Selected Dir:");
+			}
+			else if ( "Files of Type:".equals(label.getText()) ) {
+				// This is the file filter label
+				return 1;
+			}
+		}
+		else if ( JPanel.class.isInstance(comp) ) {
+			JPanel panel = (JPanel) comp;
+			for ( Component panelComp : panel.getComponents() ) {
+				int level = checkComponentForFileLabel(panelComp);
+				if ( level == 2 ) {
+					// Remove this panel component (which contains the file filter label) from this panel
+					panel.remove(panelComp);
+					return 0;
+				}
+				if ( level == 1 ) {
+					// This is the panel containing the file filter label
+					return 2;
+				}
+			}
+		}
+		return 0;
+	}
+
+	/**
+	 * If from a radio button, records this currently selected radio button.
+	 * If from a component associated with a radio button, makes sure the associated
+	 * radio button is selected.
+	 * If from the select button, closes this dialog.
+	 * If from the cancel button, sets the currently selected radio button to null 
+	 * and closes this dialog. 
+	 */
+	@Override
+	public void actionPerformed(ActionEvent evt) {
+		Object src = evt.getSource();
+		if ( src == savedLocsButton ) {
+			// Record that the saved locations radio button was selected
+			lastSelectedRadioButton = savedLocsButton;
+		}
+		else if ( src == newLocButton ) {
+			// Record that the new location radio button was selected
+			lastSelectedRadioButton = newLocButton;
+		}
+		else if ( src == localDirTreeButton ) {
+			// Record that the local directory tree radio button was selected
+			lastSelectedRadioButton = localDirTreeButton;
+		}
+		else if ( src == savedLocsComboBox ) {
+			// Put the selected location into the new location text field
+			String location = (String) savedLocsComboBox.getSelectedItem();
+			newLocTextField.setText(location);
+			// Make sure the saved locations radio button is selected
+			if ( lastSelectedRadioButton != savedLocsButton )
+				savedLocsButton.doClick();
+		}
+		else if ( src == selectButton ) {
+			// Close the dialog so selectLocation can proceed,
+			// leaving lastActionCommand as-is to indicate how to proceed.
+			setVisible(false);
+		}
+		else if ( src == cancelButton ) {
+			// Set lastSelectedRadioButton to indicate the dialog was canceled
+			// and close the dialog so selectLocation can proceed.
+			lastSelectedRadioButton = null;
+			setVisible(false);
+		}
+		else {
+			System.out.println("unhandled action event: " + evt);
+			System.out.println("coming from: " + src);
+		}
+	}
+
+	/**
+	 * Makes sure the radio button associated with the component gaining focus is selected.
+	 */
+	@Override
+	public void focusGained(FocusEvent evt) {
+		Object src = evt.getSource();
+		if ( src == newLocTextField ) {
+			// Make sure the new location radio button is selected
+			if ( lastSelectedRadioButton != newLocButton )
+				newLocButton.doClick();
+		}
+		else if ( src == savedLocsComboBox ) {
+			// Make sure the saved locations radio button is selected
+			if ( lastSelectedRadioButton != savedLocsButton )
+				savedLocsButton.doClick();
+		}
+		else {
+			System.out.println("unhandled focusGained event: " + evt);
+			System.out.println("coming from: " + src);
+		}
+	}
+
+	/**
+	 * Does nothing.
+	 */
+	@Override
+	public void focusLost(FocusEvent evt) {
+		; // don't care
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowser.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowser.java
new file mode 100644
index 0000000..3a7f2cb
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowser.java
@@ -0,0 +1,606 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+
+import thredds.catalog.InvAccess;
+import thredds.catalog.InvCatalogImpl;
+import thredds.catalog.InvDatasetImpl;
+import thredds.catalog.ui.CatalogTreeView;
+import ucar.util.prefs.PreferencesExt;
+
+/**
+ * Creates a THREDDS catalog browser for simple selection of a dataset.
+ * Uses a UCAR/Unidata CatalogTreeView to do much of the work.
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class ThreddsBrowser extends JPanel {
+	private static final long serialVersionUID = -6448720995067592662L;
+
+	/** Default locations environment variable - used for reset */
+	private String defLocsEnvName;
+
+	/**	Original BrowserDefaults - used for reset */
+	private BrowserDefaults initialDefaults;
+
+	/** JLabel showing the currently displayed location */
+	private JLabel locationLabel;
+
+	/** Tree view of the catalog or file system */
+	private CatalogTreeView treeViewer;
+
+	/** Display of information on the selected dataset */
+	private HTMLViewer htmlViewer;
+
+	/** JSplitPane containing treeViewer and htmlViewer */
+	private JSplitPane splitPanel;
+
+	/** The "USE" button */
+	private JButton useButton;
+
+	/** The "Cancel" button */
+	private JButton cancelButton;
+
+	/** Use for location selection preferences and dialog */
+	private LocationSelector locationSelector;
+
+	/** Current selected dataset URL */
+	private String datasetName;
+
+	/** JLabel displaying the currently selected dataset */
+	private JLabel datasetLabel;
+
+	/**
+	 * Create a THREDDS catalog browser for simple selection of a dataset.
+	 * @param prefs the default preference settings for this ThreddsBrowers; 
+	 * @param defaultLocationsEnvName the name of the locations environment variable 
+	 * whose value is a space-separated list of possibly-quoted locations.  May be 
+	 * null.  These locations, if not already given in prefs, will appear in 
+	 * order at the bottom of the drop-down list.  
+	 */
+	public ThreddsBrowser(PreferencesExt prefs, String defaultLocationsEnvName) {
+		// Get the defaults
+		defLocsEnvName = defaultLocationsEnvName;
+		initialDefaults = new BrowserDefaults(prefs, defLocsEnvName);
+
+		// Use a grid bag layout in this JPanel
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.anchor = GridBagConstraints.NORTHWEST;
+
+		// Intro label for the location
+		JLabel locationIntroLabel = new JLabel("Contents of location:");
+		gbc.gridx = 0;     gbc.gridy = 0;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+	    gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(15,10,10,2);
+		add(locationIntroLabel, gbc);
+		
+		// JLabel showing the currently displayed location
+		locationLabel = new JLabel(" ", SwingConstants.LEFT);
+		gbc.gridx = 2;     gbc.gridy = 0;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+	    gbc.weightx = 1.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(15,2,10,5);
+		add(locationLabel, gbc);
+
+		// Change location button to open LocationSelectorDialog
+		JButton changeLocationButton = new JButton("Change Location...");
+		changeLocationButton.setFocusPainted(false);
+		changeLocationButton.setToolTipText("Select a different location to display below");
+		gbc.gridx = 3;     gbc.gridy = 0;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+	    gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(10,5,5,10);
+		add(changeLocationButton, gbc);
+
+		// CatalogTreeView for viewing the catalog or directory tree
+		treeViewer = new CatalogTreeView();
+
+		// HTMLViewer displaying information on the selected dataset
+		htmlViewer = new HTMLViewer();
+
+	    // JSplitPane containing the above treeViewer on the left and htmlViewerScrollPane on the right
+	    splitPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false, treeViewer, htmlViewer);
+		gbc.gridx = 0;     gbc.gridy = 1;
+		gbc.gridwidth = 5; gbc.gridheight = 1;
+	    gbc.weightx = 1.0; gbc.weighty = 1.0;
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.insets = new Insets(5,10,5,10);
+		add(splitPanel, gbc);
+
+		// USE button to output the current dataset and close 
+		useButton = new JButton("Use dataset:");
+		useButton.setFocusPainted(false);
+		useButton.setToolTipText("Use the selected dataset and exit this browser");
+		gbc.gridx = 0;     gbc.gridy = 2;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+	    gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(5,10,10,2);
+		add(useButton, gbc);
+
+		// JLabel with the current selected dataset name
+		datasetName = " ";
+		datasetLabel = new JLabel(datasetName, SwingConstants.LEFT);
+		datasetLabel.setToolTipText("The currently selected dataset");
+		gbc.gridx = 1;     gbc.gridy = 2;
+		gbc.gridwidth = 2; gbc.gridheight = 1;
+	    gbc.weightx = 1.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(10,2,15,5);
+		add(datasetLabel, gbc);
+
+		// Reset button to reset the default settings
+		JButton resetButton = new JButton("Reset");
+		resetButton.setFocusPainted(false);
+		resetButton.setToolTipText("Reset this browser with default settings");
+		gbc.gridx = 3;     gbc.gridy = 2;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+	    gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(5,5,10,5);
+		add(resetButton, gbc);
+		
+		// Cancel button to close without output of a dataset name
+		cancelButton = new JButton("Cancel");
+		cancelButton.setFocusPainted(false);
+		cancelButton.setToolTipText("Exit this browser without designating a dataset to use");
+		gbc.gridx = 4;     gbc.gridy = 2;
+		gbc.gridwidth = 1; gbc.gridheight = 1;
+	    gbc.weightx = 0.0; gbc.weighty = 0.0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(5,5,10,10);
+		add(cancelButton, gbc);
+
+		// Create the location selector for this browser
+		locationSelector = new LocationSelector(this);
+
+		// Set the defaults
+		updateLocationLabel(null);
+		resetDefaults(initialDefaults);
+
+		// Listen for double clicks in the CatalogTreeView
+		treeViewer.addPropertyChangeListener(new PropertyChangeListener() {
+			@Override
+			public void propertyChange(PropertyChangeEvent e) {
+				String propName = e.getPropertyName();
+				if ( "Dataset".equals(propName) || "File".equals(propName) ) {
+					// Second click of a double-click on a dataset or file name
+					useButton.doClick();
+				}
+			}
+		});
+		// Listen for selection changes (mouse clicks or arrow key presses)
+		treeViewer.getJTree().addTreeSelectionListener(new TreeSelectionListener() {
+			@Override
+			public void valueChanged(TreeSelectionEvent e) {
+				selectDataset();
+			}
+		});
+
+		// Listen for hyperlink selections in the htmlViewer
+		htmlViewer.addHyperlinkListener(new HyperlinkListener() {
+			@Override
+			public void hyperlinkUpdate(HyperlinkEvent e) {
+				if ( e.getEventType() == HyperlinkEvent.EventType.ACTIVATED ) {
+					// Don't bother dealing with frames
+					try {
+						htmlViewer.setPage(e.getURL());
+					} catch (Exception exc) {
+						;
+					}
+				}
+			}
+		});
+
+		// Listen for Change Location... button presses
+		changeLocationButton.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				locationSelector.selectLocation(null);
+			}
+		});
+
+		// Listen for Reset button presses
+		resetButton.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				// Ask which settings to return to
+				String[] resetOptions = {"start-up settings", "default settings"};
+				String result = (String) JOptionPane.showInputDialog(ThreddsBrowser.this, "Reset to: ",
+												"Reset Settings", JOptionPane.INFORMATION_MESSAGE, null, 
+												resetOptions, resetOptions[0]);
+				if ( resetOptions[0].equals(result) ) {
+					// start-up settings - use the defaults created in the constructor
+					resetDefaults(initialDefaults);
+				}
+				else if ( resetOptions[1].equals(result) ) {
+					// default settings - use defaults from not using a XMLStore/PreferencesExt
+					resetDefaults(new BrowserDefaults(null, defLocsEnvName));
+				}
+			}
+		});
+	}
+
+	/**
+	 * Forwards the arguments to this browser's {@link LocationSelector#selectLocation} method
+	 * @param args the arguments; may be null or empty 
+	 */
+	public void selectLocation(String[] args) {
+		locationSelector.selectLocation(args);
+	}
+
+	/**
+	 * Display the THREDDS server catalog at the given URI.
+	 * @param locationURI the URI of the THREDDS server catalog
+	 */
+	public void showThreddsServerLocation(String locationString) {
+		// Update the location displayed in the browser and clear the viewers
+		clearViewers();
+		updateLocationLabel(locationString);
+
+		// Display the location in the tree viewer
+		treeViewer.setCatalog(locationString);
+	}
+
+	/**
+	 * Create and display a catalog of the given local directory.
+	 * Before creating the catalog, a dialog is opened requesting 
+	 * the user for filename extensions of datasets to display.
+	 * @param localDir the local directory to display
+	 * @param datasetFilter show only files that pass this filter; 
+	 * if null, all files are accepted
+	 */
+	public void showLocalLocation(File localDir, FileFilter datasetFilter) {
+		// Create the catalog for this directory
+		final LocalDirTreeScanMonitor scanMonitor;
+		try {
+			scanMonitor = new LocalDirTreeScanMonitor(this, localDir, datasetFilter);
+		} catch (IOException e) {
+			JOptionPane.showMessageDialog(this, "Unable to catalog " + localDir + "\n" + e.getMessage(), 
+										  "Unable to Catalog", JOptionPane.ERROR_MESSAGE);
+			return;
+		}
+		scanMonitor.addPropertyChangeListener(new PropertyChangeListener() {
+			@Override
+			public void propertyChange(PropertyChangeEvent evt) {
+				String propName = evt.getPropertyName();
+				if ( "Done".equals(propName) ) {
+					// Success - get the local directory tree root and the generated catalog
+					File rootDir = (File) evt.getOldValue();
+					InvCatalogImpl catalog = (InvCatalogImpl) evt.getNewValue();
+
+					// Update the location displayed in the browser and clear the viewers
+					clearViewers();
+					updateLocationLabel(rootDir.getPath());
+
+					// Display the catalog in the tree viewer
+					displayLocalCatalog(scanMonitor, catalog);
+				}
+				else if ( "Canceled".equals(propName) ) {
+					// Scan was canceled by the user
+					JOptionPane.showMessageDialog(ThreddsBrowser.this, "Scan canceled", 
+												  "Scan Canceled", JOptionPane.ERROR_MESSAGE);
+				}
+				else if ( "Died".equals(propName) ) {
+					// Scan threw an exception
+					Throwable cause = (Throwable) evt.getNewValue();
+					JOptionPane.showMessageDialog(ThreddsBrowser.this, "Scan died: " + cause.getMessage(), 
+												  "Scan Died", JOptionPane.ERROR_MESSAGE);
+				}
+			}
+		});
+		scanMonitor.runScan();
+	}
+
+	/**
+	 * Display the local directory tree catalog in treeViewer.  This is done in a separate thread in
+	 * case a very large directory tree is being displayed, which may take quite some time and would 
+	 * make the program appear to be frozen otherwise.
+	 * @param scanMonitor the monitor used to create the catalog to be displayed
+	 * (used for obtaining the number of entries in the catalog to determine whether to show a dialog)
+	 * @param catalog the catalog to be displayed
+	 */
+	private void displayLocalCatalog(LocalDirTreeScanMonitor scanMonitor, final InvCatalogImpl catalog) {
+		int numEntries = scanMonitor.getNumCatalogEntries();
+
+		// If not many entries, just update the treeViewer in this thread and be done with it
+		if ( numEntries < 4096 ) {
+			treeViewer.setCatalog(catalog);
+			return;
+		}
+
+		// Put up the modal "working" dialog running in a separate thread
+		final Thread dialogThread = new Thread(new Runnable() {
+			@Override
+			public void run() {
+				JOptionPane.showMessageDialog(ThreddsBrowser.this, "Please wait\n" +
+						                                           "Displaying the local directory tree\n" +
+						                                           "This dialog will go away when done\n" +
+						                                           "(Sorry, can't be canceled)", 
+											  "Displaying Local Directory Tree", JOptionPane.INFORMATION_MESSAGE);
+			}
+		});
+		dialogThread.start();
+
+		// Update the treeViewer in a separate thread
+		new Thread(new Runnable() {
+			@Override
+			public void run() {
+				treeViewer.setCatalog(catalog);
+				// Display done - kill the dialog
+				dialogThread.interrupt();
+			}
+		}).start();
+	}
+
+	/**
+	 * Updates the label of currently shown location.
+	 * @param location the new location; can be null or blank for no location given
+	 */
+	private void updateLocationLabel(String location) {
+		if ( (location == null) || location.trim().isEmpty() )
+			locationLabel.setText("(no location given)");
+		else
+			locationLabel.setText(location);
+	}
+
+	/**
+	 * Clears the shown location label, treeViewer and htmlViewer
+	 */
+	private void clearViewers() {
+		treeViewer.getJTree().setModel(new DefaultTreeModel(new DefaultMutableTreeNode(null, false)));
+		htmlViewer.clearPage();
+		updateLocationLabel(null);
+	}
+
+	/**
+	 * Set the currently selected dataset name and show information about it.
+	 */
+	private void selectDataset() {
+		// Get the dataset name
+		InvDatasetImpl dataset = (InvDatasetImpl) treeViewer.getSelectedDataset();
+
+		// Assign datasetName if the selected item is actually a dataset (has an access)
+		datasetName = " ";
+		if ( dataset != null ) {
+			List<InvAccess> accesses = dataset.getAccess();
+			if ( accesses.size() > 0 ) {
+				URI uri = accesses.get(0).getStandardUri();
+				String scheme = uri.getScheme();
+				if ( (scheme == null) || "file".equals(scheme) ) {
+					// for local datasets, get the path from the dataset ID
+					datasetName = dataset.getID();
+				}
+				else {
+					// for remote datasets, show the URI
+					datasetName = accesses.get(0).getStandardUrlName();
+				}
+			}
+		}
+
+		// Clear the info viewer so there is no mismatch while new info is being created
+		htmlViewer.clearPage();
+
+		// Show the new dataset name
+		datasetLabel.setText(datasetName);
+
+		// If actually a dataset, create content in the info viewer
+		if ( ! datasetName.trim().isEmpty() ) {
+			StringBuilder sbuff = new StringBuilder(2048);
+			InvDatasetImpl.writeHtmlDescription(sbuff, dataset, false, true, false, false, true);
+			htmlViewer.showHTMLBodyText(sbuff.toString());
+		}
+	}
+
+	/**
+	 * @return the name of the currently selected dataset, 
+	 * or null is there is no currently selected dataset. 
+	 */
+	public String getDatasetName() {
+		if ( datasetName.trim().isEmpty() )
+			return null;
+		return datasetName;
+	}
+
+	/**
+	 * Adds the given ActionListener to the "USE" button in the browser
+	 */
+	public void addUseActionListener(ActionListener actionListener) {
+		useButton.addActionListener(actionListener);
+	}
+
+	/**
+	 * Removes the given ActionListener from the "USE" button in the browser
+	 */
+	public void removeUseActionListener(ActionListener actionListener) {
+		useButton.removeActionListener(actionListener);
+	}
+
+	/**
+	 * Adds the given ActionListener to the "Cancel" button in the browser
+	 */
+	public void addCancelActionListener(ActionListener actionListener) {
+		cancelButton.addActionListener(actionListener);
+	}
+
+	/**
+	 * Removes the given ActionListener from the "Cancel" button in the browser
+	 */
+	public void removeCancelActionListener(ActionListener actionListener) {
+		cancelButton.removeActionListener(actionListener);
+	}
+
+	/**
+	 * Reset the default values in the browser to those given in the BrowserDefaults.
+	 * @param defs the BrowserDefaults to use; cannot be null
+	 */
+	public void resetDefaults(BrowserDefaults defs) {
+		// Reset the values in the location selector dialog
+		locationSelector.resetDefaults(defs);
+
+		// Set the split pane divider location
+	    splitPanel.setDividerLocation(defs.getDividerLocation());
+
+		// Clear the contents of the viewers
+		clearViewers();
+
+		// Clear the dataset name
+		datasetName = " ";
+		datasetLabel.setText(datasetName);
+
+		// Set the preferred size of the browser panel
+	    setPreferredSize(defs.getBrowserSize());
+	}
+
+	/**
+	 * Save all the current settings of this ThreddsBrowser to prefs.
+	 */
+	public void savePreferences(PreferencesExt prefs) {
+		// Save the location selector dialog settings
+		locationSelector.savePreferences(prefs);
+
+		// Save the divider location
+		BrowserDefaults.saveDividerLocation(prefs, splitPanel.getDividerLocation());
+
+		// Save the size of the browser panel
+		BrowserDefaults.saveBrowserSize(prefs, getSize());
+	}
+
+	/**
+	 * Creates the default filename for a ThreddsBrowser store file.
+	 * Creates any missing directories in this filename.  
+	 * @return the default filename, or null if unable to create
+	 * missing directories
+	 */
+	public static String createDefaultStoreFilename() {
+		String storeFilename = null;
+
+		try {
+			// First try Window desired location for application data stores
+			// APPDATA not likely to be defined on Unix systems
+			storeFilename = System.getenv("APPDATA");
+		    if ( storeFilename != null ) {
+		    	storeFilename += File.separator + "TMAP";
+		    }
+	    } catch (Exception e) {
+	    	;
+	    }
+
+	    if ( storeFilename == null ) {
+	    	// Now try in the user.home directory
+	    	try {
+	    		storeFilename = System.getProperty("user.home");
+		    	if ( storeFilename != null ) {
+		    		storeFilename += File.separator + ".tmap";
+		    	}
+	    	} catch (Exception e) {
+	    		;
+	    	}
+	    }
+
+	    if ( storeFilename == null ) {
+	    	// If all else fails, put it under the current working directory
+	    	storeFilename = ".tmap";
+	    }
+
+	    try {
+		    // Create any missing directory path for the store file
+	    	File storeDir = new File(storeFilename);
+	    	if ( ! storeDir.exists() ) {
+	    		if ( ! storeDir.mkdirs() ) {
+	    			throw new IOException();
+	    		}
+	    	}
+
+	    	// Add the store filename to the path
+	    	storeFilename += File.separator + "ThreddsBrowser.xml";
+	    } catch (Exception e) {
+			storeFilename = null;
+	    }
+
+	    return storeFilename;
+	}
+
+	/**
+	 * Starts the THREDDS catalog browser.  The first argument,
+	 * if given, is used as the initial catalog URL in the browser.
+	 */
+	public static void main(final String[] args) {
+		// Initialize the HTTPClient logger so that it won't complain
+		System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
+		System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
+		System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header", "fatal");
+		System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "fatal");
+
+		// Create the GUI in a separate thread managed by Swing
+        SwingUtilities.invokeLater(new Runnable() {
+        	@Override
+            public void run() {
+                ThreddsBrowserListener.createAndShowBrowser(args);
+            }
+        });
+	}
+
+}
diff --git a/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowserListener.java b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowserListener.java
new file mode 100644
index 0000000..2dc7905
--- /dev/null
+++ b/threddsBrowser/src/gov/noaa/pmel/ferret/threddsBrowser/ThreddsBrowserListener.java
@@ -0,0 +1,234 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowser;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Point;
+import java.awt.Window;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.Authenticator;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+
+import opendap.dap.DConnect2;
+
+import org.apache.commons.httpclient.HttpClient;
+
+import thredds.ui.UrlAuthenticatorDialog;
+
+import ucar.nc2.dataset.NetcdfDataset;
+import ucar.nc2.stream.CdmRemote;
+import ucar.nc2.ui.WmsViewer;
+import ucar.nc2.util.net.HttpClientManager;
+import ucar.unidata.io.http.HTTPRandomAccessFile;
+import ucar.util.prefs.PreferencesExt;
+import ucar.util.prefs.XMLStore;
+
+/**
+ * A listener for a ThreddsBrowser as well as the Window containing that Browser.
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class ThreddsBrowserListener extends WindowAdapter implements ActionListener {
+
+	/** XMLStore key for a Point giving the location of the main Window given to the browser */
+	public static final String WINDOW_LOCATION = "WindowLocation";
+
+	/** Window containing the ThreddsBrowser to listener for WindowClosing events */
+	private Window mainWindow;
+
+	/** ThreddsBrowser to listen to for Action events */
+	private ThreddsBrowser tBrowser;
+
+	/** Whether or not to use the selected dataset name in the ThreddsBrowser when an Action event occurs */ 
+	private boolean useDataset;
+
+	/** XMLStore to save the Window Location before closing the Window from either Action or WindowClosing events */
+	private XMLStore givenStore;
+
+	/**
+	 * Create a Listener for Action events from a ThreddsBrowser and WindowClosing events from the
+	 * Window containing that ThreddsBrowser.  
+	 * <ul>
+	 * <li>Action event if useDataset is true: the dataset name is retrieved from tBrowser and 
+	 * printed as a "USE ..." String to System.out, and the windowClosing method is then called.
+	 * If no dataset name is selected in tBrowser, an error dialog is posted and no further action 
+	 * is taken.  
+	 * <li>Action event if useDataset is false: the windowClosing method is just called.
+	 * <li>WindowClosing events (and when the windowClosing method is called from Action events): 
+	 * the current location of mainWindow as well as the setting of tBrowser are saved to the file 
+	 * that is backing givenStore, the window is closed, and the 
+	 * application exits.
+	 * <ul>
+	 * @param mainWindow the Window containing tBrowser.
+	 * @param tBrowser the ThreddsBrowser to use.
+	 * @param useDataset whether to use the selected dataset from tBrowser.
+	 * @param givenStore the XMLStore used to save current settings.
+	 */
+	public ThreddsBrowserListener(Window mainWindow, ThreddsBrowser tBrowser, boolean useDataset,  XMLStore givenStore) {
+		if ( mainWindow == null )
+			throw new NullPointerException("null Window given to the ThreddsBrowserListener constructor");
+		if ( tBrowser == null )
+			throw new NullPointerException("null ThreddsBrowser given to the ThreddsBrowserListener constructor");
+		if ( givenStore == null )
+			throw new NullPointerException("null XMLStore given to the ThreddsBrowserListener constructor");
+		this.mainWindow = mainWindow;
+		this.tBrowser = tBrowser;
+		this.useDataset = useDataset;
+		this.givenStore = givenStore;
+	}
+
+	/**
+	 * If useDataset was true in the creation of this Listener, the dataset name is retrieved
+	 * from the ThreddsBrowser and printed as a "USE ..." to System.out and the application exits.
+	 * If no dataset name is selected in the ThreddsBrowser, an error dialog is posted and no 
+	 * further action is taken.
+	 * If useDataset was false, the application just exits.
+	 */
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		if ( useDataset ) {
+			String datasetName = tBrowser.getDatasetName();
+			if ( datasetName == null ) {
+				JOptionPane.showMessageDialog(tBrowser, "No dataset is selected",
+											  "No Dataset Selected", JOptionPane.ERROR_MESSAGE);
+				return;
+			}
+			System.out.println("USE \"" + datasetName + "\"");
+			System.out.flush();
+		}
+		windowClosing(null);
+	}
+
+	/**
+	 * Saves the current location of the Window as well as the setting of the ThreddsBrowser
+	 * to the XMLStore used in the creation of this Listener.
+	 */
+	@Override
+	public void windowClosing(WindowEvent e) {
+		PreferencesExt prefs = givenStore.getPreferences();
+
+		// Save the location of main window
+        Point location = mainWindow.getLocation();
+        prefs.putBeanObject(WINDOW_LOCATION, location);
+
+        // Save the ThreddsBrowser's preferences
+		tBrowser.savePreferences(prefs);
+
+		// Save the store object to the original file
+		try {
+			givenStore.save();
+		} catch ( Exception exc ) {
+			; // don't care
+		}
+
+		// Close the window and exit the application
+		mainWindow.setVisible(false);
+		mainWindow.dispose();
+		System.exit(0);
+	}
+
+	/**
+	 * Creates and displays the ThreddsBrowser as well as initializes the 
+	 * HTTP client.  Any arguments given are passed on to the created
+	 * ThreddsBrowser selectLocation method.
+	 */
+	public static void createAndShowBrowser(final String[] args) {
+		// Create the window - leave the default close operation (HIDE_ON_CLOSE) 
+		// since we are providing a windowClosing event listener that calls System.exit
+		JFrame mainFrame = new JFrame("THREDDS Catalog Browser");
+		mainFrame.setLayout(new GridBagLayout());
+
+		// Get the default givenStore filename
+		String storeFilename = ThreddsBrowser.createDefaultStoreFilename();
+
+		// Open the givenStore of preferences
+		XMLStore store;
+		try {
+	    	store = XMLStore.createFromFile(storeFilename, null);
+	    } catch (Exception e) {
+	    	// Create a read-only empty givenStore
+			store = new XMLStore();
+	    }
+	    PreferencesExt prefs = store.getPreferences();
+
+	    // Create the ThreddsBrower and add it to mainFrame
+	    ThreddsBrowser tBrowser = new ThreddsBrowser(prefs, "FER_DATA_THREDDS");
+	    GridBagConstraints gbc = new GridBagConstraints();
+	    gbc.anchor = GridBagConstraints.NORTHWEST;
+	    gbc.gridx = 0;     gbc.gridy = 0;
+	    gbc.gridwidth = 1; gbc.gridheight = 1;
+	    gbc.weightx = 1.0; gbc.weighty = 1.0;
+	    gbc.fill = GridBagConstraints.BOTH;
+	    mainFrame.add(tBrowser, gbc);
+
+	    // Show the window
+		mainFrame.pack();
+		mainFrame.setVisible(true);
+
+		// Set the location of the main window
+		Point location = (Point) prefs.getBean(WINDOW_LOCATION, null);
+		if ( location == null ) {
+			location = new Point(50, 50);
+		}
+	    mainFrame.setLocation(location);
+
+	    // Add a listener for the Use Action events
+	    tBrowser.addUseActionListener(new ThreddsBrowserListener(mainFrame, tBrowser, true, store));
+
+	    // Add a listener for Cancel Action events and WindowClosing events 
+	    ThreddsBrowserListener cancelListener = new ThreddsBrowserListener(mainFrame, tBrowser, false, store);
+	    tBrowser.addCancelActionListener(cancelListener);
+		mainFrame.addWindowListener(cancelListener);
+
+		// Initialize the URL authenticator and HTTP client manager
+	    UrlAuthenticatorDialog provider = new UrlAuthenticatorDialog(mainFrame);
+	    Authenticator.setDefault(provider);
+	    HttpClient client = HttpClientManager.init(provider, "ThreddsBrowser");
+	    DConnect2.setHttpClient(client);
+	    HTTPRandomAccessFile.setHttpClient(client);
+	    CdmRemote.setHttpClient(client);
+	    NetcdfDataset.setHttpClient(client);
+	    WmsViewer.setHttpClient(client);
+
+	    // Pass the arguments on to the ThreddsBrowser's selectLocation method.
+	    // This brings up a LocationSelectorDialog if no arguments are given.
+	    tBrowser.selectLocation(args);
+	}
+
+}
diff --git a/threddsBrowser/toolsUI/toolsUI-4.1.jar b/threddsBrowser/toolsUI/toolsUI-4.1.jar
new file mode 100644
index 0000000..1c84548
Binary files /dev/null and b/threddsBrowser/toolsUI/toolsUI-4.1.jar differ
diff --git a/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestBrowserDefaults.java b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestBrowserDefaults.java
new file mode 100644
index 0000000..c753ed8
--- /dev/null
+++ b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestBrowserDefaults.java
@@ -0,0 +1,263 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowserTests;
+
+import static org.junit.Assert.*;
+import static org.junit.Assume.*;
+
+import gov.noaa.pmel.ferret.threddsBrowser.BrowserDefaults;
+
+import java.awt.Dimension;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+
+import org.junit.Test;
+
+import ucar.util.prefs.PreferencesExt;
+
+/**
+ * Tests for {@link BrowserDefaults}
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class TestBrowserDefaults {
+
+	/**
+	 * Test method for {@link BrowserDefaults#BrowserDefaults(PreferencesExt, String)}.
+	 */
+	@Test
+	public void testBrowserDefaults() {
+		// Test the (null,null) constructor
+		BrowserDefaults defs = new BrowserDefaults(null, null);
+		assertNotNull("BrowserDefaults(null,null)", defs);
+		Collection<String> locs = defs.getLocationStrings();
+		assertEquals("number of initial locations from (null,null)", 0, locs.size());
+		int defDividerLoc = defs.getDividerLocation();
+		assertTrue("divider location from (null,null) > 50", defDividerLoc > 50);
+		File localDir = defs.getLocalBrowseDir();
+		assertEquals("local browse directory from (null,null)", null, localDir);
+		String defExtsString = defs.getExtensionsString();
+		assertNotNull("extensions string from (null,null) not null", defExtsString);
+		Dimension defSize = defs.getBrowserSize();
+		assertNotNull("browser size from (null,null) not null", defSize);
+
+		// Test the constructor with an undefined environment variable
+		String envName = "JUNK498523851498";
+		String envVal = System.getenv(envName);
+		assertNull("made-up bizzare environment variable exists!", envVal);
+		defs = new BrowserDefaults(null, envName);
+		assertNotNull("BrowserDefaults(null," + envName + ")", defs);
+		locs = defs.getLocationStrings();
+		assertEquals("number of initial locations from (null," + envName + ")", 0, locs.size());
+		int dividerLoc = defs.getDividerLocation();
+		assertEquals("divider location from (null," + envName + ")", defDividerLoc, dividerLoc);
+		localDir = defs.getLocalBrowseDir();
+		assertEquals("local browse directory from (null," + envName + ")", null, localDir);
+		String extsString = defs.getExtensionsString();
+		assertEquals("extensions string from (null," + envName + ")", defExtsString, extsString);
+		Dimension size = defs.getBrowserSize();
+		assertEquals("browser size from (null," + envName + ")", defSize, size);
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveLocationsList(PreferencesExt, List<String>)}
+	 * and {@link BrowserDefaults#getLocationStrings()} without using an environment variable
+	 */
+	@Test
+	public void testSaveGetLocationStringsNoEnv() {
+		String[] locations = {"first", "second", "third", "fourth", "fifth"};
+		PreferencesExt prefs = new PreferencesExt(null, "");
+		BrowserDefaults.saveLocationsList(prefs, Arrays.asList(locations));
+		BrowserDefaults defs = new BrowserDefaults(prefs, null);
+		Collection<String> locsColl = defs.getLocationStrings();
+		assertEquals("number of locations", locations.length, locsColl.size());
+		int k = 0;
+		for (String loc : locsColl) {
+			assertEquals("location[" + k + "]", locations[k], loc);
+			k++;
+		}
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveLocationsList(PreferencesExt, List<String>)}
+	 * and {@link BrowserDefaults#getLocationStrings()} using the environment variable FER_DATA_THREDDS
+	 */
+	@Test
+	public void testSaveGetLocationStringsWithEnv() {
+		PreferencesExt prefs = new PreferencesExt(null, "");
+
+		// Use "FER_DATA_THREDDS as the environment variable to test (no System.setenv to create one)
+		String envName = "FER_DATA_THREDDS";
+		String envVal = System.getenv(envName);
+
+		// Following are not errors; just can't perform this test as expected
+		assumeNotNull(envVal);
+		assumeTrue( ! envVal.trim().isEmpty() );
+		assumeTrue( ! envVal.contains("\"") );
+		assumeTrue( ! envVal.contains("'") );
+
+		// Get the unique space-separated strings in the given order
+		LinkedHashSet<String> nameSet = new LinkedHashSet<String>(Arrays.asList(envVal.split("\\s+")));
+		ArrayList<String> nameList = new ArrayList<String>(nameSet);
+
+		// Get the locations from just using envName
+		BrowserDefaults defs = new BrowserDefaults(null, envName);
+		Collection<String> locsColl = defs.getLocationStrings();
+		assertEquals("number of locations from " + envName, nameList.size(), locsColl.size());
+		int numLocs = 0;
+		for (String location : locsColl) {
+			assertEquals("location[" + numLocs + "] from " + envName, nameList.get(numLocs), location);
+			numLocs++;
+		}
+
+		// Create a list of locations, one duplicating the last one from envName 
+		String myFirstLocation = "My silly first location";
+		String mySecondLocation = nameList.get(nameList.size() - 1);
+		ArrayList<String> prefLocs = new ArrayList<String>(2);
+		prefLocs.add(myFirstLocation);
+		prefLocs.add(mySecondLocation);
+
+		// Create a BrowserDefaults with this PreferenceExt and envName
+		BrowserDefaults.saveLocationsList(prefs, prefLocs);  // verify the old values are overwritten
+		defs = new BrowserDefaults(prefs, envName);
+		locsColl = defs.getLocationStrings();
+		assertEquals("number of locations from prefs and " + envName, nameList.size() + 1, locsColl.size());
+		numLocs = 0;
+		for (String location : locsColl) {
+			if ( numLocs == 0 )
+				assertEquals("location[0] from prefs and " + envName, myFirstLocation, location);
+			else if ( numLocs == 1 )
+				assertEquals("location[1] from prefs and " + envName, mySecondLocation, location);
+			else
+				assertEquals("location[" + numLocs + "] from prefs and " + envName, nameList.get(numLocs-2), location);
+			numLocs++;
+		}
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveDividerLocation(PreferencesExt, int)}
+	 * and {@link BrowserDefaults#getDividerLocation()}.
+	 */
+	@Test
+	public void testSaveGetDividerLocation() {
+		int loc = 789;
+		PreferencesExt prefs = new PreferencesExt(null, "");
+		BrowserDefaults.saveDividerLocation(prefs, loc);
+		BrowserDefaults defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved divider location", loc, defs.getDividerLocation());
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveLocalBrowseDir(PreferencesExt, File)}
+	 * and {@link BrowserDefaults#getLocalBrowseDir()}.
+	 */
+	@Test
+	public void testSaveGetLocalBrowseDir() throws IOException {
+		File tmpdir = File.createTempFile("temp_", "_dir");
+		PreferencesExt prefs = new PreferencesExt(null, "");
+		BrowserDefaults.saveLocalBrowseDir(prefs, tmpdir);
+		BrowserDefaults defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved local browse dir that is a file", null, defs.getLocalBrowseDir());
+		tmpdir.delete();
+		defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved local browse dir that does not exist", null, defs.getLocalBrowseDir());
+		tmpdir.mkdir();
+		defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved local browse dir that is a valid directory", tmpdir, defs.getLocalBrowseDir());
+		tmpdir.delete();
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveExtensionsString(PreferencesExt, String)}
+	 * and {@link BrowserDefaults#getExtensionsString()}.
+	 */
+	@Test
+	public void testSaveGetExtensionsString() {
+		String extsString = "this, that, and, the, other, thing";
+		PreferencesExt prefs = new PreferencesExt(null, "");
+		BrowserDefaults.saveExtensionsString(prefs, extsString);
+		BrowserDefaults defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved extensions string", extsString, defs.getExtensionsString());
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#saveBrowserSize(PreferencesExt, Dimension)}
+	 * and {@link BrowserDefaults#getBrowserSize()}.
+	 */
+	@Test
+	public void testSaveGetBrowserSize() {
+		Dimension size = new Dimension(234, 567);
+		PreferencesExt prefs = new PreferencesExt(null, "");
+		BrowserDefaults.saveBrowserSize(prefs, size);
+		BrowserDefaults defs = new BrowserDefaults(prefs, null);
+		assertEquals("saved browser size", size, defs.getBrowserSize());
+	}
+
+	/**
+	 * Test method for {@link BrowserDefaults#parseExtensionsString(String)}
+	 * and {@link BrowserDefaults#createExtensionsString(Collection)}.
+	 */
+	@Test
+	public void testParseCreateExtensionsString() {
+		String extsString = "this, that, and, the, other";
+		String complicatedString = "  this  that;and , the  ,other  ; ";
+		String[] extsArray = extsString.split(", ");
+
+		// Try a single string of extensions
+		Collection<String> extsColl = BrowserDefaults.parseExtensionsString(extsString);
+		assertEquals("number of extensions from a simple string", extsArray.length, extsColl.size());
+		for (int k = 0; k < extsArray.length; k++)
+		   assertTrue("collection contains extension " + extsArray[k], extsColl.contains(extsArray[k]));
+		String newStr = BrowserDefaults.createExtensionsString(extsColl);
+		assertEquals("extensions string from collection", extsString, newStr);
+
+		// Try a complicated string
+		extsColl = BrowserDefaults.parseExtensionsString(complicatedString);
+		assertEquals("number of extensions from a complicated string", extsArray.length, extsColl.size());
+		for (int k = 0; k < extsArray.length; k++)
+		   assertTrue("collection contains extension " + extsArray[k], extsColl.contains(extsArray[k]));
+		newStr = BrowserDefaults.createExtensionsString(extsColl);
+		assertEquals("extensions string from collection", extsString, newStr);
+
+		// Should work fine with an empty string or empty collection
+		extsColl = BrowserDefaults.parseExtensionsString("");
+		assertEquals("number of extensions from an empty string", 0, extsColl.size());
+		newStr = BrowserDefaults.createExtensionsString(extsColl);
+		assertEquals("extensions string from empty collection", "", newStr);
+	}
+
+}
diff --git a/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestExtensionFileFilter.java b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestExtensionFileFilter.java
new file mode 100644
index 0000000..3e5d2a9
--- /dev/null
+++ b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestExtensionFileFilter.java
@@ -0,0 +1,143 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowserTests;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import gov.noaa.pmel.ferret.threddsBrowser.ExtensionFileFilter;
+
+import org.junit.Test;
+
+/**
+ * Tests of {@link ExtensionFileFilter}
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class TestExtensionFileFilter {
+
+	/**
+	 * Test method for {@link ExtensionFileFilter#ExtensionFileFilter()}.
+	 * @throws IOException 
+	 */
+	@Test
+	public void testExtensionFileFilter() throws IOException {
+		ExtensionFileFilter filter = new ExtensionFileFilter();
+		assertNotNull("null returned from empty constructor", filter);
+		assertEquals("size of filter set from empty constructor", 0, filter.size());
+
+		// Check that everything gets accepted
+		File tmpdir = File.createTempFile("test_", "_dir");
+		tmpdir.delete();
+		tmpdir.mkdir();
+		File afile = new File(tmpdir, "afile.txt");
+		afile.createNewFile();
+		File bfile = new File(tmpdir, "bfile.dat");
+		bfile.createNewFile();
+		File cfile = new File(tmpdir, "cfile");
+		cfile.createNewFile();
+		File subdir = new File(tmpdir, "subdir");
+		subdir.mkdir();
+
+		File[] contents = tmpdir.listFiles(filter);
+		assertEquals("number of filtered files", 4, contents.length);
+
+		subdir.delete();
+		cfile.delete();
+		bfile.delete();
+		afile.delete();
+		tmpdir.delete();
+	}
+
+	/**
+	 * Test method for {@link ExtensionFileFilter#ExtensionFileFilter(Set)}.
+	 * @throws IOException 
+	 */
+	@Test
+	public void testExtensionFileFilterSetOfString() throws IOException {
+		List<String> extList = Arrays.asList("txt", "doc", "txt");
+		ExtensionFileFilter filter  = new ExtensionFileFilter(extList);
+		assertNotNull("null returned from constructor with a List", filter);
+		assertEquals("size of filter with List constructor", 2, filter.size());
+
+		// Check that things are filter appropriately
+		File tmpdir = File.createTempFile("test_", "_dir");
+		tmpdir.delete();
+		tmpdir.mkdir();
+		File afile = new File(tmpdir, "afile.txt");
+		afile.createNewFile();
+		File bfile = new File(tmpdir, "bfile.dat");
+		bfile.createNewFile();
+		File cfile = new File(tmpdir, "cfile");
+		cfile.createNewFile();
+		File subdir = new File(tmpdir, "subdir");
+		subdir.mkdir();
+
+		File[] contents = tmpdir.listFiles(filter);
+		assertEquals("number of filtered files", 2, contents.length);
+
+		List<File> contentsList = Arrays.asList(contents);
+		assertTrue("file with listed extension accepted", contentsList.contains(afile));
+		assertFalse("file with unlisted extension accepted", contentsList.contains(bfile));
+		assertFalse("file with no extension accepted", contentsList.contains(cfile));
+		assertTrue("directory accepted", contentsList.contains(subdir));
+
+		subdir.delete();
+		cfile.delete();
+		bfile.delete();
+		afile.delete();
+		tmpdir.delete();
+	}
+
+	/**
+	 * Test method for {@link ExtensionFileFilter#accept(File)}.
+	 */
+	@Test
+	public void testAccept() {
+		ExtensionFileFilter filter  = new ExtensionFileFilter();
+		assertTrue("non-existant file with an extension using filer with no extensions", filter.accept(new File("afile.txt")));
+		assertTrue("non-existant file with no extension using filter with no extensions", filter.accept(new File("cfile")));
+
+		List<String> extList = Arrays.asList("txt", "doc");
+		filter  = new ExtensionFileFilter(extList);
+		assertTrue("file with listed extension", filter.accept(new File("afile.txt")));
+		assertFalse("file with unlisted extension", filter.accept(new File("bfile.dat")));
+		assertFalse("file with no extension using filter with extensions", filter.accept(new File("cfile")));
+	}
+
+}
diff --git a/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanMonitor.java b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanMonitor.java
new file mode 100644
index 0000000..9707a96
--- /dev/null
+++ b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanMonitor.java
@@ -0,0 +1,197 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowserTests;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import gov.noaa.pmel.ferret.threddsBrowser.LocalDirTreeScanMonitor;
+
+import org.junit.Test;
+
+/**
+ * Test of {@link LocalDirTreeScanMonitor}
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class TestLocalDirTreeScanMonitor {
+
+	/**
+	 * Test method for {@link LocalDirTreeScanMonitor#truncatedPathname} with no parent directory
+	 */
+	@Test
+	public void testTruncatedPathnameNoParent() {
+		final String maxTruncName = "..." + File.separator + "pathname";
+		final String absFullName = File.separator + "absolute" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String partTruncAbsName = File.separator + "absolute" + File.separator + "..." + File.separator + "pathname";
+		final String relFullName = "relative" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String partTruncRelName = "relative" + File.separator + "..." + File.separator + "pathname";
+		final String simpleName = "simple";
+		final String shortName = File.separator + "a" + File.separator + "pathname";
+		final String complicatedName = File.separator + "an" + File.separator + "extra" + File.separator + "long"    + File.separator + "path"
+									 + File.separator + "to" + File.separator + "test"  + File.separator + "against" + File.separator + "pathname";
+		final String partTruncComplicatedName = File.separator + "an" + File.separator + "extra" + File.separator + "..." 
+									 + File.separator + "against" + File.separator + "pathname";
+
+		// Absolute paths
+		File f = new File(absFullName);
+		// No truncation
+		String name = LocalDirTreeScanMonitor.truncatedPathname(f, null, absFullName.length());
+		assertEquals("untruncated absolute pathname", absFullName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, -1);
+		assertEquals("max truncated absolute pathname", maxTruncName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, partTruncAbsName.length() + 5);
+		assertEquals("partially truncated absolute pathname", partTruncAbsName, name);
+
+		// Relative paths
+		f = new File(relFullName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, relFullName.length() + 30);
+		assertEquals("untruncated relative pathname", relFullName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, -1);
+		assertEquals("max truncated relative pathname", maxTruncName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, partTruncRelName.length());
+		assertEquals("partially truncated relative pathname", partTruncRelName, name);
+
+		// Just a name with no path
+		f = new File(simpleName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, simpleName.length());
+		assertEquals("untruncated simple name", simpleName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, -1);
+		assertEquals("max truncated simple name", simpleName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, simpleName.length() - 1);
+		assertEquals("partially truncated simple name", simpleName, name);
+
+		// Short pathname
+		f = new File(shortName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, shortName.length());
+		assertEquals("untruncated short name", shortName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, -1);
+		assertEquals("max truncated short name", shortName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, simpleName.length() - 1);
+		assertEquals("partially truncated short name", shortName, name);
+
+
+		// Name with many path components
+		f = new File(complicatedName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, complicatedName.length());
+		assertEquals("untruncated complicated pathname", complicatedName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, -1);
+		assertEquals("max truncated complicated pathname", maxTruncName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, null, partTruncComplicatedName.length() + 1);
+		assertEquals("partially truncated complicated pathname", partTruncComplicatedName, name);
+	}
+
+	/**
+	 * Test method for {@link LocalDirTreeScanMonitor#truncatedPathname} with no parent directory
+	 */
+	@Test
+	public void testTruncatedPathnameWithParent() {
+		final String maxTruncName = "..." + File.separator + "pathname";
+		final String absParentName = File.separator + "home" + File.separator + "parent";
+		final String absFullName = absParentName + File.separator + "absolute" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String relAbsFullName = "parent" + File.separator + "absolute" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String partTruncAbsName = "parent" + File.separator + "absolute" + File.separator + "..." + File.separator + "pathname";
+		final String relParentName = "home" + File.separator + "parent";
+		final String relFullName = relParentName + File.separator + "relative" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String relRelFullName = "parent" + File.separator + "relative" + File.separator + "testing" + File.separator + "example" + File.separator + "pathname";
+		final String partTruncRelName = "parent" + File.separator + "..." + File.separator + "pathname";
+		final String simpleName = "simple";
+		final String shortName = File.separator + "a" + File.separator + "pathname";
+
+		// Absolute paths
+		File p = new File(absParentName);
+		File f = new File(absFullName);
+		// No truncation
+		String name = LocalDirTreeScanMonitor.truncatedPathname(f, p, absFullName.length());
+		assertEquals("untruncated absolute pathname", relAbsFullName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, -1);
+		assertEquals("max truncated absolute pathname", maxTruncName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, partTruncAbsName.length() + 5);
+		assertEquals("partially truncated absolute pathname", partTruncAbsName, name);
+
+		// Relative paths
+		p = new File(relParentName);
+		f = new File(relFullName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, relFullName.length() + 30);
+		assertEquals("untruncated relative pathname", relRelFullName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, -1);
+		assertEquals("max truncated relative pathname", maxTruncName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, partTruncRelName.length());
+		assertEquals("partially truncated relative pathname", partTruncRelName, name);
+
+		// Just a name with no path
+		f = new File(simpleName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, simpleName.length());
+		assertEquals("untruncated simple name", simpleName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, -1);
+		assertEquals("max truncated simple name", simpleName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, simpleName.length() - 1);
+		assertEquals("partially truncated simple name", simpleName, name);
+
+		// Short pathname
+		f = new File(shortName);
+		// No truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, shortName.length());
+		assertEquals("untruncated short name", shortName, name);
+		// Maximum truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, -1);
+		assertEquals("max truncated short name", shortName, name);
+		// Partial truncation
+		name = LocalDirTreeScanMonitor.truncatedPathname(f, p, simpleName.length() - 1);
+		assertEquals("partially truncated short name", shortName, name);
+	}
+
+}
diff --git a/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanner.java b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanner.java
new file mode 100644
index 0000000..a0a3fd2
--- /dev/null
+++ b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestLocalDirTreeScanner.java
@@ -0,0 +1,239 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowserTests;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+import gov.noaa.pmel.ferret.threddsBrowser.LocalDirTreeScanner;
+
+import org.junit.Test;
+
+import thredds.catalog.InvAccess;
+import thredds.catalog.InvCatalogImpl;
+import thredds.catalog.InvDataset;
+
+/**
+ * Test of {@link LocalDirTreeScanner}
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class TestLocalDirTreeScanner {
+
+	/**
+	 * Test method for {@link LocalDirTreeScanner#LocalDirTreeScanner(File)}.
+	 */
+	@Test
+	public void testLocalDirTreeScanner() throws IOException {
+		// Try constructor with null
+		try {
+			new LocalDirTreeScanner(null, null);
+			fail("constructor with null did not throw an exception");
+		} catch (NullPointerException e) {
+			;
+		}
+
+		// Try constructor with a file
+		File tmpdir = File.createTempFile("test_", "_tmpdir");
+		try {
+			new LocalDirTreeScanner(tmpdir, null);
+			fail("constructor with a file did not throw an exception");
+		} catch (IOException e) {
+			;
+		}
+
+		// Try constructor with directory name that does not exist
+		tmpdir.delete();
+		try {
+			new LocalDirTreeScanner(tmpdir, null);
+			fail("constructor with a directory that does not exist did not throw an exception");
+		} catch (IOException e) {
+			;
+		}
+
+		// Try constructor with a valid directory
+		tmpdir.mkdir();
+		LocalDirTreeScanner scanner = new LocalDirTreeScanner(tmpdir, null);
+		assertNotNull("constructor with a valid directory returned null", scanner);
+			
+		tmpdir.delete();
+	}
+
+	/**
+	 * Test method for {@link LocalDirTreeScanner#generateCatalog(FileFilter)}
+	 * and {@link LocalDirTreeScanner#getNumCatalogEntries()}.
+	 */
+	@Test
+	public void testGenerateCatalog() throws IOException, ExecutionException, InterruptedException {
+		// Create a directory tree
+		File tmpdir = File.createTempFile("test_", "_tmpdir");
+		tmpdir.delete();
+		tmpdir.mkdir();
+
+		File afile = new File(tmpdir, "a_file");
+		afile.createNewFile();
+
+		File zfile = new File(tmpdir, "z_file");
+		zfile.createNewFile();
+
+		File subdir = new File(tmpdir, "subdir");
+		subdir.mkdir();
+
+		File subfile = new File(subdir, "subfile");
+		subfile.createNewFile();
+
+		File asubfile = new File(subdir, "a_subfile");
+		asubfile.createNewFile();
+
+		// Create a scanner for this directory tree with no filter
+		LocalDirTreeScanner scanner = new LocalDirTreeScanner(tmpdir, null);
+		assertNotNull("constructor with a valid directory returned null", scanner);
+
+		// Try scanning with no filter
+		scanner.execute();
+		InvCatalogImpl catalog = scanner.get();
+		assertNotNull("generated catalog with null filter was null", catalog);
+
+		// Check the reported number of catalog entries 
+		assertEquals("number of catalog entries", 5, scanner.getNumCatalogEntries());
+
+		// Top-level dataset is the directory itself
+		List<InvDataset> datasets = catalog.getDatasets();
+		assertEquals("Number of first-level datasets", 1, datasets.size());
+
+		assertEquals("ID of first-level dataset", tmpdir.getPath(), datasets.get(0).getID());
+		List<InvAccess> access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first-level dataset", 0, access.size());
+		assertEquals("Number of datasets under the first-level dataset", 3, datasets.get(0).getDatasets().size());
+
+		// Next level is the sorted contents of the directory
+		datasets = datasets.get(0).getDatasets();
+
+		assertEquals("ID of first second-level dataset", afile.getPath(), datasets.get(0).getID());
+		access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first second-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the first second-level datset", 0, datasets.get(0).getDatasets().size());
+
+		assertEquals("ID of second second-level dataset", subdir.getPath(), datasets.get(1).getID());
+		access = datasets.get(1).getAccess();
+		assertEquals("Number of accesses for second second-level dataset", 0, access.size());
+		assertEquals("Number of datasets under the second second-level datset", 2, datasets.get(1).getDatasets().size());
+
+		assertEquals("ID of third second-level dataset", zfile.getPath(), datasets.get(2).getID());
+		access = datasets.get(2).getAccess();
+		assertEquals("Number of accesses for third second-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the third second-level datset", 0, datasets.get(2).getDatasets().size());
+
+		// Now the contents of subdir
+		datasets = datasets.get(1).getDatasets();
+		
+		assertEquals("ID of first third-level dataset", asubfile.getPath(), datasets.get(0).getID());
+		access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first third-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the first third-level datset", 0, datasets.get(0).getDatasets().size());
+
+		assertEquals("ID of second third-level dataset", subfile.getPath(), datasets.get(1).getID());
+		access = datasets.get(1).getAccess();
+		assertEquals("Number of accesses for second third-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the second third-level datset", 0, datasets.get(1).getDatasets().size());
+
+		// Try scanning with a filter
+		scanner = new LocalDirTreeScanner(tmpdir, new FileFilter() {
+			@Override
+			public boolean accept(File pathname) {
+				// Accept all directories
+				if ( pathname.isDirectory() )
+					return true;
+				// Accept files with an underscore in their name
+				if ( pathname.getName().contains("_") )
+					return true;
+				// If made it here, don't accept it
+				return false;
+			}
+		});
+		assertNotNull("constructor with a valid directory returned null", scanner);
+		scanner.execute();
+		catalog = scanner.get();
+
+		// Check the reported number of catalog entries 
+		assertEquals("number of catalog entries", 4, scanner.getNumCatalogEntries());
+
+		// Top-level dataset is the directory itself
+		datasets = catalog.getDatasets();
+		assertEquals("Number of first-level datasets", 1, datasets.size());
+
+		assertEquals("ID of first-level dataset", tmpdir.getPath(), datasets.get(0).getID());
+		access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first-level dataset", 0, access.size());
+		assertEquals("Number of datasets under the first-level dataset", 3, datasets.get(0).getDatasets().size());
+
+		// Next level is the sorted contents of the directory
+		datasets = datasets.get(0).getDatasets();
+
+		assertEquals("ID of first second-level dataset", afile.getPath(), datasets.get(0).getID());
+		access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first second-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the first second-level datset", 0, datasets.get(0).getDatasets().size());
+
+		assertEquals("ID of second second-level dataset", subdir.getPath(), datasets.get(1).getID());
+		access = datasets.get(1).getAccess();
+		assertEquals("Number of accesses for second second-level dataset", 0, access.size());
+		assertEquals("Number of datasets under the second second-level datset", 1, datasets.get(1).getDatasets().size());
+
+		assertEquals("ID of third second-level dataset", zfile.getPath(), datasets.get(2).getID());
+		access = datasets.get(2).getAccess();
+		assertEquals("Number of accesses for third second-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the third second-level datset", 0, datasets.get(2).getDatasets().size());
+
+		// Now the contents of subdir
+		datasets = datasets.get(1).getDatasets();
+		
+		assertEquals("ID of first third-level dataset", asubfile.getPath(), datasets.get(0).getID());
+		access = datasets.get(0).getAccess();
+		assertEquals("Number of accesses for first third-level dataset", 1, access.size());
+		assertEquals("Number of datasets under the first third-level datset", 0, datasets.get(0).getDatasets().size());
+
+		asubfile.delete();
+		subfile.delete();
+		subdir.delete();
+		zfile.delete();
+		afile.delete();
+		tmpdir.delete();
+	}
+
+}
diff --git a/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestThreddsBrowser.java b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestThreddsBrowser.java
new file mode 100644
index 0000000..4c3a971
--- /dev/null
+++ b/threddsBrowser/unittests/gov/noaa/pmel/ferret/threddsBrowserTests/TestThreddsBrowser.java
@@ -0,0 +1,65 @@
+/**
+ *  This software was developed by the Thermal Modeling and Analysis
+ *  Project(TMAP) of the National Oceanographic and Atmospheric
+ *  Administration's (NOAA) Pacific Marine Environmental Lab(PMEL),
+ *  hereafter referred to as NOAA/PMEL/TMAP.
+ *
+ *  Access and use of this software shall impose the following
+ *  obligations and understandings on the user. The user is granted the
+ *  right, without any fee or cost, to use, copy, modify, alter, enhance
+ *  and distribute this software, and any derivative works thereof, and
+ *  its supporting documentation for any purpose whatsoever, provided
+ *  that this entire notice appears in all copies of the software,
+ *  derivative works and supporting documentation.  Further, the user
+ *  agrees to credit NOAA/PMEL/TMAP in any publications that result from
+ *  the use of this software or in any product that includes this
+ *  software. The names TMAP, NOAA and/or PMEL, however, may not be used
+ *  in any advertising or publicity to endorse or promote any products
+ *  or commercial entity unless specific written permission is obtained
+ *  from NOAA/PMEL/TMAP. The user also understands that NOAA/PMEL/TMAP
+ *  is not obligated to provide the user with any support, consulting,
+ *  training or assistance of any kind with regard to the use, operation
+ *  and performance of this software nor to provide the user with any
+ *  updates, revisions, new versions or "bug fixes".
+ *
+ *  THIS SOFTWARE IS PROVIDED BY NOAA/PMEL/TMAP "AS IS" AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED. IN NO EVENT SHALL NOAA/PMEL/TMAP BE LIABLE FOR ANY SPECIAL,
+ *  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. 
+ */
+package gov.noaa.pmel.ferret.threddsBrowserTests;
+
+import static org.junit.Assert.*;
+
+import gov.noaa.pmel.ferret.threddsBrowser.ThreddsBrowser;
+
+import java.io.File;
+
+import org.junit.Test;
+
+/**
+ * Tests for non-UI methods of {@link ThreddsBrowser}
+ * @author Karl M. Smith - karl.smith (at) noaa.gov
+ */
+public class TestThreddsBrowser {
+
+	/**
+	 * Test method for {@link ThreddsBrowser#createDefaultStoreFilename()}.
+	 */
+	@Test
+	public void testCreateDefaultStoreFilename() {
+		String storeName = ThreddsBrowser.createDefaultStoreFilename();
+		assertNotNull("Default store name", storeName);
+		File storeFile = new File(storeName);
+		assertEquals("store filename", "ThreddsBrowser.xml", storeFile.getName());
+		File parentDir = storeFile.getParentFile();
+		assertTrue("Unexpected store file parent directory: " + parentDir.getName(), 
+				   "TMAP".equals(parentDir.getName()) || ".tmap".equals(parentDir.getName()));
+		assertTrue("Store file parent directory exists", parentDir.isDirectory());
+	}
+
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyferret.git



More information about the debian-science-commits mailing list